@wordpress/edit-site 6.32.0 → 6.32.1-next.b8c8708f3.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 (991) hide show
  1. package/build/components/add-new-pattern/index.js +153 -141
  2. package/build/components/add-new-pattern/index.js.map +7 -1
  3. package/build/components/add-new-post/index.js +114 -89
  4. package/build/components/add-new-post/index.js.map +7 -1
  5. package/build/components/add-new-template/add-custom-generic-template-modal-content.js +80 -60
  6. package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +7 -1
  7. package/build/components/add-new-template/add-custom-template-modal-content.js +284 -207
  8. package/build/components/add-new-template/add-custom-template-modal-content.js.map +7 -1
  9. package/build/components/add-new-template/index.js +309 -248
  10. package/build/components/add-new-template/index.js.map +7 -1
  11. package/build/components/add-new-template/utils.js +459 -446
  12. package/build/components/add-new-template/utils.js.map +7 -1
  13. package/build/components/app/index.js +72 -63
  14. package/build/components/app/index.js.map +7 -1
  15. package/build/components/block-editor/use-editor-iframe-props.js +63 -66
  16. package/build/components/block-editor/use-editor-iframe-props.js.map +7 -1
  17. package/build/components/block-editor/use-navigate-to-entity-record.js +34 -22
  18. package/build/components/block-editor/use-navigate-to-entity-record.js.map +7 -1
  19. package/build/components/block-editor/use-site-editor-settings.js +64 -51
  20. package/build/components/block-editor/use-site-editor-settings.js.map +7 -1
  21. package/build/components/canvas-loader/index.js +41 -56
  22. package/build/components/canvas-loader/index.js.map +7 -1
  23. package/build/components/dataviews-actions/index.js +96 -83
  24. package/build/components/dataviews-actions/index.js.map +7 -1
  25. package/build/components/editor/index.js +288 -235
  26. package/build/components/editor/index.js.map +7 -1
  27. package/build/components/editor/site-preview.js +55 -42
  28. package/build/components/editor/site-preview.js.map +7 -1
  29. package/build/components/editor/use-adapt-editor-to-canvas.js +49 -31
  30. package/build/components/editor/use-adapt-editor-to-canvas.js.map +7 -1
  31. package/build/components/editor/use-editor-title.js +79 -61
  32. package/build/components/editor/use-editor-title.js.map +7 -1
  33. package/build/components/editor/use-resolve-edited-entity.js +112 -140
  34. package/build/components/editor/use-resolve-edited-entity.js.map +7 -1
  35. package/build/components/editor-canvas-container/index.js +101 -91
  36. package/build/components/editor-canvas-container/index.js.map +7 -1
  37. package/build/components/global-styles/background-panel.js +46 -39
  38. package/build/components/global-styles/background-panel.js.map +7 -1
  39. package/build/components/global-styles/block-preview-panel.js +58 -52
  40. package/build/components/global-styles/block-preview-panel.js.map +7 -1
  41. package/build/components/global-styles/color-indicator-wrapper.js +47 -26
  42. package/build/components/global-styles/color-indicator-wrapper.js.map +7 -1
  43. package/build/components/global-styles/color-palette-panel.js +130 -81
  44. package/build/components/global-styles/color-palette-panel.js.map +7 -1
  45. package/build/components/global-styles/confirm-reset-shadow-dialog.js +38 -22
  46. package/build/components/global-styles/confirm-reset-shadow-dialog.js.map +7 -1
  47. package/build/components/global-styles/dimensions-panel.js +46 -41
  48. package/build/components/global-styles/dimensions-panel.js.map +7 -1
  49. package/build/components/global-styles/font-families.js +106 -102
  50. package/build/components/global-styles/font-families.js.map +7 -1
  51. package/build/components/global-styles/font-family-item.js +41 -43
  52. package/build/components/global-styles/font-family-item.js.map +7 -1
  53. package/build/components/global-styles/font-library-modal/collection-font-variant.js +55 -39
  54. package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +7 -1
  55. package/build/components/global-styles/font-library-modal/context.js +228 -243
  56. package/build/components/global-styles/font-library-modal/context.js.map +7 -1
  57. package/build/components/global-styles/font-library-modal/font-card.js +70 -59
  58. package/build/components/global-styles/font-library-modal/font-card.js.map +7 -1
  59. package/build/components/global-styles/font-library-modal/font-collection.js +407 -321
  60. package/build/components/global-styles/font-library-modal/font-collection.js.map +7 -1
  61. package/build/components/global-styles/font-library-modal/font-demo.js +54 -50
  62. package/build/components/global-styles/font-library-modal/font-demo.js.map +7 -1
  63. package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +52 -44
  64. package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +7 -1
  65. package/build/components/global-styles/font-library-modal/index.js +90 -87
  66. package/build/components/global-styles/font-library-modal/index.js.map +7 -1
  67. package/build/components/global-styles/font-library-modal/installed-fonts.js +369 -255
  68. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +7 -1
  69. package/build/components/global-styles/font-library-modal/library-font-details.js +60 -42
  70. package/build/components/global-styles/font-library-modal/library-font-details.js.map +7 -1
  71. package/build/components/global-styles/font-library-modal/library-font-variant.js +64 -49
  72. package/build/components/global-styles/font-library-modal/library-font-variant.js.map +7 -1
  73. package/build/components/global-styles/font-library-modal/resolvers.js +64 -31
  74. package/build/components/global-styles/font-library-modal/resolvers.js.map +7 -1
  75. package/build/components/global-styles/font-library-modal/upload-fonts.js +133 -145
  76. package/build/components/global-styles/font-library-modal/upload-fonts.js.map +7 -1
  77. package/build/components/global-styles/font-library-modal/utils/constants.js +45 -24
  78. package/build/components/global-styles/font-library-modal/utils/constants.js.map +7 -1
  79. package/build/components/global-styles/font-library-modal/utils/filter-fonts.js +30 -27
  80. package/build/components/global-styles/font-library-modal/utils/filter-fonts.js.map +7 -1
  81. package/build/components/global-styles/font-library-modal/utils/fonts-outline.js +41 -13
  82. package/build/components/global-styles/font-library-modal/utils/fonts-outline.js.map +7 -1
  83. package/build/components/global-styles/font-library-modal/utils/index.js +127 -161
  84. package/build/components/global-styles/font-library-modal/utils/index.js.map +7 -1
  85. package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js +25 -18
  86. package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +7 -1
  87. package/build/components/global-styles/font-library-modal/utils/preview-styles.js +55 -74
  88. package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +7 -1
  89. package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js +32 -16
  90. package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +7 -1
  91. package/build/components/global-styles/font-library-modal/utils/toggleFont.js +43 -72
  92. package/build/components/global-styles/font-library-modal/utils/toggleFont.js.map +7 -1
  93. package/build/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js +44 -23
  94. package/build/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js.map +7 -1
  95. package/build/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js +38 -22
  96. package/build/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js.map +7 -1
  97. package/build/components/global-styles/font-sizes/font-size-preview.js +42 -35
  98. package/build/components/global-styles/font-sizes/font-size-preview.js.map +7 -1
  99. package/build/components/global-styles/font-sizes/font-size.js +207 -170
  100. package/build/components/global-styles/font-sizes/font-size.js.map +7 -1
  101. package/build/components/global-styles/font-sizes/font-sizes-count.js +46 -45
  102. package/build/components/global-styles/font-sizes/font-sizes-count.js.map +7 -1
  103. package/build/components/global-styles/font-sizes/font-sizes.js +199 -136
  104. package/build/components/global-styles/font-sizes/font-sizes.js.map +7 -1
  105. package/build/components/global-styles/font-sizes/rename-font-size-dialog.js +81 -58
  106. package/build/components/global-styles/font-sizes/rename-font-size-dialog.js.map +7 -1
  107. package/build/components/global-styles/gradients-palette-panel.js +140 -85
  108. package/build/components/global-styles/gradients-palette-panel.js.map +7 -1
  109. package/build/components/global-styles/header.js +51 -48
  110. package/build/components/global-styles/header.js.map +7 -1
  111. package/build/components/global-styles/highlighted-colors.js +48 -40
  112. package/build/components/global-styles/highlighted-colors.js.map +7 -1
  113. package/build/components/global-styles/hooks.js +89 -68
  114. package/build/components/global-styles/hooks.js.map +7 -1
  115. package/build/components/global-styles/icon-with-current-color.js +50 -25
  116. package/build/components/global-styles/icon-with-current-color.js.map +7 -1
  117. package/build/components/global-styles/index.js +36 -11
  118. package/build/components/global-styles/index.js.map +7 -1
  119. package/build/components/global-styles/navigation-button.js +41 -42
  120. package/build/components/global-styles/navigation-button.js.map +7 -1
  121. package/build/components/global-styles/palette.js +82 -73
  122. package/build/components/global-styles/palette.js.map +7 -1
  123. package/build/components/global-styles/preset-colors.js +36 -24
  124. package/build/components/global-styles/preset-colors.js.map +7 -1
  125. package/build/components/global-styles/preview-colors.js +68 -46
  126. package/build/components/global-styles/preview-colors.js.map +7 -1
  127. package/build/components/global-styles/preview-styles.js +182 -136
  128. package/build/components/global-styles/preview-styles.js.map +7 -1
  129. package/build/components/global-styles/preview-typography.js +65 -44
  130. package/build/components/global-styles/preview-typography.js.map +7 -1
  131. package/build/components/global-styles/preview-wrapper.js +70 -85
  132. package/build/components/global-styles/preview-wrapper.js.map +7 -1
  133. package/build/components/global-styles/root-menu.js +53 -52
  134. package/build/components/global-styles/root-menu.js.map +7 -1
  135. package/build/components/global-styles/screen-background.js +54 -35
  136. package/build/components/global-styles/screen-background.js.map +7 -1
  137. package/build/components/global-styles/screen-block-list.js +129 -118
  138. package/build/components/global-styles/screen-block-list.js.map +7 -1
  139. package/build/components/global-styles/screen-block.js +185 -182
  140. package/build/components/global-styles/screen-block.js.map +7 -1
  141. package/build/components/global-styles/screen-color-palette.js +61 -56
  142. package/build/components/global-styles/screen-color-palette.js.map +7 -1
  143. package/build/components/global-styles/screen-colors.js +64 -40
  144. package/build/components/global-styles/screen-colors.js.map +7 -1
  145. package/build/components/global-styles/screen-css.js +80 -50
  146. package/build/components/global-styles/screen-css.js.map +7 -1
  147. package/build/components/global-styles/screen-layout.js +45 -32
  148. package/build/components/global-styles/screen-layout.js.map +7 -1
  149. package/build/components/global-styles/screen-revisions/index.js +144 -116
  150. package/build/components/global-styles/screen-revisions/index.js.map +7 -1
  151. package/build/components/global-styles/screen-revisions/revisions-buttons.js +165 -166
  152. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +7 -1
  153. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +93 -81
  154. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +7 -1
  155. package/build/components/global-styles/screen-root.js +93 -84
  156. package/build/components/global-styles/screen-root.js.map +7 -1
  157. package/build/components/global-styles/screen-shadows.js +43 -16
  158. package/build/components/global-styles/screen-shadows.js.map +7 -1
  159. package/build/components/global-styles/screen-style-variations.js +64 -44
  160. package/build/components/global-styles/screen-style-variations.js.map +7 -1
  161. package/build/components/global-styles/screen-typography-element.js +146 -93
  162. package/build/components/global-styles/screen-typography-element.js.map +7 -1
  163. package/build/components/global-styles/screen-typography.js +64 -40
  164. package/build/components/global-styles/screen-typography.js.map +7 -1
  165. package/build/components/global-styles/shadow-utils.js +75 -180
  166. package/build/components/global-styles/shadow-utils.js.map +7 -1
  167. package/build/components/global-styles/shadows-edit-panel.js +433 -358
  168. package/build/components/global-styles/shadows-edit-panel.js.map +7 -1
  169. package/build/components/global-styles/shadows-panel.js +178 -131
  170. package/build/components/global-styles/shadows-panel.js.map +7 -1
  171. package/build/components/global-styles/size-control/index.js +66 -76
  172. package/build/components/global-styles/size-control/index.js.map +7 -1
  173. package/build/components/global-styles/style-variations-container.js +114 -102
  174. package/build/components/global-styles/style-variations-container.js.map +7 -1
  175. package/build/components/global-styles/subtitle.js +34 -21
  176. package/build/components/global-styles/subtitle.js.map +7 -1
  177. package/build/components/global-styles/typeset.js +73 -75
  178. package/build/components/global-styles/typeset.js.map +7 -1
  179. package/build/components/global-styles/typography-elements.js +109 -86
  180. package/build/components/global-styles/typography-elements.js.map +7 -1
  181. package/build/components/global-styles/typography-example.js +66 -65
  182. package/build/components/global-styles/typography-example.js.map +7 -1
  183. package/build/components/global-styles/typography-panel.js +57 -39
  184. package/build/components/global-styles/typography-panel.js.map +7 -1
  185. package/build/components/global-styles/typography-preview.js +73 -53
  186. package/build/components/global-styles/typography-preview.js.map +7 -1
  187. package/build/components/global-styles/ui.js +282 -314
  188. package/build/components/global-styles/ui.js.map +7 -1
  189. package/build/components/global-styles/utils.js +45 -31
  190. package/build/components/global-styles/utils.js.map +7 -1
  191. package/build/components/global-styles/variations/variation.js +90 -74
  192. package/build/components/global-styles/variations/variation.js.map +7 -1
  193. package/build/components/global-styles/variations/variations-color.js +52 -41
  194. package/build/components/global-styles/variations/variations-color.js.map +7 -1
  195. package/build/components/global-styles/variations/variations-panel.js +61 -51
  196. package/build/components/global-styles/variations/variations-panel.js.map +7 -1
  197. package/build/components/global-styles/variations/variations-typography.js +69 -49
  198. package/build/components/global-styles/variations/variations-typography.js.map +7 -1
  199. package/build/components/global-styles-renderer/index.js +39 -33
  200. package/build/components/global-styles-renderer/index.js.map +7 -1
  201. package/build/components/global-styles-sidebar/default-sidebar.js +53 -40
  202. package/build/components/global-styles-sidebar/default-sidebar.js.map +7 -1
  203. package/build/components/global-styles-sidebar/index.js +164 -141
  204. package/build/components/global-styles-sidebar/index.js.map +7 -1
  205. package/build/components/layout/animation.js +53 -78
  206. package/build/components/layout/animation.js.map +7 -1
  207. package/build/components/layout/hooks.js +40 -35
  208. package/build/components/layout/hooks.js.map +7 -1
  209. package/build/components/layout/index.js +220 -199
  210. package/build/components/layout/index.js.map +7 -1
  211. package/build/components/media/index.js +31 -26
  212. package/build/components/media/index.js.map +7 -1
  213. package/build/components/more-menu/index.js +45 -28
  214. package/build/components/more-menu/index.js.map +7 -1
  215. package/build/components/more-menu/site-export.js +69 -44
  216. package/build/components/more-menu/site-export.js.map +7 -1
  217. package/build/components/more-menu/welcome-guide-menu-item.js +29 -21
  218. package/build/components/more-menu/welcome-guide-menu-item.js.map +7 -1
  219. package/build/components/page-patterns/actions.js +82 -0
  220. package/build/components/page-patterns/actions.js.map +7 -0
  221. package/build/components/page-patterns/delete-category-menu-item.js +94 -82
  222. package/build/components/page-patterns/delete-category-menu-item.js.map +7 -1
  223. package/build/components/page-patterns/fields.js +135 -123
  224. package/build/components/page-patterns/fields.js.map +7 -1
  225. package/build/components/page-patterns/index.js +182 -148
  226. package/build/components/page-patterns/index.js.map +7 -1
  227. package/build/components/page-patterns/rename-category-menu-item.js +67 -62
  228. package/build/components/page-patterns/rename-category-menu-item.js.map +7 -1
  229. package/build/components/page-patterns/search-items.js +65 -89
  230. package/build/components/page-patterns/search-items.js.map +7 -1
  231. package/build/components/page-patterns/use-pattern-settings.js +45 -35
  232. package/build/components/page-patterns/use-pattern-settings.js.map +7 -1
  233. package/build/components/page-patterns/use-patterns.js +266 -200
  234. package/build/components/page-patterns/use-patterns.js.map +7 -1
  235. package/build/components/page-patterns/utils.js +27 -7
  236. package/build/components/page-patterns/utils.js.map +7 -1
  237. package/build/components/page-templates/fields.js +165 -159
  238. package/build/components/page-templates/fields.js.map +7 -1
  239. package/build/components/page-templates/hooks.js +66 -64
  240. package/build/components/page-templates/hooks.js.map +7 -1
  241. package/build/components/page-templates/index.js +211 -207
  242. package/build/components/page-templates/index.js.map +7 -1
  243. package/build/components/page-templates/view-utils.js +67 -0
  244. package/build/components/page-templates/view-utils.js.map +7 -0
  245. package/build/components/pagination/index.js +119 -82
  246. package/build/components/pagination/index.js.map +7 -1
  247. package/build/components/plugin-template-setting-panel/index.js +49 -56
  248. package/build/components/plugin-template-setting-panel/index.js.map +7 -1
  249. package/build/components/post-edit/index.js +171 -149
  250. package/build/components/post-edit/index.js.map +7 -1
  251. package/build/components/post-list/index.js +230 -301
  252. package/build/components/post-list/index.js.map +7 -1
  253. package/build/components/post-list/view-utils.js +167 -0
  254. package/build/components/post-list/view-utils.js.map +7 -0
  255. package/build/components/posts-app/index.js +44 -32
  256. package/build/components/posts-app/index.js.map +7 -1
  257. package/build/components/posts-app-routes/index.js +36 -25
  258. package/build/components/posts-app-routes/index.js.map +7 -1
  259. package/build/components/posts-app-routes/post-item.js +54 -35
  260. package/build/components/posts-app-routes/post-item.js.map +7 -1
  261. package/build/components/posts-app-routes/posts.js +91 -76
  262. package/build/components/posts-app-routes/posts.js.map +7 -1
  263. package/build/components/resizable-frame/index.js +200 -224
  264. package/build/components/resizable-frame/index.js.map +7 -1
  265. package/build/components/revisions/index.js +102 -71
  266. package/build/components/revisions/index.js.map +7 -1
  267. package/build/components/routes/use-title.js +45 -35
  268. package/build/components/routes/use-title.js.map +7 -1
  269. package/build/components/save-button/index.js +113 -111
  270. package/build/components/save-button/index.js.map +7 -1
  271. package/build/components/save-hub/index.js +52 -40
  272. package/build/components/save-hub/index.js.map +7 -1
  273. package/build/components/save-keyboard-shortcut/index.js +46 -52
  274. package/build/components/save-keyboard-shortcut/index.js.map +7 -1
  275. package/build/components/save-panel/index.js +155 -136
  276. package/build/components/save-panel/index.js.map +7 -1
  277. package/build/components/sidebar/index.js +81 -79
  278. package/build/components/sidebar/index.js.map +7 -1
  279. package/build/components/sidebar-button/index.js +43 -22
  280. package/build/components/sidebar-button/index.js.map +7 -1
  281. package/build/components/sidebar-dataviews/dataview-item.js +68 -55
  282. package/build/components/sidebar-dataviews/dataview-item.js.map +7 -1
  283. package/build/components/sidebar-dataviews/index.js +68 -54
  284. package/build/components/sidebar-dataviews/index.js.map +7 -1
  285. package/build/components/sidebar-global-styles-wrapper/index.js +125 -111
  286. package/build/components/sidebar-global-styles-wrapper/index.js.map +7 -1
  287. package/build/components/sidebar-navigation-item/index.js +79 -62
  288. package/build/components/sidebar-navigation-item/index.js.map +7 -1
  289. package/build/components/sidebar-navigation-screen/index.js +129 -104
  290. package/build/components/sidebar-navigation-screen/index.js.map +7 -1
  291. package/build/components/sidebar-navigation-screen-details-footer/index.js +63 -53
  292. package/build/components/sidebar-navigation-screen-details-footer/index.js.map +7 -1
  293. package/build/components/sidebar-navigation-screen-global-styles/content.js +50 -33
  294. package/build/components/sidebar-navigation-screen-global-styles/content.js.map +7 -1
  295. package/build/components/sidebar-navigation-screen-global-styles/index.js +94 -81
  296. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +7 -1
  297. package/build/components/sidebar-navigation-screen-main/index.js +141 -90
  298. package/build/components/sidebar-navigation-screen-main/index.js.map +7 -1
  299. package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +40 -29
  300. package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +7 -1
  301. package/build/components/sidebar-navigation-screen-navigation-menu/index.js +124 -91
  302. package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +7 -1
  303. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +116 -83
  304. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +7 -1
  305. package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +57 -48
  306. package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +7 -1
  307. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +80 -66
  308. package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +7 -1
  309. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +64 -38
  310. package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +7 -1
  311. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +125 -96
  312. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +7 -1
  313. package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +33 -19
  314. package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +7 -1
  315. package/build/components/sidebar-navigation-screen-navigation-menus/constants.js +30 -16
  316. package/build/components/sidebar-navigation-screen-navigation-menus/constants.js.map +7 -1
  317. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +119 -105
  318. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +7 -1
  319. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +130 -121
  320. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +7 -1
  321. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +106 -88
  322. package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +7 -1
  323. package/build/components/sidebar-navigation-screen-patterns/category-item.js +44 -21
  324. package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +7 -1
  325. package/build/components/sidebar-navigation-screen-patterns/index.js +129 -106
  326. package/build/components/sidebar-navigation-screen-patterns/index.js.map +7 -1
  327. package/build/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js +36 -25
  328. package/build/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +7 -1
  329. package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +81 -70
  330. package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +7 -1
  331. package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +42 -32
  332. package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +7 -1
  333. package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +41 -28
  334. package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +7 -1
  335. package/build/components/sidebar-navigation-screen-templates-browse/content.js +95 -76
  336. package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +7 -1
  337. package/build/components/sidebar-navigation-screen-templates-browse/index.js +48 -27
  338. package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +7 -1
  339. package/build/components/sidebar-navigation-screen-unsupported/index.js +28 -20
  340. package/build/components/sidebar-navigation-screen-unsupported/index.js.map +7 -1
  341. package/build/components/site-editor-routes/home.js +50 -32
  342. package/build/components/site-editor-routes/home.js.map +7 -1
  343. package/build/components/site-editor-routes/index.js +62 -36
  344. package/build/components/site-editor-routes/index.js.map +7 -1
  345. package/build/components/site-editor-routes/navigation-item.js +55 -49
  346. package/build/components/site-editor-routes/navigation-item.js.map +7 -1
  347. package/build/components/site-editor-routes/navigation.js +55 -49
  348. package/build/components/site-editor-routes/navigation.js.map +7 -1
  349. package/build/components/site-editor-routes/notfound.js +54 -34
  350. package/build/components/site-editor-routes/notfound.js.map +7 -1
  351. package/build/components/site-editor-routes/page-item.js +58 -41
  352. package/build/components/site-editor-routes/page-item.js.map +7 -1
  353. package/build/components/site-editor-routes/pages.js +96 -86
  354. package/build/components/site-editor-routes/pages.js.map +7 -1
  355. package/build/components/site-editor-routes/pattern-item.js +48 -26
  356. package/build/components/site-editor-routes/pattern-item.js.map +7 -1
  357. package/build/components/site-editor-routes/patterns.js +51 -36
  358. package/build/components/site-editor-routes/patterns.js.map +7 -1
  359. package/build/components/site-editor-routes/stylebook.js +60 -43
  360. package/build/components/site-editor-routes/stylebook.js.map +7 -1
  361. package/build/components/site-editor-routes/styles.js +58 -46
  362. package/build/components/site-editor-routes/styles.js.map +7 -1
  363. package/build/components/site-editor-routes/template-item.js +54 -34
  364. package/build/components/site-editor-routes/template-item.js.map +7 -1
  365. package/build/components/site-editor-routes/template-part-item.js +45 -21
  366. package/build/components/site-editor-routes/template-part-item.js.map +7 -1
  367. package/build/components/site-editor-routes/templates.js +69 -44
  368. package/build/components/site-editor-routes/templates.js.map +7 -1
  369. package/build/components/site-editor-routes/utils.js +27 -13
  370. package/build/components/site-editor-routes/utils.js.map +7 -1
  371. package/build/components/site-hub/index.js +233 -222
  372. package/build/components/site-hub/index.js.map +7 -1
  373. package/build/components/site-icon/index.js +61 -49
  374. package/build/components/site-icon/index.js.map +7 -1
  375. package/build/components/style-book/categories.js +61 -52
  376. package/build/components/style-book/categories.js.map +7 -1
  377. package/build/components/style-book/color-examples.js +54 -40
  378. package/build/components/style-book/color-examples.js.map +7 -1
  379. package/build/components/style-book/constants.js +218 -144
  380. package/build/components/style-book/constants.js.map +7 -1
  381. package/build/components/style-book/duotone-examples.js +54 -40
  382. package/build/components/style-book/duotone-examples.js.map +7 -1
  383. package/build/components/style-book/examples.js +145 -120
  384. package/build/components/style-book/examples.js.map +7 -1
  385. package/build/components/style-book/index.js +454 -409
  386. package/build/components/style-book/index.js.map +7 -1
  387. package/build/components/style-book/types.js +16 -5
  388. package/build/components/style-book/types.js.map +7 -1
  389. package/build/components/welcome-guide/editor.js +87 -60
  390. package/build/components/welcome-guide/editor.js.map +7 -1
  391. package/build/components/welcome-guide/image.js +34 -22
  392. package/build/components/welcome-guide/image.js.map +7 -1
  393. package/build/components/welcome-guide/index.js +44 -21
  394. package/build/components/welcome-guide/index.js.map +7 -1
  395. package/build/components/welcome-guide/page.js +76 -52
  396. package/build/components/welcome-guide/page.js.map +7 -1
  397. package/build/components/welcome-guide/styles.js +135 -102
  398. package/build/components/welcome-guide/styles.js.map +7 -1
  399. package/build/components/welcome-guide/template.js +71 -59
  400. package/build/components/welcome-guide/template.js.map +7 -1
  401. package/build/deprecated.js +56 -46
  402. package/build/deprecated.js.map +7 -1
  403. package/build/hooks/commands/use-common-commands.js +117 -119
  404. package/build/hooks/commands/use-common-commands.js.map +7 -1
  405. package/build/hooks/commands/use-set-command-context.js +40 -50
  406. package/build/hooks/commands/use-set-command-context.js.map +7 -1
  407. package/build/hooks/index.js +2 -3
  408. package/build/hooks/index.js.map +7 -1
  409. package/build/hooks/push-changes-to-global-styles/index.js +236 -251
  410. package/build/hooks/push-changes-to-global-styles/index.js.map +7 -1
  411. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +78 -111
  412. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +7 -1
  413. package/build/index.js +87 -112
  414. package/build/index.js.map +7 -1
  415. package/build/lock-unlock.js +31 -14
  416. package/build/lock-unlock.js.map +7 -1
  417. package/build/posts.js +67 -63
  418. package/build/posts.js.map +7 -1
  419. package/build/store/actions.js +199 -365
  420. package/build/store/actions.js.map +7 -1
  421. package/build/store/constants.js +27 -11
  422. package/build/store/constants.js.map +7 -1
  423. package/build/store/index.js +52 -30
  424. package/build/store/index.js.map +7 -1
  425. package/build/store/private-actions.js +34 -19
  426. package/build/store/private-actions.js.map +7 -1
  427. package/build/store/private-selectors.js +28 -13
  428. package/build/store/private-selectors.js.map +7 -1
  429. package/build/store/reducer.js +42 -57
  430. package/build/store/reducer.js.map +7 -1
  431. package/build/store/selectors.js +205 -301
  432. package/build/store/selectors.js.map +7 -1
  433. package/build/utils/constants.js +94 -53
  434. package/build/utils/constants.js.map +7 -1
  435. package/build/utils/get-filtered-template-parts.js +36 -42
  436. package/build/utils/get-filtered-template-parts.js.map +7 -1
  437. package/build/utils/is-previewing-theme.js +31 -13
  438. package/build/utils/is-previewing-theme.js.map +7 -1
  439. package/build/utils/is-template-removable.js +24 -17
  440. package/build/utils/is-template-removable.js.map +7 -1
  441. package/build/utils/is-template-revertable.js +24 -19
  442. package/build/utils/is-template-revertable.js.map +7 -1
  443. package/build/utils/set-nested-value.js +24 -25
  444. package/build/utils/set-nested-value.js.map +7 -1
  445. package/build/utils/template-part-create.js +1 -1
  446. package/build/utils/template-part-create.js.map +7 -1
  447. package/build/utils/use-activate-theme.js +40 -45
  448. package/build/utils/use-activate-theme.js.map +7 -1
  449. package/build/utils/use-actual-current-theme.js +47 -25
  450. package/build/utils/use-actual-current-theme.js.map +7 -1
  451. package/build-module/components/add-new-pattern/index.js +133 -127
  452. package/build-module/components/add-new-pattern/index.js.map +7 -1
  453. package/build-module/components/add-new-post/index.js +100 -82
  454. package/build-module/components/add-new-post/index.js.map +7 -1
  455. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js +63 -51
  456. package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +7 -1
  457. package/build-module/components/add-new-template/add-custom-template-modal-content.js +269 -196
  458. package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +7 -1
  459. package/build-module/components/add-new-template/index.js +289 -219
  460. package/build-module/components/add-new-template/index.js.map +7 -1
  461. package/build-module/components/add-new-template/utils.js +430 -432
  462. package/build-module/components/add-new-template/utils.js.map +7 -1
  463. package/build-module/components/app/index.js +41 -51
  464. package/build-module/components/app/index.js.map +7 -1
  465. package/build-module/components/block-editor/use-editor-iframe-props.js +33 -58
  466. package/build-module/components/block-editor/use-editor-iframe-props.js.map +7 -1
  467. package/build-module/components/block-editor/use-navigate-to-entity-record.js +17 -18
  468. package/build-module/components/block-editor/use-navigate-to-entity-record.js.map +7 -1
  469. package/build-module/components/block-editor/use-site-editor-settings.js +28 -41
  470. package/build-module/components/block-editor/use-site-editor-settings.js.map +7 -1
  471. package/build-module/components/canvas-loader/index.js +25 -50
  472. package/build-module/components/canvas-loader/index.js.map +7 -1
  473. package/build-module/components/dataviews-actions/index.js +75 -78
  474. package/build-module/components/dataviews-actions/index.js.map +7 -1
  475. package/build-module/components/editor/index.js +261 -220
  476. package/build-module/components/editor/index.js.map +7 -1
  477. package/build-module/components/editor/site-preview.js +38 -38
  478. package/build-module/components/editor/site-preview.js.map +7 -1
  479. package/build-module/components/editor/use-adapt-editor-to-canvas.js +25 -24
  480. package/build-module/components/editor/use-adapt-editor-to-canvas.js.map +7 -1
  481. package/build-module/components/editor/use-editor-title.js +49 -53
  482. package/build-module/components/editor/use-editor-title.js.map +7 -1
  483. package/build-module/components/editor/use-resolve-edited-entity.js +89 -129
  484. package/build-module/components/editor/use-resolve-edited-entity.js.map +7 -1
  485. package/build-module/components/editor-canvas-container/index.js +79 -80
  486. package/build-module/components/editor-canvas-container/index.js.map +7 -1
  487. package/build-module/components/global-styles/background-panel.js +25 -35
  488. package/build-module/components/global-styles/background-panel.js.map +7 -1
  489. package/build-module/components/global-styles/block-preview-panel.js +36 -43
  490. package/build-module/components/global-styles/block-preview-panel.js.map +7 -1
  491. package/build-module/components/global-styles/color-indicator-wrapper.js +19 -20
  492. package/build-module/components/global-styles/color-indicator-wrapper.js.map +7 -1
  493. package/build-module/components/global-styles/color-palette-panel.js +105 -74
  494. package/build-module/components/global-styles/color-palette-panel.js.map +7 -1
  495. package/build-module/components/global-styles/confirm-reset-shadow-dialog.js +20 -17
  496. package/build-module/components/global-styles/confirm-reset-shadow-dialog.js.map +7 -1
  497. package/build-module/components/global-styles/dimensions-panel.js +26 -34
  498. package/build-module/components/global-styles/dimensions-panel.js.map +7 -1
  499. package/build-module/components/global-styles/font-families.js +86 -93
  500. package/build-module/components/global-styles/font-families.js.map +7 -1
  501. package/build-module/components/global-styles/font-family-item.js +26 -37
  502. package/build-module/components/global-styles/font-family-item.js.map +7 -1
  503. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js +26 -32
  504. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +7 -1
  505. package/build-module/components/global-styles/font-library-modal/context.js +203 -224
  506. package/build-module/components/global-styles/font-library-modal/context.js.map +7 -1
  507. package/build-module/components/global-styles/font-library-modal/font-card.js +48 -52
  508. package/build-module/components/global-styles/font-library-modal/font-card.js.map +7 -1
  509. package/build-module/components/global-styles/font-library-modal/font-collection.js +397 -302
  510. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +7 -1
  511. package/build-module/components/global-styles/font-library-modal/font-demo.js +32 -38
  512. package/build-module/components/global-styles/font-library-modal/font-demo.js.map +7 -1
  513. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +41 -39
  514. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +7 -1
  515. package/build-module/components/global-styles/font-library-modal/index.js +65 -81
  516. package/build-module/components/global-styles/font-library-modal/index.js.map +7 -1
  517. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +354 -243
  518. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +7 -1
  519. package/build-module/components/global-styles/font-library-modal/library-font-details.js +35 -36
  520. package/build-module/components/global-styles/font-library-modal/library-font-details.js.map +7 -1
  521. package/build-module/components/global-styles/font-library-modal/library-font-variant.js +35 -42
  522. package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +7 -1
  523. package/build-module/components/global-styles/font-library-modal/resolvers.js +27 -20
  524. package/build-module/components/global-styles/font-library-modal/resolvers.js.map +7 -1
  525. package/build-module/components/global-styles/font-library-modal/upload-fonts.js +111 -135
  526. package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +7 -1
  527. package/build-module/components/global-styles/font-library-modal/utils/constants.js +21 -19
  528. package/build-module/components/global-styles/font-library-modal/utils/constants.js.map +7 -1
  529. package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js +13 -24
  530. package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js.map +7 -1
  531. package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js +20 -10
  532. package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js.map +7 -1
  533. package/build-module/components/global-styles/font-library-modal/utils/index.js +102 -154
  534. package/build-module/components/global-styles/font-library-modal/utils/index.js.map +7 -1
  535. package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js +8 -14
  536. package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +7 -1
  537. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js +34 -71
  538. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +7 -1
  539. package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js +11 -13
  540. package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +7 -1
  541. package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js +22 -69
  542. package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js.map +7 -1
  543. package/build-module/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js +26 -18
  544. package/build-module/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js.map +7 -1
  545. package/build-module/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js +20 -17
  546. package/build-module/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js.map +7 -1
  547. package/build-module/components/global-styles/font-sizes/font-size-preview.js +26 -29
  548. package/build-module/components/global-styles/font-sizes/font-size-preview.js.map +7 -1
  549. package/build-module/components/global-styles/font-sizes/font-size.js +185 -160
  550. package/build-module/components/global-styles/font-sizes/font-size.js.map +7 -1
  551. package/build-module/components/global-styles/font-sizes/font-sizes-count.js +23 -39
  552. package/build-module/components/global-styles/font-sizes/font-sizes-count.js.map +7 -1
  553. package/build-module/components/global-styles/font-sizes/font-sizes.js +184 -128
  554. package/build-module/components/global-styles/font-sizes/font-sizes.js.map +7 -1
  555. package/build-module/components/global-styles/font-sizes/rename-font-size-dialog.js +68 -52
  556. package/build-module/components/global-styles/font-sizes/rename-font-size-dialog.js.map +7 -1
  557. package/build-module/components/global-styles/gradients-palette-panel.js +117 -79
  558. package/build-module/components/global-styles/gradients-palette-panel.js.map +7 -1
  559. package/build-module/components/global-styles/header.js +40 -43
  560. package/build-module/components/global-styles/header.js.map +7 -1
  561. package/build-module/components/global-styles/highlighted-colors.js +31 -36
  562. package/build-module/components/global-styles/highlighted-colors.js.map +7 -1
  563. package/build-module/components/global-styles/hooks.js +56 -61
  564. package/build-module/components/global-styles/hooks.js.map +7 -1
  565. package/build-module/components/global-styles/icon-with-current-color.js +18 -19
  566. package/build-module/components/global-styles/icon-with-current-color.js.map +7 -1
  567. package/build-module/components/global-styles/index.js +5 -2
  568. package/build-module/components/global-styles/index.js.map +7 -1
  569. package/build-module/components/global-styles/navigation-button.js +23 -37
  570. package/build-module/components/global-styles/navigation-button.js.map +7 -1
  571. package/build-module/components/global-styles/palette.js +61 -67
  572. package/build-module/components/global-styles/palette.js.map +7 -1
  573. package/build-module/components/global-styles/preset-colors.js +19 -20
  574. package/build-module/components/global-styles/preset-colors.js.map +7 -1
  575. package/build-module/components/global-styles/preview-colors.js +43 -40
  576. package/build-module/components/global-styles/preview-colors.js.map +7 -1
  577. package/build-module/components/global-styles/preview-styles.js +158 -130
  578. package/build-module/components/global-styles/preview-styles.js.map +7 -1
  579. package/build-module/components/global-styles/preview-typography.js +37 -38
  580. package/build-module/components/global-styles/preview-typography.js.map +7 -1
  581. package/build-module/components/global-styles/preview-wrapper.js +51 -75
  582. package/build-module/components/global-styles/preview-wrapper.js.map +7 -1
  583. package/build-module/components/global-styles/root-menu.js +38 -44
  584. package/build-module/components/global-styles/root-menu.js.map +7 -1
  585. package/build-module/components/global-styles/screen-background.js +26 -29
  586. package/build-module/components/global-styles/screen-background.js.map +7 -1
  587. package/build-module/components/global-styles/screen-block-list.js +105 -105
  588. package/build-module/components/global-styles/screen-block-list.js.map +7 -1
  589. package/build-module/components/global-styles/screen-block.js +156 -169
  590. package/build-module/components/global-styles/screen-block.js.map +7 -1
  591. package/build-module/components/global-styles/screen-color-palette.js +33 -50
  592. package/build-module/components/global-styles/screen-color-palette.js.map +7 -1
  593. package/build-module/components/global-styles/screen-colors.js +35 -33
  594. package/build-module/components/global-styles/screen-colors.js.map +7 -1
  595. package/build-module/components/global-styles/screen-css.js +52 -44
  596. package/build-module/components/global-styles/screen-css.js.map +7 -1
  597. package/build-module/components/global-styles/screen-layout.js +17 -26
  598. package/build-module/components/global-styles/screen-layout.js.map +7 -1
  599. package/build-module/components/global-styles/screen-revisions/index.js +117 -105
  600. package/build-module/components/global-styles/screen-revisions/index.js.map +7 -1
  601. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +145 -158
  602. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +7 -1
  603. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +74 -75
  604. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +7 -1
  605. package/build-module/components/global-styles/screen-root.js +74 -77
  606. package/build-module/components/global-styles/screen-root.js.map +7 -1
  607. package/build-module/components/global-styles/screen-shadows.js +12 -11
  608. package/build-module/components/global-styles/screen-shadows.js.map +7 -1
  609. package/build-module/components/global-styles/screen-style-variations.js +38 -37
  610. package/build-module/components/global-styles/screen-style-variations.js.map +7 -1
  611. package/build-module/components/global-styles/screen-typography-element.js +122 -87
  612. package/build-module/components/global-styles/screen-typography-element.js.map +7 -1
  613. package/build-module/components/global-styles/screen-typography.js +36 -34
  614. package/build-module/components/global-styles/screen-typography.js.map +7 -1
  615. package/build-module/components/global-styles/shadow-utils.js +53 -176
  616. package/build-module/components/global-styles/shadow-utils.js.map +7 -1
  617. package/build-module/components/global-styles/shadows-edit-panel.js +426 -344
  618. package/build-module/components/global-styles/shadows-edit-panel.js.map +7 -1
  619. package/build-module/components/global-styles/shadows-panel.js +159 -124
  620. package/build-module/components/global-styles/shadows-panel.js.map +7 -1
  621. package/build-module/components/global-styles/size-control/index.js +57 -70
  622. package/build-module/components/global-styles/size-control/index.js.map +7 -1
  623. package/build-module/components/global-styles/style-variations-container.js +85 -95
  624. package/build-module/components/global-styles/style-variations-container.js.map +7 -1
  625. package/build-module/components/global-styles/subtitle.js +16 -16
  626. package/build-module/components/global-styles/subtitle.js.map +7 -1
  627. package/build-module/components/global-styles/typeset.js +50 -65
  628. package/build-module/components/global-styles/typeset.js.map +7 -1
  629. package/build-module/components/global-styles/typography-elements.js +86 -80
  630. package/build-module/components/global-styles/typography-elements.js.map +7 -1
  631. package/build-module/components/global-styles/typography-example.js +45 -57
  632. package/build-module/components/global-styles/typography-example.js.map +7 -1
  633. package/build-module/components/global-styles/typography-panel.js +38 -33
  634. package/build-module/components/global-styles/typography-panel.js.map +7 -1
  635. package/build-module/components/global-styles/typography-preview.js +55 -48
  636. package/build-module/components/global-styles/typography-preview.js.map +7 -1
  637. package/build-module/components/global-styles/ui.js +252 -295
  638. package/build-module/components/global-styles/ui.js.map +7 -1
  639. package/build-module/components/global-styles/utils.js +24 -28
  640. package/build-module/components/global-styles/utils.js.map +7 -1
  641. package/build-module/components/global-styles/variations/variation.js +59 -65
  642. package/build-module/components/global-styles/variations/variation.js.map +7 -1
  643. package/build-module/components/global-styles/variations/variations-color.js +26 -34
  644. package/build-module/components/global-styles/variations/variations-color.js.map +7 -1
  645. package/build-module/components/global-styles/variations/variations-panel.js +39 -46
  646. package/build-module/components/global-styles/variations/variations-panel.js.map +7 -1
  647. package/build-module/components/global-styles/variations/variations-typography.js +43 -42
  648. package/build-module/components/global-styles/variations/variations-typography.js.map +7 -1
  649. package/build-module/components/global-styles-renderer/index.js +16 -27
  650. package/build-module/components/global-styles-renderer/index.js.map +7 -1
  651. package/build-module/components/global-styles-sidebar/default-sidebar.js +36 -36
  652. package/build-module/components/global-styles-sidebar/default-sidebar.js.map +7 -1
  653. package/build-module/components/global-styles-sidebar/index.js +137 -133
  654. package/build-module/components/global-styles-sidebar/index.js.map +7 -1
  655. package/build-module/components/layout/animation.js +31 -69
  656. package/build-module/components/layout/animation.js.map +7 -1
  657. package/build-module/components/layout/hooks.js +16 -28
  658. package/build-module/components/layout/hooks.js.map +7 -1
  659. package/build-module/components/layout/index.js +199 -183
  660. package/build-module/components/layout/index.js.map +7 -1
  661. package/build-module/components/media/index.js +13 -21
  662. package/build-module/components/media/index.js.map +7 -1
  663. package/build-module/components/more-menu/index.js +18 -23
  664. package/build-module/components/more-menu/index.js.map +7 -1
  665. package/build-module/components/more-menu/site-export.js +41 -38
  666. package/build-module/components/more-menu/site-export.js.map +7 -1
  667. package/build-module/components/more-menu/welcome-guide-menu-item.js +12 -17
  668. package/build-module/components/more-menu/welcome-guide-menu-item.js.map +7 -1
  669. package/build-module/components/page-patterns/actions.js +52 -0
  670. package/build-module/components/page-patterns/actions.js.map +7 -0
  671. package/build-module/components/page-patterns/delete-category-menu-item.js +78 -76
  672. package/build-module/components/page-patterns/delete-category-menu-item.js.map +7 -1
  673. package/build-module/components/page-patterns/fields.js +103 -112
  674. package/build-module/components/page-patterns/fields.js.map +7 -1
  675. package/build-module/components/page-patterns/index.js +144 -120
  676. package/build-module/components/page-patterns/index.js.map +7 -1
  677. package/build-module/components/page-patterns/rename-category-menu-item.js +37 -53
  678. package/build-module/components/page-patterns/rename-category-menu-item.js.map +7 -1
  679. package/build-module/components/page-patterns/search-items.js +43 -77
  680. package/build-module/components/page-patterns/search-items.js.map +7 -1
  681. package/build-module/components/page-patterns/use-pattern-settings.js +27 -30
  682. package/build-module/components/page-patterns/use-pattern-settings.js.map +7 -1
  683. package/build-module/components/page-patterns/use-patterns.js +249 -192
  684. package/build-module/components/page-patterns/use-patterns.js.map +7 -1
  685. package/build-module/components/page-patterns/utils.js +5 -2
  686. package/build-module/components/page-patterns/utils.js.map +7 -1
  687. package/build-module/components/page-templates/fields.js +132 -147
  688. package/build-module/components/page-templates/fields.js.map +7 -1
  689. package/build-module/components/page-templates/hooks.js +44 -55
  690. package/build-module/components/page-templates/hooks.js.map +7 -1
  691. package/build-module/components/page-templates/index.js +189 -194
  692. package/build-module/components/page-templates/index.js.map +7 -1
  693. package/build-module/components/page-templates/view-utils.js +42 -0
  694. package/build-module/components/page-templates/view-utils.js.map +7 -0
  695. package/build-module/components/pagination/index.js +96 -77
  696. package/build-module/components/pagination/index.js.map +7 -1
  697. package/build-module/components/plugin-template-setting-panel/index.js +21 -50
  698. package/build-module/components/plugin-template-setting-panel/index.js.map +7 -1
  699. package/build-module/components/post-edit/index.js +136 -140
  700. package/build-module/components/post-edit/index.js.map +7 -1
  701. package/build-module/components/post-list/index.js +205 -291
  702. package/build-module/components/post-list/index.js.map +7 -1
  703. package/build-module/components/post-list/view-utils.js +149 -0
  704. package/build-module/components/post-list/view-utils.js.map +7 -0
  705. package/build-module/components/posts-app/index.js +15 -25
  706. package/build-module/components/posts-app/index.js.map +7 -1
  707. package/build-module/components/posts-app-routes/index.js +12 -18
  708. package/build-module/components/posts-app-routes/index.js.map +7 -1
  709. package/build-module/components/posts-app-routes/post-item.js +22 -29
  710. package/build-module/components/posts-app-routes/post-item.js.map +7 -1
  711. package/build-module/components/posts-app-routes/posts.js +59 -70
  712. package/build-module/components/posts-app-routes/posts.js.map +7 -1
  713. package/build-module/components/resizable-frame/index.js +169 -211
  714. package/build-module/components/resizable-frame/index.js.map +7 -1
  715. package/build-module/components/revisions/index.js +78 -64
  716. package/build-module/components/revisions/index.js.map +7 -1
  717. package/build-module/components/routes/use-title.js +25 -28
  718. package/build-module/components/routes/use-title.js.map +7 -1
  719. package/build-module/components/save-button/index.js +99 -104
  720. package/build-module/components/save-button/index.js.map +7 -1
  721. package/build-module/components/save-hub/index.js +23 -33
  722. package/build-module/components/save-hub/index.js.map +7 -1
  723. package/build-module/components/save-keyboard-shortcut/index.js +31 -47
  724. package/build-module/components/save-keyboard-shortcut/index.js.map +7 -1
  725. package/build-module/components/save-panel/index.js +125 -124
  726. package/build-module/components/save-panel/index.js.map +7 -1
  727. package/build-module/components/sidebar/index.js +47 -65
  728. package/build-module/components/sidebar/index.js.map +7 -1
  729. package/build-module/components/sidebar-button/index.js +16 -17
  730. package/build-module/components/sidebar-button/index.js.map +7 -1
  731. package/build-module/components/sidebar-dataviews/dataview-item.js +41 -50
  732. package/build-module/components/sidebar-dataviews/dataview-item.js.map +7 -1
  733. package/build-module/components/sidebar-dataviews/index.js +40 -48
  734. package/build-module/components/sidebar-dataviews/index.js.map +7 -1
  735. package/build-module/components/sidebar-global-styles-wrapper/index.js +100 -104
  736. package/build-module/components/sidebar-global-styles-wrapper/index.js.map +7 -1
  737. package/build-module/components/sidebar-navigation-item/index.js +56 -57
  738. package/build-module/components/sidebar-navigation-item/index.js.map +7 -1
  739. package/build-module/components/sidebar-navigation-screen/index.js +108 -98
  740. package/build-module/components/sidebar-navigation-screen/index.js.map +7 -1
  741. package/build-module/components/sidebar-navigation-screen-details-footer/index.js +36 -48
  742. package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +7 -1
  743. package/build-module/components/sidebar-navigation-screen-global-styles/content.js +23 -28
  744. package/build-module/components/sidebar-navigation-screen-global-styles/content.js.map +7 -1
  745. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +61 -73
  746. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +7 -1
  747. package/build-module/components/sidebar-navigation-screen-main/index.js +108 -82
  748. package/build-module/components/sidebar-navigation-screen-main/index.js.map +7 -1
  749. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +22 -24
  750. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +7 -1
  751. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +92 -84
  752. package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +7 -1
  753. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +87 -76
  754. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +7 -1
  755. package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +28 -41
  756. package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +7 -1
  757. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +67 -60
  758. package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +7 -1
  759. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +37 -32
  760. package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +7 -1
  761. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +107 -91
  762. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +7 -1
  763. package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +14 -14
  764. package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +7 -1
  765. package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js +8 -12
  766. package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js.map +7 -1
  767. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +89 -98
  768. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +7 -1
  769. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +113 -117
  770. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +7 -1
  771. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +82 -82
  772. package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +7 -1
  773. package/build-module/components/sidebar-navigation-screen-patterns/category-item.js +17 -16
  774. package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +7 -1
  775. package/build-module/components/sidebar-navigation-screen-patterns/index.js +108 -99
  776. package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +7 -1
  777. package/build-module/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js +19 -21
  778. package/build-module/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +7 -1
  779. package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +53 -59
  780. package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +7 -1
  781. package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +27 -27
  782. package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +7 -1
  783. package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +24 -24
  784. package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +7 -1
  785. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +67 -70
  786. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +7 -1
  787. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +20 -21
  788. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +7 -1
  789. package/build-module/components/sidebar-navigation-screen-unsupported/index.js +11 -16
  790. package/build-module/components/sidebar-navigation-screen-unsupported/index.js.map +7 -1
  791. package/build-module/components/site-editor-routes/home.js +18 -26
  792. package/build-module/components/site-editor-routes/home.js.map +7 -1
  793. package/build-module/components/site-editor-routes/index.js +39 -30
  794. package/build-module/components/site-editor-routes/index.js.map +7 -1
  795. package/build-module/components/site-editor-routes/navigation-item.js +23 -43
  796. package/build-module/components/site-editor-routes/navigation-item.js.map +7 -1
  797. package/build-module/components/site-editor-routes/navigation.js +23 -43
  798. package/build-module/components/site-editor-routes/navigation.js.map +7 -1
  799. package/build-module/components/site-editor-routes/notfound.js +22 -28
  800. package/build-module/components/site-editor-routes/notfound.js.map +7 -1
  801. package/build-module/components/site-editor-routes/page-item.js +26 -35
  802. package/build-module/components/site-editor-routes/page-item.js.map +7 -1
  803. package/build-module/components/site-editor-routes/pages.js +64 -80
  804. package/build-module/components/site-editor-routes/pages.js.map +7 -1
  805. package/build-module/components/site-editor-routes/pattern-item.js +16 -20
  806. package/build-module/components/site-editor-routes/pattern-item.js.map +7 -1
  807. package/build-module/components/site-editor-routes/patterns.js +19 -30
  808. package/build-module/components/site-editor-routes/patterns.js.map +7 -1
  809. package/build-module/components/site-editor-routes/stylebook.js +28 -37
  810. package/build-module/components/site-editor-routes/stylebook.js.map +7 -1
  811. package/build-module/components/site-editor-routes/styles.js +26 -40
  812. package/build-module/components/site-editor-routes/styles.js.map +7 -1
  813. package/build-module/components/site-editor-routes/template-item.js +21 -28
  814. package/build-module/components/site-editor-routes/template-item.js.map +7 -1
  815. package/build-module/components/site-editor-routes/template-part-item.js +13 -15
  816. package/build-module/components/site-editor-routes/template-part-item.js.map +7 -1
  817. package/build-module/components/site-editor-routes/templates.js +37 -38
  818. package/build-module/components/site-editor-routes/templates.js.map +7 -1
  819. package/build-module/components/site-editor-routes/utils.js +6 -10
  820. package/build-module/components/site-editor-routes/utils.js.map +7 -1
  821. package/build-module/components/site-hub/index.js +204 -215
  822. package/build-module/components/site-hub/index.js.map +7 -1
  823. package/build-module/components/site-icon/index.js +33 -43
  824. package/build-module/components/site-icon/index.js.map +7 -1
  825. package/build-module/components/style-book/categories.js +41 -48
  826. package/build-module/components/style-book/categories.js.map +7 -1
  827. package/build-module/components/style-book/color-examples.js +29 -37
  828. package/build-module/components/style-book/color-examples.js.map +7 -1
  829. package/build-module/components/style-book/constants.js +191 -140
  830. package/build-module/components/style-book/constants.js.map +7 -1
  831. package/build-module/components/style-book/duotone-examples.js +36 -35
  832. package/build-module/components/style-book/duotone-examples.js.map +7 -1
  833. package/build-module/components/style-book/examples.js +114 -116
  834. package/build-module/components/style-book/examples.js.map +7 -1
  835. package/build-module/components/style-book/index.js +431 -384
  836. package/build-module/components/style-book/index.js.map +7 -1
  837. package/build-module/components/style-book/types.js +1 -2
  838. package/build-module/components/style-book/types.js.map +7 -1
  839. package/build-module/components/welcome-guide/editor.js +59 -54
  840. package/build-module/components/welcome-guide/editor.js.map +7 -1
  841. package/build-module/components/welcome-guide/image.js +16 -18
  842. package/build-module/components/welcome-guide/image.js.map +7 -1
  843. package/build-module/components/welcome-guide/index.js +16 -15
  844. package/build-module/components/welcome-guide/index.js.map +7 -1
  845. package/build-module/components/welcome-guide/page.js +59 -48
  846. package/build-module/components/welcome-guide/page.js.map +7 -1
  847. package/build-module/components/welcome-guide/styles.js +108 -97
  848. package/build-module/components/welcome-guide/styles.js.map +7 -1
  849. package/build-module/components/welcome-guide/template.js +54 -55
  850. package/build-module/components/welcome-guide/template.js.map +7 -1
  851. package/build-module/deprecated.js +28 -40
  852. package/build-module/deprecated.js.map +7 -1
  853. package/build-module/hooks/commands/use-common-commands.js +89 -108
  854. package/build-module/hooks/commands/use-common-commands.js.map +7 -1
  855. package/build-module/hooks/commands/use-set-command-context.js +21 -44
  856. package/build-module/hooks/commands/use-set-command-context.js.map +7 -1
  857. package/build-module/hooks/index.js +2 -5
  858. package/build-module/hooks/index.js.map +7 -1
  859. package/build-module/hooks/push-changes-to-global-styles/index.js +218 -243
  860. package/build-module/hooks/push-changes-to-global-styles/index.js.map +7 -1
  861. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +56 -105
  862. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +7 -1
  863. package/build-module/index.js +55 -69
  864. package/build-module/index.js.map +7 -1
  865. package/build-module/lock-unlock.js +8 -7
  866. package/build-module/lock-unlock.js.map +7 -1
  867. package/build-module/posts.js +38 -54
  868. package/build-module/posts.js.map +7 -1
  869. package/build-module/store/actions.js +140 -320
  870. package/build-module/store/actions.js.map +7 -1
  871. package/build-module/store/constants.js +5 -7
  872. package/build-module/store/constants.js.map +7 -1
  873. package/build-module/store/index.js +15 -18
  874. package/build-module/store/index.js.map +7 -1
  875. package/build-module/store/private-actions.js +12 -14
  876. package/build-module/store/private-actions.js.map +7 -1
  877. package/build-module/store/private-selectors.js +7 -10
  878. package/build-module/store/private-selectors.js.map +7 -1
  879. package/build-module/store/reducer.js +21 -53
  880. package/build-module/store/reducer.js.map +7 -1
  881. package/build-module/store/selectors.js +151 -278
  882. package/build-module/store/selectors.js.map +7 -1
  883. package/build-module/utils/constants.js +53 -44
  884. package/build-module/utils/constants.js.map +7 -1
  885. package/build-module/utils/get-filtered-template-parts.js +18 -37
  886. package/build-module/utils/get-filtered-template-parts.js.map +7 -1
  887. package/build-module/utils/is-previewing-theme.js +10 -9
  888. package/build-module/utils/is-previewing-theme.js.map +7 -1
  889. package/build-module/utils/is-template-removable.js +6 -13
  890. package/build-module/utils/is-template-removable.js.map +7 -1
  891. package/build-module/utils/is-template-revertable.js +6 -15
  892. package/build-module/utils/is-template-revertable.js.map +7 -1
  893. package/build-module/utils/set-nested-value.js +7 -22
  894. package/build-module/utils/set-nested-value.js.map +7 -1
  895. package/build-module/utils/template-part-create.js +1 -2
  896. package/build-module/utils/template-part-create.js.map +7 -1
  897. package/build-module/utils/use-activate-theme.js +21 -40
  898. package/build-module/utils/use-activate-theme.js.map +7 -1
  899. package/build-module/utils/use-actual-current-theme.js +13 -17
  900. package/build-module/utils/use-actual-current-theme.js.map +7 -1
  901. package/build-style/posts-rtl.css +484 -214
  902. package/build-style/posts.css +484 -214
  903. package/build-style/style-rtl.css +629 -271
  904. package/build-style/style.css +629 -271
  905. package/package.json +52 -42
  906. package/src/components/add-new-template/index.js +5 -3
  907. package/src/components/add-new-template/style.scss +4 -0
  908. package/src/components/dataviews-actions/index.js +16 -9
  909. package/src/components/editor/style.scss +3 -0
  910. package/src/components/editor/use-resolve-edited-entity.js +4 -18
  911. package/src/components/editor-canvas-container/style.scss +4 -1
  912. package/src/components/global-styles/font-library-modal/style.scss +4 -0
  913. package/src/components/global-styles/screen-revisions/style.scss +4 -0
  914. package/src/components/global-styles/style.scss +3 -0
  915. package/src/components/global-styles/variations/style.scss +3 -0
  916. package/src/components/global-styles-sidebar/style.scss +3 -0
  917. package/src/components/layout/index.js +2 -1
  918. package/src/components/layout/style.scss +5 -0
  919. package/src/components/page-patterns/actions.js +54 -0
  920. package/src/components/page-patterns/index.js +79 -32
  921. package/src/components/page-patterns/style.scss +4 -0
  922. package/src/components/page-templates/fields.js +22 -1
  923. package/src/components/page-templates/index.js +71 -104
  924. package/src/components/page-templates/style.scss +4 -0
  925. package/src/components/page-templates/view-utils.js +41 -0
  926. package/src/components/pagination/style.scss +2 -0
  927. package/src/components/post-edit/index.js +4 -3
  928. package/src/components/post-edit/style.scss +3 -6
  929. package/src/components/post-list/index.js +76 -188
  930. package/src/components/post-list/style.scss +3 -0
  931. package/src/components/post-list/view-utils.js +155 -0
  932. package/src/components/posts-app-routes/posts.js +29 -16
  933. package/src/components/resizable-frame/style.scss +3 -0
  934. package/src/components/save-hub/style.scss +3 -0
  935. package/src/components/save-panel/index.js +2 -2
  936. package/src/components/save-panel/style.scss +2 -0
  937. package/src/components/sidebar/style.scss +4 -0
  938. package/src/components/sidebar-button/style.scss +2 -0
  939. package/src/components/sidebar-dataviews/dataview-item.js +5 -11
  940. package/src/components/sidebar-dataviews/index.js +17 -17
  941. package/src/components/sidebar-dataviews/style.scss +2 -16
  942. package/src/components/sidebar-global-styles-wrapper/index.js +16 -21
  943. package/src/components/sidebar-global-styles-wrapper/style.scss +4 -30
  944. package/src/components/sidebar-navigation-item/style.scss +3 -0
  945. package/src/components/sidebar-navigation-screen/style.scss +5 -0
  946. package/src/components/sidebar-navigation-screen-main/style.scss +2 -0
  947. package/src/components/sidebar-navigation-screen-navigation-menu/style.scss +2 -0
  948. package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +3 -0
  949. package/src/components/sidebar-navigation-screen-patterns/style.scss +3 -0
  950. package/src/components/sidebar-navigation-screen-templates-browse/style.scss +2 -0
  951. package/src/components/site-editor-routes/pages.js +29 -16
  952. package/src/components/site-editor-routes/templates.js +21 -4
  953. package/src/components/site-hub/style.scss +3 -0
  954. package/src/components/site-icon/style.scss +3 -0
  955. package/src/components/style-book/style.scss +3 -0
  956. package/src/components/welcome-guide/style.scss +2 -0
  957. package/src/posts.scss +14 -11
  958. package/src/style.scss +42 -39
  959. package/tsconfig.json +2 -0
  960. package/tsconfig.tsbuildinfo +1 -1
  961. package/build/components/page/header.js +0 -45
  962. package/build/components/page/header.js.map +0 -1
  963. package/build/components/page/index.js +0 -50
  964. package/build/components/page/index.js.map +0 -1
  965. package/build/components/page-patterns/header.js +0 -96
  966. package/build/components/page-patterns/header.js.map +0 -1
  967. package/build/components/sidebar-dataviews/add-new-view.js +0 -137
  968. package/build/components/sidebar-dataviews/add-new-view.js.map +0 -1
  969. package/build/components/sidebar-dataviews/custom-dataviews-list.js +0 -211
  970. package/build/components/sidebar-dataviews/custom-dataviews-list.js.map +0 -1
  971. package/build/components/sidebar-dataviews/default-views.js +0 -141
  972. package/build/components/sidebar-dataviews/default-views.js.map +0 -1
  973. package/build-module/components/page/header.js +0 -40
  974. package/build-module/components/page/header.js.map +0 -1
  975. package/build-module/components/page/index.js +0 -42
  976. package/build-module/components/page/index.js.map +0 -1
  977. package/build-module/components/page-patterns/header.js +0 -88
  978. package/build-module/components/page-patterns/header.js.map +0 -1
  979. package/build-module/components/sidebar-dataviews/add-new-view.js +0 -129
  980. package/build-module/components/sidebar-dataviews/add-new-view.js.map +0 -1
  981. package/build-module/components/sidebar-dataviews/custom-dataviews-list.js +0 -202
  982. package/build-module/components/sidebar-dataviews/custom-dataviews-list.js.map +0 -1
  983. package/build-module/components/sidebar-dataviews/default-views.js +0 -133
  984. package/build-module/components/sidebar-dataviews/default-views.js.map +0 -1
  985. package/src/components/page/header.js +0 -44
  986. package/src/components/page/index.js +0 -43
  987. package/src/components/page/style.scss +0 -56
  988. package/src/components/page-patterns/header.js +0 -120
  989. package/src/components/sidebar-dataviews/add-new-view.js +0 -143
  990. package/src/components/sidebar-dataviews/custom-dataviews-list.js +0 -233
  991. package/src/components/sidebar-dataviews/default-views.js +0 -168
