@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
@@ -0,0 +1,136 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { useDispatch, useSelect } from '@wordpress/data';
5
+ import { ExternalLink, Guide } from '@wordpress/components';
6
+ import { __ } from '@wordpress/i18n';
7
+ import { store as preferencesStore } from '@wordpress/preferences';
8
+ import { store as interfaceStore } from '@wordpress/interface';
9
+
10
+ /**
11
+ * Internal dependencies
12
+ */
13
+ import WelcomeGuideImage from './welcome-guide-image';
14
+
15
+ export default function WelcomeGuideStyles() {
16
+ const { toggle } = useDispatch( preferencesStore );
17
+
18
+ const { isActive, isStylesOpen } = useSelect( ( select ) => {
19
+ const sidebar =
20
+ select( interfaceStore ).getActiveComplementaryArea( 'core' );
21
+
22
+ return {
23
+ isActive: !! select( preferencesStore ).get(
24
+ 'core/edit-site',
25
+ 'welcomeGuideStyles'
26
+ ),
27
+ isStylesOpen: sidebar === 'edit-site/global-styles',
28
+ };
29
+ }, [] );
30
+
31
+ if ( ! isActive || ! isStylesOpen ) {
32
+ return null;
33
+ }
34
+
35
+ const welcomeLabel = __( 'Welcome to Styles' );
36
+
37
+ return (
38
+ <Guide
39
+ className="editor-welcome-guide guide-styles"
40
+ contentLabel={ welcomeLabel }
41
+ finishButtonText={ __( 'Get started' ) }
42
+ onFinish={ () => toggle( 'core/edit-site', 'welcomeGuideStyles' ) }
43
+ pages={ [
44
+ {
45
+ image: (
46
+ <WelcomeGuideImage
47
+ nonAnimatedSrc="https://s.w.org/images/block-editor/welcome-to-styles.svg?1"
48
+ animatedSrc="https://s.w.org/images/block-editor/welcome-to-styles.gif?1"
49
+ />
50
+ ),
51
+ content: (
52
+ <>
53
+ <h1 className="editor-welcome-guide__heading">
54
+ { welcomeLabel }
55
+ </h1>
56
+ <p className="editor-welcome-guide__text">
57
+ { __(
58
+ 'Tweak your site, or give it a whole new look! Get creative — how about a new color palette for your buttons, or choosing a new font? Take a look at what you can do here.'
59
+ ) }
60
+ </p>
61
+ </>
62
+ ),
63
+ },
64
+ {
65
+ image: (
66
+ <WelcomeGuideImage
67
+ nonAnimatedSrc="https://s.w.org/images/block-editor/set-the-design.svg?1"
68
+ animatedSrc="https://s.w.org/images/block-editor/set-the-design.gif?1"
69
+ />
70
+ ),
71
+ content: (
72
+ <>
73
+ <h1 className="editor-welcome-guide__heading">
74
+ { __( 'Set the design' ) }
75
+ </h1>
76
+ <p className="editor-welcome-guide__text">
77
+ { __(
78
+ 'You can customize your site as much as you like with different colors, typography, and layouts. Or if you prefer, just leave it up to your theme to handle!'
79
+ ) }
80
+ </p>
81
+ </>
82
+ ),
83
+ },
84
+ {
85
+ image: (
86
+ <WelcomeGuideImage
87
+ nonAnimatedSrc="https://s.w.org/images/block-editor/personalize-blocks.svg?1"
88
+ animatedSrc="https://s.w.org/images/block-editor/personalize-blocks.gif?1"
89
+ />
90
+ ),
91
+ content: (
92
+ <>
93
+ <h1 className="editor-welcome-guide__heading">
94
+ { __( 'Personalize blocks' ) }
95
+ </h1>
96
+ <p className="editor-welcome-guide__text">
97
+ { __(
98
+ 'You can adjust your blocks to ensure a cohesive experience across your site — add your unique colors to a branded Button block, or adjust the Heading block to your preferred size.'
99
+ ) }
100
+ </p>
101
+ </>
102
+ ),
103
+ },
104
+ {
105
+ image: (
106
+ <WelcomeGuideImage
107
+ nonAnimatedSrc="https://s.w.org/images/block-editor/welcome-documentation.svg"
108
+ animatedSrc="https://s.w.org/images/block-editor/welcome-documentation.gif"
109
+ />
110
+ ),
111
+ content: (
112
+ <>
113
+ <h1 className="editor-welcome-guide__heading">
114
+ { __( 'Learn more' ) }
115
+ </h1>
116
+ <p className="editor-welcome-guide__text">
117
+ { __(
118
+ 'New to block themes and styling your site?'
119
+ ) }{ ' ' }
120
+ <ExternalLink
121
+ href={ __(
122
+ 'https://wordpress.org/documentation/article/styles-overview/'
123
+ ) }
124
+ >
125
+ { __(
126
+ 'Here’s a detailed guide to learn how to make the most of it.'
127
+ ) }
128
+ </ExternalLink>
129
+ </p>
130
+ </>
131
+ ),
132
+ },
133
+ ] }
134
+ />
135
+ );
136
+ }
@@ -12,7 +12,6 @@ import { PinnedItems } from '@wordpress/interface';
12
12
  /**
13
13
  * Internal dependencies
14
14
  */
