@wordpress/editor 14.33.3 → 14.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 (301) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/collab-sidebar/comment-author-info.js +26 -14
  3. package/build/components/collab-sidebar/comment-author-info.js.map +2 -2
  4. package/build/components/document-bar/index.js +16 -3
  5. package/build/components/document-bar/index.js.map +2 -2
  6. package/build/components/editor/index.js +23 -4
  7. package/build/components/editor/index.js.map +3 -3
  8. package/build/components/editor-interface/index.js +15 -10
  9. package/build/components/editor-interface/index.js.map +3 -3
  10. package/build/components/entities-saved-states/entity-type-list.js +19 -15
  11. package/build/components/entities-saved-states/entity-type-list.js.map +3 -3
  12. package/build/components/global-styles/block-link.js +70 -0
  13. package/build/components/global-styles/block-link.js.map +7 -0
  14. package/build/components/global-styles/header.js +54 -0
  15. package/build/components/global-styles/header.js.map +7 -0
  16. package/build/components/global-styles/hooks.js +176 -0
  17. package/build/components/global-styles/hooks.js.map +7 -0
  18. package/build/components/global-styles/index.js +138 -0
  19. package/build/components/global-styles/index.js.map +7 -0
  20. package/build/components/global-styles/menu.js +95 -0
  21. package/build/components/global-styles/menu.js.map +7 -0
  22. package/build/components/global-styles-provider/index.js +3 -49
  23. package/build/components/global-styles-provider/index.js.map +3 -3
  24. package/build/components/global-styles-renderer/index.js +55 -0
  25. package/build/components/global-styles-renderer/index.js.map +7 -0
  26. package/build/components/global-styles-sidebar/default-sidebar.js +66 -0
  27. package/build/components/global-styles-sidebar/default-sidebar.js.map +7 -0
  28. package/build/components/global-styles-sidebar/index.js +182 -0
  29. package/build/components/global-styles-sidebar/index.js.map +7 -0
  30. package/build/components/global-styles-sidebar/welcome-guide-image.js +37 -0
  31. package/build/components/global-styles-sidebar/welcome-guide-image.js.map +7 -0
  32. package/build/components/global-styles-sidebar/welcome-guide.js +143 -0
  33. package/build/components/global-styles-sidebar/welcome-guide.js.map +7 -0
  34. package/build/components/header/index.js +12 -9
  35. package/build/components/header/index.js.map +2 -2
  36. package/build/components/post-featured-image/index.js +32 -1
  37. package/build/components/post-featured-image/index.js.map +3 -3
  38. package/build/components/provider/index.js +0 -2
  39. package/build/components/provider/index.js.map +3 -3
  40. package/build/components/style-book/categories.js +86 -0
  41. package/build/components/style-book/categories.js.map +7 -0
  42. package/build/components/style-book/color-examples.js +64 -0
  43. package/build/components/style-book/color-examples.js.map +7 -0
  44. package/build/components/style-book/constants.js +319 -0
  45. package/build/components/style-book/constants.js.map +7 -0
  46. package/build/components/style-book/duotone-examples.js +68 -0
  47. package/build/components/style-book/duotone-examples.js.map +7 -0
  48. package/build/components/style-book/examples.js +237 -0
  49. package/build/components/style-book/examples.js.map +7 -0
  50. package/build/components/style-book/index.js +627 -0
  51. package/build/components/style-book/index.js.map +7 -0
  52. package/build/components/style-book/types.js +17 -0
  53. package/build/components/style-book/types.js.map +7 -0
  54. package/build/components/styles-canvas/index.js +138 -0
  55. package/build/components/styles-canvas/index.js.map +7 -0
  56. package/build/components/styles-canvas/revisions.js +121 -0
  57. package/build/components/styles-canvas/revisions.js.map +7 -0
  58. package/build/components/styles-canvas/style-book.js +68 -0
  59. package/build/components/styles-canvas/style-book.js.map +7 -0
  60. package/build/components/visual-editor/index.js +4 -3
  61. package/build/components/visual-editor/index.js.map +2 -2
  62. package/build/dataviews/fields/content-preview/content-preview-view.js.map +2 -2
  63. package/build/hooks/index.js +1 -0
  64. package/build/hooks/index.js.map +2 -2
  65. package/build/hooks/media-upload.js +15 -4
  66. package/build/hooks/media-upload.js.map +3 -3
  67. package/build/hooks/push-changes-to-global-styles/index.js +322 -0
  68. package/build/hooks/push-changes-to-global-styles/index.js.map +7 -0
  69. package/build/hooks/use-global-styles-output.js +74 -0
  70. package/build/hooks/use-global-styles-output.js.map +7 -0
  71. package/build/private-apis.js +10 -5
  72. package/build/private-apis.js.map +3 -3
  73. package/build/store/private-actions.js +23 -0
  74. package/build/store/private-actions.js.map +2 -2
  75. package/build/store/private-selectors.js +10 -0
  76. package/build/store/private-selectors.js.map +2 -2
  77. package/build/store/reducer.js +24 -0
  78. package/build/store/reducer.js.map +2 -2
  79. package/build/{components/editor-interface/content-slot-fill.js → utils/set-nested-value.js} +24 -10
  80. package/build/utils/set-nested-value.js.map +7 -0
  81. package/build-module/components/collab-sidebar/comment-author-info.js +26 -14
  82. package/build-module/components/collab-sidebar/comment-author-info.js.map +2 -2
  83. package/build-module/components/document-bar/index.js +16 -3
  84. package/build-module/components/document-bar/index.js.map +2 -2
  85. package/build-module/components/editor/index.js +23 -4
  86. package/build-module/components/editor/index.js.map +2 -2
  87. package/build-module/components/editor-interface/index.js +15 -10
  88. package/build-module/components/editor-interface/index.js.map +2 -2
  89. package/build-module/components/entities-saved-states/entity-type-list.js +18 -14
  90. package/build-module/components/entities-saved-states/entity-type-list.js.map +2 -2
  91. package/build-module/components/global-styles/block-link.js +46 -0
  92. package/build-module/components/global-styles/block-link.js.map +7 -0
  93. package/build-module/components/global-styles/header.js +41 -0
  94. package/build-module/components/global-styles/header.js.map +7 -0
  95. package/build-module/components/global-styles/hooks.js +154 -0
  96. package/build-module/components/global-styles/hooks.js.map +7 -0
  97. package/build-module/components/global-styles/index.js +112 -0
  98. package/build-module/components/global-styles/index.js.map +7 -0
  99. package/build-module/components/global-styles/menu.js +71 -0
  100. package/build-module/components/global-styles/menu.js.map +7 -0
  101. package/build-module/components/global-styles-provider/index.js +3 -37
  102. package/build-module/components/global-styles-provider/index.js.map +2 -2
  103. package/build-module/components/global-styles-renderer/index.js +31 -0
  104. package/build-module/components/global-styles-renderer/index.js.map +7 -0
  105. package/build-module/components/global-styles-sidebar/default-sidebar.js +49 -0
  106. package/build-module/components/global-styles-sidebar/default-sidebar.js.map +7 -0
  107. package/build-module/components/global-styles-sidebar/index.js +152 -0
  108. package/build-module/components/global-styles-sidebar/index.js.map +7 -0
  109. package/build-module/components/global-styles-sidebar/welcome-guide-image.js +17 -0
  110. package/build-module/components/global-styles-sidebar/welcome-guide-image.js.map +7 -0
  111. package/build-module/components/global-styles-sidebar/welcome-guide.js +113 -0
  112. package/build-module/components/global-styles-sidebar/welcome-guide.js.map +7 -0
  113. package/build-module/components/header/index.js +12 -9
  114. package/build-module/components/header/index.js.map +2 -2
  115. package/build-module/components/post-featured-image/index.js +35 -3
  116. package/build-module/components/post-featured-image/index.js.map +2 -2
  117. package/build-module/components/provider/index.js +0 -2
  118. package/build-module/components/provider/index.js.map +2 -2
  119. package/build-module/components/style-book/categories.js +64 -0
  120. package/build-module/components/style-book/categories.js.map +7 -0
  121. package/build-module/components/style-book/color-examples.js +37 -0
  122. package/build-module/components/style-book/color-examples.js.map +7 -0
  123. package/build-module/components/style-book/constants.js +290 -0
  124. package/build-module/components/style-book/constants.js.map +7 -0
  125. package/build-module/components/style-book/duotone-examples.js +48 -0
  126. package/build-module/components/style-book/duotone-examples.js.map +7 -0
  127. package/build-module/components/style-book/examples.js +208 -0
  128. package/build-module/components/style-book/examples.js.map +7 -0
  129. package/build-module/components/style-book/index.js +618 -0
  130. package/build-module/components/style-book/index.js.map +7 -0
  131. package/build-module/components/style-book/types.js +1 -0
  132. package/build-module/components/style-book/types.js.map +7 -0
  133. package/build-module/components/styles-canvas/index.js +104 -0
  134. package/build-module/components/styles-canvas/index.js.map +7 -0
  135. package/build-module/components/styles-canvas/revisions.js +107 -0
  136. package/build-module/components/styles-canvas/revisions.js.map +7 -0
  137. package/build-module/components/styles-canvas/style-book.js +38 -0
  138. package/build-module/components/styles-canvas/style-book.js.map +7 -0
  139. package/build-module/components/visual-editor/index.js +4 -3
  140. package/build-module/components/visual-editor/index.js.map +2 -2
  141. package/build-module/dataviews/fields/content-preview/content-preview-view.js.map +2 -2
  142. package/build-module/hooks/index.js +1 -0
  143. package/build-module/hooks/index.js.map +2 -2
  144. package/build-module/hooks/media-upload.js +19 -5
  145. package/build-module/hooks/media-upload.js.map +2 -2
  146. package/build-module/hooks/push-changes-to-global-styles/index.js +309 -0
  147. package/build-module/hooks/push-changes-to-global-styles/index.js.map +7 -0
  148. package/build-module/hooks/use-global-styles-output.js +49 -0
  149. package/build-module/hooks/use-global-styles-output.js.map +7 -0
  150. package/build-module/private-apis.js +10 -8
  151. package/build-module/private-apis.js.map +2 -2
  152. package/build-module/store/private-actions.js +20 -0
  153. package/build-module/store/private-actions.js.map +2 -2
  154. package/build-module/store/private-selectors.js +8 -0
  155. package/build-module/store/private-selectors.js.map +2 -2
  156. package/build-module/store/reducer.js +22 -0
  157. package/build-module/store/reducer.js.map +2 -2
  158. package/build-module/utils/set-nested-value.js +23 -0
  159. package/build-module/utils/set-nested-value.js.map +7 -0
  160. package/build-style/style-rtl.css +3017 -11
  161. package/build-style/style.css +3018 -11
  162. package/build-types/components/collab-sidebar/comment-author-info.d.ts +5 -16
  163. package/build-types/components/collab-sidebar/comment-author-info.d.ts.map +1 -1
  164. package/build-types/components/document-bar/index.d.ts +2 -2
  165. package/build-types/components/document-bar/index.d.ts.map +1 -1
  166. package/build-types/components/editor/index.d.ts.map +1 -1
  167. package/build-types/components/editor-interface/index.d.ts +1 -3
  168. package/build-types/components/editor-interface/index.d.ts.map +1 -1
  169. package/build-types/components/entities-saved-states/entity-type-list.d.ts.map +1 -1
  170. package/build-types/components/global-styles/block-link.d.ts +12 -0
  171. package/build-types/components/global-styles/block-link.d.ts.map +1 -0
  172. package/build-types/components/global-styles/header.d.ts +7 -0
  173. package/build-types/components/global-styles/header.d.ts.map +1 -0
  174. package/build-types/components/global-styles/hooks.d.ts +24 -0
  175. package/build-types/components/global-styles/hooks.d.ts.map +1 -0
  176. package/build-types/components/global-styles/index.d.ts +6 -0
  177. package/build-types/components/global-styles/index.d.ts.map +1 -0
  178. package/build-types/components/global-styles/menu.d.ts +13 -0
  179. package/build-types/components/global-styles/menu.d.ts.map +1 -0
  180. package/build-types/components/global-styles-provider/index.d.ts +1 -5
  181. package/build-types/components/global-styles-provider/index.d.ts.map +1 -1
  182. package/build-types/components/global-styles-renderer/index.d.ts +4 -0
  183. package/build-types/components/global-styles-renderer/index.d.ts.map +1 -0
  184. package/build-types/components/global-styles-sidebar/default-sidebar.d.ts +13 -0
  185. package/build-types/components/global-styles-sidebar/default-sidebar.d.ts.map +1 -0
  186. package/build-types/components/global-styles-sidebar/index.d.ts +2 -0
  187. package/build-types/components/global-styles-sidebar/index.d.ts.map +1 -0
  188. package/build-types/components/global-styles-sidebar/welcome-guide-image.d.ts +5 -0
  189. package/build-types/components/global-styles-sidebar/welcome-guide-image.d.ts.map +1 -0
  190. package/build-types/components/global-styles-sidebar/welcome-guide.d.ts +2 -0
  191. package/build-types/components/global-styles-sidebar/welcome-guide.d.ts.map +1 -0
  192. package/build-types/components/header/index.d.ts +1 -3
  193. package/build-types/components/header/index.d.ts.map +1 -1
  194. package/build-types/components/provider/index.d.ts.map +1 -1
  195. package/build-types/components/style-book/categories.d.ts +18 -0
  196. package/build-types/components/style-book/categories.d.ts.map +1 -0
  197. package/build-types/components/style-book/color-examples.d.ts +7 -0
  198. package/build-types/components/style-book/color-examples.d.ts.map +1 -0
  199. package/build-types/components/style-book/constants.d.ts +11 -0
  200. package/build-types/components/style-book/constants.d.ts.map +1 -0
  201. package/build-types/components/style-book/duotone-examples.d.ts +9 -0
  202. package/build-types/components/style-book/duotone-examples.d.ts.map +1 -0
  203. package/build-types/components/style-book/examples.d.ts +12 -0
  204. package/build-types/components/style-book/examples.d.ts.map +1 -0
  205. package/build-types/components/style-book/index.d.ts +31 -0
  206. package/build-types/components/style-book/index.d.ts.map +1 -0
  207. package/build-types/components/style-book/types.d.ts +72 -0
  208. package/build-types/components/style-book/types.d.ts.map +1 -0
  209. package/build-types/components/styles-canvas/index.d.ts +16 -0
  210. package/build-types/components/styles-canvas/index.d.ts.map +1 -0
  211. package/build-types/components/styles-canvas/revisions.d.ts +5 -0
  212. package/build-types/components/styles-canvas/revisions.d.ts.map +1 -0
  213. package/build-types/components/styles-canvas/style-book.d.ts +6 -0
  214. package/build-types/components/styles-canvas/style-book.d.ts.map +1 -0
  215. package/build-types/components/visual-editor/index.d.ts +1 -2
  216. package/build-types/components/visual-editor/index.d.ts.map +1 -1
  217. package/build-types/dataviews/fields/content-preview/content-preview-view.d.ts.map +1 -1
  218. package/build-types/hooks/push-changes-to-global-styles/index.d.ts +2 -0
  219. package/build-types/hooks/push-changes-to-global-styles/index.d.ts.map +1 -0
  220. package/build-types/hooks/use-global-styles-output.d.ts +18 -0
  221. package/build-types/hooks/use-global-styles-output.d.ts.map +1 -0
  222. package/build-types/private-apis.d.ts.map +1 -1
  223. package/build-types/store/private-actions.d.ts +20 -0
  224. package/build-types/store/private-actions.d.ts.map +1 -1
  225. package/build-types/store/private-selectors.d.ts +14 -0
  226. package/build-types/store/private-selectors.d.ts.map +1 -1
  227. package/build-types/store/reducer.d.ts +20 -0
  228. package/build-types/store/reducer.d.ts.map +1 -1
  229. package/build-types/utils/set-nested-value.d.ts +20 -0
  230. package/build-types/utils/set-nested-value.d.ts.map +1 -0
  231. package/package.json +40 -40
  232. package/src/components/collab-sidebar/comment-author-info.js +32 -25
  233. package/src/components/collab-sidebar/style.scss +1 -1
  234. package/src/components/document-bar/index.js +18 -3
  235. package/src/components/editor/index.js +25 -1
  236. package/src/components/editor-help/style.scss +1 -1
  237. package/src/components/editor-interface/index.js +40 -39
  238. package/src/components/entities-saved-states/entity-type-list.js +19 -17
  239. package/src/components/global-styles/block-link.js +65 -0
  240. package/src/components/global-styles/header.js +48 -0
  241. package/src/components/global-styles/hooks.js +216 -0
  242. package/src/components/global-styles/index.js +125 -0
  243. package/src/components/global-styles/menu.js +101 -0
  244. package/src/components/global-styles/style.scss +11 -0
  245. package/src/components/global-styles-provider/index.js +3 -45
  246. package/src/components/global-styles-renderer/index.js +39 -0
  247. package/src/components/global-styles-sidebar/default-sidebar.js +46 -0
  248. package/src/components/global-styles-sidebar/index.js +177 -0
  249. package/src/components/global-styles-sidebar/style.scss +119 -0
  250. package/src/components/global-styles-sidebar/welcome-guide-image.js +11 -0
  251. package/src/components/global-styles-sidebar/welcome-guide.js +136 -0
  252. package/src/components/header/index.js +11 -6
  253. package/src/components/post-featured-image/index.js +44 -1
  254. package/src/components/post-last-revision/style.scss +1 -1
  255. package/src/components/post-panel-row/style.scss +1 -0
  256. package/src/components/post-publish-panel/style.scss +1 -1
  257. package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +2 -2
  258. package/src/components/provider/index.js +0 -2
  259. package/src/components/style-book/categories.ts +97 -0
  260. package/src/components/style-book/color-examples.tsx +56 -0
  261. package/src/components/style-book/constants.ts +308 -0
  262. package/src/components/style-book/duotone-examples.tsx +56 -0
  263. package/src/components/style-book/examples.tsx +273 -0
  264. package/src/components/style-book/index.js +794 -0
  265. package/src/components/style-book/style.scss +44 -0
  266. package/src/components/style-book/test/categories.js +166 -0
  267. package/src/components/style-book/types.ts +80 -0
  268. package/src/components/styles-canvas/index.js +126 -0
  269. package/src/components/styles-canvas/revisions.js +144 -0
  270. package/src/components/styles-canvas/style-book.js +57 -0
  271. package/src/components/styles-canvas/style.scss +40 -0
  272. package/src/components/visual-editor/index.js +2 -1
  273. package/src/dataviews/fields/content-preview/content-preview-view.tsx +2 -0
  274. package/src/hooks/index.js +1 -0
  275. package/src/hooks/media-upload.js +25 -5
  276. package/src/hooks/push-changes-to-global-styles/index.js +391 -0
  277. package/src/hooks/push-changes-to-global-styles/style.scss +4 -0
  278. package/src/hooks/use-global-styles-output.js +76 -0
  279. package/src/private-apis.js +10 -8
  280. package/src/store/private-actions.js +37 -0
  281. package/src/store/private-selectors.js +20 -0
  282. package/src/store/reducer.js +36 -0
  283. package/src/style.scss +7 -1
  284. package/src/utils/set-nested-value.js +39 -0
  285. package/tsconfig.json +3 -0
  286. package/tsconfig.tsbuildinfo +1 -1
  287. package/build/components/block-settings-menu/content-only-settings-menu.js +0 -186
  288. package/build/components/block-settings-menu/content-only-settings-menu.js.map +0 -7
  289. package/build/components/editor-interface/content-slot-fill.js.map +0 -7
  290. package/build-module/components/block-settings-menu/content-only-settings-menu.js +0 -161
  291. package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +0 -7
  292. package/build-module/components/editor-interface/content-slot-fill.js +0 -9
  293. package/build-module/components/editor-interface/content-slot-fill.js.map +0 -7
  294. package/build-types/components/block-settings-menu/content-only-settings-menu.d.ts +0 -2
  295. package/build-types/components/block-settings-menu/content-only-settings-menu.d.ts.map +0 -1
  296. package/build-types/components/editor-interface/content-slot-fill.d.ts +0 -14
  297. package/build-types/components/editor-interface/content-slot-fill.d.ts.map +0 -1
  298. package/src/components/block-settings-menu/content-only-settings-menu.js +0 -185
  299. package/src/components/block-settings-menu/content-only-settings-menu.native.js +0 -4
  300. package/src/components/block-settings-menu/style.scss +0 -6
  301. package/src/components/editor-interface/content-slot-fill.js +0 -10
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/style-book/index.js"],
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tDisabled,\n\tComposite,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport {\n\tBlockList,\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n\tuseSettings,\n\tBlockEditorProvider,\n\t__unstableEditorStyles as EditorStyles,\n\t__unstableIframe as Iframe,\n\t__experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients,\n} from '@wordpress/block-editor';\nimport { useSelect, dispatch } from '@wordpress/data';\nimport { mergeGlobalStyles } from '@wordpress/global-styles-engine';\nimport {\n\tuseMemo,\n\tuseState,\n\tmemo,\n\tuseRef,\n\tuseLayoutEffect,\n\tuseEffect,\n\tforwardRef,\n} from '@wordpress/element';\nimport { ENTER, SPACE } from '@wordpress/keycodes';\nimport { uploadMedia } from '@wordpress/media-utils';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { STYLE_BOOK_IFRAME_STYLES } from './constants';\nimport {\n\tgetExamplesByCategory,\n\tgetTopLevelStyleBookCategories,\n} from './categories';\nimport { getExamples } from './examples';\nimport { GlobalStylesRenderer } from '../global-styles-renderer';\nimport {\n\tSTYLE_BOOK_COLOR_GROUPS,\n\tSTYLE_BOOK_PREVIEW_CATEGORIES,\n} from '../style-book/constants';\nimport { useGlobalStylesOutputWithConfig } from '../../hooks/use-global-styles-output';\nimport { useStyle, useGlobalStyles } from '../global-styles';\nimport { store as editorStore } from '../../store';\n\nconst { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );\nconst { Tabs } = unlock( componentsPrivateApis );\n\nfunction isObjectEmpty( object ) {\n\treturn ! object || Object.keys( object ).length === 0;\n}\n\n/**\n * Scrolls to a section within an iframe.\n *\n * @param {string} anchorId The id of the element to scroll to.\n * @param {HTMLIFrameElement} iframe The target iframe.\n */\nconst scrollToSection = ( anchorId, iframe ) => {\n\tif ( ! anchorId || ! iframe || ! iframe?.contentDocument ) {\n\t\treturn;\n\t}\n\n\tconst element =\n\t\tanchorId === 'top'\n\t\t\t? iframe.contentDocument.body\n\t\t\t: iframe.contentDocument.getElementById( anchorId );\n\tif ( element ) {\n\t\telement.scrollIntoView( {\n\t\t\tbehavior: 'smooth',\n\t\t} );\n\t}\n};\n\n/**\n * Parses a Block Editor navigation path to build a style book navigation path.\n * The object can be extended to include a category, representing a style book tab/section.\n *\n * @param {string} path An internal Block Editor navigation path.\n * @return {null|{block: string}} An object containing the example to navigate to.\n */\nconst getStyleBookNavigationFromPath = ( path ) => {\n\tif ( path && typeof path === 'string' ) {\n\t\tif (\n\t\t\tpath === '/' ||\n\t\t\tpath.startsWith( '/typography' ) ||\n\t\t\tpath.startsWith( '/colors' ) ||\n\t\t\tpath.startsWith( '/blocks' )\n\t\t) {\n\t\t\treturn {\n\t\t\t\ttop: true,\n\t\t\t};\n\t\t}\n\t}\n\treturn null;\n};\n\n/**\n * Retrieves colors, gradients, and duotone filters from Global Styles.\n * The inclusion of default (Core) palettes is controlled by the relevant\n * theme.json property e.g. defaultPalette, defaultGradients, defaultDuotone.\n *\n * @return {Object} Object containing properties for each type of palette.\n */\nfunction useMultiOriginPalettes() {\n\tconst { colors, gradients } = useMultipleOriginColorsAndGradients();\n\n\t// Add duotone filters to the palettes data.\n\tconst [\n\t\tshouldDisplayDefaultDuotones,\n\t\tcustomDuotones,\n\t\tthemeDuotones,\n\t\tdefaultDuotones,\n\t] = useSettings(\n\t\t'color.defaultDuotone',\n\t\t'color.duotone.custom',\n\t\t'color.duotone.theme',\n\t\t'color.duotone.default'\n\t);\n\n\tconst palettes = useMemo( () => {\n\t\tconst result = { colors, gradients, duotones: [] };\n\n\t\tif ( themeDuotones && themeDuotones.length ) {\n\t\t\tresult.duotones.push( {\n\t\t\t\tname: _x(\n\t\t\t\t\t'Theme',\n\t\t\t\t\t'Indicates these duotone filters come from the theme.'\n\t\t\t\t),\n\t\t\t\tslug: 'theme',\n\t\t\t\tduotones: themeDuotones,\n\t\t\t} );\n\t\t}\n\n\t\tif (\n\t\t\tshouldDisplayDefaultDuotones &&\n\t\t\tdefaultDuotones &&\n\t\t\tdefaultDuotones.length\n\t\t) {\n\t\t\tresult.duotones.push( {\n\t\t\t\tname: _x(\n\t\t\t\t\t'Default',\n\t\t\t\t\t'Indicates these duotone filters come from WordPress.'\n\t\t\t\t),\n\t\t\t\tslug: 'default',\n\t\t\t\tduotones: defaultDuotones,\n\t\t\t} );\n\t\t}\n\t\tif ( customDuotones && customDuotones.length ) {\n\t\t\tresult.duotones.push( {\n\t\t\t\tname: _x(\n\t\t\t\t\t'Custom',\n\t\t\t\t\t'Indicates these doutone filters are created by the user.'\n\t\t\t\t),\n\t\t\t\tslug: 'custom',\n\t\t\t\tduotones: customDuotones,\n\t\t\t} );\n\t\t}\n\n\t\treturn result;\n\t}, [\n\t\tcolors,\n\t\tgradients,\n\t\tcustomDuotones,\n\t\tthemeDuotones,\n\t\tdefaultDuotones,\n\t\tshouldDisplayDefaultDuotones,\n\t] );\n\n\treturn palettes;\n}\n\n/**\n * Get deduped examples for single page stylebook.\n * @param {Array} examples Array of examples.\n * @return {Array} Deduped examples.\n */\nexport function getExamplesForSinglePageUse( examples ) {\n\tconst examplesForSinglePageUse = [];\n\tconst overviewCategoryExamples = getExamplesByCategory(\n\t\t{ slug: 'overview' },\n\t\texamples\n\t);\n\texamplesForSinglePageUse.push( ...overviewCategoryExamples.examples );\n\tconst otherExamples = examples.filter( ( example ) => {\n\t\treturn (\n\t\t\texample.category !== 'overview' &&\n\t\t\t! overviewCategoryExamples.examples.find(\n\t\t\t\t( overviewExample ) => overviewExample.name === example.name\n\t\t\t)\n\t\t);\n\t} );\n\texamplesForSinglePageUse.push( ...otherExamples );\n\n\treturn examplesForSinglePageUse;\n}\n\n/**\n * Applies a block variation to each example by updating its attributes.\n *\n * @param {Array} examples Array of examples\n * @param {string} variation Block variation name.\n * @return {Array} Updated examples with variation applied.\n */\nfunction applyBlockVariationsToExamples( examples, variation ) {\n\tif ( ! variation ) {\n\t\treturn examples;\n\t}\n\treturn examples.map( ( example ) => {\n\t\treturn {\n\t\t\t...example,\n\t\t\tvariation,\n\t\t\tblocks: Array.isArray( example.blocks )\n\t\t\t\t? example.blocks.map( ( block ) => ( {\n\t\t\t\t\t\t...block,\n\t\t\t\t\t\tattributes: {\n\t\t\t\t\t\t\t...block.attributes,\n\t\t\t\t\t\t\tstyle: undefined,\n\t\t\t\t\t\t\tclassName: `is-style-${ variation }`,\n\t\t\t\t\t\t},\n\t\t\t\t } ) )\n\t\t\t\t: {\n\t\t\t\t\t\t...example.blocks,\n\t\t\t\t\t\tattributes: {\n\t\t\t\t\t\t\t...example.blocks.attributes,\n\t\t\t\t\t\t\tstyle: undefined,\n\t\t\t\t\t\t\tclassName: `is-style-${ variation }`,\n\t\t\t\t\t\t},\n\t\t\t\t },\n\t\t};\n\t} );\n}\n\nfunction StyleBook(\n\t{\n\t\tisSelected,\n\t\tonClick,\n\t\tonSelect,\n\t\tshowTabs = true,\n\t\tuserConfig = {},\n\t\tpath = '',\n\t},\n\tref\n) {\n\tconst textColor = useStyle( 'color.text' );\n\tconst backgroundColor = useStyle( 'color.background' );\n\tconst colors = useMultiOriginPalettes();\n\tconst examples = useMemo( () => getExamples( colors ), [ colors ] );\n\tconst tabs = useMemo(\n\t\t() =>\n\t\t\tgetTopLevelStyleBookCategories().filter( ( category ) =>\n\t\t\t\texamples.some(\n\t\t\t\t\t( example ) => example.category === category.slug\n\t\t\t\t)\n\t\t\t),\n\t\t[ examples ]\n\t);\n\n\tconst examplesForSinglePageUse = getExamplesForSinglePageUse( examples );\n\n\tconst { base: baseConfig } = useGlobalStyles();\n\tconst goTo = getStyleBookNavigationFromPath( path );\n\n\tconst mergedConfig = useMemo( () => {\n\t\tif ( ! isObjectEmpty( userConfig ) && ! isObjectEmpty( baseConfig ) ) {\n\t\t\treturn mergeGlobalStyles( baseConfig, userConfig );\n\t\t}\n\t\treturn {};\n\t}, [ baseConfig, userConfig ] );\n\n\tconst originalSettings = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings(),\n\t\t[]\n\t);\n\tconst [ globalStyles ] = useGlobalStylesOutputWithConfig( mergedConfig );\n\n\tconst settings = useMemo(\n\t\t() => ( {\n\t\t\t...originalSettings,\n\t\t\tstyles:\n\t\t\t\t! isObjectEmpty( globalStyles ) && ! isObjectEmpty( userConfig )\n\t\t\t\t\t? globalStyles\n\t\t\t\t\t: originalSettings.styles,\n\t\t\tisPreviewMode: true,\n\t\t} ),\n\t\t[ globalStyles, originalSettings, userConfig ]\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tref={ ref }\n\t\t\tclassName={ clsx( 'editor-style-book', {\n\t\t\t\t'is-button': !! onClick,\n\t\t\t} ) }\n\t\t\tstyle={ {\n\t\t\t\tcolor: textColor,\n\t\t\t\tbackground: backgroundColor,\n\t\t\t} }\n\t\t>\n\t\t\t{ showTabs ? (\n\t\t\t\t<Tabs>\n\t\t\t\t\t<div className=\"editor-style-book__tablist-container\">\n\t\t\t\t\t\t<Tabs.TabList>\n\t\t\t\t\t\t\t{ tabs.map( ( tab ) => (\n\t\t\t\t\t\t\t\t<Tabs.Tab tabId={ tab.slug } key={ tab.slug }>\n\t\t\t\t\t\t\t\t\t{ tab.title }\n\t\t\t\t\t\t\t\t</Tabs.Tab>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t</Tabs.TabList>\n\t\t\t\t\t</div>\n\t\t\t\t\t{ tabs.map( ( tab ) => {\n\t\t\t\t\t\tconst categoryDefinition = tab.slug\n\t\t\t\t\t\t\t? getTopLevelStyleBookCategories().find(\n\t\t\t\t\t\t\t\t\t( _category ) => _category.slug === tab.slug\n\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t: null;\n\t\t\t\t\t\tconst filteredExamples = categoryDefinition\n\t\t\t\t\t\t\t? getExamplesByCategory(\n\t\t\t\t\t\t\t\t\tcategoryDefinition,\n\t\t\t\t\t\t\t\t\texamples\n\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t: { examples };\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<Tabs.TabPanel\n\t\t\t\t\t\t\t\tkey={ tab.slug }\n\t\t\t\t\t\t\t\ttabId={ tab.slug }\n\t\t\t\t\t\t\t\tfocusable={ false }\n\t\t\t\t\t\t\t\tclassName=\"editor-style-book__tabpanel\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<StyleBookBody\n\t\t\t\t\t\t\t\t\tcategory={ tab.slug }\n\t\t\t\t\t\t\t\t\texamples={ filteredExamples }\n\t\t\t\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\t\t\t\tsettings={ settings }\n\t\t\t\t\t\t\t\t\ttitle={ tab.title }\n\t\t\t\t\t\t\t\t\tgoTo={ goTo }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</Tabs.TabPanel>\n\t\t\t\t\t\t);\n\t\t\t\t\t} ) }\n\t\t\t\t</Tabs>\n\t\t\t) : (\n\t\t\t\t<StyleBookBody\n\t\t\t\t\texamples={ { examples: examplesForSinglePageUse } }\n\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\tonClick={ onClick }\n\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t\tgoTo={ goTo }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\n/**\n * Style Book Preview component renders the stylebook without the Editor dependency.\n *\n * @param {Object} props Component props.\n * @param {string} props.path Current path in global styles.\n * @param {Function} props.onPathChange Callback when the path changes.\n * @param {Object} props.userConfig User configuration.\n * @param {boolean} props.isStatic Whether the stylebook is static or clickable.\n * @return {Object} Style Book Preview component.\n */\nexport const StyleBookPreview = ( {\n\tuserConfig = {},\n\tisStatic = false,\n\tpath,\n\tonPathChange,\n} ) => {\n\tconst editorSettings = useSelect(\n\t\t( select ) => select( editorStore ).getEditorSettings(),\n\t\t[]\n\t);\n\n\tconst canUserUploadMedia = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).canUser( 'create', {\n\t\t\t\tkind: 'postType',\n\t\t\t\tname: 'attachment',\n\t\t\t} ),\n\t\t[]\n\t);\n\n\t// Update block editor settings because useMultipleOriginColorsAndGradients fetch colours from there.\n\tuseEffect( () => {\n\t\tdispatch( blockEditorStore ).updateSettings( {\n\t\t\t...editorSettings,\n\t\t\tmediaUpload: canUserUploadMedia ? uploadMedia : undefined,\n\t\t} );\n\t}, [ editorSettings, canUserUploadMedia ] );\n\n\tconst [ internalPath, setInternalPath ] = useState( '/' );\n\tconst section = path ?? internalPath;\n\tconst onChangeSection = onPathChange ?? setInternalPath;\n\n\tconst isSelected = ( blockName ) => {\n\t\t// Match '/blocks/core%2Fbutton' and\n\t\t// '/blocks/core%2Fbutton/typography', but not\n\t\t// '/blocks/core%2Fbuttons'.\n\t\treturn (\n\t\t\tsection === `/blocks/${ encodeURIComponent( blockName ) }` ||\n\t\t\tsection.startsWith(\n\t\t\t\t`/blocks/${ encodeURIComponent( blockName ) }/`\n\t\t\t)\n\t\t);\n\t};\n\n\tconst onSelect = ( blockName, isBlockVariation = false ) => {\n\t\tif (\n\t\t\tSTYLE_BOOK_COLOR_GROUPS.find(\n\t\t\t\t( group ) => group.slug === blockName\n\t\t\t)\n\t\t) {\n\t\t\t// Go to color palettes Global Styles.\n\t\t\tonChangeSection( '/colors/palette' );\n\t\t\treturn;\n\t\t}\n\t\tif ( blockName === 'typography' ) {\n\t\t\t// Go to typography Global Styles.\n\t\t\tonChangeSection( '/typography' );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isBlockVariation ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Now go to the selected block.\n\t\tonChangeSection( `/blocks/${ encodeURIComponent( blockName ) }` );\n\t};\n\n\tconst colors = useMultiOriginPalettes();\n\tconst examples = getExamples( colors );\n\tconst examplesForSinglePageUse = getExamplesForSinglePageUse( examples );\n\n\tlet previewCategory = null;\n\tlet blockVariation = null;\n\tif ( section.includes( '/colors' ) ) {\n\t\tpreviewCategory = 'colors';\n\t} else if ( section.includes( '/typography' ) ) {\n\t\tpreviewCategory = 'text';\n\t} else if ( section.includes( '/blocks' ) ) {\n\t\tpreviewCategory = 'blocks';\n\t\tlet blockName = decodeURIComponent( section ).split( '/blocks/' )[ 1 ];\n\n\t\t// The blockName can contain variations, if so, extract the variation.\n\t\tif ( blockName?.includes( '/variations' ) ) {\n\t\t\t[ blockName, blockVariation ] = blockName.split( '/variations/' );\n\t\t}\n\n\t\tif (\n\t\t\tblockName &&\n\t\t\texamples.find( ( example ) => example.name === blockName )\n\t\t) {\n\t\t\tpreviewCategory = blockName;\n\t\t}\n\t} else if ( ! isStatic ) {\n\t\tpreviewCategory = 'overview';\n\t}\n\tconst categoryDefinition = STYLE_BOOK_PREVIEW_CATEGORIES.find(\n\t\t( category ) => category.slug === previewCategory\n\t);\n\n\tconst filteredExamples = useMemo( () => {\n\t\t// If there's no category definition there may be a single block.\n\t\tif ( ! categoryDefinition ) {\n\t\t\treturn {\n\t\t\t\texamples: [\n\t\t\t\t\texamples.find(\n\t\t\t\t\t\t( example ) => example.name === previewCategory\n\t\t\t\t\t),\n\t\t\t\t],\n\t\t\t};\n\t\t}\n\n\t\treturn getExamplesByCategory( categoryDefinition, examples );\n\t}, [ categoryDefinition, examples, previewCategory ] );\n\n\tconst displayedExamples = useMemo( () => {\n\t\t// If there's no preview category, show all examples.\n\t\tif ( ! previewCategory ) {\n\t\t\treturn { examples: examplesForSinglePageUse };\n\t\t}\n\n\t\tif ( blockVariation ) {\n\t\t\treturn {\n\t\t\t\texamples: applyBlockVariationsToExamples(\n\t\t\t\t\tfilteredExamples.examples,\n\t\t\t\t\tblockVariation\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\n\t\treturn filteredExamples;\n\t}, [\n\t\tpreviewCategory,\n\t\texamplesForSinglePageUse,\n\t\tblockVariation,\n\t\tfilteredExamples,\n\t] );\n\n\tconst { base: baseConfig } = useGlobalStyles();\n\tconst goTo = getStyleBookNavigationFromPath( section );\n\n\tconst mergedConfig = useMemo( () => {\n\t\tif ( ! isObjectEmpty( userConfig ) && ! isObjectEmpty( baseConfig ) ) {\n\t\t\treturn mergeGlobalStyles( baseConfig, userConfig );\n\t\t}\n\t\treturn {};\n\t}, [ baseConfig, userConfig ] );\n\n\tconst [ globalStyles ] = useGlobalStylesOutputWithConfig( mergedConfig );\n\n\tconst settings = useMemo(\n\t\t() => ( {\n\t\t\t...editorSettings,\n\t\t\tstyles:\n\t\t\t\t! isObjectEmpty( globalStyles ) && ! isObjectEmpty( userConfig )\n\t\t\t\t\t? globalStyles\n\t\t\t\t\t: editorSettings.styles,\n\t\t\tisPreviewMode: true,\n\t\t} ),\n\t\t[ globalStyles, editorSettings, userConfig ]\n\t);\n\n\treturn (\n\t\t<div className=\"editor-style-book\">\n\t\t\t<BlockEditorProvider settings={ settings }>\n\t\t\t\t<GlobalStylesRenderer disableRootPadding />\n\t\t\t\t<StyleBookBody\n\t\t\t\t\texamples={ displayedExamples }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t\tgoTo={ goTo }\n\t\t\t\t\tisSelected={ ! isStatic ? isSelected : null }\n\t\t\t\t\tonSelect={ ! isStatic ? onSelect : null }\n\t\t\t\t/>\n\t\t\t</BlockEditorProvider>\n\t\t</div>\n\t);\n};\n\nexport const StyleBookBody = ( {\n\texamples,\n\tisSelected,\n\tonClick,\n\tonSelect,\n\tsettings,\n\ttitle,\n\tgoTo,\n} ) => {\n\tconst [ isFocused, setIsFocused ] = useState( false );\n\tconst [ hasIframeLoaded, setHasIframeLoaded ] = useState( false );\n\tconst iframeRef = useRef( null );\n\t// The presence of an `onClick` prop indicates that the Style Book is being used as a button.\n\t// In this case, add additional props to the iframe to make it behave like a button.\n\tconst buttonModeProps = {\n\t\trole: 'button',\n\t\tonFocus: () => setIsFocused( true ),\n\t\tonBlur: () => setIsFocused( false ),\n\t\tonKeyDown: ( event ) => {\n\t\t\tif ( event.defaultPrevented ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst { keyCode } = event;\n\t\t\tif ( onClick && ( keyCode === ENTER || keyCode === SPACE ) ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tonClick( event );\n\t\t\t}\n\t\t},\n\t\tonClick: ( event ) => {\n\t\t\tif ( event.defaultPrevented ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( onClick ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tonClick( event );\n\t\t\t}\n\t\t},\n\t\treadonly: true,\n\t};\n\n\tconst handleLoad = () => setHasIframeLoaded( true );\n\tuseLayoutEffect( () => {\n\t\tif ( hasIframeLoaded && iframeRef?.current ) {\n\t\t\tif ( goTo?.top ) {\n\t\t\t\tscrollToSection( 'top', iframeRef?.current );\n\t\t\t}\n\t\t}\n\t}, [ iframeRef?.current, goTo, scrollToSection, hasIframeLoaded ] );\n\n\treturn (\n\t\t<Iframe\n\t\t\tonLoad={ handleLoad }\n\t\t\tref={ iframeRef }\n\t\t\tclassName={ clsx( 'editor-style-book__iframe', {\n\t\t\t\t'is-focused': isFocused && !! onClick,\n\t\t\t\t'is-button': !! onClick,\n\t\t\t} ) }\n\t\t\tname=\"style-book-canvas\"\n\t\t\ttabIndex={ 0 }\n\t\t\t{ ...( onClick ? buttonModeProps : {} ) }\n\t\t>\n\t\t\t<EditorStyles styles={ settings.styles } />\n\t\t\t<style>\n\t\t\t\t{ STYLE_BOOK_IFRAME_STYLES }\n\t\t\t\t{ !! onClick &&\n\t\t\t\t\t'body { cursor: pointer; } body * { pointer-events: none; }' }\n\t\t\t</style>\n\t\t\t<Examples\n\t\t\t\tclassName=\"editor-style-book__examples\"\n\t\t\t\tfilteredExamples={ examples }\n\t\t\t\tlabel={\n\t\t\t\t\ttitle\n\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t// translators: %s: Category of blocks, e.g. Text.\n\t\t\t\t\t\t\t\t__( 'Examples of blocks in the %s category' ),\n\t\t\t\t\t\t\t\ttitle\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: __( 'Examples of blocks' )\n\t\t\t\t}\n\t\t\t\tisSelected={ isSelected }\n\t\t\t\tonSelect={ onSelect }\n\t\t\t\tkey={ title }\n\t\t\t/>\n\t\t</Iframe>\n\t);\n};\n\nconst Examples = memo(\n\t( { className, filteredExamples, label, isSelected, onSelect } ) => {\n\t\treturn (\n\t\t\t<Composite\n\t\t\t\torientation=\"vertical\"\n\t\t\t\tclassName={ className }\n\t\t\t\taria-label={ label }\n\t\t\t\trole=\"grid\"\n\t\t\t>\n\t\t\t\t{ !! filteredExamples?.examples?.length &&\n\t\t\t\t\tfilteredExamples.examples.map( ( example ) => (\n\t\t\t\t\t\t<Example\n\t\t\t\t\t\t\tkey={ example.name }\n\t\t\t\t\t\t\tid={ `example-${ example.name }` }\n\t\t\t\t\t\t\ttitle={ example.title }\n\t\t\t\t\t\t\tcontent={ example.content }\n\t\t\t\t\t\t\tblocks={ example.blocks }\n\t\t\t\t\t\t\tisSelected={ isSelected?.( example.name ) }\n\t\t\t\t\t\t\tonClick={\n\t\t\t\t\t\t\t\t!! onSelect\n\t\t\t\t\t\t\t\t\t? () =>\n\t\t\t\t\t\t\t\t\t\t\tonSelect(\n\t\t\t\t\t\t\t\t\t\t\t\texample.name,\n\t\t\t\t\t\t\t\t\t\t\t\t!! example.variation\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t: null\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{ !! filteredExamples?.subcategories?.length &&\n\t\t\t\t\tfilteredExamples.subcategories.map( ( subcategory ) => (\n\t\t\t\t\t\t<Composite.Group\n\t\t\t\t\t\t\tclassName=\"editor-style-book__subcategory\"\n\t\t\t\t\t\t\tkey={ `subcategory-${ subcategory.slug }` }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Composite.GroupLabel>\n\t\t\t\t\t\t\t\t<h2 className=\"editor-style-book__subcategory-title\">\n\t\t\t\t\t\t\t\t\t{ subcategory.title }\n\t\t\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t\t</Composite.GroupLabel>\n\t\t\t\t\t\t\t<Subcategory\n\t\t\t\t\t\t\t\texamples={ subcategory.examples }\n\t\t\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Composite.Group>\n\t\t\t\t\t) ) }\n\t\t\t</Composite>\n\t\t);\n\t}\n);\n\nconst Subcategory = ( { examples, isSelected, onSelect } ) => {\n\treturn (\n\t\t!! examples?.length &&\n\t\texamples.map( ( example ) => (\n\t\t\t<Example\n\t\t\t\tkey={ example.name }\n\t\t\t\tid={ `example-${ example.name }` }\n\t\t\t\ttitle={ example.title }\n\t\t\t\tcontent={ example.content }\n\t\t\t\tblocks={ example.blocks }\n\t\t\t\tisSelected={ isSelected?.( example.name ) }\n\t\t\t\tonClick={ !! onSelect ? () => onSelect( example.name ) : null }\n\t\t\t/>\n\t\t) )\n\t);\n};\n\nconst disabledExamples = [ 'example-duotones' ];\n\nconst Example = ( { id, title, blocks, isSelected, onClick, content } ) => {\n\tconst originalSettings = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings(),\n\t\t[]\n\t);\n\tconst settings = useMemo(\n\t\t() => ( {\n\t\t\t...originalSettings,\n\t\t\tfocusMode: false, // Disable \"Spotlight mode\".\n\t\t\tisPreviewMode: true,\n\t\t} ),\n\t\t[ originalSettings ]\n\t);\n\n\t// Cache the list of blocks to avoid additional processing when the component is re-rendered.\n\tconst renderedBlocks = useMemo(\n\t\t() => ( Array.isArray( blocks ) ? blocks : [ blocks ] ),\n\t\t[ blocks ]\n\t);\n\n\tconst disabledProps =\n\t\tdisabledExamples.includes( id ) || ! onClick\n\t\t\t? {\n\t\t\t\t\tdisabled: true,\n\t\t\t\t\taccessibleWhenDisabled: !! onClick,\n\t\t\t }\n\t\t\t: {};\n\n\treturn (\n\t\t<div role=\"row\">\n\t\t\t<div role=\"gridcell\">\n\t\t\t\t<Composite.Item\n\t\t\t\t\tclassName={ clsx( 'editor-style-book__example', {\n\t\t\t\t\t\t'is-selected': isSelected,\n\t\t\t\t\t\t'is-disabled-example': !! disabledProps?.disabled,\n\t\t\t\t\t} ) }\n\t\t\t\t\tid={ id }\n\t\t\t\t\taria-label={\n\t\t\t\t\t\t!! onClick\n\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t// translators: %s: Title of a block, e.g. Heading.\n\t\t\t\t\t\t\t\t\t__( 'Open %s styles in Styles panel' ),\n\t\t\t\t\t\t\t\t\ttitle\n\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t}\n\t\t\t\t\trender={ <div /> }\n\t\t\t\t\trole={ !! onClick ? 'button' : null }\n\t\t\t\t\tonClick={ onClick }\n\t\t\t\t\t{ ...disabledProps }\n\t\t\t\t>\n\t\t\t\t\t<span className=\"editor-style-book__example-title\">\n\t\t\t\t\t\t{ title }\n\t\t\t\t\t</span>\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName=\"editor-style-book__example-preview\"\n\t\t\t\t\t\taria-hidden\n\t\t\t\t\t>\n\t\t\t\t\t\t<Disabled className=\"editor-style-book__example-preview__content\">\n\t\t\t\t\t\t\t{ content ? (\n\t\t\t\t\t\t\t\tcontent\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<ExperimentalBlockEditorProvider\n\t\t\t\t\t\t\t\t\tvalue={ renderedBlocks }\n\t\t\t\t\t\t\t\t\tsettings={ settings }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<EditorStyles />\n\t\t\t\t\t\t\t\t\t<BlockList renderAppender={ false } />\n\t\t\t\t\t\t\t\t</ExperimentalBlockEditorProvider>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Disabled>\n\t\t\t\t\t</div>\n\t\t\t\t</Composite.Item>\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nexport default forwardRef( StyleBook );\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyTI;AAtTJ,kBAAiB;AAKjB,wBAIO;AACP,kBAAgC;AAChC,0BASO;AACP,kBAAoC;AACpC,kCAAkC;AAClC,qBAQO;AACP,sBAA6B;AAC7B,yBAA4B;AAC5B,uBAAmC;AAKnC,yBAAuB;AACvB,uBAAyC;AACzC,wBAGO;AACP,sBAA4B;AAC5B,oCAAqC;AACrC,IAAAA,oBAGO;AACP,sCAAgD;AAChD,2BAA0C;AAC1C,mBAAqC;AAErC,MAAM,EAAE,gCAAgC,QAAI,2BAAQ,oBAAAC,WAAuB;AAC3E,MAAM,EAAE,KAAK,QAAI,2BAAQ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AA;AAAA;AAAA,EACD,GACD,GACD;AAEF;AAEA,IAAO,yBAAQ,2BAAY,SAAU;",
6
+ "names": ["import_constants", "blockEditorPrivateApis", "componentsPrivateApis", "useMultipleOriginColorsAndGradients", "blockEditorStore", "clsx", "editorStore", "coreStore", "Iframe", "EditorStyles"]
7
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var types_exports = {};
16
+ module.exports = __toCommonJS(types_exports);
17
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/style-book/types.ts"],
4
+ "sourcesContent": ["export type Block = {\n\tname: string;\n\tattributes: Record< string, unknown >;\n\tinnerBlocks?: Block[];\n};\n\nexport type StyleBookCategory = {\n\ttitle: string;\n\tslug: string;\n\tblocks?: string[];\n\texclude?: string[];\n\tinclude?: string[];\n\tsubcategories?: StyleBookCategory[];\n};\n\nexport type BlockExample = {\n\tname: string;\n\ttitle: string;\n\tcategory: string;\n\tcontent?: JSX.Element;\n\tblocks?: Block | Block[];\n};\n\nexport type CategoryExamples = {\n\ttitle: string;\n\tslug: string;\n\texamples?: BlockExample[];\n\tsubcategories?: CategoryExamples[];\n};\n\nexport type StyleBookColorGroup = {\n\torigin: string;\n\tslug: string;\n\ttitle: string;\n\ttype: 'colors' | 'gradients' | 'duotones';\n};\n\nexport type Color = { slug: string };\nexport type Gradient = { slug: string };\nexport type Duotone = {\n\tcolors: string[];\n\tslug: string;\n};\n\nexport type ColorExampleProps = {\n\tcolors: Color[] | Gradient[];\n\ttype: StyleBookColorGroup[ 'type' ];\n\ttemplateColumns?: string | number;\n\titemHeight?: string;\n};\n\nexport type ColorOrigin = {\n\tname: string;\n\tslug: string;\n\tcolors?: Color[];\n\tgradients?: Gradient[];\n\tduotones?: Duotone[];\n};\n\nexport type MultiOriginPalettes = {\n\tdisableCustomColors: boolean;\n\tdisableCustomGradients: boolean;\n\thasColorsOrGradients: boolean;\n\tcolors: Omit< ColorOrigin, 'gradients' | 'duotones' >;\n\tduotones: Omit< ColorOrigin, 'colors' | 'gradients' >;\n\tgradients: Omit< ColorOrigin, 'colors' | 'duotones' >;\n};\n\n/*\n * Typing the items from getBlockTypes from '@wordpress/blocks'\n * to appease the TS linter.\n */\nexport type BlockType = {\n\tname: string;\n\ttitle: string;\n\tcategory: string;\n\texample: BlockType;\n\tattributes: Record< string, unknown >;\n\tsupports: Record< string, unknown >;\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,138 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var styles_canvas_exports = {};
30
+ __export(styles_canvas_exports, {
31
+ default: () => StylesCanvas,
32
+ getStylesCanvasTitle: () => getStylesCanvasTitle
33
+ });
34
+ module.exports = __toCommonJS(styles_canvas_exports);
35
+ var import_jsx_runtime = require("react/jsx-runtime");
36
+ var import_components = require("@wordpress/components");
37
+ var import_keycodes = require("@wordpress/keycodes");
38
+ var import_i18n = require("@wordpress/i18n");
39
+ var import_data = require("@wordpress/data");
40
+ var import_icons = require("@wordpress/icons");
41
+ var import_compose = require("@wordpress/compose");
42
+ var import_preferences = require("@wordpress/preferences");
43
+ var import_lock_unlock = require("../../lock-unlock");
44
+ var import_style_book = __toESM(require("./style-book"));
45
+ var import_revisions = __toESM(require("./revisions"));
46
+ var import_store = require("../../store");
47
+ var import_resizable_editor = __toESM(require("../resizable-editor"));
48
+ function getStylesCanvasTitle(path, showStylebook) {
49
+ if (showStylebook) {
50
+ return (0, import_i18n.__)("Style Book");
51
+ }
52
+ if (path?.startsWith("/revisions")) {
53
+ return (0, import_i18n.__)("Style Revisions");
54
+ }
55
+ return "";
56
+ }
57
+ function StylesCanvas() {
58
+ const { stylesPath, showStylebook, showListViewByDefault } = (0, import_data.useSelect)(
59
+ (select) => {
60
+ const { getStylesPath, getShowStylebook } = (0, import_lock_unlock.unlock)(
61
+ select(import_store.store)
62
+ );
63
+ const _showListViewByDefault = select(import_preferences.store).get(
64
+ "core",
65
+ "showListViewByDefault"
66
+ );
67
+ return {
68
+ stylesPath: getStylesPath(),
69
+ showStylebook: getShowStylebook(),
70
+ showListViewByDefault: _showListViewByDefault
71
+ };
72
+ },
73
+ []
74
+ );
75
+ const { resetStylesNavigation, setStylesPath } = (0, import_lock_unlock.unlock)(
76
+ (0, import_data.useDispatch)(import_store.store)
77
+ );
78
+ const { setIsListViewOpened } = (0, import_data.useDispatch)(import_store.store);
79
+ const focusOnMountRef = (0, import_compose.useFocusOnMount)("firstElement");
80
+ const sectionFocusReturnRef = (0, import_compose.useFocusReturn)();
81
+ let content = null;
82
+ if (showStylebook) {
83
+ content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
84
+ import_style_book.default,
85
+ {
86
+ path: stylesPath,
87
+ onPathChange: setStylesPath,
88
+ ref: sectionFocusReturnRef
89
+ }
90
+ );
91
+ } else if (stylesPath?.startsWith("/revisions")) {
92
+ content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
93
+ import_revisions.default,
94
+ {
95
+ path: stylesPath,
96
+ ref: sectionFocusReturnRef
97
+ }
98
+ );
99
+ }
100
+ const title = getStylesCanvasTitle(stylesPath, showStylebook);
101
+ const onCloseCanvas = () => {
102
+ setIsListViewOpened(showListViewByDefault);
103
+ resetStylesNavigation();
104
+ };
105
+ const closeOnEscape = (event) => {
106
+ if (event.keyCode === import_keycodes.ESCAPE && !event.defaultPrevented) {
107
+ event.preventDefault();
108
+ onCloseCanvas();
109
+ }
110
+ };
111
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "editor-styles-canvas", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_resizable_editor.default, { enableResizing: false, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
112
+ "section",
113
+ {
114
+ className: "editor-styles-canvas__section",
115
+ ref: focusOnMountRef,
116
+ onKeyDown: closeOnEscape,
117
+ "aria-label": title,
118
+ children: [
119
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
120
+ import_components.Button,
121
+ {
122
+ size: "compact",
123
+ className: "editor-styles-canvas__close-button",
124
+ icon: import_icons.closeSmall,
125
+ label: (0, import_i18n.__)("Close"),
126
+ onClick: onCloseCanvas
127
+ }
128
+ ),
129
+ content
130
+ ]
131
+ }
132
+ ) }) });
133
+ }
134
+ // Annotate the CommonJS export names for ESM import in node:
135
+ 0 && (module.exports = {
136
+ getStylesCanvasTitle
137
+ });
138
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/styles-canvas/index.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { ESCAPE } from '@wordpress/keycodes';\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { closeSmall } from '@wordpress/icons';\nimport { useFocusOnMount, useFocusReturn } from '@wordpress/compose';\nimport { store as preferencesStore } from '@wordpress/preferences';\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport StylesCanvasStyleBook from './style-book';\nimport StylesCanvasRevisions from './revisions';\nimport { store as editorStore } from '../../store';\nimport ResizableEditor from '../resizable-editor';\n\n/**\n * Helper function to get the title for the styles canvas based on current state.\n *\n * @param {string} path Current styles path.\n * @param {boolean} showStylebook Whether stylebook is visible.\n * @return {string} Translated string for the canvas title.\n */\nexport function getStylesCanvasTitle( path, showStylebook ) {\n\tif ( showStylebook ) {\n\t\treturn __( 'Style Book' );\n\t}\n\tif ( path?.startsWith( '/revisions' ) ) {\n\t\treturn __( 'Style Revisions' );\n\t}\n\treturn '';\n}\n\n/**\n * Styles canvas component - orchestrates rendering of style book and revisions.\n * Determines what content to show based on global styles navigation state.\n *\n * @return {JSX.Element|null} The styles canvas or null if nothing to render.\n */\nexport default function StylesCanvas() {\n\tconst { stylesPath, showStylebook, showListViewByDefault } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getStylesPath, getShowStylebook } = unlock(\n\t\t\t\tselect( editorStore )\n\t\t\t);\n\n\t\t\tconst _showListViewByDefault = select( preferencesStore ).get(\n\t\t\t\t'core',\n\t\t\t\t'showListViewByDefault'\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tstylesPath: getStylesPath(),\n\t\t\t\tshowStylebook: getShowStylebook(),\n\t\t\t\tshowListViewByDefault: _showListViewByDefault,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst { resetStylesNavigation, setStylesPath } = unlock(\n\t\tuseDispatch( editorStore )\n\t);\n\tconst { setIsListViewOpened } = useDispatch( editorStore );\n\n\tconst focusOnMountRef = useFocusOnMount( 'firstElement' );\n\tconst sectionFocusReturnRef = useFocusReturn();\n\n\t// Determine what content to render\n\tlet content = null;\n\n\tif ( showStylebook ) {\n\t\tcontent = (\n\t\t\t<StylesCanvasStyleBook\n\t\t\t\tpath={ stylesPath }\n\t\t\t\tonPathChange={ setStylesPath }\n\t\t\t\tref={ sectionFocusReturnRef }\n\t\t\t/>\n\t\t);\n\t} else if ( stylesPath?.startsWith( '/revisions' ) ) {\n\t\tcontent = (\n\t\t\t<StylesCanvasRevisions\n\t\t\t\tpath={ stylesPath }\n\t\t\t\tref={ sectionFocusReturnRef }\n\t\t\t/>\n\t\t);\n\t}\n\n\tconst title = getStylesCanvasTitle( stylesPath, showStylebook );\n\tconst onCloseCanvas = () => {\n\t\tsetIsListViewOpened( showListViewByDefault );\n\t\tresetStylesNavigation();\n\t};\n\n\tconst closeOnEscape = ( event ) => {\n\t\tif ( event.keyCode === ESCAPE && ! event.defaultPrevented ) {\n\t\t\tevent.preventDefault();\n\t\t\tonCloseCanvas();\n\t\t}\n\t};\n\n\treturn (\n\t\t<div className=\"editor-styles-canvas\">\n\t\t\t<ResizableEditor enableResizing={ false }>\n\t\t\t\t{ /* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */ }\n\t\t\t\t<section\n\t\t\t\t\tclassName=\"editor-styles-canvas__section\"\n\t\t\t\t\tref={ focusOnMountRef }\n\t\t\t\t\tonKeyDown={ closeOnEscape }\n\t\t\t\t\taria-label={ title }\n\t\t\t\t>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\tclassName=\"editor-styles-canvas__close-button\"\n\t\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\t\tlabel={ __( 'Close' ) }\n\t\t\t\t\t\tonClick={ onCloseCanvas }\n\t\t\t\t\t/>\n\t\t\t\t\t{ content }\n\t\t\t\t</section>\n\t\t\t</ResizableEditor>\n\t\t</div>\n\t);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA2EG;AAxEH,wBAAuB;AACvB,sBAAuB;AACvB,kBAAmB;AACnB,kBAAuC;AACvC,mBAA2B;AAC3B,qBAAgD;AAChD,yBAA0C;AAI1C,yBAAuB;AACvB,wBAAkC;AAClC,uBAAkC;AAClC,mBAAqC;AACrC,8BAA4B;AASrB,SAAS,qBAAsB,MAAM,eAAgB;AAC3D,MAAK,eAAgB;AACpB,eAAO,gBAAI,YAAa;AAAA,EACzB;AACA,MAAK,MAAM,WAAY,YAAa,GAAI;AACvC,eAAO,gBAAI,iBAAkB;AAAA,EAC9B;AACA,SAAO;AACR;AAQe,SAAR,eAAgC;AACtC,QAAM,EAAE,YAAY,eAAe,sBAAsB,QAAI;AAAA,IAC5D,CAAE,WAAY;AACb,YAAM,EAAE,eAAe,iBAAiB,QAAI;AAAA,QAC3C,OAAQ,aAAAA,KAAY;AAAA,MACrB;AAEA,YAAM,yBAAyB,OAAQ,mBAAAC,KAAiB,EAAE;AAAA,QACzD;AAAA,QACA;AAAA,MACD;AAEA,aAAO;AAAA,QACN,YAAY,cAAc;AAAA,QAC1B,eAAe,iBAAiB;AAAA,QAChC,uBAAuB;AAAA,MACxB;AAAA,IACD;AAAA,IACA,CAAC;AAAA,EACF;AACA,QAAM,EAAE,uBAAuB,cAAc,QAAI;AAAA,QAChD,yBAAa,aAAAD,KAAY;AAAA,EAC1B;AACA,QAAM,EAAE,oBAAoB,QAAI,yBAAa,aAAAA,KAAY;AAEzD,QAAM,sBAAkB,gCAAiB,cAAe;AACxD,QAAM,4BAAwB,+BAAe;AAG7C,MAAI,UAAU;AAEd,MAAK,eAAgB;AACpB,cACC;AAAA,MAAC,kBAAAE;AAAA,MAAA;AAAA,QACA,MAAO;AAAA,QACP,cAAe;AAAA,QACf,KAAM;AAAA;AAAA,IACP;AAAA,EAEF,WAAY,YAAY,WAAY,YAAa,GAAI;AACpD,cACC;AAAA,MAAC,iBAAAC;AAAA,MAAA;AAAA,QACA,MAAO;AAAA,QACP,KAAM;AAAA;AAAA,IACP;AAAA,EAEF;AAEA,QAAM,QAAQ,qBAAsB,YAAY,aAAc;AAC9D,QAAM,gBAAgB,MAAM;AAC3B,wBAAqB,qBAAsB;AAC3C,0BAAsB;AAAA,EACvB;AAEA,QAAM,gBAAgB,CAAE,UAAW;AAClC,QAAK,MAAM,YAAY,0BAAU,CAAE,MAAM,kBAAmB;AAC3D,YAAM,eAAe;AACrB,oBAAc;AAAA,IACf;AAAA,EACD;AAEA,SACC,4CAAC,SAAI,WAAU,wBACd,sDAAC,wBAAAC,SAAA,EAAgB,gBAAiB,OAEjC;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV,KAAM;AAAA,MACN,WAAY;AAAA,MACZ,cAAa;AAAA,MAEb;AAAA;AAAA,UAAC;AAAA;AAAA,YACA,MAAK;AAAA,YACL,WAAU;AAAA,YACV,MAAO;AAAA,YACP,WAAQ,gBAAI,OAAQ;AAAA,YACpB,SAAU;AAAA;AAAA,QACX;AAAA,QACE;AAAA;AAAA;AAAA,EACH,GACD,GACD;AAEF;",
6
+ "names": ["editorStore", "preferencesStore", "StylesCanvasStyleBook", "StylesCanvasRevisions", "ResizableEditor"]
7
+ }
@@ -0,0 +1,121 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var revisions_exports = {};
20
+ __export(revisions_exports, {
21
+ default: () => revisions_default
22
+ });
23
+ module.exports = __toCommonJS(revisions_exports);
24
+ var import_jsx_runtime = require("react/jsx-runtime");
25
+ var import_components = require("@wordpress/components");
26
+ var import_block_editor = require("@wordpress/block-editor");
27
+ var import_data = require("@wordpress/data");
28
+ var import_element = require("@wordpress/element");
29
+ var import_global_styles_ui = require("@wordpress/global-styles-ui");
30
+ var import_global_styles_engine = require("@wordpress/global-styles-engine");
31
+ var import_hooks = require("../global-styles/hooks");
32
+ var import_use_global_styles_output = require("../../hooks/use-global-styles-output");
33
+ var import_lock_unlock = require("../../lock-unlock");
34
+ const {
35
+ ExperimentalBlockEditorProvider,
36
+ __unstableBlockStyleVariationOverridesWithConfig
37
+ } = (0, import_lock_unlock.unlock)(import_block_editor.privateApis);
38
+ function isObjectEmpty(object) {
39
+ return !object || Object.keys(object).length === 0;
40
+ }
41
+ function StylesCanvasRevisions({ path }, ref) {
42
+ const blocks = (0, import_data.useSelect)((select) => {
43
+ return select(import_block_editor.store).getBlocks();
44
+ }, []);
45
+ const { user: userConfig, base: baseConfig } = (0, import_hooks.useGlobalStyles)();
46
+ const { revisions, isLoading } = (0, import_global_styles_ui.useGlobalStylesRevisions)();
47
+ const revisionId = (0, import_element.useMemo)(() => {
48
+ const match = path?.match(/^\/revisions\/(.+)$/);
49
+ return match ? match[1] : null;
50
+ }, [path]);
51
+ const selectedRevision = (0, import_element.useMemo)(() => {
52
+ if (!revisionId || !revisions.length) {
53
+ return null;
54
+ }
55
+ return revisions.find(
56
+ (rev) => String(rev.id) === String(revisionId)
57
+ );
58
+ }, [revisionId, revisions]);
59
+ const displayConfig = selectedRevision || userConfig;
60
+ const mergedConfig = (0, import_element.useMemo)(() => {
61
+ if (!isObjectEmpty(displayConfig) && !isObjectEmpty(baseConfig)) {
62
+ return (0, import_global_styles_engine.mergeGlobalStyles)(baseConfig, displayConfig);
63
+ }
64
+ return {};
65
+ }, [baseConfig, displayConfig]);
66
+ const renderedBlocksArray = (0, import_element.useMemo)(
67
+ () => Array.isArray(blocks) ? blocks : [blocks],
68
+ [blocks]
69
+ );
70
+ const originalSettings = (0, import_data.useSelect)(
71
+ (select) => select(import_block_editor.store).getSettings(),
72
+ []
73
+ );
74
+ const settings = (0, import_element.useMemo)(
75
+ () => ({
76
+ ...originalSettings,
77
+ isPreviewMode: true
78
+ }),
79
+ [originalSettings]
80
+ );
81
+ const [globalStyles] = (0, import_use_global_styles_output.useGlobalStylesOutputWithConfig)(mergedConfig);
82
+ const editorStyles = !isObjectEmpty(globalStyles) && !isObjectEmpty(displayConfig) ? globalStyles : settings.styles;
83
+ if (isLoading) {
84
+ return null;
85
+ }
86
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
87
+ import_block_editor.__unstableIframe,
88
+ {
89
+ ref,
90
+ className: "editor-revisions__iframe",
91
+ name: "revisions",
92
+ tabIndex: 0,
93
+ children: [
94
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", {
95
+ // Forming a "block formatting context" to prevent margin collapsing.
96
+ // @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context
97
+ children: `.is-root-container { display: flow-root; }`
98
+ }),
99
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Disabled, { className: "editor-revisions__example-preview__content", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
100
+ ExperimentalBlockEditorProvider,
101
+ {
102
+ value: renderedBlocksArray,
103
+ settings,
104
+ children: [
105
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.BlockList, { renderAppender: false }),
106
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.__unstableEditorStyles, { styles: editorStyles }),
107
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
108
+ __unstableBlockStyleVariationOverridesWithConfig,
109
+ {
110
+ config: mergedConfig
111
+ }
112
+ )
113
+ ]
114
+ }
115
+ ) })
116
+ ]
117
+ }
118
+ );
119
+ }
120
+ var revisions_default = (0, import_element.forwardRef)(StylesCanvasRevisions);
121
+ //# sourceMappingURL=revisions.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/styles-canvas/revisions.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { Disabled } from '@wordpress/components';\nimport {\n\tBlockList,\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n\t__unstableEditorStyles as EditorStyles,\n\t__unstableIframe as Iframe,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo, forwardRef } from '@wordpress/element';\nimport { useGlobalStylesRevisions } from '@wordpress/global-styles-ui';\nimport { mergeGlobalStyles } from '@wordpress/global-styles-engine';\n\n/**\n * Internal dependencies\n */\nimport { useGlobalStyles } from '../global-styles/hooks';\nimport { useGlobalStylesOutputWithConfig } from '../../hooks/use-global-styles-output';\nimport { unlock } from '../../lock-unlock';\n\nconst {\n\tExperimentalBlockEditorProvider,\n\t__unstableBlockStyleVariationOverridesWithConfig,\n} = unlock( blockEditorPrivateApis );\n\nfunction isObjectEmpty( object ) {\n\treturn ! object || Object.keys( object ).length === 0;\n}\n\n/**\n * Revisions content component for global styles.\n * Coordinates with ScreenRevisions through the path parameter to display\n * the currently selected revision.\n *\n * @param {Object} props Component props.\n * @param {string} props.path Current path in global styles.\n * @param {import('react').ForwardedRef} ref Ref to the Revisions component.\n * @return {JSX.Element|null} The Revisions component or null if loading.\n */\nfunction StylesCanvasRevisions( { path }, ref ) {\n\tconst blocks = useSelect( ( select ) => {\n\t\t// This is not ideal: it's like a loop (reading from block-editor to render it).\n\t\treturn select( blockEditorStore ).getBlocks();\n\t}, [] );\n\tconst { user: userConfig, base: baseConfig } = useGlobalStyles();\n\n\t// Fetch all revisions (includes unsaved, parent, and enriched with authors)\n\tconst { revisions, isLoading } = useGlobalStylesRevisions();\n\n\t// Parse revision ID from path (e.g., \"/revisions/123\" -> \"123\")\n\tconst revisionId = useMemo( () => {\n\t\tconst match = path?.match( /^\\/revisions\\/(.+)$/ );\n\t\treturn match ? match[ 1 ] : null;\n\t}, [ path ] );\n\n\t// Find the selected revision from the fetched list\n\tconst selectedRevision = useMemo( () => {\n\t\tif ( ! revisionId || ! revisions.length ) {\n\t\t\treturn null;\n\t\t}\n\t\treturn revisions.find(\n\t\t\t( rev ) => String( rev.id ) === String( revisionId )\n\t\t);\n\t}, [ revisionId, revisions ] );\n\n\t// Use the selected revision's config if available, otherwise use current user config\n\tconst displayConfig = selectedRevision || userConfig;\n\n\t// Merge the display config with the base config\n\tconst mergedConfig = useMemo( () => {\n\t\tif (\n\t\t\t! isObjectEmpty( displayConfig ) &&\n\t\t\t! isObjectEmpty( baseConfig )\n\t\t) {\n\t\t\treturn mergeGlobalStyles( baseConfig, displayConfig );\n\t\t}\n\t\treturn {};\n\t}, [ baseConfig, displayConfig ] );\n\n\tconst renderedBlocksArray = useMemo(\n\t\t() => ( Array.isArray( blocks ) ? blocks : [ blocks ] ),\n\t\t[ blocks ]\n\t);\n\n\tconst originalSettings = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings(),\n\t\t[]\n\t);\n\tconst settings = useMemo(\n\t\t() => ( {\n\t\t\t...originalSettings,\n\t\t\tisPreviewMode: true,\n\t\t} ),\n\t\t[ originalSettings ]\n\t);\n\n\tconst [ globalStyles ] = useGlobalStylesOutputWithConfig( mergedConfig );\n\n\tconst editorStyles =\n\t\t! isObjectEmpty( globalStyles ) && ! isObjectEmpty( displayConfig )\n\t\t\t? globalStyles\n\t\t\t: settings.styles;\n\n\tif ( isLoading ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Iframe\n\t\t\tref={ ref }\n\t\t\tclassName=\"editor-revisions__iframe\"\n\t\t\tname=\"revisions\"\n\t\t\ttabIndex={ 0 }\n\t\t>\n\t\t\t<style>\n\t\t\t\t{\n\t\t\t\t\t// Forming a \"block formatting context\" to prevent margin collapsing.\n\t\t\t\t\t// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context\n\t\t\t\t\t`.is-root-container { display: flow-root; }`\n\t\t\t\t}\n\t\t\t</style>\n\t\t\t<Disabled className=\"editor-revisions__example-preview__content\">\n\t\t\t\t<ExperimentalBlockEditorProvider\n\t\t\t\t\tvalue={ renderedBlocksArray }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t>\n\t\t\t\t\t<BlockList renderAppender={ false } />\n\t\t\t\t\t{ /*\n\t\t\t\t\t * Styles are printed inside the block editor provider,\n\t\t\t\t\t * so they can access any registered style overrides.\n\t\t\t\t\t */ }\n\t\t\t\t\t<EditorStyles styles={ editorStyles } />\n\t\t\t\t\t<__unstableBlockStyleVariationOverridesWithConfig\n\t\t\t\t\t\tconfig={ mergedConfig }\n\t\t\t\t\t/>\n\t\t\t\t</ExperimentalBlockEditorProvider>\n\t\t\t</Disabled>\n\t\t</Iframe>\n\t);\n}\nexport default forwardRef( StylesCanvasRevisions );\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAqHG;AAlHH,wBAAyB;AACzB,0BAMO;AACP,kBAA0B;AAC1B,qBA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AM,uBAAmB;AAAA,IACxB,CAAE,WAAY,OAAQ,oBAAAA,KAAiB,EAAE,YAAY;AAAA,IACrD,CAAC;AAAA,EACF;AACA,QAAM,eAAW;AAAA,IAChB,OAAQ;AAAA,MACP,GAAG;AAAA,MACH,eAAe;AAAA,IAChB;AAAA,IACA,CAAE,gBAAiB;AAAA,EACpB;AAEA,QAAM,CAAE,YAAa,QAAI,iEAAiC,YAAa;AAEvE,QAAM,eACL,CAAE,cAAe,YAAa,KAAK,CAAE,cAAe,aAAc,IAC/D,eACA,SAAS;AAEb,MAAK,WAAY;AAChB,WAAO;AAAA,EACR;AAEA,SACC;AAAA,IAAC,oBAAAC;AAAA,IAAA;AAAA,MACA;AAAA,MACA,WAAU;AAAA,MACV,MAAK;AAAA,MACL,UAAW;AAAA,MAEX;AAAA,oDAAC;AAAA;AAAA;AAAA,UAIC;AAAA,SAEF;AAAA,QACA,4CAAC,8BAAS,WAAU,8CACnB;AAAA,UAAC;AAAA;AAAA,YACA,OAAQ;AAAA,YACR;AAAA,YAEA;AAAA,0DAAC,iCAAU,gBAAiB,OAAQ;AAAA,cAKpC,4CAAC,oBAAAC,wBAAA,EAAa,QAAS,cAAe;AAAA,cACtC;AAAA,gBAAC;AAAA;AAAA,kBACA,QAAS;AAAA;AAAA,cACV;AAAA;AAAA;AAAA,QACD,GACD;AAAA;AAAA;AAAA,EACD;AAEF;AACA,IAAO,wBAAQ,2BAAY,qBAAsB;",
6
+ "names": ["blockEditorPrivateApis", "blockEditorStore", "Iframe", "EditorStyles"]
7
+ }
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var style_book_exports = {};
30
+ __export(style_book_exports, {
31
+ default: () => style_book_default
32
+ });
33
+ module.exports = __toCommonJS(style_book_exports);
34
+ var import_jsx_runtime = require("react/jsx-runtime");
35
+ var import_element = require("@wordpress/element");
36
+ var import_style_book = __toESM(require("../style-book"));
37
+ var import_constants = require("../style-book/constants");
38
+ function StylesCanvasStyleBook({ path, onPathChange }, ref) {
39
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
40
+ import_style_book.default,
41
+ {
42
+ ref,
43
+ isSelected: (blockName) => (
44
+ // Match '/blocks/core%2Fbutton' and
45
+ // '/blocks/core%2Fbutton/typography', but not
46
+ // '/blocks/core%2Fbuttons'.
47
+ path === `/blocks/${encodeURIComponent(blockName)}` || path?.startsWith(
48
+ `/blocks/${encodeURIComponent(blockName)}/`
49
+ )
50
+ ),
51
+ onSelect: (blockName) => {
52
+ if (import_constants.STYLE_BOOK_COLOR_GROUPS.find(
53
+ (group) => group.slug === blockName
54
+ )) {
55
+ onPathChange?.("/colors/palette");
56
+ return;
57
+ }
58
+ if (blockName === "typography") {
59
+ onPathChange?.("/typography");
60
+ return;
61
+ }
62
+ onPathChange?.("/blocks/" + encodeURIComponent(blockName));
63
+ }
64
+ }
65
+ );
66
+ }
67
+ var style_book_default = (0, import_element.forwardRef)(StylesCanvasStyleBook);
68
+ //# sourceMappingURL=style-book.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/styles-canvas/style-book.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport StyleBook from '../style-book';\nimport { STYLE_BOOK_COLOR_GROUPS } from '../style-book/constants';\n\n/**\n * Style Book content component for global styles.\n * Provides the business logic for StyleBook behavior in the global styles context.\n *\n * @param {Object} props Component props.\n * @param {string} props.path Current path in global styles.\n * @param {Function} props.onPathChange Callback when the path changes.\n * @param {import('react').ForwardedRef} ref Ref to the Style Book component.\n * @return {JSX.Element} The Style Book component.\n */\nfunction StylesCanvasStyleBook( { path, onPathChange }, ref ) {\n\treturn (\n\t\t<StyleBook\n\t\t\tref={ ref }\n\t\t\tisSelected={ ( blockName ) =>\n\t\t\t\t// Match '/blocks/core%2Fbutton' and\n\t\t\t\t// '/blocks/core%2Fbutton/typography', but not\n\t\t\t\t// '/blocks/core%2Fbuttons'.\n\t\t\t\tpath === `/blocks/${ encodeURIComponent( blockName ) }` ||\n\t\t\t\tpath?.startsWith(\n\t\t\t\t\t`/blocks/${ encodeURIComponent( blockName ) }/`\n\t\t\t\t)\n\t\t\t}\n\t\t\tonSelect={ ( blockName ) => {\n\t\t\t\tif (\n\t\t\t\t\tSTYLE_BOOK_COLOR_GROUPS.find(\n\t\t\t\t\t\t( group ) => group.slug === blockName\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\t// Go to color palettes Global Styles.\n\t\t\t\t\tonPathChange?.( '/colors/palette' );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif ( blockName === 'typography' ) {\n\t\t\t\t\t// Go to typography Global Styles.\n\t\t\t\t\tonPathChange?.( '/typography' );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Now go to the selected block.\n\t\t\t\tonPathChange?.( '/blocks/' + encodeURIComponent( blockName ) );\n\t\t\t} }\n\t\t/>\n\t);\n}\nexport default forwardRef( StylesCanvasStyleBook );\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAuBE;AApBF,qBAA2B;AAK3B,wBAAsB;AACtB,uBAAwC;AAYxC,SAAS,sBAAuB,EAAE,MAAM,aAAa,GAAG,KAAM;AAC7D,SACC;AAAA,IAAC,kBAAAA;AAAA,IAAA;AAAA,MACA;AAAA,MACA,YAAa,CAAE;AAAA;AAAA;AAAA;AAAA,QAId,SAAS,WAAY,mBAAoB,SAAU,CAAE,MACrD,MAAM;AAAA,UACL,WAAY,mBAAoB,SAAU,CAAE;AAAA,QAC7C;AAAA;AAAA,MAED,UAAW,CAAE,cAAe;AAC3B,YACC,yCAAwB;AAAA,UACvB,CAAE,UAAW,MAAM,SAAS;AAAA,QAC7B,GACC;AAED,yBAAgB,iBAAkB;AAClC;AAAA,QACD;AACA,YAAK,cAAc,cAAe;AAEjC,yBAAgB,aAAc;AAC9B;AAAA,QACD;AAGA,uBAAgB,aAAa,mBAAoB,SAAU,CAAE;AAAA,MAC9D;AAAA;AAAA,EACD;AAEF;AACA,IAAO,yBAAQ,2BAAY,qBAAsB;",
6
+ "names": ["StyleBook"]
7
+ }
@@ -86,7 +86,6 @@ function checkForPostContentAtRootLevel(blocks) {
86
86
  function VisualEditor({
87
87
  // Ideally as we unify post and site editors, we won't need these props.
88
88
  autoFocus,
89
- styles,
90
89
  disableIframe = false,
91
90
  iframeProps,
92
91
  contentRef,
@@ -103,7 +102,8 @@ function VisualEditor({
103
102
  isFocusedEntity,
104
103
  isDesignPostType,
105
104
  postType,
106
- isPreview
105
+ isPreview,
106
+ styles
107
107
  } = (0, import_data.useSelect)((select) => {
108
108
  const {
109
109
  getCurrentPostId,
@@ -143,7 +143,8 @@ function VisualEditor({
143
143
  deviceType: getDeviceType(),
144
144
  isFocusedEntity: !!editorSettings.onNavigateToPreviousEntityRecord,
145
145
  postType: postTypeSlug,
146
- isPreview: editorSettings.isPreviewMode
146
+ isPreview: editorSettings.isPreviewMode,
147
+ styles: editorSettings.styles
147
148
  };
148
149
  }, []);
149
150
  const { isCleanNewPost } = (0, import_data.useSelect)(import_store.store);