@wordpress/edit-widgets 6.32.0 → 6.32.1-next.47f435fc9.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 (202) hide show
  1. package/build/blocks/widget-area/block.json +26 -0
  2. package/build/blocks/widget-area/edit/index.js +94 -87
  3. package/build/blocks/widget-area/edit/index.js.map +7 -1
  4. package/build/blocks/widget-area/edit/inner-blocks.js +68 -50
  5. package/build/blocks/widget-area/edit/inner-blocks.js.map +7 -1
  6. package/build/blocks/widget-area/edit/use-is-dragging-within.js +34 -40
  7. package/build/blocks/widget-area/edit/use-is-dragging-within.js.map +7 -1
  8. package/build/blocks/widget-area/index.js +49 -52
  9. package/build/blocks/widget-area/index.js.map +7 -1
  10. package/build/components/error-boundary/index.js +49 -51
  11. package/build/components/error-boundary/index.js.map +7 -1
  12. package/build/components/header/document-tools/index.js +104 -74
  13. package/build/components/header/document-tools/index.js.map +7 -1
  14. package/build/components/header/index.js +81 -62
  15. package/build/components/header/index.js.map +7 -1
  16. package/build/components/header/undo-redo/redo.js +50 -38
  17. package/build/components/header/undo-redo/redo.js.map +7 -1
  18. package/build/components/header/undo-redo/undo.js +49 -37
  19. package/build/components/header/undo-redo/undo.js.map +7 -1
  20. package/build/components/keyboard-shortcut-help-modal/config.js +74 -71
  21. package/build/components/keyboard-shortcut-help-modal/config.js.map +7 -1
  22. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +61 -44
  23. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +7 -1
  24. package/build/components/keyboard-shortcut-help-modal/index.js +154 -103
  25. package/build/components/keyboard-shortcut-help-modal/index.js.map +7 -1
  26. package/build/components/keyboard-shortcut-help-modal/shortcut.js +74 -56
  27. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +7 -1
  28. package/build/components/keyboard-shortcuts/index.js +89 -82
  29. package/build/components/keyboard-shortcuts/index.js.map +7 -1
  30. package/build/components/layout/index.js +75 -49
  31. package/build/components/layout/index.js.map +7 -1
  32. package/build/components/layout/interface.js +89 -75
  33. package/build/components/layout/interface.js.map +7 -1
  34. package/build/components/layout/unsaved-changes-warning.js +35 -42
  35. package/build/components/layout/unsaved-changes-warning.js.map +7 -1
  36. package/build/components/more-menu/index.js +189 -108
  37. package/build/components/more-menu/index.js.map +7 -1
  38. package/build/components/more-menu/tools-more-menu-group.js +29 -23
  39. package/build/components/more-menu/tools-more-menu-group.js.map +7 -1
  40. package/build/components/notices/index.js +62 -48
  41. package/build/components/notices/index.js.map +7 -1
  42. package/build/components/save-button/index.js +55 -47
  43. package/build/components/save-button/index.js.map +7 -1
  44. package/build/components/secondary-sidebar/index.js +41 -34
  45. package/build/components/secondary-sidebar/index.js.map +7 -1
  46. package/build/components/secondary-sidebar/inserter-sidebar.js +55 -46
  47. package/build/components/secondary-sidebar/inserter-sidebar.js.map +7 -1
  48. package/build/components/secondary-sidebar/list-view-sidebar.js +76 -67
  49. package/build/components/secondary-sidebar/list-view-sidebar.js.map +7 -1
  50. package/build/components/sidebar/index.js +149 -138
  51. package/build/components/sidebar/index.js.map +7 -1
  52. package/build/components/sidebar/widget-areas.js +73 -57
  53. package/build/components/sidebar/widget-areas.js.map +7 -1
  54. package/build/components/welcome-guide/index.js +182 -137
  55. package/build/components/welcome-guide/index.js.map +7 -1
  56. package/build/components/widget-areas-block-editor-content/index.js +64 -43
  57. package/build/components/widget-areas-block-editor-content/index.js.map +7 -1
  58. package/build/components/widget-areas-block-editor-provider/index.js +115 -92
  59. package/build/components/widget-areas-block-editor-provider/index.js.map +7 -1
  60. package/build/constants.js +30 -8
  61. package/build/constants.js.map +7 -1
  62. package/build/filters/index.js +3 -5
  63. package/build/filters/index.js.map +7 -1
  64. package/build/filters/move-to-widget-area.js +52 -59
  65. package/build/filters/move-to-widget-area.js.map +7 -1
  66. package/build/filters/replace-media-upload.js +9 -11
  67. package/build/filters/replace-media-upload.js.map +7 -1
  68. package/build/hooks/use-last-selected-widget-area.js +38 -44
  69. package/build/hooks/use-last-selected-widget-area.js.map +7 -1
  70. package/build/hooks/use-widget-library-insertion-point.js +60 -55
  71. package/build/hooks/use-widget-library-insertion-point.js.map +7 -1
  72. package/build/index.js +86 -93
  73. package/build/index.js.map +7 -1
  74. package/build/lock-unlock.js +31 -15
  75. package/build/lock-unlock.js.map +7 -1
  76. package/build/store/actions.js +181 -313
  77. package/build/store/actions.js.map +7 -1
  78. package/build/store/constants.js +27 -10
  79. package/build/store/constants.js.map +7 -1
  80. package/build/store/index.js +51 -51
  81. package/build/store/index.js.map +7 -1
  82. package/build/store/private-selectors.js +28 -7
  83. package/build/store/private-selectors.js.map +7 -1
  84. package/build/store/reducer.js +65 -118
  85. package/build/store/reducer.js.map +7 -1
  86. package/build/store/resolvers.js +64 -63
  87. package/build/store/resolvers.js.map +7 -1
  88. package/build/store/selectors.js +194 -231
  89. package/build/store/selectors.js.map +7 -1
  90. package/build/store/transformers.js +47 -41
  91. package/build/store/transformers.js.map +7 -1
  92. package/build/store/utils.js +47 -70
  93. package/build/store/utils.js.map +7 -1
  94. package/build-module/blocks/widget-area/block.json +26 -0
  95. package/build-module/blocks/widget-area/edit/index.js +63 -75
  96. package/build-module/blocks/widget-area/edit/index.js.map +7 -1
  97. package/build-module/blocks/widget-area/edit/inner-blocks.js +38 -41
  98. package/build-module/blocks/widget-area/edit/inner-blocks.js.map +7 -1
  99. package/build-module/blocks/widget-area/edit/use-is-dragging-within.js +14 -33
  100. package/build-module/blocks/widget-area/edit/use-is-dragging-within.js.map +7 -1
  101. package/build-module/blocks/widget-area/index.js +14 -46
  102. package/build-module/blocks/widget-area/index.js.map +7 -1
  103. package/build-module/components/error-boundary/index.js +30 -43
  104. package/build-module/components/error-boundary/index.js.map +7 -1
  105. package/build-module/components/header/document-tools/index.js +75 -66
  106. package/build-module/components/header/document-tools/index.js.map +7 -1
  107. package/build-module/components/header/index.js +52 -54
  108. package/build-module/components/header/index.js.map +7 -1
  109. package/build-module/components/header/undo-redo/redo.js +32 -32
  110. package/build-module/components/header/undo-redo/redo.js.map +7 -1
  111. package/build-module/components/header/undo-redo/undo.js +31 -31
  112. package/build-module/components/header/undo-redo/undo.js.map +7 -1
  113. package/build-module/components/keyboard-shortcut-help-modal/config.js +62 -75
  114. package/build-module/components/keyboard-shortcut-help-modal/config.js.map +7 -1
  115. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +33 -37
  116. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +7 -1
  117. package/build-module/components/keyboard-shortcut-help-modal/index.js +130 -97
  118. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +7 -1
  119. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +56 -50
  120. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +7 -1
  121. package/build-module/components/keyboard-shortcuts/index.js +73 -75
  122. package/build-module/components/keyboard-shortcuts/index.js.map +7 -1
  123. package/build-module/components/layout/index.js +46 -41
  124. package/build-module/components/layout/index.js.map +7 -1
  125. package/build-module/components/layout/interface.js +63 -66
  126. package/build-module/components/layout/interface.js.map +7 -1
  127. package/build-module/components/layout/unsaved-changes-warning.js +17 -37
  128. package/build-module/components/layout/unsaved-changes-warning.js.map +7 -1
  129. package/build-module/components/more-menu/index.js +167 -102
  130. package/build-module/components/more-menu/index.js.map +7 -1
  131. package/build-module/components/more-menu/tools-more-menu-group.js +11 -17
  132. package/build-module/components/more-menu/tools-more-menu-group.js.map +7 -1
  133. package/build-module/components/notices/index.js +43 -42
  134. package/build-module/components/notices/index.js.map +7 -1
  135. package/build-module/components/save-button/index.js +37 -41
  136. package/build-module/components/save-button/index.js.map +7 -1
  137. package/build-module/components/secondary-sidebar/index.js +14 -27
  138. package/build-module/components/secondary-sidebar/index.js.map +7 -1
  139. package/build-module/components/secondary-sidebar/inserter-sidebar.js +26 -38
  140. package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +7 -1
  141. package/build-module/components/secondary-sidebar/list-view-sidebar.js +57 -60
  142. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +7 -1
  143. package/build-module/components/sidebar/index.js +129 -127
  144. package/build-module/components/sidebar/index.js.map +7 -1
  145. package/build-module/components/sidebar/widget-areas.js +53 -49
  146. package/build-module/components/sidebar/widget-areas.js.map +7 -1
  147. package/build-module/components/welcome-guide/index.js +165 -132
  148. package/build-module/components/welcome-guide/index.js.map +7 -1
  149. package/build-module/components/widget-areas-block-editor-content/index.js +43 -36
  150. package/build-module/components/widget-areas-block-editor-content/index.js.map +7 -1
  151. package/build-module/components/widget-areas-block-editor-provider/index.js +85 -83
  152. package/build-module/components/widget-areas-block-editor-provider/index.js.map +7 -1
  153. package/build-module/constants.js +7 -3
  154. package/build-module/constants.js.map +7 -1
  155. package/build-module/filters/index.js +3 -6
  156. package/build-module/filters/index.js.map +7 -1
  157. package/build-module/filters/move-to-widget-area.js +52 -57
  158. package/build-module/filters/move-to-widget-area.js.map +7 -1
  159. package/build-module/filters/replace-media-upload.js +8 -7
  160. package/build-module/filters/replace-media-upload.js.map +7 -1
  161. package/build-module/hooks/use-last-selected-widget-area.js +20 -39
  162. package/build-module/hooks/use-last-selected-widget-area.js.map +7 -1
  163. package/build-module/hooks/use-widget-library-insertion-point.js +42 -49
  164. package/build-module/hooks/use-widget-library-insertion-point.js.map +7 -1
  165. package/build-module/index.js +60 -72
  166. package/build-module/index.js.map +7 -1
  167. package/build-module/lock-unlock.js +8 -7
  168. package/build-module/lock-unlock.js.map +7 -1
  169. package/build-module/store/actions.js +153 -293
  170. package/build-module/store/actions.js.map +7 -1
  171. package/build-module/store/constants.js +5 -5
  172. package/build-module/store/constants.js.map +7 -1
  173. package/build-module/store/index.js +16 -40
  174. package/build-module/store/index.js.map +7 -1
  175. package/build-module/store/private-selectors.js +7 -3
  176. package/build-module/store/private-selectors.js.map +7 -1
  177. package/build-module/store/reducer.js +42 -111
  178. package/build-module/store/reducer.js.map +7 -1
  179. package/build-module/store/resolvers.js +43 -51
  180. package/build-module/store/resolvers.js.map +7 -1
  181. package/build-module/store/selectors.js +171 -224
  182. package/build-module/store/selectors.js.map +7 -1
  183. package/build-module/store/transformers.js +23 -34
  184. package/build-module/store/transformers.js.map +7 -1
  185. package/build-module/store/utils.js +22 -63
  186. package/build-module/store/utils.js.map +7 -1
  187. package/build-style/style-rtl.css +216 -88
  188. package/build-style/style.css +216 -88
  189. package/package.json +36 -29
  190. package/src/blocks/widget-area/editor.scss +3 -0
  191. package/src/components/customizer-edit-widgets-initializer/style.scss +3 -0
  192. package/src/components/error-boundary/style.scss +2 -0
  193. package/src/components/header/style.scss +5 -0
  194. package/src/components/keyboard-shortcut-help-modal/style.scss +2 -0
  195. package/src/components/layout/style.scss +3 -0
  196. package/src/components/more-menu/style.scss +2 -0
  197. package/src/components/notices/style.scss +3 -0
  198. package/src/components/secondary-sidebar/style.scss +4 -0
  199. package/src/components/sidebar/style.scss +2 -0
  200. package/src/components/welcome-guide/style.scss +2 -0
  201. package/src/components/widget-areas-block-editor-content/style.scss +2 -0
  202. package/src/style.scss +16 -13