15
- import CollabSidebar from '../collab-sidebar';
16
15
  import BackButton, { useHasBackButton } from './back-button';
17
16
  import CollapsibleBlockToolbar from '../collapsible-block-toolbar';
18
17
  import DocumentBar from '../document-bar';
@@ -24,7 +23,6 @@ import PostSavedState from '../post-saved-state';
24
23
  import PostViewLink from '../post-view-link';
25
24
  import PreviewDropdown from '../preview-dropdown';
26
25
  import ZoomOutToggle from '../zoom-out-toggle';
27
- import PostTypeSupportCheck from '../post-type-support-check';
28
26
  import { store as editorStore } from '../../store';
29
27
  import {
30
28
  TEMPLATE_PART_POST_TYPE,
@@ -52,9 +50,7 @@ const backButtonVariations = {
52
50
  function Header( {
53
51
  customSaveButton,
54
52
  forceIsDirty,
55
- forceDisableBlockTools,
56
53
  setEntitiesSavedStatesCallback,
57
- title,
58
54
  } ) {
59
55
  const isWideViewport = useViewportMatch( 'large' );
60
56
  const isLargeViewport = useViewportMatch( 'medium' );
@@ -67,6 +63,7 @@ function Header( {
67
63
  hasFixedToolbar,
68
64
  hasBlockSelection,
69
65
  hasSectionRootClientId,
66
+ isStylesCanvasActive,
70
67
  } = useSelect( ( select ) => {
71
68
  const { get: getPreference } = select( preferencesStore );
72
69
  const {
@@ -74,6 +71,9 @@ function Header( {
74
71
  getCurrentPostType,
75
72
  isPublishSidebarOpened: _isPublishSidebarOpened,
76
73
  } = select( editorStore );
74
+ const { getStylesPath, getShowStylebook } = unlock(
75
+ select( editorStore )
76
+ );
77
77
  const { getBlockSelectionStart, getSectionRootClientId } = unlock(
78
78
  select( blockEditorStore )
79
79
  );
@@ -86,6 +86,9 @@ function Header( {
86
86
  hasFixedToolbar: getPreference( 'core', 'fixedToolbar' ),
87
87
  hasBlockSelection: !! getBlockSelectionStart(),
88
88
  hasSectionRootClientId: !! getSectionRootClientId(),
89
+ isStylesCanvasActive:
90
+ !! getStylesPath()?.startsWith( '/revisions' ) ||
91
+ getShowStylebook(),
89
92
  };
90
93
  }, [] );
91
94
 
@@ -98,7 +101,7 @@ function Header( {
98
101
  NAVIGATION_POST_TYPE,
99
102
  TEMPLATE_PART_POST_TYPE,
100
103
  PATTERN_POST_TYPE,
101
- ].includes( postType ) || forceDisableBlockTools;
104
+ ].includes( postType ) || isStylesCanvasActive;
102
105
 
103
106
  const [ isBlockToolsCollapsed, setIsBlockToolsCollapsed ] =
104
107
  useState( true );
@@ -131,7 +134,7 @@ function Header( {
131
134
  transition={ { type: 'tween' } }
132
135
  >
133
136
  <DocumentTools
134
- disableBlockTools={ forceDisableBlockTools || isTextEditor }
137
+ disableBlockTools={ isStylesCanvasActive || isTextEditor }
135
138
  />
136
139
  { hasFixedToolbar && isLargeViewport && (
137
140
  <CollapsibleBlockToolbar
@@ -146,7 +149,7 @@ function Header( {
146
149
  variants={ toolbarVariations }
147
150
  transition={ { type: 'tween' } }
148
151
  >
149
- <DocumentBar title={ title } />
152
+ <DocumentBar />
150
153
  </motion.div>
151
154
  ) }
152
155
  <motion.div
@@ -178,7 +181,7 @@ function Header( {
178
181
  />
179
182
 
180
183
  { isWideViewport && canBeZoomedOut && (
181
- <ZoomOutToggle disabled={ forceDisableBlockTools } />
184
+ <ZoomOutToggle disabled={ isStylesCanvasActive } />
182
185
  ) }
183
186
 
184
187
  { ( isWideViewport || ! showIconLabels ) && (
@@ -193,11 +196,6 @@ function Header( {
193
196
  }
194
197
  />
195
198
  ) }
196
-
197
- <PostTypeSupportCheck supportKeys="editor.notes">
198
- <CollabSidebar />
199
- </PostTypeSupportCheck>
200
-
201
199
  { customSaveButton }
202
200
  <MoreMenu />
203
201
  </motion.div>
@@ -25,15 +25,19 @@ import {
25
25
  MediaUpload,
26
26
  MediaUploadCheck,
27
27
  store as blockEditorStore,
28
+ privateApis as blockEditorPrivateApis,
28
29
  } from '@wordpress/block-editor';
29
30
  import { store as coreStore } from '@wordpress/core-data';
30
31
 
31
32
  /**
32
33
  * Internal dependencies
33
34
  */
35
+ import { unlock } from '../../lock-unlock';
34
36
  import PostFeaturedImageCheck from './check';
35
37
  import { store as editorStore } from '../../store';
36
38
 
39
+ const { MediaUploadModal } = unlock( blockEditorPrivateApis );
40
+
37
41
  const ALLOWED_MEDIA_TYPES = [ 'image' ];
38
42
 
39
43
  // Used when labels from post type were not yet loaded or when they are not present.
@@ -48,6 +52,45 @@ const instructions = (
48
52
  </p>
49
53
  );
50
54
 
55
+ /**
56
+ * Conditional Media component that uses MediaUploadModal when experiment is enabled,
57
+ * otherwise falls back to MediaUpload.
58
+ *
59
+ * @param {Object} root0 Component props.
60
+ * @param {Function} root0.render Render prop function that receives { open } object.
61
+ * @return {JSX.Element} The component.
62
+ */
63
+ function ConditionalMediaUpload( { render, ...props } ) {
64
+ const [ isModalOpen, setIsModalOpen ] = useState( false );
65
+ const mediaUpload = useSelect( ( select ) => {
66
+ const { getSettings } = select( blockEditorStore );
67
+ return getSettings().mediaUpload;
68
+ }, [] );
69
+
70
+ if ( window.__experimentalDataViewsMediaModal ) {
71
+ return (
72
+ <>
73
+ { render && render( { open: () => setIsModalOpen( true ) } ) }
74
+ <MediaUploadModal
75
+ { ...props }
76
+ isOpen={ isModalOpen }
77
+ onClose={ () => {
78
+ setIsModalOpen( false );
79
+ props.onClose?.();
80
+ } }
81
+ onSelect={ ( media ) => {
82
+ setIsModalOpen( false );
83
+ props.onSelect?.( media );
84
+ } }
85
+ onUpload={ mediaUpload }
86
+ />
87
+ </>
88
+ );
89
+ }
90
+
91
+ return <MediaUpload { ...props } render={ render } />;
92
+ }
93
+
51
94
  function getMediaDetails( media, postId ) {
52
95
  if ( ! media ) {
53
96
  return {};
@@ -181,7 +224,7 @@ function PostFeaturedImage( {
181
224
  </div>
182
225
  ) }
183
226
  <MediaUploadCheck fallback={ instructions }>
184
- <MediaUpload
227
+ <ConditionalMediaUpload
185
228
  title={
186
229
  postType?.labels?.featured_image ||
187
230
  DEFAULT_FEATURE_IMAGE_LABEL
@@ -52,57 +52,16 @@ export function useAllowSwitchingTemplates() {
52
52
  }
53
53
 
54
54
  function useTemplates( postType ) {
55
- // To do: create a new selector to checks if templates exist at all instead
56
- // of and unbound request. In the modal, the user templates should be
57
- // paginated and we should not make an unbound request.
58
- const { defaultTemplateTypes, registeredTemplates, userTemplates } =
59
- useSelect(
60
- ( select ) => {
61
- return {
62
- defaultTemplateTypes:
63
- select( coreStore ).getCurrentTheme()
64
- ?.default_template_types,
65
- registeredTemplates: select( coreStore ).getEntityRecords(
66
- 'postType',
67
- 'wp_registered_template',
68
- {
69
- per_page: -1,
70
- post_type: postType,
71
- }
72
- ),
73
- userTemplates: select( coreStore ).getEntityRecords(
74
- 'postType',
75
- 'wp_template',
76
- { per_page: -1, combinedTemplates: false }
77
- ),
78
- };
79
- },
80
- [ postType ]
81
- );
82
-
83
- return useMemo( () => {
84
- if (
85
- ! defaultTemplateTypes ||
86
- ! registeredTemplates ||
87
- ! userTemplates
88
- ) {
89
- return [];
90
- }
91
- return [
92
- ...registeredTemplates,
93
- ...userTemplates.filter(
94
- ( template ) =>
95
- // Only give "custom" templates as an option, which
96
- // means the is_wp_suggestion meta field is not set and
97
- // the slug is not found in the default template types.
98
- // https://github.com/WordPress/wordpress-develop/blob/97382397b2bd7c85aef6d4cd1c10bafd397957fc/src/wp-includes/block-template-utils.php#L858-L867
99
- ! template.meta.is_wp_suggestion &&
100
- ! defaultTemplateTypes.find(
101
- ( type ) => type.slug === template.slug
102
- )
103
- ),
104
- ];
105
- }, [ registeredTemplates, userTemplates, defaultTemplateTypes ] );
55
+ return useSelect(
56
+ ( select ) =>
57
+ select( coreStore ).getEntityRecords( 'postType', 'wp_template', {
58
+ per_page: -1,
59
+ post_type: postType,
60
+ // We look at the combined templates for now (old endpoint)
61
+ // because posts only accept slugs for templates, not IDs.
62
+ } ),
63
+ [ postType ]
64
+ );
106
65
  }
107
66
 
108
67
  export function useAvailableTemplates( postType ) {
@@ -219,10 +219,7 @@ export const ExperimentalEditorProvider = withRegistryProvider(
219
219
  const defaultBlockContext = useMemo( () => {
220
220
  const postContext = {};
221
221
  // If it is a template, try to inherit the post type from the name.
222
- if (
223
- post.type === 'wp_template' ||
224
- post.type === 'wp_registered_template'
225
- ) {
222
+ if ( post.type === 'wp_template' ) {
226
223
  if ( post.slug === 'page' ) {
227
224
  postContext.postType = 'page';
228
225
  } else if ( post.slug === 'single' ) {
@@ -0,0 +1,97 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ // @wordpress/blocks imports are not typed.
5
+ // @ts-expect-error
6
+ import { getCategories } from '@wordpress/blocks';
7
+
8
+ /**
9
+ * Internal dependencies
10
+ */
11
+ import type {
12
+ BlockExample,
13
+ StyleBookCategory,
14
+ CategoryExamples,
15
+ } from './types';
16
+ import {
17
+ STYLE_BOOK_CATEGORIES,
18
+ STYLE_BOOK_THEME_SUBCATEGORIES,
19
+ } from './constants';
20
+
21
+ /**
22
+ * Returns category examples for a given category definition and list of examples.
23
+ * @param {StyleBookCategory} categoryDefinition The category definition.
24
+ * @param {BlockExample[]} examples An array of block examples.
25
+ * @return {CategoryExamples|undefined} An object containing the category examples.
26
+ */
27
+ export function getExamplesByCategory(
28
+ categoryDefinition: StyleBookCategory,
29
+ examples: BlockExample[]
30
+ ): CategoryExamples | undefined {
31
+ if ( ! categoryDefinition?.slug || ! examples?.length ) {
32
+ return;
33
+ }
34
+ const categories: CategoryExamples[] =
35
+ categoryDefinition?.subcategories ?? [];
36
+ if ( categories.length ) {
37
+ return categories.reduce(
38
+ ( acc, subcategoryDefinition ) => {
39
+ const subcategoryExamples = getExamplesByCategory(
40
+ subcategoryDefinition,
41
+ examples
42
+ );
43
+ if ( subcategoryExamples ) {
44
+ if ( ! acc.subcategories ) {
45
+ acc.subcategories = [];
46
+ }
47
+ acc.subcategories = [
48
+ ...acc.subcategories,
49
+ subcategoryExamples,
50
+ ];
51
+ }
52
+ return acc;
53
+ },
54
+ {
55
+ title: categoryDefinition.title,
56
+ slug: categoryDefinition.slug,
57
+ }
58
+ );
59
+ }
60
+
61
+ const blocksToInclude = categoryDefinition?.blocks || [];
62
+ const blocksToExclude = categoryDefinition?.exclude || [];
63
+ const categoryExamples = examples.filter( ( example ) => {
64
+ return (
65
+ ! blocksToExclude.includes( example.name ) &&
66
+ ( example.category === categoryDefinition.slug ||
67
+ blocksToInclude.includes( example.name ) )
68
+ );
69
+ } );
70
+
71
+ if ( ! categoryExamples.length ) {
72
+ return;
73
+ }
74
+
75
+ return {
76
+ title: categoryDefinition.title,
77
+ slug: categoryDefinition.slug,
78
+ examples: categoryExamples,
79
+ };
80
+ }
81
+
82
+ /**
83
+ * Returns category examples for a given category definition and list of examples.
84
+ *
85
+ * @return {StyleBookCategory[]} An array of top-level category definitions.
86
+ */
87
+ export function getTopLevelStyleBookCategories(): StyleBookCategory[] {
88
+ const reservedCategories = [
89
+ ...STYLE_BOOK_THEME_SUBCATEGORIES,
90
+ ...STYLE_BOOK_CATEGORIES,
91
+ ].map( ( { slug } ) => slug );
92
+ const extraCategories: StyleBookCategory[] = getCategories();
93
+ const extraCategoriesFiltered = extraCategories.filter(
94
+ ( { slug } ) => ! reservedCategories.includes( slug )
95
+ );
96
+ return [ ...STYLE_BOOK_CATEGORIES, ...extraCategoriesFiltered ];
97
+ }
@@ -0,0 +1,56 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import clsx from 'clsx';
5
+
6
+ /**
7
+ * WordPress dependencies
8
+ */
9
+ import { __experimentalGrid as Grid } from '@wordpress/components';
10
+ import {
11
+ getColorClassName,
12
+ __experimentalGetGradientClass,
13
+ // @wordpress/block-editor imports are not typed.
14
+ // @ts-expect-error
15
+ } from '@wordpress/block-editor';
16
+
17
+ /**
18
+ * Internal dependencies
19
+ */
20
+ import type { Color, Gradient, ColorExampleProps } from './types';
21
+
22
+ const ColorExamples = ( {
23
+ colors,
24
+ type,
25
+ templateColumns = '1fr 1fr',
26
+ itemHeight = '52px',
27
+ }: ColorExampleProps ): JSX.Element | null => {
28
+ if ( ! colors ) {
29
+ return null;
30
+ }
31
+
32
+ return (
33
+ <Grid templateColumns={ templateColumns } rowGap={ 8 } columnGap={ 16 }>
34
+ { colors.map( ( color: Color | Gradient ) => {
35
+ const className =
36
+ type === 'gradients'
37
+ ? __experimentalGetGradientClass( color.slug )
38
+ : getColorClassName( 'background-color', color.slug );
39
+ const classes = clsx(
40
+ 'editor-style-book__color-example',
41
+ className
42
+ );
43
+
44
+ return (
45
+ <div
46
+ key={ color.slug }
47
+ className={ classes }
48
+ style={ { height: itemHeight } }
49
+ />
50
+ );
51
+ } ) }
52
+ </Grid>
53
+ );
54
+ };
55
+
56
+ export default ColorExamples;