@wordpress/editor 13.27.1 → 13.28.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/bindings/post-meta.js +3 -4
- package/build/bindings/post-meta.js.map +1 -1
- package/build/components/autocompleters/user.js +1 -2
- package/build/components/autocompleters/user.js.map +1 -1
- package/build/components/autosave-monitor/index.js +1 -2
- package/build/components/autosave-monitor/index.js.map +1 -1
- package/build/components/block-manager/category.js +1 -2
- package/build/components/block-manager/category.js.map +1 -1
- package/build/components/block-manager/checklist.js +1 -2
- package/build/components/block-manager/checklist.js.map +1 -1
- package/build/components/block-manager/index.js +1 -2
- package/build/components/block-manager/index.js.map +1 -1
- package/build/components/deprecated.js +52 -104
- package/build/components/deprecated.js.map +1 -1
- package/build/components/document-bar/index.js +7 -23
- package/build/components/document-bar/index.js.map +1 -1
- package/build/components/document-outline/check.js +1 -2
- package/build/components/document-outline/check.js.map +1 -1
- package/build/components/document-outline/index.js +1 -2
- package/build/components/document-outline/index.js.map +1 -1
- package/build/components/document-outline/item.js +1 -2
- package/build/components/document-outline/item.js.map +1 -1
- package/build/components/document-tools/index.js +1 -2
- package/build/components/document-tools/index.js.map +1 -1
- package/build/components/editor-canvas/edit-template-blocks-notification.js +22 -13
- package/build/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
- package/build/components/editor-canvas/index.js +16 -12
- package/build/components/editor-canvas/index.js.map +1 -1
- package/build/components/editor-help/add-blocks.native.js +1 -2
- package/build/components/editor-help/add-blocks.native.js.map +1 -1
- package/build/components/editor-help/customize-blocks.native.js +1 -2
- package/build/components/editor-help/customize-blocks.native.js.map +1 -1
- package/build/components/editor-help/help-detail-navigation-screen.native.js +1 -2
- package/build/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
- package/build/components/editor-help/help-get-support-button.native.js +1 -2
- package/build/components/editor-help/help-get-support-button.native.js.map +1 -1
- package/build/components/editor-help/help-section-title.native.js +1 -2
- package/build/components/editor-help/help-section-title.native.js.map +1 -1
- package/build/components/editor-help/help-topic-row.native.js +1 -2
- package/build/components/editor-help/help-topic-row.native.js.map +1 -1
- package/build/components/editor-help/icon-move-blocks.native.js +1 -2
- package/build/components/editor-help/icon-move-blocks.native.js.map +1 -1
- package/build/components/editor-help/index.native.js +1 -2
- package/build/components/editor-help/index.native.js.map +1 -1
- package/build/components/editor-help/intro-to-blocks.native.js +1 -2
- package/build/components/editor-help/intro-to-blocks.native.js.map +1 -1
- package/build/components/editor-help/move-blocks.native.js +1 -2
- package/build/components/editor-help/move-blocks.native.js.map +1 -1
- package/build/components/editor-help/remove-blocks.native.js +1 -2
- package/build/components/editor-help/remove-blocks.native.js.map +1 -1
- package/build/components/editor-history/redo.js +1 -2
- package/build/components/editor-history/redo.js.map +1 -1
- package/build/components/editor-history/undo.js +1 -2
- package/build/components/editor-history/undo.js.map +1 -1
- package/build/components/editor-notices/index.js +1 -2
- package/build/components/editor-notices/index.js.map +1 -1
- package/build/components/editor-snackbars/index.js +3 -1
- package/build/components/editor-snackbars/index.js.map +1 -1
- package/build/components/entities-saved-states/entity-record-item.js +1 -1
- package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
- package/build/components/entities-saved-states/entity-type-list.js +7 -7
- package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build/components/entities-saved-states/index.js +4 -1
- package/build/components/entities-saved-states/index.js.map +1 -1
- package/build/components/error-boundary/index.js +1 -2
- package/build/components/error-boundary/index.js.map +1 -1
- package/build/components/global-keyboard-shortcuts/register-shortcuts.js +1 -2
- package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
- package/build/components/index.js +4 -6
- package/build/components/index.js.map +1 -1
- package/build/components/list-view-sidebar/index.js +43 -36
- package/build/components/list-view-sidebar/index.js.map +1 -1
- package/build/components/local-autosave-monitor/index.js +1 -2
- package/build/components/local-autosave-monitor/index.js.map +1 -1
- package/build/components/media-categories/index.js +1 -2
- package/build/components/media-categories/index.js.map +1 -1
- package/build/components/offline-status/index.native.js +1 -2
- package/build/components/offline-status/index.native.js.map +1 -1
- package/build/components/page-attributes/check.js +1 -2
- package/build/components/page-attributes/check.js.map +1 -1
- package/build/components/page-attributes/panel.js +1 -2
- package/build/components/page-attributes/panel.js.map +1 -1
- package/build/components/page-attributes/parent.js +1 -2
- package/build/components/page-attributes/parent.js.map +1 -1
- package/build/components/post-author/combobox.js +6 -60
- package/build/components/post-author/combobox.js.map +1 -1
- package/build/components/post-author/constants.js +7 -5
- package/build/components/post-author/constants.js.map +1 -1
- package/build/components/post-author/hook.js +72 -0
- package/build/components/post-author/hook.js.map +1 -0
- package/build/components/post-author/index.js +1 -2
- package/build/components/post-author/index.js.map +1 -1
- package/build/components/post-author/panel.js +1 -2
- package/build/components/post-author/panel.js.map +1 -1
- package/build/components/post-author/select.js +6 -24
- package/build/components/post-author/select.js.map +1 -1
- package/build/components/post-comments/index.js +1 -2
- package/build/components/post-comments/index.js.map +1 -1
- package/build/components/post-discussion/panel.js +1 -2
- package/build/components/post-discussion/panel.js.map +1 -1
- package/build/components/post-excerpt/check.js +1 -2
- package/build/components/post-excerpt/check.js.map +1 -1
- package/build/components/post-excerpt/index.js +1 -2
- package/build/components/post-excerpt/index.js.map +1 -1
- package/build/components/post-excerpt/plugin.js +1 -2
- package/build/components/post-excerpt/plugin.js.map +1 -1
- package/build/components/post-featured-image/check.js +1 -2
- package/build/components/post-featured-image/check.js.map +1 -1
- package/build/components/post-featured-image/index.js +1 -2
- package/build/components/post-featured-image/index.js.map +1 -1
- package/build/components/post-featured-image/panel.js +1 -2
- package/build/components/post-featured-image/panel.js.map +1 -1
- package/build/components/post-format/check.js +1 -2
- package/build/components/post-format/check.js.map +1 -1
- package/build/components/post-format/index.js +1 -2
- package/build/components/post-format/index.js.map +1 -1
- package/build/components/post-last-revision/check.js +1 -2
- package/build/components/post-last-revision/check.js.map +1 -1
- package/build/components/post-last-revision/index.js +6 -5
- package/build/components/post-last-revision/index.js.map +1 -1
- package/build/components/post-last-revision/panel.js +1 -2
- package/build/components/post-last-revision/panel.js.map +1 -1
- package/build/components/post-panel-row/index.js +1 -2
- package/build/components/post-panel-row/index.js.map +1 -1
- package/build/components/post-pending-status/check.js +1 -2
- package/build/components/post-pending-status/check.js.map +1 -1
- package/build/components/post-pending-status/index.js +1 -2
- package/build/components/post-pending-status/index.js.map +1 -1
- package/build/components/post-pingbacks/index.js +1 -2
- package/build/components/post-pingbacks/index.js.map +1 -1
- package/build/components/post-publish-button/index.js +1 -2
- package/build/components/post-publish-button/index.js.map +1 -1
- package/build/components/post-publish-button/label.js +1 -2
- package/build/components/post-publish-button/label.js.map +1 -1
- package/build/components/post-publish-panel/index.js +1 -2
- package/build/components/post-publish-panel/index.js.map +1 -1
- package/build/components/post-publish-panel/maybe-category-panel.js +1 -2
- package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-tags-panel.js +22 -26
- package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
- package/build/components/post-publish-panel/postpublish.js +1 -2
- package/build/components/post-publish-panel/postpublish.js.map +1 -1
- package/build/components/post-publish-panel/prepublish.js +1 -2
- package/build/components/post-publish-panel/prepublish.js.map +1 -1
- package/build/components/post-schedule/index.js +0 -1
- package/build/components/post-schedule/index.js.map +1 -1
- package/build/components/post-schedule/label.js +1 -1
- package/build/components/post-schedule/label.js.map +1 -1
- package/build/components/post-schedule/panel.js +1 -0
- package/build/components/post-schedule/panel.js.map +1 -1
- package/build/components/post-slug/index.js +1 -2
- package/build/components/post-slug/index.js.map +1 -1
- package/build/components/post-switch-to-draft-button/index.js +1 -0
- package/build/components/post-switch-to-draft-button/index.js.map +1 -1
- package/build/components/post-sync-status/index.js +1 -1
- package/build/components/post-sync-status/index.js.map +1 -1
- package/build/components/post-taxonomies/check.js +8 -15
- package/build/components/post-taxonomies/check.js.map +1 -1
- package/build/components/post-taxonomies/flat-term-selector.js +1 -2
- package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/hierarchical-term-selector.js +1 -2
- package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/index.js +14 -15
- package/build/components/post-taxonomies/index.js.map +1 -1
- package/build/components/post-taxonomies/panel.js +1 -2
- package/build/components/post-taxonomies/panel.js.map +1 -1
- package/build/components/post-template/block-theme.js +24 -11
- package/build/components/post-template/block-theme.js.map +1 -1
- package/build/components/post-template/classic-theme.js +17 -13
- package/build/components/post-template/classic-theme.js.map +1 -1
- package/build/components/post-template/create-new-template-modal.js +20 -5
- package/build/components/post-template/create-new-template-modal.js.map +1 -1
- package/build/components/post-template/panel.js +5 -1
- package/build/components/post-template/panel.js.map +1 -1
- package/build/components/post-title/constants.js +2 -4
- package/build/components/post-title/constants.js.map +1 -1
- package/build/components/post-title/index.js +2 -3
- package/build/components/post-title/index.js.map +1 -1
- package/build/components/post-title/index.native.js +1 -2
- package/build/components/post-title/index.native.js.map +1 -1
- package/build/components/post-title/post-title-raw.js +1 -2
- package/build/components/post-title/post-title-raw.js.map +1 -1
- package/build/components/post-trash/check.js +1 -2
- package/build/components/post-trash/check.js.map +1 -1
- package/build/components/post-trash/index.js +1 -0
- package/build/components/post-trash/index.js.map +1 -1
- package/build/components/post-type-support-check/index.js +1 -2
- package/build/components/post-type-support-check/index.js.map +1 -1
- package/build/components/post-url/panel.js +1 -0
- package/build/components/post-url/panel.js.map +1 -1
- package/build/components/post-visibility/utils.js +1 -2
- package/build/components/post-visibility/utils.js.map +1 -1
- package/build/components/preferences-modal/enable-panel.js +1 -2
- package/build/components/preferences-modal/enable-panel.js.map +1 -1
- package/build/components/preferences-modal/enable-plugin-document-setting-panel.js +1 -2
- package/build/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -1
- package/build/components/preferences-modal/index.js +0 -1
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/provider/constants.js +1 -2
- package/build/components/provider/constants.js.map +1 -1
- package/build/components/provider/index.js +13 -7
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/index.native.js +4 -6
- package/build/components/provider/index.native.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.js +2 -3
- package/build/components/provider/use-block-editor-settings.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.native.js +1 -2
- package/build/components/provider/use-block-editor-settings.native.js.map +1 -1
- package/build/components/provider/with-registry-provider.js +1 -2
- package/build/components/provider/with-registry-provider.js.map +1 -1
- package/build/components/table-of-contents/index.js +1 -2
- package/build/components/table-of-contents/index.js.map +1 -1
- package/build/components/table-of-contents/panel.js +1 -2
- package/build/components/table-of-contents/panel.js.map +1 -1
- package/build/components/template-validation-notice/index.js +1 -2
- package/build/components/template-validation-notice/index.js.map +1 -1
- package/build/components/theme-support-check/index.js +1 -2
- package/build/components/theme-support-check/index.js.map +1 -1
- package/build/hooks/pattern-partial-syncing.js +9 -2
- package/build/hooks/pattern-partial-syncing.js.map +1 -1
- package/build/private-apis.js +1 -2
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +38 -65
- package/build/store/actions.js.map +1 -1
- package/build/store/constants.js +7 -14
- package/build/store/constants.js.map +1 -1
- package/build/store/defaults.js +1 -2
- package/build/store/defaults.js.map +1 -1
- package/build/store/index.js +4 -6
- package/build/store/index.js.map +1 -1
- package/build/store/private-actions.js +1 -0
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +1 -2
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +1 -2
- package/build/store/reducer.js.map +1 -1
- package/build/store/reducer.native.js +2 -4
- package/build/store/reducer.native.js.map +1 -1
- package/build/store/selectors.js +82 -144
- package/build/store/selectors.js.map +1 -1
- package/build/store/selectors.native.js +1 -2
- package/build/store/selectors.native.js.map +1 -1
- package/build-module/bindings/post-meta.js +2 -2
- package/build-module/bindings/post-meta.js.map +1 -1
- package/build-module/components/document-bar/index.js +7 -23
- package/build-module/components/document-bar/index.js.map +1 -1
- package/build-module/components/editor-canvas/edit-template-blocks-notification.js +22 -13
- package/build-module/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
- package/build-module/components/editor-canvas/index.js +15 -10
- package/build-module/components/editor-canvas/index.js.map +1 -1
- package/build-module/components/editor-snackbars/index.js +4 -1
- package/build-module/components/editor-snackbars/index.js.map +1 -1
- package/build-module/components/entities-saved-states/entity-record-item.js +1 -1
- package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
- package/build-module/components/entities-saved-states/entity-type-list.js +8 -8
- package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build-module/components/entities-saved-states/index.js +6 -3
- package/build-module/components/entities-saved-states/index.js.map +1 -1
- package/build-module/components/list-view-sidebar/index.js +44 -37
- package/build-module/components/list-view-sidebar/index.js.map +1 -1
- package/build-module/components/post-author/combobox.js +8 -61
- package/build-module/components/post-author/combobox.js.map +1 -1
- package/build-module/components/post-author/constants.js +5 -2
- package/build-module/components/post-author/constants.js.map +1 -1
- package/build-module/components/post-author/hook.js +65 -0
- package/build-module/components/post-author/hook.js.map +1 -0
- package/build-module/components/post-author/select.js +7 -24
- package/build-module/components/post-author/select.js.map +1 -1
- package/build-module/components/post-last-revision/index.js +6 -4
- package/build-module/components/post-last-revision/index.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-tags-panel.js +24 -27
- package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
- package/build-module/components/post-schedule/index.js +0 -1
- package/build-module/components/post-schedule/index.js.map +1 -1
- package/build-module/components/post-schedule/label.js +1 -1
- package/build-module/components/post-schedule/label.js.map +1 -1
- package/build-module/components/post-schedule/panel.js +1 -0
- package/build-module/components/post-schedule/panel.js.map +1 -1
- package/build-module/components/post-switch-to-draft-button/index.js +1 -0
- package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
- package/build-module/components/post-sync-status/index.js +1 -1
- package/build-module/components/post-sync-status/index.js.map +1 -1
- package/build-module/components/post-taxonomies/check.js +9 -14
- package/build-module/components/post-taxonomies/check.js.map +1 -1
- package/build-module/components/post-taxonomies/index.js +15 -15
- package/build-module/components/post-taxonomies/index.js.map +1 -1
- package/build-module/components/post-template/block-theme.js +24 -11
- package/build-module/components/post-template/block-theme.js.map +1 -1
- package/build-module/components/post-template/classic-theme.js +16 -11
- package/build-module/components/post-template/classic-theme.js.map +1 -1
- package/build-module/components/post-template/create-new-template-modal.js +20 -5
- package/build-module/components/post-template/create-new-template-modal.js.map +1 -1
- package/build-module/components/post-template/panel.js +5 -1
- package/build-module/components/post-template/panel.js.map +1 -1
- package/build-module/components/post-title/index.js +1 -2
- package/build-module/components/post-title/index.js.map +1 -1
- package/build-module/components/post-trash/index.js +1 -0
- package/build-module/components/post-trash/index.js.map +1 -1
- package/build-module/components/post-url/panel.js +1 -0
- package/build-module/components/post-url/panel.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +0 -1
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/provider/index.js +11 -3
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.js +1 -1
- package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
- package/build-module/components/table-of-contents/panel.js +0 -1
- package/build-module/components/table-of-contents/panel.js.map +1 -1
- package/build-module/hooks/pattern-partial-syncing.js +9 -2
- package/build-module/hooks/pattern-partial-syncing.js.map +1 -1
- package/build-module/store/actions.js +7 -3
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/private-actions.js +1 -0
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/selectors.js +10 -0
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +28 -22
- package/build-style/style.css +28 -22
- package/package.json +32 -32
- package/src/bindings/post-meta.js +2 -2
- package/src/components/document-bar/index.js +24 -38
- package/src/components/editor-canvas/edit-template-blocks-notification.js +31 -14
- package/src/components/editor-canvas/index.js +16 -6
- package/src/components/editor-snackbars/index.js +6 -3
- package/src/components/entities-saved-states/entity-record-item.js +1 -4
- package/src/components/entities-saved-states/entity-type-list.js +8 -8
- package/src/components/entities-saved-states/index.js +17 -4
- package/src/components/entities-saved-states/style.scss +5 -0
- package/src/components/list-view-sidebar/index.js +60 -47
- package/src/components/list-view-sidebar/style.scss +20 -20
- package/src/components/post-author/combobox.js +5 -61
- package/src/components/post-author/constants.js +6 -2
- package/src/components/post-author/hook.js +63 -0
- package/src/components/post-author/select.js +5 -25
- package/src/components/post-last-revision/index.js +6 -6
- package/src/components/post-last-revision/style.scss +3 -6
- package/src/components/post-panel-row/style.scss +3 -3
- package/src/components/post-publish-panel/maybe-tags-panel.js +27 -37
- package/src/components/post-publish-panel/style.scss +3 -1
- package/src/components/post-schedule/label.js +1 -1
- package/src/components/post-schedule/panel.js +1 -0
- package/src/components/post-schedule/test/label.js +19 -7
- package/src/components/post-switch-to-draft-button/index.js +1 -0
- package/src/components/post-sync-status/index.js +8 -2
- package/src/components/post-taxonomies/check.js +11 -15
- package/src/components/post-taxonomies/index.js +15 -22
- package/src/components/post-taxonomies/test/index.js +37 -51
- package/src/components/post-template/block-theme.js +33 -14
- package/src/components/post-template/classic-theme.js +17 -10
- package/src/components/post-template/create-new-template-modal.js +17 -9
- package/src/components/post-template/panel.js +5 -1
- package/src/components/post-trash/index.js +1 -0
- package/src/components/post-url/panel.js +1 -0
- package/src/components/provider/index.js +18 -6
- package/src/components/provider/use-block-editor-settings.js +1 -1
- package/src/hooks/pattern-partial-syncing.js +23 -4
- package/src/store/actions.js +8 -3
- package/src/store/private-actions.js +1 -0
- package/src/store/selectors.js +12 -0
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { __experimentalListView as ListView } from '@wordpress/block-editor';
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
Button,
|
|
7
|
+
privateApis as componentsPrivateApis,
|
|
8
|
+
} from '@wordpress/components';
|
|
6
9
|
import { useFocusOnMount, useMergeRefs } from '@wordpress/compose';
|
|
7
10
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
8
11
|
import { focus } from '@wordpress/dom';
|
|
@@ -19,6 +22,8 @@ import ListViewOutline from './list-view-outline';
|
|
|
19
22
|
import { unlock } from '../../lock-unlock';
|
|
20
23
|
import { store as editorStore } from '../../store';
|
|
21
24
|
|
|
25
|
+
const { Tabs } = unlock( componentsPrivateApis );
|
|
26
|
+
|
|
22
27
|
export default function ListViewSidebar() {
|
|
23
28
|
const { setIsListViewOpened } = useDispatch( editorStore );
|
|
24
29
|
const { getListViewToggleRef } = unlock( useSelect( editorStore ) );
|
|
@@ -51,7 +56,7 @@ export default function ListViewSidebar() {
|
|
|
51
56
|
// This ref refers to the sidebar as a whole.
|
|
52
57
|
const sidebarRef = useRef();
|
|
53
58
|
// This ref refers to the tab panel.
|
|
54
|
-
const
|
|
59
|
+
const tabsRef = useRef();
|
|
55
60
|
// This ref refers to the list view application area.
|
|
56
61
|
const listViewRef = useRef();
|
|
57
62
|
|
|
@@ -71,7 +76,7 @@ export default function ListViewSidebar() {
|
|
|
71
76
|
*/
|
|
72
77
|
function handleSidebarFocus( currentTab ) {
|
|
73
78
|
// Tab panel focus.
|
|
74
|
-
const tabPanelFocus = focus.tabbable.find(
|
|
79
|
+
const tabPanelFocus = focus.tabbable.find( tabsRef.current )[ 0 ];
|
|
75
80
|
// List view tab is selected.
|
|
76
81
|
if ( currentTab === 'list-view' ) {
|
|
77
82
|
// Either focus the list view or the tab panel. Must have a fallback because the list view does not render when there are no blocks.
|
|
@@ -108,22 +113,6 @@ export default function ListViewSidebar() {
|
|
|
108
113
|
// It is the same shortcut to open but that is defined as a global shortcut and only fires when the sidebar is closed.
|
|
109
114
|
useShortcut( 'core/editor/toggle-list-view', handleToggleListViewShortcut );
|
|
110
115
|
|
|
111
|
-
/**
|
|
112
|
-
* Render tab content for a given tab name.
|
|
113
|
-
*
|
|
114
|
-
* @param {string} tabName The name of the tab to render.
|
|
115
|
-
*/
|
|
116
|
-
function renderTabContent( tabName ) {
|
|
117
|
-
if ( tabName === 'list-view' ) {
|
|
118
|
-
return (
|
|
119
|
-
<div className="editor-list-view-sidebar__list-view-panel-content">
|
|
120
|
-
<ListView dropZoneElement={ dropZoneElement } />
|
|
121
|
-
</div>
|
|
122
|
-
);
|
|
123
|
-
}
|
|
124
|
-
return <ListViewOutline />;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
116
|
return (
|
|
128
117
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
129
118
|
<div
|
|
@@ -131,39 +120,63 @@ export default function ListViewSidebar() {
|
|
|
131
120
|
onKeyDown={ closeOnEscape }
|
|
132
121
|
ref={ sidebarRef }
|
|
133
122
|
>
|
|
134
|
-
<
|
|
135
|
-
className="editor-list-view-sidebar__close-button"
|
|
136
|
-
icon={ closeSmall }
|
|
137
|
-
label={ __( 'Close' ) }
|
|
138
|
-
onClick={ closeListView }
|
|
139
|
-
/>
|
|
140
|
-
<TabPanel
|
|
141
|
-
className="editor-list-view-sidebar__tab-panel"
|
|
142
|
-
ref={ tabPanelRef }
|
|
123
|
+
<Tabs
|
|
143
124
|
onSelect={ ( tabName ) => setTab( tabName ) }
|
|
144
125
|
selectOnMove={ false }
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
name: 'outline',
|
|
153
|
-
title: _x( 'Outline', 'Post overview' ),
|
|
154
|
-
className: 'editor-list-view-sidebar__panel-tab',
|
|
155
|
-
},
|
|
156
|
-
] }
|
|
126
|
+
// The initial tab value is set explicitly to avoid an initial
|
|
127
|
+
// render where no tab is selected. This ensures that the
|
|
128
|
+
// tabpanel height is correct so the relevant scroll container
|
|
129
|
+
// can be rendered internally.
|
|
130
|
+
initialTabId="list-view"
|
|
157
131
|
>
|
|
158
|
-
|
|
159
|
-
<
|
|
160
|
-
className="editor-list-view-
|
|
161
|
-
|
|
132
|
+
<div className="edit-post-editor__document-overview-panel__header">
|
|
133
|
+
<Button
|
|
134
|
+
className="editor-list-view-sidebar__close-button"
|
|
135
|
+
icon={ closeSmall }
|
|
136
|
+
label={ __( 'Close' ) }
|
|
137
|
+
onClick={ closeListView }
|
|
138
|
+
/>
|
|
139
|
+
<Tabs.TabList
|
|
140
|
+
className="editor-list-view-sidebar__tabs-tablist"
|
|
141
|
+
ref={ tabsRef }
|
|
162
142
|
>
|
|
163
|
-
|
|
143
|
+
<Tabs.Tab
|
|
144
|
+
className="editor-list-view-sidebar__tabs-tab"
|
|
145
|
+
tabId="list-view"
|
|
146
|
+
>
|
|
147
|
+
{ _x( 'List View', 'Post overview' ) }
|
|
148
|
+
</Tabs.Tab>
|
|
149
|
+
<Tabs.Tab
|
|
150
|
+
className="editor-list-view-sidebar__tabs-tab"
|
|
151
|
+
tabId="outline"
|
|
152
|
+
>
|
|
153
|
+
{ _x( 'Outline', 'Post overview' ) }
|
|
154
|
+
</Tabs.Tab>
|
|
155
|
+
</Tabs.TabList>
|
|
156
|
+
</div>
|
|
157
|
+
|
|
158
|
+
<Tabs.TabPanel
|
|
159
|
+
ref={ listViewContainerRef }
|
|
160
|
+
className="editor-list-view-sidebar__tabs-tabpanel"
|
|
161
|
+
tabId="list-view"
|
|
162
|
+
focusable={ false }
|
|
163
|
+
>
|
|
164
|
+
<div className="editor-list-view-sidebar__list-view-container">
|
|
165
|
+
<div className="editor-list-view-sidebar__list-view-panel-content">
|
|
166
|
+
<ListView dropZoneElement={ dropZoneElement } />
|
|
167
|
+
</div>
|
|
168
|
+
</div>
|
|
169
|
+
</Tabs.TabPanel>
|
|
170
|
+
<Tabs.TabPanel
|
|
171
|
+
className="editor-list-view-sidebar__tabs-tabpanel"
|
|
172
|
+
tabId="outline"
|
|
173
|
+
focusable={ false }
|
|
174
|
+
>
|
|
175
|
+
<div className="editor-list-view-sidebar__list-view-container">
|
|
176
|
+
<ListViewOutline />
|
|
164
177
|
</div>
|
|
165
|
-
|
|
166
|
-
</
|
|
178
|
+
</Tabs.TabPanel>
|
|
179
|
+
</Tabs>
|
|
167
180
|
</div>
|
|
168
181
|
);
|
|
169
182
|
}
|
|
@@ -8,32 +8,31 @@
|
|
|
8
8
|
// @see packages/block-editor/src/components/inserter/style.scss
|
|
9
9
|
width: 350px;
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
.edit-post-editor__document-overview-panel__header {
|
|
12
|
+
display: flex;
|
|
13
|
+
border-bottom: $border-width solid $gray-300;
|
|
14
|
+
}
|
|
12
15
|
.editor-list-view-sidebar__close-button {
|
|
13
|
-
position: absolute;
|
|
14
|
-
right: $grid-unit-10;
|
|
15
|
-
top: math.div($grid-unit-60 - $button-size, 2); // ( tab height - button size ) / 2
|
|
16
|
-
z-index: 1;
|
|
17
16
|
background: $white;
|
|
17
|
+
order: 1;
|
|
18
|
+
align-self: center;
|
|
19
|
+
margin-right: $grid-unit-10;
|
|
18
20
|
}
|
|
21
|
+
}
|
|
19
22
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
box-sizing: border-box;
|
|
24
|
-
display: flex;
|
|
25
|
-
width: 100%;
|
|
26
|
-
padding-right: $grid-unit-70;
|
|
23
|
+
.editor-list-view-sidebar__tabs-tablist {
|
|
24
|
+
box-sizing: border-box;
|
|
25
|
+
flex-grow: 1;
|
|
27
26
|
|
|
28
|
-
|
|
29
|
-
width: 50%;
|
|
30
|
-
margin-bottom: -$border-width;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
27
|
+
}
|
|
33
28
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
29
|
+
.editor-list-view-sidebar__tabs-tab {
|
|
30
|
+
width: 50%;
|
|
31
|
+
margin-bottom: -$border-width;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.editor-list-view-sidebar__tabs-tabpanel {
|
|
35
|
+
height: calc(100% - #{$grid-unit-60 - $border-width});
|
|
37
36
|
}
|
|
38
37
|
|
|
39
38
|
.editor-list-view-sidebar__list-view-panel-content,
|
|
@@ -82,3 +81,4 @@
|
|
|
82
81
|
color: $gray-700;
|
|
83
82
|
}
|
|
84
83
|
}
|
|
84
|
+
|
|
@@ -2,71 +2,22 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { debounce } from '@wordpress/compose';
|
|
5
|
-
import { useState
|
|
6
|
-
import {
|
|
5
|
+
import { useState } from '@wordpress/element';
|
|
6
|
+
import { useDispatch } from '@wordpress/data';
|
|
7
7
|
import { __ } from '@wordpress/i18n';
|
|
8
8
|
import { ComboboxControl } from '@wordpress/components';
|
|
9
|
-
import { decodeEntities } from '@wordpress/html-entities';
|
|
10
|
-
import { store as coreStore } from '@wordpress/core-data';
|
|
11
9
|
|
|
12
10
|
/**
|
|
13
11
|
* Internal dependencies
|
|
14
12
|
*/
|
|
15
13
|
import { store as editorStore } from '../../store';
|
|
16
|
-
import {
|
|
14
|
+
import { useAuthorsQuery } from './hook';
|
|
17
15
|
|
|
18
|
-
function PostAuthorCombobox() {
|
|
16
|
+
export default function PostAuthorCombobox() {
|
|
19
17
|
const [ fieldValue, setFieldValue ] = useState();
|
|
20
18
|
|
|
21
|
-
const { authorId, isLoading, authors, postAuthor } = useSelect(
|
|
22
|
-
( select ) => {
|
|
23
|
-
const { getUser, getUsers, isResolving } = select( coreStore );
|
|
24
|
-
const { getEditedPostAttribute } = select( editorStore );
|
|
25
|
-
const author = getUser( getEditedPostAttribute( 'author' ), {
|
|
26
|
-
context: 'view',
|
|
27
|
-
} );
|
|
28
|
-
const query = { ...AUTHORS_QUERY };
|
|
29
|
-
|
|
30
|
-
if ( fieldValue ) {
|
|
31
|
-
query.search = fieldValue;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return {
|
|
35
|
-
authorId: getEditedPostAttribute( 'author' ),
|
|
36
|
-
postAuthor: author,
|
|
37
|
-
authors: getUsers( query ),
|
|
38
|
-
isLoading: isResolving( 'core', 'getUsers', [ query ] ),
|
|
39
|
-
};
|
|
40
|
-
},
|
|
41
|
-
[ fieldValue ]
|
|
42
|
-
);
|
|
43
19
|
const { editPost } = useDispatch( editorStore );
|
|
44
|
-
|
|
45
|
-
const authorOptions = useMemo( () => {
|
|
46
|
-
const fetchedAuthors = ( authors ?? [] ).map( ( author ) => {
|
|
47
|
-
return {
|
|
48
|
-
value: author.id,
|
|
49
|
-
label: decodeEntities( author.name ),
|
|
50
|
-
};
|
|
51
|
-
} );
|
|
52
|
-
|
|
53
|
-
// Ensure the current author is included in the dropdown list.
|
|
54
|
-
const foundAuthor = fetchedAuthors.findIndex(
|
|
55
|
-
( { value } ) => postAuthor?.id === value
|
|
56
|
-
);
|
|
57
|
-
|
|
58
|
-
if ( foundAuthor < 0 && postAuthor ) {
|
|
59
|
-
return [
|
|
60
|
-
{
|
|
61
|
-
value: postAuthor.id,
|
|
62
|
-
label: decodeEntities( postAuthor.name ),
|
|
63
|
-
},
|
|
64
|
-
...fetchedAuthors,
|
|
65
|
-
];
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
return fetchedAuthors;
|
|
69
|
-
}, [ authors, postAuthor ] );
|
|
20
|
+
const { authorId, authorOptions } = useAuthorsQuery( fieldValue );
|
|
70
21
|
|
|
71
22
|
/**
|
|
72
23
|
* Handle author selection.
|
|
@@ -89,10 +40,6 @@ function PostAuthorCombobox() {
|
|
|
89
40
|
setFieldValue( inputValue );
|
|
90
41
|
};
|
|
91
42
|
|
|
92
|
-
if ( ! postAuthor ) {
|
|
93
|
-
return null;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
43
|
return (
|
|
97
44
|
<ComboboxControl
|
|
98
45
|
__nextHasNoMarginBottom
|
|
@@ -102,10 +49,7 @@ function PostAuthorCombobox() {
|
|
|
102
49
|
value={ authorId }
|
|
103
50
|
onFilterValueChange={ debounce( handleKeydown, 300 ) }
|
|
104
51
|
onChange={ handleSelect }
|
|
105
|
-
isLoading={ isLoading }
|
|
106
52
|
allowReset={ false }
|
|
107
53
|
/>
|
|
108
54
|
);
|
|
109
55
|
}
|
|
110
|
-
|
|
111
|
-
export default PostAuthorCombobox;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
export const BASE_QUERY = {
|
|
2
|
+
_fields: 'id,name',
|
|
3
|
+
context: 'view', // Allows non-admins to perform requests.
|
|
4
|
+
};
|
|
5
|
+
|
|
1
6
|
export const AUTHORS_QUERY = {
|
|
2
7
|
who: 'authors',
|
|
3
8
|
per_page: 50,
|
|
4
|
-
|
|
5
|
-
context: 'view', // Allows non-admins to perform requests.
|
|
9
|
+
...BASE_QUERY,
|
|
6
10
|
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useMemo } from '@wordpress/element';
|
|
5
|
+
import { useSelect } from '@wordpress/data';
|
|
6
|
+
import { decodeEntities } from '@wordpress/html-entities';
|
|
7
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Internal dependencies
|
|
11
|
+
*/
|
|
12
|
+
import { store as editorStore } from '../../store';
|
|
13
|
+
import { AUTHORS_QUERY, BASE_QUERY } from './constants';
|
|
14
|
+
|
|
15
|
+
export function useAuthorsQuery( search ) {
|
|
16
|
+
const { authorId, authors, postAuthor } = useSelect(
|
|
17
|
+
( select ) => {
|
|
18
|
+
const { getUser, getUsers } = select( coreStore );
|
|
19
|
+
const { getEditedPostAttribute } = select( editorStore );
|
|
20
|
+
const _authorId = getEditedPostAttribute( 'author' );
|
|
21
|
+
const query = { ...AUTHORS_QUERY };
|
|
22
|
+
|
|
23
|
+
if ( search ) {
|
|
24
|
+
query.search = search;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return {
|
|
28
|
+
authorId: _authorId,
|
|
29
|
+
authors: getUsers( query ),
|
|
30
|
+
postAuthor: getUser( _authorId, BASE_QUERY ),
|
|
31
|
+
};
|
|
32
|
+
},
|
|
33
|
+
[ search ]
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
const authorOptions = useMemo( () => {
|
|
37
|
+
const fetchedAuthors = ( authors ?? [] ).map( ( author ) => {
|
|
38
|
+
return {
|
|
39
|
+
value: author.id,
|
|
40
|
+
label: decodeEntities( author.name ),
|
|
41
|
+
};
|
|
42
|
+
} );
|
|
43
|
+
|
|
44
|
+
// Ensure the current author is included in the dropdown list.
|
|
45
|
+
const foundAuthor = fetchedAuthors.findIndex(
|
|
46
|
+
( { value } ) => postAuthor?.id === value
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
if ( foundAuthor < 0 && postAuthor ) {
|
|
50
|
+
return [
|
|
51
|
+
{
|
|
52
|
+
value: postAuthor.id,
|
|
53
|
+
label: decodeEntities( postAuthor.name ),
|
|
54
|
+
},
|
|
55
|
+
...fetchedAuthors,
|
|
56
|
+
];
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return fetchedAuthors;
|
|
60
|
+
}, [ authors, postAuthor ] );
|
|
61
|
+
|
|
62
|
+
return { authorId, authorOptions };
|
|
63
|
+
}
|
|
@@ -2,36 +2,18 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
|
-
import {
|
|
6
|
-
import { useSelect, useDispatch } from '@wordpress/data';
|
|
7
|
-
import { decodeEntities } from '@wordpress/html-entities';
|
|
5
|
+
import { useDispatch } from '@wordpress/data';
|
|
8
6
|
import { SelectControl } from '@wordpress/components';
|
|
9
|
-
import { store as coreStore } from '@wordpress/core-data';
|
|
10
7
|
|
|
11
8
|
/**
|
|
12
9
|
* Internal dependencies
|
|
13
10
|
*/
|
|
14
11
|
import { store as editorStore } from '../../store';
|
|
15
|
-
import {
|
|
12
|
+
import { useAuthorsQuery } from './hook';
|
|
16
13
|
|
|
17
|
-
function PostAuthorSelect() {
|
|
14
|
+
export default function PostAuthorSelect() {
|
|
18
15
|
const { editPost } = useDispatch( editorStore );
|
|
19
|
-
const {
|
|
20
|
-
return {
|
|
21
|
-
postAuthor:
|
|
22
|
-
select( editorStore ).getEditedPostAttribute( 'author' ),
|
|
23
|
-
authors: select( coreStore ).getUsers( AUTHORS_QUERY ),
|
|
24
|
-
};
|
|
25
|
-
}, [] );
|
|
26
|
-
|
|
27
|
-
const authorOptions = useMemo( () => {
|
|
28
|
-
return ( authors ?? [] ).map( ( author ) => {
|
|
29
|
-
return {
|
|
30
|
-
value: author.id,
|
|
31
|
-
label: decodeEntities( author.name ),
|
|
32
|
-
};
|
|
33
|
-
} );
|
|
34
|
-
}, [ authors ] );
|
|
16
|
+
const { authorId, authorOptions } = useAuthorsQuery();
|
|
35
17
|
|
|
36
18
|
const setAuthorId = ( value ) => {
|
|
37
19
|
const author = Number( value );
|
|
@@ -46,9 +28,7 @@ function PostAuthorSelect() {
|
|
|
46
28
|
label={ __( 'Author' ) }
|
|
47
29
|
options={ authorOptions }
|
|
48
30
|
onChange={ setAuthorId }
|
|
49
|
-
value={
|
|
31
|
+
value={ authorId }
|
|
50
32
|
/>
|
|
51
33
|
);
|
|
52
34
|
}
|
|
53
|
-
|
|
54
|
-
export default PostAuthorSelect;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { sprintf,
|
|
4
|
+
import { sprintf, __ } from '@wordpress/i18n';
|
|
5
5
|
import { Button } from '@wordpress/components';
|
|
6
6
|
import { useSelect } from '@wordpress/data';
|
|
7
7
|
import { backup } from '@wordpress/icons';
|
|
@@ -31,13 +31,13 @@ function LastRevision() {
|
|
|
31
31
|
} ) }
|
|
32
32
|
className="editor-post-last-revision__title"
|
|
33
33
|
icon={ backup }
|
|
34
|
-
|
|
35
|
-
{ sprintf(
|
|
36
|
-
/* translators: %
|
|
37
|
-
|
|
34
|
+
iconPosition="right"
|
|
35
|
+
text={ sprintf(
|
|
36
|
+
/* translators: %s: number of revisions */
|
|
37
|
+
__( 'Revisions (%s)' ),
|
|
38
38
|
revisionsCount
|
|
39
39
|
) }
|
|
40
|
-
|
|
40
|
+
/>
|
|
41
41
|
</PostLastRevisionCheck>
|
|
42
42
|
);
|
|
43
43
|
}
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
.editor-post-last-revision__title {
|
|
2
2
|
width: 100%;
|
|
3
|
-
font-weight:
|
|
4
|
-
|
|
5
|
-
.dashicon {
|
|
6
|
-
margin-right: 5px;
|
|
7
|
-
}
|
|
3
|
+
font-weight: 500;
|
|
8
4
|
}
|
|
9
5
|
|
|
10
|
-
.
|
|
6
|
+
.editor-post-last-revision__title.components-button.has-icon {
|
|
11
7
|
height: 100%;
|
|
8
|
+
justify-content: space-between;
|
|
12
9
|
|
|
13
10
|
&:hover,
|
|
14
11
|
&:active {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.editor-post-panel__row {
|
|
2
2
|
width: 100%;
|
|
3
|
-
min-height: $button-size;
|
|
3
|
+
min-height: $button-size-next-default-40px;
|
|
4
4
|
justify-content: flex-start !important;
|
|
5
5
|
align-items: flex-start !important;
|
|
6
6
|
}
|
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
.editor-post-panel__row-label {
|
|
9
9
|
width: 30%;
|
|
10
10
|
flex-shrink: 0;
|
|
11
|
-
min-height: $button-size;
|
|
11
|
+
min-height: $button-size-next-default-40px;
|
|
12
12
|
display: flex;
|
|
13
13
|
align-items: center;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
.editor-post-panel__row-control {
|
|
17
17
|
flex-grow: 1;
|
|
18
|
-
min-height: $button-size;
|
|
18
|
+
min-height: $button-size-next-default-40px;
|
|
19
19
|
display: flex;
|
|
20
20
|
align-items: center;
|
|
21
21
|
}
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { withSelect } from '@wordpress/data';
|
|
5
|
+
import { useState } from '@wordpress/element';
|
|
6
|
+
import { useSelect } from '@wordpress/data';
|
|
8
7
|
import { PanelBody } from '@wordpress/components';
|
|
9
8
|
import { store as coreStore } from '@wordpress/core-data';
|
|
10
9
|
|
|
@@ -34,12 +33,26 @@ const TagsPanel = () => {
|
|
|
34
33
|
);
|
|
35
34
|
};
|
|
36
35
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
const MaybeTagsPanel = () => {
|
|
37
|
+
const { hasTags, isPostTypeSupported } = useSelect( ( select ) => {
|
|
38
|
+
const postType = select( editorStore ).getCurrentPostType();
|
|
39
|
+
const tagsTaxonomy = select( coreStore ).getTaxonomy( 'post_tag' );
|
|
40
|
+
const _isPostTypeSupported = tagsTaxonomy?.types?.includes( postType );
|
|
41
|
+
const areTagsFetched = tagsTaxonomy !== undefined;
|
|
42
|
+
const tags =
|
|
43
|
+
tagsTaxonomy &&
|
|
44
|
+
select( editorStore ).getEditedPostAttribute(
|
|
45
|
+
tagsTaxonomy.rest_base
|
|
46
|
+
);
|
|
47
|
+
return {
|
|
48
|
+
hasTags: !! tags?.length,
|
|
49
|
+
isPostTypeSupported: areTagsFetched && _isPostTypeSupported,
|
|
42
50
|
};
|
|
51
|
+
}, [] );
|
|
52
|
+
const [ hadTagsWhenOpeningThePanel ] = useState( hasTags );
|
|
53
|
+
|
|
54
|
+
if ( ! isPostTypeSupported ) {
|
|
55
|
+
return null;
|
|
43
56
|
}
|
|
44
57
|
|
|
45
58
|
/*
|
|
@@ -52,34 +65,11 @@ class MaybeTagsPanel extends Component {
|
|
|
52
65
|
* hiding this panel and keeping the user from adding
|
|
53
66
|
* more than one tag.
|
|
54
67
|
*/
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
return <TagsPanel />;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
return null;
|
|
68
|
+
if ( ! hadTagsWhenOpeningThePanel ) {
|
|
69
|
+
return <TagsPanel />;
|
|
61
70
|
}
|
|
62
|
-
}
|
|
63
71
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
const tags =
|
|
69
|
-
tagsTaxonomy &&
|
|
70
|
-
select( editorStore ).getEditedPostAttribute(
|
|
71
|
-
tagsTaxonomy.rest_base
|
|
72
|
-
);
|
|
73
|
-
return {
|
|
74
|
-
areTagsFetched: tagsTaxonomy !== undefined,
|
|
75
|
-
isPostTypeSupported:
|
|
76
|
-
tagsTaxonomy &&
|
|
77
|
-
tagsTaxonomy.types.some( ( type ) => type === postType ),
|
|
78
|
-
hasTags: tags && tags.length,
|
|
79
|
-
};
|
|
80
|
-
} ),
|
|
81
|
-
ifCondition(
|
|
82
|
-
( { areTagsFetched, isPostTypeSupported } ) =>
|
|
83
|
-
isPostTypeSupported && areTagsFetched
|
|
84
|
-
)
|
|
85
|
-
)( MaybeTagsPanel );
|
|
72
|
+
return null;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export default MaybeTagsPanel;
|
|
@@ -152,7 +152,9 @@
|
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
input[readonly] {
|
|
155
|
-
padding
|
|
155
|
+
// Do not increase top and bottom padding otherwise Firefox won't show the text overflow ellipsis.
|
|
156
|
+
// See https://github.com/WordPress/gutenberg/pull/57310
|
|
157
|
+
padding: $grid-unit-15;
|
|
156
158
|
background: $gray-100;
|
|
157
159
|
border-color: $gray-400;
|
|
158
160
|
overflow: hidden;
|
|
@@ -102,7 +102,7 @@ function getTimezoneAbbreviation() {
|
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
const symbol = timezone.offset < 0 ? '' : '+';
|
|
105
|
-
return `UTC${ symbol }${ timezone.
|
|
105
|
+
return `UTC${ symbol }${ timezone.offsetFormatted }`;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
function isTimezoneSameAsSiteTimezone( date ) {
|
|
@@ -40,6 +40,7 @@ export default function PostSchedulePanel() {
|
|
|
40
40
|
contentClassName="editor-post-schedule__dialog"
|
|
41
41
|
renderToggle={ ( { onToggle, isOpen } ) => (
|
|
42
42
|
<Button
|
|
43
|
+
__next40pxDefaultSize
|
|
43
44
|
className="editor-post-schedule__dialog-toggle"
|
|
44
45
|
variant="tertiary"
|
|
45
46
|
onClick={ onToggle }
|