@wordpress/interface 8.3.0 → 9.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 9.0.0 (2025-01-02)
6
+
7
+ ### Breaking Changes
8
+
9
+ - `ActionItem.Slot`: Render as `MenuGroup` by default ([#67985](https://github.com/WordPress/gutenberg/pull/67985)).
10
+
5
11
  ## 8.3.0 (2024-12-11)
6
12
 
7
13
  ## 8.2.0 (2024-11-27)
package/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ## Gutenberg
2
2
 
3
- Copyright 2016-2024 by the contributors
3
+ Copyright 2016-2025 by the contributors
4
4
 
5
5
  **License for Contributions (on and after April 15, 2021)**
6
6
 
@@ -15,7 +15,7 @@ var _jsxRuntime = require("react/jsx-runtime");
15
15
  const noop = () => {};
16
16
  function ActionItemSlot({
17
17
  name,
18
- as: Component = _components.ButtonGroup,
18
+ as: Component = _components.MenuGroup,
19
19
  fillProps = {},
20
20
  bubblesVirtually,
21
21
  ...props
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_element","_jsxRuntime","noop","ActionItemSlot","name","as","Component","ButtonGroup","fillProps","bubblesVirtually","props","jsx","Slot","children","fills","Children","toArray","length","initializedByPlugins","forEach","__unstableExplicitMenuItem","__unstableTarget","push","map","child","includes","ActionItem","Button","onClick","Fill","fpOnClick","args","undefined","_default","exports","default"],"sources":["@wordpress/interface/src/components/action-item/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ButtonGroup, Button, Slot, Fill } from '@wordpress/components';\nimport { Children } from '@wordpress/element';\n\nconst noop = () => {};\n\nfunction ActionItemSlot( {\n\tname,\n\tas: Component = ButtonGroup,\n\tfillProps = {},\n\tbubblesVirtually,\n\t...props\n} ) {\n\treturn (\n\t\t<Slot\n\t\t\tname={ name }\n\t\t\tbubblesVirtually={ bubblesVirtually }\n\t\t\tfillProps={ fillProps }\n\t\t>\n\t\t\t{ ( fills ) => {\n\t\t\t\tif ( ! Children.toArray( fills ).length ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\t// Special handling exists for backward compatibility.\n\t\t\t\t// It ensures that menu items created by plugin authors aren't\n\t\t\t\t// duplicated with automatically injected menu items coming\n\t\t\t\t// from pinnable plugin sidebars.\n\t\t\t\t// @see https://github.com/WordPress/gutenberg/issues/14457\n\t\t\t\tconst initializedByPlugins = [];\n\t\t\t\tChildren.forEach(\n\t\t\t\t\tfills,\n\t\t\t\t\t( {\n\t\t\t\t\t\tprops: { __unstableExplicitMenuItem, __unstableTarget },\n\t\t\t\t\t} ) => {\n\t\t\t\t\t\tif ( __unstableTarget && __unstableExplicitMenuItem ) {\n\t\t\t\t\t\t\tinitializedByPlugins.push( __unstableTarget );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\tconst children = Children.map( fills, ( child ) => {\n\t\t\t\t\tif (\n\t\t\t\t\t\t! child.props.__unstableExplicitMenuItem &&\n\t\t\t\t\t\tinitializedByPlugins.includes(\n\t\t\t\t\t\t\tchild.props.__unstableTarget\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\treturn child;\n\t\t\t\t} );\n\n\t\t\t\treturn <Component { ...props }>{ children }</Component>;\n\t\t\t} }\n\t\t</Slot>\n\t);\n}\n\nfunction ActionItem( { name, as: Component = Button, onClick, ...props } ) {\n\treturn (\n\t\t<Fill name={ name }>\n\t\t\t{ ( { onClick: fpOnClick } ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<Component\n\t\t\t\t\t\tonClick={\n\t\t\t\t\t\t\tonClick || fpOnClick\n\t\t\t\t\t\t\t\t? ( ...args ) => {\n\t\t\t\t\t\t\t\t\t\t( onClick || noop )( ...args );\n\t\t\t\t\t\t\t\t\t\t( fpOnClick || noop )( ...args );\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} }\n\t\t</Fill>\n\t);\n}\n\nActionItem.Slot = ActionItemSlot;\n\nexport default ActionItem;\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAA8C,IAAAE,WAAA,GAAAF,OAAA;AAJ9C;AACA;AACA;;AAIA,MAAMG,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAErB,SAASC,cAAcA,CAAE;EACxBC,IAAI;EACJC,EAAE,EAAEC,SAAS,GAAGC,uBAAW;EAC3BC,SAAS,GAAG,CAAC,CAAC;EACdC,gBAAgB;EAChB,GAAGC;AACJ,CAAC,EAAG;EACH,oBACC,IAAAT,WAAA,CAAAU,GAAA,EAACb,WAAA,CAAAc,IAAI;IACJR,IAAI,EAAGA,IAAM;IACbK,gBAAgB,EAAGA,gBAAkB;IACrCD,SAAS,EAAGA,SAAW;IAAAK,QAAA,EAEnBC,KAAK,IAAM;MACd,IAAK,CAAEC,iBAAQ,CAACC,OAAO,CAAEF,KAAM,CAAC,CAACG,MAAM,EAAG;QACzC,OAAO,IAAI;MACZ;;MAEA;MACA;MACA;MACA;MACA;MACA,MAAMC,oBAAoB,GAAG,EAAE;MAC/BH,iBAAQ,CAACI,OAAO,CACfL,KAAK,EACL,CAAE;QACDJ,KAAK,EAAE;UAAEU,0BAA0B;UAAEC;QAAiB;MACvD,CAAC,KAAM;QACN,IAAKA,gBAAgB,IAAID,0BAA0B,EAAG;UACrDF,oBAAoB,CAACI,IAAI,CAAED,gBAAiB,CAAC;QAC9C;MACD,CACD,CAAC;MACD,MAAMR,QAAQ,GAAGE,iBAAQ,CAACQ,GAAG,CAAET,KAAK,EAAIU,KAAK,IAAM;QAClD,IACC,CAAEA,KAAK,CAACd,KAAK,CAACU,0BAA0B,IACxCF,oBAAoB,CAACO,QAAQ,CAC5BD,KAAK,CAACd,KAAK,CAACW,gBACb,CAAC,EACA;UACD,OAAO,IAAI;QACZ;QACA,OAAOG,KAAK;MACb,CAAE,CAAC;MAEH,oBAAO,IAAAvB,WAAA,CAAAU,GAAA,EAACL,SAAS;QAAA,GAAMI,KAAK;QAAAG,QAAA,EAAKA;MAAQ,CAAa,CAAC;IACxD;EAAC,CACI,CAAC;AAET;AAEA,SAASa,UAAUA,CAAE;EAAEtB,IAAI;EAAEC,EAAE,EAAEC,SAAS,GAAGqB,kBAAM;EAAEC,OAAO;EAAE,GAAGlB;AAAM,CAAC,EAAG;EAC1E,oBACC,IAAAT,WAAA,CAAAU,GAAA,EAACb,WAAA,CAAA+B,IAAI;IAACzB,IAAI,EAAGA,IAAM;IAAAS,QAAA,EAChBA,CAAE;MAAEe,OAAO,EAAEE;IAAU,CAAC,KAAM;MAC/B,oBACC,IAAA7B,WAAA,CAAAU,GAAA,EAACL,SAAS;QACTsB,OAAO,EACNA,OAAO,IAAIE,SAAS,GACjB,CAAE,GAAGC,IAAI,KAAM;UACf,CAAEH,OAAO,IAAI1B,IAAI,EAAI,GAAG6B,IAAK,CAAC;UAC9B,CAAED,SAAS,IAAI5B,IAAI,EAAI,GAAG6B,IAAK,CAAC;QAChC,CAAC,GACDC,SACH;QAAA,GACItB;MAAK,CACV,CAAC;IAEJ;EAAC,CACI,CAAC;AAET;AAEAgB,UAAU,CAACd,IAAI,GAAGT,cAAc;AAAC,IAAA8B,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAElBT,UAAU","ignoreList":[]}
1
+ {"version":3,"names":["_components","require","_element","_jsxRuntime","noop","ActionItemSlot","name","as","Component","MenuGroup","fillProps","bubblesVirtually","props","jsx","Slot","children","fills","Children","toArray","length","initializedByPlugins","forEach","__unstableExplicitMenuItem","__unstableTarget","push","map","child","includes","ActionItem","Button","onClick","Fill","fpOnClick","args","undefined","_default","exports","default"],"sources":["@wordpress/interface/src/components/action-item/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuGroup, Button, Slot, Fill } from '@wordpress/components';\nimport { Children } from '@wordpress/element';\n\nconst noop = () => {};\n\nfunction ActionItemSlot( {\n\tname,\n\tas: Component = MenuGroup,\n\tfillProps = {},\n\tbubblesVirtually,\n\t...props\n} ) {\n\treturn (\n\t\t<Slot\n\t\t\tname={ name }\n\t\t\tbubblesVirtually={ bubblesVirtually }\n\t\t\tfillProps={ fillProps }\n\t\t>\n\t\t\t{ ( fills ) => {\n\t\t\t\tif ( ! Children.toArray( fills ).length ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\t// Special handling exists for backward compatibility.\n\t\t\t\t// It ensures that menu items created by plugin authors aren't\n\t\t\t\t// duplicated with automatically injected menu items coming\n\t\t\t\t// from pinnable plugin sidebars.\n\t\t\t\t// @see https://github.com/WordPress/gutenberg/issues/14457\n\t\t\t\tconst initializedByPlugins = [];\n\t\t\t\tChildren.forEach(\n\t\t\t\t\tfills,\n\t\t\t\t\t( {\n\t\t\t\t\t\tprops: { __unstableExplicitMenuItem, __unstableTarget },\n\t\t\t\t\t} ) => {\n\t\t\t\t\t\tif ( __unstableTarget && __unstableExplicitMenuItem ) {\n\t\t\t\t\t\t\tinitializedByPlugins.push( __unstableTarget );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\tconst children = Children.map( fills, ( child ) => {\n\t\t\t\t\tif (\n\t\t\t\t\t\t! child.props.__unstableExplicitMenuItem &&\n\t\t\t\t\t\tinitializedByPlugins.includes(\n\t\t\t\t\t\t\tchild.props.__unstableTarget\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\treturn child;\n\t\t\t\t} );\n\n\t\t\t\treturn <Component { ...props }>{ children }</Component>;\n\t\t\t} }\n\t\t</Slot>\n\t);\n}\n\nfunction ActionItem( { name, as: Component = Button, onClick, ...props } ) {\n\treturn (\n\t\t<Fill name={ name }>\n\t\t\t{ ( { onClick: fpOnClick } ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<Component\n\t\t\t\t\t\tonClick={\n\t\t\t\t\t\t\tonClick || fpOnClick\n\t\t\t\t\t\t\t\t? ( ...args ) => {\n\t\t\t\t\t\t\t\t\t\t( onClick || noop )( ...args );\n\t\t\t\t\t\t\t\t\t\t( fpOnClick || noop )( ...args );\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} }\n\t\t</Fill>\n\t);\n}\n\nActionItem.Slot = ActionItemSlot;\n\nexport default ActionItem;\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAA8C,IAAAE,WAAA,GAAAF,OAAA;AAJ9C;AACA;AACA;;AAIA,MAAMG,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAErB,SAASC,cAAcA,CAAE;EACxBC,IAAI;EACJC,EAAE,EAAEC,SAAS,GAAGC,qBAAS;EACzBC,SAAS,GAAG,CAAC,CAAC;EACdC,gBAAgB;EAChB,GAAGC;AACJ,CAAC,EAAG;EACH,oBACC,IAAAT,WAAA,CAAAU,GAAA,EAACb,WAAA,CAAAc,IAAI;IACJR,IAAI,EAAGA,IAAM;IACbK,gBAAgB,EAAGA,gBAAkB;IACrCD,SAAS,EAAGA,SAAW;IAAAK,QAAA,EAEnBC,KAAK,IAAM;MACd,IAAK,CAAEC,iBAAQ,CAACC,OAAO,CAAEF,KAAM,CAAC,CAACG,MAAM,EAAG;QACzC,OAAO,IAAI;MACZ;;MAEA;MACA;MACA;MACA;MACA;MACA,MAAMC,oBAAoB,GAAG,EAAE;MAC/BH,iBAAQ,CAACI,OAAO,CACfL,KAAK,EACL,CAAE;QACDJ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,IAAA8B,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAElBT,UAAU","ignoreList":[]}
@@ -2,13 +2,13 @@
2
2
  /**
3
3
  * WordPress dependencies
4
4
  */
5
- import { ButtonGroup, Button, Slot, Fill } from '@wordpress/components';
5
+ import { MenuGroup, Button, Slot, Fill } from '@wordpress/components';
6
6
  import { Children } from '@wordpress/element';
7
7
  import { jsx as _jsx } from "react/jsx-runtime";
8
8
  const noop = () => {};
9
9
  function ActionItemSlot({
10
10
  name,
11
- as: Component = ButtonGroup,
11
+ as: Component = MenuGroup,
12
12
  fillProps = {},
13
13
  bubblesVirtually,
14
14
  ...props
@@ -1 +1 @@
1
- {"version":3,"names":["ButtonGroup","Button","Slot","Fill","Children","jsx","_jsx","noop","ActionItemSlot","name","as","Component","fillProps","bubblesVirtually","props","children","fills","toArray","length","initializedByPlugins","forEach","__unstableExplicitMenuItem","__unstableTarget","push","map","child","includes","ActionItem","onClick","fpOnClick","args","undefined"],"sources":["@wordpress/interface/src/components/action-item/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ButtonGroup, Button, Slot, Fill } from '@wordpress/components';\nimport { Children } from '@wordpress/element';\n\nconst noop = () => {};\n\nfunction ActionItemSlot( {\n\tname,\n\tas: Component = ButtonGroup,\n\tfillProps = {},\n\tbubblesVirtually,\n\t...props\n} ) {\n\treturn (\n\t\t<Slot\n\t\t\tname={ name }\n\t\t\tbubblesVirtually={ bubblesVirtually }\n\t\t\tfillProps={ fillProps }\n\t\t>\n\t\t\t{ ( fills ) => {\n\t\t\t\tif ( ! Children.toArray( fills ).length ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\t// Special handling exists for backward compatibility.\n\t\t\t\t// It ensures that menu items created by plugin authors aren't\n\t\t\t\t// duplicated with automatically injected menu items coming\n\t\t\t\t// from pinnable plugin sidebars.\n\t\t\t\t// @see https://github.com/WordPress/gutenberg/issues/14457\n\t\t\t\tconst initializedByPlugins = [];\n\t\t\t\tChildren.forEach(\n\t\t\t\t\tfills,\n\t\t\t\t\t( {\n\t\t\t\t\t\tprops: { __unstableExplicitMenuItem, __unstableTarget },\n\t\t\t\t\t} ) => {\n\t\t\t\t\t\tif ( __unstableTarget && __unstableExplicitMenuItem ) {\n\t\t\t\t\t\t\tinitializedByPlugins.push( __unstableTarget );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\tconst children = Children.map( fills, ( child ) => {\n\t\t\t\t\tif (\n\t\t\t\t\t\t! child.props.__unstableExplicitMenuItem &&\n\t\t\t\t\t\tinitializedByPlugins.includes(\n\t\t\t\t\t\t\tchild.props.__unstableTarget\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\treturn child;\n\t\t\t\t} );\n\n\t\t\t\treturn <Component { ...props }>{ children }</Component>;\n\t\t\t} }\n\t\t</Slot>\n\t);\n}\n\nfunction ActionItem( { name, as: Component = Button, onClick, ...props } ) {\n\treturn (\n\t\t<Fill name={ name }>\n\t\t\t{ ( { onClick: fpOnClick } ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<Component\n\t\t\t\t\t\tonClick={\n\t\t\t\t\t\t\tonClick || fpOnClick\n\t\t\t\t\t\t\t\t? ( ...args ) => {\n\t\t\t\t\t\t\t\t\t\t( onClick || noop )( ...args );\n\t\t\t\t\t\t\t\t\t\t( fpOnClick || noop )( ...args );\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} }\n\t\t</Fill>\n\t);\n}\n\nActionItem.Slot = ActionItemSlot;\n\nexport default ActionItem;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,MAAM,EAAEC,IAAI,EAAEC,IAAI,QAAQ,uBAAuB;AACvE,SAASC,QAAQ,QAAQ,oB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,GAAGV,MAAM;EAAE2B,OAAO;EAAE,GAAGd;AAAM,CAAC,EAAG;EAC1E,oBACCR,IAAA,CAACH,IAAI;IAACM,IAAI,EAAGA,IAAM;IAAAM,QAAA,EAChBA,CAAE;MAAEa,OAAO,EAAEC;IAAU,CAAC,KAAM;MAC/B,oBACCvB,IAAA,CAACK,SAAS;QACTiB,OAAO,EACNA,OAAO,IAAIC,SAAS,GACjB,CAAE,GAAGC,IAAI,KAAM;UACf,CAAEF,OAAO,IAAIrB,IAAI,EAAI,GAAGuB,IAAK,CAAC;UAC9B,CAAED,SAAS,IAAItB,IAAI,EAAI,GAAGuB,IAAK,CAAC;QAChC,CAAC,GACDC,SACH;QAAA,GACIjB;MAAK,CACV,CAAC;IAEJ;EAAC,CACI,CAAC;AAET;AAEAa,UAAU,CAACzB,IAAI,GAAGM,cAAc;AAEhC,eAAemB,UAAU","ignoreList":[]}
1
+ {"version":3,"names":["MenuGroup","Button","Slot","Fill","Children","jsx","_jsx","noop","ActionItemSlot","name","as","Component","fillProps","bubblesVirtually","props","children","fills","toArray","length","initializedByPlugins","forEach","__unstableExplicitMenuItem","__unstableTarget","push","map","child","includes","ActionItem","onClick","fpOnClick","args","undefined"],"sources":["@wordpress/interface/src/components/action-item/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuGroup, Button, Slot, Fill } from '@wordpress/components';\nimport { Children } from '@wordpress/element';\n\nconst noop = () => {};\n\nfunction ActionItemSlot( {\n\tname,\n\tas: Component = MenuGroup,\n\tfillProps = {},\n\tbubblesVirtually,\n\t...props\n} ) {\n\treturn (\n\t\t<Slot\n\t\t\tname={ name }\n\t\t\tbubblesVirtually={ bubblesVirtually }\n\t\t\tfillProps={ fillProps }\n\t\t>\n\t\t\t{ ( fills ) => {\n\t\t\t\tif ( ! Children.toArray( fills ).length ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\t// Special handling exists for backward compatibility.\n\t\t\t\t// It ensures that menu items created by plugin authors aren't\n\t\t\t\t// duplicated with automatically injected menu items coming\n\t\t\t\t// from pinnable plugin sidebars.\n\t\t\t\t// @see https://github.com/WordPress/gutenberg/issues/14457\n\t\t\t\tconst initializedByPlugins = [];\n\t\t\t\tChildren.forEach(\n\t\t\t\t\tfills,\n\t\t\t\t\t( {\n\t\t\t\t\t\tprops: { __unstableExplicitMenuItem, __unstableTarget },\n\t\t\t\t\t} ) => {\n\t\t\t\t\t\tif ( __unstableTarget && __unstableExplicitMenuItem ) {\n\t\t\t\t\t\t\tinitializedByPlugins.push( __unstableTarget );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\tconst children = Children.map( fills, ( child ) => {\n\t\t\t\t\tif (\n\t\t\t\t\t\t! child.props.__unstableExplicitMenuItem &&\n\t\t\t\t\t\tinitializedByPlugins.includes(\n\t\t\t\t\t\t\tchild.props.__unstableTarget\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\treturn child;\n\t\t\t\t} );\n\n\t\t\t\treturn <Component { ...props }>{ children }</Component>;\n\t\t\t} }\n\t\t</Slot>\n\t);\n}\n\nfunction ActionItem( { name, as: Component = Button, onClick, ...props } ) {\n\treturn (\n\t\t<Fill name={ name }>\n\t\t\t{ ( { onClick: fpOnClick } ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<Component\n\t\t\t\t\t\tonClick={\n\t\t\t\t\t\t\tonClick || fpOnClick\n\t\t\t\t\t\t\t\t? ( ...args ) => {\n\t\t\t\t\t\t\t\t\t\t( onClick || noop )( ...args );\n\t\t\t\t\t\t\t\t\t\t( fpOnClick || noop )( ...args );\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} }\n\t\t</Fill>\n\t);\n}\n\nActionItem.Slot = ActionItemSlot;\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AMG,KAAK;QAAAC,QAAA,EAAKA;MAAQ,CAAa,CAAC;IACxD;EAAC,CACI,CAAC;AAET;AAEA,SAASY,UAAUA,CAAE;EAAElB,IAAI;EAAEC,EAAE,EAAEC,SAAS,GAAGV,MAAM;EAAE2B,OAAO;EAAE,GAAGd;AAAM,CAAC,EAAG;EAC1E,oBACCR,IAAA,CAACH,IAAI;IAACM,IAAI,EAAGA,IAAM;IAAAM,QAAA,EAChBA,CAAE;MAAEa,OAAO,EAAEC;IAAU,CAAC,KAAM;MAC/B,oBACCvB,IAAA,CAACK,SAAS;QACTiB,OAAO,EACNA,OAAO,IAAIC,SAAS,GACjB,CAAE,GAAGC,IAAI,KAAM;UACf,CAAEF,OAAO,IAAIrB,IAAI,EAAI,GAAGuB,IAAK,CAAC;UAC9B,CAAED,SAAS,IAAItB,IAAI,EAAI,GAAGuB,IAAK,CAAC;QAChC,CAAC,GACDC,SACH;QAAA,GACIjB;MAAK,CACV,CAAC;IAEJ;EAAC,CACI,CAAC;AAET;AAEAa,UAAU,CAACzB,IAAI,GAAGM,cAAc;AAEhC,eAAemB,UAAU","ignoreList":[]}
@@ -248,8 +248,7 @@ html.interface-interface-skeleton__html-container {
248
248
  overflow: hidden;
249
249
  }
250
250
 
251
- .interface-interface-skeleton {
252
- /* Set left position when auto-fold is not on the body element. */
251
+ .interface-interface-skeleton { /* Set left position when auto-fold is not on the body element. */
253
252
  right: 0;
254
253
  }
255
254
  @media (min-width: 783px) {
@@ -258,9 +257,7 @@ html.interface-interface-skeleton__html-container {
258
257
  }
259
258
  }
260
259
 
261
- .auto-fold .interface-interface-skeleton {
262
- /* Auto fold is when on smaller breakpoints, nav menu auto collapses. */
263
- }
260
+ .auto-fold .interface-interface-skeleton { /* Auto fold is when on smaller breakpoints, nav menu auto collapses. */ }
264
261
  @media (min-width: 783px) {
265
262
  .auto-fold .interface-interface-skeleton {
266
263
  right: 36px;
@@ -248,8 +248,7 @@ html.interface-interface-skeleton__html-container {
248
248
  overflow: hidden;
249
249
  }
250
250
 
251
- .interface-interface-skeleton {
252
- /* Set left position when auto-fold is not on the body element. */
251
+ .interface-interface-skeleton { /* Set left position when auto-fold is not on the body element. */
253
252
  left: 0;
254
253
  }
255
254
  @media (min-width: 783px) {
@@ -258,9 +257,7 @@ html.interface-interface-skeleton__html-container {
258
257
  }
259
258
  }
260
259
 
261
- .auto-fold .interface-interface-skeleton {
262
- /* Auto fold is when on smaller breakpoints, nav menu auto collapses. */
263
- }
260
+ .auto-fold .interface-interface-skeleton { /* Auto fold is when on smaller breakpoints, nav menu auto collapses. */ }
264
261
  @media (min-width: 783px) {
265
262
  .auto-fold .interface-interface-skeleton {
266
263
  left: 36px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/interface",
3
- "version": "8.3.0",
3
+ "version": "9.0.0",
4
4
  "description": "Interface module for WordPress. The package contains shared functionality across the modern JavaScript-based WordPress screens.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -34,17 +34,17 @@
34
34
  ],
35
35
  "dependencies": {
36
36
  "@babel/runtime": "7.25.7",
37
- "@wordpress/a11y": "*",
38
- "@wordpress/components": "*",
39
- "@wordpress/compose": "*",
40
- "@wordpress/data": "*",
41
- "@wordpress/deprecated": "*",
42
- "@wordpress/element": "*",
43
- "@wordpress/i18n": "*",
44
- "@wordpress/icons": "*",
45
- "@wordpress/plugins": "*",
46
- "@wordpress/preferences": "*",
47
- "@wordpress/viewport": "*",
37
+ "@wordpress/a11y": "^4.15.0",
38
+ "@wordpress/components": "^29.1.0",
39
+ "@wordpress/compose": "^7.15.0",
40
+ "@wordpress/data": "^10.15.0",
41
+ "@wordpress/deprecated": "^4.15.0",
42
+ "@wordpress/element": "^6.15.0",
43
+ "@wordpress/i18n": "^5.15.0",
44
+ "@wordpress/icons": "^10.15.0",
45
+ "@wordpress/plugins": "^7.15.0",
46
+ "@wordpress/preferences": "^4.15.0",
47
+ "@wordpress/viewport": "^6.15.0",
48
48
  "clsx": "^2.1.1"
49
49
  },
50
50
  "peerDependencies": {
@@ -54,5 +54,5 @@
54
54
  "publishConfig": {
55
55
  "access": "public"
56
56
  },
57
- "gitHead": "b432c18934c9db866b6dba7d37517a4e97d642e3"
57
+ "gitHead": "75a65eb8ffc168a92042544052f46d080a71ea45"
58
58
  }
@@ -24,11 +24,11 @@ Property used to change the event bubbling behavior, passed to the `Slot` compon
24
24
 
25
25
  ### as
26
26
 
27
- The component used as the container of the fills. Defaults to the `ButtonGroup` component.
27
+ The component used as the container of the fills. Defaults to the `MenuGroup` component.
28
28
 
29
29
  - Type: `Component`
30
30
  - Required: no
31
- - Default: `ButtonGroup`
31
+ - Default: `MenuGroup`
32
32
 
33
33
  ## ActionItem
34
34
 
@@ -1,14 +1,14 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { ButtonGroup, Button, Slot, Fill } from '@wordpress/components';
4
+ import { MenuGroup, Button, Slot, Fill } from '@wordpress/components';
5
5
  import { Children } from '@wordpress/element';
6
6
 
7
7
  const noop = () => {};
8
8
 
9
9
  function ActionItemSlot( {
10
10
  name,
11
- as: Component = ButtonGroup,
11
+ as: Component = MenuGroup,
12
12
  fillProps = {},
13
13
  bubblesVirtually,
14
14
  ...props