@wordpress/block-editor 15.9.1-next.8b30e05b0.0 → 15.10.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 (196) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +8 -0
  3. package/build/components/block-alignment-matrix-control/index.js +1 -8
  4. package/build/components/block-alignment-matrix-control/index.js.map +2 -2
  5. package/build/components/block-bindings/attribute-control.js +172 -0
  6. package/build/components/block-bindings/attribute-control.js.map +7 -0
  7. package/build/components/block-bindings/index.js +47 -0
  8. package/build/components/block-bindings/index.js.map +7 -0
  9. package/build/components/block-bindings/source-fields-list.js +135 -0
  10. package/build/components/block-bindings/source-fields-list.js.map +7 -0
  11. package/build/components/block-bindings/use-block-bindings-utils.js +66 -0
  12. package/build/components/block-bindings/use-block-bindings-utils.js.map +7 -0
  13. package/build/components/block-edit/edit.js +1 -3
  14. package/build/components/block-edit/edit.js.map +2 -2
  15. package/build/components/block-inspector/edit-contents.js +93 -14
  16. package/build/components/block-inspector/edit-contents.js.map +3 -3
  17. package/build/components/block-inspector/index.js +44 -28
  18. package/build/components/block-inspector/index.js.map +2 -2
  19. package/build/components/block-settings-menu-controls/edit-section-menu-item.js +39 -9
  20. package/build/components/block-settings-menu-controls/edit-section-menu-item.js.map +3 -3
  21. package/build/components/block-styles/preview-panel.js +3 -5
  22. package/build/components/block-styles/preview-panel.js.map +2 -2
  23. package/build/components/block-styles/use-styles-for-block.js +2 -2
  24. package/build/components/block-styles/use-styles-for-block.js.map +2 -2
  25. package/build/components/block-toolbar/index.js +1 -8
  26. package/build/components/block-toolbar/index.js.map +3 -3
  27. package/build/components/content-only-controls/index.js +2 -25
  28. package/build/components/content-only-controls/index.js.map +2 -2
  29. package/build/components/content-only-controls/link/index.js +3 -3
  30. package/build/components/content-only-controls/link/index.js.map +2 -2
  31. package/build/components/content-only-controls/media/index.js +3 -3
  32. package/build/components/content-only-controls/media/index.js.map +2 -2
  33. package/build/components/content-only-controls/rich-text/index.js +3 -2
  34. package/build/components/content-only-controls/rich-text/index.js.map +2 -2
  35. package/build/components/dimensions-tool/width-height-tool.js +4 -16
  36. package/build/components/dimensions-tool/width-height-tool.js.map +3 -3
  37. package/build/components/grid/grid-item-resizer.js +9 -5
  38. package/build/components/grid/grid-item-resizer.js.map +2 -2
  39. package/build/components/image-editor/cropper.js +3 -34
  40. package/build/components/image-editor/cropper.js.map +3 -3
  41. package/build/components/image-editor/index.js +9 -3
  42. package/build/components/image-editor/index.js.map +2 -2
  43. package/build/components/image-editor/use-transform-image.js +62 -32
  44. package/build/components/image-editor/use-transform-image.js.map +2 -2
  45. package/build/components/image-editor/zoom-dropdown.js +2 -2
  46. package/build/components/image-editor/zoom-dropdown.js.map +2 -2
  47. package/build/components/index.js +7 -3
  48. package/build/components/index.js.map +2 -2
  49. package/build/components/inserter/hooks/use-insertion-point.js +5 -2
  50. package/build/components/inserter/hooks/use-insertion-point.js.map +2 -2
  51. package/build/components/inserter-draggable-blocks/index.js +8 -4
  52. package/build/components/inserter-draggable-blocks/index.js.map +2 -2
  53. package/build/components/inspector-controls-tabs/content-tab.js +3 -2
  54. package/build/components/inspector-controls-tabs/content-tab.js.map +2 -2
  55. package/build/components/link-control/index.js +1 -1
  56. package/build/components/link-control/index.js.map +2 -2
  57. package/build/components/link-control/search-input.js +2 -2
  58. package/build/components/link-control/search-input.js.map +2 -2
  59. package/build/hooks/block-bindings.js +22 -260
  60. package/build/hooks/block-bindings.js.map +3 -3
  61. package/build/layouts/grid.js +23 -28
  62. package/build/layouts/grid.js.map +2 -2
  63. package/build/private-apis.js +1 -0
  64. package/build/private-apis.js.map +2 -2
  65. package/build/store/private-keys.js +3 -0
  66. package/build/store/private-keys.js.map +2 -2
  67. package/build/store/private-selectors.js +2 -1
  68. package/build/store/private-selectors.js.map +2 -2
  69. package/build/store/reducer.js +3 -2
  70. package/build/store/reducer.js.map +2 -2
  71. package/build/utils/block-bindings.js +2 -44
  72. package/build/utils/block-bindings.js.map +3 -3
  73. package/build/utils/index.js +2 -5
  74. package/build/utils/index.js.map +2 -2
  75. package/build-module/components/block-alignment-matrix-control/index.js +1 -8
  76. package/build-module/components/block-alignment-matrix-control/index.js.map +2 -2
  77. package/build-module/components/block-bindings/attribute-control.js +150 -0
  78. package/build-module/components/block-bindings/attribute-control.js.map +7 -0
  79. package/build-module/components/block-bindings/index.js +10 -0
  80. package/build-module/components/block-bindings/index.js.map +7 -0
  81. package/build-module/components/block-bindings/source-fields-list.js +104 -0
  82. package/build-module/components/block-bindings/source-fields-list.js.map +7 -0
  83. package/build-module/components/block-bindings/use-block-bindings-utils.js +45 -0
  84. package/build-module/components/block-bindings/use-block-bindings-utils.js.map +7 -0
  85. package/build-module/components/block-edit/edit.js +1 -3
  86. package/build-module/components/block-edit/edit.js.map +2 -2
  87. package/build-module/components/block-inspector/edit-contents.js +93 -14
  88. package/build-module/components/block-inspector/edit-contents.js.map +2 -2
  89. package/build-module/components/block-inspector/index.js +44 -28
  90. package/build-module/components/block-inspector/index.js.map +2 -2
  91. package/build-module/components/block-settings-menu-controls/edit-section-menu-item.js +39 -9
  92. package/build-module/components/block-settings-menu-controls/edit-section-menu-item.js.map +2 -2
  93. package/build-module/components/block-styles/preview-panel.js +3 -5
  94. package/build-module/components/block-styles/preview-panel.js.map +2 -2
  95. package/build-module/components/block-styles/use-styles-for-block.js +2 -2
  96. package/build-module/components/block-styles/use-styles-for-block.js.map +2 -2
  97. package/build-module/components/block-toolbar/index.js +1 -8
  98. package/build-module/components/block-toolbar/index.js.map +2 -2
  99. package/build-module/components/content-only-controls/index.js +2 -25
  100. package/build-module/components/content-only-controls/index.js.map +2 -2
  101. package/build-module/components/content-only-controls/link/index.js +3 -3
  102. package/build-module/components/content-only-controls/link/index.js.map +2 -2
  103. package/build-module/components/content-only-controls/media/index.js +3 -3
  104. package/build-module/components/content-only-controls/media/index.js.map +2 -2
  105. package/build-module/components/content-only-controls/rich-text/index.js +3 -2
  106. package/build-module/components/content-only-controls/rich-text/index.js.map +2 -2
  107. package/build-module/components/dimensions-tool/width-height-tool.js +4 -6
  108. package/build-module/components/dimensions-tool/width-height-tool.js.map +2 -2
  109. package/build-module/components/grid/grid-item-resizer.js +9 -5
  110. package/build-module/components/grid/grid-item-resizer.js.map +2 -2
  111. package/build-module/components/image-editor/cropper.js +3 -34
  112. package/build-module/components/image-editor/cropper.js.map +2 -2
  113. package/build-module/components/image-editor/index.js +9 -3
  114. package/build-module/components/image-editor/index.js.map +2 -2
  115. package/build-module/components/image-editor/use-transform-image.js +63 -33
  116. package/build-module/components/image-editor/use-transform-image.js.map +2 -2
  117. package/build-module/components/image-editor/zoom-dropdown.js +2 -2
  118. package/build-module/components/image-editor/zoom-dropdown.js.map +2 -2
  119. package/build-module/components/index.js +74 -68
  120. package/build-module/components/index.js.map +2 -2
  121. package/build-module/components/inserter/hooks/use-insertion-point.js +5 -2
  122. package/build-module/components/inserter/hooks/use-insertion-point.js.map +2 -2
  123. package/build-module/components/inserter-draggable-blocks/index.js +8 -4
  124. package/build-module/components/inserter-draggable-blocks/index.js.map +2 -2
  125. package/build-module/components/inspector-controls-tabs/content-tab.js +3 -2
  126. package/build-module/components/inspector-controls-tabs/content-tab.js.map +2 -2
  127. package/build-module/components/link-control/index.js +1 -1
  128. package/build-module/components/link-control/index.js.map +2 -2
  129. package/build-module/components/link-control/search-input.js +2 -2
  130. package/build-module/components/link-control/search-input.js.map +2 -2
  131. package/build-module/hooks/block-bindings.js +27 -270
  132. package/build-module/hooks/block-bindings.js.map +2 -2
  133. package/build-module/layouts/grid.js +23 -28
  134. package/build-module/layouts/grid.js.map +2 -2
  135. package/build-module/private-apis.js +3 -1
  136. package/build-module/private-apis.js.map +2 -2
  137. package/build-module/store/private-keys.js +2 -0
  138. package/build-module/store/private-keys.js.map +2 -2
  139. package/build-module/store/private-selectors.js +4 -2
  140. package/build-module/store/private-selectors.js.map +2 -2
  141. package/build-module/store/reducer.js +4 -3
  142. package/build-module/store/reducer.js.map +2 -2
  143. package/build-module/utils/block-bindings.js +1 -42
  144. package/build-module/utils/block-bindings.js.map +2 -2
  145. package/build-module/utils/index.js +1 -3
  146. package/build-module/utils/index.js.map +2 -2
  147. package/build-style/style-rtl.css +6 -6
  148. package/build-style/style.css +6 -6
  149. package/package.json +39 -40
  150. package/src/components/block-alignment-matrix-control/index.js +1 -5
  151. package/src/components/block-bindings/attribute-control.js +174 -0
  152. package/src/components/block-bindings/index.js +6 -0
  153. package/src/components/block-bindings/source-fields-list.js +130 -0
  154. package/src/components/block-bindings/use-block-bindings-utils.js +156 -0
  155. package/src/components/block-edit/edit.js +1 -3
  156. package/src/components/block-inspector/edit-contents.js +108 -18
  157. package/src/components/block-inspector/index.js +53 -30
  158. package/src/components/block-settings-menu-controls/edit-section-menu-item.js +50 -6
  159. package/src/components/block-styles/preview-panel.js +3 -5
  160. package/src/components/block-styles/use-styles-for-block.js +2 -2
  161. package/src/components/block-toolbar/index.js +1 -6
  162. package/src/components/block-toolbar/style.scss +6 -6
  163. package/src/components/content-only-controls/index.js +2 -27
  164. package/src/components/content-only-controls/link/index.js +3 -3
  165. package/src/components/content-only-controls/media/index.js +3 -3
  166. package/src/components/content-only-controls/rich-text/index.js +3 -2
  167. package/src/components/dimensions-tool/width-height-tool.js +6 -13
  168. package/src/components/grid/grid-item-resizer.js +18 -5
  169. package/src/components/image-editor/cropper.js +3 -32
  170. package/src/components/image-editor/index.js +34 -29
  171. package/src/components/image-editor/use-transform-image.js +80 -34
  172. package/src/components/image-editor/zoom-dropdown.js +2 -2
  173. package/src/components/index.js +5 -1
  174. package/src/components/inserter/hooks/use-insertion-point.js +3 -0
  175. package/src/components/inserter/style.scss +1 -1
  176. package/src/components/inserter-draggable-blocks/index.js +19 -8
  177. package/src/components/inspector-controls-tabs/content-tab.js +6 -2
  178. package/src/components/link-control/index.js +1 -1
  179. package/src/components/link-control/search-input.js +8 -2
  180. package/src/components/link-control/test/index.js +146 -7
  181. package/src/hooks/block-bindings.js +27 -347
  182. package/src/layouts/grid.js +40 -72
  183. package/src/layouts/test/grid.js +14 -0
  184. package/src/private-apis.js +2 -0
  185. package/src/store/private-keys.js +1 -0
  186. package/src/store/private-selectors.js +8 -1
  187. package/src/store/reducer.js +10 -3
  188. package/src/utils/block-bindings.js +0 -157
  189. package/src/utils/index.js +0 -1
  190. package/tsconfig.json +1 -0
  191. package/build/components/block-toolbar/block-name-context.js +0 -30
  192. package/build/components/block-toolbar/block-name-context.js.map +0 -7
  193. package/build-module/components/block-toolbar/block-name-context.js +0 -9
  194. package/build-module/components/block-toolbar/block-name-context.js.map +0 -7
  195. package/src/components/block-toolbar/block-name-context.js +0 -9
  196. /package/src/{utils → components/block-bindings}/test/use-block-bindings-utils.js +0 -0
