@wordpress/editor 13.11.0 → 13.12.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/autosave-monitor/index.js +1 -2
- package/build/components/autosave-monitor/index.js.map +1 -1
- package/build/components/deprecated.js +7 -9
- package/build/components/deprecated.js.map +1 -1
- package/build/components/document-outline/check.js +4 -5
- package/build/components/document-outline/check.js.map +1 -1
- package/build/components/document-outline/index.js +12 -16
- package/build/components/document-outline/index.js.map +1 -1
- package/build/components/document-outline/item.js +22 -25
- package/build/components/document-outline/item.js.map +1 -1
- package/build/components/editor-help/help-detail-navigation-screen.native.js +6 -9
- 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 +4 -5
- package/build/components/editor-help/help-get-support-button.native.js.map +1 -1
- package/build/components/editor-help/help-section-title.native.js +3 -4
- package/build/components/editor-help/help-section-title.native.js.map +1 -1
- package/build/components/editor-help/help-topic-row.native.js +6 -7
- package/build/components/editor-help/help-topic-row.native.js.map +1 -1
- package/build/components/editor-help/index.native.js +20 -27
- package/build/components/editor-help/index.native.js.map +1 -1
- package/build/components/editor-help/view-sections.native.js +16 -20
- package/build/components/editor-help/view-sections.native.js.map +1 -1
- package/build/components/editor-history/redo.js +2 -6
- package/build/components/editor-history/redo.js.map +1 -1
- package/build/components/editor-history/undo.js +2 -6
- package/build/components/editor-history/undo.js.map +1 -1
- package/build/components/editor-notices/index.js +12 -19
- package/build/components/editor-notices/index.js.map +1 -1
- package/build/components/editor-snackbars/index.js +3 -6
- package/build/components/editor-snackbars/index.js.map +1 -1
- package/build/components/entities-saved-states/entity-record-item.js +7 -10
- package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
- package/build/components/entities-saved-states/entity-type-list.js +6 -7
- package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build/components/entities-saved-states/hooks/use-is-dirty.js +86 -0
- package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -0
- package/build/components/entities-saved-states/index.js +43 -116
- package/build/components/entities-saved-states/index.js.map +1 -1
- package/build/components/error-boundary/index.js +4 -5
- package/build/components/error-boundary/index.js.map +1 -1
- package/build/components/global-keyboard-shortcuts/save-shortcut.js +3 -4
- package/build/components/global-keyboard-shortcuts/save-shortcut.js.map +1 -1
- package/build/components/index.js +18 -0
- package/build/components/index.js.map +1 -1
- package/build/components/media-categories/index.js +25 -42
- package/build/components/media-categories/index.js.map +1 -1
- package/build/components/page-attributes/check.js +4 -7
- package/build/components/page-attributes/check.js.map +1 -1
- package/build/components/page-attributes/order.js +7 -9
- package/build/components/page-attributes/order.js.map +1 -1
- package/build/components/page-attributes/parent.js +5 -12
- package/build/components/page-attributes/parent.js.map +1 -1
- package/build/components/post-author/check.js +6 -7
- package/build/components/post-author/check.js.map +1 -1
- package/build/components/post-author/combobox.js +3 -6
- package/build/components/post-author/combobox.js.map +1 -1
- package/build/components/post-author/index.js +1 -1
- package/build/components/post-author/index.js.map +1 -1
- package/build/components/post-comments/index.js +4 -6
- package/build/components/post-comments/index.js.map +1 -1
- package/build/components/post-excerpt/check.js +2 -4
- package/build/components/post-excerpt/check.js.map +1 -1
- package/build/components/post-excerpt/index.js +4 -5
- package/build/components/post-excerpt/index.js.map +1 -1
- package/build/components/post-featured-image/check.js +2 -4
- package/build/components/post-featured-image/check.js.map +1 -1
- package/build/components/post-featured-image/index.js +56 -69
- package/build/components/post-featured-image/index.js.map +1 -1
- package/build/components/post-format/check.js +6 -9
- package/build/components/post-format/check.js.map +1 -1
- package/build/components/post-format/index.js +1 -1
- package/build/components/post-format/index.js.map +1 -1
- package/build/components/post-last-revision/check.js +5 -7
- package/build/components/post-last-revision/check.js.map +1 -1
- package/build/components/post-last-revision/index.js +4 -5
- package/build/components/post-last-revision/index.js.map +1 -1
- package/build/components/post-locked-modal/index.js +1 -1
- package/build/components/post-locked-modal/index.js.map +1 -1
- package/build/components/post-pending-status/check.js +7 -9
- package/build/components/post-pending-status/check.js.map +1 -1
- package/build/components/post-pending-status/index.js +4 -6
- package/build/components/post-pending-status/index.js.map +1 -1
- package/build/components/post-pingbacks/index.js +4 -6
- package/build/components/post-pingbacks/index.js.map +1 -1
- package/build/components/post-preview-button/index.js +8 -12
- package/build/components/post-preview-button/index.js.map +1 -1
- package/build/components/post-publish-button/index.js +10 -19
- package/build/components/post-publish-button/index.js.map +1 -1
- package/build/components/post-publish-button/label.js +14 -17
- package/build/components/post-publish-button/label.js.map +1 -1
- package/build/components/post-publish-panel/index.js +10 -12
- package/build/components/post-publish-panel/index.js.map +1 -1
- package/build/components/post-publish-panel/maybe-category-panel.js +2 -4
- package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-post-format-panel.js +9 -12
- package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-tags-panel.js +4 -7
- package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-upload-media.js +150 -0
- package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -0
- package/build/components/post-publish-panel/postpublish.js +8 -11
- package/build/components/post-publish-panel/postpublish.js.map +1 -1
- package/build/components/post-publish-panel/prepublish.js +8 -7
- package/build/components/post-publish-panel/prepublish.js.map +1 -1
- package/build/components/post-saved-state/index.js +13 -8
- package/build/components/post-saved-state/index.js.map +1 -1
- package/build/components/post-schedule/check.js +6 -8
- package/build/components/post-schedule/check.js.map +1 -1
- package/build/components/post-schedule/index.js +8 -12
- package/build/components/post-schedule/index.js.map +1 -1
- package/build/components/post-schedule/label.js +7 -10
- package/build/components/post-schedule/label.js.map +1 -1
- package/build/components/post-slug/check.js +3 -4
- package/build/components/post-slug/check.js.map +1 -1
- package/build/components/post-slug/index.js +5 -6
- package/build/components/post-slug/index.js.map +1 -1
- package/build/components/post-sticky/check.js +7 -9
- package/build/components/post-sticky/check.js.map +1 -1
- package/build/components/post-sticky/index.js +4 -5
- package/build/components/post-sticky/index.js.map +1 -1
- package/build/components/post-switch-to-draft-button/index.js +6 -7
- package/build/components/post-switch-to-draft-button/index.js.map +1 -1
- package/build/components/post-sync-status/index.js +67 -0
- package/build/components/post-sync-status/index.js.map +1 -0
- package/build/components/post-taxonomies/check.js +6 -7
- package/build/components/post-taxonomies/check.js.map +1 -1
- package/build/components/post-taxonomies/flat-term-selector.js +36 -46
- package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/hierarchical-term-selector.js +13 -14
- package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/index.js +6 -11
- package/build/components/post-taxonomies/index.js.map +1 -1
- package/build/components/post-taxonomies/most-used-terms.js +5 -6
- package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build/components/post-template/index.js +6 -9
- package/build/components/post-template/index.js.map +1 -1
- package/build/components/post-title/index.js +8 -5
- package/build/components/post-title/index.js.map +1 -1
- package/build/components/post-title/index.native.js +8 -11
- package/build/components/post-title/index.native.js.map +1 -1
- package/build/components/post-trash/check.js +7 -9
- package/build/components/post-trash/check.js.map +1 -1
- package/build/components/post-type-support-check/index.js +5 -6
- package/build/components/post-type-support-check/index.js.map +1 -1
- package/build/components/post-url/check.js +4 -5
- package/build/components/post-url/check.js.map +1 -1
- package/build/components/post-url/index.js +8 -9
- package/build/components/post-url/index.js.map +1 -1
- package/build/components/post-visibility/check.js +6 -7
- package/build/components/post-visibility/check.js.map +1 -1
- package/build/components/post-visibility/index.js +14 -19
- package/build/components/post-visibility/index.js.map +1 -1
- package/build/components/post-visibility/label.js +1 -3
- package/build/components/post-visibility/label.js.map +1 -1
- package/build/components/provider/index.js +12 -15
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/index.native.js +19 -30
- package/build/components/provider/index.native.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.js +5 -9
- package/build/components/provider/use-block-editor-settings.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.native.js +1 -3
- package/build/components/provider/use-block-editor-settings.native.js.map +1 -1
- package/build/components/provider/with-registry-provider.js +4 -2
- package/build/components/provider/with-registry-provider.js.map +1 -1
- package/build/components/table-of-contents/index.js +26 -35
- package/build/components/table-of-contents/index.js.map +1 -1
- package/build/components/table-of-contents/panel.js +4 -5
- package/build/components/table-of-contents/panel.js.map +1 -1
- package/build/components/template-validation-notice/index.js +4 -6
- package/build/components/template-validation-notice/index.js.map +1 -1
- package/build/components/theme-support-check/index.js +7 -8
- package/build/components/theme-support-check/index.js.map +1 -1
- package/build/hooks/custom-sources-backwards-compatibility.js +20 -42
- package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
- package/build/hooks/default-autocompleters.js +1 -2
- package/build/hooks/default-autocompleters.js.map +1 -1
- package/build/{lockUnlock.js → lock-unlock.js} +1 -1
- package/build/lock-unlock.js.map +1 -0
- package/build/private-apis.js +5 -2
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +147 -179
- package/build/store/actions.js.map +1 -1
- package/build/store/actions.native.js +1 -2
- package/build/store/actions.native.js.map +1 -1
- package/build/store/reducer.js +14 -44
- package/build/store/reducer.js.map +1 -1
- package/build/store/reducer.native.js +3 -12
- package/build/store/reducer.native.js.map +1 -1
- package/build/store/selectors.js +23 -54
- package/build/store/selectors.js.map +1 -1
- package/build/store/utils/notice-builder.js +3 -3
- package/build/store/utils/notice-builder.js.map +1 -1
- package/build/utils/media-upload/index.js +11 -15
- package/build/utils/media-upload/index.js.map +1 -1
- package/build/utils/terms.js +3 -6
- package/build/utils/terms.js.map +1 -1
- package/build-module/components/autosave-monitor/index.js +1 -2
- package/build-module/components/autosave-monitor/index.js.map +1 -1
- package/build-module/components/deprecated.js +7 -8
- package/build-module/components/deprecated.js.map +1 -1
- package/build-module/components/document-outline/check.js +4 -5
- package/build-module/components/document-outline/check.js.map +1 -1
- package/build-module/components/document-outline/index.js +12 -16
- package/build-module/components/document-outline/index.js.map +1 -1
- package/build-module/components/document-outline/item.js +22 -25
- package/build-module/components/document-outline/item.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 +4 -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 +3 -4
- 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 +6 -7
- package/build-module/components/editor-help/help-topic-row.native.js.map +1 -1
- package/build-module/components/editor-help/index.native.js +20 -25
- package/build-module/components/editor-help/index.native.js.map +1 -1
- package/build-module/components/editor-help/view-sections.native.js +16 -20
- package/build-module/components/editor-help/view-sections.native.js.map +1 -1
- package/build-module/components/editor-history/redo.js +2 -3
- package/build-module/components/editor-history/redo.js.map +1 -1
- package/build-module/components/editor-history/undo.js +2 -3
- package/build-module/components/editor-history/undo.js.map +1 -1
- package/build-module/components/editor-notices/index.js +12 -19
- package/build-module/components/editor-notices/index.js.map +1 -1
- package/build-module/components/editor-snackbars/index.js +3 -6
- package/build-module/components/editor-snackbars/index.js.map +1 -1
- package/build-module/components/entities-saved-states/entity-record-item.js +7 -10
- 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 +6 -7
- 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 +72 -0
- package/build-module/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -0
- package/build-module/components/entities-saved-states/index.js +44 -118
- package/build-module/components/entities-saved-states/index.js.map +1 -1
- package/build-module/components/error-boundary/index.js +4 -5
- package/build-module/components/error-boundary/index.js.map +1 -1
- package/build-module/components/global-keyboard-shortcuts/save-shortcut.js +3 -4
- package/build-module/components/global-keyboard-shortcuts/save-shortcut.js.map +1 -1
- package/build-module/components/index.js +2 -0
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/media-categories/index.js +25 -42
- package/build-module/components/media-categories/index.js.map +1 -1
- package/build-module/components/page-attributes/check.js +4 -7
- package/build-module/components/page-attributes/check.js.map +1 -1
- package/build-module/components/page-attributes/order.js +7 -9
- package/build-module/components/page-attributes/order.js.map +1 -1
- package/build-module/components/page-attributes/parent.js +5 -12
- package/build-module/components/page-attributes/parent.js.map +1 -1
- package/build-module/components/post-author/check.js +6 -7
- package/build-module/components/post-author/check.js.map +1 -1
- package/build-module/components/post-author/combobox.js +3 -6
- package/build-module/components/post-author/combobox.js.map +1 -1
- package/build-module/components/post-author/index.js +1 -1
- package/build-module/components/post-author/index.js.map +1 -1
- package/build-module/components/post-comments/index.js +4 -6
- package/build-module/components/post-comments/index.js.map +1 -1
- package/build-module/components/post-excerpt/check.js +2 -3
- package/build-module/components/post-excerpt/check.js.map +1 -1
- package/build-module/components/post-excerpt/index.js +4 -5
- package/build-module/components/post-excerpt/index.js.map +1 -1
- package/build-module/components/post-featured-image/check.js +2 -3
- package/build-module/components/post-featured-image/check.js.map +1 -1
- package/build-module/components/post-featured-image/index.js +56 -69
- package/build-module/components/post-featured-image/index.js.map +1 -1
- package/build-module/components/post-format/check.js +6 -8
- package/build-module/components/post-format/check.js.map +1 -1
- package/build-module/components/post-format/index.js +1 -1
- package/build-module/components/post-format/index.js.map +1 -1
- package/build-module/components/post-last-revision/check.js +5 -7
- package/build-module/components/post-last-revision/check.js.map +1 -1
- package/build-module/components/post-last-revision/index.js +4 -5
- package/build-module/components/post-last-revision/index.js.map +1 -1
- package/build-module/components/post-locked-modal/index.js +1 -1
- package/build-module/components/post-locked-modal/index.js.map +1 -1
- package/build-module/components/post-pending-status/check.js +7 -9
- package/build-module/components/post-pending-status/check.js.map +1 -1
- package/build-module/components/post-pending-status/index.js +4 -6
- package/build-module/components/post-pending-status/index.js.map +1 -1
- package/build-module/components/post-pingbacks/index.js +4 -6
- package/build-module/components/post-pingbacks/index.js.map +1 -1
- package/build-module/components/post-preview-button/index.js +8 -12
- package/build-module/components/post-preview-button/index.js.map +1 -1
- package/build-module/components/post-publish-button/index.js +10 -18
- package/build-module/components/post-publish-button/index.js.map +1 -1
- package/build-module/components/post-publish-button/label.js +14 -17
- package/build-module/components/post-publish-button/label.js.map +1 -1
- package/build-module/components/post-publish-panel/index.js +10 -11
- package/build-module/components/post-publish-panel/index.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-category-panel.js +2 -4
- 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 +9 -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 +4 -7
- 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 +138 -0
- package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -0
- package/build-module/components/post-publish-panel/postpublish.js +8 -11
- package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
- package/build-module/components/post-publish-panel/prepublish.js +7 -7
- package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
- package/build-module/components/post-saved-state/index.js +13 -8
- package/build-module/components/post-saved-state/index.js.map +1 -1
- package/build-module/components/post-schedule/check.js +6 -8
- package/build-module/components/post-schedule/check.js.map +1 -1
- package/build-module/components/post-schedule/index.js +8 -12
- package/build-module/components/post-schedule/index.js.map +1 -1
- package/build-module/components/post-schedule/label.js +7 -10
- package/build-module/components/post-schedule/label.js.map +1 -1
- package/build-module/components/post-slug/check.js +3 -4
- package/build-module/components/post-slug/check.js.map +1 -1
- package/build-module/components/post-slug/index.js +5 -6
- package/build-module/components/post-slug/index.js.map +1 -1
- package/build-module/components/post-sticky/check.js +7 -9
- package/build-module/components/post-sticky/check.js.map +1 -1
- package/build-module/components/post-sticky/index.js +4 -5
- package/build-module/components/post-sticky/index.js.map +1 -1
- package/build-module/components/post-switch-to-draft-button/index.js +6 -7
- package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
- package/build-module/components/post-sync-status/index.js +56 -0
- package/build-module/components/post-sync-status/index.js.map +1 -0
- package/build-module/components/post-taxonomies/check.js +6 -7
- package/build-module/components/post-taxonomies/check.js.map +1 -1
- package/build-module/components/post-taxonomies/flat-term-selector.js +36 -44
- package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js +13 -14
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/index.js +6 -11
- package/build-module/components/post-taxonomies/index.js.map +1 -1
- package/build-module/components/post-taxonomies/most-used-terms.js +5 -6
- package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build-module/components/post-template/index.js +6 -9
- package/build-module/components/post-template/index.js.map +1 -1
- package/build-module/components/post-title/index.js +8 -5
- package/build-module/components/post-title/index.js.map +1 -1
- package/build-module/components/post-title/index.native.js +8 -11
- package/build-module/components/post-title/index.native.js.map +1 -1
- package/build-module/components/post-trash/check.js +7 -9
- package/build-module/components/post-trash/check.js.map +1 -1
- package/build-module/components/post-type-support-check/index.js +5 -6
- package/build-module/components/post-type-support-check/index.js.map +1 -1
- package/build-module/components/post-url/check.js +4 -5
- package/build-module/components/post-url/check.js.map +1 -1
- package/build-module/components/post-url/index.js +8 -9
- package/build-module/components/post-url/index.js.map +1 -1
- package/build-module/components/post-visibility/check.js +6 -7
- package/build-module/components/post-visibility/check.js.map +1 -1
- package/build-module/components/post-visibility/index.js +14 -16
- package/build-module/components/post-visibility/index.js.map +1 -1
- package/build-module/components/post-visibility/label.js +1 -3
- package/build-module/components/post-visibility/label.js.map +1 -1
- package/build-module/components/provider/index.js +12 -14
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/index.native.js +19 -29
- package/build-module/components/provider/index.native.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.js +5 -9
- package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.native.js +1 -3
- package/build-module/components/provider/use-block-editor-settings.native.js.map +1 -1
- package/build-module/components/provider/with-registry-provider.js +4 -2
- package/build-module/components/provider/with-registry-provider.js.map +1 -1
- package/build-module/components/table-of-contents/index.js +26 -34
- package/build-module/components/table-of-contents/index.js.map +1 -1
- package/build-module/components/table-of-contents/panel.js +4 -5
- package/build-module/components/table-of-contents/panel.js.map +1 -1
- package/build-module/components/template-validation-notice/index.js +4 -6
- package/build-module/components/template-validation-notice/index.js.map +1 -1
- package/build-module/components/theme-support-check/index.js +7 -8
- package/build-module/components/theme-support-check/index.js.map +1 -1
- package/build-module/hooks/custom-sources-backwards-compatibility.js +20 -39
- package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
- package/build-module/hooks/default-autocompleters.js +1 -2
- package/build-module/hooks/default-autocompleters.js.map +1 -1
- package/build-module/{lockUnlock.js → lock-unlock.js} +1 -1
- package/build-module/lock-unlock.js.map +1 -0
- package/build-module/private-apis.js +4 -2
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +147 -179
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/actions.native.js +1 -2
- package/build-module/store/actions.native.js.map +1 -1
- package/build-module/store/reducer.js +14 -44
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/reducer.native.js +3 -12
- package/build-module/store/reducer.native.js.map +1 -1
- package/build-module/store/selectors.js +21 -54
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/utils/notice-builder.js +3 -3
- package/build-module/store/utils/notice-builder.js.map +1 -1
- package/build-module/utils/media-upload/index.js +11 -15
- package/build-module/utils/media-upload/index.js.map +1 -1
- package/build-module/utils/terms.js +3 -6
- package/build-module/utils/terms.js.map +1 -1
- package/build-style/style-rtl.css +15 -1
- package/build-style/style.css +15 -1
- package/package.json +30 -31
- package/src/components/editor-help/test/index.native.js +3 -2
- package/src/components/entities-saved-states/hooks/use-is-dirty.js +87 -0
- package/src/components/entities-saved-states/index.js +25 -106
- package/src/components/entities-saved-states/test/use-is-dirty.js +94 -0
- package/src/components/index.js +2 -0
- package/src/components/post-publish-panel/maybe-upload-media.js +167 -0
- package/src/components/post-publish-panel/prepublish.js +2 -0
- package/src/components/post-publish-panel/style.scss +1 -1
- package/src/components/post-saved-state/index.js +6 -0
- package/src/components/post-sync-status/index.js +55 -0
- package/src/components/post-sync-status/style.scss +16 -0
- package/src/components/post-taxonomies/flat-term-selector.js +20 -30
- package/src/components/post-title/index.js +4 -1
- package/src/components/provider/index.js +1 -1
- package/src/components/provider/index.native.js +2 -9
- package/src/private-apis.js +3 -1
- package/src/style.scss +1 -0
- package/build/lockUnlock.js.map +0 -1
- package/build-module/lockUnlock.js.map +0 -1
- /package/src/{lockUnlock.js → lock-unlock.js} +0 -0
|
@@ -8,17 +8,16 @@ import { store as coreStore } from '@wordpress/core-data';
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { store as editorStore } from '../../store';
|
|
11
|
-
export function ThemeSupportCheck(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} = _ref;
|
|
11
|
+
export function ThemeSupportCheck({
|
|
12
|
+
themeSupports,
|
|
13
|
+
children,
|
|
14
|
+
postType,
|
|
15
|
+
supportKeys
|
|
16
|
+
}) {
|
|
18
17
|
const isSupported = (Array.isArray(supportKeys) ? supportKeys : [supportKeys]).some(key => {
|
|
19
18
|
var _themeSupports$key;
|
|
20
19
|
|
|
21
|
-
const supported = (_themeSupports$key = themeSupports
|
|
20
|
+
const supported = (_themeSupports$key = themeSupports?.[key]) !== null && _themeSupports$key !== void 0 ? _themeSupports$key : false; // 'post-thumbnails' can be boolean or an array of post types.
|
|
22
21
|
// In the latter case, we need to verify `postType` exists
|
|
23
22
|
// within `supported`. If `postType` isn't passed, then the check
|
|
24
23
|
// should fail.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/theme-support-check/index.js"],"names":["withSelect","store","coreStore","editorStore","ThemeSupportCheck","themeSupports","children","postType","supportKeys","isSupported","Array","isArray","some","key","supported","includes","select","getThemeSupports","getEditedPostAttribute"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAT,QAA2B,iBAA3B;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;;AACA,SAASD,KAAK,IAAIE,WAAlB,QAAqC,aAArC;AAEA,OAAO,SAASC,iBAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/theme-support-check/index.js"],"names":["withSelect","store","coreStore","editorStore","ThemeSupportCheck","themeSupports","children","postType","supportKeys","isSupported","Array","isArray","some","key","supported","includes","select","getThemeSupports","getEditedPostAttribute"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAT,QAA2B,iBAA3B;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;;AACA,SAASD,KAAK,IAAIE,WAAlB,QAAqC,aAArC;AAEA,OAAO,SAASC,iBAAT,CAA4B;AAClCC,EAAAA,aADkC;AAElCC,EAAAA,QAFkC;AAGlCC,EAAAA,QAHkC;AAIlCC,EAAAA;AAJkC,CAA5B,EAKH;AACH,QAAMC,WAAW,GAAG,CACnBC,KAAK,CAACC,OAAN,CAAeH,WAAf,IAA+BA,WAA/B,GAA6C,CAAEA,WAAF,CAD1B,EAElBI,IAFkB,CAEVC,GAAF,IAAW;AAAA;;AAClB,UAAMC,SAAS,yBAAGT,aAAa,GAAIQ,GAAJ,CAAhB,mEAA6B,KAA5C,CADkB,CAElB;AACA;AACA;AACA;;AACA,QAAK,sBAAsBA,GAAtB,IAA6BH,KAAK,CAACC,OAAN,CAAeG,SAAf,CAAlC,EAA+D;AAC9D,aAAOA,SAAS,CAACC,QAAV,CAAoBR,QAApB,CAAP;AACA;;AACD,WAAOO,SAAP;AACA,GAZmB,CAApB;;AAcA,MAAK,CAAEL,WAAP,EAAqB;AACpB,WAAO,IAAP;AACA;;AAED,SAAOH,QAAP;AACA;AAED,eAAeN,UAAU,CAAIgB,MAAF,IAAc;AACxC,QAAM;AAAEC,IAAAA;AAAF,MAAuBD,MAAM,CAAEd,SAAF,CAAnC;AACA,QAAM;AAAEgB,IAAAA;AAAF,MAA6BF,MAAM,CAAEb,WAAF,CAAzC;AACA,SAAO;AACNI,IAAAA,QAAQ,EAAEW,sBAAsB,CAAE,MAAF,CAD1B;AAENb,IAAAA,aAAa,EAAEY,gBAAgB;AAFzB,GAAP;AAIA,CAPwB,CAAV,CAOVb,iBAPU,CAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { withSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport function ThemeSupportCheck( {\n\tthemeSupports,\n\tchildren,\n\tpostType,\n\tsupportKeys,\n} ) {\n\tconst isSupported = (\n\t\tArray.isArray( supportKeys ) ? supportKeys : [ supportKeys ]\n\t).some( ( key ) => {\n\t\tconst supported = themeSupports?.[ key ] ?? false;\n\t\t// 'post-thumbnails' can be boolean or an array of post types.\n\t\t// In the latter case, we need to verify `postType` exists\n\t\t// within `supported`. If `postType` isn't passed, then the check\n\t\t// should fail.\n\t\tif ( 'post-thumbnails' === key && Array.isArray( supported ) ) {\n\t\t\treturn supported.includes( postType );\n\t\t}\n\t\treturn supported;\n\t} );\n\n\tif ( ! isSupported ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n\nexport default withSelect( ( select ) => {\n\tconst { getThemeSupports } = select( coreStore );\n\tconst { getEditedPostAttribute } = select( editorStore );\n\treturn {\n\t\tpostType: getEditedPostAttribute( 'type' ),\n\t\tthemeSupports: getThemeSupports(),\n\t};\n} )( ThemeSupportCheck );\n"]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
1
|
import { createElement } from "@wordpress/element";
|
|
3
2
|
|
|
4
3
|
/**
|
|
@@ -39,41 +38,32 @@ import { store as editorStore } from '../store';
|
|
|
39
38
|
* @return {WPHigherOrderComponent} Higher-order component.
|
|
40
39
|
*/
|
|
41
40
|
|
|
42
|
-
const createWithMetaAttributeSource = metaAttributes => createHigherOrderComponent(BlockEdit =>
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
} = _ref;
|
|
41
|
+
const createWithMetaAttributeSource = metaAttributes => createHigherOrderComponent(BlockEdit => ({
|
|
42
|
+
attributes,
|
|
43
|
+
setAttributes,
|
|
44
|
+
...props
|
|
45
|
+
}) => {
|
|
48
46
|
const postType = useSelect(select => select(editorStore).getCurrentPostType(), []);
|
|
49
47
|
const [meta, setMeta] = useEntityProp('postType', postType, 'meta');
|
|
50
48
|
const mergedAttributes = useMemo(() => ({ ...attributes,
|
|
51
|
-
...Object.fromEntries(Object.entries(metaAttributes).map(
|
|
52
|
-
let [attributeKey, metaKey] = _ref2;
|
|
53
|
-
return [attributeKey, meta[metaKey]];
|
|
54
|
-
}))
|
|
49
|
+
...Object.fromEntries(Object.entries(metaAttributes).map(([attributeKey, metaKey]) => [attributeKey, meta[metaKey]]))
|
|
55
50
|
}), [attributes, meta]);
|
|
56
|
-
return createElement(BlockEdit,
|
|
51
|
+
return createElement(BlockEdit, {
|
|
57
52
|
attributes: mergedAttributes,
|
|
58
53
|
setAttributes: nextAttributes => {
|
|
59
54
|
const nextMeta = Object.fromEntries(Object.entries(nextAttributes !== null && nextAttributes !== void 0 ? nextAttributes : {}).filter( // Filter to intersection of keys between the updated
|
|
60
55
|
// attributes and those with an associated meta key.
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
return key in metaAttributes;
|
|
64
|
-
}).map(_ref4 => {
|
|
65
|
-
let [attributeKey, value] = _ref4;
|
|
66
|
-
return [// Rename the keys to the expected meta key name.
|
|
67
|
-
metaAttributes[attributeKey], value];
|
|
68
|
-
}));
|
|
56
|
+
([key]) => key in metaAttributes).map(([attributeKey, value]) => [// Rename the keys to the expected meta key name.
|
|
57
|
+
metaAttributes[attributeKey], value]));
|
|
69
58
|
|
|
70
59
|
if (Object.entries(nextMeta).length) {
|
|
71
60
|
setMeta(nextMeta);
|
|
72
61
|
}
|
|
73
62
|
|
|
74
63
|
setAttributes(nextAttributes);
|
|
75
|
-
}
|
|
76
|
-
|
|
64
|
+
},
|
|
65
|
+
...props
|
|
66
|
+
});
|
|
77
67
|
}, 'withMetaAttributeSource');
|
|
78
68
|
/**
|
|
79
69
|
* Filters a registered block's settings to enhance a block's `edit` component
|
|
@@ -89,17 +79,11 @@ function shimAttributeSource(settings) {
|
|
|
89
79
|
var _settings$attributes;
|
|
90
80
|
|
|
91
81
|
/** @type {WPMetaAttributeMapping} */
|
|
92
|
-
const metaAttributes = Object.fromEntries(Object.entries((_settings$attributes = settings.attributes) !== null && _settings$attributes !== void 0 ? _settings$attributes : {}).filter(
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}).map(_ref6 => {
|
|
98
|
-
let [attributeKey, {
|
|
99
|
-
meta
|
|
100
|
-
}] = _ref6;
|
|
101
|
-
return [attributeKey, meta];
|
|
102
|
-
}));
|
|
82
|
+
const metaAttributes = Object.fromEntries(Object.entries((_settings$attributes = settings.attributes) !== null && _settings$attributes !== void 0 ? _settings$attributes : {}).filter(([, {
|
|
83
|
+
source
|
|
84
|
+
}]) => source === 'meta').map(([attributeKey, {
|
|
85
|
+
meta
|
|
86
|
+
}]) => [attributeKey, meta]));
|
|
103
87
|
|
|
104
88
|
if (Object.entries(metaAttributes).length) {
|
|
105
89
|
settings.edit = createWithMetaAttributeSource(metaAttributes)(settings.edit);
|
|
@@ -127,10 +111,7 @@ addFilter('blocks.registerBlockType', 'core/editor/custom-sources-backwards-comp
|
|
|
127
111
|
// In the future, we could support updating block settings, at which point this
|
|
128
112
|
// implementation could use that mechanism instead.
|
|
129
113
|
|
|
130
|
-
globalSelect(blocksStore).getBlockTypes().map(
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
} = _ref7;
|
|
134
|
-
return globalSelect(blocksStore).getBlockType(name);
|
|
135
|
-
}).forEach(shimAttributeSource);
|
|
114
|
+
globalSelect(blocksStore).getBlockTypes().map(({
|
|
115
|
+
name
|
|
116
|
+
}) => globalSelect(blocksStore).getBlockType(name)).forEach(shimAttributeSource);
|
|
136
117
|
//# sourceMappingURL=custom-sources-backwards-compatibility.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/hooks/custom-sources-backwards-compatibility.js"],"names":["store","blocksStore","select","globalSelect","useSelect","useEntityProp","useMemo","createHigherOrderComponent","addFilter","editorStore","createWithMetaAttributeSource","metaAttributes","BlockEdit","attributes","setAttributes","props","postType","getCurrentPostType","meta","setMeta","mergedAttributes","Object","fromEntries","entries","map","attributeKey","metaKey","nextAttributes","nextMeta","filter","key","value","length","shimAttributeSource","settings","source","edit","getBlockTypes","name","getBlockType","forEach"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/hooks/custom-sources-backwards-compatibility.js"],"names":["store","blocksStore","select","globalSelect","useSelect","useEntityProp","useMemo","createHigherOrderComponent","addFilter","editorStore","createWithMetaAttributeSource","metaAttributes","BlockEdit","attributes","setAttributes","props","postType","getCurrentPostType","meta","setMeta","mergedAttributes","Object","fromEntries","entries","map","attributeKey","metaKey","nextAttributes","nextMeta","filter","key","value","length","shimAttributeSource","settings","source","edit","getBlockTypes","name","getBlockType","forEach"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAlB,QAAqC,mBAArC;AACA,SAASC,MAAM,IAAIC,YAAnB,EAAiCC,SAAjC,QAAkD,iBAAlD;AACA,SAASC,aAAT,QAA8B,sBAA9B;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,0BAAT,QAA2C,oBAA3C;AACA,SAASC,SAAT,QAA0B,kBAA1B;AAEA;AACA;AACA;;AACA,SAASR,KAAK,IAAIS,WAAlB,QAAqC,UAArC;AAEA;;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMC,6BAA6B,GAAKC,cAAF,IACrCJ,0BAA0B,CACvBK,SAAF,IACC,CAAE;AAAEC,EAAAA,UAAF;AAAcC,EAAAA,aAAd;AAA6B,KAAGC;AAAhC,CAAF,KAA+C;AAC9C,QAAMC,QAAQ,GAAGZ,SAAS,CACvBF,MAAF,IAAcA,MAAM,CAAEO,WAAF,CAAN,CAAsBQ,kBAAtB,EADW,EAEzB,EAFyB,CAA1B;AAIA,QAAM,CAAEC,IAAF,EAAQC,OAAR,IAAoBd,aAAa,CACtC,UADsC,EAEtCW,QAFsC,EAGtC,MAHsC,CAAvC;AAMA,QAAMI,gBAAgB,GAAGd,OAAO,CAC/B,OAAQ,EACP,GAAGO,UADI;AAEP,OAAGQ,MAAM,CAACC,WAAP,CACFD,MAAM,CAACE,OAAP,CAAgBZ,cAAhB,EAAiCa,GAAjC,CACC,CAAE,CAAEC,YAAF,EAAgBC,OAAhB,CAAF,KAAiC,CAChCD,YADgC,EAEhCP,IAAI,CAAEQ,OAAF,CAF4B,CADlC,CADE;AAFI,GAAR,CAD+B,EAY/B,CAAEb,UAAF,EAAcK,IAAd,CAZ+B,CAAhC;AAeA,SACC,cAAC,SAAD;AACC,IAAA,UAAU,EAAGE,gBADd;AAEC,IAAA,aAAa,EAAKO,cAAF,IAAsB;AACrC,YAAMC,QAAQ,GAAGP,MAAM,CAACC,WAAP,CAChBD,MAAM,CAACE,OAAP,CAAgBI,cAAhB,aAAgBA,cAAhB,cAAgBA,cAAhB,GAAkC,EAAlC,EACEE,MADF,EAEE;AACA;AACA,OAAE,CAAEC,GAAF,CAAF,KAAeA,GAAG,IAAInB,cAJxB,EAMEa,GANF,CAMO,CAAE,CAAEC,YAAF,EAAgBM,KAAhB,CAAF,KAA+B,CACpC;AACApB,MAAAA,cAAc,CAAEc,YAAF,CAFsB,EAGpCM,KAHoC,CANtC,CADgB,CAAjB;;AAcA,UAAKV,MAAM,CAACE,OAAP,CAAgBK,QAAhB,EAA2BI,MAAhC,EAAyC;AACxCb,QAAAA,OAAO,CAAES,QAAF,CAAP;AACA;;AAEDd,MAAAA,aAAa,CAAEa,cAAF,CAAb;AACA,KAtBF;AAAA,OAuBMZ;AAvBN,IADD;AA2BA,CAvDuB,EAwDzB,yBAxDyB,CAD3B;AA4DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASkB,mBAAT,CAA8BC,QAA9B,EAAyC;AAAA;;AACxC;AACA,QAAMvB,cAAc,GAAGU,MAAM,CAACC,WAAP,CACtBD,MAAM,CAACE,OAAP,yBAAgBW,QAAQ,CAACrB,UAAzB,uEAAuC,EAAvC,EACEgB,MADF,CACU,CAAE,GAAI;AAAEM,IAAAA;AAAF,GAAJ,CAAF,KAAwBA,MAAM,KAAK,MAD7C,EAEEX,GAFF,CAEO,CAAE,CAAEC,YAAF,EAAgB;AAAEP,IAAAA;AAAF,GAAhB,CAAF,KAAkC,CAAEO,YAAF,EAAgBP,IAAhB,CAFzC,CADsB,CAAvB;;AAKA,MAAKG,MAAM,CAACE,OAAP,CAAgBZ,cAAhB,EAAiCqB,MAAtC,EAA+C;AAC9CE,IAAAA,QAAQ,CAACE,IAAT,GAAgB1B,6BAA6B,CAAEC,cAAF,CAA7B,CACfuB,QAAQ,CAACE,IADM,CAAhB;AAGA;;AAED,SAAOF,QAAP;AACA;;AAED1B,SAAS,CACR,0BADQ,EAER,0EAFQ,EAGRyB,mBAHQ,CAAT,C,CAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA9B,YAAY,CAAEF,WAAF,CAAZ,CACEoC,aADF,GAEEb,GAFF,CAEO,CAAE;AAAEc,EAAAA;AAAF,CAAF,KAAgBnC,YAAY,CAAEF,WAAF,CAAZ,CAA4BsC,YAA5B,CAA0CD,IAA1C,CAFvB,EAGEE,OAHF,CAGWP,mBAHX","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { select as globalSelect, useSelect } from '@wordpress/data';\nimport { useEntityProp } from '@wordpress/core-data';\nimport { useMemo } from '@wordpress/element';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../store';\n\n/** @typedef {import('@wordpress/compose').WPHigherOrderComponent} WPHigherOrderComponent */\n/** @typedef {import('@wordpress/blocks').WPBlockSettings} WPBlockSettings */\n\n/**\n * Object whose keys are the names of block attributes, where each value\n * represents the meta key to which the block attribute is intended to save.\n *\n * @see https://developer.wordpress.org/reference/functions/register_meta/\n *\n * @typedef {Object<string,string>} WPMetaAttributeMapping\n */\n\n/**\n * Given a mapping of attribute names (meta source attributes) to their\n * associated meta key, returns a higher order component that overrides its\n * `attributes` and `setAttributes` props to sync any changes with the edited\n * post's meta keys.\n *\n * @param {WPMetaAttributeMapping} metaAttributes Meta attribute mapping.\n *\n * @return {WPHigherOrderComponent} Higher-order component.\n */\nconst createWithMetaAttributeSource = ( metaAttributes ) =>\n\tcreateHigherOrderComponent(\n\t\t( BlockEdit ) =>\n\t\t\t( { attributes, setAttributes, ...props } ) => {\n\t\t\t\tconst postType = useSelect(\n\t\t\t\t\t( select ) => select( editorStore ).getCurrentPostType(),\n\t\t\t\t\t[]\n\t\t\t\t);\n\t\t\t\tconst [ meta, setMeta ] = useEntityProp(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\t'meta'\n\t\t\t\t);\n\n\t\t\t\tconst mergedAttributes = useMemo(\n\t\t\t\t\t() => ( {\n\t\t\t\t\t\t...attributes,\n\t\t\t\t\t\t...Object.fromEntries(\n\t\t\t\t\t\t\tObject.entries( metaAttributes ).map(\n\t\t\t\t\t\t\t\t( [ attributeKey, metaKey ] ) => [\n\t\t\t\t\t\t\t\t\tattributeKey,\n\t\t\t\t\t\t\t\t\tmeta[ metaKey ],\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t} ),\n\t\t\t\t\t[ attributes, meta ]\n\t\t\t\t);\n\n\t\t\t\treturn (\n\t\t\t\t\t<BlockEdit\n\t\t\t\t\t\tattributes={ mergedAttributes }\n\t\t\t\t\t\tsetAttributes={ ( nextAttributes ) => {\n\t\t\t\t\t\t\tconst nextMeta = Object.fromEntries(\n\t\t\t\t\t\t\t\tObject.entries( nextAttributes ?? {} )\n\t\t\t\t\t\t\t\t\t.filter(\n\t\t\t\t\t\t\t\t\t\t// Filter to intersection of keys between the updated\n\t\t\t\t\t\t\t\t\t\t// attributes and those with an associated meta key.\n\t\t\t\t\t\t\t\t\t\t( [ key ] ) => key in metaAttributes\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t.map( ( [ attributeKey, value ] ) => [\n\t\t\t\t\t\t\t\t\t\t// Rename the keys to the expected meta key name.\n\t\t\t\t\t\t\t\t\t\tmetaAttributes[ attributeKey ],\n\t\t\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t\t\t] )\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tif ( Object.entries( nextMeta ).length ) {\n\t\t\t\t\t\t\t\tsetMeta( nextMeta );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tsetAttributes( nextAttributes );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t},\n\t\t'withMetaAttributeSource'\n\t);\n\n/**\n * Filters a registered block's settings to enhance a block's `edit` component\n * to upgrade meta-sourced attributes to use the post's meta entity property.\n *\n * @param {WPBlockSettings} settings Registered block settings.\n *\n * @return {WPBlockSettings} Filtered block settings.\n */\nfunction shimAttributeSource( settings ) {\n\t/** @type {WPMetaAttributeMapping} */\n\tconst metaAttributes = Object.fromEntries(\n\t\tObject.entries( settings.attributes ?? {} )\n\t\t\t.filter( ( [ , { source } ] ) => source === 'meta' )\n\t\t\t.map( ( [ attributeKey, { meta } ] ) => [ attributeKey, meta ] )\n\t);\n\tif ( Object.entries( metaAttributes ).length ) {\n\t\tsettings.edit = createWithMetaAttributeSource( metaAttributes )(\n\t\t\tsettings.edit\n\t\t);\n\t}\n\n\treturn settings;\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/editor/custom-sources-backwards-compatibility/shim-attribute-source',\n\tshimAttributeSource\n);\n\n// The above filter will only capture blocks registered after the filter was\n// added. There may already be blocks registered by this point, and those must\n// be updated to apply the shim.\n//\n// The following implementation achieves this, albeit with a couple caveats:\n// - Only blocks registered on the global store will be modified.\n// - The block settings are directly mutated, since there is currently no\n// mechanism to update an existing block registration. This is the reason for\n// `getBlockType` separate from `getBlockTypes`, since the latter returns a\n// _copy_ of the block registration (i.e. the mutation would not affect the\n// actual registered block settings).\n//\n// `getBlockTypes` or `getBlockType` implementation could change in the future\n// in regards to creating settings clones, but the corresponding end-to-end\n// tests for meta blocks should cover against any potential regressions.\n//\n// In the future, we could support updating block settings, at which point this\n// implementation could use that mechanism instead.\nglobalSelect( blocksStore )\n\t.getBlockTypes()\n\t.map( ( { name } ) => globalSelect( blocksStore ).getBlockType( name ) )\n\t.forEach( shimAttributeSource );\n"]}
|
|
@@ -8,8 +8,7 @@ import { addFilter } from '@wordpress/hooks';
|
|
|
8
8
|
|
|
9
9
|
import { userAutocompleter } from '../components';
|
|
10
10
|
|
|
11
|
-
function setDefaultCompleters() {
|
|
12
|
-
let completers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
11
|
+
function setDefaultCompleters(completers = []) {
|
|
13
12
|
// Provide copies so filters may directly modify them.
|
|
14
13
|
completers.push({ ...userAutocompleter
|
|
15
14
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/hooks/default-autocompleters.js"],"names":["addFilter","userAutocompleter","setDefaultCompleters","completers","push"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,kBAA1B;AAEA;AACA;AACA;;AACA,SAASC,iBAAT,QAAkC,eAAlC;;AAEA,SAASC,oBAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/hooks/default-autocompleters.js"],"names":["addFilter","userAutocompleter","setDefaultCompleters","completers","push"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,kBAA1B;AAEA;AACA;AACA;;AACA,SAASC,iBAAT,QAAkC,eAAlC;;AAEA,SAASC,oBAAT,CAA+BC,UAAU,GAAG,EAA5C,EAAiD;AAChD;AACAA,EAAAA,UAAU,CAACC,IAAX,CAAiB,EAAE,GAAGH;AAAL,GAAjB;AAEA,SAAOE,UAAP;AACA;;AAEDH,SAAS,CACR,gCADQ,EAER,8CAFQ,EAGRE,oBAHQ,CAAT","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport { userAutocompleter } from '../components';\n\nfunction setDefaultCompleters( completers = [] ) {\n\t// Provide copies so filters may directly modify them.\n\tcompleters.push( { ...userAutocompleter } );\n\n\treturn completers;\n}\n\naddFilter(\n\t'editor.Autocomplete.completers',\n\t'editor/autocompleters/set-default-completers',\n\tsetDefaultCompleters\n);\n"]}
|
|
@@ -6,4 +6,4 @@ export const {
|
|
|
6
6
|
lock,
|
|
7
7
|
unlock
|
|
8
8
|
} = __dangerousOptInToUnstableAPIsOnlyForCoreModules('I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.', '@wordpress/editor');
|
|
9
|
-
//# sourceMappingURL=
|
|
9
|
+
//# sourceMappingURL=lock-unlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/lock-unlock.js"],"names":["__dangerousOptInToUnstableAPIsOnlyForCoreModules","lock","unlock"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gDAAT,QAAiE,yBAAjE;AACA,OAAO,MAAM;AAAEC,EAAAA,IAAF;AAAQC,EAAAA;AAAR,IACZF,gDAAgD,CAC/C,8GAD+C,EAE/C,mBAF+C,CAD1C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.',\n\t\t'@wordpress/editor'\n\t);\n"]}
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
* Internal dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { ExperimentalEditorProvider } from './components/provider';
|
|
5
|
-
import { lock } from './
|
|
5
|
+
import { lock } from './lock-unlock';
|
|
6
|
+
import { EntitiesSavedStatesExtensible } from './components/entities-saved-states';
|
|
6
7
|
export const privateApis = {};
|
|
7
8
|
lock(privateApis, {
|
|
8
|
-
ExperimentalEditorProvider
|
|
9
|
+
ExperimentalEditorProvider,
|
|
10
|
+
EntitiesSavedStatesExtensible
|
|
9
11
|
});
|
|
10
12
|
//# sourceMappingURL=private-apis.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/private-apis.js"],"names":["ExperimentalEditorProvider","lock","privateApis"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,0BAAT,QAA2C,uBAA3C;AACA,SAASC,IAAT,QAAqB,
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/private-apis.js"],"names":["ExperimentalEditorProvider","lock","EntitiesSavedStatesExtensible","privateApis"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,0BAAT,QAA2C,uBAA3C;AACA,SAASC,IAAT,QAAqB,eAArB;AACA,SAASC,6BAAT,QAA8C,oCAA9C;AAEA,OAAO,MAAMC,WAAW,GAAG,EAApB;AACPF,IAAI,CAAEE,WAAF,EAAe;AAClBH,EAAAA,0BADkB;AAElBE,EAAAA;AAFkB,CAAf,CAAJ","sourcesContent":["/**\n * Internal dependencies\n */\nimport { ExperimentalEditorProvider } from './components/provider';\nimport { lock } from './lock-unlock';\nimport { EntitiesSavedStatesExtensible } from './components/entities-saved-states';\n\nexport const privateApis = {};\nlock( privateApis, {\n\tExperimentalEditorProvider,\n\tEntitiesSavedStatesExtensible,\n} );\n"]}
|
|
@@ -24,10 +24,9 @@ import { getNotificationArgumentsForSaveSuccess, getNotificationArgumentsForSave
|
|
|
24
24
|
* @param {Array?} template Block Template.
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
|
-
export const setupEditor = (post, edits, template) =>
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
} = _ref;
|
|
27
|
+
export const setupEditor = (post, edits, template) => ({
|
|
28
|
+
dispatch
|
|
29
|
+
}) => {
|
|
31
30
|
dispatch.setupEditorState(post); // Apply a template for new posts only, if exists.
|
|
32
31
|
|
|
33
32
|
const isNewPost = post.status === 'auto-draft';
|
|
@@ -51,11 +50,10 @@ export const setupEditor = (post, edits, template) => _ref => {
|
|
|
51
50
|
});
|
|
52
51
|
}
|
|
53
52
|
|
|
54
|
-
if (edits && Object.values(edits).some(
|
|
55
|
-
var _post$key$raw
|
|
53
|
+
if (edits && Object.values(edits).some(([key, edit]) => {
|
|
54
|
+
var _post$key$raw;
|
|
56
55
|
|
|
57
|
-
|
|
58
|
-
return edit !== ((_post$key$raw = (_post$key = post[key]) === null || _post$key === void 0 ? void 0 : _post$key.raw) !== null && _post$key$raw !== void 0 ? _post$key$raw : post[key]);
|
|
56
|
+
return edit !== ((_post$key$raw = post[key]?.raw) !== null && _post$key$raw !== void 0 ? _post$key$raw : post[key]);
|
|
59
57
|
})) {
|
|
60
58
|
dispatch.editPost(edits);
|
|
61
59
|
}
|
|
@@ -129,11 +127,10 @@ export function setupEditorState(post) {
|
|
|
129
127
|
* @param {Object} options Options for the edit.
|
|
130
128
|
*/
|
|
131
129
|
|
|
132
|
-
export const editPost = (edits, options) =>
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
} = _ref3;
|
|
130
|
+
export const editPost = (edits, options) => ({
|
|
131
|
+
select,
|
|
132
|
+
registry
|
|
133
|
+
}) => {
|
|
137
134
|
const {
|
|
138
135
|
id,
|
|
139
136
|
type
|
|
@@ -146,76 +143,71 @@ export const editPost = (edits, options) => _ref3 => {
|
|
|
146
143
|
* @param {Object} options
|
|
147
144
|
*/
|
|
148
145
|
|
|
149
|
-
export const savePost =
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
146
|
+
export const savePost = (options = {}) => async ({
|
|
147
|
+
select,
|
|
148
|
+
dispatch,
|
|
149
|
+
registry
|
|
150
|
+
}) => {
|
|
151
|
+
if (!select.isEditedPostSaveable()) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
157
154
|
|
|
158
|
-
|
|
159
|
-
return;
|
|
160
|
-
}
|
|
155
|
+
const content = select.getEditedPostContent();
|
|
161
156
|
|
|
162
|
-
|
|
157
|
+
if (!options.isAutosave) {
|
|
158
|
+
dispatch.editPost({
|
|
159
|
+
content
|
|
160
|
+
}, {
|
|
161
|
+
undoIgnore: true
|
|
162
|
+
});
|
|
163
|
+
}
|
|
163
164
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
165
|
+
const previousRecord = select.getCurrentPost();
|
|
166
|
+
const edits = {
|
|
167
|
+
id: previousRecord.id,
|
|
168
|
+
...registry.select(coreStore).getEntityRecordNonTransientEdits('postType', previousRecord.type, previousRecord.id),
|
|
169
|
+
content
|
|
170
|
+
};
|
|
171
|
+
dispatch({
|
|
172
|
+
type: 'REQUEST_POST_UPDATE_START',
|
|
173
|
+
options
|
|
174
|
+
});
|
|
175
|
+
await registry.dispatch(coreStore).saveEntityRecord('postType', previousRecord.type, edits, options);
|
|
176
|
+
dispatch({
|
|
177
|
+
type: 'REQUEST_POST_UPDATE_FINISH',
|
|
178
|
+
options
|
|
179
|
+
});
|
|
180
|
+
const error = registry.select(coreStore).getLastEntitySaveError('postType', previousRecord.type, previousRecord.id);
|
|
171
181
|
|
|
172
|
-
|
|
173
|
-
const
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
};
|
|
178
|
-
dispatch({
|
|
179
|
-
type: 'REQUEST_POST_UPDATE_START',
|
|
180
|
-
options
|
|
182
|
+
if (error) {
|
|
183
|
+
const args = getNotificationArgumentsForSaveFail({
|
|
184
|
+
post: previousRecord,
|
|
185
|
+
edits,
|
|
186
|
+
error
|
|
181
187
|
});
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
188
|
+
|
|
189
|
+
if (args.length) {
|
|
190
|
+
registry.dispatch(noticesStore).createErrorNotice(...args);
|
|
191
|
+
}
|
|
192
|
+
} else {
|
|
193
|
+
const updatedRecord = select.getCurrentPost();
|
|
194
|
+
const args = getNotificationArgumentsForSaveSuccess({
|
|
195
|
+
previousPost: previousRecord,
|
|
196
|
+
post: updatedRecord,
|
|
197
|
+
postType: await registry.resolveSelect(coreStore).getPostType(updatedRecord.type),
|
|
185
198
|
options
|
|
186
199
|
});
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
if (args.length) {
|
|
197
|
-
registry.dispatch(noticesStore).createErrorNotice(...args);
|
|
198
|
-
}
|
|
199
|
-
} else {
|
|
200
|
-
const updatedRecord = select.getCurrentPost();
|
|
201
|
-
const args = getNotificationArgumentsForSaveSuccess({
|
|
202
|
-
previousPost: previousRecord,
|
|
203
|
-
post: updatedRecord,
|
|
204
|
-
postType: await registry.resolveSelect(coreStore).getPostType(updatedRecord.type),
|
|
205
|
-
options
|
|
206
|
-
});
|
|
207
|
-
|
|
208
|
-
if (args.length) {
|
|
209
|
-
registry.dispatch(noticesStore).createSuccessNotice(...args);
|
|
210
|
-
} // Make sure that any edits after saving create an undo level and are
|
|
211
|
-
// considered for change detection.
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
if (!options.isAutosave) {
|
|
215
|
-
registry.dispatch(blockEditorStore).__unstableMarkLastChangeAsPersistent();
|
|
216
|
-
}
|
|
200
|
+
|
|
201
|
+
if (args.length) {
|
|
202
|
+
registry.dispatch(noticesStore).createSuccessNotice(...args);
|
|
203
|
+
} // Make sure that any edits after saving create an undo level and are
|
|
204
|
+
// considered for change detection.
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
if (!options.isAutosave) {
|
|
208
|
+
registry.dispatch(blockEditorStore).__unstableMarkLastChangeAsPersistent();
|
|
217
209
|
}
|
|
218
|
-
}
|
|
210
|
+
}
|
|
219
211
|
};
|
|
220
212
|
/**
|
|
221
213
|
* Action for refreshing the current post.
|
|
@@ -237,12 +229,11 @@ export function refreshPost() {
|
|
|
237
229
|
* Action for trashing the current post in the editor.
|
|
238
230
|
*/
|
|
239
231
|
|
|
240
|
-
export const trashPost = () => async
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
} = _ref5;
|
|
232
|
+
export const trashPost = () => async ({
|
|
233
|
+
select,
|
|
234
|
+
dispatch,
|
|
235
|
+
registry
|
|
236
|
+
}) => {
|
|
246
237
|
const postTypeSlug = select.getCurrentPostType();
|
|
247
238
|
const postType = await registry.resolveSelect(coreStore).getPostType(postTypeSlug);
|
|
248
239
|
registry.dispatch(noticesStore).removeNotice(TRASH_POST_NOTICE_ID);
|
|
@@ -280,50 +271,43 @@ export const trashPost = () => async _ref5 => {
|
|
|
280
271
|
* @param {Object?} options Extra flags to identify the autosave.
|
|
281
272
|
*/
|
|
282
273
|
|
|
283
|
-
export const autosave =
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
isAutosave: true,
|
|
304
|
-
...options
|
|
305
|
-
});
|
|
306
|
-
}
|
|
307
|
-
};
|
|
274
|
+
export const autosave = ({
|
|
275
|
+
local = false,
|
|
276
|
+
...options
|
|
277
|
+
} = {}) => async ({
|
|
278
|
+
select,
|
|
279
|
+
dispatch
|
|
280
|
+
}) => {
|
|
281
|
+
if (local) {
|
|
282
|
+
const post = select.getCurrentPost();
|
|
283
|
+
const isPostNew = select.isEditedPostNew();
|
|
284
|
+
const title = select.getEditedPostAttribute('title');
|
|
285
|
+
const content = select.getEditedPostAttribute('content');
|
|
286
|
+
const excerpt = select.getEditedPostAttribute('excerpt');
|
|
287
|
+
localAutosaveSet(post.id, isPostNew, title, content, excerpt);
|
|
288
|
+
} else {
|
|
289
|
+
await dispatch.savePost({
|
|
290
|
+
isAutosave: true,
|
|
291
|
+
...options
|
|
292
|
+
});
|
|
293
|
+
}
|
|
308
294
|
};
|
|
309
295
|
/**
|
|
310
296
|
* Action that restores last popped state in undo history.
|
|
311
297
|
*/
|
|
312
298
|
|
|
313
|
-
export const redo = () =>
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
} = _ref7;
|
|
299
|
+
export const redo = () => ({
|
|
300
|
+
registry
|
|
301
|
+
}) => {
|
|
317
302
|
registry.dispatch(coreStore).redo();
|
|
318
303
|
};
|
|
319
304
|
/**
|
|
320
305
|
* Action that pops a record from undo history and undoes the edit.
|
|
321
306
|
*/
|
|
322
307
|
|
|
323
|
-
export const undo = () =>
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
} = _ref8;
|
|
308
|
+
export const undo = () => ({
|
|
309
|
+
registry
|
|
310
|
+
}) => {
|
|
327
311
|
registry.dispatch(coreStore).undo();
|
|
328
312
|
};
|
|
329
313
|
/**
|
|
@@ -359,20 +343,18 @@ export function updatePostLock(lock) {
|
|
|
359
343
|
* Enable the publish sidebar.
|
|
360
344
|
*/
|
|
361
345
|
|
|
362
|
-
export const enablePublishSidebar = () =>
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
} = _ref9;
|
|
346
|
+
export const enablePublishSidebar = () => ({
|
|
347
|
+
registry
|
|
348
|
+
}) => {
|
|
366
349
|
registry.dispatch(preferencesStore).set('core/edit-post', 'isPublishSidebarEnabled', true);
|
|
367
350
|
};
|
|
368
351
|
/**
|
|
369
352
|
* Disables the publish sidebar.
|
|
370
353
|
*/
|
|
371
354
|
|
|
372
|
-
export const disablePublishSidebar = () =>
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
} = _ref10;
|
|
355
|
+
export const disablePublishSidebar = () => ({
|
|
356
|
+
registry
|
|
357
|
+
}) => {
|
|
376
358
|
registry.dispatch(preferencesStore).set('core/edit-post', 'isPublishSidebarEnabled', false);
|
|
377
359
|
};
|
|
378
360
|
/**
|
|
@@ -492,49 +474,42 @@ export function unlockPostAutosaving(lockName) {
|
|
|
492
474
|
* @param {?Object} options Optional options.
|
|
493
475
|
*/
|
|
494
476
|
|
|
495
|
-
export const resetEditorBlocks =
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
477
|
+
export const resetEditorBlocks = (blocks, options = {}) => ({
|
|
478
|
+
select,
|
|
479
|
+
dispatch,
|
|
480
|
+
registry
|
|
481
|
+
}) => {
|
|
482
|
+
const {
|
|
483
|
+
__unstableShouldCreateUndoLevel,
|
|
484
|
+
selection
|
|
485
|
+
} = options;
|
|
486
|
+
const edits = {
|
|
487
|
+
blocks,
|
|
488
|
+
selection
|
|
489
|
+
};
|
|
490
|
+
|
|
491
|
+
if (__unstableShouldCreateUndoLevel !== false) {
|
|
503
492
|
const {
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
} =
|
|
507
|
-
const
|
|
508
|
-
blocks,
|
|
509
|
-
selection
|
|
510
|
-
};
|
|
511
|
-
|
|
512
|
-
if (__unstableShouldCreateUndoLevel !== false) {
|
|
513
|
-
const {
|
|
514
|
-
id,
|
|
515
|
-
type
|
|
516
|
-
} = select.getCurrentPost();
|
|
517
|
-
const noChange = registry.select(coreStore).getEditedEntityRecord('postType', type, id).blocks === edits.blocks;
|
|
518
|
-
|
|
519
|
-
if (noChange) {
|
|
520
|
-
registry.dispatch(coreStore).__unstableCreateUndoLevel('postType', type, id);
|
|
521
|
-
|
|
522
|
-
return;
|
|
523
|
-
} // We create a new function here on every persistent edit
|
|
524
|
-
// to make sure the edit makes the post dirty and creates
|
|
525
|
-
// a new undo level.
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
edits.content = _ref12 => {
|
|
529
|
-
let {
|
|
530
|
-
blocks: blocksForSerialization = []
|
|
531
|
-
} = _ref12;
|
|
532
|
-
return __unstableSerializeAndClean(blocksForSerialization);
|
|
533
|
-
};
|
|
534
|
-
}
|
|
493
|
+
id,
|
|
494
|
+
type
|
|
495
|
+
} = select.getCurrentPost();
|
|
496
|
+
const noChange = registry.select(coreStore).getEditedEntityRecord('postType', type, id).blocks === edits.blocks;
|
|
535
497
|
|
|
536
|
-
|
|
537
|
-
|
|
498
|
+
if (noChange) {
|
|
499
|
+
registry.dispatch(coreStore).__unstableCreateUndoLevel('postType', type, id);
|
|
500
|
+
|
|
501
|
+
return;
|
|
502
|
+
} // We create a new function here on every persistent edit
|
|
503
|
+
// to make sure the edit makes the post dirty and creates
|
|
504
|
+
// a new undo level.
|
|
505
|
+
|
|
506
|
+
|
|
507
|
+
edits.content = ({
|
|
508
|
+
blocks: blocksForSerialization = []
|
|
509
|
+
}) => __unstableSerializeAndClean(blocksForSerialization);
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
dispatch.editPost(edits);
|
|
538
513
|
};
|
|
539
514
|
/*
|
|
540
515
|
* Returns an action object used in signalling that the post editor settings have been updated.
|
|
@@ -554,22 +529,15 @@ export function updateEditorSettings(settings) {
|
|
|
554
529
|
* Backward compatibility
|
|
555
530
|
*/
|
|
556
531
|
|
|
557
|
-
const getBlockEditorAction = name =>
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
deprecated("`wp.data.dispatch( 'core/editor' )." + name + '`', {
|
|
567
|
-
since: '5.3',
|
|
568
|
-
alternative: "`wp.data.dispatch( 'core/block-editor' )." + name + '`',
|
|
569
|
-
version: '6.2'
|
|
570
|
-
});
|
|
571
|
-
registry.dispatch(blockEditorStore)[name](...args);
|
|
572
|
-
};
|
|
532
|
+
const getBlockEditorAction = name => (...args) => ({
|
|
533
|
+
registry
|
|
534
|
+
}) => {
|
|
535
|
+
deprecated("`wp.data.dispatch( 'core/editor' )." + name + '`', {
|
|
536
|
+
since: '5.3',
|
|
537
|
+
alternative: "`wp.data.dispatch( 'core/block-editor' )." + name + '`',
|
|
538
|
+
version: '6.2'
|
|
539
|
+
});
|
|
540
|
+
registry.dispatch(blockEditorStore)[name](...args);
|
|
573
541
|
};
|
|
574
542
|
/**
|
|
575
543
|
* @see resetBlocks in core/block-editor store.
|