@wordpress/edit-site 6.33.3 → 6.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/block-editor/use-site-editor-settings.js +14 -2
- package/build/components/block-editor/use-site-editor-settings.js.map +3 -3
- package/build/components/canvas-loader/index.js +5 -8
- package/build/components/canvas-loader/index.js.map +3 -3
- package/build/components/editor/index.js +2 -40
- package/build/components/editor/index.js.map +3 -3
- package/build/components/layout/index.js +5 -7
- package/build/components/layout/index.js.map +3 -3
- package/build/components/page-patterns/fields.js +4 -3
- package/build/components/page-patterns/fields.js.map +3 -3
- package/build/components/page-templates/fields.js +2 -2
- package/build/components/page-templates/fields.js.map +3 -3
- package/build/components/{sidebar-global-styles-wrapper → sidebar-global-styles}/index.js +22 -46
- package/build/components/sidebar-global-styles/index.js.map +7 -0
- package/build/components/sidebar-navigation-screen-global-styles/content.js +38 -16
- package/build/components/sidebar-navigation-screen-global-styles/content.js.map +3 -3
- package/build/components/sidebar-navigation-screen-global-styles/index.js +6 -7
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +3 -3
- package/build/components/sidebar-navigation-screen-main/index.js +0 -9
- package/build/components/sidebar-navigation-screen-main/index.js.map +3 -3
- package/build/components/sidebar-navigation-screen-templates-browse/content.js +2 -2
- package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +2 -2
- package/build/components/site-editor-routes/stylebook.js +5 -3
- package/build/components/site-editor-routes/stylebook.js.map +3 -3
- package/build/components/site-editor-routes/styles.js +33 -11
- package/build/components/site-editor-routes/styles.js.map +3 -3
- package/build/components/welcome-guide/index.js +0 -2
- package/build/components/welcome-guide/index.js.map +3 -3
- package/build/hooks/commands/use-common-commands.js +10 -12
- package/build/hooks/commands/use-common-commands.js.map +3 -3
- package/build/hooks/commands/use-set-command-context.js +0 -5
- package/build/hooks/commands/use-set-command-context.js.map +2 -2
- package/build/index.js +0 -1
- package/build/index.js.map +2 -2
- package/build/posts.js +0 -1
- package/build/posts.js.map +2 -2
- package/build/store/private-actions.js +0 -8
- package/build/store/private-actions.js.map +2 -2
- package/build/store/private-selectors.js +0 -5
- package/build/store/private-selectors.js.map +2 -2
- package/build/store/reducer.js +0 -8
- package/build/store/reducer.js.map +2 -2
- package/build-module/components/block-editor/use-site-editor-settings.js +14 -2
- package/build-module/components/block-editor/use-site-editor-settings.js.map +2 -2
- package/build-module/components/canvas-loader/index.js +5 -8
- package/build-module/components/canvas-loader/index.js.map +2 -2
- package/build-module/components/editor/index.js +4 -46
- package/build-module/components/editor/index.js.map +2 -2
- package/build-module/components/layout/index.js +5 -7
- package/build-module/components/layout/index.js.map +2 -2
- package/build-module/components/page-patterns/fields.js +5 -7
- package/build-module/components/page-patterns/fields.js.map +2 -2
- package/build-module/components/page-templates/fields.js +6 -6
- package/build-module/components/page-templates/fields.js.map +2 -2
- package/build-module/components/{sidebar-global-styles-wrapper → sidebar-global-styles}/index.js +21 -41
- package/build-module/components/sidebar-global-styles/index.js.map +7 -0
- package/build-module/components/sidebar-navigation-screen-global-styles/content.js +42 -6
- package/build-module/components/sidebar-navigation-screen-global-styles/content.js.map +2 -2
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +5 -6
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +2 -2
- package/build-module/components/sidebar-navigation-screen-main/index.js +1 -10
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +2 -2
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +3 -3
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +2 -2
- package/build-module/components/site-editor-routes/stylebook.js +3 -1
- package/build-module/components/site-editor-routes/stylebook.js.map +2 -2
- package/build-module/components/site-editor-routes/styles.js +31 -9
- package/build-module/components/site-editor-routes/styles.js.map +2 -2
- package/build-module/components/welcome-guide/index.js +0 -2
- package/build-module/components/welcome-guide/index.js.map +2 -2
- package/build-module/hooks/commands/use-common-commands.js +13 -12
- package/build-module/hooks/commands/use-common-commands.js.map +2 -2
- package/build-module/hooks/commands/use-set-command-context.js +0 -5
- package/build-module/hooks/commands/use-set-command-context.js.map +2 -2
- package/build-module/index.js +0 -1
- package/build-module/index.js.map +2 -2
- package/build-module/posts.js +0 -1
- package/build-module/posts.js.map +2 -2
- package/build-module/store/private-actions.js +0 -7
- package/build-module/store/private-actions.js.map +2 -2
- package/build-module/store/private-selectors.js +0 -4
- package/build-module/store/private-selectors.js.map +2 -2
- package/build-module/store/reducer.js +0 -8
- package/build-module/store/reducer.js.map +2 -2
- package/build-style/posts-rtl.css +13 -50
- package/build-style/posts.css +13 -50
- package/build-style/style-rtl.css +722 -726
- package/build-style/style.css +722 -726
- package/package.json +49 -44
- package/src/components/block-editor/use-site-editor-settings.js +21 -2
- package/src/components/canvas-loader/index.js +5 -9
- package/src/components/editor/index.js +2 -50
- package/src/components/layout/index.js +6 -10
- package/src/components/page-patterns/fields.js +5 -7
- package/src/components/page-templates/fields.js +6 -6
- package/src/components/{sidebar-global-styles-wrapper → sidebar-global-styles}/index.js +16 -48
- package/src/components/{sidebar-global-styles-wrapper → sidebar-global-styles}/style.scss +3 -3
- package/src/components/sidebar-navigation-screen/style.scss +5 -12
- package/src/components/sidebar-navigation-screen-global-styles/content.js +34 -6
- package/src/components/sidebar-navigation-screen-global-styles/index.js +6 -9
- package/src/components/sidebar-navigation-screen-main/index.js +1 -12
- package/src/components/sidebar-navigation-screen-patterns/style.scss +1 -1
- package/src/components/sidebar-navigation-screen-templates-browse/content.js +3 -3
- package/src/components/site-editor-routes/stylebook.js +4 -1
- package/src/components/site-editor-routes/styles.js +35 -9
- package/src/components/site-hub/style.scss +1 -1
- package/src/components/welcome-guide/index.js +0 -2
- package/src/components/welcome-guide/style.scss +1 -2
- package/src/hooks/commands/use-common-commands.js +19 -12
- package/src/hooks/commands/use-set-command-context.js +0 -11
- package/src/index.js +0 -1
- package/src/posts.js +0 -1
- package/src/posts.scss +0 -1
- package/src/store/private-actions.js +0 -14
- package/src/store/private-selectors.js +0 -11
- package/src/store/reducer.js +0 -18
- package/src/style.scss +2 -9
- package/tsconfig.json +3 -11
- package/build/components/editor-canvas-container/index.js +0 -139
- package/build/components/editor-canvas-container/index.js.map +0 -7
- package/build/components/global-styles/background-panel.js +0 -62
- package/build/components/global-styles/background-panel.js.map +0 -7
- package/build/components/global-styles/block-preview-panel.js +0 -87
- package/build/components/global-styles/block-preview-panel.js.map +0 -7
- package/build/components/global-styles/color-indicator-wrapper.js +0 -50
- package/build/components/global-styles/color-indicator-wrapper.js.map +0 -7
- package/build/components/global-styles/color-palette-panel.js +0 -133
- package/build/components/global-styles/color-palette-panel.js.map +0 -7
- package/build/components/global-styles/confirm-reset-shadow-dialog.js +0 -55
- package/build/components/global-styles/confirm-reset-shadow-dialog.js.map +0 -7
- package/build/components/global-styles/dimensions-panel.js +0 -92
- package/build/components/global-styles/dimensions-panel.js.map +0 -7
- package/build/components/global-styles/font-families.js +0 -114
- package/build/components/global-styles/font-families.js.map +0 -7
- package/build/components/global-styles/font-family-item.js +0 -48
- package/build/components/global-styles/font-family-item.js.map +0 -7
- package/build/components/global-styles/font-library-modal/collection-font-variant.js +0 -75
- package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +0 -7
- package/build/components/global-styles/font-library-modal/context.js +0 -386
- package/build/components/global-styles/font-library-modal/context.js.map +0 -7
- package/build/components/global-styles/font-library-modal/font-card.js +0 -76
- package/build/components/global-styles/font-library-modal/font-card.js.map +0 -7
- package/build/components/global-styles/font-library-modal/font-collection.js +0 -504
- package/build/components/global-styles/font-library-modal/font-collection.js.map +0 -7
- package/build/components/global-styles/font-library-modal/font-demo.js +0 -108
- package/build/components/global-styles/font-library-modal/font-demo.js.map +0 -7
- package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +0 -58
- package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +0 -7
- package/build/components/global-styles/font-library-modal/index.js +0 -110
- package/build/components/global-styles/font-library-modal/index.js.map +0 -7
- package/build/components/global-styles/font-library-modal/installed-fonts.js +0 -455
- package/build/components/global-styles/font-library-modal/installed-fonts.js.map +0 -7
- package/build/components/global-styles/font-library-modal/library-font-details.js +0 -63
- package/build/components/global-styles/font-library-modal/library-font-details.js.map +0 -7
- package/build/components/global-styles/font-library-modal/library-font-variant.js +0 -78
- package/build/components/global-styles/font-library-modal/library-font-variant.js.map +0 -7
- package/build/components/global-styles/font-library-modal/resolvers.js +0 -115
- package/build/components/global-styles/font-library-modal/resolvers.js.map +0 -7
- package/build/components/global-styles/font-library-modal/upload-fonts.js +0 -205
- package/build/components/global-styles/font-library-modal/upload-fonts.js.map +0 -7
- package/build/components/global-styles/font-library-modal/utils/constants.js +0 -49
- package/build/components/global-styles/font-library-modal/utils/constants.js.map +0 -7
- package/build/components/global-styles/font-library-modal/utils/filter-fonts.js +0 -39
- package/build/components/global-styles/font-library-modal/utils/filter-fonts.js.map +0 -7
- package/build/components/global-styles/font-library-modal/utils/fonts-outline.js +0 -51
- package/build/components/global-styles/font-library-modal/utils/fonts-outline.js.map +0 -7
- package/build/components/global-styles/font-library-modal/utils/index.js +0 -277
- package/build/components/global-styles/font-library-modal/utils/index.js.map +0 -7
- package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js +0 -42
- package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +0 -7
- package/build/components/global-styles/font-library-modal/utils/preview-styles.js +0 -117
- package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +0 -7
- package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js +0 -56
- package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +0 -7
- package/build/components/global-styles/font-library-modal/utils/toggleFont.js +0 -63
- package/build/components/global-styles/font-library-modal/utils/toggleFont.js.map +0 -7
- package/build/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js +0 -60
- package/build/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js.map +0 -7
- package/build/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js +0 -55
- package/build/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js.map +0 -7
- package/build/components/global-styles/font-sizes/font-size-preview.js +0 -51
- package/build/components/global-styles/font-sizes/font-size-preview.js.map +0 -7
- package/build/components/global-styles/font-sizes/font-size.js +0 -260
- package/build/components/global-styles/font-sizes/font-size.js.map +0 -7
- package/build/components/global-styles/font-sizes/font-sizes-count.js +0 -50
- package/build/components/global-styles/font-sizes/font-sizes-count.js.map +0 -7
- package/build/components/global-styles/font-sizes/font-sizes.js +0 -220
- package/build/components/global-styles/font-sizes/font-sizes.js.map +0 -7
- package/build/components/global-styles/font-sizes/rename-font-size-dialog.js +0 -90
- package/build/components/global-styles/font-sizes/rename-font-size-dialog.js.map +0 -7
- package/build/components/global-styles/gradients-palette-panel.js +0 -144
- package/build/components/global-styles/gradients-palette-panel.js.map +0 -7
- package/build/components/global-styles/header.js +0 -54
- package/build/components/global-styles/header.js.map +0 -7
- package/build/components/global-styles/highlighted-colors.js +0 -57
- package/build/components/global-styles/highlighted-colors.js.map +0 -7
- package/build/components/global-styles/hooks.js +0 -113
- package/build/components/global-styles/hooks.js.map +0 -7
- package/build/components/global-styles/icon-with-current-color.js +0 -53
- package/build/components/global-styles/icon-with-current-color.js.map +0 -7
- package/build/components/global-styles/index.js +0 -39
- package/build/components/global-styles/index.js.map +0 -7
- package/build/components/global-styles/navigation-button.js +0 -48
- package/build/components/global-styles/navigation-button.js.map +0 -7
- package/build/components/global-styles/palette.js +0 -86
- package/build/components/global-styles/palette.js.map +0 -7
- package/build/components/global-styles/preset-colors.js +0 -40
- package/build/components/global-styles/preset-colors.js.map +0 -7
- package/build/components/global-styles/preview-colors.js +0 -82
- package/build/components/global-styles/preview-colors.js.map +0 -7
- package/build/components/global-styles/preview-styles.js +0 -214
- package/build/components/global-styles/preview-styles.js.map +0 -7
- package/build/components/global-styles/preview-typography.js +0 -68
- package/build/components/global-styles/preview-typography.js.map +0 -7
- package/build/components/global-styles/preview-wrapper.js +0 -101
- package/build/components/global-styles/preview-wrapper.js.map +0 -7
- package/build/components/global-styles/root-menu.js +0 -72
- package/build/components/global-styles/root-menu.js.map +0 -7
- package/build/components/global-styles/screen-background.js +0 -59
- package/build/components/global-styles/screen-background.js.map +0 -7
- package/build/components/global-styles/screen-block-list.js +0 -170
- package/build/components/global-styles/screen-block-list.js.map +0 -7
- package/build/components/global-styles/screen-block.js +0 -316
- package/build/components/global-styles/screen-block.js.map +0 -7
- package/build/components/global-styles/screen-color-palette.js +0 -64
- package/build/components/global-styles/screen-color-palette.js.map +0 -7
- package/build/components/global-styles/screen-colors.js +0 -81
- package/build/components/global-styles/screen-colors.js.map +0 -7
- package/build/components/global-styles/screen-css.js +0 -92
- package/build/components/global-styles/screen-css.js.map +0 -7
- package/build/components/global-styles/screen-layout.js +0 -51
- package/build/components/global-styles/screen-layout.js.map +0 -7
- package/build/components/global-styles/screen-revisions/index.js +0 -179
- package/build/components/global-styles/screen-revisions/index.js.map +0 -7
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +0 -192
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +0 -7
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +0 -148
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +0 -7
- package/build/components/global-styles/screen-root.js +0 -99
- package/build/components/global-styles/screen-root.js.map +0 -7
- package/build/components/global-styles/screen-shadows.js +0 -49
- package/build/components/global-styles/screen-shadows.js.map +0 -7
- package/build/components/global-styles/screen-style-variations.js +0 -70
- package/build/components/global-styles/screen-style-variations.js.map +0 -7
- package/build/components/global-styles/screen-typography-element.js +0 -167
- package/build/components/global-styles/screen-typography-element.js.map +0 -7
- package/build/components/global-styles/screen-typography.js +0 -68
- package/build/components/global-styles/screen-typography.js.map +0 -7
- package/build/components/global-styles/shadow-utils.js +0 -125
- package/build/components/global-styles/shadow-utils.js.map +0 -7
- package/build/components/global-styles/shadows-edit-panel.js +0 -501
- package/build/components/global-styles/shadows-edit-panel.js.map +0 -7
- package/build/components/global-styles/shadows-panel.js +0 -206
- package/build/components/global-styles/shadows-panel.js.map +0 -7
- package/build/components/global-styles/size-control/index.js +0 -80
- package/build/components/global-styles/size-control/index.js.map +0 -7
- package/build/components/global-styles/style-variations-container.js +0 -124
- package/build/components/global-styles/style-variations-container.js.map +0 -7
- package/build/components/global-styles/subtitle.js +0 -37
- package/build/components/global-styles/subtitle.js.map +0 -7
- package/build/components/global-styles/typeset.js +0 -78
- package/build/components/global-styles/typeset.js.map +0 -7
- package/build/components/global-styles/typography-elements.js +0 -123
- package/build/components/global-styles/typography-elements.js.map +0 -7
- package/build/components/global-styles/typography-example.js +0 -81
- package/build/components/global-styles/typography-example.js.map +0 -7
- package/build/components/global-styles/typography-panel.js +0 -69
- package/build/components/global-styles/typography-panel.js.map +0 -7
- package/build/components/global-styles/typography-preview.js +0 -80
- package/build/components/global-styles/typography-preview.js.map +0 -7
- package/build/components/global-styles/ui.js +0 -355
- package/build/components/global-styles/ui.js.map +0 -7
- package/build/components/global-styles/utils.js +0 -92
- package/build/components/global-styles/utils.js.map +0 -7
- package/build/components/global-styles/variations/variation.js +0 -118
- package/build/components/global-styles/variations/variation.js.map +0 -7
- package/build/components/global-styles/variations/variations-color.js +0 -61
- package/build/components/global-styles/variations/variations-color.js.map +0 -7
- package/build/components/global-styles/variations/variations-panel.js +0 -71
- package/build/components/global-styles/variations/variations-panel.js.map +0 -7
- package/build/components/global-styles/variations/variations-typography.js +0 -75
- package/build/components/global-styles/variations/variations-typography.js.map +0 -7
- package/build/components/global-styles-renderer/index.js +0 -57
- package/build/components/global-styles-renderer/index.js.map +0 -7
- package/build/components/global-styles-sidebar/default-sidebar.js +0 -68
- package/build/components/global-styles-sidebar/default-sidebar.js.map +0 -7
- package/build/components/global-styles-sidebar/index.js +0 -202
- package/build/components/global-styles-sidebar/index.js.map +0 -7
- package/build/components/revisions/index.js +0 -120
- package/build/components/revisions/index.js.map +0 -7
- package/build/components/sidebar-global-styles-wrapper/index.js.map +0 -7
- package/build/components/style-book/categories.js +0 -86
- package/build/components/style-book/categories.js.map +0 -7
- package/build/components/style-book/color-examples.js +0 -65
- package/build/components/style-book/color-examples.js.map +0 -7
- package/build/components/style-book/constants.js +0 -319
- package/build/components/style-book/constants.js.map +0 -7
- package/build/components/style-book/duotone-examples.js +0 -69
- package/build/components/style-book/duotone-examples.js.map +0 -7
- package/build/components/style-book/examples.js +0 -237
- package/build/components/style-book/examples.js.map +0 -7
- package/build/components/style-book/index.js +0 -644
- package/build/components/style-book/index.js.map +0 -7
- package/build/components/style-book/types.js +0 -17
- package/build/components/style-book/types.js.map +0 -7
- package/build/components/welcome-guide/styles.js +0 -145
- package/build/components/welcome-guide/styles.js.map +0 -7
- package/build/hooks/index.js +0 -3
- package/build/hooks/index.js.map +0 -7
- package/build/hooks/push-changes-to-global-styles/index.js +0 -319
- package/build/hooks/push-changes-to-global-styles/index.js.map +0 -7
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +0 -126
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +0 -7
- package/build/utils/set-nested-value.js +0 -43
- package/build/utils/set-nested-value.js.map +0 -7
- package/build-module/components/editor-canvas-container/index.js +0 -120
- package/build-module/components/editor-canvas-container/index.js.map +0 -7
- package/build-module/components/global-styles/background-panel.js +0 -38
- package/build-module/components/global-styles/background-panel.js.map +0 -7
- package/build-module/components/global-styles/block-preview-panel.js +0 -67
- package/build-module/components/global-styles/block-preview-panel.js.map +0 -7
- package/build-module/components/global-styles/color-indicator-wrapper.js +0 -20
- package/build-module/components/global-styles/color-indicator-wrapper.js.map +0 -7
- package/build-module/components/global-styles/color-palette-panel.js +0 -107
- package/build-module/components/global-styles/color-palette-panel.js.map +0 -7
- package/build-module/components/global-styles/confirm-reset-shadow-dialog.js +0 -35
- package/build-module/components/global-styles/confirm-reset-shadow-dialog.js.map +0 -7
- package/build-module/components/global-styles/dimensions-panel.js +0 -72
- package/build-module/components/global-styles/dimensions-panel.js.map +0 -7
- package/build-module/components/global-styles/font-families.js +0 -92
- package/build-module/components/global-styles/font-families.js.map +0 -7
- package/build-module/components/global-styles/font-family-item.js +0 -32
- package/build-module/components/global-styles/font-family-item.js.map +0 -7
- package/build-module/components/global-styles/font-library-modal/collection-font-variant.js +0 -45
- package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +0 -7
- package/build-module/components/global-styles/font-library-modal/context.js +0 -372
- package/build-module/components/global-styles/font-library-modal/context.js.map +0 -7
- package/build-module/components/global-styles/font-library-modal/font-card.js +0 -53
- package/build-module/components/global-styles/font-library-modal/font-card.js.map +0 -7
- package/build-module/components/global-styles/font-library-modal/font-collection.js +0 -505
- package/build-module/components/global-styles/font-library-modal/font-collection.js.map +0 -7
- package/build-module/components/global-styles/font-library-modal/font-demo.js +0 -91
- package/build-module/components/global-styles/font-library-modal/font-demo.js.map +0 -7
- package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +0 -45
- package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +0 -7
- package/build-module/components/global-styles/font-library-modal/index.js +0 -83
- package/build-module/components/global-styles/font-library-modal/index.js.map +0 -7
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js +0 -444
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +0 -7
- package/build-module/components/global-styles/font-library-modal/library-font-details.js +0 -36
- package/build-module/components/global-styles/font-library-modal/library-font-details.js.map +0 -7
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js +0 -48
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +0 -7
- package/build-module/components/global-styles/font-library-modal/resolvers.js +0 -76
- package/build-module/components/global-styles/font-library-modal/resolvers.js.map +0 -7
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js +0 -185
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +0 -7
- package/build-module/components/global-styles/font-library-modal/utils/constants.js +0 -23
- package/build-module/components/global-styles/font-library-modal/utils/constants.js.map +0 -7
- package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js +0 -19
- package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js.map +0 -7
- package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js +0 -26
- package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js.map +0 -7
- package/build-module/components/global-styles/font-library-modal/utils/index.js +0 -241
- package/build-module/components/global-styles/font-library-modal/utils/index.js.map +0 -7
- package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js +0 -22
- package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +0 -7
- package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js +0 -90
- package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +0 -7
- package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js +0 -32
- package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +0 -7
- package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js +0 -39
- package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js.map +0 -7
- package/build-module/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js +0 -40
- package/build-module/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js.map +0 -7
- package/build-module/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js +0 -35
- package/build-module/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js.map +0 -7
- package/build-module/components/global-styles/font-sizes/font-size-preview.js +0 -34
- package/build-module/components/global-styles/font-sizes/font-size-preview.js.map +0 -7
- package/build-module/components/global-styles/font-sizes/font-size.js +0 -240
- package/build-module/components/global-styles/font-sizes/font-size.js.map +0 -7
- package/build-module/components/global-styles/font-sizes/font-sizes-count.js +0 -25
- package/build-module/components/global-styles/font-sizes/font-sizes-count.js.map +0 -7
- package/build-module/components/global-styles/font-sizes/font-sizes.js +0 -205
- package/build-module/components/global-styles/font-sizes/font-sizes.js.map +0 -7
- package/build-module/components/global-styles/font-sizes/rename-font-size-dialog.js +0 -76
- package/build-module/components/global-styles/font-sizes/rename-font-size-dialog.js.map +0 -7
- package/build-module/components/global-styles/gradients-palette-panel.js +0 -119
- package/build-module/components/global-styles/gradients-palette-panel.js.map +0 -7
- package/build-module/components/global-styles/header.js +0 -41
- package/build-module/components/global-styles/header.js.map +0 -7
- package/build-module/components/global-styles/highlighted-colors.js +0 -37
- package/build-module/components/global-styles/highlighted-colors.js.map +0 -7
- package/build-module/components/global-styles/hooks.js +0 -77
- package/build-module/components/global-styles/hooks.js.map +0 -7
- package/build-module/components/global-styles/icon-with-current-color.js +0 -19
- package/build-module/components/global-styles/icon-with-current-color.js.map +0 -7
- package/build-module/components/global-styles/index.js +0 -5
- package/build-module/components/global-styles/index.js.map +0 -7
- package/build-module/components/global-styles/navigation-button.js +0 -28
- package/build-module/components/global-styles/navigation-button.js.map +0 -7
- package/build-module/components/global-styles/palette.js +0 -63
- package/build-module/components/global-styles/palette.js.map +0 -7
- package/build-module/components/global-styles/preset-colors.js +0 -20
- package/build-module/components/global-styles/preset-colors.js.map +0 -7
- package/build-module/components/global-styles/preview-colors.js +0 -55
- package/build-module/components/global-styles/preview-colors.js.map +0 -7
- package/build-module/components/global-styles/preview-styles.js +0 -188
- package/build-module/components/global-styles/preview-styles.js.map +0 -7
- package/build-module/components/global-styles/preview-typography.js +0 -38
- package/build-module/components/global-styles/preview-typography.js.map +0 -7
- package/build-module/components/global-styles/preview-wrapper.js +0 -85
- package/build-module/components/global-styles/preview-wrapper.js.map +0 -7
- package/build-module/components/global-styles/root-menu.js +0 -58
- package/build-module/components/global-styles/root-menu.js.map +0 -7
- package/build-module/components/global-styles/screen-background.js +0 -29
- package/build-module/components/global-styles/screen-background.js.map +0 -7
- package/build-module/components/global-styles/screen-block-list.js +0 -150
- package/build-module/components/global-styles/screen-block-list.js.map +0 -7
- package/build-module/components/global-styles/screen-block.js +0 -293
- package/build-module/components/global-styles/screen-block.js.map +0 -7
- package/build-module/components/global-styles/screen-color-palette.js +0 -34
- package/build-module/components/global-styles/screen-color-palette.js.map +0 -7
- package/build-module/components/global-styles/screen-colors.js +0 -51
- package/build-module/components/global-styles/screen-colors.js.map +0 -7
- package/build-module/components/global-styles/screen-css.js +0 -62
- package/build-module/components/global-styles/screen-css.js.map +0 -7
- package/build-module/components/global-styles/screen-layout.js +0 -21
- package/build-module/components/global-styles/screen-layout.js.map +0 -7
- package/build-module/components/global-styles/screen-revisions/index.js +0 -155
- package/build-module/components/global-styles/screen-revisions/index.js.map +0 -7
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +0 -172
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +0 -7
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +0 -128
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +0 -7
- package/build-module/components/global-styles/screen-root.js +0 -79
- package/build-module/components/global-styles/screen-root.js.map +0 -7
- package/build-module/components/global-styles/screen-shadows.js +0 -14
- package/build-module/components/global-styles/screen-shadows.js.map +0 -7
- package/build-module/components/global-styles/screen-style-variations.js +0 -43
- package/build-module/components/global-styles/screen-style-variations.js.map +0 -7
- package/build-module/components/global-styles/screen-typography-element.js +0 -141
- package/build-module/components/global-styles/screen-typography-element.js.map +0 -7
- package/build-module/components/global-styles/screen-typography.js +0 -38
- package/build-module/components/global-styles/screen-typography.js.map +0 -7
- package/build-module/components/global-styles/shadow-utils.js +0 -98
- package/build-module/components/global-styles/shadow-utils.js.map +0 -7
- package/build-module/components/global-styles/shadows-edit-panel.js +0 -500
- package/build-module/components/global-styles/shadows-edit-panel.js.map +0 -7
- package/build-module/components/global-styles/shadows-panel.js +0 -185
- package/build-module/components/global-styles/shadows-panel.js.map +0 -7
- package/build-module/components/global-styles/size-control/index.js +0 -70
- package/build-module/components/global-styles/size-control/index.js.map +0 -7
- package/build-module/components/global-styles/style-variations-container.js +0 -94
- package/build-module/components/global-styles/style-variations-container.js.map +0 -7
- package/build-module/components/global-styles/subtitle.js +0 -17
- package/build-module/components/global-styles/subtitle.js.map +0 -7
- package/build-module/components/global-styles/typeset.js +0 -54
- package/build-module/components/global-styles/typeset.js.map +0 -7
- package/build-module/components/global-styles/typography-elements.js +0 -98
- package/build-module/components/global-styles/typography-elements.js.map +0 -7
- package/build-module/components/global-styles/typography-example.js +0 -61
- package/build-module/components/global-styles/typography-example.js.map +0 -7
- package/build-module/components/global-styles/typography-panel.js +0 -49
- package/build-module/components/global-styles/typography-panel.js.map +0 -7
- package/build-module/components/global-styles/typography-preview.js +0 -60
- package/build-module/components/global-styles/typography-preview.js.map +0 -7
- package/build-module/components/global-styles/ui.js +0 -334
- package/build-module/components/global-styles/ui.js.map +0 -7
- package/build-module/components/global-styles/utils.js +0 -66
- package/build-module/components/global-styles/utils.js.map +0 -7
- package/build-module/components/global-styles/variations/variation.js +0 -88
- package/build-module/components/global-styles/variations/variation.js.map +0 -7
- package/build-module/components/global-styles/variations/variations-color.js +0 -34
- package/build-module/components/global-styles/variations/variations-color.js.map +0 -7
- package/build-module/components/global-styles/variations/variations-panel.js +0 -46
- package/build-module/components/global-styles/variations/variations-panel.js.map +0 -7
- package/build-module/components/global-styles/variations/variations-typography.js +0 -48
- package/build-module/components/global-styles/variations/variations-typography.js.map +0 -7
- package/build-module/components/global-styles-renderer/index.js +0 -33
- package/build-module/components/global-styles-renderer/index.js.map +0 -7
- package/build-module/components/global-styles-sidebar/default-sidebar.js +0 -48
- package/build-module/components/global-styles-sidebar/default-sidebar.js.map +0 -7
- package/build-module/components/global-styles-sidebar/index.js +0 -175
- package/build-module/components/global-styles-sidebar/index.js.map +0 -7
- package/build-module/components/revisions/index.js +0 -96
- package/build-module/components/revisions/index.js.map +0 -7
- package/build-module/components/sidebar-global-styles-wrapper/index.js.map +0 -7
- package/build-module/components/style-book/categories.js +0 -64
- package/build-module/components/style-book/categories.js.map +0 -7
- package/build-module/components/style-book/color-examples.js +0 -38
- package/build-module/components/style-book/color-examples.js.map +0 -7
- package/build-module/components/style-book/constants.js +0 -290
- package/build-module/components/style-book/constants.js.map +0 -7
- package/build-module/components/style-book/duotone-examples.js +0 -49
- package/build-module/components/style-book/duotone-examples.js.map +0 -7
- package/build-module/components/style-book/examples.js +0 -208
- package/build-module/components/style-book/examples.js.map +0 -7
- package/build-module/components/style-book/index.js +0 -635
- package/build-module/components/style-book/index.js.map +0 -7
- package/build-module/components/style-book/types.js +0 -1
- package/build-module/components/style-book/types.js.map +0 -7
- package/build-module/components/welcome-guide/styles.js +0 -115
- package/build-module/components/welcome-guide/styles.js.map +0 -7
- package/build-module/hooks/index.js +0 -2
- package/build-module/hooks/index.js.map +0 -7
- package/build-module/hooks/push-changes-to-global-styles/index.js +0 -305
- package/build-module/hooks/push-changes-to-global-styles/index.js.map +0 -7
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +0 -99
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +0 -7
- package/build-module/utils/set-nested-value.js +0 -23
- package/build-module/utils/set-nested-value.js.map +0 -7
- package/build-types/components/style-book/categories.d.ts +0 -18
- package/build-types/components/style-book/categories.d.ts.map +0 -1
- package/build-types/components/style-book/color-examples.d.ts +0 -7
- package/build-types/components/style-book/color-examples.d.ts.map +0 -1
- package/build-types/components/style-book/constants.d.ts +0 -11
- package/build-types/components/style-book/constants.d.ts.map +0 -1
- package/build-types/components/style-book/duotone-examples.d.ts +0 -9
- package/build-types/components/style-book/duotone-examples.d.ts.map +0 -1
- package/build-types/components/style-book/examples.d.ts +0 -12
- package/build-types/components/style-book/examples.d.ts.map +0 -1
- package/build-types/components/style-book/types.d.ts +0 -72
- package/build-types/components/style-book/types.d.ts.map +0 -1
- package/lib/inflate.js +0 -3333
- package/lib/lib-font.browser.js +0 -3861
- package/lib/unbrotli.js +0 -2039
- package/src/components/editor-canvas-container/index.js +0 -149
- package/src/components/editor-canvas-container/style.scss +0 -43
- package/src/components/global-styles/README.md +0 -17
- package/src/components/global-styles/background-panel.js +0 -55
- package/src/components/global-styles/block-preview-panel.js +0 -81
- package/src/components/global-styles/color-indicator-wrapper.js +0 -23
- package/src/components/global-styles/color-palette-panel.js +0 -110
- package/src/components/global-styles/confirm-reset-shadow-dialog.js +0 -37
- package/src/components/global-styles/dimensions-panel.js +0 -86
- package/src/components/global-styles/font-families.js +0 -128
- package/src/components/global-styles/font-family-item.js +0 -47
- package/src/components/global-styles/font-library-modal/collection-font-variant.js +0 -51
- package/src/components/global-styles/font-library-modal/context.js +0 -540
- package/src/components/global-styles/font-library-modal/font-card.js +0 -67
- package/src/components/global-styles/font-library-modal/font-collection.js +0 -575
- package/src/components/global-styles/font-library-modal/font-demo.js +0 -116
- package/src/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +0 -57
- package/src/components/global-styles/font-library-modal/index.js +0 -106
- package/src/components/global-styles/font-library-modal/installed-fonts.js +0 -518
- package/src/components/global-styles/font-library-modal/library-font-details.js +0 -45
- package/src/components/global-styles/font-library-modal/library-font-variant.js +0 -60
- package/src/components/global-styles/font-library-modal/resolvers.js +0 -78
- package/src/components/global-styles/font-library-modal/style.scss +0 -220
- package/src/components/global-styles/font-library-modal/upload-fonts.js +0 -253
- package/src/components/global-styles/font-library-modal/utils/constants.js +0 -23
- package/src/components/global-styles/font-library-modal/utils/filter-fonts.js +0 -35
- package/src/components/global-styles/font-library-modal/utils/fonts-outline.js +0 -22
- package/src/components/global-styles/font-library-modal/utils/index.js +0 -333
- package/src/components/global-styles/font-library-modal/utils/make-families-from-faces.js +0 -27
- package/src/components/global-styles/font-library-modal/utils/preview-styles.js +0 -152
- package/src/components/global-styles/font-library-modal/utils/sort-font-faces.js +0 -37
- package/src/components/global-styles/font-library-modal/utils/test/filter-fonts.spec.js +0 -99
- package/src/components/global-styles/font-library-modal/utils/test/fonts-outline.spec.js +0 -109
- package/src/components/global-styles/font-library-modal/utils/test/getDisplaySrcFromFontFace.spec.js +0 -42
- package/src/components/global-styles/font-library-modal/utils/test/getFontFaceVariantName.spec.js +0 -30
- package/src/components/global-styles/font-library-modal/utils/test/isUrlEncoded.spec.js +0 -31
- package/src/components/global-styles/font-library-modal/utils/test/makeFamiliesFromFaces.spec.js +0 -57
- package/src/components/global-styles/font-library-modal/utils/test/mergeFontFaces.spec.js +0 -56
- package/src/components/global-styles/font-library-modal/utils/test/mergeFontFamilies.spec.js +0 -108
- package/src/components/global-styles/font-library-modal/utils/test/preview-styles.spec.js +0 -216
- package/src/components/global-styles/font-library-modal/utils/test/setUIValuesNeeded.spec.js +0 -41
- package/src/components/global-styles/font-library-modal/utils/test/sort-font-faces.js +0 -74
- package/src/components/global-styles/font-library-modal/utils/test/toggleFont.spec.js +0 -141
- package/src/components/global-styles/font-library-modal/utils/toggleFont.js +0 -90
- package/src/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js +0 -43
- package/src/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js +0 -37
- package/src/components/global-styles/font-sizes/font-size-preview.js +0 -43
- package/src/components/global-styles/font-sizes/font-size.js +0 -265
- package/src/components/global-styles/font-sizes/font-sizes-count.js +0 -37
- package/src/components/global-styles/font-sizes/font-sizes.js +0 -261
- package/src/components/global-styles/font-sizes/rename-font-size-dialog.js +0 -70
- package/src/components/global-styles/gradients-palette-panel.js +0 -123
- package/src/components/global-styles/header.js +0 -48
- package/src/components/global-styles/highlighted-colors.js +0 -39
- package/src/components/global-styles/hooks.js +0 -111
- package/src/components/global-styles/icon-with-current-color.js +0 -21
- package/src/components/global-styles/index.js +0 -1
- package/src/components/global-styles/navigation-button.js +0 -38
- package/src/components/global-styles/palette.js +0 -90
- package/src/components/global-styles/preset-colors.js +0 -18
- package/src/components/global-styles/preview-colors.js +0 -58
- package/src/components/global-styles/preview-styles.js +0 -185
- package/src/components/global-styles/preview-typography.js +0 -39
- package/src/components/global-styles/preview-wrapper.js +0 -126
- package/src/components/global-styles/root-menu.js +0 -84
- package/src/components/global-styles/screen-background.js +0 -37
- package/src/components/global-styles/screen-block-list.js +0 -187
- package/src/components/global-styles/screen-block.js +0 -358
- package/src/components/global-styles/screen-color-palette.js +0 -42
- package/src/components/global-styles/screen-colors.js +0 -55
- package/src/components/global-styles/screen-css.js +0 -67
- package/src/components/global-styles/screen-layout.js +0 -30
- package/src/components/global-styles/screen-revisions/index.js +0 -202
- package/src/components/global-styles/screen-revisions/revisions-buttons.js +0 -238
- package/src/components/global-styles/screen-revisions/style.scss +0 -194
- package/src/components/global-styles/screen-revisions/test/use-global-styles-revisions.js +0 -228
- package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +0 -159
- package/src/components/global-styles/screen-root.js +0 -102
- package/src/components/global-styles/screen-shadows.js +0 -13
- package/src/components/global-styles/screen-style-variations.js +0 -52
- package/src/components/global-styles/screen-typography-element.js +0 -121
- package/src/components/global-styles/screen-typography.js +0 -45
- package/src/components/global-styles/shadow-utils.js +0 -158
- package/src/components/global-styles/shadows-edit-panel.js +0 -525
- package/src/components/global-styles/shadows-panel.js +0 -196
- package/src/components/global-styles/size-control/index.js +0 -89
- package/src/components/global-styles/stories/index.story.js +0 -427
- package/src/components/global-styles/style-variations-container.js +0 -132
- package/src/components/global-styles/style.scss +0 -265
- package/src/components/global-styles/subtitle.js +0 -17
- package/src/components/global-styles/test/shadow-utils.spec.js +0 -251
- package/src/components/global-styles/test/utils.spec.js +0 -59
- package/src/components/global-styles/typeset.js +0 -73
- package/src/components/global-styles/typography-elements.js +0 -102
- package/src/components/global-styles/typography-example.js +0 -76
- package/src/components/global-styles/typography-panel.js +0 -54
- package/src/components/global-styles/typography-preview.js +0 -70
- package/src/components/global-styles/ui.js +0 -448
- package/src/components/global-styles/utils.js +0 -88
- package/src/components/global-styles/variations/style.scss +0 -43
- package/src/components/global-styles/variations/variation.js +0 -108
- package/src/components/global-styles/variations/variations-color.js +0 -45
- package/src/components/global-styles/variations/variations-panel.js +0 -65
- package/src/components/global-styles/variations/variations-typography.js +0 -54
- package/src/components/global-styles-renderer/index.js +0 -42
- package/src/components/global-styles-sidebar/default-sidebar.js +0 -51
- package/src/components/global-styles-sidebar/index.js +0 -206
- package/src/components/global-styles-sidebar/style.scss +0 -80
- package/src/components/revisions/index.js +0 -109
- package/src/components/style-book/categories.ts +0 -97
- package/src/components/style-book/color-examples.tsx +0 -57
- package/src/components/style-book/constants.ts +0 -308
- package/src/components/style-book/duotone-examples.tsx +0 -57
- package/src/components/style-book/examples.tsx +0 -273
- package/src/components/style-book/index.js +0 -804
- package/src/components/style-book/style.scss +0 -44
- package/src/components/style-book/test/categories.js +0 -166
- package/src/components/style-book/types.ts +0 -80
- package/src/components/welcome-guide/styles.js +0 -139
- package/src/hooks/index.js +0 -4
- package/src/hooks/push-changes-to-global-styles/index.js +0 -388
- package/src/hooks/push-changes-to-global-styles/style.scss +0 -4
- package/src/hooks/use-theme-style-variations/test/use-theme-style-variations-by-property.js +0 -271
- package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +0 -175
- package/src/utils/set-nested-value.js +0 -39
- package/tsconfig.tsbuildinfo +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/page-templates/fields.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tIcon,\n\t__experimentalHStack as HStack,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport { useState, useMemo } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { parse } from '@wordpress/blocks';\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA6EG;AA1EH,kBAAiB;AAKjB,wBAIO;AACP,kBAAuB;AACvB,qBAAkC;AAClC,2BAA+B;AAC/B,oBAAsB;AACtB,
|
|
6
|
-
"names": ["
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tIcon,\n\t__experimentalHStack as HStack,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport { useState, useMemo } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { parse } from '@wordpress/blocks';\nimport { BlockPreview } from '@wordpress/block-editor';\nimport {\n\tEditorProvider,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport {\n\tprivateApis as corePrivateApis,\n\tstore as coreStore,\n} from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useAddedBy } from './hooks';\nimport { useDefaultTemplateTypes } from '../add-new-template/utils';\nimport usePatternSettings from '../page-patterns/use-pattern-settings';\nimport { unlock } from '../../lock-unlock';\n\nconst { Badge } = unlock( componentsPrivateApis );\nconst { useEntityRecordsWithPermissions } = unlock( corePrivateApis );\nconst { useStyle } = unlock( editorPrivateApis );\n\nfunction useAllDefaultTemplateTypes() {\n\tconst defaultTemplateTypes = useDefaultTemplateTypes();\n\tconst { records: staticRecords } = useEntityRecordsWithPermissions(\n\t\t'root',\n\t\t'registeredTemplate'\n\t);\n\treturn [\n\t\t...defaultTemplateTypes,\n\t\t...staticRecords\n\t\t\t?.filter( ( record ) => ! record.is_custom )\n\t\t\t.map( ( record ) => {\n\t\t\t\treturn {\n\t\t\t\t\tslug: record.slug,\n\t\t\t\t\ttitle: record.title.rendered,\n\t\t\t\t\tdescription: record.description,\n\t\t\t\t};\n\t\t\t} ),\n\t];\n}\n\nfunction PreviewField( { item } ) {\n\tconst settings = usePatternSettings();\n\tconst backgroundColor = useStyle( 'color.background' ) ?? 'white';\n\tconst blocks = useMemo( () => {\n\t\treturn parse( item.content.raw );\n\t}, [ item.content.raw ] );\n\n\tconst isEmpty = ! blocks?.length;\n\t// Wrap everything in a block editor provider to ensure 'styles' that are needed\n\t// for the previews are synced between the site editor store and the block editor store.\n\t// Additionally we need to have the `__experimentalBlockPatterns` setting in order to\n\t// render patterns inside the previews.\n\t// TODO: Same approach is used in the patterns list and it becomes obvious that some of\n\t// the block editor settings are needed in context where we don't have the block editor.\n\t// Explore how we can solve this in a better way.\n\treturn (\n\t\t<EditorProvider post={ item } settings={ settings }>\n\t\t\t<div\n\t\t\t\tclassName=\"page-templates-preview-field\"\n\t\t\t\tstyle={ { backgroundColor } }\n\t\t\t>\n\t\t\t\t{ isEmpty && __( 'Empty template' ) }\n\t\t\t\t{ ! isEmpty && (\n\t\t\t\t\t<BlockPreview.Async>\n\t\t\t\t\t\t<BlockPreview blocks={ blocks } />\n\t\t\t\t\t</BlockPreview.Async>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</EditorProvider>\n\t);\n}\n\nexport const previewField = {\n\tlabel: __( 'Preview' ),\n\tid: 'preview',\n\trender: PreviewField,\n\tenableSorting: false,\n};\n\nexport const descriptionField = {\n\tlabel: __( 'Description' ),\n\tid: 'description',\n\trender: function RenderDescription( { item } ) {\n\t\tconst defaultTemplateTypes = useAllDefaultTemplateTypes();\n\t\tconst defaultTemplateType = defaultTemplateTypes.find(\n\t\t\t( type ) => type.slug === item.slug\n\t\t);\n\t\treturn item.description\n\t\t\t? decodeEntities( item.description )\n\t\t\t: defaultTemplateType?.description;\n\t},\n\tenableSorting: false,\n\tenableGlobalSearch: true,\n};\n\nfunction AuthorField( { item } ) {\n\tconst [ isImageLoaded, setIsImageLoaded ] = useState( false );\n\tconst { text, icon, imageUrl } = useAddedBy( item.type, item.id );\n\n\treturn (\n\t\t<HStack alignment=\"left\" spacing={ 0 }>\n\t\t\t{ imageUrl && (\n\t\t\t\t<div\n\t\t\t\t\tclassName={ clsx( 'page-templates-author-field__avatar', {\n\t\t\t\t\t\t'is-loaded': isImageLoaded,\n\t\t\t\t\t} ) }\n\t\t\t\t>\n\t\t\t\t\t<img\n\t\t\t\t\t\tonLoad={ () => setIsImageLoaded( true ) }\n\t\t\t\t\t\talt=\"\"\n\t\t\t\t\t\tsrc={ imageUrl }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t{ ! imageUrl && (\n\t\t\t\t<div className=\"page-templates-author-field__icon\">\n\t\t\t\t\t<Icon icon={ icon } />\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<span className=\"page-templates-author-field__name\">{ text }</span>\n\t\t</HStack>\n\t);\n}\n\nexport const authorField = {\n\tlabel: __( 'Author' ),\n\tid: 'author',\n\tgetValue: ( { item } ) => item.author_text ?? item.author,\n\trender: AuthorField,\n};\n\nexport const activeField = {\n\tlabel: __( 'Status' ),\n\tid: 'active',\n\ttype: 'boolean',\n\tgetValue: ( { item } ) => item._isActive,\n\trender: function Render( { item } ) {\n\t\tconst activeLabel = item._isCustom\n\t\t\t? __( 'Active when used' )\n\t\t\t: __( 'Active' );\n\t\tconst activeIntent = item._isCustom ? 'info' : 'success';\n\t\tconst isActive = item._isActive;\n\t\treturn (\n\t\t\t<Badge intent={ isActive ? activeIntent : 'default' }>\n\t\t\t\t{ isActive ? activeLabel : __( 'Inactive' ) }\n\t\t\t</Badge>\n\t\t);\n\t},\n};\n\nexport const useThemeField = () => {\n\tconst activeTheme = useSelect( ( select ) =>\n\t\tselect( coreStore ).getCurrentTheme()\n\t);\n\treturn useMemo(\n\t\t() => ( {\n\t\t\tlabel: __( 'Compatible Theme' ),\n\t\t\tid: 'theme',\n\t\t\tgetValue: ( { item } ) => item.theme,\n\t\t\trender: function Render( { item } ) {\n\t\t\t\tif ( item.theme === activeTheme.stylesheet ) {\n\t\t\t\t\treturn <Badge intent=\"success\">{ item.theme }</Badge>;\n\t\t\t\t}\n\t\t\t\treturn <Badge intent=\"error\">{ item.theme }</Badge>;\n\t\t\t},\n\t\t} ),\n\t\t[ activeTheme ]\n\t);\n};\n\nexport const slugField = {\n\tlabel: __( 'Template Type' ),\n\tid: 'slug',\n\tgetValue: ( { item } ) => item.slug,\n\trender: function Render( { item } ) {\n\t\tconst defaultTemplateTypes = useAllDefaultTemplateTypes();\n\t\tconst defaultTemplateType = defaultTemplateTypes.find(\n\t\t\t( type ) => type.slug === item.slug\n\t\t);\n\t\treturn defaultTemplateType?.title || _x( 'Custom', 'template type' );\n\t},\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA6EG;AA1EH,kBAAiB;AAKjB,wBAIO;AACP,kBAAuB;AACvB,qBAAkC;AAClC,2BAA+B;AAC/B,oBAAsB;AACtB,0BAA6B;AAC7B,oBAGO;AACP,uBAGO;AACP,kBAA0B;AAK1B,mBAA2B;AAC3B,mBAAwC;AACxC,kCAA+B;AAC/B,yBAAuB;AAEvB,MAAM,EAAE,MAAM,QAAI,2BAAQ,kBAAAA,WAAsB;AAChD,MAAM,EAAE,gCAAgC,QAAI,2BAAQ,iBAAAC,WAAgB;AACpE,MAAM,EAAE,SAAS,QAAI,2BAAQ,cAAAC,WAAkB;AAE/C,SAAS,6BAA6B;AACrC,QAAM,2BAAuB,sCAAwB;AACrD,QAAM,EAAE,SAAS,cAAc,IAAI;AAAA,IAClC;AAAA,IACA;AAAA,EACD;AACA,SAAO;AAAA,IACN,GAAG;AAAA,IACH,GAAG,eACA,OAAQ,CAAE,WAAY,CAAE,OAAO,SAAU,EAC1C,IAAK,CAAE,WAAY;AACnB,aAAO;AAAA,QACN,MAAM,OAAO;AAAA,QACb,OAAO,OAAO,MAAM;AAAA,QACpB,aAAa,OAAO;AAAA,MACrB;AAAA,IACD,CAAE;AAAA,EACJ;AACD;AAEA,SAAS,aAAc,EAAE,KAAK,GAAI;AACjC,QAAM,eAAW,4BAAAC,SAAmB;AACpC,QAAM,kBAAkB,SAAU,kBAAmB,KAAK;AAC1D,QAAM,aAAS,wBAAS,MAAM;AAC7B,eAAO,qBAAO,KAAK,QAAQ,GAAI;AAAA,EAChC,GAAG,CAAE,KAAK,QAAQ,GAAI,CAAE;AAExB,QAAM,UAAU,CAAE,QAAQ;AAQ1B,SACC,4CAAC,gCAAe,MAAO,MAAO,UAC7B;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV,OAAQ,EAAE,gBAAgB;AAAA,MAExB;AAAA,uBAAW,gBAAI,gBAAiB;AAAA,QAChC,CAAE,WACH,4CAAC,iCAAa,OAAb,EACA,sDAAC,oCAAa,QAAkB,GACjC;AAAA;AAAA;AAAA,EAEF,GACD;AAEF;AAEO,MAAM,eAAe;AAAA,EAC3B,WAAO,gBAAI,SAAU;AAAA,EACrB,IAAI;AAAA,EACJ,QAAQ;AAAA,EACR,eAAe;AAChB;AAEO,MAAM,mBAAmB;AAAA,EAC/B,WAAO,gBAAI,aAAc;AAAA,EACzB,IAAI;AAAA,EACJ,QAAQ,SAAS,kBAAmB,EAAE,KAAK,GAAI;AAC9C,UAAM,uBAAuB,2BAA2B;AACxD,UAAM,sBAAsB,qBAAqB;AAAA,MAChD,CAAE,SAAU,KAAK,SAAS,KAAK;AAAA,IAChC;AACA,WAAO,KAAK,kBACT,qCAAgB,KAAK,WAAY,IACjC,qBAAqB;AAAA,EACzB;AAAA,EACA,eAAe;AAAA,EACf,oBAAoB;AACrB;AAEA,SAAS,YAAa,EAAE,KAAK,GAAI;AAChC,QAAM,CAAE,eAAe,gBAAiB,QAAI,yBAAU,KAAM;AAC5D,QAAM,EAAE,MAAM,MAAM,SAAS,QAAI,yBAAY,KAAK,MAAM,KAAK,EAAG;AAEhE,SACC,6CAAC,kBAAAC,sBAAA,EAAO,WAAU,QAAO,SAAU,GAChC;AAAA,gBACD;AAAA,MAAC;AAAA;AAAA,QACA,eAAY,YAAAC,SAAM,uCAAuC;AAAA,UACxD,aAAa;AAAA,QACd,CAAE;AAAA,QAEF;AAAA,UAAC;AAAA;AAAA,YACA,QAAS,MAAM,iBAAkB,IAAK;AAAA,YACtC,KAAI;AAAA,YACJ,KAAM;AAAA;AAAA,QACP;AAAA;AAAA,IACD;AAAA,IAEC,CAAE,YACH,4CAAC,SAAI,WAAU,qCACd,sDAAC,0BAAK,MAAc,GACrB;AAAA,IAED,4CAAC,UAAK,WAAU,qCAAsC,gBAAM;AAAA,KAC7D;AAEF;AAEO,MAAM,cAAc;AAAA,EAC1B,WAAO,gBAAI,QAAS;AAAA,EACpB,IAAI;AAAA,EACJ,UAAU,CAAE,EAAE,KAAK,MAAO,KAAK,eAAe,KAAK;AAAA,EACnD,QAAQ;AACT;AAEO,MAAM,cAAc;AAAA,EAC1B,WAAO,gBAAI,QAAS;AAAA,EACpB,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,UAAU,CAAE,EAAE,KAAK,MAAO,KAAK;AAAA,EAC/B,QAAQ,SAAS,OAAQ,EAAE,KAAK,GAAI;AACnC,UAAM,cAAc,KAAK,gBACtB,gBAAI,kBAAmB,QACvB,gBAAI,QAAS;AAChB,UAAM,eAAe,KAAK,YAAY,SAAS;AAC/C,UAAM,WAAW,KAAK;AACtB,WACC,4CAAC,SAAM,QAAS,WAAW,eAAe,WACvC,qBAAW,kBAAc,gBAAI,UAAW,GAC3C;AAAA,EAEF;AACD;AAEO,MAAM,gBAAgB,MAAM;AAClC,QAAM,kBAAc;AAAA,IAAW,CAAE,WAChC,OAAQ,iBAAAC,KAAU,EAAE,gBAAgB;AAAA,EACrC;AACA,aAAO;AAAA,IACN,OAAQ;AAAA,MACP,WAAO,gBAAI,kBAAmB;AAAA,MAC9B,IAAI;AAAA,MACJ,UAAU,CAAE,EAAE,KAAK,MAAO,KAAK;AAAA,MAC/B,QAAQ,SAASC,QAAQ,EAAE,KAAK,GAAI;AACnC,YAAK,KAAK,UAAU,YAAY,YAAa;AAC5C,iBAAO,4CAAC,SAAM,QAAO,WAAY,eAAK,OAAO;AAAA,QAC9C;AACA,eAAO,4CAAC,SAAM,QAAO,SAAU,eAAK,OAAO;AAAA,MAC5C;AAAA,IACD;AAAA,IACA,CAAE,WAAY;AAAA,EACf;AACD;AAEO,MAAM,YAAY;AAAA,EACxB,WAAO,gBAAI,eAAgB;AAAA,EAC3B,IAAI;AAAA,EACJ,UAAU,CAAE,EAAE,KAAK,MAAO,KAAK;AAAA,EAC/B,QAAQ,SAASA,QAAQ,EAAE,KAAK,GAAI;AACnC,UAAM,uBAAuB,2BAA2B;AACxD,UAAM,sBAAsB,qBAAqB;AAAA,MAChD,CAAE,SAAU,KAAK,SAAS,KAAK;AAAA,IAChC;AACA,WAAO,qBAAqB,aAAS,gBAAI,UAAU,eAAgB;AAAA,EACpE;AACD;",
|
|
6
|
+
"names": ["componentsPrivateApis", "corePrivateApis", "editorPrivateApis", "usePatternSettings", "HStack", "clsx", "coreStore", "Render"]
|
|
7
7
|
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,47 +15,33 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
31
|
-
default: () =>
|
|
19
|
+
var sidebar_global_styles_exports = {};
|
|
20
|
+
__export(sidebar_global_styles_exports, {
|
|
21
|
+
default: () => SidebarGlobalStyles,
|
|
32
22
|
useSection: () => useSection
|
|
33
23
|
});
|
|
34
|
-
module.exports = __toCommonJS(
|
|
24
|
+
module.exports = __toCommonJS(sidebar_global_styles_exports);
|
|
35
25
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
26
|
var import_admin_ui = require("@wordpress/admin-ui");
|
|
37
27
|
var import_i18n = require("@wordpress/i18n");
|
|
38
|
-
var import_data = require("@wordpress/data");
|
|
39
|
-
var import_core_data = require("@wordpress/core-data");
|
|
40
28
|
var import_element = require("@wordpress/element");
|
|
41
29
|
var import_router = require("@wordpress/router");
|
|
30
|
+
var import_editor = require("@wordpress/editor");
|
|
42
31
|
var import_compose = require("@wordpress/compose");
|
|
43
32
|
var import_components = require("@wordpress/components");
|
|
44
33
|
var import_url = require("@wordpress/url");
|
|
45
34
|
var import_icons = require("@wordpress/icons");
|
|
46
|
-
var import_ui = __toESM(require("../global-styles/ui"));
|
|
47
35
|
var import_lock_unlock = require("../../lock-unlock");
|
|
36
|
+
const { GlobalStylesUIWrapper, GlobalStylesActionMenu } = (0, import_lock_unlock.unlock)(import_editor.privateApis);
|
|
48
37
|
const { useLocation, useHistory } = (0, import_lock_unlock.unlock)(import_router.privateApis);
|
|
49
38
|
const GlobalStylesPageActions = ({
|
|
50
39
|
isStyleBookOpened,
|
|
51
40
|
setIsStyleBookOpened,
|
|
52
|
-
path
|
|
41
|
+
path,
|
|
42
|
+
onChangeSection
|
|
53
43
|
}) => {
|
|
54
44
|
const history = useHistory();
|
|
55
|
-
const canEditCSS = (0, import_data.useSelect)((select) => {
|
|
56
|
-
const { getEntityRecord, __experimentalGetCurrentGlobalStylesId } = select(import_core_data.store);
|
|
57
|
-
const globalStylesId = __experimentalGetCurrentGlobalStylesId();
|
|
58
|
-
const globalStyles = globalStylesId ? getEntityRecord("root", "globalStyles", globalStylesId) : void 0;
|
|
59
|
-
return !!globalStyles?._links?.["wp:action-edit-css"];
|
|
60
|
-
}, []);
|
|
61
45
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalHStack, { children: [
|
|
62
46
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
63
47
|
import_components.Button,
|
|
@@ -73,26 +57,11 @@ const GlobalStylesPageActions = ({
|
|
|
73
57
|
size: "compact"
|
|
74
58
|
}
|
|
75
59
|
),
|
|
76
|
-
|
|
77
|
-
|
|
60
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
61
|
+
GlobalStylesActionMenu,
|
|
78
62
|
{
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
toggleProps: { size: "compact" },
|
|
82
|
-
children: ({ onClose }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.MenuGroup, { children: canEditCSS && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
83
|
-
import_components.MenuItem,
|
|
84
|
-
{
|
|
85
|
-
onClick: () => {
|
|
86
|
-
onClose();
|
|
87
|
-
history.navigate(
|
|
88
|
-
(0, import_url.addQueryArgs)(path, {
|
|
89
|
-
section: "/css"
|
|
90
|
-
})
|
|
91
|
-
);
|
|
92
|
-
},
|
|
93
|
-
children: (0, import_i18n.__)("Additional CSS")
|
|
94
|
-
}
|
|
95
|
-
) })
|
|
63
|
+
hideWelcomeGuide: true,
|
|
64
|
+
onChangePath: onChangeSection
|
|
96
65
|
}
|
|
97
66
|
)
|
|
98
67
|
] });
|
|
@@ -113,7 +82,7 @@ const useSection = () => {
|
|
|
113
82
|
];
|
|
114
83
|
}, [path, query.section, history]);
|
|
115
84
|
};
|
|
116
|
-
function
|
|
85
|
+
function SidebarGlobalStyles() {
|
|
117
86
|
const { path } = useLocation();
|
|
118
87
|
const [isStyleBookOpened, setIsStyleBookOpened] = (0, import_element.useState)(
|
|
119
88
|
path.includes("preview=stylebook")
|
|
@@ -128,12 +97,19 @@ function GlobalStylesUIWrapper() {
|
|
|
128
97
|
{
|
|
129
98
|
isStyleBookOpened,
|
|
130
99
|
setIsStyleBookOpened,
|
|
131
|
-
path
|
|
100
|
+
path,
|
|
101
|
+
onChangeSection
|
|
132
102
|
}
|
|
133
103
|
) : null,
|
|
134
104
|
className: "edit-site-styles",
|
|
135
105
|
title: (0, import_i18n.__)("Styles"),
|
|
136
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
106
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
107
|
+
GlobalStylesUIWrapper,
|
|
108
|
+
{
|
|
109
|
+
path: section,
|
|
110
|
+
onPathChange: onChangeSection
|
|
111
|
+
}
|
|
112
|
+
)
|
|
137
113
|
}
|
|
138
114
|
);
|
|
139
115
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/sidebar-global-styles/index.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { Page } from '@wordpress/admin-ui';\nimport { __ } from '@wordpress/i18n';\nimport { useMemo, useState } from '@wordpress/element';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { Button, __experimentalHStack as HStack } from '@wordpress/components';\nimport { addQueryArgs, removeQueryArgs } from '@wordpress/url';\nimport { seen } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { GlobalStylesUIWrapper, GlobalStylesActionMenu } =\n\tunlock( editorPrivateApis );\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\n\nconst GlobalStylesPageActions = ( {\n\tisStyleBookOpened,\n\tsetIsStyleBookOpened,\n\tpath,\n\tonChangeSection,\n} ) => {\n\tconst history = useHistory();\n\n\treturn (\n\t\t<HStack>\n\t\t\t<Button\n\t\t\t\tisPressed={ isStyleBookOpened }\n\t\t\t\ticon={ seen }\n\t\t\t\tlabel={ __( 'Style Book' ) }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetIsStyleBookOpened( ! isStyleBookOpened );\n\t\t\t\t\tconst updatedPath = ! isStyleBookOpened\n\t\t\t\t\t\t? addQueryArgs( path, { preview: 'stylebook' } )\n\t\t\t\t\t\t: removeQueryArgs( path, 'preview' );\n\t\t\t\t\t// Navigate to the updated path.\n\t\t\t\t\thistory.navigate( updatedPath );\n\t\t\t\t} }\n\t\t\t\tsize=\"compact\"\n\t\t\t/>\n\t\t\t<GlobalStylesActionMenu\n\t\t\t\thideWelcomeGuide\n\t\t\t\tonChangePath={ onChangeSection }\n\t\t\t/>\n\t\t</HStack>\n\t);\n};\n\n/**\n * Hook to deal with navigation and location state.\n *\n * @return {Array} The current section and a function to update it.\n */\nexport const useSection = () => {\n\tconst { path, query } = useLocation();\n\tconst history = useHistory();\n\treturn useMemo( () => {\n\t\treturn [\n\t\t\tquery.section ?? '/',\n\t\t\t( updatedSection ) => {\n\t\t\t\thistory.navigate(\n\t\t\t\t\taddQueryArgs( path, {\n\t\t\t\t\t\tsection: updatedSection,\n\t\t\t\t\t} )\n\t\t\t\t);\n\t\t\t},\n\t\t];\n\t}, [ path, query.section, history ] );\n};\n\nexport default function SidebarGlobalStyles() {\n\tconst { path } = useLocation();\n\n\tconst [ isStyleBookOpened, setIsStyleBookOpened ] = useState(\n\t\tpath.includes( 'preview=stylebook' )\n\t);\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst [ section, onChangeSection ] = useSection();\n\n\treturn (\n\t\t<Page\n\t\t\tactions={\n\t\t\t\t! isMobileViewport ? (\n\t\t\t\t\t<GlobalStylesPageActions\n\t\t\t\t\t\tisStyleBookOpened={ isStyleBookOpened }\n\t\t\t\t\t\tsetIsStyleBookOpened={ setIsStyleBookOpened }\n\t\t\t\t\t\tpath={ path }\n\t\t\t\t\t\tonChangeSection={ onChangeSection }\n\t\t\t\t\t/>\n\t\t\t\t) : null\n\t\t\t}\n\t\t\tclassName=\"edit-site-styles\"\n\t\t\ttitle={ __( 'Styles' ) }\n\t\t>\n\t\t\t<GlobalStylesUIWrapper\n\t\t\t\tpath={ section }\n\t\t\t\tonPathChange={ onChangeSection }\n\t\t\t/>\n\t\t</Page>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+BE;AA5BF,sBAAqB;AACrB,kBAAmB;AACnB,qBAAkC;AAClC,oBAAiD;AACjD,oBAAiD;AACjD,qBAAiC;AACjC,wBAAuD;AACvD,iBAA8C;AAC9C,mBAAqB;AAKrB,yBAAuB;AAEvB,MAAM,EAAE,uBAAuB,uBAAuB,QACrD,2BAAQ,cAAAA,WAAkB;AAC3B,MAAM,EAAE,aAAa,WAAW,QAAI,2BAAQ,cAAAC,WAAkB;AAE9D,MAAM,0BAA0B,CAAE;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,MAAO;AACN,QAAM,UAAU,WAAW;AAE3B,SACC,6CAAC,kBAAAC,sBAAA,EACA;AAAA;AAAA,MAAC;AAAA;AAAA,QACA,WAAY;AAAA,QACZ,MAAO;AAAA,QACP,WAAQ,gBAAI,YAAa;AAAA,QACzB,SAAU,MAAM;AACf,+BAAsB,CAAE,iBAAkB;AAC1C,gBAAM,cAAc,CAAE,wBACnB,yBAAc,MAAM,EAAE,SAAS,YAAY,CAAE,QAC7C,4BAAiB,MAAM,SAAU;AAEpC,kBAAQ,SAAU,WAAY;AAAA,QAC/B;AAAA,QACA,MAAK;AAAA;AAAA,IACN;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACA,kBAAgB;AAAA,QAChB,cAAe;AAAA;AAAA,IAChB;AAAA,KACD;AAEF;AAOO,MAAM,aAAa,MAAM;AAC/B,QAAM,EAAE,MAAM,MAAM,IAAI,YAAY;AACpC,QAAM,UAAU,WAAW;AAC3B,aAAO,wBAAS,MAAM;AACrB,WAAO;AAAA,MACN,MAAM,WAAW;AAAA,MACjB,CAAE,mBAAoB;AACrB,gBAAQ;AAAA,cACP,yBAAc,MAAM;AAAA,YACnB,SAAS;AAAA,UACV,CAAE;AAAA,QACH;AAAA,MACD;AAAA,IACD;AAAA,EACD,GAAG,CAAE,MAAM,MAAM,SAAS,OAAQ,CAAE;AACrC;AAEe,SAAR,sBAAuC;AAC7C,QAAM,EAAE,KAAK,IAAI,YAAY;AAE7B,QAAM,CAAE,mBAAmB,oBAAqB,QAAI;AAAA,IACnD,KAAK,SAAU,mBAAoB;AAAA,EACpC;AACA,QAAM,uBAAmB,iCAAkB,UAAU,GAAI;AACzD,QAAM,CAAE,SAAS,eAAgB,IAAI,WAAW;AAEhD,SACC;AAAA,IAAC;AAAA;AAAA,MACA,SACC,CAAE,mBACD;AAAA,QAAC;AAAA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA;AAAA,MACD,IACG;AAAA,MAEL,WAAU;AAAA,MACV,WAAQ,gBAAI,QAAS;AAAA,MAErB;AAAA,QAAC;AAAA;AAAA,UACA,MAAO;AAAA,UACP,cAAe;AAAA;AAAA,MAChB;AAAA;AAAA,EACD;AAEF;",
|
|
6
|
+
"names": ["editorPrivateApis", "routerPrivateApis", "HStack"]
|
|
7
|
+
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
var content_exports = {};
|
|
30
20
|
__export(content_exports, {
|
|
@@ -34,20 +24,52 @@ module.exports = __toCommonJS(content_exports);
|
|
|
34
24
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
25
|
var import_i18n = require("@wordpress/i18n");
|
|
36
26
|
var import_components = require("@wordpress/components");
|
|
37
|
-
var
|
|
38
|
-
var
|
|
39
|
-
var
|
|
27
|
+
var import_global_styles_ui = require("@wordpress/global-styles-ui");
|
|
28
|
+
var import_editor = require("@wordpress/editor");
|
|
29
|
+
var import_lock_unlock = require("../../lock-unlock");
|
|
30
|
+
const { useGlobalStyles } = (0, import_lock_unlock.unlock)(import_editor.privateApis);
|
|
40
31
|
function SidebarNavigationScreenGlobalStylesContent() {
|
|
41
32
|
const gap = 3;
|
|
33
|
+
const {
|
|
34
|
+
user: userConfig,
|
|
35
|
+
base: baseConfig,
|
|
36
|
+
setUser: setUserConfig
|
|
37
|
+
} = useGlobalStyles();
|
|
42
38
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
43
39
|
import_components.__experimentalVStack,
|
|
44
40
|
{
|
|
45
41
|
spacing: 10,
|
|
46
42
|
className: "edit-site-global-styles-variation-container",
|
|
47
43
|
children: [
|
|
48
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
45
|
+
import_global_styles_ui.StyleVariations,
|
|
46
|
+
{
|
|
47
|
+
value: userConfig,
|
|
48
|
+
baseValue: baseConfig || {},
|
|
49
|
+
onChange: setUserConfig,
|
|
50
|
+
gap
|
|
51
|
+
}
|
|
52
|
+
),
|
|
53
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
54
|
+
import_global_styles_ui.ColorVariations,
|
|
55
|
+
{
|
|
56
|
+
value: userConfig,
|
|
57
|
+
baseValue: baseConfig || {},
|
|
58
|
+
onChange: setUserConfig,
|
|
59
|
+
title: (0, import_i18n.__)("Palettes"),
|
|
60
|
+
gap
|
|
61
|
+
}
|
|
62
|
+
),
|
|
63
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
64
|
+
import_global_styles_ui.TypographyVariations,
|
|
65
|
+
{
|
|
66
|
+
value: userConfig,
|
|
67
|
+
baseValue: baseConfig || {},
|
|
68
|
+
onChange: setUserConfig,
|
|
69
|
+
title: (0, import_i18n.__)("Typography"),
|
|
70
|
+
gap
|
|
71
|
+
}
|
|
72
|
+
)
|
|
51
73
|
]
|
|
52
74
|
}
|
|
53
75
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/sidebar-navigation-screen-global-styles/content.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { __experimentalVStack as VStack } from '@wordpress/components';\n\n
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { __experimentalVStack as VStack } from '@wordpress/components';\nimport {\n\tStyleVariations,\n\tColorVariations,\n\tTypographyVariations,\n} from '@wordpress/global-styles-ui';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { useGlobalStyles } = unlock( editorPrivateApis );\n\nexport default function SidebarNavigationScreenGlobalStylesContent() {\n\tconst gap = 3;\n\tconst {\n\t\tuser: userConfig,\n\t\tbase: baseConfig,\n\t\tsetUser: setUserConfig,\n\t} = useGlobalStyles();\n\n\treturn (\n\t\t<VStack\n\t\t\tspacing={ 10 }\n\t\t\tclassName=\"edit-site-global-styles-variation-container\"\n\t\t>\n\t\t\t<StyleVariations\n\t\t\t\tvalue={ userConfig }\n\t\t\t\tbaseValue={ baseConfig || {} }\n\t\t\t\tonChange={ setUserConfig }\n\t\t\t\tgap={ gap }\n\t\t\t/>\n\t\t\t<ColorVariations\n\t\t\t\tvalue={ userConfig }\n\t\t\t\tbaseValue={ baseConfig || {} }\n\t\t\t\tonChange={ setUserConfig }\n\t\t\t\ttitle={ __( 'Palettes' ) }\n\t\t\t\tgap={ gap }\n\t\t\t/>\n\t\t\t<TypographyVariations\n\t\t\t\tvalue={ userConfig }\n\t\t\t\tbaseValue={ baseConfig || {} }\n\t\t\t\tonChange={ setUserConfig }\n\t\t\t\ttitle={ __( 'Typography' ) }\n\t\t\t\tgap={ gap }\n\t\t\t/>\n\t\t</VStack>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA4BE;AAzBF,kBAAmB;AACnB,wBAA+C;AAC/C,8BAIO;AACP,oBAAiD;AAKjD,yBAAuB;AAEvB,MAAM,EAAE,gBAAgB,QAAI,2BAAQ,cAAAA,WAAkB;AAEvC,SAAR,6CAA8D;AACpE,QAAM,MAAM;AACZ,QAAM;AAAA,IACL,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,EACV,IAAI,gBAAgB;AAEpB,SACC;AAAA,IAAC,kBAAAC;AAAA,IAAA;AAAA,MACA,SAAU;AAAA,MACV,WAAU;AAAA,MAEV;AAAA;AAAA,UAAC;AAAA;AAAA,YACA,OAAQ;AAAA,YACR,WAAY,cAAc,CAAC;AAAA,YAC3B,UAAW;AAAA,YACX;AAAA;AAAA,QACD;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACA,OAAQ;AAAA,YACR,WAAY,cAAc,CAAC;AAAA,YAC3B,UAAW;AAAA,YACX,WAAQ,gBAAI,UAAW;AAAA,YACvB;AAAA;AAAA,QACD;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACA,OAAQ;AAAA,YACR,WAAY,cAAc,CAAC;AAAA,YAC3B,UAAW;AAAA,YACX,WAAQ,gBAAI,YAAa;AAAA,YACzB;AAAA;AAAA,QACD;AAAA;AAAA;AAAA,EACD;AAEF;",
|
|
6
|
+
"names": ["editorPrivateApis", "VStack"]
|
|
7
7
|
}
|
|
@@ -37,13 +37,14 @@ var import_i18n = require("@wordpress/i18n");
|
|
|
37
37
|
var import_data = require("@wordpress/data");
|
|
38
38
|
var import_element = require("@wordpress/element");
|
|
39
39
|
var import_preferences = require("@wordpress/preferences");
|
|
40
|
+
var import_editor = require("@wordpress/editor");
|
|
40
41
|
var import_router = require("@wordpress/router");
|
|
41
42
|
var import_url = require("@wordpress/url");
|
|
42
43
|
var import_sidebar_navigation_screen = __toESM(require("../sidebar-navigation-screen"));
|
|
43
44
|
var import_lock_unlock = require("../../lock-unlock");
|
|
44
45
|
var import_store = require("../../store");
|
|
45
46
|
var import_sidebar_navigation_item = __toESM(require("../sidebar-navigation-item"));
|
|
46
|
-
var
|
|
47
|
+
var import_global_styles_ui = require("@wordpress/global-styles-ui");
|
|
47
48
|
var import_sidebar_navigation_screen_details_footer = __toESM(require("../sidebar-navigation-screen-details-footer"));
|
|
48
49
|
var import_sidebar_navigation_screen_main = require("../sidebar-navigation-screen-main");
|
|
49
50
|
const { useLocation, useHistory } = (0, import_lock_unlock.unlock)(import_router.privateApis);
|
|
@@ -64,11 +65,9 @@ function SidebarNavigationScreenGlobalStyles() {
|
|
|
64
65
|
revisions,
|
|
65
66
|
isLoading: isLoadingRevisions,
|
|
66
67
|
revisionsCount
|
|
67
|
-
} = (0,
|
|
68
|
+
} = (0, import_global_styles_ui.useGlobalStylesRevisions)();
|
|
68
69
|
const { openGeneralSidebar } = (0, import_data.useDispatch)(import_store.store);
|
|
69
|
-
const {
|
|
70
|
-
(0, import_data.useDispatch)(import_store.store)
|
|
71
|
-
);
|
|
70
|
+
const { setStylesPath } = (0, import_lock_unlock.unlock)((0, import_data.useDispatch)(import_editor.store));
|
|
72
71
|
const { set: setPreference } = (0, import_data.useDispatch)(import_preferences.store);
|
|
73
72
|
const openGlobalStyles = (0, import_element.useCallback)(async () => {
|
|
74
73
|
history.navigate((0, import_url.addQueryArgs)(path, { canvas: "edit" }), {
|
|
@@ -81,8 +80,8 @@ function SidebarNavigationScreenGlobalStyles() {
|
|
|
81
80
|
}, [path, history, openGeneralSidebar, setPreference]);
|
|
82
81
|
const openRevisions = (0, import_element.useCallback)(async () => {
|
|
83
82
|
await openGlobalStyles();
|
|
84
|
-
|
|
85
|
-
}, [openGlobalStyles,
|
|
83
|
+
setStylesPath("/revisions");
|
|
84
|
+
}, [openGlobalStyles, setStylesPath]);
|
|
86
85
|
const shouldShowGlobalStylesFooter = !!revisionsCount && !isLoadingRevisions;
|
|
87
86
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
88
87
|
import_sidebar_navigation_screen.default,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/sidebar-navigation-screen-global-styles/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport { useCallback } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport useGlobalStylesRevisions from '
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
6
|
-
"names": ["routerPrivateApis", "SidebarNavigationItem", "
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport { useCallback } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as editorStore } from '@wordpress/editor';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { useGlobalStylesRevisions } from '@wordpress/global-styles-ui';\nimport SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer';\nimport { MainSidebarNavigationContent } from '../sidebar-navigation-screen-main';\n\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\n\nexport function SidebarNavigationItemGlobalStyles( props ) {\n\tconst { name } = useLocation();\n\treturn (\n\t\t<SidebarNavigationItem\n\t\t\t{ ...props }\n\t\t\taria-current={ name === 'styles' }\n\t\t/>\n\t);\n}\n\nexport default function SidebarNavigationScreenGlobalStyles() {\n\tconst history = useHistory();\n\tconst { path } = useLocation();\n\tconst {\n\t\trevisions,\n\t\tisLoading: isLoadingRevisions,\n\t\trevisionsCount,\n\t} = useGlobalStylesRevisions();\n\tconst { openGeneralSidebar } = useDispatch( editSiteStore );\n\tconst { setStylesPath } = unlock( useDispatch( editorStore ) );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst openGlobalStyles = useCallback( async () => {\n\t\thistory.navigate( addQueryArgs( path, { canvas: 'edit' } ), {\n\t\t\ttransition: 'canvas-mode-edit-transition',\n\t\t} );\n\t\treturn Promise.all( [\n\t\t\tsetPreference( 'core', 'distractionFree', false ),\n\t\t\topenGeneralSidebar( 'edit-site/global-styles' ),\n\t\t] );\n\t}, [ path, history, openGeneralSidebar, setPreference ] );\n\n\tconst openRevisions = useCallback( async () => {\n\t\tawait openGlobalStyles();\n\t\t// Open the global styles revisions once the canvas mode is set to edit,\n\t\t// and the global styles sidebar is open. Set the path to revisions.\n\t\tsetStylesPath( '/revisions' );\n\t}, [ openGlobalStyles, setStylesPath ] );\n\n\t// If there are no revisions, do not render a footer.\n\tconst shouldShowGlobalStylesFooter =\n\t\t!! revisionsCount && ! isLoadingRevisions;\n\n\treturn (\n\t\t<>\n\t\t\t<SidebarNavigationScreen\n\t\t\t\ttitle={ __( 'Design' ) }\n\t\t\t\tisRoot\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Customize the appearance of your website using the block editor.'\n\t\t\t\t) }\n\t\t\t\tcontent={\n\t\t\t\t\t<MainSidebarNavigationContent activeItem=\"styles-navigation-item\" />\n\t\t\t\t}\n\t\t\t\tfooter={\n\t\t\t\t\tshouldShowGlobalStylesFooter && (\n\t\t\t\t\t\t<SidebarNavigationScreenDetailsFooter\n\t\t\t\t\t\t\trecord={ revisions?.[ 0 ] }\n\t\t\t\t\t\t\trevisionsCount={ revisionsCount }\n\t\t\t\t\t\t\tonClick={ openRevisions }\n\t\t\t\t\t\t/>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t/>\n\t\t</>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA2BE;AAxBF,kBAAmB;AACnB,kBAA4B;AAC5B,qBAA4B;AAC5B,yBAA0C;AAC1C,oBAAqC;AACrC,oBAAiD;AACjD,iBAA6B;AAK7B,uCAAoC;AACpC,yBAAuB;AACvB,mBAAuC;AACvC,qCAAkC;AAClC,8BAAyC;AACzC,sDAAiD;AACjD,4CAA6C;AAE7C,MAAM,EAAE,aAAa,WAAW,QAAI,2BAAQ,cAAAA,WAAkB;AAEvD,SAAS,kCAAmC,OAAQ;AAC1D,QAAM,EAAE,KAAK,IAAI,YAAY;AAC7B,SACC;AAAA,IAAC,+BAAAC;AAAA,IAAA;AAAA,MACE,GAAG;AAAA,MACL,gBAAe,SAAS;AAAA;AAAA,EACzB;AAEF;AAEe,SAAR,sCAAuD;AAC7D,QAAM,UAAU,WAAW;AAC3B,QAAM,EAAE,KAAK,IAAI,YAAY;AAC7B,QAAM;AAAA,IACL;AAAA,IACA,WAAW;AAAA,IACX;AAAA,EACD,QAAI,kDAAyB;AAC7B,QAAM,EAAE,mBAAmB,QAAI,yBAAa,aAAAC,KAAc;AAC1D,QAAM,EAAE,cAAc,QAAI,+BAAQ,yBAAa,cAAAC,KAAY,CAAE;AAC7D,QAAM,EAAE,KAAK,cAAc,QAAI,yBAAa,mBAAAC,KAAiB;AAE7D,QAAM,uBAAmB,4BAAa,YAAY;AACjD,YAAQ,aAAU,yBAAc,MAAM,EAAE,QAAQ,OAAO,CAAE,GAAG;AAAA,MAC3D,YAAY;AAAA,IACb,CAAE;AACF,WAAO,QAAQ,IAAK;AAAA,MACnB,cAAe,QAAQ,mBAAmB,KAAM;AAAA,MAChD,mBAAoB,yBAA0B;AAAA,IAC/C,CAAE;AAAA,EACH,GAAG,CAAE,MAAM,SAAS,oBAAoB,aAAc,CAAE;AAExD,QAAM,oBAAgB,4BAAa,YAAY;AAC9C,UAAM,iBAAiB;AAGvB,kBAAe,YAAa;AAAA,EAC7B,GAAG,CAAE,kBAAkB,aAAc,CAAE;AAGvC,QAAM,+BACL,CAAC,CAAE,kBAAkB,CAAE;AAExB,SACC,2EACC;AAAA,IAAC,iCAAAC;AAAA,IAAA;AAAA,MACA,WAAQ,gBAAI,QAAS;AAAA,MACrB,QAAM;AAAA,MACN,iBAAc;AAAA,QACb;AAAA,MACD;AAAA,MACA,SACC,4CAAC,sEAA6B,YAAW,0BAAyB;AAAA,MAEnE,QACC,gCACC;AAAA,QAAC,gDAAAC;AAAA,QAAA;AAAA,UACA,QAAS,YAAa,CAAE;AAAA,UACxB;AAAA,UACA,SAAU;AAAA;AAAA,MACX;AAAA;AAAA,EAGH,GACD;AAEF;",
|
|
6
|
+
"names": ["routerPrivateApis", "SidebarNavigationItem", "editSiteStore", "editorStore", "preferencesStore", "SidebarNavigationScreen", "SidebarNavigationScreenDetailsFooter"]
|
|
7
7
|
}
|
|
@@ -37,13 +37,10 @@ var import_components = require("@wordpress/components");
|
|
|
37
37
|
var import_i18n = require("@wordpress/i18n");
|
|
38
38
|
var import_icons = require("@wordpress/icons");
|
|
39
39
|
var import_data = require("@wordpress/data");
|
|
40
|
-
var import_element = require("@wordpress/element");
|
|
41
40
|
var import_core_data = require("@wordpress/core-data");
|
|
42
41
|
var import_sidebar_navigation_screen = __toESM(require("../sidebar-navigation-screen"));
|
|
43
42
|
var import_sidebar_navigation_item = __toESM(require("../sidebar-navigation-item"));
|
|
44
43
|
var import_sidebar_navigation_screen_global_styles = require("../sidebar-navigation-screen-global-styles");
|
|
45
|
-
var import_lock_unlock = require("../../lock-unlock");
|
|
46
|
-
var import_store = require("../../store");
|
|
47
44
|
function MainSidebarNavigationContent({ isBlockBasedTheme = true }) {
|
|
48
45
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalItemGroup, { className: "edit-site-sidebar-navigation-screen-main", children: [
|
|
49
46
|
isBlockBasedTheme && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
@@ -114,12 +111,6 @@ function SidebarNavigationScreenMain({ customDescription }) {
|
|
|
114
111
|
(select) => select(import_core_data.store).getCurrentTheme()?.is_block_theme,
|
|
115
112
|
[]
|
|
116
113
|
);
|
|
117
|
-
const { setEditorCanvasContainerView } = (0, import_lock_unlock.unlock)(
|
|
118
|
-
(0, import_data.useDispatch)(import_store.store)
|
|
119
|
-
);
|
|
120
|
-
(0, import_element.useEffect)(() => {
|
|
121
|
-
setEditorCanvasContainerView(void 0);
|
|
122
|
-
}, [setEditorCanvasContainerView]);
|
|
123
114
|
let description;
|
|
124
115
|
if (customDescription) {
|
|
125
116
|
description = customDescription;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/sidebar-navigation-screen-main/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { layout, symbol, navigation, styles, page } from '@wordpress/icons';\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
6
|
-
"names": ["ItemGroup", "SidebarNavigationItem", "coreStore", "
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { layout, symbol, navigation, styles, page } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { SidebarNavigationItemGlobalStyles } from '../sidebar-navigation-screen-global-styles';\n\nexport function MainSidebarNavigationContent( { isBlockBasedTheme = true } ) {\n\treturn (\n\t\t<ItemGroup className=\"edit-site-sidebar-navigation-screen-main\">\n\t\t\t{ isBlockBasedTheme && (\n\t\t\t\t<>\n\t\t\t\t\t<SidebarNavigationItemGlobalStyles\n\t\t\t\t\t\tto=\"/styles\"\n\t\t\t\t\t\tuid=\"global-styles-navigation-item\"\n\t\t\t\t\t\ticon={ styles }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Styles' ) }\n\t\t\t\t\t</SidebarNavigationItemGlobalStyles>\n\t\t\t\t\t<SidebarNavigationItem\n\t\t\t\t\t\tuid=\"navigation-navigation-item\"\n\t\t\t\t\t\tto=\"/navigation\"\n\t\t\t\t\t\twithChevron\n\t\t\t\t\t\ticon={ navigation }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Navigation' ) }\n\t\t\t\t\t</SidebarNavigationItem>\n\t\t\t\t\t<SidebarNavigationItem\n\t\t\t\t\t\tuid=\"page-navigation-item\"\n\t\t\t\t\t\tto=\"/page\"\n\t\t\t\t\t\twithChevron\n\t\t\t\t\t\ticon={ page }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Pages' ) }\n\t\t\t\t\t</SidebarNavigationItem>\n\t\t\t\t\t<SidebarNavigationItem\n\t\t\t\t\t\tuid=\"template-navigation-item\"\n\t\t\t\t\t\tto=\"/template\"\n\t\t\t\t\t\twithChevron\n\t\t\t\t\t\ticon={ layout }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Templates' ) }\n\t\t\t\t\t</SidebarNavigationItem>\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t{ ! isBlockBasedTheme && (\n\t\t\t\t<SidebarNavigationItem\n\t\t\t\t\tuid=\"stylebook-navigation-item\"\n\t\t\t\t\tto=\"/stylebook\"\n\t\t\t\t\twithChevron\n\t\t\t\t\ticon={ styles }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Styles' ) }\n\t\t\t\t</SidebarNavigationItem>\n\t\t\t) }\n\t\t\t<SidebarNavigationItem\n\t\t\t\tuid=\"patterns-navigation-item\"\n\t\t\t\tto=\"/pattern\"\n\t\t\t\twithChevron\n\t\t\t\ticon={ symbol }\n\t\t\t>\n\t\t\t\t{ __( 'Patterns' ) }\n\t\t\t</SidebarNavigationItem>\n\t\t</ItemGroup>\n\t);\n}\n\nexport default function SidebarNavigationScreenMain( { customDescription } ) {\n\tconst isBlockBasedTheme = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme()?.is_block_theme,\n\t\t[]\n\t);\n\n\tlet description;\n\tif ( customDescription ) {\n\t\tdescription = customDescription;\n\t} else if ( isBlockBasedTheme ) {\n\t\tdescription = __(\n\t\t\t'Customize the appearance of your website using the block editor.'\n\t\t);\n\t} else {\n\t\tdescription = __(\n\t\t\t'Explore block styles and patterns to refine your site.'\n\t\t);\n\t}\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\tisRoot\n\t\t\ttitle={ __( 'Design' ) }\n\t\t\tdescription={ description }\n\t\t\tcontent={\n\t\t\t\t<MainSidebarNavigationContent\n\t\t\t\t\tisBlockBasedTheme={ isBlockBasedTheme }\n\t\t\t\t/>\n\t\t\t}\n\t\t/>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBI;AAjBJ,wBAAqD;AACrD,kBAAmB;AACnB,mBAAyD;AACzD,kBAA0B;AAC1B,uBAAmC;AAKnC,uCAAoC;AACpC,qCAAkC;AAClC,qDAAkD;AAE3C,SAAS,6BAA8B,EAAE,oBAAoB,KAAK,GAAI;AAC5E,SACC,6CAAC,kBAAAA,yBAAA,EAAU,WAAU,4CAClB;AAAA,yBACD,4EACC;AAAA;AAAA,QAAC;AAAA;AAAA,UACA,IAAG;AAAA,UACH,KAAI;AAAA,UACJ,MAAO;AAAA,UAEL,8BAAI,QAAS;AAAA;AAAA,MAChB;AAAA,MACA;AAAA,QAAC,+BAAAC;AAAA,QAAA;AAAA,UACA,KAAI;AAAA,UACJ,IAAG;AAAA,UACH,aAAW;AAAA,UACX,MAAO;AAAA,UAEL,8BAAI,YAAa;AAAA;AAAA,MACpB;AAAA,MACA;AAAA,QAAC,+BAAAA;AAAA,QAAA;AAAA,UACA,KAAI;AAAA,UACJ,IAAG;AAAA,UACH,aAAW;AAAA,UACX,MAAO;AAAA,UAEL,8BAAI,OAAQ;AAAA;AAAA,MACf;AAAA,MACA;AAAA,QAAC,+BAAAA;AAAA,QAAA;AAAA,UACA,KAAI;AAAA,UACJ,IAAG;AAAA,UACH,aAAW;AAAA,UACX,MAAO;AAAA,UAEL,8BAAI,WAAY;AAAA;AAAA,MACnB;AAAA,OACD;AAAA,IAEC,CAAE,qBACH;AAAA,MAAC,+BAAAA;AAAA,MAAA;AAAA,QACA,KAAI;AAAA,QACJ,IAAG;AAAA,QACH,aAAW;AAAA,QACX,MAAO;AAAA,QAEL,8BAAI,QAAS;AAAA;AAAA,IAChB;AAAA,IAED;AAAA,MAAC,+BAAAA;AAAA,MAAA;AAAA,QACA,KAAI;AAAA,QACJ,IAAG;AAAA,QACH,aAAW;AAAA,QACX,MAAO;AAAA,QAEL,8BAAI,UAAW;AAAA;AAAA,IAClB;AAAA,KACD;AAEF;AAEe,SAAR,4BAA8C,EAAE,kBAAkB,GAAI;AAC5E,QAAM,wBAAoB;AAAA,IACzB,CAAE,WAAY,OAAQ,iBAAAC,KAAU,EAAE,gBAAgB,GAAG;AAAA,IACrD,CAAC;AAAA,EACF;AAEA,MAAI;AACJ,MAAK,mBAAoB;AACxB,kBAAc;AAAA,EACf,WAAY,mBAAoB;AAC/B,sBAAc;AAAA,MACb;AAAA,IACD;AAAA,EACD,OAAO;AACN,sBAAc;AAAA,MACb;AAAA,IACD;AAAA,EACD;AAEA,SACC;AAAA,IAAC,iCAAAC;AAAA,IAAA;AAAA,MACA,QAAM;AAAA,MACN,WAAQ,gBAAI,QAAS;AAAA,MACrB;AAAA,MACA,SACC;AAAA,QAAC;AAAA;AAAA,UACA;AAAA;AAAA,MACD;AAAA;AAAA,EAEF;AAEF;",
|
|
6
|
+
"names": ["ItemGroup", "SidebarNavigationItem", "coreStore", "SidebarNavigationScreen"]
|
|
7
7
|
}
|
|
@@ -81,7 +81,7 @@ function DataviewsTemplatesSidebarContent() {
|
|
|
81
81
|
import_sidebar_navigation_item.default,
|
|
82
82
|
{
|
|
83
83
|
to: "/template",
|
|
84
|
-
icon: import_icons.
|
|
84
|
+
icon: import_icons.published,
|
|
85
85
|
"aria-current": activeView === "active",
|
|
86
86
|
children: (0, import_i18n.__)("Active templates")
|
|
87
87
|
}
|
|
@@ -90,7 +90,7 @@ function DataviewsTemplatesSidebarContent() {
|
|
|
90
90
|
import_sidebar_navigation_item.default,
|
|
91
91
|
{
|
|
92
92
|
to: (0, import_url.addQueryArgs)("/template", { activeView: "user" }),
|
|
93
|
-
icon: import_icons.
|
|
93
|
+
icon: import_icons.commentAuthorAvatar,
|
|
94
94
|
"aria-current": activeView === "user",
|
|
95
95
|
// Let's avoid calling them "custom templates" to avoid
|
|
96
96
|
// confusion. "Created" is closest to meaning database
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/sidebar-navigation-screen-templates-browse/content.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useEntityRecords } from '@wordpress/core-data';\nimport { useMemo } from '@wordpress/element';\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { useAddedBy } from '../page-templates/hooks';\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA0BE;AAvBF,uBAAiC;AACjC,qBAAwB;AACxB,wBAAqD;AACrD,kBAAmB;AACnB,oBAAiD;AACjD,iBAA6B;AAK7B,qCAAkC;AAClC,mBAA2B;AAC3B,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useEntityRecords } from '@wordpress/core-data';\nimport { useMemo } from '@wordpress/element';\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { useAddedBy } from '../page-templates/hooks';\nimport { commentAuthorAvatar, published } from '@wordpress/icons';\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nconst EMPTY_ARRAY = [];\n\nfunction TemplateDataviewItem( { template, isActive } ) {\n\tconst { text, icon } = useAddedBy( template.type, template.id );\n\n\treturn (\n\t\t<SidebarNavigationItem\n\t\t\tto={ addQueryArgs( '/template', { activeView: text } ) }\n\t\t\ticon={ icon }\n\t\t\taria-current={ isActive }\n\t\t>\n\t\t\t{ text }\n\t\t</SidebarNavigationItem>\n\t);\n}\n\nexport default function DataviewsTemplatesSidebarContent() {\n\tconst {\n\t\tquery: { activeView = 'active' },\n\t} = useLocation();\n\tconst { records } = useEntityRecords( 'root', 'registeredTemplate', {\n\t\t// This should not be needed, the endpoint returns all registered\n\t\t// templates, but it's not possible right now to turn off pagination for\n\t\t// entity configs.\n\t\tper_page: -1,\n\t} );\n\tconst firstItemPerAuthorText = useMemo( () => {\n\t\tconst firstItemPerAuthor = records?.reduce( ( acc, template ) => {\n\t\t\tconst author = template.author_text;\n\t\t\tif ( author && ! acc[ author ] ) {\n\t\t\t\tacc[ author ] = template;\n\t\t\t}\n\t\t\treturn acc;\n\t\t}, {} );\n\t\treturn (\n\t\t\t( firstItemPerAuthor && Object.values( firstItemPerAuthor ) ) ??\n\t\t\tEMPTY_ARRAY\n\t\t);\n\t}, [ records ] );\n\n\treturn (\n\t\t<ItemGroup className=\"edit-site-sidebar-navigation-screen-templates-browse\">\n\t\t\t<SidebarNavigationItem\n\t\t\t\tto=\"/template\"\n\t\t\t\ticon={ published }\n\t\t\t\taria-current={ activeView === 'active' }\n\t\t\t>\n\t\t\t\t{ __( 'Active templates' ) }\n\t\t\t</SidebarNavigationItem>\n\t\t\t<SidebarNavigationItem\n\t\t\t\tto={ addQueryArgs( '/template', { activeView: 'user' } ) }\n\t\t\t\ticon={ commentAuthorAvatar }\n\t\t\t\taria-current={ activeView === 'user' }\n\t\t\t>\n\t\t\t\t{\n\t\t\t\t\t// Let's avoid calling them \"custom templates\" to avoid\n\t\t\t\t\t// confusion. \"Created\" is closest to meaning database\n\t\t\t\t\t// templates, created by users.\n\t\t\t\t\t// https://developer.wordpress.org/themes/classic-themes/templates/page-template-files/#creating-custom-page-templates-for-global-use\n\t\t\t\t\t__( 'Created templates' )\n\t\t\t\t}\n\t\t\t</SidebarNavigationItem>\n\t\t\t{ firstItemPerAuthorText.map( ( template ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<TemplateDataviewItem\n\t\t\t\t\t\tkey={ template.author_text }\n\t\t\t\t\t\ttemplate={ template }\n\t\t\t\t\t\tisActive={ activeView === template.author_text }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</ItemGroup>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA0BE;AAvBF,uBAAiC;AACjC,qBAAwB;AACxB,wBAAqD;AACrD,kBAAmB;AACnB,oBAAiD;AACjD,iBAA6B;AAK7B,qCAAkC;AAClC,mBAA2B;AAC3B,mBAA+C;AAC/C,yBAAuB;AAEvB,MAAM,EAAE,YAAY,QAAI,2BAAQ,cAAAA,WAAkB;AAElD,MAAM,cAAc,CAAC;AAErB,SAAS,qBAAsB,EAAE,UAAU,SAAS,GAAI;AACvD,QAAM,EAAE,MAAM,KAAK,QAAI,yBAAY,SAAS,MAAM,SAAS,EAAG;AAE9D,SACC;AAAA,IAAC,+BAAAC;AAAA,IAAA;AAAA,MACA,QAAK,yBAAc,aAAa,EAAE,YAAY,KAAK,CAAE;AAAA,MACrD;AAAA,MACA,gBAAe;AAAA,MAEb;AAAA;AAAA,EACH;AAEF;AAEe,SAAR,mCAAoD;AAC1D,QAAM;AAAA,IACL,OAAO,EAAE,aAAa,SAAS;AAAA,EAChC,IAAI,YAAY;AAChB,QAAM,EAAE,QAAQ,QAAI,mCAAkB,QAAQ,sBAAsB;AAAA;AAAA;AAAA;AAAA,IAInE,UAAU;AAAA,EACX,CAAE;AACF,QAAM,6BAAyB,wBAAS,MAAM;AAC7C,UAAM,qBAAqB,SAAS,OAAQ,CAAE,KAAK,aAAc;AAChE,YAAM,SAAS,SAAS;AACxB,UAAK,UAAU,CAAE,IAAK,MAAO,GAAI;AAChC,YAAK,MAAO,IAAI;AAAA,MACjB;AACA,aAAO;AAAA,IACR,GAAG,CAAC,CAAE;AACN,YACG,sBAAsB,OAAO,OAAQ,kBAAmB,MAC1D;AAAA,EAEF,GAAG,CAAE,OAAQ,CAAE;AAEf,SACC,6CAAC,kBAAAC,yBAAA,EAAU,WAAU,wDACpB;AAAA;AAAA,MAAC,+BAAAD;AAAA,MAAA;AAAA,QACA,IAAG;AAAA,QACH,MAAO;AAAA,QACP,gBAAe,eAAe;AAAA,QAE5B,8BAAI,kBAAmB;AAAA;AAAA,IAC1B;AAAA,IACA;AAAA,MAAC,+BAAAA;AAAA,MAAA;AAAA,QACA,QAAK,yBAAc,aAAa,EAAE,YAAY,OAAO,CAAE;AAAA,QACvD,MAAO;AAAA,QACP,gBAAe,eAAe;AAAA;AAAA;AAAA;AAAA;AAAA,QAO7B,8BAAI,mBAAoB;AAAA;AAAA,IAE1B;AAAA,IACE,uBAAuB,IAAK,CAAE,aAAc;AAC7C,aACC;AAAA,QAAC;AAAA;AAAA,UAEA;AAAA,UACA,UAAW,eAAe,SAAS;AAAA;AAAA,QAF7B,SAAS;AAAA,MAGhB;AAAA,IAEF,CAAE;AAAA,KACH;AAEF;",
|
|
6
6
|
"names": ["routerPrivateApis", "SidebarNavigationItem", "ItemGroup"]
|
|
7
7
|
}
|
|
@@ -33,10 +33,12 @@ __export(stylebook_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(stylebook_exports);
|
|
34
34
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
35
|
var import_i18n = require("@wordpress/i18n");
|
|
36
|
+
var import_editor = require("@wordpress/editor");
|
|
36
37
|
var import_sidebar_navigation_screen = __toESM(require("../sidebar-navigation-screen"));
|
|
37
38
|
var import_sidebar_navigation_screen_unsupported = __toESM(require("../sidebar-navigation-screen-unsupported"));
|
|
38
|
-
var
|
|
39
|
+
var import_lock_unlock = require("../../lock-unlock");
|
|
39
40
|
var import_utils = require("./utils");
|
|
41
|
+
const { StyleBookPreview } = (0, import_lock_unlock.unlock)(import_editor.privateApis);
|
|
40
42
|
const stylebookRoute = {
|
|
41
43
|
name: "stylebook",
|
|
42
44
|
path: "/stylebook",
|
|
@@ -54,10 +56,10 @@ const stylebookRoute = {
|
|
|
54
56
|
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_sidebar_navigation_screen_unsupported.default, {});
|
|
55
57
|
},
|
|
56
58
|
preview({ siteData }) {
|
|
57
|
-
return (0, import_utils.isClassicThemeWithStyleBookSupport)(siteData) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
59
|
+
return (0, import_utils.isClassicThemeWithStyleBookSupport)(siteData) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyleBookPreview, { isStatic: true }) : void 0;
|
|
58
60
|
},
|
|
59
61
|
mobile({ siteData }) {
|
|
60
|
-
return (0, import_utils.isClassicThemeWithStyleBookSupport)(siteData) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
62
|
+
return (0, import_utils.isClassicThemeWithStyleBookSupport)(siteData) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyleBookPreview, { isStatic: true }) : void 0;
|
|
61
63
|
}
|
|
62
64
|
}
|
|
63
65
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/site-editor-routes/stylebook.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport SidebarNavigationScreenUnsupported from '../sidebar-navigation-screen-unsupported';\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
6
|
-
"names": ["SidebarNavigationScreen", "SidebarNavigationScreenUnsupported"]
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport SidebarNavigationScreenUnsupported from '../sidebar-navigation-screen-unsupported';\nimport { unlock } from '../../lock-unlock';\nimport { isClassicThemeWithStyleBookSupport } from './utils';\n\nconst { StyleBookPreview } = unlock( editorPrivateApis );\n\nexport const stylebookRoute = {\n\tname: 'stylebook',\n\tpath: '/stylebook',\n\tareas: {\n\t\tsidebar( { siteData } ) {\n\t\t\treturn isClassicThemeWithStyleBookSupport( siteData ) ? (\n\t\t\t\t<SidebarNavigationScreen\n\t\t\t\t\ttitle={ __( 'Styles' ) }\n\t\t\t\t\tbackPath=\"/\"\n\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t`Preview your website's visual identity: colors, typography, and blocks.`\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t<SidebarNavigationScreenUnsupported />\n\t\t\t);\n\t\t},\n\t\tpreview( { siteData } ) {\n\t\t\treturn isClassicThemeWithStyleBookSupport( siteData ) ? (\n\t\t\t\t<StyleBookPreview isStatic />\n\t\t\t) : undefined;\n\t\t},\n\t\tmobile( { siteData } ) {\n\t\t\treturn isClassicThemeWithStyleBookSupport( siteData ) ? (\n\t\t\t\t<StyleBookPreview isStatic />\n\t\t\t) : undefined;\n\t\t},\n\t},\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAsBI;AAnBJ,kBAAmB;AACnB,oBAAiD;AAKjD,uCAAoC;AACpC,mDAA+C;AAC/C,yBAAuB;AACvB,mBAAmD;AAEnD,MAAM,EAAE,iBAAiB,QAAI,2BAAQ,cAAAA,WAAkB;AAEhD,MAAM,iBAAiB;AAAA,EAC7B,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AAAA,IACN,QAAS,EAAE,SAAS,GAAI;AACvB,iBAAO,iDAAoC,QAAS,IACnD;AAAA,QAAC,iCAAAC;AAAA,QAAA;AAAA,UACA,WAAQ,gBAAI,QAAS;AAAA,UACrB,UAAS;AAAA,UACT,iBAAc;AAAA,YACb;AAAA,UACD;AAAA;AAAA,MACD,IAEA,4CAAC,6CAAAC,SAAA,EAAmC;AAAA,IAEtC;AAAA,IACA,QAAS,EAAE,SAAS,GAAI;AACvB,iBAAO,iDAAoC,QAAS,IACnD,4CAAC,oBAAiB,UAAQ,MAAC,IACxB;AAAA,IACL;AAAA,IACA,OAAQ,EAAE,SAAS,GAAI;AACtB,iBAAO,iDAAoC,QAAS,IACnD,4CAAC,oBAAiB,UAAQ,MAAC,IACxB;AAAA,IACL;AAAA,EACD;AACD;",
|
|
6
|
+
"names": ["editorPrivateApis", "SidebarNavigationScreen", "SidebarNavigationScreenUnsupported"]
|
|
7
7
|
}
|
|
@@ -33,30 +33,52 @@ __export(styles_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(styles_exports);
|
|
34
34
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
35
|
var import_router = require("@wordpress/router");
|
|
36
|
-
var import_editor =
|
|
36
|
+
var import_editor = require("@wordpress/editor");
|
|
37
|
+
var import_url = require("@wordpress/url");
|
|
38
|
+
var import_editor2 = __toESM(require("../editor"));
|
|
37
39
|
var import_lock_unlock = require("../../lock-unlock");
|
|
38
40
|
var import_sidebar_navigation_screen_global_styles = __toESM(require("../sidebar-navigation-screen-global-styles"));
|
|
39
|
-
var
|
|
40
|
-
|
|
41
|
-
const {
|
|
41
|
+
var import_sidebar_global_styles = __toESM(require("../sidebar-global-styles"));
|
|
42
|
+
const { useLocation, useHistory } = (0, import_lock_unlock.unlock)(import_router.privateApis);
|
|
43
|
+
const { StyleBookPreview } = (0, import_lock_unlock.unlock)(import_editor.privateApis);
|
|
42
44
|
function MobileGlobalStylesUI() {
|
|
43
45
|
const { query = {} } = useLocation();
|
|
44
46
|
const { canvas } = query;
|
|
45
47
|
if (canvas === "edit") {
|
|
46
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
48
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_editor2.default, {});
|
|
47
49
|
}
|
|
48
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
50
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_sidebar_global_styles.default, {});
|
|
51
|
+
}
|
|
52
|
+
function StylesPreviewArea() {
|
|
53
|
+
const { path, query } = useLocation();
|
|
54
|
+
const history = useHistory();
|
|
55
|
+
const isStylebook = query.preview === "stylebook";
|
|
56
|
+
const section = query.section ?? "/";
|
|
57
|
+
const onChangeSection = (updatedSection) => {
|
|
58
|
+
history.navigate(
|
|
59
|
+
(0, import_url.addQueryArgs)(path, {
|
|
60
|
+
section: updatedSection
|
|
61
|
+
})
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
if (isStylebook) {
|
|
65
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
66
|
+
StyleBookPreview,
|
|
67
|
+
{
|
|
68
|
+
path: section,
|
|
69
|
+
onPathChange: onChangeSection
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_editor2.default, {});
|
|
49
74
|
}
|
|
50
75
|
const stylesRoute = {
|
|
51
76
|
name: "styles",
|
|
52
77
|
path: "/styles",
|
|
53
78
|
areas: {
|
|
54
|
-
content: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
79
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_sidebar_global_styles.default, {}),
|
|
55
80
|
sidebar: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_sidebar_navigation_screen_global_styles.default, { backPath: "/" }),
|
|
56
|
-
preview(
|
|
57
|
-
const isStylebook = query.preview === "stylebook";
|
|
58
|
-
return isStylebook ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_style_book.StyleBookPreview, {}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_editor.default, {});
|
|
59
|
-
},
|
|
81
|
+
preview: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StylesPreviewArea, {}),
|
|
60
82
|
mobile: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MobileGlobalStylesUI, {})
|
|
61
83
|
},
|
|
62
84
|
widths: {
|