@wordpress/block-editor 12.0.0 → 12.2.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 (627) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +1 -1
  3. package/build/autocompleters/block.js +13 -5
  4. package/build/autocompleters/block.js.map +1 -1
  5. package/build/components/block-breadcrumb/index.js +6 -3
  6. package/build/components/block-breadcrumb/index.js.map +1 -1
  7. package/build/components/block-controls/slot.js +12 -4
  8. package/build/components/block-controls/slot.js.map +1 -1
  9. package/build/components/block-controls/slot.native.js +10 -1
  10. package/build/components/block-controls/slot.native.js.map +1 -1
  11. package/build/components/block-draggable/index.js +11 -7
  12. package/build/components/block-draggable/index.js.map +1 -1
  13. package/build/components/block-draggable/use-scroll-when-dragging.js +2 -2
  14. package/build/components/block-draggable/use-scroll-when-dragging.js.map +1 -1
  15. package/build/components/block-editing-mode/index.js +84 -0
  16. package/build/components/block-editing-mode/index.js.map +1 -0
  17. package/build/components/block-list/block-invalid-warning.native.js +15 -7
  18. package/build/components/block-list/block-invalid-warning.native.js.map +1 -1
  19. package/build/components/block-list/block-list-block-context.js +15 -0
  20. package/build/components/block-list/block-list-block-context.js.map +1 -0
  21. package/build/components/block-list/block-list-item-cell.native.js +15 -2
  22. package/build/components/block-list/block-list-item-cell.native.js.map +1 -1
  23. package/build/components/block-list/block-list-item.native.js +158 -195
  24. package/build/components/block-list/block-list-item.native.js.map +1 -1
  25. package/build/components/block-list/block-outline.native.js +57 -0
  26. package/build/components/block-list/block-outline.native.js.map +1 -0
  27. package/build/components/block-list/block.js +29 -37
  28. package/build/components/block-list/block.js.map +1 -1
  29. package/build/components/block-list/block.native.js +347 -311
  30. package/build/components/block-list/block.native.js.map +1 -1
  31. package/build/components/block-list/index.native.js +260 -357
  32. package/build/components/block-list/index.native.js.map +1 -1
  33. package/build/components/block-list/insertion-point.native.js +4 -2
  34. package/build/components/block-list/insertion-point.native.js.map +1 -1
  35. package/build/components/block-list/use-block-props/index.js +2 -2
  36. package/build/components/block-list/use-block-props/index.js.map +1 -1
  37. package/build/components/block-list/use-in-between-inserter.js +7 -5
  38. package/build/components/block-list/use-in-between-inserter.js.map +1 -1
  39. package/build/components/block-list-appender/index.js +15 -1
  40. package/build/components/block-list-appender/index.js.map +1 -1
  41. package/build/components/block-mobile-toolbar/block-actions-menu.native.js +19 -4
  42. package/build/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  43. package/build/components/block-settings-menu/block-settings-dropdown.js +8 -10
  44. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  45. package/build/components/block-settings-menu-controls/index.js +15 -4
  46. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  47. package/build/components/block-styles/preview-panel.js +1 -2
  48. package/build/components/block-styles/preview-panel.js.map +1 -1
  49. package/build/components/block-switcher/block-transformations-menu.js +8 -0
  50. package/build/components/block-switcher/block-transformations-menu.js.map +1 -1
  51. package/build/components/block-switcher/block-variation-transformations.js +125 -0
  52. package/build/components/block-switcher/block-variation-transformations.js.map +1 -0
  53. package/build/components/block-switcher/index.js +34 -12
  54. package/build/components/block-switcher/index.js.map +1 -1
  55. package/build/components/block-switcher/pattern-transformations-menu.js +3 -3
  56. package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  57. package/build/components/block-toolbar/index.js +9 -7
  58. package/build/components/block-toolbar/index.js.map +1 -1
  59. package/build/components/block-tools/block-contextual-toolbar.js +22 -65
  60. package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
  61. package/build/components/block-tools/insertion-point.js +11 -5
  62. package/build/components/block-tools/insertion-point.js.map +1 -1
  63. package/build/components/block-tools/selected-block-popover.js +3 -8
  64. package/build/components/block-tools/selected-block-popover.js.map +1 -1
  65. package/build/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +3 -2
  66. package/build/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -1
  67. package/build/components/convert-to-group-buttons/index.js +7 -2
  68. package/build/components/convert-to-group-buttons/index.js.map +1 -1
  69. package/build/components/convert-to-group-buttons/index.native.js +87 -3
  70. package/build/components/convert-to-group-buttons/index.native.js.map +1 -1
  71. package/build/components/convert-to-group-buttons/use-convert-to-group-button-props.js +23 -37
  72. package/build/components/convert-to-group-buttons/use-convert-to-group-button-props.js.map +1 -1
  73. package/build/components/global-styles/advanced-panel.js +86 -0
  74. package/build/components/global-styles/advanced-panel.js.map +1 -0
  75. package/build/components/global-styles/color-panel.js +4 -1
  76. package/build/components/global-styles/color-panel.js.map +1 -1
  77. package/build/components/global-styles/dimensions-panel.js +9 -8
  78. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  79. package/build/components/global-styles/hooks.js +1 -2
  80. package/build/components/global-styles/hooks.js.map +1 -1
  81. package/build/components/global-styles/index.js +24 -0
  82. package/build/components/global-styles/index.js.map +1 -1
  83. package/build/components/global-styles/typography-panel.js +1 -1
  84. package/build/components/global-styles/typography-panel.js.map +1 -1
  85. package/build/components/global-styles/use-global-styles-output.js +27 -4
  86. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  87. package/build/components/global-styles/utils.js +30 -0
  88. package/build/components/global-styles/utils.js.map +1 -1
  89. package/build/components/iframe/index.js +14 -7
  90. package/build/components/iframe/index.js.map +1 -1
  91. package/build/components/image-editor/use-save-image.js +24 -8
  92. package/build/components/image-editor/use-save-image.js.map +1 -1
  93. package/build/components/inner-blocks/index.js +2 -1
  94. package/build/components/inner-blocks/index.js.map +1 -1
  95. package/build/components/inner-blocks/index.native.js +7 -7
  96. package/build/components/inner-blocks/index.native.js.map +1 -1
  97. package/build/components/inner-blocks/use-nested-settings-update.js +13 -5
  98. package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  99. package/build/components/inserter/index.js +3 -7
  100. package/build/components/inserter/index.js.map +1 -1
  101. package/build/components/inserter/quick-inserter.js +2 -4
  102. package/build/components/inserter/quick-inserter.js.map +1 -1
  103. package/build/components/inserter/search-results.js +19 -6
  104. package/build/components/inserter/search-results.js.map +1 -1
  105. package/build/components/inserter-draggable-blocks/index.js +5 -0
  106. package/build/components/inserter-draggable-blocks/index.js.map +1 -1
  107. package/build/components/inspector-controls/fill.js +1 -1
  108. package/build/components/inspector-controls/fill.js.map +1 -1
  109. package/build/components/inspector-controls/fill.native.js +1 -1
  110. package/build/components/inspector-controls/fill.native.js.map +1 -1
  111. package/build/components/inspector-controls/slot.js +3 -6
  112. package/build/components/inspector-controls/slot.js.map +1 -1
  113. package/build/components/inspector-controls/slot.native.js +1 -1
  114. package/build/components/inspector-controls/slot.native.js.map +1 -1
  115. package/build/components/line-height-control/index.js +7 -2
  116. package/build/components/line-height-control/index.js.map +1 -1
  117. package/build/components/link-control/use-internal-input-value.js +9 -8
  118. package/build/components/link-control/use-internal-input-value.js.map +1 -1
  119. package/build/components/list-view/appender.js +6 -1
  120. package/build/components/list-view/appender.js.map +1 -1
  121. package/build/components/list-view/block-contents.js +9 -2
  122. package/build/components/list-view/block-contents.js.map +1 -1
  123. package/build/components/list-view/block-select-button.js +2 -1
  124. package/build/components/list-view/block-select-button.js.map +1 -1
  125. package/build/components/list-view/block.js +25 -29
  126. package/build/components/list-view/block.js.map +1 -1
  127. package/build/components/list-view/branch.js +1 -3
  128. package/build/components/list-view/branch.js.map +1 -1
  129. package/build/components/list-view/index.js +43 -22
  130. package/build/components/list-view/index.js.map +1 -1
  131. package/build/components/list-view/use-list-view-client-ids.js +27 -3
  132. package/build/components/list-view/use-list-view-client-ids.js.map +1 -1
  133. package/build/components/list-view/use-list-view-drop-zone.js +163 -11
  134. package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
  135. package/build/components/media-placeholder/index.js +68 -7
  136. package/build/components/media-placeholder/index.js.map +1 -1
  137. package/build/components/multi-selection-inspector/index.js +2 -2
  138. package/build/components/multi-selection-inspector/index.js.map +1 -1
  139. package/build/components/preview-options/index.js +6 -1
  140. package/build/components/preview-options/index.js.map +1 -1
  141. package/build/components/publish-date-time-picker/index.js +0 -2
  142. package/build/components/publish-date-time-picker/index.js.map +1 -1
  143. package/build/components/spacing-sizes-control/spacing-input-control.js +1 -1
  144. package/build/components/spacing-sizes-control/spacing-input-control.js.map +1 -1
  145. package/build/components/url-input/index.js +4 -2
  146. package/build/components/url-input/index.js.map +1 -1
  147. package/build/components/use-block-drop-zone/index.js +25 -15
  148. package/build/components/use-block-drop-zone/index.js.map +1 -1
  149. package/build/components/use-resize-canvas/index.js +8 -1
  150. package/build/components/use-resize-canvas/index.js.map +1 -1
  151. package/build/components/writing-flow/use-arrow-nav.js +13 -7
  152. package/build/components/writing-flow/use-arrow-nav.js.map +1 -1
  153. package/build/hooks/align.js +4 -8
  154. package/build/hooks/align.js.map +1 -1
  155. package/build/hooks/behaviors.js +115 -0
  156. package/build/hooks/behaviors.js.map +1 -0
  157. package/build/hooks/border.js +1 -1
  158. package/build/hooks/border.js.map +1 -1
  159. package/build/hooks/color.js +1 -1
  160. package/build/hooks/color.js.map +1 -1
  161. package/build/hooks/content-lock-ui.js +8 -12
  162. package/build/hooks/content-lock-ui.js.map +1 -1
  163. package/build/hooks/dimensions.js +0 -30
  164. package/build/hooks/dimensions.js.map +1 -1
  165. package/build/hooks/duotone.js +5 -9
  166. package/build/hooks/duotone.js.map +1 -1
  167. package/build/hooks/index.js +2 -0
  168. package/build/hooks/index.js.map +1 -1
  169. package/build/hooks/index.native.js +8 -0
  170. package/build/hooks/index.native.js.map +1 -1
  171. package/build/hooks/layout.js +10 -11
  172. package/build/hooks/layout.js.map +1 -1
  173. package/build/hooks/position.js +1 -1
  174. package/build/hooks/position.js.map +1 -1
  175. package/build/hooks/style.js +1 -1
  176. package/build/hooks/style.js.map +1 -1
  177. package/build/hooks/use-editor-wrapper-styles.native.js +255 -0
  178. package/build/hooks/use-editor-wrapper-styles.native.js.map +1 -0
  179. package/build/hooks/use-typography-props.js +14 -10
  180. package/build/hooks/use-typography-props.js.map +1 -1
  181. package/build/index.native.js +31 -0
  182. package/build/index.native.js.map +1 -0
  183. package/build/private-apis.js +4 -7
  184. package/build/private-apis.js.map +1 -1
  185. package/build/store/private-actions.js +46 -0
  186. package/build/store/private-actions.js.map +1 -1
  187. package/build/store/private-selectors.js +88 -0
  188. package/build/store/private-selectors.js.map +1 -1
  189. package/build/store/reducer.js +36 -1
  190. package/build/store/reducer.js.map +1 -1
  191. package/build/store/selectors.js +28 -18
  192. package/build/store/selectors.js.map +1 -1
  193. package/build/utils/order-inserter-block-items.js +41 -0
  194. package/build/utils/order-inserter-block-items.js.map +1 -0
  195. package/build/utils/use-should-contextual-toolbar-show.js +16 -12
  196. package/build/utils/use-should-contextual-toolbar-show.js.map +1 -1
  197. package/build-module/autocompleters/block.js +12 -5
  198. package/build-module/autocompleters/block.js.map +1 -1
  199. package/build-module/components/block-breadcrumb/index.js +5 -3
  200. package/build-module/components/block-breadcrumb/index.js.map +1 -1
  201. package/build-module/components/block-controls/slot.js +11 -4
  202. package/build-module/components/block-controls/slot.js.map +1 -1
  203. package/build-module/components/block-controls/slot.native.js +9 -1
  204. package/build-module/components/block-controls/slot.native.js.map +1 -1
  205. package/build-module/components/block-draggable/index.js +10 -6
  206. package/build-module/components/block-draggable/index.js.map +1 -1
  207. package/build-module/components/block-draggable/use-scroll-when-dragging.js +2 -2
  208. package/build-module/components/block-draggable/use-scroll-when-dragging.js.map +1 -1
  209. package/build-module/components/block-editing-mode/index.js +72 -0
  210. package/build-module/components/block-editing-mode/index.js.map +1 -0
  211. package/build-module/components/block-list/block-invalid-warning.native.js +16 -8
  212. package/build-module/components/block-list/block-invalid-warning.native.js.map +1 -1
  213. package/build-module/components/block-list/block-list-block-context.js +6 -0
  214. package/build-module/components/block-list/block-list-block-context.js.map +1 -0
  215. package/build-module/components/block-list/block-list-item-cell.native.js +13 -2
  216. package/build-module/components/block-list/block-list-item-cell.native.js.map +1 -1
  217. package/build-module/components/block-list/block-list-item.native.js +160 -190
  218. package/build-module/components/block-list/block-list-item.native.js.map +1 -1
  219. package/build-module/components/block-list/block-outline.native.js +44 -0
  220. package/build-module/components/block-list/block-outline.native.js.map +1 -0
  221. package/build-module/components/block-list/block.js +26 -34
  222. package/build-module/components/block-list/block.js.map +1 -1
  223. package/build-module/components/block-list/block.native.js +345 -310
  224. package/build-module/components/block-list/block.native.js.map +1 -1
  225. package/build-module/components/block-list/index.native.js +263 -355
  226. package/build-module/components/block-list/index.native.js.map +1 -1
  227. package/build-module/components/block-list/insertion-point.native.js +4 -2
  228. package/build-module/components/block-list/insertion-point.native.js.map +1 -1
  229. package/build-module/components/block-list/use-block-props/index.js +1 -1
  230. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  231. package/build-module/components/block-list/use-in-between-inserter.js +6 -5
  232. package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
  233. package/build-module/components/block-list-appender/index.js +15 -1
  234. package/build-module/components/block-list-appender/index.js.map +1 -1
  235. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js +18 -4
  236. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  237. package/build-module/components/block-settings-menu/block-settings-dropdown.js +8 -9
  238. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  239. package/build-module/components/block-settings-menu-controls/index.js +13 -5
  240. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  241. package/build-module/components/block-styles/preview-panel.js +1 -2
  242. package/build-module/components/block-styles/preview-panel.js.map +1 -1
  243. package/build-module/components/block-switcher/block-transformations-menu.js +7 -0
  244. package/build-module/components/block-switcher/block-transformations-menu.js.map +1 -1
  245. package/build-module/components/block-switcher/block-variation-transformations.js +108 -0
  246. package/build-module/components/block-switcher/block-variation-transformations.js.map +1 -0
  247. package/build-module/components/block-switcher/index.js +33 -12
  248. package/build-module/components/block-switcher/index.js.map +1 -1
  249. package/build-module/components/block-switcher/pattern-transformations-menu.js +3 -3
  250. package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  251. package/build-module/components/block-toolbar/index.js +8 -7
  252. package/build-module/components/block-toolbar/index.js.map +1 -1
  253. package/build-module/components/block-tools/block-contextual-toolbar.js +22 -65
  254. package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
  255. package/build-module/components/block-tools/insertion-point.js +11 -5
  256. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  257. package/build-module/components/block-tools/selected-block-popover.js +3 -7
  258. package/build-module/components/block-tools/selected-block-popover.js.map +1 -1
  259. package/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +3 -2
  260. package/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -1
  261. package/build-module/components/convert-to-group-buttons/index.js +7 -2
  262. package/build-module/components/convert-to-group-buttons/index.js.map +1 -1
  263. package/build-module/components/convert-to-group-buttons/index.native.js +76 -1
  264. package/build-module/components/convert-to-group-buttons/index.native.js.map +1 -1
  265. package/build-module/components/convert-to-group-buttons/use-convert-to-group-button-props.js +22 -36
  266. package/build-module/components/convert-to-group-buttons/use-convert-to-group-button-props.js.map +1 -1
  267. package/build-module/components/global-styles/advanced-panel.js +74 -0
  268. package/build-module/components/global-styles/advanced-panel.js.map +1 -0
  269. package/build-module/components/global-styles/color-panel.js +5 -2
  270. package/build-module/components/global-styles/color-panel.js.map +1 -1
  271. package/build-module/components/global-styles/dimensions-panel.js +9 -8
  272. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  273. package/build-module/components/global-styles/hooks.js +1 -2
  274. package/build-module/components/global-styles/hooks.js.map +1 -1
  275. package/build-module/components/global-styles/index.js +3 -1
  276. package/build-module/components/global-styles/index.js.map +1 -1
  277. package/build-module/components/global-styles/typography-panel.js +1 -1
  278. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  279. package/build-module/components/global-styles/use-global-styles-output.js +25 -4
  280. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  281. package/build-module/components/global-styles/utils.js +25 -0
  282. package/build-module/components/global-styles/utils.js.map +1 -1
  283. package/build-module/components/iframe/index.js +15 -8
  284. package/build-module/components/iframe/index.js.map +1 -1
  285. package/build-module/components/image-editor/use-save-image.js +24 -8
  286. package/build-module/components/image-editor/use-save-image.js.map +1 -1
  287. package/build-module/components/inner-blocks/index.js +2 -1
  288. package/build-module/components/inner-blocks/index.js.map +1 -1
  289. package/build-module/components/inner-blocks/index.native.js +7 -6
  290. package/build-module/components/inner-blocks/index.native.js.map +1 -1
  291. package/build-module/components/inner-blocks/use-nested-settings-update.js +13 -5
  292. package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  293. package/build-module/components/inserter/index.js +3 -7
  294. package/build-module/components/inserter/index.js.map +1 -1
  295. package/build-module/components/inserter/quick-inserter.js +2 -4
  296. package/build-module/components/inserter/quick-inserter.js.map +1 -1
  297. package/build-module/components/inserter/search-results.js +16 -6
  298. package/build-module/components/inserter/search-results.js.map +1 -1
  299. package/build-module/components/inserter-draggable-blocks/index.js +4 -0
  300. package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
  301. package/build-module/components/inspector-controls/fill.js +1 -1
  302. package/build-module/components/inspector-controls/fill.js.map +1 -1
  303. package/build-module/components/inspector-controls/fill.native.js +1 -1
  304. package/build-module/components/inspector-controls/fill.native.js.map +1 -1
  305. package/build-module/components/inspector-controls/slot.js +4 -7
  306. package/build-module/components/inspector-controls/slot.js.map +1 -1
  307. package/build-module/components/inspector-controls/slot.native.js +1 -1
  308. package/build-module/components/inspector-controls/slot.native.js.map +1 -1
  309. package/build-module/components/line-height-control/index.js +7 -2
  310. package/build-module/components/line-height-control/index.js.map +1 -1
  311. package/build-module/components/link-control/use-internal-input-value.js +9 -8
  312. package/build-module/components/link-control/use-internal-input-value.js.map +1 -1
  313. package/build-module/components/list-view/appender.js +6 -2
  314. package/build-module/components/list-view/appender.js.map +1 -1
  315. package/build-module/components/list-view/block-contents.js +9 -3
  316. package/build-module/components/list-view/block-contents.js.map +1 -1
  317. package/build-module/components/list-view/block-select-button.js +2 -1
  318. package/build-module/components/list-view/block-select-button.js.map +1 -1
  319. package/build-module/components/list-view/block.js +24 -29
  320. package/build-module/components/list-view/block.js.map +1 -1
  321. package/build-module/components/list-view/branch.js +1 -3
  322. package/build-module/components/list-view/branch.js.map +1 -1
  323. package/build-module/components/list-view/index.js +44 -23
  324. package/build-module/components/list-view/index.js.map +1 -1
  325. package/build-module/components/list-view/use-list-view-client-ids.js +26 -3
  326. package/build-module/components/list-view/use-list-view-client-ids.js.map +1 -1
  327. package/build-module/components/list-view/use-list-view-drop-zone.js +160 -11
  328. package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
  329. package/build-module/components/media-placeholder/index.js +66 -7
  330. package/build-module/components/media-placeholder/index.js.map +1 -1
  331. package/build-module/components/multi-selection-inspector/index.js +2 -2
  332. package/build-module/components/multi-selection-inspector/index.js.map +1 -1
  333. package/build-module/components/preview-options/index.js +7 -2
  334. package/build-module/components/preview-options/index.js.map +1 -1
  335. package/build-module/components/publish-date-time-picker/index.js +0 -2
  336. package/build-module/components/publish-date-time-picker/index.js.map +1 -1
  337. package/build-module/components/spacing-sizes-control/spacing-input-control.js +1 -1
  338. package/build-module/components/spacing-sizes-control/spacing-input-control.js.map +1 -1
  339. package/build-module/components/url-input/index.js +4 -2
  340. package/build-module/components/url-input/index.js.map +1 -1
  341. package/build-module/components/use-block-drop-zone/index.js +25 -16
  342. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  343. package/build-module/components/use-resize-canvas/index.js +8 -1
  344. package/build-module/components/use-resize-canvas/index.js.map +1 -1
  345. package/build-module/components/writing-flow/use-arrow-nav.js +13 -7
  346. package/build-module/components/writing-flow/use-arrow-nav.js.map +1 -1
  347. package/build-module/hooks/align.js +4 -7
  348. package/build-module/hooks/align.js.map +1 -1
  349. package/build-module/hooks/behaviors.js +97 -0
  350. package/build-module/hooks/behaviors.js.map +1 -0
  351. package/build-module/hooks/border.js +1 -1
  352. package/build-module/hooks/border.js.map +1 -1
  353. package/build-module/hooks/color.js +1 -1
  354. package/build-module/hooks/color.js.map +1 -1
  355. package/build-module/hooks/content-lock-ui.js +8 -11
  356. package/build-module/hooks/content-lock-ui.js.map +1 -1
  357. package/build-module/hooks/dimensions.js +0 -28
  358. package/build-module/hooks/dimensions.js.map +1 -1
  359. package/build-module/hooks/duotone.js +4 -7
  360. package/build-module/hooks/duotone.js.map +1 -1
  361. package/build-module/hooks/index.js +1 -0
  362. package/build-module/hooks/index.js.map +1 -1
  363. package/build-module/hooks/index.native.js +1 -0
  364. package/build-module/hooks/index.native.js.map +1 -1
  365. package/build-module/hooks/layout.js +9 -11
  366. package/build-module/hooks/layout.js.map +1 -1
  367. package/build-module/hooks/position.js +1 -1
  368. package/build-module/hooks/position.js.map +1 -1
  369. package/build-module/hooks/style.js +1 -1
  370. package/build-module/hooks/style.js.map +1 -1
  371. package/build-module/hooks/use-editor-wrapper-styles.native.js +242 -0
  372. package/build-module/hooks/use-editor-wrapper-styles.native.js.map +1 -0
  373. package/build-module/hooks/use-typography-props.js +14 -10
  374. package/build-module/hooks/use-typography-props.js.map +1 -1
  375. package/build-module/index.native.js +6 -0
  376. package/build-module/index.native.js.map +1 -0
  377. package/build-module/private-apis.js +3 -5
  378. package/build-module/private-apis.js.map +1 -1
  379. package/build-module/store/private-actions.js +42 -0
  380. package/build-module/store/private-actions.js.map +1 -1
  381. package/build-module/store/private-selectors.js +79 -0
  382. package/build-module/store/private-selectors.js.map +1 -1
  383. package/build-module/store/reducer.js +34 -1
  384. package/build-module/store/reducer.js.map +1 -1
  385. package/build-module/store/selectors.js +26 -17
  386. package/build-module/store/selectors.js.map +1 -1
  387. package/build-module/utils/order-inserter-block-items.js +32 -0
  388. package/build-module/utils/order-inserter-block-items.js.map +1 -0
  389. package/build-module/utils/use-should-contextual-toolbar-show.js +16 -12
  390. package/build-module/utils/use-should-contextual-toolbar-show.js.map +1 -1
  391. package/build-style/content-rtl.css +32 -14
  392. package/build-style/content.css +32 -14
  393. package/build-style/default-editor-styles-rtl.css +1 -1
  394. package/build-style/default-editor-styles.css +1 -1
  395. package/build-style/style-rtl.css +56 -77
  396. package/build-style/style.css +57 -77
  397. package/package.json +32 -31
  398. package/src/autocompleters/block.js +15 -7
  399. package/src/components/block-breadcrumb/index.js +11 -3
  400. package/src/components/block-breadcrumb/style.scss +2 -1
  401. package/src/components/block-controls/slot.js +8 -4
  402. package/src/components/block-controls/slot.native.js +6 -1
  403. package/src/components/block-draggable/index.js +10 -6
  404. package/src/components/block-draggable/use-scroll-when-dragging.js +8 -2
  405. package/src/components/block-editing-mode/index.js +71 -0
  406. package/src/components/block-list/block-invalid-warning.native.js +17 -9
  407. package/src/components/block-list/block-list-block-context.js +6 -0
  408. package/src/components/block-list/block-list-item-cell.native.js +10 -1
  409. package/src/components/block-list/block-list-item.native.js +180 -208
  410. package/src/components/block-list/block-outline.native.js +58 -0
  411. package/src/components/block-list/block.js +38 -56
  412. package/src/components/block-list/block.native.js +531 -501
  413. package/src/components/block-list/content.scss +5 -6
  414. package/src/components/block-list/index.native.js +324 -382
  415. package/src/components/block-list/insertion-point.native.js +2 -2
  416. package/src/components/block-list/test/block-invalid-warning.native.js +48 -0
  417. package/src/components/block-list/test/index.native.js +205 -0
  418. package/src/components/block-list/use-block-props/index.js +1 -1
  419. package/src/components/block-list/use-in-between-inserter.js +7 -3
  420. package/src/components/block-list-appender/index.js +22 -4
  421. package/src/components/block-mobile-toolbar/block-actions-menu.native.js +26 -1
  422. package/src/components/block-mover/style.scss +1 -0
  423. package/src/components/block-pattern-setup/style.scss +1 -4
  424. package/src/components/block-patterns-list/style.scss +1 -4
  425. package/src/components/block-settings-menu/block-settings-dropdown.js +10 -17
  426. package/src/components/block-settings-menu-controls/index.js +24 -4
  427. package/src/components/block-styles/preview-panel.js +1 -3
  428. package/src/components/block-styles/style.scss +4 -4
  429. package/src/components/block-switcher/block-transformations-menu.js +12 -0
  430. package/src/components/block-switcher/block-variation-transformations.js +115 -0
  431. package/src/components/block-switcher/index.js +38 -5
  432. package/src/components/block-switcher/pattern-transformations-menu.js +5 -5
  433. package/src/components/block-switcher/style.scss +6 -5
  434. package/src/components/block-toolbar/index.js +10 -11
  435. package/src/components/block-tools/block-contextual-toolbar.js +32 -67
  436. package/src/components/block-tools/insertion-point.js +23 -9
  437. package/src/components/block-tools/selected-block-popover.js +3 -5
  438. package/src/components/block-tools/style.scss +8 -0
  439. package/src/components/button-block-appender/content.scss +22 -0
  440. package/src/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +16 -2
  441. package/src/components/convert-to-group-buttons/index.js +9 -2
  442. package/src/components/convert-to-group-buttons/index.native.js +79 -1
  443. package/src/components/convert-to-group-buttons/use-convert-to-group-button-props.js +32 -38
  444. package/src/components/global-styles/advanced-panel.js +82 -0
  445. package/src/components/global-styles/color-panel.js +6 -1
  446. package/src/components/global-styles/dimensions-panel.js +9 -8
  447. package/src/components/global-styles/hooks.js +1 -5
  448. package/src/components/global-styles/index.js +6 -1
  449. package/src/components/global-styles/style.scss +17 -0
  450. package/src/components/global-styles/test/utils.js +57 -1
  451. package/src/components/global-styles/typography-panel.js +1 -1
  452. package/src/components/global-styles/use-global-styles-output.js +21 -3
  453. package/src/components/global-styles/utils.js +27 -0
  454. package/src/components/iframe/index.js +22 -12
  455. package/src/components/image-editor/use-save-image.js +20 -9
  456. package/src/components/inner-blocks/README.md +5 -0
  457. package/src/components/inner-blocks/index.js +2 -0
  458. package/src/components/inner-blocks/index.native.js +16 -6
  459. package/src/components/inner-blocks/use-nested-settings-update.js +20 -3
  460. package/src/components/inserter/index.js +1 -9
  461. package/src/components/inserter/quick-inserter.js +0 -2
  462. package/src/components/inserter/search-results.js +32 -6
  463. package/src/components/inserter-draggable-blocks/index.js +4 -0
  464. package/src/components/inspector-controls/fill.js +1 -1
  465. package/src/components/inspector-controls/fill.native.js +1 -1
  466. package/src/components/inspector-controls/slot.js +4 -9
  467. package/src/components/inspector-controls/slot.native.js +1 -1
  468. package/src/components/line-height-control/index.js +7 -2
  469. package/src/components/line-height-control/stories/index.js +1 -1
  470. package/src/components/link-control/test/index.js +42 -0
  471. package/src/components/link-control/use-internal-input-value.js +8 -7
  472. package/src/components/list-view/appender.js +3 -2
  473. package/src/components/list-view/block-contents.js +32 -20
  474. package/src/components/list-view/block-select-button.js +5 -1
  475. package/src/components/list-view/block.js +34 -37
  476. package/src/components/list-view/branch.js +1 -7
  477. package/src/components/list-view/index.js +42 -17
  478. package/src/components/list-view/style.scss +7 -7
  479. package/src/components/list-view/test/use-list-view-drop-zone.js +88 -12
  480. package/src/components/list-view/use-list-view-client-ids.js +21 -4
  481. package/src/components/list-view/use-list-view-drop-zone.js +194 -11
  482. package/src/components/media-placeholder/index.js +74 -1
  483. package/src/components/multi-selection-inspector/index.js +2 -2
  484. package/src/components/preview-options/index.js +9 -2
  485. package/src/components/publish-date-time-picker/index.js +0 -2
  486. package/src/components/spacing-sizes-control/spacing-input-control.js +1 -0
  487. package/src/components/url-input/README.md +6 -0
  488. package/src/components/url-input/index.js +2 -2
  489. package/src/components/use-block-drop-zone/index.js +31 -17
  490. package/src/components/use-resize-canvas/index.js +9 -1
  491. package/src/components/writing-flow/test/index.js +15 -0
  492. package/src/components/writing-flow/use-arrow-nav.js +17 -4
  493. package/src/hooks/align.js +5 -12
  494. package/src/hooks/behaviors.js +104 -0
  495. package/src/hooks/border.js +2 -1
  496. package/src/hooks/color.js +2 -1
  497. package/src/hooks/content-lock-ui.js +3 -15
  498. package/src/hooks/dimensions.js +0 -40
  499. package/src/hooks/duotone.js +4 -11
  500. package/src/hooks/index.js +1 -0
  501. package/src/hooks/index.native.js +1 -0
  502. package/src/hooks/layout.js +14 -20
  503. package/src/hooks/position.js +2 -1
  504. package/src/hooks/style.js +2 -1
  505. package/src/hooks/test/use-editor-wrapper-styles.native.js +282 -0
  506. package/src/hooks/test/use-typography-props.js +47 -2
  507. package/src/hooks/use-editor-wrapper-styles.native.js +250 -0
  508. package/src/hooks/use-editor-wrapper-styles.native.scss +11 -0
  509. package/src/hooks/use-typography-props.js +10 -11
  510. package/src/index.native.js +6 -0
  511. package/src/private-apis.js +2 -4
  512. package/src/store/private-actions.js +39 -0
  513. package/src/store/private-selectors.js +95 -0
  514. package/src/store/reducer.js +27 -0
  515. package/src/store/selectors.js +25 -15
  516. package/src/store/test/private-actions.js +32 -1
  517. package/src/store/test/private-selectors.js +158 -0
  518. package/src/store/test/reducer.js +48 -0
  519. package/src/style.scss +0 -3
  520. package/src/utils/order-inserter-block-items.js +26 -0
  521. package/src/utils/use-should-contextual-toolbar-show.js +19 -9
  522. package/tsconfig.json +1 -0
  523. package/tsconfig.tsbuildinfo +1 -1
  524. package/build/components/block-list/block-list-compact.native.js +0 -75
  525. package/build/components/block-list/block-list-compact.native.js.map +0 -1
  526. package/build/components/off-canvas-editor/appender.js +0 -125
  527. package/build/components/off-canvas-editor/appender.js.map +0 -1
  528. package/build/components/off-canvas-editor/block-contents.js +0 -141
  529. package/build/components/off-canvas-editor/block-contents.js.map +0 -1
  530. package/build/components/off-canvas-editor/block-select-button.js +0 -126
  531. package/build/components/off-canvas-editor/block-select-button.js.map +0 -1
  532. package/build/components/off-canvas-editor/block.js +0 -297
  533. package/build/components/off-canvas-editor/block.js.map +0 -1
  534. package/build/components/off-canvas-editor/branch.js +0 -197
  535. package/build/components/off-canvas-editor/branch.js.map +0 -1
  536. package/build/components/off-canvas-editor/context.js +0 -19
  537. package/build/components/off-canvas-editor/context.js.map +0 -1
  538. package/build/components/off-canvas-editor/drop-indicator.js +0 -118
  539. package/build/components/off-canvas-editor/drop-indicator.js.map +0 -1
  540. package/build/components/off-canvas-editor/expander.js +0 -41
  541. package/build/components/off-canvas-editor/expander.js.map +0 -1
  542. package/build/components/off-canvas-editor/index.js +0 -236
  543. package/build/components/off-canvas-editor/index.js.map +0 -1
  544. package/build/components/off-canvas-editor/leaf-more-menu.js +0 -146
  545. package/build/components/off-canvas-editor/leaf-more-menu.js.map +0 -1
  546. package/build/components/off-canvas-editor/leaf.js +0 -60
  547. package/build/components/off-canvas-editor/leaf.js.map +0 -1
  548. package/build/components/off-canvas-editor/link-ui.js +0 -186
  549. package/build/components/off-canvas-editor/link-ui.js.map +0 -1
  550. package/build/components/off-canvas-editor/update-attributes.js +0 -108
  551. package/build/components/off-canvas-editor/update-attributes.js.map +0 -1
  552. package/build/components/off-canvas-editor/use-block-selection.js +0 -139
  553. package/build/components/off-canvas-editor/use-block-selection.js.map +0 -1
  554. package/build/components/off-canvas-editor/use-inserted-block.js +0 -58
  555. package/build/components/off-canvas-editor/use-inserted-block.js.map +0 -1
  556. package/build/components/off-canvas-editor/use-list-view-client-ids.js +0 -33
  557. package/build/components/off-canvas-editor/use-list-view-client-ids.js.map +0 -1
  558. package/build/components/off-canvas-editor/use-list-view-drop-zone.js +0 -235
  559. package/build/components/off-canvas-editor/use-list-view-drop-zone.js.map +0 -1
  560. package/build/components/off-canvas-editor/use-list-view-expand-selected-item.js +0 -60
  561. package/build/components/off-canvas-editor/use-list-view-expand-selected-item.js.map +0 -1
  562. package/build/components/off-canvas-editor/utils.js +0 -60
  563. package/build/components/off-canvas-editor/utils.js.map +0 -1
  564. package/build-module/components/block-list/block-list-compact.native.js +0 -60
  565. package/build-module/components/block-list/block-list-compact.native.js.map +0 -1
  566. package/build-module/components/off-canvas-editor/appender.js +0 -108
  567. package/build-module/components/off-canvas-editor/appender.js.map +0 -1
  568. package/build-module/components/off-canvas-editor/block-contents.js +0 -121
  569. package/build-module/components/off-canvas-editor/block-contents.js.map +0 -1
  570. package/build-module/components/off-canvas-editor/block-select-button.js +0 -107
  571. package/build-module/components/off-canvas-editor/block-select-button.js.map +0 -1
  572. package/build-module/components/off-canvas-editor/block.js +0 -273
  573. package/build-module/components/off-canvas-editor/block.js.map +0 -1
  574. package/build-module/components/off-canvas-editor/branch.js +0 -179
  575. package/build-module/components/off-canvas-editor/branch.js.map +0 -1
  576. package/build-module/components/off-canvas-editor/context.js +0 -7
  577. package/build-module/components/off-canvas-editor/context.js.map +0 -1
  578. package/build-module/components/off-canvas-editor/drop-indicator.js +0 -111
  579. package/build-module/components/off-canvas-editor/drop-indicator.js.map +0 -1
  580. package/build-module/components/off-canvas-editor/expander.js +0 -32
  581. package/build-module/components/off-canvas-editor/expander.js.map +0 -1
  582. package/build-module/components/off-canvas-editor/index.js +0 -213
  583. package/build-module/components/off-canvas-editor/index.js.map +0 -1
  584. package/build-module/components/off-canvas-editor/leaf-more-menu.js +0 -128
  585. package/build-module/components/off-canvas-editor/leaf-more-menu.js.map +0 -1
  586. package/build-module/components/off-canvas-editor/leaf.js +0 -45
  587. package/build-module/components/off-canvas-editor/leaf.js.map +0 -1
  588. package/build-module/components/off-canvas-editor/link-ui.js +0 -166
  589. package/build-module/components/off-canvas-editor/link-ui.js.map +0 -1
  590. package/build-module/components/off-canvas-editor/update-attributes.js +0 -97
  591. package/build-module/components/off-canvas-editor/update-attributes.js.map +0 -1
  592. package/build-module/components/off-canvas-editor/use-block-selection.js +0 -124
  593. package/build-module/components/off-canvas-editor/use-block-selection.js.map +0 -1
  594. package/build-module/components/off-canvas-editor/use-inserted-block.js +0 -47
  595. package/build-module/components/off-canvas-editor/use-inserted-block.js.map +0 -1
  596. package/build-module/components/off-canvas-editor/use-list-view-client-ids.js +0 -24
  597. package/build-module/components/off-canvas-editor/use-list-view-client-ids.js.map +0 -1
  598. package/build-module/components/off-canvas-editor/use-list-view-drop-zone.js +0 -220
  599. package/build-module/components/off-canvas-editor/use-list-view-drop-zone.js.map +0 -1
  600. package/build-module/components/off-canvas-editor/use-list-view-expand-selected-item.js +0 -50
  601. package/build-module/components/off-canvas-editor/use-list-view-expand-selected-item.js.map +0 -1
  602. package/build-module/components/off-canvas-editor/utils.js +0 -44
  603. package/build-module/components/off-canvas-editor/utils.js.map +0 -1
  604. package/src/components/block-list/block-list-compact.native.js +0 -63
  605. package/src/components/off-canvas-editor/README.md +0 -5
  606. package/src/components/off-canvas-editor/appender.js +0 -124
  607. package/src/components/off-canvas-editor/block-contents.js +0 -156
  608. package/src/components/off-canvas-editor/block-select-button.js +0 -128
  609. package/src/components/off-canvas-editor/block.js +0 -347
  610. package/src/components/off-canvas-editor/branch.js +0 -238
  611. package/src/components/off-canvas-editor/context.js +0 -8
  612. package/src/components/off-canvas-editor/drop-indicator.js +0 -126
  613. package/src/components/off-canvas-editor/expander.js +0 -26
  614. package/src/components/off-canvas-editor/index.js +0 -271
  615. package/src/components/off-canvas-editor/leaf-more-menu.js +0 -157
  616. package/src/components/off-canvas-editor/leaf.js +0 -52
  617. package/src/components/off-canvas-editor/link-ui.js +0 -167
  618. package/src/components/off-canvas-editor/style.scss +0 -34
  619. package/src/components/off-canvas-editor/test/use-inserted-block.js +0 -108
  620. package/src/components/off-canvas-editor/test/utils.js +0 -50
  621. package/src/components/off-canvas-editor/update-attributes.js +0 -99
  622. package/src/components/off-canvas-editor/use-block-selection.js +0 -169
  623. package/src/components/off-canvas-editor/use-inserted-block.js +0 -47
  624. package/src/components/off-canvas-editor/use-list-view-client-ids.js +0 -29
  625. package/src/components/off-canvas-editor/use-list-view-drop-zone.js +0 -260
  626. package/src/components/off-canvas-editor/use-list-view-expand-selected-item.js +0 -58
  627. package/src/components/off-canvas-editor/utils.js +0 -58
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/block-editor/src/hooks/use-editor-wrapper-styles.native.js"],"names":["ALIGNMENT_MAX_WIDTH","full","wide","wideMedium","wideLandscape","BLOCK_DEFAULT_MARGIN","getWideWidthStyles","align","isLandscape","width","WIDE_ALIGNMENTS","alignments","ALIGNMENT_BREAKPOINTS","large","maxWidth","small","medium","getFullWidthStyles","blockName","hasParents","parentBlockName","isContainerRelated","isFullWidth","alignmentHelpers","fullWidthStyles","paddingHorizontal","getBlockMargin","blockWidth","marginHorizontal","parentBlockAlignment","parentWidth","isWider","isWideWidth","isScreenWidthEqual","useEditorWrapperStyles","contentResizeMode","reversed","height","blockMargin","wrapperStyles","canvasStyles","flex","styles","alignmentStyles"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AASA;;AAlBA;AACA;AACA;;AAGA;AACA;AACA;;AA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uC;AACtC;AACAK,MAAAA,YAAY,GAAG;AAAEC,QAAAA,IAAI,EAAE;AAAR,OAAf;AACA,KAHD,MAGO,IAAKL,QAAL,EAAgB;AACtBI,MAAAA,YAAY,GAAGE,gCAAQ,qCAAR,CAAf;AACA,KAFM,MAEA;AACNF,MAAAA,YAAY,GAAGE,gCAAQ,2BAAR,CAAf;AACA;;AAED,UAAMC,eAAe,GAAG,EACvB,GAAGrC,kBAAkB,CAAE;AAAEC,QAAAA,KAAF;AAASC,QAAAA,WAAT;AAAsBC,QAAAA;AAAtB,OAAF,CADE;AAEvB,SAAGQ,kBAAkB,CAAE;AACtBV,QAAAA,KADsB;AAEtBW,QAAAA,SAFsB;AAGtBC,QAAAA,UAHsB;AAItBC,QAAAA;AAJsB,OAAF;AAFE,KAAxB;AAUA,WAAO,CAAEoB,YAAF,EAAgBG,eAAhB,CAAP;AACA,GAvBqB,EAuBnB,CACFpC,KADE,EAEFW,SAFE,EAGFC,UAHE,EAIFC,eAJE,EAKFZ,WALE,EAMFC,KANE,EAOF0B,iBAPE,EAQFC,QARE,CAvBmB,CAAtB;AAkCA,SAAO,CAAEG,aAAF,EAAiBD,WAAjB,CAAP;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport { useWindowDimensions } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport {\n\tALIGNMENT_BREAKPOINTS,\n\tWIDE_ALIGNMENTS,\n\talignmentHelpers,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport styles from './use-editor-wrapper-styles.scss';\n\nconst ALIGNMENT_MAX_WIDTH = {\n\tfull: '100%',\n\twide: 1054,\n\twideMedium: 770,\n\twideLandscape: 662,\n};\n\nconst BLOCK_DEFAULT_MARGIN = 16;\n\n/**\n * Get the styles for the wide width alignment.\n *\n * @param {Object} [options] The options for the helper.\n * @param {string} options.align The alignment value.\n * @param {boolean} options.isLandscape Whether the screen is in landscape mode.\n * @param {number} options.width The width of the screen.\n * @return {Object} An object containing the styles for the wide width alignment.\n */\nfunction getWideWidthStyles( { align, isLandscape, width } = {} ) {\n\tif ( align !== WIDE_ALIGNMENTS.alignments.wide ) {\n\t\treturn {};\n\t}\n\n\tif ( isLandscape && width < ALIGNMENT_BREAKPOINTS.large ) {\n\t\treturn { maxWidth: ALIGNMENT_MAX_WIDTH.wideLandscape };\n\t}\n\n\tif ( width <= ALIGNMENT_BREAKPOINTS.small ) {\n\t\treturn { maxWidth: width };\n\t}\n\n\tif (\n\t\twidth >= ALIGNMENT_BREAKPOINTS.medium &&\n\t\twidth < ALIGNMENT_BREAKPOINTS.wide\n\t) {\n\t\treturn { maxWidth: ALIGNMENT_MAX_WIDTH.wideMedium };\n\t}\n\n\treturn { maxWidth: ALIGNMENT_MAX_WIDTH.wide };\n}\n\n/**\n * Get the styles for the full width alignment.\n *\n * @param {Object} [options] The options for the helper.\n * @param {string} options.align The alignment value.\n * @param {string} options.blockName The name of the block.\n * @param {boolean} options.hasParents Whether the block has parents.\n * @param {string} options.parentBlockName The name of the parent block.\n * @return {Object} An object containing the styles for the full width alignment.\n */\nfunction getFullWidthStyles( {\n\talign,\n\tblockName,\n\thasParents,\n\tparentBlockName,\n} = {} ) {\n\tconst { isContainerRelated, isFullWidth } = alignmentHelpers;\n\tconst fullWidthStyles = isFullWidth( align )\n\t\t? { maxWidth: ALIGNMENT_MAX_WIDTH.full }\n\t\t: {};\n\n\tif (\n\t\t! align &&\n\t\thasParents &&\n\t\t! isContainerRelated( parentBlockName ) &&\n\t\tisContainerRelated( blockName )\n\t) {\n\t\tfullWidthStyles.paddingHorizontal = BLOCK_DEFAULT_MARGIN;\n\t}\n\n\treturn fullWidthStyles;\n}\n\n/**\n * Get the block margin based on various conditions.\n *\n * @param {Object} [options] The options for the helper.\n * @param {string} options.align The alignment value.\n * @param {string} options.blockName The name of the block.\n * @param {number} options.blockWidth The width of the block.\n * @param {boolean} options.hasParents Whether the block has parents.\n * @param {number} options.marginHorizontal Default horizontal margin.\n * @param {string} options.parentBlockAlignment The alignment of the parent block.\n * @param {string} options.parentBlockName The name of the parent block.\n * @param {number} options.parentWidth The width of the parent block.\n * @param {number} options.width The width of the screen.\n * @return {number} The calculated block margin.\n */\nfunction getBlockMargin( {\n\talign,\n\tblockName,\n\tblockWidth,\n\thasParents,\n\tmarginHorizontal,\n\tparentBlockAlignment,\n\tparentBlockName,\n\tparentWidth,\n\twidth,\n} = {} ) {\n\tconst { isContainerRelated, isWider, isWideWidth, isFullWidth } =\n\t\talignmentHelpers;\n\n\tif ( isFullWidth( align ) ) {\n\t\tif ( ! hasParents ) {\n\t\t\treturn 0;\n\t\t}\n\t\treturn marginHorizontal;\n\t}\n\n\tif ( isWideWidth( align ) ) {\n\t\treturn marginHorizontal;\n\t}\n\n\tif (\n\t\tisFullWidth( parentBlockAlignment ) &&\n\t\t! isWider( blockWidth, 'medium' )\n\t) {\n\t\tif ( isContainerRelated( blockName ) || isWider( width, 'mobile' ) ) {\n\t\t\treturn marginHorizontal;\n\t\t}\n\t\treturn marginHorizontal * 2;\n\t}\n\n\tif (\n\t\tisContainerRelated( parentBlockName ) &&\n\t\t! isContainerRelated( blockName )\n\t) {\n\t\tconst isScreenWidthEqual = parentWidth === width;\n\t\tif ( isScreenWidthEqual || isWider( width, 'mobile' ) ) {\n\t\t\treturn marginHorizontal;\n\t\t}\n\t}\n\n\treturn marginHorizontal;\n}\n\n/**\n * Custom hook to get the styles and margin for the editor wrapper.\n *\n * @param {Object} [props] The props for the hook.\n * @param {string} props.align The alignment value.\n * @param {string} props.blockName The name of the block.\n * @param {number} props.blockWidth The width of the block.\n * @param {string} props.contentResizeMode The content resize mode.\n * @param {boolean} props.hasParents Whether the block has parents.\n * @param {number} props.marginHorizontal Default horizontal margin.\n * @param {string} props.parentBlockAlignment The alignment of the parent block.\n * @param {string} props.parentBlockName The name of the parent block.\n * @param {number} props.parentWidth The width of the parent block.\n * @param {boolean} [props.reversed=false] Whether the flex direction should be reversed.\n * @return {[Array, number]} An array containing the wrapper styles and block margin.\n */\nexport function useEditorWrapperStyles( {\n\talign,\n\tblockName,\n\tblockWidth,\n\tcontentResizeMode,\n\thasParents,\n\tmarginHorizontal,\n\tparentBlockAlignment,\n\tparentBlockName,\n\tparentWidth,\n\treversed = false,\n} = {} ) {\n\tconst { width, height } = useWindowDimensions();\n\tconst isLandscape = width >= height;\n\n\tconst blockMargin = useMemo(\n\t\t() =>\n\t\t\tgetBlockMargin( {\n\t\t\t\talign,\n\t\t\t\tblockName,\n\t\t\t\tblockWidth,\n\t\t\t\thasParents,\n\t\t\t\tmarginHorizontal,\n\t\t\t\tparentBlockAlignment,\n\t\t\t\tparentBlockName,\n\t\t\t\tparentWidth,\n\t\t\t\twidth,\n\t\t\t} ),\n\t\t[\n\t\t\talign,\n\t\t\tblockName,\n\t\t\tblockWidth,\n\t\t\thasParents,\n\t\t\tmarginHorizontal,\n\t\t\tparentBlockAlignment,\n\t\t\tparentBlockName,\n\t\t\tparentWidth,\n\t\t\twidth,\n\t\t]\n\t);\n\n\tconst wrapperStyles = useMemo( () => {\n\t\tlet canvasStyles;\n\n\t\tif ( contentResizeMode === 'stretch' ) {\n\t\t\t// For these cases, no width constraints should be added.\n\t\t\tcanvasStyles = { flex: 1 };\n\t\t} else if ( reversed ) {\n\t\t\tcanvasStyles = styles[ 'use-editor-wrapper-styles--reversed' ];\n\t\t} else {\n\t\t\tcanvasStyles = styles[ 'use-editor-wrapper-styles' ];\n\t\t}\n\n\t\tconst alignmentStyles = {\n\t\t\t...getWideWidthStyles( { align, isLandscape, width } ),\n\t\t\t...getFullWidthStyles( {\n\t\t\t\talign,\n\t\t\t\tblockName,\n\t\t\t\thasParents,\n\t\t\t\tparentBlockName,\n\t\t\t} ),\n\t\t};\n\n\t\treturn [ canvasStyles, alignmentStyles ];\n\t}, [\n\t\talign,\n\t\tblockName,\n\t\thasParents,\n\t\tparentBlockName,\n\t\tisLandscape,\n\t\twidth,\n\t\tcontentResizeMode,\n\t\treversed,\n\t] );\n\n\treturn [ wrapperStyles, blockMargin ];\n}\n"]}
@@ -24,31 +24,35 @@ var _fluidUtils = require("../components/font-sizes/fluid-utils");
24
24
  /**
25
25
  * Internal dependencies
26
26
  */
