@wordpress/block-editor 12.14.0 → 12.16.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 (664) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +10 -5
  3. package/build/components/block-canvas/index.js +22 -6
  4. package/build/components/block-canvas/index.js.map +1 -1
  5. package/build/components/block-card/index.js +1 -1
  6. package/build/components/block-card/index.js.map +1 -1
  7. package/build/components/block-controls/hook.js +3 -23
  8. package/build/components/block-controls/hook.js.map +1 -1
  9. package/build/components/block-edit/context.js +5 -1
  10. package/build/components/block-edit/context.js.map +1 -1
  11. package/build/components/block-edit/index.js +18 -9
  12. package/build/components/block-edit/index.js.map +1 -1
  13. package/build/components/block-info-slot-fill/index.js +3 -4
  14. package/build/components/block-info-slot-fill/index.js.map +1 -1
  15. package/build/components/block-list/block.js +28 -9
  16. package/build/components/block-list/block.js.map +1 -1
  17. package/build/components/block-list/block.native.js +16 -5
  18. package/build/components/block-list/block.native.js.map +1 -1
  19. package/build/components/block-list/use-block-props/index.js +61 -18
  20. package/build/components/block-list/use-block-props/index.js.map +1 -1
  21. package/build/components/block-list/use-block-props/use-focus-first-element.js +4 -29
  22. package/build/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  23. package/build/components/block-list/use-block-props/use-is-hovered.js +4 -14
  24. package/build/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
  25. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js +4 -2
  26. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  27. package/build/components/block-parent-selector/index.js +1 -1
  28. package/build/components/block-parent-selector/index.js.map +1 -1
  29. package/build/components/block-pattern-setup/index.js +25 -16
  30. package/build/components/block-pattern-setup/index.js.map +1 -1
  31. package/build/components/block-pattern-setup/setup-toolbar.js +4 -2
  32. package/build/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  33. package/build/components/block-patterns-list/index.js +37 -20
  34. package/build/components/block-patterns-list/index.js.map +1 -1
  35. package/build/components/block-removal-warning-modal/index.js +2 -9
  36. package/build/components/block-removal-warning-modal/index.js.map +1 -1
  37. package/build/components/block-rename/index.js +28 -0
  38. package/build/components/block-rename/index.js.map +1 -0
  39. package/build/components/block-rename/is-empty-string.js +10 -0
  40. package/build/components/block-rename/is-empty-string.js.map +1 -0
  41. package/build/components/block-rename/modal.js +90 -0
  42. package/build/components/block-rename/modal.js.map +1 -0
  43. package/build/components/block-rename/rename-control.js +74 -0
  44. package/build/components/block-rename/rename-control.js.map +1 -0
  45. package/build/components/block-rename/use-block-rename.js +17 -0
  46. package/build/components/block-rename/use-block-rename.js.map +1 -0
  47. package/build/components/block-settings/container.native.js +6 -4
  48. package/build/components/block-settings/container.native.js.map +1 -1
  49. package/build/components/block-settings-menu/block-settings-dropdown.js +33 -20
  50. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  51. package/build/components/block-settings-menu-controls/index.js +7 -0
  52. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  53. package/build/components/block-styles/index.js +1 -1
  54. package/build/components/block-styles/index.js.map +1 -1
  55. package/build/components/block-styles/index.native.js +3 -2
  56. package/build/components/block-styles/index.native.js.map +1 -1
  57. package/build/components/block-toolbar/block-toolbar-menu.native.js +1 -1
  58. package/build/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
  59. package/build/components/block-toolbar/index.js +89 -27
  60. package/build/components/block-toolbar/index.js.map +1 -1
  61. package/build/components/block-tools/block-toolbar-breadcrumb.js +49 -0
  62. package/build/components/block-tools/block-toolbar-breadcrumb.js.map +1 -0
  63. package/build/components/block-tools/block-toolbar-popover.js +86 -0
  64. package/build/components/block-tools/block-toolbar-popover.js.map +1 -0
  65. package/build/components/block-tools/index.js +27 -24
  66. package/build/components/block-tools/index.js.map +1 -1
  67. package/build/components/block-types-list/index.js +6 -2
  68. package/build/components/block-types-list/index.js.map +1 -1
  69. package/build/components/block-types-list/index.native.js +4 -3
  70. package/build/components/block-types-list/index.native.js.map +1 -1
  71. package/build/components/block-variation-picker/index.native.js +2 -1
  72. package/build/components/block-variation-picker/index.native.js.map +1 -1
  73. package/build/components/colors-gradients/control.js +28 -17
  74. package/build/components/colors-gradients/control.js.map +1 -1
  75. package/build/components/date-format-picker/index.js +8 -1
  76. package/build/components/date-format-picker/index.js.map +1 -1
  77. package/build/components/duotone-control/index.js +1 -4
  78. package/build/components/duotone-control/index.js.map +1 -1
  79. package/build/components/global-styles/advanced-panel.js +1 -1
  80. package/build/components/global-styles/advanced-panel.js.map +1 -1
  81. package/build/components/global-styles/color-panel.js +22 -20
  82. package/build/components/global-styles/color-panel.js.map +1 -1
  83. package/build/components/global-styles/filters-panel.js +9 -3
  84. package/build/components/global-styles/filters-panel.js.map +1 -1
  85. package/build/components/global-styles/typography-panel.js +20 -31
  86. package/build/components/global-styles/typography-panel.js.map +1 -1
  87. package/build/components/image-link-destinations/index.native.js +118 -0
  88. package/build/components/image-link-destinations/index.native.js.map +1 -0
  89. package/build/components/image-size-control/index.js +0 -5
  90. package/build/components/image-size-control/index.js.map +1 -1
  91. package/build/components/index.native.js +8 -0
  92. package/build/components/index.native.js.map +1 -1
  93. package/build/components/inner-blocks/index.js +3 -1
  94. package/build/components/inner-blocks/index.js.map +1 -1
  95. package/build/components/inner-blocks/warning-max-depth-exceeded.native.js +29 -31
  96. package/build/components/inner-blocks/warning-max-depth-exceeded.native.js.map +1 -1
  97. package/build/components/inserter/block-patterns-explorer/pattern-list.js +1 -1
  98. package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  99. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +1 -1
  100. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  101. package/build/components/inserter/block-patterns-tab/use-pattern-categories.js +1 -1
  102. package/build/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  103. package/build/components/inserter/block-patterns-tab/utils.js +3 -4
  104. package/build/components/inserter/block-patterns-tab/utils.js.map +1 -1
  105. package/build/components/inserter/hooks/use-patterns-state.js +2 -1
  106. package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
  107. package/build/components/inserter/media-tab/media-panel.js +2 -2
  108. package/build/components/inserter/media-tab/media-panel.js.map +1 -1
  109. package/build/components/inserter/menu.js +14 -7
  110. package/build/components/inserter/menu.js.map +1 -1
  111. package/build/components/inserter/preview-panel.js +2 -2
  112. package/build/components/inserter/preview-panel.js.map +1 -1
  113. package/build/components/inserter-button/index.native.js +98 -0
  114. package/build/components/inserter-button/index.native.js.map +1 -0
  115. package/build/components/inserter-button/sparkles.js +23 -0
  116. package/build/components/inserter-button/sparkles.js.map +1 -0
  117. package/build/components/inserter-draggable-blocks/index.js +8 -4
  118. package/build/components/inserter-draggable-blocks/index.js.map +1 -1
  119. package/build/components/inserter-listbox/index.js +11 -6
  120. package/build/components/inserter-listbox/index.js.map +1 -1
  121. package/build/components/inserter-listbox/item.js +24 -23
  122. package/build/components/inserter-listbox/item.js.map +1 -1
  123. package/build/components/inserter-listbox/row.js +5 -5
  124. package/build/components/inserter-listbox/row.js.map +1 -1
  125. package/build/components/inspector-controls/fill.js +3 -3
  126. package/build/components/inspector-controls/fill.js.map +1 -1
  127. package/build/components/inspector-controls/fill.native.js +3 -3
  128. package/build/components/inspector-controls/fill.native.js.map +1 -1
  129. package/build/components/list-view/use-list-view-expand-selected-item.js +2 -3
  130. package/build/components/list-view/use-list-view-expand-selected-item.js.map +1 -1
  131. package/build/components/navigable-toolbar/index.js +2 -2
  132. package/build/components/navigable-toolbar/index.js.map +1 -1
  133. package/build/components/preview-options/index.js +6 -60
  134. package/build/components/preview-options/index.js.map +1 -1
  135. package/build/components/rich-text/content.js +26 -23
  136. package/build/components/rich-text/content.js.map +1 -1
  137. package/build/components/rich-text/get-rich-text-values.js +2 -1
  138. package/build/components/rich-text/get-rich-text-values.js.map +1 -1
  139. package/build/components/rich-text/index.js +2 -30
  140. package/build/components/rich-text/index.js.map +1 -1
  141. package/build/components/rich-text/index.native.js +10 -17
  142. package/build/components/rich-text/index.native.js.map +1 -1
  143. package/build/components/rich-text/native/get-format-colors.native.js +22 -24
  144. package/build/components/rich-text/native/get-format-colors.native.js.map +1 -1
  145. package/build/components/rich-text/native/index.native.js +41 -37
  146. package/build/components/rich-text/native/index.native.js.map +1 -1
  147. package/build/components/rich-text/use-input-rules.js +35 -2
  148. package/build/components/rich-text/use-input-rules.js.map +1 -1
  149. package/build/components/rich-text/with-deprecations.js +50 -0
  150. package/build/components/rich-text/with-deprecations.js.map +1 -0
  151. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -1
  152. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  153. package/build/components/use-block-drop-zone/index.js +74 -9
  154. package/build/components/use-block-drop-zone/index.js.map +1 -1
  155. package/build/components/use-moving-animation/index.js +2 -1
  156. package/build/components/use-moving-animation/index.js.map +1 -1
  157. package/build/components/use-on-block-drop/index.js +1 -1
  158. package/build/components/use-on-block-drop/index.js.map +1 -1
  159. package/build/components/use-resize-canvas/index.js +4 -1
  160. package/build/components/use-resize-canvas/index.js.map +1 -1
  161. package/build/components/use-settings/index.js +16 -2
  162. package/build/components/use-settings/index.js.map +1 -1
  163. package/build/hooks/align.js +20 -68
  164. package/build/hooks/align.js.map +1 -1
  165. package/build/hooks/align.native.js +11 -1
  166. package/build/hooks/align.native.js.map +1 -1
  167. package/build/hooks/anchor.js +13 -29
  168. package/build/hooks/anchor.js.map +1 -1
  169. package/build/hooks/background.js +28 -31
  170. package/build/hooks/background.js.map +1 -1
  171. package/build/hooks/block-hooks.js +24 -32
  172. package/build/hooks/block-hooks.js.map +1 -1
  173. package/build/hooks/block-renaming.js +38 -0
  174. package/build/hooks/block-renaming.js.map +1 -1
  175. package/build/hooks/border.js +58 -80
  176. package/build/hooks/border.js.map +1 -1
  177. package/build/hooks/color.js +76 -89
  178. package/build/hooks/color.js.map +1 -1
  179. package/build/hooks/content-lock-ui.js +29 -29
  180. package/build/hooks/content-lock-ui.js.map +1 -1
  181. package/build/hooks/custom-class-name.js +12 -29
  182. package/build/hooks/custom-class-name.js.map +1 -1
  183. package/build/hooks/custom-fields.js +64 -73
  184. package/build/hooks/custom-fields.js.map +1 -1
  185. package/build/hooks/dimensions.js +21 -17
  186. package/build/hooks/dimensions.js.map +1 -1
  187. package/build/hooks/duotone.js +31 -61
  188. package/build/hooks/duotone.js.map +1 -1
  189. package/build/hooks/font-family.js +16 -25
  190. package/build/hooks/font-family.js.map +1 -1
  191. package/build/hooks/font-size.js +51 -119
  192. package/build/hooks/font-size.js.map +1 -1
  193. package/build/hooks/index.js +25 -15
  194. package/build/hooks/index.js.map +1 -1
  195. package/build/hooks/index.native.js +10 -3
  196. package/build/hooks/index.native.js.map +1 -1
  197. package/build/hooks/layout-child.js +68 -0
  198. package/build/hooks/layout-child.js.map +1 -0
  199. package/build/hooks/layout.js +29 -108
  200. package/build/hooks/layout.js.map +1 -1
  201. package/build/hooks/padding.js +2 -2
  202. package/build/hooks/padding.js.map +1 -1
  203. package/build/hooks/position.js +40 -62
  204. package/build/hooks/position.js.map +1 -1
  205. package/build/hooks/style.js +51 -88
  206. package/build/hooks/style.js.map +1 -1
  207. package/build/hooks/typography.js +34 -14
  208. package/build/hooks/typography.js.map +1 -1
  209. package/build/hooks/utils.js +154 -7
  210. package/build/hooks/utils.js.map +1 -1
  211. package/build/layouts/constrained.js +4 -3
  212. package/build/layouts/constrained.js.map +1 -1
  213. package/build/private-apis.js +0 -2
  214. package/build/private-apis.js.map +1 -1
  215. package/build/store/private-actions.js +8 -0
  216. package/build/store/private-actions.js.map +1 -1
  217. package/build/store/private-selectors.js +34 -0
  218. package/build/store/private-selectors.js.map +1 -1
  219. package/build/store/reducer.js +8 -0
  220. package/build/store/reducer.js.map +1 -1
  221. package/build/store/selectors.js +10 -58
  222. package/build/store/selectors.js.map +1 -1
  223. package/build/store/utils.js +66 -0
  224. package/build/store/utils.js.map +1 -0
  225. package/build/utils/object.js +21 -61
  226. package/build/utils/object.js.map +1 -1
  227. package/build/utils/selection.js +9 -1
  228. package/build/utils/selection.js.map +1 -1
  229. package/build/utils/transform-styles/index.js +26 -6
  230. package/build/utils/transform-styles/index.js.map +1 -1
  231. package/build-module/components/block-canvas/index.js +23 -7
  232. package/build-module/components/block-canvas/index.js.map +1 -1
  233. package/build-module/components/block-card/index.js +1 -1
  234. package/build-module/components/block-card/index.js.map +1 -1
  235. package/build-module/components/block-controls/hook.js +4 -24
  236. package/build-module/components/block-controls/hook.js.map +1 -1
  237. package/build-module/components/block-edit/context.js +2 -0
  238. package/build-module/components/block-edit/context.js.map +1 -1
  239. package/build-module/components/block-edit/index.js +19 -10
  240. package/build-module/components/block-edit/index.js.map +1 -1
  241. package/build-module/components/block-info-slot-fill/index.js +3 -3
  242. package/build-module/components/block-info-slot-fill/index.js.map +1 -1
  243. package/build-module/components/block-list/block.js +29 -10
  244. package/build-module/components/block-list/block.js.map +1 -1
  245. package/build-module/components/block-list/block.native.js +16 -5
  246. package/build-module/components/block-list/block.native.js.map +1 -1
  247. package/build-module/components/block-list/use-block-props/index.js +62 -19
  248. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  249. package/build-module/components/block-list/use-block-props/use-focus-first-element.js +4 -29
  250. package/build-module/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  251. package/build-module/components/block-list/use-block-props/use-is-hovered.js +4 -14
  252. package/build-module/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
  253. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js +4 -2
  254. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  255. package/build-module/components/block-parent-selector/index.js +1 -1
  256. package/build-module/components/block-parent-selector/index.js.map +1 -1
  257. package/build-module/components/block-pattern-setup/index.js +24 -15
  258. package/build-module/components/block-pattern-setup/index.js.map +1 -1
  259. package/build-module/components/block-pattern-setup/setup-toolbar.js +4 -2
  260. package/build-module/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  261. package/build-module/components/block-patterns-list/index.js +37 -20
  262. package/build-module/components/block-patterns-list/index.js.map +1 -1
  263. package/build-module/components/block-removal-warning-modal/index.js +3 -10
  264. package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
  265. package/build-module/components/block-rename/index.js +4 -0
  266. package/build-module/components/block-rename/index.js.map +1 -0
  267. package/build-module/components/block-rename/is-empty-string.js +4 -0
  268. package/build-module/components/block-rename/is-empty-string.js.map +1 -0
  269. package/build-module/components/block-rename/modal.js +82 -0
  270. package/build-module/components/block-rename/modal.js.map +1 -0
  271. package/build-module/components/block-rename/rename-control.js +66 -0
  272. package/build-module/components/block-rename/rename-control.js.map +1 -0
  273. package/build-module/components/block-rename/use-block-rename.js +10 -0
  274. package/build-module/components/block-rename/use-block-rename.js.map +1 -0
  275. package/build-module/components/block-settings/container.native.js +4 -2
  276. package/build-module/components/block-settings/container.native.js.map +1 -1
  277. package/build-module/components/block-settings-menu/block-settings-dropdown.js +34 -21
  278. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  279. package/build-module/components/block-settings-menu-controls/index.js +7 -0
  280. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  281. package/build-module/components/block-styles/index.js +1 -1
  282. package/build-module/components/block-styles/index.js.map +1 -1
  283. package/build-module/components/block-styles/index.native.js +3 -2
  284. package/build-module/components/block-styles/index.native.js.map +1 -1
  285. package/build-module/components/block-toolbar/block-toolbar-menu.native.js +1 -1
  286. package/build-module/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
  287. package/build-module/components/block-toolbar/index.js +88 -25
  288. package/build-module/components/block-toolbar/index.js.map +1 -1
  289. package/build-module/components/block-tools/block-toolbar-breadcrumb.js +41 -0
  290. package/build-module/components/block-tools/block-toolbar-breadcrumb.js.map +1 -0
  291. package/build-module/components/block-tools/block-toolbar-popover.js +76 -0
  292. package/build-module/components/block-tools/block-toolbar-popover.js.map +1 -0
  293. package/build-module/components/block-tools/index.js +27 -24
  294. package/build-module/components/block-tools/index.js.map +1 -1
  295. package/build-module/components/block-types-list/index.js +6 -2
  296. package/build-module/components/block-types-list/index.js.map +1 -1
  297. package/build-module/components/block-types-list/index.native.js +2 -1
  298. package/build-module/components/block-types-list/index.native.js.map +1 -1
  299. package/build-module/components/block-variation-picker/index.native.js +2 -1
  300. package/build-module/components/block-variation-picker/index.native.js.map +1 -1
  301. package/build-module/components/colors-gradients/control.js +29 -18
  302. package/build-module/components/colors-gradients/control.js.map +1 -1
  303. package/build-module/components/date-format-picker/index.js +8 -1
  304. package/build-module/components/date-format-picker/index.js.map +1 -1
  305. package/build-module/components/duotone-control/index.js +1 -4
  306. package/build-module/components/duotone-control/index.js.map +1 -1
  307. package/build-module/components/global-styles/advanced-panel.js +1 -1
  308. package/build-module/components/global-styles/advanced-panel.js.map +1 -1
  309. package/build-module/components/global-styles/color-panel.js +23 -21
  310. package/build-module/components/global-styles/color-panel.js.map +1 -1
  311. package/build-module/components/global-styles/filters-panel.js +10 -4
  312. package/build-module/components/global-styles/filters-panel.js.map +1 -1
  313. package/build-module/components/global-styles/typography-panel.js +20 -31
  314. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  315. package/build-module/components/image-link-destinations/index.native.js +109 -0
  316. package/build-module/components/image-link-destinations/index.native.js.map +1 -0
  317. package/build-module/components/image-size-control/index.js +0 -5
  318. package/build-module/components/image-size-control/index.js.map +1 -1
  319. package/build-module/components/index.native.js +1 -0
  320. package/build-module/components/index.native.js.map +1 -1
  321. package/build-module/components/inner-blocks/index.js +3 -1
  322. package/build-module/components/inner-blocks/index.js.map +1 -1
  323. package/build-module/components/inner-blocks/warning-max-depth-exceeded.native.js +30 -32
  324. package/build-module/components/inner-blocks/warning-max-depth-exceeded.native.js.map +1 -1
  325. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
  326. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  327. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +4 -4
  328. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  329. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js +2 -2
  330. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  331. package/build-module/components/inserter/block-patterns-tab/utils.js +3 -4
  332. package/build-module/components/inserter/block-patterns-tab/utils.js.map +1 -1
  333. package/build-module/components/inserter/hooks/use-patterns-state.js +2 -1
  334. package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
  335. package/build-module/components/inserter/media-tab/media-panel.js +1 -1
  336. package/build-module/components/inserter/media-tab/media-panel.js.map +1 -1
  337. package/build-module/components/inserter/menu.js +14 -7
  338. package/build-module/components/inserter/menu.js.map +1 -1
  339. package/build-module/components/inserter/preview-panel.js +2 -2
  340. package/build-module/components/inserter/preview-panel.js.map +1 -1
  341. package/build-module/components/inserter-button/index.native.js +89 -0
  342. package/build-module/components/inserter-button/index.native.js.map +1 -0
  343. package/build-module/components/inserter-button/sparkles.js +15 -0
  344. package/build-module/components/inserter-button/sparkles.js.map +1 -0
  345. package/build-module/components/inserter-draggable-blocks/index.js +9 -5
  346. package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
  347. package/build-module/components/inserter-listbox/index.js +13 -8
  348. package/build-module/components/inserter-listbox/index.js.map +1 -1
  349. package/build-module/components/inserter-listbox/item.js +25 -23
  350. package/build-module/components/inserter-listbox/item.js.map +1 -1
  351. package/build-module/components/inserter-listbox/row.js +6 -5
  352. package/build-module/components/inserter-listbox/row.js.map +1 -1
  353. package/build-module/components/inspector-controls/fill.js +3 -3
  354. package/build-module/components/inspector-controls/fill.js.map +1 -1
  355. package/build-module/components/inspector-controls/fill.native.js +3 -3
  356. package/build-module/components/inspector-controls/fill.native.js.map +1 -1
  357. package/build-module/components/list-view/use-list-view-expand-selected-item.js +2 -3
  358. package/build-module/components/list-view/use-list-view-expand-selected-item.js.map +1 -1
  359. package/build-module/components/navigable-toolbar/index.js +2 -2
  360. package/build-module/components/navigable-toolbar/index.js.map +1 -1
  361. package/build-module/components/preview-options/index.js +6 -60
  362. package/build-module/components/preview-options/index.js.map +1 -1
  363. package/build-module/components/rich-text/content.js +25 -21
  364. package/build-module/components/rich-text/content.js.map +1 -1
  365. package/build-module/components/rich-text/get-rich-text-values.js +2 -1
  366. package/build-module/components/rich-text/get-rich-text-values.js.map +1 -1
  367. package/build-module/components/rich-text/index.js +4 -32
  368. package/build-module/components/rich-text/index.js.map +1 -1
  369. package/build-module/components/rich-text/index.native.js +11 -19
  370. package/build-module/components/rich-text/index.native.js.map +1 -1
  371. package/build-module/components/rich-text/native/get-format-colors.native.js +22 -24
  372. package/build-module/components/rich-text/native/get-format-colors.native.js.map +1 -1
  373. package/build-module/components/rich-text/native/index.native.js +41 -37
  374. package/build-module/components/rich-text/native/index.native.js.map +1 -1
  375. package/build-module/components/rich-text/use-input-rules.js +36 -3
  376. package/build-module/components/rich-text/use-input-rules.js.map +1 -1
  377. package/build-module/components/rich-text/with-deprecations.js +42 -0
  378. package/build-module/components/rich-text/with-deprecations.js.map +1 -0
  379. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -1
  380. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  381. package/build-module/components/use-block-drop-zone/index.js +73 -9
  382. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  383. package/build-module/components/use-moving-animation/index.js +2 -1
  384. package/build-module/components/use-moving-animation/index.js.map +1 -1
  385. package/build-module/components/use-on-block-drop/index.js +1 -1
  386. package/build-module/components/use-on-block-drop/index.js.map +1 -1
  387. package/build-module/components/use-resize-canvas/index.js +4 -1
  388. package/build-module/components/use-resize-canvas/index.js.map +1 -1
  389. package/build-module/components/use-settings/index.js +15 -3
  390. package/build-module/components/use-settings/index.js.map +1 -1
  391. package/build-module/hooks/align.js +19 -66
  392. package/build-module/hooks/align.js.map +1 -1
  393. package/build-module/hooks/align.native.js +1 -0
  394. package/build-module/hooks/align.native.js.map +1 -1
  395. package/build-module/hooks/anchor.js +11 -26
  396. package/build-module/hooks/anchor.js.map +1 -1
  397. package/build-module/hooks/background.js +26 -28
  398. package/build-module/hooks/background.js.map +1 -1
  399. package/build-module/hooks/block-hooks.js +22 -30
  400. package/build-module/hooks/block-hooks.js.map +1 -1
  401. package/build-module/hooks/block-renaming.js +36 -0
  402. package/build-module/hooks/block-renaming.js.map +1 -1
  403. package/build-module/hooks/border.js +57 -78
  404. package/build-module/hooks/border.js.map +1 -1
  405. package/build-module/hooks/color.js +74 -86
  406. package/build-module/hooks/color.js.map +1 -1
  407. package/build-module/hooks/content-lock-ui.js +27 -27
  408. package/build-module/hooks/content-lock-ui.js.map +1 -1
  409. package/build-module/hooks/custom-class-name.js +11 -27
  410. package/build-module/hooks/custom-class-name.js.map +1 -1
  411. package/build-module/hooks/custom-fields.js +60 -74
  412. package/build-module/hooks/custom-fields.js.map +1 -1
  413. package/build-module/hooks/dimensions.js +21 -16
  414. package/build-module/hooks/dimensions.js.map +1 -1
  415. package/build-module/hooks/duotone.js +30 -61
  416. package/build-module/hooks/duotone.js.map +1 -1
  417. package/build-module/hooks/font-family.js +14 -23
  418. package/build-module/hooks/font-family.js.map +1 -1
  419. package/build-module/hooks/font-size.js +49 -119
  420. package/build-module/hooks/font-size.js.map +1 -1
  421. package/build-module/hooks/index.js +18 -15
  422. package/build-module/hooks/index.js.map +1 -1
  423. package/build-module/hooks/index.native.js +5 -3
  424. package/build-module/hooks/index.native.js.map +1 -1
  425. package/build-module/hooks/layout-child.js +60 -0
  426. package/build-module/hooks/layout-child.js.map +1 -0
  427. package/build-module/hooks/layout.js +26 -105
  428. package/build-module/hooks/layout.js.map +1 -1
  429. package/build-module/hooks/padding.js +2 -2
  430. package/build-module/hooks/padding.js.map +1 -1
  431. package/build-module/hooks/position.js +38 -59
  432. package/build-module/hooks/position.js.map +1 -1
  433. package/build-module/hooks/style.js +51 -84
  434. package/build-module/hooks/style.js.map +1 -1
  435. package/build-module/hooks/typography.js +33 -12
  436. package/build-module/hooks/typography.js.map +1 -1
  437. package/build-module/hooks/utils.js +149 -6
  438. package/build-module/hooks/utils.js.map +1 -1
  439. package/build-module/layouts/constrained.js +4 -3
  440. package/build-module/layouts/constrained.js.map +1 -1
  441. package/build-module/private-apis.js +0 -2
  442. package/build-module/private-apis.js.map +1 -1
  443. package/build-module/store/private-actions.js +7 -0
  444. package/build-module/store/private-actions.js.map +1 -1
  445. package/build-module/store/private-selectors.js +33 -1
  446. package/build-module/store/private-selectors.js.map +1 -1
  447. package/build-module/store/reducer.js +8 -0
  448. package/build-module/store/reducer.js.map +1 -1
  449. package/build-module/store/selectors.js +3 -51
  450. package/build-module/store/selectors.js.map +1 -1
  451. package/build-module/store/utils.js +56 -0
  452. package/build-module/store/utils.js.map +1 -0
  453. package/build-module/utils/object.js +21 -60
  454. package/build-module/utils/object.js.map +1 -1
  455. package/build-module/utils/selection.js +9 -1
  456. package/build-module/utils/selection.js.map +1 -1
  457. package/build-module/utils/transform-styles/index.js +24 -7
  458. package/build-module/utils/transform-styles/index.js.map +1 -1
  459. package/build-style/content-rtl.css +6 -6
  460. package/build-style/content.css +6 -6
  461. package/build-style/style-rtl.css +123 -298
  462. package/build-style/style.css +123 -298
  463. package/package.json +31 -31
  464. package/src/components/block-canvas/index.js +31 -17
  465. package/src/components/block-caption/README.md +2 -2
  466. package/src/components/block-card/index.js +5 -3
  467. package/src/components/block-card/style.scss +7 -3
  468. package/src/components/block-controls/hook.js +8 -30
  469. package/src/components/block-controls/test/index.js +3 -3
  470. package/src/components/block-edit/context.js +3 -0
  471. package/src/components/block-edit/index.js +36 -10
  472. package/src/components/block-info-slot-fill/index.js +6 -3
  473. package/src/components/block-inspector/style.scss +0 -4
  474. package/src/components/block-list/block.js +39 -5
  475. package/src/components/block-list/block.native.js +20 -4
  476. package/src/components/block-list/use-block-props/index.js +74 -21
  477. package/src/components/block-list/use-block-props/use-focus-first-element.js +1 -34
  478. package/src/components/block-list/use-block-props/use-is-hovered.js +2 -13
  479. package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +1 -5
  480. package/src/components/block-parent-selector/index.js +1 -1
  481. package/src/components/block-pattern-setup/index.js +38 -22
  482. package/src/components/block-pattern-setup/setup-toolbar.js +2 -0
  483. package/src/components/block-pattern-setup/style.scss +4 -1
  484. package/src/components/block-patterns-list/README.md +4 -4
  485. package/src/components/block-patterns-list/index.js +61 -35
  486. package/src/components/block-patterns-list/style.scss +7 -0
  487. package/src/components/block-removal-warning-modal/index.js +7 -14
  488. package/src/components/block-rename/index.js +3 -0
  489. package/src/components/block-rename/is-empty-string.js +3 -0
  490. package/src/components/block-rename/modal.js +121 -0
  491. package/src/components/block-rename/rename-control.js +80 -0
  492. package/src/components/block-rename/use-block-rename.js +10 -0
  493. package/src/components/block-settings/container.native.js +3 -5
  494. package/src/components/block-settings-menu/block-settings-dropdown.js +38 -34
  495. package/src/components/block-settings-menu-controls/index.js +9 -0
  496. package/src/components/block-styles/index.js +1 -1
  497. package/src/components/block-styles/index.native.js +4 -2
  498. package/src/components/block-styles/style.scss +0 -11
  499. package/src/components/block-switcher/test/__snapshots__/index.js.snap +3 -1
  500. package/src/components/block-toolbar/block-toolbar-menu.native.js +1 -4
  501. package/src/components/block-toolbar/index.js +180 -95
  502. package/src/components/block-toolbar/style.scss +50 -66
  503. package/src/components/block-tools/block-toolbar-breadcrumb.js +46 -0
  504. package/src/components/block-tools/block-toolbar-popover.js +90 -0
  505. package/src/components/block-tools/index.js +42 -29
  506. package/src/components/block-tools/style.scss +60 -172
  507. package/src/components/block-types-list/index.js +5 -4
  508. package/src/components/block-types-list/index.native.js +2 -1
  509. package/src/components/block-variation-picker/index.native.js +1 -1
  510. package/src/components/button-block-appender/content.scss +2 -2
  511. package/src/components/colors-gradients/control.js +49 -30
  512. package/src/components/colors-gradients/style.scss +0 -7
  513. package/src/components/date-format-picker/index.js +7 -0
  514. package/src/components/duotone-control/index.js +2 -5
  515. package/src/components/duotone-control/style.scss +1 -6
  516. package/src/components/editable-text/README.md +0 -36
  517. package/src/components/global-styles/advanced-panel.js +1 -1
  518. package/src/components/global-styles/color-panel.js +34 -25
  519. package/src/components/global-styles/filters-panel.js +8 -4
  520. package/src/components/global-styles/typography-panel.js +23 -43
  521. package/src/components/image-link-destinations/index.native.js +152 -0
  522. package/src/components/image-link-destinations/style.native.scss +16 -0
  523. package/src/components/image-size-control/index.js +0 -6
  524. package/src/components/index.native.js +1 -0
  525. package/src/components/inner-blocks/README.md +13 -2
  526. package/src/components/inner-blocks/index.js +6 -2
  527. package/src/components/inner-blocks/warning-max-depth-exceeded.native.js +57 -33
  528. package/src/components/inserter/block-patterns-explorer/pattern-list.js +5 -1
  529. package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +7 -3
  530. package/src/components/inserter/block-patterns-tab/use-pattern-categories.js +6 -1
  531. package/src/components/inserter/block-patterns-tab/utils.js +6 -4
  532. package/src/components/inserter/hooks/use-patterns-state.js +3 -1
  533. package/src/components/inserter/media-tab/media-panel.js +1 -1
  534. package/src/components/inserter/menu.js +16 -8
  535. package/src/components/inserter/preview-panel.js +2 -2
  536. package/src/components/inserter/style.scss +15 -17
  537. package/src/components/inserter-button/README.md +62 -0
  538. package/src/components/inserter-button/index.native.js +116 -0
  539. package/src/components/inserter-button/sparkles.js +15 -0
  540. package/src/components/inserter-button/style.native.scss +72 -0
  541. package/src/components/inserter-draggable-blocks/index.js +18 -5
  542. package/src/components/inserter-listbox/index.js +11 -7
  543. package/src/components/inserter-listbox/item.js +11 -12
  544. package/src/components/inserter-listbox/row.js +6 -12
  545. package/src/components/inspector-controls/fill.js +6 -3
  546. package/src/components/inspector-controls/fill.native.js +6 -3
  547. package/src/components/link-control/style.scss +1 -1
  548. package/src/components/link-control/test/index.js +1 -1
  549. package/src/components/list-view/use-list-view-expand-selected-item.js +7 -8
  550. package/src/components/navigable-toolbar/README.md +2 -0
  551. package/src/components/navigable-toolbar/index.js +2 -2
  552. package/src/components/plain-text/README.md +0 -28
  553. package/src/components/preview-options/index.js +6 -84
  554. package/src/components/rich-text/README.md +0 -58
  555. package/src/components/rich-text/content.js +27 -20
  556. package/src/components/rich-text/get-rich-text-values.js +6 -1
  557. package/src/components/rich-text/index.js +5 -46
  558. package/src/components/rich-text/index.native.js +9 -26
  559. package/src/components/rich-text/native/get-format-colors.native.js +33 -40
  560. package/src/components/rich-text/native/index.native.js +52 -50
  561. package/src/components/rich-text/use-input-rules.js +36 -3
  562. package/src/components/rich-text/with-deprecations.js +51 -0
  563. package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -1
  564. package/src/components/url-input/README.md +1 -74
  565. package/src/components/use-block-drop-zone/index.js +118 -15
  566. package/src/components/use-moving-animation/index.js +1 -1
  567. package/src/components/use-on-block-drop/index.js +2 -1
  568. package/src/components/use-resize-canvas/README.md +3 -3
  569. package/src/components/use-resize-canvas/index.js +4 -1
  570. package/src/components/use-settings/index.js +17 -3
  571. package/src/components/use-settings/test/index.js +1 -1
  572. package/src/hooks/align.js +15 -76
  573. package/src/hooks/align.native.js +1 -0
  574. package/src/hooks/anchor.js +13 -33
  575. package/src/hooks/background.js +28 -23
  576. package/src/hooks/block-hooks.js +22 -51
  577. package/src/hooks/block-renaming.js +33 -0
  578. package/src/hooks/border.js +67 -118
  579. package/src/hooks/color.js +100 -132
  580. package/src/hooks/content-lock-ui.js +110 -122
  581. package/src/hooks/custom-class-name.js +8 -40
  582. package/src/hooks/custom-fields.js +70 -94
  583. package/src/hooks/dimensions.js +20 -16
  584. package/src/hooks/duotone.js +70 -127
  585. package/src/hooks/font-family.js +10 -29
  586. package/src/hooks/font-size.js +66 -162
  587. package/src/hooks/index.js +42 -15
  588. package/src/hooks/index.native.js +6 -3
  589. package/src/hooks/layout-child.js +53 -0
  590. package/src/hooks/layout.js +25 -110
  591. package/src/hooks/padding.js +2 -2
  592. package/src/hooks/position.js +50 -90
  593. package/src/hooks/style.js +117 -187
  594. package/src/hooks/test/__snapshots__/align.native.js.snap +5 -5
  595. package/src/hooks/test/align.js +1 -178
  596. package/src/hooks/typography.js +20 -16
  597. package/src/hooks/utils.js +187 -6
  598. package/src/layouts/constrained.js +57 -50
  599. package/src/private-apis.js +0 -2
  600. package/src/store/private-actions.js +8 -0
  601. package/src/store/private-selectors.js +45 -0
  602. package/src/store/reducer.js +8 -0
  603. package/src/store/selectors.js +5 -67
  604. package/src/store/utils.js +74 -0
  605. package/src/style.scss +1 -3
  606. package/src/utils/object.js +18 -69
  607. package/src/utils/selection.js +9 -2
  608. package/src/utils/test/transform-styles.js +49 -0
  609. package/src/utils/transform-styles/index.js +39 -13
  610. package/build/components/block-list/use-block-props/use-block-class-names.js +0 -67
  611. package/build/components/block-list/use-block-props/use-block-class-names.js.map +0 -1
  612. package/build/components/block-list/use-block-props/use-block-custom-class-name.js +0 -46
  613. package/build/components/block-list/use-block-props/use-block-custom-class-name.js.map +0 -1
  614. package/build/components/block-list/use-block-props/use-block-default-class-name.js +0 -37
  615. package/build/components/block-list/use-block-props/use-block-default-class-name.js.map +0 -1
  616. package/build/components/block-tools/back-compat.js +0 -45
  617. package/build/components/block-tools/back-compat.js.map +0 -1
  618. package/build/components/block-tools/block-contextual-toolbar.js +0 -91
  619. package/build/components/block-tools/block-contextual-toolbar.js.map +0 -1
  620. package/build/components/block-tools/selected-block-tools.js +0 -113
  621. package/build/components/block-tools/selected-block-tools.js.map +0 -1
  622. package/build/components/inserter/hooks/use-debounced-input.js +0 -22
  623. package/build/components/inserter/hooks/use-debounced-input.js.map +0 -1
  624. package/build/components/use-display-block-controls/index.js +0 -39
  625. package/build/components/use-display-block-controls/index.js.map +0 -1
  626. package/build/components/use-display-block-controls/index.native.js +0 -39
  627. package/build/components/use-display-block-controls/index.native.js.map +0 -1
  628. package/build/hooks/block-rename-ui.js +0 -167
  629. package/build/hooks/block-rename-ui.js.map +0 -1
  630. package/build-module/components/block-list/use-block-props/use-block-class-names.js +0 -60
  631. package/build-module/components/block-list/use-block-props/use-block-class-names.js.map +0 -1
  632. package/build-module/components/block-list/use-block-props/use-block-custom-class-name.js +0 -40
  633. package/build-module/components/block-list/use-block-props/use-block-custom-class-name.js.map +0 -1
  634. package/build-module/components/block-list/use-block-props/use-block-default-class-name.js +0 -31
  635. package/build-module/components/block-list/use-block-props/use-block-default-class-name.js.map +0 -1
  636. package/build-module/components/block-tools/back-compat.js +0 -35
  637. package/build-module/components/block-tools/back-compat.js.map +0 -1
  638. package/build-module/components/block-tools/block-contextual-toolbar.js +0 -83
  639. package/build-module/components/block-tools/block-contextual-toolbar.js.map +0 -1
  640. package/build-module/components/block-tools/selected-block-tools.js +0 -105
  641. package/build-module/components/block-tools/selected-block-tools.js.map +0 -1
  642. package/build-module/components/inserter/hooks/use-debounced-input.js +0 -15
  643. package/build-module/components/inserter/hooks/use-debounced-input.js.map +0 -1
  644. package/build-module/components/use-display-block-controls/index.js +0 -32
  645. package/build-module/components/use-display-block-controls/index.js.map +0 -1
  646. package/build-module/components/use-display-block-controls/index.native.js +0 -32
  647. package/build-module/components/use-display-block-controls/index.native.js.map +0 -1
  648. package/build-module/hooks/block-rename-ui.js +0 -159
  649. package/build-module/hooks/block-rename-ui.js.map +0 -1
  650. package/src/components/block-list/use-block-props/use-block-class-names.js +0 -66
  651. package/src/components/block-list/use-block-props/use-block-custom-class-name.js +0 -44
  652. package/src/components/block-list/use-block-props/use-block-default-class-name.js +0 -35
  653. package/src/components/block-parent-selector/style.scss +0 -11
  654. package/src/components/block-tools/back-compat.js +0 -35
  655. package/src/components/block-tools/block-contextual-toolbar.js +0 -100
  656. package/src/components/block-tools/selected-block-tools.js +0 -127
  657. package/src/components/inserter/hooks/use-debounced-input.js +0 -18
  658. package/src/components/preview-options/README.md +0 -94
  659. package/src/components/preview-options/style.scss +0 -64
  660. package/src/components/use-display-block-controls/index.js +0 -36
  661. package/src/components/use-display-block-controls/index.native.js +0 -37
  662. package/src/hooks/block-rename-ui.js +0 -228
  663. package/src/hooks/test/color.js +0 -112
  664. /package/src/{hooks/block-rename-ui.scss → components/block-rename/style.scss} +0 -0
