@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.
- package/CHANGELOG.md +2 -0
- package/build/bindings/post-data.js +10 -17
- package/build/bindings/post-data.js.map +2 -2
- package/build/bindings/post-meta.js +7 -14
- package/build/bindings/post-meta.js.map +2 -2
- package/build/bindings/term-data.js +6 -16
- package/build/bindings/term-data.js.map +2 -2
- package/build/components/collab-sidebar/add-comment.js +26 -3
- package/build/components/collab-sidebar/add-comment.js.map +3 -3
- 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/collab-sidebar/comment-indicator-toolbar.js +6 -22
- package/build/components/collab-sidebar/comment-indicator-toolbar.js.map +3 -3
- package/build/components/collab-sidebar/comments.js +105 -28
- package/build/components/collab-sidebar/comments.js.map +3 -3
- package/build/components/collab-sidebar/hooks.js +3 -4
- package/build/components/collab-sidebar/hooks.js.map +2 -2
- package/build/components/collab-sidebar/index.js +42 -57
- package/build/components/collab-sidebar/index.js.map +3 -3
- 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 +25 -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 -12
- package/build/components/header/index.js.map +3 -3
- package/build/components/post-featured-image/index.js +32 -1
- package/build/components/post-featured-image/index.js.map +3 -3
- package/build/components/post-template/hooks.js +7 -38
- package/build/components/post-template/hooks.js.map +2 -2
- package/build/components/provider/index.js +1 -1
- package/build/components/provider/index.js.map +2 -2
- 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/actions.js +1 -1
- package/build/store/actions.js.map +2 -2
- 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/bindings/post-data.js +10 -17
- package/build-module/bindings/post-data.js.map +2 -2
- package/build-module/bindings/post-meta.js +7 -14
- package/build-module/bindings/post-meta.js.map +2 -2
- package/build-module/bindings/term-data.js +6 -16
- package/build-module/bindings/term-data.js.map +2 -2
- package/build-module/components/collab-sidebar/add-comment.js +27 -4
- package/build-module/components/collab-sidebar/add-comment.js.map +2 -2
- 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/collab-sidebar/comment-indicator-toolbar.js +6 -12
- package/build-module/components/collab-sidebar/comment-indicator-toolbar.js.map +2 -2
- package/build-module/components/collab-sidebar/comments.js +114 -31
- package/build-module/components/collab-sidebar/comments.js.map +2 -2
- package/build-module/components/collab-sidebar/hooks.js +3 -4
- package/build-module/components/collab-sidebar/hooks.js.map +2 -2
- package/build-module/components/collab-sidebar/index.js +42 -57
- package/build-module/components/collab-sidebar/index.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 +25 -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 -12
- 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/post-template/hooks.js +7 -38
- package/build-module/components/post-template/hooks.js.map +2 -2
- package/build-module/components/provider/index.js +1 -1
- 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/actions.js +1 -1
- package/build-module/store/actions.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 +3011 -16
- package/build-style/style.css +3012 -16
- package/build-types/bindings/post-data.d.ts +6 -16
- package/build-types/bindings/post-meta.d.ts +6 -13
- package/build-types/bindings/term-data.d.ts +6 -16
- package/build-types/components/collab-sidebar/add-comment.d.ts +6 -1
- package/build-types/components/collab-sidebar/add-comment.d.ts.map +1 -1
- 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/collab-sidebar/comment-indicator-toolbar.d.ts +1 -2
- package/build-types/components/collab-sidebar/comment-indicator-toolbar.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/comments.d.ts +12 -26
- package/build-types/components/collab-sidebar/comments.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/hooks.d.ts +0 -1
- package/build-types/components/collab-sidebar/hooks.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/index.d.ts +1 -4
- package/build-types/components/collab-sidebar/index.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/post-template/hooks.d.ts +1 -1
- package/build-types/components/post-template/hooks.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/actions.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/bindings/post-data.js +9 -20
- package/src/bindings/post-meta.js +6 -17
- package/src/bindings/term-data.js +6 -21
- package/src/components/collab-sidebar/add-comment.js +31 -3
- package/src/components/collab-sidebar/comment-author-info.js +32 -25
- package/src/components/collab-sidebar/comment-indicator-toolbar.js +6 -22
- package/src/components/collab-sidebar/comments.js +108 -35
- package/src/components/collab-sidebar/hooks.js +3 -4
- package/src/components/collab-sidebar/index.js +34 -42
- package/src/components/collab-sidebar/style.scss +1 -22
- package/src/components/document-bar/index.js +18 -3
- package/src/components/editor/index.js +27 -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 -13
- package/src/components/post-featured-image/index.js +44 -1
- package/src/components/post-template/hooks.js +10 -51
- package/src/components/provider/index.js +1 -4
- 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/actions.js +4 -1
- 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 -0
- package/src/utils/set-nested-value.js +39 -0
- package/tsconfig.json +3 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/build/components/editor-interface/content-slot-fill.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/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/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 ) ||
|
|
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={
|
|
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
|
|
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={
|
|
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
|
-
<
|
|
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
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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;
|