@wordpress/block-editor 15.11.0 → 15.11.1-next.v.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 (268) hide show
  1. package/build/components/block-controls/index.cjs +1 -1
  2. package/build/components/block-controls/index.cjs.map +2 -2
  3. package/build/components/block-inspector/index.cjs +6 -19
  4. package/build/components/block-inspector/index.cjs.map +3 -3
  5. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.cjs +37 -13
  6. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.cjs.map +2 -2
  7. package/build/components/block-settings-menu-controls/index.cjs +1 -1
  8. package/build/components/block-settings-menu-controls/index.cjs.map +2 -2
  9. package/build/components/block-toolbar/index.cjs +1 -1
  10. package/build/components/block-toolbar/index.cjs.map +2 -2
  11. package/build/components/block-tools/index.cjs +2 -26
  12. package/build/components/block-tools/index.cjs.map +2 -2
  13. package/build/components/block-visibility/index.cjs +7 -9
  14. package/build/components/block-visibility/index.cjs.map +3 -3
  15. package/build/components/block-visibility/modal.cjs +13 -11
  16. package/build/components/block-visibility/modal.cjs.map +2 -2
  17. package/build/components/block-visibility/use-block-visibility.cjs +1 -1
  18. package/build/components/block-visibility/use-block-visibility.cjs.map +2 -2
  19. package/build/components/block-visibility/utils.cjs +5 -1
  20. package/build/components/block-visibility/utils.cjs.map +2 -2
  21. package/build/components/block-visibility/viewport-menu-item.cjs +11 -4
  22. package/build/components/block-visibility/viewport-menu-item.cjs.map +2 -2
  23. package/build/components/block-visibility/viewport-toolbar.cjs +4 -6
  24. package/build/components/block-visibility/viewport-toolbar.cjs.map +2 -2
  25. package/build/components/block-visibility/viewport-visibility-info.cjs +121 -0
  26. package/build/components/block-visibility/viewport-visibility-info.cjs.map +7 -0
  27. package/build/components/color-palette/with-color-context.cjs +1 -1
  28. package/build/components/color-palette/with-color-context.cjs.map +2 -2
  29. package/build/components/color-style-selector/index.cjs +1 -1
  30. package/build/components/color-style-selector/index.cjs.map +2 -2
  31. package/build/components/colors/with-colors.cjs +5 -3
  32. package/build/components/colors/with-colors.cjs.map +2 -2
  33. package/build/components/colors-gradients/dropdown.cjs +1 -1
  34. package/build/components/colors-gradients/dropdown.cjs.map +2 -2
  35. package/build/components/editable-text/index.cjs +5 -1
  36. package/build/components/editable-text/index.cjs.map +2 -2
  37. package/build/components/font-sizes/with-font-sizes.cjs +5 -3
  38. package/build/components/font-sizes/with-font-sizes.cjs.map +2 -2
  39. package/build/components/global-styles/advanced-panel.cjs +26 -13
  40. package/build/components/global-styles/advanced-panel.cjs.map +2 -2
  41. package/build/components/global-styles/filters-panel.cjs +1 -1
  42. package/build/components/global-styles/filters-panel.cjs.map +2 -2
  43. package/build/components/global-styles/shadow-panel-components.cjs +1 -1
  44. package/build/components/global-styles/shadow-panel-components.cjs.map +2 -2
  45. package/build/components/gradients/with-gradient.cjs +1 -1
  46. package/build/components/gradients/with-gradient.cjs.map +2 -2
  47. package/build/components/inspector-controls/fill.cjs +12 -2
  48. package/build/components/inspector-controls/fill.cjs.map +2 -2
  49. package/build/components/inspector-controls/index.cjs +1 -1
  50. package/build/components/inspector-controls/index.cjs.map +2 -2
  51. package/build/components/inspector-controls-tabs/index.cjs +1 -1
  52. package/build/components/inspector-controls-tabs/index.cjs.map +2 -2
  53. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.cjs +2 -2
  54. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.cjs.map +2 -2
  55. package/build/components/list-view/block-select-button.cjs +8 -16
  56. package/build/components/list-view/block-select-button.cjs.map +2 -2
  57. package/build/components/list-view/block.cjs +29 -34
  58. package/build/components/list-view/block.cjs.map +3 -3
  59. package/build/components/list-view/utils.cjs +3 -1
  60. package/build/components/list-view/utils.cjs.map +2 -2
  61. package/build/components/provider/index.cjs +7 -8
  62. package/build/components/provider/index.cjs.map +2 -2
  63. package/build/components/provider/with-registry-provider.cjs +1 -1
  64. package/build/components/provider/with-registry-provider.cjs.map +2 -2
  65. package/build/components/use-block-commands/index.cjs +2 -34
  66. package/build/components/use-block-commands/index.cjs.map +2 -2
  67. package/build/hooks/cross-origin-isolation.cjs +1 -1
  68. package/build/hooks/cross-origin-isolation.cjs.map +2 -2
  69. package/build/hooks/custom-css.cjs +141 -0
  70. package/build/hooks/custom-css.cjs.map +7 -0
  71. package/build/hooks/fit-text.cjs +14 -7
  72. package/build/hooks/fit-text.cjs.map +2 -2
  73. package/build/hooks/grid-visualizer.cjs +1 -1
  74. package/build/hooks/grid-visualizer.cjs.map +2 -2
  75. package/build/hooks/index.cjs +4 -0
  76. package/build/hooks/index.cjs.map +3 -3
  77. package/build/hooks/layout.cjs +10 -4
  78. package/build/hooks/layout.cjs.map +2 -2
  79. package/build/hooks/list-view.cjs +9 -5
  80. package/build/hooks/list-view.cjs.map +3 -3
  81. package/build/hooks/utils.cjs +2 -2
  82. package/build/hooks/utils.cjs.map +2 -2
  83. package/build/layouts/grid.cjs +12 -1
  84. package/build/layouts/grid.cjs.map +2 -2
  85. package/build/store/defaults.cjs +3 -0
  86. package/build/store/defaults.cjs.map +2 -2
  87. package/build/store/private-selectors.cjs +45 -37
  88. package/build/store/private-selectors.cjs.map +2 -2
  89. package/build/utils/fit-text-utils.cjs +5 -1
  90. package/build/utils/fit-text-utils.cjs.map +2 -2
  91. package/build-module/components/block-controls/index.mjs +1 -1
  92. package/build-module/components/block-controls/index.mjs.map +2 -2
  93. package/build-module/components/block-inspector/index.mjs +6 -19
  94. package/build-module/components/block-inspector/index.mjs.map +2 -2
  95. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.mjs +37 -13
  96. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.mjs.map +2 -2
  97. package/build-module/components/block-settings-menu-controls/index.mjs +2 -2
  98. package/build-module/components/block-settings-menu-controls/index.mjs.map +2 -2
  99. package/build-module/components/block-toolbar/index.mjs +2 -2
  100. package/build-module/components/block-toolbar/index.mjs.map +2 -2
  101. package/build-module/components/block-tools/index.mjs +2 -26
  102. package/build-module/components/block-tools/index.mjs.map +2 -2
  103. package/build-module/components/block-visibility/index.mjs +6 -9
  104. package/build-module/components/block-visibility/index.mjs.map +2 -2
  105. package/build-module/components/block-visibility/modal.mjs +13 -11
  106. package/build-module/components/block-visibility/modal.mjs.map +2 -2
  107. package/build-module/components/block-visibility/use-block-visibility.mjs +1 -1
  108. package/build-module/components/block-visibility/use-block-visibility.mjs.map +2 -2
  109. package/build-module/components/block-visibility/utils.mjs +5 -1
  110. package/build-module/components/block-visibility/utils.mjs.map +2 -2
  111. package/build-module/components/block-visibility/viewport-menu-item.mjs +11 -4
  112. package/build-module/components/block-visibility/viewport-menu-item.mjs.map +2 -2
  113. package/build-module/components/block-visibility/viewport-toolbar.mjs +4 -6
  114. package/build-module/components/block-visibility/viewport-toolbar.mjs.map +2 -2
  115. package/build-module/components/block-visibility/viewport-visibility-info.mjs +95 -0
  116. package/build-module/components/block-visibility/viewport-visibility-info.mjs.map +7 -0
  117. package/build-module/components/color-palette/with-color-context.mjs +1 -1
  118. package/build-module/components/color-palette/with-color-context.mjs.map +2 -2
  119. package/build-module/components/color-style-selector/index.mjs +1 -1
  120. package/build-module/components/color-style-selector/index.mjs.map +2 -2
  121. package/build-module/components/colors/with-colors.mjs +5 -3
  122. package/build-module/components/colors/with-colors.mjs.map +2 -2
  123. package/build-module/components/colors-gradients/dropdown.mjs +1 -1
  124. package/build-module/components/colors-gradients/dropdown.mjs.map +2 -2
  125. package/build-module/components/editable-text/index.mjs +5 -1
  126. package/build-module/components/editable-text/index.mjs.map +2 -2
  127. package/build-module/components/font-sizes/with-font-sizes.mjs +5 -3
  128. package/build-module/components/font-sizes/with-font-sizes.mjs.map +2 -2
  129. package/build-module/components/global-styles/advanced-panel.mjs +22 -13
  130. package/build-module/components/global-styles/advanced-panel.mjs.map +2 -2
  131. package/build-module/components/global-styles/filters-panel.mjs +1 -1
  132. package/build-module/components/global-styles/filters-panel.mjs.map +2 -2
  133. package/build-module/components/global-styles/shadow-panel-components.mjs +1 -1
  134. package/build-module/components/global-styles/shadow-panel-components.mjs.map +2 -2
  135. package/build-module/components/gradients/with-gradient.mjs +1 -1
  136. package/build-module/components/gradients/with-gradient.mjs.map +2 -2
  137. package/build-module/components/inspector-controls/fill.mjs +12 -2
  138. package/build-module/components/inspector-controls/fill.mjs.map +2 -2
  139. package/build-module/components/inspector-controls/index.mjs +1 -1
  140. package/build-module/components/inspector-controls/index.mjs.map +2 -2
  141. package/build-module/components/inspector-controls-tabs/index.mjs +1 -1
  142. package/build-module/components/inspector-controls-tabs/index.mjs.map +2 -2
  143. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.mjs +2 -2
  144. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.mjs.map +2 -2
  145. package/build-module/components/list-view/block-select-button.mjs +8 -16
  146. package/build-module/components/list-view/block-select-button.mjs.map +2 -2
  147. package/build-module/components/list-view/block.mjs +31 -36
  148. package/build-module/components/list-view/block.mjs.map +2 -2
  149. package/build-module/components/list-view/utils.mjs +3 -1
  150. package/build-module/components/list-view/utils.mjs.map +2 -2
  151. package/build-module/components/provider/index.mjs +7 -8
  152. package/build-module/components/provider/index.mjs.map +2 -2
  153. package/build-module/components/provider/with-registry-provider.mjs +1 -1
  154. package/build-module/components/provider/with-registry-provider.mjs.map +2 -2
  155. package/build-module/components/use-block-commands/index.mjs +3 -37
  156. package/build-module/components/use-block-commands/index.mjs.map +2 -2
  157. package/build-module/hooks/cross-origin-isolation.mjs +1 -1
  158. package/build-module/hooks/cross-origin-isolation.mjs.map +2 -2
  159. package/build-module/hooks/custom-css.mjs +112 -0
  160. package/build-module/hooks/custom-css.mjs.map +7 -0
  161. package/build-module/hooks/fit-text.mjs +14 -7
  162. package/build-module/hooks/fit-text.mjs.map +2 -2
  163. package/build-module/hooks/grid-visualizer.mjs +1 -1
  164. package/build-module/hooks/grid-visualizer.mjs.map +2 -2
  165. package/build-module/hooks/index.mjs +4 -0
  166. package/build-module/hooks/index.mjs.map +2 -2
  167. package/build-module/hooks/layout.mjs +10 -4
  168. package/build-module/hooks/layout.mjs.map +2 -2
  169. package/build-module/hooks/list-view.mjs +10 -6
  170. package/build-module/hooks/list-view.mjs.map +2 -2
  171. package/build-module/hooks/utils.mjs +2 -2
  172. package/build-module/hooks/utils.mjs.map +2 -2
  173. package/build-module/layouts/grid.mjs +12 -1
  174. package/build-module/layouts/grid.mjs.map +2 -2
  175. package/build-module/store/defaults.mjs +3 -0
  176. package/build-module/store/defaults.mjs.map +2 -2
  177. package/build-module/store/private-selectors.mjs +42 -40
  178. package/build-module/store/private-selectors.mjs.map +2 -2
  179. package/build-module/utils/fit-text-utils.mjs +5 -1
  180. package/build-module/utils/fit-text-utils.mjs.map +2 -2
  181. package/build-style/style-rtl.css +3 -0
  182. package/build-style/style.css +3 -0
  183. package/package.json +39 -39
  184. package/src/components/block-controls/index.js +1 -1
  185. package/src/components/block-controls/test/index.js +1 -0
  186. package/src/components/block-edit/test/edit.js +10 -0
  187. package/src/components/block-inspector/index.js +14 -32
  188. package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +49 -29
  189. package/src/components/block-preview/test/index.js +11 -7
  190. package/src/components/block-settings-menu-controls/index.js +2 -2
  191. package/src/components/block-switcher/test/index.js +2 -0
  192. package/src/components/block-switcher/test/use-transformed.patterns.js +2 -0
  193. package/src/components/block-switcher/test/utils.js +2 -0
  194. package/src/components/block-toolbar/index.js +2 -2
  195. package/src/components/block-tools/index.js +2 -29
  196. package/src/components/block-visibility/index.js +3 -19
  197. package/src/components/block-visibility/modal.js +16 -14
  198. package/src/components/block-visibility/test/use-block-visibility.js +27 -25
  199. package/src/components/block-visibility/test/utils.js +24 -8
  200. package/src/components/block-visibility/use-block-visibility.js +1 -4
  201. package/src/components/block-visibility/utils.js +9 -1
  202. package/src/components/block-visibility/viewport-menu-item.js +11 -5
  203. package/src/components/block-visibility/viewport-toolbar.js +5 -6
  204. package/src/components/block-visibility/viewport-visibility-info.js +131 -0
  205. package/src/components/color-palette/with-color-context.js +1 -1
  206. package/src/components/color-style-selector/index.js +2 -3
  207. package/src/components/colors/with-colors.js +23 -20
  208. package/src/components/colors-gradients/dropdown.js +2 -3
  209. package/src/components/editable-text/index.js +5 -1
  210. package/src/components/font-sizes/with-font-sizes.js +13 -10
  211. package/src/components/global-styles/advanced-panel.js +35 -16
  212. package/src/components/global-styles/filters-panel.js +2 -3
  213. package/src/components/global-styles/shadow-panel-components.js +1 -1
  214. package/src/components/global-styles/style.scss +9 -5
  215. package/src/components/gradients/with-gradient.js +7 -4
  216. package/src/components/inner-blocks/test/index.js +2 -0
  217. package/src/components/inspector-controls/fill.js +25 -5
  218. package/src/components/inspector-controls/index.js +1 -1
  219. package/src/components/inspector-controls-tabs/index.js +5 -1
  220. package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +3 -4
  221. package/src/components/link-control/test/index.js +6 -1
  222. package/src/components/list-view/block-select-button.js +16 -25
  223. package/src/components/list-view/block.js +38 -43
  224. package/src/components/list-view/utils.js +4 -2
  225. package/src/components/media-replace-flow/test/index.js +13 -11
  226. package/src/components/provider/index.js +11 -10
  227. package/src/components/provider/test/use-block-sync.js +1 -0
  228. package/src/components/provider/with-registry-provider.js +1 -1
  229. package/src/components/use-block-commands/index.js +0 -41
  230. package/src/hooks/cross-origin-isolation.js +19 -18
  231. package/src/hooks/custom-css.js +176 -0
  232. package/src/hooks/fit-text.js +20 -5
  233. package/src/hooks/grid-visualizer.js +15 -14
  234. package/src/hooks/index.js +4 -0
  235. package/src/hooks/layout.js +55 -43
  236. package/src/hooks/list-view.js +10 -6
  237. package/src/hooks/test/align.js +1 -0
  238. package/src/hooks/test/allowed-blocks.js +8 -0
  239. package/src/hooks/test/auto-inspector-controls.js +4 -0
  240. package/src/hooks/test/font-size.js +1 -0
  241. package/src/hooks/test/metadata.js +4 -0
  242. package/src/hooks/test/text-align.js +1 -0
  243. package/src/hooks/utils.js +123 -119
  244. package/src/layouts/grid.js +19 -3
  245. package/src/layouts/test/grid.js +1 -1
  246. package/src/store/defaults.js +4 -0
  247. package/src/store/private-selectors.js +94 -63
  248. package/src/store/test/actions.js +7 -0
  249. package/src/store/test/private-selectors.js +116 -119
  250. package/src/store/test/reducer.js +4 -0
  251. package/src/store/test/registry-selectors.js +2 -0
  252. package/src/store/test/selectors.js +19 -0
  253. package/src/utils/fit-text-utils.js +12 -2
  254. package/build/components/block-visibility/block-visibility-info.cjs +0 -63
  255. package/build/components/block-visibility/block-visibility-info.cjs.map +0 -7
  256. package/build/components/block-visibility/menu-item.cjs +0 -109
  257. package/build/components/block-visibility/menu-item.cjs.map +0 -7
  258. package/build/components/block-visibility/toolbar.cjs +0 -92
  259. package/build/components/block-visibility/toolbar.cjs.map +0 -7
  260. package/build-module/components/block-visibility/block-visibility-info.mjs +0 -47
  261. package/build-module/components/block-visibility/block-visibility-info.mjs.map +0 -7
  262. package/build-module/components/block-visibility/menu-item.mjs +0 -88
  263. package/build-module/components/block-visibility/menu-item.mjs.map +0 -7
  264. package/build-module/components/block-visibility/toolbar.mjs +0 -71
  265. package/build-module/components/block-visibility/toolbar.mjs.map +0 -7
  266. package/src/components/block-visibility/block-visibility-info.js +0 -62
  267. package/src/components/block-visibility/menu-item.js +0 -96
  268. package/src/components/block-visibility/toolbar.js +0 -88
