@wordpress/interface 5.10.0 → 5.12.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.
Files changed (76) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/components/action-item/index.js +25 -30
  3. package/build/components/action-item/index.js.map +1 -1
  4. package/build/components/complementary-area/index.js +27 -30
  5. package/build/components/complementary-area/index.js.map +1 -1
  6. package/build/components/complementary-area-header/index.js +6 -7
  7. package/build/components/complementary-area-header/index.js.map +1 -1
  8. package/build/components/complementary-area-more-menu-item/index.js +15 -19
  9. package/build/components/complementary-area-more-menu-item/index.js.map +1 -1
  10. package/build/components/complementary-area-toggle/index.js +9 -10
  11. package/build/components/complementary-area-toggle/index.js.map +1 -1
  12. package/build/components/fullscreen-mode/index.js +3 -4
  13. package/build/components/fullscreen-mode/index.js.map +1 -1
  14. package/build/components/interface-skeleton/index.js +17 -18
  15. package/build/components/interface-skeleton/index.js.map +1 -1
  16. package/build/components/more-menu-dropdown/index.js +11 -12
  17. package/build/components/more-menu-dropdown/index.js.map +1 -1
  18. package/build/components/more-menu-feature-toggle/index.js +9 -10
  19. package/build/components/more-menu-feature-toggle/index.js.map +1 -1
  20. package/build/components/navigable-region/index.js +7 -8
  21. package/build/components/navigable-region/index.js.map +1 -1
  22. package/build/components/pinned-items/index.js +10 -12
  23. package/build/components/pinned-items/index.js.map +1 -1
  24. package/build/components/preferences-modal/index.js +4 -5
  25. package/build/components/preferences-modal/index.js.map +1 -1
  26. package/build/components/preferences-modal-base-option/index.js +7 -8
  27. package/build/components/preferences-modal-base-option/index.js.map +1 -1
  28. package/build/components/preferences-modal-section/index.js +13 -16
  29. package/build/components/preferences-modal-section/index.js.map +1 -1
  30. package/build/components/preferences-modal-tabs/index.js +8 -10
  31. package/build/components/preferences-modal-tabs/index.js.map +1 -1
  32. package/build/store/actions.js +23 -33
  33. package/build/store/actions.js.map +1 -1
  34. package/build/store/reducer.js +1 -4
  35. package/build/store/reducer.js.map +1 -1
  36. package/build/store/selectors.js +3 -7
  37. package/build/store/selectors.js.map +1 -1
  38. package/build-module/components/action-item/index.js +25 -30
  39. package/build-module/components/action-item/index.js.map +1 -1
  40. package/build-module/components/complementary-area/index.js +27 -30
  41. package/build-module/components/complementary-area/index.js.map +1 -1
  42. package/build-module/components/complementary-area-header/index.js +6 -7
  43. package/build-module/components/complementary-area-header/index.js.map +1 -1
  44. package/build-module/components/complementary-area-more-menu-item/index.js +14 -18
  45. package/build-module/components/complementary-area-more-menu-item/index.js.map +1 -1
  46. package/build-module/components/complementary-area-toggle/index.js +9 -10
  47. package/build-module/components/complementary-area-toggle/index.js.map +1 -1
  48. package/build-module/components/fullscreen-mode/index.js +3 -4
  49. package/build-module/components/fullscreen-mode/index.js.map +1 -1
  50. package/build-module/components/interface-skeleton/index.js +17 -18
  51. package/build-module/components/interface-skeleton/index.js.map +1 -1
  52. package/build-module/components/more-menu-dropdown/index.js +10 -11
  53. package/build-module/components/more-menu-dropdown/index.js.map +1 -1
  54. package/build-module/components/more-menu-feature-toggle/index.js +9 -10
  55. package/build-module/components/more-menu-feature-toggle/index.js.map +1 -1
  56. package/build-module/components/navigable-region/index.js +7 -8
  57. package/build-module/components/navigable-region/index.js.map +1 -1
  58. package/build-module/components/pinned-items/index.js +10 -12
  59. package/build-module/components/pinned-items/index.js.map +1 -1
  60. package/build-module/components/preferences-modal/index.js +4 -5
  61. package/build-module/components/preferences-modal/index.js.map +1 -1
  62. package/build-module/components/preferences-modal-base-option/index.js +7 -8
  63. package/build-module/components/preferences-modal-base-option/index.js.map +1 -1
  64. package/build-module/components/preferences-modal-section/index.js +13 -16
  65. package/build-module/components/preferences-modal-section/index.js.map +1 -1
  66. package/build-module/components/preferences-modal-tabs/index.js +8 -10
  67. package/build-module/components/preferences-modal-tabs/index.js.map +1 -1
  68. package/build-module/store/actions.js +23 -33
  69. package/build-module/store/actions.js.map +1 -1
  70. package/build-module/store/reducer.js +1 -4
  71. package/build-module/store/reducer.js.map +1 -1
  72. package/build-module/store/selectors.js +3 -7
  73. package/build-module/store/selectors.js.map +1 -1
  74. package/build-style/style-rtl.css +1 -1
  75. package/build-style/style.css +1 -1
  76. package/package.json +13 -13
package/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 5.12.0 (2023-06-07)
6
+
7
+ ## 5.11.0 (2023-05-24)
8
+
5
9
  ## 5.10.0 (2023-05-10)
6
10
 
7
11
  ## 5.9.0 (2023-04-26)
@@ -18,14 +18,13 @@ var _components = require("@wordpress/components");
18
18
  */
19
19
  const noop = () => {};
20
20
 
