@wordpress/edit-widgets 5.35.0 → 6.0.1

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 (110) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/build/blocks/widget-area/edit/index.js +33 -30
  3. package/build/blocks/widget-area/edit/index.js.map +1 -1
  4. package/build/blocks/widget-area/edit/inner-blocks.js +6 -5
  5. package/build/blocks/widget-area/edit/inner-blocks.js.map +1 -1
  6. package/build/components/error-boundary/index.js +14 -12
  7. package/build/components/error-boundary/index.js.map +1 -1
  8. package/build/components/header/document-tools/index.js +36 -33
  9. package/build/components/header/document-tools/index.js.map +1 -1
  10. package/build/components/header/index.js +32 -22
  11. package/build/components/header/index.js.map +1 -1
  12. package/build/components/header/undo-redo/redo.js +2 -2
  13. package/build/components/header/undo-redo/redo.js.map +1 -1
  14. package/build/components/header/undo-redo/undo.js +2 -2
  15. package/build/components/header/undo-redo/undo.js.map +1 -1
  16. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +2 -2
  17. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  18. package/build/components/keyboard-shortcut-help-modal/index.js +53 -48
  19. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  20. package/build/components/keyboard-shortcut-help-modal/shortcut.js +30 -26
  21. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  22. package/build/components/layout/index.js +11 -8
  23. package/build/components/layout/index.js.map +1 -1
  24. package/build/components/layout/interface.js +16 -13
  25. package/build/components/layout/interface.js.map +1 -1
  26. package/build/components/more-menu/index.js +81 -70
  27. package/build/components/more-menu/index.js.map +1 -1
  28. package/build/components/more-menu/tools-more-menu-group.js +5 -4
  29. package/build/components/more-menu/tools-more-menu-group.js.map +1 -1
  30. package/build/components/notices/index.js +15 -13
  31. package/build/components/notices/index.js.map +1 -1
  32. package/build/components/save-button/index.js +5 -4
  33. package/build/components/save-button/index.js.map +1 -1
  34. package/build/components/secondary-sidebar/index.js +3 -3
  35. package/build/components/secondary-sidebar/index.js.map +1 -1
  36. package/build/components/secondary-sidebar/inserter-sidebar.js +21 -18
  37. package/build/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
  38. package/build/components/secondary-sidebar/list-view-sidebar.js +21 -15
  39. package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  40. package/build/components/sidebar/index.js +49 -37
  41. package/build/components/sidebar/index.js.map +1 -1
  42. package/build/components/sidebar/widget-areas.js +29 -22
  43. package/build/components/sidebar/widget-areas.js.map +1 -1
  44. package/build/components/welcome-guide/index.js +80 -53
  45. package/build/components/welcome-guide/index.js.map +1 -1
  46. package/build/components/widget-areas-block-editor-content/index.js +18 -11
  47. package/build/components/widget-areas-block-editor-content/index.js.map +1 -1
  48. package/build/components/widget-areas-block-editor-provider/index.js +14 -11
  49. package/build/components/widget-areas-block-editor-provider/index.js.map +1 -1
  50. package/build/filters/move-to-widget-area.js +14 -10
  51. package/build/filters/move-to-widget-area.js.map +1 -1
  52. package/build/index.js +3 -3
  53. package/build/index.js.map +1 -1
  54. package/build-module/blocks/widget-area/edit/index.js +32 -28
  55. package/build-module/blocks/widget-area/edit/index.js.map +1 -1
  56. package/build-module/blocks/widget-area/edit/inner-blocks.js +6 -5
  57. package/build-module/blocks/widget-area/edit/inner-blocks.js.map +1 -1
  58. package/build-module/components/error-boundary/index.js +14 -12
  59. package/build-module/components/error-boundary/index.js.map +1 -1
  60. package/build-module/components/header/document-tools/index.js +38 -33
  61. package/build-module/components/header/document-tools/index.js.map +1 -1
  62. package/build-module/components/header/index.js +34 -22
  63. package/build-module/components/header/index.js.map +1 -1
  64. package/build-module/components/header/undo-redo/redo.js +2 -2
  65. package/build-module/components/header/undo-redo/redo.js.map +1 -1
  66. package/build-module/components/header/undo-redo/undo.js +2 -2
  67. package/build-module/components/header/undo-redo/undo.js.map +1 -1
  68. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +2 -2
  69. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  70. package/build-module/components/keyboard-shortcut-help-modal/index.js +54 -48
  71. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  72. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +32 -26
  73. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  74. package/build-module/components/layout/index.js +12 -8
  75. package/build-module/components/layout/index.js.map +1 -1
  76. package/build-module/components/layout/interface.js +17 -13
  77. package/build-module/components/layout/interface.js.map +1 -1
  78. package/build-module/components/more-menu/index.js +83 -70
  79. package/build-module/components/more-menu/index.js.map +1 -1
  80. package/build-module/components/more-menu/tools-more-menu-group.js +5 -4
  81. package/build-module/components/more-menu/tools-more-menu-group.js.map +1 -1
  82. package/build-module/components/notices/index.js +17 -13
  83. package/build-module/components/notices/index.js.map +1 -1
  84. package/build-module/components/save-button/index.js +5 -4
  85. package/build-module/components/save-button/index.js.map +1 -1
  86. package/build-module/components/secondary-sidebar/index.js +3 -3
  87. package/build-module/components/secondary-sidebar/index.js.map +1 -1
  88. package/build-module/components/secondary-sidebar/inserter-sidebar.js +22 -18
  89. package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
  90. package/build-module/components/secondary-sidebar/list-view-sidebar.js +22 -15
  91. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  92. package/build-module/components/sidebar/index.js +50 -37
  93. package/build-module/components/sidebar/index.js.map +1 -1
  94. package/build-module/components/sidebar/widget-areas.js +30 -22
  95. package/build-module/components/sidebar/widget-areas.js.map +1 -1
  96. package/build-module/components/welcome-guide/index.js +82 -53
  97. package/build-module/components/welcome-guide/index.js.map +1 -1
  98. package/build-module/components/widget-areas-block-editor-content/index.js +19 -11
  99. package/build-module/components/widget-areas-block-editor-content/index.js.map +1 -1
  100. package/build-module/components/widget-areas-block-editor-provider/index.js +15 -11
  101. package/build-module/components/widget-areas-block-editor-provider/index.js.map +1 -1
  102. package/build-module/filters/move-to-widget-area.js +16 -10
  103. package/build-module/filters/move-to-widget-area.js.map +1 -1
  104. package/build-module/index.js +3 -3
  105. package/build-module/index.js.map +1 -1
  106. package/build-style/style-rtl.css +9 -8
  107. package/build-style/style.css +9 -8
  108. package/package.json +30 -29
  109. package/src/components/layout/style.scss +1 -1
  110. package/src/index.js +1 -1
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = WidgetAreasBlockEditorContent;
8
- var _react = require("react");
9
8
  var _blockEditor = require("@wordpress/block-editor");
10
9
  var _compose = require("@wordpress/compose");
11
10
  var _data = require("@wordpress/data");
@@ -13,6 +12,7 @@ var _element = require("@wordpress/element");
13
12
  var _preferences = require("@wordpress/preferences");
14
13
  var _notices = _interopRequireDefault(require("../notices"));
15
14
  var _keyboardShortcuts = _interopRequireDefault(require("../keyboard-shortcuts"));
15
+ var _jsxRuntime = require("react/jsx-runtime");
16
16
  /**
17
17
  * WordPress dependencies
18
18
  */
@@ -29,15 +29,22 @@ function WidgetAreasBlockEditorContent({
29
29
  const styles = (0, _element.useMemo)(() => {
30
30
  return hasThemeStyles ? blockEditorSettings.styles : [];
31
31
  }, [blockEditorSettings, hasThemeStyles]);
32
- return (0, _react.createElement)("div", {
33
- className: "edit-widgets-block-editor"
34
- }, (0, _react.createElement)(_notices.default, null), !isLargeViewport && (0, _react.createElement)(_blockEditor.BlockToolbar, {
35
- hideDragHandle: true
36
- }), (0, _react.createElement)(_blockEditor.BlockTools, null, (0, _react.createElement)(_keyboardShortcuts.default, null), (0, _react.createElement)(_blockEditor.__unstableEditorStyles, {
37
- styles: styles,
38
- scope: ".editor-styles-wrapper"
39
- }), (0, _react.createElement)(_blockEditor.BlockSelectionClearer, null, (0, _react.createElement)(_blockEditor.WritingFlow, null, (0, _react.createElement)(_blockEditor.BlockList, {
40
- className: "edit-widgets-main-block-list"
41
- })))));
32
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
33
+ className: "edit-widgets-block-editor",
34
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_notices.default, {}), !isLargeViewport && /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.BlockToolbar, {
35
+ hideDragHandle: true
36
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_blockEditor.BlockTools, {
37
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_keyboardShortcuts.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.__unstableEditorStyles, {
38
+ styles: styles,
39
+ scope: ".editor-styles-wrapper"
40
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.BlockSelectionClearer, {
41
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.WritingFlow, {
42
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.BlockList, {
43
+ className: "edit-widgets-main-block-list"
44
+ })
45
+ })
46
+ })]
47
+ })]
48
+ });
42
49
  }
