@wordpress/editor 13.16.0 → 13.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/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 +20 -24
- 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 +1 -10
- 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 +1 -7
- 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 +1 -10
- 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 +0 -9
- 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 +7 -18
- 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 +60 -129
- 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 +169 -295
- 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 +20 -18
- 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 +1 -7
- 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 +1 -4
- 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 +1 -7
- 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 +3 -6
- 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 +9 -15
- 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 +62 -84
- 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 +172 -222
- 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/entities-saved-states/hooks/use-is-dirty.js +16 -20
- package/src/components/page-attributes/order.js +15 -23
- package/src/components/page-attributes/test/order.js +46 -15
- package/src/components/post-excerpt/check.js +6 -2
- 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-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 +1 -1
- package/src/components/post-type-support-check/test/index.js +1 -1
- package/src/components/provider/index.js +3 -2
- package/src/components/unsaved-changes-warning/index.js +22 -27
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["_components","require","_data","_i18n","_coreData","_postFormat","_store","getSuggestion","supportedFormats","suggestedPostFormat","formats","POST_FORMATS","filter","format","includes","id","find","PostFormatSuggestion","suggestionText","onUpdatePostFormat","_element","createElement","Button","variant","onClick","PostFormatPanel","currentPostFormat","suggestion","useSelect","select","_select$getThemeSuppo","getEditedPostAttribute","getSuggestedPostFormat","editorStore","coreStore","getThemeSupports","editPost","useDispatch","panelBodyTitle","__","className","key","PanelBody","initialOpen","title","sprintf","caption"],"sources":["@wordpress/editor/src/components/post-publish-panel/maybe-post-format-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button, PanelBody } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { POST_FORMATS } from '../post-format';\nimport { store as editorStore } from '../../store';\n\nconst getSuggestion = ( supportedFormats, suggestedPostFormat ) => {\n\tconst formats = POST_FORMATS.filter( ( format ) =>\n\t\tsupportedFormats?.includes( format.id )\n\t);\n\treturn formats.find( ( format ) => format.id === suggestedPostFormat );\n};\n\nconst PostFormatSuggestion = ( {\n\tsuggestedPostFormat,\n\tsuggestionText,\n\tonUpdatePostFormat,\n} ) => (\n\t<Button\n\t\tvariant=\"link\"\n\t\tonClick={ () => onUpdatePostFormat( suggestedPostFormat ) }\n\t>\n\t\t{ suggestionText }\n\t</Button>\n);\n\nexport default function PostFormatPanel() {\n\tconst { currentPostFormat, suggestion } = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute, getSuggestedPostFormat } =\n\t\t\tselect( editorStore );\n\t\tconst supportedFormats =\n\t\t\tselect( coreStore ).getThemeSupports().formats ?? [];\n\t\treturn {\n\t\t\tcurrentPostFormat: getEditedPostAttribute( 'format' ),\n\t\t\tsuggestion: getSuggestion(\n\t\t\t\tsupportedFormats,\n\t\t\t\tgetSuggestedPostFormat()\n\t\t\t),\n\t\t};\n\t}, [] );\n\n\tconst { editPost } = useDispatch( editorStore );\n\n\tconst onUpdatePostFormat = ( format ) => editPost( { format } );\n\n\tconst panelBodyTitle = [\n\t\t__( 'Suggestion:' ),\n\t\t<span className=\"editor-post-publish-panel__link\" key=\"label\">\n\t\t\t{ __( 'Use a post format' ) }\n\t\t</span>,\n\t];\n\n\tif ( ! suggestion || suggestion.id === currentPostFormat ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PanelBody initialOpen={ false } title={ panelBodyTitle }>\n\t\t\t<p>\n\t\t\t\t{ __(\n\t\t\t\t\t'Your theme uses post formats to highlight different kinds of content, like images or videos. Apply a post format to see this special styling.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<PostFormatSuggestion\n\t\t\t\t\tonUpdatePostFormat={ onUpdatePostFormat }\n\t\t\t\t\tsuggestedPostFormat={ suggestion.id }\n\t\t\t\t\tsuggestionText={ sprintf(\n\t\t\t\t\t\t/* translators: %s: post format */\n\t\t\t\t\t\t__( 'Apply the \"%1$s\" format.' ),\n\t\t\t\t\t\tsuggestion.caption\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</p>\n\t\t</PanelBody>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AAKA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAZA;AACA;AACA;;AAMA;AACA;AACA;;AAIA,MAAMM,aAAa,GAAGA,CAAEC,gBAAgB,EAAEC,mBAAmB,KAAM;EAClE,MAAMC,OAAO,GAAGC,wBAAY,CAACC,MAAM,CAAIC,MAAM,IAC5CL,gBAAgB,EAAEM,QAAQ,CAAED,MAAM,CAACE,EAAG,CACvC,CAAC;EACD,OAAOL,OAAO,CAACM,IAAI,CAAIH,MAAM,IAAMA,MAAM,CAACE,EAAE,KAAKN,mBAAoB,CAAC;AACvE,CAAC;AAED,MAAMQ,oBAAoB,GAAGA,CAAE;EAC9BR,mBAAmB;EACnBS,cAAc;EACdC;AACD,CAAC,KACA,IAAAC,QAAA,CAAAC,aAAA,EAACrB,WAAA,CAAAsB,MAAM;EACNC,OAAO,EAAC,MAAM;EACdC,OAAO,EAAGA,CAAA,KAAML,kBAAkB,CAAEV,mBAAoB;AAAG,GAEzDS,cACK,CACR;AAEc,SAASO,eAAeA,CAAA,EAAG;EACzC,MAAM;IAAEC,iBAAiB;IAAEC;EAAW,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAAA,IAAAC,qBAAA;IAClE,MAAM;MAAEC,sBAAsB;MAAEC;IAAuB,CAAC,GACvDH,MAAM,CAA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,UAAU,CAACmB,OACZ;EAAG,CACH,CACC,CACO,CAAC;AAEd"}
|
|
@@ -1,28 +1,18 @@
|
|
|
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.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _element = require("@wordpress/element");
|
|
11
|
-
|
|
12
9
|
var _i18n = require("@wordpress/i18n");
|
|
13
|
-
|
|
14
10
|
var _compose = require("@wordpress/compose");
|
|
15
|
-
|
|
16
11
|
var _data = require("@wordpress/data");
|
|
17
|
-
|
|
18
12
|
var _components = require("@wordpress/components");
|
|
19
|
-
|
|
20
13
|
var _coreData = require("@wordpress/core-data");
|
|
21
|
-
|
|
22
14
|
var _flatTermSelector = _interopRequireDefault(require("../post-taxonomies/flat-term-selector"));
|
|
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
|
const TagsPanel = () => {
|
|
34
25
|
const panelBodyTitle = [(0, _i18n.__)('Suggestion:'), (0, _element.createElement)("span", {
|
|
35
26
|
className: "editor-post-publish-panel__link",
|
|
@@ -42,7 +33,6 @@ const TagsPanel = () => {
|
|
|
42
33
|
slug: 'post_tag'
|
|
43
34
|
}));
|
|
44
35
|
};
|
|
45
|
-
|
|
46
36
|
class MaybeTagsPanel extends _element.Component {
|
|
47
37
|
constructor(props) {
|
|
48
38
|
super(props);
|
|
@@ -50,6 +40,7 @@ class MaybeTagsPanel extends _element.Component {
|
|
|
50
40
|
hadTagsWhenOpeningThePanel: props.hasTags
|
|
51
41
|
};
|
|
52
42
|
}
|
|
43
|
+
|
|
53
44
|
/*
|
|
54
45
|
* We only want to show the tag panel if the post didn't have
|
|
55
46
|
* any tags when the user hit the Publish button.
|
|
@@ -60,18 +51,13 @@ class MaybeTagsPanel extends _element.Component {
|
|
|
60
51
|
* hiding this panel and keeping the user from adding
|
|
61
52
|
* more than one tag.
|
|
62
53
|
*/
|
|
63
|
-
|
|
64
|
-
|
|
65
54
|
render() {
|
|
66
55
|
if (!this.state.hadTagsWhenOpeningThePanel) {
|
|
67
56
|
return (0, _element.createElement)(TagsPanel, null);
|
|
68
57
|
}
|
|
69
|
-
|
|
70
58
|
return null;
|
|
71
59
|
}
|
|
72
|
-
|
|
73
60
|
}
|
|
74
|
-
|
|
75
61
|
var _default = (0, _compose.compose)((0, _data.withSelect)(select => {
|
|
76
62
|
const postType = select(_store.store).getCurrentPostType();
|
|
77
63
|
const tagsTaxonomy = select(_coreData.store).getTaxonomy('post_tag');
|
|
@@ -85,6 +71,5 @@ var _default = (0, _compose.compose)((0, _data.withSelect)(select => {
|
|
|
85
71
|
areTagsFetched,
|
|
86
72
|
isPostTypeSupported
|
|
87
73
|
}) => isPostTypeSupported && areTagsFetched))(MaybeTagsPanel);
|
|
88
|
-
|
|
89
74
|
exports.default = _default;
|
|
90
75
|
//# sourceMappingURL=maybe-tags-panel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["_element","require","_i18n","_compose","_data","_components","_coreData","_flatTermSelector","_interopRequireDefault","_store","TagsPanel","panelBodyTitle","__","createElement","className","key","PanelBody","initialOpen","title","default","slug","MaybeTagsPanel","Component","constructor","props","state","hadTagsWhenOpeningThePanel","hasTags","render","_default","compose","withSelect","select","postType","editorStore","getCurrentPostType","tagsTaxonomy","coreStore","getTaxonomy","tags","getEditedPostAttribute","rest_base","areTagsFetched","undefined","isPostTypeSupported","types","some","type","length","ifCondition","exports"],"sources":["@wordpress/editor/src/components/post-publish-panel/maybe-tags-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Component } from '@wordpress/element';\nimport { compose, ifCondition } from '@wordpress/compose';\nimport { withSelect } from '@wordpress/data';\nimport { PanelBody } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport FlatTermSelector from '../post-taxonomies/flat-term-selector';\nimport { store as editorStore } from '../../store';\n\nconst TagsPanel = () => {\n\tconst panelBodyTitle = [\n\t\t__( 'Suggestion:' ),\n\t\t<span className=\"editor-post-publish-panel__link\" key=\"label\">\n\t\t\t{ __( 'Add tags' ) }\n\t\t</span>,\n\t];\n\n\treturn (\n\t\t<PanelBody initialOpen={ false } title={ panelBodyTitle }>\n\t\t\t<p>\n\t\t\t\t{ __(\n\t\t\t\t\t'Tags help users and search engines navigate your site and find your content. Add a few keywords to describe your post.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<FlatTermSelector slug={ 'post_tag' } />\n\t\t</PanelBody>\n\t);\n};\n\nclass MaybeTagsPanel extends Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\t\tthis.state = {\n\t\t\thadTagsWhenOpeningThePanel: props.hasTags,\n\t\t};\n\t}\n\n\t/*\n\t * We only want to show the tag panel if the post didn't have\n\t * any tags when the user hit the Publish button.\n\t *\n\t * We can't use the prop.hasTags because it'll change to true\n\t * if the user adds a new tag within the pre-publish panel.\n\t * This would force a re-render and a new prop.hasTags check,\n\t * hiding this panel and keeping the user from adding\n\t * more than one tag.\n\t */\n\trender() {\n\t\tif ( ! this.state.hadTagsWhenOpeningThePanel ) {\n\t\t\treturn <TagsPanel />;\n\t\t}\n\n\t\treturn null;\n\t}\n}\n\nexport default compose(\n\twithSelect( ( select ) => {\n\t\tconst postType = select( editorStore ).getCurrentPostType();\n\t\tconst tagsTaxonomy = select( coreStore ).getTaxonomy( 'post_tag' );\n\t\tconst tags =\n\t\t\ttagsTaxonomy &&\n\t\t\tselect( editorStore ).getEditedPostAttribute(\n\t\t\t\ttagsTaxonomy.rest_base\n\t\t\t);\n\t\treturn {\n\t\t\tareTagsFetched: tagsTaxonomy !== undefined,\n\t\t\tisPostTypeSupported:\n\t\t\t\ttagsTaxonomy &&\n\t\t\t\ttagsTaxonomy.types.some( ( type ) => type === postType ),\n\t\t\thasTags: tags && tags.length,\n\t\t};\n\t} ),\n\tifCondition(\n\t\t( { areTagsFetched, isPostTypeSupported } ) =>\n\t\t\tisPostTypeSupported && areTagsFetched\n\t)\n)( MaybeTagsPanel );\n"],"mappings":";;;;;;;AAIA,IAAAA,QAAA,GAAAC,OAAA;AADA,IAAAC,KAAA,GAAAD,OAAA;AAEA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AAKA,IAAAM,iBAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AAdA;AACA;AACA;;AAQA;AACA;AACA;;AAIA,MAAMS,SAAS,GAAGA,CAAA,KAAM;EACvB,MAAMC,cAAc,GAAG,CACtB,IAAAC,QAAE,EAAE,aAAc,CAAC,EACnB,IAAAZ,QAAA,CAAAa,aAAA;IAAMC,SAAS,EAAC,iCAAiC;IAACC,GAAG,EAAC;EAAO,GAC1D,IAAAH,QAAE,EAAE,UAAW,CACZ,CAAC,CACP;EAED,OACC,IAAAZ,QAAA,CAAAa,aAAA,EAACR,WAAA,CAAAW,SAAS;IAACC,WAAW,EAAG,KAAO;IAACC,KAAK,EAAGP;EAAgB,GACxD,IAAAX,QAAA,CAAAa,aAAA,aACG,IAAAD,QAAE,EACH,wHACD,CACE,CAAC,EACJ,IAAAZ,QAAA,CAAAa,aAAA,EAACN,iBAAA,CAAAY,OAAgB;IAACC,IAAI,EAAG;EAAY,CAAE,CAC7B,CAAC;AAEd,CAAC;AAED,MAAMC,cAAc,SAASC,kB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
6
|
exports.default = PostFormatPanel;
|
|
7
|
-
|
|
8
7
|
var _element = require("@wordpress/element");
|
|
9
|
-
|
|
10
8
|
var _components = require("@wordpress/components");
|
|
11
|
-
|
|
12
9
|
var _data = require("@wordpress/data");
|
|
13
|
-
|
|
14
10
|
var _i18n = require("@wordpress/i18n");
|
|
15
|
-
|
|
16
11
|
var _icons = require("@wordpress/icons");
|
|
17
|
-
|
|
18
12
|
var _blockEditor = require("@wordpress/block-editor");
|
|
19
|
-
|
|
20
13
|
var _blob = require("@wordpress/blob");
|
|
21
|
-
|
|
22
14
|
var _store = require("../../store");
|
|
23
|
-
|
|
24
15
|
/**
|
|
25
16
|
* WordPress dependencies
|
|
26
17
|
*/
|
|
@@ -28,6 +19,7 @@ var _store = require("../../store");
|
|
|
28
19
|
/**
|
|
29
20
|
* Internal dependencies
|
|
30
21
|
*/
|
|
22
|
+
|
|
31
23
|
function flattenBlocks(blocks) {
|
|
32
24
|
const result = [];
|
|
33
25
|
blocks.forEach(block => {
|
|
@@ -36,7 +28,6 @@ function flattenBlocks(blocks) {
|
|
|
36
28
|
});
|
|
37
29
|
return result;
|
|
38
30
|
}
|
|
39
|
-
|
|
40
31
|
function Image(block) {
|
|
41
32
|
const {
|
|
42
33
|
selectBlock
|
|
@@ -76,7 +67,6 @@ function Image(block) {
|
|
|
76
67
|
}
|
|
77
68
|
});
|
|
78
69
|
}
|
|
79
|
-
|
|
80
70
|
function PostFormatPanel() {
|
|
81
71
|
const [isUploading, setIsUploading] = (0, _element.useState)(false);
|
|
82
72
|
const {
|
|
@@ -90,16 +80,13 @@ function PostFormatPanel() {
|
|
|
90
80
|
const {
|
|
91
81
|
updateBlockAttributes
|
|
92
82
|
} = (0, _data.useDispatch)(_blockEditor.store);
|
|
93
|
-
|
|
94
83
|
if (!mediaUpload || !externalImages.length) {
|
|
95
84
|
return null;
|
|
96
85
|
}
|
|
97
|
-
|
|
98
86
|
const panelBodyTitle = [(0, _i18n.__)('Suggestion:'), (0, _element.createElement)("span", {
|
|
99
87
|
className: "editor-post-publish-panel__link",
|
|
100
88
|
key: "label"
|
|
101
89
|
}, (0, _i18n.__)('External media'))];
|
|
102
|
-
|
|
103
90
|
function uploadImages() {
|
|
104
91
|
setIsUploading(true);
|
|
105
92
|
Promise.all(externalImages.map(image => window.fetch(image.attributes.url.includes('?') ? image.attributes.url : image.attributes.url + '?').then(response => response.blob()).then(blob => new Promise((resolve, reject) => {
|
|
@@ -109,24 +96,20 @@ function PostFormatPanel() {
|
|
|
109
96
|
if ((0, _blob.isBlobURL)(media.url)) {
|
|
110
97
|
return;
|
|
111
98
|
}
|
|
112
|
-
|
|
113
99
|
updateBlockAttributes(image.clientId, {
|
|
114
100
|
id: media.id,
|
|
115
101
|
url: media.url
|
|
116
102
|
});
|
|
117
103
|
resolve();
|
|
118
104
|
},
|
|
119
|
-
|
|
120
105
|
onError() {
|
|
121
106
|
reject();
|
|
122
107
|
}
|
|
123
|
-
|
|
124
108
|
});
|
|
125
109
|
})))).finally(() => {
|
|
126
110
|
setIsUploading(false);
|
|
127
111
|
});
|
|
128
112
|
}
|
|
129
|
-
|
|
130
113
|
return (0, _element.createElement)(_components.PanelBody, {
|
|
131
114
|
initialOpen: true,
|
|
132
115
|
title: panelBodyTitle
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["_element","require","_components","_data","_i18n","_icons","_blockEditor","_blob","_store","flattenBlocks","blocks","result","forEach","block","push","innerBlocks","Image","selectBlock","useDispatch","blockEditorStore","createElement","__unstableMotion","img","tabIndex","role","__","onClick","clientId","onKeyDown","event","key","preventDefault","alt","attributes","src","url","animate","opacity","exit","scale","style","width","height","objectFit","borderRadius","cursor","whileHover","PostFormatPanel","isUploading","setIsUploading","useState","editorBlocks","mediaUpload","useSelect","select","editorStore","getEditorBlocks","getSettings","externalImages","filter","name","id","updateBlockAttributes","length","panelBodyTitle","className","uploadImages","Promise","all","map","image","window","fetch","includes","then","response","blob","resolve","reject","filesList","onFileChange","media","isBlobURL","onError","finally","PanelBody","initialOpen","title","display","flexWrap","gap","__unstableAnimatePresence","Spinner","Button","icon","upload","variant"],"sources":["@wordpress/editor/src/components/post-publish-panel/maybe-upload-media.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tPanelBody,\n\tButton,\n\tSpinner,\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n} from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { upload } from '@wordpress/icons';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { useState } from '@wordpress/element';\nimport { isBlobURL } from '@wordpress/blob';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction flattenBlocks( blocks ) {\n\tconst result = [];\n\n\tblocks.forEach( ( block ) => {\n\t\tresult.push( block );\n\t\tresult.push( ...flattenBlocks( block.innerBlocks ) );\n\t} );\n\n\treturn result;\n}\n\nfunction Image( block ) {\n\tconst { selectBlock } = useDispatch( blockEditorStore );\n\treturn (\n\t\t<motion.img\n\t\t\ttabIndex={ 0 }\n\t\t\trole=\"button\"\n\t\t\taria-label={ __( 'Select image block.' ) }\n\t\t\tonClick={ () => {\n\t\t\t\tselectBlock( block.clientId );\n\t\t\t} }\n\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\tif ( event.key === 'Enter' || event.key === ' ' ) {\n\t\t\t\t\tselectBlock( block.clientId );\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t} }\n\t\t\tkey={ block.clientId }\n\t\t\talt={ block.attributes.alt }\n\t\t\tsrc={ block.attributes.url }\n\t\t\tanimate={ { opacity: 1 } }\n\t\t\texit={ { opacity: 0, scale: 0 } }\n\t\t\tstyle={ {\n\t\t\t\twidth: '36px',\n\t\t\t\theight: '36px',\n\t\t\t\tobjectFit: 'cover',\n\t\t\t\tborderRadius: '2px',\n\t\t\t\tcursor: 'pointer',\n\t\t\t} }\n\t\t\twhileHover={ { scale: 1.08 } }\n\t\t/>\n\t);\n}\n\nexport default function PostFormatPanel() {\n\tconst [ isUploading, setIsUploading ] = useState( false );\n\tconst { editorBlocks, mediaUpload } = useSelect(\n\t\t( select ) => ( {\n\t\t\teditorBlocks: select( editorStore ).getEditorBlocks(),\n\t\t\tmediaUpload: select( blockEditorStore ).getSettings().mediaUpload,\n\t\t} ),\n\t\t[]\n\t);\n\tconst externalImages = flattenBlocks( editorBlocks ).filter(\n\t\t( block ) =>\n\t\t\tblock.name === 'core/image' &&\n\t\t\tblock.attributes.url &&\n\t\t\t! block.attributes.id\n\t);\n\tconst { updateBlockAttributes } = useDispatch( blockEditorStore );\n\n\tif ( ! mediaUpload || ! externalImages.length ) {\n\t\treturn null;\n\t}\n\n\tconst panelBodyTitle = [\n\t\t__( 'Suggestion:' ),\n\t\t<span className=\"editor-post-publish-panel__link\" key=\"label\">\n\t\t\t{ __( 'External media' ) }\n\t\t</span>,\n\t];\n\n\tfunction uploadImages() {\n\t\tsetIsUploading( true );\n\t\tPromise.all(\n\t\t\texternalImages.map( ( image ) =>\n\t\t\t\twindow\n\t\t\t\t\t.fetch(\n\t\t\t\t\t\timage.attributes.url.includes( '?' )\n\t\t\t\t\t\t\t? image.attributes.url\n\t\t\t\t\t\t\t: image.attributes.url + '?'\n\t\t\t\t\t)\n\t\t\t\t\t.then( ( response ) => response.blob() )\n\t\t\t\t\t.then(\n\t\t\t\t\t\t( blob ) =>\n\t\t\t\t\t\t\tnew Promise( ( resolve, reject ) => {\n\t\t\t\t\t\t\t\tmediaUpload( {\n\t\t\t\t\t\t\t\t\tfilesList: [ blob ],\n\t\t\t\t\t\t\t\t\tonFileChange: ( [ media ] ) => {\n\t\t\t\t\t\t\t\t\t\tif ( isBlobURL( media.url ) ) {\n\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tupdateBlockAttributes( image.clientId, {\n\t\t\t\t\t\t\t\t\t\t\tid: media.id,\n\t\t\t\t\t\t\t\t\t\t\turl: media.url,\n\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\tresolve();\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tonError() {\n\t\t\t\t\t\t\t\t\t\treject();\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)\n\t\t\t)\n\t\t).finally( () => {\n\t\t\tsetIsUploading( false );\n\t\t} );\n\t}\n\n\treturn (\n\t\t<PanelBody initialOpen={ true } title={ panelBodyTitle }>\n\t\t\t<p>\n\t\t\t\t{ __(\n\t\t\t\t\t'There are some external images in the post which can be uploaded to the media library. Images coming from different domains may not always display correctly, load slowly for visitors, or be removed unexpectedly.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<div\n\t\t\t\tstyle={ {\n\t\t\t\t\tdisplay: 'inline-flex',\n\t\t\t\t\tflexWrap: 'wrap',\n\t\t\t\t\tgap: '8px',\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<AnimatePresence>\n\t\t\t\t\t{ externalImages.map( ( image ) => {\n\t\t\t\t\t\treturn <Image key={ image.clientId } { ...image } />;\n\t\t\t\t\t} ) }\n\t\t\t\t</AnimatePresence>\n\t\t\t\t{ isUploading ? (\n\t\t\t\t\t<Spinner />\n\t\t\t\t) : (\n\t\t\t\t\t<Button\n\t\t\t\t\t\ticon={ upload }\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\tonClick={ uploadImages }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Upload all' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</PanelBody>\n\t);\n}\n"],"mappings":";;;;;;AAcA,IAAAA,QAAA,GAAAC,OAAA;AAXA,IAAAC,WAAA,GAAAD,OAAA;AAOA,IAAAE,KAAA,GAAAF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B,GACvD,IAAAhE,QAAA,CAAAoB,aAAA,aACG,IAAAK,QAAE,EACH,qNACD,CACE,CAAC,EACJ,IAAAzB,QAAA,CAAAoB,aAAA;IACCoB,KAAK,EAAG;MACPgD,OAAO,EAAE,aAAa;MACtBC,QAAQ,EAAE,MAAM;MAChBC,GAAG,EAAE;IACN;EAAG,GAEH,IAAA1F,QAAA,CAAAoB,aAAA,EAAClB,WAAA,CAAAyF,yBAAe,QACbjC,cAAc,CAACW,GAAG,CAAIC,KAAK,IAAM;IAClC,OAAO,IAAAtE,QAAA,CAAAoB,aAAA,EAACJ,KAAK;MAACc,GAAG,EAAGwC,KAAK,CAAC3C,QAAU;MAAA,GAAM2C;IAAK,CAAI,CAAC;EACrD,CAAE,CACc,CAAC,EAChBtB,WAAW,GACZ,IAAAhD,QAAA,CAAAoB,aAAA,EAAClB,WAAA,CAAA0F,OAAO,MAAE,CAAC,GAEX,IAAA5F,QAAA,CAAAoB,aAAA,EAAClB,WAAA,CAAA2F,MAAM;IACNC,IAAI,EAAGC,aAAQ;IACfC,OAAO,EAAC,SAAS;IACjBtE,OAAO,EAAGwC;EAAc,GAEtB,IAAAzC,QAAE,EAAE,YAAa,CACZ,CAEL,CACK,CAAC;AAEd"}
|
|
@@ -1,32 +1,20 @@
|
|
|
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.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _element = require("@wordpress/element");
|
|
11
|
-
|
|
12
9
|
var _components = require("@wordpress/components");
|
|
13
|
-
|
|
14
10
|
var _i18n = require("@wordpress/i18n");
|
|
15
|
-
|
|
16
11
|
var _data = require("@wordpress/data");
|
|
17
|
-
|
|
18
12
|
var _url = require("@wordpress/url");
|
|
19
|
-
|
|
20
13
|
var _htmlEntities = require("@wordpress/html-entities");
|
|
21
|
-
|
|
22
14
|
var _compose = require("@wordpress/compose");
|
|
23
|
-
|
|
24
15
|
var _coreData = require("@wordpress/core-data");
|
|
25
|
-
|
|
26
16
|
var _label = _interopRequireDefault(require("../post-schedule/label"));
|
|
27
|
-
|
|
28
17
|
var _store = require("../../store");
|
|
29
|
-
|
|
30
18
|
/**
|
|
31
19
|
* WordPress dependencies
|
|
32
20
|
*/
|
|
@@ -34,8 +22,10 @@ var _store = require("../../store");
|
|
|
34
22
|
/**
|
|
35
23
|
* Internal dependencies
|
|
36
24
|
*/
|
|
25
|
+
|
|
37
26
|
const POSTNAME = '%postname%';
|
|
38
27
|
const PAGENAME = '%pagename%';
|
|
28
|
+
|
|
39
29
|
/**
|
|
40
30
|
* Returns URL for a future post.
|
|
41
31
|
*
|
|
@@ -48,18 +38,14 @@ const getFuturePostUrl = post => {
|
|
|
48
38
|
const {
|
|
49
39
|
slug
|
|
50
40
|
} = post;
|
|
51
|
-
|
|
52
41
|
if (post.permalink_template.includes(POSTNAME)) {
|
|
53
42
|
return post.permalink_template.replace(POSTNAME, slug);
|
|
54
43
|
}
|
|
55
|
-
|
|
56
44
|
if (post.permalink_template.includes(PAGENAME)) {
|
|
57
45
|
return post.permalink_template.replace(PAGENAME, slug);
|
|
58
46
|
}
|
|
59
|
-
|
|
60
47
|
return post.permalink_template;
|
|
61
48
|
};
|
|
62
|
-
|
|
63
49
|
function CopyButton({
|
|
64
50
|
text,
|
|
65
51
|
onCopy,
|
|
@@ -71,7 +57,6 @@ function CopyButton({
|
|
|
71
57
|
ref: ref
|
|
72
58
|
}, children);
|
|
73
59
|
}
|
|
74
|
-
|
|
75
60
|
class PostPublishPanelPostpublish extends _element.Component {
|
|
76
61
|
constructor() {
|
|
77
62
|
super(...arguments);
|
|
@@ -82,17 +67,14 @@ class PostPublishPanelPostpublish extends _element.Component {
|
|
|
82
67
|
this.onSelectInput = this.onSelectInput.bind(this);
|
|
83
68
|
this.postLink = (0, _element.createRef)();
|
|
84
69
|
}
|
|
85
|
-
|
|
86
70
|
componentDidMount() {
|
|
87
71
|
if (this.props.focusOnMount) {
|
|
88
72
|
this.postLink.current.focus();
|
|
89
73
|
}
|
|
90
74
|
}
|
|
91
|
-
|
|
92
75
|
componentWillUnmount() {
|
|
93
76
|
clearTimeout(this.dismissCopyConfirmation);
|
|
94
77
|
}
|
|
95
|
-
|
|
96
78
|
onCopy() {
|
|
97
79
|
this.setState({
|
|
98
80
|
showCopyConfirmation: true
|
|
@@ -104,11 +86,9 @@ class PostPublishPanelPostpublish extends _element.Component {
|
|
|
104
86
|
});
|
|
105
87
|
}, 4000);
|
|
106
88
|
}
|
|
107
|
-
|
|
108
89
|
onSelectInput(event) {
|
|
109
90
|
event.target.select();
|
|
110
91
|
}
|
|
111
|
-
|
|
112
92
|
render() {
|
|
113
93
|
const {
|
|
114
94
|
children,
|
|
@@ -139,8 +119,7 @@ class PostPublishPanelPostpublish extends _element.Component {
|
|
|
139
119
|
__nextHasNoMarginBottom: true,
|
|
140
120
|
className: "post-publish-panel__postpublish-post-address",
|
|
141
121
|
readOnly: true,
|
|
142
|
-
label: (0, _i18n.sprintf)(
|
|
143
|
-
/* translators: %s: post type singular name */
|
|
122
|
+
label: (0, _i18n.sprintf)( /* translators: %s: post type singular name */
|
|
144
123
|
(0, _i18n.__)('%s address'), postLabel),
|
|
145
124
|
value: (0, _url.safeDecodeURIComponent)(link),
|
|
146
125
|
onFocus: this.onSelectInput
|
|
@@ -159,9 +138,7 @@ class PostPublishPanelPostpublish extends _element.Component {
|
|
|
159
138
|
href: addLink
|
|
160
139
|
}, addNewPostLabel))), children);
|
|
161
140
|
}
|
|
162
|
-
|
|
163
141
|
}
|
|
164
|
-
|
|
165
142
|
var _default = (0, _data.withSelect)(select => {
|
|
166
143
|
const {
|
|
167
144
|
getEditedPostAttribute,
|
|
@@ -177,6 +154,5 @@ var _default = (0, _data.withSelect)(select => {
|
|
|
177
154
|
isScheduled: isCurrentPostScheduled()
|
|
178
155
|
};
|
|
179
156
|
})(PostPublishPanelPostpublish);
|
|
180
|
-
|
|
181
157
|
exports.default = _default;
|
|
182
158
|
//# sourceMappingURL=postpublish.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/post-publish-panel/postpublish.js"],"names":["POSTNAME","PAGENAME","getFuturePostUrl","post","slug","permalink_template","includes","replace","CopyButton","text","onCopy","children","ref","PostPublishPanelPostpublish","Component","constructor","arguments","state","showCopyConfirmation","bind","onSelectInput","postLink","componentDidMount","props","focusOnMount","current","focus","componentWillUnmount","clearTimeout","dismissCopyConfirmation","setState","setTimeout","event","target","select","render","isScheduled","postType","postLabel","labels","singular_name","viewPostLabel","view_item","addNewPostLabel","add_new_item","link","status","addLink","post_type","type","postPublishNonLinkHeader","title","getEditedPostAttribute","getCurrentPost","isCurrentPostScheduled","editorStore","getPostType","coreStore"],"mappings":";;;;;;;;;AAKA;;AAFA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAhBA;AACA;AACA;;AAUA;AACA;AACA;AAIA,MAAMA,QAAQ,GAAG,YAAjB;AACA,MAAMC,QAAQ,GAAG,YAAjB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMC,gBAAgB,GAAKC,IAAF,IAAY;AACpC,QAAM;AAAEC,IAAAA;AAAF,MAAWD,IAAjB;;AAEA,MAAKA,IAAI,CAACE,kBAAL,CAAwBC,QAAxB,CAAkCN,QAAlC,CAAL,EAAoD;AACnD,WAAOG,IAAI,CAACE,kBAAL,CAAwBE,OAAxB,CAAiCP,QAAjC,EAA2CI,IAA3C,CAAP;AACA;;AAED,MAAKD,IAAI,CAACE,kBAAL,CAAwBC,QAAxB,CAAkCL,QAAlC,CAAL,EAAoD;AACnD,WAAOE,IAAI,CAACE,kBAAL,CAAwBE,OAAxB,CAAiCN,QAAjC,EAA2CG,IAA3C,CAAP;AACA;;AAED,SAAOD,IAAI,CAAC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AA,KAAK,EAAG;AACP;AACA,oBAAI,YAAJ,CAFO,EAGPZ,SAHO,CAJT;AASC,MAAA,KAAK,EAAG,iCAAwBO,IAAxB,CATT;AAUC,MAAA,OAAO,EAAG,KAAKzB;AAVhB,MADD,EAcC;AAAK,MAAA,SAAS,EAAC;AAAf,OACC,4BAAC,UAAD;AAAY,MAAA,IAAI,EAAGyB,IAAnB;AAA0B,MAAA,MAAM,EAAG,KAAKnC;AAAxC,OACG,KAAKO,KAAL,CAAWC,oBAAX,GACC,cAAI,SAAJ,CADD,GAEC,cAAI,MAAJ,CAHJ,CADD,CAdD,CAJD,EA2BC;AAAK,MAAA,SAAS,EAAC;AAAf,OACG,CAAEkB,WAAF,IACD,4BAAC,kBAAD;AAAQ,MAAA,OAAO,EAAC,SAAhB;AAA0B,MAAA,IAAI,EAAGS;AAAjC,OACGJ,aADH,CAFF,EAMC,4BAAC,kBAAD;AACC,MAAA,OAAO,EAAGL,WAAW,GAAG,SAAH,GAAe,WADrC;AAEC,MAAA,IAAI,EAAGW;AAFR,OAIGJ,eAJH,CAND,CA3BD,CAPD,EAgDGhC,QAhDH,CADD;AAoDA;;AA9GkD;;eAiHrC,sBAAcuB,MAAF,IAAc;AACxC,QAAM;AAAEkB,IAAAA,sBAAF;AAA0BC,IAAAA,cAA1B;AAA0CC,IAAAA;AAA1C,MACLpB,MAAM,CAAEqB,YAAF,CADP;AAEA,QAAM;AAAEC,IAAAA;AAAF,MAAkBtB,MAAM,CAAEuB,eAAF,CAA9B;AAEA,SAAO;AACNtD,IAAAA,IAAI,EAAEkD,cAAc,EADd;AAENhB,IAAAA,QAAQ,EAAEmB,WAAW,CAAEJ,sBAAsB,CAAE,MAAF,CAAxB,CAFf;AAGNhB,IAAAA,WAAW,EAAEkB,sBAAsB;AAH7B,GAAP;AAKA,CAVc,EAUVzC,2BAVU,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { PanelBody, Button, TextControl } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Component, createRef } from '@wordpress/element';\nimport { withSelect } from '@wordpress/data';\nimport { addQueryArgs, safeDecodeURIComponent } from '@wordpress/url';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport PostScheduleLabel from '../post-schedule/label';\nimport { store as editorStore } from '../../store';\n\nconst POSTNAME = '%postname%';\nconst PAGENAME = '%pagename%';\n\n/**\n * Returns URL for a future post.\n *\n * @param {Object} post Post object.\n *\n * @return {string} PostPublish URL.\n */\n\nconst getFuturePostUrl = ( post ) => {\n\tconst { slug } = post;\n\n\tif ( post.permalink_template.includes( POSTNAME ) ) {\n\t\treturn post.permalink_template.replace( POSTNAME, slug );\n\t}\n\n\tif ( post.permalink_template.includes( PAGENAME ) ) {\n\t\treturn post.permalink_template.replace( PAGENAME, slug );\n\t}\n\n\treturn post.permalink_template;\n};\n\nfunction CopyButton( { text, onCopy, children } ) {\n\tconst ref = useCopyToClipboard( text, onCopy );\n\treturn (\n\t\t<Button variant=\"secondary\" ref={ ref }>\n\t\t\t{ children }\n\t\t</Button>\n\t);\n}\n\nclass PostPublishPanelPostpublish extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\t\tthis.state = {\n\t\t\tshowCopyConfirmation: false,\n\t\t};\n\t\tthis.onCopy = this.onCopy.bind( this );\n\t\tthis.onSelectInput = this.onSelectInput.bind( this );\n\t\tthis.postLink = createRef();\n\t}\n\n\tcomponentDidMount() {\n\t\tif ( this.props.focusOnMount ) {\n\t\t\tthis.postLink.current.focus();\n\t\t}\n\t}\n\n\tcomponentWillUnmount() {\n\t\tclearTimeout( this.dismissCopyConfirmation );\n\t}\n\n\tonCopy() {\n\t\tthis.setState( {\n\t\t\tshowCopyConfirmation: true,\n\t\t} );\n\n\t\tclearTimeout( this.dismissCopyConfirmation );\n\t\tthis.dismissCopyConfirmation = setTimeout( () => {\n\t\t\tthis.setState( {\n\t\t\t\tshowCopyConfirmation: false,\n\t\t\t} );\n\t\t}, 4000 );\n\t}\n\n\tonSelectInput( event ) {\n\t\tevent.target.select();\n\t}\n\n\trender() {\n\t\tconst { children, isScheduled, post, postType } = this.props;\n\t\tconst postLabel = postType?.labels?.singular_name;\n\t\tconst viewPostLabel = postType?.labels?.view_item;\n\t\tconst addNewPostLabel = postType?.labels?.add_new_item;\n\t\tconst link =\n\t\t\tpost.status === 'future' ? getFuturePostUrl( post ) : post.link;\n\t\tconst addLink = addQueryArgs( 'post-new.php', {\n\t\t\tpost_type: post.type,\n\t\t} );\n\n\t\tconst postPublishNonLinkHeader = isScheduled ? (\n\t\t\t<>\n\t\t\t\t{ __( 'is now scheduled. It will go live on' ) }{ ' ' }\n\t\t\t\t<PostScheduleLabel />.\n\t\t\t</>\n\t\t) : (\n\t\t\t__( 'is now live.' )\n\t\t);\n\n\t\treturn (\n\t\t\t<div className=\"post-publish-panel__postpublish\">\n\t\t\t\t<PanelBody className=\"post-publish-panel__postpublish-header\">\n\t\t\t\t\t<a ref={ this.postLink } href={ link }>\n\t\t\t\t\t\t{ decodeEntities( post.title ) || __( '(no title)' ) }\n\t\t\t\t\t</a>{ ' ' }\n\t\t\t\t\t{ postPublishNonLinkHeader }\n\t\t\t\t</PanelBody>\n\t\t\t\t<PanelBody>\n\t\t\t\t\t<p className=\"post-publish-panel__postpublish-subheader\">\n\t\t\t\t\t\t<strong>{ __( 'What’s next?' ) }</strong>\n\t\t\t\t\t</p>\n\t\t\t\t\t<div className=\"post-publish-panel__postpublish-post-address-container\">\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tclassName=\"post-publish-panel__postpublish-post-address\"\n\t\t\t\t\t\t\treadOnly\n\t\t\t\t\t\t\tlabel={ sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: post type singular name */\n\t\t\t\t\t\t\t\t__( '%s address' ),\n\t\t\t\t\t\t\t\tpostLabel\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tvalue={ safeDecodeURIComponent( link ) }\n\t\t\t\t\t\t\tonFocus={ this.onSelectInput }\n\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t<div className=\"post-publish-panel__postpublish-post-address__copy-button-wrap\">\n\t\t\t\t\t\t\t<CopyButton text={ link } onCopy={ this.onCopy }>\n\t\t\t\t\t\t\t\t{ this.state.showCopyConfirmation\n\t\t\t\t\t\t\t\t\t? __( 'Copied!' )\n\t\t\t\t\t\t\t\t\t: __( 'Copy' ) }\n\t\t\t\t\t\t\t</CopyButton>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div className=\"post-publish-panel__postpublish-buttons\">\n\t\t\t\t\t\t{ ! isScheduled && (\n\t\t\t\t\t\t\t<Button variant=\"primary\" href={ link }>\n\t\t\t\t\t\t\t\t{ viewPostLabel }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant={ isScheduled ? 'primary' : 'secondary' }\n\t\t\t\t\t\t\thref={ addLink }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ addNewPostLabel }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</div>\n\t\t\t\t</PanelBody>\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nexport default withSelect( ( select ) => {\n\tconst { getEditedPostAttribute, getCurrentPost, isCurrentPostScheduled } =\n\t\tselect( editorStore );\n\tconst { getPostType } = select( coreStore );\n\n\treturn {\n\t\tpost: getCurrentPost(),\n\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\tisScheduled: isCurrentPostScheduled(),\n\t};\n} )( PostPublishPanelPostpublish );\n"]}
|
|
1
|
+
{"version":3,"names":["_element","require","_components","_i18n","_data","_url","_htmlEntities","_compose","_coreData","_label","_interopRequireDefault","_store","POSTNAME","PAGENAME","getFuturePostUrl","post","slug","permalink_template","includes","replace","CopyButton","text","onCopy","children","ref","useCopyToClipboard","createElement","Button","variant","PostPublishPanelPostpublish","Component","constructor","arguments","state","showCopyConfirmation","bind","onSelectInput","postLink","createRef","componentDidMount","props","focusOnMount","current","focus","componentWillUnmount","clearTimeout","dismissCopyConfirmation","setState","setTimeout","event","target","select","render","isScheduled","postType","postLabel","labels","singular_name","viewPostLabel","view_item","addNewPostLabel","add_new_item","link","status","addLink","addQueryArgs","post_type","type","postPublishNonLinkHeader","Fragment","__","default","className","PanelBody","href","decodeEntities","title","TextControl","__nextHasNoMarginBottom","readOnly","label","sprintf","value","safeDecodeURIComponent","onFocus","_default","withSelect","getEditedPostAttribute","getCurrentPost","isCurrentPostScheduled","editorStore","getPostType","coreStore","exports"],"sources":["@wordpress/editor/src/components/post-publish-panel/postpublish.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { PanelBody, Button, TextControl } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Component, createRef } from '@wordpress/element';\nimport { withSelect } from '@wordpress/data';\nimport { addQueryArgs, safeDecodeURIComponent } from '@wordpress/url';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport PostScheduleLabel from '../post-schedule/label';\nimport { store as editorStore } from '../../store';\n\nconst POSTNAME = '%postname%';\nconst PAGENAME = '%pagename%';\n\n/**\n * Returns URL for a future post.\n *\n * @param {Object} post Post object.\n *\n * @return {string} PostPublish URL.\n */\n\nconst getFuturePostUrl = ( post ) => {\n\tconst { slug } = post;\n\n\tif ( post.permalink_template.includes( POSTNAME ) ) {\n\t\treturn post.permalink_template.replace( POSTNAME, slug );\n\t}\n\n\tif ( post.permalink_template.includes( PAGENAME ) ) {\n\t\treturn post.permalink_template.replace( PAGENAME, slug );\n\t}\n\n\treturn post.permalink_template;\n};\n\nfunction CopyButton( { text, onCopy, children } ) {\n\tconst ref = useCopyToClipboard( text, onCopy );\n\treturn (\n\t\t<Button variant=\"secondary\" ref={ ref }>\n\t\t\t{ children }\n\t\t</Button>\n\t);\n}\n\nclass PostPublishPanelPostpublish extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\t\tthis.state = {\n\t\t\tshowCopyConfirmation: false,\n\t\t};\n\t\tthis.onCopy = this.onCopy.bind( this );\n\t\tthis.onSelectInput = this.onSelectInput.bind( this );\n\t\tthis.postLink = createRef();\n\t}\n\n\tcomponentDidMount() {\n\t\tif ( this.props.focusOnMount ) {\n\t\t\tthis.postLink.current.focus();\n\t\t}\n\t}\n\n\tcomponentWillUnmount() {\n\t\tclearTimeout( this.dismissCopyConfirmation );\n\t}\n\n\tonCopy() {\n\t\tthis.setState( {\n\t\t\tshowCopyConfirmation: true,\n\t\t} );\n\n\t\tclearTimeout( this.dismissCopyConfirmation );\n\t\tthis.dismissCopyConfirmation = setTimeout( () => {\n\t\t\tthis.setState( {\n\t\t\t\tshowCopyConfirmation: false,\n\t\t\t} );\n\t\t}, 4000 );\n\t}\n\n\tonSelectInput( event ) {\n\t\tevent.target.select();\n\t}\n\n\trender() {\n\t\tconst { children, isScheduled, post, postType } = this.props;\n\t\tconst postLabel = postType?.labels?.singular_name;\n\t\tconst viewPostLabel = postType?.labels?.view_item;\n\t\tconst addNewPostLabel = postType?.labels?.add_new_item;\n\t\tconst link =\n\t\t\tpost.status === 'future' ? getFuturePostUrl( post ) : post.link;\n\t\tconst addLink = addQueryArgs( 'post-new.php', {\n\t\t\tpost_type: post.type,\n\t\t} );\n\n\t\tconst postPublishNonLinkHeader = isScheduled ? (\n\t\t\t<>\n\t\t\t\t{ __( 'is now scheduled. It will go live on' ) }{ ' ' }\n\t\t\t\t<PostScheduleLabel />.\n\t\t\t</>\n\t\t) : (\n\t\t\t__( 'is now live.' )\n\t\t);\n\n\t\treturn (\n\t\t\t<div className=\"post-publish-panel__postpublish\">\n\t\t\t\t<PanelBody className=\"post-publish-panel__postpublish-header\">\n\t\t\t\t\t<a ref={ this.postLink } href={ link }>\n\t\t\t\t\t\t{ decodeEntities( post.title ) || __( '(no title)' ) }\n\t\t\t\t\t</a>{ ' ' }\n\t\t\t\t\t{ postPublishNonLinkHeader }\n\t\t\t\t</PanelBody>\n\t\t\t\t<PanelBody>\n\t\t\t\t\t<p className=\"post-publish-panel__postpublish-subheader\">\n\t\t\t\t\t\t<strong>{ __( 'What’s next?' ) }</strong>\n\t\t\t\t\t</p>\n\t\t\t\t\t<div className=\"post-publish-panel__postpublish-post-address-container\">\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tclassName=\"post-publish-panel__postpublish-post-address\"\n\t\t\t\t\t\t\treadOnly\n\t\t\t\t\t\t\tlabel={ sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: post type singular name */\n\t\t\t\t\t\t\t\t__( '%s address' ),\n\t\t\t\t\t\t\t\tpostLabel\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tvalue={ safeDecodeURIComponent( link ) }\n\t\t\t\t\t\t\tonFocus={ this.onSelectInput }\n\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t<div className=\"post-publish-panel__postpublish-post-address__copy-button-wrap\">\n\t\t\t\t\t\t\t<CopyButton text={ link } onCopy={ this.onCopy }>\n\t\t\t\t\t\t\t\t{ this.state.showCopyConfirmation\n\t\t\t\t\t\t\t\t\t? __( 'Copied!' )\n\t\t\t\t\t\t\t\t\t: __( 'Copy' ) }\n\t\t\t\t\t\t\t</CopyButton>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div className=\"post-publish-panel__postpublish-buttons\">\n\t\t\t\t\t\t{ ! isScheduled && (\n\t\t\t\t\t\t\t<Button variant=\"primary\" href={ link }>\n\t\t\t\t\t\t\t\t{ viewPostLabel }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant={ isScheduled ? 'primary' : 'secondary' }\n\t\t\t\t\t\t\thref={ addLink }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ addNewPostLabel }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</div>\n\t\t\t\t</PanelBody>\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t);\n\t}\n}\n\nexport default withSelect( ( select ) => {\n\tconst { getEditedPostAttribute, getCurrentPost, isCurrentPostScheduled } =\n\t\tselect( editorStore );\n\tconst { getPostType } = select( coreStore );\n\n\treturn {\n\t\tpost: getCurrentPost(),\n\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\tisScheduled: isCurrentPostScheduled(),\n\t};\n} )( PostPublishPanelPostpublish );\n"],"mappings":";;;;;;;AAKA,IAAAA,QAAA,GAAAC,OAAA;AAFA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAEA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AAKA,IAAAQ,MAAA,GAAAC,sBAAA,CAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AAhBA;AACA;AACA;;AAUA;AACA;AACA;;AAIA,MAAMW,QAAQ,GAAG,YAAY;AAC7B,MAAMC,QAAQ,GAAG,YAAY;;AAE7B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMC,gBAAgB,GAAKC,IAAI,IAAM;EACpC,MAAM;IAAEC;EAAK,CAAC,GAAGD,IAAI;EAErB,IAAKA,IAAI,CAACE,kBAAkB,CAACC,QAAQ,CAAEN,QAAS,CAAC,EAAG;IACnD,OAAOG,IAAI,CAACE,kBAAkB,CAACE,OAAO,CAAEP,QAAQ,EAAEI,IAAK,CAAC;EACzD;EAEA,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AAA,CAAA0B,aAAA,EAACxB,WAAA,CAAAyB,MAAM;MAACC,OAAO,EAAC,SAAS;MAAC8C,IAAI,EAAGZ;IAAM,GACpCJ,aACK,CACR,EACD,IAAA1D,QAAA,CAAA0B,aAAA,EAACxB,WAAA,CAAAyB,MAAM;MACNC,OAAO,EAAGyB,WAAW,GAAG,SAAS,GAAG,WAAa;MACjDqB,IAAI,EAAGV;IAAS,GAEdJ,eACK,CACJ,CACK,CAAC,EACVrC,QACE,CAAC;EAER;AACD;AAAC,IAAA8D,QAAA,GAEc,IAAAC,gBAAU,EAAInC,MAAM,IAAM;EACxC,MAAM;IAAEoC,sBAAsB;IAAEC,cAAc;IAAEC;EAAuB,CAAC,GACvEtC,MAAM,CAAEuC,YAAY,CAAC;EACtB,MAAM;IAAEC;EAAY,CAAC,GAAGxC,MAAM,CAAEyC,eAAU,CAAC;EAE3C,OAAO;IACN7E,IAAI,EAAEyE,cAAc,CAAC,CAAC;IACtBlC,QAAQ,EAAEqC,WAAW,CAAEJ,sBAAsB,CAAE,MAAO,CAAE,CAAC;IACzDlC,WAAW,EAAEoC,sBAAsB,CAAC;EACrC,CAAC;AACF,CAAE,CAAC,CAAE5D,2BAA4B,CAAC;AAAAgE,OAAA,CAAAtB,OAAA,GAAAc,QAAA"}
|
|
@@ -1,46 +1,27 @@
|
|
|
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.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _element = require("@wordpress/element");
|
|
11
|
-
|
|
12
9
|
var _i18n = require("@wordpress/i18n");
|
|
13
|
-
|
|
14
10
|
var _components = require("@wordpress/components");
|
|
15
|
-
|
|
16
11
|
var _data = require("@wordpress/data");
|
|
17
|
-
|
|
18
12
|
var _icons = require("@wordpress/icons");
|
|
19
|
-
|
|
20
13
|
var _url = require("@wordpress/url");
|
|
21
|
-
|
|
22
14
|
var _coreData = require("@wordpress/core-data");
|
|
23
|
-
|
|
24
15
|
var _htmlEntities = require("@wordpress/html-entities");
|
|
25
|
-
|
|
26
16
|
var _postVisibility = _interopRequireDefault(require("../post-visibility"));
|
|
27
|
-
|
|
28
17
|
var _label = _interopRequireDefault(require("../post-visibility/label"));
|
|
29
|
-
|
|
30
18
|
var _postSchedule = _interopRequireDefault(require("../post-schedule"));
|
|
31
|
-
|
|
32
19
|
var _label2 = _interopRequireDefault(require("../post-schedule/label"));
|
|
33
|
-
|
|
34
20
|
var _maybeTagsPanel = _interopRequireDefault(require("./maybe-tags-panel"));
|
|
35
|
-
|
|
36
21
|
var _maybePostFormatPanel = _interopRequireDefault(require("./maybe-post-format-panel"));
|
|
37
|
-
|
|
38
22
|
var _store = require("../../store");
|
|
39
|
-
|
|
40
23
|
var _maybeCategoryPanel = _interopRequireDefault(require("./maybe-category-panel"));
|
|
41
|
-
|
|
42
24
|
var _maybeUploadMedia = _interopRequireDefault(require("./maybe-upload-media"));
|
|
43
|
-
|
|
44
25
|
/**
|
|
45
26
|
* WordPress dependencies
|
|
46
27
|
*/
|
|
@@ -48,6 +29,7 @@ var _maybeUploadMedia = _interopRequireDefault(require("./maybe-upload-media"));
|
|
|
48
29
|
/**
|
|
49
30
|
* Internal dependencies
|
|
50
31
|
*/
|
|
32
|
+
|
|
51
33
|
function PostPublishPanelPrepublish({
|
|
52
34
|
children
|
|
53
35
|
}) {
|
|
@@ -60,7 +42,6 @@ function PostPublishPanelPrepublish({
|
|
|
60
42
|
siteHome
|
|
61
43
|
} = (0, _data.useSelect)(select => {
|
|
62
44
|
var _getCurrentPost$_link;
|
|
63
|
-
|
|
64
45
|
const {
|
|
65
46
|
getCurrentPost,
|
|
66
47
|
isEditedPostBeingScheduled
|
|
@@ -84,7 +65,6 @@ function PostPublishPanelPrepublish({
|
|
|
84
65
|
size: "36px",
|
|
85
66
|
icon: _icons.wordpress
|
|
86
67
|
});
|
|
87
|
-
|
|
88
68
|
if (siteIconUrl) {
|
|
89
69
|
siteIcon = (0, _element.createElement)("img", {
|
|
90
70
|
alt: (0, _i18n.__)('Site Icon'),
|
|
@@ -92,13 +72,10 @@ function PostPublishPanelPrepublish({
|
|
|
92
72
|
src: siteIconUrl
|
|
93
73
|
});
|
|
94
74
|
}
|
|
95
|
-
|
|
96
75
|
if (isRequestingSiteIcon) {
|
|
97
76
|
siteIcon = null;
|
|
98
77
|
}
|
|
99
|
-
|
|
100
78
|
let prePublishTitle, prePublishBodyText;
|
|
101
|
-
|
|
102
79
|
if (!hasPublishAction) {
|
|
103
80
|
prePublishTitle = (0, _i18n.__)('Are you ready to submit for review?');
|
|
104
81
|
prePublishBodyText = (0, _i18n.__)('When you’re ready, submit your work for review, and an Editor will be able to approve it for you.');
|
|
@@ -109,7 +86,6 @@ function PostPublishPanelPrepublish({
|
|
|
109
86
|
prePublishTitle = (0, _i18n.__)('Are you ready to publish?');
|
|
110
87
|
prePublishBodyText = (0, _i18n.__)('Double-check your settings before publishing.');
|
|
111
88
|
}
|
|
112
|
-
|
|
113
89
|
return (0, _element.createElement)("div", {
|
|
114
90
|
className: "editor-post-publish-panel__prepublish"
|
|
115
91
|
}, (0, _element.createElement)("div", null, (0, _element.createElement)("strong", null, prePublishTitle)), (0, _element.createElement)("p", null, prePublishBodyText), (0, _element.createElement)("div", {
|
|
@@ -134,7 +110,6 @@ function PostPublishPanelPrepublish({
|
|
|
134
110
|
}, (0, _element.createElement)(_label2.default, null))]
|
|
135
111
|
}, (0, _element.createElement)(_postSchedule.default, null))), (0, _element.createElement)(_maybePostFormatPanel.default, null), (0, _element.createElement)(_maybeTagsPanel.default, null), (0, _element.createElement)(_maybeCategoryPanel.default, null), children);
|
|
136
112
|
}
|
|
137
|
-
|
|
138
113
|
var _default = PostPublishPanelPrepublish;
|
|
139
114
|
exports.default = _default;
|
|
140
115
|
//# sourceMappingURL=prepublish.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["_i18n","require","_components","_data","_icons","_url","_coreData","_htmlEntities","_postVisibility","_interopRequireDefault","_label","_postSchedule","_label2","_maybeTagsPanel","_maybePostFormatPanel","_store","_maybeCategoryPanel","_maybeUploadMedia","PostPublishPanelPrepublish","children","isBeingScheduled","isRequestingSiteIcon","hasPublishAction","siteIconUrl","siteTitle","siteHome","useSelect","select","_getCurrentPost$_link","getCurrentPost","isEditedPostBeingScheduled","editorStore","getEntityRecord","isResolving","coreStore","siteData","undefined","_links","site_icon_url","name","home","filterURLForDisplay","siteIcon","_element","createElement","Icon","className","size","icon","wordpress","alt","__","src","prePublishTitle","prePublishBodyText","decodeEntities","default","Fragment","PanelBody","initialOpen","title","key","_default","exports"],"sources":["@wordpress/editor/src/components/post-publish-panel/prepublish.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Icon, PanelBody } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { wordpress } from '@wordpress/icons';\nimport { filterURLForDisplay } from '@wordpress/url';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport PostVisibility from '../post-visibility';\nimport PostVisibilityLabel from '../post-visibility/label';\nimport PostSchedule from '../post-schedule';\nimport PostScheduleLabel from '../post-schedule/label';\nimport MaybeTagsPanel from './maybe-tags-panel';\nimport MaybePostFormatPanel from './maybe-post-format-panel';\nimport { store as editorStore } from '../../store';\nimport MaybeCategoryPanel from './maybe-category-panel';\nimport MaybeUploadMedia from './maybe-upload-media';\n\nfunction PostPublishPanelPrepublish( { children } ) {\n\tconst {\n\t\tisBeingScheduled,\n\t\tisRequestingSiteIcon,\n\t\thasPublishAction,\n\t\tsiteIconUrl,\n\t\tsiteTitle,\n\t\tsiteHome,\n\t} = useSelect( ( select ) => {\n\t\tconst { getCurrentPost, isEditedPostBeingScheduled } =\n\t\t\tselect( editorStore );\n\t\tconst { getEntityRecord, isResolving } = select( coreStore );\n\t\tconst siteData =\n\t\t\tgetEntityRecord( 'root', '__unstableBase', undefined ) || {};\n\n\t\treturn {\n\t\t\thasPublishAction:\n\t\t\t\tgetCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\tisBeingScheduled: isEditedPostBeingScheduled(),\n\t\t\tisRequestingSiteIcon: isResolving( 'getEntityRecord', [\n\t\t\t\t'root',\n\t\t\t\t'__unstableBase',\n\t\t\t\tundefined,\n\t\t\t] ),\n\t\t\tsiteIconUrl: siteData.site_icon_url,\n\t\t\tsiteTitle: siteData.name,\n\t\t\tsiteHome: siteData.home && filterURLForDisplay( siteData.home ),\n\t\t};\n\t}, [] );\n\n\tlet siteIcon = (\n\t\t<Icon className=\"components-site-icon\" size=\"36px\" icon={ wordpress } />\n\t);\n\n\tif ( siteIconUrl ) {\n\t\tsiteIcon = (\n\t\t\t<img\n\t\t\t\talt={ __( 'Site Icon' ) }\n\t\t\t\tclassName=\"components-site-icon\"\n\t\t\t\tsrc={ siteIconUrl }\n\t\t\t/>\n\t\t);\n\t}\n\n\tif ( isRequestingSiteIcon ) {\n\t\tsiteIcon = null;\n\t}\n\n\tlet prePublishTitle, prePublishBodyText;\n\n\tif ( ! hasPublishAction ) {\n\t\tprePublishTitle = __( 'Are you ready to submit for review?' );\n\t\tprePublishBodyText = __(\n\t\t\t'When you’re ready, submit your work for review, and an Editor will be able to approve it for you.'\n\t\t);\n\t} else if ( isBeingScheduled ) {\n\t\tprePublishTitle = __( 'Are you ready to schedule?' );\n\t\tprePublishBodyText = __(\n\t\t\t'Your work will be published at the specified date and time.'\n\t\t);\n\t} else {\n\t\tprePublishTitle = __( 'Are you ready to publish?' );\n\t\tprePublishBodyText = __(\n\t\t\t'Double-check your settings before publishing.'\n\t\t);\n\t}\n\n\treturn (\n\t\t<div className=\"editor-post-publish-panel__prepublish\">\n\t\t\t<div>\n\t\t\t\t<strong>{ prePublishTitle }</strong>\n\t\t\t</div>\n\t\t\t<p>{ prePublishBodyText }</p>\n\t\t\t<div className=\"components-site-card\">\n\t\t\t\t{ siteIcon }\n\t\t\t\t<div className=\"components-site-info\">\n\t\t\t\t\t<span className=\"components-site-name\">\n\t\t\t\t\t\t{ decodeEntities( siteTitle ) || __( '(Untitled)' ) }\n\t\t\t\t\t</span>\n\t\t\t\t\t<span className=\"components-site-home\">{ siteHome }</span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<MaybeUploadMedia />\n\t\t\t{ hasPublishAction && (\n\t\t\t\t<>\n\t\t\t\t\t<PanelBody\n\t\t\t\t\t\tinitialOpen={ false }\n\t\t\t\t\t\ttitle={ [\n\t\t\t\t\t\t\t__( 'Visibility:' ),\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tclassName=\"editor-post-publish-panel__link\"\n\t\t\t\t\t\t\t\tkey=\"label\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<PostVisibilityLabel />\n\t\t\t\t\t\t\t</span>,\n\t\t\t\t\t\t] }\n\t\t\t\t\t>\n\t\t\t\t\t\t<PostVisibility />\n\t\t\t\t\t</PanelBody>\n\t\t\t\t\t<PanelBody\n\t\t\t\t\t\tinitialOpen={ false }\n\t\t\t\t\t\ttitle={ [\n\t\t\t\t\t\t\t__( 'Publish:' ),\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tclassName=\"editor-post-publish-panel__link\"\n\t\t\t\t\t\t\t\tkey=\"label\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<PostScheduleLabel />\n\t\t\t\t\t\t\t</span>,\n\t\t\t\t\t\t] }\n\t\t\t\t\t>\n\t\t\t\t\t\t<PostSchedule />\n\t\t\t\t\t</PanelBody>\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t<MaybePostFormatPanel />\n\t\t\t<MaybeTagsPanel />\n\t\t\t<MaybeCategoryPanel />\n\t\t\t{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