@wordpress/block-editor 14.8.0 → 14.8.1-next.a9f418477.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 (290) hide show
  1. package/build/autocompleters/block.js +2 -4
  2. package/build/autocompleters/block.js.map +1 -1
  3. package/build/autocompleters/link.js +2 -4
  4. package/build/autocompleters/link.js.map +1 -1
  5. package/build/components/block-canvas/index.js +3 -6
  6. package/build/components/block-canvas/index.js.map +1 -1
  7. package/build/components/block-list/block.js +6 -5
  8. package/build/components/block-list/block.js.map +1 -1
  9. package/build/components/block-list/index.js +0 -1
  10. package/build/components/block-list/index.js.map +1 -1
  11. package/build/components/block-list/use-block-props/index.js +6 -2
  12. package/build/components/block-list/use-block-props/index.js.map +1 -1
  13. package/build/components/block-list/use-block-props/use-firefox-draggable-compatibility.js +87 -0
  14. package/build/components/block-list/use-block-props/use-firefox-draggable-compatibility.js.map +1 -0
  15. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js +98 -5
  16. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  17. package/build/components/block-lock/modal.js +4 -4
  18. package/build/components/block-lock/modal.js.map +1 -1
  19. package/build/components/block-parent-selector/index.js +2 -15
  20. package/build/components/block-parent-selector/index.js.map +1 -1
  21. package/build/components/block-patterns-list/index.js +13 -4
  22. package/build/components/block-patterns-list/index.js.map +1 -1
  23. package/build/components/block-popover/inbetween.js +4 -0
  24. package/build/components/block-popover/inbetween.js.map +1 -1
  25. package/build/components/block-settings-menu/block-settings-dropdown.js +7 -4
  26. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  27. package/build/components/block-settings-menu-controls/index.js +1 -1
  28. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  29. package/build/components/block-switcher/index.js +12 -22
  30. package/build/components/block-switcher/index.js.map +1 -1
  31. package/build/components/block-switcher/use-transformed-patterns.js +0 -1
  32. package/build/components/block-switcher/use-transformed-patterns.js.map +1 -1
  33. package/build/components/block-switcher/utils.js +0 -1
  34. package/build/components/block-switcher/utils.js.map +1 -1
  35. package/build/components/block-toolbar/index.js +7 -6
  36. package/build/components/block-toolbar/index.js.map +1 -1
  37. package/build/components/block-variation-transforms/index.js +0 -1
  38. package/build/components/block-variation-transforms/index.js.map +1 -1
  39. package/build/components/date-format-picker/index.js +0 -1
  40. package/build/components/date-format-picker/index.js.map +1 -1
  41. package/build/components/font-appearance-control/index.js +1 -0
  42. package/build/components/font-appearance-control/index.js.map +1 -1
  43. package/build/components/font-family/index.js +10 -0
  44. package/build/components/font-family/index.js.map +1 -1
  45. package/build/components/global-styles/dimensions-panel.js +17 -16
  46. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  47. package/build/components/global-styles/get-global-styles-changes.js +0 -1
  48. package/build/components/global-styles/get-global-styles-changes.js.map +1 -1
  49. package/build/components/iframe/use-scale-canvas.js +68 -47
  50. package/build/components/iframe/use-scale-canvas.js.map +1 -1
  51. package/build/components/inserter/block-patterns-tab/index.js +0 -10
  52. package/build/components/inserter/block-patterns-tab/index.js.map +1 -1
  53. package/build/components/inserter/menu.js +2 -1
  54. package/build/components/inserter/menu.js.map +1 -1
  55. package/build/components/inserter-draggable-blocks/index.js +19 -10
  56. package/build/components/inserter-draggable-blocks/index.js.map +1 -1
  57. package/build/components/inspector-controls/slot.js +2 -13
  58. package/build/components/inspector-controls/slot.js.map +1 -1
  59. package/build/components/letter-spacing-control/index.js +10 -0
  60. package/build/components/letter-spacing-control/index.js.map +1 -1
  61. package/build/components/line-height-control/index.js +1 -0
  62. package/build/components/line-height-control/index.js.map +1 -1
  63. package/build/components/media-placeholder/index.js +18 -18
  64. package/build/components/media-placeholder/index.js.map +1 -1
  65. package/build/components/multi-selection-inspector/index.js +9 -25
  66. package/build/components/multi-selection-inspector/index.js.map +1 -1
  67. package/build/components/observe-typing/index.js +0 -1
  68. package/build/components/observe-typing/index.js.map +1 -1
  69. package/build/components/recursion-provider/index.js +0 -1
  70. package/build/components/recursion-provider/index.js.map +1 -1
  71. package/build/components/rich-text/index.js +5 -1
  72. package/build/components/rich-text/index.js.map +1 -1
  73. package/build/components/rich-text/native/use-format-types.js +0 -1
  74. package/build/components/rich-text/native/use-format-types.js.map +1 -1
  75. package/build/components/rich-text/use-format-types.js +0 -1
  76. package/build/components/rich-text/use-format-types.js.map +1 -1
  77. package/build/components/spacing-sizes-control/utils.js +0 -1
  78. package/build/components/spacing-sizes-control/utils.js.map +1 -1
  79. package/build/components/typewriter/index.js +0 -1
  80. package/build/components/typewriter/index.js.map +1 -1
  81. package/build/components/use-block-drop-zone/index.js +11 -2
  82. package/build/components/use-block-drop-zone/index.js.map +1 -1
  83. package/build/components/use-moving-animation/index.js +15 -2
  84. package/build/components/use-moving-animation/index.js.map +1 -1
  85. package/build/components/use-resize-canvas/index.js +1 -1
  86. package/build/components/use-resize-canvas/index.js.map +1 -1
  87. package/build/components/warning/index.js +2 -3
  88. package/build/components/warning/index.js.map +1 -1
  89. package/build/components/writing-flow/use-drag-selection.js +11 -0
  90. package/build/components/writing-flow/use-drag-selection.js.map +1 -1
  91. package/build/components/writing-flow/use-tab-nav.js +6 -2
  92. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  93. package/build/hooks/block-bindings.js +4 -3
  94. package/build/hooks/block-bindings.js.map +1 -1
  95. package/build/hooks/gap.js +1 -1
  96. package/build/hooks/gap.js.map +1 -1
  97. package/build/hooks/generated-class-name.js +0 -1
  98. package/build/hooks/generated-class-name.js.map +1 -1
  99. package/build/hooks/use-zoom-out.js +47 -14
  100. package/build/hooks/use-zoom-out.js.map +1 -1
  101. package/build/store/private-selectors.js +1 -7
  102. package/build/store/private-selectors.js.map +1 -1
  103. package/build/store/reducer.js +478 -2
  104. package/build/store/reducer.js.map +1 -1
  105. package/build/store/selectors.js +12 -55
  106. package/build/store/selectors.js.map +1 -1
  107. package/build/utils/object.js +0 -1
  108. package/build/utils/object.js.map +1 -1
  109. package/build-module/autocompleters/block.js +2 -4
  110. package/build-module/autocompleters/block.js.map +1 -1
  111. package/build-module/autocompleters/link.js +2 -4
  112. package/build-module/autocompleters/link.js.map +1 -1
  113. package/build-module/components/block-canvas/index.js +3 -6
  114. package/build-module/components/block-canvas/index.js.map +1 -1
  115. package/build-module/components/block-list/block.js +8 -7
  116. package/build-module/components/block-list/block.js.map +1 -1
  117. package/build-module/components/block-list/index.js +0 -1
  118. package/build-module/components/block-list/index.js.map +1 -1
  119. package/build-module/components/block-list/use-block-props/index.js +6 -2
  120. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  121. package/build-module/components/block-list/use-block-props/use-firefox-draggable-compatibility.js +80 -0
  122. package/build-module/components/block-list/use-block-props/use-firefox-draggable-compatibility.js.map +1 -0
  123. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js +97 -5
  124. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  125. package/build-module/components/block-lock/modal.js +4 -4
  126. package/build-module/components/block-lock/modal.js.map +1 -1
  127. package/build-module/components/block-parent-selector/index.js +2 -15
  128. package/build-module/components/block-parent-selector/index.js.map +1 -1
  129. package/build-module/components/block-patterns-list/index.js +13 -4
  130. package/build-module/components/block-patterns-list/index.js.map +1 -1
  131. package/build-module/components/block-popover/inbetween.js +4 -0
  132. package/build-module/components/block-popover/inbetween.js.map +1 -1
  133. package/build-module/components/block-settings-menu/block-settings-dropdown.js +7 -4
  134. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  135. package/build-module/components/block-settings-menu-controls/index.js +1 -1
  136. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  137. package/build-module/components/block-switcher/index.js +13 -23
  138. package/build-module/components/block-switcher/index.js.map +1 -1
  139. package/build-module/components/block-switcher/use-transformed-patterns.js +0 -1
  140. package/build-module/components/block-switcher/use-transformed-patterns.js.map +1 -1
  141. package/build-module/components/block-switcher/utils.js +0 -1
  142. package/build-module/components/block-switcher/utils.js.map +1 -1
  143. package/build-module/components/block-toolbar/index.js +7 -6
  144. package/build-module/components/block-toolbar/index.js.map +1 -1
  145. package/build-module/components/block-variation-transforms/index.js +0 -1
  146. package/build-module/components/block-variation-transforms/index.js.map +1 -1
  147. package/build-module/components/date-format-picker/index.js +0 -1
  148. package/build-module/components/date-format-picker/index.js.map +1 -1
  149. package/build-module/components/font-appearance-control/index.js +1 -0
  150. package/build-module/components/font-appearance-control/index.js.map +1 -1
  151. package/build-module/components/font-family/index.js +10 -0
  152. package/build-module/components/font-family/index.js.map +1 -1
  153. package/build-module/components/global-styles/dimensions-panel.js +17 -16
  154. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  155. package/build-module/components/global-styles/get-global-styles-changes.js +0 -1
  156. package/build-module/components/global-styles/get-global-styles-changes.js.map +1 -1
  157. package/build-module/components/iframe/use-scale-canvas.js +68 -47
  158. package/build-module/components/iframe/use-scale-canvas.js.map +1 -1
  159. package/build-module/components/inserter/block-patterns-tab/index.js +1 -11
  160. package/build-module/components/inserter/block-patterns-tab/index.js.map +1 -1
  161. package/build-module/components/inserter/menu.js +2 -1
  162. package/build-module/components/inserter/menu.js.map +1 -1
  163. package/build-module/components/inserter-draggable-blocks/index.js +20 -11
  164. package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
  165. package/build-module/components/inspector-controls/slot.js +3 -14
  166. package/build-module/components/inspector-controls/slot.js.map +1 -1
  167. package/build-module/components/letter-spacing-control/index.js +9 -0
  168. package/build-module/components/letter-spacing-control/index.js.map +1 -1
  169. package/build-module/components/line-height-control/index.js +1 -0
  170. package/build-module/components/line-height-control/index.js.map +1 -1
  171. package/build-module/components/media-placeholder/index.js +18 -18
  172. package/build-module/components/media-placeholder/index.js.map +1 -1
  173. package/build-module/components/multi-selection-inspector/index.js +9 -25
  174. package/build-module/components/multi-selection-inspector/index.js.map +1 -1
  175. package/build-module/components/observe-typing/index.js +0 -1
  176. package/build-module/components/observe-typing/index.js.map +1 -1
  177. package/build-module/components/recursion-provider/index.js +0 -1
  178. package/build-module/components/recursion-provider/index.js.map +1 -1
  179. package/build-module/components/rich-text/index.js +5 -1
  180. package/build-module/components/rich-text/index.js.map +1 -1
  181. package/build-module/components/rich-text/native/use-format-types.js +0 -1
  182. package/build-module/components/rich-text/native/use-format-types.js.map +1 -1
  183. package/build-module/components/rich-text/use-format-types.js +0 -1
  184. package/build-module/components/rich-text/use-format-types.js.map +1 -1
  185. package/build-module/components/spacing-sizes-control/utils.js +0 -1
  186. package/build-module/components/spacing-sizes-control/utils.js.map +1 -1
  187. package/build-module/components/typewriter/index.js +0 -1
  188. package/build-module/components/typewriter/index.js.map +1 -1
  189. package/build-module/components/use-block-drop-zone/index.js +11 -2
  190. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  191. package/build-module/components/use-moving-animation/index.js +15 -2
  192. package/build-module/components/use-moving-animation/index.js.map +1 -1
  193. package/build-module/components/use-resize-canvas/index.js +1 -1
  194. package/build-module/components/use-resize-canvas/index.js.map +1 -1
  195. package/build-module/components/warning/index.js +2 -3
  196. package/build-module/components/warning/index.js.map +1 -1
  197. package/build-module/components/writing-flow/use-drag-selection.js +11 -0
  198. package/build-module/components/writing-flow/use-drag-selection.js.map +1 -1
  199. package/build-module/components/writing-flow/use-tab-nav.js +6 -2
  200. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  201. package/build-module/hooks/block-bindings.js +4 -3
  202. package/build-module/hooks/block-bindings.js.map +1 -1
  203. package/build-module/hooks/gap.js +1 -1
  204. package/build-module/hooks/gap.js.map +1 -1
  205. package/build-module/hooks/generated-class-name.js +0 -1
  206. package/build-module/hooks/generated-class-name.js.map +1 -1
  207. package/build-module/hooks/use-zoom-out.js +48 -15
  208. package/build-module/hooks/use-zoom-out.js.map +1 -1
  209. package/build-module/store/private-selectors.js +1 -6
  210. package/build-module/store/private-selectors.js.map +1 -1
  211. package/build-module/store/reducer.js +479 -3
  212. package/build-module/store/reducer.js.map +1 -1
  213. package/build-module/store/selectors.js +12 -55
  214. package/build-module/store/selectors.js.map +1 -1
  215. package/build-module/utils/object.js +0 -1
  216. package/build-module/utils/object.js.map +1 -1
  217. package/build-style/content-rtl.css +18 -5
  218. package/build-style/content.css +18 -5
  219. package/build-style/style-rtl.css +25 -64
  220. package/build-style/style.css +25 -64
  221. package/package.json +32 -32
  222. package/src/autocompleters/block.js +2 -4
  223. package/src/autocompleters/link.js +2 -4
  224. package/src/components/alignment-control/stories/aliginment-toolbar.story.js +47 -0
  225. package/src/components/alignment-control/stories/index.story.js +51 -0
  226. package/src/components/alignment-control/test/__snapshots__/index.js.snap +5 -5
  227. package/src/components/block-alignment-control/test/__snapshots__/index.js.snap +4 -4
  228. package/src/components/block-canvas/index.js +3 -5
  229. package/src/components/block-draggable/content.scss +11 -5
  230. package/src/components/block-list/block.js +7 -13
  231. package/src/components/block-list/content.scss +6 -0
  232. package/src/components/block-list/use-block-props/index.js +5 -0
  233. package/src/components/block-list/use-block-props/use-firefox-draggable-compatibility.js +83 -0
  234. package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +112 -8
  235. package/src/components/block-lock/modal.js +4 -6
  236. package/src/components/block-parent-selector/index.js +1 -19
  237. package/src/components/block-patterns-list/index.js +12 -1
  238. package/src/components/block-patterns-list/stories/fixtures.js +1 -0
  239. package/src/components/block-patterns-list/style.scss +16 -5
  240. package/src/components/block-popover/inbetween.js +4 -0
  241. package/src/components/block-settings-menu/block-settings-dropdown.js +6 -1
  242. package/src/components/block-settings-menu-controls/index.js +2 -1
  243. package/src/components/block-switcher/index.js +19 -21
  244. package/src/components/block-switcher/style.scss +0 -9
  245. package/src/components/block-title/test/index.js +2 -0
  246. package/src/components/block-toolbar/index.js +9 -6
  247. package/src/components/block-tools/style.scss +5 -0
  248. package/src/components/block-vertical-alignment-control/test/__snapshots__/index.js.snap +3 -3
  249. package/src/components/dimensions-tool/stories/aspect-ratio-tool.story.js +1 -1
  250. package/src/components/dimensions-tool/stories/index.story.js +1 -1
  251. package/src/components/dimensions-tool/stories/scale-tool.story.js +1 -1
  252. package/src/components/dimensions-tool/stories/width-height-tool.story.js +1 -1
  253. package/src/components/font-appearance-control/index.js +1 -0
  254. package/src/components/font-family/index.js +10 -0
  255. package/src/components/font-family/style.scss +5 -0
  256. package/src/components/global-styles/dimensions-panel.js +16 -16
  257. package/src/components/iframe/content.scss +6 -1
  258. package/src/components/iframe/use-scale-canvas.js +103 -81
  259. package/src/components/inserter/block-patterns-tab/index.js +1 -17
  260. package/src/components/inserter/menu.js +8 -1
  261. package/src/components/inserter-draggable-blocks/index.js +19 -29
  262. package/src/components/inspector-controls/slot.js +3 -22
  263. package/src/components/letter-spacing-control/README.md +2 -1
  264. package/src/components/letter-spacing-control/index.js +17 -0
  265. package/src/components/line-height-control/index.js +1 -0
  266. package/src/components/media-placeholder/index.js +25 -28
  267. package/src/components/multi-selection-inspector/index.js +17 -27
  268. package/src/components/multi-selection-inspector/style.scss +0 -12
  269. package/src/components/resolution-tool/stories/index.story.js +1 -1
  270. package/src/components/rich-text/index.js +5 -0
  271. package/src/components/spacing-sizes-control/style.scss +0 -29
  272. package/src/components/text-alignment-control/stories/index.story.js +1 -1
  273. package/src/components/use-block-drop-zone/index.js +18 -1
  274. package/src/components/use-moving-animation/index.js +15 -0
  275. package/src/components/use-resize-canvas/index.js +1 -1
  276. package/src/components/warning/index.js +3 -4
  277. package/src/components/warning/test/index.js +3 -1
  278. package/src/components/writing-flow/use-drag-selection.js +11 -0
  279. package/src/components/writing-flow/use-tab-nav.js +9 -6
  280. package/src/hooks/block-bindings.js +8 -4
  281. package/src/hooks/gap.js +1 -1
  282. package/src/hooks/use-zoom-out.js +48 -16
  283. package/src/store/private-selectors.js +2 -17
  284. package/src/store/reducer.js +639 -2
  285. package/src/store/selectors.js +19 -69
  286. package/src/store/test/private-selectors.js +1 -0
  287. package/src/store/test/reducer.js +849 -0
  288. package/src/store/test/selectors.js +4 -110
  289. package/src/style.scss +1 -0
  290. package/tsconfig.tsbuildinfo +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_data","_compose","_richText","_components","_blocks","_deprecated","_i18n","_autocomplete","_blockEdit","_context","_formatToolbarContainer","_store","_useMarkPersistent","_useFormatTypes","_eventListeners","_formatEdit","_utils","_content","_withDeprecations","_useBindingsAttributes","_blockContext","_jsxRuntime","_shortcut","_toolbarButton","_inputEvent","keyboardShortcutContext","exports","createContext","inputEventContext","instanceIdKey","Symbol","removeNativeProps","props","__unstableMobileNoFocusOnMount","deleteEnter","placeholderTextColor","textAlign","selectionColor","tagsToEliminate","disableEditingMenu","fontSize","fontFamily","fontWeight","fontStyle","minWidth","maxWidth","disableSuggestions","disableAutocorrection","restProps","RichTextWrapper","children","tagName","value","adjustedValue","onChange","adjustedOnChange","isSelected","originalIsSelected","multiline","inlineToolbar","wrapperClassName","autocompleters","onReplace","placeholder","allowedFormats","withoutInteractiveFormatting","onRemove","onMerge","onSplit","__unstableOnSplitAtEnd","onSplitAtEnd","__unstableOnSplitAtDoubleLineEnd","onSplitAtDoubleLineEnd","identifier","preserveWhiteSpace","__unstablePastePlainText","pastePlainText","__unstableEmbedURLOnPaste","__unstableDisableFormats","disableFormats","disableLineBreaks","__unstableAllowPrefixTransformations","readOnly","forwardedRef","deprecated","since","alternative","instanceId","useInstanceId","anchorRef","useRef","context","useBlockEditContext","clientId","isBlockSelected","name","blockName","blockBindings","blockBindingsKey","blockContext","useContext","BlockContext","registry","useRegistry","selector","select","getSelectionStart","getSelectionEnd","blockEditorStore","selectionStart","selectionEnd","undefined","attributeKey","offset","useSelect","disableBoundBlock","bindingsPlaceholder","bindingsLabel","_fieldsList$relatedBi","canBindBlock","relatedBinding","blockBindingsSource","getBlockBindingsSource","source","blockBindingsContext","usesContext","length","key","_disableBoundBlock","canUserEditValue","args","getBlockAttributes","blockAttributes","fieldsList","getFieldsList","bindingKey","label","_bindingsPlaceholder","sprintf","__","_bindingsLabel","shouldDisableEditing","getBlockRootClientId","selectionChange","useDispatch","adjustedAllowedFormats","getAllowedFormats","hasFormats","onSelectionChange","useCallback","start","end","selection","unset","baseSelection","formatTypes","prepareHandlers","valueHandlers","changeHandlers","dependencies","useFormatTypes","addEditorOnlyFormats","reduce","accumulator","fn","text","formats","removeEditorOnlyFormats","forEach","formatType","__experimentalCreatePrepareEditableTree","removeFormat","addInvisibleFormats","getValue","ref","richTextRef","useRichText","html","__unstableFormats","__unstableText","Object","values","changeHandler","__unstableIsSelected","__unstableDependencies","__unstableAfterParse","__unstableBeforeSerialize","__unstableAddInvisibleFormats","autocompleteProps","useBlockEditorAutocompleteProps","completers","record","useMarkPersistent","keyboardShortcuts","Set","inputEvents","onFocus","current","focus","TagName","jsxs","Fragment","jsx","Provider","Popover","__unstableSlotNameProvider","default","inline","editableContentElement","role","useMergeRefs","useEventListeners","contentEditable","suppressContentEditableWarning","className","clsx","tabIndex","PrivateRichText","withDeprecations","forwardRef","Content","isEmpty","PublicForwardedRichTextContainer","isPreviewMode","isPreviewModeKey","Tag","contentProps","dangerouslySetInnerHTML","__html","valueToHTMLString","_default"],"sources":["@wordpress/block-editor/src/components/rich-text/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseRef,\n\tuseCallback,\n\tforwardRef,\n\tcreateContext,\n\tuseContext,\n} from '@wordpress/element';\nimport { useDispatch, useRegistry, useSelect } from '@wordpress/data';\nimport { useMergeRefs, useInstanceId } from '@wordpress/compose';\nimport {\n\t__unstableUseRichText as useRichText,\n\tremoveFormat,\n} from '@wordpress/rich-text';\nimport { Popover } from '@wordpress/components';\nimport { getBlockBindingsSource } from '@wordpress/blocks';\nimport deprecated from '@wordpress/deprecated';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useBlockEditorAutocompleteProps } from '../autocomplete';\nimport { useBlockEditContext } from '../block-edit';\nimport { blockBindingsKey, isPreviewModeKey } from '../block-edit/context';\nimport FormatToolbarContainer from './format-toolbar-container';\nimport { store as blockEditorStore } from '../../store';\nimport { useMarkPersistent } from './use-mark-persistent';\nimport { useFormatTypes } from './use-format-types';\nimport { useEventListeners } from './event-listeners';\nimport FormatEdit from './format-edit';\nimport { getAllowedFormats } from './utils';\nimport { Content, valueToHTMLString } from './content';\nimport { withDeprecations } from './with-deprecations';\nimport { canBindBlock } from '../../hooks/use-bindings-attributes';\nimport BlockContext from '../block-context';\n\nexport const keyboardShortcutContext = createContext();\nexport const inputEventContext = createContext();\n\nconst instanceIdKey = Symbol( 'instanceId' );\n\n/**\n * Removes props used for the native version of RichText so that they are not\n * passed to the DOM element and log warnings.\n *\n * @param {Object} props Props to filter.\n *\n * @return {Object} Filtered props.\n */\nfunction removeNativeProps( props ) {\n\tconst {\n\t\t__unstableMobileNoFocusOnMount,\n\t\tdeleteEnter,\n\t\tplaceholderTextColor,\n\t\ttextAlign,\n\t\tselectionColor,\n\t\ttagsToEliminate,\n\t\tdisableEditingMenu,\n\t\tfontSize,\n\t\tfontFamily,\n\t\tfontWeight,\n\t\tfontStyle,\n\t\tminWidth,\n\t\tmaxWidth,\n\t\tdisableSuggestions,\n\t\tdisableAutocorrection,\n\t\t...restProps\n\t} = props;\n\treturn restProps;\n}\n\nexport function RichTextWrapper(\n\t{\n\t\tchildren,\n\t\ttagName = 'div',\n\t\tvalue: adjustedValue = '',\n\t\tonChange: adjustedOnChange,\n\t\tisSelected: originalIsSelected,\n\t\tmultiline,\n\t\tinlineToolbar,\n\t\twrapperClassName,\n\t\tautocompleters,\n\t\tonReplace,\n\t\tplaceholder,\n\t\tallowedFormats,\n\t\twithoutInteractiveFormatting,\n\t\tonRemove,\n\t\tonMerge,\n\t\tonSplit,\n\t\t__unstableOnSplitAtEnd: onSplitAtEnd,\n\t\t__unstableOnSplitAtDoubleLineEnd: onSplitAtDoubleLineEnd,\n\t\tidentifier,\n\t\tpreserveWhiteSpace,\n\t\t__unstablePastePlainText: pastePlainText,\n\t\t__unstableEmbedURLOnPaste,\n\t\t__unstableDisableFormats: disableFormats,\n\t\tdisableLineBreaks,\n\t\t__unstableAllowPrefixTransformations,\n\t\treadOnly,\n\t\t...props\n\t},\n\tforwardedRef\n) {\n\tprops = removeNativeProps( props );\n\n\tif ( onSplit ) {\n\t\tdeprecated( 'wp.blockEditor.RichText onSplit prop', {\n\t\t\tsince: '6.4',\n\t\t\talternative: 'block.json support key: \"splitting\"',\n\t\t} );\n\t}\n\n\tconst instanceId = useInstanceId( RichTextWrapper );\n\tconst anchorRef = useRef();\n\tconst context = useBlockEditContext();\n\tconst { clientId, isSelected: isBlockSelected, name: blockName } = context;\n\tconst blockBindings = context[ blockBindingsKey ];\n\tconst blockContext = useContext( BlockContext );\n\tconst registry = useRegistry();\n\tconst selector = ( select ) => {\n\t\t// Avoid subscribing to the block editor store if the block is not\n\t\t// selected.\n\t\tif ( ! isBlockSelected ) {\n\t\t\treturn { isSelected: false };\n\t\t}\n\n\t\tconst { getSelectionStart, getSelectionEnd } =\n\t\t\tselect( blockEditorStore );\n\t\tconst selectionStart = getSelectionStart();\n\t\tconst selectionEnd = getSelectionEnd();\n\n\t\tlet isSelected;\n\n\t\tif ( originalIsSelected === undefined ) {\n\t\t\tisSelected =\n\t\t\t\tselectionStart.clientId === clientId &&\n\t\t\t\tselectionEnd.clientId === clientId &&\n\t\t\t\t( identifier\n\t\t\t\t\t? selectionStart.attributeKey === identifier\n\t\t\t\t\t: selectionStart[ instanceIdKey ] === instanceId );\n\t\t} else if ( originalIsSelected ) {\n\t\t\tisSelected = selectionStart.clientId === clientId;\n\t\t}\n\n\t\treturn {\n\t\t\tselectionStart: isSelected ? selectionStart.offset : undefined,\n\t\t\tselectionEnd: isSelected ? selectionEnd.offset : undefined,\n\t\t\tisSelected,\n\t\t};\n\t};\n\tconst { selectionStart, selectionEnd, isSelected } = useSelect( selector, [\n\t\tclientId,\n\t\tidentifier,\n\t\tinstanceId,\n\t\toriginalIsSelected,\n\t\tisBlockSelected,\n\t] );\n\n\tconst { disableBoundBlock, bindingsPlaceholder, bindingsLabel } = useSelect(\n\t\t( select ) => {\n\t\t\tif (\n\t\t\t\t! blockBindings?.[ identifier ] ||\n\t\t\t\t! canBindBlock( blockName )\n\t\t\t) {\n\t\t\t\treturn {};\n\t\t\t}\n\n\t\t\tconst relatedBinding = blockBindings[ identifier ];\n\t\t\tconst blockBindingsSource = getBlockBindingsSource(\n\t\t\t\trelatedBinding.source\n\t\t\t);\n\t\t\tconst blockBindingsContext = {};\n\t\t\tif ( blockBindingsSource?.usesContext?.length ) {\n\t\t\t\tfor ( const key of blockBindingsSource.usesContext ) {\n\t\t\t\t\tblockBindingsContext[ key ] = blockContext[ key ];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst _disableBoundBlock =\n\t\t\t\t! blockBindingsSource?.canUserEditValue?.( {\n\t\t\t\t\tselect,\n\t\t\t\t\tcontext: blockBindingsContext,\n\t\t\t\t\targs: relatedBinding.args,\n\t\t\t\t} );\n\n\t\t\t// Don't modify placeholders if value is not empty.\n\t\t\tif ( adjustedValue.length > 0 ) {\n\t\t\t\treturn {\n\t\t\t\t\tdisableBoundBlock: _disableBoundBlock,\n\t\t\t\t\t// Null values will make them fall back to the default behavior.\n\t\t\t\t\tbindingsPlaceholder: null,\n\t\t\t\t\tbindingsLabel: null,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst { getBlockAttributes } = select( blockEditorStore );\n\t\t\tconst blockAttributes = getBlockAttributes( clientId );\n\t\t\tconst fieldsList = blockBindingsSource?.getFieldsList?.( {\n\t\t\t\tselect,\n\t\t\t\tcontext: blockBindingsContext,\n\t\t\t} );\n\t\t\tconst bindingKey =\n\t\t\t\tfieldsList?.[ relatedBinding?.args?.key ]?.label ??\n\t\t\t\tblockBindingsSource?.label;\n\n\t\t\tconst _bindingsPlaceholder = _disableBoundBlock\n\t\t\t\t? bindingKey\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t/* translators: %s: connected field label or source label */\n\t\t\t\t\t\t__( 'Add %s' ),\n\t\t\t\t\t\tbindingKey\n\t\t\t\t );\n\t\t\tconst _bindingsLabel = _disableBoundBlock\n\t\t\t\t? relatedBinding?.args?.key || blockBindingsSource?.label\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t/* translators: %s: source label or key */\n\t\t\t\t\t\t__( 'Empty %s; start writing to edit its value' ),\n\t\t\t\t\t\trelatedBinding?.args?.key || blockBindingsSource?.label\n\t\t\t\t );\n\n\t\t\treturn {\n\t\t\t\tdisableBoundBlock: _disableBoundBlock,\n\t\t\t\tbindingsPlaceholder:\n\t\t\t\t\tblockAttributes?.placeholder || _bindingsPlaceholder,\n\t\t\t\tbindingsLabel: _bindingsLabel,\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\tblockBindings,\n\t\t\tidentifier,\n\t\t\tblockName,\n\t\t\tadjustedValue,\n\t\t\tclientId,\n\t\t\tblockContext,\n\t\t]\n\t);\n\n\tconst shouldDisableEditing = readOnly || disableBoundBlock;\n\n\tconst { getSelectionStart, getSelectionEnd, getBlockRootClientId } =\n\t\tuseSelect( blockEditorStore );\n\tconst { selectionChange } = useDispatch( blockEditorStore );\n\tconst adjustedAllowedFormats = getAllowedFormats( {\n\t\tallowedFormats,\n\t\tdisableFormats,\n\t} );\n\tconst hasFormats =\n\t\t! adjustedAllowedFormats || adjustedAllowedFormats.length > 0;\n\n\tconst onSelectionChange = useCallback(\n\t\t( start, end ) => {\n\t\t\tconst selection = {};\n\t\t\tconst unset = start === undefined && end === undefined;\n\n\t\t\tconst baseSelection = {\n\t\t\t\tclientId,\n\t\t\t\t[ identifier ? 'attributeKey' : instanceIdKey ]: identifier\n\t\t\t\t\t? identifier\n\t\t\t\t\t: instanceId,\n\t\t\t};\n\n\t\t\tif ( typeof start === 'number' || unset ) {\n\t\t\t\t// If we are only setting the start (or the end below), which\n\t\t\t\t// means a partial selection, and we're not updating a selection\n\t\t\t\t// with the same client ID, abort. This means the selected block\n\t\t\t\t// is a parent block.\n\t\t\t\tif (\n\t\t\t\t\tend === undefined &&\n\t\t\t\t\tgetBlockRootClientId( clientId ) !==\n\t\t\t\t\t\tgetBlockRootClientId( getSelectionEnd().clientId )\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tselection.start = {\n\t\t\t\t\t...baseSelection,\n\t\t\t\t\toffset: start,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif ( typeof end === 'number' || unset ) {\n\t\t\t\tif (\n\t\t\t\t\tstart === undefined &&\n\t\t\t\t\tgetBlockRootClientId( clientId ) !==\n\t\t\t\t\t\tgetBlockRootClientId( getSelectionStart().clientId )\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tselection.end = {\n\t\t\t\t\t...baseSelection,\n\t\t\t\t\toffset: end,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tselectionChange( selection );\n\t\t},\n\t\t[\n\t\t\tclientId,\n\t\t\tgetBlockRootClientId,\n\t\t\tgetSelectionEnd,\n\t\t\tgetSelectionStart,\n\t\t\tidentifier,\n\t\t\tinstanceId,\n\t\t\tselectionChange,\n\t\t]\n\t);\n\n\tconst {\n\t\tformatTypes,\n\t\tprepareHandlers,\n\t\tvalueHandlers,\n\t\tchangeHandlers,\n\t\tdependencies,\n\t} = useFormatTypes( {\n\t\tclientId,\n\t\tidentifier,\n\t\twithoutInteractiveFormatting,\n\t\tallowedFormats: adjustedAllowedFormats,\n\t} );\n\n\tfunction addEditorOnlyFormats( value ) {\n\t\treturn valueHandlers.reduce(\n\t\t\t( accumulator, fn ) => fn( accumulator, value.text ),\n\t\t\tvalue.formats\n\t\t);\n\t}\n\n\tfunction removeEditorOnlyFormats( value ) {\n\t\tformatTypes.forEach( ( formatType ) => {\n\t\t\t// Remove formats created by prepareEditableTree, because they are editor only.\n\t\t\tif ( formatType.__experimentalCreatePrepareEditableTree ) {\n\t\t\t\tvalue = removeFormat(\n\t\t\t\t\tvalue,\n\t\t\t\t\tformatType.name,\n\t\t\t\t\t0,\n\t\t\t\t\tvalue.text.length\n\t\t\t\t);\n\t\t\t}\n\t\t} );\n\n\t\treturn value.formats;\n\t}\n\n\tfunction addInvisibleFormats( value ) {\n\t\treturn prepareHandlers.reduce(\n\t\t\t( accumulator, fn ) => fn( accumulator, value.text ),\n\t\t\tvalue.formats\n\t\t);\n\t}\n\n\tconst {\n\t\tvalue,\n\t\tgetValue,\n\t\tonChange,\n\t\tref: richTextRef,\n\t} = useRichText( {\n\t\tvalue: adjustedValue,\n\t\tonChange( html, { __unstableFormats, __unstableText } ) {\n\t\t\tadjustedOnChange( html );\n\t\t\tObject.values( changeHandlers ).forEach( ( changeHandler ) => {\n\t\t\t\tchangeHandler( __unstableFormats, __unstableText );\n\t\t\t} );\n\t\t},\n\t\tselectionStart,\n\t\tselectionEnd,\n\t\tonSelectionChange,\n\t\tplaceholder: bindingsPlaceholder || placeholder,\n\t\t__unstableIsSelected: isSelected,\n\t\t__unstableDisableFormats: disableFormats,\n\t\tpreserveWhiteSpace,\n\t\t__unstableDependencies: [ ...dependencies, tagName ],\n\t\t__unstableAfterParse: addEditorOnlyFormats,\n\t\t__unstableBeforeSerialize: removeEditorOnlyFormats,\n\t\t__unstableAddInvisibleFormats: addInvisibleFormats,\n\t} );\n\tconst autocompleteProps = useBlockEditorAutocompleteProps( {\n\t\tonReplace,\n\t\tcompleters: autocompleters,\n\t\trecord: value,\n\t\tonChange,\n\t} );\n\n\tuseMarkPersistent( { html: adjustedValue, value } );\n\n\tconst keyboardShortcuts = useRef( new Set() );\n\tconst inputEvents = useRef( new Set() );\n\n\tfunction onFocus() {\n\t\tanchorRef.current?.focus();\n\t}\n\n\tconst TagName = tagName;\n\treturn (\n\t\t<>\n\t\t\t{ isSelected && (\n\t\t\t\t<keyboardShortcutContext.Provider value={ keyboardShortcuts }>\n\t\t\t\t\t<inputEventContext.Provider value={ inputEvents }>\n\t\t\t\t\t\t<Popover.__unstableSlotNameProvider value=\"__unstable-block-tools-after\">\n\t\t\t\t\t\t\t{ children &&\n\t\t\t\t\t\t\t\tchildren( { value, onChange, onFocus } ) }\n\n\t\t\t\t\t\t\t<FormatEdit\n\t\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\t\t\tformatTypes={ formatTypes }\n\t\t\t\t\t\t\t\tforwardedRef={ anchorRef }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Popover.__unstableSlotNameProvider>\n\t\t\t\t\t</inputEventContext.Provider>\n\t\t\t\t</keyboardShortcutContext.Provider>\n\t\t\t) }\n\t\t\t{ isSelected && hasFormats && (\n\t\t\t\t<FormatToolbarContainer\n\t\t\t\t\tinline={ inlineToolbar }\n\t\t\t\t\teditableContentElement={ anchorRef.current }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<TagName\n\t\t\t\t// Overridable props.\n\t\t\t\trole=\"textbox\"\n\t\t\t\taria-multiline={ ! disableLineBreaks }\n\t\t\t\taria-readonly={ shouldDisableEditing }\n\t\t\t\t{ ...props }\n\t\t\t\taria-label={\n\t\t\t\t\tbindingsLabel || props[ 'aria-label' ] || placeholder\n\t\t\t\t}\n\t\t\t\t{ ...autocompleteProps }\n\t\t\t\tref={ useMergeRefs( [\n\t\t\t\t\t// Rich text ref must be first because its focus listener\n\t\t\t\t\t// must be set up before any other ref calls .focus() on\n\t\t\t\t\t// mount.\n\t\t\t\t\trichTextRef,\n\t\t\t\t\tforwardedRef,\n\t\t\t\t\tautocompleteProps.ref,\n\t\t\t\t\tprops.ref,\n\t\t\t\t\tuseEventListeners( {\n\t\t\t\t\t\tregistry,\n\t\t\t\t\t\tgetValue,\n\t\t\t\t\t\tonChange,\n\t\t\t\t\t\t__unstableAllowPrefixTransformations,\n\t\t\t\t\t\tformatTypes,\n\t\t\t\t\t\tonReplace,\n\t\t\t\t\t\tselectionChange,\n\t\t\t\t\t\tisSelected,\n\t\t\t\t\t\tdisableFormats,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\ttagName,\n\t\t\t\t\t\tonSplit,\n\t\t\t\t\t\t__unstableEmbedURLOnPaste,\n\t\t\t\t\t\tpastePlainText,\n\t\t\t\t\t\tonMerge,\n\t\t\t\t\t\tonRemove,\n\t\t\t\t\t\tremoveEditorOnlyFormats,\n\t\t\t\t\t\tdisableLineBreaks,\n\t\t\t\t\t\tonSplitAtEnd,\n\t\t\t\t\t\tonSplitAtDoubleLineEnd,\n\t\t\t\t\t\tkeyboardShortcuts,\n\t\t\t\t\t\tinputEvents,\n\t\t\t\t\t} ),\n\t\t\t\t\tanchorRef,\n\t\t\t\t] ) }\n\t\t\t\tcontentEditable={ ! shouldDisableEditing }\n\t\t\t\tsuppressContentEditableWarning\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'block-editor-rich-text__editable',\n\t\t\t\t\tprops.className,\n\t\t\t\t\t'rich-text'\n\t\t\t\t) }\n\t\t\t\t// Setting tabIndex to 0 is unnecessary, the element is already\n\t\t\t\t// focusable because it's contentEditable. This also fixes a\n\t\t\t\t// Safari bug where it's not possible to Shift+Click multi\n\t\t\t\t// select blocks when Shift Clicking into an element with\n\t\t\t\t// tabIndex because Safari will focus the element. However,\n\t\t\t\t// Safari will correctly ignore nested contentEditable elements.\n\t\t\t\ttabIndex={\n\t\t\t\t\tprops.tabIndex === 0 && ! shouldDisableEditing\n\t\t\t\t\t\t? null\n\t\t\t\t\t\t: props.tabIndex\n\t\t\t\t}\n\t\t\t\tdata-wp-block-attribute-key={ identifier }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\n// This is the private API for the RichText component.\n// It allows access to all props, not just the public ones.\nexport const PrivateRichText = withDeprecations(\n\tforwardRef( RichTextWrapper )\n);\n\nPrivateRichText.Content = Content;\nPrivateRichText.isEmpty = ( value ) => {\n\treturn ! value || value.length === 0;\n};\n\n// This is the public API for the RichText component.\n// We wrap the PrivateRichText component to hide some props from the public API.\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/rich-text/README.md\n */\nconst PublicForwardedRichTextContainer = forwardRef( ( props, ref ) => {\n\tconst context = useBlockEditContext();\n\tconst isPreviewMode = context[ isPreviewModeKey ];\n\n\tif ( isPreviewMode ) {\n\t\t// Remove all non-content props.\n\t\tconst {\n\t\t\tchildren,\n\t\t\ttagName: Tag = 'div',\n\t\t\tvalue,\n\t\t\tonChange,\n\t\t\tisSelected,\n\t\t\tmultiline,\n\t\t\tinlineToolbar,\n\t\t\twrapperClassName,\n\t\t\tautocompleters,\n\t\t\tonReplace,\n\t\t\tplaceholder,\n\t\t\tallowedFormats,\n\t\t\twithoutInteractiveFormatting,\n\t\t\tonRemove,\n\t\t\tonMerge,\n\t\t\tonSplit,\n\t\t\t__unstableOnSplitAtEnd,\n\t\t\t__unstableOnSplitAtDoubleLineEnd,\n\t\t\tidentifier,\n\t\t\tpreserveWhiteSpace,\n\t\t\t__unstablePastePlainText,\n\t\t\t__unstableEmbedURLOnPaste,\n\t\t\t__unstableDisableFormats,\n\t\t\tdisableLineBreaks,\n\t\t\t__unstableAllowPrefixTransformations,\n\t\t\treadOnly,\n\t\t\t...contentProps\n\t\t} = removeNativeProps( props );\n\t\treturn (\n\t\t\t<Tag\n\t\t\t\t{ ...contentProps }\n\t\t\t\tdangerouslySetInnerHTML={ {\n\t\t\t\t\t__html: valueToHTMLString( value, multiline ),\n\t\t\t\t} }\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn <PrivateRichText ref={ ref } { ...props } readOnly={ false } />;\n} );\n\nPublicForwardedRichTextContainer.Content = Content;\nPublicForwardedRichTextContainer.isEmpty = ( value ) => {\n\treturn ! value || value.length === 0;\n};\n\nexport default PublicForwardedRichTextContainer;\nexport { RichTextShortcut } from './shortcut';\nexport { RichTextToolbarButton } from './toolbar-button';\nexport { __unstableRichTextInputEvent } from './input-event';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OA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ChCE,UAAU;MACVC,kBAAkB;MAClBC,wBAAwB;MACxBE,yBAAyB;MACzBC,wBAAwB;MACxBE,iBAAiB;MACjBC,oCAAoC;MACpCC,QAAQ;MACR,GAAGgJ;IACJ,CAAC,GAAGnM,iBAAiB,CAAEC,KAAM,CAAC;IAC9B,oBACC,IAAAX,WAAA,CAAAqL,GAAA,EAACuB,GAAG;MAAA,GACEC,YAAY;MACjBC,uBAAuB,EAAG;QACzBC,MAAM,EAAE,IAAAC,0BAAiB,EAAEjL,KAAK,EAAEM,SAAU;MAC7C;IAAG,CACH,CAAC;EAEJ;EAEA,oBAAO,IAAArC,WAAA,CAAAqL,GAAA,EAACe,eAAe;IAAC3C,GAAG,EAAGA,GAAK;IAAA,GAAM9I,KAAK;IAAGkD,QAAQ,EAAG;EAAO,CAAE,CAAC;AACvE,CAAE,CAAC;AAEH4I,gCAAgC,CAACF,OAAO,GAAGA,gBAAO;AAClDE,gCAAgC,CAACD,OAAO,GAAKzK,KAAK,IAAM;EACvD,OAAO,CAAEA,KAAK,IAAIA,KAAK,CAAC0E,MAAM,KAAK,CAAC;AACrC,CAAC;AAAC,IAAAwG,QAAA,GAAA5M,OAAA,CAAAoL,OAAA,GAEagB,gCAAgC","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_data","_compose","_richText","_components","_blocks","_deprecated","_i18n","_autocomplete","_blockEdit","_context","_formatToolbarContainer","_store","_useMarkPersistent","_useFormatTypes","_eventListeners","_formatEdit","_utils","_content","_withDeprecations","_useBindingsAttributes","_blockContext","_jsxRuntime","_shortcut","_toolbarButton","_inputEvent","keyboardShortcutContext","exports","createContext","inputEventContext","instanceIdKey","Symbol","removeNativeProps","props","__unstableMobileNoFocusOnMount","deleteEnter","placeholderTextColor","textAlign","selectionColor","tagsToEliminate","disableEditingMenu","fontSize","fontFamily","fontWeight","fontStyle","minWidth","maxWidth","disableSuggestions","disableAutocorrection","restProps","RichTextWrapper","children","tagName","value","adjustedValue","onChange","adjustedOnChange","isSelected","originalIsSelected","multiline","inlineToolbar","wrapperClassName","autocompleters","onReplace","placeholder","allowedFormats","withoutInteractiveFormatting","onRemove","onMerge","onSplit","__unstableOnSplitAtEnd","onSplitAtEnd","__unstableOnSplitAtDoubleLineEnd","onSplitAtDoubleLineEnd","identifier","preserveWhiteSpace","__unstablePastePlainText","pastePlainText","__unstableEmbedURLOnPaste","__unstableDisableFormats","disableFormats","disableLineBreaks","__unstableAllowPrefixTransformations","readOnly","forwardedRef","deprecated","since","alternative","instanceId","useInstanceId","anchorRef","useRef","context","useBlockEditContext","clientId","isBlockSelected","name","blockName","blockBindings","blockBindingsKey","blockContext","useContext","BlockContext","registry","useRegistry","selector","select","getSelectionStart","getSelectionEnd","blockEditorStore","selectionStart","selectionEnd","undefined","attributeKey","offset","useSelect","disableBoundBlock","bindingsPlaceholder","bindingsLabel","_fieldsList$relatedBi","canBindBlock","relatedBinding","blockBindingsSource","getBlockBindingsSource","source","blockBindingsContext","usesContext","length","key","_disableBoundBlock","canUserEditValue","args","getBlockAttributes","blockAttributes","fieldsList","getFieldsList","bindingKey","label","_bindingsPlaceholder","sprintf","__","_bindingsLabel","shouldDisableEditing","getBlockRootClientId","selectionChange","useDispatch","adjustedAllowedFormats","getAllowedFormats","hasFormats","onSelectionChange","useCallback","start","end","selection","unset","baseSelection","formatTypes","prepareHandlers","valueHandlers","changeHandlers","dependencies","useFormatTypes","addEditorOnlyFormats","reduce","accumulator","fn","text","formats","removeEditorOnlyFormats","forEach","formatType","__experimentalCreatePrepareEditableTree","removeFormat","addInvisibleFormats","getValue","ref","richTextRef","useRichText","html","__unstableFormats","__unstableText","Object","values","changeHandler","__unstableIsSelected","__unstableDependencies","__unstableAfterParse","__unstableBeforeSerialize","__unstableAddInvisibleFormats","autocompleteProps","useBlockEditorAutocompleteProps","completers","record","useMarkPersistent","keyboardShortcuts","Set","inputEvents","onFocus","current","focus","TagName","jsxs","Fragment","jsx","Provider","Popover","__unstableSlotNameProvider","default","inline","editableContentElement","role","draggable","useMergeRefs","useEventListeners","contentEditable","suppressContentEditableWarning","className","clsx","tabIndex","PrivateRichText","withDeprecations","forwardRef","Content","isEmpty","PublicForwardedRichTextContainer","isPreviewMode","isPreviewModeKey","Tag","contentProps","dangerouslySetInnerHTML","__html","valueToHTMLString","_default"],"sources":["@wordpress/block-editor/src/components/rich-text/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseRef,\n\tuseCallback,\n\tforwardRef,\n\tcreateContext,\n\tuseContext,\n} from '@wordpress/element';\nimport { useDispatch, useRegistry, useSelect } from '@wordpress/data';\nimport { useMergeRefs, useInstanceId } from '@wordpress/compose';\nimport {\n\t__unstableUseRichText as useRichText,\n\tremoveFormat,\n} from '@wordpress/rich-text';\nimport { Popover } from '@wordpress/components';\nimport { getBlockBindingsSource } from '@wordpress/blocks';\nimport deprecated from '@wordpress/deprecated';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useBlockEditorAutocompleteProps } from '../autocomplete';\nimport { useBlockEditContext } from '../block-edit';\nimport { blockBindingsKey, isPreviewModeKey } from '../block-edit/context';\nimport FormatToolbarContainer from './format-toolbar-container';\nimport { store as blockEditorStore } from '../../store';\nimport { useMarkPersistent } from './use-mark-persistent';\nimport { useFormatTypes } from './use-format-types';\nimport { useEventListeners } from './event-listeners';\nimport FormatEdit from './format-edit';\nimport { getAllowedFormats } from './utils';\nimport { Content, valueToHTMLString } from './content';\nimport { withDeprecations } from './with-deprecations';\nimport { canBindBlock } from '../../hooks/use-bindings-attributes';\nimport BlockContext from '../block-context';\n\nexport const keyboardShortcutContext = createContext();\nexport const inputEventContext = createContext();\n\nconst instanceIdKey = Symbol( 'instanceId' );\n\n/**\n * Removes props used for the native version of RichText so that they are not\n * passed to the DOM element and log warnings.\n *\n * @param {Object} props Props to filter.\n *\n * @return {Object} Filtered props.\n */\nfunction removeNativeProps( props ) {\n\tconst {\n\t\t__unstableMobileNoFocusOnMount,\n\t\tdeleteEnter,\n\t\tplaceholderTextColor,\n\t\ttextAlign,\n\t\tselectionColor,\n\t\ttagsToEliminate,\n\t\tdisableEditingMenu,\n\t\tfontSize,\n\t\tfontFamily,\n\t\tfontWeight,\n\t\tfontStyle,\n\t\tminWidth,\n\t\tmaxWidth,\n\t\tdisableSuggestions,\n\t\tdisableAutocorrection,\n\t\t...restProps\n\t} = props;\n\treturn restProps;\n}\n\nexport function RichTextWrapper(\n\t{\n\t\tchildren,\n\t\ttagName = 'div',\n\t\tvalue: adjustedValue = '',\n\t\tonChange: adjustedOnChange,\n\t\tisSelected: originalIsSelected,\n\t\tmultiline,\n\t\tinlineToolbar,\n\t\twrapperClassName,\n\t\tautocompleters,\n\t\tonReplace,\n\t\tplaceholder,\n\t\tallowedFormats,\n\t\twithoutInteractiveFormatting,\n\t\tonRemove,\n\t\tonMerge,\n\t\tonSplit,\n\t\t__unstableOnSplitAtEnd: onSplitAtEnd,\n\t\t__unstableOnSplitAtDoubleLineEnd: onSplitAtDoubleLineEnd,\n\t\tidentifier,\n\t\tpreserveWhiteSpace,\n\t\t__unstablePastePlainText: pastePlainText,\n\t\t__unstableEmbedURLOnPaste,\n\t\t__unstableDisableFormats: disableFormats,\n\t\tdisableLineBreaks,\n\t\t__unstableAllowPrefixTransformations,\n\t\treadOnly,\n\t\t...props\n\t},\n\tforwardedRef\n) {\n\tprops = removeNativeProps( props );\n\n\tif ( onSplit ) {\n\t\tdeprecated( 'wp.blockEditor.RichText onSplit prop', {\n\t\t\tsince: '6.4',\n\t\t\talternative: 'block.json support key: \"splitting\"',\n\t\t} );\n\t}\n\n\tconst instanceId = useInstanceId( RichTextWrapper );\n\tconst anchorRef = useRef();\n\tconst context = useBlockEditContext();\n\tconst { clientId, isSelected: isBlockSelected, name: blockName } = context;\n\tconst blockBindings = context[ blockBindingsKey ];\n\tconst blockContext = useContext( BlockContext );\n\tconst registry = useRegistry();\n\tconst selector = ( select ) => {\n\t\t// Avoid subscribing to the block editor store if the block is not\n\t\t// selected.\n\t\tif ( ! isBlockSelected ) {\n\t\t\treturn { isSelected: false };\n\t\t}\n\n\t\tconst { getSelectionStart, getSelectionEnd } =\n\t\t\tselect( blockEditorStore );\n\t\tconst selectionStart = getSelectionStart();\n\t\tconst selectionEnd = getSelectionEnd();\n\n\t\tlet isSelected;\n\n\t\tif ( originalIsSelected === undefined ) {\n\t\t\tisSelected =\n\t\t\t\tselectionStart.clientId === clientId &&\n\t\t\t\tselectionEnd.clientId === clientId &&\n\t\t\t\t( identifier\n\t\t\t\t\t? selectionStart.attributeKey === identifier\n\t\t\t\t\t: selectionStart[ instanceIdKey ] === instanceId );\n\t\t} else if ( originalIsSelected ) {\n\t\t\tisSelected = selectionStart.clientId === clientId;\n\t\t}\n\n\t\treturn {\n\t\t\tselectionStart: isSelected ? selectionStart.offset : undefined,\n\t\t\tselectionEnd: isSelected ? selectionEnd.offset : undefined,\n\t\t\tisSelected,\n\t\t};\n\t};\n\tconst { selectionStart, selectionEnd, isSelected } = useSelect( selector, [\n\t\tclientId,\n\t\tidentifier,\n\t\tinstanceId,\n\t\toriginalIsSelected,\n\t\tisBlockSelected,\n\t] );\n\n\tconst { disableBoundBlock, bindingsPlaceholder, bindingsLabel } = useSelect(\n\t\t( select ) => {\n\t\t\tif (\n\t\t\t\t! blockBindings?.[ identifier ] ||\n\t\t\t\t! canBindBlock( blockName )\n\t\t\t) {\n\t\t\t\treturn {};\n\t\t\t}\n\n\t\t\tconst relatedBinding = blockBindings[ identifier ];\n\t\t\tconst blockBindingsSource = getBlockBindingsSource(\n\t\t\t\trelatedBinding.source\n\t\t\t);\n\t\t\tconst blockBindingsContext = {};\n\t\t\tif ( blockBindingsSource?.usesContext?.length ) {\n\t\t\t\tfor ( const key of blockBindingsSource.usesContext ) {\n\t\t\t\t\tblockBindingsContext[ key ] = blockContext[ key ];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst _disableBoundBlock =\n\t\t\t\t! blockBindingsSource?.canUserEditValue?.( {\n\t\t\t\t\tselect,\n\t\t\t\t\tcontext: blockBindingsContext,\n\t\t\t\t\targs: relatedBinding.args,\n\t\t\t\t} );\n\n\t\t\t// Don't modify placeholders if value is not empty.\n\t\t\tif ( adjustedValue.length > 0 ) {\n\t\t\t\treturn {\n\t\t\t\t\tdisableBoundBlock: _disableBoundBlock,\n\t\t\t\t\t// Null values will make them fall back to the default behavior.\n\t\t\t\t\tbindingsPlaceholder: null,\n\t\t\t\t\tbindingsLabel: null,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst { getBlockAttributes } = select( blockEditorStore );\n\t\t\tconst blockAttributes = getBlockAttributes( clientId );\n\t\t\tconst fieldsList = blockBindingsSource?.getFieldsList?.( {\n\t\t\t\tselect,\n\t\t\t\tcontext: blockBindingsContext,\n\t\t\t} );\n\t\t\tconst bindingKey =\n\t\t\t\tfieldsList?.[ relatedBinding?.args?.key ]?.label ??\n\t\t\t\tblockBindingsSource?.label;\n\n\t\t\tconst _bindingsPlaceholder = _disableBoundBlock\n\t\t\t\t? bindingKey\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t/* translators: %s: connected field label or source label */\n\t\t\t\t\t\t__( 'Add %s' ),\n\t\t\t\t\t\tbindingKey\n\t\t\t\t );\n\t\t\tconst _bindingsLabel = _disableBoundBlock\n\t\t\t\t? relatedBinding?.args?.key || blockBindingsSource?.label\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t/* translators: %s: source label or key */\n\t\t\t\t\t\t__( 'Empty %s; start writing to edit its value' ),\n\t\t\t\t\t\trelatedBinding?.args?.key || blockBindingsSource?.label\n\t\t\t\t );\n\n\t\t\treturn {\n\t\t\t\tdisableBoundBlock: _disableBoundBlock,\n\t\t\t\tbindingsPlaceholder:\n\t\t\t\t\tblockAttributes?.placeholder || _bindingsPlaceholder,\n\t\t\t\tbindingsLabel: _bindingsLabel,\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\tblockBindings,\n\t\t\tidentifier,\n\t\t\tblockName,\n\t\t\tadjustedValue,\n\t\t\tclientId,\n\t\t\tblockContext,\n\t\t]\n\t);\n\n\tconst shouldDisableEditing = readOnly || disableBoundBlock;\n\n\tconst { getSelectionStart, getSelectionEnd, getBlockRootClientId } =\n\t\tuseSelect( blockEditorStore );\n\tconst { selectionChange } = useDispatch( blockEditorStore );\n\tconst adjustedAllowedFormats = getAllowedFormats( {\n\t\tallowedFormats,\n\t\tdisableFormats,\n\t} );\n\tconst hasFormats =\n\t\t! adjustedAllowedFormats || adjustedAllowedFormats.length > 0;\n\n\tconst onSelectionChange = useCallback(\n\t\t( start, end ) => {\n\t\t\tconst selection = {};\n\t\t\tconst unset = start === undefined && end === undefined;\n\n\t\t\tconst baseSelection = {\n\t\t\t\tclientId,\n\t\t\t\t[ identifier ? 'attributeKey' : instanceIdKey ]: identifier\n\t\t\t\t\t? identifier\n\t\t\t\t\t: instanceId,\n\t\t\t};\n\n\t\t\tif ( typeof start === 'number' || unset ) {\n\t\t\t\t// If we are only setting the start (or the end below), which\n\t\t\t\t// means a partial selection, and we're not updating a selection\n\t\t\t\t// with the same client ID, abort. This means the selected block\n\t\t\t\t// is a parent block.\n\t\t\t\tif (\n\t\t\t\t\tend === undefined &&\n\t\t\t\t\tgetBlockRootClientId( clientId ) !==\n\t\t\t\t\t\tgetBlockRootClientId( getSelectionEnd().clientId )\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tselection.start = {\n\t\t\t\t\t...baseSelection,\n\t\t\t\t\toffset: start,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif ( typeof end === 'number' || unset ) {\n\t\t\t\tif (\n\t\t\t\t\tstart === undefined &&\n\t\t\t\t\tgetBlockRootClientId( clientId ) !==\n\t\t\t\t\t\tgetBlockRootClientId( getSelectionStart().clientId )\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tselection.end = {\n\t\t\t\t\t...baseSelection,\n\t\t\t\t\toffset: end,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tselectionChange( selection );\n\t\t},\n\t\t[\n\t\t\tclientId,\n\t\t\tgetBlockRootClientId,\n\t\t\tgetSelectionEnd,\n\t\t\tgetSelectionStart,\n\t\t\tidentifier,\n\t\t\tinstanceId,\n\t\t\tselectionChange,\n\t\t]\n\t);\n\n\tconst {\n\t\tformatTypes,\n\t\tprepareHandlers,\n\t\tvalueHandlers,\n\t\tchangeHandlers,\n\t\tdependencies,\n\t} = useFormatTypes( {\n\t\tclientId,\n\t\tidentifier,\n\t\twithoutInteractiveFormatting,\n\t\tallowedFormats: adjustedAllowedFormats,\n\t} );\n\n\tfunction addEditorOnlyFormats( value ) {\n\t\treturn valueHandlers.reduce(\n\t\t\t( accumulator, fn ) => fn( accumulator, value.text ),\n\t\t\tvalue.formats\n\t\t);\n\t}\n\n\tfunction removeEditorOnlyFormats( value ) {\n\t\tformatTypes.forEach( ( formatType ) => {\n\t\t\t// Remove formats created by prepareEditableTree, because they are editor only.\n\t\t\tif ( formatType.__experimentalCreatePrepareEditableTree ) {\n\t\t\t\tvalue = removeFormat(\n\t\t\t\t\tvalue,\n\t\t\t\t\tformatType.name,\n\t\t\t\t\t0,\n\t\t\t\t\tvalue.text.length\n\t\t\t\t);\n\t\t\t}\n\t\t} );\n\n\t\treturn value.formats;\n\t}\n\n\tfunction addInvisibleFormats( value ) {\n\t\treturn prepareHandlers.reduce(\n\t\t\t( accumulator, fn ) => fn( accumulator, value.text ),\n\t\t\tvalue.formats\n\t\t);\n\t}\n\n\tconst {\n\t\tvalue,\n\t\tgetValue,\n\t\tonChange,\n\t\tref: richTextRef,\n\t} = useRichText( {\n\t\tvalue: adjustedValue,\n\t\tonChange( html, { __unstableFormats, __unstableText } ) {\n\t\t\tadjustedOnChange( html );\n\t\t\tObject.values( changeHandlers ).forEach( ( changeHandler ) => {\n\t\t\t\tchangeHandler( __unstableFormats, __unstableText );\n\t\t\t} );\n\t\t},\n\t\tselectionStart,\n\t\tselectionEnd,\n\t\tonSelectionChange,\n\t\tplaceholder: bindingsPlaceholder || placeholder,\n\t\t__unstableIsSelected: isSelected,\n\t\t__unstableDisableFormats: disableFormats,\n\t\tpreserveWhiteSpace,\n\t\t__unstableDependencies: [ ...dependencies, tagName ],\n\t\t__unstableAfterParse: addEditorOnlyFormats,\n\t\t__unstableBeforeSerialize: removeEditorOnlyFormats,\n\t\t__unstableAddInvisibleFormats: addInvisibleFormats,\n\t} );\n\tconst autocompleteProps = useBlockEditorAutocompleteProps( {\n\t\tonReplace,\n\t\tcompleters: autocompleters,\n\t\trecord: value,\n\t\tonChange,\n\t} );\n\n\tuseMarkPersistent( { html: adjustedValue, value } );\n\n\tconst keyboardShortcuts = useRef( new Set() );\n\tconst inputEvents = useRef( new Set() );\n\n\tfunction onFocus() {\n\t\tanchorRef.current?.focus();\n\t}\n\n\tconst TagName = tagName;\n\treturn (\n\t\t<>\n\t\t\t{ isSelected && (\n\t\t\t\t<keyboardShortcutContext.Provider value={ keyboardShortcuts }>\n\t\t\t\t\t<inputEventContext.Provider value={ inputEvents }>\n\t\t\t\t\t\t<Popover.__unstableSlotNameProvider value=\"__unstable-block-tools-after\">\n\t\t\t\t\t\t\t{ children &&\n\t\t\t\t\t\t\t\tchildren( { value, onChange, onFocus } ) }\n\n\t\t\t\t\t\t\t<FormatEdit\n\t\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\t\t\tformatTypes={ formatTypes }\n\t\t\t\t\t\t\t\tforwardedRef={ anchorRef }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Popover.__unstableSlotNameProvider>\n\t\t\t\t\t</inputEventContext.Provider>\n\t\t\t\t</keyboardShortcutContext.Provider>\n\t\t\t) }\n\t\t\t{ isSelected && hasFormats && (\n\t\t\t\t<FormatToolbarContainer\n\t\t\t\t\tinline={ inlineToolbar }\n\t\t\t\t\teditableContentElement={ anchorRef.current }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<TagName\n\t\t\t\t// Overridable props.\n\t\t\t\trole=\"textbox\"\n\t\t\t\taria-multiline={ ! disableLineBreaks }\n\t\t\t\taria-readonly={ shouldDisableEditing }\n\t\t\t\t{ ...props }\n\t\t\t\t// Unset draggable (coming from block props) for contentEditable\n\t\t\t\t// elements because it will interfere with multi block selection\n\t\t\t\t// when the contentEditable and draggable elements are the same\n\t\t\t\t// element.\n\t\t\t\tdraggable={ undefined }\n\t\t\t\taria-label={\n\t\t\t\t\tbindingsLabel || props[ 'aria-label' ] || placeholder\n\t\t\t\t}\n\t\t\t\t{ ...autocompleteProps }\n\t\t\t\tref={ useMergeRefs( [\n\t\t\t\t\t// Rich text ref must be first because its focus listener\n\t\t\t\t\t// must be set up before any other ref calls .focus() on\n\t\t\t\t\t// mount.\n\t\t\t\t\trichTextRef,\n\t\t\t\t\tforwardedRef,\n\t\t\t\t\tautocompleteProps.ref,\n\t\t\t\t\tprops.ref,\n\t\t\t\t\tuseEventListeners( {\n\t\t\t\t\t\tregistry,\n\t\t\t\t\t\tgetValue,\n\t\t\t\t\t\tonChange,\n\t\t\t\t\t\t__unstableAllowPrefixTransformations,\n\t\t\t\t\t\tformatTypes,\n\t\t\t\t\t\tonReplace,\n\t\t\t\t\t\tselectionChange,\n\t\t\t\t\t\tisSelected,\n\t\t\t\t\t\tdisableFormats,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\ttagName,\n\t\t\t\t\t\tonSplit,\n\t\t\t\t\t\t__unstableEmbedURLOnPaste,\n\t\t\t\t\t\tpastePlainText,\n\t\t\t\t\t\tonMerge,\n\t\t\t\t\t\tonRemove,\n\t\t\t\t\t\tremoveEditorOnlyFormats,\n\t\t\t\t\t\tdisableLineBreaks,\n\t\t\t\t\t\tonSplitAtEnd,\n\t\t\t\t\t\tonSplitAtDoubleLineEnd,\n\t\t\t\t\t\tkeyboardShortcuts,\n\t\t\t\t\t\tinputEvents,\n\t\t\t\t\t} ),\n\t\t\t\t\tanchorRef,\n\t\t\t\t] ) }\n\t\t\t\tcontentEditable={ ! shouldDisableEditing }\n\t\t\t\tsuppressContentEditableWarning\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'block-editor-rich-text__editable',\n\t\t\t\t\tprops.className,\n\t\t\t\t\t'rich-text'\n\t\t\t\t) }\n\t\t\t\t// Setting tabIndex to 0 is unnecessary, the element is already\n\t\t\t\t// focusable because it's contentEditable. This also fixes a\n\t\t\t\t// Safari bug where it's not possible to Shift+Click multi\n\t\t\t\t// select blocks when Shift Clicking into an element with\n\t\t\t\t// tabIndex because Safari will focus the element. However,\n\t\t\t\t// Safari will correctly ignore nested contentEditable elements.\n\t\t\t\ttabIndex={\n\t\t\t\t\tprops.tabIndex === 0 && ! shouldDisableEditing\n\t\t\t\t\t\t? null\n\t\t\t\t\t\t: props.tabIndex\n\t\t\t\t}\n\t\t\t\tdata-wp-block-attribute-key={ identifier }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\n// This is the private API for the RichText component.\n// It allows access to all props, not just the public ones.\nexport const PrivateRichText = withDeprecations(\n\tforwardRef( RichTextWrapper )\n);\n\nPrivateRichText.Content = Content;\nPrivateRichText.isEmpty = ( value ) => {\n\treturn ! value || value.length === 0;\n};\n\n// This is the public API for the RichText component.\n// We wrap the PrivateRichText component to hide some props from the public API.\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/rich-text/README.md\n */\nconst PublicForwardedRichTextContainer = forwardRef( ( props, ref ) => {\n\tconst context = useBlockEditContext();\n\tconst isPreviewMode = context[ isPreviewModeKey ];\n\n\tif ( isPreviewMode ) {\n\t\t// Remove all non-content props.\n\t\tconst {\n\t\t\tchildren,\n\t\t\ttagName: Tag = 'div',\n\t\t\tvalue,\n\t\t\tonChange,\n\t\t\tisSelected,\n\t\t\tmultiline,\n\t\t\tinlineToolbar,\n\t\t\twrapperClassName,\n\t\t\tautocompleters,\n\t\t\tonReplace,\n\t\t\tplaceholder,\n\t\t\tallowedFormats,\n\t\t\twithoutInteractiveFormatting,\n\t\t\tonRemove,\n\t\t\tonMerge,\n\t\t\tonSplit,\n\t\t\t__unstableOnSplitAtEnd,\n\t\t\t__unstableOnSplitAtDoubleLineEnd,\n\t\t\tidentifier,\n\t\t\tpreserveWhiteSpace,\n\t\t\t__unstablePastePlainText,\n\t\t\t__unstableEmbedURLOnPaste,\n\t\t\t__unstableDisableFormats,\n\t\t\tdisableLineBreaks,\n\t\t\t__unstableAllowPrefixTransformations,\n\t\t\treadOnly,\n\t\t\t...contentProps\n\t\t} = removeNativeProps( props );\n\t\treturn (\n\t\t\t<Tag\n\t\t\t\t{ ...contentProps }\n\t\t\t\tdangerouslySetInnerHTML={ {\n\t\t\t\t\t__html: valueToHTMLString( value, multiline ),\n\t\t\t\t} }\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn <PrivateRichText ref={ ref } { ...props } readOnly={ false } />;\n} );\n\nPublicForwardedRichTextContainer.Content = Content;\nPublicForwardedRichTextContainer.isEmpty = ( value ) => {\n\treturn ! value || value.length === 0;\n};\n\nexport default PublicForwardedRichTextContainer;\nexport { RichTextShortcut } from './shortcut';\nexport { RichTextToolbarButton } from './toolbar-button';\nexport { __unstableRichTextInputEvent } from './input-event';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAOA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AAIA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,KAAA,GAAAR,OAAA;AAKA,IAAAS,aAAA,GAAAT,OAAA;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AAuB,EAAG;QACzBC,MAAM,EAAE,IAAAC,0BAAiB,EAAElL,KAAK,EAAEM,SAAU;MAC7C;IAAG,CACH,CAAC;EAEJ;EAEA,oBAAO,IAAArC,WAAA,CAAAqL,GAAA,EAACgB,eAAe;IAAC5C,GAAG,EAAGA,GAAK;IAAA,GAAM9I,KAAK;IAAGkD,QAAQ,EAAG;EAAO,CAAE,CAAC;AACvE,CAAE,CAAC;AAEH6I,gCAAgC,CAACF,OAAO,GAAGA,gBAAO;AAClDE,gCAAgC,CAACD,OAAO,GAAK1K,KAAK,IAAM;EACvD,OAAO,CAAEA,KAAK,IAAIA,KAAK,CAAC0E,MAAM,KAAK,CAAC;AACrC,CAAC;AAAC,IAAAyG,QAAA,GAAA7M,OAAA,CAAAoL,OAAA,GAEaiB,gCAAgC","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":["_element","require","_data","_richText","formatTypesSelector","select","richTextStore","getFormatTypes","interactiveContentTags","Set","useFormatTypes","clientId","identifier","withoutInteractiveFormatting","allowedFormats","allFormatTypes","useSelect","formatTypes","useMemo","filter","name","tagName","includes","has","keyedSelected","reduce","accumulator","type","__experimentalGetPropsForEditableTreePreparation","richTextIdentifier","blockClientId","dispatch","useDispatch","prepareHandlers","valueHandlers","changeHandlers","dependencies","forEach","__experimentalCreatePrepareEditableTree","selected","handler","__experimentalCreateOnChangeEditableValue","push","key","dispatchers","__experimentalGetPropsForEditableTreeChangeHandler"],"sources":["@wordpress/block-editor/src/components/rich-text/native/use-format-types.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as richTextStore } from '@wordpress/rich-text';\n\nfunction formatTypesSelector( select ) {\n\treturn select( richTextStore ).getFormatTypes();\n}\n\n/**\n * Set of all interactive content tags.\n *\n * @see https://html.spec.whatwg.org/multipage/dom.html#interactive-content\n */\nconst interactiveContentTags = new Set( [\n\t'a',\n\t'audio',\n\t'button',\n\t'details',\n\t'embed',\n\t'iframe',\n\t'input',\n\t'label',\n\t'select',\n\t'textarea',\n\t'video',\n] );\n\n/**\n * This hook provides RichText with the `formatTypes` and its derived props from\n * experimental format type settings.\n *\n * @param {Object} $0 Options\n * @param {string} $0.clientId Block client ID.\n * @param {string} $0.identifier Block attribute.\n * @param {boolean} $0.withoutInteractiveFormatting Whether to clean the interactive formattings or not.\n * @param {Array} $0.allowedFormats Allowed formats\n */\nexport function useFormatTypes( {\n\tclientId,\n\tidentifier,\n\twithoutInteractiveFormatting,\n\tallowedFormats,\n} ) {\n\tconst allFormatTypes = useSelect( formatTypesSelector, [] );\n\tconst formatTypes = useMemo( () => {\n\t\treturn allFormatTypes.filter( ( { name, tagName } ) => {\n\t\t\tif ( allowedFormats && ! allowedFormats.includes( name ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\twithoutInteractiveFormatting &&\n\t\t\t\tinteractiveContentTags.has( tagName )\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t} );\n\t}, [ allFormatTypes, allowedFormats, interactiveContentTags ] );\n\tconst keyedSelected = useSelect(\n\t\t( select ) =>\n\t\t\tformatTypes.reduce( ( accumulator, type ) => {\n\t\t\t\tif ( type.__experimentalGetPropsForEditableTreePreparation ) {\n\t\t\t\t\taccumulator[ type.name ] =\n\t\t\t\t\t\ttype.__experimentalGetPropsForEditableTreePreparation(\n\t\t\t\t\t\t\tselect,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\trichTextIdentifier: identifier,\n\t\t\t\t\t\t\t\tblockClientId: clientId,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn accumulator;\n\t\t\t}, {} ),\n\t\t[ formatTypes, clientId, identifier ]\n\t);\n\tconst dispatch = useDispatch();\n\tconst prepareHandlers = [];\n\tconst valueHandlers = [];\n\tconst changeHandlers = [];\n\tconst dependencies = [];\n\n\tformatTypes.forEach( ( type ) => {\n\t\tif ( type.__experimentalCreatePrepareEditableTree ) {\n\t\t\tconst selected = keyedSelected[ type.name ];\n\t\t\tconst handler = type.__experimentalCreatePrepareEditableTree(\n\t\t\t\tselected,\n\t\t\t\t{\n\t\t\t\t\trichTextIdentifier: identifier,\n\t\t\t\t\tblockClientId: clientId,\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tif ( type.__experimentalCreateOnChangeEditableValue ) {\n\t\t\t\tvalueHandlers.push( handler );\n\t\t\t} else {\n\t\t\t\tprepareHandlers.push( handler );\n\t\t\t}\n\n\t\t\tfor ( const key in selected ) {\n\t\t\t\tdependencies.push( selected[ key ] );\n\t\t\t}\n\t\t}\n\n\t\tif ( type.__experimentalCreateOnChangeEditableValue ) {\n\t\t\tlet dispatchers = {};\n\n\t\t\tif ( type.__experimentalGetPropsForEditableTreeChangeHandler ) {\n\t\t\t\tdispatchers =\n\t\t\t\t\ttype.__experimentalGetPropsForEditableTreeChangeHandler(\n\t\t\t\t\t\tdispatch,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\trichTextIdentifier: identifier,\n\t\t\t\t\t\t\tblockClientId: clientId,\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t}\n\n\t\t\tchangeHandlers.push(\n\t\t\t\ttype.__experimentalCreateOnChangeEditableValue(\n\t\t\t\t\t{\n\t\t\t\t\t\t...( keyedSelected[ type.name ] || {} ),\n\t\t\t\t\t\t...dispatchers,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\trichTextIdentifier: identifier,\n\t\t\t\t\t\tblockClientId: clientId,\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t} );\n\n\treturn {\n\t\tformatTypes,\n\t\tprepareHandlers,\n\t\tvalueHandlers,\n\t\tchangeHandlers,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AAI,CAACkB,kDAAkD,CACtDd,QAAQ,EACR;UACCF,kBAAkB,EAAEjB,UAAU;UAC9BkB,aAAa,EAAEnB;QAChB,CACD,CAAC;MACH;MAEAwB,cAAc,CAACO,IAAI,CAClBf,IAAI,CAACc,yCAAyC,CAC7C;QACC,IAAKjB,aAAa,CAAEG,IAAI,CAACP,IAAI,CAAE,IAAI,CAAC,CAAC,CAAE;QACvC,GAAGwB;MACJ,CAAC,EACD;QACCf,kBAAkB,EAAEjB,UAAU;QAC9BkB,aAAa,EAAEnB;MAChB,CACD,CACD,CAAC;IACF;EACD,CAAE,CAAC;EAEH,OAAO;IACNM,WAAW;IACXgB,eAAe;IACfC,aAAa;IACbC,cAAc;IACdC;EACD,CAAC;AACF","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","_data","_richText","formatTypesSelector","select","richTextStore","getFormatTypes","interactiveContentTags","Set","useFormatTypes","clientId","identifier","withoutInteractiveFormatting","allowedFormats","allFormatTypes","useSelect","formatTypes","useMemo","filter","name","tagName","includes","has","keyedSelected","reduce","accumulator","type","__experimentalGetPropsForEditableTreePreparation","richTextIdentifier","blockClientId","dispatch","useDispatch","prepareHandlers","valueHandlers","changeHandlers","dependencies","forEach","__experimentalCreatePrepareEditableTree","selected","handler","__experimentalCreateOnChangeEditableValue","push","key","dispatchers","__experimentalGetPropsForEditableTreeChangeHandler"],"sources":["@wordpress/block-editor/src/components/rich-text/native/use-format-types.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as richTextStore } from '@wordpress/rich-text';\n\nfunction formatTypesSelector( select ) {\n\treturn select( richTextStore ).getFormatTypes();\n}\n\n/**\n * Set of all interactive content tags.\n *\n * @see https://html.spec.whatwg.org/multipage/dom.html#interactive-content\n */\nconst interactiveContentTags = new Set( [\n\t'a',\n\t'audio',\n\t'button',\n\t'details',\n\t'embed',\n\t'iframe',\n\t'input',\n\t'label',\n\t'select',\n\t'textarea',\n\t'video',\n] );\n\n/**\n * This hook provides RichText with the `formatTypes` and its derived props from\n * experimental format type settings.\n *\n * @param {Object} $0 Options\n * @param {string} $0.clientId Block client ID.\n * @param {string} $0.identifier Block attribute.\n * @param {boolean} $0.withoutInteractiveFormatting Whether to clean the interactive formattings or not.\n * @param {Array} $0.allowedFormats Allowed formats\n */\nexport function useFormatTypes( {\n\tclientId,\n\tidentifier,\n\twithoutInteractiveFormatting,\n\tallowedFormats,\n} ) {\n\tconst allFormatTypes = useSelect( formatTypesSelector, [] );\n\tconst formatTypes = useMemo( () => {\n\t\treturn allFormatTypes.filter( ( { name, tagName } ) => {\n\t\t\tif ( allowedFormats && ! allowedFormats.includes( name ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\twithoutInteractiveFormatting &&\n\t\t\t\tinteractiveContentTags.has( tagName )\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t} );\n\t}, [ allFormatTypes, allowedFormats, interactiveContentTags ] );\n\tconst keyedSelected = useSelect(\n\t\t( select ) =>\n\t\t\tformatTypes.reduce( ( accumulator, type ) => {\n\t\t\t\tif ( type.__experimentalGetPropsForEditableTreePreparation ) {\n\t\t\t\t\taccumulator[ type.name ] =\n\t\t\t\t\t\ttype.__experimentalGetPropsForEditableTreePreparation(\n\t\t\t\t\t\t\tselect,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\trichTextIdentifier: identifier,\n\t\t\t\t\t\t\t\tblockClientId: clientId,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn accumulator;\n\t\t\t}, {} ),\n\t\t[ formatTypes, clientId, identifier ]\n\t);\n\tconst dispatch = useDispatch();\n\tconst prepareHandlers = [];\n\tconst valueHandlers = [];\n\tconst changeHandlers = [];\n\tconst dependencies = [];\n\n\tformatTypes.forEach( ( type ) => {\n\t\tif ( type.__experimentalCreatePrepareEditableTree ) {\n\t\t\tconst selected = keyedSelected[ type.name ];\n\t\t\tconst handler = type.__experimentalCreatePrepareEditableTree(\n\t\t\t\tselected,\n\t\t\t\t{\n\t\t\t\t\trichTextIdentifier: identifier,\n\t\t\t\t\tblockClientId: clientId,\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tif ( type.__experimentalCreateOnChangeEditableValue ) {\n\t\t\t\tvalueHandlers.push( handler );\n\t\t\t} else {\n\t\t\t\tprepareHandlers.push( handler );\n\t\t\t}\n\n\t\t\tfor ( const key in selected ) {\n\t\t\t\tdependencies.push( selected[ key ] );\n\t\t\t}\n\t\t}\n\n\t\tif ( type.__experimentalCreateOnChangeEditableValue ) {\n\t\t\tlet dispatchers = {};\n\n\t\t\tif ( type.__experimentalGetPropsForEditableTreeChangeHandler ) {\n\t\t\t\tdispatchers =\n\t\t\t\t\ttype.__experimentalGetPropsForEditableTreeChangeHandler(\n\t\t\t\t\t\tdispatch,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\trichTextIdentifier: identifier,\n\t\t\t\t\t\t\tblockClientId: clientId,\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t}\n\n\t\t\tchangeHandlers.push(\n\t\t\t\ttype.__experimentalCreateOnChangeEditableValue(\n\t\t\t\t\t{\n\t\t\t\t\t\t...( keyedSelected[ type.name ] || {} ),\n\t\t\t\t\t\t...dispatchers,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\trichTextIdentifier: identifier,\n\t\t\t\t\t\tblockClientId: clientId,\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t} );\n\n\treturn {\n\t\tformatTypes,\n\t\tprepareHandlers,\n\t\tvalueHandlers,\n\t\tchangeHandlers,\n\t\tdependencies,\n\t};\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAL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,CAClBf,IAAI,CAACc,yCAAyC,CAC7C;QACC,IAAKjB,aAAa,CAAEG,IAAI,CAACP,IAAI,CAAE,IAAI,CAAC,CAAC,CAAE;QACvC,GAAGwB;MACJ,CAAC,EACD;QACCf,kBAAkB,EAAEjB,UAAU;QAC9BkB,aAAa,EAAEnB;MAChB,CACD,CACD,CAAC;IACF;EACD,CAAE,CAAC;EAEH,OAAO;IACNM,WAAW;IACXgB,eAAe;IACfC,aAAa;IACbC,cAAc;IACdC;EACD,CAAC;AACF","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":["_element","require","_data","_richText","formatTypesSelector","select","richTextStore","getFormatTypes","interactiveContentTags","Set","prefixSelectKeys","selected","prefix","Object","fromEntries","entries","map","key","value","getPrefixedSelectKeys","keys","filter","startsWith","reduce","accumulator","slice","length","useFormatTypes","clientId","identifier","withoutInteractiveFormatting","allowedFormats","allFormatTypes","useSelect","formatTypes","useMemo","name","interactive","tagName","includes","has","keyedSelected","type","__experimentalGetPropsForEditableTreePreparation","richTextIdentifier","blockClientId","dispatch","useDispatch","prepareHandlers","valueHandlers","changeHandlers","dependencies","push","forEach","__experimentalCreatePrepareEditableTree","handler","__experimentalCreateOnChangeEditableValue","dispatchers","__experimentalGetPropsForEditableTreeChangeHandler"],"sources":["@wordpress/block-editor/src/components/rich-text/use-format-types.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as richTextStore } from '@wordpress/rich-text';\n\nfunction formatTypesSelector( select ) {\n\treturn select( richTextStore ).getFormatTypes();\n}\n\n/**\n * Set of all interactive content tags.\n *\n * @see https://html.spec.whatwg.org/multipage/dom.html#interactive-content\n */\nconst interactiveContentTags = new Set( [\n\t'a',\n\t'audio',\n\t'button',\n\t'details',\n\t'embed',\n\t'iframe',\n\t'input',\n\t'label',\n\t'select',\n\t'textarea',\n\t'video',\n] );\n\nfunction prefixSelectKeys( selected, prefix ) {\n\tif ( typeof selected !== 'object' ) {\n\t\treturn { [ prefix ]: selected };\n\t}\n\treturn Object.fromEntries(\n\t\tObject.entries( selected ).map( ( [ key, value ] ) => [\n\t\t\t`${ prefix }.${ key }`,\n\t\t\tvalue,\n\t\t] )\n\t);\n}\n\nfunction getPrefixedSelectKeys( selected, prefix ) {\n\tif ( selected[ prefix ] ) {\n\t\treturn selected[ prefix ];\n\t}\n\treturn Object.keys( selected )\n\t\t.filter( ( key ) => key.startsWith( prefix + '.' ) )\n\t\t.reduce( ( accumulator, key ) => {\n\t\t\taccumulator[ key.slice( prefix.length + 1 ) ] = selected[ key ];\n\t\t\treturn accumulator;\n\t\t}, {} );\n}\n\n/**\n * This hook provides RichText with the `formatTypes` and its derived props from\n * experimental format type settings.\n *\n * @param {Object} $0 Options\n * @param {string} $0.clientId Block client ID.\n * @param {string} $0.identifier Block attribute.\n * @param {boolean} $0.withoutInteractiveFormatting Whether to clean the interactive formattings or not.\n * @param {Array} $0.allowedFormats Allowed formats\n */\nexport function useFormatTypes( {\n\tclientId,\n\tidentifier,\n\twithoutInteractiveFormatting,\n\tallowedFormats,\n} ) {\n\tconst allFormatTypes = useSelect( formatTypesSelector, [] );\n\tconst formatTypes = useMemo( () => {\n\t\treturn allFormatTypes.filter( ( { name, interactive, tagName } ) => {\n\t\t\tif ( allowedFormats && ! allowedFormats.includes( name ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\twithoutInteractiveFormatting &&\n\t\t\t\t( interactive || interactiveContentTags.has( tagName ) )\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t} );\n\t}, [ allFormatTypes, allowedFormats, withoutInteractiveFormatting ] );\n\tconst keyedSelected = useSelect(\n\t\t( select ) =>\n\t\t\tformatTypes.reduce( ( accumulator, type ) => {\n\t\t\t\tif ( ! type.__experimentalGetPropsForEditableTreePreparation ) {\n\t\t\t\t\treturn accumulator;\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\t...accumulator,\n\t\t\t\t\t...prefixSelectKeys(\n\t\t\t\t\t\ttype.__experimentalGetPropsForEditableTreePreparation(\n\t\t\t\t\t\t\tselect,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\trichTextIdentifier: identifier,\n\t\t\t\t\t\t\t\tblockClientId: clientId,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t),\n\t\t\t\t\t\ttype.name\n\t\t\t\t\t),\n\t\t\t\t};\n\t\t\t}, {} ),\n\t\t[ formatTypes, clientId, identifier ]\n\t);\n\tconst dispatch = useDispatch();\n\tconst prepareHandlers = [];\n\tconst valueHandlers = [];\n\tconst changeHandlers = [];\n\tconst dependencies = [];\n\n\tfor ( const key in keyedSelected ) {\n\t\tdependencies.push( keyedSelected[ key ] );\n\t}\n\n\tformatTypes.forEach( ( type ) => {\n\t\tif ( type.__experimentalCreatePrepareEditableTree ) {\n\t\t\tconst handler = type.__experimentalCreatePrepareEditableTree(\n\t\t\t\tgetPrefixedSelectKeys( keyedSelected, type.name ),\n\t\t\t\t{\n\t\t\t\t\trichTextIdentifier: identifier,\n\t\t\t\t\tblockClientId: clientId,\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tif ( type.__experimentalCreateOnChangeEditableValue ) {\n\t\t\t\tvalueHandlers.push( handler );\n\t\t\t} else {\n\t\t\t\tprepareHandlers.push( handler );\n\t\t\t}\n\t\t}\n\n\t\tif ( type.__experimentalCreateOnChangeEditableValue ) {\n\t\t\tlet dispatchers = {};\n\n\t\t\tif ( type.__experimentalGetPropsForEditableTreeChangeHandler ) {\n\t\t\t\tdispatchers =\n\t\t\t\t\ttype.__experimentalGetPropsForEditableTreeChangeHandler(\n\t\t\t\t\t\tdispatch,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\trichTextIdentifier: identifier,\n\t\t\t\t\t\t\tblockClientId: clientId,\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst selected = getPrefixedSelectKeys( keyedSelected, type.name );\n\t\t\tchangeHandlers.push(\n\t\t\t\ttype.__experimentalCreateOnChangeEditableValue(\n\t\t\t\t\t{\n\t\t\t\t\t\t...( typeof selected === 'object' ? selected : {} ),\n\t\t\t\t\t\t...dispatchers,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\trichTextIdentifier: identifier,\n\t\t\t\t\t\tblockClientId: clientId,\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t} );\n\n\treturn {\n\t\tformatTypes,\n\t\tprepareHandlers,\n\t\tvalueHandlers,\n\t\tchangeHandlers,\n\t\tdependencies,\n\t};\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AALA;AACA;AACA;;AAKA,SAASG,mBAAmBA,CAAEC,MAAM,EAAG;EACtC,OAAOA,MAAM,CAAEC,eAAc,CAAC,CAACC,cAAc,CAAC,CAAC;AAChD;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAMC,sBAAsB,GAAG,IAAIC,GAAG,CAAE,CACvC,GAAG,EACH,OAAO,EACP,QAAQ,EACR,SAAS,EACT,OAAO,EACP,QAAQ,EACR,OAAO,EACP,OAAO,EACP,QAAQ,EACR,UAAU,EACV,OAAO,CACN,CAAC;AAEH,SAASC,gBAAgBA,CAAEC,QAAQ,EAAEC,MAAM,EAAG;EAC7C,IAAK,OAAOD,QAAQ,KAAK,QAAQ,EAAG;IACnC,OAAO;MAAE,CAAEC,MAAM,GAAID;IAAS,CAAC;EAChC;EACA,OAAOE,MAAM,CAACC,WAAW,CACxBD,MAAM,CAACE,OAAO,CAAEJ,QAAS,CAAC,CAACK,GAAG,CAAE,CAAE,CAAEC,GAAG,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,CAAC,MAAM;QACNP,eAAe,CAACI,IAAI,CAAEG,OAAQ,CAAC;MAChC;IACD;IAEA,IAAKb,IAAI,CAACc,yCAAyC,EAAG;MACrD,IAAIC,WAAW,GAAG,CAAC,CAAC;MAEpB,IAAKf,IAAI,CAACgB,kDAAkD,EAAG;QAC9DD,WAAW,GACVf,IAAI,CAACgB,kDAAkD,CACtDZ,QAAQ,EACR;UACCF,kBAAkB,EAAEf,UAAU;UAC9BgB,aAAa,EAAEjB;QAChB,CACD,CAAC;MACH;MAEA,MAAMjB,QAAQ,GAAGQ,qBAAqB,CAAEsB,aAAa,EAAEC,IAAI,CAACN,IAAK,CAAC;MAClEc,cAAc,CAACE,IAAI,CAClBV,IAAI,CAACc,yCAAyC,CAC7C;QACC,IAAK,OAAO7C,QAAQ,KAAK,QAAQ,GAAGA,QAAQ,GAAG,CAAC,CAAC,CAAE;QACnD,GAAG8C;MACJ,CAAC,EACD;QACCb,kBAAkB,EAAEf,UAAU;QAC9BgB,aAAa,EAAEjB;MAChB,CACD,CACD,CAAC;IACF;EACD,CAAE,CAAC;EAEH,OAAO;IACNM,WAAW;IACXc,eAAe;IACfC,aAAa;IACbC,cAAc;IACdC;EACD,CAAC;AACF","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","_data","_richText","formatTypesSelector","select","richTextStore","getFormatTypes","interactiveContentTags","Set","prefixSelectKeys","selected","prefix","Object","fromEntries","entries","map","key","value","getPrefixedSelectKeys","keys","filter","startsWith","reduce","accumulator","slice","length","useFormatTypes","clientId","identifier","withoutInteractiveFormatting","allowedFormats","allFormatTypes","useSelect","formatTypes","useMemo","name","interactive","tagName","includes","has","keyedSelected","type","__experimentalGetPropsForEditableTreePreparation","richTextIdentifier","blockClientId","dispatch","useDispatch","prepareHandlers","valueHandlers","changeHandlers","dependencies","push","forEach","__experimentalCreatePrepareEditableTree","handler","__experimentalCreateOnChangeEditableValue","dispatchers","__experimentalGetPropsForEditableTreeChangeHandler"],"sources":["@wordpress/block-editor/src/components/rich-text/use-format-types.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as richTextStore } from '@wordpress/rich-text';\n\nfunction formatTypesSelector( select ) {\n\treturn select( richTextStore ).getFormatTypes();\n}\n\n/**\n * Set of all interactive content tags.\n *\n * @see https://html.spec.whatwg.org/multipage/dom.html#interactive-content\n */\nconst interactiveContentTags = new Set( [\n\t'a',\n\t'audio',\n\t'button',\n\t'details',\n\t'embed',\n\t'iframe',\n\t'input',\n\t'label',\n\t'select',\n\t'textarea',\n\t'video',\n] );\n\nfunction prefixSelectKeys( selected, prefix ) {\n\tif ( typeof selected !== 'object' ) {\n\t\treturn { [ prefix ]: selected };\n\t}\n\treturn Object.fromEntries(\n\t\tObject.entries( selected ).map( ( [ key, value ] ) => [\n\t\t\t`${ prefix }.${ key }`,\n\t\t\tvalue,\n\t\t] )\n\t);\n}\n\nfunction getPrefixedSelectKeys( selected, prefix ) {\n\tif ( selected[ prefix ] ) {\n\t\treturn selected[ prefix ];\n\t}\n\treturn Object.keys( selected )\n\t\t.filter( ( key ) => key.startsWith( prefix + '.' ) )\n\t\t.reduce( ( accumulator, key ) => {\n\t\t\taccumulator[ key.slice( prefix.length + 1 ) ] = selected[ key ];\n\t\t\treturn accumulator;\n\t\t}, {} );\n}\n\n/**\n * This hook provides RichText with the `formatTypes` and its derived props from\n * experimental format type settings.\n *\n * @param {Object} $0 Options\n * @param {string} $0.clientId Block client ID.\n * @param {string} $0.identifier Block attribute.\n * @param {boolean} $0.withoutInteractiveFormatting Whether to clean the interactive formattings or not.\n * @param {Array} $0.allowedFormats Allowed formats\n */\nexport function useFormatTypes( {\n\tclientId,\n\tidentifier,\n\twithoutInteractiveFormatting,\n\tallowedFormats,\n} ) {\n\tconst allFormatTypes = useSelect( formatTypesSelector, [] );\n\tconst formatTypes = useMemo( () => {\n\t\treturn allFormatTypes.filter( ( { name, interactive, tagName } ) => {\n\t\t\tif ( allowedFormats && ! allowedFormats.includes( name ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\twithoutInteractiveFormatting &&\n\t\t\t\t( interactive || interactiveContentTags.has( tagName ) )\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t} );\n\t}, [ allFormatTypes, allowedFormats, withoutInteractiveFormatting ] );\n\tconst keyedSelected = useSelect(\n\t\t( select ) =>\n\t\t\tformatTypes.reduce( ( accumulator, type ) => {\n\t\t\t\tif ( ! type.__experimentalGetPropsForEditableTreePreparation ) {\n\t\t\t\t\treturn accumulator;\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\t...accumulator,\n\t\t\t\t\t...prefixSelectKeys(\n\t\t\t\t\t\ttype.__experimentalGetPropsForEditableTreePreparation(\n\t\t\t\t\t\t\tselect,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\trichTextIdentifier: identifier,\n\t\t\t\t\t\t\t\tblockClientId: clientId,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t),\n\t\t\t\t\t\ttype.name\n\t\t\t\t\t),\n\t\t\t\t};\n\t\t\t}, {} ),\n\t\t[ formatTypes, clientId, identifier ]\n\t);\n\tconst dispatch = useDispatch();\n\tconst prepareHandlers = [];\n\tconst valueHandlers = [];\n\tconst changeHandlers = [];\n\tconst dependencies = [];\n\n\tfor ( const key in keyedSelected ) {\n\t\tdependencies.push( keyedSelected[ key ] );\n\t}\n\n\tformatTypes.forEach( ( type ) => {\n\t\tif ( type.__experimentalCreatePrepareEditableTree ) {\n\t\t\tconst handler = type.__experimentalCreatePrepareEditableTree(\n\t\t\t\tgetPrefixedSelectKeys( keyedSelected, type.name ),\n\t\t\t\t{\n\t\t\t\t\trichTextIdentifier: identifier,\n\t\t\t\t\tblockClientId: clientId,\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tif ( type.__experimentalCreateOnChangeEditableValue ) {\n\t\t\t\tvalueHandlers.push( handler );\n\t\t\t} else {\n\t\t\t\tprepareHandlers.push( handler );\n\t\t\t}\n\t\t}\n\n\t\tif ( type.__experimentalCreateOnChangeEditableValue ) {\n\t\t\tlet dispatchers = {};\n\n\t\t\tif ( type.__experimentalGetPropsForEditableTreeChangeHandler ) {\n\t\t\t\tdispatchers =\n\t\t\t\t\ttype.__experimentalGetPropsForEditableTreeChangeHandler(\n\t\t\t\t\t\tdispatch,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\trichTextIdentifier: identifier,\n\t\t\t\t\t\t\tblockClientId: clientId,\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst selected = getPrefixedSelectKeys( keyedSelected, type.name );\n\t\t\tchangeHandlers.push(\n\t\t\t\ttype.__experimentalCreateOnChangeEditableValue(\n\t\t\t\t\t{\n\t\t\t\t\t\t...( typeof selected === 'object' ? selected : {} ),\n\t\t\t\t\t\t...dispatchers,\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\trichTextIdentifier: identifier,\n\t\t\t\t\t\tblockClientId: clientId,\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t} );\n\n\treturn {\n\t\tformatTypes,\n\t\tprepareHandlers,\n\t\tvalueHandlers,\n\t\tchangeHandlers,\n\t\tdependencies,\n\t};\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AALA;AACA;AACA;;AAKA,SAASG,mBAAmBA,CAAEC,MAAM,EAAG;EACtC,OAAOA,MAAM,CAAEC,eAAc,CAAC,CAACC,cAAc,CAAC,CAAC;AAChD;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAMC,sBAAsB,GAAG,IAAIC,GAAG,CAAE,CACvC,GAAG,EACH,OAAO,EACP,QAAQ,EACR,SAAS,EACT,OAAO,EACP,QAAQ,EACR,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IX,IAAI,IAAM;IAChC,IAAKA,IAAI,CAACY,uCAAuC,EAAG;MACnD,MAAMC,OAAO,GAAGb,IAAI,CAACY,uCAAuC,CAC3DnC,qBAAqB,CAAEsB,aAAa,EAAEC,IAAI,CAACN,IAAK,CAAC,EACjD;QACCQ,kBAAkB,EAAEf,UAAU;QAC9BgB,aAAa,EAAEjB;MAChB,CACD,CAAC;MAED,IAAKc,IAAI,CAACc,yCAAyC,EAAG;QACrDP,aAAa,CAACG,IAAI,CAAEG,OAAQ,CAAC;MAC9B,CAAC,MAAM;QACNP,eAAe,CAACI,IAAI,CAAEG,OAAQ,CAAC;MAChC;IACD;IAEA,IAAKb,IAAI,CAACc,yCAAyC,EAAG;MACrD,IAAIC,WAAW,GAAG,CAAC,CAAC;MAEpB,IAAKf,IAAI,CAACgB,kDAAkD,EAAG;QAC9DD,WAAW,GACVf,IAAI,CAACgB,kDAAkD,CACtDZ,QAAQ,EACR;UACCF,kBAAkB,EAAEf,UAAU;UAC9BgB,aAAa,EAAEjB;QAChB,CACD,CAAC;MACH;MAEA,MAAMjB,QAAQ,GAAGQ,qBAAqB,CAAEsB,aAAa,EAAEC,IAAI,CAACN,IAAK,CAAC;MAClEc,cAAc,CAACE,IAAI,CAClBV,IAAI,CAACc,yCAAyC,CAC7C;QACC,IAAK,OAAO7C,QAAQ,KAAK,QAAQ,GAAGA,QAAQ,GAAG,CAAC,CAAC,CAAE;QACnD,GAAG8C;MACJ,CAAC,EACD;QACCb,kBAAkB,EAAEf,UAAU;QAC9BgB,aAAa,EAAEjB;MAChB,CACD,CACD,CAAC;IACF;EACD,CAAE,CAAC;EAEH,OAAO;IACNM,WAAW;IACXc,eAAe;IACfC,aAAa;IACbC,cAAc;IACdC;EACD,CAAC;AACF","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","_icons","RANGE_CONTROL_MAX_SIZE","exports","ALL_SIDES","DEFAULT_VALUES","top","undefined","right","bottom","left","ICONS","custom","sidesAll","axial","horizontal","sidesHorizontal","vertical","sidesVertical","sidesTop","sidesRight","sidesBottom","sidesLeft","LABELS","default","__","mixed","VIEWS","isValueSpacingPreset","value","includes","getCustomValueFromPreset","spacingSizes","slug","getSpacingPresetSlug","spacingSize","find","size","String","getPresetValueFromCustomValue","spacingMatch","getSpacingPresetCssVar","match","getSliderValueFromPreset","presetValue","parseFloat","sliderValue","findIndex","NaN","mode","arr","sort","a","b","filter","v","length","pop","getAllRawValue","values","Object","isValuesMixed","sides","Set","isValuesDefined","hasAxisSupport","axis","hasHorizontalSupport","hasVerticalSupport","getSupportedMenuItems","menuItems","label","icon","numberOfIndividualSides","forEach","side","hasBalancedSidesSupport","counts","getInitialView","sideValues","Boolean","hasMatchingAxialValues","hasNoValuesAndBalancedSides","hasOnlyAxialSides","entries","some","key"],"sources":["@wordpress/block-editor/src/components/spacing-sizes-control/utils.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tsidesAll,\n\tsidesBottom,\n\tsidesHorizontal,\n\tsidesLeft,\n\tsidesRight,\n\tsidesTop,\n\tsidesVertical,\n} from '@wordpress/icons';\n\nexport const RANGE_CONTROL_MAX_SIZE = 8;\n\nexport const ALL_SIDES = [ 'top', 'right', 'bottom', 'left' ];\n\nexport const DEFAULT_VALUES = {\n\ttop: undefined,\n\tright: undefined,\n\tbottom: undefined,\n\tleft: undefined,\n};\n\nexport const ICONS = {\n\tcustom: sidesAll,\n\taxial: sidesAll,\n\thorizontal: sidesHorizontal,\n\tvertical: sidesVertical,\n\ttop: sidesTop,\n\tright: sidesRight,\n\tbottom: sidesBottom,\n\tleft: sidesLeft,\n};\n\nexport const LABELS = {\n\tdefault: __( 'Spacing control' ),\n\ttop: __( 'Top' ),\n\tbottom: __( 'Bottom' ),\n\tleft: __( 'Left' ),\n\tright: __( 'Right' ),\n\tmixed: __( 'Mixed' ),\n\tvertical: __( 'Vertical' ),\n\thorizontal: __( 'Horizontal' ),\n\taxial: __( 'Horizontal & vertical' ),\n\tcustom: __( 'Custom' ),\n};\n\nexport const VIEWS = {\n\taxial: 'axial',\n\ttop: 'top',\n\tright: 'right',\n\tbottom: 'bottom',\n\tleft: 'left',\n\tcustom: 'custom',\n};\n\n/**\n * Checks is given value is a spacing preset.\n *\n * @param {string} value Value to check\n *\n * @return {boolean} Return true if value is string in format var:preset|spacing|.\n */\nexport function isValueSpacingPreset( value ) {\n\tif ( ! value?.includes ) {\n\t\treturn false;\n\t}\n\treturn value === '0' || value.includes( 'var:preset|spacing|' );\n}\n\n/**\n * Converts a spacing preset into a custom value.\n *\n * @param {string} value Value to convert\n * @param {Array} spacingSizes Array of the current spacing preset objects\n *\n * @return {string} Mapping of the spacing preset to its equivalent custom value.\n */\nexport function getCustomValueFromPreset( value, spacingSizes ) {\n\tif ( ! isValueSpacingPreset( value ) ) {\n\t\treturn value;\n\t}\n\n\tconst slug = getSpacingPresetSlug( value );\n\tconst spacingSize = spacingSizes.find(\n\t\t( size ) => String( size.slug ) === slug\n\t);\n\n\treturn spacingSize?.size;\n}\n\n/**\n * Converts a custom value to preset value if one can be found.\n *\n * Returns value as-is if no match is found.\n *\n * @param {string} value Value to convert\n * @param {Array} spacingSizes Array of the current spacing preset objects\n *\n * @return {string} The preset value if it can be found.\n */\nexport function getPresetValueFromCustomValue( value, spacingSizes ) {\n\t// Return value as-is if it is undefined or is already a preset, or '0';\n\tif ( ! value || isValueSpacingPreset( value ) || value === '0' ) {\n\t\treturn value;\n\t}\n\n\tconst spacingMatch = spacingSizes.find(\n\t\t( size ) => String( size.size ) === String( value )\n\t);\n\n\tif ( spacingMatch?.slug ) {\n\t\treturn `var:preset|spacing|${ spacingMatch.slug }`;\n\t}\n\n\treturn value;\n}\n\n/**\n * Converts a spacing preset into a custom value.\n *\n * @param {string} value Value to convert.\n *\n * @return {string | undefined} CSS var string for given spacing preset value.\n */\nexport function getSpacingPresetCssVar( value ) {\n\tif ( ! value ) {\n\t\treturn;\n\t}\n\n\tconst slug = value.match( /var:preset\\|spacing\\|(.+)/ );\n\n\tif ( ! slug ) {\n\t\treturn value;\n\t}\n\n\treturn `var(--wp--preset--spacing--${ slug[ 1 ] })`;\n}\n\n/**\n * Returns the slug section of the given spacing preset string.\n *\n * @param {string} value Value to extract slug from.\n *\n * @return {string|undefined} The int value of the slug from given spacing preset.\n */\nexport function getSpacingPresetSlug( value ) {\n\tif ( ! value ) {\n\t\treturn;\n\t}\n\n\tif ( value === '0' || value === 'default' ) {\n\t\treturn value;\n\t}\n\n\tconst slug = value.match( /var:preset\\|spacing\\|(.+)/ );\n\n\treturn slug ? slug[ 1 ] : undefined;\n}\n\n/**\n * Converts spacing preset value into a Range component value .\n *\n * @param {string} presetValue Value to convert to Range value.\n * @param {Array} spacingSizes Array of current spacing preset value objects.\n *\n * @return {number} The int value for use in Range control.\n */\nexport function getSliderValueFromPreset( presetValue, spacingSizes ) {\n\tif ( presetValue === undefined ) {\n\t\treturn 0;\n\t}\n\tconst slug =\n\t\tparseFloat( presetValue, 10 ) === 0\n\t\t\t? '0'\n\t\t\t: getSpacingPresetSlug( presetValue );\n\tconst sliderValue = spacingSizes.findIndex( ( spacingSize ) => {\n\t\treturn String( spacingSize.slug ) === slug;\n\t} );\n\n\t// Returning NaN rather than undefined as undefined makes range control thumb sit in center\n\treturn sliderValue !== -1 ? sliderValue : NaN;\n}\n\n/**\n * Gets an items with the most occurrence within an array\n * https://stackoverflow.com/a/20762713\n *\n * @param {Array<any>} arr Array of items to check.\n * @return {any} The item with the most occurrences.\n */\nfunction mode( arr ) {\n\treturn arr\n\t\t.sort(\n\t\t\t( a, b ) =>\n\t\t\t\tarr.filter( ( v ) => v === a ).length -\n\t\t\t\tarr.filter( ( v ) => v === b ).length\n\t\t)\n\t\t.pop();\n}\n\n/**\n * Gets the 'all' input value from values data.\n *\n * @param {Object} values Box spacing values\n *\n * @return {string} The most common value from all sides of box.\n */\nexport function getAllRawValue( values = {} ) {\n\treturn mode( Object.values( values ) );\n}\n\n/**\n * Checks to determine if values are mixed.\n *\n * @param {Object} values Box values.\n * @param {Array} sides Sides that values relate to.\n *\n * @return {boolean} Whether values are mixed.\n */\nexport function isValuesMixed( values = {}, sides = ALL_SIDES ) {\n\treturn (\n\t\t( Object.values( values ).length >= 1 &&\n\t\t\tObject.values( values ).length < sides.length ) ||\n\t\tnew Set( Object.values( values ) ).size > 1\n\t);\n}\n\n/**\n * Checks to determine if values are defined.\n *\n * @param {Object} values Box values.\n *\n * @return {boolean} Whether values are defined.\n */\nexport function isValuesDefined( values ) {\n\tif ( values === undefined || values === null ) {\n\t\treturn false;\n\t}\n\treturn Object.values( values ).filter( ( value ) => !! value ).length > 0;\n}\n\n/**\n * Determines whether a particular axis has support. If no axis is\n * specified, this function checks if either axis is supported.\n *\n * @param {Array} sides Supported sides.\n * @param {string} axis Which axis to check.\n *\n * @return {boolean} Whether there is support for the specified axis or both axes.\n */\nexport function hasAxisSupport( sides, axis ) {\n\tif ( ! sides || ! sides.length ) {\n\t\treturn false;\n\t}\n\n\tconst hasHorizontalSupport =\n\t\tsides.includes( 'horizontal' ) ||\n\t\t( sides.includes( 'left' ) && sides.includes( 'right' ) );\n\n\tconst hasVerticalSupport =\n\t\tsides.includes( 'vertical' ) ||\n\t\t( sides.includes( 'top' ) && sides.includes( 'bottom' ) );\n\n\tif ( axis === 'horizontal' ) {\n\t\treturn hasHorizontalSupport;\n\t}\n\n\tif ( axis === 'vertical' ) {\n\t\treturn hasVerticalSupport;\n\t}\n\n\treturn hasHorizontalSupport || hasVerticalSupport;\n}\n\n/**\n * Determines which menu options should be included in the SidePicker.\n *\n * @param {Array} sides Supported sides.\n *\n * @return {Object} Menu options with each option containing label & icon.\n */\nexport function getSupportedMenuItems( sides ) {\n\tif ( ! sides || ! sides.length ) {\n\t\treturn {};\n\t}\n\n\tconst menuItems = {};\n\n\t// Determine the primary \"side\" menu options.\n\tconst hasHorizontalSupport = hasAxisSupport( sides, 'horizontal' );\n\tconst hasVerticalSupport = hasAxisSupport( sides, 'vertical' );\n\n\tif ( hasHorizontalSupport && hasVerticalSupport ) {\n\t\tmenuItems.axial = { label: LABELS.axial, icon: ICONS.axial };\n\t} else if ( hasHorizontalSupport ) {\n\t\tmenuItems.axial = { label: LABELS.horizontal, icon: ICONS.horizontal };\n\t} else if ( hasVerticalSupport ) {\n\t\tmenuItems.axial = { label: LABELS.vertical, icon: ICONS.vertical };\n\t}\n\n\t// Track whether we have any individual sides so we can omit the custom\n\t// option if required.\n\tlet numberOfIndividualSides = 0;\n\n\tALL_SIDES.forEach( ( side ) => {\n\t\tif ( sides.includes( side ) ) {\n\t\t\tnumberOfIndividualSides += 1;\n\t\t\tmenuItems[ side ] = {\n\t\t\t\tlabel: LABELS[ side ],\n\t\t\t\ticon: ICONS[ side ],\n\t\t\t};\n\t\t}\n\t} );\n\n\t// Add custom item if there are enough sides to warrant a separated view.\n\tif ( numberOfIndividualSides > 1 ) {\n\t\tmenuItems.custom = { label: LABELS.custom, icon: ICONS.custom };\n\t}\n\n\treturn menuItems;\n}\n\n/**\n * Checks if the supported sides are balanced for each axis.\n * - Horizontal - both left and right sides are supported.\n * - Vertical - both top and bottom are supported.\n *\n * @param {Array} sides The supported sides which may be axes as well.\n *\n * @return {boolean} Whether or not the supported sides are balanced.\n */\nexport function hasBalancedSidesSupport( sides = [] ) {\n\tconst counts = { top: 0, right: 0, bottom: 0, left: 0 };\n\tsides.forEach( ( side ) => ( counts[ side ] += 1 ) );\n\n\treturn (\n\t\t( counts.top + counts.bottom ) % 2 === 0 &&\n\t\t( counts.left + counts.right ) % 2 === 0\n\t);\n}\n\n/**\n * Determines which view the SpacingSizesControl should default to on its\n * first render; Axial, Custom, or Single side.\n *\n * @param {Object} values Current side values.\n * @param {Array} sides Supported sides.\n *\n * @return {string} View to display.\n */\nexport function getInitialView( values = {}, sides ) {\n\tconst { top, right, bottom, left } = values;\n\tconst sideValues = [ top, right, bottom, left ].filter( Boolean );\n\n\t// Axial ( Horizontal & vertical ).\n\t// - Has axial side support\n\t// - Has axial side values which match\n\t// - Has no values and the supported sides are balanced\n\tconst hasMatchingAxialValues =\n\t\ttop === bottom && left === right && ( !! top || !! left );\n\tconst hasNoValuesAndBalancedSides =\n\t\t! sideValues.length && hasBalancedSidesSupport( sides );\n\tconst hasOnlyAxialSides =\n\t\tsides?.includes( 'horizontal' ) &&\n\t\tsides?.includes( 'vertical' ) &&\n\t\tsides?.length === 2;\n\n\tif (\n\t\thasAxisSupport( sides ) &&\n\t\t( hasMatchingAxialValues || hasNoValuesAndBalancedSides )\n\t) {\n\t\treturn VIEWS.axial;\n\t}\n\n\t// Only axial sides are supported and single value defined.\n\t// - Ensure the side returned is the first side that has a value.\n\tif ( hasOnlyAxialSides && sideValues.length === 1 ) {\n\t\tlet side;\n\n\t\tObject.entries( values ).some( ( [ key, value ] ) => {\n\t\t\tside = key;\n\t\t\treturn value !== undefined;\n\t\t} );\n\n\t\treturn side;\n\t}\n\n\t// Only single side supported and no value defined.\n\tif ( sides?.length === 1 && ! sideValues.length ) {\n\t\treturn sides[ 0 ];\n\t}\n\n\t// Default to the Custom (separated sides) view.\n\treturn VIEWS.custom;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAYO,MAAME,sBAAsB,GAAAC,OAAA,CAAAD,sBAAA,GAAG,CAAC;AAEhC,MAAME,SAAS,GAAAD,OAAA,CAAAC,SAAA,GAAG,CAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAE;AAEtD,MAAMC,cAAc,GAAAF,OAAA,CAAAE,cAAA,GAAG;EAC7BC,GAAG,EAAEC,SAAS;EACdC,KAAK,EAAED,SAAS;EAChBE,MAAM,EAAEF,SAAS;EACjBG,IAAI,EAAEH;AACP,CAA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M,CAAE0B,OAAQ,CAAC;;EAEjE;EACA;EACA;EACA;EACA,MAAMC,sBAAsB,GAC3B3E,GAAG,KAAKG,MAAM,IAAIC,IAAI,KAAKF,KAAK,KAAM,CAAC,CAAEF,GAAG,IAAI,CAAC,CAAEI,IAAI,CAAE;EAC1D,MAAMwE,2BAA2B,GAChC,CAAEH,UAAU,CAACvB,MAAM,IAAIoB,uBAAuB,CAAEd,KAAM,CAAC;EACxD,MAAMqB,iBAAiB,GACtBrB,KAAK,EAAEhC,QAAQ,CAAE,YAAa,CAAC,IAC/BgC,KAAK,EAAEhC,QAAQ,CAAE,UAAW,CAAC,IAC7BgC,KAAK,EAAEN,MAAM,KAAK,CAAC;EAEpB,IACCS,cAAc,CAAEH,KAAM,CAAC,KACrBmB,sBAAsB,IAAIC,2BAA2B,CAAE,EACxD;IACD,OAAOvD,KAAK,CAACb,KAAK;EACnB;;EAEA;EACA;EACA,IAAKqE,iBAAiB,IAAIJ,UAAU,CAACvB,MAAM,KAAK,CAAC,EAAG;IACnD,IAAImB,IAAI;IAERf,MAAM,CAACwB,OAAO,CAAEzB,MAAO,CAAC,CAAC0B,IAAI,CAAE,CAAE,CAAEC,GAAG,EAAEzD,KAAK,CAAE,KAAM;MACpD8C,IAAI,GAAGW,GAAG;MACV,OAAOzD,KAAK,KAAKtB,SAAS;IAC3B,CAAE,CAAC;IAEH,OAAOoE,IAAI;EACZ;;EAEA;EACA,IAAKb,KAAK,EAAEN,MAAM,KAAK,CAAC,IAAI,CAAEuB,UAAU,CAACvB,MAAM,EAAG;IACjD,OAAOM,KAAK,CAAE,CAAC,CAAE;EAClB;;EAEA;EACA,OAAOnC,KAAK,CAACf,MAAM;AACpB","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_icons","RANGE_CONTROL_MAX_SIZE","exports","ALL_SIDES","DEFAULT_VALUES","top","undefined","right","bottom","left","ICONS","custom","sidesAll","axial","horizontal","sidesHorizontal","vertical","sidesVertical","sidesTop","sidesRight","sidesBottom","sidesLeft","LABELS","default","__","mixed","VIEWS","isValueSpacingPreset","value","includes","getCustomValueFromPreset","spacingSizes","slug","getSpacingPresetSlug","spacingSize","find","size","String","getPresetValueFromCustomValue","spacingMatch","getSpacingPresetCssVar","match","getSliderValueFromPreset","presetValue","parseFloat","sliderValue","findIndex","NaN","mode","arr","sort","a","b","filter","v","length","pop","getAllRawValue","values","Object","isValuesMixed","sides","Set","isValuesDefined","hasAxisSupport","axis","hasHorizontalSupport","hasVerticalSupport","getSupportedMenuItems","menuItems","label","icon","numberOfIndividualSides","forEach","side","hasBalancedSidesSupport","counts","getInitialView","sideValues","Boolean","hasMatchingAxialValues","hasNoValuesAndBalancedSides","hasOnlyAxialSides","entries","some","key"],"sources":["@wordpress/block-editor/src/components/spacing-sizes-control/utils.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tsidesAll,\n\tsidesBottom,\n\tsidesHorizontal,\n\tsidesLeft,\n\tsidesRight,\n\tsidesTop,\n\tsidesVertical,\n} from '@wordpress/icons';\n\nexport const RANGE_CONTROL_MAX_SIZE = 8;\n\nexport const ALL_SIDES = [ 'top', 'right', 'bottom', 'left' ];\n\nexport const DEFAULT_VALUES = {\n\ttop: undefined,\n\tright: undefined,\n\tbottom: undefined,\n\tleft: undefined,\n};\n\nexport const ICONS = {\n\tcustom: sidesAll,\n\taxial: sidesAll,\n\thorizontal: sidesHorizontal,\n\tvertical: sidesVertical,\n\ttop: sidesTop,\n\tright: sidesRight,\n\tbottom: sidesBottom,\n\tleft: sidesLeft,\n};\n\nexport const LABELS = {\n\tdefault: __( 'Spacing control' ),\n\ttop: __( 'Top' ),\n\tbottom: __( 'Bottom' ),\n\tleft: __( 'Left' ),\n\tright: __( 'Right' ),\n\tmixed: __( 'Mixed' ),\n\tvertical: __( 'Vertical' ),\n\thorizontal: __( 'Horizontal' ),\n\taxial: __( 'Horizontal & vertical' ),\n\tcustom: __( 'Custom' ),\n};\n\nexport const VIEWS = {\n\taxial: 'axial',\n\ttop: 'top',\n\tright: 'right',\n\tbottom: 'bottom',\n\tleft: 'left',\n\tcustom: 'custom',\n};\n\n/**\n * Checks is given value is a spacing preset.\n *\n * @param {string} value Value to check\n *\n * @return {boolean} Return true if value is string in format var:preset|spacing|.\n */\nexport function isValueSpacingPreset( value ) {\n\tif ( ! value?.includes ) {\n\t\treturn false;\n\t}\n\treturn value === '0' || value.includes( 'var:preset|spacing|' );\n}\n\n/**\n * Converts a spacing preset into a custom value.\n *\n * @param {string} value Value to convert\n * @param {Array} spacingSizes Array of the current spacing preset objects\n *\n * @return {string} Mapping of the spacing preset to its equivalent custom value.\n */\nexport function getCustomValueFromPreset( value, spacingSizes ) {\n\tif ( ! isValueSpacingPreset( value ) ) {\n\t\treturn value;\n\t}\n\n\tconst slug = getSpacingPresetSlug( value );\n\tconst spacingSize = spacingSizes.find(\n\t\t( size ) => String( size.slug ) === slug\n\t);\n\n\treturn spacingSize?.size;\n}\n\n/**\n * Converts a custom value to preset value if one can be found.\n *\n * Returns value as-is if no match is found.\n *\n * @param {string} value Value to convert\n * @param {Array} spacingSizes Array of the current spacing preset objects\n *\n * @return {string} The preset value if it can be found.\n */\nexport function getPresetValueFromCustomValue( value, spacingSizes ) {\n\t// Return value as-is if it is undefined or is already a preset, or '0';\n\tif ( ! value || isValueSpacingPreset( value ) || value === '0' ) {\n\t\treturn value;\n\t}\n\n\tconst spacingMatch = spacingSizes.find(\n\t\t( size ) => String( size.size ) === String( value )\n\t);\n\n\tif ( spacingMatch?.slug ) {\n\t\treturn `var:preset|spacing|${ spacingMatch.slug }`;\n\t}\n\n\treturn value;\n}\n\n/**\n * Converts a spacing preset into a custom value.\n *\n * @param {string} value Value to convert.\n *\n * @return {string | undefined} CSS var string for given spacing preset value.\n */\nexport function getSpacingPresetCssVar( value ) {\n\tif ( ! value ) {\n\t\treturn;\n\t}\n\n\tconst slug = value.match( /var:preset\\|spacing\\|(.+)/ );\n\n\tif ( ! slug ) {\n\t\treturn value;\n\t}\n\n\treturn `var(--wp--preset--spacing--${ slug[ 1 ] })`;\n}\n\n/**\n * Returns the slug section of the given spacing preset string.\n *\n * @param {string} value Value to extract slug from.\n *\n * @return {string|undefined} The int value of the slug from given spacing preset.\n */\nexport function getSpacingPresetSlug( value ) {\n\tif ( ! value ) {\n\t\treturn;\n\t}\n\n\tif ( value === '0' || value === 'default' ) {\n\t\treturn value;\n\t}\n\n\tconst slug = value.match( /var:preset\\|spacing\\|(.+)/ );\n\n\treturn slug ? slug[ 1 ] : undefined;\n}\n\n/**\n * Converts spacing preset value into a Range component value .\n *\n * @param {string} presetValue Value to convert to Range value.\n * @param {Array} spacingSizes Array of current spacing preset value objects.\n *\n * @return {number} The int value for use in Range control.\n */\nexport function getSliderValueFromPreset( presetValue, spacingSizes ) {\n\tif ( presetValue === undefined ) {\n\t\treturn 0;\n\t}\n\tconst slug =\n\t\tparseFloat( presetValue, 10 ) === 0\n\t\t\t? '0'\n\t\t\t: getSpacingPresetSlug( presetValue );\n\tconst sliderValue = spacingSizes.findIndex( ( spacingSize ) => {\n\t\treturn String( spacingSize.slug ) === slug;\n\t} );\n\n\t// Returning NaN rather than undefined as undefined makes range control thumb sit in center\n\treturn sliderValue !== -1 ? sliderValue : NaN;\n}\n\n/**\n * Gets an items with the most occurrence within an array\n * https://stackoverflow.com/a/20762713\n *\n * @param {Array<any>} arr Array of items to check.\n * @return {any} The item with the most occurrences.\n */\nfunction mode( arr ) {\n\treturn arr\n\t\t.sort(\n\t\t\t( a, b ) =>\n\t\t\t\tarr.filter( ( v ) => v === a ).length -\n\t\t\t\tarr.filter( ( v ) => v === b ).length\n\t\t)\n\t\t.pop();\n}\n\n/**\n * Gets the 'all' input value from values data.\n *\n * @param {Object} values Box spacing values\n *\n * @return {string} The most common value from all sides of box.\n */\nexport function getAllRawValue( values = {} ) {\n\treturn mode( Object.values( values ) );\n}\n\n/**\n * Checks to determine if values are mixed.\n *\n * @param {Object} values Box values.\n * @param {Array} sides Sides that values relate to.\n *\n * @return {boolean} Whether values are mixed.\n */\nexport function isValuesMixed( values = {}, sides = ALL_SIDES ) {\n\treturn (\n\t\t( Object.values( values ).length >= 1 &&\n\t\t\tObject.values( values ).length < sides.length ) ||\n\t\tnew Set( Object.values( values ) ).size > 1\n\t);\n}\n\n/**\n * Checks to determine if values are defined.\n *\n * @param {Object} values Box values.\n *\n * @return {boolean} Whether values are defined.\n */\nexport function isValuesDefined( values ) {\n\tif ( values === undefined || values === null ) {\n\t\treturn false;\n\t}\n\treturn Object.values( values ).filter( ( value ) => !! value ).length > 0;\n}\n\n/**\n * Determines whether a particular axis has support. If no axis is\n * specified, this function checks if either axis is supported.\n *\n * @param {Array} sides Supported sides.\n * @param {string} axis Which axis to check.\n *\n * @return {boolean} Whether there is support for the specified axis or both axes.\n */\nexport function hasAxisSupport( sides, axis ) {\n\tif ( ! sides || ! sides.length ) {\n\t\treturn false;\n\t}\n\n\tconst hasHorizontalSupport =\n\t\tsides.includes( 'horizontal' ) ||\n\t\t( sides.includes( 'left' ) && sides.includes( 'right' ) );\n\n\tconst hasVerticalSupport =\n\t\tsides.includes( 'vertical' ) ||\n\t\t( sides.includes( 'top' ) && sides.includes( 'bottom' ) );\n\n\tif ( axis === 'horizontal' ) {\n\t\treturn hasHorizontalSupport;\n\t}\n\n\tif ( axis === 'vertical' ) {\n\t\treturn hasVerticalSupport;\n\t}\n\n\treturn hasHorizontalSupport || hasVerticalSupport;\n}\n\n/**\n * Determines which menu options should be included in the SidePicker.\n *\n * @param {Array} sides Supported sides.\n *\n * @return {Object} Menu options with each option containing label & icon.\n */\nexport function getSupportedMenuItems( sides ) {\n\tif ( ! sides || ! sides.length ) {\n\t\treturn {};\n\t}\n\n\tconst menuItems = {};\n\n\t// Determine the primary \"side\" menu options.\n\tconst hasHorizontalSupport = hasAxisSupport( sides, 'horizontal' );\n\tconst hasVerticalSupport = hasAxisSupport( sides, 'vertical' );\n\n\tif ( hasHorizontalSupport && hasVerticalSupport ) {\n\t\tmenuItems.axial = { label: LABELS.axial, icon: ICONS.axial };\n\t} else if ( hasHorizontalSupport ) {\n\t\tmenuItems.axial = { label: LABELS.horizontal, icon: ICONS.horizontal };\n\t} else if ( hasVerticalSupport ) {\n\t\tmenuItems.axial = { label: LABELS.vertical, icon: ICONS.vertical };\n\t}\n\n\t// Track whether we have any individual sides so we can omit the custom\n\t// option if required.\n\tlet numberOfIndividualSides = 0;\n\n\tALL_SIDES.forEach( ( side ) => {\n\t\tif ( sides.includes( side ) ) {\n\t\t\tnumberOfIndividualSides += 1;\n\t\t\tmenuItems[ side ] = {\n\t\t\t\tlabel: LABELS[ side ],\n\t\t\t\ticon: ICONS[ side ],\n\t\t\t};\n\t\t}\n\t} );\n\n\t// Add custom item if there are enough sides to warrant a separated view.\n\tif ( numberOfIndividualSides > 1 ) {\n\t\tmenuItems.custom = { label: LABELS.custom, icon: ICONS.custom };\n\t}\n\n\treturn menuItems;\n}\n\n/**\n * Checks if the supported sides are balanced for each axis.\n * - Horizontal - both left and right sides are supported.\n * - Vertical - both top and bottom are supported.\n *\n * @param {Array} sides The supported sides which may be axes as well.\n *\n * @return {boolean} Whether or not the supported sides are balanced.\n */\nexport function hasBalancedSidesSupport( sides = [] ) {\n\tconst counts = { top: 0, right: 0, bottom: 0, left: 0 };\n\tsides.forEach( ( side ) => ( counts[ side ] += 1 ) );\n\n\treturn (\n\t\t( counts.top + counts.bottom ) % 2 === 0 &&\n\t\t( counts.left + counts.right ) % 2 === 0\n\t);\n}\n\n/**\n * Determines which view the SpacingSizesControl should default to on its\n * first render; Axial, Custom, or Single side.\n *\n * @param {Object} values Current side values.\n * @param {Array} sides Supported sides.\n *\n * @return {string} View to display.\n */\nexport function getInitialView( values = {}, sides ) {\n\tconst { top, right, bottom, left } = values;\n\tconst sideValues = [ top, right, bottom, left ].filter( Boolean );\n\n\t// Axial ( Horizontal & vertical ).\n\t// - Has axial side support\n\t// - Has axial side values which match\n\t// - Has no values and the supported sides are balanced\n\tconst hasMatchingAxialValues =\n\t\ttop === bottom && left === right && ( !! top || !! left );\n\tconst hasNoValuesAndBalancedSides =\n\t\t! sideValues.length && hasBalancedSidesSupport( sides );\n\tconst hasOnlyAxialSides =\n\t\tsides?.includes( 'horizontal' ) &&\n\t\tsides?.includes( 'vertical' ) &&\n\t\tsides?.length === 2;\n\n\tif (\n\t\thasAxisSupport( sides ) &&\n\t\t( hasMatchingAxialValues || hasNoValuesAndBalancedSides )\n\t) {\n\t\treturn VIEWS.axial;\n\t}\n\n\t// Only axial sides are supported and single value defined.\n\t// - Ensure the side returned is the first side that has a value.\n\tif ( hasOnlyAxialSides && sideValues.length === 1 ) {\n\t\tlet side;\n\n\t\tObject.entries( values ).some( ( [ key, value ] ) => {\n\t\t\tside = key;\n\t\t\treturn value !== undefined;\n\t\t} );\n\n\t\treturn side;\n\t}\n\n\t// Only single side supported and no value defined.\n\tif ( sides?.length === 1 && ! sideValues.length ) {\n\t\treturn sides[ 0 ];\n\t}\n\n\t// Default to the Custom (separated sides) view.\n\treturn VIEWS.custom;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAYO,MAAME,sBAAsB,GAAAC,OAAA,CAAAD,sBAAA,GAAG,CAAC;AAEhC,MAAME,SAAS,GAAAD,OAAA,CAAAC,SAAA,GAAG,CAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAE;AAEtD,MAAMC,cAAc,GAAAF,OAAA,CAAAE,cAAA,GAAG;EAC7BC,GAAG,EAAEC,SAAS;EACdC,KAAK,EAAED,SAAS;EAChBE,MAAM,EAAEF,SAAS;EACjBG,IAAI,EAAEH;AACP,CAAC;AAEM,MAAMI,KAAK,GAAAR,OAAA,CAAAQ,KAAA,GAAG;EACpBC,MAAM,EAAEC,eAAQ;EAChBC,KAAK,EAAED,eAAQ;EACfE,UAAU,EAAEC,sBAAe;EA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EF,GAAG,IAAI,CAAC,CAAEI,IAAI,CAAE;EAC1D,MAAMwE,2BAA2B,GAChC,CAAEH,UAAU,CAACvB,MAAM,IAAIoB,uBAAuB,CAAEd,KAAM,CAAC;EACxD,MAAMqB,iBAAiB,GACtBrB,KAAK,EAAEhC,QAAQ,CAAE,YAAa,CAAC,IAC/BgC,KAAK,EAAEhC,QAAQ,CAAE,UAAW,CAAC,IAC7BgC,KAAK,EAAEN,MAAM,KAAK,CAAC;EAEpB,IACCS,cAAc,CAAEH,KAAM,CAAC,KACrBmB,sBAAsB,IAAIC,2BAA2B,CAAE,EACxD;IACD,OAAOvD,KAAK,CAACb,KAAK;EACnB;;EAEA;EACA;EACA,IAAKqE,iBAAiB,IAAIJ,UAAU,CAACvB,MAAM,KAAK,CAAC,EAAG;IACnD,IAAImB,IAAI;IAERf,MAAM,CAACwB,OAAO,CAAEzB,MAAO,CAAC,CAAC0B,IAAI,CAAE,CAAE,CAAEC,GAAG,EAAEzD,KAAK,CAAE,KAAM;MACpD8C,IAAI,GAAGW,GAAG;MACV,OAAOzD,KAAK,KAAKtB,SAAS;IAC3B,CAAE,CAAC;IAEH,OAAOoE,IAAI;EACZ;;EAEA;EACA,IAAKb,KAAK,EAAEN,MAAM,KAAK,CAAC,IAAI,CAAEuB,UAAU,CAACvB,MAAM,EAAG;IACjD,OAAOM,KAAK,CAAE,CAAC,CAAE;EAClB;;EAEA;EACA,OAAOnC,KAAK,CAACf,MAAM;AACpB","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":["_compose","require","_dom","_data","_keycodes","_store","_jsxRuntime","isIE","window","navigator","userAgent","indexOf","arrowKeyCodes","Set","UP","DOWN","LEFT","RIGHT","initialTriggerPercentage","useTypewriter","hasSelectedBlock","useSelect","select","blockEditorStore","useRefEffect","node","ownerDocument","defaultView","scrollResizeRafId","onKeyDownRafId","caretRect","onScrollResize","requestAnimationFrame","computeCaretRectangle","onKeyDown","event","cancelAnimationFrame","maintainCaretPosition","keyCode","isSelectionEligibleForScroll","currentCaretRect","computeCaretRect","has","diff","top","scrollContainer","getScrollContainer","windowScroll","body","documentElement","scrollY","scrollTop","scrollContainerY","getBoundingClientRect","relativeScrollPosition","innerHeight","isLastEditableNode","scrollContainerHeight","clientHeight","height","scrollBy","addSelectionChangeListener","addEventListener","computeCaretRectOnSelectionChange","removeEventListener","contains","activeElement","isContentEditable","editableNodes","querySelectorAll","lastEditableNode","length","Typewriter","children","jsx","ref","className","TypewriterOrIEBypass","props","_default","exports","default"],"sources":["@wordpress/block-editor/src/components/typewriter/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRefEffect } from '@wordpress/compose';\nimport { computeCaretRect, getScrollContainer } from '@wordpress/dom';\nimport { useSelect } from '@wordpress/data';\nimport { UP, DOWN, LEFT, RIGHT } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\nconst isIE = window.navigator.userAgent.indexOf( 'Trident' ) !== -1;\nconst arrowKeyCodes = new Set( [ UP, DOWN, LEFT, RIGHT ] );\nconst initialTriggerPercentage = 0.75;\n\nexport function useTypewriter() {\n\tconst hasSelectedBlock = useSelect(\n\t\t( select ) => select( blockEditorStore ).hasSelectedBlock(),\n\t\t[]\n\t);\n\n\treturn useRefEffect(\n\t\t( node ) => {\n\t\t\tif ( ! hasSelectedBlock ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst { ownerDocument } = node;\n\t\t\tconst { defaultView } = ownerDocument;\n\n\t\t\tlet scrollResizeRafId;\n\t\t\tlet onKeyDownRafId;\n\n\t\t\tlet caretRect;\n\n\t\t\tfunction onScrollResize() {\n\t\t\t\tif ( scrollResizeRafId ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tscrollResizeRafId = defaultView.requestAnimationFrame( () => {\n\t\t\t\t\tcomputeCaretRectangle();\n\t\t\t\t\tscrollResizeRafId = null;\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tfunction onKeyDown( event ) {\n\t\t\t\t// Ensure the any remaining request is cancelled.\n\t\t\t\tif ( onKeyDownRafId ) {\n\t\t\t\t\tdefaultView.cancelAnimationFrame( onKeyDownRafId );\n\t\t\t\t}\n\n\t\t\t\t// Use an animation frame for a smooth result.\n\t\t\t\tonKeyDownRafId = defaultView.requestAnimationFrame( () => {\n\t\t\t\t\tmaintainCaretPosition( event );\n\t\t\t\t\tonKeyDownRafId = null;\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Maintains the scroll position after a selection change caused by a\n\t\t\t * keyboard event.\n\t\t\t *\n\t\t\t * @param {KeyboardEvent} event Keyboard event.\n\t\t\t */\n\t\t\tfunction maintainCaretPosition( { keyCode } ) {\n\t\t\t\tif ( ! isSelectionEligibleForScroll() ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst currentCaretRect = computeCaretRect( defaultView );\n\n\t\t\t\tif ( ! currentCaretRect ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// If for some reason there is no position set to be scrolled to, let\n\t\t\t\t// this be the position to be scrolled to in the future.\n\t\t\t\tif ( ! caretRect ) {\n\t\t\t\t\tcaretRect = currentCaretRect;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Even though enabling the typewriter effect for arrow keys results in\n\t\t\t\t// a pleasant experience, it may not be the case for everyone, so, for\n\t\t\t\t// now, let's disable it.\n\t\t\t\tif ( arrowKeyCodes.has( keyCode ) ) {\n\t\t\t\t\t// Reset the caret position to maintain.\n\t\t\t\t\tcaretRect = currentCaretRect;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst diff = currentCaretRect.top - caretRect.top;\n\n\t\t\t\tif ( diff === 0 ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst scrollContainer = getScrollContainer( node );\n\n\t\t\t\t// The page must be scrollable.\n\t\t\t\tif ( ! scrollContainer ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst windowScroll =\n\t\t\t\t\tscrollContainer === ownerDocument.body ||\n\t\t\t\t\tscrollContainer === ownerDocument.documentElement;\n\t\t\t\tconst scrollY = windowScroll\n\t\t\t\t\t? defaultView.scrollY\n\t\t\t\t\t: scrollContainer.scrollTop;\n\t\t\t\tconst scrollContainerY = windowScroll\n\t\t\t\t\t? 0\n\t\t\t\t\t: scrollContainer.getBoundingClientRect().top;\n\t\t\t\tconst relativeScrollPosition = windowScroll\n\t\t\t\t\t? caretRect.top / defaultView.innerHeight\n\t\t\t\t\t: ( caretRect.top - scrollContainerY ) /\n\t\t\t\t\t ( defaultView.innerHeight - scrollContainerY );\n\n\t\t\t\t// If the scroll position is at the start, the active editable element\n\t\t\t\t// is the last one, and the caret is positioned within the initial\n\t\t\t\t// trigger percentage of the page, do not scroll the page.\n\t\t\t\t// The typewriter effect should not kick in until an empty page has been\n\t\t\t\t// filled with the initial trigger percentage or the user scrolls\n\t\t\t\t// intentionally down.\n\t\t\t\tif (\n\t\t\t\t\tscrollY === 0 &&\n\t\t\t\t\trelativeScrollPosition < initialTriggerPercentage &&\n\t\t\t\t\tisLastEditableNode()\n\t\t\t\t) {\n\t\t\t\t\t// Reset the caret position to maintain.\n\t\t\t\t\tcaretRect = currentCaretRect;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst scrollContainerHeight = windowScroll\n\t\t\t\t\t? defaultView.innerHeight\n\t\t\t\t\t: scrollContainer.clientHeight;\n\n\t\t\t\t// Abort if the target scroll position would scroll the caret out of\n\t\t\t\t// view.\n\t\t\t\tif (\n\t\t\t\t\t// The caret is under the lower fold.\n\t\t\t\t\tcaretRect.top + caretRect.height >\n\t\t\t\t\t\tscrollContainerY + scrollContainerHeight ||\n\t\t\t\t\t// The caret is above the upper fold.\n\t\t\t\t\tcaretRect.top < scrollContainerY\n\t\t\t\t) {\n\t\t\t\t\t// Reset the caret position to maintain.\n\t\t\t\t\tcaretRect = currentCaretRect;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( windowScroll ) {\n\t\t\t\t\tdefaultView.scrollBy( 0, diff );\n\t\t\t\t} else {\n\t\t\t\t\tscrollContainer.scrollTop += diff;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Adds a `selectionchange` listener to reset the scroll position to be\n\t\t\t * maintained.\n\t\t\t */\n\t\t\tfunction addSelectionChangeListener() {\n\t\t\t\townerDocument.addEventListener(\n\t\t\t\t\t'selectionchange',\n\t\t\t\t\tcomputeCaretRectOnSelectionChange\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Resets the scroll position to be maintained during a `selectionchange`\n\t\t\t * event. Also removes the listener, so it acts as a one-time listener.\n\t\t\t */\n\t\t\tfunction computeCaretRectOnSelectionChange() {\n\t\t\t\townerDocument.removeEventListener(\n\t\t\t\t\t'selectionchange',\n\t\t\t\t\tcomputeCaretRectOnSelectionChange\n\t\t\t\t);\n\t\t\t\tcomputeCaretRectangle();\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Resets the scroll position to be maintained.\n\t\t\t */\n\t\t\tfunction computeCaretRectangle() {\n\t\t\t\tif ( isSelectionEligibleForScroll() ) {\n\t\t\t\t\tcaretRect = computeCaretRect( defaultView );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Checks if the current situation is elegible for scroll:\n\t\t\t * - There should be one and only one block selected.\n\t\t\t * - The component must contain the selection.\n\t\t\t * - The active element must be contenteditable.\n\t\t\t */\n\t\t\tfunction isSelectionEligibleForScroll() {\n\t\t\t\treturn (\n\t\t\t\t\tnode.contains( ownerDocument.activeElement ) &&\n\t\t\t\t\townerDocument.activeElement.isContentEditable\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tfunction isLastEditableNode() {\n\t\t\t\tconst editableNodes = node.querySelectorAll(\n\t\t\t\t\t'[contenteditable=\"true\"]'\n\t\t\t\t);\n\t\t\t\tconst lastEditableNode =\n\t\t\t\t\teditableNodes[ editableNodes.length - 1 ];\n\t\t\t\treturn lastEditableNode === ownerDocument.activeElement;\n\t\t\t}\n\n\t\t\t// When the user scrolls or resizes, the scroll position should be\n\t\t\t// reset.\n\t\t\tdefaultView.addEventListener( 'scroll', onScrollResize, true );\n\t\t\tdefaultView.addEventListener( 'resize', onScrollResize, true );\n\n\t\t\tnode.addEventListener( 'keydown', onKeyDown );\n\t\t\tnode.addEventListener( 'keyup', maintainCaretPosition );\n\t\t\tnode.addEventListener( 'mousedown', addSelectionChangeListener );\n\t\t\tnode.addEventListener( 'touchstart', addSelectionChangeListener );\n\n\t\t\treturn () => {\n\t\t\t\tdefaultView.removeEventListener(\n\t\t\t\t\t'scroll',\n\t\t\t\t\tonScrollResize,\n\t\t\t\t\ttrue\n\t\t\t\t);\n\t\t\t\tdefaultView.removeEventListener(\n\t\t\t\t\t'resize',\n\t\t\t\t\tonScrollResize,\n\t\t\t\t\ttrue\n\t\t\t\t);\n\n\t\t\t\tnode.removeEventListener( 'keydown', onKeyDown );\n\t\t\t\tnode.removeEventListener( 'keyup', maintainCaretPosition );\n\t\t\t\tnode.removeEventListener(\n\t\t\t\t\t'mousedown',\n\t\t\t\t\taddSelectionChangeListener\n\t\t\t\t);\n\t\t\t\tnode.removeEventListener(\n\t\t\t\t\t'touchstart',\n\t\t\t\t\taddSelectionChangeListener\n\t\t\t\t);\n\n\t\t\t\townerDocument.removeEventListener(\n\t\t\t\t\t'selectionchange',\n\t\t\t\t\tcomputeCaretRectOnSelectionChange\n\t\t\t\t);\n\n\t\t\t\tdefaultView.cancelAnimationFrame( scrollResizeRafId );\n\t\t\t\tdefaultView.cancelAnimationFrame( onKeyDownRafId );\n\t\t\t};\n\t\t},\n\t\t[ hasSelectedBlock ]\n\t);\n}\n\nfunction Typewriter( { children } ) {\n\treturn (\n\t\t<div ref={ useTypewriter() } className=\"block-editor__typewriter\">\n\t\t\t{ children }\n\t\t</div>\n\t);\n}\n\n/**\n * The exported component. The implementation of Typewriter faced technical\n * challenges in Internet Explorer, and is simply skipped, rendering the given\n * props children instead.\n *\n * @type {Component}\n */\nconst TypewriterOrIEBypass = isIE ? ( props ) => props.children : Typewriter;\n\n/**\n * Ensures that the text selection keeps the same vertical distance from the\n * viewport during keyboard events within this component. The vertical distance\n * can vary. It is the last clicked or scrolled to position.\n */\nexport default TypewriterOrIEBypass;\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAJ,OAAA;AAAwD,IAAAK,WAAA,GAAAL,OAAA;AAXxD;AACA;AACA;;AAMA;AACA;AACA;;AAGA,MAAMM,IAAI,GAAGC,MAAM,CAACC,SAAS,CAACC,SAAS,CAACC,OAAO,CAAE,SAAU,CAAC,KAAK,CAAC,CAAC;AACnE,MAAMC,aAAa,GAAG,IAAIC,GAAG,CAAE,CAAEC,YAAE,EAAEC,cAAI,EAAEC,cAAI,EAAEC,eAAK,CAAG,CAAC;AAC1D,MAAMC,wBAAwB,GAAG,IAAI;AAE9B,SAASC,aAAaA,CAAA,EAAG;EAC/B,MAAMC,gBAAgB,GAAG,IAAAC,eAAS,EAC/BC,MAAM,IAAMA,MAAM,CAAEC,YAAiB,CAAC,CAACH,gBAAgB,CAAC,CAAC,EAC3D,EACD,CAAC;EAED,OAAO,IAAAI,qBAAY,EAChBC,IAAI,IAAM;IACX,IAAK,CAAEL,gBAAgB,EAAG;MACzB;IACD;IAEA,MAAM;MAAEM;IAAc,CAAC,GAAGD,IAAI;IAC9B,MAAM;MAAEE;IAAY,CAAC,GAAGD,aAAa;IAErC,IAAIE,iBAAiB;IACrB,IAAIC,cAAc;IAElB,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ACD,CAAC;MAEDN,IAAI,CAACuC,mBAAmB,CAAE,SAAS,EAAE9B,SAAU,CAAC;MAChDT,IAAI,CAACuC,mBAAmB,CAAE,OAAO,EAAE3B,qBAAsB,CAAC;MAC1DZ,IAAI,CAACuC,mBAAmB,CACvB,WAAW,EACXH,0BACD,CAAC;MACDpC,IAAI,CAACuC,mBAAmB,CACvB,YAAY,EACZH,0BACD,CAAC;MAEDnC,aAAa,CAACsC,mBAAmB,CAChC,iBAAiB,EACjBD,iCACD,CAAC;MAEDpC,WAAW,CAACS,oBAAoB,CAAER,iBAAkB,CAAC;MACrDD,WAAW,CAACS,oBAAoB,CAAEP,cAAe,CAAC;IACnD,CAAC;EACF,CAAC,EACD,CAAET,gBAAgB,CACnB,CAAC;AACF;AAEA,SAASoD,UAAUA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACnC,oBACC,IAAAnE,WAAA,CAAAoE,GAAA;IAAKC,GAAG,EAAGxD,aAAa,CAAC,CAAG;IAACyD,SAAS,EAAC,0BAA0B;IAAAH,QAAA,EAC9DA;EAAQ,CACN,CAAC;AAER;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMI,oBAAoB,GAAGtE,IAAI,GAAKuE,KAAK,IAAMA,KAAK,CAACL,QAAQ,GAAGD,UAAU;;AAE5E;AACA;AACA;AACA;AACA;AAJA,IAAAO,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAKeJ,oBAAoB","ignoreList":[]}
1
+ {"version":3,"names":["_compose","require","_dom","_data","_keycodes","_store","_jsxRuntime","isIE","window","navigator","userAgent","indexOf","arrowKeyCodes","Set","UP","DOWN","LEFT","RIGHT","initialTriggerPercentage","useTypewriter","hasSelectedBlock","useSelect","select","blockEditorStore","useRefEffect","node","ownerDocument","defaultView","scrollResizeRafId","onKeyDownRafId","caretRect","onScrollResize","requestAnimationFrame","computeCaretRectangle","onKeyDown","event","cancelAnimationFrame","maintainCaretPosition","keyCode","isSelectionEligibleForScroll","currentCaretRect","computeCaretRect","has","diff","top","scrollContainer","getScrollContainer","windowScroll","body","documentElement","scrollY","scrollTop","scrollContainerY","getBoundingClientRect","relativeScrollPosition","innerHeight","isLastEditableNode","scrollContainerHeight","clientHeight","height","scrollBy","addSelectionChangeListener","addEventListener","computeCaretRectOnSelectionChange","removeEventListener","contains","activeElement","isContentEditable","editableNodes","querySelectorAll","lastEditableNode","length","Typewriter","children","jsx","ref","className","TypewriterOrIEBypass","props","_default","exports","default"],"sources":["@wordpress/block-editor/src/components/typewriter/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRefEffect } from '@wordpress/compose';\nimport { computeCaretRect, getScrollContainer } from '@wordpress/dom';\nimport { useSelect } from '@wordpress/data';\nimport { UP, DOWN, LEFT, RIGHT } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\nconst isIE = window.navigator.userAgent.indexOf( 'Trident' ) !== -1;\nconst arrowKeyCodes = new Set( [ UP, DOWN, LEFT, RIGHT ] );\nconst initialTriggerPercentage = 0.75;\n\nexport function useTypewriter() {\n\tconst hasSelectedBlock = useSelect(\n\t\t( select ) => select( blockEditorStore ).hasSelectedBlock(),\n\t\t[]\n\t);\n\n\treturn useRefEffect(\n\t\t( node ) => {\n\t\t\tif ( ! hasSelectedBlock ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst { ownerDocument } = node;\n\t\t\tconst { defaultView } = ownerDocument;\n\n\t\t\tlet scrollResizeRafId;\n\t\t\tlet onKeyDownRafId;\n\n\t\t\tlet caretRect;\n\n\t\t\tfunction onScrollResize() {\n\t\t\t\tif ( scrollResizeRafId ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tscrollResizeRafId = defaultView.requestAnimationFrame( () => {\n\t\t\t\t\tcomputeCaretRectangle();\n\t\t\t\t\tscrollResizeRafId = null;\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tfunction onKeyDown( event ) {\n\t\t\t\t// Ensure the any remaining request is cancelled.\n\t\t\t\tif ( onKeyDownRafId ) {\n\t\t\t\t\tdefaultView.cancelAnimationFrame( onKeyDownRafId );\n\t\t\t\t}\n\n\t\t\t\t// Use an animation frame for a smooth result.\n\t\t\t\tonKeyDownRafId = defaultView.requestAnimationFrame( () => {\n\t\t\t\t\tmaintainCaretPosition( event );\n\t\t\t\t\tonKeyDownRafId = null;\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Maintains the scroll position after a selection change caused by a\n\t\t\t * keyboard event.\n\t\t\t *\n\t\t\t * @param {KeyboardEvent} event Keyboard event.\n\t\t\t */\n\t\t\tfunction maintainCaretPosition( { keyCode } ) {\n\t\t\t\tif ( ! isSelectionEligibleForScroll() ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst currentCaretRect = computeCaretRect( defaultView );\n\n\t\t\t\tif ( ! currentCaretRect ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// If for some reason there is no position set to be scrolled to, let\n\t\t\t\t// this be the position to be scrolled to in the future.\n\t\t\t\tif ( ! caretRect ) {\n\t\t\t\t\tcaretRect = currentCaretRect;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Even though enabling the typewriter effect for arrow keys results in\n\t\t\t\t// a pleasant experience, it may not be the case for everyone, so, for\n\t\t\t\t// now, let's disable it.\n\t\t\t\tif ( arrowKeyCodes.has( keyCode ) ) {\n\t\t\t\t\t// Reset the caret position to maintain.\n\t\t\t\t\tcaretRect = currentCaretRect;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst diff = currentCaretRect.top - caretRect.top;\n\n\t\t\t\tif ( diff === 0 ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst scrollContainer = getScrollContainer( node );\n\n\t\t\t\t// The page must be scrollable.\n\t\t\t\tif ( ! scrollContainer ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst windowScroll =\n\t\t\t\t\tscrollContainer === ownerDocument.body ||\n\t\t\t\t\tscrollContainer === ownerDocument.documentElement;\n\t\t\t\tconst scrollY = windowScroll\n\t\t\t\t\t? defaultView.scrollY\n\t\t\t\t\t: scrollContainer.scrollTop;\n\t\t\t\tconst scrollContainerY = windowScroll\n\t\t\t\t\t? 0\n\t\t\t\t\t: scrollContainer.getBoundingClientRect().top;\n\t\t\t\tconst relativeScrollPosition = windowScroll\n\t\t\t\t\t? caretRect.top / defaultView.innerHeight\n\t\t\t\t\t: ( caretRect.top - scrollContainerY ) /\n\t\t\t\t\t ( defaultView.innerHeight - scrollContainerY );\n\n\t\t\t\t// If the scroll position is at the start, the active editable element\n\t\t\t\t// is the last one, and the caret is positioned within the initial\n\t\t\t\t// trigger percentage of the page, do not scroll the page.\n\t\t\t\t// The typewriter effect should not kick in until an empty page has been\n\t\t\t\t// filled with the initial trigger percentage or the user scrolls\n\t\t\t\t// intentionally down.\n\t\t\t\tif (\n\t\t\t\t\tscrollY === 0 &&\n\t\t\t\t\trelativeScrollPosition < initialTriggerPercentage &&\n\t\t\t\t\tisLastEditableNode()\n\t\t\t\t) {\n\t\t\t\t\t// Reset the caret position to maintain.\n\t\t\t\t\tcaretRect = currentCaretRect;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst scrollContainerHeight = windowScroll\n\t\t\t\t\t? defaultView.innerHeight\n\t\t\t\t\t: scrollContainer.clientHeight;\n\n\t\t\t\t// Abort if the target scroll position would scroll the caret out of\n\t\t\t\t// view.\n\t\t\t\tif (\n\t\t\t\t\t// The caret is under the lower fold.\n\t\t\t\t\tcaretRect.top + caretRect.height >\n\t\t\t\t\t\tscrollContainerY + scrollContainerHeight ||\n\t\t\t\t\t// The caret is above the upper fold.\n\t\t\t\t\tcaretRect.top < scrollContainerY\n\t\t\t\t) {\n\t\t\t\t\t// Reset the caret position to maintain.\n\t\t\t\t\tcaretRect = currentCaretRect;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( windowScroll ) {\n\t\t\t\t\tdefaultView.scrollBy( 0, diff );\n\t\t\t\t} else {\n\t\t\t\t\tscrollContainer.scrollTop += diff;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Adds a `selectionchange` listener to reset the scroll position to be\n\t\t\t * maintained.\n\t\t\t */\n\t\t\tfunction addSelectionChangeListener() {\n\t\t\t\townerDocument.addEventListener(\n\t\t\t\t\t'selectionchange',\n\t\t\t\t\tcomputeCaretRectOnSelectionChange\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Resets the scroll position to be maintained during a `selectionchange`\n\t\t\t * event. Also removes the listener, so it acts as a one-time listener.\n\t\t\t */\n\t\t\tfunction computeCaretRectOnSelectionChange() {\n\t\t\t\townerDocument.removeEventListener(\n\t\t\t\t\t'selectionchange',\n\t\t\t\t\tcomputeCaretRectOnSelectionChange\n\t\t\t\t);\n\t\t\t\tcomputeCaretRectangle();\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Resets the scroll position to be maintained.\n\t\t\t */\n\t\t\tfunction computeCaretRectangle() {\n\t\t\t\tif ( isSelectionEligibleForScroll() ) {\n\t\t\t\t\tcaretRect = computeCaretRect( defaultView );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Checks if the current situation is elegible for scroll:\n\t\t\t * - There should be one and only one block selected.\n\t\t\t * - The component must contain the selection.\n\t\t\t * - The active element must be contenteditable.\n\t\t\t */\n\t\t\tfunction isSelectionEligibleForScroll() {\n\t\t\t\treturn (\n\t\t\t\t\tnode.contains( ownerDocument.activeElement ) &&\n\t\t\t\t\townerDocument.activeElement.isContentEditable\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tfunction isLastEditableNode() {\n\t\t\t\tconst editableNodes = node.querySelectorAll(\n\t\t\t\t\t'[contenteditable=\"true\"]'\n\t\t\t\t);\n\t\t\t\tconst lastEditableNode =\n\t\t\t\t\teditableNodes[ editableNodes.length - 1 ];\n\t\t\t\treturn lastEditableNode === ownerDocument.activeElement;\n\t\t\t}\n\n\t\t\t// When the user scrolls or resizes, the scroll position should be\n\t\t\t// reset.\n\t\t\tdefaultView.addEventListener( 'scroll', onScrollResize, true );\n\t\t\tdefaultView.addEventListener( 'resize', onScrollResize, true );\n\n\t\t\tnode.addEventListener( 'keydown', onKeyDown );\n\t\t\tnode.addEventListener( 'keyup', maintainCaretPosition );\n\t\t\tnode.addEventListener( 'mousedown', addSelectionChangeListener );\n\t\t\tnode.addEventListener( 'touchstart', addSelectionChangeListener );\n\n\t\t\treturn () => {\n\t\t\t\tdefaultView.removeEventListener(\n\t\t\t\t\t'scroll',\n\t\t\t\t\tonScrollResize,\n\t\t\t\t\ttrue\n\t\t\t\t);\n\t\t\t\tdefaultView.removeEventListener(\n\t\t\t\t\t'resize',\n\t\t\t\t\tonScrollResize,\n\t\t\t\t\ttrue\n\t\t\t\t);\n\n\t\t\t\tnode.removeEventListener( 'keydown', onKeyDown );\n\t\t\t\tnode.removeEventListener( 'keyup', maintainCaretPosition );\n\t\t\t\tnode.removeEventListener(\n\t\t\t\t\t'mousedown',\n\t\t\t\t\taddSelectionChangeListener\n\t\t\t\t);\n\t\t\t\tnode.removeEventListener(\n\t\t\t\t\t'touchstart',\n\t\t\t\t\taddSelectionChangeListener\n\t\t\t\t);\n\n\t\t\t\townerDocument.removeEventListener(\n\t\t\t\t\t'selectionchange',\n\t\t\t\t\tcomputeCaretRectOnSelectionChange\n\t\t\t\t);\n\n\t\t\t\tdefaultView.cancelAnimationFrame( scrollResizeRafId );\n\t\t\t\tdefaultView.cancelAnimationFrame( onKeyDownRafId );\n\t\t\t};\n\t\t},\n\t\t[ hasSelectedBlock ]\n\t);\n}\n\nfunction Typewriter( { children } ) {\n\treturn (\n\t\t<div ref={ useTypewriter() } className=\"block-editor__typewriter\">\n\t\t\t{ children }\n\t\t</div>\n\t);\n}\n\n/**\n * The exported component. The implementation of Typewriter faced technical\n * challenges in Internet Explorer, and is simply skipped, rendering the given\n * props children instead.\n *\n * @type {Component}\n */\nconst TypewriterOrIEBypass = isIE ? ( props ) => props.children : Typewriter;\n\n/**\n * Ensures that the text selection keeps the same vertical distance from the\n * viewport during keyboard events within this component. The vertical distance\n * can vary. It is the last clicked or scrolled to position.\n */\nexport default TypewriterOrIEBypass;\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAJ,OAAA;AAAwD,IAAAK,WAAA,GAAAL,OAAA;AAXxD;AACA;AACA;;AAMA;AACA;AACA;;AAGA,MAAMM,IAAI,GAAGC,MAAM,CAACC,SAAS,CAACC,SAAS,CAACC,OAAO,CAAE,SAAU,CAAC,KAAK,CAAC,CAAC;AACnE,MAAMC,aAAa,GAAG,IAAIC,GAAG,CAAE,CAAEC,YAAE,EAAEC,cAAI,EAAEC,cAAI,EAAEC,eAAK,CAAG,CAAC;AAC1D,MAAMC,wBAAwB,GAAG,IAAI;AAE9B,SAASC,aAAaA,CAAA,EAAG;EAC/B,MAAMC,gBAAgB,GAAG,IAAAC,eAAS,EAC/BC,MAAM,IAAMA,MAAM,CAAEC,YAAiB,CAAC,CAACH,gBAAgB,CAAC,CAAC,EAC3D,EACD,CAAC;EAED,OAAO,IAAAI,qBAAY,EAChBC,IAAI,IAAM;IACX,IAAK,CAAEL,gBAAgB,EAAG;MACzB;IACD;IAEA,MAAM;MAAEM;IAAc,CAAC,GAAGD,IAAI;IAC9B,MAAM;MAAEE;IAAY,CAAC,GAAGD,aAAa;IAErC,IAAIE,iBAAiB;IACrB,IAAIC,cAAc;IAElB,IAAIC,SAAS;IAEb,SAASC,cAAcA,CAAA,EAAG;MACzB,IAAKH,iBAAiB,EAAG;QACxB;MACD;MAEAA,iBAAiB,GAAGD,WAAW,CAACK,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B,qBAAsB,CAAC;MAC1DZ,IAAI,CAACuC,mBAAmB,CACvB,WAAW,EACXH,0BACD,CAAC;MACDpC,IAAI,CAACuC,mBAAmB,CACvB,YAAY,EACZH,0BACD,CAAC;MAEDnC,aAAa,CAACsC,mBAAmB,CAChC,iBAAiB,EACjBD,iCACD,CAAC;MAEDpC,WAAW,CAACS,oBAAoB,CAAER,iBAAkB,CAAC;MACrDD,WAAW,CAACS,oBAAoB,CAAEP,cAAe,CAAC;IACnD,CAAC;EACF,CAAC,EACD,CAAET,gBAAgB,CACnB,CAAC;AACF;AAEA,SAASoD,UAAUA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACnC,oBACC,IAAAnE,WAAA,CAAAoE,GAAA;IAAKC,GAAG,EAAGxD,aAAa,CAAC,CAAG;IAACyD,SAAS,EAAC,0BAA0B;IAAAH,QAAA,EAC9DA;EAAQ,CACN,CAAC;AAER;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMI,oBAAoB,GAAGtE,IAAI,GAAKuE,KAAK,IAAMA,KAAK,CAACL,QAAQ,GAAGD,UAAU;;AAE5E;AACA;AACA;AACA;AACA;AAJA,IAAAO,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAKeJ,oBAAoB","ignoreList":[]}
@@ -249,7 +249,8 @@ function useBlockDropZone({
249
249
  isDragging,
250
250
  isGroupable,
251
251
  isZoomOut,
252
- getSectionRootClientId
252
+ getSectionRootClientId,
253
+ getBlockParents
253
254
  } = (0, _lockUnlock.unlock)((0, _data.useSelect)(_store.store));
254
255
  const {
255
256
  showInsertionPoint,
@@ -267,9 +268,17 @@ function useBlockDropZone({
267
268
  // So, ensure that the drag state is set when the user drags over a drop zone.
268
269
  startDragging();
269
270
  }
271
+ const draggedBlockClientIds = getDraggedBlockClientIds();
272
+ const targetParents = [targetRootClientId, ...getBlockParents(targetRootClientId, true)];
273
+
274
+ // Check if the target is within any of the dragged blocks.
275
+ const isTargetWithinDraggedBlocks = draggedBlockClientIds.some(clientId => targetParents.includes(clientId));
276
+ if (isTargetWithinDraggedBlocks) {
277
+ return;
278
+ }
270
279
  const allowedBlocks = getAllowedBlocks(targetRootClientId);
271
280
  const targetBlockName = getBlockNamesByClientId([targetRootClientId])[0];
272
- const draggedBlockNames = getBlockNamesByClientId(getDraggedBlockClientIds());
281
+ const draggedBlockNames = getBlockNamesByClientId(draggedBlockClientIds);
273
282
  const isBlockDroppingAllowed = isDropTargetValid(getBlockType, allowedBlocks, draggedBlockNames, targetBlockName);
274
283
  if (!isBlockDroppingAllowed) {
275
284
  return;