@wordpress/edit-site 6.12.1-next.082ed6819.0 → 6.13.1-next.a9f418477.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 (515) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/add-new-pattern/index.js +3 -16
  3. package/build/components/add-new-pattern/index.js.map +1 -1
  4. package/build/components/add-new-post/index.js +1 -1
  5. package/build/components/add-new-post/index.js.map +1 -1
  6. package/build/components/add-new-template/index.js +1 -5
  7. package/build/components/add-new-template/index.js.map +1 -1
  8. package/build/components/app/index.js +31 -29
  9. package/build/components/app/index.js.map +1 -1
  10. package/build/components/block-editor/use-editor-iframe-props.js +8 -8
  11. package/build/components/block-editor/use-editor-iframe-props.js.map +1 -1
  12. package/build/components/block-editor/use-navigate-to-entity-record.js +1 -5
  13. package/build/components/block-editor/use-navigate-to-entity-record.js.map +1 -1
  14. package/build/components/block-editor/use-site-editor-settings.js +4 -4
  15. package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
  16. package/build/components/dataviews-actions/index.js +1 -5
  17. package/build/components/dataviews-actions/index.js.map +1 -1
  18. package/build/components/editor/index.js +38 -22
  19. package/build/components/editor/index.js.map +1 -1
  20. package/build/components/editor/use-editor-title.js +5 -0
  21. package/build/components/editor/use-editor-title.js.map +1 -1
  22. package/build/components/editor/use-resolve-edited-entity.js +19 -4
  23. package/build/components/editor/use-resolve-edited-entity.js.map +1 -1
  24. package/build/components/global-styles/font-library-modal/context.js +0 -1
  25. package/build/components/global-styles/font-library-modal/context.js.map +1 -1
  26. package/build/components/global-styles/font-library-modal/font-collection.js +36 -26
  27. package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  28. package/build/components/global-styles/font-library-modal/installed-fonts.js +0 -1
  29. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  30. package/build/components/global-styles/font-library-modal/upload-fonts.js +0 -1
  31. package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  32. package/build/components/global-styles/preview-colors.js +2 -2
  33. package/build/components/global-styles/preview-colors.js.map +1 -1
  34. package/build/components/global-styles/preview-styles.js +2 -2
  35. package/build/components/global-styles/preview-styles.js.map +1 -1
  36. package/build/components/global-styles/preview-typography.js +2 -2
  37. package/build/components/global-styles/preview-typography.js.map +1 -1
  38. package/build/components/global-styles/{preview-iframe.js → preview-wrapper.js} +10 -29
  39. package/build/components/global-styles/preview-wrapper.js.map +1 -0
  40. package/build/components/global-styles/typography-example.js +8 -1
  41. package/build/components/global-styles/typography-example.js.map +1 -1
  42. package/build/components/global-styles-sidebar/index.js +5 -5
  43. package/build/components/global-styles-sidebar/index.js.map +1 -1
  44. package/build/components/layout/index.js +44 -19
  45. package/build/components/layout/index.js.map +1 -1
  46. package/build/components/page-patterns/delete-category-menu-item.js +1 -4
  47. package/build/components/page-patterns/delete-category-menu-item.js.map +1 -1
  48. package/build/components/page-patterns/fields.js +6 -57
  49. package/build/components/page-patterns/fields.js.map +1 -1
  50. package/build/components/page-patterns/index.js +31 -30
  51. package/build/components/page-patterns/index.js.map +1 -1
  52. package/build/components/page-templates/fields.js +6 -34
  53. package/build/components/page-templates/fields.js.map +1 -1
  54. package/build/components/page-templates/index.js +34 -46
  55. package/build/components/page-templates/index.js.map +1 -1
  56. package/build/components/post-edit/header.js +83 -0
  57. package/build/components/post-edit/header.js.map +1 -0
  58. package/build/components/post-edit/index.js +42 -7
  59. package/build/components/post-edit/index.js.map +1 -1
  60. package/build/components/post-list/index.js +26 -40
  61. package/build/components/post-list/index.js.map +1 -1
  62. package/build/components/posts-app/index.js +10 -16
  63. package/build/components/posts-app/index.js.map +1 -1
  64. package/build/components/posts-app-routes/index.js +3 -7
  65. package/build/components/posts-app-routes/index.js.map +1 -1
  66. package/build/components/posts-app-routes/{posts-edit.js → post-item.js} +9 -13
  67. package/build/components/posts-app-routes/post-item.js.map +1 -0
  68. package/build/components/posts-app-routes/posts.js +89 -0
  69. package/build/components/posts-app-routes/posts.js.map +1 -0
  70. package/build/components/resizable-frame/index.js +6 -5
  71. package/build/components/resizable-frame/index.js.map +1 -1
  72. package/build/components/save-panel/index.js +9 -6
  73. package/build/components/save-panel/index.js.map +1 -1
  74. package/build/components/sidebar-dataviews/add-new-view.js +7 -8
  75. package/build/components/sidebar-dataviews/add-new-view.js.map +1 -1
  76. package/build/components/sidebar-dataviews/dataview-item.js +5 -8
  77. package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
  78. package/build/components/sidebar-dataviews/default-views.js +7 -24
  79. package/build/components/sidebar-dataviews/default-views.js.map +1 -1
  80. package/build/components/sidebar-dataviews/index.js +4 -3
  81. package/build/components/sidebar-dataviews/index.js.map +1 -1
  82. package/build/components/sidebar-global-styles-wrapper/index.js +18 -18
  83. package/build/components/sidebar-global-styles-wrapper/index.js.map +1 -1
  84. package/build/components/sidebar-navigation-item/index.js +8 -5
  85. package/build/components/sidebar-navigation-item/index.js.map +1 -1
  86. package/build/components/sidebar-navigation-screen/index.js +2 -2
  87. package/build/components/sidebar-navigation-screen/index.js.map +1 -1
  88. package/build/components/sidebar-navigation-screen-global-styles/content.js +12 -38
  89. package/build/components/sidebar-navigation-screen-global-styles/content.js.map +1 -1
  90. package/build/components/sidebar-navigation-screen-global-styles/index.js +8 -19
  91. package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  92. package/build/components/sidebar-navigation-screen-main/index.js +6 -14
  93. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  94. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +1 -5
  95. package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  96. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +2 -7
  97. package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  98. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +1 -6
  99. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  100. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +14 -20
  101. package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  102. package/build/components/sidebar-navigation-screen-patterns/category-item.js +5 -7
  103. package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
  104. package/build/components/sidebar-navigation-screen-patterns/index.js +4 -5
  105. package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  106. package/build/components/sidebar-navigation-screen-templates-browse/content.js +25 -16
  107. package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  108. package/build/components/sidebar-navigation-screen-templates-browse/index.js +1 -14
  109. package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  110. package/build/components/site-editor-routes/{home-view.js → home.js} +7 -8
  111. package/build/components/site-editor-routes/home.js.map +1 -0
  112. package/build/components/site-editor-routes/index.js +12 -18
  113. package/build/components/site-editor-routes/index.js.map +1 -1
  114. package/build/components/site-editor-routes/navigation-item.js +49 -0
  115. package/build/components/site-editor-routes/navigation-item.js.map +1 -0
  116. package/build/components/{posts-app-routes/home.js → site-editor-routes/navigation.js} +16 -18
  117. package/build/components/site-editor-routes/navigation.js.map +1 -0
  118. package/build/components/site-editor-routes/{pages-edit.js → page-item.js} +10 -17
  119. package/build/components/site-editor-routes/page-item.js.map +1 -0
  120. package/build/components/site-editor-routes/pages.js +87 -0
  121. package/build/components/site-editor-routes/pages.js.map +1 -0
  122. package/build/components/site-editor-routes/{home-edit.js → pattern-item.js} +11 -11
  123. package/build/components/site-editor-routes/pattern-item.js.map +1 -0
  124. package/build/components/site-editor-routes/{patterns-view.js → patterns.js} +6 -9
  125. package/build/components/site-editor-routes/patterns.js.map +1 -0
  126. package/build/components/site-editor-routes/{styles-view.js → styles.js} +28 -9
  127. package/build/components/site-editor-routes/styles.js.map +1 -0
  128. package/build/components/site-editor-routes/{templates-edit.js → template-item.js} +6 -11
  129. package/build/components/site-editor-routes/template-item.js.map +1 -0
  130. package/build/components/site-editor-routes/{patterns-edit.js → template-part-item.js} +6 -11
  131. package/build/components/site-editor-routes/template-part-item.js.map +1 -0
  132. package/build/components/site-editor-routes/{templates-list-view.js → templates.js} +20 -13
  133. package/build/components/site-editor-routes/templates.js.map +1 -0
  134. package/build/components/site-hub/index.js +3 -3
  135. package/build/components/site-hub/index.js.map +1 -1
  136. package/build/components/style-book/constants.js +8 -19
  137. package/build/components/style-book/constants.js.map +1 -1
  138. package/build/components/style-book/examples.js +42 -27
  139. package/build/components/style-book/examples.js.map +1 -1
  140. package/build/components/style-book/index.js +21 -5
  141. package/build/components/style-book/index.js.map +1 -1
  142. package/build/components/style-book/types.js.map +1 -1
  143. package/build/hooks/commands/use-common-commands.js +12 -48
  144. package/build/hooks/commands/use-common-commands.js.map +1 -1
  145. package/build/hooks/commands/use-set-command-context.js +2 -2
  146. package/build/hooks/commands/use-set-command-context.js.map +1 -1
  147. package/build/store/private-actions.js +7 -0
  148. package/build/store/private-actions.js.map +1 -1
  149. package/build/store/reducer.js +2 -0
  150. package/build/store/reducer.js.map +1 -1
  151. package/build/utils/is-previewing-theme.js +1 -1
  152. package/build/utils/is-previewing-theme.js.map +1 -1
  153. package/build/utils/use-activate-theme.js +9 -8
  154. package/build/utils/use-activate-theme.js.map +1 -1
  155. package/build-module/components/add-new-pattern/index.js +3 -16
  156. package/build-module/components/add-new-pattern/index.js.map +1 -1
  157. package/build-module/components/add-new-post/index.js +1 -1
  158. package/build-module/components/add-new-post/index.js.map +1 -1
  159. package/build-module/components/add-new-template/index.js +1 -5
  160. package/build-module/components/add-new-template/index.js.map +1 -1
  161. package/build-module/components/app/index.js +33 -31
  162. package/build-module/components/app/index.js.map +1 -1
  163. package/build-module/components/block-editor/use-editor-iframe-props.js +8 -8
  164. package/build-module/components/block-editor/use-editor-iframe-props.js.map +1 -1
  165. package/build-module/components/block-editor/use-navigate-to-entity-record.js +1 -5
  166. package/build-module/components/block-editor/use-navigate-to-entity-record.js.map +1 -1
  167. package/build-module/components/block-editor/use-site-editor-settings.js +4 -4
  168. package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
  169. package/build-module/components/dataviews-actions/index.js +1 -5
  170. package/build-module/components/dataviews-actions/index.js.map +1 -1
  171. package/build-module/components/editor/index.js +38 -22
  172. package/build-module/components/editor/index.js.map +1 -1
  173. package/build-module/components/editor/use-editor-title.js +5 -0
  174. package/build-module/components/editor/use-editor-title.js.map +1 -1
  175. package/build-module/components/editor/use-resolve-edited-entity.js +19 -4
  176. package/build-module/components/editor/use-resolve-edited-entity.js.map +1 -1
  177. package/build-module/components/global-styles/font-library-modal/context.js +0 -1
  178. package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
  179. package/build-module/components/global-styles/font-library-modal/font-collection.js +37 -27
  180. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  181. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +0 -1
  182. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  183. package/build-module/components/global-styles/font-library-modal/upload-fonts.js +0 -1
  184. package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  185. package/build-module/components/global-styles/preview-colors.js +2 -2
  186. package/build-module/components/global-styles/preview-colors.js.map +1 -1
  187. package/build-module/components/global-styles/preview-styles.js +2 -2
  188. package/build-module/components/global-styles/preview-styles.js.map +1 -1
  189. package/build-module/components/global-styles/preview-typography.js +2 -2
  190. package/build-module/components/global-styles/preview-typography.js.map +1 -1
  191. package/build-module/components/global-styles/{preview-iframe.js → preview-wrapper.js} +12 -31
  192. package/build-module/components/global-styles/preview-wrapper.js.map +1 -0
  193. package/build-module/components/global-styles/typography-example.js +8 -1
  194. package/build-module/components/global-styles/typography-example.js.map +1 -1
  195. package/build-module/components/global-styles-sidebar/index.js +5 -5
  196. package/build-module/components/global-styles-sidebar/index.js.map +1 -1
  197. package/build-module/components/layout/index.js +45 -20
  198. package/build-module/components/layout/index.js.map +1 -1
  199. package/build-module/components/page-patterns/delete-category-menu-item.js +1 -4
  200. package/build-module/components/page-patterns/delete-category-menu-item.js.map +1 -1
  201. package/build-module/components/page-patterns/fields.js +7 -58
  202. package/build-module/components/page-patterns/fields.js.map +1 -1
  203. package/build-module/components/page-patterns/index.js +29 -28
  204. package/build-module/components/page-patterns/index.js.map +1 -1
  205. package/build-module/components/page-templates/fields.js +5 -31
  206. package/build-module/components/page-templates/fields.js.map +1 -1
  207. package/build-module/components/page-templates/index.js +33 -45
  208. package/build-module/components/page-templates/index.js.map +1 -1
  209. package/build-module/components/post-edit/header.js +76 -0
  210. package/build-module/components/post-edit/header.js.map +1 -0
  211. package/build-module/components/post-edit/index.js +42 -7
  212. package/build-module/components/post-edit/index.js.map +1 -1
  213. package/build-module/components/post-list/index.js +26 -40
  214. package/build-module/components/post-list/index.js.map +1 -1
  215. package/build-module/components/posts-app/index.js +11 -17
  216. package/build-module/components/posts-app/index.js.map +1 -1
  217. package/build-module/components/posts-app-routes/index.js +3 -7
  218. package/build-module/components/posts-app-routes/index.js.map +1 -1
  219. package/build-module/components/posts-app-routes/{posts-edit.js → post-item.js} +8 -12
  220. package/build-module/components/posts-app-routes/post-item.js.map +1 -0
  221. package/build-module/components/posts-app-routes/posts.js +81 -0
  222. package/build-module/components/posts-app-routes/posts.js.map +1 -0
  223. package/build-module/components/resizable-frame/index.js +6 -5
  224. package/build-module/components/resizable-frame/index.js.map +1 -1
  225. package/build-module/components/save-panel/index.js +9 -6
  226. package/build-module/components/save-panel/index.js.map +1 -1
  227. package/build-module/components/sidebar-dataviews/add-new-view.js +7 -8
  228. package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -1
  229. package/build-module/components/sidebar-dataviews/dataview-item.js +5 -8
  230. package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
  231. package/build-module/components/sidebar-dataviews/default-views.js +7 -24
  232. package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
  233. package/build-module/components/sidebar-dataviews/index.js +4 -3
  234. package/build-module/components/sidebar-dataviews/index.js.map +1 -1
  235. package/build-module/components/sidebar-global-styles-wrapper/index.js +18 -18
  236. package/build-module/components/sidebar-global-styles-wrapper/index.js.map +1 -1
  237. package/build-module/components/sidebar-navigation-item/index.js +8 -5
  238. package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
  239. package/build-module/components/sidebar-navigation-screen/index.js +2 -2
  240. package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
  241. package/build-module/components/sidebar-navigation-screen-global-styles/content.js +12 -38
  242. package/build-module/components/sidebar-navigation-screen-global-styles/content.js.map +1 -1
  243. package/build-module/components/sidebar-navigation-screen-global-styles/index.js +9 -20
  244. package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
  245. package/build-module/components/sidebar-navigation-screen-main/index.js +6 -14
  246. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  247. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +1 -5
  248. package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
  249. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +2 -7
  250. package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
  251. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +1 -6
  252. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  253. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +14 -20
  254. package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
  255. package/build-module/components/sidebar-navigation-screen-patterns/category-item.js +5 -7
  256. package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
  257. package/build-module/components/sidebar-navigation-screen-patterns/index.js +4 -5
  258. package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  259. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +25 -16
  260. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  261. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +1 -14
  262. package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
  263. package/build-module/components/site-editor-routes/{home-edit.js → home.js} +5 -7
  264. package/build-module/components/site-editor-routes/home.js.map +1 -0
  265. package/build-module/components/site-editor-routes/index.js +12 -18
  266. package/build-module/components/site-editor-routes/index.js.map +1 -1
  267. package/build-module/components/site-editor-routes/navigation-item.js +41 -0
  268. package/build-module/components/site-editor-routes/navigation-item.js.map +1 -0
  269. package/build-module/components/site-editor-routes/navigation.js +38 -0
  270. package/build-module/components/site-editor-routes/navigation.js.map +1 -0
  271. package/build-module/components/site-editor-routes/{pages-edit.js → page-item.js} +9 -16
  272. package/build-module/components/site-editor-routes/page-item.js.map +1 -0
  273. package/build-module/components/site-editor-routes/pages.js +79 -0
  274. package/build-module/components/site-editor-routes/pages.js.map +1 -0
  275. package/build-module/components/site-editor-routes/pattern-item.js +18 -0
  276. package/build-module/components/site-editor-routes/pattern-item.js.map +1 -0
  277. package/build-module/components/site-editor-routes/{patterns-view.js → patterns.js} +5 -8
  278. package/build-module/components/site-editor-routes/patterns.js.map +1 -0
  279. package/build-module/components/site-editor-routes/styles.js +44 -0
  280. package/build-module/components/site-editor-routes/styles.js.map +1 -0
  281. package/build-module/components/site-editor-routes/{templates-edit.js → template-item.js} +5 -10
  282. package/build-module/components/site-editor-routes/template-item.js.map +1 -0
  283. package/build-module/components/site-editor-routes/template-part-item.js +18 -0
  284. package/build-module/components/site-editor-routes/template-part-item.js.map +1 -0
  285. package/build-module/components/site-editor-routes/templates.js +33 -0
  286. package/build-module/components/site-editor-routes/templates.js.map +1 -0
  287. package/build-module/components/site-hub/index.js +3 -3
  288. package/build-module/components/site-hub/index.js.map +1 -1
  289. package/build-module/components/style-book/constants.js +8 -19
  290. package/build-module/components/style-book/constants.js.map +1 -1
  291. package/build-module/components/style-book/examples.js +42 -27
  292. package/build-module/components/style-book/examples.js.map +1 -1
  293. package/build-module/components/style-book/index.js +21 -5
  294. package/build-module/components/style-book/index.js.map +1 -1
  295. package/build-module/components/style-book/types.js.map +1 -1
  296. package/build-module/hooks/commands/use-common-commands.js +12 -48
  297. package/build-module/hooks/commands/use-common-commands.js.map +1 -1
  298. package/build-module/hooks/commands/use-set-command-context.js +2 -2
  299. package/build-module/hooks/commands/use-set-command-context.js.map +1 -1
  300. package/build-module/store/private-actions.js +6 -0
  301. package/build-module/store/private-actions.js.map +1 -1
  302. package/build-module/store/reducer.js +2 -0
  303. package/build-module/store/reducer.js.map +1 -1
  304. package/build-module/utils/is-previewing-theme.js +1 -1
  305. package/build-module/utils/is-previewing-theme.js.map +1 -1
  306. package/build-module/utils/use-activate-theme.js +9 -8
  307. package/build-module/utils/use-activate-theme.js.map +1 -1
  308. package/build-style/posts-rtl.css +73 -107
  309. package/build-style/posts.css +73 -107
  310. package/build-style/style-rtl.css +201 -142
  311. package/build-style/style.css +201 -142
  312. package/package.json +40 -40
  313. package/src/components/add-new-pattern/index.js +9 -17
  314. package/src/components/add-new-post/index.js +1 -1
  315. package/src/components/add-new-template/index.js +3 -5
  316. package/src/components/app/index.js +34 -35
  317. package/src/components/block-editor/use-editor-iframe-props.js +5 -4
  318. package/src/components/block-editor/use-navigate-to-entity-record.js +3 -1
  319. package/src/components/block-editor/use-site-editor-settings.js +6 -6
  320. package/src/components/dataviews-actions/index.js +1 -5
  321. package/src/components/editor/index.js +64 -29
  322. package/src/components/editor/use-editor-title.js +4 -0
  323. package/src/components/editor/use-resolve-edited-entity.js +17 -2
  324. package/src/components/global-styles/font-library-modal/font-collection.js +40 -27
  325. package/src/components/global-styles/font-library-modal/style.scss +12 -5
  326. package/src/components/global-styles/preview-colors.js +3 -3
  327. package/src/components/global-styles/preview-styles.js +3 -3
  328. package/src/components/global-styles/preview-typography.js +3 -3
  329. package/src/components/global-styles/{preview-iframe.js → preview-wrapper.js} +9 -35
  330. package/src/components/global-styles/style.scss +5 -1
  331. package/src/components/global-styles/typography-example.js +12 -1
  332. package/src/components/global-styles-sidebar/index.js +4 -4
  333. package/src/components/layout/index.js +43 -11
  334. package/src/components/page-patterns/delete-category-menu-item.js +3 -4
  335. package/src/components/page-patterns/fields.js +9 -65
  336. package/src/components/page-patterns/index.js +39 -25
  337. package/src/components/page-patterns/style.scss +0 -28
  338. package/src/components/page-templates/fields.js +3 -31
  339. package/src/components/page-templates/index.js +34 -51
  340. package/src/components/post-edit/header.js +88 -0
  341. package/src/components/post-edit/index.js +39 -7
  342. package/src/components/post-edit/style.scss +10 -0
  343. package/src/components/post-list/index.js +44 -40
  344. package/src/components/post-list/style.scss +0 -36
  345. package/src/components/posts-app/index.js +9 -18
  346. package/src/components/posts-app-routes/index.js +3 -14
  347. package/src/components/posts-app-routes/{posts-edit.js → post-item.js} +5 -9
  348. package/src/components/posts-app-routes/posts.js +66 -0
  349. package/src/components/resizable-frame/index.js +6 -7
  350. package/src/components/save-panel/index.js +11 -5
  351. package/src/components/sidebar-dataviews/add-new-view.js +9 -9
  352. package/src/components/sidebar-dataviews/dataview-item.js +5 -8
  353. package/src/components/sidebar-dataviews/default-views.js +7 -24
  354. package/src/components/sidebar-dataviews/index.js +2 -2
  355. package/src/components/sidebar-dataviews/style.scss +2 -2
  356. package/src/components/sidebar-global-styles-wrapper/index.js +24 -30
  357. package/src/components/sidebar-navigation-item/index.js +7 -5
  358. package/src/components/sidebar-navigation-item/style.scss +1 -2
  359. package/src/components/sidebar-navigation-screen/index.js +2 -2
  360. package/src/components/sidebar-navigation-screen/style.scss +2 -2
  361. package/src/components/sidebar-navigation-screen-global-styles/content.js +7 -35
  362. package/src/components/sidebar-navigation-screen-global-styles/index.js +13 -34
  363. package/src/components/sidebar-navigation-screen-main/index.js +6 -10
  364. package/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js +3 -5
  365. package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +2 -2
  366. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +6 -6
  367. package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +9 -21
  368. package/src/components/sidebar-navigation-screen-patterns/category-item.js +5 -20
  369. package/src/components/sidebar-navigation-screen-patterns/index.js +3 -4
  370. package/src/components/sidebar-navigation-screen-templates-browse/content.js +24 -18
  371. package/src/components/sidebar-navigation-screen-templates-browse/index.js +1 -14
  372. package/src/components/site-editor-routes/{home-view.js → home.js} +4 -5
  373. package/src/components/site-editor-routes/index.js +22 -34
  374. package/src/components/site-editor-routes/navigation-item.js +39 -0
  375. package/src/components/site-editor-routes/navigation.js +34 -0
  376. package/src/components/site-editor-routes/{pages-edit.js → page-item.js} +6 -14
  377. package/src/components/site-editor-routes/pages.js +66 -0
  378. package/src/components/site-editor-routes/pattern-item.js +15 -0
  379. package/src/components/site-editor-routes/patterns.js +15 -0
  380. package/src/components/site-editor-routes/styles.js +39 -0
  381. package/src/components/site-editor-routes/template-item.js +15 -0
  382. package/src/components/site-editor-routes/template-part-item.js +15 -0
  383. package/src/components/site-editor-routes/templates.js +26 -0
  384. package/src/components/site-hub/index.js +3 -6
  385. package/src/components/style-book/constants.ts +8 -19
  386. package/src/components/style-book/examples.tsx +47 -28
  387. package/src/components/style-book/index.js +28 -5
  388. package/src/components/style-book/types.ts +1 -1
  389. package/src/hooks/commands/use-common-commands.js +14 -72
  390. package/src/hooks/commands/use-set-command-context.js +2 -2
  391. package/src/store/private-actions.js +7 -0
  392. package/src/store/reducer.js +2 -0
  393. package/src/style.scss +1 -0
  394. package/src/utils/is-previewing-theme.js +1 -3
  395. package/src/utils/use-activate-theme.js +4 -3
  396. package/build/components/error-boundary/index.js +0 -47
  397. package/build/components/error-boundary/index.js.map +0 -1
  398. package/build/components/error-boundary/warning.js +0 -42
  399. package/build/components/error-boundary/warning.js.map +0 -1
  400. package/build/components/global-styles/preview-iframe.js.map +0 -1
  401. package/build/components/layout/router.js +0 -92
  402. package/build/components/layout/router.js.map +0 -1
  403. package/build/components/posts-app-routes/home.js.map +0 -1
  404. package/build/components/posts-app-routes/posts-edit.js.map +0 -1
  405. package/build/components/posts-app-routes/posts-list-view-quick-edit.js +0 -63
  406. package/build/components/posts-app-routes/posts-list-view-quick-edit.js.map +0 -1
  407. package/build/components/posts-app-routes/posts-list-view.js +0 -48
  408. package/build/components/posts-app-routes/posts-list-view.js.map +0 -1
  409. package/build/components/posts-app-routes/posts-view-quick-edit.js +0 -60
  410. package/build/components/posts-app-routes/posts-view-quick-edit.js.map +0 -1
  411. package/build/components/posts-app-routes/posts-view.js +0 -41
  412. package/build/components/posts-app-routes/posts-view.js.map +0 -1
  413. package/build/components/routes/link.js +0 -69
  414. package/build/components/routes/link.js.map +0 -1
  415. package/build/components/site-editor-routes/home-edit.js.map +0 -1
  416. package/build/components/site-editor-routes/home-view.js.map +0 -1
  417. package/build/components/site-editor-routes/navigation-edit.js +0 -29
  418. package/build/components/site-editor-routes/navigation-edit.js.map +0 -1
  419. package/build/components/site-editor-routes/navigation-item-edit.js +0 -31
  420. package/build/components/site-editor-routes/navigation-item-edit.js.map +0 -1
  421. package/build/components/site-editor-routes/navigation-item-view.js +0 -30
  422. package/build/components/site-editor-routes/navigation-item-view.js.map +0 -1
  423. package/build/components/site-editor-routes/navigation-view.js +0 -28
  424. package/build/components/site-editor-routes/navigation-view.js.map +0 -1
  425. package/build/components/site-editor-routes/pages-edit.js.map +0 -1
  426. package/build/components/site-editor-routes/pages-list-view-quick-edit.js +0 -64
  427. package/build/components/site-editor-routes/pages-list-view-quick-edit.js.map +0 -1
  428. package/build/components/site-editor-routes/pages-list-view.js +0 -47
  429. package/build/components/site-editor-routes/pages-list-view.js.map +0 -1
  430. package/build/components/site-editor-routes/pages-view-quick-edit.js +0 -61
  431. package/build/components/site-editor-routes/pages-view-quick-edit.js.map +0 -1
  432. package/build/components/site-editor-routes/pages-view.js +0 -42
  433. package/build/components/site-editor-routes/pages-view.js.map +0 -1
  434. package/build/components/site-editor-routes/patterns-edit.js.map +0 -1
  435. package/build/components/site-editor-routes/patterns-view.js.map +0 -1
  436. package/build/components/site-editor-routes/styles-view.js.map +0 -1
  437. package/build/components/site-editor-routes/templates-edit.js.map +0 -1
  438. package/build/components/site-editor-routes/templates-list-view.js.map +0 -1
  439. package/build/components/site-editor-routes/templates-view.js +0 -29
  440. package/build/components/site-editor-routes/templates-view.js.map +0 -1
  441. package/build-module/components/error-boundary/index.js +0 -38
  442. package/build-module/components/error-boundary/index.js.map +0 -1
  443. package/build-module/components/error-boundary/warning.js +0 -35
  444. package/build-module/components/error-boundary/warning.js.map +0 -1
  445. package/build-module/components/global-styles/preview-iframe.js.map +0 -1
  446. package/build-module/components/layout/router.js +0 -84
  447. package/build-module/components/layout/router.js.map +0 -1
  448. package/build-module/components/posts-app-routes/home.js +0 -40
  449. package/build-module/components/posts-app-routes/home.js.map +0 -1
  450. package/build-module/components/posts-app-routes/posts-edit.js.map +0 -1
  451. package/build-module/components/posts-app-routes/posts-list-view-quick-edit.js +0 -55
  452. package/build-module/components/posts-app-routes/posts-list-view-quick-edit.js.map +0 -1
  453. package/build-module/components/posts-app-routes/posts-list-view.js +0 -40
  454. package/build-module/components/posts-app-routes/posts-list-view.js.map +0 -1
  455. package/build-module/components/posts-app-routes/posts-view-quick-edit.js +0 -52
  456. package/build-module/components/posts-app-routes/posts-view-quick-edit.js.map +0 -1
  457. package/build-module/components/posts-app-routes/posts-view.js +0 -33
  458. package/build-module/components/posts-app-routes/posts-view.js.map +0 -1
  459. package/build-module/components/routes/link.js +0 -61
  460. package/build-module/components/routes/link.js.map +0 -1
  461. package/build-module/components/site-editor-routes/home-edit.js.map +0 -1
  462. package/build-module/components/site-editor-routes/home-view.js +0 -17
  463. package/build-module/components/site-editor-routes/home-view.js.map +0 -1
  464. package/build-module/components/site-editor-routes/navigation-edit.js +0 -21
  465. package/build-module/components/site-editor-routes/navigation-edit.js.map +0 -1
  466. package/build-module/components/site-editor-routes/navigation-item-edit.js +0 -23
  467. package/build-module/components/site-editor-routes/navigation-item-edit.js.map +0 -1
  468. package/build-module/components/site-editor-routes/navigation-item-view.js +0 -22
  469. package/build-module/components/site-editor-routes/navigation-item-view.js.map +0 -1
  470. package/build-module/components/site-editor-routes/navigation-view.js +0 -20
  471. package/build-module/components/site-editor-routes/navigation-view.js.map +0 -1
  472. package/build-module/components/site-editor-routes/pages-edit.js.map +0 -1
  473. package/build-module/components/site-editor-routes/pages-list-view-quick-edit.js +0 -56
  474. package/build-module/components/site-editor-routes/pages-list-view-quick-edit.js.map +0 -1
  475. package/build-module/components/site-editor-routes/pages-list-view.js +0 -39
  476. package/build-module/components/site-editor-routes/pages-list-view.js.map +0 -1
  477. package/build-module/components/site-editor-routes/pages-view-quick-edit.js +0 -53
  478. package/build-module/components/site-editor-routes/pages-view-quick-edit.js.map +0 -1
  479. package/build-module/components/site-editor-routes/pages-view.js +0 -34
  480. package/build-module/components/site-editor-routes/pages-view.js.map +0 -1
  481. package/build-module/components/site-editor-routes/patterns-edit.js +0 -23
  482. package/build-module/components/site-editor-routes/patterns-edit.js.map +0 -1
  483. package/build-module/components/site-editor-routes/patterns-view.js.map +0 -1
  484. package/build-module/components/site-editor-routes/styles-view.js +0 -25
  485. package/build-module/components/site-editor-routes/styles-view.js.map +0 -1
  486. package/build-module/components/site-editor-routes/templates-edit.js.map +0 -1
  487. package/build-module/components/site-editor-routes/templates-list-view.js +0 -26
  488. package/build-module/components/site-editor-routes/templates-list-view.js.map +0 -1
  489. package/build-module/components/site-editor-routes/templates-view.js +0 -21
  490. package/build-module/components/site-editor-routes/templates-view.js.map +0 -1
  491. package/src/components/error-boundary/index.js +0 -44
  492. package/src/components/error-boundary/test/error-boundary.js +0 -40
  493. package/src/components/error-boundary/warning.js +0 -30
  494. package/src/components/layout/router.js +0 -86
  495. package/src/components/posts-app-routes/home.js +0 -36
  496. package/src/components/posts-app-routes/posts-list-view-quick-edit.js +0 -52
  497. package/src/components/posts-app-routes/posts-list-view.js +0 -40
  498. package/src/components/posts-app-routes/posts-view-quick-edit.js +0 -49
  499. package/src/components/posts-app-routes/posts-view.js +0 -35
  500. package/src/components/routes/link.js +0 -68
  501. package/src/components/site-editor-routes/home-edit.js +0 -17
  502. package/src/components/site-editor-routes/navigation-edit.js +0 -22
  503. package/src/components/site-editor-routes/navigation-item-edit.js +0 -26
  504. package/src/components/site-editor-routes/navigation-item-view.js +0 -25
  505. package/src/components/site-editor-routes/navigation-view.js +0 -21
  506. package/src/components/site-editor-routes/pages-list-view-quick-edit.js +0 -56
  507. package/src/components/site-editor-routes/pages-list-view.js +0 -44
  508. package/src/components/site-editor-routes/pages-view-quick-edit.js +0 -53
  509. package/src/components/site-editor-routes/pages-view.js +0 -39
  510. package/src/components/site-editor-routes/patterns-edit.js +0 -24
  511. package/src/components/site-editor-routes/patterns-view.js +0 -22
  512. package/src/components/site-editor-routes/styles-view.js +0 -26
  513. package/src/components/site-editor-routes/templates-edit.js +0 -22
  514. package/src/components/site-editor-routes/templates-list-view.js +0 -28
  515. package/src/components/site-editor-routes/templates-view.js +0 -22
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","STYLE_BOOK_COLOR_GROUPS","exports","slug","title","__","origin","type","STYLE_BOOK_THEME_SUBCATEGORIES","blocks","exclude","STYLE_BOOK_CATEGORIES","subcategories","include","ROOT_CONTAINER","STYLE_BOOK_IFRAME_STYLES"],"sources":["@wordpress/edit-site/src/components/style-book/constants.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type { StyleBookCategory, StyleBookColorGroup } from './types';\n\nexport const STYLE_BOOK_COLOR_GROUPS: StyleBookColorGroup[] = [\n\t{\n\t\tslug: 'theme-colors',\n\t\ttitle: __( 'Theme Colors' ),\n\t\torigin: 'theme',\n\t\ttype: 'colors',\n\t},\n\t{\n\t\tslug: 'theme-gradients',\n\t\ttitle: __( 'Theme Gradients' ),\n\t\torigin: 'theme',\n\t\ttype: 'gradients',\n\t},\n\t{\n\t\tslug: 'custom-colors',\n\t\ttitle: __( 'Custom Colors' ),\n\t\torigin: 'custom',\n\t\ttype: 'colors',\n\t},\n\t{\n\t\tslug: 'custom-gradients',\n\t\ttitle: __( 'Custom Gradients' ),\n\t\torigin: 'custom', // User.\n\t\ttype: 'gradients',\n\t},\n\t{\n\t\tslug: 'duotones',\n\t\ttitle: __( 'Duotones' ),\n\t\torigin: 'theme',\n\t\ttype: 'duotones',\n\t},\n\t{\n\t\tslug: 'default-colors',\n\t\ttitle: __( 'Default Colors' ),\n\t\torigin: 'default',\n\t\ttype: 'colors',\n\t},\n\t{\n\t\tslug: 'default-gradients',\n\t\ttitle: __( 'Default Gradients' ),\n\t\torigin: 'default',\n\t\ttype: 'gradients',\n\t},\n];\n\nexport const STYLE_BOOK_THEME_SUBCATEGORIES: Omit<\n\tStyleBookCategory,\n\t'subcategories'\n>[] = [\n\t{\n\t\tslug: 'site-identity',\n\t\ttitle: __( 'Site Identity' ),\n\t\tblocks: [ 'core/site-logo', 'core/site-title', 'core/site-tagline' ],\n\t},\n\t{\n\t\tslug: 'design',\n\t\ttitle: __( 'Design' ),\n\t\tblocks: [ 'core/navigation', 'core/avatar', 'core/post-time-to-read' ],\n\t\texclude: [ 'core/home-link', 'core/navigation-link' ],\n\t},\n\t{\n\t\tslug: 'posts',\n\t\ttitle: __( 'Posts' ),\n\t\tblocks: [\n\t\t\t'core/post-title',\n\t\t\t'core/post-excerpt',\n\t\t\t'core/post-author',\n\t\t\t'core/post-author-name',\n\t\t\t'core/post-author-biography',\n\t\t\t'core/post-date',\n\t\t\t'core/post-terms',\n\t\t\t'core/term-description',\n\t\t\t'core/query-title',\n\t\t\t'core/query-no-results',\n\t\t\t'core/query-pagination',\n\t\t\t'core/query-numbers',\n\t\t],\n\t},\n\t{\n\t\tslug: 'comments',\n\t\ttitle: __( 'Comments' ),\n\t\tblocks: [\n\t\t\t'core/comments-title',\n\t\t\t'core/comments-pagination',\n\t\t\t'core/comments-pagination-numbers',\n\t\t\t'core/comments',\n\t\t\t'core/comments-author-name',\n\t\t\t'core/comment-content',\n\t\t\t'core/comment-date',\n\t\t\t'core/comment-edit-link',\n\t\t\t'core/comment-reply-link',\n\t\t\t'core/comment-template',\n\t\t\t'core/post-comments-count',\n\t\t\t'core/post-comments-link',\n\t\t],\n\t},\n];\n\nexport const STYLE_BOOK_CATEGORIES: StyleBookCategory[] = [\n\t{\n\t\tslug: 'overview',\n\t\ttitle: __( 'Overview' ),\n\t\tblocks: [],\n\t},\n\t{\n\t\tslug: 'text',\n\t\ttitle: __( 'Text' ),\n\t\tblocks: [\n\t\t\t'core/post-content',\n\t\t\t'core/home-link',\n\t\t\t'core/navigation-link',\n\t\t],\n\t},\n\t{\n\t\tslug: 'colors',\n\t\ttitle: __( 'Colors' ),\n\t\tblocks: [],\n\t},\n\t{\n\t\tslug: 'theme',\n\t\ttitle: __( 'Theme' ),\n\t\tsubcategories: STYLE_BOOK_THEME_SUBCATEGORIES,\n\t},\n\t{\n\t\tslug: 'media',\n\t\ttitle: __( 'Media' ),\n\t\tblocks: [ 'core/post-featured-image' ],\n\t},\n\t{\n\t\tslug: 'widgets',\n\t\ttitle: __( 'Widgets' ),\n\t\tblocks: [],\n\t},\n\t{\n\t\tslug: 'embed',\n\t\ttitle: __( 'Embeds' ),\n\t\tinclude: [],\n\t},\n];\n\n// Forming a \"block formatting context\" to prevent margin collapsing.\n// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context\nconst ROOT_CONTAINER = `\n\t.is-root-container {\n\t\tdisplay: flow-root;\n\t}\n`;\n// The content area of the Style Book is rendered within an iframe so that global styles\n// are applied to elements within the entire content area. To support elements that are\n// not part of the block previews, such as headings and layout for the block previews,\n// additional CSS rules need to be passed into the iframe. These are hard-coded below.\n// Note that button styles are unset, and then focus rules from the `Button` component are\n// applied to the `button` element, targeted via `.edit-site-style-book__example`.\n// This is to ensure that browser default styles for buttons are not applied to the previews.\nexport const STYLE_BOOK_IFRAME_STYLES = `\n\tbody {\n\t\tposition: relative;\n\t\tpadding: 32px !important;\n\t}\n\n\t${ ROOT_CONTAINER }\n\n\t.edit-site-style-book__examples {\n\t\tmax-width: 1200px;\n\t\tmargin: 0 auto;\n\t}\n\n\t.edit-site-style-book__example {\n\t max-width: 900px;\n\t\tborder-radius: 2px;\n\t\tcursor: pointer;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 40px;\n\t\tpadding: 16px;\n\t\twidth: 100%;\n\t\tbox-sizing: border-box;\n\t\tscroll-margin-top: 32px;\n\t\tscroll-margin-bottom: 32px;\n\t\tmargin: 0 auto 40px auto;\n\t}\n\n\t.edit-site-style-book__example.is-selected {\n\t\tbox-shadow: 0 0 0 1px var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));\n\t}\n\n\t.edit-site-style-book__example.is-disabled-example {\n\t\tpointer-events: none;\n\t}\n\n\t.edit-site-style-book__example:focus:not(:disabled) {\n\t\tbox-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));\n\t\toutline: 3px solid transparent;\n\t}\n\n\t.edit-site-style-book__duotone-example > div:first-child {\n\t\tdisplay: flex;\n\t\taspect-ratio: 16 / 9;\n\t\tgrid-row: span 1;\n\t\tgrid-column: span 2;\n\t}\n\t.edit-site-style-book__duotone-example img {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tobject-fit: cover;\n\t}\n\t.edit-site-style-book__duotone-example > div:not(:first-child) {\n\t\theight: 20px;\n\t\tborder: 1px solid #ddd;\n\t}\n\n\t.edit-site-style-book__color-example {\n\t\theight: 52px;\n\t\tborder: 1px solid #ddd;\n\t}\n\n\t.edit-site-style-book__examples.is-wide .edit-site-style-book__example {\n\t\tflex-direction: row;\n\t}\n\n\t.edit-site-style-book__subcategory-title,\n\t.edit-site-style-book__example-title {\n\t\tfont-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif;\n\t\tfont-size: 11px;\n\t\tfont-weight: 500;\n\t\tline-height: normal;\n\t\tmargin: 0;\n\t\ttext-align: left;\n\t\ttext-transform: uppercase;\n\t}\n\n\t.edit-site-style-book__subcategory-title {\n\t\tfont-size: 16px;\n\t\tmargin-bottom: 40px;\n \tborder-bottom: 1px solid #ddd;\n \tpadding-bottom: 8px;\n\t}\n\n\t.edit-site-style-book__examples.is-wide .edit-site-style-book__example-title {\n\t\ttext-align: right;\n\t\twidth: 120px;\n\t}\n\n\t.edit-site-style-book__example-preview {\n\t\twidth: 100%;\n\t}\n\t\n\t.is-wide .edit-site-style-book__example-preview {\n\t\twidth: calc(100% - 120px);\n\t}\n\n\t.edit-site-style-book__example-preview .block-editor-block-list__insertion-point,\n\t.edit-site-style-book__example-preview .block-list-appender {\n\t\tdisplay: none;\n\t}\n\t:where(.is-root-container > .wp-block:first-child) {\n\t\tmargin-top: 0;\n\t}\n\t:where(.is-root-container > .wp-block:last-child) {\n\t\tmargin-bottom: 0;\n\t}\n`;\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;;AAGO,MAAMC,uBAA8C,GAAAC,OAAA,CAAAD,uBAAA,GAAG,CAC7D;EACCE,IAAI,EAAE,cAAc;EACpBC,KAAK,EAAE,IAAAC,QAAE,EAAE,cAAe,CAAC;EAC3BC,MAAM,EAAE,OAAO;EACfC,IAAI,EAAE;AACP,CAAC,EACD;EACCJ,IAAI,EAAE,iBAAiB;EACvBC,KAAK,EAAE,IAAAC,QAAE,EAAE,iBAAkB,CAAC;EAC9BC,MAAM,EAAE,OAAO;EACfC,IAAI,EAAE;AACP,CAAC,EACD;EACCJ,IAAI,EAAE,eAAe;EACrBC,KAAK,EAAE,IAAAC,QAAE,EAAE,eAAgB,CAAC;EAC5BC,MAAM,EAAE,QAAQ;EAChBC,IAAI,EAAE;AACP,CAAC,EACD;EACCJ,IAAI,EAAE,kBAAkB;EACxBC,KAAK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;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,wBAAwB,GAAAb,OAAA,CAAAa,wBAAA,GAAG;AACxC;AACA;AACA;AACA;AACA;AACA,GAAID,cAAc;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","STYLE_BOOK_COLOR_GROUPS","exports","slug","title","__","origin","type","STYLE_BOOK_THEME_SUBCATEGORIES","blocks","exclude","STYLE_BOOK_CATEGORIES","subcategories","include","ROOT_CONTAINER","STYLE_BOOK_IFRAME_STYLES"],"sources":["@wordpress/edit-site/src/components/style-book/constants.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type { StyleBookCategory, StyleBookColorGroup } from './types';\n\nexport const STYLE_BOOK_COLOR_GROUPS: StyleBookColorGroup[] = [\n\t{\n\t\tslug: 'theme-colors',\n\t\ttitle: __( 'Theme Colors' ),\n\t\torigin: 'theme',\n\t\ttype: 'colors',\n\t},\n\t{\n\t\tslug: 'theme-gradients',\n\t\ttitle: __( 'Theme Gradients' ),\n\t\torigin: 'theme',\n\t\ttype: 'gradients',\n\t},\n\t{\n\t\tslug: 'custom-colors',\n\t\ttitle: __( 'Custom Colors' ),\n\t\torigin: 'custom',\n\t\ttype: 'colors',\n\t},\n\t{\n\t\tslug: 'custom-gradients',\n\t\ttitle: __( 'Custom Gradients' ),\n\t\torigin: 'custom', // User.\n\t\ttype: 'gradients',\n\t},\n\t{\n\t\tslug: 'duotones',\n\t\ttitle: __( 'Duotones' ),\n\t\torigin: 'theme',\n\t\ttype: 'duotones',\n\t},\n\t{\n\t\tslug: 'default-colors',\n\t\ttitle: __( 'Default Colors' ),\n\t\torigin: 'default',\n\t\ttype: 'colors',\n\t},\n\t{\n\t\tslug: 'default-gradients',\n\t\ttitle: __( 'Default Gradients' ),\n\t\torigin: 'default',\n\t\ttype: 'gradients',\n\t},\n];\n\nexport const STYLE_BOOK_THEME_SUBCATEGORIES: Omit<\n\tStyleBookCategory,\n\t'subcategories'\n>[] = [\n\t{\n\t\tslug: 'site-identity',\n\t\ttitle: __( 'Site Identity' ),\n\t\tblocks: [ 'core/site-logo', 'core/site-title', 'core/site-tagline' ],\n\t},\n\t{\n\t\tslug: 'design',\n\t\ttitle: __( 'Design' ),\n\t\tblocks: [ 'core/navigation', 'core/avatar', 'core/post-time-to-read' ],\n\t\texclude: [ 'core/home-link', 'core/navigation-link' ],\n\t},\n\t{\n\t\tslug: 'posts',\n\t\ttitle: __( 'Posts' ),\n\t\tblocks: [\n\t\t\t'core/post-title',\n\t\t\t'core/post-excerpt',\n\t\t\t'core/post-author',\n\t\t\t'core/post-author-name',\n\t\t\t'core/post-author-biography',\n\t\t\t'core/post-date',\n\t\t\t'core/post-terms',\n\t\t\t'core/term-description',\n\t\t\t'core/query-title',\n\t\t\t'core/query-no-results',\n\t\t\t'core/query-pagination',\n\t\t\t'core/query-numbers',\n\t\t],\n\t},\n\t{\n\t\tslug: 'comments',\n\t\ttitle: __( 'Comments' ),\n\t\tblocks: [\n\t\t\t'core/comments-title',\n\t\t\t'core/comments-pagination',\n\t\t\t'core/comments-pagination-numbers',\n\t\t\t'core/comments',\n\t\t\t'core/comments-author-name',\n\t\t\t'core/comment-content',\n\t\t\t'core/comment-date',\n\t\t\t'core/comment-edit-link',\n\t\t\t'core/comment-reply-link',\n\t\t\t'core/comment-template',\n\t\t\t'core/post-comments-count',\n\t\t\t'core/post-comments-link',\n\t\t],\n\t},\n];\n\nexport const STYLE_BOOK_CATEGORIES: StyleBookCategory[] = [\n\t{\n\t\tslug: 'overview',\n\t\ttitle: __( 'Overview' ),\n\t\tblocks: [],\n\t},\n\t{\n\t\tslug: 'text',\n\t\ttitle: __( 'Text' ),\n\t\tblocks: [\n\t\t\t'core/post-content',\n\t\t\t'core/home-link',\n\t\t\t'core/navigation-link',\n\t\t],\n\t},\n\t{\n\t\tslug: 'colors',\n\t\ttitle: __( 'Colors' ),\n\t\tblocks: [],\n\t},\n\t{\n\t\tslug: 'theme',\n\t\ttitle: __( 'Theme' ),\n\t\tsubcategories: STYLE_BOOK_THEME_SUBCATEGORIES,\n\t},\n\t{\n\t\tslug: 'media',\n\t\ttitle: __( 'Media' ),\n\t\tblocks: [ 'core/post-featured-image' ],\n\t},\n\t{\n\t\tslug: 'widgets',\n\t\ttitle: __( 'Widgets' ),\n\t\tblocks: [],\n\t},\n\t{\n\t\tslug: 'embed',\n\t\ttitle: __( 'Embeds' ),\n\t\tinclude: [],\n\t},\n];\n\n// Forming a \"block formatting context\" to prevent margin collapsing.\n// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context\nconst ROOT_CONTAINER = `\n\t.is-root-container {\n\t\tdisplay: flow-root;\n\t}\n`;\n// The content area of the Style Book is rendered within an iframe so that global styles\n// are applied to elements within the entire content area. To support elements that are\n// not part of the block previews, such as headings and layout for the block previews,\n// additional CSS rules need to be passed into the iframe. These are hard-coded below.\n// Note that button styles are unset, and then focus rules from the `Button` component are\n// applied to the `button` element, targeted via `.edit-site-style-book__example`.\n// This is to ensure that browser default styles for buttons are not applied to the previews.\nexport const STYLE_BOOK_IFRAME_STYLES = `\n\tbody {\n\t\tposition: relative;\n\t\tpadding: 32px !important;\n\t}\n\n\t${ ROOT_CONTAINER }\n\n\t.edit-site-style-book__examples {\n\t\tmax-width: 1200px;\n\t\tmargin: 0 auto;\n\t}\n\n\t.edit-site-style-book__example {\n\t max-width: 900px;\n\t\tborder-radius: 2px;\n\t\tcursor: pointer;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 40px;\n\t\tpadding: 16px;\n\t\twidth: 100%;\n\t\tbox-sizing: border-box;\n\t\tscroll-margin-top: 32px;\n\t\tscroll-margin-bottom: 32px;\n\t\tmargin: 0 auto 40px auto;\n\t}\n\n\t.edit-site-style-book__example.is-selected {\n\t\tbox-shadow: 0 0 0 1px var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));\n\t}\n\n\t.edit-site-style-book__example.is-disabled-example {\n\t\tpointer-events: none;\n\t}\n\n\t.edit-site-style-book__example:focus:not(:disabled) {\n\t\tbox-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));\n\t\toutline: 3px solid transparent;\n\t}\n\n\t.edit-site-style-book__duotone-example > div:first-child {\n\t\tdisplay: flex;\n\t\taspect-ratio: 16 / 9;\n\t\tgrid-row: span 1;\n\t\tgrid-column: span 2;\n\t}\n\t.edit-site-style-book__duotone-example img {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tobject-fit: cover;\n\t}\n\t.edit-site-style-book__duotone-example > div:not(:first-child) {\n\t\theight: 20px;\n\t\tborder: 1px solid color-mix( in srgb, currentColor 10%, transparent );\n\t}\n\n\t.edit-site-style-book__color-example {\n\t\theight: 32px;\n\t\tborder: 1px solid color-mix( in srgb, currentColor 10%, transparent );\n\t}\n\n\t.edit-site-style-book__subcategory-title,\n\t.edit-site-style-book__example-title {\n\t\tfont-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif;\n\t\tfont-size: 13px;\n\t\tfont-weight: normal;\n\t\tline-height: normal;\n\t\tmargin: 0;\n\t\ttext-align: left;\n\t\tpadding-top: 8px;\n\t\tborder-top: 1px solid color-mix( in srgb, currentColor 10%, transparent );\n\t\tcolor: color-mix( in srgb, currentColor 60%, transparent );\n\t}\n\n\t.edit-site-style-book__subcategory-title {\n\t\tfont-size: 16px;\n\t\tmargin-bottom: 40px;\n \tborder-bottom: 1px solid #ddd;\n \tpadding-bottom: 8px;\n\t}\n\n\t.edit-site-style-book__example-preview {\n\t\twidth: 100%;\n\t}\n\n\t.edit-site-style-book__example-preview .block-editor-block-list__insertion-point,\n\t.edit-site-style-book__example-preview .block-list-appender {\n\t\tdisplay: none;\n\t}\n\t:where(.is-root-container > .wp-block:first-child) {\n\t\tmargin-top: 0;\n\t}\n\t:where(.is-root-container > .wp-block:last-child) {\n\t\tmargin-bottom: 0;\n\t}\n`;\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;;AAGO,MAAMC,uBAA8C,GAAAC,OAAA,CAAAD,uBAAA,GAAG,CAC7D;EACCE,IAAI,EAAE,cAAc;EACpBC,KAAK,EAAE,IAAAC,QAAE,EAAE,cAAe,CAAC;EAC3BC,MAAM,EAAE,OAAO;EACfC,IAAI,EAAE;AACP,CAAC,EACD;EACCJ,IAAI,EAAE,iBAAiB;EACvBC,KAAK,EAAE,IAAAC,QAAE,EAAE,iBAAkB,CAAC;EAC9BC,MAAM,EAAE,OAAO;EACfC,IAAI,EAAE;AACP,CAAC,EACD;EACCJ,IAAI,EAAE,eAAe;EACrBC,KAAK,EAAE,IAAAC,QAAE,EAAE,eAAgB,CAAC;EAC5BC,MAAM,EAAE,QAAQ;EAChBC,IAAI,EAAE;AACP,CAAC,EACD;EACCJ,IAAI,EAAE,kBAAkB;EACxBC,KAAK,EAAE,IAAAC,QAAE,EAAE,kBAAmB,CAAC;EAC/BC,MAAM,EAAE,QAAQ;EAAE;EAClB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AA,GAAG;AACxC;AACA;AACA;AACA;AACA;AACA,GAAID,cAAc;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
@@ -78,34 +78,49 @@ function getOverviewBlockExamples(colors) {
78
78
  };
79
79
  examples.push(themeColorexample);
80
80
  }
81
- const headingBlock = (0, _blocks.createBlock)('core/heading', {
82
- content: (0, _i18n.__)(`AaBbCcDdEeFfGgHhiiJjKkLIMmNnOoPpQakRrssTtUuVVWwXxxYyZzOl23356789X{(…)},2!*&:/A@HELFO™`),
83
- level: 1
84
- });
85
- const firstParagraphBlock = (0, _blocks.createBlock)('core/paragraph', {
86
- content: (0, _i18n.__)(`A paragraph in a website refers to a distinct block of text that is used to present and organize information. It is a fundamental unit of content in web design and is typically composed of a group of related sentences or thoughts focused on a particular topic or idea. Paragraphs play a crucial role in improving the readability and user experience of a website. They break down the text into smaller, manageable chunks, allowing readers to scan the content more easily.`)
87
- });
88
- const secondParagraphBlock = (0, _blocks.createBlock)('core/paragraph', {
89
- content: (0, _i18n.__)(`Additionally, paragraphs help structure the flow of information and provide logical breaks between different concepts or pieces of information. In terms of formatting, paragraphs in websites are commonly denoted by a vertical gap or indentation between each block of text. This visual separation helps visually distinguish one paragraph from another, creating a clear and organized layout that guides the reader through the content smoothly.`)
90
- });
91
- const textExample = {
92
- name: 'typography',
93
- title: (0, _i18n.__)('Typography'),
94
- category: 'overview',
95
- blocks: [headingBlock, (0, _blocks.createBlock)('core/group', {
96
- layout: {
97
- type: 'grid',
98
- columnCount: 2,
99
- minimumColumnWidth: '12rem'
100
- },
101
- style: {
102
- spacing: {
103
- blockGap: '1.5rem'
81
+
82
+ // Get examples for typography blocks.
83
+ const typographyBlockExamples = [];
84
+ if ((0, _blocks.getBlockType)('core/heading')) {
85
+ const headingBlock = (0, _blocks.createBlock)('core/heading', {
86
+ content: (0, _i18n.__)(`AaBbCcDdEeFfGgHhiiJjKkLIMmNnOoPpQakRrssTtUuVVWwXxxYyZzOl23356789X{(…)},2!*&:/A@HELFO™`),
87
+ level: 1
88
+ });
89
+ typographyBlockExamples.push(headingBlock);
90
+ }
91
+ if ((0, _blocks.getBlockType)('core/paragraph')) {
92
+ const firstParagraphBlock = (0, _blocks.createBlock)('core/paragraph', {
93
+ content: (0, _i18n.__)(`A paragraph in a website refers to a distinct block of text that is used to present and organize information. It is a fundamental unit of content in web design and is typically composed of a group of related sentences or thoughts focused on a particular topic or idea. Paragraphs play a crucial role in improving the readability and user experience of a website. They break down the text into smaller, manageable chunks, allowing readers to scan the content more easily.`)
94
+ });
95
+ const secondParagraphBlock = (0, _blocks.createBlock)('core/paragraph', {
96
+ content: (0, _i18n.__)(`Additionally, paragraphs help structure the flow of information and provide logical breaks between different concepts or pieces of information. In terms of formatting, paragraphs in websites are commonly denoted by a vertical gap or indentation between each block of text. This visual separation helps visually distinguish one paragraph from another, creating a clear and organized layout that guides the reader through the content smoothly.`)
97
+ });
98
+ if ((0, _blocks.getBlockType)('core/group')) {
99
+ const groupBlock = (0, _blocks.createBlock)('core/group', {
100
+ layout: {
101
+ type: 'grid',
102
+ columnCount: 2,
103
+ minimumColumnWidth: '12rem'
104
+ },
105
+ style: {
106
+ spacing: {
107
+ blockGap: '1.5rem'
108
+ }
104
109
  }
105
- }
106
- }, [firstParagraphBlock, secondParagraphBlock])]
107
- };
108
- examples.push(textExample);
110
+ }, [firstParagraphBlock, secondParagraphBlock]);
111
+ typographyBlockExamples.push(groupBlock);
112
+ } else {
113
+ typographyBlockExamples.push(firstParagraphBlock);
114
+ }
115
+ }
116
+ if (!!typographyBlockExamples.length) {
117
+ examples.push({
118
+ name: 'typography',
119
+ title: (0, _i18n.__)('Typography'),
120
+ category: 'overview',
121
+ blocks: typographyBlockExamples
122
+ });
123
+ }
109
124
  const otherBlockExamples = ['core/image', 'core/separator', 'core/buttons', 'core/pullquote', 'core/search'];
110
125
 
111
126
  // Get examples for other blocks and put them in order of above array.
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_blocks","_colorExamples","_interopRequireDefault","_duotoneExamples","_constants","_jsxRuntime","getColorExamples","colors","examples","STYLE_BOOK_COLOR_GROUPS","forEach","group","palette","type","find","origin","slug","example","name","title","category","content","jsx","default","duotones","push","getOverviewBlockExamples","themePalette","themeColorexample","__","headingBlock","createBlock","level","firstParagraphBlock","secondParagraphBlock","textExample","blocks","layout","columnCount","minimumColumnWidth","style","spacing","blockGap","otherBlockExamples","blockName","blockType","getBlockType","blockExample","getBlockFromExample","attributes","undefined","getExamples","nonHeadingBlockExamples","getBlockTypes","filter","supports","inserter","map","isHeadingBlockRegistered","headingsExample","sprintf","colorExamples","overviewBlockExamples"],"sources":["@wordpress/edit-site/src/components/style-book/examples.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tgetBlockType,\n\tgetBlockTypes,\n\tgetBlockFromExample,\n\tcreateBlock,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport type { BlockExample, ColorOrigin, MultiOriginPalettes } from './types';\nimport ColorExamples from './color-examples';\nimport DuotoneExamples from './duotone-examples';\nimport { STYLE_BOOK_COLOR_GROUPS } from './constants';\n\n/**\n * Returns examples color examples for each origin\n * e.g. Core (Default), Theme, and User.\n *\n * @param {MultiOriginPalettes} colors Global Styles color palettes per origin.\n * @return {BlockExample[]} An array of color block examples.\n */\nfunction getColorExamples( colors: MultiOriginPalettes ): BlockExample[] {\n\tif ( ! colors ) {\n\t\treturn [];\n\t}\n\n\tconst examples: BlockExample[] = [];\n\n\tSTYLE_BOOK_COLOR_GROUPS.forEach( ( group ) => {\n\t\tconst palette = colors[ group.type ].find(\n\t\t\t( origin: ColorOrigin ) => origin.slug === group.origin\n\t\t);\n\n\t\tif ( palette?.[ group.type ] ) {\n\t\t\tconst example: BlockExample = {\n\t\t\t\tname: group.slug,\n\t\t\t\ttitle: group.title,\n\t\t\t\tcategory: 'colors',\n\t\t\t};\n\t\t\tif ( group.type === 'duotones' ) {\n\t\t\t\texample.content = (\n\t\t\t\t\t<DuotoneExamples duotones={ palette[ group.type ] } />\n\t\t\t\t);\n\t\t\t\texamples.push( example );\n\t\t\t} else {\n\t\t\t\texample.content = (\n\t\t\t\t\t<ColorExamples\n\t\t\t\t\t\tcolors={ palette[ group.type ] }\n\t\t\t\t\t\ttype={ group.type }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t\texamples.push( example );\n\t\t\t}\n\t\t}\n\t} );\n\n\treturn examples;\n}\n\n/**\n * Returns examples for the overview page.\n *\n * @param {MultiOriginPalettes} colors Global Styles color palettes per origin.\n * @return {BlockExample[]} An array of block examples.\n */\nfunction getOverviewBlockExamples(\n\tcolors: MultiOriginPalettes\n): BlockExample[] {\n\tconst examples: BlockExample[] = [];\n\n\t// Get theme palette from colors.\n\tconst themePalette = colors.colors.find(\n\t\t( origin: ColorOrigin ) => origin.slug === 'theme'\n\t);\n\n\tif ( themePalette ) {\n\t\tconst themeColorexample: BlockExample = {\n\t\t\tname: 'theme-colors',\n\t\t\ttitle: __( 'Colors' ),\n\t\t\tcategory: 'overview',\n\t\t\tcontent: (\n\t\t\t\t<ColorExamples colors={ themePalette.colors } type={ colors } />\n\t\t\t),\n\t\t};\n\n\t\texamples.push( themeColorexample );\n\t}\n\n\tconst headingBlock = createBlock( 'core/heading', {\n\t\tcontent: __(\n\t\t\t`AaBbCcDdEeFfGgHhiiJjKkLIMmNnOoPpQakRrssTtUuVVWwXxxYyZzOl23356789X{(…)},2!*&:/A@HELFO™`\n\t\t),\n\t\tlevel: 1,\n\t} );\n\tconst firstParagraphBlock = createBlock( 'core/paragraph', {\n\t\tcontent: __(\n\t\t\t`A paragraph in a website refers to a distinct block of text that is used to present and organize information. It is a fundamental unit of content in web design and is typically composed of a group of related sentences or thoughts focused on a particular topic or idea. Paragraphs play a crucial role in improving the readability and user experience of a website. They break down the text into smaller, manageable chunks, allowing readers to scan the content more easily.`\n\t\t),\n\t} );\n\tconst secondParagraphBlock = createBlock( 'core/paragraph', {\n\t\tcontent: __(\n\t\t\t`Additionally, paragraphs help structure the flow of information and provide logical breaks between different concepts or pieces of information. In terms of formatting, paragraphs in websites are commonly denoted by a vertical gap or indentation between each block of text. This visual separation helps visually distinguish one paragraph from another, creating a clear and organized layout that guides the reader through the content smoothly.`\n\t\t),\n\t} );\n\n\tconst textExample = {\n\t\tname: 'typography',\n\t\ttitle: __( 'Typography' ),\n\t\tcategory: 'overview',\n\t\tblocks: [\n\t\t\theadingBlock,\n\t\t\tcreateBlock(\n\t\t\t\t'core/group',\n\t\t\t\t{\n\t\t\t\t\tlayout: {\n\t\t\t\t\t\ttype: 'grid',\n\t\t\t\t\t\tcolumnCount: 2,\n\t\t\t\t\t\tminimumColumnWidth: '12rem',\n\t\t\t\t\t},\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\tspacing: {\n\t\t\t\t\t\t\tblockGap: '1.5rem',\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t[ firstParagraphBlock, secondParagraphBlock ]\n\t\t\t),\n\t\t],\n\t};\n\texamples.push( textExample );\n\n\tconst otherBlockExamples = [\n\t\t'core/image',\n\t\t'core/separator',\n\t\t'core/buttons',\n\t\t'core/pullquote',\n\t\t'core/search',\n\t];\n\n\t// Get examples for other blocks and put them in order of above array.\n\totherBlockExamples.forEach( ( blockName ) => {\n\t\tconst blockType = getBlockType( blockName );\n\t\tif ( blockType && blockType.example ) {\n\t\t\tconst blockExample: BlockExample = {\n\t\t\t\tname: blockName,\n\t\t\t\ttitle: blockType.title,\n\t\t\t\tcategory: 'overview',\n\t\t\t\t/*\n\t\t\t\t * CSS generated from style attributes will take precedence over global styles CSS,\n\t\t\t\t * so remove the style attribute from the example to ensure the example\n\t\t\t\t * demonstrates changes to global styles.\n\t\t\t\t */\n\t\t\t\tblocks: getBlockFromExample( blockName, {\n\t\t\t\t\t...blockType.example,\n\t\t\t\t\tattributes: {\n\t\t\t\t\t\t...blockType.example.attributes,\n\t\t\t\t\t\tstyle: undefined,\n\t\t\t\t\t},\n\t\t\t\t} ),\n\t\t\t};\n\t\t\texamples.push( blockExample );\n\t\t}\n\t} );\n\n\treturn examples;\n}\n\n/**\n * Returns a list of examples for registered block types.\n *\n * @param {MultiOriginPalettes} colors Global styles colors grouped by origin e.g. Core, Theme, and User.\n * @return {BlockExample[]} An array of block examples.\n */\nexport function getExamples( colors: MultiOriginPalettes ): BlockExample[] {\n\tconst nonHeadingBlockExamples = getBlockTypes()\n\t\t.filter( ( blockType ) => {\n\t\t\tconst { name, example, supports } = blockType;\n\t\t\treturn (\n\t\t\t\tname !== 'core/heading' &&\n\t\t\t\t!! example &&\n\t\t\t\tsupports?.inserter !== false\n\t\t\t);\n\t\t} )\n\t\t.map( ( blockType ) => ( {\n\t\t\tname: blockType.name,\n\t\t\ttitle: blockType.title,\n\t\t\tcategory: blockType.category,\n\t\t\t/*\n\t\t\t * CSS generated from style attributes will take precedence over global styles CSS,\n\t\t\t * so remove the style attribute from the example to ensure the example\n\t\t\t * demonstrates changes to global styles.\n\t\t\t */\n\t\t\tblocks: getBlockFromExample( blockType.name, {\n\t\t\t\t...blockType.example,\n\t\t\t\tattributes: {\n\t\t\t\t\t...blockType.example.attributes,\n\t\t\t\t\tstyle: undefined,\n\t\t\t\t},\n\t\t\t} ),\n\t\t} ) );\n\tconst isHeadingBlockRegistered = !! getBlockType( 'core/heading' );\n\n\tif ( ! isHeadingBlockRegistered ) {\n\t\treturn nonHeadingBlockExamples;\n\t}\n\n\t// Use our own example for the Heading block so that we can show multiple\n\t// heading levels.\n\tconst headingsExample = {\n\t\tname: 'core/heading',\n\t\ttitle: __( 'Headings' ),\n\t\tcategory: 'text',\n\t\tblocks: [ 1, 2, 3, 4, 5, 6 ].map( ( level ) => {\n\t\t\treturn createBlock( 'core/heading', {\n\t\t\t\tcontent: sprintf(\n\t\t\t\t\t// translators: %d: heading level e.g: \"1\", \"2\", \"3\"\n\t\t\t\t\t__( 'Heading %d' ),\n\t\t\t\t\tlevel\n\t\t\t\t),\n\t\t\t\tlevel,\n\t\t\t} );\n\t\t} ),\n\t};\n\tconst colorExamples = getColorExamples( colors );\n\n\tconst overviewBlockExamples = getOverviewBlockExamples( colors );\n\n\treturn [\n\t\theadingsExample,\n\t\t...colorExamples,\n\t\t...nonHeadingBlockExamples,\n\t\t...overviewBlockExamples,\n\t];\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAWA,IAAAE,cAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,gBAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AAAsD,IAAAM,WAAA,GAAAN,OAAA;AAjBtD;AACA;AACA;;AASA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA,GACA,SAASO,gBAAgBA,CAAEC,MAA2B,EAAmB;EACxE,IAAK,CAAEA,MAAM,EAAG;IACf,OAAO,EAAE;EACV;EAEA,MAAMC,QAAwB,GAAG,EAAE;EAEnCC,kCAAuB,CAACC,OAAO,CAAIC,KAAK,IAAM;IAC7C,MAAMC,OAAO,GAAGL,MAAM,CAAEI,KAAK,CAACE,IAAI,CAAE,CAACC,IAAI,CACtCC,MAAmB,IAAMA,MAAM,CAACC,IAA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UAAU;QAC/BT,KAAK,EAAEU;MACR;IACD,CAAE;EACH,CAAC,CAAG,CAAC;EACN,MAAMQ,wBAAwB,GAAG,CAAC,CAAE,IAAAZ,oBAAY,EAAE,cAAe,CAAC;EAElE,IAAK,CAAEY,wBAAwB,EAAG;IACjC,OAAON,uBAAuB;EAC/B;;EAEA;EACA;EACA,MAAMO,eAAe,GAAG;IACvBzC,IAAI,EAAE,cAAc;IACpBC,KAAK,EAAE,IAAAU,QAAE,EAAE,UAAW,CAAC;IACvBT,QAAQ,EAAE,MAAM;IAChBgB,MAAM,EAAE,CAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAE,CAACqB,GAAG,CAAIzB,KAAK,IAAM;MAC9C,OAAO,IAAAD,mBAAW,EAAE,cAAc,EAAE;QACnCV,OAAO,EAAE,IAAAuC,aAAO;QACf;QACA,IAAA/B,QAAE,EAAE,YAAa,CAAC,EAClBG,KACD,CAAC;QACDA;MACD,CAAE,CAAC;IACJ,CAAE;EACH,CAAC;EACD,MAAM6B,aAAa,GAAGvD,gBAAgB,CAAEC,MAAO,CAAC;EAEhD,MAAMuD,qBAAqB,GAAGpC,wBAAwB,CAAEnB,MAAO,CAAC;EAEhE,OAAO,CACNoD,eAAe,EACf,GAAGE,aAAa,EAChB,GAAGT,uBAAuB,EAC1B,GAAGU,qBAAqB,CACxB;AACF","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_blocks","_colorExamples","_interopRequireDefault","_duotoneExamples","_constants","_jsxRuntime","getColorExamples","colors","examples","STYLE_BOOK_COLOR_GROUPS","forEach","group","palette","type","find","origin","slug","example","name","title","category","content","jsx","default","duotones","push","getOverviewBlockExamples","themePalette","themeColorexample","__","typographyBlockExamples","getBlockType","headingBlock","createBlock","level","firstParagraphBlock","secondParagraphBlock","groupBlock","layout","columnCount","minimumColumnWidth","style","spacing","blockGap","length","blocks","otherBlockExamples","blockName","blockType","blockExample","getBlockFromExample","attributes","undefined","getExamples","nonHeadingBlockExamples","getBlockTypes","filter","supports","inserter","map","isHeadingBlockRegistered","headingsExample","sprintf","colorExamples","overviewBlockExamples"],"sources":["@wordpress/edit-site/src/components/style-book/examples.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tgetBlockType,\n\tgetBlockTypes,\n\tgetBlockFromExample,\n\tcreateBlock,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport type {\n\tBlock,\n\tBlockExample,\n\tColorOrigin,\n\tMultiOriginPalettes,\n} from './types';\nimport ColorExamples from './color-examples';\nimport DuotoneExamples from './duotone-examples';\nimport { STYLE_BOOK_COLOR_GROUPS } from './constants';\n\n/**\n * Returns examples color examples for each origin\n * e.g. Core (Default), Theme, and User.\n *\n * @param {MultiOriginPalettes} colors Global Styles color palettes per origin.\n * @return {BlockExample[]} An array of color block examples.\n */\nfunction getColorExamples( colors: MultiOriginPalettes ): BlockExample[] {\n\tif ( ! colors ) {\n\t\treturn [];\n\t}\n\n\tconst examples: BlockExample[] = [];\n\n\tSTYLE_BOOK_COLOR_GROUPS.forEach( ( group ) => {\n\t\tconst palette = colors[ group.type ].find(\n\t\t\t( origin: ColorOrigin ) => origin.slug === group.origin\n\t\t);\n\n\t\tif ( palette?.[ group.type ] ) {\n\t\t\tconst example: BlockExample = {\n\t\t\t\tname: group.slug,\n\t\t\t\ttitle: group.title,\n\t\t\t\tcategory: 'colors',\n\t\t\t};\n\t\t\tif ( group.type === 'duotones' ) {\n\t\t\t\texample.content = (\n\t\t\t\t\t<DuotoneExamples duotones={ palette[ group.type ] } />\n\t\t\t\t);\n\t\t\t\texamples.push( example );\n\t\t\t} else {\n\t\t\t\texample.content = (\n\t\t\t\t\t<ColorExamples\n\t\t\t\t\t\tcolors={ palette[ group.type ] }\n\t\t\t\t\t\ttype={ group.type }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t\texamples.push( example );\n\t\t\t}\n\t\t}\n\t} );\n\n\treturn examples;\n}\n\n/**\n * Returns examples for the overview page.\n *\n * @param {MultiOriginPalettes} colors Global Styles color palettes per origin.\n * @return {BlockExample[]} An array of block examples.\n */\nfunction getOverviewBlockExamples(\n\tcolors: MultiOriginPalettes\n): BlockExample[] {\n\tconst examples: BlockExample[] = [];\n\n\t// Get theme palette from colors.\n\tconst themePalette = colors.colors.find(\n\t\t( origin: ColorOrigin ) => origin.slug === 'theme'\n\t);\n\n\tif ( themePalette ) {\n\t\tconst themeColorexample: BlockExample = {\n\t\t\tname: 'theme-colors',\n\t\t\ttitle: __( 'Colors' ),\n\t\t\tcategory: 'overview',\n\t\t\tcontent: (\n\t\t\t\t<ColorExamples colors={ themePalette.colors } type={ colors } />\n\t\t\t),\n\t\t};\n\n\t\texamples.push( themeColorexample );\n\t}\n\n\t// Get examples for typography blocks.\n\tconst typographyBlockExamples: Block[] = [];\n\n\tif ( getBlockType( 'core/heading' ) ) {\n\t\tconst headingBlock = createBlock( 'core/heading', {\n\t\t\tcontent: __(\n\t\t\t\t`AaBbCcDdEeFfGgHhiiJjKkLIMmNnOoPpQakRrssTtUuVVWwXxxYyZzOl23356789X{(…)},2!*&:/A@HELFO™`\n\t\t\t),\n\t\t\tlevel: 1,\n\t\t} );\n\t\ttypographyBlockExamples.push( headingBlock );\n\t}\n\n\tif ( getBlockType( 'core/paragraph' ) ) {\n\t\tconst firstParagraphBlock = createBlock( 'core/paragraph', {\n\t\t\tcontent: __(\n\t\t\t\t`A paragraph in a website refers to a distinct block of text that is used to present and organize information. It is a fundamental unit of content in web design and is typically composed of a group of related sentences or thoughts focused on a particular topic or idea. Paragraphs play a crucial role in improving the readability and user experience of a website. They break down the text into smaller, manageable chunks, allowing readers to scan the content more easily.`\n\t\t\t),\n\t\t} );\n\t\tconst secondParagraphBlock = createBlock( 'core/paragraph', {\n\t\t\tcontent: __(\n\t\t\t\t`Additionally, paragraphs help structure the flow of information and provide logical breaks between different concepts or pieces of information. In terms of formatting, paragraphs in websites are commonly denoted by a vertical gap or indentation between each block of text. This visual separation helps visually distinguish one paragraph from another, creating a clear and organized layout that guides the reader through the content smoothly.`\n\t\t\t),\n\t\t} );\n\n\t\tif ( getBlockType( 'core/group' ) ) {\n\t\t\tconst groupBlock = createBlock(\n\t\t\t\t'core/group',\n\t\t\t\t{\n\t\t\t\t\tlayout: {\n\t\t\t\t\t\ttype: 'grid',\n\t\t\t\t\t\tcolumnCount: 2,\n\t\t\t\t\t\tminimumColumnWidth: '12rem',\n\t\t\t\t\t},\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\tspacing: {\n\t\t\t\t\t\t\tblockGap: '1.5rem',\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t[ firstParagraphBlock, secondParagraphBlock ]\n\t\t\t);\n\t\t\ttypographyBlockExamples.push( groupBlock );\n\t\t} else {\n\t\t\ttypographyBlockExamples.push( firstParagraphBlock );\n\t\t}\n\t}\n\n\tif ( !! typographyBlockExamples.length ) {\n\t\texamples.push( {\n\t\t\tname: 'typography',\n\t\t\ttitle: __( 'Typography' ),\n\t\t\tcategory: 'overview',\n\t\t\tblocks: typographyBlockExamples,\n\t\t} );\n\t}\n\n\tconst otherBlockExamples = [\n\t\t'core/image',\n\t\t'core/separator',\n\t\t'core/buttons',\n\t\t'core/pullquote',\n\t\t'core/search',\n\t];\n\n\t// Get examples for other blocks and put them in order of above array.\n\totherBlockExamples.forEach( ( blockName ) => {\n\t\tconst blockType = getBlockType( blockName );\n\t\tif ( blockType && blockType.example ) {\n\t\t\tconst blockExample: BlockExample = {\n\t\t\t\tname: blockName,\n\t\t\t\ttitle: blockType.title,\n\t\t\t\tcategory: 'overview',\n\t\t\t\t/*\n\t\t\t\t * CSS generated from style attributes will take precedence over global styles CSS,\n\t\t\t\t * so remove the style attribute from the example to ensure the example\n\t\t\t\t * demonstrates changes to global styles.\n\t\t\t\t */\n\t\t\t\tblocks: getBlockFromExample( blockName, {\n\t\t\t\t\t...blockType.example,\n\t\t\t\t\tattributes: {\n\t\t\t\t\t\t...blockType.example.attributes,\n\t\t\t\t\t\tstyle: undefined,\n\t\t\t\t\t},\n\t\t\t\t} ),\n\t\t\t};\n\t\t\texamples.push( blockExample );\n\t\t}\n\t} );\n\n\treturn examples;\n}\n\n/**\n * Returns a list of examples for registered block types.\n *\n * @param {MultiOriginPalettes} colors Global styles colors grouped by origin e.g. Core, Theme, and User.\n * @return {BlockExample[]} An array of block examples.\n */\nexport function getExamples( colors: MultiOriginPalettes ): BlockExample[] {\n\tconst nonHeadingBlockExamples = getBlockTypes()\n\t\t.filter( ( blockType ) => {\n\t\t\tconst { name, example, supports } = blockType;\n\t\t\treturn (\n\t\t\t\tname !== 'core/heading' &&\n\t\t\t\t!! example &&\n\t\t\t\tsupports?.inserter !== false\n\t\t\t);\n\t\t} )\n\t\t.map( ( blockType ) => ( {\n\t\t\tname: blockType.name,\n\t\t\ttitle: blockType.title,\n\t\t\tcategory: blockType.category,\n\t\t\t/*\n\t\t\t * CSS generated from style attributes will take precedence over global styles CSS,\n\t\t\t * so remove the style attribute from the example to ensure the example\n\t\t\t * demonstrates changes to global styles.\n\t\t\t */\n\t\t\tblocks: getBlockFromExample( blockType.name, {\n\t\t\t\t...blockType.example,\n\t\t\t\tattributes: {\n\t\t\t\t\t...blockType.example.attributes,\n\t\t\t\t\tstyle: undefined,\n\t\t\t\t},\n\t\t\t} ),\n\t\t} ) );\n\tconst isHeadingBlockRegistered = !! getBlockType( 'core/heading' );\n\n\tif ( ! isHeadingBlockRegistered ) {\n\t\treturn nonHeadingBlockExamples;\n\t}\n\n\t// Use our own example for the Heading block so that we can show multiple\n\t// heading levels.\n\tconst headingsExample = {\n\t\tname: 'core/heading',\n\t\ttitle: __( 'Headings' ),\n\t\tcategory: 'text',\n\t\tblocks: [ 1, 2, 3, 4, 5, 6 ].map( ( level ) => {\n\t\t\treturn createBlock( 'core/heading', {\n\t\t\t\tcontent: sprintf(\n\t\t\t\t\t// translators: %d: heading level e.g: \"1\", \"2\", \"3\"\n\t\t\t\t\t__( 'Heading %d' ),\n\t\t\t\t\tlevel\n\t\t\t\t),\n\t\t\t\tlevel,\n\t\t\t} );\n\t\t} ),\n\t};\n\tconst colorExamples = getColorExamples( colors );\n\n\tconst overviewBlockExamples = getOverviewBlockExamples( colors );\n\n\treturn [\n\t\theadingsExample,\n\t\t...colorExamples,\n\t\t...nonHeadingBlockExamples,\n\t\t...overviewBlockExamples,\n\t];\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAgBA,IAAAE,cAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,gBAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AAAsD,IAAAM,WAAA,GAAAN,OAAA;AAtBtD;AACA;AACA;;AASA;AACA;AACA;;AAWA;AACA;AACA;AACA;AACA;AACA;AACA,GACA,SAASO,gBAAgBA,CAAEC,MAA2B,EAAmB;EACxE,IAAK,CAAEA,MAAM,EAAG;IACf,OAAO,EAAE;EACV;EAEA,MAAMC,QAAwB,GAAG,EAAE;EAEnCC,kCAAuB,CAACC,OAAO,CAAIC,KAAK,IAAM;IAC7C,MAAMC,OAAO,GAAGL,MAAM,CAAEI,KAAK,CAACE,IAAI,CAAE,CAACC,IAAI,CACtCC,MAAmB,IAAMA,MAAM,CAACC,IAAI,KAAKL,KAAK,CAACI,MAClD,CAAC;IAED,IAAKH,OAAO,GAAID,KAAK,CAACE,IAAI,CAAE,EAAG;MAC9B,MAAMI,OAAqB,GAAG;QAC7BC,IAAI,EAAEP,KAAK,CAACK,IAAI;QAChBG,KAAK,EAAER,KAAK,CAACQ,KAAK;QAClBC,QAAQ,EAAE;MACX,CAAC;MACD,IAAKT,KAAK,CAACE,IAAI,KAAK,UAAU,EAAG;QAChCI,OAAO,CAACI,OAAO,gBACd,IAAAhB,WAAA,CAAAi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G8B,SAAS,CAAC/B,OAAO;MACpBkC,UAAU,EAAE;QACX,GAAGH,SAAS,CAAC/B,OAAO,CAACkC,UAAU;QAC/BV,KAAK,EAAEW;MACR;IACD,CAAE;EACH,CAAC,CAAG,CAAC;EACN,MAAMQ,wBAAwB,GAAG,CAAC,CAAE,IAAA7B,oBAAY,EAAE,cAAe,CAAC;EAElE,IAAK,CAAE6B,wBAAwB,EAAG;IACjC,OAAON,uBAAuB;EAC/B;;EAEA;EACA;EACA,MAAMO,eAAe,GAAG;IACvB3C,IAAI,EAAE,cAAc;IACpBC,KAAK,EAAE,IAAAU,QAAE,EAAE,UAAW,CAAC;IACvBT,QAAQ,EAAE,MAAM;IAChByB,MAAM,EAAE,CAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAE,CAACc,GAAG,CAAIzB,KAAK,IAAM;MAC9C,OAAO,IAAAD,mBAAW,EAAE,cAAc,EAAE;QACnCZ,OAAO,EAAE,IAAAyC,aAAO;QACf;QACA,IAAAjC,QAAE,EAAE,YAAa,CAAC,EAClBK,KACD,CAAC;QACDA;MACD,CAAE,CAAC;IACJ,CAAE;EACH,CAAC;EACD,MAAM6B,aAAa,GAAGzD,gBAAgB,CAAEC,MAAO,CAAC;EAEhD,MAAMyD,qBAAqB,GAAGtC,wBAAwB,CAAEnB,MAAO,CAAC;EAEhE,OAAO,CACNsD,eAAe,EACf,GAAGE,aAAa,EAChB,GAAGT,uBAAuB,EAC1B,GAAGU,qBAAqB,CACxB;AACF","ignoreList":[]}
@@ -55,10 +55,10 @@ function isObjectEmpty(object) {
55
55
  * @param {HTMLIFrameElement} iframe The target iframe.
56
56
  */
57
57
  const scrollToSection = (anchorId, iframe) => {
58
- if (!iframe || !iframe?.contentDocument) {
58
+ if (!anchorId || !iframe || !iframe?.contentDocument) {
59
59
  return;
60
60
  }
61
- const element = iframe.contentDocument.getElementById(anchorId);
61
+ const element = anchorId === 'top' ? iframe.contentDocument.body : iframe.contentDocument.getElementById(anchorId);
62
62
  if (element) {
63
63
  element.scrollIntoView({
64
64
  behavior: 'smooth'
@@ -76,6 +76,16 @@ const scrollToSection = (anchorId, iframe) => {
76
76
  */
77
77
  const getStyleBookNavigationFromPath = path => {
78
78
  if (path && typeof path === 'string') {
79
+ if (path === '/') {
80
+ return {
81
+ top: true
82
+ };
83
+ }
84
+ if (path.startsWith('/typography')) {
85
+ return {
86
+ block: 'typography'
87
+ };
88
+ }
79
89
  let block = path.includes('/blocks/') ? decodeURIComponent(path.split('/blocks/')[1]) : null;
80
90
  // Default to theme-colors if the path ends with /colors.
81
91
  block = path.endsWith('/colors') ? 'theme-colors' : block;
@@ -272,10 +282,16 @@ const StyleBookBody = ({
272
282
  };
273
283
  const handleLoad = () => setHasIframeLoaded(true);
274
284
  (0, _element.useLayoutEffect)(() => {
275
- if (goTo?.block && hasIframeLoaded && iframeRef?.current) {
276
- scrollToSection(`example-${goTo?.block}`, iframeRef?.current);
285
+ if (hasIframeLoaded && iframeRef?.current) {
286
+ if (goTo?.top) {
287
+ scrollToSection('top', iframeRef?.current);
288
+ return;
289
+ }
290
+ if (goTo?.block) {
291
+ scrollToSection(`example-${goTo?.block}`, iframeRef?.current);
292
+ }
277
293
  }
278
- }, [iframeRef?.current, goTo?.block, scrollToSection, hasIframeLoaded]);
294
+ }, [iframeRef?.current, goTo, scrollToSection, hasIframeLoaded]);
279
295
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_blockEditor.__unstableIframe, {
280
296
  onLoad: handleLoad,
281
297
  ref: iframeRef,
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_i18n","_blockEditor","_editor","_data","_compose","_element","_keycodes","_lockUnlock","_editorCanvasContainer","_constants","_categories","_examples","_jsxRuntime","ExperimentalBlockEditorProvider","useGlobalStyle","GlobalStylesContext","useGlobalStylesOutputWithConfig","unlock","blockEditorPrivateApis","mergeBaseAndUserConfigs","editorPrivateApis","Tabs","componentsPrivateApis","isObjectEmpty","object","Object","keys","length","scrollToSection","anchorId","iframe","contentDocument","element","getElementById","scrollIntoView","behavior","getStyleBookNavigationFromPath","path","block","includes","decodeURIComponent","split","endsWith","useMultiOriginPalettes","colors","gradients","useMultipleOriginColorsAndGradients","shouldDisplayDefaultDuotones","customDuotones","themeDuotones","defaultDuotones","useSettings","palettes","useMemo","result","duotones","push","name","_x","slug","StyleBook","enableResizing","isSelected","onClick","onSelect","showCloseButton","onClose","showTabs","userConfig","resizeObserver","sizes","useResizeObserver","textColor","backgroundColor","examples","getExamples","tabs","getTopLevelStyleBookCategories","filter","category","some","example","examplesForSinglePageUse","overviewCategoryExamples","getExamplesByCategory","otherExamples","find","overviewExample","base","baseConfig","useContext","goTo","mergedConfig","originalSettings","useSelect","select","blockEditorStore","getSettings","globalStyles","settings","styles","isPreviewMode","jsx","default","closeButtonLabel","__","children","jsxs","className","clsx","width","style","color","background","TabList","map","tab","Tab","tabId","title","TabPanel","focusable","StyleBookBody","isFocused","setIsFocused","useState","hasIframeLoaded","setHasIframeLoaded","iframeRef","useRef","buttonModeProps","role","onFocus","onBlur","onKeyDown","event","defaultPrevented","keyCode","ENTER","SPACE","preventDefault","readonly","handleLoad","useLayoutEffect","current","__unstableIframe","onLoad","ref","tabIndex","__unstableEditorStyles","STYLE_BOOK_IFRAME_STYLES","Examples","label","sprintf","memo","categoryDefinition","_category","filteredExamples","Composite","orientation","Example","id","content","blocks","subcategories","subcategory","Group","GroupLabel","Subcategory","disabledExamples","focusMode","renderedBlocks","Array","isArray","disabledProps","disabled","accessibleWhenDisabled","Item","render","Disabled","value","BlockList","renderAppender","_default","exports"],"sources":["@wordpress/edit-site/src/components/style-book/index.js"],"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\t__unstableEditorStyles as EditorStyles,\n\t__unstableIframe as Iframe,\n\t__experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients,\n} from '@wordpress/block-editor';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\nimport { useResizeObserver } from '@wordpress/compose';\nimport {\n\tuseMemo,\n\tuseState,\n\tmemo,\n\tuseContext,\n\tuseRef,\n\tuseLayoutEffect,\n} from '@wordpress/element';\nimport { ENTER, SPACE } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport EditorCanvasContainer from '../editor-canvas-container';\nimport { STYLE_BOOK_IFRAME_STYLES } from './constants';\nimport {\n\tgetExamplesByCategory,\n\tgetTopLevelStyleBookCategories,\n} from './categories';\nimport { getExamples } from './examples';\n\nconst {\n\tExperimentalBlockEditorProvider,\n\tuseGlobalStyle,\n\tGlobalStylesContext,\n\tuseGlobalStylesOutputWithConfig,\n} = unlock( blockEditorPrivateApis );\nconst { mergeBaseAndUserConfigs } = unlock( editorPrivateApis );\n\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 ( ! iframe || ! iframe?.contentDocument ) {\n\t\treturn;\n\t}\n\n\tconst element = 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 extract the block name and\n * build a style book navigation path. The object can be extended to include a category,\n * 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\tlet block = path.includes( '/blocks/' )\n\t\t\t? decodeURIComponent( path.split( '/blocks/' )[ 1 ] )\n\t\t\t: null;\n\t\t// Default to theme-colors if the path ends with /colors.\n\t\tblock = path.endsWith( '/colors' ) ? 'theme-colors' : block;\n\n\t\treturn {\n\t\t\tblock,\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\nfunction StyleBook( {\n\tenableResizing = true,\n\tisSelected,\n\tonClick,\n\tonSelect,\n\tshowCloseButton = true,\n\tonClose,\n\tshowTabs = true,\n\tuserConfig = {},\n\tpath = '',\n} ) {\n\tconst [ resizeObserver, sizes ] = useResizeObserver();\n\tconst [ textColor ] = useGlobalStyle( 'color.text' );\n\tconst [ backgroundColor ] = useGlobalStyle( '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 = [];\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\tconst { base: baseConfig } = useContext( GlobalStylesContext );\n\tconst goTo = getStyleBookNavigationFromPath( path );\n\n\tconst mergedConfig = useMemo( () => {\n\t\tif ( ! isObjectEmpty( userConfig ) && ! isObjectEmpty( baseConfig ) ) {\n\t\t\treturn mergeBaseAndUserConfigs( baseConfig, userConfig );\n\t\t}\n\t\treturn {};\n\t}, [ baseConfig, userConfig ] );\n\n\t// Copied from packages/edit-site/src/components/revisions/index.js\n\t// could we create a shared hook?\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<EditorCanvasContainer\n\t\t\tonClose={ onClose }\n\t\t\tenableResizing={ enableResizing }\n\t\t\tcloseButtonLabel={ showCloseButton ? __( 'Close' ) : null }\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName={ clsx( 'edit-site-style-book', {\n\t\t\t\t\t'is-wide': sizes.width > 600,\n\t\t\t\t\t'is-button': !! onClick,\n\t\t\t\t} ) }\n\t\t\t\tstyle={ {\n\t\t\t\t\tcolor: textColor,\n\t\t\t\t\tbackground: backgroundColor,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ resizeObserver }\n\t\t\t\t{ showTabs ? (\n\t\t\t\t\t<Tabs>\n\t\t\t\t\t\t<div className=\"edit-site-style-book__tablist-container\">\n\t\t\t\t\t\t\t<Tabs.TabList>\n\t\t\t\t\t\t\t\t{ tabs.map( ( tab ) => (\n\t\t\t\t\t\t\t\t\t<Tabs.Tab\n\t\t\t\t\t\t\t\t\t\ttabId={ tab.slug }\n\t\t\t\t\t\t\t\t\t\tkey={ tab.slug }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ tab.title }\n\t\t\t\t\t\t\t\t\t</Tabs.Tab>\n\t\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t\t</Tabs.TabList>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{ tabs.map( ( tab ) => (\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=\"edit-site-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={ examples }\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\tsizes={ sizes }\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</Tabs>\n\t\t\t\t) : (\n\t\t\t\t\t<StyleBookBody\n\t\t\t\t\t\texamples={ examplesForSinglePageUse }\n\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\tonClick={ onClick }\n\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\tsettings={ settings }\n\t\t\t\t\t\tsizes={ sizes }\n\t\t\t\t\t\tgoTo={ goTo }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</EditorCanvasContainer>\n\t);\n}\n\nconst StyleBookBody = ( {\n\tcategory,\n\texamples,\n\tisSelected,\n\tonClick,\n\tonSelect,\n\tsettings,\n\tsizes,\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 ( goTo?.block && hasIframeLoaded && iframeRef?.current ) {\n\t\t\tscrollToSection( `example-${ goTo?.block }`, iframeRef?.current );\n\t\t}\n\t}, [ iframeRef?.current, goTo?.block, scrollToSection, hasIframeLoaded ] );\n\n\treturn (\n\t\t<Iframe\n\t\t\tonLoad={ handleLoad }\n\t\t\tref={ iframeRef }\n\t\t\tclassName={ clsx( 'edit-site-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={ clsx( 'edit-site-style-book__examples', {\n\t\t\t\t\t'is-wide': sizes.width > 600,\n\t\t\t\t} ) }\n\t\t\t\texamples={ examples }\n\t\t\t\tcategory={ category }\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={ category }\n\t\t\t/>\n\t\t</Iframe>\n\t);\n};\n\nconst Examples = memo(\n\t( { className, examples, category, label, isSelected, onSelect } ) => {\n\t\tconst categoryDefinition = category\n\t\t\t? getTopLevelStyleBookCategories().find(\n\t\t\t\t\t( _category ) => _category.slug === category\n\t\t\t )\n\t\t\t: null;\n\n\t\tconst filteredExamples = categoryDefinition\n\t\t\t? getExamplesByCategory( categoryDefinition, examples )\n\t\t\t: { examples };\n\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={ () => onSelect?.( example.name ) }\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=\"edit-site-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=\"edit-site-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={ () => {\n\t\t\t\t\tonSelect?.( example.name );\n\t\t\t\t} }\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 = disabledExamples.includes( id )\n\t\t? {\n\t\t\t\tdisabled: true,\n\t\t\t\taccessibleWhenDisabled: true,\n\t\t }\n\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( 'edit-site-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={ sprintf(\n\t\t\t\t\t\t// translators: %s: Title of a block, e.g. Heading.\n\t\t\t\t\t\t__( 'Open %s styles in Styles panel' ),\n\t\t\t\t\t\ttitle\n\t\t\t\t\t) }\n\t\t\t\t\trender={ <div /> }\n\t\t\t\t\trole=\"button\"\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=\"edit-site-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=\"edit-site-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=\"edit-site-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 StyleBook;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AAKA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AASA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AAQA,IAAAQ,SAAA,GAAAR,OAAA;AAKA,IAAAS,WAAA,GAAAT,OAAA;AACA,IAAAU,sBAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,UAAA,GAAAX,OAAA;AACA,IAAAY,WAAA,GAAAZ,OAAA;AAIA,IAAAa,SAAA,GAAAb,OAAA;AAAyC,IAAAc,WAAA,GAAAd,OAAA;AA9CzC;AACA;AACA;;AAGA;AACA;AACA;;AA6BA;AACA;AACA;;AAUA,MAAM;EACLe,+BAA+B;EAC/BC,cAAc;EACdC,mBAAmB;EACnBC;AACD,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AACpC,MAAM;EAAEC;AAAwB,CAAC,GAAG,IAAAF,kBAAM,EAAEG,mBAAkB,CAAC;AAE/D,MAAM;EAAEC;AAAK,CAAC,GAAG,IAAAJ,kBAAM,EAAEK,uBAAsB,CAAC;AAEhD,SAASC,aAAaA,CAAEC,MAAM,EAAG;EAChC,OAAO,CA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AAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAjF,OAAA,GAEa3C,SAAS","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_i18n","_blockEditor","_editor","_data","_compose","_element","_keycodes","_lockUnlock","_editorCanvasContainer","_constants","_categories","_examples","_jsxRuntime","ExperimentalBlockEditorProvider","useGlobalStyle","GlobalStylesContext","useGlobalStylesOutputWithConfig","unlock","blockEditorPrivateApis","mergeBaseAndUserConfigs","editorPrivateApis","Tabs","componentsPrivateApis","isObjectEmpty","object","Object","keys","length","scrollToSection","anchorId","iframe","contentDocument","element","body","getElementById","scrollIntoView","behavior","getStyleBookNavigationFromPath","path","top","startsWith","block","includes","decodeURIComponent","split","endsWith","useMultiOriginPalettes","colors","gradients","useMultipleOriginColorsAndGradients","shouldDisplayDefaultDuotones","customDuotones","themeDuotones","defaultDuotones","useSettings","palettes","useMemo","result","duotones","push","name","_x","slug","StyleBook","enableResizing","isSelected","onClick","onSelect","showCloseButton","onClose","showTabs","userConfig","resizeObserver","sizes","useResizeObserver","textColor","backgroundColor","examples","getExamples","tabs","getTopLevelStyleBookCategories","filter","category","some","example","examplesForSinglePageUse","overviewCategoryExamples","getExamplesByCategory","otherExamples","find","overviewExample","base","baseConfig","useContext","goTo","mergedConfig","originalSettings","useSelect","select","blockEditorStore","getSettings","globalStyles","settings","styles","isPreviewMode","jsx","default","closeButtonLabel","__","children","jsxs","className","clsx","width","style","color","background","TabList","map","tab","Tab","tabId","title","TabPanel","focusable","StyleBookBody","isFocused","setIsFocused","useState","hasIframeLoaded","setHasIframeLoaded","iframeRef","useRef","buttonModeProps","role","onFocus","onBlur","onKeyDown","event","defaultPrevented","keyCode","ENTER","SPACE","preventDefault","readonly","handleLoad","useLayoutEffect","current","__unstableIframe","onLoad","ref","tabIndex","__unstableEditorStyles","STYLE_BOOK_IFRAME_STYLES","Examples","label","sprintf","memo","categoryDefinition","_category","filteredExamples","Composite","orientation","Example","id","content","blocks","subcategories","subcategory","Group","GroupLabel","Subcategory","disabledExamples","focusMode","renderedBlocks","Array","isArray","disabledProps","disabled","accessibleWhenDisabled","Item","render","Disabled","value","BlockList","renderAppender","_default","exports"],"sources":["@wordpress/edit-site/src/components/style-book/index.js"],"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\t__unstableEditorStyles as EditorStyles,\n\t__unstableIframe as Iframe,\n\t__experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients,\n} from '@wordpress/block-editor';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\nimport { useResizeObserver } from '@wordpress/compose';\nimport {\n\tuseMemo,\n\tuseState,\n\tmemo,\n\tuseContext,\n\tuseRef,\n\tuseLayoutEffect,\n} from '@wordpress/element';\nimport { ENTER, SPACE } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport EditorCanvasContainer from '../editor-canvas-container';\nimport { STYLE_BOOK_IFRAME_STYLES } from './constants';\nimport {\n\tgetExamplesByCategory,\n\tgetTopLevelStyleBookCategories,\n} from './categories';\nimport { getExamples } from './examples';\n\nconst {\n\tExperimentalBlockEditorProvider,\n\tuseGlobalStyle,\n\tGlobalStylesContext,\n\tuseGlobalStylesOutputWithConfig,\n} = unlock( blockEditorPrivateApis );\nconst { mergeBaseAndUserConfigs } = unlock( editorPrivateApis );\n\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 extract the block name and\n * build a style book navigation path. The object can be extended to include a category,\n * 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 ( path === '/' ) {\n\t\t\treturn {\n\t\t\t\ttop: true,\n\t\t\t};\n\t\t}\n\n\t\tif ( path.startsWith( '/typography' ) ) {\n\t\t\treturn {\n\t\t\t\tblock: 'typography',\n\t\t\t};\n\t\t}\n\t\tlet block = path.includes( '/blocks/' )\n\t\t\t? decodeURIComponent( path.split( '/blocks/' )[ 1 ] )\n\t\t\t: null;\n\t\t// Default to theme-colors if the path ends with /colors.\n\t\tblock = path.endsWith( '/colors' ) ? 'theme-colors' : block;\n\n\t\treturn {\n\t\t\tblock,\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\nfunction StyleBook( {\n\tenableResizing = true,\n\tisSelected,\n\tonClick,\n\tonSelect,\n\tshowCloseButton = true,\n\tonClose,\n\tshowTabs = true,\n\tuserConfig = {},\n\tpath = '',\n} ) {\n\tconst [ resizeObserver, sizes ] = useResizeObserver();\n\tconst [ textColor ] = useGlobalStyle( 'color.text' );\n\tconst [ backgroundColor ] = useGlobalStyle( '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 = [];\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\tconst { base: baseConfig } = useContext( GlobalStylesContext );\n\tconst goTo = getStyleBookNavigationFromPath( path );\n\n\tconst mergedConfig = useMemo( () => {\n\t\tif ( ! isObjectEmpty( userConfig ) && ! isObjectEmpty( baseConfig ) ) {\n\t\t\treturn mergeBaseAndUserConfigs( baseConfig, userConfig );\n\t\t}\n\t\treturn {};\n\t}, [ baseConfig, userConfig ] );\n\n\t// Copied from packages/edit-site/src/components/revisions/index.js\n\t// could we create a shared hook?\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<EditorCanvasContainer\n\t\t\tonClose={ onClose }\n\t\t\tenableResizing={ enableResizing }\n\t\t\tcloseButtonLabel={ showCloseButton ? __( 'Close' ) : null }\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName={ clsx( 'edit-site-style-book', {\n\t\t\t\t\t'is-wide': sizes.width > 600,\n\t\t\t\t\t'is-button': !! onClick,\n\t\t\t\t} ) }\n\t\t\t\tstyle={ {\n\t\t\t\t\tcolor: textColor,\n\t\t\t\t\tbackground: backgroundColor,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ resizeObserver }\n\t\t\t\t{ showTabs ? (\n\t\t\t\t\t<Tabs>\n\t\t\t\t\t\t<div className=\"edit-site-style-book__tablist-container\">\n\t\t\t\t\t\t\t<Tabs.TabList>\n\t\t\t\t\t\t\t\t{ tabs.map( ( tab ) => (\n\t\t\t\t\t\t\t\t\t<Tabs.Tab\n\t\t\t\t\t\t\t\t\t\ttabId={ tab.slug }\n\t\t\t\t\t\t\t\t\t\tkey={ tab.slug }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ tab.title }\n\t\t\t\t\t\t\t\t\t</Tabs.Tab>\n\t\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t\t</Tabs.TabList>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{ tabs.map( ( tab ) => (\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=\"edit-site-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={ examples }\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\tsizes={ sizes }\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</Tabs>\n\t\t\t\t) : (\n\t\t\t\t\t<StyleBookBody\n\t\t\t\t\t\texamples={ examplesForSinglePageUse }\n\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\tonClick={ onClick }\n\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\tsettings={ settings }\n\t\t\t\t\t\tsizes={ sizes }\n\t\t\t\t\t\tgoTo={ goTo }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</EditorCanvasContainer>\n\t);\n}\n\nconst StyleBookBody = ( {\n\tcategory,\n\texamples,\n\tisSelected,\n\tonClick,\n\tonSelect,\n\tsettings,\n\tsizes,\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\treturn;\n\t\t\t}\n\t\t\tif ( goTo?.block ) {\n\t\t\t\tscrollToSection(\n\t\t\t\t\t`example-${ goTo?.block }`,\n\t\t\t\t\tiframeRef?.current\n\t\t\t\t);\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( 'edit-site-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={ clsx( 'edit-site-style-book__examples', {\n\t\t\t\t\t'is-wide': sizes.width > 600,\n\t\t\t\t} ) }\n\t\t\t\texamples={ examples }\n\t\t\t\tcategory={ category }\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={ category }\n\t\t\t/>\n\t\t</Iframe>\n\t);\n};\n\nconst Examples = memo(\n\t( { className, examples, category, label, isSelected, onSelect } ) => {\n\t\tconst categoryDefinition = category\n\t\t\t? getTopLevelStyleBookCategories().find(\n\t\t\t\t\t( _category ) => _category.slug === category\n\t\t\t )\n\t\t\t: null;\n\n\t\tconst filteredExamples = categoryDefinition\n\t\t\t? getExamplesByCategory( categoryDefinition, examples )\n\t\t\t: { examples };\n\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={ () => onSelect?.( example.name ) }\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=\"edit-site-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=\"edit-site-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={ () => {\n\t\t\t\t\tonSelect?.( example.name );\n\t\t\t\t} }\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 = disabledExamples.includes( id )\n\t\t? {\n\t\t\t\tdisabled: true,\n\t\t\t\taccessibleWhenDisabled: true,\n\t\t }\n\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( 'edit-site-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={ sprintf(\n\t\t\t\t\t\t// translators: %s: Title of a block, e.g. Heading.\n\t\t\t\t\t\t__( 'Open %s styles in Styles panel' ),\n\t\t\t\t\t\ttitle\n\t\t\t\t\t) }\n\t\t\t\t\trender={ <div /> }\n\t\t\t\t\trole=\"button\"\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=\"edit-site-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=\"edit-site-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=\"edit-site-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 StyleBook;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AAKA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AASA,IAAAI,OAAA,GAAAJ,OAAA;AACA,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esContent":["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: string;\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 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"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/edit-site/src/components/style-book/types.ts"],"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: string;\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 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"],"mappings":"","ignoreList":[]}
@@ -55,17 +55,8 @@ const getGlobalStylesOpenStylesCommands = () => function useGlobalStylesOpenStyl
55
55
  close
56
56
  }) => {
57
57
  close();
58
- if (!params.postId) {
59
- history.push({
60
- path: '/wp_global_styles',
61
- canvas: 'edit'
62
- });
63
- }
64
- if (params.postId && canvas !== 'edit') {
65
- history.push({
66
- ...params,
67
- canvas: 'edit'
68
- }, undefined, {
58
+ if (canvas !== 'edit') {
59
+ history.navigate('/styles?canvas=edit', {
69
60
  transition: 'canvas-mode-edit-transition'
70
61
  });
71
62
  }
@@ -73,7 +64,7 @@ const getGlobalStylesOpenStylesCommands = () => function useGlobalStylesOpenStyl
73
64
  },
74
65
  icon: _icons.styles
75
66
  }];
76
- }, [history, openGeneralSidebar, params, canvas, isBlockBasedTheme]);
67
+ }, [history, openGeneralSidebar, canvas, isBlockBasedTheme]);
77
68
  return {
78
69
  isLoading: false,
79
70
  commands
@@ -107,17 +98,8 @@ const getGlobalStylesToggleWelcomeGuideCommands = () => function useGlobalStyles
107
98
  close
108
99
  }) => {
109
100
  close();
110
- if (!params.postId) {
111
- history.push({
112
- path: '/wp_global_styles',
113
- canvas: 'edit'
114
- });
115
- }
116
- if (params.postId && canvas !== 'edit') {
117
- history.push({
118
- ...params,
119
- canvas: 'edit'
120
- }, undefined, {
101
+ if (canvas !== 'edit') {
102
+ history.navigate('/styles?canvas=edit', {
121
103
  transition: 'canvas-mode-edit-transition'
122
104
  });
123
105
  }
@@ -131,7 +113,7 @@ const getGlobalStylesToggleWelcomeGuideCommands = () => function useGlobalStyles
131
113
  },
132
114
  icon: _icons.help
133
115
  }];
134
- }, [history, openGeneralSidebar, canvas, isBlockBasedTheme, set, params]);
116
+ }, [history, openGeneralSidebar, canvas, isBlockBasedTheme, set]);
135
117
  return {
136
118
  isLoading: false,
137
119
  commands
@@ -197,17 +179,8 @@ const getGlobalStylesOpenCssCommands = () => function useGlobalStylesOpenCssComm
197
179
  close
198
180
  }) => {
199
181
  close();
200
- if (!params.postId) {
201
- history.push({
202
- path: '/wp_global_styles',
203
- canvas: 'edit'
204
- });
205
- }
206
- if (params.postId && canvas !== 'edit') {
207
- history.push({
208
- ...params,
209
- canvas: 'edit'
210
- }, undefined, {
182
+ if (canvas !== 'edit') {
183
+ history.navigate('/styles?canvas=edit', {
211
184
  transition: 'canvas-mode-edit-transition'
212
185
  });
213
186
  }
@@ -215,7 +188,7 @@ const getGlobalStylesOpenCssCommands = () => function useGlobalStylesOpenCssComm
215
188
  setEditorCanvasContainerView('global-styles-css');
216
189
  }
217
190
  }];
218
- }, [history, openGeneralSidebar, setEditorCanvasContainerView, canEditCSS, canvas, params]);
191
+ }, [history, openGeneralSidebar, setEditorCanvasContainerView, canEditCSS, canvas]);
219
192
  return {
220
193
  isLoading: false,
221
194
  commands
@@ -254,17 +227,8 @@ const getGlobalStylesOpenRevisionsCommands = () => function useGlobalStylesOpenR
254
227
  close
255
228
  }) => {
256
229
  close();
257
- if (!params.postId) {
258
- history.push({
259
- path: '/wp_global_styles',
260
- canvas: 'edit'
261
- });
262
- }
263
- if (params.postId && canvas !== 'edit') {
264
- history.push({
265
- ...params,
266
- canvas: 'edit'
267
- }, undefined, {
230
+ if (canvas !== 'edit') {
231
+ history.navigate('/styles?canvas=edit', {
268
232
  transition: 'canvas-mode-edit-transition'
269
233
  });
270
234
  }
@@ -272,7 +236,7 @@ const getGlobalStylesOpenRevisionsCommands = () => function useGlobalStylesOpenR
272
236
  setEditorCanvasContainerView('global-styles-revisions');
273
237
  }
274
238
  }];
275
- }, [hasRevisions, history, openGeneralSidebar, setEditorCanvasContainerView, canvas, params]);
239
+ }, [hasRevisions, history, openGeneralSidebar, setEditorCanvasContainerView, canvas]);
276
240
  return {
277
241
  isLoading: false,
278
242
  commands