43
50
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_blockEditor","require","_compose","_data","_element","_preferences","_notices","_interopRequireDefault","_keyboardShortcuts","WidgetAreasBlockEditorContent","blockEditorSettings","hasThemeStyles","useSelect","select","preferencesStore","get","isLargeViewport","useViewportMatch","styles","useMemo","_react","createElement","className","default","BlockToolbar","hideDragHandle","BlockTools","__unstableEditorStyles","scope","BlockSelectionClearer","WritingFlow","BlockList"],"sources":["@wordpress/edit-widgets/src/components/widget-areas-block-editor-content/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tBlockList,\n\tBlockToolbar,\n\tBlockTools,\n\tBlockSelectionClearer,\n\tWritingFlow,\n\t__unstableEditorStyles as EditorStyles,\n} from '@wordpress/block-editor';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport Notices from '../notices';\nimport KeyboardShortcuts from '../keyboard-shortcuts';\n\nexport default function WidgetAreasBlockEditorContent( {\n\tblockEditorSettings,\n} ) {\n\tconst hasThemeStyles = useSelect(\n\t\t( select ) =>\n\t\t\t!! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'themeStyles'\n\t\t\t),\n\t\t[]\n\t);\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\n\tconst styles = useMemo( () => {\n\t\treturn hasThemeStyles ? blockEditorSettings.styles : [];\n\t}, [ blockEditorSettings, hasThemeStyles ] );\n\n\treturn (\n\t\t<div className=\"edit-widgets-block-editor\">\n\t\t\t<Notices />\n\t\t\t{ ! isLargeViewport && <BlockToolbar hideDragHandle /> }\n\t\t\t<BlockTools>\n\t\t\t\t<KeyboardShortcuts />\n\t\t\t\t<EditorStyles\n\t\t\t\t\tstyles={ styles }\n\t\t\t\t\tscope=\".editor-styles-wrapper\"\n\t\t\t\t/>\n\t\t\t\t<BlockSelectionClearer>\n\t\t\t\t\t<WritingFlow>\n\t\t\t\t\t\t<BlockList className=\"edit-widgets-main-block-list\" />\n\t\t\t\t\t</WritingFlow>\n\t\t\t\t</BlockSelectionClearer>\n\t\t\t</BlockTools>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAQA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAKA,IAAAK,QAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,kBAAA,GAAAD,sBAAA,CAAAN,OAAA;AApBA;AACA;AACA;;AAcA;AACA;AACA;;AAIe,SAASQ,6BAA6BA,CAAE;EACtDC;AACD,CAAC,EAAG;EACH,MAAMC,cAAc,GAAG,IAAAC,eAAS,EAC7BC,MAAM,IACP,CAAC,CAAEA,MAAM,CAAEC,kBAAiB,CAAC,CAACC,GAAG,CAChC,mBAAmB,EACnB,aACD,CAAC,EACF,EACD,CAAC;EACD,MAAMC,eAAe,GAAG,IAAAC,yBAAgB,EAAE,QAAS,CAAC;EAEpD,MAAMC,MAAM,GAAG,IAAAC,gBAAO,EAAE,MAAM;IAC7B,OAAOR,cAAc,GAAGD,mBAAmB,CAACQ,MAAM,GAAG,EAAE;EACxD,CAAC,EAAE,CAAER,mBAAmB,EAAEC,cAAc,CAAG,CAAC;EAE5C,OACC,IAAAS,MAAA,CAAAC,aAAA;IAAKC,SAAS,EAAC;EAA2B,GACzC,IAAAF,MAAA,CAAAC,aAAA,EAACf,QAAA,CAAAiB,OAAO,MAAE,CAAC,EACT,CAAEP,eAAe,IAAI,IAAAI,MAAA,CAAAC,aAAA,EAACrB,YAAA,CAAAwB,YAAY;IAACC,cAAc;EAAA,CAAE,CAAC,EACtD,IAAAL,MAAA,CAAAC,aAAA,EAACrB,YAAA,CAAA0B,UAAU,QACV,IAAAN,MAAA,CAAAC,aAAA,EAACb,kBAAA,CAAAe,OAAiB,MAAE,CAAC,EACrB,IAAAH,MAAA,CAAAC,aAAA,EAACrB,YAAA,CAAA2B,sBAAY;IACZT,MAAM,EAAGA,MAAQ;IACjBU,KAAK,EAAC;EAAwB,CAC9B,CAAC,EACF,IAAAR,MAAA,CAAAC,aAAA,EAACrB,YAAA,CAAA6B,qBAAqB,QACrB,IAAAT,MAAA,CAAAC,aAAA,EAACrB,YAAA,CAAA8B,WAAW,QACX,IAAAV,MAAA,CAAAC,aAAA,EAACrB,YAAA,CAAA+B,SAAS;IAACT,SAAS,EAAC;EAA8B,CAAE,CACzC,CACS,CACZ,CACR,CAAC;AAER","ignoreList":[]}
1
+ {"version":3,"names":["_blockEditor","require","_compose","_data","_element","_preferences","_notices","_interopRequireDefault","_keyboardShortcuts","_jsxRuntime","WidgetAreasBlockEditorContent","blockEditorSettings","hasThemeStyles","useSelect","select","preferencesStore","get","isLargeViewport","useViewportMatch","styles","useMemo","jsxs","className","children","jsx","default","BlockToolbar","hideDragHandle","BlockTools","__unstableEditorStyles","scope","BlockSelectionClearer","WritingFlow","BlockList"],"sources":["@wordpress/edit-widgets/src/components/widget-areas-block-editor-content/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tBlockList,\n\tBlockToolbar,\n\tBlockTools,\n\tBlockSelectionClearer,\n\tWritingFlow,\n\t__unstableEditorStyles as EditorStyles,\n} from '@wordpress/block-editor';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport Notices from '../notices';\nimport KeyboardShortcuts from '../keyboard-shortcuts';\n\nexport default function WidgetAreasBlockEditorContent( {\n\tblockEditorSettings,\n} ) {\n\tconst hasThemeStyles = useSelect(\n\t\t( select ) =>\n\t\t\t!! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'themeStyles'\n\t\t\t),\n\t\t[]\n\t);\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\n\tconst styles = useMemo( () => {\n\t\treturn hasThemeStyles ? blockEditorSettings.styles : [];\n\t}, [ blockEditorSettings, hasThemeStyles ] );\n\n\treturn (\n\t\t<div className=\"edit-widgets-block-editor\">\n\t\t\t<Notices />\n\t\t\t{ ! isLargeViewport && <BlockToolbar hideDragHandle /> }\n\t\t\t<BlockTools>\n\t\t\t\t<KeyboardShortcuts />\n\t\t\t\t<EditorStyles\n\t\t\t\t\tstyles={ styles }\n\t\t\t\t\tscope=\".editor-styles-wrapper\"\n\t\t\t\t/>\n\t\t\t\t<BlockSelectionClearer>\n\t\t\t\t\t<WritingFlow>\n\t\t\t\t\t\t<BlockList className=\"edit-widgets-main-block-list\" />\n\t\t\t\t\t</WritingFlow>\n\t\t\t\t</BlockSelectionClearer>\n\t\t\t</BlockTools>\n\t\t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,GAAA,EAACxB,YAAA,CAAA6B,sBAAY;QACZV,MAAM,EAAGA,MAAQ;QACjBW,KAAK,EAAC;MAAwB,CAC9B,CAAC,eACF,IAAArB,WAAA,CAAAe,GAAA,EAACxB,YAAA,CAAA+B,qBAAqB;QAAAR,QAAA,eACrB,IAAAd,WAAA,CAAAe,GAAA,EAACxB,YAAA,CAAAgC,WAAW;UAAAT,QAAA,eACX,IAAAd,WAAA,CAAAe,GAAA,EAACxB,YAAA,CAAAiC,SAAS;YAACX,SAAS,EAAC;UAA8B,CAAE;QAAC,CAC1C;MAAC,CACQ,CAAC;IAAA,CACb,CAAC;EAAA,CACT,CAAC;AAER","ignoreList":[]}
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = WidgetAreasBlockEditorProvider;
8
- var _react = require("react");
9
8
  var _components = require("@wordpress/components");
10
9
  var _compose = require("@wordpress/compose");
11
10
  var _mediaUtils = require("@wordpress/media-utils");
@@ -22,6 +21,7 @@ var _useLastSelectedWidgetArea = _interopRequireDefault(require("../../hooks/use
22
21
  var _store = require("../../store");
23
22
  var _constants = require("../../constants");
24
23
  var _lockUnlock = require("../../lock-unlock");
24
+ var _jsxRuntime = require("react/jsx-runtime");
25
25
  /**
26
26
  * WordPress dependencies
27
27
  */
@@ -104,15 +104,18 @@ function WidgetAreasBlockEditorProvider({
104
104
  const [blocks, onInput, onChange] = (0, _coreData.useEntityBlockEditor)(_utils.KIND, _utils.POST_TYPE, {
105
105
  id: (0, _utils.buildWidgetAreasPostId)()
106
106
  });
107
- return (0, _react.createElement)(_components.SlotFillProvider, null, (0, _react.createElement)(_keyboardShortcuts.default.Register, null), (0, _react.createElement)(BlockKeyboardShortcuts, null), (0, _react.createElement)(ExperimentalBlockEditorProvider, {
108
- value: blocks,
109
- onInput: onInput,
110
- onChange: onChange,
111
- settings: settings,
112
- useSubRegistry: false,
113
- ...props
114
- }, children, (0, _react.createElement)(PatternsMenuItems, {
115
- rootClientId: widgetAreaId
116
- })));
107
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.SlotFillProvider, {
108
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_keyboardShortcuts.default.Register, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(BlockKeyboardShortcuts, {}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(ExperimentalBlockEditorProvider, {
109
+ value: blocks,
110
+ onInput: onInput,
111
+ onChange: onChange,
112
+ settings: settings,
113
+ useSubRegistry: false,
114
+ ...props,
115
+ children: [children, /*#__PURE__*/(0, _jsxRuntime.jsx)(PatternsMenuItems, {
116
+ rootClientId: widgetAreaId
117
+ })]
118
+ })]
119
+ });
117
120
  }
118
121
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_compose","_mediaUtils","_data","_coreData","_element","_blockEditor","_patterns","_preferences","_blockLibrary","_keyboardShortcuts","_interopRequireDefault","_utils","_useLastSelectedWidgetArea","_store","_constants","_lockUnlock","ExperimentalBlockEditorProvider","unlock","blockEditorPrivateApis","PatternsMenuItems","editPatternsPrivateApis","BlockKeyboardShortcuts","blockLibraryPrivateApis","WidgetAreasBlockEditorProvider","blockEditorSettings","children","props","mediaPermissions","useResourcePermissions","isLargeViewport","useViewportMatch","reusableBlocks","isFixedToolbarActive","keepCaretInsideBlock","pageOnFront","pageForPosts","useSelect","select","canUser","getEntityRecord","getEntityRecords","coreStore","siteSettings","undefined","widgetAreas","editWidgetsStore","getWidgetAreas","widgets","getWidgets","ALLOW_REUSABLE_BLOCKS","preferencesStore","get","page_on_front","page_for_posts","setIsInserterOpened","useDispatch","settings","useMemo","mediaUploadBlockEditor","canCreate","onError","argumentsObject","uploadMedia","wpAllowedMimeTypes","allowedMimeTypes","message","__experimentalReusableBlocks","hasFixedToolbar","mediaUpload","templateLock","__experimentalSetIsInserterOpened","widgetAreaId","useLastSelectedWidgetArea","blocks","onInput","onChange","useEntityBlockEditor","KIND","POST_TYPE","id","buildWidgetAreasPostId","_react","createElement","SlotFillProvider","default","Register","value","useSubRegistry","rootClientId"],"sources":["@wordpress/edit-widgets/src/components/widget-areas-block-editor-provider/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SlotFillProvider } from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { uploadMedia } from '@wordpress/media-utils';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tuseEntityBlockEditor,\n\tstore as coreStore,\n\tuseResourcePermissions,\n} from '@wordpress/core-data';\nimport { useMemo } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { privateApis as editPatternsPrivateApis } from '@wordpress/patterns';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { privateApis as blockLibraryPrivateApis } from '@wordpress/block-library';\n\n/**\n * Internal dependencies\n */\nimport KeyboardShortcuts from '../keyboard-shortcuts';\nimport { buildWidgetAreasPostId, KIND, POST_TYPE } from '../../store/utils';\nimport useLastSelectedWidgetArea from '../../hooks/use-last-selected-widget-area';\nimport { store as editWidgetsStore } from '../../store';\nimport { ALLOW_REUSABLE_BLOCKS } from '../../constants';\nimport { unlock } from '../../lock-unlock';\n\nconst { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );\nconst { PatternsMenuItems } = unlock( editPatternsPrivateApis );\nconst { BlockKeyboardShortcuts } = unlock( blockLibraryPrivateApis );\n\nexport default function WidgetAreasBlockEditorProvider( {\n\tblockEditorSettings,\n\tchildren,\n\t...props\n} ) {\n\tconst mediaPermissions = useResourcePermissions( 'media' );\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst {\n\t\treusableBlocks,\n\t\tisFixedToolbarActive,\n\t\tkeepCaretInsideBlock,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t} = useSelect( ( select ) => {\n\t\tconst { canUser, getEntityRecord, getEntityRecords } =\n\t\t\tselect( coreStore );\n\t\tconst siteSettings = canUser( 'read', 'settings' )\n\t\t\t? getEntityRecord( 'root', 'site' )\n\t\t\t: undefined;\n\t\treturn {\n\t\t\twidgetAreas: select( editWidgetsStore ).getWidgetAreas(),\n\t\t\twidgets: select( editWidgetsStore ).getWidgets(),\n\t\t\treusableBlocks: ALLOW_REUSABLE_BLOCKS\n\t\t\t\t? getEntityRecords( 'postType', 'wp_block' )\n\t\t\t\t: [],\n\t\t\tisFixedToolbarActive: !! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'fixedToolbar'\n\t\t\t),\n\t\t\tkeepCaretInsideBlock: !! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'keepCaretInsideBlock'\n\t\t\t),\n\t\t\tpageOnFront: siteSettings?.page_on_front,\n\t\t\tpageForPosts: siteSettings?.page_for_posts,\n\t\t};\n\t}, [] );\n\tconst { setIsInserterOpened } = useDispatch( editWidgetsStore );\n\n\tconst settings = useMemo( () => {\n\t\tlet mediaUploadBlockEditor;\n\t\tif ( mediaPermissions.canCreate ) {\n\t\t\tmediaUploadBlockEditor = ( { onError, ...argumentsObject } ) => {\n\t\t\t\tuploadMedia( {\n\t\t\t\t\twpAllowedMimeTypes: blockEditorSettings.allowedMimeTypes,\n\t\t\t\t\tonError: ( { message } ) => onError( message ),\n\t\t\t\t\t...argumentsObject,\n\t\t\t\t} );\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t...blockEditorSettings,\n\t\t\t__experimentalReusableBlocks: reusableBlocks,\n\t\t\thasFixedToolbar: isFixedToolbarActive || ! isLargeViewport,\n\t\t\tkeepCaretInsideBlock,\n\t\t\tmediaUpload: mediaUploadBlockEditor,\n\t\t\ttemplateLock: 'all',\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpened,\n\t\t\tpageOnFront,\n\t\t\tpageForPosts,\n\t\t};\n\t}, [\n\t\tblockEditorSettings,\n\t\tisFixedToolbarActive,\n\t\tisLargeViewport,\n\t\tkeepCaretInsideBlock,\n\t\tmediaPermissions.canCreate,\n\t\treusableBlocks,\n\t\tsetIsInserterOpened,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t] );\n\n\tconst widgetAreaId = useLastSelectedWidgetArea();\n\n\tconst [ blocks, onInput, onChange ] = useEntityBlockEditor(\n\t\tKIND,\n\t\tPOST_TYPE,\n\t\t{ id: buildWidgetAreasPostId() }\n\t);\n\n\treturn (\n\t\t<SlotFillProvider>\n\t\t\t<KeyboardShortcuts.Register />\n\t\t\t<BlockKeyboardShortcuts />\n\t\t\t<ExperimentalBlockEditorProvider\n\t\t\t\tvalue={ blocks }\n\t\t\t\tonInput={ onInput }\n\t\t\t\tonChange={ onChange }\n\t\t\t\tsettings={ settings }\n\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t{ ...props }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t\t<PatternsMenuItems rootClientId={ widgetAreaId } />\n\t\t\t</ExperimentalBlockEditorProvider>\n\t\t</SlotFillProvider>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AAKA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAR,OAAA;AACA,IAAAS,aAAA,GAAAT,OAAA;AAKA,IAAAU,kBAAA,GAAAC,sBAAA,CAAAX,OAAA;AACA,IAAAY,MAAA,GAAAZ,OAAA;AACA,IAAAa,0BAAA,GAAAF,sBAAA,CAAAX,OAAA;AACA,IAAAc,MAAA,GAAAd,OAAA;AACA,IAAAe,UAAA,GAAAf,OAAA;AACA,IAAAgB,WAAA,GAAAhB,OAAA;AA1BA;AACA;AACA;;AAgBA;AACA;AACA;;AAQA,MAAM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ED,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACpF,WAAA,CAAAqF,gBAAgB,QAChB,IAAAF,MAAA,CAAAC,aAAA,EAACzE,kBAAA,CAAA2E,OAAiB,CAACC,QAAQ,MAAE,CAAC,EAC9B,IAAAJ,MAAA,CAAAC,aAAA,EAAC7D,sBAAsB,MAAE,CAAC,EAC1B,IAAA4D,MAAA,CAAAC,aAAA,EAAClE,+BAA+B;IAC/BsE,KAAK,EAAGb,MAAQ;IAChBC,OAAO,EAAGA,OAAS;IACnBC,QAAQ,EAAGA,QAAU;IACrBnB,QAAQ,EAAGA,QAAU;IACrB+B,cAAc,EAAG,KAAO;IAAA,GACnB7D;EAAK,GAERD,QAAQ,EACV,IAAAwD,MAAA,CAAAC,aAAA,EAAC/D,iBAAiB;IAACqE,YAAY,EAAGjB;EAAc,CAAE,CAClB,CAChB,CAAC;AAErB","ignoreList":[]}
1
+ {"version":3,"names":["_components","require","_compose","_mediaUtils","_data","_coreData","_element","_blockEditor","_patterns","_preferences","_blockLibrary","_keyboardShortcuts","_interopRequireDefault","_utils","_useLastSelectedWidgetArea","_store","_constants","_lockUnlock","_jsxRuntime","ExperimentalBlockEditorProvider","unlock","blockEditorPrivateApis","PatternsMenuItems","editPatternsPrivateApis","BlockKeyboardShortcuts","blockLibraryPrivateApis","WidgetAreasBlockEditorProvider","blockEditorSettings","children","props","mediaPermissions","useResourcePermissions","isLargeViewport","useViewportMatch","reusableBlocks","isFixedToolbarActive","keepCaretInsideBlock","pageOnFront","pageForPosts","useSelect","select","canUser","getEntityRecord","getEntityRecords","coreStore","siteSettings","undefined","widgetAreas","editWidgetsStore","getWidgetAreas","widgets","getWidgets","ALLOW_REUSABLE_BLOCKS","preferencesStore","get","page_on_front","page_for_posts","setIsInserterOpened","useDispatch","settings","useMemo","mediaUploadBlockEditor","canCreate","onError","argumentsObject","uploadMedia","wpAllowedMimeTypes","allowedMimeTypes","message","__experimentalReusableBlocks","hasFixedToolbar","mediaUpload","templateLock","__experimentalSetIsInserterOpened","widgetAreaId","useLastSelectedWidgetArea","blocks","onInput","onChange","useEntityBlockEditor","KIND","POST_TYPE","id","buildWidgetAreasPostId","jsxs","SlotFillProvider","jsx","default","Register","value","useSubRegistry","rootClientId"],"sources":["@wordpress/edit-widgets/src/components/widget-areas-block-editor-provider/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SlotFillProvider } from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { uploadMedia } from '@wordpress/media-utils';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tuseEntityBlockEditor,\n\tstore as coreStore,\n\tuseResourcePermissions,\n} from '@wordpress/core-data';\nimport { useMemo } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { privateApis as editPatternsPrivateApis } from '@wordpress/patterns';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { privateApis as blockLibraryPrivateApis } from '@wordpress/block-library';\n\n/**\n * Internal dependencies\n */\nimport KeyboardShortcuts from '../keyboard-shortcuts';\nimport { buildWidgetAreasPostId, KIND, POST_TYPE } from '../../store/utils';\nimport useLastSelectedWidgetArea from '../../hooks/use-last-selected-widget-area';\nimport { store as editWidgetsStore } from '../../store';\nimport { ALLOW_REUSABLE_BLOCKS } from '../../constants';\nimport { unlock } from '../../lock-unlock';\n\nconst { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );\nconst { PatternsMenuItems } = unlock( editPatternsPrivateApis );\nconst { BlockKeyboardShortcuts } = unlock( blockLibraryPrivateApis );\n\nexport default function WidgetAreasBlockEditorProvider( {\n\tblockEditorSettings,\n\tchildren,\n\t...props\n} ) {\n\tconst mediaPermissions = useResourcePermissions( 'media' );\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst {\n\t\treusableBlocks,\n\t\tisFixedToolbarActive,\n\t\tkeepCaretInsideBlock,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t} = useSelect( ( select ) => {\n\t\tconst { canUser, getEntityRecord, getEntityRecords } =\n\t\t\tselect( coreStore );\n\t\tconst siteSettings = canUser( 'read', 'settings' )\n\t\t\t? getEntityRecord( 'root', 'site' )\n\t\t\t: undefined;\n\t\treturn {\n\t\t\twidgetAreas: select( editWidgetsStore ).getWidgetAreas(),\n\t\t\twidgets: select( editWidgetsStore ).getWidgets(),\n\t\t\treusableBlocks: ALLOW_REUSABLE_BLOCKS\n\t\t\t\t? getEntityRecords( 'postType', 'wp_block' )\n\t\t\t\t: [],\n\t\t\tisFixedToolbarActive: !! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'fixedToolbar'\n\t\t\t),\n\t\t\tkeepCaretInsideBlock: !! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'keepCaretInsideBlock'\n\t\t\t),\n\t\t\tpageOnFront: siteSettings?.page_on_front,\n\t\t\tpageForPosts: siteSettings?.page_for_posts,\n\t\t};\n\t}, [] );\n\tconst { setIsInserterOpened } = useDispatch( editWidgetsStore );\n\n\tconst settings = useMemo( () => {\n\t\tlet mediaUploadBlockEditor;\n\t\tif ( mediaPermissions.canCreate ) {\n\t\t\tmediaUploadBlockEditor = ( { onError, ...argumentsObject } ) => {\n\t\t\t\tuploadMedia( {\n\t\t\t\t\twpAllowedMimeTypes: blockEditorSettings.allowedMimeTypes,\n\t\t\t\t\tonError: ( { message } ) => onError( message ),\n\t\t\t\t\t...argumentsObject,\n\t\t\t\t} );\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t...blockEditorSettings,\n\t\t\t__experimentalReusableBlocks: reusableBlocks,\n\t\t\thasFixedToolbar: isFixedToolbarActive || ! isLargeViewport,\n\t\t\tkeepCaretInsideBlock,\n\t\t\tmediaUpload: mediaUploadBlockEditor,\n\t\t\ttemplateLock: 'all',\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpened,\n\t\t\tpageOnFront,\n\t\t\tpageForPosts,\n\t\t};\n\t}, [\n\t\tblockEditorSettings,\n\t\tisFixedToolbarActive,\n\t\tisLargeViewport,\n\t\tkeepCaretInsideBlock,\n\t\tmediaPermissions.canCreate,\n\t\treusableBlocks,\n\t\tsetIsInserterOpened,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t] );\n\n\tconst widgetAreaId = useLastSelectedWidgetArea();\n\n\tconst [ blocks, onInput, onChange ] = useEntityBlockEditor(\n\t\tKIND,\n\t\tPOST_TYPE,\n\t\t{ id: buildWidgetAreasPostId() }\n\t);\n\n\treturn (\n\t\t<SlotFillProvider>\n\t\t\t<KeyboardShortcuts.Register />\n\t\t\t<BlockKeyboardShortcuts />\n\t\t\t<ExperimentalBlockEditorProvider\n\t\t\t\tvalue={ blocks }\n\t\t\t\tonInput={ onInput }\n\t\t\t\tonChange={ onChange }\n\t\t\t\tsettings={ settings }\n\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t{ ...props }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t\t<PatternsMenuItems rootClientId={ widgetAreaId } />\n\t\t\t</ExperimentalBlockEditorProvider>\n\t\t</SlotFillProvider>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AAKA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAR,OAAA;AACA,IAAAS,aAAA,GAAAT,OAAA;AAKA,IAAAU,kBAAA,GAAAC,sBAAA,CAAAX,OAAA;AACA,IAAAY,MAAA,GAAAZ,OAAA;AACA,IAAAa,0BAAA,GAAAF,sBAAA,CAAAX,OAAA;AACA,IAAAc,MAAA,GAAAd,OAAA;AACA,IAAAe,UAAA,GAAAf,OAAA;AACA,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AAG,IAAAC,8BAAoB,EACzDC,WAAI,EACJC,gBAAS,EACT;IAAEC,EAAE,EAAE,IAAAC,6BAAsB,EAAC;EAAE,CAChC,CAAC;EAED,oBACC,IAAAjE,WAAA,CAAAkE,IAAA,EAACpF,WAAA,CAAAqF,gBAAgB;IAAAzD,QAAA,gBAChB,IAAAV,WAAA,CAAAoE,GAAA,EAAC3E,kBAAA,CAAA4E,OAAiB,CAACC,QAAQ,IAAE,CAAC,eAC9B,IAAAtE,WAAA,CAAAoE,GAAA,EAAC9D,sBAAsB,IAAE,CAAC,eAC1B,IAAAN,WAAA,CAAAkE,IAAA,EAACjE,+BAA+B;MAC/BsE,KAAK,EAAGb,MAAQ;MAChBC,OAAO,EAAGA,OAAS;MACnBC,QAAQ,EAAGA,QAAU;MACrBnB,QAAQ,EAAGA,QAAU;MACrB+B,cAAc,EAAG,KAAO;MAAA,GACnB7D,KAAK;MAAAD,QAAA,GAERA,QAAQ,eACV,IAAAV,WAAA,CAAAoE,GAAA,EAAChE,iBAAiB;QAACqE,YAAY,EAAGjB;MAAc,CAAE,CAAC;IAAA,CACnB,CAAC;EAAA,CACjB,CAAC;AAErB","ignoreList":[]}
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
 
3
- var _react = require("react");
4
3
  var _blockEditor = require("@wordpress/block-editor");
5
4
  var _compose = require("@wordpress/compose");
6
5
  var _data = require("@wordpress/data");
7
6
  var _hooks = require("@wordpress/hooks");
8
7
  var _widgets = require("@wordpress/widgets");
9
8
  var _store = require("../store");
9
+ var _jsxRuntime = require("react/jsx-runtime");
10
10
  /**
11
11
  * WordPress dependencies
12
12
  */
@@ -42,15 +42,19 @@ const withMoveToWidgetAreaToolbarItem = (0, _compose.createHigherOrderComponent)
42
42
  } = (0, _data.useDispatch)(_store.store);
43
43
  const hasMultipleWidgetAreas = widgetAreas?.length > 1;
44
44
  const isMoveToWidgetAreaVisible = blockName !== 'core/widget-area' && hasMultipleWidgetAreas && canInsertBlockInWidgetArea;
45
- return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(BlockEdit, {
46
- ...props
47
- }), isMoveToWidgetAreaVisible && (0, _react.createElement)(_blockEditor.BlockControls, null, (0, _react.createElement)(_widgets.MoveToWidgetArea, {
48
- widgetAreas: widgetAreas,
49
- currentWidgetAreaId: currentWidgetAreaId,
50
- onSelect: widgetAreaId => {
51
- moveBlockToWidgetArea(props.clientId, widgetAreaId);
52
- }
53
- })));
45
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
46
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(BlockEdit, {
47
+ ...props
48
+ }), isMoveToWidgetAreaVisible && /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.BlockControls, {
49
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_widgets.MoveToWidgetArea, {
50
+ widgetAreas: widgetAreas,
51
+ currentWidgetAreaId: currentWidgetAreaId,
52
+ onSelect: widgetAreaId => {
53
+ moveBlockToWidgetArea(props.clientId, widgetAreaId);
54
+ }
55
+ })
56
+ })]
57
+ });
54
58
  }, 'withMoveToWidgetAreaToolbarItem');
