@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
package/build/store/actions.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
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
|
});
|
|
@@ -24,29 +23,17 @@ exports.updateBlockListSettings = exports.updateBlockAttributes = exports.update
|
|
|
24
23
|
exports.updateEditorSettings = updateEditorSettings;
|
|
25
24
|
exports.updatePost = updatePost;
|
|
26
25
|
exports.updatePostLock = updatePostLock;
|
|
27
|
-
|
|
28
26
|
var _apiFetch = _interopRequireDefault(require("@wordpress/api-fetch"));
|
|
29
|
-
|
|
30
27
|
var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
|
|
31
|
-
|
|
32
28
|
var _blocks = require("@wordpress/blocks");
|
|
33
|
-
|
|
34
29
|
var _notices = require("@wordpress/notices");
|
|
35
|
-
|
|
36
30
|
var _coreData = require("@wordpress/core-data");
|
|
37
|
-
|
|
38
31
|
var _blockEditor = require("@wordpress/block-editor");
|
|
39
|
-
|
|
40
32
|
var _hooks = require("@wordpress/hooks");
|
|
41
|
-
|
|
42
33
|
var _preferences = require("@wordpress/preferences");
|
|
43
|
-
|
|
44
34
|
var _constants = require("./constants");
|
|
45
|
-
|
|
46
35
|
var _localAutosave = require("./local-autosave");
|
|
47
|
-
|
|
48
36
|
var _noticeBuilder = require("./utils/notice-builder");
|
|
49
|
-
|
|
50
37
|
/**
|
|
51
38
|
* WordPress dependencies
|
|
52
39
|
*/
|
|
@@ -66,60 +53,52 @@ var _noticeBuilder = require("./utils/notice-builder");
|
|
|
66
53
|
const setupEditor = (post, edits, template) => ({
|
|
67
54
|
dispatch
|
|
68
55
|
}) => {
|
|
69
|
-
dispatch.setupEditorState(post);
|
|
70
|
-
|
|
56
|
+
dispatch.setupEditorState(post);
|
|
57
|
+
// Apply a template for new posts only, if exists.
|
|
71
58
|
const isNewPost = post.status === 'auto-draft';
|
|
72
|
-
|
|
73
59
|
if (isNewPost && template) {
|
|
74
60
|
// In order to ensure maximum of a single parse during setup, edits are
|
|
75
61
|
// included as part of editor setup action. Assume edited content as
|
|
76
62
|
// canonical if provided, falling back to post.
|
|
77
63
|
let content;
|
|
78
|
-
|
|
79
64
|
if ('content' in edits) {
|
|
80
65
|
content = edits.content;
|
|
81
66
|
} else {
|
|
82
67
|
content = post.content.raw;
|
|
83
68
|
}
|
|
84
|
-
|
|
85
69
|
let blocks = (0, _blocks.parse)(content);
|
|
86
70
|
blocks = (0, _blocks.synchronizeBlocksWithTemplate)(blocks, template);
|
|
87
71
|
dispatch.resetEditorBlocks(blocks, {
|
|
88
72
|
__unstableShouldCreateUndoLevel: false
|
|
89
73
|
});
|
|
90
74
|
}
|
|
91
|
-
|
|
92
75
|
if (edits && Object.values(edits).some(([key, edit]) => {
|
|
93
76
|
var _post$key$raw;
|
|
94
|
-
|
|
95
77
|
return edit !== ((_post$key$raw = post[key]?.raw) !== null && _post$key$raw !== void 0 ? _post$key$raw : post[key]);
|
|
96
78
|
})) {
|
|
97
79
|
dispatch.editPost(edits);
|
|
98
80
|
}
|
|
99
81
|
};
|
|
82
|
+
|
|
100
83
|
/**
|
|
101
84
|
* Returns an action object signalling that the editor is being destroyed and
|
|
102
85
|
* that any necessary state or side-effect cleanup should occur.
|
|
103
86
|
*
|
|
104
87
|
* @return {Object} Action object.
|
|
105
88
|
*/
|
|
106
|
-
|
|
107
|
-
|
|
108
89
|
exports.setupEditor = setupEditor;
|
|
109
|
-
|
|
110
90
|
function __experimentalTearDownEditor() {
|
|
111
91
|
return {
|
|
112
92
|
type: 'TEAR_DOWN_EDITOR'
|
|
113
93
|
};
|
|
114
94
|
}
|
|
95
|
+
|
|
115
96
|
/**
|
|
116
97
|
* Returns an action object used in signalling that the latest version of the
|
|
117
98
|
* post has been received, either by initialization or save.
|
|
118
99
|
*
|
|
119
100
|
* @deprecated Since WordPress 6.0.
|
|
120
101
|
*/
|
|
121
|
-
|
|
122
|
-
|
|
123
102
|
function resetPost() {
|
|
124
103
|
(0, _deprecated.default)("wp.data.dispatch( 'core/editor' ).resetPost", {
|
|
125
104
|
since: '6.0',
|
|
@@ -130,6 +109,7 @@ function resetPost() {
|
|
|
130
109
|
type: 'DO_NOTHING'
|
|
131
110
|
};
|
|
132
111
|
}
|
|
112
|
+
|
|
133
113
|
/**
|
|
134
114
|
* Returns an action object used in signalling that a patch of updates for the
|
|
135
115
|
* latest version of the post have been received.
|
|
@@ -137,8 +117,6 @@ function resetPost() {
|
|
|
137
117
|
* @return {Object} Action object.
|
|
138
118
|
* @deprecated since Gutenberg 9.7.0.
|
|
139
119
|
*/
|
|
140
|
-
|
|
141
|
-
|
|
142
120
|
function updatePost() {
|
|
143
121
|
(0, _deprecated.default)("wp.data.dispatch( 'core/editor' ).updatePost", {
|
|
144
122
|
since: '5.7',
|
|
@@ -148,6 +126,7 @@ function updatePost() {
|
|
|
148
126
|
type: 'DO_NOTHING'
|
|
149
127
|
};
|
|
150
128
|
}
|
|
129
|
+
|
|
151
130
|
/**
|
|
152
131
|
* Returns an action object used to setup the editor state when first opening
|
|
153
132
|
* an editor.
|
|
@@ -156,14 +135,13 @@ function updatePost() {
|
|
|
156
135
|
*
|
|
157
136
|
* @return {Object} Action object.
|
|
158
137
|
*/
|
|
159
|
-
|
|
160
|
-
|
|
161
138
|
function setupEditorState(post) {
|
|
162
139
|
return {
|
|
163
140
|
type: 'SETUP_EDITOR_STATE',
|
|
164
141
|
post
|
|
165
142
|
};
|
|
166
143
|
}
|
|
144
|
+
|
|
167
145
|
/**
|
|
168
146
|
* Returns an action object used in signalling that attributes of the post have
|
|
169
147
|
* been edited.
|
|
@@ -171,8 +149,6 @@ function setupEditorState(post) {
|
|
|
171
149
|
* @param {Object} edits Post attributes to edit.
|
|
172
150
|
* @param {Object} options Options for the edit.
|
|
173
151
|
*/
|
|
174
|
-
|
|
175
|
-
|
|
176
152
|
const editPost = (edits, options) => ({
|
|
177
153
|
select,
|
|
178
154
|
registry
|
|
@@ -183,15 +159,13 @@ const editPost = (edits, options) => ({
|
|
|
183
159
|
} = select.getCurrentPost();
|
|
184
160
|
registry.dispatch(_coreData.store).editEntityRecord('postType', type, id, edits, options);
|
|
185
161
|
};
|
|
162
|
+
|
|
186
163
|
/**
|
|
187
164
|
* Action for saving the current post in the editor.
|
|
188
165
|
*
|
|
189
166
|
* @param {Object} options
|
|
190
167
|
*/
|
|
191
|
-
|
|
192
|
-
|
|
193
168
|
exports.editPost = editPost;
|
|
194
|
-
|
|
195
169
|
const savePost = (options = {}) => async ({
|
|
196
170
|
select,
|
|
197
171
|
dispatch,
|
|
@@ -200,9 +174,7 @@ const savePost = (options = {}) => async ({
|
|
|
200
174
|
if (!select.isEditedPostSaveable()) {
|
|
201
175
|
return;
|
|
202
176
|
}
|
|
203
|
-
|
|
204
177
|
const content = select.getEditedPostContent();
|
|
205
|
-
|
|
206
178
|
if (!options.isAutosave) {
|
|
207
179
|
dispatch.editPost({
|
|
208
180
|
content
|
|
@@ -210,7 +182,6 @@ const savePost = (options = {}) => async ({
|
|
|
210
182
|
undoIgnore: true
|
|
211
183
|
});
|
|
212
184
|
}
|
|
213
|
-
|
|
214
185
|
const previousRecord = select.getCurrentPost();
|
|
215
186
|
const edits = {
|
|
216
187
|
id: previousRecord.id,
|
|
@@ -223,25 +194,21 @@ const savePost = (options = {}) => async ({
|
|
|
223
194
|
});
|
|
224
195
|
await registry.dispatch(_coreData.store).saveEntityRecord('postType', previousRecord.type, edits, options);
|
|
225
196
|
let error = registry.select(_coreData.store).getLastEntitySaveError('postType', previousRecord.type, previousRecord.id);
|
|
226
|
-
|
|
227
197
|
if (!error) {
|
|
228
198
|
await (0, _hooks.applyFilters)('editor.__unstableSavePost', Promise.resolve(), options).catch(err => {
|
|
229
199
|
error = err;
|
|
230
200
|
});
|
|
231
201
|
}
|
|
232
|
-
|
|
233
202
|
dispatch({
|
|
234
203
|
type: 'REQUEST_POST_UPDATE_FINISH',
|
|
235
204
|
options
|
|
236
205
|
});
|
|
237
|
-
|
|
238
206
|
if (error) {
|
|
239
207
|
const args = (0, _noticeBuilder.getNotificationArgumentsForSaveFail)({
|
|
240
208
|
post: previousRecord,
|
|
241
209
|
edits,
|
|
242
210
|
error
|
|
243
211
|
});
|
|
244
|
-
|
|
245
212
|
if (args.length) {
|
|
246
213
|
registry.dispatch(_notices.store).createErrorNotice(...args);
|
|
247
214
|
}
|
|
@@ -253,27 +220,23 @@ const savePost = (options = {}) => async ({
|
|
|
253
220
|
postType: await registry.resolveSelect(_coreData.store).getPostType(updatedRecord.type),
|
|
254
221
|
options
|
|
255
222
|
});
|
|
256
|
-
|
|
257
223
|
if (args.length) {
|
|
258
224
|
registry.dispatch(_notices.store).createSuccessNotice(...args);
|
|
259
|
-
}
|
|
225
|
+
}
|
|
226
|
+
// Make sure that any edits after saving create an undo level and are
|
|
260
227
|
// considered for change detection.
|
|
261
|
-
|
|
262
|
-
|
|
263
228
|
if (!options.isAutosave) {
|
|
264
229
|
registry.dispatch(_blockEditor.store).__unstableMarkLastChangeAsPersistent();
|
|
265
230
|
}
|
|
266
231
|
}
|
|
267
232
|
};
|
|
233
|
+
|
|
268
234
|
/**
|
|
269
235
|
* Action for refreshing the current post.
|
|
270
236
|
*
|
|
271
237
|
* @deprecated Since WordPress 6.0.
|
|
272
238
|
*/
|
|
273
|
-
|
|
274
|
-
|
|
275
239
|
exports.savePost = savePost;
|
|
276
|
-
|
|
277
240
|
function refreshPost() {
|
|
278
241
|
(0, _deprecated.default)("wp.data.dispatch( 'core/editor' ).refreshPost", {
|
|
279
242
|
since: '6.0',
|
|
@@ -284,11 +247,10 @@ function refreshPost() {
|
|
|
284
247
|
type: 'DO_NOTHING'
|
|
285
248
|
};
|
|
286
249
|
}
|
|
250
|
+
|
|
287
251
|
/**
|
|
288
252
|
* Action for trashing the current post in the editor.
|
|
289
253
|
*/
|
|
290
|
-
|
|
291
|
-
|
|
292
254
|
const trashPost = () => async ({
|
|
293
255
|
select,
|
|
294
256
|
dispatch,
|
|
@@ -304,7 +266,6 @@ const trashPost = () => async ({
|
|
|
304
266
|
dispatch({
|
|
305
267
|
type: 'REQUEST_POST_DELETE_START'
|
|
306
268
|
});
|
|
307
|
-
|
|
308
269
|
try {
|
|
309
270
|
const post = select.getCurrentPost();
|
|
310
271
|
await (0, _apiFetch.default)({
|
|
@@ -317,11 +278,11 @@ const trashPost = () => async ({
|
|
|
317
278
|
error
|
|
318
279
|
}));
|
|
319
280
|
}
|
|
320
|
-
|
|
321
281
|
dispatch({
|
|
322
282
|
type: 'REQUEST_POST_DELETE_FINISH'
|
|
323
283
|
});
|
|
324
284
|
};
|
|
285
|
+
|
|
325
286
|
/**
|
|
326
287
|
* Action that autosaves the current post. This
|
|
327
288
|
* includes server-side autosaving (default) and client-side (a.k.a. local)
|
|
@@ -330,10 +291,7 @@ const trashPost = () => async ({
|
|
|
330
291
|
*
|
|
331
292
|
* @param {Object?} options Extra flags to identify the autosave.
|
|
332
293
|
*/
|
|
333
|
-
|
|
334
|
-
|
|
335
294
|
exports.trashPost = trashPost;
|
|
336
|
-
|
|
337
295
|
const autosave = ({
|
|
338
296
|
local = false,
|
|
339
297
|
...options
|
|
@@ -355,9 +313,7 @@ const autosave = ({
|
|
|
355
313
|
});
|
|
356
314
|
}
|
|
357
315
|
};
|
|
358
|
-
|
|
359
316
|
exports.autosave = autosave;
|
|
360
|
-
|
|
361
317
|
const __unstableSaveForPreview = ({
|
|
362
318
|
forceIsAutosaveable
|
|
363
319
|
} = {}) => async ({
|
|
@@ -366,7 +322,6 @@ const __unstableSaveForPreview = ({
|
|
|
366
322
|
}) => {
|
|
367
323
|
if ((forceIsAutosaveable || select.isEditedPostAutosaveable()) && !select.isPostLocked()) {
|
|
368
324
|
const isDraft = ['draft', 'auto-draft'].includes(select.getEditedPostAttribute('status'));
|
|
369
|
-
|
|
370
325
|
if (isDraft) {
|
|
371
326
|
await dispatch.savePost({
|
|
372
327
|
isPreview: true
|
|
@@ -377,42 +332,35 @@ const __unstableSaveForPreview = ({
|
|
|
377
332
|
});
|
|
378
333
|
}
|
|
379
334
|
}
|
|
380
|
-
|
|
381
335
|
return select.getEditedPostPreviewLink();
|
|
382
336
|
};
|
|
337
|
+
|
|
383
338
|
/**
|
|
384
339
|
* Action that restores last popped state in undo history.
|
|
385
340
|
*/
|
|
386
|
-
|
|
387
|
-
|
|
388
341
|
exports.__unstableSaveForPreview = __unstableSaveForPreview;
|
|
389
|
-
|
|
390
342
|
const redo = () => ({
|
|
391
343
|
registry
|
|
392
344
|
}) => {
|
|
393
345
|
registry.dispatch(_coreData.store).redo();
|
|
394
346
|
};
|
|
347
|
+
|
|
395
348
|
/**
|
|
396
349
|
* Action that pops a record from undo history and undoes the edit.
|
|
397
350
|
*/
|
|
398
|
-
|
|
399
|
-
|
|
400
351
|
exports.redo = redo;
|
|
401
|
-
|
|
402
352
|
const undo = () => ({
|
|
403
353
|
registry
|
|
404
354
|
}) => {
|
|
405
355
|
registry.dispatch(_coreData.store).undo();
|
|
406
356
|
};
|
|
357
|
+
|
|
407
358
|
/**
|
|
408
359
|
* Action that creates an undo history record.
|
|
409
360
|
*
|
|
410
361
|
* @deprecated Since WordPress 6.0
|
|
411
362
|
*/
|
|
412
|
-
|
|
413
|
-
|
|
414
363
|
exports.undo = undo;
|
|
415
|
-
|
|
416
364
|
function createUndoLevel() {
|
|
417
365
|
(0, _deprecated.default)("wp.data.dispatch( 'core/editor' ).createUndoLevel", {
|
|
418
366
|
since: '6.0',
|
|
@@ -423,42 +371,39 @@ function createUndoLevel() {
|
|
|
423
371
|
type: 'DO_NOTHING'
|
|
424
372
|
};
|
|
425
373
|
}
|
|
374
|
+
|
|
426
375
|
/**
|
|
427
376
|
* Action that locks the editor.
|
|
428
377
|
*
|
|
429
378
|
* @param {Object} lock Details about the post lock status, user, and nonce.
|
|
430
379
|
* @return {Object} Action object.
|
|
431
380
|
*/
|
|
432
|
-
|
|
433
|
-
|
|
434
381
|
function updatePostLock(lock) {
|
|
435
382
|
return {
|
|
436
383
|
type: 'UPDATE_POST_LOCK',
|
|
437
384
|
lock
|
|
438
385
|
};
|
|
439
386
|
}
|
|
387
|
+
|
|
440
388
|
/**
|
|
441
389
|
* Enable the publish sidebar.
|
|
442
390
|
*/
|
|
443
|
-
|
|
444
|
-
|
|
445
391
|
const enablePublishSidebar = () => ({
|
|
446
392
|
registry
|
|
447
393
|
}) => {
|
|
448
394
|
registry.dispatch(_preferences.store).set('core/edit-post', 'isPublishSidebarEnabled', true);
|
|
449
395
|
};
|
|
396
|
+
|
|
450
397
|
/**
|
|
451
398
|
* Disables the publish sidebar.
|
|
452
399
|
*/
|
|
453
|
-
|
|
454
|
-
|
|
455
400
|
exports.enablePublishSidebar = enablePublishSidebar;
|
|
456
|
-
|
|
457
401
|
const disablePublishSidebar = () => ({
|
|
458
402
|
registry
|
|
459
403
|
}) => {
|
|
460
404
|
registry.dispatch(_preferences.store).set('core/edit-post', 'isPublishSidebarEnabled', false);
|
|
461
405
|
};
|
|
406
|
+
|
|
462
407
|
/**
|
|
463
408
|
* Action that locks post saving.
|
|
464
409
|
*
|
|
@@ -502,16 +447,14 @@ const disablePublishSidebar = () => ({
|
|
|
502
447
|
*
|
|
503
448
|
* @return {Object} Action object
|
|
504
449
|
*/
|
|
505
|
-
|
|
506
|
-
|
|
507
450
|
exports.disablePublishSidebar = disablePublishSidebar;
|
|
508
|
-
|
|
509
451
|
function lockPostSaving(lockName) {
|
|
510
452
|
return {
|
|
511
453
|
type: 'LOCK_POST_SAVING',
|
|
512
454
|
lockName
|
|
513
455
|
};
|
|
514
456
|
}
|
|
457
|
+
|
|
515
458
|
/**
|
|
516
459
|
* Action that unlocks post saving.
|
|
517
460
|
*
|
|
@@ -525,14 +468,13 @@ function lockPostSaving(lockName) {
|
|
|
525
468
|
*
|
|
526
469
|
* @return {Object} Action object
|
|
527
470
|
*/
|
|
528
|
-
|
|
529
|
-
|
|
530
471
|
function unlockPostSaving(lockName) {
|
|
531
472
|
return {
|
|
532
473
|
type: 'UNLOCK_POST_SAVING',
|
|
533
474
|
lockName
|
|
534
475
|
};
|
|
535
476
|
}
|
|
477
|
+
|
|
536
478
|
/**
|
|
537
479
|
* Action that locks post autosaving.
|
|
538
480
|
*
|
|
@@ -546,14 +488,13 @@ function unlockPostSaving(lockName) {
|
|
|
546
488
|
*
|
|
547
489
|
* @return {Object} Action object
|
|
548
490
|
*/
|
|
549
|
-
|
|
550
|
-
|
|
551
491
|
function lockPostAutosaving(lockName) {
|
|
552
492
|
return {
|
|
553
493
|
type: 'LOCK_POST_AUTOSAVING',
|
|
554
494
|
lockName
|
|
555
495
|
};
|
|
556
496
|
}
|
|
497
|
+
|
|
557
498
|
/**
|
|
558
499
|
* Action that unlocks post autosaving.
|
|
559
500
|
*
|
|
@@ -567,22 +508,19 @@ function lockPostAutosaving(lockName) {
|
|
|
567
508
|
*
|
|
568
509
|
* @return {Object} Action object
|
|
569
510
|
*/
|
|
570
|
-
|
|
571
|
-
|
|
572
511
|
function unlockPostAutosaving(lockName) {
|
|
573
512
|
return {
|
|
574
513
|
type: 'UNLOCK_POST_AUTOSAVING',
|
|
575
514
|
lockName
|
|
576
515
|
};
|
|
577
516
|
}
|
|
517
|
+
|
|
578
518
|
/**
|
|
579
519
|
* Returns an action object used to signal that the blocks have been updated.
|
|
580
520
|
*
|
|
581
521
|
* @param {Array} blocks Block Array.
|
|
582
522
|
* @param {?Object} options Optional options.
|
|
583
523
|
*/
|
|
584
|
-
|
|
585
|
-
|
|
586
524
|
const resetEditorBlocks = (blocks, options = {}) => ({
|
|
587
525
|
select,
|
|
588
526
|
dispatch,
|
|
@@ -596,30 +534,27 @@ const resetEditorBlocks = (blocks, options = {}) => ({
|
|
|
596
534
|
blocks,
|
|
597
535
|
selection
|
|
598
536
|
};
|
|
599
|
-
|
|
600
537
|
if (__unstableShouldCreateUndoLevel !== false) {
|
|
601
538
|
const {
|
|
602
539
|
id,
|
|
603
540
|
type
|
|
604
541
|
} = select.getCurrentPost();
|
|
605
542
|
const noChange = registry.select(_coreData.store).getEditedEntityRecord('postType', type, id).blocks === edits.blocks;
|
|
606
|
-
|
|
607
543
|
if (noChange) {
|
|
608
544
|
registry.dispatch(_coreData.store).__unstableCreateUndoLevel('postType', type, id);
|
|
609
|
-
|
|
610
545
|
return;
|
|
611
|
-
}
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
// We create a new function here on every persistent edit
|
|
612
549
|
// to make sure the edit makes the post dirty and creates
|
|
613
550
|
// a new undo level.
|
|
614
|
-
|
|
615
|
-
|
|
616
551
|
edits.content = ({
|
|
617
552
|
blocks: blocksForSerialization = []
|
|
618
553
|
}) => (0, _blocks.__unstableSerializeAndClean)(blocksForSerialization);
|
|
619
554
|
}
|
|
620
|
-
|
|
621
555
|
dispatch.editPost(edits);
|
|
622
556
|
};
|
|
557
|
+
|
|
623
558
|
/*
|
|
624
559
|
* Returns an action object used in signalling that the post editor settings have been updated.
|
|
625
560
|
*
|
|
@@ -627,21 +562,18 @@ const resetEditorBlocks = (blocks, options = {}) => ({
|
|
|
627
562
|
*
|
|
628
563
|
* @return {Object} Action object
|
|
629
564
|
*/
|
|
630
|
-
|
|
631
|
-
|
|
632
565
|
exports.resetEditorBlocks = resetEditorBlocks;
|
|
633
|
-
|
|
634
566
|
function updateEditorSettings(settings) {
|
|
635
567
|
return {
|
|
636
568
|
type: 'UPDATE_EDITOR_SETTINGS',
|
|
637
569
|
settings
|
|
638
570
|
};
|
|
639
571
|
}
|
|
572
|
+
|
|
640
573
|
/**
|
|
641
574
|
* Backward compatibility
|
|
642
575
|
*/
|
|
643
576
|
|
|
644
|
-
|
|
645
577
|
const getBlockEditorAction = name => (...args) => ({
|
|
646
578
|
registry
|
|
647
579
|
}) => {
|
|
@@ -652,190 +584,189 @@ const getBlockEditorAction = name => (...args) => ({
|
|
|
652
584
|
});
|
|
653
585
|
registry.dispatch(_blockEditor.store)[name](...args);
|
|
654
586
|
};
|
|
587
|
+
|
|
655
588
|
/**
|
|
656
589
|
* @see resetBlocks in core/block-editor store.
|
|
657
590
|
*/
|
|
658
|
-
|
|
659
|
-
|
|
660
591
|
const resetBlocks = getBlockEditorAction('resetBlocks');
|
|
592
|
+
|
|
661
593
|
/**
|
|
662
594
|
* @see receiveBlocks in core/block-editor store.
|
|
663
595
|
*/
|
|
664
|
-
|
|
665
596
|
exports.resetBlocks = resetBlocks;
|
|
666
597
|
const receiveBlocks = getBlockEditorAction('receiveBlocks');
|
|
598
|
+
|
|
667
599
|
/**
|
|
668
600
|
* @see updateBlock in core/block-editor store.
|
|
669
601
|
*/
|
|
670
|
-
|
|
671
602
|
exports.receiveBlocks = receiveBlocks;
|
|
672
603
|
const updateBlock = getBlockEditorAction('updateBlock');
|
|
604
|
+
|
|
673
605
|
/**
|
|
674
606
|
* @see updateBlockAttributes in core/block-editor store.
|
|
675
607
|
*/
|
|
676
|
-
|
|
677
608
|
exports.updateBlock = updateBlock;
|
|
678
609
|
const updateBlockAttributes = getBlockEditorAction('updateBlockAttributes');
|
|
610
|
+
|
|
679
611
|
/**
|
|
680
612
|
* @see selectBlock in core/block-editor store.
|
|
681
613
|
*/
|
|
682
|
-
|
|
683
614
|
exports.updateBlockAttributes = updateBlockAttributes;
|
|
684
615
|
const selectBlock = getBlockEditorAction('selectBlock');
|
|
616
|
+
|
|
685
617
|
/**
|
|
686
618
|
* @see startMultiSelect in core/block-editor store.
|
|
687
619
|
*/
|
|
688
|
-
|
|
689
620
|
exports.selectBlock = selectBlock;
|
|
690
621
|
const startMultiSelect = getBlockEditorAction('startMultiSelect');
|
|
622
|
+
|
|
691
623
|
/**
|
|
692
624
|
* @see stopMultiSelect in core/block-editor store.
|
|
693
625
|
*/
|
|
694
|
-
|
|
695
626
|
exports.startMultiSelect = startMultiSelect;
|
|
696
627
|
const stopMultiSelect = getBlockEditorAction('stopMultiSelect');
|
|
628
|
+
|
|
697
629
|
/**
|
|
698
630
|
* @see multiSelect in core/block-editor store.
|
|
699
631
|
*/
|
|
700
|
-
|
|
701
632
|
exports.stopMultiSelect = stopMultiSelect;
|
|
702
633
|
const multiSelect = getBlockEditorAction('multiSelect');
|
|
634
|
+
|
|
703
635
|
/**
|
|
704
636
|
* @see clearSelectedBlock in core/block-editor store.
|
|
705
637
|
*/
|
|
706
|
-
|
|
707
638
|
exports.multiSelect = multiSelect;
|
|
708
639
|
const clearSelectedBlock = getBlockEditorAction('clearSelectedBlock');
|
|
640
|
+
|
|
709
641
|
/**
|
|
710
642
|
* @see toggleSelection in core/block-editor store.
|
|
711
643
|
*/
|
|
712
|
-
|
|
713
644
|
exports.clearSelectedBlock = clearSelectedBlock;
|
|
714
645
|
const toggleSelection = getBlockEditorAction('toggleSelection');
|
|
646
|
+
|
|
715
647
|
/**
|
|
716
648
|
* @see replaceBlocks in core/block-editor store.
|
|
717
649
|
*/
|
|
718
|
-
|
|
719
650
|
exports.toggleSelection = toggleSelection;
|
|
720
651
|
const replaceBlocks = getBlockEditorAction('replaceBlocks');
|
|
652
|
+
|
|
721
653
|
/**
|
|
722
654
|
* @see replaceBlock in core/block-editor store.
|
|
723
655
|
*/
|
|
724
|
-
|
|
725
656
|
exports.replaceBlocks = replaceBlocks;
|
|
726
657
|
const replaceBlock = getBlockEditorAction('replaceBlock');
|
|
658
|
+
|
|
727
659
|
/**
|
|
728
660
|
* @see moveBlocksDown in core/block-editor store.
|
|
729
661
|
*/
|
|
730
|
-
|
|
731
662
|
exports.replaceBlock = replaceBlock;
|
|
732
663
|
const moveBlocksDown = getBlockEditorAction('moveBlocksDown');
|
|
664
|
+
|
|
733
665
|
/**
|
|
734
666
|
* @see moveBlocksUp in core/block-editor store.
|
|
735
667
|
*/
|
|
736
|
-
|
|
737
668
|
exports.moveBlocksDown = moveBlocksDown;
|
|
738
669
|
const moveBlocksUp = getBlockEditorAction('moveBlocksUp');
|
|
670
|
+
|
|
739
671
|
/**
|
|
740
672
|
* @see moveBlockToPosition in core/block-editor store.
|
|
741
673
|
*/
|
|
742
|
-
|
|
743
674
|
exports.moveBlocksUp = moveBlocksUp;
|
|
744
675
|
const moveBlockToPosition = getBlockEditorAction('moveBlockToPosition');
|
|
676
|
+
|
|
745
677
|
/**
|
|
746
678
|
* @see insertBlock in core/block-editor store.
|
|
747
679
|
*/
|
|
748
|
-
|
|
749
680
|
exports.moveBlockToPosition = moveBlockToPosition;
|
|
750
681
|
const insertBlock = getBlockEditorAction('insertBlock');
|
|
682
|
+
|
|
751
683
|
/**
|
|
752
684
|
* @see insertBlocks in core/block-editor store.
|
|
753
685
|
*/
|
|
754
|
-
|
|
755
686
|
exports.insertBlock = insertBlock;
|
|
756
687
|
const insertBlocks = getBlockEditorAction('insertBlocks');
|
|
688
|
+
|
|
757
689
|
/**
|
|
758
690
|
* @see showInsertionPoint in core/block-editor store.
|
|
759
691
|
*/
|
|
760
|
-
|
|
761
692
|
exports.insertBlocks = insertBlocks;
|
|
762
693
|
const showInsertionPoint = getBlockEditorAction('showInsertionPoint');
|
|
694
|
+
|
|
763
695
|
/**
|
|
764
696
|
* @see hideInsertionPoint in core/block-editor store.
|
|
765
697
|
*/
|
|
766
|
-
|
|
767
698
|
exports.showInsertionPoint = showInsertionPoint;
|
|
768
699
|
const hideInsertionPoint = getBlockEditorAction('hideInsertionPoint');
|
|
700
|
+
|
|
769
701
|
/**
|
|
770
702
|
* @see setTemplateValidity in core/block-editor store.
|
|
771
703
|
*/
|
|
772
|
-
|
|
773
704
|
exports.hideInsertionPoint = hideInsertionPoint;
|
|
774
705
|
const setTemplateValidity = getBlockEditorAction('setTemplateValidity');
|
|
706
|
+
|
|
775
707
|
/**
|
|
776
708
|
* @see synchronizeTemplate in core/block-editor store.
|
|
777
709
|
*/
|
|
778
|
-
|
|
779
710
|
exports.setTemplateValidity = setTemplateValidity;
|
|
780
711
|
const synchronizeTemplate = getBlockEditorAction('synchronizeTemplate');
|
|
712
|
+
|
|
781
713
|
/**
|
|
782
714
|
* @see mergeBlocks in core/block-editor store.
|
|
783
715
|
*/
|
|
784
|
-
|
|
785
716
|
exports.synchronizeTemplate = synchronizeTemplate;
|
|
786
717
|
const mergeBlocks = getBlockEditorAction('mergeBlocks');
|
|
718
|
+
|
|
787
719
|
/**
|
|
788
720
|
* @see removeBlocks in core/block-editor store.
|
|
789
721
|
*/
|
|
790
|
-
|
|
791
722
|
exports.mergeBlocks = mergeBlocks;
|
|
792
723
|
const removeBlocks = getBlockEditorAction('removeBlocks');
|
|
724
|
+
|
|
793
725
|
/**
|
|
794
726
|
* @see removeBlock in core/block-editor store.
|
|
795
727
|
*/
|
|
796
|
-
|
|
797
728
|
exports.removeBlocks = removeBlocks;
|
|
798
729
|
const removeBlock = getBlockEditorAction('removeBlock');
|
|
730
|
+
|
|
799
731
|
/**
|
|
800
732
|
* @see toggleBlockMode in core/block-editor store.
|
|
801
733
|
*/
|
|
802
|
-
|
|
803
734
|
exports.removeBlock = removeBlock;
|
|
804
735
|
const toggleBlockMode = getBlockEditorAction('toggleBlockMode');
|
|
736
|
+
|
|
805
737
|
/**
|
|
806
738
|
* @see startTyping in core/block-editor store.
|
|
807
739
|
*/
|
|
808
|
-
|
|
809
740
|
exports.toggleBlockMode = toggleBlockMode;
|
|
810
741
|
const startTyping = getBlockEditorAction('startTyping');
|
|
742
|
+
|
|
811
743
|
/**
|
|
812
744
|
* @see stopTyping in core/block-editor store.
|
|
813
745
|
*/
|
|
814
|
-
|
|
815
746
|
exports.startTyping = startTyping;
|
|
816
747
|
const stopTyping = getBlockEditorAction('stopTyping');
|
|
748
|
+
|
|
817
749
|
/**
|
|
818
750
|
* @see enterFormattedText in core/block-editor store.
|
|
819
751
|
*/
|
|
820
|
-
|
|
821
752
|
exports.stopTyping = stopTyping;
|
|
822
753
|
const enterFormattedText = getBlockEditorAction('enterFormattedText');
|
|
754
|
+
|
|
823
755
|
/**
|
|
824
756
|
* @see exitFormattedText in core/block-editor store.
|
|
825
757
|
*/
|
|
826
|
-
|
|
827
758
|
exports.enterFormattedText = enterFormattedText;
|
|
828
759
|
const exitFormattedText = getBlockEditorAction('exitFormattedText');
|
|
760
|
+
|
|
829
761
|
/**
|
|
830
762
|
* @see insertDefaultBlock in core/block-editor store.
|
|
831
763
|
*/
|
|
832
|
-
|
|
833
764
|
exports.exitFormattedText = exitFormattedText;
|
|
834
765
|
const insertDefaultBlock = getBlockEditorAction('insertDefaultBlock');
|
|
766
|
+
|
|
835
767
|
/**
|
|
836
768
|
* @see updateBlockListSettings in core/block-editor store.
|
|
837
769
|
*/
|
|
838
|
-
|
|
839
770
|
exports.insertDefaultBlock = insertDefaultBlock;
|
|
840
771
|
const updateBlockListSettings = getBlockEditorAction('updateBlockListSettings');
|
|
841
772
|
exports.updateBlockListSettings = updateBlockListSettings;
|