@wordpress/editor 13.10.0 → 13.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/build/components/autosave-monitor/index.js +1 -2
- package/build/components/autosave-monitor/index.js.map +1 -1
- package/build/components/deprecated.js +3 -4
- 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 +4 -5
- 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 +19 -24
- 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-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 +84 -0
- package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -0
- package/build/components/entities-saved-states/index.js +42 -110
- 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 +9 -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 +5 -8
- 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/index.js +4 -5
- package/build/components/post-excerpt/index.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 +4 -5
- 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 +6 -13
- 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 +6 -7
- 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/postpublish.js +8 -11
- package/build/components/post-publish-panel/postpublish.js.map +1 -1
- package/build/components/post-publish-panel/prepublish.js +5 -6
- 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-taxonomies/check.js +6 -7
- package/build/components/post-taxonomies/check.js.map +1 -1
- package/build/components/post-taxonomies/flat-term-selector.js +13 -14
- 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 +2 -6
- 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 +10 -12
- 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 +9 -10
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/index.native.js +14 -20
- package/build/components/provider/index.native.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.js +6 -10
- 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/table-of-contents/index.js +26 -33
- 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 +16 -35
- 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/private-apis.js +4 -1
- 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 +3 -4
- 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 +4 -5
- 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 +19 -23
- 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-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 +70 -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 +43 -113
- 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 +1 -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 +5 -8
- 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/index.js +4 -5
- package/build-module/components/post-excerpt/index.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 +4 -5
- 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 +6 -13
- 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 +6 -7
- 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/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 +5 -6
- 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-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 +13 -14
- 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 +2 -6
- 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 +10 -12
- 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 +9 -10
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/index.native.js +14 -20
- package/build-module/components/provider/index.native.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.js +6 -10
- 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/table-of-contents/index.js +26 -33
- 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 +16 -35
- 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/private-apis.js +3 -1
- 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 +1 -1
- package/build-style/style.css +1 -1
- package/package.json +31 -31
- package/src/components/entities-saved-states/hooks/use-is-dirty.js +85 -0
- package/src/components/entities-saved-states/index.js +29 -107
- package/src/components/entities-saved-states/test/use-is-dirty.js +94 -0
- package/src/components/index.js +1 -0
- package/src/components/post-saved-state/index.js +6 -0
- package/src/components/post-taxonomies/flat-term-selector.js +1 -1
- package/src/components/post-title/index.js +2 -1
- package/src/components/provider/use-block-editor-settings.js +1 -0
- package/src/private-apis.js +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/editor",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.12.0",
|
|
4
4
|
"description": "Enhanced block editor for WordPress posts.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -31,38 +31,38 @@
|
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@babel/runtime": "^7.16.0",
|
|
34
|
-
"@wordpress/a11y": "^3.
|
|
35
|
-
"@wordpress/api-fetch": "^6.
|
|
36
|
-
"@wordpress/blob": "^3.
|
|
37
|
-
"@wordpress/block-editor": "^12.
|
|
38
|
-
"@wordpress/blocks": "^12.
|
|
39
|
-
"@wordpress/components": "^
|
|
40
|
-
"@wordpress/compose": "^6.
|
|
41
|
-
"@wordpress/core-data": "^6.
|
|
42
|
-
"@wordpress/data": "^9.
|
|
43
|
-
"@wordpress/date": "^4.
|
|
44
|
-
"@wordpress/deprecated": "^3.
|
|
45
|
-
"@wordpress/dom": "^3.
|
|
46
|
-
"@wordpress/element": "^5.
|
|
47
|
-
"@wordpress/hooks": "^3.
|
|
48
|
-
"@wordpress/html-entities": "^3.
|
|
49
|
-
"@wordpress/i18n": "^4.
|
|
50
|
-
"@wordpress/icons": "^9.
|
|
51
|
-
"@wordpress/keyboard-shortcuts": "^4.
|
|
52
|
-
"@wordpress/keycodes": "^3.
|
|
53
|
-
"@wordpress/media-utils": "^4.
|
|
54
|
-
"@wordpress/notices": "^4.
|
|
55
|
-
"@wordpress/preferences": "^3.
|
|
56
|
-
"@wordpress/private-apis": "^0.
|
|
57
|
-
"@wordpress/reusable-blocks": "^4.
|
|
58
|
-
"@wordpress/rich-text": "^6.
|
|
59
|
-
"@wordpress/server-side-render": "^4.
|
|
60
|
-
"@wordpress/url": "^3.
|
|
61
|
-
"@wordpress/wordcount": "^3.
|
|
34
|
+
"@wordpress/a11y": "^3.35.0",
|
|
35
|
+
"@wordpress/api-fetch": "^6.32.0",
|
|
36
|
+
"@wordpress/blob": "^3.35.0",
|
|
37
|
+
"@wordpress/block-editor": "^12.3.0",
|
|
38
|
+
"@wordpress/blocks": "^12.12.0",
|
|
39
|
+
"@wordpress/components": "^25.1.0",
|
|
40
|
+
"@wordpress/compose": "^6.12.0",
|
|
41
|
+
"@wordpress/core-data": "^6.12.0",
|
|
42
|
+
"@wordpress/data": "^9.5.0",
|
|
43
|
+
"@wordpress/date": "^4.35.0",
|
|
44
|
+
"@wordpress/deprecated": "^3.35.0",
|
|
45
|
+
"@wordpress/dom": "^3.35.0",
|
|
46
|
+
"@wordpress/element": "^5.12.0",
|
|
47
|
+
"@wordpress/hooks": "^3.35.0",
|
|
48
|
+
"@wordpress/html-entities": "^3.35.0",
|
|
49
|
+
"@wordpress/i18n": "^4.35.0",
|
|
50
|
+
"@wordpress/icons": "^9.26.0",
|
|
51
|
+
"@wordpress/keyboard-shortcuts": "^4.12.0",
|
|
52
|
+
"@wordpress/keycodes": "^3.35.0",
|
|
53
|
+
"@wordpress/media-utils": "^4.26.0",
|
|
54
|
+
"@wordpress/notices": "^4.3.0",
|
|
55
|
+
"@wordpress/preferences": "^3.12.0",
|
|
56
|
+
"@wordpress/private-apis": "^0.17.0",
|
|
57
|
+
"@wordpress/reusable-blocks": "^4.12.0",
|
|
58
|
+
"@wordpress/rich-text": "^6.12.0",
|
|
59
|
+
"@wordpress/server-side-render": "^4.12.0",
|
|
60
|
+
"@wordpress/url": "^3.36.0",
|
|
61
|
+
"@wordpress/wordcount": "^3.35.0",
|
|
62
62
|
"classnames": "^2.3.1",
|
|
63
63
|
"date-fns": "^2.28.0",
|
|
64
64
|
"escape-html": "^1.0.3",
|
|
65
|
-
"memize": "^
|
|
65
|
+
"memize": "^2.1.0",
|
|
66
66
|
"react-autosize-textarea": "^7.1.0",
|
|
67
67
|
"rememo": "^4.0.2",
|
|
68
68
|
"remove-accents": "^0.4.2"
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
"publishConfig": {
|
|
75
75
|
"access": "public"
|
|
76
76
|
},
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "a92f606309b1541b834ff9b0a76ed2a466fc45ed"
|
|
78
78
|
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useSelect } from '@wordpress/data';
|
|
5
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
6
|
+
import { useState } from '@wordpress/element';
|
|
7
|
+
import { __ } from '@wordpress/i18n';
|
|
8
|
+
|
|
9
|
+
const TRANSLATED_SITE_PROPERTIES = {
|
|
10
|
+
title: __( 'Title' ),
|
|
11
|
+
description: __( 'Tagline' ),
|
|
12
|
+
site_logo: __( 'Logo' ),
|
|
13
|
+
site_icon: __( 'Icon' ),
|
|
14
|
+
show_on_front: __( 'Show on front' ),
|
|
15
|
+
page_on_front: __( 'Page on front' ),
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const useIsDirty = () => {
|
|
19
|
+
const { dirtyEntityRecords } = useSelect( ( select ) => {
|
|
20
|
+
const dirtyRecords =
|
|
21
|
+
select( coreStore ).__experimentalGetDirtyEntityRecords();
|
|
22
|
+
|
|
23
|
+
// Remove site object and decouple into its edited pieces.
|
|
24
|
+
const dirtyRecordsWithoutSite = dirtyRecords.filter(
|
|
25
|
+
( record ) => ! ( record.kind === 'root' && record.name === 'site' )
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
const siteEdits = select( coreStore ).getEntityRecordEdits(
|
|
29
|
+
'root',
|
|
30
|
+
'site'
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
const siteEditsAsEntities = [];
|
|
34
|
+
for ( const property in siteEdits ) {
|
|
35
|
+
siteEditsAsEntities.push( {
|
|
36
|
+
kind: 'root',
|
|
37
|
+
name: 'site',
|
|
38
|
+
title: TRANSLATED_SITE_PROPERTIES[ property ] || property,
|
|
39
|
+
property,
|
|
40
|
+
} );
|
|
41
|
+
}
|
|
42
|
+
const dirtyRecordsWithSiteItems = [
|
|
43
|
+
...dirtyRecordsWithoutSite,
|
|
44
|
+
...siteEditsAsEntities,
|
|
45
|
+
];
|
|
46
|
+
|
|
47
|
+
return {
|
|
48
|
+
dirtyEntityRecords: dirtyRecordsWithSiteItems,
|
|
49
|
+
};
|
|
50
|
+
}, [] );
|
|
51
|
+
|
|
52
|
+
// Unchecked entities to be ignored by save function.
|
|
53
|
+
const [ unselectedEntities, _setUnselectedEntities ] = useState( [] );
|
|
54
|
+
|
|
55
|
+
const setUnselectedEntities = (
|
|
56
|
+
{ kind, name, key, property },
|
|
57
|
+
checked
|
|
58
|
+
) => {
|
|
59
|
+
if ( checked ) {
|
|
60
|
+
_setUnselectedEntities(
|
|
61
|
+
unselectedEntities.filter(
|
|
62
|
+
( elt ) =>
|
|
63
|
+
elt.kind !== kind ||
|
|
64
|
+
elt.name !== name ||
|
|
65
|
+
elt.key !== key ||
|
|
66
|
+
elt.property !== property
|
|
67
|
+
)
|
|
68
|
+
);
|
|
69
|
+
} else {
|
|
70
|
+
_setUnselectedEntities( [
|
|
71
|
+
...unselectedEntities,
|
|
72
|
+
{ kind, name, key, property },
|
|
73
|
+
] );
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
const isDirty = dirtyEntityRecords.length - unselectedEntities.length > 0;
|
|
78
|
+
|
|
79
|
+
return {
|
|
80
|
+
dirtyEntityRecords,
|
|
81
|
+
isDirty,
|
|
82
|
+
setUnselectedEntities,
|
|
83
|
+
unselectedEntities,
|
|
84
|
+
};
|
|
85
|
+
};
|
|
@@ -2,28 +2,19 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { Button, Flex, FlexItem } from '@wordpress/components';
|
|
5
|
-
import { __
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { __ } from '@wordpress/i18n';
|
|
6
|
+
import { useDispatch } from '@wordpress/data';
|
|
7
|
+
import { useCallback, useRef } from '@wordpress/element';
|
|
8
8
|
import { store as coreStore } from '@wordpress/core-data';
|
|
9
9
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
10
10
|
import { __experimentalUseDialog as useDialog } from '@wordpress/compose';
|
|
11
11
|
import { store as noticesStore } from '@wordpress/notices';
|
|
12
|
-
import { getQueryArg } from '@wordpress/url';
|
|
13
12
|
|
|
14
13
|
/**
|
|
15
14
|
* Internal dependencies
|
|
16
15
|
*/
|
|
17
16
|
import EntityTypeList from './entity-type-list';
|
|
18
|
-
|
|
19
|
-
const TRANSLATED_SITE_PROPERTIES = {
|
|
20
|
-
title: __( 'Title' ),
|
|
21
|
-
description: __( 'Tagline' ),
|
|
22
|
-
site_logo: __( 'Logo' ),
|
|
23
|
-
site_icon: __( 'Icon' ),
|
|
24
|
-
show_on_front: __( 'Show on front' ),
|
|
25
|
-
page_on_front: __( 'Page on front' ),
|
|
26
|
-
};
|
|
17
|
+
import { useIsDirty } from './hooks/use-is-dirty';
|
|
27
18
|
|
|
28
19
|
const PUBLISH_ON_SAVE_ENTITIES = [
|
|
29
20
|
{
|
|
@@ -36,56 +27,26 @@ function identity( values ) {
|
|
|
36
27
|
return values;
|
|
37
28
|
}
|
|
38
29
|
|
|
39
|
-
function
|
|
30
|
+
export default function EntitiesSavedStates( { close } ) {
|
|
31
|
+
const isDirtyProps = useIsDirty();
|
|
40
32
|
return (
|
|
41
|
-
|
|
42
|
-
getQueryArg( window.location.href, 'theme_preview' ) !== undefined
|
|
33
|
+
<EntitiesSavedStatesExtensible close={ close } { ...isDirtyProps } />
|
|
43
34
|
);
|
|
44
35
|
}
|
|
45
36
|
|
|
46
|
-
function
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
37
|
+
export function EntitiesSavedStatesExtensible( {
|
|
38
|
+
additionalPrompt = undefined,
|
|
39
|
+
close,
|
|
40
|
+
onSave = identity,
|
|
41
|
+
saveEnabled: saveEnabledProp = undefined,
|
|
42
|
+
saveLabel = __( 'Save' ),
|
|
43
|
+
|
|
44
|
+
dirtyEntityRecords,
|
|
45
|
+
isDirty,
|
|
46
|
+
setUnselectedEntities,
|
|
47
|
+
unselectedEntities,
|
|
48
|
+
} ) {
|
|
54
49
|
const saveButtonRef = useRef();
|
|
55
|
-
const { getTheme } = useSelect( coreStore );
|
|
56
|
-
const theme = getTheme( currentlyPreviewingTheme() );
|
|
57
|
-
const { dirtyEntityRecords } = useSelect( ( select ) => {
|
|
58
|
-
const dirtyRecords =
|
|
59
|
-
select( coreStore ).__experimentalGetDirtyEntityRecords();
|
|
60
|
-
|
|
61
|
-
// Remove site object and decouple into its edited pieces.
|
|
62
|
-
const dirtyRecordsWithoutSite = dirtyRecords.filter(
|
|
63
|
-
( record ) => ! ( record.kind === 'root' && record.name === 'site' )
|
|
64
|
-
);
|
|
65
|
-
|
|
66
|
-
const siteEdits = select( coreStore ).getEntityRecordEdits(
|
|
67
|
-
'root',
|
|
68
|
-
'site'
|
|
69
|
-
);
|
|
70
|
-
|
|
71
|
-
const siteEditsAsEntities = [];
|
|
72
|
-
for ( const property in siteEdits ) {
|
|
73
|
-
siteEditsAsEntities.push( {
|
|
74
|
-
kind: 'root',
|
|
75
|
-
name: 'site',
|
|
76
|
-
title: TRANSLATED_SITE_PROPERTIES[ property ] || property,
|
|
77
|
-
property,
|
|
78
|
-
} );
|
|
79
|
-
}
|
|
80
|
-
const dirtyRecordsWithSiteItems = [
|
|
81
|
-
...dirtyRecordsWithoutSite,
|
|
82
|
-
...siteEditsAsEntities,
|
|
83
|
-
];
|
|
84
|
-
|
|
85
|
-
return {
|
|
86
|
-
dirtyEntityRecords: dirtyRecordsWithSiteItems,
|
|
87
|
-
};
|
|
88
|
-
}, [] );
|
|
89
50
|
const {
|
|
90
51
|
editEntityRecord,
|
|
91
52
|
saveEditedEntityRecord,
|
|
@@ -95,7 +56,7 @@ export default function EntitiesSavedStates( { close, onSave = identity } ) {
|
|
|
95
56
|
const { __unstableMarkLastChangeAsPersistent } =
|
|
96
57
|
useDispatch( blockEditorStore );
|
|
97
58
|
|
|
98
|
-
const { createSuccessNotice, createErrorNotice } =
|
|
59
|
+
const { createSuccessNotice, createErrorNotice, removeNotice } =
|
|
99
60
|
useDispatch( noticesStore );
|
|
100
61
|
|
|
101
62
|
// To group entities by type.
|
|
@@ -122,32 +83,11 @@ export default function EntitiesSavedStates( { close, onSave = identity } ) {
|
|
|
122
83
|
...Object.values( contentSavables ),
|
|
123
84
|
].filter( Array.isArray );
|
|
124
85
|
|
|
125
|
-
|
|
126
|
-
const [ unselectedEntities, _setUnselectedEntities ] = useState( [] );
|
|
127
|
-
|
|
128
|
-
const setUnselectedEntities = (
|
|
129
|
-
{ kind, name, key, property },
|
|
130
|
-
checked
|
|
131
|
-
) => {
|
|
132
|
-
if ( checked ) {
|
|
133
|
-
_setUnselectedEntities(
|
|
134
|
-
unselectedEntities.filter(
|
|
135
|
-
( elt ) =>
|
|
136
|
-
elt.kind !== kind ||
|
|
137
|
-
elt.name !== name ||
|
|
138
|
-
elt.key !== key ||
|
|
139
|
-
elt.property !== property
|
|
140
|
-
)
|
|
141
|
-
);
|
|
142
|
-
} else {
|
|
143
|
-
_setUnselectedEntities( [
|
|
144
|
-
...unselectedEntities,
|
|
145
|
-
{ kind, name, key, property },
|
|
146
|
-
] );
|
|
147
|
-
}
|
|
148
|
-
};
|
|
86
|
+
const saveEnabled = saveEnabledProp ?? isDirty;
|
|
149
87
|
|
|
150
|
-
const
|
|
88
|
+
const saveCheckedEntities = () => {
|
|
89
|
+
const saveNoticeId = 'site-editor-save-success';
|
|
90
|
+
removeNotice( saveNoticeId );
|
|
151
91
|
const entitiesToSave = dirtyEntityRecords.filter(
|
|
152
92
|
( { kind, name, key, property } ) => {
|
|
153
93
|
return ! unselectedEntities.some(
|
|
@@ -208,6 +148,7 @@ export default function EntitiesSavedStates( { close, onSave = identity } ) {
|
|
|
208
148
|
} else {
|
|
209
149
|
createSuccessNotice( __( 'Site updated.' ), {
|
|
210
150
|
type: 'snackbar',
|
|
151
|
+
id: saveNoticeId,
|
|
211
152
|
} );
|
|
212
153
|
}
|
|
213
154
|
} )
|
|
@@ -224,18 +165,6 @@ export default function EntitiesSavedStates( { close, onSave = identity } ) {
|
|
|
224
165
|
onClose: () => dismissPanel(),
|
|
225
166
|
} );
|
|
226
167
|
|
|
227
|
-
const isDirty = dirtyEntityRecords.length - unselectedEntities.length > 0;
|
|
228
|
-
const activateSaveEnabled = isPreviewingTheme() || isDirty;
|
|
229
|
-
|
|
230
|
-
let activateSaveLabel;
|
|
231
|
-
if ( isPreviewingTheme() && isDirty ) {
|
|
232
|
-
activateSaveLabel = __( 'Activate & Save' );
|
|
233
|
-
} else if ( isPreviewingTheme() ) {
|
|
234
|
-
activateSaveLabel = __( 'Activate' );
|
|
235
|
-
} else {
|
|
236
|
-
activateSaveLabel = __( 'Save' );
|
|
237
|
-
}
|
|
238
|
-
|
|
239
168
|
return (
|
|
240
169
|
<div
|
|
241
170
|
ref={ saveDialogRef }
|
|
@@ -248,11 +177,11 @@ export default function EntitiesSavedStates( { close, onSave = identity } ) {
|
|
|
248
177
|
as={ Button }
|
|
249
178
|
ref={ saveButtonRef }
|
|
250
179
|
variant="primary"
|
|
251
|
-
disabled={ !
|
|
252
|
-
onClick={
|
|
180
|
+
disabled={ ! saveEnabled }
|
|
181
|
+
onClick={ saveCheckedEntities }
|
|
253
182
|
className="editor-entities-saved-states__save-button"
|
|
254
183
|
>
|
|
255
|
-
{
|
|
184
|
+
{ saveLabel }
|
|
256
185
|
</FlexItem>
|
|
257
186
|
<FlexItem
|
|
258
187
|
isBlock
|
|
@@ -266,14 +195,7 @@ export default function EntitiesSavedStates( { close, onSave = identity } ) {
|
|
|
266
195
|
|
|
267
196
|
<div className="entities-saved-states__text-prompt">
|
|
268
197
|
<strong>{ __( 'Are you ready to save?' ) }</strong>
|
|
269
|
-
{
|
|
270
|
-
<p>
|
|
271
|
-
{ sprintf(
|
|
272
|
-
'Saving your changes will change your active theme to %1$s.',
|
|
273
|
-
theme?.name?.rendered
|
|
274
|
-
) }
|
|
275
|
-
</p>
|
|
276
|
-
) }
|
|
198
|
+
{ additionalPrompt }
|
|
277
199
|
{ isDirty && (
|
|
278
200
|
<p>
|
|
279
201
|
{ __(
|
|
@@ -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';
|
|
@@ -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
|
|
|
@@ -74,7 +74,8 @@ function PostTitle( _, forwardedRef ) {
|
|
|
74
74
|
return;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
const
|
|
77
|
+
const ownerDocument =
|
|
78
|
+
ref.current.ownerDocument.defaultView.top.document;
|
|
78
79
|
const { activeElement, body } = ownerDocument;
|
|
79
80
|
|
|
80
81
|
// Only autofocus the title when the post is entirely empty. This should
|
package/src/private-apis.js
CHANGED
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { ExperimentalEditorProvider } from './components/provider';
|
|
5
5
|
import { lock } from './lockUnlock';
|
|
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
|
} );
|