@@ -20,8 +20,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // packages/block-editor/src/store/private-selectors.js
21
21
  var private_selectors_exports = {};
22
22
  __export(private_selectors_exports, {
23
- areBlocksHidden: () => areBlocksHidden,
24
- areBlocksHiddenAnywhere: () => areBlocksHiddenAnywhere,
25
23
  getAllPatterns: () => getAllPatterns,
26
24
  getBlockRemovalRules: () => getBlockRemovalRules,
27
25
  getBlockSettings: () => import_get_block_settings.getBlockSettings,
@@ -48,8 +46,12 @@ __export(private_selectors_exports, {
48
46
  getZoomLevel: () => getZoomLevel,
49
47
  hasAllowedPatterns: () => hasAllowedPatterns,
50
48
  hasBlockSpotlight: () => hasBlockSpotlight,
51
- isBlockHidden: () => isBlockHidden,
49
+ isBlockHiddenAnywhere: () => isBlockHiddenAnywhere,
50
+ isBlockHiddenAtViewport: () => isBlockHiddenAtViewport,
51
+ isBlockHiddenEverywhere: () => isBlockHiddenEverywhere,
52
52
  isBlockInterfaceHidden: () => isBlockInterfaceHidden,
53
+ isBlockParentHiddenAtViewport: () => isBlockParentHiddenAtViewport,
54
+ isBlockParentHiddenEverywhere: () => isBlockParentHiddenEverywhere,
53
55
  isBlockSubtreeDisabled: () => isBlockSubtreeDisabled,
54
56
  isContainerInsertableToInContentOnlyMode: () => isContainerInsertableToInContentOnlyMode,
55
57
  isDragging: () => isDragging,
@@ -399,7 +401,7 @@ function getClosestAllowedInsertionPointForPattern(state, pattern, clientId) {
399
401
  function getInsertionPoint(state) {
400
402
  return state.insertionPoint;
401
403
  }
402
- var isBlockHidden = (state, clientId) => {
404
+ var isBlockHiddenAnywhere = (state, clientId) => {
403
405
  const blockName = (0, import_selectors.getBlockName)(state, clientId);
404
406
  if (!(0, import_blocks.hasBlockSupport)(blockName, "visibility", true)) {
405
407
  return false;
@@ -409,43 +411,47 @@ var isBlockHidden = (state, clientId) => {
409
411
  if (blockVisibility === false) {
410
412
  return true;
411
413
  }
412
- if (!window.__experimentalHideBlocksBasedOnScreenSize) {
413
- return false;
414
- }
415
- if (typeof blockVisibility === "object" && blockVisibility !== null) {
416
- const settings = (0, import_selectors.getSettings)(state);
417
- const viewportType = settings[import_private_keys.deviceTypeKey] ?? import_constants2.BLOCK_VISIBILITY_VIEWPORTS.desktop.key;
418
- const viewportKey = viewportType.toLowerCase();
419
- return blockVisibility?.[viewportKey] === false;
414
+ if (typeof blockVisibility?.viewport === "object" && blockVisibility?.viewport !== null) {
415
+ return Object.values(import_constants2.BLOCK_VISIBILITY_VIEWPORTS).some(
416
+ (viewport) => blockVisibility?.viewport?.[viewport.key] === false
417
+ );
420
418
  }
421
419
  return false;
422
420
  };
423
- var areBlocksHidden = (state, clientIds) => {
424
- if (!clientIds || clientIds.length === 0) {
421
+ var isBlockHiddenEverywhere = (state, clientId) => {
422
+ const blockName = (0, import_selectors.getBlockName)(state, clientId);
423
+ if (!(0, import_blocks.hasBlockSupport)(blockName, "visibility", true)) {
425
424
  return false;
426
425
  }
427
- return clientIds.some((clientId) => isBlockHidden(state, clientId));
426
+ const attributes = state.blocks.attributes.get(clientId);
427
+ const blockVisibility = attributes?.metadata?.blockVisibility;
428
+ if (blockVisibility === false) {
429
+ return true;
430
+ }
431
+ return false;
428
432
  };
429
- var areBlocksHiddenAnywhere = (state, clientIds) => {
430
- if (!clientIds?.length) {
431
- return false;
433
+ var isBlockParentHiddenEverywhere = (state, clientId) => {
434
+ const parents = (0, import_selectors.getBlockParents)(state, clientId);
435
+ return parents.some(
436
+ (parentId) => isBlockHiddenEverywhere(state, parentId)
437
+ );
438
+ };
439
+ var isBlockHiddenAtViewport = (state, clientId, viewport) => {
440
+ if (isBlockHiddenEverywhere(state, clientId)) {
441
+ return true;
432
442
  }
433
- return clientIds.some((clientId) => {
434
- if (!clientId) {
435
- return false;
436
- }
437
- const attributes = state.blocks.attributes.get(clientId);
438
- const blockVisibility = attributes?.metadata?.blockVisibility;
439
- if (typeof blockVisibility === "boolean") {
440
- return blockVisibility === false;
441
- }
442
- if ("object" !== typeof blockVisibility) {
443
- return false;
444
- }
445
- return import_constants2.BLOCK_VISIBILITY_VIEWPORT_ENTRIES.some(
446
- ([, { key }]) => blockVisibility?.[key] === false
447
- );
448
- });
443
+ const attributes = state.blocks.attributes.get(clientId);
444
+ const blockVisibilityViewport = attributes?.metadata?.blockVisibility?.viewport;
445
+ if (typeof blockVisibilityViewport === "object" && blockVisibilityViewport !== null && typeof viewport === "string") {
446
+ return blockVisibilityViewport?.[viewport.toLowerCase()] === false;
447
+ }
448
+ return false;
449
+ };
450
+ var isBlockParentHiddenAtViewport = (state, clientId, viewport) => {
451
+ const parents = (0, import_selectors.getBlockParents)(state, clientId);
452
+ return parents.some(
453
+ (parentId) => isBlockHiddenAtViewport(state, parentId, viewport)
454
+ );
449
455
  };
450
456
  function hasBlockSpotlight(state) {
451
457
  return !!state.hasBlockSpotlight || !!state.editedContentOnlySection;
@@ -477,8 +483,6 @@ function isLockedBlock(state, clientId) {
477
483
  }
478
484
  // Annotate the CommonJS export names for ESM import in node:
479
485
  0 && (module.exports = {
480
- areBlocksHidden,
481
- areBlocksHiddenAnywhere,
482
486
  getAllPatterns,
483
487
  getBlockRemovalRules,
484
488
  getBlockSettings,
@@ -505,8 +509,12 @@ function isLockedBlock(state, clientId) {
505
509
  getZoomLevel,
506
510
  hasAllowedPatterns,
507
511
  hasBlockSpotlight,
508
- isBlockHidden,
512
+ isBlockHiddenAnywhere,
513
+ isBlockHiddenAtViewport,
514
+ isBlockHiddenEverywhere,
509
515
  isBlockInterfaceHidden,
516
+ isBlockParentHiddenAtViewport,
517
+ isBlockParentHiddenEverywhere,
510
518
  isBlockSubtreeDisabled,
511
519
  isContainerInsertableToInContentOnlyMode,
512
520
  isDragging,
@@ -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\tisIsolatedEditorKey,\n\tdeviceTypeKey,\n} from './private-keys';\nimport {\n\tBLOCK_VISIBILITY_VIEWPORT_ENTRIES,\n\tBLOCK_VISIBILITY_VIEWPORTS,\n} from '../components/block-visibility/constants';\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 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 * A block is considered hidden if:\n * - blockVisibility is false (hidden everywhere)\n * - blockVisibility is an object with the current device preview set to false\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( blockName, 'visibility', true ) ) {\n\t\treturn false;\n\t}\n\tconst attributes = state.blocks.attributes.get( clientId );\n\tconst blockVisibility = attributes?.metadata?.blockVisibility;\n\n\tif ( blockVisibility === false ) {\n\t\treturn true;\n\t}\n\n\tif ( ! window.__experimentalHideBlocksBasedOnScreenSize ) {\n\t\treturn false;\n\t}\n\n\t// Check viewport-specific hiding based on current device preview\n\t// Only apply when a device is explicitly selected.\n\tif ( typeof blockVisibility === 'object' && blockVisibility !== null ) {\n\t\tconst settings = getSettings( state );\n\t\tconst viewportType =\n\t\t\tsettings[ deviceTypeKey ] ?? BLOCK_VISIBILITY_VIEWPORTS.desktop.key;\n\t\tconst viewportKey = viewportType.toLowerCase();\n\t\treturn blockVisibility?.[ viewportKey ] === false;\n\t}\n\n\treturn false;\n};\n\n/**\n * Returns true if any of the provided blocks are hidden.\n *\n * @param {Object} state Global application state.\n * @param {Array} clientIds Array of block client IDs to check.\n * @return {boolean} Whether any block is hidden.\n */\nexport const areBlocksHidden = ( state, clientIds ) => {\n\tif ( ! clientIds || clientIds.length === 0 ) {\n\t\treturn false;\n\t}\n\treturn clientIds.some( ( clientId ) => isBlockHidden( state, clientId ) );\n};\n\n/**\n * Checks if at least one block in an array is hidden according to viewport visibility metadata.\n *\n * This is typically used to determine if the block visibility button should be shown in the toolbar.\n * TODO: This is temporary for now. Later the UI will\n * want to know where exactly the block is hidden, e.g., to display icons or other things.\n *\n * A block is considered hidden if:\n * - Its `blockVisibility` metadata is `false` (hidden everywhere), or\n * - Any viewport is set to `false`\n *\n * @param {Object} state Global application state.\n * @param {Array} clientIds Array of block client IDs to check.\n * @return {boolean} `true` if at least one block meets the visibility criteria, `false` otherwise.\n */\nexport const areBlocksHiddenAnywhere = ( state, clientIds ) => {\n\tif ( ! clientIds?.length ) {\n\t\treturn false;\n\t}\n\treturn clientIds.some( ( clientId ) => {\n\t\tif ( ! clientId ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst attributes = state.blocks.attributes.get( clientId );\n\t\tconst blockVisibility = attributes?.metadata?.blockVisibility;\n\n\t\t// If explicitly hidden everywhere (false), return true.\n\t\tif ( typeof blockVisibility === 'boolean' ) {\n\t\t\treturn blockVisibility === false;\n\t\t}\n\n\t\t// If not an object, block is not hidden in any viewport.\n\t\tif ( 'object' !== typeof blockVisibility ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check viewport-specific visibility.\n\t\treturn BLOCK_VISIBILITY_VIEWPORT_ENTRIES.some(\n\t\t\t( [ , { key } ] ) => blockVisibility?.[ key ] === false\n\t\t);\n\t} );\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": ";;;;;;;;;;;;;;;;;;;;A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AmB,GAAI,MAAM;AAAA,IACnD;AAAA,EACD,CAAE;AACH;AAYO,SAAS,kBAAmB,OAAQ;AAC1C,SAAO,CAAC,CAAE,MAAM,qBAAqB,CAAC,CAAE,MAAM;AAC/C;AAkBO,SAAS,kBAAmB,OAAO,UAAW;AACpD,QAAM,iBAAa,qCAAoB,OAAO,QAAS;AACvD,SAAO,CAAC,CAAE,YAAY,MAAM;AAC7B;AAiBO,SAAS,kBAAmB,OAAO,UAAW;AACpD,QAAM,iBAAa,qCAAoB,OAAO,QAAS;AAGvD,MAAK,YAAY,MAAM,SAAS,QAAY;AAC3C,WAAO,CAAC,CAAE,YAAY,MAAM;AAAA,EAC7B;AAEA,QAAM,mBAAe,uCAAsB,OAAO,QAAS;AAC3D,QAAM,mBAAe,kCAAiB,OAAO,YAAa;AAK1D,SAAO,iBAAiB;AACzB;AAiBO,SAAS,oBAAqB,OAAO,UAAW;AACtD,QAAM,iBAAa,qCAAoB,OAAO,QAAS;AACvD,MAAK,YAAY,MAAM,WAAW,QAAY;AAC7C,WAAO,CAAC,CAAE,YAAY,MAAM;AAAA,EAC7B;AAEA,QAAM,mBAAe,uCAAsB,OAAO,QAAS;AAC3D,QAAM,mBAAe,kCAAiB,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';\nimport { BLOCK_VISIBILITY_VIEWPORTS } from '../components/block-visibility/constants';\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 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 anywhere, or false otherwise.\n *\n * This selector checks whether a block has visibility metadata set that would\n * hide it at any viewport or everywhere. It's useful for flagging blocks that\n * have visibility restrictions.\n *\n * A block is considered hidden anywhere if:\n * - blockVisibility is false (hidden everywhere)\n * - blockVisibility.viewport has any viewport set to false (hidden at specific screen sizes)\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 anywhere.\n */\nexport const isBlockHiddenAnywhere = ( state, clientId ) => {\n\tconst blockName = getBlockName( state, clientId );\n\tif ( ! hasBlockSupport( blockName, 'visibility', true ) ) {\n\t\treturn false;\n\t}\n\tconst attributes = state.blocks.attributes.get( clientId );\n\tconst blockVisibility = attributes?.metadata?.blockVisibility;\n\n\tif ( blockVisibility === false ) {\n\t\treturn true;\n\t}\n\n\tif (\n\t\ttypeof blockVisibility?.viewport === 'object' &&\n\t\tblockVisibility?.viewport !== null\n\t) {\n\t\t// Check if the block is hidden at any viewport.\n\t\treturn Object.values( BLOCK_VISIBILITY_VIEWPORTS ).some(\n\t\t\t( viewport ) =>\n\t\t\t\tblockVisibility?.viewport?.[ viewport.key ] === false\n\t\t);\n\t}\n\treturn false;\n};\n\n/**\n * Returns true if the block is hidden everywhere (blockVisibility is false).\n *\n * A block is considered hidden everywhere when blockVisibility is explicitly\n * set to false, which means it's hidden on all viewports.\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 everywhere.\n */\nexport const isBlockHiddenEverywhere = ( state, clientId ) => {\n\tconst blockName = getBlockName( state, clientId );\n\tif ( ! hasBlockSupport( blockName, 'visibility', true ) ) {\n\t\treturn false;\n\t}\n\tconst attributes = state.blocks.attributes.get( clientId );\n\tconst blockVisibility = attributes?.metadata?.blockVisibility;\n\n\tif ( blockVisibility === false ) {\n\t\treturn true;\n\t}\n\treturn false;\n};\n\n/**\n * Returns true if any parent block (immediate or further up the chain) is hidden everywhere.\n *\n * Checks all parent blocks in the hierarchy and returns true if any of them\n * is hidden everywhere.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId Client ID of the block.\n *\n * @return {boolean} Whether any parent block is hidden everywhere.\n */\nexport const isBlockParentHiddenEverywhere = ( state, clientId ) => {\n\tconst parents = getBlockParents( state, clientId );\n\treturn parents.some( ( parentId ) =>\n\t\tisBlockHiddenEverywhere( state, parentId )\n\t);\n};\n\n/**\n * Returns true if the block is hidden at the given viewport.\n *\n * A block is considered hidden at a viewport if:\n * - blockVisibility is false (hidden everywhere)\n * - blockVisibility is an object with the specified viewport set to false\n *\n * @param {Object} state Global application state.\n * @param {string} clientId Client ID of the block.\n * @param {string} viewport Viewport to check ('desktop', 'tablet', 'mobile').\n *\n * @return {boolean} Whether the block is hidden at the viewport.\n */\nexport const isBlockHiddenAtViewport = ( state, clientId, viewport ) => {\n\tif ( isBlockHiddenEverywhere( state, clientId ) ) {\n\t\treturn true;\n\t}\n\n\tconst attributes = state.blocks.attributes.get( clientId );\n\tconst blockVisibilityViewport =\n\t\tattributes?.metadata?.blockVisibility?.viewport;\n\tif (\n\t\ttypeof blockVisibilityViewport === 'object' &&\n\t\tblockVisibilityViewport !== null &&\n\t\ttypeof viewport === 'string'\n\t) {\n\t\treturn blockVisibilityViewport?.[ viewport.toLowerCase() ] === false;\n\t}\n\treturn false;\n};\n\n/**\n * Returns true if any parent block (immediate or further up the chain) is hidden at the given viewport.\n *\n * Checks all parent blocks in the hierarchy and returns true if any of them\n * is hidden at the specified viewport.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId Client ID of the block.\n * @param {string} viewport Viewport to check ('desktop', 'tablet', 'mobile').\n *\n * @return {boolean} Whether any parent block is hidden at the viewport.\n */\nexport const isBlockParentHiddenAtViewport = ( state, clientId, viewport ) => {\n\tconst parents = getBlockParents( state, clientId );\n\treturn parents.some( ( parentId ) =>\n\t\tisBlockHiddenAtViewport( state, parentId, viewport )\n\t);\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": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAuD;AACvD,oBAGO;AAKP,uBAWO;AACP,mBAMO;AACP,uBAA2B;AAC3B,yBAAuB;AACvB,0BAKO;AACP,IAAAA,oBAA2C;AAI3C,gCAAiC;AAFjC,IAAM,EAAE,eAAe,QAAI,2BAAQ,cAAAC,WAAkB;AAW9C,S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BO,SAAS,kBAAmB,OAAO,UAAW;AACpD,QAAM,iBAAa,qCAAoB,OAAO,QAAS;AAGvD,MAAK,YAAY,MAAM,SAAS,QAAY;AAC3C,WAAO,CAAC,CAAE,YAAY,MAAM;AAAA,EAC7B;AAEA,QAAM,mBAAe,uCAAsB,OAAO,QAAS;AAC3D,QAAM,mBAAe,kCAAiB,OAAO,YAAa;AAK1D,SAAO,iBAAiB;AACzB;AAiBO,SAAS,oBAAqB,OAAO,UAAW;AACtD,QAAM,iBAAa,qCAAoB,OAAO,QAAS;AACvD,MAAK,YAAY,MAAM,WAAW,QAAY;AAC7C,WAAO,CAAC,CAAE,YAAY,MAAM;AAAA,EAC7B;AAEA,QAAM,mBAAe,uCAAsB,OAAO,QAAS;AAC3D,QAAM,mBAAe,kCAAiB,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": ["import_constants", "blocksPrivateApis", "getAllPatterns"]
7
7
  }
@@ -33,13 +33,17 @@ function findOptimalFontSize(textElement, applyFontSize) {
33
33
  const paddingRight = parseFloat(computedStyle.paddingRight) || 0;
34
34
  const range = document.createRange();
35
35
  range.selectNodeContents(textElement);
36
+ let maxclientHeight = textElement.clientHeight;
36
37
  while (minSize <= maxSize) {
37
38
  const midSize = Math.floor((minSize + maxSize) / 2);
38
39
  applyFontSize(midSize);
39
40
  const rect = range.getBoundingClientRect();
40
41
  const textWidth = rect.width;
41
42
  const fitsWidth = textElement.scrollWidth <= textElement.clientWidth && textWidth <= textElement.clientWidth - paddingLeft - paddingRight;
42
- const fitsHeight = alreadyHasScrollableHeight || textElement.scrollHeight <= textElement.clientHeight;
43
+ const fitsHeight = alreadyHasScrollableHeight || textElement.scrollHeight <= textElement.clientHeight || textElement.scrollHeight <= maxclientHeight;
44
+ if (textElement.clientHeight > maxclientHeight) {
45
+ maxclientHeight = textElement.clientHeight;
46
+ }
43
47
  if (fitsWidth && fitsHeight) {
44
48
  bestSize = midSize;
45
49
  minSize = midSize + 1;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/utils/fit-text-utils.js"],
4
- "sourcesContent": ["/**\n * Shared utility functions for fit text functionality.\n * Uses callback-based approach for maximum code reuse between editor and frontend.\n */\n\n/**\n * Find optimal font size using simple binary search between 0-2400px.\n *\n * @param {HTMLElement} textElement The text element\n * @param {Function} applyFontSize Function that receives font size in pixels\n * @return {number} Optimal font size\n */\nfunction findOptimalFontSize( textElement, applyFontSize ) {\n\tconst alreadyHasScrollableHeight =\n\t\ttextElement.scrollHeight > textElement.clientHeight;\n\tlet minSize = 0;\n\tlet maxSize = 2400;\n\tlet bestSize = minSize;\n\n\tconst computedStyle = window.getComputedStyle( textElement );\n\tconst paddingLeft = parseFloat( computedStyle.paddingLeft ) || 0;\n\tconst paddingRight = parseFloat( computedStyle.paddingRight ) || 0;\n\tconst range = document.createRange();\n\trange.selectNodeContents( textElement );\n\n\twhile ( minSize <= maxSize ) {\n\t\tconst midSize = Math.floor( ( minSize + maxSize ) / 2 );\n\t\tapplyFontSize( midSize );\n\n\t\t// When there is padding if the text overflows to the\n\t\t// padding area, it should be considered overflowing.\n\t\t// Use Range API to measure actual text content dimensions.\n\t\tconst rect = range.getBoundingClientRect();\n\t\tconst textWidth = rect.width;\n\n\t\t// Check if text fits within the element's width and is not\n\t\t// overflowing into the padding area.\n\t\tconst fitsWidth =\n\t\t\ttextElement.scrollWidth <= textElement.clientWidth &&\n\t\t\ttextWidth <= textElement.clientWidth - paddingLeft - paddingRight;\n\t\t// Check if text fits within the element's height.\n\t\tconst fitsHeight =\n\t\t\talreadyHasScrollableHeight ||\n\t\t\ttextElement.scrollHeight <= textElement.clientHeight;\n\n\t\tif ( fitsWidth && fitsHeight ) {\n\t\t\tbestSize = midSize;\n\t\t\tminSize = midSize + 1;\n\t\t} else {\n\t\t\tmaxSize = midSize - 1;\n\t\t}\n\t}\n\trange.detach();\n\n\treturn bestSize;\n}\n\n/**\n * Complete fit text optimization for a single text element.\n * Handles the full flow using callbacks for font size application.\n *\n * @param {HTMLElement} textElement The text element (paragraph, heading, etc.)\n * @param {Function} applyFontSize Function that receives font size in pixels (0 to clear, >0 to apply)\n */\nexport function optimizeFitText( textElement, applyFontSize ) {\n\tif ( ! textElement ) {\n\t\treturn;\n\t}\n\n\tapplyFontSize( 0 );\n\n\tconst optimalSize = findOptimalFontSize( textElement, applyFontSize );\n\n\tapplyFontSize( optimalSize );\n\treturn optimalSize;\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAYA,SAAS,oBAAqB,aAAa,eAAgB;AAC1D,QAAM,6BACL,YAAY,eAAe,YAAY;AACxC,MAAI,UAAU;AACd,MAAI,UAAU;AACd,MAAI,WAAW;AAEf,QAAM,gBAAgB,OAAO,iBAAkB,WAAY;AAC3D,QAAM,cAAc,WAAY,cAAc,WAAY,KAAK;AAC/D,QAAM,eAAe,WAAY,cAAc,YAAa,KAAK;AACjE,QAAM,QAAQ,SAAS,YAAY;AACnC,QAAM,mBAAoB,WAAY;AAEtC,SAAQ,WAAW,SAAU;AAC5B,UAAM,UAAU,KAAK,OAAS,UAAU,WAAY,CAAE;AACtD,kBAAe,OAAQ;AAKvB,UAAM,OAAO,MAAM,sBAAsB;AACzC,UAAM,YAAY,KAAK;AAIvB,UAAM,YACL,YAAY,eAAe,YAAY,eACvC,aAAa,YAAY,cAAc,cAAc;AAEtD,UAAM,aACL,8BACA,YAAY,gBAAgB,YAAY;AAEzC,QAAK,aAAa,YAAa;AAC9B,iBAAW;AACX,gBAAU,UAAU;AAAA,IACrB,OAAO;AACN,gBAAU,UAAU;AAAA,IACrB;AAAA,EACD;AACA,QAAM,OAAO;AAEb,SAAO;AACR;AASO,SAAS,gBAAiB,aAAa,eAAgB;AAC7D,MAAK,CAAE,aAAc;AACpB;AAAA,EACD;AAEA,gBAAe,CAAE;AAEjB,QAAM,cAAc,oBAAqB,aAAa,aAAc;AAEpE,gBAAe,WAAY;AAC3B,SAAO;AACR;",
4
+ "sourcesContent": ["/**\n * Shared utility functions for fit text functionality.\n * Uses callback-based approach for maximum code reuse between editor and frontend.\n */\n\n/**\n * Find optimal font size using simple binary search between 0-2400px.\n *\n * @param {HTMLElement} textElement The text element\n * @param {Function} applyFontSize Function that receives font size in pixels\n * @return {number} Optimal font size\n */\nfunction findOptimalFontSize( textElement, applyFontSize ) {\n\tconst alreadyHasScrollableHeight =\n\t\ttextElement.scrollHeight > textElement.clientHeight;\n\tlet minSize = 0;\n\tlet maxSize = 2400;\n\tlet bestSize = minSize;\n\n\tconst computedStyle = window.getComputedStyle( textElement );\n\tconst paddingLeft = parseFloat( computedStyle.paddingLeft ) || 0;\n\tconst paddingRight = parseFloat( computedStyle.paddingRight ) || 0;\n\tconst range = document.createRange();\n\trange.selectNodeContents( textElement );\n\tlet maxclientHeight = textElement.clientHeight;\n\twhile ( minSize <= maxSize ) {\n\t\tconst midSize = Math.floor( ( minSize + maxSize ) / 2 );\n\t\tapplyFontSize( midSize );\n\n\t\t// When there is padding if the text overflows to the\n\t\t// padding area, it should be considered overflowing.\n\t\t// Use Range API to measure actual text content dimensions.\n\t\tconst rect = range.getBoundingClientRect();\n\t\tconst textWidth = rect.width;\n\n\t\t// Check if text fits within the element's width and is not\n\t\t// overflowing into the padding area.\n\t\tconst fitsWidth =\n\t\t\ttextElement.scrollWidth <= textElement.clientWidth &&\n\t\t\ttextWidth <= textElement.clientWidth - paddingLeft - paddingRight;\n\t\t// Check if text fits within the element's height.\n\t\tconst fitsHeight =\n\t\t\talreadyHasScrollableHeight ||\n\t\t\ttextElement.scrollHeight <= textElement.clientHeight ||\n\t\t\ttextElement.scrollHeight <= maxclientHeight;\n\n\t\t// When there are calculated line heights, text may jump in height\n\t\t// the available space may decrease while the font size decreases,\n\t\t// making text not fit.\n\t\t// We store a maximum reference height: the maximum reference element height that was observed\n\t\t// during the loop to avoid issues with such jumps.\n\t\tif ( textElement.clientHeight > maxclientHeight ) {\n\t\t\tmaxclientHeight = textElement.clientHeight;\n\t\t}\n\n\t\tif ( fitsWidth && fitsHeight ) {\n\t\t\tbestSize = midSize;\n\t\t\tminSize = midSize + 1;\n\t\t} else {\n\t\t\tmaxSize = midSize - 1;\n\t\t}\n\t}\n\trange.detach();\n\n\treturn bestSize;\n}\n\n/**\n * Complete fit text optimization for a single text element.\n * Handles the full flow using callbacks for font size application.\n *\n * @param {HTMLElement} textElement The text element (paragraph, heading, etc.)\n * @param {Function} applyFontSize Function that receives font size in pixels (0 to clear, >0 to apply)\n */\nexport function optimizeFitText( textElement, applyFontSize ) {\n\tif ( ! textElement ) {\n\t\treturn;\n\t}\n\n\tapplyFontSize( 0 );\n\n\tconst optimalSize = findOptimalFontSize( textElement, applyFontSize );\n\n\tapplyFontSize( optimalSize );\n\treturn optimalSize;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAYA,SAAS,oBAAqB,aAAa,eAAgB;AAC1D,QAAM,6BACL,YAAY,eAAe,YAAY;AACxC,MAAI,UAAU;AACd,MAAI,UAAU;AACd,MAAI,WAAW;AAEf,QAAM,gBAAgB,OAAO,iBAAkB,WAAY;AAC3D,QAAM,cAAc,WAAY,cAAc,WAAY,KAAK;AAC/D,QAAM,eAAe,WAAY,cAAc,YAAa,KAAK;AACjE,QAAM,QAAQ,SAAS,YAAY;AACnC,QAAM,mBAAoB,WAAY;AACtC,MAAI,kBAAkB,YAAY;AAClC,SAAQ,WAAW,SAAU;AAC5B,UAAM,UAAU,KAAK,OAAS,UAAU,WAAY,CAAE;AACtD,kBAAe,OAAQ;AAKvB,UAAM,OAAO,MAAM,sBAAsB;AACzC,UAAM,YAAY,KAAK;AAIvB,UAAM,YACL,YAAY,eAAe,YAAY,eACvC,aAAa,YAAY,cAAc,cAAc;AAEtD,UAAM,aACL,8BACA,YAAY,gBAAgB,YAAY,gBACxC,YAAY,gBAAgB;AAO7B,QAAK,YAAY,eAAe,iBAAkB;AACjD,wBAAkB,YAAY;AAAA,IAC/B;AAEA,QAAK,aAAa,YAAa;AAC9B,iBAAW;AACX,gBAAU,UAAU;AAAA,IACrB,OAAO;AACN,gBAAU,UAAU;AAAA,IACrB;AAAA,EACD;AACA,QAAM,OAAO;AAEb,SAAO;AACR;AASO,SAAS,gBAAiB,aAAa,eAAgB;AAC7D,MAAK,CAAE,aAAc;AACpB;AAAA,EACD;AAEA,gBAAe,CAAE;AAEjB,QAAM,cAAc,oBAAqB,aAAa,aAAc;AAEpE,gBAAe,WAAY;AAC3B,SAAO;AACR;",
6
6
  "names": []
7
7
  }
@@ -7,7 +7,7 @@ BlockControls.Slot = BlockControlsSlot;
7
7
  var BlockFormatControls = (props) => {
8
8
  return /* @__PURE__ */ jsx(BlockControlsFill, { group: "inline", ...props });
9
9
  };
10
- BlockFormatControls.Slot = (props) => {
10
+ BlockFormatControls.Slot = function Slot(props) {
11
11
  return /* @__PURE__ */ jsx(BlockControlsSlot, { group: "inline", ...props });
12
12
  };
13
13
  var block_controls_default = BlockControls;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/block-controls/index.js"],
4
- "sourcesContent": ["/**\n * Internal dependencies\n */\nimport BlockControlsFill from './fill';\nimport BlockControlsSlot from './slot';\n\nconst BlockControls = BlockControlsFill;\n\nBlockControls.Slot = BlockControlsSlot;\n\n// This is just here for backward compatibility.\nexport const BlockFormatControls = ( props ) => {\n\treturn <BlockControlsFill group=\"inline\" { ...props } />;\n};\nBlockFormatControls.Slot = ( props ) => {\n\treturn <BlockControlsSlot group=\"inline\" { ...props } />;\n};\n\nexport default BlockControls;\n"],
5
- "mappings": ";AAGA,OAAO,uBAAuB;AAC9B,OAAO,uBAAuB;AAQtB;AANR,IAAM,gBAAgB;AAEtB,cAAc,OAAO;AAGd,IAAM,sBAAsB,CAAE,UAAW;AAC/C,SAAO,oBAAC,qBAAkB,OAAM,UAAW,GAAG,OAAQ;AACvD;AACA,oBAAoB,OAAO,CAAE,UAAW;AACvC,SAAO,oBAAC,qBAAkB,OAAM,UAAW,GAAG,OAAQ;AACvD;AAEA,IAAO,yBAAQ;",
4
+ "sourcesContent": ["/**\n * Internal dependencies\n */\nimport BlockControlsFill from './fill';\nimport BlockControlsSlot from './slot';\n\nconst BlockControls = BlockControlsFill;\n\nBlockControls.Slot = BlockControlsSlot;\n\n// This is just here for backward compatibility.\nexport const BlockFormatControls = ( props ) => {\n\treturn <BlockControlsFill group=\"inline\" { ...props } />;\n};\nBlockFormatControls.Slot = function Slot( props ) {\n\treturn <BlockControlsSlot group=\"inline\" { ...props } />;\n};\n\nexport default BlockControls;\n"],
5
+ "mappings": ";AAGA,OAAO,uBAAuB;AAC9B,OAAO,uBAAuB;AAQtB;AANR,IAAM,gBAAgB;AAEtB,cAAc,OAAO;AAGd,IAAM,sBAAsB,CAAE,UAAW;AAC/C,SAAO,oBAAC,qBAAkB,OAAM,UAAW,GAAG,OAAQ;AACvD;AACA,oBAAoB,OAAO,SAAS,KAAM,OAAQ;AACjD,SAAO,oBAAC,qBAAkB,OAAM,UAAW,GAAG,OAAQ;AACvD;AAEA,IAAO,yBAAQ;",
6
6
  "names": []
7
7
  }
@@ -23,7 +23,7 @@ import PositionControls from "../inspector-controls-tabs/position-controls-panel
23
23
  import useBlockInspectorAnimationSettings from "./useBlockInspectorAnimationSettings.mjs";
24
24
  import { useBorderPanelLabel } from "../../hooks/border.mjs";
25
25
  import ContentTab from "../inspector-controls-tabs/content-tab.mjs";
26
- import BlockVisibilityInfo from "../block-visibility/block-visibility-info.mjs";
26
+ import ViewportVisibilityInfo from "../block-visibility/viewport-visibility-info.mjs";
27
27
  import { unlock } from "../../lock-unlock.mjs";
28
28
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
29
29
  function StyleInspectorSlots({
@@ -74,7 +74,6 @@ function StyleInspectorSlots({
74
74
  function BlockInspector() {
75
75
  const {
76
76
  selectedBlockCount,
77
- selectedBlockClientId,
78
77
  renderedBlockName,
79
78
  renderedBlockClientId,
80
79
  blockType,
@@ -109,7 +108,6 @@ function BlockInspector() {
109
108
  const _hasBlockStyles = blockStyles && blockStyles.length > 0;
110
109
  return {
111
110
  selectedBlockCount: getSelectedBlockCount(),
112
- selectedBlockClientId: _selectedBlockClientId,
113
111
  renderedBlockClientId: _renderedBlockClientId,
114
112
  renderedBlockName: _renderedBlockName,
115
113
  blockType: _blockType,
@@ -197,7 +195,6 @@ function BlockInspector() {
197
195
  BlockInspectorSingleBlock,
198
196
  {
199
197
  renderedBlockClientId,
200
- selectedBlockClientId,
201
198
  blockName: blockType.name,
202
199
  isSectionBlock,
203
200
  availableTabs,
@@ -242,10 +239,6 @@ var BlockInspectorSingleBlock = ({
242
239
  // The block that is displayed in the inspector. This is the block whose
243
240
  // controls and information are shown to the user.
244
241
  renderedBlockClientId,
245
- // The actual block that is selected in the editor. This may or may not
246
- // be the same as the rendered block (e.g., when a child block is selected
247
- // but its parent section block is the main one rendered in the inspector).
248
- selectedBlockClientId,
249
242
  blockName,
250
243
  isSectionBlock,
251
244
  availableTabs,
@@ -262,8 +255,6 @@ var BlockInspectorSingleBlock = ({
262
255
  renderedBlockClientId
263
256
  );
264
257
  const isBlockSynced = blockInformation.isSynced;
265
- const shouldShowTabs = !isBlockSynced && hasMultipleTabs;
266
- const isSectionBlockSelected = window?.__experimentalContentOnlyPatternInsertion && selectedBlockClientId === renderedBlockClientId;
267
258
  return /* @__PURE__ */ jsxs("div", { className: "block-editor-block-inspector", children: [
268
259
  hasParentChildBlockCards && /* @__PURE__ */ jsx(
269
260
  BlockCard,
@@ -283,10 +274,10 @@ var BlockInspectorSingleBlock = ({
283
274
  clientId: renderedBlockClientId
284
275
  }
285
276
  ),
286
- /* @__PURE__ */ jsx(BlockVisibilityInfo, { clientId: renderedBlockClientId }),
277
+ /* @__PURE__ */ jsx(ViewportVisibilityInfo, { clientId: renderedBlockClientId }),
287
278
  window?.__experimentalContentOnlyPatternInsertion && /* @__PURE__ */ jsx(EditContents, { clientId: renderedBlockClientId }),
288
279
  /* @__PURE__ */ jsx(BlockVariationTransforms, { blockClientId: renderedBlockClientId }),
289
- shouldShowTabs && /* @__PURE__ */ jsx(
280
+ hasMultipleTabs && /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
290
281
  InspectorControlsTabs,
291
282
  {
292
283
  hasBlockStyles,
@@ -296,17 +287,13 @@ var BlockInspectorSingleBlock = ({
296
287
  isSectionBlock,
297
288
  contentClientIds
298
289
  }
299
- ),
300
- !shouldShowTabs && /* @__PURE__ */ jsxs(Fragment, { children: [
290
+ ) }),
291
+ !hasMultipleTabs && /* @__PURE__ */ jsxs(Fragment, { children: [
301
292
  hasBlockStyles && /* @__PURE__ */ jsx(BlockStyles, { clientId: renderedBlockClientId }),
302
293
  /* @__PURE__ */ jsx(ContentTab, { contentClientIds }),
303
294
  /* @__PURE__ */ jsx(InspectorControls.Slot, { group: "content" }),
304
295
  /* @__PURE__ */ jsx(InspectorControls.Slot, { group: "list" }),
305
- !isSectionBlock && /* @__PURE__ */ jsx(StyleInspectorSlots, { blockName }),
306
- isSectionBlock && isBlockSynced && isSectionBlockSelected && /* @__PURE__ */ jsxs(Fragment, { children: [
307
- /* @__PURE__ */ jsx(InspectorControls.Slot, {}),
308
- /* @__PURE__ */ jsx(AdvancedControls, {})
309
- ] })
296
+ !isSectionBlock && /* @__PURE__ */ jsx(StyleInspectorSlots, { blockName })
310
297
  ] }),
311
298
  /* @__PURE__ */ jsx(SkipToSelectedBlock, {}, "back")
312
299
  ] });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/block-inspector/index.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tgetBlockType,\n\tgetUnregisteredTypeHandlerName,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport { __unstableMotion as motion } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport EditContents from './edit-contents';\nimport SkipToSelectedBlock from '../skip-to-selected-block';\nimport BlockCard from '../block-card';\nimport MultiSelectionInspector from '../multi-selection-inspector';\nimport BlockVariationTransforms from '../block-variation-transforms';\nimport useBlockDisplayInformation from '../use-block-display-information';\nimport { store as blockEditorStore } from '../../store';\nimport BlockStyles from '../block-styles';\nimport { default as InspectorControls } from '../inspector-controls';\nimport { default as InspectorControlsTabs } from '../inspector-controls-tabs';\nimport useInspectorControlsTabs from '../inspector-controls-tabs/use-inspector-controls-tabs';\nimport AdvancedControls from '../inspector-controls-tabs/advanced-controls-panel';\nimport PositionControls from '../inspector-controls-tabs/position-controls-panel';\nimport useBlockInspectorAnimationSettings from './useBlockInspectorAnimationSettings';\nimport { useBorderPanelLabel } from '../../hooks/border';\nimport ContentTab from '../inspector-controls-tabs/content-tab';\nimport BlockVisibilityInfo from '../block-visibility/block-visibility-info';\nimport { unlock } from '../../lock-unlock';\n\nfunction StyleInspectorSlots( {\n\tblockName,\n\tshowAdvancedControls = true,\n\tshowPositionControls = true,\n\tshowBindingsControls = true,\n} ) {\n\tconst borderPanelLabel = useBorderPanelLabel( { blockName } );\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls.Slot />\n\t\t\t<InspectorControls.Slot\n\t\t\t\tgroup=\"color\"\n\t\t\t\tlabel={ __( 'Color' ) }\n\t\t\t\tclassName=\"color-block-support-panel__inner-wrapper\"\n\t\t\t/>\n\t\t\t<InspectorControls.Slot\n\t\t\t\tgroup=\"background\"\n\t\t\t\tlabel={ __( 'Background image' ) }\n\t\t\t/>\n\t\t\t<InspectorControls.Slot\n\t\t\t\tgroup=\"typography\"\n\t\t\t\tlabel={ __( 'Typography' ) }\n\t\t\t/>\n\t\t\t<InspectorControls.Slot\n\t\t\t\tgroup=\"dimensions\"\n\t\t\t\tlabel={ __( 'Dimensions' ) }\n\t\t\t/>\n\t\t\t<InspectorControls.Slot group=\"border\" label={ borderPanelLabel } />\n\t\t\t<InspectorControls.Slot group=\"styles\" />\n\t\t\t{ showPositionControls && <PositionControls /> }\n\t\t\t{ showBindingsControls && (\n\t\t\t\t<InspectorControls.Slot group=\"bindings\" />\n\t\t\t) }\n\t\t\t{ showAdvancedControls && (\n\t\t\t\t<div>\n\t\t\t\t\t<AdvancedControls />\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction BlockInspector() {\n\tconst {\n\t\tselectedBlockCount,\n\t\tselectedBlockClientId,\n\t\trenderedBlockName,\n\t\trenderedBlockClientId,\n\t\tblockType,\n\t\tisSectionBlock,\n\t\tisSectionBlockInSelection,\n\t\thasBlockStyles,\n\t\teditedContentOnlySection,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetSelectedBlockClientId,\n\t\t\tgetSelectedBlockClientIds,\n\t\t\tgetSelectedBlockCount,\n\t\t\tgetBlockName,\n\t\t\tgetParentSectionBlock,\n\t\t\tisSectionBlock: _isSectionBlock,\n\t\t\tgetEditedContentOnlySection,\n\t\t\tisWithinEditedContentOnlySection,\n\t\t} = unlock( select( blockEditorStore ) );\n\t\tconst { getBlockStyles } = select( blocksStore );\n\t\tconst _selectedBlockClientId = getSelectedBlockClientId();\n\t\tconst isWithinEditedSection = isWithinEditedContentOnlySection(\n\t\t\t_selectedBlockClientId\n\t\t);\n\t\tconst _renderedBlockClientId = isWithinEditedSection\n\t\t\t? _selectedBlockClientId\n\t\t\t: getParentSectionBlock( _selectedBlockClientId ) ||\n\t\t\t _selectedBlockClientId;\n\t\tconst _renderedBlockName =\n\t\t\t_renderedBlockClientId && getBlockName( _renderedBlockClientId );\n\t\tconst _blockType =\n\t\t\t_renderedBlockName && getBlockType( _renderedBlockName );\n\t\tconst selectedBlockClientIds = getSelectedBlockClientIds();\n\t\tconst _isSectionBlockInSelection = selectedBlockClientIds.some(\n\t\t\t( id ) => _isSectionBlock( id )\n\t\t);\n\t\tconst blockStyles =\n\t\t\t_renderedBlockName && getBlockStyles( _renderedBlockName );\n\t\tconst _hasBlockStyles = blockStyles && blockStyles.length > 0;\n\n\t\treturn {\n\t\t\tselectedBlockCount: getSelectedBlockCount(),\n\t\t\tselectedBlockClientId: _selectedBlockClientId,\n\t\t\trenderedBlockClientId: _renderedBlockClientId,\n\t\t\trenderedBlockName: _renderedBlockName,\n\t\t\tblockType: _blockType,\n\t\t\tisSectionBlockInSelection: _isSectionBlockInSelection,\n\t\t\tisSectionBlock: _isSectionBlock( _renderedBlockClientId ),\n\t\t\thasBlockStyles: _hasBlockStyles,\n\t\t\teditedContentOnlySection: getEditedContentOnlySection(),\n\t\t};\n\t}, [] );\n\n\t// Separate useSelect for contentClientIds with proper dependencies\n\tconst contentClientIds = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! isSectionBlock || ! renderedBlockClientId ) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\tconst {\n\t\t\t\tgetClientIdsOfDescendants,\n\t\t\t\tgetBlockName,\n\t\t\t\tgetBlockEditingMode,\n\t\t\t} = unlock( select( blockEditorStore ) );\n\n\t\t\tconst descendants = getClientIdsOfDescendants(\n\t\t\t\trenderedBlockClientId\n\t\t\t);\n\n\t\t\t// Temporary workaround for issue #71991\n\t\t\t// Exclude Navigation block children from Content sidebar until proper\n\t\t\t// drill-down experience is implemented (see #65699)\n\t\t\t// This prevents a poor UX where all Nav block sub-items are shown\n\t\t\t// when the parent block is in contentOnly mode.\n\t\t\t// Build a Set of all navigation block descendants for efficient lookup\n\t\t\tconst navigationDescendants = new Set();\n\t\t\tdescendants.forEach( ( clientId ) => {\n\t\t\t\tif ( getBlockName( clientId ) === 'core/navigation' ) {\n\t\t\t\t\tconst navChildren = getClientIdsOfDescendants( clientId );\n\t\t\t\t\tnavChildren.forEach( ( childId ) =>\n\t\t\t\t\t\tnavigationDescendants.add( childId )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\treturn descendants.filter( ( current ) => {\n\t\t\t\t// Exclude navigation block children\n\t\t\t\tif ( navigationDescendants.has( current ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\tgetBlockName( current ) !== 'core/list-item' &&\n\t\t\t\t\tgetBlockEditingMode( current ) === 'contentOnly'\n\t\t\t\t);\n\t\t\t} );\n\t\t},\n\t\t[ isSectionBlock, renderedBlockClientId ]\n\t);\n\n\tconst availableTabs = useInspectorControlsTabs(\n\t\tblockType?.name,\n\t\tcontentClientIds,\n\t\tisSectionBlock,\n\t\thasBlockStyles\n\t);\n\tconst hasMultipleTabs = availableTabs?.length > 1;\n\n\t// The block inspector animation settings will be completely\n\t// removed in the future to create an API which allows the block\n\t// inspector to transition between what it\n\t// displays based on the relationship between the selected block\n\t// and its parent, and only enable it if the parent is controlling\n\t// its children blocks.\n\tconst blockInspectorAnimationSettings =\n\t\tuseBlockInspectorAnimationSettings( blockType );\n\n\tconst hasSelectedBlocks = selectedBlockCount > 1;\n\n\tif ( hasSelectedBlocks && ! isSectionBlockInSelection ) {\n\t\treturn (\n\t\t\t<div className=\"block-editor-block-inspector\">\n\t\t\t\t<MultiSelectionInspector />\n\t\t\t\t{ hasMultipleTabs ? (\n\t\t\t\t\t<InspectorControlsTabs tabs={ availableTabs } />\n\t\t\t\t) : (\n\t\t\t\t\t<StyleInspectorSlots\n\t\t\t\t\t\tblockName={ renderedBlockName }\n\t\t\t\t\t\tshowAdvancedControls={ false }\n\t\t\t\t\t\tshowPositionControls={ false }\n\t\t\t\t\t\tshowBindingsControls={ false }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t);\n\t}\n\n\tif ( hasSelectedBlocks && isSectionBlockInSelection ) {\n\t\treturn (\n\t\t\t<div className=\"block-editor-block-inspector\">\n\t\t\t\t<MultiSelectionInspector />\n\t\t\t</div>\n\t\t);\n\t}\n\n\tconst isRenderedBlockUnregistered =\n\t\trenderedBlockName === getUnregisteredTypeHandlerName();\n\n\t/*\n\t * If the rendered block is of an unregistered type, avoid showing it as an actual selection\n\t * because we want the user to focus on the unregistered block warning, not block settings.\n\t */\n\tconst shouldShowWarning =\n\t\t! blockType || ! renderedBlockClientId || isRenderedBlockUnregistered;\n\n\tif ( shouldShowWarning ) {\n\t\treturn (\n\t\t\t<span className=\"block-editor-block-inspector__no-blocks\">\n\t\t\t\t{ __( 'No block selected.' ) }\n\t\t\t</span>\n\t\t);\n\t}\n\n\treturn (\n\t\t<BlockInspectorSingleBlockWrapper\n\t\t\tanimate={ blockInspectorAnimationSettings }\n\t\t\twrapper={ ( children ) => (\n\t\t\t\t<AnimatedContainer\n\t\t\t\t\tblockInspectorAnimationSettings={\n\t\t\t\t\t\tblockInspectorAnimationSettings\n\t\t\t\t\t}\n\t\t\t\t\trenderedBlockClientId={ renderedBlockClientId }\n\t\t\t\t>\n\t\t\t\t\t{ children }\n\t\t\t\t</AnimatedContainer>\n\t\t\t) }\n\t\t>\n\t\t\t<BlockInspectorSingleBlock\n\t\t\t\trenderedBlockClientId={ renderedBlockClientId }\n\t\t\t\tselectedBlockClientId={ selectedBlockClientId }\n\t\t\t\tblockName={ blockType.name }\n\t\t\t\tisSectionBlock={ isSectionBlock }\n\t\t\t\tavailableTabs={ availableTabs }\n\t\t\t\tcontentClientIds={ contentClientIds }\n\t\t\t\thasBlockStyles={ hasBlockStyles }\n\t\t\t\teditedContentOnlySection={ editedContentOnlySection }\n\t\t\t/>\n\t\t</BlockInspectorSingleBlockWrapper>\n\t);\n}\n\nconst BlockInspectorSingleBlockWrapper = ( { animate, wrapper, children } ) => {\n\treturn animate ? wrapper( children ) : children;\n};\n\nconst AnimatedContainer = ( {\n\tblockInspectorAnimationSettings,\n\trenderedBlockClientId,\n\tchildren,\n} ) => {\n\tconst animationOrigin =\n\t\tblockInspectorAnimationSettings &&\n\t\tblockInspectorAnimationSettings.enterDirection === 'leftToRight'\n\t\t\t? -50\n\t\t\t: 50;\n\n\treturn (\n\t\t<motion.div\n\t\t\tanimate={ {\n\t\t\t\tx: 0,\n\t\t\t\topacity: 1,\n\t\t\t\ttransition: {\n\t\t\t\t\tease: 'easeInOut',\n\t\t\t\t\tduration: 0.14,\n\t\t\t\t},\n\t\t\t} }\n\t\t\tinitial={ {\n\t\t\t\tx: animationOrigin,\n\t\t\t\topacity: 0,\n\t\t\t} }\n\t\t\tkey={ renderedBlockClientId }\n\t\t>\n\t\t\t{ children }\n\t\t</motion.div>\n\t);\n};\n\nconst BlockInspectorSingleBlock = ( {\n\t// The block that is displayed in the inspector. This is the block whose\n\t// controls and information are shown to the user.\n\trenderedBlockClientId,\n\t// The actual block that is selected in the editor. This may or may not\n\t// be the same as the rendered block (e.g., when a child block is selected\n\t// but its parent section block is the main one rendered in the inspector).\n\tselectedBlockClientId,\n\tblockName,\n\tisSectionBlock,\n\tavailableTabs,\n\tcontentClientIds,\n\thasBlockStyles,\n\teditedContentOnlySection,\n} ) => {\n\tconst hasMultipleTabs = availableTabs?.length > 1;\n\tconst hasParentChildBlockCards =\n\t\twindow?.__experimentalContentOnlyPatternInsertion &&\n\t\teditedContentOnlySection &&\n\t\teditedContentOnlySection !== renderedBlockClientId;\n\tconst parentBlockInformation = useBlockDisplayInformation(\n\t\teditedContentOnlySection\n\t);\n\tconst blockInformation = useBlockDisplayInformation(\n\t\trenderedBlockClientId\n\t);\n\tconst isBlockSynced = blockInformation.isSynced;\n\tconst shouldShowTabs = ! isBlockSynced && hasMultipleTabs;\n\tconst isSectionBlockSelected =\n\t\twindow?.__experimentalContentOnlyPatternInsertion &&\n\t\tselectedBlockClientId === renderedBlockClientId;\n\n\treturn (\n\t\t<div className=\"block-editor-block-inspector\">\n\t\t\t{ hasParentChildBlockCards && (\n\t\t\t\t<BlockCard\n\t\t\t\t\t{ ...parentBlockInformation }\n\t\t\t\t\tclassName={ parentBlockInformation.isSynced && 'is-synced' }\n\t\t\t\t\tparentClientId={ editedContentOnlySection }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<BlockCard\n\t\t\t\t{ ...blockInformation }\n\t\t\t\tallowParentNavigation\n\t\t\t\tclassName={ isBlockSynced && 'is-synced' }\n\t\t\t\tisChild={ hasParentChildBlockCards }\n\t\t\t\tclientId={ renderedBlockClientId }\n\t\t\t/>\n\t\t\t<BlockVisibilityInfo clientId={ renderedBlockClientId } />\n\t\t\t{ window?.__experimentalContentOnlyPatternInsertion && (\n\t\t\t\t<EditContents clientId={ renderedBlockClientId } />\n\t\t\t) }\n\t\t\t<BlockVariationTransforms blockClientId={ renderedBlockClientId } />\n\t\t\t{ shouldShowTabs && (\n\t\t\t\t<InspectorControlsTabs\n\t\t\t\t\thasBlockStyles={ hasBlockStyles }\n\t\t\t\t\tclientId={ renderedBlockClientId }\n\t\t\t\t\tblockName={ blockName }\n\t\t\t\t\ttabs={ availableTabs }\n\t\t\t\t\tisSectionBlock={ isSectionBlock }\n\t\t\t\t\tcontentClientIds={ contentClientIds }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ ! shouldShowTabs && (\n\t\t\t\t<>\n\t\t\t\t\t{ hasBlockStyles && (\n\t\t\t\t\t\t<BlockStyles clientId={ renderedBlockClientId } />\n\t\t\t\t\t) }\n\t\t\t\t\t<ContentTab contentClientIds={ contentClientIds } />\n\t\t\t\t\t<InspectorControls.Slot group=\"content\" />\n\t\t\t\t\t<InspectorControls.Slot group=\"list\" />\n\t\t\t\t\t{ ! isSectionBlock && (\n\t\t\t\t\t\t<StyleInspectorSlots blockName={ blockName } />\n\t\t\t\t\t) }\n\t\t\t\t\t{ isSectionBlock &&\n\t\t\t\t\t\tisBlockSynced &&\n\t\t\t\t\t\tisSectionBlockSelected && (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<InspectorControls.Slot />\n\t\t\t\t\t\t\t\t{ /* Allow AdvancedControls so users can adjust local attributes (e.g. additional CSS classes, HTML element). */ }\n\t\t\t\t\t\t\t\t<AdvancedControls />\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t) }\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t<SkipToSelectedBlock key=\"back\" />\n\t\t</div>\n\t);\n};\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-inspector/README.md\n */\nexport default BlockInspector;\n"],
5
- "mappings": ";AAGA,SAAS,UAAU;AACnB;AAAA,EACC;AAAA,EACA;AAAA,EACA,SAAS;AAAA,OACH;AACP,SAAS,oBAAoB,cAAc;AAC3C,SAAS,iBAAiB;AAK1B,OAAO,kBAAkB;AACzB,OAAO,yBAAyB;AAChC,OAAO,eAAe;AACtB,OAAO,6BAA6B;AACpC,OAAO,8BAA8B;AACrC,OAAO,gCAAgC;AACvC,SAAS,SAAS,wBAAwB;AAC1C,OAAO,iBAAiB;AACxB,SAAS,WAAW,yBAAyB;AAC7C,SAAS,WAAW,6BAA6B;AACjD,OAAO,8BAA8B;AACrC,OAAO,sBAAsB;AAC7B,OAAO,sBAAsB;AAC7B,OAAO,wCAAwC;AAC/C,SAAS,2BAA2B;AACpC,OAAO,gBAAgB;AACvB,OAAO,yBAAyB;AAChC,SAAS,cAAc;AAUrB,mBACC,KADD;AARF,SAAS,oBAAqB;AAAA,EAC7B;AAAA,EACA,uBAAuB;AAAA,EACvB,uBAAuB;AAAA,EACvB,uBAAuB;AACxB,GAAI;AACH,QAAM,mBAAmB,oBAAqB,EAAE,UAAU,CAAE;AAC5D,SACC,iCACC;AAAA,wBAAC,kBAAkB,MAAlB,EAAuB;AAAA,IACxB;AAAA,MAAC,kBAAkB;AAAA,MAAlB;AAAA,QACA,OAAM;AAAA,QACN,OAAQ,GAAI,OAAQ;AAAA,QACpB,WAAU;AAAA;AAAA,IACX;AAAA,IACA;AAAA,MAAC,kBAAkB;AAAA,MAAlB;AAAA,QACA,OAAM;AAAA,QACN,OA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oBAAC,cAAW,kBAAsC;AAAA,MAClD,oBAAC,kBAAkB,MAAlB,EAAuB,OAAM,WAAU;AAAA,MACxC,oBAAC,kBAAkB,MAAlB,EAAuB,OAAM,QAAO;AAAA,MACnC,CAAE,kBACH,oBAAC,uBAAoB,WAAwB;AAAA,MAE5C,kBACD,iBACA,0BACC,iCACC;AAAA,4BAAC,kBAAkB,MAAlB,EAAuB;AAAA,QAExB,oBAAC,oBAAiB;AAAA,SACnB;AAAA,OAEH;AAAA,IAED,oBAAC,yBAAwB,MAAO;AAAA,KACjC;AAEF;AAKA,IAAO,0BAAQ;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tgetBlockType,\n\tgetUnregisteredTypeHandlerName,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport { __unstableMotion as motion } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport EditContents from './edit-contents';\nimport SkipToSelectedBlock from '../skip-to-selected-block';\nimport BlockCard from '../block-card';\nimport MultiSelectionInspector from '../multi-selection-inspector';\nimport BlockVariationTransforms from '../block-variation-transforms';\nimport useBlockDisplayInformation from '../use-block-display-information';\nimport { store as blockEditorStore } from '../../store';\nimport BlockStyles from '../block-styles';\nimport { default as InspectorControls } from '../inspector-controls';\nimport { default as InspectorControlsTabs } from '../inspector-controls-tabs';\nimport useInspectorControlsTabs from '../inspector-controls-tabs/use-inspector-controls-tabs';\nimport AdvancedControls from '../inspector-controls-tabs/advanced-controls-panel';\nimport PositionControls from '../inspector-controls-tabs/position-controls-panel';\nimport useBlockInspectorAnimationSettings from './useBlockInspectorAnimationSettings';\nimport { useBorderPanelLabel } from '../../hooks/border';\nimport ContentTab from '../inspector-controls-tabs/content-tab';\nimport ViewportVisibilityInfo from '../block-visibility/viewport-visibility-info';\nimport { unlock } from '../../lock-unlock';\n\nfunction StyleInspectorSlots( {\n\tblockName,\n\tshowAdvancedControls = true,\n\tshowPositionControls = true,\n\tshowBindingsControls = true,\n} ) {\n\tconst borderPanelLabel = useBorderPanelLabel( { blockName } );\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls.Slot />\n\t\t\t<InspectorControls.Slot\n\t\t\t\tgroup=\"color\"\n\t\t\t\tlabel={ __( 'Color' ) }\n\t\t\t\tclassName=\"color-block-support-panel__inner-wrapper\"\n\t\t\t/>\n\t\t\t<InspectorControls.Slot\n\t\t\t\tgroup=\"background\"\n\t\t\t\tlabel={ __( 'Background image' ) }\n\t\t\t/>\n\t\t\t<InspectorControls.Slot\n\t\t\t\tgroup=\"typography\"\n\t\t\t\tlabel={ __( 'Typography' ) }\n\t\t\t/>\n\t\t\t<InspectorControls.Slot\n\t\t\t\tgroup=\"dimensions\"\n\t\t\t\tlabel={ __( 'Dimensions' ) }\n\t\t\t/>\n\t\t\t<InspectorControls.Slot group=\"border\" label={ borderPanelLabel } />\n\t\t\t<InspectorControls.Slot group=\"styles\" />\n\t\t\t{ showPositionControls && <PositionControls /> }\n\t\t\t{ showBindingsControls && (\n\t\t\t\t<InspectorControls.Slot group=\"bindings\" />\n\t\t\t) }\n\t\t\t{ showAdvancedControls && (\n\t\t\t\t<div>\n\t\t\t\t\t<AdvancedControls />\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction BlockInspector() {\n\tconst {\n\t\tselectedBlockCount,\n\t\trenderedBlockName,\n\t\trenderedBlockClientId,\n\t\tblockType,\n\t\tisSectionBlock,\n\t\tisSectionBlockInSelection,\n\t\thasBlockStyles,\n\t\teditedContentOnlySection,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetSelectedBlockClientId,\n\t\t\tgetSelectedBlockClientIds,\n\t\t\tgetSelectedBlockCount,\n\t\t\tgetBlockName,\n\t\t\tgetParentSectionBlock,\n\t\t\tisSectionBlock: _isSectionBlock,\n\t\t\tgetEditedContentOnlySection,\n\t\t\tisWithinEditedContentOnlySection,\n\t\t} = unlock( select( blockEditorStore ) );\n\t\tconst { getBlockStyles } = select( blocksStore );\n\t\tconst _selectedBlockClientId = getSelectedBlockClientId();\n\t\tconst isWithinEditedSection = isWithinEditedContentOnlySection(\n\t\t\t_selectedBlockClientId\n\t\t);\n\t\tconst _renderedBlockClientId = isWithinEditedSection\n\t\t\t? _selectedBlockClientId\n\t\t\t: getParentSectionBlock( _selectedBlockClientId ) ||\n\t\t\t _selectedBlockClientId;\n\t\tconst _renderedBlockName =\n\t\t\t_renderedBlockClientId && getBlockName( _renderedBlockClientId );\n\t\tconst _blockType =\n\t\t\t_renderedBlockName && getBlockType( _renderedBlockName );\n\t\tconst selectedBlockClientIds = getSelectedBlockClientIds();\n\t\tconst _isSectionBlockInSelection = selectedBlockClientIds.some(\n\t\t\t( id ) => _isSectionBlock( id )\n\t\t);\n\t\tconst blockStyles =\n\t\t\t_renderedBlockName && getBlockStyles( _renderedBlockName );\n\t\tconst _hasBlockStyles = blockStyles && blockStyles.length > 0;\n\n\t\treturn {\n\t\t\tselectedBlockCount: getSelectedBlockCount(),\n\t\t\trenderedBlockClientId: _renderedBlockClientId,\n\t\t\trenderedBlockName: _renderedBlockName,\n\t\t\tblockType: _blockType,\n\t\t\tisSectionBlockInSelection: _isSectionBlockInSelection,\n\t\t\tisSectionBlock: _isSectionBlock( _renderedBlockClientId ),\n\t\t\thasBlockStyles: _hasBlockStyles,\n\t\t\teditedContentOnlySection: getEditedContentOnlySection(),\n\t\t};\n\t}, [] );\n\n\t// Separate useSelect for contentClientIds with proper dependencies\n\tconst contentClientIds = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! isSectionBlock || ! renderedBlockClientId ) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\tconst {\n\t\t\t\tgetClientIdsOfDescendants,\n\t\t\t\tgetBlockName,\n\t\t\t\tgetBlockEditingMode,\n\t\t\t} = unlock( select( blockEditorStore ) );\n\n\t\t\tconst descendants = getClientIdsOfDescendants(\n\t\t\t\trenderedBlockClientId\n\t\t\t);\n\n\t\t\t// Temporary workaround for issue #71991\n\t\t\t// Exclude Navigation block children from Content sidebar until proper\n\t\t\t// drill-down experience is implemented (see #65699)\n\t\t\t// This prevents a poor UX where all Nav block sub-items are shown\n\t\t\t// when the parent block is in contentOnly mode.\n\t\t\t// Build a Set of all navigation block descendants for efficient lookup\n\t\t\tconst navigationDescendants = new Set();\n\t\t\tdescendants.forEach( ( clientId ) => {\n\t\t\t\tif ( getBlockName( clientId ) === 'core/navigation' ) {\n\t\t\t\t\tconst navChildren = getClientIdsOfDescendants( clientId );\n\t\t\t\t\tnavChildren.forEach( ( childId ) =>\n\t\t\t\t\t\tnavigationDescendants.add( childId )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\treturn descendants.filter( ( current ) => {\n\t\t\t\t// Exclude navigation block children\n\t\t\t\tif ( navigationDescendants.has( current ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\tgetBlockName( current ) !== 'core/list-item' &&\n\t\t\t\t\tgetBlockEditingMode( current ) === 'contentOnly'\n\t\t\t\t);\n\t\t\t} );\n\t\t},\n\t\t[ isSectionBlock, renderedBlockClientId ]\n\t);\n\n\tconst availableTabs = useInspectorControlsTabs(\n\t\tblockType?.name,\n\t\tcontentClientIds,\n\t\tisSectionBlock,\n\t\thasBlockStyles\n\t);\n\tconst hasMultipleTabs = availableTabs?.length > 1;\n\n\t// The block inspector animation settings will be completely\n\t// removed in the future to create an API which allows the block\n\t// inspector to transition between what it\n\t// displays based on the relationship between the selected block\n\t// and its parent, and only enable it if the parent is controlling\n\t// its children blocks.\n\tconst blockInspectorAnimationSettings =\n\t\tuseBlockInspectorAnimationSettings( blockType );\n\n\tconst hasSelectedBlocks = selectedBlockCount > 1;\n\n\tif ( hasSelectedBlocks && ! isSectionBlockInSelection ) {\n\t\treturn (\n\t\t\t<div className=\"block-editor-block-inspector\">\n\t\t\t\t<MultiSelectionInspector />\n\t\t\t\t{ hasMultipleTabs ? (\n\t\t\t\t\t<InspectorControlsTabs tabs={ availableTabs } />\n\t\t\t\t) : (\n\t\t\t\t\t<StyleInspectorSlots\n\t\t\t\t\t\tblockName={ renderedBlockName }\n\t\t\t\t\t\tshowAdvancedControls={ false }\n\t\t\t\t\t\tshowPositionControls={ false }\n\t\t\t\t\t\tshowBindingsControls={ false }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t);\n\t}\n\n\tif ( hasSelectedBlocks && isSectionBlockInSelection ) {\n\t\treturn (\n\t\t\t<div className=\"block-editor-block-inspector\">\n\t\t\t\t<MultiSelectionInspector />\n\t\t\t</div>\n\t\t);\n\t}\n\n\tconst isRenderedBlockUnregistered =\n\t\trenderedBlockName === getUnregisteredTypeHandlerName();\n\n\t/*\n\t * If the rendered block is of an unregistered type, avoid showing it as an actual selection\n\t * because we want the user to focus on the unregistered block warning, not block settings.\n\t */\n\tconst shouldShowWarning =\n\t\t! blockType || ! renderedBlockClientId || isRenderedBlockUnregistered;\n\n\tif ( shouldShowWarning ) {\n\t\treturn (\n\t\t\t<span className=\"block-editor-block-inspector__no-blocks\">\n\t\t\t\t{ __( 'No block selected.' ) }\n\t\t\t</span>\n\t\t);\n\t}\n\n\treturn (\n\t\t<BlockInspectorSingleBlockWrapper\n\t\t\tanimate={ blockInspectorAnimationSettings }\n\t\t\twrapper={ ( children ) => (\n\t\t\t\t<AnimatedContainer\n\t\t\t\t\tblockInspectorAnimationSettings={\n\t\t\t\t\t\tblockInspectorAnimationSettings\n\t\t\t\t\t}\n\t\t\t\t\trenderedBlockClientId={ renderedBlockClientId }\n\t\t\t\t>\n\t\t\t\t\t{ children }\n\t\t\t\t</AnimatedContainer>\n\t\t\t) }\n\t\t>\n\t\t\t<BlockInspectorSingleBlock\n\t\t\t\trenderedBlockClientId={ renderedBlockClientId }\n\t\t\t\tblockName={ blockType.name }\n\t\t\t\tisSectionBlock={ isSectionBlock }\n\t\t\t\tavailableTabs={ availableTabs }\n\t\t\t\tcontentClientIds={ contentClientIds }\n\t\t\t\thasBlockStyles={ hasBlockStyles }\n\t\t\t\teditedContentOnlySection={ editedContentOnlySection }\n\t\t\t/>\n\t\t</BlockInspectorSingleBlockWrapper>\n\t);\n}\n\nconst BlockInspectorSingleBlockWrapper = ( { animate, wrapper, children } ) => {\n\treturn animate ? wrapper( children ) : children;\n};\n\nconst AnimatedContainer = ( {\n\tblockInspectorAnimationSettings,\n\trenderedBlockClientId,\n\tchildren,\n} ) => {\n\tconst animationOrigin =\n\t\tblockInspectorAnimationSettings &&\n\t\tblockInspectorAnimationSettings.enterDirection === 'leftToRight'\n\t\t\t? -50\n\t\t\t: 50;\n\n\treturn (\n\t\t<motion.div\n\t\t\tanimate={ {\n\t\t\t\tx: 0,\n\t\t\t\topacity: 1,\n\t\t\t\ttransition: {\n\t\t\t\t\tease: 'easeInOut',\n\t\t\t\t\tduration: 0.14,\n\t\t\t\t},\n\t\t\t} }\n\t\t\tinitial={ {\n\t\t\t\tx: animationOrigin,\n\t\t\t\topacity: 0,\n\t\t\t} }\n\t\t\tkey={ renderedBlockClientId }\n\t\t>\n\t\t\t{ children }\n\t\t</motion.div>\n\t);\n};\n\nconst BlockInspectorSingleBlock = ( {\n\t// The block that is displayed in the inspector. This is the block whose\n\t// controls and information are shown to the user.\n\trenderedBlockClientId,\n\tblockName,\n\tisSectionBlock,\n\tavailableTabs,\n\tcontentClientIds,\n\thasBlockStyles,\n\teditedContentOnlySection,\n} ) => {\n\tconst hasMultipleTabs = availableTabs?.length > 1;\n\tconst hasParentChildBlockCards =\n\t\twindow?.__experimentalContentOnlyPatternInsertion &&\n\t\teditedContentOnlySection &&\n\t\teditedContentOnlySection !== renderedBlockClientId;\n\tconst parentBlockInformation = useBlockDisplayInformation(\n\t\teditedContentOnlySection\n\t);\n\tconst blockInformation = useBlockDisplayInformation(\n\t\trenderedBlockClientId\n\t);\n\tconst isBlockSynced = blockInformation.isSynced;\n\n\treturn (\n\t\t<div className=\"block-editor-block-inspector\">\n\t\t\t{ hasParentChildBlockCards && (\n\t\t\t\t<BlockCard\n\t\t\t\t\t{ ...parentBlockInformation }\n\t\t\t\t\tclassName={ parentBlockInformation.isSynced && 'is-synced' }\n\t\t\t\t\tparentClientId={ editedContentOnlySection }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<BlockCard\n\t\t\t\t{ ...blockInformation }\n\t\t\t\tallowParentNavigation\n\t\t\t\tclassName={ isBlockSynced && 'is-synced' }\n\t\t\t\tisChild={ hasParentChildBlockCards }\n\t\t\t\tclientId={ renderedBlockClientId }\n\t\t\t/>\n\t\t\t<ViewportVisibilityInfo clientId={ renderedBlockClientId } />\n\t\t\t{ window?.__experimentalContentOnlyPatternInsertion && (\n\t\t\t\t<EditContents clientId={ renderedBlockClientId } />\n\t\t\t) }\n\t\t\t<BlockVariationTransforms blockClientId={ renderedBlockClientId } />\n\t\t\t{ hasMultipleTabs && (\n\t\t\t\t<>\n\t\t\t\t\t<InspectorControlsTabs\n\t\t\t\t\t\thasBlockStyles={ hasBlockStyles }\n\t\t\t\t\t\tclientId={ renderedBlockClientId }\n\t\t\t\t\t\tblockName={ blockName }\n\t\t\t\t\t\ttabs={ availableTabs }\n\t\t\t\t\t\tisSectionBlock={ isSectionBlock }\n\t\t\t\t\t\tcontentClientIds={ contentClientIds }\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t{ ! hasMultipleTabs && (\n\t\t\t\t<>\n\t\t\t\t\t{ hasBlockStyles && (\n\t\t\t\t\t\t<BlockStyles clientId={ renderedBlockClientId } />\n\t\t\t\t\t) }\n\t\t\t\t\t<ContentTab contentClientIds={ contentClientIds } />\n\t\t\t\t\t<InspectorControls.Slot group=\"content\" />\n\t\t\t\t\t<InspectorControls.Slot group=\"list\" />\n\t\t\t\t\t{ ! isSectionBlock && (\n\t\t\t\t\t\t<StyleInspectorSlots blockName={ blockName } />\n\t\t\t\t\t) }\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t<SkipToSelectedBlock key=\"back\" />\n\t\t</div>\n\t);\n};\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-inspector/README.md\n */\nexport default BlockInspector;\n"],
5
+ "mappings": ";AAGA,SAAS,UAAU;AACnB;AAAA,EACC;AAAA,EACA;AAAA,EACA,SAAS;AAAA,OACH;AACP,SAAS,oBAAoB,cAAc;AAC3C,SAAS,iBAAiB;AAK1B,OAAO,kBAAkB;AACzB,OAAO,yBAAyB;AAChC,OAAO,eAAe;AACtB,OAAO,6BAA6B;AACpC,OAAO,8BAA8B;AACrC,OAAO,gCAAgC;AACvC,SAAS,SAAS,wBAAwB;AAC1C,OAAO,iBAAiB;AACxB,SAAS,WAAW,yBAAyB;AAC7C,SAAS,WAAW,6BAA6B;AACjD,OAAO,8BAA8B;AACrC,OAAO,sBAAsB;AAC7B,OAAO,sBAAsB;AAC7B,OAAO,wCAAwC;AAC/C,SAAS,2BAA2B;AACpC,OAAO,gBAAgB;AACvB,OAAO,4BAA4B;AACnC,SAAS,cAAc;AAUrB,mBACC,KADD;AARF,SAAS,oBAAqB;AAAA,EAC7B;AAAA,EACA,uBAAuB;AAAA,EACvB,uBAAuB;AAAA,EACvB,uBAAuB;AACxB,GAAI;AACH,QAAM,mBAAmB,oBAAqB,EAAE,UAAU,CAAE;AAC5D,SACC,iCACC;AAAA,wBAAC,kBAAkB,MAAlB,EAAuB;AAAA,IACxB;AAAA,MAAC,kBAAkB;AAAA,MAAlB;AAAA,QACA,OAAM;AAAA,QACN,OAAQ,GAAI,OAAQ;AAAA,QACpB,WAAU;AAAA;AAAA,IACX;AAAA,IACA;AAAA,MAAC,kBAAkB;AAAA,MAAlB;AAAA,QACA,OAAM;AAAA,QACN,OAAQ,GAAI,kBAAmB;AAAA;AAAA,IAChC;AAAA,IACA;AAAA,MAAC,kBAAkB;AAAA,MAAlB;AAAA,QACA,OAAM;AAAA,QACN,OAAQ,GAAI,YAAa;AA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