@wordpress/editor 14.33.3-next.36001005c.0 → 14.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (353) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/bindings/post-data.js +10 -17
  3. package/build/bindings/post-data.js.map +2 -2
  4. package/build/bindings/post-meta.js +7 -14
  5. package/build/bindings/post-meta.js.map +2 -2
  6. package/build/bindings/term-data.js +6 -16
  7. package/build/bindings/term-data.js.map +2 -2
  8. package/build/components/collab-sidebar/add-comment.js +26 -3
  9. package/build/components/collab-sidebar/add-comment.js.map +3 -3
  10. package/build/components/collab-sidebar/comment-author-info.js +26 -14
  11. package/build/components/collab-sidebar/comment-author-info.js.map +2 -2
  12. package/build/components/collab-sidebar/comment-indicator-toolbar.js +6 -22
  13. package/build/components/collab-sidebar/comment-indicator-toolbar.js.map +3 -3
  14. package/build/components/collab-sidebar/comments.js +105 -28
  15. package/build/components/collab-sidebar/comments.js.map +3 -3
  16. package/build/components/collab-sidebar/hooks.js +3 -4
  17. package/build/components/collab-sidebar/hooks.js.map +2 -2
  18. package/build/components/collab-sidebar/index.js +42 -57
  19. package/build/components/collab-sidebar/index.js.map +3 -3
  20. package/build/components/document-bar/index.js +16 -3
  21. package/build/components/document-bar/index.js.map +2 -2
  22. package/build/components/editor/index.js +25 -4
  23. package/build/components/editor/index.js.map +3 -3
  24. package/build/components/editor-interface/index.js +15 -10
  25. package/build/components/editor-interface/index.js.map +3 -3
  26. package/build/components/entities-saved-states/entity-type-list.js +19 -15
  27. package/build/components/entities-saved-states/entity-type-list.js.map +3 -3
  28. package/build/components/global-styles/block-link.js +70 -0
  29. package/build/components/global-styles/block-link.js.map +7 -0
  30. package/build/components/global-styles/header.js +54 -0
  31. package/build/components/global-styles/header.js.map +7 -0
  32. package/build/components/global-styles/hooks.js +176 -0
  33. package/build/components/global-styles/hooks.js.map +7 -0
  34. package/build/components/global-styles/index.js +138 -0
  35. package/build/components/global-styles/index.js.map +7 -0
  36. package/build/components/global-styles/menu.js +95 -0
  37. package/build/components/global-styles/menu.js.map +7 -0
  38. package/build/components/global-styles-provider/index.js +3 -49
  39. package/build/components/global-styles-provider/index.js.map +3 -3
  40. package/build/components/global-styles-renderer/index.js +55 -0
  41. package/build/components/global-styles-renderer/index.js.map +7 -0
  42. package/build/components/global-styles-sidebar/default-sidebar.js +66 -0
  43. package/build/components/global-styles-sidebar/default-sidebar.js.map +7 -0
  44. package/build/components/global-styles-sidebar/index.js +182 -0
  45. package/build/components/global-styles-sidebar/index.js.map +7 -0
  46. package/build/components/global-styles-sidebar/welcome-guide-image.js +37 -0
  47. package/build/components/global-styles-sidebar/welcome-guide-image.js.map +7 -0
  48. package/build/components/global-styles-sidebar/welcome-guide.js +143 -0
  49. package/build/components/global-styles-sidebar/welcome-guide.js.map +7 -0
  50. package/build/components/header/index.js +12 -12
  51. package/build/components/header/index.js.map +3 -3
  52. package/build/components/post-featured-image/index.js +32 -1
  53. package/build/components/post-featured-image/index.js.map +3 -3
  54. package/build/components/post-template/hooks.js +7 -38
  55. package/build/components/post-template/hooks.js.map +2 -2
  56. package/build/components/provider/index.js +1 -1
  57. package/build/components/provider/index.js.map +2 -2
  58. package/build/components/style-book/categories.js +86 -0
  59. package/build/components/style-book/categories.js.map +7 -0
  60. package/build/components/style-book/color-examples.js +64 -0
  61. package/build/components/style-book/color-examples.js.map +7 -0
  62. package/build/components/style-book/constants.js +319 -0
  63. package/build/components/style-book/constants.js.map +7 -0
  64. package/build/components/style-book/duotone-examples.js +68 -0
  65. package/build/components/style-book/duotone-examples.js.map +7 -0
  66. package/build/components/style-book/examples.js +237 -0
  67. package/build/components/style-book/examples.js.map +7 -0
  68. package/build/components/style-book/index.js +627 -0
  69. package/build/components/style-book/index.js.map +7 -0
  70. package/build/components/style-book/types.js +17 -0
  71. package/build/components/style-book/types.js.map +7 -0
  72. package/build/components/styles-canvas/index.js +138 -0
  73. package/build/components/styles-canvas/index.js.map +7 -0
  74. package/build/components/styles-canvas/revisions.js +121 -0
  75. package/build/components/styles-canvas/revisions.js.map +7 -0
  76. package/build/components/styles-canvas/style-book.js +68 -0
  77. package/build/components/styles-canvas/style-book.js.map +7 -0
  78. package/build/components/visual-editor/index.js +4 -3
  79. package/build/components/visual-editor/index.js.map +2 -2
  80. package/build/dataviews/fields/content-preview/content-preview-view.js.map +2 -2
  81. package/build/hooks/index.js +1 -0
  82. package/build/hooks/index.js.map +2 -2
  83. package/build/hooks/media-upload.js +15 -4
  84. package/build/hooks/media-upload.js.map +3 -3
  85. package/build/hooks/push-changes-to-global-styles/index.js +322 -0
  86. package/build/hooks/push-changes-to-global-styles/index.js.map +7 -0
  87. package/build/hooks/use-global-styles-output.js +74 -0
  88. package/build/hooks/use-global-styles-output.js.map +7 -0
  89. package/build/private-apis.js +10 -5
  90. package/build/private-apis.js.map +3 -3
  91. package/build/store/actions.js +1 -1
  92. package/build/store/actions.js.map +2 -2
  93. package/build/store/private-actions.js +23 -0
  94. package/build/store/private-actions.js.map +2 -2
  95. package/build/store/private-selectors.js +10 -0
  96. package/build/store/private-selectors.js.map +2 -2
  97. package/build/store/reducer.js +24 -0
  98. package/build/store/reducer.js.map +2 -2
  99. package/build/{components/editor-interface/content-slot-fill.js → utils/set-nested-value.js} +24 -10
  100. package/build/utils/set-nested-value.js.map +7 -0
  101. package/build-module/bindings/post-data.js +10 -17
  102. package/build-module/bindings/post-data.js.map +2 -2
  103. package/build-module/bindings/post-meta.js +7 -14
  104. package/build-module/bindings/post-meta.js.map +2 -2
  105. package/build-module/bindings/term-data.js +6 -16
  106. package/build-module/bindings/term-data.js.map +2 -2
  107. package/build-module/components/collab-sidebar/add-comment.js +27 -4
  108. package/build-module/components/collab-sidebar/add-comment.js.map +2 -2
  109. package/build-module/components/collab-sidebar/comment-author-info.js +26 -14
  110. package/build-module/components/collab-sidebar/comment-author-info.js.map +2 -2
  111. package/build-module/components/collab-sidebar/comment-indicator-toolbar.js +6 -12
  112. package/build-module/components/collab-sidebar/comment-indicator-toolbar.js.map +2 -2
  113. package/build-module/components/collab-sidebar/comments.js +114 -31
  114. package/build-module/components/collab-sidebar/comments.js.map +2 -2
  115. package/build-module/components/collab-sidebar/hooks.js +3 -4
  116. package/build-module/components/collab-sidebar/hooks.js.map +2 -2
  117. package/build-module/components/collab-sidebar/index.js +42 -57
  118. package/build-module/components/collab-sidebar/index.js.map +2 -2
  119. package/build-module/components/document-bar/index.js +16 -3
  120. package/build-module/components/document-bar/index.js.map +2 -2
  121. package/build-module/components/editor/index.js +25 -4
  122. package/build-module/components/editor/index.js.map +2 -2
  123. package/build-module/components/editor-interface/index.js +15 -10
  124. package/build-module/components/editor-interface/index.js.map +2 -2
  125. package/build-module/components/entities-saved-states/entity-type-list.js +18 -14
  126. package/build-module/components/entities-saved-states/entity-type-list.js.map +2 -2
  127. package/build-module/components/global-styles/block-link.js +46 -0
  128. package/build-module/components/global-styles/block-link.js.map +7 -0
  129. package/build-module/components/global-styles/header.js +41 -0
  130. package/build-module/components/global-styles/header.js.map +7 -0
  131. package/build-module/components/global-styles/hooks.js +154 -0
  132. package/build-module/components/global-styles/hooks.js.map +7 -0
  133. package/build-module/components/global-styles/index.js +112 -0
  134. package/build-module/components/global-styles/index.js.map +7 -0
  135. package/build-module/components/global-styles/menu.js +71 -0
  136. package/build-module/components/global-styles/menu.js.map +7 -0
  137. package/build-module/components/global-styles-provider/index.js +3 -37
  138. package/build-module/components/global-styles-provider/index.js.map +2 -2
  139. package/build-module/components/global-styles-renderer/index.js +31 -0
  140. package/build-module/components/global-styles-renderer/index.js.map +7 -0
  141. package/build-module/components/global-styles-sidebar/default-sidebar.js +49 -0
  142. package/build-module/components/global-styles-sidebar/default-sidebar.js.map +7 -0
  143. package/build-module/components/global-styles-sidebar/index.js +152 -0
  144. package/build-module/components/global-styles-sidebar/index.js.map +7 -0
  145. package/build-module/components/global-styles-sidebar/welcome-guide-image.js +17 -0
  146. package/build-module/components/global-styles-sidebar/welcome-guide-image.js.map +7 -0
  147. package/build-module/components/global-styles-sidebar/welcome-guide.js +113 -0
  148. package/build-module/components/global-styles-sidebar/welcome-guide.js.map +7 -0
  149. package/build-module/components/header/index.js +12 -12
  150. package/build-module/components/header/index.js.map +2 -2
  151. package/build-module/components/post-featured-image/index.js +35 -3
  152. package/build-module/components/post-featured-image/index.js.map +2 -2
  153. package/build-module/components/post-template/hooks.js +7 -38
  154. package/build-module/components/post-template/hooks.js.map +2 -2
  155. package/build-module/components/provider/index.js +1 -1
  156. package/build-module/components/provider/index.js.map +2 -2
  157. package/build-module/components/style-book/categories.js +64 -0
  158. package/build-module/components/style-book/categories.js.map +7 -0
  159. package/build-module/components/style-book/color-examples.js +37 -0
  160. package/build-module/components/style-book/color-examples.js.map +7 -0
  161. package/build-module/components/style-book/constants.js +290 -0
  162. package/build-module/components/style-book/constants.js.map +7 -0
  163. package/build-module/components/style-book/duotone-examples.js +48 -0
  164. package/build-module/components/style-book/duotone-examples.js.map +7 -0
  165. package/build-module/components/style-book/examples.js +208 -0
  166. package/build-module/components/style-book/examples.js.map +7 -0
  167. package/build-module/components/style-book/index.js +618 -0
  168. package/build-module/components/style-book/index.js.map +7 -0
  169. package/build-module/components/style-book/types.js +1 -0
  170. package/build-module/components/style-book/types.js.map +7 -0
  171. package/build-module/components/styles-canvas/index.js +104 -0
  172. package/build-module/components/styles-canvas/index.js.map +7 -0
  173. package/build-module/components/styles-canvas/revisions.js +107 -0
  174. package/build-module/components/styles-canvas/revisions.js.map +7 -0
  175. package/build-module/components/styles-canvas/style-book.js +38 -0
  176. package/build-module/components/styles-canvas/style-book.js.map +7 -0
  177. package/build-module/components/visual-editor/index.js +4 -3
  178. package/build-module/components/visual-editor/index.js.map +2 -2
  179. package/build-module/dataviews/fields/content-preview/content-preview-view.js.map +2 -2
  180. package/build-module/hooks/index.js +1 -0
  181. package/build-module/hooks/index.js.map +2 -2
  182. package/build-module/hooks/media-upload.js +19 -5
  183. package/build-module/hooks/media-upload.js.map +2 -2
  184. package/build-module/hooks/push-changes-to-global-styles/index.js +309 -0
  185. package/build-module/hooks/push-changes-to-global-styles/index.js.map +7 -0
  186. package/build-module/hooks/use-global-styles-output.js +49 -0
  187. package/build-module/hooks/use-global-styles-output.js.map +7 -0
  188. package/build-module/private-apis.js +10 -8
  189. package/build-module/private-apis.js.map +2 -2
  190. package/build-module/store/actions.js +1 -1
  191. package/build-module/store/actions.js.map +2 -2
  192. package/build-module/store/private-actions.js +20 -0
  193. package/build-module/store/private-actions.js.map +2 -2
  194. package/build-module/store/private-selectors.js +8 -0
  195. package/build-module/store/private-selectors.js.map +2 -2
  196. package/build-module/store/reducer.js +22 -0
  197. package/build-module/store/reducer.js.map +2 -2
  198. package/build-module/utils/set-nested-value.js +23 -0
  199. package/build-module/utils/set-nested-value.js.map +7 -0
  200. package/build-style/style-rtl.css +3011 -16
  201. package/build-style/style.css +3012 -16
  202. package/build-types/bindings/post-data.d.ts +6 -16
  203. package/build-types/bindings/post-meta.d.ts +6 -13
  204. package/build-types/bindings/term-data.d.ts +6 -16
  205. package/build-types/components/collab-sidebar/add-comment.d.ts +6 -1
  206. package/build-types/components/collab-sidebar/add-comment.d.ts.map +1 -1
  207. package/build-types/components/collab-sidebar/comment-author-info.d.ts +5 -16
  208. package/build-types/components/collab-sidebar/comment-author-info.d.ts.map +1 -1
  209. package/build-types/components/collab-sidebar/comment-indicator-toolbar.d.ts +1 -2
  210. package/build-types/components/collab-sidebar/comment-indicator-toolbar.d.ts.map +1 -1
  211. package/build-types/components/collab-sidebar/comments.d.ts +12 -26
  212. package/build-types/components/collab-sidebar/comments.d.ts.map +1 -1
  213. package/build-types/components/collab-sidebar/hooks.d.ts +0 -1
  214. package/build-types/components/collab-sidebar/hooks.d.ts.map +1 -1
  215. package/build-types/components/collab-sidebar/index.d.ts +1 -4
  216. package/build-types/components/collab-sidebar/index.d.ts.map +1 -1
  217. package/build-types/components/document-bar/index.d.ts +2 -2
  218. package/build-types/components/document-bar/index.d.ts.map +1 -1
  219. package/build-types/components/editor/index.d.ts.map +1 -1
  220. package/build-types/components/editor-interface/index.d.ts +1 -3
  221. package/build-types/components/editor-interface/index.d.ts.map +1 -1
  222. package/build-types/components/entities-saved-states/entity-type-list.d.ts.map +1 -1
  223. package/build-types/components/global-styles/block-link.d.ts +12 -0
  224. package/build-types/components/global-styles/block-link.d.ts.map +1 -0
  225. package/build-types/components/global-styles/header.d.ts +7 -0
  226. package/build-types/components/global-styles/header.d.ts.map +1 -0
  227. package/build-types/components/global-styles/hooks.d.ts +24 -0
  228. package/build-types/components/global-styles/hooks.d.ts.map +1 -0
  229. package/build-types/components/global-styles/index.d.ts +6 -0
  230. package/build-types/components/global-styles/index.d.ts.map +1 -0
  231. package/build-types/components/global-styles/menu.d.ts +13 -0
  232. package/build-types/components/global-styles/menu.d.ts.map +1 -0
  233. package/build-types/components/global-styles-provider/index.d.ts +1 -5
  234. package/build-types/components/global-styles-provider/index.d.ts.map +1 -1
  235. package/build-types/components/global-styles-renderer/index.d.ts +4 -0
  236. package/build-types/components/global-styles-renderer/index.d.ts.map +1 -0
  237. package/build-types/components/global-styles-sidebar/default-sidebar.d.ts +13 -0
  238. package/build-types/components/global-styles-sidebar/default-sidebar.d.ts.map +1 -0
  239. package/build-types/components/global-styles-sidebar/index.d.ts +2 -0
  240. package/build-types/components/global-styles-sidebar/index.d.ts.map +1 -0
  241. package/build-types/components/global-styles-sidebar/welcome-guide-image.d.ts +5 -0
  242. package/build-types/components/global-styles-sidebar/welcome-guide-image.d.ts.map +1 -0
  243. package/build-types/components/global-styles-sidebar/welcome-guide.d.ts +2 -0
  244. package/build-types/components/global-styles-sidebar/welcome-guide.d.ts.map +1 -0
  245. package/build-types/components/header/index.d.ts +1 -3
  246. package/build-types/components/header/index.d.ts.map +1 -1
  247. package/build-types/components/post-template/hooks.d.ts +1 -1
  248. package/build-types/components/post-template/hooks.d.ts.map +1 -1
  249. package/build-types/components/provider/index.d.ts.map +1 -1
  250. package/build-types/components/style-book/categories.d.ts +18 -0
  251. package/build-types/components/style-book/categories.d.ts.map +1 -0
  252. package/build-types/components/style-book/color-examples.d.ts +7 -0
  253. package/build-types/components/style-book/color-examples.d.ts.map +1 -0
  254. package/build-types/components/style-book/constants.d.ts +11 -0
  255. package/build-types/components/style-book/constants.d.ts.map +1 -0
  256. package/build-types/components/style-book/duotone-examples.d.ts +9 -0
  257. package/build-types/components/style-book/duotone-examples.d.ts.map +1 -0
  258. package/build-types/components/style-book/examples.d.ts +12 -0
  259. package/build-types/components/style-book/examples.d.ts.map +1 -0
  260. package/build-types/components/style-book/index.d.ts +31 -0
  261. package/build-types/components/style-book/index.d.ts.map +1 -0
  262. package/build-types/components/style-book/types.d.ts +72 -0
  263. package/build-types/components/style-book/types.d.ts.map +1 -0
  264. package/build-types/components/styles-canvas/index.d.ts +16 -0
  265. package/build-types/components/styles-canvas/index.d.ts.map +1 -0
  266. package/build-types/components/styles-canvas/revisions.d.ts +5 -0
  267. package/build-types/components/styles-canvas/revisions.d.ts.map +1 -0
  268. package/build-types/components/styles-canvas/style-book.d.ts +6 -0
  269. package/build-types/components/styles-canvas/style-book.d.ts.map +1 -0
  270. package/build-types/components/visual-editor/index.d.ts +1 -2
  271. package/build-types/components/visual-editor/index.d.ts.map +1 -1
  272. package/build-types/dataviews/fields/content-preview/content-preview-view.d.ts.map +1 -1
  273. package/build-types/hooks/push-changes-to-global-styles/index.d.ts +2 -0
  274. package/build-types/hooks/push-changes-to-global-styles/index.d.ts.map +1 -0
  275. package/build-types/hooks/use-global-styles-output.d.ts +18 -0
  276. package/build-types/hooks/use-global-styles-output.d.ts.map +1 -0
  277. package/build-types/private-apis.d.ts.map +1 -1
  278. package/build-types/store/actions.d.ts.map +1 -1
  279. package/build-types/store/private-actions.d.ts +20 -0
  280. package/build-types/store/private-actions.d.ts.map +1 -1
  281. package/build-types/store/private-selectors.d.ts +14 -0
  282. package/build-types/store/private-selectors.d.ts.map +1 -1
  283. package/build-types/store/reducer.d.ts +20 -0
  284. package/build-types/store/reducer.d.ts.map +1 -1
  285. package/build-types/utils/set-nested-value.d.ts +20 -0
  286. package/build-types/utils/set-nested-value.d.ts.map +1 -0
  287. package/package.json +40 -40
  288. package/src/bindings/post-data.js +9 -20
  289. package/src/bindings/post-meta.js +6 -17
  290. package/src/bindings/term-data.js +6 -21
  291. package/src/components/collab-sidebar/add-comment.js +31 -3
  292. package/src/components/collab-sidebar/comment-author-info.js +32 -25
  293. package/src/components/collab-sidebar/comment-indicator-toolbar.js +6 -22
  294. package/src/components/collab-sidebar/comments.js +108 -35
  295. package/src/components/collab-sidebar/hooks.js +3 -4
  296. package/src/components/collab-sidebar/index.js +34 -42
  297. package/src/components/collab-sidebar/style.scss +1 -22
  298. package/src/components/document-bar/index.js +18 -3
  299. package/src/components/editor/index.js +27 -1
  300. package/src/components/editor-interface/index.js +40 -39
  301. package/src/components/entities-saved-states/entity-type-list.js +19 -17
  302. package/src/components/global-styles/block-link.js +65 -0
  303. package/src/components/global-styles/header.js +48 -0
  304. package/src/components/global-styles/hooks.js +216 -0
  305. package/src/components/global-styles/index.js +125 -0
  306. package/src/components/global-styles/menu.js +101 -0
  307. package/src/components/global-styles/style.scss +11 -0
  308. package/src/components/global-styles-provider/index.js +3 -45
  309. package/src/components/global-styles-renderer/index.js +39 -0
  310. package/src/components/global-styles-sidebar/default-sidebar.js +46 -0
  311. package/src/components/global-styles-sidebar/index.js +177 -0
  312. package/src/components/global-styles-sidebar/style.scss +119 -0
  313. package/src/components/global-styles-sidebar/welcome-guide-image.js +11 -0
  314. package/src/components/global-styles-sidebar/welcome-guide.js +136 -0
  315. package/src/components/header/index.js +11 -13
  316. package/src/components/post-featured-image/index.js +44 -1
  317. package/src/components/post-template/hooks.js +10 -51
  318. package/src/components/provider/index.js +1 -4
  319. package/src/components/style-book/categories.ts +97 -0
  320. package/src/components/style-book/color-examples.tsx +56 -0
  321. package/src/components/style-book/constants.ts +308 -0
  322. package/src/components/style-book/duotone-examples.tsx +56 -0
  323. package/src/components/style-book/examples.tsx +273 -0
  324. package/src/components/style-book/index.js +794 -0
  325. package/src/components/style-book/style.scss +44 -0
  326. package/src/components/style-book/test/categories.js +166 -0
  327. package/src/components/style-book/types.ts +80 -0
  328. package/src/components/styles-canvas/index.js +126 -0
  329. package/src/components/styles-canvas/revisions.js +144 -0
  330. package/src/components/styles-canvas/style-book.js +57 -0
  331. package/src/components/styles-canvas/style.scss +40 -0
  332. package/src/components/visual-editor/index.js +2 -1
  333. package/src/dataviews/fields/content-preview/content-preview-view.tsx +2 -0
  334. package/src/hooks/index.js +1 -0
  335. package/src/hooks/media-upload.js +25 -5
  336. package/src/hooks/push-changes-to-global-styles/index.js +391 -0
  337. package/src/hooks/push-changes-to-global-styles/style.scss +4 -0
  338. package/src/hooks/use-global-styles-output.js +76 -0
  339. package/src/private-apis.js +10 -8
  340. package/src/store/actions.js +4 -1
  341. package/src/store/private-actions.js +37 -0
  342. package/src/store/private-selectors.js +20 -0
  343. package/src/store/reducer.js +36 -0
  344. package/src/style.scss +7 -0
  345. package/src/utils/set-nested-value.js +39 -0
  346. package/tsconfig.json +3 -0
  347. package/tsconfig.tsbuildinfo +1 -1
  348. package/build/components/editor-interface/content-slot-fill.js.map +0 -7
  349. package/build-module/components/editor-interface/content-slot-fill.js +0 -9
  350. package/build-module/components/editor-interface/content-slot-fill.js.map +0 -7
  351. package/build-types/components/editor-interface/content-slot-fill.d.ts +0 -14
  352. package/build-types/components/editor-interface/content-slot-fill.d.ts.map +0 -1
  353. package/src/components/editor-interface/content-slot-fill.js +0 -10
