@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.
- package/CHANGELOG.md +2 -0
- package/build/components/collab-sidebar/comment-author-info.js +26 -14
- package/build/components/collab-sidebar/comment-author-info.js.map +2 -2
- package/build/components/document-bar/index.js +16 -3
- package/build/components/document-bar/index.js.map +2 -2
- package/build/components/editor/index.js +23 -4
- package/build/components/editor/index.js.map +3 -3
- package/build/components/editor-interface/index.js +15 -10
- package/build/components/editor-interface/index.js.map +3 -3
- package/build/components/entities-saved-states/entity-type-list.js +19 -15
- package/build/components/entities-saved-states/entity-type-list.js.map +3 -3
- package/build/components/global-styles/block-link.js +70 -0
- package/build/components/global-styles/block-link.js.map +7 -0
- package/build/components/global-styles/header.js +54 -0
- package/build/components/global-styles/header.js.map +7 -0
- package/build/components/global-styles/hooks.js +176 -0
- package/build/components/global-styles/hooks.js.map +7 -0
- package/build/components/global-styles/index.js +138 -0
- package/build/components/global-styles/index.js.map +7 -0
- package/build/components/global-styles/menu.js +95 -0
- package/build/components/global-styles/menu.js.map +7 -0
- package/build/components/global-styles-provider/index.js +3 -49
- package/build/components/global-styles-provider/index.js.map +3 -3
- package/build/components/global-styles-renderer/index.js +55 -0
- package/build/components/global-styles-renderer/index.js.map +7 -0
- package/build/components/global-styles-sidebar/default-sidebar.js +66 -0
- package/build/components/global-styles-sidebar/default-sidebar.js.map +7 -0
- package/build/components/global-styles-sidebar/index.js +182 -0
- package/build/components/global-styles-sidebar/index.js.map +7 -0
- package/build/components/global-styles-sidebar/welcome-guide-image.js +37 -0
- package/build/components/global-styles-sidebar/welcome-guide-image.js.map +7 -0
- package/build/components/global-styles-sidebar/welcome-guide.js +143 -0
- package/build/components/global-styles-sidebar/welcome-guide.js.map +7 -0
- package/build/components/header/index.js +12 -9
- package/build/components/header/index.js.map +2 -2
- package/build/components/post-featured-image/index.js +32 -1
- package/build/components/post-featured-image/index.js.map +3 -3
- package/build/components/provider/index.js +0 -2
- package/build/components/provider/index.js.map +3 -3
- package/build/components/style-book/categories.js +86 -0
- package/build/components/style-book/categories.js.map +7 -0
- package/build/components/style-book/color-examples.js +64 -0
- package/build/components/style-book/color-examples.js.map +7 -0
- package/build/components/style-book/constants.js +319 -0
- package/build/components/style-book/constants.js.map +7 -0
- package/build/components/style-book/duotone-examples.js +68 -0
- package/build/components/style-book/duotone-examples.js.map +7 -0
- package/build/components/style-book/examples.js +237 -0
- package/build/components/style-book/examples.js.map +7 -0
- package/build/components/style-book/index.js +627 -0
- package/build/components/style-book/index.js.map +7 -0
- package/build/components/style-book/types.js +17 -0
- package/build/components/style-book/types.js.map +7 -0
- package/build/components/styles-canvas/index.js +138 -0
- package/build/components/styles-canvas/index.js.map +7 -0
- package/build/components/styles-canvas/revisions.js +121 -0
- package/build/components/styles-canvas/revisions.js.map +7 -0
- package/build/components/styles-canvas/style-book.js +68 -0
- package/build/components/styles-canvas/style-book.js.map +7 -0
- package/build/components/visual-editor/index.js +4 -3
- package/build/components/visual-editor/index.js.map +2 -2
- package/build/dataviews/fields/content-preview/content-preview-view.js.map +2 -2
- package/build/hooks/index.js +1 -0
- package/build/hooks/index.js.map +2 -2
- package/build/hooks/media-upload.js +15 -4
- package/build/hooks/media-upload.js.map +3 -3
- package/build/hooks/push-changes-to-global-styles/index.js +322 -0
- package/build/hooks/push-changes-to-global-styles/index.js.map +7 -0
- package/build/hooks/use-global-styles-output.js +74 -0
- package/build/hooks/use-global-styles-output.js.map +7 -0
- package/build/private-apis.js +10 -5
- package/build/private-apis.js.map +3 -3
- package/build/store/private-actions.js +23 -0
- package/build/store/private-actions.js.map +2 -2
- package/build/store/private-selectors.js +10 -0
- package/build/store/private-selectors.js.map +2 -2
- package/build/store/reducer.js +24 -0
- package/build/store/reducer.js.map +2 -2
- package/build/{components/editor-interface/content-slot-fill.js → utils/set-nested-value.js} +24 -10
- package/build/utils/set-nested-value.js.map +7 -0
- package/build-module/components/collab-sidebar/comment-author-info.js +26 -14
- package/build-module/components/collab-sidebar/comment-author-info.js.map +2 -2
- package/build-module/components/document-bar/index.js +16 -3
- package/build-module/components/document-bar/index.js.map +2 -2
- package/build-module/components/editor/index.js +23 -4
- package/build-module/components/editor/index.js.map +2 -2
- package/build-module/components/editor-interface/index.js +15 -10
- package/build-module/components/editor-interface/index.js.map +2 -2
- package/build-module/components/entities-saved-states/entity-type-list.js +18 -14
- package/build-module/components/entities-saved-states/entity-type-list.js.map +2 -2
- package/build-module/components/global-styles/block-link.js +46 -0
- package/build-module/components/global-styles/block-link.js.map +7 -0
- package/build-module/components/global-styles/header.js +41 -0
- package/build-module/components/global-styles/header.js.map +7 -0
- package/build-module/components/global-styles/hooks.js +154 -0
- package/build-module/components/global-styles/hooks.js.map +7 -0
- package/build-module/components/global-styles/index.js +112 -0
- package/build-module/components/global-styles/index.js.map +7 -0
- package/build-module/components/global-styles/menu.js +71 -0
- package/build-module/components/global-styles/menu.js.map +7 -0
- package/build-module/components/global-styles-provider/index.js +3 -37
- package/build-module/components/global-styles-provider/index.js.map +2 -2
- package/build-module/components/global-styles-renderer/index.js +31 -0
- package/build-module/components/global-styles-renderer/index.js.map +7 -0
- package/build-module/components/global-styles-sidebar/default-sidebar.js +49 -0
- package/build-module/components/global-styles-sidebar/default-sidebar.js.map +7 -0
- package/build-module/components/global-styles-sidebar/index.js +152 -0
- package/build-module/components/global-styles-sidebar/index.js.map +7 -0
- package/build-module/components/global-styles-sidebar/welcome-guide-image.js +17 -0
- package/build-module/components/global-styles-sidebar/welcome-guide-image.js.map +7 -0
- package/build-module/components/global-styles-sidebar/welcome-guide.js +113 -0
- package/build-module/components/global-styles-sidebar/welcome-guide.js.map +7 -0
- package/build-module/components/header/index.js +12 -9
- package/build-module/components/header/index.js.map +2 -2
- package/build-module/components/post-featured-image/index.js +35 -3
- package/build-module/components/post-featured-image/index.js.map +2 -2
- package/build-module/components/provider/index.js +0 -2
- package/build-module/components/provider/index.js.map +2 -2
- package/build-module/components/style-book/categories.js +64 -0
- package/build-module/components/style-book/categories.js.map +7 -0
- package/build-module/components/style-book/color-examples.js +37 -0
- package/build-module/components/style-book/color-examples.js.map +7 -0
- package/build-module/components/style-book/constants.js +290 -0
- package/build-module/components/style-book/constants.js.map +7 -0
- package/build-module/components/style-book/duotone-examples.js +48 -0
- package/build-module/components/style-book/duotone-examples.js.map +7 -0
- package/build-module/components/style-book/examples.js +208 -0
- package/build-module/components/style-book/examples.js.map +7 -0
- package/build-module/components/style-book/index.js +618 -0
- package/build-module/components/style-book/index.js.map +7 -0
- package/build-module/components/style-book/types.js +1 -0
- package/build-module/components/style-book/types.js.map +7 -0
- package/build-module/components/styles-canvas/index.js +104 -0
- package/build-module/components/styles-canvas/index.js.map +7 -0
- package/build-module/components/styles-canvas/revisions.js +107 -0
- package/build-module/components/styles-canvas/revisions.js.map +7 -0
- package/build-module/components/styles-canvas/style-book.js +38 -0
- package/build-module/components/styles-canvas/style-book.js.map +7 -0
- package/build-module/components/visual-editor/index.js +4 -3
- package/build-module/components/visual-editor/index.js.map +2 -2
- package/build-module/dataviews/fields/content-preview/content-preview-view.js.map +2 -2
- package/build-module/hooks/index.js +1 -0
- package/build-module/hooks/index.js.map +2 -2
- package/build-module/hooks/media-upload.js +19 -5
- package/build-module/hooks/media-upload.js.map +2 -2
- package/build-module/hooks/push-changes-to-global-styles/index.js +309 -0
- package/build-module/hooks/push-changes-to-global-styles/index.js.map +7 -0
- package/build-module/hooks/use-global-styles-output.js +49 -0
- package/build-module/hooks/use-global-styles-output.js.map +7 -0
- package/build-module/private-apis.js +10 -8
- package/build-module/private-apis.js.map +2 -2
- package/build-module/store/private-actions.js +20 -0
- package/build-module/store/private-actions.js.map +2 -2
- package/build-module/store/private-selectors.js +8 -0
- package/build-module/store/private-selectors.js.map +2 -2
- package/build-module/store/reducer.js +22 -0
- package/build-module/store/reducer.js.map +2 -2
- package/build-module/utils/set-nested-value.js +23 -0
- package/build-module/utils/set-nested-value.js.map +7 -0
- package/build-style/style-rtl.css +3017 -11
- package/build-style/style.css +3018 -11
- package/build-types/components/collab-sidebar/comment-author-info.d.ts +5 -16
- package/build-types/components/collab-sidebar/comment-author-info.d.ts.map +1 -1
- package/build-types/components/document-bar/index.d.ts +2 -2
- package/build-types/components/document-bar/index.d.ts.map +1 -1
- package/build-types/components/editor/index.d.ts.map +1 -1
- package/build-types/components/editor-interface/index.d.ts +1 -3
- package/build-types/components/editor-interface/index.d.ts.map +1 -1
- package/build-types/components/entities-saved-states/entity-type-list.d.ts.map +1 -1
- package/build-types/components/global-styles/block-link.d.ts +12 -0
- package/build-types/components/global-styles/block-link.d.ts.map +1 -0
- package/build-types/components/global-styles/header.d.ts +7 -0
- package/build-types/components/global-styles/header.d.ts.map +1 -0
- package/build-types/components/global-styles/hooks.d.ts +24 -0
- package/build-types/components/global-styles/hooks.d.ts.map +1 -0
- package/build-types/components/global-styles/index.d.ts +6 -0
- package/build-types/components/global-styles/index.d.ts.map +1 -0
- package/build-types/components/global-styles/menu.d.ts +13 -0
- package/build-types/components/global-styles/menu.d.ts.map +1 -0
- package/build-types/components/global-styles-provider/index.d.ts +1 -5
- package/build-types/components/global-styles-provider/index.d.ts.map +1 -1
- package/build-types/components/global-styles-renderer/index.d.ts +4 -0
- package/build-types/components/global-styles-renderer/index.d.ts.map +1 -0
- package/build-types/components/global-styles-sidebar/default-sidebar.d.ts +13 -0
- package/build-types/components/global-styles-sidebar/default-sidebar.d.ts.map +1 -0
- package/build-types/components/global-styles-sidebar/index.d.ts +2 -0
- package/build-types/components/global-styles-sidebar/index.d.ts.map +1 -0
- package/build-types/components/global-styles-sidebar/welcome-guide-image.d.ts +5 -0
- package/build-types/components/global-styles-sidebar/welcome-guide-image.d.ts.map +1 -0
- package/build-types/components/global-styles-sidebar/welcome-guide.d.ts +2 -0
- package/build-types/components/global-styles-sidebar/welcome-guide.d.ts.map +1 -0
- package/build-types/components/header/index.d.ts +1 -3
- package/build-types/components/header/index.d.ts.map +1 -1
- package/build-types/components/provider/index.d.ts.map +1 -1
- package/build-types/components/style-book/categories.d.ts +18 -0
- package/build-types/components/style-book/categories.d.ts.map +1 -0
- package/build-types/components/style-book/color-examples.d.ts +7 -0
- package/build-types/components/style-book/color-examples.d.ts.map +1 -0
- package/build-types/components/style-book/constants.d.ts +11 -0
- package/build-types/components/style-book/constants.d.ts.map +1 -0
- package/build-types/components/style-book/duotone-examples.d.ts +9 -0
- package/build-types/components/style-book/duotone-examples.d.ts.map +1 -0
- package/build-types/components/style-book/examples.d.ts +12 -0
- package/build-types/components/style-book/examples.d.ts.map +1 -0
- package/build-types/components/style-book/index.d.ts +31 -0
- package/build-types/components/style-book/index.d.ts.map +1 -0
- package/build-types/components/style-book/types.d.ts +72 -0
- package/build-types/components/style-book/types.d.ts.map +1 -0
- package/build-types/components/styles-canvas/index.d.ts +16 -0
- package/build-types/components/styles-canvas/index.d.ts.map +1 -0
- package/build-types/components/styles-canvas/revisions.d.ts +5 -0
- package/build-types/components/styles-canvas/revisions.d.ts.map +1 -0
- package/build-types/components/styles-canvas/style-book.d.ts +6 -0
- package/build-types/components/styles-canvas/style-book.d.ts.map +1 -0
- package/build-types/components/visual-editor/index.d.ts +1 -2
- package/build-types/components/visual-editor/index.d.ts.map +1 -1
- package/build-types/dataviews/fields/content-preview/content-preview-view.d.ts.map +1 -1
- package/build-types/hooks/push-changes-to-global-styles/index.d.ts +2 -0
- package/build-types/hooks/push-changes-to-global-styles/index.d.ts.map +1 -0
- package/build-types/hooks/use-global-styles-output.d.ts +18 -0
- package/build-types/hooks/use-global-styles-output.d.ts.map +1 -0
- package/build-types/private-apis.d.ts.map +1 -1
- package/build-types/store/private-actions.d.ts +20 -0
- package/build-types/store/private-actions.d.ts.map +1 -1
- package/build-types/store/private-selectors.d.ts +14 -0
- package/build-types/store/private-selectors.d.ts.map +1 -1
- package/build-types/store/reducer.d.ts +20 -0
- package/build-types/store/reducer.d.ts.map +1 -1
- package/build-types/utils/set-nested-value.d.ts +20 -0
- package/build-types/utils/set-nested-value.d.ts.map +1 -0
- package/package.json +40 -40
- package/src/components/collab-sidebar/comment-author-info.js +32 -25
- package/src/components/collab-sidebar/style.scss +1 -1
- package/src/components/document-bar/index.js +18 -3
- package/src/components/editor/index.js +25 -1
- package/src/components/editor-help/style.scss +1 -1
- package/src/components/editor-interface/index.js +40 -39
- package/src/components/entities-saved-states/entity-type-list.js +19 -17
- package/src/components/global-styles/block-link.js +65 -0
- package/src/components/global-styles/header.js +48 -0
- package/src/components/global-styles/hooks.js +216 -0
- package/src/components/global-styles/index.js +125 -0
- package/src/components/global-styles/menu.js +101 -0
- package/src/components/global-styles/style.scss +11 -0
- package/src/components/global-styles-provider/index.js +3 -45
- package/src/components/global-styles-renderer/index.js +39 -0
- package/src/components/global-styles-sidebar/default-sidebar.js +46 -0
- package/src/components/global-styles-sidebar/index.js +177 -0
- package/src/components/global-styles-sidebar/style.scss +119 -0
- package/src/components/global-styles-sidebar/welcome-guide-image.js +11 -0
- package/src/components/global-styles-sidebar/welcome-guide.js +136 -0
- package/src/components/header/index.js +11 -6
- package/src/components/post-featured-image/index.js +44 -1
- package/src/components/post-last-revision/style.scss +1 -1
- package/src/components/post-panel-row/style.scss +1 -0
- package/src/components/post-publish-panel/style.scss +1 -1
- package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +2 -2
- package/src/components/provider/index.js +0 -2
- package/src/components/style-book/categories.ts +97 -0
- package/src/components/style-book/color-examples.tsx +56 -0
- package/src/components/style-book/constants.ts +308 -0
- package/src/components/style-book/duotone-examples.tsx +56 -0
- package/src/components/style-book/examples.tsx +273 -0
- package/src/components/style-book/index.js +794 -0
- package/src/components/style-book/style.scss +44 -0
- package/src/components/style-book/test/categories.js +166 -0
- package/src/components/style-book/types.ts +80 -0
- package/src/components/styles-canvas/index.js +126 -0
- package/src/components/styles-canvas/revisions.js +144 -0
- package/src/components/styles-canvas/style-book.js +57 -0
- package/src/components/styles-canvas/style.scss +40 -0
- package/src/components/visual-editor/index.js +2 -1
- package/src/dataviews/fields/content-preview/content-preview-view.tsx +2 -0
- package/src/hooks/index.js +1 -0
- package/src/hooks/media-upload.js +25 -5
- package/src/hooks/push-changes-to-global-styles/index.js +391 -0
- package/src/hooks/push-changes-to-global-styles/style.scss +4 -0
- package/src/hooks/use-global-styles-output.js +76 -0
- package/src/private-apis.js +10 -8
- package/src/store/private-actions.js +37 -0
- package/src/store/private-selectors.js +20 -0
- package/src/store/reducer.js +36 -0
- package/src/style.scss +7 -1
- package/src/utils/set-nested-value.js +39 -0
- package/tsconfig.json +3 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/build/components/block-settings-menu/content-only-settings-menu.js +0 -186
- package/build/components/block-settings-menu/content-only-settings-menu.js.map +0 -7
- package/build/components/editor-interface/content-slot-fill.js.map +0 -7
- package/build-module/components/block-settings-menu/content-only-settings-menu.js +0 -161
- package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +0 -7
- package/build-module/components/editor-interface/content-slot-fill.js +0 -9
- package/build-module/components/editor-interface/content-slot-fill.js.map +0 -7
- package/build-types/components/block-settings-menu/content-only-settings-menu.d.ts +0 -2
- package/build-types/components/block-settings-menu/content-only-settings-menu.d.ts.map +0 -1
- package/build-types/components/editor-interface/content-slot-fill.d.ts +0 -14
- package/build-types/components/editor-interface/content-slot-fill.d.ts.map +0 -1
- package/src/components/block-settings-menu/content-only-settings-menu.js +0 -185
- package/src/components/block-settings-menu/content-only-settings-menu.native.js +0 -4
- package/src/components/block-settings-menu/style.scss +0 -6
- 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;
|
|
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
|
|
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.
|
|
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.
|
|
57
|
-
"@wordpress/api-fetch": "^7.
|
|
58
|
-
"@wordpress/base-styles": "^6.
|
|
59
|
-
"@wordpress/blob": "^4.
|
|
60
|
-
"@wordpress/block-editor": "^15.
|
|
61
|
-
"@wordpress/blocks": "^15.
|
|
62
|
-
"@wordpress/commands": "^1.
|
|
63
|
-
"@wordpress/components": "^30.
|
|
64
|
-
"@wordpress/compose": "^7.
|
|
65
|
-
"@wordpress/core-data": "^7.
|
|
66
|
-
"@wordpress/data": "^10.
|
|
67
|
-
"@wordpress/dataviews": "^10.
|
|
68
|
-
"@wordpress/date": "^5.
|
|
69
|
-
"@wordpress/deprecated": "^4.
|
|
70
|
-
"@wordpress/dom": "^4.
|
|
71
|
-
"@wordpress/element": "^6.
|
|
72
|
-
"@wordpress/fields": "^0.
|
|
73
|
-
"@wordpress/
|
|
74
|
-
"@wordpress/
|
|
75
|
-
"@wordpress/
|
|
76
|
-
"@wordpress/
|
|
77
|
-
"@wordpress/
|
|
78
|
-
"@wordpress/
|
|
79
|
-
"@wordpress/
|
|
80
|
-
"@wordpress/
|
|
81
|
-
"@wordpress/
|
|
82
|
-
"@wordpress/
|
|
83
|
-
"@wordpress/
|
|
84
|
-
"@wordpress/
|
|
85
|
-
"@wordpress/
|
|
86
|
-
"@wordpress/
|
|
87
|
-
"@wordpress/
|
|
88
|
-
"@wordpress/
|
|
89
|
-
"@wordpress/
|
|
90
|
-
"@wordpress/
|
|
91
|
-
"@wordpress/
|
|
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": "
|
|
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(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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 );
|
|
@@ -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 {
|
|
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
|
</>
|
|
@@ -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
|
|
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
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
{
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
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 {
|
|
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 {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
-
|
|
53
|
+
editedRecord,
|
|
52
54
|
savedRecord,
|
|
53
55
|
{
|
|
54
56
|
maxResults: 10,
|