@@ -1,55 +1,48 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { useSelect } from '@wordpress/data';
5
- import { store as blockEditorStore } from '@wordpress/block-editor';
6
- import { store as coreStore } from '@wordpress/core-data';
7
-
8
- /**
9
- * Internal dependencies
10
- */
11
- import { store as editWidgetsStore } from '../store';
12
- import { buildWidgetAreasPostId, KIND, POST_TYPE } from '../store/utils';
1
+ import { useSelect } from "@wordpress/data";
2
+ import { store as blockEditorStore } from "@wordpress/block-editor";
3
+ import { store as coreStore } from "@wordpress/core-data";
4
+ import { store as editWidgetsStore } from "../store";
5
+ import { buildWidgetAreasPostId, KIND, POST_TYPE } from "../store/utils";
13
6
  const useWidgetLibraryInsertionPoint = () => {
14
- const firstRootId = useSelect(select => {
15
- // Default to the first widget area
16
- const {
17
- getEntityRecord
18
- } = select(coreStore);
19
- const widgetAreasPost = getEntityRecord(KIND, POST_TYPE, buildWidgetAreasPostId());
7
+ const firstRootId = useSelect((select) => {
8
+ const { getEntityRecord } = select(coreStore);
9
+ const widgetAreasPost = getEntityRecord(
10
+ KIND,
11
+ POST_TYPE,
12
+ buildWidgetAreasPostId()
13
+ );
20
14
  return widgetAreasPost?.blocks[0]?.clientId;
21
15
  }, []);
22
- return useSelect(select => {
23
- const {
24
- getBlockRootClientId,
25
- getBlockSelectionEnd,
26
- getBlockOrder,
27
- getBlockIndex
28
- } = select(blockEditorStore);
29
- const insertionPoint = select(editWidgetsStore).__experimentalGetInsertionPoint();
30
-
31
- // "Browse all" in the quick inserter will set the rootClientId to the current block.
32
- // Otherwise, it will just be undefined, and we'll have to handle it differently below.
33
- if (insertionPoint.rootClientId) {
34
- return insertionPoint;
35
- }
36
- const clientId = getBlockSelectionEnd() || firstRootId;
37
- const rootClientId = getBlockRootClientId(clientId);
38
-
39
- // If the selected block is at the root level, it's a widget area and
40
- // blocks can't be inserted here. Return this block as the root and the
41
- // last child clientId indicating insertion at the end.
42
- if (clientId && rootClientId === '') {
16
+ return useSelect(
17
+ (select) => {
18
+ const {
19
+ getBlockRootClientId,
20
+ getBlockSelectionEnd,
21
+ getBlockOrder,
22
+ getBlockIndex
23
+ } = select(blockEditorStore);
24
+ const insertionPoint = select(editWidgetsStore).__experimentalGetInsertionPoint();
25
+ if (insertionPoint.rootClientId) {
26
+ return insertionPoint;
27
+ }
28
+ const clientId = getBlockSelectionEnd() || firstRootId;
29
+ const rootClientId = getBlockRootClientId(clientId);
30
+ if (clientId && rootClientId === "") {
31
+ return {
32
+ rootClientId: clientId,
33
+ insertionIndex: getBlockOrder(clientId).length
34
+ };
35
+ }
43
36
  return {
44
- rootClientId: clientId,
45
- insertionIndex: getBlockOrder(clientId).length
37
+ rootClientId,
38
+ insertionIndex: getBlockIndex(clientId) + 1
46
39
  };
47
- }
48
- return {
49
- rootClientId,
50
- insertionIndex: getBlockIndex(clientId) + 1
51
- };
52
- }, [firstRootId]);
40
+ },
41
+ [firstRootId]
42
+ );
53
43
  };
54
- export default useWidgetLibraryInsertionPoint;
55
- //# sourceMappingURL=use-widget-library-insertion-point.js.map
44
+ var use_widget_library_insertion_point_default = useWidgetLibraryInsertionPoint;
45
+ export {
46
+ use_widget_library_insertion_point_default as default
47
+ };
48
+ //# sourceMappingURL=use-widget-library-insertion-point.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["useSelect","store","blockEditorStore","coreStore","editWidgetsStore","buildWidgetAreasPostId","KIND","POST_TYPE","useWidgetLibraryInsertionPoint","firstRootId","select","getEntityRecord","widgetAreasPost","blocks","clientId","getBlockRootClientId","getBlockSelectionEnd","getBlockOrder","getBlockIndex","insertionPoint","__experimentalGetInsertionPoint","rootClientId","insertionIndex","length"],"sources":["@wordpress/edit-widgets/src/hooks/use-widget-library-insertion-point.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editWidgetsStore } from '../store';\nimport { buildWidgetAreasPostId, KIND, POST_TYPE } from '../store/utils';\n\nconst useWidgetLibraryInsertionPoint = () => {\n\tconst firstRootId = useSelect( ( select ) => {\n\t\t// Default to the first widget area\n\t\tconst { getEntityRecord } = select( coreStore );\n\t\tconst widgetAreasPost = getEntityRecord(\n\t\t\tKIND,\n\t\t\tPOST_TYPE,\n\t\t\tbuildWidgetAreasPostId()\n\t\t);\n\t\treturn widgetAreasPost?.blocks[ 0 ]?.clientId;\n\t}, [] );\n\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tgetBlockSelectionEnd,\n\t\t\t\tgetBlockOrder,\n\t\t\t\tgetBlockIndex,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tconst insertionPoint =\n\t\t\t\tselect( editWidgetsStore ).__experimentalGetInsertionPoint();\n\n\t\t\t// \"Browse all\" in the quick inserter will set the rootClientId to the current block.\n\t\t\t// Otherwise, it will just be undefined, and we'll have to handle it differently below.\n\t\t\tif ( insertionPoint.rootClientId ) {\n\t\t\t\treturn insertionPoint;\n\t\t\t}\n\n\t\t\tconst clientId = getBlockSelectionEnd() || firstRootId;\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\n\t\t\t// If the selected block is at the root level, it's a widget area and\n\t\t\t// blocks can't be inserted here. Return this block as the root and the\n\t\t\t// last child clientId indicating insertion at the end.\n\t\t\tif ( clientId && rootClientId === '' ) {\n\t\t\t\treturn {\n\t\t\t\t\trootClientId: clientId,\n\t\t\t\t\tinsertionIndex: getBlockOrder( clientId ).length,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\trootClientId,\n\t\t\t\tinsertionIndex: getBlockIndex( clientId ) + 1,\n\t\t\t};\n\t\t},\n\t\t[ firstRootId ]\n\t);\n};\n\nexport default useWidgetLibraryInsertionPoint;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASD,KAAK,IAAIE,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASF,KAAK,IAAIG,gBAAgB,QAAQ,UAAU;AACpD,SAASC,sBAAsB,EAAEC,IAAI,EAAEC,SAAS,QAAQ,gBAAgB;AAExE,MAAMC,8BAA8B,GAAGA,CAAA,KAAM;EAC5C,MAAMC,WAAW,GAAGT,SAAS,CAAIU,MAAM,IAAM;IAC5C;IACA,MAAM;MAAEC;IAAgB,CAAC,GAAGD,MAAM,CAAEP,SAAU,CAAC;IAC/C,MAAMS,eAAe,GAAGD,eAAe,CACtCL,IAAI,EACJC,SAAS,EACTF,sBAAsB,CAAC,CACxB,CAAC;IACD,OAAOO,eAAe,EAAEC,MAAM,CAAE,CAAC,CAAE,EAAEC,QAAQ;EAC9C,CAAC,EAAE,EAAG,CAAC;EAEP,OAAOd,SAAS,CACbU,MAAM,IAAM;IACb,MAAM;MACLK,oBAAoB;MACpBC,oBAAoB;MACpBC,aAAa;MACbC;IACD,CAAC,GAAGR,MAAM,CAAER,gBAAiB,CAAC;IAE9B,MAAMiB,cAAc,GACnBT,MAAM,CAAEN,gBAAiB,CAAC,CAACgB,+BAA+B,CAAC,CAAC;;IAE7D;IACA;IACA,IAAKD,cAAc,CAACE,YAAY,EAAG;MAClC,OAAOF,cAAc;IACtB;IAEA,MAAML,QAAQ,GAAGE,oBAAoB,CAAC,CAAC,IAAIP,WAAW;IACtD,MAAMY,YAAY,GAAGN,oBAAoB,CAAED,QAAS,CAAC;;IAErD;IACA;IACA;IACA,IAAKA,QAAQ,IAAIO,YAAY,KAAK,EAAE,EAAG;MACtC,OAAO;QACNA,YAAY,EAAEP,QAAQ;QACtBQ,cAAc,EAAEL,aAAa,CAAEH,QAAS,CAAC,CAACS;MAC3C,CAAC;IACF;IAEA,OAAO;MACNF,YAAY;MACZC,cAAc,EAAEJ,aAAa,CAAEJ,QAAS,CAAC,GAAG;IAC7C,CAAC;EACF,CAAC,EACD,CAAEL,WAAW,CACd,CAAC;AACF,CAAC;AAED,eAAeD,8BAA8B","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/hooks/use-widget-library-insertion-point.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editWidgetsStore } from '../store';\nimport { buildWidgetAreasPostId, KIND, POST_TYPE } from '../store/utils';\n\nconst useWidgetLibraryInsertionPoint = () => {\n\tconst firstRootId = useSelect( ( select ) => {\n\t\t// Default to the first widget area\n\t\tconst { getEntityRecord } = select( coreStore );\n\t\tconst widgetAreasPost = getEntityRecord(\n\t\t\tKIND,\n\t\t\tPOST_TYPE,\n\t\t\tbuildWidgetAreasPostId()\n\t\t);\n\t\treturn widgetAreasPost?.blocks[ 0 ]?.clientId;\n\t}, [] );\n\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tgetBlockSelectionEnd,\n\t\t\t\tgetBlockOrder,\n\t\t\t\tgetBlockIndex,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tconst insertionPoint =\n\t\t\t\tselect( editWidgetsStore ).__experimentalGetInsertionPoint();\n\n\t\t\t// \"Browse all\" in the quick inserter will set the rootClientId to the current block.\n\t\t\t// Otherwise, it will just be undefined, and we'll have to handle it differently below.\n\t\t\tif ( insertionPoint.rootClientId ) {\n\t\t\t\treturn insertionPoint;\n\t\t\t}\n\n\t\t\tconst clientId = getBlockSelectionEnd() || firstRootId;\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\n\t\t\t// If the selected block is at the root level, it's a widget area and\n\t\t\t// blocks can't be inserted here. Return this block as the root and the\n\t\t\t// last child clientId indicating insertion at the end.\n\t\t\tif ( clientId && rootClientId === '' ) {\n\t\t\t\treturn {\n\t\t\t\t\trootClientId: clientId,\n\t\t\t\t\tinsertionIndex: getBlockOrder( clientId ).length,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\trootClientId,\n\t\t\t\tinsertionIndex: getBlockIndex( clientId ) + 1,\n\t\t\t};\n\t\t},\n\t\t[ firstRootId ]\n\t);\n};\n\nexport default useWidgetLibraryInsertionPoint;\n"],
5
+ "mappings": "AAGA,SAAS,iBAAiB;AAC1B,SAAS,SAAS,wBAAwB;AAC1C,SAAS,SAAS,iBAAiB;AAKnC,SAAS,SAAS,wBAAwB;AAC1C,SAAS,wBAAwB,MAAM,iBAAiB;AAExD,MAAM,iCAAiC,MAAM;AAC5C,QAAM,cAAc,UAAW,CAAE,WAAY;AAE5C,UAAM,EAAE,gBAAgB,IAAI,OAAQ,SAAU;AAC9C,UAAM,kBAAkB;AAAA,MACvB;AAAA,MACA;AAAA,MACA,uBAAuB;AAAA,IACxB;AACA,WAAO,iBAAiB,OAAQ,CAAE,GAAG;AAAA,EACtC,GAAG,CAAC,CAAE;AAEN,SAAO;AAAA,IACN,CAAE,WAAY;AACb,YAAM;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACD,IAAI,OAAQ,gBAAiB;AAE7B,YAAM,iBACL,OAAQ,gBAAiB,EAAE,gCAAgC;AAI5D,UAAK,eAAe,cAAe;AAClC,eAAO;AAAA,MACR;AAEA,YAAM,WAAW,qBAAqB,KAAK;AAC3C,YAAM,eAAe,qBAAsB,QAAS;AAKpD,UAAK,YAAY,iBAAiB,IAAK;AACtC,eAAO;AAAA,UACN,cAAc;AAAA,UACd,gBAAgB,cAAe,QAAS,EAAE;AAAA,QAC3C;AAAA,MACD;AAEA,aAAO;AAAA,QACN;AAAA,QACA,gBAAgB,cAAe,QAAS,IAAI;AAAA,MAC7C;AAAA,IACD;AAAA,IACA,CAAE,WAAY;AAAA,EACf;AACD;AAEA,IAAO,6CAAQ;",
6
+ "names": []
7
+ }
@@ -1,41 +1,46 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { registerBlockType, unstable__bootstrapServerSideBlockDefinitions,
5
- // eslint-disable-line camelcase
6
- setFreeformContentHandlerName, store as blocksStore } from '@wordpress/blocks';
7
- import { dispatch } from '@wordpress/data';
8
- import deprecated from '@wordpress/deprecated';
9
- import { StrictMode, createRoot } from '@wordpress/element';
10
- import { registerCoreBlocks, __experimentalGetCoreBlocks, __experimentalRegisterExperimentalCoreBlocks } from '@wordpress/block-library';
11
- import { __experimentalFetchLinkSuggestions as fetchLinkSuggestions } from '@wordpress/core-data';
12
- import { registerLegacyWidgetBlock, registerLegacyWidgetVariations, registerWidgetGroupBlock } from '@wordpress/widgets';
13
- import { store as preferencesStore } from '@wordpress/preferences';
14
-
15
- /**
16
- * Internal dependencies
17
- */
18
- import './store';
19
- import './filters';
20
- import * as widgetArea from './blocks/widget-area';
21
- import Layout from './components/layout';
22
- import { ALLOW_REUSABLE_BLOCKS, ENABLE_EXPERIMENTAL_FSE_BLOCKS } from './constants';
23
- import { jsx as _jsx } from "react/jsx-runtime";
24
- const disabledBlocks = ['core/more', 'core/freeform', 'core/template-part', ...(ALLOW_REUSABLE_BLOCKS ? [] : ['core/block'])];
25
-
26
- /**
27
- * Initializes the block editor in the widgets screen.
28
- *
29
- * @param {string} id ID of the root element to render the screen in.
30
- * @param {Object} settings Block editor settings.
31
- */
32
- export function initializeEditor(id, settings) {
1
+ import { jsx } from "react/jsx-runtime";
2
+ import {
3
+ registerBlockType,
4
+ unstable__bootstrapServerSideBlockDefinitions,
5
+ setFreeformContentHandlerName,
6
+ store as blocksStore
7
+ } from "@wordpress/blocks";
8
+ import { dispatch } from "@wordpress/data";
9
+ import deprecated from "@wordpress/deprecated";
10
+ import { StrictMode, createRoot } from "@wordpress/element";
11
+ import {
12
+ registerCoreBlocks,
13
+ __experimentalGetCoreBlocks,
14
+ __experimentalRegisterExperimentalCoreBlocks
15
+ } from "@wordpress/block-library";
16
+ import { __experimentalFetchLinkSuggestions as fetchLinkSuggestions } from "@wordpress/core-data";
17
+ import {
18
+ registerLegacyWidgetBlock,
19
+ registerLegacyWidgetVariations,
20
+ registerWidgetGroupBlock
21
+ } from "@wordpress/widgets";
22
+ import { store as preferencesStore } from "@wordpress/preferences";
23
+ import "./store";
24
+ import "./filters";
25
+ import * as widgetArea from "./blocks/widget-area";
26
+ import Layout from "./components/layout";
27
+ import {
28
+ ALLOW_REUSABLE_BLOCKS,
29
+ ENABLE_EXPERIMENTAL_FSE_BLOCKS
30
+ } from "./constants";
31
+ const disabledBlocks = [
32
+ "core/more",
33
+ "core/freeform",
34
+ "core/template-part",
35
+ ...ALLOW_REUSABLE_BLOCKS ? [] : ["core/block"]
36
+ ];
37
+ function initializeEditor(id, settings) {
33
38
  const target = document.getElementById(id);
34
39
  const root = createRoot(target);
35
- const coreBlocks = __experimentalGetCoreBlocks().filter(block => {
36
- return !(disabledBlocks.includes(block.name) || block.name.startsWith('core/post') || block.name.startsWith('core/query') || block.name.startsWith('core/site') || block.name.startsWith('core/navigation'));
40
+ const coreBlocks = __experimentalGetCoreBlocks().filter((block) => {
41
+ return !(disabledBlocks.includes(block.name) || block.name.startsWith("core/post") || block.name.startsWith("core/query") || block.name.startsWith("core/site") || block.name.startsWith("core/navigation"));
37
42
  });
38
- dispatch(preferencesStore).setDefaults('core/edit-widgets', {
43
+ dispatch(preferencesStore).setDefaults("core/edit-widgets", {
39
44
  fixedToolbar: false,
40
45
  welcomeGuide: true,
41
46
  showBlockBreadcrumbs: true,
@@ -53,51 +58,34 @@ export function initializeEditor(id, settings) {
53
58
  registerBlock(widgetArea);
54
59
  registerWidgetGroupBlock();
55
60
  settings.__experimentalFetchLinkSuggestions = (search, searchOptions) => fetchLinkSuggestions(search, searchOptions, settings);
56
-
57
- // As we are unregistering `core/freeform` to avoid the Classic block, we must
58
- // replace it with something as the default freeform content handler. Failure to
59
- // do this will result in errors in the default block parser.
60
- // see: https://github.com/WordPress/gutenberg/issues/33097
61
- setFreeformContentHandlerName('core/html');
62
- root.render(/*#__PURE__*/_jsx(StrictMode, {
63
- children: /*#__PURE__*/_jsx(Layout, {
64
- blockEditorSettings: settings
65
- })
66
- }));
61
+ setFreeformContentHandlerName("core/html");
62
+ root.render(
63
+ /* @__PURE__ */ jsx(StrictMode, { children: /* @__PURE__ */ jsx(Layout, { blockEditorSettings: settings }) })
64
+ );
67
65
  return root;
68
66
  }
69
-
70
- /**
71
- * Compatibility export under the old `initialize` name.
72
- */
73
- export const initialize = initializeEditor;
74
- export function reinitializeEditor() {
75
- deprecated('wp.editWidgets.reinitializeEditor', {
76
- since: '6.2',
77
- version: '6.3'
67
+ const initialize = initializeEditor;
68
+ function reinitializeEditor() {
69
+ deprecated("wp.editWidgets.reinitializeEditor", {
70
+ since: "6.2",
71
+ version: "6.3"
78
72
  });
79
73
  }
80
-
81
- /**
82
- * Function to register an individual block.
83
- *
84
- * @param {Object} block The block to be registered.
85
- */
86
- const registerBlock = block => {
74
+ const registerBlock = (block) => {
87
75
  if (!block) {
88
76
  return;
89
77
  }
90
- const {
91
- metadata,
92
- settings,
93
- name
94
- } = block;
78
+ const { metadata, settings, name } = block;
95
79
  if (metadata) {
96
- unstable__bootstrapServerSideBlockDefinitions({
97
- [name]: metadata
98
- });
80
+ unstable__bootstrapServerSideBlockDefinitions({ [name]: metadata });
99
81
  }
100
82
  registerBlockType(name, settings);
101
83
  };
102
- export { store } from './store';
103
- //# sourceMappingURL=index.js.map
84
+ import { store } from "./store";
85
+ export {
86
+ initialize,
87
+ initializeEditor,
88
+ reinitializeEditor,
89
+ store
90
+ };
91
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["registerBlockType","unstable__bootstrapServerSideBlockDefinitions","setFreeformContentHandlerName","store","blocksStore","dispatch","deprecated","StrictMode","createRoot","registerCoreBlocks","__experimentalGetCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","__experimentalFetchLinkSuggestions","fetchLinkSuggestions","registerLegacyWidgetBlock","registerLegacyWidgetVariations","registerWidgetGroupBlock","preferencesStore","widgetArea","Layout","ALLOW_REUSABLE_BLOCKS","ENABLE_EXPERIMENTAL_FSE_BLOCKS","jsx","_jsx","disabledBlocks","initializeEditor","id","settings","target","document","getElementById","root","coreBlocks","filter","block","includes","name","startsWith","setDefaults","fixedToolbar","welcomeGuide","showBlockBreadcrumbs","themeStyles","reapplyBlockTypeFilters","globalThis","IS_GUTENBERG_PLUGIN","enableFSEBlocks","registerBlock","search","searchOptions","render","children","blockEditorSettings","initialize","reinitializeEditor","since","version","metadata"],"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 { StrictMode, 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';\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(\n\t\t<StrictMode>\n\t\t\t<Layout blockEditorSettings={ settings } />\n\t\t</StrictMode>\n\t);\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":"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","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/index.js"],
4
+ "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 { StrictMode, 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';\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(\n\t\t<StrictMode>\n\t\t\t<Layout blockEditorSettings={ settings } />\n\t\t</StrictMode>\n\t);\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"],
5
+ "mappings": "AA8FG;AA3FH;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AAAA,OACH;AACP,SAAS,gBAAgB;AACzB,OAAO,gBAAgB;AACvB,SAAS,YAAY,kBAAkB;AACvC;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,sCAAsC,4BAA4B;AAC3E;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,SAAS,wBAAwB;AAK1C,OAAO;AACP,OAAO;AACP,YAAY,gBAAgB;AAC5B,OAAO,YAAY;AACnB;AAAA,EACC;AAAA,EACA;AAAA,OACM;AAEP,MAAM,iBAAiB;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAK,wBAAwB,CAAC,IAAI,CAAE,YAAa;AAClD;AAQO,SAAS,iBAAkB,IAAI,UAAW;AAChD,QAAM,SAAS,SAAS,eAAgB,EAAG;AAC3C,QAAM,OAAO,WAAY,MAAO;AAEhC,QAAM,aAAa,4BAA4B,EAAE,OAAQ,CAAE,UAAW;AACrE,WAAO,EACN,eAAe,SAAU,MAAM,IAAK,KACpC,MAAM,KAAK,WAAY,WAAY,KACnC,MAAM,KAAK,WAAY,YAAa,KACpC,MAAM,KAAK,WAAY,WAAY,KACnC,MAAM,KAAK,WAAY,iBAAkB;AAAA,EAE3C,CAAE;AAEF,WAAU,gBAAiB,EAAE,YAAa,qBAAqB;AAAA,IAC9D,cAAc;AAAA,IACd,cAAc;AAAA,IACd,sBAAsB;AAAA,IACtB,aAAa;AAAA,EACd,CAAE;AAEF,WAAU,WAAY,EAAE,wBAAwB;AAChD,qBAAoB,UAAW;AAC/B,4BAA0B;AAC1B,MAAK,WAAW,qBAAsB;AACrC,iDAA8C;AAAA,MAC7C,iBAAiB;AAAA,IAClB,CAAE;AAAA,EACH;AACA,iCAAgC,QAAS;AACzC,gBAAe,UAAW;AAC1B,2BAAyB;AAEzB,WAAS,qCAAqC,CAAE,QAAQ,kBACvD,qBAAsB,QAAQ,eAAe,QAAS;AAMvD,gCAA+B,WAAY;AAE3C,OAAK;AAAA,IACJ,oBAAC,cACA,8BAAC,UAAO,qBAAsB,UAAW,GAC1C;AAAA,EACD;AAEA,SAAO;AACR;AAKO,MAAM,aAAa;AAEnB,SAAS,qBAAqB;AACpC,aAAY,qCAAqC;AAAA,IAChD,OAAO;AAAA,IACP,SAAS;AAAA,EACV,CAAE;AACH;AAOA,MAAM,gBAAgB,CAAE,UAAW;AAClC,MAAK,CAAE,OAAQ;AACd;AAAA,EACD;AACA,QAAM,EAAE,UAAU,UAAU,KAAK,IAAI;AACrC,MAAK,UAAW;AACf,kDAA+C,EAAE,CAAE,IAAK,GAAG,SAAS,CAAE;AAAA,EACvE;AACA,oBAAmB,MAAM,QAAS;AACnC;AAEA,SAAS,aAAa;",
6
+ "names": []
7
+ }
@@ -1,9 +1,10 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';
5
- export const {
1
+ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from "@wordpress/private-apis";
2
+ const { lock, unlock } = __dangerousOptInToUnstableAPIsOnlyForCoreModules(
3
+ "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
4
+ "@wordpress/edit-widgets"
5
+ );
6
+ export {
6
7
  lock,
7
8
  unlock
8
- } = __dangerousOptInToUnstableAPIsOnlyForCoreModules('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/edit-widgets');
9
- //# sourceMappingURL=lock-unlock.js.map
9
+ };
10
+ //# sourceMappingURL=lock-unlock.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["__dangerousOptInToUnstableAPIsOnlyForCoreModules","lock","unlock"],"sources":["@wordpress/edit-widgets/src/lock-unlock.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.',\n\t\t'@wordpress/edit-widgets'\n\t);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gDAAgD,QAAQ,yBAAyB;AAE1F,OAAO,MAAM;EAAEC,IAAI;EAAEC;AAAO,CAAC,GAC5BF,gDAAgD,CAC/C,+HAA+H,EAC/H,yBACD,CAAC","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/lock-unlock.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.',\n\t\t'@wordpress/edit-widgets'\n\t);\n"],
5
+ "mappings": "AAGA,SAAS,wDAAwD;AAE1D,MAAM,EAAE,MAAM,OAAO,IAC3B;AAAA,EACC;AAAA,EACA;AACD;",
6
+ "names": []
7
+ }