@wordpress/edit-widgets 5.11.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 (116) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/blocks/widget-area/edit/index.js +24 -29
  3. package/build/blocks/widget-area/edit/index.js.map +1 -1
  4. package/build/blocks/widget-area/edit/inner-blocks.js +3 -4
  5. package/build/blocks/widget-area/edit/inner-blocks.js.map +1 -1
  6. package/build/blocks/widget-area/index.js +3 -6
  7. package/build/blocks/widget-area/index.js.map +1 -1
  8. package/build/components/error-boundary/index.js +8 -10
  9. package/build/components/error-boundary/index.js.map +1 -1
  10. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +3 -4
  11. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  12. package/build/components/keyboard-shortcut-help-modal/index.js +41 -50
  13. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  14. package/build/components/keyboard-shortcut-help-modal/shortcut.js +10 -12
  15. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  16. package/build/components/layout/index.js +3 -4
  17. package/build/components/layout/index.js.map +1 -1
  18. package/build/components/layout/interface.js +3 -4
  19. package/build/components/layout/interface.js.map +1 -1
  20. package/build/components/layout/unsaved-changes-warning.js +1 -1
  21. package/build/components/layout/unsaved-changes-warning.js.map +1 -1
  22. package/build/components/more-menu/tools-more-menu-group.js +5 -8
  23. package/build/components/more-menu/tools-more-menu-group.js.map +1 -1
  24. package/build/components/notices/index.js +11 -20
  25. package/build/components/notices/index.js.map +1 -1
  26. package/build/components/save-button/index.js +1 -3
  27. package/build/components/save-button/index.js.map +1 -1
  28. package/build/components/secondary-sidebar/list-view-sidebar.js +8 -3
  29. package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  30. package/build/components/sidebar/index.js +7 -8
  31. package/build/components/sidebar/index.js.map +1 -1
  32. package/build/components/sidebar/widget-areas.js +5 -6
  33. package/build/components/sidebar/widget-areas.js.map +1 -1
  34. package/build/components/welcome-guide/index.js +6 -7
  35. package/build/components/welcome-guide/index.js.map +1 -1
  36. package/build/components/widget-areas-block-editor-content/index.js +3 -4
  37. package/build/components/widget-areas-block-editor-content/index.js.map +1 -1
  38. package/build/components/widget-areas-block-editor-provider/index.js +12 -17
  39. package/build/components/widget-areas-block-editor-provider/index.js.map +1 -1
  40. package/build/filters/move-to-widget-area.js +2 -4
  41. package/build/filters/move-to-widget-area.js.map +1 -1
  42. package/build/hooks/use-last-selected-widget-area.js +2 -4
  43. package/build/hooks/use-last-selected-widget-area.js.map +1 -1
  44. package/build/hooks/use-widget-library-insertion-point.js +1 -3
  45. package/build/hooks/use-widget-library-insertion-point.js.map +1 -1
  46. package/build/store/actions.js +49 -74
  47. package/build/store/actions.js.map +1 -1
  48. package/build/store/index.js +1 -3
  49. package/build/store/index.js.map +1 -1
  50. package/build/store/reducer.js +3 -11
  51. package/build/store/reducer.js.map +1 -1
  52. package/build/store/resolvers.js +8 -10
  53. package/build/store/resolvers.js.map +1 -1
  54. package/build/store/selectors.js +15 -32
  55. package/build/store/selectors.js.map +1 -1
  56. package/build/store/transformers.js +1 -2
  57. package/build/store/transformers.js.map +1 -1
  58. package/build-module/blocks/widget-area/edit/index.js +24 -29
  59. package/build-module/blocks/widget-area/edit/index.js.map +1 -1
  60. package/build-module/blocks/widget-area/edit/inner-blocks.js +3 -4
  61. package/build-module/blocks/widget-area/edit/inner-blocks.js.map +1 -1
  62. package/build-module/blocks/widget-area/index.js +3 -6
  63. package/build-module/blocks/widget-area/index.js.map +1 -1
  64. package/build-module/components/error-boundary/index.js +8 -10
  65. package/build-module/components/error-boundary/index.js.map +1 -1
  66. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +3 -4
  67. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  68. package/build-module/components/keyboard-shortcut-help-modal/index.js +39 -48
  69. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  70. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +10 -12
  71. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  72. package/build-module/components/layout/index.js +3 -4
  73. package/build-module/components/layout/index.js.map +1 -1
  74. package/build-module/components/layout/interface.js +3 -4
  75. package/build-module/components/layout/interface.js.map +1 -1
  76. package/build-module/components/layout/unsaved-changes-warning.js +1 -1
  77. package/build-module/components/layout/unsaved-changes-warning.js.map +1 -1
  78. package/build-module/components/more-menu/tools-more-menu-group.js +5 -8
  79. package/build-module/components/more-menu/tools-more-menu-group.js.map +1 -1
  80. package/build-module/components/notices/index.js +11 -20
  81. package/build-module/components/notices/index.js.map +1 -1
  82. package/build-module/components/save-button/index.js +1 -3
  83. package/build-module/components/save-button/index.js.map +1 -1
  84. package/build-module/components/secondary-sidebar/list-view-sidebar.js +9 -3
  85. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  86. package/build-module/components/sidebar/index.js +9 -10
  87. package/build-module/components/sidebar/index.js.map +1 -1
  88. package/build-module/components/sidebar/widget-areas.js +5 -6
  89. package/build-module/components/sidebar/widget-areas.js.map +1 -1
  90. package/build-module/components/welcome-guide/index.js +6 -7
  91. package/build-module/components/welcome-guide/index.js.map +1 -1
  92. package/build-module/components/widget-areas-block-editor-content/index.js +3 -4
  93. package/build-module/components/widget-areas-block-editor-content/index.js.map +1 -1
  94. package/build-module/components/widget-areas-block-editor-provider/index.js +12 -17
  95. package/build-module/components/widget-areas-block-editor-provider/index.js.map +1 -1
  96. package/build-module/filters/move-to-widget-area.js +2 -4
  97. package/build-module/filters/move-to-widget-area.js.map +1 -1
  98. package/build-module/hooks/use-last-selected-widget-area.js +2 -4
  99. package/build-module/hooks/use-last-selected-widget-area.js.map +1 -1
  100. package/build-module/hooks/use-widget-library-insertion-point.js +1 -3
  101. package/build-module/hooks/use-widget-library-insertion-point.js.map +1 -1
  102. package/build-module/store/actions.js +49 -74
  103. package/build-module/store/actions.js.map +1 -1
  104. package/build-module/store/index.js +1 -3
  105. package/build-module/store/index.js.map +1 -1
  106. package/build-module/store/reducer.js +3 -11
  107. package/build-module/store/reducer.js.map +1 -1
  108. package/build-module/store/resolvers.js +8 -10
  109. package/build-module/store/resolvers.js.map +1 -1
  110. package/build-module/store/selectors.js +15 -32
  111. package/build-module/store/selectors.js.map +1 -1
  112. package/build-module/store/transformers.js +1 -2
  113. package/build-module/store/transformers.js.map +1 -1
  114. package/package.json +27 -27
  115. package/src/components/secondary-sidebar/list-view-sidebar.js +8 -1
  116. package/src/components/sidebar/index.js +3 -3
package/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 5.12.0 (2023-06-07)
6
+
5
7
  ## 5.11.0 (2023-05-24)
6
8
 
7
9
  ## 5.10.0 (2023-05-10)
@@ -30,15 +30,14 @@ var _useIsDraggingWithin = _interopRequireDefault(require("./use-is-dragging-wit
30
30
  */
31
31
 
32
32
  /** @typedef {import('@wordpress/element').RefObject} RefObject */
33
- function WidgetAreaEdit(_ref) {
34
- let {
35
- clientId,
36
- className,
37
- attributes: {
38
- id,
39
- name
40
- }
41
- } = _ref;
33
+ function WidgetAreaEdit({
34
+ clientId,
35
+ className,
36
+ attributes: {
37
+ id,
38
+ name
39
+ }
40
+ }) {
42
41
  const isOpen = (0, _data.useSelect)(select => select(_store.store).getIsWidgetAreaOpen(clientId), [clientId]);
43
42
  const {
44
43
  setIsWidgetAreaOpen
@@ -71,26 +70,22 @@ function WidgetAreaEdit(_ref) {
71
70
  setIsWidgetAreaOpen(clientId, !isOpen);
72
71
  },
73
72
  scrollAfterOpen: !isDragging
74
- }, _ref2 => {
75
- let {
76
- opened
77
- } = _ref2;
78
- return (// This is required to ensure LegacyWidget blocks are not
79
- // unmounted when the panel is collapsed. Unmounting legacy
80
- // widgets may have unintended consequences (e.g. TinyMCE
81
- // not being properly reinitialized)
82
- (0, _element.createElement)(_components.__unstableDisclosureContent, {
83
- className: "wp-block-widget-area__panel-body-content",
84
- visible: opened
85
- }, (0, _element.createElement)(_coreData.EntityProvider, {
86
- kind: "root",
87
- type: "postType",
88
- id: `widget-area-${id}`
89
- }, (0, _element.createElement)(_innerBlocks.default, {
90
- id: id
91
- })))
92
- );
93
- }));
73
+ }, ({
74
+ opened
75
+ }) => // This is required to ensure LegacyWidget blocks are not
76
+ // unmounted when the panel is collapsed. Unmounting legacy
77
+ // widgets may have unintended consequences (e.g. TinyMCE
78
+ // not being properly reinitialized)
79
+ (0, _element.createElement)(_components.__unstableDisclosureContent, {
80
+ className: "wp-block-widget-area__panel-body-content",
81
+ visible: opened
82
+ }, (0, _element.createElement)(_coreData.EntityProvider, {
83
+ kind: "root",
84
+ type: "postType",
85
+ id: `widget-area-${id}`
86
+ }, (0, _element.createElement)(_innerBlocks.default, {
87
+ id: id
88
+ })))));
94
89
  }
