@wordpress/editor 14.33.3 → 14.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (301) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/collab-sidebar/comment-author-info.js +26 -14
  3. package/build/components/collab-sidebar/comment-author-info.js.map +2 -2
  4. package/build/components/document-bar/index.js +16 -3
  5. package/build/components/document-bar/index.js.map +2 -2
  6. package/build/components/editor/index.js +23 -4
  7. package/build/components/editor/index.js.map +3 -3
  8. package/build/components/editor-interface/index.js +15 -10
  9. package/build/components/editor-interface/index.js.map +3 -3
  10. package/build/components/entities-saved-states/entity-type-list.js +19 -15
  11. package/build/components/entities-saved-states/entity-type-list.js.map +3 -3
  12. package/build/components/global-styles/block-link.js +70 -0
  13. package/build/components/global-styles/block-link.js.map +7 -0
  14. package/build/components/global-styles/header.js +54 -0
  15. package/build/components/global-styles/header.js.map +7 -0
  16. package/build/components/global-styles/hooks.js +176 -0
  17. package/build/components/global-styles/hooks.js.map +7 -0
  18. package/build/components/global-styles/index.js +138 -0
  19. package/build/components/global-styles/index.js.map +7 -0
  20. package/build/components/global-styles/menu.js +95 -0
  21. package/build/components/global-styles/menu.js.map +7 -0
  22. package/build/components/global-styles-provider/index.js +3 -49
  23. package/build/components/global-styles-provider/index.js.map +3 -3
  24. package/build/components/global-styles-renderer/index.js +55 -0
  25. package/build/components/global-styles-renderer/index.js.map +7 -0
  26. package/build/components/global-styles-sidebar/default-sidebar.js +66 -0
  27. package/build/components/global-styles-sidebar/default-sidebar.js.map +7 -0
  28. package/build/components/global-styles-sidebar/index.js +182 -0
  29. package/build/components/global-styles-sidebar/index.js.map +7 -0
  30. package/build/components/global-styles-sidebar/welcome-guide-image.js +37 -0
  31. package/build/components/global-styles-sidebar/welcome-guide-image.js.map +7 -0
  32. package/build/components/global-styles-sidebar/welcome-guide.js +143 -0
  33. package/build/components/global-styles-sidebar/welcome-guide.js.map +7 -0
  34. package/build/components/header/index.js +12 -9
  35. package/build/components/header/index.js.map +2 -2
  36. package/build/components/post-featured-image/index.js +32 -1
  37. package/build/components/post-featured-image/index.js.map +3 -3
  38. package/build/components/provider/index.js +0 -2
  39. package/build/components/provider/index.js.map +3 -3
  40. package/build/components/style-book/categories.js +86 -0
  41. package/build/components/style-book/categories.js.map +7 -0
  42. package/build/components/style-book/color-examples.js +64 -0
  43. package/build/components/style-book/color-examples.js.map +7 -0
  44. package/build/components/style-book/constants.js +319 -0
  45. package/build/components/style-book/constants.js.map +7 -0
  46. package/build/components/style-book/duotone-examples.js +68 -0
  47. package/build/components/style-book/duotone-examples.js.map +7 -0
  48. package/build/components/style-book/examples.js +237 -0
  49. package/build/components/style-book/examples.js.map +7 -0
  50. package/build/components/style-book/index.js +627 -0
  51. package/build/components/style-book/index.js.map +7 -0
  52. package/build/components/style-book/types.js +17 -0
  53. package/build/components/style-book/types.js.map +7 -0
  54. package/build/components/styles-canvas/index.js +138 -0
  55. package/build/components/styles-canvas/index.js.map +7 -0
  56. package/build/components/styles-canvas/revisions.js +121 -0
  57. package/build/components/styles-canvas/revisions.js.map +7 -0
  58. package/build/components/styles-canvas/style-book.js +68 -0
  59. package/build/components/styles-canvas/style-book.js.map +7 -0
  60. package/build/components/visual-editor/index.js +4 -3
  61. package/build/components/visual-editor/index.js.map +2 -2
  62. package/build/dataviews/fields/content-preview/content-preview-view.js.map +2 -2
  63. package/build/hooks/index.js +1 -0
  64. package/build/hooks/index.js.map +2 -2
  65. package/build/hooks/media-upload.js +15 -4
  66. package/build/hooks/media-upload.js.map +3 -3
  67. package/build/hooks/push-changes-to-global-styles/index.js +322 -0
  68. package/build/hooks/push-changes-to-global-styles/index.js.map +7 -0
  69. package/build/hooks/use-global-styles-output.js +74 -0
  70. package/build/hooks/use-global-styles-output.js.map +7 -0
  71. package/build/private-apis.js +10 -5
  72. package/build/private-apis.js.map +3 -3
  73. package/build/store/private-actions.js +23 -0
  74. package/build/store/private-actions.js.map +2 -2
  75. package/build/store/private-selectors.js +10 -0
  76. package/build/store/private-selectors.js.map +2 -2
  77. package/build/store/reducer.js +24 -0
  78. package/build/store/reducer.js.map +2 -2
  79. package/build/{components/editor-interface/content-slot-fill.js → utils/set-nested-value.js} +24 -10
  80. package/build/utils/set-nested-value.js.map +7 -0
  81. package/build-module/components/collab-sidebar/comment-author-info.js +26 -14
  82. package/build-module/components/collab-sidebar/comment-author-info.js.map +2 -2
  83. package/build-module/components/document-bar/index.js +16 -3
  84. package/build-module/components/document-bar/index.js.map +2 -2
  85. package/build-module/components/editor/index.js +23 -4
  86. package/build-module/components/editor/index.js.map +2 -2
  87. package/build-module/components/editor-interface/index.js +15 -10
  88. package/build-module/components/editor-interface/index.js.map +2 -2
  89. package/build-module/components/entities-saved-states/entity-type-list.js +18 -14
  90. package/build-module/components/entities-saved-states/entity-type-list.js.map +2 -2
  91. package/build-module/components/global-styles/block-link.js +46 -0
  92. package/build-module/components/global-styles/block-link.js.map +7 -0
  93. package/build-module/components/global-styles/header.js +41 -0
  94. package/build-module/components/global-styles/header.js.map +7 -0
  95. package/build-module/components/global-styles/hooks.js +154 -0
  96. package/build-module/components/global-styles/hooks.js.map +7 -0
  97. package/build-module/components/global-styles/index.js +112 -0
  98. package/build-module/components/global-styles/index.js.map +7 -0
  99. package/build-module/components/global-styles/menu.js +71 -0
  100. package/build-module/components/global-styles/menu.js.map +7 -0
  101. package/build-module/components/global-styles-provider/index.js +3 -37
  102. package/build-module/components/global-styles-provider/index.js.map +2 -2
  103. package/build-module/components/global-styles-renderer/index.js +31 -0
  104. package/build-module/components/global-styles-renderer/index.js.map +7 -0
  105. package/build-module/components/global-styles-sidebar/default-sidebar.js +49 -0
  106. package/build-module/components/global-styles-sidebar/default-sidebar.js.map +7 -0
  107. package/build-module/components/global-styles-sidebar/index.js +152 -0
  108. package/build-module/components/global-styles-sidebar/index.js.map +7 -0
  109. package/build-module/components/global-styles-sidebar/welcome-guide-image.js +17 -0
  110. package/build-module/components/global-styles-sidebar/welcome-guide-image.js.map +7 -0
  111. package/build-module/components/global-styles-sidebar/welcome-guide.js +113 -0
  112. package/build-module/components/global-styles-sidebar/welcome-guide.js.map +7 -0
  113. package/build-module/components/header/index.js +12 -9
  114. package/build-module/components/header/index.js.map +2 -2
  115. package/build-module/components/post-featured-image/index.js +35 -3
  116. package/build-module/components/post-featured-image/index.js.map +2 -2
  117. package/build-module/components/provider/index.js +0 -2
  118. package/build-module/components/provider/index.js.map +2 -2
  119. package/build-module/components/style-book/categories.js +64 -0
  120. package/build-module/components/style-book/categories.js.map +7 -0
  121. package/build-module/components/style-book/color-examples.js +37 -0
  122. package/build-module/components/style-book/color-examples.js.map +7 -0
  123. package/build-module/components/style-book/constants.js +290 -0
  124. package/build-module/components/style-book/constants.js.map +7 -0
  125. package/build-module/components/style-book/duotone-examples.js +48 -0
  126. package/build-module/components/style-book/duotone-examples.js.map +7 -0
  127. package/build-module/components/style-book/examples.js +208 -0
  128. package/build-module/components/style-book/examples.js.map +7 -0
  129. package/build-module/components/style-book/index.js +618 -0
  130. package/build-module/components/style-book/index.js.map +7 -0
  131. package/build-module/components/style-book/types.js +1 -0
  132. package/build-module/components/style-book/types.js.map +7 -0
  133. package/build-module/components/styles-canvas/index.js +104 -0
  134. package/build-module/components/styles-canvas/index.js.map +7 -0
  135. package/build-module/components/styles-canvas/revisions.js +107 -0
  136. package/build-module/components/styles-canvas/revisions.js.map +7 -0
  137. package/build-module/components/styles-canvas/style-book.js +38 -0
  138. package/build-module/components/styles-canvas/style-book.js.map +7 -0
  139. package/build-module/components/visual-editor/index.js +4 -3
  140. package/build-module/components/visual-editor/index.js.map +2 -2
  141. package/build-module/dataviews/fields/content-preview/content-preview-view.js.map +2 -2
  142. package/build-module/hooks/index.js +1 -0
  143. package/build-module/hooks/index.js.map +2 -2
  144. package/build-module/hooks/media-upload.js +19 -5
  145. package/build-module/hooks/media-upload.js.map +2 -2
  146. package/build-module/hooks/push-changes-to-global-styles/index.js +309 -0
  147. package/build-module/hooks/push-changes-to-global-styles/index.js.map +7 -0
  148. package/build-module/hooks/use-global-styles-output.js +49 -0
  149. package/build-module/hooks/use-global-styles-output.js.map +7 -0
  150. package/build-module/private-apis.js +10 -8
  151. package/build-module/private-apis.js.map +2 -2
  152. package/build-module/store/private-actions.js +20 -0
  153. package/build-module/store/private-actions.js.map +2 -2
  154. package/build-module/store/private-selectors.js +8 -0
  155. package/build-module/store/private-selectors.js.map +2 -2
  156. package/build-module/store/reducer.js +22 -0
  157. package/build-module/store/reducer.js.map +2 -2
  158. package/build-module/utils/set-nested-value.js +23 -0
  159. package/build-module/utils/set-nested-value.js.map +7 -0
  160. package/build-style/style-rtl.css +3017 -11
  161. package/build-style/style.css +3018 -11
  162. package/build-types/components/collab-sidebar/comment-author-info.d.ts +5 -16
  163. package/build-types/components/collab-sidebar/comment-author-info.d.ts.map +1 -1
  164. package/build-types/components/document-bar/index.d.ts +2 -2
  165. package/build-types/components/document-bar/index.d.ts.map +1 -1
  166. package/build-types/components/editor/index.d.ts.map +1 -1
  167. package/build-types/components/editor-interface/index.d.ts +1 -3
  168. package/build-types/components/editor-interface/index.d.ts.map +1 -1
  169. package/build-types/components/entities-saved-states/entity-type-list.d.ts.map +1 -1
  170. package/build-types/components/global-styles/block-link.d.ts +12 -0
  171. package/build-types/components/global-styles/block-link.d.ts.map +1 -0
  172. package/build-types/components/global-styles/header.d.ts +7 -0
  173. package/build-types/components/global-styles/header.d.ts.map +1 -0
  174. package/build-types/components/global-styles/hooks.d.ts +24 -0
  175. package/build-types/components/global-styles/hooks.d.ts.map +1 -0
  176. package/build-types/components/global-styles/index.d.ts +6 -0
  177. package/build-types/components/global-styles/index.d.ts.map +1 -0
  178. package/build-types/components/global-styles/menu.d.ts +13 -0
  179. package/build-types/components/global-styles/menu.d.ts.map +1 -0
  180. package/build-types/components/global-styles-provider/index.d.ts +1 -5
  181. package/build-types/components/global-styles-provider/index.d.ts.map +1 -1
  182. package/build-types/components/global-styles-renderer/index.d.ts +4 -0
  183. package/build-types/components/global-styles-renderer/index.d.ts.map +1 -0
  184. package/build-types/components/global-styles-sidebar/default-sidebar.d.ts +13 -0
  185. package/build-types/components/global-styles-sidebar/default-sidebar.d.ts.map +1 -0
  186. package/build-types/components/global-styles-sidebar/index.d.ts +2 -0
  187. package/build-types/components/global-styles-sidebar/index.d.ts.map +1 -0
  188. package/build-types/components/global-styles-sidebar/welcome-guide-image.d.ts +5 -0
  189. package/build-types/components/global-styles-sidebar/welcome-guide-image.d.ts.map +1 -0
  190. package/build-types/components/global-styles-sidebar/welcome-guide.d.ts +2 -0
  191. package/build-types/components/global-styles-sidebar/welcome-guide.d.ts.map +1 -0
  192. package/build-types/components/header/index.d.ts +1 -3
  193. package/build-types/components/header/index.d.ts.map +1 -1
  194. package/build-types/components/provider/index.d.ts.map +1 -1
  195. package/build-types/components/style-book/categories.d.ts +18 -0
  196. package/build-types/components/style-book/categories.d.ts.map +1 -0
  197. package/build-types/components/style-book/color-examples.d.ts +7 -0
  198. package/build-types/components/style-book/color-examples.d.ts.map +1 -0
  199. package/build-types/components/style-book/constants.d.ts +11 -0
  200. package/build-types/components/style-book/constants.d.ts.map +1 -0
  201. package/build-types/components/style-book/duotone-examples.d.ts +9 -0
  202. package/build-types/components/style-book/duotone-examples.d.ts.map +1 -0
  203. package/build-types/components/style-book/examples.d.ts +12 -0
  204. package/build-types/components/style-book/examples.d.ts.map +1 -0
  205. package/build-types/components/style-book/index.d.ts +31 -0
  206. package/build-types/components/style-book/index.d.ts.map +1 -0
  207. package/build-types/components/style-book/types.d.ts +72 -0
  208. package/build-types/components/style-book/types.d.ts.map +1 -0
  209. package/build-types/components/styles-canvas/index.d.ts +16 -0
  210. package/build-types/components/styles-canvas/index.d.ts.map +1 -0
  211. package/build-types/components/styles-canvas/revisions.d.ts +5 -0
  212. package/build-types/components/styles-canvas/revisions.d.ts.map +1 -0
  213. package/build-types/components/styles-canvas/style-book.d.ts +6 -0
  214. package/build-types/components/styles-canvas/style-book.d.ts.map +1 -0
  215. package/build-types/components/visual-editor/index.d.ts +1 -2
  216. package/build-types/components/visual-editor/index.d.ts.map +1 -1
  217. package/build-types/dataviews/fields/content-preview/content-preview-view.d.ts.map +1 -1
  218. package/build-types/hooks/push-changes-to-global-styles/index.d.ts +2 -0
  219. package/build-types/hooks/push-changes-to-global-styles/index.d.ts.map +1 -0
  220. package/build-types/hooks/use-global-styles-output.d.ts +18 -0
  221. package/build-types/hooks/use-global-styles-output.d.ts.map +1 -0
  222. package/build-types/private-apis.d.ts.map +1 -1
  223. package/build-types/store/private-actions.d.ts +20 -0
  224. package/build-types/store/private-actions.d.ts.map +1 -1
  225. package/build-types/store/private-selectors.d.ts +14 -0
  226. package/build-types/store/private-selectors.d.ts.map +1 -1
  227. package/build-types/store/reducer.d.ts +20 -0
  228. package/build-types/store/reducer.d.ts.map +1 -1
  229. package/build-types/utils/set-nested-value.d.ts +20 -0
  230. package/build-types/utils/set-nested-value.d.ts.map +1 -0
  231. package/package.json +40 -40
  232. package/src/components/collab-sidebar/comment-author-info.js +32 -25
  233. package/src/components/collab-sidebar/style.scss +1 -1
  234. package/src/components/document-bar/index.js +18 -3
  235. package/src/components/editor/index.js +25 -1
  236. package/src/components/editor-help/style.scss +1 -1
  237. package/src/components/editor-interface/index.js +40 -39
  238. package/src/components/entities-saved-states/entity-type-list.js +19 -17
  239. package/src/components/global-styles/block-link.js +65 -0
  240. package/src/components/global-styles/header.js +48 -0
  241. package/src/components/global-styles/hooks.js +216 -0
  242. package/src/components/global-styles/index.js +125 -0
  243. package/src/components/global-styles/menu.js +101 -0
  244. package/src/components/global-styles/style.scss +11 -0
  245. package/src/components/global-styles-provider/index.js +3 -45
  246. package/src/components/global-styles-renderer/index.js +39 -0
  247. package/src/components/global-styles-sidebar/default-sidebar.js +46 -0
  248. package/src/components/global-styles-sidebar/index.js +177 -0
  249. package/src/components/global-styles-sidebar/style.scss +119 -0
  250. package/src/components/global-styles-sidebar/welcome-guide-image.js +11 -0
  251. package/src/components/global-styles-sidebar/welcome-guide.js +136 -0
  252. package/src/components/header/index.js +11 -6
  253. package/src/components/post-featured-image/index.js +44 -1
  254. package/src/components/post-last-revision/style.scss +1 -1
  255. package/src/components/post-panel-row/style.scss +1 -0
  256. package/src/components/post-publish-panel/style.scss +1 -1
  257. package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +2 -2
  258. package/src/components/provider/index.js +0 -2
  259. package/src/components/style-book/categories.ts +97 -0
  260. package/src/components/style-book/color-examples.tsx +56 -0
  261. package/src/components/style-book/constants.ts +308 -0
  262. package/src/components/style-book/duotone-examples.tsx +56 -0
  263. package/src/components/style-book/examples.tsx +273 -0
  264. package/src/components/style-book/index.js +794 -0
  265. package/src/components/style-book/style.scss +44 -0
  266. package/src/components/style-book/test/categories.js +166 -0
  267. package/src/components/style-book/types.ts +80 -0
  268. package/src/components/styles-canvas/index.js +126 -0
  269. package/src/components/styles-canvas/revisions.js +144 -0
  270. package/src/components/styles-canvas/style-book.js +57 -0
  271. package/src/components/styles-canvas/style.scss +40 -0
  272. package/src/components/visual-editor/index.js +2 -1
  273. package/src/dataviews/fields/content-preview/content-preview-view.tsx +2 -0
  274. package/src/hooks/index.js +1 -0
  275. package/src/hooks/media-upload.js +25 -5
  276. package/src/hooks/push-changes-to-global-styles/index.js +391 -0
  277. package/src/hooks/push-changes-to-global-styles/style.scss +4 -0
  278. package/src/hooks/use-global-styles-output.js +76 -0
  279. package/src/private-apis.js +10 -8
  280. package/src/store/private-actions.js +37 -0
  281. package/src/store/private-selectors.js +20 -0
  282. package/src/store/reducer.js +36 -0
  283. package/src/style.scss +7 -1
  284. package/src/utils/set-nested-value.js +39 -0
  285. package/tsconfig.json +3 -0
  286. package/tsconfig.tsbuildinfo +1 -1
  287. package/build/components/block-settings-menu/content-only-settings-menu.js +0 -186
  288. package/build/components/block-settings-menu/content-only-settings-menu.js.map +0 -7
  289. package/build/components/editor-interface/content-slot-fill.js.map +0 -7
  290. package/build-module/components/block-settings-menu/content-only-settings-menu.js +0 -161
  291. package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +0 -7
  292. package/build-module/components/editor-interface/content-slot-fill.js +0 -9
  293. package/build-module/components/editor-interface/content-slot-fill.js.map +0 -7
  294. package/build-types/components/block-settings-menu/content-only-settings-menu.d.ts +0 -2
  295. package/build-types/components/block-settings-menu/content-only-settings-menu.d.ts.map +0 -1
  296. package/build-types/components/editor-interface/content-slot-fill.d.ts +0 -14
  297. package/build-types/components/editor-interface/content-slot-fill.d.ts.map +0 -1
  298. package/src/components/block-settings-menu/content-only-settings-menu.js +0 -185
  299. package/src/components/block-settings-menu/content-only-settings-menu.native.js +0 -4
  300. package/src/components/block-settings-menu/style.scss +0 -6
  301. package/src/components/editor-interface/content-slot-fill.js +0 -10
