@wordpress/block-editor 14.12.0 → 14.13.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 (940) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/autocompleters/block.js +0 -1
  3. package/build/autocompleters/block.js.map +1 -1
  4. package/build/autocompleters/link.js +0 -1
  5. package/build/autocompleters/link.js.map +1 -1
  6. package/build/components/alignment-control/ui.js +0 -1
  7. package/build/components/alignment-control/ui.js.map +1 -1
  8. package/build/components/autocomplete/index.js +0 -1
  9. package/build/components/autocomplete/index.js.map +1 -1
  10. package/build/components/background-image-control/index.js +0 -1
  11. package/build/components/background-image-control/index.js.map +1 -1
  12. package/build/components/block-actions/index.js +0 -1
  13. package/build/components/block-actions/index.js.map +1 -1
  14. package/build/components/block-alignment-control/ui.js +0 -1
  15. package/build/components/block-alignment-control/ui.js.map +1 -1
  16. package/build/components/block-alignment-control/ui.native.js +0 -1
  17. package/build/components/block-alignment-control/ui.native.js.map +1 -1
  18. package/build/components/block-alignment-control/use-available-alignments.js +0 -1
  19. package/build/components/block-alignment-control/use-available-alignments.js.map +1 -1
  20. package/build/components/block-breadcrumb/index.js +0 -1
  21. package/build/components/block-breadcrumb/index.js.map +1 -1
  22. package/build/components/block-compare/index.js +0 -1
  23. package/build/components/block-compare/index.js.map +1 -1
  24. package/build/components/block-controls/fill.js +0 -1
  25. package/build/components/block-controls/fill.js.map +1 -1
  26. package/build/components/block-edit/edit.js +0 -1
  27. package/build/components/block-edit/edit.js.map +1 -1
  28. package/build/components/block-edit/edit.native.js +0 -1
  29. package/build/components/block-edit/edit.native.js.map +1 -1
  30. package/build/components/block-heading-level-dropdown/index.js +0 -1
  31. package/build/components/block-heading-level-dropdown/index.js.map +1 -1
  32. package/build/components/block-heading-level-dropdown/index.native.js +0 -1
  33. package/build/components/block-heading-level-dropdown/index.native.js.map +1 -1
  34. package/build/components/block-inspector/index.js +0 -1
  35. package/build/components/block-inspector/index.js.map +1 -1
  36. package/build/components/block-list/block-invalid-warning.js +0 -1
  37. package/build/components/block-list/block-invalid-warning.js.map +1 -1
  38. package/build/components/block-list/block-list-context.native.js +0 -1
  39. package/build/components/block-list/block-list-context.native.js.map +1 -1
  40. package/build/components/block-list/block.js +0 -1
  41. package/build/components/block-list/block.js.map +1 -1
  42. package/build/components/block-list/block.native.js +0 -1
  43. package/build/components/block-list/block.native.js.map +1 -1
  44. package/build/components/block-list/index.js +9 -6
  45. package/build/components/block-list/index.js.map +1 -1
  46. package/build/components/block-list/index.native.js +0 -1
  47. package/build/components/block-list/index.native.js.map +1 -1
  48. package/build/components/block-list/use-block-props/use-focus-first-element.js +0 -1
  49. package/build/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  50. package/build/components/block-list/use-in-between-inserter.js +0 -1
  51. package/build/components/block-list/use-in-between-inserter.js.map +1 -1
  52. package/build/components/block-lock/modal.js +0 -1
  53. package/build/components/block-lock/modal.js.map +1 -1
  54. package/build/components/block-manager/category.js +0 -1
  55. package/build/components/block-manager/category.js.map +1 -1
  56. package/build/components/block-manager/checklist.js +0 -1
  57. package/build/components/block-manager/checklist.js.map +1 -1
  58. package/build/components/block-manager/index.js +0 -1
  59. package/build/components/block-manager/index.js.map +1 -1
  60. package/build/components/block-media-update-progress/index.native.js +0 -1
  61. package/build/components/block-media-update-progress/index.native.js.map +1 -1
  62. package/build/components/block-mover/index.native.js +0 -1
  63. package/build/components/block-mover/index.native.js.map +1 -1
  64. package/build/components/block-mover/mover-description.native.js +0 -1
  65. package/build/components/block-mover/mover-description.native.js.map +1 -1
  66. package/build/components/block-pattern-setup/index.js +0 -1
  67. package/build/components/block-pattern-setup/index.js.map +1 -1
  68. package/build/components/block-pattern-setup/use-patterns-setup.js +0 -1
  69. package/build/components/block-pattern-setup/use-patterns-setup.js.map +1 -1
  70. package/build/components/block-patterns-list/index.js +0 -1
  71. package/build/components/block-patterns-list/index.js.map +1 -1
  72. package/build/components/block-popover/use-popover-scroll.js +13 -7
  73. package/build/components/block-popover/use-popover-scroll.js.map +1 -1
  74. package/build/components/block-quick-navigation/index.js +0 -1
  75. package/build/components/block-quick-navigation/index.js.map +1 -1
  76. package/build/components/block-rename/modal.js +0 -1
  77. package/build/components/block-rename/modal.js.map +1 -1
  78. package/build/components/block-settings-menu/block-settings-dropdown.js +0 -1
  79. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  80. package/build/components/block-styles/index.js +0 -1
  81. package/build/components/block-styles/index.js.map +1 -1
  82. package/build/components/block-styles/index.native.js +0 -1
  83. package/build/components/block-styles/index.native.js.map +1 -1
  84. package/build/components/block-styles/menu-items.js +0 -1
  85. package/build/components/block-styles/menu-items.js.map +1 -1
  86. package/build/components/block-styles/preview.native.js +0 -1
  87. package/build/components/block-styles/preview.native.js.map +1 -1
  88. package/build/components/block-switcher/block-transformations-menu.js +0 -1
  89. package/build/components/block-switcher/block-transformations-menu.js.map +1 -1
  90. package/build/components/block-switcher/block-transformations-menu.native.js +0 -1
  91. package/build/components/block-switcher/block-transformations-menu.native.js.map +1 -1
  92. package/build/components/block-switcher/block-variation-transformations.js +0 -1
  93. package/build/components/block-switcher/block-variation-transformations.js.map +1 -1
  94. package/build/components/block-switcher/index.js +0 -1
  95. package/build/components/block-switcher/index.js.map +1 -1
  96. package/build/components/block-switcher/pattern-transformations-menu.js +0 -1
  97. package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  98. package/build/components/block-switcher/use-transformed-patterns.js +0 -1
  99. package/build/components/block-switcher/use-transformed-patterns.js.map +1 -1
  100. package/build/components/block-switcher/utils.js +0 -1
  101. package/build/components/block-switcher/utils.js.map +1 -1
  102. package/build/components/block-toolbar/block-toolbar-menu.native.js +0 -1
  103. package/build/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
  104. package/build/components/block-toolbar/change-design.js +0 -1
  105. package/build/components/block-toolbar/change-design.js.map +1 -1
  106. package/build/components/block-toolbar/index.js +0 -1
  107. package/build/components/block-toolbar/index.js.map +1 -1
  108. package/build/components/block-tools/block-toolbar-popover.js +3 -2
  109. package/build/components/block-tools/block-toolbar-popover.js.map +1 -1
  110. package/build/components/block-tools/use-selected-block-tool-props.js +0 -1
  111. package/build/components/block-tools/use-selected-block-tool-props.js.map +1 -1
  112. package/build/components/block-types-list/index.js +0 -1
  113. package/build/components/block-types-list/index.js.map +1 -1
  114. package/build/components/block-variation-picker/index.js +0 -1
  115. package/build/components/block-variation-picker/index.js.map +1 -1
  116. package/build/components/block-variation-picker/index.native.js +0 -1
  117. package/build/components/block-variation-picker/index.native.js.map +1 -1
  118. package/build/components/block-variation-transforms/index.js +0 -1
  119. package/build/components/block-variation-transforms/index.js.map +1 -1
  120. package/build/components/block-vertical-alignment-control/ui.js +0 -1
  121. package/build/components/block-vertical-alignment-control/ui.js.map +1 -1
  122. package/build/components/border-radius-control/index.js +0 -1
  123. package/build/components/border-radius-control/index.js.map +1 -1
  124. package/build/components/border-radius-control/input-controls.js +0 -1
  125. package/build/components/border-radius-control/input-controls.js.map +1 -1
  126. package/build/components/border-radius-control/utils.js +0 -1
  127. package/build/components/border-radius-control/utils.js.map +1 -1
  128. package/build/components/colors/utils.js +0 -1
  129. package/build/components/colors/utils.js.map +1 -1
  130. package/build/components/colors/with-colors.js +0 -1
  131. package/build/components/colors/with-colors.js.map +1 -1
  132. package/build/components/colors-gradients/dropdown.js +0 -1
  133. package/build/components/colors-gradients/dropdown.js.map +1 -1
  134. package/build/components/colors-gradients/panel-color-gradient-settings.js +0 -1
  135. package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  136. package/build/components/colors-gradients/panel-color-gradient-settings.native.js +0 -1
  137. package/build/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
  138. package/build/components/convert-to-group-buttons/toolbar.js +0 -1
  139. package/build/components/convert-to-group-buttons/toolbar.js.map +1 -1
  140. package/build/components/date-format-picker/index.js +0 -1
  141. package/build/components/date-format-picker/index.js.map +1 -1
  142. package/build/components/dimensions-tool/scale-tool.js +0 -1
  143. package/build/components/dimensions-tool/scale-tool.js.map +1 -1
  144. package/build/components/duotone/utils.js +0 -1
  145. package/build/components/duotone/utils.js.map +1 -1
  146. package/build/components/editor-styles/index.js +0 -1
  147. package/build/components/editor-styles/index.js.map +1 -1
  148. package/build/components/font-appearance-control/index.js +0 -1
  149. package/build/components/font-appearance-control/index.js.map +1 -1
  150. package/build/components/font-family/index.js +0 -1
  151. package/build/components/font-family/index.js.map +1 -1
  152. package/build/components/font-sizes/with-font-sizes.js +0 -1
  153. package/build/components/font-sizes/with-font-sizes.js.map +1 -1
  154. package/build/components/global-styles/border-panel.js +0 -1
  155. package/build/components/global-styles/border-panel.js.map +1 -1
  156. package/build/components/global-styles/color-panel.js +0 -1
  157. package/build/components/global-styles/color-panel.js.map +1 -1
  158. package/build/components/global-styles/color-panel.native.js +0 -1
  159. package/build/components/global-styles/color-panel.native.js.map +1 -1
  160. package/build/components/global-styles/dimensions-panel.js +0 -1
  161. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  162. package/build/components/global-styles/filters-panel.js +42 -25
  163. package/build/components/global-styles/filters-panel.js.map +1 -1
  164. package/build/components/global-styles/get-global-styles-changes.js +0 -1
  165. package/build/components/global-styles/get-global-styles-changes.js.map +1 -1
  166. package/build/components/global-styles/shadow-panel-components.js +41 -17
  167. package/build/components/global-styles/shadow-panel-components.js.map +1 -1
  168. package/build/components/global-styles/typography-utils.js +0 -1
  169. package/build/components/global-styles/typography-utils.js.map +1 -1
  170. package/build/components/global-styles/use-global-styles-context.native.js +0 -1
  171. package/build/components/global-styles/use-global-styles-context.native.js.map +1 -1
  172. package/build/components/global-styles/use-global-styles-output.js +0 -1
  173. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  174. package/build/components/global-styles/utils.js +0 -1
  175. package/build/components/global-styles/utils.js.map +1 -1
  176. package/build/components/grid/grid-visualizer.js +0 -1
  177. package/build/components/grid/grid-visualizer.js.map +1 -1
  178. package/build/components/grid/use-grid-layout-sync.js +0 -1
  179. package/build/components/grid/use-grid-layout-sync.js.map +1 -1
  180. package/build/components/grid/utils.js +0 -1
  181. package/build/components/grid/utils.js.map +1 -1
  182. package/build/components/iframe/get-compatibility-styles.js +0 -1
  183. package/build/components/iframe/get-compatibility-styles.js.map +1 -1
  184. package/build/components/image-editor/aspect-ratio-dropdown.js +1 -2
  185. package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  186. package/build/components/inner-blocks/index.js +2 -2
  187. package/build/components/inner-blocks/index.js.map +1 -1
  188. package/build/components/inner-blocks/index.native.js +2 -2
  189. package/build/components/inner-blocks/index.native.js.map +1 -1
  190. package/build/components/inner-blocks/use-block-context.js +0 -1
  191. package/build/components/inner-blocks/use-block-context.js.map +1 -1
  192. package/build/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js +0 -1
  193. package/build/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js.map +1 -1
  194. package/build/components/inserter/block-patterns-explorer/pattern-list.js +0 -1
  195. package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  196. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +0 -1
  197. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  198. package/build/components/inserter/block-patterns-tab/use-pattern-categories.js +0 -1
  199. package/build/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  200. package/build/components/inserter/block-types-tab.js +0 -1
  201. package/build/components/inserter/block-types-tab.js.map +1 -1
  202. package/build/components/inserter/block-types-tab.native.js +0 -1
  203. package/build/components/inserter/block-types-tab.native.js.map +1 -1
  204. package/build/components/inserter/category-tabs/index.js +0 -1
  205. package/build/components/inserter/category-tabs/index.js.map +1 -1
  206. package/build/components/inserter/hooks/use-block-type-impressions.native.js +0 -1
  207. package/build/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
  208. package/build/components/inserter/hooks/use-patterns-state.js +0 -1
  209. package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
  210. package/build/components/inserter/index.js +0 -1
  211. package/build/components/inserter/index.js.map +1 -1
  212. package/build/components/inserter/index.native.js +0 -1
  213. package/build/components/inserter/index.native.js.map +1 -1
  214. package/build/components/inserter/media-tab/hooks.js +0 -1
  215. package/build/components/inserter/media-tab/hooks.js.map +1 -1
  216. package/build/components/inserter/media-tab/media-list.js +0 -1
  217. package/build/components/inserter/media-tab/media-list.js.map +1 -1
  218. package/build/components/inserter/media-tab/media-tab.js +0 -1
  219. package/build/components/inserter/media-tab/media-tab.js.map +1 -1
  220. package/build/components/inserter/mobile-tab-navigation.js +0 -1
  221. package/build/components/inserter/mobile-tab-navigation.js.map +1 -1
  222. package/build/components/inserter/no-results.js +3 -7
  223. package/build/components/inserter/no-results.js.map +1 -1
  224. package/build/components/inserter/quick-inserter.js +2 -1
  225. package/build/components/inserter/quick-inserter.js.map +1 -1
  226. package/build/components/inserter/search-items.js +0 -1
  227. package/build/components/inserter/search-items.js.map +1 -1
  228. package/build/components/inserter/search-results.js +1 -2
  229. package/build/components/inserter/search-results.js.map +1 -1
  230. package/build/components/inserter/tabs.native.js +0 -1
  231. package/build/components/inserter/tabs.native.js.map +1 -1
  232. package/build/components/inserter/utils.native.js +0 -1
  233. package/build/components/inserter/utils.native.js.map +1 -1
  234. package/build/components/inspector-controls/block-support-tools-panel.js +0 -1
  235. package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  236. package/build/components/inspector-controls/fill.js +0 -1
  237. package/build/components/inspector-controls/fill.js.map +1 -1
  238. package/build/components/inspector-controls-tabs/index.js +0 -1
  239. package/build/components/inspector-controls-tabs/index.js.map +1 -1
  240. package/build/components/inspector-popover-header/index.js +0 -1
  241. package/build/components/inspector-popover-header/index.js.map +1 -1
  242. package/build/components/justify-content-control/ui.js +0 -1
  243. package/build/components/justify-content-control/ui.js.map +1 -1
  244. package/build/components/keyboard-shortcuts/index.js +1 -1
  245. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  246. package/build/components/link-control/index.js +0 -1
  247. package/build/components/link-control/index.js.map +1 -1
  248. package/build/components/link-control/search-results.js +0 -1
  249. package/build/components/link-control/search-results.js.map +1 -1
  250. package/build/components/link-control/settings.js +0 -1
  251. package/build/components/link-control/settings.js.map +1 -1
  252. package/build/components/link-control/use-internal-value.js +0 -1
  253. package/build/components/link-control/use-internal-value.js.map +1 -1
  254. package/build/components/link-control/use-search-handler.js +0 -1
  255. package/build/components/link-control/use-search-handler.js.map +1 -1
  256. package/build/components/list-view/block-select-button.js +0 -1
  257. package/build/components/list-view/block-select-button.js.map +1 -1
  258. package/build/components/list-view/block.js +0 -1
  259. package/build/components/list-view/block.js.map +1 -1
  260. package/build/components/list-view/branch.js +0 -1
  261. package/build/components/list-view/branch.js.map +1 -1
  262. package/build/components/list-view/index.js +0 -1
  263. package/build/components/list-view/index.js.map +1 -1
  264. package/build/components/list-view/use-block-selection.js +0 -1
  265. package/build/components/list-view/use-block-selection.js.map +1 -1
  266. package/build/components/list-view/use-clipboard-handler.js +0 -1
  267. package/build/components/list-view/use-clipboard-handler.js.map +1 -1
  268. package/build/components/list-view/use-list-view-block-indexes.js +0 -1
  269. package/build/components/list-view/use-list-view-block-indexes.js.map +1 -1
  270. package/build/components/list-view/use-list-view-drop-zone.js +0 -1
  271. package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
  272. package/build/components/list-view/utils.js +0 -1
  273. package/build/components/list-view/utils.js.map +1 -1
  274. package/build/components/media-placeholder/index.js +0 -1
  275. package/build/components/media-placeholder/index.js.map +1 -1
  276. package/build/components/media-placeholder/index.native.js +0 -1
  277. package/build/components/media-placeholder/index.native.js.map +1 -1
  278. package/build/components/media-replace-flow/index.js +0 -1
  279. package/build/components/media-replace-flow/index.js.map +1 -1
  280. package/build/components/media-upload/index.native.js +0 -1
  281. package/build/components/media-upload/index.native.js.map +1 -1
  282. package/build/components/navigable-toolbar/index.js +0 -1
  283. package/build/components/navigable-toolbar/index.js.map +1 -1
  284. package/build/components/panel-color-settings/index.js +0 -1
  285. package/build/components/panel-color-settings/index.js.map +1 -1
  286. package/build/components/provider/use-block-sync.js +0 -1
  287. package/build/components/provider/use-block-sync.js.map +1 -1
  288. package/build/components/responsive-block-control/index.js +0 -1
  289. package/build/components/responsive-block-control/index.js.map +1 -1
  290. package/build/components/rich-text/embed-handler-picker.native.js +0 -1
  291. package/build/components/rich-text/embed-handler-picker.native.js.map +1 -1
  292. package/build/components/rich-text/event-listeners/before-input-rules.js +0 -1
  293. package/build/components/rich-text/event-listeners/before-input-rules.js.map +1 -1
  294. package/build/components/rich-text/event-listeners/delete.js +5 -3
  295. package/build/components/rich-text/event-listeners/delete.js.map +1 -1
  296. package/build/components/rich-text/event-listeners/index.js +0 -1
  297. package/build/components/rich-text/event-listeners/index.js.map +1 -1
  298. package/build/components/rich-text/event-listeners/input-rules.js +0 -1
  299. package/build/components/rich-text/event-listeners/input-rules.js.map +1 -1
  300. package/build/components/rich-text/event-listeners/paste-handler.js +0 -1
  301. package/build/components/rich-text/event-listeners/paste-handler.js.map +1 -1
  302. package/build/components/rich-text/file-paste-handler.native.js +0 -1
  303. package/build/components/rich-text/file-paste-handler.native.js.map +1 -1
  304. package/build/components/rich-text/format-edit.js +0 -1
  305. package/build/components/rich-text/format-edit.js.map +1 -1
  306. package/build/components/rich-text/format-toolbar/index.js +0 -1
  307. package/build/components/rich-text/format-toolbar/index.js.map +1 -1
  308. package/build/components/rich-text/index.js +0 -1
  309. package/build/components/rich-text/index.js.map +1 -1
  310. package/build/components/rich-text/index.native.js +0 -1
  311. package/build/components/rich-text/index.native.js.map +1 -1
  312. package/build/components/rich-text/multiline.js +0 -1
  313. package/build/components/rich-text/multiline.js.map +1 -1
  314. package/build/components/rich-text/native/format-edit.js +0 -1
  315. package/build/components/rich-text/native/format-edit.js.map +1 -1
  316. package/build/components/rich-text/native/get-format-colors.native.js +0 -1
  317. package/build/components/rich-text/native/get-format-colors.native.js.map +1 -1
  318. package/build/components/rich-text/native/index.native.js +0 -1
  319. package/build/components/rich-text/native/index.native.js.map +1 -1
  320. package/build/components/rich-text/native/toolbar-button-with-options.native.js +0 -1
  321. package/build/components/rich-text/native/toolbar-button-with-options.native.js.map +1 -1
  322. package/build/components/rich-text/native/use-format-types.js +0 -1
  323. package/build/components/rich-text/native/use-format-types.js.map +1 -1
  324. package/build/components/rich-text/use-format-types.js +0 -1
  325. package/build/components/rich-text/use-format-types.js.map +1 -1
  326. package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js +0 -1
  327. package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -1
  328. package/build/components/spacing-sizes-control/input-controls/axial.js +0 -1
  329. package/build/components/spacing-sizes-control/input-controls/axial.js.map +1 -1
  330. package/build/components/spacing-sizes-control/input-controls/separated.js +0 -1
  331. package/build/components/spacing-sizes-control/input-controls/separated.js.map +1 -1
  332. package/build/components/spacing-sizes-control/input-controls/single.js +0 -1
  333. package/build/components/spacing-sizes-control/input-controls/single.js.map +1 -1
  334. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +0 -1
  335. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  336. package/build/components/spacing-sizes-control/utils.js +0 -1
  337. package/build/components/spacing-sizes-control/utils.js.map +1 -1
  338. package/build/components/tabbed-sidebar/index.js +0 -1
  339. package/build/components/tabbed-sidebar/index.js.map +1 -1
  340. package/build/components/text-alignment-control/index.js +0 -1
  341. package/build/components/text-alignment-control/index.js.map +1 -1
  342. package/build/components/text-decoration-control/index.js +0 -1
  343. package/build/components/text-decoration-control/index.js.map +1 -1
  344. package/build/components/text-transform-control/index.js +0 -1
  345. package/build/components/text-transform-control/index.js.map +1 -1
  346. package/build/components/unsupported-block-details/index.native.js +0 -1
  347. package/build/components/unsupported-block-details/index.native.js.map +1 -1
  348. package/build/components/url-input/index.js +0 -1
  349. package/build/components/url-input/index.js.map +1 -1
  350. package/build/components/url-popover/image-url-input-ui.js +0 -1
  351. package/build/components/url-popover/image-url-input-ui.js.map +1 -1
  352. package/build/components/use-block-commands/index.js +0 -1
  353. package/build/components/use-block-commands/index.js.map +1 -1
  354. package/build/components/use-block-drop-zone/index.js +0 -1
  355. package/build/components/use-block-drop-zone/index.js.map +1 -1
  356. package/build/components/use-block-drop-zone/index.native.js +0 -1
  357. package/build/components/use-block-drop-zone/index.native.js.map +1 -1
  358. package/build/components/use-flash-editable-blocks/index.js +0 -1
  359. package/build/components/use-flash-editable-blocks/index.js.map +1 -1
  360. package/build/components/use-on-block-drop/index.js +0 -1
  361. package/build/components/use-on-block-drop/index.js.map +1 -1
  362. package/build/components/use-on-block-drop/index.native.js +0 -1
  363. package/build/components/use-on-block-drop/index.native.js.map +1 -1
  364. package/build/components/use-paste-styles/index.js +0 -1
  365. package/build/components/use-paste-styles/index.js.map +1 -1
  366. package/build/components/warning/index.js +0 -1
  367. package/build/components/warning/index.js.map +1 -1
  368. package/build/components/writing-flow/use-arrow-nav.js +0 -1
  369. package/build/components/writing-flow/use-arrow-nav.js.map +1 -1
  370. package/build/components/writing-flow/use-clipboard-handler.js +0 -1
  371. package/build/components/writing-flow/use-clipboard-handler.js.map +1 -1
  372. package/build/components/writing-flow/use-input.js +0 -1
  373. package/build/components/writing-flow/use-input.js.map +1 -1
  374. package/build/components/writing-flow/use-tab-nav.js +3 -1
  375. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  376. package/build/components/writing-flow/utils.js +0 -1
  377. package/build/components/writing-flow/utils.js.map +1 -1
  378. package/build/components/writing-mode-control/index.js +0 -1
  379. package/build/components/writing-mode-control/index.js.map +1 -1
  380. package/build/hooks/align.js +0 -1
  381. package/build/hooks/align.js.map +1 -1
  382. package/build/hooks/align.native.js +0 -1
  383. package/build/hooks/align.native.js.map +1 -1
  384. package/build/hooks/aria-label.js +3 -8
  385. package/build/hooks/aria-label.js.map +1 -1
  386. package/build/hooks/block-bindings.js +0 -1
  387. package/build/hooks/block-bindings.js.map +1 -1
  388. package/build/hooks/block-hooks.js +0 -1
  389. package/build/hooks/block-hooks.js.map +1 -1
  390. package/build/hooks/block-style-variation.js +0 -1
  391. package/build/hooks/block-style-variation.js.map +1 -1
  392. package/build/hooks/border.js +0 -1
  393. package/build/hooks/border.js.map +1 -1
  394. package/build/hooks/contrast-checker.js +0 -1
  395. package/build/hooks/contrast-checker.js.map +1 -1
  396. package/build/hooks/duotone.js +0 -1
  397. package/build/hooks/duotone.js.map +1 -1
  398. package/build/hooks/index.js +0 -1
  399. package/build/hooks/index.js.map +1 -1
  400. package/build/hooks/layout.js +0 -1
  401. package/build/hooks/layout.js.map +1 -1
  402. package/build/hooks/position.js +0 -1
  403. package/build/hooks/position.js.map +1 -1
  404. package/build/hooks/style.js +0 -1
  405. package/build/hooks/style.js.map +1 -1
  406. package/build/hooks/supports.js +0 -1
  407. package/build/hooks/supports.js.map +1 -1
  408. package/build/hooks/text-align.js +0 -1
  409. package/build/hooks/text-align.js.map +1 -1
  410. package/build/hooks/typography.js +0 -1
  411. package/build/hooks/typography.js.map +1 -1
  412. package/build/hooks/utils.js +0 -1
  413. package/build/hooks/utils.js.map +1 -1
  414. package/build/layouts/constrained.js +0 -1
  415. package/build/layouts/constrained.js.map +1 -1
  416. package/build/layouts/flex.js +0 -1
  417. package/build/layouts/flex.js.map +1 -1
  418. package/build/layouts/flow.js +0 -1
  419. package/build/layouts/flow.js.map +1 -1
  420. package/build/layouts/index.js +0 -1
  421. package/build/layouts/index.js.map +1 -1
  422. package/build/layouts/utils.js +0 -1
  423. package/build/layouts/utils.js.map +1 -1
  424. package/build/store/actions.js +0 -1
  425. package/build/store/actions.js.map +1 -1
  426. package/build/store/get-block-settings.js +0 -1
  427. package/build/store/get-block-settings.js.map +1 -1
  428. package/build/store/private-actions.js +0 -1
  429. package/build/store/private-actions.js.map +1 -1
  430. package/build/store/private-selectors.js +0 -1
  431. package/build/store/private-selectors.js.map +1 -1
  432. package/build/store/reducer.js +0 -1
  433. package/build/store/reducer.js.map +1 -1
  434. package/build/store/selectors.js +0 -1
  435. package/build/store/selectors.js.map +1 -1
  436. package/build/store/utils.js +0 -1
  437. package/build/store/utils.js.map +1 -1
  438. package/build/utils/block-bindings.js +0 -1
  439. package/build/utils/block-bindings.js.map +1 -1
  440. package/build/utils/get-editor-region.js +0 -1
  441. package/build/utils/get-editor-region.js.map +1 -1
  442. package/build/utils/get-font-styles-and-weights.js +0 -1
  443. package/build/utils/get-font-styles-and-weights.js.map +1 -1
  444. package/build/utils/math.js +0 -1
  445. package/build/utils/math.js.map +1 -1
  446. package/build/utils/object.js +0 -1
  447. package/build/utils/object.js.map +1 -1
  448. package/build/utils/selection.js +0 -1
  449. package/build/utils/selection.js.map +1 -1
  450. package/build/utils/transform-styles/index.js +0 -1
  451. package/build/utils/transform-styles/index.js.map +1 -1
  452. package/build-module/autocompleters/block.js +0 -1
  453. package/build-module/autocompleters/block.js.map +1 -1
  454. package/build-module/autocompleters/link.js +0 -1
  455. package/build-module/autocompleters/link.js.map +1 -1
  456. package/build-module/components/alignment-control/ui.js +0 -1
  457. package/build-module/components/alignment-control/ui.js.map +1 -1
  458. package/build-module/components/autocomplete/index.js +0 -1
  459. package/build-module/components/autocomplete/index.js.map +1 -1
  460. package/build-module/components/background-image-control/index.js +0 -1
  461. package/build-module/components/background-image-control/index.js.map +1 -1
  462. package/build-module/components/block-actions/index.js +0 -1
  463. package/build-module/components/block-actions/index.js.map +1 -1
  464. package/build-module/components/block-alignment-control/ui.js +0 -1
  465. package/build-module/components/block-alignment-control/ui.js.map +1 -1
  466. package/build-module/components/block-alignment-control/ui.native.js +0 -1
  467. package/build-module/components/block-alignment-control/ui.native.js.map +1 -1
  468. package/build-module/components/block-alignment-control/use-available-alignments.js +0 -1
  469. package/build-module/components/block-alignment-control/use-available-alignments.js.map +1 -1
  470. package/build-module/components/block-breadcrumb/index.js +0 -1
  471. package/build-module/components/block-breadcrumb/index.js.map +1 -1
  472. package/build-module/components/block-compare/index.js +0 -1
  473. package/build-module/components/block-compare/index.js.map +1 -1
  474. package/build-module/components/block-controls/fill.js +0 -1
  475. package/build-module/components/block-controls/fill.js.map +1 -1
  476. package/build-module/components/block-edit/edit.js +0 -1
  477. package/build-module/components/block-edit/edit.js.map +1 -1
  478. package/build-module/components/block-edit/edit.native.js +0 -1
  479. package/build-module/components/block-edit/edit.native.js.map +1 -1
  480. package/build-module/components/block-heading-level-dropdown/index.js +0 -1
  481. package/build-module/components/block-heading-level-dropdown/index.js.map +1 -1
  482. package/build-module/components/block-heading-level-dropdown/index.native.js +0 -1
  483. package/build-module/components/block-heading-level-dropdown/index.native.js.map +1 -1
  484. package/build-module/components/block-inspector/index.js +0 -1
  485. package/build-module/components/block-inspector/index.js.map +1 -1
  486. package/build-module/components/block-list/block-invalid-warning.js +0 -1
  487. package/build-module/components/block-list/block-invalid-warning.js.map +1 -1
  488. package/build-module/components/block-list/block-list-context.native.js +0 -1
  489. package/build-module/components/block-list/block-list-context.native.js.map +1 -1
  490. package/build-module/components/block-list/block.js +0 -1
  491. package/build-module/components/block-list/block.js.map +1 -1
  492. package/build-module/components/block-list/block.native.js +0 -1
  493. package/build-module/components/block-list/block.native.js.map +1 -1
  494. package/build-module/components/block-list/index.js +9 -6
  495. package/build-module/components/block-list/index.js.map +1 -1
  496. package/build-module/components/block-list/index.native.js +0 -1
  497. package/build-module/components/block-list/index.native.js.map +1 -1
  498. package/build-module/components/block-list/use-block-props/use-focus-first-element.js +0 -1
  499. package/build-module/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  500. package/build-module/components/block-list/use-in-between-inserter.js +0 -1
  501. package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
  502. package/build-module/components/block-lock/modal.js +0 -1
  503. package/build-module/components/block-lock/modal.js.map +1 -1
  504. package/build-module/components/block-manager/category.js +0 -1
  505. package/build-module/components/block-manager/category.js.map +1 -1
  506. package/build-module/components/block-manager/checklist.js +0 -1
  507. package/build-module/components/block-manager/checklist.js.map +1 -1
  508. package/build-module/components/block-manager/index.js +0 -1
  509. package/build-module/components/block-manager/index.js.map +1 -1
  510. package/build-module/components/block-media-update-progress/index.native.js +0 -1
  511. package/build-module/components/block-media-update-progress/index.native.js.map +1 -1
  512. package/build-module/components/block-mover/index.native.js +0 -1
  513. package/build-module/components/block-mover/index.native.js.map +1 -1
  514. package/build-module/components/block-mover/mover-description.native.js +0 -1
  515. package/build-module/components/block-mover/mover-description.native.js.map +1 -1
  516. package/build-module/components/block-pattern-setup/index.js +0 -1
  517. package/build-module/components/block-pattern-setup/index.js.map +1 -1
  518. package/build-module/components/block-pattern-setup/use-patterns-setup.js +0 -1
  519. package/build-module/components/block-pattern-setup/use-patterns-setup.js.map +1 -1
  520. package/build-module/components/block-patterns-list/index.js +0 -1
  521. package/build-module/components/block-patterns-list/index.js.map +1 -1
  522. package/build-module/components/block-popover/use-popover-scroll.js +12 -7
  523. package/build-module/components/block-popover/use-popover-scroll.js.map +1 -1
  524. package/build-module/components/block-quick-navigation/index.js +0 -1
  525. package/build-module/components/block-quick-navigation/index.js.map +1 -1
  526. package/build-module/components/block-rename/modal.js +0 -1
  527. package/build-module/components/block-rename/modal.js.map +1 -1
  528. package/build-module/components/block-settings-menu/block-settings-dropdown.js +0 -1
  529. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  530. package/build-module/components/block-styles/index.js +0 -1
  531. package/build-module/components/block-styles/index.js.map +1 -1
  532. package/build-module/components/block-styles/index.native.js +0 -1
  533. package/build-module/components/block-styles/index.native.js.map +1 -1
  534. package/build-module/components/block-styles/menu-items.js +0 -1
  535. package/build-module/components/block-styles/menu-items.js.map +1 -1
  536. package/build-module/components/block-styles/preview.native.js +0 -1
  537. package/build-module/components/block-styles/preview.native.js.map +1 -1
  538. package/build-module/components/block-switcher/block-transformations-menu.js +0 -1
  539. package/build-module/components/block-switcher/block-transformations-menu.js.map +1 -1
  540. package/build-module/components/block-switcher/block-transformations-menu.native.js +0 -1
  541. package/build-module/components/block-switcher/block-transformations-menu.native.js.map +1 -1
  542. package/build-module/components/block-switcher/block-variation-transformations.js +0 -1
  543. package/build-module/components/block-switcher/block-variation-transformations.js.map +1 -1
  544. package/build-module/components/block-switcher/index.js +0 -1
  545. package/build-module/components/block-switcher/index.js.map +1 -1
  546. package/build-module/components/block-switcher/pattern-transformations-menu.js +0 -1
  547. package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  548. package/build-module/components/block-switcher/use-transformed-patterns.js +0 -1
  549. package/build-module/components/block-switcher/use-transformed-patterns.js.map +1 -1
  550. package/build-module/components/block-switcher/utils.js +0 -1
  551. package/build-module/components/block-switcher/utils.js.map +1 -1
  552. package/build-module/components/block-toolbar/block-toolbar-menu.native.js +0 -1
  553. package/build-module/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
  554. package/build-module/components/block-toolbar/change-design.js +0 -1
  555. package/build-module/components/block-toolbar/change-design.js.map +1 -1
  556. package/build-module/components/block-toolbar/index.js +0 -1
  557. package/build-module/components/block-toolbar/index.js.map +1 -1
  558. package/build-module/components/block-tools/block-toolbar-popover.js +3 -2
  559. package/build-module/components/block-tools/block-toolbar-popover.js.map +1 -1
  560. package/build-module/components/block-tools/use-selected-block-tool-props.js +0 -1
  561. package/build-module/components/block-tools/use-selected-block-tool-props.js.map +1 -1
  562. package/build-module/components/block-types-list/index.js +0 -1
  563. package/build-module/components/block-types-list/index.js.map +1 -1
  564. package/build-module/components/block-variation-picker/index.js +0 -1
  565. package/build-module/components/block-variation-picker/index.js.map +1 -1
  566. package/build-module/components/block-variation-picker/index.native.js +0 -1
  567. package/build-module/components/block-variation-picker/index.native.js.map +1 -1
  568. package/build-module/components/block-variation-transforms/index.js +0 -1
  569. package/build-module/components/block-variation-transforms/index.js.map +1 -1
  570. package/build-module/components/block-vertical-alignment-control/ui.js +0 -1
  571. package/build-module/components/block-vertical-alignment-control/ui.js.map +1 -1
  572. package/build-module/components/border-radius-control/index.js +0 -1
  573. package/build-module/components/border-radius-control/index.js.map +1 -1
  574. package/build-module/components/border-radius-control/input-controls.js +0 -1
  575. package/build-module/components/border-radius-control/input-controls.js.map +1 -1
  576. package/build-module/components/border-radius-control/utils.js +0 -1
  577. package/build-module/components/border-radius-control/utils.js.map +1 -1
  578. package/build-module/components/colors/utils.js +0 -1
  579. package/build-module/components/colors/utils.js.map +1 -1
  580. package/build-module/components/colors/with-colors.js +0 -1
  581. package/build-module/components/colors/with-colors.js.map +1 -1
  582. package/build-module/components/colors-gradients/dropdown.js +0 -1
  583. package/build-module/components/colors-gradients/dropdown.js.map +1 -1
  584. package/build-module/components/colors-gradients/panel-color-gradient-settings.js +0 -1
  585. package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  586. package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js +0 -1
  587. package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
  588. package/build-module/components/convert-to-group-buttons/toolbar.js +0 -1
  589. package/build-module/components/convert-to-group-buttons/toolbar.js.map +1 -1
  590. package/build-module/components/date-format-picker/index.js +0 -1
  591. package/build-module/components/date-format-picker/index.js.map +1 -1
  592. package/build-module/components/dimensions-tool/scale-tool.js +0 -1
  593. package/build-module/components/dimensions-tool/scale-tool.js.map +1 -1
  594. package/build-module/components/duotone/utils.js +0 -1
  595. package/build-module/components/duotone/utils.js.map +1 -1
  596. package/build-module/components/editor-styles/index.js +0 -1
  597. package/build-module/components/editor-styles/index.js.map +1 -1
  598. package/build-module/components/font-appearance-control/index.js +0 -1
  599. package/build-module/components/font-appearance-control/index.js.map +1 -1
  600. package/build-module/components/font-family/index.js +0 -1
  601. package/build-module/components/font-family/index.js.map +1 -1
  602. package/build-module/components/font-sizes/with-font-sizes.js +0 -1
  603. package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
  604. package/build-module/components/global-styles/border-panel.js +0 -1
  605. package/build-module/components/global-styles/border-panel.js.map +1 -1
  606. package/build-module/components/global-styles/color-panel.js +0 -1
  607. package/build-module/components/global-styles/color-panel.js.map +1 -1
  608. package/build-module/components/global-styles/color-panel.native.js +0 -1
  609. package/build-module/components/global-styles/color-panel.native.js.map +1 -1
  610. package/build-module/components/global-styles/dimensions-panel.js +0 -1
  611. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  612. package/build-module/components/global-styles/filters-panel.js +45 -28
  613. package/build-module/components/global-styles/filters-panel.js.map +1 -1
  614. package/build-module/components/global-styles/get-global-styles-changes.js +0 -1
  615. package/build-module/components/global-styles/get-global-styles-changes.js.map +1 -1
  616. package/build-module/components/global-styles/shadow-panel-components.js +44 -20
  617. package/build-module/components/global-styles/shadow-panel-components.js.map +1 -1
  618. package/build-module/components/global-styles/typography-utils.js +0 -1
  619. package/build-module/components/global-styles/typography-utils.js.map +1 -1
  620. package/build-module/components/global-styles/use-global-styles-context.native.js +0 -1
  621. package/build-module/components/global-styles/use-global-styles-context.native.js.map +1 -1
  622. package/build-module/components/global-styles/use-global-styles-output.js +0 -1
  623. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  624. package/build-module/components/global-styles/utils.js +0 -1
  625. package/build-module/components/global-styles/utils.js.map +1 -1
  626. package/build-module/components/grid/grid-visualizer.js +0 -1
  627. package/build-module/components/grid/grid-visualizer.js.map +1 -1
  628. package/build-module/components/grid/use-grid-layout-sync.js +0 -1
  629. package/build-module/components/grid/use-grid-layout-sync.js.map +1 -1
  630. package/build-module/components/grid/utils.js +0 -1
  631. package/build-module/components/grid/utils.js.map +1 -1
  632. package/build-module/components/iframe/get-compatibility-styles.js +0 -1
  633. package/build-module/components/iframe/get-compatibility-styles.js.map +1 -1
  634. package/build-module/components/image-editor/aspect-ratio-dropdown.js +1 -2
  635. package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  636. package/build-module/components/inner-blocks/index.js +2 -2
  637. package/build-module/components/inner-blocks/index.js.map +1 -1
  638. package/build-module/components/inner-blocks/index.native.js +2 -2
  639. package/build-module/components/inner-blocks/index.native.js.map +1 -1
  640. package/build-module/components/inner-blocks/use-block-context.js +0 -1
  641. package/build-module/components/inner-blocks/use-block-context.js.map +1 -1
  642. package/build-module/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js +0 -1
  643. package/build-module/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js.map +1 -1
  644. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js +0 -1
  645. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  646. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +0 -1
  647. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  648. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js +0 -1
  649. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  650. package/build-module/components/inserter/block-types-tab.js +0 -1
  651. package/build-module/components/inserter/block-types-tab.js.map +1 -1
  652. package/build-module/components/inserter/block-types-tab.native.js +0 -1
  653. package/build-module/components/inserter/block-types-tab.native.js.map +1 -1
  654. package/build-module/components/inserter/category-tabs/index.js +0 -1
  655. package/build-module/components/inserter/category-tabs/index.js.map +1 -1
  656. package/build-module/components/inserter/hooks/use-block-type-impressions.native.js +0 -1
  657. package/build-module/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
  658. package/build-module/components/inserter/hooks/use-patterns-state.js +0 -1
  659. package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
  660. package/build-module/components/inserter/index.js +0 -1
  661. package/build-module/components/inserter/index.js.map +1 -1
  662. package/build-module/components/inserter/index.native.js +0 -1
  663. package/build-module/components/inserter/index.native.js.map +1 -1
  664. package/build-module/components/inserter/media-tab/hooks.js +0 -1
  665. package/build-module/components/inserter/media-tab/hooks.js.map +1 -1
  666. package/build-module/components/inserter/media-tab/media-list.js +0 -1
  667. package/build-module/components/inserter/media-tab/media-list.js.map +1 -1
  668. package/build-module/components/inserter/media-tab/media-tab.js +0 -1
  669. package/build-module/components/inserter/media-tab/media-tab.js.map +1 -1
  670. package/build-module/components/inserter/mobile-tab-navigation.js +0 -1
  671. package/build-module/components/inserter/mobile-tab-navigation.js.map +1 -1
  672. package/build-module/components/inserter/no-results.js +4 -8
  673. package/build-module/components/inserter/no-results.js.map +1 -1
  674. package/build-module/components/inserter/quick-inserter.js +2 -1
  675. package/build-module/components/inserter/quick-inserter.js.map +1 -1
  676. package/build-module/components/inserter/search-items.js +0 -1
  677. package/build-module/components/inserter/search-items.js.map +1 -1
  678. package/build-module/components/inserter/search-results.js +1 -2
  679. package/build-module/components/inserter/search-results.js.map +1 -1
  680. package/build-module/components/inserter/tabs.native.js +0 -1
  681. package/build-module/components/inserter/tabs.native.js.map +1 -1
  682. package/build-module/components/inserter/utils.native.js +0 -1
  683. package/build-module/components/inserter/utils.native.js.map +1 -1
  684. package/build-module/components/inspector-controls/block-support-tools-panel.js +0 -1
  685. package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  686. package/build-module/components/inspector-controls/fill.js +0 -1
  687. package/build-module/components/inspector-controls/fill.js.map +1 -1
  688. package/build-module/components/inspector-controls-tabs/index.js +0 -1
  689. package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
  690. package/build-module/components/inspector-popover-header/index.js +0 -1
  691. package/build-module/components/inspector-popover-header/index.js.map +1 -1
  692. package/build-module/components/justify-content-control/ui.js +0 -1
  693. package/build-module/components/justify-content-control/ui.js.map +1 -1
  694. package/build-module/components/keyboard-shortcuts/index.js +1 -1
  695. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  696. package/build-module/components/link-control/index.js +0 -1
  697. package/build-module/components/link-control/index.js.map +1 -1
  698. package/build-module/components/link-control/search-results.js +0 -1
  699. package/build-module/components/link-control/search-results.js.map +1 -1
  700. package/build-module/components/link-control/settings.js +0 -1
  701. package/build-module/components/link-control/settings.js.map +1 -1
  702. package/build-module/components/link-control/use-internal-value.js +0 -1
  703. package/build-module/components/link-control/use-internal-value.js.map +1 -1
  704. package/build-module/components/link-control/use-search-handler.js +0 -1
  705. package/build-module/components/link-control/use-search-handler.js.map +1 -1
  706. package/build-module/components/list-view/block-select-button.js +0 -1
  707. package/build-module/components/list-view/block-select-button.js.map +1 -1
  708. package/build-module/components/list-view/block.js +0 -1
  709. package/build-module/components/list-view/block.js.map +1 -1
  710. package/build-module/components/list-view/branch.js +0 -1
  711. package/build-module/components/list-view/branch.js.map +1 -1
  712. package/build-module/components/list-view/index.js +0 -1
  713. package/build-module/components/list-view/index.js.map +1 -1
  714. package/build-module/components/list-view/use-block-selection.js +0 -1
  715. package/build-module/components/list-view/use-block-selection.js.map +1 -1
  716. package/build-module/components/list-view/use-clipboard-handler.js +0 -1
  717. package/build-module/components/list-view/use-clipboard-handler.js.map +1 -1
  718. package/build-module/components/list-view/use-list-view-block-indexes.js +0 -1
  719. package/build-module/components/list-view/use-list-view-block-indexes.js.map +1 -1
  720. package/build-module/components/list-view/use-list-view-drop-zone.js +0 -1
  721. package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
  722. package/build-module/components/list-view/utils.js +0 -1
  723. package/build-module/components/list-view/utils.js.map +1 -1
  724. package/build-module/components/media-placeholder/index.js +0 -1
  725. package/build-module/components/media-placeholder/index.js.map +1 -1
  726. package/build-module/components/media-placeholder/index.native.js +0 -1
  727. package/build-module/components/media-placeholder/index.native.js.map +1 -1
  728. package/build-module/components/media-replace-flow/index.js +0 -1
  729. package/build-module/components/media-replace-flow/index.js.map +1 -1
  730. package/build-module/components/media-upload/index.native.js +0 -1
  731. package/build-module/components/media-upload/index.native.js.map +1 -1
  732. package/build-module/components/navigable-toolbar/index.js +0 -1
  733. package/build-module/components/navigable-toolbar/index.js.map +1 -1
  734. package/build-module/components/panel-color-settings/index.js +0 -1
  735. package/build-module/components/panel-color-settings/index.js.map +1 -1
  736. package/build-module/components/provider/use-block-sync.js +0 -1
  737. package/build-module/components/provider/use-block-sync.js.map +1 -1
  738. package/build-module/components/responsive-block-control/index.js +0 -1
  739. package/build-module/components/responsive-block-control/index.js.map +1 -1
  740. package/build-module/components/rich-text/embed-handler-picker.native.js +0 -1
  741. package/build-module/components/rich-text/embed-handler-picker.native.js.map +1 -1
  742. package/build-module/components/rich-text/event-listeners/before-input-rules.js +0 -1
  743. package/build-module/components/rich-text/event-listeners/before-input-rules.js.map +1 -1
  744. package/build-module/components/rich-text/event-listeners/delete.js +5 -3
  745. package/build-module/components/rich-text/event-listeners/delete.js.map +1 -1
  746. package/build-module/components/rich-text/event-listeners/index.js +0 -1
  747. package/build-module/components/rich-text/event-listeners/index.js.map +1 -1
  748. package/build-module/components/rich-text/event-listeners/input-rules.js +0 -1
  749. package/build-module/components/rich-text/event-listeners/input-rules.js.map +1 -1
  750. package/build-module/components/rich-text/event-listeners/paste-handler.js +0 -1
  751. package/build-module/components/rich-text/event-listeners/paste-handler.js.map +1 -1
  752. package/build-module/components/rich-text/file-paste-handler.native.js +0 -1
  753. package/build-module/components/rich-text/file-paste-handler.native.js.map +1 -1
  754. package/build-module/components/rich-text/format-edit.js +0 -1
  755. package/build-module/components/rich-text/format-edit.js.map +1 -1
  756. package/build-module/components/rich-text/format-toolbar/index.js +0 -1
  757. package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
  758. package/build-module/components/rich-text/index.js +0 -1
  759. package/build-module/components/rich-text/index.js.map +1 -1
  760. package/build-module/components/rich-text/index.native.js +0 -1
  761. package/build-module/components/rich-text/index.native.js.map +1 -1
  762. package/build-module/components/rich-text/multiline.js +0 -1
  763. package/build-module/components/rich-text/multiline.js.map +1 -1
  764. package/build-module/components/rich-text/native/format-edit.js +0 -1
  765. package/build-module/components/rich-text/native/format-edit.js.map +1 -1
  766. package/build-module/components/rich-text/native/get-format-colors.native.js +0 -1
  767. package/build-module/components/rich-text/native/get-format-colors.native.js.map +1 -1
  768. package/build-module/components/rich-text/native/index.native.js +0 -1
  769. package/build-module/components/rich-text/native/index.native.js.map +1 -1
  770. package/build-module/components/rich-text/native/toolbar-button-with-options.native.js +0 -1
  771. package/build-module/components/rich-text/native/toolbar-button-with-options.native.js.map +1 -1
  772. package/build-module/components/rich-text/native/use-format-types.js +0 -1
  773. package/build-module/components/rich-text/native/use-format-types.js.map +1 -1
  774. package/build-module/components/rich-text/use-format-types.js +0 -1
  775. package/build-module/components/rich-text/use-format-types.js.map +1 -1
  776. package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js +0 -1
  777. package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -1
  778. package/build-module/components/spacing-sizes-control/input-controls/axial.js +0 -1
  779. package/build-module/components/spacing-sizes-control/input-controls/axial.js.map +1 -1
  780. package/build-module/components/spacing-sizes-control/input-controls/separated.js +0 -1
  781. package/build-module/components/spacing-sizes-control/input-controls/separated.js.map +1 -1
  782. package/build-module/components/spacing-sizes-control/input-controls/single.js +0 -1
  783. package/build-module/components/spacing-sizes-control/input-controls/single.js.map +1 -1
  784. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +0 -1
  785. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  786. package/build-module/components/spacing-sizes-control/utils.js +0 -1
  787. package/build-module/components/spacing-sizes-control/utils.js.map +1 -1
  788. package/build-module/components/tabbed-sidebar/index.js +0 -1
  789. package/build-module/components/tabbed-sidebar/index.js.map +1 -1
  790. package/build-module/components/text-alignment-control/index.js +0 -1
  791. package/build-module/components/text-alignment-control/index.js.map +1 -1
  792. package/build-module/components/text-decoration-control/index.js +0 -1
  793. package/build-module/components/text-decoration-control/index.js.map +1 -1
  794. package/build-module/components/text-transform-control/index.js +0 -1
  795. package/build-module/components/text-transform-control/index.js.map +1 -1
  796. package/build-module/components/unsupported-block-details/index.native.js +0 -1
  797. package/build-module/components/unsupported-block-details/index.native.js.map +1 -1
  798. package/build-module/components/url-input/index.js +0 -1
  799. package/build-module/components/url-input/index.js.map +1 -1
  800. package/build-module/components/url-popover/image-url-input-ui.js +0 -1
  801. package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
  802. package/build-module/components/use-block-commands/index.js +0 -1
  803. package/build-module/components/use-block-commands/index.js.map +1 -1
  804. package/build-module/components/use-block-drop-zone/index.js +0 -1
  805. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  806. package/build-module/components/use-block-drop-zone/index.native.js +0 -1
  807. package/build-module/components/use-block-drop-zone/index.native.js.map +1 -1
  808. package/build-module/components/use-flash-editable-blocks/index.js +0 -1
  809. package/build-module/components/use-flash-editable-blocks/index.js.map +1 -1
  810. package/build-module/components/use-on-block-drop/index.js +0 -1
  811. package/build-module/components/use-on-block-drop/index.js.map +1 -1
  812. package/build-module/components/use-on-block-drop/index.native.js +0 -1
  813. package/build-module/components/use-on-block-drop/index.native.js.map +1 -1
  814. package/build-module/components/use-paste-styles/index.js +0 -1
  815. package/build-module/components/use-paste-styles/index.js.map +1 -1
  816. package/build-module/components/warning/index.js +0 -1
  817. package/build-module/components/warning/index.js.map +1 -1
  818. package/build-module/components/writing-flow/use-arrow-nav.js +0 -1
  819. package/build-module/components/writing-flow/use-arrow-nav.js.map +1 -1
  820. package/build-module/components/writing-flow/use-clipboard-handler.js +0 -1
  821. package/build-module/components/writing-flow/use-clipboard-handler.js.map +1 -1
  822. package/build-module/components/writing-flow/use-input.js +0 -1
  823. package/build-module/components/writing-flow/use-input.js.map +1 -1
  824. package/build-module/components/writing-flow/use-tab-nav.js +3 -1
  825. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  826. package/build-module/components/writing-flow/utils.js +0 -1
  827. package/build-module/components/writing-flow/utils.js.map +1 -1
  828. package/build-module/components/writing-mode-control/index.js +0 -1
  829. package/build-module/components/writing-mode-control/index.js.map +1 -1
  830. package/build-module/hooks/align.js +0 -1
  831. package/build-module/hooks/align.js.map +1 -1
  832. package/build-module/hooks/align.native.js +0 -1
  833. package/build-module/hooks/align.native.js.map +1 -1
  834. package/build-module/hooks/aria-label.js +3 -7
  835. package/build-module/hooks/aria-label.js.map +1 -1
  836. package/build-module/hooks/block-bindings.js +0 -1
  837. package/build-module/hooks/block-bindings.js.map +1 -1
  838. package/build-module/hooks/block-hooks.js +0 -1
  839. package/build-module/hooks/block-hooks.js.map +1 -1
  840. package/build-module/hooks/block-style-variation.js +0 -1
  841. package/build-module/hooks/block-style-variation.js.map +1 -1
  842. package/build-module/hooks/border.js +0 -1
  843. package/build-module/hooks/border.js.map +1 -1
  844. package/build-module/hooks/contrast-checker.js +0 -1
  845. package/build-module/hooks/contrast-checker.js.map +1 -1
  846. package/build-module/hooks/duotone.js +0 -1
  847. package/build-module/hooks/duotone.js.map +1 -1
  848. package/build-module/hooks/index.js +0 -1
  849. package/build-module/hooks/index.js.map +1 -1
  850. package/build-module/hooks/layout.js +0 -1
  851. package/build-module/hooks/layout.js.map +1 -1
  852. package/build-module/hooks/position.js +0 -1
  853. package/build-module/hooks/position.js.map +1 -1
  854. package/build-module/hooks/style.js +0 -1
  855. package/build-module/hooks/style.js.map +1 -1
  856. package/build-module/hooks/supports.js +0 -1
  857. package/build-module/hooks/supports.js.map +1 -1
  858. package/build-module/hooks/text-align.js +0 -1
  859. package/build-module/hooks/text-align.js.map +1 -1
  860. package/build-module/hooks/typography.js +0 -1
  861. package/build-module/hooks/typography.js.map +1 -1
  862. package/build-module/hooks/utils.js +0 -1
  863. package/build-module/hooks/utils.js.map +1 -1
  864. package/build-module/layouts/constrained.js +0 -1
  865. package/build-module/layouts/constrained.js.map +1 -1
  866. package/build-module/layouts/flex.js +0 -1
  867. package/build-module/layouts/flex.js.map +1 -1
  868. package/build-module/layouts/flow.js +0 -1
  869. package/build-module/layouts/flow.js.map +1 -1
  870. package/build-module/layouts/index.js +0 -1
  871. package/build-module/layouts/index.js.map +1 -1
  872. package/build-module/layouts/utils.js +0 -1
  873. package/build-module/layouts/utils.js.map +1 -1
  874. package/build-module/store/actions.js +0 -1
  875. package/build-module/store/actions.js.map +1 -1
  876. package/build-module/store/get-block-settings.js +0 -1
  877. package/build-module/store/get-block-settings.js.map +1 -1
  878. package/build-module/store/private-actions.js +0 -1
  879. package/build-module/store/private-actions.js.map +1 -1
  880. package/build-module/store/private-selectors.js +0 -1
  881. package/build-module/store/private-selectors.js.map +1 -1
  882. package/build-module/store/reducer.js +0 -1
  883. package/build-module/store/reducer.js.map +1 -1
  884. package/build-module/store/selectors.js +0 -1
  885. package/build-module/store/selectors.js.map +1 -1
  886. package/build-module/store/utils.js +0 -1
  887. package/build-module/store/utils.js.map +1 -1
  888. package/build-module/utils/block-bindings.js +0 -1
  889. package/build-module/utils/block-bindings.js.map +1 -1
  890. package/build-module/utils/get-editor-region.js +0 -1
  891. package/build-module/utils/get-editor-region.js.map +1 -1
  892. package/build-module/utils/get-font-styles-and-weights.js +0 -1
  893. package/build-module/utils/get-font-styles-and-weights.js.map +1 -1
  894. package/build-module/utils/math.js +0 -1
  895. package/build-module/utils/math.js.map +1 -1
  896. package/build-module/utils/object.js +0 -1
  897. package/build-module/utils/object.js.map +1 -1
  898. package/build-module/utils/selection.js +0 -1
  899. package/build-module/utils/selection.js.map +1 -1
  900. package/build-module/utils/transform-styles/index.js +0 -1
  901. package/build-module/utils/transform-styles/index.js.map +1 -1
  902. package/build-style/content-rtl.css +22 -25
  903. package/build-style/content.css +22 -25
  904. package/build-style/style-rtl.css +130 -104
  905. package/build-style/style.css +130 -104
  906. package/package.json +34 -34
  907. package/src/components/block-canvas/style.scss +3 -2
  908. package/src/components/block-draggable/style.scss +3 -1
  909. package/src/components/block-list/content.scss +19 -12
  910. package/src/components/block-list/index.js +21 -7
  911. package/src/components/block-mover/style.scss +5 -4
  912. package/src/components/block-pattern-setup/style.scss +3 -1
  913. package/src/components/block-patterns-list/style.scss +3 -3
  914. package/src/components/block-popover/use-popover-scroll.js +13 -8
  915. package/src/components/block-switcher/style.scss +3 -1
  916. package/src/components/block-toolbar/style.scss +5 -3
  917. package/src/components/block-tools/block-toolbar-popover.js +4 -3
  918. package/src/components/block-tools/style.scss +6 -3
  919. package/src/components/button-block-appender/content.scss +2 -4
  920. package/src/components/colors-gradients/style.scss +3 -2
  921. package/src/components/global-styles/filters-panel.js +48 -21
  922. package/src/components/global-styles/shadow-panel-components.js +44 -13
  923. package/src/components/global-styles/style.scss +53 -1
  924. package/src/components/grid/style.scss +5 -4
  925. package/src/components/iframe/content.scss +5 -2
  926. package/src/components/image-editor/aspect-ratio-dropdown.js +1 -1
  927. package/src/components/inner-blocks/index.js +2 -2
  928. package/src/components/inner-blocks/index.native.js +2 -2
  929. package/src/components/inserter/no-results.js +0 -5
  930. package/src/components/inserter/quick-inserter.js +4 -1
  931. package/src/components/inserter/search-results.js +3 -1
  932. package/src/components/inserter/style.scss +6 -8
  933. package/src/components/inserter-list-item/style.scss +9 -6
  934. package/src/components/keyboard-shortcuts/index.js +1 -1
  935. package/src/components/link-control/style.scss +11 -6
  936. package/src/components/list-view/style.scss +34 -17
  937. package/src/components/rich-text/event-listeners/delete.js +3 -3
  938. package/src/components/url-input/style.scss +3 -2
  939. package/src/components/writing-flow/use-tab-nav.js +4 -0
  940. package/src/hooks/aria-label.js +3 -8
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_compose","_keycodes","_blocks","_store","useInput","__unstableIsFullySelected","getSelectedBlockClientIds","getSelectedBlockClientId","__unstableIsSelectionMergeable","hasMultiSelection","getBlockName","canInsertBlockType","getBlockRootClientId","getSelectionStart","getSelectionEnd","getBlockAttributes","useSelect","blockEditorStore","replaceBlocks","__unstableSplitSelection","removeBlocks","__unstableDeleteSelection","__unstableExpandSelection","__unstableMarkAutomaticChange","useDispatch","useRefEffect","node","onBeforeInput","event","contentEditable","preventDefault","onKeyDown","defaultPrevented","keyCode","ENTER","shiftKey","clientId","blockName","selectionStart","selectionEnd","attributeKey","selectedAttributeValue","transforms","getBlockTransforms","filter","type","transformation","findTransform","item","regExp","test","transform","content","hasBlockSupport","__deprecatedOnSplit","createBlock","getDefaultBlockName","BACKSPACE","DELETE","key","length","metaKey","ctrlKey","ownerDocument","defaultView","getSelection","removeAllRanges","onCompositionStart","addEventListener","removeEventListener"],"sources":["@wordpress/block-editor/src/components/writing-flow/use-input.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useRefEffect } from '@wordpress/compose';\nimport { ENTER, BACKSPACE, DELETE } from '@wordpress/keycodes';\nimport {\n\tcreateBlock,\n\tgetDefaultBlockName,\n\thasBlockSupport,\n\tgetBlockTransforms,\n\tfindTransform,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\n/**\n * Handles input for selections across blocks.\n */\nexport default function useInput() {\n\tconst {\n\t\t__unstableIsFullySelected,\n\t\tgetSelectedBlockClientIds,\n\t\tgetSelectedBlockClientId,\n\t\t__unstableIsSelectionMergeable,\n\t\thasMultiSelection,\n\t\tgetBlockName,\n\t\tcanInsertBlockType,\n\t\tgetBlockRootClientId,\n\t\tgetSelectionStart,\n\t\tgetSelectionEnd,\n\t\tgetBlockAttributes,\n\t} = useSelect( blockEditorStore );\n\tconst {\n\t\treplaceBlocks,\n\t\t__unstableSplitSelection,\n\t\tremoveBlocks,\n\t\t__unstableDeleteSelection,\n\t\t__unstableExpandSelection,\n\t\t__unstableMarkAutomaticChange,\n\t} = useDispatch( blockEditorStore );\n\n\treturn useRefEffect( ( node ) => {\n\t\tfunction onBeforeInput( event ) {\n\t\t\t// If writing flow is editable, NEVER allow the browser to alter the\n\t\t\t// DOM. This will cause React errors (and the DOM should only be\n\t\t\t// altered in a controlled fashion).\n\t\t\tif ( node.contentEditable === 'true' ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t}\n\n\t\tfunction onKeyDown( event ) {\n\t\t\tif ( event.defaultPrevented ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! hasMultiSelection() ) {\n\t\t\t\tif ( event.keyCode === ENTER ) {\n\t\t\t\t\tif ( event.shiftKey || __unstableIsFullySelected() ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst clientId = getSelectedBlockClientId();\n\t\t\t\t\tconst blockName = getBlockName( clientId );\n\t\t\t\t\tconst selectionStart = getSelectionStart();\n\t\t\t\t\tconst selectionEnd = getSelectionEnd();\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tselectionStart.attributeKey ===\n\t\t\t\t\t\tselectionEnd.attributeKey\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst selectedAttributeValue =\n\t\t\t\t\t\t\tgetBlockAttributes( clientId )[\n\t\t\t\t\t\t\t\tselectionStart.attributeKey\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\tconst transforms = getBlockTransforms( 'from' ).filter(\n\t\t\t\t\t\t\t( { type } ) => type === 'enter'\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst transformation = findTransform(\n\t\t\t\t\t\t\ttransforms,\n\t\t\t\t\t\t\t( item ) => {\n\t\t\t\t\t\t\t\treturn item.regExp.test(\n\t\t\t\t\t\t\t\t\tselectedAttributeValue\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif ( transformation ) {\n\t\t\t\t\t\t\treplaceBlocks(\n\t\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\t\ttransformation.transform( {\n\t\t\t\t\t\t\t\t\tcontent: selectedAttributeValue,\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t__unstableMarkAutomaticChange();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t! hasBlockSupport( blockName, 'splitting', false ) &&\n\t\t\t\t\t\t! event.__deprecatedOnSplit\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Ensure template is not locked.\n\t\t\t\t\tif (\n\t\t\t\t\t\tcanInsertBlockType(\n\t\t\t\t\t\t\tblockName,\n\t\t\t\t\t\t\tgetBlockRootClientId( clientId )\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\t__unstableSplitSelection();\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( event.keyCode === ENTER ) {\n\t\t\t\tnode.contentEditable = false;\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif ( __unstableIsFullySelected() ) {\n\t\t\t\t\treplaceBlocks(\n\t\t\t\t\t\tgetSelectedBlockClientIds(),\n\t\t\t\t\t\tcreateBlock( getDefaultBlockName() )\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t__unstableSplitSelection();\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\tevent.keyCode === BACKSPACE ||\n\t\t\t\tevent.keyCode === DELETE\n\t\t\t) {\n\t\t\t\tnode.contentEditable = false;\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif ( __unstableIsFullySelected() ) {\n\t\t\t\t\tremoveBlocks( getSelectedBlockClientIds() );\n\t\t\t\t} else if ( __unstableIsSelectionMergeable() ) {\n\t\t\t\t\t__unstableDeleteSelection( event.keyCode === DELETE );\n\t\t\t\t} else {\n\t\t\t\t\t__unstableExpandSelection();\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\t// If key.length is longer than 1, it's a control key that doesn't\n\t\t\t\t// input anything.\n\t\t\t\tevent.key.length === 1 &&\n\t\t\t\t! ( event.metaKey || event.ctrlKey )\n\t\t\t) {\n\t\t\t\tnode.contentEditable = false;\n\t\t\t\tif ( __unstableIsSelectionMergeable() ) {\n\t\t\t\t\t__unstableDeleteSelection( event.keyCode === DELETE );\n\t\t\t\t} else {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t// Safari does not stop default behaviour with either\n\t\t\t\t\t// event.preventDefault() or node.contentEditable = false, so\n\t\t\t\t\t// remove the selection to stop browser manipulation.\n\t\t\t\t\tnode.ownerDocument.defaultView\n\t\t\t\t\t\t.getSelection()\n\t\t\t\t\t\t.removeAllRanges();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction onCompositionStart( event ) {\n\t\t\tif ( ! hasMultiSelection() ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tnode.contentEditable = false;\n\n\t\t\tif ( __unstableIsSelectionMergeable() ) {\n\t\t\t\t__unstableDeleteSelection();\n\t\t\t} else {\n\t\t\t\tevent.preventDefault();\n\t\t\t\t// Safari does not stop default behaviour with either\n\t\t\t\t// event.preventDefault() or node.contentEditable = false, so\n\t\t\t\t// remove the selection to stop browser manipulation.\n\t\t\t\tnode.ownerDocument.defaultView.getSelection().removeAllRanges();\n\t\t\t}\n\t\t}\n\n\t\tnode.addEventListener( 'beforeinput', onBeforeInput );\n\t\tnode.addEventListener( 'keydown', onKeyDown );\n\t\tnode.addEventListener( 'compositionstart', onCompositionStart );\n\t\treturn () => {\n\t\t\tnode.removeEventListener( 'beforeinput', onBeforeInput );\n\t\t\tnode.removeEventListener( 'keydown', onKeyDown );\n\t\t\tnode.removeEventListener( 'compositionstart', onCompositionStart );\n\t\t};\n\t}, [] );\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAWA,IAAAI,MAAA,GAAAJ,OAAA;AAjBA;AACA;AACA;;AAYA;AACA;AACA;;AAGA;AACA;AACA;AACe,SAASK,QAAQA,CAAA,EAAG;EAClC,MAAM;IACLC,yBAAyB;IACzBC,yBAAyB;IACzBC,wBAAwB;IACxBC,8BAA8B;IAC9BC,iBAAiB;IACjBC,YAAY;IACZC,kBAAkB;IAClBC,oBAAoB;IACpBC,iBAAiB;IACjBC,eAAe;IACfC;EACD,CAAC,GAAG,IAAAC,eAAS,EAAEC,YAAiB,CAAC;EACjC,MAAM;IACLC,aAAa;IACbC,wBAAwB;IACxBC,YAAY;IACZC,yBAAyB;IACzBC,yBAAyB;IACzBC;EACD,CAAC,GAAG,IAAAC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version":3,"names":["_data","require","_compose","_keycodes","_blocks","_store","useInput","__unstableIsFullySelected","getSelectedBlockClientIds","getSelectedBlockClientId","__unstableIsSelectionMergeable","hasMultiSelection","getBlockName","canInsertBlockType","getBlockRootClientId","getSelectionStart","getSelectionEnd","getBlockAttributes","useSelect","blockEditorStore","replaceBlocks","__unstableSplitSelection","removeBlocks","__unstableDeleteSelection","__unstableExpandSelection","__unstableMarkAutomaticChange","useDispatch","useRefEffect","node","onBeforeInput","event","contentEditable","preventDefault","onKeyDown","defaultPrevented","keyCode","ENTER","shiftKey","clientId","blockName","selectionStart","selectionEnd","attributeKey","selectedAttributeValue","transforms","getBlockTransforms","filter","type","transformation","findTransform","item","regExp","test","transform","content","hasBlockSupport","__deprecatedOnSplit","createBlock","getDefaultBlockName","BACKSPACE","DELETE","key","length","metaKey","ctrlKey","ownerDocument","defaultView","getSelection","removeAllRanges","onCompositionStart","addEventListener","removeEventListener"],"sources":["@wordpress/block-editor/src/components/writing-flow/use-input.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useRefEffect } from '@wordpress/compose';\nimport { ENTER, BACKSPACE, DELETE } from '@wordpress/keycodes';\nimport {\n\tcreateBlock,\n\tgetDefaultBlockName,\n\thasBlockSupport,\n\tgetBlockTransforms,\n\tfindTransform,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\n/**\n * Handles input for selections across blocks.\n */\nexport default function useInput() {\n\tconst {\n\t\t__unstableIsFullySelected,\n\t\tgetSelectedBlockClientIds,\n\t\tgetSelectedBlockClientId,\n\t\t__unstableIsSelectionMergeable,\n\t\thasMultiSelection,\n\t\tgetBlockName,\n\t\tcanInsertBlockType,\n\t\tgetBlockRootClientId,\n\t\tgetSelectionStart,\n\t\tgetSelectionEnd,\n\t\tgetBlockAttributes,\n\t} = useSelect( blockEditorStore );\n\tconst {\n\t\treplaceBlocks,\n\t\t__unstableSplitSelection,\n\t\tremoveBlocks,\n\t\t__unstableDeleteSelection,\n\t\t__unstableExpandSelection,\n\t\t__unstableMarkAutomaticChange,\n\t} = useDispatch( blockEditorStore );\n\n\treturn useRefEffect( ( node ) => {\n\t\tfunction onBeforeInput( event ) {\n\t\t\t// If writing flow is editable, NEVER allow the browser to alter the\n\t\t\t// DOM. This will cause React errors (and the DOM should only be\n\t\t\t// altered in a controlled fashion).\n\t\t\tif ( node.contentEditable === 'true' ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t}\n\n\t\tfunction onKeyDown( event ) {\n\t\t\tif ( event.defaultPrevented ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! hasMultiSelection() ) {\n\t\t\t\tif ( event.keyCode === ENTER ) {\n\t\t\t\t\tif ( event.shiftKey || __unstableIsFullySelected() ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst clientId = getSelectedBlockClientId();\n\t\t\t\t\tconst blockName = getBlockName( clientId );\n\t\t\t\t\tconst selectionStart = getSelectionStart();\n\t\t\t\t\tconst selectionEnd = getSelectionEnd();\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tselectionStart.attributeKey ===\n\t\t\t\t\t\tselectionEnd.attributeKey\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst selectedAttributeValue =\n\t\t\t\t\t\t\tgetBlockAttributes( clientId )[\n\t\t\t\t\t\t\t\tselectionStart.attributeKey\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\tconst transforms = getBlockTransforms( 'from' ).filter(\n\t\t\t\t\t\t\t( { type } ) => type === 'enter'\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst transformation = findTransform(\n\t\t\t\t\t\t\ttransforms,\n\t\t\t\t\t\t\t( item ) => {\n\t\t\t\t\t\t\t\treturn item.regExp.test(\n\t\t\t\t\t\t\t\t\tselectedAttributeValue\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif ( transformation ) {\n\t\t\t\t\t\t\treplaceBlocks(\n\t\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\t\ttransformation.transform( {\n\t\t\t\t\t\t\t\t\tcontent: selectedAttributeValue,\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t__unstableMarkAutomaticChange();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t! hasBlockSupport( blockName, 'splitting', false ) &&\n\t\t\t\t\t\t! event.__deprecatedOnSplit\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Ensure template is not locked.\n\t\t\t\t\tif (\n\t\t\t\t\t\tcanInsertBlockType(\n\t\t\t\t\t\t\tblockName,\n\t\t\t\t\t\t\tgetBlockRootClientId( clientId )\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\t__unstableSplitSelection();\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( event.keyCode === ENTER ) {\n\t\t\t\tnode.contentEditable = false;\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif ( __unstableIsFullySelected() ) {\n\t\t\t\t\treplaceBlocks(\n\t\t\t\t\t\tgetSelectedBlockClientIds(),\n\t\t\t\t\t\tcreateBlock( getDefaultBlockName() )\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t__unstableSplitSelection();\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\tevent.keyCode === BACKSPACE ||\n\t\t\t\tevent.keyCode === DELETE\n\t\t\t) {\n\t\t\t\tnode.contentEditable = false;\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif ( __unstableIsFullySelected() ) {\n\t\t\t\t\tremoveBlocks( getSelectedBlockClientIds() );\n\t\t\t\t} else if ( __unstableIsSelectionMergeable() ) {\n\t\t\t\t\t__unstableDeleteSelection( event.keyCode === DELETE );\n\t\t\t\t} else {\n\t\t\t\t\t__unstableExpandSelection();\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\t// If key.length is longer than 1, it's a control key that doesn't\n\t\t\t\t// input anything.\n\t\t\t\tevent.key.length === 1 &&\n\t\t\t\t! ( event.metaKey || event.ctrlKey )\n\t\t\t) {\n\t\t\t\tnode.contentEditable = false;\n\t\t\t\tif ( __unstableIsSelectionMergeable() ) {\n\t\t\t\t\t__unstableDeleteSelection( event.keyCode === DELETE );\n\t\t\t\t} else {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t// Safari does not stop default behaviour with either\n\t\t\t\t\t// event.preventDefault() or node.contentEditable = false, so\n\t\t\t\t\t// remove the selection to stop browser manipulation.\n\t\t\t\t\tnode.ownerDocument.defaultView\n\t\t\t\t\t\t.getSelection()\n\t\t\t\t\t\t.removeAllRanges();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction onCompositionStart( event ) {\n\t\t\tif ( ! hasMultiSelection() ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tnode.contentEditable = false;\n\n\t\t\tif ( __unstableIsSelectionMergeable() ) {\n\t\t\t\t__unstableDeleteSelection();\n\t\t\t} else {\n\t\t\t\tevent.preventDefault();\n\t\t\t\t// Safari does not stop default behaviour with either\n\t\t\t\t// event.preventDefault() or node.contentEditable = false, so\n\t\t\t\t// remove the selection to stop browser manipulation.\n\t\t\t\tnode.ownerDocument.defaultView.getSelection().removeAllRanges();\n\t\t\t}\n\t\t}\n\n\t\tnode.addEventListener( 'beforeinput', onBeforeInput );\n\t\tnode.addEventListener( 'keydown', onKeyDown );\n\t\tnode.addEventListener( 'compositionstart', onCompositionStart );\n\t\treturn () => {\n\t\t\tnode.removeEventListener( 'beforeinput', onBeforeInput );\n\t\t\tnode.removeEventListener( 'keydown', onKeyDown );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AAyB,CAAC,CAAC;MAC5B,CAAC,MAAM;QACNO,KAAK,CAACE,cAAc,CAAC,CAAC;QACtB;QACA;QACA;QACAJ,IAAI,CAACqC,aAAa,CAACC,WAAW,CAACC,YAAY,CAAC,CAAC,CAACC,eAAe,CAAC,CAAC;MAChE;IACD;IAEAxC,IAAI,CAAC0C,gBAAgB,CAAE,aAAa,EAAEzC,aAAc,CAAC;IACrDD,IAAI,CAAC0C,gBAAgB,CAAE,SAAS,EAAErC,SAAU,CAAC;IAC7CL,IAAI,CAAC0C,gBAAgB,CAAE,kBAAkB,EAAED,kBAAmB,CAAC;IAC/D,OAAO,MAAM;MACZzC,IAAI,CAAC2C,mBAAmB,CAAE,aAAa,EAAE1C,aAAc,CAAC;MACxDD,IAAI,CAAC2C,mBAAmB,CAAE,SAAS,EAAEtC,SAAU,CAAC;MAChDL,IAAI,CAAC2C,mBAAmB,CAAE,kBAAkB,EAAEF,kBAAmB,CAAC;IACnE,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;AACR","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- /* wp:polyfill */
2
1
  "use strict";
3
2
 
4
3
  Object.defineProperty(exports, "__esModule", {
@@ -110,6 +109,9 @@ function useTabNav() {
110
109
  if (event.keyCode !== _keycodes.TAB) {
111
110
  return;
112
111
  }
112
+ if (!hasMultiSelection() && !getSelectedBlockClientId()) {
113
+ return;
114
+ }
113
115
  const isShift = event.shiftKey;
114
116
  const direction = isShift ? 'findPrevious' : 'findNext';
115
117
  const nextTabbable = _dom.focus.tabbable[direction](event.target);
@@ -1 +1 @@
1
- {"version":3,"names":["_dom","require","_keycodes","_data","_compose","_element","_store","_dom2","_lockUnlock","_jsxRuntime","useTabNav","container","useRef","focusCaptureBeforeRef","focusCaptureAfterRef","hasMultiSelection","getSelectedBlockClientId","getBlockCount","getBlockOrder","getLastFocus","getSectionRootClientId","isZoomOut","unlock","useSelect","blockEditorStore","setLastFocus","useDispatch","noCaptureRef","onFocusCapture","event","canvasElement","current","ownerDocument","target","defaultView","frameElement","focus","querySelector","sectionRootClientId","sectionBlocks","length","isBefore","compareDocumentPosition","DOCUMENT_POSITION_FOLLOWING","tabbables","tabbable","find","next","before","jsx","ref","tabIndex","onFocus","after","useRefEffect","node","onKeyDown","defaultPrevented","keyCode","TAB","isShift","shiftKey","direction","nextTabbable","currentBlock","closest","isElementPartOfSelectedBlock","isInSameBlock","isInsideRootBlock","isFormElement","preventScroll","onFocusOut","relatedTarget","activeElement","body","preventScrollOnTab","getAttribute","preventDefault","addEventListener","removeEventListener","mergedRefs","useMergeRefs"],"sources":["@wordpress/block-editor/src/components/writing-flow/use-tab-nav.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { focus, isFormElement } from '@wordpress/dom';\nimport { TAB } from '@wordpress/keycodes';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useRefEffect, useMergeRefs } from '@wordpress/compose';\nimport { useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { isInSameBlock, isInsideRootBlock } from '../../utils/dom';\nimport { unlock } from '../../lock-unlock';\n\nexport default function useTabNav() {\n\tconst container = useRef();\n\tconst focusCaptureBeforeRef = useRef();\n\tconst focusCaptureAfterRef = useRef();\n\n\tconst {\n\t\thasMultiSelection,\n\t\tgetSelectedBlockClientId,\n\t\tgetBlockCount,\n\t\tgetBlockOrder,\n\t\tgetLastFocus,\n\t\tgetSectionRootClientId,\n\t\tisZoomOut,\n\t} = unlock( useSelect( blockEditorStore ) );\n\tconst { setLastFocus } = unlock( useDispatch( blockEditorStore ) );\n\n\t// Reference that holds the a flag for enabling or disabling\n\t// capturing on the focus capture elements.\n\tconst noCaptureRef = useRef();\n\n\tfunction onFocusCapture( event ) {\n\t\tconst canvasElement =\n\t\t\tcontainer.current.ownerDocument === event.target.ownerDocument\n\t\t\t\t? container.current\n\t\t\t\t: container.current.ownerDocument.defaultView.frameElement;\n\n\t\t// Do not capture incoming focus if set by us in WritingFlow.\n\t\tif ( noCaptureRef.current ) {\n\t\t\tnoCaptureRef.current = null;\n\t\t} else if ( hasMultiSelection() ) {\n\t\t\tcontainer.current.focus();\n\t\t} else if ( getSelectedBlockClientId() ) {\n\t\t\tif ( getLastFocus()?.current ) {\n\t\t\t\tgetLastFocus().current.focus();\n\t\t\t} else {\n\t\t\t\t// Handles when the last focus has not been set yet, or has been cleared by new blocks being added via the inserter.\n\t\t\t\tcontainer.current\n\t\t\t\t\t.querySelector(\n\t\t\t\t\t\t`[data-block=\"${ getSelectedBlockClientId() }\"]`\n\t\t\t\t\t)\n\t\t\t\t\t.focus();\n\t\t\t}\n\t\t}\n\t\t// In \"compose\" mode without a selected ID, we want to place focus on the section root when tabbing to the canvas.\n\t\telse if ( isZoomOut() ) {\n\t\t\tconst sectionRootClientId = getSectionRootClientId();\n\t\t\tconst sectionBlocks = getBlockOrder( sectionRootClientId );\n\n\t\t\t// If we have section within the section root, focus the first one.\n\t\t\tif ( sectionBlocks.length ) {\n\t\t\t\tcontainer.current\n\t\t\t\t\t.querySelector( `[data-block=\"${ sectionBlocks[ 0 ] }\"]` )\n\t\t\t\t\t.focus();\n\t\t\t}\n\t\t\t// If we don't have any section blocks, focus the section root.\n\t\t\telse if ( sectionRootClientId ) {\n\t\t\t\tcontainer.current\n\t\t\t\t\t.querySelector( `[data-block=\"${ sectionRootClientId }\"]` )\n\t\t\t\t\t.focus();\n\t\t\t} else {\n\t\t\t\t// If we don't have any section root, focus the canvas.\n\t\t\t\tcanvasElement.focus();\n\t\t\t}\n\t\t} else {\n\t\t\tconst isBefore =\n\t\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\t\tevent.target.compareDocumentPosition( canvasElement ) &\n\t\t\t\tevent.target.DOCUMENT_POSITION_FOLLOWING;\n\t\t\tconst tabbables = focus.tabbable.find( container.current );\n\n\t\t\tif ( tabbables.length ) {\n\t\t\t\tconst next = isBefore\n\t\t\t\t\t? tabbables[ 0 ]\n\t\t\t\t\t: tabbables[ tabbables.length - 1 ];\n\t\t\t\tnext.focus();\n\t\t\t}\n\t\t}\n\t}\n\n\tconst before = (\n\t\t<div\n\t\t\tref={ focusCaptureBeforeRef }\n\t\t\ttabIndex=\"0\"\n\t\t\tonFocus={ onFocusCapture }\n\t\t/>\n\t);\n\n\tconst after = (\n\t\t<div\n\t\t\tref={ focusCaptureAfterRef }\n\t\t\ttabIndex=\"0\"\n\t\t\tonFocus={ onFocusCapture }\n\t\t/>\n\t);\n\n\tconst ref = useRefEffect( ( node ) => {\n\t\tfunction onKeyDown( event ) {\n\t\t\tif ( event.defaultPrevented ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// In Edit mode, Tab should focus the first tabbable element after\n\t\t\t// the content, which is normally the sidebar (with block controls)\n\t\t\t// and Shift+Tab should focus the first tabbable element before the\n\t\t\t// content, which is normally the block toolbar.\n\t\t\t// Arrow keys can be used, and Tab and arrow keys can be used in\n\t\t\t// Navigation mode (press Esc), to navigate through blocks.\n\t\t\tif ( event.keyCode !== TAB ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst isShift = event.shiftKey;\n\t\t\tconst direction = isShift ? 'findPrevious' : 'findNext';\n\t\t\tconst nextTabbable = focus.tabbable[ direction ]( event.target );\n\n\t\t\t// We want to constrain the tabbing to the block and its child blocks.\n\t\t\t// If the preceding form element is within a different block,\n\t\t\t// such as two sibling image blocks in the placeholder state,\n\t\t\t// we want shift + tab from the first form element to move to the image\n\t\t\t// block toolbar and not the previous image block's form element.\n\t\t\tconst currentBlock = event.target.closest( '[data-block]' );\n\t\t\tconst isElementPartOfSelectedBlock =\n\t\t\t\tcurrentBlock &&\n\t\t\t\tnextTabbable &&\n\t\t\t\t( isInSameBlock( currentBlock, nextTabbable ) ||\n\t\t\t\t\tisInsideRootBlock( currentBlock, nextTabbable ) );\n\n\t\t\t// Allow tabbing from the block wrapper to a form element,\n\t\t\t// and between form elements rendered in a block and its child blocks,\n\t\t\t// such as inside a placeholder. Form elements are generally\n\t\t\t// meant to be UI rather than part of the content. Ideally\n\t\t\t// these are not rendered in the content and perhaps in the\n\t\t\t// future they can be rendered in an iframe or shadow DOM.\n\t\t\tif (\n\t\t\t\tisFormElement( nextTabbable ) &&\n\t\t\t\tisElementPartOfSelectedBlock\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst next = isShift ? focusCaptureBeforeRef : focusCaptureAfterRef;\n\n\t\t\t// Disable focus capturing on the focus capture element, so it\n\t\t\t// doesn't refocus this block and so it allows default behaviour\n\t\t\t// (moving focus to the next tabbable element).\n\t\t\tnoCaptureRef.current = true;\n\n\t\t\t// Focusing the focus capture element, which is located above and\n\t\t\t// below the editor, should not scroll the page all the way up or\n\t\t\t// down.\n\t\t\tnext.current.focus( { preventScroll: true } );\n\t\t}\n\n\t\tfunction onFocusOut( event ) {\n\t\t\tsetLastFocus( { ...getLastFocus(), current: event.target } );\n\n\t\t\tconst { ownerDocument } = node;\n\n\t\t\t// If focus disappears due to there being no blocks, move focus to\n\t\t\t// the writing flow wrapper.\n\t\t\tif (\n\t\t\t\t! event.relatedTarget &&\n\t\t\t\townerDocument.activeElement === ownerDocument.body &&\n\t\t\t\tgetBlockCount() === 0\n\t\t\t) {\n\t\t\t\tnode.focus();\n\t\t\t}\n\t\t}\n\n\t\t// When tabbing back to an element in block list, this event handler prevents scrolling if the\n\t\t// focus capture divs (before/after) are outside of the viewport. (For example shift+tab back to a paragraph\n\t\t// when focus is on a sidebar element. This prevents the scrollable writing area from jumping either to the\n\t\t// top or bottom of the document.\n\t\t//\n\t\t// Note that it isn't possible to disable scrolling in the onFocus event. We need to intercept this\n\t\t// earlier in the keypress handler, and call focus( { preventScroll: true } ) instead.\n\t\t// https://developer.mozilla.org/en-US/docs/Web/API/HTMLOrForeignElement/focus#parameters\n\t\tfunction preventScrollOnTab( event ) {\n\t\t\tif ( event.keyCode !== TAB ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( event.target?.getAttribute( 'role' ) === 'region' ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( container.current === event.target ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst isShift = event.shiftKey;\n\t\t\tconst direction = isShift ? 'findPrevious' : 'findNext';\n\t\t\tconst target = focus.tabbable[ direction ]( event.target );\n\t\t\t// Only do something when the next tabbable is a focus capture div (before/after)\n\t\t\tif (\n\t\t\t\ttarget === focusCaptureBeforeRef.current ||\n\t\t\t\ttarget === focusCaptureAfterRef.current\n\t\t\t) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\ttarget.focus( { preventScroll: true } );\n\t\t\t}\n\t\t}\n\n\t\tconst { ownerDocument } = node;\n\t\tconst { defaultView } = ownerDocument;\n\t\tdefaultView.addEventListener( 'keydown', preventScrollOnTab );\n\t\tnode.addEventListener( 'keydown', onKeyDown );\n\t\tnode.addEventListener( 'focusout', onFocusOut );\n\t\treturn () => {\n\t\t\tdefaultView.removeEventListener( 'keydown', preventScrollOnTab );\n\t\t\tnode.removeEventListener( 'keydown', onKeyDown );\n\t\t\tnode.removeEventListener( 'focusout', onFocusOut );\n\t\t};\n\t}, [] );\n\n\tconst mergedRefs = useMergeRefs( [ container, ref ] );\n\n\treturn [ before, mergedRefs, after ];\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAA2C,IAAAQ,WAAA,GAAAR,OAAA;AAd3C;AACA;AACA;;AAOA;AACA;AACA;;AAKe,SAASS,SAASA,CAAA,EAAG;EACnC,MAAMC,SAAS,GAAG,IAAAC,eAAM,EAAC,CAAC;EAC1B,MAAMC,qBA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O,MAAM;MACZrC,WAAW,CAAC6C,mBAAmB,CAAE,SAAS,EAAEJ,kBAAmB,CAAC;MAChEpB,IAAI,CAACwB,mBAAmB,CAAE,SAAS,EAAEvB,SAAU,CAAC;MAChDD,IAAI,CAACwB,mBAAmB,CAAE,UAAU,EAAER,UAAW,CAAC;IACnD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAMS,UAAU,GAAG,IAAAC,qBAAY,EAAE,CAAEtE,SAAS,EAAEuC,GAAG,CAAG,CAAC;EAErD,OAAO,CAAEF,MAAM,EAAEgC,UAAU,EAAE3B,KAAK,CAAE;AACrC","ignoreList":[]}
1
+ {"version":3,"names":["_dom","require","_keycodes","_data","_compose","_element","_store","_dom2","_lockUnlock","_jsxRuntime","useTabNav","container","useRef","focusCaptureBeforeRef","focusCaptureAfterRef","hasMultiSelection","getSelectedBlockClientId","getBlockCount","getBlockOrder","getLastFocus","getSectionRootClientId","isZoomOut","unlock","useSelect","blockEditorStore","setLastFocus","useDispatch","noCaptureRef","onFocusCapture","event","canvasElement","current","ownerDocument","target","defaultView","frameElement","focus","querySelector","sectionRootClientId","sectionBlocks","length","isBefore","compareDocumentPosition","DOCUMENT_POSITION_FOLLOWING","tabbables","tabbable","find","next","before","jsx","ref","tabIndex","onFocus","after","useRefEffect","node","onKeyDown","defaultPrevented","keyCode","TAB","isShift","shiftKey","direction","nextTabbable","currentBlock","closest","isElementPartOfSelectedBlock","isInSameBlock","isInsideRootBlock","isFormElement","preventScroll","onFocusOut","relatedTarget","activeElement","body","preventScrollOnTab","getAttribute","preventDefault","addEventListener","removeEventListener","mergedRefs","useMergeRefs"],"sources":["@wordpress/block-editor/src/components/writing-flow/use-tab-nav.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { focus, isFormElement } from '@wordpress/dom';\nimport { TAB } from '@wordpress/keycodes';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useRefEffect, useMergeRefs } from '@wordpress/compose';\nimport { useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { isInSameBlock, isInsideRootBlock } from '../../utils/dom';\nimport { unlock } from '../../lock-unlock';\n\nexport default function useTabNav() {\n\tconst container = useRef();\n\tconst focusCaptureBeforeRef = useRef();\n\tconst focusCaptureAfterRef = useRef();\n\n\tconst {\n\t\thasMultiSelection,\n\t\tgetSelectedBlockClientId,\n\t\tgetBlockCount,\n\t\tgetBlockOrder,\n\t\tgetLastFocus,\n\t\tgetSectionRootClientId,\n\t\tisZoomOut,\n\t} = unlock( useSelect( blockEditorStore ) );\n\tconst { setLastFocus } = unlock( useDispatch( blockEditorStore ) );\n\n\t// Reference that holds the a flag for enabling or disabling\n\t// capturing on the focus capture elements.\n\tconst noCaptureRef = useRef();\n\n\tfunction onFocusCapture( event ) {\n\t\tconst canvasElement =\n\t\t\tcontainer.current.ownerDocument === event.target.ownerDocument\n\t\t\t\t? container.current\n\t\t\t\t: container.current.ownerDocument.defaultView.frameElement;\n\n\t\t// Do not capture incoming focus if set by us in WritingFlow.\n\t\tif ( noCaptureRef.current ) {\n\t\t\tnoCaptureRef.current = null;\n\t\t} else if ( hasMultiSelection() ) {\n\t\t\tcontainer.current.focus();\n\t\t} else if ( getSelectedBlockClientId() ) {\n\t\t\tif ( getLastFocus()?.current ) {\n\t\t\t\tgetLastFocus().current.focus();\n\t\t\t} else {\n\t\t\t\t// Handles when the last focus has not been set yet, or has been cleared by new blocks being added via the inserter.\n\t\t\t\tcontainer.current\n\t\t\t\t\t.querySelector(\n\t\t\t\t\t\t`[data-block=\"${ getSelectedBlockClientId() }\"]`\n\t\t\t\t\t)\n\t\t\t\t\t.focus();\n\t\t\t}\n\t\t}\n\t\t// In \"compose\" mode without a selected ID, we want to place focus on the section root when tabbing to the canvas.\n\t\telse if ( isZoomOut() ) {\n\t\t\tconst sectionRootClientId = getSectionRootClientId();\n\t\t\tconst sectionBlocks = getBlockOrder( sectionRootClientId );\n\n\t\t\t// If we have section within the section root, focus the first one.\n\t\t\tif ( sectionBlocks.length ) {\n\t\t\t\tcontainer.current\n\t\t\t\t\t.querySelector( `[data-block=\"${ sectionBlocks[ 0 ] }\"]` )\n\t\t\t\t\t.focus();\n\t\t\t}\n\t\t\t// If we don't have any section blocks, focus the section root.\n\t\t\telse if ( sectionRootClientId ) {\n\t\t\t\tcontainer.current\n\t\t\t\t\t.querySelector( `[data-block=\"${ sectionRootClientId }\"]` )\n\t\t\t\t\t.focus();\n\t\t\t} else {\n\t\t\t\t// If we don't have any section root, focus the canvas.\n\t\t\t\tcanvasElement.focus();\n\t\t\t}\n\t\t} else {\n\t\t\tconst isBefore =\n\t\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\t\tevent.target.compareDocumentPosition( canvasElement ) &\n\t\t\t\tevent.target.DOCUMENT_POSITION_FOLLOWING;\n\t\t\tconst tabbables = focus.tabbable.find( container.current );\n\n\t\t\tif ( tabbables.length ) {\n\t\t\t\tconst next = isBefore\n\t\t\t\t\t? tabbables[ 0 ]\n\t\t\t\t\t: tabbables[ tabbables.length - 1 ];\n\t\t\t\tnext.focus();\n\t\t\t}\n\t\t}\n\t}\n\n\tconst before = (\n\t\t<div\n\t\t\tref={ focusCaptureBeforeRef }\n\t\t\ttabIndex=\"0\"\n\t\t\tonFocus={ onFocusCapture }\n\t\t/>\n\t);\n\n\tconst after = (\n\t\t<div\n\t\t\tref={ focusCaptureAfterRef }\n\t\t\ttabIndex=\"0\"\n\t\t\tonFocus={ onFocusCapture }\n\t\t/>\n\t);\n\n\tconst ref = useRefEffect( ( node ) => {\n\t\tfunction onKeyDown( event ) {\n\t\t\tif ( event.defaultPrevented ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// In Edit mode, Tab should focus the first tabbable element after\n\t\t\t// the content, which is normally the sidebar (with block controls)\n\t\t\t// and Shift+Tab should focus the first tabbable element before the\n\t\t\t// content, which is normally the block toolbar.\n\t\t\t// Arrow keys can be used, and Tab and arrow keys can be used in\n\t\t\t// Navigation mode (press Esc), to navigate through blocks.\n\t\t\tif ( event.keyCode !== TAB ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! hasMultiSelection() && ! getSelectedBlockClientId() ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst isShift = event.shiftKey;\n\t\t\tconst direction = isShift ? 'findPrevious' : 'findNext';\n\t\t\tconst nextTabbable = focus.tabbable[ direction ]( event.target );\n\n\t\t\t// We want to constrain the tabbing to the block and its child blocks.\n\t\t\t// If the preceding form element is within a different block,\n\t\t\t// such as two sibling image blocks in the placeholder state,\n\t\t\t// we want shift + tab from the first form element to move to the image\n\t\t\t// block toolbar and not the previous image block's form element.\n\t\t\tconst currentBlock = event.target.closest( '[data-block]' );\n\t\t\tconst isElementPartOfSelectedBlock =\n\t\t\t\tcurrentBlock &&\n\t\t\t\tnextTabbable &&\n\t\t\t\t( isInSameBlock( currentBlock, nextTabbable ) ||\n\t\t\t\t\tisInsideRootBlock( currentBlock, nextTabbable ) );\n\n\t\t\t// Allow tabbing from the block wrapper to a form element,\n\t\t\t// and between form elements rendered in a block and its child blocks,\n\t\t\t// such as inside a placeholder. Form elements are generally\n\t\t\t// meant to be UI rather than part of the content. Ideally\n\t\t\t// these are not rendered in the content and perhaps in the\n\t\t\t// future they can be rendered in an iframe or shadow DOM.\n\t\t\tif (\n\t\t\t\tisFormElement( nextTabbable ) &&\n\t\t\t\tisElementPartOfSelectedBlock\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst next = isShift ? focusCaptureBeforeRef : focusCaptureAfterRef;\n\n\t\t\t// Disable focus capturing on the focus capture element, so it\n\t\t\t// doesn't refocus this block and so it allows default behaviour\n\t\t\t// (moving focus to the next tabbable element).\n\t\t\tnoCaptureRef.current = true;\n\n\t\t\t// Focusing the focus capture element, which is located above and\n\t\t\t// below the editor, should not scroll the page all the way up or\n\t\t\t// down.\n\t\t\tnext.current.focus( { preventScroll: true } );\n\t\t}\n\n\t\tfunction onFocusOut( event ) {\n\t\t\tsetLastFocus( { ...getLastFocus(), current: event.target } );\n\n\t\t\tconst { ownerDocument } = node;\n\n\t\t\t// If focus disappears due to there being no blocks, move focus to\n\t\t\t// the writing flow wrapper.\n\t\t\tif (\n\t\t\t\t! event.relatedTarget &&\n\t\t\t\townerDocument.activeElement === ownerDocument.body &&\n\t\t\t\tgetBlockCount() === 0\n\t\t\t) {\n\t\t\t\tnode.focus();\n\t\t\t}\n\t\t}\n\n\t\t// When tabbing back to an element in block list, this event handler prevents scrolling if the\n\t\t// focus capture divs (before/after) are outside of the viewport. (For example shift+tab back to a paragraph\n\t\t// when focus is on a sidebar element. This prevents the scrollable writing area from jumping either to the\n\t\t// top or bottom of the document.\n\t\t//\n\t\t// Note that it isn't possible to disable scrolling in the onFocus event. We need to intercept this\n\t\t// earlier in the keypress handler, and call focus( { preventScroll: true } ) instead.\n\t\t// https://developer.mozilla.org/en-US/docs/Web/API/HTMLOrForeignElement/focus#parameters\n\t\tfunction preventScrollOnTab( event ) {\n\t\t\tif ( event.keyCode !== TAB ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( event.target?.getAttribute( 'role' ) === 'region' ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( container.current === event.target ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst isShift = event.shiftKey;\n\t\t\tconst direction = isShift ? 'findPrevious' : 'findNext';\n\t\t\tconst target = focus.tabbable[ direction ]( event.target );\n\t\t\t// Only do something when the next tabbable is a focus capture div (before/after)\n\t\t\tif (\n\t\t\t\ttarget === focusCaptureBeforeRef.current ||\n\t\t\t\ttarget === focusCaptureAfterRef.current\n\t\t\t) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\ttarget.focus( { preventScroll: true } );\n\t\t\t}\n\t\t}\n\n\t\tconst { ownerDocument } = node;\n\t\tconst { defaultView } = ownerDocument;\n\t\tdefaultView.addEventListener( 'keydown', preventScrollOnTab );\n\t\tnode.addEventListener( 'keydown', onKeyDown );\n\t\tnode.addEventListener( 'focusout', onFocusOut );\n\t\treturn () => {\n\t\t\tdefaultView.removeEventListener( 'keydown', preventScrollOnTab );\n\t\t\tnode.removeEventListener( 'keydown', onKeyDown );\n\t\t\tnode.removeEventListener( 'focusout', onFocusOut );\n\t\t};\n\t}, [] );\n\n\tconst mergedRefs = useMergeRefs( [ container, ref ] );\n\n\treturn [ before, mergedRefs, after ];\n}\n"],"mappings":";;;;;;AAGA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAA2C,IAAAQ,WAAA,GAAAR,OAAA;AAd3C;AACA;AACA;;AAOA;AACA;AACA;;AAKe,SAASS,SAASA,CAAA,EAAG;EACnC,MAAMC,SAAS,GAAG,IAAAC,eAAM,EAAC,CAAC;EAC1B,MAAMC,qBAAqB,GAAG,IAAAD,eAAM,EAAC,CAAC;EACtC,MAAME,oBAAoB,GAAG,IAAAF,eAAM,EAAC,CAAC;EAErC,MAAM;IACLG,iBAAiB;IACjBC,wBAAwB;IACxBC,aAAa;IACbC,aAAa;IACbC,YAAY;IACZC,sBAAsB;IACtBC;EACD,CAAC,GAAG,IAAAC,kBAAM,EAAE,IAAAC,eAAS,EAAEC,YAAiB,CAAE,CAAC;EAC3C,MAAM;IAAEC;EAAa,CAAC,GAAG,IAAAH,kBAAM,EAAE,IAAAI,iBAAW,EAAEF,YAAiB,CAAE,CAAC;;EAElE;EACA;EACA,MAAMG,YAAY,GAAG,IAAAf,eAAM,EAAC,CAAC;EAE7B,SAASgB,cAAcA,CAAEC,KAAK,EAAG;IAChC,MAAMC,aAAa,GAClBnB,SAAS,CA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+1,3 @@
1
- /* wp:polyfill */
2
1
  "use strict";
3
2
 
4
3
  Object.defineProperty(exports, "__esModule", {
@@ -1 +1 @@
1
- {"version":3,"names":["_dom","require","_blocks2","_pasting","_store","requiresWrapperOnCopy","exports","Symbol","setClipboardBlocks","event","blocks","registry","_blocks","firstBlock","firstBlockType","select","blocksStore","getBlockType","name","getBlockRootClientId","getBlockName","getBlockAttributes","blockEditorStore","wrapperBlockClientId","clientId","wrapperBlockName","createBlock","serialized","serialize","clipboardData","setData","toPlainText","getPasteBlocks","canUserUseUnfilteredHTML","plainText","html","files","getPasteEventData","length","fromTransforms","getBlockTransforms","reduce","accumulator","file","transformation","findTransform","transform","type","isMatch","push","flat","pasteHandler","HTML","mode","replace","stripHTML","trim"],"sources":["@wordpress/block-editor/src/components/writing-flow/utils.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\nimport {\n\tserialize,\n\tcreateBlock,\n\tpasteHandler,\n\tfindTransform,\n\tgetBlockTransforms,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { getPasteEventData } from '../../utils/pasting';\nimport { store as blockEditorStore } from '../../store';\n\nexport const requiresWrapperOnCopy = Symbol( 'requiresWrapperOnCopy' );\n\n/**\n * Sets the clipboard data for the provided blocks, with both HTML and plain\n * text representations.\n *\n * @param {ClipboardEvent} event Clipboard event.\n * @param {WPBlock[]} blocks Blocks to set as clipboard data.\n * @param {Object} registry The registry to select from.\n */\nexport function setClipboardBlocks( event, blocks, registry ) {\n\tlet _blocks = blocks;\n\n\tconst [ firstBlock ] = blocks;\n\n\tif ( firstBlock ) {\n\t\tconst firstBlockType = registry\n\t\t\t.select( blocksStore )\n\t\t\t.getBlockType( firstBlock.name );\n\n\t\tif ( firstBlockType[ requiresWrapperOnCopy ] ) {\n\t\t\tconst { getBlockRootClientId, getBlockName, getBlockAttributes } =\n\t\t\t\tregistry.select( blockEditorStore );\n\t\t\tconst wrapperBlockClientId = getBlockRootClientId(\n\t\t\t\tfirstBlock.clientId\n\t\t\t);\n\t\t\tconst wrapperBlockName = getBlockName( wrapperBlockClientId );\n\n\t\t\tif ( wrapperBlockName ) {\n\t\t\t\t_blocks = createBlock(\n\t\t\t\t\twrapperBlockName,\n\t\t\t\t\tgetBlockAttributes( wrapperBlockClientId ),\n\t\t\t\t\t_blocks\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tconst serialized = serialize( _blocks );\n\n\tevent.clipboardData.setData( 'text/plain', toPlainText( serialized ) );\n\tevent.clipboardData.setData( 'text/html', serialized );\n}\n\n/**\n * Returns the blocks to be pasted from the clipboard event.\n *\n * @param {ClipboardEvent} event The clipboard event.\n * @param {boolean} canUserUseUnfilteredHTML Whether the user can or can't post unfiltered HTML.\n * @return {Array|string} A list of blocks or a string, depending on `handlerMode`.\n */\nexport function getPasteBlocks( event, canUserUseUnfilteredHTML ) {\n\tconst { plainText, html, files } = getPasteEventData( event );\n\tlet blocks = [];\n\n\tif ( files.length ) {\n\t\tconst fromTransforms = getBlockTransforms( 'from' );\n\t\tblocks = files\n\t\t\t.reduce( ( accumulator, file ) => {\n\t\t\t\tconst transformation = findTransform(\n\t\t\t\t\tfromTransforms,\n\t\t\t\t\t( transform ) =>\n\t\t\t\t\t\ttransform.type === 'files' &&\n\t\t\t\t\t\ttransform.isMatch( [ file ] )\n\t\t\t\t);\n\t\t\t\tif ( transformation ) {\n\t\t\t\t\taccumulator.push( transformation.transform( [ file ] ) );\n\t\t\t\t}\n\t\t\t\treturn accumulator;\n\t\t\t}, [] )\n\t\t\t.flat();\n\t} else {\n\t\tblocks = pasteHandler( {\n\t\t\tHTML: html,\n\t\t\tplainText,\n\t\t\tmode: 'BLOCKS',\n\t\t\tcanUserUseUnfilteredHTML,\n\t\t} );\n\t}\n\n\treturn blocks;\n}\n\n/**\n * Given a string of HTML representing serialized blocks, returns the plain\n * text extracted after stripping the HTML of any tags and fixing line breaks.\n *\n * @param {string} html Serialized blocks.\n * @return {string} The plain-text content with any html removed.\n */\nfunction toPlainText( html ) {\n\t// Manually handle BR tags as line breaks prior to `stripHTML` call\n\thtml = html.replace( /<br>/g, '\\n' );\n\n\tconst plainText = stripHTML( html ).trim();\n\n\t// Merge any consecutive line breaks\n\treturn plainText.replace( /\\n\\n+/g, '\\n\\n' );\n}\n"],"mappings":";;;;;;;;;AAGA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAYA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAjBA;AACA;AACA;;AAWA;AACA;AACA;;AAIO,MAAMI,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,GAAGE,MAAM,CAAE,uBAAwB,CAAC;;AAEtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,kBAAkBA,CAAEC,KAAK,EAAEC,MAAM,EAAEC,QAAQ,EAAG;EAC7D,IAAIC,OAAO,GAAGF,MAAM;EAEpB,MAAM,CAAEG,UAAU,CAAE,GAAGH,MAAM;EAE7B,IAAKG,UAAU,EAAG;IACjB,MAAMC,cAAc,GAAGH,QAAQ,CAC7BI,MAAM,CAAEC,cAAY,CAAC,CACrBC,YAAY,CAAEJ,UAAU,CAACK,IAAK,CAAC;IAEjC,IAAKJ,cAAc,CAAET,qBAAqB,CAAE,EAAG;MAC9C,MAAM;QAAEc,oBAAoB;QAAEC,YAAY;QAAEC;MAAmB,CAAC,GAC/DV,QAAQ,CAACI,MAAM,CAAEO,YAAiB,CAAC;MACpC,MAAMC,oBAAoB,GAAGJ,oBAAoB,CAChDN,UAAU,CAACW,QACZ,CAAC;MACD,MAAMC,gBAAgB,GAAGL,YAAY,CAAEG,oBAAqB,CAAC;MAE7D,IAAKE,gBAAgB,EAAG;QACvBb,OAAO,GAAG,IAAAc,oBAAW,EACpBD,gBAAgB,EAChBJ,kBAAkB,CAAEE,oBAAqB,CAAC,EAC1C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A,SAASqB,WAAWA,CAAEI,IAAI,EAAG;EAC5B;EACAA,IAAI,GAAGA,IAAI,CAACmB,OAAO,CAAE,OAAO,EAAE,IAAK,CAAC;EAEpC,MAAMpB,SAAS,GAAG,IAAAqB,wBAAS,EAAEpB,IAAK,CAAC,CAACqB,IAAI,CAAC,CAAC;;EAE1C;EACA,OAAOtB,SAAS,CAACoB,OAAO,CAAE,QAAQ,EAAE,MAAO,CAAC;AAC7C","ignoreList":[]}
1
+ {"version":3,"names":["_dom","require","_blocks2","_pasting","_store","requiresWrapperOnCopy","exports","Symbol","setClipboardBlocks","event","blocks","registry","_blocks","firstBlock","firstBlockType","select","blocksStore","getBlockType","name","getBlockRootClientId","getBlockName","getBlockAttributes","blockEditorStore","wrapperBlockClientId","clientId","wrapperBlockName","createBlock","serialized","serialize","clipboardData","setData","toPlainText","getPasteBlocks","canUserUseUnfilteredHTML","plainText","html","files","getPasteEventData","length","fromTransforms","getBlockTransforms","reduce","accumulator","file","transformation","findTransform","transform","type","isMatch","push","flat","pasteHandler","HTML","mode","replace","stripHTML","trim"],"sources":["@wordpress/block-editor/src/components/writing-flow/utils.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\nimport {\n\tserialize,\n\tcreateBlock,\n\tpasteHandler,\n\tfindTransform,\n\tgetBlockTransforms,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { getPasteEventData } from '../../utils/pasting';\nimport { store as blockEditorStore } from '../../store';\n\nexport const requiresWrapperOnCopy = Symbol( 'requiresWrapperOnCopy' );\n\n/**\n * Sets the clipboard data for the provided blocks, with both HTML and plain\n * text representations.\n *\n * @param {ClipboardEvent} event Clipboard event.\n * @param {WPBlock[]} blocks Blocks to set as clipboard data.\n * @param {Object} registry The registry to select from.\n */\nexport function setClipboardBlocks( event, blocks, registry ) {\n\tlet _blocks = blocks;\n\n\tconst [ firstBlock ] = blocks;\n\n\tif ( firstBlock ) {\n\t\tconst firstBlockType = registry\n\t\t\t.select( blocksStore )\n\t\t\t.getBlockType( firstBlock.name );\n\n\t\tif ( firstBlockType[ requiresWrapperOnCopy ] ) {\n\t\t\tconst { getBlockRootClientId, getBlockName, getBlockAttributes } =\n\t\t\t\tregistry.select( blockEditorStore );\n\t\t\tconst wrapperBlockClientId = getBlockRootClientId(\n\t\t\t\tfirstBlock.clientId\n\t\t\t);\n\t\t\tconst wrapperBlockName = getBlockName( wrapperBlockClientId );\n\n\t\t\tif ( wrapperBlockName ) {\n\t\t\t\t_blocks = createBlock(\n\t\t\t\t\twrapperBlockName,\n\t\t\t\t\tgetBlockAttributes( wrapperBlockClientId ),\n\t\t\t\t\t_blocks\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tconst serialized = serialize( _blocks );\n\n\tevent.clipboardData.setData( 'text/plain', toPlainText( serialized ) );\n\tevent.clipboardData.setData( 'text/html', serialized );\n}\n\n/**\n * Returns the blocks to be pasted from the clipboard event.\n *\n * @param {ClipboardEvent} event The clipboard event.\n * @param {boolean} canUserUseUnfilteredHTML Whether the user can or can't post unfiltered HTML.\n * @return {Array|string} A list of blocks or a string, depending on `handlerMode`.\n */\nexport function getPasteBlocks( event, canUserUseUnfilteredHTML ) {\n\tconst { plainText, html, files } = getPasteEventData( event );\n\tlet blocks = [];\n\n\tif ( files.length ) {\n\t\tconst fromTransforms = getBlockTransforms( 'from' );\n\t\tblocks = files\n\t\t\t.reduce( ( accumulator, file ) => {\n\t\t\t\tconst transformation = findTransform(\n\t\t\t\t\tfromTransforms,\n\t\t\t\t\t( transform ) =>\n\t\t\t\t\t\ttransform.type === 'files' &&\n\t\t\t\t\t\ttransform.isMatch( [ file ] )\n\t\t\t\t);\n\t\t\t\tif ( transformation ) {\n\t\t\t\t\taccumulator.push( transformation.transform( [ file ] ) );\n\t\t\t\t}\n\t\t\t\treturn accumulator;\n\t\t\t}, [] )\n\t\t\t.flat();\n\t} else {\n\t\tblocks = pasteHandler( {\n\t\t\tHTML: html,\n\t\t\tplainText,\n\t\t\tmode: 'BLOCKS',\n\t\t\tcanUserUseUnfilteredHTML,\n\t\t} );\n\t}\n\n\treturn blocks;\n}\n\n/**\n * Given a string of HTML representing serialized blocks, returns the plain\n * text extracted after stripping the HTML of any tags and fixing line breaks.\n *\n * @param {string} html Serialized blocks.\n * @return {string} The plain-text content with any html removed.\n */\nfunction toPlainText( html ) {\n\t// Manually handle BR tags as line breaks prior to `stripHTML` call\n\thtml = html.replace( /<br>/g, '\\n' );\n\n\tconst plainText = stripHTML( html ).trim();\n\n\t// Merge any consecutive line breaks\n\treturn plainText.replace( /\\n\\n+/g, '\\n\\n' );\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAYA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAjBA;AACA;AACA;;AAWA;AACA;AACA;;AAIO,MAAMI,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,GAAGE,MAAM,CAAE,uBAAwB,CAAC;;AAEtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,kBAAkBA,CAAEC,KAAK,EAAEC,MAAM,EAAEC,QAAQ,EAAG;EAC7D,IAAIC,OAAO,GAAGF,MAAM;EAEpB,MAAM,CAAEG,UAAU,CAAE,GAAGH,MAAM;EAE7B,IAAKG,UAAU,EAAG;IACjB,MAAMC,cAAc,GAAGH,QAAQ,CAC7BI,MAAM,CAAEC,cAAY,CAAC,CACrBC,YAAY,CAAEJ,UAAU,CAACK,IAAK,CAAC;IAEjC,IAAKJ,cAAc,CAAET,qBAAqB,CAAE,EAAG;MAC9C,MAAM;QAAEc,oBAAoB;QAAEC,YAAY;QAAEC;MAAmB,CAAC,GAC/DV,QAAQ,CAACI,MAAM,CAAEO,YAAiB,CAAC;MACpC,MAAMC,oBAAoB,GAAGJ,oBAAoB,CAChDN,U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IACNxC,MAAM,GAAG,IAAAyC,qBAAY,EAAE;MACtBC,IAAI,EAAEjB,IAAI;MACVD,SAAS;MACTmB,IAAI,EAAE,QAAQ;MACdpB;IACD,CAAE,CAAC;EACJ;EAEA,OAAOvB,MAAM;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASqB,WAAWA,CAAEI,IAAI,EAAG;EAC5B;EACAA,IAAI,GAAGA,IAAI,CAACmB,OAAO,CAAE,OAAO,EAAE,IAAK,CAAC;EAEpC,MAAMpB,SAAS,GAAG,IAAAqB,wBAAS,EAAEpB,IAAK,CAAC,CAACqB,IAAI,CAAC,CAAC;;EAE1C;EACA,OAAOtB,SAAS,CAACoB,OAAO,CAAE,QAAQ,EAAE,MAAO,CAAC;AAC7C","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- /* wp:polyfill */
2
1
  "use strict";
3
2
 
4
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_icons","_components","_jsxRuntime","WRITING_MODES","label","__","value","icon","textHorizontal","isRTL","textVertical","WritingModeControl","className","onChange","jsx","__experimentalToggleGroupControl","isDeselectable","__nextHasNoMarginBottom","__next40pxDefaultSize","clsx","newValue","undefined","children","map","option","__experimentalToggleGroupControlOptionIcon"],"sources":["@wordpress/block-editor/src/components/writing-mode-control/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, isRTL } from '@wordpress/i18n';\nimport { textHorizontal, textVertical } from '@wordpress/icons';\nimport {\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOptionIcon as ToggleGroupControlOptionIcon,\n} from '@wordpress/components';\n\nconst WRITING_MODES = [\n\t{\n\t\tlabel: __( 'Horizontal' ),\n\t\tvalue: 'horizontal-tb',\n\t\ticon: textHorizontal,\n\t},\n\t{\n\t\tlabel: __( 'Vertical' ),\n\t\tvalue: isRTL() ? 'vertical-lr' : 'vertical-rl',\n\t\ticon: textVertical,\n\t},\n];\n\n/**\n * Control to facilitate writing mode selections.\n *\n * @param {Object} props Component props.\n * @param {string} props.className Class name to add to the control.\n * @param {string} props.value Currently selected writing mode.\n * @param {Function} props.onChange Handles change in the writing mode selection.\n *\n * @return {Element} Writing Mode control.\n */\nexport default function WritingModeControl( { className, value, onChange } ) {\n\treturn (\n\t\t<ToggleGroupControl\n\t\t\tisDeselectable\n\t\t\t__nextHasNoMarginBottom\n\t\t\t__next40pxDefaultSize\n\t\t\tlabel={ __( 'Orientation' ) }\n\t\t\tclassName={ clsx( 'block-editor-writing-mode-control', className ) }\n\t\t\tvalue={ value }\n\t\t\tonChange={ ( newValue ) => {\n\t\t\t\tonChange( newValue === value ? undefined : newValue );\n\t\t\t} }\n\t\t>\n\t\t\t{ WRITING_MODES.map( ( option ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<ToggleGroupControlOptionIcon\n\t\t\t\t\t\tkey={ option.value }\n\t\t\t\t\t\tvalue={ option.value }\n\t\t\t\t\t\ticon={ option.icon }\n\t\t\t\t\t\tlabel={ option.label }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</ToggleGroupControl>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAG+B,IAAAI,WAAA,GAAAJ,OAAA;AAb/B;AACA;AACA;;AAGA;AACA;AACA;;AAQA,MAAMK,aAAa,GAAG,CACrB;EACCC,KAAK,EAAE,IAAAC,QAAE,EAAE,YAAa,CAAC;EACzBC,KAAK,EAAE,eAAe;EACtBC,IAAI,EAAEC;AACP,CAAC,EACD;EACCJ,KAAK,EAAE,IAAAC,QAAE,EAAE,UAAW,CAAC;EACvBC,KAAK,EAAE,IAAAG,WAAK,EAAC,CAAC,GAAG,aAAa,GAAG,aAAa;EAC9CF,IAAI,EAAEG;AACP,CAAC,CACD;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASC,kBAAkBA,CAAE;EAAEC,SAAS;EAAEN,KAAK;EAAEO;AAAS,CAAC,EAAG;EAC5E,oBACC,IAAAX,WAAA,CAAAY,GAAA,EAACb,WAAA,CAAAc,gCAAkB;IAClBC,cAAc;IACdC,uBAAuB;IACvBC,qBAAqB;IACrBd,KAAK,EAAG,IAAAC,QAAE,EAAE,aAAc,CAAG;IAC7BO,SAAS,EAAG,IAAAO,aAAI,EAAE,mCAAmC,EAAEP,SAAU,CAAG;IACpEN,KAAK,EAAGA,KAAO;IACfO,QAAQ,EAAKO,QAAQ,IAAM;MAC1BP,QAAQ,CAAEO,QAAQ,KAAKd,KAAK,GAAGe,SAAS,GAAGD,QAAS,CAAC;IACtD,CAAG;IAAAE,QAAA,EAEDnB,aAAa,CAACoB,GAAG,CAAIC,MAAM,IAAM;MAClC,oBACC,IAAAtB,WAAA,CAAAY,GAAA,EAACb,WAAA,CAAAwB,0CAA4B;QAE5BnB,KAAK,EAAGkB,MAAM,CAAClB,KAAO;QACtBC,IAAI,EAAGiB,MAAM,CAACjB,IAAM;QACpBH,KAAK,EAAGoB,MAAM,CAACpB;MAAO,GAHhBoB,MAAM,CAAClB,KAIb,CAAC;IAEJ,CAAE;EAAC,CACgB,CAAC;AAEvB","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_icons","_components","_jsxRuntime","WRITING_MODES","label","__","value","icon","textHorizontal","isRTL","textVertical","WritingModeControl","className","onChange","jsx","__experimentalToggleGroupControl","isDeselectable","__nextHasNoMarginBottom","__next40pxDefaultSize","clsx","newValue","undefined","children","map","option","__experimentalToggleGroupControlOptionIcon"],"sources":["@wordpress/block-editor/src/components/writing-mode-control/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, isRTL } from '@wordpress/i18n';\nimport { textHorizontal, textVertical } from '@wordpress/icons';\nimport {\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOptionIcon as ToggleGroupControlOptionIcon,\n} from '@wordpress/components';\n\nconst WRITING_MODES = [\n\t{\n\t\tlabel: __( 'Horizontal' ),\n\t\tvalue: 'horizontal-tb',\n\t\ticon: textHorizontal,\n\t},\n\t{\n\t\tlabel: __( 'Vertical' ),\n\t\tvalue: isRTL() ? 'vertical-lr' : 'vertical-rl',\n\t\ticon: textVertical,\n\t},\n];\n\n/**\n * Control to facilitate writing mode selections.\n *\n * @param {Object} props Component props.\n * @param {string} props.className Class name to add to the control.\n * @param {string} props.value Currently selected writing mode.\n * @param {Function} props.onChange Handles change in the writing mode selection.\n *\n * @return {Element} Writing Mode control.\n */\nexport default function WritingModeControl( { className, value, onChange } ) {\n\treturn (\n\t\t<ToggleGroupControl\n\t\t\tisDeselectable\n\t\t\t__nextHasNoMarginBottom\n\t\t\t__next40pxDefaultSize\n\t\t\tlabel={ __( 'Orientation' ) }\n\t\t\tclassName={ clsx( 'block-editor-writing-mode-control', className ) }\n\t\t\tvalue={ value }\n\t\t\tonChange={ ( newValue ) => {\n\t\t\t\tonChange( newValue === value ? undefined : newValue );\n\t\t\t} }\n\t\t>\n\t\t\t{ WRITING_MODES.map( ( option ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<ToggleGroupControlOptionIcon\n\t\t\t\t\t\tkey={ option.value }\n\t\t\t\t\t\tvalue={ option.value }\n\t\t\t\t\t\ticon={ option.icon }\n\t\t\t\t\t\tlabel={ option.label }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</ToggleGroupControl>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAA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;IAEJ,CAAE;EAAC,CACgB,CAAC;AAEvB","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- /* wp:polyfill */
2
1
  "use strict";
3
2
 
4
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_hooks","_blocks","_components","_useAvailableAlignments","_blockEditingMode","_jsxRuntime","ALL_ALIGNMENTS","WIDE_ALIGNMENTS","getValidAlignments","blockAlign","hasWideBlockSupport","hasWideEnabled","validAlignments","Array","isArray","filter","value","includes","alignment","addAttribute","settings","_settings$attributes$","attributes","align","hasBlockSupport","type","enum","BlockEditAlignmentToolbarControlsPure","name","blockName","setAttributes","blockAllowedAlignments","getBlockSupport","useAvailableAlignments","map","blockEditingMode","useBlockEditingMode","length","updateAlignment","nextAlign","blockType","getBlockType","blockDefaultAlign","default","jsx","BlockControls","group","__experimentalShareWithChildBlocks","children","BlockAlignmentControl","onChange","controls","_default","exports","shareWithChildBlocks","edit","useBlockProps","addSaveProps","addAssignedAlign","attributeKeys","hasSupport","some","props","isAlignValid","className","clsx","addFilter"],"sources":["@wordpress/block-editor/src/hooks/align.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport {\n\tgetBlockSupport,\n\tgetBlockType,\n\thasBlockSupport,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { BlockControls, BlockAlignmentControl } from '../components';\nimport useAvailableAlignments from '../components/block-alignment-control/use-available-alignments';\nimport { useBlockEditingMode } from '../components/block-editing-mode';\n\n/**\n * An array which includes all possible valid alignments,\n * used to validate if an alignment is valid or not.\n *\n * @constant\n * @type {string[]}\n */\nconst ALL_ALIGNMENTS = [ 'left', 'center', 'right', 'wide', 'full' ];\n\n/**\n * An array which includes all wide alignments.\n * In order for this alignments to be valid they need to be supported by the block,\n * and by the theme.\n *\n * @constant\n * @type {string[]}\n */\nconst WIDE_ALIGNMENTS = [ 'wide', 'full' ];\n\n/**\n * Returns the valid alignments.\n * Takes into consideration the aligns supported by a block, if the block supports wide controls or not and if theme supports wide controls or not.\n * Exported just for testing purposes, not exported outside the module.\n *\n * @param {?boolean|string[]} blockAlign Aligns supported by the block.\n * @param {?boolean} hasWideBlockSupport True if block supports wide alignments. And False otherwise.\n * @param {?boolean} hasWideEnabled True if theme supports wide alignments. And False otherwise.\n *\n * @return {string[]} Valid alignments.\n */\nexport function getValidAlignments(\n\tblockAlign,\n\thasWideBlockSupport = true,\n\thasWideEnabled = true\n) {\n\tlet validAlignments;\n\tif ( Array.isArray( blockAlign ) ) {\n\t\tvalidAlignments = ALL_ALIGNMENTS.filter( ( value ) =>\n\t\t\tblockAlign.includes( value )\n\t\t);\n\t} else if ( blockAlign === true ) {\n\t\t// `true` includes all alignments...\n\t\tvalidAlignments = [ ...ALL_ALIGNMENTS ];\n\t} else {\n\t\tvalidAlignments = [];\n\t}\n\n\tif (\n\t\t! hasWideEnabled ||\n\t\t( blockAlign === true && ! hasWideBlockSupport )\n\t) {\n\t\treturn validAlignments.filter(\n\t\t\t( alignment ) => ! WIDE_ALIGNMENTS.includes( alignment )\n\t\t);\n\t}\n\n\treturn validAlignments;\n}\n\n/**\n * Filters registered block settings, extending attributes to include `align`.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nexport function addAttribute( settings ) {\n\t// Allow blocks to specify their own attribute definition with default values if needed.\n\tif ( 'type' in ( settings.attributes?.align ?? {} ) ) {\n\t\treturn settings;\n\t}\n\tif ( hasBlockSupport( settings, 'align' ) ) {\n\t\t// Gracefully handle if settings.attributes is undefined.\n\t\tsettings.attributes = {\n\t\t\t...settings.attributes,\n\t\t\talign: {\n\t\t\t\ttype: 'string',\n\t\t\t\t// Allow for '' since it is used by the `updateAlignment` function\n\t\t\t\t// in toolbar controls for special cases with defined default values.\n\t\t\t\tenum: [ ...ALL_ALIGNMENTS, '' ],\n\t\t\t},\n\t\t};\n\t}\n\n\treturn settings;\n}\n\nfunction BlockEditAlignmentToolbarControlsPure( {\n\tname: blockName,\n\talign,\n\tsetAttributes,\n} ) {\n\t// Compute the block valid alignments by taking into account,\n\t// if the theme supports wide alignments or not and the layout's\n\t// available alignments. We do that for conditionally rendering\n\t// Slot.\n\tconst blockAllowedAlignments = getValidAlignments(\n\t\tgetBlockSupport( blockName, 'align' ),\n\t\thasBlockSupport( blockName, 'alignWide', true )\n\t);\n\n\tconst validAlignments = useAvailableAlignments(\n\t\tblockAllowedAlignments\n\t).map( ( { name } ) => name );\n\tconst blockEditingMode = useBlockEditingMode();\n\tif ( ! validAlignments.length || blockEditingMode !== 'default' ) {\n\t\treturn null;\n\t}\n\n\tconst updateAlignment = ( nextAlign ) => {\n\t\tif ( ! nextAlign ) {\n\t\t\tconst blockType = getBlockType( blockName );\n\t\t\tconst blockDefaultAlign = blockType?.attributes?.align?.default;\n\t\t\tif ( blockDefaultAlign ) {\n\t\t\t\tnextAlign = '';\n\t\t\t}\n\t\t}\n\t\tsetAttributes( { align: nextAlign } );\n\t};\n\n\treturn (\n\t\t<BlockControls group=\"block\" __experimentalShareWithChildBlocks>\n\t\t\t<BlockAlignmentControl\n\t\t\t\tvalue={ align }\n\t\t\t\tonChange={ updateAlignment }\n\t\t\t\tcontrols={ validAlignments }\n\t\t\t/>\n\t\t</BlockControls>\n\t);\n}\n\nexport default {\n\tshareWithChildBlocks: true,\n\tedit: BlockEditAlignmentToolbarControlsPure,\n\tuseBlockProps,\n\taddSaveProps: addAssignedAlign,\n\tattributeKeys: [ 'align' ],\n\thasSupport( name ) {\n\t\treturn hasBlockSupport( name, 'align', false );\n\t},\n};\n\nfunction useBlockProps( { name, align } ) {\n\tconst blockAllowedAlignments = getValidAlignments(\n\t\tgetBlockSupport( name, 'align' ),\n\t\thasBlockSupport( name, 'alignWide', true )\n\t);\n\tconst validAlignments = useAvailableAlignments( blockAllowedAlignments );\n\n\tif ( validAlignments.some( ( alignment ) => alignment.name === align ) ) {\n\t\treturn { 'data-align': align };\n\t}\n\n\treturn {};\n}\n\n/**\n * Override props assigned to save component to inject alignment class name if\n * block supports it.\n *\n * @param {Object} props Additional props applied to save element.\n * @param {Object} blockType Block type.\n * @param {Object} attributes Block attributes.\n *\n * @return {Object} Filtered props applied to save element.\n */\nexport function addAssignedAlign( props, blockType, attributes ) {\n\tconst { align } = attributes;\n\tconst blockAlign = getBlockSupport( blockType, 'align' );\n\tconst hasWideBlockSupport = hasBlockSupport( blockType, 'alignWide', true );\n\n\t// Compute valid alignments without taking into account if\n\t// the theme supports wide alignments or not.\n\t// This way changing themes does not impact the block save.\n\tconst isAlignValid = getValidAlignments(\n\t\tblockAlign,\n\t\thasWideBlockSupport\n\t).includes( align );\n\tif ( isAlignValid ) {\n\t\tprops.className = clsx( `align${ align }`, props.className );\n\t}\n\n\treturn props;\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/editor/align/addAttribute',\n\taddAttribute\n);\n"],"mappings":";;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AASA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,uBAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,iBAAA,GAAAL,OAAA;AAAuE,IAAAM,WAAA,GAAAN,OAAA;AApBvE;AACA;AACA;;AAGA;AACA;AACA;;AAQA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA,GACA,MAAMO,cAAc,GAAG,CAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAE;;AAEpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,eAAe,GAAG,CAAE,MAAM,EAAE,MAAM,CAAE;;AAE1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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AS1C,KAAK,EAAG,EAAEuC,KAAK,CAACE,SAAU,CAAC;EAC7D;EAEA,OAAOF,KAAK;AACb;AAEA,IAAAI,gBAAS,EACR,0BAA0B,EAC1B,gCAAgC,EAChC/C,YACD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_hooks","_blocks","_components","_useAvailableAlignments","_blockEditingMode","_jsxRuntime","ALL_ALIGNMENTS","WIDE_ALIGNMENTS","getValidAlignments","blockAlign","hasWideBlockSupport","hasWideEnabled","validAlignments","Array","isArray","filter","value","includes","alignment","addAttribute","settings","_settings$attributes$","attributes","align","hasBlockSupport","type","enum","BlockEditAlignmentToolbarControlsPure","name","blockName","setAttributes","blockAllowedAlignments","getBlockSupport","useAvailableAlignments","map","blockEditingMode","useBlockEditingMode","length","updateAlignment","nextAlign","blockType","getBlockType","blockDefaultAlign","default","jsx","BlockControls","group","__experimentalShareWithChildBlocks","children","BlockAlignmentControl","onChange","controls","_default","exports","shareWithChildBlocks","edit","useBlockProps","addSaveProps","addAssignedAlign","attributeKeys","hasSupport","some","props","isAlignValid","className","clsx","addFilter"],"sources":["@wordpress/block-editor/src/hooks/align.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport {\n\tgetBlockSupport,\n\tgetBlockType,\n\thasBlockSupport,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { BlockControls, BlockAlignmentControl } from '../components';\nimport useAvailableAlignments from '../components/block-alignment-control/use-available-alignments';\nimport { useBlockEditingMode } from '../components/block-editing-mode';\n\n/**\n * An array which includes all possible valid alignments,\n * used to validate if an alignment is valid or not.\n *\n * @constant\n * @type {string[]}\n */\nconst ALL_ALIGNMENTS = [ 'left', 'center', 'right', 'wide', 'full' ];\n\n/**\n * An array which includes all wide alignments.\n * In order for this alignments to be valid they need to be supported by the block,\n * and by the theme.\n *\n * @constant\n * @type {string[]}\n */\nconst WIDE_ALIGNMENTS = [ 'wide', 'full' ];\n\n/**\n * Returns the valid alignments.\n * Takes into consideration the aligns supported by a block, if the block supports wide controls or not and if theme supports wide controls or not.\n * Exported just for testing purposes, not exported outside the module.\n *\n * @param {?boolean|string[]} blockAlign Aligns supported by the block.\n * @param {?boolean} hasWideBlockSupport True if block supports wide alignments. And False otherwise.\n * @param {?boolean} hasWideEnabled True if theme supports wide alignments. And False otherwise.\n *\n * @return {string[]} Valid alignments.\n */\nexport function getValidAlignments(\n\tblockAlign,\n\thasWideBlockSupport = true,\n\thasWideEnabled = true\n) {\n\tlet validAlignments;\n\tif ( Array.isArray( blockAlign ) ) {\n\t\tvalidAlignments = ALL_ALIGNMENTS.filter( ( value ) =>\n\t\t\tblockAlign.includes( value )\n\t\t);\n\t} else if ( blockAlign === true ) {\n\t\t// `true` includes all alignments...\n\t\tvalidAlignments = [ ...ALL_ALIGNMENTS ];\n\t} else {\n\t\tvalidAlignments = [];\n\t}\n\n\tif (\n\t\t! hasWideEnabled ||\n\t\t( blockAlign === true && ! hasWideBlockSupport )\n\t) {\n\t\treturn validAlignments.filter(\n\t\t\t( alignment ) => ! WIDE_ALIGNMENTS.includes( alignment )\n\t\t);\n\t}\n\n\treturn validAlignments;\n}\n\n/**\n * Filters registered block settings, extending attributes to include `align`.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nexport function addAttribute( settings ) {\n\t// Allow blocks to specify their own attribute definition with default values if needed.\n\tif ( 'type' in ( settings.attributes?.align ?? {} ) ) {\n\t\treturn settings;\n\t}\n\tif ( hasBlockSupport( settings, 'align' ) ) {\n\t\t// Gracefully handle if settings.attributes is undefined.\n\t\tsettings.attributes = {\n\t\t\t...settings.attributes,\n\t\t\talign: {\n\t\t\t\ttype: 'string',\n\t\t\t\t// Allow for '' since it is used by the `updateAlignment` function\n\t\t\t\t// in toolbar controls for special cases with defined default values.\n\t\t\t\tenum: [ ...ALL_ALIGNMENTS, '' ],\n\t\t\t},\n\t\t};\n\t}\n\n\treturn settings;\n}\n\nfunction BlockEditAlignmentToolbarControlsPure( {\n\tname: blockName,\n\talign,\n\tsetAttributes,\n} ) {\n\t// Compute the block valid alignments by taking into account,\n\t// if the theme supports wide alignments or not and the layout's\n\t// available alignments. We do that for conditionally rendering\n\t// Slot.\n\tconst blockAllowedAlignments = getValidAlignments(\n\t\tgetBlockSupport( blockName, 'align' ),\n\t\thasBlockSupport( blockName, 'alignWide', true )\n\t);\n\n\tconst validAlignments = useAvailableAlignments(\n\t\tblockAllowedAlignments\n\t).map( ( { name } ) => name );\n\tconst blockEditingMode = useBlockEditingMode();\n\tif ( ! validAlignments.length || blockEditingMode !== 'default' ) {\n\t\treturn null;\n\t}\n\n\tconst updateAlignment = ( nextAlign ) => {\n\t\tif ( ! nextAlign ) {\n\t\t\tconst blockType = getBlockType( blockName );\n\t\t\tconst blockDefaultAlign = blockType?.attributes?.align?.default;\n\t\t\tif ( blockDefaultAlign ) {\n\t\t\t\tnextAlign = '';\n\t\t\t}\n\t\t}\n\t\tsetAttributes( { align: nextAlign } );\n\t};\n\n\treturn (\n\t\t<BlockControls group=\"block\" __experimentalShareWithChildBlocks>\n\t\t\t<BlockAlignmentControl\n\t\t\t\tvalue={ align }\n\t\t\t\tonChange={ updateAlignment }\n\t\t\t\tcontrols={ validAlignments }\n\t\t\t/>\n\t\t</BlockControls>\n\t);\n}\n\nexport default {\n\tshareWithChildBlocks: true,\n\tedit: BlockEditAlignmentToolbarControlsPure,\n\tuseBlockProps,\n\taddSaveProps: addAssignedAlign,\n\tattributeKeys: [ 'align' ],\n\thasSupport( name ) {\n\t\treturn hasBlockSupport( name, 'align', false );\n\t},\n};\n\nfunction useBlockProps( { name, align } ) {\n\tconst blockAllowedAlignments = getValidAlignments(\n\t\tgetBlockSupport( name, 'align' ),\n\t\thasBlockSupport( name, 'alignWide', true )\n\t);\n\tconst validAlignments = useAvailableAlignments( blockAllowedAlignments );\n\n\tif ( validAlignments.some( ( alignment ) => alignment.name === align ) ) {\n\t\treturn { 'data-align': align };\n\t}\n\n\treturn {};\n}\n\n/**\n * Override props assigned to save component to inject alignment class name if\n * block supports it.\n *\n * @param {Object} props Additional props applied to save element.\n * @param {Object} blockType Block type.\n * @param {Object} attributes Block attributes.\n *\n * @return {Object} Filtered props applied to save element.\n */\nexport function addAssignedAlign( props, blockType, attributes ) {\n\tconst { align } = attributes;\n\tconst blockAlign = getBlockSupport( blockType, 'align' );\n\tconst hasWideBlockSupport = hasBlockSupport( blockType, 'alignWide', true );\n\n\t// Compute valid alignments without taking into account if\n\t// the theme supports wide alignments or not.\n\t// This way changing themes does not impact the block save.\n\tconst isAlignValid = getValidAlignments(\n\t\tblockAlign,\n\t\thasWideBlockSupport\n\t).includes( align );\n\tif ( isAlignValid ) {\n\t\tprops.className = clsx( `align${ align }`, props.className );\n\t}\n\n\treturn props;\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/editor/align/addAttribute',\n\taddAttribute\n);\n"],"mappings":";;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AASA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,uBAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,iBAAA,GAAAL,OAAA;AAAuE,IAAAM,WAAA,GAAAN,OAAA;AApBvE;AACA;AACA;;AAGA;AACA;AACA;;AAQA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA,GACA,MAAMO,cAAc,GAAG,CAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAE;;AAEpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,eAAe,GAAG,CAAE,MAAM,EAAE,MAAM,CAAE;;AAE1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO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AK,EAAG,EAAEuC,KAAK,CAACE,SAAU,CAAC;EAC7D;EAEA,OAAOF,KAAK;AACb;AAEA,IAAAI,gBAAS,EACR,0BAA0B,EAC1B,gCAAgC,EAChC/C,YACD,CAAC","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- /* wp:polyfill */
2
1
  "use strict";
3
2
 
4
3
  Object.defineProperty(exports, "__esModule", {
@@ -1 +1 @@
1
- {"version":3,"names":["_hooks","require","_blocks","_components","_align","_interopRequireWildcard","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","n","__proto__","a","getOwnPropertyDescriptor","u","i","set","ALIGNMENTS","addFilter","settings","name","WIDE_ALIGNMENTS","excludeBlocks","includes","hasBlockSupport","blockAlign","supports","align","Array","isArray","filter","alignment","values","alignments","alignWide","attributes","type","enum"],"sources":["@wordpress/block-editor/src/hooks/align.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { hasBlockSupport } from '@wordpress/blocks';\nimport { WIDE_ALIGNMENTS } from '@wordpress/components';\n\nconst ALIGNMENTS = [ 'left', 'center', 'right' ];\n\nexport * from './align.js';\nexport { default } from './align.js';\n\n// Used to filter out blocks that don't support wide/full alignment on mobile\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/react-native-editor/align',\n\t( settings, name ) => {\n\t\tif (\n\t\t\tWIDE_ALIGNMENTS.excludeBlocks.includes( name ) &&\n\t\t\thasBlockSupport( settings, 'align' )\n\t\t) {\n\t\t\tconst blockAlign = settings.supports.align;\n\n\t\t\tsettings.supports = {\n\t\t\t\t...settings.supports,\n\t\t\t\talign: Array.isArray( blockAlign )\n\t\t\t\t\t? blockAlign.filter(\n\t\t\t\t\t\t\t( alignment ) =>\n\t\t\t\t\t\t\t\t! Object.values(\n\t\t\t\t\t\t\t\t\tWIDE_ALIGNMENTS.alignments\n\t\t\t\t\t\t\t\t).includes( alignment )\n\t\t\t\t\t )\n\t\t\t\t\t: blockAlign,\n\t\t\t\talignWide: false,\n\t\t\t};\n\t\t\tsettings.attributes = {\n\t\t\t\t...settings.attributes,\n\t\t\t\talign: {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\t// Allow for '' since it is used by the `updateAlignment` function\n\t\t\t\t\t// in toolbar controls for special cases with defined default values.\n\t\t\t\t\tenum: [ ...ALIGNMENTS, '' ],\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\treturn settings;\n\t}\n);\n"],"mappings":";;;;;;;;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAIA,IAAAG,MAAA,GAAAC,uBAAA,CAAAJ,OAAA;AAAAK,MAAA,CAAAC,IAAA,CAAAH,MAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAL,MAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAb,MAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AAA2B,SAAAS,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAd,wBAAAc,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAA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OAAO,CAAEJ,UAAW,CAAC,GAC/BA,UAAU,CAACK,MAAM,CACfC,SAAS,IACV,CAAEzC,MAAM,CAAC0C,MAAM,CACdX,2BAAe,CAACY,UACjB,CAAC,CAACV,QAAQ,CAAEQ,SAAU,CACvB,CAAC,GACDN,UAAU;MACbS,SAAS,EAAE;IACZ,CAAC;IACDf,QAAQ,CAACgB,UAAU,GAAG;MACrB,GAAGhB,QAAQ,CAACgB,UAAU;MACtBR,KAAK,EAAE;QACNS,IAAI,EAAE,QAAQ;QACd;QACA;QACAC,IAAI,EAAE,CAAE,GAAGpB,UAAU,EAAE,EAAE;MAC1B;IACD,CAAC;EACF;EAEA,OAAOE,QAAQ;AAChB,CACD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_hooks","require","_blocks","_components","_align","_interopRequireWildcard","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","n","__proto__","a","getOwnPropertyDescriptor","u","i","set","ALIGNMENTS","addFilter","settings","name","WIDE_ALIGNMENTS","excludeBlocks","includes","hasBlockSupport","blockAlign","supports","align","Array","isArray","filter","alignment","values","alignments","alignWide","attributes","type","enum"],"sources":["@wordpress/block-editor/src/hooks/align.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { hasBlockSupport } from '@wordpress/blocks';\nimport { WIDE_ALIGNMENTS } from '@wordpress/components';\n\nconst ALIGNMENTS = [ 'left', 'center', 'right' ];\n\nexport * from './align.js';\nexport { default } from './align.js';\n\n// Used to filter out blocks that don't support wide/full alignment on mobile\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/react-native-editor/align',\n\t( settings, name ) => {\n\t\tif (\n\t\t\tWIDE_ALIGNMENTS.excludeBlocks.includes( name ) &&\n\t\t\thasBlockSupport( settings, 'align' )\n\t\t) {\n\t\t\tconst blockAlign = settings.supports.align;\n\n\t\t\tsettings.supports = {\n\t\t\t\t...settings.supports,\n\t\t\t\talign: Array.isArray( blockAlign )\n\t\t\t\t\t? blockAlign.filter(\n\t\t\t\t\t\t\t( alignment ) =>\n\t\t\t\t\t\t\t\t! Object.values(\n\t\t\t\t\t\t\t\t\tWIDE_ALIGNMENTS.alignments\n\t\t\t\t\t\t\t\t).includes( alignment )\n\t\t\t\t\t )\n\t\t\t\t\t: blockAlign,\n\t\t\t\talignWide: false,\n\t\t\t};\n\t\t\tsettings.attributes = {\n\t\t\t\t...settings.attributes,\n\t\t\t\talign: {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\t// Allow for '' since it is used by the `updateAlignment` function\n\t\t\t\t\t// in toolbar controls for special cases with defined default values.\n\t\t\t\t\tenum: [ ...ALIGNMENTS, '' ],\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\treturn settings;\n\t}\n);\n"],"mappings":";;;;;;;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAIA,IAAAG,MAAA,GAAAC,uBAAA,CAAAJ,OAAA;AAAAK,MAAA,CAAAC,IAAA,CAAAH,MAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAL,MAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAb,MAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AAA2B,SAAAS,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA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e,EAAEL,QAAQ,EAAE,OAAQ,CAAC,EACnC;IACD,MAAMM,UAAU,GAAGN,QAAQ,CAACO,QAAQ,CAACC,KAAK;IAE1CR,QAAQ,CAACO,QAAQ,GAAG;MACnB,GAAGP,QAAQ,CAACO,QAAQ;MACpBC,KAAK,EAAEC,KAAK,CAACC,OAAO,CAAEJ,UAAW,CAAC,GAC/BA,UAAU,CAACK,MAAM,CACfC,SAAS,IACV,CAAEzC,MAAM,CAAC0C,MAAM,CACdX,2BAAe,CAACY,UACjB,CAAC,CAACV,QAAQ,CAAEQ,SAAU,CACvB,CAAC,GACDN,UAAU;MACbS,SAAS,EAAE;IACZ,CAAC;IACDf,QAAQ,CAACgB,UAAU,GAAG;MACrB,GAAGhB,QAAQ,CAACgB,UAAU;MACtBR,KAAK,EAAE;QACNS,IAAI,EAAE,QAAQ;QACd;QACA;QACAC,IAAI,EAAE,CAAE,GAAGpB,UAAU,EAAE,EAAE;MAC1B;IACD,CAAC;EACF;EAEA,OAAOE,QAAQ;AAChB,CACD,CAAC","ignoreList":[]}
@@ -12,13 +12,6 @@ var _blocks = require("@wordpress/blocks");
12
12
  * WordPress dependencies
13
13
  */
14
14
 
15
- const ARIA_LABEL_SCHEMA = {
16
- type: 'string',
17
- source: 'attribute',
18
- attribute: 'aria-label',
19
- selector: '*'
20
- };
21
-
22
15
  /**
23
16
  * Filters registered block settings, extending attributes with ariaLabel using aria-label
24
17
  * of the first node.
@@ -36,7 +29,9 @@ function addAttribute(settings) {
36
29
  // Gracefully handle if settings.attributes is undefined.
37
30
  settings.attributes = {
38
31
  ...settings.attributes,
39
- ariaLabel: ARIA_LABEL_SCHEMA
32
+ ariaLabel: {
33
+ type: 'string'
34
+ }
40
35
  };
41
36
  }
42
37
  return settings;
@@ -1 +1 @@
1
- {"version":3,"names":["_hooks","require","_blocks","ARIA_LABEL_SCHEMA","type","source","attribute","selector","addAttribute","settings","attributes","ariaLabel","hasBlockSupport","addSaveProps","extraProps","blockType","_default","exports","default","attributeKeys","hasSupport","name","addFilter"],"sources":["@wordpress/block-editor/src/hooks/aria-label.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { hasBlockSupport } from '@wordpress/blocks';\n\nconst ARIA_LABEL_SCHEMA = {\n\ttype: 'string',\n\tsource: 'attribute',\n\tattribute: 'aria-label',\n\tselector: '*',\n};\n\n/**\n * Filters registered block settings, extending attributes with ariaLabel using aria-label\n * of the first node.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nexport function addAttribute( settings ) {\n\t// Allow blocks to specify their own attribute definition with default values if needed.\n\tif ( settings?.attributes?.ariaLabel?.type ) {\n\t\treturn settings;\n\t}\n\tif ( hasBlockSupport( settings, 'ariaLabel' ) ) {\n\t\t// Gracefully handle if settings.attributes is undefined.\n\t\tsettings.attributes = {\n\t\t\t...settings.attributes,\n\t\t\tariaLabel: ARIA_LABEL_SCHEMA,\n\t\t};\n\t}\n\n\treturn settings;\n}\n\n/**\n * Override props assigned to save component to inject aria-label, if block\n * supports ariaLabel. This is only applied if the block's save result is an\n * element and not a markup string.\n *\n * @param {Object} extraProps Additional props applied to save element.\n * @param {Object} blockType Block type.\n * @param {Object} attributes Current block attributes.\n *\n * @return {Object} Filtered props applied to save element.\n */\nexport function addSaveProps( extraProps, blockType, attributes ) {\n\tif ( hasBlockSupport( blockType, 'ariaLabel' ) ) {\n\t\textraProps[ 'aria-label' ] =\n\t\t\tattributes.ariaLabel === '' ? null : attributes.ariaLabel;\n\t}\n\n\treturn extraProps;\n}\n\nexport default {\n\taddSaveProps,\n\tattributeKeys: [ 'ariaLabel' ],\n\thasSupport( name ) {\n\t\treturn hasBlockSupport( name, 'ariaLabel' );\n\t},\n};\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/ariaLabel/attribute',\n\taddAttribute\n);\n"],"mappings":";;;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA,MAAME,iBAAiB,GAAG;EACzBC,IAAI,EAAE,QAAQ;EACdC,MAAM,EAAE,WAAW;EACnBC,SAAS,EAAE,YAAY;EACvBC,QAAQ,EAAE;AACX,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,YAAYA,CAAEC,QAAQ,EAAG;EACxC;EACA,IAAKA,QAAQ,EAAEC,UAAU,EAAEC,SAAS,EAAEP,IAAI,EAAG;IAC5C,OAAOK,QAAQ;EAChB;EACA,IAAK,IAAAG,uBAAe,EAAEH,QAAQ,EAAE,WAAY,CAAC,EAAG;IAC/C;IACAA,QAAQ,CAACC,UAAU,GAAG;MACrB,GAAGD,QAAQ,CAACC,UAAU;MACtBC,SAAS,EAAER;IACZ,CAAC;EACF;EAEA,OAAOM,QAAQ;AAChB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASI,YAAYA,CAAEC,UAAU,EAAEC,SAAS,EAAEL,UAAU,EAAG;EACjE,IAAK,IAAAE,uBAAe,EAAEG,SAAS,EAAE,WAAY,CAAC,EAAG;IAChDD,UAAU,CAAE,YAAY,CAAE,GACzBJ,UAAU,CAACC,SAAS,KAAK,EAAE,GAAG,IAAI,GAAGD,UAAU,CAACC,SAAS;EAC3D;EAEA,OAAOG,UAAU;AAClB;AAAC,IAAAE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc;EACdL,YAAY;EACZM,aAAa,EAAE,CAAE,WAAW,CAAE;EAC9BC,UAAUA,CAAEC,IAAI,EAAG;IAClB,OAAO,IAAAT,uBAAe,EAAES,IAAI,EAAE,WAAY,CAAC;EAC5C;AACD,CAAC;AAED,IAAAC,gBAAS,EACR,0BAA0B,EAC1B,0BAA0B,EAC1Bd,YACD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_hooks","require","_blocks","addAttribute","settings","attributes","ariaLabel","type","hasBlockSupport","addSaveProps","extraProps","blockType","_default","exports","default","attributeKeys","hasSupport","name","addFilter"],"sources":["@wordpress/block-editor/src/hooks/aria-label.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { hasBlockSupport } from '@wordpress/blocks';\n\n/**\n * Filters registered block settings, extending attributes with ariaLabel using aria-label\n * of the first node.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nexport function addAttribute( settings ) {\n\t// Allow blocks to specify their own attribute definition with default values if needed.\n\tif ( settings?.attributes?.ariaLabel?.type ) {\n\t\treturn settings;\n\t}\n\tif ( hasBlockSupport( settings, 'ariaLabel' ) ) {\n\t\t// Gracefully handle if settings.attributes is undefined.\n\t\tsettings.attributes = {\n\t\t\t...settings.attributes,\n\t\t\tariaLabel: {\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t};\n\t}\n\n\treturn settings;\n}\n\n/**\n * Override props assigned to save component to inject aria-label, if block\n * supports ariaLabel. This is only applied if the block's save result is an\n * element and not a markup string.\n *\n * @param {Object} extraProps Additional props applied to save element.\n * @param {Object} blockType Block type.\n * @param {Object} attributes Current block attributes.\n *\n * @return {Object} Filtered props applied to save element.\n */\nexport function addSaveProps( extraProps, blockType, attributes ) {\n\tif ( hasBlockSupport( blockType, 'ariaLabel' ) ) {\n\t\textraProps[ 'aria-label' ] =\n\t\t\tattributes.ariaLabel === '' ? null : attributes.ariaLabel;\n\t}\n\n\treturn extraProps;\n}\n\nexport default {\n\taddSaveProps,\n\tattributeKeys: [ 'ariaLabel' ],\n\thasSupport( name ) {\n\t\treturn hasBlockSupport( name, 'ariaLabel' );\n\t},\n};\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/ariaLabel/attribute',\n\taddAttribute\n);\n"],"mappings":";;;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,YAAYA,CAAEC,QAAQ,EAAG;EACxC;EACA,IAAKA,QAAQ,EAAEC,UAAU,EAAEC,SAAS,EAAEC,IAAI,EAAG;IAC5C,OAAOH,QAAQ;EAChB;EACA,IAAK,IAAAI,uBAAe,EAAEJ,QAAQ,EAAE,WAAY,CAAC,EAAG;IAC/C;IACAA,QAAQ,CAACC,UAAU,GAAG;MACrB,GAAGD,QAAQ,CAACC,UAAU;MACtBC,SAAS,EAAE;QACVC,IAAI,EAAE;MACP;IACD,CAAC;EACF;EAEA,OAAOH,QAAQ;AAChB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASK,YAAYA,CAAEC,UAAU,EAAEC,SAAS,EAAEN,UAAU,EAAG;EACjE,IAAK,IAAAG,uBAAe,EAAEG,SAAS,EAAE,WAAY,CAAC,EAAG;IAChDD,UAAU,CAAE,YAAY,CAAE,GACzBL,UAAU,CAACC,SAAS,KAAK,EAAE,GAAG,IAAI,GAAGD,UAAU,CAACC,SAAS;EAC3D;EAEA,OAAOI,UAAU;AAClB;AAAC,IAAAE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc;EACdL,YAAY;EACZM,aAAa,EAAE,CAAE,WAAW,CAAE;EAC9BC,UAAUA,CAAEC,IAAI,EAAG;IAClB,OAAO,IAAAT,uBAAe,EAAES,IAAI,EAAE,WAAY,CAAC;EAC5C;AACD,CAAC;AAED,IAAAC,gBAAS,EACR,0BAA0B,EAC1B,0BAA0B,EAC1Bf,YACD,CAAC","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- /* wp:polyfill */
2
1
  "use strict";
3
2
 
4
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_blocks","_components","_data","_element","_compose","_blockBindings","_lockUnlock","_inspectorControls","_interopRequireDefault","_blockContext","_blockEdit","_store","_jsxRuntime","Menu","unlock","componentsPrivateApis","EMPTY_OBJECT","useToolsPanelDropdownMenuProps","isMobile","useViewportMatch","popoverProps","placement","offset","BlockBindingsPanelMenuContent","fieldsList","attribute","binding","clientId","useBlockEditContext","registeredSources","getBlockBindingsSources","updateBlockBindings","useBlockBindingsUtils","currentKey","args","key","attributeType","useSelect","select","name","blockName","blockEditorStore","getBlock","_attributeType","getBlockType","attributes","type","jsx","Fragment","children","Object","entries","map","fields","i","jsxs","Group","keys","length","GroupLabel","label","filter","RadioItem","onChange","source","value","checked","ItemLabel","ItemHelpText","Separator","BlockBindingsAttribute","sourceName","sourceProps","getBlockBindingsSource","isSourceInvalid","__experimentalVStack","className","spacing","__experimentalText","truncate","variant","isDestructive","__","ReadOnlyBlockBindingsPanelItems","bindings","__experimentalItem","EditableBlockBindingsPanelItems","__experimentalToolsPanelItem","hasValue","onDeselect","undefined","TriggerButton","render","Popover","gutter","BlockBindingsPanel","metadata","blockContext","useContext","BlockContext","removeAllBlockBindings","bindableAttributes","getBindableAttributes","dropdownMenuProps","_fieldsList","canUpdateBlockBindings","forEach","getFieldsList","usesContext","context","sourceList","values","getSettings","filteredBindings","canBindAttribute","readOnly","default","group","__experimentalToolsPanel","resetAll","__experimentalItemGroup","isBordered","isSeparated","as","exports","_default","edit","attributeKeys","hasSupport"],"sources":["@wordpress/block-editor/src/hooks/block-bindings.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tgetBlockBindingsSource,\n\tgetBlockBindingsSources,\n\tgetBlockType,\n} from '@wordpress/blocks';\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalItem as Item,\n\t__experimentalText as Text,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\t__experimentalVStack as VStack,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { useContext, Fragment } from '@wordpress/element';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport {\n\tcanBindAttribute,\n\tgetBindableAttributes,\n\tuseBlockBindingsUtils,\n} from '../utils/block-bindings';\nimport { unlock } from '../lock-unlock';\nimport InspectorControls from '../components/inspector-controls';\nimport BlockContext from '../components/block-context';\nimport { useBlockEditContext } from '../components/block-edit';\nimport { store as blockEditorStore } from '../store';\n\nconst { Menu } = unlock( componentsPrivateApis );\n\nconst EMPTY_OBJECT = {};\n\nconst useToolsPanelDropdownMenuProps = () => {\n\tconst isMobile = useViewportMatch( 'medium', '<' );\n\treturn ! isMobile\n\t\t? {\n\t\t\t\tpopoverProps: {\n\t\t\t\t\tplacement: 'left-start',\n\t\t\t\t\t// For non-mobile, inner sidebar width (248px) - button width (24px) - border (1px) + padding (16px) + spacing (20px)\n\t\t\t\t\toffset: 259,\n\t\t\t\t},\n\t\t }\n\t\t: {};\n};\n\nfunction BlockBindingsPanelMenuContent( { fieldsList, attribute, binding } ) {\n\tconst { clientId } = useBlockEditContext();\n\tconst registeredSources = getBlockBindingsSources();\n\tconst { updateBlockBindings } = useBlockBindingsUtils();\n\tconst currentKey = binding?.args?.key;\n\tconst attributeType = useSelect(\n\t\t( select ) => {\n\t\t\tconst { name: blockName } =\n\t\t\t\tselect( blockEditorStore ).getBlock( clientId );\n\t\t\tconst _attributeType =\n\t\t\t\tgetBlockType( blockName ).attributes?.[ attribute ]?.type;\n\t\t\treturn _attributeType === 'rich-text' ? 'string' : _attributeType;\n\t\t},\n\t\t[ clientId, attribute ]\n\t);\n\treturn (\n\t\t<>\n\t\t\t{ Object.entries( fieldsList ).map( ( [ name, fields ], i ) => (\n\t\t\t\t<Fragment key={ name }>\n\t\t\t\t\t<Menu.Group>\n\t\t\t\t\t\t{ Object.keys( fieldsList ).length > 1 && (\n\t\t\t\t\t\t\t<Menu.GroupLabel>\n\t\t\t\t\t\t\t\t{ registeredSources[ name ].label }\n\t\t\t\t\t\t\t</Menu.GroupLabel>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ Object.entries( fields )\n\t\t\t\t\t\t\t.filter(\n\t\t\t\t\t\t\t\t( [ , args ] ) => args?.type === attributeType\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t.map( ( [ key, args ] ) => (\n\t\t\t\t\t\t\t\t<Menu.RadioItem\n\t\t\t\t\t\t\t\t\tkey={ key }\n\t\t\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\t\t\tupdateBlockBindings( {\n\t\t\t\t\t\t\t\t\t\t\t[ attribute ]: {\n\t\t\t\t\t\t\t\t\t\t\t\tsource: name,\n\t\t\t\t\t\t\t\t\t\t\t\targs: { key },\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tname={ attribute + '-binding' }\n\t\t\t\t\t\t\t\t\tvalue={ key }\n\t\t\t\t\t\t\t\t\tchecked={ key === currentKey }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Menu.ItemLabel>\n\t\t\t\t\t\t\t\t\t\t{ args?.label }\n\t\t\t\t\t\t\t\t\t</Menu.ItemLabel>\n\t\t\t\t\t\t\t\t\t<Menu.ItemHelpText>\n\t\t\t\t\t\t\t\t\t\t{ args?.value }\n\t\t\t\t\t\t\t\t\t</Menu.ItemHelpText>\n\t\t\t\t\t\t\t\t</Menu.RadioItem>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t</Menu.Group>\n\t\t\t\t\t{ i !== Object.keys( fieldsList ).length - 1 && (\n\t\t\t\t\t\t<Menu.Separator />\n\t\t\t\t\t) }\n\t\t\t\t</Fragment>\n\t\t\t) ) }\n\t\t</>\n\t);\n}\n\nfunction BlockBindingsAttribute( { attribute, binding, fieldsList } ) {\n\tconst { source: sourceName, args } = binding || {};\n\tconst sourceProps = getBlockBindingsSource( sourceName );\n\tconst isSourceInvalid = ! sourceProps;\n\treturn (\n\t\t<VStack className=\"block-editor-bindings__item\" spacing={ 0 }>\n\t\t\t<Text truncate>{ attribute }</Text>\n\t\t\t{ !! binding && (\n\t\t\t\t<Text\n\t\t\t\t\ttruncate\n\t\t\t\t\tvariant={ ! isSourceInvalid && 'muted' }\n\t\t\t\t\tisDestructive={ isSourceInvalid }\n\t\t\t\t>\n\t\t\t\t\t{ isSourceInvalid\n\t\t\t\t\t\t? __( 'Invalid source' )\n\t\t\t\t\t\t: fieldsList?.[ sourceName ]?.[ args?.key ]?.label ||\n\t\t\t\t\t\t sourceProps?.label ||\n\t\t\t\t\t\t sourceName }\n\t\t\t\t</Text>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n\nfunction ReadOnlyBlockBindingsPanelItems( { bindings, fieldsList } ) {\n\treturn (\n\t\t<>\n\t\t\t{ Object.entries( bindings ).map( ( [ attribute, binding ] ) => (\n\t\t\t\t<Item key={ attribute }>\n\t\t\t\t\t<BlockBindingsAttribute\n\t\t\t\t\t\tattribute={ attribute }\n\t\t\t\t\t\tbinding={ binding }\n\t\t\t\t\t\tfieldsList={ fieldsList }\n\t\t\t\t\t/>\n\t\t\t\t</Item>\n\t\t\t) ) }\n\t\t</>\n\t);\n}\n\nfunction EditableBlockBindingsPanelItems( {\n\tattributes,\n\tbindings,\n\tfieldsList,\n} ) {\n\tconst { updateBlockBindings } = useBlockBindingsUtils();\n\tconst isMobile = useViewportMatch( 'medium', '<' );\n\treturn (\n\t\t<>\n\t\t\t{ attributes.map( ( attribute ) => {\n\t\t\t\tconst binding = bindings[ attribute ];\n\t\t\t\treturn (\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tkey={ attribute }\n\t\t\t\t\t\thasValue={ () => !! binding }\n\t\t\t\t\t\tlabel={ attribute }\n\t\t\t\t\t\tonDeselect={ () => {\n\t\t\t\t\t\t\tupdateBlockBindings( {\n\t\t\t\t\t\t\t\t[ attribute ]: undefined,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Menu\n\t\t\t\t\t\t\tplacement={\n\t\t\t\t\t\t\t\tisMobile ? 'bottom-start' : 'left-start'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Menu.TriggerButton render={ <Item /> }>\n\t\t\t\t\t\t\t\t<BlockBindingsAttribute\n\t\t\t\t\t\t\t\t\tattribute={ attribute }\n\t\t\t\t\t\t\t\t\tbinding={ binding }\n\t\t\t\t\t\t\t\t\tfieldsList={ fieldsList }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</Menu.TriggerButton>\n\t\t\t\t\t\t\t<Menu.Popover gutter={ isMobile ? 8 : 36 }>\n\t\t\t\t\t\t\t\t<BlockBindingsPanelMenuContent\n\t\t\t\t\t\t\t\t\tfieldsList={ fieldsList }\n\t\t\t\t\t\t\t\t\tattribute={ attribute }\n\t\t\t\t\t\t\t\t\tbinding={ binding }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</Menu.Popover>\n\t\t\t\t\t\t</Menu>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</>\n\t);\n}\n\nexport const BlockBindingsPanel = ( { name: blockName, metadata } ) => {\n\tconst blockContext = useContext( BlockContext );\n\tconst { removeAllBlockBindings } = useBlockBindingsUtils();\n\tconst bindableAttributes = getBindableAttributes( blockName );\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\t// `useSelect` is used purposely here to ensure `getFieldsList`\n\t// is updated whenever there are updates in block context.\n\t// `source.getFieldsList` may also call a selector via `select`.\n\tconst _fieldsList = {};\n\tconst { fieldsList, canUpdateBlockBindings } = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! bindableAttributes || bindableAttributes.length === 0 ) {\n\t\t\t\treturn EMPTY_OBJECT;\n\t\t\t}\n\t\t\tconst registeredSources = getBlockBindingsSources();\n\t\t\tObject.entries( registeredSources ).forEach(\n\t\t\t\t( [ sourceName, { getFieldsList, usesContext } ] ) => {\n\t\t\t\t\tif ( getFieldsList ) {\n\t\t\t\t\t\t// Populate context.\n\t\t\t\t\t\tconst context = {};\n\t\t\t\t\t\tif ( usesContext?.length ) {\n\t\t\t\t\t\t\tfor ( const key of usesContext ) {\n\t\t\t\t\t\t\t\tcontext[ key ] = blockContext[ key ];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst sourceList = getFieldsList( {\n\t\t\t\t\t\t\tselect,\n\t\t\t\t\t\t\tcontext,\n\t\t\t\t\t\t} );\n\t\t\t\t\t\t// Only add source if the list is not empty.\n\t\t\t\t\t\tif ( Object.keys( sourceList || {} ).length ) {\n\t\t\t\t\t\t\t_fieldsList[ sourceName ] = { ...sourceList };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t\treturn {\n\t\t\t\tfieldsList:\n\t\t\t\t\tObject.values( _fieldsList ).length > 0\n\t\t\t\t\t\t? _fieldsList\n\t\t\t\t\t\t: EMPTY_OBJECT,\n\t\t\t\tcanUpdateBlockBindings:\n\t\t\t\t\tselect( blockEditorStore ).getSettings()\n\t\t\t\t\t\t.canUpdateBlockBindings,\n\t\t\t};\n\t\t},\n\t\t[ blockContext, bindableAttributes ]\n\t);\n\t// Return early if there are no bindable attributes.\n\tif ( ! bindableAttributes || bindableAttributes.length === 0 ) {\n\t\treturn null;\n\t}\n\t// Filter bindings to only show bindable attributes and remove pattern overrides.\n\tconst { bindings } = metadata || {};\n\tconst filteredBindings = { ...bindings };\n\tObject.keys( filteredBindings ).forEach( ( key ) => {\n\t\tif (\n\t\t\t! canBindAttribute( blockName, key ) ||\n\t\t\tfilteredBindings[ key ].source === 'core/pattern-overrides'\n\t\t) {\n\t\t\tdelete filteredBindings[ key ];\n\t\t}\n\t} );\n\n\t// Lock the UI when the user can't update bindings or there are no fields to connect to.\n\tconst readOnly =\n\t\t! canUpdateBlockBindings || ! Object.keys( fieldsList ).length;\n\n\tif ( readOnly && Object.keys( filteredBindings ).length === 0 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<InspectorControls group=\"bindings\">\n\t\t\t<ToolsPanel\n\t\t\t\tlabel={ __( 'Attributes' ) }\n\t\t\t\tresetAll={ () => {\n\t\t\t\t\tremoveAllBlockBindings();\n\t\t\t\t} }\n\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\tclassName=\"block-editor-bindings__panel\"\n\t\t\t>\n\t\t\t\t<ItemGroup isBordered isSeparated>\n\t\t\t\t\t{ readOnly ? (\n\t\t\t\t\t\t<ReadOnlyBlockBindingsPanelItems\n\t\t\t\t\t\t\tbindings={ filteredBindings }\n\t\t\t\t\t\t\tfieldsList={ fieldsList }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<EditableBlockBindingsPanelItems\n\t\t\t\t\t\t\tattributes={ bindableAttributes }\n\t\t\t\t\t\t\tbindings={ filteredBindings }\n\t\t\t\t\t\t\tfieldsList={ fieldsList }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</ItemGroup>\n\t\t\t\t{ /*\n\t\t\t\t\tUse a div element to make the ToolsPanelHiddenInnerWrapper\n\t\t\t\t\ttoggle the visibility of this help text automatically.\n\t\t\t\t*/ }\n\t\t\t\t<Text as=\"div\" variant=\"muted\">\n\t\t\t\t\t<p>\n\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t'Attributes connected to custom fields or other dynamic data.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t</p>\n\t\t\t\t</Text>\n\t\t\t</ToolsPanel>\n\t\t</InspectorControls>\n\t);\n};\n\nexport default {\n\tedit: BlockBindingsPanel,\n\tattributeKeys: [ 'metadata' ],\n\thasSupport() {\n\t\treturn true;\n\t},\n};\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAKA,IAAAE,WAAA,GAAAF,OAAA;AASA,IAAA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AC,8BAA8B;MAAA3B,QAAA,gBAExC,IAAArC,WAAA,CAAAmC,GAAA,EAAC9C,WAAA,CAAAuH,uBAAS;QAACC,UAAU;QAACC,WAAW;QAAAzE,QAAA,EAC9BkE,QAAQ,gBACT,IAAAvG,WAAA,CAAAmC,GAAA,EAACoC,+BAA+B;UAC/BC,QAAQ,EAAG6B,gBAAkB;UAC7BzF,UAAU,EAAGA;QAAY,CACzB,CAAC,gBAEF,IAAAZ,WAAA,CAAAmC,GAAA,EAACuC,+BAA+B;UAC/BzC,UAAU,EAAGwD,kBAAoB;UACjCjB,QAAQ,EAAG6B,gBAAkB;UAC7BzF,UAAU,EAAGA;QAAY,CACzB;MACD,CACS,CAAC,eAKZ,IAAAZ,WAAA,CAAAmC,GAAA,EAAC9C,WAAA,CAAA6E,kBAAI;QAAC6C,EAAE,EAAC,KAAK;QAAC3C,OAAO,EAAC,OAAO;QAAA/B,QAAA,eAC7B,IAAArC,WAAA,CAAAmC,GAAA;UAAAE,QAAA,EACG,IAAAiC,QAAE,EACH,8DACD;QAAC,CACC;MAAC,CACC,CAAC;IAAA,CACI;EAAC,CACK,CAAC;AAEtB,CAAC;AAAC0C,OAAA,CAAA7B,kBAAA,GAAAA,kBAAA;AAAA,IAAA8B,QAAA,GAAAD,OAAA,CAAAR,OAAA,GAEa;EACdU,IAAI,EAAE/B,kBAAkB;EACxBgC,aAAa,EAAE,CAAE,UAAU,CAAE;EAC7BC,UAAUA,CAAA,EAAG;IACZ,OAAO,IAAI;EACZ;AACD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_blocks","_components","_data","_element","_compose","_blockBindings","_lockUnlock","_inspectorControls","_interopRequireDefault","_blockContext","_blockEdit","_store","_jsxRuntime","Menu","unlock","componentsPrivateApis","EMPTY_OBJECT","useToolsPanelDropdownMenuProps","isMobile","useViewportMatch","popoverProps","placement","offset","BlockBindingsPanelMenuContent","fieldsList","attribute","binding","clientId","useBlockEditContext","registeredSources","getBlockBindingsSources","updateBlockBindings","useBlockBindingsUtils","currentKey","args","key","attributeType","useSelect","select","name","blockName","blockEditorStore","getBlock","_attributeType","getBlockType","attributes","type","jsx","Fragment","children","Object","entries","map","fields","i","jsxs","Group","keys","length","GroupLabel","label","filter","RadioItem","onChange","source","value","checked","ItemLabel","ItemHelpText","Separator","BlockBindingsAttribute","sourceName","sourceProps","getBlockBindingsSource","isSourceInvalid","__experimentalVStack","className","spacing","__experimentalText","truncate","variant","isDestructive","__","ReadOnlyBlockBindingsPanelItems","bindings","__experimentalItem","EditableBlockBindingsPanelItems","__experimentalToolsPanelItem","hasValue","onDeselect","undefined","TriggerButton","render","Popover","gutter","BlockBindingsPanel","metadata","blockContext","useContext","BlockContext","removeAllBlockBindings","bindableAttributes","getBindableAttributes","dropdownMenuProps","_fieldsList","canUpdateBlockBindings","forEach","getFieldsList","usesContext","context","sourceList","values","getSettings","filteredBindings","canBindAttribute","readOnly","default","group","__experimentalToolsPanel","resetAll","__experimentalItemGroup","isBordered","isSeparated","as","exports","_default","edit","attributeKeys","hasSupport"],"sources":["@wordpress/block-editor/src/hooks/block-bindings.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tgetBlockBindingsSource,\n\tgetBlockBindingsSources,\n\tgetBlockType,\n} from '@wordpress/blocks';\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalItem as Item,\n\t__experimentalText as Text,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\t__experimentalVStack as VStack,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { useContext, Fragment } from '@wordpress/element';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport {\n\tcanBindAttribute,\n\tgetBindableAttributes,\n\tuseBlockBindingsUtils,\n} from '../utils/block-bindings';\nimport { unlock } from '../lock-unlock';\nimport InspectorControls from '../components/inspector-controls';\nimport BlockContext from '../components/block-context';\nimport { useBlockEditContext } from '../components/block-edit';\nimport { store as blockEditorStore } from '../store';\n\nconst { Menu } = unlock( componentsPrivateApis );\n\nconst EMPTY_OBJECT = {};\n\nconst useToolsPanelDropdownMenuProps = () => {\n\tconst isMobile = useViewportMatch( 'medium', '<' );\n\treturn ! isMobile\n\t\t? {\n\t\t\t\tpopoverProps: {\n\t\t\t\t\tplacement: 'left-start',\n\t\t\t\t\t// For non-mobile, inner sidebar width (248px) - button width (24px) - border (1px) + padding (16px) + spacing (20px)\n\t\t\t\t\toffset: 259,\n\t\t\t\t},\n\t\t }\n\t\t: {};\n};\n\nfunction BlockBindingsPanelMenuContent( { fieldsList, attribute, binding } ) {\n\tconst { clientId } = useBlockEditContext();\n\tconst registeredSources = getBlockBindingsSources();\n\tconst { updateBlockBindings } = useBlockBindingsUtils();\n\tconst currentKey = binding?.args?.key;\n\tconst attributeType = useSelect(\n\t\t( select ) => {\n\t\t\tconst { name: blockName } =\n\t\t\t\tselect( blockEditorStore ).getBlock( clientId );\n\t\t\tconst _attributeType =\n\t\t\t\tgetBlockType( blockName ).attributes?.[ attribute ]?.type;\n\t\t\treturn _attributeType === 'rich-text' ? 'string' : _attributeType;\n\t\t},\n\t\t[ clientId, attribute ]\n\t);\n\treturn (\n\t\t<>\n\t\t\t{ Object.entries( fieldsList ).map( ( [ name, fields ], i ) => (\n\t\t\t\t<Fragment key={ name }>\n\t\t\t\t\t<Menu.Group>\n\t\t\t\t\t\t{ Object.keys( fieldsList ).length > 1 && (\n\t\t\t\t\t\t\t<Menu.GroupLabel>\n\t\t\t\t\t\t\t\t{ registeredSources[ name ].label }\n\t\t\t\t\t\t\t</Menu.GroupLabel>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ Object.entries( fields )\n\t\t\t\t\t\t\t.filter(\n\t\t\t\t\t\t\t\t( [ , args ] ) => args?.type === attributeType\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t.map( ( [ key, args ] ) => (\n\t\t\t\t\t\t\t\t<Menu.RadioItem\n\t\t\t\t\t\t\t\t\tkey={ key }\n\t\t\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\t\t\tupdateBlockBindings( {\n\t\t\t\t\t\t\t\t\t\t\t[ attribute ]: {\n\t\t\t\t\t\t\t\t\t\t\t\tsource: name,\n\t\t\t\t\t\t\t\t\t\t\t\targs: { key },\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tname={ attribute + '-binding' }\n\t\t\t\t\t\t\t\t\tvalue={ key }\n\t\t\t\t\t\t\t\t\tchecked={ key === currentKey }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Menu.ItemLabel>\n\t\t\t\t\t\t\t\t\t\t{ args?.label }\n\t\t\t\t\t\t\t\t\t</Menu.ItemLabel>\n\t\t\t\t\t\t\t\t\t<Menu.ItemHelpText>\n\t\t\t\t\t\t\t\t\t\t{ args?.value }\n\t\t\t\t\t\t\t\t\t</Menu.ItemHelpText>\n\t\t\t\t\t\t\t\t</Menu.RadioItem>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t</Menu.Group>\n\t\t\t\t\t{ i !== Object.keys( fieldsList ).length - 1 && (\n\t\t\t\t\t\t<Menu.Separator />\n\t\t\t\t\t) }\n\t\t\t\t</Fragment>\n\t\t\t) ) }\n\t\t</>\n\t);\n}\n\nfunction BlockBindingsAttribute( { attribute, binding, fieldsList } ) {\n\tconst { source: sourceName, args } = binding || {};\n\tconst sourceProps = getBlockBindingsSource( sourceName );\n\tconst isSourceInvalid = ! sourceProps;\n\treturn (\n\t\t<VStack className=\"block-editor-bindings__item\" spacing={ 0 }>\n\t\t\t<Text truncate>{ attribute }</Text>\n\t\t\t{ !! binding && (\n\t\t\t\t<Text\n\t\t\t\t\ttruncate\n\t\t\t\t\tvariant={ ! isSourceInvalid && 'muted' }\n\t\t\t\t\tisDestructive={ isSourceInvalid }\n\t\t\t\t>\n\t\t\t\t\t{ isSourceInvalid\n\t\t\t\t\t\t? __( 'Invalid source' )\n\t\t\t\t\t\t: fieldsList?.[ sourceName ]?.[ args?.key ]?.label ||\n\t\t\t\t\t\t sourceProps?.label ||\n\t\t\t\t\t\t sourceName }\n\t\t\t\t</Text>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n\nfunction ReadOnlyBlockBindingsPanelItems( { bindings, fieldsList } ) {\n\treturn (\n\t\t<>\n\t\t\t{ Object.entries( bindings ).map( ( [ attribute, binding ] ) => (\n\t\t\t\t<Item key={ attribute }>\n\t\t\t\t\t<BlockBindingsAttribute\n\t\t\t\t\t\tattribute={ attribute }\n\t\t\t\t\t\tbinding={ binding }\n\t\t\t\t\t\tfieldsList={ fieldsList }\n\t\t\t\t\t/>\n\t\t\t\t</Item>\n\t\t\t) ) }\n\t\t</>\n\t);\n}\n\nfunction EditableBlockBindingsPanelItems( {\n\tattributes,\n\tbindings,\n\tfieldsList,\n} ) {\n\tconst { updateBlockBindings } = useBlockBindingsUtils();\n\tconst isMobile = useViewportMatch( 'medium', '<' );\n\treturn (\n\t\t<>\n\t\t\t{ attributes.map( ( attribute ) => {\n\t\t\t\tconst binding = bindings[ attribute ];\n\t\t\t\treturn (\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tkey={ attribute }\n\t\t\t\t\t\thasValue={ () => !! binding }\n\t\t\t\t\t\tlabel={ attribute }\n\t\t\t\t\t\tonDeselect={ () => {\n\t\t\t\t\t\t\tupdateBlockBindings( {\n\t\t\t\t\t\t\t\t[ attribute ]: undefined,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Menu\n\t\t\t\t\t\t\tplacement={\n\t\t\t\t\t\t\t\tisMobile ? 'bottom-start' : 'left-start'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Menu.TriggerButton render={ <Item /> }>\n\t\t\t\t\t\t\t\t<BlockBindingsAttribute\n\t\t\t\t\t\t\t\t\tattribute={ attribute }\n\t\t\t\t\t\t\t\t\tbinding={ binding }\n\t\t\t\t\t\t\t\t\tfieldsList={ fieldsList }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</Menu.TriggerButton>\n\t\t\t\t\t\t\t<Menu.Popover gutter={ isMobile ? 8 : 36 }>\n\t\t\t\t\t\t\t\t<BlockBindingsPanelMenuContent\n\t\t\t\t\t\t\t\t\tfieldsList={ fieldsList }\n\t\t\t\t\t\t\t\t\tattribute={ attribute }\n\t\t\t\t\t\t\t\t\tbinding={ binding }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</Menu.Popover>\n\t\t\t\t\t\t</Menu>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</>\n\t);\n}\n\nexport const BlockBindingsPanel = ( { name: blockName, metadata } ) => {\n\tconst blockContext = useContext( BlockContext );\n\tconst { removeAllBlockBindings } = useBlockBindingsUtils();\n\tconst bindableAttributes = getBindableAttributes( blockName );\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\t// `useSelect` is used purposely here to ensure `getFieldsList`\n\t// is updated whenever there are updates in block context.\n\t// `source.getFieldsList` may also call a selector via `select`.\n\tconst _fieldsList = {};\n\tconst { fieldsList, canUpdateBlockBindings } = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! bindableAttributes || bindableAttributes.length === 0 ) {\n\t\t\t\treturn EMPTY_OBJECT;\n\t\t\t}\n\t\t\tconst registeredSources = getBlockBindingsSources();\n\t\t\tObject.entries( registeredSources ).forEach(\n\t\t\t\t( [ sourceName, { getFieldsList, usesContext } ] ) => {\n\t\t\t\t\tif ( getFieldsList ) {\n\t\t\t\t\t\t// Populate context.\n\t\t\t\t\t\tconst context = {};\n\t\t\t\t\t\tif ( usesContext?.length ) {\n\t\t\t\t\t\t\tfor ( const key of usesContext ) {\n\t\t\t\t\t\t\t\tcontext[ key ] = blockContext[ key ];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst sourceList = getFieldsList( {\n\t\t\t\t\t\t\tselect,\n\t\t\t\t\t\t\tcontext,\n\t\t\t\t\t\t} );\n\t\t\t\t\t\t// Only add source if the list is not empty.\n\t\t\t\t\t\tif ( Object.keys( sourceList || {} ).length ) {\n\t\t\t\t\t\t\t_fieldsList[ sourceName ] = { ...sourceList };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t\treturn {\n\t\t\t\tfieldsList:\n\t\t\t\t\tObject.values( _fieldsList ).length > 0\n\t\t\t\t\t\t? _fieldsList\n\t\t\t\t\t\t: EMPTY_OBJECT,\n\t\t\t\tcanUpdateBlockBindings:\n\t\t\t\t\tselect( blockEditorStore ).getSettings()\n\t\t\t\t\t\t.canUpdateBlockBindings,\n\t\t\t};\n\t\t},\n\t\t[ blockContext, bindableAttributes ]\n\t);\n\t// Return early if there are no bindable attributes.\n\tif ( ! bindableAttributes || bindableAttributes.length === 0 ) {\n\t\treturn null;\n\t}\n\t// Filter bindings to only show bindable attributes and remove pattern overrides.\n\tconst { bindings } = metadata || {};\n\tconst filteredBindings = { ...bindings };\n\tObject.keys( filteredBindings ).forEach( ( key ) => {\n\t\tif (\n\t\t\t! canBindAttribute( blockName, key ) ||\n\t\t\tfilteredBindings[ key ].source === 'core/pattern-overrides'\n\t\t) {\n\t\t\tdelete filteredBindings[ key ];\n\t\t}\n\t} );\n\n\t// Lock the UI when the user can't update bindings or there are no fields to connect to.\n\tconst readOnly =\n\t\t! canUpdateBlockBindings || ! Object.keys( fieldsList ).length;\n\n\tif ( readOnly && Object.keys( filteredBindings ).length === 0 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<InspectorControls group=\"bindings\">\n\t\t\t<ToolsPanel\n\t\t\t\tlabel={ __( 'Attributes' ) }\n\t\t\t\tresetAll={ () => {\n\t\t\t\t\tremoveAllBlockBindings();\n\t\t\t\t} }\n\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\tclassName=\"block-editor-bindings__panel\"\n\t\t\t>\n\t\t\t\t<ItemGroup isBordered isSeparated>\n\t\t\t\t\t{ readOnly ? (\n\t\t\t\t\t\t<ReadOnlyBlockBindingsPanelItems\n\t\t\t\t\t\t\tbindings={ filteredBindings }\n\t\t\t\t\t\t\tfieldsList={ fieldsList }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<EditableBlockBindingsPanelItems\n\t\t\t\t\t\t\tattributes={ bindableAttributes }\n\t\t\t\t\t\t\tbindings={ filteredBindings }\n\t\t\t\t\t\t\tfieldsList={ fieldsList }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</ItemGroup>\n\t\t\t\t{ /*\n\t\t\t\t\tUse a div element to make the ToolsPanelHiddenInnerWrapper\n\t\t\t\t\ttoggle the visibility of this help text automatically.\n\t\t\t\t*/ }\n\t\t\t\t<Text as=\"div\" variant=\"muted\">\n\t\t\t\t\t<p>\n\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t'Attributes connected to custom fields or other dynamic data.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t</p>\n\t\t\t\t</Text>\n\t\t\t</ToolsPanel>\n\t\t</InspectorControls>\n\t);\n};\n\nexport default {\n\tedit: BlockBindingsPanel,\n\tattributeKeys: [ 'metadata' ],\n\thasSupport() {\n\t\treturn true;\n\t},\n};\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAKA,IAAAE,WAAA,GAAAF,OAAA;AASA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAKA,IAAAM,cAAA,GAAAN,OAAA;AA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zE,QAAA,EAC9BkE,QAAQ,gBACT,IAAAvG,WAAA,CAAAmC,GAAA,EAACoC,+BAA+B;UAC/BC,QAAQ,EAAG6B,gBAAkB;UAC7BzF,UAAU,EAAGA;QAAY,CACzB,CAAC,gBAEF,IAAAZ,WAAA,CAAAmC,GAAA,EAACuC,+BAA+B;UAC/BzC,UAAU,EAAGwD,kBAAoB;UACjCjB,QAAQ,EAAG6B,gBAAkB;UAC7BzF,UAAU,EAAGA;QAAY,CACzB;MACD,CACS,CAAC,eAKZ,IAAAZ,WAAA,CAAAmC,GAAA,EAAC9C,WAAA,CAAA6E,kBAAI;QAAC6C,EAAE,EAAC,KAAK;QAAC3C,OAAO,EAAC,OAAO;QAAA/B,QAAA,eAC7B,IAAArC,WAAA,CAAAmC,GAAA;UAAAE,QAAA,EACG,IAAAiC,QAAE,EACH,8DACD;QAAC,CACC;MAAC,CACC,CAAC;IAAA,CACI;EAAC,CACK,CAAC;AAEtB,CAAC;AAAC0C,OAAA,CAAA7B,kBAAA,GAAAA,kBAAA;AAAA,IAAA8B,QAAA,GAAAD,OAAA,CAAAR,OAAA,GAEa;EACdU,IAAI,EAAE/B,kBAAkB;EACxBgC,aAAa,EAAE,CAAE,UAAU,CAAE;EAC7BC,UAAUA,CAAA,EAAG;IACZ,OAAO,IAAI;EACZ;AACD,CAAC","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- /* wp:polyfill */
2
1
  "use strict";
3
2
 
4
3
  Object.defineProperty(exports, "__esModule", {
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_element","_components","_blocks","_data","_components2","_store","_jsxRuntime","EMPTY_OBJECT","BlockHooksControlPure","name","clientId","metadata","ignoredHookedBlocks","blockTypes","useSelect","select","blocksStore","getBlockTypes","hookedBlocksForCurrentBlock","useMemo","filter","blockName","blockHooks","includes","hookedBlockClientIds","getBlocks","getBlockRootClientId","getGlobalBlockCount","blockEditorStore","rootClientId","_hookedBlockClientIds","reduce","clientIds","block","relativePosition","candidates","undefined","hookedBlock","find","candidate","Object","values","length","getBlockIndex","getBlockCount","insertBlock","removeBlock","useDispatch","groupedHookedBlocks","groups","namespace","split","push","insertBlockIntoDesignatedLocation","blockIndex","innerBlocksLength","jsx","InspectorControls","children","jsxs","PanelBody","className","title","__","initialOpen","keys","map","vendor","Fragment","checked","ToggleControl","__nextHasNoMarginBottom","label","onChange","createBlock","_default","exports","default","edit","attributeKeys","hasSupport"],"sources":["@wordpress/block-editor/src/hooks/block-hooks.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Fragment, useMemo } from '@wordpress/element';\nimport { PanelBody, ToggleControl } from '@wordpress/components';\nimport { createBlock, store as blocksStore } from '@wordpress/blocks';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { InspectorControls } from '../components';\nimport { store as blockEditorStore } from '../store';\n\nconst EMPTY_OBJECT = {};\n\nfunction BlockHooksControlPure( {\n\tname,\n\tclientId,\n\tmetadata: { ignoredHookedBlocks = [] } = {},\n} ) {\n\tconst blockTypes = useSelect(\n\t\t( select ) => select( blocksStore ).getBlockTypes(),\n\t\t[]\n\t);\n\n\t// A hooked block added via a filter will not be exposed through a block\n\t// type's `blockHooks` property; however, if the containing layout has been\n\t// modified, it will be present in the anchor block's `ignoredHookedBlocks`\n\t// metadata.\n\tconst hookedBlocksForCurrentBlock = useMemo(\n\t\t() =>\n\t\t\tblockTypes?.filter(\n\t\t\t\t( { name: blockName, blockHooks } ) =>\n\t\t\t\t\t( blockHooks && name in blockHooks ) ||\n\t\t\t\t\tignoredHookedBlocks.includes( blockName )\n\t\t\t),\n\t\t[ blockTypes, name, ignoredHookedBlocks ]\n\t);\n\n\tconst hookedBlockClientIds = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlocks, getBlockRootClientId, getGlobalBlockCount } =\n\t\t\t\tselect( blockEditorStore );\n\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\t\tconst _hookedBlockClientIds = hookedBlocksForCurrentBlock.reduce(\n\t\t\t\t( clientIds, block ) => {\n\t\t\t\t\t// If the block doesn't exist anywhere in the block tree,\n\t\t\t\t\t// we know that we have to set the toggle to disabled.\n\t\t\t\t\tif ( getGlobalBlockCount( block.name ) === 0 ) {\n\t\t\t\t\t\treturn clientIds;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst relativePosition = block?.blockHooks?.[ name ];\n\t\t\t\t\tlet candidates;\n\n\t\t\t\t\tswitch ( relativePosition ) {\n\t\t\t\t\t\tcase 'before':\n\t\t\t\t\t\tcase 'after':\n\t\t\t\t\t\t\t// Any of the current block's siblings (with the right block type) qualifies\n\t\t\t\t\t\t\t// as a hooked block (inserted `before` or `after` the current one), as the block\n\t\t\t\t\t\t\t// might've been automatically inserted and then moved around a bit by the user.\n\t\t\t\t\t\t\tcandidates = getBlocks( rootClientId );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'first_child':\n\t\t\t\t\t\tcase 'last_child':\n\t\t\t\t\t\t\t// Any of the current block's child blocks (with the right block type) qualifies\n\t\t\t\t\t\t\t// as a hooked first or last child block, as the block might've been automatically\n\t\t\t\t\t\t\t// inserted and then moved around a bit by the user.\n\t\t\t\t\t\t\tcandidates = getBlocks( clientId );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase undefined:\n\t\t\t\t\t\t\t// If we haven't found a blockHooks field with a relative position for the hooked\n\t\t\t\t\t\t\t// block, it means that it was added by a filter. In this case, we look for the block\n\t\t\t\t\t\t\t// both among the current block's siblings and its children.\n\t\t\t\t\t\t\tcandidates = [\n\t\t\t\t\t\t\t\t...getBlocks( rootClientId ),\n\t\t\t\t\t\t\t\t...getBlocks( clientId ),\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst hookedBlock = candidates?.find(\n\t\t\t\t\t\t( candidate ) => candidate.name === block.name\n\t\t\t\t\t);\n\n\t\t\t\t\t// If the block exists in the designated location, we consider it hooked\n\t\t\t\t\t// and show the toggle as enabled.\n\t\t\t\t\tif ( hookedBlock ) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t...clientIds,\n\t\t\t\t\t\t\t[ block.name ]: hookedBlock.clientId,\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\n\t\t\t\t\t// If no hooked block was found in any of its designated locations,\n\t\t\t\t\t// we set the toggle to disabled.\n\t\t\t\t\treturn clientIds;\n\t\t\t\t},\n\t\t\t\t{}\n\t\t\t);\n\n\t\t\tif ( Object.values( _hookedBlockClientIds ).length > 0 ) {\n\t\t\t\treturn _hookedBlockClientIds;\n\t\t\t}\n\n\t\t\treturn EMPTY_OBJECT;\n\t\t},\n\t\t[ hookedBlocksForCurrentBlock, name, clientId ]\n\t);\n\n\tconst { getBlockIndex, getBlockCount, getBlockRootClientId } =\n\t\tuseSelect( blockEditorStore );\n\tconst { insertBlock, removeBlock } = useDispatch( blockEditorStore );\n\n\tif ( ! hookedBlocksForCurrentBlock.length ) {\n\t\treturn null;\n\t}\n\n\t// Group by block namespace (i.e. prefix before the slash).\n\tconst groupedHookedBlocks = hookedBlocksForCurrentBlock.reduce(\n\t\t( groups, block ) => {\n\t\t\tconst [ namespace ] = block.name.split( '/' );\n\t\t\tif ( ! groups[ namespace ] ) {\n\t\t\t\tgroups[ namespace ] = [];\n\t\t\t}\n\t\t\tgroups[ namespace ].push( block );\n\t\t\treturn groups;\n\t\t},\n\t\t{}\n\t);\n\n\tconst insertBlockIntoDesignatedLocation = ( block, relativePosition ) => {\n\t\tconst blockIndex = getBlockIndex( clientId );\n\t\tconst innerBlocksLength = getBlockCount( clientId );\n\t\tconst rootClientId = getBlockRootClientId( clientId );\n\n\t\tswitch ( relativePosition ) {\n\t\t\tcase 'before':\n\t\t\tcase 'after':\n\t\t\t\tinsertBlock(\n\t\t\t\t\tblock,\n\t\t\t\t\trelativePosition === 'after' ? blockIndex + 1 : blockIndex,\n\t\t\t\t\trootClientId, // Insert as a child of the current block's parent\n\t\t\t\t\tfalse\n\t\t\t\t);\n\t\t\t\tbreak;\n\n\t\t\tcase 'first_child':\n\t\t\tcase 'last_child':\n\t\t\t\tinsertBlock(\n\t\t\t\t\tblock,\n\t\t\t\t\t// TODO: It'd be great if insertBlock() would accept negative indices for insertion.\n\t\t\t\t\trelativePosition === 'first_child' ? 0 : innerBlocksLength,\n\t\t\t\t\tclientId, // Insert as a child of the current block.\n\t\t\t\t\tfalse\n\t\t\t\t);\n\t\t\t\tbreak;\n\n\t\t\tcase undefined:\n\t\t\t\t// If we do not know the relative position, it is because the block was\n\t\t\t\t// added via a filter. In this case, we default to inserting it after the\n\t\t\t\t// current block.\n\t\t\t\tinsertBlock(\n\t\t\t\t\tblock,\n\t\t\t\t\tblockIndex + 1,\n\t\t\t\t\trootClientId, // Insert as a child of the current block's parent\n\t\t\t\t\tfalse\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t}\n\t};\n\n\treturn (\n\t\t<InspectorControls>\n\t\t\t<PanelBody\n\t\t\t\tclassName=\"block-editor-hooks__block-hooks\"\n\t\t\t\ttitle={ __( 'Plugins' ) }\n\t\t\t\tinitialOpen\n\t\t\t>\n\t\t\t\t<p className=\"block-editor-hooks__block-hooks-helptext\">\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Manage the inclusion of blocks added automatically by plugins.'\n\t\t\t\t\t) }\n\t\t\t\t</p>\n\t\t\t\t{ Object.keys( groupedHookedBlocks ).map( ( vendor ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Fragment key={ vendor }>\n\t\t\t\t\t\t\t<h3>{ vendor }</h3>\n\t\t\t\t\t\t\t{ groupedHookedBlocks[ vendor ].map( ( block ) => {\n\t\t\t\t\t\t\t\tconst checked =\n\t\t\t\t\t\t\t\t\tblock.name in hookedBlockClientIds;\n\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\t\tchecked={ checked }\n\t\t\t\t\t\t\t\t\t\tkey={ block.title }\n\t\t\t\t\t\t\t\t\t\tlabel={ block.title }\n\t\t\t\t\t\t\t\t\t\tonChange={ () => {\n\t\t\t\t\t\t\t\t\t\t\tif ( ! checked ) {\n\t\t\t\t\t\t\t\t\t\t\t\t// Create and insert block.\n\t\t\t\t\t\t\t\t\t\t\t\tconst relativePosition =\n\t\t\t\t\t\t\t\t\t\t\t\t\tblock.blockHooks[ name ];\n\t\t\t\t\t\t\t\t\t\t\t\tinsertBlockIntoDesignatedLocation(\n\t\t\t\t\t\t\t\t\t\t\t\t\tcreateBlock( block.name ),\n\t\t\t\t\t\t\t\t\t\t\t\t\trelativePosition\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t// Remove block.\n\t\t\t\t\t\t\t\t\t\t\tremoveBlock(\n\t\t\t\t\t\t\t\t\t\t\t\thookedBlockClientIds[\n\t\t\t\t\t\t\t\t\t\t\t\t\tblock.name\n\t\t\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</PanelBody>\n\t\t</InspectorControls>\n\t);\n}\n\nexport default {\n\tedit: BlockHooksControlPure,\n\tattributeKeys: [ 'metadata' ],\n\thasSupport() {\n\t\treturn true;\n\t},\n};\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAA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K,MAmCN,CAAC;MAEb,CAAE,CAAC;IAAA,CACO;EAAC,CACM,CAAC;AAEtB;AAAC,IAAAQ,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc;EACdC,IAAI,EAAEtE,qBAAqB;EAC3BuE,aAAa,EAAE,CAAE,UAAU,CAAE;EAC7BC,UAAUA,CAAA,EAAG;IACZ,OAAO,IAAI;EACZ;AACD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_element","_components","_blocks","_data","_components2","_store","_jsxRuntime","EMPTY_OBJECT","BlockHooksControlPure","name","clientId","metadata","ignoredHookedBlocks","blockTypes","useSelect","select","blocksStore","getBlockTypes","hookedBlocksForCurrentBlock","useMemo","filter","blockName","blockHooks","includes","hookedBlockClientIds","getBlocks","getBlockRootClientId","getGlobalBlockCount","blockEditorStore","rootClientId","_hookedBlockClientIds","reduce","clientIds","block","relativePosition","candidates","undefined","hookedBlock","find","candidate","Object","values","length","getBlockIndex","getBlockCount","insertBlock","removeBlock","useDispatch","groupedHookedBlocks","groups","namespace","split","push","insertBlockIntoDesignatedLocation","blockIndex","innerBlocksLength","jsx","InspectorControls","children","jsxs","PanelBody","className","title","__","initialOpen","keys","map","vendor","Fragment","checked","ToggleControl","__nextHasNoMarginBottom","label","onChange","createBlock","_default","exports","default","edit","attributeKeys","hasSupport"],"sources":["@wordpress/block-editor/src/hooks/block-hooks.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Fragment, useMemo } from '@wordpress/element';\nimport { PanelBody, ToggleControl } from '@wordpress/components';\nimport { createBlock, store as blocksStore } from '@wordpress/blocks';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { InspectorControls } from '../components';\nimport { store as blockEditorStore } from '../store';\n\nconst EMPTY_OBJECT = {};\n\nfunction BlockHooksControlPure( {\n\tname,\n\tclientId,\n\tmetadata: { ignoredHookedBlocks = [] } = {},\n} ) {\n\tconst blockTypes = useSelect(\n\t\t( select ) => select( blocksStore ).getBlockTypes(),\n\t\t[]\n\t);\n\n\t// A hooked block added via a filter will not be exposed through a block\n\t// type's `blockHooks` property; however, if the containing layout has been\n\t// modified, it will be present in the anchor block's `ignoredHookedBlocks`\n\t// metadata.\n\tconst hookedBlocksForCurrentBlock = useMemo(\n\t\t() =>\n\t\t\tblockTypes?.filter(\n\t\t\t\t( { name: blockName, blockHooks } ) =>\n\t\t\t\t\t( blockHooks && name in blockHooks ) ||\n\t\t\t\t\tignoredHookedBlocks.includes( blockName )\n\t\t\t),\n\t\t[ blockTypes, name, ignoredHookedBlocks ]\n\t);\n\n\tconst hookedBlockClientIds = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlocks, getBlockRootClientId, getGlobalBlockCount } =\n\t\t\t\tselect( blockEditorStore );\n\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\t\tconst _hookedBlockClientIds = hookedBlocksForCurrentBlock.reduce(\n\t\t\t\t( clientIds, block ) => {\n\t\t\t\t\t// If the block doesn't exist anywhere in the block tree,\n\t\t\t\t\t// we know that we have to set the toggle to disabled.\n\t\t\t\t\tif ( getGlobalBlockCount( block.name ) === 0 ) {\n\t\t\t\t\t\treturn clientIds;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst relativePosition = block?.blockHooks?.[ name ];\n\t\t\t\t\tlet candidates;\n\n\t\t\t\t\tswitch ( relativePosition ) {\n\t\t\t\t\t\tcase 'before':\n\t\t\t\t\t\tcase 'after':\n\t\t\t\t\t\t\t// Any of the current block's siblings (with the right block type) qualifies\n\t\t\t\t\t\t\t// as a hooked block (inserted `before` or `after` the current one), as the block\n\t\t\t\t\t\t\t// might've been automatically inserted and then moved around a bit by the user.\n\t\t\t\t\t\t\tcandidates = getBlocks( rootClientId );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'first_child':\n\t\t\t\t\t\tcase 'last_child':\n\t\t\t\t\t\t\t// Any of the current block's child blocks (with the right block type) qualifies\n\t\t\t\t\t\t\t// as a hooked first or last child block, as the block might've been automatically\n\t\t\t\t\t\t\t// inserted and then moved around a bit by the user.\n\t\t\t\t\t\t\tcandidates = getBlocks( clientId );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase undefined:\n\t\t\t\t\t\t\t// If we haven't found a blockHooks field with a relative position for the hooked\n\t\t\t\t\t\t\t// block, it means that it was added by a filter. In this case, we look for the block\n\t\t\t\t\t\t\t// both among the current block's siblings and its children.\n\t\t\t\t\t\t\tcandidates = [\n\t\t\t\t\t\t\t\t...getBlocks( rootClientId ),\n\t\t\t\t\t\t\t\t...getBlocks( clientId ),\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst hookedBlock = candidates?.find(\n\t\t\t\t\t\t( candidate ) => candidate.name === block.name\n\t\t\t\t\t);\n\n\t\t\t\t\t// If the block exists in the designated location, we consider it hooked\n\t\t\t\t\t// and show the toggle as enabled.\n\t\t\t\t\tif ( hookedBlock ) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t...clientIds,\n\t\t\t\t\t\t\t[ block.name ]: hookedBlock.clientId,\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\n\t\t\t\t\t// If no hooked block was found in any of its designated locations,\n\t\t\t\t\t// we set the toggle to disabled.\n\t\t\t\t\treturn clientIds;\n\t\t\t\t},\n\t\t\t\t{}\n\t\t\t);\n\n\t\t\tif ( Object.values( _hookedBlockClientIds ).length > 0 ) {\n\t\t\t\treturn _hookedBlockClientIds;\n\t\t\t}\n\n\t\t\treturn EMPTY_OBJECT;\n\t\t},\n\t\t[ hookedBlocksForCurrentBlock, name, clientId ]\n\t);\n\n\tconst { getBlockIndex, getBlockCount, getBlockRootClientId } =\n\t\tuseSelect( blockEditorStore );\n\tconst { insertBlock, removeBlock } = useDispatch( blockEditorStore );\n\n\tif ( ! hookedBlocksForCurrentBlock.length ) {\n\t\treturn null;\n\t}\n\n\t// Group by block namespace (i.e. prefix before the slash).\n\tconst groupedHookedBlocks = hookedBlocksForCurrentBlock.reduce(\n\t\t( groups, block ) => {\n\t\t\tconst [ namespace ] = block.name.split( '/' );\n\t\t\tif ( ! groups[ namespace ] ) {\n\t\t\t\tgroups[ namespace ] = [];\n\t\t\t}\n\t\t\tgroups[ namespace ].push( block );\n\t\t\treturn groups;\n\t\t},\n\t\t{}\n\t);\n\n\tconst insertBlockIntoDesignatedLocation = ( block, relativePosition ) => {\n\t\tconst blockIndex = getBlockIndex( clientId );\n\t\tconst innerBlocksLength = getBlockCount( clientId );\n\t\tconst rootClientId = getBlockRootClientId( clientId );\n\n\t\tswitch ( relativePosition ) {\n\t\t\tcase 'before':\n\t\t\tcase 'after':\n\t\t\t\tinsertBlock(\n\t\t\t\t\tblock,\n\t\t\t\t\trelativePosition === 'after' ? blockIndex + 1 : blockIndex,\n\t\t\t\t\trootClientId, // Insert as a child of the current block's parent\n\t\t\t\t\tfalse\n\t\t\t\t);\n\t\t\t\tbreak;\n\n\t\t\tcase 'first_child':\n\t\t\tcase 'last_child':\n\t\t\t\tinsertBlock(\n\t\t\t\t\tblock,\n\t\t\t\t\t// TODO: It'd be great if insertBlock() would accept negative indices for insertion.\n\t\t\t\t\trelativePosition === 'first_child' ? 0 : innerBlocksLength,\n\t\t\t\t\tclientId, // Insert as a child of the current block.\n\t\t\t\t\tfalse\n\t\t\t\t);\n\t\t\t\tbreak;\n\n\t\t\tcase undefined:\n\t\t\t\t// If we do not know the relative position, it is because the block was\n\t\t\t\t// added via a filter. In this case, we default to inserting it after the\n\t\t\t\t// current block.\n\t\t\t\tinsertBlock(\n\t\t\t\t\tblock,\n\t\t\t\t\tblockIndex + 1,\n\t\t\t\t\trootClientId, // Insert as a child of the current block's parent\n\t\t\t\t\tfalse\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t}\n\t};\n\n\treturn (\n\t\t<InspectorControls>\n\t\t\t<PanelBody\n\t\t\t\tclassName=\"block-editor-hooks__block-hooks\"\n\t\t\t\ttitle={ __( 'Plugins' ) }\n\t\t\t\tinitialOpen\n\t\t\t>\n\t\t\t\t<p className=\"block-editor-hooks__block-hooks-helptext\">\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Manage the inclusion of blocks added automatically by plugins.'\n\t\t\t\t\t) }\n\t\t\t\t</p>\n\t\t\t\t{ Object.keys( groupedHookedBlocks ).map( ( vendor ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Fragment key={ vendor }>\n\t\t\t\t\t\t\t<h3>{ vendor }</h3>\n\t\t\t\t\t\t\t{ groupedHookedBlocks[ vendor ].map( ( block ) => {\n\t\t\t\t\t\t\t\tconst checked =\n\t\t\t\t\t\t\t\t\tblock.name in hookedBlockClientIds;\n\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\t\tchecked={ checked }\n\t\t\t\t\t\t\t\t\t\tkey={ block.title }\n\t\t\t\t\t\t\t\t\t\tlabel={ block.title }\n\t\t\t\t\t\t\t\t\t\tonChange={ () => {\n\t\t\t\t\t\t\t\t\t\t\tif ( ! checked ) {\n\t\t\t\t\t\t\t\t\t\t\t\t// Create and insert block.\n\t\t\t\t\t\t\t\t\t\t\t\tconst relativePosition =\n\t\t\t\t\t\t\t\t\t\t\t\t\tblock.blockHooks[ name ];\n\t\t\t\t\t\t\t\t\t\t\t\tinsertBlockIntoDesignatedLocation(\n\t\t\t\t\t\t\t\t\t\t\t\t\tcreateBlock( block.name ),\n\t\t\t\t\t\t\t\t\t\t\t\t\trelativePosition\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t// Remove block.\n\t\t\t\t\t\t\t\t\t\t\tremoveBlock(\n\t\t\t\t\t\t\t\t\t\t\t\thookedBlockClientIds[\n\t\t\t\t\t\t\t\t\t\t\t\t\tblock.name\n\t\t\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</PanelBody>\n\t\t</InspectorControls>\n\t);\n}\n\nexport default {\n\tedit: BlockHooksControlPure,\n\tattributeKeys: [ 'metadata' ],\n\thasSupport() {\n\t\treturn true;\n\t},\n};\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAKA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAAqD,IAAAO,WAAA,GAAAP,OAAA;AAbrD;AACA;AACA;;AAOA;AACA;AACA;;AAIA,MAAMQ,YAAY,GAAG,CAAC,CAAC;AAEvB,SAASC,qBAAqBA,CAAE;EAC/BC,IAAI;EACJC,QAAQ;EACRC,QAAQ,EAAE;IAAEC,mBAAmB,GAAG;EAAG,CAAC,GAAG,CAAC;AAC3C,CAAC,EAAG;EACH,MAAMC,UAAU,GAAG,IAAAC,eAAS,EACzBC,MAAM,IAAMA,MAAM,CAAEC,aAAY,CAAC,CAACC,aAAa,CAAC,CAAC,EACnD,EACD,CAAC;;EAED;EACA;EACA;EACA;EACA,MAAMC,2BAA2B,GAAG,IAAAC,gBAAO,EAC1C,MACCN,UAAU,EAAEO,MAAM,CACjB,CAAE;IAAEX,IAAI,EAAEY,SAAS;IAAEC;EAAW,CAAC,KAC9BA,UAAU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