55
59
  (0, _hooks.addFilter)('editor.BlockEdit', 'core/edit-widgets/block-edit', withMoveToWidgetAreaToolbarItem);
56
60
  //# sourceMappingURL=move-to-widget-area.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_blockEditor","require","_compose","_data","_hooks","_widgets","_store","withMoveToWidgetAreaToolbarItem","createHigherOrderComponent","BlockEdit","props","clientId","name","blockName","widgetAreas","currentWidgetAreaId","canInsertBlockInWidgetArea","useSelect","select","selectors","editWidgetsStore","widgetAreaBlock","getParentWidgetAreaBlock","getWidgetAreas","attributes","id","moveBlockToWidgetArea","useDispatch","hasMultipleWidgetAreas","length","isMoveToWidgetAreaVisible","_react","createElement","Fragment","BlockControls","MoveToWidgetArea","onSelect","widgetAreaId","addFilter"],"sources":["@wordpress/edit-widgets/src/filters/move-to-widget-area.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { BlockControls } from '@wordpress/block-editor';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { addFilter } from '@wordpress/hooks';\nimport { MoveToWidgetArea } from '@wordpress/widgets';\n\n/**\n * Internal dependencies\n */\nimport { store as editWidgetsStore } from '../store';\n\nconst withMoveToWidgetAreaToolbarItem = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst { clientId, name: blockName } = props;\n\t\tconst { widgetAreas, currentWidgetAreaId, canInsertBlockInWidgetArea } =\n\t\t\tuseSelect(\n\t\t\t\t( select ) => {\n\t\t\t\t\t// Component won't display for a widget area, so don't run selectors.\n\t\t\t\t\tif ( blockName === 'core/widget-area' ) {\n\t\t\t\t\t\treturn {};\n\t\t\t\t\t}\n\n\t\t\t\t\tconst selectors = select( editWidgetsStore );\n\n\t\t\t\t\tconst widgetAreaBlock =\n\t\t\t\t\t\tselectors.getParentWidgetAreaBlock( clientId );\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\twidgetAreas: selectors.getWidgetAreas(),\n\t\t\t\t\t\tcurrentWidgetAreaId: widgetAreaBlock?.attributes?.id,\n\t\t\t\t\t\tcanInsertBlockInWidgetArea:\n\t\t\t\t\t\t\tselectors.canInsertBlockInWidgetArea( blockName ),\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t\t[ clientId, blockName ]\n\t\t\t);\n\n\t\tconst { moveBlockToWidgetArea } = useDispatch( editWidgetsStore );\n\t\tconst hasMultipleWidgetAreas = widgetAreas?.length > 1;\n\t\tconst isMoveToWidgetAreaVisible =\n\t\t\tblockName !== 'core/widget-area' &&\n\t\t\thasMultipleWidgetAreas &&\n\t\t\tcanInsertBlockInWidgetArea;\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<BlockEdit { ...props } />\n\t\t\t\t{ isMoveToWidgetAreaVisible && (\n\t\t\t\t\t<BlockControls>\n\t\t\t\t\t\t<MoveToWidgetArea\n\t\t\t\t\t\t\twidgetAreas={ widgetAreas }\n\t\t\t\t\t\t\tcurrentWidgetAreaId={ currentWidgetAreaId }\n\t\t\t\t\t\t\tonSelect={ ( widgetAreaId ) => {\n\t\t\t\t\t\t\t\tmoveBlockToWidgetArea(\n\t\t\t\t\t\t\t\t\tprops.clientId,\n\t\t\t\t\t\t\t\t\twidgetAreaId\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</BlockControls>\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t},\n\t'withMoveToWidgetAreaToolbarItem'\n);\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/edit-widgets/block-edit',\n\twithMoveToWidgetAreaToolbarItem\n);\n"],"mappings":";;;AAIA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AAbA;AACA;AACA;;AAQA;AACA;AACA;;AAGA,MAAMM,+BAA+B,GAAG,IAAAC,mCAA0B,EAC/DC,SAAS,IAAQC,KAAK,IAAM;EAC7B,MAAM;IAAEC,QAAQ;IAAEC,IAAI,EAAEC;EAAU,CAAC,GAAGH,KAAK;EAC3C,MAAM;IAAEI,WAAW;IAAEC,mBAAmB;IAAEC;EAA2B,CAAC,GACrE,IAAAC,eAAS,EACNC,MAAM,IAAM;IACb;IACA,IAAKL,SAAS,KAAK,kBAAkB,EAAG;MACvC,OAAO,CAAC,CAAC;IACV;IAEA,MAAMM,SAAS,GAAGD,MAAM,CAAEE,YAAiB,CAAC;IAE5C,MAAMC,eAAe,GACpBF,SAAS,CAACG,wBAAwB,CAAEX,QAAS,CAAC;IAE/C,OAAO;MACNG,WAAW,EAAEK,SAAS,CAACI,cAAc,CAAC,CAAC;MACvCR,mBAAmB,EAAEM,eAAe,EAAEG,UAAU,EAAEC,EAAE;MACpDT,0BAA0B,EACzBG,SAAS,CAACH,0BAA0B,CAAEH,SAAU;IAClD,CAAC;EACF,CAAC,EACD,CAAEF,QAAQ,EAAEE,SAAS,CACtB,CAAC;EAEF,MAAM;IAAEa;EAAsB,CAAC,GAAG,IAAAC,iBAAW,EAAEP,YAAiB,CAAC;EACjE,MAAMQ,sBAAsB,GAAGd,WAAW,EAAEe,MAAM,GAAG,CAAC;EACtD,MAAMC,yBAAyB,GAC9BjB,SAAS,KAAK,kBAAkB,IAChCe,sBAAsB,IACtBZ,0BAA0B;EAE3B,OACC,IAAAe,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAE,QAAA,QACC,IAAAF,MAAA,CAAAC,aAAA,EAACvB,SAAS;IAAA,GAAMC;EAAK,CAAI,CAAC,EACxBoB,yBAAyB,IAC1B,IAAAC,MAAA,CAAAC,aAAA,EAAChC,YAAA,CAAAkC,aAAa,QACb,IAAAH,MAAA,CAAAC,aAAA,EAAC3B,QAAA,CAAA8B,gBAAgB;IAChBrB,WAAW,EAAGA,WAAa;IAC3BC,mBAAmB,EAAGA,mBAAqB;IAC3CqB,QAAQ,EAAKC,YAAY,IAAM;MAC9BX,qBAAqB,CACpBhB,KAAK,CAACC,QAAQ,EACd0B,YACD,CAAC;IACF;EAAG,CACH,CACa,CAEf,CAAC;AAEL,CAAC,EACD,iCACD,CAAC;AAED,IAAAC,gBAAS,EACR,kBAAkB,EAClB,8BAA8B,EAC9B/B,+BACD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_blockEditor","require","_compose","_data","_hooks","_widgets","_store","_jsxRuntime","withMoveToWidgetAreaToolbarItem","createHigherOrderComponent","BlockEdit","props","clientId","name","blockName","widgetAreas","currentWidgetAreaId","canInsertBlockInWidgetArea","useSelect","select","selectors","editWidgetsStore","widgetAreaBlock","getParentWidgetAreaBlock","getWidgetAreas","attributes","id","moveBlockToWidgetArea","useDispatch","hasMultipleWidgetAreas","length","isMoveToWidgetAreaVisible","jsxs","Fragment","children","jsx","BlockControls","MoveToWidgetArea","onSelect","widgetAreaId","addFilter"],"sources":["@wordpress/edit-widgets/src/filters/move-to-widget-area.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { BlockControls } from '@wordpress/block-editor';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { addFilter } from '@wordpress/hooks';\nimport { MoveToWidgetArea } from '@wordpress/widgets';\n\n/**\n * Internal dependencies\n */\nimport { store as editWidgetsStore } from '../store';\n\nconst withMoveToWidgetAreaToolbarItem = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst { clientId, name: blockName } = props;\n\t\tconst { widgetAreas, currentWidgetAreaId, canInsertBlockInWidgetArea } =\n\t\t\tuseSelect(\n\t\t\t\t( select ) => {\n\t\t\t\t\t// Component won't display for a widget area, so don't run selectors.\n\t\t\t\t\tif ( blockName === 'core/widget-area' ) {\n\t\t\t\t\t\treturn {};\n\t\t\t\t\t}\n\n\t\t\t\t\tconst selectors = select( editWidgetsStore );\n\n\t\t\t\t\tconst widgetAreaBlock =\n\t\t\t\t\t\tselectors.getParentWidgetAreaBlock( clientId );\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\twidgetAreas: selectors.getWidgetAreas(),\n\t\t\t\t\t\tcurrentWidgetAreaId: widgetAreaBlock?.attributes?.id,\n\t\t\t\t\t\tcanInsertBlockInWidgetArea:\n\t\t\t\t\t\t\tselectors.canInsertBlockInWidgetArea( blockName ),\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t\t[ clientId, blockName ]\n\t\t\t);\n\n\t\tconst { moveBlockToWidgetArea } = useDispatch( editWidgetsStore );\n\t\tconst hasMultipleWidgetAreas = widgetAreas?.length > 1;\n\t\tconst isMoveToWidgetAreaVisible =\n\t\t\tblockName !== 'core/widget-area' &&\n\t\t\thasMultipleWidgetAreas &&\n\t\t\tcanInsertBlockInWidgetArea;\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<BlockEdit { ...props } />\n\t\t\t\t{ isMoveToWidgetAreaVisible && (\n\t\t\t\t\t<BlockControls>\n\t\t\t\t\t\t<MoveToWidgetArea\n\t\t\t\t\t\t\twidgetAreas={ widgetAreas }\n\t\t\t\t\t\t\tcurrentWidgetAreaId={ currentWidgetAreaId }\n\t\t\t\t\t\t\tonSelect={ ( widgetAreaId ) => {\n\t\t\t\t\t\t\t\tmoveBlockToWidgetArea(\n\t\t\t\t\t\t\t\t\tprops.clientId,\n\t\t\t\t\t\t\t\t\twidgetAreaId\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</BlockControls>\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t},\n\t'withMoveToWidgetAreaToolbarItem'\n);\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/edit-widgets/block-edit',\n\twithMoveToWidgetAreaToolbarItem\n);\n"],"mappings":";;AAIA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AAAqD,IAAAM,WAAA,GAAAN,OAAA;AAbrD;AACA;AACA;;AAQA;AACA;AACA;;AAGA,MAAMO,+BAA+B,GAAG,IAAAC,mCAA0B,EAC/DC,SAAS,IAAQC,KAAK,IAAM;EAC7B,MAAM;IAAEC,QAAQ;IAAEC,IAAI,EAAEC;EAAU,CAAC,GAAGH,KAAK;EAC3C,MAAM;IAAEI,WAAW;IAAEC,mBAAmB;IAAEC;EAA2B,CAAC,GACrE,IAAAC,eAAS,EACNC,MAAM,IAAM;IACb;IACA,IAAKL,SAAS,KAAK,kBAAkB,EAAG;MACvC,OAAO,CAAC,CAAC;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.js CHANGED
