@wordpress/block-editor 14.5.0 → 14.7.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 (541) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +0 -8
  3. package/build/autocompleters/block.js +13 -5
  4. package/build/autocompleters/block.js.map +1 -1
  5. package/build/components/block-canvas/index.js +10 -0
  6. package/build/components/block-canvas/index.js.map +1 -1
  7. package/build/components/block-card/index.js +2 -2
  8. package/build/components/block-card/index.js.map +1 -1
  9. package/build/components/block-full-height-alignment-control/index.js +1 -1
  10. package/build/components/block-full-height-alignment-control/index.js.map +1 -1
  11. package/build/components/block-list/block.js +15 -29
  12. package/build/components/block-list/block.js.map +1 -1
  13. package/build/components/block-list/block.native.js +1 -7
  14. package/build/components/block-list/block.native.js.map +1 -1
  15. package/build/components/block-list/index.js +5 -5
  16. package/build/components/block-list/index.js.map +1 -1
  17. package/build/components/block-list/use-block-props/index.js +1 -2
  18. package/build/components/block-list/use-block-props/index.js.map +1 -1
  19. package/build/components/block-list/use-block-props/use-focus-first-element.js +4 -3
  20. package/build/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  21. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js +3 -6
  22. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  23. package/build/components/block-list/use-in-between-inserter.js +1 -1
  24. package/build/components/block-list/use-in-between-inserter.js.map +1 -1
  25. package/build/components/block-patterns-list/index.js +23 -26
  26. package/build/components/block-patterns-list/index.js.map +1 -1
  27. package/build/components/block-patterns-paging/index.js +1 -1
  28. package/build/components/block-patterns-paging/index.js.map +1 -1
  29. package/build/components/block-popover/index.js +3 -46
  30. package/build/components/block-popover/index.js.map +1 -1
  31. package/build/components/block-preview/async.js +51 -0
  32. package/build/components/block-preview/async.js.map +1 -0
  33. package/build/components/block-preview/index.js +6 -3
  34. package/build/components/block-preview/index.js.map +1 -1
  35. package/build/components/block-settings-menu/block-settings-dropdown.js +5 -0
  36. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  37. package/build/components/block-settings-menu/index.js +4 -3
  38. package/build/components/block-settings-menu/index.js.map +1 -1
  39. package/build/components/block-toolbar/change-design.js +119 -0
  40. package/build/components/block-toolbar/change-design.js.map +1 -0
  41. package/build/components/block-toolbar/index.js +19 -7
  42. package/build/components/block-toolbar/index.js.map +1 -1
  43. package/build/components/block-tools/index.js +16 -19
  44. package/build/components/block-tools/index.js.map +1 -1
  45. package/build/components/block-tools/insertion-point.js +4 -3
  46. package/build/components/block-tools/insertion-point.js.map +1 -1
  47. package/build/components/block-tools/use-block-toolbar-popover-props.js +1 -1
  48. package/build/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
  49. package/build/components/block-tools/use-show-block-tools.js +7 -10
  50. package/build/components/block-tools/use-show-block-tools.js.map +1 -1
  51. package/build/components/block-tools/zoom-out-mode-inserters.js +20 -29
  52. package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  53. package/build/components/block-variation-transforms/index.js +2 -2
  54. package/build/components/block-variation-transforms/index.js.map +1 -1
  55. package/build/components/block-vertical-alignment-control/ui.js +6 -10
  56. package/build/components/block-vertical-alignment-control/ui.js.map +1 -1
  57. package/build/components/border-radius-control/linked-button.js +7 -10
  58. package/build/components/border-radius-control/linked-button.js.map +1 -1
  59. package/build/components/collab/block-comment-icon-slot.js +18 -0
  60. package/build/components/collab/block-comment-icon-slot.js.map +1 -0
  61. package/build/components/collab/block-comment-icon-toolbar-slot.js +18 -0
  62. package/build/components/collab/block-comment-icon-toolbar-slot.js.map +1 -0
  63. package/build/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +7 -1
  64. package/build/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -1
  65. package/build/components/convert-to-group-buttons/toolbar.js +4 -4
  66. package/build/components/convert-to-group-buttons/toolbar.js.map +1 -1
  67. package/build/components/global-styles/color-panel.js +1 -4
  68. package/build/components/global-styles/color-panel.js.map +1 -1
  69. package/build/components/global-styles/dimensions-panel.js +26 -14
  70. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  71. package/build/components/global-styles/use-global-styles-context.native.js +6 -0
  72. package/build/components/global-styles/use-global-styles-context.native.js.map +1 -1
  73. package/build/components/iframe/get-compatibility-styles.js +4 -4
  74. package/build/components/iframe/get-compatibility-styles.js.map +1 -1
  75. package/build/components/iframe/index.js +33 -22
  76. package/build/components/iframe/index.js.map +1 -1
  77. package/build/components/image-size-control/index.js +61 -20
  78. package/build/components/image-size-control/index.js.map +1 -1
  79. package/build/components/inner-blocks/index.js +9 -5
  80. package/build/components/inner-blocks/index.js.map +1 -1
  81. package/build/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
  82. package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  83. package/build/components/inserter/block-patterns-tab/index.js +1 -2
  84. package/build/components/inserter/block-patterns-tab/index.js.map +1 -1
  85. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +5 -3
  86. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  87. package/build/components/inserter/block-patterns-tab/patterns-filter.js +1 -1
  88. package/build/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
  89. package/build/components/inserter/block-patterns-tab/use-pattern-categories.js +3 -0
  90. package/build/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  91. package/build/components/inserter/block-patterns-tab/utils.js +5 -1
  92. package/build/components/inserter/block-patterns-tab/utils.js.map +1 -1
  93. package/build/components/inserter/category-tabs/index.js +15 -2
  94. package/build/components/inserter/category-tabs/index.js.map +1 -1
  95. package/build/components/inserter/hooks/use-block-types-state.js +1 -1
  96. package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
  97. package/build/components/inserter/hooks/use-patterns-paging.js +0 -5
  98. package/build/components/inserter/hooks/use-patterns-paging.js.map +1 -1
  99. package/build/components/inserter/menu.js +4 -2
  100. package/build/components/inserter/menu.js.map +1 -1
  101. package/build/components/inserter/search-results.js +0 -2
  102. package/build/components/inserter/search-results.js.map +1 -1
  103. package/build/components/inserter-button/index.native.js +1 -1
  104. package/build/components/inserter-button/index.native.js.map +1 -1
  105. package/build/components/inspector-controls-tabs/index.js +0 -2
  106. package/build/components/inspector-controls-tabs/index.js.map +1 -1
  107. package/build/components/inspector-controls-tabs/utils.js +3 -6
  108. package/build/components/inspector-controls-tabs/utils.js.map +1 -1
  109. package/build/components/link-control/link-preview.js +12 -9
  110. package/build/components/link-control/link-preview.js.map +1 -1
  111. package/build/components/list-view/appender.js +4 -3
  112. package/build/components/list-view/appender.js.map +1 -1
  113. package/build/components/list-view/branch.js +6 -5
  114. package/build/components/list-view/branch.js.map +1 -1
  115. package/build/components/list-view/index.js +1 -2
  116. package/build/components/list-view/index.js.map +1 -1
  117. package/build/components/media-placeholder/index.js +4 -4
  118. package/build/components/media-placeholder/index.js.map +1 -1
  119. package/build/components/provider/index.js +1 -1
  120. package/build/components/provider/index.js.map +1 -1
  121. package/build/components/rich-text/event-listeners/index.js +3 -1
  122. package/build/components/rich-text/event-listeners/index.js.map +1 -1
  123. package/build/components/rich-text/index.js +1 -1
  124. package/build/components/rich-text/index.js.map +1 -1
  125. package/build/components/rich-text/index.native.js +2 -6
  126. package/build/components/rich-text/index.native.js.map +1 -1
  127. package/build/components/spacing-sizes-control/index.js +2 -2
  128. package/build/components/spacing-sizes-control/index.js.map +1 -1
  129. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +3 -3
  130. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  131. package/build/components/spacing-sizes-control/linked-button.js +1 -5
  132. package/build/components/spacing-sizes-control/linked-button.js.map +1 -1
  133. package/build/components/tabbed-sidebar/index.js +1 -1
  134. package/build/components/tabbed-sidebar/index.js.map +1 -1
  135. package/build/components/tool-selector/index.js +1 -4
  136. package/build/components/tool-selector/index.js.map +1 -1
  137. package/build/components/url-input/index.js +4 -2
  138. package/build/components/url-input/index.js.map +1 -1
  139. package/build/components/use-block-commands/index.js +6 -7
  140. package/build/components/use-block-commands/index.js.map +1 -1
  141. package/build/components/use-block-drop-zone/index.js +5 -5
  142. package/build/components/use-block-drop-zone/index.js.map +1 -1
  143. package/build/components/use-block-drop-zone/index.native.js +0 -1
  144. package/build/components/use-block-drop-zone/index.native.js.map +1 -1
  145. package/build/components/use-moving-animation/index.js +1 -3
  146. package/build/components/use-moving-animation/index.js.map +1 -1
  147. package/build/components/use-settings/index.js +1 -3
  148. package/build/components/use-settings/index.js.map +1 -1
  149. package/build/components/writing-flow/index.js +5 -3
  150. package/build/components/writing-flow/index.js.map +1 -1
  151. package/build/components/writing-flow/use-tab-nav.js +2 -3
  152. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  153. package/build/hooks/block-bindings.js +19 -8
  154. package/build/hooks/block-bindings.js.map +1 -1
  155. package/build/hooks/contrast-checker.js +0 -1
  156. package/build/hooks/contrast-checker.js.map +1 -1
  157. package/build/hooks/duotone.js +2 -2
  158. package/build/hooks/duotone.js.map +1 -1
  159. package/build/hooks/font-family.js +1 -1
  160. package/build/hooks/font-family.js.map +1 -1
  161. package/build/hooks/style.js +4 -1
  162. package/build/hooks/style.js.map +1 -1
  163. package/build/hooks/supports.js +6 -6
  164. package/build/hooks/supports.js.map +1 -1
  165. package/build/hooks/typography.js +5 -5
  166. package/build/hooks/typography.js.map +1 -1
  167. package/build/hooks/use-zoom-out.js +13 -22
  168. package/build/hooks/use-zoom-out.js.map +1 -1
  169. package/build/hooks/utils.js +2 -2
  170. package/build/hooks/utils.js.map +1 -1
  171. package/build/index.js +0 -7
  172. package/build/index.js.map +1 -1
  173. package/build/lock-unlock.js.map +1 -1
  174. package/build/private-apis.js +6 -3
  175. package/build/private-apis.js.map +1 -1
  176. package/build/store/actions.js +2 -33
  177. package/build/store/actions.js.map +1 -1
  178. package/build/store/defaults.js +1 -1
  179. package/build/store/defaults.js.map +1 -1
  180. package/build/store/private-actions.js +57 -8
  181. package/build/store/private-actions.js.map +1 -1
  182. package/build/store/private-selectors.js +10 -22
  183. package/build/store/private-selectors.js.map +1 -1
  184. package/build/store/reducer.js +16 -6
  185. package/build/store/reducer.js.map +1 -1
  186. package/build/store/selectors.js +53 -15
  187. package/build/store/selectors.js.map +1 -1
  188. package/build/store/utils.js +5 -4
  189. package/build/store/utils.js.map +1 -1
  190. package/build/utils/dom.js +37 -17
  191. package/build/utils/dom.js.map +1 -1
  192. package/build/utils/get-font-styles-and-weights.js +1 -1
  193. package/build/utils/get-font-styles-and-weights.js.map +1 -1
  194. package/build/utils/transform-styles/index.js +4 -3
  195. package/build/utils/transform-styles/index.js.map +1 -1
  196. package/build-module/autocompleters/block.js +14 -6
  197. package/build-module/autocompleters/block.js.map +1 -1
  198. package/build-module/components/block-canvas/index.js +11 -1
  199. package/build-module/components/block-canvas/index.js.map +1 -1
  200. package/build-module/components/block-card/index.js +3 -3
  201. package/build-module/components/block-card/index.js.map +1 -1
  202. package/build-module/components/block-full-height-alignment-control/index.js +1 -1
  203. package/build-module/components/block-full-height-alignment-control/index.js.map +1 -1
  204. package/build-module/components/block-list/block.js +16 -28
  205. package/build-module/components/block-list/block.js.map +1 -1
  206. package/build-module/components/block-list/block.native.js +1 -7
  207. package/build-module/components/block-list/block.native.js.map +1 -1
  208. package/build-module/components/block-list/index.js +5 -5
  209. package/build-module/components/block-list/index.js.map +1 -1
  210. package/build-module/components/block-list/use-block-props/index.js +1 -2
  211. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  212. package/build-module/components/block-list/use-block-props/use-focus-first-element.js +4 -3
  213. package/build-module/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  214. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js +3 -6
  215. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  216. package/build-module/components/block-list/use-in-between-inserter.js +1 -1
  217. package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
  218. package/build-module/components/block-patterns-list/index.js +23 -26
  219. package/build-module/components/block-patterns-list/index.js.map +1 -1
  220. package/build-module/components/block-patterns-paging/index.js +1 -1
  221. package/build-module/components/block-patterns-paging/index.js.map +1 -1
  222. package/build-module/components/block-popover/index.js +4 -47
  223. package/build-module/components/block-popover/index.js.map +1 -1
  224. package/build-module/components/block-preview/async.js +44 -0
  225. package/build-module/components/block-preview/async.js.map +1 -0
  226. package/build-module/components/block-preview/index.js +6 -3
  227. package/build-module/components/block-preview/index.js.map +1 -1
  228. package/build-module/components/block-settings-menu/block-settings-dropdown.js +5 -0
  229. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  230. package/build-module/components/block-settings-menu/index.js +5 -4
  231. package/build-module/components/block-settings-menu/index.js.map +1 -1
  232. package/build-module/components/block-toolbar/change-design.js +111 -0
  233. package/build-module/components/block-toolbar/change-design.js.map +1 -0
  234. package/build-module/components/block-toolbar/index.js +19 -7
  235. package/build-module/components/block-toolbar/index.js.map +1 -1
  236. package/build-module/components/block-tools/index.js +17 -20
  237. package/build-module/components/block-tools/index.js.map +1 -1
  238. package/build-module/components/block-tools/insertion-point.js +4 -3
  239. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  240. package/build-module/components/block-tools/use-block-toolbar-popover-props.js +2 -2
  241. package/build-module/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
  242. package/build-module/components/block-tools/use-show-block-tools.js +7 -10
  243. package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
  244. package/build-module/components/block-tools/zoom-out-mode-inserters.js +20 -29
  245. package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  246. package/build-module/components/block-variation-transforms/index.js +2 -2
  247. package/build-module/components/block-variation-transforms/index.js.map +1 -1
  248. package/build-module/components/block-vertical-alignment-control/ui.js +6 -10
  249. package/build-module/components/block-vertical-alignment-control/ui.js.map +1 -1
  250. package/build-module/components/border-radius-control/linked-button.js +8 -11
  251. package/build-module/components/border-radius-control/linked-button.js.map +1 -1
  252. package/build-module/components/collab/block-comment-icon-slot.js +11 -0
  253. package/build-module/components/collab/block-comment-icon-slot.js.map +1 -0
  254. package/build-module/components/collab/block-comment-icon-toolbar-slot.js +11 -0
  255. package/build-module/components/collab/block-comment-icon-toolbar-slot.js.map +1 -0
  256. package/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +7 -1
  257. package/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -1
  258. package/build-module/components/convert-to-group-buttons/toolbar.js +4 -4
  259. package/build-module/components/convert-to-group-buttons/toolbar.js.map +1 -1
  260. package/build-module/components/global-styles/color-panel.js +2 -5
  261. package/build-module/components/global-styles/color-panel.js.map +1 -1
  262. package/build-module/components/global-styles/dimensions-panel.js +26 -14
  263. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  264. package/build-module/components/global-styles/use-global-styles-context.native.js +6 -0
  265. package/build-module/components/global-styles/use-global-styles-context.native.js.map +1 -1
  266. package/build-module/components/iframe/get-compatibility-styles.js +4 -4
  267. package/build-module/components/iframe/get-compatibility-styles.js.map +1 -1
  268. package/build-module/components/iframe/index.js +33 -22
  269. package/build-module/components/iframe/index.js.map +1 -1
  270. package/build-module/components/image-size-control/index.js +62 -21
  271. package/build-module/components/image-size-control/index.js.map +1 -1
  272. package/build-module/components/inner-blocks/index.js +9 -5
  273. package/build-module/components/inner-blocks/index.js.map +1 -1
  274. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
  275. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  276. package/build-module/components/inserter/block-patterns-tab/index.js +1 -2
  277. package/build-module/components/inserter/block-patterns-tab/index.js.map +1 -1
  278. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +6 -4
  279. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  280. package/build-module/components/inserter/block-patterns-tab/patterns-filter.js +1 -1
  281. package/build-module/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
  282. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js +4 -1
  283. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  284. package/build-module/components/inserter/block-patterns-tab/utils.js +4 -0
  285. package/build-module/components/inserter/block-patterns-tab/utils.js.map +1 -1
  286. package/build-module/components/inserter/category-tabs/index.js +15 -2
  287. package/build-module/components/inserter/category-tabs/index.js.map +1 -1
  288. package/build-module/components/inserter/hooks/use-block-types-state.js +1 -1
  289. package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
  290. package/build-module/components/inserter/hooks/use-patterns-paging.js +1 -6
  291. package/build-module/components/inserter/hooks/use-patterns-paging.js.map +1 -1
  292. package/build-module/components/inserter/menu.js +5 -3
  293. package/build-module/components/inserter/menu.js.map +1 -1
  294. package/build-module/components/inserter/search-results.js +0 -2
  295. package/build-module/components/inserter/search-results.js.map +1 -1
  296. package/build-module/components/inserter-button/index.native.js +1 -1
  297. package/build-module/components/inserter-button/index.native.js.map +1 -1
  298. package/build-module/components/inspector-controls-tabs/index.js +0 -2
  299. package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
  300. package/build-module/components/inspector-controls-tabs/utils.js +3 -6
  301. package/build-module/components/inspector-controls-tabs/utils.js.map +1 -1
  302. package/build-module/components/link-control/link-preview.js +13 -10
  303. package/build-module/components/link-control/link-preview.js.map +1 -1
  304. package/build-module/components/list-view/appender.js +4 -3
  305. package/build-module/components/list-view/appender.js.map +1 -1
  306. package/build-module/components/list-view/branch.js +7 -6
  307. package/build-module/components/list-view/branch.js.map +1 -1
  308. package/build-module/components/list-view/index.js +1 -2
  309. package/build-module/components/list-view/index.js.map +1 -1
  310. package/build-module/components/media-placeholder/index.js +4 -4
  311. package/build-module/components/media-placeholder/index.js.map +1 -1
  312. package/build-module/components/provider/index.js +1 -1
  313. package/build-module/components/provider/index.js.map +1 -1
  314. package/build-module/components/rich-text/event-listeners/index.js +4 -2
  315. package/build-module/components/rich-text/event-listeners/index.js.map +1 -1
  316. package/build-module/components/rich-text/index.js +1 -1
  317. package/build-module/components/rich-text/index.js.map +1 -1
  318. package/build-module/components/rich-text/index.native.js +2 -6
  319. package/build-module/components/rich-text/index.native.js.map +1 -1
  320. package/build-module/components/spacing-sizes-control/index.js +3 -3
  321. package/build-module/components/spacing-sizes-control/index.js.map +1 -1
  322. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +4 -4
  323. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  324. package/build-module/components/spacing-sizes-control/linked-button.js +2 -6
  325. package/build-module/components/spacing-sizes-control/linked-button.js.map +1 -1
  326. package/build-module/components/tabbed-sidebar/index.js +1 -1
  327. package/build-module/components/tabbed-sidebar/index.js.map +1 -1
  328. package/build-module/components/tool-selector/index.js +1 -4
  329. package/build-module/components/tool-selector/index.js.map +1 -1
  330. package/build-module/components/url-input/index.js +4 -2
  331. package/build-module/components/url-input/index.js.map +1 -1
  332. package/build-module/components/use-block-commands/index.js +5 -5
  333. package/build-module/components/use-block-commands/index.js.map +1 -1
  334. package/build-module/components/use-block-drop-zone/index.js +5 -5
  335. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  336. package/build-module/components/use-block-drop-zone/index.native.js +0 -1
  337. package/build-module/components/use-block-drop-zone/index.native.js.map +1 -1
  338. package/build-module/components/use-moving-animation/index.js +1 -3
  339. package/build-module/components/use-moving-animation/index.js.map +1 -1
  340. package/build-module/components/use-settings/index.js +1 -3
  341. package/build-module/components/use-settings/index.js.map +1 -1
  342. package/build-module/components/writing-flow/index.js +5 -3
  343. package/build-module/components/writing-flow/index.js.map +1 -1
  344. package/build-module/components/writing-flow/use-tab-nav.js +2 -3
  345. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  346. package/build-module/hooks/block-bindings.js +20 -9
  347. package/build-module/hooks/block-bindings.js.map +1 -1
  348. package/build-module/hooks/contrast-checker.js +0 -1
  349. package/build-module/hooks/contrast-checker.js.map +1 -1
  350. package/build-module/hooks/duotone.js +2 -2
  351. package/build-module/hooks/duotone.js.map +1 -1
  352. package/build-module/hooks/font-family.js +1 -1
  353. package/build-module/hooks/font-family.js.map +1 -1
  354. package/build-module/hooks/style.js +4 -1
  355. package/build-module/hooks/style.js.map +1 -1
  356. package/build-module/hooks/supports.js +6 -6
  357. package/build-module/hooks/supports.js.map +1 -1
  358. package/build-module/hooks/typography.js +5 -5
  359. package/build-module/hooks/typography.js.map +1 -1
  360. package/build-module/hooks/use-zoom-out.js +15 -23
  361. package/build-module/hooks/use-zoom-out.js.map +1 -1
  362. package/build-module/hooks/utils.js +2 -2
  363. package/build-module/hooks/utils.js.map +1 -1
  364. package/build-module/index.js +1 -1
  365. package/build-module/index.js.map +1 -1
  366. package/build-module/lock-unlock.js.map +1 -1
  367. package/build-module/private-apis.js +7 -5
  368. package/build-module/private-apis.js.map +1 -1
  369. package/build-module/store/actions.js +2 -33
  370. package/build-module/store/actions.js.map +1 -1
  371. package/build-module/store/defaults.js +1 -1
  372. package/build-module/store/defaults.js.map +1 -1
  373. package/build-module/store/private-actions.js +54 -7
  374. package/build-module/store/private-actions.js.map +1 -1
  375. package/build-module/store/private-selectors.js +10 -21
  376. package/build-module/store/private-selectors.js.map +1 -1
  377. package/build-module/store/reducer.js +16 -6
  378. package/build-module/store/reducer.js.map +1 -1
  379. package/build-module/store/selectors.js +54 -16
  380. package/build-module/store/selectors.js.map +1 -1
  381. package/build-module/store/utils.js +3 -3
  382. package/build-module/store/utils.js.map +1 -1
  383. package/build-module/utils/dom.js +35 -16
  384. package/build-module/utils/dom.js.map +1 -1
  385. package/build-module/utils/get-font-styles-and-weights.js +2 -2
  386. package/build-module/utils/get-font-styles-and-weights.js.map +1 -1
  387. package/build-module/utils/transform-styles/index.js +3 -2
  388. package/build-module/utils/transform-styles/index.js.map +1 -1
  389. package/build-style/content-rtl.css +16 -10
  390. package/build-style/content.css +16 -10
  391. package/build-style/style-rtl.css +47 -25
  392. package/build-style/style.css +47 -25
  393. package/build-types/utils/dom.d.ts +7 -9
  394. package/build-types/utils/dom.d.ts.map +1 -1
  395. package/package.json +34 -32
  396. package/src/autocompleters/block.js +16 -7
  397. package/src/components/block-canvas/index.js +17 -1
  398. package/src/components/block-canvas/style.scss +3 -1
  399. package/src/components/block-card/index.js +3 -3
  400. package/src/components/block-full-height-alignment-control/index.js +1 -1
  401. package/src/components/block-inspector/style.scss +2 -7
  402. package/src/components/block-list/block.js +29 -50
  403. package/src/components/block-list/block.native.js +0 -4
  404. package/src/components/block-list/content.scss +1 -1
  405. package/src/components/block-list/index.js +4 -4
  406. package/src/components/block-list/use-block-props/index.js +0 -2
  407. package/src/components/block-list/use-block-props/use-focus-first-element.js +5 -3
  408. package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +7 -20
  409. package/src/components/block-list/use-in-between-inserter.js +1 -1
  410. package/src/components/block-patterns-list/README.md +8 -8
  411. package/src/components/block-patterns-list/index.js +35 -51
  412. package/src/components/block-patterns-list/stories/fixtures.js +834 -0
  413. package/src/components/block-patterns-list/stories/index.story.js +64 -0
  414. package/src/components/block-patterns-list/style.scss +2 -0
  415. package/src/components/block-patterns-paging/index.js +1 -1
  416. package/src/components/block-popover/index.js +4 -66
  417. package/src/components/block-preview/async.js +43 -0
  418. package/src/components/block-preview/index.js +8 -3
  419. package/src/components/block-settings-menu/block-settings-dropdown.js +4 -0
  420. package/src/components/block-settings-menu/index.js +3 -0
  421. package/src/components/block-toolbar/change-design.js +127 -0
  422. package/src/components/block-toolbar/index.js +25 -8
  423. package/src/components/block-toolbar/style.scss +16 -0
  424. package/src/components/block-tools/index.js +30 -27
  425. package/src/components/block-tools/insertion-point.js +4 -3
  426. package/src/components/block-tools/style.scss +12 -20
  427. package/src/components/block-tools/use-block-toolbar-popover-props.js +2 -2
  428. package/src/components/block-tools/use-show-block-tools.js +3 -14
  429. package/src/components/block-tools/zoom-out-mode-inserters.js +25 -40
  430. package/src/components/block-variation-transforms/index.js +2 -2
  431. package/src/components/block-vertical-alignment-control/ui.js +11 -15
  432. package/src/components/border-radius-control/linked-button.js +9 -11
  433. package/src/components/collab/block-comment-icon-slot.js +12 -0
  434. package/src/components/collab/block-comment-icon-toolbar-slot.js +12 -0
  435. package/src/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +7 -1
  436. package/src/components/convert-to-group-buttons/toolbar.js +4 -4
  437. package/src/components/default-block-appender/content.scss +13 -19
  438. package/src/components/global-styles/color-panel.js +2 -10
  439. package/src/components/global-styles/dimensions-panel.js +22 -16
  440. package/src/components/global-styles/test/use-global-styles-context.native.js +1 -0
  441. package/src/components/global-styles/use-global-styles-context.native.js +6 -0
  442. package/src/components/iframe/content.scss +4 -9
  443. package/src/components/iframe/get-compatibility-styles.js +4 -9
  444. package/src/components/iframe/index.js +48 -34
  445. package/src/components/iframe/style.scss +2 -3
  446. package/src/components/image-size-control/index.js +74 -43
  447. package/src/components/image-size-control/test/index.js +5 -63
  448. package/src/components/inner-blocks/index.js +12 -6
  449. package/src/components/inserter/block-patterns-explorer/pattern-list.js +3 -6
  450. package/src/components/inserter/block-patterns-tab/index.js +0 -1
  451. package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +10 -4
  452. package/src/components/inserter/block-patterns-tab/patterns-filter.js +1 -1
  453. package/src/components/inserter/block-patterns-tab/use-pattern-categories.js +8 -0
  454. package/src/components/inserter/block-patterns-tab/utils.js +5 -0
  455. package/src/components/inserter/category-tabs/index.js +16 -2
  456. package/src/components/inserter/hooks/use-block-types-state.js +6 -1
  457. package/src/components/inserter/hooks/use-patterns-paging.js +1 -6
  458. package/src/components/inserter/menu.js +6 -4
  459. package/src/components/inserter/search-results.js +0 -6
  460. package/src/components/inserter/style.scss +13 -0
  461. package/src/components/inserter-button/index.native.js +1 -1
  462. package/src/components/inspector-controls-tabs/index.js +1 -6
  463. package/src/components/inspector-controls-tabs/utils.js +0 -3
  464. package/src/components/link-control/link-preview.js +15 -8
  465. package/src/components/link-control/test/index.js +63 -24
  466. package/src/components/list-view/appender.js +5 -6
  467. package/src/components/list-view/branch.js +8 -6
  468. package/src/components/list-view/index.js +1 -2
  469. package/src/components/media-placeholder/index.js +4 -4
  470. package/src/components/provider/index.js +1 -3
  471. package/src/components/provider/test/experimental-provider.js +43 -1
  472. package/src/components/rich-text/event-listeners/index.js +4 -2
  473. package/src/components/rich-text/index.js +8 -1
  474. package/src/components/rich-text/index.native.js +0 -2
  475. package/src/components/spacing-sizes-control/index.js +3 -3
  476. package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +4 -4
  477. package/src/components/spacing-sizes-control/linked-button.js +2 -12
  478. package/src/components/tabbed-sidebar/index.js +1 -1
  479. package/src/components/tabbed-sidebar/style.scss +1 -1
  480. package/src/components/tool-selector/index.js +1 -5
  481. package/src/components/url-input/index.js +4 -5
  482. package/src/components/use-block-commands/index.js +245 -234
  483. package/src/components/use-block-drop-zone/index.js +5 -5
  484. package/src/components/use-block-drop-zone/index.native.js +0 -1
  485. package/src/components/use-moving-animation/index.js +0 -1
  486. package/src/components/use-settings/index.js +0 -1
  487. package/src/components/writing-flow/index.js +5 -3
  488. package/src/components/writing-flow/use-tab-nav.js +1 -2
  489. package/src/hooks/block-bindings.js +48 -31
  490. package/src/hooks/contrast-checker.js +0 -1
  491. package/src/hooks/duotone.js +2 -2
  492. package/src/hooks/font-family.js +1 -1
  493. package/src/hooks/style.js +7 -3
  494. package/src/hooks/supports.js +6 -6
  495. package/src/hooks/typography.js +5 -5
  496. package/src/hooks/use-zoom-out.js +14 -34
  497. package/src/hooks/utils.js +7 -2
  498. package/src/index.js +0 -1
  499. package/src/private-apis.js +6 -3
  500. package/src/store/actions.js +3 -52
  501. package/src/store/defaults.js +2 -1
  502. package/src/store/private-actions.js +71 -8
  503. package/src/store/private-selectors.js +14 -25
  504. package/src/store/reducer.js +25 -11
  505. package/src/store/selectors.js +116 -53
  506. package/src/store/test/actions.js +41 -0
  507. package/src/store/test/private-selectors.js +5 -0
  508. package/src/store/test/reducer.js +23 -0
  509. package/src/store/utils.js +12 -11
  510. package/src/utils/dom.js +42 -17
  511. package/src/utils/get-font-styles-and-weights.js +2 -2
  512. package/src/utils/test/dom.js +224 -0
  513. package/src/utils/transform-styles/index.js +3 -2
  514. package/tsconfig.json +1 -0
  515. package/tsconfig.tsbuildinfo +1 -1
  516. package/build/components/block-list/use-block-props/use-zoom-out-mode-exit.js +0 -57
  517. package/build/components/block-list/use-block-props/use-zoom-out-mode-exit.js.map +0 -1
  518. package/build/components/block-toolbar/shuffle.js +0 -110
  519. package/build/components/block-toolbar/shuffle.js.map +0 -1
  520. package/build/components/block-tools/zoom-out-popover.js +0 -58
  521. package/build/components/block-tools/zoom-out-popover.js.map +0 -1
  522. package/build/components/block-tools/zoom-out-toolbar.js +0 -132
  523. package/build/components/block-tools/zoom-out-toolbar.js.map +0 -1
  524. package/build/components/block-vertical-alignment-control/icons.js +0 -48
  525. package/build/components/block-vertical-alignment-control/icons.js.map +0 -1
  526. package/build-module/components/block-list/use-block-props/use-zoom-out-mode-exit.js +0 -51
  527. package/build-module/components/block-list/use-block-props/use-zoom-out-mode-exit.js.map +0 -1
  528. package/build-module/components/block-toolbar/shuffle.js +0 -103
  529. package/build-module/components/block-toolbar/shuffle.js.map +0 -1
  530. package/build-module/components/block-tools/zoom-out-popover.js +0 -49
  531. package/build-module/components/block-tools/zoom-out-popover.js.map +0 -1
  532. package/build-module/components/block-tools/zoom-out-toolbar.js +0 -124
  533. package/build-module/components/block-tools/zoom-out-toolbar.js.map +0 -1
  534. package/build-module/components/block-vertical-alignment-control/icons.js +0 -41
  535. package/build-module/components/block-vertical-alignment-control/icons.js.map +0 -1
  536. package/src/components/block-list/use-block-props/use-zoom-out-mode-exit.js +0 -65
  537. package/src/components/block-toolbar/shuffle.js +0 -111
  538. package/src/components/block-tools/zoom-out-popover.js +0 -47
  539. package/src/components/block-tools/zoom-out-toolbar.js +0 -135
  540. package/src/components/block-vertical-alignment-control/icons.js +0 -34
  541. /package/src/{lock-unlock.js → lock-unlock.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"names":["_hooks","require","_blocks","_tokenList","_interopRequireDefault","_components","_utils","_typography","_lockUnlock","FONT_FAMILY_SUPPORT_KEY","exports","kebabCase","unlock","componentsPrivateApis","addAttributes","settings","hasBlockSupport","attributes","fontFamily","Object","assign","type","addSaveProps","props","blockType","shouldSkipSerialization","TYPOGRAPHY_SUPPORT_KEY","classes","TokenList","className","add","newClassName","value","undefined","useBlockProps","name","_default","default","attributeKeys","hasSupport","resetFontFamily","setAttributes","addFilter"],"sources":["@wordpress/block-editor/src/hooks/font-family.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { hasBlockSupport } from '@wordpress/blocks';\nimport TokenList from '@wordpress/token-list';\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { shouldSkipSerialization } from './utils';\nimport { TYPOGRAPHY_SUPPORT_KEY } from './typography';\nimport { unlock } from '../lock-unlock';\n\nexport const FONT_FAMILY_SUPPORT_KEY = 'typography.__experimentalFontFamily';\nconst { kebabCase } = unlock( componentsPrivateApis );\n\n/**\n * Filters registered block settings, extending attributes to include\n * the `fontFamily` attribute.\n *\n * @param {Object} settings Original block settings\n * @return {Object} Filtered block settings\n */\nfunction addAttributes( settings ) {\n\tif ( ! hasBlockSupport( settings, FONT_FAMILY_SUPPORT_KEY ) ) {\n\t\treturn settings;\n\t}\n\n\t// Allow blocks to specify a default value if needed.\n\tif ( ! settings.attributes.fontFamily ) {\n\t\tObject.assign( settings.attributes, {\n\t\t\tfontFamily: {\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn settings;\n}\n\n/**\n * Override props assigned to save component to inject font family.\n *\n * @param {Object} props Additional props applied to save element\n * @param {Object} blockType Block type\n * @param {Object} attributes Block attributes\n * @return {Object} Filtered props applied to save element\n */\nfunction addSaveProps( props, blockType, attributes ) {\n\tif ( ! hasBlockSupport( blockType, FONT_FAMILY_SUPPORT_KEY ) ) {\n\t\treturn props;\n\t}\n\n\tif (\n\t\tshouldSkipSerialization(\n\t\t\tblockType,\n\t\t\tTYPOGRAPHY_SUPPORT_KEY,\n\t\t\t'fontFamily'\n\t\t)\n\t) {\n\t\treturn props;\n\t}\n\n\tif ( ! attributes?.fontFamily ) {\n\t\treturn props;\n\t}\n\n\t// Use TokenList to dedupe classes.\n\tconst classes = new TokenList( props.className );\n\tclasses.add( `has-${ kebabCase( attributes?.fontFamily ) }-font-family` );\n\tconst newClassName = classes.value;\n\tprops.className = newClassName ? newClassName : undefined;\n\n\treturn props;\n}\n\nfunction useBlockProps( { name, fontFamily } ) {\n\treturn addSaveProps( {}, name, { fontFamily } );\n}\n\nexport default {\n\tuseBlockProps,\n\taddSaveProps,\n\tattributeKeys: [ 'fontFamily' ],\n\thasSupport( name ) {\n\t\treturn hasBlockSupport( name, FONT_FAMILY_SUPPORT_KEY );\n\t},\n};\n\n/**\n * Resets the font family block support attribute. This can be used when\n * disabling the font family support controls for a block via a progressive\n * discovery panel.\n *\n * @param {Object} props Block props.\n * @param {Object} props.setAttributes Function to set block's attributes.\n */\nexport function resetFontFamily( { setAttributes } ) {\n\tsetAttributes( { fontFamily: undefined } );\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/fontFamily/addAttribute',\n\taddAttributes\n);\n"],"mappings":";;;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAbA;AACA;AACA;;AAMA;AACA;AACA;;AAKO,MAAMQ,uBAAuB,GAAAC,OAAA,CAAAD,uBAAA,GAAG,qCAAqC;AAC5E,MAAM;EAAEE;AAAU,CAAC,GAAG,IA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W,CAAE,CAAC;AAChD;AAAC,IAAAkB,QAAA,GAAA1B,OAAA,CAAA2B,OAAA,GAEc;EACdH,aAAa;EACbZ,YAAY;EACZgB,aAAa,EAAE,CAAE,YAAY,CAAE;EAC/BC,UAAUA,CAAEJ,IAAI,EAAG;IAClB,OAAO,IAAAnB,uBAAe,EAAEmB,IAAI,EAAE1B,uBAAwB,CAAC;EACxD;AACD,CAAC;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS+B,eAAeA,CAAE;EAAEC;AAAc,CAAC,EAAG;EACpDA,aAAa,CAAE;IAAEvB,UAAU,EAAEe;EAAU,CAAE,CAAC;AAC3C;AAEA,IAAAS,gBAAS,EACR,0BAA0B,EAC1B,8BAA8B,EAC9B5B,aACD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_hooks","require","_blocks","_tokenList","_interopRequireDefault","_components","_utils","_typography","_lockUnlock","FONT_FAMILY_SUPPORT_KEY","exports","kebabCase","unlock","componentsPrivateApis","addAttributes","settings","hasBlockSupport","attributes","fontFamily","Object","assign","type","addSaveProps","props","blockType","shouldSkipSerialization","TYPOGRAPHY_SUPPORT_KEY","classes","TokenList","className","add","newClassName","value","undefined","useBlockProps","name","_default","default","attributeKeys","hasSupport","resetFontFamily","setAttributes","addFilter"],"sources":["@wordpress/block-editor/src/hooks/font-family.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { hasBlockSupport } from '@wordpress/blocks';\nimport TokenList from '@wordpress/token-list';\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { shouldSkipSerialization } from './utils';\nimport { TYPOGRAPHY_SUPPORT_KEY } from './typography';\nimport { unlock } from '../lock-unlock';\n\nexport const FONT_FAMILY_SUPPORT_KEY = 'typography.fontFamily';\nconst { kebabCase } = unlock( componentsPrivateApis );\n\n/**\n * Filters registered block settings, extending attributes to include\n * the `fontFamily` attribute.\n *\n * @param {Object} settings Original block settings\n * @return {Object} Filtered block settings\n */\nfunction addAttributes( settings ) {\n\tif ( ! hasBlockSupport( settings, FONT_FAMILY_SUPPORT_KEY ) ) {\n\t\treturn settings;\n\t}\n\n\t// Allow blocks to specify a default value if needed.\n\tif ( ! settings.attributes.fontFamily ) {\n\t\tObject.assign( settings.attributes, {\n\t\t\tfontFamily: {\n\t\t\t\ttype: 'string',\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn settings;\n}\n\n/**\n * Override props assigned to save component to inject font family.\n *\n * @param {Object} props Additional props applied to save element\n * @param {Object} blockType Block type\n * @param {Object} attributes Block attributes\n * @return {Object} Filtered props applied to save element\n */\nfunction addSaveProps( props, blockType, attributes ) {\n\tif ( ! hasBlockSupport( blockType, FONT_FAMILY_SUPPORT_KEY ) ) {\n\t\treturn props;\n\t}\n\n\tif (\n\t\tshouldSkipSerialization(\n\t\t\tblockType,\n\t\t\tTYPOGRAPHY_SUPPORT_KEY,\n\t\t\t'fontFamily'\n\t\t)\n\t) {\n\t\treturn props;\n\t}\n\n\tif ( ! attributes?.fontFamily ) {\n\t\treturn props;\n\t}\n\n\t// Use TokenList to dedupe classes.\n\tconst classes = new TokenList( props.className );\n\tclasses.add( `has-${ kebabCase( attributes?.fontFamily ) }-font-family` );\n\tconst newClassName = classes.value;\n\tprops.className = newClassName ? newClassName : undefined;\n\n\treturn props;\n}\n\nfunction useBlockProps( { name, fontFamily } ) {\n\treturn addSaveProps( {}, name, { fontFamily } );\n}\n\nexport default {\n\tuseBlockProps,\n\taddSaveProps,\n\tattributeKeys: [ 'fontFamily' ],\n\thasSupport( name ) {\n\t\treturn hasBlockSupport( name, FONT_FAMILY_SUPPORT_KEY );\n\t},\n};\n\n/**\n * Resets the font family block support attribute. This can be used when\n * disabling the font family support controls for a block via a progressive\n * discovery panel.\n *\n * @param {Object} props Block props.\n * @param {Object} props.setAttributes Function to set block's attributes.\n */\nexport function resetFontFamily( { setAttributes } ) {\n\tsetAttributes( { fontFamily: undefined } );\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/fontFamily/addAttribute',\n\taddAttributes\n);\n"],"mappings":";;;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAbA;AACA;AACA;;AAMA;AACA;AACA;;AAKO,MAAMQ,uBAAuB,GAAAC,OAAA,CAAAD,uBAAA,GAAG,uBAAuB;AAC9D,MAAM;EAAEE;AAAU,CAAC,GAAG,IAAAC,kBAAM,EAAEC,uBAAsB,CAAC;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,aAAaA,CAAEC,QAAQ,EAAG;EAClC,IAAK,CAAE,IAAAC,uBAAe,EAAED,QAAQ,EAAEN,uBAAwB,CAAC,EAAG;IAC7D,OAAOM,QAAQ;EAChB;;EAEA;EACA,IAAK,CAAEA,QAAQ,CAACE,UAAU,CAACC,UAAU,EAAG;IACvCC,MAAM,CAACC,MAAM,CAAEL,QAAQ,CAACE,UAAU,EAAE;MACnCC,UAAU,EAAE;QACXG,IAAI,EAAE;MACP;IACD,CAAE,CAAC;EACJ;EAEA,OAAON,QAAQ;AAChB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASO,YAAYA,CAAEC,KAAK,EAAEC,SAAS,EAAEP,UAAU,EAAG;EACrD,IAAK,CAAE,IAAAD,uBAAe,EAAEQ,SAAS,EAAEf,uBAAwB,CAAC,EAAG;IAC9D,OAAOc,KAAK;EACb;EAEA,IACC,IAAAE,8BAAuB,EACtBD,SAAS,EACTE,kCAAsB,EACtB,YACD,CAAC,EACA;IACD,OAAOH,KAAK;EACb;EAEA,IAAK,CAAEN,UAAU,EAAEC,UAAU,EAAG;IAC/B,OAAOK,KAAK;EACb;;EAEA;EACA,MAAMI,OAAO,GAAG,IAAIC,kBAAS,CAAEL,KAAK,CAACM,SAAU,CAAC;EAChDF,OAAO,CAACG,GAAG,CAAE,OAAQnB,SAAS,CAAEM,UAAU,EAAEC,UAAW,CAAC,cAAgB,CAAC;EACzE,MAAMa,YAAY,GAAGJ,OAAO,CAACK,KAAK;EAClCT,KAAK,CAACM,SAAS,GAAGE,YAAY,GAAGA,YAAY,GAAGE,SAAS;EAEzD,OAAOV,KAAK;AACb;AAEA,SAASW,aAAaA,CAAE;EAAEC,IAAI;EAAEjB;AAAW,CAAC,EAAG;EAC9C,OAAOI,YAAY,CAAE,CAAC,CAAC,EAAEa,IAAI,EAAE;IAAEjB;EAAW,CAAE,CAAC;AAChD;AAAC,IAAAkB,QAAA,GAAA1B,OAAA,CAAA2B,OAAA,GAEc;EACdH,aAAa;EACbZ,YAAY;EACZgB,aAAa,EAAE,CAAE,YAAY,CAAE;EAC/BC,UAAUA,CAAEJ,IAAI,EAAG;IAClB,OAAO,IAAAnB,uBAAe,EAAEmB,IAAI,EAAE1B,uBAAwB,CAAC;EACxD;AACD,CAAC;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS+B,eAAeA,CAAE;EAAEC;AAAc,CAAC,EAAG;EACpDA,aAAa,CAAE;IAAEvB,UAAU,EAAEe;EAAU,CAAE,CAAC;AAC3C;AAEA,IAAAS,gBAAS,EACR,0BAA0B,EAC1B,8BAA8B,EAC9B5B,aACD,CAAC","ignoreList":[]}