@@ -156,7 +156,7 @@ const ExperimentalEditorProvider = (0, import_with_registry_provider.default)(
156
156
  const rootLevelPost = shouldRenderTemplate ? template : post;
157
157
  const defaultBlockContext = (0, import_element.useMemo)(() => {
158
158
  const postContext = {};
159
- if (post.type === "wp_template" || post.type === "wp_registered_template") {
159
+ if (post.type === "wp_template") {
160
160
  if (post.slug === "page") {
161
161
  postContext.postType = "page";
162
162
  } else if (post.slug === "single") {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/provider/index.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useEffect, useLayoutEffect, useMemo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tEntityProvider,\n\tuseEntityBlockEditor,\n\tstore as coreStore,\n} from '@wordpress/core-data';\nimport {\n\tBlockEditorProvider,\n\tBlockContextProvider,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { privateApis as editPatternsPrivateApis } from '@wordpress/patterns';\nimport { createBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport withRegistryProvider from './with-registry-provider';\nimport { store as editorStore } from '../../store';\nimport useBlockEditorSettings from './use-block-editor-settings';\nimport { unlock } from '../../lock-unlock';\nimport DisableNonPageContentBlocks from './disable-non-page-content-blocks';\nimport NavigationBlockEditingMode from './navigation-block-editing-mode';\nimport { useHideBlocksFromInserter } from './use-hide-blocks-from-inserter';\nimport useCommands from '../commands';\nimport BlockRemovalWarnings from '../block-removal-warnings';\nimport StartPageOptions from '../start-page-options';\nimport KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';\nimport StartTemplateOptions from '../start-template-options';\nimport EditorKeyboardShortcuts from '../global-keyboard-shortcuts';\nimport PatternRenameModal from '../pattern-rename-modal';\nimport PatternDuplicateModal from '../pattern-duplicate-modal';\nimport TemplatePartMenuItems from '../template-part-menu-items';\n\nconst { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );\nconst { PatternsMenuItems } = unlock( editPatternsPrivateApis );\n\nconst noop = () => {};\n\n/**\n * These are global entities that are only there to split blocks into logical units\n * They don't provide a \"context\" for the current post/page being rendered.\n * So we should not use their ids as post context. This is important to allow post blocks\n * (post content, post title) to be used within them without issues.\n */\nconst NON_CONTEXTUAL_POST_TYPES = [\n\t'wp_block',\n\t'wp_navigation',\n\t'wp_template_part',\n];\n\n/**\n * Depending on the post, template and template mode,\n * returns the appropriate blocks and change handlers for the block editor provider.\n *\n * @param {Array} post Block list.\n * @param {boolean} template Whether the page content has focus (and the surrounding template is inert). If `true` return page content blocks. Default `false`.\n * @param {string} mode Rendering mode.\n *\n * @example\n * ```jsx\n * const [ blocks, onInput, onChange ] = useBlockEditorProps( post, template, mode );\n * ```\n *\n * @return {Array} Block editor props.\n */\nfunction useBlockEditorProps( post, template, mode ) {\n\tconst rootLevelPost = mode === 'template-locked' ? 'template' : 'post';\n\tconst [ postBlocks, onInput, onChange ] = useEntityBlockEditor(\n\t\t'postType',\n\t\tpost.type,\n\t\t{ id: post.id }\n\t);\n\tconst [ templateBlocks, onInputTemplate, onChangeTemplate ] =\n\t\tuseEntityBlockEditor( 'postType', template?.type, {\n\t\t\tid: template?.id,\n\t\t} );\n\tconst maybeNavigationBlocks = useMemo( () => {\n\t\tif ( post.type === 'wp_navigation' ) {\n\t\t\treturn [\n\t\t\t\tcreateBlock( 'core/navigation', {\n\t\t\t\t\tref: post.id,\n\t\t\t\t\t// As the parent editor is locked with `templateLock`, the template locking\n\t\t\t\t\t// must be explicitly \"unset\" on the block itself to allow the user to modify\n\t\t\t\t\t// the block's content.\n\t\t\t\t\ttemplateLock: false,\n\t\t\t\t} ),\n\t\t\t];\n\t\t}\n\t}, [ post.type, post.id ] );\n\n\t// It is important that we don't create a new instance of blocks on every change\n\t// We should only create a new instance if the blocks them selves change, not a dependency of them.\n\tconst blocks = useMemo( () => {\n\t\tif ( maybeNavigationBlocks ) {\n\t\t\treturn maybeNavigationBlocks;\n\t\t}\n\n\t\tif ( rootLevelPost === 'template' ) {\n\t\t\treturn templateBlocks;\n\t\t}\n\n\t\treturn postBlocks;\n\t}, [ maybeNavigationBlocks, rootLevelPost, templateBlocks, postBlocks ] );\n\n\t// Handle fallback to postBlocks outside of the above useMemo, to ensure\n\t// that constructed block templates that call `createBlock` are not generated\n\t// too frequently. This ensures that clientIds are stable.\n\tconst disableRootLevelChanges =\n\t\t( !! template && mode === 'template-locked' ) ||\n\t\tpost.type === 'wp_navigation';\n\tif ( disableRootLevelChanges ) {\n\t\treturn [ blocks, noop, noop ];\n\t}\n\n\treturn [\n\t\tblocks,\n\t\trootLevelPost === 'post' ? onInput : onInputTemplate,\n\t\trootLevelPost === 'post' ? onChange : onChangeTemplate,\n\t];\n}\n\n/**\n * This component provides the editor context and manages the state of the block editor.\n *\n * @param {Object} props The component props.\n * @param {Object} props.post The post object.\n * @param {Object} props.settings The editor settings.\n * @param {boolean} props.recovery Indicates if the editor is in recovery mode.\n * @param {Array} props.initialEdits The initial edits for the editor.\n * @param {Object} props.children The child components.\n * @param {Object} [props.BlockEditorProviderComponent] The block editor provider component to use. Defaults to ExperimentalBlockEditorProvider.\n * @param {Object} [props.__unstableTemplate] The template object.\n *\n * @example\n * ```jsx\n * <ExperimentalEditorProvider\n * post={ post }\n * settings={ settings }\n * recovery={ recovery }\n * initialEdits={ initialEdits }\n * __unstableTemplate={ template }\n * >\n * { children }\n * </ExperimentalEditorProvider>\n *\n * @return {Object} The rendered ExperimentalEditorProvider component.\n */\nexport const ExperimentalEditorProvider = withRegistryProvider(\n\t( {\n\t\tpost,\n\t\tsettings,\n\t\trecovery,\n\t\tinitialEdits,\n\t\tchildren,\n\t\tBlockEditorProviderComponent = ExperimentalBlockEditorProvider,\n\t\t__unstableTemplate: template,\n\t} ) => {\n\t\tconst hasTemplate = !! template;\n\t\tconst {\n\t\t\teditorSettings,\n\t\t\tselection,\n\t\t\tisReady,\n\t\t\tmode,\n\t\t\tdefaultMode,\n\t\t\tpostTypeEntities,\n\t\t} = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\tgetEditorSettings,\n\t\t\t\t\tgetEditorSelection,\n\t\t\t\t\tgetRenderingMode,\n\t\t\t\t\t__unstableIsEditorReady,\n\t\t\t\t\tgetDefaultRenderingMode,\n\t\t\t\t} = unlock( select( editorStore ) );\n\t\t\t\tconst { getEntitiesConfig } = select( coreStore );\n\n\t\t\t\tconst _mode = getRenderingMode();\n\t\t\t\tconst _defaultMode = getDefaultRenderingMode( post.type );\n\t\t\t\t/**\n\t\t\t\t * To avoid content \"flash\", wait until rendering mode has been resolved.\n\t\t\t\t * This is important for the initial render of the editor.\n\t\t\t\t *\n\t\t\t\t * - Wait for template to be resolved if the default mode is 'template-locked'.\n\t\t\t\t * - Wait for default mode to be resolved otherwise.\n\t\t\t\t */\n\t\t\t\tconst hasResolvedDefaultMode =\n\t\t\t\t\t_defaultMode === 'template-locked'\n\t\t\t\t\t\t? hasTemplate\n\t\t\t\t\t\t: _defaultMode !== undefined;\n\t\t\t\t// Wait until the default mode is retrieved and start rendering canvas.\n\t\t\t\tconst isRenderingModeReady = _defaultMode !== undefined;\n\n\t\t\t\treturn {\n\t\t\t\t\teditorSettings: getEditorSettings(),\n\t\t\t\t\tisReady: __unstableIsEditorReady(),\n\t\t\t\t\tmode: isRenderingModeReady ? _mode : undefined,\n\t\t\t\t\tdefaultMode: hasResolvedDefaultMode\n\t\t\t\t\t\t? _defaultMode\n\t\t\t\t\t\t: undefined,\n\t\t\t\t\tselection: getEditorSelection(),\n\t\t\t\t\tpostTypeEntities:\n\t\t\t\t\t\tpost.type === 'wp_template'\n\t\t\t\t\t\t\t? getEntitiesConfig( 'postType' )\n\t\t\t\t\t\t\t: null,\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ post.type, hasTemplate ]\n\t\t);\n\n\t\tconst shouldRenderTemplate = hasTemplate && mode !== 'post-only';\n\t\tconst rootLevelPost = shouldRenderTemplate ? template : post;\n\t\tconst defaultBlockContext = useMemo( () => {\n\t\t\tconst postContext = {};\n\t\t\t// If it is a template, try to inherit the post type from the name.\n\t\t\tif (\n\t\t\t\tpost.type === 'wp_template' ||\n\t\t\t\tpost.type === 'wp_registered_template'\n\t\t\t) {\n\t\t\t\tif ( post.slug === 'page' ) {\n\t\t\t\t\tpostContext.postType = 'page';\n\t\t\t\t} else if ( post.slug === 'single' ) {\n\t\t\t\t\tpostContext.postType = 'post';\n\t\t\t\t} else if ( post.slug.split( '-' )[ 0 ] === 'single' ) {\n\t\t\t\t\t// If the slug is single-{postType}, infer the post type from the name.\n\t\t\t\t\tconst postTypeNames =\n\t\t\t\t\t\tpostTypeEntities?.map( ( entity ) => entity.name ) ||\n\t\t\t\t\t\t[];\n\t\t\t\t\tconst match = post.slug.match(\n\t\t\t\t\t\t`^single-(${ postTypeNames.join( '|' ) })(?:-.+)?$`\n\t\t\t\t\t);\n\t\t\t\t\tif ( match ) {\n\t\t\t\t\t\tpostContext.postType = match[ 1 ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\t! NON_CONTEXTUAL_POST_TYPES.includes( rootLevelPost.type ) ||\n\t\t\t\tshouldRenderTemplate\n\t\t\t) {\n\t\t\t\tpostContext.postId = post.id;\n\t\t\t\tpostContext.postType = post.type;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...postContext,\n\t\t\t\ttemplateSlug:\n\t\t\t\t\trootLevelPost.type === 'wp_template'\n\t\t\t\t\t\t? rootLevelPost.slug\n\t\t\t\t\t\t: undefined,\n\t\t\t};\n\t\t}, [\n\t\t\tshouldRenderTemplate,\n\t\t\tpost.id,\n\t\t\tpost.type,\n\t\t\tpost.slug,\n\t\t\trootLevelPost.type,\n\t\t\trootLevelPost.slug,\n\t\t\tpostTypeEntities,\n\t\t] );\n\t\tconst { id, type } = rootLevelPost;\n\t\tconst blockEditorSettings = useBlockEditorSettings(\n\t\t\teditorSettings,\n\t\t\ttype,\n\t\t\tid,\n\t\t\tmode\n\t\t);\n\t\tconst [ blocks, onInput, onChange ] = useBlockEditorProps(\n\t\t\tpost,\n\t\t\ttemplate,\n\t\t\tmode\n\t\t);\n\n\t\tconst {\n\t\t\tupdatePostLock,\n\t\t\tsetupEditor,\n\t\t\tupdateEditorSettings,\n\t\t\tsetCurrentTemplateId,\n\t\t\tsetEditedPost,\n\t\t\tsetRenderingMode,\n\t\t} = unlock( useDispatch( editorStore ) );\n\t\tconst { createWarningNotice, removeNotice } =\n\t\t\tuseDispatch( noticesStore );\n\n\t\t// Ideally this should be synced on each change and not just something you do once.\n\t\tuseLayoutEffect( () => {\n\t\t\t// Assume that we don't need to initialize in the case of an error recovery.\n\t\t\tif ( recovery ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tupdatePostLock( settings.postLock );\n\t\t\tsetupEditor( post, initialEdits, settings.template );\n\t\t\tif ( settings.autosave ) {\n\t\t\t\tcreateWarningNotice(\n\t\t\t\t\t__(\n\t\t\t\t\t\t'There is an autosave of this post that is more recent than the version below.'\n\t\t\t\t\t),\n\t\t\t\t\t{\n\t\t\t\t\t\tid: 'autosave-exists',\n\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'View the autosave' ),\n\t\t\t\t\t\t\t\turl: settings.autosave.editLink,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// The dependencies of the hook are omitted deliberately\n\t\t\t// We only want to run setupEditor (with initialEdits) only once per post.\n\t\t\t// A better solution in the future would be to split this effect into multiple ones.\n\t\t}, [] );\n\n\t\t// Synchronizes the active post with the state\n\t\tuseEffect( () => {\n\t\t\tsetEditedPost( post.type, post.id );\n\t\t\t// Clear any notices dependent on the post context.\n\t\t\tremoveNotice( 'template-activate-notice' );\n\t\t}, [ post.type, post.id, setEditedPost, removeNotice ] );\n\n\t\t// Synchronize the editor settings as they change.\n\t\tuseEffect( () => {\n\t\t\tupdateEditorSettings( settings );\n\t\t}, [ settings, updateEditorSettings ] );\n\n\t\t// Synchronizes the active template with the state.\n\t\tuseEffect( () => {\n\t\t\tsetCurrentTemplateId( template?.id );\n\t\t}, [ template?.id, setCurrentTemplateId ] );\n\n\t\t// Sets the right rendering mode when loading the editor.\n\t\tuseEffect( () => {\n\t\t\tif ( defaultMode ) {\n\t\t\t\tsetRenderingMode( defaultMode );\n\t\t\t}\n\t\t}, [ defaultMode, setRenderingMode ] );\n\n\t\tuseHideBlocksFromInserter( post.type, mode );\n\n\t\t// Register the editor commands.\n\t\tuseCommands();\n\n\t\tif ( ! isReady || ! mode ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (\n\t\t\t<EntityProvider kind=\"root\" type=\"site\">\n\t\t\t\t<EntityProvider\n\t\t\t\t\tkind=\"postType\"\n\t\t\t\t\ttype={ post.type }\n\t\t\t\t\tid={ post.id }\n\t\t\t\t>\n\t\t\t\t\t<BlockContextProvider value={ defaultBlockContext }>\n\t\t\t\t\t\t<BlockEditorProviderComponent\n\t\t\t\t\t\t\tvalue={ blocks }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\tonInput={ onInput }\n\t\t\t\t\t\t\tselection={ selection }\n\t\t\t\t\t\t\tsettings={ blockEditorSettings }\n\t\t\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t{ ! settings.isPreviewMode && (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<PatternsMenuItems />\n\t\t\t\t\t\t\t\t\t<TemplatePartMenuItems />\n\t\t\t\t\t\t\t\t\t{ mode === 'template-locked' && (\n\t\t\t\t\t\t\t\t\t\t<DisableNonPageContentBlocks />\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ type === 'wp_navigation' && (\n\t\t\t\t\t\t\t\t\t\t<NavigationBlockEditingMode />\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t<EditorKeyboardShortcuts />\n\t\t\t\t\t\t\t\t\t<KeyboardShortcutHelpModal />\n\t\t\t\t\t\t\t\t\t<BlockRemovalWarnings />\n\t\t\t\t\t\t\t\t\t<StartPageOptions />\n\t\t\t\t\t\t\t\t\t<StartTemplateOptions />\n\t\t\t\t\t\t\t\t\t<PatternRenameModal />\n\t\t\t\t\t\t\t\t\t<PatternDuplicateModal />\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</BlockEditorProviderComponent>\n\t\t\t\t\t</BlockContextProvider>\n\t\t\t\t</EntityProvider>\n\t\t\t</EntityProvider>\n\t\t);\n\t}\n);\n\n/**\n * This component establishes a new post editing context, and serves as the entry point for a new post editor (or post with template editor).\n *\n * It supports a large number of post types, including post, page, templates,\n * custom post types, patterns, template parts.\n *\n * All modification and changes are performed to the `@wordpress/core-data` store.\n *\n * @param {Object} props The component props.\n * @param {Object} [props.post] The post object to edit. This is required.\n * @param {Object} [props.__unstableTemplate] The template object wrapper the edited post.\n * This is optional and can only be used when the post type supports templates (like posts and pages).\n * @param {Object} [props.settings] The settings object to use for the editor.\n * This is optional and can be used to override the default settings.\n * @param {React.ReactNode} [props.children] Children elements for which the BlockEditorProvider context should apply.\n * This is optional.\n *\n * @example\n * ```jsx\n * <EditorProvider\n * post={ post }\n * settings={ settings }\n * __unstableTemplate={ template }\n * >\n * { children }\n * </EditorProvider>\n * ```\n *\n * @return {React.ReactNode} The rendered EditorProvider component.\n */\nexport function EditorProvider( props ) {\n\treturn (\n\t\t<ExperimentalEditorProvider\n\t\t\t{ ...props }\n\t\t\tBlockEditorProviderComponent={ BlockEditorProvider }\n\t\t>\n\t\t\t{ props.children }\n\t\t</ExperimentalEditorProvider>\n\t);\n}\n\nexport default EditorProvider;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmXQ;AAhXR,qBAAoD;AACpD,kBAAuC;AACvC,kBAAmB;AACnB,uBAIO;AACP,0BAIO;AACP,qBAAsC;AACtC,sBAAuD;AACvD,oBAA4B;AAK5B,oCAAiC;AACjC,mBAAqC;AACrC,uCAAmC;AACnC,yBAAuB;AACvB,6CAAwC;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C,SAAA,EAAsB;AAAA,gBACrB,SAAS,qBACV,4CAAC,uCAAAC,SAAA,EAA4B;AAAA,gBAE5B,SAAS,mBACV,4CAAC,qCAAAC,SAAA,EAA2B;AAAA,gBAE7B,4CAAC,iCAAAC,SAAA,EAAwB;AAAA,gBACzB,4CAAC,oCAAAC,SAAA,EAA0B;AAAA,gBAC3B,4CAAC,8BAAAC,SAAA,EAAqB;AAAA,gBACtB,4CAAC,0BAAAC,SAAA,EAAiB;AAAA,gBAClB,4CAAC,8BAAAC,SAAA,EAAqB;AAAA,gBACtB,4CAAC,4BAAAC,SAAA,EAAmB;AAAA,gBACpB,4CAAC,+BAAAC,SAAA,EAAsB;AAAA,iBACxB;AAAA;AAAA;AAAA,QAEF,GACD;AAAA;AAAA,IACD,GACD;AAAA,EAEF;AACD;AAgCO,SAAS,eAAgB,OAAQ;AACvC,SACC;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACL,8BAA+B;AAAA,MAE7B,gBAAM;AAAA;AAAA,EACT;AAEF;AAEA,IAAO,mBAAQ;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useEffect, useLayoutEffect, useMemo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tEntityProvider,\n\tuseEntityBlockEditor,\n\tstore as coreStore,\n} from '@wordpress/core-data';\nimport {\n\tBlockEditorProvider,\n\tBlockContextProvider,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { privateApis as editPatternsPrivateApis } from '@wordpress/patterns';\nimport { createBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport withRegistryProvider from './with-registry-provider';\nimport { store as editorStore } from '../../store';\nimport useBlockEditorSettings from './use-block-editor-settings';\nimport { unlock } from '../../lock-unlock';\nimport DisableNonPageContentBlocks from './disable-non-page-content-blocks';\nimport NavigationBlockEditingMode from './navigation-block-editing-mode';\nimport { useHideBlocksFromInserter } from './use-hide-blocks-from-inserter';\nimport useCommands from '../commands';\nimport BlockRemovalWarnings from '../block-removal-warnings';\nimport StartPageOptions from '../start-page-options';\nimport KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';\nimport StartTemplateOptions from '../start-template-options';\nimport EditorKeyboardShortcuts from '../global-keyboard-shortcuts';\nimport PatternRenameModal from '../pattern-rename-modal';\nimport PatternDuplicateModal from '../pattern-duplicate-modal';\nimport TemplatePartMenuItems from '../template-part-menu-items';\n\nconst { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );\nconst { PatternsMenuItems } = unlock( editPatternsPrivateApis );\n\nconst noop = () => {};\n\n/**\n * These are global entities that are only there to split blocks into logical units\n * They don't provide a \"context\" for the current post/page being rendered.\n * So we should not use their ids as post context. This is important to allow post blocks\n * (post content, post title) to be used within them without issues.\n */\nconst NON_CONTEXTUAL_POST_TYPES = [\n\t'wp_block',\n\t'wp_navigation',\n\t'wp_template_part',\n];\n\n/**\n * Depending on the post, template and template mode,\n * returns the appropriate blocks and change handlers for the block editor provider.\n *\n * @param {Array} post Block list.\n * @param {boolean} template Whether the page content has focus (and the surrounding template is inert). If `true` return page content blocks. Default `false`.\n * @param {string} mode Rendering mode.\n *\n * @example\n * ```jsx\n * const [ blocks, onInput, onChange ] = useBlockEditorProps( post, template, mode );\n * ```\n *\n * @return {Array} Block editor props.\n */\nfunction useBlockEditorProps( post, template, mode ) {\n\tconst rootLevelPost = mode === 'template-locked' ? 'template' : 'post';\n\tconst [ postBlocks, onInput, onChange ] = useEntityBlockEditor(\n\t\t'postType',\n\t\tpost.type,\n\t\t{ id: post.id }\n\t);\n\tconst [ templateBlocks, onInputTemplate, onChangeTemplate ] =\n\t\tuseEntityBlockEditor( 'postType', template?.type, {\n\t\t\tid: template?.id,\n\t\t} );\n\tconst maybeNavigationBlocks = useMemo( () => {\n\t\tif ( post.type === 'wp_navigation' ) {\n\t\t\treturn [\n\t\t\t\tcreateBlock( 'core/navigation', {\n\t\t\t\t\tref: post.id,\n\t\t\t\t\t// As the parent editor is locked with `templateLock`, the template locking\n\t\t\t\t\t// must be explicitly \"unset\" on the block itself to allow the user to modify\n\t\t\t\t\t// the block's content.\n\t\t\t\t\ttemplateLock: false,\n\t\t\t\t} ),\n\t\t\t];\n\t\t}\n\t}, [ post.type, post.id ] );\n\n\t// It is important that we don't create a new instance of blocks on every change\n\t// We should only create a new instance if the blocks them selves change, not a dependency of them.\n\tconst blocks = useMemo( () => {\n\t\tif ( maybeNavigationBlocks ) {\n\t\t\treturn maybeNavigationBlocks;\n\t\t}\n\n\t\tif ( rootLevelPost === 'template' ) {\n\t\t\treturn templateBlocks;\n\t\t}\n\n\t\treturn postBlocks;\n\t}, [ maybeNavigationBlocks, rootLevelPost, templateBlocks, postBlocks ] );\n\n\t// Handle fallback to postBlocks outside of the above useMemo, to ensure\n\t// that constructed block templates that call `createBlock` are not generated\n\t// too frequently. This ensures that clientIds are stable.\n\tconst disableRootLevelChanges =\n\t\t( !! template && mode === 'template-locked' ) ||\n\t\tpost.type === 'wp_navigation';\n\tif ( disableRootLevelChanges ) {\n\t\treturn [ blocks, noop, noop ];\n\t}\n\n\treturn [\n\t\tblocks,\n\t\trootLevelPost === 'post' ? onInput : onInputTemplate,\n\t\trootLevelPost === 'post' ? onChange : onChangeTemplate,\n\t];\n}\n\n/**\n * This component provides the editor context and manages the state of the block editor.\n *\n * @param {Object} props The component props.\n * @param {Object} props.post The post object.\n * @param {Object} props.settings The editor settings.\n * @param {boolean} props.recovery Indicates if the editor is in recovery mode.\n * @param {Array} props.initialEdits The initial edits for the editor.\n * @param {Object} props.children The child components.\n * @param {Object} [props.BlockEditorProviderComponent] The block editor provider component to use. Defaults to ExperimentalBlockEditorProvider.\n * @param {Object} [props.__unstableTemplate] The template object.\n *\n * @example\n * ```jsx\n * <ExperimentalEditorProvider\n * post={ post }\n * settings={ settings }\n * recovery={ recovery }\n * initialEdits={ initialEdits }\n * __unstableTemplate={ template }\n * >\n * { children }\n * </ExperimentalEditorProvider>\n *\n * @return {Object} The rendered ExperimentalEditorProvider component.\n */\nexport const ExperimentalEditorProvider = withRegistryProvider(\n\t( {\n\t\tpost,\n\t\tsettings,\n\t\trecovery,\n\t\tinitialEdits,\n\t\tchildren,\n\t\tBlockEditorProviderComponent = ExperimentalBlockEditorProvider,\n\t\t__unstableTemplate: template,\n\t} ) => {\n\t\tconst hasTemplate = !! template;\n\t\tconst {\n\t\t\teditorSettings,\n\t\t\tselection,\n\t\t\tisReady,\n\t\t\tmode,\n\t\t\tdefaultMode,\n\t\t\tpostTypeEntities,\n\t\t} = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\tgetEditorSettings,\n\t\t\t\t\tgetEditorSelection,\n\t\t\t\t\tgetRenderingMode,\n\t\t\t\t\t__unstableIsEditorReady,\n\t\t\t\t\tgetDefaultRenderingMode,\n\t\t\t\t} = unlock( select( editorStore ) );\n\t\t\t\tconst { getEntitiesConfig } = select( coreStore );\n\n\t\t\t\tconst _mode = getRenderingMode();\n\t\t\t\tconst _defaultMode = getDefaultRenderingMode( post.type );\n\t\t\t\t/**\n\t\t\t\t * To avoid content \"flash\", wait until rendering mode has been resolved.\n\t\t\t\t * This is important for the initial render of the editor.\n\t\t\t\t *\n\t\t\t\t * - Wait for template to be resolved if the default mode is 'template-locked'.\n\t\t\t\t * - Wait for default mode to be resolved otherwise.\n\t\t\t\t */\n\t\t\t\tconst hasResolvedDefaultMode =\n\t\t\t\t\t_defaultMode === 'template-locked'\n\t\t\t\t\t\t? hasTemplate\n\t\t\t\t\t\t: _defaultMode !== undefined;\n\t\t\t\t// Wait until the default mode is retrieved and start rendering canvas.\n\t\t\t\tconst isRenderingModeReady = _defaultMode !== undefined;\n\n\t\t\t\treturn {\n\t\t\t\t\teditorSettings: getEditorSettings(),\n\t\t\t\t\tisReady: __unstableIsEditorReady(),\n\t\t\t\t\tmode: isRenderingModeReady ? _mode : undefined,\n\t\t\t\t\tdefaultMode: hasResolvedDefaultMode\n\t\t\t\t\t\t? _defaultMode\n\t\t\t\t\t\t: undefined,\n\t\t\t\t\tselection: getEditorSelection(),\n\t\t\t\t\tpostTypeEntities:\n\t\t\t\t\t\tpost.type === 'wp_template'\n\t\t\t\t\t\t\t? getEntitiesConfig( 'postType' )\n\t\t\t\t\t\t\t: null,\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ post.type, hasTemplate ]\n\t\t);\n\n\t\tconst shouldRenderTemplate = hasTemplate && mode !== 'post-only';\n\t\tconst rootLevelPost = shouldRenderTemplate ? template : post;\n\t\tconst defaultBlockContext = useMemo( () => {\n\t\t\tconst postContext = {};\n\t\t\t// If it is a template, try to inherit the post type from the name.\n\t\t\tif ( post.type === 'wp_template' ) {\n\t\t\t\tif ( post.slug === 'page' ) {\n\t\t\t\t\tpostContext.postType = 'page';\n\t\t\t\t} else if ( post.slug === 'single' ) {\n\t\t\t\t\tpostContext.postType = 'post';\n\t\t\t\t} else if ( post.slug.split( '-' )[ 0 ] === 'single' ) {\n\t\t\t\t\t// If the slug is single-{postType}, infer the post type from the name.\n\t\t\t\t\tconst postTypeNames =\n\t\t\t\t\t\tpostTypeEntities?.map( ( entity ) => entity.name ) ||\n\t\t\t\t\t\t[];\n\t\t\t\t\tconst match = post.slug.match(\n\t\t\t\t\t\t`^single-(${ postTypeNames.join( '|' ) })(?:-.+)?$`\n\t\t\t\t\t);\n\t\t\t\t\tif ( match ) {\n\t\t\t\t\t\tpostContext.postType = match[ 1 ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\t! NON_CONTEXTUAL_POST_TYPES.includes( rootLevelPost.type ) ||\n\t\t\t\tshouldRenderTemplate\n\t\t\t) {\n\t\t\t\tpostContext.postId = post.id;\n\t\t\t\tpostContext.postType = post.type;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...postContext,\n\t\t\t\ttemplateSlug:\n\t\t\t\t\trootLevelPost.type === 'wp_template'\n\t\t\t\t\t\t? rootLevelPost.slug\n\t\t\t\t\t\t: undefined,\n\t\t\t};\n\t\t}, [\n\t\t\tshouldRenderTemplate,\n\t\t\tpost.id,\n\t\t\tpost.type,\n\t\t\tpost.slug,\n\t\t\trootLevelPost.type,\n\t\t\trootLevelPost.slug,\n\t\t\tpostTypeEntities,\n\t\t] );\n\t\tconst { id, type } = rootLevelPost;\n\t\tconst blockEditorSettings = useBlockEditorSettings(\n\t\t\teditorSettings,\n\t\t\ttype,\n\t\t\tid,\n\t\t\tmode\n\t\t);\n\t\tconst [ blocks, onInput, onChange ] = useBlockEditorProps(\n\t\t\tpost,\n\t\t\ttemplate,\n\t\t\tmode\n\t\t);\n\n\t\tconst {\n\t\t\tupdatePostLock,\n\t\t\tsetupEditor,\n\t\t\tupdateEditorSettings,\n\t\t\tsetCurrentTemplateId,\n\t\t\tsetEditedPost,\n\t\t\tsetRenderingMode,\n\t\t} = unlock( useDispatch( editorStore ) );\n\t\tconst { createWarningNotice, removeNotice } =\n\t\t\tuseDispatch( noticesStore );\n\n\t\t// Ideally this should be synced on each change and not just something you do once.\n\t\tuseLayoutEffect( () => {\n\t\t\t// Assume that we don't need to initialize in the case of an error recovery.\n\t\t\tif ( recovery ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tupdatePostLock( settings.postLock );\n\t\t\tsetupEditor( post, initialEdits, settings.template );\n\t\t\tif ( settings.autosave ) {\n\t\t\t\tcreateWarningNotice(\n\t\t\t\t\t__(\n\t\t\t\t\t\t'There is an autosave of this post that is more recent than the version below.'\n\t\t\t\t\t),\n\t\t\t\t\t{\n\t\t\t\t\t\tid: 'autosave-exists',\n\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'View the autosave' ),\n\t\t\t\t\t\t\t\turl: settings.autosave.editLink,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// The dependencies of the hook are omitted deliberately\n\t\t\t// We only want to run setupEditor (with initialEdits) only once per post.\n\t\t\t// A better solution in the future would be to split this effect into multiple ones.\n\t\t}, [] );\n\n\t\t// Synchronizes the active post with the state\n\t\tuseEffect( () => {\n\t\t\tsetEditedPost( post.type, post.id );\n\t\t\t// Clear any notices dependent on the post context.\n\t\t\tremoveNotice( 'template-activate-notice' );\n\t\t}, [ post.type, post.id, setEditedPost, removeNotice ] );\n\n\t\t// Synchronize the editor settings as they change.\n\t\tuseEffect( () => {\n\t\t\tupdateEditorSettings( settings );\n\t\t}, [ settings, updateEditorSettings ] );\n\n\t\t// Synchronizes the active template with the state.\n\t\tuseEffect( () => {\n\t\t\tsetCurrentTemplateId( template?.id );\n\t\t}, [ template?.id, setCurrentTemplateId ] );\n\n\t\t// Sets the right rendering mode when loading the editor.\n\t\tuseEffect( () => {\n\t\t\tif ( defaultMode ) {\n\t\t\t\tsetRenderingMode( defaultMode );\n\t\t\t}\n\t\t}, [ defaultMode, setRenderingMode ] );\n\n\t\tuseHideBlocksFromInserter( post.type, mode );\n\n\t\t// Register the editor commands.\n\t\tuseCommands();\n\n\t\tif ( ! isReady || ! mode ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (\n\t\t\t<EntityProvider kind=\"root\" type=\"site\">\n\t\t\t\t<EntityProvider\n\t\t\t\t\tkind=\"postType\"\n\t\t\t\t\ttype={ post.type }\n\t\t\t\t\tid={ post.id }\n\t\t\t\t>\n\t\t\t\t\t<BlockContextProvider value={ defaultBlockContext }>\n\t\t\t\t\t\t<BlockEditorProviderComponent\n\t\t\t\t\t\t\tvalue={ blocks }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\tonInput={ onInput }\n\t\t\t\t\t\t\tselection={ selection }\n\t\t\t\t\t\t\tsettings={ blockEditorSettings }\n\t\t\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t{ ! settings.isPreviewMode && (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<PatternsMenuItems />\n\t\t\t\t\t\t\t\t\t<TemplatePartMenuItems />\n\t\t\t\t\t\t\t\t\t{ mode === 'template-locked' && (\n\t\t\t\t\t\t\t\t\t\t<DisableNonPageContentBlocks />\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ type === 'wp_navigation' && (\n\t\t\t\t\t\t\t\t\t\t<NavigationBlockEditingMode />\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t<EditorKeyboardShortcuts />\n\t\t\t\t\t\t\t\t\t<KeyboardShortcutHelpModal />\n\t\t\t\t\t\t\t\t\t<BlockRemovalWarnings />\n\t\t\t\t\t\t\t\t\t<StartPageOptions />\n\t\t\t\t\t\t\t\t\t<StartTemplateOptions />\n\t\t\t\t\t\t\t\t\t<PatternRenameModal />\n\t\t\t\t\t\t\t\t\t<PatternDuplicateModal />\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</BlockEditorProviderComponent>\n\t\t\t\t\t</BlockContextProvider>\n\t\t\t\t</EntityProvider>\n\t\t\t</EntityProvider>\n\t\t);\n\t}\n);\n\n/**\n * This component establishes a new post editing context, and serves as the entry point for a new post editor (or post with template editor).\n *\n * It supports a large number of post types, including post, page, templates,\n * custom post types, patterns, template parts.\n *\n * All modification and changes are performed to the `@wordpress/core-data` store.\n *\n * @param {Object} props The component props.\n * @param {Object} [props.post] The post object to edit. This is required.\n * @param {Object} [props.__unstableTemplate] The template object wrapper the edited post.\n * This is optional and can only be used when the post type supports templates (like posts and pages).\n * @param {Object} [props.settings] The settings object to use for the editor.\n * This is optional and can be used to override the default settings.\n * @param {React.ReactNode} [props.children] Children elements for which the BlockEditorProvider context should apply.\n * This is optional.\n *\n * @example\n * ```jsx\n * <EditorProvider\n * post={ post }\n * settings={ settings }\n * __unstableTemplate={ template }\n * >\n * { children }\n * </EditorProvider>\n * ```\n *\n * @return {React.ReactNode} The rendered EditorProvider component.\n */\nexport function EditorProvider( props ) {\n\treturn (\n\t\t<ExperimentalEditorProvider\n\t\t\t{ ...props }\n\t\t\tBlockEditorProviderComponent={ BlockEditorProvider }\n\t\t>\n\t\t\t{ props.children }\n\t\t</ExperimentalEditorProvider>\n\t);\n}\n\nexport default EditorProvider;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgXQ;AA7WR,qBAAoD;AACpD,kBAAuC;AACvC,kBAAmB;AACnB,uBAIO;AACP,0BAIO;AACP,qBAAsC;AACtC,sBAAuD;AACvD,oBAA4B;AAK5B,oCAAiC;AACjC,mBAAqC;AACrC,uCAAmC;AACnC,yBAAuB;AACvB,6CAAwC;AACxC,2CAAuC;AACvC,2CAA0C;AAC1C,sBAAwB;AACxB,oCAAiC;AACjC,gCAA6B;AAC7B,0CAAsC;AACtC,oCAAiC;AACjC,uCAAoC;AACpC,kCAA+B;AAC/B,qCAAkC;AAClC,sCAAkC;AAElC,MAAM,EAAE,gCAAgC,QAAI,2BAAQ,oBAAAA,WAAuB;AAC3E,MAAM,EAAE,kBAAkB,QAAI,2BAAQ,gBAAAC,WAAwB;AAE9D,MAAM,OAAO,MAAM;AAAC;AAQpB,MAAM,4BAA4B;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AACD;AAiBA,SAAS,oBAAqB,MAAM,UAAU,MAAO;AACpD,QAAM,gBAAgB,SAAS,oBAAoB,aAAa;AAChE,QAAM,CAAE,YAAY,SAAS,QAAS,QAAI;AAAA,IACzC;AAAA,IACA,KAAK;AAAA,IACL,EAAE,IAAI,KAAK,GAAG;AAAA,EACf;AACA,QAAM,CAAE,gBAAgB,iBAAiB,gBAAiB,QACzD,uCAAsB,YAAY,UAAU,MAAM;AAAA,IACjD,IAAI,UAAU;AAAA,EACf,CAAE;AACH,Q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is", "withRegistryProvider", "editorStore", "coreStore", "useBlockEditorSettings", "noticesStore", "useCommands", "TemplatePartMenuItems", "DisableNonPageContentBlocks", "NavigationBlockEditingMode", "EditorKeyboardShortcuts", "KeyboardShortcutHelpModal", "BlockRemovalWarnings", "StartPageOptions", "StartTemplateOptions", "PatternRenameModal", "PatternDuplicateModal"]
7
7
  }
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var categories_exports = {};
20
+ __export(categories_exports, {
21
+ getExamplesByCategory: () => getExamplesByCategory,
22
+ getTopLevelStyleBookCategories: () => getTopLevelStyleBookCategories
23
+ });
24
+ module.exports = __toCommonJS(categories_exports);
25
+ var import_blocks = require("@wordpress/blocks");
26
+ var import_constants = require("./constants");
27
+ function getExamplesByCategory(categoryDefinition, examples) {
28
+ if (!categoryDefinition?.slug || !examples?.length) {
29
+ return;
30
+ }
31
+ const categories = categoryDefinition?.subcategories ?? [];
32
+ if (categories.length) {
33
+ return categories.reduce(
34
+ (acc, subcategoryDefinition) => {
35
+ const subcategoryExamples = getExamplesByCategory(
36
+ subcategoryDefinition,
37
+ examples
38
+ );
39
+ if (subcategoryExamples) {
40
+ if (!acc.subcategories) {
41
+ acc.subcategories = [];
42
+ }
43
+ acc.subcategories = [
44
+ ...acc.subcategories,
45
+ subcategoryExamples
46
+ ];
47
+ }
48
+ return acc;
49
+ },
50
+ {
51
+ title: categoryDefinition.title,
52
+ slug: categoryDefinition.slug
53
+ }
54
+ );
55
+ }
56
+ const blocksToInclude = categoryDefinition?.blocks || [];
57
+ const blocksToExclude = categoryDefinition?.exclude || [];
58
+ const categoryExamples = examples.filter((example) => {
59
+ return !blocksToExclude.includes(example.name) && (example.category === categoryDefinition.slug || blocksToInclude.includes(example.name));
60
+ });
61
+ if (!categoryExamples.length) {
62
+ return;
63
+ }
64
+ return {
65
+ title: categoryDefinition.title,
66
+ slug: categoryDefinition.slug,
67
+ examples: categoryExamples
68
+ };
69
+ }
70
+ function getTopLevelStyleBookCategories() {
71
+ const reservedCategories = [
72
+ ...import_constants.STYLE_BOOK_THEME_SUBCATEGORIES,
73
+ ...import_constants.STYLE_BOOK_CATEGORIES
74
+ ].map(({ slug }) => slug);
75
+ const extraCategories = (0, import_blocks.getCategories)();
76
+ const extraCategoriesFiltered = extraCategories.filter(
77
+ ({ slug }) => !reservedCategories.includes(slug)
78
+ );
79
+ return [...import_constants.STYLE_BOOK_CATEGORIES, ...extraCategoriesFiltered];
80
+ }
81
+ // Annotate the CommonJS export names for ESM import in node:
82
+ 0 && (module.exports = {
83
+ getExamplesByCategory,
84
+ getTopLevelStyleBookCategories
85
+ });
86
+ //# sourceMappingURL=categories.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/style-book/categories.ts"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\n// @wordpress/blocks imports are not typed.\n// @ts-expect-error\nimport { getCategories } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport type {\n\tBlockExample,\n\tStyleBookCategory,\n\tCategoryExamples,\n} from './types';\nimport {\n\tSTYLE_BOOK_CATEGORIES,\n\tSTYLE_BOOK_THEME_SUBCATEGORIES,\n} from './constants';\n\n/**\n * Returns category examples for a given category definition and list of examples.\n * @param {StyleBookCategory} categoryDefinition The category definition.\n * @param {BlockExample[]} examples An array of block examples.\n * @return {CategoryExamples|undefined} An object containing the category examples.\n */\nexport function getExamplesByCategory(\n\tcategoryDefinition: StyleBookCategory,\n\texamples: BlockExample[]\n): CategoryExamples | undefined {\n\tif ( ! categoryDefinition?.slug || ! examples?.length ) {\n\t\treturn;\n\t}\n\tconst categories: CategoryExamples[] =\n\t\tcategoryDefinition?.subcategories ?? [];\n\tif ( categories.length ) {\n\t\treturn categories.reduce(\n\t\t\t( acc, subcategoryDefinition ) => {\n\t\t\t\tconst subcategoryExamples = getExamplesByCategory(\n\t\t\t\t\tsubcategoryDefinition,\n\t\t\t\t\texamples\n\t\t\t\t);\n\t\t\t\tif ( subcategoryExamples ) {\n\t\t\t\t\tif ( ! acc.subcategories ) {\n\t\t\t\t\t\tacc.subcategories = [];\n\t\t\t\t\t}\n\t\t\t\t\tacc.subcategories = [\n\t\t\t\t\t\t...acc.subcategories,\n\t\t\t\t\t\tsubcategoryExamples,\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t\treturn acc;\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: categoryDefinition.title,\n\t\t\t\tslug: categoryDefinition.slug,\n\t\t\t}\n\t\t);\n\t}\n\n\tconst blocksToInclude = categoryDefinition?.blocks || [];\n\tconst blocksToExclude = categoryDefinition?.exclude || [];\n\tconst categoryExamples = examples.filter( ( example ) => {\n\t\treturn (\n\t\t\t! blocksToExclude.includes( example.name ) &&\n\t\t\t( example.category === categoryDefinition.slug ||\n\t\t\t\tblocksToInclude.includes( example.name ) )\n\t\t);\n\t} );\n\n\tif ( ! categoryExamples.length ) {\n\t\treturn;\n\t}\n\n\treturn {\n\t\ttitle: categoryDefinition.title,\n\t\tslug: categoryDefinition.slug,\n\t\texamples: categoryExamples,\n\t};\n}\n\n/**\n * Returns category examples for a given category definition and list of examples.\n *\n * @return {StyleBookCategory[]} An array of top-level category definitions.\n */\nexport function getTopLevelStyleBookCategories(): StyleBookCategory[] {\n\tconst reservedCategories = [\n\t\t...STYLE_BOOK_THEME_SUBCATEGORIES,\n\t\t...STYLE_BOOK_CATEGORIES,\n\t].map( ( { slug } ) => slug );\n\tconst extraCategories: StyleBookCategory[] = getCategories();\n\tconst extraCategoriesFiltered = extraCategories.filter(\n\t\t( { slug } ) => ! reservedCategories.includes( slug )\n\t);\n\treturn [ ...STYLE_BOOK_CATEGORIES, ...extraCategoriesFiltered ];\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,oBAA8B;AAU9B,uBAGO;AAQA,SAAS,sBACf,oBACA,UAC+B;AAC/B,MAAK,CAAE,oBAAoB,QAAQ,CAAE,UAAU,QAAS;AACvD;AAAA,EACD;AACA,QAAM,aACL,oBAAoB,iBAAiB,CAAC;AACvC,MAAK,WAAW,QAAS;AACxB,WAAO,WAAW;AAAA,MACjB,CAAE,KAAK,0BAA2B;AACjC,cAAM,sBAAsB;AAAA,UAC3B;AAAA,UACA;AAAA,QACD;AACA,YAAK,qBAAsB;AAC1B,cAAK,CAAE,IAAI,eAAgB;AAC1B,gBAAI,gBAAgB,CAAC;AAAA,UACtB;AACA,cAAI,gBAAgB;AAAA,YACnB,GAAG,IAAI;AAAA,YACP;AAAA,UACD;AAAA,QACD;AACA,eAAO;AAAA,MACR;AAAA,MACA;AAAA,QACC,OAAO,mBAAmB;AAAA,QAC1B,MAAM,mBAAmB;AAAA,MAC1B;AAAA,IACD;AAAA,EACD;AAEA,QAAM,kBAAkB,oBAAoB,UAAU,CAAC;AACvD,QAAM,kBAAkB,oBAAoB,WAAW,CAAC;AACxD,QAAM,mBAAmB,SAAS,OAAQ,CAAE,YAAa;AACxD,WACC,CAAE,gBAAgB,SAAU,QAAQ,IAAK,MACvC,QAAQ,aAAa,mBAAmB,QACzC,gBAAgB,SAAU,QAAQ,IAAK;AAAA,EAE1C,CAAE;AAEF,MAAK,CAAE,iBAAiB,QAAS;AAChC;AAAA,EACD;AAEA,SAAO;AAAA,IACN,OAAO,mBAAmB;AAAA,IAC1B,MAAM,mBAAmB;AAAA,IACzB,UAAU;AAAA,EACX;AACD;AAOO,SAAS,iCAAsD;AACrE,QAAM,qBAAqB;AAAA,IAC1B,GAAG;AAAA,IACH,GAAG;AAAA,EACJ,EAAE,IAAK,CAAE,EAAE,KAAK,MAAO,IAAK;AAC5B,QAAM,sBAAuC,6BAAc;AAC3D,QAAM,0BAA0B,gBAAgB;AAAA,IAC/C,CAAE,EAAE,KAAK,MAAO,CAAE,mBAAmB,SAAU,IAAK;AAAA,EACrD;AACA,SAAO,CAAE,GAAG,wCAAuB,GAAG,uBAAwB;AAC/D;",
6
+ "names": []
7
+ }
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var color_examples_exports = {};
30
+ __export(color_examples_exports, {
31
+ default: () => color_examples_default
32
+ });
33
+ module.exports = __toCommonJS(color_examples_exports);
34
+ var import_jsx_runtime = require("react/jsx-runtime");
35
+ var import_clsx = __toESM(require("clsx"));
36
+ var import_components = require("@wordpress/components");
37
+ var import_block_editor = require("@wordpress/block-editor");
38
+ const ColorExamples = ({
39
+ colors,
40
+ type,
41
+ templateColumns = "1fr 1fr",
42
+ itemHeight = "52px"
43
+ }) => {
44
+ if (!colors) {
45
+ return null;
46
+ }
47
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.__experimentalGrid, { templateColumns, rowGap: 8, columnGap: 16, children: colors.map((color) => {
48
+ const className = type === "gradients" ? (0, import_block_editor.__experimentalGetGradientClass)(color.slug) : (0, import_block_editor.getColorClassName)("background-color", color.slug);
49
+ const classes = (0, import_clsx.default)(
50
+ "editor-style-book__color-example",
51
+ className
52
+ );
53
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
54
+ "div",
55
+ {
56
+ className: classes,
57
+ style: { height: itemHeight }
58
+ },
59
+ color.slug
60
+ );
61
+ }) });
62
+ };
63
+ var color_examples_default = ColorExamples;
64
+ //# sourceMappingURL=color-examples.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/style-book/color-examples.tsx"],
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __experimentalGrid as Grid } from '@wordpress/components';\nimport {\n\tgetColorClassName,\n\t__experimentalGetGradientClass,\n\t// @wordpress/block-editor imports are not typed.\n\t// @ts-expect-error\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport type { Color, Gradient, ColorExampleProps } from './types';\n\nconst ColorExamples = ( {\n\tcolors,\n\ttype,\n\ttemplateColumns = '1fr 1fr',\n\titemHeight = '52px',\n}: ColorExampleProps ): JSX.Element | null => {\n\tif ( ! colors ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Grid templateColumns={ templateColumns } rowGap={ 8 } columnGap={ 16 }>\n\t\t\t{ colors.map( ( color: Color | Gradient ) => {\n\t\t\t\tconst className =\n\t\t\t\t\ttype === 'gradients'\n\t\t\t\t\t\t? __experimentalGetGradientClass( color.slug )\n\t\t\t\t\t\t: getColorClassName( 'background-color', color.slug );\n\t\t\t\tconst classes = clsx(\n\t\t\t\t\t'editor-style-book__color-example',\n\t\t\t\t\tclassName\n\t\t\t\t);\n\n\t\t\t\treturn (\n\t\t\t\t\t<div\n\t\t\t\t\t\tkey={ color.slug }\n\t\t\t\t\t\tclassName={ classes }\n\t\t\t\t\t\tstyle={ { height: itemHeight } }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</Grid>\n\t);\n};\n\nexport default ColorExamples;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA4CK;AAzCL,kBAAiB;AAKjB,wBAA2C;AAC3C,0BAKO;AAOP,MAAM,gBAAgB,CAAE;AAAA,EACvB;AAAA,EACA;AAAA,EACA,kBAAkB;AAAA,EAClB,aAAa;AACd,MAA8C;AAC7C,MAAK,CAAE,QAAS;AACf,WAAO;AAAA,EACR;AAEA,SACC,4CAAC,kBAAAA,oBAAA,EAAK,iBAAoC,QAAS,GAAI,WAAY,IAChE,iBAAO,IAAK,CAAE,UAA6B;AAC5C,UAAM,YACL,SAAS,kBACN,oDAAgC,MAAM,IAAK,QAC3C,uCAAmB,oBAAoB,MAAM,IAAK;AACtD,UAAM,cAAU,YAAAC;AAAA,MACf;AAAA,MACA;AAAA,IACD;AAEA,WACC;AAAA,MAAC;AAAA;AAAA,QAEA,WAAY;AAAA,QACZ,OAAQ,EAAE,QAAQ,WAAW;AAAA;AAAA,MAFvB,MAAM;AAAA,IAGb;AAAA,EAEF,CAAE,GACH;AAEF;AAEA,IAAO,yBAAQ;",
6
+ "names": ["Grid", "clsx"]
7
+ }
@@ -0,0 +1,319 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var constants_exports = {};
20
+ __export(constants_exports, {
21
+ STYLE_BOOK_ALL_BLOCKS_SUBCATEGORIES: () => STYLE_BOOK_ALL_BLOCKS_SUBCATEGORIES,
22
+ STYLE_BOOK_CATEGORIES: () => STYLE_BOOK_CATEGORIES,
23
+ STYLE_BOOK_COLOR_GROUPS: () => STYLE_BOOK_COLOR_GROUPS,
24
+ STYLE_BOOK_IFRAME_STYLES: () => STYLE_BOOK_IFRAME_STYLES,
25
+ STYLE_BOOK_PREVIEW_CATEGORIES: () => STYLE_BOOK_PREVIEW_CATEGORIES,
26
+ STYLE_BOOK_THEME_SUBCATEGORIES: () => STYLE_BOOK_THEME_SUBCATEGORIES
27
+ });
28
+ module.exports = __toCommonJS(constants_exports);
29
+ var import_i18n = require("@wordpress/i18n");
30
+ const STYLE_BOOK_COLOR_GROUPS = [
31
+ {
32
+ slug: "theme-colors",
33
+ title: (0, import_i18n.__)("Theme Colors"),
34
+ origin: "theme",
35
+ type: "colors"
36
+ },
37
+ {
38
+ slug: "theme-gradients",
39
+ title: (0, import_i18n.__)("Theme Gradients"),
40
+ origin: "theme",
41
+ type: "gradients"
42
+ },
43
+ {
44
+ slug: "custom-colors",
45
+ title: (0, import_i18n.__)("Custom Colors"),
46
+ origin: "custom",
47
+ type: "colors"
48
+ },
49
+ {
50
+ slug: "custom-gradients",
51
+ title: (0, import_i18n.__)("Custom Gradients"),
52
+ origin: "custom",
53
+ // User.
54
+ type: "gradients"
55
+ },
56
+ {
57
+ slug: "duotones",
58
+ title: (0, import_i18n.__)("Duotones"),
59
+ origin: "theme",
60
+ type: "duotones"
61
+ },
62
+ {
63
+ slug: "default-colors",
64
+ title: (0, import_i18n.__)("Default Colors"),
65
+ origin: "default",
66
+ type: "colors"
67
+ },
68
+ {
69
+ slug: "default-gradients",
70
+ title: (0, import_i18n.__)("Default Gradients"),
71
+ origin: "default",
72
+ type: "gradients"
73
+ }
74
+ ];
75
+ const STYLE_BOOK_THEME_SUBCATEGORIES = [
76
+ {
77
+ slug: "site-identity",
78
+ title: (0, import_i18n.__)("Site Identity"),
79
+ blocks: ["core/site-logo", "core/site-title", "core/site-tagline"]
80
+ },
81
+ {
82
+ slug: "design",
83
+ title: (0, import_i18n.__)("Design"),
84
+ blocks: ["core/navigation", "core/avatar", "core/post-time-to-read"],
85
+ exclude: ["core/home-link", "core/navigation-link"]
86
+ },
87
+ {
88
+ slug: "posts",
89
+ title: (0, import_i18n.__)("Posts"),
90
+ blocks: [
91
+ "core/post-title",
92
+ "core/post-excerpt",
93
+ "core/post-author",
94
+ "core/post-author-name",
95
+ "core/post-author-biography",
96
+ "core/post-date",
97
+ "core/post-terms",
98
+ "core/term-description",
99
+ "core/query-title",
100
+ "core/query-no-results",
101
+ "core/query-pagination",
102
+ "core/query-numbers"
103
+ ]
104
+ },
105
+ {
106
+ slug: "comments",
107
+ title: (0, import_i18n.__)("Comments"),
108
+ blocks: [
109
+ "core/comments-title",
110
+ "core/comments-pagination",
111
+ "core/comments-pagination-numbers",
112
+ "core/comments",
113
+ "core/comments-author-name",
114
+ "core/comment-content",
115
+ "core/comment-date",
116
+ "core/comment-edit-link",
117
+ "core/comment-reply-link",
118
+ "core/comment-template",
119
+ "core/post-comments-count",
120
+ "core/post-comments-link"
121
+ ]
122
+ }
123
+ ];
124
+ const STYLE_BOOK_CATEGORIES = [
125
+ {
126
+ slug: "overview",
127
+ title: (0, import_i18n.__)("Overview"),
128
+ blocks: []
129
+ },
130
+ {
131
+ slug: "text",
132
+ title: (0, import_i18n.__)("Text"),
133
+ blocks: [
134
+ "core/post-content",
135
+ "core/home-link",
136
+ "core/navigation-link"
137
+ ]
138
+ },
139
+ {
140
+ slug: "colors",
141
+ title: (0, import_i18n.__)("Colors"),
142
+ blocks: []
143
+ },
144
+ {
145
+ slug: "theme",
146
+ title: (0, import_i18n.__)("Theme"),
147
+ subcategories: STYLE_BOOK_THEME_SUBCATEGORIES
148
+ },
149
+ {
150
+ slug: "media",
151
+ title: (0, import_i18n.__)("Media"),
152
+ blocks: ["core/post-featured-image"]
153
+ },
154
+ {
155
+ slug: "widgets",
156
+ title: (0, import_i18n.__)("Widgets"),
157
+ blocks: []
158
+ },
159
+ {
160
+ slug: "embed",
161
+ title: (0, import_i18n.__)("Embeds"),
162
+ include: []
163
+ }
164
+ ];
165
+ const STYLE_BOOK_ALL_BLOCKS_SUBCATEGORIES = [
166
+ ...STYLE_BOOK_THEME_SUBCATEGORIES,
167
+ {
168
+ slug: "media",
169
+ title: (0, import_i18n.__)("Media"),
170
+ blocks: ["core/post-featured-image"]
171
+ },
172
+ {
173
+ slug: "widgets",
174
+ title: (0, import_i18n.__)("Widgets"),
175
+ blocks: []
176
+ },
177
+ {
178
+ slug: "embed",
179
+ title: (0, import_i18n.__)("Embeds"),
180
+ include: []
181
+ }
182
+ ];
183
+ const STYLE_BOOK_PREVIEW_CATEGORIES = [
184
+ {
185
+ slug: "overview",
186
+ title: (0, import_i18n.__)("Overview"),
187
+ blocks: []
188
+ },
189
+ {
190
+ slug: "text",
191
+ title: (0, import_i18n.__)("Text"),
192
+ blocks: [
193
+ "core/post-content",
194
+ "core/home-link",
195
+ "core/navigation-link"
196
+ ]
197
+ },
198
+ {
199
+ slug: "colors",
200
+ title: (0, import_i18n.__)("Colors"),
201
+ blocks: []
202
+ },
203
+ {
204
+ slug: "blocks",
205
+ title: (0, import_i18n.__)("All Blocks"),
206
+ blocks: [],
207
+ subcategories: STYLE_BOOK_ALL_BLOCKS_SUBCATEGORIES
208
+ }
209
+ ];
210
+ const ROOT_CONTAINER = `
211
+ .is-root-container {
212
+ display: flow-root;
213
+ }
214
+ `;
215
+ const STYLE_BOOK_IFRAME_STYLES = `
216
+ body {
217
+ position: relative;
218
+ padding: 32px !important;
219
+ }
220
+
221
+ ${ROOT_CONTAINER}
222
+
223
+ .editor-style-book__examples {
224
+ max-width: 1200px;
225
+ margin: 0 auto;
226
+ }
227
+
228
+ .editor-style-book__example {
229
+ max-width: 900px;
230
+ border-radius: 2px;
231
+ cursor: pointer;
232
+ display: flex;
233
+ flex-direction: column;
234
+ gap: 40px;
235
+ padding: 16px;
236
+ width: 100%;
237
+ box-sizing: border-box;
238
+ scroll-margin-top: 32px;
239
+ scroll-margin-bottom: 32px;
240
+ margin: 0 auto 40px auto;
241
+ }
242
+
243
+ .editor-style-book__example.is-selected {
244
+ box-shadow: 0 0 0 1px var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));
245
+ }
246
+
247
+ .editor-style-book__example.is-disabled-example {
248
+ pointer-events: none;
249
+ }
250
+
251
+ .editor-style-book__example:focus:not(:disabled) {
252
+ box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));
253
+ outline: 3px solid transparent;
254
+ }
255
+
256
+ .editor-style-book__duotone-example > div:first-child {
257
+ display: flex;
258
+ aspect-ratio: 16 / 9;
259
+ grid-row: span 1;
260
+ grid-column: span 2;
261
+ }
262
+ .editor-style-book__duotone-example img {
263
+ width: 100%;
264
+ height: 100%;
265
+ object-fit: cover;
266
+ }
267
+ .editor-style-book__duotone-example > div:not(:first-child) {
268
+ height: 20px;
269
+ border: 1px solid color-mix( in srgb, currentColor 10%, transparent );
270
+ }
271
+
272
+ .editor-style-book__color-example {
273
+ border: 1px solid color-mix( in srgb, currentColor 10%, transparent );
274
+ }
275
+
276
+ .editor-style-book__subcategory-title,
277
+ .editor-style-book__example-title {
278
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
279
+ font-size: 13px;
280
+ font-weight: normal;
281
+ line-height: normal;
282
+ margin: 0;
283
+ text-align: left;
284
+ padding-top: 8px;
285
+ border-top: 1px solid color-mix( in srgb, currentColor 10%, transparent );
286
+ color: color-mix( in srgb, currentColor 60%, transparent );
287
+ }
288
+
289
+ .editor-style-book__subcategory-title {
290
+ font-size: 16px;
291
+ margin-bottom: 40px;
292
+ padding-bottom: 8px;
293
+ }
294
+
295
+ .editor-style-book__example-preview {
296
+ width: 100%;
297
+ }
298
+
299
+ .editor-style-book__example-preview .block-editor-block-list__insertion-point,
300
+ .editor-style-book__example-preview .block-list-appender {
301
+ display: none;
302
+ }
303
+ :where(.is-root-container > .wp-block:first-child) {
304
+ margin-top: 0;
305
+ }
306
+ :where(.is-root-container > .wp-block:last-child) {
307
+ margin-bottom: 0;
308
+ }
309
+ `;
310
+ // Annotate the CommonJS export names for ESM import in node:
311
+ 0 && (module.exports = {
312
+ STYLE_BOOK_ALL_BLOCKS_SUBCATEGORIES,
313
+ STYLE_BOOK_CATEGORIES,
314
+ STYLE_BOOK_COLOR_GROUPS,
315
+ STYLE_BOOK_IFRAME_STYLES,
316
+ STYLE_BOOK_PREVIEW_CATEGORIES,
317
+ STYLE_BOOK_THEME_SUBCATEGORIES
318
+ });
319
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/style-book/constants.ts"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type { StyleBookCategory, StyleBookColorGroup } from './types';\n\nexport const STYLE_BOOK_COLOR_GROUPS: StyleBookColorGroup[] = [\n\t{\n\t\tslug: 'theme-colors',\n\t\ttitle: __( 'Theme Colors' ),\n\t\torigin: 'theme',\n\t\ttype: 'colors',\n\t},\n\t{\n\t\tslug: 'theme-gradients',\n\t\ttitle: __( 'Theme Gradients' ),\n\t\torigin: 'theme',\n\t\ttype: 'gradients',\n\t},\n\t{\n\t\tslug: 'custom-colors',\n\t\ttitle: __( 'Custom Colors' ),\n\t\torigin: 'custom',\n\t\ttype: 'colors',\n\t},\n\t{\n\t\tslug: 'custom-gradients',\n\t\ttitle: __( 'Custom Gradients' ),\n\t\torigin: 'custom', // User.\n\t\ttype: 'gradients',\n\t},\n\t{\n\t\tslug: 'duotones',\n\t\ttitle: __( 'Duotones' ),\n\t\torigin: 'theme',\n\t\ttype: 'duotones',\n\t},\n\t{\n\t\tslug: 'default-colors',\n\t\ttitle: __( 'Default Colors' ),\n\t\torigin: 'default',\n\t\ttype: 'colors',\n\t},\n\t{\n\t\tslug: 'default-gradients',\n\t\ttitle: __( 'Default Gradients' ),\n\t\torigin: 'default',\n\t\ttype: 'gradients',\n\t},\n];\n\nexport const STYLE_BOOK_THEME_SUBCATEGORIES: Omit<\n\tStyleBookCategory,\n\t'subcategories'\n>[] = [\n\t{\n\t\tslug: 'site-identity',\n\t\ttitle: __( 'Site Identity' ),\n\t\tblocks: [ 'core/site-logo', 'core/site-title', 'core/site-tagline' ],\n\t},\n\t{\n\t\tslug: 'design',\n\t\ttitle: __( 'Design' ),\n\t\tblocks: [ 'core/navigation', 'core/avatar', 'core/post-time-to-read' ],\n\t\texclude: [ 'core/home-link', 'core/navigation-link' ],\n\t},\n\t{\n\t\tslug: 'posts',\n\t\ttitle: __( 'Posts' ),\n\t\tblocks: [\n\t\t\t'core/post-title',\n\t\t\t'core/post-excerpt',\n\t\t\t'core/post-author',\n\t\t\t'core/post-author-name',\n\t\t\t'core/post-author-biography',\n\t\t\t'core/post-date',\n\t\t\t'core/post-terms',\n\t\t\t'core/term-description',\n\t\t\t'core/query-title',\n\t\t\t'core/query-no-results',\n\t\t\t'core/query-pagination',\n\t\t\t'core/query-numbers',\n\t\t],\n\t},\n\t{\n\t\tslug: 'comments',\n\t\ttitle: __( 'Comments' ),\n\t\tblocks: [\n\t\t\t'core/comments-title',\n\t\t\t'core/comments-pagination',\n\t\t\t'core/comments-pagination-numbers',\n\t\t\t'core/comments',\n\t\t\t'core/comments-author-name',\n\t\t\t'core/comment-content',\n\t\t\t'core/comment-date',\n\t\t\t'core/comment-edit-link',\n\t\t\t'core/comment-reply-link',\n\t\t\t'core/comment-template',\n\t\t\t'core/post-comments-count',\n\t\t\t'core/post-comments-link',\n\t\t],\n\t},\n];\n\nexport const STYLE_BOOK_CATEGORIES: StyleBookCategory[] = [\n\t{\n\t\tslug: 'overview',\n\t\ttitle: __( 'Overview' ),\n\t\tblocks: [],\n\t},\n\t{\n\t\tslug: 'text',\n\t\ttitle: __( 'Text' ),\n\t\tblocks: [\n\t\t\t'core/post-content',\n\t\t\t'core/home-link',\n\t\t\t'core/navigation-link',\n\t\t],\n\t},\n\t{\n\t\tslug: 'colors',\n\t\ttitle: __( 'Colors' ),\n\t\tblocks: [],\n\t},\n\t{\n\t\tslug: 'theme',\n\t\ttitle: __( 'Theme' ),\n\t\tsubcategories: STYLE_BOOK_THEME_SUBCATEGORIES,\n\t},\n\t{\n\t\tslug: 'media',\n\t\ttitle: __( 'Media' ),\n\t\tblocks: [ 'core/post-featured-image' ],\n\t},\n\t{\n\t\tslug: 'widgets',\n\t\ttitle: __( 'Widgets' ),\n\t\tblocks: [],\n\t},\n\t{\n\t\tslug: 'embed',\n\t\ttitle: __( 'Embeds' ),\n\t\tinclude: [],\n\t},\n];\n\n// Style book preview subcategories for all blocks section.\nexport const STYLE_BOOK_ALL_BLOCKS_SUBCATEGORIES: StyleBookCategory[] = [\n\t...STYLE_BOOK_THEME_SUBCATEGORIES,\n\t{\n\t\tslug: 'media',\n\t\ttitle: __( 'Media' ),\n\t\tblocks: [ 'core/post-featured-image' ],\n\t},\n\t{\n\t\tslug: 'widgets',\n\t\ttitle: __( 'Widgets' ),\n\t\tblocks: [],\n\t},\n\t{\n\t\tslug: 'embed',\n\t\ttitle: __( 'Embeds' ),\n\t\tinclude: [],\n\t},\n];\n\n// Style book preview categories are organized slightly differently to the editor ones.\nexport const STYLE_BOOK_PREVIEW_CATEGORIES: StyleBookCategory[] = [\n\t{\n\t\tslug: 'overview',\n\t\ttitle: __( 'Overview' ),\n\t\tblocks: [],\n\t},\n\t{\n\t\tslug: 'text',\n\t\ttitle: __( 'Text' ),\n\t\tblocks: [\n\t\t\t'core/post-content',\n\t\t\t'core/home-link',\n\t\t\t'core/navigation-link',\n\t\t],\n\t},\n\t{\n\t\tslug: 'colors',\n\t\ttitle: __( 'Colors' ),\n\t\tblocks: [],\n\t},\n\t{\n\t\tslug: 'blocks',\n\t\ttitle: __( 'All Blocks' ),\n\t\tblocks: [],\n\t\tsubcategories: STYLE_BOOK_ALL_BLOCKS_SUBCATEGORIES,\n\t},\n];\n\n// Forming a \"block formatting context\" to prevent margin collapsing.\n// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context\nconst ROOT_CONTAINER = `\n\t.is-root-container {\n\t\tdisplay: flow-root;\n\t}\n`;\n// The content area of the Style Book is rendered within an iframe so that global styles\n// are applied to elements within the entire content area. To support elements that are\n// not part of the block previews, such as headings and layout for the block previews,\n// additional CSS rules need to be passed into the iframe. These are hard-coded below.\n// Note that button styles are unset, and then focus rules from the `Button` component are\n// applied to the `button` element, targeted via `.editor-style-book__example`.\n// This is to ensure that browser default styles for buttons are not applied to the previews.\nexport const STYLE_BOOK_IFRAME_STYLES = `\n\tbody {\n\t\tposition: relative;\n\t\tpadding: 32px !important;\n\t}\n\n\t${ ROOT_CONTAINER }\n\n\t.editor-style-book__examples {\n\t\tmax-width: 1200px;\n\t\tmargin: 0 auto;\n\t}\n\n\t.editor-style-book__example {\n\t max-width: 900px;\n\t\tborder-radius: 2px;\n\t\tcursor: pointer;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 40px;\n\t\tpadding: 16px;\n\t\twidth: 100%;\n\t\tbox-sizing: border-box;\n\t\tscroll-margin-top: 32px;\n\t\tscroll-margin-bottom: 32px;\n\t\tmargin: 0 auto 40px auto;\n\t}\n\n\t.editor-style-book__example.is-selected {\n\t\tbox-shadow: 0 0 0 1px var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));\n\t}\n\n\t.editor-style-book__example.is-disabled-example {\n\t\tpointer-events: none;\n\t}\n\n\t.editor-style-book__example:focus:not(:disabled) {\n\t\tbox-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));\n\t\toutline: 3px solid transparent;\n\t}\n\n\t.editor-style-book__duotone-example > div:first-child {\n\t\tdisplay: flex;\n\t\taspect-ratio: 16 / 9;\n\t\tgrid-row: span 1;\n\t\tgrid-column: span 2;\n\t}\n\t.editor-style-book__duotone-example img {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tobject-fit: cover;\n\t}\n\t.editor-style-book__duotone-example > div:not(:first-child) {\n\t\theight: 20px;\n\t\tborder: 1px solid color-mix( in srgb, currentColor 10%, transparent );\n\t}\n\n\t.editor-style-book__color-example {\n\t\tborder: 1px solid color-mix( in srgb, currentColor 10%, transparent );\n\t}\n\n\t.editor-style-book__subcategory-title,\n\t.editor-style-book__example-title {\n\t\tfont-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif;\n\t\tfont-size: 13px;\n\t\tfont-weight: normal;\n\t\tline-height: normal;\n\t\tmargin: 0;\n\t\ttext-align: left;\n\t\tpadding-top: 8px;\n\t\tborder-top: 1px solid color-mix( in srgb, currentColor 10%, transparent );\n\t\tcolor: color-mix( in srgb, currentColor 60%, transparent );\n\t}\n\n\t.editor-style-book__subcategory-title {\n\t\tfont-size: 16px;\n\t\tmargin-bottom: 40px;\n \tpadding-bottom: 8px;\n\t}\n\n\t.editor-style-book__example-preview {\n\t\twidth: 100%;\n\t}\n\n\t.editor-style-book__example-preview .block-editor-block-list__insertion-point,\n\t.editor-style-book__example-preview .block-list-appender {\n\t\tdisplay: none;\n\t}\n\t:where(.is-root-container > .wp-block:first-child) {\n\t\tmargin-top: 0;\n\t}\n\t:where(.is-root-container > .wp-block:last-child) {\n\t\tmargin-bottom: 0;\n\t}\n`;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AAOZ,MAAM,0BAAiD;AAAA,EAC7D;AAAA,IACC,MAAM;AAAA,IACN,WAAO,gBAAI,cAAe;AAAA,IAC1B,QAAQ;AAAA,IACR,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,MAAM;AAAA,IACN,WAAO,gBAAI,iBAAkB;AAAA,IAC7B,QAAQ;AAAA,IACR,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,MAAM;AAAA,IACN,WAAO,gBAAI,eAAgB;AAAA,IAC3B,QAAQ;AAAA,IACR,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,MAAM;AAAA,IACN,WAAO,gBAAI,kBAAmB;AAAA,IAC9B,QAAQ;AAAA;AAAA,IACR,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,MAAM;AAAA,IACN,WAAO,gBAAI,UAAW;AAAA,IACtB,QAAQ;AAAA,IACR,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC,MAAM;AAAA,IACN,WAAO,gBAAI,gBAAiB;AAAA,I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