@wordpress/edit-site 5.24.1 → 5.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/add-new-template/add-custom-template-modal-content.js +2 -3
- package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
- package/build/components/block-editor/editor-canvas.js +48 -23
- package/build/components/block-editor/editor-canvas.js.map +1 -1
- package/build/components/block-editor/site-editor-canvas.js +5 -54
- package/build/components/block-editor/site-editor-canvas.js.map +1 -1
- package/build/components/block-editor/use-site-editor-settings.js +14 -5
- package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build/components/editor/index.js +6 -17
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/collection-font-variant.js +8 -7
- package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
- package/build/components/global-styles/font-library-modal/context.js +1 -1
- package/build/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build/components/global-styles/font-library-modal/library-font-variant.js +8 -7
- package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
- package/build/components/global-styles/screen-revisions/get-revision-changes.js +146 -0
- package/build/components/global-styles/screen-revisions/get-revision-changes.js.map +1 -0
- package/build/components/global-styles/screen-revisions/index.js +6 -10
- package/build/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +63 -13
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build/components/header-edit-mode/document-tools/index.js +17 -10
- package/build/components/header-edit-mode/document-tools/index.js.map +1 -1
- package/build/components/header-edit-mode/index.js +16 -38
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/header-edit-mode/more-menu/index.js +11 -9
- package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build/components/layout/index.js +9 -8
- package/build/components/layout/index.js.map +1 -1
- package/build/components/page/header.js +2 -1
- package/build/components/page/header.js.map +1 -1
- package/build/components/page-pages/index.js +31 -28
- package/build/components/page-pages/index.js.map +1 -1
- package/build/components/page-patterns/patterns-list.js +1 -2
- package/build/components/page-patterns/patterns-list.js.map +1 -1
- package/build/components/page-patterns/rename-menu-item.js +3 -0
- package/build/components/page-patterns/rename-menu-item.js.map +1 -1
- package/build/components/page-templates/dataviews-templates.js +18 -17
- package/build/components/page-templates/dataviews-templates.js.map +1 -1
- package/build/components/preferences-modal/index.js +36 -20
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/routes/use-title.js +3 -4
- package/build/components/routes/use-title.js.map +1 -1
- package/build/components/save-button/index.js +2 -1
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/sidebar/index.js +26 -12
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-dataviews/dataview-item.js +2 -10
- package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build/components/sidebar-dataviews/default-views.js +2 -2
- package/build/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/index.js +9 -3
- package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/page-summary.js +1 -2
- package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +3 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
- package/build/components/sidebar-navigation-screen-template/home-template-details.js +3 -89
- package/build/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -1
- package/build/components/sidebar-navigation-screen-template/index.js +2 -1
- package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-template/template-areas.js +117 -0
- package/build/components/sidebar-navigation-screen-template/template-areas.js.map +1 -0
- package/build/components/site-hub/index.js +6 -3
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/template-actions/rename-menu-item.js +3 -0
- package/build/components/template-actions/rename-menu-item.js.map +1 -1
- package/build/components/welcome-guide/styles.js +1 -1
- package/build/components/welcome-guide/styles.js.map +1 -1
- package/build/hooks/commands/use-common-commands.js +9 -1
- package/build/hooks/commands/use-common-commands.js.map +1 -1
- package/build/hooks/navigation-menu-edit.js +1 -1
- package/build/hooks/navigation-menu-edit.js.map +1 -1
- package/build/hooks/template-part-edit.js +1 -1
- package/build/hooks/template-part-edit.js.map +1 -1
- package/build/store/actions.js +15 -8
- package/build/store/actions.js.map +1 -1
- package/build/store/reducer.js +0 -18
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +12 -6
- package/build/store/selectors.js.map +1 -1
- package/build/utils/constants.js +15 -1
- package/build/utils/constants.js.map +1 -1
- package/build-module/components/add-new-template/add-custom-template-modal-content.js +1 -1
- package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
- package/build-module/components/block-editor/editor-canvas.js +50 -25
- package/build-module/components/block-editor/editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/site-editor-canvas.js +8 -56
- package/build-module/components/block-editor/site-editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/use-site-editor-settings.js +14 -5
- package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build-module/components/editor/index.js +9 -20
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/collection-font-variant.js +9 -7
- package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/context.js +1 -1
- package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js +9 -7
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/get-revision-changes.js +139 -0
- package/build-module/components/global-styles/screen-revisions/get-revision-changes.js.map +1 -0
- package/build-module/components/global-styles/screen-revisions/index.js +7 -11
- package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +64 -14
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build-module/components/header-edit-mode/document-tools/index.js +17 -10
- package/build-module/components/header-edit-mode/document-tools/index.js.map +1 -1
- package/build-module/components/header-edit-mode/index.js +20 -42
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/header-edit-mode/more-menu/index.js +12 -10
- package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build-module/components/layout/index.js +9 -8
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/page/header.js +2 -1
- package/build-module/components/page/header.js.map +1 -1
- package/build-module/components/page-pages/index.js +31 -28
- package/build-module/components/page-pages/index.js.map +1 -1
- package/build-module/components/page-patterns/patterns-list.js +1 -2
- package/build-module/components/page-patterns/patterns-list.js.map +1 -1
- package/build-module/components/page-patterns/rename-menu-item.js +3 -0
- package/build-module/components/page-patterns/rename-menu-item.js.map +1 -1
- package/build-module/components/page-templates/dataviews-templates.js +18 -17
- package/build-module/components/page-templates/dataviews-templates.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +37 -21
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/routes/use-title.js +3 -4
- package/build-module/components/routes/use-title.js.map +1 -1
- package/build-module/components/save-button/index.js +2 -1
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +26 -12
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/dataview-item.js +2 -10
- package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build-module/components/sidebar-dataviews/default-views.js +2 -2
- package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/index.js +9 -3
- package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +2 -3
- package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +3 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-template/home-template-details.js +5 -90
- package/build-module/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-template/index.js +2 -1
- package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-template/template-areas.js +109 -0
- package/build-module/components/sidebar-navigation-screen-template/template-areas.js.map +1 -0
- package/build-module/components/site-hub/index.js +6 -3
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/template-actions/rename-menu-item.js +3 -0
- package/build-module/components/template-actions/rename-menu-item.js.map +1 -1
- package/build-module/components/welcome-guide/styles.js +1 -1
- package/build-module/components/welcome-guide/styles.js.map +1 -1
- package/build-module/hooks/commands/use-common-commands.js +9 -1
- package/build-module/hooks/commands/use-common-commands.js.map +1 -1
- package/build-module/hooks/navigation-menu-edit.js +1 -1
- package/build-module/hooks/navigation-menu-edit.js.map +1 -1
- package/build-module/hooks/template-part-edit.js +1 -1
- package/build-module/hooks/template-part-edit.js.map +1 -1
- package/build-module/store/actions.js +13 -6
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/reducer.js +0 -17
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +10 -3
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/constants.js +8 -0
- package/build-module/utils/constants.js.map +1 -1
- package/build-style/style-rtl.css +302 -354
- package/build-style/style.css +302 -354
- package/package.json +42 -42
- package/src/components/add-new-template/add-custom-template-modal-content.js +1 -1
- package/src/components/block-editor/editor-canvas.js +63 -47
- package/src/components/block-editor/site-editor-canvas.js +32 -96
- package/src/components/block-editor/style.scss +6 -12
- package/src/components/block-editor/use-site-editor-settings.js +47 -36
- package/src/components/editor/index.js +10 -16
- package/src/components/global-styles/font-library-modal/collection-font-variant.js +12 -6
- package/src/components/global-styles/font-library-modal/context.js +1 -1
- package/src/components/global-styles/font-library-modal/library-font-variant.js +12 -6
- package/src/components/global-styles/screen-revisions/get-revision-changes.js +171 -0
- package/src/components/global-styles/screen-revisions/index.js +4 -11
- package/src/components/global-styles/screen-revisions/revisions-buttons.js +86 -17
- package/src/components/global-styles/screen-revisions/style.scss +10 -2
- package/src/components/global-styles/screen-revisions/test/get-revision-changes.js +191 -0
- package/src/components/header-edit-mode/document-tools/index.js +13 -13
- package/src/components/header-edit-mode/index.js +29 -63
- package/src/components/header-edit-mode/more-menu/index.js +18 -22
- package/src/components/header-edit-mode/style.scss +58 -33
- package/src/components/layout/index.js +21 -20
- package/src/components/list/style.scss +5 -0
- package/src/components/page/header.js +2 -1
- package/src/components/page/style.scss +2 -2
- package/src/components/page-pages/index.js +59 -35
- package/src/components/page-pages/style.scss +3 -1
- package/src/components/page-patterns/patterns-list.js +5 -2
- package/src/components/page-patterns/rename-menu-item.js +7 -1
- package/src/components/page-templates/dataviews-templates.js +28 -13
- package/src/components/preferences-modal/index.js +59 -33
- package/src/components/routes/use-title.js +3 -10
- package/src/components/save-button/index.js +1 -0
- package/src/components/sidebar/index.js +41 -24
- package/src/components/sidebar/style.scss +10 -12
- package/src/components/sidebar-dataviews/dataview-item.js +3 -7
- package/src/components/sidebar-dataviews/default-views.js +2 -2
- package/src/components/sidebar-edit-mode/page-panels/index.js +39 -25
- package/src/components/sidebar-edit-mode/page-panels/page-summary.js +2 -2
- package/src/components/sidebar-edit-mode/page-panels/style.scss +1 -42
- package/src/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +7 -1
- package/src/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +1 -1
- package/src/components/sidebar-navigation-screen-template/home-template-details.js +1 -96
- package/src/components/sidebar-navigation-screen-template/index.js +8 -2
- package/src/components/sidebar-navigation-screen-template/template-areas.js +135 -0
- package/src/components/site-hub/index.js +4 -5
- package/src/components/template-actions/rename-menu-item.js +7 -1
- package/src/components/welcome-guide/styles.js +1 -1
- package/src/hooks/commands/use-common-commands.js +10 -5
- package/src/hooks/navigation-menu-edit.js +1 -1
- package/src/hooks/template-part-edit.js +1 -1
- package/src/store/actions.js +15 -5
- package/src/store/reducer.js +0 -18
- package/src/store/selectors.js +15 -3
- package/src/style.scss +1 -2
- package/src/utils/constants.js +8 -0
- package/build/components/dataviews/add-filter.js +0 -91
- package/build/components/dataviews/add-filter.js.map +0 -1
- package/build/components/dataviews/constants.js +0 -14
- package/build/components/dataviews/constants.js.map +0 -1
- package/build/components/dataviews/dataviews.js +0 -99
- package/build/components/dataviews/dataviews.js.map +0 -1
- package/build/components/dataviews/filter-summary.js +0 -62
- package/build/components/dataviews/filter-summary.js.map +0 -1
- package/build/components/dataviews/filters.js +0 -63
- package/build/components/dataviews/filters.js.map +0 -1
- package/build/components/dataviews/index.js +0 -21
- package/build/components/dataviews/index.js.map +0 -1
- package/build/components/dataviews/item-actions.js +0 -184
- package/build/components/dataviews/item-actions.js.map +0 -1
- package/build/components/dataviews/pagination.js +0 -123
- package/build/components/dataviews/pagination.js.map +0 -1
- package/build/components/dataviews/reset-filters.js +0 -33
- package/build/components/dataviews/reset-filters.js.map +0 -1
- package/build/components/dataviews/search.js +0 -51
- package/build/components/dataviews/search.js.map +0 -1
- package/build/components/dataviews/view-actions.js +0 -244
- package/build/components/dataviews/view-actions.js.map +0 -1
- package/build/components/dataviews/view-grid.js +0 -82
- package/build/components/dataviews/view-grid.js.map +0 -1
- package/build/components/dataviews/view-list.js +0 -399
- package/build/components/dataviews/view-list.js.map +0 -1
- package/build/components/dataviews/view-side-by-side.js +0 -20
- package/build/components/dataviews/view-side-by-side.js.map +0 -1
- package/build/components/header-edit-mode/document-actions/index.js +0 -172
- package/build/components/header-edit-mode/document-actions/index.js.map +0 -1
- package/build/components/page-content-focus-notifications/back-to-page-notification.js +0 -61
- package/build/components/page-content-focus-notifications/back-to-page-notification.js.map +0 -1
- package/build/components/page-content-focus-notifications/edit-template-notification.js +0 -102
- package/build/components/page-content-focus-notifications/edit-template-notification.js.map +0 -1
- package/build/components/page-content-focus-notifications/index.js +0 -22
- package/build/components/page-content-focus-notifications/index.js.map +0 -1
- package/build/components/sidebar-edit-mode/page-panels/edit-template.js +0 -101
- package/build/components/sidebar-edit-mode/page-panels/edit-template.js.map +0 -1
- package/build/components/sidebar-edit-mode/page-panels/hooks.js +0 -79
- package/build/components/sidebar-edit-mode/page-panels/hooks.js.map +0 -1
- package/build/components/sidebar-edit-mode/page-panels/reset-default-template.js +0 -48
- package/build/components/sidebar-edit-mode/page-panels/reset-default-template.js.map +0 -1
- package/build/components/sidebar-edit-mode/page-panels/swap-template-button.js +0 -84
- package/build/components/sidebar-edit-mode/page-panels/swap-template-button.js.map +0 -1
- package/build/utils/use-debounced-input.js +0 -22
- package/build/utils/use-debounced-input.js.map +0 -1
- package/build-module/components/dataviews/add-filter.js +0 -84
- package/build-module/components/dataviews/add-filter.js.map +0 -1
- package/build-module/components/dataviews/constants.js +0 -6
- package/build-module/components/dataviews/constants.js.map +0 -1
- package/build-module/components/dataviews/dataviews.js +0 -90
- package/build-module/components/dataviews/dataviews.js.map +0 -1
- package/build-module/components/dataviews/filter-summary.js +0 -55
- package/build-module/components/dataviews/filter-summary.js.map +0 -1
- package/build-module/components/dataviews/filters.js +0 -55
- package/build-module/components/dataviews/filters.js.map +0 -1
- package/build-module/components/dataviews/index.js +0 -2
- package/build-module/components/dataviews/index.js.map +0 -1
- package/build-module/components/dataviews/item-actions.js +0 -177
- package/build-module/components/dataviews/item-actions.js.map +0 -1
- package/build-module/components/dataviews/pagination.js +0 -115
- package/build-module/components/dataviews/pagination.js.map +0 -1
- package/build-module/components/dataviews/reset-filters.js +0 -26
- package/build-module/components/dataviews/reset-filters.js.map +0 -1
- package/build-module/components/dataviews/search.js +0 -43
- package/build-module/components/dataviews/search.js.map +0 -1
- package/build-module/components/dataviews/view-actions.js +0 -237
- package/build-module/components/dataviews/view-actions.js.map +0 -1
- package/build-module/components/dataviews/view-grid.js +0 -74
- package/build-module/components/dataviews/view-grid.js.map +0 -1
- package/build-module/components/dataviews/view-list.js +0 -390
- package/build-module/components/dataviews/view-list.js.map +0 -1
- package/build-module/components/dataviews/view-side-by-side.js +0 -12
- package/build-module/components/dataviews/view-side-by-side.js.map +0 -1
- package/build-module/components/header-edit-mode/document-actions/index.js +0 -164
- package/build-module/components/header-edit-mode/document-actions/index.js.map +0 -1
- package/build-module/components/page-content-focus-notifications/back-to-page-notification.js +0 -54
- package/build-module/components/page-content-focus-notifications/back-to-page-notification.js.map +0 -1
- package/build-module/components/page-content-focus-notifications/edit-template-notification.js +0 -96
- package/build-module/components/page-content-focus-notifications/edit-template-notification.js.map +0 -1
- package/build-module/components/page-content-focus-notifications/index.js +0 -14
- package/build-module/components/page-content-focus-notifications/index.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js +0 -93
- package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/page-panels/hooks.js +0 -69
- package/build-module/components/sidebar-edit-mode/page-panels/hooks.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/page-panels/reset-default-template.js +0 -41
- package/build-module/components/sidebar-edit-mode/page-panels/reset-default-template.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/page-panels/swap-template-button.js +0 -77
- package/build-module/components/sidebar-edit-mode/page-panels/swap-template-button.js.map +0 -1
- package/build-module/utils/use-debounced-input.js +0 -15
- package/build-module/utils/use-debounced-input.js.map +0 -1
- package/src/components/dataviews/README.md +0 -191
- package/src/components/dataviews/add-filter.js +0 -108
- package/src/components/dataviews/constants.js +0 -5
- package/src/components/dataviews/dataviews.js +0 -99
- package/src/components/dataviews/filter-summary.js +0 -79
- package/src/components/dataviews/filters.js +0 -65
- package/src/components/dataviews/index.js +0 -1
- package/src/components/dataviews/item-actions.js +0 -208
- package/src/components/dataviews/pagination.js +0 -144
- package/src/components/dataviews/reset-filters.js +0 -26
- package/src/components/dataviews/search.js +0 -42
- package/src/components/dataviews/style.scss +0 -131
- package/src/components/dataviews/view-actions.js +0 -319
- package/src/components/dataviews/view-grid.js +0 -90
- package/src/components/dataviews/view-list.js +0 -512
- package/src/components/dataviews/view-side-by-side.js +0 -9
- package/src/components/header-edit-mode/document-actions/index.js +0 -204
- package/src/components/header-edit-mode/document-actions/style.scss +0 -145
- package/src/components/page-content-focus-notifications/back-to-page-notification.js +0 -58
- package/src/components/page-content-focus-notifications/edit-template-notification.js +0 -104
- package/src/components/page-content-focus-notifications/index.js +0 -14
- package/src/components/sidebar-edit-mode/page-panels/edit-template.js +0 -108
- package/src/components/sidebar-edit-mode/page-panels/hooks.js +0 -99
- package/src/components/sidebar-edit-mode/page-panels/reset-default-template.js +0 -45
- package/src/components/sidebar-edit-mode/page-panels/swap-template-button.js +0 -83
- package/src/utils/use-debounced-input.js +0 -18
|
@@ -2,15 +2,13 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { CheckboxControl, Flex } from '@wordpress/components';
|
|
5
|
-
/**
|
|
6
|
-
* Internal dependencies
|
|
7
|
-
*/
|
|
8
|
-
import { getFontFaceVariantName } from './utils';
|
|
9
5
|
|
|
10
6
|
/**
|
|
11
7
|
* Internal dependencies
|
|
12
8
|
*/
|
|
9
|
+
import { getFontFaceVariantName } from './utils';
|
|
13
10
|
import FontFaceDemo from './font-demo';
|
|
11
|
+
import { kebabCase } from '../../../../../block-editor/src/utils/object';
|
|
14
12
|
|
|
15
13
|
function CollectionFontVariant( {
|
|
16
14
|
face,
|
|
@@ -27,18 +25,26 @@ function CollectionFontVariant( {
|
|
|
27
25
|
};
|
|
28
26
|
|
|
29
27
|
const displayName = font.name + ' ' + getFontFaceVariantName( face );
|
|
28
|
+
const checkboxId = kebabCase(
|
|
29
|
+
`${ font.slug }-${ getFontFaceVariantName( face ) }`
|
|
30
|
+
);
|
|
30
31
|
|
|
31
32
|
return (
|
|
32
|
-
<
|
|
33
|
+
<label
|
|
34
|
+
className="font-library-modal__library-font-variant"
|
|
35
|
+
htmlFor={ checkboxId }
|
|
36
|
+
>
|
|
33
37
|
<Flex justify="space-between" align="center" gap="1rem">
|
|
34
38
|
<FontFaceDemo fontFace={ face } text={ displayName } />
|
|
35
39
|
<CheckboxControl
|
|
36
40
|
checked={ selected }
|
|
37
41
|
onChange={ handleToggleActivation }
|
|
38
42
|
__nextHasNoMarginBottom={ true }
|
|
43
|
+
id={ checkboxId }
|
|
44
|
+
label={ false }
|
|
39
45
|
/>
|
|
40
46
|
</Flex>
|
|
41
|
-
</
|
|
47
|
+
</label>
|
|
42
48
|
);
|
|
43
49
|
}
|
|
44
50
|
|
|
@@ -229,7 +229,7 @@ function FontLibraryProvider( { children } ) {
|
|
|
229
229
|
// Uninstall the font (remove the font files from the server and the post from the database).
|
|
230
230
|
const response = await fetchUninstallFonts( [ font ] );
|
|
231
231
|
// Deactivate the font family (remove the font family from the global styles).
|
|
232
|
-
if (
|
|
232
|
+
if ( 0 === response.errors.length ) {
|
|
233
233
|
deactivateFontFamily( font );
|
|
234
234
|
// Save the global styles to the database.
|
|
235
235
|
await saveSpecifiedEntityEdits(
|
|
@@ -3,16 +3,14 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { useContext } from '@wordpress/element';
|
|
5
5
|
import { CheckboxControl, Flex } from '@wordpress/components';
|
|
6
|
-
/**
|
|
7
|
-
* Internal dependencies
|
|
8
|
-
*/
|
|
9
|
-
import { getFontFaceVariantName } from './utils';
|
|
10
6
|
|
|
11
7
|
/**
|
|
12
8
|
* Internal dependencies
|
|
13
9
|
*/
|
|
10
|
+
import { getFontFaceVariantName } from './utils';
|
|
14
11
|
import { FontLibraryContext } from './context';
|
|
15
12
|
import FontFaceDemo from './font-demo';
|
|
13
|
+
import { kebabCase } from '../../../../../block-editor/src/utils/object';
|
|
16
14
|
|
|
17
15
|
function LibraryFontVariant( { face, font } ) {
|
|
18
16
|
const { isFontActivated, toggleActivateFont } =
|
|
@@ -36,18 +34,26 @@ function LibraryFontVariant( { face, font } ) {
|
|
|
36
34
|
};
|
|
37
35
|
|
|
38
36
|
const displayName = font.name + ' ' + getFontFaceVariantName( face );
|
|
37
|
+
const checkboxId = kebabCase(
|
|
38
|
+
`${ font.slug }-${ getFontFaceVariantName( face ) }`
|
|
39
|
+
);
|
|
39
40
|
|
|
40
41
|
return (
|
|
41
|
-
<
|
|
42
|
+
<label
|
|
43
|
+
className="font-library-modal__library-font-variant"
|
|
44
|
+
htmlFor={ checkboxId }
|
|
45
|
+
>
|
|
42
46
|
<Flex justify="space-between" align="center" gap="1rem">
|
|
43
47
|
<FontFaceDemo fontFace={ face } text={ displayName } />
|
|
44
48
|
<CheckboxControl
|
|
45
49
|
checked={ isIstalled }
|
|
46
50
|
onChange={ handleToggleActivation }
|
|
47
51
|
__nextHasNoMarginBottom={ true }
|
|
52
|
+
id={ checkboxId }
|
|
53
|
+
label={ false }
|
|
48
54
|
/>
|
|
49
55
|
</Flex>
|
|
50
|
-
</
|
|
56
|
+
</label>
|
|
51
57
|
);
|
|
52
58
|
}
|
|
53
59
|
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __, sprintf } from '@wordpress/i18n';
|
|
5
|
+
|
|
6
|
+
const globalStylesChangesCache = new Map();
|
|
7
|
+
const EMPTY_ARRAY = [];
|
|
8
|
+
|
|
9
|
+
const translationMap = {
|
|
10
|
+
caption: __( 'Caption' ),
|
|
11
|
+
link: __( 'Link' ),
|
|
12
|
+
button: __( 'Button' ),
|
|
13
|
+
heading: __( 'Heading' ),
|
|
14
|
+
'settings.color': __( 'Color settings' ),
|
|
15
|
+
'settings.typography': __( 'Typography settings' ),
|
|
16
|
+
'styles.color': __( 'Colors' ),
|
|
17
|
+
'styles.spacing': __( 'Spacing' ),
|
|
18
|
+
'styles.typography': __( 'Typography' ),
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const isObject = ( obj ) => obj !== null && typeof obj === 'object';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Get the translation for a given global styles key.
|
|
25
|
+
* @param {string} key A key representing a path to a global style property or setting.
|
|
26
|
+
* @param {Record<string,string>} blockNames A key/value pair object of block names and their rendered titles.
|
|
27
|
+
* @return {string|undefined} A translated key or undefined if no translation exists.
|
|
28
|
+
*/
|
|
29
|
+
function getTranslation( key, blockNames ) {
|
|
30
|
+
if ( translationMap[ key ] ) {
|
|
31
|
+
return translationMap[ key ];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const keyArray = key.split( '.' );
|
|
35
|
+
|
|
36
|
+
if ( keyArray?.[ 0 ] === 'blocks' ) {
|
|
37
|
+
const blockName = blockNames[ keyArray[ 1 ] ];
|
|
38
|
+
return blockName
|
|
39
|
+
? sprintf(
|
|
40
|
+
// translators: %s: block name.
|
|
41
|
+
__( '%s block' ),
|
|
42
|
+
blockName
|
|
43
|
+
)
|
|
44
|
+
: keyArray[ 1 ];
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if ( keyArray?.[ 0 ] === 'elements' ) {
|
|
48
|
+
return sprintf(
|
|
49
|
+
// translators: %s: element name, e.g., heading button, link, caption.
|
|
50
|
+
__( '%s element' ),
|
|
51
|
+
translationMap[ keyArray[ 1 ] ]
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return undefined;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* A deep comparison of two objects, optimized for comparing global styles.
|
|
60
|
+
* @param {Object} changedObject The changed object to compare.
|
|
61
|
+
* @param {Object} originalObject The original object to compare against.
|
|
62
|
+
* @param {string} parentPath A key/value pair object of block names and their rendered titles.
|
|
63
|
+
* @return {string[]} An array of paths whose values have changed.
|
|
64
|
+
*/
|
|
65
|
+
function deepCompare( changedObject, originalObject, parentPath = '' ) {
|
|
66
|
+
// We have two non-object values to compare.
|
|
67
|
+
if ( ! isObject( changedObject ) && ! isObject( originalObject ) ) {
|
|
68
|
+
/*
|
|
69
|
+
* Only return a path if the value has changed.
|
|
70
|
+
* And then only the path name up to 2 levels deep.
|
|
71
|
+
*/
|
|
72
|
+
return changedObject !== originalObject
|
|
73
|
+
? parentPath.split( '.' ).slice( 0, 2 ).join( '.' )
|
|
74
|
+
: undefined;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Enable comparison when an object doesn't have a corresponding property to compare.
|
|
78
|
+
changedObject = isObject( changedObject ) ? changedObject : {};
|
|
79
|
+
originalObject = isObject( originalObject ) ? originalObject : {};
|
|
80
|
+
|
|
81
|
+
const allKeys = new Set( [
|
|
82
|
+
...Object.keys( changedObject ),
|
|
83
|
+
...Object.keys( originalObject ),
|
|
84
|
+
] );
|
|
85
|
+
|
|
86
|
+
let diffs = [];
|
|
87
|
+
for ( const key of allKeys ) {
|
|
88
|
+
const path = parentPath ? parentPath + '.' + key : key;
|
|
89
|
+
const changedPath = deepCompare(
|
|
90
|
+
changedObject[ key ],
|
|
91
|
+
originalObject[ key ],
|
|
92
|
+
path
|
|
93
|
+
);
|
|
94
|
+
if ( changedPath ) {
|
|
95
|
+
diffs = diffs.concat( changedPath );
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return diffs;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Get an array of translated summarized global styles changes.
|
|
103
|
+
* Results are cached using a Map() key of `JSON.stringify( { revision, previousRevision } )`.
|
|
104
|
+
*
|
|
105
|
+
* @param {Object} revision The changed object to compare.
|
|
106
|
+
* @param {Object} previousRevision The original object to compare against.
|
|
107
|
+
* @param {Record<string,string>} blockNames A key/value pair object of block names and their rendered titles.
|
|
108
|
+
* @return {string[]} An array of translated changes.
|
|
109
|
+
*/
|
|
110
|
+
export default function getRevisionChanges(
|
|
111
|
+
revision,
|
|
112
|
+
previousRevision,
|
|
113
|
+
blockNames
|
|
114
|
+
) {
|
|
115
|
+
const cacheKey = JSON.stringify( { revision, previousRevision } );
|
|
116
|
+
|
|
117
|
+
if ( globalStylesChangesCache.has( cacheKey ) ) {
|
|
118
|
+
return globalStylesChangesCache.get( cacheKey );
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/*
|
|
122
|
+
* Compare the two revisions with normalized keys.
|
|
123
|
+
* The order of these keys determines the order in which
|
|
124
|
+
* they'll appear in the results.
|
|
125
|
+
*/
|
|
126
|
+
const changedValueTree = deepCompare(
|
|
127
|
+
{
|
|
128
|
+
styles: {
|
|
129
|
+
color: revision?.styles?.color,
|
|
130
|
+
typography: revision?.styles?.typography,
|
|
131
|
+
spacing: revision?.styles?.spacing,
|
|
132
|
+
},
|
|
133
|
+
blocks: revision?.styles?.blocks,
|
|
134
|
+
elements: revision?.styles?.elements,
|
|
135
|
+
settings: revision?.settings,
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
styles: {
|
|
139
|
+
color: previousRevision?.styles?.color,
|
|
140
|
+
typography: previousRevision?.styles?.typography,
|
|
141
|
+
spacing: previousRevision?.styles?.spacing,
|
|
142
|
+
},
|
|
143
|
+
blocks: previousRevision?.styles?.blocks,
|
|
144
|
+
elements: previousRevision?.styles?.elements,
|
|
145
|
+
settings: previousRevision?.settings,
|
|
146
|
+
}
|
|
147
|
+
);
|
|
148
|
+
|
|
149
|
+
if ( ! changedValueTree.length ) {
|
|
150
|
+
globalStylesChangesCache.set( cacheKey, EMPTY_ARRAY );
|
|
151
|
+
return EMPTY_ARRAY;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// Remove duplicate results.
|
|
155
|
+
const result = [ ...new Set( changedValueTree ) ]
|
|
156
|
+
/*
|
|
157
|
+
* Translate the keys.
|
|
158
|
+
* Remove duplicate or empty translations.
|
|
159
|
+
*/
|
|
160
|
+
.reduce( ( acc, curr ) => {
|
|
161
|
+
const translation = getTranslation( curr, blockNames );
|
|
162
|
+
if ( translation && ! acc.includes( translation ) ) {
|
|
163
|
+
acc.push( translation );
|
|
164
|
+
}
|
|
165
|
+
return acc;
|
|
166
|
+
}, [] );
|
|
167
|
+
|
|
168
|
+
globalStylesChangesCache.set( cacheKey, result );
|
|
169
|
+
|
|
170
|
+
return result;
|
|
171
|
+
}
|
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
__experimentalUseNavigator as useNavigator,
|
|
8
8
|
__experimentalConfirmDialog as ConfirmDialog,
|
|
9
9
|
Spinner,
|
|
10
|
-
__experimentalSpacer as Spacer,
|
|
11
10
|
} from '@wordpress/components';
|
|
12
11
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
13
12
|
import { store as coreStore } from '@wordpress/core-data';
|
|
@@ -135,7 +134,8 @@ function ScreenRevisions() {
|
|
|
135
134
|
}
|
|
136
135
|
}, [ shouldSelectFirstItem, firstRevision ] );
|
|
137
136
|
|
|
138
|
-
// Only display load button if there is a revision to load
|
|
137
|
+
// Only display load button if there is a revision to load,
|
|
138
|
+
// and it is different from the current editor styles.
|
|
139
139
|
const isLoadButtonEnabled =
|
|
140
140
|
!! currentlySelectedRevisionId && ! selectedRevisionMatchesEditorStyles;
|
|
141
141
|
const shouldShowRevisions = ! isLoading && revisions.length;
|
|
@@ -156,7 +156,7 @@ function ScreenRevisions() {
|
|
|
156
156
|
{ isLoading && (
|
|
157
157
|
<Spinner className="edit-site-global-styles-screen-revisions__loading" />
|
|
158
158
|
) }
|
|
159
|
-
{ shouldShowRevisions
|
|
159
|
+
{ shouldShowRevisions && (
|
|
160
160
|
<>
|
|
161
161
|
<Revisions
|
|
162
162
|
blocks={ blocks }
|
|
@@ -168,6 +168,7 @@ function ScreenRevisions() {
|
|
|
168
168
|
onChange={ selectRevision }
|
|
169
169
|
selectedRevisionId={ currentlySelectedRevisionId }
|
|
170
170
|
userRevisions={ revisions }
|
|
171
|
+
canApplyRevision={ isLoadButtonEnabled }
|
|
171
172
|
/>
|
|
172
173
|
{ isLoadButtonEnabled && (
|
|
173
174
|
<SidebarFixedBottom>
|
|
@@ -215,14 +216,6 @@ function ScreenRevisions() {
|
|
|
215
216
|
</ConfirmDialog>
|
|
216
217
|
) }
|
|
217
218
|
</>
|
|
218
|
-
) : (
|
|
219
|
-
<Spacer marginX={ 4 } data-testid="global-styles-no-revisions">
|
|
220
|
-
{
|
|
221
|
-
// Adding an existing translation here in case these changes are shipped to WordPress 6.3.
|
|
222
|
-
// Later we could update to something better, e.g., "There are currently no style revisions.".
|
|
223
|
-
__( 'No results found.' )
|
|
224
|
-
}
|
|
225
|
-
</Spacer>
|
|
226
219
|
) }
|
|
227
220
|
</>
|
|
228
221
|
);
|
|
@@ -6,28 +6,69 @@ import classnames from 'classnames';
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
|
-
import { __, sprintf } from '@wordpress/i18n';
|
|
9
|
+
import { __, _n, sprintf } from '@wordpress/i18n';
|
|
10
10
|
import { Button } from '@wordpress/components';
|
|
11
11
|
import { dateI18n, getDate, humanTimeDiff, getSettings } from '@wordpress/date';
|
|
12
12
|
import { store as coreStore } from '@wordpress/core-data';
|
|
13
13
|
import { useSelect } from '@wordpress/data';
|
|
14
|
+
import { useMemo } from '@wordpress/element';
|
|
15
|
+
import { getBlockTypes } from '@wordpress/blocks';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Internal dependencies
|
|
19
|
+
*/
|
|
20
|
+
import getRevisionChanges from './get-revision-changes';
|
|
14
21
|
|
|
15
22
|
const DAY_IN_MILLISECONDS = 60 * 60 * 1000 * 24;
|
|
23
|
+
const MAX_CHANGES = 7;
|
|
24
|
+
|
|
25
|
+
function ChangesSummary( { revision, previousRevision, blockNames } ) {
|
|
26
|
+
const changes = getRevisionChanges(
|
|
27
|
+
revision,
|
|
28
|
+
previousRevision,
|
|
29
|
+
blockNames
|
|
30
|
+
);
|
|
31
|
+
const changesLength = changes.length;
|
|
32
|
+
|
|
33
|
+
if ( ! changesLength ) {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Truncate to `n` results if necessary.
|
|
38
|
+
if ( changesLength > MAX_CHANGES ) {
|
|
39
|
+
const deleteCount = changesLength - MAX_CHANGES;
|
|
40
|
+
const andMoreText = sprintf(
|
|
41
|
+
// translators: %d: number of global styles changes that are not displayed in the UI.
|
|
42
|
+
_n( '…and %d more change.', '…and %d more changes.', deleteCount ),
|
|
43
|
+
deleteCount
|
|
44
|
+
);
|
|
45
|
+
changes.splice( MAX_CHANGES, deleteCount, andMoreText );
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<span
|
|
50
|
+
data-testid="global-styles-revision-changes"
|
|
51
|
+
className="edit-site-global-styles-screen-revisions__changes"
|
|
52
|
+
>
|
|
53
|
+
{ changes.join( ', ' ) }
|
|
54
|
+
</span>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
16
57
|
|
|
17
58
|
/**
|
|
18
59
|
* Returns a button label for the revision.
|
|
19
60
|
*
|
|
20
61
|
* @param {string|number} id A revision object.
|
|
21
|
-
* @param {boolean} isLatest Whether the revision is the most current.
|
|
22
62
|
* @param {string} authorDisplayName Author name.
|
|
23
63
|
* @param {string} formattedModifiedDate Revision modified date formatted.
|
|
64
|
+
* @param {boolean} areStylesEqual Whether the revision matches the current editor styles.
|
|
24
65
|
* @return {string} Translated label.
|
|
25
66
|
*/
|
|
26
67
|
function getRevisionLabel(
|
|
27
68
|
id,
|
|
28
|
-
isLatest,
|
|
29
69
|
authorDisplayName,
|
|
30
|
-
formattedModifiedDate
|
|
70
|
+
formattedModifiedDate,
|
|
71
|
+
areStylesEqual
|
|
31
72
|
) {
|
|
32
73
|
if ( 'parent' === id ) {
|
|
33
74
|
return __( 'Reset the styles to the theme defaults' );
|
|
@@ -35,21 +76,23 @@ function getRevisionLabel(
|
|
|
35
76
|
|
|
36
77
|
if ( 'unsaved' === id ) {
|
|
37
78
|
return sprintf(
|
|
38
|
-
/* translators: %s author display name */
|
|
79
|
+
/* translators: %s: author display name */
|
|
39
80
|
__( 'Unsaved changes by %s' ),
|
|
40
81
|
authorDisplayName
|
|
41
82
|
);
|
|
42
83
|
}
|
|
43
84
|
|
|
44
|
-
return
|
|
85
|
+
return areStylesEqual
|
|
45
86
|
? sprintf(
|
|
46
|
-
|
|
47
|
-
__(
|
|
87
|
+
// translators: %1$s: author display name, %2$s: revision creation date.
|
|
88
|
+
__(
|
|
89
|
+
'Changes saved by %1$s on %2$s. This revision matches current editor styles.'
|
|
90
|
+
),
|
|
48
91
|
authorDisplayName,
|
|
49
92
|
formattedModifiedDate
|
|
50
93
|
)
|
|
51
94
|
: sprintf(
|
|
52
|
-
|
|
95
|
+
// translators: %1$s: author display name, %2$s: revision creation date.
|
|
53
96
|
__( 'Changes saved by %1$s on %2$s' ),
|
|
54
97
|
authorDisplayName,
|
|
55
98
|
formattedModifiedDate
|
|
@@ -67,7 +110,12 @@ function getRevisionLabel(
|
|
|
67
110
|
* @param {props} Component props.
|
|
68
111
|
* @return {JSX.Element} The modal component.
|
|
69
112
|
*/
|
|
70
|
-
function RevisionsButtons( {
|
|
113
|
+
function RevisionsButtons( {
|
|
114
|
+
userRevisions,
|
|
115
|
+
selectedRevisionId,
|
|
116
|
+
onChange,
|
|
117
|
+
canApplyRevision,
|
|
118
|
+
} ) {
|
|
71
119
|
const { currentThemeName, currentUser } = useSelect( ( select ) => {
|
|
72
120
|
const { getCurrentTheme, getCurrentUser } = select( coreStore );
|
|
73
121
|
const currentTheme = getCurrentTheme();
|
|
@@ -77,8 +125,15 @@ function RevisionsButtons( { userRevisions, selectedRevisionId, onChange } ) {
|
|
|
77
125
|
currentUser: getCurrentUser(),
|
|
78
126
|
};
|
|
79
127
|
}, [] );
|
|
128
|
+
const blockNames = useMemo( () => {
|
|
129
|
+
const blockTypes = getBlockTypes();
|
|
130
|
+
return blockTypes.reduce( ( accumulator, { name, title } ) => {
|
|
131
|
+
accumulator[ name ] = title;
|
|
132
|
+
return accumulator;
|
|
133
|
+
}, {} );
|
|
134
|
+
}, [] );
|
|
80
135
|
const dateNowInMs = getDate().getTime();
|
|
81
|
-
const {
|
|
136
|
+
const { datetimeAbbreviated } = getSettings().formats;
|
|
82
137
|
|
|
83
138
|
return (
|
|
84
139
|
<ol
|
|
@@ -87,27 +142,29 @@ function RevisionsButtons( { userRevisions, selectedRevisionId, onChange } ) {
|
|
|
87
142
|
role="group"
|
|
88
143
|
>
|
|
89
144
|
{ userRevisions.map( ( revision, index ) => {
|
|
90
|
-
const { id,
|
|
145
|
+
const { id, author, modified } = revision;
|
|
91
146
|
const isUnsaved = 'unsaved' === id;
|
|
92
147
|
// Unsaved changes are created by the current user.
|
|
93
148
|
const revisionAuthor = isUnsaved ? currentUser : author;
|
|
94
149
|
const authorDisplayName = revisionAuthor?.name || __( 'User' );
|
|
95
150
|
const authorAvatar = revisionAuthor?.avatar_urls?.[ '48' ];
|
|
151
|
+
const isFirstItem = index === 0;
|
|
96
152
|
const isSelected = selectedRevisionId
|
|
97
153
|
? selectedRevisionId === id
|
|
98
|
-
:
|
|
154
|
+
: isFirstItem;
|
|
155
|
+
const areStylesEqual = ! canApplyRevision && isSelected;
|
|
99
156
|
const isReset = 'parent' === id;
|
|
100
157
|
const modifiedDate = getDate( modified );
|
|
101
158
|
const displayDate =
|
|
102
159
|
modified &&
|
|
103
160
|
dateNowInMs - modifiedDate.getTime() > DAY_IN_MILLISECONDS
|
|
104
|
-
? dateI18n(
|
|
161
|
+
? dateI18n( datetimeAbbreviated, modifiedDate )
|
|
105
162
|
: humanTimeDiff( modified );
|
|
106
163
|
const revisionLabel = getRevisionLabel(
|
|
107
164
|
id,
|
|
108
|
-
isLatest,
|
|
109
165
|
authorDisplayName,
|
|
110
|
-
dateI18n( datetimeAbbreviated, modifiedDate )
|
|
166
|
+
dateI18n( datetimeAbbreviated, modifiedDate ),
|
|
167
|
+
areStylesEqual
|
|
111
168
|
);
|
|
112
169
|
|
|
113
170
|
return (
|
|
@@ -116,6 +173,7 @@ function RevisionsButtons( { userRevisions, selectedRevisionId, onChange } ) {
|
|
|
116
173
|
'edit-site-global-styles-screen-revisions__revision-item',
|
|
117
174
|
{
|
|
118
175
|
'is-selected': isSelected,
|
|
176
|
+
'is-active': areStylesEqual,
|
|
119
177
|
'is-reset': isReset,
|
|
120
178
|
}
|
|
121
179
|
) }
|
|
@@ -127,7 +185,7 @@ function RevisionsButtons( { userRevisions, selectedRevisionId, onChange } ) {
|
|
|
127
185
|
onClick={ () => {
|
|
128
186
|
onChange( revision );
|
|
129
187
|
} }
|
|
130
|
-
label={ revisionLabel }
|
|
188
|
+
aria-label={ revisionLabel }
|
|
131
189
|
>
|
|
132
190
|
{ isReset ? (
|
|
133
191
|
<span className="edit-site-global-styles-screen-revisions__description">
|
|
@@ -150,6 +208,17 @@ function RevisionsButtons( { userRevisions, selectedRevisionId, onChange } ) {
|
|
|
150
208
|
{ displayDate }
|
|
151
209
|
</time>
|
|
152
210
|
) }
|
|
211
|
+
{ isSelected && (
|
|
212
|
+
<ChangesSummary
|
|
213
|
+
blockNames={ blockNames }
|
|
214
|
+
revision={ revision }
|
|
215
|
+
previousRevision={
|
|
216
|
+
index < userRevisions.length
|
|
217
|
+
? userRevisions[ index + 1 ]
|
|
218
|
+
: {}
|
|
219
|
+
}
|
|
220
|
+
/>
|
|
221
|
+
) }
|
|
153
222
|
<span className="edit-site-global-styles-screen-revisions__meta">
|
|
154
223
|
<img
|
|
155
224
|
alt={ authorDisplayName }
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
width: 100%;
|
|
67
67
|
height: auto;
|
|
68
68
|
display: block;
|
|
69
|
-
padding: $grid-unit-15 $grid-unit-15 $grid-unit-
|
|
69
|
+
padding: $grid-unit-15 $grid-unit-15 $grid-unit-10 $grid-unit-30;
|
|
70
70
|
&:focus,
|
|
71
71
|
&:active {
|
|
72
72
|
outline: 0;
|
|
@@ -103,6 +103,7 @@
|
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
+
.edit-site-global-styles-screen-revisions__changes,
|
|
106
107
|
.edit-site-global-styles-screen-revisions__meta {
|
|
107
108
|
color: $gray-600;
|
|
108
109
|
display: flex;
|
|
@@ -110,7 +111,6 @@
|
|
|
110
111
|
width: 100%;
|
|
111
112
|
align-items: center;
|
|
112
113
|
font-size: 12px;
|
|
113
|
-
|
|
114
114
|
img {
|
|
115
115
|
width: $grid-unit-20;
|
|
116
116
|
height: $grid-unit-20;
|
|
@@ -122,3 +122,11 @@
|
|
|
122
122
|
.edit-site-global-styles-screen-revisions__loading {
|
|
123
123
|
margin: $grid-unit-30 auto !important;
|
|
124
124
|
}
|
|
125
|
+
|
|
126
|
+
.edit-site-global-styles-screen-revisions__changes {
|
|
127
|
+
margin-bottom: $grid-unit-05;
|
|
128
|
+
text-align: left;
|
|
129
|
+
color: $gray-900;
|
|
130
|
+
line-height: $default-line-height;
|
|
131
|
+
}
|
|
132
|
+
|