@wordpress/edit-site 6.13.1-next.cd6172eb0.0 → 6.14.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 (441) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/add-new-pattern/index.js +1 -0
  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/add-custom-template-modal-content.js +1 -0
  7. package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  8. package/build/components/add-new-template/index.js +1 -0
  9. package/build/components/add-new-template/index.js.map +1 -1
  10. package/build/components/add-new-template/utils.js +1 -0
  11. package/build/components/add-new-template/utils.js.map +1 -1
  12. package/build/components/editor-canvas-container/index.js +1 -0
  13. package/build/components/editor-canvas-container/index.js.map +1 -1
  14. package/build/components/global-styles/font-families.js +1 -0
  15. package/build/components/global-styles/font-families.js.map +1 -1
  16. package/build/components/global-styles/font-library-modal/context.js +1 -0
  17. package/build/components/global-styles/font-library-modal/context.js.map +1 -1
  18. package/build/components/global-styles/font-library-modal/font-collection.js +1 -0
  19. package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  20. package/build/components/global-styles/font-library-modal/font-demo.js +1 -0
  21. package/build/components/global-styles/font-library-modal/font-demo.js.map +1 -1
  22. package/build/components/global-styles/font-library-modal/index.js +1 -0
  23. package/build/components/global-styles/font-library-modal/index.js.map +1 -1
  24. package/build/components/global-styles/font-library-modal/installed-fonts.js +1 -0
  25. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  26. package/build/components/global-styles/font-library-modal/library-font-details.js +1 -0
  27. package/build/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
  28. package/build/components/global-styles/font-library-modal/upload-fonts.js +1 -0
  29. package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  30. package/build/components/global-styles/font-library-modal/utils/filter-fonts.js +1 -0
  31. package/build/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -1
  32. package/build/components/global-styles/font-library-modal/utils/fonts-outline.js +1 -0
  33. package/build/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -1
  34. package/build/components/global-styles/font-library-modal/utils/index.js +1 -0
  35. package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  36. package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js +1 -0
  37. package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +1 -1
  38. package/build/components/global-styles/font-library-modal/utils/preview-styles.js +1 -0
  39. package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
  40. package/build/components/global-styles/font-library-modal/utils/toggleFont.js +1 -0
  41. package/build/components/global-styles/font-library-modal/utils/toggleFont.js.map +1 -1
  42. package/build/components/global-styles/font-sizes/font-size.js +1 -0
  43. package/build/components/global-styles/font-sizes/font-size.js.map +1 -1
  44. package/build/components/global-styles/font-sizes/font-sizes.js +1 -0
  45. package/build/components/global-styles/font-sizes/font-sizes.js.map +1 -1
  46. package/build/components/global-styles/highlighted-colors.js +1 -0
  47. package/build/components/global-styles/highlighted-colors.js.map +1 -1
  48. package/build/components/global-styles/hooks.js +1 -0
  49. package/build/components/global-styles/hooks.js.map +1 -1
  50. package/build/components/global-styles/palette.js +1 -0
  51. package/build/components/global-styles/palette.js.map +1 -1
  52. package/build/components/global-styles/preset-colors.js +1 -0
  53. package/build/components/global-styles/preset-colors.js.map +1 -1
  54. package/build/components/global-styles/preview-colors.js +2 -2
  55. package/build/components/global-styles/preview-colors.js.map +1 -1
  56. package/build/components/global-styles/preview-styles.js +3 -2
  57. package/build/components/global-styles/preview-styles.js.map +1 -1
  58. package/build/components/global-styles/preview-typography.js +2 -2
  59. package/build/components/global-styles/preview-typography.js.map +1 -1
  60. package/build/components/global-styles/{preview-iframe.js → preview-wrapper.js} +11 -29
  61. package/build/components/global-styles/preview-wrapper.js.map +1 -0
  62. package/build/components/global-styles/screen-block-list.js +1 -0
  63. package/build/components/global-styles/screen-block-list.js.map +1 -1
  64. package/build/components/global-styles/screen-revisions/revisions-buttons.js +1 -0
  65. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  66. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +1 -0
  67. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  68. package/build/components/global-styles/shadow-utils.js +1 -0
  69. package/build/components/global-styles/shadow-utils.js.map +1 -1
  70. package/build/components/global-styles/shadows-edit-panel.js +15 -21
  71. package/build/components/global-styles/shadows-edit-panel.js.map +1 -1
  72. package/build/components/global-styles/shadows-panel.js +1 -0
  73. package/build/components/global-styles/shadows-panel.js.map +1 -1
  74. package/build/components/global-styles/style-variations-container.js +1 -0
  75. package/build/components/global-styles/style-variations-container.js.map +1 -1
  76. package/build/components/global-styles/typeset.js +1 -0
  77. package/build/components/global-styles/typeset.js.map +1 -1
  78. package/build/components/global-styles/typography-example.js +8 -1
  79. package/build/components/global-styles/typography-example.js.map +1 -1
  80. package/build/components/global-styles/ui.js +1 -0
  81. package/build/components/global-styles/ui.js.map +1 -1
  82. package/build/components/global-styles/utils.js +1 -0
  83. package/build/components/global-styles/utils.js.map +1 -1
  84. package/build/components/global-styles/variations/variations-color.js +1 -0
  85. package/build/components/global-styles/variations/variations-color.js.map +1 -1
  86. package/build/components/global-styles/variations/variations-panel.js +1 -0
  87. package/build/components/global-styles/variations/variations-panel.js.map +1 -1
  88. package/build/components/global-styles/variations/variations-typography.js +1 -0
  89. package/build/components/global-styles/variations/variations-typography.js.map +1 -1
  90. package/build/components/global-styles-renderer/index.js +1 -0
  91. package/build/components/global-styles-renderer/index.js.map +1 -1
  92. package/build/components/layout/index.js +14 -7
  93. package/build/components/layout/index.js.map +1 -1
  94. package/build/components/maybe-editor/index.js +65 -0
  95. package/build/components/maybe-editor/index.js.map +1 -0
  96. package/build/components/media/index.js +1 -0
  97. package/build/components/media/index.js.map +1 -1
  98. package/build/components/page-patterns/fields.js +2 -47
  99. package/build/components/page-patterns/fields.js.map +1 -1
  100. package/build/components/page-patterns/header.js +1 -0
  101. package/build/components/page-patterns/header.js.map +1 -1
  102. package/build/components/page-patterns/index.js +18 -14
  103. package/build/components/page-patterns/index.js.map +1 -1
  104. package/build/components/page-patterns/search-items.js +1 -0
  105. package/build/components/page-patterns/search-items.js.map +1 -1
  106. package/build/components/page-patterns/use-pattern-settings.js +1 -0
  107. package/build/components/page-patterns/use-pattern-settings.js.map +1 -1
  108. package/build/components/page-patterns/use-patterns.js +1 -0
  109. package/build/components/page-patterns/use-patterns.js.map +1 -1
  110. package/build/components/page-templates/fields.js +2 -21
  111. package/build/components/page-templates/fields.js.map +1 -1
  112. package/build/components/page-templates/index.js +38 -41
  113. package/build/components/page-templates/index.js.map +1 -1
  114. package/build/components/post-edit/index.js +16 -8
  115. package/build/components/post-edit/index.js.map +1 -1
  116. package/build/components/post-list/index.js +30 -19
  117. package/build/components/post-list/index.js.map +1 -1
  118. package/build/components/posts-app-routes/index.js +1 -0
  119. package/build/components/posts-app-routes/index.js.map +1 -1
  120. package/build/components/resizable-frame/index.js +9 -1
  121. package/build/components/resizable-frame/index.js.map +1 -1
  122. package/build/components/save-button/index.js +1 -0
  123. package/build/components/save-button/index.js.map +1 -1
  124. package/build/components/save-hub/index.js +1 -0
  125. package/build/components/save-hub/index.js.map +1 -1
  126. package/build/components/save-keyboard-shortcut/index.js +1 -0
  127. package/build/components/save-keyboard-shortcut/index.js.map +1 -1
  128. package/build/components/save-panel/index.js +1 -0
  129. package/build/components/save-panel/index.js.map +1 -1
  130. package/build/components/sidebar/index.js +1 -0
  131. package/build/components/sidebar/index.js.map +1 -1
  132. package/build/components/sidebar-dataviews/custom-dataviews-list.js +1 -0
  133. package/build/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
  134. package/build/components/sidebar-dataviews/dataview-item.js +1 -0
  135. package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
  136. package/build/components/sidebar-dataviews/default-views.js +7 -24
  137. package/build/components/sidebar-dataviews/default-views.js.map +1 -1
  138. package/build/components/sidebar-dataviews/index.js +2 -0
  139. package/build/components/sidebar-dataviews/index.js.map +1 -1
  140. package/build/components/sidebar-global-styles-wrapper/index.js +1 -0
  141. package/build/components/sidebar-global-styles-wrapper/index.js.map +1 -1
  142. package/build/components/sidebar-navigation-screen-global-styles/content.js +12 -38
  143. package/build/components/sidebar-navigation-screen-global-styles/content.js.map +1 -1
  144. package/build/components/sidebar-navigation-screen-main/index.js +37 -23
  145. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  146. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +1 -0
  147. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  148. package/build/components/sidebar-navigation-screen-patterns/index.js +1 -4
  149. package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  150. package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +1 -0
  151. package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
  152. package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +1 -0
  153. package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
  154. package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +1 -0
  155. package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
  156. package/build/components/sidebar-navigation-screen-templates-browse/content.js +2 -0
  157. package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  158. package/build/components/site-editor-routes/home.js +4 -2
  159. package/build/components/site-editor-routes/home.js.map +1 -1
  160. package/build/components/site-editor-routes/index.js +3 -1
  161. package/build/components/site-editor-routes/index.js.map +1 -1
  162. package/build/components/site-editor-routes/stylebook.js +33 -0
  163. package/build/components/site-editor-routes/stylebook.js.map +1 -0
  164. package/build/components/site-editor-routes/template-item.js +3 -3
  165. package/build/components/site-editor-routes/template-item.js.map +1 -1
  166. package/build/components/site-editor-routes/template-part-item.js +3 -3
  167. package/build/components/site-editor-routes/template-part-item.js.map +1 -1
  168. package/build/components/style-book/categories.js +1 -0
  169. package/build/components/style-book/categories.js.map +1 -1
  170. package/build/components/style-book/color-examples.js +9 -3
  171. package/build/components/style-book/color-examples.js.map +1 -1
  172. package/build/components/style-book/constants.js +0 -1
  173. package/build/components/style-book/constants.js.map +1 -1
  174. package/build/components/style-book/duotone-examples.js +1 -0
  175. package/build/components/style-book/duotone-examples.js.map +1 -1
  176. package/build/components/style-book/examples.js +48 -30
  177. package/build/components/style-book/examples.js.map +1 -1
  178. package/build/components/style-book/index.js +103 -24
  179. package/build/components/style-book/index.js.map +1 -1
  180. package/build/components/style-book/types.js.map +1 -1
  181. package/build/index.js +1 -0
  182. package/build/index.js.map +1 -1
  183. package/build/posts.js +1 -0
  184. package/build/posts.js.map +1 -1
  185. package/build/store/reducer.js +1 -0
  186. package/build/store/reducer.js.map +1 -1
  187. package/build/utils/get-filtered-template-parts.js +1 -0
  188. package/build/utils/get-filtered-template-parts.js.map +1 -1
  189. package/build/utils/set-nested-value.js +1 -0
  190. package/build/utils/set-nested-value.js.map +1 -1
  191. package/build-module/components/add-new-pattern/index.js +1 -0
  192. package/build-module/components/add-new-pattern/index.js.map +1 -1
  193. package/build-module/components/add-new-post/index.js +1 -1
  194. package/build-module/components/add-new-post/index.js.map +1 -1
  195. package/build-module/components/add-new-template/add-custom-template-modal-content.js +1 -0
  196. package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  197. package/build-module/components/add-new-template/index.js +1 -0
  198. package/build-module/components/add-new-template/index.js.map +1 -1
  199. package/build-module/components/add-new-template/utils.js +1 -0
  200. package/build-module/components/add-new-template/utils.js.map +1 -1
  201. package/build-module/components/editor-canvas-container/index.js +1 -0
  202. package/build-module/components/editor-canvas-container/index.js.map +1 -1
  203. package/build-module/components/global-styles/font-families.js +1 -0
  204. package/build-module/components/global-styles/font-families.js.map +1 -1
  205. package/build-module/components/global-styles/font-library-modal/context.js +1 -0
  206. package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
  207. package/build-module/components/global-styles/font-library-modal/font-collection.js +1 -0
  208. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  209. package/build-module/components/global-styles/font-library-modal/font-demo.js +1 -0
  210. package/build-module/components/global-styles/font-library-modal/font-demo.js.map +1 -1
  211. package/build-module/components/global-styles/font-library-modal/index.js +1 -0
  212. package/build-module/components/global-styles/font-library-modal/index.js.map +1 -1
  213. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +1 -0
  214. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  215. package/build-module/components/global-styles/font-library-modal/library-font-details.js +1 -0
  216. package/build-module/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
  217. package/build-module/components/global-styles/font-library-modal/upload-fonts.js +1 -0
  218. package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  219. package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js +1 -0
  220. package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -1
  221. package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js +1 -0
  222. package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -1
  223. package/build-module/components/global-styles/font-library-modal/utils/index.js +1 -0
  224. package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  225. package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js +1 -0
  226. package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +1 -1
  227. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js +1 -0
  228. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
  229. package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js +1 -0
  230. package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js.map +1 -1
  231. package/build-module/components/global-styles/font-sizes/font-size.js +1 -0
  232. package/build-module/components/global-styles/font-sizes/font-size.js.map +1 -1
  233. package/build-module/components/global-styles/font-sizes/font-sizes.js +1 -0
  234. package/build-module/components/global-styles/font-sizes/font-sizes.js.map +1 -1
  235. package/build-module/components/global-styles/highlighted-colors.js +1 -0
  236. package/build-module/components/global-styles/highlighted-colors.js.map +1 -1
  237. package/build-module/components/global-styles/hooks.js +1 -0
  238. package/build-module/components/global-styles/hooks.js.map +1 -1
  239. package/build-module/components/global-styles/palette.js +1 -0
  240. package/build-module/components/global-styles/palette.js.map +1 -1
  241. package/build-module/components/global-styles/preset-colors.js +1 -0
  242. package/build-module/components/global-styles/preset-colors.js.map +1 -1
  243. package/build-module/components/global-styles/preview-colors.js +2 -2
  244. package/build-module/components/global-styles/preview-colors.js.map +1 -1
  245. package/build-module/components/global-styles/preview-styles.js +3 -2
  246. package/build-module/components/global-styles/preview-styles.js.map +1 -1
  247. package/build-module/components/global-styles/preview-typography.js +2 -2
  248. package/build-module/components/global-styles/preview-typography.js.map +1 -1
  249. package/build-module/components/global-styles/{preview-iframe.js → preview-wrapper.js} +13 -31
  250. package/build-module/components/global-styles/preview-wrapper.js.map +1 -0
  251. package/build-module/components/global-styles/screen-block-list.js +1 -0
  252. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  253. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +1 -0
  254. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  255. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +1 -0
  256. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  257. package/build-module/components/global-styles/shadow-utils.js +1 -0
  258. package/build-module/components/global-styles/shadow-utils.js.map +1 -1
  259. package/build-module/components/global-styles/shadows-edit-panel.js +16 -22
  260. package/build-module/components/global-styles/shadows-edit-panel.js.map +1 -1
  261. package/build-module/components/global-styles/shadows-panel.js +1 -0
  262. package/build-module/components/global-styles/shadows-panel.js.map +1 -1
  263. package/build-module/components/global-styles/style-variations-container.js +1 -0
  264. package/build-module/components/global-styles/style-variations-container.js.map +1 -1
  265. package/build-module/components/global-styles/typeset.js +1 -0
  266. package/build-module/components/global-styles/typeset.js.map +1 -1
  267. package/build-module/components/global-styles/typography-example.js +8 -1
  268. package/build-module/components/global-styles/typography-example.js.map +1 -1
  269. package/build-module/components/global-styles/ui.js +1 -0
  270. package/build-module/components/global-styles/ui.js.map +1 -1
  271. package/build-module/components/global-styles/utils.js +1 -0
  272. package/build-module/components/global-styles/utils.js.map +1 -1
  273. package/build-module/components/global-styles/variations/variations-color.js +1 -0
  274. package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
  275. package/build-module/components/global-styles/variations/variations-panel.js +1 -0
  276. package/build-module/components/global-styles/variations/variations-panel.js.map +1 -1
  277. package/build-module/components/global-styles/variations/variations-typography.js +1 -0
  278. package/build-module/components/global-styles/variations/variations-typography.js.map +1 -1
  279. package/build-module/components/global-styles-renderer/index.js +1 -0
  280. package/build-module/components/global-styles-renderer/index.js.map +1 -1
  281. package/build-module/components/layout/index.js +14 -7
  282. package/build-module/components/layout/index.js.map +1 -1
  283. package/build-module/components/maybe-editor/index.js +59 -0
  284. package/build-module/components/maybe-editor/index.js.map +1 -0
  285. package/build-module/components/media/index.js +1 -0
  286. package/build-module/components/media/index.js.map +1 -1
  287. package/build-module/components/page-patterns/fields.js +3 -48
  288. package/build-module/components/page-patterns/fields.js.map +1 -1
  289. package/build-module/components/page-patterns/header.js +1 -0
  290. package/build-module/components/page-patterns/header.js.map +1 -1
  291. package/build-module/components/page-patterns/index.js +16 -12
  292. package/build-module/components/page-patterns/index.js.map +1 -1
  293. package/build-module/components/page-patterns/search-items.js +1 -0
  294. package/build-module/components/page-patterns/search-items.js.map +1 -1
  295. package/build-module/components/page-patterns/use-pattern-settings.js +1 -0
  296. package/build-module/components/page-patterns/use-pattern-settings.js.map +1 -1
  297. package/build-module/components/page-patterns/use-patterns.js +1 -0
  298. package/build-module/components/page-patterns/use-patterns.js.map +1 -1
  299. package/build-module/components/page-templates/fields.js +1 -20
  300. package/build-module/components/page-templates/fields.js.map +1 -1
  301. package/build-module/components/page-templates/index.js +37 -40
  302. package/build-module/components/page-templates/index.js.map +1 -1
  303. package/build-module/components/post-edit/index.js +16 -8
  304. package/build-module/components/post-edit/index.js.map +1 -1
  305. package/build-module/components/post-list/index.js +31 -20
  306. package/build-module/components/post-list/index.js.map +1 -1
  307. package/build-module/components/posts-app-routes/index.js +1 -0
  308. package/build-module/components/posts-app-routes/index.js.map +1 -1
  309. package/build-module/components/resizable-frame/index.js +9 -1
  310. package/build-module/components/resizable-frame/index.js.map +1 -1
  311. package/build-module/components/save-button/index.js +1 -0
  312. package/build-module/components/save-button/index.js.map +1 -1
  313. package/build-module/components/save-hub/index.js +1 -0
  314. package/build-module/components/save-hub/index.js.map +1 -1
  315. package/build-module/components/save-keyboard-shortcut/index.js +1 -0
  316. package/build-module/components/save-keyboard-shortcut/index.js.map +1 -1
  317. package/build-module/components/save-panel/index.js +1 -0
  318. package/build-module/components/save-panel/index.js.map +1 -1
  319. package/build-module/components/sidebar/index.js +1 -0
  320. package/build-module/components/sidebar/index.js.map +1 -1
  321. package/build-module/components/sidebar-dataviews/custom-dataviews-list.js +1 -0
  322. package/build-module/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
  323. package/build-module/components/sidebar-dataviews/dataview-item.js +1 -0
  324. package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
  325. package/build-module/components/sidebar-dataviews/default-views.js +7 -24
  326. package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
  327. package/build-module/components/sidebar-dataviews/index.js +2 -0
  328. package/build-module/components/sidebar-dataviews/index.js.map +1 -1
  329. package/build-module/components/sidebar-global-styles-wrapper/index.js +1 -0
  330. package/build-module/components/sidebar-global-styles-wrapper/index.js.map +1 -1
  331. package/build-module/components/sidebar-navigation-screen-global-styles/content.js +12 -38
  332. package/build-module/components/sidebar-navigation-screen-global-styles/content.js.map +1 -1
  333. package/build-module/components/sidebar-navigation-screen-main/index.js +39 -25
  334. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  335. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +1 -0
  336. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  337. package/build-module/components/sidebar-navigation-screen-patterns/index.js +1 -4
  338. package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  339. package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +1 -0
  340. package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
  341. package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +1 -0
  342. package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
  343. package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +1 -0
  344. package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
  345. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +2 -0
  346. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  347. package/build-module/components/site-editor-routes/home.js +4 -2
  348. package/build-module/components/site-editor-routes/home.js.map +1 -1
  349. package/build-module/components/site-editor-routes/index.js +3 -1
  350. package/build-module/components/site-editor-routes/index.js.map +1 -1
  351. package/build-module/components/site-editor-routes/stylebook.js +25 -0
  352. package/build-module/components/site-editor-routes/stylebook.js.map +1 -0
  353. package/build-module/components/site-editor-routes/template-item.js +3 -3
  354. package/build-module/components/site-editor-routes/template-item.js.map +1 -1
  355. package/build-module/components/site-editor-routes/template-part-item.js +3 -3
  356. package/build-module/components/site-editor-routes/template-part-item.js.map +1 -1
  357. package/build-module/components/style-book/categories.js +1 -0
  358. package/build-module/components/style-book/categories.js.map +1 -1
  359. package/build-module/components/style-book/color-examples.js +9 -3
  360. package/build-module/components/style-book/color-examples.js.map +1 -1
  361. package/build-module/components/style-book/constants.js +0 -1
  362. package/build-module/components/style-book/constants.js.map +1 -1
  363. package/build-module/components/style-book/duotone-examples.js +1 -0
  364. package/build-module/components/style-book/duotone-examples.js.map +1 -1
  365. package/build-module/components/style-book/examples.js +48 -30
  366. package/build-module/components/style-book/examples.js.map +1 -1
  367. package/build-module/components/style-book/index.js +102 -26
  368. package/build-module/components/style-book/index.js.map +1 -1
  369. package/build-module/components/style-book/types.js.map +1 -1
  370. package/build-module/index.js +1 -0
  371. package/build-module/index.js.map +1 -1
  372. package/build-module/posts.js +1 -0
  373. package/build-module/posts.js.map +1 -1
  374. package/build-module/store/reducer.js +1 -0
  375. package/build-module/store/reducer.js.map +1 -1
  376. package/build-module/utils/get-filtered-template-parts.js +1 -0
  377. package/build-module/utils/get-filtered-template-parts.js.map +1 -1
  378. package/build-module/utils/set-nested-value.js +1 -0
  379. package/build-module/utils/set-nested-value.js.map +1 -1
  380. package/build-style/posts-rtl.css +92 -117
  381. package/build-style/posts.css +92 -117
  382. package/build-style/style-rtl.css +205 -195
  383. package/build-style/style.css +205 -195
  384. package/package.json +40 -40
  385. package/src/components/add-new-post/index.js +1 -1
  386. package/src/components/global-styles/preview-colors.js +3 -3
  387. package/src/components/global-styles/preview-styles.js +3 -3
  388. package/src/components/global-styles/preview-typography.js +3 -3
  389. package/src/components/global-styles/{preview-iframe.js → preview-wrapper.js} +9 -35
  390. package/src/components/global-styles/shadows-edit-panel.js +20 -21
  391. package/src/components/global-styles/style.scss +32 -18
  392. package/src/components/global-styles/typography-example.js +12 -1
  393. package/src/components/layout/index.js +8 -6
  394. package/src/components/maybe-editor/index.js +58 -0
  395. package/src/components/page-patterns/fields.js +2 -59
  396. package/src/components/page-patterns/index.js +23 -11
  397. package/src/components/page-patterns/style.scss +0 -28
  398. package/src/components/page-templates/fields.js +1 -18
  399. package/src/components/page-templates/index.js +38 -55
  400. package/src/components/post-edit/index.js +22 -18
  401. package/src/components/post-list/index.js +49 -43
  402. package/src/components/post-list/style.scss +0 -36
  403. package/src/components/resizable-frame/index.js +10 -1
  404. package/src/components/sidebar-dataviews/default-views.js +7 -24
  405. package/src/components/sidebar-dataviews/index.js +1 -1
  406. package/src/components/sidebar-dataviews/style.scss +5 -0
  407. package/src/components/sidebar-navigation-screen/style.scss +0 -5
  408. package/src/components/sidebar-navigation-screen-global-styles/content.js +7 -35
  409. package/src/components/sidebar-navigation-screen-main/index.js +66 -37
  410. package/src/components/sidebar-navigation-screen-main/style.scss +4 -0
  411. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +1 -1
  412. package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +5 -0
  413. package/src/components/sidebar-navigation-screen-patterns/index.js +0 -7
  414. package/src/components/sidebar-navigation-screen-patterns/style.scss +2 -0
  415. package/src/components/sidebar-navigation-screen-templates-browse/content.js +1 -1
  416. package/src/components/sidebar-navigation-screen-templates-browse/style.scss +4 -0
  417. package/src/components/site-editor-routes/home.js +2 -2
  418. package/src/components/site-editor-routes/index.js +2 -0
  419. package/src/components/site-editor-routes/stylebook.js +28 -0
  420. package/src/components/site-editor-routes/template-item.js +3 -3
  421. package/src/components/site-editor-routes/template-part-item.js +3 -3
  422. package/src/components/style-book/color-examples.tsx +21 -3
  423. package/src/components/style-book/constants.ts +0 -1
  424. package/src/components/style-book/examples.tsx +55 -31
  425. package/src/components/style-book/index.js +145 -38
  426. package/src/components/style-book/style.scss +4 -0
  427. package/src/components/style-book/types.ts +1 -1
  428. package/src/style.scss +4 -1
  429. package/build/components/error-boundary/index.js +0 -47
  430. package/build/components/error-boundary/index.js.map +0 -1
  431. package/build/components/error-boundary/warning.js +0 -42
  432. package/build/components/error-boundary/warning.js.map +0 -1
  433. package/build/components/global-styles/preview-iframe.js.map +0 -1
  434. package/build-module/components/error-boundary/index.js +0 -38
  435. package/build-module/components/error-boundary/index.js.map +0 -1
  436. package/build-module/components/error-boundary/warning.js +0 -35
  437. package/build-module/components/error-boundary/warning.js.map +0 -1
  438. package/build-module/components/global-styles/preview-iframe.js.map +0 -1
  439. package/src/components/error-boundary/index.js +0 -44
  440. package/src/components/error-boundary/test/error-boundary.js +0 -40
  441. package/src/components/error-boundary/warning.js +0 -30