95
90
  /**
96
91
  * A React hook to determine if dragging is active.
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-widgets/src/blocks/widget-area/edit/index.js"],"names":["WidgetAreaEdit","clientId","className","attributes","id","name","isOpen","select","editWidgetsStore","getIsWidgetAreaOpen","setIsWidgetAreaOpen","wrapper","setOpen","openState","isDragging","useIsDragging","isDraggingWithin","openedWhileDragging","setOpenedWhileDragging","opened","elementRef","setIsDragging","ownerDocument","current","handleDragStart","handleDragEnd","addEventListener","removeEventListener"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AASA;;AACA;;AACA;;AAjBA;AACA;AACA;;AAUA;AACA;AACA;;AAKA;AAEe,SAASA,cAAT,OAIX;AAAA,MAJoC;AACvCC,IAAAA,QADuC;AAEvCC,IAAAA,SAFuC;AAGvCC,IAAAA,UAAU,EAAE;AAAEC,MAAAA,EAAF;AAAMC,MAAAA;AAAN;AAH2B,GAIpC;AACH,QAAMC,MAAM,GAAG,qBACZC,MAAF,IACCA,MAAM,CAAEC,YAAF,CAAN,CA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A;AAAF,KAAF;AAAA,WACD;AACA;AACA;AACA;AACA,kCAAC,uCAAD;AACC,QAAA,SAAS,EAAC,0CADX;AAEC,QAAA,OAAO,EAAGA;AAFX,SAIC,4BAAC,wBAAD;AACC,QAAA,IAAI,EAAC,MADN;AAEC,QAAA,IAAI,EAAC,UAFN;AAGC,QAAA,EAAE,EAAI,eAAef,EAAI;AAH1B,SAKC,4BAAC,oBAAD;AAAuB,QAAA,EAAE,EAAGA;AAA5B,QALD,CAJD;AALC;AAAA,GARH,CADD,CADD;AA+BA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMW,aAAa,GAAKK,UAAF,IAAkB;AACvC,QAAM,CAAEN,UAAF,EAAcO,aAAd,IAAgC,uBAAU,KAAV,CAAtC;AAEA,0BAAW,MAAM;AAChB,UAAM;AAAEC,MAAAA;AAAF,QAAoBF,UAAU,CAACG,OAArC;;AAEA,aAASC,eAAT,GAA2B;AAC1BH,MAAAA,aAAa,CAAE,IAAF,CAAb;AACA;;AAED,aAASI,aAAT,GAAyB;AACxBJ,MAAAA,aAAa,CAAE,KAAF,CAAb;AACA;;AAEDC,IAAAA,aAAa,CAACI,gBAAd,CAAgC,WAAhC,EAA6CF,eAA7C;AACAF,IAAAA,aAAa,CAACI,gBAAd,CAAgC,SAAhC,EAA2CD,aAA3C;AAEA,WAAO,MAAM;AACZH,MAAAA,aAAa,CAACK,mBAAd,CAAmC,WAAnC,EAAgDH,eAAhD;AACAF,MAAAA,aAAa,CAACK,mBAAd,CAAmC,SAAnC,EAA8CF,aAA9C;AACA,KAHD;AAIA,GAlBD,EAkBG,EAlBH;AAoBA,SAAOX,UAAP;AACA,CAxBD","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useState, useCallback, useRef } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { EntityProvider } from '@wordpress/core-data';\nimport {\n\t__unstableDisclosureContent as DisclosureContent,\n\tPanel,\n\tPanelBody,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport WidgetAreaInnerBlocks from './inner-blocks';\nimport { store as editWidgetsStore } from '../../../store';\nimport useIsDraggingWithin from './use-is-dragging-within';\n\n/** @typedef {import('@wordpress/element').RefObject} RefObject */\n\nexport default function WidgetAreaEdit( {\n\tclientId,\n\tclassName,\n\tattributes: { id, name },\n} ) {\n\tconst isOpen = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editWidgetsStore ).getIsWidgetAreaOpen( clientId ),\n\t\t[ clientId ]\n\t);\n\tconst { setIsWidgetAreaOpen } = useDispatch( editWidgetsStore );\n\n\tconst wrapper = useRef();\n\tconst setOpen = useCallback(\n\t\t( openState ) => setIsWidgetAreaOpen( clientId, openState ),\n\t\t[ clientId ]\n\t);\n\tconst isDragging = useIsDragging( wrapper );\n\tconst isDraggingWithin = useIsDraggingWithin( wrapper );\n\n\tconst [ openedWhileDragging, setOpenedWhileDragging ] = useState( false );\n\tuseEffect( () => {\n\t\tif ( ! isDragging ) {\n\t\t\tsetOpenedWhileDragging( false );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isDraggingWithin && ! isOpen ) {\n\t\t\tsetOpen( true );\n\t\t\tsetOpenedWhileDragging( true );\n\t\t} else if ( ! isDraggingWithin && isOpen && openedWhileDragging ) {\n\t\t\tsetOpen( false );\n\t\t}\n\t}, [ isOpen, isDragging, isDraggingWithin, openedWhileDragging ] );\n\n\treturn (\n\t\t<Panel className={ className } ref={ wrapper }>\n\t\t\t<PanelBody\n\t\t\t\ttitle={ name }\n\t\t\t\topened={ isOpen }\n\t\t\t\tonToggle={ () => {\n\t\t\t\t\tsetIsWidgetAreaOpen( clientId, ! isOpen );\n\t\t\t\t} }\n\t\t\t\tscrollAfterOpen={ ! isDragging }\n\t\t\t>\n\t\t\t\t{ ( { opened } ) => (\n\t\t\t\t\t// This is required to ensure LegacyWidget blocks are not\n\t\t\t\t\t// unmounted when the panel is collapsed. Unmounting legacy\n\t\t\t\t\t// widgets may have unintended consequences (e.g. TinyMCE\n\t\t\t\t\t// not being properly reinitialized)\n\t\t\t\t\t<DisclosureContent\n\t\t\t\t\t\tclassName=\"wp-block-widget-area__panel-body-content\"\n\t\t\t\t\t\tvisible={ opened }\n\t\t\t\t\t>\n\t\t\t\t\t\t<EntityProvider\n\t\t\t\t\t\t\tkind=\"root\"\n\t\t\t\t\t\t\ttype=\"postType\"\n\t\t\t\t\t\t\tid={ `widget-area-${ id }` }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<WidgetAreaInnerBlocks id={ id } />\n\t\t\t\t\t\t</EntityProvider>\n\t\t\t\t\t</DisclosureContent>\n\t\t\t\t) }\n\t\t\t</PanelBody>\n\t\t</Panel>\n\t);\n}\n\n/**\n * A React hook to determine if dragging is active.\n *\n * @param {RefObject<HTMLElement>} elementRef The target elementRef object.\n *\n * @return {boolean} Is dragging within the entire document.\n */\nconst useIsDragging = ( elementRef ) => {\n\tconst [ isDragging, setIsDragging ] = useState( false );\n\n\tuseEffect( () => {\n\t\tconst { ownerDocument } = elementRef.current;\n\n\t\tfunction handleDragStart() {\n\t\t\tsetIsDragging( true );\n\t\t}\n\n\t\tfunction handleDragEnd() {\n\t\t\tsetIsDragging( false );\n\t\t}\n\n\t\townerDocument.addEventListener( 'dragstart', handleDragStart );\n\t\townerDocument.addEventListener( 'dragend', handleDragEnd );\n\n\t\treturn () => {\n\t\t\townerDocument.removeEventListener( 'dragstart', handleDragStart );\n\t\t\townerDocument.removeEventListener( 'dragend', handleDragEnd );\n\t\t};\n\t}, [] );\n\n\treturn isDragging;\n};\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-widgets/src/blocks/widget-area/edit/index.js"],"names":["WidgetAreaEdit","clientId","className","attributes","id","name","isOpen","select","editWidgetsStore","getIsWidgetAreaOpen","setIsWidgetAreaOpen","wrapper","setOpen","openState","isDragging","useIsDragging","isDraggingWithin","openedWhileDragging","setOpenedWhileDragging","opened","elementRef","setIsDragging","ownerDocument","current","handleDragStart","handle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AAhD;AACAF,MAAAA,aAAa,CAACK,mBAAd,CAAmC,SAAnC,EAA8CF,aAA9C;AACA,KAHD;AAIA,GAlBD,EAkBG,EAlBH;AAoBA,SAAOX,UAAP;AACA,CAxBD","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useState, useCallback, useRef } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { EntityProvider } from '@wordpress/core-data';\nimport {\n\t__unstableDisclosureContent as DisclosureContent,\n\tPanel,\n\tPanelBody,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport WidgetAreaInnerBlocks from './inner-blocks';\nimport { store as editWidgetsStore } from '../../../store';\nimport useIsDraggingWithin from './use-is-dragging-within';\n\n/** @typedef {import('@wordpress/element').RefObject} RefObject */\n\nexport default function WidgetAreaEdit( {\n\tclientId,\n\tclassName,\n\tattributes: { id, name },\n} ) {\n\tconst isOpen = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editWidgetsStore ).getIsWidgetAreaOpen( clientId ),\n\t\t[ clientId ]\n\t);\n\tconst { setIsWidgetAreaOpen } = useDispatch( editWidgetsStore );\n\n\tconst wrapper = useRef();\n\tconst setOpen = useCallback(\n\t\t( openState ) => setIsWidgetAreaOpen( clientId, openState ),\n\t\t[ clientId ]\n\t);\n\tconst isDragging = useIsDragging( wrapper );\n\tconst isDraggingWithin = useIsDraggingWithin( wrapper );\n\n\tconst [ openedWhileDragging, setOpenedWhileDragging ] = useState( false );\n\tuseEffect( () => {\n\t\tif ( ! isDragging ) {\n\t\t\tsetOpenedWhileDragging( false );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isDraggingWithin && ! isOpen ) {\n\t\t\tsetOpen( true );\n\t\t\tsetOpenedWhileDragging( true );\n\t\t} else if ( ! isDraggingWithin && isOpen && openedWhileDragging ) {\n\t\t\tsetOpen( false );\n\t\t}\n\t}, [ isOpen, isDragging, isDraggingWithin, openedWhileDragging ] );\n\n\treturn (\n\t\t<Panel className={ className } ref={ wrapper }>\n\t\t\t<PanelBody\n\t\t\t\ttitle={ name }\n\t\t\t\topened={ isOpen }\n\t\t\t\tonToggle={ () => {\n\t\t\t\t\tsetIsWidgetAreaOpen( clientId, ! isOpen );\n\t\t\t\t} }\n\t\t\t\tscrollAfterOpen={ ! isDragging }\n\t\t\t>\n\t\t\t\t{ ( { opened } ) => (\n\t\t\t\t\t// This is required to ensure LegacyWidget blocks are not\n\t\t\t\t\t// unmounted when the panel is collapsed. Unmounting legacy\n\t\t\t\t\t// widgets may have unintended consequences (e.g. TinyMCE\n\t\t\t\t\t// not being properly reinitialized)\n\t\t\t\t\t<DisclosureContent\n\t\t\t\t\t\tclassName=\"wp-block-widget-area__panel-body-content\"\n\t\t\t\t\t\tvisible={ opened }\n\t\t\t\t\t>\n\t\t\t\t\t\t<EntityProvider\n\t\t\t\t\t\t\tkind=\"root\"\n\t\t\t\t\t\t\ttype=\"postType\"\n\t\t\t\t\t\t\tid={ `widget-area-${ id }` }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<WidgetAreaInnerBlocks id={ id } />\n\t\t\t\t\t\t</EntityProvider>\n\t\t\t\t\t</DisclosureContent>\n\t\t\t\t) }\n\t\t\t</PanelBody>\n\t\t</Panel>\n\t);\n}\n\n/**\n * A React hook to determine if dragging is active.\n *\n * @param {RefObject<HTMLElement>} elementRef The target elementRef object.\n *\n * @return {boolean} Is dragging within the entire document.\n */\nconst useIsDragging = ( elementRef ) => {\n\tconst [ isDragging, setIsDragging ] = useState( false );\n\n\tuseEffect( () => {\n\t\tconst { ownerDocument } = elementRef.current;\n\n\t\tfunction handleDragStart() {\n\t\t\tsetIsDragging( true );\n\t\t}\n\n\t\tfunction handleDragEnd() {\n\t\t\tsetIsDragging( false );\n\t\t}\n\n\t\townerDocument.addEventListener( 'dragstart', handleDragStart );\n\t\townerDocument.addEventListener( 'dragend', handleDragEnd );\n\n\t\treturn () => {\n\t\t\townerDocument.removeEventListener( 'dragstart', handleDragStart );\n\t\t\townerDocument.removeEventListener( 'dragend', handleDragEnd );\n\t\t};\n\t}, [] );\n\n\treturn isDragging;\n};\n"]}
@@ -28,10 +28,9 @@ var _useIsDraggingWithin = _interopRequireDefault(require("./use-is-dragging-wit
28
28
  /**
29
29
  * Internal dependencies
30
30
  */
31
- function WidgetAreaInnerBlocks(_ref) {
32
- let {
33
- id
34
- } = _ref;
31
+ function WidgetAreaInnerBlocks({
32
+ id
33
+ }) {
35
34
  const [blocks, onInput, onChange] = (0, _coreData.useEntityBlockEditor)('root', 'postType');
36
35
  const innerBlocksRef = (0, _element.useRef)();
37
36
  const isDraggingWithinInnerBlocks = (0, _useIsDraggingWithin.default)(innerBlocksRef);
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-widgets/src/blocks/widget-area/edit/inner-blocks.js"],"names":["WidgetAreaInnerBlocks","id","blocks","onInput","onChange","innerBlocksRef","isDraggingWithinInnerBlocks","shouldHighlightDropZone","innerBlocksProps","ref","value","templateLock","renderAppender","InnerBlocks","ButtonBlockAppender"],"mappings":";;;;;;;;;AAUA;;AAPA;;AAKA;;AACA;;AAMA;;AAfA;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;AAGe,SAASA,qBAAT,OAAyC;AAAA,MAAT;AAAEC,IAAAA;AAAF,GAAS;AACvD,QAAM,CAAEC,MAAF,EAAUC,OAAV,EAAmBC,QAAnB,IAAgC,oCACrC,MADqC,EAErC,UAFqC,CAAtC;AAIA,QAAMC,cAAc,GAAG,sBAAvB;AACA,QAAMC,2BAA2B,GAAG,kCAAqBD,cAArB,CAApC;AACA,QAAME,uBAAuB,GAAGD,2BAAhC,CAPuD,CAQvD;;AACA,QAAME,gBAAgB,GAAG,sCACxB;AAAEC,IAAAA,GAAG,EAAEJ;AAAP,GADwB,EAExB;AACCK,IAAAA,KAAK,EAAER,MADR;AAECC,IAAAA,OAFD;AAGCC,IAAAA,QAHD;AAICO,IAAAA,YAAY,EAAE,KAJf;AAKCC,IAAAA,cAAc,EAAEC,yBAAYC;AAL7B,GAFwB,CAAzB;AAWA,SACC;AACC,2BAAsBb,EADvB;AAEC,IAAA,SAAS,EAAG,yBACX,oFADW,EAEX;AACC,mDACCM;AAFF,KAFW;AAFb,KAUC,mCAAUC,gBAAV,CAVD,CADD;AAcA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useEntityBlockEditor } from '@wordpress/core-data';\nimport { InnerBlocks, useInnerBlocksProps } from '@wordpress/block-editor';\nimport { useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport useIsDraggingWithin from './use-is-dragging-within';\n\nexport default function WidgetAreaInnerBlocks( { id } ) {\n\tconst [ blocks, onInput, onChange ] = useEntityBlockEditor(\n\t\t'root',\n\t\t'postType'\n\t);\n\tconst innerBlocksRef = useRef();\n\tconst isDraggingWithinInnerBlocks = useIsDraggingWithin( innerBlocksRef );\n\tconst shouldHighlightDropZone = isDraggingWithinInnerBlocks;\n\t// Using the experimental hook so that we can control the className of the element.\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{ ref: innerBlocksRef },\n\t\t{\n\t\t\tvalue: blocks,\n\t\t\tonInput,\n\t\t\tonChange,\n\t\t\ttemplateLock: false,\n\t\t\trenderAppender: InnerBlocks.ButtonBlockAppender,\n\t\t}\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tdata-widget-area-id={ id }\n\t\t\tclassName={ classnames(\n\t\t\t\t'wp-block-widget-area__inner-blocks block-editor-inner-blocks editor-styles-wrapper',\n\t\t\t\t{\n\t\t\t\t\t'wp-block-widget-area__highlight-drop-zone':\n\t\t\t\t\t\tshouldHighlightDropZone,\n\t\t\t\t}\n\t\t\t) }\n\t\t>\n\t\t\t<div { ...innerBlocksProps } />\n\t\t</div>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-widgets/src/blocks/widget-area/edit/inner-blocks.js"],"names":["WidgetAreaInnerBlocks","id","blocks","onInput","onChange","innerBlocksRef","isDraggingWithinInnerBlocks","shouldHighlightDropZone","innerBlocksProps","ref","value","templateLock","renderAppender","InnerBlocks","ButtonBlockAppender"],"mappings":";;;;;;;;;AAUA;;AAPA;;AAKA;;AACA;;AAMA;;AAfA;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;AAGe,SAASA,qBAAT,CAAgC;AAAEC,EAAAA;AAAF,CAAhC,EAAyC;AACvD,QAAM,CAAEC,MAAF,EAAUC,OAAV,EAAmBC,QAAnB,IAAgC,oCACrC,MADqC,EAErC,UAFqC,CAAtC;AAIA,QAAMC,cAAc,GAAG,sBAAvB;AACA,QAAMC,2BAA2B,GAAG,kCAAqBD,cAArB,CAApC;AACA,QAAME,uBAAuB,GAAGD,2BAAhC,CAPuD,CAQvD;;AACA,QAAME,gBAAgB,GAAG,sCACxB;AAAEC,IAAAA,GAAG,EAAEJ;AAAP,GADwB,EAExB;AACCK,IAAAA,KAAK,EAAER,MADR;AAECC,IAAAA,OAFD;AAGCC,IAAAA,QAHD;AAICO,IAAAA,YAAY,EAAE,KAJf;AAKCC,IAAAA,cAAc,EAAEC,yBAAYC;AAL7B,GAFwB,CAAzB;AAWA,SACC;AACC,2BAAsBb,EADvB;AAEC,IAAA,SAAS,EAAG,yBACX,oFADW,EAEX;AACC,mDACCM;AAFF,KAFW;AAFb,KAUC,mCAAUC,gBAAV,CAVD,CADD;AAcA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useEntityBlockEditor } from '@wordpress/core-data';\nimport { InnerBlocks, useInnerBlocksProps } from '@wordpress/block-editor';\nimport { useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport useIsDraggingWithin from './use-is-dragging-within';\n\nexport default function WidgetAreaInnerBlocks( { id } ) {\n\tconst [ blocks, onInput, onChange ] = useEntityBlockEditor(\n\t\t'root',\n\t\t'postType'\n\t);\n\tconst innerBlocksRef = useRef();\n\tconst isDraggingWithinInnerBlocks = useIsDraggingWithin( innerBlocksRef );\n\tconst shouldHighlightDropZone = isDraggingWithinInnerBlocks;\n\t// Using the experimental hook so that we can control the className of the element.\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{ ref: innerBlocksRef },\n\t\t{\n\t\t\tvalue: blocks,\n\t\t\tonInput,\n\t\t\tonChange,\n\t\t\ttemplateLock: false,\n\t\t\trenderAppender: InnerBlocks.ButtonBlockAppender,\n\t\t}\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tdata-widget-area-id={ id }\n\t\t\tclassName={ classnames(\n\t\t\t\t'wp-block-widget-area__inner-blocks block-editor-inner-blocks editor-styles-wrapper',\n\t\t\t\t{\n\t\t\t\t\t'wp-block-widget-area__highlight-drop-zone':\n\t\t\t\t\t\tshouldHighlightDropZone,\n\t\t\t\t}\n\t\t\t) }\n\t\t>\n\t\t\t<div { ...innerBlocksProps } />\n\t\t</div>\n\t);\n}\n"]}
@@ -49,12 +49,9 @@ exports.name = name;
49
49
  const settings = {
50
50
  title: (0, _i18n.__)('Widget Area'),
51
51
  description: (0, _i18n.__)('A widget area container.'),
52
- __experimentalLabel: _ref => {
53
- let {
54
- name: label
55
- } = _ref;
56
- return label;
57
- },
52
+ __experimentalLabel: ({
53
+ name: label
54
+ }) => label,
58
55
  edit: _edit.default
59
56
  };
60
57
  exports.settings = settings;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-widgets/src/blocks/widget-area/index.js"],"names":["name","metadata","settings","title","description","__experimentalLabel","label","edit"],"mappings":";;;;;;;;;AAGA;;AAMA;;AATA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAGO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,KAAK,EAAE,cAAI,aAAJ,CADgB;AAEvBC,EAAAA,WAAW,EAAE,cAAI,0BAAJ,CAFU;AAGvBC,EAAAA,mBAAmB,EAAE;AAAA,QAAE;AAAEL,MAAAA,IAAI,EAAEM;AAAR,KAAF;AAAA,WAAuBA,KAAvB;AAAA,GAHE;AAIvBC,EAAAA,IAAI,EAAJA;AAJuB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport metadata from './block.json';\nimport edit from './edit';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ttitle: __( 'Widget Area' ),\n\tdescription: __( 'A widget area container.' ),\n\t__experimentalLabel: ( { name: label } ) => label,\n\tedit,\n};\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-widgets/src/blocks/widget-area/index.js"],"names":["name","metadata","settings","title","description","__experimentalLabel","label","edit"],"mappings":";;;;;;;;;AAGA;;AAMA;;AATA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAGO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,KAAK,EAAE,cAAI,aAAJ,CADgB;AAEvBC,EAAAA,WAAW,EAAE,cAAI,0BAAJ,CAFU;AAGvBC,EAAAA,mBAAmB,EAAE,CAAE;AAAEL,IAAAA,IAAI,EAAEM;AAAR,GAAF,KAAuBA,KAHrB;AAIvBC,EAAAA,IAAI,EAAJA;AAJuB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport metadata from './block.json';\nimport edit from './edit';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ttitle: __( 'Widget Area' ),\n\tdescription: __( 'A widget area container.' ),\n\t__experimentalLabel: ( { name: label } ) => label,\n\tedit,\n};\n"]}
@@ -20,11 +20,10 @@ var _hooks = require("@wordpress/hooks");
20
20
  /**
21
21
  * WordPress dependencies
22
22
  */
23
- function CopyButton(_ref) {
24
- let {
25
- text,
26
- children
27
- } = _ref;
23
+ function CopyButton({
24
+ text,
25
+ children
26
+ }) {
28
27
  const ref = (0, _compose.useCopyToClipboard)(text);
29
28
  return (0, _element.createElement)(_components.Button, {
30
29
  variant: "secondary",
@@ -32,11 +31,10 @@ function CopyButton(_ref) {
32
31
  }, children);
33
32
  }
34
33
 
35
- function ErrorBoundaryWarning(_ref2) {
36
- let {
37
- message,
38
- error
39
- } = _ref2;
34
+ function ErrorBoundaryWarning({
35
+ message,
36
+ error
37
+ }) {
40
38
  const actions = [(0, _element.createElement)(CopyButton, {
41
39
  key: "copy-error",
42
40
  text: error.stack
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-widgets/src/components/error-boundary/index.js"],"names":["CopyButton","text","children","ref","ErrorBoundaryWarning","message","error","actions","stack","ErrorBoundary","Component","constructor","arguments","state","componentDidCatch","getDerivedStateFromError","render","props"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AARA;AACA;AACA;AAQA,SAASA,UAAT,OAA0C;AAAA,MAArB;AAAEC,IAAAA,IAAF;AAAQC,IAAAA;AAAR,GAAqB;AACzC,QAAMC,GAAG,GAAG,iCAAoBF,IAApB,CAAZ;AACA,SACC,4BAAC,kBAAD;AAAQ,IAAA,OAAO,EAAC,WAAhB;AAA4B,IAAA,GAAG,EAAGE;AAAlC,KACGD,QADH,CADD;AAKA;;AAED,SAASE,oBAAT,QAAoD;AAAA,MAArB;AAAEC,IAAAA,OAAF;AAAWC,IAAAA;AAAX,GAAqB;AACnD,QAAMC,OAAO,GAAG,CACf,4BAAC,UAAD;AAAY,IAAA,GAAG,EAAC,YAAhB;AAA6B,IAAA,IAAI,EAAGD,KAAK,CAACE;AAA1C,KACG,cAAI,YAAJ,CADH,CADe,CAAhB;AAMA,SACC,4BAAC,oBAAD;AAAS,IAAA,SAAS,EAAC,6BAAnB;AAAiD,IAAA,OAAO,EAAGD;AAA3D,KACGF,OADH,CADD;AAKA;;AAEc,MAAMI,aAAN,SAA4BC,kBAA5B,CAAsC;AACpDC,EAAAA,WAAW,GAAG;AACb,UAAO,GAAGC,SAAV;AAEA,SAAKC,KAAL,GAAa;AACZP,MAAAA,KAAK,EAAE;AADK,KAAb;AAGA;;AAEDQ,EAAAA,iBAAiB,CAAER,KAAF,EAAU;AAC1B,yBAAU,kCAAV,EAA8CA,KAA9C;AACA;;AAE8B,SAAxBS,wBAAwB,CAAET,KAAF,EAAU;AACxC,WAAO;AAAEA,MAAAA;AAAF,KAAP;AACA;;AAEDU,EAAAA,MAAM,GAAG;AACR,QAAK,CAAE,KAAKH,KAAL,CAAWP,KAAlB,EAA0B;AACzB,aAAO,KAAKW,KAAL,CAAWf,QAAlB;AACA;;AAED,WACC,4BAAC,oBAAD;AACC,MAAA,OAAO,EAAG,cACT,iDADS,CADX;AAIC,MAAA,KAAK,EAAG,KAAKW,KAAL,CAAWP;AAJpB,MADD;AAQA;;AA9BmD","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { Warning } from '@wordpress/block-editor';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { doAction } from '@wordpress/hooks';\n\nfunction CopyButton( { text, children } ) {\n\tconst ref = useCopyToClipboard( text );\n\treturn (\n\t\t<Button variant=\"secondary\" ref={ ref }>\n\t\t\t{ children }\n\t\t</Button>\n\t);\n}\n\nfunction ErrorBoundaryWarning( { message, error } ) {\n\tconst actions = [\n\t\t<CopyButton key=\"copy-error\" text={ error.stack }>\n\t\t\t{ __( 'Copy Error' ) }\n\t\t</CopyButton>,\n\t];\n\n\treturn (\n\t\t<Warning className=\"edit-widgets-error-boundary\" actions={ actions }>\n\t\t\t{ message }\n\t\t</Warning>\n\t);\n}\n\nexport default class ErrorBoundary extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.state = {\n\t\t\terror: null,\n\t\t};\n\t}\n\n\tcomponentDidCatch( error ) {\n\t\tdoAction( 'editor.ErrorBoundary.errorLogged', error );\n\t}\n\n\tstatic getDerivedStateFromError( error ) {\n\t\treturn { error };\n\t}\n\n\trender() {\n\t\tif ( ! this.state.error ) {\n\t\t\treturn this.props.children;\n\t\t}\n\n\t\treturn (\n\t\t\t<ErrorBoundaryWarning\n\t\t\t\tmessage={ __(\n\t\t\t\t\t'The editor has encountered an unexpected error.'\n\t\t\t\t) }\n\t\t\t\terror={ this.state.error }\n\t\t\t/>\n\t\t);\n\t}\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-widgets/src/components/error-boundary/index.js"],"names":["CopyButton","text","children","ref","ErrorBoundaryWarning","message","error","actions","stack","ErrorBoundary","Component","constructor","arguments","state","componentDidCatch","getDerivedStateFromError","render","props"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AARA;AACA;AACA;AAQA,SAASA,UAAT,CAAqB;AAAEC,EAAAA,IAAF;AAAQC,EAAAA;AAAR,CAArB,EAA0C;AACzC,QAAMC,GAAG,GAAG,iCAAoBF,IAApB,CAAZ;AACA,SACC,4BAAC,kBAAD;AAAQ,IAAA,OAAO,EAAC,WAAhB;AAA4B,IAAA,GAAG,EAAGE;AAAlC,KACGD,QADH,CADD;AAKA;;AAED,SAASE,oBAAT,CAA+B;AAAEC,EAAAA,OAAF;AAAWC,EAAAA;AAAX,CAA/B,EAAoD;AACnD,QAAMC,OAAO,GAAG,CACf,4BAAC,UAAD;AAAY,IAAA,GAAG,EAAC,YAAhB;AAA6B,IAAA,IAAI,EAAGD,KAAK,CAACE;AAA1C,KACG,cAAI,YAAJ,CADH,CADe,CAAhB;AAMA,SACC,4BAAC,oBAAD;AAAS,IAAA,SAAS,EAAC,6BAAnB;AAAiD,IAAA,OAAO,EAAGD;AAA3D,KACGF,OADH,CADD;AAKA;;AAEc,MAAMI,aAAN,SAA4BC,kBAA5B,CAAsC;AACpDC,EAAAA,WAAW,GAAG;AACb,UAAO,GAAGC,SAAV;AAEA,SAAKC,KAAL,GAAa;AACZP,MAAAA,KAAK,EAAE;AADK,KAAb;AAGA;;AAEDQ,EAAAA,iBAAiB,CAAER,KAAF,EAAU;AAC1B,yBAAU,kCAAV,EAA8CA,KAA9C;AACA;;AAE8B,SAAxBS,wBAAwB,CAAET,KAAF,EAAU;AACxC,WAAO;AAAEA,MAAAA;AAAF,KAAP;AACA;;AAEDU,EAAAA,MAAM,GAAG;AACR,QAAK,CAAE,KAAKH,KAAL,CAAWP,KAAlB,EAA0B;AACzB,aAAO,KAAKW,KAAL,CAAWf,QAAlB;AACA;;AAED,WACC,4BAAC,oBAAD;AACC,MAAA,OAAO,EAAG,cACT,iDADS,CADX;AAIC,MAAA,KAAK,EAAG,KAAKW,KAAL,CAAWP;AAJpB,MADD;AAQA;;AA9BmD","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { Warning } from '@wordpress/block-editor';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { doAction } from '@wordpress/hooks';\n\nfunction CopyButton( { text, children } ) {\n\tconst ref = useCopyToClipboard( text );\n\treturn (\n\t\t<Button variant=\"secondary\" ref={ ref }>\n\t\t\t{ children }\n\t\t</Button>\n\t);\n}\n\nfunction ErrorBoundaryWarning( { message, error } ) {\n\tconst actions = [\n\t\t<CopyButton key=\"copy-error\" text={ error.stack }>\n\t\t\t{ __( 'Copy Error' ) }\n\t\t</CopyButton>,\n\t];\n\n\treturn (\n\t\t<Warning className=\"edit-widgets-error-boundary\" actions={ actions }>\n\t\t\t{ message }\n\t\t</Warning>\n\t);\n}\n\nexport default class ErrorBoundary extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.state = {\n\t\t\terror: null,\n\t\t};\n\t}\n\n\tcomponentDidCatch( error ) {\n\t\tdoAction( 'editor.ErrorBoundary.errorLogged', error );\n\t}\n\n\tstatic getDerivedStateFromError( error ) {\n\t\treturn { error };\n\t}\n\n\trender() {\n\t\tif ( ! this.state.error ) {\n\t\t\treturn this.props.children;\n\t\t}\n\n\t\treturn (\n\t\t\t<ErrorBoundaryWarning\n\t\t\t\tmessage={ __(\n\t\t\t\t\t'The editor has encountered an unexpected error.'\n\t\t\t\t) }\n\t\t\t\terror={ this.state.error }\n\t\t\t/>\n\t\t);\n\t}\n}\n"]}
@@ -22,10 +22,9 @@ var _shortcut = _interopRequireDefault(require("./shortcut"));
22
22
  /**
23
23
  * Internal dependencies
24
24
  */
25
- function DynamicShortcut(_ref) {
26
- let {
27
- name
28
- } = _ref;
25
+ function DynamicShortcut({
26
+ name
27
+ }) {
29
28
  const {
30
29
  keyCombination,
31
30
  description,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-widgets/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js"],"names":["DynamicShortcut","name","keyCombination","description","aliases","select","getShortcutKeyCombination","getShortcutDescription","getShortcutAliases","keyboardShortcutsStore"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AAKA;;AATA;AACA;AACA;;AAIA;AACA;AACA;AAGA,SAASA,eAAT,OAAqC;AAAA,MAAX;AAAEC,IAAAA;AAAF,GAAW;AACpC,QAAM;AAAEC,IAAAA,cAAF;AAAkBC,IAAAA,WAAlB;AAA+BC,IAAAA;AAA/B,MAA2C,qBAC9CC,MAAF,IAAc;AACb,UAAM;AACLC,MAAAA,yBADK;AAELC,MAAAA,sBAFK;AAGLC,MAAAA;AAHK,QAIFH,MAAM,CAAEI,wBAAF,CAJV;AAMA,WAAO;AACNP,MAAAA,cAAc,EAAEI,yBAAyB,CAAEL,IAAF,CADnC;AAENG,MAAAA,OAAO,EAAEI,kBAAkB,CAAEP,IAAF,CAFrB;AAGNE,MAAAA,WAAW,EAAEI,sBAAsB,CAAEN,IAAF;AAH7B,KAAP;AAKA,GAb+C,EAchD,CAAEA,IAAF,CAdgD,CAAjD;;AAiBA,MAAK,CAAEC,cAAP,EAAwB;AACvB,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,iBAAD;AACC,IAAA,cAAc,EAAGA,cADlB;AAEC,IAAA,WAAW,EAAGC,WAFf;AAGC,IAAA,OAAO,EAAGC;AAHX,IADD;AAOA;;eAEcJ,e","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\n\n/**\n * Internal dependencies\n */\nimport Shortcut from './shortcut';\n\nfunction DynamicShortcut( { name } ) {\n\tconst { keyCombination, description, aliases } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetShortcutKeyCombination,\n\t\t\t\tgetShortcutDescription,\n\t\t\t\tgetShortcutAliases,\n\t\t\t} = select( keyboardShortcutsStore );\n\n\t\t\treturn {\n\t\t\t\tkeyCombination: getShortcutKeyCombination( name ),\n\t\t\t\taliases: getShortcutAliases( name ),\n\t\t\t\tdescription: getShortcutDescription( name ),\n\t\t\t};\n\t\t},\n\t\t[ name ]\n\t);\n\n\tif ( ! keyCombination ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Shortcut\n\t\t\tkeyCombination={ keyCombination }\n\t\t\tdescription={ description }\n\t\t\taliases={ aliases }\n\t\t/>\n\t);\n}\n\nexport default DynamicShortcut;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-widgets/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js"],"names":["DynamicShortcut","name","keyCombination","description","aliases","select","getShortcutKeyCombination","getShortcutDescription","getShortcutAliases","keyboardShortcutsStore"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AAKA;;AATA;AACA;AACA;;AAIA;AACA;AACA;AAGA,SAASA,eAAT,CAA0B;AAAEC,EAAAA;AAAF,CAA1B,EAAqC;AACpC,QAAM;AAAEC,IAAAA,cAAF;AAAkBC,IAAAA,WAAlB;AAA+BC,IAAAA;AAA/B,MAA2C,qBAC9CC,MAAF,IAAc;AACb,UAAM;AACLC,MAAAA,yBADK;AAELC,MAAAA,sBAFK;AAGLC,MAAAA;AAHK,QAIFH,MAAM,CAAEI,wBAAF,CAJV;AAMA,WAAO;AACNP,MAAAA,cAAc,EAAEI,yBAAyB,CAAEL,IAAF,CADnC;AAENG,MAAAA,OAAO,EAAEI,kBAAkB,CAAEP,IAAF,CAFrB;AAGNE,MAAAA,WAAW,EAAEI,sBAAsB,CAAEN,IAAF;AAH7B,KAAP;AAKA,GAb+C,EAchD,CAAEA,IAAF,CAdgD,CAAjD;;AAiBA,MAAK,CAAEC,cAAP,EAAwB;AACvB,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,iBAAD;AACC,IAAA,cAAc,EAAGA,cADlB;AAEC,IAAA,WAAW,EAAGC,WAFf;AAGC,IAAA,OAAO,EAAGC;AAHX,IADD;AAOA;;eAEcJ,e","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\n\n/**\n * Internal dependencies\n */\nimport Shortcut from './shortcut';\n\nfunction DynamicShortcut( { name } ) {\n\tconst { keyCombination, description, aliases } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetShortcutKeyCombination,\n\t\t\t\tgetShortcutDescription,\n\t\t\t\tgetShortcutAliases,\n\t\t\t} = select( keyboardShortcutsStore );\n\n\t\t\treturn {\n\t\t\t\tkeyCombination: getShortcutKeyCombination( name ),\n\t\t\t\taliases: getShortcutAliases( name ),\n\t\t\t\tdescription: getShortcutDescription( name ),\n\t\t\t};\n\t\t},\n\t\t[ name ]\n\t);\n\n\tif ( ! keyCombination ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Shortcut\n\t\t\tkeyCombination={ keyCombination }\n\t\t\tdescription={ description }\n\t\t\taliases={ aliases }\n\t\t/>\n\t);\n}\n\nexport default DynamicShortcut;\n"]}
@@ -36,52 +36,44 @@ var _dynamicShortcut = _interopRequireDefault(require("./dynamic-shortcut"));
36
36
  /**
37
37
  * Internal dependencies
38
38
  */
39
- const ShortcutList = _ref => {
40
- let {
41
- shortcuts
42
- } = _ref;
43
- return (
44
- /*
45
- * Disable reason: The `list` ARIA role is redundant but
46
- * Safari+VoiceOver won't announce the list otherwise.
47
- */
48
-
49
- /* eslint-disable jsx-a11y/no-redundant-roles */
50
- (0, _element.createElement)("ul", {
51
- className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-list",
52
- role: "list"
53
- }, shortcuts.map((shortcut, index) => (0, _element.createElement)("li", {
54
- className: "edit-widgets-keyboard-shortcut-help-modal__shortcut",
55
- key: index
56
- }, typeof shortcut === 'string' ? (0, _element.createElement)(_dynamicShortcut.default, {
57
- name: shortcut
58
- }) : (0, _element.createElement)(_shortcut.default, shortcut))))
59
- /* eslint-enable jsx-a11y/no-redundant-roles */
60
-
61
- );
62
- };
63
-
64
- const ShortcutSection = _ref2 => {
65
- let {
66
- title,
67
- shortcuts,
68
- className
69
- } = _ref2;
70
- return (0, _element.createElement)("section", {
71
- className: (0, _classnames.default)('edit-widgets-keyboard-shortcut-help-modal__section', className)
72
- }, !!title && (0, _element.createElement)("h2", {
73
- className: "edit-widgets-keyboard-shortcut-help-modal__section-title"
74
- }, title), (0, _element.createElement)(ShortcutList, {
75
- shortcuts: shortcuts
76
- }));
77
- };
39
+ const ShortcutList = ({
40
+ shortcuts
41
+ }) =>
42
+ /*
43
+ * Disable reason: The `list` ARIA role is redundant but
44
+ * Safari+VoiceOver won't announce the list otherwise.
45
+ */
78
46
 
79
- const ShortcutCategorySection = _ref3 => {
80
- let {
81
- title,
82
- categoryName,
83
- additionalShortcuts = []
84
- } = _ref3;
47
+ /* eslint-disable jsx-a11y/no-redundant-roles */
48
+ (0, _element.createElement)("ul", {
49
+ className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-list",
50
+ role: "list"
51
+ }, shortcuts.map((shortcut, index) => (0, _element.createElement)("li", {
52
+ className: "edit-widgets-keyboard-shortcut-help-modal__shortcut",
53
+ key: index
54
+ }, typeof shortcut === 'string' ? (0, _element.createElement)(_dynamicShortcut.default, {
55
+ name: shortcut
56
+ }) : (0, _element.createElement)(_shortcut.default, shortcut))))
57
+ /* eslint-enable jsx-a11y/no-redundant-roles */
58
+ ;
59
+
60
+ const ShortcutSection = ({
61
+ title,
62
+ shortcuts,
63
+ className
64
+ }) => (0, _element.createElement)("section", {
65
+ className: (0, _classnames.default)('edit-widgets-keyboard-shortcut-help-modal__section', className)
66
+ }, !!title && (0, _element.createElement)("h2", {
67
+ className: "edit-widgets-keyboard-shortcut-help-modal__section-title"
68
+ }, title), (0, _element.createElement)(ShortcutList, {
69
+ shortcuts: shortcuts
70
+ }));
71
+
72
+ const ShortcutCategorySection = ({
73
+ title,
74
+ categoryName,
75
+ additionalShortcuts = []
76
+ }) => {
85
77
  const categoryShortcuts = (0, _data.useSelect)(select => {
86
78
  return select(_keyboardShortcuts.store).getCategoryShortcuts(categoryName);
87
79
  }, [categoryName]);
@@ -91,11 +83,10 @@ const ShortcutCategorySection = _ref3 => {
91
83
  });
92
84
  };
93
85
 
94
- function KeyboardShortcutHelpModal(_ref4) {
95
- let {
96
- isModalActive,
97
- toggleModal
98
- } = _ref4;
86
+ function KeyboardShortcutHelpModal({
87
+ isModalActive,
88
+ toggleModal
89
+ }) {
99
90
  (0, _keyboardShortcuts.useShortcut)('core/edit-widgets/keyboard-shortcuts', toggleModal, {
100
91
  bindGlobal: true
101
92
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-widgets/src/components/keyboard-shortcut-help-modal/index.js"],"names":["ShortcutList","shortcuts","map","shortcut","index","ShortcutSection","title","className","ShortcutCategorySection","categoryName","additionalShortcuts","categoryShortcuts","select","keyboardShortcutsStore","getCategoryShortcuts","concat","KeyboardShortcutHelpModal","isModalActive","toggleModal","bindGlobal","keyCombination","character","description","ariaLabel","textFormattingShortcuts"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAI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AAiB,CAACI,MAAlB,CAA0BL,mBAA1B;AAFb,IADD;AAMA,CApBD;;AAsBe,SAASM,yBAAT,QAGX;AAAA,MAH+C;AAClDC,IAAAA,aADkD;AAElDC,IAAAA;AAFkD,GAG/C;AACH,sCAAa,sCAAb,EAAqDA,WAArD,EAAkE;AACjEC,IAAAA,UAAU,EAAE;AADqD,GAAlE;;AAIA,MAAK,CAAEF,aAAP,EAAuB;AACtB,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,iBAAD;AACC,IAAA,SAAS,EAAC,2CADX;AAEC,IAAA,KAAK,EAAG,cAAI,oBAAJ,CAFT;AAGC,IAAA,cAAc,EAAGC;AAHlB,KAKC,4BAAC,eAAD;AACC,IAAA,SAAS,EAAC,2DADX;AAEC,IAAA,SAAS,EAAG,CAAE,sCAAF;AAFb,IALD,EASC,4BAAC,uBAAD;AACC,IAAA,KAAK,EAAG,cAAI,kBAAJ,CADT;AAEC,IAAA,YAAY,EAAC;AAFd,IATD,EAcC,4BAAC,uBAAD;AACC,IAAA,KAAK,EAAG,cAAI,qBAAJ,CADT;AAEC,IAAA,YAAY,EAAC;AAFd,IAdD,EAmBC,4BAAC,uBAAD;AACC,IAAA,KAAK,EAAG,cAAI,iBAAJ,CADT;AAEC,IAAA,YAAY,EAAC,OAFd;AAGC,IAAA,mBAAmB,EAAG,CACrB;AACCE,MAAAA,cAAc,EAAE;AAAEC,QAAAA,SAAS,EAAE;AAAb,OADjB;AAECC,MAAAA,WAAW,EAAE,cACZ,qDADY,CAFd;;AAKC;AACAC,MAAAA,SAAS,EAAE,cAAI,eAAJ;AANZ,KADqB;AAHvB,IAnBD,EAiCC,4BAAC,eAAD;AACC,IAAA,KAAK,EAAG,cAAI,iBAAJ,CADT;AAEC,IAAA,SAAS,EAAGC;AAFb,IAjCD,CADD;AAwCA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Modal } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { textFormattingShortcuts } from './config';\nimport Shortcut from './shortcut';\nimport DynamicShortcut from './dynamic-shortcut';\n\nconst ShortcutList = ( { shortcuts } ) => (\n\t/*\n\t * Disable reason: The `list` ARIA role is redundant but\n\t * Safari+VoiceOver won't announce the list otherwise.\n\t */\n\t/* eslint-disable jsx-a11y/no-redundant-roles */\n\t<ul\n\t\tclassName=\"edit-widgets-keyboard-shortcut-help-modal__shortcut-list\"\n\t\trole=\"list\"\n\t>\n\t\t{ shortcuts.map( ( shortcut, index ) => (\n\t\t\t<li\n\t\t\t\tclassName=\"edit-widgets-keyboard-shortcut-help-modal__shortcut\"\n\t\t\t\tkey={ index }\n\t\t\t>\n\t\t\t\t{ typeof shortcut === 'string' ? (\n\t\t\t\t\t<DynamicShortcut name={ shortcut } />\n\t\t\t\t) : (\n\t\t\t\t\t<Shortcut { ...shortcut } />\n\t\t\t\t) }\n\t\t\t</li>\n\t\t) ) }\n\t</ul>\n\t/* eslint-enable jsx-a11y/no-redundant-roles */\n);\n\nconst ShortcutSection = ( { title, shortcuts, className } ) => (\n\t<section\n\t\tclassName={ classnames(\n\t\t\t'edit-widgets-keyboard-shortcut-help-modal__section',\n\t\t\tclassName\n\t\t) }\n\t>\n\t\t{ !! title && (\n\t\t\t<h2 className=\"edit-widgets-keyboard-shortcut-help-modal__section-title\">\n\t\t\t\t{ title }\n\t\t\t</h2>\n\t\t) }\n\t\t<ShortcutList shortcuts={ shortcuts } />\n\t</section>\n);\n\nconst ShortcutCategorySection = ( {\n\ttitle,\n\tcategoryName,\n\tadditionalShortcuts = [],\n} ) => {\n\tconst categoryShortcuts = useSelect(\n\t\t( select ) => {\n\t\t\treturn select( keyboardShortcutsStore ).getCategoryShortcuts(\n\t\t\t\tcategoryName\n\t\t\t);\n\t\t},\n\t\t[ categoryName ]\n\t);\n\n\treturn (\n\t\t<ShortcutSection\n\t\t\ttitle={ title }\n\t\t\tshortcuts={ categoryShortcuts.concat( additionalShortcuts ) }\n\t\t/>\n\t);\n};\n\nexport default function KeyboardShortcutHelpModal( {\n\tisModalActive,\n\ttoggleModal,\n} ) {\n\tuseShortcut( 'core/edit-widgets/keyboard-shortcuts', toggleModal, {\n\t\tbindGlobal: true,\n\t} );\n\n\tif ( ! isModalActive ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Modal\n\t\t\tclassName=\"edit-widgets-keyboard-shortcut-help-modal\"\n\t\t\ttitle={ __( 'Keyboard shortcuts' ) }\n\t\t\tonRequestClose={ toggleModal }\n\t\t>\n\t\t\t<ShortcutSection\n\t\t\t\tclassName=\"edit-widgets-keyboard-shortcut-help-modal__main-shortcuts\"\n\t\t\t\tshortcuts={ [ 'core/edit-widgets/keyboard-shortcuts' ] }\n\t\t\t/>\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Global shortcuts' ) }\n\t\t\t\tcategoryName=\"global\"\n\t\t\t/>\n\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Selection shortcuts' ) }\n\t\t\t\tcategoryName=\"selection\"\n\t\t\t/>\n\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Block shortcuts' ) }\n\t\t\t\tcategoryName=\"block\"\n\t\t\t\tadditionalShortcuts={ [\n\t\t\t\t\t{\n\t\t\t\t\t\tkeyCombination: { character: '/' },\n\t\t\t\t\t\tdescription: __(\n\t\t\t\t\t\t\t'Change the block type after adding a new paragraph.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t/* translators: The forward-slash character. e.g. '/'. */\n\t\t\t\t\t\tariaLabel: __( 'Forward-slash' ),\n\t\t\t\t\t},\n\t\t\t\t] }\n\t\t\t/>\n\t\t\t<ShortcutSection\n\t\t\t\ttitle={ __( 'Text formatting' ) }\n\t\t\t\tshortcuts={ textFormattingShortcuts }\n\t\t\t/>\n\t\t</Modal>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-widgets/src/components/keyboard-shortcut-help-modal/index.js"],"names":["ShortcutList","shortcuts","map","shortcut","index","ShortcutSection","title","className","ShortcutCategorySection","categoryName","additionalShortcuts","categoryShortcuts","select","keyboardShortcutsStore","getCategoryShortcuts","concat","KeyboardShortcutHelpModal","isModalActive","toggleModal","bindGlobal","keyCombination","character","description","ariaLabel","textFormattingShortcuts"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAIA;;AAKA;;AACA;;AACA;;AArBA;AACA;AACA;;AAGA;AACA;AACA;;AASA;AACA;AACA;AAKA,MAAMA,YAAY,GAAG,CAAE;AAAEC,EAAAA;AAAF,CAAF;AACpB;AACD;AACA;AACA;;AACC;AACA;AACC,EAAA,SAAS,EAAC,0DADX;AAEC,EAAA,IAAI,EAAC;AAFN,GAIGA,SAAS,CAACC,GAAV,CAAe,CAAEC,QAAF,EAAYC,KAAZ,KAChB;AACC,EAAA,SAAS,EAAC,qDADX;AAEC,EAAA,GAAG,EAAGA;AAFP,GAIG,OAAOD,QAAP,KAAoB,QAApB,GACD,4BAAC,wBAAD;AAAiB,EAAA,IAAI,EAAGA;AAAxB,EADC,GAGD,4BAAC,iBAAD,EAAeA,QAAf,CAPF,CADC,CAJH;AAiBA;AAvBD;;AA0BA,MAAME,eAAe,GAAG,CAAE;AAAEC,EAAAA,KAAF;AAASL,EAAAA,SAAT;AAAoBM,EAAAA;AAApB,CAAF,KACvB;AACC,EAAA,SAAS,EAAG,yBACX,oDADW,EAEXA,SAFW;AADb,GAMG,CAAC,CAAED,KAAH,IACD;AAAI,EAAA,SAAS,EAAC;AAAd,GACGA,KADH,CAPF,EAWC,4BAAC,YAAD;AAAc,EAAA,SAAS,EAAGL;AAA1B,EAXD,CADD;;AAgBA,MAAMO,uBAAuB,GAAG,CAAE;AACjCF,EAAAA,KADiC;AAEjCG,EAAAA,YAFiC;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KC;AACAC,MAAAA,SAAS,EAAE,cAAI,eAAJ;AANZ,KADqB;AAHvB,IAnBD,EAiCC,4BAAC,eAAD;AACC,IAAA,KAAK,EAAG,cAAI,iBAAJ,CADT;AAEC,IAAA,SAAS,EAAGC;AAFb,IAjCD,CADD;AAwCA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Modal } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { textFormattingShortcuts } from './config';\nimport Shortcut from './shortcut';\nimport DynamicShortcut from './dynamic-shortcut';\n\nconst ShortcutList = ( { shortcuts } ) => (\n\t/*\n\t * Disable reason: The `list` ARIA role is redundant but\n\t * Safari+VoiceOver won't announce the list otherwise.\n\t */\n\t/* eslint-disable jsx-a11y/no-redundant-roles */\n\t<ul\n\t\tclassName=\"edit-widgets-keyboard-shortcut-help-modal__shortcut-list\"\n\t\trole=\"list\"\n\t>\n\t\t{ shortcuts.map( ( shortcut, index ) => (\n\t\t\t<li\n\t\t\t\tclassName=\"edit-widgets-keyboard-shortcut-help-modal__shortcut\"\n\t\t\t\tkey={ index }\n\t\t\t>\n\t\t\t\t{ typeof shortcut === 'string' ? (\n\t\t\t\t\t<DynamicShortcut name={ shortcut } />\n\t\t\t\t) : (\n\t\t\t\t\t<Shortcut { ...shortcut } />\n\t\t\t\t) }\n\t\t\t</li>\n\t\t) ) }\n\t</ul>\n\t/* eslint-enable jsx-a11y/no-redundant-roles */\n);\n\nconst ShortcutSection = ( { title, shortcuts, className } ) => (\n\t<section\n\t\tclassName={ classnames(\n\t\t\t'edit-widgets-keyboard-shortcut-help-modal__section',\n\t\t\tclassName\n\t\t) }\n\t>\n\t\t{ !! title && (\n\t\t\t<h2 className=\"edit-widgets-keyboard-shortcut-help-modal__section-title\">\n\t\t\t\t{ title }\n\t\t\t</h2>\n\t\t) }\n\t\t<ShortcutList shortcuts={ shortcuts } />\n\t</section>\n);\n\nconst ShortcutCategorySection = ( {\n\ttitle,\n\tcategoryName,\n\tadditionalShortcuts = [],\n} ) => {\n\tconst categoryShortcuts = useSelect(\n\t\t( select ) => {\n\t\t\treturn select( keyboardShortcutsStore ).getCategoryShortcuts(\n\t\t\t\tcategoryName\n\t\t\t);\n\t\t},\n\t\t[ categoryName ]\n\t);\n\n\treturn (\n\t\t<ShortcutSection\n\t\t\ttitle={ title }\n\t\t\tshortcuts={ categoryShortcuts.concat( additionalShortcuts ) }\n\t\t/>\n\t);\n};\n\nexport default function KeyboardShortcutHelpModal( {\n\tisModalActive,\n\ttoggleModal,\n} ) {\n\tuseShortcut( 'core/edit-widgets/keyboard-shortcuts', toggleModal, {\n\t\tbindGlobal: true,\n\t} );\n\n\tif ( ! isModalActive ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Modal\n\t\t\tclassName=\"edit-widgets-keyboard-shortcut-help-modal\"\n\t\t\ttitle={ __( 'Keyboard shortcuts' ) }\n\t\t\tonRequestClose={ toggleModal }\n\t\t>\n\t\t\t<ShortcutSection\n\t\t\t\tclassName=\"edit-widgets-keyboard-shortcut-help-modal__main-shortcuts\"\n\t\t\t\tshortcuts={ [ 'core/edit-widgets/keyboard-shortcuts' ] }\n\t\t\t/>\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Global shortcuts' ) }\n\t\t\t\tcategoryName=\"global\"\n\t\t\t/>\n\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Selection shortcuts' ) }\n\t\t\t\tcategoryName=\"selection\"\n\t\t\t/>\n\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Block shortcuts' ) }\n\t\t\t\tcategoryName=\"block\"\n\t\t\t\tadditionalShortcuts={ [\n\t\t\t\t\t{\n\t\t\t\t\t\tkeyCombination: { character: '/' },\n\t\t\t\t\t\tdescription: __(\n\t\t\t\t\t\t\t'Change the block type after adding a new paragraph.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t/* translators: The forward-slash character. e.g. '/'. */\n\t\t\t\t\t\tariaLabel: __( 'Forward-slash' ),\n\t\t\t\t\t},\n\t\t\t\t] }\n\t\t\t/>\n\t\t\t<ShortcutSection\n\t\t\t\ttitle={ __( 'Text formatting' ) }\n\t\t\t\tshortcuts={ textFormattingShortcuts }\n\t\t\t/>\n\t\t</Modal>\n\t);\n}\n"]}
@@ -12,11 +12,10 @@ var _keycodes = require("@wordpress/keycodes");
12
12
  /**
13
13
  * WordPress dependencies
14
14
  */
15
- function KeyCombination(_ref) {
16
- let {
17
- keyCombination,
18
- forceAriaLabel
19
- } = _ref;
15
+ function KeyCombination({
16
+ keyCombination,
17
+ forceAriaLabel
18
+ }) {
20
19
  const shortcut = keyCombination.modifier ? _keycodes.displayShortcutList[keyCombination.modifier](keyCombination.character) : keyCombination.character;
21
20
  const ariaLabel = keyCombination.modifier ? _keycodes.shortcutAriaLabel[keyCombination.modifier](keyCombination.character) : keyCombination.character;
22
21
  const shortcuts = Array.isArray(shortcut) ? shortcut : [shortcut];
@@ -37,13 +36,12 @@ function KeyCombination(_ref) {
37
36
  }));
38
37
  }
39
38
 
40
- function Shortcut(_ref2) {
41
- let {
42
- description,
43
- keyCombination,
44
- aliases = [],
45
- ariaLabel
46
- } = _ref2;
39
+ function Shortcut({
40
+ description,
41
+ keyCombination,
42
+ aliases = [],
43
+ ariaLabel
44
+ }) {
47
45
  return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)("div", {
48
46
  className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-description"
49
47
  }, description), (0, _element.createElement)("div", {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-widgets/src/components/keyboard-shortcut-help-modal/shortcut.js"],"names":["KeyCombination","keyCombination","forceAriaLabel","shortcut","modifier","displayShortcutList","character","ariaLabel","shortcutAriaLabel","shortcuts","Array","isArray","map","index","Shortcut","description","aliases","alias"],"mappings":";;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;AAIA,SAASA,cAAT,OAA8D;AAAA,MAArC;AAAEC,IAAAA,cAAF;AAAkBC,IAAAA;AAAlB,GAAqC;AAC7D,QAAMC,QAAQ,GAAGF,cAAc,CAACG,QAAf,GACdC,8BAAqBJ,cAAc,CAACG,QAApC,EACAH,cAAc,CAACK,SADf,CADc,GAIdL,cAAc,CAACK,SAJlB;AAKA,QAAMC,SAAS,GAAGN,cAAc,CAACG,QAAf,GACfI,4BAAmBP,cAAc,CAACG,QAAlC,EACAH,cAAc,CAACK,SADf,CADe,GAIfL,cAAc,CAACK,SAJlB;AAKA,QAAMG,SAAS,GAAGC,KAAK,CAACC,OAAN,CAAeR,QAAf,IAA4BA,QAA5B,GAAuC,CAAEA,QAAF,CAAzD;AAEA,SACC;AACC,IAAA,SAAS,EAAC,qEADX;AAEC,kBAAaD,cAAc,IAAIK;AAFhC,KAIGE,SAAS,CAACG,GAAV,CAAe,CAAEN,SAAF,EAAaO,KAAb,KAAwB;AACxC,QAAKP,SAAS,KAAK,GAAnB,EAAyB;AACxB,aAAO,4BAAC,iBAAD;AAAU,QAAA,GAAG,EAAGO;AAAhB,SAA0BP,SAA1B,CAAP;AACA;;AAED,WACC;AACC,MAAA,GAAG,EAAGO,KADP;AAEC,MAAA,SAAS,EAAC;AAFX,OAIGP,SAJH,CADD;AAQA,GAbC,CAJH,CADD;AAqBA;;AAED,SAASQ,QAAT,QAA8E;AAAA,MAA3D;AAAEC,IAAAA,WAAF;AAAed,IAAAA,cAAf;AAA+Be,IAAAA,OAAO,GAAG,EAAzC;AAA6CT,IAAAA;AAA7C,GAA2D;AAC7E,SACC,qDACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGQ,WADH,CADD,EAIC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,cAAD;AACC,IAAA,cAAc,EAAGd,cADlB;AAEC,IAAA,cAAc,EAAGM;AAFlB,IADD,EAKGS,OAAO,CAACJ,GAAR,CAAa,CAAEK,KAAF,EAASJ,KAAT,KACd,4BAAC,cAAD;AACC,IAAA,cAAc,EAAGI,KADlB;AAEC,IAAA,cAAc,EAAGV,SAFlB;AAGC,IAAA,GAAG,EAAGM;AAHP,IADC,CALH,CAJD,CADD;AAoBA;;eAEcC,Q","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Fragment } from '@wordpress/element';\nimport { displayShortcutList, shortcutAriaLabel } from '@wordpress/keycodes';\n\nfunction KeyCombination( { keyCombination, forceAriaLabel } ) {\n\tconst shortcut = keyCombination.modifier\n\t\t? displayShortcutList[ keyCombination.modifier ](\n\t\t\t\tkeyCombination.character\n\t\t )\n\t\t: keyCombination.character;\n\tconst ariaLabel = keyCombination.modifier\n\t\t? shortcutAriaLabel[ keyCombination.modifier ](\n\t\t\t\tkeyCombination.character\n\t\t )\n\t\t: keyCombination.character;\n\tconst shortcuts = Array.isArray( shortcut ) ? shortcut : [ shortcut ];\n\n\treturn (\n\t\t<kbd\n\t\t\tclassName=\"edit-widgets-keyboard-shortcut-help-modal__shortcut-key-combination\"\n\t\t\taria-label={ forceAriaLabel || ariaLabel }\n\t\t>\n\t\t\t{ shortcuts.map( ( character, index ) => {\n\t\t\t\tif ( character === '+' ) {\n\t\t\t\t\treturn <Fragment key={ index }>{ character }</Fragment>;\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\t<kbd\n\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\tclassName=\"edit-widgets-keyboard-shortcut-help-modal__shortcut-key\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ character }\n\t\t\t\t\t</kbd>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</kbd>\n\t);\n}\n\nfunction Shortcut( { description, keyCombination, aliases = [], ariaLabel } ) {\n\treturn (\n\t\t<>\n\t\t\t<div className=\"edit-widgets-keyboard-shortcut-help-modal__shortcut-description\">\n\t\t\t\t{ description }\n\t\t\t</div>\n\t\t\t<div className=\"edit-widgets-keyboard-shortcut-help-modal__shortcut-term\">\n\t\t\t\t<KeyCombination\n\t\t\t\t\tkeyCombination={ keyCombination }\n\t\t\t\t\tforceAriaLabel={ ariaLabel }\n\t\t\t\t/>\n\t\t\t\t{ aliases.map( ( alias, index ) => (\n\t\t\t\t\t<KeyCombination\n\t\t\t\t\t\tkeyCombination={ alias }\n\t\t\t\t\t\tforceAriaLabel={ ariaLabel }\n\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default Shortcut;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-widgets/src/components/keyboard-shortcut-help-modal/shortcut.js"],"names":["KeyCombination","keyCombination","forceAriaLabel","shortcut","modifier","displayShortcutList","character","ariaLabel","shortcutAriaLabel","shortcuts","Array","isArray","map","index","Shortcut","description","aliases","alias"],"mappings":";;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;AAIA,SAASA,cAAT,CAAyB;AAAEC,EAAAA,cAAF;AAAkBC,EAAAA;AAAlB,CAAzB,EAA8D;AAC7D,QAAMC,QAAQ,GAAGF,cAAc,CAACG,QAAf,GACdC,8BAAqBJ,cAAc,CAACG,QAApC,EACAH,cAAc,CAACK,SADf,CADc,GAIdL,cAAc,CAACK,SAJlB;AAKA,QAAMC,SAAS,GAAGN,cAAc,CAACG,QAAf,GACfI,4BAAmBP,cAAc,CAACG,QAAlC,EACAH,cAAc,CAACK,SADf,CADe,GAIfL,cAAc,CAACK,SAJlB;AAKA,QAAMG,SAAS,GAAGC,KAAK,CAACC,OAAN,CAAeR,QAAf,IAA4BA,QAA5B,GAAuC,CAAEA,QAAF,CAAzD;AAEA,SACC;AACC,IAAA,SAAS,EAAC,qEADX;AAEC,kBAAaD,cAAc,IAAIK;AAFhC,KAIGE,SAAS,CAACG,GAAV,CAAe,CAAEN,SAAF,EAAaO,KAAb,KAAwB;AACxC,QAAKP,SAAS,KAAK,GAAnB,EAAyB;AACxB,aAAO,4BAAC,iBAAD;AAAU,QAAA,GAAG,EAAGO;AAAhB,SAA0BP,SAA1B,CAAP;AACA;;AAED,WACC;AACC,MAAA,GAAG,EAAGO,KADP;AAEC,MAAA,SAAS,EAAC;AAFX,OAIGP,SAJH,CADD;AAQA,GAbC,CAJH,CADD;AAqBA;;AAED,SAASQ,QAAT,CAAmB;AAAEC,EAAAA,WAAF;AAAed,EAAAA,cAAf;AAA+Be,EAAAA,OAAO,GAAG,EAAzC;AAA6CT,EAAAA;AAA7C,CAAnB,EAA8E;AAC7E,SACC,qDACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGQ,WADH,CADD,EAIC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,cAAD;AACC,IAAA,cAAc,EAAGd,cADlB;AAEC,IAAA,cAAc,EAAGM;AAFlB,IADD,EAKGS,OAAO,CAACJ,GAAR,CAAa,CAAEK,KAAF,EAASJ,KAAT,KACd,4BAAC,cAAD;AACC,IAAA,cAAc,EAAGI,KADlB;AAEC,IAAA,cAAc,EAAGV,SAFlB;AAGC,IAAA,GAAG,EAAGM;AAHP,IADC,CALH,CAJD,CADD;AAoBA;;eAEcC,Q","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Fragment } from '@wordpress/element';\nimport { displayShortcutList, shortcutAriaLabel } from '@wordpress/keycodes';\n\nfunction KeyCombination( { keyCombination, forceAriaLabel } ) {\n\tconst shortcut = keyCombination.modifier\n\t\t? displayShortcutList[ keyCombination.modifier ](\n\t\t\t\tkeyCombination.character\n\t\t )\n\t\t: keyCombination.character;\n\tconst ariaLabel = keyCombination.modifier\n\t\t? shortcutAriaLabel[ keyCombination.modifier ](\n\t\t\t\tkeyCombination.character\n\t\t )\n\t\t: keyCombination.character;\n\tconst shortcuts = Array.isArray( shortcut ) ? shortcut : [ shortcut ];\n\n\treturn (\n\t\t<kbd\n\t\t\tclassName=\"edit-widgets-keyboard-shortcut-help-modal__shortcut-key-combination\"\n\t\t\taria-label={ forceAriaLabel || ariaLabel }\n\t\t>\n\t\t\t{ shortcuts.map( ( character, index ) => {\n\t\t\t\tif ( character === '+' ) {\n\t\t\t\t\treturn <Fragment key={ index }>{ character }</Fragment>;\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\t<kbd\n\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\tclassName=\"edit-widgets-keyboard-shortcut-help-modal__shortcut-key\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ character }\n\t\t\t\t\t</kbd>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</kbd>\n\t);\n}\n\nfunction Shortcut( { description, keyCombination, aliases = [], ariaLabel } ) {\n\treturn (\n\t\t<>\n\t\t\t<div className=\"edit-widgets-keyboard-shortcut-help-modal__shortcut-description\">\n\t\t\t\t{ description }\n\t\t\t</div>\n\t\t\t<div className=\"edit-widgets-keyboard-shortcut-help-modal__shortcut-term\">\n\t\t\t\t<KeyCombination\n\t\t\t\t\tkeyCombination={ keyCombination }\n\t\t\t\t\tforceAriaLabel={ ariaLabel }\n\t\t\t\t/>\n\t\t\t\t{ aliases.map( ( alias, index ) => (\n\t\t\t\t\t<KeyCombination\n\t\t\t\t\t\tkeyCombination={ alias }\n\t\t\t\t\t\tforceAriaLabel={ ariaLabel }\n\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default Shortcut;\n"]}
@@ -38,10 +38,9 @@ var _welcomeGuide = _interopRequireDefault(require("../welcome-guide"));
38
38
  /**
39
39
  * Internal dependencies
40
40
  */
41
- function Layout(_ref) {
42
- let {
43
- blockEditorSettings
44
- } = _ref;
41
+ function Layout({
42
+ blockEditorSettings
43
+ }) {
45
44
  const {
46
45
  createErrorNotice
47
46
  } = (0, _data.useDispatch)(_notices.store);
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-widgets/src/components/layout/index.js"],"names":["Layout","blockEditorSettings","createErrorNotice","noticesStore","onPluginAreaError","name"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAjBA;AACA;AACA;;AAOA;AACA;AACA;AAQA,SAASA,MAAT,OAA2C;AAAA,MAA1B;AAAEC,IAAAA;AAAF,GAA0B;AAC1C,QAAM;AAAEC,IAAAA;AAAF,MAAwB,uBAAaC,cAAb,CAA9B;;AAEA,WAASC,iBAAT,CAA4BC,IAA5B,EAAmC;AAClCH,IAAAA,iBAAiB,CAChB;AACC;AACA,kBACC,kEADD,CAFD,EAKCG,IALD,CADgB,CAAjB;AASA;;AAED,SACC,4BAAC,sBAAD,QACC,4BAAC,uCAAD;AACC,IAAA,mBAAmB,EAAGJ;AADvB,KAGC,4BAAC,kBAAD;AAAW,IAAA,mBAAmB,EAAGA;AAAjC,IAHD,EAIC,4BAAC,gBAAD,OAJD,EAKC,4BAAC,mBAAD,CAAS,IAAT,OALD,EAMC,4BAAC,mBAAD;AAAY,IAAA,OAAO,EAAGG;AAAtB,IAND,EAOC,4BAAC,8BAAD,OAPD,EAQC,4BAAC,qBAAD,OARD,CADD,CADD;AAcA;;eAEcJ,M","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Popover } from '@wordpress/components';\nimport { useDispatch } from '@wordpress/data';\nimport { PluginArea } from '@wordpress/plugins';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport ErrorBoundary from '../error-boundary';\nimport WidgetAreasBlockEditorProvider from '../widget-areas-block-editor-provider';\nimport Sidebar from '../sidebar';\nimport Interface from './interface';\nimport UnsavedChangesWarning from './unsaved-changes-warning';\nimport WelcomeGuide from '../welcome-guide';\n\nfunction Layout( { blockEditorSettings } ) {\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\n\tfunction onPluginAreaError( name ) {\n\t\tcreateErrorNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: plugin name */\n\t\t\t\t__(\n\t\t\t\t\t'The \"%s\" plugin has encountered an error and cannot be rendered.'\n\t\t\t\t),\n\t\t\t\tname\n\t\t\t)\n\t\t);\n\t}\n\n\treturn (\n\t\t<ErrorBoundary>\n\t\t\t<WidgetAreasBlockEditorProvider\n\t\t\t\tblockEditorSettings={ blockEditorSettings }\n\t\t\t>\n\t\t\t\t<Interface blockEditorSettings={ blockEditorSettings } />\n\t\t\t\t<Sidebar />\n\t\t\t\t<Popover.Slot />\n\t\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t\t\t<UnsavedChangesWarning />\n\t\t\t\t<WelcomeGuide />\n\t\t\t</WidgetAreasBlockEditorProvider>\n\t\t</ErrorBoundary>\n\t);\n}\n\nexport default Layout;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-widgets/src/components/layout/index.js"],"names":["Layout","blockEditorSettings","createErrorNotice","noticesStore","onPluginAreaError","name"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAjBA;AACA;AACA;;AAOA;AACA;AACA;AAQA,SAASA,MAAT,CAAiB;AAAEC,EAAAA;AAAF,CAAjB,EAA2C;AAC1C,QAAM;AAAEC,IAAAA;AAAF,MAAwB,uBAAaC,cAAb,CAA9B;;AAEA,WAASC,iBAAT,CAA4BC,IAA5B,EAAmC;AAClCH,IAAAA,iBAAiB,CAChB;AACC;AACA,kBACC,kEADD,CAFD,EAKCG,IALD,CADgB,CAAjB;AASA;;AAED,SACC,4BAAC,sBAAD,QACC,4BAAC,uCAAD;AACC,IAAA,mBAAmB,EAAGJ;AADvB,KAGC,4BAAC,kBAAD;AAAW,IAAA,mBAAmB,EAAGA;AAAjC,IAHD,EAIC,4BAAC,gBAAD,OAJD,EAKC,4BAAC,mBAAD,CAAS,IAAT,OALD,EAMC,4BAAC,mBAAD;AAAY,IAAA,OAAO,EAAGG;AAAtB,IAND,EAOC,4BAAC,8BAAD,OAPD,EAQC,4BAAC,qBAAD,OARD,CADD,CADD;AAcA;;eAEcJ,M","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Popover } from '@wordpress/components';\nimport { useDispatch } from '@wordpress/data';\nimport { PluginArea } from '@wordpress/plugins';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport ErrorBoundary from '../error-boundary';\nimport WidgetAreasBlockEditorProvider from '../widget-areas-block-editor-provider';\nimport Sidebar from '../sidebar';\nimport Interface from './interface';\nimport UnsavedChangesWarning from './unsaved-changes-warning';\nimport WelcomeGuide from '../welcome-guide';\n\nfunction Layout( { blockEditorSettings } ) {\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\n\tfunction onPluginAreaError( name ) {\n\t\tcreateErrorNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: plugin name */\n\t\t\t\t__(\n\t\t\t\t\t'The \"%s\" plugin has encountered an error and cannot be rendered.'\n\t\t\t\t),\n\t\t\t\tname\n\t\t\t)\n\t\t);\n\t}\n\n\treturn (\n\t\t<ErrorBoundary>\n\t\t\t<WidgetAreasBlockEditorProvider\n\t\t\t\tblockEditorSettings={ blockEditorSettings }\n\t\t\t>\n\t\t\t\t<Interface blockEditorSettings={ blockEditorSettings } />\n\t\t\t\t<Sidebar />\n\t\t\t\t<Popover.Slot />\n\t\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t\t\t<UnsavedChangesWarning />\n\t\t\t\t<WelcomeGuide />\n\t\t\t</WidgetAreasBlockEditorProvider>\n\t\t</ErrorBoundary>\n\t);\n}\n\nexport default Layout;\n"]}
@@ -52,10 +52,9 @@ const interfaceLabels = {
52
52
  footer: (0, _i18n.__)('Widgets footer')
53
53
  };
54
54
 
55
- function Interface(_ref) {
56
- let {
57
- blockEditorSettings
58
- } = _ref;
55
+ function Interface({
56
+ blockEditorSettings
57
+ }) {
59
58
  const isMobileViewport = (0, _compose.useViewportMatch)('medium', '<');
60
59
  const isHugeViewport = (0, _compose.useViewportMatch)('huge', '>=');
61
60
  const {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-widgets/src/components/layout/interface.js"],"names":["interfaceLabels","header","body","sidebar","footer","Interface","blockEditorSettings","isMobileViewport","isHugeViewport","setIsInserterOpened","setIsListViewOpened","closeGeneralSidebar","editWidgetsStore","hasBlockBreadCrumbsEnabled","hasSidebarEnabled","isInserterOpened","isListViewOpened","previousShortcut","nextShortcut","select","interfaceStore","getActiveComplementaryArea","name","preferencesStore","get","keyboardShortcutsStore","getAllShortcutKeyCombinations","secondarySidebarLabel","hasSecondarySidebar","secondarySidebar","previous","next"],"mappings":";;;;;;;;;AAKA;;AAFA;;AACA;;AAEA;;AACA;;AAKA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAtBA;AACA;AACA;;AAcA;AACA;AACA;AAMA,MAAMA,eAAe,GAAG;AACvB;AACAC,EAAAA,MAAM,EAAE,cAAI,iBAAJ,CAFe;;AAGvB;AACAC,EAAAA,IAAI,EAAE,cAAI,oBAAJ,CAJiB;;AAKvB;AACAC,EAAAA,OAAO,EAAE,cAAI,kBAAJ,CANc;;AAOvB;AACAC,EAAAA,MAAM,EAAE,cAAI,gBAAJ;AARe,CAAxB;;AAWA,SAASC,SAAT,OAA8C;AAAA,MAA1B;AAAEC,IAAAA;AAAF,GAA0B;AAC7C,QAAMC,gBAAgB,GAAG,+BAAkB,QAAlB,EAA4B,GAA5B,CAAzB;AACA,QAAMC,cAAc,GAAG,+BAAkB,MAAlB,EAA0B,IAA1B,CAAvB;AACA,QAAM;AAAEC,IAAAA,mBAAF;AAAuBC,IAAAA,mBAAvB;AAA4CC,IAAAA;AAA5C,MACL,uBAAaC,YAAb,CADD;AAEA,QAAM;AACLC,IAAAA,0BADK;AAELC,IAAAA,iBAFK;AAGLC,IAAAA,gBAHK;A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Y,mBAAmB,GAAGZ,gBAAgB,IAAID,gBAAhD;AAEA,SACC,4BAAC,4BAAD;AACC,IAAA,MAAM,EAAG,EACR,GAAGf,eADK;AAER6B,MAAAA,gBAAgB,EAAEF;AAFV,KADV;AAKC,IAAA,MAAM,EAAG,4BAAC,eAAD,OALV;AAMC,IAAA,gBAAgB,EAAGC,mBAAmB,IAAI,4BAAC,yBAAD,OAN3C;AAOC,IAAA,OAAO,EACNd,iBAAiB,IAChB,4BAAC,4BAAD,CAAmB,IAAnB;AAAwB,MAAA,KAAK,EAAC;AAA9B,MATH;AAYC,IAAA,OAAO,EACN,qDACC,4BAAC,sCAAD;AACC,MAAA,mBAAmB,EAAGR;AADvB,MADD,CAbF;AAmBC,IAAA,MAAM,EACLO,0BAA0B,IAC1B,CAAEN,gBADF,IAEC;AAAK,MAAA,SAAS,EAAC;AAAf,OACC,4BAAC,4BAAD;AAAiB,MAAA,aAAa,EAAG,cAAI,SAAJ;AAAjC,MADD,CAtBH;AA2BC,IAAA,SAAS,EAAG;AACXuB,MAAAA,QAAQ,EAAEb,gBADC;AAEXc,MAAAA,IAAI,EAAEb;AAFK;AA3Bb,IADD;AAkCA;;eAEcb,S","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport { BlockBreadcrumb } from '@wordpress/block-editor';\nimport { useEffect } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tInterfaceSkeleton,\n\tComplementaryArea,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport { __ } from '@wordpress/i18n';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport Header from '../header';\nimport WidgetAreasBlockEditorContent from '../widget-areas-block-editor-content';\nimport { store as editWidgetsStore } from '../../store';\nimport SecondarySidebar from '../secondary-sidebar';\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the widgets screen top bar landmark region. */\n\theader: __( 'Widgets top bar' ),\n\t/* translators: accessibility text for the widgets screen content landmark region. */\n\tbody: __( 'Widgets and blocks' ),\n\t/* translators: accessibility text for the widgets screen settings landmark region. */\n\tsidebar: __( 'Widgets settings' ),\n\t/* translators: accessibility text for the widgets screen footer landmark region. */\n\tfooter: __( 'Widgets footer' ),\n};\n\nfunction Interface( { blockEditorSettings } ) {\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isHugeViewport = useViewportMatch( 'huge', '>=' );\n\tconst { setIsInserterOpened, setIsListViewOpened, closeGeneralSidebar } =\n\t\tuseDispatch( editWidgetsStore );\n\tconst {\n\t\thasBlockBreadCrumbsEnabled,\n\t\thasSidebarEnabled,\n\t\tisInserterOpened,\n\t\tisListViewOpened,\n\t\tpreviousShortcut,\n\t\tnextShortcut,\n\t} = useSelect(\n\t\t( select ) => ( {\n\t\t\thasSidebarEnabled: !! select(\n\t\t\t\tinterfaceStore\n\t\t\t).getActiveComplementaryArea( editWidgetsStore.name ),\n\t\t\tisInserterOpened: !! select( editWidgetsStore ).isInserterOpened(),\n\t\t\tisListViewOpened: !! select( editWidgetsStore ).isListViewOpened(),\n\t\t\thasBlockBreadCrumbsEnabled: !! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'showBlockBreadcrumbs'\n\t\t\t),\n\t\t\tpreviousShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations(\n\t\t\t\t'core/edit-widgets/previous-region'\n\t\t\t),\n\t\t\tnextShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-widgets/next-region' ),\n\t\t} ),\n\t\t[]\n\t);\n\n\t// Inserter and Sidebars are mutually exclusive\n\tuseEffect( () => {\n\t\tif ( hasSidebarEnabled && ! isHugeViewport ) {\n\t\t\tsetIsInserterOpened( false );\n\t\t\tsetIsListViewOpened( false );\n\t\t}\n\t}, [ hasSidebarEnabled, isHugeViewport ] );\n\n\tuseEffect( () => {\n\t\tif ( ( isInserterOpened || isListViewOpened ) && ! isHugeViewport ) {\n\t\t\tcloseGeneralSidebar();\n\t\t}\n\t}, [ isInserterOpened, isListViewOpened, isHugeViewport ] );\n\n\tconst secondarySidebarLabel = isListViewOpened\n\t\t? __( 'List View' )\n\t\t: __( 'Block Library' );\n\n\tconst hasSecondarySidebar = isListViewOpened || isInserterOpened;\n\n\treturn (\n\t\t<InterfaceSkeleton\n\t\t\tlabels={ {\n\t\t\t\t...interfaceLabels,\n\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t} }\n\t\t\theader={ <Header /> }\n\t\t\tsecondarySidebar={ hasSecondarySidebar && <SecondarySidebar /> }\n\t\t\tsidebar={\n\t\t\t\thasSidebarEnabled && (\n\t\t\t\t\t<ComplementaryArea.Slot scope=\"core/edit-widgets\" />\n\t\t\t\t)\n\t\t\t}\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t<WidgetAreasBlockEditorContent\n\t\t\t\t\t\tblockEditorSettings={ blockEditorSettings }\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t}\n\t\t\tfooter={\n\t\t\t\thasBlockBreadCrumbsEnabled &&\n\t\t\t\t! isMobileViewport && (\n\t\t\t\t\t<div className=\"edit-widgets-layout__footer\">\n\t\t\t\t\t\t<BlockBreadcrumb rootLabelText={ __( 'Widgets' ) } />\n\t\t\t\t\t</div>\n\t\t\t\t)\n\t\t\t}\n\t\t\tshortcuts={ {\n\t\t\t\tprevious: previousShortcut,\n\t\t\t\tnext: nextShortcut,\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nexport default Interface;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-widgets/src/components/layout/interface.js"],"names":["interfaceLabels","header","body","sidebar","footer","Interface","blockEditorSettings","isMobileViewport","isHugeViewport","setIsInserterOpened","setIsListViewOpened","closeGeneralSidebar","editWidgetsStore","hasBlockBreadCrumbsEnabled","hasSidebarEnabled","isInserterOpened","isListViewOpened","previousShortcut","nextShortcut","select","interfaceStore","getActiveComplementaryArea","name","preferencesStore","get","keyboardShortcutsStore","getAllShortcutKeyCombinations","secondarySidebarLabel","hasSecondarySidebar","secondarySidebar","previous","next"],"mappings":";;;;;;;;;AAKA;;AAFA;;AACA;;AAEA;;AACA;;AAKA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAtBA;AACA;AACA;;AAcA;AACA;AACA;AAMA,MAAMA,eAAe,GAAG;AACvB;AACAC,EAAAA,MAAM,EAAE,cAAI,iBAAJ,CAFe;;AAGvB;AACAC,EAAAA,IAAI,EAAE,cAAI,oBAAJ,CAJiB;;AAKvB;AACAC,EAAAA,OAAO,EAAE,cAAI,kBAAJ,CANc;;AAOvB;AACAC,EAAAA,MAAM,EAAE,cAAI,gBAAJ;AARe,CAAxB;;AAWA,SAASC,SAAT,CAAoB;AAAEC,EAAAA;AAAF,CAApB,EAA8C;AAC7C,QAAMC,gBAAgB,GAAG,+BAAkB,QAAlB,EAA4B,GAA5B,CAAzB;AACA,QAAMC,cAAc,GAAG,+BAAkB,MAAlB,EAA0B,IAA1B,CAAvB;AACA,QAAM;AAAEC,IAAAA,mBAAF;AAAuBC,IAAAA,mBAAvB;AAA4CC,IAAAA;AAA5C,MACL,uBAAaC,YAAb,CADD;AAEA,QAAM;AACLC,IAAAA,0BADK;AAELC,IAAAA,iBAFK;AAGLC,IAAAA,gBAHK;AAILC,IAAAA,gBAJK;AAKLC,IAAAA,gBALK;AAMLC,IAAAA;AANK,MAOF,qBACDC,MAAF,KAAgB;AACfL,IAAAA,iBAAiB,EAAE,CAAC,CAAEK,MAAM,CAC3BC,gBAD2B,CAAN,CAEpBC,0BAFoB,CAEQT,aAAiBU,IAFzB,CADP;AAIfP,IAAAA,gBAAgB,EAAE,CAAC,CAAEI,MAAM,CAAEP,YAAF,CAAN,CAA2BG,gBAA3B,EAJN;AAKfC,IAAAA,gBAAgB,EA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AAnB;AAAwB,MAAA,KAAK,EAAC;AAA9B,MATH;AAYC,IAAA,OAAO,EACN,qDACC,4BAAC,sCAAD;AACC,MAAA,mBAAmB,EAAGR;AADvB,MADD,CAbF;AAmBC,IAAA,MAAM,EACLO,0BAA0B,IAC1B,CAAEN,gBADF,IAEC;AAAK,MAAA,SAAS,EAAC;AAAf,OACC,4BAAC,4BAAD;AAAiB,MAAA,aAAa,EAAG,cAAI,SAAJ;AAAjC,MADD,CAtBH;AA2BC,IAAA,SAAS,EAAG;AACXuB,MAAAA,QAAQ,EAAEb,gBADC;AAEXc,MAAAA,IAAI,EAAEb;AAFK;AA3Bb,IADD;AAkCA;;eAEcb,S","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport { BlockBreadcrumb } from '@wordpress/block-editor';\nimport { useEffect } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tInterfaceSkeleton,\n\tComplementaryArea,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport { __ } from '@wordpress/i18n';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport Header from '../header';\nimport WidgetAreasBlockEditorContent from '../widget-areas-block-editor-content';\nimport { store as editWidgetsStore } from '../../store';\nimport SecondarySidebar from '../secondary-sidebar';\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the widgets screen top bar landmark region. */\n\theader: __( 'Widgets top bar' ),\n\t/* translators: accessibility text for the widgets screen content landmark region. */\n\tbody: __( 'Widgets and blocks' ),\n\t/* translators: accessibility text for the widgets screen settings landmark region. */\n\tsidebar: __( 'Widgets settings' ),\n\t/* translators: accessibility text for the widgets screen footer landmark region. */\n\tfooter: __( 'Widgets footer' ),\n};\n\nfunction Interface( { blockEditorSettings } ) {\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isHugeViewport = useViewportMatch( 'huge', '>=' );\n\tconst { setIsInserterOpened, setIsListViewOpened, closeGeneralSidebar } =\n\t\tuseDispatch( editWidgetsStore );\n\tconst {\n\t\thasBlockBreadCrumbsEnabled,\n\t\thasSidebarEnabled,\n\t\tisInserterOpened,\n\t\tisListViewOpened,\n\t\tpreviousShortcut,\n\t\tnextShortcut,\n\t} = useSelect(\n\t\t( select ) => ( {\n\t\t\thasSidebarEnabled: !! select(\n\t\t\t\tinterfaceStore\n\t\t\t).getActiveComplementaryArea( editWidgetsStore.name ),\n\t\t\tisInserterOpened: !! select( editWidgetsStore ).isInserterOpened(),\n\t\t\tisListViewOpened: !! select( editWidgetsStore ).isListViewOpened(),\n\t\t\thasBlockBreadCrumbsEnabled: !! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'showBlockBreadcrumbs'\n\t\t\t),\n\t\t\tpreviousShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations(\n\t\t\t\t'core/edit-widgets/previous-region'\n\t\t\t),\n\t\t\tnextShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-widgets/next-region' ),\n\t\t} ),\n\t\t[]\n\t);\n\n\t// Inserter and Sidebars are mutually exclusive\n\tuseEffect( () => {\n\t\tif ( hasSidebarEnabled && ! isHugeViewport ) {\n\t\t\tsetIsInserterOpened( false );\n\t\t\tsetIsListViewOpened( false );\n\t\t}\n\t}, [ hasSidebarEnabled, isHugeViewport ] );\n\n\tuseEffect( () => {\n\t\tif ( ( isInserterOpened || isListViewOpened ) && ! isHugeViewport ) {\n\t\t\tcloseGeneralSidebar();\n\t\t}\n\t}, [ isInserterOpened, isListViewOpened, isHugeViewport ] );\n\n\tconst secondarySidebarLabel = isListViewOpened\n\t\t? __( 'List View' )\n\t\t: __( 'Block Library' );\n\n\tconst hasSecondarySidebar = isListViewOpened || isInserterOpened;\n\n\treturn (\n\t\t<InterfaceSkeleton\n\t\t\tlabels={ {\n\t\t\t\t...interfaceLabels,\n\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t} }\n\t\t\theader={ <Header /> }\n\t\t\tsecondarySidebar={ hasSecondarySidebar && <SecondarySidebar /> }\n\t\t\tsidebar={\n\t\t\t\thasSidebarEnabled && (\n\t\t\t\t\t<ComplementaryArea.Slot scope=\"core/edit-widgets\" />\n\t\t\t\t)\n\t\t\t}\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t<WidgetAreasBlockEditorContent\n\t\t\t\t\t\tblockEditorSettings={ blockEditorSettings }\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t}\n\t\t\tfooter={\n\t\t\t\thasBlockBreadCrumbsEnabled &&\n\t\t\t\t! isMobileViewport && (\n\t\t\t\t\t<div className=\"edit-widgets-layout__footer\">\n\t\t\t\t\t\t<BlockBreadcrumb rootLabelText={ __( 'Widgets' ) } />\n\t\t\t\t\t</div>\n\t\t\t\t)\n\t\t\t}\n\t\t\tshortcuts={ {\n\t\t\t\tprevious: previousShortcut,\n\t\t\t\tnext: nextShortcut,\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nexport default Interface;\n"]}
@@ -35,7 +35,7 @@ function UnsavedChangesWarning() {
35
35
  getEditedWidgetAreas
36
36
  } = select(_store.store);
37
37
  const editedWidgetAreas = getEditedWidgetAreas();
38
- return (editedWidgetAreas === null || editedWidgetAreas === void 0 ? void 0 : editedWidgetAreas.length) > 0;
38
+ return editedWidgetAreas?.length > 0;
39
39
  }, []);
40
40
  (0, _element.useEffect)(() => {
41
41
  /**
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-widgets/src/components/layout/unsaved-changes-warning.js"],"names":["UnsavedChangesWarning","isDirty","select","getEditedWidgetAreas","editWidgetsStore","editedWidgetAreas","length","warnIfUnsavedChanges","event","returnValue","window","addEventListener","removeEventListener"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AAKA;;AAVA;AACA;AACA;;AAKA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,qBAAT,GAAiC;AAC/C,QAAMC,OAAO,GAAG,qBAAaC,MAAF,IAAc;AACxC,UAAM;AAAEC,MAAAA;AAAF,QAA2BD,MAAM,CAAEE,YAAF,CAAvC;AACA,UAAMC,iBAAiB,GAAGF,oBAAoB,EAA9C;AAEA,WAAO,CAAAE,iBAAiB,SAAjB,IAAAA,iBAAiB,WAAjB,YAAAA,iBAAiB,CAAEC,MAAnB,IAA4B,CAAnC;AACA,GALe,EAKb,EALa,CAAhB;AAOA,0BAAW,MAAM;AAChB;AACF;AACA;AACA;AACA;AACA;AACA;AACE,UAAMC,oBAAoB,GAAKC,KAAF,IAAa;AACzC,UAAKP,OAAL,EAAe;AACdO,QAAAA,KAAK,CAACC,WAAN,GAAoB,cACnB,8DADmB,CAApB;AAGA,eAAOD,KAAK,CAACC,WAAb;AACA;AACD,KAPD;;AASAC,IAAAA,MAAM,CAACC,gBAAP,CAAyB,cAAzB,EAAyCJ,oBAAzC;AAEA,WAAO,MAAM;AACZG,MAAAA,MAAM,CAACE,mBAAP,CAA4B,cAA5B,EAA4CL,oBAA5C;AACA,KAFD;AAGA,GAtBD,EAsBG,CAAEN,OAAF,CAtBH;AAwBA,SAAO,IAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useEffect } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editWidgetsStore } from '../../store';\n\n/**\n * Warns the user if there are unsaved changes before leaving the editor.\n *\n * This is a duplicate of the component implemented in the editor package.\n * Duplicated here as edit-widgets doesn't depend on editor.\n *\n * @return {WPComponent} The component.\n */\nexport default function UnsavedChangesWarning() {\n\tconst isDirty = useSelect( ( select ) => {\n\t\tconst { getEditedWidgetAreas } = select( editWidgetsStore );\n\t\tconst editedWidgetAreas = getEditedWidgetAreas();\n\n\t\treturn editedWidgetAreas?.length > 0;\n\t}, [] );\n\n\tuseEffect( () => {\n\t\t/**\n\t\t * Warns the user if there are unsaved changes before leaving the editor.\n\t\t *\n\t\t * @param {Event} event `beforeunload` event.\n\t\t *\n\t\t * @return {string | undefined} Warning prompt message, if unsaved changes exist.\n\t\t */\n\t\tconst warnIfUnsavedChanges = ( event ) => {\n\t\t\tif ( isDirty ) {\n\t\t\t\tevent.returnValue = __(\n\t\t\t\t\t'You have unsaved changes. If you proceed, they will be lost.'\n\t\t\t\t);\n\t\t\t\treturn event.returnValue;\n\t\t\t}\n\t\t};\n\n\t\twindow.addEventListener( 'beforeunload', warnIfUnsavedChanges );\n\n\t\treturn () => {\n\t\t\twindow.removeEventListener( 'beforeunload', warnIfUnsavedChanges );\n\t\t};\n\t}, [ isDirty ] );\n\n\treturn null;\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-widgets/src/components/layout/unsaved-changes-warning.js"],"names":["UnsavedChangesWarning","isDirty","select","getEditedWidgetAreas","editWidgetsStore","editedWidgetAreas","length","warnIfUnsavedChanges","event","returnValue","window","addEventListener","removeEventListener"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AAKA;;AAVA;AACA;AACA;;AAKA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,qBAAT,GAAiC;AAC/C,QAAMC,OAAO,GAAG,qBAAaC,MAAF,IAAc;AACxC,UAAM;AAAEC,MAAAA;AAAF,QAA2BD,MAAM,CAAEE,YAAF,CAAvC;AACA,UAAMC,iBAAiB,GAAGF,oBAAoB,EAA9C;AAEA,WAAOE,iBAAiB,EAAEC,MAAnB,GAA4B,CAAnC;AACA,GALe,EAKb,EALa,CAAhB;AAOA,0BAAW,MAAM;AAChB;AACF;AACA;AACA;AACA;AACA;AACA;AACE,UAAMC,oBAAoB,GAAKC,KAAF,IAAa;AACzC,UAAKP,OAAL,EAAe;AACdO,QAAAA,KAAK,CAACC,WAAN,GAAoB,cACnB,8DADmB,CAApB;AAGA,eAAOD,KAAK,CAACC,WAAb;AACA;AACD,KAPD;;AASAC,IAAAA,MAAM,CAACC,gBAAP,CAAyB,cAAzB,EAAyCJ,oBAAzC;AAEA,WAAO,MAAM;AACZG,MAAAA,MAAM,CAACE,mBAAP,CAA4B,cAA5B,EAA4CL,oBAA5C;AACA,KAFD;AAGA,GAtBD,EAsBG,CAAEN,OAAF,CAtBH;AAwBA,SAAO,IAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useEffect } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editWidgetsStore } from '../../store';\n\n/**\n * Warns the user if there are unsaved changes before leaving the editor.\n *\n * This is a duplicate of the component implemented in the editor package.\n * Duplicated here as edit-widgets doesn't depend on editor.\n *\n * @return {WPComponent} The component.\n */\nexport default function UnsavedChangesWarning() {\n\tconst isDirty = useSelect( ( select ) => {\n\t\tconst { getEditedWidgetAreas } = select( editWidgetsStore );\n\t\tconst editedWidgetAreas = getEditedWidgetAreas();\n\n\t\treturn editedWidgetAreas?.length > 0;\n\t}, [] );\n\n\tuseEffect( () => {\n\t\t/**\n\t\t * Warns the user if there are unsaved changes before leaving the editor.\n\t\t *\n\t\t * @param {Event} event `beforeunload` event.\n\t\t *\n\t\t * @return {string | undefined} Warning prompt message, if unsaved changes exist.\n\t\t */\n\t\tconst warnIfUnsavedChanges = ( event ) => {\n\t\t\tif ( isDirty ) {\n\t\t\t\tevent.returnValue = __(\n\t\t\t\t\t'You have unsaved changes. If you proceed, they will be lost.'\n\t\t\t\t);\n\t\t\t\treturn event.returnValue;\n\t\t\t}\n\t\t};\n\n\t\twindow.addEventListener( 'beforeunload', warnIfUnsavedChanges );\n\n\t\treturn () => {\n\t\t\twindow.removeEventListener( 'beforeunload', warnIfUnsavedChanges );\n\t\t};\n\t}, [ isDirty ] );\n\n\treturn null;\n}\n"]}
@@ -17,14 +17,11 @@ const {
17
17
  Slot
18
18
  } = (0, _components.createSlotFill)('EditWidgetsToolsMoreMenuGroup');
19
19
 
20
- ToolsMoreMenuGroup.Slot = _ref => {
21
- let {
22
- fillProps
23
- } = _ref;
24
- return (0, _element.createElement)(Slot, {
25
- fillProps: fillProps
26
- }, fills => fills.length > 0 && fills);
27
- };
20
+ ToolsMoreMenuGroup.Slot = ({
21
+ fillProps
22
+ }) => (0, _element.createElement)(Slot, {
23
+ fillProps: fillProps
24
+ }, fills => fills.length > 0 && fills);
28
25
 
29
26
  var _default = ToolsMoreMenuGroup;
30
27
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-widgets/src/components/more-menu/tools-more-menu-group.js"],"names":["Fill","ToolsMoreMenuGroup","Slot","fillProps","fills","length"],"mappings":";;;;;;;;;AAGA;;AAHA;AACA;AACA;AAGA,MAAM;AAAEA,EAAAA,IAAI,EAAEC,kBAAR;AAA4BC,EAAAA;AAA5B,IAAqC,gCAC1C,+BAD0C,CAA3C;;AAIAD,kBAAkB,CAACC,IAAnB,GAA0B;AAAA,MAAE;AAAEC,IAAAA;AAAF,GAAF;AAAA,SACzB,4BAAC,IAAD;AAAM,IAAA,SAAS,EAAGA;AAAlB,KACKC,KAAF,IAAaA,KAAK,CAACC,MAAN,GAAe,CAAf,IAAoBD,KADpC,CADyB;AAAA,CAA1B;;eAMeH,kB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill } from '@wordpress/components';\n\nconst { Fill: ToolsMoreMenuGroup, Slot } = createSlotFill(\n\t'EditWidgetsToolsMoreMenuGroup'\n);\n\nToolsMoreMenuGroup.Slot = ( { fillProps } ) => (\n\t<Slot fillProps={ fillProps }>\n\t\t{ ( fills ) => fills.length > 0 && fills }\n\t</Slot>\n);\n\nexport default ToolsMoreMenuGroup;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-widgets/src/components/more-menu/tools-more-menu-group.js"],"names":["Fill","ToolsMoreMenuGroup","Slot","fillProps","fills","length"],"mappings":";;;;;;;;;AAGA;;AAHA;AACA;AACA;AAGA,MAAM;AAAEA,EAAAA,IAAI,EAAEC,kBAAR;AAA4BC,EAAAA;AAA5B,IAAqC,gCAC1C,+BAD0C,CAA3C;;AAIAD,kBAAkB,CAACC,IAAnB,GAA0B,CAAE;AAAEC,EAAAA;AAAF,CAAF,KACzB,4BAAC,IAAD;AAAM,EAAA,SAAS,EAAGA;AAAlB,GACKC,KAAF,IAAaA,KAAK,CAACC,MAAN,GAAe,CAAf,IAAoBD,KADpC,CADD;;eAMeH,kB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill } from '@wordpress/components';\n\nconst { Fill: ToolsMoreMenuGroup, Slot } = createSlotFill(\n\t'EditWidgetsToolsMoreMenuGroup'\n);\n\nToolsMoreMenuGroup.Slot = ( { fillProps } ) => (\n\t<Slot fillProps={ fillProps }>\n\t\t{ ( fills ) => fills.length > 0 && fills }\n\t</Slot>\n);\n\nexport default ToolsMoreMenuGroup;\n"]}