@wordpress/edit-site 6.31.1-next.f56bd8138.0 → 6.32.1-next.47f435fc9.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/add-new-pattern/index.js +153 -141
- package/build/components/add-new-pattern/index.js.map +7 -1
- package/build/components/add-new-post/index.js +114 -89
- package/build/components/add-new-post/index.js.map +7 -1
- package/build/components/add-new-template/add-custom-generic-template-modal-content.js +80 -60
- package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +7 -1
- package/build/components/add-new-template/add-custom-template-modal-content.js +284 -207
- package/build/components/add-new-template/add-custom-template-modal-content.js.map +7 -1
- package/build/components/add-new-template/index.js +309 -248
- package/build/components/add-new-template/index.js.map +7 -1
- package/build/components/add-new-template/utils.js +459 -446
- package/build/components/add-new-template/utils.js.map +7 -1
- package/build/components/app/index.js +72 -63
- package/build/components/app/index.js.map +7 -1
- package/build/components/block-editor/use-editor-iframe-props.js +63 -66
- package/build/components/block-editor/use-editor-iframe-props.js.map +7 -1
- package/build/components/block-editor/use-navigate-to-entity-record.js +34 -22
- package/build/components/block-editor/use-navigate-to-entity-record.js.map +7 -1
- package/build/components/block-editor/use-site-editor-settings.js +64 -51
- package/build/components/block-editor/use-site-editor-settings.js.map +7 -1
- package/build/components/canvas-loader/index.js +41 -56
- package/build/components/canvas-loader/index.js.map +7 -1
- package/build/components/dataviews-actions/index.js +96 -83
- package/build/components/dataviews-actions/index.js.map +7 -1
- package/build/components/editor/index.js +288 -235
- package/build/components/editor/index.js.map +7 -1
- package/build/components/editor/site-preview.js +55 -42
- package/build/components/editor/site-preview.js.map +7 -1
- package/build/components/editor/use-adapt-editor-to-canvas.js +49 -31
- package/build/components/editor/use-adapt-editor-to-canvas.js.map +7 -1
- package/build/components/editor/use-editor-title.js +79 -61
- package/build/components/editor/use-editor-title.js.map +7 -1
- package/build/components/editor/use-resolve-edited-entity.js +112 -140
- package/build/components/editor/use-resolve-edited-entity.js.map +7 -1
- package/build/components/editor-canvas-container/index.js +101 -91
- package/build/components/editor-canvas-container/index.js.map +7 -1
- package/build/components/global-styles/background-panel.js +46 -39
- package/build/components/global-styles/background-panel.js.map +7 -1
- package/build/components/global-styles/block-preview-panel.js +58 -52
- package/build/components/global-styles/block-preview-panel.js.map +7 -1
- package/build/components/global-styles/color-indicator-wrapper.js +47 -26
- package/build/components/global-styles/color-indicator-wrapper.js.map +7 -1
- package/build/components/global-styles/color-palette-panel.js +130 -81
- package/build/components/global-styles/color-palette-panel.js.map +7 -1
- package/build/components/global-styles/confirm-reset-shadow-dialog.js +38 -22
- package/build/components/global-styles/confirm-reset-shadow-dialog.js.map +7 -1
- package/build/components/global-styles/dimensions-panel.js +46 -41
- package/build/components/global-styles/dimensions-panel.js.map +7 -1
- package/build/components/global-styles/font-families.js +106 -102
- package/build/components/global-styles/font-families.js.map +7 -1
- package/build/components/global-styles/font-family-item.js +41 -43
- package/build/components/global-styles/font-family-item.js.map +7 -1
- package/build/components/global-styles/font-library-modal/collection-font-variant.js +55 -39
- package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +7 -1
- package/build/components/global-styles/font-library-modal/context.js +228 -243
- package/build/components/global-styles/font-library-modal/context.js.map +7 -1
- package/build/components/global-styles/font-library-modal/font-card.js +70 -59
- package/build/components/global-styles/font-library-modal/font-card.js.map +7 -1
- package/build/components/global-styles/font-library-modal/font-collection.js +407 -321
- package/build/components/global-styles/font-library-modal/font-collection.js.map +7 -1
- package/build/components/global-styles/font-library-modal/font-demo.js +54 -50
- package/build/components/global-styles/font-library-modal/font-demo.js.map +7 -1
- package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +52 -44
- package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +7 -1
- package/build/components/global-styles/font-library-modal/index.js +90 -87
- package/build/components/global-styles/font-library-modal/index.js.map +7 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js +369 -255
- package/build/components/global-styles/font-library-modal/installed-fonts.js.map +7 -1
- package/build/components/global-styles/font-library-modal/library-font-details.js +60 -42
- package/build/components/global-styles/font-library-modal/library-font-details.js.map +7 -1
- package/build/components/global-styles/font-library-modal/library-font-variant.js +64 -49
- package/build/components/global-styles/font-library-modal/library-font-variant.js.map +7 -1
- package/build/components/global-styles/font-library-modal/resolvers.js +64 -31
- package/build/components/global-styles/font-library-modal/resolvers.js.map +7 -1
- package/build/components/global-styles/font-library-modal/upload-fonts.js +133 -145
- package/build/components/global-styles/font-library-modal/upload-fonts.js.map +7 -1
- package/build/components/global-styles/font-library-modal/utils/constants.js +45 -24
- package/build/components/global-styles/font-library-modal/utils/constants.js.map +7 -1
- package/build/components/global-styles/font-library-modal/utils/filter-fonts.js +30 -27
- package/build/components/global-styles/font-library-modal/utils/filter-fonts.js.map +7 -1
- package/build/components/global-styles/font-library-modal/utils/fonts-outline.js +41 -13
- package/build/components/global-styles/font-library-modal/utils/fonts-outline.js.map +7 -1
- package/build/components/global-styles/font-library-modal/utils/index.js +127 -161
- package/build/components/global-styles/font-library-modal/utils/index.js.map +7 -1
- package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js +25 -18
- package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +7 -1
- package/build/components/global-styles/font-library-modal/utils/preview-styles.js +55 -74
- package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +7 -1
- package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js +32 -16
- package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +7 -1
- package/build/components/global-styles/font-library-modal/utils/toggleFont.js +43 -72
- package/build/components/global-styles/font-library-modal/utils/toggleFont.js.map +7 -1
- package/build/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js +44 -23
- package/build/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js.map +7 -1
- package/build/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js +38 -22
- package/build/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js.map +7 -1
- package/build/components/global-styles/font-sizes/font-size-preview.js +42 -35
- package/build/components/global-styles/font-sizes/font-size-preview.js.map +7 -1
- package/build/components/global-styles/font-sizes/font-size.js +207 -170
- package/build/components/global-styles/font-sizes/font-size.js.map +7 -1
- package/build/components/global-styles/font-sizes/font-sizes-count.js +46 -45
- package/build/components/global-styles/font-sizes/font-sizes-count.js.map +7 -1
- package/build/components/global-styles/font-sizes/font-sizes.js +199 -136
- package/build/components/global-styles/font-sizes/font-sizes.js.map +7 -1
- package/build/components/global-styles/font-sizes/rename-font-size-dialog.js +81 -58
- package/build/components/global-styles/font-sizes/rename-font-size-dialog.js.map +7 -1
- package/build/components/global-styles/gradients-palette-panel.js +140 -85
- package/build/components/global-styles/gradients-palette-panel.js.map +7 -1
- package/build/components/global-styles/header.js +51 -48
- package/build/components/global-styles/header.js.map +7 -1
- package/build/components/global-styles/highlighted-colors.js +48 -40
- package/build/components/global-styles/highlighted-colors.js.map +7 -1
- package/build/components/global-styles/hooks.js +89 -68
- package/build/components/global-styles/hooks.js.map +7 -1
- package/build/components/global-styles/icon-with-current-color.js +50 -25
- package/build/components/global-styles/icon-with-current-color.js.map +7 -1
- package/build/components/global-styles/index.js +36 -11
- package/build/components/global-styles/index.js.map +7 -1
- package/build/components/global-styles/navigation-button.js +41 -42
- package/build/components/global-styles/navigation-button.js.map +7 -1
- package/build/components/global-styles/palette.js +82 -73
- package/build/components/global-styles/palette.js.map +7 -1
- package/build/components/global-styles/preset-colors.js +36 -24
- package/build/components/global-styles/preset-colors.js.map +7 -1
- package/build/components/global-styles/preview-colors.js +68 -46
- package/build/components/global-styles/preview-colors.js.map +7 -1
- package/build/components/global-styles/preview-styles.js +182 -136
- package/build/components/global-styles/preview-styles.js.map +7 -1
- package/build/components/global-styles/preview-typography.js +65 -44
- package/build/components/global-styles/preview-typography.js.map +7 -1
- package/build/components/global-styles/preview-wrapper.js +70 -85
- package/build/components/global-styles/preview-wrapper.js.map +7 -1
- package/build/components/global-styles/root-menu.js +53 -52
- package/build/components/global-styles/root-menu.js.map +7 -1
- package/build/components/global-styles/screen-background.js +54 -35
- package/build/components/global-styles/screen-background.js.map +7 -1
- package/build/components/global-styles/screen-block-list.js +129 -118
- package/build/components/global-styles/screen-block-list.js.map +7 -1
- package/build/components/global-styles/screen-block.js +185 -182
- package/build/components/global-styles/screen-block.js.map +7 -1
- package/build/components/global-styles/screen-color-palette.js +61 -56
- package/build/components/global-styles/screen-color-palette.js.map +7 -1
- package/build/components/global-styles/screen-colors.js +64 -40
- package/build/components/global-styles/screen-colors.js.map +7 -1
- package/build/components/global-styles/screen-css.js +80 -50
- package/build/components/global-styles/screen-css.js.map +7 -1
- package/build/components/global-styles/screen-layout.js +45 -32
- package/build/components/global-styles/screen-layout.js.map +7 -1
- package/build/components/global-styles/screen-revisions/index.js +144 -116
- package/build/components/global-styles/screen-revisions/index.js.map +7 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +165 -166
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +7 -1
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +93 -81
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +7 -1
- package/build/components/global-styles/screen-root.js +93 -84
- package/build/components/global-styles/screen-root.js.map +7 -1
- package/build/components/global-styles/screen-shadows.js +43 -16
- package/build/components/global-styles/screen-shadows.js.map +7 -1
- package/build/components/global-styles/screen-style-variations.js +64 -44
- package/build/components/global-styles/screen-style-variations.js.map +7 -1
- package/build/components/global-styles/screen-typography-element.js +146 -93
- package/build/components/global-styles/screen-typography-element.js.map +7 -1
- package/build/components/global-styles/screen-typography.js +64 -40
- package/build/components/global-styles/screen-typography.js.map +7 -1
- package/build/components/global-styles/shadow-utils.js +75 -180
- package/build/components/global-styles/shadow-utils.js.map +7 -1
- package/build/components/global-styles/shadows-edit-panel.js +433 -358
- package/build/components/global-styles/shadows-edit-panel.js.map +7 -1
- package/build/components/global-styles/shadows-panel.js +178 -131
- package/build/components/global-styles/shadows-panel.js.map +7 -1
- package/build/components/global-styles/size-control/index.js +66 -76
- package/build/components/global-styles/size-control/index.js.map +7 -1
- package/build/components/global-styles/style-variations-container.js +114 -102
- package/build/components/global-styles/style-variations-container.js.map +7 -1
- package/build/components/global-styles/subtitle.js +34 -21
- package/build/components/global-styles/subtitle.js.map +7 -1
- package/build/components/global-styles/typeset.js +73 -75
- package/build/components/global-styles/typeset.js.map +7 -1
- package/build/components/global-styles/typography-elements.js +109 -86
- package/build/components/global-styles/typography-elements.js.map +7 -1
- package/build/components/global-styles/typography-example.js +66 -65
- package/build/components/global-styles/typography-example.js.map +7 -1
- package/build/components/global-styles/typography-panel.js +57 -39
- package/build/components/global-styles/typography-panel.js.map +7 -1
- package/build/components/global-styles/typography-preview.js +73 -53
- package/build/components/global-styles/typography-preview.js.map +7 -1
- package/build/components/global-styles/ui.js +282 -314
- package/build/components/global-styles/ui.js.map +7 -1
- package/build/components/global-styles/utils.js +45 -31
- package/build/components/global-styles/utils.js.map +7 -1
- package/build/components/global-styles/variations/variation.js +90 -74
- package/build/components/global-styles/variations/variation.js.map +7 -1
- package/build/components/global-styles/variations/variations-color.js +52 -41
- package/build/components/global-styles/variations/variations-color.js.map +7 -1
- package/build/components/global-styles/variations/variations-panel.js +61 -51
- package/build/components/global-styles/variations/variations-panel.js.map +7 -1
- package/build/components/global-styles/variations/variations-typography.js +69 -49
- package/build/components/global-styles/variations/variations-typography.js.map +7 -1
- package/build/components/global-styles-renderer/index.js +39 -33
- package/build/components/global-styles-renderer/index.js.map +7 -1
- package/build/components/global-styles-sidebar/default-sidebar.js +53 -40
- package/build/components/global-styles-sidebar/default-sidebar.js.map +7 -1
- package/build/components/global-styles-sidebar/index.js +164 -141
- package/build/components/global-styles-sidebar/index.js.map +7 -1
- package/build/components/layout/animation.js +53 -78
- package/build/components/layout/animation.js.map +7 -1
- package/build/components/layout/hooks.js +40 -35
- package/build/components/layout/hooks.js.map +7 -1
- package/build/components/layout/index.js +220 -199
- package/build/components/layout/index.js.map +7 -1
- package/build/components/media/index.js +31 -26
- package/build/components/media/index.js.map +7 -1
- package/build/components/more-menu/index.js +45 -28
- package/build/components/more-menu/index.js.map +7 -1
- package/build/components/more-menu/site-export.js +69 -44
- package/build/components/more-menu/site-export.js.map +7 -1
- package/build/components/more-menu/welcome-guide-menu-item.js +29 -21
- package/build/components/more-menu/welcome-guide-menu-item.js.map +7 -1
- package/build/components/page-patterns/actions.js +82 -0
- package/build/components/page-patterns/actions.js.map +7 -0
- package/build/components/page-patterns/delete-category-menu-item.js +94 -82
- package/build/components/page-patterns/delete-category-menu-item.js.map +7 -1
- package/build/components/page-patterns/fields.js +135 -123
- package/build/components/page-patterns/fields.js.map +7 -1
- package/build/components/page-patterns/index.js +182 -148
- package/build/components/page-patterns/index.js.map +7 -1
- package/build/components/page-patterns/rename-category-menu-item.js +67 -62
- package/build/components/page-patterns/rename-category-menu-item.js.map +7 -1
- package/build/components/page-patterns/search-items.js +65 -89
- package/build/components/page-patterns/search-items.js.map +7 -1
- package/build/components/page-patterns/use-pattern-settings.js +45 -35
- package/build/components/page-patterns/use-pattern-settings.js.map +7 -1
- package/build/components/page-patterns/use-patterns.js +266 -200
- package/build/components/page-patterns/use-patterns.js.map +7 -1
- package/build/components/page-patterns/utils.js +27 -7
- package/build/components/page-patterns/utils.js.map +7 -1
- package/build/components/page-templates/fields.js +165 -159
- package/build/components/page-templates/fields.js.map +7 -1
- package/build/components/page-templates/hooks.js +66 -64
- package/build/components/page-templates/hooks.js.map +7 -1
- package/build/components/page-templates/index.js +211 -207
- package/build/components/page-templates/index.js.map +7 -1
- package/build/components/page-templates/view-utils.js +67 -0
- package/build/components/page-templates/view-utils.js.map +7 -0
- package/build/components/pagination/index.js +119 -82
- package/build/components/pagination/index.js.map +7 -1
- package/build/components/plugin-template-setting-panel/index.js +49 -56
- package/build/components/plugin-template-setting-panel/index.js.map +7 -1
- package/build/components/post-edit/index.js +171 -144
- package/build/components/post-edit/index.js.map +7 -1
- package/build/components/post-list/index.js +230 -301
- package/build/components/post-list/index.js.map +7 -1
- package/build/components/post-list/view-utils.js +167 -0
- package/build/components/post-list/view-utils.js.map +7 -0
- package/build/components/posts-app/index.js +44 -32
- package/build/components/posts-app/index.js.map +7 -1
- package/build/components/posts-app-routes/index.js +36 -25
- package/build/components/posts-app-routes/index.js.map +7 -1
- package/build/components/posts-app-routes/post-item.js +54 -35
- package/build/components/posts-app-routes/post-item.js.map +7 -1
- package/build/components/posts-app-routes/posts.js +91 -76
- package/build/components/posts-app-routes/posts.js.map +7 -1
- package/build/components/resizable-frame/index.js +200 -224
- package/build/components/resizable-frame/index.js.map +7 -1
- package/build/components/revisions/index.js +102 -71
- package/build/components/revisions/index.js.map +7 -1
- package/build/components/routes/use-title.js +45 -35
- package/build/components/routes/use-title.js.map +7 -1
- package/build/components/save-button/index.js +113 -111
- package/build/components/save-button/index.js.map +7 -1
- package/build/components/save-hub/index.js +52 -40
- package/build/components/save-hub/index.js.map +7 -1
- package/build/components/save-keyboard-shortcut/index.js +46 -52
- package/build/components/save-keyboard-shortcut/index.js.map +7 -1
- package/build/components/save-panel/index.js +155 -136
- package/build/components/save-panel/index.js.map +7 -1
- package/build/components/sidebar/index.js +81 -79
- package/build/components/sidebar/index.js.map +7 -1
- package/build/components/sidebar-button/index.js +43 -22
- package/build/components/sidebar-button/index.js.map +7 -1
- package/build/components/sidebar-dataviews/dataview-item.js +68 -55
- package/build/components/sidebar-dataviews/dataview-item.js.map +7 -1
- package/build/components/sidebar-dataviews/index.js +68 -54
- package/build/components/sidebar-dataviews/index.js.map +7 -1
- package/build/components/sidebar-global-styles-wrapper/index.js +125 -111
- package/build/components/sidebar-global-styles-wrapper/index.js.map +7 -1
- package/build/components/sidebar-navigation-item/index.js +79 -62
- package/build/components/sidebar-navigation-item/index.js.map +7 -1
- package/build/components/sidebar-navigation-screen/index.js +129 -104
- package/build/components/sidebar-navigation-screen/index.js.map +7 -1
- package/build/components/sidebar-navigation-screen-details-footer/index.js +63 -53
- package/build/components/sidebar-navigation-screen-details-footer/index.js.map +7 -1
- package/build/components/sidebar-navigation-screen-global-styles/content.js +50 -33
- package/build/components/sidebar-navigation-screen-global-styles/content.js.map +7 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +94 -81
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +7 -1
- package/build/components/sidebar-navigation-screen-main/index.js +141 -90
- package/build/components/sidebar-navigation-screen-main/index.js.map +7 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +40 -29
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +7 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js +124 -91
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +7 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +116 -83
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +7 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +57 -48
- package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +7 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +80 -66
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +7 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +64 -38
- package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +7 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +125 -96
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +7 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +33 -19
- package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +7 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/constants.js +30 -16
- package/build/components/sidebar-navigation-screen-navigation-menus/constants.js.map +7 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +119 -105
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +7 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +130 -121
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +7 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +106 -88
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +7 -1
- package/build/components/sidebar-navigation-screen-patterns/category-item.js +44 -21
- package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +7 -1
- package/build/components/sidebar-navigation-screen-patterns/index.js +129 -106
- package/build/components/sidebar-navigation-screen-patterns/index.js.map +7 -1
- package/build/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js +36 -25
- package/build/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +7 -1
- package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +81 -70
- package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +7 -1
- package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +42 -32
- package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +7 -1
- package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +41 -28
- package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +7 -1
- package/build/components/sidebar-navigation-screen-templates-browse/content.js +95 -76
- package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +7 -1
- package/build/components/sidebar-navigation-screen-templates-browse/index.js +48 -27
- package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +7 -1
- package/build/components/sidebar-navigation-screen-unsupported/index.js +28 -20
- package/build/components/sidebar-navigation-screen-unsupported/index.js.map +7 -1
- package/build/components/site-editor-routes/home.js +50 -32
- package/build/components/site-editor-routes/home.js.map +7 -1
- package/build/components/site-editor-routes/index.js +62 -36
- package/build/components/site-editor-routes/index.js.map +7 -1
- package/build/components/site-editor-routes/navigation-item.js +55 -49
- package/build/components/site-editor-routes/navigation-item.js.map +7 -1
- package/build/components/site-editor-routes/navigation.js +55 -49
- package/build/components/site-editor-routes/navigation.js.map +7 -1
- package/build/components/site-editor-routes/notfound.js +54 -34
- package/build/components/site-editor-routes/notfound.js.map +7 -1
- package/build/components/site-editor-routes/page-item.js +58 -41
- package/build/components/site-editor-routes/page-item.js.map +7 -1
- package/build/components/site-editor-routes/pages.js +96 -86
- package/build/components/site-editor-routes/pages.js.map +7 -1
- package/build/components/site-editor-routes/pattern-item.js +48 -26
- package/build/components/site-editor-routes/pattern-item.js.map +7 -1
- package/build/components/site-editor-routes/patterns.js +51 -36
- package/build/components/site-editor-routes/patterns.js.map +7 -1
- package/build/components/site-editor-routes/stylebook.js +60 -43
- package/build/components/site-editor-routes/stylebook.js.map +7 -1
- package/build/components/site-editor-routes/styles.js +58 -46
- package/build/components/site-editor-routes/styles.js.map +7 -1
- package/build/components/site-editor-routes/template-item.js +54 -34
- package/build/components/site-editor-routes/template-item.js.map +7 -1
- package/build/components/site-editor-routes/template-part-item.js +45 -21
- package/build/components/site-editor-routes/template-part-item.js.map +7 -1
- package/build/components/site-editor-routes/templates.js +69 -44
- package/build/components/site-editor-routes/templates.js.map +7 -1
- package/build/components/site-editor-routes/utils.js +27 -13
- package/build/components/site-editor-routes/utils.js.map +7 -1
- package/build/components/site-hub/index.js +233 -222
- package/build/components/site-hub/index.js.map +7 -1
- package/build/components/site-icon/index.js +61 -49
- package/build/components/site-icon/index.js.map +7 -1
- package/build/components/style-book/categories.js +61 -52
- package/build/components/style-book/categories.js.map +7 -1
- package/build/components/style-book/color-examples.js +54 -40
- package/build/components/style-book/color-examples.js.map +7 -1
- package/build/components/style-book/constants.js +218 -144
- package/build/components/style-book/constants.js.map +7 -1
- package/build/components/style-book/duotone-examples.js +54 -40
- package/build/components/style-book/duotone-examples.js.map +7 -1
- package/build/components/style-book/examples.js +145 -120
- package/build/components/style-book/examples.js.map +7 -1
- package/build/components/style-book/index.js +454 -409
- package/build/components/style-book/index.js.map +7 -1
- package/build/components/style-book/types.js +16 -5
- package/build/components/style-book/types.js.map +7 -1
- package/build/components/welcome-guide/editor.js +87 -60
- package/build/components/welcome-guide/editor.js.map +7 -1
- package/build/components/welcome-guide/image.js +34 -22
- package/build/components/welcome-guide/image.js.map +7 -1
- package/build/components/welcome-guide/index.js +44 -21
- package/build/components/welcome-guide/index.js.map +7 -1
- package/build/components/welcome-guide/page.js +76 -52
- package/build/components/welcome-guide/page.js.map +7 -1
- package/build/components/welcome-guide/styles.js +135 -102
- package/build/components/welcome-guide/styles.js.map +7 -1
- package/build/components/welcome-guide/template.js +71 -59
- package/build/components/welcome-guide/template.js.map +7 -1
- package/build/deprecated.js +56 -46
- package/build/deprecated.js.map +7 -1
- package/build/hooks/commands/use-common-commands.js +117 -119
- package/build/hooks/commands/use-common-commands.js.map +7 -1
- package/build/hooks/commands/use-set-command-context.js +40 -50
- package/build/hooks/commands/use-set-command-context.js.map +7 -1
- package/build/hooks/index.js +2 -3
- package/build/hooks/index.js.map +7 -1
- package/build/hooks/push-changes-to-global-styles/index.js +236 -251
- package/build/hooks/push-changes-to-global-styles/index.js.map +7 -1
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +78 -111
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +7 -1
- package/build/index.js +87 -112
- package/build/index.js.map +7 -1
- package/build/lock-unlock.js +31 -14
- package/build/lock-unlock.js.map +7 -1
- package/build/posts.js +67 -63
- package/build/posts.js.map +7 -1
- package/build/store/actions.js +199 -365
- package/build/store/actions.js.map +7 -1
- package/build/store/constants.js +27 -11
- package/build/store/constants.js.map +7 -1
- package/build/store/index.js +52 -30
- package/build/store/index.js.map +7 -1
- package/build/store/private-actions.js +34 -19
- package/build/store/private-actions.js.map +7 -1
- package/build/store/private-selectors.js +28 -13
- package/build/store/private-selectors.js.map +7 -1
- package/build/store/reducer.js +42 -57
- package/build/store/reducer.js.map +7 -1
- package/build/store/selectors.js +205 -301
- package/build/store/selectors.js.map +7 -1
- package/build/utils/constants.js +94 -53
- package/build/utils/constants.js.map +7 -1
- package/build/utils/get-filtered-template-parts.js +36 -42
- package/build/utils/get-filtered-template-parts.js.map +7 -1
- package/build/utils/is-previewing-theme.js +31 -13
- package/build/utils/is-previewing-theme.js.map +7 -1
- package/build/utils/is-template-removable.js +24 -17
- package/build/utils/is-template-removable.js.map +7 -1
- package/build/utils/is-template-revertable.js +24 -19
- package/build/utils/is-template-revertable.js.map +7 -1
- package/build/utils/set-nested-value.js +24 -25
- package/build/utils/set-nested-value.js.map +7 -1
- package/build/utils/template-part-create.js +1 -1
- package/build/utils/template-part-create.js.map +7 -1
- package/build/utils/use-activate-theme.js +40 -45
- package/build/utils/use-activate-theme.js.map +7 -1
- package/build/utils/use-actual-current-theme.js +47 -25
- package/build/utils/use-actual-current-theme.js.map +7 -1
- package/build-module/components/add-new-pattern/index.js +133 -127
- package/build-module/components/add-new-pattern/index.js.map +7 -1
- package/build-module/components/add-new-post/index.js +100 -82
- package/build-module/components/add-new-post/index.js.map +7 -1
- package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js +63 -51
- package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +7 -1
- package/build-module/components/add-new-template/add-custom-template-modal-content.js +269 -196
- package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +7 -1
- package/build-module/components/add-new-template/index.js +289 -219
- package/build-module/components/add-new-template/index.js.map +7 -1
- package/build-module/components/add-new-template/utils.js +430 -432
- package/build-module/components/add-new-template/utils.js.map +7 -1
- package/build-module/components/app/index.js +41 -51
- package/build-module/components/app/index.js.map +7 -1
- package/build-module/components/block-editor/use-editor-iframe-props.js +33 -58
- package/build-module/components/block-editor/use-editor-iframe-props.js.map +7 -1
- package/build-module/components/block-editor/use-navigate-to-entity-record.js +17 -18
- package/build-module/components/block-editor/use-navigate-to-entity-record.js.map +7 -1
- package/build-module/components/block-editor/use-site-editor-settings.js +28 -41
- package/build-module/components/block-editor/use-site-editor-settings.js.map +7 -1
- package/build-module/components/canvas-loader/index.js +25 -50
- package/build-module/components/canvas-loader/index.js.map +7 -1
- package/build-module/components/dataviews-actions/index.js +75 -78
- package/build-module/components/dataviews-actions/index.js.map +7 -1
- package/build-module/components/editor/index.js +261 -220
- package/build-module/components/editor/index.js.map +7 -1
- package/build-module/components/editor/site-preview.js +38 -38
- package/build-module/components/editor/site-preview.js.map +7 -1
- package/build-module/components/editor/use-adapt-editor-to-canvas.js +25 -24
- package/build-module/components/editor/use-adapt-editor-to-canvas.js.map +7 -1
- package/build-module/components/editor/use-editor-title.js +49 -53
- package/build-module/components/editor/use-editor-title.js.map +7 -1
- package/build-module/components/editor/use-resolve-edited-entity.js +89 -129
- package/build-module/components/editor/use-resolve-edited-entity.js.map +7 -1
- package/build-module/components/editor-canvas-container/index.js +79 -80
- package/build-module/components/editor-canvas-container/index.js.map +7 -1
- package/build-module/components/global-styles/background-panel.js +25 -35
- package/build-module/components/global-styles/background-panel.js.map +7 -1
- package/build-module/components/global-styles/block-preview-panel.js +36 -43
- package/build-module/components/global-styles/block-preview-panel.js.map +7 -1
- package/build-module/components/global-styles/color-indicator-wrapper.js +19 -20
- package/build-module/components/global-styles/color-indicator-wrapper.js.map +7 -1
- package/build-module/components/global-styles/color-palette-panel.js +105 -74
- package/build-module/components/global-styles/color-palette-panel.js.map +7 -1
- package/build-module/components/global-styles/confirm-reset-shadow-dialog.js +20 -17
- package/build-module/components/global-styles/confirm-reset-shadow-dialog.js.map +7 -1
- package/build-module/components/global-styles/dimensions-panel.js +26 -34
- package/build-module/components/global-styles/dimensions-panel.js.map +7 -1
- package/build-module/components/global-styles/font-families.js +86 -93
- package/build-module/components/global-styles/font-families.js.map +7 -1
- package/build-module/components/global-styles/font-family-item.js +26 -37
- package/build-module/components/global-styles/font-family-item.js.map +7 -1
- package/build-module/components/global-styles/font-library-modal/collection-font-variant.js +26 -32
- package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +7 -1
- package/build-module/components/global-styles/font-library-modal/context.js +203 -224
- package/build-module/components/global-styles/font-library-modal/context.js.map +7 -1
- package/build-module/components/global-styles/font-library-modal/font-card.js +48 -52
- package/build-module/components/global-styles/font-library-modal/font-card.js.map +7 -1
- package/build-module/components/global-styles/font-library-modal/font-collection.js +397 -302
- package/build-module/components/global-styles/font-library-modal/font-collection.js.map +7 -1
- package/build-module/components/global-styles/font-library-modal/font-demo.js +32 -38
- package/build-module/components/global-styles/font-library-modal/font-demo.js.map +7 -1
- package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +41 -39
- package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +7 -1
- package/build-module/components/global-styles/font-library-modal/index.js +65 -81
- package/build-module/components/global-styles/font-library-modal/index.js.map +7 -1
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js +354 -243
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +7 -1
- package/build-module/components/global-styles/font-library-modal/library-font-details.js +35 -36
- package/build-module/components/global-styles/font-library-modal/library-font-details.js.map +7 -1
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js +35 -42
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +7 -1
- package/build-module/components/global-styles/font-library-modal/resolvers.js +27 -20
- package/build-module/components/global-styles/font-library-modal/resolvers.js.map +7 -1
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js +111 -135
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +7 -1
- package/build-module/components/global-styles/font-library-modal/utils/constants.js +21 -19
- package/build-module/components/global-styles/font-library-modal/utils/constants.js.map +7 -1
- package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js +13 -24
- package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js.map +7 -1
- package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js +20 -10
- package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js.map +7 -1
- package/build-module/components/global-styles/font-library-modal/utils/index.js +102 -154
- package/build-module/components/global-styles/font-library-modal/utils/index.js.map +7 -1
- package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js +8 -14
- package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +7 -1
- package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js +34 -71
- package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +7 -1
- package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js +11 -13
- package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +7 -1
- package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js +22 -69
- package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js.map +7 -1
- package/build-module/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js +26 -18
- package/build-module/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js.map +7 -1
- package/build-module/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js +20 -17
- package/build-module/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js.map +7 -1
- package/build-module/components/global-styles/font-sizes/font-size-preview.js +26 -29
- package/build-module/components/global-styles/font-sizes/font-size-preview.js.map +7 -1
- package/build-module/components/global-styles/font-sizes/font-size.js +185 -160
- package/build-module/components/global-styles/font-sizes/font-size.js.map +7 -1
- package/build-module/components/global-styles/font-sizes/font-sizes-count.js +23 -39
- package/build-module/components/global-styles/font-sizes/font-sizes-count.js.map +7 -1
- package/build-module/components/global-styles/font-sizes/font-sizes.js +184 -128
- package/build-module/components/global-styles/font-sizes/font-sizes.js.map +7 -1
- package/build-module/components/global-styles/font-sizes/rename-font-size-dialog.js +68 -52
- package/build-module/components/global-styles/font-sizes/rename-font-size-dialog.js.map +7 -1
- package/build-module/components/global-styles/gradients-palette-panel.js +117 -79
- package/build-module/components/global-styles/gradients-palette-panel.js.map +7 -1
- package/build-module/components/global-styles/header.js +40 -43
- package/build-module/components/global-styles/header.js.map +7 -1
- package/build-module/components/global-styles/highlighted-colors.js +31 -36
- package/build-module/components/global-styles/highlighted-colors.js.map +7 -1
- package/build-module/components/global-styles/hooks.js +56 -61
- package/build-module/components/global-styles/hooks.js.map +7 -1
- package/build-module/components/global-styles/icon-with-current-color.js +18 -19
- package/build-module/components/global-styles/icon-with-current-color.js.map +7 -1
- package/build-module/components/global-styles/index.js +5 -2
- package/build-module/components/global-styles/index.js.map +7 -1
- package/build-module/components/global-styles/navigation-button.js +23 -37
- package/build-module/components/global-styles/navigation-button.js.map +7 -1
- package/build-module/components/global-styles/palette.js +61 -67
- package/build-module/components/global-styles/palette.js.map +7 -1
- package/build-module/components/global-styles/preset-colors.js +19 -20
- package/build-module/components/global-styles/preset-colors.js.map +7 -1
- package/build-module/components/global-styles/preview-colors.js +43 -40
- package/build-module/components/global-styles/preview-colors.js.map +7 -1
- package/build-module/components/global-styles/preview-styles.js +158 -130
- package/build-module/components/global-styles/preview-styles.js.map +7 -1
- package/build-module/components/global-styles/preview-typography.js +37 -38
- package/build-module/components/global-styles/preview-typography.js.map +7 -1
- package/build-module/components/global-styles/preview-wrapper.js +51 -75
- package/build-module/components/global-styles/preview-wrapper.js.map +7 -1
- package/build-module/components/global-styles/root-menu.js +38 -44
- package/build-module/components/global-styles/root-menu.js.map +7 -1
- package/build-module/components/global-styles/screen-background.js +26 -29
- package/build-module/components/global-styles/screen-background.js.map +7 -1
- package/build-module/components/global-styles/screen-block-list.js +105 -105
- package/build-module/components/global-styles/screen-block-list.js.map +7 -1
- package/build-module/components/global-styles/screen-block.js +156 -169
- package/build-module/components/global-styles/screen-block.js.map +7 -1
- package/build-module/components/global-styles/screen-color-palette.js +33 -50
- package/build-module/components/global-styles/screen-color-palette.js.map +7 -1
- package/build-module/components/global-styles/screen-colors.js +35 -33
- package/build-module/components/global-styles/screen-colors.js.map +7 -1
- package/build-module/components/global-styles/screen-css.js +52 -44
- package/build-module/components/global-styles/screen-css.js.map +7 -1
- package/build-module/components/global-styles/screen-layout.js +17 -26
- package/build-module/components/global-styles/screen-layout.js.map +7 -1
- package/build-module/components/global-styles/screen-revisions/index.js +117 -105
- package/build-module/components/global-styles/screen-revisions/index.js.map +7 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +145 -158
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +7 -1
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +74 -75
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +7 -1
- package/build-module/components/global-styles/screen-root.js +74 -77
- package/build-module/components/global-styles/screen-root.js.map +7 -1
- package/build-module/components/global-styles/screen-shadows.js +12 -11
- package/build-module/components/global-styles/screen-shadows.js.map +7 -1
- package/build-module/components/global-styles/screen-style-variations.js +38 -37
- package/build-module/components/global-styles/screen-style-variations.js.map +7 -1
- package/build-module/components/global-styles/screen-typography-element.js +122 -87
- package/build-module/components/global-styles/screen-typography-element.js.map +7 -1
- package/build-module/components/global-styles/screen-typography.js +36 -34
- package/build-module/components/global-styles/screen-typography.js.map +7 -1
- package/build-module/components/global-styles/shadow-utils.js +53 -176
- package/build-module/components/global-styles/shadow-utils.js.map +7 -1
- package/build-module/components/global-styles/shadows-edit-panel.js +426 -344
- package/build-module/components/global-styles/shadows-edit-panel.js.map +7 -1
- package/build-module/components/global-styles/shadows-panel.js +159 -124
- package/build-module/components/global-styles/shadows-panel.js.map +7 -1
- package/build-module/components/global-styles/size-control/index.js +57 -70
- package/build-module/components/global-styles/size-control/index.js.map +7 -1
- package/build-module/components/global-styles/style-variations-container.js +85 -95
- package/build-module/components/global-styles/style-variations-container.js.map +7 -1
- package/build-module/components/global-styles/subtitle.js +16 -16
- package/build-module/components/global-styles/subtitle.js.map +7 -1
- package/build-module/components/global-styles/typeset.js +50 -65
- package/build-module/components/global-styles/typeset.js.map +7 -1
- package/build-module/components/global-styles/typography-elements.js +86 -80
- package/build-module/components/global-styles/typography-elements.js.map +7 -1
- package/build-module/components/global-styles/typography-example.js +45 -57
- package/build-module/components/global-styles/typography-example.js.map +7 -1
- package/build-module/components/global-styles/typography-panel.js +38 -33
- package/build-module/components/global-styles/typography-panel.js.map +7 -1
- package/build-module/components/global-styles/typography-preview.js +55 -48
- package/build-module/components/global-styles/typography-preview.js.map +7 -1
- package/build-module/components/global-styles/ui.js +252 -295
- package/build-module/components/global-styles/ui.js.map +7 -1
- package/build-module/components/global-styles/utils.js +24 -28
- package/build-module/components/global-styles/utils.js.map +7 -1
- package/build-module/components/global-styles/variations/variation.js +59 -65
- package/build-module/components/global-styles/variations/variation.js.map +7 -1
- package/build-module/components/global-styles/variations/variations-color.js +26 -34
- package/build-module/components/global-styles/variations/variations-color.js.map +7 -1
- package/build-module/components/global-styles/variations/variations-panel.js +39 -46
- package/build-module/components/global-styles/variations/variations-panel.js.map +7 -1
- package/build-module/components/global-styles/variations/variations-typography.js +43 -42
- package/build-module/components/global-styles/variations/variations-typography.js.map +7 -1
- package/build-module/components/global-styles-renderer/index.js +16 -27
- package/build-module/components/global-styles-renderer/index.js.map +7 -1
- package/build-module/components/global-styles-sidebar/default-sidebar.js +36 -36
- package/build-module/components/global-styles-sidebar/default-sidebar.js.map +7 -1
- package/build-module/components/global-styles-sidebar/index.js +137 -133
- package/build-module/components/global-styles-sidebar/index.js.map +7 -1
- package/build-module/components/layout/animation.js +31 -69
- package/build-module/components/layout/animation.js.map +7 -1
- package/build-module/components/layout/hooks.js +16 -28
- package/build-module/components/layout/hooks.js.map +7 -1
- package/build-module/components/layout/index.js +199 -183
- package/build-module/components/layout/index.js.map +7 -1
- package/build-module/components/media/index.js +13 -21
- package/build-module/components/media/index.js.map +7 -1
- package/build-module/components/more-menu/index.js +18 -23
- package/build-module/components/more-menu/index.js.map +7 -1
- package/build-module/components/more-menu/site-export.js +41 -38
- package/build-module/components/more-menu/site-export.js.map +7 -1
- package/build-module/components/more-menu/welcome-guide-menu-item.js +12 -17
- package/build-module/components/more-menu/welcome-guide-menu-item.js.map +7 -1
- package/build-module/components/page-patterns/actions.js +52 -0
- package/build-module/components/page-patterns/actions.js.map +7 -0
- package/build-module/components/page-patterns/delete-category-menu-item.js +78 -76
- package/build-module/components/page-patterns/delete-category-menu-item.js.map +7 -1
- package/build-module/components/page-patterns/fields.js +103 -112
- package/build-module/components/page-patterns/fields.js.map +7 -1
- package/build-module/components/page-patterns/index.js +144 -120
- package/build-module/components/page-patterns/index.js.map +7 -1
- package/build-module/components/page-patterns/rename-category-menu-item.js +37 -53
- package/build-module/components/page-patterns/rename-category-menu-item.js.map +7 -1
- package/build-module/components/page-patterns/search-items.js +43 -77
- package/build-module/components/page-patterns/search-items.js.map +7 -1
- package/build-module/components/page-patterns/use-pattern-settings.js +27 -30
- package/build-module/components/page-patterns/use-pattern-settings.js.map +7 -1
- package/build-module/components/page-patterns/use-patterns.js +249 -192
- package/build-module/components/page-patterns/use-patterns.js.map +7 -1
- package/build-module/components/page-patterns/utils.js +5 -2
- package/build-module/components/page-patterns/utils.js.map +7 -1
- package/build-module/components/page-templates/fields.js +132 -147
- package/build-module/components/page-templates/fields.js.map +7 -1
- package/build-module/components/page-templates/hooks.js +44 -55
- package/build-module/components/page-templates/hooks.js.map +7 -1
- package/build-module/components/page-templates/index.js +189 -194
- package/build-module/components/page-templates/index.js.map +7 -1
- package/build-module/components/page-templates/view-utils.js +42 -0
- package/build-module/components/page-templates/view-utils.js.map +7 -0
- package/build-module/components/pagination/index.js +96 -77
- package/build-module/components/pagination/index.js.map +7 -1
- package/build-module/components/plugin-template-setting-panel/index.js +21 -50
- package/build-module/components/plugin-template-setting-panel/index.js.map +7 -1
- package/build-module/components/post-edit/index.js +136 -135
- package/build-module/components/post-edit/index.js.map +7 -1
- package/build-module/components/post-list/index.js +205 -291
- package/build-module/components/post-list/index.js.map +7 -1
- package/build-module/components/post-list/view-utils.js +149 -0
- package/build-module/components/post-list/view-utils.js.map +7 -0
- package/build-module/components/posts-app/index.js +15 -25
- package/build-module/components/posts-app/index.js.map +7 -1
- package/build-module/components/posts-app-routes/index.js +12 -18
- package/build-module/components/posts-app-routes/index.js.map +7 -1
- package/build-module/components/posts-app-routes/post-item.js +22 -29
- package/build-module/components/posts-app-routes/post-item.js.map +7 -1
- package/build-module/components/posts-app-routes/posts.js +59 -70
- package/build-module/components/posts-app-routes/posts.js.map +7 -1
- package/build-module/components/resizable-frame/index.js +169 -211
- package/build-module/components/resizable-frame/index.js.map +7 -1
- package/build-module/components/revisions/index.js +78 -64
- package/build-module/components/revisions/index.js.map +7 -1
- package/build-module/components/routes/use-title.js +25 -28
- package/build-module/components/routes/use-title.js.map +7 -1
- package/build-module/components/save-button/index.js +99 -104
- package/build-module/components/save-button/index.js.map +7 -1
- package/build-module/components/save-hub/index.js +23 -33
- package/build-module/components/save-hub/index.js.map +7 -1
- package/build-module/components/save-keyboard-shortcut/index.js +31 -47
- package/build-module/components/save-keyboard-shortcut/index.js.map +7 -1
- package/build-module/components/save-panel/index.js +125 -124
- package/build-module/components/save-panel/index.js.map +7 -1
- package/build-module/components/sidebar/index.js +47 -65
- package/build-module/components/sidebar/index.js.map +7 -1
- package/build-module/components/sidebar-button/index.js +16 -17
- package/build-module/components/sidebar-button/index.js.map +7 -1
- package/build-module/components/sidebar-dataviews/dataview-item.js +41 -50
- package/build-module/components/sidebar-dataviews/dataview-item.js.map +7 -1
- package/build-module/components/sidebar-dataviews/index.js +40 -48
- package/build-module/components/sidebar-dataviews/index.js.map +7 -1
- package/build-module/components/sidebar-global-styles-wrapper/index.js +100 -104
- package/build-module/components/sidebar-global-styles-wrapper/index.js.map +7 -1
- package/build-module/components/sidebar-navigation-item/index.js +56 -57
- package/build-module/components/sidebar-navigation-item/index.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen/index.js +108 -98
- package/build-module/components/sidebar-navigation-screen/index.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-details-footer/index.js +36 -48
- package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/content.js +23 -28
- package/build-module/components/sidebar-navigation-screen-global-styles/content.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +61 -73
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +108 -82
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +22 -24
- package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +92 -84
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +87 -76
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +28 -41
- package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +67 -60
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +37 -32
- package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +107 -91
- package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +14 -14
- package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js +8 -12
- package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +89 -98
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +113 -117
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +82 -82
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-patterns/category-item.js +17 -16
- package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.js +108 -99
- package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js +19 -21
- package/build-module/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +53 -59
- package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +27 -27
- package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +24 -24
- package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +67 -70
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +20 -21
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +7 -1
- package/build-module/components/sidebar-navigation-screen-unsupported/index.js +11 -16
- package/build-module/components/sidebar-navigation-screen-unsupported/index.js.map +7 -1
- package/build-module/components/site-editor-routes/home.js +18 -26
- package/build-module/components/site-editor-routes/home.js.map +7 -1
- package/build-module/components/site-editor-routes/index.js +39 -30
- package/build-module/components/site-editor-routes/index.js.map +7 -1
- package/build-module/components/site-editor-routes/navigation-item.js +23 -43
- package/build-module/components/site-editor-routes/navigation-item.js.map +7 -1
- package/build-module/components/site-editor-routes/navigation.js +23 -43
- package/build-module/components/site-editor-routes/navigation.js.map +7 -1
- package/build-module/components/site-editor-routes/notfound.js +22 -28
- package/build-module/components/site-editor-routes/notfound.js.map +7 -1
- package/build-module/components/site-editor-routes/page-item.js +26 -35
- package/build-module/components/site-editor-routes/page-item.js.map +7 -1
- package/build-module/components/site-editor-routes/pages.js +64 -80
- package/build-module/components/site-editor-routes/pages.js.map +7 -1
- package/build-module/components/site-editor-routes/pattern-item.js +16 -20
- package/build-module/components/site-editor-routes/pattern-item.js.map +7 -1
- package/build-module/components/site-editor-routes/patterns.js +19 -30
- package/build-module/components/site-editor-routes/patterns.js.map +7 -1
- package/build-module/components/site-editor-routes/stylebook.js +28 -37
- package/build-module/components/site-editor-routes/stylebook.js.map +7 -1
- package/build-module/components/site-editor-routes/styles.js +26 -40
- package/build-module/components/site-editor-routes/styles.js.map +7 -1
- package/build-module/components/site-editor-routes/template-item.js +21 -28
- package/build-module/components/site-editor-routes/template-item.js.map +7 -1
- package/build-module/components/site-editor-routes/template-part-item.js +13 -15
- package/build-module/components/site-editor-routes/template-part-item.js.map +7 -1
- package/build-module/components/site-editor-routes/templates.js +37 -38
- package/build-module/components/site-editor-routes/templates.js.map +7 -1
- package/build-module/components/site-editor-routes/utils.js +6 -10
- package/build-module/components/site-editor-routes/utils.js.map +7 -1
- package/build-module/components/site-hub/index.js +204 -215
- package/build-module/components/site-hub/index.js.map +7 -1
- package/build-module/components/site-icon/index.js +33 -43
- package/build-module/components/site-icon/index.js.map +7 -1
- package/build-module/components/style-book/categories.js +41 -48
- package/build-module/components/style-book/categories.js.map +7 -1
- package/build-module/components/style-book/color-examples.js +29 -37
- package/build-module/components/style-book/color-examples.js.map +7 -1
- package/build-module/components/style-book/constants.js +191 -140
- package/build-module/components/style-book/constants.js.map +7 -1
- package/build-module/components/style-book/duotone-examples.js +36 -35
- package/build-module/components/style-book/duotone-examples.js.map +7 -1
- package/build-module/components/style-book/examples.js +114 -116
- package/build-module/components/style-book/examples.js.map +7 -1
- package/build-module/components/style-book/index.js +431 -384
- package/build-module/components/style-book/index.js.map +7 -1
- package/build-module/components/style-book/types.js +1 -2
- package/build-module/components/style-book/types.js.map +7 -1
- package/build-module/components/welcome-guide/editor.js +59 -54
- package/build-module/components/welcome-guide/editor.js.map +7 -1
- package/build-module/components/welcome-guide/image.js +16 -18
- package/build-module/components/welcome-guide/image.js.map +7 -1
- package/build-module/components/welcome-guide/index.js +16 -15
- package/build-module/components/welcome-guide/index.js.map +7 -1
- package/build-module/components/welcome-guide/page.js +59 -48
- package/build-module/components/welcome-guide/page.js.map +7 -1
- package/build-module/components/welcome-guide/styles.js +108 -97
- package/build-module/components/welcome-guide/styles.js.map +7 -1
- package/build-module/components/welcome-guide/template.js +54 -55
- package/build-module/components/welcome-guide/template.js.map +7 -1
- package/build-module/deprecated.js +28 -40
- package/build-module/deprecated.js.map +7 -1
- package/build-module/hooks/commands/use-common-commands.js +89 -108
- package/build-module/hooks/commands/use-common-commands.js.map +7 -1
- package/build-module/hooks/commands/use-set-command-context.js +21 -44
- package/build-module/hooks/commands/use-set-command-context.js.map +7 -1
- package/build-module/hooks/index.js +2 -5
- package/build-module/hooks/index.js.map +7 -1
- package/build-module/hooks/push-changes-to-global-styles/index.js +218 -243
- package/build-module/hooks/push-changes-to-global-styles/index.js.map +7 -1
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +56 -105
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +7 -1
- package/build-module/index.js +55 -69
- package/build-module/index.js.map +7 -1
- package/build-module/lock-unlock.js +8 -7
- package/build-module/lock-unlock.js.map +7 -1
- package/build-module/posts.js +38 -54
- package/build-module/posts.js.map +7 -1
- package/build-module/store/actions.js +140 -320
- package/build-module/store/actions.js.map +7 -1
- package/build-module/store/constants.js +5 -7
- package/build-module/store/constants.js.map +7 -1
- package/build-module/store/index.js +15 -18
- package/build-module/store/index.js.map +7 -1
- package/build-module/store/private-actions.js +12 -14
- package/build-module/store/private-actions.js.map +7 -1
- package/build-module/store/private-selectors.js +7 -10
- package/build-module/store/private-selectors.js.map +7 -1
- package/build-module/store/reducer.js +21 -53
- package/build-module/store/reducer.js.map +7 -1
- package/build-module/store/selectors.js +151 -278
- package/build-module/store/selectors.js.map +7 -1
- package/build-module/utils/constants.js +53 -44
- package/build-module/utils/constants.js.map +7 -1
- package/build-module/utils/get-filtered-template-parts.js +18 -37
- package/build-module/utils/get-filtered-template-parts.js.map +7 -1
- package/build-module/utils/is-previewing-theme.js +10 -9
- package/build-module/utils/is-previewing-theme.js.map +7 -1
- package/build-module/utils/is-template-removable.js +6 -13
- package/build-module/utils/is-template-removable.js.map +7 -1
- package/build-module/utils/is-template-revertable.js +6 -15
- package/build-module/utils/is-template-revertable.js.map +7 -1
- package/build-module/utils/set-nested-value.js +7 -22
- package/build-module/utils/set-nested-value.js.map +7 -1
- package/build-module/utils/template-part-create.js +1 -2
- package/build-module/utils/template-part-create.js.map +7 -1
- package/build-module/utils/use-activate-theme.js +21 -40
- package/build-module/utils/use-activate-theme.js.map +7 -1
- package/build-module/utils/use-actual-current-theme.js +13 -17
- package/build-module/utils/use-actual-current-theme.js.map +7 -1
- package/build-style/posts-rtl.css +484 -214
- package/build-style/posts.css +484 -214
- package/build-style/style-rtl.css +629 -271
- package/build-style/style.css +629 -271
- package/package.json +52 -42
- package/src/components/add-new-post/index.js +2 -1
- package/src/components/add-new-template/index.js +7 -4
- package/src/components/add-new-template/style.scss +4 -0
- package/src/components/dataviews-actions/index.js +16 -9
- package/src/components/editor/index.js +1 -1
- package/src/components/editor/style.scss +3 -0
- package/src/components/editor/use-resolve-edited-entity.js +4 -18
- package/src/components/editor-canvas-container/style.scss +4 -1
- package/src/components/global-styles/font-library-modal/style.scss +4 -0
- package/src/components/global-styles/screen-revisions/style.scss +4 -0
- package/src/components/global-styles/style.scss +3 -0
- package/src/components/global-styles/variations/style.scss +3 -0
- package/src/components/global-styles-sidebar/style.scss +3 -0
- package/src/components/layout/index.js +2 -1
- package/src/components/layout/style.scss +5 -0
- package/src/components/page-patterns/actions.js +54 -0
- package/src/components/page-patterns/index.js +79 -32
- package/src/components/page-patterns/style.scss +4 -0
- package/src/components/page-templates/fields.js +22 -1
- package/src/components/page-templates/index.js +71 -104
- package/src/components/page-templates/style.scss +4 -0
- package/src/components/page-templates/view-utils.js +41 -0
- package/src/components/pagination/style.scss +2 -0
- package/src/components/post-edit/index.js +10 -4
- package/src/components/post-edit/style.scss +3 -6
- package/src/components/post-list/index.js +76 -188
- package/src/components/post-list/style.scss +3 -0
- package/src/components/post-list/view-utils.js +155 -0
- package/src/components/posts-app-routes/posts.js +29 -16
- package/src/components/resizable-frame/style.scss +3 -0
- package/src/components/save-hub/style.scss +3 -0
- package/src/components/save-panel/index.js +2 -2
- package/src/components/save-panel/style.scss +2 -0
- package/src/components/sidebar/style.scss +4 -0
- package/src/components/sidebar-button/style.scss +2 -0
- package/src/components/sidebar-dataviews/dataview-item.js +5 -11
- package/src/components/sidebar-dataviews/index.js +17 -17
- package/src/components/sidebar-dataviews/style.scss +2 -16
- package/src/components/sidebar-global-styles-wrapper/index.js +16 -21
- package/src/components/sidebar-global-styles-wrapper/style.scss +4 -30
- package/src/components/sidebar-navigation-item/style.scss +3 -0
- package/src/components/sidebar-navigation-screen/style.scss +5 -0
- package/src/components/sidebar-navigation-screen-main/style.scss +2 -0
- package/src/components/sidebar-navigation-screen-navigation-menu/style.scss +2 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +3 -0
- package/src/components/sidebar-navigation-screen-patterns/style.scss +3 -0
- package/src/components/sidebar-navigation-screen-templates-browse/style.scss +2 -0
- package/src/components/site-editor-routes/pages.js +29 -16
- package/src/components/site-editor-routes/templates.js +21 -4
- package/src/components/site-hub/style.scss +3 -0
- package/src/components/site-icon/style.scss +3 -0
- package/src/components/style-book/style.scss +3 -0
- package/src/components/welcome-guide/style.scss +2 -0
- package/src/posts.scss +14 -11
- package/src/style.scss +42 -39
- package/tsconfig.json +2 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/build/components/page/header.js +0 -45
- package/build/components/page/header.js.map +0 -1
- package/build/components/page/index.js +0 -50
- package/build/components/page/index.js.map +0 -1
- package/build/components/page-patterns/header.js +0 -96
- package/build/components/page-patterns/header.js.map +0 -1
- package/build/components/sidebar-dataviews/add-new-view.js +0 -137
- package/build/components/sidebar-dataviews/add-new-view.js.map +0 -1
- package/build/components/sidebar-dataviews/custom-dataviews-list.js +0 -211
- package/build/components/sidebar-dataviews/custom-dataviews-list.js.map +0 -1
- package/build/components/sidebar-dataviews/default-views.js +0 -141
- package/build/components/sidebar-dataviews/default-views.js.map +0 -1
- package/build-module/components/page/header.js +0 -40
- package/build-module/components/page/header.js.map +0 -1
- package/build-module/components/page/index.js +0 -42
- package/build-module/components/page/index.js.map +0 -1
- package/build-module/components/page-patterns/header.js +0 -88
- package/build-module/components/page-patterns/header.js.map +0 -1
- package/build-module/components/sidebar-dataviews/add-new-view.js +0 -129
- package/build-module/components/sidebar-dataviews/add-new-view.js.map +0 -1
- package/build-module/components/sidebar-dataviews/custom-dataviews-list.js +0 -202
- package/build-module/components/sidebar-dataviews/custom-dataviews-list.js.map +0 -1
- package/build-module/components/sidebar-dataviews/default-views.js +0 -133
- package/build-module/components/sidebar-dataviews/default-views.js.map +0 -1
- package/src/components/page/header.js +0 -44
- package/src/components/page/index.js +0 -43
- package/src/components/page/style.scss +0 -56
- package/src/components/page-patterns/header.js +0 -120
- package/src/components/sidebar-dataviews/add-new-view.js +0 -143
- package/src/components/sidebar-dataviews/custom-dataviews-list.js +0 -233
- package/src/components/sidebar-dataviews/default-views.js +0 -168
|
@@ -1,168 +1,128 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import { useEffect, useMemo } from "@wordpress/element";
|
|
2
|
+
import { useSelect, useDispatch } from "@wordpress/data";
|
|
3
|
+
import { store as coreDataStore } from "@wordpress/core-data";
|
|
4
|
+
import { privateApis as routerPrivateApis } from "@wordpress/router";
|
|
5
|
+
import { store as editSiteStore } from "../../store";
|
|
6
|
+
import { unlock } from "../../lock-unlock";
|
|
7
|
+
import {
|
|
8
|
+
TEMPLATE_POST_TYPE,
|
|
9
|
+
TEMPLATE_PART_POST_TYPE,
|
|
10
|
+
NAVIGATION_POST_TYPE,
|
|
11
|
+
PATTERN_TYPES
|
|
12
|
+
} from "../../utils/constants";
|
|
13
|
+
const { useLocation } = unlock(routerPrivateApis);
|
|
14
|
+
const postTypesWithoutParentTemplate = [
|
|
15
|
+
TEMPLATE_POST_TYPE,
|
|
16
|
+
TEMPLATE_PART_POST_TYPE,
|
|
17
|
+
NAVIGATION_POST_TYPE,
|
|
18
|
+
PATTERN_TYPES.user,
|
|
19
|
+
"wp_registered_template"
|
|
20
|
+
];
|
|
21
|
+
const authorizedPostTypes = ["page", "post"];
|
|
22
|
+
function getPostType(name) {
|
|
21
23
|
let postType;
|
|
22
|
-
if (name ===
|
|
24
|
+
if (name === "navigation-item") {
|
|
23
25
|
postType = NAVIGATION_POST_TYPE;
|
|
24
|
-
} else if (name ===
|
|
26
|
+
} else if (name === "pattern-item") {
|
|
25
27
|
postType = PATTERN_TYPES.user;
|
|
26
|
-
} else if (name ===
|
|
28
|
+
} else if (name === "template-part-item") {
|
|
27
29
|
postType = TEMPLATE_PART_POST_TYPE;
|
|
28
|
-
} else if (name ===
|
|
29
|
-
postType = /^\d+$/.test(postId) ? TEMPLATE_POST_TYPE : 'wp_registered_template';
|
|
30
|
-
} else if (name === 'template-item') {
|
|
30
|
+
} else if (name === "templates") {
|
|
31
31
|
postType = TEMPLATE_POST_TYPE;
|
|
32
|
-
} else if (name ===
|
|
33
|
-
postType =
|
|
34
|
-
} else if (name ===
|
|
35
|
-
postType =
|
|
36
|
-
} else if (name ===
|
|
37
|
-
postType =
|
|
32
|
+
} else if (name === "template-item") {
|
|
33
|
+
postType = TEMPLATE_POST_TYPE;
|
|
34
|
+
} else if (name === "static-template-item") {
|
|
35
|
+
postType = "wp_registered_template";
|
|
36
|
+
} else if (name === "page-item" || name === "pages") {
|
|
37
|
+
postType = "page";
|
|
38
|
+
} else if (name === "post-item" || name === "posts") {
|
|
39
|
+
postType = "post";
|
|
38
40
|
}
|
|
39
41
|
return postType;
|
|
40
42
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
} = useLocation();
|
|
48
|
-
const {
|
|
49
|
-
postId: _postId = query?.postId
|
|
50
|
-
} = params; // Fallback to query param for postId for list view routes.
|
|
51
|
-
const _postType = (_getPostType = getPostType(name, _postId)) !== null && _getPostType !== void 0 ? _getPostType : query?.postType;
|
|
52
|
-
const homePage = useSelect(select => {
|
|
53
|
-
const {
|
|
54
|
-
getHomePage
|
|
55
|
-
} = unlock(select(coreDataStore));
|
|
43
|
+
function useResolveEditedEntity() {
|
|
44
|
+
const { name, params = {}, query } = useLocation();
|
|
45
|
+
const { postId: _postId = query?.postId } = params;
|
|
46
|
+
const _postType = getPostType(name, _postId) ?? query?.postType;
|
|
47
|
+
const homePage = useSelect((select) => {
|
|
48
|
+
const { getHomePage } = unlock(select(coreDataStore));
|
|
56
49
|
return getHomePage();
|
|
57
50
|
}, []);
|
|
58
|
-
const [postType, postId] = useSelect(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
if (homePage?.postType === 'page') {
|
|
94
|
-
return getTemplateId('page', homePage?.postId);
|
|
95
|
-
}
|
|
96
|
-
if (homePage?.postType === 'wp_template') {
|
|
97
|
-
return homePage?.postId;
|
|
98
|
-
}
|
|
99
|
-
}, [homePage, postId, postType]);
|
|
100
|
-
const editableResolvedTemplateId = useSelect(select => {
|
|
101
|
-
if (typeof resolvedTemplateId !== 'string') {
|
|
102
|
-
return resolvedTemplateId;
|
|
103
|
-
}
|
|
104
|
-
return unlock(select(coreDataStore)).getTemplateAutoDraftId(resolvedTemplateId);
|
|
105
|
-
}, [resolvedTemplateId]);
|
|
51
|
+
const [postType, postId] = useSelect(
|
|
52
|
+
(select) => {
|
|
53
|
+
if (_postType !== "wp_registered_template") {
|
|
54
|
+
return [_postType, _postId];
|
|
55
|
+
}
|
|
56
|
+
return [
|
|
57
|
+
TEMPLATE_POST_TYPE,
|
|
58
|
+
unlock(select(coreDataStore)).getTemplateAutoDraftId(
|
|
59
|
+
_postId
|
|
60
|
+
)
|
|
61
|
+
];
|
|
62
|
+
},
|
|
63
|
+
[_postType, _postId]
|
|
64
|
+
);
|
|
65
|
+
const resolvedTemplateId = useSelect(
|
|
66
|
+
(select) => {
|
|
67
|
+
if (postTypesWithoutParentTemplate.includes(postType) && postId) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
if (postId && postId.includes(",")) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const { getTemplateId } = unlock(select(coreDataStore));
|
|
74
|
+
if (postType && postId && authorizedPostTypes.includes(postType)) {
|
|
75
|
+
return getTemplateId(postType, postId);
|
|
76
|
+
}
|
|
77
|
+
if (homePage?.postType === "page") {
|
|
78
|
+
return getTemplateId("page", homePage?.postId);
|
|
79
|
+
}
|
|
80
|
+
if (homePage?.postType === "wp_template") {
|
|
81
|
+
return homePage?.postId;
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
[homePage, postId, postType]
|
|
85
|
+
);
|
|
106
86
|
const context = useMemo(() => {
|
|
107
87
|
if (postTypesWithoutParentTemplate.includes(postType) && postId) {
|
|
108
88
|
return {};
|
|
109
89
|
}
|
|
110
90
|
if (postType && postId && authorizedPostTypes.includes(postType)) {
|
|
111
|
-
return {
|
|
112
|
-
postType,
|
|
113
|
-
postId
|
|
114
|
-
};
|
|
91
|
+
return { postType, postId };
|
|
115
92
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
if (homePage?.postType === 'page') {
|
|
119
|
-
return {
|
|
120
|
-
postType: 'page',
|
|
121
|
-
postId: homePage?.postId
|
|
122
|
-
};
|
|
93
|
+
if (homePage?.postType === "page") {
|
|
94
|
+
return { postType: "page", postId: homePage?.postId };
|
|
123
95
|
}
|
|
124
96
|
return {};
|
|
125
97
|
}, [homePage, postType, postId]);
|
|
126
98
|
if (postTypesWithoutParentTemplate.includes(postType) && postId) {
|
|
127
|
-
return {
|
|
128
|
-
isReady: true,
|
|
129
|
-
postType,
|
|
130
|
-
postId,
|
|
131
|
-
context
|
|
132
|
-
};
|
|
99
|
+
return { isReady: true, postType, postId, context };
|
|
133
100
|
}
|
|
134
101
|
if (!!homePage) {
|
|
135
102
|
return {
|
|
136
|
-
isReady:
|
|
103
|
+
isReady: resolvedTemplateId !== void 0,
|
|
137
104
|
postType: TEMPLATE_POST_TYPE,
|
|
138
|
-
postId:
|
|
105
|
+
postId: resolvedTemplateId,
|
|
139
106
|
context
|
|
140
107
|
};
|
|
141
108
|
}
|
|
142
|
-
return {
|
|
143
|
-
isReady: false
|
|
144
|
-
};
|
|
109
|
+
return { isReady: false };
|
|
145
110
|
}
|
|
146
|
-
|
|
111
|
+
function useSyncDeprecatedEntityIntoState({
|
|
147
112
|
postType,
|
|
148
113
|
postId,
|
|
149
114
|
context,
|
|
150
115
|
isReady
|
|
151
116
|
}) {
|
|
152
|
-
const {
|
|
153
|
-
setEditedEntity
|
|
154
|
-
} = useDispatch(editSiteStore);
|
|
117
|
+
const { setEditedEntity } = useDispatch(editSiteStore);
|
|
155
118
|
useEffect(() => {
|
|
156
119
|
if (isReady) {
|
|
157
|
-
// setEditedEntity expects a string (because the postId used to be
|
|
158
|
-
// the template slug, even for edited templates). Now the postId can
|
|
159
|
-
// be a number (either because it's an auto-draft or edited
|
|
160
|
-
// template). Passing a number could break plugins doing things like
|
|
161
|
-
// `id.includes`. It would be way more complex to keep passing the
|
|
162
|
-
// template slug, while also being incorrect, so the easiest
|
|
163
|
-
// solution is to cast the postId to a string.
|
|
164
120
|
setEditedEntity(postType, String(postId), context);
|
|
165
121
|
}
|
|
166
122
|
}, [isReady, postType, postId, context, setEditedEntity]);
|
|
167
123
|
}
|
|
168
|
-
|
|
124
|
+
export {
|
|
125
|
+
useResolveEditedEntity,
|
|
126
|
+
useSyncDeprecatedEntityIntoState
|
|
127
|
+
};
|
|
128
|
+
//# sourceMappingURL=use-resolve-edited-entity.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{"version":3,"names":["useEffect","useMemo","useSelect","useDispatch","store","coreDataStore","privateApis","routerPrivateApis","editSiteStore","unlock","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","NAVIGATION_POST_TYPE","PATTERN_TYPES","useLocation","postTypesWithoutParentTemplate","user","authorizedPostTypes","getPostType","name","postId","postType","test","useResolveEditedEntity","_getPostType","params","query","_postId","_postType","homePage","select","getHomePage","getTemplateAutoDraftId","resolvedTemplateId","includes","getTemplateId","editableResolvedTemplateId","context","isReady","undefined","useSyncDeprecatedEntityIntoState","setEditedEntity","String"],"sources":["@wordpress/edit-site/src/components/editor/use-resolve-edited-entity.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useMemo } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n\tPATTERN_TYPES,\n} from '../../utils/constants';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nconst postTypesWithoutParentTemplate = [\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n\tPATTERN_TYPES.user,\n\t'wp_registered_template',\n];\n\nconst authorizedPostTypes = [ 'page', 'post' ];\n\nfunction getPostType( name, postId ) {\n\tlet postType;\n\tif ( name === 'navigation-item' ) {\n\t\tpostType = NAVIGATION_POST_TYPE;\n\t} else if ( name === 'pattern-item' ) {\n\t\tpostType = PATTERN_TYPES.user;\n\t} else if ( name === 'template-part-item' ) {\n\t\tpostType = TEMPLATE_PART_POST_TYPE;\n\t} else if ( name === 'templates' ) {\n\t\tpostType = /^\\d+$/.test( postId )\n\t\t\t? TEMPLATE_POST_TYPE\n\t\t\t: 'wp_registered_template';\n\t} else if ( name === 'template-item' ) {\n\t\tpostType = TEMPLATE_POST_TYPE;\n\t} else if ( name === 'static-template-item' ) {\n\t\tpostType = 'wp_registered_template';\n\t} else if ( name === 'page-item' || name === 'pages' ) {\n\t\tpostType = 'page';\n\t} else if ( name === 'post-item' || name === 'posts' ) {\n\t\tpostType = 'post';\n\t}\n\n\treturn postType;\n}\n\nexport function useResolveEditedEntity() {\n\tconst { name, params = {}, query } = useLocation();\n\tconst { postId: _postId = query?.postId } = params; // Fallback to query param for postId for list view routes.\n\tconst _postType = getPostType( name, _postId ) ?? query?.postType;\n\n\tconst homePage = useSelect( ( select ) => {\n\t\tconst { getHomePage } = unlock( select( coreDataStore ) );\n\t\treturn getHomePage();\n\t}, [] );\n\n\tconst [ postType, postId ] = useSelect(\n\t\t( select ) => {\n\t\t\tif ( _postType !== 'wp_registered_template' ) {\n\t\t\t\treturn [ _postType, _postId ];\n\t\t\t}\n\t\t\treturn [\n\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\tunlock( select( coreDataStore ) ).getTemplateAutoDraftId(\n\t\t\t\t\t_postId\n\t\t\t\t),\n\t\t\t];\n\t\t},\n\t\t[ _postType, _postId ]\n\t);\n\n\t/**\n\t * This is a hook that recreates the logic to resolve a template for a given WordPress postID postTypeId\n\t * in order to match the frontend as closely as possible in the site editor.\n\t *\n\t * It is not possible to rely on the server logic because there maybe unsaved changes that impact the template resolution.\n\t */\n\tconst resolvedTemplateId = useSelect(\n\t\t( select ) => {\n\t\t\t// If we're rendering a post type that doesn't have a template\n\t\t\t// no need to resolve its template.\n\t\t\tif (\n\t\t\t\tpostTypesWithoutParentTemplate.includes( postType ) &&\n\t\t\t\tpostId\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Don't trigger resolution for multi-selected posts.\n\t\t\tif ( postId && postId.includes( ',' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst { getTemplateId } = unlock( select( coreDataStore ) );\n\n\t\t\t// If we're rendering a specific page, we need to resolve its template.\n\t\t\t// The site editor only supports pages for now, not other CPTs.\n\t\t\tif (\n\t\t\t\tpostType &&\n\t\t\t\tpostId &&\n\t\t\t\tauthorizedPostTypes.includes( postType )\n\t\t\t) {\n\t\t\t\treturn getTemplateId( postType, postId );\n\t\t\t}\n\n\t\t\t// If we're rendering the home page, and we have a static home page, resolve its template.\n\t\t\tif ( homePage?.postType === 'page' ) {\n\t\t\t\treturn getTemplateId( 'page', homePage?.postId );\n\t\t\t}\n\n\t\t\tif ( homePage?.postType === 'wp_template' ) {\n\t\t\t\treturn homePage?.postId;\n\t\t\t}\n\t\t},\n\t\t[ homePage, postId, postType ]\n\t);\n\n\tconst editableResolvedTemplateId = useSelect(\n\t\t( select ) => {\n\t\t\tif ( typeof resolvedTemplateId !== 'string' ) {\n\t\t\t\treturn resolvedTemplateId;\n\t\t\t}\n\t\t\treturn unlock( select( coreDataStore ) ).getTemplateAutoDraftId(\n\t\t\t\tresolvedTemplateId\n\t\t\t);\n\t\t},\n\t\t[ resolvedTemplateId ]\n\t);\n\n\tconst context = useMemo( () => {\n\t\tif ( postTypesWithoutParentTemplate.includes( postType ) && postId ) {\n\t\t\treturn {};\n\t\t}\n\n\t\tif ( postType && postId && authorizedPostTypes.includes( postType ) ) {\n\t\t\treturn { postType, postId };\n\t\t}\n\t\t// TODO: for post types lists we should probably not render the front page, but maybe a placeholder\n\t\t// with a message like \"Select a page\" or something similar.\n\t\tif ( homePage?.postType === 'page' ) {\n\t\t\treturn { postType: 'page', postId: homePage?.postId };\n\t\t}\n\n\t\treturn {};\n\t}, [ homePage, postType, postId ] );\n\n\tif ( postTypesWithoutParentTemplate.includes( postType ) && postId ) {\n\t\treturn { isReady: true, postType, postId, context };\n\t}\n\n\tif ( !! homePage ) {\n\t\treturn {\n\t\t\tisReady: editableResolvedTemplateId !== undefined,\n\t\t\tpostType: TEMPLATE_POST_TYPE,\n\t\t\tpostId: editableResolvedTemplateId,\n\t\t\tcontext,\n\t\t};\n\t}\n\n\treturn { isReady: false };\n}\n\nexport function useSyncDeprecatedEntityIntoState( {\n\tpostType,\n\tpostId,\n\tcontext,\n\tisReady,\n} ) {\n\tconst { setEditedEntity } = useDispatch( editSiteStore );\n\n\tuseEffect( () => {\n\t\tif ( isReady ) {\n\t\t\t// setEditedEntity expects a string (because the postId used to be\n\t\t\t// the template slug, even for edited templates). Now the postId can\n\t\t\t// be a number (either because it's an auto-draft or edited\n\t\t\t// template). Passing a number could break plugins doing things like\n\t\t\t// `id.includes`. It would be way more complex to keep passing the\n\t\t\t// template slug, while also being incorrect, so the easiest\n\t\t\t// solution is to cast the postId to a string.\n\t\t\tsetEditedEntity( postType, String( postId ), context );\n\t\t}\n\t}, [ isReady, postType, postId, context, setEditedEntity ] );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,OAAO,QAAQ,oBAAoB;AACvD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,aAAa,QAAQ,sBAAsB;AAC7D,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,SAASH,KAAK,IAAII,aAAa,QAAQ,aAAa;AACpD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SACCC,kBAAkB,EAClBC,uBAAuB,EACvBC,oBAAoB,EACpBC,aAAa,QACP,uBAAuB;AAE9B,MAAM;EAAEC;AAAY,CAAC,GAAGL,MAAM,CAAEF,iBAAkB,CAAC;AAEnD,MAAMQ,8BAA8B,GAAG,CACtCL,kBAAkB,EAClBC,uBAAuB,EACvBC,oBAAoB,EACpBC,aAAa,CAACG,IAAI,EAClB,wBAAwB,CACxB;AAED,MAAMC,mBAAmB,GAAG,CAAE,MAAM,EAAE,MAAM,CAAE;AAE9C,SAASC,WAAWA,CAAEC,IAAI,EAAEC,MAAM,EAAG;EACpC,IAAIC,QAAQ;EACZ,IAAKF,IAAI,KAAK,iBAAiB,EAAG;IACjCE,QAAQ,GAAGT,oBAAoB;EAChC,CAAC,MAAM,IAAKO,IAAI,KAAK,cAAc,EAAG;IACrCE,QAAQ,GAAGR,aAAa,CAACG,IAAI;EAC9B,CAAC,MAAM,IAAKG,IAAI,KAAK,oBAAoB,EAAG;IAC3CE,QAAQ,GAAGV,uBAAuB;EACnC,CAAC,MAAM,IAAKQ,IAAI,KAAK,WAAW,EAAG;IAClCE,QAAQ,GAAG,OAAO,CAACC,IAAI,CAAEF,MAAO,CAAC,GAC9BV,kBAAkB,GAClB,wBAAwB;EAC5B,CAAC,MAAM,IAAKS,IAAI,KAAK,eAAe,EAAG;IACtCE,QAAQ,GA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AAC7D","ignoreList":[]}
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/editor/use-resolve-edited-entity.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useEffect, useMemo } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n\tPATTERN_TYPES,\n} from '../../utils/constants';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nconst postTypesWithoutParentTemplate = [\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n\tPATTERN_TYPES.user,\n\t'wp_registered_template',\n];\n\nconst authorizedPostTypes = [ 'page', 'post' ];\n\nfunction getPostType( name ) {\n\tlet postType;\n\tif ( name === 'navigation-item' ) {\n\t\tpostType = NAVIGATION_POST_TYPE;\n\t} else if ( name === 'pattern-item' ) {\n\t\tpostType = PATTERN_TYPES.user;\n\t} else if ( name === 'template-part-item' ) {\n\t\tpostType = TEMPLATE_PART_POST_TYPE;\n\t} else if ( name === 'templates' ) {\n\t\tpostType = TEMPLATE_POST_TYPE;\n\t} else if ( name === 'template-item' ) {\n\t\tpostType = TEMPLATE_POST_TYPE;\n\t} else if ( name === 'static-template-item' ) {\n\t\tpostType = 'wp_registered_template';\n\t} else if ( name === 'page-item' || name === 'pages' ) {\n\t\tpostType = 'page';\n\t} else if ( name === 'post-item' || name === 'posts' ) {\n\t\tpostType = 'post';\n\t}\n\n\treturn postType;\n}\n\nexport function useResolveEditedEntity() {\n\tconst { name, params = {}, query } = useLocation();\n\tconst { postId: _postId = query?.postId } = params; // Fallback to query param for postId for list view routes.\n\tconst _postType = getPostType( name, _postId ) ?? query?.postType;\n\n\tconst homePage = useSelect( ( select ) => {\n\t\tconst { getHomePage } = unlock( select( coreDataStore ) );\n\t\treturn getHomePage();\n\t}, [] );\n\n\tconst [ postType, postId ] = useSelect(\n\t\t( select ) => {\n\t\t\tif ( _postType !== 'wp_registered_template' ) {\n\t\t\t\treturn [ _postType, _postId ];\n\t\t\t}\n\t\t\treturn [\n\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\tunlock( select( coreDataStore ) ).getTemplateAutoDraftId(\n\t\t\t\t\t_postId\n\t\t\t\t),\n\t\t\t];\n\t\t},\n\t\t[ _postType, _postId ]\n\t);\n\n\t/**\n\t * This is a hook that recreates the logic to resolve a template for a given WordPress postID postTypeId\n\t * in order to match the frontend as closely as possible in the site editor.\n\t *\n\t * It is not possible to rely on the server logic because there maybe unsaved changes that impact the template resolution.\n\t */\n\tconst resolvedTemplateId = useSelect(\n\t\t( select ) => {\n\t\t\t// If we're rendering a post type that doesn't have a template\n\t\t\t// no need to resolve its template.\n\t\t\tif (\n\t\t\t\tpostTypesWithoutParentTemplate.includes( postType ) &&\n\t\t\t\tpostId\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Don't trigger resolution for multi-selected posts.\n\t\t\tif ( postId && postId.includes( ',' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst { getTemplateId } = unlock( select( coreDataStore ) );\n\n\t\t\t// If we're rendering a specific page, we need to resolve its template.\n\t\t\t// The site editor only supports pages for now, not other CPTs.\n\t\t\tif (\n\t\t\t\tpostType &&\n\t\t\t\tpostId &&\n\t\t\t\tauthorizedPostTypes.includes( postType )\n\t\t\t) {\n\t\t\t\treturn getTemplateId( postType, postId );\n\t\t\t}\n\n\t\t\t// If we're rendering the home page, and we have a static home page, resolve its template.\n\t\t\tif ( homePage?.postType === 'page' ) {\n\t\t\t\treturn getTemplateId( 'page', homePage?.postId );\n\t\t\t}\n\n\t\t\tif ( homePage?.postType === 'wp_template' ) {\n\t\t\t\treturn homePage?.postId;\n\t\t\t}\n\t\t},\n\t\t[ homePage, postId, postType ]\n\t);\n\n\tconst context = useMemo( () => {\n\t\tif ( postTypesWithoutParentTemplate.includes( postType ) && postId ) {\n\t\t\treturn {};\n\t\t}\n\n\t\tif ( postType && postId && authorizedPostTypes.includes( postType ) ) {\n\t\t\treturn { postType, postId };\n\t\t}\n\t\t// TODO: for post types lists we should probably not render the front page, but maybe a placeholder\n\t\t// with a message like \"Select a page\" or something similar.\n\t\tif ( homePage?.postType === 'page' ) {\n\t\t\treturn { postType: 'page', postId: homePage?.postId };\n\t\t}\n\n\t\treturn {};\n\t}, [ homePage, postType, postId ] );\n\n\tif ( postTypesWithoutParentTemplate.includes( postType ) && postId ) {\n\t\treturn { isReady: true, postType, postId, context };\n\t}\n\n\tif ( !! homePage ) {\n\t\treturn {\n\t\t\tisReady: resolvedTemplateId !== undefined,\n\t\t\tpostType: TEMPLATE_POST_TYPE,\n\t\t\tpostId: resolvedTemplateId,\n\t\t\tcontext,\n\t\t};\n\t}\n\n\treturn { isReady: false };\n}\n\nexport function useSyncDeprecatedEntityIntoState( {\n\tpostType,\n\tpostId,\n\tcontext,\n\tisReady,\n} ) {\n\tconst { setEditedEntity } = useDispatch( editSiteStore );\n\n\tuseEffect( () => {\n\t\tif ( isReady ) {\n\t\t\t// setEditedEntity expects a string (because the postId used to be\n\t\t\t// the template slug, even for edited templates). Now the postId can\n\t\t\t// be a number (either because it's an auto-draft or edited\n\t\t\t// template). Passing a number could break plugins doing things like\n\t\t\t// `id.includes`. It would be way more complex to keep passing the\n\t\t\t// template slug, while also being incorrect, so the easiest\n\t\t\t// solution is to cast the postId to a string.\n\t\t\tsetEditedEntity( postType, String( postId ), context );\n\t\t}\n\t}, [ isReady, postType, postId, context, setEditedEntity ] );\n}\n"],
|
|
5
|
+
"mappings": "AAGA,SAAS,WAAW,eAAe;AACnC,SAAS,WAAW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Q;AAAA,MACR;AAAA,IACD;AAAA,EACD;AAEA,SAAO,EAAE,SAAS,MAAM;AACzB;AAEO,SAAS,iCAAkC;AAAA,EACjD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,QAAM,EAAE,gBAAgB,IAAI,YAAa,aAAc;AAEvD,YAAW,MAAM;AAChB,QAAK,SAAU;AAQd,sBAAiB,UAAU,OAAQ,MAAO,GAAG,OAAQ;AAAA,IACtD;AAAA,EACD,GAAG,CAAE,SAAS,UAAU,QAAQ,SAAS,eAAgB,CAAE;AAC5D;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,43 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { store as
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
import { unlock } from
|
|
18
|
-
import { store as editSiteStore } from
|
|
19
|
-
|
|
20
|
-
const {
|
|
21
|
-
EditorContentSlotFill,
|
|
22
|
-
ResizableEditor
|
|
23
|
-
} = unlock(editorPrivateApis);
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Returns a translated string for the title of the editor canvas container.
|
|
27
|
-
*
|
|
28
|
-
* @param {string} view Editor canvas container view.
|
|
29
|
-
*
|
|
30
|
-
* @return {Object} Translated string for the view title and associated icon, both defaulting to ''.
|
|
31
|
-
*/
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Children, cloneElement, useState } from "@wordpress/element";
|
|
3
|
+
import {
|
|
4
|
+
Button,
|
|
5
|
+
__experimentalUseSlotFills as useSlotFills
|
|
6
|
+
} from "@wordpress/components";
|
|
7
|
+
import { ESCAPE } from "@wordpress/keycodes";
|
|
8
|
+
import { __ } from "@wordpress/i18n";
|
|
9
|
+
import { useDispatch, useSelect } from "@wordpress/data";
|
|
10
|
+
import { closeSmall } from "@wordpress/icons";
|
|
11
|
+
import { useFocusOnMount, useFocusReturn } from "@wordpress/compose";
|
|
12
|
+
import { store as preferencesStore } from "@wordpress/preferences";
|
|
13
|
+
import {
|
|
14
|
+
store as editorStore,
|
|
15
|
+
privateApis as editorPrivateApis
|
|
16
|
+
} from "@wordpress/editor";
|
|
17
|
+
import { unlock } from "../../lock-unlock";
|
|
18
|
+
import { store as editSiteStore } from "../../store";
|
|
19
|
+
const { EditorContentSlotFill, ResizableEditor } = unlock(editorPrivateApis);
|
|
32
20
|
function getEditorCanvasContainerTitle(view) {
|
|
33
21
|
switch (view) {
|
|
34
|
-
case
|
|
35
|
-
return __(
|
|
36
|
-
case
|
|
37
|
-
case
|
|
38
|
-
return __(
|
|
22
|
+
case "style-book":
|
|
23
|
+
return __("Style Book");
|
|
24
|
+
case "global-styles-revisions":
|
|
25
|
+
case "global-styles-revisions:style-book":
|
|
26
|
+
return __("Style Revisions");
|
|
39
27
|
default:
|
|
40
|
-
return
|
|
28
|
+
return "";
|
|
41
29
|
}
|
|
42
30
|
}
|
|
43
31
|
function EditorCanvasContainer({
|
|
@@ -46,31 +34,34 @@ function EditorCanvasContainer({
|
|
|
46
34
|
onClose,
|
|
47
35
|
enableResizing = false
|
|
48
36
|
}) {
|
|
49
|
-
const {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
37
|
+
const { editorCanvasContainerView, showListViewByDefault } = useSelect(
|
|
38
|
+
(select) => {
|
|
39
|
+
const _editorCanvasContainerView = unlock(
|
|
40
|
+
select(editSiteStore)
|
|
41
|
+
).getEditorCanvasContainerView();
|
|
42
|
+
const _showListViewByDefault = select(preferencesStore).get(
|
|
43
|
+
"core",
|
|
44
|
+
"showListViewByDefault"
|
|
45
|
+
);
|
|
46
|
+
return {
|
|
47
|
+
editorCanvasContainerView: _editorCanvasContainerView,
|
|
48
|
+
showListViewByDefault: _showListViewByDefault
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
[]
|
|
52
|
+
);
|
|
60
53
|
const [isClosed, setIsClosed] = useState(false);
|
|
61
|
-
const {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
const {
|
|
65
|
-
|
|
66
|
-
} = useDispatch(editorStore);
|
|
67
|
-
const focusOnMountRef = useFocusOnMount('firstElement');
|
|
54
|
+
const { setEditorCanvasContainerView } = unlock(
|
|
55
|
+
useDispatch(editSiteStore)
|
|
56
|
+
);
|
|
57
|
+
const { setIsListViewOpened } = useDispatch(editorStore);
|
|
58
|
+
const focusOnMountRef = useFocusOnMount("firstElement");
|
|
68
59
|
const sectionFocusReturnRef = useFocusReturn();
|
|
69
60
|
function onCloseContainer() {
|
|
70
61
|
setIsListViewOpened(showListViewByDefault);
|
|
71
|
-
setEditorCanvasContainerView(
|
|
62
|
+
setEditorCanvasContainerView(void 0);
|
|
72
63
|
setIsClosed(true);
|
|
73
|
-
if (typeof onClose ===
|
|
64
|
+
if (typeof onClose === "function") {
|
|
74
65
|
onClose();
|
|
75
66
|
}
|
|
76
67
|
}
|
|
@@ -80,9 +71,12 @@ function EditorCanvasContainer({
|
|
|
80
71
|
onCloseContainer();
|
|
81
72
|
}
|
|
82
73
|
}
|
|
83
|
-
const childrenWithProps = Array.isArray(children) ? Children.map(
|
|
84
|
-
|
|
85
|
-
|
|
74
|
+
const childrenWithProps = Array.isArray(children) ? Children.map(
|
|
75
|
+
children,
|
|
76
|
+
(child, index) => index === 0 ? cloneElement(child, {
|
|
77
|
+
ref: sectionFocusReturnRef
|
|
78
|
+
}) : child
|
|
79
|
+
) : cloneElement(children, {
|
|
86
80
|
ref: sectionFocusReturnRef
|
|
87
81
|
});
|
|
88
82
|
if (isClosed) {
|
|
@@ -90,32 +84,37 @@ function EditorCanvasContainer({
|
|
|
90
84
|
}
|
|
91
85
|
const title = getEditorCanvasContainerTitle(editorCanvasContainerView);
|
|
92
86
|
const shouldShowCloseButton = onClose || closeButtonLabel;
|
|
93
|
-
return
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
87
|
+
return /* @__PURE__ */ jsx(EditorContentSlotFill.Fill, { children: /* @__PURE__ */ jsx("div", { className: "edit-site-editor-canvas-container", children: /* @__PURE__ */ jsx(ResizableEditor, { enableResizing, children: /* @__PURE__ */ jsxs(
|
|
88
|
+
"section",
|
|
89
|
+
{
|
|
90
|
+
className: "edit-site-editor-canvas-container__section",
|
|
91
|
+
ref: shouldShowCloseButton ? focusOnMountRef : null,
|
|
92
|
+
onKeyDown: closeOnEscape,
|
|
93
|
+
"aria-label": title,
|
|
94
|
+
children: [
|
|
95
|
+
shouldShowCloseButton && /* @__PURE__ */ jsx(
|
|
96
|
+
Button,
|
|
97
|
+
{
|
|
104
98
|
size: "compact",
|
|
105
99
|
className: "edit-site-editor-canvas-container__close-button",
|
|
106
100
|
icon: closeSmall,
|
|
107
|
-
label: closeButtonLabel || __(
|
|
101
|
+
label: closeButtonLabel || __("Close"),
|
|
108
102
|
onClick: onCloseContainer
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
103
|
+
}
|
|
104
|
+
),
|
|
105
|
+
childrenWithProps
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
) }) }) });
|
|
114
109
|
}
|
|
115
110
|
function useHasEditorCanvasContainer() {
|
|
116
111
|
const fills = useSlotFills(EditorContentSlotFill.name);
|
|
117
112
|
return !!fills?.length;
|
|
118
113
|
}
|
|
119
|
-
|
|
120
|
-
export {
|
|
121
|
-
|
|
114
|
+
var editor_canvas_container_default = EditorCanvasContainer;
|
|
115
|
+
export {
|
|
116
|
+
editor_canvas_container_default as default,
|
|
117
|
+
getEditorCanvasContainerTitle,
|
|
118
|
+
useHasEditorCanvasContainer
|
|
119
|
+
};
|
|
120
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/editor-canvas-container/index.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { Children, cloneElement, useState } from '@wordpress/element';\nimport {\n\tButton,\n\t__experimentalUseSlotFills as useSlotFills,\n} from '@wordpress/components';\nimport { ESCAPE } from '@wordpress/keycodes';\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { closeSmall } from '@wordpress/icons';\nimport { useFocusOnMount, useFocusReturn } from '@wordpress/compose';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\n\nconst { EditorContentSlotFill, ResizableEditor } = unlock( editorPrivateApis );\n\n/**\n * Returns a translated string for the title of the editor canvas container.\n *\n * @param {string} view Editor canvas container view.\n *\n * @return {Object} Translated string for the view title and associated icon, both defaulting to ''.\n */\nfunction getEditorCanvasContainerTitle( view ) {\n\tswitch ( view ) {\n\t\tcase 'style-book':\n\t\t\treturn __( 'Style Book' );\n\t\tcase 'global-styles-revisions':\n\t\tcase 'global-styles-revisions:style-book':\n\t\t\treturn __( 'Style Revisions' );\n\t\tdefault:\n\t\t\treturn '';\n\t}\n}\n\nfunction EditorCanvasContainer( {\n\tchildren,\n\tcloseButtonLabel,\n\tonClose,\n\tenableResizing = false,\n} ) {\n\tconst { editorCanvasContainerView, showListViewByDefault } = useSelect(\n\t\t( select ) => {\n\t\t\tconst _editorCanvasContainerView = unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t).getEditorCanvasContainerView();\n\n\t\t\tconst _showListViewByDefault = select( preferencesStore ).get(\n\t\t\t\t'core',\n\t\t\t\t'showListViewByDefault'\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\teditorCanvasContainerView: _editorCanvasContainerView,\n\t\t\t\tshowListViewByDefault: _showListViewByDefault,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst [ isClosed, setIsClosed ] = useState( false );\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst { setIsListViewOpened } = useDispatch( editorStore );\n\n\tconst focusOnMountRef = useFocusOnMount( 'firstElement' );\n\tconst sectionFocusReturnRef = useFocusReturn();\n\n\tfunction onCloseContainer() {\n\t\tsetIsListViewOpened( showListViewByDefault );\n\t\tsetEditorCanvasContainerView( undefined );\n\t\tsetIsClosed( true );\n\t\tif ( typeof onClose === 'function' ) {\n\t\t\tonClose();\n\t\t}\n\t}\n\n\tfunction closeOnEscape( event ) {\n\t\tif ( event.keyCode === ESCAPE && ! event.defaultPrevented ) {\n\t\t\tevent.preventDefault();\n\t\t\tonCloseContainer();\n\t\t}\n\t}\n\n\tconst childrenWithProps = Array.isArray( children )\n\t\t? Children.map( children, ( child, index ) =>\n\t\t\t\tindex === 0\n\t\t\t\t\t? cloneElement( child, {\n\t\t\t\t\t\t\tref: sectionFocusReturnRef,\n\t\t\t\t\t } )\n\t\t\t\t\t: child\n\t\t )\n\t\t: cloneElement( children, {\n\t\t\t\tref: sectionFocusReturnRef,\n\t\t } );\n\n\tif ( isClosed ) {\n\t\treturn null;\n\t}\n\n\tconst title = getEditorCanvasContainerTitle( editorCanvasContainerView );\n\tconst shouldShowCloseButton = onClose || closeButtonLabel;\n\n\treturn (\n\t\t<EditorContentSlotFill.Fill>\n\t\t\t<div className=\"edit-site-editor-canvas-container\">\n\t\t\t\t<ResizableEditor enableResizing={ enableResizing }>\n\t\t\t\t\t{ /* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */ }\n\t\t\t\t\t<section\n\t\t\t\t\t\tclassName=\"edit-site-editor-canvas-container__section\"\n\t\t\t\t\t\tref={ shouldShowCloseButton ? focusOnMountRef : null }\n\t\t\t\t\t\tonKeyDown={ closeOnEscape }\n\t\t\t\t\t\taria-label={ title }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ shouldShowCloseButton && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t\tclassName=\"edit-site-editor-canvas-container__close-button\"\n\t\t\t\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\t\t\t\tlabel={ closeButtonLabel || __( 'Close' ) }\n\t\t\t\t\t\t\t\tonClick={ onCloseContainer }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ childrenWithProps }\n\t\t\t\t\t</section>\n\t\t\t\t</ResizableEditor>\n\t\t\t</div>\n\t\t</EditorContentSlotFill.Fill>\n\t);\n}\n\nfunction useHasEditorCanvasContainer() {\n\tconst fills = useSlotFills( EditorContentSlotFill.name );\n\treturn !! fills?.length;\n}\n\nexport default EditorCanvasContainer;\nexport { useHasEditorCanvasContainer, getEditorCanvasContainerTitle };\n"],
|
|
5
|
+
"mappings": "AAuHK,SAOE,KAPF;AApHL,SAAS,UAAU,cAAc,gBAAgB;AACjD;AAAA,EACC;AAAA,EACA,8BAA8B;AAAA,OACxB;AACP,SAAS,cAAc;AACvB,SAAS,UAAU;AACnB,SAAS,aAAa,iBAAiB;AACvC,SAAS,kBAAkB;AAC3B,SAAS,iBAAiB,sBAAsB;AAChD,SAAS,SAAS,wBAAwB;AAC1C;AAAA,EACC,SAAS;AAAA,EACT,eAAe;AAAA,OACT;AAKP,SAAS,cAAc;AACvB,SAAS,SAAS,qBAAqB;AAEvC,MAAM,EAAE,uBAAuB,gBAAgB,IAAI,OAAQ,iBAAkB;AAS7E,SAAS,8BAA+B,MAAO;AAC9C,UAAS,MAAO;AAAA,IAC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A,IACxB,KAAK;AAAA,EACL,CAAE;AAEL,MAAK,UAAW;AACf,WAAO;AAAA,EACR;AAEA,QAAM,QAAQ,8BAA+B,yBAA0B;AACvE,QAAM,wBAAwB,WAAW;AAEzC,SACC,oBAAC,sBAAsB,MAAtB,EACA,8BAAC,SAAI,WAAU,qCACd,8BAAC,mBAAgB,gBAEhB;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV,KAAM,wBAAwB,kBAAkB;AAAA,MAChD,WAAY;AAAA,MACZ,cAAa;AAAA,MAEX;AAAA,iCACD;AAAA,UAAC;AAAA;AAAA,YACA,MAAK;AAAA,YACL,WAAU;AAAA,YACV,MAAO;AAAA,YACP,OAAQ,oBAAoB,GAAI,OAAQ;AAAA,YACxC,SAAU;AAAA;AAAA,QACX;AAAA,QAEC;AAAA;AAAA;AAAA,EACH,GACD,GACD,GACD;AAEF;AAEA,SAAS,8BAA8B;AACtC,QAAM,QAAQ,aAAc,sBAAsB,IAAK;AACvD,SAAO,CAAC,CAAE,OAAO;AAClB;AAEA,IAAO,kCAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,48 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Internal dependencies
|
|
8
|
-
*/
|
|
9
|
-
import { unlock } from '../../lock-unlock';
|
|
10
|
-
|
|
11
|
-
// Initial control values where no block style is set.
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { privateApis as blockEditorPrivateApis } from "@wordpress/block-editor";
|
|
3
|
+
import { unlock } from "../../lock-unlock";
|
|
13
4
|
const BACKGROUND_DEFAULT_VALUES = {
|
|
14
|
-
backgroundSize:
|
|
5
|
+
backgroundSize: "auto"
|
|
15
6
|
};
|
|
16
7
|
const {
|
|
17
8
|
useGlobalStyle,
|
|
18
9
|
useGlobalSetting,
|
|
19
10
|
BackgroundPanel: StylesBackgroundPanel
|
|
20
11
|
} = unlock(blockEditorPrivateApis);
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
* Checks if there is a current value in the background image block support
|
|
24
|
-
* attributes.
|
|
25
|
-
*
|
|
26
|
-
* @param {Object} style Style attribute.
|
|
27
|
-
* @return {boolean} Whether the block has a background image value set.
|
|
28
|
-
*/
|
|
29
|
-
export function hasBackgroundImageValue(style) {
|
|
30
|
-
return !!style?.background?.backgroundImage?.id || !!style?.background?.backgroundImage?.url || typeof style?.background?.backgroundImage === 'string';
|
|
12
|
+
function hasBackgroundImageValue(style) {
|
|
13
|
+
return !!style?.background?.backgroundImage?.id || !!style?.background?.backgroundImage?.url || typeof style?.background?.backgroundImage === "string";
|
|
31
14
|
}
|
|
32
|
-
|
|
33
|
-
const [style] = useGlobalStyle(
|
|
15
|
+
function BackgroundPanel() {
|
|
16
|
+
const [style] = useGlobalStyle("", void 0, "user", {
|
|
34
17
|
shouldDecodeEncode: false
|
|
35
18
|
});
|
|
36
|
-
const [inheritedStyle, setStyle] = useGlobalStyle(
|
|
19
|
+
const [inheritedStyle, setStyle] = useGlobalStyle("", void 0, "all", {
|
|
37
20
|
shouldDecodeEncode: false
|
|
38
21
|
});
|
|
39
|
-
const [settings] = useGlobalSetting(
|
|
40
|
-
return
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
22
|
+
const [settings] = useGlobalSetting("");
|
|
23
|
+
return /* @__PURE__ */ jsx(
|
|
24
|
+
StylesBackgroundPanel,
|
|
25
|
+
{
|
|
26
|
+
inheritedValue: inheritedStyle,
|
|
27
|
+
value: style,
|
|
28
|
+
onChange: setStyle,
|
|
29
|
+
settings,
|
|
30
|
+
defaultValues: BACKGROUND_DEFAULT_VALUES
|
|
31
|
+
}
|
|
32
|
+
);
|
|
47
33
|
}
|
|
48
|
-
|
|
34
|
+
export {
|
|
35
|
+
BackgroundPanel as default,
|
|
36
|
+
hasBackgroundImageValue
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=background-panel.js.map
|