@wordpress/editor 13.15.0 → 13.17.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 +4 -0
- package/build/components/autocompleters/index.js +0 -2
- package/build/components/autocompleters/index.js.map +1 -1
- package/build/components/autocompleters/user.js +2 -9
- package/build/components/autocompleters/user.js.map +1 -1
- package/build/components/autosave-monitor/index.js +0 -24
- package/build/components/autosave-monitor/index.js.map +1 -1
- package/build/components/character-count/index.js +1 -4
- package/build/components/character-count/index.js.map +1 -1
- package/build/components/deprecated.js +1 -11
- package/build/components/deprecated.js.map +1 -1
- package/build/components/deprecated.native.js +0 -1
- package/build/components/deprecated.native.js.map +1 -1
- package/build/components/document-outline/check.js +1 -7
- package/build/components/document-outline/check.js.map +1 -1
- package/build/components/document-outline/index.js +7 -24
- package/build/components/document-outline/index.js.map +1 -1
- package/build/components/document-outline/item.js +1 -5
- package/build/components/document-outline/item.js.map +1 -1
- package/build/components/editor-help/add-blocks.native.js +1 -8
- package/build/components/editor-help/add-blocks.native.js.map +1 -1
- package/build/components/editor-help/customize-blocks.native.js +1 -8
- package/build/components/editor-help/customize-blocks.native.js.map +1 -1
- package/build/components/editor-help/help-detail-navigation-screen.native.js +5 -13
- 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 -7
- 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 -7
- package/build/components/editor-help/help-section-title.native.js.map +1 -1
- package/build/components/editor-help/help-topic-row.native.js +1 -8
- package/build/components/editor-help/help-topic-row.native.js.map +1 -1
- package/build/components/editor-help/icon-move-blocks.native.js +0 -4
- package/build/components/editor-help/icon-move-blocks.native.js.map +1 -1
- package/build/components/editor-help/index.native.js +8 -29
- package/build/components/editor-help/index.native.js.map +1 -1
- package/build/components/editor-help/intro-to-blocks.native.js +1 -9
- package/build/components/editor-help/intro-to-blocks.native.js.map +1 -1
- package/build/components/editor-help/move-blocks.native.js +1 -8
- package/build/components/editor-help/move-blocks.native.js.map +1 -1
- package/build/components/editor-help/remove-blocks.native.js +1 -8
- package/build/components/editor-help/remove-blocks.native.js.map +1 -1
- package/build/components/editor-help/view-sections.native.js +1 -12
- package/build/components/editor-help/view-sections.native.js.map +1 -1
- package/build/components/editor-history/redo.js +6 -14
- package/build/components/editor-history/redo.js.map +1 -1
- package/build/components/editor-history/undo.js +6 -14
- package/build/components/editor-history/undo.js.map +1 -1
- package/build/components/editor-notices/index.js +1 -10
- package/build/components/editor-notices/index.js.map +1 -1
- package/build/components/editor-snackbars/index.js +1 -5
- package/build/components/editor-snackbars/index.js.map +1 -1
- package/build/components/entities-saved-states/entity-record-item.js +3 -10
- package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
- package/build/components/entities-saved-states/entity-type-list.js +3 -15
- package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build/components/entities-saved-states/hooks/use-is-dirty.js +5 -14
- package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
- package/build/components/entities-saved-states/index.js +8 -27
- package/build/components/entities-saved-states/index.js.map +1 -1
- package/build/components/error-boundary/index.js +1 -18
- package/build/components/error-boundary/index.js.map +1 -1
- package/build/components/global-keyboard-shortcuts/index.js +5 -9
- package/build/components/global-keyboard-shortcuts/index.js.map +1 -1
- package/build/components/global-keyboard-shortcuts/register-shortcuts.js +1 -8
- package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
- package/build/components/index.js +4 -76
- package/build/components/index.js.map +1 -1
- package/build/components/index.native.js +0 -9
- package/build/components/index.native.js.map +1 -1
- package/build/components/local-autosave-monitor/index.js +6 -31
- package/build/components/local-autosave-monitor/index.js.map +1 -1
- package/build/components/media-categories/index.js +30 -45
- package/build/components/media-categories/index.js.map +1 -1
- package/build/components/page-attributes/check.js +3 -7
- package/build/components/page-attributes/check.js.map +1 -1
- package/build/components/page-attributes/order.js +17 -42
- package/build/components/page-attributes/order.js.map +1 -1
- package/build/components/page-attributes/parent.js +8 -34
- package/build/components/page-attributes/parent.js.map +1 -1
- package/build/components/post-author/check.js +1 -11
- package/build/components/post-author/check.js.map +1 -1
- package/build/components/post-author/combobox.js +7 -23
- package/build/components/post-author/combobox.js.map +1 -1
- package/build/components/post-author/constants.js +0 -1
- package/build/components/post-author/constants.js.map +1 -1
- package/build/components/post-author/index.js +1 -12
- package/build/components/post-author/index.js.map +1 -1
- package/build/components/post-author/select.js +1 -12
- package/build/components/post-author/select.js.map +1 -1
- package/build/components/post-comments/index.js +11 -23
- package/build/components/post-comments/index.js.map +1 -1
- package/build/components/post-excerpt/check.js +6 -8
- package/build/components/post-excerpt/check.js.map +1 -1
- package/build/components/post-excerpt/index.js +10 -27
- package/build/components/post-excerpt/index.js.map +1 -1
- package/build/components/post-featured-image/check.js +6 -9
- package/build/components/post-featured-image/check.js.map +1 -1
- package/build/components/post-featured-image/index.js +13 -42
- package/build/components/post-featured-image/index.js.map +1 -1
- package/build/components/post-format/check.js +9 -18
- package/build/components/post-format/check.js.map +1 -1
- package/build/components/post-format/index.js +2 -20
- package/build/components/post-format/index.js.map +1 -1
- package/build/components/post-last-revision/check.js +15 -22
- package/build/components/post-last-revision/check.js.map +1 -1
- package/build/components/post-last-revision/index.js +17 -28
- package/build/components/post-last-revision/index.js.map +1 -1
- package/build/components/post-locked-modal/index.js +8 -28
- package/build/components/post-locked-modal/index.js.map +1 -1
- package/build/components/post-pending-status/check.js +16 -24
- package/build/components/post-pending-status/check.js.map +1 -1
- package/build/components/post-pending-status/index.js +10 -28
- package/build/components/post-pending-status/index.js.map +1 -1
- package/build/components/post-pingbacks/index.js +11 -23
- package/build/components/post-pingbacks/index.js.map +1 -1
- package/build/components/post-preview-button/index.js +11 -22
- package/build/components/post-preview-button/index.js.map +1 -1
- package/build/components/post-publish-button/index.js +6 -32
- package/build/components/post-publish-button/index.js.map +1 -1
- package/build/components/post-publish-button/label.js +1 -10
- package/build/components/post-publish-button/label.js.map +1 -1
- package/build/components/post-publish-panel/index.js +1 -22
- package/build/components/post-publish-panel/index.js.map +1 -1
- package/build/components/post-publish-panel/maybe-category-panel.js +4 -14
- package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-post-format-panel.js +2 -18
- package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-tags-panel.js +2 -17
- package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-upload-media.js +1 -18
- package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
- package/build/components/post-publish-panel/postpublish.js +3 -27
- package/build/components/post-publish-panel/postpublish.js.map +1 -1
- package/build/components/post-publish-panel/prepublish.js +1 -26
- package/build/components/post-publish-panel/prepublish.js.map +1 -1
- package/build/components/post-saved-state/index.js +12 -29
- package/build/components/post-saved-state/index.js.map +1 -1
- package/build/components/post-schedule/check.js +1 -8
- package/build/components/post-schedule/check.js.map +1 -1
- package/build/components/post-schedule/index.js +7 -13
- package/build/components/post-schedule/index.js.map +1 -1
- package/build/components/post-schedule/label.js +18 -29
- package/build/components/post-schedule/label.js.map +1 -1
- package/build/components/post-slug/check.js +1 -4
- package/build/components/post-slug/check.js.map +1 -1
- package/build/components/post-slug/index.js +1 -19
- package/build/components/post-slug/index.js.map +1 -1
- package/build/components/post-sticky/check.js +1 -8
- package/build/components/post-sticky/check.js.map +1 -1
- package/build/components/post-sticky/index.js +1 -12
- package/build/components/post-sticky/index.js.map +1 -1
- package/build/components/post-switch-to-draft-button/index.js +1 -14
- package/build/components/post-switch-to-draft-button/index.js.map +1 -1
- package/build/components/post-sync-status/index.js +5 -18
- package/build/components/post-sync-status/index.js.map +1 -1
- package/build/components/post-taxonomies/check.js +1 -9
- package/build/components/post-taxonomies/check.js.map +1 -1
- package/build/components/post-taxonomies/flat-term-selector.js +15 -50
- package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/hierarchical-term-selector.js +27 -79
- package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/index.js +3 -13
- package/build/components/post-taxonomies/index.js.map +1 -1
- package/build/components/post-taxonomies/most-used-terms.js +1 -9
- package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build/components/post-template/index.js +1 -11
- package/build/components/post-template/index.js.map +1 -1
- package/build/components/post-text-editor/index.js +3 -17
- package/build/components/post-text-editor/index.js.map +1 -1
- package/build/components/post-title/index.js +14 -46
- package/build/components/post-title/index.js.map +1 -1
- package/build/components/post-title/index.native.js +7 -44
- package/build/components/post-title/index.native.js.map +1 -1
- package/build/components/post-trash/check.js +1 -7
- package/build/components/post-trash/check.js.map +1 -1
- package/build/components/post-trash/index.js +1 -8
- package/build/components/post-trash/index.js.map +1 -1
- package/build/components/post-type-support-check/index.js +10 -23
- package/build/components/post-type-support-check/index.js.map +1 -1
- package/build/components/post-url/check.js +1 -12
- package/build/components/post-url/check.js.map +1 -1
- package/build/components/post-url/index.js +3 -15
- package/build/components/post-url/index.js.map +1 -1
- package/build/components/post-url/label.js +1 -5
- package/build/components/post-url/label.js.map +1 -1
- package/build/components/post-visibility/check.js +1 -7
- package/build/components/post-visibility/check.js.map +1 -1
- package/build/components/post-visibility/index.js +1 -17
- package/build/components/post-visibility/index.js.map +1 -1
- package/build/components/post-visibility/label.js +1 -5
- package/build/components/post-visibility/label.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/provider/index.js +13 -27
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/index.native.js +18 -70
- package/build/components/provider/index.native.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.js +9 -20
- package/build/components/provider/use-block-editor-settings.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.native.js +5 -11
- package/build/components/provider/use-block-editor-settings.native.js.map +1 -1
- package/build/components/provider/with-registry-provider.js +5 -12
- package/build/components/provider/with-registry-provider.js.map +1 -1
- package/build/components/table-of-contents/index.js +4 -14
- package/build/components/table-of-contents/index.js.map +1 -1
- package/build/components/table-of-contents/panel.js +1 -13
- package/build/components/table-of-contents/panel.js.map +1 -1
- package/build/components/template-validation-notice/index.js +3 -12
- package/build/components/template-validation-notice/index.js.map +1 -1
- package/build/components/theme-support-check/index.js +3 -12
- package/build/components/theme-support-check/index.js.map +1 -1
- package/build/components/time-to-read/index.js +2 -10
- package/build/components/time-to-read/index.js.map +1 -1
- package/build/components/unsaved-changes-warning/index.js +21 -35
- package/build/components/unsaved-changes-warning/index.js.map +1 -1
- package/build/components/word-count/index.js +2 -7
- package/build/components/word-count/index.js.map +1 -1
- package/build/hooks/custom-sources-backwards-compatibility.js +8 -42
- package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
- package/build/hooks/default-autocompleters.js +3 -4
- package/build/hooks/default-autocompleters.js.map +1 -1
- package/build/hooks/index.js +0 -1
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/index.native.js.map +1 -1
- package/build/index.js +0 -9
- package/build/index.js.map +1 -1
- package/build/index.native.js +0 -11
- package/build/index.native.js.map +1 -1
- package/build/lock-unlock.js +1 -2
- package/build/lock-unlock.js.map +1 -1
- package/build/private-apis.js +1 -4
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +61 -130
- package/build/store/actions.js.map +1 -1
- package/build/store/actions.native.js +1 -8
- package/build/store/actions.native.js.map +1 -1
- package/build/store/constants.js +1 -2
- package/build/store/constants.js.map +1 -1
- package/build/store/defaults.js +2 -3
- package/build/store/defaults.js.map +1 -1
- package/build/store/index.js +3 -11
- package/build/store/index.js.map +1 -1
- package/build/store/local-autosave.js +0 -4
- package/build/store/local-autosave.js.map +1 -1
- package/build/store/reducer.js +19 -49
- package/build/store/reducer.js.map +1 -1
- package/build/store/reducer.native.js +3 -17
- package/build/store/reducer.native.js.map +1 -1
- package/build/store/selectors.js +170 -296
- package/build/store/selectors.js.map +1 -1
- package/build/store/selectors.native.js +4 -11
- package/build/store/selectors.native.js.map +1 -1
- package/build/store/utils/notice-builder.js +13 -24
- package/build/store/utils/notice-builder.js.map +1 -1
- package/build/utils/get-template-part-icon.js +0 -3
- package/build/utils/get-template-part-icon.js.map +1 -1
- package/build/utils/index.js +0 -4
- package/build/utils/index.js.map +1 -1
- package/build/utils/index.native.js +0 -2
- package/build/utils/index.native.js.map +1 -1
- package/build/utils/media-upload/index.js +2 -6
- package/build/utils/media-upload/index.js.map +1 -1
- package/build/utils/media-upload/index.native.js +0 -1
- package/build/utils/media-upload/index.native.js.map +1 -1
- package/build/utils/terms.js +8 -18
- package/build/utils/terms.js.map +1 -1
- package/build/utils/url.js +0 -4
- package/build/utils/url.js.map +1 -1
- package/build-module/components/autocompleters/index.js.map +1 -1
- package/build-module/components/autocompleters/user.js +2 -5
- package/build-module/components/autocompleters/user.js.map +1 -1
- package/build-module/components/autosave-monitor/index.js +2 -17
- package/build-module/components/autosave-monitor/index.js.map +1 -1
- package/build-module/components/character-count/index.js +1 -1
- package/build-module/components/character-count/index.js.map +1 -1
- package/build-module/components/deprecated.js +0 -4
- package/build-module/components/deprecated.js.map +1 -1
- package/build-module/components/deprecated.native.js +0 -1
- package/build-module/components/deprecated.native.js.map +1 -1
- package/build-module/components/document-outline/check.js +0 -4
- package/build-module/components/document-outline/check.js.map +1 -1
- package/build-module/components/document-outline/index.js +9 -13
- package/build-module/components/document-outline/index.js.map +1 -1
- package/build-module/components/document-outline/item.js +0 -3
- package/build-module/components/document-outline/item.js.map +1 -1
- package/build-module/components/editor-help/add-blocks.native.js +2 -5
- package/build-module/components/editor-help/add-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/customize-blocks.native.js +2 -5
- package/build-module/components/editor-help/customize-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/help-detail-navigation-screen.native.js +6 -8
- package/build-module/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
- package/build-module/components/editor-help/help-get-support-button.native.js +2 -5
- package/build-module/components/editor-help/help-get-support-button.native.js.map +1 -1
- package/build-module/components/editor-help/help-section-title.native.js +2 -5
- package/build-module/components/editor-help/help-section-title.native.js.map +1 -1
- package/build-module/components/editor-help/help-topic-row.native.js +1 -6
- package/build-module/components/editor-help/help-topic-row.native.js.map +1 -1
- package/build-module/components/editor-help/icon-move-blocks.native.js +0 -1
- package/build-module/components/editor-help/icon-move-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/index.native.js +9 -9
- package/build-module/components/editor-help/index.native.js.map +1 -1
- package/build-module/components/editor-help/intro-to-blocks.native.js +2 -5
- package/build-module/components/editor-help/intro-to-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/move-blocks.native.js +2 -5
- package/build-module/components/editor-help/move-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/remove-blocks.native.js +2 -5
- package/build-module/components/editor-help/remove-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/view-sections.native.js +2 -4
- package/build-module/components/editor-help/view-sections.native.js.map +1 -1
- package/build-module/components/editor-history/redo.js +6 -8
- package/build-module/components/editor-history/redo.js.map +1 -1
- package/build-module/components/editor-history/undo.js +6 -8
- package/build-module/components/editor-history/undo.js.map +1 -1
- package/build-module/components/editor-notices/index.js +1 -2
- package/build-module/components/editor-notices/index.js.map +1 -1
- package/build-module/components/editor-snackbars/index.js +0 -1
- package/build-module/components/editor-snackbars/index.js.map +1 -1
- package/build-module/components/entities-saved-states/entity-record-item.js +3 -4
- 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 +3 -10
- package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build-module/components/entities-saved-states/hooks/use-is-dirty.js +4 -7
- package/build-module/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
- package/build-module/components/entities-saved-states/index.js +8 -16
- package/build-module/components/entities-saved-states/index.js.map +1 -1
- package/build-module/components/error-boundary/index.js +1 -12
- package/build-module/components/error-boundary/index.js.map +1 -1
- package/build-module/components/global-keyboard-shortcuts/index.js +5 -6
- package/build-module/components/global-keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +0 -3
- package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
- package/build-module/components/index.js +6 -3
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/index.native.js +4 -2
- package/build-module/components/index.native.js.map +1 -1
- package/build-module/components/local-autosave-monitor/index.js +6 -21
- package/build-module/components/local-autosave-monitor/index.js.map +1 -1
- package/build-module/components/media-categories/index.js +31 -41
- package/build-module/components/media-categories/index.js.map +1 -1
- package/build-module/components/page-attributes/check.js +3 -3
- package/build-module/components/page-attributes/check.js.map +1 -1
- package/build-module/components/page-attributes/order.js +17 -31
- package/build-module/components/page-attributes/order.js.map +1 -1
- package/build-module/components/page-attributes/parent.js +9 -23
- package/build-module/components/page-attributes/parent.js.map +1 -1
- package/build-module/components/post-author/check.js +1 -5
- package/build-module/components/post-author/check.js.map +1 -1
- package/build-module/components/post-author/combobox.js +7 -16
- package/build-module/components/post-author/combobox.js.map +1 -1
- package/build-module/components/post-author/constants.js +0 -1
- package/build-module/components/post-author/constants.js.map +1 -1
- package/build-module/components/post-author/index.js +1 -6
- package/build-module/components/post-author/index.js.map +1 -1
- package/build-module/components/post-author/select.js +1 -6
- package/build-module/components/post-author/select.js.map +1 -1
- package/build-module/components/post-comments/index.js +12 -19
- package/build-module/components/post-comments/index.js.map +1 -1
- package/build-module/components/post-excerpt/check.js +5 -6
- package/build-module/components/post-excerpt/check.js.map +1 -1
- package/build-module/components/post-excerpt/index.js +11 -23
- package/build-module/components/post-excerpt/index.js.map +1 -1
- package/build-module/components/post-featured-image/check.js +5 -6
- package/build-module/components/post-featured-image/check.js.map +1 -1
- package/build-module/components/post-featured-image/index.js +13 -31
- package/build-module/components/post-featured-image/index.js.map +1 -1
- package/build-module/components/post-format/check.js +10 -15
- package/build-module/components/post-format/check.js.map +1 -1
- package/build-module/components/post-format/index.js +4 -12
- package/build-module/components/post-format/index.js.map +1 -1
- package/build-module/components/post-last-revision/check.js +17 -17
- package/build-module/components/post-last-revision/check.js.map +1 -1
- package/build-module/components/post-last-revision/index.js +18 -21
- package/build-module/components/post-last-revision/index.js.map +1 -1
- package/build-module/components/post-locked-modal/index.js +8 -22
- package/build-module/components/post-locked-modal/index.js.map +1 -1
- package/build-module/components/post-pending-status/check.js +17 -20
- package/build-module/components/post-pending-status/check.js.map +1 -1
- package/build-module/components/post-pending-status/index.js +11 -20
- package/build-module/components/post-pending-status/index.js.map +1 -1
- package/build-module/components/post-pingbacks/index.js +12 -19
- package/build-module/components/post-pingbacks/index.js.map +1 -1
- package/build-module/components/post-preview-button/index.js +11 -17
- package/build-module/components/post-preview-button/index.js.map +1 -1
- package/build-module/components/post-publish-button/index.js +7 -23
- package/build-module/components/post-publish-button/index.js.map +1 -1
- package/build-module/components/post-publish-button/label.js +1 -4
- package/build-module/components/post-publish-button/label.js.map +1 -1
- package/build-module/components/post-publish-panel/index.js +1 -8
- package/build-module/components/post-publish-panel/index.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-category-panel.js +4 -8
- package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-post-format-panel.js +2 -12
- package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-tags-panel.js +2 -9
- package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-upload-media.js +1 -12
- package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
- package/build-module/components/post-publish-panel/postpublish.js +3 -16
- package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
- package/build-module/components/post-publish-panel/prepublish.js +1 -10
- package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
- package/build-module/components/post-saved-state/index.js +15 -23
- package/build-module/components/post-saved-state/index.js.map +1 -1
- package/build-module/components/post-schedule/check.js +1 -3
- package/build-module/components/post-schedule/check.js.map +1 -1
- package/build-module/components/post-schedule/index.js +8 -8
- package/build-module/components/post-schedule/index.js.map +1 -1
- package/build-module/components/post-schedule/label.js +18 -22
- package/build-module/components/post-schedule/label.js.map +1 -1
- package/build-module/components/post-slug/check.js +0 -1
- package/build-module/components/post-slug/check.js.map +1 -1
- package/build-module/components/post-slug/index.js +1 -8
- package/build-module/components/post-slug/index.js.map +1 -1
- package/build-module/components/post-sticky/check.js +1 -3
- package/build-module/components/post-sticky/check.js.map +1 -1
- package/build-module/components/post-sticky/index.js +1 -3
- package/build-module/components/post-sticky/index.js.map +1 -1
- package/build-module/components/post-switch-to-draft-button/index.js +1 -9
- package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
- package/build-module/components/post-sync-status/index.js +5 -11
- package/build-module/components/post-sync-status/index.js.map +1 -1
- package/build-module/components/post-taxonomies/check.js +1 -3
- package/build-module/components/post-taxonomies/check.js.map +1 -1
- package/build-module/components/post-taxonomies/flat-term-selector.js +17 -39
- package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js +29 -66
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/index.js +3 -5
- package/build-module/components/post-taxonomies/index.js.map +1 -1
- package/build-module/components/post-taxonomies/most-used-terms.js +1 -4
- package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build-module/components/post-template/index.js +1 -5
- package/build-module/components/post-template/index.js.map +1 -1
- package/build-module/components/post-text-editor/index.js +4 -9
- package/build-module/components/post-text-editor/index.js.map +1 -1
- package/build-module/components/post-title/index.js +17 -35
- package/build-module/components/post-title/index.js.map +1 -1
- package/build-module/components/post-title/index.native.js +8 -33
- package/build-module/components/post-title/index.native.js.map +1 -1
- package/build-module/components/post-trash/check.js +1 -4
- package/build-module/components/post-trash/check.js.map +1 -1
- package/build-module/components/post-trash/index.js +1 -4
- package/build-module/components/post-trash/index.js.map +1 -1
- package/build-module/components/post-type-support-check/index.js +14 -20
- package/build-module/components/post-type-support-check/index.js.map +1 -1
- package/build-module/components/post-url/check.js +1 -9
- package/build-module/components/post-url/check.js.map +1 -1
- package/build-module/components/post-url/index.js +3 -8
- package/build-module/components/post-url/index.js.map +1 -1
- package/build-module/components/post-url/label.js +1 -1
- package/build-module/components/post-url/label.js.map +1 -1
- package/build-module/components/post-visibility/check.js +1 -2
- package/build-module/components/post-visibility/check.js.map +1 -1
- package/build-module/components/post-visibility/index.js +1 -10
- package/build-module/components/post-visibility/index.js.map +1 -1
- package/build-module/components/post-visibility/label.js +1 -1
- package/build-module/components/post-visibility/label.js.map +1 -1
- package/build-module/components/post-visibility/utils.js.map +1 -1
- package/build-module/components/provider/index.js +13 -14
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/index.native.js +21 -52
- package/build-module/components/provider/index.native.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.js +9 -12
- package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.native.js +5 -5
- package/build-module/components/provider/use-block-editor-settings.native.js.map +1 -1
- package/build-module/components/provider/with-registry-provider.js +5 -8
- package/build-module/components/provider/with-registry-provider.js.map +1 -1
- package/build-module/components/table-of-contents/index.js +4 -7
- package/build-module/components/table-of-contents/index.js.map +1 -1
- package/build-module/components/table-of-contents/panel.js +1 -5
- package/build-module/components/table-of-contents/panel.js.map +1 -1
- package/build-module/components/template-validation-notice/index.js +2 -6
- package/build-module/components/template-validation-notice/index.js.map +1 -1
- package/build-module/components/theme-support-check/index.js +3 -7
- package/build-module/components/theme-support-check/index.js.map +1 -1
- package/build-module/components/time-to-read/index.js +4 -7
- package/build-module/components/time-to-read/index.js.map +1 -1
- package/build-module/components/unsaved-changes-warning/index.js +22 -31
- package/build-module/components/unsaved-changes-warning/index.js.map +1 -1
- package/build-module/components/word-count/index.js +2 -4
- package/build-module/components/word-count/index.js.map +1 -1
- package/build-module/hooks/custom-sources-backwards-compatibility.js +11 -39
- package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
- package/build-module/hooks/default-autocompleters.js +3 -4
- package/build-module/hooks/default-autocompleters.js.map +1 -1
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/index.native.js.map +1 -1
- package/build-module/index.js +1 -1
- package/build-module/index.js.map +1 -1
- package/build-module/index.native.js +1 -1
- package/build-module/index.native.js.map +1 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +63 -85
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/actions.native.js +2 -2
- package/build-module/store/actions.native.js.map +1 -1
- package/build-module/store/constants.js +1 -1
- package/build-module/store/constants.js.map +1 -1
- package/build-module/store/defaults.js +3 -2
- package/build-module/store/defaults.js.map +1 -1
- package/build-module/store/index.js +5 -4
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/local-autosave.js +0 -1
- package/build-module/store/local-autosave.js.map +1 -1
- package/build-module/store/reducer.js +21 -33
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/reducer.native.js +4 -10
- package/build-module/store/reducer.native.js.map +1 -1
- package/build-module/store/selectors.js +173 -223
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/selectors.native.js +6 -8
- package/build-module/store/selectors.native.js.map +1 -1
- package/build-module/store/utils/notice-builder.js +15 -21
- package/build-module/store/utils/notice-builder.js.map +1 -1
- package/build-module/utils/get-template-part-icon.js +0 -2
- package/build-module/utils/get-template-part-icon.js.map +1 -1
- package/build-module/utils/index.js.map +1 -1
- package/build-module/utils/index.native.js.map +1 -1
- package/build-module/utils/media-upload/index.js +2 -4
- package/build-module/utils/media-upload/index.js.map +1 -1
- package/build-module/utils/media-upload/index.native.js.map +1 -1
- package/build-module/utils/terms.js +9 -11
- package/build-module/utils/terms.js.map +1 -1
- package/build-module/utils/url.js +1 -1
- package/build-module/utils/url.js.map +1 -1
- package/build-style/style-rtl.css +10 -17
- package/build-style/style.css +10 -17
- package/package.json +32 -31
- package/src/components/editor-help/index.native.js +1 -1
- package/src/components/editor-help/style.scss +5 -0
- package/src/components/page-attributes/order.js +15 -23
- package/src/components/page-attributes/test/order.js +46 -15
- package/src/components/post-author/test/check.js +18 -12
- package/src/components/post-comments/index.js +11 -17
- package/src/components/post-excerpt/check.js +6 -2
- package/src/components/post-excerpt/index.js +10 -16
- package/src/components/post-featured-image/check.js +4 -2
- package/src/components/post-format/check.js +16 -11
- package/src/components/post-last-revision/check.js +12 -14
- package/src/components/post-last-revision/index.js +12 -10
- package/src/components/post-last-revision/test/check.js +28 -16
- package/src/components/post-pending-status/check.js +13 -19
- package/src/components/post-pending-status/index.js +9 -14
- package/src/components/post-pending-status/test/check.js +32 -10
- package/src/components/post-pingbacks/index.js +11 -15
- package/src/components/post-publish-panel/style.scss +12 -25
- package/src/components/post-sync-status/style.scss +4 -1
- package/src/components/post-type-support-check/index.js +8 -10
- package/src/components/post-type-support-check/test/index.js +36 -20
- package/src/components/provider/index.js +3 -2
- package/src/components/unsaved-changes-warning/index.js +22 -27
- package/src/hooks/custom-sources-backwards-compatibility.js +1 -25
- package/src/store/actions.js +1 -1
- package/src/store/selectors.js +2 -2
- package/src/store/test/selectors.js +13 -13
|
@@ -4,25 +4,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = PostLockedModal;
|
|
7
|
-
|
|
8
7
|
var _element = require("@wordpress/element");
|
|
9
|
-
|
|
10
8
|
var _i18n = require("@wordpress/i18n");
|
|
11
|
-
|
|
12
9
|
var _components = require("@wordpress/components");
|
|
13
|
-
|
|
14
10
|
var _data = require("@wordpress/data");
|
|
15
|
-
|
|
16
11
|
var _url = require("@wordpress/url");
|
|
17
|
-
|
|
18
12
|
var _hooks = require("@wordpress/hooks");
|
|
19
|
-
|
|
20
13
|
var _compose = require("@wordpress/compose");
|
|
21
|
-
|
|
22
14
|
var _coreData = require("@wordpress/core-data");
|
|
23
|
-
|
|
24
15
|
var _store = require("../../store");
|
|
25
|
-
|
|
26
16
|
/**
|
|
27
17
|
* WordPress dependencies
|
|
28
18
|
*/
|
|
@@ -30,6 +20,7 @@ var _store = require("../../store");
|
|
|
30
20
|
/**
|
|
31
21
|
* Internal dependencies
|
|
32
22
|
*/
|
|
23
|
+
|
|
33
24
|
function PostLockedModal() {
|
|
34
25
|
const instanceId = (0, _compose.useInstanceId)(PostLockedModal);
|
|
35
26
|
const hookName = 'core/editor/post-locked-modal-' + instanceId;
|
|
@@ -84,26 +75,22 @@ function PostLockedModal() {
|
|
|
84
75
|
if (isLocked) {
|
|
85
76
|
return;
|
|
86
77
|
}
|
|
87
|
-
|
|
88
78
|
data['wp-refresh-post-lock'] = {
|
|
89
79
|
lock: activePostLock,
|
|
90
80
|
post_id: postId
|
|
91
81
|
};
|
|
92
82
|
}
|
|
83
|
+
|
|
93
84
|
/**
|
|
94
85
|
* Refresh post locks: update the lock string or show the dialog if somebody has taken over editing.
|
|
95
86
|
*
|
|
96
87
|
* @param {Object} data Data received in the heartbeat request
|
|
97
88
|
*/
|
|
98
|
-
|
|
99
|
-
|
|
100
89
|
function receivePostLock(data) {
|
|
101
90
|
if (!data['wp-refresh-post-lock']) {
|
|
102
91
|
return;
|
|
103
92
|
}
|
|
104
|
-
|
|
105
93
|
const received = data['wp-refresh-post-lock'];
|
|
106
|
-
|
|
107
94
|
if (received.lock_error) {
|
|
108
95
|
// Auto save and display the takeover modal.
|
|
109
96
|
autosave();
|
|
@@ -122,22 +109,19 @@ function PostLockedModal() {
|
|
|
122
109
|
});
|
|
123
110
|
}
|
|
124
111
|
}
|
|
112
|
+
|
|
125
113
|
/**
|
|
126
114
|
* Unlock the post before the window is exited.
|
|
127
115
|
*/
|
|
128
|
-
|
|
129
|
-
|
|
130
116
|
function releasePostLock() {
|
|
131
117
|
if (isLocked || !activePostLock) {
|
|
132
118
|
return;
|
|
133
119
|
}
|
|
134
|
-
|
|
135
120
|
const data = new window.FormData();
|
|
136
121
|
data.append('action', 'wp-remove-post-lock');
|
|
137
122
|
data.append('_wpnonce', postLockUtils.unlockNonce);
|
|
138
123
|
data.append('post_ID', postId);
|
|
139
124
|
data.append('active_post_lock', activePostLock);
|
|
140
|
-
|
|
141
125
|
if (window.navigator.sendBeacon) {
|
|
142
126
|
window.navigator.sendBeacon(postLockUtils.ajaxUrl, data);
|
|
143
127
|
} else {
|
|
@@ -145,10 +129,10 @@ function PostLockedModal() {
|
|
|
145
129
|
xhr.open('POST', postLockUtils.ajaxUrl, false);
|
|
146
130
|
xhr.send(data);
|
|
147
131
|
}
|
|
148
|
-
}
|
|
149
|
-
// https://developer.wordpress.org/plugins/javascript/heartbeat-api/
|
|
150
|
-
|
|
132
|
+
}
|
|
151
133
|
|
|
134
|
+
// Details on these events on the Heartbeat API docs
|
|
135
|
+
// https://developer.wordpress.org/plugins/javascript/heartbeat-api/
|
|
152
136
|
(0, _hooks.addAction)('heartbeat.send', hookName, sendPostLock);
|
|
153
137
|
(0, _hooks.addAction)('heartbeat.tick', hookName, receivePostLock);
|
|
154
138
|
window.addEventListener('beforeunload', releasePostLock);
|
|
@@ -158,11 +142,9 @@ function PostLockedModal() {
|
|
|
158
142
|
window.removeEventListener('beforeunload', releasePostLock);
|
|
159
143
|
};
|
|
160
144
|
}, []);
|
|
161
|
-
|
|
162
145
|
if (!isLocked) {
|
|
163
146
|
return null;
|
|
164
147
|
}
|
|
165
|
-
|
|
166
148
|
const userDisplayName = user.name;
|
|
167
149
|
const userAvatar = user.avatar;
|
|
168
150
|
const unlockUrl = (0, _url.addQueryArgs)('post.php', {
|
|
@@ -192,15 +174,13 @@ function PostLockedModal() {
|
|
|
192
174
|
className: "editor-post-locked-modal__avatar",
|
|
193
175
|
width: 64,
|
|
194
176
|
height: 64
|
|
195
|
-
}), (0, _element.createElement)("div", null, !!isTakeover && (0, _element.createElement)("p", null, (0, _element.createInterpolateElement)(userDisplayName ? (0, _i18n.sprintf)(
|
|
196
|
-
/* translators: %s: user's display name */
|
|
177
|
+
}), (0, _element.createElement)("div", null, !!isTakeover && (0, _element.createElement)("p", null, (0, _element.createInterpolateElement)(userDisplayName ? (0, _i18n.sprintf)( /* translators: %s: user's display name */
|
|
197
178
|
(0, _i18n.__)('<strong>%s</strong> now has editing control of this post (<PreviewLink />). Don’t worry, your changes up to this moment have been saved.'), userDisplayName) : (0, _i18n.__)('Another user now has editing control of this post (<PreviewLink />). Don’t worry, your changes up to this moment have been saved.'), {
|
|
198
179
|
strong: (0, _element.createElement)("strong", null),
|
|
199
180
|
PreviewLink: (0, _element.createElement)(_components.ExternalLink, {
|
|
200
181
|
href: previewLink
|
|
201
182
|
}, (0, _i18n.__)('preview'))
|
|
202
|
-
})), !isTakeover && (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)("p", null, (0, _element.createInterpolateElement)(userDisplayName ? (0, _i18n.sprintf)(
|
|
203
|
-
/* translators: %s: user's display name */
|
|
183
|
+
})), !isTakeover && (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)("p", null, (0, _element.createInterpolateElement)(userDisplayName ? (0, _i18n.sprintf)( /* translators: %s: user's display name */
|
|
204
184
|
(0, _i18n.__)('<strong>%s</strong> is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over.'), userDisplayName) : (0, _i18n.__)('Another user is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over.'), {
|
|
205
185
|
strong: (0, _element.createElement)("strong", null),
|
|
206
186
|
PreviewLink: (0, _element.createElement)(_components.ExternalLink, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/post-locked-modal/index.js"],"names":["PostLockedModal","instanceId","hookName","autosave","updatePostLock","editorStore","isLocked","isTakeover","user","postId","postLockUtils","activePostLock","postType","previewLink","select","isPostLocked","isPostLockTakeover","getPostLockUser","getCurrentPostId","getActivePostLock","getEditedPostAttribute","getEditedPostPreviewLink","getEditorSettings","getPostType","coreStore","sendPostLock","data","lock","post_id","receivePostLock","received","lock_error","name","avatar","avatar_src_2x","new_lock","releasePostLock","window","FormData","append","unlockNonce","navigator","sendBeacon","ajaxUrl","xhr","XMLHttpRequest","open","send","addEventListener","removeEventListener","userDisplayName","userAvatar","unlockUrl","lockKey","post","action","_wpnonce","nonce","allPostsUrl","post_type","slug","allPostsLabel","strong","PreviewLink"],"mappings":";;;;;;;AAYA;;AATA;;AACA;;AAMA;;AACA;;AAEA;;AACA;;AACA;;AAKA;;AApBA;AACA;AACA;;AAeA;AACA;AACA;AAGe,SAASA,eAAT,GAA2B;AACzC,QAAMC,UAAU,GAAG,4BAAeD,eAAf,CAAnB;AACA,QAAME,QAAQ,GAAG,mCAAmCD,UAApD;AACA,QAAM;AAAEE,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,MAA+B,uBAAaC,YAAb,CAArC;AACA,QAAM;AACLC,IAAAA,QADK;AAELC,IAAAA,UAFK;AAGLC,IAAAA,IAHK;AAILC,IAAAA,MAJK;AAKLC,IAAAA,aALK;AAMLC,IAAAA,cANK;AAOLC,IAAAA,QAPK;AAQLC,IAAAA;AARK,MASF,qBAAaC,MAAF,IAAc;AAC5B,UAAM;AACLC,MAAAA,YADK;AAELC,MAAAA,kBAFK;AAGLC,MAAAA,eAHK;AAILC,MAAAA,gBAJK;AAKLC,MAAAA,iBALK;AAMLC,MAAAA,sBANK;AAOLC,MAAAA,wBAPK;AAQLC,MAAAA;AARK,QASFR,MAAM,CAAET,YAAF,CATV;AAUA,UAAM;AAAEkB,MAAAA;AAAF,QAAkBT,MAAM,CAAEU,eAAF,CAA9B;AACA,WAAO;AACNlB,MAAAA,QAAQ,EAAES,YAAY,EADhB;AAENR,MAAAA,UAAU,EAAES,kBAAkB,EAFxB;AAGNR,MAAAA,IAAI,EAAES,eAAe,EAHf;AAINR,MAAAA,MAAM,EAAES,gBAAgB,EAJlB;AAKNR,MAAAA,aA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AA,IAAI,EAAGlD;AAArB,OACG,cAAI,SAAJ,CADH;AAHF,GAZC,CADH,CAFF,EA0BG,CAAEN,UAAF,IACD,qDACC,uCACG,uCACD2C,eAAe,GACZ;AACA;AACA,gBACC,qIADD,CAFA,EAKAA,eALA,CADY,GAQZ,cACA,8HADA,CATF,EAYD;AACCY,IAAAA,MAAM,EAAE,2CADT;AAECC,IAAAA,WAAW,EACV,4BAAC,wBAAD;AAAc,MAAA,IAAI,EAAGlD;AAArB,OACG,cAAI,SAAJ,CADH;AAHF,GAZC,CADH,CADD,EAwBC,uCACG,cACD,0GADC,CADH,CAxBD,CA3BF,EA2DC,4BAAC,gCAAD;AACC,IAAA,SAAS,EAAC,mCADX;AAEC,IAAA,OAAO,EAAC;AAFT,KAIG,CAAEN,UAAF,IACD,4BAAC,kBAAD;AAAQ,IAAA,OAAO,EAAC,UAAhB;AAA2B,IAAA,IAAI,EAAG6C;AAAlC,KACG,cAAI,WAAJ,CADH,CALF,EASC,4BAAC,kBAAD;AAAQ,IAAA,OAAO,EAAC,SAAhB;AAA0B,IAAA,IAAI,EAAGM;AAAjC,KACGG,aADH,CATD,CA3DD,CAVD,CAZD,CADD;AAmGA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tModal,\n\tButton,\n\tExternalLink,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { addQueryArgs } from '@wordpress/url';\nimport { useEffect, createInterpolateElement } from '@wordpress/element';\nimport { addAction, removeAction } from '@wordpress/hooks';\nimport { useInstanceId } from '@wordpress/compose';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport default function PostLockedModal() {\n\tconst instanceId = useInstanceId( PostLockedModal );\n\tconst hookName = 'core/editor/post-locked-modal-' + instanceId;\n\tconst { autosave, updatePostLock } = useDispatch( editorStore );\n\tconst {\n\t\tisLocked,\n\t\tisTakeover,\n\t\tuser,\n\t\tpostId,\n\t\tpostLockUtils,\n\t\tactivePostLock,\n\t\tpostType,\n\t\tpreviewLink,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tisPostLocked,\n\t\t\tisPostLockTakeover,\n\t\t\tgetPostLockUser,\n\t\t\tgetCurrentPostId,\n\t\t\tgetActivePostLock,\n\t\t\tgetEditedPostAttribute,\n\t\t\tgetEditedPostPreviewLink,\n\t\t\tgetEditorSettings,\n\t\t} = select( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\t\treturn {\n\t\t\tisLocked: isPostLocked(),\n\t\t\tisTakeover: isPostLockTakeover(),\n\t\t\tuser: getPostLockUser(),\n\t\t\tpostId: getCurrentPostId(),\n\t\t\tpostLockUtils: getEditorSettings().postLockUtils,\n\t\t\tactivePostLock: getActivePostLock(),\n\t\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\t\tpreviewLink: getEditedPostPreviewLink(),\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\t/**\n\t\t * Keep the lock refreshed.\n\t\t *\n\t\t * When the user does not send a heartbeat in a heartbeat-tick\n\t\t * the user is no longer editing and another user can start editing.\n\t\t *\n\t\t * @param {Object} data Data to send in the heartbeat request.\n\t\t */\n\t\tfunction sendPostLock( data ) {\n\t\t\tif ( isLocked ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdata[ 'wp-refresh-post-lock' ] = {\n\t\t\t\tlock: activePostLock,\n\t\t\t\tpost_id: postId,\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Refresh post locks: update the lock string or show the dialog if somebody has taken over editing.\n\t\t *\n\t\t * @param {Object} data Data received in the heartbeat request\n\t\t */\n\t\tfunction receivePostLock( data ) {\n\t\t\tif ( ! data[ 'wp-refresh-post-lock' ] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst received = data[ 'wp-refresh-post-lock' ];\n\t\t\tif ( received.lock_error ) {\n\t\t\t\t// Auto save and display the takeover modal.\n\t\t\t\tautosave();\n\t\t\t\tupdatePostLock( {\n\t\t\t\t\tisLocked: true,\n\t\t\t\t\tisTakeover: true,\n\t\t\t\t\tuser: {\n\t\t\t\t\t\tname: received.lock_error.name,\n\t\t\t\t\t\tavatar: received.lock_error.avatar_src_2x,\n\t\t\t\t\t},\n\t\t\t\t} );\n\t\t\t} else if ( received.new_lock ) {\n\t\t\t\tupdatePostLock( {\n\t\t\t\t\tisLocked: false,\n\t\t\t\t\tactivePostLock: received.new_lock,\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Unlock the post before the window is exited.\n\t\t */\n\t\tfunction releasePostLock() {\n\t\t\tif ( isLocked || ! activePostLock ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst data = new window.FormData();\n\t\t\tdata.append( 'action', 'wp-remove-post-lock' );\n\t\t\tdata.append( '_wpnonce', postLockUtils.unlockNonce );\n\t\t\tdata.append( 'post_ID', postId );\n\t\t\tdata.append( 'active_post_lock', activePostLock );\n\n\t\t\tif ( window.navigator.sendBeacon ) {\n\t\t\t\twindow.navigator.sendBeacon( postLockUtils.ajaxUrl, data );\n\t\t\t} else {\n\t\t\t\tconst xhr = new window.XMLHttpRequest();\n\t\t\t\txhr.open( 'POST', postLockUtils.ajaxUrl, false );\n\t\t\t\txhr.send( data );\n\t\t\t}\n\t\t}\n\n\t\t// Details on these events on the Heartbeat API docs\n\t\t// https://developer.wordpress.org/plugins/javascript/heartbeat-api/\n\t\taddAction( 'heartbeat.send', hookName, sendPostLock );\n\t\taddAction( 'heartbeat.tick', hookName, receivePostLock );\n\t\twindow.addEventListener( 'beforeunload', releasePostLock );\n\n\t\treturn () => {\n\t\t\tremoveAction( 'heartbeat.send', hookName );\n\t\t\tremoveAction( 'heartbeat.tick', hookName );\n\t\t\twindow.removeEventListener( 'beforeunload', releasePostLock );\n\t\t};\n\t}, [] );\n\n\tif ( ! isLocked ) {\n\t\treturn null;\n\t}\n\n\tconst userDisplayName = user.name;\n\tconst userAvatar = user.avatar;\n\n\tconst unlockUrl = addQueryArgs( 'post.php', {\n\t\t'get-post-lock': '1',\n\t\tlockKey: true,\n\t\tpost: postId,\n\t\taction: 'edit',\n\t\t_wpnonce: postLockUtils.nonce,\n\t} );\n\tconst allPostsUrl = addQueryArgs( 'edit.php', {\n\t\tpost_type: postType?.slug,\n\t} );\n\tconst allPostsLabel = __( 'Exit editor' );\n\treturn (\n\t\t<Modal\n\t\t\ttitle={\n\t\t\t\tisTakeover\n\t\t\t\t\t? __( 'Someone else has taken over this post' )\n\t\t\t\t\t: __( 'This post is already being edited' )\n\t\t\t}\n\t\t\tfocusOnMount={ true }\n\t\t\tshouldCloseOnClickOutside={ false }\n\t\t\tshouldCloseOnEsc={ false }\n\t\t\tisDismissible={ false }\n\t\t\tclassName=\"editor-post-locked-modal\"\n\t\t>\n\t\t\t<HStack alignment=\"top\" spacing={ 6 }>\n\t\t\t\t{ !! userAvatar && (\n\t\t\t\t\t<img\n\t\t\t\t\t\tsrc={ userAvatar }\n\t\t\t\t\t\talt={ __( 'Avatar' ) }\n\t\t\t\t\t\tclassName=\"editor-post-locked-modal__avatar\"\n\t\t\t\t\t\twidth={ 64 }\n\t\t\t\t\t\theight={ 64 }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<div>\n\t\t\t\t\t{ !! isTakeover && (\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\tuserDisplayName\n\t\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: user's display name */\n\t\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t\t'<strong>%s</strong> now has editing control of this post (<PreviewLink />). Don’t worry, your changes up to this moment have been saved.'\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\tuserDisplayName\n\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t\t\t\t'Another user now has editing control of this post (<PreviewLink />). Don’t worry, your changes up to this moment have been saved.'\n\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tstrong: <strong />,\n\t\t\t\t\t\t\t\t\tPreviewLink: (\n\t\t\t\t\t\t\t\t\t\t<ExternalLink href={ previewLink }>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'preview' ) }\n\t\t\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! isTakeover && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\tuserDisplayName\n\t\t\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: user's display name */\n\t\t\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'<strong>%s</strong> is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over.'\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\tuserDisplayName\n\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Another user is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over.'\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tstrong: <strong />,\n\t\t\t\t\t\t\t\t\t\tPreviewLink: (\n\t\t\t\t\t\t\t\t\t\t\t<ExternalLink href={ previewLink }>\n\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'preview' ) }\n\t\t\t\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'If you take over, the other user will lose editing control to the post, but their changes will be saved.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\n\t\t\t\t\t<HStack\n\t\t\t\t\t\tclassName=\"editor-post-locked-modal__buttons\"\n\t\t\t\t\t\tjustify=\"flex-end\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ! isTakeover && (\n\t\t\t\t\t\t\t<Button variant=\"tertiary\" href={ unlockUrl }>\n\t\t\t\t\t\t\t\t{ __( 'Take over' ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<Button variant=\"primary\" href={ allPostsUrl }>\n\t\t\t\t\t\t\t{ allPostsLabel }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</HStack>\n\t\t\t\t</div>\n\t\t\t</HStack>\n\t\t</Modal>\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"names":["_element","require","_i18n","_components","_data","_url","_hooks","_compose","_coreData","_store","PostLockedModal","instanceId","useInstanceId","hookName","autosave","updatePostLock","useDispatch","editorStore","isLocked","isTakeover","user","postId","postLockUtils","activePostLock","postType","previewLink","useSelect","select","isPostLocked","isPostLockTakeover","getPostLockUser","getCurrentPostId","getActivePostLock","getEditedPostAttribute","getEditedPostPreviewLink","getEditorSettings","getPostType","coreStore","useEffect","sendPostLock","data","lock","post_id","receivePostLock","received","lock_error","name","avatar","avatar_src_2x","new_lock","releasePostLock","window","FormData","append","unlockNonce","navigator","sendBeacon","ajaxUrl","xhr","XMLHttpRequest","open","send","addAction","addEventListener","removeAction","removeEventListener","userDisplayName","userAvatar","unlockUrl","addQueryArgs","lockKey","post","action","_wpnonce","nonce","allPostsUrl","post_type","slug","allPostsLabel","__","createElement","Modal","title","focusOnMount","shouldCloseOnClickOutside","shouldCloseOnEsc","isDismissible","className","__experimentalHStack","alignment","spacing","src","alt","width","height","createInterpolateElement","sprintf","strong","PreviewLink","ExternalLink","href","Fragment","justify","Button","variant"],"sources":["@wordpress/editor/src/components/post-locked-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tModal,\n\tButton,\n\tExternalLink,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { addQueryArgs } from '@wordpress/url';\nimport { useEffect, createInterpolateElement } from '@wordpress/element';\nimport { addAction, removeAction } from '@wordpress/hooks';\nimport { useInstanceId } from '@wordpress/compose';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport default function PostLockedModal() {\n\tconst instanceId = useInstanceId( PostLockedModal );\n\tconst hookName = 'core/editor/post-locked-modal-' + instanceId;\n\tconst { autosave, updatePostLock } = useDispatch( editorStore );\n\tconst {\n\t\tisLocked,\n\t\tisTakeover,\n\t\tuser,\n\t\tpostId,\n\t\tpostLockUtils,\n\t\tactivePostLock,\n\t\tpostType,\n\t\tpreviewLink,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tisPostLocked,\n\t\t\tisPostLockTakeover,\n\t\t\tgetPostLockUser,\n\t\t\tgetCurrentPostId,\n\t\t\tgetActivePostLock,\n\t\t\tgetEditedPostAttribute,\n\t\t\tgetEditedPostPreviewLink,\n\t\t\tgetEditorSettings,\n\t\t} = select( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\t\treturn {\n\t\t\tisLocked: isPostLocked(),\n\t\t\tisTakeover: isPostLockTakeover(),\n\t\t\tuser: getPostLockUser(),\n\t\t\tpostId: getCurrentPostId(),\n\t\t\tpostLockUtils: getEditorSettings().postLockUtils,\n\t\t\tactivePostLock: getActivePostLock(),\n\t\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\t\tpreviewLink: getEditedPostPreviewLink(),\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\t/**\n\t\t * Keep the lock refreshed.\n\t\t *\n\t\t * When the user does not send a heartbeat in a heartbeat-tick\n\t\t * the user is no longer editing and another user can start editing.\n\t\t *\n\t\t * @param {Object} data Data to send in the heartbeat request.\n\t\t */\n\t\tfunction sendPostLock( data ) {\n\t\t\tif ( isLocked ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdata[ 'wp-refresh-post-lock' ] = {\n\t\t\t\tlock: activePostLock,\n\t\t\t\tpost_id: postId,\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Refresh post locks: update the lock string or show the dialog if somebody has taken over editing.\n\t\t *\n\t\t * @param {Object} data Data received in the heartbeat request\n\t\t */\n\t\tfunction receivePostLock( data ) {\n\t\t\tif ( ! data[ 'wp-refresh-post-lock' ] ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst received = data[ 'wp-refresh-post-lock' ];\n\t\t\tif ( received.lock_error ) {\n\t\t\t\t// Auto save and display the takeover modal.\n\t\t\t\tautosave();\n\t\t\t\tupdatePostLock( {\n\t\t\t\t\tisLocked: true,\n\t\t\t\t\tisTakeover: true,\n\t\t\t\t\tuser: {\n\t\t\t\t\t\tname: received.lock_error.name,\n\t\t\t\t\t\tavatar: received.lock_error.avatar_src_2x,\n\t\t\t\t\t},\n\t\t\t\t} );\n\t\t\t} else if ( received.new_lock ) {\n\t\t\t\tupdatePostLock( {\n\t\t\t\t\tisLocked: false,\n\t\t\t\t\tactivePostLock: received.new_lock,\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Unlock the post before the window is exited.\n\t\t */\n\t\tfunction releasePostLock() {\n\t\t\tif ( isLocked || ! activePostLock ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst data = new window.FormData();\n\t\t\tdata.append( 'action', 'wp-remove-post-lock' );\n\t\t\tdata.append( '_wpnonce', postLockUtils.unlockNonce );\n\t\t\tdata.append( 'post_ID', postId );\n\t\t\tdata.append( 'active_post_lock', activePostLock );\n\n\t\t\tif ( window.navigator.sendBeacon ) {\n\t\t\t\twindow.navigator.sendBeacon( postLockUtils.ajaxUrl, data );\n\t\t\t} else {\n\t\t\t\tconst xhr = new window.XMLHttpRequest();\n\t\t\t\txhr.open( 'POST', postLockUtils.ajaxUrl, false );\n\t\t\t\txhr.send( data );\n\t\t\t}\n\t\t}\n\n\t\t// Details on these events on the Heartbeat API docs\n\t\t// https://developer.wordpress.org/plugins/javascript/heartbeat-api/\n\t\taddAction( 'heartbeat.send', hookName, sendPostLock );\n\t\taddAction( 'heartbeat.tick', hookName, receivePostLock );\n\t\twindow.addEventListener( 'beforeunload', releasePostLock );\n\n\t\treturn () => {\n\t\t\tremoveAction( 'heartbeat.send', hookName );\n\t\t\tremoveAction( 'heartbeat.tick', hookName );\n\t\t\twindow.removeEventListener( 'beforeunload', releasePostLock );\n\t\t};\n\t}, [] );\n\n\tif ( ! isLocked ) {\n\t\treturn null;\n\t}\n\n\tconst userDisplayName = user.name;\n\tconst userAvatar = user.avatar;\n\n\tconst unlockUrl = addQueryArgs( 'post.php', {\n\t\t'get-post-lock': '1',\n\t\tlockKey: true,\n\t\tpost: postId,\n\t\taction: 'edit',\n\t\t_wpnonce: postLockUtils.nonce,\n\t} );\n\tconst allPostsUrl = addQueryArgs( 'edit.php', {\n\t\tpost_type: postType?.slug,\n\t} );\n\tconst allPostsLabel = __( 'Exit editor' );\n\treturn (\n\t\t<Modal\n\t\t\ttitle={\n\t\t\t\tisTakeover\n\t\t\t\t\t? __( 'Someone else has taken over this post' )\n\t\t\t\t\t: __( 'This post is already being edited' )\n\t\t\t}\n\t\t\tfocusOnMount={ true }\n\t\t\tshouldCloseOnClickOutside={ false }\n\t\t\tshouldCloseOnEsc={ false }\n\t\t\tisDismissible={ false }\n\t\t\tclassName=\"editor-post-locked-modal\"\n\t\t>\n\t\t\t<HStack alignment=\"top\" spacing={ 6 }>\n\t\t\t\t{ !! userAvatar && (\n\t\t\t\t\t<img\n\t\t\t\t\t\tsrc={ userAvatar }\n\t\t\t\t\t\talt={ __( 'Avatar' ) }\n\t\t\t\t\t\tclassName=\"editor-post-locked-modal__avatar\"\n\t\t\t\t\t\twidth={ 64 }\n\t\t\t\t\t\theight={ 64 }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<div>\n\t\t\t\t\t{ !! isTakeover && (\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\tuserDisplayName\n\t\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: user's display name */\n\t\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t\t'<strong>%s</strong> now has editing control of this post (<PreviewLink />). Don’t worry, your changes up to this moment have been saved.'\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\tuserDisplayName\n\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t\t\t\t'Another user now has editing control of this post (<PreviewLink />). Don’t worry, your changes up to this moment have been saved.'\n\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tstrong: <strong />,\n\t\t\t\t\t\t\t\t\tPreviewLink: (\n\t\t\t\t\t\t\t\t\t\t<ExternalLink href={ previewLink }>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'preview' ) }\n\t\t\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! isTakeover && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\tuserDisplayName\n\t\t\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: user's display name */\n\t\t\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'<strong>%s</strong> is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over.'\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\tuserDisplayName\n\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Another user is currently working on this post (<PreviewLink />), which means you cannot make changes, unless you take over.'\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tstrong: <strong />,\n\t\t\t\t\t\t\t\t\t\tPreviewLink: (\n\t\t\t\t\t\t\t\t\t\t\t<ExternalLink href={ previewLink }>\n\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'preview' ) }\n\t\t\t\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'If you take over, the other user will lose editing control to the post, but their changes will be saved.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\n\t\t\t\t\t<HStack\n\t\t\t\t\t\tclassName=\"editor-post-locked-modal__buttons\"\n\t\t\t\t\t\tjustify=\"flex-end\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ! isTakeover && (\n\t\t\t\t\t\t\t<Button variant=\"tertiary\" href={ unlockUrl }>\n\t\t\t\t\t\t\t\t{ __( 'Take over' ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<Button variant=\"primary\" href={ allPostsUrl }>\n\t\t\t\t\t\t\t{ allPostsLabel }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</HStack>\n\t\t\t\t</div>\n\t\t\t</HStack>\n\t\t</Modal>\n\t);\n}\n"],"mappings":";;;;;;AAYA,IAAAA,QAAA,GAAAC,OAAA;AATA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAMA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AAEA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AAKA,IAAAQ,MAAA,GAAAR,OAAA;AApBA;AACA;AACA;;AAeA;AACA;AACA;;AAGe,SAASS,eAAeA,CAAA,EAAG;EACzC,MAAMC,UAAU,GAAG,IAAAC,sBAAa,EAAEF,eAAgB,CAAC;EACnD,MAAMG,QAAQ,GAAG,gCAAgC,GAAGF,UAAU;EAC9D,MAAM;IAAEG,QAAQ;IAAEC;EAAe,CAAC,GAAG,IAAAC,iBAAW,EAAEC,YAAY,CAAC;EAC/D,MAAM;IACLC,QAAQ;IACRC,UAAU;IACVC,IAAI;IACJC,MAAM;IACNC,aAAa;IACbC,cAAc;IACdC,QAAQ;IACRC;EACD,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAC5B,MAAM;MACLC,YAAY;MACZC,kBAAkB;MAClBC,eAAe;MACfC,gBAAgB;MAChBC,iBAAiB;MACjBC,sBAAsB;MACtBC,wBAAwB;MACxBC;IACD,CAAC,GAAGR,MAAM,CAAEV,YAAY,CAAC;IAC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AAC;EAAU,GAEhB,CAAEnF,UAAU,IACb,IAAAnB,QAAA,CAAAgF,aAAA,EAAC7E,WAAA,CAAAoG,MAAM;IAACC,OAAO,EAAC,UAAU;IAACJ,IAAI,EAAGhC;EAAW,GAC1C,IAAAW,QAAE,EAAE,WAAY,CACX,CACR,EACD,IAAA/E,QAAA,CAAAgF,aAAA,EAAC7E,WAAA,CAAAoG,MAAM;IAACC,OAAO,EAAC,SAAS;IAACJ,IAAI,EAAGzB;EAAa,GAC3CG,aACK,CACD,CACJ,CACE,CACF,CAAC;AAEV"}
|
|
@@ -5,13 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.PostPendingStatusCheck = PostPendingStatusCheck;
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
|
|
9
|
-
var _compose = require("@wordpress/compose");
|
|
10
|
-
|
|
11
8
|
var _data = require("@wordpress/data");
|
|
12
|
-
|
|
13
9
|
var _store = require("../../store");
|
|
14
|
-
|
|
15
10
|
/**
|
|
16
11
|
* WordPress dependencies
|
|
17
12
|
*/
|
|
@@ -19,32 +14,29 @@ var _store = require("../../store");
|
|
|
19
14
|
/**
|
|
20
15
|
* Internal dependencies
|
|
21
16
|
*/
|
|
17
|
+
|
|
22
18
|
function PostPendingStatusCheck({
|
|
23
|
-
hasPublishAction,
|
|
24
|
-
isPublished,
|
|
25
19
|
children
|
|
26
20
|
}) {
|
|
21
|
+
const {
|
|
22
|
+
hasPublishAction,
|
|
23
|
+
isPublished
|
|
24
|
+
} = (0, _data.useSelect)(select => {
|
|
25
|
+
var _getCurrentPost$_link;
|
|
26
|
+
const {
|
|
27
|
+
isCurrentPostPublished,
|
|
28
|
+
getCurrentPost
|
|
29
|
+
} = select(_store.store);
|
|
30
|
+
return {
|
|
31
|
+
hasPublishAction: (_getCurrentPost$_link = getCurrentPost()._links?.['wp:action-publish']) !== null && _getCurrentPost$_link !== void 0 ? _getCurrentPost$_link : false,
|
|
32
|
+
isPublished: isCurrentPostPublished()
|
|
33
|
+
};
|
|
34
|
+
}, []);
|
|
27
35
|
if (isPublished || !hasPublishAction) {
|
|
28
36
|
return null;
|
|
29
37
|
}
|
|
30
|
-
|
|
31
38
|
return children;
|
|
32
39
|
}
|
|
33
|
-
|
|
34
|
-
var _default = (0, _compose.compose)((0, _data.withSelect)(select => {
|
|
35
|
-
var _getCurrentPost$_link;
|
|
36
|
-
|
|
37
|
-
const {
|
|
38
|
-
isCurrentPostPublished,
|
|
39
|
-
getCurrentPostType,
|
|
40
|
-
getCurrentPost
|
|
41
|
-
} = select(_store.store);
|
|
42
|
-
return {
|
|
43
|
-
hasPublishAction: (_getCurrentPost$_link = getCurrentPost()._links?.['wp:action-publish']) !== null && _getCurrentPost$_link !== void 0 ? _getCurrentPost$_link : false,
|
|
44
|
-
isPublished: isCurrentPostPublished(),
|
|
45
|
-
postType: getCurrentPostType()
|
|
46
|
-
};
|
|
47
|
-
}))(PostPendingStatusCheck);
|
|
48
|
-
|
|
40
|
+
var _default = PostPendingStatusCheck;
|
|
49
41
|
exports.default = _default;
|
|
50
42
|
//# sourceMappingURL=check.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["_data","require","_store","PostPendingStatusCheck","children","hasPublishAction","isPublished","useSelect","select","_getCurrentPost$_link","isCurrentPostPublished","getCurrentPost","editorStore","_links","_default","exports","default"],"sources":["@wordpress/editor/src/components/post-pending-status/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport function PostPendingStatusCheck( { children } ) {\n\tconst { hasPublishAction, isPublished } = useSelect( ( select ) => {\n\t\tconst { isCurrentPostPublished, getCurrentPost } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\thasPublishAction:\n\t\t\t\tgetCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\tisPublished: isCurrentPostPublished(),\n\t\t};\n\t}, [] );\n\n\tif ( isPublished || ! hasPublishAction ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n\nexport default PostPendingStatusCheck;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAGO,SAASE,sBAAsBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACtD,MAAM;IAAEC,gBAAgB;IAAEC;EAAY,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAAA,IAAAC,qBAAA;IAClE,MAAM;MAAEC,sBAAsB;MAAEC;IAAe,CAAC,GAC/CH,MAAM,CAAEI,YAAY,CAAC;IACtB,OAAO;MACNP,gBAAgB,GAAAI,qBAAA,GACfE,cAAc,CAAC,CAAC,CAACE,MAAM,GAAI,mBAAmB,CAAE,cAAAJ,qBAAA,cAAAA,qBAAA,GAAI,KAAK;MAC1DH,WAAW,EAAEI,sBAAsB,CAAC;IACrC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,IAAKJ,WAAW,IAAI,CAAED,gBAAgB,EAAG;IACxC,OAAO,IAAI;EACZ;EAEA,OAAOD,QAAQ;AAChB;AAAC,IAAAU,QAAA,GAEcX,sBAAsB;AAAAY,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
|
@@ -1,27 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.PostPendingStatus = PostPendingStatus;
|
|
9
8
|
exports.default = void 0;
|
|
10
|
-
|
|
11
9
|
var _element = require("@wordpress/element");
|
|
12
|
-
|
|
13
10
|
var _i18n = require("@wordpress/i18n");
|
|
14
|
-
|
|
15
11
|
var _components = require("@wordpress/components");
|
|
16
|
-
|
|
17
12
|
var _data = require("@wordpress/data");
|
|
18
|
-
|
|
19
|
-
var _compose = require("@wordpress/compose");
|
|
20
|
-
|
|
21
13
|
var _check = _interopRequireDefault(require("./check"));
|
|
22
|
-
|
|
23
14
|
var _store = require("../../store");
|
|
24
|
-
|
|
25
15
|
/**
|
|
26
16
|
* WordPress dependencies
|
|
27
17
|
*/
|
|
@@ -29,15 +19,18 @@ var _store = require("../../store");
|
|
|
29
19
|
/**
|
|
30
20
|
* Internal dependencies
|
|
31
21
|
*/
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
22
|
+
|
|
23
|
+
function PostPendingStatus() {
|
|
24
|
+
const status = (0, _data.useSelect)(select => select(_store.store).getEditedPostAttribute('status'), []);
|
|
25
|
+
const {
|
|
26
|
+
editPost
|
|
27
|
+
} = (0, _data.useDispatch)(_store.store);
|
|
36
28
|
const togglePendingStatus = () => {
|
|
37
29
|
const updatedStatus = status === 'pending' ? 'draft' : 'pending';
|
|
38
|
-
|
|
30
|
+
editPost({
|
|
31
|
+
status: updatedStatus
|
|
32
|
+
});
|
|
39
33
|
};
|
|
40
|
-
|
|
41
34
|
return (0, _element.createElement)(_check.default, null, (0, _element.createElement)(_components.CheckboxControl, {
|
|
42
35
|
__nextHasNoMarginBottom: true,
|
|
43
36
|
label: (0, _i18n.__)('Pending review'),
|
|
@@ -45,17 +38,6 @@ function PostPendingStatus({
|
|
|
45
38
|
onChange: togglePendingStatus
|
|
46
39
|
}));
|
|
47
40
|
}
|
|
48
|
-
|
|
49
|
-
var _default = (0, _compose.compose)((0, _data.withSelect)(select => ({
|
|
50
|
-
status: select(_store.store).getEditedPostAttribute('status')
|
|
51
|
-
})), (0, _data.withDispatch)(dispatch => ({
|
|
52
|
-
onUpdateStatus(status) {
|
|
53
|
-
dispatch(_store.store).editPost({
|
|
54
|
-
status
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
})))(PostPendingStatus);
|
|
59
|
-
|
|
41
|
+
var _default = PostPendingStatus;
|
|
60
42
|
exports.default = _default;
|
|
61
43
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["_i18n","require","_components","_data","_check","_interopRequireDefault","_store","PostPendingStatus","status","useSelect","select","editorStore","getEditedPostAttribute","editPost","useDispatch","togglePendingStatus","updatedStatus","_element","createElement","default","CheckboxControl","__nextHasNoMarginBottom","label","__","checked","onChange","_default","exports"],"sources":["@wordpress/editor/src/components/post-pending-status/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { CheckboxControl } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport PostPendingStatusCheck from './check';\nimport { store as editorStore } from '../../store';\n\nexport function PostPendingStatus() {\n\tconst status = useSelect(\n\t\t( select ) => select( editorStore ).getEditedPostAttribute( 'status' ),\n\t\t[]\n\t);\n\tconst { editPost } = useDispatch( editorStore );\n\tconst togglePendingStatus = () => {\n\t\tconst updatedStatus = status === 'pending' ? 'draft' : 'pending';\n\t\teditPost( { status: updatedStatus } );\n\t};\n\n\treturn (\n\t\t<PostPendingStatusCheck>\n\t\t\t<CheckboxControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tlabel={ __( 'Pending review' ) }\n\t\t\t\tchecked={ status === 'pending' }\n\t\t\t\tonChange={ togglePendingStatus }\n\t\t\t/>\n\t\t</PostPendingStatusCheck>\n\t);\n}\n\nexport default PostPendingStatus;\n"],"mappings":";;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAKA,IAAAG,MAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAXA;AACA;AACA;;AAKA;AACA;AACA;;AAIO,SAASM,iBAAiBA,CAAA,EAAG;EACnC,MAAMC,MAAM,GAAG,IAAAC,eAAS,EACrBC,MAAM,IAAMA,MAAM,CAAEC,YAAY,CAAC,CAACC,sBAAsB,CAAE,QAAS,CAAC,EACtE,EACD,CAAC;EACD,MAAM;IAAEC;EAAS,CAAC,GAAG,IAAAC,iBAAW,EAAEH,YAAY,CAAC;EAC/C,MAAMI,mBAAmB,GAAGA,CAAA,KAAM;IACjC,MAAMC,aAAa,GAAGR,MAAM,KAAK,SAAS,GAAG,OAAO,GAAG,SAAS;IAChEK,QAAQ,CAAE;MAAEL,MAAM,EAAEQ;IAAc,CAAE,CAAC;EACtC,CAAC;EAED,OACC,IAAAC,QAAA,CAAAC,aAAA,EAACd,MAAA,CAAAe,OAAsB,QACtB,IAAAF,QAAA,CAAAC,aAAA,EAAChB,WAAA,CAAAkB,eAAe;IACfC,uBAAuB;IACvBC,KAAK,EAAG,IAAAC,QAAE,EAAE,gBAAiB,CAAG;IAChCC,OAAO,EAAGhB,MAAM,KAAK,SAAW;IAChCiB,QAAQ,EAAGV;EAAqB,CAChC,CACsB,CAAC;AAE3B;AAAC,IAAAW,QAAA,GAEcnB,iBAAiB;AAAAoB,OAAA,CAAAR,OAAA,GAAAO,QAAA"}
|
|
@@ -4,19 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _element = require("@wordpress/element");
|
|
9
|
-
|
|
10
8
|
var _i18n = require("@wordpress/i18n");
|
|
11
|
-
|
|
12
9
|
var _components = require("@wordpress/components");
|
|
13
|
-
|
|
14
10
|
var _data = require("@wordpress/data");
|
|
15
|
-
|
|
16
|
-
var _compose = require("@wordpress/compose");
|
|
17
|
-
|
|
18
11
|
var _store = require("../../store");
|
|
19
|
-
|
|
20
12
|
/**
|
|
21
13
|
* WordPress dependencies
|
|
22
14
|
*/
|
|
@@ -24,14 +16,18 @@ var _store = require("../../store");
|
|
|
24
16
|
/**
|
|
25
17
|
* Internal dependencies
|
|
26
18
|
*/
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
19
|
+
|
|
20
|
+
function PostPingbacks() {
|
|
21
|
+
const pingStatus = (0, _data.useSelect)(select => {
|
|
22
|
+
var _select$getEditedPost;
|
|
23
|
+
return (_select$getEditedPost = select(_store.store).getEditedPostAttribute('ping_status')) !== null && _select$getEditedPost !== void 0 ? _select$getEditedPost : 'open';
|
|
24
|
+
}, []);
|
|
25
|
+
const {
|
|
26
|
+
editPost
|
|
27
|
+
} = (0, _data.useDispatch)(_store.store);
|
|
28
|
+
const onTogglePingback = () => editPost({
|
|
32
29
|
ping_status: pingStatus === 'open' ? 'closed' : 'open'
|
|
33
30
|
});
|
|
34
|
-
|
|
35
31
|
return (0, _element.createElement)(_components.CheckboxControl, {
|
|
36
32
|
__nextHasNoMarginBottom: true,
|
|
37
33
|
label: (0, _i18n.__)('Allow pingbacks & trackbacks'),
|
|
@@ -39,14 +35,6 @@ function PostPingbacks({
|
|
|
39
35
|
onChange: onTogglePingback
|
|
40
36
|
});
|
|
41
37
|
}
|
|
42
|
-
|
|
43
|
-
var _default = (0, _compose.compose)([(0, _data.withSelect)(select => {
|
|
44
|
-
return {
|
|
45
|
-
pingStatus: select(_store.store).getEditedPostAttribute('ping_status')
|
|
46
|
-
};
|
|
47
|
-
}), (0, _data.withDispatch)(dispatch => ({
|
|
48
|
-
editPost: dispatch(_store.store).editPost
|
|
49
|
-
}))])(PostPingbacks);
|
|
50
|
-
|
|
38
|
+
var _default = PostPingbacks;
|
|
51
39
|
exports.default = _default;
|
|
52
40
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["_i18n","require","_components","_data","_store","PostPingbacks","pingStatus","useSelect","select","_select$getEditedPost","editorStore","getEditedPostAttribute","editPost","useDispatch","onTogglePingback","ping_status","_element","createElement","CheckboxControl","__nextHasNoMarginBottom","label","__","checked","onChange","_default","exports","default"],"sources":["@wordpress/editor/src/components/post-pingbacks/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { CheckboxControl } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction PostPingbacks() {\n\tconst pingStatus = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getEditedPostAttribute( 'ping_status' ) ??\n\t\t\t'open',\n\t\t[]\n\t);\n\tconst { editPost } = useDispatch( editorStore );\n\tconst onTogglePingback = () =>\n\t\teditPost( {\n\t\t\tping_status: pingStatus === 'open' ? 'closed' : 'open',\n\t\t} );\n\n\treturn (\n\t\t<CheckboxControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\tlabel={ __( 'Allow pingbacks & trackbacks' ) }\n\t\t\tchecked={ pingStatus === 'open' }\n\t\t\tonChange={ onTogglePingback }\n\t\t/>\n\t);\n}\n\nexport default PostPingbacks;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAKA,IAAAG,MAAA,GAAAH,OAAA;AAVA;AACA;AACA;;AAKA;AACA;AACA;;AAGA,SAASI,aAAaA,CAAA,EAAG;EACxB,MAAMC,UAAU,GAAG,IAAAC,eAAS,EACzBC,MAAM;IAAA,IAAAC,qBAAA;IAAA,QAAAA,qBAAA,GACPD,MAAM,CAAEE,YAAY,CAAC,CAACC,sBAAsB,CAAE,aAAc,CAAC,cAAAF,qBAAA,cAAAA,qBAAA,GAC7D,MAAM;EAAA,GACP,EACD,CAAC;EACD,MAAM;IAAEG;EAAS,CAAC,GAAG,IAAAC,iBAAW,EAAEH,YAAY,CAAC;EAC/C,MAAMI,gBAAgB,GAAGA,CAAA,KACxBF,QAAQ,CAAE;IACTG,WAAW,EAAET,UAAU,KAAK,MAAM,GAAG,QAAQ,GAAG;EACjD,CAAE,CAAC;EAEJ,OACC,IAAAU,QAAA,CAAAC,aAAA,EAACf,WAAA,CAAAgB,eAAe;IACfC,uBAAuB;IACvBC,KAAK,EAAG,IAAAC,QAAE,EAAE,8BAA+B,CAAG;IAC9CC,OAAO,EAAGhB,UAAU,KAAK,MAAQ;IACjCiB,QAAQ,EAAGT;EAAkB,CAC7B,CAAC;AAEJ;AAAC,IAAAU,QAAA,GAEcnB,aAAa;AAAAoB,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
|
@@ -4,21 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = PostPreviewButton;
|
|
7
|
-
|
|
8
7
|
var _element = require("@wordpress/element");
|
|
9
|
-
|
|
10
8
|
var _components = require("@wordpress/components");
|
|
11
|
-
|
|
12
9
|
var _i18n = require("@wordpress/i18n");
|
|
13
|
-
|
|
14
10
|
var _data = require("@wordpress/data");
|
|
15
|
-
|
|
16
11
|
var _hooks = require("@wordpress/hooks");
|
|
17
|
-
|
|
18
12
|
var _coreData = require("@wordpress/core-data");
|
|
19
|
-
|
|
20
13
|
var _store = require("../../store");
|
|
21
|
-
|
|
22
14
|
/**
|
|
23
15
|
* WordPress dependencies
|
|
24
16
|
*/
|
|
@@ -26,6 +18,7 @@ var _store = require("../../store");
|
|
|
26
18
|
/**
|
|
27
19
|
* Internal dependencies
|
|
28
20
|
*/
|
|
21
|
+
|
|
29
22
|
function writeInterstitialMessage(targetDocument) {
|
|
30
23
|
let markup = (0, _element.renderToString)((0, _element.createElement)("div", {
|
|
31
24
|
className: "editor-post-preview-button__interstitial-message"
|
|
@@ -95,18 +88,17 @@ function writeInterstitialMessage(targetDocument) {
|
|
|
95
88
|
}
|
|
96
89
|
</style>
|
|
97
90
|
`;
|
|
91
|
+
|
|
98
92
|
/**
|
|
99
93
|
* Filters the interstitial message shown when generating previews.
|
|
100
94
|
*
|
|
101
95
|
* @param {string} markup The preview interstitial markup.
|
|
102
96
|
*/
|
|
103
|
-
|
|
104
97
|
markup = (0, _hooks.applyFilters)('editor.PostPreview.interstitialMarkup', markup);
|
|
105
98
|
targetDocument.write(markup);
|
|
106
99
|
targetDocument.title = (0, _i18n.__)('Generating preview…');
|
|
107
100
|
targetDocument.close();
|
|
108
101
|
}
|
|
109
|
-
|
|
110
102
|
function PostPreviewButton({
|
|
111
103
|
className,
|
|
112
104
|
textContent,
|
|
@@ -122,7 +114,6 @@ function PostPreviewButton({
|
|
|
122
114
|
isViewable
|
|
123
115
|
} = (0, _data.useSelect)(select => {
|
|
124
116
|
var _postType$viewable;
|
|
125
|
-
|
|
126
117
|
const editor = select(_store.store);
|
|
127
118
|
const core = select(_coreData.store);
|
|
128
119
|
const postType = core.getPostType(editor.getCurrentPostType('type'));
|
|
@@ -137,25 +128,24 @@ function PostPreviewButton({
|
|
|
137
128
|
const {
|
|
138
129
|
__unstableSaveForPreview
|
|
139
130
|
} = (0, _data.useDispatch)(_store.store);
|
|
140
|
-
|
|
141
131
|
if (!isViewable) {
|
|
142
132
|
return null;
|
|
143
133
|
}
|
|
144
|
-
|
|
145
134
|
const targetId = `wp-preview-${postId}`;
|
|
146
|
-
|
|
147
135
|
const openPreviewWindow = async event => {
|
|
148
136
|
// Our Preview button has its 'href' and 'target' set correctly for a11y
|
|
149
137
|
// purposes. Unfortunately, though, we can't rely on the default 'click'
|
|
150
138
|
// handler since sometimes it incorrectly opens a new tab instead of reusing
|
|
151
139
|
// the existing one.
|
|
152
140
|
// https://github.com/WordPress/gutenberg/pull/8330
|
|
153
|
-
event.preventDefault();
|
|
141
|
+
event.preventDefault();
|
|
154
142
|
|
|
155
|
-
|
|
143
|
+
// Open up a Preview tab if needed. This is where we'll show the preview.
|
|
144
|
+
const previewWindow = window.open('', targetId);
|
|
145
|
+
|
|
146
|
+
// Focus the Preview tab. This might not do anything, depending on the browser's
|
|
156
147
|
// and user's preferences.
|
|
157
148
|
// https://html.spec.whatwg.org/multipage/interaction.html#dom-window-focus
|
|
158
|
-
|
|
159
149
|
previewWindow.focus();
|
|
160
150
|
writeInterstitialMessage(previewWindow.document);
|
|
161
151
|
const link = await __unstableSaveForPreview({
|
|
@@ -163,11 +153,11 @@ function PostPreviewButton({
|
|
|
163
153
|
});
|
|
164
154
|
previewWindow.location = link;
|
|
165
155
|
onPreview?.();
|
|
166
|
-
};
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
// Link to the `?preview=true` URL if we have it, since this lets us see
|
|
167
159
|
// changes that were autosaved since the post was last published. Otherwise,
|
|
168
160
|
// just link to the post's URL.
|
|
169
|
-
|
|
170
|
-
|
|
171
161
|
const href = previewLink || currentPostLink;
|
|
172
162
|
return (0, _element.createElement)(_components.Button, {
|
|
173
163
|
variant: !className ? 'tertiary' : undefined,
|
|
@@ -179,8 +169,7 @@ function PostPreviewButton({
|
|
|
179
169
|
role: role
|
|
180
170
|
}, textContent || (0, _element.createElement)(_element.Fragment, null, (0, _i18n._x)('Preview', 'imperative verb'), (0, _element.createElement)(_components.VisuallyHidden, {
|
|
181
171
|
as: "span"
|
|
182
|
-
},
|
|
183
|
-
/* translators: accessibility text */
|
|
172
|
+
}, /* translators: accessibility text */
|
|
184
173
|
(0, _i18n.__)('(opens in a new tab)'))));
|
|
185
174
|
}
|
|
186
175
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/post-preview-button/index.js"],"names":["writeInterstitialMessage","targetDocument","markup","write","title","close","PostPreviewButton","className","textContent","forceIsAutosaveable","role","onPreview","postId","currentPostLink","previewLink","isSaveable","isViewable","select","editor","editorStore","core","coreStore","postType","getPostType","getCurrentPostType","getCurrentPostId","getCurrentPostAttribute","getEditedPostPreviewLink","isEditedPostSaveable","viewable","__unstableSaveForPreview","targetId","openPreviewWindow","event","preventDefault","previewWindow","window","open","focus","document","link","location","href","undefined"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAbA;AACA;AACA;;AAQA;AACA;AACA;AAGA,SAASA,wBAAT,CAAmCC,cAAnC,EAAoD;AACnD,MAAIC,MAAM,GAAG,6BACZ;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,eAAD;AAAK,IAAA,KAAK,EAAC,4BAAX;AAAwC,IAAA,OAAO,EAAC;AAAhD,KACC,4BAAC,gBAAD;AACC,IAAA,SAAS,EAAC,OADX;AAEC,IAAA,CAAC,EAAC,uEAFH;AAGC,IAAA,IAAI,EAAC;AAHN,IADD,EAMC,4BAAC,gBAAD;AACC,IAAA,SAAS,EAAC,OADX;AAEC,IAAA,CAAC,EAAC,0nBAFH;AAGC,IAAA,IAAI,EAAC;AAHN,IAND,CADD,EAaC,uCAAK,cAAI,qBAAJ,CAAL,CAbD,CADY,CAAb;AAkBAA,EAAAA,MAAM,IAAK;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EArDC;AAuDA;AACD;AACA;AACA;AACA;;AACCA,EAAAA,MAAM,GAAG,yBAAc,uCAAd,EAAuDA,MAAvD,CAAT;AAEAD,EAAAA,cAAc,CAACE,KAAf,CAAsBD,MAAtB;AACAD,EAAAA,cAAc,CAACG,KAAf,GAAuB,cAAI,qBAAJ,CAAvB;AACAH,EAAAA,cAAc,CAACI,KAAf;AACA;;AAEc,SAASC,iBAAT,CAA4B;AAC1CC,EAAAA,SAD0C;AAE1CC,EAAAA,WAF0C;AAG1CC,EAAA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,CAACI,QAAhB,CAAxB;AAEA,UAAMC,IAAI,GAAG,MAAMV,wBAAwB,CAAE;AAAErB,MAAAA;AAAF,KAAF,CAA3C;AAEA0B,IAAAA,aAAa,CAACM,QAAd,GAAyBD,IAAzB;AAEA7B,IAAAA,SAAS;AACT,GAvBD,CA3BG,CAoDH;AACA;AACA;;;AACA,QAAM+B,IAAI,GAAG5B,WAAW,IAAID,eAA5B;AAEA,SACC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAG,CAAEN,SAAF,GAAc,UAAd,GAA2BoC,SADtC;AAEC,IAAA,SAAS,EAAGpC,SAAS,IAAI,qBAF1B;AAGC,IAAA,IAAI,EAAGmC,IAHR;AAIC,IAAA,MAAM,EAAGX,QAJV;AAKC,IAAA,QAAQ,EAAG,CAAEhB,UALd;AAMC,IAAA,OAAO,EAAGiB,iBANX;AAOC,IAAA,IAAI,EAAGtB;AAPR,KASGF,WAAW,IACZ,qDACG,cAAI,SAAJ,EAAe,iBAAf,CADH,EAEC,4BAAC,0BAAD;AAAgB,IAAA,EAAE,EAAC;AAAnB;AAEE;AACA,gBAAI,sBAAJ,CAHF,CAFD,CAVF,CADD;AAuBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { renderToString } from '@wordpress/element';\nimport { Button, Path, SVG, VisuallyHidden } from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { applyFilters } from '@wordpress/hooks';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction writeInterstitialMessage( targetDocument ) {\n\tlet markup = renderToString(\n\t\t<div className=\"editor-post-preview-button__interstitial-message\">\n\t\t\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 96 96\">\n\t\t\t\t<Path\n\t\t\t\t\tclassName=\"outer\"\n\t\t\t\t\td=\"M48 12c19.9 0 36 16.1 36 36S67.9 84 48 84 12 67.9 12 48s16.1-36 36-36\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t/>\n\t\t\t\t<Path\n\t\t\t\t\tclassName=\"inner\"\n\t\t\t\t\td=\"M69.5 46.4c0-3.9-1.4-6.7-2.6-8.8-1.6-2.6-3.1-4.9-3.1-7.5 0-2.9 2.2-5.7 5.4-5.7h.4C63.9 19.2 56.4 16 48 16c-11.2 0-21 5.7-26.7 14.4h2.1c3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3L40 67.5l7-20.9L42 33c-1.7-.1-3.3-.3-3.3-.3-1.7-.1-1.5-2.7.2-2.6 0 0 5.3.4 8.4.4 3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3l11.5 34.3 3.3-10.4c1.6-4.5 2.4-7.8 2.4-10.5zM16.1 48c0 12.6 7.3 23.5 18 28.7L18.8 35c-1.7 4-2.7 8.4-2.7 13zm32.5 2.8L39 78.6c2.9.8 5.9 1.3 9 1.3 3.7 0 7.3-.6 10.6-1.8-.1-.1-.2-.3-.2-.4l-9.8-26.9zM76.2 36c0 3.2-.6 6.9-2.4 11.4L64 75.6c9.5-5.5 15.9-15.8 15.9-27.6 0-5.5-1.4-10.8-3.9-15.3.1 1 .2 2.1.2 3.3z\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t/>\n\t\t\t</SVG>\n\t\t\t<p>{ __( 'Generating preview…' ) }</p>\n\t\t</div>\n\t);\n\n\tmarkup += `\n\t\t<style>\n\t\t\tbody {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t\theight: 100vh;\n\t\t\t\twidth: 100vw;\n\t\t\t}\n\t\t\t@-webkit-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-moz-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-o-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg {\n\t\t\t\twidth: 192px;\n\t\t\t\theight: 192px;\n\t\t\t\tstroke: #555d66;\n\t\t\t\tstroke-width: 0.75;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg .outer,\n\t\t\t.editor-post-preview-button__interstitial-message svg .inner {\n\t\t\t\tstroke-dasharray: 280;\n\t\t\t\tstroke-dashoffset: 280;\n\t\t\t\t-webkit-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-moz-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-o-animation: paint 1.5s ease infinite alternate;\n\t\t\t\tanimation: paint 1.5s ease infinite alternate;\n\t\t\t}\n\t\t\tp {\n\t\t\t\ttext-align: center;\n\t\t\t\tfont-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif;\n\t\t\t}\n\t\t</style>\n\t`;\n\n\t/**\n\t * Filters the interstitial message shown when generating previews.\n\t *\n\t * @param {string} markup The preview interstitial markup.\n\t */\n\tmarkup = applyFilters( 'editor.PostPreview.interstitialMarkup', markup );\n\n\ttargetDocument.write( markup );\n\ttargetDocument.title = __( 'Generating preview…' );\n\ttargetDocument.close();\n}\n\nexport default function PostPreviewButton( {\n\tclassName,\n\ttextContent,\n\tforceIsAutosaveable,\n\trole,\n\tonPreview,\n} ) {\n\tconst { postId, currentPostLink, previewLink, isSaveable, isViewable } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst editor = select( editorStore );\n\t\t\tconst core = select( coreStore );\n\n\t\t\tconst postType = core.getPostType(\n\t\t\t\teditor.getCurrentPostType( 'type' )\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tpostId: editor.getCurrentPostId(),\n\t\t\t\tcurrentPostLink: editor.getCurrentPostAttribute( 'link' ),\n\t\t\t\tpreviewLink: editor.getEditedPostPreviewLink(),\n\t\t\t\tisSaveable: editor.isEditedPostSaveable(),\n\t\t\t\tisViewable: postType?.viewable ?? false,\n\t\t\t};\n\t\t}, [] );\n\n\tconst { __unstableSaveForPreview } = useDispatch( editorStore );\n\n\tif ( ! isViewable ) {\n\t\treturn null;\n\t}\n\n\tconst targetId = `wp-preview-${ postId }`;\n\n\tconst openPreviewWindow = async ( event ) => {\n\t\t// Our Preview button has its 'href' and 'target' set correctly for a11y\n\t\t// purposes. Unfortunately, though, we can't rely on the default 'click'\n\t\t// handler since sometimes it incorrectly opens a new tab instead of reusing\n\t\t// the existing one.\n\t\t// https://github.com/WordPress/gutenberg/pull/8330\n\t\tevent.preventDefault();\n\n\t\t// Open up a Preview tab if needed. This is where we'll show the preview.\n\t\tconst previewWindow = window.open( '', targetId );\n\n\t\t// Focus the Preview tab. This might not do anything, depending on the browser's\n\t\t// and user's preferences.\n\t\t// https://html.spec.whatwg.org/multipage/interaction.html#dom-window-focus\n\t\tpreviewWindow.focus();\n\n\t\twriteInterstitialMessage( previewWindow.document );\n\n\t\tconst link = await __unstableSaveForPreview( { forceIsAutosaveable } );\n\n\t\tpreviewWindow.location = link;\n\n\t\tonPreview?.();\n\t};\n\n\t// Link to the `?preview=true` URL if we have it, since this lets us see\n\t// changes that were autosaved since the post was last published. Otherwise,\n\t// just link to the post's URL.\n\tconst href = previewLink || currentPostLink;\n\n\treturn (\n\t\t<Button\n\t\t\tvariant={ ! className ? 'tertiary' : undefined }\n\t\t\tclassName={ className || 'editor-post-preview' }\n\t\t\thref={ href }\n\t\t\ttarget={ targetId }\n\t\t\tdisabled={ ! isSaveable }\n\t\t\tonClick={ openPreviewWindow }\n\t\t\trole={ role }\n\t\t>\n\t\t\t{ textContent || (\n\t\t\t\t<>\n\t\t\t\t\t{ _x( 'Preview', 'imperative verb' ) }\n\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t}\n\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t</>\n\t\t\t) }\n\t\t</Button>\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"names":["_element","require","_components","_i18n","_data","_hooks","_coreData","_store","writeInterstitialMessage","targetDocument","markup","renderToString","createElement","className","SVG","xmlns","viewBox","Path","d","fill","__","applyFilters","write","title","close","PostPreviewButton","textContent","forceIsAutosaveable","role","onPreview","postId","currentPostLink","previewLink","isSaveable","isViewable","useSelect","select","_postType$viewable","editor","editorStore","core","coreStore","postType","getPostType","getCurrentPostType","getCurrentPostId","getCurrentPostAttribute","getEditedPostPreviewLink","isEditedPostSaveable","viewable","__unstableSaveForPreview","useDispatch","targetId","openPreviewWindow","event","preventDefault","previewWindow","window","open","focus","document","link","location","href","Button","variant","undefined","target","disabled","onClick","Fragment","_x","VisuallyHidden","as"],"sources":["@wordpress/editor/src/components/post-preview-button/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { renderToString } from '@wordpress/element';\nimport { Button, Path, SVG, VisuallyHidden } from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { applyFilters } from '@wordpress/hooks';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction writeInterstitialMessage( targetDocument ) {\n\tlet markup = renderToString(\n\t\t<div className=\"editor-post-preview-button__interstitial-message\">\n\t\t\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 96 96\">\n\t\t\t\t<Path\n\t\t\t\t\tclassName=\"outer\"\n\t\t\t\t\td=\"M48 12c19.9 0 36 16.1 36 36S67.9 84 48 84 12 67.9 12 48s16.1-36 36-36\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t/>\n\t\t\t\t<Path\n\t\t\t\t\tclassName=\"inner\"\n\t\t\t\t\td=\"M69.5 46.4c0-3.9-1.4-6.7-2.6-8.8-1.6-2.6-3.1-4.9-3.1-7.5 0-2.9 2.2-5.7 5.4-5.7h.4C63.9 19.2 56.4 16 48 16c-11.2 0-21 5.7-26.7 14.4h2.1c3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3L40 67.5l7-20.9L42 33c-1.7-.1-3.3-.3-3.3-.3-1.7-.1-1.5-2.7.2-2.6 0 0 5.3.4 8.4.4 3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3l11.5 34.3 3.3-10.4c1.6-4.5 2.4-7.8 2.4-10.5zM16.1 48c0 12.6 7.3 23.5 18 28.7L18.8 35c-1.7 4-2.7 8.4-2.7 13zm32.5 2.8L39 78.6c2.9.8 5.9 1.3 9 1.3 3.7 0 7.3-.6 10.6-1.8-.1-.1-.2-.3-.2-.4l-9.8-26.9zM76.2 36c0 3.2-.6 6.9-2.4 11.4L64 75.6c9.5-5.5 15.9-15.8 15.9-27.6 0-5.5-1.4-10.8-3.9-15.3.1 1 .2 2.1.2 3.3z\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t/>\n\t\t\t</SVG>\n\t\t\t<p>{ __( 'Generating preview…' ) }</p>\n\t\t</div>\n\t);\n\n\tmarkup += `\n\t\t<style>\n\t\t\tbody {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t\theight: 100vh;\n\t\t\t\twidth: 100vw;\n\t\t\t}\n\t\t\t@-webkit-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-moz-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-o-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg {\n\t\t\t\twidth: 192px;\n\t\t\t\theight: 192px;\n\t\t\t\tstroke: #555d66;\n\t\t\t\tstroke-width: 0.75;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg .outer,\n\t\t\t.editor-post-preview-button__interstitial-message svg .inner {\n\t\t\t\tstroke-dasharray: 280;\n\t\t\t\tstroke-dashoffset: 280;\n\t\t\t\t-webkit-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-moz-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-o-animation: paint 1.5s ease infinite alternate;\n\t\t\t\tanimation: paint 1.5s ease infinite alternate;\n\t\t\t}\n\t\t\tp {\n\t\t\t\ttext-align: center;\n\t\t\t\tfont-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif;\n\t\t\t}\n\t\t</style>\n\t`;\n\n\t/**\n\t * Filters the interstitial message shown when generating previews.\n\t *\n\t * @param {string} markup The preview interstitial markup.\n\t */\n\tmarkup = applyFilters( 'editor.PostPreview.interstitialMarkup', markup );\n\n\ttargetDocument.write( markup );\n\ttargetDocument.title = __( 'Generating preview…' );\n\ttargetDocument.close();\n}\n\nexport default function PostPreviewButton( {\n\tclassName,\n\ttextContent,\n\tforceIsAutosaveable,\n\trole,\n\tonPreview,\n} ) {\n\tconst { postId, currentPostLink, previewLink, isSaveable, isViewable } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst editor = select( editorStore );\n\t\t\tconst core = select( coreStore );\n\n\t\t\tconst postType = core.getPostType(\n\t\t\t\teditor.getCurrentPostType( 'type' )\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tpostId: editor.getCurrentPostId(),\n\t\t\t\tcurrentPostLink: editor.getCurrentPostAttribute( 'link' ),\n\t\t\t\tpreviewLink: editor.getEditedPostPreviewLink(),\n\t\t\t\tisSaveable: editor.isEditedPostSaveable(),\n\t\t\t\tisViewable: postType?.viewable ?? false,\n\t\t\t};\n\t\t}, [] );\n\n\tconst { __unstableSaveForPreview } = useDispatch( editorStore );\n\n\tif ( ! isViewable ) {\n\t\treturn null;\n\t}\n\n\tconst targetId = `wp-preview-${ postId }`;\n\n\tconst openPreviewWindow = async ( event ) => {\n\t\t// Our Preview button has its 'href' and 'target' set correctly for a11y\n\t\t// purposes. Unfortunately, though, we can't rely on the default 'click'\n\t\t// handler since sometimes it incorrectly opens a new tab instead of reusing\n\t\t// the existing one.\n\t\t// https://github.com/WordPress/gutenberg/pull/8330\n\t\tevent.preventDefault();\n\n\t\t// Open up a Preview tab if needed. This is where we'll show the preview.\n\t\tconst previewWindow = window.open( '', targetId );\n\n\t\t// Focus the Preview tab. This might not do anything, depending on the browser's\n\t\t// and user's preferences.\n\t\t// https://html.spec.whatwg.org/multipage/interaction.html#dom-window-focus\n\t\tpreviewWindow.focus();\n\n\t\twriteInterstitialMessage( previewWindow.document );\n\n\t\tconst link = await __unstableSaveForPreview( { forceIsAutosaveable } );\n\n\t\tpreviewWindow.location = link;\n\n\t\tonPreview?.();\n\t};\n\n\t// Link to the `?preview=true` URL if we have it, since this lets us see\n\t// changes that were autosaved since the post was last published. Otherwise,\n\t// just link to the post's URL.\n\tconst href = previewLink || currentPostLink;\n\n\treturn (\n\t\t<Button\n\t\t\tvariant={ ! className ? 'tertiary' : undefined }\n\t\t\tclassName={ className || 'editor-post-preview' }\n\t\t\thref={ href }\n\t\t\ttarget={ targetId }\n\t\t\tdisabled={ ! isSaveable }\n\t\t\tonClick={ openPreviewWindow }\n\t\t\trole={ role }\n\t\t>\n\t\t\t{ textContent || (\n\t\t\t\t<>\n\t\t\t\t\t{ _x( 'Preview', 'imperative verb' ) }\n\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t}\n\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t</>\n\t\t\t) }\n\t\t</Button>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AAKA,IAAAM,MAAA,GAAAN,OAAA;AAbA;AACA;AACA;;AAQA;AACA;AACA;;AAGA,SAASO,wBAAwBA,CAAEC,cAAc,EAAG;EACnD,IAAIC,MAAM,GAAG,IAAAC,uBAAc,EAC1B,IAAAX,QAAA,CAAAY,aAAA;IAAKC,SAAS,EAAC;EAAkD,GAChE,IAAAb,QAAA,CAAAY,aAAA,EAACV,WAAA,CAAAY,GAAG;IAACC,KAAK,EAAC,4BAA4B;IAACC,OAAO,EAAC;EAAW,GAC1D,IAAAhB,QAAA,CAAAY,aAAA,EAACV,WAAA,CAAAe,IAAI;IACJJ,SAAS,EAAC,OAAO;IACjBK,CAAC,EAAC,uEAAuE;IACzEC,IAAI,EAAC;EAAM,CACX,CAAC,EACF,IAAAnB,QAAA,CAAAY,aAAA,EAACV,WAAA,CAAAe,IAAI;IACJJ,SAA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