@wordpress/edit-site 6.33.3 → 6.34.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 (654) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/block-editor/use-site-editor-settings.js +14 -2
  3. package/build/components/block-editor/use-site-editor-settings.js.map +3 -3
  4. package/build/components/canvas-loader/index.js +5 -8
  5. package/build/components/canvas-loader/index.js.map +3 -3
  6. package/build/components/editor/index.js +2 -40
  7. package/build/components/editor/index.js.map +3 -3
  8. package/build/components/layout/index.js +5 -7
  9. package/build/components/layout/index.js.map +3 -3
  10. package/build/components/page-patterns/fields.js +4 -3
  11. package/build/components/page-patterns/fields.js.map +3 -3
  12. package/build/components/page-templates/fields.js +2 -2
  13. package/build/components/page-templates/fields.js.map +3 -3
  14. package/build/components/{sidebar-global-styles-wrapper → sidebar-global-styles}/index.js +22 -46
  15. package/build/components/sidebar-global-styles/index.js.map +7 -0
  16. package/build/components/sidebar-navigation-screen-global-styles/content.js +38 -16
  17. package/build/components/sidebar-navigation-screen-global-styles/content.js.map +3 -3
  18. package/build/components/sidebar-navigation-screen-global-styles/index.js +6 -7
  19. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +3 -3
  20. package/build/components/sidebar-navigation-screen-main/index.js +0 -9
  21. package/build/components/sidebar-navigation-screen-main/index.js.map +3 -3
  22. package/build/components/sidebar-navigation-screen-templates-browse/content.js +2 -2
  23. package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +2 -2
  24. package/build/components/site-editor-routes/stylebook.js +5 -3
  25. package/build/components/site-editor-routes/stylebook.js.map +3 -3
  26. package/build/components/site-editor-routes/styles.js +33 -11
  27. package/build/components/site-editor-routes/styles.js.map +3 -3
  28. package/build/components/welcome-guide/index.js +0 -2
  29. package/build/components/welcome-guide/index.js.map +3 -3
  30. package/build/hooks/commands/use-common-commands.js +10 -12
  31. package/build/hooks/commands/use-common-commands.js.map +3 -3
  32. package/build/hooks/commands/use-set-command-context.js +0 -5
  33. package/build/hooks/commands/use-set-command-context.js.map +2 -2
  34. package/build/index.js +0 -1
  35. package/build/index.js.map +2 -2
  36. package/build/posts.js +0 -1
  37. package/build/posts.js.map +2 -2
  38. package/build/store/private-actions.js +0 -8
  39. package/build/store/private-actions.js.map +2 -2
  40. package/build/store/private-selectors.js +0 -5
  41. package/build/store/private-selectors.js.map +2 -2
  42. package/build/store/reducer.js +0 -8
  43. package/build/store/reducer.js.map +2 -2
  44. package/build-module/components/block-editor/use-site-editor-settings.js +14 -2
  45. package/build-module/components/block-editor/use-site-editor-settings.js.map +2 -2
  46. package/build-module/components/canvas-loader/index.js +5 -8
  47. package/build-module/components/canvas-loader/index.js.map +2 -2
  48. package/build-module/components/editor/index.js +4 -46
  49. package/build-module/components/editor/index.js.map +2 -2
  50. package/build-module/components/layout/index.js +5 -7
  51. package/build-module/components/layout/index.js.map +2 -2
  52. package/build-module/components/page-patterns/fields.js +5 -7
  53. package/build-module/components/page-patterns/fields.js.map +2 -2
  54. package/build-module/components/page-templates/fields.js +6 -6
  55. package/build-module/components/page-templates/fields.js.map +2 -2
  56. package/build-module/components/{sidebar-global-styles-wrapper → sidebar-global-styles}/index.js +21 -41
  57. package/build-module/components/sidebar-global-styles/index.js.map +7 -0
  58. package/build-module/components/sidebar-navigation-screen-global-styles/content.js +42 -6
  59. package/build-module/components/sidebar-navigation-screen-global-styles/content.js.map +2 -2
  60. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +5 -6
  61. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +2 -2
  62. package/build-module/components/sidebar-navigation-screen-main/index.js +1 -10
  63. package/build-module/components/sidebar-navigation-screen-main/index.js.map +2 -2
  64. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +3 -3
  65. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +2 -2
  66. package/build-module/components/site-editor-routes/stylebook.js +3 -1
  67. package/build-module/components/site-editor-routes/stylebook.js.map +2 -2
  68. package/build-module/components/site-editor-routes/styles.js +31 -9
  69. package/build-module/components/site-editor-routes/styles.js.map +2 -2
  70. package/build-module/components/welcome-guide/index.js +0 -2
  71. package/build-module/components/welcome-guide/index.js.map +2 -2
  72. package/build-module/hooks/commands/use-common-commands.js +13 -12
  73. package/build-module/hooks/commands/use-common-commands.js.map +2 -2
  74. package/build-module/hooks/commands/use-set-command-context.js +0 -5
  75. package/build-module/hooks/commands/use-set-command-context.js.map +2 -2
  76. package/build-module/index.js +0 -1
  77. package/build-module/index.js.map +2 -2
  78. package/build-module/posts.js +0 -1
  79. package/build-module/posts.js.map +2 -2
  80. package/build-module/store/private-actions.js +0 -7
  81. package/build-module/store/private-actions.js.map +2 -2
  82. package/build-module/store/private-selectors.js +0 -4
  83. package/build-module/store/private-selectors.js.map +2 -2
  84. package/build-module/store/reducer.js +0 -8
  85. package/build-module/store/reducer.js.map +2 -2
  86. package/build-style/posts-rtl.css +13 -50
  87. package/build-style/posts.css +13 -50
  88. package/build-style/style-rtl.css +722 -726
  89. package/build-style/style.css +722 -726
  90. package/package.json +49 -44
  91. package/src/components/block-editor/use-site-editor-settings.js +21 -2
  92. package/src/components/canvas-loader/index.js +5 -9
  93. package/src/components/editor/index.js +2 -50
  94. package/src/components/layout/index.js +6 -10
  95. package/src/components/page-patterns/fields.js +5 -7
  96. package/src/components/page-templates/fields.js +6 -6
  97. package/src/components/{sidebar-global-styles-wrapper → sidebar-global-styles}/index.js +16 -48
  98. package/src/components/{sidebar-global-styles-wrapper → sidebar-global-styles}/style.scss +3 -3
  99. package/src/components/sidebar-navigation-screen/style.scss +5 -12
  100. package/src/components/sidebar-navigation-screen-global-styles/content.js +34 -6
  101. package/src/components/sidebar-navigation-screen-global-styles/index.js +6 -9
  102. package/src/components/sidebar-navigation-screen-main/index.js +1 -12
  103. package/src/components/sidebar-navigation-screen-patterns/style.scss +1 -1
  104. package/src/components/sidebar-navigation-screen-templates-browse/content.js +3 -3
  105. package/src/components/site-editor-routes/stylebook.js +4 -1
  106. package/src/components/site-editor-routes/styles.js +35 -9
  107. package/src/components/site-hub/style.scss +1 -1
  108. package/src/components/welcome-guide/index.js +0 -2
  109. package/src/components/welcome-guide/style.scss +1 -2
  110. package/src/hooks/commands/use-common-commands.js +19 -12
  111. package/src/hooks/commands/use-set-command-context.js +0 -11
  112. package/src/index.js +0 -1
  113. package/src/posts.js +0 -1
  114. package/src/posts.scss +0 -1
  115. package/src/store/private-actions.js +0 -14
  116. package/src/store/private-selectors.js +0 -11
  117. package/src/store/reducer.js +0 -18
  118. package/src/style.scss +2 -9
  119. package/tsconfig.json +3 -11
  120. package/build/components/editor-canvas-container/index.js +0 -139
  121. package/build/components/editor-canvas-container/index.js.map +0 -7
  122. package/build/components/global-styles/background-panel.js +0 -62
  123. package/build/components/global-styles/background-panel.js.map +0 -7
  124. package/build/components/global-styles/block-preview-panel.js +0 -87
  125. package/build/components/global-styles/block-preview-panel.js.map +0 -7
  126. package/build/components/global-styles/color-indicator-wrapper.js +0 -50
  127. package/build/components/global-styles/color-indicator-wrapper.js.map +0 -7
  128. package/build/components/global-styles/color-palette-panel.js +0 -133
  129. package/build/components/global-styles/color-palette-panel.js.map +0 -7
  130. package/build/components/global-styles/confirm-reset-shadow-dialog.js +0 -55
  131. package/build/components/global-styles/confirm-reset-shadow-dialog.js.map +0 -7
  132. package/build/components/global-styles/dimensions-panel.js +0 -92
  133. package/build/components/global-styles/dimensions-panel.js.map +0 -7
  134. package/build/components/global-styles/font-families.js +0 -114
  135. package/build/components/global-styles/font-families.js.map +0 -7
  136. package/build/components/global-styles/font-family-item.js +0 -48
  137. package/build/components/global-styles/font-family-item.js.map +0 -7
  138. package/build/components/global-styles/font-library-modal/collection-font-variant.js +0 -75
  139. package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +0 -7
  140. package/build/components/global-styles/font-library-modal/context.js +0 -386
  141. package/build/components/global-styles/font-library-modal/context.js.map +0 -7
  142. package/build/components/global-styles/font-library-modal/font-card.js +0 -76
  143. package/build/components/global-styles/font-library-modal/font-card.js.map +0 -7
  144. package/build/components/global-styles/font-library-modal/font-collection.js +0 -504
  145. package/build/components/global-styles/font-library-modal/font-collection.js.map +0 -7
  146. package/build/components/global-styles/font-library-modal/font-demo.js +0 -108
  147. package/build/components/global-styles/font-library-modal/font-demo.js.map +0 -7
  148. package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +0 -58
  149. package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +0 -7
  150. package/build/components/global-styles/font-library-modal/index.js +0 -110
  151. package/build/components/global-styles/font-library-modal/index.js.map +0 -7
  152. package/build/components/global-styles/font-library-modal/installed-fonts.js +0 -455
  153. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +0 -7
  154. package/build/components/global-styles/font-library-modal/library-font-details.js +0 -63
  155. package/build/components/global-styles/font-library-modal/library-font-details.js.map +0 -7
  156. package/build/components/global-styles/font-library-modal/library-font-variant.js +0 -78
  157. package/build/components/global-styles/font-library-modal/library-font-variant.js.map +0 -7
  158. package/build/components/global-styles/font-library-modal/resolvers.js +0 -115
  159. package/build/components/global-styles/font-library-modal/resolvers.js.map +0 -7
  160. package/build/components/global-styles/font-library-modal/upload-fonts.js +0 -205
  161. package/build/components/global-styles/font-library-modal/upload-fonts.js.map +0 -7
  162. package/build/components/global-styles/font-library-modal/utils/constants.js +0 -49
  163. package/build/components/global-styles/font-library-modal/utils/constants.js.map +0 -7
  164. package/build/components/global-styles/font-library-modal/utils/filter-fonts.js +0 -39
  165. package/build/components/global-styles/font-library-modal/utils/filter-fonts.js.map +0 -7
  166. package/build/components/global-styles/font-library-modal/utils/fonts-outline.js +0 -51
  167. package/build/components/global-styles/font-library-modal/utils/fonts-outline.js.map +0 -7
  168. package/build/components/global-styles/font-library-modal/utils/index.js +0 -277
  169. package/build/components/global-styles/font-library-modal/utils/index.js.map +0 -7
  170. package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js +0 -42
  171. package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +0 -7
  172. package/build/components/global-styles/font-library-modal/utils/preview-styles.js +0 -117
  173. package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +0 -7
  174. package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js +0 -56
  175. package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +0 -7
  176. package/build/components/global-styles/font-library-modal/utils/toggleFont.js +0 -63
  177. package/build/components/global-styles/font-library-modal/utils/toggleFont.js.map +0 -7
  178. package/build/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js +0 -60
  179. package/build/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js.map +0 -7
  180. package/build/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js +0 -55
  181. package/build/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js.map +0 -7
  182. package/build/components/global-styles/font-sizes/font-size-preview.js +0 -51
  183. package/build/components/global-styles/font-sizes/font-size-preview.js.map +0 -7
  184. package/build/components/global-styles/font-sizes/font-size.js +0 -260
  185. package/build/components/global-styles/font-sizes/font-size.js.map +0 -7
  186. package/build/components/global-styles/font-sizes/font-sizes-count.js +0 -50
  187. package/build/components/global-styles/font-sizes/font-sizes-count.js.map +0 -7
  188. package/build/components/global-styles/font-sizes/font-sizes.js +0 -220
  189. package/build/components/global-styles/font-sizes/font-sizes.js.map +0 -7
  190. package/build/components/global-styles/font-sizes/rename-font-size-dialog.js +0 -90
  191. package/build/components/global-styles/font-sizes/rename-font-size-dialog.js.map +0 -7
  192. package/build/components/global-styles/gradients-palette-panel.js +0 -144
  193. package/build/components/global-styles/gradients-palette-panel.js.map +0 -7
  194. package/build/components/global-styles/header.js +0 -54
  195. package/build/components/global-styles/header.js.map +0 -7
  196. package/build/components/global-styles/highlighted-colors.js +0 -57
  197. package/build/components/global-styles/highlighted-colors.js.map +0 -7
  198. package/build/components/global-styles/hooks.js +0 -113
  199. package/build/components/global-styles/hooks.js.map +0 -7
  200. package/build/components/global-styles/icon-with-current-color.js +0 -53
  201. package/build/components/global-styles/icon-with-current-color.js.map +0 -7
  202. package/build/components/global-styles/index.js +0 -39
  203. package/build/components/global-styles/index.js.map +0 -7
  204. package/build/components/global-styles/navigation-button.js +0 -48
  205. package/build/components/global-styles/navigation-button.js.map +0 -7
  206. package/build/components/global-styles/palette.js +0 -86
  207. package/build/components/global-styles/palette.js.map +0 -7
  208. package/build/components/global-styles/preset-colors.js +0 -40
  209. package/build/components/global-styles/preset-colors.js.map +0 -7
  210. package/build/components/global-styles/preview-colors.js +0 -82
  211. package/build/components/global-styles/preview-colors.js.map +0 -7
  212. package/build/components/global-styles/preview-styles.js +0 -214
  213. package/build/components/global-styles/preview-styles.js.map +0 -7
  214. package/build/components/global-styles/preview-typography.js +0 -68
  215. package/build/components/global-styles/preview-typography.js.map +0 -7
  216. package/build/components/global-styles/preview-wrapper.js +0 -101
  217. package/build/components/global-styles/preview-wrapper.js.map +0 -7
  218. package/build/components/global-styles/root-menu.js +0 -72
  219. package/build/components/global-styles/root-menu.js.map +0 -7
  220. package/build/components/global-styles/screen-background.js +0 -59
  221. package/build/components/global-styles/screen-background.js.map +0 -7
  222. package/build/components/global-styles/screen-block-list.js +0 -170
  223. package/build/components/global-styles/screen-block-list.js.map +0 -7
  224. package/build/components/global-styles/screen-block.js +0 -316
  225. package/build/components/global-styles/screen-block.js.map +0 -7
  226. package/build/components/global-styles/screen-color-palette.js +0 -64
  227. package/build/components/global-styles/screen-color-palette.js.map +0 -7
  228. package/build/components/global-styles/screen-colors.js +0 -81
  229. package/build/components/global-styles/screen-colors.js.map +0 -7
  230. package/build/components/global-styles/screen-css.js +0 -92
  231. package/build/components/global-styles/screen-css.js.map +0 -7
  232. package/build/components/global-styles/screen-layout.js +0 -51
  233. package/build/components/global-styles/screen-layout.js.map +0 -7
  234. package/build/components/global-styles/screen-revisions/index.js +0 -179
  235. package/build/components/global-styles/screen-revisions/index.js.map +0 -7
  236. package/build/components/global-styles/screen-revisions/revisions-buttons.js +0 -192
  237. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +0 -7
  238. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +0 -148
  239. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +0 -7
  240. package/build/components/global-styles/screen-root.js +0 -99
  241. package/build/components/global-styles/screen-root.js.map +0 -7
  242. package/build/components/global-styles/screen-shadows.js +0 -49
  243. package/build/components/global-styles/screen-shadows.js.map +0 -7
  244. package/build/components/global-styles/screen-style-variations.js +0 -70
  245. package/build/components/global-styles/screen-style-variations.js.map +0 -7
  246. package/build/components/global-styles/screen-typography-element.js +0 -167
  247. package/build/components/global-styles/screen-typography-element.js.map +0 -7
  248. package/build/components/global-styles/screen-typography.js +0 -68
  249. package/build/components/global-styles/screen-typography.js.map +0 -7
  250. package/build/components/global-styles/shadow-utils.js +0 -125
  251. package/build/components/global-styles/shadow-utils.js.map +0 -7
  252. package/build/components/global-styles/shadows-edit-panel.js +0 -501
  253. package/build/components/global-styles/shadows-edit-panel.js.map +0 -7
  254. package/build/components/global-styles/shadows-panel.js +0 -206
  255. package/build/components/global-styles/shadows-panel.js.map +0 -7
  256. package/build/components/global-styles/size-control/index.js +0 -80
  257. package/build/components/global-styles/size-control/index.js.map +0 -7
  258. package/build/components/global-styles/style-variations-container.js +0 -124
  259. package/build/components/global-styles/style-variations-container.js.map +0 -7
  260. package/build/components/global-styles/subtitle.js +0 -37
  261. package/build/components/global-styles/subtitle.js.map +0 -7
  262. package/build/components/global-styles/typeset.js +0 -78
  263. package/build/components/global-styles/typeset.js.map +0 -7
  264. package/build/components/global-styles/typography-elements.js +0 -123
  265. package/build/components/global-styles/typography-elements.js.map +0 -7
  266. package/build/components/global-styles/typography-example.js +0 -81
  267. package/build/components/global-styles/typography-example.js.map +0 -7
  268. package/build/components/global-styles/typography-panel.js +0 -69
  269. package/build/components/global-styles/typography-panel.js.map +0 -7
  270. package/build/components/global-styles/typography-preview.js +0 -80
  271. package/build/components/global-styles/typography-preview.js.map +0 -7
  272. package/build/components/global-styles/ui.js +0 -355
  273. package/build/components/global-styles/ui.js.map +0 -7
  274. package/build/components/global-styles/utils.js +0 -92
  275. package/build/components/global-styles/utils.js.map +0 -7
  276. package/build/components/global-styles/variations/variation.js +0 -118
  277. package/build/components/global-styles/variations/variation.js.map +0 -7
  278. package/build/components/global-styles/variations/variations-color.js +0 -61
  279. package/build/components/global-styles/variations/variations-color.js.map +0 -7
  280. package/build/components/global-styles/variations/variations-panel.js +0 -71
  281. package/build/components/global-styles/variations/variations-panel.js.map +0 -7
  282. package/build/components/global-styles/variations/variations-typography.js +0 -75
  283. package/build/components/global-styles/variations/variations-typography.js.map +0 -7
  284. package/build/components/global-styles-renderer/index.js +0 -57
  285. package/build/components/global-styles-renderer/index.js.map +0 -7
  286. package/build/components/global-styles-sidebar/default-sidebar.js +0 -68
  287. package/build/components/global-styles-sidebar/default-sidebar.js.map +0 -7
  288. package/build/components/global-styles-sidebar/index.js +0 -202
  289. package/build/components/global-styles-sidebar/index.js.map +0 -7
  290. package/build/components/revisions/index.js +0 -120
  291. package/build/components/revisions/index.js.map +0 -7
  292. package/build/components/sidebar-global-styles-wrapper/index.js.map +0 -7
  293. package/build/components/style-book/categories.js +0 -86
  294. package/build/components/style-book/categories.js.map +0 -7
  295. package/build/components/style-book/color-examples.js +0 -65
  296. package/build/components/style-book/color-examples.js.map +0 -7
  297. package/build/components/style-book/constants.js +0 -319
  298. package/build/components/style-book/constants.js.map +0 -7
  299. package/build/components/style-book/duotone-examples.js +0 -69
  300. package/build/components/style-book/duotone-examples.js.map +0 -7
  301. package/build/components/style-book/examples.js +0 -237
  302. package/build/components/style-book/examples.js.map +0 -7
  303. package/build/components/style-book/index.js +0 -644
  304. package/build/components/style-book/index.js.map +0 -7
  305. package/build/components/style-book/types.js +0 -17
  306. package/build/components/style-book/types.js.map +0 -7
  307. package/build/components/welcome-guide/styles.js +0 -145
  308. package/build/components/welcome-guide/styles.js.map +0 -7
  309. package/build/hooks/index.js +0 -3
  310. package/build/hooks/index.js.map +0 -7
  311. package/build/hooks/push-changes-to-global-styles/index.js +0 -319
  312. package/build/hooks/push-changes-to-global-styles/index.js.map +0 -7
  313. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +0 -126
  314. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +0 -7
  315. package/build/utils/set-nested-value.js +0 -43
  316. package/build/utils/set-nested-value.js.map +0 -7
  317. package/build-module/components/editor-canvas-container/index.js +0 -120
  318. package/build-module/components/editor-canvas-container/index.js.map +0 -7
  319. package/build-module/components/global-styles/background-panel.js +0 -38
  320. package/build-module/components/global-styles/background-panel.js.map +0 -7
  321. package/build-module/components/global-styles/block-preview-panel.js +0 -67
  322. package/build-module/components/global-styles/block-preview-panel.js.map +0 -7
  323. package/build-module/components/global-styles/color-indicator-wrapper.js +0 -20
  324. package/build-module/components/global-styles/color-indicator-wrapper.js.map +0 -7
  325. package/build-module/components/global-styles/color-palette-panel.js +0 -107
  326. package/build-module/components/global-styles/color-palette-panel.js.map +0 -7
  327. package/build-module/components/global-styles/confirm-reset-shadow-dialog.js +0 -35
  328. package/build-module/components/global-styles/confirm-reset-shadow-dialog.js.map +0 -7
  329. package/build-module/components/global-styles/dimensions-panel.js +0 -72
  330. package/build-module/components/global-styles/dimensions-panel.js.map +0 -7
  331. package/build-module/components/global-styles/font-families.js +0 -92
  332. package/build-module/components/global-styles/font-families.js.map +0 -7
  333. package/build-module/components/global-styles/font-family-item.js +0 -32
  334. package/build-module/components/global-styles/font-family-item.js.map +0 -7
  335. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js +0 -45
  336. package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +0 -7
  337. package/build-module/components/global-styles/font-library-modal/context.js +0 -372
  338. package/build-module/components/global-styles/font-library-modal/context.js.map +0 -7
  339. package/build-module/components/global-styles/font-library-modal/font-card.js +0 -53
  340. package/build-module/components/global-styles/font-library-modal/font-card.js.map +0 -7
  341. package/build-module/components/global-styles/font-library-modal/font-collection.js +0 -505
  342. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +0 -7
  343. package/build-module/components/global-styles/font-library-modal/font-demo.js +0 -91
  344. package/build-module/components/global-styles/font-library-modal/font-demo.js.map +0 -7
  345. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +0 -45
  346. package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +0 -7
  347. package/build-module/components/global-styles/font-library-modal/index.js +0 -83
  348. package/build-module/components/global-styles/font-library-modal/index.js.map +0 -7
  349. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +0 -444
  350. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +0 -7
  351. package/build-module/components/global-styles/font-library-modal/library-font-details.js +0 -36
  352. package/build-module/components/global-styles/font-library-modal/library-font-details.js.map +0 -7
  353. package/build-module/components/global-styles/font-library-modal/library-font-variant.js +0 -48
  354. package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +0 -7
  355. package/build-module/components/global-styles/font-library-modal/resolvers.js +0 -76
  356. package/build-module/components/global-styles/font-library-modal/resolvers.js.map +0 -7
  357. package/build-module/components/global-styles/font-library-modal/upload-fonts.js +0 -185
  358. package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +0 -7
  359. package/build-module/components/global-styles/font-library-modal/utils/constants.js +0 -23
  360. package/build-module/components/global-styles/font-library-modal/utils/constants.js.map +0 -7
  361. package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js +0 -19
  362. package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js.map +0 -7
  363. package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js +0 -26
  364. package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js.map +0 -7
  365. package/build-module/components/global-styles/font-library-modal/utils/index.js +0 -241
  366. package/build-module/components/global-styles/font-library-modal/utils/index.js.map +0 -7
  367. package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js +0 -22
  368. package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +0 -7
  369. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js +0 -90
  370. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +0 -7
  371. package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js +0 -32
  372. package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +0 -7
  373. package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js +0 -39
  374. package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js.map +0 -7
  375. package/build-module/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js +0 -40
  376. package/build-module/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js.map +0 -7
  377. package/build-module/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js +0 -35
  378. package/build-module/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js.map +0 -7
  379. package/build-module/components/global-styles/font-sizes/font-size-preview.js +0 -34
  380. package/build-module/components/global-styles/font-sizes/font-size-preview.js.map +0 -7
  381. package/build-module/components/global-styles/font-sizes/font-size.js +0 -240
  382. package/build-module/components/global-styles/font-sizes/font-size.js.map +0 -7
  383. package/build-module/components/global-styles/font-sizes/font-sizes-count.js +0 -25
  384. package/build-module/components/global-styles/font-sizes/font-sizes-count.js.map +0 -7
  385. package/build-module/components/global-styles/font-sizes/font-sizes.js +0 -205
  386. package/build-module/components/global-styles/font-sizes/font-sizes.js.map +0 -7
  387. package/build-module/components/global-styles/font-sizes/rename-font-size-dialog.js +0 -76
  388. package/build-module/components/global-styles/font-sizes/rename-font-size-dialog.js.map +0 -7
  389. package/build-module/components/global-styles/gradients-palette-panel.js +0 -119
  390. package/build-module/components/global-styles/gradients-palette-panel.js.map +0 -7
  391. package/build-module/components/global-styles/header.js +0 -41
  392. package/build-module/components/global-styles/header.js.map +0 -7
  393. package/build-module/components/global-styles/highlighted-colors.js +0 -37
  394. package/build-module/components/global-styles/highlighted-colors.js.map +0 -7
  395. package/build-module/components/global-styles/hooks.js +0 -77
  396. package/build-module/components/global-styles/hooks.js.map +0 -7
  397. package/build-module/components/global-styles/icon-with-current-color.js +0 -19
  398. package/build-module/components/global-styles/icon-with-current-color.js.map +0 -7
  399. package/build-module/components/global-styles/index.js +0 -5
  400. package/build-module/components/global-styles/index.js.map +0 -7
  401. package/build-module/components/global-styles/navigation-button.js +0 -28
  402. package/build-module/components/global-styles/navigation-button.js.map +0 -7
  403. package/build-module/components/global-styles/palette.js +0 -63
  404. package/build-module/components/global-styles/palette.js.map +0 -7
  405. package/build-module/components/global-styles/preset-colors.js +0 -20
  406. package/build-module/components/global-styles/preset-colors.js.map +0 -7
  407. package/build-module/components/global-styles/preview-colors.js +0 -55
  408. package/build-module/components/global-styles/preview-colors.js.map +0 -7
  409. package/build-module/components/global-styles/preview-styles.js +0 -188
  410. package/build-module/components/global-styles/preview-styles.js.map +0 -7
  411. package/build-module/components/global-styles/preview-typography.js +0 -38
  412. package/build-module/components/global-styles/preview-typography.js.map +0 -7
  413. package/build-module/components/global-styles/preview-wrapper.js +0 -85
  414. package/build-module/components/global-styles/preview-wrapper.js.map +0 -7
  415. package/build-module/components/global-styles/root-menu.js +0 -58
  416. package/build-module/components/global-styles/root-menu.js.map +0 -7
  417. package/build-module/components/global-styles/screen-background.js +0 -29
  418. package/build-module/components/global-styles/screen-background.js.map +0 -7
  419. package/build-module/components/global-styles/screen-block-list.js +0 -150
  420. package/build-module/components/global-styles/screen-block-list.js.map +0 -7
  421. package/build-module/components/global-styles/screen-block.js +0 -293
  422. package/build-module/components/global-styles/screen-block.js.map +0 -7
  423. package/build-module/components/global-styles/screen-color-palette.js +0 -34
  424. package/build-module/components/global-styles/screen-color-palette.js.map +0 -7
  425. package/build-module/components/global-styles/screen-colors.js +0 -51
  426. package/build-module/components/global-styles/screen-colors.js.map +0 -7
  427. package/build-module/components/global-styles/screen-css.js +0 -62
  428. package/build-module/components/global-styles/screen-css.js.map +0 -7
  429. package/build-module/components/global-styles/screen-layout.js +0 -21
  430. package/build-module/components/global-styles/screen-layout.js.map +0 -7
  431. package/build-module/components/global-styles/screen-revisions/index.js +0 -155
  432. package/build-module/components/global-styles/screen-revisions/index.js.map +0 -7
  433. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +0 -172
  434. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +0 -7
  435. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +0 -128
  436. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +0 -7
  437. package/build-module/components/global-styles/screen-root.js +0 -79
  438. package/build-module/components/global-styles/screen-root.js.map +0 -7
  439. package/build-module/components/global-styles/screen-shadows.js +0 -14
  440. package/build-module/components/global-styles/screen-shadows.js.map +0 -7
  441. package/build-module/components/global-styles/screen-style-variations.js +0 -43
  442. package/build-module/components/global-styles/screen-style-variations.js.map +0 -7
  443. package/build-module/components/global-styles/screen-typography-element.js +0 -141
  444. package/build-module/components/global-styles/screen-typography-element.js.map +0 -7
  445. package/build-module/components/global-styles/screen-typography.js +0 -38
  446. package/build-module/components/global-styles/screen-typography.js.map +0 -7
  447. package/build-module/components/global-styles/shadow-utils.js +0 -98
  448. package/build-module/components/global-styles/shadow-utils.js.map +0 -7
  449. package/build-module/components/global-styles/shadows-edit-panel.js +0 -500
  450. package/build-module/components/global-styles/shadows-edit-panel.js.map +0 -7
  451. package/build-module/components/global-styles/shadows-panel.js +0 -185
  452. package/build-module/components/global-styles/shadows-panel.js.map +0 -7
  453. package/build-module/components/global-styles/size-control/index.js +0 -70
  454. package/build-module/components/global-styles/size-control/index.js.map +0 -7
  455. package/build-module/components/global-styles/style-variations-container.js +0 -94
  456. package/build-module/components/global-styles/style-variations-container.js.map +0 -7
  457. package/build-module/components/global-styles/subtitle.js +0 -17
  458. package/build-module/components/global-styles/subtitle.js.map +0 -7
  459. package/build-module/components/global-styles/typeset.js +0 -54
  460. package/build-module/components/global-styles/typeset.js.map +0 -7
  461. package/build-module/components/global-styles/typography-elements.js +0 -98
  462. package/build-module/components/global-styles/typography-elements.js.map +0 -7
  463. package/build-module/components/global-styles/typography-example.js +0 -61
  464. package/build-module/components/global-styles/typography-example.js.map +0 -7
  465. package/build-module/components/global-styles/typography-panel.js +0 -49
  466. package/build-module/components/global-styles/typography-panel.js.map +0 -7
  467. package/build-module/components/global-styles/typography-preview.js +0 -60
  468. package/build-module/components/global-styles/typography-preview.js.map +0 -7
  469. package/build-module/components/global-styles/ui.js +0 -334
  470. package/build-module/components/global-styles/ui.js.map +0 -7
  471. package/build-module/components/global-styles/utils.js +0 -66
  472. package/build-module/components/global-styles/utils.js.map +0 -7
  473. package/build-module/components/global-styles/variations/variation.js +0 -88
  474. package/build-module/components/global-styles/variations/variation.js.map +0 -7
  475. package/build-module/components/global-styles/variations/variations-color.js +0 -34
  476. package/build-module/components/global-styles/variations/variations-color.js.map +0 -7
  477. package/build-module/components/global-styles/variations/variations-panel.js +0 -46
  478. package/build-module/components/global-styles/variations/variations-panel.js.map +0 -7
  479. package/build-module/components/global-styles/variations/variations-typography.js +0 -48
  480. package/build-module/components/global-styles/variations/variations-typography.js.map +0 -7
  481. package/build-module/components/global-styles-renderer/index.js +0 -33
  482. package/build-module/components/global-styles-renderer/index.js.map +0 -7
  483. package/build-module/components/global-styles-sidebar/default-sidebar.js +0 -48
  484. package/build-module/components/global-styles-sidebar/default-sidebar.js.map +0 -7
  485. package/build-module/components/global-styles-sidebar/index.js +0 -175
  486. package/build-module/components/global-styles-sidebar/index.js.map +0 -7
  487. package/build-module/components/revisions/index.js +0 -96
  488. package/build-module/components/revisions/index.js.map +0 -7
  489. package/build-module/components/sidebar-global-styles-wrapper/index.js.map +0 -7
  490. package/build-module/components/style-book/categories.js +0 -64
  491. package/build-module/components/style-book/categories.js.map +0 -7
  492. package/build-module/components/style-book/color-examples.js +0 -38
  493. package/build-module/components/style-book/color-examples.js.map +0 -7
  494. package/build-module/components/style-book/constants.js +0 -290
  495. package/build-module/components/style-book/constants.js.map +0 -7
  496. package/build-module/components/style-book/duotone-examples.js +0 -49
  497. package/build-module/components/style-book/duotone-examples.js.map +0 -7
  498. package/build-module/components/style-book/examples.js +0 -208
  499. package/build-module/components/style-book/examples.js.map +0 -7
  500. package/build-module/components/style-book/index.js +0 -635
  501. package/build-module/components/style-book/index.js.map +0 -7
  502. package/build-module/components/style-book/types.js +0 -1
  503. package/build-module/components/style-book/types.js.map +0 -7
  504. package/build-module/components/welcome-guide/styles.js +0 -115
  505. package/build-module/components/welcome-guide/styles.js.map +0 -7
  506. package/build-module/hooks/index.js +0 -2
  507. package/build-module/hooks/index.js.map +0 -7
  508. package/build-module/hooks/push-changes-to-global-styles/index.js +0 -305
  509. package/build-module/hooks/push-changes-to-global-styles/index.js.map +0 -7
  510. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +0 -99
  511. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +0 -7
  512. package/build-module/utils/set-nested-value.js +0 -23
  513. package/build-module/utils/set-nested-value.js.map +0 -7
  514. package/build-types/components/style-book/categories.d.ts +0 -18
  515. package/build-types/components/style-book/categories.d.ts.map +0 -1
  516. package/build-types/components/style-book/color-examples.d.ts +0 -7
  517. package/build-types/components/style-book/color-examples.d.ts.map +0 -1
  518. package/build-types/components/style-book/constants.d.ts +0 -11
  519. package/build-types/components/style-book/constants.d.ts.map +0 -1
  520. package/build-types/components/style-book/duotone-examples.d.ts +0 -9
  521. package/build-types/components/style-book/duotone-examples.d.ts.map +0 -1
  522. package/build-types/components/style-book/examples.d.ts +0 -12
  523. package/build-types/components/style-book/examples.d.ts.map +0 -1
  524. package/build-types/components/style-book/types.d.ts +0 -72
  525. package/build-types/components/style-book/types.d.ts.map +0 -1
  526. package/lib/inflate.js +0 -3333
  527. package/lib/lib-font.browser.js +0 -3861
  528. package/lib/unbrotli.js +0 -2039
  529. package/src/components/editor-canvas-container/index.js +0 -149
  530. package/src/components/editor-canvas-container/style.scss +0 -43
  531. package/src/components/global-styles/README.md +0 -17
  532. package/src/components/global-styles/background-panel.js +0 -55
  533. package/src/components/global-styles/block-preview-panel.js +0 -81
  534. package/src/components/global-styles/color-indicator-wrapper.js +0 -23
  535. package/src/components/global-styles/color-palette-panel.js +0 -110
  536. package/src/components/global-styles/confirm-reset-shadow-dialog.js +0 -37
  537. package/src/components/global-styles/dimensions-panel.js +0 -86
  538. package/src/components/global-styles/font-families.js +0 -128
  539. package/src/components/global-styles/font-family-item.js +0 -47
  540. package/src/components/global-styles/font-library-modal/collection-font-variant.js +0 -51
  541. package/src/components/global-styles/font-library-modal/context.js +0 -540
  542. package/src/components/global-styles/font-library-modal/font-card.js +0 -67
  543. package/src/components/global-styles/font-library-modal/font-collection.js +0 -575
  544. package/src/components/global-styles/font-library-modal/font-demo.js +0 -116
  545. package/src/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +0 -57
  546. package/src/components/global-styles/font-library-modal/index.js +0 -106
  547. package/src/components/global-styles/font-library-modal/installed-fonts.js +0 -518
  548. package/src/components/global-styles/font-library-modal/library-font-details.js +0 -45
  549. package/src/components/global-styles/font-library-modal/library-font-variant.js +0 -60
  550. package/src/components/global-styles/font-library-modal/resolvers.js +0 -78
  551. package/src/components/global-styles/font-library-modal/style.scss +0 -220
  552. package/src/components/global-styles/font-library-modal/upload-fonts.js +0 -253
  553. package/src/components/global-styles/font-library-modal/utils/constants.js +0 -23
  554. package/src/components/global-styles/font-library-modal/utils/filter-fonts.js +0 -35
  555. package/src/components/global-styles/font-library-modal/utils/fonts-outline.js +0 -22
  556. package/src/components/global-styles/font-library-modal/utils/index.js +0 -333
  557. package/src/components/global-styles/font-library-modal/utils/make-families-from-faces.js +0 -27
  558. package/src/components/global-styles/font-library-modal/utils/preview-styles.js +0 -152
  559. package/src/components/global-styles/font-library-modal/utils/sort-font-faces.js +0 -37
  560. package/src/components/global-styles/font-library-modal/utils/test/filter-fonts.spec.js +0 -99
  561. package/src/components/global-styles/font-library-modal/utils/test/fonts-outline.spec.js +0 -109
  562. package/src/components/global-styles/font-library-modal/utils/test/getDisplaySrcFromFontFace.spec.js +0 -42
  563. package/src/components/global-styles/font-library-modal/utils/test/getFontFaceVariantName.spec.js +0 -30
  564. package/src/components/global-styles/font-library-modal/utils/test/isUrlEncoded.spec.js +0 -31
  565. package/src/components/global-styles/font-library-modal/utils/test/makeFamiliesFromFaces.spec.js +0 -57
  566. package/src/components/global-styles/font-library-modal/utils/test/mergeFontFaces.spec.js +0 -56
  567. package/src/components/global-styles/font-library-modal/utils/test/mergeFontFamilies.spec.js +0 -108
  568. package/src/components/global-styles/font-library-modal/utils/test/preview-styles.spec.js +0 -216
  569. package/src/components/global-styles/font-library-modal/utils/test/setUIValuesNeeded.spec.js +0 -41
  570. package/src/components/global-styles/font-library-modal/utils/test/sort-font-faces.js +0 -74
  571. package/src/components/global-styles/font-library-modal/utils/test/toggleFont.spec.js +0 -141
  572. package/src/components/global-styles/font-library-modal/utils/toggleFont.js +0 -90
  573. package/src/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js +0 -43
  574. package/src/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js +0 -37
  575. package/src/components/global-styles/font-sizes/font-size-preview.js +0 -43
  576. package/src/components/global-styles/font-sizes/font-size.js +0 -265
  577. package/src/components/global-styles/font-sizes/font-sizes-count.js +0 -37
  578. package/src/components/global-styles/font-sizes/font-sizes.js +0 -261
  579. package/src/components/global-styles/font-sizes/rename-font-size-dialog.js +0 -70
  580. package/src/components/global-styles/gradients-palette-panel.js +0 -123
  581. package/src/components/global-styles/header.js +0 -48
  582. package/src/components/global-styles/highlighted-colors.js +0 -39
  583. package/src/components/global-styles/hooks.js +0 -111
  584. package/src/components/global-styles/icon-with-current-color.js +0 -21
  585. package/src/components/global-styles/index.js +0 -1
  586. package/src/components/global-styles/navigation-button.js +0 -38
  587. package/src/components/global-styles/palette.js +0 -90
  588. package/src/components/global-styles/preset-colors.js +0 -18
  589. package/src/components/global-styles/preview-colors.js +0 -58
  590. package/src/components/global-styles/preview-styles.js +0 -185
  591. package/src/components/global-styles/preview-typography.js +0 -39
  592. package/src/components/global-styles/preview-wrapper.js +0 -126
  593. package/src/components/global-styles/root-menu.js +0 -84
  594. package/src/components/global-styles/screen-background.js +0 -37
  595. package/src/components/global-styles/screen-block-list.js +0 -187
  596. package/src/components/global-styles/screen-block.js +0 -358
  597. package/src/components/global-styles/screen-color-palette.js +0 -42
  598. package/src/components/global-styles/screen-colors.js +0 -55
  599. package/src/components/global-styles/screen-css.js +0 -67
  600. package/src/components/global-styles/screen-layout.js +0 -30
  601. package/src/components/global-styles/screen-revisions/index.js +0 -202
  602. package/src/components/global-styles/screen-revisions/revisions-buttons.js +0 -238
  603. package/src/components/global-styles/screen-revisions/style.scss +0 -194
  604. package/src/components/global-styles/screen-revisions/test/use-global-styles-revisions.js +0 -228
  605. package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +0 -159
  606. package/src/components/global-styles/screen-root.js +0 -102
  607. package/src/components/global-styles/screen-shadows.js +0 -13
  608. package/src/components/global-styles/screen-style-variations.js +0 -52
  609. package/src/components/global-styles/screen-typography-element.js +0 -121
  610. package/src/components/global-styles/screen-typography.js +0 -45
  611. package/src/components/global-styles/shadow-utils.js +0 -158
  612. package/src/components/global-styles/shadows-edit-panel.js +0 -525
  613. package/src/components/global-styles/shadows-panel.js +0 -196
  614. package/src/components/global-styles/size-control/index.js +0 -89
  615. package/src/components/global-styles/stories/index.story.js +0 -427
  616. package/src/components/global-styles/style-variations-container.js +0 -132
  617. package/src/components/global-styles/style.scss +0 -265
  618. package/src/components/global-styles/subtitle.js +0 -17
  619. package/src/components/global-styles/test/shadow-utils.spec.js +0 -251
  620. package/src/components/global-styles/test/utils.spec.js +0 -59
  621. package/src/components/global-styles/typeset.js +0 -73
  622. package/src/components/global-styles/typography-elements.js +0 -102
  623. package/src/components/global-styles/typography-example.js +0 -76
  624. package/src/components/global-styles/typography-panel.js +0 -54
  625. package/src/components/global-styles/typography-preview.js +0 -70
  626. package/src/components/global-styles/ui.js +0 -448
  627. package/src/components/global-styles/utils.js +0 -88
  628. package/src/components/global-styles/variations/style.scss +0 -43
  629. package/src/components/global-styles/variations/variation.js +0 -108
  630. package/src/components/global-styles/variations/variations-color.js +0 -45
  631. package/src/components/global-styles/variations/variations-panel.js +0 -65
  632. package/src/components/global-styles/variations/variations-typography.js +0 -54
  633. package/src/components/global-styles-renderer/index.js +0 -42
  634. package/src/components/global-styles-sidebar/default-sidebar.js +0 -51
  635. package/src/components/global-styles-sidebar/index.js +0 -206
  636. package/src/components/global-styles-sidebar/style.scss +0 -80
  637. package/src/components/revisions/index.js +0 -109
  638. package/src/components/style-book/categories.ts +0 -97
  639. package/src/components/style-book/color-examples.tsx +0 -57
  640. package/src/components/style-book/constants.ts +0 -308
  641. package/src/components/style-book/duotone-examples.tsx +0 -57
  642. package/src/components/style-book/examples.tsx +0 -273
  643. package/src/components/style-book/index.js +0 -804
  644. package/src/components/style-book/style.scss +0 -44
  645. package/src/components/style-book/test/categories.js +0 -166
  646. package/src/components/style-book/types.ts +0 -80
  647. package/src/components/welcome-guide/styles.js +0 -139
  648. package/src/hooks/index.js +0 -4
  649. package/src/hooks/push-changes-to-global-styles/index.js +0 -388
  650. package/src/hooks/push-changes-to-global-styles/style.scss +0 -4
  651. package/src/hooks/use-theme-style-variations/test/use-theme-style-variations-by-property.js +0 -271
  652. package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +0 -175
  653. package/src/utils/set-nested-value.js +0 -39
  654. package/tsconfig.tsbuildinfo +0 -1