21
- function ActionItemSlot(_ref) {
22
- let {
23
- name,
24
- as: Component = _components.ButtonGroup,
25
- fillProps = {},
26
- bubblesVirtually,
27
- ...props
28
- } = _ref;
21
+ function ActionItemSlot({
22
+ name,
23
+ as: Component = _components.ButtonGroup,
24
+ fillProps = {},
25
+ bubblesVirtually,
26
+ ...props
27
+ }) {
29
28
  return (0, _element.createElement)(_components.Slot, {
30
29
  name: name,
31
30
  bubblesVirtually: bubblesVirtually,
@@ -42,14 +41,12 @@ function ActionItemSlot(_ref) {
42
41
 
43
42
  const initializedByPlugins = [];
44
43
 
45
- _element.Children.forEach(fills, _ref2 => {
46
- let {
47
- props: {
48
- __unstableExplicitMenuItem,
49
- __unstableTarget
50
- }
51
- } = _ref2;
52
-
44
+ _element.Children.forEach(fills, ({
45
+ props: {
46
+ __unstableExplicitMenuItem,
47
+ __unstableTarget
48
+ }
49
+ }) => {
53
50
  if (__unstableTarget && __unstableExplicitMenuItem) {
54
51
  initializedByPlugins.push(__unstableTarget);
55
52
  }
@@ -67,23 +64,21 @@ function ActionItemSlot(_ref) {
67
64
  });
68
65
  }
69
66
 
70
- function ActionItem(_ref3) {
71
- let {
72
- name,
73
- as: Component = _components.Button,
74
- onClick,
75
- ...props
76
- } = _ref3;
67
+ function ActionItem({
68
+ name,
69
+ as: Component = _components.Button,
70
+ onClick,
71
+ ...props
72
+ }) {
77
73
  return (0, _element.createElement)(_components.Fill, {
78
74
  name: name
79
- }, _ref4 => {
80
- let {
81
- onClick: fpOnClick
82
- } = _ref4;
75
+ }, ({
76
+ onClick: fpOnClick
77
+ }) => {
83
78
  return (0, _element.createElement)(Component, (0, _extends2.default)({
84
- onClick: onClick || fpOnClick ? function () {
85
- (onClick || noop)(...arguments);
86
- (fpOnClick || noop)(...arguments);
79
+ onClick: onClick || fpOnClick ? (...args) => {
80
+ (onClick || noop)(...args);
81
+ (fpOnClick || noop)(...args);
87
82
  } : undefined
88
83
  }, props));
89
84
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/interface/src/components/action-item/index.js"],"names":["noop","ActionItemSlot","name","as","Component","ButtonGroup","fillProps","bubblesVirtually","props","fills","Children","toArray","length","initializedByPlugins","forEach","__unstableExplicitMenuItem","__unstableTarget","push","children","map","child","includes","ActionItem","Button","onClick","fpOnClick","undefined","Slot"],"mappings":";;;;;;;;;AAIA;;;;AADA;;AAHA;AACA;AACA;AAIA,MAAMA,IAAI,GAAG,MAAM,CAAE,CAArB;;AAEA,SAASC,cAAT,OAMI;AAAA,MANqB;AACxBC,IAAAA,IADwB;AAExBC,IAAAA,EAAE,EAAEC,SAAS,GAAGC,uBAFQ;AAGxBC,IAAAA,SAAS,GAAG,EAHY;AAIxBC,IAAAA,gBAJwB;AAKxB,OAAGC;AALqB,GAMrB;AACH,SACC,4BAAC,gBAAD;AACC,IAAA,IAAI,EAAGN,IADR;AAEC,IAAA,gBAAgB,EAAGK,gBAFpB;AAGC,IAAA,SAAS,EAAGD;AAHb,KAKKG,KAAF,IAAa;AACd,QAAK,CAAEC,kBAASC,OAAT,CAAkBF,KAAlB,EAA0BG,MAAjC,EAA0C;AACzC,aAAO,IAAP;AACA,KAHa,CAKd;AACA;AACA;AACA;AACA;;;AACA,UAAMC,oBAAoB,GAAG,EAA7B;;AACAH,sBAASI,OAAT,CACCL,KADD,EAEC,SAEO;AAAA,UAFL;AACDD,QAAAA,KAAK,EAAE;AAAEO,UAAAA,0BAAF;AAA8BC,UAAAA;AAA9B;AADN,OAEK;;AACN,UAAKA,gBAAgB,IAAID,0BAAzB,EAAsD;AACrDF,QAAAA,oBAAoB,CAACI,IAArB,CAA2BD,gBAA3B;AACA;AACD,KARF;;AAUA,UAAME,QAAQ,GAAGR,kBAASS,GAAT,CAAcV,KAAd,EAAuBW,KAAF,IAAa;AAClD,UACC,CAAEA,KAAK,CAACZ,KAAN,CAAYO,0BAAd,IACAF,oBAAoB,CAACQ,QAArB,CACCD,KAAK,CAACZ,KAAN,CAAYQ,gBADb,CAFD,EAKE;AACD,eAAO,IAAP;AACA;;AACD,aAAOI,KAAP;AACA,KAVgB,CAAjB;;AAYA,WAAO,4BAAC,SAAD,EAAgBZ,KAAhB,EAA0BU,QAA1B,CAAP;AACA,GAvCF,CADD;AA2CA;;AAED,SAASI,UAAT,QAA2E;AAAA,MAAtD;AAAEpB,IAAAA,IAAF;AAAQC,IAAAA,EAAE,EAAEC,SAAS,GAAGmB,kBAAxB;AAAgCC,IAAAA,OAAhC;AAAyC,OAAGhB;AAA5C,GAAsD;AAC1E,SACC,4BAAC,gBAAD;AAAM,IAAA,IAAI,EAAGN;AAAb,KACG,SAA8B;AAAA,QAA5B;AAAEsB,MAAAA,OAAO,EAAEC;AAAX,KAA4B;AAC/B,WACC,4BAAC,SAAD;AACC,MAAA,OAAO,EACND,OAAO,IAAIC,SAAX,GACG,YAAe;AACf,SAAED,OAAO,IAAIxB,IAAb,EAAqB,YAArB;AACA,SAAEyB,SAAS,IAAIzB,IAAf,EAAuB,YAAvB;AACC,OAJJ,GAKG0B;AAPL,OASMlB,KATN,EADD;AAaA,GAfF,CADD;AAmBA;;AAEDc,UAAU,CAACK,IAAX,GAAkB1B,cAAlB;eAEeqB,U","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"]}
1
+ {"version":3,"sources":["@wordpress/interface/src/components/action-item/index.js"],"names":["noop","ActionItemSlot","name","as","Component","ButtonGroup","fillProps","bubblesVirtually","props","fills","Children","toArray","length","initializedByPlugins","forEach","__unstableExplicitMenuItem","__unstableTarget","push","children","map","child","includes","ActionItem","Button","onClick","fpOnClick","args","undefined","Slot"],"mappings":";;;;;;;;;AAIA;;;;AADA;;AAHA;AACA;AACA;AAIA,MAAMA,IAAI,GAAG,MAAM,CAAE,CAArB;;AAEA,SAASC,cAAT,CAAyB;AACxBC,EAAAA,IADwB;AAExBC,EAAAA,EAAE,EAAEC,SAAS,GAAGC,uBAFQ;AAGxBC,EAAAA,SAAS,GAAG,EAHY;AAIxBC,EAAAA,gBAJwB;AAKxB,KAAGC;AALqB,CAAzB,EAMI;AACH,SACC,4BAAC,gBAAD;AACC,IAAA,IAAI,EAAGN,IADR;AAEC,IAAA,gBAAgB,EAAGK,gBAFpB;AAGC,IAAA,SAAS,EAAGD;AAHb,KAKKG,KAAF,IAAa;AACd,QAAK,CAAEC,kBAASC,OAAT,CAAkBF,KAAlB,EAA0BG,MAAjC,EAA0C;AACzC,aAAO,IAAP;AACA,KAHa,CAKd;AACA;AACA;AACA;AACA;;;AACA,UAAMC,oBAAoB,GAAG,EAA7B;;AACAH,sBAASI,OAAT,CACCL,KADD,EAEC,CAAE;AACDD,MAAAA,KAAK,EAAE;AAAEO,QAAAA,0BAAF;AAA8BC,QAAAA;AAA9B;AADN,KAAF,KAEO;AACN,UAAKA,gBAAgB,IAAID,0BAAzB,EAAsD;AACrDF,QAAAA,oBAAoB,CAACI,IAArB,CAA2BD,gBAA3B;AACA;AACD,KARF;;AAUA,UAAME,QAAQ,GAAGR,kBAASS,GAAT,CAAcV,KAAd,EAAuBW,KAAF,IAAa;AAClD,UACC,CAAEA,KAAK,CAACZ,KAAN,CAAYO,0BAAd,IACAF,oBAAoB,CAACQ,QAArB,CACCD,KAAK,CAACZ,KAAN,CAAYQ,gBADb,CAFD,EAKE;AACD,eAAO,IAAP;AACA;;AACD,aAAOI,KAAP;AACA,KAVgB,CAAjB;;AAYA,WAAO,4BAAC,SAAD,EAAgBZ,KAAhB,EAA0BU,QAA1B,CAAP;AACA,GAvCF,CADD;AA2CA;;AAED,SAASI,UAAT,CAAqB;AAAEpB,EAAAA,IAAF;AAAQC,EAAAA,EAAE,EAAEC,SAAS,GAAGmB,kBAAxB;AAAgCC,EAAAA,OAAhC;AAAyC,KAAGhB;AAA5C,CAArB,EAA2E;AAC1E,SACC,4BAAC,gBAAD;AAAM,IAAA,IAAI,EAAGN;AAAb,KACG,CAAE;AAAEsB,IAAAA,OAAO,EAAEC;AAAX,GAAF,KAA8B;AAC/B,WACC,4BAAC,SAAD;AACC,MAAA,OAAO,EACND,OAAO,IAAIC,SAAX,GACG,CAAE,GAAGC,IAAL,KAAe;AACf,SAAEF,OAAO,IAAIxB,IAAb,EAAqB,GAAG0B,IAAxB;AACA,SAAED,SAAS,IAAIzB,IAAf,EAAuB,GAAG0B,IAA1B;AACC,OAJJ,GAKGC;AAPL,OASMnB,KATN,EADD;AAaA,GAfF,CADD;AAmBA;;AAEDc,UAAU,CAACM,IAAX,GAAkB3B,cAAlB;eAEeqB,U","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"]}
@@ -46,22 +46,20 @@ var _store = require("../../store");
46
46
  /**
47
47
  * Internal dependencies
48
48
  */
49
- function ComplementaryAreaSlot(_ref) {
50
- let {
51
- scope,
52
- ...props
53
- } = _ref;
49
+ function ComplementaryAreaSlot({
50
+ scope,
51
+ ...props
52
+ }) {
54
53
  return (0, _element.createElement)(_components.Slot, (0, _extends2.default)({
55
54
  name: `ComplementaryArea/${scope}`
56
55
  }, props));
57
56
  }
58
57
 
59
- function ComplementaryAreaFill(_ref2) {
60
- let {
61
- scope,
62
- children,
63
- className
64
- } = _ref2;
58
+ function ComplementaryAreaFill({
59
+ scope,
60
+ children,
61
+ className
62
+ }) {
65
63
  return (0, _element.createElement)(_components.Fill, {
66
64
  name: `ComplementaryArea/${scope}`
67
65
  }, (0, _element.createElement)("div", {
@@ -105,25 +103,24 @@ function useAdjustComplementaryListener(scope, identifier, activeArea, isActive,
105
103
  }, [isActive, isSmall, scope, identifier, activeArea]);
106
104
  }
107
105
 
108
- function ComplementaryArea(_ref3) {
109
- let {
110
- children,
111
- className,
112
- closeLabel = (0, _i18n.__)('Close plugin'),
113
- identifier,
114
- header,
115
- headerClassName,
116
- icon,
117
- isPinnable = true,
118
- panelClassName,
119
- scope,
120
- name,
121
- smallScreenTitle,
122
- title,
123
- toggleShortcut,
124
- isActiveByDefault,
125
- showIconLabels = false
126
- } = _ref3;
106
+ function ComplementaryArea({
107
+ children,
108
+ className,
109
+ closeLabel = (0, _i18n.__)('Close plugin'),
110
+ identifier,
111
+ header,
112
+ headerClassName,
113
+ icon,
114
+ isPinnable = true,
115
+ panelClassName,
116
+ scope,
117
+ name,
118
+ smallScreenTitle,
119
+ title,
120
+ toggleShortcut,
121
+ isActiveByDefault,
122
+ showIconLabels = false
123
+ }) {
127
124
  const {
128
125
  isLoading,
129
126
  isActive,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/interface/src/components/complementary-area/index.js"],"names":["ComplementaryAreaSlot","scope","props","ComplementaryAreaFill","children","className","useAdjustComplementaryListener","identifier","activeArea","isActive","isSmall","previousIsSmall","shouldOpenWhenNotSmall","enableComplementaryArea","disableComplementaryArea","interfaceStore","current","ComplementaryArea","closeLabel","header","headerClassName","icon","isPinnable","panelClassName","name","smallScreenTitle","title","toggleShortcut","isActiveByDefault","showIconLabels","isLoading","isPinned","isLarge","select","getActiveComplementaryArea","isComplementaryAreaLoading","isItemPinned","_activeArea","viewportStore","isViewportMatch","pinItem","unpinItem","undefined","check","label","shortcut","starFilled","starEmpty","ComplementaryAreaWrapped","Slot"],"mappings":";;;;;;;;;AAYA;;;;AATA;;AAKA;;AACA;;AACA;;AACA;;AAEA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAvBA;AACA;AACA;;AAGA;AACA;AACA;;AAQA;AACA;AACA;AAQA,SAASA,qBAAT,OAAsD;AAAA,MAAtB;AAAEC,IAAAA,KAAF;AAAS,OAAGC;AAAZ,GAAsB;AACrD,SAAO,4BAAC,gBAAD;AAAM,IAAA,IAAI,EAAI,qBAAqBD,KAAO;AAA1C,KAAmDC,KAAnD,EAAP;AACA;;AAED,SAASC,qBAAT,QAAiE;AAAA,MAAjC;AAAEF,IAAAA,KAAF;AAASG,IAAAA,QAAT;AAAmBC,IAAAA;AAAnB,GAAiC;AAChE,SACC,4BAAC,gBAAD;AAAM,IAAA,IAAI,EAAI,qBAAqBJ,KAAO;AAA1C,KACC;AAAK,IAAA,SAAS,EAA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AAD;AACC,IAAA,SAAS,EAAG,yBACX,8BADW,EAEXJ,SAFW,CADb;AAKC,IAAA,KAAK,EAAGJ;AALT,KAOC,4BAAC,gCAAD;AACC,IAAA,SAAS,EAAGmB,eADb;AAEC,IAAA,UAAU,EAAGF,UAFd;AAGC,IAAA,OAAO,EAAG,MAAMJ,wBAAwB,CAAEb,KAAF,CAHzC;AAIC,IAAA,gBAAgB,EAAGwB,gBAJpB;AAKC,IAAA,iBAAiB,EAAG;AACnBmB,MAAAA,KAAK,EAAE1B,UADY;AAEnB2B,MAAAA,QAAQ,EAAElB,cAFS;AAGnB1B,MAAAA,KAHmB;AAInBM,MAAAA;AAJmB;AALrB,KAYGY,MAAM,IACP,qDACC,4CAAUO,KAAV,CADD,EAEGJ,UAAU,IACX,4BAAC,kBAAD;AACC,IAAA,SAAS,EAAC,8CADX;AAEC,IAAA,IAAI,EACHS,QAAQ,GAAGe,iBAAH,GAAgBC,gBAH1B;AAKC,IAAA,KAAK,EACJhB,QAAQ,GACL,cAAI,oBAAJ,CADK,GAEL,cAAI,gBAAJ,CARL;AAUC,IAAA,OAAO,EAAG,MACT,CAAEA,QAAQ,GAAGU,SAAH,GAAeD,OAAzB,EACCvC,KADD,EAECM,UAFD,CAXF;AAgBC,IAAA,SAAS,EAAGwB,QAhBb;AAiBC,qBAAgBA;AAjBjB,IAHF,CAbF,CAPD,EA8CC,4BAAC,iBAAD;AAAO,IAAA,SAAS,EAAGR;AAAnB,KAAsCnB,QAAtC,CA9CD,CA9BF,CADD;AAkFA;;AAED,MAAM4C,wBAAwB,GAC7B,uCAA8B/B,iBAA9B,CADD;AAGA+B,wBAAwB,CAACC,IAAzB,GAAgCjD,qBAAhC;eAEegD,wB","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Button, Panel, Slot, Fill } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { check, starEmpty, starFilled } from '@wordpress/icons';\nimport { useEffect, useRef } from '@wordpress/element';\nimport { store as viewportStore } from '@wordpress/viewport';\n\n/**\n * Internal dependencies\n */\nimport ComplementaryAreaHeader from '../complementary-area-header';\nimport ComplementaryAreaMoreMenuItem from '../complementary-area-more-menu-item';\nimport ComplementaryAreaToggle from '../complementary-area-toggle';\nimport withComplementaryAreaContext from '../complementary-area-context';\nimport PinnedItems from '../pinned-items';\nimport { store as interfaceStore } from '../../store';\n\nfunction ComplementaryAreaSlot( { scope, ...props } ) {\n\treturn <Slot name={ `ComplementaryArea/${ scope }` } { ...props } />;\n}\n\nfunction ComplementaryAreaFill( { scope, children, className } ) {\n\treturn (\n\t\t<Fill name={ `ComplementaryArea/${ scope }` }>\n\t\t\t<div className={ className }>{ children }</div>\n\t\t</Fill>\n\t);\n}\n\nfunction useAdjustComplementaryListener(\n\tscope,\n\tidentifier,\n\tactiveArea,\n\tisActive,\n\tisSmall\n) {\n\tconst previousIsSmall = useRef( false );\n\tconst shouldOpenWhenNotSmall = useRef( false );\n\tconst { enableComplementaryArea, disableComplementaryArea } =\n\t\tuseDispatch( interfaceStore );\n\tuseEffect( () => {\n\t\t// If the complementary area is active and the editor is switching from\n\t\t// a big to a small window size.\n\t\tif ( isActive && isSmall && ! previousIsSmall.current ) {\n\t\t\tdisableComplementaryArea( scope );\n\t\t\t// Flag the complementary area to be reopened when the window size\n\t\t\t// goes from small to big.\n\t\t\tshouldOpenWhenNotSmall.current = true;\n\t\t} else if (\n\t\t\t// If there is a flag indicating the complementary area should be\n\t\t\t// enabled when we go from small to big window size and we are going\n\t\t\t// from a small to big window size.\n\t\t\tshouldOpenWhenNotSmall.current &&\n\t\t\t! isSmall &&\n\t\t\tpreviousIsSmall.current\n\t\t) {\n\t\t\t// Remove the flag indicating the complementary area should be\n\t\t\t// enabled.\n\t\t\tshouldOpenWhenNotSmall.current = false;\n\t\t\tenableComplementaryArea( scope, identifier );\n\t\t} else if (\n\t\t\t// If the flag is indicating the current complementary should be\n\t\t\t// reopened but another complementary area becomes active, remove\n\t\t\t// the flag.\n\t\t\tshouldOpenWhenNotSmall.current &&\n\t\t\tactiveArea &&\n\t\t\tactiveArea !== identifier\n\t\t) {\n\t\t\tshouldOpenWhenNotSmall.current = false;\n\t\t}\n\t\tif ( isSmall !== previousIsSmall.current ) {\n\t\t\tpreviousIsSmall.current = isSmall;\n\t\t}\n\t}, [ isActive, isSmall, scope, identifier, activeArea ] );\n}\n\nfunction ComplementaryArea( {\n\tchildren,\n\tclassName,\n\tcloseLabel = __( 'Close plugin' ),\n\tidentifier,\n\theader,\n\theaderClassName,\n\ticon,\n\tisPinnable = true,\n\tpanelClassName,\n\tscope,\n\tname,\n\tsmallScreenTitle,\n\ttitle,\n\ttoggleShortcut,\n\tisActiveByDefault,\n\tshowIconLabels = false,\n} ) {\n\tconst { isLoading, isActive, isPinned, activeArea, isSmall, isLarge } =\n\t\tuseSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\tgetActiveComplementaryArea,\n\t\t\t\t\tisComplementaryAreaLoading,\n\t\t\t\t\tisItemPinned,\n\t\t\t\t} = select( interfaceStore );\n\n\t\t\t\tconst _activeArea = getActiveComplementaryArea( scope );\n\n\t\t\t\treturn {\n\t\t\t\t\tisLoading: isComplementaryAreaLoading( scope ),\n\t\t\t\t\tisActive: _activeArea === identifier,\n\t\t\t\t\tisPinned: isItemPinned( scope, identifier ),\n\t\t\t\t\tactiveArea: _activeArea,\n\t\t\t\t\tisSmall:\n\t\t\t\t\t\tselect( viewportStore ).isViewportMatch( '< medium' ),\n\t\t\t\t\tisLarge: select( viewportStore ).isViewportMatch( 'large' ),\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ identifier, scope ]\n\t\t);\n\tuseAdjustComplementaryListener(\n\t\tscope,\n\t\tidentifier,\n\t\tactiveArea,\n\t\tisActive,\n\t\tisSmall\n\t);\n\tconst {\n\t\tenableComplementaryArea,\n\t\tdisableComplementaryArea,\n\t\tpinItem,\n\t\tunpinItem,\n\t} = useDispatch( interfaceStore );\n\n\tuseEffect( () => {\n\t\t// Set initial visibility: For large screens, enable if it's active by\n\t\t// default. For small screens, always initially disable.\n\t\tif ( isActiveByDefault && activeArea === undefined && ! isSmall ) {\n\t\t\tenableComplementaryArea( scope, identifier );\n\t\t} else if ( activeArea === undefined && isSmall ) {\n\t\t\tdisableComplementaryArea( scope, identifier );\n\t\t}\n\t}, [ activeArea, isActiveByDefault, scope, identifier, isSmall ] );\n\n\treturn (\n\t\t<>\n\t\t\t{ isPinnable && (\n\t\t\t\t<PinnedItems scope={ scope }>\n\t\t\t\t\t{ isPinned && (\n\t\t\t\t\t\t<ComplementaryAreaToggle\n\t\t\t\t\t\t\tscope={ scope }\n\t\t\t\t\t\t\tidentifier={ identifier }\n\t\t\t\t\t\t\tisPressed={\n\t\t\t\t\t\t\t\tisActive && ( ! showIconLabels || isLarge )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\taria-expanded={ isActive }\n\t\t\t\t\t\t\taria-disabled={ isLoading }\n\t\t\t\t\t\t\tlabel={ title }\n\t\t\t\t\t\t\ticon={ showIconLabels ? check : icon }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</PinnedItems>\n\t\t\t) }\n\t\t\t{ name && isPinnable && (\n\t\t\t\t<ComplementaryAreaMoreMenuItem\n\t\t\t\t\ttarget={ name }\n\t\t\t\t\tscope={ scope }\n\t\t\t\t\ticon={ icon }\n\t\t\t\t>\n\t\t\t\t\t{ title }\n\t\t\t\t</ComplementaryAreaMoreMenuItem>\n\t\t\t) }\n\t\t\t{ isActive && (\n\t\t\t\t<ComplementaryAreaFill\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'interface-complementary-area',\n\t\t\t\t\t\tclassName\n\t\t\t\t\t) }\n\t\t\t\t\tscope={ scope }\n\t\t\t\t>\n\t\t\t\t\t<ComplementaryAreaHeader\n\t\t\t\t\t\tclassName={ headerClassName }\n\t\t\t\t\t\tcloseLabel={ closeLabel }\n\t\t\t\t\t\tonClose={ () => disableComplementaryArea( scope ) }\n\t\t\t\t\t\tsmallScreenTitle={ smallScreenTitle }\n\t\t\t\t\t\ttoggleButtonProps={ {\n\t\t\t\t\t\t\tlabel: closeLabel,\n\t\t\t\t\t\t\tshortcut: toggleShortcut,\n\t\t\t\t\t\t\tscope,\n\t\t\t\t\t\t\tidentifier,\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ header || (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<strong>{ title }</strong>\n\t\t\t\t\t\t\t\t{ isPinnable && (\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tclassName=\"interface-complementary-area__pin-unpin-item\"\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\tisPinned ? starFilled : starEmpty\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\t\t\t\tisPinned\n\t\t\t\t\t\t\t\t\t\t\t\t? __( 'Unpin from toolbar' )\n\t\t\t\t\t\t\t\t\t\t\t\t: __( 'Pin to toolbar' )\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\t\t\t( isPinned ? unpinItem : pinItem )(\n\t\t\t\t\t\t\t\t\t\t\t\tscope,\n\t\t\t\t\t\t\t\t\t\t\t\tidentifier\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tisPressed={ isPinned }\n\t\t\t\t\t\t\t\t\t\taria-expanded={ isPinned }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</ComplementaryAreaHeader>\n\t\t\t\t\t<Panel className={ panelClassName }>{ children }</Panel>\n\t\t\t\t</ComplementaryAreaFill>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nconst ComplementaryAreaWrapped =\n\twithComplementaryAreaContext( ComplementaryArea );\n\nComplementaryAreaWrapped.Slot = ComplementaryAreaSlot;\n\nexport default ComplementaryAreaWrapped;\n"]}
1
+ {"version":3,"sources":["@wordpress/interface/src/components/complementary-area/index.js"],"names":["ComplementaryAreaSlot","scope","props","ComplementaryAreaFill","children","className","useAdjustComplementaryListener","identifier","activeArea","isActive","isSmall","previousIsSmall","shouldOpenWhenNotSmall","enableComplementaryArea","disableComplementaryArea","interfaceStore","current","ComplementaryArea","closeLabel","header","headerClassName","icon","isPinnable","panelClassName","name","smallScreenTitle","title","toggleShortcut","isActiveByDefault","showIconLabels","isLoading","isPinned","isLarge","select","getActiveComplementaryArea","isComplementaryAreaLoading","isItemPinned","_activeArea","viewportStore","isViewportMatch","pinItem","unpinItem","undefined","check","label","shortcut","starFilled","starEmpty","ComplementaryAreaWrapped","Slot"],"mappings":";;;;;;;;;AAYA;;;;AATA;;AAKA;;AACA;;AACA;;AACA;;AAEA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAvBA;AACA;AACA;;AAGA;AACA;AACA;;AAQA;AACA;AACA;AAQA,SAASA,qBAAT,CAAgC;AAAEC,EAAAA,KAAF;AAAS,KAAGC;AAAZ,CAAhC,EAAsD;AACrD,SAAO,4BAAC,gBAAD;AAAM,IAAA,IAAI,EAAI,qBAAqBD,KAAO;AAA1C,KAAmDC,KAAnD,EAAP;AACA;;AAED,SAASC,qBAAT,CAAgC;AAAEF,EAAAA,KAAF;AAASG,EAAAA,QAAT;AAAmBC,EAAAA;AAAnB,CAAhC,EAAiE;AAChE,SACC,4BAAC,gBAAD;AAAM,IAAA,IAAI,EAAI,qBAAqBJ,KAAO;AAA1C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AQ,IACT,4BAAC,qBAAD;AACC,IAAA,SAAS,EAAG,yBACX,8BADW,EAEXJ,SAFW,CADb;AAKC,IAAA,KAAK,EAAGJ;AALT,KAOC,4BAAC,gCAAD;AACC,IAAA,SAAS,EAAGmB,eADb;AAEC,IAAA,UAAU,EAAGF,UAFd;AAGC,IAAA,OAAO,EAAG,MAAMJ,wBAAwB,CAAEb,KAAF,CAHzC;AAIC,IAAA,gBAAgB,EAAGwB,gBAJpB;AAKC,IAAA,iBAAiB,EAAG;AACnBmB,MAAAA,KAAK,EAAE1B,UADY;AAEnB2B,MAAAA,QAAQ,EAAElB,cAFS;AAGnB1B,MAAAA,KAHmB;AAInBM,MAAAA;AAJmB;AALrB,KAYGY,MAAM,IACP,qDACC,4CAAUO,KAAV,CADD,EAEGJ,UAAU,IACX,4BAAC,kBAAD;AACC,IAAA,SAAS,EAAC,8CADX;AAEC,IAAA,IAAI,EACHS,QAAQ,GAAGe,iBAAH,GAAgBC,gBAH1B;AAKC,IAAA,KAAK,EACJhB,QAAQ,GACL,cAAI,oBAAJ,CADK,GAEL,cAAI,gBAAJ,CARL;AAUC,IAAA,OAAO,EAAG,MACT,CAAEA,QAAQ,GAAGU,SAAH,GAAeD,OAAzB,EACCvC,KADD,EAECM,UAFD,CAXF;AAgBC,IAAA,SAAS,EAAGwB,QAhBb;AAiBC,qBAAgBA;AAjBjB,IAHF,CAbF,CAPD,EA8CC,4BAAC,iBAAD;AAAO,IAAA,SAAS,EAAGR;AAAnB,KAAsCnB,QAAtC,CA9CD,CA9BF,CADD;AAkFA;;AAED,MAAM4C,wBAAwB,GAC7B,uCAA8B/B,iBAA9B,CADD;AAGA+B,wBAAwB,CAACC,IAAzB,GAAgCjD,qBAAhC;eAEegD,wB","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Button, Panel, Slot, Fill } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { check, starEmpty, starFilled } from '@wordpress/icons';\nimport { useEffect, useRef } from '@wordpress/element';\nimport { store as viewportStore } from '@wordpress/viewport';\n\n/**\n * Internal dependencies\n */\nimport ComplementaryAreaHeader from '../complementary-area-header';\nimport ComplementaryAreaMoreMenuItem from '../complementary-area-more-menu-item';\nimport ComplementaryAreaToggle from '../complementary-area-toggle';\nimport withComplementaryAreaContext from '../complementary-area-context';\nimport PinnedItems from '../pinned-items';\nimport { store as interfaceStore } from '../../store';\n\nfunction ComplementaryAreaSlot( { scope, ...props } ) {\n\treturn <Slot name={ `ComplementaryArea/${ scope }` } { ...props } />;\n}\n\nfunction ComplementaryAreaFill( { scope, children, className } ) {\n\treturn (\n\t\t<Fill name={ `ComplementaryArea/${ scope }` }>\n\t\t\t<div className={ className }>{ children }</div>\n\t\t</Fill>\n\t);\n}\n\nfunction useAdjustComplementaryListener(\n\tscope,\n\tidentifier,\n\tactiveArea,\n\tisActive,\n\tisSmall\n) {\n\tconst previousIsSmall = useRef( false );\n\tconst shouldOpenWhenNotSmall = useRef( false );\n\tconst { enableComplementaryArea, disableComplementaryArea } =\n\t\tuseDispatch( interfaceStore );\n\tuseEffect( () => {\n\t\t// If the complementary area is active and the editor is switching from\n\t\t// a big to a small window size.\n\t\tif ( isActive && isSmall && ! previousIsSmall.current ) {\n\t\t\tdisableComplementaryArea( scope );\n\t\t\t// Flag the complementary area to be reopened when the window size\n\t\t\t// goes from small to big.\n\t\t\tshouldOpenWhenNotSmall.current = true;\n\t\t} else if (\n\t\t\t// If there is a flag indicating the complementary area should be\n\t\t\t// enabled when we go from small to big window size and we are going\n\t\t\t// from a small to big window size.\n\t\t\tshouldOpenWhenNotSmall.current &&\n\t\t\t! isSmall &&\n\t\t\tpreviousIsSmall.current\n\t\t) {\n\t\t\t// Remove the flag indicating the complementary area should be\n\t\t\t// enabled.\n\t\t\tshouldOpenWhenNotSmall.current = false;\n\t\t\tenableComplementaryArea( scope, identifier );\n\t\t} else if (\n\t\t\t// If the flag is indicating the current complementary should be\n\t\t\t// reopened but another complementary area becomes active, remove\n\t\t\t// the flag.\n\t\t\tshouldOpenWhenNotSmall.current &&\n\t\t\tactiveArea &&\n\t\t\tactiveArea !== identifier\n\t\t) {\n\t\t\tshouldOpenWhenNotSmall.current = false;\n\t\t}\n\t\tif ( isSmall !== previousIsSmall.current ) {\n\t\t\tpreviousIsSmall.current = isSmall;\n\t\t}\n\t}, [ isActive, isSmall, scope, identifier, activeArea ] );\n}\n\nfunction ComplementaryArea( {\n\tchildren,\n\tclassName,\n\tcloseLabel = __( 'Close plugin' ),\n\tidentifier,\n\theader,\n\theaderClassName,\n\ticon,\n\tisPinnable = true,\n\tpanelClassName,\n\tscope,\n\tname,\n\tsmallScreenTitle,\n\ttitle,\n\ttoggleShortcut,\n\tisActiveByDefault,\n\tshowIconLabels = false,\n} ) {\n\tconst { isLoading, isActive, isPinned, activeArea, isSmall, isLarge } =\n\t\tuseSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\tgetActiveComplementaryArea,\n\t\t\t\t\tisComplementaryAreaLoading,\n\t\t\t\t\tisItemPinned,\n\t\t\t\t} = select( interfaceStore );\n\n\t\t\t\tconst _activeArea = getActiveComplementaryArea( scope );\n\n\t\t\t\treturn {\n\t\t\t\t\tisLoading: isComplementaryAreaLoading( scope ),\n\t\t\t\t\tisActive: _activeArea === identifier,\n\t\t\t\t\tisPinned: isItemPinned( scope, identifier ),\n\t\t\t\t\tactiveArea: _activeArea,\n\t\t\t\t\tisSmall:\n\t\t\t\t\t\tselect( viewportStore ).isViewportMatch( '< medium' ),\n\t\t\t\t\tisLarge: select( viewportStore ).isViewportMatch( 'large' ),\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ identifier, scope ]\n\t\t);\n\tuseAdjustComplementaryListener(\n\t\tscope,\n\t\tidentifier,\n\t\tactiveArea,\n\t\tisActive,\n\t\tisSmall\n\t);\n\tconst {\n\t\tenableComplementaryArea,\n\t\tdisableComplementaryArea,\n\t\tpinItem,\n\t\tunpinItem,\n\t} = useDispatch( interfaceStore );\n\n\tuseEffect( () => {\n\t\t// Set initial visibility: For large screens, enable if it's active by\n\t\t// default. For small screens, always initially disable.\n\t\tif ( isActiveByDefault && activeArea === undefined && ! isSmall ) {\n\t\t\tenableComplementaryArea( scope, identifier );\n\t\t} else if ( activeArea === undefined && isSmall ) {\n\t\t\tdisableComplementaryArea( scope, identifier );\n\t\t}\n\t}, [ activeArea, isActiveByDefault, scope, identifier, isSmall ] );\n\n\treturn (\n\t\t<>\n\t\t\t{ isPinnable && (\n\t\t\t\t<PinnedItems scope={ scope }>\n\t\t\t\t\t{ isPinned && (\n\t\t\t\t\t\t<ComplementaryAreaToggle\n\t\t\t\t\t\t\tscope={ scope }\n\t\t\t\t\t\t\tidentifier={ identifier }\n\t\t\t\t\t\t\tisPressed={\n\t\t\t\t\t\t\t\tisActive && ( ! showIconLabels || isLarge )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\taria-expanded={ isActive }\n\t\t\t\t\t\t\taria-disabled={ isLoading }\n\t\t\t\t\t\t\tlabel={ title }\n\t\t\t\t\t\t\ticon={ showIconLabels ? check : icon }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</PinnedItems>\n\t\t\t) }\n\t\t\t{ name && isPinnable && (\n\t\t\t\t<ComplementaryAreaMoreMenuItem\n\t\t\t\t\ttarget={ name }\n\t\t\t\t\tscope={ scope }\n\t\t\t\t\ticon={ icon }\n\t\t\t\t>\n\t\t\t\t\t{ title }\n\t\t\t\t</ComplementaryAreaMoreMenuItem>\n\t\t\t) }\n\t\t\t{ isActive && (\n\t\t\t\t<ComplementaryAreaFill\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'interface-complementary-area',\n\t\t\t\t\t\tclassName\n\t\t\t\t\t) }\n\t\t\t\t\tscope={ scope }\n\t\t\t\t>\n\t\t\t\t\t<ComplementaryAreaHeader\n\t\t\t\t\t\tclassName={ headerClassName }\n\t\t\t\t\t\tcloseLabel={ closeLabel }\n\t\t\t\t\t\tonClose={ () => disableComplementaryArea( scope ) }\n\t\t\t\t\t\tsmallScreenTitle={ smallScreenTitle }\n\t\t\t\t\t\ttoggleButtonProps={ {\n\t\t\t\t\t\t\tlabel: closeLabel,\n\t\t\t\t\t\t\tshortcut: toggleShortcut,\n\t\t\t\t\t\t\tscope,\n\t\t\t\t\t\t\tidentifier,\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ header || (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<strong>{ title }</strong>\n\t\t\t\t\t\t\t\t{ isPinnable && (\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tclassName=\"interface-complementary-area__pin-unpin-item\"\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\tisPinned ? starFilled : starEmpty\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\t\t\t\tisPinned\n\t\t\t\t\t\t\t\t\t\t\t\t? __( 'Unpin from toolbar' )\n\t\t\t\t\t\t\t\t\t\t\t\t: __( 'Pin to toolbar' )\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\t\t\t( isPinned ? unpinItem : pinItem )(\n\t\t\t\t\t\t\t\t\t\t\t\tscope,\n\t\t\t\t\t\t\t\t\t\t\t\tidentifier\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tisPressed={ isPinned }\n\t\t\t\t\t\t\t\t\t\taria-expanded={ isPinned }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</ComplementaryAreaHeader>\n\t\t\t\t\t<Panel className={ panelClassName }>{ children }</Panel>\n\t\t\t\t</ComplementaryAreaFill>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nconst ComplementaryAreaWrapped =\n\twithComplementaryAreaContext( ComplementaryArea );\n\nComplementaryAreaWrapped.Slot = ComplementaryAreaSlot;\n\nexport default ComplementaryAreaWrapped;\n"]}
@@ -28,13 +28,12 @@ var _complementaryAreaToggle = _interopRequireDefault(require("../complementary-
28
28
  /**
29
29
  * Internal dependencies
30
30
  */
31
- const ComplementaryAreaHeader = _ref => {
32
- let {
33
- smallScreenTitle,
34
- children,
35
- className,
36
- toggleButtonProps
37
- } = _ref;
31
+ const ComplementaryAreaHeader = ({
32
+ smallScreenTitle,
33
+ children,
34
+ className,
35
+ toggleButtonProps
36
+ }) => {
38
37
  const toggleButton = (0, _element.createElement)(_complementaryAreaToggle.default, (0, _extends2.default)({
39
38
  icon: _icons.closeSmall
40
39
  }, toggleButtonProps));
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/interface/src/components/complementary-area-header/index.js"],"names":["ComplementaryAreaHeader","smallScreenTitle","children","className","toggleButtonProps","toggleButton","closeSmall"],"mappings":";;;;;;;;;;;;;AAGA;;AAKA;;AAKA;;AAbA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AAGA,MAAMA,uBAAuB,GAAG,QAKzB;AAAA,MAL2B;AACjCC,IAAAA,gBADiC;AAEjCC,IAAAA,QAFiC;AAGjCC,IAAAA,SAHiC;AAIjCC,IAAAA;AAJiC,GAK3B;AACN,QAAMC,YAAY,GACjB,4BAAC,gCAAD;AAAyB,IAAA,IAAI,EAAGC;AAAhC,KAAkDF,iBAAlD,EADD;AAGA,SACC,qDACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGH,gBAAgB,IACjB;AAAM,IAAA,SAAS,EAAC;AAAhB,KACGA,gBADH,CAFF,EAMGI,YANH,CADD,EASC;AACC,IAAA,SAAS,EAAG,yBACX,0BADW,EAEX,qCAFW,EAGXF,SAHW,CADb;AAMC,IAAA,QAAQ,EAAG,CAAC;AANb,KAQGD,QARH,EASGG,YATH,CATD,CADD;AAuBA,CAhCD;;eAkCeL,uB","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { closeSmall } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport ComplementaryAreaToggle from '../complementary-area-toggle';\n\nconst ComplementaryAreaHeader = ( {\n\tsmallScreenTitle,\n\tchildren,\n\tclassName,\n\ttoggleButtonProps,\n} ) => {\n\tconst toggleButton = (\n\t\t<ComplementaryAreaToggle icon={ closeSmall } { ...toggleButtonProps } />\n\t);\n\treturn (\n\t\t<>\n\t\t\t<div className=\"components-panel__header interface-complementary-area-header__small\">\n\t\t\t\t{ smallScreenTitle && (\n\t\t\t\t\t<span className=\"interface-complementary-area-header__small-title\">\n\t\t\t\t\t\t{ smallScreenTitle }\n\t\t\t\t\t</span>\n\t\t\t\t) }\n\t\t\t\t{ toggleButton }\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'components-panel__header',\n\t\t\t\t\t'interface-complementary-area-header',\n\t\t\t\t\tclassName\n\t\t\t\t) }\n\t\t\t\ttabIndex={ -1 }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t\t{ toggleButton }\n\t\t\t</div>\n\t\t</>\n\t);\n};\n\nexport default ComplementaryAreaHeader;\n"]}
1
+ {"version":3,"sources":["@wordpress/interface/src/components/complementary-area-header/index.js"],"names":["ComplementaryAreaHeader","smallScreenTitle","children","className","toggleButtonProps","toggleButton","closeSmall"],"mappings":";;;;;;;;;;;;;AAGA;;AAKA;;AAKA;;AAbA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AAGA,MAAMA,uBAAuB,GAAG,CAAE;AACjCC,EAAAA,gBADiC;AAEjCC,EAAAA,QAFiC;AAGjCC,EAAAA,SAHiC;AAIjCC,EAAAA;AAJiC,CAAF,KAKzB;AACN,QAAMC,YAAY,GACjB,4BAAC,gCAAD;AAAyB,IAAA,IAAI,EAAGC;AAAhC,KAAkDF,iBAAlD,EADD;AAGA,SACC,qDACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGH,gBAAgB,IACjB;AAAM,IAAA,SAAS,EAAC;AAAhB,KACGA,gBADH,CAFF,EAMGI,YANH,CADD,EASC;AACC,IAAA,SAAS,EAAG,yBACX,0BADW,EAEX,qCAFW,EAGXF,SAHW,CADb;AAMC,IAAA,QAAQ,EAAG,CAAC;AANb,KAQGD,QARH,EASGG,YATH,CATD,CADD;AAuBA,CAhCD;;eAkCeL,uB","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { closeSmall } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport ComplementaryAreaToggle from '../complementary-area-toggle';\n\nconst ComplementaryAreaHeader = ( {\n\tsmallScreenTitle,\n\tchildren,\n\tclassName,\n\ttoggleButtonProps,\n} ) => {\n\tconst toggleButton = (\n\t\t<ComplementaryAreaToggle icon={ closeSmall } { ...toggleButtonProps } />\n\t);\n\treturn (\n\t\t<>\n\t\t\t<div className=\"components-panel__header interface-complementary-area-header__small\">\n\t\t\t\t{ smallScreenTitle && (\n\t\t\t\t\t<span className=\"interface-complementary-area-header__small-title\">\n\t\t\t\t\t\t{ smallScreenTitle }\n\t\t\t\t\t</span>\n\t\t\t\t) }\n\t\t\t\t{ toggleButton }\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'components-panel__header',\n\t\t\t\t\t'interface-complementary-area-header',\n\t\t\t\t\tclassName\n\t\t\t\t) }\n\t\t\t\ttabIndex={ -1 }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t\t{ toggleButton }\n\t\t\t</div>\n\t\t</>\n\t);\n};\n\nexport default ComplementaryAreaHeader;\n"]}
@@ -26,25 +26,21 @@ var _actionItem = _interopRequireDefault(require("../action-item"));
26
26
  /**
27
27
  * Internal dependencies
28
28
  */
29
- const PluginsMenuItem = _ref => {
30
- let {
31
- // Menu item is marked with unstable prop for backward compatibility.
32
- // They are removed so they don't leak to DOM elements.
33
- // @see https://github.com/WordPress/gutenberg/issues/14457
34
- __unstableExplicitMenuItem,
35
- __unstableTarget,
36
- ...restProps
37
- } = _ref;
38
- return (0, _element.createElement)(_components.MenuItem, restProps);
39
- };
40
-
41
- function ComplementaryAreaMoreMenuItem(_ref2) {
42
- let {
43
- scope,
44
- target,
45
- __unstableExplicitMenuItem,
46
- ...props
47
- } = _ref2;
29
+ const PluginsMenuItem = ({
30
+ // Menu item is marked with unstable prop for backward compatibility.
31
+ // They are removed so they don't leak to DOM elements.
32
+ // @see https://github.com/WordPress/gutenberg/issues/14457
33
+ __unstableExplicitMenuItem,
34
+ __unstableTarget,
35
+ ...restProps
36
+ }) => (0, _element.createElement)(_components.MenuItem, restProps);
37
+
38
+ function ComplementaryAreaMoreMenuItem({
39
+ scope,
40
+ target,
41
+ __unstableExplicitMenuItem,
42
+ ...props
43
+ }) {
48
44
  return (0, _element.createElement)(_complementaryAreaToggle.default, (0, _extends2.default)({
49
45
  as: toggleProps => {
50
46
  return (0, _element.createElement)(_actionItem.default, (0, _extends2.default)({
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/interface/src/components/complementary-area-more-menu-item/index.js"],"names":["PluginsMenuItem","__unstableExplicitMenuItem","__unstableTarget","restProps","ComplementaryAreaMoreMenuItem","scope","target","props","toggleProps","check"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AAVA;AACA;AACA;;AAIA;AACA;AACA;AAIA,MAAMA,eAAe,GAAG;AAAA,MAAE;AACzB;AACA;AACA;AACAC,IAAAA,0BAJyB;AAKzBC,IAAAA,gBALyB;AAMzB,OAAGC;AANsB,GAAF;AAAA,SAOjB,4BAAC,oBAAD,EAAeA,SAAf,CAPiB;AAAA,CAAxB;;AASe,SAASC,6BAAT,QAKX;AAAA,MALmD;AACtDC,IAAAA,KADsD;AAEtDC,IAAAA,MAFsD;AAGtDL,IAAAA,0BAHsD;AAItD,OAAGM;AAJmD,GAKnD;AACH,SACC,4BAAC,gCAAD;AACC,IAAA,EAAE,EAAKC,WAAF,IAAmB;AACvB,aACC,4BAAC,mBAAD;AACC,QAAA,0BAA0B,EACzBP,0BAFF;AAIC,QAAA,gBAAgB,EAAI,GAAGI,KAAO,IAAIC,MAAQ,EAJ3C;AAKC,QAAA,EAAE,EAAGN,eALN;AAMC,QAAA,IAAI,EAAI,GAAGK,KAAO;AANnB,SAOMG,WAPN,EADD;AAWA,KAbF;AAcC,IAAA,IAAI,EAAC,kBAdN;AAeC,IAAA,YAAY,EAAGC,YAfhB;AAgBC,IAAA,IAAI,EAAGH,MAhBR;AAiBC,IAAA,KAAK,EAAGD;AAjBT,KAkBME,KAlBN,EADD;AAsBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { check } from '@wordpress/icons';\nimport { MenuItem } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport ComplementaryAreaToggle from '../complementary-area-toggle';\nimport ActionItem from '../action-item';\n\nconst PluginsMenuItem = ( {\n\t// Menu item is marked with unstable prop for backward compatibility.\n\t// They are removed so they don't leak to DOM elements.\n\t// @see https://github.com/WordPress/gutenberg/issues/14457\n\t__unstableExplicitMenuItem,\n\t__unstableTarget,\n\t...restProps\n} ) => <MenuItem { ...restProps } />;\n\nexport default function ComplementaryAreaMoreMenuItem( {\n\tscope,\n\ttarget,\n\t__unstableExplicitMenuItem,\n\t...props\n} ) {\n\treturn (\n\t\t<ComplementaryAreaToggle\n\t\t\tas={ ( toggleProps ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<ActionItem\n\t\t\t\t\t\t__unstableExplicitMenuItem={\n\t\t\t\t\t\t\t__unstableExplicitMenuItem\n\t\t\t\t\t\t}\n\t\t\t\t\t\t__unstableTarget={ `${ scope }/${ target }` }\n\t\t\t\t\t\tas={ PluginsMenuItem }\n\t\t\t\t\t\tname={ `${ scope }/plugin-more-menu` }\n\t\t\t\t\t\t{ ...toggleProps }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} }\n\t\t\trole=\"menuitemcheckbox\"\n\t\t\tselectedIcon={ check }\n\t\t\tname={ target }\n\t\t\tscope={ scope }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/interface/src/components/complementary-area-more-menu-item/index.js"],"names":["PluginsMenuItem","__unstableExplicitMenuItem","__unstableTarget","restProps","ComplementaryAreaMoreMenuItem","scope","target","props","toggleProps","check"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AAVA;AACA;AACA;;AAIA;AACA;AACA;AAIA,MAAMA,eAAe,GAAG,CAAE;AACzB;AACA;AACA;AACAC,EAAAA,0BAJyB;AAKzBC,EAAAA,gBALyB;AAMzB,KAAGC;AANsB,CAAF,KAOjB,4BAAC,oBAAD,EAAeA,SAAf,CAPP;;AASe,SAASC,6BAAT,CAAwC;AACtDC,EAAAA,KADsD;AAEtDC,EAAAA,MAFsD;AAGtDL,EAAAA,0BAHsD;AAItD,KAAGM;AAJmD,CAAxC,EAKX;AACH,SACC,4BAAC,gCAAD;AACC,IAAA,EAAE,EAAKC,WAAF,IAAmB;AACvB,aACC,4BAAC,mBAAD;AACC,QAAA,0BAA0B,EACzBP,0BAFF;AAIC,QAAA,gBAAgB,EAAI,GAAGI,KAAO,IAAIC,MAAQ,EAJ3C;AAKC,QAAA,EAAE,EAAGN,eALN;AAMC,QAAA,IAAI,EAAI,GAAGK,KAAO;AANnB,SAOMG,WAPN,EADD;AAWA,KAbF;AAcC,IAAA,IAAI,EAAC,kBAdN;AAeC,IAAA,YAAY,EAAGC,YAfhB;AAgBC,IAAA,IAAI,EAAGH,MAhBR;AAiBC,IAAA,KAAK,EAAGD;AAjBT,KAkBME,KAlBN,EADD;AAsBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { check } from '@wordpress/icons';\nimport { MenuItem } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport ComplementaryAreaToggle from '../complementary-area-toggle';\nimport ActionItem from '../action-item';\n\nconst PluginsMenuItem = ( {\n\t// Menu item is marked with unstable prop for backward compatibility.\n\t// They are removed so they don't leak to DOM elements.\n\t// @see https://github.com/WordPress/gutenberg/issues/14457\n\t__unstableExplicitMenuItem,\n\t__unstableTarget,\n\t...restProps\n} ) => <MenuItem { ...restProps } />;\n\nexport default function ComplementaryAreaMoreMenuItem( {\n\tscope,\n\ttarget,\n\t__unstableExplicitMenuItem,\n\t...props\n} ) {\n\treturn (\n\t\t<ComplementaryAreaToggle\n\t\t\tas={ ( toggleProps ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<ActionItem\n\t\t\t\t\t\t__unstableExplicitMenuItem={\n\t\t\t\t\t\t\t__unstableExplicitMenuItem\n\t\t\t\t\t\t}\n\t\t\t\t\t\t__unstableTarget={ `${ scope }/${ target }` }\n\t\t\t\t\t\tas={ PluginsMenuItem }\n\t\t\t\t\t\tname={ `${ scope }/plugin-more-menu` }\n\t\t\t\t\t\t{ ...toggleProps }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} }\n\t\t\trole=\"menuitemcheckbox\"\n\t\t\tselectedIcon={ check }\n\t\t\tname={ target }\n\t\t\tscope={ scope }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n"]}
@@ -26,16 +26,15 @@ var _complementaryAreaContext = _interopRequireDefault(require("../complementary
26
26
  /**
27
27
  * Internal dependencies
28
28
  */
29
- function ComplementaryAreaToggle(_ref) {
30
- let {
31
- as = _components.Button,
32
- scope,
33
- identifier,
34
- icon,
35
- selectedIcon,
36
- name,
37
- ...props
38
- } = _ref;
29
+ function ComplementaryAreaToggle({
30
+ as = _components.Button,
31
+ scope,
32
+ identifier,
33
+ icon,
34
+ selectedIcon,
35
+ name,
36
+ ...props
37
+ }) {
39
38
  const ComponentToUse = as;
40
39
  const isSelected = (0, _data.useSelect)(select => select(_store.store).getActiveComplementaryArea(scope) === identifier, [identifier]);
41
40
  const {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/interface/src/components/complementary-area-toggle/index.js"],"names":["ComplementaryAreaToggle","as","Button","scope","identifier","icon","selectedIcon","name","props","ComponentToUse","isSelected","select","interfaceStore","getActiveComplementaryArea","enableComplementaryArea","disableComplementaryArea"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AAVA;AACA;AACA;;AAIA;AACA;AACA;AAIA,SAASA,uBAAT,OAQI;AAAA,MAR8B;AACjCC,IAAAA,EAAE,GAAGC,kBAD4B;AAEjCC,IAAAA,KAFiC;AAGjCC,IAAAA,UAHiC;AAIjCC,IAAAA,IAJiC;AAKjCC,IAAAA,YALiC;AAMjCC,IAAAA,IANiC;AAOjC,OAAGC;AAP8B,GAQ9B;AACH,QAAMC,cAAc,GAAGR,EAAvB;AACA,QAAMS,UAAU,GAAG,qBAChBC,MAAF,IACCA,MAAM,CAAEC,YAAF,CAAN,CAAyBC,0BAAzB,CAAqDV,KAArD,MACAC,UAHiB,EAIlB,CAAEA,UAAF,CAJkB,CAAnB;AAMA,QAAM;AAAEU,IAAAA,uBAAF;AAA2BC,IAAAA;AAA3B,MACL,uBAAaH,YAAb,CADD;AAEA,SACC,4BAAC,cAAD;AACC,IAAA,IAAI,EAAGN,YAAY,IAAII,UAAhB,GAA6BJ,YAA7B,GAA4CD,IADpD;AAEC,IAAA,OAAO,EAAG,MAAM;AACf,UAAKK,UAAL,EAAkB;AACjBK,QAAAA,wBAAwB,CAAEZ,KAAF,CAAxB;AACA,OAFD,MAEO;AACNW,QAAAA,uBAAuB,CAAEX,KAAF,EAASC,UAAT,CAAvB;AACA;AACD;AARF,KASMI,KATN,EADD;AAaA;;eAEc,uCAA0BR,uBAA1B,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as interfaceStore } from '../../store';\nimport complementaryAreaContext from '../complementary-area-context';\n\nfunction ComplementaryAreaToggle( {\n\tas = Button,\n\tscope,\n\tidentifier,\n\ticon,\n\tselectedIcon,\n\tname,\n\t...props\n} ) {\n\tconst ComponentToUse = as;\n\tconst isSelected = useSelect(\n\t\t( select ) =>\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea( scope ) ===\n\t\t\tidentifier,\n\t\t[ identifier ]\n\t);\n\tconst { enableComplementaryArea, disableComplementaryArea } =\n\t\tuseDispatch( interfaceStore );\n\treturn (\n\t\t<ComponentToUse\n\t\t\ticon={ selectedIcon && isSelected ? selectedIcon : icon }\n\t\t\tonClick={ () => {\n\t\t\t\tif ( isSelected ) {\n\t\t\t\t\tdisableComplementaryArea( scope );\n\t\t\t\t} else {\n\t\t\t\t\tenableComplementaryArea( scope, identifier );\n\t\t\t\t}\n\t\t\t} }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nexport default complementaryAreaContext( ComplementaryAreaToggle );\n"]}
1
+ {"version":3,"sources":["@wordpress/interface/src/components/complementary-area-toggle/index.js"],"names":["ComplementaryAreaToggle","as","Button","scope","identifier","icon","selectedIcon","name","props","ComponentToUse","isSelected","select","interfaceStore","getActiveComplementaryArea","enableComplementaryArea","disableComplementaryArea"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AAVA;AACA;AACA;;AAIA;AACA;AACA;AAIA,SAASA,uBAAT,CAAkC;AACjCC,EAAAA,EAAE,GAAGC,kBAD4B;AAEjCC,EAAAA,KAFiC;AAGjCC,EAAAA,UAHiC;AAIjCC,EAAAA,IAJiC;AAKjCC,EAAAA,YALiC;AAMjCC,EAAAA,IANiC;AAOjC,KAAGC;AAP8B,CAAlC,EAQI;AACH,QAAMC,cAAc,GAAGR,EAAvB;AACA,QAAMS,UAAU,GAAG,qBAChBC,MAAF,IACCA,MAAM,CAAEC,YAAF,CAAN,CAAyBC,0BAAzB,CAAqDV,KAArD,MACAC,UAHiB,EAIlB,CAAEA,UAAF,CAJkB,CAAnB;AAMA,QAAM;AAAEU,IAAAA,uBAAF;AAA2BC,IAAAA;AAA3B,MACL,uBAAaH,YAAb,CADD;AAEA,SACC,4BAAC,cAAD;AACC,IAAA,IAAI,EAAGN,YAAY,IAAII,UAAhB,GAA6BJ,YAA7B,GAA4CD,IADpD;AAEC,IAAA,OAAO,EAAG,MAAM;AACf,UAAKK,UAAL,EAAkB;AACjBK,QAAAA,wBAAwB,CAAEZ,KAAF,CAAxB;AACA,OAFD,MAEO;AACNW,QAAAA,uBAAuB,CAAEX,KAAF,EAASC,UAAT,CAAvB;AACA;AACD;AARF,KASMI,KATN,EADD;AAaA;;eAEc,uCAA0BR,uBAA1B,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as interfaceStore } from '../../store';\nimport complementaryAreaContext from '../complementary-area-context';\n\nfunction ComplementaryAreaToggle( {\n\tas = Button,\n\tscope,\n\tidentifier,\n\ticon,\n\tselectedIcon,\n\tname,\n\t...props\n} ) {\n\tconst ComponentToUse = as;\n\tconst isSelected = useSelect(\n\t\t( select ) =>\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea( scope ) ===\n\t\t\tidentifier,\n\t\t[ identifier ]\n\t);\n\tconst { enableComplementaryArea, disableComplementaryArea } =\n\t\tuseDispatch( interfaceStore );\n\treturn (\n\t\t<ComponentToUse\n\t\t\ticon={ selectedIcon && isSelected ? selectedIcon : icon }\n\t\t\tonClick={ () => {\n\t\t\t\tif ( isSelected ) {\n\t\t\t\t\tdisableComplementaryArea( scope );\n\t\t\t\t} else {\n\t\t\t\t\tenableComplementaryArea( scope, identifier );\n\t\t\t\t}\n\t\t\t} }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nexport default complementaryAreaContext( ComplementaryAreaToggle );\n"]}
@@ -10,10 +10,9 @@ var _element = require("@wordpress/element");
10
10
  /**
11
11
  * WordPress dependencies
12
12
  */
13
- const FullscreenMode = _ref => {
14
- let {
15
- isActive
16
- } = _ref;
13
+ const FullscreenMode = ({
14
+ isActive
15
+ }) => {
17
16
  (0, _element.useEffect)(() => {
18
17
  let isSticky = false; // `is-fullscreen-mode` is set in PHP as a body class by Gutenberg, and this causes
19
18
  // `sticky-menu` to be applied by WordPress and prevents the admin menu being scrolled
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/interface/src/components/fullscreen-mode/index.js"],"names":["FullscreenMode","isActive","isSticky","document","body","classList","contains","remove","add"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;AAGA,MAAMA,cAAc,GAAG,QAAoB;AAAA,MAAlB;AAAEC,IAAAA;AAAF,GAAkB;AAC1C,0BAAW,MAAM;AAChB,QAAIC,QAAQ,GAAG,KAAf,CADgB,CAEhB;AACA;AACA;AACA;;AACA,QAAKC,QAAQ,CAACC,IAAT,CAAcC,SAAd,CAAwBC,QAAxB,CAAkC,aAAlC,CAAL,EAAyD;AACxDJ,MAAAA,QAAQ,GAAG,IAAX;AACAC,MAAAA,QAAQ,CAACC,IAAT,CAAcC,SAAd,CAAwBE,MAAxB,CAAgC,aAAhC;AACA;;AAED,WAAO,MAAM;AACZ,UAAKL,QAAL,EAAgB;AACfC,QAAAA,QAAQ,CAACC,IAAT,CAAcC,SAAd,CAAwBG,GAAxB,CAA6B,aAA7B;AACA;AACD,KAJD;AAKA,GAhBD,EAgBG,EAhBH;AAkBA,0BAAW,MAAM;AAChB,QAAKP,QAAL,EAAgB;AACfE,MAAAA,QAAQ,CAACC,IAAT,CAAcC,SAAd,CAAwBG,GAAxB,CAA6B,oBAA7B;AACA,KAFD,MAEO;AACNL,MAAAA,QAAQ,CAACC,IAAT,CAAcC,SAAd,CAAwBE,MAAxB,CAAgC,oBAAhC;AACA;;AAED,WAAO,MAAM;AACZ,UAAKN,QAAL,EAAgB;AACfE,QAAAA,QAAQ,CAACC,IAAT,CAAcC,SAAd,CAAwBE,MAAxB,CAAgC,oBAAhC;AACA;AACD,KAJD;AAKA,GAZD,EAYG,CAAEN,QAAF,CAZH;AAcA,SAAO,IAAP;AACA,CAlCD;;eAmCeD,c","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\n\nconst FullscreenMode = ( { isActive } ) => {\n\tuseEffect( () => {\n\t\tlet isSticky = false;\n\t\t// `is-fullscreen-mode` is set in PHP as a body class by Gutenberg, and this causes\n\t\t// `sticky-menu` to be applied by WordPress and prevents the admin menu being scrolled\n\t\t// even if `is-fullscreen-mode` is then removed. Let's remove `sticky-menu` here as\n\t\t// a consequence of the FullscreenMode setup.\n\t\tif ( document.body.classList.contains( 'sticky-menu' ) ) {\n\t\t\tisSticky = true;\n\t\t\tdocument.body.classList.remove( 'sticky-menu' );\n\t\t}\n\n\t\treturn () => {\n\t\t\tif ( isSticky ) {\n\t\t\t\tdocument.body.classList.add( 'sticky-menu' );\n\t\t\t}\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tif ( isActive ) {\n\t\t\tdocument.body.classList.add( 'is-fullscreen-mode' );\n\t\t} else {\n\t\t\tdocument.body.classList.remove( 'is-fullscreen-mode' );\n\t\t}\n\n\t\treturn () => {\n\t\t\tif ( isActive ) {\n\t\t\t\tdocument.body.classList.remove( 'is-fullscreen-mode' );\n\t\t\t}\n\t\t};\n\t}, [ isActive ] );\n\n\treturn null;\n};\nexport default FullscreenMode;\n"]}
1
+ {"version":3,"sources":["@wordpress/interface/src/components/fullscreen-mode/index.js"],"names":["FullscreenMode","isActive","isSticky","document","body","classList","contains","remove","add"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;AAGA,MAAMA,cAAc,GAAG,CAAE;AAAEC,EAAAA;AAAF,CAAF,KAAoB;AAC1C,0BAAW,MAAM;AAChB,QAAIC,QAAQ,GAAG,KAAf,CADgB,CAEhB;AACA;AACA;AACA;;AACA,QAAKC,QAAQ,CAACC,IAAT,CAAcC,SAAd,CAAwBC,QAAxB,CAAkC,aAAlC,CAAL,EAAyD;AACxDJ,MAAAA,QAAQ,GAAG,IAAX;AACAC,MAAAA,QAAQ,CAACC,IAAT,CAAcC,SAAd,CAAwBE,MAAxB,CAAgC,aAAhC;AACA;;AAED,WAAO,MAAM;AACZ,UAAKL,QAAL,EAAgB;AACfC,QAAAA,QAAQ,CAACC,IAAT,CAAcC,SAAd,CAAwBG,GAAxB,CAA6B,aAA7B;AACA;AACD,KAJD;AAKA,GAhBD,EAgBG,EAhBH;AAkBA,0BAAW,MAAM;AAChB,QAAKP,QAAL,EAAgB;AACfE,MAAAA,QAAQ,CAACC,IAAT,CAAcC,SAAd,CAAwBG,GAAxB,CAA6B,oBAA7B;AACA,KAFD,MAEO;AACNL,MAAAA,QAAQ,CAACC,IAAT,CAAcC,SAAd,CAAwBE,MAAxB,CAAgC,oBAAhC;AACA;;AAED,WAAO,MAAM;AACZ,UAAKN,QAAL,EAAgB;AACfE,QAAAA,QAAQ,CAACC,IAAT,CAAcC,SAAd,CAAwBE,MAAxB,CAAgC,oBAAhC;AACA;AACD,KAJD;AAKA,GAZD,EAYG,CAAEN,QAAF,CAZH;AAcA,SAAO,IAAP;AACA,CAlCD;;eAmCeD,c","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\n\nconst FullscreenMode = ( { isActive } ) => {\n\tuseEffect( () => {\n\t\tlet isSticky = false;\n\t\t// `is-fullscreen-mode` is set in PHP as a body class by Gutenberg, and this causes\n\t\t// `sticky-menu` to be applied by WordPress and prevents the admin menu being scrolled\n\t\t// even if `is-fullscreen-mode` is then removed. Let's remove `sticky-menu` here as\n\t\t// a consequence of the FullscreenMode setup.\n\t\tif ( document.body.classList.contains( 'sticky-menu' ) ) {\n\t\t\tisSticky = true;\n\t\t\tdocument.body.classList.remove( 'sticky-menu' );\n\t\t}\n\n\t\treturn () => {\n\t\t\tif ( isSticky ) {\n\t\t\t\tdocument.body.classList.add( 'sticky-menu' );\n\t\t\t}\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tif ( isActive ) {\n\t\t\tdocument.body.classList.add( 'is-fullscreen-mode' );\n\t\t} else {\n\t\t\tdocument.body.classList.remove( 'is-fullscreen-mode' );\n\t\t}\n\n\t\treturn () => {\n\t\t\tif ( isActive ) {\n\t\t\t\tdocument.body.classList.remove( 'is-fullscreen-mode' );\n\t\t\t}\n\t\t};\n\t}, [ isActive ] );\n\n\treturn null;\n};\nexport default FullscreenMode;\n"]}
@@ -47,24 +47,23 @@ function useHTMLClass(className) {
47
47
  }, [className]);
48
48
  }
49
49
 
50
- function InterfaceSkeleton(_ref, ref) {
51
- let {
52
- isDistractionFree,
53
- footer,
54
- header,
55
- editorNotices,
56
- sidebar,
57
- secondarySidebar,
58
- notices,
59
- content,
60
- actions,
61
- labels,
62
- className,
63
- enableRegionNavigation = true,
64
- // Todo: does this need to be a prop.
65
- // Can we use a dependency to keyboard-shortcuts directly?
66
- shortcuts
67
- } = _ref;
50
+ function InterfaceSkeleton({
51
+ isDistractionFree,
52
+ footer,
53
+ header,
54
+ editorNotices,
55
+ sidebar,
56
+ secondarySidebar,
57
+ notices,
58
+ content,
59
+ actions,
60
+ labels,
61
+ className,
62
+ enableRegionNavigation = true,
63
+ // Todo: does this need to be a prop.
64
+ // Can we use a dependency to keyboard-shortcuts directly?
65
+ shortcuts
66
+ }, ref) {
68
67
  const navigateRegionsProps = (0, _components.__unstableUseNavigateRegions)(shortcuts);
69
68
  useHTMLClass('interface-interface-skeleton__html-container');
70
69
  const defaultLabels = {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/interface/src/components/interface-skeleton/index.js"],"names":["useHTMLClass","className","element","document","querySelector","classList","toggle","InterfaceSkeleton","ref","isDistractionFree","footer","header","editorNotices","sidebar","secondarySidebar","notices","content","actions","labels","enableRegionNavigation","shortcuts","navigateRegionsProps","defaultLabels","body","mergedLabels","headerVariants","hidden","opacity","hover","transition","type","delay","delayChildren","undefined","motion","div"],"mappings":";;;;;;;;;AAQA;;;;AALA;;AAMA;;AAIA;;AACA;;AAKA;;AAnBA;AACA;AACA;;AAGA;AACA;AACA;;AASA;AACA;AACA;AAGA,SAASA,YAAT,CAAuBC,SAAvB,EAAmC;AAClC,0BAAW,MAAM;AAChB,UAAMC,OAAO,GACZC,QAAQ,IAAIA,QAAQ,CAACC,aAAT,CAAyB,aAAaH,SAAW,GAAjD,CADb;;AAEA,QAAK,CAAEC,OAAP,EAAiB;AAChB;AACA;;AACDA,IAAAA,OAAO,CAACG,SAAR,CAAkBC,MAAlB,CAA0BL,SAA1B;AACA,WAAO,MAAM;AACZC,MAAAA,OAAO,CAACG,SAAR,CAAkBC,MAAlB,CAA0BL,SAA1B;AACA,KAFD;AAGA,GAVD,EAUG,CAAEA,SAAF,CAVH;AAWA;;AAED,SAASM,iBAAT,OAkBCC,GAlBD,EAmBE;AAAA,MAlBD;AACCC,IAAAA,iBADD;AAECC,IAAAA,MAFD;AAGCC,IAAAA,MAHD;AAICC,IAAAA,aAJD;AAKCC,IAAAA,OALD;AAMCC,IAAAA,gBAND;AAOCC,IAAAA,OAPD;AAQCC,IAAAA,OARD;AASCC,IAAAA,OATD;AAUCC,IAAAA,MAVD;AAWCjB,IAAAA,SAXD;AAYCkB,IAAAA,sBAAsB,GAAG,IAZ1B;AAaC;AACA;AACAC,IAAAA;AAfD,GAkBC;AACD,QAAMC,oBAAoB,GAAG,8CAAoBD,SAApB,CAA7B;AAEApB,EAAAA,YAAY,CAAE,8CAAF,CAAZ;AAEA,QAAMsB,aAAa,GAAG;AACrB;AACAX,IAAAA,MAAM,EAAE,cAAI,QAAJ,CAFa;;AAGrB;AACAY,IAAAA,IAAI,EAAE,cAAI,SAAJ,CAJe;;AA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\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef, useEffect } from '@wordpress/element';\nimport {\n\t__unstableUseNavigateRegions as useNavigateRegions,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport NavigableRegion from '../navigable-region';\n\nfunction useHTMLClass( className ) {\n\tuseEffect( () => {\n\t\tconst element =\n\t\t\tdocument && document.querySelector( `html:not(.${ className })` );\n\t\tif ( ! element ) {\n\t\t\treturn;\n\t\t}\n\t\telement.classList.toggle( className );\n\t\treturn () => {\n\t\t\telement.classList.toggle( className );\n\t\t};\n\t}, [ className ] );\n}\n\nfunction InterfaceSkeleton(\n\t{\n\t\tisDistractionFree,\n\t\tfooter,\n\t\theader,\n\t\teditorNotices,\n\t\tsidebar,\n\t\tsecondarySidebar,\n\t\tnotices,\n\t\tcontent,\n\t\tactions,\n\t\tlabels,\n\t\tclassName,\n\t\tenableRegionNavigation = true,\n\t\t// Todo: does this need to be a prop.\n\t\t// Can we use a dependency to keyboard-shortcuts directly?\n\t\tshortcuts,\n\t},\n\tref\n) {\n\tconst navigateRegionsProps = useNavigateRegions( shortcuts );\n\n\tuseHTMLClass( 'interface-interface-skeleton__html-container' );\n\n\tconst defaultLabels = {\n\t\t/* translators: accessibility text for the top bar landmark region. */\n\t\theader: __( 'Header' ),\n\t\t/* translators: accessibility text for the content landmark region. */\n\t\tbody: __( 'Content' ),\n\t\t/* translators: accessibility text for the secondary sidebar landmark region. */\n\t\tsecondarySidebar: __( 'Block Library' ),\n\t\t/* translators: accessibility text for the settings landmark region. */\n\t\tsidebar: __( 'Settings' ),\n\t\t/* translators: accessibility text for the publish landmark region. */\n\t\tactions: __( 'Publish' ),\n\t\t/* translators: accessibility text for the footer landmark region. */\n\t\tfooter: __( 'Footer' ),\n\t};\n\n\tconst mergedLabels = { ...defaultLabels, ...labels };\n\n\tconst headerVariants = {\n\t\thidden: isDistractionFree ? { opacity: 0 } : { opacity: 1 },\n\t\thover: {\n\t\t\topacity: 1,\n\t\t\ttransition: { type: 'tween', delay: 0.2, delayChildren: 0.2 },\n\t\t},\n\t};\n\n\treturn (\n\t\t<div\n\t\t\t{ ...( enableRegionNavigation ? navigateRegionsProps : {} ) }\n\t\t\tref={ useMergeRefs( [\n\t\t\t\tref,\n\t\t\t\tenableRegionNavigation ? navigateRegionsProps.ref : undefined,\n\t\t\t] ) }\n\t\t\tclassName={ classnames(\n\t\t\t\tclassName,\n\t\t\t\t'interface-interface-skeleton',\n\t\t\t\tnavigateRegionsProps.className,\n\t\t\t\t!! footer && 'has-footer'\n\t\t\t) }\n\t\t>\n\t\t\t<div className=\"interface-interface-skeleton__editor\">\n\t\t\t\t{ !! header && isDistractionFree && (\n\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\tas={ motion.div }\n\t\t\t\t\t\tclassName=\"interface-interface-skeleton__header\"\n\t\t\t\t\t\taria-label={ mergedLabels.header }\n\t\t\t\t\t\tinitial={ isDistractionFree ? 'hidden' : 'hover' }\n\t\t\t\t\t\twhileHover=\"hover\"\n\t\t\t\t\t\tvariants={ headerVariants }\n\t\t\t\t\t\ttransition={ { type: 'tween', delay: 0.8 } }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ header }\n\t\t\t\t\t</NavigableRegion>\n\t\t\t\t) }\n\t\t\t\t{ !! header && ! isDistractionFree && (\n\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\tclassName=\"interface-interface-skeleton__header\"\n\t\t\t\t\t\tariaLabel={ mergedLabels.header }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ header }\n\t\t\t\t\t</NavigableRegion>\n\t\t\t\t) }\n\t\t\t\t{ isDistractionFree && (\n\t\t\t\t\t<div className=\"interface-interface-skeleton__header\">\n\t\t\t\t\t\t{ editorNotices }\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t\t<div className=\"interface-interface-skeleton__body\">\n\t\t\t\t\t{ !! secondarySidebar && (\n\t\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\t\tclassName=\"interface-interface-skeleton__secondary-sidebar\"\n\t\t\t\t\t\t\tariaLabel={ mergedLabels.secondarySidebar }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ secondarySidebar }\n\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t) }\n\t\t\t\t\t{ !! notices && (\n\t\t\t\t\t\t<div className=\"interface-interface-skeleton__notices\">\n\t\t\t\t\t\t\t{ notices }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\tclassName=\"interface-interface-skeleton__content\"\n\t\t\t\t\t\tariaLabel={ mergedLabels.body }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ content }\n\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t{ !! sidebar && (\n\t\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\t\tclassName=\"interface-interface-skeleton__sidebar\"\n\t\t\t\t\t\t\tariaLabel={ mergedLabels.sidebar }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ sidebar }\n\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t) }\n\t\t\t\t\t{ !! actions && (\n\t\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\t\tclassName=\"interface-interface-skeleton__actions\"\n\t\t\t\t\t\t\tariaLabel={ mergedLabels.actions }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ actions }\n\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t{ !! footer && (\n\t\t\t\t<NavigableRegion\n\t\t\t\t\tclassName=\"interface-interface-skeleton__footer\"\n\t\t\t\t\tariaLabel={ mergedLabels.footer }\n\t\t\t\t>\n\t\t\t\t\t{ footer }\n\t\t\t\t</NavigableRegion>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nexport default forwardRef( InterfaceSkeleton );\n"]}
1
+ {"version":3,"sources":["@wordpress/interface/src/components/interface-skeleton/index.js"],"names":["useHTMLClass","className","element","document","querySelector","classList","toggle","InterfaceSkeleton","isDistractionFree","footer","header","editorNotices","sidebar","secondarySidebar","notices","content","actions","labels","enableRegionNavigation","shortcuts","ref","navigateRegionsProps","defaultLabels","body","mergedLabels","headerVariants","hidden","opacity","hover","transition","type","delay","delayChildren","undefined","motion","div"],"mappings":";;;;;;;;;AAQA;;;;AALA;;AAMA;;AAIA;;AACA;;AAKA;;AAnBA;AACA;AACA;;AAGA;AACA;AACA;;AASA;AACA;AACA;AAGA,SAASA,YAAT,CAAuBC,SAAvB,EAAmC;AAClC,0BAAW,MAAM;AAChB,UAAMC,OAAO,GACZC,QAAQ,IAAIA,QAAQ,CAACC,aAAT,CAAyB,aAAaH,SAAW,GAAjD,CADb;;AAEA,QAAK,CAAEC,OAAP,EAAiB;AAChB;AACA;;AACDA,IAAAA,OAAO,CAACG,SAAR,CAAkBC,MAAlB,CAA0BL,SAA1B;AACA,WAAO,MAAM;AACZC,MAAAA,OAAO,CAACG,SAAR,CAAkBC,MAAlB,CAA0BL,SAA1B;AACA,KAFD;AAGA,GAVD,EAUG,CAAEA,SAAF,CAVH;AAWA;;AAED,SAASM,iBAAT,CACC;AACCC,EAAAA,iBADD;AAECC,EAAAA,MAFD;AAGCC,EAAAA,MAHD;AAICC,EAAAA,aAJD;AAKCC,EAAAA,OALD;AAMCC,EAAAA,gBAND;AAOCC,EAAAA,OAPD;AAQCC,EAAAA,OARD;AASCC,EAAAA,OATD;AAUCC,EAAAA,MAVD;AAWChB,EAAAA,SAXD;AAYCiB,EAAAA,sBAAsB,GAAG,IAZ1B;AAaC;AACA;AACAC,EAAAA;AAfD,CADD,EAkBCC,GAlBD,EAmBE;AACD,QAAMC,oBAAoB,GAAG,8CAAoBF,SAApB,CAA7B;AAEAnB,EAAAA,YAAY,CAAE,8CAAF,CAAZ;AAEA,QAAMsB,a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,IAAA,SAAS,EAAGe,YAAY,CAACf;AAF1B,KAIGA,MAJH,CA/EF,CADD;AAyFA;;eAEc,yBAAYF,iBAAZ,C","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef, useEffect } from '@wordpress/element';\nimport {\n\t__unstableUseNavigateRegions as useNavigateRegions,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport NavigableRegion from '../navigable-region';\n\nfunction useHTMLClass( className ) {\n\tuseEffect( () => {\n\t\tconst element =\n\t\t\tdocument && document.querySelector( `html:not(.${ className })` );\n\t\tif ( ! element ) {\n\t\t\treturn;\n\t\t}\n\t\telement.classList.toggle( className );\n\t\treturn () => {\n\t\t\telement.classList.toggle( className );\n\t\t};\n\t}, [ className ] );\n}\n\nfunction InterfaceSkeleton(\n\t{\n\t\tisDistractionFree,\n\t\tfooter,\n\t\theader,\n\t\teditorNotices,\n\t\tsidebar,\n\t\tsecondarySidebar,\n\t\tnotices,\n\t\tcontent,\n\t\tactions,\n\t\tlabels,\n\t\tclassName,\n\t\tenableRegionNavigation = true,\n\t\t// Todo: does this need to be a prop.\n\t\t// Can we use a dependency to keyboard-shortcuts directly?\n\t\tshortcuts,\n\t},\n\tref\n) {\n\tconst navigateRegionsProps = useNavigateRegions( shortcuts );\n\n\tuseHTMLClass( 'interface-interface-skeleton__html-container' );\n\n\tconst defaultLabels = {\n\t\t/* translators: accessibility text for the top bar landmark region. */\n\t\theader: __( 'Header' ),\n\t\t/* translators: accessibility text for the content landmark region. */\n\t\tbody: __( 'Content' ),\n\t\t/* translators: accessibility text for the secondary sidebar landmark region. */\n\t\tsecondarySidebar: __( 'Block Library' ),\n\t\t/* translators: accessibility text for the settings landmark region. */\n\t\tsidebar: __( 'Settings' ),\n\t\t/* translators: accessibility text for the publish landmark region. */\n\t\tactions: __( 'Publish' ),\n\t\t/* translators: accessibility text for the footer landmark region. */\n\t\tfooter: __( 'Footer' ),\n\t};\n\n\tconst mergedLabels = { ...defaultLabels, ...labels };\n\n\tconst headerVariants = {\n\t\thidden: isDistractionFree ? { opacity: 0 } : { opacity: 1 },\n\t\thover: {\n\t\t\topacity: 1,\n\t\t\ttransition: { type: 'tween', delay: 0.2, delayChildren: 0.2 },\n\t\t},\n\t};\n\n\treturn (\n\t\t<div\n\t\t\t{ ...( enableRegionNavigation ? navigateRegionsProps : {} ) }\n\t\t\tref={ useMergeRefs( [\n\t\t\t\tref,\n\t\t\t\tenableRegionNavigation ? navigateRegionsProps.ref : undefined,\n\t\t\t] ) }\n\t\t\tclassName={ classnames(\n\t\t\t\tclassName,\n\t\t\t\t'interface-interface-skeleton',\n\t\t\t\tnavigateRegionsProps.className,\n\t\t\t\t!! footer && 'has-footer'\n\t\t\t) }\n\t\t>\n\t\t\t<div className=\"interface-interface-skeleton__editor\">\n\t\t\t\t{ !! header && isDistractionFree && (\n\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\tas={ motion.div }\n\t\t\t\t\t\tclassName=\"interface-interface-skeleton__header\"\n\t\t\t\t\t\taria-label={ mergedLabels.header }\n\t\t\t\t\t\tinitial={ isDistractionFree ? 'hidden' : 'hover' }\n\t\t\t\t\t\twhileHover=\"hover\"\n\t\t\t\t\t\tvariants={ headerVariants }\n\t\t\t\t\t\ttransition={ { type: 'tween', delay: 0.8 } }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ header }\n\t\t\t\t\t</NavigableRegion>\n\t\t\t\t) }\n\t\t\t\t{ !! header && ! isDistractionFree && (\n\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\tclassName=\"interface-interface-skeleton__header\"\n\t\t\t\t\t\tariaLabel={ mergedLabels.header }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ header }\n\t\t\t\t\t</NavigableRegion>\n\t\t\t\t) }\n\t\t\t\t{ isDistractionFree && (\n\t\t\t\t\t<div className=\"interface-interface-skeleton__header\">\n\t\t\t\t\t\t{ editorNotices }\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t\t<div className=\"interface-interface-skeleton__body\">\n\t\t\t\t\t{ !! secondarySidebar && (\n\t\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\t\tclassName=\"interface-interface-skeleton__secondary-sidebar\"\n\t\t\t\t\t\t\tariaLabel={ mergedLabels.secondarySidebar }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ secondarySidebar }\n\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t) }\n\t\t\t\t\t{ !! notices && (\n\t\t\t\t\t\t<div className=\"interface-interface-skeleton__notices\">\n\t\t\t\t\t\t\t{ notices }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\tclassName=\"interface-interface-skeleton__content\"\n\t\t\t\t\t\tariaLabel={ mergedLabels.body }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ content }\n\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t{ !! sidebar && (\n\t\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\t\tclassName=\"interface-interface-skeleton__sidebar\"\n\t\t\t\t\t\t\tariaLabel={ mergedLabels.sidebar }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ sidebar }\n\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t) }\n\t\t\t\t\t{ !! actions && (\n\t\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\t\tclassName=\"interface-interface-skeleton__actions\"\n\t\t\t\t\t\t\tariaLabel={ mergedLabels.actions }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ actions }\n\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t{ !! footer && (\n\t\t\t\t<NavigableRegion\n\t\t\t\t\tclassName=\"interface-interface-skeleton__footer\"\n\t\t\t\t\tariaLabel={ mergedLabels.footer }\n\t\t\t\t>\n\t\t\t\t\t{ footer }\n\t\t\t\t</NavigableRegion>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nexport default forwardRef( InterfaceSkeleton );\n"]}
@@ -24,17 +24,16 @@ var _icons = require("@wordpress/icons");
24
24
  /**
25
25
  * WordPress dependencies
26
26
  */
27
- function MoreMenuDropdown(_ref) {
28
- let {
29
- as: DropdownComponent = _components.DropdownMenu,
30
- className,
31
-
32
- /* translators: button label text should, if possible, be under 16 characters. */
33
- label = (0, _i18n.__)('Options'),
34
- popoverProps,
35
- toggleProps,
36
- children
37
- } = _ref;
27
+ function MoreMenuDropdown({
28
+ as: DropdownComponent = _components.DropdownMenu,
29
+ className,
30
+
31
+ /* translators: button label text should, if possible, be under 16 characters. */
32
+ label = (0, _i18n.__)('Options'),
33
+ popoverProps,
34
+ toggleProps,
35
+ children
36
+ }) {
38
37
  return (0, _element.createElement)(DropdownComponent, {
39
38
  className: (0, _classnames.default)('interface-more-menu-dropdown', className),
40
39
  icon: _icons.moreVertical,
@@ -42,7 +41,7 @@ function MoreMenuDropdown(_ref) {
42
41
  popoverProps: {
43
42
  placement: 'bottom-end',
44
43
  ...popoverProps,
45
- className: (0, _classnames.default)('interface-more-menu-dropdown__content', popoverProps === null || popoverProps === void 0 ? void 0 : popoverProps.className)
44
+ className: (0, _classnames.default)('interface-more-menu-dropdown__content', popoverProps?.className)
46
45
  },
47
46
  toggleProps: {
48
47
  tooltipPosition: 'bottom',
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/interface/src/components/more-menu-dropdown/index.js"],"names":["MoreMenuDropdown","as","DropdownComponent","DropdownMenu","className","label","popoverProps","toggleProps","children","moreVertical","placement","tooltipPosition","onClose"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;AAKe,SAASA,gBAAT,OAQX;AAAA,MARsC;AACzCC,IAAAA,EAAE,EAAEC,iBAAiB,GAAGC,wBADiB;AAEzCC,IAAAA,SAFyC;;AAGzC;AACAC,IAAAA,KAAK,GAAG,cAAI,SAAJ,CAJiC;AAKzCC,IAAAA,YALyC;AAMzCC,IAAAA,WANyC;AAOzCC,IAAAA;AAPyC,GAQtC;AACH,SACC,4BAAC,iBAAD;AACC,IAAA,SAAS,EAAG,yBACX,8BADW,EAEXJ,SAFW,CADb;AAKC,IAAA,IAAI,EAAGK,mBALR;AAMC,IAAA,KAAK,EAAGJ,KANT;AAOC,IAAA,YAAY,EAAG;AACdK,MAAAA,SAAS,EAAE,YADG;AAEd,SAAGJ,YAFW;AAGdF,MAAAA,SAAS,EAAE,yBACV,uCADU,EAEVE,YAFU,aAEVA,YAFU,uBAEVA,YAAY,CAAEF,SAFJ;AAHG,KAPhB;AAeC,IAAA,WAAW,EAAG;AACbO,MAAAA,eAAe,EAAE,QADJ;AAEb,SAAGJ;AAFU;AAff,KAoBKK,OAAF,IAAeJ,QAAQ,CAAEI,OAAF,CApB1B,CADD;AAwBA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { DropdownMenu } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { moreVertical } from '@wordpress/icons';\n\nexport default function MoreMenuDropdown( {\n\tas: DropdownComponent = DropdownMenu,\n\tclassName,\n\t/* translators: button label text should, if possible, be under 16 characters. */\n\tlabel = __( 'Options' ),\n\tpopoverProps,\n\ttoggleProps,\n\tchildren,\n} ) {\n\treturn (\n\t\t<DropdownComponent\n\t\t\tclassName={ classnames(\n\t\t\t\t'interface-more-menu-dropdown',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\ticon={ moreVertical }\n\t\t\tlabel={ label }\n\t\t\tpopoverProps={ {\n\t\t\t\tplacement: 'bottom-end',\n\t\t\t\t...popoverProps,\n\t\t\t\tclassName: classnames(\n\t\t\t\t\t'interface-more-menu-dropdown__content',\n\t\t\t\t\tpopoverProps?.className\n\t\t\t\t),\n\t\t\t} }\n\t\t\ttoggleProps={ {\n\t\t\t\ttooltipPosition: 'bottom',\n\t\t\t\t...toggleProps,\n\t\t\t} }\n\t\t>\n\t\t\t{ ( onClose ) => children( onClose ) }\n\t\t</DropdownComponent>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/interface/src/components/more-menu-dropdown/index.js"],"names":["MoreMenuDropdown","as","DropdownComponent","DropdownMenu","className","label","popoverProps","toggleProps","children","moreVertical","placement","tooltipPosition","onClose"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;AAKe,SAASA,gBAAT,CAA2B;AACzCC,EAAAA,EAAE,EAAEC,iBAAiB,GAAGC,wBADiB;AAEzCC,EAAAA,SAFyC;;AAGzC;AACAC,EAAAA,KAAK,GAAG,cAAI,SAAJ,CAJiC;AAKzCC,EAAAA,YALyC;AAMzCC,EAAAA,WANyC;AAOzCC,EAAAA;AAPyC,CAA3B,EAQX;AACH,SACC,4BAAC,iBAAD;AACC,IAAA,SAAS,EAAG,yBACX,8BADW,EAEXJ,SAFW,CADb;AAKC,IAAA,IAAI,EAAGK,mBALR;AAMC,IAAA,KAAK,EAAGJ,KANT;AAOC,IAAA,YAAY,EAAG;AACdK,MAAAA,SAAS,EAAE,YADG;AAEd,SAAGJ,YAFW;AAGdF,MAAAA,SAAS,EAAE,yBACV,uCADU,EAEVE,YAAY,EAAEF,SAFJ;AAHG,KAPhB;AAeC,IAAA,WAAW,EAAG;AACbO,MAAAA,eAAe,EAAE,QADJ;AAEb,SAAGJ;AAFU;AAff,KAoBKK,OAAF,IAAeJ,QAAQ,CAAEI,OAAF,CApB1B,CADD;AAwBA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { DropdownMenu } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { moreVertical } from '@wordpress/icons';\n\nexport default function MoreMenuDropdown( {\n\tas: DropdownComponent = DropdownMenu,\n\tclassName,\n\t/* translators: button label text should, if possible, be under 16 characters. */\n\tlabel = __( 'Options' ),\n\tpopoverProps,\n\ttoggleProps,\n\tchildren,\n} ) {\n\treturn (\n\t\t<DropdownComponent\n\t\t\tclassName={ classnames(\n\t\t\t\t'interface-more-menu-dropdown',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\ticon={ moreVertical }\n\t\t\tlabel={ label }\n\t\t\tpopoverProps={ {\n\t\t\t\tplacement: 'bottom-end',\n\t\t\t\t...popoverProps,\n\t\t\t\tclassName: classnames(\n\t\t\t\t\t'interface-more-menu-dropdown__content',\n\t\t\t\t\tpopoverProps?.className\n\t\t\t\t),\n\t\t\t} }\n\t\t\ttoggleProps={ {\n\t\t\t\ttooltipPosition: 'bottom',\n\t\t\t\t...toggleProps,\n\t\t\t} }\n\t\t>\n\t\t\t{ ( onClose ) => children( onClose ) }\n\t\t</DropdownComponent>\n\t);\n}\n"]}
@@ -26,16 +26,15 @@ var _store = require("../../store");
26
26
  /**
27
27
  * Internal dependencies
28
28
  */
29
- function MoreMenuFeatureToggle(_ref) {
30
- let {
31
- scope,
32
- label,
33
- info,
34
- messageActivated,
35
- messageDeactivated,
36
- shortcut,
37
- feature
38
- } = _ref;
29
+ function MoreMenuFeatureToggle({
30
+ scope,
31
+ label,
32
+ info,
33
+ messageActivated,
34
+ messageDeactivated,
35
+ shortcut,
36
+ feature
37
+ }) {
39
38
  const isActive = (0, _data.useSelect)(select => select(_store.store).isFeatureActive(scope, feature), [feature]);
40
39
  const {
41
40
  toggleFeature
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/interface/src/components/more-menu-feature-toggle/index.js"],"names":["MoreMenuFeatureToggle","scope","label","info","messageActivated","messageDeactivated","shortcut","feature","isActive","select","interfaceStore","isFeatureActive","toggleFeature","speakMessage","check"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAZA;AACA;AACA;;AAOA;AACA;AACA;AAGe,SAASA,qBAAT,OAQX;AAAA,MAR2C;AAC9CC,IAAAA,KAD8C;AAE9CC,IAAAA,KAF8C;AAG9CC,IAAAA,IAH8C;AAI9CC,IAAAA,gBAJ8C;AAK9CC,IAAAA,kBAL8C;AAM9CC,IAAAA,QAN8C;AAO9CC,IAAAA;AAP8C,GAQ3C;AACH,QAAMC,QAAQ,GAAG,qBACdC,MAAF,IACCA,MAAM,CAAEC,YAAF,CAAN,CAAyBC,eAAzB,CAA0CV,KAA1C,EAAiDM,OAAjD,CAFe,EAGhB,CAAEA,OAAF,CAHgB,CAAjB;AAKA,QAAM;AAAEK,IAAAA;AAAF,MAAoB,uBAAaF,YAAb,CAA1B;;AACA,QAAMG,YAAY,GAAG,MAAM;AAC1B,QAAKL,QAAL,EAAgB;AACf,uBAAOH,kBAAkB,IAAI,cAAI,qBAAJ,CAA7B;AACA,KAFD,MAEO;AACN,uBAAOD,gBAAgB,IAAI,cAAI,mBAAJ,CAA3B;AACA;AACD,GAND;;AAQA,SACC,4BAAC,oBAAD;AACC,IAAA,IAAI,EAAGI,QAAQ,IAAIM,YADpB;AAEC,IAAA,UAAU,EAAGN,QAFd;AAGC,IAAA,OAAO,EAAG,MAAM;AACfI,MAAAA,aAAa,CAAEX,KAAF,EAASM,OAAT,CAAb;AACAM,MAAAA,YAAY;AACZ,KANF;AAOC,IAAA,IAAI,EAAC,kBAPN;AAQC,IAAA,IAAI,EAAGV,IARR;AASC,IAAA,QAAQ,EAAGG;AATZ,KAWGJ,KAXH,CADD;AAeA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { MenuItem } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { check } from '@wordpress/icons';\nimport { speak } from '@wordpress/a11y';\n\n/**\n * Internal dependencies\n */\nimport { store as interfaceStore } from '../../store';\n\nexport default function MoreMenuFeatureToggle( {\n\tscope,\n\tlabel,\n\tinfo,\n\tmessageActivated,\n\tmessageDeactivated,\n\tshortcut,\n\tfeature,\n} ) {\n\tconst isActive = useSelect(\n\t\t( select ) =>\n\t\t\tselect( interfaceStore ).isFeatureActive( scope, feature ),\n\t\t[ feature ]\n\t);\n\tconst { toggleFeature } = useDispatch( interfaceStore );\n\tconst speakMessage = () => {\n\t\tif ( isActive ) {\n\t\t\tspeak( messageDeactivated || __( 'Feature deactivated' ) );\n\t\t} else {\n\t\t\tspeak( messageActivated || __( 'Feature activated' ) );\n\t\t}\n\t};\n\n\treturn (\n\t\t<MenuItem\n\t\t\ticon={ isActive && check }\n\t\t\tisSelected={ isActive }\n\t\t\tonClick={ () => {\n\t\t\t\ttoggleFeature( scope, feature );\n\t\t\t\tspeakMessage();\n\t\t\t} }\n\t\t\trole=\"menuitemcheckbox\"\n\t\t\tinfo={ info }\n\t\t\tshortcut={ shortcut }\n\t\t>\n\t\t\t{ label }\n\t\t</MenuItem>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/interface/src/components/more-menu-feature-toggle/index.js"],"names":["MoreMenuFeatureToggle","scope","label","info","messageActivated","messageDeactivated","shortcut","feature","isActive","select","interfaceStore","isFeatureActive","toggleFeature","speakMessage","check"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAZA;AACA;AACA;;AAOA;AACA;AACA;AAGe,SAASA,qBAAT,CAAgC;AAC9CC,EAAAA,KAD8C;AAE9CC,EAAAA,KAF8C;AAG9CC,EAAAA,IAH8C;AAI9CC,EAAAA,gBAJ8C;AAK9CC,EAAAA,kBAL8C;AAM9CC,EAAAA,QAN8C;AAO9CC,EAAAA;AAP8C,CAAhC,EAQX;AACH,QAAMC,QAAQ,GAAG,qBACdC,MAAF,IACCA,MAAM,CAAEC,YAAF,CAAN,CAAyBC,eAAzB,CAA0CV,KAA1C,EAAiDM,OAAjD,CAFe,EAGhB,CAAEA,OAAF,CAHgB,CAAjB;AAKA,QAAM;AAAEK,IAAAA;AAAF,MAAoB,uBAAaF,YAAb,CAA1B;;AACA,QAAMG,YAAY,GAAG,MAAM;AAC1B,QAAKL,QAAL,EAAgB;AACf,uBAAOH,kBAAkB,IAAI,cAAI,qBAAJ,CAA7B;AACA,KAFD,MAEO;AACN,uBAAOD,gBAAgB,IAAI,cAAI,mBAAJ,CAA3B;AACA;AACD,GAND;;AAQA,SACC,4BAAC,oBAAD;AACC,IAAA,IAAI,EAAGI,QAAQ,IAAIM,YADpB;AAEC,IAAA,UAAU,EAAGN,QAFd;AAGC,IAAA,OAAO,EAAG,MAAM;AACfI,MAAAA,aAAa,CAAEX,KAAF,EAASM,OAAT,CAAb;AACAM,MAAAA,YAAY;AACZ,KANF;AAOC,IAAA,IAAI,EAAC,kBAPN;AAQC,IAAA,IAAI,EAAGV,IARR;AASC,IAAA,QAAQ,EAAGG;AATZ,KAWGJ,KAXH,CADD;AAeA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { MenuItem } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { check } from '@wordpress/icons';\nimport { speak } from '@wordpress/a11y';\n\n/**\n * Internal dependencies\n */\nimport { store as interfaceStore } from '../../store';\n\nexport default function MoreMenuFeatureToggle( {\n\tscope,\n\tlabel,\n\tinfo,\n\tmessageActivated,\n\tmessageDeactivated,\n\tshortcut,\n\tfeature,\n} ) {\n\tconst isActive = useSelect(\n\t\t( select ) =>\n\t\t\tselect( interfaceStore ).isFeatureActive( scope, feature ),\n\t\t[ feature ]\n\t);\n\tconst { toggleFeature } = useDispatch( interfaceStore );\n\tconst speakMessage = () => {\n\t\tif ( isActive ) {\n\t\t\tspeak( messageDeactivated || __( 'Feature deactivated' ) );\n\t\t} else {\n\t\t\tspeak( messageActivated || __( 'Feature activated' ) );\n\t\t}\n\t};\n\n\treturn (\n\t\t<MenuItem\n\t\t\ticon={ isActive && check }\n\t\t\tisSelected={ isActive }\n\t\t\tonClick={ () => {\n\t\t\t\ttoggleFeature( scope, feature );\n\t\t\t\tspeakMessage();\n\t\t\t} }\n\t\t\trole=\"menuitemcheckbox\"\n\t\t\tinfo={ info }\n\t\t\tshortcut={ shortcut }\n\t\t>\n\t\t\t{ label }\n\t\t</MenuItem>\n\t);\n}\n"]}