@@ -62,10 +62,10 @@ var grid_default = {
62
62
  layoutBlockSupport = {}
63
63
  }) {
64
64
  const { allowSizingOnChildren = false } = layoutBlockSupport;
65
- const showColumnsControl = window.__experimentalEnableGridInteractivity || !!layout?.columnCount;
66
- const showMinWidthControl = window.__experimentalEnableGridInteractivity || !layout?.columnCount;
65
+ const showColumnsControl = true;
66
+ const showMinWidthControl = !layout?.isManualPlacement || window.__experimentalEnableGridInteractivity;
67
67
  return /* @__PURE__ */ jsxs(Fragment, { children: [
68
- /* @__PURE__ */ jsx(
68
+ window.__experimentalEnableGridInteractivity && /* @__PURE__ */ jsx(
69
69
  GridLayoutTypeControl,
70
70
  {
71
71
  layout,
@@ -193,7 +193,7 @@ function GridLayoutMinimumWidthControl({ layout, onChange }) {
193
193
  });
194
194
  };
195
195
  return /* @__PURE__ */ jsxs("fieldset", { className: "block-editor-hooks__grid-layout-minimum-width-control", children: [
196
- /* @__PURE__ */ jsx(BaseControl.VisualLabel, { as: "legend", children: __("Minimum column width") }),
196
+ /* @__PURE__ */ jsx(BaseControl.VisualLabel, { as: "legend", children: __("Min. column width") }),
197
197
  /* @__PURE__ */ jsxs(Flex, { gap: 4, children: [
198
198
  /* @__PURE__ */ jsx(FlexItem, { isBlock: true, children: /* @__PURE__ */ jsx(
199
199
  UnitControl,
@@ -227,7 +227,10 @@ function GridLayoutMinimumWidthControl({ layout, onChange }) {
227
227
  hideLabelFromVision: true
228
228
  }
229
229
  ) })
230
- ] })
230
+ ] }),
231
+ /* @__PURE__ */ jsx("p", { className: "components-base-control__help", children: __(
232
+ "Columns will wrap to fewer per row when they can no longer maintain the minimum width."
233
+ ) })
231
234
  ] });
232
235
  }
233
236
  function GridLayoutColumnsAndRowsControl({
@@ -235,42 +238,34 @@ function GridLayoutColumnsAndRowsControl({
235
238
  onChange,
236
239
  allowSizingOnChildren
237
240
  }) {
238
- const defaultColumnCount = window.__experimentalEnableGridInteractivity ? void 0 : 3;
241
+ const defaultColumnCount = void 0;
239
242
  const {
240
243
  columnCount = defaultColumnCount,
241
244
  rowCount,
242
245
  isManualPlacement
243
246
  } = layout;
244
247
  return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("fieldset", { className: "block-editor-hooks__grid-layout-columns-and-rows-controls", children: [
245
- (!window.__experimentalEnableGridInteractivity || !isManualPlacement) && /* @__PURE__ */ jsx(BaseControl.VisualLabel, { as: "legend", children: __("Columns") }),
248
+ !isManualPlacement && /* @__PURE__ */ jsx(BaseControl.VisualLabel, { as: "legend", children: __("Max. columns") }),
246
249
  /* @__PURE__ */ jsxs(Flex, { gap: 4, children: [
247
250
  /* @__PURE__ */ jsx(FlexItem, { isBlock: true, children: /* @__PURE__ */ jsx(
248
251
  NumberControl,
249
252
  {
250
253
  size: "__unstable-large",
251
254
  onChange: (value) => {
252
- if (window.__experimentalEnableGridInteractivity) {
253
- const defaultNewColumnCount = isManualPlacement ? 1 : void 0;
254
- const newColumnCount = value === "" || value === "0" ? defaultNewColumnCount : parseInt(value, 10);
255
- onChange({
256
- ...layout,
257
- columnCount: newColumnCount
258
- });
259
- } else {
260
- const newColumnCount = value === "" || value === "0" ? 1 : parseInt(value, 10);
261
- onChange({
262
- ...layout,
263
- columnCount: newColumnCount
264
- });
265
- }
255
+ const defaultNewColumnCount = isManualPlacement ? 1 : void 0;
256
+ const newColumnCount = value === "" || value === "0" ? defaultNewColumnCount : parseInt(value, 10);
257
+ onChange({
258
+ ...layout,
259
+ columnCount: newColumnCount
260
+ });
266
261
  },
267
262
  value: columnCount,
268
263
  min: 1,
269
264
  label: __("Columns"),
270
- hideLabelFromVision: !window.__experimentalEnableGridInteractivity || !isManualPlacement
265
+ hideLabelFromVision: !isManualPlacement
271
266
  }
272
267
  ) }),
273
- /* @__PURE__ */ jsx(FlexItem, { isBlock: true, children: window.__experimentalEnableGridInteractivity && allowSizingOnChildren && isManualPlacement ? /* @__PURE__ */ jsx(
268
+ /* @__PURE__ */ jsx(FlexItem, { isBlock: true, children: allowSizingOnChildren && isManualPlacement ? /* @__PURE__ */ jsx(
274
269
  NumberControl,
275
270
  {
276
271
  size: "__unstable-large",
@@ -314,7 +309,7 @@ function GridLayoutTypeControl({ layout, onChange }) {
314
309
  const [tempMinimumColumnWidth, setTempMinimumColumnWidth] = useState(
315
310
  minimumColumnWidth || "12rem"
316
311
  );
317
- const gridPlacement = isManualPlacement || !!columnCount && !window.__experimentalEnableGridInteractivity ? "manual" : "auto";
312
+ const gridPlacement = isManualPlacement ? "manual" : "auto";
318
313
  const onChangeType = (value) => {
319
314
  if (value === "manual") {
320
315
  setTempMinimumColumnWidth(minimumColumnWidth || "12rem");
@@ -324,9 +319,9 @@ function GridLayoutTypeControl({ layout, onChange }) {
324
319
  }
325
320
  onChange({
326
321
  ...layout,
327
- columnCount: value === "manual" ? tempColumnCount : null,
328
- rowCount: value === "manual" && window.__experimentalEnableGridInteractivity ? tempRowCount : void 0,
329
- isManualPlacement: value === "manual" && window.__experimentalEnableGridInteractivity ? true : void 0,
322
+ columnCount: value === "manual" ? tempColumnCount : tempColumnCount,
323
+ rowCount: value === "manual" ? tempRowCount : void 0,
324
+ isManualPlacement: value === "manual" ? true : void 0,
330
325
  minimumColumnWidth: value === "auto" ? tempMinimumColumnWidth : null
331
326
  });
332
327
  };
@@ -344,7 +339,7 @@ function GridLayoutTypeControl({ layout, onChange }) {
344
339
  value: gridPlacement,
345
340
  onChange: onChangeType,
346
341
  isBlock: true,
347
- help: window.__experimentalEnableGridInteractivity ? helpText : void 0,
342
+ help: helpText,
348
343
  children: [
349
344
  /* @__PURE__ */ jsx(
350
345
  ToggleGroupControlOption,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/layouts/grid.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\nimport {\n\tBaseControl,\n\tFlex,\n\tFlexItem,\n\tRangeControl,\n\t__experimentalNumberControl as NumberControl,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { appendSelectors, getBlockGapCSS } from './utils';\nimport { getGapCSSValue } from '../hooks/gap';\nimport { shouldSkipSerialization } from '../hooks/utils';\nimport { LAYOUT_DEFINITIONS } from './definitions';\n\nconst RANGE_CONTROL_MAX_VALUES = {\n\tpx: 600,\n\t'%': 100,\n\tvw: 100,\n\tvh: 100,\n\tem: 38,\n\trem: 38,\n\tsvw: 100,\n\tlvw: 100,\n\tdvw: 100,\n\tsvh: 100,\n\tlvh: 100,\n\tdvh: 100,\n\tvi: 100,\n\tsvi: 100,\n\tlvi: 100,\n\tdvi: 100,\n\tvb: 100,\n\tsvb: 100,\n\tlvb: 100,\n\tdvb: 100,\n\tvmin: 100,\n\tsvmin: 100,\n\tlvmin: 100,\n\tdvmin: 100,\n\tvmax: 100,\n\tsvmax: 100,\n\tlvmax: 100,\n\tdvmax: 100,\n};\n\nconst units = [\n\t{ value: 'px', label: 'px', default: 0 },\n\t{ value: 'rem', label: 'rem', default: 0 },\n\t{ value: 'em', label: 'em', default: 0 },\n];\n\nexport default {\n\tname: 'grid',\n\tlabel: __( 'Grid' ),\n\tinspectorControls: function GridLayoutInspectorControls( {\n\t\tlayout = {},\n\t\tonChange,\n\t\tlayoutBlockSupport = {},\n\t} ) {\n\t\tconst { allowSizingOnChildren = false } = layoutBlockSupport;\n\n\t\t// In the experiment we want to also show column control in Auto mode, and\n\t\t// the minimum width control in Manual mode.\n\t\tconst showColumnsControl =\n\t\t\twindow.__experimentalEnableGridInteractivity ||\n\t\t\t!! layout?.columnCount;\n\t\tconst showMinWidthControl =\n\t\t\twindow.__experimentalEnableGridInteractivity ||\n\t\t\t! layout?.columnCount;\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<GridLayoutTypeControl\n\t\t\t\t\tlayout={ layout }\n\t\t\t\t\tonChange={ onChange }\n\t\t\t\t/>\n\t\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t\t{ showColumnsControl && (\n\t\t\t\t\t\t<GridLayoutColumnsAndRowsControl\n\t\t\t\t\t\t\tlayout={ layout }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\tallowSizingOnChildren={ allowSizingOnChildren }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ showMinWidthControl && (\n\t\t\t\t\t\t<GridLayoutMinimumWidthControl\n\t\t\t\t\t\t\tlayout={ layout }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</VStack>\n\t\t\t</>\n\t\t);\n\t},\n\ttoolBarControls: function GridLayoutToolbarControls() {\n\t\treturn null;\n\t},\n\tgetLayoutStyle: function getLayoutStyle( {\n\t\tselector,\n\t\tlayout,\n\t\tstyle,\n\t\tblockName,\n\t\thasBlockGapSupport,\n\t\tlayoutDefinitions = LAYOUT_DEFINITIONS,\n\t} ) {\n\t\tconst {\n\t\t\tminimumColumnWidth = null,\n\t\t\tcolumnCount = null,\n\t\t\trowCount = null,\n\t\t} = layout;\n\n\t\t// Check that the grid layout attributes are of the correct type, so that we don't accidentally\n\t\t// write code that stores a string attribute instead of a number.\n\t\tif ( process.env.NODE_ENV === 'development' ) {\n\t\t\tif (\n\t\t\t\tminimumColumnWidth &&\n\t\t\t\ttypeof minimumColumnWidth !== 'string'\n\t\t\t) {\n\t\t\t\tthrow new Error( 'minimumColumnWidth must be a string' );\n\t\t\t}\n\t\t\tif ( columnCount && typeof columnCount !== 'number' ) {\n\t\t\t\tthrow new Error( 'columnCount must be a number' );\n\t\t\t}\n\t\t\tif ( rowCount && typeof rowCount !== 'number' ) {\n\t\t\t\tthrow new Error( 'rowCount must be a number' );\n\t\t\t}\n\t\t}\n\n\t\t// If a block's block.json skips serialization for spacing or spacing.blockGap,\n\t\t// don't apply the user-defined value to the styles.\n\t\tconst blockGapValue =\n\t\t\tstyle?.spacing?.blockGap &&\n\t\t\t! shouldSkipSerialization( blockName, 'spacing', 'blockGap' )\n\t\t\t\t? getGapCSSValue( style?.spacing?.blockGap, '0.5em' )\n\t\t\t\t: undefined;\n\n\t\tlet output = '';\n\t\tconst rules = [];\n\n\t\tif ( minimumColumnWidth && columnCount > 0 ) {\n\t\t\tconst maxValue = `max(${ minimumColumnWidth }, ( 100% - (${\n\t\t\t\tblockGapValue || '1.2rem'\n\t\t\t}*${ columnCount - 1 }) ) / ${ columnCount })`;\n\t\t\trules.push(\n\t\t\t\t`grid-template-columns: repeat(auto-fill, minmax(${ maxValue }, 1fr))`,\n\t\t\t\t`container-type: inline-size`\n\t\t\t);\n\t\t\tif ( rowCount ) {\n\t\t\t\trules.push(\n\t\t\t\t\t`grid-template-rows: repeat(${ rowCount }, minmax(1rem, auto))`\n\t\t\t\t);\n\t\t\t}\n\t\t} else if ( columnCount ) {\n\t\t\trules.push(\n\t\t\t\t`grid-template-columns: repeat(${ columnCount }, minmax(0, 1fr))`\n\t\t\t);\n\t\t\tif ( rowCount ) {\n\t\t\t\trules.push(\n\t\t\t\t\t`grid-template-rows: repeat(${ rowCount }, minmax(1rem, auto))`\n\t\t\t\t);\n\t\t\t}\n\t\t} else {\n\t\t\trules.push(\n\t\t\t\t`grid-template-columns: repeat(auto-fill, minmax(min(${\n\t\t\t\t\tminimumColumnWidth || '12rem'\n\t\t\t\t}, 100%), 1fr))`,\n\t\t\t\t'container-type: inline-size'\n\t\t\t);\n\t\t}\n\n\t\tif ( rules.length ) {\n\t\t\toutput = `${ appendSelectors( selector ) } { ${ rules.join(\n\t\t\t\t'; '\n\t\t\t) }; }`;\n\t\t}\n\n\t\t// Output blockGap styles based on rules contained in layout definitions in theme.json.\n\t\tif ( hasBlockGapSupport && blockGapValue ) {\n\t\t\toutput += getBlockGapCSS(\n\t\t\t\tselector,\n\t\t\t\tlayoutDefinitions,\n\t\t\t\t'grid',\n\t\t\t\tblockGapValue\n\t\t\t);\n\t\t}\n\t\treturn output;\n\t},\n\tgetOrientation() {\n\t\treturn 'horizontal';\n\t},\n\tgetAlignments() {\n\t\treturn [];\n\t},\n};\n\n// Enables setting minimum width of grid items.\nfunction GridLayoutMinimumWidthControl( { layout, onChange } ) {\n\tconst { minimumColumnWidth, columnCount, isManualPlacement } = layout;\n\tconst defaultValue = isManualPlacement || columnCount ? null : '12rem';\n\tconst value = minimumColumnWidth || defaultValue;\n\tconst [ quantity, unit = 'rem' ] =\n\t\tparseQuantityAndUnitFromRawValue( value );\n\n\tconst handleSliderChange = ( next ) => {\n\t\tonChange( {\n\t\t\t...layout,\n\t\t\tminimumColumnWidth: [ next, unit ].join( '' ),\n\t\t} );\n\t};\n\n\t// Mostly copied from HeightControl.\n\tconst handleUnitChange = ( newUnit ) => {\n\t\t// Attempt to smooth over differences between currentUnit and newUnit.\n\t\t// This should slightly improve the experience of switching between unit types.\n\t\tlet newValue;\n\n\t\tif ( [ 'em', 'rem' ].includes( newUnit ) && unit === 'px' ) {\n\t\t\t// Convert pixel value to an approximate of the new unit, assuming a root size of 16px.\n\t\t\tnewValue = ( quantity / 16 ).toFixed( 2 ) + newUnit;\n\t\t} else if ( [ 'em', 'rem' ].includes( unit ) && newUnit === 'px' ) {\n\t\t\t// Convert to pixel value assuming a root size of 16px.\n\t\t\tnewValue = Math.round( quantity * 16 ) + newUnit;\n\t\t}\n\n\t\tonChange( {\n\t\t\t...layout,\n\t\t\tminimumColumnWidth: newValue,\n\t\t} );\n\t};\n\n\treturn (\n\t\t<fieldset className=\"block-editor-hooks__grid-layout-minimum-width-control\">\n\t\t\t<BaseControl.VisualLabel as=\"legend\">\n\t\t\t\t{ __( 'Minimum column width' ) }\n\t\t\t</BaseControl.VisualLabel>\n\t\t\t<Flex gap={ 4 }>\n\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t<UnitControl\n\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t...layout,\n\t\t\t\t\t\t\t\tminimumColumnWidth:\n\t\t\t\t\t\t\t\t\tnewValue === '' ? undefined : newValue,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tonUnitChange={ handleUnitChange }\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\tlabel={ __( 'Minimum column width' ) }\n\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t/>\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tonChange={ handleSliderChange }\n\t\t\t\t\t\tvalue={ quantity || 0 }\n\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\tmax={ RANGE_CONTROL_MAX_VALUES[ unit ] || 600 }\n\t\t\t\t\t\twithInputField={ false }\n\t\t\t\t\t\tlabel={ __( 'Minimum column width' ) }\n\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t/>\n\t\t\t\t</FlexItem>\n\t\t\t</Flex>\n\t\t</fieldset>\n\t);\n}\n\n// Enables setting number of grid columns\nfunction GridLayoutColumnsAndRowsControl( {\n\tlayout,\n\tonChange,\n\tallowSizingOnChildren,\n} ) {\n\t// If the grid interactivity experiment is enabled, allow unsetting the column count.\n\tconst defaultColumnCount = window.__experimentalEnableGridInteractivity\n\t\t? undefined\n\t\t: 3;\n\tconst {\n\t\tcolumnCount = defaultColumnCount,\n\t\trowCount,\n\t\tisManualPlacement,\n\t} = layout;\n\n\treturn (\n\t\t<>\n\t\t\t<fieldset className=\"block-editor-hooks__grid-layout-columns-and-rows-controls\">\n\t\t\t\t{ ( ! window.__experimentalEnableGridInteractivity ||\n\t\t\t\t\t! isManualPlacement ) && (\n\t\t\t\t\t<BaseControl.VisualLabel as=\"legend\">\n\t\t\t\t\t\t{ __( 'Columns' ) }\n\t\t\t\t\t</BaseControl.VisualLabel>\n\t\t\t\t) }\n\t\t\t\t<Flex gap={ 4 }>\n\t\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t\t<NumberControl\n\t\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\twindow.__experimentalEnableGridInteractivity\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t// Allow unsetting the column count when in auto mode.\n\t\t\t\t\t\t\t\t\tconst defaultNewColumnCount =\n\t\t\t\t\t\t\t\t\t\tisManualPlacement ? 1 : undefined;\n\t\t\t\t\t\t\t\t\tconst newColumnCount =\n\t\t\t\t\t\t\t\t\t\tvalue === '' || value === '0'\n\t\t\t\t\t\t\t\t\t\t\t? defaultNewColumnCount\n\t\t\t\t\t\t\t\t\t\t\t: parseInt( value, 10 );\n\t\t\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t\t\t...layout,\n\t\t\t\t\t\t\t\t\t\tcolumnCount: newColumnCount,\n\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// Don't allow unsetting the column count.\n\t\t\t\t\t\t\t\t\tconst newColumnCount =\n\t\t\t\t\t\t\t\t\t\tvalue === '' || value === '0'\n\t\t\t\t\t\t\t\t\t\t\t? 1\n\t\t\t\t\t\t\t\t\t\t\t: parseInt( value, 10 );\n\t\t\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t\t\t...layout,\n\t\t\t\t\t\t\t\t\t\tcolumnCount: newColumnCount,\n\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tvalue={ columnCount }\n\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\t\t\thideLabelFromVision={\n\t\t\t\t\t\t\t\t! window.__experimentalEnableGridInteractivity ||\n\t\t\t\t\t\t\t\t! isManualPlacement\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\n\t\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t\t{ window.__experimentalEnableGridInteractivity &&\n\t\t\t\t\t\tallowSizingOnChildren &&\n\t\t\t\t\t\tisManualPlacement ? (\n\t\t\t\t\t\t\t<NumberControl\n\t\t\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\t\t// Don't allow unsetting the row count.\n\t\t\t\t\t\t\t\t\tconst newRowCount =\n\t\t\t\t\t\t\t\t\t\tvalue === '' || value === '0'\n\t\t\t\t\t\t\t\t\t\t\t? 1\n\t\t\t\t\t\t\t\t\t\t\t: parseInt( value, 10 );\n\t\t\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t\t\t...layout,\n\t\t\t\t\t\t\t\t\t\trowCount: newRowCount,\n\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tvalue={ rowCount }\n\t\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\t\tlabel={ __( 'Rows' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tvalue={ columnCount ?? 1 }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t\t\t...layout,\n\t\t\t\t\t\t\t\t\t\tcolumnCount:\n\t\t\t\t\t\t\t\t\t\t\tvalue === '' || value === '0'\n\t\t\t\t\t\t\t\t\t\t\t\t? 1\n\t\t\t\t\t\t\t\t\t\t\t\t: value,\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\t\tmax={ 16 }\n\t\t\t\t\t\t\t\twithInputField={ false }\n\t\t\t\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</FlexItem>\n\t\t\t\t</Flex>\n\t\t\t</fieldset>\n\t\t</>\n\t);\n}\n\n// Enables switching between grid types\nfunction GridLayoutTypeControl( { layout, onChange } ) {\n\tconst { columnCount, rowCount, minimumColumnWidth, isManualPlacement } =\n\t\tlayout;\n\n\t/**\n\t * When switching, temporarily save any custom values set on the\n\t * previous type so we can switch back without loss.\n\t */\n\tconst [ tempColumnCount, setTempColumnCount ] = useState(\n\t\tcolumnCount || 3\n\t);\n\tconst [ tempRowCount, setTempRowCount ] = useState( rowCount );\n\tconst [ tempMinimumColumnWidth, setTempMinimumColumnWidth ] = useState(\n\t\tminimumColumnWidth || '12rem'\n\t);\n\n\tconst gridPlacement =\n\t\tisManualPlacement ||\n\t\t( !! columnCount && ! window.__experimentalEnableGridInteractivity )\n\t\t\t? 'manual'\n\t\t\t: 'auto';\n\n\tconst onChangeType = ( value ) => {\n\t\tif ( value === 'manual' ) {\n\t\t\tsetTempMinimumColumnWidth( minimumColumnWidth || '12rem' );\n\t\t} else {\n\t\t\tsetTempColumnCount( columnCount || 3 );\n\t\t\tsetTempRowCount( rowCount );\n\t\t}\n\t\tonChange( {\n\t\t\t...layout,\n\t\t\tcolumnCount: value === 'manual' ? tempColumnCount : null,\n\t\t\trowCount:\n\t\t\t\tvalue === 'manual' &&\n\t\t\t\twindow.__experimentalEnableGridInteractivity\n\t\t\t\t\t? tempRowCount\n\t\t\t\t\t: undefined,\n\t\t\tisManualPlacement:\n\t\t\t\tvalue === 'manual' &&\n\t\t\t\twindow.__experimentalEnableGridInteractivity\n\t\t\t\t\t? true\n\t\t\t\t\t: undefined,\n\t\t\tminimumColumnWidth:\n\t\t\t\tvalue === 'auto' ? tempMinimumColumnWidth : null,\n\t\t} );\n\t};\n\n\tconst helpText =\n\t\tgridPlacement === 'manual'\n\t\t\t? __(\n\t\t\t\t\t'Grid items can be manually placed in any position on the grid.'\n\t\t\t )\n\t\t\t: __(\n\t\t\t\t\t'Grid items are placed automatically depending on their order.'\n\t\t\t );\n\n\treturn (\n\t\t<ToggleGroupControl\n\t\t\t__next40pxDefaultSize\n\t\t\t__nextHasNoMarginBottom\n\t\t\tlabel={ __( 'Grid item position' ) }\n\t\t\tvalue={ gridPlacement }\n\t\t\tonChange={ onChangeType }\n\t\t\tisBlock\n\t\t\thelp={\n\t\t\t\twindow.__experimentalEnableGridInteractivity\n\t\t\t\t\t? helpText\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t>\n\t\t\t<ToggleGroupControlOption\n\t\t\t\tkey=\"auto\"\n\t\t\t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,IACA;AAAA,EACA;AAEJ,SACC;AAAA,IAAC;AAAA;AAAA,MACA,uBAAqB;AAAA,MACrB,yBAAuB;AAAA,MACvB,OAAQ,GAAI,oBAAqB;AAAA,MACjC,OAAQ;AAAA,MACR,UAAW;AAAA,MACX,SAAO;AAAA,MACP,MACC,OAAO,wCACJ,WACA;AAAA,MAGJ;AAAA;AAAA,UAAC;AAAA;AAAA,YAEA,OAAM;AAAA,YACN,OAAQ,GAAI,MAAO;AAAA;AAAA,UAFf;AAAA,QAGL;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YAEA,OAAM;AAAA,YACN,OAAQ,GAAI,QAAS;AAAA;AAAA,UAFjB;AAAA,QAGL;AAAA;AAAA;AAAA,EACD;AAEF;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\nimport {\n\tBaseControl,\n\tFlex,\n\tFlexItem,\n\tRangeControl,\n\t__experimentalNumberControl as NumberControl,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { appendSelectors, getBlockGapCSS } from './utils';\nimport { getGapCSSValue } from '../hooks/gap';\nimport { shouldSkipSerialization } from '../hooks/utils';\nimport { LAYOUT_DEFINITIONS } from './definitions';\n\nconst RANGE_CONTROL_MAX_VALUES = {\n\tpx: 600,\n\t'%': 100,\n\tvw: 100,\n\tvh: 100,\n\tem: 38,\n\trem: 38,\n\tsvw: 100,\n\tlvw: 100,\n\tdvw: 100,\n\tsvh: 100,\n\tlvh: 100,\n\tdvh: 100,\n\tvi: 100,\n\tsvi: 100,\n\tlvi: 100,\n\tdvi: 100,\n\tvb: 100,\n\tsvb: 100,\n\tlvb: 100,\n\tdvb: 100,\n\tvmin: 100,\n\tsvmin: 100,\n\tlvmin: 100,\n\tdvmin: 100,\n\tvmax: 100,\n\tsvmax: 100,\n\tlvmax: 100,\n\tdvmax: 100,\n};\n\nconst units = [\n\t{ value: 'px', label: 'px', default: 0 },\n\t{ value: 'rem', label: 'rem', default: 0 },\n\t{ value: 'em', label: 'em', default: 0 },\n];\n\nexport default {\n\tname: 'grid',\n\tlabel: __( 'Grid' ),\n\tinspectorControls: function GridLayoutInspectorControls( {\n\t\tlayout = {},\n\t\tonChange,\n\t\tlayoutBlockSupport = {},\n\t} ) {\n\t\tconst { allowSizingOnChildren = false } = layoutBlockSupport;\n\n\t\t// Always show both column and minimum width controls in Auto mode.\n\t\t// Manual mode (with isManualPlacement) is only available behind the experiment flag.\n\t\tconst showColumnsControl = true;\n\t\tconst showMinWidthControl =\n\t\t\t! layout?.isManualPlacement ||\n\t\t\twindow.__experimentalEnableGridInteractivity;\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ window.__experimentalEnableGridInteractivity && (\n\t\t\t\t\t<GridLayoutTypeControl\n\t\t\t\t\t\tlayout={ layout }\n\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t\t{ showColumnsControl && (\n\t\t\t\t\t\t<GridLayoutColumnsAndRowsControl\n\t\t\t\t\t\t\tlayout={ layout }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\tallowSizingOnChildren={ allowSizingOnChildren }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ showMinWidthControl && (\n\t\t\t\t\t\t<GridLayoutMinimumWidthControl\n\t\t\t\t\t\t\tlayout={ layout }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</VStack>\n\t\t\t</>\n\t\t);\n\t},\n\ttoolBarControls: function GridLayoutToolbarControls() {\n\t\treturn null;\n\t},\n\tgetLayoutStyle: function getLayoutStyle( {\n\t\tselector,\n\t\tlayout,\n\t\tstyle,\n\t\tblockName,\n\t\thasBlockGapSupport,\n\t\tlayoutDefinitions = LAYOUT_DEFINITIONS,\n\t} ) {\n\t\tconst {\n\t\t\tminimumColumnWidth = null,\n\t\t\tcolumnCount = null,\n\t\t\trowCount = null,\n\t\t} = layout;\n\n\t\t// Check that the grid layout attributes are of the correct type, so that we don't accidentally\n\t\t// write code that stores a string attribute instead of a number.\n\t\tif ( process.env.NODE_ENV === 'development' ) {\n\t\t\tif (\n\t\t\t\tminimumColumnWidth &&\n\t\t\t\ttypeof minimumColumnWidth !== 'string'\n\t\t\t) {\n\t\t\t\tthrow new Error( 'minimumColumnWidth must be a string' );\n\t\t\t}\n\t\t\tif ( columnCount && typeof columnCount !== 'number' ) {\n\t\t\t\tthrow new Error( 'columnCount must be a number' );\n\t\t\t}\n\t\t\tif ( rowCount && typeof rowCount !== 'number' ) {\n\t\t\t\tthrow new Error( 'rowCount must be a number' );\n\t\t\t}\n\t\t}\n\n\t\t// If a block's block.json skips serialization for spacing or spacing.blockGap,\n\t\t// don't apply the user-defined value to the styles.\n\t\tconst blockGapValue =\n\t\t\tstyle?.spacing?.blockGap &&\n\t\t\t! shouldSkipSerialization( blockName, 'spacing', 'blockGap' )\n\t\t\t\t? getGapCSSValue( style?.spacing?.blockGap, '0.5em' )\n\t\t\t\t: undefined;\n\n\t\tlet output = '';\n\t\tconst rules = [];\n\n\t\tif ( minimumColumnWidth && columnCount > 0 ) {\n\t\t\tconst maxValue = `max(${ minimumColumnWidth }, ( 100% - (${\n\t\t\t\tblockGapValue || '1.2rem'\n\t\t\t}*${ columnCount - 1 }) ) / ${ columnCount })`;\n\t\t\trules.push(\n\t\t\t\t`grid-template-columns: repeat(auto-fill, minmax(${ maxValue }, 1fr))`,\n\t\t\t\t`container-type: inline-size`\n\t\t\t);\n\t\t\tif ( rowCount ) {\n\t\t\t\trules.push(\n\t\t\t\t\t`grid-template-rows: repeat(${ rowCount }, minmax(1rem, auto))`\n\t\t\t\t);\n\t\t\t}\n\t\t} else if ( columnCount ) {\n\t\t\trules.push(\n\t\t\t\t`grid-template-columns: repeat(${ columnCount }, minmax(0, 1fr))`\n\t\t\t);\n\t\t\tif ( rowCount ) {\n\t\t\t\trules.push(\n\t\t\t\t\t`grid-template-rows: repeat(${ rowCount }, minmax(1rem, auto))`\n\t\t\t\t);\n\t\t\t}\n\t\t} else {\n\t\t\trules.push(\n\t\t\t\t`grid-template-columns: repeat(auto-fill, minmax(min(${\n\t\t\t\t\tminimumColumnWidth || '12rem'\n\t\t\t\t}, 100%), 1fr))`,\n\t\t\t\t'container-type: inline-size'\n\t\t\t);\n\t\t}\n\n\t\tif ( rules.length ) {\n\t\t\toutput = `${ appendSelectors( selector ) } { ${ rules.join(\n\t\t\t\t'; '\n\t\t\t) }; }`;\n\t\t}\n\n\t\t// Output blockGap styles based on rules contained in layout definitions in theme.json.\n\t\tif ( hasBlockGapSupport && blockGapValue ) {\n\t\t\toutput += getBlockGapCSS(\n\t\t\t\tselector,\n\t\t\t\tlayoutDefinitions,\n\t\t\t\t'grid',\n\t\t\t\tblockGapValue\n\t\t\t);\n\t\t}\n\t\treturn output;\n\t},\n\tgetOrientation() {\n\t\treturn 'horizontal';\n\t},\n\tgetAlignments() {\n\t\treturn [];\n\t},\n};\n\n// Enables setting minimum width of grid items.\nfunction GridLayoutMinimumWidthControl( { layout, onChange } ) {\n\tconst { minimumColumnWidth, columnCount, isManualPlacement } = layout;\n\tconst defaultValue = isManualPlacement || columnCount ? null : '12rem';\n\tconst value = minimumColumnWidth || defaultValue;\n\tconst [ quantity, unit = 'rem' ] =\n\t\tparseQuantityAndUnitFromRawValue( value );\n\n\tconst handleSliderChange = ( next ) => {\n\t\tonChange( {\n\t\t\t...layout,\n\t\t\tminimumColumnWidth: [ next, unit ].join( '' ),\n\t\t} );\n\t};\n\n\t// Mostly copied from HeightControl.\n\tconst handleUnitChange = ( newUnit ) => {\n\t\t// Attempt to smooth over differences between currentUnit and newUnit.\n\t\t// This should slightly improve the experience of switching between unit types.\n\t\tlet newValue;\n\n\t\tif ( [ 'em', 'rem' ].includes( newUnit ) && unit === 'px' ) {\n\t\t\t// Convert pixel value to an approximate of the new unit, assuming a root size of 16px.\n\t\t\tnewValue = ( quantity / 16 ).toFixed( 2 ) + newUnit;\n\t\t} else if ( [ 'em', 'rem' ].includes( unit ) && newUnit === 'px' ) {\n\t\t\t// Convert to pixel value assuming a root size of 16px.\n\t\t\tnewValue = Math.round( quantity * 16 ) + newUnit;\n\t\t}\n\n\t\tonChange( {\n\t\t\t...layout,\n\t\t\tminimumColumnWidth: newValue,\n\t\t} );\n\t};\n\n\treturn (\n\t\t<fieldset className=\"block-editor-hooks__grid-layout-minimum-width-control\">\n\t\t\t<BaseControl.VisualLabel as=\"legend\">\n\t\t\t\t{ __( 'Min. column width' ) }\n\t\t\t</BaseControl.VisualLabel>\n\t\t\t<Flex gap={ 4 }>\n\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t<UnitControl\n\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t...layout,\n\t\t\t\t\t\t\t\tminimumColumnWidth:\n\t\t\t\t\t\t\t\t\tnewValue === '' ? undefined : newValue,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tonUnitChange={ handleUnitChange }\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\tlabel={ __( 'Minimum column width' ) }\n\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t/>\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tonChange={ handleSliderChange }\n\t\t\t\t\t\tvalue={ quantity || 0 }\n\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\tmax={ RANGE_CONTROL_MAX_VALUES[ unit ] || 600 }\n\t\t\t\t\t\twithInputField={ false }\n\t\t\t\t\t\tlabel={ __( 'Minimum column width' ) }\n\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t/>\n\t\t\t\t</FlexItem>\n\t\t\t</Flex>\n\t\t\t<p className=\"components-base-control__help\">\n\t\t\t\t{ __(\n\t\t\t\t\t'Columns will wrap to fewer per row when they can no longer maintain the minimum width.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t</fieldset>\n\t);\n}\n\n// Enables setting number of grid columns\nfunction GridLayoutColumnsAndRowsControl( {\n\tlayout,\n\tonChange,\n\tallowSizingOnChildren,\n} ) {\n\t// Allow unsetting the column count in Auto mode.\n\tconst defaultColumnCount = undefined;\n\tconst {\n\t\tcolumnCount = defaultColumnCount,\n\t\trowCount,\n\t\tisManualPlacement,\n\t} = layout;\n\n\treturn (\n\t\t<>\n\t\t\t<fieldset className=\"block-editor-hooks__grid-layout-columns-and-rows-controls\">\n\t\t\t\t{ ! isManualPlacement && (\n\t\t\t\t\t<BaseControl.VisualLabel as=\"legend\">\n\t\t\t\t\t\t{ __( 'Max. columns' ) }\n\t\t\t\t\t</BaseControl.VisualLabel>\n\t\t\t\t) }\n\t\t\t\t<Flex gap={ 4 }>\n\t\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t\t<NumberControl\n\t\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\t// Allow unsetting the column count when in auto mode.\n\t\t\t\t\t\t\t\tconst defaultNewColumnCount = isManualPlacement\n\t\t\t\t\t\t\t\t\t? 1\n\t\t\t\t\t\t\t\t\t: undefined;\n\t\t\t\t\t\t\t\tconst newColumnCount =\n\t\t\t\t\t\t\t\t\tvalue === '' || value === '0'\n\t\t\t\t\t\t\t\t\t\t? defaultNewColumnCount\n\t\t\t\t\t\t\t\t\t\t: parseInt( value, 10 );\n\t\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t\t...layout,\n\t\t\t\t\t\t\t\t\tcolumnCount: newColumnCount,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tvalue={ columnCount }\n\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\t\t\thideLabelFromVision={ ! isManualPlacement }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\n\t\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t\t{ allowSizingOnChildren && isManualPlacement ? (\n\t\t\t\t\t\t\t<NumberControl\n\t\t\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\t\t// Don't allow unsetting the row count.\n\t\t\t\t\t\t\t\t\tconst newRowCount =\n\t\t\t\t\t\t\t\t\t\tvalue === '' || value === '0'\n\t\t\t\t\t\t\t\t\t\t\t? 1\n\t\t\t\t\t\t\t\t\t\t\t: parseInt( value, 10 );\n\t\t\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t\t\t...layout,\n\t\t\t\t\t\t\t\t\t\trowCount: newRowCount,\n\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tvalue={ rowCount }\n\t\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\t\tlabel={ __( 'Rows' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tvalue={ columnCount ?? 1 }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t\t\t...layout,\n\t\t\t\t\t\t\t\t\t\tcolumnCount:\n\t\t\t\t\t\t\t\t\t\t\tvalue === '' || value === '0'\n\t\t\t\t\t\t\t\t\t\t\t\t? 1\n\t\t\t\t\t\t\t\t\t\t\t\t: value,\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\t\tmax={ 16 }\n\t\t\t\t\t\t\t\twithInputField={ false }\n\t\t\t\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</FlexItem>\n\t\t\t\t</Flex>\n\t\t\t</fieldset>\n\t\t</>\n\t);\n}\n\n// Enables switching between grid types\nfunction GridLayoutTypeControl( { layout, onChange } ) {\n\tconst { columnCount, rowCount, minimumColumnWidth, isManualPlacement } =\n\t\tlayout;\n\n\t/**\n\t * When switching, temporarily save any custom values set on the\n\t * previous type so we can switch back without loss.\n\t */\n\tconst [ tempColumnCount, setTempColumnCount ] = useState(\n\t\tcolumnCount || 3\n\t);\n\tconst [ tempRowCount, setTempRowCount ] = useState( rowCount );\n\tconst [ tempMinimumColumnWidth, setTempMinimumColumnWidth ] = useState(\n\t\tminimumColumnWidth || '12rem'\n\t);\n\n\tconst gridPlacement = isManualPlacement ? 'manual' : 'auto';\n\n\tconst onChangeType = ( value ) => {\n\t\tif ( value === 'manual' ) {\n\t\t\tsetTempMinimumColumnWidth( minimumColumnWidth || '12rem' );\n\t\t} else {\n\t\t\tsetTempColumnCount( columnCount || 3 );\n\t\t\tsetTempRowCount( rowCount );\n\t\t}\n\t\tonChange( {\n\t\t\t...layout,\n\t\t\tcolumnCount: value === 'manual' ? tempColumnCount : tempColumnCount,\n\t\t\trowCount: value === 'manual' ? tempRowCount : undefined,\n\t\t\tisManualPlacement: value === 'manual' ? true : undefined,\n\t\t\tminimumColumnWidth:\n\t\t\t\tvalue === 'auto' ? tempMinimumColumnWidth : null,\n\t\t} );\n\t};\n\n\tconst helpText =\n\t\tgridPlacement === 'manual'\n\t\t\t? __(\n\t\t\t\t\t'Grid items can be manually placed in any position on the grid.'\n\t\t\t )\n\t\t\t: __(\n\t\t\t\t\t'Grid items are placed automatically depending on their order.'\n\t\t\t );\n\n\treturn (\n\t\t<ToggleGroupControl\n\t\t\t__next40pxDefaultSize\n\t\t\t__nextHasNoMarginBottom\n\t\t\tlabel={ __( 'Grid item position' ) }\n\t\t\tvalue={ gridPlacement }\n\t\t\tonChange={ onChangeType }\n\t\t\tisBlock\n\t\t\thelp={ helpText }\n\t\t>\n\t\t\t<ToggleGroupControlOption\n\t\t\t\tkey=\"auto\"\n\t\t\t\tvalue=\"auto\"\n\t\t\t\tlabel={ __( 'Auto' ) }\n\t\t\t/>\n\t\t\t<ToggleGroupControlOption\n\t\t\t\tkey=\"manual\"\n\t\t\t\tvalue=\"manual\"\n\t\t\t\tlabel={ __( 'Manual' ) }\n\t\t\t/>\n\t\t</ToggleGroupControl>\n\t);\n}\n"],
5
+ "mappings": ";AAGA,SAAS,UAAU;AAEnB;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,+BAA+B;AAAA,EAC/B,oCAAoC;AAAA,EACpC,0CAA0C;AAAA,EAC1C,6BAA6B;AAAA,EAC7B,kDAAkD;AAAA,EAClD,wBAAwB;AAAA,OAClB;AACP,SAAS,gBAAgB;AAKzB,SAAS,iBAAiB,sBAAsB;AAChD,SAAS,sBAAsB;AAC/B,SAAS,+BAA+B;AACxC,SAAS,0BAA0B;AAwDhC,mBAEE,KAKD,YAPD;AAtDH,IAAM,2BAA2B;AAAA,EAChC,IAAI;AAAA,EACJ,KAAK;AAAA,EACL,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,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AACrC,sBAAiB,QAAS;AAAA,IAC3B;AACA,aAAU;AAAA,MACT,GAAG;AAAA,MACH,aAAa,UAAU,WAAW,kBAAkB;AAAA,MACpD,UAAU,UAAU,WAAW,eAAe;AAAA,MAC9C,mBAAmB,UAAU,WAAW,OAAO;AAAA,MAC/C,oBACC,UAAU,SAAS,yBAAyB;AAAA,IAC9C,CAAE;AAAA,EACH;AAEA,QAAM,WACL,kBAAkB,WACf;AAAA,IACA;AAAA,EACA,IACA;AAAA,IACA;AAAA,EACA;AAEJ,SACC;AAAA,IAAC;AAAA;AAAA,MACA,uBAAqB;AAAA,MACrB,yBAAuB;AAAA,MACvB,OAAQ,GAAI,oBAAqB;AAAA,MACjC,OAAQ;AAAA,MACR,UAAW;AAAA,MACX,SAAO;AAAA,MACP,MAAO;AAAA,MAEP;AAAA;AAAA,UAAC;AAAA;AAAA,YAEA,OAAM;AAAA,YACN,OAAQ,GAAI,MAAO;AAAA;AAAA,UAFf;AAAA,QAGL;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YAEA,OAAM;AAAA,YACN,OAAQ,GAAI,QAAS;AAAA;AAAA,UAFjB;AAAA,QAGL;AAAA;AAAA;AAAA,EACD;AAEF;",
6
6
  "names": []
7
7
  }
@@ -39,7 +39,8 @@ import {
39
39
  sectionRootClientIdKey,
40
40
  mediaEditKey,
41
41
  getMediaSelectKey,
42
- essentialFormatKey
42
+ essentialFormatKey,
43
+ isIsolatedEditorKey
43
44
  } from "./store/private-keys";
44
45
  import { requiresWrapperOnCopy } from "./components/writing-flow/utils";
45
46
  import { PrivateRichText } from "./components/rich-text/";
@@ -104,6 +105,7 @@ lock(privateApis, {
104
105
  mediaEditKey,
105
106
  getMediaSelectKey,
106
107
  essentialFormatKey,
108
+ isIsolatedEditorKey,
107
109
  useBlockElement,
108
110
  useBlockElementRef
109
111
  });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/private-apis.js"],
4
- "sourcesContent": ["/**\n * Internal dependencies\n */\nimport * as globalStyles from './components/global-styles';\nimport { ExperimentalBlockEditorProvider } from './components/provider';\nimport { lock } from './lock-unlock';\nimport { getRichTextValues } from './components/rich-text/get-rich-text-values';\nimport ResizableBoxPopover from './components/resizable-box-popover';\nimport { default as PrivateQuickInserter } from './components/inserter/quick-inserter';\nimport {\n\textractWords,\n\tgetNormalizedSearchTerms,\n\tnormalizeString,\n} from './components/inserter/search-items';\nimport { PrivateListView } from './components/list-view';\nimport { useHasBlockToolbar } from './components/block-toolbar/use-has-block-toolbar';\nimport { cleanEmptyObject } from './hooks/utils';\nimport BlockQuickNavigation from './components/block-quick-navigation';\nimport { LayoutStyle } from './components/block-list/layout';\nimport BlockManager from './components/block-manager';\nimport { BlockRemovalWarningModal } from './components/block-removal-warning-modal';\nimport {\n\tsetBackgroundStyleDefaults,\n\tuseLayoutClasses,\n\tuseLayoutStyles,\n\t__unstableBlockStyleVariationOverridesWithConfig,\n\tuseZoomOut,\n} from './hooks';\nimport DimensionsTool from './components/dimensions-tool';\nimport ResolutionTool from './components/resolution-tool';\nimport TextAlignmentControl from './components/text-alignment-control';\nimport { usesContextKey } from './components/rich-text/format-edit';\nimport { ExperimentalBlockCanvas } from './components/block-canvas';\nimport { getDuotoneFilter } from './components/duotone/utils';\nimport { useFlashEditableBlocks } from './components/use-flash-editable-blocks';\nimport {\n\tselectBlockPatternsKey,\n\treusableBlocksSelectKey,\n\tglobalStylesDataKey,\n\tglobalStylesLinksDataKey,\n\tsectionRootClientIdKey,\n\tmediaEditKey,\n\tgetMediaSelectKey,\n\tessentialFormatKey,\n} from './store/private-keys';\nimport { requiresWrapperOnCopy } from './components/writing-flow/utils';\nimport { PrivateRichText } from './components/rich-text/';\nimport { PrivateBlockPopover } from './components/block-popover';\nimport { PrivateInserterLibrary } from './components/inserter/library';\nimport { PrivatePublishDateTimePicker } from './components/publish-date-time-picker';\nimport useSpacingSizes from './components/spacing-sizes-control/hooks/use-spacing-sizes';\nimport useBlockDisplayTitle from './components/block-title/use-block-display-title';\nimport TabbedSidebar from './components/tabbed-sidebar';\nimport CommentIconSlotFill from './components/collab/block-comment-icon-slot';\nimport CommentIconToolbarSlotFill from './components/collab/block-comment-icon-toolbar-slot';\nimport HTMLElementControl from './components/html-element-control';\nimport {\n\tuseBlockElementRef,\n\tuseBlockElement,\n} from './components/block-list/use-block-props/use-block-refs';\n\n/**\n * Private @wordpress/block-editor APIs.\n */\nexport const privateApis = {};\nlock( privateApis, {\n\t...globalStyles,\n\tExperimentalBlockCanvas,\n\tExperimentalBlockEditorProvider,\n\tgetDuotoneFilter,\n\tgetRichTextValues,\n\tPrivateQuickInserter,\n\textractWords,\n\tgetNormalizedSearchTerms,\n\tnormalizeString,\n\tPrivateListView,\n\tResizableBoxPopover,\n\tuseHasBlockToolbar,\n\tcleanEmptyObject,\n\tBlockQuickNavigation,\n\tLayoutStyle,\n\tBlockManager,\n\tBlockRemovalWarningModal,\n\tuseLayoutClasses,\n\tuseLayoutStyles,\n\tDimensionsTool,\n\tResolutionTool,\n\tTabbedSidebar,\n\tTextAlignmentControl,\n\tusesContextKey,\n\tuseFlashEditableBlocks,\n\tHTMLElementControl,\n\tuseZoomOut,\n\tglobalStylesDataKey,\n\tglobalStylesLinksDataKey,\n\tselectBlockPatternsKey,\n\trequiresWrapperOnCopy,\n\tPrivateRichText,\n\tPrivateInserterLibrary,\n\treusableBlocksSelectKey,\n\tPrivateBlockPopover,\n\tPrivatePublishDateTimePicker,\n\tuseSpacingSizes,\n\tuseBlockDisplayTitle,\n\t__unstableBlockStyleVariationOverridesWithConfig,\n\tsetBackgroundStyleDefaults,\n\tsectionRootClientIdKey,\n\tCommentIconSlotFill,\n\tCommentIconToolbarSlotFill,\n\tmediaEditKey,\n\tgetMediaSelectKey,\n\tessentialFormatKey,\n\tuseBlockElement,\n\tuseBlockElementRef,\n} );\n"],
5
- "mappings": ";AAGA,YAAY,kBAAkB;AAC9B,SAAS,uCAAuC;AAChD,SAAS,YAAY;AACrB,S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EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,CAAE;",
4
+ "sourcesContent": ["/**\n * Internal dependencies\n */\nimport * as globalStyles from './components/global-styles';\nimport { ExperimentalBlockEditorProvider } from './components/provider';\nimport { lock } from './lock-unlock';\nimport { getRichTextValues } from './components/rich-text/get-rich-text-values';\nimport ResizableBoxPopover from './components/resizable-box-popover';\nimport { default as PrivateQuickInserter } from './components/inserter/quick-inserter';\nimport {\n\textractWords,\n\tgetNormalizedSearchTerms,\n\tnormalizeString,\n} from './components/inserter/search-items';\nimport { PrivateListView } from './components/list-view';\nimport { useHasBlockToolbar } from './components/block-toolbar/use-has-block-toolbar';\nimport { cleanEmptyObject } from './hooks/utils';\nimport BlockQuickNavigation from './components/block-quick-navigation';\nimport { LayoutStyle } from './components/block-list/layout';\nimport BlockManager from './components/block-manager';\nimport { BlockRemovalWarningModal } from './components/block-removal-warning-modal';\nimport {\n\tsetBackgroundStyleDefaults,\n\tuseLayoutClasses,\n\tuseLayoutStyles,\n\t__unstableBlockStyleVariationOverridesWithConfig,\n\tuseZoomOut,\n} from './hooks';\nimport DimensionsTool from './components/dimensions-tool';\nimport ResolutionTool from './components/resolution-tool';\nimport TextAlignmentControl from './components/text-alignment-control';\nimport { usesContextKey } from './components/rich-text/format-edit';\nimport { ExperimentalBlockCanvas } from './components/block-canvas';\nimport { getDuotoneFilter } from './components/duotone/utils';\nimport { useFlashEditableBlocks } from './components/use-flash-editable-blocks';\nimport {\n\tselectBlockPatternsKey,\n\treusableBlocksSelectKey,\n\tglobalStylesDataKey,\n\tglobalStylesLinksDataKey,\n\tsectionRootClientIdKey,\n\tmediaEditKey,\n\tgetMediaSelectKey,\n\tessentialFormatKey,\n\tisIsolatedEditorKey,\n} from './store/private-keys';\nimport { requiresWrapperOnCopy } from './components/writing-flow/utils';\nimport { PrivateRichText } from './components/rich-text/';\nimport { PrivateBlockPopover } from './components/block-popover';\nimport { PrivateInserterLibrary } from './components/inserter/library';\nimport { PrivatePublishDateTimePicker } from './components/publish-date-time-picker';\nimport useSpacingSizes from './components/spacing-sizes-control/hooks/use-spacing-sizes';\nimport useBlockDisplayTitle from './components/block-title/use-block-display-title';\nimport TabbedSidebar from './components/tabbed-sidebar';\nimport CommentIconSlotFill from './components/collab/block-comment-icon-slot';\nimport CommentIconToolbarSlotFill from './components/collab/block-comment-icon-toolbar-slot';\nimport HTMLElementControl from './components/html-element-control';\nimport {\n\tuseBlockElementRef,\n\tuseBlockElement,\n} from './components/block-list/use-block-props/use-block-refs';\n\n/**\n * Private @wordpress/block-editor APIs.\n */\nexport const privateApis = {};\nlock( privateApis, {\n\t...globalStyles,\n\tExperimentalBlockCanvas,\n\tExperimentalBlockEditorProvider,\n\tgetDuotoneFilter,\n\tgetRichTextValues,\n\tPrivateQuickInserter,\n\textractWords,\n\tgetNormalizedSearchTerms,\n\tnormalizeString,\n\tPrivateListView,\n\tResizableBoxPopover,\n\tuseHasBlockToolbar,\n\tcleanEmptyObject,\n\tBlockQuickNavigation,\n\tLayoutStyle,\n\tBlockManager,\n\tBlockRemovalWarningModal,\n\tuseLayoutClasses,\n\tuseLayoutStyles,\n\tDimensionsTool,\n\tResolutionTool,\n\tTabbedSidebar,\n\tTextAlignmentControl,\n\tusesContextKey,\n\tuseFlashEditableBlocks,\n\tHTMLElementControl,\n\tuseZoomOut,\n\tglobalStylesDataKey,\n\tglobalStylesLinksDataKey,\n\tselectBlockPatternsKey,\n\trequiresWrapperOnCopy,\n\tPrivateRichText,\n\tPrivateInserterLibrary,\n\treusableBlocksSelectKey,\n\tPrivateBlockPopover,\n\tPrivatePublishDateTimePicker,\n\tuseSpacingSizes,\n\tuseBlockDisplayTitle,\n\t__unstableBlockStyleVariationOverridesWithConfig,\n\tsetBackgroundStyleDefaults,\n\tsectionRootClientIdKey,\n\tCommentIconSlotFill,\n\tCommentIconToolbarSlotFill,\n\tmediaEditKey,\n\tgetMediaSelectKey,\n\tessentialFormatKey,\n\tisIsolatedEditorKey,\n\tuseBlockElement,\n\tuseBlockElementRef,\n} );\n"],
5
+ "mappings": ";AAGA,YAAY,kBAAkB;AAC9B,SAAS,uCAAuC;AAChD,SAAS,YAAY;AACrB,SAAS,yBAAyB;AAClC,OAAO,yBAAyB;AAChC,SAAS,WAAW,4BAA4B;AAChD;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,uBAAuB;AAChC,SAAS,0BAA0B;AACnC,SAAS,wBAAwB;AACjC,OAAO,0BAA0B;AACjC,SAAS,mBAAmB;AAC5B,OAAO,kBAAkB;AACzB,SAAS,gCAAgC;AACzC;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,OAAO,oBAAoB;AAC3B,OAAO,oBAAoB;AAC3B,OAAO,0BAA0B;AACjC,SAAS,sBAAsB;AAC/B,SAAS,+BAA+B;AACxC,SAAS,wBAAwB;AACjC,SAAS,8BAA8B;AACvC;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,6BAA6B;AACtC,SAAS,uBAAuB;AAChC,SAAS,2BAA2B;AACpC,SAAS,8BAA8B;AACvC,SAAS,oCAAoC;AAC7C,OAAO,qBAAqB;AAC5B,OAAO,0BAA0B;AACjC,OAAO,mBAAmB;AAC1B,OAAO,yBAAyB;AAChC,OAAO,gCAAgC;AACvC,OAAO,wBAAwB;AAC/B;AAAA,EACC;AAAA,EACA;AAAA,OACM;AAKA,IAAM,cAAc,CAAC;AAC5B,KAAM,aAAa;AAAA,EAClB,GAAG;AAAA,EACH;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,CAAE;",
6
6
  "names": []
7
7
  }
@@ -7,11 +7,13 @@ var sectionRootClientIdKey = Symbol("sectionRootClientIdKey");
7
7
  var mediaEditKey = Symbol("mediaEditKey");
8
8
  var getMediaSelectKey = Symbol("getMediaSelect");
9
9
  var essentialFormatKey = Symbol("essentialFormat");
10
+ var isIsolatedEditorKey = Symbol("isIsolatedEditor");
10
11
  export {
11
12
  essentialFormatKey,
12
13
  getMediaSelectKey,
13
14
  globalStylesDataKey,
14
15
  globalStylesLinksDataKey,
16
+ isIsolatedEditorKey,
15
17
  mediaEditKey,
16
18
  reusableBlocksSelectKey,
17
19
  sectionRootClientIdKey,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/store/private-keys.js"],
4
- "sourcesContent": ["export const globalStylesDataKey = Symbol( 'globalStylesDataKey' );\nexport const globalStylesLinksDataKey = Symbol( 'globalStylesLinks' );\nexport const selectBlockPatternsKey = Symbol( 'selectBlockPatternsKey' );\nexport const reusableBlocksSelectKey = Symbol( 'reusableBlocksSelect' );\nexport const sectionRootClientIdKey = Symbol( 'sectionRootClientIdKey' );\nexport const mediaEditKey = Symbol( 'mediaEditKey' );\nexport const getMediaSelectKey = Symbol( 'getMediaSelect' );\nexport const essentialFormatKey = Symbol( 'essentialFormat' );\n"],
5
- "mappings": ";AAAO,IAAM,sBAAsB,OAAQ,qBAAsB;AAC1D,IAAM,2BAA2B,OAAQ,mBAAoB;AAC7D,IAAM,yBAAyB,OAAQ,wBAAyB;AAChE,IAAM,0BAA0B,OAAQ,sBAAuB;AAC/D,IAAM,yBAAyB,OAAQ,wBAAyB;AAChE,IAAM,eAAe,OAAQ,cAAe;AAC5C,IAAM,oBAAoB,OAAQ,gBAAiB;AACnD,IAAM,qBAAqB,OAAQ,iBAAkB;",
4
+ "sourcesContent": ["export const globalStylesDataKey = Symbol( 'globalStylesDataKey' );\nexport const globalStylesLinksDataKey = Symbol( 'globalStylesLinks' );\nexport const selectBlockPatternsKey = Symbol( 'selectBlockPatternsKey' );\nexport const reusableBlocksSelectKey = Symbol( 'reusableBlocksSelect' );\nexport const sectionRootClientIdKey = Symbol( 'sectionRootClientIdKey' );\nexport const mediaEditKey = Symbol( 'mediaEditKey' );\nexport const getMediaSelectKey = Symbol( 'getMediaSelect' );\nexport const essentialFormatKey = Symbol( 'essentialFormat' );\nexport const isIsolatedEditorKey = Symbol( 'isIsolatedEditor' );\n"],
5
+ "mappings": ";AAAO,IAAM,sBAAsB,OAAQ,qBAAsB;AAC1D,IAAM,2BAA2B,OAAQ,mBAAoB;AAC7D,IAAM,yBAAyB,OAAQ,wBAAyB;AAChE,IAAM,0BAA0B,OAAQ,sBAAuB;AAC/D,IAAM,yBAAyB,OAAQ,wBAAyB;AAChE,IAAM,eAAe,OAAQ,cAAe;AAC5C,IAAM,oBAAoB,OAAQ,gBAAiB;AACnD,IAAM,qBAAqB,OAAQ,iBAAkB;AACrD,IAAM,sBAAsB,OAAQ,kBAAmB;",
6
6
  "names": []
7
7
  }
@@ -28,7 +28,8 @@ import { unlock } from "../lock-unlock";
28
28
  import {
29
29
  selectBlockPatternsKey,
30
30
  reusableBlocksSelectKey,
31
- sectionRootClientIdKey
31
+ sectionRootClientIdKey,
32
+ isIsolatedEditorKey
32
33
  } from "./private-keys";
33
34
  import { getBlockSettings } from "./get-block-settings";
34
35
  var { isContentBlock } = unlock(blocksPrivateApis);
@@ -275,7 +276,8 @@ function isSectionBlock(state, clientId) {
275
276
  }
276
277
  const attributes = getBlockAttributes(state, clientId);
277
278
  const isTemplatePart = blockName === "core/template-part";
278
- if ((attributes?.metadata?.patternName || isTemplatePart) && !!window?.__experimentalContentOnlyPatternInsertion) {
279
+ const isIsolatedEditor = state.settings?.[isIsolatedEditorKey];
280
+ if ((attributes?.metadata?.patternName || isTemplatePart) && !!window?.__experimentalContentOnlyPatternInsertion && !isIsolatedEditor) {
279
281
  return true;
280
282
  }
281
283
  const hasContentOnlyTempateLock = getTemplateLock(state, clientId) === "contentOnly";
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/store/private-selectors.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { createSelector, createRegistrySelector } from '@wordpress/data';\nimport {\n\thasBlockSupport,\n\tprivateApis as blocksPrivateApis,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport {\n\tgetBlockOrder,\n\tgetBlockParents,\n\tgetBlockEditingMode,\n\tgetSettings,\n\tcanInsertBlockType,\n\tgetBlockName,\n\tgetTemplateLock,\n\tgetClientIdsWithDescendants,\n\tgetBlockRootClientId,\n\tgetBlockAttributes,\n} from './selectors';\nimport {\n\tcheckAllowListRecursive,\n\tgetAllPatternsDependants,\n\tgetInsertBlockTypeDependants,\n\tgetGrammar,\n\tmapUserPattern,\n} from './utils';\nimport { STORE_NAME } from './constants';\nimport { unlock } from '../lock-unlock';\nimport {\n\tselectBlockPatternsKey,\n\treusableBlocksSelectKey,\n\tsectionRootClientIdKey,\n} from './private-keys';\n\nconst { isContentBlock } = unlock( blocksPrivateApis );\n\nexport { getBlockSettings } from './get-block-settings';\n\n/**\n * Returns true if the block interface is hidden, or false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the block toolbar is hidden.\n */\nexport function isBlockInterfaceHidden( state ) {\n\treturn state.isBlockInterfaceHidden;\n}\n\n/**\n * Gets the client ids of the last inserted blocks.\n *\n * @param {Object} state Global application state.\n * @return {Array|undefined} Client Ids of the last inserted block(s).\n */\nexport function getLastInsertedBlocksClientIds( state ) {\n\treturn state?.lastBlockInserted?.clientIds;\n}\n\nexport function getBlockWithoutAttributes( state, clientId ) {\n\treturn state.blocks.byClientId.get( clientId );\n}\n\n/**\n * Returns true if all of the descendants of a block with the given client ID\n * have an editing mode of 'disabled', or false otherwise.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId The block client ID.\n *\n * @return {boolean} Whether the block descendants are disabled.\n */\nexport const isBlockSubtreeDisabled = ( state, clientId ) => {\n\tconst isChildSubtreeDisabled = ( childClientId ) => {\n\t\treturn (\n\t\t\tgetBlockEditingMode( state, childClientId ) === 'disabled' &&\n\t\t\tgetBlockOrder( state, childClientId ).every(\n\t\t\t\tisChildSubtreeDisabled\n\t\t\t)\n\t\t);\n\t};\n\treturn getBlockOrder( state, clientId ).every( isChildSubtreeDisabled );\n};\n\n/**\n * Determines if a container (clientId) allows insertion of blocks, considering contentOnly mode restrictions.\n *\n * @param {Object} state Editor state.\n * @param {string} blockName The block name to insert.\n * @param {string} rootClientId The client ID of the root container block.\n * @return {boolean} Whether the container allows insertion.\n */\nexport function isContainerInsertableToInContentOnlyMode(\n\tstate,\n\tblockName,\n\trootClientId\n) {\n\tconst isBlockContentBlock = isContentBlock( blockName );\n\tconst rootBlockName = getBlockName( state, rootClientId );\n\tconst isContainerContentBlock = isContentBlock( rootBlockName );\n\tconst isRootBlockMain = getSectionRootClientId( state ) === rootClientId;\n\n\t// In contentOnly mode, containers shouldn't be inserted into unless:\n\t// 1. they are a section root;\n\t// 2. they are a content block and the block to be inserted is also content.\n\treturn (\n\t\tisRootBlockMain || ( isContainerContentBlock && isBlockContentBlock )\n\t);\n}\n\nfunction getEnabledClientIdsTreeUnmemoized( state, rootClientId ) {\n\tconst blockOrder = getBlockOrder( state, rootClientId );\n\tconst result = [];\n\n\tfor ( const clientId of blockOrder ) {\n\t\tconst innerBlocks = getEnabledClientIdsTreeUnmemoized(\n\t\t\tstate,\n\t\t\tclientId\n\t\t);\n\t\tif ( getBlockEditingMode( state, clientId ) !== 'disabled' ) {\n\t\t\tresult.push( { clientId, innerBlocks } );\n\t\t} else {\n\t\t\tresult.push( ...innerBlocks );\n\t\t}\n\t}\n\n\treturn result;\n}\n\n/**\n * Returns a tree of block objects with only clientID and innerBlocks set.\n * Blocks with a 'disabled' editing mode are not included.\n *\n * @param {Object} state Global application state.\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {Object[]} Tree of block objects with only clientID and innerBlocks set.\n */\nexport const getEnabledClientIdsTree = createRegistrySelector( () =>\n\tcreateSelector( getEnabledClientIdsTreeUnmemoized, ( state ) => [\n\t\tstate.blocks.order,\n\t\tstate.derivedBlockEditingModes,\n\t\tstate.blockEditingModes,\n\t] )\n);\n\n/**\n * Returns a list of a given block's ancestors, from top to bottom. Blocks with\n * a 'disabled' editing mode are excluded.\n *\n * @see getBlockParents\n *\n * @param {Object} state Global application state.\n * @param {string} clientId The block client ID.\n * @param {boolean} ascending Order results from bottom to top (true) or top\n * to bottom (false).\n */\nexport const getEnabledBlockParents = createSelector(\n\t( state, clientId, ascending = false ) => {\n\t\treturn getBlockParents( state, clientId, ascending ).filter(\n\t\t\t( parent ) => getBlockEditingMode( state, parent ) !== 'disabled'\n\t\t);\n\t},\n\t( state ) => [\n\t\tstate.blocks.parents,\n\t\tstate.blockEditingModes,\n\t\tstate.settings.templateLock,\n\t\tstate.blockListSettings,\n\t]\n);\n\n/**\n * Selector that returns the data needed to display a prompt when certain\n * blocks are removed, or `false` if no such prompt is requested.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object|false} Data for removal prompt display, if any.\n */\nexport function getRemovalPromptData( state ) {\n\treturn state.removalPromptData;\n}\n\n/**\n * Returns true if removal prompt exists, or false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether removal prompt exists.\n */\nexport function getBlockRemovalRules( state ) {\n\treturn state.blockRemovalRules;\n}\n\n/**\n * Returns the client ID of the block settings menu that is currently open.\n *\n * @param {Object} state Global application state.\n * @return {string|null} The client ID of the block menu that is currently open.\n */\nexport function getOpenedBlockSettingsMenu( state ) {\n\treturn state.openedBlockSettingsMenu;\n}\n\n/**\n * Returns all style overrides, intended to be merged with global editor styles.\n *\n * Overrides are sorted to match the order of the blocks they relate to. This\n * is useful to maintain correct CSS cascade order.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} An array of style ID to style override pairs.\n */\nexport const getStyleOverrides = createSelector(\n\t( state ) => {\n\t\tconst clientIds = getClientIdsWithDescendants( state );\n\t\tconst clientIdMap = clientIds.reduce( ( acc, clientId, index ) => {\n\t\t\tacc[ clientId ] = index;\n\t\t\treturn acc;\n\t\t}, {} );\n\n\t\treturn [ ...state.styleOverrides ].sort( ( overrideA, overrideB ) => {\n\t\t\t// Once the overrides Map is spread to an array, the first element\n\t\t\t// is the key, while the second is the override itself including\n\t\t\t// the clientId to sort by.\n\t\t\tconst [ , { clientId: clientIdA } ] = overrideA;\n\t\t\tconst [ , { clientId: clientIdB } ] = overrideB;\n\n\t\t\tconst aIndex = clientIdMap[ clientIdA ] ?? -1;\n\t\t\tconst bIndex = clientIdMap[ clientIdB ] ?? -1;\n\n\t\t\treturn aIndex - bIndex;\n\t\t} );\n\t},\n\t( state ) => [ state.blocks.order, state.styleOverrides ]\n);\n\n/** @typedef {import('./actions').InserterMediaCategory} InserterMediaCategory */\n/**\n * Returns the registered inserter media categories through the public API.\n *\n * @param {Object} state Editor state.\n *\n * @return {InserterMediaCategory[]} Inserter media categories.\n */\nexport function getRegisteredInserterMediaCategories( state ) {\n\treturn state.registeredInserterMediaCategories;\n}\n\n/**\n * Returns an array containing the allowed inserter media categories.\n * It merges the registered media categories from extenders with the\n * core ones. It also takes into account the allowed `mime_types`, which\n * can be altered by `upload_mimes` filter and restrict some of them.\n *\n * @param {Object} state Global application state.\n *\n * @return {InserterMediaCategory[]} Client IDs of descendants.\n */\nexport const getInserterMediaCategories = createSelector(\n\t( state ) => {\n\t\tconst {\n\t\t\tsettings: {\n\t\t\t\tinserterMediaCategories,\n\t\t\t\tallowedMimeTypes,\n\t\t\t\tenableOpenverseMediaCategory,\n\t\t\t},\n\t\t\tregisteredInserterMediaCategories,\n\t\t} = state;\n\t\t// The allowed `mime_types` can be altered by `upload_mimes` filter and restrict\n\t\t// some of them. In this case we shouldn't add the category to the available media\n\t\t// categories list in the inserter.\n\t\tif (\n\t\t\t( ! inserterMediaCategories &&\n\t\t\t\t! registeredInserterMediaCategories.length ) ||\n\t\t\t! allowedMimeTypes\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tconst coreInserterMediaCategoriesNames =\n\t\t\tinserterMediaCategories?.map( ( { name } ) => name ) || [];\n\t\tconst mergedCategories = [\n\t\t\t...( inserterMediaCategories || [] ),\n\t\t\t...( registeredInserterMediaCategories || [] ).filter(\n\t\t\t\t( { name } ) =>\n\t\t\t\t\t! coreInserterMediaCategoriesNames.includes( name )\n\t\t\t),\n\t\t];\n\t\treturn mergedCategories.filter( ( category ) => {\n\t\t\t// Check if Openverse category is enabled.\n\t\t\tif (\n\t\t\t\t! enableOpenverseMediaCategory &&\n\t\t\t\tcategory.name === 'openverse'\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn Object.values( allowedMimeTypes ).some( ( mimeType ) =>\n\t\t\t\tmimeType.startsWith( `${ category.mediaType }/` )\n\t\t\t);\n\t\t} );\n\t},\n\t( state ) => [\n\t\tstate.settings.inserterMediaCategories,\n\t\tstate.settings.allowedMimeTypes,\n\t\tstate.settings.enableOpenverseMediaCategory,\n\t\tstate.registeredInserterMediaCategories,\n\t]\n);\n\n/**\n * Returns whether there is at least one allowed pattern for inner blocks children.\n * This is useful for deferring the parsing of all patterns until needed.\n *\n * @param {Object} state Editor state.\n * @param {string} [rootClientId=null] Target root client ID.\n *\n * @return {boolean} If there is at least one allowed pattern.\n */\nexport const hasAllowedPatterns = createRegistrySelector( ( select ) =>\n\tcreateSelector(\n\t\t( state, rootClientId = null ) => {\n\t\t\tconst { getAllPatterns } = unlock( select( STORE_NAME ) );\n\t\t\tconst patterns = getAllPatterns();\n\t\t\tconst { allowedBlockTypes } = getSettings( state );\n\t\t\treturn patterns.some( ( pattern ) => {\n\t\t\t\tconst { inserter = true } = pattern;\n\t\t\t\tif ( ! inserter ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tconst grammar = getGrammar( pattern );\n\t\t\t\treturn (\n\t\t\t\t\tcheckAllowListRecursive( grammar, allowedBlockTypes ) &&\n\t\t\t\t\tgrammar.every( ( { name: blockName } ) =>\n\t\t\t\t\t\tcanInsertBlockType( state, blockName, rootClientId )\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} );\n\t\t},\n\t\t( state, rootClientId ) => [\n\t\t\t...getAllPatternsDependants( select )( state ),\n\t\t\t...getInsertBlockTypeDependants( select )( state, rootClientId ),\n\t\t]\n\t)\n);\n\nexport const getPatternBySlug = createRegistrySelector( ( select ) =>\n\tcreateSelector(\n\t\t( state, patternName ) => {\n\t\t\t// Only fetch reusable blocks if we know we need them. To do: maybe\n\t\t\t// use the entity record API to retrieve the block by slug.\n\t\t\tif ( patternName?.startsWith( 'core/block/' ) ) {\n\t\t\t\tconst _id = parseInt(\n\t\t\t\t\tpatternName.slice( 'core/block/'.length ),\n\t\t\t\t\t10\n\t\t\t\t);\n\t\t\t\tconst block = unlock( select( STORE_NAME ) )\n\t\t\t\t\t.getReusableBlocks()\n\t\t\t\t\t.find( ( { id } ) => id === _id );\n\n\t\t\t\tif ( ! block ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\treturn mapUserPattern(\n\t\t\t\t\tblock,\n\t\t\t\t\tstate.settings.__experimentalUserPatternCategories\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn [\n\t\t\t\t// This setting is left for back compat.\n\t\t\t\t...( state.settings.__experimentalBlockPatterns ?? [] ),\n\t\t\t\t...( state.settings[ selectBlockPatternsKey ]?.( select ) ??\n\t\t\t\t\t[] ),\n\t\t\t].find( ( { name } ) => name === patternName );\n\t\t},\n\t\t( state, patternName ) =>\n\t\t\tpatternName?.startsWith( 'core/block/' )\n\t\t\t\t? [\n\t\t\t\t\t\tunlock( select( STORE_NAME ) ).getReusableBlocks(),\n\t\t\t\t\t\tstate.settings.__experimentalReusableBlocks,\n\t\t\t\t ]\n\t\t\t\t: [\n\t\t\t\t\t\tstate.settings.__experimentalBlockPatterns,\n\t\t\t\t\t\tstate.settings[ selectBlockPatternsKey ]?.( select ),\n\t\t\t\t ]\n\t)\n);\n\nexport const getAllPatterns = createRegistrySelector( ( select ) =>\n\tcreateSelector( ( state ) => {\n\t\treturn [\n\t\t\t...unlock( select( STORE_NAME ) )\n\t\t\t\t.getReusableBlocks()\n\t\t\t\t.map( ( userPattern ) =>\n\t\t\t\t\tmapUserPattern(\n\t\t\t\t\t\tuserPattern,\n\t\t\t\t\t\tstate.settings.__experimentalUserPatternCategories\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t// This setting is left for back compat.\n\t\t\t...( state.settings.__experimentalBlockPatterns ?? [] ),\n\t\t\t...( state.settings[ selectBlockPatternsKey ]?.( select ) ?? [] ),\n\t\t].filter(\n\t\t\t( x, index, arr ) =>\n\t\t\t\tindex === arr.findIndex( ( y ) => x.name === y.name )\n\t\t);\n\t}, getAllPatternsDependants( select ) )\n);\n\nconst EMPTY_ARRAY = [];\n\nexport const getReusableBlocks = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst reusableBlocksSelect = state.settings[ reusableBlocksSelectKey ];\n\t\treturn (\n\t\t\t( reusableBlocksSelect\n\t\t\t\t? reusableBlocksSelect( select )\n\t\t\t\t: state.settings.__experimentalReusableBlocks ) ?? EMPTY_ARRAY\n\t\t);\n\t}\n);\n\n/**\n * Returns the element of the last element that had focus when focus left the editor canvas.\n *\n * @param {Object} state Block editor state.\n *\n * @return {Object} Element.\n */\nexport function getLastFocus( state ) {\n\treturn state.lastFocus;\n}\n\n/**\n * Returns true if the user is dragging anything, or false otherwise. It is possible for a\n * user to be dragging data from outside of the editor, so this selector is separate from\n * the `isDraggingBlocks` selector which only returns true if the user is dragging blocks.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether user is dragging.\n */\nexport function isDragging( state ) {\n\treturn state.isDragging;\n}\n\n/**\n * Retrieves the expanded block from the state.\n *\n * @param {Object} state Block editor state.\n *\n * @return {string|null} The client ID of the expanded block, if set.\n */\nexport function getExpandedBlock( state ) {\n\treturn state.expandedBlock;\n}\n\n/**\n * Retrieves the client ID of the ancestor block that is content locking the block\n * with the provided client ID.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId Client Id of the block.\n *\n * @return {?string} Client ID of the ancestor block that is content locking the block.\n */\nexport const getContentLockingParent = ( state, clientId ) => {\n\tlet current = clientId;\n\tlet result;\n\twhile ( ! result && ( current = state.blocks.parents.get( current ) ) ) {\n\t\tif ( getTemplateLock( state, current ) === 'contentOnly' ) {\n\t\t\tresult = current;\n\t\t}\n\t}\n\treturn result;\n};\n\n/**\n * Retrieves the client ID of the parent section block.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId Client Id of the block.\n *\n * @return {?string} Client ID of the ancestor block that is a contentOnly section.\n */\nexport const getParentSectionBlock = ( state, clientId ) => {\n\tlet current = clientId;\n\tlet result;\n\n\t// If sections are nested, return the top level section block.\n\t// Don't return early.\n\twhile ( ( current = state.blocks.parents.get( current ) ) ) {\n\t\tif ( isSectionBlock( state, current ) ) {\n\t\t\tresult = current;\n\t\t}\n\t}\n\treturn result;\n};\n\n/**\n * Returns whether the block is a contentOnly section.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId Client Id of the block.\n *\n * @return {boolean} Whether the block is a contentOnly section.\n */\nexport function isSectionBlock( state, clientId ) {\n\tif ( clientId === state.editedContentOnlySection ) {\n\t\treturn false;\n\t}\n\n\tconst blockName = getBlockName( state, clientId );\n\tif ( blockName === 'core/block' ) {\n\t\treturn true;\n\t}\n\n\tconst attributes = getBlockAttributes( state, clientId );\n\tconst isTemplatePart = blockName === 'core/template-part';\n\tif (\n\t\t( attributes?.metadata?.patternName || isTemplatePart ) &&\n\t\t!! window?.__experimentalContentOnlyPatternInsertion\n\t) {\n\t\treturn true;\n\t}\n\n\t// TemplateLock cascades to all inner parent blocks. Only the top-level\n\t// block that's contentOnly templateLocked is the true contentLocker,\n\t// all the others are mere imitators.\n\tconst hasContentOnlyTempateLock =\n\t\tgetTemplateLock( state, clientId ) === 'contentOnly';\n\tconst rootClientId = getBlockRootClientId( state, clientId );\n\tconst hasRootContentOnlyTemplateLock =\n\t\tgetTemplateLock( state, rootClientId ) === 'contentOnly';\n\tif ( hasContentOnlyTempateLock && ! hasRootContentOnlyTemplateLock ) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\n/**\n * Retrieves the client ID of the block that is a contentOnly section but is\n * currently being temporarily edited (contentOnly is deactivated).\n *\n * @param {Object} state Global application state.\n *\n * @return {?string} The client ID of the block being temporarily edited.\n */\nexport function getEditedContentOnlySection( state ) {\n\treturn state.editedContentOnlySection;\n}\n\nexport function isWithinEditedContentOnlySection( state, clientId ) {\n\tif ( ! state.editedContentOnlySection ) {\n\t\treturn false;\n\t}\n\n\tif ( state.editedContentOnlySection === clientId ) {\n\t\treturn true;\n\t}\n\n\tlet current = clientId;\n\twhile ( ( current = state.blocks.parents.get( current ) ) ) {\n\t\tif ( state.editedContentOnlySection === current ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\n/**\n * Returns the style attributes of multiple blocks.\n *\n * @param {Object} state Global application state.\n * @param {string[]} clientIds An array of block client IDs.\n *\n * @return {Object} An object where keys are client IDs and values are the corresponding block styles or undefined.\n */\nexport const getBlockStyles = createSelector(\n\t( state, clientIds ) =>\n\t\tclientIds.reduce( ( styles, clientId ) => {\n\t\t\tstyles[ clientId ] = state.blocks.attributes.get( clientId )?.style;\n\t\t\treturn styles;\n\t\t}, {} ),\n\t( state, clientIds ) => [\n\t\t...clientIds.map(\n\t\t\t( clientId ) => state.blocks.attributes.get( clientId )?.style\n\t\t),\n\t]\n);\n\n/**\n * Retrieves the client ID of the block which contains the blocks\n * acting as \"sections\" in the editor. This is typically the \"main content\"\n * of the template/post.\n *\n * @param {Object} state Editor state.\n *\n * @return {string|undefined} The section root client ID or undefined if not set.\n */\nexport function getSectionRootClientId( state ) {\n\treturn state.settings?.[ sectionRootClientIdKey ];\n}\n\n/**\n * Returns whether the editor is considered zoomed out.\n *\n * @param {Object} state Global application state.\n * @return {boolean} Whether the editor is zoomed.\n */\nexport function isZoomOut( state ) {\n\treturn state.zoomLevel === 'auto-scaled' || state.zoomLevel < 100;\n}\n\n/**\n * Returns whether the zoom level.\n *\n * @param {Object} state Global application state.\n * @return {number|\"auto-scaled\"} Zoom level.\n */\nexport function getZoomLevel( state ) {\n\treturn state.zoomLevel;\n}\n\n/**\n * Finds the closest block where the block is allowed to be inserted.\n *\n * @param {Object} state Editor state.\n * @param {string[] | string} name Block name or names.\n * @param {string} clientId Default insertion point.\n *\n * @return {string} clientID of the closest container when the block name can be inserted.\n */\nexport function getClosestAllowedInsertionPoint( state, name, clientId = '' ) {\n\tconst blockNames = Array.isArray( name ) ? name : [ name ];\n\tconst areBlockNamesAllowedInClientId = ( id ) =>\n\t\tblockNames.every( ( currentName ) =>\n\t\t\tcanInsertBlockType( state, currentName, id )\n\t\t);\n\n\t// If we're trying to insert at the root level and it's not allowed\n\t// Try the section root instead.\n\tif ( ! clientId ) {\n\t\tif ( areBlockNamesAllowedInClientId( clientId ) ) {\n\t\t\treturn clientId;\n\t\t}\n\n\t\tconst sectionRootClientId = getSectionRootClientId( state );\n\t\tif (\n\t\t\tsectionRootClientId &&\n\t\t\tareBlockNamesAllowedInClientId( sectionRootClientId )\n\t\t) {\n\t\t\treturn sectionRootClientId;\n\t\t}\n\t\treturn null;\n\t}\n\n\t// Traverse the block tree up until we find a place where we can insert.\n\tlet current = clientId;\n\twhile ( current !== null && ! areBlockNamesAllowedInClientId( current ) ) {\n\t\tconst parentClientId = getBlockRootClientId( state, current );\n\t\tcurrent = parentClientId;\n\t}\n\n\treturn current;\n}\n\nexport function getClosestAllowedInsertionPointForPattern(\n\tstate,\n\tpattern,\n\tclientId\n) {\n\tconst { allowedBlockTypes } = getSettings( state );\n\tconst isAllowed = checkAllowListRecursive(\n\t\tgetGrammar( pattern ),\n\t\tallowedBlockTypes\n\t);\n\tif ( ! isAllowed ) {\n\t\treturn null;\n\t}\n\tconst names = getGrammar( pattern ).map( ( { blockName: name } ) => name );\n\treturn getClosestAllowedInsertionPoint( state, names, clientId );\n}\n\n/**\n * Where the point where the next block will be inserted into.\n *\n * @param {Object} state\n * @return {Object} where the insertion point in the block editor is or null if none is set.\n */\nexport function getInsertionPoint( state ) {\n\treturn state.insertionPoint;\n}\n\n/**\n * Returns true if the block is hidden, or false otherwise.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId Client ID of the block.\n *\n * @return {boolean} Whether the block is hidden.\n */\nexport const isBlockHidden = ( state, clientId ) => {\n\tconst blockName = getBlockName( state, clientId );\n\tif ( ! hasBlockSupport( state, blockName, 'visibility', true ) ) {\n\t\treturn false;\n\t}\n\tconst attributes = state.blocks.attributes.get( clientId );\n\treturn attributes?.metadata?.blockVisibility === false;\n};\n\n/**\n * Returns true if there is a spotlighted block.\n *\n * The spotlight is also active when a contentOnly section is being edited, the selector\n * also returns true if this is the case.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the block is currently spotlighted.\n */\nexport function hasBlockSpotlight( state ) {\n\treturn !! state.hasBlockSpotlight || !! state.editedContentOnlySection;\n}\n\n/**\n * Returns whether a block is locked to prevent editing.\n *\n * This selector only reasons about block lock, not associated features\n * like `blockEditingMode` that might prevent user modifications to a block.\n * Currently there's also no way to prevent editing via `templateLock`.\n *\n * This distinction is important as this selector specifically drives the block lock UI\n * that a user interacts with. `blockEditingModes` aren't included as a user can't change\n * them.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId ClientId of the block.\n *\n * @return {boolean} Whether the block is currently locked.\n */\nexport function isEditLockedBlock( state, clientId ) {\n\tconst attributes = getBlockAttributes( state, clientId );\n\treturn !! attributes?.lock?.edit;\n}\n\n/**\n * Returns whether a block is locked to prevent moving.\n *\n * This selector only reasons about templateLock and block lock, not associated features\n * like `blockEditingMode` that might prevent user modifications to a block.\n *\n * This distinction is important as this selector specifically drives the block lock UI\n * that a user interacts with. `blockEditingModes` are excluded as a user can't change\n * them.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId ClientId of the block.\n *\n * @return {boolean} Whether the block is currently locked.\n */\nexport function isMoveLockedBlock( state, clientId ) {\n\tconst attributes = getBlockAttributes( state, clientId );\n\t// If a block explicitly has `move` set to `false`, it turns off\n\t// any locking that might be inherited from a parent.\n\tif ( attributes?.lock?.move !== undefined ) {\n\t\treturn !! attributes?.lock?.move;\n\t}\n\n\tconst rootClientId = getBlockRootClientId( state, clientId );\n\tconst templateLock = getTemplateLock( state, rootClientId );\n\n\t// While `contentOnly` templateLock does sometimes prevent moving, a user can't modify\n\t// this, so don't include it in this function. See the `canMoveBlock` selector\n\t// as an alternative.\n\treturn templateLock === 'all';\n}\n\n/**\n * Returns whether a block is locked to prevent removal.\n *\n * This selector only reasons about templateLock and block lock, not associated features\n * like `blockEditingMode` that might prevent user modifications to a block.\n *\n * This distinction is important as this selector specifically drives the block lock UI\n * that a user interacts with. `blockEditingModes` are excluded as a user can't change\n * them.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId ClientId of the block.\n *\n * @return {boolean} Whether the block is currently locked.\n */\nexport function isRemoveLockedBlock( state, clientId ) {\n\tconst attributes = getBlockAttributes( state, clientId );\n\tif ( attributes?.lock?.remove !== undefined ) {\n\t\treturn !! attributes?.lock?.remove;\n\t}\n\n\tconst rootClientId = getBlockRootClientId( state, clientId );\n\tconst templateLock = getTemplateLock( state, rootClientId );\n\n\t// While `contentOnly` templateLock does sometimes prevent removal, a user can't modify\n\t// this, so don't include it in this function. See the `canRemoveBlock` selector\n\t// as an alternative.\n\treturn templateLock === 'all' || templateLock === 'insert';\n}\n\n/**\n * Returns whether a block is locked.\n *\n * This selector only reasons about templateLock and block lock, not associated features\n * like `blockEditingMode` that might prevent user modifications to a block.\n *\n * This distinction is important as this selector specifically drives the block lock UI\n * that a user interacts with. `blockEditingModes` are excluded as a user can't change\n * them.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId ClientId of the block.\n *\n * @return {boolean} Whether the block is currently locked.\n */\nexport function isLockedBlock( state, clientId ) {\n\treturn (\n\t\tisEditLockedBlock( state, clientId ) ||\n\t\tisMoveLockedBlock( state, clientId ) ||\n\t\tisRemoveLockedBlock( state, clientId )\n\t);\n}\n"],
5
- "mappings": ";AAGA,SAAS,gBAAgB,8BAA8B;AACvD;AAAA,EACC;AAAA,EACA,eAAe;AAAA,OACT;AAKP;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,kBAAkB;AAC3B,SAAS,cAAc;AACvB;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAIP,SAAS,wBAAwB;AAFjC,IAAM,EAAE,eAAe,IAAI,OAAQ,iBAAkB;AAW9C,SAAS,uBAAwB,OAAQ;AAC/C,SAAO,MAAM;AACd;AAQO,SAAS,+BAAgC,OAAQ;AACvD,SAAO,OAAO,mBAAmB;AAClC;AAEO,SAAS,0BAA2B,OAAO,UAAW;AAC5D,SAAO,MAAM,OAAO,WAAW,IAAK,QAAS;AAC9C;AAWO,IAAM,yBAAy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,eAAe,gBAAiB,OAAO,YAAa;AAK1D,SAAO,iBAAiB;AACzB;AAiBO,SAAS,oBAAqB,OAAO,UAAW;AACtD,QAAM,aAAa,mBAAoB,OAAO,QAAS;AACvD,MAAK,YAAY,MAAM,WAAW,QAAY;AAC7C,WAAO,CAAC,CAAE,YAAY,MAAM;AAAA,EAC7B;AAEA,QAAM,eAAe,qBAAsB,OAAO,QAAS;AAC3D,QAAM,eAAe,gBAAiB,OAAO,YAAa;AAK1D,SAAO,iBAAiB,SAAS,iBAAiB;AACnD;AAiBO,SAAS,cAAe,OAAO,UAAW;AAChD,SACC,kBAAmB,OAAO,QAAS,KACnC,kBAAmB,OAAO,QAAS,KACnC,oBAAqB,OAAO,QAAS;AAEvC;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { createSelector, createRegistrySelector } from '@wordpress/data';\nimport {\n\thasBlockSupport,\n\tprivateApis as blocksPrivateApis,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport {\n\tgetBlockOrder,\n\tgetBlockParents,\n\tgetBlockEditingMode,\n\tgetSettings,\n\tcanInsertBlockType,\n\tgetBlockName,\n\tgetTemplateLock,\n\tgetClientIdsWithDescendants,\n\tgetBlockRootClientId,\n\tgetBlockAttributes,\n} from './selectors';\nimport {\n\tcheckAllowListRecursive,\n\tgetAllPatternsDependants,\n\tgetInsertBlockTypeDependants,\n\tgetGrammar,\n\tmapUserPattern,\n} from './utils';\nimport { STORE_NAME } from './constants';\nimport { unlock } from '../lock-unlock';\nimport {\n\tselectBlockPatternsKey,\n\treusableBlocksSelectKey,\n\tsectionRootClientIdKey,\n\tisIsolatedEditorKey,\n} from './private-keys';\n\nconst { isContentBlock } = unlock( blocksPrivateApis );\n\nexport { getBlockSettings } from './get-block-settings';\n\n/**\n * Returns true if the block interface is hidden, or false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the block toolbar is hidden.\n */\nexport function isBlockInterfaceHidden( state ) {\n\treturn state.isBlockInterfaceHidden;\n}\n\n/**\n * Gets the client ids of the last inserted blocks.\n *\n * @param {Object} state Global application state.\n * @return {Array|undefined} Client Ids of the last inserted block(s).\n */\nexport function getLastInsertedBlocksClientIds( state ) {\n\treturn state?.lastBlockInserted?.clientIds;\n}\n\nexport function getBlockWithoutAttributes( state, clientId ) {\n\treturn state.blocks.byClientId.get( clientId );\n}\n\n/**\n * Returns true if all of the descendants of a block with the given client ID\n * have an editing mode of 'disabled', or false otherwise.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId The block client ID.\n *\n * @return {boolean} Whether the block descendants are disabled.\n */\nexport const isBlockSubtreeDisabled = ( state, clientId ) => {\n\tconst isChildSubtreeDisabled = ( childClientId ) => {\n\t\treturn (\n\t\t\tgetBlockEditingMode( state, childClientId ) === 'disabled' &&\n\t\t\tgetBlockOrder( state, childClientId ).every(\n\t\t\t\tisChildSubtreeDisabled\n\t\t\t)\n\t\t);\n\t};\n\treturn getBlockOrder( state, clientId ).every( isChildSubtreeDisabled );\n};\n\n/**\n * Determines if a container (clientId) allows insertion of blocks, considering contentOnly mode restrictions.\n *\n * @param {Object} state Editor state.\n * @param {string} blockName The block name to insert.\n * @param {string} rootClientId The client ID of the root container block.\n * @return {boolean} Whether the container allows insertion.\n */\nexport function isContainerInsertableToInContentOnlyMode(\n\tstate,\n\tblockName,\n\trootClientId\n) {\n\tconst isBlockContentBlock = isContentBlock( blockName );\n\tconst rootBlockName = getBlockName( state, rootClientId );\n\tconst isContainerContentBlock = isContentBlock( rootBlockName );\n\tconst isRootBlockMain = getSectionRootClientId( state ) === rootClientId;\n\n\t// In contentOnly mode, containers shouldn't be inserted into unless:\n\t// 1. they are a section root;\n\t// 2. they are a content block and the block to be inserted is also content.\n\treturn (\n\t\tisRootBlockMain || ( isContainerContentBlock && isBlockContentBlock )\n\t);\n}\n\nfunction getEnabledClientIdsTreeUnmemoized( state, rootClientId ) {\n\tconst blockOrder = getBlockOrder( state, rootClientId );\n\tconst result = [];\n\n\tfor ( const clientId of blockOrder ) {\n\t\tconst innerBlocks = getEnabledClientIdsTreeUnmemoized(\n\t\t\tstate,\n\t\t\tclientId\n\t\t);\n\t\tif ( getBlockEditingMode( state, clientId ) !== 'disabled' ) {\n\t\t\tresult.push( { clientId, innerBlocks } );\n\t\t} else {\n\t\t\tresult.push( ...innerBlocks );\n\t\t}\n\t}\n\n\treturn result;\n}\n\n/**\n * Returns a tree of block objects with only clientID and innerBlocks set.\n * Blocks with a 'disabled' editing mode are not included.\n *\n * @param {Object} state Global application state.\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {Object[]} Tree of block objects with only clientID and innerBlocks set.\n */\nexport const getEnabledClientIdsTree = createRegistrySelector( () =>\n\tcreateSelector( getEnabledClientIdsTreeUnmemoized, ( state ) => [\n\t\tstate.blocks.order,\n\t\tstate.derivedBlockEditingModes,\n\t\tstate.blockEditingModes,\n\t] )\n);\n\n/**\n * Returns a list of a given block's ancestors, from top to bottom. Blocks with\n * a 'disabled' editing mode are excluded.\n *\n * @see getBlockParents\n *\n * @param {Object} state Global application state.\n * @param {string} clientId The block client ID.\n * @param {boolean} ascending Order results from bottom to top (true) or top\n * to bottom (false).\n */\nexport const getEnabledBlockParents = createSelector(\n\t( state, clientId, ascending = false ) => {\n\t\treturn getBlockParents( state, clientId, ascending ).filter(\n\t\t\t( parent ) => getBlockEditingMode( state, parent ) !== 'disabled'\n\t\t);\n\t},\n\t( state ) => [\n\t\tstate.blocks.parents,\n\t\tstate.blockEditingModes,\n\t\tstate.settings.templateLock,\n\t\tstate.blockListSettings,\n\t]\n);\n\n/**\n * Selector that returns the data needed to display a prompt when certain\n * blocks are removed, or `false` if no such prompt is requested.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object|false} Data for removal prompt display, if any.\n */\nexport function getRemovalPromptData( state ) {\n\treturn state.removalPromptData;\n}\n\n/**\n * Returns true if removal prompt exists, or false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether removal prompt exists.\n */\nexport function getBlockRemovalRules( state ) {\n\treturn state.blockRemovalRules;\n}\n\n/**\n * Returns the client ID of the block settings menu that is currently open.\n *\n * @param {Object} state Global application state.\n * @return {string|null} The client ID of the block menu that is currently open.\n */\nexport function getOpenedBlockSettingsMenu( state ) {\n\treturn state.openedBlockSettingsMenu;\n}\n\n/**\n * Returns all style overrides, intended to be merged with global editor styles.\n *\n * Overrides are sorted to match the order of the blocks they relate to. This\n * is useful to maintain correct CSS cascade order.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} An array of style ID to style override pairs.\n */\nexport const getStyleOverrides = createSelector(\n\t( state ) => {\n\t\tconst clientIds = getClientIdsWithDescendants( state );\n\t\tconst clientIdMap = clientIds.reduce( ( acc, clientId, index ) => {\n\t\t\tacc[ clientId ] = index;\n\t\t\treturn acc;\n\t\t}, {} );\n\n\t\treturn [ ...state.styleOverrides ].sort( ( overrideA, overrideB ) => {\n\t\t\t// Once the overrides Map is spread to an array, the first element\n\t\t\t// is the key, while the second is the override itself including\n\t\t\t// the clientId to sort by.\n\t\t\tconst [ , { clientId: clientIdA } ] = overrideA;\n\t\t\tconst [ , { clientId: clientIdB } ] = overrideB;\n\n\t\t\tconst aIndex = clientIdMap[ clientIdA ] ?? -1;\n\t\t\tconst bIndex = clientIdMap[ clientIdB ] ?? -1;\n\n\t\t\treturn aIndex - bIndex;\n\t\t} );\n\t},\n\t( state ) => [ state.blocks.order, state.styleOverrides ]\n);\n\n/** @typedef {import('./actions').InserterMediaCategory} InserterMediaCategory */\n/**\n * Returns the registered inserter media categories through the public API.\n *\n * @param {Object} state Editor state.\n *\n * @return {InserterMediaCategory[]} Inserter media categories.\n */\nexport function getRegisteredInserterMediaCategories( state ) {\n\treturn state.registeredInserterMediaCategories;\n}\n\n/**\n * Returns an array containing the allowed inserter media categories.\n * It merges the registered media categories from extenders with the\n * core ones. It also takes into account the allowed `mime_types`, which\n * can be altered by `upload_mimes` filter and restrict some of them.\n *\n * @param {Object} state Global application state.\n *\n * @return {InserterMediaCategory[]} Client IDs of descendants.\n */\nexport const getInserterMediaCategories = createSelector(\n\t( state ) => {\n\t\tconst {\n\t\t\tsettings: {\n\t\t\t\tinserterMediaCategories,\n\t\t\t\tallowedMimeTypes,\n\t\t\t\tenableOpenverseMediaCategory,\n\t\t\t},\n\t\t\tregisteredInserterMediaCategories,\n\t\t} = state;\n\t\t// The allowed `mime_types` can be altered by `upload_mimes` filter and restrict\n\t\t// some of them. In this case we shouldn't add the category to the available media\n\t\t// categories list in the inserter.\n\t\tif (\n\t\t\t( ! inserterMediaCategories &&\n\t\t\t\t! registeredInserterMediaCategories.length ) ||\n\t\t\t! allowedMimeTypes\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tconst coreInserterMediaCategoriesNames =\n\t\t\tinserterMediaCategories?.map( ( { name } ) => name ) || [];\n\t\tconst mergedCategories = [\n\t\t\t...( inserterMediaCategories || [] ),\n\t\t\t...( registeredInserterMediaCategories || [] ).filter(\n\t\t\t\t( { name } ) =>\n\t\t\t\t\t! coreInserterMediaCategoriesNames.includes( name )\n\t\t\t),\n\t\t];\n\t\treturn mergedCategories.filter( ( category ) => {\n\t\t\t// Check if Openverse category is enabled.\n\t\t\tif (\n\t\t\t\t! enableOpenverseMediaCategory &&\n\t\t\t\tcategory.name === 'openverse'\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn Object.values( allowedMimeTypes ).some( ( mimeType ) =>\n\t\t\t\tmimeType.startsWith( `${ category.mediaType }/` )\n\t\t\t);\n\t\t} );\n\t},\n\t( state ) => [\n\t\tstate.settings.inserterMediaCategories,\n\t\tstate.settings.allowedMimeTypes,\n\t\tstate.settings.enableOpenverseMediaCategory,\n\t\tstate.registeredInserterMediaCategories,\n\t]\n);\n\n/**\n * Returns whether there is at least one allowed pattern for inner blocks children.\n * This is useful for deferring the parsing of all patterns until needed.\n *\n * @param {Object} state Editor state.\n * @param {string} [rootClientId=null] Target root client ID.\n *\n * @return {boolean} If there is at least one allowed pattern.\n */\nexport const hasAllowedPatterns = createRegistrySelector( ( select ) =>\n\tcreateSelector(\n\t\t( state, rootClientId = null ) => {\n\t\t\tconst { getAllPatterns } = unlock( select( STORE_NAME ) );\n\t\t\tconst patterns = getAllPatterns();\n\t\t\tconst { allowedBlockTypes } = getSettings( state );\n\t\t\treturn patterns.some( ( pattern ) => {\n\t\t\t\tconst { inserter = true } = pattern;\n\t\t\t\tif ( ! inserter ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tconst grammar = getGrammar( pattern );\n\t\t\t\treturn (\n\t\t\t\t\tcheckAllowListRecursive( grammar, allowedBlockTypes ) &&\n\t\t\t\t\tgrammar.every( ( { name: blockName } ) =>\n\t\t\t\t\t\tcanInsertBlockType( state, blockName, rootClientId )\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} );\n\t\t},\n\t\t( state, rootClientId ) => [\n\t\t\t...getAllPatternsDependants( select )( state ),\n\t\t\t...getInsertBlockTypeDependants( select )( state, rootClientId ),\n\t\t]\n\t)\n);\n\nexport const getPatternBySlug = createRegistrySelector( ( select ) =>\n\tcreateSelector(\n\t\t( state, patternName ) => {\n\t\t\t// Only fetch reusable blocks if we know we need them. To do: maybe\n\t\t\t// use the entity record API to retrieve the block by slug.\n\t\t\tif ( patternName?.startsWith( 'core/block/' ) ) {\n\t\t\t\tconst _id = parseInt(\n\t\t\t\t\tpatternName.slice( 'core/block/'.length ),\n\t\t\t\t\t10\n\t\t\t\t);\n\t\t\t\tconst block = unlock( select( STORE_NAME ) )\n\t\t\t\t\t.getReusableBlocks()\n\t\t\t\t\t.find( ( { id } ) => id === _id );\n\n\t\t\t\tif ( ! block ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\treturn mapUserPattern(\n\t\t\t\t\tblock,\n\t\t\t\t\tstate.settings.__experimentalUserPatternCategories\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn [\n\t\t\t\t// This setting is left for back compat.\n\t\t\t\t...( state.settings.__experimentalBlockPatterns ?? [] ),\n\t\t\t\t...( state.settings[ selectBlockPatternsKey ]?.( select ) ??\n\t\t\t\t\t[] ),\n\t\t\t].find( ( { name } ) => name === patternName );\n\t\t},\n\t\t( state, patternName ) =>\n\t\t\tpatternName?.startsWith( 'core/block/' )\n\t\t\t\t? [\n\t\t\t\t\t\tunlock( select( STORE_NAME ) ).getReusableBlocks(),\n\t\t\t\t\t\tstate.settings.__experimentalReusableBlocks,\n\t\t\t\t ]\n\t\t\t\t: [\n\t\t\t\t\t\tstate.settings.__experimentalBlockPatterns,\n\t\t\t\t\t\tstate.settings[ selectBlockPatternsKey ]?.( select ),\n\t\t\t\t ]\n\t)\n);\n\nexport const getAllPatterns = createRegistrySelector( ( select ) =>\n\tcreateSelector( ( state ) => {\n\t\treturn [\n\t\t\t...unlock( select( STORE_NAME ) )\n\t\t\t\t.getReusableBlocks()\n\t\t\t\t.map( ( userPattern ) =>\n\t\t\t\t\tmapUserPattern(\n\t\t\t\t\t\tuserPattern,\n\t\t\t\t\t\tstate.settings.__experimentalUserPatternCategories\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t// This setting is left for back compat.\n\t\t\t...( state.settings.__experimentalBlockPatterns ?? [] ),\n\t\t\t...( state.settings[ selectBlockPatternsKey ]?.( select ) ?? [] ),\n\t\t].filter(\n\t\t\t( x, index, arr ) =>\n\t\t\t\tindex === arr.findIndex( ( y ) => x.name === y.name )\n\t\t);\n\t}, getAllPatternsDependants( select ) )\n);\n\nconst EMPTY_ARRAY = [];\n\nexport const getReusableBlocks = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst reusableBlocksSelect = state.settings[ reusableBlocksSelectKey ];\n\t\treturn (\n\t\t\t( reusableBlocksSelect\n\t\t\t\t? reusableBlocksSelect( select )\n\t\t\t\t: state.settings.__experimentalReusableBlocks ) ?? EMPTY_ARRAY\n\t\t);\n\t}\n);\n\n/**\n * Returns the element of the last element that had focus when focus left the editor canvas.\n *\n * @param {Object} state Block editor state.\n *\n * @return {Object} Element.\n */\nexport function getLastFocus( state ) {\n\treturn state.lastFocus;\n}\n\n/**\n * Returns true if the user is dragging anything, or false otherwise. It is possible for a\n * user to be dragging data from outside of the editor, so this selector is separate from\n * the `isDraggingBlocks` selector which only returns true if the user is dragging blocks.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether user is dragging.\n */\nexport function isDragging( state ) {\n\treturn state.isDragging;\n}\n\n/**\n * Retrieves the expanded block from the state.\n *\n * @param {Object} state Block editor state.\n *\n * @return {string|null} The client ID of the expanded block, if set.\n */\nexport function getExpandedBlock( state ) {\n\treturn state.expandedBlock;\n}\n\n/**\n * Retrieves the client ID of the ancestor block that is content locking the block\n * with the provided client ID.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId Client Id of the block.\n *\n * @return {?string} Client ID of the ancestor block that is content locking the block.\n */\nexport const getContentLockingParent = ( state, clientId ) => {\n\tlet current = clientId;\n\tlet result;\n\twhile ( ! result && ( current = state.blocks.parents.get( current ) ) ) {\n\t\tif ( getTemplateLock( state, current ) === 'contentOnly' ) {\n\t\t\tresult = current;\n\t\t}\n\t}\n\treturn result;\n};\n\n/**\n * Retrieves the client ID of the parent section block.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId Client Id of the block.\n *\n * @return {?string} Client ID of the ancestor block that is a contentOnly section.\n */\nexport const getParentSectionBlock = ( state, clientId ) => {\n\tlet current = clientId;\n\tlet result;\n\n\t// If sections are nested, return the top level section block.\n\t// Don't return early.\n\twhile ( ( current = state.blocks.parents.get( current ) ) ) {\n\t\tif ( isSectionBlock( state, current ) ) {\n\t\t\tresult = current;\n\t\t}\n\t}\n\treturn result;\n};\n\n/**\n * Returns whether the block is a contentOnly section.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId Client Id of the block.\n *\n * @return {boolean} Whether the block is a contentOnly section.\n */\nexport function isSectionBlock( state, clientId ) {\n\tif ( clientId === state.editedContentOnlySection ) {\n\t\treturn false;\n\t}\n\n\tconst blockName = getBlockName( state, clientId );\n\tif ( blockName === 'core/block' ) {\n\t\treturn true;\n\t}\n\n\tconst attributes = getBlockAttributes( state, clientId );\n\tconst isTemplatePart = blockName === 'core/template-part';\n\n\t// When in an isolated editing context (e.g., editing a template part or pattern directly),\n\t// don't treat nested unsynced patterns as section blocks.\n\tconst isIsolatedEditor = state.settings?.[ isIsolatedEditorKey ];\n\n\tif (\n\t\t( attributes?.metadata?.patternName || isTemplatePart ) &&\n\t\t!! window?.__experimentalContentOnlyPatternInsertion &&\n\t\t! isIsolatedEditor\n\t) {\n\t\treturn true;\n\t}\n\n\t// TemplateLock cascades to all inner parent blocks. Only the top-level\n\t// block that's contentOnly templateLocked is the true contentLocker,\n\t// all the others are mere imitators.\n\tconst hasContentOnlyTempateLock =\n\t\tgetTemplateLock( state, clientId ) === 'contentOnly';\n\tconst rootClientId = getBlockRootClientId( state, clientId );\n\tconst hasRootContentOnlyTemplateLock =\n\t\tgetTemplateLock( state, rootClientId ) === 'contentOnly';\n\tif ( hasContentOnlyTempateLock && ! hasRootContentOnlyTemplateLock ) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\n/**\n * Retrieves the client ID of the block that is a contentOnly section but is\n * currently being temporarily edited (contentOnly is deactivated).\n *\n * @param {Object} state Global application state.\n *\n * @return {?string} The client ID of the block being temporarily edited.\n */\nexport function getEditedContentOnlySection( state ) {\n\treturn state.editedContentOnlySection;\n}\n\nexport function isWithinEditedContentOnlySection( state, clientId ) {\n\tif ( ! state.editedContentOnlySection ) {\n\t\treturn false;\n\t}\n\n\tif ( state.editedContentOnlySection === clientId ) {\n\t\treturn true;\n\t}\n\n\tlet current = clientId;\n\twhile ( ( current = state.blocks.parents.get( current ) ) ) {\n\t\tif ( state.editedContentOnlySection === current ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\n/**\n * Returns the style attributes of multiple blocks.\n *\n * @param {Object} state Global application state.\n * @param {string[]} clientIds An array of block client IDs.\n *\n * @return {Object} An object where keys are client IDs and values are the corresponding block styles or undefined.\n */\nexport const getBlockStyles = createSelector(\n\t( state, clientIds ) =>\n\t\tclientIds.reduce( ( styles, clientId ) => {\n\t\t\tstyles[ clientId ] = state.blocks.attributes.get( clientId )?.style;\n\t\t\treturn styles;\n\t\t}, {} ),\n\t( state, clientIds ) => [\n\t\t...clientIds.map(\n\t\t\t( clientId ) => state.blocks.attributes.get( clientId )?.style\n\t\t),\n\t]\n);\n\n/**\n * Retrieves the client ID of the block which contains the blocks\n * acting as \"sections\" in the editor. This is typically the \"main content\"\n * of the template/post.\n *\n * @param {Object} state Editor state.\n *\n * @return {string|undefined} The section root client ID or undefined if not set.\n */\nexport function getSectionRootClientId( state ) {\n\treturn state.settings?.[ sectionRootClientIdKey ];\n}\n\n/**\n * Returns whether the editor is considered zoomed out.\n *\n * @param {Object} state Global application state.\n * @return {boolean} Whether the editor is zoomed.\n */\nexport function isZoomOut( state ) {\n\treturn state.zoomLevel === 'auto-scaled' || state.zoomLevel < 100;\n}\n\n/**\n * Returns whether the zoom level.\n *\n * @param {Object} state Global application state.\n * @return {number|\"auto-scaled\"} Zoom level.\n */\nexport function getZoomLevel( state ) {\n\treturn state.zoomLevel;\n}\n\n/**\n * Finds the closest block where the block is allowed to be inserted.\n *\n * @param {Object} state Editor state.\n * @param {string[] | string} name Block name or names.\n * @param {string} clientId Default insertion point.\n *\n * @return {string} clientID of the closest container when the block name can be inserted.\n */\nexport function getClosestAllowedInsertionPoint( state, name, clientId = '' ) {\n\tconst blockNames = Array.isArray( name ) ? name : [ name ];\n\tconst areBlockNamesAllowedInClientId = ( id ) =>\n\t\tblockNames.every( ( currentName ) =>\n\t\t\tcanInsertBlockType( state, currentName, id )\n\t\t);\n\n\t// If we're trying to insert at the root level and it's not allowed\n\t// Try the section root instead.\n\tif ( ! clientId ) {\n\t\tif ( areBlockNamesAllowedInClientId( clientId ) ) {\n\t\t\treturn clientId;\n\t\t}\n\n\t\tconst sectionRootClientId = getSectionRootClientId( state );\n\t\tif (\n\t\t\tsectionRootClientId &&\n\t\t\tareBlockNamesAllowedInClientId( sectionRootClientId )\n\t\t) {\n\t\t\treturn sectionRootClientId;\n\t\t}\n\t\treturn null;\n\t}\n\n\t// Traverse the block tree up until we find a place where we can insert.\n\tlet current = clientId;\n\twhile ( current !== null && ! areBlockNamesAllowedInClientId( current ) ) {\n\t\tconst parentClientId = getBlockRootClientId( state, current );\n\t\tcurrent = parentClientId;\n\t}\n\n\treturn current;\n}\n\nexport function getClosestAllowedInsertionPointForPattern(\n\tstate,\n\tpattern,\n\tclientId\n) {\n\tconst { allowedBlockTypes } = getSettings( state );\n\tconst isAllowed = checkAllowListRecursive(\n\t\tgetGrammar( pattern ),\n\t\tallowedBlockTypes\n\t);\n\tif ( ! isAllowed ) {\n\t\treturn null;\n\t}\n\tconst names = getGrammar( pattern ).map( ( { blockName: name } ) => name );\n\treturn getClosestAllowedInsertionPoint( state, names, clientId );\n}\n\n/**\n * Where the point where the next block will be inserted into.\n *\n * @param {Object} state\n * @return {Object} where the insertion point in the block editor is or null if none is set.\n */\nexport function getInsertionPoint( state ) {\n\treturn state.insertionPoint;\n}\n\n/**\n * Returns true if the block is hidden, or false otherwise.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId Client ID of the block.\n *\n * @return {boolean} Whether the block is hidden.\n */\nexport const isBlockHidden = ( state, clientId ) => {\n\tconst blockName = getBlockName( state, clientId );\n\tif ( ! hasBlockSupport( state, blockName, 'visibility', true ) ) {\n\t\treturn false;\n\t}\n\tconst attributes = state.blocks.attributes.get( clientId );\n\treturn attributes?.metadata?.blockVisibility === false;\n};\n\n/**\n * Returns true if there is a spotlighted block.\n *\n * The spotlight is also active when a contentOnly section is being edited, the selector\n * also returns true if this is the case.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the block is currently spotlighted.\n */\nexport function hasBlockSpotlight( state ) {\n\treturn !! state.hasBlockSpotlight || !! state.editedContentOnlySection;\n}\n\n/**\n * Returns whether a block is locked to prevent editing.\n *\n * This selector only reasons about block lock, not associated features\n * like `blockEditingMode` that might prevent user modifications to a block.\n * Currently there's also no way to prevent editing via `templateLock`.\n *\n * This distinction is important as this selector specifically drives the block lock UI\n * that a user interacts with. `blockEditingModes` aren't included as a user can't change\n * them.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId ClientId of the block.\n *\n * @return {boolean} Whether the block is currently locked.\n */\nexport function isEditLockedBlock( state, clientId ) {\n\tconst attributes = getBlockAttributes( state, clientId );\n\treturn !! attributes?.lock?.edit;\n}\n\n/**\n * Returns whether a block is locked to prevent moving.\n *\n * This selector only reasons about templateLock and block lock, not associated features\n * like `blockEditingMode` that might prevent user modifications to a block.\n *\n * This distinction is important as this selector specifically drives the block lock UI\n * that a user interacts with. `blockEditingModes` are excluded as a user can't change\n * them.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId ClientId of the block.\n *\n * @return {boolean} Whether the block is currently locked.\n */\nexport function isMoveLockedBlock( state, clientId ) {\n\tconst attributes = getBlockAttributes( state, clientId );\n\t// If a block explicitly has `move` set to `false`, it turns off\n\t// any locking that might be inherited from a parent.\n\tif ( attributes?.lock?.move !== undefined ) {\n\t\treturn !! attributes?.lock?.move;\n\t}\n\n\tconst rootClientId = getBlockRootClientId( state, clientId );\n\tconst templateLock = getTemplateLock( state, rootClientId );\n\n\t// While `contentOnly` templateLock does sometimes prevent moving, a user can't modify\n\t// this, so don't include it in this function. See the `canMoveBlock` selector\n\t// as an alternative.\n\treturn templateLock === 'all';\n}\n\n/**\n * Returns whether a block is locked to prevent removal.\n *\n * This selector only reasons about templateLock and block lock, not associated features\n * like `blockEditingMode` that might prevent user modifications to a block.\n *\n * This distinction is important as this selector specifically drives the block lock UI\n * that a user interacts with. `blockEditingModes` are excluded as a user can't change\n * them.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId ClientId of the block.\n *\n * @return {boolean} Whether the block is currently locked.\n */\nexport function isRemoveLockedBlock( state, clientId ) {\n\tconst attributes = getBlockAttributes( state, clientId );\n\tif ( attributes?.lock?.remove !== undefined ) {\n\t\treturn !! attributes?.lock?.remove;\n\t}\n\n\tconst rootClientId = getBlockRootClientId( state, clientId );\n\tconst templateLock = getTemplateLock( state, rootClientId );\n\n\t// While `contentOnly` templateLock does sometimes prevent removal, a user can't modify\n\t// this, so don't include it in this function. See the `canRemoveBlock` selector\n\t// as an alternative.\n\treturn templateLock === 'all' || templateLock === 'insert';\n}\n\n/**\n * Returns whether a block is locked.\n *\n * This selector only reasons about templateLock and block lock, not associated features\n * like `blockEditingMode` that might prevent user modifications to a block.\n *\n * This distinction is important as this selector specifically drives the block lock UI\n * that a user interacts with. `blockEditingModes` are excluded as a user can't change\n * them.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId ClientId of the block.\n *\n * @return {boolean} Whether the block is currently locked.\n */\nexport function isLockedBlock( state, clientId ) {\n\treturn (\n\t\tisEditLockedBlock( state, clientId ) ||\n\t\tisMoveLockedBlock( state, clientId ) ||\n\t\tisRemoveLockedBlock( state, clientId )\n\t);\n}\n"],
5
+ "mappings": ";AAGA,SAAS,gBAAgB,8BAA8B;AACvD;AAAA,EACC;AAAA,EACA,eAAe;AAAA,OACT;AAKP;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,kBAAkB;AAC3B,SAAS,cAAc;AACvB;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAIP,SAAS,wBAAwB;AAFjC,IAAM,EAAE,eAAe,IAAI,OAAQ,iBAAkB;AAW9C,SAAS,uBAAwB,OAAQ;AAC/C,SAAO,MAAM;AACd;AAQO,SAAS,+BAAgC,OAAQ;AACvD,SAAO,OAAO,mBAAmB;AAClC;AAEO,S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AAO,QAAS;AAGvD,MAAK,YAAY,MAAM,SAAS,QAAY;AAC3C,WAAO,CAAC,CAAE,YAAY,MAAM;AAAA,EAC7B;AAEA,QAAM,eAAe,qBAAsB,OAAO,QAAS;AAC3D,QAAM,eAAe,gBAAiB,OAAO,YAAa;AAK1D,SAAO,iBAAiB;AACzB;AAiBO,SAAS,oBAAqB,OAAO,UAAW;AACtD,QAAM,aAAa,mBAAoB,OAAO,QAAS;AACvD,MAAK,YAAY,MAAM,WAAW,QAAY;AAC7C,WAAO,CAAC,CAAE,YAAY,MAAM;AAAA,EAC7B;AAEA,QAAM,eAAe,qBAAsB,OAAO,QAAS;AAC3D,QAAM,eAAe,gBAAiB,OAAO,YAAa;AAK1D,SAAO,iBAAiB,SAAS,iBAAiB;AACnD;AAiBO,SAAS,cAAe,OAAO,UAAW;AAChD,SACC,kBAAmB,OAAO,QAAS,KACnC,kBAAmB,OAAO,QAAS,KACnC,oBAAqB,OAAO,QAAS;AAEvC;",
6
6
  "names": ["getAllPatterns"]
7
7
  }
@@ -9,7 +9,7 @@ import {
9
9
  } from "@wordpress/blocks";
10
10
  import { PREFERENCES_DEFAULTS, SETTINGS_DEFAULTS } from "./defaults";
11
11
  import { insertAt, moveTo } from "./array";
12
- import { sectionRootClientIdKey } from "./private-keys";
12
+ import { sectionRootClientIdKey, isIsolatedEditorKey } from "./private-keys";
13
13
  import { unlock } from "../lock-unlock";
14
14
  var { isContentBlock } = unlock(blocksPrivateApis);
15
15
  var identity = (x) => x;
@@ -1467,13 +1467,14 @@ function getDerivedBlockEditingModesForTree(state, treeClientId = "") {
1467
1467
  ).filter(
1468
1468
  (clientId) => state.blockListSettings[clientId]?.templateLock === "contentOnly"
1469
1469
  );
1470
- const unsyncedPatternClientIds = !!window?.__experimentalContentOnlyPatternInsertion ? Array.from(state.blocks.attributes.keys()).filter(
1470
+ const isIsolatedEditor = state.settings?.[isIsolatedEditorKey];
1471
+ const unsyncedPatternClientIds = !!window?.__experimentalContentOnlyPatternInsertion && !isIsolatedEditor ? Array.from(state.blocks.attributes.keys()).filter(
1471
1472
  (clientId) => state.blocks.attributes.get(clientId)?.metadata?.patternName
1472
1473
  ) : [];
1473
1474
  const contentOnlyParents = [
1474
1475
  ...contentOnlyTemplateLockedClientIds,
1475
1476
  ...unsyncedPatternClientIds,
1476
- ...window?.__experimentalContentOnlyPatternInsertion ? templatePartClientIds : []
1477
+ ...window?.__experimentalContentOnlyPatternInsertion && !isIsolatedEditor ? templatePartClientIds : []
1477
1478
  ];
1478
1479
  traverseBlockTree(state, treeClientId, (block) => {
1479
1480
  const { clientId, name: blockName } = block;