@@ -333,11 +333,14 @@ const elementTypes = [{
333
333
  elementType: 'heading',
334
334
  elements: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']
335
335
  }];
336
+
337
+ // Used for generating the instance ID
338
+ const STYLE_BLOCK_PROPS_REFERENCE = {};
336
339
  function useBlockProps({
337
340
  name,
338
341
  style
339
342
  }) {
340
- const blockElementsContainerIdentifier = `wp-elements-${(0, _compose.useInstanceId)(useBlockProps)}`;
343
+ const blockElementsContainerIdentifier = (0, _compose.useInstanceId)(STYLE_BLOCK_PROPS_REFERENCE, 'wp-elements');
341
344
  const baseElementSelector = `.${blockElementsContainerIdentifier}`;
342
345
  const blockElementStyles = style?.elements;
343
346
  const styles = (0, _element.useMemo)(() => {
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_hooks","_blocks","_compose","_styleEngine","_background","_border","_color","_typography","_dimensions","_utils","_utils2","_blockEditingMode","_jsxRuntime","styleSupportKeys","TYPOGRAPHY_SUPPORT_KEYS","BORDER_SUPPORT_KEY","COLOR_SUPPORT_KEY","DIMENSIONS_SUPPORT_KEY","BACKGROUND_SUPPORT_KEY","SPACING_SUPPORT_KEY","SHADOW_SUPPORT_KEY","hasStyleSupport","nameOrType","some","key","hasBlockSupport","getInlineStyles","styles","output","getCSSRules","forEach","rule","value","addAttribute","settings","attributes","style","Object","assign","type","skipSerializationPathsEdit","TYPOGRAPHY_SUPPORT_KEY","skipSerializationPathsSave","skipSerializationPathsSaveChecks","renamedFeatures","gradients","omitStyle","paths","preserveReference","newStyle","JSON","parse","stringify","Array","isArray","path","split","length","firstSubpath","restPath","addSaveProps","props","blockNameOrType","skipPaths","entries","indicator","skipSerialization","getBlockSupport","featureName","feature","BlockStyleControls","clientId","name","setAttributes","__unstableParentLayout","useBlockSettings","blockEditingMode","useBlockEditingMode","passedProps","typography","textAlign","jsxs","Fragment","children","jsx","ColorEdit","BackgroundImagePanel","TypographyPanel","BorderPanel","DimensionsPanel","_default","exports","default","edit","hasSupport","attributeKeys","useBlockProps","elementTypes","elementType","pseudo","elements","blockElementsContainerIdentifier","useInstanceId","baseElementSelector","blockElementStyles","useMemo","elementCSSRules","shouldSkipSerialization","elementStyles","selector","scopeSelector","ELEMENTS","push","compileCSS","pseudoSelector","element","join","undefined","useStyleOverride","css","className","addFilter"],"sources":["@wordpress/block-editor/src/hooks/style.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { addFilter } from '@wordpress/hooks';\nimport {\n\tgetBlockSupport,\n\thasBlockSupport,\n\t__EXPERIMENTAL_ELEMENTS as ELEMENTS,\n} from '@wordpress/blocks';\nimport { useInstanceId } from '@wordpress/compose';\nimport { getCSSRules, compileCSS } from '@wordpress/style-engine';\n\n/**\n * Internal dependencies\n */\nimport { BACKGROUND_SUPPORT_KEY, BackgroundImagePanel } from './background';\nimport { BORDER_SUPPORT_KEY, BorderPanel, SHADOW_SUPPORT_KEY } from './border';\nimport { COLOR_SUPPORT_KEY, ColorEdit } from './color';\nimport {\n\tTypographyPanel,\n\tTYPOGRAPHY_SUPPORT_KEY,\n\tTYPOGRAPHY_SUPPORT_KEYS,\n} from './typography';\nimport {\n\tDIMENSIONS_SUPPORT_KEY,\n\tSPACING_SUPPORT_KEY,\n\tDimensionsPanel,\n} from './dimensions';\nimport {\n\tshouldSkipSerialization,\n\tuseStyleOverride,\n\tuseBlockSettings,\n} from './utils';\nimport { scopeSelector } from '../components/global-styles/utils';\nimport { useBlockEditingMode } from '../components/block-editing-mode';\n\nconst styleSupportKeys = [\n\t...TYPOGRAPHY_SUPPORT_KEYS,\n\tBORDER_SUPPORT_KEY,\n\tCOLOR_SUPPORT_KEY,\n\tDIMENSIONS_SUPPORT_KEY,\n\tBACKGROUND_SUPPORT_KEY,\n\tSPACING_SUPPORT_KEY,\n\tSHADOW_SUPPORT_KEY,\n];\n\nconst hasStyleSupport = ( nameOrType ) =>\n\tstyleSupportKeys.some( ( key ) => hasBlockSupport( nameOrType, key ) );\n\n/**\n * Returns the inline styles to add depending on the style object\n *\n * @param {Object} styles Styles configuration.\n *\n * @return {Object} Flattened CSS variables declaration.\n */\nexport function getInlineStyles( styles = {} ) {\n\tconst output = {};\n\t// The goal is to move everything to server side generated engine styles\n\t// This is temporary as we absorb more and more styles into the engine.\n\tgetCSSRules( styles ).forEach( ( rule ) => {\n\t\toutput[ rule.key ] = rule.value;\n\t} );\n\n\treturn output;\n}\n\n/**\n * Filters registered block settings, extending attributes to include `style` attribute.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nfunction addAttribute( settings ) {\n\tif ( ! hasStyleSupport( settings ) ) {\n\t\treturn settings;\n\t}\n\n\t// Allow blocks to specify their own attribute definition with default values if needed.\n\tif ( ! settings.attributes.style ) {\n\t\tObject.assign( settings.attributes, {\n\t\t\tstyle: {\n\t\t\t\ttype: 'object',\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn settings;\n}\n\n/**\n * A dictionary of paths to flag skipping block support serialization as the key,\n * with values providing the style paths to be omitted from serialization.\n *\n * @constant\n * @type {Record<string, string[]>}\n */\nconst skipSerializationPathsEdit = {\n\t[ `${ BORDER_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [ 'border' ],\n\t[ `${ COLOR_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tCOLOR_SUPPORT_KEY,\n\t],\n\t[ `${ TYPOGRAPHY_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tTYPOGRAPHY_SUPPORT_KEY,\n\t],\n\t[ `${ DIMENSIONS_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tDIMENSIONS_SUPPORT_KEY,\n\t],\n\t[ `${ SPACING_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tSPACING_SUPPORT_KEY,\n\t],\n\t[ `${ SHADOW_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tSHADOW_SUPPORT_KEY,\n\t],\n};\n\n/**\n * A dictionary of paths to flag skipping block support serialization as the key,\n * with values providing the style paths to be omitted from serialization.\n *\n * Extends the Edit skip paths to enable skipping additional paths in just\n * the Save component. This allows a block support to be serialized within the\n * editor, while using an alternate approach, such as server-side rendering, when\n * the support is saved.\n *\n * @constant\n * @type {Record<string, string[]>}\n */\nconst skipSerializationPathsSave = {\n\t...skipSerializationPathsEdit,\n\t[ `${ DIMENSIONS_SUPPORT_KEY }.aspectRatio` ]: [\n\t\t`${ DIMENSIONS_SUPPORT_KEY }.aspectRatio`,\n\t], // Skip serialization of aspect ratio in save mode.\n\t[ `${ BACKGROUND_SUPPORT_KEY }` ]: [ BACKGROUND_SUPPORT_KEY ], // Skip serialization of background support in save mode.\n};\n\nconst skipSerializationPathsSaveChecks = {\n\t[ `${ DIMENSIONS_SUPPORT_KEY }.aspectRatio` ]: true,\n\t[ `${ BACKGROUND_SUPPORT_KEY }` ]: true,\n};\n\n/**\n * A dictionary used to normalize feature names between support flags, style\n * object properties and __experimentSkipSerialization configuration arrays.\n *\n * This allows not having to provide a migration for a support flag and possible\n * backwards compatibility bridges, while still achieving consistency between\n * the support flag and the skip serialization array.\n *\n * @constant\n * @type {Record<string, string>}\n */\nconst renamedFeatures = { gradients: 'gradient' };\n\n/**\n * A utility function used to remove one or more paths from a style object.\n * Works in a way similar to Lodash's `omit()`. See unit tests and examples below.\n *\n * It supports a single string path:\n *\n * ```\n * omitStyle( { color: 'red' }, 'color' ); // {}\n * ```\n *\n * or an array of paths:\n *\n * ```\n * omitStyle( { color: 'red', background: '#fff' }, [ 'color', 'background' ] ); // {}\n * ```\n *\n * It also allows you to specify paths at multiple levels in a string.\n *\n * ```\n * omitStyle( { typography: { textDecoration: 'underline' } }, 'typography.textDecoration' ); // {}\n * ```\n *\n * You can remove multiple paths at the same time:\n *\n * ```\n * omitStyle(\n * \t\t{\n * \t\t\ttypography: {\n * \t\t\t\ttextDecoration: 'underline',\n * \t\t\t\ttextTransform: 'uppercase',\n * \t\t\t}\n *\t\t},\n *\t\t[\n * \t\t\t'typography.textDecoration',\n * \t\t\t'typography.textTransform',\n *\t\t]\n * );\n * // {}\n * ```\n *\n * You can also specify nested paths as arrays:\n *\n * ```\n * omitStyle(\n * \t\t{\n * \t\t\ttypography: {\n * \t\t\t\ttextDecoration: 'underline',\n * \t\t\t\ttextTransform: 'uppercase',\n * \t\t\t}\n *\t\t},\n *\t\t[\n * \t\t\t[ 'typography', 'textDecoration' ],\n * \t\t\t[ 'typography', 'textTransform' ],\n *\t\t]\n * );\n * // {}\n * ```\n *\n * With regards to nesting of styles, infinite depth is supported:\n *\n * ```\n * omitStyle(\n * \t\t{\n * \t\t\tborder: {\n * \t\t\t\tradius: {\n * \t\t\t\t\ttopLeft: '10px',\n * \t\t\t\t\ttopRight: '0.5rem',\n * \t\t\t\t}\n * \t\t\t}\n *\t\t},\n *\t\t[\n * \t\t\t[ 'border', 'radius', 'topRight' ],\n *\t\t]\n * );\n * // { border: { radius: { topLeft: '10px' } } }\n * ```\n *\n * The third argument, `preserveReference`, defines how to treat the input style object.\n * It is mostly necessary to properly handle mutation when recursively handling the style object.\n * Defaulting to `false`, this will always create a new object, avoiding to mutate `style`.\n * However, when recursing, we change that value to `true` in order to work with a single copy\n * of the original style object.\n *\n * @see https://lodash.com/docs/4.17.15#omit\n *\n * @param {Object} style Styles object.\n * @param {Array|string} paths Paths to remove.\n * @param {boolean} preserveReference True to mutate the `style` object, false otherwise.\n * @return {Object} Styles object with the specified paths removed.\n */\nexport function omitStyle( style, paths, preserveReference = false ) {\n\tif ( ! style ) {\n\t\treturn style;\n\t}\n\n\tlet newStyle = style;\n\tif ( ! preserveReference ) {\n\t\tnewStyle = JSON.parse( JSON.stringify( style ) );\n\t}\n\n\tif ( ! Array.isArray( paths ) ) {\n\t\tpaths = [ paths ];\n\t}\n\n\tpaths.forEach( ( path ) => {\n\t\tif ( ! Array.isArray( path ) ) {\n\t\t\tpath = path.split( '.' );\n\t\t}\n\n\t\tif ( path.length > 1 ) {\n\t\t\tconst [ firstSubpath, ...restPath ] = path;\n\t\t\tomitStyle( newStyle[ firstSubpath ], [ restPath ], true );\n\t\t} else if ( path.length === 1 ) {\n\t\t\tdelete newStyle[ path[ 0 ] ];\n\t\t}\n\t} );\n\n\treturn newStyle;\n}\n\n/**\n * Override props assigned to save component to inject the CSS variables definition.\n *\n * @param {Object} props Additional props applied to save element.\n * @param {Object|string} blockNameOrType Block type.\n * @param {Object} attributes Block attributes.\n * @param {?Record<string, string[]>} skipPaths An object of keys and paths to skip serialization.\n *\n * @return {Object} Filtered props applied to save element.\n */\nexport function addSaveProps(\n\tprops,\n\tblockNameOrType,\n\tattributes,\n\tskipPaths = skipSerializationPathsSave\n) {\n\tif ( ! hasStyleSupport( blockNameOrType ) ) {\n\t\treturn props;\n\t}\n\n\tlet { style } = attributes;\n\tObject.entries( skipPaths ).forEach( ( [ indicator, path ] ) => {\n\t\tconst skipSerialization =\n\t\t\tskipSerializationPathsSaveChecks[ indicator ] ||\n\t\t\tgetBlockSupport( blockNameOrType, indicator );\n\n\t\tif ( skipSerialization === true ) {\n\t\t\tstyle = omitStyle( style, path );\n\t\t}\n\n\t\tif ( Array.isArray( skipSerialization ) ) {\n\t\t\tskipSerialization.forEach( ( featureName ) => {\n\t\t\t\tconst feature = renamedFeatures[ featureName ] || featureName;\n\t\t\t\tstyle = omitStyle( style, [ [ ...path, feature ] ] );\n\t\t\t} );\n\t\t}\n\t} );\n\n\tprops.style = {\n\t\t...getInlineStyles( style ),\n\t\t...props.style,\n\t};\n\n\treturn props;\n}\n\nfunction BlockStyleControls( {\n\tclientId,\n\tname,\n\tsetAttributes,\n\t__unstableParentLayout,\n} ) {\n\tconst settings = useBlockSettings( name, __unstableParentLayout );\n\tconst blockEditingMode = useBlockEditingMode();\n\tconst passedProps = {\n\t\tclientId,\n\t\tname,\n\t\tsetAttributes,\n\t\tsettings: {\n\t\t\t...settings,\n\t\t\ttypography: {\n\t\t\t\t...settings.typography,\n\t\t\t\t// The text alignment UI for individual blocks is rendered in\n\t\t\t\t// the block toolbar, so disable it here.\n\t\t\t\ttextAlign: false,\n\t\t\t},\n\t\t},\n\t};\n\tif ( blockEditingMode !== 'default' ) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<>\n\t\t\t<ColorEdit { ...passedProps } />\n\t\t\t<BackgroundImagePanel { ...passedProps } />\n\t\t\t<TypographyPanel { ...passedProps } />\n\t\t\t<BorderPanel { ...passedProps } />\n\t\t\t<DimensionsPanel { ...passedProps } />\n\t\t</>\n\t);\n}\n\nexport default {\n\tedit: BlockStyleControls,\n\thasSupport: hasStyleSupport,\n\taddSaveProps,\n\tattributeKeys: [ 'style' ],\n\tuseBlockProps,\n};\n\n// Defines which element types are supported, including their hover styles or\n// any other elements that have been included under a single element type\n// e.g. heading and h1-h6.\nconst elementTypes = [\n\t{ elementType: 'button' },\n\t{ elementType: 'link', pseudo: [ ':hover' ] },\n\t{\n\t\telementType: 'heading',\n\t\telements: [ 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ],\n\t},\n];\n\nfunction useBlockProps( { name, style } ) {\n\tconst blockElementsContainerIdentifier = `wp-elements-${ useInstanceId(\n\t\tuseBlockProps\n\t) }`;\n\n\tconst baseElementSelector = `.${ blockElementsContainerIdentifier }`;\n\tconst blockElementStyles = style?.elements;\n\n\tconst styles = useMemo( () => {\n\t\tif ( ! blockElementStyles ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst elementCSSRules = [];\n\n\t\telementTypes.forEach( ( { elementType, pseudo, elements } ) => {\n\t\t\tconst skipSerialization = shouldSkipSerialization(\n\t\t\t\tname,\n\t\t\t\tCOLOR_SUPPORT_KEY,\n\t\t\t\telementType\n\t\t\t);\n\n\t\t\tif ( skipSerialization ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst elementStyles = blockElementStyles?.[ elementType ];\n\n\t\t\t// Process primary element type styles.\n\t\t\tif ( elementStyles ) {\n\t\t\t\tconst selector = scopeSelector(\n\t\t\t\t\tbaseElementSelector,\n\t\t\t\t\tELEMENTS[ elementType ]\n\t\t\t\t);\n\n\t\t\t\telementCSSRules.push(\n\t\t\t\t\tcompileCSS( elementStyles, { selector } )\n\t\t\t\t);\n\n\t\t\t\t// Process any interactive states for the element type.\n\t\t\t\tif ( pseudo ) {\n\t\t\t\t\tpseudo.forEach( ( pseudoSelector ) => {\n\t\t\t\t\t\tif ( elementStyles[ pseudoSelector ] ) {\n\t\t\t\t\t\t\telementCSSRules.push(\n\t\t\t\t\t\t\t\tcompileCSS( elementStyles[ pseudoSelector ], {\n\t\t\t\t\t\t\t\t\tselector: scopeSelector(\n\t\t\t\t\t\t\t\t\t\tbaseElementSelector,\n\t\t\t\t\t\t\t\t\t\t`${ ELEMENTS[ elementType ] }${ pseudoSelector }`\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Process related elements e.g. h1-h6 for headings\n\t\t\tif ( elements ) {\n\t\t\t\telements.forEach( ( element ) => {\n\t\t\t\t\tif ( blockElementStyles[ element ] ) {\n\t\t\t\t\t\telementCSSRules.push(\n\t\t\t\t\t\t\tcompileCSS( blockElementStyles[ element ], {\n\t\t\t\t\t\t\t\tselector: scopeSelector(\n\t\t\t\t\t\t\t\t\tbaseElementSelector,\n\t\t\t\t\t\t\t\t\tELEMENTS[ element ]\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\treturn elementCSSRules.length > 0\n\t\t\t? elementCSSRules.join( '' )\n\t\t\t: undefined;\n\t}, [ baseElementSelector, blockElementStyles, name ] );\n\n\tuseStyleOverride( { css: styles } );\n\n\treturn addSaveProps(\n\t\t{ className: blockElementsContainerIdentifier },\n\t\tname,\n\t\t{ style },\n\t\tskipSerializationPathsEdit\n\t);\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/style/addAttribute',\n\taddAttribute\n);\n"],"mappings":";;;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAKA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAKA,IAAAK,WAAA,GAAAL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nB,GAAIQ,+BAAQ,CAAEb,WAAW,CAAE,GAAKgB,cAAc,EAC/C;cACD,CAAE,CACH,CAAC;YACF;UACD,CAAE,CAAC;QACJ;MACD;;MAEA;MACA,IAAKd,QAAQ,EAAG;QACfA,QAAQ,CAACtE,OAAO,CAAIqF,OAAO,IAAM;UAChC,IAAKX,kBAAkB,CAAEW,OAAO,CAAE,EAAG;YACpCT,eAAe,CAACM,IAAI,CACnB,IAAAC,uBAAU,EAAET,kBAAkB,CAAEW,OAAO,CAAE,EAAE;cAC1CN,QAAQ,EAAE,IAAAC,qBAAa,EACtBP,mBAAmB,EACnBQ,+BAAQ,CAAEI,OAAO,CAClB;YACD,CAAE,CACH,CAAC;UACF;QACD,CAAE,CAAC;MACJ;IACD,CAAE,CAAC;IAEH,OAAOT,eAAe,CAACjD,MAAM,GAAG,CAAC,GAC9BiD,eAAe,CAACU,IAAI,CAAE,EAAG,CAAC,GAC1BC,SAAS;EACb,CAAC,EAAE,CAAEd,mBAAmB,EAAEC,kBAAkB,EAAEhC,IAAI,CAAG,CAAC;EAEtD,IAAA8C,uBAAgB,EAAE;IAAEC,GAAG,EAAE5F;EAAO,CAAE,CAAC;EAEnC,OAAOiC,YAAY,CAClB;IAAE4D,SAAS,EAAEnB;EAAiC,CAAC,EAC/C7B,IAAI,EACJ;IAAEpC;EAAM,CAAC,EACTI,0BACD,CAAC;AACF;AAEA,IAAAiF,gBAAS,EACR,0BAA0B,EAC1B,yBAAyB,EACzBxF,YACD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","_hooks","_blocks","_compose","_styleEngine","_background","_border","_color","_typography","_dimensions","_utils","_utils2","_blockEditingMode","_jsxRuntime","styleSupportKeys","TYPOGRAPHY_SUPPORT_KEYS","BORDER_SUPPORT_KEY","COLOR_SUPPORT_KEY","DIMENSIONS_SUPPORT_KEY","BACKGROUND_SUPPORT_KEY","SPACING_SUPPORT_KEY","SHADOW_SUPPORT_KEY","hasStyleSupport","nameOrType","some","key","hasBlockSupport","getInlineStyles","styles","output","getCSSRules","forEach","rule","value","addAttribute","settings","attributes","style","Object","assign","type","skipSerializationPathsEdit","TYPOGRAPHY_SUPPORT_KEY","skipSerializationPathsSave","skipSerializationPathsSaveChecks","renamedFeatures","gradients","omitStyle","paths","preserveReference","newStyle","JSON","parse","stringify","Array","isArray","path","split","length","firstSubpath","restPath","addSaveProps","props","blockNameOrType","skipPaths","entries","indicator","skipSerialization","getBlockSupport","featureName","feature","BlockStyleControls","clientId","name","setAttributes","__unstableParentLayout","useBlockSettings","blockEditingMode","useBlockEditingMode","passedProps","typography","textAlign","jsxs","Fragment","children","jsx","ColorEdit","BackgroundImagePanel","TypographyPanel","BorderPanel","DimensionsPanel","_default","exports","default","edit","hasSupport","attributeKeys","useBlockProps","elementTypes","elementType","pseudo","elements","STYLE_BLOCK_PROPS_REFERENCE","blockElementsContainerIdentifier","useInstanceId","baseElementSelector","blockElementStyles","useMemo","elementCSSRules","shouldSkipSerialization","elementStyles","selector","scopeSelector","ELEMENTS","push","compileCSS","pseudoSelector","element","join","undefined","useStyleOverride","css","className","addFilter"],"sources":["@wordpress/block-editor/src/hooks/style.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { addFilter } from '@wordpress/hooks';\nimport {\n\tgetBlockSupport,\n\thasBlockSupport,\n\t__EXPERIMENTAL_ELEMENTS as ELEMENTS,\n} from '@wordpress/blocks';\nimport { useInstanceId } from '@wordpress/compose';\nimport { getCSSRules, compileCSS } from '@wordpress/style-engine';\n\n/**\n * Internal dependencies\n */\nimport { BACKGROUND_SUPPORT_KEY, BackgroundImagePanel } from './background';\nimport { BORDER_SUPPORT_KEY, BorderPanel, SHADOW_SUPPORT_KEY } from './border';\nimport { COLOR_SUPPORT_KEY, ColorEdit } from './color';\nimport {\n\tTypographyPanel,\n\tTYPOGRAPHY_SUPPORT_KEY,\n\tTYPOGRAPHY_SUPPORT_KEYS,\n} from './typography';\nimport {\n\tDIMENSIONS_SUPPORT_KEY,\n\tSPACING_SUPPORT_KEY,\n\tDimensionsPanel,\n} from './dimensions';\nimport {\n\tshouldSkipSerialization,\n\tuseStyleOverride,\n\tuseBlockSettings,\n} from './utils';\nimport { scopeSelector } from '../components/global-styles/utils';\nimport { useBlockEditingMode } from '../components/block-editing-mode';\n\nconst styleSupportKeys = [\n\t...TYPOGRAPHY_SUPPORT_KEYS,\n\tBORDER_SUPPORT_KEY,\n\tCOLOR_SUPPORT_KEY,\n\tDIMENSIONS_SUPPORT_KEY,\n\tBACKGROUND_SUPPORT_KEY,\n\tSPACING_SUPPORT_KEY,\n\tSHADOW_SUPPORT_KEY,\n];\n\nconst hasStyleSupport = ( nameOrType ) =>\n\tstyleSupportKeys.some( ( key ) => hasBlockSupport( nameOrType, key ) );\n\n/**\n * Returns the inline styles to add depending on the style object\n *\n * @param {Object} styles Styles configuration.\n *\n * @return {Object} Flattened CSS variables declaration.\n */\nexport function getInlineStyles( styles = {} ) {\n\tconst output = {};\n\t// The goal is to move everything to server side generated engine styles\n\t// This is temporary as we absorb more and more styles into the engine.\n\tgetCSSRules( styles ).forEach( ( rule ) => {\n\t\toutput[ rule.key ] = rule.value;\n\t} );\n\n\treturn output;\n}\n\n/**\n * Filters registered block settings, extending attributes to include `style` attribute.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nfunction addAttribute( settings ) {\n\tif ( ! hasStyleSupport( settings ) ) {\n\t\treturn settings;\n\t}\n\n\t// Allow blocks to specify their own attribute definition with default values if needed.\n\tif ( ! settings.attributes.style ) {\n\t\tObject.assign( settings.attributes, {\n\t\t\tstyle: {\n\t\t\t\ttype: 'object',\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn settings;\n}\n\n/**\n * A dictionary of paths to flag skipping block support serialization as the key,\n * with values providing the style paths to be omitted from serialization.\n *\n * @constant\n * @type {Record<string, string[]>}\n */\nconst skipSerializationPathsEdit = {\n\t[ `${ BORDER_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [ 'border' ],\n\t[ `${ COLOR_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tCOLOR_SUPPORT_KEY,\n\t],\n\t[ `${ TYPOGRAPHY_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tTYPOGRAPHY_SUPPORT_KEY,\n\t],\n\t[ `${ DIMENSIONS_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tDIMENSIONS_SUPPORT_KEY,\n\t],\n\t[ `${ SPACING_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tSPACING_SUPPORT_KEY,\n\t],\n\t[ `${ SHADOW_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tSHADOW_SUPPORT_KEY,\n\t],\n};\n\n/**\n * A dictionary of paths to flag skipping block support serialization as the key,\n * with values providing the style paths to be omitted from serialization.\n *\n * Extends the Edit skip paths to enable skipping additional paths in just\n * the Save component. This allows a block support to be serialized within the\n * editor, while using an alternate approach, such as server-side rendering, when\n * the support is saved.\n *\n * @constant\n * @type {Record<string, string[]>}\n */\nconst skipSerializationPathsSave = {\n\t...skipSerializationPathsEdit,\n\t[ `${ DIMENSIONS_SUPPORT_KEY }.aspectRatio` ]: [\n\t\t`${ DIMENSIONS_SUPPORT_KEY }.aspectRatio`,\n\t], // Skip serialization of aspect ratio in save mode.\n\t[ `${ BACKGROUND_SUPPORT_KEY }` ]: [ BACKGROUND_SUPPORT_KEY ], // Skip serialization of background support in save mode.\n};\n\nconst skipSerializationPathsSaveChecks = {\n\t[ `${ DIMENSIONS_SUPPORT_KEY }.aspectRatio` ]: true,\n\t[ `${ BACKGROUND_SUPPORT_KEY }` ]: true,\n};\n\n/**\n * A dictionary used to normalize feature names between support flags, style\n * object properties and __experimentSkipSerialization configuration arrays.\n *\n * This allows not having to provide a migration for a support flag and possible\n * backwards compatibility bridges, while still achieving consistency between\n * the support flag and the skip serialization array.\n *\n * @constant\n * @type {Record<string, string>}\n */\nconst renamedFeatures = { gradients: 'gradient' };\n\n/**\n * A utility function used to remove one or more paths from a style object.\n * Works in a way similar to Lodash's `omit()`. See unit tests and examples below.\n *\n * It supports a single string path:\n *\n * ```\n * omitStyle( { color: 'red' }, 'color' ); // {}\n * ```\n *\n * or an array of paths:\n *\n * ```\n * omitStyle( { color: 'red', background: '#fff' }, [ 'color', 'background' ] ); // {}\n * ```\n *\n * It also allows you to specify paths at multiple levels in a string.\n *\n * ```\n * omitStyle( { typography: { textDecoration: 'underline' } }, 'typography.textDecoration' ); // {}\n * ```\n *\n * You can remove multiple paths at the same time:\n *\n * ```\n * omitStyle(\n * \t\t{\n * \t\t\ttypography: {\n * \t\t\t\ttextDecoration: 'underline',\n * \t\t\t\ttextTransform: 'uppercase',\n * \t\t\t}\n *\t\t},\n *\t\t[\n * \t\t\t'typography.textDecoration',\n * \t\t\t'typography.textTransform',\n *\t\t]\n * );\n * // {}\n * ```\n *\n * You can also specify nested paths as arrays:\n *\n * ```\n * omitStyle(\n * \t\t{\n * \t\t\ttypography: {\n * \t\t\t\ttextDecoration: 'underline',\n * \t\t\t\ttextTransform: 'uppercase',\n * \t\t\t}\n *\t\t},\n *\t\t[\n * \t\t\t[ 'typography', 'textDecoration' ],\n * \t\t\t[ 'typography', 'textTransform' ],\n *\t\t]\n * );\n * // {}\n * ```\n *\n * With regards to nesting of styles, infinite depth is supported:\n *\n * ```\n * omitStyle(\n * \t\t{\n * \t\t\tborder: {\n * \t\t\t\tradius: {\n * \t\t\t\t\ttopLeft: '10px',\n * \t\t\t\t\ttopRight: '0.5rem',\n * \t\t\t\t}\n * \t\t\t}\n *\t\t},\n *\t\t[\n * \t\t\t[ 'border', 'radius', 'topRight' ],\n *\t\t]\n * );\n * // { border: { radius: { topLeft: '10px' } } }\n * ```\n *\n * The third argument, `preserveReference`, defines how to treat the input style object.\n * It is mostly necessary to properly handle mutation when recursively handling the style object.\n * Defaulting to `false`, this will always create a new object, avoiding to mutate `style`.\n * However, when recursing, we change that value to `true` in order to work with a single copy\n * of the original style object.\n *\n * @see https://lodash.com/docs/4.17.15#omit\n *\n * @param {Object} style Styles object.\n * @param {Array|string} paths Paths to remove.\n * @param {boolean} preserveReference True to mutate the `style` object, false otherwise.\n * @return {Object} Styles object with the specified paths removed.\n */\nexport function omitStyle( style, paths, preserveReference = false ) {\n\tif ( ! style ) {\n\t\treturn style;\n\t}\n\n\tlet newStyle = style;\n\tif ( ! preserveReference ) {\n\t\tnewStyle = JSON.parse( JSON.stringify( style ) );\n\t}\n\n\tif ( ! Array.isArray( paths ) ) {\n\t\tpaths = [ paths ];\n\t}\n\n\tpaths.forEach( ( path ) => {\n\t\tif ( ! Array.isArray( path ) ) {\n\t\t\tpath = path.split( '.' );\n\t\t}\n\n\t\tif ( path.length > 1 ) {\n\t\t\tconst [ firstSubpath, ...restPath ] = path;\n\t\t\tomitStyle( newStyle[ firstSubpath ], [ restPath ], true );\n\t\t} else if ( path.length === 1 ) {\n\t\t\tdelete newStyle[ path[ 0 ] ];\n\t\t}\n\t} );\n\n\treturn newStyle;\n}\n\n/**\n * Override props assigned to save component to inject the CSS variables definition.\n *\n * @param {Object} props Additional props applied to save element.\n * @param {Object|string} blockNameOrType Block type.\n * @param {Object} attributes Block attributes.\n * @param {?Record<string, string[]>} skipPaths An object of keys and paths to skip serialization.\n *\n * @return {Object} Filtered props applied to save element.\n */\nexport function addSaveProps(\n\tprops,\n\tblockNameOrType,\n\tattributes,\n\tskipPaths = skipSerializationPathsSave\n) {\n\tif ( ! hasStyleSupport( blockNameOrType ) ) {\n\t\treturn props;\n\t}\n\n\tlet { style } = attributes;\n\tObject.entries( skipPaths ).forEach( ( [ indicator, path ] ) => {\n\t\tconst skipSerialization =\n\t\t\tskipSerializationPathsSaveChecks[ indicator ] ||\n\t\t\tgetBlockSupport( blockNameOrType, indicator );\n\n\t\tif ( skipSerialization === true ) {\n\t\t\tstyle = omitStyle( style, path );\n\t\t}\n\n\t\tif ( Array.isArray( skipSerialization ) ) {\n\t\t\tskipSerialization.forEach( ( featureName ) => {\n\t\t\t\tconst feature = renamedFeatures[ featureName ] || featureName;\n\t\t\t\tstyle = omitStyle( style, [ [ ...path, feature ] ] );\n\t\t\t} );\n\t\t}\n\t} );\n\n\tprops.style = {\n\t\t...getInlineStyles( style ),\n\t\t...props.style,\n\t};\n\n\treturn props;\n}\n\nfunction BlockStyleControls( {\n\tclientId,\n\tname,\n\tsetAttributes,\n\t__unstableParentLayout,\n} ) {\n\tconst settings = useBlockSettings( name, __unstableParentLayout );\n\tconst blockEditingMode = useBlockEditingMode();\n\tconst passedProps = {\n\t\tclientId,\n\t\tname,\n\t\tsetAttributes,\n\t\tsettings: {\n\t\t\t...settings,\n\t\t\ttypography: {\n\t\t\t\t...settings.typography,\n\t\t\t\t// The text alignment UI for individual blocks is rendered in\n\t\t\t\t// the block toolbar, so disable it here.\n\t\t\t\ttextAlign: false,\n\t\t\t},\n\t\t},\n\t};\n\tif ( blockEditingMode !== 'default' ) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<>\n\t\t\t<ColorEdit { ...passedProps } />\n\t\t\t<BackgroundImagePanel { ...passedProps } />\n\t\t\t<TypographyPanel { ...passedProps } />\n\t\t\t<BorderPanel { ...passedProps } />\n\t\t\t<DimensionsPanel { ...passedProps } />\n\t\t</>\n\t);\n}\n\nexport default {\n\tedit: BlockStyleControls,\n\thasSupport: hasStyleSupport,\n\taddSaveProps,\n\tattributeKeys: [ 'style' ],\n\tuseBlockProps,\n};\n\n// Defines which element types are supported, including their hover styles or\n// any other elements that have been included under a single element type\n// e.g. heading and h1-h6.\nconst elementTypes = [\n\t{ elementType: 'button' },\n\t{ elementType: 'link', pseudo: [ ':hover' ] },\n\t{\n\t\telementType: 'heading',\n\t\telements: [ 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ],\n\t},\n];\n\n// Used for generating the instance ID\nconst STYLE_BLOCK_PROPS_REFERENCE = {};\n\nfunction useBlockProps( { name, style } ) {\n\tconst blockElementsContainerIdentifier = useInstanceId(\n\t\tSTYLE_BLOCK_PROPS_REFERENCE,\n\t\t'wp-elements'\n\t);\n\n\tconst baseElementSelector = `.${ blockElementsContainerIdentifier }`;\n\tconst blockElementStyles = style?.elements;\n\n\tconst styles = useMemo( () => {\n\t\tif ( ! blockElementStyles ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst elementCSSRules = [];\n\n\t\telementTypes.forEach( ( { elementType, pseudo, elements } ) => {\n\t\t\tconst skipSerialization = shouldSkipSerialization(\n\t\t\t\tname,\n\t\t\t\tCOLOR_SUPPORT_KEY,\n\t\t\t\telementType\n\t\t\t);\n\n\t\t\tif ( skipSerialization ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst elementStyles = blockElementStyles?.[ elementType ];\n\n\t\t\t// Process primary element type styles.\n\t\t\tif ( elementStyles ) {\n\t\t\t\tconst selector = scopeSelector(\n\t\t\t\t\tbaseElementSelector,\n\t\t\t\t\tELEMENTS[ elementType ]\n\t\t\t\t);\n\n\t\t\t\telementCSSRules.push(\n\t\t\t\t\tcompileCSS( elementStyles, { selector } )\n\t\t\t\t);\n\n\t\t\t\t// Process any interactive states for the element type.\n\t\t\t\tif ( pseudo ) {\n\t\t\t\t\tpseudo.forEach( ( pseudoSelector ) => {\n\t\t\t\t\t\tif ( elementStyles[ pseudoSelector ] ) {\n\t\t\t\t\t\t\telementCSSRules.push(\n\t\t\t\t\t\t\t\tcompileCSS( elementStyles[ pseudoSelector ], {\n\t\t\t\t\t\t\t\t\tselector: scopeSelector(\n\t\t\t\t\t\t\t\t\t\tbaseElementSelector,\n\t\t\t\t\t\t\t\t\t\t`${ ELEMENTS[ elementType ] }${ pseudoSelector }`\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Process related elements e.g. h1-h6 for headings\n\t\t\tif ( elements ) {\n\t\t\t\telements.forEach( ( element ) => {\n\t\t\t\t\tif ( blockElementStyles[ element ] ) {\n\t\t\t\t\t\telementCSSRules.push(\n\t\t\t\t\t\t\tcompileCSS( blockElementStyles[ element ], {\n\t\t\t\t\t\t\t\tselector: scopeSelector(\n\t\t\t\t\t\t\t\t\tbaseElementSelector,\n\t\t\t\t\t\t\t\t\tELEMENTS[ element ]\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\treturn elementCSSRules.length > 0\n\t\t\t? elementCSSRules.join( '' )\n\t\t\t: undefined;\n\t}, [ baseElementSelector, blockElementStyles, name ] );\n\n\tuseStyleOverride( { css: styles } );\n\n\treturn addSaveProps(\n\t\t{ className: blockElementsContainerIdentifier },\n\t\tname,\n\t\t{ style },\n\t\tskipSerializationPathsEdit\n\t);\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/style/addAttribute',\n\taddAttribute\n);\n"],"mappings":";;;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAKA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAKA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AAKA,IAAAS,WAAA,GAAAT,OAAA;AAKA,IAAAU,MAAA,GAAAV,OAAA;AAKA,IAAAW,OAAA,GAAAX,OAAA;AACA,IAAAY,iBAAA,GAAAZ,OAAA;AAAuE,IAAAa,WAAA,GAAAb,OAAA;AAnCvE;AACA;AACA;;AAWA;AACA;AACA;;AAsBA,MAAMc,gBAAgB,GAAG,CACxB,GAAGC,mCAAuB,EAC1BC,0BAAkB,EAClBC,wBAAiB,EAC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,kCAAmC,GAAI,CAC/DA,+BAAmB,CACnB;EACD,CAAE,GAAIC,0BAAkB,kCAAmC,GAAI,CAC9DA,0BAAkB;AAEpB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMsB,0BAA0B,GAAG;EAClC,GAAGF,0BAA0B;EAC7B,CAAE,GAAIvB,kCAAsB,cAAe,GAAI,CAC9C,GAAIA,kCAAsB,cAAe,CACzC;EAAE;EACH,CAAE,GAAIC,kCAAsB,EAAG,GAAI,CAAEA,kCAAsB,CAAE,CAAE;AAChE,CAAC;AAED,MAAMyB,gCAAgC,GAAG;EACxC,CAAE,GAAI1B,kCAAsB,cAAe,GAAI,IAAI;EACnD,CAAE,GAAIC,kCAAsB,EAAG,GAAI;AACpC,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM0B,eAAe,GAAG;EAAEC,SAAS,EAAE;AAAW,CAAC;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,SAASA,CAAEV,KAAK,EAAEW,KAAK,EAAEC,iBAAiB,GAAG,KAAK,EAAG;EACpE,IAAK,CAAEZ,KAAK,EAAG;IACd,OAAOA,KAAK;EACb;EAEA,IAAIa,QAAQ,GAAGb,KAAK;EACpB,IAAK,C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AAE,IAAAC,qBAAa,EACtBP,mBAAmB,EACnBQ,+BAAQ,CAAEI,OAAO,CAClB;YACD,CAAE,CACH,CAAC;UACF;QACD,CAAE,CAAC;MACJ;IACD,CAAE,CAAC;IAEH,OAAOT,eAAe,CAAClD,MAAM,GAAG,CAAC,GAC9BkD,eAAe,CAACU,IAAI,CAAE,EAAG,CAAC,GAC1BC,SAAS;EACb,CAAC,EAAE,CAAEd,mBAAmB,EAAEC,kBAAkB,EAAEjC,IAAI,CAAG,CAAC;EAEtD,IAAA+C,uBAAgB,EAAE;IAAEC,GAAG,EAAE7F;EAAO,CAAE,CAAC;EAEnC,OAAOiC,YAAY,CAClB;IAAE6D,SAAS,EAAEnB;EAAiC,CAAC,EAC/C9B,IAAI,EACJ;IAAEpC;EAAM,CAAC,EACTI,0BACD,CAAC;AACF;AAEA,IAAAkF,gBAAS,EACR,0BAA0B,EAC1B,yBAAyB,EACzBzF,YACD,CAAC","ignoreList":[]}
@@ -17,17 +17,17 @@ const ALIGN_WIDE_SUPPORT_KEY = 'alignWide';
17
17
  const BORDER_SUPPORT_KEY = '__experimentalBorder';
18
18
  const COLOR_SUPPORT_KEY = 'color';
19
19
  const CUSTOM_CLASS_NAME_SUPPORT_KEY = 'customClassName';
20
- const FONT_FAMILY_SUPPORT_KEY = 'typography.__experimentalFontFamily';
20
+ const FONT_FAMILY_SUPPORT_KEY = 'typography.fontFamily';
21
21
  const FONT_SIZE_SUPPORT_KEY = 'typography.fontSize';
22
22
  const LINE_HEIGHT_SUPPORT_KEY = 'typography.lineHeight';
23
23
  /**
24
24
  * Key within block settings' support array indicating support for font style.
25
25
  */
26
- const FONT_STYLE_SUPPORT_KEY = 'typography.__experimentalFontStyle';
26
+ const FONT_STYLE_SUPPORT_KEY = 'typography.fontStyle';
27
27
  /**
28
28
  * Key within block settings' support array indicating support for font weight.
29
29
  */
30
- const FONT_WEIGHT_SUPPORT_KEY = 'typography.__experimentalFontWeight';
30
+ const FONT_WEIGHT_SUPPORT_KEY = 'typography.fontWeight';
31
31
  /**
32
32
  * Key within block settings' supports array indicating support for text
33
33
  * align e.g. settings found in `block.json`.
@@ -42,7 +42,7 @@ const TEXT_COLUMNS_SUPPORT_KEY = 'typography.textColumns';
42
42
  * Key within block settings' supports array indicating support for text
43
43
  * decorations e.g. settings found in `block.json`.
44
44
  */
45
- const TEXT_DECORATION_SUPPORT_KEY = 'typography.__experimentalTextDecoration';
45
+ const TEXT_DECORATION_SUPPORT_KEY = 'typography.textDecoration';
46
46
  /**
47
47
  * Key within block settings' supports array indicating support for writing mode
48
48
  * e.g. settings found in `block.json`.
@@ -52,13 +52,13 @@ const WRITING_MODE_SUPPORT_KEY = 'typography.__experimentalWritingMode';
52
52
  * Key within block settings' supports array indicating support for text
53
53
  * transforms e.g. settings found in `block.json`.
54
54
  */
55
- const TEXT_TRANSFORM_SUPPORT_KEY = 'typography.__experimentalTextTransform';
55
+ const TEXT_TRANSFORM_SUPPORT_KEY = 'typography.textTransform';
56
56
 
57
57
  /**
58
58
  * Key within block settings' supports array indicating support for letter-spacing
59
59
  * e.g. settings found in `block.json`.
60
60
  */
61
- const LETTER_SPACING_SUPPORT_KEY = 'typography.__experimentalLetterSpacing';
61
+ const LETTER_SPACING_SUPPORT_KEY = 'typography.letterSpacing';
62
62
  const LAYOUT_SUPPORT_KEY = 'layout';
63
63
  const TYPOGRAPHY_SUPPORT_KEYS = [LINE_HEIGHT_SUPPORT_KEY, FONT_SIZE_SUPPORT_KEY, FONT_STYLE_SUPPORT_KEY, FONT_WEIGHT_SUPPORT_KEY, FONT_FAMILY_SUPPORT_KEY, TEXT_ALIGN_SUPPORT_KEY, TEXT_COLUMNS_SUPPORT_KEY, TEXT_DECORATION_SUPPORT_KEY, TEXT_TRANSFORM_SUPPORT_KEY, WRITING_MODE_SUPPORT_KEY, LETTER_SPACING_SUPPORT_KEY];
64
64
  const EFFECTS_SUPPORT_KEYS = ['shadow'];
@@ -1 +1 @@
1
- {"version":3,"names":["_blocks","require","_element","ALIGN_SUPPORT_KEY","ALIGN_WIDE_SUPPORT_KEY","BORDER_SUPPORT_KEY","COLOR_SUPPORT_KEY","CUSTOM_CLASS_NAME_SUPPORT_KEY","FONT_FAMILY_SUPPORT_KEY","FONT_SIZE_SUPPORT_KEY","LINE_HEIGHT_SUPPORT_KEY","FONT_STYLE_SUPPORT_KEY","FONT_WEIGHT_SUPPORT_KEY","TEXT_ALIGN_SUPPORT_KEY","TEXT_COLUMNS_SUPPORT_KEY","TEXT_DECORATION_SUPPORT_KEY","WRITING_MODE_SUPPORT_KEY","TEXT_TRANSFORM_SUPPORT_KEY","LETTER_SPACING_SUPPORT_KEY","LAYOUT_SUPPORT_KEY","TYPOGRAPHY_SUPPORT_KEYS","EFFECTS_SUPPORT_KEYS","SPACING_SUPPORT_KEY","styleSupportKeys","hasAlignSupport","nameOrType","hasBlockSupport","exports","getAlignSupport","getBlockSupport","hasAlignWideSupport","getAlignWideSupport","hasBorderSupport","feature","Platform","OS","support","color","radius","width","style","getBorderSupport","hasColorSupport","colorSupport","link","gradient","background","text","hasLinkColorSupport","hasGradientSupport","gradients","hasBackgroundColorSupport","hasTextAlignSupport","getTextAlignSupport","hasTextColorSupport","getColorSupport","hasCustomClassNameSupport","getCustomClassNameSupport","hasFontFamilySupport","getFontFamilySupport","hasFontSizeSupport","getFontSizeSupport","hasLayoutSupport","getLayoutSupport","hasStyleSupport","some","key"],"sources":["@wordpress/block-editor/src/hooks/supports.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';\nimport { Platform } from '@wordpress/element';\n\nconst ALIGN_SUPPORT_KEY = 'align';\nconst ALIGN_WIDE_SUPPORT_KEY = 'alignWide';\nconst BORDER_SUPPORT_KEY = '__experimentalBorder';\nconst COLOR_SUPPORT_KEY = 'color';\nconst CUSTOM_CLASS_NAME_SUPPORT_KEY = 'customClassName';\nconst FONT_FAMILY_SUPPORT_KEY = 'typography.__experimentalFontFamily';\nconst FONT_SIZE_SUPPORT_KEY = 'typography.fontSize';\nconst LINE_HEIGHT_SUPPORT_KEY = 'typography.lineHeight';\n/**\n * Key within block settings' support array indicating support for font style.\n */\nconst FONT_STYLE_SUPPORT_KEY = 'typography.__experimentalFontStyle';\n/**\n * Key within block settings' support array indicating support for font weight.\n */\nconst FONT_WEIGHT_SUPPORT_KEY = 'typography.__experimentalFontWeight';\n/**\n * Key within block settings' supports array indicating support for text\n * align e.g. settings found in `block.json`.\n */\nconst TEXT_ALIGN_SUPPORT_KEY = 'typography.textAlign';\n/**\n * Key within block settings' supports array indicating support for text\n * columns e.g. settings found in `block.json`.\n */\nconst TEXT_COLUMNS_SUPPORT_KEY = 'typography.textColumns';\n/**\n * Key within block settings' supports array indicating support for text\n * decorations e.g. settings found in `block.json`.\n */\nconst TEXT_DECORATION_SUPPORT_KEY = 'typography.__experimentalTextDecoration';\n/**\n * Key within block settings' supports array indicating support for writing mode\n * e.g. settings found in `block.json`.\n */\nconst WRITING_MODE_SUPPORT_KEY = 'typography.__experimentalWritingMode';\n/**\n * Key within block settings' supports array indicating support for text\n * transforms e.g. settings found in `block.json`.\n */\nconst TEXT_TRANSFORM_SUPPORT_KEY = 'typography.__experimentalTextTransform';\n\n/**\n * Key within block settings' supports array indicating support for letter-spacing\n * e.g. settings found in `block.json`.\n */\nconst LETTER_SPACING_SUPPORT_KEY = 'typography.__experimentalLetterSpacing';\nconst LAYOUT_SUPPORT_KEY = 'layout';\nconst TYPOGRAPHY_SUPPORT_KEYS = [\n\tLINE_HEIGHT_SUPPORT_KEY,\n\tFONT_SIZE_SUPPORT_KEY,\n\tFONT_STYLE_SUPPORT_KEY,\n\tFONT_WEIGHT_SUPPORT_KEY,\n\tFONT_FAMILY_SUPPORT_KEY,\n\tTEXT_ALIGN_SUPPORT_KEY,\n\tTEXT_COLUMNS_SUPPORT_KEY,\n\tTEXT_DECORATION_SUPPORT_KEY,\n\tTEXT_TRANSFORM_SUPPORT_KEY,\n\tWRITING_MODE_SUPPORT_KEY,\n\tLETTER_SPACING_SUPPORT_KEY,\n];\nconst EFFECTS_SUPPORT_KEYS = [ 'shadow' ];\nconst SPACING_SUPPORT_KEY = 'spacing';\nconst styleSupportKeys = [\n\t...EFFECTS_SUPPORT_KEYS,\n\t...TYPOGRAPHY_SUPPORT_KEYS,\n\tBORDER_SUPPORT_KEY,\n\tCOLOR_SUPPORT_KEY,\n\tSPACING_SUPPORT_KEY,\n];\n\n/**\n * Returns true if the block defines support for align.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasAlignSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, ALIGN_SUPPORT_KEY );\n\n/**\n * Returns the block support value for align, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getAlignSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, ALIGN_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for align wide.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasAlignWideSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, ALIGN_WIDE_SUPPORT_KEY );\n\n/**\n * Returns the block support value for align wide, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getAlignWideSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, ALIGN_WIDE_SUPPORT_KEY );\n\n/**\n * Determine whether there is block support for border properties.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @param {string} feature Border feature to check support for.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasBorderSupport( nameOrType, feature = 'any' ) {\n\tif ( Platform.OS !== 'web' ) {\n\t\treturn false;\n\t}\n\n\tconst support = getBlockSupport( nameOrType, BORDER_SUPPORT_KEY );\n\n\tif ( support === true ) {\n\t\treturn true;\n\t}\n\n\tif ( feature === 'any' ) {\n\t\treturn !! (\n\t\t\tsupport?.color ||\n\t\t\tsupport?.radius ||\n\t\t\tsupport?.width ||\n\t\t\tsupport?.style\n\t\t);\n\t}\n\n\treturn !! support?.[ feature ];\n}\n\n/**\n * Get block support for border properties.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @param {string} feature Border feature to get.\n *\n * @return {unknown} The block support.\n */\nexport const getBorderSupport = ( nameOrType, feature ) =>\n\tgetBlockSupport( nameOrType, [ BORDER_SUPPORT_KEY, feature ] );\n\n/**\n * Returns true if the block defines support for color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasColorSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\treturn (\n\t\tcolorSupport &&\n\t\t( colorSupport.link === true ||\n\t\t\tcolorSupport.gradient === true ||\n\t\t\tcolorSupport.background !== false ||\n\t\t\tcolorSupport.text !== false )\n\t);\n};\n\n/**\n * Returns true if the block defines support for link color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasLinkColorSupport = ( nameOrType ) => {\n\tif ( Platform.OS !== 'web' ) {\n\t\treturn false;\n\t}\n\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn (\n\t\tcolorSupport !== null &&\n\t\ttypeof colorSupport === 'object' &&\n\t\t!! colorSupport.link\n\t);\n};\n\n/**\n * Returns true if the block defines support for gradient color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasGradientSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn (\n\t\tcolorSupport !== null &&\n\t\ttypeof colorSupport === 'object' &&\n\t\t!! colorSupport.gradients\n\t);\n};\n\n/**\n * Returns true if the block defines support for background color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasBackgroundColorSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn colorSupport && colorSupport.background !== false;\n};\n\n/**\n * Returns true if the block defines support for text-align.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasTextAlignSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, TEXT_ALIGN_SUPPORT_KEY );\n\n/**\n * Returns the block support value for text-align, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getTextAlignSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, TEXT_ALIGN_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for background color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasTextColorSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn colorSupport && colorSupport.text !== false;\n};\n\n/**\n * Get block support for color properties.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @param {string} feature Color feature to get.\n *\n * @return {unknown} The block support.\n */\nexport const getColorSupport = ( nameOrType, feature ) =>\n\tgetBlockSupport( nameOrType, [ COLOR_SUPPORT_KEY, feature ] );\n\n/**\n * Returns true if the block defines support for custom class name.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasCustomClassNameSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, CUSTOM_CLASS_NAME_SUPPORT_KEY, true );\n\n/**\n * Returns the block support value for custom class name, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getCustomClassNameSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, CUSTOM_CLASS_NAME_SUPPORT_KEY, true );\n\n/**\n * Returns true if the block defines support for font family.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasFontFamilySupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, FONT_FAMILY_SUPPORT_KEY );\n\n/**\n * Returns the block support value for font family, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getFontFamilySupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, FONT_FAMILY_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for font size.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasFontSizeSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, FONT_SIZE_SUPPORT_KEY );\n\n/**\n * Returns the block support value for font size, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getFontSizeSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, FONT_SIZE_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for layout.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasLayoutSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, LAYOUT_SUPPORT_KEY );\n\n/**\n * Returns the block support value for layout, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getLayoutSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, LAYOUT_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for style.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasStyleSupport = ( nameOrType ) =>\n\tstyleSupportKeys.some( ( key ) => hasBlockSupport( nameOrType, key ) );\n"],"mappings":";;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA,MAAME,iBAAiB,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AKvC,UAAU,IAC1CF,gBAAgB,CAAC0C,IAAI,CAAIC,GAAG,IAAM,IAAAxC,uBAAe,EAAED,UAAU,EAAEyC,GAAI,CAAE,CAAC;AAACvC,OAAA,CAAAqC,eAAA,GAAAA,eAAA","ignoreList":[]}
1
+ {"version":3,"names":["_blocks","require","_element","ALIGN_SUPPORT_KEY","ALIGN_WIDE_SUPPORT_KEY","BORDER_SUPPORT_KEY","COLOR_SUPPORT_KEY","CUSTOM_CLASS_NAME_SUPPORT_KEY","FONT_FAMILY_SUPPORT_KEY","FONT_SIZE_SUPPORT_KEY","LINE_HEIGHT_SUPPORT_KEY","FONT_STYLE_SUPPORT_KEY","FONT_WEIGHT_SUPPORT_KEY","TEXT_ALIGN_SUPPORT_KEY","TEXT_COLUMNS_SUPPORT_KEY","TEXT_DECORATION_SUPPORT_KEY","WRITING_MODE_SUPPORT_KEY","TEXT_TRANSFORM_SUPPORT_KEY","LETTER_SPACING_SUPPORT_KEY","LAYOUT_SUPPORT_KEY","TYPOGRAPHY_SUPPORT_KEYS","EFFECTS_SUPPORT_KEYS","SPACING_SUPPORT_KEY","styleSupportKeys","hasAlignSupport","nameOrType","hasBlockSupport","exports","getAlignSupport","getBlockSupport","hasAlignWideSupport","getAlignWideSupport","hasBorderSupport","feature","Platform","OS","support","color","radius","width","style","getBorderSupport","hasColorSupport","colorSupport","link","gradient","background","text","hasLinkColorSupport","hasGradientSupport","gradients","hasBackgroundColorSupport","hasTextAlignSupport","getTextAlignSupport","hasTextColorSupport","getColorSupport","hasCustomClassNameSupport","getCustomClassNameSupport","hasFontFamilySupport","getFontFamilySupport","hasFontSizeSupport","getFontSizeSupport","hasLayoutSupport","getLayoutSupport","hasStyleSupport","some","key"],"sources":["@wordpress/block-editor/src/hooks/supports.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';\nimport { Platform } from '@wordpress/element';\n\nconst ALIGN_SUPPORT_KEY = 'align';\nconst ALIGN_WIDE_SUPPORT_KEY = 'alignWide';\nconst BORDER_SUPPORT_KEY = '__experimentalBorder';\nconst COLOR_SUPPORT_KEY = 'color';\nconst CUSTOM_CLASS_NAME_SUPPORT_KEY = 'customClassName';\nconst FONT_FAMILY_SUPPORT_KEY = 'typography.fontFamily';\nconst FONT_SIZE_SUPPORT_KEY = 'typography.fontSize';\nconst LINE_HEIGHT_SUPPORT_KEY = 'typography.lineHeight';\n/**\n * Key within block settings' support array indicating support for font style.\n */\nconst FONT_STYLE_SUPPORT_KEY = 'typography.fontStyle';\n/**\n * Key within block settings' support array indicating support for font weight.\n */\nconst FONT_WEIGHT_SUPPORT_KEY = 'typography.fontWeight';\n/**\n * Key within block settings' supports array indicating support for text\n * align e.g. settings found in `block.json`.\n */\nconst TEXT_ALIGN_SUPPORT_KEY = 'typography.textAlign';\n/**\n * Key within block settings' supports array indicating support for text\n * columns e.g. settings found in `block.json`.\n */\nconst TEXT_COLUMNS_SUPPORT_KEY = 'typography.textColumns';\n/**\n * Key within block settings' supports array indicating support for text\n * decorations e.g. settings found in `block.json`.\n */\nconst TEXT_DECORATION_SUPPORT_KEY = 'typography.textDecoration';\n/**\n * Key within block settings' supports array indicating support for writing mode\n * e.g. settings found in `block.json`.\n */\nconst WRITING_MODE_SUPPORT_KEY = 'typography.__experimentalWritingMode';\n/**\n * Key within block settings' supports array indicating support for text\n * transforms e.g. settings found in `block.json`.\n */\nconst TEXT_TRANSFORM_SUPPORT_KEY = 'typography.textTransform';\n\n/**\n * Key within block settings' supports array indicating support for letter-spacing\n * e.g. settings found in `block.json`.\n */\nconst LETTER_SPACING_SUPPORT_KEY = 'typography.letterSpacing';\nconst LAYOUT_SUPPORT_KEY = 'layout';\nconst TYPOGRAPHY_SUPPORT_KEYS = [\n\tLINE_HEIGHT_SUPPORT_KEY,\n\tFONT_SIZE_SUPPORT_KEY,\n\tFONT_STYLE_SUPPORT_KEY,\n\tFONT_WEIGHT_SUPPORT_KEY,\n\tFONT_FAMILY_SUPPORT_KEY,\n\tTEXT_ALIGN_SUPPORT_KEY,\n\tTEXT_COLUMNS_SUPPORT_KEY,\n\tTEXT_DECORATION_SUPPORT_KEY,\n\tTEXT_TRANSFORM_SUPPORT_KEY,\n\tWRITING_MODE_SUPPORT_KEY,\n\tLETTER_SPACING_SUPPORT_KEY,\n];\nconst EFFECTS_SUPPORT_KEYS = [ 'shadow' ];\nconst SPACING_SUPPORT_KEY = 'spacing';\nconst styleSupportKeys = [\n\t...EFFECTS_SUPPORT_KEYS,\n\t...TYPOGRAPHY_SUPPORT_KEYS,\n\tBORDER_SUPPORT_KEY,\n\tCOLOR_SUPPORT_KEY,\n\tSPACING_SUPPORT_KEY,\n];\n\n/**\n * Returns true if the block defines support for align.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasAlignSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, ALIGN_SUPPORT_KEY );\n\n/**\n * Returns the block support value for align, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getAlignSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, ALIGN_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for align wide.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasAlignWideSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, ALIGN_WIDE_SUPPORT_KEY );\n\n/**\n * Returns the block support value for align wide, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getAlignWideSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, ALIGN_WIDE_SUPPORT_KEY );\n\n/**\n * Determine whether there is block support for border properties.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @param {string} feature Border feature to check support for.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasBorderSupport( nameOrType, feature = 'any' ) {\n\tif ( Platform.OS !== 'web' ) {\n\t\treturn false;\n\t}\n\n\tconst support = getBlockSupport( nameOrType, BORDER_SUPPORT_KEY );\n\n\tif ( support === true ) {\n\t\treturn true;\n\t}\n\n\tif ( feature === 'any' ) {\n\t\treturn !! (\n\t\t\tsupport?.color ||\n\t\t\tsupport?.radius ||\n\t\t\tsupport?.width ||\n\t\t\tsupport?.style\n\t\t);\n\t}\n\n\treturn !! support?.[ feature ];\n}\n\n/**\n * Get block support for border properties.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @param {string} feature Border feature to get.\n *\n * @return {unknown} The block support.\n */\nexport const getBorderSupport = ( nameOrType, feature ) =>\n\tgetBlockSupport( nameOrType, [ BORDER_SUPPORT_KEY, feature ] );\n\n/**\n * Returns true if the block defines support for color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasColorSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\treturn (\n\t\tcolorSupport &&\n\t\t( colorSupport.link === true ||\n\t\t\tcolorSupport.gradient === true ||\n\t\t\tcolorSupport.background !== false ||\n\t\t\tcolorSupport.text !== false )\n\t);\n};\n\n/**\n * Returns true if the block defines support for link color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasLinkColorSupport = ( nameOrType ) => {\n\tif ( Platform.OS !== 'web' ) {\n\t\treturn false;\n\t}\n\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn (\n\t\tcolorSupport !== null &&\n\t\ttypeof colorSupport === 'object' &&\n\t\t!! colorSupport.link\n\t);\n};\n\n/**\n * Returns true if the block defines support for gradient color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasGradientSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn (\n\t\tcolorSupport !== null &&\n\t\ttypeof colorSupport === 'object' &&\n\t\t!! colorSupport.gradients\n\t);\n};\n\n/**\n * Returns true if the block defines support for background color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasBackgroundColorSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn colorSupport && colorSupport.background !== false;\n};\n\n/**\n * Returns true if the block defines support for text-align.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasTextAlignSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, TEXT_ALIGN_SUPPORT_KEY );\n\n/**\n * Returns the block support value for text-align, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getTextAlignSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, TEXT_ALIGN_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for background color.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasTextColorSupport = ( nameOrType ) => {\n\tconst colorSupport = getBlockSupport( nameOrType, COLOR_SUPPORT_KEY );\n\n\treturn colorSupport && colorSupport.text !== false;\n};\n\n/**\n * Get block support for color properties.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @param {string} feature Color feature to get.\n *\n * @return {unknown} The block support.\n */\nexport const getColorSupport = ( nameOrType, feature ) =>\n\tgetBlockSupport( nameOrType, [ COLOR_SUPPORT_KEY, feature ] );\n\n/**\n * Returns true if the block defines support for custom class name.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasCustomClassNameSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, CUSTOM_CLASS_NAME_SUPPORT_KEY, true );\n\n/**\n * Returns the block support value for custom class name, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getCustomClassNameSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, CUSTOM_CLASS_NAME_SUPPORT_KEY, true );\n\n/**\n * Returns true if the block defines support for font family.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasFontFamilySupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, FONT_FAMILY_SUPPORT_KEY );\n\n/**\n * Returns the block support value for font family, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getFontFamilySupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, FONT_FAMILY_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for font size.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasFontSizeSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, FONT_SIZE_SUPPORT_KEY );\n\n/**\n * Returns the block support value for font size, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getFontSizeSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, FONT_SIZE_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for layout.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasLayoutSupport = ( nameOrType ) =>\n\thasBlockSupport( nameOrType, LAYOUT_SUPPORT_KEY );\n\n/**\n * Returns the block support value for layout, if defined.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {unknown} The block support value.\n */\nexport const getLayoutSupport = ( nameOrType ) =>\n\tgetBlockSupport( nameOrType, LAYOUT_SUPPORT_KEY );\n\n/**\n * Returns true if the block defines support for style.\n *\n * @param {string|Object} nameOrType Block name or type object.\n * @return {boolean} Whether the block supports the feature.\n */\nexport const hasStyleSupport = ( nameOrType ) =>\n\tstyleSupport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AAU,IAC3C,IAAAI,uBAAe,EAAEJ,UAAU,EAAEN,kBAAmB,CAAC;;AAElD;AACA;AACA;AACA;AACA;AACA;AALAQ,OAAA,CAAAoC,gBAAA,GAAAA,gBAAA;AAMO,MAAMC,eAAe,GAAKvC,UAAU,IAC1CF,gBAAgB,CAAC0C,IAAI,CAAIC,GAAG,IAAM,IAAAxC,uBAAe,EAAED,UAAU,EAAEyC,GAAI,CAAE,CAAC;AAACvC,OAAA,CAAAqC,eAAA,GAAAA,eAAA","ignoreList":[]}
@@ -32,12 +32,12 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
32
32
  function omit(object, keys) {
33
33
  return Object.fromEntries(Object.entries(object).filter(([key]) => !keys.includes(key)));
34
34
  }
35
- const LETTER_SPACING_SUPPORT_KEY = 'typography.__experimentalLetterSpacing';
36
- const TEXT_TRANSFORM_SUPPORT_KEY = 'typography.__experimentalTextTransform';
37
- const TEXT_DECORATION_SUPPORT_KEY = 'typography.__experimentalTextDecoration';
35
+ const LETTER_SPACING_SUPPORT_KEY = 'typography.letterSpacing';
36
+ const TEXT_TRANSFORM_SUPPORT_KEY = 'typography.textTransform';
37
+ const TEXT_DECORATION_SUPPORT_KEY = 'typography.textDecoration';
38
38
  const TEXT_COLUMNS_SUPPORT_KEY = 'typography.textColumns';
39
- const FONT_STYLE_SUPPORT_KEY = 'typography.__experimentalFontStyle';
40
- const FONT_WEIGHT_SUPPORT_KEY = 'typography.__experimentalFontWeight';
39
+ const FONT_STYLE_SUPPORT_KEY = 'typography.fontStyle';
40
+ const FONT_WEIGHT_SUPPORT_KEY = 'typography.fontWeight';
41
41
  const WRITING_MODE_SUPPORT_KEY = 'typography.__experimentalWritingMode';
42
42
  const TYPOGRAPHY_SUPPORT_KEY = exports.TYPOGRAPHY_SUPPORT_KEY = 'typography';
43
43
  const TYPOGRAPHY_SUPPORT_KEYS = exports.TYPOGRAPHY_SUPPORT_KEYS = [_lineHeight.LINE_HEIGHT_SUPPORT_KEY, _fontSize.FONT_SIZE_SUPPORT_KEY, FONT_STYLE_SUPPORT_KEY, FONT_WEIGHT_SUPPORT_KEY, _fontFamily.FONT_FAMILY_SUPPORT_KEY, _textAlign.TEXT_ALIGN_SUPPORT_KEY, TEXT_COLUMNS_SUPPORT_KEY, TEXT_DECORATION_SUPPORT_KEY, WRITING_MODE_SUPPORT_KEY, TEXT_TRANSFORM_SUPPORT_KEY, LETTER_SPACING_SUPPORT_KEY];
@@ -1 +1 @@
1
- {"version":3,"names":["_blocks","require","_element","_data","_inspectorControls","_interopRequireDefault","_typographyPanel","_interopRequireWildcard","_lineHeight","_fontFamily","_fontSize","_textAlign","_utils","_store","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","omit","object","keys","fromEntries","entries","filter","key","includes","LETTER_SPACING_SUPPORT_KEY","TEXT_TRANSFORM_SUPPORT_KEY","TEXT_DECORATION_SUPPORT_KEY","TEXT_COLUMNS_SUPPORT_KEY","FONT_STYLE_SUPPORT_KEY","FONT_WEIGHT_SUPPORT_KEY","WRITING_MODE_SUPPORT_KEY","TYPOGRAPHY_SUPPORT_KEY","exports","TYPOGRAPHY_SUPPORT_KEYS","LINE_HEIGHT_SUPPORT_KEY","FONT_SIZE_SUPPORT_KEY","FONT_FAMILY_SUPPORT_KEY","TEXT_ALIGN_SUPPORT_KEY","styleToAttributes","style","updatedStyle","fontSizeValue","typography","fontSize","fontFamilyValue","fontFamily","fontSizeSlug","startsWith","substring","length","undefined","fontFamilySlug","cleanEmptyObject","attributesToStyle","attributes","TypographyInspectorControl","children","resetAllFilter","attributesResetAllFilter","useCallback","existingStyle","jsx","group","TypographyPanel","clientId","name","setAttributes","settings","selector","select","blockEditorStore","getBlockAttributes","useSelect","isEnabled","useHasTypographyPanel","value","useMemo","onChange","newStyle","defaultControls","getBlockSupport","as","panelId","hasTypographySupport","blockName","some","hasBlockSupport"],"sources":["@wordpress/block-editor/src/hooks/typography.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';\nimport { useMemo, useCallback } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport InspectorControls from '../components/inspector-controls';\nimport {\n\tdefault as StylesTypographyPanel,\n\tuseHasTypographyPanel,\n} from '../components/global-styles/typography-panel';\n\nimport { LINE_HEIGHT_SUPPORT_KEY } from './line-height';\nimport { FONT_FAMILY_SUPPORT_KEY } from './font-family';\nimport { FONT_SIZE_SUPPORT_KEY } from './font-size';\nimport { TEXT_ALIGN_SUPPORT_KEY } from './text-align';\nimport { cleanEmptyObject } from './utils';\nimport { store as blockEditorStore } from '../store';\n\nfunction omit( object, keys ) {\n\treturn Object.fromEntries(\n\t\tObject.entries( object ).filter( ( [ key ] ) => ! keys.includes( key ) )\n\t);\n}\n\nconst LETTER_SPACING_SUPPORT_KEY = 'typography.__experimentalLetterSpacing';\nconst TEXT_TRANSFORM_SUPPORT_KEY = 'typography.__experimentalTextTransform';\nconst TEXT_DECORATION_SUPPORT_KEY = 'typography.__experimentalTextDecoration';\nconst TEXT_COLUMNS_SUPPORT_KEY = 'typography.textColumns';\nconst FONT_STYLE_SUPPORT_KEY = 'typography.__experimentalFontStyle';\nconst FONT_WEIGHT_SUPPORT_KEY = 'typography.__experimentalFontWeight';\nconst WRITING_MODE_SUPPORT_KEY = 'typography.__experimentalWritingMode';\nexport const TYPOGRAPHY_SUPPORT_KEY = 'typography';\nexport const TYPOGRAPHY_SUPPORT_KEYS = [\n\tLINE_HEIGHT_SUPPORT_KEY,\n\tFONT_SIZE_SUPPORT_KEY,\n\tFONT_STYLE_SUPPORT_KEY,\n\tFONT_WEIGHT_SUPPORT_KEY,\n\tFONT_FAMILY_SUPPORT_KEY,\n\tTEXT_ALIGN_SUPPORT_KEY,\n\tTEXT_COLUMNS_SUPPORT_KEY,\n\tTEXT_DECORATION_SUPPORT_KEY,\n\tWRITING_MODE_SUPPORT_KEY,\n\tTEXT_TRANSFORM_SUPPORT_KEY,\n\tLETTER_SPACING_SUPPORT_KEY,\n];\n\nfunction styleToAttributes( style ) {\n\tconst updatedStyle = { ...omit( style, [ 'fontFamily' ] ) };\n\tconst fontSizeValue = style?.typography?.fontSize;\n\tconst fontFamilyValue = style?.typography?.fontFamily;\n\tconst fontSizeSlug = fontSizeValue?.startsWith( 'var:preset|font-size|' )\n\t\t? fontSizeValue.substring( 'var:preset|font-size|'.length )\n\t\t: undefined;\n\tconst fontFamilySlug = fontFamilyValue?.startsWith(\n\t\t'var:preset|font-family|'\n\t)\n\t\t? fontFamilyValue.substring( 'var:preset|font-family|'.length )\n\t\t: undefined;\n\tupdatedStyle.typography = {\n\t\t...omit( updatedStyle.typography, [ 'fontFamily' ] ),\n\t\tfontSize: fontSizeSlug ? undefined : fontSizeValue,\n\t};\n\treturn {\n\t\tstyle: cleanEmptyObject( updatedStyle ),\n\t\tfontFamily: fontFamilySlug,\n\t\tfontSize: fontSizeSlug,\n\t};\n}\n\nfunction attributesToStyle( attributes ) {\n\treturn {\n\t\t...attributes.style,\n\t\ttypography: {\n\t\t\t...attributes.style?.typography,\n\t\t\tfontFamily: attributes.fontFamily\n\t\t\t\t? 'var:preset|font-family|' + attributes.fontFamily\n\t\t\t\t: undefined,\n\t\t\tfontSize: attributes.fontSize\n\t\t\t\t? 'var:preset|font-size|' + attributes.fontSize\n\t\t\t\t: attributes.style?.typography?.fontSize,\n\t\t},\n\t};\n}\n\nfunction TypographyInspectorControl( { children, resetAllFilter } ) {\n\tconst attributesResetAllFilter = useCallback(\n\t\t( attributes ) => {\n\t\t\tconst existingStyle = attributesToStyle( attributes );\n\t\t\tconst updatedStyle = resetAllFilter( existingStyle );\n\t\t\treturn {\n\t\t\t\t...attributes,\n\t\t\t\t...styleToAttributes( updatedStyle ),\n\t\t\t};\n\t\t},\n\t\t[ resetAllFilter ]\n\t);\n\n\treturn (\n\t\t<InspectorControls\n\t\t\tgroup=\"typography\"\n\t\t\tresetAllFilter={ attributesResetAllFilter }\n\t\t>\n\t\t\t{ children }\n\t\t</InspectorControls>\n\t);\n}\n\nexport function TypographyPanel( { clientId, name, setAttributes, settings } ) {\n\tfunction selector( select ) {\n\t\tconst { style, fontFamily, fontSize } =\n\t\t\tselect( blockEditorStore ).getBlockAttributes( clientId ) || {};\n\t\treturn { style, fontFamily, fontSize };\n\t}\n\tconst { style, fontFamily, fontSize } = useSelect( selector, [ clientId ] );\n\tconst isEnabled = useHasTypographyPanel( settings );\n\tconst value = useMemo(\n\t\t() => attributesToStyle( { style, fontFamily, fontSize } ),\n\t\t[ style, fontSize, fontFamily ]\n\t);\n\n\tconst onChange = ( newStyle ) => {\n\t\tsetAttributes( styleToAttributes( newStyle ) );\n\t};\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\tconst defaultControls = getBlockSupport( name, [\n\t\tTYPOGRAPHY_SUPPORT_KEY,\n\t\t'__experimentalDefaultControls',\n\t] );\n\n\treturn (\n\t\t<StylesTypographyPanel\n\t\t\tas={ TypographyInspectorControl }\n\t\t\tpanelId={ clientId }\n\t\t\tsettings={ settings }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\tdefaultControls={ defaultControls }\n\t\t/>\n\t);\n}\n\nexport const hasTypographySupport = ( blockName ) => {\n\treturn TYPOGRAPHY_SUPPORT_KEYS.some( ( key ) =>\n\t\thasBlockSupport( blockName, key )\n\t);\n};\n"],"mappings":";;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAKA,IAAAG,kBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,gBAAA,GAAAC,uBAAA,CAAAN,OAAA;AAKA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AACA,IAAAS,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GA,QAAU;IACrBQ,KAAK,EAAGA,KAAO;IACfE,QAAQ,EAAGA,QAAU;IACrBE,eAAe,EAAGA;EAAiB,CACnC,CAAC;AAEJ;AAEO,MAAMI,oBAAoB,GAAKC,SAAS,IAAM;EACpD,OAAOnD,uBAAuB,CAACoD,IAAI,CAAI/D,GAAG,IACzC,IAAAgE,uBAAe,EAAEF,SAAS,EAAE9D,GAAI,CACjC,CAAC;AACF,CAAC;AAACU,OAAA,CAAAmD,oBAAA,GAAAA,oBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_blocks","require","_element","_data","_inspectorControls","_interopRequireDefault","_typographyPanel","_interopRequireWildcard","_lineHeight","_fontFamily","_fontSize","_textAlign","_utils","_store","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","omit","object","keys","fromEntries","entries","filter","key","includes","LETTER_SPACING_SUPPORT_KEY","TEXT_TRANSFORM_SUPPORT_KEY","TEXT_DECORATION_SUPPORT_KEY","TEXT_COLUMNS_SUPPORT_KEY","FONT_STYLE_SUPPORT_KEY","FONT_WEIGHT_SUPPORT_KEY","WRITING_MODE_SUPPORT_KEY","TYPOGRAPHY_SUPPORT_KEY","exports","TYPOGRAPHY_SUPPORT_KEYS","LINE_HEIGHT_SUPPORT_KEY","FONT_SIZE_SUPPORT_KEY","FONT_FAMILY_SUPPORT_KEY","TEXT_ALIGN_SUPPORT_KEY","styleToAttributes","style","updatedStyle","fontSizeValue","typography","fontSize","fontFamilyValue","fontFamily","fontSizeSlug","startsWith","substring","length","undefined","fontFamilySlug","cleanEmptyObject","attributesToStyle","attributes","TypographyInspectorControl","children","resetAllFilter","attributesResetAllFilter","useCallback","existingStyle","jsx","group","TypographyPanel","clientId","name","setAttributes","settings","selector","select","blockEditorStore","getBlockAttributes","useSelect","isEnabled","useHasTypographyPanel","value","useMemo","onChange","newStyle","defaultControls","getBlockSupport","as","panelId","hasTypographySupport","blockName","some","hasBlockSupport"],"sources":["@wordpress/block-editor/src/hooks/typography.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';\nimport { useMemo, useCallback } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport InspectorControls from '../components/inspector-controls';\nimport {\n\tdefault as StylesTypographyPanel,\n\tuseHasTypographyPanel,\n} from '../components/global-styles/typography-panel';\n\nimport { LINE_HEIGHT_SUPPORT_KEY } from './line-height';\nimport { FONT_FAMILY_SUPPORT_KEY } from './font-family';\nimport { FONT_SIZE_SUPPORT_KEY } from './font-size';\nimport { TEXT_ALIGN_SUPPORT_KEY } from './text-align';\nimport { cleanEmptyObject } from './utils';\nimport { store as blockEditorStore } from '../store';\n\nfunction omit( object, keys ) {\n\treturn Object.fromEntries(\n\t\tObject.entries( object ).filter( ( [ key ] ) => ! keys.includes( key ) )\n\t);\n}\n\nconst LETTER_SPACING_SUPPORT_KEY = 'typography.letterSpacing';\nconst TEXT_TRANSFORM_SUPPORT_KEY = 'typography.textTransform';\nconst TEXT_DECORATION_SUPPORT_KEY = 'typography.textDecoration';\nconst TEXT_COLUMNS_SUPPORT_KEY = 'typography.textColumns';\nconst FONT_STYLE_SUPPORT_KEY = 'typography.fontStyle';\nconst FONT_WEIGHT_SUPPORT_KEY = 'typography.fontWeight';\nconst WRITING_MODE_SUPPORT_KEY = 'typography.__experimentalWritingMode';\nexport const TYPOGRAPHY_SUPPORT_KEY = 'typography';\nexport const TYPOGRAPHY_SUPPORT_KEYS = [\n\tLINE_HEIGHT_SUPPORT_KEY,\n\tFONT_SIZE_SUPPORT_KEY,\n\tFONT_STYLE_SUPPORT_KEY,\n\tFONT_WEIGHT_SUPPORT_KEY,\n\tFONT_FAMILY_SUPPORT_KEY,\n\tTEXT_ALIGN_SUPPORT_KEY,\n\tTEXT_COLUMNS_SUPPORT_KEY,\n\tTEXT_DECORATION_SUPPORT_KEY,\n\tWRITING_MODE_SUPPORT_KEY,\n\tTEXT_TRANSFORM_SUPPORT_KEY,\n\tLETTER_SPACING_SUPPORT_KEY,\n];\n\nfunction styleToAttributes( style ) {\n\tconst updatedStyle = { ...omit( style, [ 'fontFamily' ] ) };\n\tconst fontSizeValue = style?.typography?.fontSize;\n\tconst fontFamilyValue = style?.typography?.fontFamily;\n\tconst fontSizeSlug = fontSizeValue?.startsWith( 'var:preset|font-size|' )\n\t\t? fontSizeValue.substring( 'var:preset|font-size|'.length )\n\t\t: undefined;\n\tconst fontFamilySlug = fontFamilyValue?.startsWith(\n\t\t'var:preset|font-family|'\n\t)\n\t\t? fontFamilyValue.substring( 'var:preset|font-family|'.length )\n\t\t: undefined;\n\tupdatedStyle.typography = {\n\t\t...omit( updatedStyle.typography, [ 'fontFamily' ] ),\n\t\tfontSize: fontSizeSlug ? undefined : fontSizeValue,\n\t};\n\treturn {\n\t\tstyle: cleanEmptyObject( updatedStyle ),\n\t\tfontFamily: fontFamilySlug,\n\t\tfontSize: fontSizeSlug,\n\t};\n}\n\nfunction attributesToStyle( attributes ) {\n\treturn {\n\t\t...attributes.style,\n\t\ttypography: {\n\t\t\t...attributes.style?.typography,\n\t\t\tfontFamily: attributes.fontFamily\n\t\t\t\t? 'var:preset|font-family|' + attributes.fontFamily\n\t\t\t\t: undefined,\n\t\t\tfontSize: attributes.fontSize\n\t\t\t\t? 'var:preset|font-size|' + attributes.fontSize\n\t\t\t\t: attributes.style?.typography?.fontSize,\n\t\t},\n\t};\n}\n\nfunction TypographyInspectorControl( { children, resetAllFilter } ) {\n\tconst attributesResetAllFilter = useCallback(\n\t\t( attributes ) => {\n\t\t\tconst existingStyle = attributesToStyle( attributes );\n\t\t\tconst updatedStyle = resetAllFilter( existingStyle );\n\t\t\treturn {\n\t\t\t\t...attributes,\n\t\t\t\t...styleToAttributes( updatedStyle ),\n\t\t\t};\n\t\t},\n\t\t[ resetAllFilter ]\n\t);\n\n\treturn (\n\t\t<InspectorControls\n\t\t\tgroup=\"typography\"\n\t\t\tresetAllFilter={ attributesResetAllFilter }\n\t\t>\n\t\t\t{ children }\n\t\t</InspectorControls>\n\t);\n}\n\nexport function TypographyPanel( { clientId, name, setAttributes, settings } ) {\n\tfunction selector( select ) {\n\t\tconst { style, fontFamily, fontSize } =\n\t\t\tselect( blockEditorStore ).getBlockAttributes( clientId ) || {};\n\t\treturn { style, fontFamily, fontSize };\n\t}\n\tconst { style, fontFamily, fontSize } = useSelect( selector, [ clientId ] );\n\tconst isEnabled = useHasTypographyPanel( settings );\n\tconst value = useMemo(\n\t\t() => attributesToStyle( { style, fontFamily, fontSize } ),\n\t\t[ style, fontSize, fontFamily ]\n\t);\n\n\tconst onChange = ( newStyle ) => {\n\t\tsetAttributes( styleToAttributes( newStyle ) );\n\t};\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\tconst defaultControls = getBlockSupport( name, [\n\t\tTYPOGRAPHY_SUPPORT_KEY,\n\t\t'__experimentalDefaultControls',\n\t] );\n\n\treturn (\n\t\t<StylesTypographyPanel\n\t\t\tas={ TypographyInspectorControl }\n\t\t\tpanelId={ clientId }\n\t\t\tsettings={ settings }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\tdefaultControls={ defaultControls }\n\t\t/>\n\t);\n}\n\nexport const hasTypographySupport = ( blockName ) => {\n\treturn TYPOGRAPHY_SUPPORT_KEYS.some( ( key ) =>\n\t\thasBlockSupport( blockName, key )\n\t);\n};\n"],"mappings":";;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAKA,IAAAG,kBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,gBAAA,GAAAC,uBAAA,CAAAN,OAAA;AAKA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AACA,IAAAS,SAAA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AAU;IACrBQ,KAAK,EAAGA,KAAO;IACfE,QAAQ,EAAGA,QAAU;IACrBE,eAAe,EAAGA;EAAiB,CACnC,CAAC;AAEJ;AAEO,MAAMI,oBAAoB,GAAKC,SAAS,IAAM;EACpD,OAAOnD,uBAAuB,CAACoD,IAAI,CAAI/D,GAAG,IACzC,IAAAgE,uBAAe,EAAEF,SAAS,EAAE9D,GAAI,CACjC,CAAC;AACF,CAAC;AAACU,OAAA,CAAAmD,oBAAA,GAAAA,oBAAA","ignoreList":[]}
@@ -23,37 +23,28 @@ var _lockUnlock = require("../lock-unlock");
23
23
  */
24
24
  function useZoomOut(zoomOut = true) {
25
25
  const {
26
- __unstableSetEditorMode,
27
- setZoomLevel
26
+ setZoomLevel,
27
+ resetZoomLevel
28
28
  } = (0, _lockUnlock.unlock)((0, _data.useDispatch)(_store.store));
29
29
  const {
30
- __unstableGetEditorMode
30
+ isZoomOut
31
31
  } = (0, _lockUnlock.unlock)((0, _data.useSelect)(_store.store));
32
- const originalEditingModeRef = (0, _element.useRef)(null);
33
- const mode = __unstableGetEditorMode();
34
32
  (0, _element.useEffect)(() => {
35
- // Only set this on mount so we know what to return to when we unmount.
36
- if (!originalEditingModeRef.current) {
37
- originalEditingModeRef.current = mode;
38
- }
33
+ const isZoomOutOnMount = isZoomOut();
39
34
  return () => {
40
- // We need to use __unstableGetEditorMode() here and not `mode`, as mode may not update on unmount
41
- if (__unstableGetEditorMode() === 'zoom-out' && __unstableGetEditorMode() !== originalEditingModeRef.current) {
42
- __unstableSetEditorMode(originalEditingModeRef.current);
43
- setZoomLevel(100);
35
+ if (isZoomOutOnMount) {
36
+ setZoomLevel('auto-scaled');
37
+ } else {
38
+ resetZoomLevel();
44
39
  }
45
40
  };
46
41
  }, []);
47
-
48
- // The effect opens the zoom-out view if we want it open and it's not currently in zoom-out mode.
49
42
  (0, _element.useEffect)(() => {
50
- if (zoomOut && mode !== 'zoom-out') {
51
- __unstableSetEditorMode('zoom-out');
52
- setZoomLevel(50);
53
- } else if (!zoomOut && __unstableGetEditorMode() === 'zoom-out' && originalEditingModeRef.current !== mode) {
54
- __unstableSetEditorMode(originalEditingModeRef.current);
55
- setZoomLevel(100);
43
+ if (zoomOut) {
44
+ setZoomLevel('auto-scaled');
45
+ } else {
46
+ resetZoomLevel();
56
47
  }
57
- }, [__unstableGetEditorMode, __unstableSetEditorMode, zoomOut, setZoomLevel]); // Mode is deliberately excluded from the dependencies so that the effect does not run when mode changes.
48
+ }, [zoomOut, setZoomLevel, resetZoomLevel]);
58
49
  }
59
50
  //# sourceMappingURL=use-zoom-out.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_element","_store","_lockUnlock","useZoomOut","zoomOut","__unstableSetEditorMode","setZoomLevel","unlock","useDispatch","blockEditorStore","__unstableGetEditorMode","useSelect","originalEditingModeRef","useRef","mode","useEffect","current"],"sources":["@wordpress/block-editor/src/hooks/use-zoom-out.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useEffect, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../store';\nimport { unlock } from '../lock-unlock';\n/**\n * A hook used to set the editor mode to zoomed out mode, invoking the hook sets the mode.\n *\n * @param {boolean} zoomOut If we should enter into zoomOut mode or not\n */\nexport function useZoomOut( zoomOut = true ) {\n\tconst { __unstableSetEditorMode, setZoomLevel } = unlock(\n\t\tuseDispatch( blockEditorStore )\n\t);\n\tconst { __unstableGetEditorMode } = unlock( useSelect( blockEditorStore ) );\n\n\tconst originalEditingModeRef = useRef( null );\n\tconst mode = __unstableGetEditorMode();\n\n\tuseEffect( () => {\n\t\t// Only set this on mount so we know what to return to when we unmount.\n\t\tif ( ! originalEditingModeRef.current ) {\n\t\t\toriginalEditingModeRef.current = mode;\n\t\t}\n\n\t\treturn () => {\n\t\t\t// We need to use __unstableGetEditorMode() here and not `mode`, as mode may not update on unmount\n\t\t\tif (\n\t\t\t\t__unstableGetEditorMode() === 'zoom-out' &&\n\t\t\t\t__unstableGetEditorMode() !== originalEditingModeRef.current\n\t\t\t) {\n\t\t\t\t__unstableSetEditorMode( originalEditingModeRef.current );\n\t\t\t\tsetZoomLevel( 100 );\n\t\t\t}\n\t\t};\n\t}, [] );\n\n\t// The effect opens the zoom-out view if we want it open and it's not currently in zoom-out mode.\n\tuseEffect( () => {\n\t\tif ( zoomOut && mode !== 'zoom-out' ) {\n\t\t\t__unstableSetEditorMode( 'zoom-out' );\n\t\t\tsetZoomLevel( 50 );\n\t\t} else if (\n\t\t\t! zoomOut &&\n\t\t\t__unstableGetEditorMode() === 'zoom-out' &&\n\t\t\toriginalEditingModeRef.current !== mode\n\t\t) {\n\t\t\t__unstableSetEditorMode( originalEditingModeRef.current );\n\t\t\tsetZoomLevel( 100 );\n\t\t}\n\t}, [\n\t\t__unstableGetEditorMode,\n\t\t__unstableSetEditorMode,\n\t\tzoomOut,\n\t\tsetZoomLevel,\n\t] ); // Mode is deliberately excluded from the dependencies so that the effect does not run when mode changes.\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAVA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACO,SAASI,UAAUA,CAAEC,OAAO,GAAG,IAAI,EAAG;EAC5C,MAAM;IAAEC,uBAAuB;IAAEC;EAAa,CAAC,GAAG,IAAAC,kBAAM,EACvD,IAAAC,iBAAW,EAAEC,YAAiB,CAC/B,CAAC;EACD,MAAM;IAAEC;EAAwB,CAAC,GAAG,IAAAH,kBAAM,EAAE,IAAAI,eAAS,EAAEF,YAAiB,CAAE,CAAC;EAE3E,MAAMG,sBAAsB,GAAG,IAAAC,eAAM,EAAE,IAAK,CAAC;EAC7C,MAAMC,IAAI,GAAGJ,uBAAuB,CAAC,CAAC;EAEtC,IAAAK,kBAAS,EAAE,MAAM;IAChB;IACA,IAAK,CAAEH,sBAAsB,CAACI,OAAO,EAAG;MACvCJ,sBAAsB,CAACI,OAAO,GAAGF,IAAI;IACtC;IAEA,OAAO,MAAM;MACZ;MACA,IACCJ,uBAAuB,CAAC,CAAC,KAAK,UAAU,IACxCA,uBAAuB,CAAC,CAAC,KAAKE,sBAAsB,CAACI,OAAO,EAC3D;QACDX,uBAAuB,CAAEO,sBAAsB,CAACI,OAAQ,CAAC;QACzDV,YAAY,CAAE,GAAI,CAAC;MACpB;IACD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;;EAEP;EACA,IAAAS,kBAAS,EAAE,MAAM;IAChB,IAAKX,OAAO,IAAIU,IAAI,KAAK,UAAU,EAAG;MACrCT,uBAAuB,CAAE,UAAW,CAAC;MACrCC,YAAY,CAAE,EAAG,CAAC;IACnB,CAAC,MAAM,IACN,CAAEF,OAAO,IACTM,uBAAuB,CAAC,CAAC,KAAK,UAAU,IACxCE,sBAAsB,CAACI,OAAO,KAAKF,IAAI,EACtC;MACDT,uBAAuB,CAAEO,sBAAsB,CAACI,OAAQ,CAAC;MACzDV,YAAY,CAAE,GAAI,CAAC;IACpB;EACD,CAAC,EAAE,CACFI,uBAAuB,EACvBL,uBAAuB,EACvBD,OAAO,EACPE,YAAY,CACX,CAAC,CAAC,CAAC;AACN","ignoreList":[]}
1
+ {"version":3,"names":["_data","require","_element","_store","_lockUnlock","useZoomOut","zoomOut","setZoomLevel","resetZoomLevel","unlock","useDispatch","blockEditorStore","isZoomOut","useSelect","useEffect","isZoomOutOnMount"],"sources":["@wordpress/block-editor/src/hooks/use-zoom-out.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../store';\nimport { unlock } from '../lock-unlock';\n\n/**\n * A hook used to set the editor mode to zoomed out mode, invoking the hook sets the mode.\n *\n * @param {boolean} zoomOut If we should enter into zoomOut mode or not\n */\nexport function useZoomOut( zoomOut = true ) {\n\tconst { setZoomLevel, resetZoomLevel } = unlock(\n\t\tuseDispatch( blockEditorStore )\n\t);\n\tconst { isZoomOut } = unlock( useSelect( blockEditorStore ) );\n\n\tuseEffect( () => {\n\t\tconst isZoomOutOnMount = isZoomOut();\n\n\t\treturn () => {\n\t\t\tif ( isZoomOutOnMount ) {\n\t\t\t\tsetZoomLevel( 'auto-scaled' );\n\t\t\t} else {\n\t\t\t\tresetZoomLevel();\n\t\t\t}\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tif ( zoomOut ) {\n\t\t\tsetZoomLevel( 'auto-scaled' );\n\t\t} else {\n\t\t\tresetZoomLevel();\n\t\t}\n\t}, [ zoomOut, setZoomLevel, resetZoomLevel ] );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAVA;AACA;AACA;;AAIA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACO,SAASI,UAAUA,CAAEC,OAAO,GAAG,IAAI,EAAG;EAC5C,MAAM;IAAEC,YAAY;IAAEC;EAAe,CAAC,GAAG,IAAAC,kBAAM,EAC9C,IAAAC,iBAAW,EAAEC,YAAiB,CAC/B,CAAC;EACD,MAAM;IAAEC;EAAU,CAAC,GAAG,IAAAH,kBAAM,EAAE,IAAAI,eAAS,EAAEF,YAAiB,CAAE,CAAC;EAE7D,IAAAG,kBAAS,EAAE,MAAM;IAChB,MAAMC,gBAAgB,GAAGH,SAAS,CAAC,CAAC;IAEpC,OAAO,MAAM;MACZ,IAAKG,gBAAgB,EAAG;QACvBR,YAAY,CAAE,aAAc,CAAC;MAC9B,CAAC,MAAM;QACNC,cAAc,CAAC,CAAC;MACjB;IACD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,IAAAM,kBAAS,EAAE,MAAM;IAChB,IAAKR,OAAO,EAAG;MACdC,YAAY,CAAE,aAAc,CAAC;IAC9B,CAAC,MAAM;MACNC,cAAc,CAAC,CAAC;IACjB;EACD,CAAC,EAAE,CAAEF,OAAO,EAAEC,YAAY,EAAEC,cAAc,CAAG,CAAC;AAC/C","ignoreList":[]}
@@ -341,11 +341,11 @@ function createBlockEditFilter(features) {
341
341
  }
342
342
  function BlockProps({
343
343
  index,
344
- useBlockProps,
344
+ useBlockProps: hook,
345
345
  setAllWrapperProps,
346
346
  ...props
347
347
  }) {
348
- const wrapperProps = useBlockProps(props);
348
+ const wrapperProps = hook(props);
349
349
  const setWrapperProps = next => setAllWrapperProps(prev => {
350
350
  const nextAll = [...prev];
351
351
  nextAll[index] = next;