@@ -1,16 +1,13 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
- exports.addEditProps = addEditProps;
8
6
  exports.addSaveProps = addSaveProps;
7
+ exports.default = void 0;
9
8
  exports.getInlineStyles = getInlineStyles;
10
9
  exports.omitStyle = omitStyle;
11
- exports.withBlockStyleControls = void 0;
12
10
  var _react = require("react");
13
- var _classnames = _interopRequireDefault(require("classnames"));
14
11
  var _element = require("@wordpress/element");
15
12
  var _hooks = require("@wordpress/hooks");
16
13
  var _blocks = require("@wordpress/blocks");
@@ -21,14 +18,9 @@ var _border = require("./border");
21
18
  var _color = require("./color");
22
19
  var _typography = require("./typography");
23
20
  var _dimensions = require("./dimensions");
24
- var _useDisplayBlockControls = _interopRequireDefault(require("../components/use-display-block-controls"));
25
21
  var _utils = require("./utils");
26
22
  var _utils2 = require("../components/global-styles/utils");
27
23
  var _blockEditingMode = require("../components/block-editing-mode");
28
- /**
29
- * External dependencies
30
- */
31
-
32
24
  /**
33
25
  * WordPress dependencies
34
26
  */
@@ -249,22 +241,22 @@ function omitStyle(style, paths, preserveReference = false) {
249
241
  /**
250
242
  * Override props assigned to save component to inject the CSS variables definition.
251
243
  *
252
- * @param {Object} props Additional props applied to save element.
253
- * @param {Object} blockType Block type.
254
- * @param {Object} attributes Block attributes.
255
- * @param {?Record<string, string[]>} skipPaths An object of keys and paths to skip serialization.
244
+ * @param {Object} props Additional props applied to save element.
245
+ * @param {Object|string} blockNameOrType Block type.
246
+ * @param {Object} attributes Block attributes.
247
+ * @param {?Record<string, string[]>} skipPaths An object of keys and paths to skip serialization.
256
248
  *
257
249
  * @return {Object} Filtered props applied to save element.
258
250
  */
259
- function addSaveProps(props, blockType, attributes, skipPaths = skipSerializationPathsSave) {
260
- if (!hasStyleSupport(blockType)) {
251
+ function addSaveProps(props, blockNameOrType, attributes, skipPaths = skipSerializationPathsSave) {
252
+ if (!hasStyleSupport(blockNameOrType)) {
261
253
  return props;
262
254
  }
263
255
  let {
264
256
  style
265
257
  } = attributes;
266
258
  Object.entries(skipPaths).forEach(([indicator, path]) => {
267
- const skipSerialization = skipSerializationPathsSaveChecks[indicator] || (0, _blocks.getBlockSupport)(blockType, indicator);
259
+ const skipSerialization = skipSerializationPathsSaveChecks[indicator] || (0, _blocks.getBlockSupport)(blockNameOrType, indicator);
268
260
  if (skipSerialization === true) {
269
261
  style = omitStyle(style, path);
270
262
  }
@@ -281,67 +273,44 @@ function addSaveProps(props, blockType, attributes, skipPaths = skipSerializatio
281
273
  };
282
274
  return props;
283
275
  }
284
-
285
- /**
286
- * Filters registered block settings to extend the block edit wrapper
287
- * to apply the desired styles and classnames properly.
288
- *
289
- * @param {Object} settings Original block settings.
290
- *
291
- * @return {Object}.Filtered block settings.
292
- */
293
- function addEditProps(settings) {
294
- if (!hasStyleSupport(settings)) {
295
- return settings;
296
- }
297
- const existingGetEditWrapperProps = settings.getEditWrapperProps;
298
- settings.getEditWrapperProps = attributes => {
299
- let props = {};
300
- if (existingGetEditWrapperProps) {
301
- props = existingGetEditWrapperProps(attributes);
302
- }
303
- return addSaveProps(props, settings, attributes, skipSerializationPathsEdit);
276
+ function BlockStyleControls({
277
+ clientId,
278
+ name,
279
+ setAttributes,
280
+ __unstableParentLayout
281
+ }) {
282
+ const settings = (0, _utils.useBlockSettings)(name, __unstableParentLayout);
283
+ const blockEditingMode = (0, _blockEditingMode.useBlockEditingMode)();
284
+ const passedProps = {
285
+ clientId,
286
+ name,
287
+ setAttributes,
288
+ settings
304
289
  };
305
- return settings;
306
- }
307
-
308
- /**
309
- * Override the default edit UI to include new inspector controls for
310
- * all the custom styles configs.
311
- *
312
- * @param {Function} BlockEdit Original component.
313
- *
314
- * @return {Function} Wrapped component.
315
- */
316
- const withBlockStyleControls = (0, _compose.createHigherOrderComponent)(BlockEdit => props => {
317
- if (!hasStyleSupport(props.name)) {
318
- return (0, _react.createElement)(BlockEdit, {
319
- key: "edit",
320
- ...props
321
- });
290
+ if (blockEditingMode !== 'default') {
291
+ return null;
322
292
  }
323
- const shouldDisplayControls = (0, _useDisplayBlockControls.default)();
324
- const blockEditingMode = (0, _blockEditingMode.useBlockEditingMode)();
325
- return (0, _react.createElement)(_react.Fragment, null, shouldDisplayControls && blockEditingMode === 'default' && (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_color.ColorEdit, {
326
- ...props
293
+ return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_color.ColorEdit, {
294
+ ...passedProps
327
295
  }), (0, _react.createElement)(_background.BackgroundImagePanel, {
328
- ...props
296
+ ...passedProps
329
297
  }), (0, _react.createElement)(_typography.TypographyPanel, {
330
- ...props
298
+ ...passedProps
331
299
  }), (0, _react.createElement)(_border.BorderPanel, {
332
- ...props
300
+ ...passedProps
333
301
  }), (0, _react.createElement)(_dimensions.DimensionsPanel, {
334
- ...props
335
- })), (0, _react.createElement)(BlockEdit, {
336
- key: "edit",
337
- ...props
302
+ ...passedProps
338
303
  }));
339
- }, 'withBlockStyleControls');
340
-
341
- // Defines which element types are supported, including their hover styles or
304
+ }
305
+ var _default = {
306
+ edit: BlockStyleControls,
307
+ hasSupport: hasStyleSupport,
308
+ attributeKeys: ['style'],
309
+ useBlockProps
310
+ }; // Defines which element types are supported, including their hover styles or
342
311
  // any other elements that have been included under a single element type
343
312
  // e.g. heading and h1-h6.
344
- exports.withBlockStyleControls = withBlockStyleControls;
313
+ exports.default = _default;
345
314
  const elementTypes = [{
346
315
  elementType: 'button'
347
316
  }, {
@@ -351,21 +320,17 @@ const elementTypes = [{
351
320
  elementType: 'heading',
352
321
  elements: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']
353
322
  }];
354
-
355
- /**
356
- * Override the default block element to include elements styles.
357
- *
358
- * @param {Function} BlockListBlock Original component
359
- * @return {Function} Wrapped component
360
- */
361
- const withElementsStyles = (0, _compose.createHigherOrderComponent)(BlockListBlock => props => {
362
- const blockElementsContainerIdentifier = `wp-elements-${(0, _compose.useInstanceId)(BlockListBlock)}`;
323
+ function useBlockProps({
324
+ name,
325
+ style
326
+ }) {
327
+ const blockElementsContainerIdentifier = `wp-elements-${(0, _compose.useInstanceId)(useBlockProps)}`;
363
328
 
364
329
  // The .editor-styles-wrapper selector is required on elements styles. As it is
365
330
  // added to all other editor styles, not providing it causes reset and global
366
331
  // styles to override element styles because of higher specificity.
367
332
  const baseElementSelector = `.editor-styles-wrapper .${blockElementsContainerIdentifier}`;
368
- const blockElementStyles = props.attributes.style?.elements;
333
+ const blockElementStyles = style?.elements;
369
334
  const styles = (0, _element.useMemo)(() => {
370
335
  if (!blockElementStyles) {
371
336
  return;
@@ -376,7 +341,7 @@ const withElementsStyles = (0, _compose.createHigherOrderComponent)(BlockListBlo
376
341
  pseudo,
377
342
  elements
378
343
  }) => {
379
- const skipSerialization = (0, _utils.shouldSkipSerialization)(props.name, _color.COLOR_SUPPORT_KEY, elementType);
344
+ const skipSerialization = (0, _utils.shouldSkipSerialization)(name, _color.COLOR_SUPPORT_KEY, elementType);
380
345
  if (skipSerialization) {
381
346
  return;
382
347
  }
@@ -413,18 +378,16 @@ const withElementsStyles = (0, _compose.createHigherOrderComponent)(BlockListBlo
413
378
  }
414
379
  });
415
380
  return elementCSSRules.length > 0 ? elementCSSRules.join('') : undefined;
416
- }, [baseElementSelector, blockElementStyles, props.name]);
381
+ }, [baseElementSelector, blockElementStyles, name]);
417
382
  (0, _utils.useStyleOverride)({
418
383
  css: styles
419
384
  });
420
- return (0, _react.createElement)(BlockListBlock, {
421
- ...props,
422
- className: props.attributes.style?.elements ? (0, _classnames.default)(props.className, blockElementsContainerIdentifier) : props.className
423
- });
424
- }, 'withElementsStyles');
385
+ return addSaveProps({
386
+ className: blockElementsContainerIdentifier
387
+ }, name, {
388
+ style
389
+ }, skipSerializationPathsEdit);
390
+ }
425
391
  (0, _hooks.addFilter)('blocks.registerBlockType', 'core/style/addAttribute', addAttribute);
426
392
  (0, _hooks.addFilter)('blocks.getSaveContent.extraProps', 'core/style/addSaveProps', addSaveProps);
427
- (0, _hooks.addFilter)('blocks.registerBlockType', 'core/style/addEditProps', addEditProps);
428
- (0, _hooks.addFilter)('editor.BlockEdit', 'core/style/with-block-controls', withBlockStyleControls);
429
- (0, _hooks.addFilter)('editor.BlockListBlock', 'core/editor/with-elements-styles', withElementsStyles);
430
393
  //# sourceMappingURL=style.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_element","_hooks","_blocks","_compose","_styleEngine","_background","_border","_color","_typography","_dimensions","_useDisplayBlockControls","_utils","_utils2","_blockEditingMode","styleSupportKeys","TYPOGRAPHY_SUPPORT_KEYS","BORDER_SUPPORT_KEY","COLOR_SUPPORT_KEY","DIMENSIONS_SUPPORT_KEY","BACKGROUND_SUPPORT_KEY","SPACING_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","blockType","skipPaths","entries","indicator","skipSerialization","getBlockSupport","featureName","feature","addEditProps","existingGetEditWrapperProps","getEditWrapperProps","withBlockStyleControls","createHigherOrderComponent","BlockEdit","name","_react","createElement","shouldDisplayControls","useDisplayBlockControls","blockEditingMode","useBlockEditingMode","Fragment","ColorEdit","BackgroundImagePanel","TypographyPanel","BorderPanel","DimensionsPanel","exports","elementTypes","elementType","pseudo","elements","withElementsStyles","BlockListBlock","blockElementsContainerIdentifier","useInstanceId","baseElementSelector","blockElementStyles","useMemo","elementCSSRules","shouldSkipSerialization","elementStyles","selector","scopeSelector","ELEMENTS","push","compileCSS","pseudoSelector","element","join","undefined","useStyleOverride","css","className","classnames","addFilter"],"sources":["@wordpress/block-editor/src/hooks/style.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\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 { createHigherOrderComponent, 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 } 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 useDisplayBlockControls from '../components/use-display-block-controls';\nimport { shouldSkipSerialization, useStyleOverride } 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];\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};\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[ `${ BACKGROUND_SUPPORT_KEY }` ]: [ BACKGROUND_SUPPORT_KEY ], // Skip serialization of background support in save mode.\n};\n\nconst skipSerializationPathsSaveChecks = {\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} blockType 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\tblockType,\n\tattributes,\n\tskipPaths = skipSerializationPathsSave\n) {\n\tif ( ! hasStyleSupport( blockType ) ) {\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( blockType, 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\n/**\n * Filters registered block settings to extend the block edit wrapper\n * to apply the desired styles and classnames properly.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object}.Filtered block settings.\n */\nexport function addEditProps( settings ) {\n\tif ( ! hasStyleSupport( settings ) ) {\n\t\treturn settings;\n\t}\n\n\tconst existingGetEditWrapperProps = settings.getEditWrapperProps;\n\tsettings.getEditWrapperProps = ( attributes ) => {\n\t\tlet props = {};\n\t\tif ( existingGetEditWrapperProps ) {\n\t\t\tprops = existingGetEditWrapperProps( attributes );\n\t\t}\n\n\t\treturn addSaveProps(\n\t\t\tprops,\n\t\t\tsettings,\n\t\t\tattributes,\n\t\t\tskipSerializationPathsEdit\n\t\t);\n\t};\n\n\treturn settings;\n}\n\n/**\n * Override the default edit UI to include new inspector controls for\n * all the custom styles configs.\n *\n * @param {Function} BlockEdit Original component.\n *\n * @return {Function} Wrapped component.\n */\nexport const withBlockStyleControls = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tif ( ! hasStyleSupport( props.name ) ) {\n\t\t\treturn <BlockEdit key=\"edit\" { ...props } />;\n\t\t}\n\n\t\tconst shouldDisplayControls = useDisplayBlockControls();\n\t\tconst blockEditingMode = useBlockEditingMode();\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ shouldDisplayControls && blockEditingMode === 'default' && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<ColorEdit { ...props } />\n\t\t\t\t\t\t<BackgroundImagePanel { ...props } />\n\t\t\t\t\t\t<TypographyPanel { ...props } />\n\t\t\t\t\t\t<BorderPanel { ...props } />\n\t\t\t\t\t\t<DimensionsPanel { ...props } />\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t<BlockEdit key=\"edit\" { ...props } />\n\t\t\t</>\n\t\t);\n\t},\n\t'withBlockStyleControls'\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/**\n * Override the default block element to include elements styles.\n *\n * @param {Function} BlockListBlock Original component\n * @return {Function} Wrapped component\n */\nconst withElementsStyles = createHigherOrderComponent(\n\t( BlockListBlock ) => ( props ) => {\n\t\tconst blockElementsContainerIdentifier = `wp-elements-${ useInstanceId(\n\t\t\tBlockListBlock\n\t\t) }`;\n\n\t\t// The .editor-styles-wrapper selector is required on elements styles. As it is\n\t\t// added to all other editor styles, not providing it causes reset and global\n\t\t// styles to override element styles because of higher specificity.\n\t\tconst baseElementSelector = `.editor-styles-wrapper .${ blockElementsContainerIdentifier }`;\n\t\tconst blockElementStyles = props.attributes.style?.elements;\n\n\t\tconst styles = useMemo( () => {\n\t\t\tif ( ! blockElementStyles ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst elementCSSRules = [];\n\n\t\t\telementTypes.forEach( ( { elementType, pseudo, elements } ) => {\n\t\t\t\tconst skipSerialization = shouldSkipSerialization(\n\t\t\t\t\tprops.name,\n\t\t\t\t\tCOLOR_SUPPORT_KEY,\n\t\t\t\t\telementType\n\t\t\t\t);\n\n\t\t\t\tif ( skipSerialization ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst elementStyles = blockElementStyles?.[ elementType ];\n\n\t\t\t\t// Process primary element type styles.\n\t\t\t\tif ( elementStyles ) {\n\t\t\t\t\tconst selector = scopeSelector(\n\t\t\t\t\t\tbaseElementSelector,\n\t\t\t\t\t\tELEMENTS[ elementType ]\n\t\t\t\t\t);\n\n\t\t\t\t\telementCSSRules.push(\n\t\t\t\t\t\tcompileCSS( elementStyles, { selector } )\n\t\t\t\t\t);\n\n\t\t\t\t\t// Process any interactive states for the element type.\n\t\t\t\t\tif ( pseudo ) {\n\t\t\t\t\t\tpseudo.forEach( ( pseudoSelector ) => {\n\t\t\t\t\t\t\tif ( elementStyles[ pseudoSelector ] ) {\n\t\t\t\t\t\t\t\telementCSSRules.push(\n\t\t\t\t\t\t\t\t\tcompileCSS(\n\t\t\t\t\t\t\t\t\t\telementStyles[ pseudoSelector ],\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tselector: scopeSelector(\n\t\t\t\t\t\t\t\t\t\t\t\tbaseElementSelector,\n\t\t\t\t\t\t\t\t\t\t\t\t`${ ELEMENTS[ elementType ] }${ pseudoSelector }`\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Process related elements e.g. h1-h6 for headings\n\t\t\t\tif ( elements ) {\n\t\t\t\t\telements.forEach( ( element ) => {\n\t\t\t\t\t\tif ( blockElementStyles[ element ] ) {\n\t\t\t\t\t\t\telementCSSRules.push(\n\t\t\t\t\t\t\t\tcompileCSS( blockElementStyles[ element ], {\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\tELEMENTS[ element ]\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\treturn elementCSSRules.length > 0\n\t\t\t\t? elementCSSRules.join( '' )\n\t\t\t\t: undefined;\n\t\t}, [ baseElementSelector, blockElementStyles, props.name ] );\n\n\t\tuseStyleOverride( { css: styles } );\n\n\t\treturn (\n\t\t\t<BlockListBlock\n\t\t\t\t{ ...props }\n\t\t\t\tclassName={\n\t\t\t\t\tprops.attributes.style?.elements\n\t\t\t\t\t\t? classnames(\n\t\t\t\t\t\t\t\tprops.className,\n\t\t\t\t\t\t\t\tblockElementsContainerIdentifier\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: props.className\n\t\t\t\t}\n\t\t\t/>\n\t\t);\n\t},\n\t'withElementsStyles'\n);\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/style/addAttribute',\n\taddAttribute\n);\n\naddFilter(\n\t'blocks.getSaveContent.extraProps',\n\t'core/style/addSaveProps',\n\taddSaveProps\n);\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/style/addEditProps',\n\taddEditProps\n);\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/style/with-block-controls',\n\twithBlockStyleControls\n);\n\naddFilter(\n\t'editor.BlockListBlock',\n\t'core/editor/with-elements-styles',\n\twithElementsStyles\n);\n"],"mappings":";;;;;;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAKA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAKA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AAE;QACNG,IAAI,EAAE;MACP;IACD,CAAE,CAAC;EACJ;EAEA,OAAOL,QAAQ;AAChB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMM,0BAA0B,GAAG;EAClC,CAAG,GAAGxB,0BAAoB,kCAAiC,GAAI,CAAE,QAAQ,CAAE;EAC3E,CAAG,GAAGC,wBAAmB,kCAAiC,GAAI,CAC7DA,wBAAiB,CACjB;EACD,CAAG,GAAGwB,kCAAwB,kCAAiC,GAAI,CAClEA,kCAAsB,CACtB;EACD,CAAG,GAAGvB,kCAAwB,kCAAiC,GAAI,CAClEA,kCAAsB,CACtB;EACD,CAAG,GAAGE,+BAAqB,kCAAiC,GAAI,CAC/DA,+BAAmB;AAErB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMsB,0BAA0B,GAAG;EAClC,GAAGF,0BAA0B;EAC7B,CAAG,GAAGrB,kCAAwB,EAAC,GAAI,CAAEA,kCAAsB,CAAE,CAAE;AAChE,CAAC;;AAED,MAAMwB,gCAAgC,GAAG;EACxC,CAAG,GAAGxB,kCAAwB,EAAC,GAAI;AACpC,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMyB,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;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;IACVsD,SAAS,EACRtD,KAAK,CAAC1B,UAAU,CAACC,KAAK,EAAEyD,QAAQ,GAC7B,IAAAuB,mBAAU,EACVvD,KAAK,CAACsD,SAAS,EACfnB,gCACA,CAAC,GACDnC,KAAK,CAACsD;EACT,CACD,CAAC;AAEJ,CAAC,EACD,oBACD,CAAC;AAED,IAAAE,gBAAS,EACR,0BAA0B,EAC1B,yBAAyB,EACzBpF,YACD,CAAC;AAED,IAAAoF,gBAAS,EACR,kCAAkC,EAClC,yBAAyB,EACzBzD,YACD,CAAC;AAED,IAAAyD,gBAAS,EACR,0BAA0B,EAC1B,yBAAyB,EACzB/C,YACD,CAAC;AAED,IAAA+C,gBAAS,EACR,kBAAkB,EAClB,gCAAgC,EAChC5C,sBACD,CAAC;AAED,IAAA4C,gBAAS,EACR,uBAAuB,EACvB,kCAAkC,EAClCvB,kBACD,CAAC"}
1
+ {"version":3,"names":["_element","require","_hooks","_blocks","_compose","_styleEngine","_background","_border","_color","_typography","_dimensions","_utils","_utils2","_blockEditingMode","styleSupportKeys","TYPOGRAPHY_SUPPORT_KEYS","BORDER_SUPPORT_KEY","COLOR_SUPPORT_KEY","DIMENSIONS_SUPPORT_KEY","BACKGROUND_SUPPORT_KEY","SPACING_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","_react","createElement","Fragment","ColorEdit","BackgroundImagePanel","TypographyPanel","BorderPanel","DimensionsPanel","_default","edit","hasSupport","attributeKeys","useBlockProps","exports","default","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 } 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];\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};\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[ `${ BACKGROUND_SUPPORT_KEY }` ]: [ BACKGROUND_SUPPORT_KEY ], // Skip serialization of background support in save mode.\n};\n\nconst skipSerializationPathsSaveChecks = {\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};\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\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\t// The .editor-styles-wrapper selector is required on elements styles. As it is\n\t// added to all other editor styles, not providing it causes reset and global\n\t// styles to override element styles because of higher specificity.\n\tconst baseElementSelector = `.editor-styles-wrapper .${ 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\naddFilter(\n\t'blocks.getSaveContent.extraProps',\n\t'core/style/addSaveProps',\n\taddSaveProps\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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;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMM,0BAA0B,GAAG;EAClC,CAAG,GAAGxB,0BAAoB,kCAAiC,GAAI,CAAE,QAAQ,CAAE;EAC3E,CAAG,GAAGC,wBAAmB,kCAAiC,GAAI,CAC7DA,wBAAiB,CACjB;EACD,CAAG,GAAGwB,kCAAwB,kCAAiC,GAAI,CAClEA,kCAAsB,CACtB;EACD,CAAG,GAAGvB,kCAAwB,kCAAiC,GAAI,CAClEA,kCAAsB,CACtB;EACD,CAAG,GAAGE,+BAAqB,kCAAiC,GAAI,CAC/DA,+BAAmB;AAErB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMsB,0BAA0B,GAAG;EAClC,GAAGF,0BAA0B;EAC7B,CAAG,GAAGrB,kCAAwB,EAAC,GAAI,CAAEA,kCAAsB,CAAE,CAAE;AAChE,CAAC;;AAED,MAAMwB,gCAAgC,GAAG;EACxC,CAAG,GAAGxB,kCAAwB,EAAC,GAAI;AACpC,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMyB,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,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AAEI,OAAO,CAClB;YACD,CAAE,CACH,CAAC;UACF;QACD,CAAE,CAAC;MACJ;IACD,CAAE,CAAC;IAEH,OAAOT,eAAe,CAAC9C,MAAM,GAAG,CAAC,GAC9B8C,eAAe,CAACU,IAAI,CAAE,EAAG,CAAC,GAC1BC,SAAS;EACb,CAAC,EAAE,CAAEd,mBAAmB,EAAEC,kBAAkB,EAAE7B,IAAI,CAAG,CAAC;EAEtD,IAAA2C,uBAAgB,EAAE;IAAEC,GAAG,EAAEzF;EAAO,CAAE,CAAC;EAEnC,OAAOiC,YAAY,CAClB;IAAEyD,SAAS,EAAEnB;EAAiC,CAAC,EAC/C1B,IAAI,EACJ;IAAEpC;EAAM,CAAC,EACTI,0BACD,CAAC;AACF;AAEA,IAAA8E,gBAAS,EACR,0BAA0B,EAC1B,yBAAyB,EACzBrF,YACD,CAAC;AAED,IAAAqF,gBAAS,EACR,kCAAkC,EAClC,yBAAyB,EACzB1D,YACD,CAAC"}
@@ -4,18 +4,19 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.TYPOGRAPHY_SUPPORT_KEYS = exports.TYPOGRAPHY_SUPPORT_KEY = void 0;
8
- exports.TypographyPanel = TypographyPanel;
9
- exports.hasTypographySupport = void 0;
7
+ exports.hasTypographySupport = exports.TypographyPanel = exports.TYPOGRAPHY_SUPPORT_KEYS = exports.TYPOGRAPHY_SUPPORT_KEY = void 0;
10
8
  var _react = require("react");
11
9
  var _blocks = require("@wordpress/blocks");
12
10
  var _element = require("@wordpress/element");
11
+ var _data = require("@wordpress/data");
12
+ var _compose = require("@wordpress/compose");
13
13
  var _inspectorControls = _interopRequireDefault(require("../components/inspector-controls"));
14
14
  var _typographyPanel = _interopRequireWildcard(require("../components/global-styles/typography-panel"));
15
15
  var _lineHeight = require("./line-height");
16
16
  var _fontFamily = require("./font-family");
17
17
  var _fontSize = require("./font-size");
18
18
  var _utils = require("./utils");
19
+ var _store = require("../store");
19
20
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
20
21
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21
22
  /**
@@ -85,22 +86,35 @@ function TypographyInspectorControl({
85
86
  resetAllFilter: attributesResetAllFilter
86
87
  }, children);
87
88
  }
88
- function TypographyPanel({
89
+ function TypographyPanelPure({
89
90
  clientId,
90
91
  name,
91
- attributes,
92
92
  setAttributes,
93
- __unstableParentLayout
93
+ settings
94
94
  }) {
95
- const settings = (0, _utils.useBlockSettings)(name, __unstableParentLayout);
95
+ function selector(select) {
96
+ const {
97
+ style,
98
+ fontFamily,
99
+ fontSize
100
+ } = select(_store.store).getBlockAttributes(clientId) || {};
101
+ return {
102
+ style,
103
+ fontFamily,
104
+ fontSize
105
+ };
106
+ }
107
+ const {
108
+ style,
109
+ fontFamily,
110
+ fontSize
111
+ } = (0, _data.useSelect)(selector, [clientId]);
96
112
  const isEnabled = (0, _typographyPanel.useHasTypographyPanel)(settings);
97
- const value = (0, _element.useMemo)(() => {
98
- return attributesToStyle({
99
- style: attributes.style,
100
- fontFamily: attributes.fontFamily,
101
- fontSize: attributes.fontSize
102
- });
103
- }, [attributes.style, attributes.fontSize, attributes.fontFamily]);
113
+ const value = (0, _element.useMemo)(() => attributesToStyle({
114
+ style,
115
+ fontFamily,
116
+ fontSize
117
+ }), [style, fontSize, fontFamily]);
104
118
  const onChange = newStyle => {
105
119
  setAttributes(styleToAttributes(newStyle));
106
120
  };
@@ -117,6 +131,12 @@ function TypographyPanel({
117
131
  defaultControls: defaultControls
118
132
  });
119
133
  }
134
+
135
+ // We don't want block controls to re-render when typing inside a block. `pure`
136
+ // will prevent re-renders unless props change, so only pass the needed props
137
+ // and not the whole attributes object.
138
+ const TypographyPanel = (0, _compose.pure)(TypographyPanelPure);
139
+ exports.TypographyPanel = TypographyPanel;
120
140
  const hasTypographySupport = blockName => {
121
141
  return TYPOGRAPHY_SUPPORT_KEYS.some(key => (0, _blocks.hasBlockSupport)(blockName, key));
122
142
  };
@@ -1 +1 @@
1
- {"version":3,"names":["_blocks","require","_element","_inspectorControls","_interopRequireDefault","_typographyPanel","_interopRequireWildcard","_lineHeight","_fontFamily","_fontSize","_utils","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","omit","object","keys","fromEntries","entries","filter","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","styleToAttributes","style","updatedStyle","fontSizeValue","typography","fontSize","fontFamilyValue","fontFamily","fontSizeSlug","startsWith","substring","length","undefined","fontFamilySlug","cleanEmptyObject","attributesToStyle","attributes","TypographyInspectorControl","children","resetAllFilter","attributesResetAllFilter","useCallback","existingStyle","_react","createElement","group","TypographyPanel","clientId","name","setAttributes","__unstableParentLayout","settings","useBlockSettings","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';\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 { cleanEmptyObject, useBlockSettings } from './utils';\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_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( {\n\tclientId,\n\tname,\n\tattributes,\n\tsetAttributes,\n\t__unstableParentLayout,\n} ) {\n\tconst settings = useBlockSettings( name, __unstableParentLayout );\n\tconst isEnabled = useHasTypographyPanel( settings );\n\tconst value = useMemo( () => {\n\t\treturn attributesToStyle( {\n\t\t\tstyle: attributes.style,\n\t\t\tfontFamily: attributes.fontFamily,\n\t\t\tfontSize: attributes.fontSize,\n\t\t} );\n\t}, [ attributes.style, attributes.fontSize, attributes.fontFamily ] );\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;AAKA,IAAAE,kBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,I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AAKC,SAAS,IAAM;EACpD,OAAOhD,uBAAuB,CAACiD,IAAI,CAAIvE,GAAG,IACzC,IAAAwE,uBAAe,EAAEF,SAAS,EAAEtE,GAAI,CACjC,CAAC;AACF,CAAC;AAACqB,OAAA,CAAAgD,oBAAA,GAAAA,oBAAA"}
1
+ {"version":3,"names":["_blocks","require","_element","_data","_compose","_inspectorControls","_interopRequireDefault","_typographyPanel","_interopRequireWildcard","_lineHeight","_fontFamily","_fontSize","_utils","_store","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","omit","object","keys","fromEntries","entries","filter","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","styleToAttributes","style","updatedStyle","fontSizeValue","typography","fontSize","fontFamilyValue","fontFamily","fontSizeSlug","startsWith","substring","length","undefined","fontFamilySlug","cleanEmptyObject","attributesToStyle","attributes","TypographyInspectorControl","children","resetAllFilter","attributesResetAllFilter","useCallback","existingStyle","_react","createElement","group","TypographyPanelPure","clientId","name","setAttributes","settings","selector","select","blockEditorStore","getBlockAttributes","useSelect","isEnabled","useHasTypographyPanel","value","useMemo","onChange","newStyle","defaultControls","getBlockSupport","as","panelId","TypographyPanel","pure","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';\nimport { pure } from '@wordpress/compose';\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 { 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_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\nfunction TypographyPanelPure( { 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\n// We don't want block controls to re-render when typing inside a block. `pure`\n// will prevent re-renders unless props change, so only pass the needed props\n// and not the whole attributes object.\nexport const TypographyPanel = pure( TypographyPanelPure );\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;AACA,IAAAG,QAAA,GAAAH,OAAA;AAKA,IAAAI,kBAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,gBAAA,GAAAC,uBAAA,CAAAP,OAAA;AAKA,IAAAQ,WAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AACA,IAA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