@wordpress/editor 13.27.2 → 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 +1 -2
- 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 +5 -6
- 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 +11 -18
- package/build/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
- package/build/components/editor-canvas/index.js +14 -10
- 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 +12 -11
- package/build/components/post-template/block-theme.js.map +1 -1
- package/build/components/post-template/classic-theme.js +10 -11
- package/build/components/post-template/classic-theme.js.map +1 -1
- package/build/components/post-template/create-new-template-modal.js +4 -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 +12 -6
- 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 +31 -62
- 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-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 +72 -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/components/document-bar/index.js +5 -6
- package/build-module/components/document-bar/index.js.map +1 -1
- package/build-module/components/editor-canvas/edit-template-blocks-notification.js +11 -18
- package/build-module/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
- package/build-module/components/editor-canvas/index.js +13 -8
- 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 +12 -11
- package/build-module/components/post-template/block-theme.js.map +1 -1
- package/build-module/components/post-template/classic-theme.js +9 -9
- package/build-module/components/post-template/classic-theme.js.map +1 -1
- package/build-module/components/post-template/create-new-template-modal.js +4 -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 +10 -2
- 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-style/style-rtl.css +28 -22
- package/build-style/style.css +28 -22
- package/package.json +32 -32
- package/src/components/document-bar/index.js +22 -17
- package/src/components/editor-canvas/edit-template-blocks-notification.js +31 -30
- package/src/components/editor-canvas/index.js +14 -4
- 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 +29 -22
- package/src/components/post-template/classic-theme.js +10 -13
- package/src/components/post-template/create-new-template-modal.js +7 -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 +22 -2
- package/src/components/provider/use-block-editor-settings.js +1 -1
- package/src/hooks/pattern-partial-syncing.js +23 -4
|
@@ -181,7 +181,10 @@ function EntitiesSavedStatesExtensible({
|
|
|
181
181
|
className: "entities-saved-states__text-prompt"
|
|
182
182
|
}, (0, _react.createElement)("strong", {
|
|
183
183
|
className: "entities-saved-states__text-prompt--header"
|
|
184
|
-
}, (0, _i18n.__)('Are you ready to save?')), additionalPrompt, (0, _react.createElement)("p", null, isDirty ? (0,
|
|
184
|
+
}, (0, _i18n.__)('Are you ready to save?')), additionalPrompt, (0, _react.createElement)("p", null, isDirty ? (0, _element.createInterpolateElement)((0, _i18n.sprintf)( /* translators: %d: number of site changes waiting to be saved. */
|
|
185
|
+
(0, _i18n._n)('There is <strong>%d site change</strong> waiting to be saved.', 'There are <strong>%d site changes</strong> waiting to be saved.', sortedPartitionedSavables.length), sortedPartitionedSavables.length), {
|
|
186
|
+
strong: (0, _react.createElement)("strong", null)
|
|
187
|
+
}) : (0, _i18n.__)('Select the items you want to save.'))), sortedPartitionedSavables.map(list => {
|
|
185
188
|
return (0, _react.createElement)(_entityTypeList.default, {
|
|
186
189
|
key: list[0].name,
|
|
187
190
|
list: list,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_i18n","_data","_element","_coreData","_blockEditor","_compose","_notices","_entityTypeList","_interopRequireDefault","_useIsDirty","PUBLISH_ON_SAVE_ENTITIES","kind","name","identity","values","EntitiesSavedStates","close","isDirtyProps","useIsDirty","_react","createElement","EntitiesSavedStatesExtensible","additionalPrompt","undefined","onSave","saveEnabled","saveEnabledProp","saveLabel","__","dirtyEntityRecords","isDirty","setUnselectedEntities","unselectedEntities","saveButtonRef","useRef","editEntityRecord","saveEditedEntityRecord","__experimentalSaveSpecifiedEntityEdits","saveSpecifiedEntityEdits","useDispatch","coreStore","__unstableMarkLastChangeAsPersistent","blockEditorStore","createSuccessNotice","createErrorNotice","removeNotice","noticesStore","partitionedSavables","reduce","acc","record","push","site","siteSavables","wp_template","templateSavables","wp_template_part","templatePartSavables","contentSavables","sortedPartitionedSavables","Object","filter","Array","isArray","homeUrl","useSelect","select","getUnstableBase","home","saveCheckedEntities","saveNoticeId","entitiesToSave","key","property","some","elt","siteItemsToSave","pendingSavedRecords","forEach","typeToPublish","status","length","Promise","all","then","value","type","id","actions","label","url","catch","error","dismissPanel","useCallback","saveDialogRef","saveDialogProps","useDialog","onClose","ref","className","Flex","gap","FlexItem","isBlock","as","Button","variant","disabled","onClick","map","list","default"],"sources":["@wordpress/editor/src/components/entities-saved-states/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button, Flex, FlexItem } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useCallback, useRef } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { __experimentalUseDialog as useDialog } from '@wordpress/compose';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport EntityTypeList from './entity-type-list';\nimport { useIsDirty } from './hooks/use-is-dirty';\n\nconst PUBLISH_ON_SAVE_ENTITIES = [\n\t{\n\t\tkind: 'postType',\n\t\tname: 'wp_navigation',\n\t},\n];\n\nfunction identity( values ) {\n\treturn values;\n}\n\nexport default function EntitiesSavedStates( { close } ) {\n\tconst isDirtyProps = useIsDirty();\n\treturn (\n\t\t<EntitiesSavedStatesExtensible close={ close } { ...isDirtyProps } />\n\t);\n}\n\nexport function EntitiesSavedStatesExtensible( {\n\tadditionalPrompt = undefined,\n\tclose,\n\tonSave = identity,\n\tsaveEnabled: saveEnabledProp = undefined,\n\tsaveLabel = __( 'Save' ),\n\n\tdirtyEntityRecords,\n\tisDirty,\n\tsetUnselectedEntities,\n\tunselectedEntities,\n} ) {\n\tconst saveButtonRef = useRef();\n\tconst {\n\t\teditEntityRecord,\n\t\tsaveEditedEntityRecord,\n\t\t__experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits,\n\t} = useDispatch( coreStore );\n\n\tconst { __unstableMarkLastChangeAsPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\n\tconst { createSuccessNotice, createErrorNotice, removeNotice } =\n\t\tuseDispatch( noticesStore );\n\n\t// To group entities by type.\n\tconst partitionedSavables = dirtyEntityRecords.reduce( ( acc, record ) => {\n\t\tconst { name } = record;\n\t\tif ( ! acc[ name ] ) {\n\t\t\tacc[ name ] = [];\n\t\t}\n\t\tacc[ name ].push( record );\n\t\treturn acc;\n\t}, {} );\n\n\t// Sort entity groups.\n\tconst {\n\t\tsite: siteSavables,\n\t\twp_template: templateSavables,\n\t\twp_template_part: templatePartSavables,\n\t\t...contentSavables\n\t} = partitionedSavables;\n\tconst sortedPartitionedSavables = [\n\t\tsiteSavables,\n\t\ttemplateSavables,\n\t\ttemplatePartSavables,\n\t\t...Object.values( contentSavables ),\n\t].filter( Array.isArray );\n\n\tconst saveEnabled = saveEnabledProp ?? isDirty;\n\n\tconst { homeUrl } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetUnstableBase, // Site index.\n\t\t} = select( coreStore );\n\t\treturn {\n\t\t\thomeUrl: getUnstableBase()?.home,\n\t\t};\n\t}, [] );\n\n\tconst saveCheckedEntities = () => {\n\t\tconst saveNoticeId = 'site-editor-save-success';\n\t\tremoveNotice( saveNoticeId );\n\t\tconst entitiesToSave = dirtyEntityRecords.filter(\n\t\t\t( { kind, name, key, property } ) => {\n\t\t\t\treturn ! unselectedEntities.some(\n\t\t\t\t\t( elt ) =>\n\t\t\t\t\t\telt.kind === kind &&\n\t\t\t\t\t\telt.name === name &&\n\t\t\t\t\t\telt.key === key &&\n\t\t\t\t\t\telt.property === property\n\t\t\t\t);\n\t\t\t}\n\t\t);\n\n\t\tclose( entitiesToSave );\n\n\t\tconst siteItemsToSave = [];\n\t\tconst pendingSavedRecords = [];\n\t\tentitiesToSave.forEach( ( { kind, name, key, property } ) => {\n\t\t\tif ( 'root' === kind && 'site' === name ) {\n\t\t\t\tsiteItemsToSave.push( property );\n\t\t\t} else {\n\t\t\t\tif (\n\t\t\t\t\tPUBLISH_ON_SAVE_ENTITIES.some(\n\t\t\t\t\t\t( typeToPublish ) =>\n\t\t\t\t\t\t\ttypeToPublish.kind === kind &&\n\t\t\t\t\t\t\ttypeToPublish.name === name\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\teditEntityRecord( kind, name, key, { status: 'publish' } );\n\t\t\t\t}\n\n\t\t\t\tpendingSavedRecords.push(\n\t\t\t\t\tsaveEditedEntityRecord( kind, name, key )\n\t\t\t\t);\n\t\t\t}\n\t\t} );\n\t\tif ( siteItemsToSave.length ) {\n\t\t\tpendingSavedRecords.push(\n\t\t\t\tsaveSpecifiedEntityEdits(\n\t\t\t\t\t'root',\n\t\t\t\t\t'site',\n\t\t\t\t\tundefined,\n\t\t\t\t\tsiteItemsToSave\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t__unstableMarkLastChangeAsPersistent();\n\n\t\tPromise.all( pendingSavedRecords )\n\t\t\t.then( ( values ) => {\n\t\t\t\treturn onSave( values );\n\t\t\t} )\n\t\t\t.then( ( values ) => {\n\t\t\t\tif (\n\t\t\t\t\tvalues.some( ( value ) => typeof value === 'undefined' )\n\t\t\t\t) {\n\t\t\t\t\tcreateErrorNotice( __( 'Saving failed.' ) );\n\t\t\t\t} else {\n\t\t\t\t\tcreateSuccessNotice( __( 'Site updated.' ), {\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\tid: saveNoticeId,\n\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'View site' ),\n\t\t\t\t\t\t\t\turl: homeUrl,\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} )\n\t\t\t.catch( ( error ) =>\n\t\t\t\tcreateErrorNotice( `${ __( 'Saving failed.' ) } ${ error }` )\n\t\t\t);\n\t};\n\n\t// Explicitly define this with no argument passed. Using `close` on\n\t// its own will use the event object in place of the expected saved entities.\n\tconst dismissPanel = useCallback( () => close(), [ close ] );\n\n\tconst [ saveDialogRef, saveDialogProps ] = useDialog( {\n\t\tonClose: () => dismissPanel(),\n\t} );\n\n\treturn (\n\t\t<div\n\t\t\tref={ saveDialogRef }\n\t\t\t{ ...saveDialogProps }\n\t\t\tclassName=\"entities-saved-states__panel\"\n\t\t>\n\t\t\t<Flex className=\"entities-saved-states__panel-header\" gap={ 2 }>\n\t\t\t\t<FlexItem\n\t\t\t\t\tisBlock\n\t\t\t\t\tas={ Button }\n\t\t\t\t\tref={ saveButtonRef }\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\tdisabled={ ! saveEnabled }\n\t\t\t\t\tonClick={ saveCheckedEntities }\n\t\t\t\t\tclassName=\"editor-entities-saved-states__save-button\"\n\t\t\t\t>\n\t\t\t\t\t{ saveLabel }\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem\n\t\t\t\t\tisBlock\n\t\t\t\t\tas={ Button }\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tonClick={ dismissPanel }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t</FlexItem>\n\t\t\t</Flex>\n\n\t\t\t<div className=\"entities-saved-states__text-prompt\">\n\t\t\t\t<strong className=\"entities-saved-states__text-prompt--header\">\n\t\t\t\t\t{ __( 'Are you ready to save?' ) }\n\t\t\t\t</strong>\n\t\t\t\t{ additionalPrompt }\n\t\t\t\t<p>\n\t\t\t\t\t{ isDirty\n\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t'The following changes have been made to your site, templates, and content.'\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: __( 'Select the items you want to save.' ) }\n\t\t\t\t</p>\n\t\t\t</div>\n\n\t\t\t{ sortedPartitionedSavables.map( ( list ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<EntityTypeList\n\t\t\t\t\t\tkey={ list[ 0 ].name }\n\t\t\t\t\t\tlist={ list }\n\t\t\t\t\t\tunselectedEntities={ unselectedEntities }\n\t\t\t\t\t\tsetUnselectedEntities={ setUnselectedEntities }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AAKA,IAAAQ,eAAA,GAAAC,sBAAA,CAAAT,OAAA;AACA,IAAAU,WAAA,GAAAV,OAAA;AAhBA;AACA;AACA;;AAUA;AACA;AACA;;AAIA,MAAMW,wBAAwB,GAAG,CAChC;EACCC,IAAI,EAAE,UAAU;EAChBC,IAAI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tB,IAAAjE,QAAE,EAAE,QAAS,CACN,CACL,CAAC,EAEP,IAAAT,MAAA,CAAAC,aAAA;IAAKgF,SAAS,EAAC;EAAoC,GAClD,IAAAjF,MAAA,CAAAC,aAAA;IAAQgF,SAAS,EAAC;EAA4C,GAC3D,IAAAxE,QAAE,EAAE,wBAAyB,CACxB,CAAC,EACPN,gBAAgB,EAClB,IAAAH,MAAA,CAAAC,aAAA,aACGU,OAAO,GACN,IAAAF,QAAE,EACF,4EACA,CAAC,GACD,IAAAA,QAAE,EAAE,oCAAqC,CAC1C,CACC,CAAC,EAEJ+B,yBAAyB,CAACmD,GAAG,CAAIC,IAAI,IAAM;IAC5C,OACC,IAAA5F,MAAA,CAAAC,aAAA,EAACb,eAAA,CAAAyG,OAAc;MACdxC,GAAG,EAAGuC,IAAI,CAAE,CAAC,CAAE,CAACnG,IAAM;MACtBmG,IAAI,EAAGA,IAAM;MACb/E,kBAAkB,EAAGA,kBAAoB;MACzCD,qBAAqB,EAAGA;IAAuB,CAC/C,CAAC;EAEJ,CAAE,CACE,CAAC;AAER"}
|
|
1
|
+
{"version":3,"names":["_components","require","_i18n","_data","_element","_coreData","_blockEditor","_compose","_notices","_entityTypeList","_interopRequireDefault","_useIsDirty","PUBLISH_ON_SAVE_ENTITIES","kind","name","identity","values","EntitiesSavedStates","close","isDirtyProps","useIsDirty","_react","createElement","EntitiesSavedStatesExtensible","additionalPrompt","undefined","onSave","saveEnabled","saveEnabledProp","saveLabel","__","dirtyEntityRecords","isDirty","setUnselectedEntities","unselectedEntities","saveButtonRef","useRef","editEntityRecord","saveEditedEntityRecord","__experimentalSaveSpecifiedEntityEdits","saveSpecifiedEntityEdits","useDispatch","coreStore","__unstableMarkLastChangeAsPersistent","blockEditorStore","createSuccessNotice","createErrorNotice","removeNotice","noticesStore","partitionedSavables","reduce","acc","record","push","site","siteSavables","wp_template","templateSavables","wp_template_part","templatePartSavables","contentSavables","sortedPartitionedSavables","Object","filter","Array","isArray","homeUrl","useSelect","select","getUnstableBase","home","saveCheckedEntities","saveNoticeId","entitiesToSave","key","property","some","elt","siteItemsToSave","pendingSavedRecords","forEach","typeToPublish","status","length","Promise","all","then","value","type","id","actions","label","url","catch","error","dismissPanel","useCallback","saveDialogRef","saveDialogProps","useDialog","onClose","ref","className","Flex","gap","FlexItem","isBlock","as","Button","variant","disabled","onClick","createInterpolateElement","sprintf","_n","strong","map","list","default"],"sources":["@wordpress/editor/src/components/entities-saved-states/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button, Flex, FlexItem } from '@wordpress/components';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tuseCallback,\n\tuseRef,\n\tcreateInterpolateElement,\n} from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { __experimentalUseDialog as useDialog } from '@wordpress/compose';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport EntityTypeList from './entity-type-list';\nimport { useIsDirty } from './hooks/use-is-dirty';\n\nconst PUBLISH_ON_SAVE_ENTITIES = [\n\t{\n\t\tkind: 'postType',\n\t\tname: 'wp_navigation',\n\t},\n];\n\nfunction identity( values ) {\n\treturn values;\n}\n\nexport default function EntitiesSavedStates( { close } ) {\n\tconst isDirtyProps = useIsDirty();\n\treturn (\n\t\t<EntitiesSavedStatesExtensible close={ close } { ...isDirtyProps } />\n\t);\n}\n\nexport function EntitiesSavedStatesExtensible( {\n\tadditionalPrompt = undefined,\n\tclose,\n\tonSave = identity,\n\tsaveEnabled: saveEnabledProp = undefined,\n\tsaveLabel = __( 'Save' ),\n\n\tdirtyEntityRecords,\n\tisDirty,\n\tsetUnselectedEntities,\n\tunselectedEntities,\n} ) {\n\tconst saveButtonRef = useRef();\n\tconst {\n\t\teditEntityRecord,\n\t\tsaveEditedEntityRecord,\n\t\t__experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits,\n\t} = useDispatch( coreStore );\n\n\tconst { __unstableMarkLastChangeAsPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\n\tconst { createSuccessNotice, createErrorNotice, removeNotice } =\n\t\tuseDispatch( noticesStore );\n\n\t// To group entities by type.\n\tconst partitionedSavables = dirtyEntityRecords.reduce( ( acc, record ) => {\n\t\tconst { name } = record;\n\t\tif ( ! acc[ name ] ) {\n\t\t\tacc[ name ] = [];\n\t\t}\n\t\tacc[ name ].push( record );\n\t\treturn acc;\n\t}, {} );\n\n\t// Sort entity groups.\n\tconst {\n\t\tsite: siteSavables,\n\t\twp_template: templateSavables,\n\t\twp_template_part: templatePartSavables,\n\t\t...contentSavables\n\t} = partitionedSavables;\n\tconst sortedPartitionedSavables = [\n\t\tsiteSavables,\n\t\ttemplateSavables,\n\t\ttemplatePartSavables,\n\t\t...Object.values( contentSavables ),\n\t].filter( Array.isArray );\n\n\tconst saveEnabled = saveEnabledProp ?? isDirty;\n\n\tconst { homeUrl } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetUnstableBase, // Site index.\n\t\t} = select( coreStore );\n\t\treturn {\n\t\t\thomeUrl: getUnstableBase()?.home,\n\t\t};\n\t}, [] );\n\n\tconst saveCheckedEntities = () => {\n\t\tconst saveNoticeId = 'site-editor-save-success';\n\t\tremoveNotice( saveNoticeId );\n\t\tconst entitiesToSave = dirtyEntityRecords.filter(\n\t\t\t( { kind, name, key, property } ) => {\n\t\t\t\treturn ! unselectedEntities.some(\n\t\t\t\t\t( elt ) =>\n\t\t\t\t\t\telt.kind === kind &&\n\t\t\t\t\t\telt.name === name &&\n\t\t\t\t\t\telt.key === key &&\n\t\t\t\t\t\telt.property === property\n\t\t\t\t);\n\t\t\t}\n\t\t);\n\n\t\tclose( entitiesToSave );\n\n\t\tconst siteItemsToSave = [];\n\t\tconst pendingSavedRecords = [];\n\t\tentitiesToSave.forEach( ( { kind, name, key, property } ) => {\n\t\t\tif ( 'root' === kind && 'site' === name ) {\n\t\t\t\tsiteItemsToSave.push( property );\n\t\t\t} else {\n\t\t\t\tif (\n\t\t\t\t\tPUBLISH_ON_SAVE_ENTITIES.some(\n\t\t\t\t\t\t( typeToPublish ) =>\n\t\t\t\t\t\t\ttypeToPublish.kind === kind &&\n\t\t\t\t\t\t\ttypeToPublish.name === name\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\teditEntityRecord( kind, name, key, { status: 'publish' } );\n\t\t\t\t}\n\n\t\t\t\tpendingSavedRecords.push(\n\t\t\t\t\tsaveEditedEntityRecord( kind, name, key )\n\t\t\t\t);\n\t\t\t}\n\t\t} );\n\t\tif ( siteItemsToSave.length ) {\n\t\t\tpendingSavedRecords.push(\n\t\t\t\tsaveSpecifiedEntityEdits(\n\t\t\t\t\t'root',\n\t\t\t\t\t'site',\n\t\t\t\t\tundefined,\n\t\t\t\t\tsiteItemsToSave\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t__unstableMarkLastChangeAsPersistent();\n\n\t\tPromise.all( pendingSavedRecords )\n\t\t\t.then( ( values ) => {\n\t\t\t\treturn onSave( values );\n\t\t\t} )\n\t\t\t.then( ( values ) => {\n\t\t\t\tif (\n\t\t\t\t\tvalues.some( ( value ) => typeof value === 'undefined' )\n\t\t\t\t) {\n\t\t\t\t\tcreateErrorNotice( __( 'Saving failed.' ) );\n\t\t\t\t} else {\n\t\t\t\t\tcreateSuccessNotice( __( 'Site updated.' ), {\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\tid: saveNoticeId,\n\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'View site' ),\n\t\t\t\t\t\t\t\turl: homeUrl,\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} )\n\t\t\t.catch( ( error ) =>\n\t\t\t\tcreateErrorNotice( `${ __( 'Saving failed.' ) } ${ error }` )\n\t\t\t);\n\t};\n\n\t// Explicitly define this with no argument passed. Using `close` on\n\t// its own will use the event object in place of the expected saved entities.\n\tconst dismissPanel = useCallback( () => close(), [ close ] );\n\n\tconst [ saveDialogRef, saveDialogProps ] = useDialog( {\n\t\tonClose: () => dismissPanel(),\n\t} );\n\n\treturn (\n\t\t<div\n\t\t\tref={ saveDialogRef }\n\t\t\t{ ...saveDialogProps }\n\t\t\tclassName=\"entities-saved-states__panel\"\n\t\t>\n\t\t\t<Flex className=\"entities-saved-states__panel-header\" gap={ 2 }>\n\t\t\t\t<FlexItem\n\t\t\t\t\tisBlock\n\t\t\t\t\tas={ Button }\n\t\t\t\t\tref={ saveButtonRef }\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\tdisabled={ ! saveEnabled }\n\t\t\t\t\tonClick={ saveCheckedEntities }\n\t\t\t\t\tclassName=\"editor-entities-saved-states__save-button\"\n\t\t\t\t>\n\t\t\t\t\t{ saveLabel }\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem\n\t\t\t\t\tisBlock\n\t\t\t\t\tas={ Button }\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tonClick={ dismissPanel }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t</FlexItem>\n\t\t\t</Flex>\n\n\t\t\t<div className=\"entities-saved-states__text-prompt\">\n\t\t\t\t<strong className=\"entities-saved-states__text-prompt--header\">\n\t\t\t\t\t{ __( 'Are you ready to save?' ) }\n\t\t\t\t</strong>\n\t\t\t\t{ additionalPrompt }\n\t\t\t\t<p>\n\t\t\t\t\t{ isDirty\n\t\t\t\t\t\t? createInterpolateElement(\n\t\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t\t/* translators: %d: number of site changes waiting to be saved. */\n\t\t\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t\t\t'There is <strong>%d site change</strong> waiting to be saved.',\n\t\t\t\t\t\t\t\t\t\t'There are <strong>%d site changes</strong> waiting to be saved.',\n\t\t\t\t\t\t\t\t\t\tsortedPartitionedSavables.length\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tsortedPartitionedSavables.length\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t{ strong: <strong /> }\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: __( 'Select the items you want to save.' ) }\n\t\t\t\t</p>\n\t\t\t</div>\n\n\t\t\t{ sortedPartitionedSavables.map( ( list ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<EntityTypeList\n\t\t\t\t\t\tkey={ list[ 0 ].name }\n\t\t\t\t\t\tlist={ list }\n\t\t\t\t\t\tunselectedEntities={ unselectedEntities }\n\t\t\t\t\t\tsetUnselectedEntities={ setUnselectedEntities }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAKA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AAKA,IAAAQ,eAAA,GAAAC,sBAAA,CAAAT,OAAA;AACA,IAAAU,WAAA,GAAAV,OAAA;AApBA;AACA;AACA;;AAcA;AACA;AACA;;AAIA,MAAMW,wBAAwB,GAAG,CAChC;EACCC,IAAI,EAAE,UAAU;EAChBC,IAAI,EAAE;AACP,CAAC,CACD;AAED,SAASC,QAAQA,CAAEC,MAAM,EAAG;EAC3B,OAAOA,MAAM;AACd;AAEe,SAASC,mBAAmBA,CAAE;EAAEC;AAAM,CAAC,EAAG;EACxD,MAAMC,YAAY,GAAG,IAAAC,sBAAU,EAAC,CAAC;EACjC,OACC,IAAAC,MAAA,CAAAC,aAAA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gB,EAClB,IAAAH,MAAA,CAAAC,aAAA,aACGU,OAAO,GACN,IAAAgF,iCAAwB,EACxB,IAAAC,aAAO,GACN;EACA,IAAAC,QAAE,EACD,+DAA+D,EAC/D,iEAAiE,EACjErD,yBAAyB,CAACsB,MAC3B,CAAC,EACDtB,yBAAyB,CAACsB,MAC3B,CAAC,EACD;IAAEgC,MAAM,EAAE,IAAA9F,MAAA,CAAAC,aAAA,gBAAS;EAAE,CACrB,CAAC,GACD,IAAAQ,QAAE,EAAE,oCAAqC,CAC1C,CACC,CAAC,EAEJ+B,yBAAyB,CAACuD,GAAG,CAAIC,IAAI,IAAM;IAC5C,OACC,IAAAhG,MAAA,CAAAC,aAAA,EAACb,eAAA,CAAA6G,OAAc;MACd5C,GAAG,EAAG2C,IAAI,CAAE,CAAC,CAAE,CAACvG,IAAM;MACtBuG,IAAI,EAAGA,IAAM;MACbnF,kBAAkB,EAAGA,kBAAoB;MACzCD,qBAAqB,EAAGA;IAAuB,CAC/C,CAAC;EAEJ,CAAE,CACE,CAAC;AAER"}
|
|
@@ -77,6 +77,5 @@ class ErrorBoundary extends _element.Component {
|
|
|
77
77
|
}, (0, _i18n.__)('The editor has encountered an unexpected error.'));
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
var _default = ErrorBoundary;
|
|
81
|
-
exports.default = _default;
|
|
80
|
+
var _default = exports.default = ErrorBoundary;
|
|
82
81
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_i18n","_components","_data","_blockEditor","_compose","_hooks","_store","getContent","select","editorStore","getEditedPostContent","error","CopyButton","text","children","ref","useCopyToClipboard","_react","createElement","Button","variant","ErrorBoundary","Component","constructor","arguments","state","componentDidCatch","doAction","getDerivedStateFromError","render","props","actions","key","__","stack","Warning","className","_default","exports","default"],"sources":["@wordpress/editor/src/components/error-boundary/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { select } from '@wordpress/data';\nimport { Warning } from '@wordpress/block-editor';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { doAction } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction getContent() {\n\ttry {\n\t\t// While `select` in a component is generally discouraged, it is\n\t\t// used here because it (a) reduces the chance of data loss in the\n\t\t// case of additional errors by performing a direct retrieval and\n\t\t// (b) avoids the performance cost associated with unnecessary\n\t\t// content serialization throughout the lifetime of a non-erroring\n\t\t// application.\n\t\treturn select( editorStore ).getEditedPostContent();\n\t} catch ( error ) {}\n}\n\nfunction CopyButton( { text, children } ) {\n\tconst ref = useCopyToClipboard( text );\n\treturn (\n\t\t<Button variant=\"secondary\" ref={ ref }>\n\t\t\t{ children }\n\t\t</Button>\n\t);\n}\n\nclass ErrorBoundary extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.state = {\n\t\t\terror: null,\n\t\t};\n\t}\n\n\tcomponentDidCatch( error ) {\n\t\tdoAction( 'editor.ErrorBoundary.errorLogged', error );\n\t}\n\n\tstatic getDerivedStateFromError( error ) {\n\t\treturn { error };\n\t}\n\n\trender() {\n\t\tconst { error } = this.state;\n\t\tif ( ! error ) {\n\t\t\treturn this.props.children;\n\t\t}\n\n\t\tconst actions = [\n\t\t\t<CopyButton key=\"copy-post\" text={ getContent }>\n\t\t\t\t{ __( 'Copy Post Text' ) }\n\t\t\t</CopyButton>,\n\t\t\t<CopyButton key=\"copy-error\" text={ error.stack }>\n\t\t\t\t{ __( 'Copy Error' ) }\n\t\t\t</CopyButton>,\n\t\t];\n\n\t\treturn (\n\t\t\t<Warning className=\"editor-error-boundary\" actions={ actions }>\n\t\t\t\t{ __( 'The editor has encountered an unexpected error.' ) }\n\t\t\t</Warning>\n\t\t);\n\t}\n}\n\nexport default ErrorBoundary;\n"],"mappings":";;;;;;;AAGA,IAAAA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;IAC3B;IAEA,MAAMiB,OAAO,GAAG,CACf,IAAAd,MAAA,CAAAC,aAAA,EAACN,UAAU;MAACoB,GAAG,EAAC,WAAW;MAACnB,IAAI,EAAGN;IAAY,GAC5C,IAAA0B,QAAE,EAAE,gBAAiB,CACZ,CAAC,EACb,IAAAhB,MAAA,CAAAC,aAAA,EAACN,UAAU;MAACoB,GAAG,EAAC,YAAY;MAACnB,IAAI,EAAGF,KAAK,CAACuB;IAAO,GAC9C,IAAAD,QAAE,EAAE,YAAa,CACR,CAAC,CACb;IAED,OACC,IAAAhB,MAAA,CAAAC,aAAA,EAACf,YAAA,CAAAgC,OAAO;MAACC,SAAS,EAAC,uBAAuB;MAACL,OAAO,EAAGA;IAAS,GAC3D,IAAAE,QAAE,EAAE,iDAAkD,CAChD,CAAC;EAEZ;AACD;AAAC,IAAAI,QAAA,
|
|
1
|
+
{"version":3,"names":["_element","require","_i18n","_components","_data","_blockEditor","_compose","_hooks","_store","getContent","select","editorStore","getEditedPostContent","error","CopyButton","text","children","ref","useCopyToClipboard","_react","createElement","Button","variant","ErrorBoundary","Component","constructor","arguments","state","componentDidCatch","doAction","getDerivedStateFromError","render","props","actions","key","__","stack","Warning","className","_default","exports","default"],"sources":["@wordpress/editor/src/components/error-boundary/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { select } from '@wordpress/data';\nimport { Warning } from '@wordpress/block-editor';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { doAction } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction getContent() {\n\ttry {\n\t\t// While `select` in a component is generally discouraged, it is\n\t\t// used here because it (a) reduces the chance of data loss in the\n\t\t// case of additional errors by performing a direct retrieval and\n\t\t// (b) avoids the performance cost associated with unnecessary\n\t\t// content serialization throughout the lifetime of a non-erroring\n\t\t// application.\n\t\treturn select( editorStore ).getEditedPostContent();\n\t} catch ( error ) {}\n}\n\nfunction CopyButton( { text, children } ) {\n\tconst ref = useCopyToClipboard( text );\n\treturn (\n\t\t<Button variant=\"secondary\" ref={ ref }>\n\t\t\t{ children }\n\t\t</Button>\n\t);\n}\n\nclass ErrorBoundary extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.state = {\n\t\t\terror: null,\n\t\t};\n\t}\n\n\tcomponentDidCatch( error ) {\n\t\tdoAction( 'editor.ErrorBoundary.errorLogged', error );\n\t}\n\n\tstatic getDerivedStateFromError( error ) {\n\t\treturn { error };\n\t}\n\n\trender() {\n\t\tconst { error } = this.state;\n\t\tif ( ! error ) {\n\t\t\treturn this.props.children;\n\t\t}\n\n\t\tconst actions = [\n\t\t\t<CopyButton key=\"copy-post\" text={ getContent }>\n\t\t\t\t{ __( 'Copy Post Text' ) }\n\t\t\t</CopyButton>,\n\t\t\t<CopyButton key=\"copy-error\" text={ error.stack }>\n\t\t\t\t{ __( 'Copy Error' ) }\n\t\t\t</CopyButton>,\n\t\t];\n\n\t\treturn (\n\t\t\t<Warning className=\"editor-error-boundary\" actions={ actions }>\n\t\t\t\t{ __( 'The editor has encountered an unexpected error.' ) }\n\t\t\t</Warning>\n\t\t);\n\t}\n}\n\nexport default ErrorBoundary;\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAKA,IAAAO,MAAA,GAAAP,OAAA;AAdA;AACA;AACA;;AASA;AACA;AACA;;AAGA,SAASQ,UAAUA,CAAA,EAAG;EACrB,IAAI;IACH;IACA;IACA;IACA;IACA;IACA;IACA,OAAO,IAAAC,YAAM,EAAEC,YAAY,C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CAAAgC,OAAO;MAACC,SAAS,EAAC,uBAAuB;MAACL,OAAO,EAAGA;IAAS,GAC3D,IAAAE,QAAE,EAAE,iDAAkD,CAChD,CAAC;EAEZ;AACD;AAAC,IAAAI,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEclB,aAAa"}
|
|
@@ -68,6 +68,5 @@ function EditorKeyboardShortcutsRegister() {
|
|
|
68
68
|
}, [registerShortcut]);
|
|
69
69
|
return (0, _react.createElement)(_blockEditor.BlockEditorKeyboardShortcuts.Register, null);
|
|
70
70
|
}
|
|
71
|
-
var _default = EditorKeyboardShortcutsRegister;
|
|
72
|
-
exports.default = _default;
|
|
71
|
+
var _default = exports.default = EditorKeyboardShortcutsRegister;
|
|
73
72
|
//# sourceMappingURL=register-shortcuts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_data","_i18n","_blockEditor","_keyboardShortcuts","_keycodes","EditorKeyboardShortcutsRegister","registerShortcut","useDispatch","keyboardShortcutsStore","useEffect","name","category","description","__","keyCombination","modifier","character","aliases","isAppleOS","_react","createElement","BlockEditorKeyboardShortcuts","Register","_default","exports","default"],"sources":["@wordpress/editor/src/components/global-keyboard-shortcuts/register-shortcuts.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { BlockEditorKeyboardShortcuts } from '@wordpress/block-editor';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { isAppleOS } from '@wordpress/keycodes';\n\nfunction EditorKeyboardShortcutsRegister() {\n\t// Registering the shortcuts.\n\tconst { registerShortcut } = useDispatch( keyboardShortcutsStore );\n\tuseEffect( () => {\n\t\tregisterShortcut( {\n\t\t\tname: 'core/editor/save',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Save your changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 's',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/editor/undo',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Undo your last changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 'z',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/editor/redo',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Redo your last undo.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primaryShift',\n\t\t\t\tcharacter: 'z',\n\t\t\t},\n\t\t\t// Disable on Apple OS because it conflicts with the browser's\n\t\t\t// history shortcut. It's a fine alias for both Windows and Linux.\n\t\t\t// Since there's no conflict for Ctrl+Shift+Z on both Windows and\n\t\t\t// Linux, we keep it as the default for consistency.\n\t\t\taliases: isAppleOS()\n\t\t\t\t? []\n\t\t\t\t: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmodifier: 'primary',\n\t\t\t\t\t\t\tcharacter: 'y',\n\t\t\t\t\t\t},\n\t\t\t\t ],\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/editor/toggle-list-view',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Open the block list view.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'access',\n\t\t\t\tcharacter: 'o',\n\t\t\t},\n\t\t} );\n\t}, [ registerShortcut ] );\n\n\treturn <BlockEditorKeyboardShortcuts.Register />;\n}\n\nexport default EditorKeyboardShortcutsRegister;\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,kBAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AARA;AACA;AACA;;AAQA,SAASM,+BAA+B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EAAClB,YAAA,CAAAmB,4BAA4B,CAACC,QAAQ,MAAE,CAAC;AACjD;AAAC,IAAAC,QAAA,
|
|
1
|
+
{"version":3,"names":["_element","require","_data","_i18n","_blockEditor","_keyboardShortcuts","_keycodes","EditorKeyboardShortcutsRegister","registerShortcut","useDispatch","keyboardShortcutsStore","useEffect","name","category","description","__","keyCombination","modifier","character","aliases","isAppleOS","_react","createElement","BlockEditorKeyboardShortcuts","Register","_default","exports","default"],"sources":["@wordpress/editor/src/components/global-keyboard-shortcuts/register-shortcuts.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { BlockEditorKeyboardShortcuts } from '@wordpress/block-editor';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { isAppleOS } from '@wordpress/keycodes';\n\nfunction EditorKeyboardShortcutsRegister() {\n\t// Registering the shortcuts.\n\tconst { registerShortcut } = useDispatch( keyboardShortcutsStore );\n\tuseEffect( () => {\n\t\tregisterShortcut( {\n\t\t\tname: 'core/editor/save',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Save your changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 's',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/editor/undo',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Undo your last changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 'z',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/editor/redo',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Redo your last undo.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primaryShift',\n\t\t\t\tcharacter: 'z',\n\t\t\t},\n\t\t\t// Disable on Apple OS because it conflicts with the browser's\n\t\t\t// history shortcut. It's a fine alias for both Windows and Linux.\n\t\t\t// Since there's no conflict for Ctrl+Shift+Z on both Windows and\n\t\t\t// Linux, we keep it as the default for consistency.\n\t\t\taliases: isAppleOS()\n\t\t\t\t? []\n\t\t\t\t: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmodifier: 'primary',\n\t\t\t\t\t\t\tcharacter: 'y',\n\t\t\t\t\t\t},\n\t\t\t\t ],\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/editor/toggle-list-view',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Open the block list view.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'access',\n\t\t\t\tcharacter: 'o',\n\t\t\t},\n\t\t} );\n\t}, [ registerShortcut ] );\n\n\treturn <BlockEditorKeyboardShortcuts.Register />;\n}\n\nexport default EditorKeyboardShortcutsRegister;\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,kBAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AARA;AACA;AACA;;AAQA,SAASM,+BAA+BA,CAAA,EAAG;EAC1C;EACA,MAAM;IAAEC;EAAiB,CAAC,GAAG,IAAAC,iBAAW,EAAEC,wBAAuB,CAAC;EAClE,IAAAC,kBAAS,EAAE,MAAM;IAChBH,gBAAgB,CAAE;MACjBI,IAAI,EAAE,kBAAkB;MACxBC,QAAQ,EAAE,QAAQ;MAClBC,WAAW,EAAE,IAAAC,QAAE,EAAE,oBAAqB,CAAC;MACvCC,cAAc,EAAE;QACfC,QAAQ,EAAE,SAAS;QACnBC,SAAS,EAAE;MACZ;IACD,CAAE,CAAC;IAEHV,gBAAgB,CAAE;MACjBI,IAAI,EAAE,kBAAkB;MACxBC,QAAQ,EAAE,QAAQ;MAClBC,WAAW,EAAE,IAAAC,QAAE,EAAE,yBAA0B,CAAC;MAC5CC,cAAc,EAAE;QACfC,QAAQ,EAAE,SAAS;QACnBC,SAAS,EAAE;MACZ;IACD,CAAE,CAAC;IAEHV,gBAAgB,CAAE;MACjBI,IAAI,EAAE,kBAAkB;MACxBC,QAAQ,EAAE,QAAQ;MAClBC,WAAW,EAAE,IAAAC,QAAE,EAAE,sBAAuB,CAAC;MACzCC,cAAc,EAAE;QACfC,QAAQ,EAAE,cAAc;QACxBC,SAAS,EAAE;MACZ,CAAC;MACD;MACA;MACA;MACA;MACAC,OAAO,EAAE,IAAAC,mBAAS,EAAC,CAAC,GACjB,EAAE,GACF,CACA;QACCH,QAAQ,EAAE,SAAS;QACnBC,SAAS,EAAE;MACZ,CAAC;IAEL,CAAE,CAAC;IAEHV,gBAAgB,CAAE;MACjBI,IAAI,EAAE,8BAA8B;MACpCC,QAAQ,EAAE,QAAQ;MAClBC,WAAW,EAAE,IAAAC,QAAE,EAAE,2BAA4B,CAAC;MAC9CC,cAAc,EAAE;QACfC,QAAQ,EAAE,QAAQ;QAClBC,SAAS,EAAE;MACZ;IACD,CAAE,CAAC;EACJ,CAAC,EAAE,CAAEV,gBAAgB,CAAG,CAAC;EAEzB,OAAO,IAAAa,MAAA,CAAAC,aAAA,EAAClB,YAAA,CAAAmB,4BAA4B,CAACC,QAAQ,MAAE,CAAC;AACjD;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcpB,+BAA+B"}
|
|
@@ -702,8 +702,8 @@ Object.keys(_deprecated).forEach(function (key) {
|
|
|
702
702
|
}
|
|
703
703
|
});
|
|
704
704
|
});
|
|
705
|
-
function _getRequireWildcardCache(
|
|
706
|
-
function _interopRequireWildcard(
|
|
705
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
706
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
707
707
|
/**
|
|
708
708
|
* Internal dependencies
|
|
709
709
|
*/
|
|
@@ -714,8 +714,6 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
714
714
|
|
|
715
715
|
// State Related Components.
|
|
716
716
|
|
|
717
|
-
const VisualEditorGlobalKeyboardShortcuts = _globalKeyboardShortcuts.default;
|
|
718
|
-
exports.
|
|
719
|
-
const TextEditorGlobalKeyboardShortcuts = _globalKeyboardShortcuts.default;
|
|
720
|
-
exports.TextEditorGlobalKeyboardShortcuts = TextEditorGlobalKeyboardShortcuts;
|
|
717
|
+
const VisualEditorGlobalKeyboardShortcuts = exports.VisualEditorGlobalKeyboardShortcuts = _globalKeyboardShortcuts.default;
|
|
718
|
+
const TextEditorGlobalKeyboardShortcuts = exports.TextEditorGlobalKeyboardShortcuts = _globalKeyboardShortcuts.default;
|
|
721
719
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_globalKeyboardShortcuts","_interopRequireDefault","require","_autocompleters","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_autosaveMonitor","_documentBar","_documentOutline","_check","_registerShortcuts","_redo","_undo","_editorNotices","_editorSnackbars","_entitiesSavedStates","_useIsDirty","_errorBoundary","_localAutosaveMonitor","_check2","_order","_panel","_parent","_classicTheme","_panel2","_postAuthor","_check3","_panel3","_postComments","_panel4","_postExcerpt","_check4","_panel5","_postFeaturedImage","_check5","_panel6","_postFormat","_check6","_postLastRevision","_check7","_panel7","_postLockedModal","_postPendingStatus","_check8","_postPingbacks","_postPreviewButton","_postPublishButton","_label","_postPublishPanel","_postSavedState","_postSchedule","_check9","_label2","_interopRequireWildcard","_panel8","_postSlug","_check10","_postSticky","_check11","_postSwitchToDraftButton","_postSyncStatus","_postTaxonomies","_flatTermSelector","_hierarchicalTermSelector","_check12","_panel9","_postTextEditor","_postTitle","_postTitleRaw","_postTrash","_check13","_postTypeSupportCheck","_postUrl","_check14","_label3","_panel10","_postVisibility","_label4","_check15","_tableOfContents","_themeSupportCheck","_unsavedChangesWarning","_wordCount","_timeToRead","_characterCount","_provider","_deprecated","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","newObj","hasPropertyDescriptor","getOwnPropertyDescriptor","desc","set","VisualEditorGlobalKeyboardShortcuts","EditorKeyboardShortcuts","TextEditorGlobalKeyboardShortcuts"],"sources":["@wordpress/editor/src/components/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport EditorKeyboardShortcuts from './global-keyboard-shortcuts';\n\n// Block Creation Components.\nexport * from './autocompleters';\n\n// Post Related Components.\nexport { default as AutosaveMonitor } from './autosave-monitor';\nexport { default as DocumentBar } from './document-bar';\nexport { default as DocumentOutline } from './document-outline';\nexport { default as DocumentOutlineCheck } from './document-outline/check';\nexport { EditorKeyboardShortcuts };\nexport { default as EditorKeyboardShortcutsRegister } from './global-keyboard-shortcuts/register-shortcuts';\nexport { default as EditorHistoryRedo } from './editor-history/redo';\nexport { default as EditorHistoryUndo } from './editor-history/undo';\nexport { default as EditorNotices } from './editor-notices';\nexport { default as EditorSnackbars } from './editor-snackbars';\nexport { default as EntitiesSavedStates } from './entities-saved-states';\nexport { useIsDirty as useEntitiesSavedStatesIsDirty } from './entities-saved-states/hooks/use-is-dirty';\nexport { default as ErrorBoundary } from './error-boundary';\nexport { default as LocalAutosaveMonitor } from './local-autosave-monitor';\nexport { default as PageAttributesCheck } from './page-attributes/check';\nexport { default as PageAttributesOrder } from './page-attributes/order';\nexport { default as PageAttributesPanel } from './page-attributes/panel';\nexport { default as PageAttributesParent } from './page-attributes/parent';\nexport { default as PageTemplate } from './post-template/classic-theme';\nexport { default as PostTemplatePanel } from './post-template/panel';\nexport { default as PostAuthor } from './post-author';\nexport { default as PostAuthorCheck } from './post-author/check';\nexport { default as PostAuthorPanel } from './post-author/panel';\nexport { default as PostComments } from './post-comments';\nexport { default as PostDiscussionPanel } from './post-discussion/panel';\nexport { default as PostExcerpt } from './post-excerpt';\nexport { default as PostExcerptCheck } from './post-excerpt/check';\nexport { default as PostExcerptPanel } from './post-excerpt/panel';\nexport { default as PostFeaturedImage } from './post-featured-image';\nexport { default as PostFeaturedImageCheck } from './post-featured-image/check';\nexport { default as PostFeaturedImagePanel } from './post-featured-image/panel';\nexport { default as PostFormat } from './post-format';\nexport { default as PostFormatCheck } from './post-format/check';\nexport { default as PostLastRevision } from './post-last-revision';\nexport { default as PostLastRevisionCheck } from './post-last-revision/check';\nexport { default as PostLastRevisionPanel } from './post-last-revision/panel';\nexport { default as PostLockedModal } from './post-locked-modal';\nexport { default as PostPendingStatus } from './post-pending-status';\nexport { default as PostPendingStatusCheck } from './post-pending-status/check';\nexport { default as PostPingbacks } from './post-pingbacks';\nexport { default as PostPreviewButton } from './post-preview-button';\nexport { default as PostPublishButton } from './post-publish-button';\nexport { default as PostPublishButtonLabel } from './post-publish-button/label';\nexport { default as PostPublishPanel } from './post-publish-panel';\nexport { default as PostSavedState } from './post-saved-state';\nexport { default as PostSchedule } from './post-schedule';\nexport { default as PostScheduleCheck } from './post-schedule/check';\nexport {\n\tdefault as PostScheduleLabel,\n\tusePostScheduleLabel,\n} from './post-schedule/label';\nexport { default as PostSchedulePanel } from './post-schedule/panel';\nexport { default as PostSlug } from './post-slug';\nexport { default as PostSlugCheck } from './post-slug/check';\nexport { default as PostSticky } from './post-sticky';\nexport { default as PostStickyCheck } from './post-sticky/check';\nexport { default as PostSwitchToDraftButton } from './post-switch-to-draft-button';\nexport {\n\tdefault as PostSyncStatus,\n\tPostSyncStatusModal,\n} from './post-sync-status';\nexport { default as PostTaxonomies } from './post-taxonomies';\nexport { FlatTermSelector as PostTaxonomiesFlatTermSelector } from './post-taxonomies/flat-term-selector';\nexport { HierarchicalTermSelector as PostTaxonomiesHierarchicalTermSelector } from './post-taxonomies/hierarchical-term-selector';\nexport { default as PostTaxonomiesCheck } from './post-taxonomies/check';\nexport { default as PostTaxonomiesPanel } from './post-taxonomies/panel';\nexport { default as PostTextEditor } from './post-text-editor';\nexport { default as PostTitle } from './post-title';\nexport { default as PostTitleRaw } from './post-title/post-title-raw';\nexport { default as PostTrash } from './post-trash';\nexport { default as PostTrashCheck } from './post-trash/check';\nexport { default as PostTypeSupportCheck } from './post-type-support-check';\nexport { default as PostURL } from './post-url';\nexport { default as PostURLCheck } from './post-url/check';\nexport { default as PostURLLabel, usePostURLLabel } from './post-url/label';\nexport { default as PostURLPanel } from './post-url/panel';\nexport { default as PostVisibility } from './post-visibility';\nexport {\n\tdefault as PostVisibilityLabel,\n\tusePostVisibilityLabel,\n} from './post-visibility/label';\nexport { default as PostVisibilityCheck } from './post-visibility/check';\nexport { default as TableOfContents } from './table-of-contents';\nexport { default as ThemeSupportCheck } from './theme-support-check';\nexport { default as UnsavedChangesWarning } from './unsaved-changes-warning';\nexport { default as WordCount } from './word-count';\nexport { default as TimeToRead } from './time-to-read';\nexport { default as CharacterCount } from './character-count';\n\n// State Related Components.\nexport { default as EditorProvider } from './provider';\n\nexport * from './deprecated';\nexport const VisualEditorGlobalKeyboardShortcuts = EditorKeyboardShortcuts;\nexport const TextEditorGlobalKeyboardShortcuts = EditorKeyboardShortcuts;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,CAAA/F,GAAA,IAAA+F,IAAA,CAAAC,GAAA,KAAA3G,MAAA,CAAAS,cAAA,CAAA8F,MAAA,EAAApG,GAAA,EAAAuG,IAAA,YAAAH,MAAA,CAAApG,GAAA,IAAA+F,GAAA,CAAA/F,GAAA,SAAAoG,MAAA,CAAAH,OAAA,GAAAF,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAM,GAAA,CAAAT,GAAA,EAAAK,MAAA,YAAAA,MAAA;AArG7B;AACA;AACA;;AAGA;;AAGA;;AA0FA;;AAIO,MAAMK,mCAAmC,GAAGC,gCAAuB;AAACrG,OAAA,CAAAoG,mCAAA,GAAAA,mCAAA;AACpE,MAAME,iCAAiC,GAAGD,gCAAuB;AAACrG,OAAA,CAAAsG,iCAAA,GAAAA,iCAAA"}
|
|
1
|
+
{"version":3,"names":["_globalKeyboardShortcuts","_interopRequireDefault","require","_autocompleters","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_autosaveMonitor","_documentBar","_documentOutline","_check","_registerShortcuts","_redo","_undo","_editorNotices","_editorSnackbars","_entitiesSavedStates","_useIsDirty","_errorBoundary","_localAutosaveMonitor","_check2","_order","_panel","_parent","_classicTheme","_panel2","_postAuthor","_check3","_panel3","_postComments","_panel4","_postExcerpt","_check4","_panel5","_postFeaturedImage","_check5","_panel6","_postFormat","_check6","_postLastRevision","_check7","_panel7","_postLockedModal","_postPendingStatus","_check8","_postPingbacks","_postPreviewButton","_postPublishButton","_label","_postPublishPanel","_postSavedState","_postSchedule","_check9","_label2","_interopRequireWildcard","_panel8","_postSlug","_check10","_postSticky","_check11","_postSwitchToDraftButton","_postSyncStatus","_postTaxonomies","_flatTermSelector","_hierarchicalTermSelector","_check12","_panel9","_postTextEditor","_postTitle","_postTitleRaw","_postTrash","_check13","_postTypeSupportCheck","_postUrl","_check14","_label3","_panel10","_postVisibility","_label4","_check15","_tableOfContents","_themeSupportCheck","_unsavedChangesWarning","_wordCount","_timeToRead","_characterCount","_provider","_deprecated","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","n","__proto__","a","getOwnPropertyDescriptor","u","i","set","VisualEditorGlobalKeyboardShortcuts","EditorKeyboardShortcuts","TextEditorGlobalKeyboardShortcuts"],"sources":["@wordpress/editor/src/components/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport EditorKeyboardShortcuts from './global-keyboard-shortcuts';\n\n// Block Creation Components.\nexport * from './autocompleters';\n\n// Post Related Components.\nexport { default as AutosaveMonitor } from './autosave-monitor';\nexport { default as DocumentBar } from './document-bar';\nexport { default as DocumentOutline } from './document-outline';\nexport { default as DocumentOutlineCheck } from './document-outline/check';\nexport { EditorKeyboardShortcuts };\nexport { default as EditorKeyboardShortcutsRegister } from './global-keyboard-shortcuts/register-shortcuts';\nexport { default as EditorHistoryRedo } from './editor-history/redo';\nexport { default as EditorHistoryUndo } from './editor-history/undo';\nexport { default as EditorNotices } from './editor-notices';\nexport { default as EditorSnackbars } from './editor-snackbars';\nexport { default as EntitiesSavedStates } from './entities-saved-states';\nexport { useIsDirty as useEntitiesSavedStatesIsDirty } from './entities-saved-states/hooks/use-is-dirty';\nexport { default as ErrorBoundary } from './error-boundary';\nexport { default as LocalAutosaveMonitor } from './local-autosave-monitor';\nexport { default as PageAttributesCheck } from './page-attributes/check';\nexport { default as PageAttributesOrder } from './page-attributes/order';\nexport { default as PageAttributesPanel } from './page-attributes/panel';\nexport { default as PageAttributesParent } from './page-attributes/parent';\nexport { default as PageTemplate } from './post-template/classic-theme';\nexport { default as PostTemplatePanel } from './post-template/panel';\nexport { default as PostAuthor } from './post-author';\nexport { default as PostAuthorCheck } from './post-author/check';\nexport { default as PostAuthorPanel } from './post-author/panel';\nexport { default as PostComments } from './post-comments';\nexport { default as PostDiscussionPanel } from './post-discussion/panel';\nexport { default as PostExcerpt } from './post-excerpt';\nexport { default as PostExcerptCheck } from './post-excerpt/check';\nexport { default as PostExcerptPanel } from './post-excerpt/panel';\nexport { default as PostFeaturedImage } from './post-featured-image';\nexport { default as PostFeaturedImageCheck } from './post-featured-image/check';\nexport { default as PostFeaturedImagePanel } from './post-featured-image/panel';\nexport { default as PostFormat } from './post-format';\nexport { default as PostFormatCheck } from './post-format/check';\nexport { default as PostLastRevision } from './post-last-revision';\nexport { default as PostLastRevisionCheck } from './post-last-revision/check';\nexport { default as PostLastRevisionPanel } from './post-last-revision/panel';\nexport { default as PostLockedModal } from './post-locked-modal';\nexport { default as PostPendingStatus } from './post-pending-status';\nexport { default as PostPendingStatusCheck } from './post-pending-status/check';\nexport { default as PostPingbacks } from './post-pingbacks';\nexport { default as PostPreviewButton } from './post-preview-button';\nexport { default as PostPublishButton } from './post-publish-button';\nexport { default as PostPublishButtonLabel } from './post-publish-button/label';\nexport { default as PostPublishPanel } from './post-publish-panel';\nexport { default as PostSavedState } from './post-saved-state';\nexport { default as PostSchedule } from './post-schedule';\nexport { default as PostScheduleCheck } from './post-schedule/check';\nexport {\n\tdefault as PostScheduleLabel,\n\tusePostScheduleLabel,\n} from './post-schedule/label';\nexport { default as PostSchedulePanel } from './post-schedule/panel';\nexport { default as PostSlug } from './post-slug';\nexport { default as PostSlugCheck } from './post-slug/check';\nexport { default as PostSticky } from './post-sticky';\nexport { default as PostStickyCheck } from './post-sticky/check';\nexport { default as PostSwitchToDraftButton } from './post-switch-to-draft-button';\nexport {\n\tdefault as PostSyncStatus,\n\tPostSyncStatusModal,\n} from './post-sync-status';\nexport { default as PostTaxonomies } from './post-taxonomies';\nexport { FlatTermSelector as PostTaxonomiesFlatTermSelector } from './post-taxonomies/flat-term-selector';\nexport { HierarchicalTermSelector as PostTaxonomiesHierarchicalTermSelector } from './post-taxonomies/hierarchical-term-selector';\nexport { default as PostTaxonomiesCheck } from './post-taxonomies/check';\nexport { default as PostTaxonomiesPanel } from './post-taxonomies/panel';\nexport { default as PostTextEditor } from './post-text-editor';\nexport { default as PostTitle } from './post-title';\nexport { default as PostTitleRaw } from './post-title/post-title-raw';\nexport { default as PostTrash } from './post-trash';\nexport { default as PostTrashCheck } from './post-trash/check';\nexport { default as PostTypeSupportCheck } from './post-type-support-check';\nexport { default as PostURL } from './post-url';\nexport { default as PostURLCheck } from './post-url/check';\nexport { default as PostURLLabel, usePostURLLabel } from './post-url/label';\nexport { default as PostURLPanel } from './post-url/panel';\nexport { default as PostVisibility } from './post-visibility';\nexport {\n\tdefault as PostVisibilityLabel,\n\tusePostVisibilityLabel,\n} from './post-visibility/label';\nexport { default as PostVisibilityCheck } from './post-visibility/check';\nexport { default as TableOfContents } from './table-of-contents';\nexport { default as ThemeSupportCheck } from './theme-support-check';\nexport { default as UnsavedChangesWarning } from './unsaved-changes-warning';\nexport { default as WordCount } from './word-count';\nexport { default as TimeToRead } from './time-to-read';\nexport { default as CharacterCount } from './character-count';\n\n// State Related Components.\nexport { default as EditorProvider } from './provider';\n\nexport * from './deprecated';\nexport const VisualEditorGlobalKeyboardShortcuts = EditorKeyboardShortcuts;\nexport const TextEditorGlobalKeyboardShortcuts = EditorKeyboardShortcuts;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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uB"}
|
|
@@ -27,6 +27,9 @@ var _store = require("../../store");
|
|
|
27
27
|
* Internal dependencies
|
|
28
28
|
*/
|
|
29
29
|
|
|
30
|
+
const {
|
|
31
|
+
Tabs
|
|
32
|
+
} = (0, _lockUnlock.unlock)(_components.privateApis);
|
|
30
33
|
function ListViewSidebar() {
|
|
31
34
|
const {
|
|
32
35
|
setIsListViewOpened
|
|
@@ -59,7 +62,7 @@ function ListViewSidebar() {
|
|
|
59
62
|
// This ref refers to the sidebar as a whole.
|
|
60
63
|
const sidebarRef = (0, _element.useRef)();
|
|
61
64
|
// This ref refers to the tab panel.
|
|
62
|
-
const
|
|
65
|
+
const tabsRef = (0, _element.useRef)();
|
|
63
66
|
// This ref refers to the list view application area.
|
|
64
67
|
const listViewRef = (0, _element.useRef)();
|
|
65
68
|
|
|
@@ -75,7 +78,7 @@ function ListViewSidebar() {
|
|
|
75
78
|
*/
|
|
76
79
|
function handleSidebarFocus(currentTab) {
|
|
77
80
|
// Tab panel focus.
|
|
78
|
-
const tabPanelFocus = _dom.focus.tabbable.find(
|
|
81
|
+
const tabPanelFocus = _dom.focus.tabbable.find(tabsRef.current)[0];
|
|
79
82
|
// List view tab is selected.
|
|
80
83
|
if (currentTab === 'list-view') {
|
|
81
84
|
// 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.
|
|
@@ -100,51 +103,55 @@ function ListViewSidebar() {
|
|
|
100
103
|
// This only fires when the sidebar is open because of the conditional rendering.
|
|
101
104
|
// It is the same shortcut to open but that is defined as a global shortcut and only fires when the sidebar is closed.
|
|
102
105
|
(0, _keyboardShortcuts.useShortcut)('core/editor/toggle-list-view', handleToggleListViewShortcut);
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Render tab content for a given tab name.
|
|
106
|
-
*
|
|
107
|
-
* @param {string} tabName The name of the tab to render.
|
|
108
|
-
*/
|
|
109
|
-
function renderTabContent(tabName) {
|
|
110
|
-
if (tabName === 'list-view') {
|
|
111
|
-
return (0, _react.createElement)("div", {
|
|
112
|
-
className: "editor-list-view-sidebar__list-view-panel-content"
|
|
113
|
-
}, (0, _react.createElement)(_blockEditor.__experimentalListView, {
|
|
114
|
-
dropZoneElement: dropZoneElement
|
|
115
|
-
}));
|
|
116
|
-
}
|
|
117
|
-
return (0, _react.createElement)(_listViewOutline.default, null);
|
|
118
|
-
}
|
|
119
106
|
return (
|
|
120
107
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
121
108
|
(0, _react.createElement)("div", {
|
|
122
109
|
className: "editor-list-view-sidebar",
|
|
123
110
|
onKeyDown: closeOnEscape,
|
|
124
111
|
ref: sidebarRef
|
|
112
|
+
}, (0, _react.createElement)(Tabs, {
|
|
113
|
+
onSelect: tabName => setTab(tabName),
|
|
114
|
+
selectOnMove: false
|
|
115
|
+
// The initial tab value is set explicitly to avoid an initial
|
|
116
|
+
// render where no tab is selected. This ensures that the
|
|
117
|
+
// tabpanel height is correct so the relevant scroll container
|
|
118
|
+
// can be rendered internally.
|
|
119
|
+
,
|
|
120
|
+
initialTabId: "list-view"
|
|
121
|
+
}, (0, _react.createElement)("div", {
|
|
122
|
+
className: "edit-post-editor__document-overview-panel__header"
|
|
125
123
|
}, (0, _react.createElement)(_components.Button, {
|
|
126
124
|
className: "editor-list-view-sidebar__close-button",
|
|
127
125
|
icon: _icons.closeSmall,
|
|
128
126
|
label: (0, _i18n.__)('Close'),
|
|
129
127
|
onClick: closeListView
|
|
130
|
-
}), (0, _react.createElement)(
|
|
131
|
-
className: "editor-list-view-
|
|
132
|
-
ref:
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
},
|
|
145
|
-
className: "editor-list-view-sidebar__list-view-container"
|
|
146
|
-
|
|
147
|
-
|
|
128
|
+
}), (0, _react.createElement)(Tabs.TabList, {
|
|
129
|
+
className: "editor-list-view-sidebar__tabs-tablist",
|
|
130
|
+
ref: tabsRef
|
|
131
|
+
}, (0, _react.createElement)(Tabs.Tab, {
|
|
132
|
+
className: "editor-list-view-sidebar__tabs-tab",
|
|
133
|
+
tabId: "list-view"
|
|
134
|
+
}, (0, _i18n._x)('List View', 'Post overview')), (0, _react.createElement)(Tabs.Tab, {
|
|
135
|
+
className: "editor-list-view-sidebar__tabs-tab",
|
|
136
|
+
tabId: "outline"
|
|
137
|
+
}, (0, _i18n._x)('Outline', 'Post overview')))), (0, _react.createElement)(Tabs.TabPanel, {
|
|
138
|
+
ref: listViewContainerRef,
|
|
139
|
+
className: "editor-list-view-sidebar__tabs-tabpanel",
|
|
140
|
+
tabId: "list-view",
|
|
141
|
+
focusable: false
|
|
142
|
+
}, (0, _react.createElement)("div", {
|
|
143
|
+
className: "editor-list-view-sidebar__list-view-container"
|
|
144
|
+
}, (0, _react.createElement)("div", {
|
|
145
|
+
className: "editor-list-view-sidebar__list-view-panel-content"
|
|
146
|
+
}, (0, _react.createElement)(_blockEditor.__experimentalListView, {
|
|
147
|
+
dropZoneElement: dropZoneElement
|
|
148
|
+
})))), (0, _react.createElement)(Tabs.TabPanel, {
|
|
149
|
+
className: "editor-list-view-sidebar__tabs-tabpanel",
|
|
150
|
+
tabId: "outline",
|
|
151
|
+
focusable: false
|
|
152
|
+
}, (0, _react.createElement)("div", {
|
|
153
|
+
className: "editor-list-view-sidebar__list-view-container"
|
|
154
|
+
}, (0, _react.createElement)(_listViewOutline.default, null)))))
|
|
148
155
|
);
|
|
149
156
|
}
|
|
150
157
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blockEditor","require","_components","_compose","_data","_dom","_element","_i18n","_icons","_keyboardShortcuts","_keycodes","_listViewOutline","_interopRequireDefault","_lockUnlock","_store","ListViewSidebar","setIsListViewOpened","useDispatch","editorStore","getListViewToggleRef","unlock","useSelect","focusOnMountRef","useFocusOnMount","closeListView","useCallback","current","focus","closeOnEscape","event","keyCode","ESCAPE","defaultPrevented","preventDefault","dropZoneElement","setDropZoneElement","useState","tab","setTab","sidebarRef","useRef","tabPanelRef","listViewRef","listViewContainerRef","useMergeRefs","handleSidebarFocus","currentTab","tabPanelFocus","tabbable","find","listViewApplicationFocus","listViewFocusArea","contains","handleToggleListViewShortcut","ownerDocument","activeElement","useShortcut","renderTabContent","tabName","_react","createElement","className","__experimentalListView","default","onKeyDown","ref","Button","icon","closeSmall","label","__","onClick","TabPanel","onSelect","selectOnMove","tabs","name","title","_x"],"sources":["@wordpress/editor/src/components/list-view-sidebar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalListView as ListView } from '@wordpress/block-editor';\nimport { Button, TabPanel } from '@wordpress/components';\nimport { useFocusOnMount, useMergeRefs } from '@wordpress/compose';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { focus } from '@wordpress/dom';\nimport { useCallback, useRef, useState } from '@wordpress/element';\nimport { __, _x } from '@wordpress/i18n';\nimport { closeSmall } from '@wordpress/icons';\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\nimport { ESCAPE } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport ListViewOutline from './list-view-outline';\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\n\nexport default function ListViewSidebar() {\n\tconst { setIsListViewOpened } = useDispatch( editorStore );\n\tconst { getListViewToggleRef } = unlock( useSelect( editorStore ) );\n\n\t// This hook handles focus when the sidebar first renders.\n\tconst focusOnMountRef = useFocusOnMount( 'firstElement' );\n\n\t// When closing the list view, focus should return to the toggle button.\n\tconst closeListView = useCallback( () => {\n\t\tsetIsListViewOpened( false );\n\t\tgetListViewToggleRef().current?.focus();\n\t}, [ getListViewToggleRef, setIsListViewOpened ] );\n\n\tconst closeOnEscape = useCallback(\n\t\t( event ) => {\n\t\t\tif ( event.keyCode === ESCAPE && ! event.defaultPrevented ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tcloseListView();\n\t\t\t}\n\t\t},\n\t\t[ closeListView ]\n\t);\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the dropZoneElement updates.\n\tconst [ dropZoneElement, setDropZoneElement ] = useState( null );\n\t// Tracks our current tab.\n\tconst [ tab, setTab ] = useState( 'list-view' );\n\n\t// This ref refers to the sidebar as a whole.\n\tconst sidebarRef = useRef();\n\t// This ref refers to the tab panel.\n\tconst tabPanelRef = useRef();\n\t// This ref refers to the list view application area.\n\tconst listViewRef = useRef();\n\n\t// Must merge the refs together so focus can be handled properly in the next function.\n\tconst listViewContainerRef = useMergeRefs( [\n\t\tfocusOnMountRef,\n\t\tlistViewRef,\n\t\tsetDropZoneElement,\n\t] );\n\n\t/*\n\t * Callback function to handle list view or outline focus.\n\t *\n\t * @param {string} currentTab The current tab. Either list view or outline.\n\t *\n\t * @return void\n\t */\n\tfunction handleSidebarFocus( currentTab ) {\n\t\t// Tab panel focus.\n\t\tconst tabPanelFocus = focus.tabbable.find( tabPanelRef.current )[ 0 ];\n\t\t// List view tab is selected.\n\t\tif ( currentTab === 'list-view' ) {\n\t\t\t// 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.\n\t\t\tconst listViewApplicationFocus = focus.tabbable.find(\n\t\t\t\tlistViewRef.current\n\t\t\t)[ 0 ];\n\t\t\tconst listViewFocusArea = sidebarRef.current.contains(\n\t\t\t\tlistViewApplicationFocus\n\t\t\t)\n\t\t\t\t? listViewApplicationFocus\n\t\t\t\t: tabPanelFocus;\n\t\t\tlistViewFocusArea.focus();\n\t\t\t// Outline tab is selected.\n\t\t} else {\n\t\t\ttabPanelFocus.focus();\n\t\t}\n\t}\n\n\tconst handleToggleListViewShortcut = useCallback( () => {\n\t\t// If the sidebar has focus, it is safe to close.\n\t\tif (\n\t\t\tsidebarRef.current.contains(\n\t\t\t\tsidebarRef.current.ownerDocument.activeElement\n\t\t\t)\n\t\t) {\n\t\t\tcloseListView();\n\t\t} else {\n\t\t\t// If the list view or outline does not have focus, focus should be moved to it.\n\t\t\thandleSidebarFocus( tab );\n\t\t}\n\t}, [ closeListView, tab ] );\n\n\t// This only fires when the sidebar is open because of the conditional rendering.\n\t// It is the same shortcut to open but that is defined as a global shortcut and only fires when the sidebar is closed.\n\tuseShortcut( 'core/editor/toggle-list-view', handleToggleListViewShortcut );\n\n\t/**\n\t * Render tab content for a given tab name.\n\t *\n\t * @param {string} tabName The name of the tab to render.\n\t */\n\tfunction renderTabContent( tabName ) {\n\t\tif ( tabName === 'list-view' ) {\n\t\t\treturn (\n\t\t\t\t<div className=\"editor-list-view-sidebar__list-view-panel-content\">\n\t\t\t\t\t<ListView dropZoneElement={ dropZoneElement } />\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\t\treturn <ListViewOutline />;\n\t}\n\n\treturn (\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div\n\t\t\tclassName=\"editor-list-view-sidebar\"\n\t\t\tonKeyDown={ closeOnEscape }\n\t\t\tref={ sidebarRef }\n\t\t>\n\t\t\t<Button\n\t\t\t\tclassName=\"editor-list-view-sidebar__close-button\"\n\t\t\t\ticon={ closeSmall }\n\t\t\t\tlabel={ __( 'Close' ) }\n\t\t\t\tonClick={ closeListView }\n\t\t\t/>\n\t\t\t<TabPanel\n\t\t\t\tclassName=\"editor-list-view-sidebar__tab-panel\"\n\t\t\t\tref={ tabPanelRef }\n\t\t\t\tonSelect={ ( tabName ) => setTab( tabName ) }\n\t\t\t\tselectOnMove={ false }\n\t\t\t\ttabs={ [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'list-view',\n\t\t\t\t\t\ttitle: _x( 'List View', 'Post overview' ),\n\t\t\t\t\t\tclassName: 'editor-list-view-sidebar__panel-tab',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'outline',\n\t\t\t\t\t\ttitle: _x( 'Outline', 'Post overview' ),\n\t\t\t\t\t\tclassName: 'editor-list-view-sidebar__panel-tab',\n\t\t\t\t\t},\n\t\t\t\t] }\n\t\t\t>\n\t\t\t\t{ ( currentTab ) => (\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName=\"editor-list-view-sidebar__list-view-container\"\n\t\t\t\t\t\tref={ listViewContainerRef }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ renderTabContent( currentTab.name ) }\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</TabPanel>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,kBAAA,GAAAR,OAAA;AACA,IAAAS,SAAA,GAAAT,OAAA;AAKA,IAAAU,gBAAA,GAAAC,sBAAA,CAAAX,OAAA;AACA,IAAAY,WAAA,GAAAZ,OAAA;AACA,IAAAa,MAAA,GAAAb,OAAA;AAnBA;AACA;AACA;;AAYA;AACA;AACA;;AAKe,SAASc,eAAeA,CAAA,EAAG;EACzC,MAAM;IAAEC;EAAoB,CAAC,GAAG,IAAAC,iBAAW,EAAEC,YAAY,CAAC;EAC1D,MAAM;IAAEC;EAAqB,CAAC,GAAG,IAAAC,kBAAM,EAAE,IAAAC,eAAS,EAAEH,YAAY,CAAE,CAAC;;EAEnE;EACA,MAAMI,eAAe,GAAG,IAAAC,wBAAe,EAAE,cAAe,CAAC;;EAEzD;EACA,MAAMC,aAAa,GAAG,IAAAC,oBAAW,EAAE,MAAM;IACxCT,mBAAmB,CAAE,KAAM,CAAC;IAC5BG,oBAAoB,CAAC,CAAC,CAACO,OAAO,EAAEC,KAAK,CAAC,CAAC;EACxC,CAAC,EAA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AA,EAAC1D,WAAA,CAAAsE,QAAQ;MACRX,SAAS,EAAC,qCAAqC;MAC/CI,GAAG,EAAGxB,WAAa;MACnBgC,QAAQ,EAAKf,OAAO,IAAMpB,MAAM,CAAEoB,OAAQ,CAAG;MAC7CgB,YAAY,EAAG,KAAO;MACtBC,IAAI,EAAG,CACN;QACCC,IAAI,EAAE,WAAW;QACjBC,KAAK,EAAE,IAAAC,QAAE,EAAE,WAAW,EAAE,eAAgB,CAAC;QACzCjB,SAAS,EAAE;MACZ,CAAC,EACD;QACCe,IAAI,EAAE,SAAS;QACfC,KAAK,EAAE,IAAAC,QAAE,EAAE,SAAS,EAAE,eAAgB,CAAC;QACvCjB,SAAS,EAAE;MACZ,CAAC;IACC,GAECf,UAAU,IACb,IAAAa,MAAA,CAAAC,aAAA;MACCC,SAAS,EAAC,+CAA+C;MACzDI,GAAG,EAAGtB;IAAsB,GAE1Bc,gBAAgB,CAAEX,UAAU,CAAC8B,IAAK,CAChC,CAEG,CACN;EAAC;AAER"}
|
|
1
|
+
{"version":3,"names":["_blockEditor","require","_components","_compose","_data","_dom","_element","_i18n","_icons","_keyboardShortcuts","_keycodes","_listViewOutline","_interopRequireDefault","_lockUnlock","_store","Tabs","unlock","componentsPrivateApis","ListViewSidebar","setIsListViewOpened","useDispatch","editorStore","getListViewToggleRef","useSelect","focusOnMountRef","useFocusOnMount","closeListView","useCallback","current","focus","closeOnEscape","event","keyCode","ESCAPE","defaultPrevented","preventDefault","dropZoneElement","setDropZoneElement","useState","tab","setTab","sidebarRef","useRef","tabsRef","listViewRef","listViewContainerRef","useMergeRefs","handleSidebarFocus","currentTab","tabPanelFocus","tabbable","find","listViewApplicationFocus","listViewFocusArea","contains","handleToggleListViewShortcut","ownerDocument","activeElement","useShortcut","_react","createElement","className","onKeyDown","ref","onSelect","tabName","selectOnMove","initialTabId","Button","icon","closeSmall","label","__","onClick","TabList","Tab","tabId","_x","TabPanel","focusable","__experimentalListView","default"],"sources":["@wordpress/editor/src/components/list-view-sidebar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalListView as ListView } from '@wordpress/block-editor';\nimport {\n\tButton,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { useFocusOnMount, useMergeRefs } from '@wordpress/compose';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { focus } from '@wordpress/dom';\nimport { useCallback, useRef, useState } from '@wordpress/element';\nimport { __, _x } from '@wordpress/i18n';\nimport { closeSmall } from '@wordpress/icons';\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\nimport { ESCAPE } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport ListViewOutline from './list-view-outline';\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\n\nconst { Tabs } = unlock( componentsPrivateApis );\n\nexport default function ListViewSidebar() {\n\tconst { setIsListViewOpened } = useDispatch( editorStore );\n\tconst { getListViewToggleRef } = unlock( useSelect( editorStore ) );\n\n\t// This hook handles focus when the sidebar first renders.\n\tconst focusOnMountRef = useFocusOnMount( 'firstElement' );\n\n\t// When closing the list view, focus should return to the toggle button.\n\tconst closeListView = useCallback( () => {\n\t\tsetIsListViewOpened( false );\n\t\tgetListViewToggleRef().current?.focus();\n\t}, [ getListViewToggleRef, setIsListViewOpened ] );\n\n\tconst closeOnEscape = useCallback(\n\t\t( event ) => {\n\t\t\tif ( event.keyCode === ESCAPE && ! event.defaultPrevented ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tcloseListView();\n\t\t\t}\n\t\t},\n\t\t[ closeListView ]\n\t);\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the dropZoneElement updates.\n\tconst [ dropZoneElement, setDropZoneElement ] = useState( null );\n\t// Tracks our current tab.\n\tconst [ tab, setTab ] = useState( 'list-view' );\n\n\t// This ref refers to the sidebar as a whole.\n\tconst sidebarRef = useRef();\n\t// This ref refers to the tab panel.\n\tconst tabsRef = useRef();\n\t// This ref refers to the list view application area.\n\tconst listViewRef = useRef();\n\n\t// Must merge the refs together so focus can be handled properly in the next function.\n\tconst listViewContainerRef = useMergeRefs( [\n\t\tfocusOnMountRef,\n\t\tlistViewRef,\n\t\tsetDropZoneElement,\n\t] );\n\n\t/*\n\t * Callback function to handle list view or outline focus.\n\t *\n\t * @param {string} currentTab The current tab. Either list view or outline.\n\t *\n\t * @return void\n\t */\n\tfunction handleSidebarFocus( currentTab ) {\n\t\t// Tab panel focus.\n\t\tconst tabPanelFocus = focus.tabbable.find( tabsRef.current )[ 0 ];\n\t\t// List view tab is selected.\n\t\tif ( currentTab === 'list-view' ) {\n\t\t\t// 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.\n\t\t\tconst listViewApplicationFocus = focus.tabbable.find(\n\t\t\t\tlistViewRef.current\n\t\t\t)[ 0 ];\n\t\t\tconst listViewFocusArea = sidebarRef.current.contains(\n\t\t\t\tlistViewApplicationFocus\n\t\t\t)\n\t\t\t\t? listViewApplicationFocus\n\t\t\t\t: tabPanelFocus;\n\t\t\tlistViewFocusArea.focus();\n\t\t\t// Outline tab is selected.\n\t\t} else {\n\t\t\ttabPanelFocus.focus();\n\t\t}\n\t}\n\n\tconst handleToggleListViewShortcut = useCallback( () => {\n\t\t// If the sidebar has focus, it is safe to close.\n\t\tif (\n\t\t\tsidebarRef.current.contains(\n\t\t\t\tsidebarRef.current.ownerDocument.activeElement\n\t\t\t)\n\t\t) {\n\t\t\tcloseListView();\n\t\t} else {\n\t\t\t// If the list view or outline does not have focus, focus should be moved to it.\n\t\t\thandleSidebarFocus( tab );\n\t\t}\n\t}, [ closeListView, tab ] );\n\n\t// This only fires when the sidebar is open because of the conditional rendering.\n\t// It is the same shortcut to open but that is defined as a global shortcut and only fires when the sidebar is closed.\n\tuseShortcut( 'core/editor/toggle-list-view', handleToggleListViewShortcut );\n\n\treturn (\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div\n\t\t\tclassName=\"editor-list-view-sidebar\"\n\t\t\tonKeyDown={ closeOnEscape }\n\t\t\tref={ sidebarRef }\n\t\t>\n\t\t\t<Tabs\n\t\t\t\tonSelect={ ( tabName ) => setTab( tabName ) }\n\t\t\t\tselectOnMove={ false }\n\t\t\t\t// The initial tab value is set explicitly to avoid an initial\n\t\t\t\t// render where no tab is selected. This ensures that the\n\t\t\t\t// tabpanel height is correct so the relevant scroll container\n\t\t\t\t// can be rendered internally.\n\t\t\t\tinitialTabId=\"list-view\"\n\t\t\t>\n\t\t\t\t<div className=\"edit-post-editor__document-overview-panel__header\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassName=\"editor-list-view-sidebar__close-button\"\n\t\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\t\tlabel={ __( 'Close' ) }\n\t\t\t\t\t\tonClick={ closeListView }\n\t\t\t\t\t/>\n\t\t\t\t\t<Tabs.TabList\n\t\t\t\t\t\tclassName=\"editor-list-view-sidebar__tabs-tablist\"\n\t\t\t\t\t\tref={ tabsRef }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Tabs.Tab\n\t\t\t\t\t\t\tclassName=\"editor-list-view-sidebar__tabs-tab\"\n\t\t\t\t\t\t\ttabId=\"list-view\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ _x( 'List View', 'Post overview' ) }\n\t\t\t\t\t\t</Tabs.Tab>\n\t\t\t\t\t\t<Tabs.Tab\n\t\t\t\t\t\t\tclassName=\"editor-list-view-sidebar__tabs-tab\"\n\t\t\t\t\t\t\ttabId=\"outline\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ _x( 'Outline', 'Post overview' ) }\n\t\t\t\t\t\t</Tabs.Tab>\n\t\t\t\t\t</Tabs.TabList>\n\t\t\t\t</div>\n\n\t\t\t\t<Tabs.TabPanel\n\t\t\t\t\tref={ listViewContainerRef }\n\t\t\t\t\tclassName=\"editor-list-view-sidebar__tabs-tabpanel\"\n\t\t\t\t\ttabId=\"list-view\"\n\t\t\t\t\tfocusable={ false }\n\t\t\t\t>\n\t\t\t\t\t<div className=\"editor-list-view-sidebar__list-view-container\">\n\t\t\t\t\t\t<div className=\"editor-list-view-sidebar__list-view-panel-content\">\n\t\t\t\t\t\t\t<ListView dropZoneElement={ dropZoneElement } />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</Tabs.TabPanel>\n\t\t\t\t<Tabs.TabPanel\n\t\t\t\t\tclassName=\"editor-list-view-sidebar__tabs-tabpanel\"\n\t\t\t\t\ttabId=\"outline\"\n\t\t\t\t\tfocusable={ false }\n\t\t\t\t>\n\t\t\t\t\t<div className=\"editor-list-view-sidebar__list-view-container\">\n\t\t\t\t\t\t<ListViewOutline />\n\t\t\t\t\t</div>\n\t\t\t\t</Tabs.TabPanel>\n\t\t\t</Tabs>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAIA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,kBAAA,GAAAR,OAAA;AACA,IAAAS,SAAA,GAAAT,OAAA;AAKA,IAAAU,gBAAA,GAAAC,sBAAA,CAAAX,OAAA;AACA,IAAAY,WAAA,GAAAZ,OAAA;AACA,IAAAa,MAAA,GAAAb,OAAA;AAtBA;AACA;AACA;;AAeA;AACA;AACA;;AAKA,MAAM;EAAEc;AAAK,CAAC,GAAG,IAAAC,kBAAM,EAAEC,uBAAsB,CAAC;AAEjC,SAASC,eAAeA,CAAA,EAAG;EACzC,MAAM;IAAEC;EAAoB,CAAC,GAAG,IAAAC,iBAAW,EAAEC,YAAY,CAAC;EAC1D,MAAM;IAAEC;EAAqB,CAAC,GAAG,IAAAN,k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AAA,CAAAC,aAAA,EAACjD,gBAAA,CAAAsE,OAAe,MAAE,CACd,CACS,CACV,CACF;EAAC;AAER"}
|
|
@@ -181,6 +181,5 @@ function LocalAutosaveMonitor() {
|
|
|
181
181
|
autosave: deferredAutosave
|
|
182
182
|
});
|
|
183
183
|
}
|
|
184
|
-
var _default = (0, _compose.ifCondition)(hasSessionStorageSupport)(LocalAutosaveMonitor);
|
|
185
|
-
exports.default = _default;
|
|
184
|
+
var _default = exports.default = (0, _compose.ifCondition)(hasSessionStorageSupport)(LocalAutosaveMonitor);
|
|
186
185
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_compose","_data","_i18n","_blocks","_notices","_autosaveMonitor","_interopRequireDefault","_localAutosave","_store","requestIdleCallback","window","requestAnimationFrame","hasStorageSupport","hasSessionStorageSupport","undefined","sessionStorage","setItem","removeItem","useAutosaveNotice","postId","isEditedPostNew","hasRemoteAutosave","useSelect","select","editorStore","getCurrentPostId","getEditorSettings","autosave","getEditedPostAttribute","createWarningNotice","removeNotice","useDispatch","noticesStore","editPost","resetEditorBlocks","useEffect","localAutosave","localAutosaveGet","JSON","parse","post_title","title","content","excerpt","edits","hasDifference","Object","keys","some","key","localAutosaveClear","id","__","actions","label","onClick","editsContent","editsWithoutContent","useAutosavePurge","isDirty","isAutosaving","didError","isEditedPostDirty","isAutosavingPost","didPostSaveRequestFail","lastIsDirty","useRef","lastIsAutosaving","current","wasEditedPostNew","usePrevious","prevPostId","LocalAutosaveMonitor","deferredAutosave","useCallback","local","localAutosaveInterval","_react","createElement","default","interval","_default","ifCondition","exports"],"sources":["@wordpress/editor/src/components/local-autosave-monitor/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback, useEffect, useRef } from '@wordpress/element';\nimport { ifCondition, usePrevious } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { parse } from '@wordpress/blocks';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport AutosaveMonitor from '../autosave-monitor';\nimport {\n\tlocalAutosaveGet,\n\tlocalAutosaveClear,\n} from '../../store/local-autosave';\nimport { store as editorStore } from '../../store';\n\nconst requestIdleCallback = window.requestIdleCallback\n\t? window.requestIdleCallback\n\t: window.requestAnimationFrame;\n\nlet hasStorageSupport;\n\n/**\n * Function which returns true if the current environment supports browser\n * sessionStorage, or false otherwise. The result of this function is cached and\n * reused in subsequent invocations.\n */\nconst hasSessionStorageSupport = () => {\n\tif ( hasStorageSupport !== undefined ) {\n\t\treturn hasStorageSupport;\n\t}\n\n\ttry {\n\t\t// Private Browsing in Safari 10 and earlier will throw an error when\n\t\t// attempting to set into sessionStorage. The test here is intentional in\n\t\t// causing a thrown error as condition bailing from local autosave.\n\t\twindow.sessionStorage.setItem( '__wpEditorTestSessionStorage', '' );\n\t\twindow.sessionStorage.removeItem( '__wpEditorTestSessionStorage' );\n\t\thasStorageSupport = true;\n\t} catch {\n\t\thasStorageSupport = false;\n\t}\n\n\treturn hasStorageSupport;\n};\n\n/**\n * Custom hook which manages the creation of a notice prompting the user to\n * restore a local autosave, if one exists.\n */\nfunction useAutosaveNotice() {\n\tconst { postId, isEditedPostNew, hasRemoteAutosave } = useSelect(\n\t\t( select ) => ( {\n\t\t\tpostId: select( editorStore ).getCurrentPostId(),\n\t\t\tisEditedPostNew: select( editorStore ).isEditedPostNew(),\n\t\t\thasRemoteAutosave:\n\t\t\t\t!! select( editorStore ).getEditorSettings().autosave,\n\t\t} ),\n\t\t[]\n\t);\n\tconst { getEditedPostAttribute } = useSelect( editorStore );\n\n\tconst { createWarningNotice, removeNotice } = useDispatch( noticesStore );\n\tconst { editPost, resetEditorBlocks } = useDispatch( editorStore );\n\n\tuseEffect( () => {\n\t\tlet localAutosave = localAutosaveGet( postId, isEditedPostNew );\n\t\tif ( ! localAutosave ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tlocalAutosave = JSON.parse( localAutosave );\n\t\t} catch {\n\t\t\t// Not usable if it can't be parsed.\n\t\t\treturn;\n\t\t}\n\n\t\tconst { post_title: title, content, excerpt } = localAutosave;\n\t\tconst edits = { title, content, excerpt };\n\n\t\t{\n\t\t\t// Only display a notice if there is a difference between what has been\n\t\t\t// saved and that which is stored in sessionStorage.\n\t\t\tconst hasDifference = Object.keys( edits ).some( ( key ) => {\n\t\t\t\treturn edits[ key ] !== getEditedPostAttribute( key );\n\t\t\t} );\n\n\t\t\tif ( ! hasDifference ) {\n\t\t\t\t// If there is no difference, it can be safely ejected from storage.\n\t\t\t\tlocalAutosaveClear( postId, isEditedPostNew );\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif ( hasRemoteAutosave ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst id = 'wpEditorAutosaveRestore';\n\n\t\tcreateWarningNotice(\n\t\t\t__(\n\t\t\t\t'The backup of this post in your browser is different from the version below.'\n\t\t\t),\n\t\t\t{\n\t\t\t\tid,\n\t\t\t\tactions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: __( 'Restore the backup' ),\n\t\t\t\t\t\tonClick() {\n\t\t\t\t\t\t\tconst {\n\t\t\t\t\t\t\t\tcontent: editsContent,\n\t\t\t\t\t\t\t\t...editsWithoutContent\n\t\t\t\t\t\t\t} = edits;\n\t\t\t\t\t\t\teditPost( editsWithoutContent );\n\t\t\t\t\t\t\tresetEditorBlocks( parse( edits.content ) );\n\t\t\t\t\t\t\tremoveNotice( id );\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t}\n\t\t);\n\t}, [ isEditedPostNew, postId ] );\n}\n\n/**\n * Custom hook which ejects a local autosave after a successful save occurs.\n */\nfunction useAutosavePurge() {\n\tconst { postId, isEditedPostNew, isDirty, isAutosaving, didError } =\n\t\tuseSelect(\n\t\t\t( select ) => ( {\n\t\t\t\tpostId: select( editorStore ).getCurrentPostId(),\n\t\t\t\tisEditedPostNew: select( editorStore ).isEditedPostNew(),\n\t\t\t\tisDirty: select( editorStore ).isEditedPostDirty(),\n\t\t\t\tisAutosaving: select( editorStore ).isAutosavingPost(),\n\t\t\t\tdidError: select( editorStore ).didPostSaveRequestFail(),\n\t\t\t} ),\n\t\t\t[]\n\t\t);\n\n\tconst lastIsDirty = useRef( isDirty );\n\tconst lastIsAutosaving = useRef( isAutosaving );\n\n\tuseEffect( () => {\n\t\tif (\n\t\t\t! didError &&\n\t\t\t( ( lastIsAutosaving.current && ! isAutosaving ) ||\n\t\t\t\t( lastIsDirty.current && ! isDirty ) )\n\t\t) {\n\t\t\tlocalAutosaveClear( postId, isEditedPostNew );\n\t\t}\n\n\t\tlastIsDirty.current = isDirty;\n\t\tlastIsAutosaving.current = isAutosaving;\n\t}, [ isDirty, isAutosaving, didError ] );\n\n\t// Once the isEditedPostNew changes from true to false, let's clear the auto-draft autosave.\n\tconst wasEditedPostNew = usePrevious( isEditedPostNew );\n\tconst prevPostId = usePrevious( postId );\n\tuseEffect( () => {\n\t\tif ( prevPostId === postId && wasEditedPostNew && ! isEditedPostNew ) {\n\t\t\tlocalAutosaveClear( postId, true );\n\t\t}\n\t}, [ isEditedPostNew, postId ] );\n}\n\nfunction LocalAutosaveMonitor() {\n\tconst { autosave } = useDispatch( editorStore );\n\tconst deferredAutosave = useCallback( () => {\n\t\trequestIdleCallback( () => autosave( { local: true } ) );\n\t}, [] );\n\tuseAutosaveNotice();\n\tuseAutosavePurge();\n\n\tconst localAutosaveInterval = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getEditorSettings().localAutosaveInterval,\n\t\t[]\n\t);\n\n\treturn (\n\t\t<AutosaveMonitor\n\t\t\tinterval={ localAutosaveInterval }\n\t\t\tautosave={ deferredAutosave }\n\t\t/>\n\t);\n}\n\nexport default ifCondition( hasSessionStorageSupport )( LocalAutosaveMonitor );\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAA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W,EAAErE,wBAAyB,CAAC,CAAE2D,oBAAqB,CAAC;AAAAW,OAAA,CAAAJ,OAAA,GAAAE,QAAA"}
|
|
1
|
+
{"version":3,"names":["_element","require","_compose","_data","_i18n","_blocks","_notices","_autosaveMonitor","_interopRequireDefault","_localAutosave","_store","requestIdleCallback","window","requestAnimationFrame","hasStorageSupport","hasSessionStorageSupport","undefined","sessionStorage","setItem","removeItem","useAutosaveNotice","postId","isEditedPostNew","hasRemoteAutosave","useSelect","select","editorStore","getCurrentPostId","getEditorSettings","autosave","getEditedPostAttribute","createWarningNotice","removeNotice","useDispatch","noticesStore","editPost","resetEditorBlocks","useEffect","localAutosave","localAutosaveGet","JSON","parse","post_title","title","content","excerpt","edits","hasDifference","Object","keys","some","key","localAutosaveClear","id","__","actions","label","onClick","editsContent","editsWithoutContent","useAutosavePurge","isDirty","isAutosaving","didError","isEditedPostDirty","isAutosavingPost","didPostSaveRequestFail","lastIsDirty","useRef","lastIsAutosaving","current","wasEditedPostNew","usePrevious","prevPostId","LocalAutosaveMonitor","deferredAutosave","useCallback","local","localAutosaveInterval","_react","createElement","default","interval","_default","exports","ifCondition"],"sources":["@wordpress/editor/src/components/local-autosave-monitor/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback, useEffect, useRef } from '@wordpress/element';\nimport { ifCondition, usePrevious } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { parse } from '@wordpress/blocks';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport AutosaveMonitor from '../autosave-monitor';\nimport {\n\tlocalAutosaveGet,\n\tlocalAutosaveClear,\n} from '../../store/local-autosave';\nimport { store as editorStore } from '../../store';\n\nconst requestIdleCallback = window.requestIdleCallback\n\t? window.requestIdleCallback\n\t: window.requestAnimationFrame;\n\nlet hasStorageSupport;\n\n/**\n * Function which returns true if the current environment supports browser\n * sessionStorage, or false otherwise. The result of this function is cached and\n * reused in subsequent invocations.\n */\nconst hasSessionStorageSupport = () => {\n\tif ( hasStorageSupport !== undefined ) {\n\t\treturn hasStorageSupport;\n\t}\n\n\ttry {\n\t\t// Private Browsing in Safari 10 and earlier will throw an error when\n\t\t// attempting to set into sessionStorage. The test here is intentional in\n\t\t// causing a thrown error as condition bailing from local autosave.\n\t\twindow.sessionStorage.setItem( '__wpEditorTestSessionStorage', '' );\n\t\twindow.sessionStorage.removeItem( '__wpEditorTestSessionStorage' );\n\t\thasStorageSupport = true;\n\t} catch {\n\t\thasStorageSupport = false;\n\t}\n\n\treturn hasStorageSupport;\n};\n\n/**\n * Custom hook which manages the creation of a notice prompting the user to\n * restore a local autosave, if one exists.\n */\nfunction useAutosaveNotice() {\n\tconst { postId, isEditedPostNew, hasRemoteAutosave } = useSelect(\n\t\t( select ) => ( {\n\t\t\tpostId: select( editorStore ).getCurrentPostId(),\n\t\t\tisEditedPostNew: select( editorStore ).isEditedPostNew(),\n\t\t\thasRemoteAutosave:\n\t\t\t\t!! select( editorStore ).getEditorSettings().autosave,\n\t\t} ),\n\t\t[]\n\t);\n\tconst { getEditedPostAttribute } = useSelect( editorStore );\n\n\tconst { createWarningNotice, removeNotice } = useDispatch( noticesStore );\n\tconst { editPost, resetEditorBlocks } = useDispatch( editorStore );\n\n\tuseEffect( () => {\n\t\tlet localAutosave = localAutosaveGet( postId, isEditedPostNew );\n\t\tif ( ! localAutosave ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tlocalAutosave = JSON.parse( localAutosave );\n\t\t} catch {\n\t\t\t// Not usable if it can't be parsed.\n\t\t\treturn;\n\t\t}\n\n\t\tconst { post_title: title, content, excerpt } = localAutosave;\n\t\tconst edits = { title, content, excerpt };\n\n\t\t{\n\t\t\t// Only display a notice if there is a difference between what has been\n\t\t\t// saved and that which is stored in sessionStorage.\n\t\t\tconst hasDifference = Object.keys( edits ).some( ( key ) => {\n\t\t\t\treturn edits[ key ] !== getEditedPostAttribute( key );\n\t\t\t} );\n\n\t\t\tif ( ! hasDifference ) {\n\t\t\t\t// If there is no difference, it can be safely ejected from storage.\n\t\t\t\tlocalAutosaveClear( postId, isEditedPostNew );\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif ( hasRemoteAutosave ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst id = 'wpEditorAutosaveRestore';\n\n\t\tcreateWarningNotice(\n\t\t\t__(\n\t\t\t\t'The backup of this post in your browser is different from the version below.'\n\t\t\t),\n\t\t\t{\n\t\t\t\tid,\n\t\t\t\tactions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: __( 'Restore the backup' ),\n\t\t\t\t\t\tonClick() {\n\t\t\t\t\t\t\tconst {\n\t\t\t\t\t\t\t\tcontent: editsContent,\n\t\t\t\t\t\t\t\t...editsWithoutContent\n\t\t\t\t\t\t\t} = edits;\n\t\t\t\t\t\t\teditPost( editsWithoutContent );\n\t\t\t\t\t\t\tresetEditorBlocks( parse( edits.content ) );\n\t\t\t\t\t\t\tremoveNotice( id );\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t}\n\t\t);\n\t}, [ isEditedPostNew, postId ] );\n}\n\n/**\n * Custom hook which ejects a local autosave after a successful save occurs.\n */\nfunction useAutosavePurge() {\n\tconst { postId, isEditedPostNew, isDirty, isAutosaving, didError } =\n\t\tuseSelect(\n\t\t\t( select ) => ( {\n\t\t\t\tpostId: select( editorStore ).getCurrentPostId(),\n\t\t\t\tisEditedPostNew: select( editorStore ).isEditedPostNew(),\n\t\t\t\tisDirty: select( editorStore ).isEditedPostDirty(),\n\t\t\t\tisAutosaving: select( editorStore ).isAutosavingPost(),\n\t\t\t\tdidError: select( editorStore ).didPostSaveRequestFail(),\n\t\t\t} ),\n\t\t\t[]\n\t\t);\n\n\tconst lastIsDirty = useRef( isDirty );\n\tconst lastIsAutosaving = useRef( isAutosaving );\n\n\tuseEffect( () => {\n\t\tif (\n\t\t\t! didError &&\n\t\t\t( ( lastIsAutosaving.current && ! isAutosaving ) ||\n\t\t\t\t( lastIsDirty.current && ! isDirty ) )\n\t\t) {\n\t\t\tlocalAutosaveClear( postId, isEditedPostNew );\n\t\t}\n\n\t\tlastIsDirty.current = isDirty;\n\t\tlastIsAutosaving.current = isAutosaving;\n\t}, [ isDirty, isAutosaving, didError ] );\n\n\t// Once the isEditedPostNew changes from true to false, let's clear the auto-draft autosave.\n\tconst wasEditedPostNew = usePrevious( isEditedPostNew );\n\tconst prevPostId = usePrevious( postId );\n\tuseEffect( () => {\n\t\tif ( prevPostId === postId && wasEditedPostNew && ! isEditedPostNew ) {\n\t\t\tlocalAutosaveClear( postId, true );\n\t\t}\n\t}, [ isEditedPostNew, postId ] );\n}\n\nfunction LocalAutosaveMonitor() {\n\tconst { autosave } = useDispatch( editorStore );\n\tconst deferredAutosave = useCallback( () => {\n\t\trequestIdleCallback( () => autosave( { local: true } ) );\n\t}, [] );\n\tuseAutosaveNotice();\n\tuseAutosavePurge();\n\n\tconst localAutosaveInterval = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getEditorSettings().localAutosaveInterval,\n\t\t[]\n\t);\n\n\treturn (\n\t\t<AutosaveMonitor\n\t\t\tinterval={ localAutosaveInterval }\n\t\t\tautosave={ deferredAutosave }\n\t\t/>\n\t);\n}\n\nexport default ifCondition( hasSessionStorageSupport )( LocalAutosaveMonitor );\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAKA,IAAAM,gBAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,cAAA,GAAAR,OAAA;AAIA,IAAAS,MAAA,GAAAT,OAAA;AAlBA;AACA;AACA;;AAQA;AACA;AACA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,MAAO,CAAC;EACxC,IAAAgB,kBAAS,EAAE,MAAM;IAChB,IAAKoC,UAAU,KAAKpD,MAAM,IAAIkD,gBAAgB,IAAI,CAAEjD,eAAe,EAAG;MACrE,IAAA8B,iCAAkB,EAAE/B,MAAM,EAAE,IAAK,CAAC;IACnC;EACD,CAAC,EAAE,CAAEC,eAAe,EAAED,MAAM,CAAG,CAAC;AACjC;AAEA,SAASqD,oBAAoBA,CAAA,EAAG;EAC/B,MAAM;IAAE7C;EAAS,CAAC,GAAG,IAAAI,iBAAW,EAAEP,YAAY,CAAC;EAC/C,MAAMiD,gBAAgB,GAAG,IAAAC,oBAAW,EAAE,MAAM;IAC3CjE,mBAAmB,CAAE,MAAMkB,QAAQ,CAAE;MAAEgD,KAAK,EAAE;IAAK,CAAE,CAAE,CAAC;EACzD,CAAC,EAAE,EAAG,CAAC;EACPzD,iBAAiB,CAAC,CAAC;EACnBwC,gBAAgB,CAAC,CAAC;EAElB,MAAMkB,qBAAqB,GAAG,IAAAtD,eAAS,EACpCC,MAAM,IACPA,MAAM,CAAEC,YAAY,CAAC,CAACE,iBAAiB,CAAC,CAAC,CAACkD,qBAAqB,EAChE,EACD,CAAC;EAED,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACzE,gBAAA,CAAA0E,OAAe;IACfC,QAAQ,EAAGJ,qBAAuB;IAClCjD,QAAQ,EAAG8C;EAAkB,CAC7B,CAAC;AAEJ;AAAC,IAAAQ,QAAA,GAAAC,OAAA,CAAAH,OAAA,GAEc,IAAAI,oBAAW,EAAEtE,wBAAyB,CAAC,CAAE2D,oBAAqB,CAAC"}
|
|
@@ -179,6 +179,5 @@ const inserterMediaCategories = [{
|
|
|
179
179
|
}) => `https://wordpress.org/openverse/image/${sourceId}/report/`,
|
|
180
180
|
isExternalResource: true
|
|
181
181
|
}];
|
|
182
|
-
var _default = inserterMediaCategories;
|
|
183
|
-
exports.default = _default;
|
|
182
|
+
var _default = exports.default = inserterMediaCategories;
|
|
184
183
|
//# sourceMappingURL=index.js.map
|