@@ -1,3 +1,4 @@
1
+ /* wp:polyfill */
1
2
  /**
2
3
  * WordPress dependencies
3
4
  */
@@ -59,8 +60,8 @@ function getColorExamples(colors) {
59
60
  function getOverviewBlockExamples(colors) {
60
61
  const examples = [];
61
62
 
62
- // Get theme palette from colors.
63
- const themePalette = colors.colors.find(origin => origin.slug === 'theme');
63
+ // Get theme palette from colors if they exist.
64
+ const themePalette = colors?.colors.find(origin => origin.slug === 'theme');
64
65
  if (themePalette) {
65
66
  const themeColorexample = {
66
67
  name: 'theme-colors',
@@ -68,39 +69,56 @@ function getOverviewBlockExamples(colors) {
68
69
  category: 'overview',
69
70
  content: /*#__PURE__*/_jsx(ColorExamples, {
70
71
  colors: themePalette.colors,
71
- type: colors
72
+ type: colors,
73
+ templateColumns: "repeat(auto-fill, minmax( 200px, 1fr ))",
74
+ itemHeight: "32px"
72
75
  })
73
76
  };
74
77
  examples.push(themeColorexample);
75
78
  }
76
- const headingBlock = createBlock('core/heading', {
77
- content: __(`AaBbCcDdEeFfGgHhiiJjKkLIMmNnOoPpQakRrssTtUuVVWwXxxYyZzOl23356789X{(…)},2!*&:/A@HELFO™`),
78
- level: 1
79
- });
80
- const firstParagraphBlock = createBlock('core/paragraph', {
81
- content: __(`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.`)
82
- });
83
- const secondParagraphBlock = createBlock('core/paragraph', {
84
- content: __(`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.`)
85
- });
86
- const textExample = {
87
- name: 'typography',
88
- title: __('Typography'),
89
- category: 'overview',
90
- blocks: [headingBlock, createBlock('core/group', {
91
- layout: {
92
- type: 'grid',
93
- columnCount: 2,
94
- minimumColumnWidth: '12rem'
95
- },
96
- style: {
97
- spacing: {
98
- blockGap: '1.5rem'
79
+
80
+ // Get examples for typography blocks.
81
+ const typographyBlockExamples = [];
82
+ if (getBlockType('core/heading')) {
83
+ const headingBlock = createBlock('core/heading', {
84
+ content: __(`AaBbCcDdEeFfGgHhiiJjKkLIMmNnOoPpQakRrssTtUuVVWwXxxYyZzOl23356789X{(…)},2!*&:/A@HELFO™`),
85
+ level: 1
86
+ });
87
+ typographyBlockExamples.push(headingBlock);
88
+ }
89
+ if (getBlockType('core/paragraph')) {
90
+ const firstParagraphBlock = createBlock('core/paragraph', {
91
+ content: __(`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.`)
92
+ });
93
+ const secondParagraphBlock = createBlock('core/paragraph', {
94
+ content: __(`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.`)
95
+ });
96
+ if (getBlockType('core/group')) {
97
+ const groupBlock = createBlock('core/group', {
98
+ layout: {
99
+ type: 'grid',
100
+ columnCount: 2,
101
+ minimumColumnWidth: '12rem'
102
+ },
103
+ style: {
104
+ spacing: {
105
+ blockGap: '1.5rem'
106
+ }
99
107
  }
100
- }
101
- }, [firstParagraphBlock, secondParagraphBlock])]
102
- };
103
- examples.push(textExample);
108
+ }, [firstParagraphBlock, secondParagraphBlock]);
109
+ typographyBlockExamples.push(groupBlock);
110
+ } else {
111
+ typographyBlockExamples.push(firstParagraphBlock);
112
+ }
113
+ }
114
+ if (!!typographyBlockExamples.length) {
115
+ examples.push({
116
+ name: 'typography',
117
+ title: __('Typography'),
118
+ category: 'overview',
119
+ blocks: typographyBlockExamples
120
+ });
121
+ }
104
122
  const otherBlockExamples = ['core/image', 'core/separator', 'core/buttons', 'core/pullquote', 'core/search'];
105
123
 
106
124
  // Get examples for other blocks and put them in order of above array.
@@ -1 +1 @@
1
- {"version":3,"names":["__","sprintf","getBlockType","getBlockTypes","getBlockFromExample","createBlock","ColorExamples","DuotoneExamples","STYLE_BOOK_COLOR_GROUPS","jsx","_jsx","getColorExamples","colors","examples","forEach","group","palette","type","find","origin","slug","example","name","title","category","content","duotones","push","getOverviewBlockExamples","themePalette","themeColorexample","headingBlock","level","firstParagraphBlock","secondParagraphBlock","textExample","blocks","layout","columnCount","minimumColumnWidth","style","spacing","blockGap","otherBlockExamples","blockName","blockType","blockExample","attributes","undefined","getExamples","nonHeadingBlockExamples","filter","supports","inserter","map","isHeadingBlockRegistered","headingsExample","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":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SACCC,YAAY,EACZC,aAAa,EACbC,mBAAmB,EACnBC,WAAW,QACL,mBAAmB;;AAE1B;AACA;AACA;;AAEA,OAAOC,aAAa,MAAM,kBAAkB;AAC5C,OAAOC,eAAe,MAAM,oBAAoB;AAChD,SAASC,uBAAuB,QAAQ,aAAa;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA;AANA,SAAAC,GAAA,IAAAC,IAAA;AAOA,SAASC,gBAAgBA,CAAEC,MAA2B,EAAmB;EACxE,IAAK,CAAEA,MAAM,EAAG;IACf,OAAO,EAAE;EACV;EAEA,MAAMC,QAAwB,GAAG,EAAE;EAEnCL,uBAAuB,CAACM,OAAO,CAAIC,KAAK,IAAM;IAC7C,MAAMC,OAAO,GAAGJ,MAAM,CAAEG,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,EAA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CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAE,CAACkB,GAAG,CAAItB,KAAK,IAAM;MAC9C,OAAO3B,WAAW,CAAE,cAAc,EAAE;QACnCoB,OAAO,EAAExB,OAAO;QACf;QACAD,EAAE,CAAE,YAAa,CAAC,EAClBgC,KACD,CAAC;QACDA;MACD,CAAE,CAAC;IACJ,CAAE;EACH,CAAC;EACD,MAAMyB,aAAa,GAAG9C,gBAAgB,CAAEC,MAAO,CAAC;EAEhD,MAAM8C,qBAAqB,GAAG9B,wBAAwB,CAAEhB,MAAO,CAAC;EAEhE,OAAO,CACN4C,eAAe,EACf,GAAGC,aAAa,EAChB,GAAGP,uBAAuB,EAC1B,GAAGQ,qBAAqB,CACxB;AACF","ignoreList":[]}
1
+ {"version":3,"names":["__","sprintf","getBlockType","getBlockTypes","getBlockFromExample","createBlock","ColorExamples","DuotoneExamples","STYLE_BOOK_COLOR_GROUPS","jsx","_jsx","getColorExamples","colors","examples","forEach","group","palette","type","find","origin","slug","example","name","title","category","content","duotones","push","getOverviewBlockExamples","themePalette","themeColorexample","templateColumns","itemHeight","typographyBlockExamples","headingBlock","level","firstParagraphBlock","secondParagraphBlock","groupBlock","layout","columnCount","minimumColumnWidth","style","spacing","blockGap","length","blocks","otherBlockExamples","blockName","blockType","blockExample","attributes","undefined","getExamples","nonHeadingBlockExamples","filter","supports","inserter","map","isHeadingBlockRegistered","headingsExample","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 if they exist.\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\n\t\t\t\t\tcolors={ themePalette.colors }\n\t\t\t\t\ttype={ colors }\n\t\t\t\t\ttemplateColumns=\"repeat(auto-fill, minmax( 200px, 1fr ))\"\n\t\t\t\t\titemHeight=\"32px\"\n\t\t\t\t/>\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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;IACvBwB,QAAQ,EAAE,MAAM;IAChBsB,MAAM,EAAE,CAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAE,CAACY,GAAG,CAAIvB,KAAK,IAAM;MAC9C,OAAO9B,WAAW,CAAE,cAAc,EAAE;QACnCoB,OAAO,EAAExB,OAAO;QACf;QACAD,EAAE,CAAE,YAAa,CAAC,EAClBmC,KACD,CAAC;QACDA;MACD,CAAE,CAAC;IACJ,CAAE;EACH,CAAC;EACD,MAAM0B,aAAa,GAAGlD,gBAAgB,CAAEC,MAAO,CAAC;EAEhD,MAAMkD,qBAAqB,GAAGlC,wBAAwB,CAAEhB,MAAO,CAAC;EAEhE,OAAO,CACNgD,eAAe,EACf,GAAGC,aAAa,EAChB,GAAGP,uBAAuB,EAC1B,GAAGQ,qBAAqB,CACxB;AACF","ignoreList":[]}
@@ -1,3 +1,4 @@
1
+ /* wp:polyfill */
1
2
  /**
2
3
  * External dependencies
3
4
  */
@@ -8,9 +9,9 @@ import clsx from 'clsx';
8
9
  */
9
10
  import { Disabled, Composite, privateApis as componentsPrivateApis } from '@wordpress/components';
10
11
  import { __, _x, sprintf } from '@wordpress/i18n';
11
- import { BlockList, privateApis as blockEditorPrivateApis, store as blockEditorStore, useSettings, __unstableEditorStyles as EditorStyles, __unstableIframe as Iframe, __experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients } from '@wordpress/block-editor';
12
+ import { BlockList, privateApis as blockEditorPrivateApis, store as blockEditorStore, useSettings, BlockEditorProvider, __unstableEditorStyles as EditorStyles, __unstableIframe as Iframe, __experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients } from '@wordpress/block-editor';
12
13
  import { privateApis as editorPrivateApis } from '@wordpress/editor';
13
- import { useSelect } from '@wordpress/data';
14
+ import { useSelect, dispatch } from '@wordpress/data';
14
15
  import { useResizeObserver } from '@wordpress/compose';
15
16
  import { useMemo, useState, memo, useContext, useRef, useLayoutEffect } from '@wordpress/element';
16
17
  import { ENTER, SPACE } from '@wordpress/keycodes';
@@ -23,6 +24,7 @@ import EditorCanvasContainer from '../editor-canvas-container';
23
24
  import { STYLE_BOOK_IFRAME_STYLES } from './constants';
24
25
  import { getExamplesByCategory, getTopLevelStyleBookCategories } from './categories';
25
26
  import { getExamples } from './examples';
27
+ import { store as siteEditorStore } from '../../store';
26
28
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
27
29
  const {
28
30
  ExperimentalBlockEditorProvider,
@@ -47,10 +49,10 @@ function isObjectEmpty(object) {
47
49
  * @param {HTMLIFrameElement} iframe The target iframe.
48
50
  */
49
51
  const scrollToSection = (anchorId, iframe) => {
50
- if (!iframe || !iframe?.contentDocument) {
52
+ if (!anchorId || !iframe || !iframe?.contentDocument) {
51
53
  return;
52
54
  }
53
- const element = iframe.contentDocument.getElementById(anchorId);
55
+ const element = anchorId === 'top' ? iframe.contentDocument.body : iframe.contentDocument.getElementById(anchorId);
54
56
  if (element) {
55
57
  element.scrollIntoView({
56
58
  behavior: 'smooth'
@@ -68,6 +70,11 @@ const scrollToSection = (anchorId, iframe) => {
68
70
  */
69
71
  const getStyleBookNavigationFromPath = path => {
70
72
  if (path && typeof path === 'string') {
73
+ if (path === '/') {
74
+ return {
75
+ top: true
76
+ };
77
+ }
71
78
  if (path.startsWith('/typography')) {
72
79
  return {
73
80
  block: 'typography'
@@ -129,6 +136,24 @@ function useMultiOriginPalettes() {
129
136
  }, [colors, gradients, customDuotones, themeDuotones, defaultDuotones, shouldDisplayDefaultDuotones]);
130
137
  return palettes;
131
138
  }
139
+
140
+ /**
141
+ * Get deduped examples for single page stylebook.
142
+ * @param {Array} examples Array of examples.
143
+ * @return {Array} Deduped examples.
144
+ */
145
+ export function getExamplesForSinglePageUse(examples) {
146
+ const examplesForSinglePageUse = [];
147
+ const overviewCategoryExamples = getExamplesByCategory({
148
+ slug: 'overview'
149
+ }, examples);
150
+ examplesForSinglePageUse.push(...overviewCategoryExamples.examples);
151
+ const otherExamples = examples.filter(example => {
152
+ return example.category !== 'overview' && !overviewCategoryExamples.examples.find(overviewExample => overviewExample.name === example.name);
153
+ });
154
+ examplesForSinglePageUse.push(...otherExamples);
155
+ return examplesForSinglePageUse;
156
+ }
132
157
  function StyleBook({
133
158
  enableResizing = true,
134
159
  isSelected,
@@ -146,15 +171,7 @@ function StyleBook({
146
171
  const colors = useMultiOriginPalettes();
147
172
  const examples = useMemo(() => getExamples(colors), [colors]);
148
173
  const tabs = useMemo(() => getTopLevelStyleBookCategories().filter(category => examples.some(example => example.category === category.slug)), [examples]);
149
- const examplesForSinglePageUse = [];
150
- const overviewCategoryExamples = getExamplesByCategory({
151
- slug: 'overview'
152
- }, examples);
153
- examplesForSinglePageUse.push(...overviewCategoryExamples.examples);
154
- const otherExamples = examples.filter(example => {
155
- return example.category !== 'overview' && !overviewCategoryExamples.examples.find(overviewExample => overviewExample.name === example.name);
156
- });
157
- examplesForSinglePageUse.push(...otherExamples);
174
+ const examplesForSinglePageUse = getExamplesForSinglePageUse(examples);
158
175
  const {
159
176
  base: baseConfig
160
177
  } = useContext(GlobalStylesContext);
@@ -224,7 +241,62 @@ function StyleBook({
224
241
  })
225
242
  });
226
243
  }
227
- const StyleBookBody = ({
244
+
245
+ /**
246
+ * Style Book Preview component renders the stylebook without the Editor dependency.
247
+ *
248
+ * @param {Object} props Component props.
249
+ * @param {string} props.path Path to the selected block.
250
+ * @param {Object} props.userConfig User configuration.
251
+ * @param {Function} props.isSelected Function to check if a block is selected.
252
+ * @param {Function} props.onSelect Function to select a block.
253
+ * @return {Object} Style Book Preview component.
254
+ */
255
+ export const StyleBookPreview = ({
256
+ path = '',
257
+ userConfig = {},
258
+ isSelected,
259
+ onSelect
260
+ }) => {
261
+ const siteEditorSettings = useSelect(select => select(siteEditorStore).getSettings(), []);
262
+ // Update block editor settings because useMultipleOriginColorsAndGradients fetch colours from there.
263
+ dispatch(blockEditorStore).updateSettings(siteEditorSettings);
264
+ const [resizeObserver, sizes] = useResizeObserver();
265
+ const colors = useMultiOriginPalettes();
266
+ const examples = getExamples(colors);
267
+ const examplesForSinglePageUse = getExamplesForSinglePageUse(examples);
268
+ const {
269
+ base: baseConfig
270
+ } = useContext(GlobalStylesContext);
271
+ const goTo = getStyleBookNavigationFromPath(path);
272
+ const mergedConfig = useMemo(() => {
273
+ if (!isObjectEmpty(userConfig) && !isObjectEmpty(baseConfig)) {
274
+ return mergeBaseAndUserConfigs(baseConfig, userConfig);
275
+ }
276
+ return {};
277
+ }, [baseConfig, userConfig]);
278
+ const [globalStyles] = useGlobalStylesOutputWithConfig(mergedConfig);
279
+ const settings = useMemo(() => ({
280
+ ...siteEditorSettings,
281
+ styles: !isObjectEmpty(globalStyles) && !isObjectEmpty(userConfig) ? globalStyles : siteEditorSettings.styles,
282
+ isPreviewMode: true
283
+ }), [globalStyles, siteEditorSettings, userConfig]);
284
+ return /*#__PURE__*/_jsxs("div", {
285
+ className: "edit-site-style-book",
286
+ children: [resizeObserver, /*#__PURE__*/_jsx(BlockEditorProvider, {
287
+ settings: settings,
288
+ children: /*#__PURE__*/_jsx(StyleBookBody, {
289
+ examples: examplesForSinglePageUse,
290
+ settings: settings,
291
+ goTo: goTo,
292
+ sizes: sizes,
293
+ isSelected: isSelected,
294
+ onSelect: onSelect
295
+ })
296
+ })]
297
+ });
298
+ };
299
+ export const StyleBookBody = ({
228
300
  category,
229
301
  examples,
230
302
  isSelected,
@@ -269,10 +341,16 @@ const StyleBookBody = ({
269
341
  };
270
342
  const handleLoad = () => setHasIframeLoaded(true);
271
343
  useLayoutEffect(() => {
272
- if (goTo?.block && hasIframeLoaded && iframeRef?.current) {
273
- scrollToSection(`example-${goTo?.block}`, iframeRef?.current);
344
+ if (hasIframeLoaded && iframeRef?.current) {
345
+ if (goTo?.top) {
346
+ scrollToSection('top', iframeRef?.current);
347
+ return;
348
+ }
349
+ if (goTo?.block) {
350
+ scrollToSection(`example-${goTo?.block}`, iframeRef?.current);
351
+ }
274
352
  }
275
- }, [iframeRef?.current, goTo?.block, scrollToSection, hasIframeLoaded]);
353
+ }, [iframeRef?.current, goTo, scrollToSection, hasIframeLoaded]);
276
354
  return /*#__PURE__*/_jsxs(Iframe, {
277
355
  onLoad: handleLoad,
278
356
  ref: iframeRef,
@@ -324,7 +402,7 @@ const Examples = memo(({
324
402
  content: example.content,
325
403
  blocks: example.blocks,
326
404
  isSelected: isSelected?.(example.name),
327
- onClick: () => onSelect?.(example.name)
405
+ onClick: !!onSelect ? () => onSelect(example.name) : null
328
406
  }, example.name)), !!filteredExamples?.subcategories?.length && filteredExamples.subcategories.map(subcategory => /*#__PURE__*/_jsxs(Composite.Group, {
329
407
  className: "edit-site-style-book__subcategory",
330
408
  children: [/*#__PURE__*/_jsx(Composite.GroupLabel, {
@@ -351,9 +429,7 @@ const Subcategory = ({
351
429
  content: example.content,
352
430
  blocks: example.blocks,
353
431
  isSelected: isSelected?.(example.name),
354
- onClick: () => {
355
- onSelect?.(example.name);
356
- }
432
+ onClick: !!onSelect ? () => onSelect(example.name) : null
357
433
  }, example.name));
358
434
  };
359
435
  const disabledExamples = ['example-duotones'];
@@ -375,9 +451,9 @@ const Example = ({
375
451
 
376
452
  // Cache the list of blocks to avoid additional processing when the component is re-rendered.
377
453
  const renderedBlocks = useMemo(() => Array.isArray(blocks) ? blocks : [blocks], [blocks]);
378
- const disabledProps = disabledExamples.includes(id) ? {
454
+ const disabledProps = disabledExamples.includes(id) || !onClick ? {
379
455
  disabled: true,
380
- accessibleWhenDisabled: true
456
+ accessibleWhenDisabled: !!onClick
381
457
  } : {};
382
458
  return /*#__PURE__*/_jsx("div", {
383
459
  role: "row",
@@ -389,11 +465,11 @@ const Example = ({
389
465
  'is-disabled-example': !!disabledProps?.disabled
390
466
  }),
391
467
  id: id,
392
- "aria-label": sprintf(
468
+ "aria-label": !!onClick ? sprintf(
393
469
  // translators: %s: Title of a block, e.g. Heading.
394
- __('Open %s styles in Styles panel'), title),
470
+ __('Open %s styles in Styles panel'), title) : undefined,
395
471
  render: /*#__PURE__*/_jsx("div", {}),
396
- role: "button",
472
+ role: !!onClick ? 'button' : null,
397
473
  onClick: onClick,
398
474
  ...disabledProps,
399
475
  children: [/*#__PURE__*/_jsx("span", {
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","Disabled","Composite","privateApis","componentsPrivateApis","__","_x","sprintf","BlockList","blockEditorPrivateApis","store","blockEditorStore","useSettings","__unstableEditorStyles","EditorStyles","__unstableIframe","Iframe","__experimentalUseMultipleOriginColorsAndGradients","useMultipleOriginColorsAndGradients","editorPrivateApis","useSelect","useResizeObserver","useMemo","useState","memo","useContext","useRef","useLayoutEffect","ENTER","SPACE","unlock","EditorCanvasContainer","STYLE_BOOK_IFRAME_STYLES","getExamplesByCategory","getTopLevelStyleBookCategories","getExamples","jsx","_jsx","jsxs","_jsxs","ExperimentalBlockEditorProvider","useGlobalStyle","GlobalStylesContext","useGlobalStylesOutputWithConfig","mergeBaseAndUserConfigs","Tabs","isObjectEmpty","object","Object","keys","length","scrollToSection","anchorId","iframe","contentDocument","element","getElementById","scrollIntoView","behavior","getStyleBookNavigationFromPath","path","startsWith","block","includes","decodeURIComponent","split","endsWith","useMultiOriginPalettes","colors","gradients","shouldDisplayDefaultDuotones","customDuotones","themeDuotones","defaultDuotones","palettes","result","duotones","push","name","slug","StyleBook","enableResizing","isSelected","onClick","onSelect","showCloseButton","onClose","showTabs","userConfig","resizeObserver","sizes","textColor","backgroundColor","examples","tabs","filter","category","some","example","examplesForSinglePageUse","overviewCategoryExamples","otherExamples","find","overviewExample","base","baseConfig","goTo","mergedConfig","originalSettings","select","getSettings","globalStyles","settings","styles","isPreviewMode","closeButtonLabel","children","className","width","style","color","background","TabList","map","tab","Tab","tabId","title","TabPanel","focusable","StyleBookBody","isFocused","setIsFocused","hasIframeLoaded","setHasIframeLoaded","iframeRef","buttonModeProps","role","onFocus","onBlur","onKeyDown","event","defaultPrevented","keyCode","preventDefault","readonly","handleLoad","current","onLoad","ref","tabIndex","Examples","label","categoryDefinition","_category","filteredExamples","orientation","Example","id","content","blocks","subcategories","subcategory","Group","GroupLabel","Subcategory","disabledExamples","focusMode","renderedBlocks","Array","isArray","disabledProps","disabled","accessibleWhenDisabled","Item","render","value","renderAppender"],"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\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 ( 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":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,QAAQ,EACRC,SAAS,EACTC,WAAW,IAAIC,qBAAqB,QAC9B,uBAAuB;AAC9B,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SACCC,SAAS,EACTL,WAAW,IAAIM,sBAAsB,EACrCC,KAAK,IAAIC,gBAAgB,EACzBC,WAAW,EACXC,sBAAsB,IAAIC,YAAY,EACtCC,gBAAgB,IAAIC,MAAM,EAC1BC,iDAAiD,IAAIC,mCAAmC,QAClF,yBAAyB;AAChC,SAASf,WAAW,IAAIgB,iBAAiB,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3,"names":["clsx","Disabled","Composite","privateApis","componentsPrivateApis","__","_x","sprintf","BlockList","blockEditorPrivateApis","store","blockEditorStore","useSettings","BlockEditorProvider","__unstableEditorStyles","EditorStyles","__unstableIframe","Iframe","__experimentalUseMultipleOriginColorsAndGradients","useMultipleOriginColorsAndGradients","editorPrivateApis","useSelect","dispatch","useResizeObserver","useMemo","useState","memo","useContext","useRef","useLayoutEffect","ENTER","SPACE","unlock","EditorCanvasContainer","STYLE_BOOK_IFRAME_STYLES","getExamplesByCategory","getTopLevelStyleBookCategories","getExamples","siteEditorStore","jsx","_jsx","jsxs","_jsxs","ExperimentalBlockEditorProvider","useGlobalStyle","GlobalStylesContext","useGlobalStylesOutputWithConfig","mergeBaseAndUserConfigs","Tabs","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","shouldDisplayDefaultDuotones","customDuotones","themeDuotones","defaultDuotones","palettes","result","duotones","push","name","slug","getExamplesForSinglePageUse","examples","examplesForSinglePageUse","overviewCategoryExamples","otherExamples","filter","example","category","find","overviewExample","StyleBook","enableResizing","isSelected","onClick","onSelect","showCloseButton","onClose","showTabs","userConfig","resizeObserver","sizes","textColor","backgroundColor","tabs","some","base","baseConfig","goTo","mergedConfig","originalSettings","select","getSettings","globalStyles","settings","styles","isPreviewMode","closeButtonLabel","children","className","width","style","color","background","TabList","map","tab","Tab","tabId","title","TabPanel","focusable","StyleBookBody","StyleBookPreview","siteEditorSettings","updateSettings","isFocused","setIsFocused","hasIframeLoaded","setHasIframeLoaded","iframeRef","buttonModeProps","role","onFocus","onBlur","onKeyDown","event","defaultPrevented","keyCode","preventDefault","readonly","handleLoad","current","onLoad","ref","tabIndex","Examples","label","categoryDefinition","_category","filteredExamples","orientation","Example","id","content","blocks","subcategories","subcategory","Group","GroupLabel","Subcategory","disabledExamples","focusMode","renderedBlocks","Array","isArray","disabledProps","disabled","accessibleWhenDisabled","Item","undefined","render","value","renderAppender"],"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\tBlockEditorProvider,\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, dispatch } 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';\nimport { store as siteEditorStore } from '../../store';\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\n/**\n * Get deduped examples for single page stylebook.\n * @param {Array} examples Array of examples.\n * @return {Array} Deduped examples.\n */\nexport function getExamplesForSinglePageUse( examples ) {\n\tconst examplesForSinglePageUse = [];\n\tconst overviewCategoryExamples = getExamplesByCategory(\n\t\t{ slug: 'overview' },\n\t\texamples\n\t);\n\texamplesForSinglePageUse.push( ...overviewCategoryExamples.examples );\n\tconst otherExamples = examples.filter( ( example ) => {\n\t\treturn (\n\t\t\texample.category !== 'overview' &&\n\t\t\t! overviewCategoryExamples.examples.find(\n\t\t\t\t( overviewExample ) => overviewExample.name === example.name\n\t\t\t)\n\t\t);\n\t} );\n\texamplesForSinglePageUse.push( ...otherExamples );\n\n\treturn examplesForSinglePageUse;\n}\n\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 = getExamplesForSinglePageUse( examples );\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\n/**\n * Style Book Preview component renders the stylebook without the Editor dependency.\n *\n * @param {Object} props Component props.\n * @param {string} props.path Path to the selected block.\n * @param {Object} props.userConfig User configuration.\n * @param {Function} props.isSelected Function to check if a block is selected.\n * @param {Function} props.onSelect Function to select a block.\n * @return {Object} Style Book Preview component.\n */\nexport const StyleBookPreview = ( {\n\tpath = '',\n\tuserConfig = {},\n\tisSelected,\n\tonSelect,\n} ) => {\n\tconst siteEditorSettings = useSelect(\n\t\t( select ) => select( siteEditorStore ).getSettings(),\n\t\t[]\n\t);\n\t// Update block editor settings because useMultipleOriginColorsAndGradients fetch colours from there.\n\tdispatch( blockEditorStore ).updateSettings( siteEditorSettings );\n\n\tconst [ resizeObserver, sizes ] = useResizeObserver();\n\tconst colors = useMultiOriginPalettes();\n\tconst examples = getExamples( colors );\n\tconst examplesForSinglePageUse = getExamplesForSinglePageUse( examples );\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\tconst [ globalStyles ] = useGlobalStylesOutputWithConfig( mergedConfig );\n\n\tconst settings = useMemo(\n\t\t() => ( {\n\t\t\t...siteEditorSettings,\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: siteEditorSettings.styles,\n\t\t\tisPreviewMode: true,\n\t\t} ),\n\t\t[ globalStyles, siteEditorSettings, userConfig ]\n\t);\n\n\treturn (\n\t\t<div className=\"edit-site-style-book\">\n\t\t\t{ resizeObserver }\n\t\t\t<BlockEditorProvider settings={ settings }>\n\t\t\t\t<StyleBookBody\n\t\t\t\t\texamples={ examplesForSinglePageUse }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t\tgoTo={ goTo }\n\t\t\t\t\tsizes={ sizes }\n\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t/>\n\t\t\t</BlockEditorProvider>\n\t\t</div>\n\t);\n};\n\nexport const 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={\n\t\t\t\t\t\t\t\t!! onSelect\n\t\t\t\t\t\t\t\t\t? () => onSelect( example.name )\n\t\t\t\t\t\t\t\t\t: null\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) ) }\n\t\t\t\t{ !! filteredExamples?.subcategories?.length &&\n\t\t\t\t\tfilteredExamples.subcategories.map( ( subcategory ) => (\n\t\t\t\t\t\t<Composite.Group\n\t\t\t\t\t\t\tclassName=\"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={ !! onSelect ? () => onSelect( example.name ) : null }\n\t\t\t/>\n\t\t) )\n\t);\n};\n\nconst disabledExamples = [ 'example-duotones' ];\n\nconst Example = ( { id, title, blocks, isSelected, onClick, content } ) => {\n\tconst originalSettings = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings(),\n\t\t[]\n\t);\n\tconst settings = useMemo(\n\t\t() => ( {\n\t\t\t...originalSettings,\n\t\t\tfocusMode: false, // Disable \"Spotlight mode\".\n\t\t\tisPreviewMode: true,\n\t\t} ),\n\t\t[ originalSettings ]\n\t);\n\n\t// Cache the list of blocks to avoid additional processing when the component is re-rendered.\n\tconst renderedBlocks = useMemo(\n\t\t() => ( Array.isArray( blocks ) ? blocks : [ blocks ] ),\n\t\t[ blocks ]\n\t);\n\n\tconst disabledProps =\n\t\tdisabledExamples.includes( id ) || ! onClick\n\t\t\t? {\n\t\t\t\t\tdisabled: true,\n\t\t\t\t\taccessibleWhenDisabled: !! onClick,\n\t\t\t }\n\t\t\t: {};\n\n\treturn (\n\t\t<div role=\"row\">\n\t\t\t<div role=\"gridcell\">\n\t\t\t\t<Composite.Item\n\t\t\t\t\tclassName={ clsx( '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={\n\t\t\t\t\t\t!! onClick\n\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t// translators: %s: Title of a block, e.g. Heading.\n\t\t\t\t\t\t\t\t\t__( 'Open %s styles in Styles panel' ),\n\t\t\t\t\t\t\t\t\ttitle\n\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t}\n\t\t\t\t\trender={ <div /> }\n\t\t\t\t\trole={ !! onClick ? 'button' : null }\n\t\t\t\t\tonClick={ onClick }\n\t\t\t\t\t{ ...disabledProps }\n\t\t\t\t>\n\t\t\t\t\t<span className=\"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":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,QAAQ,EACRC,SAAS,EACTC,WAAW,IAAIC,qBAAqB,QAC9B,uBAAuB;AAC9B,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SACCC,SAAS,EACTL,WAAW,IAAIM,sBAAsB,EACrCC,KAAK,IAAIC,gBAAgB,EACzBC,WAAW,EACXC,mBAAmB,EACnBC,sBAAsB,IAAIC,YAAY,EACtCC,gBAAgB,IAAIC,MAAM,EAC1BC,iDAAiD,IAAIC,mCAAmC,QAClF,yBAAyB;AAChC,SAAShB,WAAW,IAAIiB,iBAAiB,QAAQ,mBAAmB;AACpE,SAASC,SAAS,EAAEC,QAAQ,QAAQ,iBAAiB;AACrD,SAASC,iBAAiB,QAAQ,oBAAoB;AACtD,SACCC,OAAO,EACPC,QAAQ,EACRC,IAAI,EACJC,UAAU,EACVC,MAAM,EACNC,eAAe,QACT,oBAAoB;AAC3B,SAASC,KAAK,EAAEC,KAAK,QAAQ,qBAAqB;;AAElD;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,qBAAqB,MAAM,4BAA4B;AAC9D,SAASC,wBAAwB,QAAQ,aAAa;AACtD,SACCC,qBAAqB,EACrBC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;QACAF,EAAE,CAAE,gCAAiC,CAAC,EACtCgI,KACA,CAAC,GACDmD,SACH;QACDC,MAAM,eAAGjJ,IAAA,UAAM,CAAG;QAClB0G,IAAI,EAAG,CAAC,CAAEhD,OAAO,GAAG,QAAQ,GAAG,IAAM;QACrCA,OAAO,EAAGA,OAAS;QAAA,GACdkF,aAAa;QAAA1D,QAAA,gBAElBlF,IAAA;UAAMmF,SAAS,EAAC,qCAAqC;UAAAD,QAAA,EAClDW;QAAK,CACF,CAAC,eACP7F,IAAA;UACCmF,SAAS,EAAC,uCAAuC;UACjD,mBAAW;UAAAD,QAAA,eAEXlF,IAAA,CAACvC,QAAQ;YAAC0H,SAAS,EAAC,gDAAgD;YAAAD,QAAA,EACjE8C,OAAO,GACRA,OAAO,gBAEP9H,KAAA,CAACC,+BAA+B;cAC/B+I,KAAK,EAAGT,cAAgB;cACxB3D,QAAQ,EAAGA,QAAU;cAAAI,QAAA,gBAErBlF,IAAA,CAACzB,YAAY,IAAE,CAAC,eAChByB,IAAA,CAAChC,SAAS;gBAACmL,cAAc,EAAG;cAAO,CAAE,CAAC;YAAA,CACN;UACjC,CACQ;QAAC,CACP,CAAC;MAAA,CACS;IAAC,CACb;EAAC,CACF,CAAC;AAER,CAAC;AAED,eAAe5F,SAAS","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/edit-site/src/components/style-book/types.ts"],"sourcesContent":["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":[]}
@@ -1,3 +1,4 @@
1
+ /* wp:polyfill */
1
2
  /**
2
3
  * WordPress dependencies
3
4
  */
@@ -1 +1 @@
1
- {"version":3,"names":["store","blocksStore","registerCoreBlocks","__experimentalGetCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","dispatch","deprecated","createRoot","StrictMode","privateApis","editorPrivateApis","preferencesStore","registerLegacyWidgetBlock","registerWidgetGroupBlock","editSiteStore","unlock","App","jsx","_jsx","registerCoreBlockBindingsSources","initializeEditor","id","settings","target","document","getElementById","root","reapplyBlockTypeFilters","coreBlocks","filter","name","setFreeformFallbackBlockName","inserter","globalThis","IS_GUTENBERG_PLUGIN","enableFSEBlocks","setDefaults","welcomeGuide","welcomeGuideStyles","welcomeGuidePage","welcomeGuideTemplate","allowRightClickOverrides","distractionFree","editorMode","editorTool","fixedToolbar","focusMode","inactivePanels","keepCaretInsideBlock","openPanels","showBlockBreadcrumbs","showListViewByDefault","enableChoosePatternModal","window","__experimentalMediaProcessing","requireApproval","optimizeOnUpload","updateSettings","addEventListener","e","preventDefault","render","children","reinitializeEditor","since","version","default","PluginTemplateSettingPanel","initializePostsDashboard"],"sources":["@wordpress/edit-site/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalGetCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport { dispatch } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot, StrictMode } from '@wordpress/element';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport { store as editSiteStore } from './store';\nimport { unlock } from './lock-unlock';\nimport App from './components/app';\n\nconst { registerCoreBlockBindingsSources } = unlock( editorPrivateApis );\n\n/**\n * Initializes the site editor screen.\n *\n * @param {string} id ID of the root element to render the screen in.\n * @param {Object} settings Editor settings.\n */\nexport function initializeEditor( id, settings ) {\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\tconst coreBlocks = __experimentalGetCoreBlocks().filter(\n\t\t( { name } ) => name !== 'core/freeform'\n\t);\n\tregisterCoreBlocks( coreBlocks );\n\tregisterCoreBlockBindingsSources();\n\tdispatch( blocksStore ).setFreeformFallbackBlockName( 'core/html' );\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: true,\n\t\t} );\n\t}\n\n\t// We dispatch actions and update the store synchronously before rendering\n\t// so that we won't trigger unnecessary re-renders with useEffect.\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-site', {\n\t\twelcomeGuide: true,\n\t\twelcomeGuideStyles: true,\n\t\twelcomeGuidePage: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( preferencesStore ).setDefaults( 'core', {\n\t\tallowRightClickOverrides: true,\n\t\tdistractionFree: false,\n\t\teditorMode: 'visual',\n\t\teditorTool: 'edit',\n\t\tfixedToolbar: false,\n\t\tfocusMode: false,\n\t\tinactivePanels: [],\n\t\tkeepCaretInsideBlock: false,\n\t\topenPanels: [ 'post-status' ],\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowListViewByDefault: false,\n\t\tenableChoosePatternModal: true,\n\t} );\n\n\tif ( window.__experimentalMediaProcessing ) {\n\t\tdispatch( preferencesStore ).setDefaults( 'core/media', {\n\t\t\trequireApproval: true,\n\t\t\toptimizeOnUpload: true,\n\t\t} );\n\t}\n\n\tdispatch( editSiteStore ).updateSettings( settings );\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render(\n\t\t<StrictMode>\n\t\t\t<App />\n\t\t</StrictMode>\n\t);\n\n\treturn root;\n}\n\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editSite.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { default as PluginTemplateSettingPanel } from './components/plugin-template-setting-panel';\nexport { store } from './store';\nexport * from './deprecated';\n\n// Temporary: While the posts dashboard is being iterated on\n// it's being built in the same package as the site editor.\nexport { initializePostsDashboard } from './posts';\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SACCC,kBAAkB,EAClBC,2BAA2B,EAC3BC,4CAA4C,QACtC,0BAA0B;AACjC,SAASC,QAAQ,QAAQ,iBAAiB;AAC1C,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;AAC3D,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;AACpE,SAASV,KAAK,IAAIW,gBAAgB,QAAQ,wBAAwB;AAClE,SACCC,yBAAyB,EACzBC,wBAAwB,QAClB,oBAAoB;;AAE3B;AACA;AACA;AACA,OAAO,SAAS;AAChB,SAASb,KAAK,IAAIc,aAAa,QAAQ,SAAS;AAChD,SAASC,MAAM,QAAQ,eAAe;AACtC,OAAOC,GAAG,MAAM,kBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEnC,MAAM;EAAEC;AAAiC,CAAC,GAAGJ,MAAM,CAAEL,iBAAkB,CAAC;;AA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AAoB,EAAE,KAAK;IAC3BC,UAAU,EAAE,CAAE,aAAa,CAAE;IAC7BC,oBAAoB,EAAE,IAAI;IAC1BC,qBAAqB,EAAE,KAAK;IAC5BC,wBAAwB,EAAE;EAC3B,CAAE,CAAC;EAEH,IAAKC,MAAM,CAACC,6BAA6B,EAAG;IAC3CjD,QAAQ,CAAEM,gBAAiB,CAAC,CAACyB,WAAW,CAAE,YAAY,EAAE;MACvDmB,eAAe,EAAE,IAAI;MACrBC,gBAAgB,EAAE;IACnB,CAAE,CAAC;EACJ;EAEAnD,QAAQ,CAAES,aAAc,CAAC,CAAC2C,cAAc,CAAEnC,QAAS,CAAC;;EAEpD;EACA+B,MAAM,CAACK,gBAAgB,CAAE,UAAU,EAAIC,CAAC,IAAMA,CAAC,CAACC,cAAc,CAAC,CAAC,EAAE,KAAM,CAAC;EACzEP,MAAM,CAACK,gBAAgB,CAAE,MAAM,EAAIC,CAAC,IAAMA,CAAC,CAACC,cAAc,CAAC,CAAC,EAAE,KAAM,CAAC;EAErElC,IAAI,CAACmC,MAAM,cACV3C,IAAA,CAACV,UAAU;IAAAsD,QAAA,eACV5C,IAAA,CAACF,GAAG,IAAE;EAAC,CACI,CACb,CAAC;EAED,OAAOU,IAAI;AACZ;AAEA,OAAO,SAASqC,kBAAkBA,CAAA,EAAG;EACpCzD,UAAU,CAAE,gCAAgC,EAAE;IAC7C0D,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ;AAEA,SAASC,OAAO,IAAIC,0BAA0B,QAAQ,4CAA4C;AAClG,SAASnE,KAAK,QAAQ,SAAS;AAC/B,cAAc,cAAc;;AAE5B;AACA;AACA,SAASoE,wBAAwB,QAAQ,SAAS","ignoreList":[]}
1
+ {"version":3,"names":["store","blocksStore","registerCoreBlocks","__experimentalGetCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","dispatch","deprecated","createRoot","StrictMode","privateApis","editorPrivateApis","preferencesStore","registerLegacyWidgetBlock","registerWidgetGroupBlock","editSiteStore","unlock","App","jsx","_jsx","registerCoreBlockBindingsSources","initializeEditor","id","settings","target","document","getElementById","root","reapplyBlockTypeFilters","coreBlocks","filter","name","setFreeformFallbackBlockName","inserter","globalThis","IS_GUTENBERG_PLUGIN","enableFSEBlocks","setDefaults","welcomeGuide","welcomeGuideStyles","welcomeGuidePage","welcomeGuideTemplate","allowRightClickOverrides","distractionFree","editorMode","editorTool","fixedToolbar","focusMode","inactivePanels","keepCaretInsideBlock","openPanels","showBlockBreadcrumbs","showListViewByDefault","enableChoosePatternModal","window","__experimentalMediaProcessing","requireApproval","optimizeOnUpload","updateSettings","addEventListener","e","preventDefault","render","children","reinitializeEditor","since","version","default","PluginTemplateSettingPanel","initializePostsDashboard"],"sources":["@wordpress/edit-site/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalGetCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport { dispatch } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot, StrictMode } from '@wordpress/element';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport { store as editSiteStore } from './store';\nimport { unlock } from './lock-unlock';\nimport App from './components/app';\n\nconst { registerCoreBlockBindingsSources } = unlock( editorPrivateApis );\n\n/**\n * Initializes the site editor screen.\n *\n * @param {string} id ID of the root element to render the screen in.\n * @param {Object} settings Editor settings.\n */\nexport function initializeEditor( id, settings ) {\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\tconst coreBlocks = __experimentalGetCoreBlocks().filter(\n\t\t( { name } ) => name !== 'core/freeform'\n\t);\n\tregisterCoreBlocks( coreBlocks );\n\tregisterCoreBlockBindingsSources();\n\tdispatch( blocksStore ).setFreeformFallbackBlockName( 'core/html' );\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: true,\n\t\t} );\n\t}\n\n\t// We dispatch actions and update the store synchronously before rendering\n\t// so that we won't trigger unnecessary re-renders with useEffect.\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-site', {\n\t\twelcomeGuide: true,\n\t\twelcomeGuideStyles: true,\n\t\twelcomeGuidePage: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( preferencesStore ).setDefaults( 'core', {\n\t\tallowRightClickOverrides: true,\n\t\tdistractionFree: false,\n\t\teditorMode: 'visual',\n\t\teditorTool: 'edit',\n\t\tfixedToolbar: false,\n\t\tfocusMode: false,\n\t\tinactivePanels: [],\n\t\tkeepCaretInsideBlock: false,\n\t\topenPanels: [ 'post-status' ],\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowListViewByDefault: false,\n\t\tenableChoosePatternModal: true,\n\t} );\n\n\tif ( window.__experimentalMediaProcessing ) {\n\t\tdispatch( preferencesStore ).setDefaults( 'core/media', {\n\t\t\trequireApproval: true,\n\t\t\toptimizeOnUpload: true,\n\t\t} );\n\t}\n\n\tdispatch( editSiteStore ).updateSettings( settings );\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render(\n\t\t<StrictMode>\n\t\t\t<App />\n\t\t</StrictMode>\n\t);\n\n\treturn root;\n}\n\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editSite.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { default as PluginTemplateSettingPanel } from './components/plugin-template-setting-panel';\nexport { store } from './store';\nexport * from './deprecated';\n\n// Temporary: While the posts dashboard is being iterated on\n// it's being built in the same package as the site editor.\nexport { initializePostsDashboard } from './posts';\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SACCC,kBAAkB,EAClBC,2BAA2B,EAC3BC,4CAA4C,QACtC,0BAA0B;AACjC,SAASC,QAAQ,QAAQ,iBAAiB;AAC1C,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;AAC3D,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;AACpE,SAASV,KAAK,IAAIW,gBAAgB,QAAQ,wBAAwB;AAClE,SACCC,yBAAyB,EACzBC,wBAAwB,QAClB,oBAAoB;;AAE3B;AACA;AACA;AACA,OAAO,SAAS;AAChB,SAASb,KAAK,IAAIc,aAAa,QAAQ,SAAS;AAChD,SAASC,MAAM,QAAQ,eAAe;AACtC,OAAOC,GAAG,MAAM,kBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEnC,MAAM;EAAEC;AAAiC,CAAC,GAAGJ,MAAM,CAAEL,iBAAkB,CAAC;;AAExE;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASU,gBAAgBA,CAAEC,EAAE,EAAEC,QAAQ,EAAG;EAChD,MAAMC,MAAM,GAAGC,QAAQ,CAACC,cAAc,CAAEJ,EAAG,CAAC;EAC5C,MAAMK,IAAI,GAAGnB,UAAU,CAAEgB,MAAO,CAAC;EAEjClB,QAAQ,CAAEJ,WAAY,CAAC,CAAC0B,uBAAuB,CAAC,CAAC;EACjD,MAAMC,UAAU,GAAGzB,2BAA2B,CAAC,CAAC,CAAC0B,MAAM,CACtD,CAAE;IAAEC;EAAK,CAAC,KAAMA,IAAI,KAAK,eAC1B,CAAC;EACD5B,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