diff --git a/Gruntfile.js b/Gruntfile.js
index b720379a23101..ef82a84128ce9 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -697,7 +697,7 @@ module.exports = function(grunt) {
src: 'vendor/composer/ca-bundle/res/cacert.pem',
dest: SOURCE_DIR + 'wp-includes/certificates/ca-bundle.crt'
},
- // Gutenberg PHP infrastructure files (routes.php, pages.php, constants.php, pages/).
+ // Gutenberg PHP infrastructure files (routes.php, pages.php, constants.php, pages/, core actions, core fields).
'gutenberg-php': {
options: {
process: function( content ) {
@@ -716,6 +716,10 @@ module.exports = function(grunt) {
'pages.php',
'constants.php',
'pages/**/*.php',
+ // The actions Core registers through the entity actions API.
+ 'scripts/core-actions/**/*.php',
+ // The fields Core registers through the entity fields API.
+ 'scripts/core-fields/**/*.php',
],
dest: SOURCE_DIR + 'wp-includes/build/',
} ],
diff --git a/package.json b/package.json
index eb165bda5b0f0..0aa204288908d 100644
--- a/package.json
+++ b/package.json
@@ -7,7 +7,7 @@
"url": "https://develop.svn.wordpress.org/trunk"
},
"gutenberg": {
- "sha": "954fe7f9e04631c41aec4552acd627a7203a2aad",
+ "sha": "e18c3cafbe1dc2f370fdc4cb7a44811766ea177c",
"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 6af5b7d421051..10b34a0b86a83 100644
--- a/src/wp-includes/assets/icon-library-manifest.php
+++ b/src/wp-includes/assets/icon-library-manifest.php
@@ -49,16 +49,18 @@
'label' => _x( 'At Symbol (@)', 'icon label' ),
'filePath' => 'at-symbol.svg',
'collections' => array( 'core' ),
+ 'keywords' => array( _x( 'email', 'icon keyword' ) ),
),
'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' ),
@@ -83,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' ),
@@ -98,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' ),
@@ -109,11 +111,12 @@
'label' => _x( 'Caution', 'icon label' ),
'filePath' => 'caution.svg',
'collections' => array( 'core' ),
+ 'keywords' => array( _x( 'alert', 'icon keyword' ), _x( 'exclamation', 'icon keyword' ), _x( 'warning', 'icon keyword' ) ),
),
'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' ),
@@ -179,6 +182,7 @@
'label' => _x( 'Create', 'icon label' ),
'filePath' => 'create.svg',
'collections' => array( 'core' ),
+ 'keywords' => array( _x( 'add', 'icon keyword' ), _x( 'new', 'icon keyword' ), _x( 'plus', 'icon keyword' ) ),
),
'dashboard' => array(
'label' => _x( 'Dashboard', 'icon label' ),
@@ -208,12 +212,14 @@
'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(
'label' => _x( 'Error', 'icon label' ),
'filePath' => 'error.svg',
'collections' => array( 'core' ),
+ 'keywords' => array( _x( 'alert', 'icon keyword' ), _x( 'caution', 'icon keyword' ), _x( 'exclamation', 'icon keyword' ), _x( 'warning', 'icon keyword' ) ),
),
'external' => array(
'label' => _x( 'External', 'icon label' ),
@@ -224,11 +230,12 @@
'label' => _x( 'File', 'icon label' ),
'filePath' => 'file.svg',
'collections' => array( 'core' ),
+ 'keywords' => array( _x( 'archive', 'icon keyword' ), _x( 'document', 'icon keyword' ), _x( 'folder', 'icon keyword' ) ),
),
'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' ),
@@ -243,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' ),
@@ -253,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' ),
@@ -278,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' ),
@@ -323,12 +330,13 @@
'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' ),
'filePath' => 'pencil.svg',
'collections' => array( 'core', 'core-admin' ),
+ 'keywords' => array( _x( 'edit', 'icon keyword' ) ),
),
'people' => array(
'label' => _x( 'People', 'icon label' ),
@@ -368,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' ),
@@ -403,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' ),
@@ -429,6 +437,7 @@
'label' => _x( 'Star Filled', 'icon label' ),
'filePath' => 'star-filled.svg',
'collections' => array( 'core' ),
+ 'keywords' => array( _x( 'favorite', 'icon keyword' ) ),
),
'star-half' => array(
'label' => _x( 'Star Half', 'icon label' ),
@@ -438,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' ),
@@ -468,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 130c022842931..c5049e6d1ad09 100644
--- a/src/wp-includes/assets/script-loader-packages.php
+++ b/src/wp-includes/assets/script-loader-packages.php
@@ -67,7 +67,7 @@
'wp-url',
'wp-warning'
),
- 'version' => '56da94f1b6ed56573e78'
+ 'version' => '2cd675763a8218c966ec'
),
'block-editor.js' => array(
'dependencies' => array(
@@ -105,7 +105,7 @@
'wp-url',
'wp-warning'
),
- 'version' => '578ad9eb61ae8af0123d'
+ 'version' => 'da6e796949fcb911a90f'
),
'block-library.js' => array(
'dependencies' => array(
@@ -151,7 +151,7 @@
'import' => 'dynamic'
)
),
- 'version' => '0999d15ea60b2ca101bc'
+ 'version' => 'f71a7a01a0cb1ba6e9a1'
),
'block-serialization-default-parser.js' => array(
'dependencies' => array(
@@ -184,7 +184,7 @@
'wp-shortcode',
'wp-warning'
),
- 'version' => 'c453468c6e4fc4dacf25'
+ 'version' => '8e35a0edaf0ac8ebf0fb'
),
'commands.js' => array(
'dependencies' => array(
@@ -201,7 +201,7 @@
'wp-primitives',
'wp-private-apis'
),
- 'version' => '4a4a518ce9c4838666fe'
+ 'version' => 'bfadfc4e96de15d6f689'
),
'components.js' => array(
'dependencies' => array(
@@ -226,11 +226,10 @@
'wp-theme',
'wp-warning'
),
- 'version' => 'fecbc7a454bacff1527c'
+ 'version' => '94fead7ee78ffbb72667'
),
'compose.js' => array(
'dependencies' => array(
- 'react',
'react-jsx-runtime',
'wp-deprecated',
'wp-dom',
@@ -241,7 +240,7 @@
'wp-private-apis',
'wp-undo-manager'
),
- 'version' => '18547cd8d2e6674f7b98'
+ 'version' => '2c882cef80a075bd7c3d'
),
'core-commands.js' => array(
'dependencies' => array(
@@ -258,7 +257,7 @@
'wp-router',
'wp-url'
),
- 'version' => '738a4beca871c27833f1'
+ 'version' => '8839a8b3ea5cc4eb698e'
),
'core-data.js' => array(
'dependencies' => array(
@@ -271,6 +270,7 @@
'wp-data',
'wp-deprecated',
'wp-element',
+ 'wp-hooks',
'wp-html-entities',
'wp-i18n',
'wp-notices',
@@ -278,12 +278,11 @@
'wp-private-apis',
'wp-rich-text',
'wp-style-engine',
- 'wp-sync',
'wp-undo-manager',
'wp-url',
'wp-warning'
),
- 'version' => 'a1d74a5d3b46ac893e05'
+ 'version' => 'd2b82f6369d5503e99bb'
),
'customize-widgets.js' => array(
'dependencies' => array(
@@ -319,7 +318,7 @@
'import' => 'static'
)
),
- 'version' => 'dcab974f036fbee73086'
+ 'version' => '50c2d8139dc39c1e047a'
),
'data.js' => array(
'dependencies' => array(
@@ -347,7 +346,7 @@
'moment',
'wp-deprecated'
),
- 'version' => '8173fc0fc12b7bb7eaf0'
+ 'version' => 'af0f72250d99230696c5'
),
'deprecated.js' => array(
'dependencies' => array(
@@ -359,7 +358,7 @@
'dependencies' => array(
'wp-deprecated'
),
- 'version' => 'd72034b45da1dc03f5fb'
+ 'version' => 'd9b90cd4513d2092fd3c'
),
'dom-ready.js' => array(
'dependencies' => array(
@@ -410,7 +409,7 @@
'import' => 'static'
)
),
- 'version' => 'b4b1fb53ee012caa42fb'
+ 'version' => 'f1cb12c1fd14293aec82'
),
'edit-site.js' => array(
'dependencies' => array(
@@ -450,8 +449,7 @@
'wp-theme',
'wp-url',
'wp-warning',
- 'wp-widgets',
- 'wp-wordcount'
+ 'wp-widgets'
),
'module_dependencies' => array(
array(
@@ -459,7 +457,7 @@
'import' => 'static'
)
),
- 'version' => '1d1116c276ed95618737'
+ 'version' => 'c8492f0430258646a606'
),
'edit-widgets.js' => array(
'dependencies' => array(
@@ -501,7 +499,7 @@
'import' => 'static'
)
),
- 'version' => 'b66dc643708560ba6922'
+ 'version' => '3a5bc43bc625e0f5774a'
),
'editor.js' => array(
'dependencies' => array(
@@ -523,7 +521,6 @@
'wp-deprecated',
'wp-dom',
'wp-element',
- 'wp-escape-html',
'wp-hooks',
'wp-html-entities',
'wp-i18n',
@@ -552,7 +549,7 @@
'import' => 'static'
)
),
- 'version' => '021570d5ceb676201638'
+ 'version' => 'd029bd62a89843653c78'
),
'element.js' => array(
'dependencies' => array(
@@ -560,7 +557,7 @@
'react-dom',
'wp-escape-html'
),
- 'version' => '4822427ad9c627826631'
+ 'version' => '5a4b1aa0e42aad8ef7db'
),
'escape-html.js' => array(
'dependencies' => array(
@@ -594,7 +591,7 @@
'import' => 'dynamic'
)
),
- 'version' => 'f9ce39fe8a3d8aaf2fd6'
+ 'version' => '80364106dc5cdf6f30e0'
),
'hooks.js' => array(
'dependencies' => array(
@@ -627,7 +624,7 @@
'wp-element',
'wp-keycodes'
),
- 'version' => 'ba3985e44a8fdca9462f'
+ 'version' => '2871b9b36c2a9aef74c4'
),
'keycodes.js' => array(
'dependencies' => array(
@@ -662,6 +659,7 @@
'wp-date',
'wp-deprecated',
'wp-element',
+ 'wp-html-entities',
'wp-i18n',
'wp-keycodes',
'wp-notices',
@@ -672,15 +670,26 @@
'wp-url',
'wp-warning'
),
- 'version' => '64a4692e40e4685caccd'
+ 'version' => 'e41aab29ecfcd5067912'
),
'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' => '50f64da182bc1a7417c8'
),
'nux.js' => array(
'dependencies' => array(
@@ -711,7 +720,7 @@
'wp-url',
'wp-warning'
),
- 'version' => 'bb86130c876014c4db11'
+ 'version' => 'ced901bac0e8160bedae'
),
'plugins.js' => array(
'dependencies' => array(
@@ -723,7 +732,7 @@
'wp-is-shallow-equal',
'wp-primitives'
),
- 'version' => 'a03a674fba0130981f2d'
+ 'version' => '4c53884fe0283a7ee4c5'
),
'preferences.js' => array(
'dependencies' => array(
@@ -739,13 +748,13 @@
'wp-primitives',
'wp-private-apis'
),
- 'version' => 'f0a611a312173e6b7648'
+ 'version' => '00228fed7f2d274a78ab'
),
'preferences-persistence.js' => array(
'dependencies' => array(
'wp-api-fetch'
),
- 'version' => 'a34abbdacd8f50f9acb1'
+ 'version' => '63049460a74cb385aa0a'
),
'primitives.js' => array(
'dependencies' => array(
@@ -764,7 +773,7 @@
'dependencies' => array(
),
- 'version' => 'df3615fd5cb379fb7ffe'
+ 'version' => '81dd8f4c0e768e396025'
),
'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' => '83e806a0634df6b93530'
+ 'version' => '93e0b8da5b06ea5406ab'
),
'shortcode.js' => array(
'dependencies' => array(
@@ -836,15 +845,7 @@
'dependencies' => array(
),
- 'version' => '914befb08774033e6265'
- ),
- 'sync.js' => array(
- 'dependencies' => array(
- 'wp-api-fetch',
- 'wp-hooks',
- 'wp-private-apis'
- ),
- 'version' => '7179e38284ff7aba21e6'
+ 'version' => '6500509f32193fe14392'
),
'theme.js' => array(
'dependencies' => array(
@@ -854,7 +855,7 @@
'wp-element',
'wp-private-apis'
),
- 'version' => '795a74a11c336f95159b'
+ 'version' => '21b0c3318f26c7b3d71e'
),
'token-list.js' => array(
'dependencies' => array(
@@ -876,8 +877,7 @@
'wp-data',
'wp-element',
'wp-i18n',
- 'wp-private-apis',
- 'wp-url'
+ 'wp-private-apis'
),
'module_dependencies' => array(
array(
@@ -889,13 +889,13 @@
'import' => 'dynamic'
)
),
- 'version' => '86068d5116da27ca40a5'
+ 'version' => '4bd74c9d859a5ffe1e31'
),
'url.js' => array(
'dependencies' => array(
),
- 'version' => '65e1ab123ef3bf825dea'
+ 'version' => '3c0d9743cc6cd9591281'
),
'viewport.js' => array(
'dependencies' => array(
@@ -913,7 +913,10 @@
),
'widgets.js' => array(
'dependencies' => array(
+ 'react',
+ 'react-dom',
'react-jsx-runtime',
+ 'wp-a11y',
'wp-api-fetch',
'wp-block-editor',
'wp-blocks',
@@ -924,9 +927,12 @@
'wp-element',
'wp-i18n',
'wp-notices',
- 'wp-primitives'
+ 'wp-primitives',
+ 'wp-private-apis',
+ 'wp-theme',
+ 'wp-warning'
),
- 'version' => 'f2802a2d8ac37b86bc43'
+ '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 b000cd3d852b6..fc801f0ae0590 100644
--- a/src/wp-includes/assets/script-modules-packages.php
+++ b/src/wp-includes/assets/script-modules-packages.php
@@ -10,7 +10,7 @@
'wp-data',
'wp-i18n'
),
- 'version' => 'e5fcd7e304ead0fc9779'
+ 'version' => '9448bb3053516a39086d'
),
'block-editor/utils/fit-text-frontend.js' => array(
'dependencies' => array(
@@ -36,6 +36,18 @@
),
'version' => '6d4bb8df9c7539843ad3'
),
+ 'block-library/cover/view.js' => array(
+ 'dependencies' => array(
+
+ ),
+ 'module_dependencies' => array(
+ array(
+ 'id' => '@wordpress/interactivity',
+ 'import' => 'static'
+ )
+ ),
+ 'version' => 'ef26735bd1dbc6c830a0'
+ ),
'block-library/file/view.js' => array(
'dependencies' => array(
@@ -58,7 +70,7 @@
'import' => 'static'
)
),
- 'version' => '25ee935fd6c67371d0f3'
+ 'version' => 'b5457389a410156f7ef6'
),
'block-library/navigation/view.js' => array(
'dependencies' => array(
@@ -82,7 +94,7 @@
'import' => 'static'
)
),
- 'version' => 'fde7e3309a48521aed56'
+ 'version' => 'dcead465d87ec21eea99'
),
'block-library/query/view.js' => array(
'dependencies' => array(
@@ -124,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',
@@ -162,7 +186,7 @@
'import' => 'static'
)
),
- 'version' => 'f6c3c0c637fe0ed2dbd2'
+ 'version' => 'd8489a9113a214b5278c'
),
'connectors/index.js' => array(
'dependencies' => array(
@@ -188,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' => 'af71ae1624cb6d030f74'
+ ),
+ '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',
@@ -219,13 +459,13 @@
'import' => 'static'
)
),
- 'version' => '9e49b9edcfc16dc5203c'
+ 'version' => '4b2e3230d57e16afb0ad'
),
'interactivity/index.js' => array(
'dependencies' => array(
),
- 'version' => 'b0929e0bd08daccaa778'
+ 'version' => '38309185015c9ca20405'
),
'interactivity-router/full-page.js' => array(
'dependencies' => array(
@@ -253,13 +493,13 @@
'import' => 'static'
)
),
- 'version' => '711aa380e66c57009b7a'
+ 'version' => '3ee11de34faed693e7a5'
),
'latex-to-mathml/index.js' => array(
'dependencies' => array(
),
- 'version' => '662cb0e7f68d2a21cd68'
+ 'version' => '4ec5f96f5cf884f76516'
),
'latex-to-mathml/loader.js' => array(
'dependencies' => array(
@@ -287,7 +527,7 @@
'wp-private-apis',
'wp-style-engine'
),
- 'version' => 'e50dce77f58e6e3ffa9b'
+ 'version' => 'b1449ad638987b6a4b90'
),
'route/index.js' => array(
'dependencies' => array(
@@ -314,7 +554,7 @@
'dependencies' => array(
),
- 'version' => '4d3627c45251ceb4f9a2'
+ 'version' => 'fa777d9ac60940d2e501'
),
'vips/loader.js' => array(
'dependencies' => array(
@@ -332,14 +572,14 @@
'dependencies' => array(
),
- 'version' => '7e33cd8c4128731126e8'
+ 'version' => '4aef10eaf28026b90482'
),
'widget-primitives/index.js' => array(
'dependencies' => array(
'react-jsx-runtime',
'wp-element'
),
- 'version' => '3047de39283129372300'
+ 'version' => '355066e7b5d458a5968d'
),
'workflow/index.js' => array(
'dependencies' => array(
@@ -350,6 +590,7 @@
'wp-compose',
'wp-data',
'wp-element',
+ 'wp-html-entities',
'wp-i18n',
'wp-keyboard-shortcuts',
'wp-keycodes',
@@ -372,6 +613,6 @@
'import' => 'dynamic'
)
),
- 'version' => '02fa947b818b1e4c07fd'
+ '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 8f51644120d41..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
@@ -45,6 +48,7 @@
"letterSpacing"
],
"fontSize": true,
+ "lineHeight": true,
"__experimentalFontFamily": true,
"__experimentalFontWeight": true,
"__experimentalFontStyle": true,
diff --git a/src/wp-includes/blocks/archives/block.json b/src/wp-includes/blocks/archives/block.json
index 7455b558c0d18..b0063dd06663b 100644
--- a/src/wp-includes/blocks/archives/block.json
+++ b/src/wp-includes/blocks/archives/block.json
@@ -42,6 +42,9 @@
"gradient": true
}
},
+ "dimensions": {
+ "minHeight": true
+ },
"html": false,
"spacing": {
"margin": true,
diff --git a/src/wp-includes/blocks/avatar.php b/src/wp-includes/blocks/avatar.php
index 196d67a4d480c..c257175432685 100644
--- a/src/wp-includes/blocks/avatar.php
+++ b/src/wp-includes/blocks/avatar.php
@@ -19,6 +19,7 @@ function render_block_core_avatar( $attributes, $content, $block ) {
$size = $attributes['size'] ?? 96;
$wrapper_attributes = get_block_wrapper_attributes();
$border_attributes = get_block_core_avatar_border_attributes( $attributes );
+ $shadow_styles = wp_style_engine_get_styles( array( 'shadow' => $attributes['style']['shadow'] ?? null ) );
// Class gets passed through `esc_attr` via `get_avatar`.
$image_classes = ! empty( $border_attributes['class'] )
@@ -26,10 +27,11 @@ function render_block_core_avatar( $attributes, $content, $block ) {
: 'wp-block-avatar__image';
// Unlike class, `get_avatar` doesn't filter the styles via `esc_attr`.
- // The style engine does pass the border styles through
+ // The style engine does pass the border and shadow styles through
// `safecss_filter_attr` however.
- $image_styles = ! empty( $border_attributes['style'] )
- ? sprintf( ' style="%s"', esc_attr( $border_attributes['style'] ) )
+ $image_css = ( $border_attributes['style'] ?? '' ) . ( $shadow_styles['css'] ?? '' );
+ $image_styles = ! empty( $image_css )
+ ? sprintf( ' style="%s"', esc_attr( $image_css ) )
: '';
if ( ! isset( $block->context['commentId'] ) ) {
diff --git a/src/wp-includes/blocks/avatar/block.json b/src/wp-includes/blocks/avatar/block.json
index 0cb92d81865c7..7d8b2ddee1f10 100644
--- a/src/wp-includes/blocks/avatar/block.json
+++ b/src/wp-includes/blocks/avatar/block.json
@@ -54,12 +54,16 @@
"filter": {
"duotone": true
},
+ "shadow": {
+ "__experimentalSkipSerialization": true
+ },
"interactivity": {
"clientNavigation": true
}
},
"selectors": {
"border": ".wp-block-avatar img",
+ "shadow": ".wp-block-avatar img",
"filter": {
"duotone": ".wp-block-avatar img"
}
diff --git a/src/wp-includes/blocks/blocks-json.php b/src/wp-includes/blocks/blocks-json.php
index 73e0bebb8fb78..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
@@ -152,6 +155,7 @@
'letterSpacing'
),
'fontSize' => true,
+ 'lineHeight' => true,
'__experimentalFontFamily' => true,
'__experimentalFontWeight' => true,
'__experimentalFontStyle' => true,
@@ -414,6 +418,9 @@
'gradient' => true
)
),
+ 'dimensions' => array(
+ 'minHeight' => true
+ ),
'html' => false,
'spacing' => array(
'margin' => true,
@@ -591,12 +598,16 @@
'filter' => array(
'duotone' => true
),
+ 'shadow' => array(
+ '__experimentalSkipSerialization' => true
+ ),
'interactivity' => array(
'clientNavigation' => true
)
),
'selectors' => array(
'border' => '.wp-block-avatar img',
+ 'shadow' => '.wp-block-avatar img',
'filter' => array(
'duotone' => '.wp-block-avatar img'
)
@@ -808,6 +819,12 @@
'splitting' => true,
'align' => false,
'alignWide' => false,
+ 'background' => array(
+ 'backgroundImage' => true,
+ 'backgroundSize' => true,
+ 'gradient' => true,
+ '__experimentalSkipSerialization' => true
+ ),
'color' => array(
'__experimentalSkipSerialization' => true,
'gradients' => true,
@@ -971,6 +988,10 @@
'fontSize' => true
)
),
+ 'dimensions' => array(
+ 'minHeight' => true,
+ 'minWidth' => true
+ ),
'__experimentalBorder' => array(
'color' => true,
'radius' => true,
@@ -994,7 +1015,8 @@
'clientNavigation' => true
),
'listView' => true,
- 'contentRole' => true
+ 'contentRole' => true,
+ 'shadow' => true
),
'editorStyle' => 'wp-block-buttons-editor',
'style' => 'wp-block-buttons'
@@ -1196,6 +1218,10 @@
'gradient' => true
)
),
+ 'dimensions' => array(
+ 'minHeight' => true,
+ 'minWidth' => true
+ ),
'typography' => array(
'fontSize' => true,
'lineHeight' => true,
@@ -1400,6 +1426,10 @@
'gradient' => true
)
),
+ 'dimensions' => array(
+ 'minHeight' => true,
+ 'minWidth' => true
+ ),
'spacing' => array(
'blockGap' => array(
'__experimentalDefault' => '2em',
@@ -1995,6 +2025,11 @@
'type' => 'flex'
)
),
+ 'spacing' => array(
+ 'padding' => true,
+ 'margin' => true,
+ 'blockGap' => true
+ ),
'typography' => array(
'fontSize' => true,
'lineHeight' => true,
@@ -2008,6 +2043,12 @@
'fontSize' => true
)
),
+ '__experimentalBorder' => array(
+ 'color' => true,
+ 'radius' => true,
+ 'style' => true,
+ 'width' => true
+ ),
'interactivity' => array(
'clientNavigation' => true
)
@@ -2064,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',
@@ -2172,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',
@@ -2398,6 +2465,8 @@
'color' => array(
'heading' => true,
'text' => true,
+ 'link' => true,
+ 'button' => true,
'background' => false,
'__experimentalSkipSerialization' => array(
'gradients'
@@ -2405,7 +2474,8 @@
'enableContrastChecker' => false
),
'dimensions' => array(
- 'aspectRatio' => true
+ 'aspectRatio' => true,
+ 'minWidth' => true
),
'typography' => array(
'fontSize' => true,
@@ -2424,7 +2494,8 @@
'allowJustification' => false
),
'interactivity' => array(
- 'clientNavigation' => true
+ 'clientNavigation' => true,
+ 'interactive' => true
),
'filter' => array(
'duotone' => true
@@ -2515,6 +2586,9 @@
'padding' => false
)
),
+ 'dimensions' => array(
+ 'minWidth' => true
+ ),
'typography' => array(
'fontSize' => true,
'lineHeight' => true,
@@ -2584,8 +2658,13 @@
'supports' => array(
'anchor' => true,
'align' => true,
+ 'dimensions' => array(
+ 'minHeight' => true,
+ 'minWidth' => true
+ ),
'spacing' => array(
- 'margin' => true
+ 'margin' => true,
+ 'padding' => true
),
'interactivity' => array(
'clientNavigation' => true
@@ -2678,6 +2757,10 @@
'margin' => true,
'padding' => true
),
+ 'dimensions' => array(
+ 'minHeight' => true,
+ 'minWidth' => true
+ ),
'color' => array(
'gradients' => true,
'link' => true,
@@ -2699,6 +2782,20 @@
'style' => true
)
),
+ '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',
@@ -2764,6 +2861,10 @@
'padding' => false
)
),
+ 'dimensions' => array(
+ 'minHeight' => true,
+ 'minWidth' => true
+ ),
'typography' => array(
'fontSize' => true,
'lineHeight' => true,
@@ -3005,6 +3106,11 @@
'background' => true,
'gradients' => true
),
+ 'shadow' => true,
+ 'dimensions' => array(
+ 'minHeight' => true,
+ 'minWidth' => true
+ ),
'layout' => array(
'allowSwitching' => false,
'allowInheriting' => false,
@@ -3018,11 +3124,19 @@
'type' => 'flex'
)
),
+ 'filter' => array(
+ 'duotone' => true
+ ),
'interactivity' => array(
'clientNavigation' => true
),
'listView' => true
),
+ 'selectors' => array(
+ 'filter' => array(
+ 'duotone' => '.wp-block-gallery :where(img)'
+ )
+ ),
'editorStyle' => 'wp-block-gallery-editor',
'style' => 'wp-block-gallery'
),
@@ -3186,6 +3300,7 @@
'className' => true,
'splitting' => true,
'background' => array(
+ 'backgroundClip' => true,
'backgroundImage' => true,
'backgroundSize' => true,
'gradient' => true,
@@ -3208,6 +3323,10 @@
'text' => true
)
),
+ 'dimensions' => array(
+ 'minHeight' => true,
+ 'minWidth' => true
+ ),
'shadow' => true,
'spacing' => array(
'margin' => true,
@@ -3221,6 +3340,7 @@
'fontSize' => true,
'lineHeight' => true,
'textAlign' => true,
+ 'textIndent' => true,
'__experimentalFontFamily' => true,
'__experimentalFontStyle' => true,
'__experimentalFontWeight' => true,
@@ -3299,6 +3419,10 @@
)
),
'shadow' => true,
+ 'dimensions' => array(
+ 'minHeight' => true,
+ 'minWidth' => true
+ ),
'__experimentalBorder' => array(
'color' => true,
'radius' => true,
@@ -3311,6 +3435,14 @@
'width' => false
)
),
+ 'spacing' => array(
+ 'margin' => true,
+ 'padding' => true,
+ '__experimentalDefaultControls' => array(
+ 'margin' => false,
+ 'padding' => false
+ )
+ ),
'interactivity' => array(
'clientNavigation' => true
)
@@ -3388,6 +3520,12 @@
'center',
'right'
),
+ 'background' => array(
+ 'backgroundImage' => true,
+ 'backgroundSize' => true,
+ 'gradient' => true,
+ '__experimentalSkipSerialization' => true
+ ),
'html' => false,
'color' => array(
'__experimentalSkipSerialization' => true,
@@ -3399,6 +3537,9 @@
'interactivity' => array(
'clientNavigation' => true
),
+ 'shadow' => array(
+ '__experimentalSkipSerialization' => true
+ ),
'__experimentalBorder' => array(
'color' => true,
'radius' => true,
@@ -3425,8 +3566,12 @@
),
'dimensions' => array(
'width' => true,
+ 'minWidth' => true,
+ 'minHeight' => true,
'__experimentalSkipSerialization' => array(
- 'width'
+ 'width',
+ 'minWidth',
+ 'minHeight'
),
'__experimentalDefaultControls' => array(
'width' => true
@@ -3436,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'
)
@@ -3674,11 +3820,21 @@
'link' => true
)
),
+ 'dimensions' => array(
+ 'minHeight' => true,
+ 'minWidth' => true
+ ),
'html' => false,
'spacing' => array(
'margin' => true,
'padding' => true
),
+ '__experimentalBorder' => array(
+ 'color' => true,
+ 'radius' => true,
+ 'style' => true,
+ 'width' => true
+ ),
'shadow' => true,
'typography' => array(
'fontSize' => true,
@@ -3804,6 +3960,10 @@
'link' => true
)
),
+ 'dimensions' => array(
+ 'minHeight' => true,
+ 'minWidth' => true
+ ),
'spacing' => array(
'margin' => true,
'padding' => true,
@@ -3945,6 +4105,15 @@
'fontSize' => true
)
),
+ 'background' => array(
+ 'backgroundImage' => true,
+ 'backgroundSize' => true,
+ 'gradient' => true,
+ '__experimentalDefaultControls' => array(
+ 'backgroundImage' => true,
+ 'gradient' => true
+ )
+ ),
'color' => array(
'gradients' => true,
'link' => true,
@@ -3953,6 +4122,10 @@
'text' => true
)
),
+ 'dimensions' => array(
+ 'minHeight' => true,
+ 'minWidth' => true
+ ),
'spacing' => array(
'margin' => true,
'padding' => true,
@@ -3961,6 +4134,7 @@
'padding' => false
)
),
+ 'shadow' => true,
'__unstablePasteTextInline' => true,
'__experimentalOnMerge' => true,
'__experimentalSlashInserter' => true,
@@ -3970,7 +4144,9 @@
'listView' => true
),
'selectors' => array(
- 'border' => '.wp-block-list:not(.wp-block-list .wp-block-list)'
+ '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',
'style' => 'wp-block-list'
@@ -4005,6 +4181,11 @@
'html' => false,
'className' => false,
'splitting' => true,
+ 'background' => array(
+ 'backgroundImage' => true,
+ 'backgroundSize' => true,
+ 'gradient' => true
+ ),
'__experimentalBorder' => array(
'color' => true,
'radius' => true,
@@ -4027,6 +4208,7 @@
'padding' => false
)
),
+ 'shadow' => true,
'typography' => array(
'fontSize' => true,
'lineHeight' => true,
@@ -4046,7 +4228,8 @@
),
'selectors' => array(
'root' => '.wp-block-list > li',
- 'border' => '.wp-block-list:not(.wp-block-list .wp-block-list) > li'
+ 'border' => '.wp-block-list:not(.wp-block-list .wp-block-list) > li',
+ 'shadow' => '.wp-block-list:not(.wp-block-list .wp-block-list) > li'
)
),
'loginout' => array(
@@ -4093,6 +4276,10 @@
'gradients' => true,
'link' => true
),
+ 'dimensions' => array(
+ 'minHeight' => true,
+ 'minWidth' => true
+ ),
'spacing' => array(
'margin' => true,
'padding' => true,
@@ -4123,7 +4310,8 @@
'shadow' => true,
'interactivity' => array(
'clientNavigation' => true
- )
+ ),
+ 'contentRole' => true
),
'style' => 'wp-block-loginout'
),
@@ -4166,6 +4354,10 @@
'text' => true
)
),
+ 'dimensions' => array(
+ 'minHeight' => true,
+ 'minWidth' => true
+ ),
'shadow' => true,
'spacing' => array(
'margin' => true,
@@ -4310,6 +4502,11 @@
'full'
),
'html' => false,
+ 'background' => array(
+ 'backgroundImage' => true,
+ 'backgroundSize' => true,
+ 'gradient' => true
+ ),
'__experimentalBorder' => array(
'color' => true,
'radius' => true,
@@ -4332,10 +4529,15 @@
'text' => true
)
),
+ 'dimensions' => array(
+ 'minHeight' => true,
+ 'minWidth' => true
+ ),
'spacing' => array(
'margin' => true,
'padding' => true
),
+ 'shadow' => true,
'typography' => array(
'fontSize' => true,
'lineHeight' => true,
@@ -4349,11 +4551,19 @@
'fontSize' => true
)
),
+ 'filter' => array(
+ 'duotone' => true
+ ),
'interactivity' => array(
'clientNavigation' => true
),
'allowedBlocks' => true
),
+ 'selectors' => array(
+ 'filter' => array(
+ 'duotone' => '.wp-block-media-text > .wp-block-media-text__media img, .wp-block-media-text > .wp-block-media-text__media video'
+ )
+ ),
'editorStyle' => 'wp-block-media-text-editor',
'style' => 'wp-block-media-text'
),
@@ -4741,6 +4951,10 @@
)
),
'shadow' => true,
+ 'dimensions' => array(
+ 'minHeight' => true,
+ 'minWidth' => true
+ ),
'__experimentalBorder' => array(
'color' => true,
'radius' => true,
@@ -4749,6 +4963,7 @@
),
'spacing' => array(
'padding' => true,
+ 'margin' => true,
'__experimentalDefaultControls' => array(
'padding' => true
)
@@ -4989,6 +5204,10 @@
)
),
'shadow' => true,
+ 'dimensions' => array(
+ 'minHeight' => true,
+ 'minWidth' => true
+ ),
'contentRole' => true
),
'editorStyle' => 'wp-block-page-list-editor',
@@ -5098,12 +5317,19 @@
'splitting' => true,
'anchor' => true,
'className' => false,
+ 'background' => array(
+ 'backgroundClip' => true,
+ 'backgroundImage' => true,
+ 'backgroundSize' => true,
+ 'gradient' => true
+ ),
'__experimentalBorder' => array(
'color' => true,
'radius' => true,
'style' => true,
'width' => true
),
+ 'shadow' => true,
'color' => array(
'gradients' => true,
'link' => true,
@@ -5112,6 +5338,10 @@
'text' => true
)
),
+ 'dimensions' => array(
+ 'minHeight' => true,
+ 'minWidth' => true
+ ),
'spacing' => array(
'margin' => true,
'padding' => true,
@@ -5260,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,
@@ -5278,6 +5517,10 @@
'width' => true
)
),
+ 'dimensions' => array(
+ 'minHeight' => true,
+ 'minWidth' => true
+ ),
'interactivity' => true,
'shadow' => true,
'spacing' => array(
@@ -5499,6 +5742,7 @@
'lineHeight' => true,
'textAlign' => true,
'textColumns' => true,
+ 'textIndent' => true,
'__experimentalFontFamily' => true,
'__experimentalFontWeight' => true,
'__experimentalFontStyle' => true,
@@ -5698,6 +5942,10 @@
'text' => true
)
),
+ 'dimensions' => array(
+ 'minHeight' => true,
+ 'minWidth' => true
+ ),
'spacing' => array(
'margin' => true,
'padding' => true
@@ -5706,6 +5954,7 @@
'fontSize' => true,
'lineHeight' => true,
'textAlign' => true,
+ '__experimentalFontFamily' => true,
'__experimentalFontStyle' => true,
'__experimentalFontWeight' => true,
'__experimentalLetterSpacing' => true,
@@ -5844,7 +6093,8 @@
)
),
'dimensions' => array(
- 'minHeight' => true
+ 'minHeight' => true,
+ 'minWidth' => true
),
'shadow' => true,
'spacing' => array(
@@ -6031,6 +6281,10 @@
'margin' => true,
'padding' => true
),
+ 'dimensions' => array(
+ 'minHeight' => true,
+ 'minWidth' => true
+ ),
'typography' => array(
'fontSize' => true,
'lineHeight' => true,
@@ -6151,6 +6405,7 @@
'__experimentalBorder' => array(
'color' => true,
'radius' => true,
+ 'style' => true,
'width' => true,
'__experimentalSkipSerialization' => true,
'__experimentalDefaultControls' => array(
@@ -6226,6 +6481,12 @@
'anchor' => true,
'reusable' => false,
'html' => false,
+ 'background' => array(
+ '__experimentalSkipSerialization' => true,
+ 'backgroundImage' => true,
+ 'backgroundSize' => true,
+ 'gradient' => true
+ ),
'color' => array(
'link' => true
),
@@ -6250,6 +6511,11 @@
'interactivity' => array(
'clientNavigation' => true
),
+ 'dimensions' => array(
+ '__experimentalSkipSerialization' => true,
+ 'minHeight' => true,
+ 'minWidth' => true
+ ),
'spacing' => array(
'__experimentalSkipSerialization' => true,
'margin' => true,
@@ -6274,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)'
),
@@ -6354,6 +6622,10 @@
'margin' => false
)
),
+ 'dimensions' => array(
+ 'minHeight' => true,
+ 'minWidth' => true
+ ),
'interactivity' => array(
'clientNavigation' => true
),
@@ -6419,6 +6691,10 @@
'link' => true
)
),
+ 'dimensions' => array(
+ 'minHeight' => true,
+ 'minWidth' => true
+ ),
'shadow' => true,
'spacing' => array(
'margin' => true,
@@ -6496,6 +6772,10 @@
'text' => true
)
),
+ 'dimensions' => array(
+ 'minHeight' => true,
+ 'minWidth' => true
+ ),
'html' => false,
'shadow' => true,
'spacing' => array(
@@ -6600,6 +6880,10 @@
'link' => true
)
),
+ 'dimensions' => array(
+ 'minHeight' => true,
+ 'minWidth' => true
+ ),
'shadow' => true,
'spacing' => array(
'margin' => true,
@@ -6615,6 +6899,7 @@
'__experimentalTextTransform' => true,
'__experimentalTextDecoration' => true,
'__experimentalLetterSpacing' => true,
+ 'fitText' => true,
'__experimentalDefaultControls' => array(
'fontSize' => true
)
@@ -6669,6 +6954,10 @@
'text' => true
)
),
+ 'dimensions' => array(
+ 'minHeight' => true,
+ 'minWidth' => true
+ ),
'shadow' => true,
'spacing' => array(
'padding' => true,
@@ -6754,7 +7043,8 @@
)
),
'dimensions' => array(
- 'minHeight' => true
+ 'minHeight' => true,
+ 'minWidth' => true
),
'shadow' => true,
'spacing' => array(
@@ -6765,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
)
@@ -6913,6 +7205,10 @@
'heading' => true,
'button' => true
),
+ 'dimensions' => array(
+ 'minHeight' => true,
+ 'minWidth' => true
+ ),
'spacing' => array(
'padding' => true,
'margin' => true,
@@ -6998,6 +7294,11 @@
'link' => true
)
),
+ 'spacing' => array(
+ 'padding' => true,
+ 'margin' => true,
+ 'blockGap' => true
+ ),
'layout' => array(
'allowSwitching' => false,
'allowInheriting' => false,
@@ -7018,6 +7319,18 @@
'fontSize' => true
)
),
+ '__experimentalBorder' => array(
+ 'color' => true,
+ 'radius' => true,
+ 'style' => true,
+ 'width' => true,
+ '__experimentalDefaultControls' => array(
+ 'color' => false,
+ 'radius' => false,
+ 'style' => false,
+ 'width' => false
+ )
+ ),
'interactivity' => array(
'clientNavigation' => true
)
@@ -7316,6 +7629,10 @@
'margin' => true,
'padding' => true
),
+ 'dimensions' => array(
+ 'minHeight' => true,
+ 'minWidth' => true
+ ),
'color' => array(
'gradients' => true,
'__experimentalDefaultControls' => array(
@@ -7418,6 +7735,7 @@
),
'dimensions' => array(
'minHeight' => true,
+ 'minWidth' => true,
'__experimentalDefaultControls' => array(
'minHeight' => false
)
@@ -7433,6 +7751,7 @@
'__experimentalTextTransform' => true,
'__experimentalTextDecoration' => true,
'__experimentalLetterSpacing' => true,
+ '__experimentalWritingMode' => true,
'__experimentalDefaultControls' => array(
'fontSize' => true
)
@@ -7441,6 +7760,7 @@
'gradients' => true,
'heading' => true,
'link' => true,
+ 'button' => true,
'__experimentalDefaultControls' => array(
'background' => true,
'text' => true
@@ -7521,6 +7841,10 @@
'textDecoration' => true
)
),
+ 'dimensions' => array(
+ 'minHeight' => true,
+ 'minWidth' => true
+ ),
'spacing' => array(
'margin' => array(
'top',
@@ -7534,6 +7858,7 @@
'__experimentalBorder' => array(
'color' => true,
'radius' => true,
+ 'style' => true,
'width' => true,
'__experimentalDefaultControls' => array(
'width' => true
@@ -7621,6 +7946,10 @@
'margin' => false
)
),
+ 'dimensions' => array(
+ 'minHeight' => true,
+ 'minWidth' => true
+ ),
'shadow' => true,
'background' => array(
'backgroundImage' => true,
@@ -7698,6 +8027,10 @@
'center',
'right'
),
+ 'background' => array(
+ 'gradient' => true,
+ '__experimentalSkipSerialization' => true
+ ),
'color' => array(
'gradients' => true,
'__experimentalSkipSerialization' => true,
@@ -7725,6 +8058,7 @@
'__experimentalBorder' => array(
'color' => true,
'radius' => true,
+ 'style' => true,
'width' => true,
'__experimentalSkipSerialization' => true,
'__experimentalDefaultControls' => array(
@@ -7733,8 +8067,17 @@
'width' => true
)
),
+ 'shadow' => array(
+ '__experimentalSkipSerialization' => true
+ ),
+ 'dimensions' => array(
+ 'minHeight' => true,
+ 'minWidth' => true,
+ '__experimentalSkipSerialization' => true
+ ),
'spacing' => array(
- 'margin' => true
+ 'margin' => true,
+ 'padding' => true
),
'html' => false
),
@@ -7742,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(
@@ -7976,6 +8322,10 @@
)
),
'contentRole' => true,
+ 'dimensions' => array(
+ 'minHeight' => true,
+ 'minWidth' => true
+ ),
'spacing' => array(
'margin' => true,
'padding' => true,
@@ -8074,6 +8424,10 @@
'link' => true
)
),
+ 'dimensions' => array(
+ 'minHeight' => true,
+ 'minWidth' => true
+ ),
'spacing' => array(
'padding' => true,
'margin' => true,
@@ -8274,6 +8628,7 @@
'style' => true
)
),
+ 'shadow' => true,
'contentRole' => true,
'listView' => true
),
@@ -8369,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,
@@ -8380,7 +8741,11 @@
),
'typography' => array(
'fontSize' => true,
- '__experimentalFontFamily' => true
+ 'lineHeight' => true,
+ '__experimentalFontFamily' => true,
+ '__experimentalFontWeight' => true,
+ '__experimentalTextTransform' => true,
+ '__experimentalLetterSpacing' => true
),
'__experimentalBorder' => array(
'color' => true,
@@ -8408,10 +8773,15 @@
'padding' => true,
'blockGap' => true
)
+ ),
+ 'shadow' => array(
+ '__experimentalSkipSerialization' => true
)
),
'selectors' => array(
+ 'background' => '.wp-block-tab-list button',
'border' => '.wp-block-tab-list button',
+ 'shadow' => '.wp-block-tab-list button',
'color' => array(
'background' => '.wp-block-tab-list button',
'text' => '.wp-block-tab-list button'
@@ -8541,6 +8911,9 @@
'spacing' => array(
'padding' => true
),
+ 'dimensions' => array(
+ 'minHeight' => true
+ ),
'typography' => array(
'fontSize' => true,
'lineHeight' => true,
@@ -8732,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
@@ -8749,6 +9131,9 @@
)
),
'typography' => array(
+ '__experimentalSkipSerialization' => array(
+ 'textAlign'
+ ),
'fontSize' => true,
'lineHeight' => true,
'__experimentalFontFamily' => true,
@@ -8757,6 +9142,7 @@
'__experimentalLetterSpacing' => true,
'__experimentalTextTransform' => true,
'__experimentalTextDecoration' => true,
+ 'textAlign' => true,
'__experimentalDefaultControls' => array(
'fontSize' => true
)
@@ -8854,6 +9240,9 @@
'margin' => true,
'padding' => true
),
+ 'dimensions' => array(
+ 'minWidth' => true
+ ),
'shadow' => true,
'typography' => array(
'fontSize' => true,
@@ -9010,7 +9399,8 @@
'textdomain' => 'default',
'usesContext' => array(
'termId',
- 'taxonomy'
+ 'taxonomy',
+ 'termData'
),
'attributes' => array(
'bracketType' => array(
@@ -9042,8 +9432,13 @@
),
'shadow' => true,
'spacing' => array(
+ 'margin' => true,
'padding' => true
),
+ 'dimensions' => array(
+ 'minHeight' => true,
+ 'minWidth' => true
+ ),
'typography' => array(
'fontSize' => true,
'lineHeight' => true,
@@ -9109,6 +9504,10 @@
'text' => true
)
),
+ 'dimensions' => array(
+ 'minHeight' => true,
+ 'minWidth' => true
+ ),
'spacing' => array(
'padding' => true,
'margin' => true
@@ -9198,9 +9597,14 @@
'link' => true
)
),
+ 'dimensions' => array(
+ 'minHeight' => true,
+ 'minWidth' => true
+ ),
'shadow' => true,
'spacing' => array(
- 'padding' => true
+ 'padding' => true,
+ 'margin' => true
),
'typography' => array(
'fontSize' => true,
@@ -9267,6 +9671,8 @@
'color' => array(
'gradients' => true,
'link' => true,
+ 'heading' => true,
+ 'button' => true,
'__experimentalDefaultControls' => array(
'background' => true,
'text' => true
@@ -9285,6 +9691,10 @@
'fontSize' => true
)
),
+ 'dimensions' => array(
+ 'minHeight' => true,
+ 'minWidth' => true
+ ),
'spacing' => array(
'margin' => true,
'padding' => true,
@@ -9361,6 +9771,11 @@
),
'html' => false,
'layout' => true,
+ 'spacing' => array(
+ 'padding' => true,
+ 'margin' => true,
+ 'blockGap' => true
+ ),
'interactivity' => true
)
),
@@ -9456,6 +9871,7 @@
),
'dimensions' => array(
'minHeight' => true,
+ 'minWidth' => true,
'__experimentalDefaultControls' => array(
'minHeight' => false
)
@@ -9465,12 +9881,15 @@
'__experimentalFontFamily' => true,
'lineHeight' => true,
'textAlign' => true,
+ 'textColumns' => true,
+ 'textIndent' => true,
'__experimentalFontStyle' => true,
'__experimentalFontWeight' => true,
'__experimentalLetterSpacing' => true,
'__experimentalTextTransform' => true,
'__experimentalTextDecoration' => true,
'__experimentalWritingMode' => true,
+ 'fitText' => true,
'__experimentalDefaultControls' => array(
'fontSize' => true
)
@@ -9594,6 +10013,9 @@
'supports' => array(
'anchor' => true,
'align' => true,
+ 'filter' => array(
+ 'duotone' => true
+ ),
'spacing' => array(
'margin' => true,
'padding' => true,
@@ -9603,14 +10025,24 @@
)
),
'interactivity' => array(
- 'clientNavigation' => true
+ 'clientNavigation' => true,
+ 'interactive' => true
),
'shadow' => array(
'__experimentalSkipSerialization' => true
+ ),
+ 'dimensions' => array(
+ 'minWidth' => true,
+ 'minHeight' => true,
+ '__experimentalSkipSerialization' => true
)
),
'selectors' => array(
- 'shadow' => '.wp-block-video video'
+ 'dimensions' => '.wp-block-video video',
+ 'shadow' => '.wp-block-video video',
+ 'filter' => array(
+ 'duotone' => '.wp-block-video video'
+ )
),
'editorStyle' => 'wp-block-video-editor',
'style' => 'wp-block-video'
diff --git a/src/wp-includes/blocks/breadcrumbs.php b/src/wp-includes/blocks/breadcrumbs.php
index 02c038dd057ea..b659afd8259b1 100644
--- a/src/wp-includes/blocks/breadcrumbs.php
+++ b/src/wp-includes/blocks/breadcrumbs.php
@@ -188,7 +188,7 @@ function render_block_core_breadcrumbs( $attributes, $content, $block ) {
$wrapper_attributes = get_block_wrapper_attributes(
array(
'style' => '--separator: "' . $separator . '";',
- 'aria-label' => _x( 'Breadcrumbs', 'area label' ),
+ 'aria-label' => _x( 'Breadcrumbs', 'aria label' ),
)
);
diff --git a/src/wp-includes/blocks/button.php b/src/wp-includes/blocks/button.php
index 7b67ad158aed1..fd117e9436a57 100644
--- a/src/wp-includes/blocks/button.php
+++ b/src/wp-includes/blocks/button.php
@@ -60,6 +60,53 @@ function render_block_core_button( $attributes, $content ) {
return '';
}
+ // Background skips serialization, so apply it to the link like color.
+ $background = $attributes['style']['background'] ?? null;
+
+ if ( is_array( $background ) ) {
+ $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,
+ );
+
+ // Mirror the background block support defaults.
+ 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( 'background' => $background_styles ) );
+
+ if ( ! empty( $styles['css'] ) ) {
+ $processor = new WP_HTML_Tag_Processor( $content );
+ while ( $processor->next_tag() ) {
+ if ( $tag !== $processor->get_tag() ) {
+ continue;
+ }
+
+ $existing_style = $processor->get_attribute( 'style' );
+ if ( is_string( $existing_style ) && '' !== $existing_style ) {
+ $separator = str_ends_with( $existing_style, ';' ) ? '' : ';';
+ $processor->set_attribute( 'style', $existing_style . $separator . $styles['css'] );
+ } else {
+ $processor->set_attribute( 'style', $styles['css'] );
+ }
+
+ if ( ! empty( $background_styles['backgroundImage'] ) || ! empty( $background_styles['gradient'] ) ) {
+ $processor->add_class( 'has-background' );
+ }
+ break;
+ }
+ $content = $processor->get_updated_html();
+ }
+ }
+
$width = $attributes['style']['dimensions']['width'] ?? null;
if ( is_string( $width ) && '' !== $width ) {
diff --git a/src/wp-includes/blocks/button/block.json b/src/wp-includes/blocks/button/block.json
index 2e23a64c8f559..29e3c1f22c50f 100644
--- a/src/wp-includes/blocks/button/block.json
+++ b/src/wp-includes/blocks/button/block.json
@@ -70,6 +70,12 @@
"splitting": true,
"align": false,
"alignWide": false,
+ "background": {
+ "backgroundImage": true,
+ "backgroundSize": true,
+ "gradient": true,
+ "__experimentalSkipSerialization": true
+ },
"color": {
"__experimentalSkipSerialization": true,
"gradients": true,
diff --git a/src/wp-includes/blocks/buttons/block.json b/src/wp-includes/blocks/buttons/block.json
index 4927a9644837b..03092ff3dc10a 100644
--- a/src/wp-includes/blocks/buttons/block.json
+++ b/src/wp-includes/blocks/buttons/block.json
@@ -50,6 +50,10 @@
"fontSize": true
}
},
+ "dimensions": {
+ "minHeight": true,
+ "minWidth": true
+ },
"__experimentalBorder": {
"color": true,
"radius": true,
@@ -73,7 +77,8 @@
"clientNavigation": true
},
"listView": true,
- "contentRole": true
+ "contentRole": true,
+ "shadow": true
},
"editorStyle": "wp-block-buttons-editor",
"style": "wp-block-buttons"
diff --git a/src/wp-includes/blocks/code/block.json b/src/wp-includes/blocks/code/block.json
index 028a64620cac3..4fad135a9706d 100644
--- a/src/wp-includes/blocks/code/block.json
+++ b/src/wp-includes/blocks/code/block.json
@@ -27,6 +27,10 @@
"gradient": true
}
},
+ "dimensions": {
+ "minHeight": true,
+ "minWidth": true
+ },
"typography": {
"fontSize": true,
"lineHeight": true,
diff --git a/src/wp-includes/blocks/columns/block.json b/src/wp-includes/blocks/columns/block.json
index dcd1193ca093e..7f742a87931a1 100644
--- a/src/wp-includes/blocks/columns/block.json
+++ b/src/wp-includes/blocks/columns/block.json
@@ -43,6 +43,10 @@
"gradient": true
}
},
+ "dimensions": {
+ "minHeight": true,
+ "minWidth": true
+ },
"spacing": {
"blockGap": {
"__experimentalDefault": "2em",
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/comments-pagination/block.json b/src/wp-includes/blocks/comments-pagination/block.json
index a2b7d9fe0b170..867a29736413d 100644
--- a/src/wp-includes/blocks/comments-pagination/block.json
+++ b/src/wp-includes/blocks/comments-pagination/block.json
@@ -50,6 +50,11 @@
"type": "flex"
}
},
+ "spacing": {
+ "padding": true,
+ "margin": true,
+ "blockGap": true
+ },
"typography": {
"fontSize": true,
"lineHeight": true,
@@ -63,6 +68,12 @@
"fontSize": true
}
},
+ "__experimentalBorder": {
+ "color": true,
+ "radius": true,
+ "style": true,
+ "width": true
+ },
"interactivity": {
"clientNavigation": true
}
diff --git a/src/wp-includes/blocks/cover.php b/src/wp-includes/blocks/cover.php
index 8bd1c3f5cd38f..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'] ) &&
@@ -30,11 +39,13 @@ function render_block_core_cover( $attributes, $content ) {
$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;
@@ -50,7 +61,8 @@ function render_block_core_cover( $attributes, $content ) {
}
// Modify iframe src to add background video parameters based on provider.
- $parsed_url = wp_parse_url( $iframe_src );
+ $parsed_url = wp_parse_url( $iframe_src );
+ $reduced_motion_src = null;
if ( $parsed_url && isset( $parsed_url['host'] ) ) {
// Parse existing query parameters.
$query_params = array();
@@ -58,9 +70,12 @@ function render_block_core_cover( $attributes, $content ) {
parse_str( $parsed_url['query'], $query_params );
}
- // Add background video parameters based on provider.
+ // Add background video parameters based on provider. The
+ // autoplay parameters are kept separate so a source without
+ // them can also be built, which the view script swaps in for
+ // a visitor who has asked for reduced motion.
+ $autoplay_params = array();
if ( 'youtube' === $provider ) {
- $query_params['autoplay'] = '1';
$query_params['mute'] = '1';
$query_params['loop'] = '1';
$query_params['controls'] = '0';
@@ -74,32 +89,53 @@ function render_block_core_cover( $attributes, $content ) {
if ( $video_id ) {
$query_params['playlist'] = $video_id;
}
+
+ $autoplay_params['autoplay'] = '1';
} elseif ( 'vimeo' === $provider ) {
- $query_params['autoplay'] = '1';
$query_params['muted'] = '1';
$query_params['loop'] = '1';
- $query_params['background'] = '1';
$query_params['controls'] = '0';
$query_params['transparent'] = '0';
+
+ // Vimeo's background mode always autoplays, so it can only
+ // be used when autoplay is allowed.
+ $autoplay_params['autoplay'] = '1';
+ $autoplay_params['background'] = '1';
} elseif ( 'videopress' === $provider || 'wordpress-tv' === $provider ) {
- $query_params['autoplay'] = '1';
- $query_params['loop'] = '1';
- $query_params['muted'] = '1';
+ $query_params['loop'] = '1';
+ $query_params['muted'] = '1';
+
+ $autoplay_params['autoplay'] = '1';
}
// Rebuild the URL with new parameters.
- $iframe_src = $parsed_url['scheme'] . '://' . $parsed_url['host'];
+ $iframe_base = $parsed_url['scheme'] . '://' . $parsed_url['host'];
if ( isset( $parsed_url['path'] ) ) {
- $iframe_src .= $parsed_url['path'];
- }
- if ( ! empty( $query_params ) ) {
- $iframe_src .= '?' . http_build_query( $query_params );
+ $iframe_base .= $parsed_url['path'];
}
+
+ $reduced_motion_src = empty( $query_params )
+ ? $iframe_base
+ : $iframe_base . '?' . http_build_query( $query_params );
+
+ $iframe_src = empty( $autoplay_params )
+ ? $reduced_motion_src
+ : $iframe_base . '?' . http_build_query( array_merge( $query_params, $autoplay_params ) );
}
- // Build the iframe HTML that will replace the figure.
+ // Build the iframe HTML that will replace the figure. The server
+ // renders the autoplaying source, and the view script swaps in the
+ // one without autoplay for a visitor who prefers reduced motion.
$iframe_html = sprintf(
- '
',
+ '',
+ esc_attr(
+ wp_json_encode(
+ array(
+ 'src' => $iframe_src,
+ 'reducedMotionSrc' => $reduced_motion_src,
+ )
+ )
+ ),
esc_url( $iframe_src )
);
@@ -130,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 1d95f80402e61..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,
@@ -153,7 +156,8 @@
"allowJustification": false
},
"interactivity": {
- "clientNavigation": true
+ "clientNavigation": true,
+ "interactive": true
},
"filter": {
"duotone": true
diff --git a/src/wp-includes/blocks/details/block.json b/src/wp-includes/blocks/details/block.json
index f5a2a1a6c3edc..ef2ad1428c39c 100644
--- a/src/wp-includes/blocks/details/block.json
+++ b/src/wp-includes/blocks/details/block.json
@@ -67,6 +67,9 @@
"padding": false
}
},
+ "dimensions": {
+ "minWidth": true
+ },
"typography": {
"fontSize": true,
"lineHeight": true,
diff --git a/src/wp-includes/blocks/embed/block.json b/src/wp-includes/blocks/embed/block.json
index d6f7c501d6507..41db597f29949 100644
--- a/src/wp-includes/blocks/embed/block.json
+++ b/src/wp-includes/blocks/embed/block.json
@@ -43,8 +43,13 @@
"supports": {
"anchor": true,
"align": true,
+ "dimensions": {
+ "minHeight": true,
+ "minWidth": true
+ },
"spacing": {
- "margin": true
+ "margin": true,
+ "padding": true
},
"interactivity": {
"clientNavigation": true
diff --git a/src/wp-includes/blocks/file/block.json b/src/wp-includes/blocks/file/block.json
index 24eeba2b2c386..68e389a4d28fb 100644
--- a/src/wp-includes/blocks/file/block.json
+++ b/src/wp-includes/blocks/file/block.json
@@ -78,6 +78,10 @@
"margin": true,
"padding": true
},
+ "dimensions": {
+ "minHeight": true,
+ "minWidth": true
+ },
"color": {
"gradients": true,
"link": true,
@@ -99,6 +103,20 @@
"style": true
}
},
+ "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/footnotes/block.json b/src/wp-includes/blocks/footnotes/block.json
index 393f7f702ab99..07fb9171aa243 100644
--- a/src/wp-includes/blocks/footnotes/block.json
+++ b/src/wp-includes/blocks/footnotes/block.json
@@ -53,6 +53,10 @@
"padding": false
}
},
+ "dimensions": {
+ "minHeight": true,
+ "minWidth": true
+ },
"typography": {
"fontSize": true,
"lineHeight": true,
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/gallery/block.json b/src/wp-includes/blocks/gallery/block.json
index 44158bb0fd0ad..a18adb2573b8c 100644
--- a/src/wp-includes/blocks/gallery/block.json
+++ b/src/wp-includes/blocks/gallery/block.json
@@ -166,6 +166,11 @@
"background": true,
"gradients": true
},
+ "shadow": true,
+ "dimensions": {
+ "minHeight": true,
+ "minWidth": true
+ },
"layout": {
"allowSwitching": false,
"allowInheriting": false,
@@ -179,11 +184,19 @@
"type": "flex"
}
},
+ "filter": {
+ "duotone": true
+ },
"interactivity": {
"clientNavigation": true
},
"listView": true
},
+ "selectors": {
+ "filter": {
+ "duotone": ".wp-block-gallery :where(img)"
+ }
+ },
"editorStyle": "wp-block-gallery-editor",
"style": "wp-block-gallery"
}
diff --git a/src/wp-includes/blocks/heading/block.json b/src/wp-includes/blocks/heading/block.json
index 4498f79781735..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,
@@ -53,6 +54,10 @@
"text": true
}
},
+ "dimensions": {
+ "minHeight": true,
+ "minWidth": true
+ },
"shadow": true,
"spacing": {
"margin": true,
@@ -66,6 +71,7 @@
"fontSize": true,
"lineHeight": true,
"textAlign": true,
+ "textIndent": true,
"__experimentalFontFamily": true,
"__experimentalFontStyle": true,
"__experimentalFontWeight": true,
diff --git a/src/wp-includes/blocks/home-link/block.json b/src/wp-includes/blocks/home-link/block.json
index 036e967883164..733a3afdd8e0d 100644
--- a/src/wp-includes/blocks/home-link/block.json
+++ b/src/wp-includes/blocks/home-link/block.json
@@ -52,6 +52,10 @@
}
},
"shadow": true,
+ "dimensions": {
+ "minHeight": true,
+ "minWidth": true
+ },
"__experimentalBorder": {
"color": true,
"radius": true,
@@ -64,6 +68,14 @@
"width": false
}
},
+ "spacing": {
+ "margin": true,
+ "padding": true,
+ "__experimentalDefaultControls": {
+ "margin": false,
+ "padding": false
+ }
+ },
"interactivity": {
"clientNavigation": true
}
diff --git a/src/wp-includes/blocks/icon.php b/src/wp-includes/blocks/icon.php
index 1b615c8a6dc96..fe5e9dcb41fe4 100644
--- a/src/wp-includes/blocks/icon.php
+++ b/src/wp-includes/blocks/icon.php
@@ -15,7 +15,7 @@
* @return string Returns the Icon.
*/
function render_block_core_icon( $attributes ) {
- if ( empty( $attributes['icon'] ) ) {
+ if ( empty( $attributes['icon'] ) || ! is_string( $attributes['icon'] ) ) {
return;
}
@@ -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 aef905ef59a64..8035a99782c7f 100644
--- a/src/wp-includes/blocks/image.php
+++ b/src/wp-includes/blocks/image.php
@@ -369,13 +369,13 @@ 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--click="actions.hideLightbox"
+ 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"
tabindex="-1"
>
-
-
+
@@ -405,7 +405,7 @@ class="wp-lightbox-overlay zoom"
{$next_button_icon}
-
+
HTML;
}
diff --git a/src/wp-includes/blocks/latest-comments/block.json b/src/wp-includes/blocks/latest-comments/block.json
index 0fcaf713b4219..b7cd908c45f3b 100644
--- a/src/wp-includes/blocks/latest-comments/block.json
+++ b/src/wp-includes/blocks/latest-comments/block.json
@@ -49,11 +49,21 @@
"link": true
}
},
+ "dimensions": {
+ "minHeight": true,
+ "minWidth": true
+ },
"html": false,
"spacing": {
"margin": true,
"padding": true
},
+ "__experimentalBorder": {
+ "color": true,
+ "radius": true,
+ "style": true,
+ "width": true
+ },
"shadow": true,
"typography": {
"fontSize": true,
diff --git a/src/wp-includes/blocks/latest-posts/block.json b/src/wp-includes/blocks/latest-posts/block.json
index cf855ac799121..bfc1ddd07ac52 100644
--- a/src/wp-includes/blocks/latest-posts/block.json
+++ b/src/wp-includes/blocks/latest-posts/block.json
@@ -97,6 +97,10 @@
"link": true
}
},
+ "dimensions": {
+ "minHeight": true,
+ "minWidth": true
+ },
"spacing": {
"margin": true,
"padding": true,
diff --git a/src/wp-includes/blocks/list-item/block.json b/src/wp-includes/blocks/list-item/block.json
index cdefd6c232bf3..a122785b424f3 100644
--- a/src/wp-includes/blocks/list-item/block.json
+++ b/src/wp-includes/blocks/list-item/block.json
@@ -24,6 +24,11 @@
"html": false,
"className": false,
"splitting": true,
+ "background": {
+ "backgroundImage": true,
+ "backgroundSize": true,
+ "gradient": true
+ },
"__experimentalBorder": {
"color": true,
"radius": true,
@@ -46,6 +51,7 @@
"padding": false
}
},
+ "shadow": true,
"typography": {
"fontSize": true,
"lineHeight": true,
@@ -65,6 +71,7 @@
},
"selectors": {
"root": ".wp-block-list > li",
- "border": ".wp-block-list:not(.wp-block-list .wp-block-list) > li"
+ "border": ".wp-block-list:not(.wp-block-list .wp-block-list) > li",
+ "shadow": ".wp-block-list:not(.wp-block-list .wp-block-list) > li"
}
}
diff --git a/src/wp-includes/blocks/list/block.json b/src/wp-includes/blocks/list/block.json
index c0bdef4eabcd8..b751c64ab7ae6 100644
--- a/src/wp-includes/blocks/list/block.json
+++ b/src/wp-includes/blocks/list/block.json
@@ -58,6 +58,15 @@
"fontSize": true
}
},
+ "background": {
+ "backgroundImage": true,
+ "backgroundSize": true,
+ "gradient": true,
+ "__experimentalDefaultControls": {
+ "backgroundImage": true,
+ "gradient": true
+ }
+ },
"color": {
"gradients": true,
"link": true,
@@ -66,6 +75,10 @@
"text": true
}
},
+ "dimensions": {
+ "minHeight": true,
+ "minWidth": true
+ },
"spacing": {
"margin": true,
"padding": true,
@@ -74,6 +87,7 @@
"padding": false
}
},
+ "shadow": true,
"__unstablePasteTextInline": true,
"__experimentalOnMerge": true,
"__experimentalSlashInserter": true,
@@ -83,7 +97,9 @@
"listView": true
},
"selectors": {
- "border": ".wp-block-list:not(.wp-block-list .wp-block-list)"
+ "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",
"style": "wp-block-list"
diff --git a/src/wp-includes/blocks/loginout/block.json b/src/wp-includes/blocks/loginout/block.json
index 2cb710277665c..9d2a6b52305d2 100644
--- a/src/wp-includes/blocks/loginout/block.json
+++ b/src/wp-includes/blocks/loginout/block.json
@@ -38,6 +38,10 @@
"gradients": true,
"link": true
},
+ "dimensions": {
+ "minHeight": true,
+ "minWidth": true
+ },
"spacing": {
"margin": true,
"padding": true,
@@ -68,7 +72,8 @@
"shadow": true,
"interactivity": {
"clientNavigation": true
- }
+ },
+ "contentRole": true
},
"style": "wp-block-loginout"
}
diff --git a/src/wp-includes/blocks/math/block.json b/src/wp-includes/blocks/math/block.json
index 53509016a90ec..c00c3459fc258 100644
--- a/src/wp-includes/blocks/math/block.json
+++ b/src/wp-includes/blocks/math/block.json
@@ -32,6 +32,10 @@
"text": true
}
},
+ "dimensions": {
+ "minHeight": true,
+ "minWidth": true
+ },
"shadow": true,
"spacing": {
"margin": true,
diff --git a/src/wp-includes/blocks/media-text/block.json b/src/wp-includes/blocks/media-text/block.json
index 41c6b2d33aa15..342dc8f7baec8 100644
--- a/src/wp-includes/blocks/media-text/block.json
+++ b/src/wp-includes/blocks/media-text/block.json
@@ -100,6 +100,11 @@
"anchor": true,
"align": [ "wide", "full" ],
"html": false,
+ "background": {
+ "backgroundImage": true,
+ "backgroundSize": true,
+ "gradient": true
+ },
"__experimentalBorder": {
"color": true,
"radius": true,
@@ -122,10 +127,15 @@
"text": true
}
},
+ "dimensions": {
+ "minHeight": true,
+ "minWidth": true
+ },
"spacing": {
"margin": true,
"padding": true
},
+ "shadow": true,
"typography": {
"fontSize": true,
"lineHeight": true,
@@ -139,11 +149,19 @@
"fontSize": true
}
},
+ "filter": {
+ "duotone": true
+ },
"interactivity": {
"clientNavigation": true
},
"allowedBlocks": true
},
+ "selectors": {
+ "filter": {
+ "duotone": ".wp-block-media-text > .wp-block-media-text__media img, .wp-block-media-text > .wp-block-media-text__media video"
+ }
+ },
"editorStyle": "wp-block-media-text-editor",
"style": "wp-block-media-text"
}
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/page-list/block.json b/src/wp-includes/blocks/page-list/block.json
index 96c19c5e3e376..af9773f5a3917 100644
--- a/src/wp-includes/blocks/page-list/block.json
+++ b/src/wp-includes/blocks/page-list/block.json
@@ -86,6 +86,10 @@
}
},
"shadow": true,
+ "dimensions": {
+ "minHeight": true,
+ "minWidth": true
+ },
"contentRole": true
},
"editorStyle": "wp-block-page-list-editor",
diff --git a/src/wp-includes/blocks/paragraph/block.json b/src/wp-includes/blocks/paragraph/block.json
index 31cb23fedd8b0..e8dfaa7ff9ae1 100644
--- a/src/wp-includes/blocks/paragraph/block.json
+++ b/src/wp-includes/blocks/paragraph/block.json
@@ -31,12 +31,19 @@
"splitting": true,
"anchor": true,
"className": false,
+ "background": {
+ "backgroundClip": true,
+ "backgroundImage": true,
+ "backgroundSize": true,
+ "gradient": true
+ },
"__experimentalBorder": {
"color": true,
"radius": true,
"style": true,
"width": true
},
+ "shadow": true,
"color": {
"gradients": true,
"link": true,
@@ -45,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-author-biography/block.json b/src/wp-includes/blocks/post-author-biography/block.json
index a9f9870f842ed..bf611c9ed58c5 100644
--- a/src/wp-includes/blocks/post-author-biography/block.json
+++ b/src/wp-includes/blocks/post-author-biography/block.json
@@ -32,6 +32,7 @@
"lineHeight": true,
"textAlign": true,
"textColumns": true,
+ "textIndent": true,
"__experimentalFontFamily": true,
"__experimentalFontWeight": true,
"__experimentalFontStyle": true,
diff --git a/src/wp-includes/blocks/post-comments-form/block.json b/src/wp-includes/blocks/post-comments-form/block.json
index 1fe6e56ef8ad3..581812b34078f 100644
--- a/src/wp-includes/blocks/post-comments-form/block.json
+++ b/src/wp-includes/blocks/post-comments-form/block.json
@@ -29,6 +29,10 @@
"text": true
}
},
+ "dimensions": {
+ "minHeight": true,
+ "minWidth": true
+ },
"spacing": {
"margin": true,
"padding": true
@@ -37,6 +41,7 @@
"fontSize": true,
"lineHeight": true,
"textAlign": true,
+ "__experimentalFontFamily": true,
"__experimentalFontStyle": true,
"__experimentalFontWeight": true,
"__experimentalLetterSpacing": true,
diff --git a/src/wp-includes/blocks/post-content/block.json b/src/wp-includes/blocks/post-content/block.json
index 835e8aecef7af..bd20b8cf82d4f 100644
--- a/src/wp-includes/blocks/post-content/block.json
+++ b/src/wp-includes/blocks/post-content/block.json
@@ -30,7 +30,8 @@
}
},
"dimensions": {
- "minHeight": true
+ "minHeight": true,
+ "minWidth": true
},
"shadow": true,
"spacing": {
diff --git a/src/wp-includes/blocks/post-excerpt/block.json b/src/wp-includes/blocks/post-excerpt/block.json
index f1e8d02cad469..e3dff4bc3ea5a 100644
--- a/src/wp-includes/blocks/post-excerpt/block.json
+++ b/src/wp-includes/blocks/post-excerpt/block.json
@@ -46,6 +46,10 @@
"margin": true,
"padding": true
},
+ "dimensions": {
+ "minHeight": true,
+ "minWidth": true
+ },
"typography": {
"fontSize": true,
"lineHeight": true,
diff --git a/src/wp-includes/blocks/post-featured-image/block.json b/src/wp-includes/blocks/post-featured-image/block.json
index 72332d2d1d1e7..f65c1fe3523a1 100644
--- a/src/wp-includes/blocks/post-featured-image/block.json
+++ b/src/wp-includes/blocks/post-featured-image/block.json
@@ -74,6 +74,7 @@
"__experimentalBorder": {
"color": true,
"radius": true,
+ "style": true,
"width": true,
"__experimentalSkipSerialization": true,
"__experimentalDefaultControls": {
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-terms/block.json b/src/wp-includes/blocks/post-terms/block.json
index 4244a9cc65ed0..94fd4e4911832 100644
--- a/src/wp-includes/blocks/post-terms/block.json
+++ b/src/wp-includes/blocks/post-terms/block.json
@@ -46,6 +46,10 @@
"link": true
}
},
+ "dimensions": {
+ "minHeight": true,
+ "minWidth": true
+ },
"shadow": true,
"spacing": {
"margin": true,
diff --git a/src/wp-includes/blocks/post-time-to-read/block.json b/src/wp-includes/blocks/post-time-to-read/block.json
index 2d7024176a03c..2ab2d2ec2e150 100644
--- a/src/wp-includes/blocks/post-time-to-read/block.json
+++ b/src/wp-includes/blocks/post-time-to-read/block.json
@@ -35,6 +35,10 @@
"text": true
}
},
+ "dimensions": {
+ "minHeight": true,
+ "minWidth": true
+ },
"html": false,
"shadow": true,
"spacing": {
diff --git a/src/wp-includes/blocks/post-title/block.json b/src/wp-includes/blocks/post-title/block.json
index 036070d6e711b..1f63739257ada 100644
--- a/src/wp-includes/blocks/post-title/block.json
+++ b/src/wp-includes/blocks/post-title/block.json
@@ -60,6 +60,10 @@
"link": true
}
},
+ "dimensions": {
+ "minHeight": true,
+ "minWidth": true
+ },
"shadow": true,
"spacing": {
"margin": true,
@@ -75,6 +79,7 @@
"__experimentalTextTransform": true,
"__experimentalTextDecoration": true,
"__experimentalLetterSpacing": true,
+ "fitText": true,
"__experimentalDefaultControls": {
"fontSize": true
}
diff --git a/src/wp-includes/blocks/preformatted/block.json b/src/wp-includes/blocks/preformatted/block.json
index 29b6e47a6cfc4..b9553e8508837 100644
--- a/src/wp-includes/blocks/preformatted/block.json
+++ b/src/wp-includes/blocks/preformatted/block.json
@@ -30,6 +30,10 @@
"text": true
}
},
+ "dimensions": {
+ "minHeight": true,
+ "minWidth": true
+ },
"shadow": true,
"spacing": {
"padding": true,
diff --git a/src/wp-includes/blocks/pullquote/block.json b/src/wp-includes/blocks/pullquote/block.json
index 37aad23e108d2..fccc514c0eca2 100644
--- a/src/wp-includes/blocks/pullquote/block.json
+++ b/src/wp-includes/blocks/pullquote/block.json
@@ -42,7 +42,8 @@
}
},
"dimensions": {
- "minHeight": true
+ "minHeight": true,
+ "minWidth": true
},
"shadow": true,
"spacing": {
@@ -53,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/query-no-results/block.json b/src/wp-includes/blocks/query-no-results/block.json
index af81be4039d5f..8f9045dbfa03f 100644
--- a/src/wp-includes/blocks/query-no-results/block.json
+++ b/src/wp-includes/blocks/query-no-results/block.json
@@ -24,6 +24,10 @@
"heading": true,
"button": true
},
+ "dimensions": {
+ "minHeight": true,
+ "minWidth": true
+ },
"spacing": {
"padding": true,
"margin": true,
diff --git a/src/wp-includes/blocks/query-pagination/block.json b/src/wp-includes/blocks/query-pagination/block.json
index 0795249c3dc53..afed49ae1c9f3 100644
--- a/src/wp-includes/blocks/query-pagination/block.json
+++ b/src/wp-includes/blocks/query-pagination/block.json
@@ -44,6 +44,11 @@
"link": true
}
},
+ "spacing": {
+ "padding": true,
+ "margin": true,
+ "blockGap": true
+ },
"layout": {
"allowSwitching": false,
"allowInheriting": false,
@@ -64,6 +69,18 @@
"fontSize": true
}
},
+ "__experimentalBorder": {
+ "color": true,
+ "radius": true,
+ "style": true,
+ "width": true,
+ "__experimentalDefaultControls": {
+ "color": false,
+ "radius": false,
+ "style": false,
+ "width": false
+ }
+ },
"interactivity": {
"clientNavigation": true
}
diff --git a/src/wp-includes/blocks/query-total/block.json b/src/wp-includes/blocks/query-total/block.json
index b15eb1a1aa9e1..86a61d6e84bfd 100644
--- a/src/wp-includes/blocks/query-total/block.json
+++ b/src/wp-includes/blocks/query-total/block.json
@@ -27,6 +27,10 @@
"margin": true,
"padding": true
},
+ "dimensions": {
+ "minHeight": true,
+ "minWidth": true
+ },
"color": {
"gradients": true,
"__experimentalDefaultControls": {
diff --git a/src/wp-includes/blocks/quote/block.json b/src/wp-includes/blocks/quote/block.json
index a3fb9123640f6..f0c0d767d76e8 100644
--- a/src/wp-includes/blocks/quote/block.json
+++ b/src/wp-includes/blocks/quote/block.json
@@ -53,6 +53,7 @@
},
"dimensions": {
"minHeight": true,
+ "minWidth": true,
"__experimentalDefaultControls": {
"minHeight": false
}
@@ -68,6 +69,7 @@
"__experimentalTextTransform": true,
"__experimentalTextDecoration": true,
"__experimentalLetterSpacing": true,
+ "__experimentalWritingMode": true,
"__experimentalDefaultControls": {
"fontSize": true
}
@@ -76,6 +78,7 @@
"gradients": true,
"heading": true,
"link": true,
+ "button": true,
"__experimentalDefaultControls": {
"background": true,
"text": true
diff --git a/src/wp-includes/blocks/read-more/block.json b/src/wp-includes/blocks/read-more/block.json
index 987db294f4bf6..5cf9882e77027 100644
--- a/src/wp-includes/blocks/read-more/block.json
+++ b/src/wp-includes/blocks/read-more/block.json
@@ -43,6 +43,10 @@
"textDecoration": true
}
},
+ "dimensions": {
+ "minHeight": true,
+ "minWidth": true
+ },
"spacing": {
"margin": [ "top", "bottom" ],
"padding": true,
@@ -53,6 +57,7 @@
"__experimentalBorder": {
"color": true,
"radius": true,
+ "style": true,
"width": true,
"__experimentalDefaultControls": {
"width": true
diff --git a/src/wp-includes/blocks/rss/block.json b/src/wp-includes/blocks/rss/block.json
index 9e013e84f673c..b2daac9efcdc9 100644
--- a/src/wp-includes/blocks/rss/block.json
+++ b/src/wp-includes/blocks/rss/block.json
@@ -70,6 +70,10 @@
"margin": false
}
},
+ "dimensions": {
+ "minHeight": true,
+ "minWidth": true
+ },
"shadow": true,
"background": {
"backgroundImage": 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 4104c0fd4fd5d..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,8 +91,17 @@
"width": true
}
},
+ "shadow": {
+ "__experimentalSkipSerialization": true
+ },
+ "dimensions": {
+ "minHeight": true,
+ "minWidth": true,
+ "__experimentalSkipSerialization": true
+ },
"spacing": {
- "margin": true
+ "margin": true,
+ "padding": true
},
"html": false
},
@@ -95,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/site-tagline/block.json b/src/wp-includes/blocks/site-tagline/block.json
index bb701870dd9e6..f6a3b7987ba11 100644
--- a/src/wp-includes/blocks/site-tagline/block.json
+++ b/src/wp-includes/blocks/site-tagline/block.json
@@ -44,6 +44,10 @@
}
},
"contentRole": true,
+ "dimensions": {
+ "minHeight": true,
+ "minWidth": true
+ },
"spacing": {
"margin": true,
"padding": true,
diff --git a/src/wp-includes/blocks/site-title/block.json b/src/wp-includes/blocks/site-title/block.json
index 214256fa52a22..74b94e5570888 100644
--- a/src/wp-includes/blocks/site-title/block.json
+++ b/src/wp-includes/blocks/site-title/block.json
@@ -47,6 +47,10 @@
"link": true
}
},
+ "dimensions": {
+ "minHeight": true,
+ "minWidth": true
+ },
"spacing": {
"padding": true,
"margin": true,
diff --git a/src/wp-includes/blocks/social-links/block.json b/src/wp-includes/blocks/social-links/block.json
index bbe7f2486b351..4fcf80acc94fa 100644
--- a/src/wp-includes/blocks/social-links/block.json
+++ b/src/wp-includes/blocks/social-links/block.json
@@ -98,6 +98,7 @@
"style": true
}
},
+ "shadow": true,
"contentRole": true,
"listView": true
},
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 3b489fc86d546..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,
@@ -65,10 +75,15 @@
"padding": true,
"blockGap": true
}
+ },
+ "shadow": {
+ "__experimentalSkipSerialization": true
}
},
"selectors": {
+ "background": ".wp-block-tab-list button",
"border": ".wp-block-tab-list button",
+ "shadow": ".wp-block-tab-list button",
"color": {
"background": ".wp-block-tab-list button",
"text": ".wp-block-tab-list button"
diff --git a/src/wp-includes/blocks/tab-panels/block.json b/src/wp-includes/blocks/tab-panels/block.json
index 30c407115d65f..1c91344d45ab7 100644
--- a/src/wp-includes/blocks/tab-panels/block.json
+++ b/src/wp-includes/blocks/tab-panels/block.json
@@ -36,6 +36,9 @@
"spacing": {
"padding": true
},
+ "dimensions": {
+ "minHeight": true
+ },
"typography": {
"fontSize": true,
"lineHeight": true,
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/tabs/block.json b/src/wp-includes/blocks/tabs/block.json
index 2910a67464f46..88f023f68eb83 100644
--- a/src/wp-includes/blocks/tabs/block.json
+++ b/src/wp-includes/blocks/tabs/block.json
@@ -55,6 +55,9 @@
"margin": true,
"padding": true
},
+ "dimensions": {
+ "minWidth": true
+ },
"shadow": true,
"typography": {
"fontSize": true,
diff --git a/src/wp-includes/blocks/template-part.php b/src/wp-includes/blocks/template-part.php
index 4f2062c2af668..c716e1e677696 100644
--- a/src/wp-includes/blocks/template-part.php
+++ b/src/wp-includes/blocks/template-part.php
@@ -44,11 +44,24 @@ function render_block_core_template_part( $attributes ) {
)
);
$template_part_post = $template_part_query->have_posts() ? $template_part_query->next_post() : null;
- if ( $template_part_post ) {
+ $block_template = $template_part_post ? _build_block_template_result_from_post( $template_part_post ) : null;
+ // Can be a WP_Error if the post's `wp_theme` terms can't be read, even though the query
+ // matched on them. Report it and fall back to the theme file.
+ if ( is_wp_error( $block_template ) ) {
+ wp_trigger_error(
+ __FUNCTION__,
+ sprintf(
+ /* translators: 1: Template part ID, 2: Error message. */
+ __( 'Error when loading the template part %1$s from the database: %2$s' ),
+ $template_part_id,
+ $block_template->get_error_message()
+ )
+ );
+ }
+ if ( $block_template && ! is_wp_error( $block_template ) ) {
// A published post might already exist if this template part was customized elsewhere
// or if it's part of a customized template.
- $block_template = _build_block_template_result_from_post( $template_part_post );
- $content = $block_template->content;
+ $content = $block_template->content;
if ( isset( $block_template->area ) ) {
$area = $block_template->area;
}
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 11d64619609b0..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",
@@ -31,8 +31,13 @@
},
"shadow": true,
"spacing": {
+ "margin": true,
"padding": true
},
+ "dimensions": {
+ "minHeight": true,
+ "minWidth": true
+ },
"typography": {
"fontSize": true,
"lineHeight": true,
diff --git a/src/wp-includes/blocks/term-description/block.json b/src/wp-includes/blocks/term-description/block.json
index 77943ee4f7eb9..e3c7af81c09b2 100644
--- a/src/wp-includes/blocks/term-description/block.json
+++ b/src/wp-includes/blocks/term-description/block.json
@@ -26,6 +26,10 @@
"text": true
}
},
+ "dimensions": {
+ "minHeight": true,
+ "minWidth": true
+ },
"spacing": {
"padding": true,
"margin": true
diff --git a/src/wp-includes/blocks/term-name/block.json b/src/wp-includes/blocks/term-name/block.json
index 5fce425367924..a5b427f338480 100644
--- a/src/wp-includes/blocks/term-name/block.json
+++ b/src/wp-includes/blocks/term-name/block.json
@@ -43,9 +43,14 @@
"link": true
}
},
+ "dimensions": {
+ "minHeight": true,
+ "minWidth": true
+ },
"shadow": true,
"spacing": {
- "padding": true
+ "padding": true,
+ "margin": true
},
"typography": {
"fontSize": true,
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 287e105baf1f1..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
@@ -43,6 +45,10 @@
"fontSize": true
}
},
+ "dimensions": {
+ "minHeight": true,
+ "minWidth": true
+ },
"spacing": {
"margin": true,
"padding": 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/verse/block.json b/src/wp-includes/blocks/verse/block.json
index 967720520630a..97a2394c66583 100644
--- a/src/wp-includes/blocks/verse/block.json
+++ b/src/wp-includes/blocks/verse/block.json
@@ -37,6 +37,7 @@
},
"dimensions": {
"minHeight": true,
+ "minWidth": true,
"__experimentalDefaultControls": {
"minHeight": false
}
@@ -46,12 +47,15 @@
"__experimentalFontFamily": true,
"lineHeight": true,
"textAlign": true,
+ "textColumns": true,
+ "textIndent": true,
"__experimentalFontStyle": true,
"__experimentalFontWeight": true,
"__experimentalLetterSpacing": true,
"__experimentalTextTransform": true,
"__experimentalTextDecoration": true,
"__experimentalWritingMode": true,
+ "fitText": true,
"__experimentalDefaultControls": {
"fontSize": 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 292583692274b..f030c66090501 100644
--- a/src/wp-includes/blocks/video/block.json
+++ b/src/wp-includes/blocks/video/block.json
@@ -91,6 +91,9 @@
"supports": {
"anchor": true,
"align": true,
+ "filter": {
+ "duotone": true
+ },
"spacing": {
"margin": true,
"padding": true,
@@ -100,14 +103,24 @@
}
},
"interactivity": {
- "clientNavigation": true
+ "clientNavigation": true,
+ "interactive": true
},
"shadow": {
"__experimentalSkipSerialization": true
+ },
+ "dimensions": {
+ "minWidth": true,
+ "minHeight": true,
+ "__experimentalSkipSerialization": true
}
},
"selectors": {
- "shadow": ".wp-block-video video"
+ "dimensions": ".wp-block-video video",
+ "shadow": ".wp-block-video video",
+ "filter": {
+ "duotone": ".wp-block-video video"
+ }
},
"editorStyle": "wp-block-video-editor",
"style": "wp-block-video"
diff --git a/src/wp-includes/build/constants.php b/src/wp-includes/build/constants.php
index d842927190ca2..3bf290f0186b2 100644
--- a/src/wp-includes/build/constants.php
+++ b/src/wp-includes/build/constants.php
@@ -9,6 +9,6 @@
*/
return array(
- 'version' => '24.1.0',
+ 'version' => '24.2.0',
'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 7e21b056850e2..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/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/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();
@@ -94,7 +101,7 @@ var require_use_sync_external_store_shim_development = __commonJS({
},
[subscribe, value, getSnapshot]
);
- useEffect15(
+ useEffect14(
function() {
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
return subscribe(function() {
@@ -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, useEffect15 = 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/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/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/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/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, useEffect15 = 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;
@@ -191,7 +198,7 @@ var require_with_selector_development = __commonJS({
[getSnapshot, getServerSnapshot, selector, isEqual]
);
var value = useSyncExternalStore3(subscribe, instRef[0], instRef[1]);
- useEffect15(
+ useEffect14(
function() {
inst.hasValue = true;
inst.value = value;
@@ -206,9 +213,9 @@ var require_with_selector_development = __commonJS({
}
});
-// 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/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/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/@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/@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/@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/@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/@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/@base-ui/utils/warn.mjs
-var warn = createLogOnce("warn", "Base UI");
-
-// node_modules/@base-ui/utils/empty.mjs
-function NOOP() {
-}
-var EMPTY_ARRAY = Object.freeze([]);
-var EMPTY_OBJECT = Object.freeze({});
-
-// 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/@base-ui/react/internals/useRenderElement.mjs
-var React6 = __toESM(require_react(), 1);
-
-// 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/@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/@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/@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/@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/@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/@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/@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/@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/@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);
- }
- if (element) {
- if (typeof element === "string") {
- return renderTag(element, props);
- }
+ return /* @__PURE__ */ React4.cloneElement(render, mergedProps);
}
- 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/@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/@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/@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/@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/@base-ui/react/internals/useTransitionStatus.mjs
-var React9 = __toESM(require_react(), 1);
-
-// node_modules/@base-ui/utils/useOnMount.mjs
-var React8 = __toESM(require_react(), 1);
-function useOnMount(fn) {
- React8.useEffect(fn, EMPTY_ARRAY);
-}
-
-// 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/@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,37 +1094,236 @@ function useTransitionStatus(open2, enableIdleState = false, deferEndingState =
};
}
-// node_modules/@base-ui/react/internals/TransitionStatusDataAttributes.mjs
-var startingStyle = "data-starting-style";
-var endingStyle = "data-ending-style";
-
-// 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();
+ }
+ 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/@base-ui/react/internals/use-button/useButton.mjs
-var React12 = __toESM(require_react(), 1);
-
-// node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
-function hasWindow() {
- return typeof window !== "undefined";
+// 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 getNodeName(node) {
+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();
}
@@ -1289,20 +1475,20 @@ function getFrameElement(win) {
return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
}
-// 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/@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/@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/@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/@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/@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/@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/@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/@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/@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/@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();
- }
- });
- });
+ 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
+ };
+ }
}
- 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/@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/@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/@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/@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
- };
+ 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/@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/@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/@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/@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/@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/@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/@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/@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/@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/@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/@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/@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/@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/@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/@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/@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/@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/@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/@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/@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/@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,
@@ -2229,7 +2271,7 @@ var FocusGuard = /* @__PURE__ */ React15.forwardRef(function FocusGuard2(props,
});
if (true) FocusGuard.displayName = "FocusGuard";
-// node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
+// node_modules/.store/@floating-ui/utils@0.2.12-gOxTzMf36nCrbeHpEew-rw/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
var min = Math.min;
var max = Math.max;
var round = Math.round;
@@ -2357,7 +2399,7 @@ function rectToClientRect(rect) {
};
}
-// 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/@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/@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/@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/@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/@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/@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/@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/@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/@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/@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/@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/@base-ui/react/floating-ui-react/hooks/useFloating.mjs
-var React27 = __toESM(require_react(), 1);
-
-// 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();
+ }
+ }
+ });
+ 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();
}
- return {
- x: x + diffCoords.x,
- y: y + diffCoords.y,
- data: {
- ...diffCoords,
- placement
- }
- };
}
+ });
+ 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 shift = 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 {
- 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);
+}
+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) {
- crossAxisCoord = clampCoord(crossAxis, crossAxisCoord);
+ registrationRef.current = null;
+ const registeredStore = registration.store;
+ if (registeredStore.context.triggerElements.getById(registration.id) === registration.element) {
+ registeredStore.context.triggerElements.delete(registration.id);
+ syncTriggerCount(registeredStore);
}
- 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
- }
- }
- };
}
- };
-};
-var limitShift = function(options) {
- if (options === void 0) {
- options = {};
- }
- 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;
- }
- }
- 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;
- }
- }
- 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;
}
- 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/@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;
+ const triggerId = trigger?.id ?? null;
+ let activeTriggerId = state.activeTriggerId;
+ let activeTriggerElement = state.activeTriggerElement;
+ if (triggerId || open2) {
+ activeTriggerId = triggerId;
+ activeTriggerElement = trigger ?? null;
}
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 attachPreventUnmountOnClose(eventDetails) {
+ let preventUnmountOnClose = false;
+ eventDetails.preventUnmountOnClose = () => {
+ preventUnmountOnClose = true;
+ };
+ return () => preventUnmountOnClose;
}
-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
- };
-}
-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);
- 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
- };
-}
-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;
- }
+ }, [isMountedByThisTrigger, store2, triggerElementRef, ...Object.values(stateUpdates)]);
return {
- width,
- height,
- x,
- y
+ registerTrigger,
+ isMountedByThisTrigger
};
}
-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);
}
- } else {
- width = visualViewport.width;
- height = visualViewport.height;
- if (layoutRelativeClientCoords) {
- x = visualViewport.offsetLeft;
- y = visualViewport.offsetTop;
+ if (store2.state.openedWithoutTrigger) {
+ store2.set("openedWithoutTrigger", false);
}
+ return;
}
- }
- 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;
+ const triggerCount = store2.context.triggerElements.size;
+ const stateUpdates = {};
+ if (store2.state.triggerCount !== triggerCount) {
+ stateUpdates.triggerCount = triggerCount;
}
- }
- return {
- width,
- height,
- x,
- y
- };
-}
-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;
- return {
- width,
- height,
- x,
- y
- };
-}
-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
- };
- }
- return rectToClientRect(rect);
-}
-function getClippingElementAncestors(element, cache) {
- const cachedResult = cache.get(element);
- if (cachedResult) {
- return cachedResult;
- }
- 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);
+ 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 {
- lastKeptComputedStyle = computedStyle;
+ resolvedActiveTriggerIdRef.current = null;
}
- currentNode = getParentNode(currentNode);
- }
- 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
- };
+ 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;
+ }
+ }
+ if (stateUpdates.triggerCount !== void 0 || stateUpdates.activeTriggerId !== void 0 || stateUpdates.activeTriggerElement !== void 0) {
+ store2.update(stateUpdates);
+ }
+ 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 getDimensions(element) {
+function useOpenStateTransitions(open2, store2, onUnmount, animateInitialOpen) {
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);
- }
- if (isOffsetParentAnElement) {
- const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
- offsets.x = offsetRect.x + offsetParent.clientLeft;
- offsets.y = offsetRect.y + offsetParent.clientTop;
+ 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);
}
- }
- if (!isOffsetParentAnElement && documentElement) {
- offsets.x = getWindowScrollBarX(documentElement);
- }
- 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;
+ });
+ useRefWithInit(() => {
+ store2.set("mounted", mounted);
+ return null;
+ });
+ store2.useSyncedValues({
+ mounted,
+ transitionStatus
+ });
return {
- x,
- y,
- width: rect.width,
- height: rect.height
+ forceUnmount,
+ transitionStatus
};
}
-function isStaticPositioned(element) {
- return getComputedStyle2(element).position === "static";
+function usePopupInteractionProps(store2, statePart) {
+ store2.useSyncedValues(statePart);
+ useIsoLayoutEffect(() => () => {
+ store2.update({
+ activeTriggerProps: EMPTY_OBJECT,
+ inactiveTriggerProps: EMPTY_OBJECT,
+ popupProps: EMPTY_OBJECT
+ });
+ }, [store2]);
}
-function getTrueOffsetParent(element, polyfill) {
- if (!isHTMLElement(element) || getComputedStyle2(element).position === "fixed") {
- return null;
- }
- if (polyfill) {
- return polyfill(element);
- }
- let rawOffsetParent = element.offsetParent;
- if (getDocumentElement(element) === rawOffsetParent) {
- rawOffsetParent = rawOffsetParent.ownerDocument.body;
+
+// 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 rawOffsetParent;
+ return elementIds;
}
-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;
+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.");
}
- svgOffsetParent = getParentNode(svgOffsetParent);
+ const previousElement = this.idMap.get(id);
+ if (previousElement !== void 0 && previousElement !== element) {
+ elementIds.delete(previousElement);
+ }
+ elementIds.set(element, id);
}
- return win;
+ this.idMap.set(id, element);
}
- let offsetParent = getTrueOffsetParent(element, polyfill);
- while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
- offsetParent = getTrueOffsetParent(offsetParent, polyfill);
+ /**
+ * 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);
+ }
+ }
+ this.idMap.delete(id);
}
- if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
- return win;
+ /**
+ * Whether the given element is registered as a trigger.
+ */
+ hasElement(element) {
+ for (const registered of this.idMap.values()) {
+ if (registered === element) {
+ return true;
+ }
+ }
+ return false;
}
- return offsetParent || getContainingBlock(element) || win;
-}
-var getElementRects = async function(data) {
- const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
- const getDimensionsFn = this.getDimensions;
- const floatingDimensions = await getDimensionsFn(data.floating);
- return {
- reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
- floating: {
- x: 0,
- y: 0,
- width: floatingDimensions.width,
- height: floatingDimensions.height
+ /**
+ * 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;
+ }
+ /**
+ * Returns the trigger element associated with the given ID, or undefined if no such element exists.
+ */
+ getById(id) {
+ return this.idMap.get(id);
+ }
+ /**
+ * Returns an iterable of all registered trigger entries, where each entry is a tuple of [id, element].
+ */
+ entries() {
+ return this.idMap.entries();
+ }
+ /**
+ * Returns an iterable of all registered trigger elements.
+ */
+ elements() {
+ return this.idMap.values();
+ }
+ /**
+ * Returns the number of registered trigger elements.
+ */
+ get size() {
+ return this.idMap.size;
+ }
};
-function isRTL(element) {
- return getComputedStyle2(element).direction === "rtl";
+
+// 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;
}
-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;
+function register(hook) {
+ hooks.push(hook);
}
-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();
- }
- if (!width || !height) {
- return;
- }
- 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
- };
- let isFirstUpdate = true;
- function handleObserve(entries) {
- const ratio = entries[0].intersectionRatio;
- if (!rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
- return refresh();
+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);
}
- if (ratio !== threshold) {
- if (!isFirstUpdate) {
- return refresh();
- }
- if (!ratio) {
- timeoutId = setTimeout(() => {
- refresh(false, 1e-7);
- }, 1e3);
- } else {
- refresh(false, ratio);
- }
+ result = fn(props, forwardedRef);
+ for (const hook of hooks) {
+ hook.after(instance);
}
- isFirstUpdate = false;
- }
- try {
- io = new IntersectionObserver(handleObserve, {
- ...options,
- // Handle