@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
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { act, renderHook } from '@testing-library/react';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { useIsDirty } from '../hooks/use-is-dirty';
|
|
10
|
+
|
|
11
|
+
jest.mock( '@wordpress/data', () => {
|
|
12
|
+
return {
|
|
13
|
+
useSelect: jest.fn().mockImplementation( ( fn ) => {
|
|
14
|
+
const select = () => {
|
|
15
|
+
return {
|
|
16
|
+
__experimentalGetDirtyEntityRecords: jest
|
|
17
|
+
.fn()
|
|
18
|
+
.mockReturnValue( [
|
|
19
|
+
{
|
|
20
|
+
kind: 'root',
|
|
21
|
+
name: 'site',
|
|
22
|
+
title: 'title',
|
|
23
|
+
property: 'property',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
kind: 'postType',
|
|
27
|
+
name: 'post',
|
|
28
|
+
title: 'title',
|
|
29
|
+
property: 'property',
|
|
30
|
+
},
|
|
31
|
+
] ),
|
|
32
|
+
getEntityRecordEdits: jest.fn().mockReturnValue( {
|
|
33
|
+
title: 'My Site',
|
|
34
|
+
} ),
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
return fn( select );
|
|
38
|
+
} ),
|
|
39
|
+
};
|
|
40
|
+
} );
|
|
41
|
+
|
|
42
|
+
jest.mock( '@wordpress/core-data', () => {
|
|
43
|
+
return {
|
|
44
|
+
store: {
|
|
45
|
+
__experimentalGetDirtyEntityRecords: jest.fn(),
|
|
46
|
+
getEntityRecordEdits: jest.fn(),
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
} );
|
|
50
|
+
|
|
51
|
+
describe( 'useIsDirty', () => {
|
|
52
|
+
it( 'should calculate dirtyEntityRecords', () => {
|
|
53
|
+
const { result } = renderHook( () => useIsDirty() );
|
|
54
|
+
expect( result.current.dirtyEntityRecords ).toEqual( [
|
|
55
|
+
{
|
|
56
|
+
kind: 'postType',
|
|
57
|
+
name: 'post',
|
|
58
|
+
property: 'property',
|
|
59
|
+
title: 'title',
|
|
60
|
+
},
|
|
61
|
+
{ kind: 'root', name: 'site', property: 'title', title: 'Title' },
|
|
62
|
+
] );
|
|
63
|
+
} );
|
|
64
|
+
it( 'should return `isDirty: true` when there are changes', () => {
|
|
65
|
+
const { result } = renderHook( () => useIsDirty() );
|
|
66
|
+
expect( result.current.isDirty ).toBeTruthy();
|
|
67
|
+
} );
|
|
68
|
+
it( 'should return `isDirty: false` when there are NO changes', async () => {
|
|
69
|
+
const { result } = renderHook( () => useIsDirty() );
|
|
70
|
+
act( () => {
|
|
71
|
+
result.current.setUnselectedEntities(
|
|
72
|
+
{
|
|
73
|
+
kind: 'postType',
|
|
74
|
+
name: 'post',
|
|
75
|
+
key: 'key',
|
|
76
|
+
property: 'property',
|
|
77
|
+
},
|
|
78
|
+
false
|
|
79
|
+
);
|
|
80
|
+
} );
|
|
81
|
+
act( () => {
|
|
82
|
+
result.current.setUnselectedEntities(
|
|
83
|
+
{
|
|
84
|
+
kind: 'root',
|
|
85
|
+
name: 'site',
|
|
86
|
+
key: 'key',
|
|
87
|
+
property: 'property',
|
|
88
|
+
},
|
|
89
|
+
false
|
|
90
|
+
);
|
|
91
|
+
} );
|
|
92
|
+
expect( result.current.isDirty ).toBeFalsy();
|
|
93
|
+
} );
|
|
94
|
+
} );
|
package/src/components/index.js
CHANGED
|
@@ -13,6 +13,7 @@ export { default as EditorHistoryUndo } from './editor-history/undo';
|
|
|
13
13
|
export { default as EditorNotices } from './editor-notices';
|
|
14
14
|
export { default as EditorSnackbars } from './editor-snackbars';
|
|
15
15
|
export { default as EntitiesSavedStates } from './entities-saved-states';
|
|
16
|
+
export { useIsDirty as useEntitiesSavedStatesIsDirty } from './entities-saved-states/hooks/use-is-dirty';
|
|
16
17
|
export { default as ErrorBoundary } from './error-boundary';
|
|
17
18
|
export { default as LocalAutosaveMonitor } from './local-autosave-monitor';
|
|
18
19
|
export { default as PageAttributesCheck } from './page-attributes/check';
|
|
@@ -50,6 +51,7 @@ export { default as PostSlugCheck } from './post-slug/check';
|
|
|
50
51
|
export { default as PostSticky } from './post-sticky';
|
|
51
52
|
export { default as PostStickyCheck } from './post-sticky/check';
|
|
52
53
|
export { default as PostSwitchToDraftButton } from './post-switch-to-draft-button';
|
|
54
|
+
export { default as PostSyncStatus } from './post-sync-status';
|
|
53
55
|
export { default as PostTaxonomies } from './post-taxonomies';
|
|
54
56
|
export { FlatTermSelector as PostTaxonomiesFlatTermSelector } from './post-taxonomies/flat-term-selector';
|
|
55
57
|
export { HierarchicalTermSelector as PostTaxonomiesHierarchicalTermSelector } from './post-taxonomies/hierarchical-term-selector';
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import {
|
|
5
|
+
PanelBody,
|
|
6
|
+
Button,
|
|
7
|
+
Spinner,
|
|
8
|
+
__unstableMotion as motion,
|
|
9
|
+
__unstableAnimatePresence as AnimatePresence,
|
|
10
|
+
} from '@wordpress/components';
|
|
11
|
+
import { useSelect, useDispatch } from '@wordpress/data';
|
|
12
|
+
import { __ } from '@wordpress/i18n';
|
|
13
|
+
import { upload } from '@wordpress/icons';
|
|
14
|
+
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
15
|
+
import { useState } from '@wordpress/element';
|
|
16
|
+
import { isBlobURL } from '@wordpress/blob';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Internal dependencies
|
|
20
|
+
*/
|
|
21
|
+
import { store as editorStore } from '../../store';
|
|
22
|
+
|
|
23
|
+
function flattenBlocks( blocks ) {
|
|
24
|
+
const result = [];
|
|
25
|
+
|
|
26
|
+
blocks.forEach( ( block ) => {
|
|
27
|
+
result.push( block );
|
|
28
|
+
result.push( ...flattenBlocks( block.innerBlocks ) );
|
|
29
|
+
} );
|
|
30
|
+
|
|
31
|
+
return result;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function Image( block ) {
|
|
35
|
+
const { selectBlock } = useDispatch( blockEditorStore );
|
|
36
|
+
return (
|
|
37
|
+
<motion.img
|
|
38
|
+
tabIndex={ 0 }
|
|
39
|
+
role="button"
|
|
40
|
+
aria-label={ __( 'Select image block.' ) }
|
|
41
|
+
onClick={ () => {
|
|
42
|
+
selectBlock( block.clientId );
|
|
43
|
+
} }
|
|
44
|
+
onKeyDown={ ( event ) => {
|
|
45
|
+
if ( event.key === 'Enter' || event.key === ' ' ) {
|
|
46
|
+
selectBlock( block.clientId );
|
|
47
|
+
event.preventDefault();
|
|
48
|
+
}
|
|
49
|
+
} }
|
|
50
|
+
key={ block.clientId }
|
|
51
|
+
alt={ block.attributes.alt }
|
|
52
|
+
src={ block.attributes.url }
|
|
53
|
+
animate={ { opacity: 1 } }
|
|
54
|
+
exit={ { opacity: 0, scale: 0 } }
|
|
55
|
+
style={ {
|
|
56
|
+
width: '36px',
|
|
57
|
+
height: '36px',
|
|
58
|
+
objectFit: 'cover',
|
|
59
|
+
borderRadius: '2px',
|
|
60
|
+
cursor: 'pointer',
|
|
61
|
+
} }
|
|
62
|
+
whileHover={ { scale: 1.08 } }
|
|
63
|
+
/>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export default function PostFormatPanel() {
|
|
68
|
+
const [ isUploading, setIsUploading ] = useState( false );
|
|
69
|
+
const { editorBlocks, mediaUpload } = useSelect(
|
|
70
|
+
( select ) => ( {
|
|
71
|
+
editorBlocks: select( editorStore ).getEditorBlocks(),
|
|
72
|
+
mediaUpload: select( blockEditorStore ).getSettings().mediaUpload,
|
|
73
|
+
} ),
|
|
74
|
+
[]
|
|
75
|
+
);
|
|
76
|
+
const externalImages = flattenBlocks( editorBlocks ).filter(
|
|
77
|
+
( block ) =>
|
|
78
|
+
block.name === 'core/image' &&
|
|
79
|
+
block.attributes.url &&
|
|
80
|
+
! block.attributes.id
|
|
81
|
+
);
|
|
82
|
+
const { updateBlockAttributes } = useDispatch( blockEditorStore );
|
|
83
|
+
|
|
84
|
+
if ( ! mediaUpload || ! externalImages.length ) {
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const panelBodyTitle = [
|
|
89
|
+
__( 'Suggestion:' ),
|
|
90
|
+
<span className="editor-post-publish-panel__link" key="label">
|
|
91
|
+
{ __( 'External media' ) }
|
|
92
|
+
</span>,
|
|
93
|
+
];
|
|
94
|
+
|
|
95
|
+
function uploadImages() {
|
|
96
|
+
setIsUploading( true );
|
|
97
|
+
Promise.all(
|
|
98
|
+
externalImages.map( ( image ) =>
|
|
99
|
+
window
|
|
100
|
+
.fetch(
|
|
101
|
+
image.attributes.url.includes( '?' )
|
|
102
|
+
? image.attributes.url
|
|
103
|
+
: image.attributes.url + '?'
|
|
104
|
+
)
|
|
105
|
+
.then( ( response ) => response.blob() )
|
|
106
|
+
.then(
|
|
107
|
+
( blob ) =>
|
|
108
|
+
new Promise( ( resolve, reject ) => {
|
|
109
|
+
mediaUpload( {
|
|
110
|
+
filesList: [ blob ],
|
|
111
|
+
onFileChange: ( [ media ] ) => {
|
|
112
|
+
if ( isBlobURL( media.url ) ) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
updateBlockAttributes( image.clientId, {
|
|
117
|
+
id: media.id,
|
|
118
|
+
url: media.url,
|
|
119
|
+
} );
|
|
120
|
+
resolve();
|
|
121
|
+
},
|
|
122
|
+
onError() {
|
|
123
|
+
reject();
|
|
124
|
+
},
|
|
125
|
+
} );
|
|
126
|
+
} )
|
|
127
|
+
)
|
|
128
|
+
)
|
|
129
|
+
).finally( () => {
|
|
130
|
+
setIsUploading( false );
|
|
131
|
+
} );
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
return (
|
|
135
|
+
<PanelBody initialOpen={ true } title={ panelBodyTitle }>
|
|
136
|
+
<p>
|
|
137
|
+
{ __(
|
|
138
|
+
'There are some external images in the post which can be uploaded to the media library. Images coming from different domains may not always display correctly, load slowly for visitors, or be removed unexpectedly.'
|
|
139
|
+
) }
|
|
140
|
+
</p>
|
|
141
|
+
<div
|
|
142
|
+
style={ {
|
|
143
|
+
display: 'inline-flex',
|
|
144
|
+
flexWrap: 'wrap',
|
|
145
|
+
gap: '8px',
|
|
146
|
+
} }
|
|
147
|
+
>
|
|
148
|
+
<AnimatePresence>
|
|
149
|
+
{ externalImages.map( ( image ) => {
|
|
150
|
+
return <Image key={ image.clientId } { ...image } />;
|
|
151
|
+
} ) }
|
|
152
|
+
</AnimatePresence>
|
|
153
|
+
{ isUploading ? (
|
|
154
|
+
<Spinner />
|
|
155
|
+
) : (
|
|
156
|
+
<Button
|
|
157
|
+
icon={ upload }
|
|
158
|
+
variant="primary"
|
|
159
|
+
onClick={ uploadImages }
|
|
160
|
+
>
|
|
161
|
+
{ __( 'Upload all' ) }
|
|
162
|
+
</Button>
|
|
163
|
+
) }
|
|
164
|
+
</div>
|
|
165
|
+
</PanelBody>
|
|
166
|
+
);
|
|
167
|
+
}
|
|
@@ -20,6 +20,7 @@ import MaybeTagsPanel from './maybe-tags-panel';
|
|
|
20
20
|
import MaybePostFormatPanel from './maybe-post-format-panel';
|
|
21
21
|
import { store as editorStore } from '../../store';
|
|
22
22
|
import MaybeCategoryPanel from './maybe-category-panel';
|
|
23
|
+
import MaybeUploadMedia from './maybe-upload-media';
|
|
23
24
|
|
|
24
25
|
function PostPublishPanelPrepublish( { children } ) {
|
|
25
26
|
const {
|
|
@@ -103,6 +104,7 @@ function PostPublishPanelPrepublish( { children } ) {
|
|
|
103
104
|
<span className="components-site-home">{ siteHome }</span>
|
|
104
105
|
</div>
|
|
105
106
|
</div>
|
|
107
|
+
<MaybeUploadMedia />
|
|
106
108
|
{ hasPublishAction && (
|
|
107
109
|
<>
|
|
108
110
|
<PanelBody
|
|
@@ -47,8 +47,10 @@ export default function PostSavedState( {
|
|
|
47
47
|
isDirty,
|
|
48
48
|
isNew,
|
|
49
49
|
isPending,
|
|
50
|
+
isPublished,
|
|
50
51
|
isSaveable,
|
|
51
52
|
isSaving,
|
|
53
|
+
isScheduled,
|
|
52
54
|
hasPublishAction,
|
|
53
55
|
} = useSelect(
|
|
54
56
|
( select ) => {
|
|
@@ -103,6 +105,10 @@ export default function PostSavedState( {
|
|
|
103
105
|
return null;
|
|
104
106
|
}
|
|
105
107
|
|
|
108
|
+
if ( isPublished || isScheduled ) {
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
|
|
106
112
|
/* translators: button label text should, if possible, be under 16 characters. */
|
|
107
113
|
const label = isPending ? __( 'Save as pending' ) : __( 'Save draft' );
|
|
108
114
|
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useSelect, useDispatch } from '@wordpress/data';
|
|
5
|
+
import { __ } from '@wordpress/i18n';
|
|
6
|
+
import { ToggleControl, PanelRow } from '@wordpress/components';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Internal dependencies
|
|
10
|
+
*/
|
|
11
|
+
import { store as editorStore } from '../../store';
|
|
12
|
+
|
|
13
|
+
export default function PostSyncStatus() {
|
|
14
|
+
const { editPost } = useDispatch( editorStore );
|
|
15
|
+
const { meta, postType } = useSelect( ( select ) => {
|
|
16
|
+
const { getEditedPostAttribute } = select( editorStore );
|
|
17
|
+
return {
|
|
18
|
+
meta: getEditedPostAttribute( 'meta' ),
|
|
19
|
+
postType: getEditedPostAttribute( 'type' ),
|
|
20
|
+
};
|
|
21
|
+
}, [] );
|
|
22
|
+
if ( postType !== 'wp_block' ) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
const onUpdateSync = ( syncStatus ) =>
|
|
26
|
+
editPost( {
|
|
27
|
+
meta: {
|
|
28
|
+
...meta,
|
|
29
|
+
wp_block:
|
|
30
|
+
syncStatus === 'unsynced'
|
|
31
|
+
? { sync_status: syncStatus }
|
|
32
|
+
: null,
|
|
33
|
+
},
|
|
34
|
+
} );
|
|
35
|
+
const syncStatus = meta?.wp_block?.sync_status;
|
|
36
|
+
const isFullySynced = ! syncStatus;
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<PanelRow className="edit-post-sync-status">
|
|
40
|
+
<span>{ __( 'Syncing' ) }</span>
|
|
41
|
+
<ToggleControl
|
|
42
|
+
__nextHasNoMarginBottom
|
|
43
|
+
label={
|
|
44
|
+
isFullySynced ? __( 'Fully synced' ) : __( 'Not synced' )
|
|
45
|
+
}
|
|
46
|
+
checked={ isFullySynced }
|
|
47
|
+
onChange={ () => {
|
|
48
|
+
onUpdateSync(
|
|
49
|
+
syncStatus === 'unsynced' ? 'fully' : 'unsynced'
|
|
50
|
+
);
|
|
51
|
+
} }
|
|
52
|
+
/>
|
|
53
|
+
</PanelRow>
|
|
54
|
+
);
|
|
55
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
.edit-post-sync-status {
|
|
2
|
+
width: 100%;
|
|
3
|
+
position: relative;
|
|
4
|
+
justify-content: flex-start;
|
|
5
|
+
|
|
6
|
+
> span {
|
|
7
|
+
display: block;
|
|
8
|
+
width: 45%;
|
|
9
|
+
flex-shrink: 0;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.components-base-control {
|
|
13
|
+
// Match padding on tertiary buttons for alignment.
|
|
14
|
+
padding-left: $grid-unit-15 * 0.5;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import escapeHtml from 'escape-html';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* WordPress dependencies
|
|
8
3
|
*/
|
|
@@ -12,7 +7,6 @@ import { FormTokenField, withFilters } from '@wordpress/components';
|
|
|
12
7
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
13
8
|
import { store as coreStore } from '@wordpress/core-data';
|
|
14
9
|
import { useDebounce } from '@wordpress/compose';
|
|
15
|
-
import apiFetch from '@wordpress/api-fetch';
|
|
16
10
|
import { speak } from '@wordpress/a11y';
|
|
17
11
|
|
|
18
12
|
/**
|
|
@@ -51,28 +45,6 @@ const termNamesToIds = ( names, terms ) => {
|
|
|
51
45
|
);
|
|
52
46
|
};
|
|
53
47
|
|
|
54
|
-
// Tries to create a term or fetch it if it already exists.
|
|
55
|
-
function findOrCreateTerm( termName, restBase, namespace ) {
|
|
56
|
-
const escapedTermName = escapeHtml( termName );
|
|
57
|
-
|
|
58
|
-
return apiFetch( {
|
|
59
|
-
path: `/${ namespace }/${ restBase }`,
|
|
60
|
-
method: 'POST',
|
|
61
|
-
data: { name: escapedTermName },
|
|
62
|
-
} )
|
|
63
|
-
.catch( ( error ) => {
|
|
64
|
-
if ( error.code !== 'term_exists' ) {
|
|
65
|
-
return Promise.reject( error );
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
return Promise.resolve( {
|
|
69
|
-
id: error.data.term_id,
|
|
70
|
-
name: termName,
|
|
71
|
-
} );
|
|
72
|
-
} )
|
|
73
|
-
.then( unescapeTerm );
|
|
74
|
-
}
|
|
75
|
-
|
|
76
48
|
export function FlatTermSelector( { slug } ) {
|
|
77
49
|
const [ values, setValues ] = useState( [] );
|
|
78
50
|
const [ search, setSearch ] = useState( '' );
|
|
@@ -165,11 +137,30 @@ export function FlatTermSelector( { slug } ) {
|
|
|
165
137
|
}, [ searchResults ] );
|
|
166
138
|
|
|
167
139
|
const { editPost } = useDispatch( editorStore );
|
|
140
|
+
const { saveEntityRecord } = useDispatch( coreStore );
|
|
168
141
|
|
|
169
142
|
if ( ! hasAssignAction ) {
|
|
170
143
|
return null;
|
|
171
144
|
}
|
|
172
145
|
|
|
146
|
+
async function findOrCreateTerm( term ) {
|
|
147
|
+
try {
|
|
148
|
+
const newTerm = await saveEntityRecord( 'taxonomy', slug, term, {
|
|
149
|
+
throwOnError: true,
|
|
150
|
+
} );
|
|
151
|
+
return unescapeTerm( newTerm );
|
|
152
|
+
} catch ( error ) {
|
|
153
|
+
if ( error.code !== 'term_exists' ) {
|
|
154
|
+
throw error;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
return {
|
|
158
|
+
id: error.data.term_id,
|
|
159
|
+
name: term.name,
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
173
164
|
function onUpdateTerms( newTermIds ) {
|
|
174
165
|
editPost( { [ taxonomy.rest_base ]: newTermIds } );
|
|
175
166
|
}
|
|
@@ -209,10 +200,9 @@ export function FlatTermSelector( { slug } ) {
|
|
|
209
200
|
return;
|
|
210
201
|
}
|
|
211
202
|
|
|
212
|
-
const namespace = taxonomy?.rest_namespace ?? 'wp/v2';
|
|
213
203
|
Promise.all(
|
|
214
204
|
newTermNames.map( ( termName ) =>
|
|
215
|
-
findOrCreateTerm( termName
|
|
205
|
+
findOrCreateTerm( { name: termName } )
|
|
216
206
|
)
|
|
217
207
|
).then( ( newTerms ) => {
|
|
218
208
|
const newAvailableTerms = availableTerms.concat( newTerms );
|
|
@@ -74,7 +74,10 @@ function PostTitle( _, forwardedRef ) {
|
|
|
74
74
|
return;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
const {
|
|
77
|
+
const { defaultView } = ref.current.ownerDocument;
|
|
78
|
+
const { name, parent } = defaultView;
|
|
79
|
+
const ownerDocument =
|
|
80
|
+
name === 'editor-canvas' ? parent.document : defaultView.document;
|
|
78
81
|
const { activeElement, body } = ownerDocument;
|
|
79
82
|
|
|
80
83
|
// Only autofocus the title when the post is entirely empty. This should
|
|
@@ -19,7 +19,7 @@ import { store as noticesStore } from '@wordpress/notices';
|
|
|
19
19
|
import withRegistryProvider from './with-registry-provider';
|
|
20
20
|
import { store as editorStore } from '../../store';
|
|
21
21
|
import useBlockEditorSettings from './use-block-editor-settings';
|
|
22
|
-
import { unlock } from '../../
|
|
22
|
+
import { unlock } from '../../lock-unlock';
|
|
23
23
|
|
|
24
24
|
const { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );
|
|
25
25
|
|
|
@@ -319,8 +319,6 @@ class NativeEditorProvider extends Component {
|
|
|
319
319
|
const { mode, switchMode } = this.props;
|
|
320
320
|
// Refresh html content first.
|
|
321
321
|
this.serializeToNativeAction();
|
|
322
|
-
// Make sure to blur the selected block and dismiss the keyboard.
|
|
323
|
-
this.props.clearSelectedBlock();
|
|
324
322
|
switchMode( mode === 'visual' ? 'text' : 'visual' );
|
|
325
323
|
}
|
|
326
324
|
|
|
@@ -387,12 +385,8 @@ const ComposedNativeProvider = compose( [
|
|
|
387
385
|
withDispatch( ( dispatch ) => {
|
|
388
386
|
const { editPost, resetEditorBlocks, updateEditorSettings } =
|
|
389
387
|
dispatch( editorStore );
|
|
390
|
-
const {
|
|
391
|
-
|
|
392
|
-
clearSelectedBlock,
|
|
393
|
-
insertBlock,
|
|
394
|
-
replaceBlock,
|
|
395
|
-
} = dispatch( blockEditorStore );
|
|
388
|
+
const { updateSettings, insertBlock, replaceBlock } =
|
|
389
|
+
dispatch( blockEditorStore );
|
|
396
390
|
const { switchEditorMode } = dispatch( editPostStore );
|
|
397
391
|
const { addEntities, receiveEntityRecords } = dispatch( coreStore );
|
|
398
392
|
const { createSuccessNotice } = dispatch( noticesStore );
|
|
@@ -401,7 +395,6 @@ const ComposedNativeProvider = compose( [
|
|
|
401
395
|
updateBlockEditorSettings: updateSettings,
|
|
402
396
|
updateEditorSettings,
|
|
403
397
|
addEntities,
|
|
404
|
-
clearSelectedBlock,
|
|
405
398
|
insertBlock,
|
|
406
399
|
createSuccessNotice,
|
|
407
400
|
editTitle( title ) {
|
package/src/private-apis.js
CHANGED
|
@@ -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
|
|
|
7
8
|
export const privateApis = {};
|
|
8
9
|
lock( privateApis, {
|
|
9
10
|
ExperimentalEditorProvider,
|
|
11
|
+
EntitiesSavedStatesExtensible,
|
|
10
12
|
} );
|
package/src/style.scss
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
@import "./components/post-publish-button/style.scss";
|
|
12
12
|
@import "./components/post-publish-panel/style.scss";
|
|
13
13
|
@import "./components/post-saved-state/style.scss";
|
|
14
|
+
@import "./components/post-sync-status/style.scss";
|
|
14
15
|
@import "./components/post-taxonomies/style.scss";
|
|
15
16
|
@import "./components/post-text-editor/style.scss";
|
|
16
17
|
@import "./components/post-url/style.scss";
|
package/build/lockUnlock.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/lockUnlock.js"],"names":["lock","unlock"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;AAEO,MAAM;AAAEA,EAAAA,IAAF;AAAQC,EAAAA;AAAR,IACZ,mEACC,8GADD,EAEC,mBAFD,CADM","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"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/lockUnlock.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"]}
|
|
File without changes
|