@wordpress/editor 13.15.0 → 13.17.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/autocompleters/index.js +0 -2
- package/build/components/autocompleters/index.js.map +1 -1
- package/build/components/autocompleters/user.js +2 -9
- package/build/components/autocompleters/user.js.map +1 -1
- package/build/components/autosave-monitor/index.js +0 -24
- package/build/components/autosave-monitor/index.js.map +1 -1
- package/build/components/character-count/index.js +1 -4
- package/build/components/character-count/index.js.map +1 -1
- package/build/components/deprecated.js +1 -11
- package/build/components/deprecated.js.map +1 -1
- package/build/components/deprecated.native.js +0 -1
- package/build/components/deprecated.native.js.map +1 -1
- package/build/components/document-outline/check.js +1 -7
- package/build/components/document-outline/check.js.map +1 -1
- package/build/components/document-outline/index.js +7 -24
- package/build/components/document-outline/index.js.map +1 -1
- package/build/components/document-outline/item.js +1 -5
- package/build/components/document-outline/item.js.map +1 -1
- package/build/components/editor-help/add-blocks.native.js +1 -8
- package/build/components/editor-help/add-blocks.native.js.map +1 -1
- package/build/components/editor-help/customize-blocks.native.js +1 -8
- package/build/components/editor-help/customize-blocks.native.js.map +1 -1
- package/build/components/editor-help/help-detail-navigation-screen.native.js +5 -13
- package/build/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
- package/build/components/editor-help/help-get-support-button.native.js +1 -7
- package/build/components/editor-help/help-get-support-button.native.js.map +1 -1
- package/build/components/editor-help/help-section-title.native.js +1 -7
- package/build/components/editor-help/help-section-title.native.js.map +1 -1
- package/build/components/editor-help/help-topic-row.native.js +1 -8
- package/build/components/editor-help/help-topic-row.native.js.map +1 -1
- package/build/components/editor-help/icon-move-blocks.native.js +0 -4
- package/build/components/editor-help/icon-move-blocks.native.js.map +1 -1
- package/build/components/editor-help/index.native.js +8 -29
- package/build/components/editor-help/index.native.js.map +1 -1
- package/build/components/editor-help/intro-to-blocks.native.js +1 -9
- package/build/components/editor-help/intro-to-blocks.native.js.map +1 -1
- package/build/components/editor-help/move-blocks.native.js +1 -8
- package/build/components/editor-help/move-blocks.native.js.map +1 -1
- package/build/components/editor-help/remove-blocks.native.js +1 -8
- package/build/components/editor-help/remove-blocks.native.js.map +1 -1
- package/build/components/editor-help/view-sections.native.js +1 -12
- package/build/components/editor-help/view-sections.native.js.map +1 -1
- package/build/components/editor-history/redo.js +6 -14
- package/build/components/editor-history/redo.js.map +1 -1
- package/build/components/editor-history/undo.js +6 -14
- package/build/components/editor-history/undo.js.map +1 -1
- package/build/components/editor-notices/index.js +1 -10
- package/build/components/editor-notices/index.js.map +1 -1
- package/build/components/editor-snackbars/index.js +1 -5
- package/build/components/editor-snackbars/index.js.map +1 -1
- package/build/components/entities-saved-states/entity-record-item.js +3 -10
- package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
- package/build/components/entities-saved-states/entity-type-list.js +3 -15
- package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build/components/entities-saved-states/hooks/use-is-dirty.js +5 -14
- package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
- package/build/components/entities-saved-states/index.js +8 -27
- package/build/components/entities-saved-states/index.js.map +1 -1
- package/build/components/error-boundary/index.js +1 -18
- package/build/components/error-boundary/index.js.map +1 -1
- package/build/components/global-keyboard-shortcuts/index.js +5 -9
- package/build/components/global-keyboard-shortcuts/index.js.map +1 -1
- package/build/components/global-keyboard-shortcuts/register-shortcuts.js +1 -8
- package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
- package/build/components/index.js +4 -76
- package/build/components/index.js.map +1 -1
- package/build/components/index.native.js +0 -9
- package/build/components/index.native.js.map +1 -1
- package/build/components/local-autosave-monitor/index.js +6 -31
- package/build/components/local-autosave-monitor/index.js.map +1 -1
- package/build/components/media-categories/index.js +30 -45
- package/build/components/media-categories/index.js.map +1 -1
- package/build/components/page-attributes/check.js +3 -7
- package/build/components/page-attributes/check.js.map +1 -1
- package/build/components/page-attributes/order.js +17 -42
- package/build/components/page-attributes/order.js.map +1 -1
- package/build/components/page-attributes/parent.js +8 -34
- package/build/components/page-attributes/parent.js.map +1 -1
- package/build/components/post-author/check.js +1 -11
- package/build/components/post-author/check.js.map +1 -1
- package/build/components/post-author/combobox.js +7 -23
- package/build/components/post-author/combobox.js.map +1 -1
- package/build/components/post-author/constants.js +0 -1
- package/build/components/post-author/constants.js.map +1 -1
- package/build/components/post-author/index.js +1 -12
- package/build/components/post-author/index.js.map +1 -1
- package/build/components/post-author/select.js +1 -12
- package/build/components/post-author/select.js.map +1 -1
- package/build/components/post-comments/index.js +11 -23
- package/build/components/post-comments/index.js.map +1 -1
- package/build/components/post-excerpt/check.js +6 -8
- package/build/components/post-excerpt/check.js.map +1 -1
- package/build/components/post-excerpt/index.js +10 -27
- package/build/components/post-excerpt/index.js.map +1 -1
- package/build/components/post-featured-image/check.js +6 -9
- package/build/components/post-featured-image/check.js.map +1 -1
- package/build/components/post-featured-image/index.js +13 -42
- package/build/components/post-featured-image/index.js.map +1 -1
- package/build/components/post-format/check.js +9 -18
- package/build/components/post-format/check.js.map +1 -1
- package/build/components/post-format/index.js +2 -20
- package/build/components/post-format/index.js.map +1 -1
- package/build/components/post-last-revision/check.js +15 -22
- package/build/components/post-last-revision/check.js.map +1 -1
- package/build/components/post-last-revision/index.js +17 -28
- package/build/components/post-last-revision/index.js.map +1 -1
- package/build/components/post-locked-modal/index.js +8 -28
- package/build/components/post-locked-modal/index.js.map +1 -1
- package/build/components/post-pending-status/check.js +16 -24
- package/build/components/post-pending-status/check.js.map +1 -1
- package/build/components/post-pending-status/index.js +10 -28
- package/build/components/post-pending-status/index.js.map +1 -1
- package/build/components/post-pingbacks/index.js +11 -23
- package/build/components/post-pingbacks/index.js.map +1 -1
- package/build/components/post-preview-button/index.js +11 -22
- package/build/components/post-preview-button/index.js.map +1 -1
- package/build/components/post-publish-button/index.js +6 -32
- package/build/components/post-publish-button/index.js.map +1 -1
- package/build/components/post-publish-button/label.js +1 -10
- package/build/components/post-publish-button/label.js.map +1 -1
- package/build/components/post-publish-panel/index.js +1 -22
- package/build/components/post-publish-panel/index.js.map +1 -1
- package/build/components/post-publish-panel/maybe-category-panel.js +4 -14
- package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-post-format-panel.js +2 -18
- package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-tags-panel.js +2 -17
- package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-upload-media.js +1 -18
- package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
- package/build/components/post-publish-panel/postpublish.js +3 -27
- package/build/components/post-publish-panel/postpublish.js.map +1 -1
- package/build/components/post-publish-panel/prepublish.js +1 -26
- package/build/components/post-publish-panel/prepublish.js.map +1 -1
- package/build/components/post-saved-state/index.js +12 -29
- package/build/components/post-saved-state/index.js.map +1 -1
- package/build/components/post-schedule/check.js +1 -8
- package/build/components/post-schedule/check.js.map +1 -1
- package/build/components/post-schedule/index.js +7 -13
- package/build/components/post-schedule/index.js.map +1 -1
- package/build/components/post-schedule/label.js +18 -29
- package/build/components/post-schedule/label.js.map +1 -1
- package/build/components/post-slug/check.js +1 -4
- package/build/components/post-slug/check.js.map +1 -1
- package/build/components/post-slug/index.js +1 -19
- package/build/components/post-slug/index.js.map +1 -1
- package/build/components/post-sticky/check.js +1 -8
- package/build/components/post-sticky/check.js.map +1 -1
- package/build/components/post-sticky/index.js +1 -12
- package/build/components/post-sticky/index.js.map +1 -1
- package/build/components/post-switch-to-draft-button/index.js +1 -14
- package/build/components/post-switch-to-draft-button/index.js.map +1 -1
- package/build/components/post-sync-status/index.js +5 -18
- package/build/components/post-sync-status/index.js.map +1 -1
- package/build/components/post-taxonomies/check.js +1 -9
- package/build/components/post-taxonomies/check.js.map +1 -1
- package/build/components/post-taxonomies/flat-term-selector.js +15 -50
- package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/hierarchical-term-selector.js +27 -79
- package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/index.js +3 -13
- package/build/components/post-taxonomies/index.js.map +1 -1
- package/build/components/post-taxonomies/most-used-terms.js +1 -9
- package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build/components/post-template/index.js +1 -11
- package/build/components/post-template/index.js.map +1 -1
- package/build/components/post-text-editor/index.js +3 -17
- package/build/components/post-text-editor/index.js.map +1 -1
- package/build/components/post-title/index.js +14 -46
- package/build/components/post-title/index.js.map +1 -1
- package/build/components/post-title/index.native.js +7 -44
- package/build/components/post-title/index.native.js.map +1 -1
- package/build/components/post-trash/check.js +1 -7
- package/build/components/post-trash/check.js.map +1 -1
- package/build/components/post-trash/index.js +1 -8
- package/build/components/post-trash/index.js.map +1 -1
- package/build/components/post-type-support-check/index.js +10 -23
- package/build/components/post-type-support-check/index.js.map +1 -1
- package/build/components/post-url/check.js +1 -12
- package/build/components/post-url/check.js.map +1 -1
- package/build/components/post-url/index.js +3 -15
- package/build/components/post-url/index.js.map +1 -1
- package/build/components/post-url/label.js +1 -5
- package/build/components/post-url/label.js.map +1 -1
- package/build/components/post-visibility/check.js +1 -7
- package/build/components/post-visibility/check.js.map +1 -1
- package/build/components/post-visibility/index.js +1 -17
- package/build/components/post-visibility/index.js.map +1 -1
- package/build/components/post-visibility/label.js +1 -5
- package/build/components/post-visibility/label.js.map +1 -1
- package/build/components/post-visibility/utils.js +1 -2
- package/build/components/post-visibility/utils.js.map +1 -1
- package/build/components/provider/index.js +13 -27
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/index.native.js +18 -70
- package/build/components/provider/index.native.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.js +9 -20
- package/build/components/provider/use-block-editor-settings.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.native.js +5 -11
- package/build/components/provider/use-block-editor-settings.native.js.map +1 -1
- package/build/components/provider/with-registry-provider.js +5 -12
- package/build/components/provider/with-registry-provider.js.map +1 -1
- package/build/components/table-of-contents/index.js +4 -14
- package/build/components/table-of-contents/index.js.map +1 -1
- package/build/components/table-of-contents/panel.js +1 -13
- package/build/components/table-of-contents/panel.js.map +1 -1
- package/build/components/template-validation-notice/index.js +3 -12
- package/build/components/template-validation-notice/index.js.map +1 -1
- package/build/components/theme-support-check/index.js +3 -12
- package/build/components/theme-support-check/index.js.map +1 -1
- package/build/components/time-to-read/index.js +2 -10
- package/build/components/time-to-read/index.js.map +1 -1
- package/build/components/unsaved-changes-warning/index.js +21 -35
- package/build/components/unsaved-changes-warning/index.js.map +1 -1
- package/build/components/word-count/index.js +2 -7
- package/build/components/word-count/index.js.map +1 -1
- package/build/hooks/custom-sources-backwards-compatibility.js +8 -42
- package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
- package/build/hooks/default-autocompleters.js +3 -4
- package/build/hooks/default-autocompleters.js.map +1 -1
- package/build/hooks/index.js +0 -1
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/index.native.js.map +1 -1
- package/build/index.js +0 -9
- package/build/index.js.map +1 -1
- package/build/index.native.js +0 -11
- package/build/index.native.js.map +1 -1
- package/build/lock-unlock.js +1 -2
- package/build/lock-unlock.js.map +1 -1
- package/build/private-apis.js +1 -4
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +61 -130
- package/build/store/actions.js.map +1 -1
- package/build/store/actions.native.js +1 -8
- package/build/store/actions.native.js.map +1 -1
- package/build/store/constants.js +1 -2
- package/build/store/constants.js.map +1 -1
- package/build/store/defaults.js +2 -3
- package/build/store/defaults.js.map +1 -1
- package/build/store/index.js +3 -11
- package/build/store/index.js.map +1 -1
- package/build/store/local-autosave.js +0 -4
- package/build/store/local-autosave.js.map +1 -1
- package/build/store/reducer.js +19 -49
- package/build/store/reducer.js.map +1 -1
- package/build/store/reducer.native.js +3 -17
- package/build/store/reducer.native.js.map +1 -1
- package/build/store/selectors.js +170 -296
- package/build/store/selectors.js.map +1 -1
- package/build/store/selectors.native.js +4 -11
- package/build/store/selectors.native.js.map +1 -1
- package/build/store/utils/notice-builder.js +13 -24
- package/build/store/utils/notice-builder.js.map +1 -1
- package/build/utils/get-template-part-icon.js +0 -3
- package/build/utils/get-template-part-icon.js.map +1 -1
- package/build/utils/index.js +0 -4
- package/build/utils/index.js.map +1 -1
- package/build/utils/index.native.js +0 -2
- package/build/utils/index.native.js.map +1 -1
- package/build/utils/media-upload/index.js +2 -6
- package/build/utils/media-upload/index.js.map +1 -1
- package/build/utils/media-upload/index.native.js +0 -1
- package/build/utils/media-upload/index.native.js.map +1 -1
- package/build/utils/terms.js +8 -18
- package/build/utils/terms.js.map +1 -1
- package/build/utils/url.js +0 -4
- package/build/utils/url.js.map +1 -1
- package/build-module/components/autocompleters/index.js.map +1 -1
- package/build-module/components/autocompleters/user.js +2 -5
- package/build-module/components/autocompleters/user.js.map +1 -1
- package/build-module/components/autosave-monitor/index.js +2 -17
- package/build-module/components/autosave-monitor/index.js.map +1 -1
- package/build-module/components/character-count/index.js +1 -1
- package/build-module/components/character-count/index.js.map +1 -1
- package/build-module/components/deprecated.js +0 -4
- package/build-module/components/deprecated.js.map +1 -1
- package/build-module/components/deprecated.native.js +0 -1
- package/build-module/components/deprecated.native.js.map +1 -1
- package/build-module/components/document-outline/check.js +0 -4
- package/build-module/components/document-outline/check.js.map +1 -1
- package/build-module/components/document-outline/index.js +9 -13
- package/build-module/components/document-outline/index.js.map +1 -1
- package/build-module/components/document-outline/item.js +0 -3
- package/build-module/components/document-outline/item.js.map +1 -1
- package/build-module/components/editor-help/add-blocks.native.js +2 -5
- package/build-module/components/editor-help/add-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/customize-blocks.native.js +2 -5
- package/build-module/components/editor-help/customize-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/help-detail-navigation-screen.native.js +6 -8
- package/build-module/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
- package/build-module/components/editor-help/help-get-support-button.native.js +2 -5
- package/build-module/components/editor-help/help-get-support-button.native.js.map +1 -1
- package/build-module/components/editor-help/help-section-title.native.js +2 -5
- package/build-module/components/editor-help/help-section-title.native.js.map +1 -1
- package/build-module/components/editor-help/help-topic-row.native.js +1 -6
- package/build-module/components/editor-help/help-topic-row.native.js.map +1 -1
- package/build-module/components/editor-help/icon-move-blocks.native.js +0 -1
- package/build-module/components/editor-help/icon-move-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/index.native.js +9 -9
- package/build-module/components/editor-help/index.native.js.map +1 -1
- package/build-module/components/editor-help/intro-to-blocks.native.js +2 -5
- package/build-module/components/editor-help/intro-to-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/move-blocks.native.js +2 -5
- package/build-module/components/editor-help/move-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/remove-blocks.native.js +2 -5
- package/build-module/components/editor-help/remove-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/view-sections.native.js +2 -4
- package/build-module/components/editor-help/view-sections.native.js.map +1 -1
- package/build-module/components/editor-history/redo.js +6 -8
- package/build-module/components/editor-history/redo.js.map +1 -1
- package/build-module/components/editor-history/undo.js +6 -8
- package/build-module/components/editor-history/undo.js.map +1 -1
- package/build-module/components/editor-notices/index.js +1 -2
- package/build-module/components/editor-notices/index.js.map +1 -1
- package/build-module/components/editor-snackbars/index.js +0 -1
- package/build-module/components/editor-snackbars/index.js.map +1 -1
- package/build-module/components/entities-saved-states/entity-record-item.js +3 -4
- package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
- package/build-module/components/entities-saved-states/entity-type-list.js +3 -10
- package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build-module/components/entities-saved-states/hooks/use-is-dirty.js +4 -7
- package/build-module/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
- package/build-module/components/entities-saved-states/index.js +8 -16
- package/build-module/components/entities-saved-states/index.js.map +1 -1
- package/build-module/components/error-boundary/index.js +1 -12
- package/build-module/components/error-boundary/index.js.map +1 -1
- package/build-module/components/global-keyboard-shortcuts/index.js +5 -6
- package/build-module/components/global-keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +0 -3
- package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
- package/build-module/components/index.js +6 -3
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/index.native.js +4 -2
- package/build-module/components/index.native.js.map +1 -1
- package/build-module/components/local-autosave-monitor/index.js +6 -21
- package/build-module/components/local-autosave-monitor/index.js.map +1 -1
- package/build-module/components/media-categories/index.js +31 -41
- package/build-module/components/media-categories/index.js.map +1 -1
- package/build-module/components/page-attributes/check.js +3 -3
- package/build-module/components/page-attributes/check.js.map +1 -1
- package/build-module/components/page-attributes/order.js +17 -31
- package/build-module/components/page-attributes/order.js.map +1 -1
- package/build-module/components/page-attributes/parent.js +9 -23
- package/build-module/components/page-attributes/parent.js.map +1 -1
- package/build-module/components/post-author/check.js +1 -5
- package/build-module/components/post-author/check.js.map +1 -1
- package/build-module/components/post-author/combobox.js +7 -16
- package/build-module/components/post-author/combobox.js.map +1 -1
- package/build-module/components/post-author/constants.js +0 -1
- package/build-module/components/post-author/constants.js.map +1 -1
- package/build-module/components/post-author/index.js +1 -6
- package/build-module/components/post-author/index.js.map +1 -1
- package/build-module/components/post-author/select.js +1 -6
- package/build-module/components/post-author/select.js.map +1 -1
- package/build-module/components/post-comments/index.js +12 -19
- package/build-module/components/post-comments/index.js.map +1 -1
- package/build-module/components/post-excerpt/check.js +5 -6
- package/build-module/components/post-excerpt/check.js.map +1 -1
- package/build-module/components/post-excerpt/index.js +11 -23
- package/build-module/components/post-excerpt/index.js.map +1 -1
- package/build-module/components/post-featured-image/check.js +5 -6
- package/build-module/components/post-featured-image/check.js.map +1 -1
- package/build-module/components/post-featured-image/index.js +13 -31
- package/build-module/components/post-featured-image/index.js.map +1 -1
- package/build-module/components/post-format/check.js +10 -15
- package/build-module/components/post-format/check.js.map +1 -1
- package/build-module/components/post-format/index.js +4 -12
- package/build-module/components/post-format/index.js.map +1 -1
- package/build-module/components/post-last-revision/check.js +17 -17
- package/build-module/components/post-last-revision/check.js.map +1 -1
- package/build-module/components/post-last-revision/index.js +18 -21
- package/build-module/components/post-last-revision/index.js.map +1 -1
- package/build-module/components/post-locked-modal/index.js +8 -22
- package/build-module/components/post-locked-modal/index.js.map +1 -1
- package/build-module/components/post-pending-status/check.js +17 -20
- package/build-module/components/post-pending-status/check.js.map +1 -1
- package/build-module/components/post-pending-status/index.js +11 -20
- package/build-module/components/post-pending-status/index.js.map +1 -1
- package/build-module/components/post-pingbacks/index.js +12 -19
- package/build-module/components/post-pingbacks/index.js.map +1 -1
- package/build-module/components/post-preview-button/index.js +11 -17
- package/build-module/components/post-preview-button/index.js.map +1 -1
- package/build-module/components/post-publish-button/index.js +7 -23
- package/build-module/components/post-publish-button/index.js.map +1 -1
- package/build-module/components/post-publish-button/label.js +1 -4
- package/build-module/components/post-publish-button/label.js.map +1 -1
- package/build-module/components/post-publish-panel/index.js +1 -8
- package/build-module/components/post-publish-panel/index.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-category-panel.js +4 -8
- package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-post-format-panel.js +2 -12
- package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-tags-panel.js +2 -9
- package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-upload-media.js +1 -12
- package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
- package/build-module/components/post-publish-panel/postpublish.js +3 -16
- package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
- package/build-module/components/post-publish-panel/prepublish.js +1 -10
- package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
- package/build-module/components/post-saved-state/index.js +15 -23
- package/build-module/components/post-saved-state/index.js.map +1 -1
- package/build-module/components/post-schedule/check.js +1 -3
- package/build-module/components/post-schedule/check.js.map +1 -1
- package/build-module/components/post-schedule/index.js +8 -8
- package/build-module/components/post-schedule/index.js.map +1 -1
- package/build-module/components/post-schedule/label.js +18 -22
- package/build-module/components/post-schedule/label.js.map +1 -1
- package/build-module/components/post-slug/check.js +0 -1
- package/build-module/components/post-slug/check.js.map +1 -1
- package/build-module/components/post-slug/index.js +1 -8
- package/build-module/components/post-slug/index.js.map +1 -1
- package/build-module/components/post-sticky/check.js +1 -3
- package/build-module/components/post-sticky/check.js.map +1 -1
- package/build-module/components/post-sticky/index.js +1 -3
- package/build-module/components/post-sticky/index.js.map +1 -1
- package/build-module/components/post-switch-to-draft-button/index.js +1 -9
- package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
- package/build-module/components/post-sync-status/index.js +5 -11
- package/build-module/components/post-sync-status/index.js.map +1 -1
- package/build-module/components/post-taxonomies/check.js +1 -3
- package/build-module/components/post-taxonomies/check.js.map +1 -1
- package/build-module/components/post-taxonomies/flat-term-selector.js +17 -39
- package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js +29 -66
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/index.js +3 -5
- package/build-module/components/post-taxonomies/index.js.map +1 -1
- package/build-module/components/post-taxonomies/most-used-terms.js +1 -4
- package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build-module/components/post-template/index.js +1 -5
- package/build-module/components/post-template/index.js.map +1 -1
- package/build-module/components/post-text-editor/index.js +4 -9
- package/build-module/components/post-text-editor/index.js.map +1 -1
- package/build-module/components/post-title/index.js +17 -35
- package/build-module/components/post-title/index.js.map +1 -1
- package/build-module/components/post-title/index.native.js +8 -33
- package/build-module/components/post-title/index.native.js.map +1 -1
- package/build-module/components/post-trash/check.js +1 -4
- package/build-module/components/post-trash/check.js.map +1 -1
- package/build-module/components/post-trash/index.js +1 -4
- package/build-module/components/post-trash/index.js.map +1 -1
- package/build-module/components/post-type-support-check/index.js +14 -20
- package/build-module/components/post-type-support-check/index.js.map +1 -1
- package/build-module/components/post-url/check.js +1 -9
- package/build-module/components/post-url/check.js.map +1 -1
- package/build-module/components/post-url/index.js +3 -8
- package/build-module/components/post-url/index.js.map +1 -1
- package/build-module/components/post-url/label.js +1 -1
- package/build-module/components/post-url/label.js.map +1 -1
- package/build-module/components/post-visibility/check.js +1 -2
- package/build-module/components/post-visibility/check.js.map +1 -1
- package/build-module/components/post-visibility/index.js +1 -10
- package/build-module/components/post-visibility/index.js.map +1 -1
- package/build-module/components/post-visibility/label.js +1 -1
- package/build-module/components/post-visibility/label.js.map +1 -1
- package/build-module/components/post-visibility/utils.js.map +1 -1
- package/build-module/components/provider/index.js +13 -14
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/index.native.js +21 -52
- package/build-module/components/provider/index.native.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.js +9 -12
- package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.native.js +5 -5
- package/build-module/components/provider/use-block-editor-settings.native.js.map +1 -1
- package/build-module/components/provider/with-registry-provider.js +5 -8
- package/build-module/components/provider/with-registry-provider.js.map +1 -1
- package/build-module/components/table-of-contents/index.js +4 -7
- package/build-module/components/table-of-contents/index.js.map +1 -1
- package/build-module/components/table-of-contents/panel.js +1 -5
- package/build-module/components/table-of-contents/panel.js.map +1 -1
- package/build-module/components/template-validation-notice/index.js +2 -6
- package/build-module/components/template-validation-notice/index.js.map +1 -1
- package/build-module/components/theme-support-check/index.js +3 -7
- package/build-module/components/theme-support-check/index.js.map +1 -1
- package/build-module/components/time-to-read/index.js +4 -7
- package/build-module/components/time-to-read/index.js.map +1 -1
- package/build-module/components/unsaved-changes-warning/index.js +22 -31
- package/build-module/components/unsaved-changes-warning/index.js.map +1 -1
- package/build-module/components/word-count/index.js +2 -4
- package/build-module/components/word-count/index.js.map +1 -1
- package/build-module/hooks/custom-sources-backwards-compatibility.js +11 -39
- package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
- package/build-module/hooks/default-autocompleters.js +3 -4
- package/build-module/hooks/default-autocompleters.js.map +1 -1
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/index.native.js.map +1 -1
- package/build-module/index.js +1 -1
- package/build-module/index.js.map +1 -1
- package/build-module/index.native.js +1 -1
- package/build-module/index.native.js.map +1 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +63 -85
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/actions.native.js +2 -2
- package/build-module/store/actions.native.js.map +1 -1
- package/build-module/store/constants.js +1 -1
- package/build-module/store/constants.js.map +1 -1
- package/build-module/store/defaults.js +3 -2
- package/build-module/store/defaults.js.map +1 -1
- package/build-module/store/index.js +5 -4
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/local-autosave.js +0 -1
- package/build-module/store/local-autosave.js.map +1 -1
- package/build-module/store/reducer.js +21 -33
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/reducer.native.js +4 -10
- package/build-module/store/reducer.native.js.map +1 -1
- package/build-module/store/selectors.js +173 -223
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/selectors.native.js +6 -8
- package/build-module/store/selectors.native.js.map +1 -1
- package/build-module/store/utils/notice-builder.js +15 -21
- package/build-module/store/utils/notice-builder.js.map +1 -1
- package/build-module/utils/get-template-part-icon.js +0 -2
- package/build-module/utils/get-template-part-icon.js.map +1 -1
- package/build-module/utils/index.js.map +1 -1
- package/build-module/utils/index.native.js.map +1 -1
- package/build-module/utils/media-upload/index.js +2 -4
- package/build-module/utils/media-upload/index.js.map +1 -1
- package/build-module/utils/media-upload/index.native.js.map +1 -1
- package/build-module/utils/terms.js +9 -11
- package/build-module/utils/terms.js.map +1 -1
- package/build-module/utils/url.js +1 -1
- package/build-module/utils/url.js.map +1 -1
- package/build-style/style-rtl.css +10 -17
- package/build-style/style.css +10 -17
- package/package.json +32 -31
- package/src/components/editor-help/index.native.js +1 -1
- package/src/components/editor-help/style.scss +5 -0
- package/src/components/page-attributes/order.js +15 -23
- package/src/components/page-attributes/test/order.js +46 -15
- package/src/components/post-author/test/check.js +18 -12
- package/src/components/post-comments/index.js +11 -17
- package/src/components/post-excerpt/check.js +6 -2
- package/src/components/post-excerpt/index.js +10 -16
- package/src/components/post-featured-image/check.js +4 -2
- package/src/components/post-format/check.js +16 -11
- package/src/components/post-last-revision/check.js +12 -14
- package/src/components/post-last-revision/index.js +12 -10
- package/src/components/post-last-revision/test/check.js +28 -16
- package/src/components/post-pending-status/check.js +13 -19
- package/src/components/post-pending-status/index.js +9 -14
- package/src/components/post-pending-status/test/check.js +32 -10
- package/src/components/post-pingbacks/index.js +11 -15
- package/src/components/post-publish-panel/style.scss +12 -25
- package/src/components/post-sync-status/style.scss +4 -1
- package/src/components/post-type-support-check/index.js +8 -10
- package/src/components/post-type-support-check/test/index.js +36 -20
- package/src/components/provider/index.js +3 -2
- package/src/components/unsaved-changes-warning/index.js +22 -27
- package/src/hooks/custom-sources-backwards-compatibility.js +1 -25
- package/src/store/actions.js +1 -1
- package/src/store/selectors.js +2 -2
- package/src/store/test/selectors.js +13 -13
|
@@ -3,17 +3,23 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
import { CheckboxControl } from '@wordpress/components';
|
|
6
|
-
import {
|
|
7
|
-
import { compose } from '@wordpress/compose';
|
|
6
|
+
import { useDispatch, useSelect } from '@wordpress/data';
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
9
|
* Internal dependencies
|
|
11
10
|
*/
|
|
12
11
|
import { store as editorStore } from '../../store';
|
|
13
12
|
|
|
14
|
-
function PostPingbacks(
|
|
13
|
+
function PostPingbacks() {
|
|
14
|
+
const pingStatus = useSelect(
|
|
15
|
+
( select ) =>
|
|
16
|
+
select( editorStore ).getEditedPostAttribute( 'ping_status' ) ??
|
|
17
|
+
'open',
|
|
18
|
+
[]
|
|
19
|
+
);
|
|
20
|
+
const { editPost } = useDispatch( editorStore );
|
|
15
21
|
const onTogglePingback = () =>
|
|
16
|
-
|
|
22
|
+
editPost( {
|
|
17
23
|
ping_status: pingStatus === 'open' ? 'closed' : 'open',
|
|
18
24
|
} );
|
|
19
25
|
|
|
@@ -27,14 +33,4 @@ function PostPingbacks( { pingStatus = 'open', ...props } ) {
|
|
|
27
33
|
);
|
|
28
34
|
}
|
|
29
35
|
|
|
30
|
-
export default
|
|
31
|
-
withSelect( ( select ) => {
|
|
32
|
-
return {
|
|
33
|
-
pingStatus:
|
|
34
|
-
select( editorStore ).getEditedPostAttribute( 'ping_status' ),
|
|
35
|
-
};
|
|
36
|
-
} ),
|
|
37
|
-
withDispatch( ( dispatch ) => ( {
|
|
38
|
-
editPost: dispatch( editorStore ).editPost,
|
|
39
|
-
} ) ),
|
|
40
|
-
] )( PostPingbacks );
|
|
36
|
+
export default PostPingbacks;
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
.editor-post-publish-panel__footer {
|
|
85
|
-
padding:
|
|
85
|
+
padding: $grid-unit-20;
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
.components-button.editor-post-publish-panel__toggle.is-primary {
|
|
@@ -94,17 +94,17 @@
|
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
.dashicon {
|
|
97
|
-
margin-right: -
|
|
97
|
+
margin-right: -$grid-unit-05;
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
.editor-post-publish-panel__link {
|
|
102
102
|
font-weight: 400;
|
|
103
|
-
padding-left:
|
|
103
|
+
padding-left: $grid-unit-05;
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
.editor-post-publish-panel__prepublish {
|
|
107
|
-
padding:
|
|
107
|
+
padding: $grid-unit-20;
|
|
108
108
|
|
|
109
109
|
strong {
|
|
110
110
|
color: $gray-900;
|
|
@@ -112,8 +112,8 @@
|
|
|
112
112
|
|
|
113
113
|
.components-panel__body {
|
|
114
114
|
background: $white;
|
|
115
|
-
margin-left: -
|
|
116
|
-
margin-right: -
|
|
115
|
+
margin-left: -$grid-unit-20;
|
|
116
|
+
margin-right: -$grid-unit-20;
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
.editor-post-visibility__dialog-legend {
|
|
@@ -130,21 +130,11 @@
|
|
|
130
130
|
display: flex;
|
|
131
131
|
align-content: space-between;
|
|
132
132
|
flex-wrap: wrap;
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
> * {
|
|
136
|
-
flex-grow: 1;
|
|
137
|
-
margin: 5px;
|
|
138
|
-
}
|
|
133
|
+
gap: $grid-unit-20;
|
|
139
134
|
|
|
140
135
|
.components-button {
|
|
141
|
-
height: auto;
|
|
142
136
|
justify-content: center;
|
|
143
|
-
padding: 3px 10px 4px;
|
|
144
137
|
flex: 1;
|
|
145
|
-
line-height: 1.6;
|
|
146
|
-
text-align: center;
|
|
147
|
-
white-space: normal;
|
|
148
138
|
}
|
|
149
139
|
|
|
150
140
|
.components-clipboard-button {
|
|
@@ -162,21 +152,18 @@
|
|
|
162
152
|
}
|
|
163
153
|
|
|
164
154
|
input[readonly] {
|
|
165
|
-
padding:
|
|
166
|
-
background: $gray-
|
|
155
|
+
padding: $grid-unit-20;
|
|
156
|
+
background: $gray-100;
|
|
157
|
+
border-color: $gray-400;
|
|
167
158
|
overflow: hidden;
|
|
168
159
|
text-overflow: ellipsis;
|
|
160
|
+
height: $button-size;
|
|
169
161
|
}
|
|
170
162
|
}
|
|
171
163
|
|
|
172
164
|
.post-publish-panel__postpublish-post-address__copy-button-wrap {
|
|
173
165
|
flex-shrink: 0;
|
|
174
|
-
margin-left:
|
|
175
|
-
|
|
176
|
-
// match copy button height to the address field height
|
|
177
|
-
.components-button {
|
|
178
|
-
height: 38px;
|
|
179
|
-
}
|
|
166
|
+
margin-left: $grid-unit-20;
|
|
180
167
|
}
|
|
181
168
|
|
|
182
169
|
.post-publish-panel__postpublish-header {
|
|
@@ -2,15 +2,18 @@
|
|
|
2
2
|
width: 100%;
|
|
3
3
|
position: relative;
|
|
4
4
|
justify-content: flex-start;
|
|
5
|
+
align-items: flex-start;
|
|
5
6
|
|
|
6
7
|
> span {
|
|
7
8
|
display: block;
|
|
8
9
|
width: 45%;
|
|
9
10
|
flex-shrink: 0;
|
|
11
|
+
padding: $grid-unit-15 * 0.5 0;
|
|
12
|
+
word-break: break-word;
|
|
10
13
|
}
|
|
11
14
|
|
|
12
15
|
> div {
|
|
13
16
|
// Match padding on tertiary buttons for alignment.
|
|
14
|
-
padding
|
|
17
|
+
padding: $grid-unit-15 * 0.5 0 $grid-unit-15 * 0.5 $grid-unit-15;
|
|
15
18
|
}
|
|
16
19
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { useSelect } from '@wordpress/data';
|
|
5
5
|
import { store as coreStore } from '@wordpress/core-data';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -14,7 +14,6 @@ import { store as editorStore } from '../../store';
|
|
|
14
14
|
* type supports one of the given `supportKeys` prop.
|
|
15
15
|
*
|
|
16
16
|
* @param {Object} props Props.
|
|
17
|
-
* @param {string} [props.postType] Current post type.
|
|
18
17
|
* @param {WPElement} props.children Children to be rendered if post
|
|
19
18
|
* type supports.
|
|
20
19
|
* @param {(string|string[])} props.supportKeys String or string array of keys
|
|
@@ -22,7 +21,12 @@ import { store as editorStore } from '../../store';
|
|
|
22
21
|
*
|
|
23
22
|
* @return {WPComponent} The component to be rendered.
|
|
24
23
|
*/
|
|
25
|
-
|
|
24
|
+
function PostTypeSupportCheck( { children, supportKeys } ) {
|
|
25
|
+
const postType = useSelect( ( select ) => {
|
|
26
|
+
const { getEditedPostAttribute } = select( editorStore );
|
|
27
|
+
const { getPostType } = select( coreStore );
|
|
28
|
+
return getPostType( getEditedPostAttribute( 'type' ) );
|
|
29
|
+
}, [] );
|
|
26
30
|
let isSupported = true;
|
|
27
31
|
if ( postType ) {
|
|
28
32
|
isSupported = (
|
|
@@ -37,10 +41,4 @@ export function PostTypeSupportCheck( { postType, children, supportKeys } ) {
|
|
|
37
41
|
return children;
|
|
38
42
|
}
|
|
39
43
|
|
|
40
|
-
export default
|
|
41
|
-
const { getEditedPostAttribute } = select( editorStore );
|
|
42
|
-
const { getPostType } = select( coreStore );
|
|
43
|
-
return {
|
|
44
|
-
postType: getPostType( getEditedPostAttribute( 'type' ) ),
|
|
45
|
-
};
|
|
46
|
-
} )( PostTypeSupportCheck );
|
|
44
|
+
export default PostTypeSupportCheck;
|
|
@@ -3,15 +3,37 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { render } from '@testing-library/react';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* WordPress dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { useSelect } from '@wordpress/data';
|
|
10
|
+
|
|
6
11
|
/**
|
|
7
12
|
* Internal dependencies
|
|
8
13
|
*/
|
|
9
|
-
import
|
|
14
|
+
import PostTypeSupportCheck from '../';
|
|
15
|
+
|
|
16
|
+
jest.mock( '@wordpress/data/src/components/use-select', () => {
|
|
17
|
+
// This allows us to tweak the returned value on each test.
|
|
18
|
+
const mock = jest.fn();
|
|
19
|
+
return mock;
|
|
20
|
+
} );
|
|
21
|
+
|
|
22
|
+
function setupUseSelectMock( postType ) {
|
|
23
|
+
useSelect.mockImplementation( ( cb ) => {
|
|
24
|
+
return cb( () => ( {
|
|
25
|
+
getPostType: () => postType,
|
|
26
|
+
getEditedPostAttribute: () => 'post',
|
|
27
|
+
} ) );
|
|
28
|
+
} );
|
|
29
|
+
}
|
|
10
30
|
|
|
11
31
|
describe( 'PostTypeSupportCheck', () => {
|
|
12
32
|
it( 'renders its children when post type is not known', () => {
|
|
33
|
+
setupUseSelectMock( undefined );
|
|
34
|
+
|
|
13
35
|
const { container } = render(
|
|
14
|
-
<PostTypeSupportCheck
|
|
36
|
+
<PostTypeSupportCheck supportKeys="title">
|
|
15
37
|
Supported
|
|
16
38
|
</PostTypeSupportCheck>
|
|
17
39
|
);
|
|
@@ -20,11 +42,11 @@ describe( 'PostTypeSupportCheck', () => {
|
|
|
20
42
|
} );
|
|
21
43
|
|
|
22
44
|
it( 'does not render its children when post type is known and not supports', () => {
|
|
23
|
-
|
|
45
|
+
setupUseSelectMock( {
|
|
24
46
|
supports: {},
|
|
25
|
-
};
|
|
47
|
+
} );
|
|
26
48
|
const { container } = render(
|
|
27
|
-
<PostTypeSupportCheck
|
|
49
|
+
<PostTypeSupportCheck supportKeys="title">
|
|
28
50
|
Supported
|
|
29
51
|
</PostTypeSupportCheck>
|
|
30
52
|
);
|
|
@@ -33,13 +55,13 @@ describe( 'PostTypeSupportCheck', () => {
|
|
|
33
55
|
} );
|
|
34
56
|
|
|
35
57
|
it( 'renders its children when post type is known and supports', () => {
|
|
36
|
-
|
|
58
|
+
setupUseSelectMock( {
|
|
37
59
|
supports: {
|
|
38
60
|
title: true,
|
|
39
61
|
},
|
|
40
|
-
};
|
|
62
|
+
} );
|
|
41
63
|
const { container } = render(
|
|
42
|
-
<PostTypeSupportCheck
|
|
64
|
+
<PostTypeSupportCheck supportKeys="title">
|
|
43
65
|
Supported
|
|
44
66
|
</PostTypeSupportCheck>
|
|
45
67
|
);
|
|
@@ -48,16 +70,13 @@ describe( 'PostTypeSupportCheck', () => {
|
|
|
48
70
|
} );
|
|
49
71
|
|
|
50
72
|
it( 'renders its children if some of keys supported', () => {
|
|
51
|
-
|
|
73
|
+
setupUseSelectMock( {
|
|
52
74
|
supports: {
|
|
53
75
|
title: true,
|
|
54
76
|
},
|
|
55
|
-
};
|
|
77
|
+
} );
|
|
56
78
|
const { container } = render(
|
|
57
|
-
<PostTypeSupportCheck
|
|
58
|
-
postType={ postType }
|
|
59
|
-
supportKeys={ [ 'title', 'thumbnail' ] }
|
|
60
|
-
>
|
|
79
|
+
<PostTypeSupportCheck supportKeys={ [ 'title', 'thumbnail' ] }>
|
|
61
80
|
Supported
|
|
62
81
|
</PostTypeSupportCheck>
|
|
63
82
|
);
|
|
@@ -66,14 +85,11 @@ describe( 'PostTypeSupportCheck', () => {
|
|
|
66
85
|
} );
|
|
67
86
|
|
|
68
87
|
it( 'does not render its children if none of keys supported', () => {
|
|
69
|
-
|
|
88
|
+
setupUseSelectMock( {
|
|
70
89
|
supports: {},
|
|
71
|
-
};
|
|
90
|
+
} );
|
|
72
91
|
const { container } = render(
|
|
73
|
-
<PostTypeSupportCheck
|
|
74
|
-
postType={ postType }
|
|
75
|
-
supportKeys={ [ 'title', 'thumbnail' ] }
|
|
76
|
-
>
|
|
92
|
+
<PostTypeSupportCheck supportKeys={ [ 'title', 'thumbnail' ] }>
|
|
77
93
|
Supported
|
|
78
94
|
</PostTypeSupportCheck>
|
|
79
95
|
);
|
|
@@ -10,8 +10,8 @@ import {
|
|
|
10
10
|
BlockContextProvider,
|
|
11
11
|
privateApis as blockEditorPrivateApis,
|
|
12
12
|
} from '@wordpress/block-editor';
|
|
13
|
-
import { ReusableBlocksMenuItems } from '@wordpress/reusable-blocks';
|
|
14
13
|
import { store as noticesStore } from '@wordpress/notices';
|
|
14
|
+
import { privateApis as editPatternsPrivateApis } from '@wordpress/patterns';
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Internal dependencies
|
|
@@ -22,6 +22,7 @@ import useBlockEditorSettings from './use-block-editor-settings';
|
|
|
22
22
|
import { unlock } from '../../lock-unlock';
|
|
23
23
|
|
|
24
24
|
const { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );
|
|
25
|
+
const { PatternsMenuItems } = unlock( editPatternsPrivateApis );
|
|
25
26
|
|
|
26
27
|
export const ExperimentalEditorProvider = withRegistryProvider(
|
|
27
28
|
( {
|
|
@@ -130,7 +131,7 @@ export const ExperimentalEditorProvider = withRegistryProvider(
|
|
|
130
131
|
useSubRegistry={ false }
|
|
131
132
|
>
|
|
132
133
|
{ children }
|
|
133
|
-
<
|
|
134
|
+
<PatternsMenuItems />
|
|
134
135
|
</BlockEditorProviderComponent>
|
|
135
136
|
</BlockContextProvider>
|
|
136
137
|
</EntityProvider>
|
|
@@ -13,41 +13,36 @@ import { store as coreStore } from '@wordpress/core-data';
|
|
|
13
13
|
* @return {WPComponent} The component.
|
|
14
14
|
*/
|
|
15
15
|
export default function UnsavedChangesWarning() {
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
const { __experimentalGetDirtyEntityRecords } = useSelect( coreStore );
|
|
17
|
+
|
|
18
|
+
useEffect( () => {
|
|
19
|
+
/**
|
|
20
|
+
* Warns the user if there are unsaved changes before leaving the editor.
|
|
21
|
+
*
|
|
22
|
+
* @param {Event} event `beforeunload` event.
|
|
23
|
+
*
|
|
24
|
+
* @return {string | undefined} Warning prompt message, if unsaved changes exist.
|
|
25
|
+
*/
|
|
26
|
+
const warnIfUnsavedChanges = ( event ) => {
|
|
27
|
+
// We need to call the selector directly in the listener to avoid race
|
|
28
|
+
// conditions with `BrowserURL` where `componentDidUpdate` gets the
|
|
29
|
+
// new value of `isEditedPostDirty` before this component does,
|
|
30
|
+
// causing this component to incorrectly think a trashed post is still dirty.
|
|
19
31
|
const dirtyEntityRecords = __experimentalGetDirtyEntityRecords();
|
|
20
|
-
|
|
32
|
+
if ( dirtyEntityRecords.length > 0 ) {
|
|
33
|
+
event.returnValue = __(
|
|
34
|
+
'You have unsaved changes. If you proceed, they will be lost.'
|
|
35
|
+
);
|
|
36
|
+
return event.returnValue;
|
|
37
|
+
}
|
|
21
38
|
};
|
|
22
|
-
}, [] );
|
|
23
39
|
|
|
24
|
-
/**
|
|
25
|
-
* Warns the user if there are unsaved changes before leaving the editor.
|
|
26
|
-
*
|
|
27
|
-
* @param {Event} event `beforeunload` event.
|
|
28
|
-
*
|
|
29
|
-
* @return {string | undefined} Warning prompt message, if unsaved changes exist.
|
|
30
|
-
*/
|
|
31
|
-
const warnIfUnsavedChanges = ( event ) => {
|
|
32
|
-
// We need to call the selector directly in the listener to avoid race
|
|
33
|
-
// conditions with `BrowserURL` where `componentDidUpdate` gets the
|
|
34
|
-
// new value of `isEditedPostDirty` before this component does,
|
|
35
|
-
// causing this component to incorrectly think a trashed post is still dirty.
|
|
36
|
-
if ( isDirty() ) {
|
|
37
|
-
event.returnValue = __(
|
|
38
|
-
'You have unsaved changes. If you proceed, they will be lost.'
|
|
39
|
-
);
|
|
40
|
-
return event.returnValue;
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
useEffect( () => {
|
|
45
40
|
window.addEventListener( 'beforeunload', warnIfUnsavedChanges );
|
|
46
41
|
|
|
47
42
|
return () => {
|
|
48
43
|
window.removeEventListener( 'beforeunload', warnIfUnsavedChanges );
|
|
49
44
|
};
|
|
50
|
-
}, [] );
|
|
45
|
+
}, [ __experimentalGetDirtyEntityRecords ] );
|
|
51
46
|
|
|
52
47
|
return null;
|
|
53
48
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
5
|
-
import { select as globalSelect, useSelect } from '@wordpress/data';
|
|
4
|
+
import { useSelect } from '@wordpress/data';
|
|
6
5
|
import { useEntityProp } from '@wordpress/core-data';
|
|
7
6
|
import { useMemo } from '@wordpress/element';
|
|
8
7
|
import { createHigherOrderComponent } from '@wordpress/compose';
|
|
@@ -124,26 +123,3 @@ addFilter(
|
|
|
124
123
|
'core/editor/custom-sources-backwards-compatibility/shim-attribute-source',
|
|
125
124
|
shimAttributeSource
|
|
126
125
|
);
|
|
127
|
-
|
|
128
|
-
// The above filter will only capture blocks registered after the filter was
|
|
129
|
-
// added. There may already be blocks registered by this point, and those must
|
|
130
|
-
// be updated to apply the shim.
|
|
131
|
-
//
|
|
132
|
-
// The following implementation achieves this, albeit with a couple caveats:
|
|
133
|
-
// - Only blocks registered on the global store will be modified.
|
|
134
|
-
// - The block settings are directly mutated, since there is currently no
|
|
135
|
-
// mechanism to update an existing block registration. This is the reason for
|
|
136
|
-
// `getBlockType` separate from `getBlockTypes`, since the latter returns a
|
|
137
|
-
// _copy_ of the block registration (i.e. the mutation would not affect the
|
|
138
|
-
// actual registered block settings).
|
|
139
|
-
//
|
|
140
|
-
// `getBlockTypes` or `getBlockType` implementation could change in the future
|
|
141
|
-
// in regards to creating settings clones, but the corresponding end-to-end
|
|
142
|
-
// tests for meta blocks should cover against any potential regressions.
|
|
143
|
-
//
|
|
144
|
-
// In the future, we could support updating block settings, at which point this
|
|
145
|
-
// implementation could use that mechanism instead.
|
|
146
|
-
globalSelect( blocksStore )
|
|
147
|
-
.getBlockTypes()
|
|
148
|
-
.map( ( { name } ) => globalSelect( blocksStore ).getBlockType( name ) )
|
|
149
|
-
.forEach( shimAttributeSource );
|
package/src/store/actions.js
CHANGED
|
@@ -302,7 +302,7 @@ export const autosave =
|
|
|
302
302
|
};
|
|
303
303
|
|
|
304
304
|
export const __unstableSaveForPreview =
|
|
305
|
-
( { forceIsAutosaveable } ) =>
|
|
305
|
+
( { forceIsAutosaveable } = {} ) =>
|
|
306
306
|
async ( { select, dispatch } ) => {
|
|
307
307
|
if (
|
|
308
308
|
( forceIsAutosaveable || select.isEditedPostAutosaveable() ) &&
|
package/src/store/selectors.js
CHANGED
|
@@ -611,8 +611,8 @@ export const isEditedPostAutosaveable = createRegistrySelector(
|
|
|
611
611
|
return true;
|
|
612
612
|
}
|
|
613
613
|
|
|
614
|
-
// If
|
|
615
|
-
return [ 'title', 'excerpt' ].some(
|
|
614
|
+
// If title, excerpt, or meta have changed, the post is autosaveable.
|
|
615
|
+
return [ 'title', 'excerpt', 'meta' ].some(
|
|
616
616
|
( field ) =>
|
|
617
617
|
getPostRawValue( autosave[ field ] ) !==
|
|
618
618
|
getEditedPostAttribute( state, field )
|
|
@@ -260,7 +260,7 @@ describe( 'selectors', () => {
|
|
|
260
260
|
parent: [ 'core/test-block-b' ],
|
|
261
261
|
} );
|
|
262
262
|
|
|
263
|
-
registerBlockType( 'core/
|
|
263
|
+
registerBlockType( 'core/freeform', {
|
|
264
264
|
save: ( props ) => <RawHTML>{ props.attributes.content }</RawHTML>,
|
|
265
265
|
category: 'text',
|
|
266
266
|
title: 'Test Freeform Content Handler',
|
|
@@ -287,7 +287,7 @@ describe( 'selectors', () => {
|
|
|
287
287
|
save: () => null,
|
|
288
288
|
} );
|
|
289
289
|
|
|
290
|
-
setFreeformContentHandlerName( 'core/
|
|
290
|
+
setFreeformContentHandlerName( 'core/freeform' );
|
|
291
291
|
setDefaultBlockName( 'core/test-default' );
|
|
292
292
|
|
|
293
293
|
cachedSelectors.forEach( ( { clear } ) => clear() );
|
|
@@ -298,7 +298,7 @@ describe( 'selectors', () => {
|
|
|
298
298
|
unregisterBlockType( 'core/test-block-a' );
|
|
299
299
|
unregisterBlockType( 'core/test-block-b' );
|
|
300
300
|
unregisterBlockType( 'core/test-block-c' );
|
|
301
|
-
unregisterBlockType( 'core/
|
|
301
|
+
unregisterBlockType( 'core/freeform' );
|
|
302
302
|
unregisterBlockType( 'core/test-default' );
|
|
303
303
|
|
|
304
304
|
setFreeformContentHandlerName( undefined );
|
|
@@ -1337,7 +1337,7 @@ describe( 'selectors', () => {
|
|
|
1337
1337
|
value: [
|
|
1338
1338
|
{
|
|
1339
1339
|
clientId: 123,
|
|
1340
|
-
name: 'core/
|
|
1340
|
+
name: 'core/freeform',
|
|
1341
1341
|
isValid: true,
|
|
1342
1342
|
attributes: {
|
|
1343
1343
|
content: '',
|
|
@@ -1364,7 +1364,7 @@ describe( 'selectors', () => {
|
|
|
1364
1364
|
value: [
|
|
1365
1365
|
{
|
|
1366
1366
|
clientId: 123,
|
|
1367
|
-
name: 'core/
|
|
1367
|
+
name: 'core/freeform',
|
|
1368
1368
|
isValid: true,
|
|
1369
1369
|
attributes: {
|
|
1370
1370
|
content: '',
|
|
@@ -1741,7 +1741,7 @@ describe( 'selectors', () => {
|
|
|
1741
1741
|
value: [
|
|
1742
1742
|
{
|
|
1743
1743
|
clientId: 123,
|
|
1744
|
-
name: 'core/
|
|
1744
|
+
name: 'core/freeform',
|
|
1745
1745
|
isValid: true,
|
|
1746
1746
|
attributes: {
|
|
1747
1747
|
content: '',
|
|
@@ -1769,7 +1769,7 @@ describe( 'selectors', () => {
|
|
|
1769
1769
|
value: [
|
|
1770
1770
|
{
|
|
1771
1771
|
clientId: 123,
|
|
1772
|
-
name: 'core/
|
|
1772
|
+
name: 'core/freeform',
|
|
1773
1773
|
isValid: true,
|
|
1774
1774
|
attributes: {
|
|
1775
1775
|
content: '',
|
|
@@ -1797,7 +1797,7 @@ describe( 'selectors', () => {
|
|
|
1797
1797
|
value: [
|
|
1798
1798
|
{
|
|
1799
1799
|
clientId: 123,
|
|
1800
|
-
name: 'core/
|
|
1800
|
+
name: 'core/freeform',
|
|
1801
1801
|
isValid: true,
|
|
1802
1802
|
attributes: {
|
|
1803
1803
|
content: 'Test Data',
|
|
@@ -1825,7 +1825,7 @@ describe( 'selectors', () => {
|
|
|
1825
1825
|
value: [
|
|
1826
1826
|
{
|
|
1827
1827
|
clientId: 123,
|
|
1828
|
-
name: 'core/
|
|
1828
|
+
name: 'core/freeform',
|
|
1829
1829
|
isValid: true,
|
|
1830
1830
|
attributes: {
|
|
1831
1831
|
content: '',
|
|
@@ -1833,7 +1833,7 @@ describe( 'selectors', () => {
|
|
|
1833
1833
|
},
|
|
1834
1834
|
{
|
|
1835
1835
|
clientId: 456,
|
|
1836
|
-
name: 'core/
|
|
1836
|
+
name: 'core/freeform',
|
|
1837
1837
|
isValid: true,
|
|
1838
1838
|
attributes: {
|
|
1839
1839
|
content: '',
|
|
@@ -2426,7 +2426,7 @@ describe( 'selectors', () => {
|
|
|
2426
2426
|
} );
|
|
2427
2427
|
|
|
2428
2428
|
it( "returns removep'd serialization of blocks for single unknown", () => {
|
|
2429
|
-
const unknownBlock = createBlock( 'core/
|
|
2429
|
+
const unknownBlock = createBlock( 'core/freeform', {
|
|
2430
2430
|
content: '<p>foo</p>',
|
|
2431
2431
|
} );
|
|
2432
2432
|
const state = {
|
|
@@ -2448,10 +2448,10 @@ describe( 'selectors', () => {
|
|
|
2448
2448
|
} );
|
|
2449
2449
|
|
|
2450
2450
|
it( "returns non-removep'd serialization of blocks for multiple unknown", () => {
|
|
2451
|
-
const firstUnknown = createBlock( 'core/
|
|
2451
|
+
const firstUnknown = createBlock( 'core/freeform', {
|
|
2452
2452
|
content: '<p>foo</p>',
|
|
2453
2453
|
} );
|
|
2454
|
-
const secondUnknown = createBlock( 'core/
|
|
2454
|
+
const secondUnknown = createBlock( 'core/freeform', {
|
|
2455
2455
|
content: '<p>bar</p>',
|
|
2456
2456
|
} );
|
|
2457
2457
|
const state = {
|