@@ -13,7 +13,6 @@ Object.defineProperty(exports, "store", {
13
13
  return _store.store;
14
14
  }
15
15
  });
16
- var _react = require("react");
17
16
  var _blocks = require("@wordpress/blocks");
18
17
  var _data = require("@wordpress/data");
19
18
  var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
@@ -27,6 +26,7 @@ require("./filters");
27
26
  var widgetArea = _interopRequireWildcard(require("./blocks/widget-area"));
28
27
  var _layout = _interopRequireDefault(require("./components/layout"));
29
28
  var _constants = require("./constants");
29
+ var _jsxRuntime = require("react/jsx-runtime");
30
30
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
31
31
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
32
32
  /**
@@ -60,7 +60,7 @@ function initializeEditor(id, settings) {
60
60
  (0, _data.dispatch)(_blocks.store).reapplyBlockTypeFilters();
61
61
  (0, _blockLibrary.registerCoreBlocks)(coreBlocks);
62
62
  (0, _widgets.registerLegacyWidgetBlock)();
63
- if (process.env.IS_GUTENBERG_PLUGIN) {
63
+ if (globalThis.IS_GUTENBERG_PLUGIN) {
64
64
  (0, _blockLibrary.__experimentalRegisterExperimentalCoreBlocks)({
65
65
  enableFSEBlocks: _constants.ENABLE_EXPERIMENTAL_FSE_BLOCKS
66
66
  });
@@ -75,7 +75,7 @@ function initializeEditor(id, settings) {
75
75
  // do this will result in errors in the default block parser.
76
76
  // see: https://github.com/WordPress/gutenberg/issues/33097
77
77
  (0, _blocks.setFreeformContentHandlerName)('core/html');
78
- root.render((0, _react.createElement)(_layout.default, {
78
+ root.render( /*#__PURE__*/(0, _jsxRuntime.jsx)(_layout.default, {
79
79
  blockEditorSettings: settings
80
80
  }));