@@ -1,66 +0,0 @@
1
- function getVariationClassName(variation) {
2
- if (!variation) {
3
- return "";
4
- }
5
- return `is-style-${variation}`;
6
- }
7
- function getNewIndexFromPresets(presets, slugPrefix) {
8
- const nameRegex = new RegExp(`^${slugPrefix}([\\d]+)$`);
9
- const highestPresetValue = presets.reduce((currentHighest, preset) => {
10
- if (typeof preset?.slug === "string") {
11
- const matches = preset?.slug.match(nameRegex);
12
- if (matches) {
13
- const id = parseInt(matches[1], 10);
14
- if (id > currentHighest) {
15
- return id;
16
- }
17
- }
18
- }
19
- return currentHighest;
20
- }, 0);
21
- return highestPresetValue + 1;
22
- }
23
- function getFontFamilyFromSetting(fontFamilies, setting) {
24
- if (!Array.isArray(fontFamilies) || !setting) {
25
- return null;
26
- }
27
- const fontFamilyVariable = setting.replace("var(", "").replace(")", "");
28
- const fontFamilySlug = fontFamilyVariable?.split("--").slice(-1)[0];
29
- return fontFamilies.find(
30
- (fontFamily) => fontFamily.slug === fontFamilySlug
31
- );
32
- }
33
- function getFontFamilies(themeJson) {
34
- const themeFontFamilies = themeJson?.settings?.typography?.fontFamilies?.theme;
35
- const customFontFamilies = themeJson?.settings?.typography?.fontFamilies?.custom;
36
- let fontFamilies = [];
37
- if (themeFontFamilies && customFontFamilies) {
38
- fontFamilies = [...themeFontFamilies, ...customFontFamilies];
39
- } else if (themeFontFamilies) {
40
- fontFamilies = themeFontFamilies;
41
- } else if (customFontFamilies) {
42
- fontFamilies = customFontFamilies;
43
- }
44
- const bodyFontFamilySetting = themeJson?.styles?.typography?.fontFamily;
45
- const bodyFontFamily = getFontFamilyFromSetting(
46
- fontFamilies,
47
- bodyFontFamilySetting
48
- );
49
- const headingFontFamilySetting = themeJson?.styles?.elements?.heading?.typography?.fontFamily;
50
- let headingFontFamily;
51
- if (!headingFontFamilySetting) {
52
- headingFontFamily = bodyFontFamily;
53
- } else {
54
- headingFontFamily = getFontFamilyFromSetting(
55
- fontFamilies,
56
- themeJson?.styles?.elements?.heading?.typography?.fontFamily
57
- );
58
- }
59
- return [bodyFontFamily, headingFontFamily];
60
- }
61
- export {
62
- getFontFamilies,
63
- getNewIndexFromPresets,
64
- getVariationClassName
65
- };
66
- //# sourceMappingURL=utils.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/global-styles/utils.js"],
4
- "sourcesContent": ["/**\n *\n * @param {string} variation The variation name.\n *\n * @return {string} The variation class name.\n */\nexport function getVariationClassName( variation ) {\n\tif ( ! variation ) {\n\t\treturn '';\n\t}\n\treturn `is-style-${ variation }`;\n}\n\n/**\n * Iterates through the presets array and searches for slugs that start with the specified\n * slugPrefix followed by a numerical suffix. It identifies the highest numerical suffix found\n * and returns one greater than the highest found suffix, ensuring that the new index is unique.\n *\n * @param {Array} presets The array of preset objects, each potentially containing a slug property.\n * @param {string} slugPrefix The prefix to look for in the preset slugs.\n *\n * @return {number} The next available index for a preset with the specified slug prefix, or 1 if no matching slugs are found.\n */\nexport function getNewIndexFromPresets( presets, slugPrefix ) {\n\tconst nameRegex = new RegExp( `^${ slugPrefix }([\\\\d]+)$` );\n\tconst highestPresetValue = presets.reduce( ( currentHighest, preset ) => {\n\t\tif ( typeof preset?.slug === 'string' ) {\n\t\t\tconst matches = preset?.slug.match( nameRegex );\n\t\t\tif ( matches ) {\n\t\t\t\tconst id = parseInt( matches[ 1 ], 10 );\n\t\t\t\tif ( id > currentHighest ) {\n\t\t\t\t\treturn id;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn currentHighest;\n\t}, 0 );\n\treturn highestPresetValue + 1;\n}\n\nfunction getFontFamilyFromSetting( fontFamilies, setting ) {\n\tif ( ! Array.isArray( fontFamilies ) || ! setting ) {\n\t\treturn null;\n\t}\n\n\tconst fontFamilyVariable = setting.replace( 'var(', '' ).replace( ')', '' );\n\tconst fontFamilySlug = fontFamilyVariable?.split( '--' ).slice( -1 )[ 0 ];\n\n\treturn fontFamilies.find(\n\t\t( fontFamily ) => fontFamily.slug === fontFamilySlug\n\t);\n}\n\nexport function getFontFamilies( themeJson ) {\n\tconst themeFontFamilies =\n\t\tthemeJson?.settings?.typography?.fontFamilies?.theme;\n\tconst customFontFamilies =\n\t\tthemeJson?.settings?.typography?.fontFamilies?.custom;\n\n\tlet fontFamilies = [];\n\tif ( themeFontFamilies && customFontFamilies ) {\n\t\tfontFamilies = [ ...themeFontFamilies, ...customFontFamilies ];\n\t} else if ( themeFontFamilies ) {\n\t\tfontFamilies = themeFontFamilies;\n\t} else if ( customFontFamilies ) {\n\t\tfontFamilies = customFontFamilies;\n\t}\n\tconst bodyFontFamilySetting = themeJson?.styles?.typography?.fontFamily;\n\tconst bodyFontFamily = getFontFamilyFromSetting(\n\t\tfontFamilies,\n\t\tbodyFontFamilySetting\n\t);\n\n\tconst headingFontFamilySetting =\n\t\tthemeJson?.styles?.elements?.heading?.typography?.fontFamily;\n\n\tlet headingFontFamily;\n\tif ( ! headingFontFamilySetting ) {\n\t\theadingFontFamily = bodyFontFamily;\n\t} else {\n\t\theadingFontFamily = getFontFamilyFromSetting(\n\t\t\tfontFamilies,\n\t\t\tthemeJson?.styles?.elements?.heading?.typography?.fontFamily\n\t\t);\n\t}\n\n\treturn [ bodyFontFamily, headingFontFamily ];\n}\n"],
5
- "mappings": "AAMO,SAAS,sBAAuB,WAAY;AAClD,MAAK,CAAE,WAAY;AAClB,WAAO;AAAA,EACR;AACA,SAAO,YAAa,SAAU;AAC/B;AAYO,SAAS,uBAAwB,SAAS,YAAa;AAC7D,QAAM,YAAY,IAAI,OAAQ,IAAK,UAAW,WAAY;AAC1D,QAAM,qBAAqB,QAAQ,OAAQ,CAAE,gBAAgB,WAAY;AACxE,QAAK,OAAO,QAAQ,SAAS,UAAW;AACvC,YAAM,UAAU,QAAQ,KAAK,MAAO,SAAU;AAC9C,UAAK,SAAU;AACd,cAAM,KAAK,SAAU,QAAS,CAAE,GAAG,EAAG;AACtC,YAAK,KAAK,gBAAiB;AAC1B,iBAAO;AAAA,QACR;AAAA,MACD;AAAA,IACD;AACA,WAAO;AAAA,EACR,GAAG,CAAE;AACL,SAAO,qBAAqB;AAC7B;AAEA,SAAS,yBAA0B,cAAc,SAAU;AAC1D,MAAK,CAAE,MAAM,QAAS,YAAa,KAAK,CAAE,SAAU;AACnD,WAAO;AAAA,EACR;AAEA,QAAM,qBAAqB,QAAQ,QAAS,QAAQ,EAAG,EAAE,QAAS,KAAK,EAAG;AAC1E,QAAM,iBAAiB,oBAAoB,MAAO,IAAK,EAAE,MAAO,EAAG,EAAG,CAAE;AAExE,SAAO,aAAa;AAAA,IACnB,CAAE,eAAgB,WAAW,SAAS;AAAA,EACvC;AACD;AAEO,SAAS,gBAAiB,WAAY;AAC5C,QAAM,oBACL,WAAW,UAAU,YAAY,cAAc;AAChD,QAAM,qBACL,WAAW,UAAU,YAAY,cAAc;AAEhD,MAAI,eAAe,CAAC;AACpB,MAAK,qBAAqB,oBAAqB;AAC9C,mBAAe,CAAE,GAAG,mBAAmB,GAAG,kBAAmB;AAAA,EAC9D,WAAY,mBAAoB;AAC/B,mBAAe;AAAA,EAChB,WAAY,oBAAqB;AAChC,mBAAe;AAAA,EAChB;AACA,QAAM,wBAAwB,WAAW,QAAQ,YAAY;AAC7D,QAAM,iBAAiB;AAAA,IACtB;AAAA,IACA;AAAA,EACD;AAEA,QAAM,2BACL,WAAW,QAAQ,UAAU,SAAS,YAAY;AAEnD,MAAI;AACJ,MAAK,CAAE,0BAA2B;AACjC,wBAAoB;AAAA,EACrB,OAAO;AACN,wBAAoB;AAAA,MACnB;AAAA,MACA,WAAW,QAAQ,UAAU,SAAS,YAAY;AAAA,IACnD;AAAA,EACD;AAEA,SAAO,CAAE,gBAAgB,iBAAkB;AAC5C;",
6
- "names": []
7
- }
@@ -1,88 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import clsx from "clsx";
3
- import { Tooltip } from "@wordpress/components";
4
- import { useMemo, useContext, useState } from "@wordpress/element";
5
- import { ENTER } from "@wordpress/keycodes";
6
- import { _x, sprintf } from "@wordpress/i18n";
7
- import { privateApis as blockEditorPrivateApis } from "@wordpress/block-editor";
8
- import { privateApis as editorPrivateApis } from "@wordpress/editor";
9
- import { filterObjectByProperties } from "../../../hooks/use-theme-style-variations/use-theme-style-variations-by-property";
10
- import { unlock } from "../../../lock-unlock";
11
- const { mergeBaseAndUserConfigs } = unlock(editorPrivateApis);
12
- const { GlobalStylesContext, areGlobalStyleConfigsEqual } = unlock(
13
- blockEditorPrivateApis
14
- );
15
- function Variation({
16
- variation,
17
- children,
18
- isPill,
19
- properties,
20
- showTooltip
21
- }) {
22
- const [isFocused, setIsFocused] = useState(false);
23
- const { base, user, setUserConfig } = useContext(GlobalStylesContext);
24
- const context = useMemo(() => {
25
- let merged = mergeBaseAndUserConfigs(base, variation);
26
- if (properties) {
27
- merged = filterObjectByProperties(merged, properties);
28
- }
29
- return {
30
- user: variation,
31
- base,
32
- merged,
33
- setUserConfig: () => {
34
- }
35
- };
36
- }, [variation, base, properties]);
37
- const selectVariation = () => setUserConfig(variation);
38
- const selectOnEnter = (event) => {
39
- if (event.keyCode === ENTER) {
40
- event.preventDefault();
41
- selectVariation();
42
- }
43
- };
44
- const isActive = useMemo(
45
- () => areGlobalStyleConfigsEqual(user, variation),
46
- [user, variation]
47
- );
48
- let label = variation?.title;
49
- if (variation?.description) {
50
- label = sprintf(
51
- /* translators: 1: variation title. 2: variation description. */
52
- _x("%1$s (%2$s)", "variation label"),
53
- variation?.title,
54
- variation?.description
55
- );
56
- }
57
- const content = /* @__PURE__ */ jsx(
58
- "div",
59
- {
60
- className: clsx("edit-site-global-styles-variations_item", {
61
- "is-active": isActive
62
- }),
63
- role: "button",
64
- onClick: selectVariation,
65
- onKeyDown: selectOnEnter,
66
- tabIndex: "0",
67
- "aria-label": label,
68
- "aria-current": isActive,
69
- onFocus: () => setIsFocused(true),
70
- onBlur: () => setIsFocused(false),
71
- children: /* @__PURE__ */ jsx(
72
- "div",
73
- {
74
- className: clsx(
75
- "edit-site-global-styles-variations_item-preview",
76
- { "is-pill": isPill }
77
- ),
78
- children: children(isFocused)
79
- }
80
- )
81
- }
82
- );
83
- return /* @__PURE__ */ jsx(GlobalStylesContext.Provider, { value: context, children: showTooltip ? /* @__PURE__ */ jsx(Tooltip, { text: variation?.title, children: content }) : content });
84
- }
85
- export {
86
- Variation as default
87
- };
88
- //# sourceMappingURL=variation.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../src/components/global-styles/variations/variation.js"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { Tooltip } from '@wordpress/components';\nimport { useMemo, useContext, useState } from '@wordpress/element';\nimport { ENTER } from '@wordpress/keycodes';\nimport { _x, sprintf } from '@wordpress/i18n';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { filterObjectByProperties } from '../../../hooks/use-theme-style-variations/use-theme-style-variations-by-property';\nimport { unlock } from '../../../lock-unlock';\n\nconst { mergeBaseAndUserConfigs } = unlock( editorPrivateApis );\nconst { GlobalStylesContext, areGlobalStyleConfigsEqual } = unlock(\n\tblockEditorPrivateApis\n);\n\nexport default function Variation( {\n\tvariation,\n\tchildren,\n\tisPill,\n\tproperties,\n\tshowTooltip,\n} ) {\n\tconst [ isFocused, setIsFocused ] = useState( false );\n\tconst { base, user, setUserConfig } = useContext( GlobalStylesContext );\n\n\tconst context = useMemo( () => {\n\t\tlet merged = mergeBaseAndUserConfigs( base, variation );\n\t\tif ( properties ) {\n\t\t\tmerged = filterObjectByProperties( merged, properties );\n\t\t}\n\t\treturn {\n\t\t\tuser: variation,\n\t\t\tbase,\n\t\t\tmerged,\n\t\t\tsetUserConfig: () => {},\n\t\t};\n\t}, [ variation, base, properties ] );\n\n\tconst selectVariation = () => setUserConfig( variation );\n\n\tconst selectOnEnter = ( event ) => {\n\t\tif ( event.keyCode === ENTER ) {\n\t\t\tevent.preventDefault();\n\t\t\tselectVariation();\n\t\t}\n\t};\n\n\tconst isActive = useMemo(\n\t\t() => areGlobalStyleConfigsEqual( user, variation ),\n\t\t[ user, variation ]\n\t);\n\n\tlet label = variation?.title;\n\tif ( variation?.description ) {\n\t\tlabel = sprintf(\n\t\t\t/* translators: 1: variation title. 2: variation description. */\n\t\t\t_x( '%1$s (%2$s)', 'variation label' ),\n\t\t\tvariation?.title,\n\t\t\tvariation?.description\n\t\t);\n\t}\n\n\tconst content = (\n\t\t<div\n\t\t\tclassName={ clsx( 'edit-site-global-styles-variations_item', {\n\t\t\t\t'is-active': isActive,\n\t\t\t} ) }\n\t\t\trole=\"button\"\n\t\t\tonClick={ selectVariation }\n\t\t\tonKeyDown={ selectOnEnter }\n\t\t\ttabIndex=\"0\"\n\t\t\taria-label={ label }\n\t\t\taria-current={ isActive }\n\t\t\tonFocus={ () => setIsFocused( true ) }\n\t\t\tonBlur={ () => setIsFocused( false ) }\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'edit-site-global-styles-variations_item-preview',\n\t\t\t\t\t{ 'is-pill': isPill }\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t{ children( isFocused ) }\n\t\t\t</div>\n\t\t</div>\n\t);\n\n\treturn (\n\t\t<GlobalStylesContext.Provider value={ context }>\n\t\t\t{ showTooltip ? (\n\t\t\t\t<Tooltip text={ variation?.title }>{ content }</Tooltip>\n\t\t\t) : (\n\t\t\t\tcontent\n\t\t\t) }\n\t\t</GlobalStylesContext.Provider>\n\t);\n}\n"],
5
- "mappings": "AAuFG;AApFH,OAAO,UAAU;AAKjB,SAAS,eAAe;AACxB,SAAS,SAAS,YAAY,gBAAgB;AAC9C,SAAS,aAAa;AACtB,SAAS,IAAI,eAAe;AAC5B,SAAS,eAAe,8BAA8B;AACtD,SAAS,eAAe,yBAAyB;AAKjD,SAAS,gCAAgC;AACzC,SAAS,cAAc;AAEvB,MAAM,EAAE,wBAAwB,IAAI,OAAQ,iBAAkB;AAC9D,MAAM,EAAE,qBAAqB,2BAA2B,IAAI;AAAA,EAC3D;AACD;AAEe,SAAR,UAA4B;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,QAAM,CAAE,WAAW,YAAa,IAAI,SAAU,KAAM;AACpD,QAAM,EAAE,MAAM,MAAM,cAAc,IAAI,WAAY,mBAAoB;AAEtE,QAAM,UAAU,QAAS,MAAM;AAC9B,QAAI,SAAS,wBAAyB,MAAM,SAAU;AACtD,QAAK,YAAa;AACjB,eAAS,yBAA0B,QAAQ,UAAW;AAAA,IACvD;AACA,WAAO;AAAA,MACN,MAAM;AAAA,MACN;AAAA,MACA;AAAA,MACA,eAAe,MAAM;AAAA,MAAC;AAAA,IACvB;AAAA,EACD,GAAG,CAAE,WAAW,MAAM,UAAW,CAAE;AAEnC,QAAM,kBAAkB,MAAM,cAAe,SAAU;AAEvD,QAAM,gBAAgB,CAAE,UAAW;AAClC,QAAK,MAAM,YAAY,OAAQ;AAC9B,YAAM,eAAe;AACrB,sBAAgB;AAAA,IACjB;AAAA,EACD;AAEA,QAAM,WAAW;AAAA,IAChB,MAAM,2BAA4B,MAAM,SAAU;AAAA,IAClD,CAAE,MAAM,SAAU;AAAA,EACnB;AAEA,MAAI,QAAQ,WAAW;AACvB,MAAK,WAAW,aAAc;AAC7B,YAAQ;AAAA;AAAA,MAEP,GAAI,eAAe,iBAAkB;AAAA,MACrC,WAAW;AAAA,MACX,WAAW;AAAA,IACZ;AAAA,EACD;AAEA,QAAM,UACL;AAAA,IAAC;AAAA;AAAA,MACA,WAAY,KAAM,2CAA2C;AAAA,QAC5D,aAAa;AAAA,MACd,CAAE;AAAA,MACF,MAAK;AAAA,MACL,SAAU;AAAA,MACV,WAAY;AAAA,MACZ,UAAS;AAAA,MACT,cAAa;AAAA,MACb,gBAAe;AAAA,MACf,SAAU,MAAM,aAAc,IAAK;AAAA,MACnC,QAAS,MAAM,aAAc,KAAM;AAAA,MAEnC;AAAA,QAAC;AAAA;AAAA,UACA,WAAY;AAAA,YACX;AAAA,YACA,EAAE,WAAW,OAAO;AAAA,UACrB;AAAA,UAEE,mBAAU,SAAU;AAAA;AAAA,MACvB;AAAA;AAAA,EACD;AAGD,SACC,oBAAC,oBAAoB,UAApB,EAA6B,OAAQ,SACnC,wBACD,oBAAC,WAAQ,MAAO,WAAW,OAAU,mBAAS,IAE9C,SAEF;AAEF;",
6
- "names": []
7
- }
@@ -1,34 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import {
3
- __experimentalGrid as Grid,
4
- __experimentalVStack as VStack
5
- } from "@wordpress/components";
6
- import StylesPreviewColors from "../preview-colors";
7
- import { useCurrentMergeThemeStyleVariationsWithUserConfig } from "../../../hooks/use-theme-style-variations/use-theme-style-variations-by-property";
8
- import Subtitle from "../subtitle";
9
- import Variation from "./variation";
10
- function ColorVariations({ title, gap = 2 }) {
11
- const propertiesToFilter = ["color"];
12
- const colorVariations = useCurrentMergeThemeStyleVariationsWithUserConfig(propertiesToFilter);
13
- if (colorVariations?.length <= 1) {
14
- return null;
15
- }
16
- return /* @__PURE__ */ jsxs(VStack, { spacing: 3, children: [
17
- title && /* @__PURE__ */ jsx(Subtitle, { level: 3, children: title }),
18
- /* @__PURE__ */ jsx(Grid, { spacing: gap, children: colorVariations.map((variation, index) => /* @__PURE__ */ jsx(
19
- Variation,
20
- {
21
- variation,
22
- isPill: true,
23
- properties: propertiesToFilter,
24
- showTooltip: true,
25
- children: () => /* @__PURE__ */ jsx(StylesPreviewColors, {})
26
- },
27
- index
28
- )) })
29
- ] });
30
- }
31
- export {
32
- ColorVariations as default
33
- };
34
- //# sourceMappingURL=variations-color.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../src/components/global-styles/variations/variations-color.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalGrid as Grid,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport StylesPreviewColors from '../preview-colors';\nimport { useCurrentMergeThemeStyleVariationsWithUserConfig } from '../../../hooks/use-theme-style-variations/use-theme-style-variations-by-property';\nimport Subtitle from '../subtitle';\nimport Variation from './variation';\n\nexport default function ColorVariations( { title, gap = 2 } ) {\n\tconst propertiesToFilter = [ 'color' ];\n\tconst colorVariations =\n\t\tuseCurrentMergeThemeStyleVariationsWithUserConfig( propertiesToFilter );\n\n\t// Return null if there is only one variation (the default).\n\tif ( colorVariations?.length <= 1 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<VStack spacing={ 3 }>\n\t\t\t{ title && <Subtitle level={ 3 }>{ title }</Subtitle> }\n\t\t\t<Grid spacing={ gap }>\n\t\t\t\t{ colorVariations.map( ( variation, index ) => (\n\t\t\t\t\t<Variation\n\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\tvariation={ variation }\n\t\t\t\t\t\tisPill\n\t\t\t\t\t\tproperties={ propertiesToFilter }\n\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t>\n\t\t\t\t\t\t{ () => <StylesPreviewColors /> }\n\t\t\t\t\t</Variation>\n\t\t\t\t) ) }\n\t\t\t</Grid>\n\t\t</VStack>\n\t);\n}\n"],
5
- "mappings": "AA2BE,SACY,KADZ;AAxBF;AAAA,EACC,sBAAsB;AAAA,EACtB,wBAAwB;AAAA,OAClB;AAKP,OAAO,yBAAyB;AAChC,SAAS,yDAAyD;AAClE,OAAO,cAAc;AACrB,OAAO,eAAe;AAEP,SAAR,gBAAkC,EAAE,OAAO,MAAM,EAAE,GAAI;AAC7D,QAAM,qBAAqB,CAAE,OAAQ;AACrC,QAAM,kBACL,kDAAmD,kBAAmB;AAGvE,MAAK,iBAAiB,UAAU,GAAI;AACnC,WAAO;AAAA,EACR;AAEA,SACC,qBAAC,UAAO,SAAU,GACf;AAAA,aAAS,oBAAC,YAAS,OAAQ,GAAM,iBAAO;AAAA,IAC1C,oBAAC,QAAK,SAAU,KACb,0BAAgB,IAAK,CAAE,WAAW,UACnC;AAAA,MAAC;AAAA;AAAA,QAEA;AAAA,QACA,QAAM;AAAA,QACN,YAAa;AAAA,QACb,aAAW;AAAA,QAET,gBAAM,oBAAC,uBAAoB;AAAA;AAAA,MANvB;AAAA,IAOP,CACC,GACH;AAAA,KACD;AAEF;",
6
- "names": []
7
- }
@@ -1,46 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { store as blocksStore } from "@wordpress/blocks";
3
- import { privateApis as blockEditorPrivateApis } from "@wordpress/block-editor";
4
- import { useSelect } from "@wordpress/data";
5
- import { __experimentalItemGroup as ItemGroup } from "@wordpress/components";
6
- import { NavigationButtonAsItem } from "../navigation-button";
7
- import { unlock } from "../../../lock-unlock";
8
- const { useGlobalStyle } = unlock(blockEditorPrivateApis);
9
- function getFilteredBlockStyles(blockStyles, variations) {
10
- return blockStyles?.filter(
11
- (style) => style.source === "block" || variations.includes(style.name)
12
- );
13
- }
14
- function useBlockVariations(name) {
15
- const blockStyles = useSelect(
16
- (select) => {
17
- const { getBlockStyles } = select(blocksStore);
18
- return getBlockStyles(name);
19
- },
20
- [name]
21
- );
22
- const [variations] = useGlobalStyle("variations", name);
23
- const variationNames = Object.keys(variations ?? {});
24
- return getFilteredBlockStyles(blockStyles, variationNames);
25
- }
26
- function VariationsPanel({ name }) {
27
- const coreBlockStyles = useBlockVariations(name);
28
- return /* @__PURE__ */ jsx(ItemGroup, { isBordered: true, isSeparated: true, children: coreBlockStyles.map((style, index) => {
29
- if (style?.isDefault) {
30
- return null;
31
- }
32
- return /* @__PURE__ */ jsx(
33
- NavigationButtonAsItem,
34
- {
35
- path: "/blocks/" + encodeURIComponent(name) + "/variations/" + encodeURIComponent(style.name),
36
- children: style.label
37
- },
38
- index
39
- );
40
- }) });
41
- }
42
- export {
43
- VariationsPanel,
44
- useBlockVariations
45
- };
46
- //# sourceMappingURL=variations-panel.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../src/components/global-styles/variations/variations-panel.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { NavigationButtonAsItem } from '../navigation-button';\nimport { unlock } from '../../../lock-unlock';\n\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\n\n// Only core block styles (source === block) or block styles with a matching\n// theme.json style variation will be configurable via Global Styles.\nfunction getFilteredBlockStyles( blockStyles, variations ) {\n\treturn blockStyles?.filter(\n\t\t( style ) =>\n\t\t\tstyle.source === 'block' || variations.includes( style.name )\n\t);\n}\n\nexport function useBlockVariations( name ) {\n\tconst blockStyles = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockStyles } = select( blocksStore );\n\t\t\treturn getBlockStyles( name );\n\t\t},\n\t\t[ name ]\n\t);\n\tconst [ variations ] = useGlobalStyle( 'variations', name );\n\tconst variationNames = Object.keys( variations ?? {} );\n\n\treturn getFilteredBlockStyles( blockStyles, variationNames );\n}\n\nexport function VariationsPanel( { name } ) {\n\tconst coreBlockStyles = useBlockVariations( name );\n\n\treturn (\n\t\t<ItemGroup isBordered isSeparated>\n\t\t\t{ coreBlockStyles.map( ( style, index ) => {\n\t\t\t\tif ( style?.isDefault ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\treturn (\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\tpath={\n\t\t\t\t\t\t\t'/blocks/' +\n\t\t\t\t\t\t\tencodeURIComponent( name ) +\n\t\t\t\t\t\t\t'/variations/' +\n\t\t\t\t\t\t\tencodeURIComponent( style.name )\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{ style.label }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</ItemGroup>\n\t);\n}\n"],
5
- "mappings": "AAiDK;AA9CL,SAAS,SAAS,mBAAmB;AACrC,SAAS,eAAe,8BAA8B;AACtD,SAAS,iBAAiB;AAC1B,SAAS,2BAA2B,iBAAiB;AAKrD,SAAS,8BAA8B;AACvC,SAAS,cAAc;AAEvB,MAAM,EAAE,eAAe,IAAI,OAAQ,sBAAuB;AAI1D,SAAS,uBAAwB,aAAa,YAAa;AAC1D,SAAO,aAAa;AAAA,IACnB,CAAE,UACD,MAAM,WAAW,WAAW,WAAW,SAAU,MAAM,IAAK;AAAA,EAC9D;AACD;AAEO,SAAS,mBAAoB,MAAO;AAC1C,QAAM,cAAc;AAAA,IACnB,CAAE,WAAY;AACb,YAAM,EAAE,eAAe,IAAI,OAAQ,WAAY;AAC/C,aAAO,eAAgB,IAAK;AAAA,IAC7B;AAAA,IACA,CAAE,IAAK;AAAA,EACR;AACA,QAAM,CAAE,UAAW,IAAI,eAAgB,cAAc,IAAK;AAC1D,QAAM,iBAAiB,OAAO,KAAM,cAAc,CAAC,CAAE;AAErD,SAAO,uBAAwB,aAAa,cAAe;AAC5D;AAEO,SAAS,gBAAiB,EAAE,KAAK,GAAI;AAC3C,QAAM,kBAAkB,mBAAoB,IAAK;AAEjD,SACC,oBAAC,aAAU,YAAU,MAAC,aAAW,MAC9B,0BAAgB,IAAK,CAAE,OAAO,UAAW;AAC1C,QAAK,OAAO,WAAY;AACvB,aAAO;AAAA,IACR;AACA,WACC;AAAA,MAAC;AAAA;AAAA,QAEA,MACC,aACA,mBAAoB,IAAK,IACzB,iBACA,mBAAoB,MAAM,IAAK;AAAA,QAG9B,gBAAM;AAAA;AAAA,MARF;AAAA,IASP;AAAA,EAEF,CAAE,GACH;AAEF;",
6
- "names": []
7
- }
@@ -1,48 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import {
3
- __experimentalGrid as Grid,
4
- __experimentalVStack as VStack
5
- } from "@wordpress/components";
6
- import StylesPreviewTypography from "../preview-typography";
7
- import { useCurrentMergeThemeStyleVariationsWithUserConfig } from "../../../hooks/use-theme-style-variations/use-theme-style-variations-by-property";
8
- import Subtitle from "../subtitle";
9
- import Variation from "./variation";
10
- function TypographyVariations({ title, gap = 2 }) {
11
- const propertiesToFilter = ["typography"];
12
- const typographyVariations = useCurrentMergeThemeStyleVariationsWithUserConfig(propertiesToFilter);
13
- if (typographyVariations?.length <= 1) {
14
- return null;
15
- }
16
- return /* @__PURE__ */ jsxs(VStack, { spacing: 3, children: [
17
- title && /* @__PURE__ */ jsx(Subtitle, { level: 3, children: title }),
18
- /* @__PURE__ */ jsx(
19
- Grid,
20
- {
21
- columns: 3,
22
- gap,
23
- className: "edit-site-global-styles-style-variations-container",
24
- children: typographyVariations.map((variation, index) => {
25
- return /* @__PURE__ */ jsx(
26
- Variation,
27
- {
28
- variation,
29
- properties: propertiesToFilter,
30
- showTooltip: true,
31
- children: () => /* @__PURE__ */ jsx(
32
- StylesPreviewTypography,
33
- {
34
- variation
35
- }
36
- )
37
- },
38
- index
39
- );
40
- })
41
- }
42
- )
43
- ] });
44
- }
45
- export {
46
- TypographyVariations as default
47
- };
48
- //# sourceMappingURL=variations-typography.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../src/components/global-styles/variations/variations-typography.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalGrid as Grid,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport StylesPreviewTypography from '../preview-typography';\nimport { useCurrentMergeThemeStyleVariationsWithUserConfig } from '../../../hooks/use-theme-style-variations/use-theme-style-variations-by-property';\nimport Subtitle from '../subtitle';\nimport Variation from './variation';\n\nexport default function TypographyVariations( { title, gap = 2 } ) {\n\tconst propertiesToFilter = [ 'typography' ];\n\tconst typographyVariations =\n\t\tuseCurrentMergeThemeStyleVariationsWithUserConfig( propertiesToFilter );\n\n\t// Return null if there is only one variation (the default).\n\tif ( typographyVariations?.length <= 1 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<VStack spacing={ 3 }>\n\t\t\t{ title && <Subtitle level={ 3 }>{ title }</Subtitle> }\n\t\t\t<Grid\n\t\t\t\tcolumns={ 3 }\n\t\t\t\tgap={ gap }\n\t\t\t\tclassName=\"edit-site-global-styles-style-variations-container\"\n\t\t\t>\n\t\t\t\t{ typographyVariations.map( ( variation, index ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Variation\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\tvariation={ variation }\n\t\t\t\t\t\t\tproperties={ propertiesToFilter }\n\t\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ () => (\n\t\t\t\t\t\t\t\t<StylesPreviewTypography\n\t\t\t\t\t\t\t\t\tvariation={ variation }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Variation>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</Grid>\n\t\t</VStack>\n\t);\n}\n"],
5
- "mappings": "AA2BE,SACY,KADZ;AAxBF;AAAA,EACC,sBAAsB;AAAA,EACtB,wBAAwB;AAAA,OAClB;AAKP,OAAO,6BAA6B;AACpC,SAAS,yDAAyD;AAClE,OAAO,cAAc;AACrB,OAAO,eAAe;AAEP,SAAR,qBAAuC,EAAE,OAAO,MAAM,EAAE,GAAI;AAClE,QAAM,qBAAqB,CAAE,YAAa;AAC1C,QAAM,uBACL,kDAAmD,kBAAmB;AAGvE,MAAK,sBAAsB,UAAU,GAAI;AACxC,WAAO;AAAA,EACR;AAEA,SACC,qBAAC,UAAO,SAAU,GACf;AAAA,aAAS,oBAAC,YAAS,OAAQ,GAAM,iBAAO;AAAA,IAC1C;AAAA,MAAC;AAAA;AAAA,QACA,SAAU;AAAA,QACV;AAAA,QACA,WAAU;AAAA,QAER,+BAAqB,IAAK,CAAE,WAAW,UAAW;AACnD,iBACC;AAAA,YAAC;AAAA;AAAA,cAEA;AAAA,cACA,YAAa;AAAA,cACb,aAAW;AAAA,cAET,gBACD;AAAA,gBAAC;AAAA;AAAA,kBACA;AAAA;AAAA,cACD;AAAA;AAAA,YARK;AAAA,UAUP;AAAA,QAEF,CAAE;AAAA;AAAA,IACH;AAAA,KACD;AAEF;",
6
- "names": []
7
- }
@@ -1,33 +0,0 @@
1
- import { useEffect } from "@wordpress/element";
2
- import { useSelect, useDispatch } from "@wordpress/data";
3
- import { privateApis as blockEditorPrivateApis } from "@wordpress/block-editor";
4
- import { store as editSiteStore } from "../../store";
5
- import { unlock } from "../../lock-unlock";
6
- const { useGlobalStylesOutput } = unlock(blockEditorPrivateApis);
7
- function useGlobalStylesRenderer(disableRootPadding) {
8
- const [styles, settings] = useGlobalStylesOutput(disableRootPadding);
9
- const { getSettings } = useSelect(editSiteStore);
10
- const { updateSettings } = useDispatch(editSiteStore);
11
- useEffect(() => {
12
- if (!styles || !settings) {
13
- return;
14
- }
15
- const currentStoreSettings = getSettings();
16
- const nonGlobalStyles = Object.values(
17
- currentStoreSettings.styles ?? []
18
- ).filter((style) => !style.isGlobalStyles);
19
- updateSettings({
20
- ...currentStoreSettings,
21
- styles: [...nonGlobalStyles, ...styles],
22
- __experimentalFeatures: settings
23
- });
24
- }, [styles, settings, updateSettings, getSettings]);
25
- }
26
- function GlobalStylesRenderer({ disableRootPadding }) {
27
- useGlobalStylesRenderer(disableRootPadding);
28
- return null;
29
- }
30
- export {
31
- GlobalStylesRenderer
32
- };
33
- //# sourceMappingURL=index.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/global-styles-renderer/index.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { useGlobalStylesOutput } = unlock( blockEditorPrivateApis );\n\nfunction useGlobalStylesRenderer( disableRootPadding ) {\n\tconst [ styles, settings ] = useGlobalStylesOutput( disableRootPadding );\n\tconst { getSettings } = useSelect( editSiteStore );\n\tconst { updateSettings } = useDispatch( editSiteStore );\n\n\tuseEffect( () => {\n\t\tif ( ! styles || ! settings ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst currentStoreSettings = getSettings();\n\t\tconst nonGlobalStyles = Object.values(\n\t\t\tcurrentStoreSettings.styles ?? []\n\t\t).filter( ( style ) => ! style.isGlobalStyles );\n\t\tupdateSettings( {\n\t\t\t...currentStoreSettings,\n\t\t\tstyles: [ ...nonGlobalStyles, ...styles ],\n\t\t\t__experimentalFeatures: settings,\n\t\t} );\n\t}, [ styles, settings, updateSettings, getSettings ] );\n}\n\nexport function GlobalStylesRenderer( { disableRootPadding } ) {\n\tuseGlobalStylesRenderer( disableRootPadding );\n\n\treturn null;\n}\n"],
5
- "mappings": "AAGA,SAAS,iBAAiB;AAC1B,SAAS,WAAW,mBAAmB;AACvC,SAAS,eAAe,8BAA8B;AAKtD,SAAS,SAAS,qBAAqB;AACvC,SAAS,cAAc;AAEvB,MAAM,EAAE,sBAAsB,IAAI,OAAQ,sBAAuB;AAEjE,SAAS,wBAAyB,oBAAqB;AACtD,QAAM,CAAE,QAAQ,QAAS,IAAI,sBAAuB,kBAAmB;AACvE,QAAM,EAAE,YAAY,IAAI,UAAW,aAAc;AACjD,QAAM,EAAE,eAAe,IAAI,YAAa,aAAc;AAEtD,YAAW,MAAM;AAChB,QAAK,CAAE,UAAU,CAAE,UAAW;AAC7B;AAAA,IACD;AAEA,UAAM,uBAAuB,YAAY;AACzC,UAAM,kBAAkB,OAAO;AAAA,MAC9B,qBAAqB,UAAU,CAAC;AAAA,IACjC,EAAE,OAAQ,CAAE,UAAW,CAAE,MAAM,cAAe;AAC9C,mBAAgB;AAAA,MACf,GAAG;AAAA,MACH,QAAQ,CAAE,GAAG,iBAAiB,GAAG,MAAO;AAAA,MACxC,wBAAwB;AAAA,IACzB,CAAE;AAAA,EACH,GAAG,CAAE,QAAQ,UAAU,gBAAgB,WAAY,CAAE;AACtD;AAEO,SAAS,qBAAsB,EAAE,mBAAmB,GAAI;AAC9D,0BAAyB,kBAAmB;AAE5C,SAAO;AACR;",
6
- "names": []
7
- }
@@ -1,48 +0,0 @@
1
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
- import { privateApis as editorPrivateApis } from "@wordpress/editor";
3
- import { unlock } from "../../lock-unlock";
4
- const { ComplementaryArea, ComplementaryAreaMoreMenuItem } = unlock(editorPrivateApis);
5
- function DefaultSidebar({
6
- className,
7
- identifier,
8
- title,
9
- icon,
10
- children,
11
- closeLabel,
12
- header,
13
- headerClassName,
14
- panelClassName,
15
- isActiveByDefault
16
- }) {
17
- return /* @__PURE__ */ jsxs(Fragment, { children: [
18
- /* @__PURE__ */ jsx(
19
- ComplementaryArea,
20
- {
21
- className,
22
- scope: "core",
23
- identifier,
24
- title,
25
- icon,
26
- closeLabel,
27
- header,
28
- headerClassName,
29
- panelClassName,
30
- isActiveByDefault,
31
- children
32
- }
33
- ),
34
- /* @__PURE__ */ jsx(
35
- ComplementaryAreaMoreMenuItem,
36
- {
37
- scope: "core",
38
- identifier,
39
- icon,
40
- children: title
41
- }
42
- )
43
- ] });
44
- }
45
- export {
46
- DefaultSidebar as default
47
- };
48
- //# sourceMappingURL=default-sidebar.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/global-styles-sidebar/default-sidebar.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { ComplementaryArea, ComplementaryAreaMoreMenuItem } =\n\tunlock( editorPrivateApis );\n\nexport default function DefaultSidebar( {\n\tclassName,\n\tidentifier,\n\ttitle,\n\ticon,\n\tchildren,\n\tcloseLabel,\n\theader,\n\theaderClassName,\n\tpanelClassName,\n\tisActiveByDefault,\n} ) {\n\treturn (\n\t\t<>\n\t\t\t<ComplementaryArea\n\t\t\t\tclassName={ className }\n\t\t\t\tscope=\"core\"\n\t\t\t\tidentifier={ identifier }\n\t\t\t\ttitle={ title }\n\t\t\t\ticon={ icon }\n\t\t\t\tcloseLabel={ closeLabel }\n\t\t\t\theader={ header }\n\t\t\t\theaderClassName={ headerClassName }\n\t\t\t\tpanelClassName={ panelClassName }\n\t\t\t\tisActiveByDefault={ isActiveByDefault }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</ComplementaryArea>\n\t\t\t<ComplementaryAreaMoreMenuItem\n\t\t\t\tscope=\"core\"\n\t\t\t\tidentifier={ identifier }\n\t\t\t\ticon={ icon }\n\t\t\t>\n\t\t\t\t{ title }\n\t\t\t</ComplementaryAreaMoreMenuItem>\n\t\t</>\n\t);\n}\n"],
5
- "mappings": "AA0BE,mBACC,KADD;AAvBF,SAAS,eAAe,yBAAyB;AAKjD,SAAS,cAAc;AAEvB,MAAM,EAAE,mBAAmB,8BAA8B,IACxD,OAAQ,iBAAkB;AAEZ,SAAR,eAAiC;AAAA,EACvC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,SACC,iCACC;AAAA;AAAA,MAAC;AAAA;AAAA,QACA;AAAA,QACA,OAAM;AAAA,QACN;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QAEE;AAAA;AAAA,IACH;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACA,OAAM;AAAA,QACN;AAAA,QACA;AAAA,QAEE;AAAA;AAAA,IACH;AAAA,KACD;AAEF;",
6
- "names": []
7
- }
@@ -1,175 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { FlexItem, Flex, Button } from "@wordpress/components";
3
- import { __ } from "@wordpress/i18n";
4
- import { styles, seen, backup } from "@wordpress/icons";
5
- import { useSelect, useDispatch } from "@wordpress/data";
6
- import { useEffect, useRef } from "@wordpress/element";
7
- import { store as preferencesStore } from "@wordpress/preferences";
8
- import {
9
- store as editorStore,
10
- privateApis as editorPrivateApis
11
- } from "@wordpress/editor";
12
- import { useViewportMatch } from "@wordpress/compose";
13
- import { privateApis as routerPrivateApis } from "@wordpress/router";
14
- import { GlobalStylesUI } from "../global-styles";
15
- import { store as editSiteStore } from "../../store";
16
- import { GlobalStylesMenuSlot } from "../global-styles/ui";
17
- import { unlock } from "../../lock-unlock";
18
- import { store as coreStore } from "@wordpress/core-data";
19
- import DefaultSidebar from "./default-sidebar";
20
- const { interfaceStore } = unlock(editorPrivateApis);
21
- const { useLocation } = unlock(routerPrivateApis);
22
- function GlobalStylesSidebar() {
23
- const { query } = useLocation();
24
- const { canvas = "view", name } = query;
25
- const {
26
- shouldClearCanvasContainerView,
27
- isStyleBookOpened,
28
- showListViewByDefault,
29
- hasRevisions,
30
- isRevisionsOpened,
31
- isRevisionsStyleBookOpened
32
- } = useSelect(
33
- (select) => {
34
- const { getActiveComplementaryArea: getActiveComplementaryArea2 } = select(interfaceStore);
35
- const { getEditorCanvasContainerView } = unlock(
36
- select(editSiteStore)
37
- );
38
- const canvasContainerView = getEditorCanvasContainerView();
39
- const _isVisualEditorMode = "visual" === select(editorStore).getEditorMode();
40
- const _isEditCanvasMode = "edit" === canvas;
41
- const _showListViewByDefault = select(preferencesStore).get(
42
- "core",
43
- "showListViewByDefault"
44
- );
45
- const { getEntityRecord, __experimentalGetCurrentGlobalStylesId } = select(coreStore);
46
- const globalStylesId = __experimentalGetCurrentGlobalStylesId();
47
- const globalStyles = globalStylesId ? getEntityRecord("root", "globalStyles", globalStylesId) : void 0;
48
- return {
49
- isStyleBookOpened: "style-book" === canvasContainerView,
50
- shouldClearCanvasContainerView: "edit-site/global-styles" !== getActiveComplementaryArea2("core") || !_isVisualEditorMode || !_isEditCanvasMode,
51
- showListViewByDefault: _showListViewByDefault,
52
- hasRevisions: !!globalStyles?._links?.["version-history"]?.[0]?.count,
53
- isRevisionsStyleBookOpened: "global-styles-revisions:style-book" === canvasContainerView,
54
- isRevisionsOpened: "global-styles-revisions" === canvasContainerView
55
- };
56
- },
57
- [canvas]
58
- );
59
- const { setEditorCanvasContainerView } = unlock(
60
- useDispatch(editSiteStore)
61
- );
62
- const isMobileViewport = useViewportMatch("medium", "<");
63
- useEffect(() => {
64
- if (shouldClearCanvasContainerView) {
65
- setEditorCanvasContainerView(void 0);
66
- }
67
- }, [shouldClearCanvasContainerView, setEditorCanvasContainerView]);
68
- const { setIsListViewOpened } = useDispatch(editorStore);
69
- const toggleRevisions = () => {
70
- setIsListViewOpened(false);
71
- if (isRevisionsStyleBookOpened) {
72
- setEditorCanvasContainerView("style-book");
73
- return;
74
- }
75
- if (isRevisionsOpened) {
76
- setEditorCanvasContainerView(void 0);
77
- return;
78
- }
79
- if (isStyleBookOpened) {
80
- setEditorCanvasContainerView(
81
- "global-styles-revisions:style-book"
82
- );
83
- } else {
84
- setEditorCanvasContainerView("global-styles-revisions");
85
- }
86
- };
87
- const toggleStyleBook = () => {
88
- if (isRevisionsOpened) {
89
- setEditorCanvasContainerView(
90
- "global-styles-revisions:style-book"
91
- );
92
- return;
93
- }
94
- if (isRevisionsStyleBookOpened) {
95
- setEditorCanvasContainerView("global-styles-revisions");
96
- return;
97
- }
98
- setIsListViewOpened(isStyleBookOpened && showListViewByDefault);
99
- setEditorCanvasContainerView(
100
- isStyleBookOpened ? void 0 : "style-book"
101
- );
102
- };
103
- const { getActiveComplementaryArea } = useSelect(interfaceStore);
104
- const { enableComplementaryArea } = useDispatch(interfaceStore);
105
- const previousActiveAreaRef = useRef(null);
106
- useEffect(() => {
107
- if (name === "styles" && canvas === "edit") {
108
- previousActiveAreaRef.current = getActiveComplementaryArea("core");
109
- enableComplementaryArea("core", "edit-site/global-styles");
110
- } else if (previousActiveAreaRef.current) {
111
- enableComplementaryArea("core", previousActiveAreaRef.current);
112
- }
113
- }, [name, enableComplementaryArea, canvas, getActiveComplementaryArea]);
114
- return /* @__PURE__ */ jsx(
115
- DefaultSidebar,
116
- {
117
- className: "edit-site-global-styles-sidebar",
118
- identifier: "edit-site/global-styles",
119
- title: __("Styles"),
120
- icon: styles,
121
- closeLabel: __("Close Styles"),
122
- panelClassName: "edit-site-global-styles-sidebar__panel",
123
- header: /* @__PURE__ */ jsxs(
124
- Flex,
125
- {
126
- className: "edit-site-global-styles-sidebar__header",
127
- gap: 1,
128
- children: [
129
- /* @__PURE__ */ jsx(FlexItem, { children: /* @__PURE__ */ jsx("h2", { className: "edit-site-global-styles-sidebar__header-title", children: __("Styles") }) }),
130
- /* @__PURE__ */ jsxs(
131
- Flex,
132
- {
133
- justify: "flex-end",
134
- gap: 1,
135
- className: "edit-site-global-styles-sidebar__header-actions",
136
- children: [
137
- !isMobileViewport && /* @__PURE__ */ jsx(FlexItem, { children: /* @__PURE__ */ jsx(
138
- Button,
139
- {
140
- icon: seen,
141
- label: __("Style Book"),
142
- isPressed: isStyleBookOpened || isRevisionsStyleBookOpened,
143
- accessibleWhenDisabled: true,
144
- disabled: shouldClearCanvasContainerView,
145
- onClick: toggleStyleBook,
146
- size: "compact"
147
- }
148
- ) }),
149
- /* @__PURE__ */ jsx(FlexItem, { children: /* @__PURE__ */ jsx(
150
- Button,
151
- {
152
- label: __("Revisions"),
153
- icon: backup,
154
- onClick: toggleRevisions,
155
- accessibleWhenDisabled: true,
156
- disabled: !hasRevisions,
157
- isPressed: isRevisionsOpened || isRevisionsStyleBookOpened,
158
- size: "compact"
159
- }
160
- ) }),
161
- /* @__PURE__ */ jsx(GlobalStylesMenuSlot, {})
162
- ]
163
- }
164
- )
165
- ]
166
- }
167
- ),
168
- children: /* @__PURE__ */ jsx(GlobalStylesUI, {})
169
- }
170
- );
171
- }
172
- export {
173
- GlobalStylesSidebar as default
174
- };
175
- //# sourceMappingURL=index.js.map