@@ -3,6 +3,20 @@ export function getInserterSidebarToggleRef(state: any): any;
3
3
  export function getEntityActions(state: any, ...args: any[]): import("@wordpress/dataviews").Action<any>[];
4
4
  export function isEntityReady(state: any, ...args: any[]): boolean;
5
5
  export function getEntityFields(state: any, ...args: any[]): import("@wordpress/dataviews").Field<any>[];
6
+ /**
7
+ * Get the current global styles navigation path.
8
+ *
9
+ * @param {Object} state Global application state.
10
+ * @return {string} The current styles path.
11
+ */
12
+ export function getStylesPath(state: Object): string;
13
+ /**
14
+ * Get whether the stylebook is currently visible.
15
+ *
16
+ * @param {Object} state Global application state.
17
+ * @return {boolean} Whether the stylebook is visible.
18
+ */
19
+ export function getShowStylebook(state: Object): boolean;
6
20
  /**
7
21
  * Get the inserter.
8
22
  *
@@ -1 +1 @@
1
- {"version":3,"file":"private-selectors.d.ts","sourceRoot":"","sources":["../../src/store/private-selectors.js"],"names":[],"mappings":"AAsFA,sDAEC;AACD,6DAEC;AAsFD,2GAEC;AAED,mEAEC;AAED,yGAEC;AAjJD;;;;;;GAMG;AACH;;;;EAmCE;AAeF;;;;EAqCE;AAEF;;;;;;;;;GASG;AACH;;;;EA2BE;AAcF;;;;;;;;GAQG;AACH;;;;EAsBE;AAEF;;;;;;;GAOG;AACH;;;;EAyCE"}
1
+ {"version":3,"file":"private-selectors.d.ts","sourceRoot":"","sources":["../../src/store/private-selectors.js"],"names":[],"mappings":"AAsFA,sDAEC;AACD,6DAEC;AAsFD,2GAEC;AAED,mEAEC;AAED,yGAEC;AAsFD;;;;;GAKG;AACH,qCAHW,MAAM,GACL,MAAM,CAIjB;AAED;;;;;GAKG;AACH,wCAHW,MAAM,GACL,OAAO,CAIlB;AAzPD;;;;;;GAMG;AACH;;;;EAmCE;AAeF;;;;EAqCE;AAEF;;;;;;;;;GASG;AACH;;;;EA2BE;AAcF;;;;;;;;GAQG;AACH;;;;EAsBE;AAEF;;;;;;;GAOG;AACH;;;;EAyCE"}
@@ -176,6 +176,22 @@ export function listViewToggleRef(state?: Object): Object;
176
176
  */