81
81
  return root;
@@ -1 +1 @@
1
- {"version":3,"names":["_blocks","require","_data","_deprecated","_interopRequireDefault","_element","_blockLibrary","_coreData","_widgets","_preferences","_store","widgetArea","_interopRequireWildcard","_layout","_constants","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","disabledBlocks","ALLOW_REUSABLE_BLOCKS","initializeEditor","id","settings","target","document","getElementById","root","createRoot","coreBlocks","__experimentalGetCoreBlocks","filter","block","includes","name","startsWith","dispatch","preferencesStore","setDefaults","fixedToolbar","welcomeGuide","showBlockBreadcrumbs","themeStyles","blocksStore","reapplyBlockTypeFilters","registerCoreBlocks","registerLegacyWidgetBlock","process","env","IS_GUTENBERG_PLUGIN","__experimentalRegisterExperimentalCoreBlocks","enableFSEBlocks","ENABLE_EXPERIMENTAL_FSE_BLOCKS","registerLegacyWidgetVariations","registerBlock","registerWidgetGroupBlock","__experimentalFetchLinkSuggestions","search","searchOptions","fetchLinkSuggestions","setFreeformContentHandlerName","render","_react","createElement","blockEditorSettings","initialize","exports","reinitializeEditor","deprecated","since","version","metadata","unstable__bootstrapServerSideBlockDefinitions","registerBlockType"],"sources":["@wordpress/edit-widgets/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tregisterBlockType,\n\tunstable__bootstrapServerSideBlockDefinitions, // eslint-disable-line camelcase\n\tsetFreeformContentHandlerName,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport { dispatch } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot } from '@wordpress/element';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalGetCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport { __experimentalFetchLinkSuggestions as fetchLinkSuggestions } from '@wordpress/core-data';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterLegacyWidgetVariations,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport './store';\nimport './filters';\nimport * as widgetArea from './blocks/widget-area';\n\nimport Layout from './components/layout';\nimport {\n\tALLOW_REUSABLE_BLOCKS,\n\tENABLE_EXPERIMENTAL_FSE_BLOCKS,\n} from './constants';\n\nconst disabledBlocks = [\n\t'core/more',\n\t'core/freeform',\n\t'core/template-part',\n\t...( ALLOW_REUSABLE_BLOCKS ? [] : [ 'core/block' ] ),\n];\n\n/**\n * Initializes the block editor in the widgets screen.\n *\n * @param {string} id ID of the root element to render the screen in.\n * @param {Object} settings Block editor settings.\n */\nexport function initializeEditor( id, settings ) {\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tconst coreBlocks = __experimentalGetCoreBlocks().filter( ( block ) => {\n\t\treturn ! (\n\t\t\tdisabledBlocks.includes( block.name ) ||\n\t\t\tblock.name.startsWith( 'core/post' ) ||\n\t\t\tblock.name.startsWith( 'core/query' ) ||\n\t\t\tblock.name.startsWith( 'core/site' ) ||\n\t\t\tblock.name.startsWith( 'core/navigation' )\n\t\t);\n\t} );\n\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-widgets', {\n\t\tfixedToolbar: false,\n\t\twelcomeGuide: true,\n\t\tshowBlockBreadcrumbs: true,\n\t\tthemeStyles: true,\n\t} );\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\tregisterCoreBlocks( coreBlocks );\n\tregisterLegacyWidgetBlock();\n\tif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: ENABLE_EXPERIMENTAL_FSE_BLOCKS,\n\t\t} );\n\t}\n\tregisterLegacyWidgetVariations( settings );\n\tregisterBlock( widgetArea );\n\tregisterWidgetGroupBlock();\n\n\tsettings.__experimentalFetchLinkSuggestions = ( search, searchOptions ) =>\n\t\tfetchLinkSuggestions( search, searchOptions, settings );\n\n\t// As we are unregistering `core/freeform` to avoid the Classic block, we must\n\t// replace it with something as the default freeform content handler. Failure to\n\t// do this will result in errors in the default block parser.\n\t// see: https://github.com/WordPress/gutenberg/issues/33097\n\tsetFreeformContentHandlerName( 'core/html' );\n\n\troot.render( <Layout blockEditorSettings={ settings } /> );\n\n\treturn root;\n}\n\n/**\n * Compatibility export under the old `initialize` name.\n */\nexport const initialize = initializeEditor;\n\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editWidgets.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\n/**\n * Function to register an individual block.\n *\n * @param {Object} block The block to be registered.\n */\nconst registerBlock = ( block ) => {\n\tif ( ! block ) {\n\t\treturn;\n\t}\n\tconst { metadata, settings, name } = block;\n\tif ( metadata ) {\n\t\tunstable__bootstrapServerSideBlockDefinitions( { [ name ]: metadata } );\n\t}\n\tregisterBlockType( name, settings );\n};\n\nexport { store } from './store';\n"],"mappings":";;;;;;;;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAMA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AAKA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AAKA,IAAAQ,YAAA,GAAAR,OAAA;AAKA,IAAAS,MAAA,GAAAT,OAAA;AACAA,OAAA;AACA,IAAAU,UAAA,GAAAC,uBAAA,CAAAX,OAAA;AAEA,IAAAY,OAAA,GAAAT,sBAAA,CAAAH,OAAA;AACA,IAAAa,UAAA,G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C,kCAAkC,GAAG,CAAEC,MAAM,EAAEC,aAAa,KACpE,IAAAC,4CAAoB,EAAEF,MAAM,EAAEC,aAAa,EAAEnC,QAAS,CAAC;;EAExD;EACA;EACA;EACA;EACA,IAAAqC,qCAA6B,EAAE,WAAY,CAAC;EAE5CjC,IAAI,CAACkC,MAAM,CAAE,IAAAC,MAAA,CAAAC,aAAA,EAAClE,OAAA,CAAAQ,OAAM;IAAC2D,mBAAmB,EAAGzC;EAAU,CAAE,CAAE,CAAC;EAE1D,OAAOI,IAAI;AACZ;;AAEA;AACA;AACA;AACO,MAAMsC,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAG5C,gBAAgB;AAEnC,SAAS8C,kBAAkBA,CAAA,EAAG;EACpC,IAAAC,mBAAU,EAAE,mCAAmC,EAAE;IAChDC,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAMhB,aAAa,GAAKtB,KAAK,IAAM;EAClC,IAAK,CAAEA,KAAK,EAAG;IACd;EACD;EACA,MAAM;IAAEuC,QAAQ;IAAEhD,QAAQ;IAAEW;EAAK,CAAC,GAAGF,KAAK;EAC1C,IAAKuC,QAAQ,EAAG;IACf,IAAAC,qDAA6C,EAAE;MAAE,CAAEtC,IAAI,GAAIqC;IAAS,CAAE,CAAC;EACxE;EACA,IAAAE,yBAAiB,EAAEvC,IAAI,EAAEX,QAAS,CAAC;AACpC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_blocks","require","_data","_deprecated","_interopRequireDefault","_element","_blockLibrary","_coreData","_widgets","_preferences","_store","widgetArea","_interopRequireWildcard","_layout","_constants","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","disabledBlocks","ALLOW_REUSABLE_BLOCKS","initializeEditor","id","settings","target","document","getElementById","root","createRoot","coreBlocks","__experimentalGetCoreBlocks","filter","block","includes","name","startsWith","dispatch","preferencesStore","setDefaults","fixedToolbar","welcomeGuide","showBlockBreadcrumbs","themeStyles","blocksStore","reapplyBlockTypeFilters","registerCoreBlocks","registerLegacyWidgetBlock","globalThis","IS_GUTENBERG_PLUGIN","__experimentalRegisterExperimentalCoreBlocks","enableFSEBlocks","ENABLE_EXPERIMENTAL_FSE_BLOCKS","registerLegacyWidgetVariations","registerBlock","registerWidgetGroupBlock","__experimentalFetchLinkSuggestions","search","searchOptions","fetchLinkSuggestions","setFreeformContentHandlerName","render","jsx","blockEditorSettings","initialize","exports","reinitializeEditor","deprecated","since","version","metadata","unstable__bootstrapServerSideBlockDefinitions","registerBlockType"],"sources":["@wordpress/edit-widgets/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tregisterBlockType,\n\tunstable__bootstrapServerSideBlockDefinitions, // eslint-disable-line camelcase\n\tsetFreeformContentHandlerName,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport { dispatch } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot } from '@wordpress/element';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalGetCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport { __experimentalFetchLinkSuggestions as fetchLinkSuggestions } from '@wordpress/core-data';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterLegacyWidgetVariations,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport './store';\nimport './filters';\nimport * as widgetArea from './blocks/widget-area';\n\nimport Layout from './components/layout';\nimport {\n\tALLOW_REUSABLE_BLOCKS,\n\tENABLE_EXPERIMENTAL_FSE_BLOCKS,\n} from './constants';\n\nconst disabledBlocks = [\n\t'core/more',\n\t'core/freeform',\n\t'core/template-part',\n\t...( ALLOW_REUSABLE_BLOCKS ? [] : [ 'core/block' ] ),\n];\n\n/**\n * Initializes the block editor in the widgets screen.\n *\n * @param {string} id ID of the root element to render the screen in.\n * @param {Object} settings Block editor settings.\n */\nexport function initializeEditor( id, settings ) {\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tconst coreBlocks = __experimentalGetCoreBlocks().filter( ( block ) => {\n\t\treturn ! (\n\t\t\tdisabledBlocks.includes( block.name ) ||\n\t\t\tblock.name.startsWith( 'core/post' ) ||\n\t\t\tblock.name.startsWith( 'core/query' ) ||\n\t\t\tblock.name.startsWith( 'core/site' ) ||\n\t\t\tblock.name.startsWith( 'core/navigation' )\n\t\t);\n\t} );\n\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-widgets', {\n\t\tfixedToolbar: false,\n\t\twelcomeGuide: true,\n\t\tshowBlockBreadcrumbs: true,\n\t\tthemeStyles: true,\n\t} );\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\tregisterCoreBlocks( coreBlocks );\n\tregisterLegacyWidgetBlock();\n\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: ENABLE_EXPERIMENTAL_FSE_BLOCKS,\n\t\t} );\n\t}\n\tregisterLegacyWidgetVariations( settings );\n\tregisterBlock( widgetArea );\n\tregisterWidgetGroupBlock();\n\n\tsettings.__experimentalFetchLinkSuggestions = ( search, searchOptions ) =>\n\t\tfetchLinkSuggestions( search, searchOptions, settings );\n\n\t// As we are unregistering `core/freeform` to avoid the Classic block, we must\n\t// replace it with something as the default freeform content handler. Failure to\n\t// do this will result in errors in the default block parser.\n\t// see: https://github.com/WordPress/gutenberg/issues/33097\n\tsetFreeformContentHandlerName( 'core/html' );\n\n\troot.render( <Layout blockEditorSettings={ settings } /> );\n\n\treturn root;\n}\n\n/**\n * Compatibility export under the old `initialize` name.\n */\nexport const initialize = initializeEditor;\n\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editWidgets.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\n/**\n * Function to register an individual block.\n *\n * @param {Object} block The block to be registered.\n */\nconst registerBlock = ( block ) => {\n\tif ( ! block ) {\n\t\treturn;\n\t}\n\tconst { metadata, settings, name } = block;\n\tif ( metadata ) {\n\t\tunstable__bootstrapServerSideBlockDefinitions( { [ name ]: metadata } );\n\t}\n\tregisterBlockType( name, settings );\n};\n\nexport { store } from './store';\n"],"mappings":";;;;;;;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAMA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AAKA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AAKA,IAAAQ,YAAA,GAAAR,OAAA;AAKA,IAAAS,MAAA,GAAAT,OAAA;AACAA,OAAA;AACA,IAAAU,UAAA,GAAAC,uBAAA,CAAAX,OAAA;AAEA,IAAAY,OAAA,GAAAT,sBAAA,CAAAH,OAAA;AACA,IAAAa,UAAA,GAAAb,OAAA;AAGqB,IAAAc,WAAA,GAAAd,OAAA;AAAA,SAAAe,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAL,wBAAAK,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GA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,mBAAU,EAAE,mCAAmC,EAAE;IAChDC,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAMf,aAAa,GAAKrB,KAAK,IAAM;EAClC,IAAK,CAAEA,KAAK,EAAG;IACd;EACD;EACA,MAAM;IAAEqC,QAAQ;IAAE9C,QAAQ;IAAEW;EAAK,CAAC,GAAGF,KAAK;EAC1C,IAAKqC,QAAQ,EAAG;IACf,IAAAC,qDAA6C,EAAE;MAAE,CAAEpC,IAAI,GAAImC;IAAS,CAAE,CAAC;EACxE;EACA,IAAAE,yBAAiB,EAAErC,IAAI,EAAEX,QAAS,CAAC;AACpC,CAAC","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- import { createElement } from "react";
2
1
  /**
3
2
  * WordPress dependencies
4
3
  */
