diff --git a/package.json b/package.json index 294261979aeaf..ab44fd105f344 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "url": "https://develop.svn.wordpress.org/trunk" }, "gutenberg": { - "sha": "7b95ee96b54de2e35886971ccf7eb449c324c830", + "sha": "be6a50be6834e922b9db12c75c9a2cd817b2db59", "ghcrRepo": "WordPress/gutenberg/gutenberg-wp-develop-build" }, "engines": { diff --git a/src/wp-includes/assets/icon-library-manifest.php b/src/wp-includes/assets/icon-library-manifest.php index c4bbc83af2b5b..10b34a0b86a83 100644 --- a/src/wp-includes/assets/icon-library-manifest.php +++ b/src/wp-includes/assets/icon-library-manifest.php @@ -54,13 +54,13 @@ 'audio' => array( 'label' => _x( 'Audio', 'icon label' ), 'filePath' => 'audio.svg', - 'collections' => array( 'core' ), + 'collections' => array( 'core', 'core-admin' ), 'keywords' => array( _x( 'music', 'icon keyword' ), _x( 'note', 'icon keyword' ) ), ), 'bell' => array( 'label' => _x( 'Bell', 'icon label' ), 'filePath' => 'bell.svg', - 'collections' => array( 'core' ), + 'collections' => array( 'core', 'core-admin' ), ), 'block-default' => array( 'label' => _x( 'Block Default', 'icon label' ), @@ -85,7 +85,7 @@ 'calendar' => array( 'label' => _x( 'Calendar', 'icon label' ), 'filePath' => 'calendar.svg', - 'collections' => array( 'core' ), + 'collections' => array( 'core', 'core-admin' ), ), 'capture-photo' => array( 'label' => _x( 'Capture Photo', 'icon label' ), @@ -100,7 +100,7 @@ 'cart' => array( 'label' => _x( 'Cart', 'icon label' ), 'filePath' => 'cart.svg', - 'collections' => array( 'core' ), + 'collections' => array( 'core', 'core-admin' ), ), 'category' => array( 'label' => _x( 'Category', 'icon label' ), @@ -116,7 +116,7 @@ 'chart-bar' => array( 'label' => _x( 'Chart Bar', 'icon label' ), 'filePath' => 'chart-bar.svg', - 'collections' => array( 'core' ), + 'collections' => array( 'core', 'core-admin' ), ), 'check' => array( 'label' => _x( 'Check', 'icon label' ), @@ -212,7 +212,7 @@ 'envelope' => array( 'label' => _x( 'Envelope', 'icon label' ), 'filePath' => 'envelope.svg', - 'collections' => array( 'core' ), + 'collections' => array( 'core', 'core-admin' ), 'keywords' => array( _x( 'email', 'icon keyword' ), _x( 'letter', 'icon keyword' ), _x( 'post', 'icon keyword' ) ), ), 'error' => array( @@ -235,7 +235,7 @@ 'gallery' => array( 'label' => _x( 'Gallery', 'icon label' ), 'filePath' => 'gallery.svg', - 'collections' => array( 'core' ), + 'collections' => array( 'core', 'core-admin' ), ), 'group' => array( 'label' => _x( 'Group', 'icon label' ), @@ -250,7 +250,7 @@ 'help' => array( 'label' => _x( 'Help', 'icon label' ), 'filePath' => 'help.svg', - 'collections' => array( 'core' ), + 'collections' => array( 'core', 'core-admin' ), ), 'home' => array( 'label' => _x( 'Home', 'icon label' ), @@ -260,7 +260,7 @@ 'image' => array( 'label' => _x( 'Image', 'icon label' ), 'filePath' => 'image.svg', - 'collections' => array( 'core' ), + 'collections' => array( 'core', 'core-admin' ), ), 'info' => array( 'label' => _x( 'Info', 'icon label' ), @@ -285,7 +285,7 @@ 'map-marker' => array( 'label' => _x( 'Map Marker', 'icon label' ), 'filePath' => 'map-marker.svg', - 'collections' => array( 'core' ), + 'collections' => array( 'core', 'core-admin' ), ), 'media' => array( 'label' => _x( 'Media', 'icon label' ), @@ -330,7 +330,7 @@ 'payment' => array( 'label' => _x( 'Payment', 'icon label' ), 'filePath' => 'payment.svg', - 'collections' => array( 'core' ), + 'collections' => array( 'core', 'core-admin' ), ), 'pencil' => array( 'label' => _x( 'Pencil', 'icon label' ), @@ -376,17 +376,17 @@ 'quote' => array( 'label' => _x( 'Quote', 'icon label' ), 'filePath' => 'quote.svg', - 'collections' => array( 'core' ), + 'collections' => array( 'core', 'core-admin' ), ), 'receipt' => array( 'label' => _x( 'Receipt', 'icon label' ), 'filePath' => 'receipt.svg', - 'collections' => array( 'core' ), + 'collections' => array( 'core', 'core-admin' ), ), 'rss' => array( 'label' => _x( 'RSS', 'icon label' ), 'filePath' => 'rss.svg', - 'collections' => array( 'core' ), + 'collections' => array( 'core', 'core-admin' ), ), 'scheduled' => array( 'label' => _x( 'Scheduled', 'icon label' ), @@ -411,12 +411,12 @@ 'share' => array( 'label' => _x( 'Share', 'icon label' ), 'filePath' => 'share.svg', - 'collections' => array( 'core' ), + 'collections' => array( 'core', 'core-admin' ), ), 'shield' => array( 'label' => _x( 'Shield', 'icon label' ), 'filePath' => 'shield.svg', - 'collections' => array( 'core' ), + 'collections' => array( 'core', 'core-admin' ), ), 'shuffle' => array( 'label' => _x( 'Shuffle', 'icon label' ), @@ -447,7 +447,7 @@ 'store' => array( 'label' => _x( 'Store', 'icon label' ), 'filePath' => 'store.svg', - 'collections' => array( 'core' ), + 'collections' => array( 'core', 'core-admin' ), ), 'styles' => array( 'label' => _x( 'Styles', 'icon label' ), @@ -477,7 +477,7 @@ 'tag' => array( 'label' => _x( 'Tag', 'icon label' ), 'filePath' => 'tag.svg', - 'collections' => array( 'core' ), + 'collections' => array( 'core', 'core-admin' ), ), 'tip' => array( 'label' => _x( 'Tip', 'icon label' ), diff --git a/src/wp-includes/assets/script-loader-packages.php b/src/wp-includes/assets/script-loader-packages.php index d25684f47cc98..71748149f75eb 100644 --- a/src/wp-includes/assets/script-loader-packages.php +++ b/src/wp-includes/assets/script-loader-packages.php @@ -4,7 +4,7 @@ 'wp-dom-ready', 'wp-i18n' ), - 'version' => '5faef02d497f248e93ee' + 'version' => '31c6cec5a4ff7aff483d' ), 'annotations.js' => array( 'dependencies' => array( @@ -21,7 +21,7 @@ 'wp-private-apis', 'wp-url' ), - 'version' => 'd680fe82a7a89a9c6337' + 'version' => '6cf932e67c46d9f2e92d' ), 'autop.js' => array( 'dependencies' => array( @@ -67,7 +67,7 @@ 'wp-url', 'wp-warning' ), - 'version' => '6d6b3181a753252387e7' + 'version' => '2cd675763a8218c966ec' ), 'block-editor.js' => array( 'dependencies' => array( @@ -105,7 +105,7 @@ 'wp-url', 'wp-warning' ), - 'version' => '6e282539cf0a135ed4a5' + 'version' => 'dbc24ecd4192ebc3199c' ), 'block-library.js' => array( 'dependencies' => array( @@ -151,7 +151,7 @@ 'import' => 'dynamic' ) ), - 'version' => '9442f80186e1fd6c9d4b' + 'version' => '817d35ef1e7591ec131b' ), 'block-serialization-default-parser.js' => array( 'dependencies' => array( @@ -184,7 +184,7 @@ 'wp-shortcode', 'wp-warning' ), - 'version' => '3a5d55524352cd1635f7' + 'version' => '329805e87105829e0168' ), 'commands.js' => array( 'dependencies' => array( @@ -201,7 +201,7 @@ 'wp-primitives', 'wp-private-apis' ), - 'version' => '0f782aaf1624cdb1148e' + 'version' => 'bfadfc4e96de15d6f689' ), 'components.js' => array( 'dependencies' => array( @@ -226,7 +226,7 @@ 'wp-theme', 'wp-warning' ), - 'version' => 'b719ac135662ae191dd9' + 'version' => '7ee05eade9dc4626c51a' ), 'compose.js' => array( 'dependencies' => array( @@ -240,7 +240,7 @@ 'wp-private-apis', 'wp-undo-manager' ), - 'version' => '502412777bc436c79a5e' + 'version' => '2c882cef80a075bd7c3d' ), 'core-commands.js' => array( 'dependencies' => array( @@ -282,7 +282,7 @@ 'wp-url', 'wp-warning' ), - 'version' => '85a2af40c63fbc42dfd4' + 'version' => 'd2b82f6369d5503e99bb' ), 'customize-widgets.js' => array( 'dependencies' => array( @@ -318,7 +318,7 @@ 'import' => 'static' ) ), - 'version' => 'b8cdb457de36ea41f05c' + 'version' => '50c2d8139dc39c1e047a' ), 'data.js' => array( 'dependencies' => array( @@ -358,7 +358,7 @@ 'dependencies' => array( 'wp-deprecated' ), - 'version' => 'd72034b45da1dc03f5fb' + 'version' => 'd9b90cd4513d2092fd3c' ), 'dom-ready.js' => array( 'dependencies' => array( @@ -409,7 +409,7 @@ 'import' => 'static' ) ), - 'version' => '2c15b75d60d41653fe34' + 'version' => 'b4d9c2d937873b8b234f' ), 'edit-site.js' => array( 'dependencies' => array( @@ -449,8 +449,7 @@ 'wp-theme', 'wp-url', 'wp-warning', - 'wp-widgets', - 'wp-wordcount' + 'wp-widgets' ), 'module_dependencies' => array( array( @@ -458,7 +457,7 @@ 'import' => 'static' ) ), - 'version' => '8690337206dfcb4ce13d' + 'version' => 'd95ffc404eed69f201eb' ), 'edit-widgets.js' => array( 'dependencies' => array( @@ -500,7 +499,7 @@ 'import' => 'static' ) ), - 'version' => '09222c649dc37fa9ac75' + 'version' => '3a5bc43bc625e0f5774a' ), 'editor.js' => array( 'dependencies' => array( @@ -522,7 +521,6 @@ 'wp-deprecated', 'wp-dom', 'wp-element', - 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', @@ -551,7 +549,7 @@ 'import' => 'static' ) ), - 'version' => 'a4fe21d0704817acc70d' + 'version' => '4b354a6b3a4c4ee3948b' ), 'element.js' => array( 'dependencies' => array( @@ -593,7 +591,7 @@ 'import' => 'dynamic' ) ), - 'version' => '8a12998b72d8407956ee' + 'version' => '80364106dc5cdf6f30e0' ), 'hooks.js' => array( 'dependencies' => array( @@ -672,15 +670,26 @@ 'wp-url', 'wp-warning' ), - 'version' => '688e248d5d924b36f889' + 'version' => '67363f8f10fba326506c' ), 'notices.js' => array( 'dependencies' => array( + 'react', + 'react-dom', 'react-jsx-runtime', + 'wp-a11y', 'wp-components', - 'wp-data' + 'wp-compose', + 'wp-data', + 'wp-deprecated', + 'wp-element', + 'wp-i18n', + 'wp-primitives', + 'wp-private-apis', + 'wp-theme', + 'wp-warning' ), - 'version' => 'c09a068fdab0eb465e14' + 'version' => 'a8a701350bc0355b661a' ), 'nux.js' => array( 'dependencies' => array( @@ -711,7 +720,7 @@ 'wp-url', 'wp-warning' ), - 'version' => '6738120a1e2a12899699' + 'version' => 'ced901bac0e8160bedae' ), 'plugins.js' => array( 'dependencies' => array( @@ -745,7 +754,7 @@ 'dependencies' => array( 'wp-api-fetch' ), - 'version' => 'a34abbdacd8f50f9acb1' + 'version' => '63049460a74cb385aa0a' ), 'primitives.js' => array( 'dependencies' => array( @@ -764,7 +773,7 @@ 'dependencies' => array( ), - 'version' => 'c12220e72e4bcdfac6f3' + 'version' => '0286c29a68e664667316' ), 'react-i18n.js' => array( 'dependencies' => array( @@ -800,7 +809,7 @@ 'wp-keycodes', 'wp-private-apis' ), - 'version' => 'd04c731671320d12f4e9' + 'version' => '961958792146058e5f18' ), 'router.js' => array( 'dependencies' => array( @@ -824,7 +833,7 @@ 'wp-i18n', 'wp-url' ), - 'version' => '3ddc6eaa634c653fb483' + 'version' => '93e0b8da5b06ea5406ab' ), 'shortcode.js' => array( 'dependencies' => array( @@ -836,7 +845,7 @@ 'dependencies' => array( ), - 'version' => '7d2c0a2a9e5ae3f8e1c9' + 'version' => '6500509f32193fe14392' ), 'theme.js' => array( 'dependencies' => array( @@ -868,8 +877,7 @@ 'wp-data', 'wp-element', 'wp-i18n', - 'wp-private-apis', - 'wp-url' + 'wp-private-apis' ), 'module_dependencies' => array( array( @@ -881,13 +889,13 @@ 'import' => 'dynamic' ) ), - 'version' => '86068d5116da27ca40a5' + 'version' => '4bd74c9d859a5ffe1e31' ), 'url.js' => array( 'dependencies' => array( ), - 'version' => '65e1ab123ef3bf825dea' + 'version' => '3c0d9743cc6cd9591281' ), 'viewport.js' => array( 'dependencies' => array( @@ -905,7 +913,10 @@ ), 'widgets.js' => array( 'dependencies' => array( + 'react', + 'react-dom', 'react-jsx-runtime', + 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', @@ -916,9 +927,12 @@ 'wp-element', 'wp-i18n', 'wp-notices', - 'wp-primitives' + 'wp-primitives', + 'wp-private-apis', + 'wp-theme', + 'wp-warning' ), - 'version' => '27c5c0b8c8fcd1753149' + 'version' => '809cf178473fab752cef' ), 'wordcount.js' => array( 'dependencies' => array( diff --git a/src/wp-includes/assets/script-modules-packages.php b/src/wp-includes/assets/script-modules-packages.php index 1cfd4f0882c86..e0daa6d4eaac5 100644 --- a/src/wp-includes/assets/script-modules-packages.php +++ b/src/wp-includes/assets/script-modules-packages.php @@ -3,7 +3,7 @@ 'dependencies' => array( ), - 'version' => '4df772cdd295831820e3' + 'version' => 'f62f48906198ea8abc60' ), 'abilities/index.js' => array( 'dependencies' => array( @@ -41,16 +41,12 @@ ), 'module_dependencies' => array( - array( - 'id' => '@wordpress/a11y', - 'import' => 'static' - ), array( 'id' => '@wordpress/interactivity', 'import' => 'static' ) ), - 'version' => '205c83d309206ac7b189' + 'version' => 'ef26735bd1dbc6c830a0' ), 'block-library/file/view.js' => array( 'dependencies' => array( @@ -74,7 +70,7 @@ 'import' => 'static' ) ), - 'version' => '22bef14632c3f4b4622a' + 'version' => 'b5457389a410156f7ef6' ), 'block-library/navigation/view.js' => array( 'dependencies' => array( @@ -140,6 +136,18 @@ ), 'version' => '0684c8bb3dc8582b92ea' ), + 'block-library/video/view.js' => array( + 'dependencies' => array( + + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/interactivity', + 'import' => 'static' + ) + ), + 'version' => 'a75554c34e6430cbfdd5' + ), 'boot/index.js' => array( 'dependencies' => array( 'react', @@ -178,7 +186,7 @@ 'import' => 'static' ) ), - 'version' => 'a31ac98fff5501742501' + 'version' => 'd8489a9113a214b5278c' ), 'connectors/index.js' => array( 'dependencies' => array( @@ -204,6 +212,222 @@ ), 'version' => '012760fd849397dd0031' ), + 'core-actions/page.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-components', + 'wp-core-data', + 'wp-data', + 'wp-html-entities', + 'wp-i18n', + 'wp-notices' + ), + 'version' => 'b7ea80c796cbace5c19c' + ), + 'core-actions/post_type_supports.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-api-fetch', + 'wp-blocks', + 'wp-components', + 'wp-core-data', + 'wp-data', + 'wp-element', + 'wp-html-entities', + 'wp-i18n', + 'wp-notices', + 'wp-patterns', + 'wp-primitives', + 'wp-private-apis', + 'wp-url' + ), + 'version' => 'c68e5c9a605e907ca528' + ), + 'core-actions/wp_block.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-blob', + 'wp-element', + 'wp-html-entities', + 'wp-i18n', + 'wp-patterns', + 'wp-primitives', + 'wp-private-apis' + ), + 'version' => 'fc39ba4261c0c13a18da' + ), + 'core-actions/wp_template_part.js' => array( + 'dependencies' => array( + 'react-jsx-runtime', + 'wp-blocks', + 'wp-data', + 'wp-element', + 'wp-html-entities', + 'wp-i18n', + 'wp-notices', + 'wp-patterns', + 'wp-private-apis' + ), + 'version' => 'c8126a6b5289ae455bf2' + ), + 'core-fields/attachment.js' => array( + 'dependencies' => array( + 'react', + 'react-dom', + 'react-jsx-runtime', + 'wp-components', + 'wp-compose', + 'wp-core-data', + 'wp-data', + 'wp-element', + 'wp-html-entities', + 'wp-i18n', + 'wp-primitives', + 'wp-private-apis', + 'wp-theme', + 'wp-url', + 'wp-warning' + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/a11y', + 'import' => 'static' + ) + ), + 'version' => '3a28135598a5699ab7f1' + ), + 'core-fields/page.js' => array( + 'dependencies' => array( + 'react', + 'react-dom', + 'react-jsx-runtime', + 'wp-compose', + 'wp-core-data', + 'wp-data', + 'wp-element', + 'wp-html-entities', + 'wp-i18n', + 'wp-primitives', + 'wp-private-apis', + 'wp-theme', + 'wp-warning' + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/a11y', + 'import' => 'static' + ) + ), + 'version' => 'cc78f2192db7a69e99c1' + ), + 'core-fields/post_type_supports.js' => array( + 'dependencies' => array( + 'react', + 'react-dom', + 'react-jsx-runtime', + 'wp-components', + 'wp-compose', + 'wp-core-data', + 'wp-data', + 'wp-date', + 'wp-element', + 'wp-html-entities', + 'wp-i18n', + 'wp-media-utils', + 'wp-notices', + 'wp-primitives', + 'wp-private-apis', + 'wp-theme', + 'wp-url', + 'wp-warning', + 'wp-wordcount' + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/a11y', + 'import' => 'static' + ) + ), + 'version' => '97c0d5fbf2243cfc2429' + ), + 'core-fields/root_site.js' => array( + 'dependencies' => array( + 'wp-html-entities', + 'wp-media-utils', + 'wp-private-apis' + ), + 'version' => 'e94092be498b0e24d377' + ), + 'core-fields/wp_block.js' => array( + 'dependencies' => array( + 'react', + 'react-dom', + 'react-jsx-runtime', + 'wp-compose', + 'wp-element', + 'wp-html-entities', + 'wp-i18n', + 'wp-primitives', + 'wp-private-apis', + 'wp-theme', + 'wp-warning' + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/a11y', + 'import' => 'static' + ) + ), + 'version' => '98921ca4890d4baead31' + ), + 'core-fields/wp_template.js' => array( + 'dependencies' => array( + 'react', + 'react-dom', + 'react-jsx-runtime', + 'wp-compose', + 'wp-core-data', + 'wp-data', + 'wp-element', + 'wp-html-entities', + 'wp-i18n', + 'wp-primitives', + 'wp-private-apis', + 'wp-theme', + 'wp-warning' + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/a11y', + 'import' => 'static' + ) + ), + 'version' => 'd94f646d08e9c4a6ba08' + ), + 'core-fields/wp_template_part.js' => array( + 'dependencies' => array( + 'react', + 'react-dom', + 'react-jsx-runtime', + 'wp-compose', + 'wp-core-data', + 'wp-data', + 'wp-element', + 'wp-html-entities', + 'wp-i18n', + 'wp-primitives', + 'wp-private-apis', + 'wp-theme', + 'wp-warning' + ), + 'module_dependencies' => array( + array( + 'id' => '@wordpress/a11y', + 'import' => 'static' + ) + ), + 'version' => 'b528ca2741b1c38e32ff' + ), 'dashboard-init/index.js' => array( 'dependencies' => array( 'react', @@ -241,7 +465,7 @@ 'dependencies' => array( ), - 'version' => '2c5ac406b0272485700e' + 'version' => '38309185015c9ca20405' ), 'interactivity-router/full-page.js' => array( 'dependencies' => array( @@ -303,7 +527,7 @@ 'wp-private-apis', 'wp-style-engine' ), - 'version' => '7fa38becb312ea2acafb' + 'version' => '5efb2019845bf8676150' ), 'route/index.js' => array( 'dependencies' => array( @@ -348,7 +572,7 @@ 'dependencies' => array( ), - 'version' => '41206bd52b7ae59d873a' + 'version' => '4aef10eaf28026b90482' ), 'widget-primitives/index.js' => array( 'dependencies' => array( @@ -366,6 +590,7 @@ 'wp-compose', 'wp-data', 'wp-element', + 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', @@ -388,6 +613,6 @@ 'import' => 'dynamic' ) ), - 'version' => '870e8ddb51af5d567758' + 'version' => 'fc89488ffb88c0560c75' ) ); \ No newline at end of file diff --git a/src/wp-includes/blocks/accordion-heading/block.json b/src/wp-includes/blocks/accordion-heading/block.json index 1aa1756019374..c301c6c1b7e5e 100644 --- a/src/wp-includes/blocks/accordion-heading/block.json +++ b/src/wp-includes/blocks/accordion-heading/block.json @@ -13,6 +13,9 @@ ], "supports": { "anchor": true, + "background": { + "gradient": true + }, "color": { "background": true, "gradients": true diff --git a/src/wp-includes/blocks/blocks-json.php b/src/wp-includes/blocks/blocks-json.php index e21c24ebf586c..ee655132af3ac 100644 --- a/src/wp-includes/blocks/blocks-json.php +++ b/src/wp-includes/blocks/blocks-json.php @@ -120,6 +120,9 @@ ), 'supports' => array( 'anchor' => true, + 'background' => array( + 'gradient' => true + ), 'color' => array( 'background' => true, 'gradients' => true @@ -2102,8 +2105,21 @@ ), 'interactivity' => array( 'clientNavigation' => true + ), + 'spacing' => array( + 'padding' => true, + '__experimentalDefaultControls' => array( + 'padding' => false + ) + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true ) - ) + ), + 'style' => 'wp-block-comments-pagination-next' ), 'comments-pagination-numbers' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', @@ -2210,8 +2226,21 @@ ), 'interactivity' => array( 'clientNavigation' => true + ), + 'spacing' => array( + 'padding' => true, + '__experimentalDefaultControls' => array( + 'padding' => false + ) + ), + '__experimentalBorder' => array( + 'radius' => true, + 'color' => true, + 'width' => true, + 'style' => true ) - ) + ), + 'style' => 'wp-block-comments-pagination-previous' ), 'comments-title' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', @@ -2436,6 +2465,8 @@ 'color' => array( 'heading' => true, 'text' => true, + 'link' => true, + 'button' => true, 'background' => false, '__experimentalSkipSerialization' => array( 'gradients' @@ -2443,7 +2474,8 @@ 'enableContrastChecker' => false ), 'dimensions' => array( - 'aspectRatio' => true + 'aspectRatio' => true, + 'minWidth' => true ), 'typography' => array( 'fontSize' => true, @@ -2751,6 +2783,19 @@ ) ), 'shadow' => true, + 'typography' => array( + 'fontSize' => true, + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalFontStyle' => true, + '__experimentalTextTransform' => true, + '__experimentalTextDecoration' => true, + '__experimentalLetterSpacing' => true, + '__experimentalDefaultControls' => array( + 'fontSize' => true + ) + ), 'interactivity' => true ), 'editorStyle' => 'wp-block-file-editor', @@ -3255,6 +3300,7 @@ 'className' => true, 'splitting' => true, 'background' => array( + 'backgroundClip' => true, 'backgroundImage' => true, 'backgroundSize' => true, 'gradient' => true, @@ -3474,6 +3520,12 @@ 'center', 'right' ), + 'background' => array( + 'backgroundImage' => true, + 'backgroundSize' => true, + 'gradient' => true, + '__experimentalSkipSerialization' => true + ), 'html' => false, 'color' => array( '__experimentalSkipSerialization' => true, @@ -3485,6 +3537,9 @@ 'interactivity' => array( 'clientNavigation' => true ), + 'shadow' => array( + '__experimentalSkipSerialization' => true + ), '__experimentalBorder' => array( 'color' => true, 'radius' => true, @@ -3511,8 +3566,12 @@ ), 'dimensions' => array( 'width' => true, + 'minWidth' => true, + 'minHeight' => true, '__experimentalSkipSerialization' => array( - 'width' + 'width', + 'minWidth', + 'minHeight' ), '__experimentalDefaultControls' => array( 'width' => true @@ -3522,6 +3581,7 @@ 'selectors' => array( 'root' => '.wp-block-icon svg', 'css' => '.wp-block-icon', + 'shadow' => '.wp-block-icon svg', 'spacing' => array( 'margin' => '.wp-block-icon' ) @@ -4062,6 +4122,10 @@ 'text' => true ) ), + 'dimensions' => array( + 'minHeight' => true, + 'minWidth' => true + ), 'spacing' => array( 'margin' => true, 'padding' => true, @@ -4081,6 +4145,7 @@ ), 'selectors' => array( 'border' => '.wp-block-list:not(.wp-block-list .wp-block-list)', + 'dimensions' => '.wp-block-list:not(.wp-block-list .wp-block-list)', 'shadow' => '.wp-block-list:not(.wp-block-list .wp-block-list)' ), 'editorStyle' => 'wp-block-list-editor', @@ -4245,7 +4310,8 @@ 'shadow' => true, 'interactivity' => array( 'clientNavigation' => true - ) + ), + 'contentRole' => true ), 'style' => 'wp-block-loginout' ), @@ -4885,6 +4951,10 @@ ) ), 'shadow' => true, + 'dimensions' => array( + 'minHeight' => true, + 'minWidth' => true + ), '__experimentalBorder' => array( 'color' => true, 'radius' => true, @@ -4893,6 +4963,7 @@ ), 'spacing' => array( 'padding' => true, + 'margin' => true, '__experimentalDefaultControls' => array( 'padding' => true ) @@ -5246,6 +5317,12 @@ 'splitting' => true, 'anchor' => true, 'className' => false, + 'background' => array( + 'backgroundClip' => true, + 'backgroundImage' => true, + 'backgroundSize' => true, + 'gradient' => true + ), '__experimentalBorder' => array( 'color' => true, 'radius' => true, @@ -5261,6 +5338,10 @@ 'text' => true ) ), + 'dimensions' => array( + 'minHeight' => true, + 'minWidth' => true + ), 'spacing' => array( 'margin' => true, 'padding' => true, @@ -5409,6 +5490,15 @@ 'supports' => array( 'anchor' => true, 'align' => true, + 'background' => array( + 'backgroundImage' => true, + 'backgroundSize' => true, + 'gradient' => true, + '__experimentalDefaultControls' => array( + 'backgroundImage' => true, + 'gradient' => true + ) + ), 'color' => array( 'gradients' => true, 'link' => true, @@ -5427,6 +5517,10 @@ 'width' => true ) ), + 'dimensions' => array( + 'minHeight' => true, + 'minWidth' => true + ), 'interactivity' => true, 'shadow' => true, 'spacing' => array( @@ -6387,6 +6481,12 @@ 'anchor' => true, 'reusable' => false, 'html' => false, + 'background' => array( + '__experimentalSkipSerialization' => true, + 'backgroundImage' => true, + 'backgroundSize' => true, + 'gradient' => true + ), 'color' => array( 'link' => true ), @@ -6411,6 +6511,11 @@ 'interactivity' => array( 'clientNavigation' => true ), + 'dimensions' => array( + '__experimentalSkipSerialization' => true, + 'minHeight' => true, + 'minWidth' => true + ), 'spacing' => array( '__experimentalSkipSerialization' => true, 'margin' => true, @@ -6435,7 +6540,9 @@ ) ), 'selectors' => array( + 'background' => '.wp-block-post-navigation-link:not(:empty)', 'border' => '.wp-block-post-navigation-link:not(:empty)', + 'dimensions' => '.wp-block-post-navigation-link:not(:empty)', 'shadow' => '.wp-block-post-navigation-link:not(:empty)', 'spacing' => '.wp-block-post-navigation-link:not(:empty)' ), @@ -6515,6 +6622,10 @@ 'margin' => false ) ), + 'dimensions' => array( + 'minHeight' => true, + 'minWidth' => true + ), 'interactivity' => array( 'clientNavigation' => true ), @@ -6788,6 +6899,7 @@ '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, + 'fitText' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) @@ -6943,12 +7055,14 @@ 'fontSize' => true, 'lineHeight' => true, 'textAlign' => true, + 'textIndent' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, + '__experimentalWritingMode' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) @@ -7637,6 +7751,7 @@ '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, + '__experimentalWritingMode' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) @@ -7912,6 +8027,10 @@ 'center', 'right' ), + 'background' => array( + 'gradient' => true, + '__experimentalSkipSerialization' => true + ), 'color' => array( 'gradients' => true, '__experimentalSkipSerialization' => true, @@ -7939,6 +8058,7 @@ '__experimentalBorder' => array( 'color' => true, 'radius' => true, + 'style' => true, 'width' => true, '__experimentalSkipSerialization' => true, '__experimentalDefaultControls' => array( @@ -7947,6 +8067,14 @@ 'width' => true ) ), + 'shadow' => array( + '__experimentalSkipSerialization' => true + ), + 'dimensions' => array( + 'minHeight' => true, + 'minWidth' => true, + '__experimentalSkipSerialization' => true + ), 'spacing' => array( 'margin' => true, 'padding' => true @@ -7957,7 +8085,10 @@ 'style' => 'wp-block-search', 'selectors' => array( 'color' => '.wp-block-search .wp-block-search__button, .wp-block-search.wp-block-search__no-button .wp-block-search__input', - 'border' => '.wp-block-search.wp-block-search__button-outside .wp-block-search__input, .wp-block-search.wp-block-search__button-outside .wp-block-search__button, .wp-block-search.wp-block-search__no-button .wp-block-search__input, .wp-block-search.wp-block-search__button-only .wp-block-search__input, .wp-block-search.wp-block-search__button-only .wp-block-search__button, .wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper' + 'background' => '.wp-block-search .wp-block-search__button, .wp-block-search.wp-block-search__no-button .wp-block-search__input', + 'border' => '.wp-block-search.wp-block-search__button-outside .wp-block-search__input, .wp-block-search.wp-block-search__button-outside .wp-block-search__button, .wp-block-search.wp-block-search__no-button .wp-block-search__input, .wp-block-search.wp-block-search__button-only .wp-block-search__input, .wp-block-search.wp-block-search__button-only .wp-block-search__button, .wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper', + 'shadow' => '.wp-block-search.wp-block-search__button-outside .wp-block-search__input, .wp-block-search.wp-block-search__button-outside .wp-block-search__button, .wp-block-search.wp-block-search__no-button .wp-block-search__input, .wp-block-search.wp-block-search__button-only .wp-block-search__input, .wp-block-search.wp-block-search__button-only .wp-block-search__button, .wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper', + 'dimensions' => '.wp-block-search .wp-block-search__inside-wrapper' ) ), 'separator' => array( @@ -8593,6 +8724,12 @@ 'ariaLabel' => true, 'visibility' => false, 'lock' => false, + 'background' => array( + 'backgroundImage' => true, + 'backgroundSize' => true, + 'gradient' => true, + '__experimentalSkipSerialization' => true + ), 'color' => array( 'background' => true, 'text' => true, @@ -8604,7 +8741,11 @@ ), 'typography' => array( 'fontSize' => true, - '__experimentalFontFamily' => true + 'lineHeight' => true, + '__experimentalFontFamily' => true, + '__experimentalFontWeight' => true, + '__experimentalTextTransform' => true, + '__experimentalLetterSpacing' => true ), '__experimentalBorder' => array( 'color' => true, @@ -8638,6 +8779,7 @@ ) ), 'selectors' => array( + 'background' => '.wp-block-tab-list button', 'border' => '.wp-block-tab-list button', 'shadow' => '.wp-block-tab-list button', 'color' => array( @@ -8963,9 +9105,18 @@ 'supports' => array( 'anchor' => true, 'align' => true, - 'color' => array( + 'background' => array( '__experimentalSkipSerialization' => true, + 'gradient' => true + ), + 'color' => array( + '__experimentalSkipSerialization' => array( + 'text', + 'background', + 'gradients' + ), 'gradients' => true, + 'link' => true, '__experimentalDefaultControls' => array( 'background' => true, 'text' => true @@ -8980,6 +9131,9 @@ ) ), 'typography' => array( + '__experimentalSkipSerialization' => array( + 'textAlign' + ), 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, @@ -8988,6 +9142,7 @@ '__experimentalLetterSpacing' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, + 'textAlign' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) @@ -9244,7 +9399,8 @@ 'textdomain' => 'default', 'usesContext' => array( 'termId', - 'taxonomy' + 'taxonomy', + 'termData' ), 'attributes' => array( 'bracketType' => array( @@ -9515,6 +9671,8 @@ 'color' => array( 'gradients' => true, 'link' => true, + 'heading' => true, + 'button' => true, '__experimentalDefaultControls' => array( 'background' => true, 'text' => true @@ -9613,6 +9771,11 @@ ), 'html' => false, 'layout' => true, + 'spacing' => array( + 'padding' => true, + 'margin' => true, + 'blockGap' => true + ), 'interactivity' => true ) ), @@ -9862,13 +10025,20 @@ ) ), 'interactivity' => array( - 'clientNavigation' => true + 'clientNavigation' => true, + 'interactive' => true ), 'shadow' => array( '__experimentalSkipSerialization' => true + ), + 'dimensions' => array( + 'minWidth' => true, + 'minHeight' => true, + '__experimentalSkipSerialization' => true ) ), 'selectors' => array( + 'dimensions' => '.wp-block-video video', 'shadow' => '.wp-block-video video', 'filter' => array( 'duotone' => '.wp-block-video video' diff --git a/src/wp-includes/blocks/button.php b/src/wp-includes/blocks/button.php index fd117e9436a57..e9dd007b1e6e2 100644 --- a/src/wp-includes/blocks/button.php +++ b/src/wp-includes/blocks/button.php @@ -60,7 +60,7 @@ function render_block_core_button( $attributes, $content ) { return ''; } - // Background skips serialization, so apply it to the link like color. + // Background skips serialization, so apply it to the link element, like the color support does. $background = $attributes['style']['background'] ?? null; if ( is_array( $background ) ) { diff --git a/src/wp-includes/blocks/comments-pagination-next/block.json b/src/wp-includes/blocks/comments-pagination-next/block.json index 3b3c122a9084d..7cbc1bba7cd1c 100644 --- a/src/wp-includes/blocks/comments-pagination-next/block.json +++ b/src/wp-includes/blocks/comments-pagination-next/block.json @@ -42,6 +42,19 @@ }, "interactivity": { "clientNavigation": true + }, + "spacing": { + "padding": true, + "__experimentalDefaultControls": { + "padding": false + } + }, + "__experimentalBorder": { + "radius": true, + "color": true, + "width": true, + "style": true } - } + }, + "style": "wp-block-comments-pagination-next" } diff --git a/src/wp-includes/blocks/comments-pagination-previous/block.json b/src/wp-includes/blocks/comments-pagination-previous/block.json index de141ba2bb553..6f857f2030f1d 100644 --- a/src/wp-includes/blocks/comments-pagination-previous/block.json +++ b/src/wp-includes/blocks/comments-pagination-previous/block.json @@ -45,6 +45,19 @@ }, "interactivity": { "clientNavigation": true + }, + "spacing": { + "padding": true, + "__experimentalDefaultControls": { + "padding": false + } + }, + "__experimentalBorder": { + "radius": true, + "color": true, + "width": true, + "style": true } - } + }, + "style": "wp-block-comments-pagination-previous" } diff --git a/src/wp-includes/blocks/cover.php b/src/wp-includes/blocks/cover.php index 1241ece24c917..bd7ee8b88034a 100644 --- a/src/wp-includes/blocks/cover.php +++ b/src/wp-includes/blocks/cover.php @@ -16,6 +16,15 @@ * @return string Returns the cover block markup, if useFeaturedImage is true. */ function render_block_core_cover( $attributes, $content ) { + // The view module decides whether a background video may play, so it is + // only needed for the two video background types. + if ( + isset( $attributes['backgroundType'] ) && + in_array( $attributes['backgroundType'], array( 'video', 'embed-video' ), true ) + ) { + wp_enqueue_script_module( '@wordpress/block-library/cover/view' ); + } + // Handle embed video background. if ( isset( $attributes['backgroundType'] ) && @@ -26,19 +35,17 @@ function render_block_core_cover( $attributes, $content ) { ) { $url = $attributes['url']; - // The view script decides whether the embed may autoplay, so it is only - // needed for embed backgrounds. - wp_enqueue_script_module( '@wordpress/block-library/cover/view' ); - // Use WordPress's native oEmbed processing (includes caching). $oembed_html = wp_oembed_get( $url ); if ( $oembed_html ) { - // Extract iframe src from the oEmbed HTML. - preg_match( '/src=["\']([^"\']+)["\']/', $oembed_html, $src_matches ); - if ( ! empty( $src_matches[1] ) ) { - $iframe_src = $src_matches[1]; - + // Read the iframe src with the HTML API, which returns the attribute + // value decoded, so `&` in the query string becomes `&`. + $oembed_processor = new WP_HTML_Tag_Processor( $oembed_html ); + $iframe_src = $oembed_processor->next_tag( 'IFRAME' ) + ? $oembed_processor->get_attribute( 'src' ) + : null; + if ( is_string( $iframe_src ) && '' !== $iframe_src ) { // Detect provider from iframe src URL. $lower_src = strtolower( $iframe_src ); $provider = null; @@ -159,6 +166,31 @@ function render_block_core_cover( $attributes, $content ) { return $content; } + // Handle uploaded video background. The video is saved with `autoplay`, so + // the view module stops it for a visitor who prefers reduced motion. The + // directives are added here rather than in the saved markup so existing + // content does not need a deprecation. + if ( + isset( $attributes['backgroundType'] ) && + 'video' === $attributes['backgroundType'] + ) { + $processor = new WP_HTML_Tag_Processor( $content ); + + if ( $processor->next_tag( + array( + 'tag_name' => 'VIDEO', + 'class_name' => 'wp-block-cover__video-background', + ) + ) ) { + $processor->set_attribute( 'data-wp-interactive', 'core/cover' ); + $processor->set_attribute( 'data-wp-init', 'callbacks.stopBackgroundVideo' ); + + $content = $processor->get_updated_html(); + } + + return $content; + } + if ( 'image' !== $attributes['backgroundType'] || false === $attributes['useFeaturedImage'] ) { return $content; } diff --git a/src/wp-includes/blocks/cover/block.json b/src/wp-includes/blocks/cover/block.json index 8f2f864555eb7..5419ecfcd6eb0 100644 --- a/src/wp-includes/blocks/cover/block.json +++ b/src/wp-includes/blocks/cover/block.json @@ -129,12 +129,15 @@ "color": { "heading": true, "text": true, + "link": true, + "button": true, "background": false, "__experimentalSkipSerialization": [ "gradients" ], "enableContrastChecker": false }, "dimensions": { - "aspectRatio": true + "aspectRatio": true, + "minWidth": true }, "typography": { "fontSize": true, diff --git a/src/wp-includes/blocks/file/block.json b/src/wp-includes/blocks/file/block.json index 3d8da956428be..68e389a4d28fb 100644 --- a/src/wp-includes/blocks/file/block.json +++ b/src/wp-includes/blocks/file/block.json @@ -104,6 +104,19 @@ } }, "shadow": true, + "typography": { + "fontSize": true, + "lineHeight": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalDefaultControls": { + "fontSize": true + } + }, "interactivity": true }, "editorStyle": "wp-block-file-editor", diff --git a/src/wp-includes/blocks/gallery.php b/src/wp-includes/blocks/gallery.php index 5474503702a65..587a6e349f93a 100644 --- a/src/wp-includes/blocks/gallery.php +++ b/src/wp-includes/blocks/gallery.php @@ -469,6 +469,11 @@ function block_core_gallery_render_dynamic_image( $attachment_id, $attributes, $ * @return string The content of the block being rendered. */ function block_core_gallery_render( $attributes, $content, $block ) { + /* + * Reads global styles once per request. wp_get_global_styles() has no cache + * of its own, so without this static each gallery would merge the theme.json + * data again wherever the resolver does not cache the merged result. + */ static $global_styles = null; // Gallery blocks created before layout variations existed do not have an @@ -554,13 +559,6 @@ function block_core_gallery_render( $attributes, $content, $block ) { $style_attr = is_array( $attributes['style'] ?? null ) ? $attributes['style'] : array(); - if ( - defined( 'IS_GUTENBERG_PLUGIN' ) && - IS_GUTENBERG_PLUGIN && - function_exists( 'gutenberg_resolve_style_state_aliases' ) - ) { - $style_attr = gutenberg_resolve_style_state_aliases( $style_attr, 'core/gallery' ); - } $global_settings = wp_get_global_settings(); $viewport_settings = $global_settings['viewport'] ?? null; diff --git a/src/wp-includes/blocks/heading/block.json b/src/wp-includes/blocks/heading/block.json index 0f4a9476b19a9..a19a6ecdd33a7 100644 --- a/src/wp-includes/blocks/heading/block.json +++ b/src/wp-includes/blocks/heading/block.json @@ -31,6 +31,7 @@ "className": true, "splitting": true, "background": { + "backgroundClip": true, "backgroundImage": true, "backgroundSize": true, "gradient": true, diff --git a/src/wp-includes/blocks/icon.php b/src/wp-includes/blocks/icon.php index e158333bc4da5..fe5e9dcb41fe4 100644 --- a/src/wp-includes/blocks/icon.php +++ b/src/wp-includes/blocks/icon.php @@ -39,6 +39,23 @@ function render_block_core_icon( $attributes ) { $custom_background_color = $attributes['style']['color']['background'] ?? null; $color_styles['background'] = $preset_background_color ? $preset_background_color : $custom_background_color; + // Background image, size and gradient. + $background_styles = array(); + if ( isset( $attributes['style']['background'] ) && is_array( $attributes['style']['background'] ) ) { + $background_styles = array_intersect_key( + $attributes['style']['background'], + array_flip( array( 'backgroundImage', 'backgroundSize', 'backgroundPosition', 'backgroundRepeat', 'backgroundAttachment', 'gradient' ) ) + ); + + // Mirror of the defaults in the background block support. + if ( ! empty( $background_styles['backgroundImage'] ) ) { + $background_styles['backgroundSize'] = $background_styles['backgroundSize'] ?? 'cover'; + if ( 'contain' === $background_styles['backgroundSize'] && empty( $background_styles['backgroundPosition'] ) ) { + $background_styles['backgroundPosition'] = '50% 50%'; + } + } + } + // Border. $border_styles = array(); $sides = array( 'top', 'right', 'bottom', 'left' ); @@ -66,23 +83,30 @@ function render_block_core_icon( $attributes ) { ); } + // Shadow. + $shadow_styles = $attributes['style']['shadow'] ?? null; + // Spacing (Padding). $spacing_styles = array(); if ( isset( $attributes['style']['spacing']['padding'] ) ) { $spacing_styles['padding'] = $attributes['style']['spacing']['padding']; } - // Dimensions (Width). + // Dimensions (Width, Min width, Min height). $dimensions_styles = array(); - if ( isset( $attributes['style']['dimensions']['width'] ) ) { - $dimensions_styles['width'] = $attributes['style']['dimensions']['width']; + foreach ( array( 'width', 'minWidth', 'minHeight' ) as $dimension ) { + if ( isset( $attributes['style']['dimensions'][ $dimension ] ) ) { + $dimensions_styles[ $dimension ] = $attributes['style']['dimensions'][ $dimension ]; + } } // Generate styles and classes. $styles = wp_style_engine_get_styles( array( 'color' => $color_styles, + 'background' => $background_styles, 'border' => $border_styles, + 'shadow' => $shadow_styles, 'spacing' => $spacing_styles, 'dimensions' => $dimensions_styles, ), @@ -118,6 +142,11 @@ function render_block_core_icon( $attributes ) { $processor->set_attribute( 'style', $merged_style ); } + // The style engine only adds `has-background` for a gradient. + if ( ! empty( $background_styles['backgroundImage'] ) ) { + $processor->add_class( 'has-background' ); + } + // Apply flip classes to the SVG. $flip_horizontal = $attributes['flipHorizontal'] ?? false; $flip_vertical = $attributes['flipVertical'] ?? false; diff --git a/src/wp-includes/blocks/icon/block.json b/src/wp-includes/blocks/icon/block.json index de9f71af79e4b..ddc62d6216c12 100644 --- a/src/wp-includes/blocks/icon/block.json +++ b/src/wp-includes/blocks/icon/block.json @@ -31,6 +31,12 @@ "__experimentalSkipSerialization": true }, "align": [ "left", "center", "right" ], + "background": { + "backgroundImage": true, + "backgroundSize": true, + "gradient": true, + "__experimentalSkipSerialization": true + }, "html": false, "color": { "__experimentalSkipSerialization": true, @@ -42,6 +48,9 @@ "interactivity": { "clientNavigation": true }, + "shadow": { + "__experimentalSkipSerialization": true + }, "__experimentalBorder": { "color": true, "radius": true, @@ -66,7 +75,13 @@ }, "dimensions": { "width": true, - "__experimentalSkipSerialization": [ "width" ], + "minWidth": true, + "minHeight": true, + "__experimentalSkipSerialization": [ + "width", + "minWidth", + "minHeight" + ], "__experimentalDefaultControls": { "width": true } @@ -75,6 +90,7 @@ "selectors": { "root": ".wp-block-icon svg", "css": ".wp-block-icon", + "shadow": ".wp-block-icon svg", "spacing": { "margin": ".wp-block-icon" } diff --git a/src/wp-includes/blocks/image.php b/src/wp-includes/blocks/image.php index 43f8e8c26c468..8035a99782c7f 100644 --- a/src/wp-includes/blocks/image.php +++ b/src/wp-includes/blocks/image.php @@ -369,6 +369,7 @@ class="wp-lightbox-overlay zoom" data-wp-on--touchstart="actions.handleTouchStart" data-wp-on--touchmove="actions.handleTouchMove" data-wp-on--touchend="actions.handleTouchEnd" + data-wp-on--touchcancel="actions.handleTouchCancel" data-wp-on-window--resize="callbacks.setOverlayStyles" data-wp-on-window--scroll="actions.handleScroll" data-wp-bind--style="state.overlayStyles" diff --git a/src/wp-includes/blocks/list/block.json b/src/wp-includes/blocks/list/block.json index 2b63e91d4e787..b751c64ab7ae6 100644 --- a/src/wp-includes/blocks/list/block.json +++ b/src/wp-includes/blocks/list/block.json @@ -75,6 +75,10 @@ "text": true } }, + "dimensions": { + "minHeight": true, + "minWidth": true + }, "spacing": { "margin": true, "padding": true, @@ -94,6 +98,7 @@ }, "selectors": { "border": ".wp-block-list:not(.wp-block-list .wp-block-list)", + "dimensions": ".wp-block-list:not(.wp-block-list .wp-block-list)", "shadow": ".wp-block-list:not(.wp-block-list .wp-block-list)" }, "editorStyle": "wp-block-list-editor", diff --git a/src/wp-includes/blocks/loginout/block.json b/src/wp-includes/blocks/loginout/block.json index 6266dcae73c7f..9d2a6b52305d2 100644 --- a/src/wp-includes/blocks/loginout/block.json +++ b/src/wp-includes/blocks/loginout/block.json @@ -72,7 +72,8 @@ "shadow": true, "interactivity": { "clientNavigation": true - } + }, + "contentRole": true }, "style": "wp-block-loginout" } diff --git a/src/wp-includes/blocks/navigation-overlay-close/block.json b/src/wp-includes/blocks/navigation-overlay-close/block.json index 86b3f5d5efcff..efa58e631b44c 100644 --- a/src/wp-includes/blocks/navigation-overlay-close/block.json +++ b/src/wp-includes/blocks/navigation-overlay-close/block.json @@ -26,6 +26,10 @@ } }, "shadow": true, + "dimensions": { + "minHeight": true, + "minWidth": true + }, "__experimentalBorder": { "color": true, "radius": true, @@ -34,6 +38,7 @@ }, "spacing": { "padding": true, + "margin": true, "__experimentalDefaultControls": { "padding": true } diff --git a/src/wp-includes/blocks/navigation.php b/src/wp-includes/blocks/navigation.php index 48c1c73fd0f81..4503af8a62312 100644 --- a/src/wp-includes/blocks/navigation.php +++ b/src/wp-includes/blocks/navigation.php @@ -1656,13 +1656,6 @@ function block_core_navigation_add_support_classes_to_container( $block_content, $attributes = is_array( $block['attrs'] ?? null ) ? $block['attrs'] : array(); $style = is_array( $attributes['style'] ?? null ) ? $attributes['style'] : array(); - if ( - defined( 'IS_GUTENBERG_PLUGIN' ) && - IS_GUTENBERG_PLUGIN && - function_exists( 'gutenberg_resolve_style_state_aliases' ) - ) { - $style = gutenberg_resolve_style_state_aliases( $style, 'core/navigation' ); - } $global_settings = wp_get_global_settings(); $viewport_settings = $global_settings['viewport'] ?? null; diff --git a/src/wp-includes/blocks/paragraph/block.json b/src/wp-includes/blocks/paragraph/block.json index 8cbb931b05acb..e8dfaa7ff9ae1 100644 --- a/src/wp-includes/blocks/paragraph/block.json +++ b/src/wp-includes/blocks/paragraph/block.json @@ -31,6 +31,12 @@ "splitting": true, "anchor": true, "className": false, + "background": { + "backgroundClip": true, + "backgroundImage": true, + "backgroundSize": true, + "gradient": true + }, "__experimentalBorder": { "color": true, "radius": true, @@ -46,6 +52,10 @@ "text": true } }, + "dimensions": { + "minHeight": true, + "minWidth": true + }, "spacing": { "margin": true, "padding": true, diff --git a/src/wp-includes/blocks/playlist/block.json b/src/wp-includes/blocks/playlist/block.json index 073a9c08ffedd..e184319f5c385 100644 --- a/src/wp-includes/blocks/playlist/block.json +++ b/src/wp-includes/blocks/playlist/block.json @@ -69,6 +69,15 @@ "supports": { "anchor": true, "align": true, + "background": { + "backgroundImage": true, + "backgroundSize": true, + "gradient": true, + "__experimentalDefaultControls": { + "backgroundImage": true, + "gradient": true + } + }, "color": { "gradients": true, "link": true, @@ -87,6 +96,10 @@ "width": true } }, + "dimensions": { + "minHeight": true, + "minWidth": true + }, "interactivity": true, "shadow": true, "spacing": { diff --git a/src/wp-includes/blocks/post-navigation-link.php b/src/wp-includes/blocks/post-navigation-link.php index b27b571bcdaf1..c52959dc6ab5d 100644 --- a/src/wp-includes/blocks/post-navigation-link.php +++ b/src/wp-includes/blocks/post-navigation-link.php @@ -116,9 +116,10 @@ function render_block_core_post_navigation_link( $attributes, $content ) { $content = (string) $content; /* - * Border, shadow and spacing serialization is skipped for this block so - * those styles can be withheld from the empty wrapper rendered when there is - * no adjacent post. The wrapper itself is kept for backward compatibility. + * Background, border, dimensions, shadow and spacing serialization is + * skipped for this block so those styles can be withheld from the empty + * wrapper rendered when there is no adjacent post. The wrapper itself is + * kept for backward compatibility. */ $support_styles = '' === $content ? array( @@ -146,18 +147,19 @@ function render_block_core_post_navigation_link( $attributes, $content ) { } /** - * Generates the border, shadow and spacing class names and inline styles for - * the `core/post-navigation-link` block. + * Generates the background, border, dimensions, shadow and spacing class + * names and inline styles for the `core/post-navigation-link` block. * - * Mirrors the default border, shadow and spacing block support serialization, - * which the block opts out of so the styles are only applied when a link is - * rendered. + * Mirrors the default background, border, dimensions, shadow and spacing + * block support serialization, which the block opts out of so the styles are + * only applied when a link is rendered. * * @since 7.2.0 * * @param array $attributes The block attributes. * @return array { - * Border, shadow and spacing class names and inline styles. + * Background, border, dimensions, shadow and spacing class names and + * inline styles. * * @type string $class Class names generated by the style engine, or an empty string. * @type string $style Inline styles generated by the style engine, or an empty string. @@ -195,19 +197,49 @@ function block_core_post_navigation_link_get_support_styles( $attributes ) { ); } + $background = $block_styles['background'] ?? array(); + $background_styles = array( + 'backgroundImage' => $background['backgroundImage'] ?? null, + 'backgroundSize' => $background['backgroundSize'] ?? null, + 'backgroundPosition' => $background['backgroundPosition'] ?? null, + 'backgroundRepeat' => $background['backgroundRepeat'] ?? null, + 'backgroundAttachment' => $background['backgroundAttachment'] ?? null, + 'gradient' => $background['gradient'] ?? null, + ); + + // Mirrors the background image defaults of the background block support. + if ( ! empty( $background_styles['backgroundImage'] ) ) { + $background_styles['backgroundSize'] = $background_styles['backgroundSize'] ?? 'cover'; + if ( 'contain' === $background_styles['backgroundSize'] && ! $background_styles['backgroundPosition'] ) { + $background_styles['backgroundPosition'] = '50% 50%'; + } + } + $styles = wp_style_engine_get_styles( array( - 'border' => $border_styles, - 'shadow' => $block_styles['shadow'] ?? null, - 'spacing' => array( + 'background' => $background_styles, + 'border' => $border_styles, + 'dimensions' => array( + 'minHeight' => $block_styles['dimensions']['minHeight'] ?? null, + 'minWidth' => $block_styles['dimensions']['minWidth'] ?? null, + ), + 'shadow' => $block_styles['shadow'] ?? null, + 'spacing' => array( 'margin' => $block_styles['spacing']['margin'] ?? null, 'padding' => $block_styles['spacing']['padding'] ?? null, ), ) ); + $class_names = $styles['classnames'] ?? ''; + + // The style engine only adds `has-background` for a gradient, the background block support adds it for an image too. + if ( ! empty( $background_styles['backgroundImage'] ) && ! in_array( 'has-background', explode( ' ', $class_names ), true ) ) { + $class_names = trim( "{$class_names} has-background" ); + } + return array( - 'class' => $styles['classnames'] ?? '', + 'class' => $class_names, 'style' => $styles['css'] ?? '', ); } diff --git a/src/wp-includes/blocks/post-navigation-link/block.json b/src/wp-includes/blocks/post-navigation-link/block.json index fdf7d89a1eaa6..ec8586ad09a8a 100644 --- a/src/wp-includes/blocks/post-navigation-link/block.json +++ b/src/wp-includes/blocks/post-navigation-link/block.json @@ -37,6 +37,12 @@ "anchor": true, "reusable": false, "html": false, + "background": { + "__experimentalSkipSerialization": true, + "backgroundImage": true, + "backgroundSize": true, + "gradient": true + }, "color": { "link": true }, @@ -61,6 +67,11 @@ "interactivity": { "clientNavigation": true }, + "dimensions": { + "__experimentalSkipSerialization": true, + "minHeight": true, + "minWidth": true + }, "spacing": { "__experimentalSkipSerialization": true, "margin": true, @@ -85,7 +96,9 @@ } }, "selectors": { + "background": ".wp-block-post-navigation-link:not(:empty)", "border": ".wp-block-post-navigation-link:not(:empty)", + "dimensions": ".wp-block-post-navigation-link:not(:empty)", "shadow": ".wp-block-post-navigation-link:not(:empty)", "spacing": ".wp-block-post-navigation-link:not(:empty)" }, diff --git a/src/wp-includes/blocks/post-template/block.json b/src/wp-includes/blocks/post-template/block.json index 00bfd4feb79f2..cae15c91d7646 100644 --- a/src/wp-includes/blocks/post-template/block.json +++ b/src/wp-includes/blocks/post-template/block.json @@ -67,6 +67,10 @@ "margin": false } }, + "dimensions": { + "minHeight": true, + "minWidth": true + }, "interactivity": { "clientNavigation": true }, diff --git a/src/wp-includes/blocks/post-title/block.json b/src/wp-includes/blocks/post-title/block.json index e227776a9d915..1f63739257ada 100644 --- a/src/wp-includes/blocks/post-title/block.json +++ b/src/wp-includes/blocks/post-title/block.json @@ -79,6 +79,7 @@ "__experimentalTextTransform": true, "__experimentalTextDecoration": true, "__experimentalLetterSpacing": true, + "fitText": true, "__experimentalDefaultControls": { "fontSize": true } diff --git a/src/wp-includes/blocks/pullquote/block.json b/src/wp-includes/blocks/pullquote/block.json index bbb433ff9958b..fccc514c0eca2 100644 --- a/src/wp-includes/blocks/pullquote/block.json +++ b/src/wp-includes/blocks/pullquote/block.json @@ -54,12 +54,14 @@ "fontSize": true, "lineHeight": true, "textAlign": true, + "textIndent": true, "__experimentalFontFamily": true, "__experimentalFontWeight": true, "__experimentalFontStyle": true, "__experimentalTextTransform": true, "__experimentalTextDecoration": true, "__experimentalLetterSpacing": true, + "__experimentalWritingMode": true, "__experimentalDefaultControls": { "fontSize": true } diff --git a/src/wp-includes/blocks/quote/block.json b/src/wp-includes/blocks/quote/block.json index 6724c008e9a42..f0c0d767d76e8 100644 --- a/src/wp-includes/blocks/quote/block.json +++ b/src/wp-includes/blocks/quote/block.json @@ -69,6 +69,7 @@ "__experimentalTextTransform": true, "__experimentalTextDecoration": true, "__experimentalLetterSpacing": true, + "__experimentalWritingMode": true, "__experimentalDefaultControls": { "fontSize": true } diff --git a/src/wp-includes/blocks/search.php b/src/wp-includes/blocks/search.php index 8a453bcfd1908..29850a5cc2a55 100644 --- a/src/wp-includes/blocks/search.php +++ b/src/wp-includes/blocks/search.php @@ -384,6 +384,20 @@ function styles_for_block_core_search( $attributes ) { ); } + // Add minimum width and height styles. + $dimensions_styles = wp_style_engine_get_styles( + array( + 'dimensions' => array( + 'minWidth' => $attributes['style']['dimensions']['minWidth'] ?? null, + 'minHeight' => $attributes['style']['dimensions']['minHeight'] ?? null, + ), + ) + ); + + if ( ! empty( $dimensions_styles['css'] ) ) { + $wrapper_styles[] = $dimensions_styles['css']; + } + // Add border width and color styles. apply_block_core_search_border_styles( $attributes, 'width', $wrapper_styles, $button_styles, $input_styles ); apply_block_core_search_border_styles( $attributes, 'color', $wrapper_styles, $button_styles, $input_styles ); @@ -457,6 +471,20 @@ function styles_for_block_core_search( $attributes ) { } } + // Shadow lands on the same elements as the border. + if ( ! empty( $attributes['style']['shadow'] ) && is_string( $attributes['style']['shadow'] ) ) { + $shadow_styles = wp_style_engine_get_styles( array( 'shadow' => $attributes['style']['shadow'] ) ); + + if ( ! empty( $shadow_styles['css'] ) ) { + if ( $is_button_inside ) { + $wrapper_styles[] = $shadow_styles['css']; + } else { + $button_styles[] = $shadow_styles['css']; + $input_styles[] = $shadow_styles['css']; + } + } + } + $use_input_for_colors = ! empty( $attributes['buttonPosition'] ) && 'no-button' === $attributes['buttonPosition']; // Add color styles. @@ -490,6 +518,24 @@ function styles_for_block_core_search( $attributes ) { } } + // Background skips serialization, so it follows color onto the same element. + if ( ! empty( $attributes['style']['background']['gradient'] ) ) { + $background_styles = wp_style_engine_get_styles( + array( + 'background' => array( + 'gradient' => $attributes['style']['background']['gradient'], + ), + ) + ); + if ( ! empty( $background_styles['css'] ) ) { + if ( $use_input_for_colors ) { + $input_styles[] = $background_styles['css']; + } else { + $button_styles[] = $background_styles['css']; + } + } + } + // Get typography styles to be shared across inner elements. $typography_styles = esc_attr( get_typography_styles_for_block_core_search( $attributes ) ); if ( ! empty( $typography_styles ) ) { @@ -646,11 +692,13 @@ function get_color_classes_for_block_core_search( $attributes ) { $has_custom_background_color = ! empty( $attributes['style']['color']['background'] ); $has_named_gradient = ! empty( $attributes['gradient'] ); $has_custom_gradient = ! empty( $attributes['style']['color']['gradient'] ); + $has_background_gradient = ! empty( $attributes['style']['background']['gradient'] ); if ( $has_named_background_color || $has_custom_background_color || $has_named_gradient || - $has_custom_gradient + $has_custom_gradient || + $has_background_gradient ) { $classnames[] = 'has-background'; } diff --git a/src/wp-includes/blocks/search/block.json b/src/wp-includes/blocks/search/block.json index 3bbd10cd6e638..8373024eda4c9 100644 --- a/src/wp-includes/blocks/search/block.json +++ b/src/wp-includes/blocks/search/block.json @@ -51,6 +51,10 @@ "supports": { "anchor": true, "align": [ "left", "center", "right" ], + "background": { + "gradient": true, + "__experimentalSkipSerialization": true + }, "color": { "gradients": true, "__experimentalSkipSerialization": true, @@ -78,6 +82,7 @@ "__experimentalBorder": { "color": true, "radius": true, + "style": true, "width": true, "__experimentalSkipSerialization": true, "__experimentalDefaultControls": { @@ -86,6 +91,14 @@ "width": true } }, + "shadow": { + "__experimentalSkipSerialization": true + }, + "dimensions": { + "minHeight": true, + "minWidth": true, + "__experimentalSkipSerialization": true + }, "spacing": { "margin": true, "padding": true @@ -96,6 +109,9 @@ "style": "wp-block-search", "selectors": { "color": ".wp-block-search .wp-block-search__button, .wp-block-search.wp-block-search__no-button .wp-block-search__input", - "border": ".wp-block-search.wp-block-search__button-outside .wp-block-search__input, .wp-block-search.wp-block-search__button-outside .wp-block-search__button, .wp-block-search.wp-block-search__no-button .wp-block-search__input, .wp-block-search.wp-block-search__button-only .wp-block-search__input, .wp-block-search.wp-block-search__button-only .wp-block-search__button, .wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper" + "background": ".wp-block-search .wp-block-search__button, .wp-block-search.wp-block-search__no-button .wp-block-search__input", + "border": ".wp-block-search.wp-block-search__button-outside .wp-block-search__input, .wp-block-search.wp-block-search__button-outside .wp-block-search__button, .wp-block-search.wp-block-search__no-button .wp-block-search__input, .wp-block-search.wp-block-search__button-only .wp-block-search__input, .wp-block-search.wp-block-search__button-only .wp-block-search__button, .wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper", + "shadow": ".wp-block-search.wp-block-search__button-outside .wp-block-search__input, .wp-block-search.wp-block-search__button-outside .wp-block-search__button, .wp-block-search.wp-block-search__no-button .wp-block-search__input, .wp-block-search.wp-block-search__button-only .wp-block-search__input, .wp-block-search.wp-block-search__button-only .wp-block-search__button, .wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper", + "dimensions": ".wp-block-search .wp-block-search__inside-wrapper" } } diff --git a/src/wp-includes/blocks/tab-list.php b/src/wp-includes/blocks/tab-list.php index f45de5def38e9..f65e86873759d 100644 --- a/src/wp-includes/blocks/tab-list.php +++ b/src/wp-includes/blocks/tab-list.php @@ -9,8 +9,8 @@ * Render callback for core/tab-list. * * Injects IAPI directives into the saved button HTML. The buttons already - * carry color/border/padding styles from save.jsx; this callback adds - * tab-specific attributes (id, aria-controls, context) and interactivity + * carry background/color/border/padding styles from save.jsx; this callback + * adds tab-specific attributes (id, aria-controls, context) and interactivity * directives using data from the tabs-list context. * * @since 7.1.0 diff --git a/src/wp-includes/blocks/tab-list/block.json b/src/wp-includes/blocks/tab-list/block.json index 95fa9eb3d7e0f..8f141977fda1b 100644 --- a/src/wp-includes/blocks/tab-list/block.json +++ b/src/wp-includes/blocks/tab-list/block.json @@ -28,6 +28,12 @@ "ariaLabel": true, "visibility": false, "lock": false, + "background": { + "backgroundImage": true, + "backgroundSize": true, + "gradient": true, + "__experimentalSkipSerialization": true + }, "color": { "background": true, "text": true, @@ -39,7 +45,11 @@ }, "typography": { "fontSize": true, - "__experimentalFontFamily": true + "lineHeight": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalTextTransform": true, + "__experimentalLetterSpacing": true }, "__experimentalBorder": { "color": true, @@ -71,6 +81,7 @@ } }, "selectors": { + "background": ".wp-block-tab-list button", "border": ".wp-block-tab-list button", "shadow": ".wp-block-tab-list button", "color": { diff --git a/src/wp-includes/blocks/table/block.json b/src/wp-includes/blocks/table/block.json index 84f2783d3ff8c..51f5f29bd3c56 100644 --- a/src/wp-includes/blocks/table/block.json +++ b/src/wp-includes/blocks/table/block.json @@ -159,9 +159,18 @@ "supports": { "anchor": true, "align": true, - "color": { + "background": { "__experimentalSkipSerialization": true, + "gradient": true + }, + "color": { + "__experimentalSkipSerialization": [ + "text", + "background", + "gradients" + ], "gradients": true, + "link": true, "__experimentalDefaultControls": { "background": true, "text": true @@ -176,6 +185,7 @@ } }, "typography": { + "__experimentalSkipSerialization": [ "textAlign" ], "fontSize": true, "lineHeight": true, "__experimentalFontFamily": true, @@ -184,6 +194,7 @@ "__experimentalLetterSpacing": true, "__experimentalTextTransform": true, "__experimentalTextDecoration": true, + "textAlign": true, "__experimentalDefaultControls": { "fontSize": true } diff --git a/src/wp-includes/blocks/template-part.php b/src/wp-includes/blocks/template-part.php index c716e1e677696..ed77cce74a29a 100644 --- a/src/wp-includes/blocks/template-part.php +++ b/src/wp-includes/blocks/template-part.php @@ -52,7 +52,7 @@ function render_block_core_template_part( $attributes ) { __FUNCTION__, sprintf( /* translators: 1: Template part ID, 2: Error message. */ - __( 'Error when loading the template part %1$s from the database: %2$s' ), + __( 'Error loading the template part %1$s from the database: %2$s' ), $template_part_id, $block_template->get_error_message() ) diff --git a/src/wp-includes/blocks/term-count.php b/src/wp-includes/blocks/term-count.php index 9794896524eb4..c65eaaf6ef310 100644 --- a/src/wp-includes/blocks/term-count.php +++ b/src/wp-includes/blocks/term-count.php @@ -17,8 +17,10 @@ * @return string Returns the count of the current taxonomy term wrapped inside a heading tag. */ function render_block_core_term_count( $attributes, $content, $block ) { - // Get term from context or from the current query. - if ( isset( $block->context['termId'] ) && isset( $block->context['taxonomy'] ) ) { + // Reuse the filtered term from Term Template to avoid a separate query for each count. + if ( isset( $block->context['termData'] ) && $block->context['termData'] instanceof WP_Term ) { + $term = $block->context['termData']; + } elseif ( isset( $block->context['termId'] ) && isset( $block->context['taxonomy'] ) ) { $term = get_term( $block->context['termId'], $block->context['taxonomy'] ); } else { $term = get_queried_object(); diff --git a/src/wp-includes/blocks/term-count/block.json b/src/wp-includes/blocks/term-count/block.json index a0990215ab494..0f266cec0d5e4 100644 --- a/src/wp-includes/blocks/term-count/block.json +++ b/src/wp-includes/blocks/term-count/block.json @@ -6,7 +6,7 @@ "category": "theme", "description": "Displays the post count of a taxonomy term.", "textdomain": "default", - "usesContext": [ "termId", "taxonomy" ], + "usesContext": [ "termId", "taxonomy", "termData" ], "attributes": { "bracketType": { "type": "string", diff --git a/src/wp-includes/blocks/term-template.php b/src/wp-includes/blocks/term-template.php index c6fa390c4ec47..d0d44f44e6b9d 100644 --- a/src/wp-includes/blocks/term-template.php +++ b/src/wp-includes/blocks/term-template.php @@ -66,8 +66,7 @@ function render_block_core_term_template( $attributes, $content, $block ) { } } - $terms_query = new WP_Term_Query( $query_args ); - $terms = $terms_query->get_terms(); + $terms = get_terms( $query_args ); if ( ! $terms || is_wp_error( $terms ) ) { return ''; @@ -85,9 +84,10 @@ function render_block_core_term_template( $attributes, $content, $block ) { $term_id = $term->term_id; $taxonomy = $term->taxonomy; - $filter_block_context = static function ( $context ) use ( $term_id, $taxonomy ) { + $filter_block_context = static function ( $context ) use ( $term_id, $taxonomy, $term ) { $context['termId'] = $term_id; $context['taxonomy'] = $taxonomy; + $context['termData'] = $term; return $context; }; diff --git a/src/wp-includes/blocks/term-template/block.json b/src/wp-includes/blocks/term-template/block.json index 509077269eaa0..54a180afa39ba 100644 --- a/src/wp-includes/blocks/term-template/block.json +++ b/src/wp-includes/blocks/term-template/block.json @@ -25,6 +25,8 @@ "color": { "gradients": true, "link": true, + "heading": true, + "button": true, "__experimentalDefaultControls": { "background": true, "text": true diff --git a/src/wp-includes/blocks/terms-query/block.json b/src/wp-includes/blocks/terms-query/block.json index 1741de5e5b2fd..e06f493a23e1d 100644 --- a/src/wp-includes/blocks/terms-query/block.json +++ b/src/wp-includes/blocks/terms-query/block.json @@ -35,6 +35,11 @@ "align": [ "wide", "full" ], "html": false, "layout": true, + "spacing": { + "padding": true, + "margin": true, + "blockGap": true + }, "interactivity": true } } diff --git a/src/wp-includes/blocks/video.php b/src/wp-includes/blocks/video.php index f5307729dccd2..4f1350a5764b7 100644 --- a/src/wp-includes/blocks/video.php +++ b/src/wp-includes/blocks/video.php @@ -22,6 +22,31 @@ function render_block_core_video( array $attributes, string $content ): string { return $content; } + /* + * Inspect the video to determine whether autoplay is enabled and, when it + * is, set the interactivity directives that stop playback for visitors who + * prefer reduced motion. + * + * The directives are added here rather than in the saved markup so existing + * content does not need a deprecation. + * + * `autoplay` is read from the markup rather than from `$attributes`, because + * it is sourced from the `video` element and so is never stored in the block + * comment delimiter the server parses. + */ + $autoplay_processor = new WP_HTML_Tag_Processor( $content ); + if ( + $autoplay_processor->next_tag( array( 'tag_name' => 'VIDEO' ) ) && + null !== $autoplay_processor->get_attribute( 'autoplay' ) + ) { + wp_enqueue_script_module( '@wordpress/block-library/video/view' ); + + $autoplay_processor->set_attribute( 'data-wp-interactive', 'core/video' ); + $autoplay_processor->set_attribute( 'data-wp-init', 'callbacks.stopAutoplay' ); + + $content = $autoplay_processor->get_updated_html(); + } + // If the 'id' attribute is not populated for a video attachment, abort. if ( ! isset( $attributes['id'] ) || diff --git a/src/wp-includes/blocks/video/block.json b/src/wp-includes/blocks/video/block.json index a1e259f196dcd..f030c66090501 100644 --- a/src/wp-includes/blocks/video/block.json +++ b/src/wp-includes/blocks/video/block.json @@ -103,13 +103,20 @@ } }, "interactivity": { - "clientNavigation": true + "clientNavigation": true, + "interactive": true }, "shadow": { "__experimentalSkipSerialization": true + }, + "dimensions": { + "minWidth": true, + "minHeight": true, + "__experimentalSkipSerialization": true } }, "selectors": { + "dimensions": ".wp-block-video video", "shadow": ".wp-block-video video", "filter": { "duotone": ".wp-block-video video" diff --git a/src/wp-includes/build/constants.php b/src/wp-includes/build/constants.php index 3bf290f0186b2..c4cf4649ad707 100644 --- a/src/wp-includes/build/constants.php +++ b/src/wp-includes/build/constants.php @@ -9,6 +9,6 @@ */ return array( - 'version' => '24.2.0', + 'version' => '24.3.0-rc.1', 'build_url' => includes_url( 'build/' ), ); diff --git a/src/wp-includes/build/pages/font-library/page-wp-admin.php b/src/wp-includes/build/pages/font-library/page-wp-admin.php index bc5625319a725..3e0d420e5bf27 100644 --- a/src/wp-includes/build/pages/font-library/page-wp-admin.php +++ b/src/wp-includes/build/pages/font-library/page-wp-admin.php @@ -90,10 +90,22 @@ function wp_font_library_wp_admin_preload_data() { // This must exactly match the _fields list in packages/core-data/src/entities.js, // same fields in the same order, or the preload is never consumed. $preload_paths = array( - '/?_fields=description,gmt_offset,home,image_max_bit_depth,image_sizes,image_size_threshold,image_strip_meta,name,site_icon,site_icon_url,site_logo,timezone_string,url,page_for_posts,page_on_front,show_on_front', + '/?_fields=description,generate_animated_image_subsizes,gmt_offset,home,image_max_bit_depth,image_sizes,image_size_threshold,image_strip_meta,name,site_icon,site_icon_url,site_logo,timezone_string,url,page_for_posts,page_on_front,show_on_front', array( '/wp/v2/settings', 'OPTIONS' ), ); + /** + * Filters the REST API paths preloaded for this page. + * + * Each entry is either a string path (GET) or a `[ path, method ]` tuple. + * Pages that know which requests their JS will issue on mount can add + * them here so the responses are embedded in the initial HTML rather + * than fetched over the network after hydration. + * + * @param array $preload_paths Paths to preload. + */ + $preload_paths = apply_filters( 'wp_font_library_wp_admin_preload_paths', $preload_paths ); + // Use rest_preload_api_request to gather the preloaded data $preload_data = array_reduce( $preload_paths, diff --git a/src/wp-includes/build/pages/font-library/page.php b/src/wp-includes/build/pages/font-library/page.php index f1413c181c202..a4a0f3437d365 100644 --- a/src/wp-includes/build/pages/font-library/page.php +++ b/src/wp-includes/build/pages/font-library/page.php @@ -91,7 +91,7 @@ function wp_font_library_preload_data() { // This must exactly match the _fields list in packages/core-data/src/entities.js, // same fields in the same order, or the preload is never consumed. $preload_paths = array( - '/?_fields=description,gmt_offset,home,image_max_bit_depth,image_sizes,image_size_threshold,image_strip_meta,name,site_icon,site_icon_url,site_logo,timezone_string,url,page_for_posts,page_on_front,show_on_front', + '/?_fields=description,generate_animated_image_subsizes,gmt_offset,home,image_max_bit_depth,image_sizes,image_size_threshold,image_strip_meta,name,site_icon,site_icon_url,site_logo,timezone_string,url,page_for_posts,page_on_front,show_on_front', array( '/wp/v2/settings', 'OPTIONS' ), ); diff --git a/src/wp-includes/build/pages/options-connectors/page-wp-admin.php b/src/wp-includes/build/pages/options-connectors/page-wp-admin.php index 0bc111244ec8c..c4a6892b17e6c 100644 --- a/src/wp-includes/build/pages/options-connectors/page-wp-admin.php +++ b/src/wp-includes/build/pages/options-connectors/page-wp-admin.php @@ -90,10 +90,22 @@ function wp_options_connectors_wp_admin_preload_data() { // This must exactly match the _fields list in packages/core-data/src/entities.js, // same fields in the same order, or the preload is never consumed. $preload_paths = array( - '/?_fields=description,gmt_offset,home,image_max_bit_depth,image_sizes,image_size_threshold,image_strip_meta,name,site_icon,site_icon_url,site_logo,timezone_string,url,page_for_posts,page_on_front,show_on_front', + '/?_fields=description,generate_animated_image_subsizes,gmt_offset,home,image_max_bit_depth,image_sizes,image_size_threshold,image_strip_meta,name,site_icon,site_icon_url,site_logo,timezone_string,url,page_for_posts,page_on_front,show_on_front', array( '/wp/v2/settings', 'OPTIONS' ), ); + /** + * Filters the REST API paths preloaded for this page. + * + * Each entry is either a string path (GET) or a `[ path, method ]` tuple. + * Pages that know which requests their JS will issue on mount can add + * them here so the responses are embedded in the initial HTML rather + * than fetched over the network after hydration. + * + * @param array $preload_paths Paths to preload. + */ + $preload_paths = apply_filters( 'wp_options_connectors_wp_admin_preload_paths', $preload_paths ); + // Use rest_preload_api_request to gather the preloaded data $preload_data = array_reduce( $preload_paths, diff --git a/src/wp-includes/build/pages/options-connectors/page.php b/src/wp-includes/build/pages/options-connectors/page.php index e563b7c231520..05bab2afb4a96 100644 --- a/src/wp-includes/build/pages/options-connectors/page.php +++ b/src/wp-includes/build/pages/options-connectors/page.php @@ -91,7 +91,7 @@ function wp_options_connectors_preload_data() { // This must exactly match the _fields list in packages/core-data/src/entities.js, // same fields in the same order, or the preload is never consumed. $preload_paths = array( - '/?_fields=description,gmt_offset,home,image_max_bit_depth,image_sizes,image_size_threshold,image_strip_meta,name,site_icon,site_icon_url,site_logo,timezone_string,url,page_for_posts,page_on_front,show_on_front', + '/?_fields=description,generate_animated_image_subsizes,gmt_offset,home,image_max_bit_depth,image_sizes,image_size_threshold,image_strip_meta,name,site_icon,site_icon_url,site_logo,timezone_string,url,page_for_posts,page_on_front,show_on_front', array( '/wp/v2/settings', 'OPTIONS' ), ); diff --git a/src/wp-includes/build/routes/connectors-home/content.js b/src/wp-includes/build/routes/connectors-home/content.js index 73caabe641b12..20df6e97e0bc1 100644 --- a/src/wp-includes/build/routes/connectors-home/content.js +++ b/src/wp-includes/build/routes/connectors-home/content.js @@ -35,13 +35,6 @@ var require_i18n = __commonJS({ } }); -// package-external:@wordpress/element -var require_element = __commonJS({ - "package-external:@wordpress/element"(exports, module) { - module.exports = window.wp.element; - } -}); - // vendor-external:react var require_react = __commonJS({ "vendor-external:react"(exports, module) { @@ -63,16 +56,30 @@ var require_react_dom = __commonJS({ } }); -// node_modules/.store/use-sync-external-store@1.6.0-I0W9gfWaba5M6uWU9Ouj4A/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +// package-external:@wordpress/element +var require_element = __commonJS({ + "package-external:@wordpress/element"(exports, module) { + module.exports = window.wp.element; + } +}); + +// package-external:@wordpress/primitives +var require_primitives = __commonJS({ + "package-external:@wordpress/primitives"(exports, module) { + module.exports = window.wp.primitives; + } +}); + +// node_modules/.store/use-sync-external-store@1.7.0-jHNF5n8408rkWhZ5NHKclA/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js var require_use_sync_external_store_shim_development = __commonJS({ - "node_modules/.store/use-sync-external-store@1.6.0-I0W9gfWaba5M6uWU9Ouj4A/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js"(exports) { + "node_modules/.store/use-sync-external-store@1.7.0-jHNF5n8408rkWhZ5NHKclA/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js"(exports) { "use strict"; (function() { function is(x, y) { return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y; } function useSyncExternalStore$2(subscribe, getSnapshot) { - didWarnOld18Alpha || void 0 === React52.startTransition || (didWarnOld18Alpha = true, console.error( + didWarnOld18Alpha || void 0 === React53.startTransition || (didWarnOld18Alpha = true, console.error( "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release." )); var value = getSnapshot(); @@ -120,16 +127,16 @@ var require_use_sync_external_store_shim_development = __commonJS({ return getSnapshot(); } "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); - var React52 = require_react(), objectIs = "function" === typeof Object.is ? Object.is : is, useState14 = React52.useState, useEffect14 = React52.useEffect, useLayoutEffect3 = React52.useLayoutEffect, useDebugValue2 = React52.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2; - exports.useSyncExternalStore = void 0 !== React52.useSyncExternalStore ? React52.useSyncExternalStore : shim; + var React53 = require_react(), objectIs = "function" === typeof Object.is ? Object.is : is, useState14 = React53.useState, useEffect14 = React53.useEffect, useLayoutEffect3 = React53.useLayoutEffect, useDebugValue2 = React53.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2; + exports.useSyncExternalStore = void 0 !== React53.useSyncExternalStore ? React53.useSyncExternalStore : shim; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error()); })(); } }); -// node_modules/.store/use-sync-external-store@1.6.0-I0W9gfWaba5M6uWU9Ouj4A/node_modules/use-sync-external-store/shim/index.js +// node_modules/.store/use-sync-external-store@1.7.0-jHNF5n8408rkWhZ5NHKclA/node_modules/use-sync-external-store/shim/index.js var require_shim = __commonJS({ - "node_modules/.store/use-sync-external-store@1.6.0-I0W9gfWaba5M6uWU9Ouj4A/node_modules/use-sync-external-store/shim/index.js"(exports, module) { + "node_modules/.store/use-sync-external-store@1.7.0-jHNF5n8408rkWhZ5NHKclA/node_modules/use-sync-external-store/shim/index.js"(exports, module) { "use strict"; if (false) { module.exports = null; @@ -139,18 +146,18 @@ var require_shim = __commonJS({ } }); -// node_modules/.store/use-sync-external-store@1.6.0-I0W9gfWaba5M6uWU9Ouj4A/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +// node_modules/.store/use-sync-external-store@1.7.0-jHNF5n8408rkWhZ5NHKclA/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js var require_with_selector_development = __commonJS({ - "node_modules/.store/use-sync-external-store@1.6.0-I0W9gfWaba5M6uWU9Ouj4A/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js"(exports) { + "node_modules/.store/use-sync-external-store@1.7.0-jHNF5n8408rkWhZ5NHKclA/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js"(exports) { "use strict"; (function() { function is(x, y) { return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y; } "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); - var React52 = require_react(), shim = require_shim(), objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore3 = shim.useSyncExternalStore, useRef21 = React52.useRef, useEffect14 = React52.useEffect, useMemo17 = React52.useMemo, useDebugValue2 = React52.useDebugValue; + var React53 = require_react(), shim = require_shim(), objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore3 = shim.useSyncExternalStore, useRef22 = React53.useRef, useEffect14 = React53.useEffect, useMemo17 = React53.useMemo, useDebugValue2 = React53.useDebugValue; exports.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) { - var instRef = useRef21(null); + var instRef = useRef22(null); if (null === instRef.current) { var inst = { hasValue: false, value: null }; instRef.current = inst; @@ -206,9 +213,9 @@ var require_with_selector_development = __commonJS({ } }); -// node_modules/.store/use-sync-external-store@1.6.0-I0W9gfWaba5M6uWU9Ouj4A/node_modules/use-sync-external-store/shim/with-selector.js +// node_modules/.store/use-sync-external-store@1.7.0-jHNF5n8408rkWhZ5NHKclA/node_modules/use-sync-external-store/shim/with-selector.js var require_with_selector = __commonJS({ - "node_modules/.store/use-sync-external-store@1.6.0-I0W9gfWaba5M6uWU9Ouj4A/node_modules/use-sync-external-store/shim/with-selector.js"(exports, module) { + "node_modules/.store/use-sync-external-store@1.7.0-jHNF5n8408rkWhZ5NHKclA/node_modules/use-sync-external-store/shim/with-selector.js"(exports, module) { "use strict"; if (false) { module.exports = null; @@ -232,13 +239,6 @@ var require_private_apis = __commonJS({ } }); -// package-external:@wordpress/primitives -var require_primitives = __commonJS({ - "package-external:@wordpress/primitives"(exports, module) { - module.exports = window.wp.primitives; - } -}); - // package-external:@wordpress/components var require_components = __commonJS({ "package-external:@wordpress/components"(exports, module) { @@ -274,120 +274,21 @@ var require_url = __commonJS({ } }); -// node_modules/.store/clsx@2.1.1-XOLP1vUL9vEGfpiXm37fAw/node_modules/clsx/dist/clsx.mjs -function r(e) { - var t, f, n = ""; - if ("string" == typeof e || "number" == typeof e) n += e; - else if ("object" == typeof e) if (Array.isArray(e)) { - var o = e.length; - for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f); - } else for (f in e) e[f] && (n && (n += " "), n += f); - return n; -} -function clsx() { - for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t); - return n; -} -var clsx_default = clsx; - -// packages/ui/build-module/badge/badge.mjs -var import_element11 = __toESM(require_element(), 1); - -// node_modules/.store/@base-ui/utils@0.4.0-Z81C5N42agUorsFwt3T4Yw/node_modules/@base-ui/utils/createLogOnce.mjs -var loggedMessages; -if (true) { - loggedMessages = /* @__PURE__ */ new Set(); -} -function createLogOnce(severity, prefix) { - return function logOnce(...messages) { - if (true) { - const message = messages.join(" "); - const output = prefix ? `${prefix}: ${message}` : message; - const key = `${severity}:${output}`; - if (!loggedMessages.has(key)) { - loggedMessages.add(key); - if (severity === "warn") { - console.warn(output); - } else { - console.error(output); - } - } - } - }; -} - -// node_modules/.store/@base-ui/utils@0.4.0-Z81C5N42agUorsFwt3T4Yw/node_modules/@base-ui/utils/error.mjs -var error = createLogOnce("error", "Base UI"); +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/useRenderElement.mjs +var React4 = __toESM(require_react(), 1); -// node_modules/.store/@base-ui/utils@0.4.0-Z81C5N42agUorsFwt3T4Yw/node_modules/@base-ui/utils/safeReact.mjs +// node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/useRefWithInit.mjs var React = __toESM(require_react(), 1); -var SafeReact = { - ...React -}; - -// node_modules/.store/@base-ui/utils@0.4.0-Z81C5N42agUorsFwt3T4Yw/node_modules/@base-ui/utils/useRefWithInit.mjs -var React2 = __toESM(require_react(), 1); var UNINITIALIZED = {}; function useRefWithInit(init, initArg) { - const ref = React2.useRef(UNINITIALIZED); + const ref = React.useRef(UNINITIALIZED); if (ref.current === UNINITIALIZED) { ref.current = init(initArg); } return ref; } -// node_modules/.store/@base-ui/utils@0.4.0-Z81C5N42agUorsFwt3T4Yw/node_modules/@base-ui/utils/useStableCallback.mjs -var useInsertionEffect = SafeReact.useInsertionEffect; -var useSafeInsertionEffect = ( - // React 17 doesn't have useInsertionEffect. - useInsertionEffect && // Preact replaces useInsertionEffect with useLayoutEffect and fires too late. - useInsertionEffect !== SafeReact.useLayoutEffect ? useInsertionEffect : (fn) => fn() -); -function useStableCallback(callback) { - const stable = useRefWithInit(createStableCallback).current; - stable.next = callback; - useSafeInsertionEffect(stable.effect); - return stable.trampoline; -} -function createStableCallback() { - const stable = { - next: void 0, - callback: assertNotCalled, - trampoline: (...args) => stable.callback?.(...args), - effect: () => { - stable.callback = stable.next; - } - }; - return stable; -} -function assertNotCalled() { - if (true) { - throw ( - /* minify-error-disabled */ - new Error("Base UI: Cannot call an event handler while rendering.") - ); - } -} - -// node_modules/.store/@base-ui/utils@0.4.0-Z81C5N42agUorsFwt3T4Yw/node_modules/@base-ui/utils/warn.mjs -var warn = createLogOnce("warn", "Base UI"); - -// node_modules/.store/@base-ui/utils@0.4.0-Z81C5N42agUorsFwt3T4Yw/node_modules/@base-ui/utils/empty.mjs -function NOOP() { -} -var EMPTY_ARRAY = Object.freeze([]); -var EMPTY_OBJECT = Object.freeze({}); - -// node_modules/.store/@base-ui/utils@0.4.0-Z81C5N42agUorsFwt3T4Yw/node_modules/@base-ui/utils/useIsoLayoutEffect.mjs -var React3 = __toESM(require_react(), 1); -var noop = () => { -}; -var useIsoLayoutEffect = typeof document !== "undefined" ? React3.useLayoutEffect : noop; - -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/internals/useRenderElement.mjs -var React6 = __toESM(require_react(), 1); - -// node_modules/.store/@base-ui/utils@0.4.0-Z81C5N42agUorsFwt3T4Yw/node_modules/@base-ui/utils/useMergedRefs.mjs +// node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/useMergedRefs.mjs function useMergedRefs(a, b, c, d) { const forkRef = useRefWithInit(createForkRef).current; if (didChange(forkRef, a, b, c, d)) { @@ -476,19 +377,19 @@ function update(forkRef, refs) { }; } -// node_modules/.store/@base-ui/utils@0.4.0-Z81C5N42agUorsFwt3T4Yw/node_modules/@base-ui/utils/getReactElementRef.mjs -var React5 = __toESM(require_react(), 1); +// node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/getReactElementRef.mjs +var React3 = __toESM(require_react(), 1); -// node_modules/.store/@base-ui/utils@0.4.0-Z81C5N42agUorsFwt3T4Yw/node_modules/@base-ui/utils/reactVersion.mjs -var React4 = __toESM(require_react(), 1); -var majorVersion = parseInt(React4.version, 10); +// node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/reactVersion.mjs +var React2 = __toESM(require_react(), 1); +var majorVersion = parseInt(React2.version, 10); function isReactVersionAtLeast(reactVersionToCheck) { return majorVersion >= reactVersionToCheck; } -// node_modules/.store/@base-ui/utils@0.4.0-Z81C5N42agUorsFwt3T4Yw/node_modules/@base-ui/utils/getReactElementRef.mjs +// node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/getReactElementRef.mjs function getReactElementRef(element) { - if (!/* @__PURE__ */ React5.isValidElement(element)) { + if (!/* @__PURE__ */ React3.isValidElement(element)) { return null; } const reactElement = element; @@ -496,7 +397,7 @@ function getReactElementRef(element) { return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null; } -// node_modules/.store/@base-ui/utils@0.4.0-Z81C5N42agUorsFwt3T4Yw/node_modules/@base-ui/utils/mergeObjects.mjs +// node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/mergeObjects.mjs function mergeObjects(a, b) { if (a && !b) { return a; @@ -513,7 +414,39 @@ function mergeObjects(a, b) { return void 0; } -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/internals/getStateAttributesProps.mjs +// node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/createLogOnce.mjs +var loggedMessages; +if (true) { + loggedMessages = /* @__PURE__ */ new Set(); +} +function createLogOnce(severity, prefix) { + return function logOnce(...messages) { + if (true) { + const message = messages.join(" "); + const output = prefix ? `${prefix}: ${message}` : message; + const key = `${severity}:${output}`; + if (!loggedMessages.has(key)) { + loggedMessages.add(key); + if (severity === "warn") { + console.warn(output); + } else { + console.error(output); + } + } + } + }; +} + +// node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/warn.mjs +var warn = createLogOnce("warn", "Base UI"); + +// node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/empty.mjs +function NOOP() { +} +var EMPTY_ARRAY = Object.freeze([]); +var EMPTY_OBJECT = Object.freeze({}); + +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/getStateAttributesProps.mjs function getStateAttributesProps(state, customMapping) { const props = {}; for (const key in state) { @@ -534,17 +467,17 @@ function getStateAttributesProps(state, customMapping) { return props; } -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/utils/resolveClassName.mjs +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/resolveClassName.mjs function resolveClassName(className, state) { return typeof className === "function" ? className(state) : className; } -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/utils/resolveStyle.mjs +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/resolveStyle.mjs function resolveStyle(style, state) { return typeof style === "function" ? style(state) : style; } -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/merge-props/mergeProps.mjs +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/merge-props/mergeProps.mjs var EMPTY_PROPS = {}; function mergeProps(a, b, c, d, e) { if (!c && !d && !e && !a) { @@ -581,14 +514,14 @@ function mergePropsN(props) { function createInitialMergedProps(inputProps) { if (isPropsGetter(inputProps)) { return { - ...resolvePropsGetter(inputProps, EMPTY_PROPS) + ...inputProps(EMPTY_PROPS) }; } return copyInitialProps(inputProps); } function mergeInto(merged, inputProps) { if (isPropsGetter(inputProps)) { - return resolvePropsGetter(inputProps, merged); + return inputProps(merged); } return mutablyMergeInto(merged, inputProps); } @@ -639,12 +572,6 @@ function isEventHandler(key, value) { function isPropsGetter(inputProps) { return typeof inputProps === "function"; } -function resolvePropsGetter(inputProps, previousProps) { - if (isPropsGetter(inputProps)) { - return inputProps(previousProps); - } - return inputProps ?? EMPTY_PROPS; -} function mergeEventHandlers(ourHandler, theirHandler) { if (!theirHandler) { return ourHandler; @@ -699,7 +626,7 @@ function isSyntheticEvent(event) { return event != null && typeof event === "object" && "nativeEvent" in event; } -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/internals/useRenderElement.mjs +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/useRenderElement.mjs var import_react = __toESM(require_react(), 1); function useRenderElement(element, componentProps, params = {}) { let renderProp = componentProps.render; @@ -763,8 +690,8 @@ function unwrapLazyRenderProp(render) { if (render?.$$typeof !== REACT_LAZY_TYPE) { return render; } - const unwrapped = React6.Children.toArray(render)[0]; - return /* @__PURE__ */ React6.isValidElement(unwrapped) ? unwrapped : render; + const unwrapped = React4.Children.toArray(render)[0]; + return /* @__PURE__ */ React4.isValidElement(unwrapped) ? unwrapped : render; } function evaluateRenderProp(element, render, props, state) { if (render) { @@ -777,18 +704,13 @@ function evaluateRenderProp(element, render, props, state) { const mergedProps = mergeProps(props, render.props); mergedProps.ref = props.ref; if (true) { - if (!/* @__PURE__ */ React6.isValidElement(render)) { + if (!/* @__PURE__ */ React4.isValidElement(render)) { throw new Error(["Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.", "A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.", "https://base-ui.com/r/invalid-render-prop"].join("\n")); } } - return /* @__PURE__ */ React6.cloneElement(render, mergedProps); + return /* @__PURE__ */ React4.cloneElement(render, mergedProps); } - if (element) { - if (typeof element === "string") { - return renderTag(element, props); - } - } - throw new Error(true ? "Base UI: Render element or function are not defined." : formatErrorMessage_default(8)); + return renderTag(element, props); } function warnIfRenderPropLooksLikeComponent(renderFn) { const functionName = renderFn.name; @@ -818,148 +740,67 @@ function renderTag(Tag, props) { key: props.key }); } - return /* @__PURE__ */ React6.createElement(Tag, props); + return /* @__PURE__ */ React4.createElement(Tag, props); } -// node_modules/.store/@base-ui/utils@0.4.0-Z81C5N42agUorsFwt3T4Yw/node_modules/@base-ui/utils/useId.mjs -var React7 = __toESM(require_react(), 1); -var globalId = 0; -function useGlobalId(idOverride, prefix = "mui") { - const [defaultId, setDefaultId] = React7.useState(idOverride); - const id = idOverride || defaultId; - React7.useEffect(() => { - if (defaultId == null) { - globalId += 1; - setDefaultId(`${prefix}-${globalId}`); +// node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/safeReact.mjs +var React5 = __toESM(require_react(), 1); +var SafeReact = { + ...React5 +}; + +// node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/useStableCallback.mjs +var useInsertionEffect = SafeReact.useInsertionEffect; +var useSafeInsertionEffect = ( + // React 17 doesn't have useInsertionEffect. + useInsertionEffect && // Preact replaces useInsertionEffect with useLayoutEffect and fires too late. + useInsertionEffect !== SafeReact.useLayoutEffect ? useInsertionEffect : (fn) => fn() +); +function useStableCallback(callback) { + const stable = useRefWithInit(createStableCallback).current; + stable.next = callback; + useSafeInsertionEffect(stable.effect); + return stable.trampoline; +} +function createStableCallback() { + const stable = { + next: void 0, + callback: assertNotCalled, + trampoline: (...args) => stable.callback?.(...args), + effect: () => { + stable.callback = stable.next; } - }, [defaultId, prefix]); - return id; + }; + return stable; } -var maybeReactUseId = SafeReact.useId; -function useId(idOverride, prefix) { - if (maybeReactUseId !== void 0) { - const reactId = maybeReactUseId(); - return idOverride ?? (prefix ? `${prefix}-${reactId}` : reactId); +function assertNotCalled() { + if (true) { + throw ( + /* minify-error-disabled */ + new Error("Base UI: Cannot call an event handler while rendering.") + ); } - return useGlobalId(idOverride, prefix); } -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/internals/useBaseUiId.mjs -function useBaseUiId(idOverride) { - return useId(idOverride, "base-ui"); +// node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/useIsoLayoutEffect.mjs +var React6 = __toESM(require_react(), 1); +var noop = () => { +}; +var useIsoLayoutEffect = typeof document !== "undefined" ? React6.useLayoutEffect : noop; + +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/useOpenChangeComplete.mjs +var React8 = __toESM(require_react(), 1); + +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/useAnimationsFinished.mjs +var ReactDOM = __toESM(require_react_dom(), 1); + +// node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/useOnMount.mjs +var React7 = __toESM(require_react(), 1); +function useOnMount(fn) { + React7.useEffect(fn, EMPTY_ARRAY); } -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/internals/reason-parts.mjs -var reason_parts_exports = {}; -__export(reason_parts_exports, { - cancelOpen: () => cancelOpen, - chipRemovePress: () => chipRemovePress, - clearPress: () => clearPress, - closePress: () => closePress, - closeWatcher: () => closeWatcher, - decrementPress: () => decrementPress, - disabled: () => disabled, - drag: () => drag, - escapeKey: () => escapeKey, - focusOut: () => focusOut, - imperativeAction: () => imperativeAction, - incrementPress: () => incrementPress, - initial: () => initial, - inputBlur: () => inputBlur, - inputChange: () => inputChange, - inputClear: () => inputClear, - inputPaste: () => inputPaste, - inputPress: () => inputPress, - itemPress: () => itemPress, - keyboard: () => keyboard, - linkPress: () => linkPress, - listNavigation: () => listNavigation, - missing: () => missing, - none: () => none, - outsidePress: () => outsidePress, - pointer: () => pointer, - scrub: () => scrub, - siblingOpen: () => siblingOpen, - swipe: () => swipe, - trackPress: () => trackPress, - triggerFocus: () => triggerFocus, - triggerHover: () => triggerHover, - triggerPress: () => triggerPress, - wheel: () => wheel, - windowResize: () => windowResize -}); -var none = "none"; -var triggerPress = "trigger-press"; -var triggerHover = "trigger-hover"; -var triggerFocus = "trigger-focus"; -var outsidePress = "outside-press"; -var itemPress = "item-press"; -var closePress = "close-press"; -var linkPress = "link-press"; -var clearPress = "clear-press"; -var chipRemovePress = "chip-remove-press"; -var trackPress = "track-press"; -var incrementPress = "increment-press"; -var decrementPress = "decrement-press"; -var inputChange = "input-change"; -var inputClear = "input-clear"; -var inputBlur = "input-blur"; -var inputPaste = "input-paste"; -var inputPress = "input-press"; -var focusOut = "focus-out"; -var escapeKey = "escape-key"; -var closeWatcher = "close-watcher"; -var listNavigation = "list-navigation"; -var keyboard = "keyboard"; -var pointer = "pointer"; -var drag = "drag"; -var wheel = "wheel"; -var scrub = "scrub"; -var cancelOpen = "cancel-open"; -var siblingOpen = "sibling-open"; -var disabled = "disabled"; -var missing = "missing"; -var initial = "initial"; -var imperativeAction = "imperative-action"; -var swipe = "swipe"; -var windowResize = "window-resize"; - -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/internals/createBaseUIEventDetails.mjs -function createChangeEventDetails(reason, event, trigger, customProperties) { - let canceled = false; - let allowPropagation = false; - const custom = customProperties ?? EMPTY_OBJECT; - const details = { - reason, - event: event ?? new Event("base-ui"), - cancel() { - canceled = true; - }, - allowPropagation() { - allowPropagation = true; - }, - get isCanceled() { - return canceled; - }, - get isPropagationAllowed() { - return allowPropagation; - }, - trigger, - ...custom - }; - return details; -} - -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/internals/useTransitionStatus.mjs -var React9 = __toESM(require_react(), 1); - -// node_modules/.store/@base-ui/utils@0.4.0-Z81C5N42agUorsFwt3T4Yw/node_modules/@base-ui/utils/useOnMount.mjs -var React8 = __toESM(require_react(), 1); -function useOnMount(fn) { - React8.useEffect(fn, EMPTY_ARRAY); -} - -// node_modules/.store/@base-ui/utils@0.4.0-Z81C5N42agUorsFwt3T4Yw/node_modules/@base-ui/utils/useAnimationFrame.mjs +// node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/useAnimationFrame.mjs var EMPTY = null; var LAST_RAF = globalThis.requestAnimationFrame; var Scheduler = class { @@ -1050,7 +891,153 @@ function useAnimationFrame() { return timeout; } -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/internals/useTransitionStatus.mjs +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/resolveRef.mjs +function resolveRef(maybeRef) { + if (maybeRef == null) { + return maybeRef; + } + return "current" in maybeRef ? maybeRef.current : maybeRef; +} + +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/getFiniteAnimations.mjs +function getFiniteAnimations(element, options) { + return element.getAnimations(options).filter((animation) => { + const timing = animation.effect?.getTiming(); + return timing?.duration !== Infinity && timing?.iterations !== Infinity; + }); +} + +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/TransitionStatusDataAttributes.mjs +var startingStyle = "data-starting-style"; +var endingStyle = "data-ending-style"; + +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/useAnimationsFinished.mjs +var pendingCallbacks = null; +function flushBeforePaint(fn) { + if (!pendingCallbacks) { + const callbacks = []; + pendingCallbacks = callbacks; + queueMicrotask(() => { + pendingCallbacks = null; + ReactDOM.flushSync(() => { + for (const callback of callbacks) { + callback(); + } + }); + }); + } + pendingCallbacks.push(fn); +} +function useAnimationsFinished(elementOrRef, waitForStartingStyleRemoved = false, batch = false) { + const frame = useAnimationFrame(); + return useStableCallback((fnToExecute, signal = null) => { + frame.cancel(); + const element = resolveRef(elementOrRef); + if (element == null) { + return; + } + const resolvedElement = element; + const done = () => { + if (!batch) { + ReactDOM.flushSync(fnToExecute); + return; + } + flushBeforePaint(() => { + if (!signal?.aborted) { + fnToExecute(); + } + }); + }; + if (typeof resolvedElement.getAnimations !== "function" || globalThis.BASE_UI_ANIMATIONS_DISABLED) { + fnToExecute(); + return; + } + function exec() { + Promise.all(getFiniteAnimations(resolvedElement).map((animation) => animation.finished.then(NOOP))).then(() => { + if (!signal?.aborted) { + done(); + } + }, () => { + if (signal?.aborted) { + return; + } + const currentAnimations = getFiniteAnimations(resolvedElement); + if (currentAnimations.some((animation) => animation.pending || animation.playState !== "finished")) { + exec(); + return; + } + done(); + }); + } + if (waitForStartingStyleRemoved) { + const startingStyleAttribute = startingStyle; + if (!resolvedElement.hasAttribute(startingStyleAttribute)) { + frame.request(exec); + return; + } + const attributeObserver = new MutationObserver(() => { + if (!resolvedElement.hasAttribute(startingStyleAttribute)) { + attributeObserver.disconnect(); + exec(); + } + }); + attributeObserver.observe(resolvedElement, { + attributes: true, + attributeFilter: [startingStyleAttribute] + }); + signal?.addEventListener("abort", () => attributeObserver.disconnect(), { + once: true + }); + return; + } + frame.request(exec); + }); +} + +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/useOpenChangeComplete.mjs +function useOpenChangeComplete(parameters) { + const { + enabled = true, + open: open2, + ref, + batch = false, + onComplete: onCompleteParam + } = parameters; + const onComplete = useStableCallback(onCompleteParam); + const runOnceAnimationsFinish = useAnimationsFinished(ref, open2, batch); + React8.useEffect(() => { + if (!enabled) { + return void 0; + } + const abortController = new AbortController(); + runOnceAnimationsFinish(onComplete, abortController.signal); + return () => { + abortController.abort(); + }; + }, [enabled, open2, onComplete, runOnceAnimationsFinish]); +} + +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/stateAttributesMapping.mjs +var STARTING_HOOK = { + [startingStyle]: "" +}; +var ENDING_HOOK = { + [endingStyle]: "" +}; +var transitionStatusMapping = { + transitionStatus(value) { + if (value === "starting") { + return STARTING_HOOK; + } + if (value === "ending") { + return ENDING_HOOK; + } + return null; + } +}; + +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/useTransitionStatus.mjs +var React9 = __toESM(require_react(), 1); function useTransitionStatus(open2, enableIdleState = false, deferEndingState = false, animateInitialOpen = false) { const [transitionStatus, setTransitionStatus] = React9.useState(open2 && enableIdleState ? "idle" : void 0); const [mounted, setMounted] = React9.useState(open2 && !animateInitialOpen); @@ -1076,7 +1063,7 @@ function useTransitionStatus(open2, enableIdleState = false, deferEndingState = return void 0; }, [open2, mounted, transitionStatus, deferEndingState]); useIsoLayoutEffect(() => { - if (!open2 || enableIdleState) { + if (!open2 || enableIdleState || transitionStatus === void 0) { return void 0; } const frame = AnimationFrame.request(() => { @@ -1085,7 +1072,7 @@ function useTransitionStatus(open2, enableIdleState = false, deferEndingState = return () => { AnimationFrame.cancel(frame); }; - }, [enableIdleState, open2]); + }, [enableIdleState, open2, transitionStatus]); useIsoLayoutEffect(() => { if (!open2 || !enableIdleState) { return void 0; @@ -1107,58 +1094,257 @@ function useTransitionStatus(open2, enableIdleState = false, deferEndingState = }; } -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/internals/TransitionStatusDataAttributes.mjs -var startingStyle = "data-starting-style"; -var endingStyle = "data-ending-style"; - -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/internals/stateAttributesMapping.mjs -var STARTING_HOOK = { - [startingStyle]: "" -}; -var ENDING_HOOK = { - [endingStyle]: "" -}; -var transitionStatusMapping = { - transitionStatus(value) { - if (value === "starting") { - return STARTING_HOOK; - } - if (value === "ending") { - return ENDING_HOOK; - } - return null; +// node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/useTimeout.mjs +var EMPTY2 = 0; +var Timeout = class _Timeout { + static create() { + return new _Timeout(); } -}; - -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/internals/use-button/useButton.mjs -var React12 = __toESM(require_react(), 1); - -// node_modules/.store/@floating-ui/utils@0.2.12-gOxTzMf36nCrbeHpEew-rw/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs -function hasWindow() { - return typeof window !== "undefined"; -} -function getNodeName(node) { - if (isNode(node)) { - return (node.nodeName || "").toLowerCase(); + currentId = EMPTY2; + /** + * Executes `fn` after `delay`, clearing any previously scheduled call. + */ + start(delay, fn) { + this.clear(); + this.currentId = setTimeout(() => { + this.currentId = EMPTY2; + fn(); + }, delay); } - return "#document"; -} -function getWindow(node) { - var _node$ownerDocument; - return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window; -} -function getDocumentElement(node) { - var _ref; - return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement; -} -function isNode(value) { - if (!hasWindow()) { - return false; + isStarted() { + return this.currentId !== EMPTY2; } - return value instanceof Node || value instanceof getWindow(value).Node; -} -function isElement(value) { - if (!hasWindow()) { + clear = () => { + if (this.currentId !== EMPTY2) { + clearTimeout(this.currentId); + this.currentId = EMPTY2; + } + }; + disposeEffect = () => { + return this.clear; + }; +}; +function useTimeout() { + const timeout = useRefWithInit(Timeout.create).current; + useOnMount(timeout.disposeEffect); + return timeout; +} + +// node_modules/.store/clsx@2.1.1-XOLP1vUL9vEGfpiXm37fAw/node_modules/clsx/dist/clsx.mjs +function r(e) { + var t, f, n = ""; + if ("string" == typeof e || "number" == typeof e) n += e; + else if ("object" == typeof e) if (Array.isArray(e)) { + var o = e.length; + for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f); + } else for (f in e) e[f] && (n && (n += " "), n += f); + return n; +} +function clsx() { + for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t); + return n; +} +var clsx_default = clsx; + +// packages/ui/build-module/icon/icon.mjs +var import_element = __toESM(require_element(), 1); +var import_primitives = __toESM(require_primitives(), 1); +var import_jsx_runtime = __toESM(require_jsx_runtime(), 1); +var Icon = (0, import_element.forwardRef)( + function UnforwardedIcon({ icon, size: size4 = 24, style, ...restProps }, ref) { + const mergedStyle = icon.props.style || style ? { ...icon.props.style, ...style } : void 0; + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + import_primitives.SVG, + { + ref, + ...icon.props, + ...restProps, + ...mergedStyle ? { style: mergedStyle } : {}, + width: size4, + height: size4 + } + ); + } +); + +// node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/error.mjs +var error = createLogOnce("error", "Base UI"); + +// node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/useId.mjs +var React11 = __toESM(require_react(), 1); + +// node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/useForcedRerendering.mjs +var React10 = __toESM(require_react(), 1); +function useForcedRerendering() { + const [, setState] = React10.useState({}); + return React10.useCallback(() => { + setState({}); + }, []); +} + +// node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/useId.mjs +var globalId = 0; +function useGlobalId(idOverride, prefix = "mui") { + const defaultId = React11.useRef(void 0); + const forceRerender = useForcedRerendering(); + const id = idOverride ?? defaultId.current; + React11.useEffect(() => { + if (defaultId.current == null) { + globalId += 1; + defaultId.current = `${prefix}-${globalId}`; + if (idOverride == null) { + forceRerender(); + } + } + }, [idOverride, prefix, forceRerender]); + return id; +} +var maybeReactUseId = SafeReact.useId; +function useId(idOverride, prefix) { + if (maybeReactUseId !== void 0) { + const reactId = maybeReactUseId(); + return idOverride ?? (prefix ? `${prefix}-${reactId}` : reactId); + } + return useGlobalId(idOverride, prefix); +} + +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/useBaseUiId.mjs +function useBaseUiId(idOverride) { + return useId(idOverride, "base-ui"); +} + +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/createBaseUIEventDetails.mjs +function createChangeEventDetails(reason, event, trigger, customProperties) { + let canceled = false; + let allowPropagation = false; + const custom = customProperties ?? EMPTY_OBJECT; + const details = { + reason, + event: event ?? new Event("base-ui"), + cancel() { + canceled = true; + }, + allowPropagation() { + allowPropagation = true; + }, + get isCanceled() { + return canceled; + }, + get isPropagationAllowed() { + return allowPropagation; + }, + trigger, + ...custom + }; + return details; +} + +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/reason-parts.mjs +var reason_parts_exports = {}; +__export(reason_parts_exports, { + cancelOpen: () => cancelOpen, + chipRemovePress: () => chipRemovePress, + clearPress: () => clearPress, + closePress: () => closePress, + closeWatcher: () => closeWatcher, + decrementPress: () => decrementPress, + disabled: () => disabled, + drag: () => drag, + escapeKey: () => escapeKey, + focusOut: () => focusOut, + imperativeAction: () => imperativeAction, + incrementPress: () => incrementPress, + initial: () => initial, + inputBlur: () => inputBlur, + inputChange: () => inputChange, + inputClear: () => inputClear, + inputPaste: () => inputPaste, + inputPress: () => inputPress, + itemPress: () => itemPress, + keyboard: () => keyboard, + linkPress: () => linkPress, + listNavigation: () => listNavigation, + missing: () => missing, + none: () => none, + outsidePress: () => outsidePress, + pointer: () => pointer, + popupClose: () => popupClose, + scrub: () => scrub, + siblingOpen: () => siblingOpen, + swipe: () => swipe, + trackPress: () => trackPress, + triggerFocus: () => triggerFocus, + triggerHover: () => triggerHover, + triggerPress: () => triggerPress, + wheel: () => wheel, + windowResize: () => windowResize +}); +var none = "none"; +var triggerPress = "trigger-press"; +var triggerHover = "trigger-hover"; +var triggerFocus = "trigger-focus"; +var outsidePress = "outside-press"; +var itemPress = "item-press"; +var closePress = "close-press"; +var linkPress = "link-press"; +var clearPress = "clear-press"; +var chipRemovePress = "chip-remove-press"; +var trackPress = "track-press"; +var incrementPress = "increment-press"; +var decrementPress = "decrement-press"; +var inputChange = "input-change"; +var inputClear = "input-clear"; +var inputBlur = "input-blur"; +var inputPaste = "input-paste"; +var inputPress = "input-press"; +var focusOut = "focus-out"; +var escapeKey = "escape-key"; +var closeWatcher = "close-watcher"; +var listNavigation = "list-navigation"; +var keyboard = "keyboard"; +var pointer = "pointer"; +var drag = "drag"; +var wheel = "wheel"; +var scrub = "scrub"; +var popupClose = "popup-close"; +var cancelOpen = "cancel-open"; +var siblingOpen = "sibling-open"; +var disabled = "disabled"; +var missing = "missing"; +var initial = "initial"; +var imperativeAction = "imperative-action"; +var swipe = "swipe"; +var windowResize = "window-resize"; + +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/use-button/useButton.mjs +var React14 = __toESM(require_react(), 1); + +// node_modules/.store/@floating-ui/utils@0.2.12-gOxTzMf36nCrbeHpEew-rw/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs +function hasWindow() { + return typeof window !== "undefined"; +} +function getNodeName(node) { + if (isNode(node)) { + return (node.nodeName || "").toLowerCase(); + } + return "#document"; +} +function getWindow(node) { + var _node$ownerDocument; + return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window; +} +function getDocumentElement(node) { + var _ref; + return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement; +} +function isNode(value) { + if (!hasWindow()) { + return false; + } + return value instanceof Node || value instanceof getWindow(value).Node; +} +function isElement(value) { + if (!hasWindow()) { return false; } return value instanceof Element || value instanceof getWindow(value).Element; @@ -1289,20 +1475,20 @@ function getFrameElement(win) { return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null; } -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/internals/composite/root/CompositeRootContext.mjs -var React10 = __toESM(require_react(), 1); -var CompositeRootContext = /* @__PURE__ */ React10.createContext(void 0); +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/composite/root/CompositeRootContext.mjs +var React12 = __toESM(require_react(), 1); +var CompositeRootContext = /* @__PURE__ */ React12.createContext(void 0); if (true) CompositeRootContext.displayName = "CompositeRootContext"; function useCompositeRootContext(optional = false) { - const context = React10.useContext(CompositeRootContext); + const context = React12.useContext(CompositeRootContext); if (context === void 0 && !optional) { throw new Error(true ? "Base UI: CompositeRootContext is missing. Composite parts must be placed within ." : formatErrorMessage_default(16)); } return context; } -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/utils/useFocusableWhenDisabled.mjs -var React11 = __toESM(require_react(), 1); +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/useFocusableWhenDisabled.mjs +var React13 = __toESM(require_react(), 1); function useFocusableWhenDisabled(parameters) { const { focusableWhenDisabled, @@ -1313,7 +1499,7 @@ function useFocusableWhenDisabled(parameters) { } = parameters; const isFocusableComposite = composite && focusableWhenDisabled !== false; const isNonFocusableComposite = composite && focusableWhenDisabled === false; - const props = React11.useMemo(() => { + const props = React13.useMemo(() => { const additionalProps = { // allow Tabbing away from focusableWhenDisabled elements onKeyDown(event) { @@ -1341,20 +1527,22 @@ function useFocusableWhenDisabled(parameters) { }; } -// node_modules/.store/@base-ui/utils@0.4.0-Z81C5N42agUorsFwt3T4Yw/node_modules/@base-ui/utils/owner.mjs +// node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/owner.mjs function ownerDocument(node) { return node?.ownerDocument || document; } -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/utils/dispatchClickWithModifiers.mjs +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/dispatchClickWithModifiers.mjs function dispatchClickWithModifiers(target, sourceEvent, { - detail = 0 + detail = 0, + pointerType = "" } = {}) { target.dispatchEvent(new (getWindow(target)).PointerEvent("click", { bubbles: true, cancelable: true, composed: true, detail, + pointerType, shiftKey: sourceEvent.shiftKey, ctrlKey: sourceEvent.ctrlKey, altKey: sourceEvent.altKey, @@ -1362,7 +1550,7 @@ function dispatchClickWithModifiers(target, sourceEvent, { })); } -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/internals/use-button/useButton.mjs +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/use-button/useButton.mjs function useButton(parameters = {}) { const { disabled: disabled2 = false, @@ -1371,7 +1559,7 @@ function useButton(parameters = {}) { native: isNativeButton = true, composite: compositeProp } = parameters; - const elementRef = React12.useRef(null); + const elementRef = React14.useRef(null); const compositeRootContext = useCompositeRootContext(true); const isCompositeItem = compositeProp ?? compositeRootContext !== void 0; const { @@ -1384,7 +1572,7 @@ function useButton(parameters = {}) { isNativeButton }); if (true) { - React12.useEffect(() => { + React14.useEffect(() => { if (!elementRef.current) { return; } @@ -1402,7 +1590,7 @@ function useButton(parameters = {}) { } }, [isNativeButton]); } - const updateDisabled = React12.useCallback(() => { + const updateDisabled = React14.useCallback(() => { const element = elementRef.current; if (!isButtonElement(element)) { return; @@ -1412,7 +1600,7 @@ function useButton(parameters = {}) { } }, [disabled2, focusableWhenDisabledProps.disabled, isCompositeItem]); useIsoLayoutEffect(updateDisabled, [updateDisabled]); - const getButtonProps = React12.useCallback((externalProps = {}) => { + const getButtonProps = React14.useCallback((externalProps = {}) => { const { onClick: externalOnClick, onMouseDown: externalOnMouseDown, @@ -1525,7 +1713,7 @@ function isValidLinkElement(elem) { return isHTMLElement(elem) && elem.tagName === "A" && Boolean(elem.href); } -// node_modules/.store/@base-ui/utils@0.4.0-Z81C5N42agUorsFwt3T4Yw/node_modules/@base-ui/utils/addEventListener.mjs +// node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/addEventListener.mjs function addEventListener(target, type, listener, options) { target.addEventListener(type, listener, options); return () => { @@ -1533,7 +1721,7 @@ function addEventListener(target, type, listener, options) { }; } -// node_modules/.store/@base-ui/utils@0.4.0-Z81C5N42agUorsFwt3T4Yw/node_modules/@base-ui/utils/useValueAsRef.mjs +// node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/useValueAsRef.mjs function useValueAsRef(value) { const latest = useRefWithInit(createLatestRef, value).current; latest.next = value; @@ -1551,174 +1739,54 @@ function createLatestRef(value) { return latest; } -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/internals/useOpenChangeComplete.mjs -var React13 = __toESM(require_react(), 1); +// node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/platform/parts.mjs +var parts_exports = {}; +__export(parts_exports, { + engine: () => engine_exports, + env: () => env_exports, + mediaQuery: () => media_query_exports, + os: () => os_exports, + screenReader: () => screen_reader_exports +}); -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/internals/useAnimationsFinished.mjs -var ReactDOM = __toESM(require_react_dom(), 1); +// node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/platform/os.mjs +var os_exports = {}; +__export(os_exports, { + android: () => android, + apple: () => apple, + ios: () => ios, + linux: () => linux, + mac: () => mac, + windows: () => windows +}); -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/utils/resolveRef.mjs -function resolveRef(maybeRef) { - if (maybeRef == null) { - return maybeRef; +// node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/platform/shared.mjs +function readRawData() { + if (typeof navigator === "undefined") { + return { + userAgent: "", + platform: "", + maxTouchPoints: 0 + }; } - return "current" in maybeRef ? maybeRef.current : maybeRef; -} - -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/internals/useAnimationsFinished.mjs -var pendingCallbacks = null; -function flushBeforePaint(fn) { - if (!pendingCallbacks) { - const callbacks = []; - pendingCallbacks = callbacks; - queueMicrotask(() => { - pendingCallbacks = null; - ReactDOM.flushSync(() => { - for (const callback of callbacks) { - callback(); - } - }); - }); - } - pendingCallbacks.push(fn); -} -function useAnimationsFinished(elementOrRef, waitForStartingStyleRemoved = false, batch = false) { - const frame = useAnimationFrame(); - return useStableCallback((fnToExecute, signal = null) => { - frame.cancel(); - const element = resolveRef(elementOrRef); - if (element == null) { - return; - } - const resolvedElement = element; - const done = () => { - if (!batch) { - ReactDOM.flushSync(fnToExecute); - return; - } - flushBeforePaint(() => { - if (!signal?.aborted) { - fnToExecute(); - } - }); - }; - if (typeof resolvedElement.getAnimations !== "function" || globalThis.BASE_UI_ANIMATIONS_DISABLED) { - fnToExecute(); - return; - } - function exec() { - Promise.all(resolvedElement.getAnimations().map((animation) => animation.finished)).then(() => { - if (!signal?.aborted) { - done(); - } - }, () => { - if (signal?.aborted) { - return; - } - const currentAnimations = resolvedElement.getAnimations(); - if (currentAnimations.some((animation) => animation.pending || animation.playState !== "finished")) { - exec(); - return; - } - done(); - }); - } - if (waitForStartingStyleRemoved) { - const startingStyleAttribute = startingStyle; - if (!resolvedElement.hasAttribute(startingStyleAttribute)) { - frame.request(exec); - return; - } - const attributeObserver = new MutationObserver(() => { - if (!resolvedElement.hasAttribute(startingStyleAttribute)) { - attributeObserver.disconnect(); - exec(); - } - }); - attributeObserver.observe(resolvedElement, { - attributes: true, - attributeFilter: [startingStyleAttribute] - }); - signal?.addEventListener("abort", () => attributeObserver.disconnect(), { - once: true - }); - return; - } - frame.request(exec); - }); -} - -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/internals/useOpenChangeComplete.mjs -function useOpenChangeComplete(parameters) { - const { - enabled = true, - open: open2, - ref, - batch = false, - onComplete: onCompleteParam - } = parameters; - const onComplete = useStableCallback(onCompleteParam); - const runOnceAnimationsFinish = useAnimationsFinished(ref, open2, batch); - React13.useEffect(() => { - if (!enabled) { - return void 0; - } - const abortController = new AbortController(); - runOnceAnimationsFinish(onComplete, abortController.signal); - return () => { - abortController.abort(); - }; - }, [enabled, open2, onComplete, runOnceAnimationsFinish]); -} - -// node_modules/.store/@base-ui/utils@0.4.0-Z81C5N42agUorsFwt3T4Yw/node_modules/@base-ui/utils/platform/parts.mjs -var parts_exports = {}; -__export(parts_exports, { - engine: () => engine_exports, - env: () => env_exports, - mediaQuery: () => media_query_exports, - os: () => os_exports, - screenReader: () => screen_reader_exports -}); - -// node_modules/.store/@base-ui/utils@0.4.0-Z81C5N42agUorsFwt3T4Yw/node_modules/@base-ui/utils/platform/os.mjs -var os_exports = {}; -__export(os_exports, { - android: () => android, - apple: () => apple, - ios: () => ios, - linux: () => linux, - mac: () => mac, - windows: () => windows -}); - -// node_modules/.store/@base-ui/utils@0.4.0-Z81C5N42agUorsFwt3T4Yw/node_modules/@base-ui/utils/platform/shared.mjs -function readRawData() { - if (typeof navigator === "undefined") { - return { - userAgent: "", - platform: "", - maxTouchPoints: 0 - }; - } - if (true) { - const uaData = navigator.userAgentData; - if (uaData && Array.isArray(uaData.brands)) { - return { - userAgent: uaData.brands.map(({ - brand, - version: version2 - }) => `${brand}/${version2}`).join(" "), - platform: uaData.platform ?? navigator.platform ?? "", - maxTouchPoints: navigator.maxTouchPoints ?? 0 - }; - } - } - return { - userAgent: navigator.userAgent, - platform: navigator.platform ?? "", - maxTouchPoints: navigator.maxTouchPoints ?? 0 - }; + if (true) { + const uaData = navigator.userAgentData; + if (uaData && Array.isArray(uaData.brands)) { + return { + userAgent: uaData.brands.map(({ + brand, + version: version2 + }) => `${brand}/${version2}`).join(" "), + platform: uaData.platform ?? navigator.platform ?? "", + maxTouchPoints: navigator.maxTouchPoints ?? 0 + }; + } + } + return { + userAgent: navigator.userAgent, + platform: navigator.platform ?? "", + maxTouchPoints: navigator.maxTouchPoints ?? 0 + }; } var { userAgent, @@ -1728,7 +1796,7 @@ var { var lowerUserAgent = userAgent.toLowerCase(); var lowerPlatform = platform.toLowerCase(); -// node_modules/.store/@base-ui/utils@0.4.0-Z81C5N42agUorsFwt3T4Yw/node_modules/@base-ui/utils/platform/os.mjs +// node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/platform/os.mjs var ios = /^i(os$|p)/.test(lowerPlatform) || lowerPlatform === "macintel" && maxTouchPoints > 1; var ANDROID_STRING = "android"; var android = lowerPlatform === ANDROID_STRING || lowerUserAgent.includes(ANDROID_STRING); @@ -1737,7 +1805,7 @@ var windows = lowerPlatform.startsWith("win"); var linux = !android && /^(linux|chrome os)/.test(lowerPlatform); var apple = mac || ios; -// node_modules/.store/@base-ui/utils@0.4.0-Z81C5N42agUorsFwt3T4Yw/node_modules/@base-ui/utils/platform/engine.mjs +// node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/platform/engine.mjs var engine_exports = {}; __export(engine_exports, { blink: () => blink, @@ -1748,67 +1816,31 @@ var webkit = typeof CSS !== "undefined" && !!CSS.supports?.("-webkit-backdrop-fi var gecko = !webkit && lowerUserAgent.includes("firefox"); var blink = !webkit && lowerUserAgent.includes("chrom"); -// node_modules/.store/@base-ui/utils@0.4.0-Z81C5N42agUorsFwt3T4Yw/node_modules/@base-ui/utils/platform/screen-reader.mjs +// node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/platform/screen-reader.mjs var screen_reader_exports = {}; __export(screen_reader_exports, { voiceOver: () => voiceOver }); var voiceOver = apple; -// node_modules/.store/@base-ui/utils@0.4.0-Z81C5N42agUorsFwt3T4Yw/node_modules/@base-ui/utils/platform/env.mjs +// node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/platform/env.mjs var env_exports = {}; __export(env_exports, { jsdom: () => jsdom }); var jsdom = /jsdom|happydom/.test(lowerUserAgent); -// node_modules/.store/@base-ui/utils@0.4.0-Z81C5N42agUorsFwt3T4Yw/node_modules/@base-ui/utils/platform/media-query.mjs +// node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/platform/media-query.mjs var media_query_exports = {}; __export(media_query_exports, { iOS: () => iOS }); var iOS = "@supports (-webkit-touch-callout: none)"; -// node_modules/.store/@base-ui/utils@0.4.0-Z81C5N42agUorsFwt3T4Yw/node_modules/@base-ui/utils/useTimeout.mjs -var EMPTY2 = 0; -var Timeout = class _Timeout { - static create() { - return new _Timeout(); - } - currentId = EMPTY2; - /** - * Executes `fn` after `delay`, clearing any previously scheduled call. - */ - start(delay, fn) { - this.clear(); - this.currentId = setTimeout(() => { - this.currentId = EMPTY2; - fn(); - }, delay); - } - isStarted() { - return this.currentId !== EMPTY2; - } - clear = () => { - if (this.currentId !== EMPTY2) { - clearTimeout(this.currentId); - this.currentId = EMPTY2; - } - }; - disposeEffect = () => { - return this.clear; - }; -}; -function useTimeout() { - const timeout = useRefWithInit(Timeout.create).current; - useOnMount(timeout.disposeEffect); - return timeout; -} - -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/floating-ui-react/components/FloatingDelayGroup.mjs -var React14 = __toESM(require_react(), 1); +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/components/FloatingDelayGroup.mjs +var React15 = __toESM(require_react(), 1); -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/floating-ui-react/utils/event.mjs +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/utils/event.mjs function isReactEvent(event) { return "nativeEvent" in event; } @@ -1833,7 +1865,7 @@ function isClickLikeEvent(event) { return type === "click" || type === "mousedown" || type === "keydown" || type === "keyup"; } -// node_modules/.store/@base-ui/utils@0.4.0-Z81C5N42agUorsFwt3T4Yw/node_modules/@base-ui/utils/shadowDom.mjs +// node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/shadowDom.mjs function activeElement(doc) { let element = doc.activeElement; while (element?.shadowRoot?.activeElement != null) { @@ -1860,6 +1892,16 @@ function contains(parent, child) { } return false; } +function closest(node, selector) { + let current = node; + while (current) { + if (isElement(current) && current.matches(selector)) { + return current; + } + current = current.assignedSlot ?? current.parentNode ?? (isShadowRoot(current) ? current.host : null); + } + return null; +} function getTarget(event) { if ("composedPath" in event) { return event.composedPath()[0] ?? event.target; @@ -1867,16 +1909,16 @@ function getTarget(event) { return event.target; } -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/floating-ui-react/utils/constants.mjs +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/utils/constants.mjs var FOCUSABLE_ATTRIBUTE = "data-base-ui-focusable"; var TYPEABLE_SELECTOR = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])"; -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/utils/CommonPopupDataAttributes.mjs +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/CommonPopupDataAttributes.mjs var open = "data-open"; var closed = "data-closed"; var anchorHidden = "data-anchor-hidden"; -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/utils/CommonTriggerDataAttributes.mjs +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/CommonTriggerDataAttributes.mjs var CommonTriggerDataAttributes_exports = {}; __export(CommonTriggerDataAttributes_exports, { popupOpen: () => popupOpen, @@ -1885,7 +1927,7 @@ __export(CommonTriggerDataAttributes_exports, { var popupOpen = "data-popup-open"; var pressed = "data-pressed"; -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/utils/popupStateMapping.mjs +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/popupStateMapping.mjs var TRIGGER_HOOK = { [popupOpen]: "" }; @@ -1929,11 +1971,11 @@ var popupTransitionStateMapping = { ...transitionStatusMapping }; -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/tooltip/trigger/TooltipTriggerDataAttributes.mjs +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/trigger/TooltipTriggerDataAttributes.mjs var popupOpen2 = CommonTriggerDataAttributes_exports.popupOpen; var triggerDisabled = "data-trigger-disabled"; -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/floating-ui-react/utils/element.mjs +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/utils/element.mjs function isTargetInsideEnabledTrigger(target, triggerElements) { if (!isElement(target)) { return false; @@ -1966,7 +2008,7 @@ function isTypeableElement(element) { return isHTMLElement(element) && element.matches(TYPEABLE_SELECTOR); } function isInteractiveElement(element) { - return element?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${TYPEABLE_SELECTOR}`) != null; + return closest(element, `button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${TYPEABLE_SELECTOR}`) != null; } function matchesFocusVisible(element) { if (!element || parts_exports.env.jsdom) { @@ -1979,7 +2021,7 @@ function matchesFocusVisible(element) { } } -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/floating-ui-react/hooks/useHoverShared.mjs +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/hooks/useHoverShared.mjs function resolveValue(value, pointerType) { if (pointerType != null && !isMouseLikePointerType(pointerType)) { return 0; @@ -2009,9 +2051,9 @@ function isHoverOpenEvent(openEventType) { return openEventType?.includes("mouse") && openEventType !== "mousedown"; } -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/floating-ui-react/components/FloatingDelayGroup.mjs -var import_jsx_runtime = __toESM(require_jsx_runtime(), 1); -var FloatingDelayGroupContext = /* @__PURE__ */ React14.createContext({ +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/components/FloatingDelayGroup.mjs +var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1); +var FloatingDelayGroupContext = /* @__PURE__ */ React15.createContext({ hasProvider: false, timeoutMs: 0, delayRef: { @@ -2038,10 +2080,10 @@ function FloatingDelayGroup(props) { delay, timeoutMs = 0 } = props; - const delayRef = React14.useRef(delay); - const initialDelayRef = React14.useRef(delay); - const currentIdRef = React14.useRef(null); - const currentContextRef = React14.useRef(null); + const delayRef = React15.useRef(delay); + const initialDelayRef = React15.useRef(delay); + const currentIdRef = React15.useRef(null); + const currentContextRef = React15.useRef(null); const timeout = useTimeout(); useIsoLayoutEffect(() => { initialDelayRef.current = delay; @@ -2054,8 +2096,8 @@ function FloatingDelayGroup(props) { close: getDelay(delay, "close") }; }, [delay, currentIdRef, delayRef, initialDelayRef]); - return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FloatingDelayGroupContext.Provider, { - value: React14.useMemo(() => ({ + return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(FloatingDelayGroupContext.Provider, { + value: React15.useMemo(() => ({ hasProvider: true, delayRef, initialDelayRef, @@ -2067,15 +2109,14 @@ function FloatingDelayGroup(props) { children }); } -function useDelayGroup(context, options = { +function useDelayGroup(store2, options = { open: false }) { const { open: open2 } = options; - const store2 = "rootStore" in context ? context.rootStore : context; const floatingId = store2.useState("floatingId"); - const groupContext = React14.useContext(FloatingDelayGroupContext); + const groupContext = React15.useContext(FloatingDelayGroupContext); const { currentIdRef, delayRef, @@ -2085,8 +2126,8 @@ function useDelayGroup(context, options = { hasProvider, timeout } = groupContext; - const [isInstantPhase, setIsInstantPhase] = React14.useState(false); - const openRef = React14.useRef(open2); + const [isInstantPhase, setIsInstantPhase] = React15.useState(false); + const openRef = React15.useRef(open2); useIsoLayoutEffect(() => { openRef.current = open2; }, [open2]); @@ -2159,7 +2200,7 @@ function useDelayGroup(context, options = { } }; }, [currentContextRef, currentIdRef, delayRef, floatingId, initialDelayRef, timeout]); - return React14.useMemo(() => ({ + return React15.useMemo(() => ({ activeIdRef: currentIdRef, hasProvider, delayRef, @@ -2167,7 +2208,7 @@ function useDelayGroup(context, options = { }), [currentIdRef, hasProvider, delayRef, isInstantPhase]); } -// node_modules/.store/@base-ui/utils@0.4.0-Z81C5N42agUorsFwt3T4Yw/node_modules/@base-ui/utils/mergeCleanups.mjs +// node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/mergeCleanups.mjs function mergeCleanups(...cleanups) { return () => { for (let i = 0; i < cleanups.length; i += 1) { @@ -2179,10 +2220,10 @@ function mergeCleanups(...cleanups) { }; } -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/utils/FocusGuard.mjs -var React15 = __toESM(require_react(), 1); +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/FocusGuard.mjs +var React16 = __toESM(require_react(), 1); -// node_modules/.store/@base-ui/utils@0.4.0-Z81C5N42agUorsFwt3T4Yw/node_modules/@base-ui/utils/visuallyHidden.mjs +// node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/visuallyHidden.mjs var visuallyHiddenBase = { clipPath: "inset(50%)", overflow: "hidden", @@ -2196,6 +2237,7 @@ var visuallyHiddenBase = { var visuallyHidden = { ...visuallyHiddenBase, position: "fixed", + margin: 0, top: 0, left: 0 }; @@ -2204,10 +2246,10 @@ var visuallyHiddenInput = { position: "absolute" }; -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/utils/FocusGuard.mjs -var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1); -var FocusGuard = /* @__PURE__ */ React15.forwardRef(function FocusGuard2(props, ref) { - const [role, setRole] = React15.useState(); +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/FocusGuard.mjs +var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1); +var FocusGuard = /* @__PURE__ */ React16.forwardRef(function FocusGuard2(props, ref) { + const [role, setRole] = React16.useState(); useIsoLayoutEffect(() => { if (parts_exports.screenReader.voiceOver && parts_exports.engine.webkit) { setRole("button"); @@ -2218,7 +2260,7 @@ var FocusGuard = /* @__PURE__ */ React15.forwardRef(function FocusGuard2(props, // Role is only for VoiceOver role }; - return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { + return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { ...props, ref, style: visuallyHidden, @@ -2357,7 +2399,7 @@ function rectToClientRect(rect) { }; } -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/floating-ui-react/utils/composite.mjs +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/utils/composite.mjs function isHiddenByStyles(styles) { return styles.visibility === "hidden" || styles.visibility === "collapse"; } @@ -2371,7 +2413,7 @@ function isElementVisible(element, styles = element ? getComputedStyle2(element) return styles.display !== "none" && styles.display !== "contents"; } -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/floating-ui-react/utils/tabbable.mjs +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/utils/tabbable.mjs var CANDIDATE_SELECTOR = 'a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]'; function getParentElement(element) { const assignedSlot = element.assignedSlot; @@ -2539,22 +2581,22 @@ function enableFocusInside(container) { }); } -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/floating-ui-react/utils/nodes.mjs +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/utils/nodes.mjs function getNodeChildren(nodes, id, onlyOpenChildren = true) { const directChildren = nodes.filter((node) => node.parentId === id); return directChildren.flatMap((child) => [...!onlyOpenChildren || child.context?.open ? [child] : [], ...getNodeChildren(nodes, child.id, onlyOpenChildren)]); } -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/floating-ui-react/utils/createAttribute.mjs +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/utils/createAttribute.mjs function createAttribute(name) { return `data-base-ui-${name}`; } -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/floating-ui-react/components/FloatingPortal.mjs -var React16 = __toESM(require_react(), 1); +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/components/FloatingPortal.mjs +var React17 = __toESM(require_react(), 1); var ReactDOM2 = __toESM(require_react_dom(), 1); -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/internals/constants.mjs +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/constants.mjs var DISABLED_TRANSITIONS_STYLE = { style: { transition: "none" @@ -2574,11 +2616,11 @@ var ownerVisuallyHidden = { left: 0 }; -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/floating-ui-react/components/FloatingPortal.mjs -var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1); -var PortalContext = /* @__PURE__ */ React16.createContext(null); +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/components/FloatingPortal.mjs +var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1); +var PortalContext = /* @__PURE__ */ React17.createContext(null); if (true) PortalContext.displayName = "PortalContext"; -var usePortalContext = () => React16.useContext(PortalContext); +var usePortalContext = () => React17.useContext(PortalContext); var attr = createAttribute("portal"); function useFloatingPortalNode(props = {}) { const { @@ -2590,14 +2632,14 @@ function useFloatingPortalNode(props = {}) { const uniqueId = useId(); const portalContext = usePortalContext(); const parentPortalNode = portalContext?.portalNode; - const [containerElement, setContainerElement] = React16.useState(null); - const [portalNode, setPortalNode] = React16.useState(null); + const [containerElement, setContainerElement] = React17.useState(null); + const [portalNode, setPortalNode] = React17.useState(null); const setPortalNodeRef = useStableCallback((node) => { if (node !== null) { setPortalNode(node); } }); - const containerRef = React16.useRef(null); + const containerRef = React17.useRef(null); useIsoLayoutEffect(() => { if (containerProp === null) { if (containerRef.current) { @@ -2634,11 +2676,11 @@ function useFloatingPortalNode(props = {}) { node: portalNode, // `id` and `render` props can override or remove the generated ID. Use the exact // rendered value so `aria-owns` never points at an ID absent from the DOM. - nodeId: /* @__PURE__ */ React16.isValidElement(portalElement) ? portalElement.props.id : void 0, + nodeId: /* @__PURE__ */ React17.isValidElement(portalElement) ? portalElement.props.id : void 0, subtree: portalSubtree }; } -var FloatingPortal = /* @__PURE__ */ React16.forwardRef(function FloatingPortal2(componentProps, forwardedRef) { +var FloatingPortal = /* @__PURE__ */ React17.forwardRef(function FloatingPortal2(componentProps, forwardedRef) { const { render, className, @@ -2658,16 +2700,16 @@ var FloatingPortal = /* @__PURE__ */ React16.forwardRef(function FloatingPortal2 componentProps, elementProps }); - const beforeOutsideRef = React16.useRef(null); - const afterOutsideRef = React16.useRef(null); - const beforeInsideRef = React16.useRef(null); - const afterInsideRef = React16.useRef(null); - const [focusManagerState, setFocusManagerState] = React16.useState(null); - const focusInsideDisabledRef = React16.useRef(false); + const beforeOutsideRef = React17.useRef(null); + const afterOutsideRef = React17.useRef(null); + const beforeInsideRef = React17.useRef(null); + const afterInsideRef = React17.useRef(null); + const [focusManagerState, setFocusManagerState] = React17.useState(null); + const focusInsideDisabledRef = React17.useRef(false); const modal = focusManagerState?.modal; const open2 = focusManagerState?.open; const shouldRenderGuards = !!focusManagerState && !focusManagerState.modal && focusManagerState.open && !!portalNode; - React16.useEffect(() => { + React17.useEffect(() => { if (!portalNode || modal) { return void 0; } @@ -2693,7 +2735,7 @@ var FloatingPortal = /* @__PURE__ */ React16.forwardRef(function FloatingPortal2 enableFocusInside(portalNode); focusInsideDisabledRef.current = false; }, [open2, portalNode]); - const portalContextValue = React16.useMemo(() => ({ + const portalContextValue = React17.useMemo(() => ({ beforeOutsideRef, afterOutsideRef, beforeInsideRef, @@ -2701,10 +2743,10 @@ var FloatingPortal = /* @__PURE__ */ React16.forwardRef(function FloatingPortal2 portalNode, setFocusManagerState }), [portalNode]); - return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(React16.Fragment, { - children: [portalSubtree, /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(PortalContext.Provider, { + return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(React17.Fragment, { + children: [portalSubtree, /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(PortalContext.Provider, { value: portalContextValue, - children: [shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(FocusGuard, { + children: [shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(FocusGuard, { "data-type": "outside", ref: beforeOutsideRef, onFocus: (event) => { @@ -2716,11 +2758,11 @@ var FloatingPortal = /* @__PURE__ */ React16.forwardRef(function FloatingPortal2 prevTabbable?.focus(); } } - }), shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { + }), shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { role: portalOwnerRole, "aria-owns": portalNodeId, style: ownerVisuallyHidden - }), portalNode && /* @__PURE__ */ ReactDOM2.createPortal(children, portalNode), shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(FocusGuard, { + }), portalNode && /* @__PURE__ */ ReactDOM2.createPortal(children, portalNode), shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(FocusGuard, { "data-type": "outside", ref: afterOutsideRef, onFocus: (event) => { @@ -2741,10 +2783,10 @@ var FloatingPortal = /* @__PURE__ */ React16.forwardRef(function FloatingPortal2 }); if (true) FloatingPortal.displayName = "FloatingPortal"; -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/floating-ui-react/components/FloatingTree.mjs -var React17 = __toESM(require_react(), 1); +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/components/FloatingTree.mjs +var React18 = __toESM(require_react(), 1); -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/floating-ui-react/utils/createEventEmitter.mjs +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/utils/createEventEmitter.mjs function createEventEmitter() { const map = /* @__PURE__ */ new Map(); return { @@ -2763,20 +2805,20 @@ function createEventEmitter() { }; } -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/floating-ui-react/components/FloatingTree.mjs -var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1); -var FloatingNodeContext = /* @__PURE__ */ React17.createContext(null); +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/components/FloatingTree.mjs +var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1); +var FloatingNodeContext = /* @__PURE__ */ React18.createContext(null); if (true) FloatingNodeContext.displayName = "FloatingNodeContext"; -var FloatingTreeContext = /* @__PURE__ */ React17.createContext(null); +var FloatingTreeContext = /* @__PURE__ */ React18.createContext(null); if (true) FloatingTreeContext.displayName = "FloatingTreeContext"; -var useFloatingParentNodeId = () => React17.useContext(FloatingNodeContext)?.id || null; +var useFloatingParentNodeId = () => React18.useContext(FloatingNodeContext)?.id || null; var useFloatingTree = (externalTree) => { - const contextTree = React17.useContext(FloatingTreeContext); + const contextTree = React18.useContext(FloatingTreeContext); return externalTree ?? contextTree; }; -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/floating-ui-react/hooks/useClientPoint.mjs -var React18 = __toESM(require_react(), 1); +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/hooks/useClientPoint.mjs +var React19 = __toESM(require_react(), 1); function createVirtualElement(domElement, data) { let offsetX = null; let offsetY = null; @@ -2793,8 +2835,8 @@ function createVirtualElement(domElement, data) { const isXAxis = data.axis === "x" || data.axis === "both"; const isYAxis = data.axis === "y" || data.axis === "both"; const canTrackCursorOnAutoUpdate = ["mouseenter", "mousemove"].includes(data.dataRef.current.openEvent?.type || "") && data.pointerType !== "touch"; - let width = domRect.width; - let height = domRect.height; + const width = data.axis === "y" ? domRect.width : 0; + const height = data.axis === "x" ? domRect.height : 0; let x = domRect.x; let y = domRect.y; if (offsetX == null && data.x && isXAxis) { @@ -2805,16 +2847,9 @@ function createVirtualElement(domElement, data) { } x -= offsetX || 0; y -= offsetY || 0; - width = 0; - height = 0; if (!isAutoUpdateEvent || canTrackCursorOnAutoUpdate) { - width = data.axis === "y" ? domRect.width : 0; - height = data.axis === "x" ? domRect.height : 0; x = isXAxis && data.x != null ? data.x : x; y = isYAxis && data.y != null ? data.y : y; - } else if (isAutoUpdateEvent && !canTrackCursorOnAutoUpdate) { - height = data.axis === "x" ? domRect.height : height; - width = data.axis === "y" ? domRect.width : width; } isAutoUpdateEvent = true; return { @@ -2833,20 +2868,19 @@ function createVirtualElement(domElement, data) { function isMouseBasedEvent(event) { return event != null && event.clientX != null; } -function useClientPoint(context, props = {}) { +function useClientPoint(store2, props = {}) { const { enabled = true, axis = "both" } = props; - const store2 = "rootStore" in context ? context.rootStore : context; const open2 = store2.useState("open"); const floating = store2.useState("floatingElement"); const domReference = store2.useState("domReferenceElement"); const dataRef = store2.context.dataRef; - const initialRef = React18.useRef(false); - const cleanupListenerRef = React18.useRef(null); - const [pointerType, setPointerType] = React18.useState(); - const [reactive, setReactive] = React18.useState([]); + const initialRef = React19.useRef(false); + const cleanupListenerRef = React19.useRef(null); + const [pointerType, setPointerType] = React19.useState(); + const [reactive, setReactive] = React19.useState([]); const resetReference = useStableCallback((reference2) => { store2.set("positionReference", reference2); }); @@ -2874,7 +2908,7 @@ function useClientPoint(context, props = {}) { } }); const openCheck = isMouseLikePointerType(pointerType) ? floating : open2; - React18.useEffect(() => { + React19.useEffect(() => { if (!enabled) { resetReference(domReference); return void 0; @@ -2902,20 +2936,20 @@ function useClientPoint(context, props = {}) { } return cleanupListener; }, [openCheck, enabled, floating, dataRef, domReference, store2, setReference, resetReference, reactive]); - React18.useEffect(() => () => { + React19.useEffect(() => () => { store2.set("positionReference", null); }, [store2]); - React18.useEffect(() => { + React19.useEffect(() => { if (enabled && !floating) { initialRef.current = false; } }, [enabled, floating]); - React18.useEffect(() => { + React19.useEffect(() => { if (!enabled && open2) { initialRef.current = true; } }, [enabled, open2]); - const reference = React18.useMemo(() => { + const reference = React19.useMemo(() => { function setPointerTypeRef(event) { setPointerType(event.pointerType); } @@ -2926,14 +2960,14 @@ function useClientPoint(context, props = {}) { onMouseEnter: handleReferenceEnterOrMove }; }, [handleReferenceEnterOrMove]); - return React18.useMemo(() => enabled ? { + return React19.useMemo(() => enabled ? { reference, trigger: reference } : {}, [enabled, reference]); } -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/floating-ui-react/hooks/useDismiss.mjs -var React19 = __toESM(require_react(), 1); +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/hooks/useDismiss.mjs +var React20 = __toESM(require_react(), 1); function alwaysFalse() { return false; } @@ -2943,7 +2977,7 @@ function normalizeProp(normalizable) { outsidePress: typeof normalizable === "boolean" ? normalizable : normalizable?.outsidePress ?? true }; } -function useDismiss(context, props = {}) { +function useDismiss(store2, props = {}) { const { enabled = true, escapeKey: escapeKey2 = true, @@ -2953,7 +2987,6 @@ function useDismiss(context, props = {}) { bubbles, externalTree } = props; - const store2 = "rootStore" in context ? context.rootStore : context; const open2 = store2.useState("open"); const floatingElement = store2.useState("floatingElement"); const { @@ -2969,15 +3002,16 @@ function useDismiss(context, props = {}) { escapeKey: escapeKeyBubbles, outsidePress: outsidePressBubbles } = normalizeProp(bubbles); - const pressStartedInsideRef = React19.useRef(false); - const pressStartPreventedRef = React19.useRef(false); - const suppressNextOutsideClickRef = React19.useRef(false); - const sawPressWhileOpenRef = React19.useRef(false); - const isComposingRef = React19.useRef(false); - const currentPointerTypeRef = React19.useRef(""); - const touchStateRef = React19.useRef(null); + const pressStartedInsideRef = React20.useRef(false); + const pressStartPreventedRef = React20.useRef(false); + const suppressNextOutsideClickRef = React20.useRef(false); + const sawPressWhileOpenRef = React20.useRef(false); + const isComposingRef = React20.useRef(false); + const currentPointerTypeRef = React20.useRef(""); + const touchStateRef = React20.useRef(null); const cancelDismissOnEndTimeout = useTimeout(); const clearInsideReactTreeTimeout = useTimeout(); + const compositionTimeout = useTimeout(); const clearInsideReactTree = useStableCallback(() => { clearInsideReactTreeTimeout.clear(); dataRef.current.insideReactTree = false; @@ -3000,13 +3034,13 @@ function useDismiss(context, props = {}) { if (!open2 || !enabled || !escapeKey2 || event.key !== "Escape") { return; } - if (isComposingRef.current) { + const native = isReactEvent(event) ? event.nativeEvent : event; + if (isComposingRef.current || native.isComposing) { return; } if (!escapeKeyBubbles && hasBlockingChild("__escapeKeyBubbles")) { return; } - const native = isReactEvent(event) ? event.nativeEvent : event; const eventDetails = createChangeEventDetails(reason_parts_exports.escapeKey, native); store2.setOpen(false, eventDetails); if (!eventDetails.isCanceled) { @@ -3044,7 +3078,7 @@ function useDismiss(context, props = {}) { pressStartPreventedRef.current = true; } }); - React19.useEffect(() => { + React20.useEffect(() => { function handleOpenChange(details) { if (!details.open) { sawPressWhileOpenRef.current = false; @@ -3055,16 +3089,19 @@ function useDismiss(context, props = {}) { events.off("openchange", handleOpenChange); }; }, [events]); - React19.useEffect(() => { + React20.useEffect(() => clearInsideReactTree, [clearInsideReactTree]); + React20.useEffect(() => { if (!open2 || !enabled) { if (!open2) { sawPressWhileOpenRef.current = false; + isComposingRef.current = false; + currentPointerTypeRef.current = ""; + touchStateRef.current = null; } return clearInsideReactTree; } dataRef.current.__escapeKeyBubbles = escapeKeyBubbles; dataRef.current.__outsidePressBubbles = outsidePressBubbles; - const compositionTimeout = new Timeout(); const preventedPressSuppressionTimeout = new Timeout(); const doc = ownerDocument(floatingElement); function handleCompositionStart() { @@ -3072,6 +3109,7 @@ function useDismiss(context, props = {}) { isComposingRef.current = true; } function handleCompositionEnd() { + isComposingRef.current = true; compositionTimeout.start( // 0ms or 1ms don't work in Safari. 5ms appears to consistently work. // Only apply to WebKit for the test to remain 0ms. @@ -3322,19 +3360,17 @@ function useDismiss(context, props = {}) { }))); return () => { unsubscribe(); - compositionTimeout.clear(); preventedPressSuppressionTimeout.clear(); resetPressStartState(); suppressNextOutsideClickRef.current = false; - clearInsideReactTree(); }; - }, [dataRef, floatingElement, escapeKey2, outsidePressEnabled, outsidePress2, open2, enabled, escapeKeyBubbles, outsidePressBubbles, closeOnEscapeKeyDown, clearInsideReactTree, getOutsidePressEventProp, hasBlockingChild, isEventWithinOwnElements, tree, store2, cancelDismissOnEndTimeout]); - const reference = React19.useMemo(() => ({ + }, [dataRef, floatingElement, escapeKey2, outsidePressEnabled, outsidePress2, open2, enabled, escapeKeyBubbles, outsidePressBubbles, closeOnEscapeKeyDown, clearInsideReactTree, getOutsidePressEventProp, hasBlockingChild, isEventWithinOwnElements, tree, store2, cancelDismissOnEndTimeout, compositionTimeout]); + const reference = React20.useMemo(() => ({ onKeyDown: closeOnEscapeKeyDown, onPointerDown: closeOnReferencePress, onClick: closeOnReferencePress }), [closeOnEscapeKeyDown, closeOnReferencePress]); - const floating = React19.useMemo(() => ({ + const floating = React20.useMemo(() => ({ onKeyDown: closeOnEscapeKeyDown, // `onMouseDown` may be blocked if `event.preventDefault()` is called in // `onPointerDown`, such as with . @@ -3354,3621 +3390,3561 @@ function useDismiss(context, props = {}) { onTouchEndCapture: markInsideReactTree, onTouchMoveCapture: markInsideReactTree }), [closeOnEscapeKeyDown, markInsideReactTree, markPressStartedInsideReactTree, markInsidePressStartPrevented]); - return React19.useMemo(() => enabled ? { + return React20.useMemo(() => enabled ? { reference, floating, trigger: reference } : {}, [enabled, reference, floating]); } -// node_modules/.store/@base-ui/react@1.8.0-AmwqKTN4N3wuPkzw6LPphA/node_modules/@base-ui/react/floating-ui-react/hooks/useFloating.mjs -var React27 = __toESM(require_react(), 1); - -// node_modules/.store/@floating-ui/core@1.8.0-3V8aS7jJHHGcsCINjP9-5A/node_modules/@floating-ui/core/dist/floating-ui.core.mjs -function computeCoordsFromPlacement(_ref, placement, rtl) { - let { - reference, - floating - } = _ref; - const sideAxis = getSideAxis(placement); - const alignmentAxis = getAlignmentAxis(placement); - const alignLength = getAxisLength(alignmentAxis); - const side = getSide(placement); - const isVertical = sideAxis === "y"; - const commonX = reference.x + reference.width / 2 - floating.width / 2; - const commonY = reference.y + reference.height / 2 - floating.height / 2; - const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2; - let coords; - switch (side) { - case "top": - coords = { - x: commonX, - y: reference.y - floating.height - }; - break; - case "bottom": - coords = { - x: commonX, - y: reference.y + reference.height - }; - break; - case "right": - coords = { - x: reference.x + reference.width, - y: commonY - }; - break; - case "left": - coords = { - x: reference.x - floating.width, - y: commonY - }; - break; - default: - coords = { - x: reference.x, - y: reference.y - }; +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/popups/popupHandle.mjs +var BasePopupHandle = class { + /** + * Stores of every root currently using this handle, in attach order. A handle is meant to be used + * by a single mounted root, but roots can transiently overlap (e.g. during an animated route + * transition), so this stack lets `attachStore`'s cleanup restore the previous root instead of + * leaving a still-mounted root uncontrollable when a newer overlapping root detaches first. + */ + attachedStores = []; + /** + * Store of the root that currently controls the handle: the most recently attached one still + * mounted, or `null` when no root is attached. Imperative methods are no-ops while this is `null`. + */ + attachedStoreValue = null; + /** + * Listeners notified when `attachedStore` changes, so detached triggers can follow the store pointer. + */ + storeListeners = /* @__PURE__ */ new Set(); + /** + * Creates a handle backed by the store used while no root is attached. + * + * @param fallbackStore Inert, closed store handed to detached triggers while no root is attached, + * so they can render and register without a mounted root. Triggers register into whichever store + * `store` currently resolves to, so while detached they live in this store's trigger map and + * migrate themselves to the root's store (and back) as it attaches/detaches. + * @param componentName Component name used to prefix dev warnings, e.g. `'Menu'` produces + * `MenuHandle.open()` in warning text. + * @param throwOnMissingTrigger Whether `open(triggerId)` throws when no trigger with that id is + * registered. Anchored popups (Menu, Popover, Tooltip, PreviewCard) need a trigger to anchor to, + * so they throw; Dialog is not anchored and instead opens unassociated with a dev warning. + */ + constructor(fallbackStore, componentName, throwOnMissingTrigger = true) { + this.fallbackStore = fallbackStore; + this.componentName = componentName; + this.throwOnMissingTrigger = throwOnMissingTrigger; } - const alignment = getAlignment(placement); - if (alignment) { - coords[alignmentAxis] += commonAlign * (alignment === "end" ? 1 : -1) * (rtl && isVertical ? -1 : 1); + get attachedStore() { + return this.attachedStoreValue; } - return coords; -} -async function detectOverflow(state, options) { - var _await$platform$isEle; - if (options === void 0) { - options = {}; + /** + * Store that detached triggers read from: the attached root's store, or an inert fallback store + * used while no root is attached. + * @internal + */ + get store() { + return this.attachedStoreValue ?? this.fallbackStore; } - const { - x, - y, - platform: platform3, - rects, - elements, - strategy - } = state; - const { - boundary = "clippingAncestors", - rootBoundary = "viewport", - elementContext = "floating", - altBoundary = false, - padding = 0 - } = evaluate(options, state); - const paddingObject = getPaddingObject(padding); - const altContext = elementContext === "floating" ? "reference" : "floating"; - const element = elements[altBoundary ? altContext : elementContext]; - const clippingClientRect = rectToClientRect(await platform3.getClippingRect({ - element: ((_await$platform$isEle = await (platform3.isElement == null ? void 0 : platform3.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || await (platform3.getDocumentElement == null ? void 0 : platform3.getDocumentElement(elements.floating)), - boundary, - rootBoundary, - strategy - })); - const rect = elementContext === "floating" ? { - x, - y, - width: rects.floating.width, - height: rects.floating.height - } : rects.reference; - const offsetParent = await (platform3.getOffsetParent == null ? void 0 : platform3.getOffsetParent(elements.floating)); - const offsetScale = await (platform3.isElement == null ? void 0 : platform3.isElement(offsetParent)) && await (platform3.getScale == null ? void 0 : platform3.getScale(offsetParent)) || { - x: 1, - y: 1 - }; - const elementClientRect = rectToClientRect(platform3.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform3.convertOffsetParentRelativeRectToViewportRelativeRect({ - elements, - rect, - offsetParent, - strategy - }) : rect); - return { - top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y, - bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y, - left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x, - right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x - }; -} -var MAX_RESET_COUNT = 50; -var computePosition = async (reference, floating, config) => { - const { - placement = "bottom", - strategy = "absolute", - middleware = [], - platform: platform3 - } = config; - const platformWithDetectOverflow = platform3.detectOverflow ? platform3 : { - ...platform3, - detectOverflow - }; - const rtl = await (platform3.isRTL == null ? void 0 : platform3.isRTL(floating)); - let rects = await platform3.getElementRects({ - reference, - floating, - strategy - }); - let { - x, - y - } = computeCoordsFromPlacement(rects, placement, rtl); - let statefulPlacement = placement; - let resetCount = 0; - const middlewareData = {}; - for (let i = 0; i < middleware.length; i++) { - const currentMiddleware = middleware[i]; - if (!currentMiddleware) { - continue; - } - const { - name, - fn - } = currentMiddleware; - const { - x: nextX, - y: nextY, - data, - reset - } = await fn({ - x, - y, - initialPlacement: placement, - placement: statefulPlacement, - strategy, - middlewareData, - rects, - platform: platformWithDetectOverflow, - elements: { - reference, - floating - } - }); - x = nextX != null ? nextX : x; - y = nextY != null ? nextY : y; - middlewareData[name] = { - ...middlewareData[name], - ...data + /** + * Stable fallback store used for server rendering and hydration. Root stores cannot be recorded on + * the handle during render because a handle can be shared by concurrent server-rendered requests. + * @internal + */ + get serverStore() { + return this.fallbackStore; + } + /** + * Subscribes to changes of the attached store pointer so detached triggers re-render and re-bind + * when a root attaches or detaches. Returns a function that removes the listener. + * @internal + */ + subscribeStore(listener) { + this.storeListeners.add(listener); + return () => { + this.storeListeners.delete(listener); }; - if (reset && resetCount < MAX_RESET_COUNT) { - resetCount++; - if (typeof reset === "object") { - if (reset.placement) { - statefulPlacement = reset.placement; - } - if (reset.rects) { - rects = reset.rects === true ? await platform3.getElementRects({ - reference, - floating, - strategy - }) : reset.rects; - } - ({ - x, - y - } = computeCoordsFromPlacement(rects, statefulPlacement, rtl)); + } + /** + * Points the handle at a root's store and notifies subscribers so detached triggers re-render and + * re-register into it (their registration effect migrates them when the store pointer changes). + * Returns a cleanup function that detaches the store again. + * @internal + */ + attachStore(newStore) { + this.attachedStores.push(newStore); + this.setActiveStore(newStore); + if (true) { + if (this.attachedStores.length > 1) { + const dev = this; + (dev.overlapWarningFrame ??= AnimationFrame.create()).request(() => { + if (this.attachedStores.length > 1) { + console.warn("Base UI: A handle is attached to more than one mounted root at the same time. The most recently mounted root takes over and the previous one stops being controlled by the handle. A handle should be used by a single root that stays mounted for the lifetime of the handle."); + } + }); } - i = -1; } + return () => { + const index2 = this.attachedStores.lastIndexOf(newStore); + if (index2 !== -1) { + this.attachedStores.splice(index2, 1); + } + this.setActiveStore(this.attachedStores[this.attachedStores.length - 1] ?? null); + }; } - return { - x, - y, - placement: statefulPlacement, - strategy, - middlewareData - }; -}; -var flip = function(options) { - if (options === void 0) { - options = {}; + /** + * Sets the store that currently controls the handle and notifies subscribers when it changes, so + * detached triggers re-render and migrate their registration to the new store. + */ + setActiveStore(store2) { + if (this.attachedStoreValue !== store2) { + this.attachedStoreValue = store2; + this.storeListeners.forEach((listener) => { + listener(); + }); + } } - return { - name: "flip", - options, - async fn(state) { - var _middlewareData$arrow, _middlewareData$flip; - const { - placement, - middlewareData, - rects, - initialPlacement, - platform: platform3, - elements - } = state; - const { - mainAxis: checkMainAxis = true, - crossAxis: checkCrossAxis = true, - fallbackPlacements: specifiedFallbackPlacements, - fallbackStrategy = "bestFit", - fallbackAxisSideDirection = "none", - flipAlignment = true, - ...detectOverflowOptions - } = evaluate(options, state); - if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { - return {}; + /** + * Opens the attached root's store and associates it with the trigger with the given id, or a + * no-op (with a dev warning) while no root is attached. Shared by every concrete handle's public + * `open()` method, which only narrows the parameter type. + * + * When a trigger id is given but no matching trigger is registered, anchored popups throw (see + * `throwOnMissingTrigger`); Dialog opens unassociated with a dev warning instead. + * + * This method should only be called in an event handler or an effect (not during rendering). + * + * @param triggerId ID of the trigger to associate with the popup, or `null`/`undefined` to open + * without associating any trigger. + */ + openByTrigger(triggerId) { + const attachedStore = this.attachedStore; + if (attachedStore === null) { + if (true) { + console.warn(`Base UI: ${this.componentName}Handle.open() was called while no root using this handle is mounted. The call was ignored; mount a root with this handle before opening it imperatively.`); } - const side = getSide(placement); - const initialSideAxis = getSideAxis(initialPlacement); - const isBasePlacement = getSide(initialPlacement) === initialPlacement; - const rtl = await (platform3.isRTL == null ? void 0 : platform3.isRTL(elements.floating)); - const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement)); - const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none"; - if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) { - fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl)); + return; + } + let triggerElement; + if (triggerId) { + for (let i = this.attachedStores.length - 1; i >= 0 && !triggerElement; i -= 1) { + triggerElement = this.attachedStores[i].context.triggerElements.getById(triggerId); } - const placements2 = [initialPlacement, ...fallbackPlacements]; - const overflow = await platform3.detectOverflow(state, detectOverflowOptions); - const overflows = []; - let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || []; - if (checkMainAxis) { - overflows.push(overflow[side]); + triggerElement ??= this.fallbackStore.context.triggerElements.getById(triggerId); + } + if (triggerId && !triggerElement) { + if (this.throwOnMissingTrigger) { + throw new Error(true ? `Base UI: ${this.componentName}Handle.open() was called with the trigger id "${triggerId}", but no matching trigger is registered with this handle. An anchored popup cannot open without a trigger to anchor to. Pass the id of a mounted ${this.componentName}.Trigger that has this handle set on its "handle" prop.` : formatErrorMessage_default(99, this.componentName, triggerId, this.componentName)); } - if (checkCrossAxis) { - const sides2 = getAlignmentSides(placement, rects, rtl); - overflows.push(overflow[sides2[0]], overflow[sides2[1]]); + if (true) { + console.warn(`Base UI: ${this.componentName}Handle.open: No trigger found with id "${triggerId}". The popup will open, but the trigger will not be associated with it.`); } - overflowsData = [...overflowsData, { - placement, - overflows - }]; - if (!overflows.every((side2) => side2 <= 0)) { - var _middlewareData$flip2, _overflowsData$filter; - const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1; - const nextPlacement = placements2[nextIndex]; - if (nextPlacement) { - const ignoreCrossAxisOverflow = checkCrossAxis === "alignment" ? initialSideAxis !== getSideAxis(nextPlacement) : false; - if (!ignoreCrossAxisOverflow || // We leave the current main axis only if every placement on that axis - // overflows the main axis. - overflowsData.every((d) => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) { - return { - data: { - index: nextIndex, - overflows: overflowsData - }, - reset: { - placement: nextPlacement - } - }; - } - } - let resetPlacement = (_overflowsData$filter = overflowsData.filter((d) => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement; - if (!resetPlacement) { - switch (fallbackStrategy) { - case "bestFit": { - var _overflowsData$filter2; - const placement2 = (_overflowsData$filter2 = overflowsData.filter((d) => { - if (hasFallbackAxisSideDirection) { - const currentSideAxis = getSideAxis(d.placement); - return currentSideAxis === initialSideAxis || // Create a bias to the `y` side axis due to horizontal - // reading directions favoring greater width. - currentSideAxis === "y"; - } - return true; - }).map((d) => [d.placement, d.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0]; - if (placement2) { - resetPlacement = placement2; - } - break; - } - case "initialPlacement": - resetPlacement = initialPlacement; - break; - } - } - if (placement !== resetPlacement) { - return { - reset: { - placement: resetPlacement - } - }; - } + } + attachedStore.setOpen(true, createChangeEventDetails(reason_parts_exports.imperativeAction, void 0, triggerElement)); + } + /** + * Closes the popup by setting the attached root's store to closed, or a no-op (with a dev warning) + * while no root is attached. Shared by every concrete handle's public `close()` method. + * + * This method should only be called in an event handler or an effect (not during rendering). + */ + closePopup() { + const attachedStore = this.attachedStore; + if (attachedStore === null) { + if (true) { + console.warn(`Base UI: ${this.componentName}Handle.close() was called while no root using this handle is mounted. The call was ignored.`); } - return {}; + return; } - }; + attachedStore.setOpen(false, createChangeEventDetails(reason_parts_exports.imperativeAction)); + } }; -var originSides = /* @__PURE__ */ new Set(["left", "top"]); -async function convertValueToCoords(state, options) { + +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/popups/popupStoreUtils.mjs +var React22 = __toESM(require_react(), 1); +var ReactDOM3 = __toESM(require_react_dom(), 1); + +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/hooks/useSyncedFloatingRootContext.mjs +function useSyncedFloatingRootContext(options) { const { - placement, - platform: platform3, - elements - } = state; - const rtl = await (platform3.isRTL == null ? void 0 : platform3.isRTL(elements.floating)); - const side = getSide(placement); - const alignment = getAlignment(placement); - const isVertical = getSideAxis(placement) === "y"; - const mainAxisMulti = originSides.has(side) ? -1 : 1; - const crossAxisMulti = rtl && isVertical ? -1 : 1; - const rawValue = evaluate(options, state); - let { - mainAxis, - crossAxis, - alignmentAxis - } = typeof rawValue === "number" ? { - mainAxis: rawValue, - crossAxis: 0, - alignmentAxis: null - } : { - mainAxis: rawValue.mainAxis || 0, - crossAxis: rawValue.crossAxis || 0, - alignmentAxis: rawValue.alignmentAxis - }; - if (alignment && typeof alignmentAxis === "number") { - crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis; - } - return isVertical ? { - x: crossAxis * crossAxisMulti, - y: mainAxis * mainAxisMulti - } : { - x: mainAxis * mainAxisMulti, - y: crossAxis * crossAxisMulti - }; + popupStore, + treatPopupAsFloatingElement = false, + floatingRootContext: store2, + floatingId, + nested, + onOpenChange + } = options; + const open2 = popupStore.useState("open"); + const referenceElement = popupStore.useState("activeTriggerElement"); + const floatingElement = popupStore.useState(treatPopupAsFloatingElement ? "popupElement" : "positionerElement"); + const handleOpenChange = onOpenChange; + popupStore.useSyncedValue("floatingId", floatingId); + useIsoLayoutEffect(() => { + const valuesToSync = { + open: open2, + floatingId, + referenceElement, + floatingElement + }; + if (isElement(referenceElement)) { + valuesToSync.domReferenceElement = referenceElement; + } + if (store2.state.positionReference === store2.state.referenceElement) { + valuesToSync.positionReference = referenceElement; + } + store2.update(valuesToSync); + }, [open2, floatingId, referenceElement, floatingElement, store2]); + store2.context.onOpenChange = handleOpenChange; + store2.context.nested = nested; + return store2; } -var offset = function(options) { - if (options === void 0) { - options = 0; - } - return { - name: "offset", - options, - async fn(state) { - var _middlewareData$offse, _middlewareData$arrow; - const { - x, - y, - placement, - middlewareData - } = state; - const diffCoords = await convertValueToCoords(state, options); - if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { - return {}; + +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/useUnmountAfterClose.mjs +var React21 = __toESM(require_react(), 1); +function useUnmountAfterClose(parameters) { + const { + open: open2, + ref, + preventUnmountOnClose, + setPreventUnmountOnClose: setPreventUnmountOnCloseParam, + onUnmount, + animateInitialOpen + } = parameters; + const setPreventUnmountOnClose = useStableCallback(setPreventUnmountOnCloseParam); + const { + mounted, + setMounted, + transitionStatus + } = useTransitionStatus(open2, false, false, animateInitialOpen); + const preventUnmountingOnClose = open2 ? false : preventUnmountOnClose; + useIsoLayoutEffect(() => { + if (open2) { + setPreventUnmountOnClose(false); + } + }, [open2, setPreventUnmountOnClose]); + const mountedRef = React21.useRef(mounted); + const pendingUnmountRef = React21.useRef(false); + const rerender = useForcedRerendering(); + const unmount = () => { + mountedRef.current = false; + setMounted(false); + onUnmount(); + }; + useIsoLayoutEffect(() => { + mountedRef.current = mounted; + if (pendingUnmountRef.current) { + pendingUnmountRef.current = false; + if (!open2 && mounted) { + unmount(); } - return { - x: x + diffCoords.x, - y: y + diffCoords.y, - data: { - ...diffCoords, - placement - } - }; } - }; -}; -var shift = function(options) { - if (options === void 0) { - options = {}; - } - return { - name: "shift", - options, - async fn(state) { - const { - x, - y, - placement, - platform: platform3 - } = state; - const { - mainAxis: checkMainAxis = true, - crossAxis: checkCrossAxis = false, - limiter = { - fn: (_ref) => { - let { - x: x2, - y: y2 - } = _ref; - return { - x: x2, - y: y2 - }; - } - }, - ...detectOverflowOptions - } = evaluate(options, state); - const coords = { - x, - y - }; - const overflow = await platform3.detectOverflow(state, detectOverflowOptions); - const crossAxis = getSideAxis(placement); - const mainAxis = getOppositeAxis(crossAxis); - let mainAxisCoord = coords[mainAxis]; - let crossAxisCoord = coords[crossAxis]; - const clampCoord = (axis, coord) => clamp(coord + overflow[axis === "y" ? "top" : "left"], coord, coord - overflow[axis === "y" ? "bottom" : "right"]); - if (checkMainAxis) { - mainAxisCoord = clampCoord(mainAxis, mainAxisCoord); - } - if (checkCrossAxis) { - crossAxisCoord = clampCoord(crossAxis, crossAxisCoord); + }); + const forceUnmount = useStableCallback(() => { + if (!mountedRef.current) { + return; + } + if (open2) { + pendingUnmountRef.current = true; + rerender(); + return; + } + unmount(); + }); + useOpenChangeComplete({ + enabled: mounted && !open2 && !preventUnmountingOnClose, + open: open2, + ref, + onComplete() { + if (!open2) { + forceUnmount(); } - const limitedCoords = limiter.fn({ - ...state, - [mainAxis]: mainAxisCoord, - [crossAxis]: crossAxisCoord - }); - return { - ...limitedCoords, - data: { - x: limitedCoords.x - x, - y: limitedCoords.y - y, - enabled: { - [mainAxis]: checkMainAxis, - [crossAxis]: checkCrossAxis - } - } - }; } + }); + return { + mounted, + transitionStatus, + preventUnmountingOnClose, + forceUnmount }; +} + +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/popups/popupStoreUtils.mjs +var FOCUSABLE_POPUP_PROPS = { + tabIndex: -1, + [FOCUSABLE_ATTRIBUTE]: "" }; -var limitShift = function(options) { - if (options === void 0) { - options = {}; +function usePopupRootStore(createStore, treatPopupAsFloatingElement = false) { + const floatingId = useId(); + const nested = useFloatingParentNodeId() != null; + const store2 = useRefWithInit(() => createStore(floatingId, nested)).current; + useSyncedFloatingRootContext({ + popupStore: store2, + treatPopupAsFloatingElement, + floatingRootContext: store2.state.floatingRootContext, + floatingId, + nested, + onOpenChange: store2.setOpen + }); + return store2; +} +function PopupHandleAttachment({ + handle, + store: store2 +}) { + useIsoLayoutEffect(() => { + return handle.attachStore(store2); + }, [handle, store2]); + return null; +} +function syncTriggerCount(store2) { + const triggerCount = store2.context.triggerElements.size; + if (store2.select("open") && store2.state.triggerCount !== triggerCount) { + store2.set("triggerCount", triggerCount); } - return { - options, - fn(state) { - var _rawOffset$mainAxis, _rawOffset$crossAxis; - const { - x, - y, - placement, - rects, - middlewareData - } = state; - const { - offset: offset4 = 0, - mainAxis: checkMainAxis = true, - crossAxis: checkCrossAxis = true - } = evaluate(options, state); - const coords = { - x, - y - }; - const crossAxis = getSideAxis(placement); - const mainAxis = getOppositeAxis(crossAxis); - let mainAxisCoord = coords[mainAxis]; - let crossAxisCoord = coords[crossAxis]; - const rawOffset = evaluate(offset4, state); - const computedOffset = typeof rawOffset === "number" ? { - mainAxis: rawOffset, - crossAxis: 0 - } : { - mainAxis: (_rawOffset$mainAxis = rawOffset.mainAxis) != null ? _rawOffset$mainAxis : 0, - crossAxis: (_rawOffset$crossAxis = rawOffset.crossAxis) != null ? _rawOffset$crossAxis : 0 - }; - if (checkMainAxis) { - const len = mainAxis === "y" ? "height" : "width"; - const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis; - const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis; - if (mainAxisCoord < limitMin) { - mainAxisCoord = limitMin; - } else if (mainAxisCoord > limitMax) { - mainAxisCoord = limitMax; - } +} +function useTriggerRegistration(id, store2) { + const registrationRef = React22.useRef(null); + return useStableCallback((element) => { + const registration = registrationRef.current; + if (registration !== null) { + if (registration.element === element && registration.store === store2 && registration.id === id) { + return; } - if (checkCrossAxis) { - var _middlewareData$offse, _middlewareData$offse2; - const len = mainAxis === "y" ? "width" : "height"; - const isOriginSide = originSides.has(getSide(placement)); - const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis); - const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0); - if (crossAxisCoord < limitMin) { - crossAxisCoord = limitMin; - } else if (crossAxisCoord > limitMax) { - crossAxisCoord = limitMax; - } + registrationRef.current = null; + const registeredStore = registration.store; + if (registeredStore.context.triggerElements.getById(registration.id) === registration.element) { + registeredStore.context.triggerElements.delete(registration.id); + syncTriggerCount(registeredStore); } - return { - [mainAxis]: mainAxisCoord, - [crossAxis]: crossAxisCoord + } + if (element !== null && id !== void 0) { + registrationRef.current = { + store: store2, + id, + element }; + store2.context.triggerElements.add(id, element); + syncTriggerCount(store2); } - }; -}; -var size = function(options) { - if (options === void 0) { - options = {}; + }); +} +function createPopupOpenState(state, open2, trigger, preventUnmountOnClose = false) { + let preventUnmountingOnClose = state.preventUnmountingOnClose; + if (open2) { + preventUnmountingOnClose = false; + } else if (preventUnmountOnClose) { + preventUnmountingOnClose = true; + } + const triggerId = trigger?.id ?? null; + let activeTriggerId = state.activeTriggerId; + let activeTriggerElement = state.activeTriggerElement; + if (triggerId || open2) { + activeTriggerId = triggerId; + activeTriggerElement = trigger ?? null; } return { - name: "size", - options, - async fn(state) { - const { - placement, - rects, - platform: platform3, - elements - } = state; - const { - apply = () => { - }, - ...detectOverflowOptions - } = evaluate(options, state); - const overflow = await platform3.detectOverflow(state, detectOverflowOptions); - const side = getSide(placement); - const alignment = getAlignment(placement); - const isYAxis = getSideAxis(placement) === "y"; - const { - width, - height - } = rects.floating; - let heightSide; - let widthSide; - if (side === "top" || side === "bottom") { - heightSide = side; - widthSide = alignment === (await (platform3.isRTL == null ? void 0 : platform3.isRTL(elements.floating)) ? "start" : "end") ? "left" : "right"; - } else { - widthSide = side; - heightSide = alignment === "end" ? "top" : "bottom"; - } - const maximumClippingHeight = height - overflow.top - overflow.bottom; - const maximumClippingWidth = width - overflow.left - overflow.right; - const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight); - const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth); - const shiftData = state.middlewareData.shift; - const noShift = !shiftData; - let availableHeight2 = overflowAvailableHeight; - let availableWidth2 = overflowAvailableWidth; - if (shiftData != null && shiftData.enabled.x) { - availableWidth2 = maximumClippingWidth; - } - if (shiftData != null && shiftData.enabled.y) { - availableHeight2 = maximumClippingHeight; - } - if (noShift && !alignment) { - if (isYAxis) { - availableWidth2 = width - 2 * max(overflow.left, overflow.right); - } else { - availableHeight2 = height - 2 * max(overflow.top, overflow.bottom); - } - } - await apply({ - ...state, - availableWidth: availableWidth2, - availableHeight: availableHeight2 - }); - const nextDimensions = await platform3.getDimensions(elements.floating); - if (width !== nextDimensions.width || height !== nextDimensions.height) { - return { - reset: { - rects: true - } - }; - } - return {}; - } - }; -}; - -// node_modules/.store/@floating-ui/dom@1.8.0-vHXcr4FgWneV0cgwFw-d7A/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs -function getCssDimensions(element) { - const css = getComputedStyle2(element); - let width = parseFloat(css.width) || 0; - let height = parseFloat(css.height) || 0; - const hasOffset = isHTMLElement(element); - const offsetWidth = hasOffset ? element.offsetWidth : width; - const offsetHeight = hasOffset ? element.offsetHeight : height; - const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight; - if (shouldFallback) { - width = offsetWidth; - height = offsetHeight; - } - return { - width, - height, - $: shouldFallback + open: open2, + preventUnmountingOnClose, + activeTriggerId, + activeTriggerElement, + // An open request without a trigger (a handle's `open(null)` or `openWithPayload()`) must not + // be reassociated with a lone registered trigger later on. Controlled and default opens never + // pass through here, so they keep claiming a lone trigger. A close request keeps the flag: a + // controlled root may decline it and stay open, so the Root clears the flag only once the + // popup is effectively closed. + openedWithoutTrigger: open2 ? trigger == null : state.openedWithoutTrigger }; } -function unwrapElement(element) { - return !isElement(element) ? element.contextElement : element; -} -function getScale(element) { - const domElement = unwrapElement(element); - if (!isHTMLElement(domElement)) { - return createCoords(1); - } - const rect = domElement.getBoundingClientRect(); - const { - width, - height, - $ - } = getCssDimensions(domElement); - let x = ($ ? round(rect.width) : rect.width) / width; - let y = ($ ? round(rect.height) : rect.height) / height; - if (!x || !Number.isFinite(x)) { - x = 1; - } - if (!y || !Number.isFinite(y)) { - y = 1; - } - return { - x, - y +function attachPreventUnmountOnClose(eventDetails) { + let preventUnmountOnClose = false; + eventDetails.preventUnmountOnClose = () => { + preventUnmountOnClose = true; }; + return () => preventUnmountOnClose; } -var noOffsets = /* @__PURE__ */ createCoords(0); -function getVisualOffsets(element) { - const win = getWindow(element); - if (!isWebKit() || !win.visualViewport) { - return noOffsets; +function applyPopupOpenChange(store2, nextOpen, eventDetails, options = {}) { + const reason = eventDetails.reason; + const isHover = reason === reason_parts_exports.triggerHover; + const isFocusOpen = nextOpen && reason === reason_parts_exports.triggerFocus; + const isDismissClose = !nextOpen && (reason === reason_parts_exports.triggerPress || reason === reason_parts_exports.escapeKey); + const shouldPreventUnmountOnClose = attachPreventUnmountOnClose(eventDetails); + store2.context.onOpenChange?.(nextOpen, eventDetails); + if (eventDetails.isCanceled) { + return; } - return { - x: win.visualViewport.offsetLeft, - y: win.visualViewport.offsetTop + options.onBeforeDispatch?.(); + store2.state.floatingRootContext.dispatchOpenChange(nextOpen, eventDetails); + const changeState = () => { + const popupOpenState = createPopupOpenState(store2.state, nextOpen, eventDetails.trigger, shouldPreventUnmountOnClose()); + const updatedState = { + ...options.extraState, + ...popupOpenState + }; + if (isFocusOpen) { + updatedState.instantType = "focus"; + } else if (isDismissClose) { + updatedState.instantType = "dismiss"; + } else if (isHover) { + updatedState.instantType = void 0; + } + store2.update(updatedState); }; -} -function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) { - if (isFixed === void 0) { - isFixed = false; + if (isHover) { + ReactDOM3.flushSync(changeState); + } else { + changeState(); } - return !!floatingOffsetParent && isFixed && floatingOffsetParent === getWindow(element); } -function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) { - if (includeScale === void 0) { - includeScale = false; - } - if (isFixedStrategy === void 0) { - isFixedStrategy = false; - } - const clientRect = element.getBoundingClientRect(); - const domElement = unwrapElement(element); - let scale = createCoords(1); - if (includeScale) { - if (offsetParent) { - if (isElement(offsetParent)) { - scale = getScale(offsetParent); - } - } else { - scale = getScale(element); +function useTriggerDataForwarding(triggerId, triggerElementRef, store2, stateUpdates) { + const isMountedByThisTrigger = store2.useState("isMountedByTrigger", triggerId); + const baseRegisterTrigger = useTriggerRegistration(triggerId, store2); + const applyTriggerData = useStableCallback((element) => { + const open2 = store2.select("open"); + const activeTriggerId = store2.select("activeTriggerId"); + if (activeTriggerId === triggerId) { + const changes = { + activeTriggerElement: element, + ...open2 ? stateUpdates : null + }; + store2.update(changes); + return; } - } - const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0); - let x = (clientRect.left + visualOffsets.x) / scale.x; - let y = (clientRect.top + visualOffsets.y) / scale.y; - let width = clientRect.width / scale.x; - let height = clientRect.height / scale.y; - if (domElement && offsetParent) { - const win = getWindow(domElement); - const offsetWin = isElement(offsetParent) ? getWindow(offsetParent) : offsetParent; - let currentWin = win; - let currentIFrame = getFrameElement(currentWin); - while (currentIFrame && offsetWin !== currentWin) { - const iframeScale = getScale(currentIFrame); - const iframeRect = currentIFrame.getBoundingClientRect(); - const css = getComputedStyle2(currentIFrame); - const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x; - const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y; - x *= iframeScale.x; - y *= iframeScale.y; - width *= iframeScale.x; - height *= iframeScale.y; - x += left; - y += top; - currentWin = getWindow(currentIFrame); - currentIFrame = getFrameElement(currentWin); + if (activeTriggerId == null && open2 && !store2.state.openedWithoutTrigger) { + const changes = { + activeTriggerId: triggerId ?? null, + activeTriggerElement: element, + ...stateUpdates + }; + store2.update(changes); } - } - return rectToClientRect({ - width, - height, - x, - y }); -} -function getWindowScrollBarX(element, rect) { - const leftScroll = getNodeScroll(element).scrollLeft; - if (!rect) { - return getBoundingClientRect(getDocumentElement(element)).left + leftScroll; - } - return rect.left + leftScroll; -} -function getHTMLOffset(documentElement, scroll) { - const htmlRect = documentElement.getBoundingClientRect(); - const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect); - const y = htmlRect.top + scroll.scrollTop; - return { - x, - y - }; -} -function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) { - let { - elements, - rect, - offsetParent, - strategy - } = _ref; - const isFixed = strategy === "fixed"; - const documentElement = getDocumentElement(offsetParent); - const topLayer = elements ? isTopLayer(elements.floating) : false; - if (offsetParent === documentElement || topLayer && isFixed) { - return rect; - } - let scroll = { - scrollLeft: 0, - scrollTop: 0 - }; - let scale = createCoords(1); - const offsets = createCoords(0); - const isOffsetParentAnElement = isHTMLElement(offsetParent); - if (isOffsetParentAnElement || !isFixed) { - if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) { - scroll = getNodeScroll(offsetParent); + const registerTrigger = useStableCallback((element) => { + baseRegisterTrigger(element); + if (element) { + applyTriggerData(element); } - if (isOffsetParentAnElement) { - const offsetRect = getBoundingClientRect(offsetParent); - scale = getScale(offsetParent); - offsets.x = offsetRect.x + offsetParent.clientLeft; - offsets.y = offsetRect.y + offsetParent.clientTop; + }); + useIsoLayoutEffect(() => { + registerTrigger(triggerElementRef.current); + return () => registerTrigger(null); + }, [registerTrigger, triggerElementRef, store2, triggerId]); + useIsoLayoutEffect(() => { + if (isMountedByThisTrigger) { + const changes = { + activeTriggerElement: triggerElementRef.current, + ...stateUpdates + }; + store2.update(changes); } - } - const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0); + }, [isMountedByThisTrigger, store2, triggerElementRef, ...Object.values(stateUpdates)]); return { - width: rect.width * scale.x, - height: rect.height * scale.y, - x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x, - y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y + registerTrigger, + isMountedByThisTrigger }; } -function getClientRects(element) { - return element.getClientRects ? Array.from(element.getClientRects()) : []; -} -function getDocumentRect(html) { - const scroll = getNodeScroll(html); - const body = html.ownerDocument.body; - const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth); - const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight); - let x = -scroll.scrollLeft + getWindowScrollBarX(html); - const y = -scroll.scrollTop; - if (getComputedStyle2(body).direction === "rtl") { - x += max(html.clientWidth, body.clientWidth) - width; - } - return { - width, - height, - x, - y - }; -} -var SCROLLBAR_MAX = 25; -function getViewportRect(element, strategy, rootBoundary) { - if (rootBoundary === void 0) { - rootBoundary = "viewport"; - } - const isLayoutViewport = rootBoundary === "layoutViewport"; - const win = getWindow(element); - const html = getDocumentElement(element); - const visualViewport = win.visualViewport; - let width = html.clientWidth; - let height = html.clientHeight; - let x = 0; - let y = 0; - if (visualViewport) { - const layoutRelativeClientCoords = !isWebKit() || strategy === "fixed"; - if (isLayoutViewport) { - if (!layoutRelativeClientCoords) { - x = -visualViewport.offsetLeft; - y = -visualViewport.offsetTop; +function useImplicitActiveTrigger(store2, options = {}) { + const { + closeOnActiveTriggerUnmount = false + } = options; + const resolvedActiveTriggerIdRef = React22.useRef(null); + const open2 = store2.useState("open"); + const reactiveTriggerCount = store2.useState("triggerCount"); + const activeTriggerId = store2.useState("activeTriggerId"); + const reactiveActiveTriggerElement = store2.useState("activeTriggerElement"); + useIsoLayoutEffect(() => { + if (!open2) { + resolvedActiveTriggerIdRef.current = null; + if (store2.state.triggerCount !== 0) { + store2.set("triggerCount", 0); + } + if (store2.state.openedWithoutTrigger) { + store2.set("openedWithoutTrigger", false); + } + return; + } + const triggerCount = store2.context.triggerElements.size; + const stateUpdates = {}; + if (store2.state.triggerCount !== triggerCount) { + stateUpdates.triggerCount = triggerCount; + } + const currentActiveTriggerId = store2.select("activeTriggerId"); + let lostActiveTriggerId = null; + if (currentActiveTriggerId) { + const activeTriggerElement = store2.context.triggerElements.getById(currentActiveTriggerId); + if (!activeTriggerElement) { + for (const [triggerId, triggerElement] of store2.context.triggerElements.entries()) { + if (triggerElement === store2.state.activeTriggerElement) { + stateUpdates.activeTriggerId = triggerId; + stateUpdates.activeTriggerElement = triggerElement; + resolvedActiveTriggerIdRef.current = triggerId; + break; + } + } + if (stateUpdates.activeTriggerId === void 0) { + if (resolvedActiveTriggerIdRef.current === currentActiveTriggerId) { + lostActiveTriggerId = currentActiveTriggerId; + } else { + resolvedActiveTriggerIdRef.current = null; + } + } + } else { + resolvedActiveTriggerIdRef.current = currentActiveTriggerId; + if (activeTriggerElement !== store2.state.activeTriggerElement) { + stateUpdates.activeTriggerElement = activeTriggerElement; + } } } else { - width = visualViewport.width; - height = visualViewport.height; - if (layoutRelativeClientCoords) { - x = visualViewport.offsetLeft; - y = visualViewport.offsetTop; + resolvedActiveTriggerIdRef.current = null; + } + if (!lostActiveTriggerId && !currentActiveTriggerId && !store2.state.openedWithoutTrigger && triggerCount === 1) { + const iteratorResult = store2.context.triggerElements.entries().next(); + if (!iteratorResult.done) { + const [implicitTriggerId, implicitTriggerElement] = iteratorResult.value; + stateUpdates.activeTriggerId = implicitTriggerId; + stateUpdates.activeTriggerElement = implicitTriggerElement; + resolvedActiveTriggerIdRef.current = implicitTriggerId; } } - } - const windowScrollbarX = getWindowScrollBarX(html); - if (windowScrollbarX <= 0) { - const doc = html.ownerDocument; - const body = doc.body; - const bodyStyles = getComputedStyle(body); - const bodyMarginInline = doc.compatMode === "CSS1Compat" ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0; - const reservedWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline); - const gutter = getComputedStyle(html).scrollbarGutter === "stable both-edges" ? reservedWidth / 2 : reservedWidth; - if (gutter <= SCROLLBAR_MAX) { - width -= gutter; + if (stateUpdates.triggerCount !== void 0 || stateUpdates.activeTriggerId !== void 0 || stateUpdates.activeTriggerElement !== void 0) { + store2.update(stateUpdates); } - } - return { - width, - height, - x, - y - }; + if (lostActiveTriggerId) { + if (closeOnActiveTriggerUnmount) { + queueMicrotask(() => { + if (store2.select("open") && store2.select("activeTriggerId") === lostActiveTriggerId && !store2.context.triggerElements.getById(lostActiveTriggerId)) { + const eventDetails = createChangeEventDetails(reason_parts_exports.none); + store2.setOpen(false, eventDetails); + if (!eventDetails.isCanceled) { + store2.update({ + activeTriggerId: null, + activeTriggerElement: null + }); + } + } + }); + } + } + }, [open2, store2, reactiveTriggerCount, activeTriggerId, reactiveActiveTriggerElement, closeOnActiveTriggerUnmount]); } -function getInnerBoundingClientRect(element, strategy) { - const clientRect = getBoundingClientRect(element, true, strategy === "fixed"); - const top = clientRect.top + element.clientTop; - const left = clientRect.left + element.clientLeft; - const scale = getScale(element); - const width = element.clientWidth * scale.x; - const height = element.clientHeight * scale.y; - const x = left * scale.x; - const y = top * scale.y; +function useOpenStateTransitions(open2, store2, onUnmount, animateInitialOpen) { + const { + mounted, + transitionStatus, + forceUnmount + } = useUnmountAfterClose({ + open: open2, + ref: store2.context.popupRef, + preventUnmountOnClose: store2.useState("preventUnmountingOnClose"), + setPreventUnmountOnClose: (preventUnmountOnClose) => store2.set("preventUnmountingOnClose", preventUnmountOnClose), + animateInitialOpen, + onUnmount() { + store2.update({ + activeTriggerId: null, + activeTriggerElement: null, + mounted: false, + preventUnmountingOnClose: false + }); + onUnmount?.(); + store2.context.onOpenChangeComplete?.(false); + } + }); + useRefWithInit(() => { + store2.set("mounted", mounted); + return null; + }); + store2.useSyncedValues({ + mounted, + transitionStatus + }); return { - width, - height, - x, - y + forceUnmount, + transitionStatus }; } -function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) { - let rect; - if (clippingAncestor === "viewport" || clippingAncestor === "layoutViewport") { - rect = getViewportRect(element, strategy, clippingAncestor); - } else if (clippingAncestor === "document") { - rect = getDocumentRect(getDocumentElement(element)); - } else if (isElement(clippingAncestor)) { - rect = getInnerBoundingClientRect(clippingAncestor, strategy); - } else { - const visualOffsets = getVisualOffsets(element); - rect = { - x: clippingAncestor.x - visualOffsets.x, - y: clippingAncestor.y - visualOffsets.y, - width: clippingAncestor.width, - height: clippingAncestor.height - }; +function usePopupInteractionProps(store2, statePart) { + store2.useSyncedValues(statePart); + useIsoLayoutEffect(() => () => { + store2.update({ + activeTriggerProps: EMPTY_OBJECT, + inactiveTriggerProps: EMPTY_OBJECT, + popupProps: EMPTY_OBJECT + }); + }, [store2]); +} + +// node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/popups/popupTriggerMap.mjs +var devElementIdsByMap; +function getDevElementIds(map) { + devElementIdsByMap ??= /* @__PURE__ */ new WeakMap(); + let elementIds = devElementIdsByMap.get(map); + if (!elementIds) { + elementIds = /* @__PURE__ */ new WeakMap(); + devElementIdsByMap.set(map, elementIds); } - return rectToClientRect(rect); + return elementIds; } -function getClippingElementAncestors(element, cache) { - const cachedResult = cache.get(element); - if (cachedResult) { - return cachedResult; +var PopupTriggerMap = class { + idMap = /* @__PURE__ */ new Map(); + /** + * Adds a trigger element with the given ID. + * + * Note: The provided element is assumed to not be registered under multiple IDs. + */ + add(id, element) { + if (true) { + const elementIds = getDevElementIds(this); + const existingId = elementIds.get(element); + if (existingId !== void 0 && existingId !== id) { + throw new Error("Base UI: A trigger element cannot be registered under multiple IDs in PopupTriggerMap."); + } + const previousElement = this.idMap.get(id); + if (previousElement !== void 0 && previousElement !== element) { + elementIds.delete(previousElement); + } + elementIds.set(element, id); + } + this.idMap.set(id, element); } - let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body"); - let lastKeptComputedStyle = null; - const elementIsFixed = getComputedStyle2(element).position === "fixed"; - let currentNode = elementIsFixed ? getParentNode(element) : element; - while (isElement(currentNode) && !isLastTraversableNode(currentNode)) { - const computedStyle = getComputedStyle2(currentNode); - const currentNodeIsContaining = isContainingBlock(currentNode); - const lastPosition = lastKeptComputedStyle ? lastKeptComputedStyle.position : elementIsFixed ? "fixed" : ""; - const shouldDropCurrentNode = !currentNodeIsContaining && (lastPosition === "fixed" || lastPosition === "absolute" && computedStyle.position === "static"); - if (shouldDropCurrentNode) { - result = result.filter((ancestor) => ancestor !== currentNode); - } else { - lastKeptComputedStyle = computedStyle; + /** + * Removes the trigger element with the given ID. + */ + delete(id) { + if (true) { + const element = this.idMap.get(id); + if (element !== void 0) { + devElementIdsByMap?.get(this)?.delete(element); + } } - currentNode = getParentNode(currentNode); + this.idMap.delete(id); } - cache.set(element, result); - return result; -} -function getClippingRect(_ref) { - let { - element, - boundary, - rootBoundary, - strategy - } = _ref; - const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary); - const clippingAncestors = [...elementClippingAncestors, rootBoundary]; - const firstRect = getClientRectFromClippingAncestor(element, clippingAncestors[0], strategy); - let top = firstRect.top; - let right = firstRect.right; - let bottom = firstRect.bottom; - let left = firstRect.left; - for (let i = 1; i < clippingAncestors.length; i++) { - const rect = getClientRectFromClippingAncestor(element, clippingAncestors[i], strategy); - top = max(rect.top, top); - right = min(rect.right, right); - bottom = min(rect.bottom, bottom); - left = max(rect.left, left); - } - return { - width: right - left, - height: bottom - top, - x: left, - y: top - }; -} -function getDimensions(element) { - const { - width, - height - } = getCssDimensions(element); - return { - width, - height - }; -} -function getRectRelativeToOffsetParent(element, offsetParent, strategy) { - const isOffsetParentAnElement = isHTMLElement(offsetParent); - const documentElement = getDocumentElement(offsetParent); - const isFixed = strategy === "fixed"; - const rect = getBoundingClientRect(element, true, isFixed, offsetParent); - let scroll = { - scrollLeft: 0, - scrollTop: 0 - }; - const offsets = createCoords(0); - if (isOffsetParentAnElement || !isFixed) { - if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) { - scroll = getNodeScroll(offsetParent); + /** + * Whether the given element is registered as a trigger. + */ + hasElement(element) { + for (const registered of this.idMap.values()) { + if (registered === element) { + return true; + } } - if (isOffsetParentAnElement) { - const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent); - offsets.x = offsetRect.x + offsetParent.clientLeft; - offsets.y = offsetRect.y + offsetParent.clientTop; + return false; + } + /** + * Whether there is a registered trigger element matching the given predicate. + */ + hasMatchingElement(predicate) { + for (const element of this.idMap.values()) { + if (predicate(element)) { + return true; + } } + return false; } - if (!isOffsetParentAnElement && documentElement) { - offsets.x = getWindowScrollBarX(documentElement); + /** + * Returns the trigger element associated with the given ID, or undefined if no such element exists. + */ + getById(id) { + return this.idMap.get(id); } - const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0); - const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x; - const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y; - return { - x, - y, - width: rect.width, - height: rect.height - }; -} -function isStaticPositioned(element) { - return getComputedStyle2(element).position === "static"; -} -function getTrueOffsetParent(element, polyfill) { - if (!isHTMLElement(element) || getComputedStyle2(element).position === "fixed") { - return null; + /** + * Returns an iterable of all registered trigger entries, where each entry is a tuple of [id, element]. + */ + entries() { + return this.idMap.entries(); } - if (polyfill) { - return polyfill(element); + /** + * Returns an iterable of all registered trigger elements. + */ + elements() { + return this.idMap.values(); } - let rawOffsetParent = element.offsetParent; - if (getDocumentElement(element) === rawOffsetParent) { - rawOffsetParent = rawOffsetParent.ownerDocument.body; + /** + * Returns the number of registered trigger elements. + */ + get size() { + return this.idMap.size; } - return rawOffsetParent; +}; + +// node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/store/useStore.mjs +var React24 = __toESM(require_react(), 1); +var import_shim = __toESM(require_shim(), 1); +var import_with_selector = __toESM(require_with_selector(), 1); + +// node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/fastHooks.mjs +var React23 = __toESM(require_react(), 1); +var hooks = []; +var currentInstance = void 0; +function getInstance() { + return currentInstance; } -function getOffsetParent(element, polyfill) { - const win = getWindow(element); - if (isTopLayer(element)) { - return win; - } - if (!isHTMLElement(element)) { - let svgOffsetParent = getParentNode(element); - while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) { - if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) { - return svgOffsetParent; +function register(hook) { + hooks.push(hook); +} +function fastComponent(fn) { + const FastComponent = (props, forwardedRef) => { + const instance = useRefWithInit(createInstance).current; + let result; + try { + currentInstance = instance; + for (const hook of hooks) { + hook.before(instance); } - svgOffsetParent = getParentNode(svgOffsetParent); + result = fn(props, forwardedRef); + for (const hook of hooks) { + hook.after(instance); + } + instance.didInitialize = true; + } finally { + currentInstance = void 0; } - return win; - } - let offsetParent = getTrueOffsetParent(element, polyfill); - while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) { - offsetParent = getTrueOffsetParent(offsetParent, polyfill); - } - if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) { - return win; - } - return offsetParent || getContainingBlock(element) || win; + return result; + }; + FastComponent.displayName = fn.displayName || fn.name; + return FastComponent; } -var getElementRects = async function(data) { - const getOffsetParentFn = this.getOffsetParent || getOffsetParent; - const getDimensionsFn = this.getDimensions; - const floatingDimensions = await getDimensionsFn(data.floating); +function fastComponentRef(fn) { + return /* @__PURE__ */ React23.forwardRef(fastComponent(fn)); +} +function createInstance() { return { - reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy), - floating: { - x: 0, - y: 0, - width: floatingDimensions.width, - height: floatingDimensions.height - } + didInitialize: false }; -}; -function isRTL(element) { - return getComputedStyle2(element).direction === "rtl"; } -var platform2 = { - convertOffsetParentRelativeRectToViewportRelativeRect, - getDocumentElement, - getClippingRect, - getOffsetParent, - getElementRects, - getClientRects, - getDimensions, - getScale, - isElement, - isRTL -}; -function rectsAreEqual(a, b) { - return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height; + +// node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/store/useStore.mjs +var canUseRawUseSyncExternalStore = isReactVersionAtLeast(19); +var useStoreImplementation = canUseRawUseSyncExternalStore ? useStoreFast : useStoreLegacy; +function useStore(store2, selector, a1, a2, a3) { + return useStoreImplementation(store2, selector, a1, a2, a3); } -function observeMove(element, onMove, ancestorResize) { - let io = null; - let timeoutId; - const root = getDocumentElement(element); - function cleanup() { - var _io; - clearTimeout(timeoutId); - (_io = io) == null || _io.disconnect(); - io = null; - } - function refresh(skip, threshold) { - if (skip === void 0) { - skip = false; - } - if (threshold === void 0) { - threshold = 1; - } - cleanup(); - const elementRectForRootMargin = element.getBoundingClientRect(); - const { - left, - top, - width, - height - } = elementRectForRootMargin; - if (!skip) { - onMove(); +function useStoreR19(store2, selector, a1, a2, a3) { + const getSelection = React24.useCallback(() => selector(store2.getSnapshot(), a1, a2, a3), [store2, selector, a1, a2, a3]); + return (0, import_shim.useSyncExternalStore)(store2.subscribe, getSelection, getSelection); +} +register({ + before(instance) { + instance.syncIndex = 0; + if (!instance.didInitialize) { + instance.syncTick = 1; + instance.syncHooks = []; + instance.didChangeStore = true; + instance.getSnapshot = () => { + let didChange2 = false; + for (let i = 0; i < instance.syncHooks.length; i += 1) { + const hook = instance.syncHooks[i]; + const value = hook.selector(hook.store.state, hook.a1, hook.a2, hook.a3); + if (!Object.is(hook.value, value)) { + didChange2 = true; + hook.value = value; + } + } + if (didChange2) { + instance.syncTick += 1; + } + return instance.syncTick; + }; } - if (!width || !height) { - return; + }, + after(instance) { + if (instance.syncHooks.length > 0) { + if (instance.didChangeStore) { + instance.didChangeStore = false; + instance.subscribe = (onStoreChange) => { + const stores = /* @__PURE__ */ new Set(); + for (const hook of instance.syncHooks) { + stores.add(hook.store); + } + const unsubscribes = []; + for (const store2 of stores) { + unsubscribes.push(store2.subscribe(onStoreChange)); + } + return () => { + for (const unsubscribe of unsubscribes) { + unsubscribe(); + } + }; + }; + } + (0, import_shim.useSyncExternalStore)(instance.subscribe, instance.getSnapshot, instance.getSnapshot); } - const insetTop = floor(top); - const insetRight = floor(root.clientWidth - (left + width)); - const insetBottom = floor(root.clientHeight - (top + height)); - const insetLeft = floor(left); - const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px"; - const options = { - rootMargin, - threshold: max(0, min(1, threshold)) || 1 + } +}); +function useStoreFast(store2, selector, a1, a2, a3) { + const instance = getInstance(); + if (!instance) { + return useStoreR19(store2, selector, a1, a2, a3); + } + const index2 = instance.syncIndex; + instance.syncIndex += 1; + let hook; + if (!instance.didInitialize) { + hook = { + store: store2, + selector, + a1, + a2, + a3, + value: selector(store2.getSnapshot(), a1, a2, a3) }; - let isFirstUpdate = true; - function handleObserve(entries) { - const ratio = entries[0].intersectionRatio; - if (!rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) { - return refresh(); - } - if (ratio !== threshold) { - if (!isFirstUpdate) { - return refresh(); - } - if (!ratio) { - timeoutId = setTimeout(() => { - refresh(false, 1e-7); - }, 1e3); - } else { - refresh(false, ratio); - } + instance.syncHooks.push(hook); + } else { + hook = instance.syncHooks[index2]; + if (hook.store !== store2 || hook.selector !== selector || !Object.is(hook.a1, a1) || !Object.is(hook.a2, a2) || !Object.is(hook.a3, a3)) { + if (hook.store !== store2) { + instance.didChangeStore = true; } - isFirstUpdate = false; - } - try { - io = new IntersectionObserver(handleObserve, { - ...options, - // Handle