@@ -1 +1,7 @@
1
- {"version":3,"names":["addFilter","createHigherOrderComponent","InspectorAdvancedControls","store","blockEditorStore","privateApis","blockEditorPrivateApis","useBlockEditingMode","BaseControl","Button","__","sprintf","__EXPERIMENTAL_STYLE_PROPERTY","getBlockType","hasBlockSupport","useContext","useMemo","useCallback","useDispatch","useSelect","noticesStore","coreStore","useSupportedStyles","unlock","setNestedValue","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","cleanEmptyObject","GlobalStylesContext","STYLE_PROPERTY","blockGap","value","STYLE_PATH_TO_CSS_VAR_INFIX","STYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE","SUPPORTED_STYLES","getValueFromObjectPath","object","path","forEach","fieldName","flatBorderProperties","sides","getBorderStyleChanges","border","presetColor","userStyle","changes","getFallbackBorderStyleChange","color","customColor","style","width","hasColorOrWidth","side","push","globalBorderStyle","useChangesToPush","name","attributes","userConfig","supports","blockUserConfig","styles","blocks","flatMap","key","presetAttributeKey","join","presetAttributeValue","linkChanges","hoverPath","hoverValue","includes","borderChanges","currentPath","splice","borderColor","change","PushChangesToGlobalStylesControl","setAttributes","user","setUserConfig","__unstableMarkNextChangeAsNotPersistent","createSuccessNotice","pushChanges","length","blockStyles","newBlockStyles","structuredClone","newUserConfig","undefined","newBlockAttributes","backgroundColor","textColor","gradient","fontSize","fontFamily","undoIgnore","title","type","actions","label","onClick","__nextHasNoMarginBottom","className","help","children","VisualLabel","__next40pxDefaultSize","variant","accessibleWhenDisabled","disabled","PushChangesToGlobalStyles","props","blockEditingMode","isBlockBasedTheme","select","getCurrentTheme","is_block_theme","supportsStyles","some","feature","isDisplayed","withPushChangesToGlobalStyles","BlockEdit","isSelected"],"sources":["@wordpress/edit-site/src/hooks/push-changes-to-global-styles/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport {\n\tInspectorAdvancedControls,\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n\tuseBlockEditingMode,\n} from '@wordpress/block-editor';\nimport { BaseControl, Button } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\t__EXPERIMENTAL_STYLE_PROPERTY,\n\tgetBlockType,\n\thasBlockSupport,\n} from '@wordpress/blocks';\nimport { useContext, useMemo, useCallback } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { useSupportedStyles } from '../../components/global-styles/hooks';\nimport { unlock } from '../../lock-unlock';\nimport setNestedValue from '../../utils/set-nested-value';\n\nconst { cleanEmptyObject, GlobalStylesContext } = unlock(\n\tblockEditorPrivateApis\n);\n\n// Block Gap is a special case and isn't defined within the blocks\n// style properties config. We'll add it here to allow it to be pushed\n// to global styles as well.\nconst STYLE_PROPERTY = {\n\t...__EXPERIMENTAL_STYLE_PROPERTY,\n\tblockGap: { value: [ 'spacing', 'blockGap' ] },\n};\n\n// TODO: Temporary duplication of constant in @wordpress/block-editor. Can be\n// removed by moving PushChangesToGlobalStylesControl to\n// @wordpress/block-editor.\nconst STYLE_PATH_TO_CSS_VAR_INFIX = {\n\t'border.color': 'color',\n\t'color.background': 'color',\n\t'color.text': 'color',\n\t'elements.link.color.text': 'color',\n\t'elements.link.:hover.color.text': 'color',\n\t'elements.link.typography.fontFamily': 'font-family',\n\t'elements.link.typography.fontSize': 'font-size',\n\t'elements.button.color.text': 'color',\n\t'elements.button.color.background': 'color',\n\t'elements.button.typography.fontFamily': 'font-family',\n\t'elements.button.typography.fontSize': 'font-size',\n\t'elements.caption.color.text': 'color',\n\t'elements.heading.color': 'color',\n\t'elements.heading.color.background': 'color',\n\t'elements.heading.typography.fontFamily': 'font-family',\n\t'elements.heading.gradient': 'gradient',\n\t'elements.heading.color.gradient': 'gradient',\n\t'elements.h1.color': 'color',\n\t'elements.h1.color.background': 'color',\n\t'elements.h1.typography.fontFamily': 'font-family',\n\t'elements.h1.color.gradient': 'gradient',\n\t'elements.h2.color': 'color',\n\t'elements.h2.color.background': 'color',\n\t'elements.h2.typography.fontFamily': 'font-family',\n\t'elements.h2.color.gradient': 'gradient',\n\t'elements.h3.color': 'color',\n\t'elements.h3.color.background': 'color',\n\t'elements.h3.typography.fontFamily': 'font-family',\n\t'elements.h3.color.gradient': 'gradient',\n\t'elements.h4.color': 'color',\n\t'elements.h4.color.background': 'color',\n\t'elements.h4.typography.fontFamily': 'font-family',\n\t'elements.h4.color.gradient': 'gradient',\n\t'elements.h5.color': 'color',\n\t'elements.h5.color.background': 'color',\n\t'elements.h5.typography.fontFamily': 'font-family',\n\t'elements.h5.color.gradient': 'gradient',\n\t'elements.h6.color': 'color',\n\t'elements.h6.color.background': 'color',\n\t'elements.h6.typography.fontFamily': 'font-family',\n\t'elements.h6.color.gradient': 'gradient',\n\t'color.gradient': 'gradient',\n\tblockGap: 'spacing',\n\t'typography.fontSize': 'font-size',\n\t'typography.fontFamily': 'font-family',\n};\n\n// TODO: Temporary duplication of constant in @wordpress/block-editor. Can be\n// removed by moving PushChangesToGlobalStylesControl to\n// @wordpress/block-editor.\nconst STYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE = {\n\t'border.color': 'borderColor',\n\t'color.background': 'backgroundColor',\n\t'color.text': 'textColor',\n\t'color.gradient': 'gradient',\n\t'typography.fontSize': 'fontSize',\n\t'typography.fontFamily': 'fontFamily',\n};\n\nconst SUPPORTED_STYLES = [ 'border', 'color', 'spacing', 'typography' ];\n\nconst getValueFromObjectPath = ( object, path ) => {\n\tlet value = object;\n\tpath.forEach( ( fieldName ) => {\n\t\tvalue = value?.[ fieldName ];\n\t} );\n\treturn value;\n};\n\nconst flatBorderProperties = [ 'borderColor', 'borderWidth', 'borderStyle' ];\nconst sides = [ 'top', 'right', 'bottom', 'left' ];\n\nfunction getBorderStyleChanges( border, presetColor, userStyle ) {\n\tif ( ! border && ! presetColor ) {\n\t\treturn [];\n\t}\n\n\tconst changes = [\n\t\t...getFallbackBorderStyleChange( 'top', border, userStyle ),\n\t\t...getFallbackBorderStyleChange( 'right', border, userStyle ),\n\t\t...getFallbackBorderStyleChange( 'bottom', border, userStyle ),\n\t\t...getFallbackBorderStyleChange( 'left', border, userStyle ),\n\t];\n\n\t// Handle a flat border i.e. all sides the same, CSS shorthand.\n\tconst { color: customColor, style, width } = border || {};\n\tconst hasColorOrWidth = presetColor || customColor || width;\n\n\tif ( hasColorOrWidth && ! style ) {\n\t\t// Global Styles need individual side configurations to overcome\n\t\t// theme.json configurations which are per side as well.\n\t\tsides.forEach( ( side ) => {\n\t\t\t// Only add fallback border-style if global styles don't already\n\t\t\t// have something set.\n\t\t\tif ( ! userStyle?.[ side ]?.style ) {\n\t\t\t\tchanges.push( {\n\t\t\t\t\tpath: [ 'border', side, 'style' ],\n\t\t\t\t\tvalue: 'solid',\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\t}\n\n\treturn changes;\n}\n\nfunction getFallbackBorderStyleChange( side, border, globalBorderStyle ) {\n\tif ( ! border?.[ side ] || globalBorderStyle?.[ side ]?.style ) {\n\t\treturn [];\n\t}\n\n\tconst { color, style, width } = border[ side ];\n\tconst hasColorOrWidth = color || width;\n\n\tif ( ! hasColorOrWidth || style ) {\n\t\treturn [];\n\t}\n\n\treturn [ { path: [ 'border', side, 'style' ], value: 'solid' } ];\n}\n\nfunction useChangesToPush( name, attributes, userConfig ) {\n\tconst supports = useSupportedStyles( name );\n\tconst blockUserConfig = userConfig?.styles?.blocks?.[ name ];\n\n\treturn useMemo( () => {\n\t\tconst changes = supports.flatMap( ( key ) => {\n\t\t\tif ( ! STYLE_PROPERTY[ key ] ) {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\tconst { value: path } = STYLE_PROPERTY[ key ];\n\t\t\tconst presetAttributeKey = path.join( '.' );\n\t\t\tconst presetAttributeValue =\n\t\t\t\tattributes[\n\t\t\t\t\tSTYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE[ presetAttributeKey ]\n\t\t\t\t];\n\t\t\tconst value = presetAttributeValue\n\t\t\t\t? `var:preset|${ STYLE_PATH_TO_CSS_VAR_INFIX[ presetAttributeKey ] }|${ presetAttributeValue }`\n\t\t\t\t: getValueFromObjectPath( attributes.style, path );\n\n\t\t\t// Links only have a single support entry but have two element\n\t\t\t// style properties, color and hover color. The following check\n\t\t\t// will add the hover color to the changes if required.\n\t\t\tif ( key === 'linkColor' ) {\n\t\t\t\tconst linkChanges = value ? [ { path, value } ] : [];\n\t\t\t\tconst hoverPath = [\n\t\t\t\t\t'elements',\n\t\t\t\t\t'link',\n\t\t\t\t\t':hover',\n\t\t\t\t\t'color',\n\t\t\t\t\t'text',\n\t\t\t\t];\n\t\t\t\tconst hoverValue = getValueFromObjectPath(\n\t\t\t\t\tattributes.style,\n\t\t\t\t\thoverPath\n\t\t\t\t);\n\n\t\t\t\tif ( hoverValue ) {\n\t\t\t\t\tlinkChanges.push( { path: hoverPath, value: hoverValue } );\n\t\t\t\t}\n\n\t\t\t\treturn linkChanges;\n\t\t\t}\n\n\t\t\t// The shorthand border styles can't be mapped directly as global\n\t\t\t// styles requires longhand config.\n\t\t\tif ( flatBorderProperties.includes( key ) && value ) {\n\t\t\t\t// The shorthand config path is included to clear the block attribute.\n\t\t\t\tconst borderChanges = [ { path, value } ];\n\t\t\t\tsides.forEach( ( side ) => {\n\t\t\t\t\tconst currentPath = [ ...path ];\n\t\t\t\t\tcurrentPath.splice( -1, 0, side );\n\t\t\t\t\tborderChanges.push( { path: currentPath, value } );\n\t\t\t\t} );\n\t\t\t\treturn borderChanges;\n\t\t\t}\n\n\t\t\treturn value ? [ { path, value } ] : [];\n\t\t} );\n\n\t\t// To ensure display of a visible border, global styles require a\n\t\t// default border style if a border color or width is present.\n\t\tgetBorderStyleChanges(\n\t\t\tattributes.style?.border,\n\t\t\tattributes.borderColor,\n\t\t\tblockUserConfig?.border\n\t\t).forEach( ( change ) => changes.push( change ) );\n\n\t\treturn changes;\n\t}, [ supports, attributes, blockUserConfig ] );\n}\n\nfunction PushChangesToGlobalStylesControl( {\n\tname,\n\tattributes,\n\tsetAttributes,\n} ) {\n\tconst { user: userConfig, setUserConfig } =\n\t\tuseContext( GlobalStylesContext );\n\n\tconst changes = useChangesToPush( name, attributes, userConfig );\n\n\tconst { __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\n\tconst pushChanges = useCallback( () => {\n\t\tif ( changes.length === 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( changes.length > 0 ) {\n\t\t\tconst { style: blockStyles } = attributes;\n\n\t\t\tconst newBlockStyles = structuredClone( blockStyles );\n\t\t\tconst newUserConfig = structuredClone( userConfig );\n\n\t\t\tfor ( const { path, value } of changes ) {\n\t\t\t\tsetNestedValue( newBlockStyles, path, undefined );\n\t\t\t\tsetNestedValue(\n\t\t\t\t\tnewUserConfig,\n\t\t\t\t\t[ 'styles', 'blocks', name, ...path ],\n\t\t\t\t\tvalue\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst newBlockAttributes = {\n\t\t\t\tborderColor: undefined,\n\t\t\t\tbackgroundColor: undefined,\n\t\t\t\ttextColor: undefined,\n\t\t\t\tgradient: undefined,\n\t\t\t\tfontSize: undefined,\n\t\t\t\tfontFamily: undefined,\n\t\t\t\tstyle: cleanEmptyObject( newBlockStyles ),\n\t\t\t};\n\n\t\t\t// @wordpress/core-data doesn't support editing multiple entity types in\n\t\t\t// a single undo level. So for now, we disable @wordpress/core-data undo\n\t\t\t// tracking and implement our own Undo button in the snackbar\n\t\t\t// notification.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( newBlockAttributes );\n\t\t\tsetUserConfig( newUserConfig, { undoIgnore: true } );\n\t\t\tcreateSuccessNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t// translators: %s: Title of the block e.g. 'Heading'.\n\t\t\t\t\t__( '%s styles applied.' ),\n\t\t\t\t\tgetBlockType( name ).title\n\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tactions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\tonClick() {\n\t\t\t\t\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\t\t\t\t\tsetAttributes( attributes );\n\t\t\t\t\t\t\t\tsetUserConfig( userConfig, {\n\t\t\t\t\t\t\t\t\tundoIgnore: true,\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\t}, [\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\tattributes,\n\t\tchanges,\n\t\tcreateSuccessNotice,\n\t\tname,\n\t\tsetAttributes,\n\t\tsetUserConfig,\n\t\tuserConfig,\n\t] );\n\n\treturn (\n\t\t<BaseControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\tclassName=\"edit-site-push-changes-to-global-styles-control\"\n\t\t\thelp={ sprintf(\n\t\t\t\t// translators: %s: Title of the block e.g. 'Heading'.\n\t\t\t\t__(\n\t\t\t\t\t'Apply this block’s typography, spacing, dimensions, and color styles to all %s blocks.'\n\t\t\t\t),\n\t\t\t\tgetBlockType( name ).title\n\t\t\t) }\n\t\t>\n\t\t\t<BaseControl.VisualLabel>\n\t\t\t\t{ __( 'Styles' ) }\n\t\t\t</BaseControl.VisualLabel>\n\t\t\t<Button\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\taccessibleWhenDisabled\n\t\t\t\tdisabled={ changes.length === 0 }\n\t\t\t\tonClick={ pushChanges }\n\t\t\t>\n\t\t\t\t{ __( 'Apply globally' ) }\n\t\t\t</Button>\n\t\t</BaseControl>\n\t);\n}\n\nfunction PushChangesToGlobalStyles( props ) {\n\tconst blockEditingMode = useBlockEditingMode();\n\tconst isBlockBasedTheme = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme()?.is_block_theme,\n\t\t[]\n\t);\n\tconst supportsStyles = SUPPORTED_STYLES.some( ( feature ) =>\n\t\thasBlockSupport( props.name, feature )\n\t);\n\tconst isDisplayed =\n\t\tblockEditingMode === 'default' && supportsStyles && isBlockBasedTheme;\n\n\tif ( ! isDisplayed ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<InspectorAdvancedControls>\n\t\t\t<PushChangesToGlobalStylesControl { ...props } />\n\t\t</InspectorAdvancedControls>\n\t);\n}\n\nconst withPushChangesToGlobalStyles = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => (\n\t\t<>\n\t\t\t<BlockEdit key=\"edit\" { ...props } />\n\t\t\t{ props.isSelected && <PushChangesToGlobalStyles { ...props } /> }\n\t\t</>\n\t)\n);\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/edit-site/push-changes-to-global-styles',\n\twithPushChangesToGlobalStyles\n);\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,0BAA0B,QAAQ,oBAAoB;AAC/D,SACCC,yBAAyB,EACzBC,KAAK,IAAIC,gBAAgB,EACzBC,WAAW,IAAIC,sBAAsB,EACrCC,mBAAmB,QACb,yBAAyB;AAChC,SAASC,WAAW,EAAEC,MAAM,QAAQ,uBAAuB;AAC3D,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SACCC,6BAA6B,EAC7BC,YAAY,EACZC,eAAe,QACT,mBAAmB;AAC1B,SAASC,UAAU,EAAEC,OAAO,EAAEC,WAAW,QAAQ,oBAAoB;AACrE,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAAShB,KAAK,IAAIiB,YAAY,QAAQ,oBAAoB;AAC1D,SAASjB,KAAK,IAAIkB,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASC,kBAAkB,QAAQ,sCAAsC;AACzE,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,cAAc,MAAM,8BAA8B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAE1D,MAAM;EAAEC,gBAAgB;EAAEC;AAAoB,CAAC,GAAGT,MAAM,CACvDjB,sBACD,CAAC;;AAED;AACA;AACA;AACA,MAAM2B,cAAc,GAAG;EACtB,GAAGrB,6BAA6B;EAChCsB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,EAAG;IACpB,OAAO,IAAI;EACZ;EAEA,oBACCpG,IAAA,CAACxB,yBAAyB;IAAA4G,QAAA,eACzBpF,IAAA,CAACwD,gCAAgC;MAAA,GAAMmC;IAAK,CAAI;EAAC,CACvB,CAAC;AAE9B;AAEA,MAAMU,6BAA6B,GAAG9H,0BAA0B,CAC7D+H,SAAS,IAAQX,KAAK,iBACvBzF,KAAA,CAAAE,SAAA;EAAAgF,QAAA,gBACCpF,IAAA,CAACsG,SAAS;IAAA,GAAiBX;EAAK,GAAjB,MAAqB,CAAC,EACnCA,KAAK,CAACY,UAAU,iBAAIvG,IAAA,CAAC0F,yBAAyB;IAAA,GAAMC;EAAK,CAAI,CAAC;AAAA,CAC/D,CAEJ,CAAC;AAEDrH,SAAS,CACR,kBAAkB,EAClB,8CAA8C,EAC9C+H,6BACD,CAAC","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/hooks/push-changes-to-global-styles/index.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport {\n\tInspectorAdvancedControls,\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n\tuseBlockEditingMode,\n} from '@wordpress/block-editor';\nimport { BaseControl, Button } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\t__EXPERIMENTAL_STYLE_PROPERTY,\n\tgetBlockType,\n\thasBlockSupport,\n} from '@wordpress/blocks';\nimport { useContext, useMemo, useCallback } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { useSupportedStyles } from '../../components/global-styles/hooks';\nimport { unlock } from '../../lock-unlock';\nimport setNestedValue from '../../utils/set-nested-value';\n\nconst { cleanEmptyObject, GlobalStylesContext } = unlock(\n\tblockEditorPrivateApis\n);\n\n// Block Gap is a special case and isn't defined within the blocks\n// style properties config. We'll add it here to allow it to be pushed\n// to global styles as well.\nconst STYLE_PROPERTY = {\n\t...__EXPERIMENTAL_STYLE_PROPERTY,\n\tblockGap: { value: [ 'spacing', 'blockGap' ] },\n};\n\n// TODO: Temporary duplication of constant in @wordpress/block-editor. Can be\n// removed by moving PushChangesToGlobalStylesControl to\n// @wordpress/block-editor.\nconst STYLE_PATH_TO_CSS_VAR_INFIX = {\n\t'border.color': 'color',\n\t'color.background': 'color',\n\t'color.text': 'color',\n\t'elements.link.color.text': 'color',\n\t'elements.link.:hover.color.text': 'color',\n\t'elements.link.typography.fontFamily': 'font-family',\n\t'elements.link.typography.fontSize': 'font-size',\n\t'elements.button.color.text': 'color',\n\t'elements.button.color.background': 'color',\n\t'elements.button.typography.fontFamily': 'font-family',\n\t'elements.button.typography.fontSize': 'font-size',\n\t'elements.caption.color.text': 'color',\n\t'elements.heading.color': 'color',\n\t'elements.heading.color.background': 'color',\n\t'elements.heading.typography.fontFamily': 'font-family',\n\t'elements.heading.gradient': 'gradient',\n\t'elements.heading.color.gradient': 'gradient',\n\t'elements.h1.color': 'color',\n\t'elements.h1.color.background': 'color',\n\t'elements.h1.typography.fontFamily': 'font-family',\n\t'elements.h1.color.gradient': 'gradient',\n\t'elements.h2.color': 'color',\n\t'elements.h2.color.background': 'color',\n\t'elements.h2.typography.fontFamily': 'font-family',\n\t'elements.h2.color.gradient': 'gradient',\n\t'elements.h3.color': 'color',\n\t'elements.h3.color.background': 'color',\n\t'elements.h3.typography.fontFamily': 'font-family',\n\t'elements.h3.color.gradient': 'gradient',\n\t'elements.h4.color': 'color',\n\t'elements.h4.color.background': 'color',\n\t'elements.h4.typography.fontFamily': 'font-family',\n\t'elements.h4.color.gradient': 'gradient',\n\t'elements.h5.color': 'color',\n\t'elements.h5.color.background': 'color',\n\t'elements.h5.typography.fontFamily': 'font-family',\n\t'elements.h5.color.gradient': 'gradient',\n\t'elements.h6.color': 'color',\n\t'elements.h6.color.background': 'color',\n\t'elements.h6.typography.fontFamily': 'font-family',\n\t'elements.h6.color.gradient': 'gradient',\n\t'color.gradient': 'gradient',\n\tblockGap: 'spacing',\n\t'typography.fontSize': 'font-size',\n\t'typography.fontFamily': 'font-family',\n};\n\n// TODO: Temporary duplication of constant in @wordpress/block-editor. Can be\n// removed by moving PushChangesToGlobalStylesControl to\n// @wordpress/block-editor.\nconst STYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE = {\n\t'border.color': 'borderColor',\n\t'color.background': 'backgroundColor',\n\t'color.text': 'textColor',\n\t'color.gradient': 'gradient',\n\t'typography.fontSize': 'fontSize',\n\t'typography.fontFamily': 'fontFamily',\n};\n\nconst SUPPORTED_STYLES = [ 'border', 'color', 'spacing', 'typography' ];\n\nconst getValueFromObjectPath = ( object, path ) => {\n\tlet value = object;\n\tpath.forEach( ( fieldName ) => {\n\t\tvalue = value?.[ fieldName ];\n\t} );\n\treturn value;\n};\n\nconst flatBorderProperties = [ 'borderColor', 'borderWidth', 'borderStyle' ];\nconst sides = [ 'top', 'right', 'bottom', 'left' ];\n\nfunction getBorderStyleChanges( border, presetColor, userStyle ) {\n\tif ( ! border && ! presetColor ) {\n\t\treturn [];\n\t}\n\n\tconst changes = [\n\t\t...getFallbackBorderStyleChange( 'top', border, userStyle ),\n\t\t...getFallbackBorderStyleChange( 'right', border, userStyle ),\n\t\t...getFallbackBorderStyleChange( 'bottom', border, userStyle ),\n\t\t...getFallbackBorderStyleChange( 'left', border, userStyle ),\n\t];\n\n\t// Handle a flat border i.e. all sides the same, CSS shorthand.\n\tconst { color: customColor, style, width } = border || {};\n\tconst hasColorOrWidth = presetColor || customColor || width;\n\n\tif ( hasColorOrWidth && ! style ) {\n\t\t// Global Styles need individual side configurations to overcome\n\t\t// theme.json configurations which are per side as well.\n\t\tsides.forEach( ( side ) => {\n\t\t\t// Only add fallback border-style if global styles don't already\n\t\t\t// have something set.\n\t\t\tif ( ! userStyle?.[ side ]?.style ) {\n\t\t\t\tchanges.push( {\n\t\t\t\t\tpath: [ 'border', side, 'style' ],\n\t\t\t\t\tvalue: 'solid',\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\t}\n\n\treturn changes;\n}\n\nfunction getFallbackBorderStyleChange( side, border, globalBorderStyle ) {\n\tif ( ! border?.[ side ] || globalBorderStyle?.[ side ]?.style ) {\n\t\treturn [];\n\t}\n\n\tconst { color, style, width } = border[ side ];\n\tconst hasColorOrWidth = color || width;\n\n\tif ( ! hasColorOrWidth || style ) {\n\t\treturn [];\n\t}\n\n\treturn [ { path: [ 'border', side, 'style' ], value: 'solid' } ];\n}\n\nfunction useChangesToPush( name, attributes, userConfig ) {\n\tconst supports = useSupportedStyles( name );\n\tconst blockUserConfig = userConfig?.styles?.blocks?.[ name ];\n\n\treturn useMemo( () => {\n\t\tconst changes = supports.flatMap( ( key ) => {\n\t\t\tif ( ! STYLE_PROPERTY[ key ] ) {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\tconst { value: path } = STYLE_PROPERTY[ key ];\n\t\t\tconst presetAttributeKey = path.join( '.' );\n\t\t\tconst presetAttributeValue =\n\t\t\t\tattributes[\n\t\t\t\t\tSTYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE[ presetAttributeKey ]\n\t\t\t\t];\n\t\t\tconst value = presetAttributeValue\n\t\t\t\t? `var:preset|${ STYLE_PATH_TO_CSS_VAR_INFIX[ presetAttributeKey ] }|${ presetAttributeValue }`\n\t\t\t\t: getValueFromObjectPath( attributes.style, path );\n\n\t\t\t// Links only have a single support entry but have two element\n\t\t\t// style properties, color and hover color. The following check\n\t\t\t// will add the hover color to the changes if required.\n\t\t\tif ( key === 'linkColor' ) {\n\t\t\t\tconst linkChanges = value ? [ { path, value } ] : [];\n\t\t\t\tconst hoverPath = [\n\t\t\t\t\t'elements',\n\t\t\t\t\t'link',\n\t\t\t\t\t':hover',\n\t\t\t\t\t'color',\n\t\t\t\t\t'text',\n\t\t\t\t];\n\t\t\t\tconst hoverValue = getValueFromObjectPath(\n\t\t\t\t\tattributes.style,\n\t\t\t\t\thoverPath\n\t\t\t\t);\n\n\t\t\t\tif ( hoverValue ) {\n\t\t\t\t\tlinkChanges.push( { path: hoverPath, value: hoverValue } );\n\t\t\t\t}\n\n\t\t\t\treturn linkChanges;\n\t\t\t}\n\n\t\t\t// The shorthand border styles can't be mapped directly as global\n\t\t\t// styles requires longhand config.\n\t\t\tif ( flatBorderProperties.includes( key ) && value ) {\n\t\t\t\t// The shorthand config path is included to clear the block attribute.\n\t\t\t\tconst borderChanges = [ { path, value } ];\n\t\t\t\tsides.forEach( ( side ) => {\n\t\t\t\t\tconst currentPath = [ ...path ];\n\t\t\t\t\tcurrentPath.splice( -1, 0, side );\n\t\t\t\t\tborderChanges.push( { path: currentPath, value } );\n\t\t\t\t} );\n\t\t\t\treturn borderChanges;\n\t\t\t}\n\n\t\t\treturn value ? [ { path, value } ] : [];\n\t\t} );\n\n\t\t// To ensure display of a visible border, global styles require a\n\t\t// default border style if a border color or width is present.\n\t\tgetBorderStyleChanges(\n\t\t\tattributes.style?.border,\n\t\t\tattributes.borderColor,\n\t\t\tblockUserConfig?.border\n\t\t).forEach( ( change ) => changes.push( change ) );\n\n\t\treturn changes;\n\t}, [ supports, attributes, blockUserConfig ] );\n}\n\nfunction PushChangesToGlobalStylesControl( {\n\tname,\n\tattributes,\n\tsetAttributes,\n} ) {\n\tconst { user: userConfig, setUserConfig } =\n\t\tuseContext( GlobalStylesContext );\n\n\tconst changes = useChangesToPush( name, attributes, userConfig );\n\n\tconst { __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\n\tconst pushChanges = useCallback( () => {\n\t\tif ( changes.length === 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( changes.length > 0 ) {\n\t\t\tconst { style: blockStyles } = attributes;\n\n\t\t\tconst newBlockStyles = structuredClone( blockStyles );\n\t\t\tconst newUserConfig = structuredClone( userConfig );\n\n\t\t\tfor ( const { path, value } of changes ) {\n\t\t\t\tsetNestedValue( newBlockStyles, path, undefined );\n\t\t\t\tsetNestedValue(\n\t\t\t\t\tnewUserConfig,\n\t\t\t\t\t[ 'styles', 'blocks', name, ...path ],\n\t\t\t\t\tvalue\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst newBlockAttributes = {\n\t\t\t\tborderColor: undefined,\n\t\t\t\tbackgroundColor: undefined,\n\t\t\t\ttextColor: undefined,\n\t\t\t\tgradient: undefined,\n\t\t\t\tfontSize: undefined,\n\t\t\t\tfontFamily: undefined,\n\t\t\t\tstyle: cleanEmptyObject( newBlockStyles ),\n\t\t\t};\n\n\t\t\t// @wordpress/core-data doesn't support editing multiple entity types in\n\t\t\t// a single undo level. So for now, we disable @wordpress/core-data undo\n\t\t\t// tracking and implement our own Undo button in the snackbar\n\t\t\t// notification.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( newBlockAttributes );\n\t\t\tsetUserConfig( newUserConfig, { undoIgnore: true } );\n\t\t\tcreateSuccessNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t// translators: %s: Title of the block e.g. 'Heading'.\n\t\t\t\t\t__( '%s styles applied.' ),\n\t\t\t\t\tgetBlockType( name ).title\n\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tactions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\tonClick() {\n\t\t\t\t\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\t\t\t\t\tsetAttributes( attributes );\n\t\t\t\t\t\t\t\tsetUserConfig( userConfig, {\n\t\t\t\t\t\t\t\t\tundoIgnore: true,\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\t}, [\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\tattributes,\n\t\tchanges,\n\t\tcreateSuccessNotice,\n\t\tname,\n\t\tsetAttributes,\n\t\tsetUserConfig,\n\t\tuserConfig,\n\t] );\n\n\treturn (\n\t\t<BaseControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\tclassName=\"edit-site-push-changes-to-global-styles-control\"\n\t\t\thelp={ sprintf(\n\t\t\t\t// translators: %s: Title of the block e.g. 'Heading'.\n\t\t\t\t__(\n\t\t\t\t\t'Apply this block\u2019s typography, spacing, dimensions, and color styles to all %s blocks.'\n\t\t\t\t),\n\t\t\t\tgetBlockType( name ).title\n\t\t\t) }\n\t\t>\n\t\t\t<BaseControl.VisualLabel>\n\t\t\t\t{ __( 'Styles' ) }\n\t\t\t</BaseControl.VisualLabel>\n\t\t\t<Button\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\taccessibleWhenDisabled\n\t\t\t\tdisabled={ changes.length === 0 }\n\t\t\t\tonClick={ pushChanges }\n\t\t\t>\n\t\t\t\t{ __( 'Apply globally' ) }\n\t\t\t</Button>\n\t\t</BaseControl>\n\t);\n}\n\nfunction PushChangesToGlobalStyles( props ) {\n\tconst blockEditingMode = useBlockEditingMode();\n\tconst isBlockBasedTheme = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme()?.is_block_theme,\n\t\t[]\n\t);\n\tconst supportsStyles = SUPPORTED_STYLES.some( ( feature ) =>\n\t\thasBlockSupport( props.name, feature )\n\t);\n\tconst isDisplayed =\n\t\tblockEditingMode === 'default' && supportsStyles && isBlockBasedTheme;\n\n\tif ( ! isDisplayed ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<InspectorAdvancedControls>\n\t\t\t<PushChangesToGlobalStylesControl { ...props } />\n\t\t</InspectorAdvancedControls>\n\t);\n}\n\nconst withPushChangesToGlobalStyles = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => (\n\t\t<>\n\t\t\t<BlockEdit key=\"edit\" { ...props } />\n\t\t\t{ props.isSelected && <PushChangesToGlobalStyles { ...props } /> }\n\t\t</>\n\t)\n);\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/edit-site/push-changes-to-global-styles',\n\twithPushChangesToGlobalStyles\n);\n"],
5
+ "mappings": "AAoUE,SAoDA,UAzCC,KAXD;AAjUF,SAAS,iBAAiB;AAC1B,SAAS,kCAAkC;AAC3C;AAAA,EACC;AAAA,EACA,SAAS;AAAA,EACT,eAAe;AAAA,EACf;AAAA,OACM;AACP,SAAS,aAAa,cAAc;AACpC,SAAS,IAAI,eAAe;AAC5B;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,YAAY,SAAS,mBAAmB;AACjD,SAAS,aAAa,iBAAiB;AACvC,SAAS,SAAS,oBAAoB;AACtC,SAAS,SAAS,iBAAiB;AAKnC,SAAS,0BAA0B;AACnC,SAAS,cAAc;AACvB,OAAO,oBAAoB;AAE3B,MAAM,EAAE,kBAAkB,oBAAoB,IAAI;AAAA,EACjD;AACD;AAKA,MAAM,iBAAiB;AAAA,EACtB,GAAG;AAAA,EACH,UAAU,EAAE,OAAO,CAAE,WAAW,UAAW,EAAE;AAC9C;AAKA,MAAM,8BAA8B;AAAA,EACnC,gBAAgB;AAAA,EAChB,oBAAoB;AAAA,EACpB,cAAc;AAAA,EACd,4BAA4B;AAAA,EAC5B,mCAAmC;AAAA,EACnC,uCAAuC;AAAA,EACvC,qCAAqC;AAAA,EACrC,8BAA8B;AAAA,EAC9B,oCAAoC;AAAA,EACpC,yCAAyC;AAAA,EACzC,uCAAuC;AAAA,EACvC,+BAA+B;AAAA,EAC/B,0BAA0B;AAAA,EAC1B,qCAAqC;AAAA,EACrC,0CAA0C;AAAA,EAC1C,6BAA6B;AAAA,EAC7B,mCAAmC;AAAA,EACnC,qBAAqB;AAAA,EACrB,gCAAgC;AAAA,EAChC,qCAAqC;AAAA,EACrC,8BAA8B;AA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E;AAAA,MACtB;AAAA,MAEA;AAAA,4BAAC,YAAY,aAAZ,EACE,aAAI,QAAS,GAChB;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACA,uBAAqB;AAAA,YACrB,SAAQ;AAAA,YACR,wBAAsB;AAAA,YACtB,UAAW,QAAQ,WAAW;AAAA,YAC9B,SAAU;AAAA,YAER,aAAI,gBAAiB;AAAA;AAAA,QACxB;AAAA;AAAA;AAAA,EACD;AAEF;AAEA,SAAS,0BAA2B,OAAQ;AAC3C,QAAM,mBAAmB,oBAAoB;AAC7C,QAAM,oBAAoB;AAAA,IACzB,CAAE,WAAY,OAAQ,SAAU,EAAE,gBAAgB,GAAG;AAAA,IACrD,CAAC;AAAA,EACF;AACA,QAAM,iBAAiB,iBAAiB;AAAA,IAAM,CAAE,YAC/C,gBAAiB,MAAM,MAAM,OAAQ;AAAA,EACtC;AACA,QAAM,cACL,qBAAqB,aAAa,kBAAkB;AAErD,MAAK,CAAE,aAAc;AACpB,WAAO;AAAA,EACR;AAEA,SACC,oBAAC,6BACA,8BAAC,oCAAmC,GAAG,OAAQ,GAChD;AAEF;AAEA,MAAM,gCAAgC;AAAA,EACrC,CAAE,cAAe,CAAE,UAClB,iCACC;AAAA,wBAAC,aAAuB,GAAG,SAAZ,MAAoB;AAAA,IACjC,MAAM,cAAc,oBAAC,6BAA4B,GAAG,OAAQ;AAAA,KAC/D;AAEF;AAEA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AACD;",
6
+ "names": []
7
+ }
@@ -1,130 +1,81 @@
1
- /* wp:polyfill */
2
- /**
3
- * WordPress dependencies
4
- */
5
- import { useSelect } from '@wordpress/data';
6
- import { store as coreStore } from '@wordpress/core-data';
7
- import { useContext, useMemo } from '@wordpress/element';
8
- import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
9
- import { privateApis as editorPrivateApis } from '@wordpress/editor';
10
- import { __ } from '@wordpress/i18n';
11
-
12
- /**
13
- * Internal dependencies
14
- */
15
- import { unlock } from '../../lock-unlock';
1
+ import { useSelect } from "@wordpress/data";
2
+ import { store as coreStore } from "@wordpress/core-data";
3
+ import { useContext, useMemo } from "@wordpress/element";
4
+ import { privateApis as blockEditorPrivateApis } from "@wordpress/block-editor";
5
+ import { privateApis as editorPrivateApis } from "@wordpress/editor";
6
+ import { __ } from "@wordpress/i18n";
7
+ import { unlock } from "../../lock-unlock";
16
8
  const EMPTY_ARRAY = [];