@@ -15,7 +14,7 @@ import { store as editWidgetsStore } from '../../../store';
15
14
  import useIsDraggingWithin from './use-is-dragging-within';
16
15
 
17
16
  /** @typedef {import('@wordpress/element').RefObject} RefObject */
18
-
17
+ import { jsx as _jsx } from "react/jsx-runtime";
19
18
  export default function WidgetAreaEdit({
20
19
  clientId,
21
20
  className,
@@ -45,33 +44,38 @@ export default function WidgetAreaEdit({
45
44
  setOpen(false);
46
45
  }
47
46
  }, [isOpen, isDragging, isDraggingWithin, openedWhileDragging]);
48
- return createElement(Panel, {
47
+ return /*#__PURE__*/_jsx(Panel, {
49
48
  className: className,
50
- ref: wrapper
51
- }, createElement(PanelBody, {
52
- title: name,
53
- opened: isOpen,
54
- onToggle: () => {
55
- setIsWidgetAreaOpen(clientId, !isOpen);
56
- },
57
- scrollAfterOpen: !isDragging
58
- }, ({
59
- opened
60
- }) =>
61
- // This is required to ensure LegacyWidget blocks are not
62
- // unmounted when the panel is collapsed. Unmounting legacy
63
- // widgets may have unintended consequences (e.g. TinyMCE
64
- // not being properly reinitialized)
65
- createElement(DisclosureContent, {
66
- className: "wp-block-widget-area__panel-body-content",
67
- visible: opened
68
- }, createElement(EntityProvider, {
69
- kind: "root",
70
- type: "postType",
71
- id: `widget-area-${id}`
72
- }, createElement(WidgetAreaInnerBlocks, {
73
- id: id
74
- })))));
49
+ ref: wrapper,
50
+ children: /*#__PURE__*/_jsx(PanelBody, {
51
+ title: name,
52
+ opened: isOpen,
53
+ onToggle: () => {
54
+ setIsWidgetAreaOpen(clientId, !isOpen);
55
+ },
56
+ scrollAfterOpen: !isDragging,
57
+ children: ({
58
+ opened
59
+ }) =>
60
+ /*#__PURE__*/
61
+ // This is required to ensure LegacyWidget blocks are not
62
+ // unmounted when the panel is collapsed. Unmounting legacy
63
+ // widgets may have unintended consequences (e.g. TinyMCE
64
+ // not being properly reinitialized)
65
+ _jsx(DisclosureContent, {
66
+ className: "wp-block-widget-area__panel-body-content",
67
+ visible: opened,
68
+ children: /*#__PURE__*/_jsx(EntityProvider, {
69
+ kind: "root",
70
+ type: "postType",
71
+ id: `widget-area-${id}`,
72
+ children: /*#__PURE__*/_jsx(WidgetAreaInnerBlocks, {
73
+ id: id
74
+ })
75
+ })
76
+ })
77
+ })
78
+ });
75
79
  }