177
177
  export function inserterSidebarToggleRef(state?: Object): Object;
178
178
  export function publishSidebarActive(state: boolean | undefined, action: any): boolean;
179
+ /**
180
+ * Reducer for the current global styles navigation path.
181
+ *
182
+ * @param {string} state Current state.
183
+ * @param {Object} action Dispatched action.
184
+ * @return {string} Updated state.
185
+ */
186
+ export function stylesPath(state: string | undefined, action: Object): string;
187
+ /**
188
+ * Reducer for whether the stylebook is visible.
189
+ *
190
+ * @param {boolean} state Current state.
191
+ * @param {Object} action Dispatched action.
192
+ * @return {boolean} Updated state.
193
+ */
194
+ export function showStylebook(state: boolean | undefined, action: Object): boolean;
179
195
  declare const _default: import("redux").Reducer<{
180
196
  postId: any;
181
197
  postType: any;
@@ -195,6 +211,8 @@ declare const _default: import("redux").Reducer<{
195
211
  listViewPanel: any;
196
212
  listViewToggleRef: Object;
197
213
  publishSidebarActive: boolean;
214
+ stylesPath: string;
215
+ showStylebook: boolean;
198
216
  dataviews: {
199
217
  actions: {
200
218
  [x: string]: Record<string, import("@wordpress/dataviews").Action<any>[]> | {
@@ -227,6 +245,8 @@ declare const _default: import("redux").Reducer<{
227
245
  listViewPanel: Object | undefined;
228
246
  listViewToggleRef: Object | undefined;
229
247
  publishSidebarActive: boolean | undefined;
248
+ stylesPath: string | undefined;
249
+ showStylebook: boolean | undefined;
230
250
  dataviews: never;
231
251
  }>>;
232
252
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../../src/store/reducer.js"],"names":[],"mappings":"AAWA;;;;;;;GAOG;AACH,uCAJW,GAAC,GAEA,GAAC,CAQZ;AAED;;;;;;;;GAQG;AACH,+BALW,MAAM,KACN,MAAM,GAEL,OAAO,CASlB;AAED;;;;;;;;;GASG;AACH,mDALW,MAAM,kBACN,MAAM,GAEL,OAAO,CAOlB;AAED;;;;;;;;;GASG;AACH,6CALW,MAAM,kBACN,MAAM,GAEL,OAAO,CAYlB;AAED,kEAOC;AAED,sEAOC;AAED,oEAOC;AAED;;;;;;;GAOG;AACH,gCALW,MAAM,sBACN,MAAM,GAEL,OAAO,CAYlB;AAED;;;;;;;;GAQG;AACH,8BALW,MAAM,sBACN,MAAM,GAEL,MAAM,CAajB;AAED;;;;;;;GAOG;AACH,gCALW,MAAM,sBACN,MAAM,GAEL,MAAM,CAYjB;AAED;;;;;;;;;GASG;AAEH;;;;;;;GAOG;AACH,gCALW,aAAa,sBACb,MAAM,GAEL,aAAa,CASxB;AAED;;;;;;;;;GASG;AACH,sCALW,aAAa,sBACb,MAAM,GAEL,aAAa,CAcxB;AAED;;;;;;;;;GASG;AACH,0CALW,aAAa,sBACb,MAAM,GAEL,aAAa,CAcxB;AAED;;;;;;;GAOG;AACH,sCALW,MAAM,sBACN,MAAM,GAEL,MAAM,CAYjB;AAED,2EAOC;AAED;;;;;;;GAOG;AACH,kCALW,MAAM,sBACN,MAAM,GAEL,MAAM,CASjB;AAED;;;;;;;GAOG;AACH,gEAJW,MAAM,SAahB;AAED;;;;;;;;GAQG;AACH,0CAHW,MAAM,sBACN,MAAM,OAUhB;AAED;;;;;;;;GAQG;AACH,qCAHW,MAAM,sBACN,MAAM,OAUhB;AAED;;;;;;GAMG;AACH,0CAHW,MAAM,GACL,MAAM,CAIjB;AAED;;;;;;GAMG;AACH,iDAHW,MAAM,GACL,MAAM,CAIjB;AAED,uFAUC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA9Ma,OAAO;;;;gBACN,OAAO,OAAA;;;;oBACP,OAAO,OAAA;;;;UACP,MAAM,OAAA"}
1
+ {"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../../src/store/reducer.js"],"names":[],"mappings":"AAWA;;;;;;;GAOG;AACH,uCAJW,GAAC,GAEA,GAAC,CAQZ;AAED;;;;;;;;GAQG;AACH,+BALW,MAAM,KACN,MAAM,GAEL,OAAO,CASlB;AAED;;;;;;;;;GASG;AACH,mDALW,MAAM,kBACN,MAAM,GAEL,OAAO,CAOlB;AAED;;;;;;;;;GASG;AACH,6CALW,MAAM,kBACN,MAAM,GAEL,OAAO,CAYlB;AAED,kEAOC;AAED,sEAOC;AAED,oEAOC;AAED;;;;;;;GAOG;AACH,gCALW,MAAM,sBACN,MAAM,GAEL,OAAO,CAYlB;AAED;;;;;;;;GAQG;AACH,8BALW,MAAM,sBACN,MAAM,GAEL,MAAM,CAajB;AAED;;;;;;;GAOG;AACH,gCALW,MAAM,sBACN,MAAM,GAEL,MAAM,CAYjB;AAED;;;;;;;;;GASG;AAEH;;;;;;;GAOG;AACH,gCALW,aAAa,sBACb,MAAM,GAEL,aAAa,CASxB;AAED;;;;;;;;;GASG;AACH,sCALW,aAAa,sBACb,MAAM,GAEL,aAAa,CAcxB;AAED;;;;;;;;;GASG;AACH,0CALW,aAAa,sBACb,MAAM,GAEL,aAAa,CAcxB;AAED;;;;;;;GAOG;AACH,sCALW,MAAM,sBACN,MAAM,GAEL,MAAM,CAYjB;AAED,2EAOC;AAED;;;;;;;GAOG;AACH,kCALW,MAAM,sBACN,MAAM,GAEL,MAAM,CASjB;AAED;;;;;;;GAOG;AACH,gEAJW,MAAM,SAahB;AAED;;;;;;;;GAQG;AACH,0CAHW,MAAM,sBACN,MAAM,OAUhB;AAED;;;;;;;;GAQG;AACH,qCAHW,MAAM,sBACN,MAAM,OAUhB;AAED;;;;;;GAMG;AACH,0CAHW,MAAM,GACL,MAAM,CAIjB;AAED;;;;;;GAMG;AACH,iDAHW,MAAM,GACL,MAAM,CAIjB;AAED,uFAUC;AAED;;;;;;GAMG;AACH,kCAJW,MAAM,sBACN,MAAM,GACL,MAAM,CAUjB;AAED;;;;;;GAMG;AACH,qCAJW,OAAO,sBACP,MAAM,GACL,OAAO,CAUlB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAhPa,OAAO;;;;gBACN,OAAO,OAAA;;;;oBACP,OAAO,OAAA;;;;UACP,MAAM,OAAA"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Sets the value at path of object.
3
+ * If a portion of path doesn’t exist, it’s created.
4
+ * Arrays are created for missing index properties while objects are created
5
+ * for all other missing properties.
6
+ *
7
+ * This function intentionally mutates the input object.
8
+ *
9
+ * Inspired by _.set().
10
+ *
11
+ * @see https://lodash.com/docs/4.17.15#set
12
+ *
13
+ * @todo Needs to be deduplicated with its copy in `@wordpress/core-data`.
14
+ *
15
+ * @param {Object} object Object to modify
16
+ * @param {Array} path Path of the property to set.
17
+ * @param {*} value Value to set.
18
+ */
19
+ export default function setNestedValue(object: Object, path: any[], value: any): Object;
20
+ //# sourceMappingURL=set-nested-value.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"set-nested-value.d.ts","sourceRoot":"","sources":["../../src/utils/set-nested-value.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,+CAJW,MAAM,sBAEN,GAAC,UAsBX"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/editor",
3
- "version": "14.33.3",
3
+ "version": "14.34.0",
4
4
  "description": "Enhanced block editor for WordPress posts.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -53,49 +53,49 @@
53
53
  ],
54
54
  "dependencies": {
55
55
  "@floating-ui/react-dom": "2.0.8",
56
- "@wordpress/a11y": "^4.33.1",
57
- "@wordpress/api-fetch": "^7.33.1",
58
- "@wordpress/base-styles": "^6.9.1",
59
- "@wordpress/blob": "^4.33.1",
60
- "@wordpress/block-editor": "^15.6.1",
61
- "@wordpress/blocks": "^15.6.1",
62
- "@wordpress/commands": "^1.33.1",
63
- "@wordpress/components": "^30.6.1",
64
- "@wordpress/compose": "^7.33.1",
65
- "@wordpress/core-data": "^7.33.1",
66
- "@wordpress/data": "^10.33.1",
67
- "@wordpress/dataviews": "^10.1.1",
68
- "@wordpress/date": "^5.33.1",
69
- "@wordpress/deprecated": "^4.33.1",
70
- "@wordpress/dom": "^4.33.1",
71
- "@wordpress/element": "^6.33.1",
72
- "@wordpress/fields": "^0.25.3",
73
- "@wordpress/hooks": "^4.33.1",
74
- "@wordpress/html-entities": "^4.33.1",
75
- "@wordpress/i18n": "^6.6.1",
76
- "@wordpress/icons": "^11.0.1",
77
- "@wordpress/interface": "^9.18.1",
78
- "@wordpress/keyboard-shortcuts": "^5.33.1",
79
- "@wordpress/keycodes": "^4.33.1",
80
- "@wordpress/media-utils": "^5.33.1",
81
- "@wordpress/notices": "^5.33.1",
82
- "@wordpress/patterns": "^2.33.1",
83
- "@wordpress/plugins": "^7.33.1",
84
- "@wordpress/preferences": "^4.33.1",
85
- "@wordpress/private-apis": "^1.33.1",
86
- "@wordpress/reusable-blocks": "^5.33.1",
87
- "@wordpress/rich-text": "^7.33.1",
88
- "@wordpress/server-side-render": "^6.9.1",
89
- "@wordpress/url": "^4.33.1",
90
- "@wordpress/warning": "^3.33.1",
91
- "@wordpress/wordcount": "^4.33.1",
56
+ "@wordpress/a11y": "^4.34.0",
57
+ "@wordpress/api-fetch": "^7.34.0",
58
+ "@wordpress/base-styles": "^6.10.0",
59
+ "@wordpress/blob": "^4.34.0",
60
+ "@wordpress/block-editor": "^15.7.0",
61
+ "@wordpress/blocks": "^15.7.0",
62
+ "@wordpress/commands": "^1.34.0",
63
+ "@wordpress/components": "^30.7.0",
64
+ "@wordpress/compose": "^7.34.0",
65
+ "@wordpress/core-data": "^7.34.0",
66
+ "@wordpress/data": "^10.34.0",
67
+ "@wordpress/dataviews": "^10.2.0",
68
+ "@wordpress/date": "^5.34.0",
69
+ "@wordpress/deprecated": "^4.34.0",
70
+ "@wordpress/dom": "^4.34.0",
71
+ "@wordpress/element": "^6.34.0",
72
+ "@wordpress/fields": "^0.26.0",
73
+ "@wordpress/global-styles-engine": "^1.1.0",
74
+ "@wordpress/global-styles-ui": "^1.1.0",
75
+ "@wordpress/hooks": "^4.34.0",
76
+ "@wordpress/html-entities": "^4.34.0",
77
+ "@wordpress/i18n": "^6.7.0",
78
+ "@wordpress/icons": "^11.1.0",
79
+ "@wordpress/interface": "^9.19.0",
80
+ "@wordpress/keyboard-shortcuts": "^5.34.0",
81
+ "@wordpress/keycodes": "^4.34.0",
82
+ "@wordpress/media-utils": "^5.34.0",
83
+ "@wordpress/notices": "^5.34.0",
84
+ "@wordpress/patterns": "^2.34.0",
85
+ "@wordpress/plugins": "^7.34.0",
86
+ "@wordpress/preferences": "^4.34.0",
87
+ "@wordpress/private-apis": "^1.34.0",
88
+ "@wordpress/reusable-blocks": "^5.34.0",
89
+ "@wordpress/rich-text": "^7.34.0",
90
+ "@wordpress/server-side-render": "^6.10.0",
91
+ "@wordpress/url": "^4.34.0",
92
+ "@wordpress/warning": "^3.34.0",
93
+ "@wordpress/wordcount": "^4.34.0",
92
94
  "change-case": "^4.1.2",
93
95
  "client-zip": "^2.4.5",
94
96
  "clsx": "^2.1.1",
95
97
  "date-fns": "^3.6.0",
96
- "deepmerge": "^4.3.0",
97
98
  "fast-deep-equal": "^3.1.3",
98
- "is-plain-object": "^5.0.0",
99
99
  "memize": "^2.1.0",
100
100
  "react-autosize-textarea": "^7.1.0",
101
101
  "remove-accents": "^0.5.0",
@@ -108,5 +108,5 @@
108
108
  "publishConfig": {
109
109
  "access": "public"
110
110
  },
111
- "gitHead": "5f84bafdec1bed05247c1080c12f6a237951b862"
111
+ "gitHead": "ceebff807958d2e8fc755b5a20473939c78b4d1d"
112
112
  }
@@ -18,38 +18,45 @@ import { store as blockEditorStore } from '@wordpress/block-editor';
18
18
  */
19
19
  import { getAvatarBorderColor } from './utils';
20
20
 
21
- /**
22
- * Render author information for a comment.
23
- *
24
- * @param {Object} props - Component properties.
25
- * @param {string} props.avatar - URL of the author's avatar.
26
- * @param {string} props.name - Name of the author.
27
- * @param {string} props.date - Date of the comment.
28
- * @param {string} props.userId - User ID of the author.
29
- *
30
- * @return {React.ReactNode} The JSX element representing the author's information.
31
- */
32
21
  function CommentAuthorInfo( { avatar, name, date, userId } ) {
22
+ const hasAvatar = !! avatar;
33
23
  const dateSettings = getDateSettings();
34
24
  const {
35
25
  currentUserAvatar,
36
26
  currentUserName,
37
27
  currentUserId,
38
28
  dateFormat = dateSettings.formats.date,
39
- } = useSelect( ( select ) => {
40
- const { getCurrentUser, getEntityRecord } = select( coreStore );
41
- const { getSettings } = select( blockEditorStore );
42
- const userData = getCurrentUser();
43
- const { __experimentalDiscussionSettings } = getSettings();
44
- const defaultAvatar = __experimentalDiscussionSettings?.avatarURL;
45
- const siteSettings = getEntityRecord( 'root', 'site' );
46
- return {
47
- currentUserAvatar: userData?.avatar_urls?.[ 48 ] ?? defaultAvatar,
48
- currentUserName: userData?.name,
49
- currentUserId: userData?.id,
50
- dateFormat: siteSettings?.date_format,
51
- };
52
- }, [] );
29
+ } = useSelect(
30
+ ( select ) => {
31
+ const { canUser, getCurrentUser, getEntityRecord } =
32
+ select( coreStore );
33
+ const siteSettings = canUser( 'read', {
34
+ kind: 'root',
35
+ name: 'site',
36
+ } )
37
+ ? getEntityRecord( 'root', 'site' )
38
+ : undefined;
39
+
40
+ if ( hasAvatar ) {
41
+ return {
42
+ dateFormat: siteSettings?.date_format,
43
+ };
44
+ }
45
+
46
+ const { getSettings } = select( blockEditorStore );
47
+ const { __experimentalDiscussionSettings } = getSettings();
48
+ const defaultAvatar = __experimentalDiscussionSettings?.avatarURL;
49
+ const userData = getCurrentUser();
50
+ return {
51
+ currentUserAvatar:
52
+ userData?.avatar_urls?.[ 48 ] ?? defaultAvatar,
53
+ currentUserName: userData?.name,
54
+ currentUserId: userData?.id,
55
+ dateFormat: siteSettings?.date_format,
56
+ };
57
+ },
58
+ [ hasAvatar ]
59
+ );
53
60
 
54
61
  const commentDate = getDate( date );
55
62
  const commentDateTime = dateI18n( 'c', commentDate );
@@ -111,7 +111,7 @@
111
111
  }
112
112
 
113
113
  .editor-collab-sidebar-panel__more-reply-button {
114
- font-weight: 500;
114
+ font-weight: $font-weight-medium;
115
115
  }
116
116
 
117
117
  .editor-collab-sidebar-panel__resolution-text {
@@ -31,6 +31,8 @@ import { TEMPLATE_POST_TYPES } from '../../store/constants';
31
31
  import { store as editorStore } from '../../store';
32
32
  import usePageTypeBadge from '../../utils/pageTypeBadge';
33
33
  import { getTemplateInfo } from '../../utils/get-template-info';
34
+ import { getStylesCanvasTitle } from '../styles-canvas';
35
+ import { unlock } from '../../lock-unlock';
34
36
 
35
37
  /** @typedef {import("@wordpress/components").IconType} IconType */
36
38
 
@@ -45,9 +47,9 @@ const MotionButton = motion.create( Button );
45
47
  * ```jsx
46
48
  * <DocumentBar />
47
49
  * ```
50
+ *
48
51
  * @param {Object} props The component props.
49
- * @param {string} props.title A title for the document, defaulting to the document or
50
- * template title currently being edited.
52
+ * @param {string} props.title A title for the document, defaulting to the document or template title currently being edited.
51
53
  * @param {IconType} props.icon An icon for the document, no default.
52
54
  * (A default icon indicating the document post type is no longer used.)
53
55
  *
@@ -63,6 +65,7 @@ export default function DocumentBar( props ) {
63
65
  templateTitle,
64
66
  onNavigateToPreviousEntityRecord,
65
67
  isTemplatePreview,
68
+ stylesCanvasTitle,
66
69
  } = useSelect( ( select ) => {
67
70
  const {
68
71
  getCurrentPostType,
@@ -94,6 +97,17 @@ export default function DocumentBar( props ) {
94
97
  } );
95
98
  const _postTypeLabel = getPostType( _postType )?.labels?.singular_name;
96
99
 
100
+ // Check if styles canvas is active and get its title
101
+ const { getStylesPath, getShowStylebook } = unlock(
102
+ select( editorStore )
103
+ );
104
+ const _stylesPath = getStylesPath();
105
+ const _showStylebook = getShowStylebook();
106
+ const _stylesCanvasTitle = getStylesCanvasTitle(
107
+ _stylesPath,
108
+ _showStylebook
109
+ );
110
+
97
111
  return {
98
112
  postId: _postId,
99
113
  postType: _postType,
@@ -111,6 +125,7 @@ export default function DocumentBar( props ) {
111
125
  onNavigateToPreviousEntityRecord:
112
126
  getEditorSettings().onNavigateToPreviousEntityRecord,
113
127
  isTemplatePreview: getRenderingMode() === 'template-locked',
128
+ stylesCanvasTitle: _stylesCanvasTitle,
114
129
  };
115
130
  }, [] );
116
131
 
@@ -120,7 +135,7 @@ export default function DocumentBar( props ) {
120
135
  const isTemplate = TEMPLATE_POST_TYPES.includes( postType );
121
136
  const hasBackButton = !! onNavigateToPreviousEntityRecord;
122
137
  const entityTitle = isTemplate ? templateTitle : documentTitle;
123
- const title = props.title || entityTitle;
138
+ const title = props.title || stylesCanvasTitle || entityTitle;
124
139
  const icon = props.icon;
125
140
 
126
141
  const pageTypeBadge = usePageTypeBadge( postId );
@@ -9,11 +9,14 @@ import { __ } from '@wordpress/i18n';
9
9
  /**
10
10
  * Internal dependencies
11
11
  */
12
+ import { store as editorStore } from '../../store';
12
13
  import { TEMPLATE_POST_TYPE } from '../../store/constants';
13
14
  import EditorInterface from '../editor-interface';
14
15
  import { ExperimentalEditorProvider } from '../provider';
15
16
  import Sidebar from '../sidebar';
16
17
  import NotesSidebar from '../collab-sidebar';
18
+ import GlobalStylesSidebar from '../global-styles-sidebar';
19
+ import { GlobalStylesRenderer } from '../global-styles-renderer';
17
20
 
18
21
  function Editor( {
19
22
  postType,
@@ -32,15 +35,29 @@ function Editor( {
32
35
  extraSidebarPanels,
33
36
  ...props
34
37
  } ) {
35
- const { post, template, hasLoadedPost, error } = useSelect(
38
+ const {
39
+ post,
40
+ template,
41
+ hasLoadedPost,
42
+ error,
43
+ isBlockTheme,
44
+ showGlobalStyles,
45
+ } = useSelect(
36
46
  ( select ) => {
37
47
  const {
38
48
  getEntityRecord,
39
49
  getResolutionError,
40
50
  hasFinishedResolution,
51
+ getCurrentTheme,
41
52
  } = select( coreStore );
53
+ const { getRenderingMode, getCurrentPostType } =
54
+ select( editorStore );
42
55
 
43
56
  const postArgs = [ 'postType', postType, postId ];
57
+ const renderingMode = getRenderingMode();
58
+ const currentPostType = getCurrentPostType();
59
+ const _isBlockTheme = getCurrentTheme()?.is_block_theme;
60
+
44
61
  return {
45
62
  post: getEntityRecord( ...postArgs ),
46
63
  template: templateId
@@ -56,6 +73,11 @@ function Editor( {
56
73
  ),
57
74
  error: getResolutionError( 'getEntityRecord', postArgs )
58
75
  ?.message,
76
+ isBlockTheme: _isBlockTheme,
77
+ showGlobalStyles:
78
+ _isBlockTheme &&
79
+ ( currentPostType === 'wp_template' ||
80
+ renderingMode === 'template-locked' ),
59
81
  };
60
82
  },
61
83
  [ postType, postId, templateId ]
@@ -92,6 +114,8 @@ function Editor( {
92
114
  onActionPerformed={ onActionPerformed }
93
115
  extraPanels={ extraSidebarPanels }
94
116
  />
117
+ { isBlockTheme && <GlobalStylesRenderer /> }
118
+ { showGlobalStyles && <GlobalStylesSidebar /> }
95
119
  </ExperimentalEditorProvider>
96
120
  ) }
97
121
  </>
@@ -118,6 +118,6 @@
118
118
 
119
119
  .helpDetailBadgeText {
120
120
  color: $white;
121
- font-weight: 500;
121
+ font-weight: $font-weight-medium;
122
122
  font-size: 12px;
123
123
  }
@@ -18,6 +18,7 @@ import { useState, useCallback } from '@wordpress/element';
18
18
  * Internal dependencies
19
19
  */
20
20
  import { store as editorStore } from '../../store';
21
+ import { unlock } from '../../lock-unlock';
21
22
  import EditorNotices from '../editor-notices';
22
23
  import Header from '../header';
23
24
  import InserterSidebar from '../inserter-sidebar';
@@ -25,7 +26,7 @@ import ListViewSidebar from '../list-view-sidebar';
25
26
  import SavePublishPanels from '../save-publish-panels';
26
27
  import TextEditor from '../text-editor';
27
28
  import VisualEditor from '../visual-editor';
28
- import EditorContentSlotFill from './content-slot-fill';
29
+ import StylesCanvas from '../styles-canvas';
29
30
 
30
31
  const interfaceLabels = {
31
32
  /* translators: accessibility text for the editor top bar landmark region. */
@@ -42,7 +43,6 @@ const interfaceLabels = {
42
43
 
43
44
  export default function EditorInterface( {
44
45
  className,
45
- styles,
46
46
  children,
47
47
  forceIsDirty,
48
48
  contentRef,
@@ -51,7 +51,6 @@ export default function EditorInterface( {
51
51
  customSaveButton,
52
52
  customSavePanel,
53
53
  forceDisableBlockTools,
54
- title,
55
54
  iframeProps,
56
55
  } ) {
57
56
  const {
@@ -62,9 +61,14 @@ export default function EditorInterface( {
62
61
  isPreviewMode,
63
62
  showBlockBreadcrumbs,
64
63
  documentLabel,
64
+ stylesPath,
65
+ showStylebook,
65
66
  } = useSelect( ( select ) => {
66
67
  const { get } = select( preferencesStore );
67
68
  const { getEditorSettings, getPostTypeLabel } = select( editorStore );
69
+ const { getStylesPath, getShowStylebook } = unlock(
70
+ select( editorStore )
71
+ );
68
72
  const editorSettings = getEditorSettings();
69
73
  const postTypeLabel = getPostTypeLabel();
70
74
 
@@ -86,12 +90,16 @@ export default function EditorInterface( {
86
90
  documentLabel:
87
91
  // translators: Default label for the Document in the Block Breadcrumb.
88
92
  postTypeLabel || _x( 'Document', 'noun, breadcrumb' ),
93
+ stylesPath: getStylesPath(),
94
+ showStylebook: getShowStylebook(),
89
95
  };
90
96
  }, [] );
91
97
  const isLargeViewport = useViewportMatch( 'medium' );
92
98
  const secondarySidebarLabel = isListViewOpened
93
99
  ? __( 'Document Overview' )
94
100
  : __( 'Block Library' );
101
+ const shouldShowStylesCanvas =
102
+ showStylebook || stylesPath?.startsWith( '/revisions' );
95
103
 
96
104
  // Local state for save panel.
97
105
  // Note 'truthy' callback implies an open panel.
@@ -127,7 +135,6 @@ export default function EditorInterface( {
127
135
  }
128
136
  customSaveButton={ customSaveButton }
129
137
  forceDisableBlockTools={ forceDisableBlockTools }
130
- title={ title }
131
138
  />
132
139
  )
133
140
  }
@@ -148,41 +155,35 @@ export default function EditorInterface( {
148
155
  <EditorNotices />
149
156
  ) }
150
157
 
151
- <EditorContentSlotFill.Slot>
152
- { ( [ editorCanvasView ] ) =>
153
- editorCanvasView ? (
154
- editorCanvasView
155
- ) : (
156
- <>
157
- { ! isPreviewMode && mode === 'text' && (
158
- <TextEditor
159
- // We should auto-focus the canvas (title) on load.
160
- // eslint-disable-next-line jsx-a11y/no-autofocus
161
- autoFocus={ autoFocus }
162
- />
163
- ) }
164
- { ! isPreviewMode &&
165
- ! isLargeViewport &&
166
- mode === 'visual' && (
167
- <BlockToolbar hideDragHandle />
168
- ) }
169
- { ( isPreviewMode ||
170
- mode === 'visual' ) && (
171
- <VisualEditor
172
- styles={ styles }
173
- contentRef={ contentRef }
174
- disableIframe={ disableIframe }
175
- // We should auto-focus the canvas (title) on load.
176
- // eslint-disable-next-line jsx-a11y/no-autofocus
177
- autoFocus={ autoFocus }
178
- iframeProps={ iframeProps }
179
- />
180
- ) }
181
- { children }
182
- </>
183
- )
184
- }
185
- </EditorContentSlotFill.Slot>
158
+ { shouldShowStylesCanvas ? (
159
+ <StylesCanvas />
160
+ ) : (
161
+ <>
162
+ { ! isPreviewMode && mode === 'text' && (
163
+ <TextEditor
164
+ // We should auto-focus the canvas (title) on load.
165
+ // eslint-disable-next-line jsx-a11y/no-autofocus
166
+ autoFocus={ autoFocus }
167
+ />
168
+ ) }
169
+ { ! isPreviewMode &&
170
+ ! isLargeViewport &&
171
+ mode === 'visual' && (
172
+ <BlockToolbar hideDragHandle />
173
+ ) }
174
+ { ( isPreviewMode || mode === 'visual' ) && (
175
+ <VisualEditor
176
+ contentRef={ contentRef }
177
+ disableIframe={ disableIframe }
178
+ // We should auto-focus the canvas (title) on load.
179
+ // eslint-disable-next-line jsx-a11y/no-autofocus
180
+ autoFocus={ autoFocus }
181
+ iframeProps={ iframeProps }
182
+ />
183
+ ) }
184
+ { children }
185
+ </>
186
+ ) }
186
187
  </>
187
188
  }
188
189
  footer={
@@ -5,18 +5,12 @@ import { __ } from '@wordpress/i18n';
5
5
  import { useSelect } from '@wordpress/data';
6
6
  import { PanelBody, PanelRow } from '@wordpress/components';
7
7
  import { store as coreStore } from '@wordpress/core-data';
8
- import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
9
- import { useContext } from '@wordpress/element';
8
+ import { getGlobalStylesChanges } from '@wordpress/global-styles-engine';
10
9
 
11
10
  /**
12
11
  * Internal dependencies
13
12
  */
14
13
  import EntityRecordItem from './entity-record-item';
15
- import { unlock } from '../../lock-unlock';
16
-
17
- const { getGlobalStylesChanges, GlobalStylesContext } = unlock(
18
- blockEditorPrivateApis
19
- );
20
14
 
21
15
  function getEntityDescription( entity, count ) {
22
16
  switch ( entity ) {
@@ -35,20 +29,28 @@ function getEntityDescription( entity, count ) {
35
29
  }
36
30
 
37
31
  function GlobalStylesDescription( { record } ) {
38
- const { user: currentEditorGlobalStyles } =
39
- useContext( GlobalStylesContext );
40
- const savedRecord = useSelect(
41
- ( select ) =>
42
- select( coreStore ).getEntityRecord(
43
- record.kind,
44
- record.name,
45
- record.key
46
- ),
32
+ const { editedRecord, savedRecord } = useSelect(
33
+ ( select ) => {
34
+ const { getEditedEntityRecord, getEntityRecord } =
35
+ select( coreStore );
36
+ return {
37
+ editedRecord: getEditedEntityRecord(
38
+ record.kind,
39
+ record.name,
40
+ record.key
41
+ ),
42
+ savedRecord: getEntityRecord(
43
+ record.kind,
44
+ record.name,
45
+ record.key
46
+ ),
47
+ };
48
+ },
47
49
  [ record.kind, record.name, record.key ]
48
50
  );
49
51
 
50
52
  const globalStylesChanges = getGlobalStylesChanges(
51
- currentEditorGlobalStyles,
53
+ editedRecord,
52
54
  savedRecord,
53
55
  {
54
56
  maxResults: 10,