17
- const {
18
- GlobalStylesContext,
19
- areGlobalStyleConfigsEqual
20
- } = unlock(blockEditorPrivateApis);
21
- const {
22
- mergeBaseAndUserConfigs
23
- } = unlock(editorPrivateApis);
24
-
25
- /**
26
- * Removes all instances of properties from an object.
27
- *
28
- * @param {Object} object The object to remove the properties from.
29
- * @param {string[]} properties The properties to remove.
30
- * @return {Object} The modified object.
31
- */
32
- export function removePropertiesFromObject(object, properties) {
9
+ const { GlobalStylesContext, areGlobalStyleConfigsEqual } = unlock(
10
+ blockEditorPrivateApis
11
+ );
12
+ const { mergeBaseAndUserConfigs } = unlock(editorPrivateApis);
13
+ function removePropertiesFromObject(object, properties) {
33
14
  if (!properties?.length) {
34
15
  return object;
35
16
  }
36
- if (typeof object !== 'object' || !object || !Object.keys(object).length) {
17
+ if (typeof object !== "object" || !object || !Object.keys(object).length) {
37
18
  return object;
38
19
  }
39
20
  for (const key in object) {
40
21
  if (properties.includes(key)) {
41
22
  delete object[key];
42
- } else if (typeof object[key] === 'object') {
23
+ } else if (typeof object[key] === "object") {
43
24
  removePropertiesFromObject(object[key], properties);
44
25
  }
45
26
  }
46
27
  return object;
47
28
  }
48
-
49
- /**
50
- * Checks whether a style variation is empty.
51
- *
52
- * @param {Object} variation A style variation object.
53
- * @param {string} variation.title The title of the variation.
54
- * @param {Object} variation.settings The settings of the variation.
55
- * @param {Object} variation.styles The styles of the variation.
56
- * @return {boolean} Whether the variation is empty.
57
- */
58
- function hasThemeVariation({
59
- title,
60
- settings,
61
- styles
62
- }) {
63
- return title === __('Default') ||
64
- // Always preserve the default variation.
29
+ function hasThemeVariation({ title, settings, styles }) {
30
+ return title === __("Default") || // Always preserve the default variation.
65
31
  Object.keys(settings).length > 0 || Object.keys(styles).length > 0;
66
32
  }
67
-
68
- /**
69
- * Fetches the current theme style variations that contain only the specified properties
70
- * and merges them with the user config.
71
- *
72
- * @param {string[]} properties The properties to filter by.
73
- * @return {Object[]|*} The merged object.
74
- */
75
- export function useCurrentMergeThemeStyleVariationsWithUserConfig(properties = []) {
76
- const {
77
- variationsFromTheme
78
- } = useSelect(select => {
79
- const _variationsFromTheme = select(coreStore).__experimentalGetCurrentThemeGlobalStylesVariations();
33
+ function useCurrentMergeThemeStyleVariationsWithUserConfig(properties = []) {
34
+ const { variationsFromTheme } = useSelect((select) => {
35
+ const _variationsFromTheme = select(
36
+ coreStore
37
+ ).__experimentalGetCurrentThemeGlobalStylesVariations();
80
38
  return {
81
39
  variationsFromTheme: _variationsFromTheme || EMPTY_ARRAY
82
40
  };
83
41
  }, []);
84
- const {
85
- user: userVariation
86
- } = useContext(GlobalStylesContext);
42
+ const { user: userVariation } = useContext(GlobalStylesContext);
87
43
  const propertiesAsString = properties.toString();
88
44
  return useMemo(() => {
89
45
  const clonedUserVariation = structuredClone(userVariation);
90
-
91
- // Get user variation and remove the settings for the given property.
92
- const userVariationWithoutProperties = removePropertiesFromObject(clonedUserVariation, properties);
93
- userVariationWithoutProperties.title = __('Default');
94
- const variationsWithPropertiesAndBase = variationsFromTheme.filter(variation => {
46
+ const userVariationWithoutProperties = removePropertiesFromObject(
47
+ clonedUserVariation,
48
+ properties
49
+ );
50
+ userVariationWithoutProperties.title = __("Default");
51
+ const variationsWithPropertiesAndBase = variationsFromTheme.filter((variation) => {
95
52
  return isVariationWithProperties(variation, properties);
96
- }).map(variation => {
97
- return mergeBaseAndUserConfigs(userVariationWithoutProperties, variation);
53
+ }).map((variation) => {
54
+ return mergeBaseAndUserConfigs(
55
+ userVariationWithoutProperties,
56
+ variation
57
+ );
98
58
  });
99
- const variationsByProperties = [userVariationWithoutProperties, ...variationsWithPropertiesAndBase];
100
-
101
- /*
102
- * Filter out variations with no settings or styles.
103
- */
59
+ const variationsByProperties = [
60
+ userVariationWithoutProperties,
61
+ ...variationsWithPropertiesAndBase
62
+ ];
104
63
  return variationsByProperties?.length ? variationsByProperties.filter(hasThemeVariation) : [];
105
64
  }, [propertiesAsString, userVariation, variationsFromTheme]);
106
65
  }
107
-
108
- /**
109
- * Returns a new object, with properties specified in `properties` array.,
110
- * maintain the original object tree structure.
111
- * The function is recursive, so it will perform a deep search for the given properties.
112
- * E.g., the function will return `{ a: { b: { c: { test: 1 } } } }` if the properties are `[ 'test' ]`.
113
- *
114
- * @param {Object} object The object to filter
115
- * @param {string[]} properties The properties to filter by
116
- * @return {Object} The merged object.
117
- */
118
- export const filterObjectByProperties = (object, properties) => {
66
+ const filterObjectByProperties = (object, properties) => {
119
67
  if (!object || !properties?.length) {
120
68
  return {};
121
69
  }
122
70
  const newObject = {};
123
- Object.keys(object).forEach(key => {
71
+ Object.keys(object).forEach((key) => {
124
72
  if (properties.includes(key)) {
125
73
  newObject[key] = object[key];
126
- } else if (typeof object[key] === 'object') {
127
- const newFilter = filterObjectByProperties(object[key], properties);
74
+ } else if (typeof object[key] === "object") {
75
+ const newFilter = filterObjectByProperties(
76
+ object[key],
77
+ properties
78
+ );
128
79
  if (Object.keys(newFilter).length) {
129
80
  newObject[key] = newFilter;
130
81
  }
@@ -132,17 +83,17 @@ export const filterObjectByProperties = (object, properties) => {
132
83
  });
133
84
  return newObject;
134
85
  };
135
-
136
- /**
137
- * Compares a style variation to the same variation filtered by the specified properties.
138
- * Returns true if the variation contains only the properties specified.
139
- *
140
- * @param {Object} variation The variation to compare.
141
- * @param {string[]} properties The properties to compare.
142
- * @return {boolean} Whether the variation contains only the specified properties.
143
- */
144
- export function isVariationWithProperties(variation, properties) {
145
- const variationWithProperties = filterObjectByProperties(structuredClone(variation), properties);
86
+ function isVariationWithProperties(variation, properties) {
87
+ const variationWithProperties = filterObjectByProperties(
88
+ structuredClone(variation),
89
+ properties
90
+ );
146
91
  return areGlobalStyleConfigsEqual(variationWithProperties, variation);
147
92
  }
148
- //# sourceMappingURL=use-theme-style-variations-by-property.js.map
93
+ export {
94
+ filterObjectByProperties,
95
+ isVariationWithProperties,
96
+ removePropertiesFromObject,
97
+ useCurrentMergeThemeStyleVariationsWithUserConfig
98
+ };
99
+ //# sourceMappingURL=use-theme-style-variations-by-property.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["useSelect","store","coreStore","useContext","useMemo","privateApis","blockEditorPrivateApis","editorPrivateApis","__","unlock","EMPTY_ARRAY","GlobalStylesContext","areGlobalStyleConfigsEqual","mergeBaseAndUserConfigs","removePropertiesFromObject","object","properties","length","Object","keys","key","includes","hasThemeVariation","title","settings","styles","useCurrentMergeThemeStyleVariationsWithUserConfig","variationsFromTheme","select","_variationsFromTheme","__experimentalGetCurrentThemeGlobalStylesVariations","user","userVariation","propertiesAsString","toString","clonedUserVariation","structuredClone","userVariationWithoutProperties","variationsWithPropertiesAndBase","filter","variation","isVariationWithProperties","map","variationsByProperties","filterObjectByProperties","newObject","forEach","newFilter","variationWithProperties"],"sources":["@wordpress/edit-site/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useContext, useMemo } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst EMPTY_ARRAY = [];\nconst { GlobalStylesContext, areGlobalStyleConfigsEqual } = unlock(\n\tblockEditorPrivateApis\n);\nconst { mergeBaseAndUserConfigs } = unlock( editorPrivateApis );\n\n/**\n * Removes all instances of properties from an object.\n *\n * @param {Object} object The object to remove the properties from.\n * @param {string[]} properties The properties to remove.\n * @return {Object} The modified object.\n */\nexport function removePropertiesFromObject( object, properties ) {\n\tif ( ! properties?.length ) {\n\t\treturn object;\n\t}\n\n\tif (\n\t\ttypeof object !== 'object' ||\n\t\t! object ||\n\t\t! Object.keys( object ).length\n\t) {\n\t\treturn object;\n\t}\n\n\tfor ( const key in object ) {\n\t\tif ( properties.includes( key ) ) {\n\t\t\tdelete object[ key ];\n\t\t} else if ( typeof object[ key ] === 'object' ) {\n\t\t\tremovePropertiesFromObject( object[ key ], properties );\n\t\t}\n\t}\n\treturn object;\n}\n\n/**\n * Checks whether a style variation is empty.\n *\n * @param {Object} variation A style variation object.\n * @param {string} variation.title The title of the variation.\n * @param {Object} variation.settings The settings of the variation.\n * @param {Object} variation.styles The styles of the variation.\n * @return {boolean} Whether the variation is empty.\n */\nfunction hasThemeVariation( { title, settings, styles } ) {\n\treturn (\n\t\ttitle === __( 'Default' ) || // Always preserve the default variation.\n\t\tObject.keys( settings ).length > 0 ||\n\t\tObject.keys( styles ).length > 0\n\t);\n}\n\n/**\n * Fetches the current theme style variations that contain only the specified properties\n * and merges them with the user config.\n *\n * @param {string[]} properties The properties to filter by.\n * @return {Object[]|*} The merged object.\n */\nexport function useCurrentMergeThemeStyleVariationsWithUserConfig(\n\tproperties = []\n) {\n\tconst { variationsFromTheme } = useSelect( ( select ) => {\n\t\tconst _variationsFromTheme =\n\t\t\tselect(\n\t\t\t\tcoreStore\n\t\t\t).__experimentalGetCurrentThemeGlobalStylesVariations();\n\n\t\treturn {\n\t\t\tvariationsFromTheme: _variationsFromTheme || EMPTY_ARRAY,\n\t\t};\n\t}, [] );\n\tconst { user: userVariation } = useContext( GlobalStylesContext );\n\n\tconst propertiesAsString = properties.toString();\n\n\treturn useMemo( () => {\n\t\tconst clonedUserVariation = structuredClone( userVariation );\n\n\t\t// Get user variation and remove the settings for the given property.\n\t\tconst userVariationWithoutProperties = removePropertiesFromObject(\n\t\t\tclonedUserVariation,\n\t\t\tproperties\n\t\t);\n\t\tuserVariationWithoutProperties.title = __( 'Default' );\n\n\t\tconst variationsWithPropertiesAndBase = variationsFromTheme\n\t\t\t.filter( ( variation ) => {\n\t\t\t\treturn isVariationWithProperties( variation, properties );\n\t\t\t} )\n\t\t\t.map( ( variation ) => {\n\t\t\t\treturn mergeBaseAndUserConfigs(\n\t\t\t\t\tuserVariationWithoutProperties,\n\t\t\t\t\tvariation\n\t\t\t\t);\n\t\t\t} );\n\n\t\tconst variationsByProperties = [\n\t\t\tuserVariationWithoutProperties,\n\t\t\t...variationsWithPropertiesAndBase,\n\t\t];\n\n\t\t/*\n\t\t * Filter out variations with no settings or styles.\n\t\t */\n\t\treturn variationsByProperties?.length\n\t\t\t? variationsByProperties.filter( hasThemeVariation )\n\t\t\t: [];\n\t}, [ propertiesAsString, userVariation, variationsFromTheme ] );\n}\n\n/**\n * Returns a new object, with properties specified in `properties` array.,\n * maintain the original object tree structure.\n * The function is recursive, so it will perform a deep search for the given properties.\n * E.g., the function will return `{ a: { b: { c: { test: 1 } } } }` if the properties are `[ 'test' ]`.\n *\n * @param {Object} object The object to filter\n * @param {string[]} properties The properties to filter by\n * @return {Object} The merged object.\n */\nexport const filterObjectByProperties = ( object, properties ) => {\n\tif ( ! object || ! properties?.length ) {\n\t\treturn {};\n\t}\n\n\tconst newObject = {};\n\tObject.keys( object ).forEach( ( key ) => {\n\t\tif ( properties.includes( key ) ) {\n\t\t\tnewObject[ key ] = object[ key ];\n\t\t} else if ( typeof object[ key ] === 'object' ) {\n\t\t\tconst newFilter = filterObjectByProperties(\n\t\t\t\tobject[ key ],\n\t\t\t\tproperties\n\t\t\t);\n\t\t\tif ( Object.keys( newFilter ).length ) {\n\t\t\t\tnewObject[ key ] = newFilter;\n\t\t\t}\n\t\t}\n\t} );\n\treturn newObject;\n};\n\n/**\n * Compares a style variation to the same variation filtered by the specified properties.\n * Returns true if the variation contains only the properties specified.\n *\n * @param {Object} variation The variation to compare.\n * @param {string[]} properties The properties to compare.\n * @return {boolean} Whether the variation contains only the specified properties.\n */\nexport function isVariationWithProperties( variation, properties ) {\n\tconst variationWithProperties = filterObjectByProperties(\n\t\tstructuredClone( variation ),\n\t\tproperties\n\t);\n\n\treturn areGlobalStyleConfigsEqual( variationWithProperties, variation );\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,UAAU,EAAEC,OAAO,QAAQ,oBAAoB;AACxD,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;AAC/E,SAASD,WAAW,IAAIE,iBAAiB,QAAQ,mBAAmB;AACpE,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAMC,WAAW,GAAG,EAAE;AACtB,MAAM;EAAEC,mBAAmB;EAAEC;AAA2B,CAAC,GAAGH,MAAM,CACjEH,sBACD,CAAC;AACD,MAAM;EAAEO;AAAwB,CAAC,GAAGJ,MAAM,CAAEF,iBAAkB,CAAC;;AAE/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASO,0BAA0BA,CAAEC,MAAM,EAAEC,UAAU,EAAG;EAChE,IAAK,CAAEA,UAAU,EAAEC,MAAM,EAAG;IAC3B,OAAOF,MAAM;EACd;EAEA,IACC,OAAOA,MAAM,KAAK,QAAQ,IAC1B,CAAEA,MAAM,IACR,CAAEG,MAAM,CAACC,IAAI,CAAEJ,MAAO,CAAC,CAACE,MAAM,EAC7B;IACD,OAAOF,MAAM;EACd;EAEA,KAAM,MAAMK,GAAG,IAAIL,MAAM,EAAG;IAC3B,IAAKC,UAAU,CAACK,QAAQ,CAAED,GAAI,CAAC,EAAG;MACjC,OAAOL,MAAM,CAAEK,GAAG,CAAE;IACrB,CAAC,MAAM,IAAK,OAAOL,MAAM,CAAEK,GAAG,CAAE,KAAK,QAAQ,EAAG;MAC/CN,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ACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASJ,yBAAyBA,CAAED,SAAS,EAAExB,UAAU,EAAG;EAClE,MAAMgC,uBAAuB,GAAGJ,wBAAwB,CACvDR,eAAe,CAAEI,SAAU,CAAC,EAC5BxB,UACD,CAAC;EAED,OAAOJ,0BAA0B,CAAEoC,uBAAuB,EAAER,SAAU,CAAC;AACxE","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useContext, useMemo } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst EMPTY_ARRAY = [];\nconst { GlobalStylesContext, areGlobalStyleConfigsEqual } = unlock(\n\tblockEditorPrivateApis\n);\nconst { mergeBaseAndUserConfigs } = unlock( editorPrivateApis );\n\n/**\n * Removes all instances of properties from an object.\n *\n * @param {Object} object The object to remove the properties from.\n * @param {string[]} properties The properties to remove.\n * @return {Object} The modified object.\n */\nexport function removePropertiesFromObject( object, properties ) {\n\tif ( ! properties?.length ) {\n\t\treturn object;\n\t}\n\n\tif (\n\t\ttypeof object !== 'object' ||\n\t\t! object ||\n\t\t! Object.keys( object ).length\n\t) {\n\t\treturn object;\n\t}\n\n\tfor ( const key in object ) {\n\t\tif ( properties.includes( key ) ) {\n\t\t\tdelete object[ key ];\n\t\t} else if ( typeof object[ key ] === 'object' ) {\n\t\t\tremovePropertiesFromObject( object[ key ], properties );\n\t\t}\n\t}\n\treturn object;\n}\n\n/**\n * Checks whether a style variation is empty.\n *\n * @param {Object} variation A style variation object.\n * @param {string} variation.title The title of the variation.\n * @param {Object} variation.settings The settings of the variation.\n * @param {Object} variation.styles The styles of the variation.\n * @return {boolean} Whether the variation is empty.\n */\nfunction hasThemeVariation( { title, settings, styles } ) {\n\treturn (\n\t\ttitle === __( 'Default' ) || // Always preserve the default variation.\n\t\tObject.keys( settings ).length > 0 ||\n\t\tObject.keys( styles ).length > 0\n\t);\n}\n\n/**\n * Fetches the current theme style variations that contain only the specified properties\n * and merges them with the user config.\n *\n * @param {string[]} properties The properties to filter by.\n * @return {Object[]|*} The merged object.\n */\nexport function useCurrentMergeThemeStyleVariationsWithUserConfig(\n\tproperties = []\n) {\n\tconst { variationsFromTheme } = useSelect( ( select ) => {\n\t\tconst _variationsFromTheme =\n\t\t\tselect(\n\t\t\t\tcoreStore\n\t\t\t).__experimentalGetCurrentThemeGlobalStylesVariations();\n\n\t\treturn {\n\t\t\tvariationsFromTheme: _variationsFromTheme || EMPTY_ARRAY,\n\t\t};\n\t}, [] );\n\tconst { user: userVariation } = useContext( GlobalStylesContext );\n\n\tconst propertiesAsString = properties.toString();\n\n\treturn useMemo( () => {\n\t\tconst clonedUserVariation = structuredClone( userVariation );\n\n\t\t// Get user variation and remove the settings for the given property.\n\t\tconst userVariationWithoutProperties = removePropertiesFromObject(\n\t\t\tclonedUserVariation,\n\t\t\tproperties\n\t\t);\n\t\tuserVariationWithoutProperties.title = __( 'Default' );\n\n\t\tconst variationsWithPropertiesAndBase = variationsFromTheme\n\t\t\t.filter( ( variation ) => {\n\t\t\t\treturn isVariationWithProperties( variation, properties );\n\t\t\t} )\n\t\t\t.map( ( variation ) => {\n\t\t\t\treturn mergeBaseAndUserConfigs(\n\t\t\t\t\tuserVariationWithoutProperties,\n\t\t\t\t\tvariation\n\t\t\t\t);\n\t\t\t} );\n\n\t\tconst variationsByProperties = [\n\t\t\tuserVariationWithoutProperties,\n\t\t\t...variationsWithPropertiesAndBase,\n\t\t];\n\n\t\t/*\n\t\t * Filter out variations with no settings or styles.\n\t\t */\n\t\treturn variationsByProperties?.length\n\t\t\t? variationsByProperties.filter( hasThemeVariation )\n\t\t\t: [];\n\t}, [ propertiesAsString, userVariation, variationsFromTheme ] );\n}\n\n/**\n * Returns a new object, with properties specified in `properties` array.,\n * maintain the original object tree structure.\n * The function is recursive, so it will perform a deep search for the given properties.\n * E.g., the function will return `{ a: { b: { c: { test: 1 } } } }` if the properties are `[ 'test' ]`.\n *\n * @param {Object} object The object to filter\n * @param {string[]} properties The properties to filter by\n * @return {Object} The merged object.\n */\nexport const filterObjectByProperties = ( object, properties ) => {\n\tif ( ! object || ! properties?.length ) {\n\t\treturn {};\n\t}\n\n\tconst newObject = {};\n\tObject.keys( object ).forEach( ( key ) => {\n\t\tif ( properties.includes( key ) ) {\n\t\t\tnewObject[ key ] = object[ key ];\n\t\t} else if ( typeof object[ key ] === 'object' ) {\n\t\t\tconst newFilter = filterObjectByProperties(\n\t\t\t\tobject[ key ],\n\t\t\t\tproperties\n\t\t\t);\n\t\t\tif ( Object.keys( newFilter ).length ) {\n\t\t\t\tnewObject[ key ] = newFilter;\n\t\t\t}\n\t\t}\n\t} );\n\treturn newObject;\n};\n\n/**\n * Compares a style variation to the same variation filtered by the specified properties.\n * Returns true if the variation contains only the properties specified.\n *\n * @param {Object} variation The variation to compare.\n * @param {string[]} properties The properties to compare.\n * @return {boolean} Whether the variation contains only the specified properties.\n */\nexport function isVariationWithProperties( variation, properties ) {\n\tconst variationWithProperties = filterObjectByProperties(\n\t\tstructuredClone( variation ),\n\t\tproperties\n\t);\n\n\treturn areGlobalStyleConfigsEqual( variationWithProperties, variation );\n}\n"],
5
+ "mappings": "AAGA,SAAS,iBAAiB;AAC1B,SAAS,SAAS,iBAAiB;AACnC,SAAS,YAAY,eAAe;AACpC,SAAS,eAAe,8BAA8B;AACtD,SAAS,eAAe,yBAAyB;AACjD,SAAS,UAAU;AAKnB,SAAS,cAAc;AAEvB,MAAM,cAAc,CAAC;AACrB,MAAM,EAAE,qBAAqB,2BAA2B,IAAI;AAAA,EAC3D;AACD;AACA,MAAM,EA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AAEH,UAAM,yBAAyB;AAAA,MAC9B;AAAA,MACA,GAAG;AAAA,IACJ;AAKA,WAAO,wBAAwB,SAC5B,uBAAuB,OAAQ,iBAAkB,IACjD,CAAC;AAAA,EACL,GAAG,CAAE,oBAAoB,eAAe,mBAAoB,CAAE;AAC/D;AAYO,MAAM,2BAA2B,CAAE,QAAQ,eAAgB;AACjE,MAAK,CAAE,UAAU,CAAE,YAAY,QAAS;AACvC,WAAO,CAAC;AAAA,EACT;AAEA,QAAM,YAAY,CAAC;AACnB,SAAO,KAAM,MAAO,EAAE,QAAS,CAAE,QAAS;AACzC,QAAK,WAAW,SAAU,GAAI,GAAI;AACjC,gBAAW,GAAI,IAAI,OAAQ,GAAI;AAAA,IAChC,WAAY,OAAO,OAAQ,GAAI,MAAM,UAAW;AAC/C,YAAM,YAAY;AAAA,QACjB,OAAQ,GAAI;AAAA,QACZ;AAAA,MACD;AACA,UAAK,OAAO,KAAM,SAAU,EAAE,QAAS;AACtC,kBAAW,GAAI,IAAI;AAAA,MACpB;AAAA,IACD;AAAA,EACD,CAAE;AACF,SAAO;AACR;AAUO,SAAS,0BAA2B,WAAW,YAAa;AAClE,QAAM,0BAA0B;AAAA,IAC/B,gBAAiB,SAAU;AAAA,IAC3B;AAAA,EACD;AAEA,SAAO,2BAA4B,yBAAyB,SAAU;AACvE;",
6
+ "names": []
7
+ }
@@ -1,104 +1,90 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { store as blocksStore } from '@wordpress/blocks';
5
- import { registerCoreBlocks, __experimentalGetCoreBlocks, __experimentalRegisterExperimentalCoreBlocks } from '@wordpress/block-library';
6
- import { dispatch } from '@wordpress/data';
7
- import deprecated from '@wordpress/deprecated';
8
- import { createRoot, StrictMode } from '@wordpress/element';
9
- import { privateApis as editorPrivateApis } from '@wordpress/editor';
10
- import { store as preferencesStore } from '@wordpress/preferences';
11
- import { registerLegacyWidgetBlock, registerWidgetGroupBlock } from '@wordpress/widgets';
12
-
13
- /**
14
- * Internal dependencies
15
- */
16
- import './hooks';
17
- import { store as editSiteStore } from './store';
18
- import { unlock } from './lock-unlock';
19
- import App from './components/app';
20
- import { jsx as _jsx } from "react/jsx-runtime";
21
- const {
22
- registerCoreBlockBindingsSources
23
- } = unlock(editorPrivateApis);
24
-
25
- /**
26
- * Initializes the site editor screen.
27
- *
28
- * @param {string} id ID of the root element to render the screen in.
29
- * @param {Object} settings Editor settings.
30
- */
31
- export function initializeEditor(id, settings) {
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { store as blocksStore } from "@wordpress/blocks";
3
+ import {
4
+ registerCoreBlocks,
5
+ __experimentalGetCoreBlocks,
6
+ __experimentalRegisterExperimentalCoreBlocks
7
+ } from "@wordpress/block-library";
8
+ import { dispatch } from "@wordpress/data";
9
+ import deprecated from "@wordpress/deprecated";
10
+ import { createRoot, StrictMode } from "@wordpress/element";
11
+ import { privateApis as editorPrivateApis } from "@wordpress/editor";
12
+ import { store as preferencesStore } from "@wordpress/preferences";
13
+ import {
14
+ registerLegacyWidgetBlock,
15
+ registerWidgetGroupBlock
16
+ } from "@wordpress/widgets";
17
+ import "./hooks";
18
+ import { store as editSiteStore } from "./store";
19
+ import { unlock } from "./lock-unlock";
20
+ import App from "./components/app";
21
+ const { registerCoreBlockBindingsSources } = unlock(editorPrivateApis);
22
+ function initializeEditor(id, settings) {
32
23
  const target = document.getElementById(id);
33
24
  const root = createRoot(target);
34
25
  dispatch(blocksStore).reapplyBlockTypeFilters();
35
- const coreBlocks = __experimentalGetCoreBlocks().filter(({
36
- name
37
- }) => name !== 'core/freeform');
26
+ const coreBlocks = __experimentalGetCoreBlocks().filter(
27
+ ({ name }) => name !== "core/freeform"
28
+ );
38
29
  registerCoreBlocks(coreBlocks);
39
30
  registerCoreBlockBindingsSources();
40
- dispatch(blocksStore).setFreeformFallbackBlockName('core/html');
41
- registerLegacyWidgetBlock({
42
- inserter: false
43
- });
44
- registerWidgetGroupBlock({
45
- inserter: false
46
- });
31
+ dispatch(blocksStore).setFreeformFallbackBlockName("core/html");
32
+ registerLegacyWidgetBlock({ inserter: false });
33
+ registerWidgetGroupBlock({ inserter: false });
47
34
  if (globalThis.IS_GUTENBERG_PLUGIN) {
48
35
  __experimentalRegisterExperimentalCoreBlocks({
49
36
  enableFSEBlocks: true
50
37
  });
51
38
  }
52
-
53
- // We dispatch actions and update the store synchronously before rendering
54
- // so that we won't trigger unnecessary re-renders with useEffect.
55
- dispatch(preferencesStore).setDefaults('core/edit-site', {
39
+ dispatch(preferencesStore).setDefaults("core/edit-site", {
56
40
  welcomeGuide: true,
57
41
  welcomeGuideStyles: true,
58
42
  welcomeGuidePage: true,
59
43
  welcomeGuideTemplate: true
60
44
  });
61
- dispatch(preferencesStore).setDefaults('core', {
45
+ dispatch(preferencesStore).setDefaults("core", {
62
46
  allowRightClickOverrides: true,
63
47
  distractionFree: false,
64
- editorMode: 'visual',
65
- editorTool: 'edit',
48
+ editorMode: "visual",
49
+ editorTool: "edit",
66
50
  fixedToolbar: false,
67
51
  focusMode: false,
68
52
  inactivePanels: [],
69
53
  keepCaretInsideBlock: false,
70
- openPanels: ['post-status'],
54
+ openPanels: ["post-status"],
71
55
  showBlockBreadcrumbs: true,
72
56
  showListViewByDefault: false,
73
57
  enableChoosePatternModal: true
74
58
  });
75
59
  if (window.__experimentalMediaProcessing) {
76
- dispatch(preferencesStore).setDefaults('core/media', {
60
+ dispatch(preferencesStore).setDefaults("core/media", {
77
61
  requireApproval: true,
78
62
  optimizeOnUpload: true
79
63
  });
80
64
  }
81
65
  dispatch(editSiteStore).updateSettings(settings);
82
-
83
- // Prevent the default browser action for files dropped outside of dropzones.
84
- window.addEventListener('dragover', e => e.preventDefault(), false);
85
- window.addEventListener('drop', e => e.preventDefault(), false);
86
- root.render(/*#__PURE__*/_jsx(StrictMode, {
87
- children: /*#__PURE__*/_jsx(App, {})
88
- }));
66
+ window.addEventListener("dragover", (e) => e.preventDefault(), false);
67
+ window.addEventListener("drop", (e) => e.preventDefault(), false);
68
+ root.render(
69
+ /* @__PURE__ */ jsx(StrictMode, { children: /* @__PURE__ */ jsx(App, {}) })
70
+ );
89
71
  return root;
90
72
  }
91
- export function reinitializeEditor() {
92
- deprecated('wp.editSite.reinitializeEditor', {
93
- since: '6.2',
94
- version: '6.3'
73
+ function reinitializeEditor() {
74
+ deprecated("wp.editSite.reinitializeEditor", {
75
+ since: "6.2",
76
+ version: "6.3"
95
77
  });
96
78
  }
97
- export { default as PluginTemplateSettingPanel } from './components/plugin-template-setting-panel';
98
- export { store } from './store';
99
- export * from './deprecated';
100
-
101
- // Temporary: While the posts dashboard is being iterated on
102
- // it's being built in the same package as the site editor.
103
- export { initializePostsDashboard } from './posts';
104
- //# sourceMappingURL=index.js.map
79
+ import { default as default2 } from "./components/plugin-template-setting-panel";
80
+ import { store } from "./store";
81
+ export * from "./deprecated";
82
+ import { initializePostsDashboard } from "./posts";
83
+ export {
84
+ default2 as PluginTemplateSettingPanel,
85
+ initializeEditor,
86
+ initializePostsDashboard,
87
+ reinitializeEditor,
88
+ store
89
+ };
90
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["store","blocksStore","registerCoreBlocks","__experimentalGetCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","dispatch","deprecated","createRoot","StrictMode","privateApis","editorPrivateApis","preferencesStore","registerLegacyWidgetBlock","registerWidgetGroupBlock","editSiteStore","unlock","App","jsx","_jsx","registerCoreBlockBindingsSources","initializeEditor","id","settings","target","document","getElementById","root","reapplyBlockTypeFilters","coreBlocks","filter","name","setFreeformFallbackBlockName","inserter","globalThis","IS_GUTENBERG_PLUGIN","enableFSEBlocks","setDefaults","welcomeGuide","welcomeGuideStyles","welcomeGuidePage","welcomeGuideTemplate","allowRightClickOverrides","distractionFree","editorMode","editorTool","fixedToolbar","focusMode","inactivePanels","keepCaretInsideBlock","openPanels","showBlockBreadcrumbs","showListViewByDefault","enableChoosePatternModal","window","__experimentalMediaProcessing","requireApproval","optimizeOnUpload","updateSettings","addEventListener","e","preventDefault","render","children","reinitializeEditor","since","version","default","PluginTemplateSettingPanel","initializePostsDashboard"],"sources":["@wordpress/edit-site/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalGetCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport { dispatch } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot, StrictMode } from '@wordpress/element';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport { store as editSiteStore } from './store';\nimport { unlock } from './lock-unlock';\nimport App from './components/app';\n\nconst { registerCoreBlockBindingsSources } = unlock( editorPrivateApis );\n\n/**\n * Initializes the site editor screen.\n *\n * @param {string} id ID of the root element to render the screen in.\n * @param {Object} settings Editor settings.\n */\nexport function initializeEditor( id, settings ) {\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\tconst coreBlocks = __experimentalGetCoreBlocks().filter(\n\t\t( { name } ) => name !== 'core/freeform'\n\t);\n\tregisterCoreBlocks( coreBlocks );\n\tregisterCoreBlockBindingsSources();\n\tdispatch( blocksStore ).setFreeformFallbackBlockName( 'core/html' );\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: true,\n\t\t} );\n\t}\n\n\t// We dispatch actions and update the store synchronously before rendering\n\t// so that we won't trigger unnecessary re-renders with useEffect.\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-site', {\n\t\twelcomeGuide: true,\n\t\twelcomeGuideStyles: true,\n\t\twelcomeGuidePage: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( preferencesStore ).setDefaults( 'core', {\n\t\tallowRightClickOverrides: true,\n\t\tdistractionFree: false,\n\t\teditorMode: 'visual',\n\t\teditorTool: 'edit',\n\t\tfixedToolbar: false,\n\t\tfocusMode: false,\n\t\tinactivePanels: [],\n\t\tkeepCaretInsideBlock: false,\n\t\topenPanels: [ 'post-status' ],\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowListViewByDefault: false,\n\t\tenableChoosePatternModal: true,\n\t} );\n\n\tif ( window.__experimentalMediaProcessing ) {\n\t\tdispatch( preferencesStore ).setDefaults( 'core/media', {\n\t\t\trequireApproval: true,\n\t\t\toptimizeOnUpload: true,\n\t\t} );\n\t}\n\n\tdispatch( editSiteStore ).updateSettings( settings );\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render(\n\t\t<StrictMode>\n\t\t\t<App />\n\t\t</StrictMode>\n\t);\n\n\treturn root;\n}\n\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editSite.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { default as PluginTemplateSettingPanel } from './components/plugin-template-setting-panel';\nexport { store } from './store';\nexport * from './deprecated';\n\n// Temporary: While the posts dashboard is being iterated on\n// it's being built in the same package as the site editor.\nexport { initializePostsDashboard } from './posts';\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SACCC,kBAAkB,EAClBC,2BAA2B,EAC3BC,4CAA4C,QACtC,0BAA0B;AACjC,SAASC,QAAQ,QAAQ,iBAAiB;AAC1C,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,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AAkBA,CAAA,EAAG;EACpCzD,UAAU,CAAE,gCAAgC,EAAE;IAC7C0D,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ;AAEA,SAASC,OAAO,IAAIC,0BAA0B,QAAQ,4CAA4C;AAClG,SAASnE,KAAK,QAAQ,SAAS;AAC/B,cAAc,cAAc;;AAE5B;AACA;AACA,SAASoE,wBAAwB,QAAQ,SAAS","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/index.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalGetCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport { dispatch } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot, StrictMode } from '@wordpress/element';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport { store as editSiteStore } from './store';\nimport { unlock } from './lock-unlock';\nimport App from './components/app';\n\nconst { registerCoreBlockBindingsSources } = unlock( editorPrivateApis );\n\n/**\n * Initializes the site editor screen.\n *\n * @param {string} id ID of the root element to render the screen in.\n * @param {Object} settings Editor settings.\n */\nexport function initializeEditor( id, settings ) {\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\tconst coreBlocks = __experimentalGetCoreBlocks().filter(\n\t\t( { name } ) => name !== 'core/freeform'\n\t);\n\tregisterCoreBlocks( coreBlocks );\n\tregisterCoreBlockBindingsSources();\n\tdispatch( blocksStore ).setFreeformFallbackBlockName( 'core/html' );\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: true,\n\t\t} );\n\t}\n\n\t// We dispatch actions and update the store synchronously before rendering\n\t// so that we won't trigger unnecessary re-renders with useEffect.\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-site', {\n\t\twelcomeGuide: true,\n\t\twelcomeGuideStyles: true,\n\t\twelcomeGuidePage: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( preferencesStore ).setDefaults( 'core', {\n\t\tallowRightClickOverrides: true,\n\t\tdistractionFree: false,\n\t\teditorMode: 'visual',\n\t\teditorTool: 'edit',\n\t\tfixedToolbar: false,\n\t\tfocusMode: false,\n\t\tinactivePanels: [],\n\t\tkeepCaretInsideBlock: false,\n\t\topenPanels: [ 'post-status' ],\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowListViewByDefault: false,\n\t\tenableChoosePatternModal: true,\n\t} );\n\n\tif ( window.__experimentalMediaProcessing ) {\n\t\tdispatch( preferencesStore ).setDefaults( 'core/media', {\n\t\t\trequireApproval: true,\n\t\t\toptimizeOnUpload: true,\n\t\t} );\n\t}\n\n\tdispatch( editSiteStore ).updateSettings( settings );\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render(\n\t\t<StrictMode>\n\t\t\t<App />\n\t\t</StrictMode>\n\t);\n\n\treturn root;\n}\n\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editSite.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { default as PluginTemplateSettingPanel } from './components/plugin-template-setting-panel';\nexport { store } from './store';\nexport * from './deprecated';\n\n// Temporary: While the posts dashboard is being iterated on\n// it's being built in the same package as the site editor.\nexport { initializePostsDashboard } from './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5B,sBAAsB;AAAA,IACtB,uBAAuB;AAAA,IACvB,0BAA0B;AAAA,EAC3B,CAAE;AAEF,MAAK,OAAO,+BAAgC;AAC3C,aAAU,gBAAiB,EAAE,YAAa,cAAc;AAAA,MACvD,iBAAiB;AAAA,MACjB,kBAAkB;AAAA,IACnB,CAAE;AAAA,EACH;AAEA,WAAU,aAAc,EAAE,eAAgB,QAAS;AAGnD,SAAO,iBAAkB,YAAY,CAAE,MAAO,EAAE,eAAe,GAAG,KAAM;AACxE,SAAO,iBAAkB,QAAQ,CAAE,MAAO,EAAE,eAAe,GAAG,KAAM;AAEpE,OAAK;AAAA,IACJ,oBAAC,cACA,8BAAC,OAAI,GACN;AAAA,EACD;AAEA,SAAO;AACR;AAEO,SAAS,qBAAqB;AACpC,aAAY,kCAAkC;AAAA,IAC7C,OAAO;AAAA,IACP,SAAS;AAAA,EACV,CAAE;AACH;AAEA,SAAoB,WAAXA,gBAA6C;AACtD,SAAS,aAAa;AACtB,cAAc;AAId,SAAS,gCAAgC;",
6
+ "names": ["default"]
7
+ }
@@ -1,9 +1,10 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';
5
- export const {
1
+ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from "@wordpress/private-apis";
2
+ const { lock, unlock } = __dangerousOptInToUnstableAPIsOnlyForCoreModules(
3
+ "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
4
+ "@wordpress/edit-site"
5
+ );
6
+ export {
6
7
  lock,
7
8
  unlock
8
- } = __dangerousOptInToUnstableAPIsOnlyForCoreModules('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/edit-site');
9
- //# sourceMappingURL=lock-unlock.js.map
9
+ };
10
+ //# sourceMappingURL=lock-unlock.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["__dangerousOptInToUnstableAPIsOnlyForCoreModules","lock","unlock"],"sources":["@wordpress/edit-site/src/lock-unlock.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.',\n\t\t'@wordpress/edit-site'\n\t);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gDAAgD,QAAQ,yBAAyB;AAE1F,OAAO,MAAM;EAAEC,IAAI;EAAEC;AAAO,CAAC,GAC5BF,gDAAgD,CAC/C,+HAA+H,EAC/H,sBACD,CAAC","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/lock-unlock.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.',\n\t\t'@wordpress/edit-site'\n\t);\n"],
5
+ "mappings": "AAGA,SAAS,wDAAwD;AAE1D,MAAM,EAAE,MAAM,OAAO,IAC3B;AAAA,EACC;AAAA,EACA;AACD;",
6
+ "names": []
7
+ }