76
80
 
77
81
  /**
@@ -1 +1 @@
1
- {"version":3,"names":["useEffect","useState","useCallback","useRef","useSelect","useDispatch","EntityProvider","__unstableDisclosureContent","DisclosureContent","Panel","PanelBody","WidgetAreaInnerBlocks","store","editWidgetsStore","useIsDraggingWithin","WidgetAreaEdit","clientId","className","attributes","id","name","isOpen","select","getIsWidgetAreaOpen","setIsWidgetAreaOpen","wrapper","setOpen","openState","isDragging","useIsDragging","isDraggingWithin","openedWhileDragging","setOpenedWhileDragging","createElement","ref","title","opened","onToggle","scrollAfterOpen","visible","kind","type","elementRef","setIsDragging","ownerDocument","current","handleDragStart","handleDragEnd","addEventListener","removeEventListener"],"sources":["@wordpress/edit-widgets/src/blocks/widget-area/edit/index.js"],"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"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,QAAQ,EAAEC,WAAW,EAAEC,MAAM,QAAQ,oBAAoB;AAC7E,SAASC,SAAS,EAAEC,WAAW,QAAQ,i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B,CAAC;IAC9DF,aAAa,CAACI,gBAAgB,CAAE,SAAS,EAAED,aAAc,CAAC;IAE1D,OAAO,MAAM;MACZH,aAAa,CAACK,mBAAmB,CAAE,WAAW,EAAEH,eAAgB,CAAC;MACjEF,aAAa,CAACK,mBAAmB,CAAE,SAAS,EAAEF,aAAc,CAAC;IAC9D,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,OAAOnB,UAAU;AAClB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["useEffect","useState","useCallback","useRef","useSelect","useDispatch","EntityProvider","__unstableDisclosureContent","DisclosureContent","Panel","PanelBody","WidgetAreaInnerBlocks","store","editWidgetsStore","useIsDraggingWithin","jsx","_jsx","WidgetAreaEdit","clientId","className","attributes","id","name","isOpen","select","getIsWidgetAreaOpen","setIsWidgetAreaOpen","wrapper","setOpen","openState","isDragging","useIsDragging","isDraggingWithin","openedWhileDragging","setOpenedWhileDragging","ref","children","title","opened","onToggle","scrollAfterOpen","visible","kind","type","elementRef","setIsDragging","ownerDocument","current","handleDragStart","handleDragEnd","addEventListener","removeEventListener"],"sources":["@wordpress/edit-widgets/src/blocks/widget-area/edit/index.js"],"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"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,QAAQ,EAAEC,WAAW,EAAEC,MAAM,QAAQ,oBAAoB;AAC7E,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,cAAc,QAAQ,sBAAsB;AACrD,SACCC,2BAA2B,IAAIC,iBAAiB,EAChDC,KAAK,EACLC,SAAS,QACH,uBAAuB;;AAE9B;AACA;AACA;AACA,OAAOC,qBAAqB,MAAM,gBAAgB;AAClD,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,gBAAgB;AAC1D,OAAOC,mBAAmB,MAAM,0BAA0B;;AAE1D;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAEA,eAAe,SAASC,cAAcA,CAAE;EACvCC,QAAQ;EACRC,SAAS;EACTC,UAAU,EAAE;IAAEC,EAAE;IAAEC;EAAK;AACxB,CAAC,EAAG;EACH,MAAMC,M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ement } from "react";
2
1
  /**
3
2
  * External dependencies
4
3
  */
