@wordpress/edit-site 5.3.2 → 5.4.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 +3 -0
- package/build/components/add-new-template/new-template-part.js +8 -5
- package/build/components/add-new-template/new-template-part.js.map +1 -1
- package/build/components/add-new-template/new-template.js +9 -25
- package/build/components/add-new-template/new-template.js.map +1 -1
- package/build/components/app/index.js.map +1 -1
- package/build/components/block-editor/editor-canvas.js +4 -3
- package/build/components/block-editor/editor-canvas.js.map +1 -1
- package/build/components/block-editor/index.js +3 -3
- package/build/components/block-editor/index.js.map +1 -1
- package/build/components/editor/index.js +28 -24
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/border-panel.js +6 -6
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/color-palette-panel.js +7 -4
- package/build/components/global-styles/color-palette-panel.js.map +1 -1
- package/build/components/global-styles/color-utils.js +1 -1
- package/build/components/global-styles/color-utils.js.map +1 -1
- package/build/components/global-styles/context-menu.js +16 -3
- package/build/components/global-styles/context-menu.js.map +1 -1
- package/build/components/global-styles/custom-css.js +3 -3
- package/build/components/global-styles/custom-css.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +10 -9
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/global-styles-provider.js +2 -2
- package/build/components/global-styles/global-styles-provider.js.map +1 -1
- package/build/components/global-styles/gradients-palette-panel.js +10 -5
- package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build/components/global-styles/header.js +4 -2
- package/build/components/global-styles/header.js.map +1 -1
- package/build/components/global-styles/hooks.js +16 -53
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/navigation-button.js +1 -1
- package/build/components/global-styles/navigation-button.js.map +1 -1
- package/build/components/global-styles/palette.js +5 -3
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/preview.js +2 -2
- package/build/components/global-styles/preview.js.map +1 -1
- package/build/components/global-styles/screen-background-color.js +5 -4
- package/build/components/global-styles/screen-background-color.js.map +1 -1
- package/build/components/global-styles/screen-block-list.js +14 -3
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-button-color.js +9 -7
- package/build/components/global-styles/screen-button-color.js.map +1 -1
- package/build/components/global-styles/screen-colors.js +10 -8
- package/build/components/global-styles/screen-colors.js.map +1 -1
- package/build/components/global-styles/screen-css.js +5 -5
- package/build/components/global-styles/screen-css.js.map +1 -1
- package/build/components/global-styles/screen-heading-color.js +10 -8
- package/build/components/global-styles/screen-heading-color.js.map +1 -1
- package/build/components/global-styles/screen-link-color.js +5 -4
- package/build/components/global-styles/screen-link-color.js.map +1 -1
- package/build/components/global-styles/screen-root.js +2 -2
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/screen-style-variations.js +2 -2
- package/build/components/global-styles/screen-style-variations.js.map +1 -1
- package/build/components/global-styles/screen-text-color.js +5 -4
- package/build/components/global-styles/screen-text-color.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +5 -3
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/shadow-panel.js +4 -5
- package/build/components/global-styles/shadow-panel.js.map +1 -1
- package/build/components/global-styles/subtitle.js +3 -2
- package/build/components/global-styles/subtitle.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +24 -301
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/typography-preview.js +2 -2
- package/build/components/global-styles/typography-preview.js.map +1 -1
- package/build/components/global-styles/ui.js +3 -10
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles-renderer/index.js +2 -2
- package/build/components/global-styles-renderer/index.js.map +1 -1
- package/build/components/header-edit-mode/index.js +6 -3
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +1 -1
- package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build/components/layout/index.js +10 -23
- package/build/components/layout/index.js.map +1 -1
- package/build/components/list/actions/rename-menu-item.js +1 -1
- package/build/components/list/actions/rename-menu-item.js.map +1 -1
- package/build/components/list/table.js +1 -0
- package/build/components/list/table.js.map +1 -1
- package/build/components/navigation-inspector/index.js +0 -29
- package/build/components/navigation-inspector/index.js.map +1 -1
- package/build/components/navigation-inspector/navigation-menu.js +6 -4
- package/build/components/navigation-inspector/navigation-menu.js.map +1 -1
- package/build/components/save-panel/index.js +4 -3
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/sidebar/index.js +18 -23
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/index.js +1 -1
- package/build/components/sidebar-edit-mode/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-card/index.js +9 -2
- package/build/components/sidebar-edit-mode/template-card/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-card/last-revision.js +84 -0
- package/build/components/sidebar-edit-mode/template-card/last-revision.js.map +1 -0
- package/build/components/sidebar-navigation-screen/index.js +28 -7
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-item/index.js +72 -0
- package/build/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +2 -2
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-template/index.js +70 -0
- package/build/components/sidebar-navigation-screen-template/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-templates/index.js +32 -82
- package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/index.js +43 -0
- package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -0
- package/build/components/site-hub/index.js +14 -49
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/start-template-options/index.js +175 -0
- package/build/components/start-template-options/index.js.map +1 -0
- package/build/components/style-book/index.js +10 -3
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +55 -20
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +3 -3
- package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
- package/build/components/sync-state-with-url/{use-sync-sidebar-path-with-url.js → use-sync-path-with-url.js} +12 -12
- package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -0
- package/build/components/use-edited-entity-record/index.js +6 -2
- package/build/components/use-edited-entity-record/index.js.map +1 -1
- package/build/hooks/push-changes-to-global-styles/index.js +7 -6
- package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build/{experiments.js → private-apis.js} +3 -3
- package/build/private-apis.js.map +1 -0
- package/build/store/index.js +3 -3
- package/build/store/index.js.map +1 -1
- package/build/utils/get-is-list-page.js +5 -6
- package/build/utils/get-is-list-page.js.map +1 -1
- package/build-module/components/add-new-template/new-template-part.js +7 -4
- package/build-module/components/add-new-template/new-template-part.js.map +1 -1
- package/build-module/components/add-new-template/new-template.js +8 -22
- package/build-module/components/add-new-template/new-template.js.map +1 -1
- package/build-module/components/app/index.js.map +1 -1
- package/build-module/components/block-editor/editor-canvas.js +2 -1
- package/build-module/components/block-editor/editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/index.js +3 -3
- package/build-module/components/block-editor/index.js.map +1 -1
- package/build-module/components/editor/index.js +27 -25
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +8 -8
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/color-palette-panel.js +8 -5
- package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/color-utils.js +2 -2
- package/build-module/components/global-styles/color-utils.js.map +1 -1
- package/build-module/components/global-styles/context-menu.js +13 -2
- package/build-module/components/global-styles/context-menu.js.map +1 -1
- package/build-module/components/global-styles/custom-css.js +4 -4
- package/build-module/components/global-styles/custom-css.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +12 -11
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/global-styles-provider.js +3 -3
- package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
- package/build-module/components/global-styles/gradients-palette-panel.js +11 -6
- package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/header.js +5 -3
- package/build-module/components/global-styles/header.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +15 -52
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/navigation-button.js +2 -2
- package/build-module/components/global-styles/navigation-button.js.map +1 -1
- package/build-module/components/global-styles/palette.js +6 -4
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/global-styles/preview.js +3 -3
- package/build-module/components/global-styles/preview.js.map +1 -1
- package/build-module/components/global-styles/screen-background-color.js +7 -6
- package/build-module/components/global-styles/screen-background-color.js.map +1 -1
- package/build-module/components/global-styles/screen-block-list.js +12 -3
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-button-color.js +11 -9
- package/build-module/components/global-styles/screen-button-color.js.map +1 -1
- package/build-module/components/global-styles/screen-colors.js +12 -10
- package/build-module/components/global-styles/screen-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-css.js +5 -5
- package/build-module/components/global-styles/screen-css.js.map +1 -1
- package/build-module/components/global-styles/screen-heading-color.js +12 -10
- package/build-module/components/global-styles/screen-heading-color.js.map +1 -1
- package/build-module/components/global-styles/screen-link-color.js +7 -6
- package/build-module/components/global-styles/screen-link-color.js.map +1 -1
- package/build-module/components/global-styles/screen-root.js +3 -3
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/screen-style-variations.js +3 -3
- package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
- package/build-module/components/global-styles/screen-text-color.js +7 -6
- package/build-module/components/global-styles/screen-text-color.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +6 -4
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/shadow-panel.js +6 -7
- package/build-module/components/global-styles/shadow-panel.js.map +1 -1
- package/build-module/components/global-styles/subtitle.js +3 -2
- package/build-module/components/global-styles/subtitle.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +29 -302
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-preview.js +3 -3
- package/build-module/components/global-styles/typography-preview.js.map +1 -1
- package/build-module/components/global-styles/ui.js +4 -11
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles-renderer/index.js +3 -3
- package/build-module/components/global-styles-renderer/index.js.map +1 -1
- package/build-module/components/header-edit-mode/index.js +6 -3
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build-module/components/layout/index.js +10 -23
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/list/actions/rename-menu-item.js +1 -1
- package/build-module/components/list/actions/rename-menu-item.js.map +1 -1
- package/build-module/components/list/table.js +1 -0
- package/build-module/components/list/table.js.map +1 -1
- package/build-module/components/navigation-inspector/index.js +0 -27
- package/build-module/components/navigation-inspector/index.js.map +1 -1
- package/build-module/components/navigation-inspector/navigation-menu.js +7 -5
- package/build-module/components/navigation-inspector/navigation-menu.js.map +1 -1
- package/build-module/components/save-panel/index.js +3 -2
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +15 -21
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/index.js +1 -1
- package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-card/index.js +9 -4
- package/build-module/components/sidebar-edit-mode/template-card/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-card/last-revision.js +70 -0
- package/build-module/components/sidebar-edit-mode/template-card/last-revision.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen/index.js +27 -9
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-item/index.js +55 -0
- package/build-module/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +2 -2
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-template/index.js +53 -0
- package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-templates/index.js +34 -81
- package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +31 -0
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -0
- package/build-module/components/site-hub/index.js +14 -46
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/start-template-options/index.js +156 -0
- package/build-module/components/start-template-options/index.js.map +1 -0
- package/build-module/components/style-book/index.js +11 -4
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +55 -21
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +1 -1
- package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
- package/build-module/components/sync-state-with-url/{use-sync-sidebar-path-with-url.js → use-sync-path-with-url.js} +11 -11
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -0
- package/build-module/components/use-edited-entity-record/index.js +6 -2
- package/build-module/components/use-edited-entity-record/index.js.map +1 -1
- package/build-module/hooks/push-changes-to-global-styles/index.js +9 -8
- package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build-module/{experiments.js → private-apis.js} +2 -2
- package/build-module/private-apis.js.map +1 -0
- package/build-module/store/index.js +1 -1
- package/build-module/store/index.js.map +1 -1
- package/build-module/utils/get-is-list-page.js +5 -6
- package/build-module/utils/get-is-list-page.js.map +1 -1
- package/build-style/style-rtl.css +91 -41
- package/build-style/style.css +91 -41
- package/package.json +31 -31
- package/src/components/add-new-template/new-template-part.js +7 -4
- package/src/components/add-new-template/new-template.js +9 -22
- package/src/components/app/index.js +0 -1
- package/src/components/block-editor/editor-canvas.js +2 -1
- package/src/components/block-editor/index.js +3 -3
- package/src/components/editor/index.js +31 -28
- package/src/components/global-styles/border-panel.js +8 -8
- package/src/components/global-styles/color-palette-panel.js +6 -3
- package/src/components/global-styles/color-utils.js +2 -3
- package/src/components/global-styles/context-menu.js +17 -2
- package/src/components/global-styles/custom-css.js +4 -4
- package/src/components/global-styles/dimensions-panel.js +15 -11
- package/src/components/global-styles/global-styles-provider.js +3 -3
- package/src/components/global-styles/gradients-palette-panel.js +7 -4
- package/src/components/global-styles/header.js +9 -3
- package/src/components/global-styles/hooks.js +20 -93
- package/src/components/global-styles/navigation-button.js +4 -2
- package/src/components/global-styles/palette.js +4 -4
- package/src/components/global-styles/preview.js +3 -3
- package/src/components/global-styles/screen-background-color.js +6 -5
- package/src/components/global-styles/screen-block-list.js +19 -3
- package/src/components/global-styles/screen-button-color.js +11 -9
- package/src/components/global-styles/screen-colors.js +10 -10
- package/src/components/global-styles/screen-css.js +14 -7
- package/src/components/global-styles/screen-heading-color.js +12 -10
- package/src/components/global-styles/screen-link-color.js +6 -5
- package/src/components/global-styles/screen-root.js +3 -3
- package/src/components/global-styles/screen-style-variations.js +3 -3
- package/src/components/global-styles/screen-text-color.js +6 -5
- package/src/components/global-styles/screen-typography.js +4 -4
- package/src/components/global-styles/shadow-panel.js +9 -6
- package/src/components/global-styles/style.scss +7 -1
- package/src/components/global-styles/subtitle.js +5 -2
- package/src/components/global-styles/typography-panel.js +31 -395
- package/src/components/global-styles/typography-preview.js +3 -3
- package/src/components/global-styles/ui.js +3 -8
- package/src/components/global-styles-renderer/index.js +3 -3
- package/src/components/header-edit-mode/index.js +6 -3
- package/src/components/keyboard-shortcut-help-modal/config.js +1 -1
- package/src/components/layout/index.js +35 -48
- package/src/components/layout/style.scss +11 -23
- package/src/components/list/actions/rename-menu-item.js +1 -1
- package/src/components/list/table.js +4 -0
- package/src/components/navigation-inspector/index.js +0 -32
- package/src/components/navigation-inspector/navigation-menu.js +10 -4
- package/src/components/save-panel/index.js +4 -1
- package/src/components/sidebar/index.js +14 -19
- package/src/components/sidebar-edit-mode/index.js +1 -1
- package/src/components/sidebar-edit-mode/template-card/index.js +24 -14
- package/src/components/sidebar-edit-mode/template-card/last-revision.js +75 -0
- package/src/components/sidebar-edit-mode/template-card/style.scss +4 -0
- package/src/components/sidebar-navigation-screen/index.js +27 -11
- package/src/components/sidebar-navigation-screen/style.scss +4 -6
- package/src/components/sidebar-navigation-screen-navigation-item/index.js +52 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/index.js +1 -1
- package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +0 -4
- package/src/components/sidebar-navigation-screen-template/index.js +52 -0
- package/src/components/sidebar-navigation-screen-templates/index.js +49 -83
- package/src/components/sidebar-navigation-screen-templates-browse/index.js +31 -0
- package/src/components/site-hub/index.js +67 -122
- package/src/components/site-hub/style.scss +1 -11
- package/src/components/start-template-options/index.js +171 -0
- package/src/components/start-template-options/style.scss +76 -0
- package/src/components/style-book/index.js +11 -7
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +48 -14
- package/src/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +1 -1
- package/src/components/sync-state-with-url/{use-sync-sidebar-path-with-url.js → use-sync-path-with-url.js} +10 -10
- package/src/components/use-edited-entity-record/index.js +6 -2
- package/src/hooks/push-changes-to-global-styles/index.js +29 -24
- package/src/{experiments.js → private-apis.js} +1 -1
- package/src/store/index.js +1 -1
- package/src/style.scss +1 -0
- package/src/utils/get-is-list-page.js +5 -5
- package/build/components/sync-state-with-url/use-sync-sidebar-path-with-url.js.map +0 -1
- package/build/experiments.js.map +0 -1
- package/build-module/components/sync-state-with-url/use-sync-sidebar-path-with-url.js.map +0 -1
- package/build-module/experiments.js.map +0 -1
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
} from '@wordpress/blocks';
|
|
22
22
|
import {
|
|
23
23
|
BlockPreview,
|
|
24
|
-
|
|
24
|
+
privateApis as blockEditorPrivateApis,
|
|
25
25
|
} from '@wordpress/block-editor';
|
|
26
26
|
import { closeSmall } from '@wordpress/icons';
|
|
27
27
|
import { useResizeObserver } from '@wordpress/compose';
|
|
@@ -30,9 +30,9 @@ import { useMemo, memo } from '@wordpress/element';
|
|
|
30
30
|
/**
|
|
31
31
|
* Internal dependencies
|
|
32
32
|
*/
|
|
33
|
-
import { unlock } from '../../
|
|
33
|
+
import { unlock } from '../../private-apis';
|
|
34
34
|
|
|
35
|
-
const { useGlobalStyle } = unlock(
|
|
35
|
+
const { useGlobalStyle } = unlock( blockEditorPrivateApis );
|
|
36
36
|
|
|
37
37
|
const SLOT_FILL_NAME = 'EditSiteStyleBook';
|
|
38
38
|
const { Slot: StyleBookSlot, Fill: StyleBookFill } =
|
|
@@ -70,10 +70,14 @@ function getExamples() {
|
|
|
70
70
|
};
|
|
71
71
|
|
|
72
72
|
const otherExamples = getBlockTypes()
|
|
73
|
-
.filter(
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
.filter( ( blockType ) => {
|
|
74
|
+
const { name, example, supports } = blockType;
|
|
75
|
+
return (
|
|
76
|
+
name !== 'core/heading' &&
|
|
77
|
+
!! example &&
|
|
78
|
+
supports.inserter !== false
|
|
79
|
+
);
|
|
80
|
+
} )
|
|
77
81
|
.map( ( blockType ) => ( {
|
|
78
82
|
name: blockType.name,
|
|
79
83
|
title: blockType.title,
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { useEffect } from '@wordpress/element';
|
|
5
|
-
import { useDispatch } from '@wordpress/data';
|
|
5
|
+
import { useSelect, useDispatch } from '@wordpress/data';
|
|
6
|
+
import { store as coreDataStore } from '@wordpress/core-data';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Internal dependencies
|
|
@@ -11,22 +12,55 @@ import { useLocation } from '../routes';
|
|
|
11
12
|
import { store as editSiteStore } from '../../store';
|
|
12
13
|
|
|
13
14
|
export default function useInitEditedEntityFromURL() {
|
|
15
|
+
const { params: { postId, postType, path = '/' } = {} } = useLocation();
|
|
16
|
+
const { isRequestingSite, homepageId } = useSelect( ( select ) => {
|
|
17
|
+
const { getSite } = select( coreDataStore );
|
|
18
|
+
const siteData = getSite();
|
|
19
|
+
|
|
20
|
+
return {
|
|
21
|
+
isRequestingSite: ! siteData,
|
|
22
|
+
homepageId:
|
|
23
|
+
siteData?.show_on_front === 'page'
|
|
24
|
+
? siteData.page_on_front
|
|
25
|
+
: null,
|
|
26
|
+
};
|
|
27
|
+
}, [] );
|
|
28
|
+
|
|
14
29
|
const { setTemplate, setTemplatePart, setPage } =
|
|
15
30
|
useDispatch( editSiteStore );
|
|
16
|
-
const {
|
|
17
|
-
params: { postId, postType },
|
|
18
|
-
} = useLocation();
|
|
19
31
|
|
|
20
|
-
// Set correct entity on page navigation.
|
|
21
32
|
useEffect( () => {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
33
|
+
switch ( path ) {
|
|
34
|
+
case '/templates/single':
|
|
35
|
+
setTemplate( postId );
|
|
36
|
+
break;
|
|
37
|
+
case '/template-parts/single':
|
|
38
|
+
setTemplatePart( postId );
|
|
39
|
+
break;
|
|
40
|
+
case '/navigation/single':
|
|
41
|
+
setPage( {
|
|
42
|
+
context: { postType, postId },
|
|
43
|
+
} );
|
|
44
|
+
break;
|
|
45
|
+
default: {
|
|
46
|
+
if ( homepageId ) {
|
|
47
|
+
setPage( {
|
|
48
|
+
context: { postType: 'page', postId: homepageId },
|
|
49
|
+
} );
|
|
50
|
+
} else if ( ! isRequestingSite ) {
|
|
51
|
+
setPage( {
|
|
52
|
+
path: '/',
|
|
53
|
+
} );
|
|
54
|
+
}
|
|
55
|
+
}
|
|
30
56
|
}
|
|
31
|
-
}, [
|
|
57
|
+
}, [
|
|
58
|
+
path,
|
|
59
|
+
postId,
|
|
60
|
+
homepageId,
|
|
61
|
+
isRequestingSite,
|
|
62
|
+
setPage,
|
|
63
|
+
setTemplate,
|
|
64
|
+
setTemplatePart,
|
|
65
|
+
] );
|
|
32
66
|
}
|
|
@@ -9,7 +9,7 @@ import { useSelect, useDispatch } from '@wordpress/data';
|
|
|
9
9
|
*/
|
|
10
10
|
import { store as editSiteStore } from '../../store';
|
|
11
11
|
import { useLocation, useHistory } from '../routes';
|
|
12
|
-
import { unlock } from '../../
|
|
12
|
+
import { unlock } from '../../private-apis';
|
|
13
13
|
|
|
14
14
|
export default function useSyncCanvasModeWithURL() {
|
|
15
15
|
const history = useHistory();
|
|
@@ -9,28 +9,28 @@ import { useEffect, useRef } from '@wordpress/element';
|
|
|
9
9
|
*/
|
|
10
10
|
import { useLocation, useHistory } from '../routes';
|
|
11
11
|
|
|
12
|
-
export default function
|
|
12
|
+
export default function useSyncPathWithURL() {
|
|
13
13
|
const history = useHistory();
|
|
14
14
|
const { params } = useLocation();
|
|
15
|
-
const {
|
|
15
|
+
const { path = '/' } = params;
|
|
16
16
|
const { location, goTo } = useNavigator();
|
|
17
|
-
const
|
|
17
|
+
const currentPath = useRef( path );
|
|
18
18
|
const currentNavigatorLocation = useRef( location.path );
|
|
19
19
|
useEffect( () => {
|
|
20
|
-
|
|
21
|
-
if (
|
|
22
|
-
goTo(
|
|
20
|
+
currentPath.current = path;
|
|
21
|
+
if ( path !== currentNavigatorLocation.current ) {
|
|
22
|
+
goTo( path );
|
|
23
23
|
}
|
|
24
|
-
}, [
|
|
24
|
+
}, [ path ] );
|
|
25
25
|
useEffect( () => {
|
|
26
26
|
currentNavigatorLocation.current = location.path;
|
|
27
|
-
if ( location.path !==
|
|
27
|
+
if ( location.path !== currentPath.current ) {
|
|
28
28
|
history.push( {
|
|
29
29
|
...params,
|
|
30
|
-
|
|
30
|
+
path: location.path,
|
|
31
31
|
} );
|
|
32
32
|
}
|
|
33
33
|
}, [ location.path, history ] );
|
|
34
34
|
|
|
35
|
-
return
|
|
35
|
+
return path;
|
|
36
36
|
}
|
|
@@ -12,7 +12,7 @@ import { decodeEntities } from '@wordpress/html-entities';
|
|
|
12
12
|
import { store as editSiteStore } from '../../store';
|
|
13
13
|
|
|
14
14
|
export default function useEditedEntityRecord() {
|
|
15
|
-
const { record, title, isLoaded } = useSelect( ( select ) => {
|
|
15
|
+
const { record, title, description, isLoaded } = useSelect( ( select ) => {
|
|
16
16
|
const { getEditedPostType, getEditedPostId } = select( editSiteStore );
|
|
17
17
|
const { getEditedEntityRecord } = select( coreStore );
|
|
18
18
|
const { __experimentalGetTemplateInfo: getTemplateInfo } =
|
|
@@ -21,10 +21,12 @@ export default function useEditedEntityRecord() {
|
|
|
21
21
|
const postId = getEditedPostId();
|
|
22
22
|
const _record = getEditedEntityRecord( 'postType', postType, postId );
|
|
23
23
|
const _isLoaded = !! postId;
|
|
24
|
+
const templateInfo = getTemplateInfo( _record );
|
|
24
25
|
|
|
25
26
|
return {
|
|
26
27
|
record: _record,
|
|
27
|
-
title:
|
|
28
|
+
title: templateInfo.title,
|
|
29
|
+
description: templateInfo.description,
|
|
28
30
|
isLoaded: _isLoaded,
|
|
29
31
|
};
|
|
30
32
|
}, [] );
|
|
@@ -33,5 +35,7 @@ export default function useEditedEntityRecord() {
|
|
|
33
35
|
isLoaded,
|
|
34
36
|
record,
|
|
35
37
|
getTitle: () => ( title ? decodeEntities( title ) : null ),
|
|
38
|
+
getDescription: () =>
|
|
39
|
+
description ? decodeEntities( description ) : null,
|
|
36
40
|
};
|
|
37
41
|
}
|
|
@@ -11,7 +11,7 @@ import { createHigherOrderComponent } from '@wordpress/compose';
|
|
|
11
11
|
import {
|
|
12
12
|
InspectorAdvancedControls,
|
|
13
13
|
store as blockEditorStore,
|
|
14
|
-
|
|
14
|
+
privateApis as blockEditorPrivateApis,
|
|
15
15
|
} from '@wordpress/block-editor';
|
|
16
16
|
import { BaseControl, Button } from '@wordpress/components';
|
|
17
17
|
import { __, sprintf } from '@wordpress/i18n';
|
|
@@ -26,10 +26,10 @@ import { store as noticesStore } from '@wordpress/notices';
|
|
|
26
26
|
/**
|
|
27
27
|
* Internal dependencies
|
|
28
28
|
*/
|
|
29
|
-
import {
|
|
30
|
-
import { unlock } from '../../
|
|
29
|
+
import { useSupportedStyles } from '../../components/global-styles/hooks';
|
|
30
|
+
import { unlock } from '../../private-apis';
|
|
31
31
|
|
|
32
|
-
const { GlobalStylesContext } = unlock(
|
|
32
|
+
const { GlobalStylesContext } = unlock( blockEditorPrivateApis );
|
|
33
33
|
|
|
34
34
|
// TODO: Temporary duplication of constant in @wordpress/block-editor. Can be
|
|
35
35
|
// removed by moving PushChangesToGlobalStylesControl to
|
|
@@ -90,22 +90,30 @@ const STYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE = {
|
|
|
90
90
|
'typography.fontFamily': 'fontFamily',
|
|
91
91
|
};
|
|
92
92
|
|
|
93
|
-
function
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
93
|
+
function useChangesToPush( name, attributes ) {
|
|
94
|
+
const supports = useSupportedStyles( name );
|
|
95
|
+
|
|
96
|
+
return useMemo(
|
|
97
|
+
() =>
|
|
98
|
+
supports.flatMap( ( key ) => {
|
|
99
|
+
if ( ! STYLE_PROPERTY[ key ] ) {
|
|
100
|
+
return [];
|
|
101
|
+
}
|
|
102
|
+
const { value: path } = STYLE_PROPERTY[ key ];
|
|
103
|
+
const presetAttributeKey = path.join( '.' );
|
|
104
|
+
const presetAttributeValue =
|
|
105
|
+
attributes[
|
|
106
|
+
STYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE[
|
|
107
|
+
presetAttributeKey
|
|
108
|
+
]
|
|
109
|
+
];
|
|
110
|
+
const value = presetAttributeValue
|
|
111
|
+
? `var:preset|${ STYLE_PATH_TO_CSS_VAR_INFIX[ presetAttributeKey ] }|${ presetAttributeValue }`
|
|
112
|
+
: get( attributes.style, path );
|
|
113
|
+
return value ? [ { path, value } ] : [];
|
|
114
|
+
} ),
|
|
115
|
+
[ supports, name, attributes ]
|
|
116
|
+
);
|
|
109
117
|
}
|
|
110
118
|
|
|
111
119
|
function cloneDeep( object ) {
|
|
@@ -117,10 +125,7 @@ function PushChangesToGlobalStylesControl( {
|
|
|
117
125
|
attributes,
|
|
118
126
|
setAttributes,
|
|
119
127
|
} ) {
|
|
120
|
-
const changes =
|
|
121
|
-
() => getChangesToPush( name, attributes ),
|
|
122
|
-
[ name, attributes ]
|
|
123
|
-
);
|
|
128
|
+
const changes = useChangesToPush( name, attributes );
|
|
124
129
|
|
|
125
130
|
const { user: userConfig, setUserConfig } =
|
|
126
131
|
useContext( GlobalStylesContext );
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/
|
|
4
|
+
import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';
|
|
5
5
|
|
|
6
6
|
export const { lock, unlock } =
|
|
7
7
|
__dangerousOptInToUnstableAPIsOnlyForCoreModules(
|
package/src/store/index.js
CHANGED
|
@@ -12,7 +12,7 @@ import * as privateActions from './private-actions';
|
|
|
12
12
|
import * as selectors from './selectors';
|
|
13
13
|
import * as privateSelectors from './private-selectors';
|
|
14
14
|
import { STORE_NAME } from './constants';
|
|
15
|
-
import { unlock } from '../
|
|
15
|
+
import { unlock } from '../private-apis';
|
|
16
16
|
|
|
17
17
|
export const storeConfig = {
|
|
18
18
|
reducer,
|
package/src/style.scss
CHANGED
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
@import "./components/create-template-part-modal/style.scss";
|
|
18
18
|
@import "./components/secondary-sidebar/style.scss";
|
|
19
19
|
@import "./components/welcome-guide/style.scss";
|
|
20
|
+
@import "./components/start-template-options/style.scss";
|
|
20
21
|
@import "./components/keyboard-shortcut-help-modal/style.scss";
|
|
21
22
|
@import "./components/layout/style.scss";
|
|
22
23
|
@import "./components/save-panel/style.scss";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Returns if the params match the list page route.
|
|
3
3
|
*
|
|
4
|
-
* @param {Object} params
|
|
5
|
-
* @param {string} params.
|
|
6
|
-
*
|
|
4
|
+
* @param {Object} params The url params.
|
|
5
|
+
* @param {string} params.path The current path.
|
|
6
|
+
*
|
|
7
7
|
* @return {boolean} Is list page or not.
|
|
8
8
|
*/
|
|
9
|
-
export default function getIsListPage( {
|
|
10
|
-
return
|
|
9
|
+
export default function getIsListPage( { path } ) {
|
|
10
|
+
return path === '/templates/all' || path === '/template-parts/all';
|
|
11
11
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sync-state-with-url/use-sync-sidebar-path-with-url.js"],"names":["useSyncSidebarPathWithURL","history","params","sidebar","location","goTo","currentSidebar","currentNavigatorLocation","path","current","push"],"mappings":";;;;;;;AAGA;;AACA;;AAKA;;AATA;AACA;AACA;;AAIA;AACA;AACA;AAGe,SAASA,yBAAT,GAAqC;AACnD,QAAMC,OAAO,GAAG,yBAAhB;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAa,0BAAnB;AACA,QAAM;AAAEC,IAAAA,OAAO,GAAG;AAAZ,MAAoBD,MAA1B;AACA,QAAM;AAAEE,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,MAAqB,6CAA3B;AACA,QAAMC,cAAc,GAAG,qBAAQH,OAAR,CAAvB;AACA,QAAMI,wBAAwB,GAAG,qBAAQH,QAAQ,CAACI,IAAjB,CAAjC;AACA,0BAAW,MAAM;AAChBF,IAAAA,cAAc,CAACG,OAAf,GAAyBN,OAAzB;;AACA,QAAKA,OAAO,KAAKI,wBAAwB,CAACE,OAA1C,EAAoD;AACnDJ,MAAAA,IAAI,CAAEF,OAAF,CAAJ;AACA;AACD,GALD,EAKG,CAAEA,OAAF,CALH;AAMA,0BAAW,MAAM;AAChBI,IAAAA,wBAAwB,CAACE,OAAzB,GAAmCL,QAAQ,CAACI,IAA5C;;AACA,QAAKJ,QAAQ,CAACI,IAAT,KAAkBF,cAAc,CAACG,OAAtC,EAAgD;AAC/CR,MAAAA,OAAO,CAACS,IAAR,CAAc,EACb,GAAGR,MADU;AAEbC,QAAAA,OAAO,EAAEC,QAAQ,CAACI;AAFL,OAAd;AAIA;AACD,GARD,EAQG,CAAEJ,QAAQ,CAACI,IAAX,EAAiBP,OAAjB,CARH;AAUA,SAAOE,OAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalUseNavigator as useNavigator } from '@wordpress/components';\nimport { useEffect, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useLocation, useHistory } from '../routes';\n\nexport default function useSyncSidebarPathWithURL() {\n\tconst history = useHistory();\n\tconst { params } = useLocation();\n\tconst { sidebar = '/' } = params;\n\tconst { location, goTo } = useNavigator();\n\tconst currentSidebar = useRef( sidebar );\n\tconst currentNavigatorLocation = useRef( location.path );\n\tuseEffect( () => {\n\t\tcurrentSidebar.current = sidebar;\n\t\tif ( sidebar !== currentNavigatorLocation.current ) {\n\t\t\tgoTo( sidebar );\n\t\t}\n\t}, [ sidebar ] );\n\tuseEffect( () => {\n\t\tcurrentNavigatorLocation.current = location.path;\n\t\tif ( location.path !== currentSidebar.current ) {\n\t\t\thistory.push( {\n\t\t\t\t...params,\n\t\t\t\tsidebar: location.path,\n\t\t\t} );\n\t\t}\n\t}, [ location.path, history ] );\n\n\treturn sidebar;\n}\n"]}
|
package/build/experiments.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/experiments.js"],"names":["lock","unlock"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;AAGO,MAAM;AAAEA,EAAAA,IAAF;AAAQC,EAAAA;AAAR,IACZ,mEACC,8GADD,EAEC,sBAFD,CADM","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/experiments';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.',\n\t\t'@wordpress/edit-site'\n\t);\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sync-state-with-url/use-sync-sidebar-path-with-url.js"],"names":["__experimentalUseNavigator","useNavigator","useEffect","useRef","useLocation","useHistory","useSyncSidebarPathWithURL","history","params","sidebar","location","goTo","currentSidebar","currentNavigatorLocation","path","current","push"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,0BAA0B,IAAIC,YAAvC,QAA2D,uBAA3D;AACA,SAASC,SAAT,EAAoBC,MAApB,QAAkC,oBAAlC;AAEA;AACA;AACA;;AACA,SAASC,WAAT,EAAsBC,UAAtB,QAAwC,WAAxC;AAEA,eAAe,SAASC,yBAAT,GAAqC;AACnD,QAAMC,OAAO,GAAGF,UAAU,EAA1B;AACA,QAAM;AAAEG,IAAAA;AAAF,MAAaJ,WAAW,EAA9B;AACA,QAAM;AAAEK,IAAAA,OAAO,GAAG;AAAZ,MAAoBD,MAA1B;AACA,QAAM;AAAEE,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,MAAqBV,YAAY,EAAvC;AACA,QAAMW,cAAc,GAAGT,MAAM,CAAEM,OAAF,CAA7B;AACA,QAAMI,wBAAwB,GAAGV,MAAM,CAAEO,QAAQ,CAACI,IAAX,CAAvC;AACAZ,EAAAA,SAAS,CAAE,MAAM;AAChBU,IAAAA,cAAc,CAACG,OAAf,GAAyBN,OAAzB;;AACA,QAAKA,OAAO,KAAKI,wBAAwB,CAACE,OAA1C,EAAoD;AACnDJ,MAAAA,IAAI,CAAEF,OAAF,CAAJ;AACA;AACD,GALQ,EAKN,CAAEA,OAAF,CALM,CAAT;AAMAP,EAAAA,SAAS,CAAE,MAAM;AAChBW,IAAAA,wBAAwB,CAACE,OAAzB,GAAmCL,QAAQ,CAACI,IAA5C;;AACA,QAAKJ,QAAQ,CAACI,IAAT,KAAkBF,cAAc,CAACG,OAAtC,EAAgD;AAC/CR,MAAAA,OAAO,CAACS,IAAR,CAAc,EACb,GAAGR,MADU;AAEbC,QAAAA,OAAO,EAAEC,QAAQ,CAACI;AAFL,OAAd;AAIA;AACD,GARQ,EAQN,CAAEJ,QAAQ,CAACI,IAAX,EAAiBP,OAAjB,CARM,CAAT;AAUA,SAAOE,OAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalUseNavigator as useNavigator } from '@wordpress/components';\nimport { useEffect, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useLocation, useHistory } from '../routes';\n\nexport default function useSyncSidebarPathWithURL() {\n\tconst history = useHistory();\n\tconst { params } = useLocation();\n\tconst { sidebar = '/' } = params;\n\tconst { location, goTo } = useNavigator();\n\tconst currentSidebar = useRef( sidebar );\n\tconst currentNavigatorLocation = useRef( location.path );\n\tuseEffect( () => {\n\t\tcurrentSidebar.current = sidebar;\n\t\tif ( sidebar !== currentNavigatorLocation.current ) {\n\t\t\tgoTo( sidebar );\n\t\t}\n\t}, [ sidebar ] );\n\tuseEffect( () => {\n\t\tcurrentNavigatorLocation.current = location.path;\n\t\tif ( location.path !== currentSidebar.current ) {\n\t\t\thistory.push( {\n\t\t\t\t...params,\n\t\t\t\tsidebar: location.path,\n\t\t\t} );\n\t\t}\n\t}, [ location.path, history ] );\n\n\treturn sidebar;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/experiments.js"],"names":["__dangerousOptInToUnstableAPIsOnlyForCoreModules","lock","unlock"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gDAAT,QAAiE,wBAAjE;AAEA,OAAO,MAAM;AAAEC,EAAAA,IAAF;AAAQC,EAAAA;AAAR,IACZF,gDAAgD,CAC/C,8GAD+C,EAE/C,sBAF+C,CAD1C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/experiments';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.',\n\t\t'@wordpress/edit-site'\n\t);\n"]}
|