@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,155 +0,0 @@
|
|
|
1
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { __, sprintf } from "@wordpress/i18n";
|
|
3
|
-
import {
|
|
4
|
-
__experimentalConfirmDialog as ConfirmDialog,
|
|
5
|
-
Spinner
|
|
6
|
-
} from "@wordpress/components";
|
|
7
|
-
import { useSelect, useDispatch } from "@wordpress/data";
|
|
8
|
-
import { useContext, useState, useEffect } from "@wordpress/element";
|
|
9
|
-
import {
|
|
10
|
-
privateApis as blockEditorPrivateApis,
|
|
11
|
-
store as blockEditorStore
|
|
12
|
-
} from "@wordpress/block-editor";
|
|
13
|
-
import ScreenHeader from "../header";
|
|
14
|
-
import { unlock } from "../../../lock-unlock";
|
|
15
|
-
import Revisions from "../../revisions";
|
|
16
|
-
import { store as editSiteStore } from "../../../store";
|
|
17
|
-
import useGlobalStylesRevisions from "./use-global-styles-revisions";
|
|
18
|
-
import RevisionsButtons from "./revisions-buttons";
|
|
19
|
-
import StyleBook from "../../style-book";
|
|
20
|
-
import Pagination from "../../pagination";
|
|
21
|
-
const { GlobalStylesContext, areGlobalStyleConfigsEqual } = unlock(
|
|
22
|
-
blockEditorPrivateApis
|
|
23
|
-
);
|
|
24
|
-
const PAGE_SIZE = 10;
|
|
25
|
-
function ScreenRevisions() {
|
|
26
|
-
const { user: currentEditorGlobalStyles, setUserConfig } = useContext(GlobalStylesContext);
|
|
27
|
-
const { blocks, editorCanvasContainerView } = useSelect(
|
|
28
|
-
(select) => ({
|
|
29
|
-
editorCanvasContainerView: unlock(
|
|
30
|
-
select(editSiteStore)
|
|
31
|
-
).getEditorCanvasContainerView(),
|
|
32
|
-
blocks: select(blockEditorStore).getBlocks()
|
|
33
|
-
}),
|
|
34
|
-
[]
|
|
35
|
-
);
|
|
36
|
-
const [currentPage, setCurrentPage] = useState(1);
|
|
37
|
-
const [currentRevisions, setCurrentRevisions] = useState([]);
|
|
38
|
-
const { revisions, isLoading, hasUnsavedChanges, revisionsCount } = useGlobalStylesRevisions({
|
|
39
|
-
query: {
|
|
40
|
-
per_page: PAGE_SIZE,
|
|
41
|
-
page: currentPage
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
const numPages = Math.ceil(revisionsCount / PAGE_SIZE);
|
|
45
|
-
const [currentlySelectedRevision, setCurrentlySelectedRevision] = useState(currentEditorGlobalStyles);
|
|
46
|
-
const [
|
|
47
|
-
isLoadingRevisionWithUnsavedChanges,
|
|
48
|
-
setIsLoadingRevisionWithUnsavedChanges
|
|
49
|
-
] = useState(false);
|
|
50
|
-
const { setEditorCanvasContainerView } = unlock(
|
|
51
|
-
useDispatch(editSiteStore)
|
|
52
|
-
);
|
|
53
|
-
const selectedRevisionMatchesEditorStyles = areGlobalStyleConfigsEqual(
|
|
54
|
-
currentlySelectedRevision,
|
|
55
|
-
currentEditorGlobalStyles
|
|
56
|
-
);
|
|
57
|
-
const onCloseRevisions = () => {
|
|
58
|
-
const canvasContainerView = editorCanvasContainerView === "global-styles-revisions:style-book" ? "style-book" : void 0;
|
|
59
|
-
setEditorCanvasContainerView(canvasContainerView);
|
|
60
|
-
};
|
|
61
|
-
const restoreRevision = (revision) => {
|
|
62
|
-
setUserConfig(() => revision);
|
|
63
|
-
setIsLoadingRevisionWithUnsavedChanges(false);
|
|
64
|
-
onCloseRevisions();
|
|
65
|
-
};
|
|
66
|
-
useEffect(() => {
|
|
67
|
-
if (!isLoading && revisions.length) {
|
|
68
|
-
setCurrentRevisions(revisions);
|
|
69
|
-
}
|
|
70
|
-
}, [revisions, isLoading]);
|
|
71
|
-
const firstRevision = revisions[0];
|
|
72
|
-
const currentlySelectedRevisionId = currentlySelectedRevision?.id;
|
|
73
|
-
const shouldSelectFirstItem = !!firstRevision?.id && !selectedRevisionMatchesEditorStyles && !currentlySelectedRevisionId;
|
|
74
|
-
useEffect(() => {
|
|
75
|
-
if (shouldSelectFirstItem) {
|
|
76
|
-
setCurrentlySelectedRevision(firstRevision);
|
|
77
|
-
}
|
|
78
|
-
}, [shouldSelectFirstItem, firstRevision]);
|
|
79
|
-
const isLoadButtonEnabled = !!currentlySelectedRevisionId && currentlySelectedRevisionId !== "unsaved" && !selectedRevisionMatchesEditorStyles;
|
|
80
|
-
const hasRevisions = !!currentRevisions.length;
|
|
81
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
82
|
-
/* @__PURE__ */ jsx(
|
|
83
|
-
ScreenHeader,
|
|
84
|
-
{
|
|
85
|
-
title: revisionsCount && // translators: %s: number of revisions.
|
|
86
|
-
sprintf(__("Revisions (%s)"), revisionsCount),
|
|
87
|
-
description: __(
|
|
88
|
-
`Click on previously saved styles to preview them. To restore a selected version to the editor, hit "Apply." When you're ready, use the Save button to save your changes.`
|
|
89
|
-
),
|
|
90
|
-
onBack: onCloseRevisions
|
|
91
|
-
}
|
|
92
|
-
),
|
|
93
|
-
!hasRevisions && /* @__PURE__ */ jsx(Spinner, { className: "edit-site-global-styles-screen-revisions__loading" }),
|
|
94
|
-
hasRevisions && (editorCanvasContainerView === "global-styles-revisions:style-book" ? /* @__PURE__ */ jsx(
|
|
95
|
-
StyleBook,
|
|
96
|
-
{
|
|
97
|
-
userConfig: currentlySelectedRevision,
|
|
98
|
-
isSelected: () => {
|
|
99
|
-
},
|
|
100
|
-
onClose: () => {
|
|
101
|
-
setEditorCanvasContainerView(
|
|
102
|
-
"global-styles-revisions"
|
|
103
|
-
);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
) : /* @__PURE__ */ jsx(
|
|
107
|
-
Revisions,
|
|
108
|
-
{
|
|
109
|
-
blocks,
|
|
110
|
-
userConfig: currentlySelectedRevision,
|
|
111
|
-
closeButtonLabel: __("Close revisions")
|
|
112
|
-
}
|
|
113
|
-
)),
|
|
114
|
-
/* @__PURE__ */ jsx(
|
|
115
|
-
RevisionsButtons,
|
|
116
|
-
{
|
|
117
|
-
onChange: setCurrentlySelectedRevision,
|
|
118
|
-
selectedRevisionId: currentlySelectedRevisionId,
|
|
119
|
-
userRevisions: currentRevisions,
|
|
120
|
-
canApplyRevision: isLoadButtonEnabled,
|
|
121
|
-
onApplyRevision: () => hasUnsavedChanges ? setIsLoadingRevisionWithUnsavedChanges(true) : restoreRevision(currentlySelectedRevision)
|
|
122
|
-
}
|
|
123
|
-
),
|
|
124
|
-
numPages > 1 && /* @__PURE__ */ jsx("div", { className: "edit-site-global-styles-screen-revisions__footer", children: /* @__PURE__ */ jsx(
|
|
125
|
-
Pagination,
|
|
126
|
-
{
|
|
127
|
-
className: "edit-site-global-styles-screen-revisions__pagination",
|
|
128
|
-
currentPage,
|
|
129
|
-
numPages,
|
|
130
|
-
changePage: setCurrentPage,
|
|
131
|
-
totalItems: revisionsCount,
|
|
132
|
-
disabled: isLoading,
|
|
133
|
-
label: __("Global Styles pagination")
|
|
134
|
-
}
|
|
135
|
-
) }),
|
|
136
|
-
isLoadingRevisionWithUnsavedChanges && /* @__PURE__ */ jsx(
|
|
137
|
-
ConfirmDialog,
|
|
138
|
-
{
|
|
139
|
-
isOpen: isLoadingRevisionWithUnsavedChanges,
|
|
140
|
-
confirmButtonText: __("Apply"),
|
|
141
|
-
onConfirm: () => restoreRevision(currentlySelectedRevision),
|
|
142
|
-
onCancel: () => setIsLoadingRevisionWithUnsavedChanges(false),
|
|
143
|
-
size: "medium",
|
|
144
|
-
children: __(
|
|
145
|
-
"Are you sure you want to apply this revision? Any unsaved changes will be lost."
|
|
146
|
-
)
|
|
147
|
-
}
|
|
148
|
-
)
|
|
149
|
-
] });
|
|
150
|
-
}
|
|
151
|
-
var screen_revisions_default = ScreenRevisions;
|
|
152
|
-
export {
|
|
153
|
-
screen_revisions_default as default
|
|
154
|
-
};
|
|
155
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/components/global-styles/screen-revisions/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\t__experimentalConfirmDialog as ConfirmDialog,\n\tSpinner,\n} from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useContext, useState, useEffect } from '@wordpress/element';\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport ScreenHeader from '../header';\nimport { unlock } from '../../../lock-unlock';\nimport Revisions from '../../revisions';\nimport { store as editSiteStore } from '../../../store';\nimport useGlobalStylesRevisions from './use-global-styles-revisions';\nimport RevisionsButtons from './revisions-buttons';\nimport StyleBook from '../../style-book';\nimport Pagination from '../../pagination';\n\nconst { GlobalStylesContext, areGlobalStyleConfigsEqual } = unlock(\n\tblockEditorPrivateApis\n);\n\nconst PAGE_SIZE = 10;\n\nfunction ScreenRevisions() {\n\tconst { user: currentEditorGlobalStyles, setUserConfig } =\n\t\tuseContext( GlobalStylesContext );\n\tconst { blocks, editorCanvasContainerView } = useSelect(\n\t\t( select ) => ( {\n\t\t\teditorCanvasContainerView: unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t).getEditorCanvasContainerView(),\n\t\t\tblocks: select( blockEditorStore ).getBlocks(),\n\t\t} ),\n\t\t[]\n\t);\n\tconst [ currentPage, setCurrentPage ] = useState( 1 );\n\tconst [ currentRevisions, setCurrentRevisions ] = useState( [] );\n\tconst { revisions, isLoading, hasUnsavedChanges, revisionsCount } =\n\t\tuseGlobalStylesRevisions( {\n\t\t\tquery: {\n\t\t\t\tper_page: PAGE_SIZE,\n\t\t\t\tpage: currentPage,\n\t\t\t},\n\t\t} );\n\n\tconst numPages = Math.ceil( revisionsCount / PAGE_SIZE );\n\n\tconst [ currentlySelectedRevision, setCurrentlySelectedRevision ] =\n\t\tuseState( currentEditorGlobalStyles );\n\tconst [\n\t\tisLoadingRevisionWithUnsavedChanges,\n\t\tsetIsLoadingRevisionWithUnsavedChanges,\n\t] = useState( false );\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst selectedRevisionMatchesEditorStyles = areGlobalStyleConfigsEqual(\n\t\tcurrentlySelectedRevision,\n\t\tcurrentEditorGlobalStyles\n\t);\n\n\t// The actual code that triggers the revisions screen to navigate back\n\t// to the home screen in in `packages/edit-site/src/components/global-styles/ui.js`.\n\tconst onCloseRevisions = () => {\n\t\tconst canvasContainerView =\n\t\t\teditorCanvasContainerView === 'global-styles-revisions:style-book'\n\t\t\t\t? 'style-book'\n\t\t\t\t: undefined;\n\t\tsetEditorCanvasContainerView( canvasContainerView );\n\t};\n\n\tconst restoreRevision = ( revision ) => {\n\t\tsetUserConfig( () => revision );\n\t\tsetIsLoadingRevisionWithUnsavedChanges( false );\n\t\tonCloseRevisions();\n\t};\n\n\tuseEffect( () => {\n\t\tif ( ! isLoading && revisions.length ) {\n\t\t\tsetCurrentRevisions( revisions );\n\t\t}\n\t}, [ revisions, isLoading ] );\n\n\tconst firstRevision = revisions[ 0 ];\n\tconst currentlySelectedRevisionId = currentlySelectedRevision?.id;\n\tconst shouldSelectFirstItem =\n\t\t!! firstRevision?.id &&\n\t\t! selectedRevisionMatchesEditorStyles &&\n\t\t! currentlySelectedRevisionId;\n\n\tuseEffect( () => {\n\t\t/*\n\t\t * Ensure that the first item is selected and loaded into the preview pane\n\t\t * when no revision is selected and the selected styles don't match the current editor styles.\n\t\t * This is required in case editor styles are changed outside the revisions panel,\n\t\t * e.g., via the reset styles function of useGlobalStylesReset().\n\t\t * See: https://github.com/WordPress/gutenberg/issues/55866\n\t\t */\n\t\tif ( shouldSelectFirstItem ) {\n\t\t\tsetCurrentlySelectedRevision( firstRevision );\n\t\t}\n\t}, [ shouldSelectFirstItem, firstRevision ] );\n\n\t// Only display load button if there is a revision to load,\n\t// and it is different from the current editor styles.\n\tconst isLoadButtonEnabled =\n\t\t!! currentlySelectedRevisionId &&\n\t\tcurrentlySelectedRevisionId !== 'unsaved' &&\n\t\t! selectedRevisionMatchesEditorStyles;\n\tconst hasRevisions = !! currentRevisions.length;\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={\n\t\t\t\t\trevisionsCount &&\n\t\t\t\t\t// translators: %s: number of revisions.\n\t\t\t\t\tsprintf( __( 'Revisions (%s)' ), revisionsCount )\n\t\t\t\t}\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Click on previously saved styles to preview them. To restore a selected version to the editor, hit \"Apply.\" When you\\'re ready, use the Save button to save your changes.'\n\t\t\t\t) }\n\t\t\t\tonBack={ onCloseRevisions }\n\t\t\t/>\n\t\t\t{ ! hasRevisions && (\n\t\t\t\t<Spinner className=\"edit-site-global-styles-screen-revisions__loading\" />\n\t\t\t) }\n\t\t\t{ hasRevisions &&\n\t\t\t\t( editorCanvasContainerView ===\n\t\t\t\t'global-styles-revisions:style-book' ? (\n\t\t\t\t\t<StyleBook\n\t\t\t\t\t\tuserConfig={ currentlySelectedRevision }\n\t\t\t\t\t\tisSelected={ () => {} }\n\t\t\t\t\t\tonClose={ () => {\n\t\t\t\t\t\t\tsetEditorCanvasContainerView(\n\t\t\t\t\t\t\t\t'global-styles-revisions'\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<Revisions\n\t\t\t\t\t\tblocks={ blocks }\n\t\t\t\t\t\tuserConfig={ currentlySelectedRevision }\n\t\t\t\t\t\tcloseButtonLabel={ __( 'Close revisions' ) }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t<RevisionsButtons\n\t\t\t\tonChange={ setCurrentlySelectedRevision }\n\t\t\t\tselectedRevisionId={ currentlySelectedRevisionId }\n\t\t\t\tuserRevisions={ currentRevisions }\n\t\t\t\tcanApplyRevision={ isLoadButtonEnabled }\n\t\t\t\tonApplyRevision={ () =>\n\t\t\t\t\thasUnsavedChanges\n\t\t\t\t\t\t? setIsLoadingRevisionWithUnsavedChanges( true )\n\t\t\t\t\t\t: restoreRevision( currentlySelectedRevision )\n\t\t\t\t}\n\t\t\t/>\n\t\t\t{ numPages > 1 && (\n\t\t\t\t<div className=\"edit-site-global-styles-screen-revisions__footer\">\n\t\t\t\t\t<Pagination\n\t\t\t\t\t\tclassName=\"edit-site-global-styles-screen-revisions__pagination\"\n\t\t\t\t\t\tcurrentPage={ currentPage }\n\t\t\t\t\t\tnumPages={ numPages }\n\t\t\t\t\t\tchangePage={ setCurrentPage }\n\t\t\t\t\t\ttotalItems={ revisionsCount }\n\t\t\t\t\t\tdisabled={ isLoading }\n\t\t\t\t\t\tlabel={ __( 'Global Styles pagination' ) }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t{ isLoadingRevisionWithUnsavedChanges && (\n\t\t\t\t<ConfirmDialog\n\t\t\t\t\tisOpen={ isLoadingRevisionWithUnsavedChanges }\n\t\t\t\t\tconfirmButtonText={ __( 'Apply' ) }\n\t\t\t\t\tonConfirm={ () =>\n\t\t\t\t\t\trestoreRevision( currentlySelectedRevision )\n\t\t\t\t\t}\n\t\t\t\t\tonCancel={ () =>\n\t\t\t\t\t\tsetIsLoadingRevisionWithUnsavedChanges( false )\n\t\t\t\t\t}\n\t\t\t\t\tsize=\"medium\"\n\t\t\t\t>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Are you sure you want to apply this revision? Any unsaved changes will be lost.'\n\t\t\t\t\t) }\n\t\t\t\t</ConfirmDialog>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default ScreenRevisions;\n"],
|
|
5
|
-
"mappings": "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",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { __, sprintf } from "@wordpress/i18n";
|
|
3
|
-
import { Button, Composite } from "@wordpress/components";
|
|
4
|
-
import { dateI18n, getDate, humanTimeDiff, getSettings } from "@wordpress/date";
|
|
5
|
-
import { store as coreStore } from "@wordpress/core-data";
|
|
6
|
-
import { useSelect } from "@wordpress/data";
|
|
7
|
-
import { privateApis as blockEditorPrivateApis } from "@wordpress/block-editor";
|
|
8
|
-
import { ENTER, SPACE } from "@wordpress/keycodes";
|
|
9
|
-
import { unlock } from "../../../lock-unlock";
|
|
10
|
-
const DAY_IN_MILLISECONDS = 60 * 60 * 1e3 * 24;
|
|
11
|
-
const { getGlobalStylesChanges } = unlock(blockEditorPrivateApis);
|
|
12
|
-
function ChangesSummary({ revision, previousRevision }) {
|
|
13
|
-
const changes = getGlobalStylesChanges(revision, previousRevision, {
|
|
14
|
-
maxResults: 7
|
|
15
|
-
});
|
|
16
|
-
if (!changes.length) {
|
|
17
|
-
return null;
|
|
18
|
-
}
|
|
19
|
-
return /* @__PURE__ */ jsx(
|
|
20
|
-
"ul",
|
|
21
|
-
{
|
|
22
|
-
"data-testid": "global-styles-revision-changes",
|
|
23
|
-
className: "edit-site-global-styles-screen-revisions__changes",
|
|
24
|
-
children: changes.map((change) => /* @__PURE__ */ jsx("li", { children: change }, change))
|
|
25
|
-
}
|
|
26
|
-
);
|
|
27
|
-
}
|
|
28
|
-
function getRevisionLabel(id, authorDisplayName, formattedModifiedDate, areStylesEqual) {
|
|
29
|
-
if ("parent" === id) {
|
|
30
|
-
return __("Reset the styles to the theme defaults");
|
|
31
|
-
}
|
|
32
|
-
if ("unsaved" === id) {
|
|
33
|
-
return sprintf(
|
|
34
|
-
/* translators: %s: author display name */
|
|
35
|
-
__("Unsaved changes by %s"),
|
|
36
|
-
authorDisplayName
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
return areStylesEqual ? sprintf(
|
|
40
|
-
// translators: 1: author display name. 2: revision creation date.
|
|
41
|
-
__(
|
|
42
|
-
"Changes saved by %1$s on %2$s. This revision matches current editor styles."
|
|
43
|
-
),
|
|
44
|
-
authorDisplayName,
|
|
45
|
-
formattedModifiedDate
|
|
46
|
-
) : sprintf(
|
|
47
|
-
// translators: 1: author display name. 2: revision creation date.
|
|
48
|
-
__("Changes saved by %1$s on %2$s"),
|
|
49
|
-
authorDisplayName,
|
|
50
|
-
formattedModifiedDate
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
function RevisionsButtons({
|
|
54
|
-
userRevisions,
|
|
55
|
-
selectedRevisionId,
|
|
56
|
-
onChange,
|
|
57
|
-
canApplyRevision,
|
|
58
|
-
onApplyRevision
|
|
59
|
-
}) {
|
|
60
|
-
const { currentThemeName, currentUser } = useSelect((select) => {
|
|
61
|
-
const { getCurrentTheme, getCurrentUser } = select(coreStore);
|
|
62
|
-
const currentTheme = getCurrentTheme();
|
|
63
|
-
return {
|
|
64
|
-
currentThemeName: currentTheme?.name?.rendered || currentTheme?.stylesheet,
|
|
65
|
-
currentUser: getCurrentUser()
|
|
66
|
-
};
|
|
67
|
-
}, []);
|
|
68
|
-
const dateNowInMs = getDate().getTime();
|
|
69
|
-
const { datetimeAbbreviated } = getSettings().formats;
|
|
70
|
-
return /* @__PURE__ */ jsx(
|
|
71
|
-
Composite,
|
|
72
|
-
{
|
|
73
|
-
orientation: "vertical",
|
|
74
|
-
className: "edit-site-global-styles-screen-revisions__revisions-list",
|
|
75
|
-
"aria-label": __("Global styles revisions list"),
|
|
76
|
-
role: "listbox",
|
|
77
|
-
children: userRevisions.map((revision, index) => {
|
|
78
|
-
const { id, author, modified } = revision;
|
|
79
|
-
const isUnsaved = "unsaved" === id;
|
|
80
|
-
const revisionAuthor = isUnsaved ? currentUser : author;
|
|
81
|
-
const authorDisplayName = revisionAuthor?.name || __("User");
|
|
82
|
-
const authorAvatar = revisionAuthor?.avatar_urls?.["48"];
|
|
83
|
-
const isFirstItem = index === 0;
|
|
84
|
-
const isSelected = selectedRevisionId ? selectedRevisionId === id : isFirstItem;
|
|
85
|
-
const areStylesEqual = !canApplyRevision && isSelected;
|
|
86
|
-
const isReset = "parent" === id;
|
|
87
|
-
const modifiedDate = getDate(modified);
|
|
88
|
-
const displayDate = modified && dateNowInMs - modifiedDate.getTime() > DAY_IN_MILLISECONDS ? dateI18n(datetimeAbbreviated, modifiedDate) : humanTimeDiff(modified);
|
|
89
|
-
const revisionLabel = getRevisionLabel(
|
|
90
|
-
id,
|
|
91
|
-
authorDisplayName,
|
|
92
|
-
dateI18n(datetimeAbbreviated, modifiedDate),
|
|
93
|
-
areStylesEqual
|
|
94
|
-
);
|
|
95
|
-
return /* @__PURE__ */ jsxs(
|
|
96
|
-
Composite.Item,
|
|
97
|
-
{
|
|
98
|
-
className: "edit-site-global-styles-screen-revisions__revision-item",
|
|
99
|
-
"aria-current": isSelected,
|
|
100
|
-
role: "option",
|
|
101
|
-
onKeyDown: (event) => {
|
|
102
|
-
const { keyCode } = event;
|
|
103
|
-
if (keyCode === ENTER || keyCode === SPACE) {
|
|
104
|
-
onChange(revision);
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
onClick: (event) => {
|
|
108
|
-
event.preventDefault();
|
|
109
|
-
onChange(revision);
|
|
110
|
-
},
|
|
111
|
-
"aria-selected": isSelected,
|
|
112
|
-
"aria-label": revisionLabel,
|
|
113
|
-
render: /* @__PURE__ */ jsx("div", {}),
|
|
114
|
-
children: [
|
|
115
|
-
/* @__PURE__ */ jsx("span", { className: "edit-site-global-styles-screen-revisions__revision-item-wrapper", children: isReset ? /* @__PURE__ */ jsxs("span", { className: "edit-site-global-styles-screen-revisions__description", children: [
|
|
116
|
-
__("Default styles"),
|
|
117
|
-
/* @__PURE__ */ jsx("span", { className: "edit-site-global-styles-screen-revisions__meta", children: currentThemeName })
|
|
118
|
-
] }) : /* @__PURE__ */ jsxs("span", { className: "edit-site-global-styles-screen-revisions__description", children: [
|
|
119
|
-
isUnsaved ? /* @__PURE__ */ jsx("span", { className: "edit-site-global-styles-screen-revisions__date", children: __("(Unsaved)") }) : /* @__PURE__ */ jsx(
|
|
120
|
-
"time",
|
|
121
|
-
{
|
|
122
|
-
className: "edit-site-global-styles-screen-revisions__date",
|
|
123
|
-
dateTime: modified,
|
|
124
|
-
children: displayDate
|
|
125
|
-
}
|
|
126
|
-
),
|
|
127
|
-
/* @__PURE__ */ jsxs("span", { className: "edit-site-global-styles-screen-revisions__meta", children: [
|
|
128
|
-
/* @__PURE__ */ jsx(
|
|
129
|
-
"img",
|
|
130
|
-
{
|
|
131
|
-
alt: authorDisplayName,
|
|
132
|
-
src: authorAvatar
|
|
133
|
-
}
|
|
134
|
-
),
|
|
135
|
-
authorDisplayName
|
|
136
|
-
] }),
|
|
137
|
-
isSelected && /* @__PURE__ */ jsx(
|
|
138
|
-
ChangesSummary,
|
|
139
|
-
{
|
|
140
|
-
revision,
|
|
141
|
-
previousRevision: index < userRevisions.length ? userRevisions[index + 1] : {}
|
|
142
|
-
}
|
|
143
|
-
)
|
|
144
|
-
] }) }),
|
|
145
|
-
isSelected && (areStylesEqual ? /* @__PURE__ */ jsx("p", { className: "edit-site-global-styles-screen-revisions__applied-text", children: __(
|
|
146
|
-
"These styles are already applied to your site."
|
|
147
|
-
) }) : /* @__PURE__ */ jsx(
|
|
148
|
-
Button,
|
|
149
|
-
{
|
|
150
|
-
size: "compact",
|
|
151
|
-
variant: "primary",
|
|
152
|
-
className: "edit-site-global-styles-screen-revisions__apply-button",
|
|
153
|
-
onClick: onApplyRevision,
|
|
154
|
-
"aria-label": __(
|
|
155
|
-
"Apply the selected revision to your site."
|
|
156
|
-
),
|
|
157
|
-
children: isReset ? __("Reset to defaults") : __("Apply")
|
|
158
|
-
}
|
|
159
|
-
))
|
|
160
|
-
]
|
|
161
|
-
},
|
|
162
|
-
id
|
|
163
|
-
);
|
|
164
|
-
})
|
|
165
|
-
}
|
|
166
|
-
);
|
|
167
|
-
}
|
|
168
|
-
var revisions_buttons_default = RevisionsButtons;
|
|
169
|
-
export {
|
|
170
|
-
revisions_buttons_default as default
|
|
171
|
-
};
|
|
172
|
-
//# sourceMappingURL=revisions-buttons.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/components/global-styles/screen-revisions/revisions-buttons.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Button, Composite } from '@wordpress/components';\nimport { dateI18n, getDate, humanTimeDiff, getSettings } from '@wordpress/date';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { ENTER, SPACE } from '@wordpress/keycodes';\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\n\nconst DAY_IN_MILLISECONDS = 60 * 60 * 1000 * 24;\nconst { getGlobalStylesChanges } = unlock( blockEditorPrivateApis );\n\nfunction ChangesSummary( { revision, previousRevision } ) {\n\tconst changes = getGlobalStylesChanges( revision, previousRevision, {\n\t\tmaxResults: 7,\n\t} );\n\n\tif ( ! changes.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<ul\n\t\t\tdata-testid=\"global-styles-revision-changes\"\n\t\t\tclassName=\"edit-site-global-styles-screen-revisions__changes\"\n\t\t>\n\t\t\t{ changes.map( ( change ) => (\n\t\t\t\t<li key={ change }>{ change }</li>\n\t\t\t) ) }\n\t\t</ul>\n\t);\n}\n\n/**\n * Returns a button label for the revision.\n *\n * @param {string|number} id A revision object.\n * @param {string} authorDisplayName Author name.\n * @param {string} formattedModifiedDate Revision modified date formatted.\n * @param {boolean} areStylesEqual Whether the revision matches the current editor styles.\n * @return {string} Translated label.\n */\nfunction getRevisionLabel(\n\tid,\n\tauthorDisplayName,\n\tformattedModifiedDate,\n\tareStylesEqual\n) {\n\tif ( 'parent' === id ) {\n\t\treturn __( 'Reset the styles to the theme defaults' );\n\t}\n\n\tif ( 'unsaved' === id ) {\n\t\treturn sprintf(\n\t\t\t/* translators: %s: author display name */\n\t\t\t__( 'Unsaved changes by %s' ),\n\t\t\tauthorDisplayName\n\t\t);\n\t}\n\n\treturn areStylesEqual\n\t\t? sprintf(\n\t\t\t\t// translators: 1: author display name. 2: revision creation date.\n\t\t\t\t__(\n\t\t\t\t\t'Changes saved by %1$s on %2$s. This revision matches current editor styles.'\n\t\t\t\t),\n\t\t\t\tauthorDisplayName,\n\t\t\t\tformattedModifiedDate\n\t\t )\n\t\t: sprintf(\n\t\t\t\t// translators: 1: author display name. 2: revision creation date.\n\t\t\t\t__( 'Changes saved by %1$s on %2$s' ),\n\t\t\t\tauthorDisplayName,\n\t\t\t\tformattedModifiedDate\n\t\t );\n}\n\n/**\n * Returns a rendered list of revisions buttons.\n *\n * @typedef {Object} props\n * @property {Array<Object>} userRevisions A collection of user revisions.\n * @property {number} selectedRevisionId The id of the currently-selected revision.\n * @property {Function} onChange Callback fired when a revision is selected.\n *\n * @param {props} Component props.\n * @return {JSX.Element} The modal component.\n */\nfunction RevisionsButtons( {\n\tuserRevisions,\n\tselectedRevisionId,\n\tonChange,\n\tcanApplyRevision,\n\tonApplyRevision,\n} ) {\n\tconst { currentThemeName, currentUser } = useSelect( ( select ) => {\n\t\tconst { getCurrentTheme, getCurrentUser } = select( coreStore );\n\t\tconst currentTheme = getCurrentTheme();\n\t\treturn {\n\t\t\tcurrentThemeName:\n\t\t\t\tcurrentTheme?.name?.rendered || currentTheme?.stylesheet,\n\t\t\tcurrentUser: getCurrentUser(),\n\t\t};\n\t}, [] );\n\tconst dateNowInMs = getDate().getTime();\n\tconst { datetimeAbbreviated } = getSettings().formats;\n\n\treturn (\n\t\t<Composite\n\t\t\torientation=\"vertical\"\n\t\t\tclassName=\"edit-site-global-styles-screen-revisions__revisions-list\"\n\t\t\taria-label={ __( 'Global styles revisions list' ) }\n\t\t\trole=\"listbox\"\n\t\t>\n\t\t\t{ userRevisions.map( ( revision, index ) => {\n\t\t\t\tconst { id, author, modified } = revision;\n\t\t\t\tconst isUnsaved = 'unsaved' === id;\n\t\t\t\t// Unsaved changes are created by the current user.\n\t\t\t\tconst revisionAuthor = isUnsaved ? currentUser : author;\n\t\t\t\tconst authorDisplayName = revisionAuthor?.name || __( 'User' );\n\t\t\t\tconst authorAvatar = revisionAuthor?.avatar_urls?.[ '48' ];\n\t\t\t\tconst isFirstItem = index === 0;\n\t\t\t\tconst isSelected = selectedRevisionId\n\t\t\t\t\t? selectedRevisionId === id\n\t\t\t\t\t: isFirstItem;\n\t\t\t\tconst areStylesEqual = ! canApplyRevision && isSelected;\n\t\t\t\tconst isReset = 'parent' === id;\n\t\t\t\tconst modifiedDate = getDate( modified );\n\t\t\t\tconst displayDate =\n\t\t\t\t\tmodified &&\n\t\t\t\t\tdateNowInMs - modifiedDate.getTime() > DAY_IN_MILLISECONDS\n\t\t\t\t\t\t? dateI18n( datetimeAbbreviated, modifiedDate )\n\t\t\t\t\t\t: humanTimeDiff( modified );\n\t\t\t\tconst revisionLabel = getRevisionLabel(\n\t\t\t\t\tid,\n\t\t\t\t\tauthorDisplayName,\n\t\t\t\t\tdateI18n( datetimeAbbreviated, modifiedDate ),\n\t\t\t\t\tareStylesEqual\n\t\t\t\t);\n\n\t\t\t\treturn (\n\t\t\t\t\t<Composite.Item\n\t\t\t\t\t\tkey={ id }\n\t\t\t\t\t\tclassName=\"edit-site-global-styles-screen-revisions__revision-item\"\n\t\t\t\t\t\taria-current={ isSelected }\n\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\t\t\t\tconst { keyCode } = event;\n\t\t\t\t\t\t\tif ( keyCode === ENTER || keyCode === SPACE ) {\n\t\t\t\t\t\t\t\tonChange( revision );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tonClick={ ( event ) => {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tonChange( revision );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\taria-selected={ isSelected }\n\t\t\t\t\t\taria-label={ revisionLabel }\n\t\t\t\t\t\trender={ <div /> }\n\t\t\t\t\t>\n\t\t\t\t\t\t<span className=\"edit-site-global-styles-screen-revisions__revision-item-wrapper\">\n\t\t\t\t\t\t\t{ isReset ? (\n\t\t\t\t\t\t\t\t<span className=\"edit-site-global-styles-screen-revisions__description\">\n\t\t\t\t\t\t\t\t\t{ __( 'Default styles' ) }\n\t\t\t\t\t\t\t\t\t<span className=\"edit-site-global-styles-screen-revisions__meta\">\n\t\t\t\t\t\t\t\t\t\t{ currentThemeName }\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<span className=\"edit-site-global-styles-screen-revisions__description\">\n\t\t\t\t\t\t\t\t\t{ isUnsaved ? (\n\t\t\t\t\t\t\t\t\t\t<span className=\"edit-site-global-styles-screen-revisions__date\">\n\t\t\t\t\t\t\t\t\t\t\t{ __( '(Unsaved)' ) }\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t<time\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"edit-site-global-styles-screen-revisions__date\"\n\t\t\t\t\t\t\t\t\t\t\tdateTime={ modified }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ displayDate }\n\t\t\t\t\t\t\t\t\t\t</time>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t<span className=\"edit-site-global-styles-screen-revisions__meta\">\n\t\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\t\talt={ authorDisplayName }\n\t\t\t\t\t\t\t\t\t\t\tsrc={ authorAvatar }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t{ authorDisplayName }\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t{ isSelected && (\n\t\t\t\t\t\t\t\t\t\t<ChangesSummary\n\t\t\t\t\t\t\t\t\t\t\trevision={ revision }\n\t\t\t\t\t\t\t\t\t\t\tpreviousRevision={\n\t\t\t\t\t\t\t\t\t\t\t\tindex < userRevisions.length\n\t\t\t\t\t\t\t\t\t\t\t\t\t? userRevisions[ index + 1 ]\n\t\t\t\t\t\t\t\t\t\t\t\t\t: {}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t{ isSelected &&\n\t\t\t\t\t\t\t( areStylesEqual ? (\n\t\t\t\t\t\t\t\t<p className=\"edit-site-global-styles-screen-revisions__applied-text\">\n\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t'These styles are already applied to your site.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\t\tclassName=\"edit-site-global-styles-screen-revisions__apply-button\"\n\t\t\t\t\t\t\t\t\tonClick={ onApplyRevision }\n\t\t\t\t\t\t\t\t\taria-label={ __(\n\t\t\t\t\t\t\t\t\t\t'Apply the selected revision to your site.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ isReset\n\t\t\t\t\t\t\t\t\t\t? __( 'Reset to defaults' )\n\t\t\t\t\t\t\t\t\t\t: __( 'Apply' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t</Composite.Item>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</Composite>\n\t);\n}\n\nexport default RevisionsButtons;\n"],
|
|
5
|
-
"mappings": "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",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js
DELETED
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import { useSelect } from "@wordpress/data";
|
|
2
|
-
import { store as coreStore } from "@wordpress/core-data";
|
|
3
|
-
import { useContext, useMemo } from "@wordpress/element";
|
|
4
|
-
import { privateApis as blockEditorPrivateApis } from "@wordpress/block-editor";
|
|
5
|
-
import { unlock } from "../../../lock-unlock";
|
|
6
|
-
const SITE_EDITOR_AUTHORS_QUERY = {
|
|
7
|
-
per_page: -1,
|
|
8
|
-
_fields: "id,name,avatar_urls",
|
|
9
|
-
context: "view",
|
|
10
|
-
capabilities: ["edit_theme_options"]
|
|
11
|
-
};
|
|
12
|
-
const DEFAULT_QUERY = { per_page: 100, page: 1 };
|
|
13
|
-
const EMPTY_ARRAY = [];
|
|
14
|
-
const { GlobalStylesContext } = unlock(blockEditorPrivateApis);
|
|
15
|
-
function useGlobalStylesRevisions({ query } = {}) {
|
|
16
|
-
const { user: userConfig } = useContext(GlobalStylesContext);
|
|
17
|
-
const _query = { ...DEFAULT_QUERY, ...query };
|
|
18
|
-
const {
|
|
19
|
-
authors,
|
|
20
|
-
currentUser,
|
|
21
|
-
isDirty,
|
|
22
|
-
revisions,
|
|
23
|
-
isLoadingGlobalStylesRevisions,
|
|
24
|
-
revisionsCount
|
|
25
|
-
} = useSelect(
|
|
26
|
-
(select) => {
|
|
27
|
-
const {
|
|
28
|
-
__experimentalGetDirtyEntityRecords,
|
|
29
|
-
getCurrentUser,
|
|
30
|
-
getUsers,
|
|
31
|
-
getRevisions,
|
|
32
|
-
__experimentalGetCurrentGlobalStylesId,
|
|
33
|
-
getEntityRecord,
|
|
34
|
-
isResolving
|
|
35
|
-
} = select(coreStore);
|
|
36
|
-
const dirtyEntityRecords = __experimentalGetDirtyEntityRecords();
|
|
37
|
-
const _currentUser = getCurrentUser();
|
|
38
|
-
const _isDirty = dirtyEntityRecords.length > 0;
|
|
39
|
-
const globalStylesId = __experimentalGetCurrentGlobalStylesId();
|
|
40
|
-
const globalStyles = globalStylesId ? getEntityRecord("root", "globalStyles", globalStylesId) : void 0;
|
|
41
|
-
const _revisionsCount = globalStyles?._links?.["version-history"]?.[0]?.count ?? 0;
|
|
42
|
-
const globalStylesRevisions = getRevisions(
|
|
43
|
-
"root",
|
|
44
|
-
"globalStyles",
|
|
45
|
-
globalStylesId,
|
|
46
|
-
_query
|
|
47
|
-
) || EMPTY_ARRAY;
|
|
48
|
-
const _authors = getUsers(SITE_EDITOR_AUTHORS_QUERY) || EMPTY_ARRAY;
|
|
49
|
-
const _isResolving = isResolving("getRevisions", [
|
|
50
|
-
"root",
|
|
51
|
-
"globalStyles",
|
|
52
|
-
globalStylesId,
|
|
53
|
-
_query
|
|
54
|
-
]);
|
|
55
|
-
return {
|
|
56
|
-
authors: _authors,
|
|
57
|
-
currentUser: _currentUser,
|
|
58
|
-
isDirty: _isDirty,
|
|
59
|
-
revisions: globalStylesRevisions,
|
|
60
|
-
isLoadingGlobalStylesRevisions: _isResolving,
|
|
61
|
-
revisionsCount: _revisionsCount
|
|
62
|
-
};
|
|
63
|
-
},
|
|
64
|
-
[query]
|
|
65
|
-
);
|
|
66
|
-
return useMemo(() => {
|
|
67
|
-
if (!authors.length || isLoadingGlobalStylesRevisions) {
|
|
68
|
-
return {
|
|
69
|
-
revisions: EMPTY_ARRAY,
|
|
70
|
-
hasUnsavedChanges: isDirty,
|
|
71
|
-
isLoading: true,
|
|
72
|
-
revisionsCount
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
const _modifiedRevisions = revisions.map((revision) => {
|
|
76
|
-
return {
|
|
77
|
-
...revision,
|
|
78
|
-
author: authors.find(
|
|
79
|
-
(author) => author.id === revision.author
|
|
80
|
-
)
|
|
81
|
-
};
|
|
82
|
-
});
|
|
83
|
-
const fetchedRevisionsCount = revisions.length;
|
|
84
|
-
if (fetchedRevisionsCount) {
|
|
85
|
-
if (_modifiedRevisions[0].id !== "unsaved" && _query.page === 1) {
|
|
86
|
-
_modifiedRevisions[0].isLatest = true;
|
|
87
|
-
}
|
|
88
|
-
if (isDirty && userConfig && Object.keys(userConfig).length > 0 && currentUser && _query.page === 1) {
|
|
89
|
-
const unsavedRevision = {
|
|
90
|
-
id: "unsaved",
|
|
91
|
-
styles: userConfig?.styles,
|
|
92
|
-
settings: userConfig?.settings,
|
|
93
|
-
_links: userConfig?._links,
|
|
94
|
-
author: {
|
|
95
|
-
name: currentUser?.name,
|
|
96
|
-
avatar_urls: currentUser?.avatar_urls
|
|
97
|
-
},
|
|
98
|
-
modified: /* @__PURE__ */ new Date()
|
|
99
|
-
};
|
|
100
|
-
_modifiedRevisions.unshift(unsavedRevision);
|
|
101
|
-
}
|
|
102
|
-
if (_query.page === Math.ceil(revisionsCount / _query.per_page)) {
|
|
103
|
-
_modifiedRevisions.push({
|
|
104
|
-
id: "parent",
|
|
105
|
-
styles: {},
|
|
106
|
-
settings: {}
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
return {
|
|
111
|
-
revisions: _modifiedRevisions,
|
|
112
|
-
hasUnsavedChanges: isDirty,
|
|
113
|
-
isLoading: false,
|
|
114
|
-
revisionsCount
|
|
115
|
-
};
|
|
116
|
-
}, [
|
|
117
|
-
isDirty,
|
|
118
|
-
revisions,
|
|
119
|
-
currentUser,
|
|
120
|
-
authors,
|
|
121
|
-
userConfig,
|
|
122
|
-
isLoadingGlobalStylesRevisions
|
|
123
|
-
]);
|
|
124
|
-
}
|
|
125
|
-
export {
|
|
126
|
-
useGlobalStylesRevisions as default
|
|
127
|
-
};
|
|
128
|
-
//# sourceMappingURL=use-global-styles-revisions.js.map
|
package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/components/global-styles/screen-revisions/use-global-styles-revisions.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useContext, useMemo } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\n\nconst SITE_EDITOR_AUTHORS_QUERY = {\n\tper_page: -1,\n\t_fields: 'id,name,avatar_urls',\n\tcontext: 'view',\n\tcapabilities: [ 'edit_theme_options' ],\n};\nconst DEFAULT_QUERY = { per_page: 100, page: 1 };\nconst EMPTY_ARRAY = [];\nconst { GlobalStylesContext } = unlock( blockEditorPrivateApis );\nexport default function useGlobalStylesRevisions( { query } = {} ) {\n\tconst { user: userConfig } = useContext( GlobalStylesContext );\n\tconst _query = { ...DEFAULT_QUERY, ...query };\n\tconst {\n\t\tauthors,\n\t\tcurrentUser,\n\t\tisDirty,\n\t\trevisions,\n\t\tisLoadingGlobalStylesRevisions,\n\t\trevisionsCount,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\t\tgetCurrentUser,\n\t\t\t\tgetUsers,\n\t\t\t\tgetRevisions,\n\t\t\t\t__experimentalGetCurrentGlobalStylesId,\n\t\t\t\tgetEntityRecord,\n\t\t\t\tisResolving,\n\t\t\t} = select( coreStore );\n\t\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\t\tconst _currentUser = getCurrentUser();\n\t\t\tconst _isDirty = dirtyEntityRecords.length > 0;\n\t\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\t\tconst globalStyles = globalStylesId\n\t\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t\t: undefined;\n\t\t\tconst _revisionsCount =\n\t\t\t\tglobalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count ?? 0;\n\t\t\tconst globalStylesRevisions =\n\t\t\t\tgetRevisions(\n\t\t\t\t\t'root',\n\t\t\t\t\t'globalStyles',\n\t\t\t\t\tglobalStylesId,\n\t\t\t\t\t_query\n\t\t\t\t) || EMPTY_ARRAY;\n\t\t\tconst _authors =\n\t\t\t\tgetUsers( SITE_EDITOR_AUTHORS_QUERY ) || EMPTY_ARRAY;\n\t\t\tconst _isResolving = isResolving( 'getRevisions', [\n\t\t\t\t'root',\n\t\t\t\t'globalStyles',\n\t\t\t\tglobalStylesId,\n\t\t\t\t_query,\n\t\t\t] );\n\t\t\treturn {\n\t\t\t\tauthors: _authors,\n\t\t\t\tcurrentUser: _currentUser,\n\t\t\t\tisDirty: _isDirty,\n\t\t\t\trevisions: globalStylesRevisions,\n\t\t\t\tisLoadingGlobalStylesRevisions: _isResolving,\n\t\t\t\trevisionsCount: _revisionsCount,\n\t\t\t};\n\t\t},\n\t\t[ query ]\n\t);\n\treturn useMemo( () => {\n\t\tif ( ! authors.length || isLoadingGlobalStylesRevisions ) {\n\t\t\treturn {\n\t\t\t\trevisions: EMPTY_ARRAY,\n\t\t\t\thasUnsavedChanges: isDirty,\n\t\t\t\tisLoading: true,\n\t\t\t\trevisionsCount,\n\t\t\t};\n\t\t}\n\n\t\t// Adds author details to each revision.\n\t\tconst _modifiedRevisions = revisions.map( ( revision ) => {\n\t\t\treturn {\n\t\t\t\t...revision,\n\t\t\t\tauthor: authors.find(\n\t\t\t\t\t( author ) => author.id === revision.author\n\t\t\t\t),\n\t\t\t};\n\t\t} );\n\n\t\tconst fetchedRevisionsCount = revisions.length;\n\n\t\tif ( fetchedRevisionsCount ) {\n\t\t\t// Flags the most current saved revision.\n\t\t\tif (\n\t\t\t\t_modifiedRevisions[ 0 ].id !== 'unsaved' &&\n\t\t\t\t_query.page === 1\n\t\t\t) {\n\t\t\t\t_modifiedRevisions[ 0 ].isLatest = true;\n\t\t\t}\n\n\t\t\t// Adds an item for unsaved changes.\n\t\t\tif (\n\t\t\t\tisDirty &&\n\t\t\t\tuserConfig &&\n\t\t\t\tObject.keys( userConfig ).length > 0 &&\n\t\t\t\tcurrentUser &&\n\t\t\t\t_query.page === 1\n\t\t\t) {\n\t\t\t\tconst unsavedRevision = {\n\t\t\t\t\tid: 'unsaved',\n\t\t\t\t\tstyles: userConfig?.styles,\n\t\t\t\t\tsettings: userConfig?.settings,\n\t\t\t\t\t_links: userConfig?._links,\n\t\t\t\t\tauthor: {\n\t\t\t\t\t\tname: currentUser?.name,\n\t\t\t\t\t\tavatar_urls: currentUser?.avatar_urls,\n\t\t\t\t\t},\n\t\t\t\t\tmodified: new Date(),\n\t\t\t\t};\n\n\t\t\t\t_modifiedRevisions.unshift( unsavedRevision );\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t_query.page === Math.ceil( revisionsCount / _query.per_page )\n\t\t\t) {\n\t\t\t\t// Adds an item for the default theme styles.\n\t\t\t\t_modifiedRevisions.push( {\n\t\t\t\t\tid: 'parent',\n\t\t\t\t\tstyles: {},\n\t\t\t\t\tsettings: {},\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\trevisions: _modifiedRevisions,\n\t\t\thasUnsavedChanges: isDirty,\n\t\t\tisLoading: false,\n\t\t\trevisionsCount,\n\t\t};\n\t}, [\n\t\tisDirty,\n\t\trevisions,\n\t\tcurrentUser,\n\t\tauthors,\n\t\tuserConfig,\n\t\tisLoadingGlobalStylesRevisions,\n\t] );\n}\n"],
|
|
5
|
-
"mappings": "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",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
__experimentalItemGroup as ItemGroup,
|
|
4
|
-
__experimentalHStack as HStack,
|
|
5
|
-
__experimentalSpacer as Spacer,
|
|
6
|
-
__experimentalVStack as VStack,
|
|
7
|
-
FlexItem,
|
|
8
|
-
CardBody,
|
|
9
|
-
Card,
|
|
10
|
-
CardDivider,
|
|
11
|
-
CardMedia
|
|
12
|
-
} from "@wordpress/components";
|
|
13
|
-
import { isRTL, __ } from "@wordpress/i18n";
|
|
14
|
-
import { chevronLeft, chevronRight } from "@wordpress/icons";
|
|
15
|
-
import { useSelect } from "@wordpress/data";
|
|
16
|
-
import { store as coreStore } from "@wordpress/core-data";
|
|
17
|
-
import { IconWithCurrentColor } from "./icon-with-current-color";
|
|
18
|
-
import { NavigationButtonAsItem } from "./navigation-button";
|
|
19
|
-
import RootMenu from "./root-menu";
|
|
20
|
-
import PreviewStyles from "./preview-styles";
|
|
21
|
-
function ScreenRoot() {
|
|
22
|
-
const hasVariations = useSelect((select) => {
|
|
23
|
-
const { __experimentalGetCurrentThemeGlobalStylesVariations } = select(coreStore);
|
|
24
|
-
return !!__experimentalGetCurrentThemeGlobalStylesVariations()?.length;
|
|
25
|
-
}, []);
|
|
26
|
-
return /* @__PURE__ */ jsxs(
|
|
27
|
-
Card,
|
|
28
|
-
{
|
|
29
|
-
size: "small",
|
|
30
|
-
isBorderless: true,
|
|
31
|
-
className: "edit-site-global-styles-screen-root",
|
|
32
|
-
isRounded: false,
|
|
33
|
-
children: [
|
|
34
|
-
/* @__PURE__ */ jsx(CardBody, { children: /* @__PURE__ */ jsxs(VStack, { spacing: 4, children: [
|
|
35
|
-
/* @__PURE__ */ jsx(Card, { className: "edit-site-global-styles-screen-root__active-style-tile", children: /* @__PURE__ */ jsx(CardMedia, { className: "edit-site-global-styles-screen-root__active-style-tile-preview", children: /* @__PURE__ */ jsx(PreviewStyles, {}) }) }),
|
|
36
|
-
hasVariations && /* @__PURE__ */ jsx(ItemGroup, { children: /* @__PURE__ */ jsx(NavigationButtonAsItem, { path: "/variations", children: /* @__PURE__ */ jsxs(HStack, { justify: "space-between", children: [
|
|
37
|
-
/* @__PURE__ */ jsx(FlexItem, { children: __("Browse styles") }),
|
|
38
|
-
/* @__PURE__ */ jsx(
|
|
39
|
-
IconWithCurrentColor,
|
|
40
|
-
{
|
|
41
|
-
icon: isRTL() ? chevronLeft : chevronRight
|
|
42
|
-
}
|
|
43
|
-
)
|
|
44
|
-
] }) }) }),
|
|
45
|
-
/* @__PURE__ */ jsx(RootMenu, {})
|
|
46
|
-
] }) }),
|
|
47
|
-
/* @__PURE__ */ jsx(CardDivider, {}),
|
|
48
|
-
/* @__PURE__ */ jsxs(CardBody, { children: [
|
|
49
|
-
/* @__PURE__ */ jsx(
|
|
50
|
-
Spacer,
|
|
51
|
-
{
|
|
52
|
-
as: "p",
|
|
53
|
-
paddingTop: 2,
|
|
54
|
-
paddingX: "13px",
|
|
55
|
-
marginBottom: 2,
|
|
56
|
-
children: __(
|
|
57
|
-
"Customize the appearance of specific blocks for the whole site."
|
|
58
|
-
)
|
|
59
|
-
}
|
|
60
|
-
),
|
|
61
|
-
/* @__PURE__ */ jsx(ItemGroup, { children: /* @__PURE__ */ jsx(NavigationButtonAsItem, { path: "/blocks", children: /* @__PURE__ */ jsxs(HStack, { justify: "space-between", children: [
|
|
62
|
-
/* @__PURE__ */ jsx(FlexItem, { children: __("Blocks") }),
|
|
63
|
-
/* @__PURE__ */ jsx(
|
|
64
|
-
IconWithCurrentColor,
|
|
65
|
-
{
|
|
66
|
-
icon: isRTL() ? chevronLeft : chevronRight
|
|
67
|
-
}
|
|
68
|
-
)
|
|
69
|
-
] }) }) })
|
|
70
|
-
] })
|
|
71
|
-
]
|
|
72
|
-
}
|
|
73
|
-
);
|
|
74
|
-
}
|
|
75
|
-
var screen_root_default = ScreenRoot;
|
|
76
|
-
export {
|
|
77
|
-
screen_root_default as default
|
|
78
|
-
};
|
|
79
|
-
//# sourceMappingURL=screen-root.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/global-styles/screen-root.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalHStack as HStack,\n\t__experimentalSpacer as Spacer,\n\t__experimentalVStack as VStack,\n\tFlexItem,\n\tCardBody,\n\tCard,\n\tCardDivider,\n\tCardMedia,\n} from '@wordpress/components';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { chevronLeft, chevronRight } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { IconWithCurrentColor } from './icon-with-current-color';\nimport { NavigationButtonAsItem } from './navigation-button';\nimport RootMenu from './root-menu';\nimport PreviewStyles from './preview-styles';\n\nfunction ScreenRoot() {\n\tconst hasVariations = useSelect( ( select ) => {\n\t\tconst { __experimentalGetCurrentThemeGlobalStylesVariations } =\n\t\t\tselect( coreStore );\n\t\treturn !! __experimentalGetCurrentThemeGlobalStylesVariations()?.length;\n\t}, [] );\n\n\treturn (\n\t\t<Card\n\t\t\tsize=\"small\"\n\t\t\tisBorderless\n\t\t\tclassName=\"edit-site-global-styles-screen-root\"\n\t\t\tisRounded={ false }\n\t\t>\n\t\t\t<CardBody>\n\t\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t\t<Card className=\"edit-site-global-styles-screen-root__active-style-tile\">\n\t\t\t\t\t\t<CardMedia className=\"edit-site-global-styles-screen-root__active-style-tile-preview\">\n\t\t\t\t\t\t\t<PreviewStyles />\n\t\t\t\t\t\t</CardMedia>\n\t\t\t\t\t</Card>\n\t\t\t\t\t{ hasVariations && (\n\t\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t\t<NavigationButtonAsItem path=\"/variations\">\n\t\t\t\t\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Browse styles' ) }\n\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t<IconWithCurrentColor\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\tisRTL() ? chevronLeft : chevronRight\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t) }\n\t\t\t\t\t<RootMenu />\n\t\t\t\t</VStack>\n\t\t\t</CardBody>\n\n\t\t\t<CardDivider />\n\n\t\t\t<CardBody>\n\t\t\t\t<Spacer\n\t\t\t\t\tas=\"p\"\n\t\t\t\t\tpaddingTop={ 2 }\n\t\t\t\t\t/*\n\t\t\t\t\t * 13px matches the text inset of the NavigationButton (12px padding, plus the width of the button's border).\n\t\t\t\t\t * This is an ad hoc override for this instance and the Additional CSS option below. Other options for matching the\n\t\t\t\t\t * the nav button inset should be looked at before reusing further.\n\t\t\t\t\t */\n\t\t\t\t\tpaddingX=\"13px\"\n\t\t\t\t\tmarginBottom={ 2 }\n\t\t\t\t>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Customize the appearance of specific blocks for the whole site.'\n\t\t\t\t\t) }\n\t\t\t\t</Spacer>\n\t\t\t\t<ItemGroup>\n\t\t\t\t\t<NavigationButtonAsItem path=\"/blocks\">\n\t\t\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t\t\t<FlexItem>{ __( 'Blocks' ) }</FlexItem>\n\t\t\t\t\t\t\t<IconWithCurrentColor\n\t\t\t\t\t\t\t\ticon={ isRTL() ? chevronLeft : chevronRight }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t</ItemGroup>\n\t\t\t</CardBody>\n\t\t</Card>\n\t);\n}\n\nexport default ScreenRoot;\n"],
|
|
5
|
-
"mappings": "AA6CO,cAMC,YAND;AA1CP;AAAA,EACC,2BAA2B;AAAA,EAC3B,wBAAwB;AAAA,EACxB,wBAAwB;AAAA,EACxB,wBAAwB;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,OAAO,UAAU;AAC1B,SAAS,aAAa,oBAAoB;AAC1C,SAAS,iBAAiB;AAC1B,SAAS,SAAS,iBAAiB;AAKnC,SAAS,4BAA4B;AACrC,SAAS,8BAA8B;AACvC,OAAO,cAAc;AACrB,OAAO,mBAAmB;AAE1B,SAAS,aAAa;AACrB,QAAM,gBAAgB,UAAW,CAAE,WAAY;AAC9C,UAAM,EAAE,oDAAoD,IAC3D,OAAQ,SAAU;AACnB,WAAO,CAAC,CAAE,oDAAoD,GAAG;AAAA,EAClE,GAAG,CAAC,CAAE;AAEN,SACC;AAAA,IAAC;AAAA;AAAA,MACA,MAAK;AAAA,MACL,cAAY;AAAA,MACZ,WAAU;AAAA,MACV,WAAY;AAAA,MAEZ;AAAA,4BAAC,YACA,+BAAC,UAAO,SAAU,GACjB;AAAA,8BAAC,QAAK,WAAU,0DACf,8BAAC,aAAU,WAAU,kEACpB,8BAAC,iBAAc,GAChB,GACD;AAAA,UACE,iBACD,oBAAC,aACA,8BAAC,0BAAuB,MAAK,eAC5B,+BAAC,UAAO,SAAQ,iBACf;AAAA,gCAAC,YACE,aAAI,eAAgB,GACvB;AAAA,YACA;AAAA,cAAC;AAAA;AAAA,gBACA,MACC,MAAM,IAAI,cAAc;AAAA;AAAA,YAE1B;AAAA,aACD,GACD,GACD;AAAA,UAED,oBAAC,YAAS;AAAA,WACX,GACD;AAAA,QAEA,oBAAC,eAAY;AAAA,QAEb,qBAAC,YACA;AAAA;AAAA,YAAC;AAAA;AAAA,cACA,IAAG;AAAA,cACH,YAAa;AAAA,cAMb,UAAS;AAAA,cACT,cAAe;AAAA,cAEb;AAAA,gBACD;AAAA,cACD;AAAA;AAAA,UACD;AAAA,UACA,oBAAC,aACA,8BAAC,0BAAuB,MAAK,WAC5B,+BAAC,UAAO,SAAQ,iBACf;AAAA,gCAAC,YAAW,aAAI,QAAS,GAAG;AAAA,YAC5B;AAAA,cAAC;AAAA;AAAA,gBACA,MAAO,MAAM,IAAI,cAAc;AAAA;AAAA,YAChC;AAAA,aACD,GACD,GACD;AAAA,WACD;AAAA;AAAA;AAAA,EACD;AAEF;AAEA,IAAO,sBAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import ShadowsPanel from "./shadows-panel";
|
|
3
|
-
import ShadowsEditPanel from "./shadows-edit-panel";
|
|
4
|
-
function ScreenShadows() {
|
|
5
|
-
return /* @__PURE__ */ jsx(ShadowsPanel, {});
|
|
6
|
-
}
|
|
7
|
-
function ScreenShadowsEdit() {
|
|
8
|
-
return /* @__PURE__ */ jsx(ShadowsEditPanel, {});
|
|
9
|
-
}
|
|
10
|
-
export {
|
|
11
|
-
ScreenShadows,
|
|
12
|
-
ScreenShadowsEdit
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=screen-shadows.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/global-styles/screen-shadows.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport ShadowsPanel from './shadows-panel';\nimport ShadowsEditPanel from './shadows-edit-panel';\n\nexport function ScreenShadows() {\n\treturn <ShadowsPanel />;\n}\n\nexport function ScreenShadowsEdit() {\n\treturn <ShadowsEditPanel />;\n}\n"],
|
|
5
|
-
"mappings": "AAOQ;AAJR,OAAO,kBAAkB;AACzB,OAAO,sBAAsB;AAEtB,SAAS,gBAAgB;AAC/B,SAAO,oBAAC,gBAAa;AACtB;AAEO,SAAS,oBAAoB;AACnC,SAAO,oBAAC,oBAAiB;AAC1B;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|