27
- // This utility is intended to assist where the serialization of the typography
28
- // block support is being skipped for a block but the typography related CSS
29
- // styles still need to be generated so they can be applied to inner elements.
27
+
28
+ /*
29
+ * This utility is intended to assist where the serialization of the typography
30
+ * block support is being skipped for a block but the typography related CSS
31
+ * styles still need to be generated so they can be applied to inner elements.
32
+ */
30
33
 
31
34
  /**
32
35
  * Provides the CSS class names and inline styles for a block's typography support
33
36
  * attributes.
34
37
  *
35
- * @param {Object} attributes Block attributes.
36
- * @param {Object|boolean} fluidTypographySettings If boolean, whether the function should try to convert font sizes to fluid values,
37
- * otherwise an object containing theme fluid typography settings.
38
+ * @param {Object} attributes Block attributes.
39
+ * @param {Object|boolean} settings Merged theme.json settings
38
40
  *
39
41
  * @return {Object} Typography block support derived CSS classes & styles.
40
42
  */
41
- function getTypographyClassesAndStyles(attributes, fluidTypographySettings) {
42
- var _attributes$style;
43
+ function getTypographyClassesAndStyles(attributes, settings) {
44
+ var _attributes$style, _settings$typography;
43
45
 
44
46
  let typographyStyles = (attributes === null || attributes === void 0 ? void 0 : (_attributes$style = attributes.style) === null || _attributes$style === void 0 ? void 0 : _attributes$style.typography) || {};
47
+ const fluidTypographySettings = settings === null || settings === void 0 ? void 0 : (_settings$typography = settings.typography) === null || _settings$typography === void 0 ? void 0 : _settings$typography.fluid;
45
48
 
46
49
  if (!!fluidTypographySettings && (true === fluidTypographySettings || Object.keys(fluidTypographySettings).length !== 0)) {
47
- var _attributes$style2, _attributes$style2$ty, _attributes$style3, _attributes$style3$ty;
50
+ var _attributes$style2, _attributes$style2$ty, _settings$layout, _attributes$style3, _attributes$style3$ty;
48
51
 
49
52
  const newFontSize = (0, _fluidUtils.getComputedFluidTypographyValue)({
50
53
  fontSize: attributes === null || attributes === void 0 ? void 0 : (_attributes$style2 = attributes.style) === null || _attributes$style2 === void 0 ? void 0 : (_attributes$style2$ty = _attributes$style2.typography) === null || _attributes$style2$ty === void 0 ? void 0 : _attributes$style2$ty.fontSize,
51
- minimumFontSizeLimit: fluidTypographySettings === null || fluidTypographySettings === void 0 ? void 0 : fluidTypographySettings.minFontSize
54
+ minimumFontSizeLimit: fluidTypographySettings === null || fluidTypographySettings === void 0 ? void 0 : fluidTypographySettings.minFontSize,
55
+ maximumViewPortWidth: settings === null || settings === void 0 ? void 0 : (_settings$layout = settings.layout) === null || _settings$layout === void 0 ? void 0 : _settings$layout.wideSize
52
56
  }) || (attributes === null || attributes === void 0 ? void 0 : (_attributes$style3 = attributes.style) === null || _attributes$style3 === void 0 ? void 0 : (_attributes$style3$ty = _attributes$style3.typography) === null || _attributes$style3$ty === void 0 ? void 0 : _attributes$style3$ty.fontSize);
53
57
  typographyStyles = { ...typographyStyles,
54
58
  fontSize: newFontSize
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/hooks/use-typography-props.js"],"names":["getTypographyClassesAndStyles","attributes","fluidTypographySettings","typographyStyles","style","typography","Object","keys","length","newFontSize","fontSize","minimumFontSizeLimit","minFontSize","fontFamilyClassName","fontFamily","className"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AACA;;AAXA;AACA;AACA;;AAIA;AACA;AACA;AAKA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,6BAAT,CACNC,UADM,EAENC,uBAFM,EAGL;AAAA;;AACD,MAAIC,gBAAgB,GAAG,CAAAF,UAAU,SAAV,IAAAA,UAAU,WAAV,iCAAAA,UAAU,CAAEG,KAAZ,wEAAmBC,UAAnB,KAAiC,EAAxD;;AAEA,MACC,CAAC,CAAEH,uBAAH,KACE,SAASA,uBAAT,IACDI,MAAM,CAACC,IAAP,CAAaL,uBAAb,EAAuCM,MAAvC,KAAkD,CAFnD,CADD,EAIE;AAAA;;AACD,UAAMC,WAAW,GAChB,iDAAiC;AAChCC,MAAAA,QAAQ,EAAET,UAAF,aAAEA,UAAF,6CAAEA,UAAU,CAAEG,KAAd,gFAAE,mBAAmBC,UAArB,0DAAE,sBAA+BK,QADT;AAEhCC,MAAAA,oBAAoB,EAAET,uBAAF,aAAEA,uBAAF,uBAAEA,uBAAuB,CAAEU;AAFf,KAAjC,MAGOX,UAHP,aAGOA,UAHP,6CAGOA,UAAU,CAAEG,KAHnB,gFAGO,mBAAmBC,UAH1B,0DAGO,sBAA+BK,QAHtC,CADD;AAKAP,IAAAA,gBAAgB,GAAG,EAClB,GAAGA,gBADe;AAElBO,MAAAA,QAAQ,EAAED;AAFQ,KAAnB;AAIA;;AAED,QAAML,KAAK,GAAG,4BAAiB;AAAEC,IAAAA,UAAU,EAAEF;AAAd,GAAjB,CAAd;AACA,QAAMU,mBAAmB,GAAG,CAAC,EAAEZ,UAAF,aAAEA,UAAF,eAAEA,UAAU,CAAEa,UAAd,CAAD,GACxB,OAAO,uBAAWb,UAAU,CAACa,UAAtB,CAAoC,cADnB,GAEzB,EAFH;AAIA,QAAMC,SAAS,GAAG,yBACjBF,mBADiB,EAEjB,iCAAkBZ,UAAlB,aAAkBA,UAAlB,uBAAkBA,UAAU,CAAES,QAA9B,CAFiB,CAAlB;AAKA,SAAO;AACNK,IAAAA,SADM;AAENX,IAAAA;AAFM,GAAP;AAIA","sourcesContent":["/**\n * External dependencies\n */\nimport { kebabCase } from 'lodash';\nimport classnames from 'classnames';\n\n/**\n * Internal dependencies\n */\nimport { getInlineStyles } from './style';\nimport { getFontSizeClass } from '../components/font-sizes';\nimport { getComputedFluidTypographyValue } from '../components/font-sizes/fluid-utils';\n\n// This utility is intended to assist where the serialization of the typography\n// block support is being skipped for a block but the typography related CSS\n// styles still need to be generated so they can be applied to inner elements.\n\n/**\n * Provides the CSS class names and inline styles for a block's typography support\n * attributes.\n *\n * @param {Object} attributes Block attributes.\n * @param {Object|boolean} fluidTypographySettings If boolean, whether the function should try to convert font sizes to fluid values,\n * otherwise an object containing theme fluid typography settings.\n *\n * @return {Object} Typography block support derived CSS classes & styles.\n */\nexport function getTypographyClassesAndStyles(\n\tattributes,\n\tfluidTypographySettings\n) {\n\tlet typographyStyles = attributes?.style?.typography || {};\n\n\tif (\n\t\t!! fluidTypographySettings &&\n\t\t( true === fluidTypographySettings ||\n\t\t\tObject.keys( fluidTypographySettings ).length !== 0 )\n\t) {\n\t\tconst newFontSize =\n\t\t\tgetComputedFluidTypographyValue( {\n\t\t\t\tfontSize: attributes?.style?.typography?.fontSize,\n\t\t\t\tminimumFontSizeLimit: fluidTypographySettings?.minFontSize,\n\t\t\t} ) || attributes?.style?.typography?.fontSize;\n\t\ttypographyStyles = {\n\t\t\t...typographyStyles,\n\t\t\tfontSize: newFontSize,\n\t\t};\n\t}\n\n\tconst style = getInlineStyles( { typography: typographyStyles } );\n\tconst fontFamilyClassName = !! attributes?.fontFamily\n\t\t? `has-${ kebabCase( attributes.fontFamily ) }-font-family`\n\t\t: '';\n\n\tconst className = classnames(\n\t\tfontFamilyClassName,\n\t\tgetFontSizeClass( attributes?.fontSize )\n\t);\n\n\treturn {\n\t\tclassName,\n\t\tstyle,\n\t};\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/hooks/use-typography-props.js"],"names":["getTypographyClassesAndStyles","attributes","settings","typographyStyles","style","typography","fluidTypographySettings","fluid","Object","keys","length","newFontSize","fontSize","minimumFontSizeLimit","minFontSize","maximumViewPortWidth","layout","wideSize","fontFamilyClassName","fontFamily","className"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AACA;;AAXA;AACA;AACA;;AAIA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,6BAAT,CAAwCC,UAAxC,EAAoDC,QAApD,EAA+D;AAAA;;AACrE,MAAIC,gBAAgB,GAAG,CAAAF,UAAU,SAAV,IAAAA,UAAU,WAA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AO;AACNQ,IAAAA,SADM;AAENhB,IAAAA;AAFM,GAAP;AAIA","sourcesContent":["/**\n * External dependencies\n */\nimport { kebabCase } from 'lodash';\nimport classnames from 'classnames';\n\n/**\n * Internal dependencies\n */\nimport { getInlineStyles } from './style';\nimport { getFontSizeClass } from '../components/font-sizes';\nimport { getComputedFluidTypographyValue } from '../components/font-sizes/fluid-utils';\n\n/*\n * This utility is intended to assist where the serialization of the typography\n * block support is being skipped for a block but the typography related CSS\n * styles still need to be generated so they can be applied to inner elements.\n */\n/**\n * Provides the CSS class names and inline styles for a block's typography support\n * attributes.\n *\n * @param {Object} attributes Block attributes.\n * @param {Object|boolean} settings Merged theme.json settings\n *\n * @return {Object} Typography block support derived CSS classes & styles.\n */\nexport function getTypographyClassesAndStyles( attributes, settings ) {\n\tlet typographyStyles = attributes?.style?.typography || {};\n\tconst fluidTypographySettings = settings?.typography?.fluid;\n\n\tif (\n\t\t!! fluidTypographySettings &&\n\t\t( true === fluidTypographySettings ||\n\t\t\tObject.keys( fluidTypographySettings ).length !== 0 )\n\t) {\n\t\tconst newFontSize =\n\t\t\tgetComputedFluidTypographyValue( {\n\t\t\t\tfontSize: attributes?.style?.typography?.fontSize,\n\t\t\t\tminimumFontSizeLimit: fluidTypographySettings?.minFontSize,\n\t\t\t\tmaximumViewPortWidth: settings?.layout?.wideSize,\n\t\t\t} ) || attributes?.style?.typography?.fontSize;\n\t\ttypographyStyles = {\n\t\t\t...typographyStyles,\n\t\t\tfontSize: newFontSize,\n\t\t};\n\t}\n\n\tconst style = getInlineStyles( { typography: typographyStyles } );\n\tconst fontFamilyClassName = !! attributes?.fontFamily\n\t\t? `has-${ kebabCase( attributes.fontFamily ) }-font-family`\n\t\t: '';\n\n\tconst className = classnames(\n\t\tfontFamilyClassName,\n\t\tgetFontSizeClass( attributes?.fontSize )\n\t);\n\n\treturn {\n\t\tclassName,\n\t\tstyle,\n\t};\n}\n"]}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _exportNames = {
7
+ useEditorWrapperStyles: true
8
+ };
9
+ Object.defineProperty(exports, "useEditorWrapperStyles", {
10
+ enumerable: true,
11
+ get: function () {
12
+ return _hooks.useEditorWrapperStyles;
13
+ }
14
+ });
15
+
16
+ var _index = require("./index.js");
17
+
18
+ Object.keys(_index).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
21
+ if (key in exports && exports[key] === _index[key]) return;
22
+ Object.defineProperty(exports, key, {
23
+ enumerable: true,
24
+ get: function () {
25
+ return _index[key];
26
+ }
27
+ });
28
+ });
29
+
30
+ var _hooks = require("./hooks");
31
+ //# sourceMappingURL=index.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/block-editor/src/index.native.js"],"names":[],"mappings":";;;;;;;;;;;;;;;AAGA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAEA","sourcesContent":["/**\n * Internal dependencies\n */\nexport * from './index.js';\n\nexport { useEditorWrapperStyles } from './hooks';\n"]}
@@ -13,10 +13,6 @@ var _provider = require("./components/provider");
13
13
 
14
14
  var _lockUnlock = require("./lock-unlock");
15
15
 
16
- var _offCanvasEditor = _interopRequireDefault(require("./components/off-canvas-editor"));
17
-
18
- var _leafMoreMenu = _interopRequireDefault(require("./components/off-canvas-editor/leaf-more-menu"));
19
-
20
16
  var _resizableBoxPopover = _interopRequireDefault(require("./components/resizable-box-popover"));
21
17
 
22
18
  var _inserter = require("./components/inserter");
@@ -29,6 +25,8 @@ var _useShouldContextualToolbarShow = require("./utils/use-should-contextual-too
29
25
 
30
26
  var _utils = require("./hooks/utils");
31
27
 
28
+ var _blockEditingMode = require("./components/block-editing-mode");
29
+
32
30
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
33
31
 
34
32
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -44,13 +42,12 @@ const privateApis = {};
44
42
  exports.privateApis = privateApis;
45
43
  (0, _lockUnlock.lock)(privateApis, { ...globalStyles,
46
44
  ExperimentalBlockEditorProvider: _provider.ExperimentalBlockEditorProvider,
47
- LeafMoreMenu: _leafMoreMenu.default,
48
- OffCanvasEditor: _offCanvasEditor.default,
49
45
  PrivateInserter: _inserter.ComposedPrivateInserter,
50
46
  PrivateListView: _listView.PrivateListView,
51
47
  ResizableBoxPopover: _resizableBoxPopover.default,
52
48
  BlockInfo: _blockInfoSlotFill.default,
53
49
  useShouldContextualToolbarShow: _useShouldContextualToolbarShow.useShouldContextualToolbarShow,
54
- cleanEmptyObject: _utils.cleanEmptyObject
50
+ cleanEmptyObject: _utils.cleanEmptyObject,
51
+ useBlockEditingMode: _blockEditingMode.useBlockEditingMode
55
52
  });
56
53
  //# sourceMappingURL=private-apis.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/private-apis.js"],"names":["privateApis","globalStyles","ExperimentalBlockEditorProvider","LeafMoreMenu","OffCanvasEditor","PrivateInserter","PrivateListView","ResizableBoxPopover","BlockInfo","useShouldContextualToolbarShow","cleanEmptyObject"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAbA;AACA;AACA;;AAaA;AACA;AACA;AACO,MAAMA,WAAW,GAAG,EAApB;;AACP,sBAAMA,WAAN,EAAmB,EAClB,GAAGC,YADe;AAElBC,EAAAA,+BAA+B,EAA/BA,yCAFkB;AAGlBC,EAAAA,YAAY,EAAZA,qBAHkB;AAIlBC,EAAAA,eAAe,EAAfA,wBAJkB;AAKlBC,EAAAA,eAAe,EAAfA,iCALkB;AAMlBC,EAAAA,eAAe,EAAfA,yBANkB;AAOlBC,EAAAA,mBAAmB,EAAnBA,4BAPkB;AAQlBC,EAAAA,SAAS,EAATA,0BARkB;AASlBC,EAAAA,8BAA8B,EAA9BA,8DATkB;AAUlBC,EAAAA,gBAAgB,EAAhBA;AAVkB,CAAnB","sourcesContent":["/**\n * Internal dependencies\n */\nimport * as globalStyles from './components/global-styles';\nimport { ExperimentalBlockEditorProvider } from './components/provider';\nimport { lock } from './lock-unlock';\nimport OffCanvasEditor from './components/off-canvas-editor';\nimport LeafMoreMenu from './components/off-canvas-editor/leaf-more-menu';\nimport ResizableBoxPopover from './components/resizable-box-popover';\nimport { ComposedPrivateInserter as PrivateInserter } from './components/inserter';\nimport { PrivateListView } from './components/list-view';\nimport BlockInfo from './components/block-info-slot-fill';\nimport { useShouldContextualToolbarShow } from './utils/use-should-contextual-toolbar-show';\nimport { cleanEmptyObject } from './hooks/utils';\n\n/**\n * Private @wordpress/block-editor APIs.\n */\nexport const privateApis = {};\nlock( privateApis, {\n\t...globalStyles,\n\tExperimentalBlockEditorProvider,\n\tLeafMoreMenu,\n\tOffCanvasEditor,\n\tPrivateInserter,\n\tPrivateListView,\n\tResizableBoxPopover,\n\tBlockInfo,\n\tuseShouldContextualToolbarShow,\n\tcleanEmptyObject,\n} );\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/private-apis.js"],"names":["privateApis","globalStyles","ExperimentalBlockEditorProvider","PrivateInserter","PrivateListView","ResizableBoxPopover","BlockInfo","useShouldContextualToolbarShow","cleanEmptyObject","useBlockEditingMode"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAZA;AACA;AACA;;AAYA;AACA;AACA;AACO,MAAMA,WAAW,GAAG,EAApB;;AACP,sBAAMA,WAAN,EAAmB,EAClB,GAAGC,YADe;AAElBC,EAAAA,+BAA+B,EAA/BA,yCAFkB;AAGlBC,EAAAA,eAAe,EAAfA,iCAHkB;AAIlBC,EAAAA,eAAe,EAAfA,yBAJkB;AAKlBC,EAAAA,mBAAmB,EAAnBA,4BALkB;AAMlBC,EAAAA,SAAS,EAATA,0BANkB;AAOlBC,EAAAA,8BAA8B,EAA9BA,8DAPkB;AAQlBC,EAAAA,gBAAgB,EAAhBA,uBARkB;AASlBC,EAAAA,mBAAmB,EAAnBA;AATkB,CAAnB","sourcesContent":["/**\n * Internal dependencies\n */\nimport * as globalStyles from './components/global-styles';\nimport { ExperimentalBlockEditorProvider } from './components/provider';\nimport { lock } from './lock-unlock';\nimport ResizableBoxPopover from './components/resizable-box-popover';\nimport { ComposedPrivateInserter as PrivateInserter } from './components/inserter';\nimport { PrivateListView } from './components/list-view';\nimport BlockInfo from './components/block-info-slot-fill';\nimport { useShouldContextualToolbarShow } from './utils/use-should-contextual-toolbar-show';\nimport { cleanEmptyObject } from './hooks/utils';\nimport { useBlockEditingMode } from './components/block-editing-mode';\n\n/**\n * Private @wordpress/block-editor APIs.\n */\nexport const privateApis = {};\nlock( privateApis, {\n\t...globalStyles,\n\tExperimentalBlockEditorProvider,\n\tPrivateInserter,\n\tPrivateListView,\n\tResizableBoxPopover,\n\tBlockInfo,\n\tuseShouldContextualToolbarShow,\n\tcleanEmptyObject,\n\tuseBlockEditingMode,\n} );\n"]}
@@ -5,7 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.__experimentalUpdateSettings = __experimentalUpdateSettings;
7
7
  exports.hideBlockInterface = hideBlockInterface;
8
+ exports.setBlockEditingMode = setBlockEditingMode;
8
9
  exports.showBlockInterface = showBlockInterface;
10
+ exports.unsetBlockEditingMode = unsetBlockEditingMode;
9
11
 
10
12
  var _element = require("@wordpress/element");
11
13
 
@@ -75,4 +77,48 @@ function showBlockInterface() {
75
77
  type: 'SHOW_BLOCK_INTERFACE'
76
78
  };
77
79
  }
80
+ /**
81
+ * @typedef {import('../components/block-editing-mode').BlockEditingMode} BlockEditingMode
82
+ */
83
+
84
+ /**
85
+ * Sets the block editing mode for a given block.
86
+ *
87
+ * @see useBlockEditingMode
88
+ *
89
+ * @param {string} clientId The block client ID, or `''` for the root container.
90
+ * @param {BlockEditingMode} mode The block editing mode. One of `'disabled'`,
91
+ * `'contentOnly'`, or `'default'`.
92
+ *
93
+ * @return {Object} Action object.
94
+ */
95
+
96
+
97
+ function setBlockEditingMode() {
98
+ let clientId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
99
+ let mode = arguments.length > 1 ? arguments[1] : undefined;
100
+ return {
101
+ type: 'SET_BLOCK_EDITING_MODE',
102
+ clientId,
103
+ mode
104
+ };
105
+ }
106
+ /**
107
+ * Clears the block editing mode for a given block.
108
+ *
109
+ * @see useBlockEditingMode
110
+ *
111
+ * @param {string} clientId The block client ID, or `''` for the root container.
112
+ *
113
+ * @return {Object} Action object.
114
+ */
115
+
116
+
117
+ function unsetBlockEditingMode() {
118
+ let clientId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
119
+ return {
120
+ type: 'UNSET_BLOCK_EDITING_MODE',
121
+ clientId
122
+ };
123
+ }
78
124
  //# sourceMappingURL=private-actions.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/store/private-actions.js"],"names":["privateSettings","__experimentalUpdateSettings","settings","stripExperimentalSettings","cleanSettings","Platform","OS","key","includes","type","hideBlockInterface","showBlockInterface"],"mappings":";;;;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,eAAe,GAAG,CACvB,yBADuB,EAEvB,yBAFuB,CAAxB;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACO,SAASC,4BAAT,CACNC,QADM,EAGL;AAAA,MADDC,yBACC,uEAD2B,KAC3B;AACD,MAAIC,aAAa,GAAGF,QAApB,CADC,CAED;AACA;;AACA,MAAKC,yBAAyB,IAAIE,kBAASC,EAAT,KAAgB,KAAlD,EAA0D;AACzDF,IAAAA,aAAa,GAAG,EAAhB;;AACA,SAAM,MAAMG,GAAZ,IAAmBL,QAAnB,EAA8B;AAC7B,UAAK,CAAEF,eAAe,CAACQ,QAAhB,CAA0BD,GAA1B,CAAP,EAAyC;AACxCH,QAAAA,aAAa,CAAEG,GAAF,CAAb,GAAuBL,QAAQ,CAAEK,GAAF,CAA/B;AACA;AACD;AACD;;AACD,SAAO;AACNE,IAAAA,IAAI,EAAE,iBADA;AAENP,IAAAA,QAAQ,EAAEE;AAFJ,GAAP;AAIA;AAED;AACA;AACA;AACA;AACA;;;AACO,SAASM,kBAAT,GAA8B;AACpC,SAAO;AACND,IAAAA,IAAI,EAAE;AADA,GAAP;AAGA;AAED;AACA;AACA;AACA;AACA;;;AACO,SAASE,kBAAT,GAA8B;AACpC,SAAO;AACNF,IAAAA,IAAI,EAAE;AADA,GAAP;AAGA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Platform } from '@wordpress/element';\n\n/**\n * A list of private/experimental block editor settings that\n * should not become a part of the WordPress public API.\n * BlockEditorProvider will remove these settings from the\n * settings object it receives.\n *\n * @see https://github.com/WordPress/gutenberg/pull/46131\n */\nconst privateSettings = [\n\t'inserterMediaCategories',\n\t'blockInspectorAnimation',\n];\n\n/**\n * Action that updates the block editor settings and\n * conditionally preserves the experimental ones.\n *\n * @param {Object} settings Updated settings\n * @param {boolean} stripExperimentalSettings Whether to strip experimental settings.\n * @return {Object} Action object\n */\nexport function __experimentalUpdateSettings(\n\tsettings,\n\tstripExperimentalSettings = false\n) {\n\tlet cleanSettings = settings;\n\t// There are no plugins in the mobile apps, so there is no\n\t// need to strip the experimental settings:\n\tif ( stripExperimentalSettings && Platform.OS === 'web' ) {\n\t\tcleanSettings = {};\n\t\tfor ( const key in settings ) {\n\t\t\tif ( ! privateSettings.includes( key ) ) {\n\t\t\t\tcleanSettings[ key ] = settings[ key ];\n\t\t\t}\n\t\t}\n\t}\n\treturn {\n\t\ttype: 'UPDATE_SETTINGS',\n\t\tsettings: cleanSettings,\n\t};\n}\n\n/**\n * Hides the block interface (eg. toolbar, outline, etc.)\n *\n * @return {Object} Action object.\n */\nexport function hideBlockInterface() {\n\treturn {\n\t\ttype: 'HIDE_BLOCK_INTERFACE',\n\t};\n}\n\n/**\n * Shows the block interface (eg. toolbar, outline, etc.)\n *\n * @return {Object} Action object.\n */\nexport function showBlockInterface() {\n\treturn {\n\t\ttype: 'SHOW_BLOCK_INTERFACE',\n\t};\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/store/private-actions.js"],"names":["privateSettings","__experimentalUpdateSettings","settings","stripExperimentalSettings","cleanSettings","Platform","OS","key","includes","type","hideBlockInterface","showBlockInterface","setBlockEditingMode","clientId","mode","unsetBlockEditingMode"],"mappings":";;;;;;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,eAAe,GAAG,CACvB,yBADuB,EAEvB,yBAFuB,CAAxB;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACO,SAASC,4BAAT,CACNC,QADM,EAGL;AAAA,MADDC,yBACC,uEAD2B,KAC3B;AACD,MAAIC,aAAa,GAAGF,QAApB,CADC,CAED;AACA;;AACA,MAAKC,yBAAyB,IAAIE,kBAASC,EAAT,KAAgB,KAAlD,EAA0D;AACzDF,IAAAA,aAAa,GAAG,EAAhB;;AACA,SAAM,MAAMG,GAAZ,IAAmBL,QAAnB,EAA8B;AAC7B,UAAK,CAAEF,eAAe,CAACQ,QAAhB,CAA0BD,GAA1B,CAAP,EAAyC;AACxCH,QAAAA,aAAa,CAAEG,GAAF,CAAb,GAAuBL,QAAQ,CAAEK,GAAF,CAA/B;AACA;AACD;AACD;;AACD,SAAO;AACNE,IAAAA,IAAI,EAAE,iBADA;AAENP,IAAAA,QAAQ,EAAEE;AAFJ,GAAP;AAIA;AAED;AACA;AACA;AACA;AACA;;;AACO,SAASM,kBAAT,GAA8B;AACpC,SAAO;AACND,IAAAA,IAAI,EAAE;AADA,GAAP;AAGA;AAED;AACA;AACA;AACA;AACA;;;AACO,SAASE,kBAAT,GAA8B;AACpC,SAAO;AACNF,IAAAA,IAAI,EAAE;AADA,GAAP;AAGA;AAED;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASG,mBAAT,GAAoD;AAAA,MAAtBC,QAAsB,uEAAX,EAAW;AAAA,MAAPC,IAAO;AAC1D,SAAO;AACNL,IAAAA,IAAI,EAAE,wBADA;AAENI,IAAAA,QAFM;AAGNC,IAAAA;AAHM,GAAP;AAKA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASC,qBAAT,GAAgD;AAAA,MAAhBF,QAAgB,uEAAL,EAAK;AACtD,SAAO;AACNJ,IAAAA,IAAI,EAAE,0BADA;AAENI,IAAAA;AAFM,GAAP;AAIA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Platform } from '@wordpress/element';\n\n/**\n * A list of private/experimental block editor settings that\n * should not become a part of the WordPress public API.\n * BlockEditorProvider will remove these settings from the\n * settings object it receives.\n *\n * @see https://github.com/WordPress/gutenberg/pull/46131\n */\nconst privateSettings = [\n\t'inserterMediaCategories',\n\t'blockInspectorAnimation',\n];\n\n/**\n * Action that updates the block editor settings and\n * conditionally preserves the experimental ones.\n *\n * @param {Object} settings Updated settings\n * @param {boolean} stripExperimentalSettings Whether to strip experimental settings.\n * @return {Object} Action object\n */\nexport function __experimentalUpdateSettings(\n\tsettings,\n\tstripExperimentalSettings = false\n) {\n\tlet cleanSettings = settings;\n\t// There are no plugins in the mobile apps, so there is no\n\t// need to strip the experimental settings:\n\tif ( stripExperimentalSettings && Platform.OS === 'web' ) {\n\t\tcleanSettings = {};\n\t\tfor ( const key in settings ) {\n\t\t\tif ( ! privateSettings.includes( key ) ) {\n\t\t\t\tcleanSettings[ key ] = settings[ key ];\n\t\t\t}\n\t\t}\n\t}\n\treturn {\n\t\ttype: 'UPDATE_SETTINGS',\n\t\tsettings: cleanSettings,\n\t};\n}\n\n/**\n * Hides the block interface (eg. toolbar, outline, etc.)\n *\n * @return {Object} Action object.\n */\nexport function hideBlockInterface() {\n\treturn {\n\t\ttype: 'HIDE_BLOCK_INTERFACE',\n\t};\n}\n\n/**\n * Shows the block interface (eg. toolbar, outline, etc.)\n *\n * @return {Object} Action object.\n */\nexport function showBlockInterface() {\n\treturn {\n\t\ttype: 'SHOW_BLOCK_INTERFACE',\n\t};\n}\n\n/**\n * @typedef {import('../components/block-editing-mode').BlockEditingMode} BlockEditingMode\n */\n\n/**\n * Sets the block editing mode for a given block.\n *\n * @see useBlockEditingMode\n *\n * @param {string} clientId The block client ID, or `''` for the root container.\n * @param {BlockEditingMode} mode The block editing mode. One of `'disabled'`,\n * `'contentOnly'`, or `'default'`.\n *\n * @return {Object} Action object.\n */\nexport function setBlockEditingMode( clientId = '', mode ) {\n\treturn {\n\t\ttype: 'SET_BLOCK_EDITING_MODE',\n\t\tclientId,\n\t\tmode,\n\t};\n}\n\n/**\n * Clears the block editing mode for a given block.\n *\n * @see useBlockEditingMode\n *\n * @param {string} clientId The block client ID, or `''` for the root container.\n *\n * @return {Object} Action object.\n */\nexport function unsetBlockEditingMode( clientId = '' ) {\n\treturn {\n\t\ttype: 'UNSET_BLOCK_EDITING_MODE',\n\t\tclientId,\n\t};\n}\n"]}
@@ -1,11 +1,34 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
8
+ exports.getBlockEditingMode = void 0;
6
9
  exports.getLastInsertedBlocksClientIds = getLastInsertedBlocksClientIds;
7
10
  exports.isBlockInterfaceHidden = isBlockInterfaceHidden;
8
11
 
12
+ var _rememo = _interopRequireDefault(require("rememo"));
13
+
14
+ var _data = require("@wordpress/data");
15
+
16
+ var _blocks = require("@wordpress/blocks");
17
+
18
+ var _selectors = require("./selectors");
19
+
20
+ /**
21
+ * External dependencies
22
+ */
23
+
24
+ /**
25
+ * WordPress dependencies
26
+ */
27
+
28
+ /**
29
+ * Internal dependencies
30
+ */
31
+
9
32
  /**
10
33
  * Returns true if the block interface is hidden, or false otherwise.
11
34
  *
@@ -29,4 +52,69 @@ function getLastInsertedBlocksClientIds(state) {
29
52
 
30
53
  return state === null || state === void 0 ? void 0 : (_state$lastBlockInser = state.lastBlockInserted) === null || _state$lastBlockInser === void 0 ? void 0 : _state$lastBlockInser.clientIds;
31
54
  }
55
+ /**
56
+ * @typedef {import('../components/block-editing-mode').BlockEditingMode} BlockEditingMode
57
+ */
58
+
59
+ /**
60
+ * Returns the block editing mode for a given block.
61
+ *
62
+ * The mode can be one of three options:
63
+ *
64
+ * - `'disabled'`: Prevents editing the block entirely, i.e. it cannot be
65
+ * selected.
66
+ * - `'contentOnly'`: Hides all non-content UI, e.g. auxiliary controls in the
67
+ * toolbar, the block movers, block settings.
68
+ * - `'default'`: Allows editing the block as normal.
69
+ *
70
+ * Blocks can set a mode using the `useBlockEditingMode` hook.
71
+ *
72
+ * The mode is inherited by all of the block's inner blocks, unless they have
73
+ * their own mode.
74
+ *
75
+ * A template lock can also set a mode. If the template lock is `'contentOnly'`,
76
+ * the block's mode is overridden to `'contentOnly'` if the block has a content
77
+ * role attribute, or `'disabled'` otherwise.
78
+ *
79
+ * @see useBlockEditingMode
80
+ *
81
+ * @param {Object} state Global application state.
82
+ * @param {string} clientId The block client ID, or `''` for the root container.
83
+ *
84
+ * @return {BlockEditingMode} The block editing mode. One of `'disabled'`,
85
+ * `'contentOnly'`, or `'default'`.
86
+ */
87
+
88
+
89
+ const getBlockEditingMode = (0, _data.createRegistrySelector)(select => function (state) {
90
+ let clientId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
91
+ const explicitEditingMode = getExplcitBlockEditingMode(state, clientId);
92
+ const rootClientId = (0, _selectors.getBlockRootClientId)(state, clientId);
93
+ const templateLock = (0, _selectors.getTemplateLock)(state, rootClientId);
94
+ const name = (0, _selectors.getBlockName)(state, clientId);
95
+
96
+ const isContent = select(_blocks.store).__experimentalHasContentRoleAttribute(name);
97
+
98
+ if (explicitEditingMode === 'disabled' || templateLock === 'contentOnly' && !isContent) {
99
+ return 'disabled';
100
+ }
101
+
102
+ if (explicitEditingMode === 'contentOnly' || templateLock === 'contentOnly' && isContent) {
103
+ return 'contentOnly';
104
+ }
105
+
106
+ return 'default';
107
+ });
108
+ exports.getBlockEditingMode = getBlockEditingMode;
109
+ const getExplcitBlockEditingMode = (0, _rememo.default)(function (state) {
110
+ var _state$blockEditingMo;
111
+
112
+ let clientId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
113
+
114
+ while (!state.blockEditingModes.has(clientId) && state.blocks.parents.has(clientId)) {
115
+ clientId = state.blocks.parents.get(clientId);
116
+ }
117
+
118
+ return (_state$blockEditingMo = state.blockEditingModes.get(clientId)) !== null && _state$blockEditingMo !== void 0 ? _state$blockEditingMo : 'default';
119
+ }, state => [state.blockEditingModes, state.blocks.parents]);
32
120
  //# sourceMappingURL=private-selectors.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/store/private-selectors.js"],"names":["isBlockInterfaceHidden","state","getLastInsertedBlocksClientIds","lastBlockInserted","clientIds"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,sBAAT,CAAiCC,KAAjC,EAAyC;AAC/C,SAAOA,KAAK,CAACD,sBAAb;AACA;AAED;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASE,8BAAT,CAAyCD,KAAzC,EAAiD;AAAA;;AACvD,SAAOA,KAAP,aAAOA,KAAP,gDAAOA,KAAK,CAAEE,iBAAd,0DAAO,sBAA0BC,SAAjC;AACA","sourcesContent":["/**\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"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/store/private-selectors.js"],"names":["isBlockInterfaceHidden","state","getLastInsertedBlocksClientIds","lastBlockInserted","clientIds","getBlockEditingMode","select","clientId","explicitEditingMode","getExplcitBlockEditingMode","rootClientId","templateLock","name","isContent","blocksStore","__experimentalHasContentRoleAttribute","blockEditingModes","has","blocks","parents","get"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AAKA;;AAdA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,sBAAT,CAAiCC,KAAjC,EAAyC;AAC/C,SAAOA,KAAK,CAACD,sBAAb;AACA;AAED;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASE,8BAAT,CAAyCD,KAAzC,EAAiD;AAAA;;AACvD,SAAOA,KAAP,aAAOA,KAAP,gDAAOA,KAAK,CAAEE,iBAAd,0DAAO,sBAA0BC,SAAjC;AACA;AAED;AACA;AACA;;AAEA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AAxB,CAA6Bb,QAA7B,CAAP,yEAAkD,SAAlD;AACA,CATiC,EAUhCN,KAAF,IAAa,CAAEA,KAAK,CAACe,iBAAR,EAA2Bf,KAAK,CAACiB,MAAN,CAAaC,OAAxC,CAVqB,CAAnC","sourcesContent":["/**\n * External dependencies\n */\nimport createSelector from 'rememo';\n\n/**\n * WordPress dependencies\n */\nimport { createRegistrySelector } from '@wordpress/data';\nimport { store as blocksStore } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport {\n\tgetBlockRootClientId,\n\tgetTemplateLock,\n\tgetBlockName,\n} from './selectors';\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\n/**\n * @typedef {import('../components/block-editing-mode').BlockEditingMode} BlockEditingMode\n */\n\n/**\n * Returns the block editing mode for a given block.\n *\n * The mode can be one of three options:\n *\n * - `'disabled'`: Prevents editing the block entirely, i.e. it cannot be\n * selected.\n * - `'contentOnly'`: Hides all non-content UI, e.g. auxiliary controls in the\n * toolbar, the block movers, block settings.\n * - `'default'`: Allows editing the block as normal.\n *\n * Blocks can set a mode using the `useBlockEditingMode` hook.\n *\n * The mode is inherited by all of the block's inner blocks, unless they have\n * their own mode.\n *\n * A template lock can also set a mode. If the template lock is `'contentOnly'`,\n * the block's mode is overridden to `'contentOnly'` if the block has a content\n * role attribute, or `'disabled'` otherwise.\n *\n * @see useBlockEditingMode\n *\n * @param {Object} state Global application state.\n * @param {string} clientId The block client ID, or `''` for the root container.\n *\n * @return {BlockEditingMode} The block editing mode. One of `'disabled'`,\n * `'contentOnly'`, or `'default'`.\n */\nexport const getBlockEditingMode = createRegistrySelector(\n\t( select ) =>\n\t\t( state, clientId = '' ) => {\n\t\t\tconst explicitEditingMode = getExplcitBlockEditingMode(\n\t\t\t\tstate,\n\t\t\t\tclientId\n\t\t\t);\n\t\t\tconst rootClientId = getBlockRootClientId( state, clientId );\n\t\t\tconst templateLock = getTemplateLock( state, rootClientId );\n\t\t\tconst name = getBlockName( state, clientId );\n\t\t\tconst isContent =\n\t\t\t\tselect( blocksStore ).__experimentalHasContentRoleAttribute(\n\t\t\t\t\tname\n\t\t\t\t);\n\t\t\tif (\n\t\t\t\texplicitEditingMode === 'disabled' ||\n\t\t\t\t( templateLock === 'contentOnly' && ! isContent )\n\t\t\t) {\n\t\t\t\treturn 'disabled';\n\t\t\t}\n\t\t\tif (\n\t\t\t\texplicitEditingMode === 'contentOnly' ||\n\t\t\t\t( templateLock === 'contentOnly' && isContent )\n\t\t\t) {\n\t\t\t\treturn 'contentOnly';\n\t\t\t}\n\t\t\treturn 'default';\n\t\t}\n);\n\nconst getExplcitBlockEditingMode = createSelector(\n\t( state, clientId = '' ) => {\n\t\twhile (\n\t\t\t! state.blockEditingModes.has( clientId ) &&\n\t\t\tstate.blocks.parents.has( clientId )\n\t\t) {\n\t\t\tclientId = state.blocks.parents.get( clientId );\n\t\t}\n\t\treturn state.blockEditingModes.get( clientId ) ?? 'default';\n\t},\n\t( state ) => [ state.blockEditingModes, state.blocks.parents ]\n);\n"]}
@@ -5,6 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
+ exports.blockEditingModes = blockEditingModes;
8
9
  exports.blockListSettings = void 0;
9
10
  exports.blockVisibility = blockVisibility;
10
11
  exports.blocks = void 0;
@@ -1916,6 +1917,39 @@ function temporarilyEditingAsBlocks() {
1916
1917
 
1917
1918
  return state;
1918
1919
  }
1920
+ /**
1921
+ * Reducer returning a map of block client IDs to block editing modes.
1922
+ *
1923
+ * @param {Map} state Current state.
1924
+ * @param {Object} action Dispatched action.
1925
+ *
1926
+ * @return {Map} Updated state.
1927
+ */
1928
+
1929
+
1930
+ function blockEditingModes() {
1931
+ let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Map();
1932
+ let action = arguments.length > 1 ? arguments[1] : undefined;
1933
+
1934
+ switch (action.type) {
1935
+ case 'SET_BLOCK_EDITING_MODE':
1936
+ return new Map(state).set(action.clientId, action.mode);
1937
+
1938
+ case 'UNSET_BLOCK_EDITING_MODE':
1939
+ {
1940
+ const newState = new Map(state);
1941
+ newState.delete(action.clientId);
1942
+ return newState;
1943
+ }
1944
+
1945
+ case 'RESET_BLOCKS':
1946
+ {
1947
+ return state.has('') ? new Map().set('', state.get('')) : state;
1948
+ }
1949
+ }
1950
+
1951
+ return state;
1952
+ }
1919
1953
 
1920
1954
  const combinedReducers = (0, _data.combineReducers)({
1921
1955
  blocks,
@@ -1938,7 +1972,8 @@ const combinedReducers = (0, _data.combineReducers)({
1938
1972
  highlightedBlock,
1939
1973
  lastBlockInserted,
1940
1974
  temporarilyEditingAsBlocks,
1941
- blockVisibility
1975
+ blockVisibility,
1976
+ blockEditingModes
1942
1977
  });
1943
1978
 
1944
1979
  function withAutomaticChangeReset(reducer) {