@@ -15,6 +14,7 @@ import { useRef } from '@wordpress/element';
15
14
  * Internal dependencies
16
15
  */
17
16
  import useIsDraggingWithin from './use-is-dragging-within';
17
+ import { jsx as _jsx } from "react/jsx-runtime";
18
18
  export default function WidgetAreaInnerBlocks({
19
19
  id
20
20
  }) {
@@ -32,13 +32,14 @@ export default function WidgetAreaInnerBlocks({
32
32
  templateLock: false,
33
33
  renderAppender: InnerBlocks.ButtonBlockAppender
34
34
  });
35
- return createElement("div", {
35
+ return /*#__PURE__*/_jsx("div", {
36
36
  "data-widget-area-id": id,
37
37
  className: clsx('wp-block-widget-area__inner-blocks block-editor-inner-blocks editor-styles-wrapper', {
38
38
  'wp-block-widget-area__highlight-drop-zone': shouldHighlightDropZone
39
+ }),
40
+ children: /*#__PURE__*/_jsx("div", {
41
+ ...innerBlocksProps
39
42
  })
40
- }, createElement("div", {
41
- ...innerBlocksProps
42
- }));
43
+ });
43
44
  }
44
45
  //# sourceMappingURL=inner-blocks.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","useEntityBlockEditor","InnerBlocks","useInnerBlocksProps","useRef","useIsDraggingWithin","WidgetAreaInnerBlocks","id","blocks","onInput","onChange","innerBlocksRef","isDraggingWithinInnerBlocks","shouldHighlightDropZone","innerBlocksProps","ref","value","templateLock","renderAppender","ButtonBlockAppender","createElement","className"],"sources":["@wordpress/edit-widgets/src/blocks/widget-area/edit/inner-blocks.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\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={ clsx(\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"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,oBAAoB,QAAQ,sBAAsB;AAC3D,SAASC,WAAW,EAAEC,mBAAmB,QAAQ,yBAAyB;AAC1E,SAASC,MAAM,QAAQ,oBAAoB;;AAE3C;AACA;AACA;AACA,OAAOC,mBAAmB,MAAM,0BAA0B;AAE1D,eAAe,SAASC,qBAAqBA,CAAE;EAAEC;AAAG,CAAC,EAAG;EACvD,MAAM,CAAEC,MAAM,EAAEC,OAAO,EAAEC,QAAQ,CAAE,GAAGT,oBAAoB,CACzD,MAAM,EACN,UACD,CAAC;EACD,MAAMU,cAAc,GAAGP,MAAM,CAAC,CAAC;EAC/B,MAAMQ,2BAA2B,GAAGP,mBAAmB,CAAEM,cAAe,CAAC;EACzE,MAAME,uBAAuB,GAAGD,2BAA2B;EAC3D;EACA,MAAME,gBAAgB,GAAGX,mBAAmB,CAC3C;IAAEY,GAAG,EAAEJ;EAAe,CAAC,EACvB;IACCK,KAAK,EAAER,MAAM;IACbC,OAAO;IACPC,QAAQ;IACRO,YAAY,EAAE,KAAK;IACnBC,cAAc,EAAEhB,WAAW,CAACiB;EAC7B,CACD,CAAC;EAED,OACCC,aAAA;IACC,uBAAsBb,EAAI;IAC1Bc,SAAS,EAAGrB,IAAI,CACf,oFAAoF,EACpF;MACC,2CAA2C,EAC1Ca;IACF,CACD;EAAG,GAEHO,aAAA;IAAA,GAAUN;EAAgB,CAAI,CAC1B,CAAC;AAER","ignoreList":[]}
1
+ {"version":3,"names":["clsx","useEntityBlockEditor","InnerBlocks","useInnerBlocksProps","useRef","useIsDraggingWithin","jsx","_jsx","WidgetAreaInnerBlocks","id","blocks","onInput","onChange","innerBlocksRef","isDraggingWithinInnerBlocks","shouldHighlightDropZone","innerBlocksProps","ref","value","templateLock","renderAppender","ButtonBlockAppender","className","children"],"sources":["@wordpress/edit-widgets/src/blocks/widget-area/edit/inner-blocks.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\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={ clsx(\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"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,oBAAoB,QAAQ,sBAAsB;AAC3D,SAASC,WAAW,EAAEC,mBAAmB,QAAQ,yBAAyB;AAC1E,SAASC,MAAM,QAAQ,oBAAoB;;AAE3C;AACA;AACA;AACA,OAAOC,mBAAmB,MAAM,0BAA0B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE3D,eAAe,SAASC,qBAAqBA,CAAE;EAAEC;AAAG,CAAC,EAAG;EACvD,MAAM,CAAEC,MAAM,EAAEC,OAAO,EAAEC,QAAQ,CAAE,GAAGX,oBAAoB,CACzD,MAAM,EACN,UACD,CAAC;EACD,MAAMY,cAAc,GAAGT,MAAM,CAAC,CAAC;EAC/B,MAAMU,2BAA2B,GAAGT,mBAAmB,CAAEQ,cAAe,CAAC;EACzE,MAAME,uBAAuB,GAAGD,2BAA2B;EAC3D;EACA,MAAME,gBAAgB,GAAGb,mBAAmB,CAC3C;IAAEc,GAAG,EAAEJ;EAAe,CAAC,EACvB;IACCK,KAAK,EAAER,MAAM;IACbC,OAAO;IACPC,QAAQ;IACRO,YAAY,EAAE,KAAK;IACnBC,cAAc,EAAElB,WAAW,CAACmB;EAC7B,CACD,CAAC;EAED,oBACCd,IAAA;IACC,uBAAsBE,EAAI;IAC1Ba,SAAS,EAAGtB,IAAI,CACf,oFAAoF,EACpF;MACC,2CAA2C,EAC1Ce;IACF,CACD,CAAG;IAAAQ,QAAA,eAEHhB,IAAA;MAAA,GAAUS;IAAgB,CAAI;EAAC,CAC3B,CAAC;AAER","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- import { createElement } from "react";
2
1
  /**
3
2
  * WordPress dependencies
4
3
  */
@@ -8,28 +7,31 @@ import { Button } from '@wordpress/components';
8
7
  import { Warning } from '@wordpress/block-editor';
9
8
  import { useCopyToClipboard } from '@wordpress/compose';
10
9
  import { doAction } from '@wordpress/hooks';
10
+ import { jsx as _jsx } from "react/jsx-runtime";
11
11
  function CopyButton({
12
12
  text,
13
13
  children
14
14
  }) {
15
15
  const ref = useCopyToClipboard(text);
16
- return createElement(Button, {
16
+ return /*#__PURE__*/_jsx(Button, {
17
17
  variant: "secondary",
18
- ref: ref
19
- }, children);
18
+ ref: ref,
19
+ children: children
20
+ });
20
21
  }
21
22
  function ErrorBoundaryWarning({
22
23
  message,
23
24
  error
24
25
  }) {
25
- const actions = [createElement(CopyButton, {
26
- key: "copy-error",
27
- text: error.stack
28
- }, __('Copy Error'))];
29
- return createElement(Warning, {
26
+ const actions = [/*#__PURE__*/_jsx(CopyButton, {
27
+ text: error.stack,
28
+ children: __('Copy Error')
29
+ }, "copy-error")];
30
+ return /*#__PURE__*/_jsx(Warning, {
30
31
  className: "edit-widgets-error-boundary",
31
- actions: actions
32
- }, message);
32
+ actions: actions,
33
+ children: message
34
+ });
33
35
  }
34
36
  export default class ErrorBoundary extends Component {
35
37
  constructor() {
@@ -50,7 +52,7 @@ export default class ErrorBoundary extends Component {
50
52
  if (!this.state.error) {
51
53
  return this.props.children;
52
54
  }
53
- return createElement(ErrorBoundaryWarning, {
55
+ return /*#__PURE__*/_jsx(ErrorBoundaryWarning, {
54
56
  message: __('The editor has encountered an unexpected error.'),
55
57
  error: this.state.error
56
58
  });
@@ -1 +1 @@
1
- {"version":3,"names":["Component","__","Button","Warning","useCopyToClipboard","doAction","CopyButton","text","children","ref","createElement","variant","ErrorBoundaryWarning","message","error","actions","key","stack","className","ErrorBoundary","constructor","arguments","state","componentDidCatch","getDerivedStateFromError","render","props"],"sources":["@wordpress/edit-widgets/src/components/error-boundary/index.js"],"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"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,MAAM,QAAQ,uBAAuB;AA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,KAAK,CAACR;IAAO,CAC1B,CAAC;EAEJ;AACD","ignoreList":[]}
1
+ {"version":3,"names":["Component","__","Button","Warning","useCopyToClipboard","doAction","jsx","_jsx","CopyButton","text","children","ref","variant","ErrorBoundaryWarning","message","error","actions","stack","className","ErrorBoundary","constructor","arguments","state","componentDidCatch","getDerivedStateFromError","render","props"],"sources":["@wordpress/edit-widgets/src/components/error-boundary/index.js"],"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}\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