@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["useSelect","filterURLForDisplay","safeDecodeURIComponent","store","editorStore","PostURLLabel","usePostURLLabel","postLink","select","getPermalink"],"sources":["@wordpress/editor/src/components/post-url/label.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { filterURLForDisplay, safeDecodeURIComponent } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport default function PostURLLabel() {\n\treturn usePostURLLabel();\n}\n\nexport function usePostURLLabel() {\n\tconst postLink = useSelect(\n\t\t( select ) => select( editorStore ).getPermalink(),\n\t\t[]\n\t);\n\treturn filterURLForDisplay( safeDecodeURIComponent( postLink ) );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,mBAAmB,EAAEC,sBAAsB,QAAQ,gBAAgB;;AAE5E;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAElD,eAAe,SAASC,YAAYA,CAAA,EAAG;EACtC,OAAOC,eAAe,CAAC,CAAC;AACzB;AAEA,OAAO,SAASA,eAAeA,CAAA,EAAG;EACjC,MAAMC,QAAQ,GAAGP,SAAS,CACvBQ,MAAM,IAAMA,MAAM,CAAEJ,WAAY,CAAC,CAACK,YAAY,CAAC,CAAC,EAClD,EACD,CAAC;EACD,OAAOR,mBAAmB,CAAEC,sBAAsB,CAAEK,QAAS,CAAE,CAAC;AACjE"}
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { compose } from '@wordpress/compose';
|
|
5
5
|
import { withSelect } from '@wordpress/data';
|
|
6
|
+
|
|
6
7
|
/**
|
|
7
8
|
* Internal dependencies
|
|
8
9
|
*/
|
|
9
|
-
|
|
10
10
|
import { store as editorStore } from '../../store';
|
|
11
11
|
export function PostVisibilityCheck({
|
|
12
12
|
hasPublishAction,
|
|
@@ -19,7 +19,6 @@ export function PostVisibilityCheck({
|
|
|
19
19
|
}
|
|
20
20
|
export default compose([withSelect(select => {
|
|
21
21
|
var _getCurrentPost$_link;
|
|
22
|
-
|
|
23
22
|
const {
|
|
24
23
|
getCurrentPost,
|
|
25
24
|
getCurrentPostType
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["compose","withSelect","store","editorStore","PostVisibilityCheck","hasPublishAction","render","canEdit","select","_getCurrentPost$_link","getCurrentPost","getCurrentPostType","_links","postType"],"sources":["@wordpress/editor/src/components/post-visibility/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { compose } from '@wordpress/compose';\nimport { withSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport function PostVisibilityCheck( { hasPublishAction, render } ) {\n\tconst canEdit = hasPublishAction;\n\treturn render( { canEdit } );\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst { getCurrentPost, getCurrentPostType } = select( editorStore );\n\t\treturn {\n\t\t\thasPublishAction:\n\t\t\t\tgetCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,\n\t\t\tpostType: getCurrentPostType(),\n\t\t};\n\t} ),\n] )( PostVisibilityCheck );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,UAAU,QAAQ,iBAAiB;;AAE5C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAElD,OAAO,SAASC,mBAAmBA,CAAE;EAAEC,gBAAgB;EAAEC;AAAO,CAAC,EAAG;EACnE,MAAMC,OAAO,GAAGF,gBAAgB;EAChC,OAAOC,MAAM,CAAE;IAAEC;EAAQ,CAAE,CAAC;AAC7B;AAEA,eAAeP,OAAO,CAAE,CACvBC,UAAU,CAAIO,MAAM,IAAM;EAAA,IAAAC,qBAAA;EACzB,MAAM;IAAEC,cAAc;IAAEC;EAAmB,CAAC,GAAGH,MAAM,CAAEL,WAAY,CAAC;EACpE,OAAO;IACNE,gBAAgB,GAAAI,qBAAA,GACfC,cAAc,CAAC,CAAC,CAACE,MAAM,GAAI,mBAAmB,CAAE,cAAAH,qBAAA,cAAAA,qBAAA,GAAI,KAAK;IAC1DI,QAAQ,EAAEF,kBAAkB,CAAC;EAC9B,CAAC;AACF,CAAE,CAAC,CACF,CAAC,CAAEP,mBAAoB,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { createElement } from "@wordpress/element";
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
3
|
* WordPress dependencies
|
|
5
4
|
*/
|
|
@@ -9,10 +8,10 @@ import { VisuallyHidden, __experimentalConfirmDialog as ConfirmDialog } from '@w
|
|
|
9
8
|
import { useInstanceId } from '@wordpress/compose';
|
|
10
9
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
11
10
|
import { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';
|
|
11
|
+
|
|
12
12
|
/**
|
|
13
13
|
* Internal dependencies
|
|
14
14
|
*/
|
|
15
|
-
|
|
16
15
|
import { visibilityOptions } from './utils';
|
|
17
16
|
import { store as editorStore } from '../../store';
|
|
18
17
|
export default function PostVisibility({
|
|
@@ -34,7 +33,6 @@ export default function PostVisibility({
|
|
|
34
33
|
} = useDispatch(editorStore);
|
|
35
34
|
const [hasPassword, setHasPassword] = useState(!!password);
|
|
36
35
|
const [showPrivateConfirmDialog, setShowPrivateConfirmDialog] = useState(false);
|
|
37
|
-
|
|
38
36
|
const setPublic = () => {
|
|
39
37
|
editPost({
|
|
40
38
|
status: visibility === 'private' ? 'draft' : status,
|
|
@@ -42,11 +40,9 @@ export default function PostVisibility({
|
|
|
42
40
|
});
|
|
43
41
|
setHasPassword(false);
|
|
44
42
|
};
|
|
45
|
-
|
|
46
43
|
const setPrivate = () => {
|
|
47
44
|
setShowPrivateConfirmDialog(true);
|
|
48
45
|
};
|
|
49
|
-
|
|
50
46
|
const confirmPrivate = () => {
|
|
51
47
|
editPost({
|
|
52
48
|
status: 'private',
|
|
@@ -56,11 +52,9 @@ export default function PostVisibility({
|
|
|
56
52
|
setShowPrivateConfirmDialog(false);
|
|
57
53
|
savePost();
|
|
58
54
|
};
|
|
59
|
-
|
|
60
55
|
const handleDialogCancel = () => {
|
|
61
56
|
setShowPrivateConfirmDialog(false);
|
|
62
57
|
};
|
|
63
|
-
|
|
64
58
|
const setPasswordProtected = () => {
|
|
65
59
|
editPost({
|
|
66
60
|
status: visibility === 'private' ? 'draft' : status,
|
|
@@ -68,13 +62,11 @@ export default function PostVisibility({
|
|
|
68
62
|
});
|
|
69
63
|
setHasPassword(true);
|
|
70
64
|
};
|
|
71
|
-
|
|
72
65
|
const updatePassword = event => {
|
|
73
66
|
editPost({
|
|
74
67
|
password: event.target.value
|
|
75
68
|
});
|
|
76
69
|
};
|
|
77
|
-
|
|
78
70
|
return createElement("div", {
|
|
79
71
|
className: "editor-post-visibility"
|
|
80
72
|
}, createElement(InspectorPopoverHeader, {
|
|
@@ -124,7 +116,6 @@ export default function PostVisibility({
|
|
|
124
116
|
onCancel: handleDialogCancel
|
|
125
117
|
}, __('Would you like to privately publish this post now?')));
|
|
126
118
|
}
|
|
127
|
-
|
|
128
119
|
function PostVisibilityChoice({
|
|
129
120
|
instanceId,
|
|
130
121
|
value,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["__","useState","VisuallyHidden","__experimentalConfirmDialog","ConfirmDialog","useInstanceId","useSelect","useDispatch","__experimentalInspectorPopoverHeader","InspectorPopoverHeader","visibilityOptions","store","editorStore","PostVisibility","onClose","instanceId","status","visibility","password","select","getEditedPostAttribute","getEditedPostVisibility","editPost","savePost","hasPassword","setHasPassword","showPrivateConfirmDialog","setShowPrivateConfirmDialog","setPublic","setPrivate","confirmPrivate","handleDialogCancel","setPasswordProtected","updatePassword","event","target","value","createElement","className","title","help","as","PostVisibilityChoice","label","public","info","checked","onChange","private","htmlFor","id","type","placeholder","isOpen","onConfirm","onCancel","props","name"],"sources":["@wordpress/editor/src/components/post-visibility/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport {\n\tVisuallyHidden,\n\t__experimentalConfirmDialog as ConfirmDialog,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { visibilityOptions } from './utils';\nimport { store as editorStore } from '../../store';\n\nexport default function PostVisibility( { onClose } ) {\n\tconst instanceId = useInstanceId( PostVisibility );\n\n\tconst { status, visibility, password } = useSelect( ( select ) => ( {\n\t\tstatus: select( editorStore ).getEditedPostAttribute( 'status' ),\n\t\tvisibility: select( editorStore ).getEditedPostVisibility(),\n\t\tpassword: select( editorStore ).getEditedPostAttribute( 'password' ),\n\t} ) );\n\n\tconst { editPost, savePost } = useDispatch( editorStore );\n\n\tconst [ hasPassword, setHasPassword ] = useState( !! password );\n\tconst [ showPrivateConfirmDialog, setShowPrivateConfirmDialog ] =\n\t\tuseState( false );\n\n\tconst setPublic = () => {\n\t\teditPost( {\n\t\t\tstatus: visibility === 'private' ? 'draft' : status,\n\t\t\tpassword: '',\n\t\t} );\n\t\tsetHasPassword( false );\n\t};\n\n\tconst setPrivate = () => {\n\t\tsetShowPrivateConfirmDialog( true );\n\t};\n\n\tconst confirmPrivate = () => {\n\t\teditPost( { status: 'private', password: '' } );\n\t\tsetHasPassword( false );\n\t\tsetShowPrivateConfirmDialog( false );\n\t\tsavePost();\n\t};\n\n\tconst handleDialogCancel = () => {\n\t\tsetShowPrivateConfirmDialog( false );\n\t};\n\n\tconst setPasswordProtected = () => {\n\t\teditPost( {\n\t\t\tstatus: visibility === 'private' ? 'draft' : status,\n\t\t\tpassword: password || '',\n\t\t} );\n\t\tsetHasPassword( true );\n\t};\n\n\tconst updatePassword = ( event ) => {\n\t\teditPost( { password: event.target.value } );\n\t};\n\n\treturn (\n\t\t<div className=\"editor-post-visibility\">\n\t\t\t<InspectorPopoverHeader\n\t\t\t\ttitle={ __( 'Visibility' ) }\n\t\t\t\thelp={ __( 'Control how this post is viewed.' ) }\n\t\t\t\tonClose={ onClose }\n\t\t\t/>\n\t\t\t<fieldset className=\"editor-post-visibility__fieldset\">\n\t\t\t\t<VisuallyHidden as=\"legend\">\n\t\t\t\t\t{ __( 'Visibility' ) }\n\t\t\t\t</VisuallyHidden>\n\t\t\t\t<PostVisibilityChoice\n\t\t\t\t\tinstanceId={ instanceId }\n\t\t\t\t\tvalue=\"public\"\n\t\t\t\t\tlabel={ visibilityOptions.public.label }\n\t\t\t\t\tinfo={ visibilityOptions.public.info }\n\t\t\t\t\tchecked={ visibility === 'public' && ! hasPassword }\n\t\t\t\t\tonChange={ setPublic }\n\t\t\t\t/>\n\t\t\t\t<PostVisibilityChoice\n\t\t\t\t\tinstanceId={ instanceId }\n\t\t\t\t\tvalue=\"private\"\n\t\t\t\t\tlabel={ visibilityOptions.private.label }\n\t\t\t\t\tinfo={ visibilityOptions.private.info }\n\t\t\t\t\tchecked={ visibility === 'private' }\n\t\t\t\t\tonChange={ setPrivate }\n\t\t\t\t/>\n\t\t\t\t<PostVisibilityChoice\n\t\t\t\t\tinstanceId={ instanceId }\n\t\t\t\t\tvalue=\"password\"\n\t\t\t\t\tlabel={ visibilityOptions.password.label }\n\t\t\t\t\tinfo={ visibilityOptions.password.info }\n\t\t\t\t\tchecked={ hasPassword }\n\t\t\t\t\tonChange={ setPasswordProtected }\n\t\t\t\t/>\n\t\t\t\t{ hasPassword && (\n\t\t\t\t\t<div className=\"editor-post-visibility__password\">\n\t\t\t\t\t\t<VisuallyHidden\n\t\t\t\t\t\t\tas=\"label\"\n\t\t\t\t\t\t\thtmlFor={ `editor-post-visibility__password-input-${ instanceId }` }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Create password' ) }\n\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tclassName=\"editor-post-visibility__password-input\"\n\t\t\t\t\t\t\tid={ `editor-post-visibility__password-input-${ instanceId }` }\n\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\tonChange={ updatePassword }\n\t\t\t\t\t\t\tvalue={ password }\n\t\t\t\t\t\t\tplaceholder={ __( 'Use a secure password' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</fieldset>\n\t\t\t<ConfirmDialog\n\t\t\t\tisOpen={ showPrivateConfirmDialog }\n\t\t\t\tonConfirm={ confirmPrivate }\n\t\t\t\tonCancel={ handleDialogCancel }\n\t\t\t>\n\t\t\t\t{ __( 'Would you like to privately publish this post now?' ) }\n\t\t\t</ConfirmDialog>\n\t\t</div>\n\t);\n}\n\nfunction PostVisibilityChoice( { instanceId, value, label, info, ...props } ) {\n\treturn (\n\t\t<div className=\"editor-post-visibility__choice\">\n\t\t\t<input\n\t\t\t\ttype=\"radio\"\n\t\t\t\tname={ `editor-post-visibility__setting-${ instanceId }` }\n\t\t\t\tvalue={ value }\n\t\t\t\tid={ `editor-post-${ value }-${ instanceId }` }\n\t\t\t\taria-describedby={ `editor-post-${ value }-${ instanceId }-description` }\n\t\t\t\tclassName=\"editor-post-visibility__radio\"\n\t\t\t\t{ ...props }\n\t\t\t/>\n\t\t\t<label\n\t\t\t\thtmlFor={ `editor-post-${ value }-${ instanceId }` }\n\t\t\t\tclassName=\"editor-post-visibility__label\"\n\t\t\t>\n\t\t\t\t{ label }\n\t\t\t</label>\n\t\t\t<p\n\t\t\t\tid={ `editor-post-${ value }-${ instanceId }-description` }\n\t\t\t\tclassName=\"editor-post-visibility__info\"\n\t\t\t>\n\t\t\t\t{ info }\n\t\t\t</p>\n\t\t</div>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SACCC,cAAc,EACdC,2BAA2B,IAAIC,aAAa,QACtC,uBAAuB;AAC9B,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,oCAAoC,IAAIC,sBAAsB,QAAQ,yBAAyB;;AAExG;AACA;AACA;AACA,SAASC,iBAAiB,QAAQ,SAAS;AAC3C,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;A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,KAAK,EAAGA,KAAO;IACfc,EAAE,EAAI,eAAed,KAAO,IAAIrB,UAAY,EAAG;IAC/C,oBAAoB,eAAeqB,KAAO,IAAIrB,UAAY,cAAe;IACzEuB,SAAS,EAAC,+BAA+B;IAAA,GACpCkB;EAAK,CACV,CAAC,EACFnB,aAAA;IACCY,OAAO,EAAI,eAAeb,KAAO,IAAIrB,UAAY,EAAG;IACpDuB,SAAS,EAAC;EAA+B,GAEvCK,KACI,CAAC,EACRN,aAAA;IACCa,EAAE,EAAI,eAAed,KAAO,IAAIrB,UAAY,cAAe;IAC3DuB,SAAS,EAAC;EAA8B,GAEtCO,IACA,CACC,CAAC;AAER"}
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { useSelect } from '@wordpress/data';
|
|
5
|
+
|
|
5
6
|
/**
|
|
6
7
|
* Internal dependencies
|
|
7
8
|
*/
|
|
8
|
-
|
|
9
9
|
import { visibilityOptions } from './utils';
|
|
10
10
|
import { store as editorStore } from '../../store';
|
|
11
11
|
export default function PostVisibilityLabel() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["useSelect","visibilityOptions","store","editorStore","PostVisibilityLabel","usePostVisibilityLabel","visibility","select","getEditedPostVisibility","label"],"sources":["@wordpress/editor/src/components/post-visibility/label.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { visibilityOptions } from './utils';\nimport { store as editorStore } from '../../store';\n\nexport default function PostVisibilityLabel() {\n\treturn usePostVisibilityLabel();\n}\n\nexport function usePostVisibilityLabel() {\n\tconst visibility = useSelect( ( select ) =>\n\t\tselect( editorStore ).getEditedPostVisibility()\n\t);\n\treturn visibilityOptions[ visibility ]?.label;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,iBAAiB,QAAQ,SAAS;AAC3C,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAElD,eAAe,SAASC,mBAAmBA,CAAA,EAAG;EAC7C,OAAOC,sBAAsB,CAAC,CAAC;AAChC;AAEA,OAAO,SAASA,sBAAsBA,CAAA,EAAG;EACxC,MAAMC,UAAU,GAAGN,SAAS,CAAIO,MAAM,IACrCA,MAAM,CAAEJ,WAAY,CAAC,CAACK,uBAAuB,CAAC,CAC/C,CAAC;EACD,OAAOP,iBAAiB,CAAEK,UAAU,CAAE,EAAEG,KAAK;AAC9C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["__","visibilityOptions","public","label","info","private","password"],"sources":["@wordpress/editor/src/components/post-visibility/utils.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\nexport const visibilityOptions = {\n\tpublic: {\n\t\tlabel: __( 'Public' ),\n\t\tinfo: __( 'Visible to everyone.' ),\n\t},\n\tprivate: {\n\t\tlabel: __( 'Private' ),\n\t\tinfo: __( 'Only visible to site admins and editors.' ),\n\t},\n\tpassword: {\n\t\tlabel: __( 'Password protected' ),\n\t\tinfo: __( 'Only those with the password can view this post.' ),\n\t},\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AAEpC,OAAO,MAAMC,iBAAiB,GAAG;EAChCC,MAAM,EAAE;IACPC,KAAK,EAAEH,EAAE,CAAE,QAAS,CAAC;IACrBI,IAAI,EAAEJ,EAAE,CAAE,sBAAuB;EAClC,CAAC;EACDK,OAAO,EAAE;IACRF,KAAK,EAAEH,EAAE,CAAE,SAAU,CAAC;IACtBI,IAAI,EAAEJ,EAAE,CAAE,0CAA2C;EACtD,CAAC;EACDM,QAAQ,EAAE;IACTH,KAAK,EAAEH,EAAE,CAAE,oBAAqB,CAAC;IACjCI,IAAI,EAAEJ,EAAE,CAAE,kDAAmD;EAC9D;AACD,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { createElement } from "@wordpress/element";
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
3
|
* WordPress dependencies
|
|
5
4
|
*/
|
|
@@ -8,12 +7,12 @@ import { useDispatch, useSelect } from '@wordpress/data';
|
|
|
8
7
|
import { __ } from '@wordpress/i18n';
|
|
9
8
|
import { EntityProvider, useEntityBlockEditor } from '@wordpress/core-data';
|
|
10
9
|
import { BlockEditorProvider, BlockContextProvider, privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
11
|
-
import { ReusableBlocksMenuItems } from '@wordpress/reusable-blocks';
|
|
12
10
|
import { store as noticesStore } from '@wordpress/notices';
|
|
11
|
+
import { privateApis as editPatternsPrivateApis } from '@wordpress/patterns';
|
|
12
|
+
|
|
13
13
|
/**
|
|
14
14
|
* Internal dependencies
|
|
15
15
|
*/
|
|
16
|
-
|
|
17
16
|
import withRegistryProvider from './with-registry-provider';
|
|
18
17
|
import { store as editorStore } from '../../store';
|
|
19
18
|
import useBlockEditorSettings from './use-block-editor-settings';
|
|
@@ -21,6 +20,9 @@ import { unlock } from '../../lock-unlock';
|
|
|
21
20
|
const {
|
|
22
21
|
ExperimentalBlockEditorProvider
|
|
23
22
|
} = unlock(blockEditorPrivateApis);
|
|
23
|
+
const {
|
|
24
|
+
PatternsMenuItems
|
|
25
|
+
} = unlock(editPatternsPrivateApis);
|
|
24
26
|
export const ExperimentalEditorProvider = withRegistryProvider(({
|
|
25
27
|
__unstableTemplate,
|
|
26
28
|
post,
|
|
@@ -34,7 +36,6 @@ export const ExperimentalEditorProvider = withRegistryProvider(({
|
|
|
34
36
|
if (post.type === 'wp_template') {
|
|
35
37
|
return {};
|
|
36
38
|
}
|
|
37
|
-
|
|
38
39
|
return {
|
|
39
40
|
postId: post.id,
|
|
40
41
|
postType: post.type
|
|
@@ -72,18 +73,17 @@ export const ExperimentalEditorProvider = withRegistryProvider(({
|
|
|
72
73
|
} = useDispatch(editorStore);
|
|
73
74
|
const {
|
|
74
75
|
createWarningNotice
|
|
75
|
-
} = useDispatch(noticesStore);
|
|
76
|
-
// Ideally this should be synced on each change and not just something you do once.
|
|
76
|
+
} = useDispatch(noticesStore);
|
|
77
77
|
|
|
78
|
+
// Initialize and tear down the editor.
|
|
79
|
+
// Ideally this should be synced on each change and not just something you do once.
|
|
78
80
|
useLayoutEffect(() => {
|
|
79
81
|
// Assume that we don't need to initialize in the case of an error recovery.
|
|
80
82
|
if (recovery) {
|
|
81
83
|
return;
|
|
82
84
|
}
|
|
83
|
-
|
|
84
85
|
updatePostLock(settings.postLock);
|
|
85
86
|
setupEditor(post, initialEdits, settings.template);
|
|
86
|
-
|
|
87
87
|
if (settings.autosave) {
|
|
88
88
|
createWarningNotice(__('There is an autosave of this post that is more recent than the version below.'), {
|
|
89
89
|
id: 'autosave-exists',
|
|
@@ -93,20 +93,18 @@ export const ExperimentalEditorProvider = withRegistryProvider(({
|
|
|
93
93
|
}]
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
|
-
|
|
97
96
|
return () => {
|
|
98
97
|
__experimentalTearDownEditor();
|
|
99
98
|
};
|
|
100
|
-
}, []);
|
|
99
|
+
}, []);
|
|
101
100
|
|
|
101
|
+
// Synchronize the editor settings as they change.
|
|
102
102
|
useEffect(() => {
|
|
103
103
|
updateEditorSettings(settings);
|
|
104
104
|
}, [settings]);
|
|
105
|
-
|
|
106
105
|
if (!isReady) {
|
|
107
106
|
return null;
|
|
108
107
|
}
|
|
109
|
-
|
|
110
108
|
return createElement(EntityProvider, {
|
|
111
109
|
kind: "root",
|
|
112
110
|
type: "site"
|
|
@@ -123,10 +121,11 @@ export const ExperimentalEditorProvider = withRegistryProvider(({
|
|
|
123
121
|
selection: selection,
|
|
124
122
|
settings: blockEditorSettings,
|
|
125
123
|
useSubRegistry: false
|
|
126
|
-
}, children, createElement(
|
|
124
|
+
}, children, createElement(PatternsMenuItems, null)))));
|
|
127
125
|
});
|
|
128
126
|
export function EditorProvider(props) {
|
|
129
|
-
return createElement(ExperimentalEditorProvider, {
|
|
127
|
+
return createElement(ExperimentalEditorProvider, {
|
|
128
|
+
...props,
|
|
130
129
|
BlockEditorProviderComponent: BlockEditorProvider
|
|
131
130
|
}, props.children);
|
|
132
131
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["useEffect","useLayoutEffect","useMemo","useDispatch","useSelect","__","EntityProvider","useEntityBlockEditor","BlockEditorProvider","BlockContextProvider","privateApis","blockEditorPrivateApis","store","noticesStore","editPatternsPrivateApis","withRegistryProvider","editorStore","useBlockEditorSettings","unlock","ExperimentalBlockEditorProvider","PatternsMenuItems","ExperimentalEditorProvider","__unstableTemplate","post","settings","recovery","initialEdits","children","BlockEditorProviderComponent","defaultBlockContext","type","postId","id","postType","editorSettings","selection","isReady","select","getEditorSettings","getEditorSelection","__unstableIsEditorReady","blocks","onInput","onChange","blockEditorSettings","updatePostLock","setupEditor","updateEditorSettings","__experimentalTearDownEditor","createWarningNotice","postLock","template","autosave","actions","label","url","editLink","createElement","kind","value","useSubRegistry","EditorProvider","props"],"sources":["@wordpress/editor/src/components/provider/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useLayoutEffect, useMemo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { EntityProvider, useEntityBlockEditor } from '@wordpress/core-data';\nimport {\n\tBlockEditorProvider,\n\tBlockContextProvider,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { privateApis as editPatternsPrivateApis } from '@wordpress/patterns';\n\n/**\n * Internal dependencies\n */\nimport withRegistryProvider from './with-registry-provider';\nimport { store as editorStore } from '../../store';\nimport useBlockEditorSettings from './use-block-editor-settings';\nimport { unlock } from '../../lock-unlock';\n\nconst { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );\nconst { PatternsMenuItems } = unlock( editPatternsPrivateApis );\n\nexport const ExperimentalEditorProvider = withRegistryProvider(\n\t( {\n\t\t__unstableTemplate,\n\t\tpost,\n\t\tsettings,\n\t\trecovery,\n\t\tinitialEdits,\n\t\tchildren,\n\t\tBlockEditorProviderComponent = ExperimentalBlockEditorProvider,\n\t} ) => {\n\t\tconst defaultBlockContext = useMemo( () => {\n\t\t\tif ( post.type === 'wp_template' ) {\n\t\t\t\treturn {};\n\t\t\t}\n\t\t\treturn { postId: post.id, postType: post.type };\n\t\t}, [ post.id, post.type ] );\n\t\tconst { editorSettings, selection, isReady } = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\tgetEditorSettings,\n\t\t\t\t\tgetEditorSelection,\n\t\t\t\t\t__unstableIsEditorReady,\n\t\t\t\t} = select( editorStore );\n\t\t\t\treturn {\n\t\t\t\t\teditorSettings: getEditorSettings(),\n\t\t\t\t\tisReady: __unstableIsEditorReady(),\n\t\t\t\t\tselection: getEditorSelection(),\n\t\t\t\t};\n\t\t\t},\n\t\t\t[]\n\t\t);\n\t\tconst { id, type } = __unstableTemplate ?? post;\n\t\tconst [ blocks, onInput, onChange ] = useEntityBlockEditor(\n\t\t\t'postType',\n\t\t\ttype,\n\t\t\t{ id }\n\t\t);\n\t\tconst blockEditorSettings = useBlockEditorSettings(\n\t\t\teditorSettings,\n\t\t\t!! __unstableTemplate\n\t\t);\n\t\tconst {\n\t\t\tupdatePostLock,\n\t\t\tsetupEditor,\n\t\t\tupdateEditorSettings,\n\t\t\t__experimentalTearDownEditor,\n\t\t} = useDispatch( editorStore );\n\t\tconst { createWarningNotice } = useDispatch( noticesStore );\n\n\t\t// Initialize and tear down the editor.\n\t\t// Ideally this should be synced on each change and not just something you do once.\n\t\tuseLayoutEffect( () => {\n\t\t\t// Assume that we don't need to initialize in the case of an error recovery.\n\t\t\tif ( recovery ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tupdatePostLock( settings.postLock );\n\t\t\tsetupEditor( post, initialEdits, settings.template );\n\t\t\tif ( settings.autosave ) {\n\t\t\t\tcreateWarningNotice(\n\t\t\t\t\t__(\n\t\t\t\t\t\t'There is an autosave of this post that is more recent than the version below.'\n\t\t\t\t\t),\n\t\t\t\t\t{\n\t\t\t\t\t\tid: 'autosave-exists',\n\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'View the autosave' ),\n\t\t\t\t\t\t\t\turl: settings.autosave.editLink,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn () => {\n\t\t\t\t__experimentalTearDownEditor();\n\t\t\t};\n\t\t}, [] );\n\n\t\t// Synchronize the editor settings as they change.\n\t\tuseEffect( () => {\n\t\t\tupdateEditorSettings( settings );\n\t\t}, [ settings ] );\n\n\t\tif ( ! isReady ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (\n\t\t\t<EntityProvider kind=\"root\" type=\"site\">\n\t\t\t\t<EntityProvider\n\t\t\t\t\tkind=\"postType\"\n\t\t\t\t\ttype={ post.type }\n\t\t\t\t\tid={ post.id }\n\t\t\t\t>\n\t\t\t\t\t<BlockContextProvider value={ defaultBlockContext }>\n\t\t\t\t\t\t<BlockEditorProviderComponent\n\t\t\t\t\t\t\tvalue={ blocks }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\tonInput={ onInput }\n\t\t\t\t\t\t\tselection={ selection }\n\t\t\t\t\t\t\tsettings={ blockEditorSettings }\n\t\t\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t<PatternsMenuItems />\n\t\t\t\t\t\t</BlockEditorProviderComponent>\n\t\t\t\t\t</BlockContextProvider>\n\t\t\t\t</EntityProvider>\n\t\t\t</EntityProvider>\n\t\t);\n\t}\n);\n\nexport function EditorProvider( props ) {\n\treturn (\n\t\t<ExperimentalEditorProvider\n\t\t\t{ ...props }\n\t\t\tBlockEditorProviderComponent={ BlockEditorProvider }\n\t\t>\n\t\t\t{ props.children }\n\t\t</ExperimentalEditorProvider>\n\t);\n}\n\nexport default EditorProvider;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,eAAe,EAAEC,OAAO,QAAQ,oBAAoB;AACxE,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,cAAc,EAAEC,oBAAoB,QAAQ,sBAAsB;AAC3E,SACCC,mBAAmB,EACnBC,oBAAoB,EACpBC,WAAW,IAAIC,sBAAsB,QAC/B,yBAAyB;AAChC,SAASC,KAAK,IAAIC,YAAY,QAAQ,oBAAoB;AAC1D,SAASH,WAAW,IAAII,uBAAuB,QAAQ,qBAAqB;;AAE5E;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,0BAA0B;AAC3D,SAASH,KAAK,IAAII,WAAW,QAAQ,aAAa;AAClD,OAAOC,sBAAsB,MAAM,6BAA6B;AAChE,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAM;EAAEC;AAAgC,CAAC,GAAGD,MAAM,CAAEP,sBAAuB,CAAC;AAC5E,MAAM;EAAES;AAAkB,CAAC,GAAGF,MAAM,CAAEJ,uBAAwB,CAAC;AAE/D,OAAO,MAAMO,0BAA0B,GAAGN,oBAAoB,CAC7D,CAAE;EACDO,kBAAkB;EAClBC,IAAI;EACJC,QAAQ;EACRC,QAAQ;EACRC,YAAY;EACZC,QAAQ;EACRC,4BAA4B,GAAGT;AAChC,CAAC,KAAM;EACN,MAAMU,mBAAmB,GAAG3B,OAAO,CAAE,MAAM;IAC1C,IAAKqB,IAAI,CAACO,IAAI,KAAK,aAAa,EAAG;MAClC,OAAO,CAAC,CAAC;IACV;IACA,OAAO;MAAEC,MAAM,EAAER,IAA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;AAE/B;AAEA,eAAekC,cAAc"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { createElement, Fragment } from "@wordpress/element";
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
3
|
* External dependencies
|
|
5
4
|
*/
|
|
6
5
|
import memize from 'memize';
|
|
7
6
|
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
|
7
|
+
|
|
8
8
|
/**
|
|
9
9
|
* WordPress dependencies
|
|
10
10
|
*/
|
|
11
|
-
|
|
12
11
|
import RNReactNativeGutenbergBridge, { requestBlockTypeImpressions, setBlockTypeImpressions, subscribeParentGetHtml, subscribeParentToggleHTMLMode, subscribeUpdateHtml, subscribeSetTitle, subscribeMediaAppend, subscribeReplaceBlock, subscribeUpdateEditorSettings, subscribeUpdateCapabilities, subscribeShowNotice, subscribeShowEditorHelp } from '@wordpress/react-native-bridge';
|
|
13
12
|
import { Component } from '@wordpress/element';
|
|
14
13
|
import { count as wordCount } from '@wordpress/wordcount';
|
|
@@ -45,23 +44,24 @@ const postTypeEntities = [{
|
|
|
45
44
|
}));
|
|
46
45
|
import { EditorHelpTopics, store as editorStore } from '@wordpress/editor';
|
|
47
46
|
import { store as noticesStore } from '@wordpress/notices';
|
|
48
|
-
import { store as coreStore } from '@wordpress/core-data';
|
|
49
|
-
|
|
47
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
48
|
+
// eslint-disable-next-line no-restricted-imports
|
|
50
49
|
import { store as editPostStore } from '@wordpress/edit-post';
|
|
50
|
+
|
|
51
51
|
/**
|
|
52
52
|
* Internal dependencies
|
|
53
53
|
*/
|
|
54
|
-
|
|
55
54
|
import EditorProvider from './index.js';
|
|
56
|
-
|
|
57
55
|
class NativeEditorProvider extends Component {
|
|
58
56
|
constructor() {
|
|
59
|
-
super(...arguments);
|
|
57
|
+
super(...arguments);
|
|
60
58
|
|
|
59
|
+
// Keep a local reference to `post` to detect changes.
|
|
61
60
|
this.post = this.props.post;
|
|
62
61
|
this.props.addEntities(postTypeEntities);
|
|
63
62
|
this.props.receiveEntityRecords('postType', this.post.type, this.post);
|
|
64
|
-
this.getEditorSettings = memize((settings, capabilities) => ({
|
|
63
|
+
this.getEditorSettings = memize((settings, capabilities) => ({
|
|
64
|
+
...settings,
|
|
65
65
|
capabilities
|
|
66
66
|
}), {
|
|
67
67
|
maxSize: 1
|
|
@@ -70,7 +70,6 @@ class NativeEditorProvider extends Component {
|
|
|
70
70
|
isHelpVisible: false
|
|
71
71
|
};
|
|
72
72
|
}
|
|
73
|
-
|
|
74
73
|
componentDidMount() {
|
|
75
74
|
const {
|
|
76
75
|
capabilities,
|
|
@@ -117,7 +116,6 @@ class NativeEditorProvider extends Component {
|
|
|
117
116
|
if (typeof galleryWithImageBlocks === 'boolean') {
|
|
118
117
|
window.wp.galleryBlockV2Enabled = galleryWithImageBlocks;
|
|
119
118
|
}
|
|
120
|
-
|
|
121
119
|
updateEditorSettings(this.getThemeColors(editorSettings));
|
|
122
120
|
});
|
|
123
121
|
this.subscriptionParentUpdateCapabilities = subscribeUpdateCapabilities(payload => {
|
|
@@ -130,69 +128,61 @@ class NativeEditorProvider extends Component {
|
|
|
130
128
|
this.setState({
|
|
131
129
|
isHelpVisible: true
|
|
132
130
|
});
|
|
133
|
-
});
|
|
131
|
+
});
|
|
134
132
|
|
|
133
|
+
// Request current block impressions from native app.
|
|
135
134
|
requestBlockTypeImpressions(storedImpressions => {
|
|
136
|
-
const impressions = {
|
|
135
|
+
const impressions = {
|
|
136
|
+
...NEW_BLOCK_TYPES,
|
|
137
137
|
...storedImpressions
|
|
138
|
-
};
|
|
138
|
+
};
|
|
139
139
|
|
|
140
|
+
// Persist impressions to JavaScript store.
|
|
140
141
|
updateBlockEditorSettings({
|
|
141
142
|
impressions
|
|
142
|
-
});
|
|
143
|
-
// `NEW_BLOCK_TYPES` configuration.
|
|
143
|
+
});
|
|
144
144
|
|
|
145
|
+
// Persist impressions to native store if they do not include latest
|
|
146
|
+
// `NEW_BLOCK_TYPES` configuration.
|
|
145
147
|
const storedImpressionKeys = Object.keys(storedImpressions);
|
|
146
148
|
const storedImpressionsCurrent = Object.keys(NEW_BLOCK_TYPES).every(newKey => storedImpressionKeys.includes(newKey));
|
|
147
|
-
|
|
148
149
|
if (!storedImpressionsCurrent) {
|
|
149
150
|
setBlockTypeImpressions(impressions);
|
|
150
151
|
}
|
|
151
152
|
});
|
|
152
153
|
}
|
|
153
|
-
|
|
154
154
|
componentWillUnmount() {
|
|
155
155
|
if (this.subscriptionParentGetHtml) {
|
|
156
156
|
this.subscriptionParentGetHtml.remove();
|
|
157
157
|
}
|
|
158
|
-
|
|
159
158
|
if (this.subscriptionParentToggleHTMLMode) {
|
|
160
159
|
this.subscriptionParentToggleHTMLMode.remove();
|
|
161
160
|
}
|
|
162
|
-
|
|
163
161
|
if (this.subscriptionParentSetTitle) {
|
|
164
162
|
this.subscriptionParentSetTitle.remove();
|
|
165
163
|
}
|
|
166
|
-
|
|
167
164
|
if (this.subscriptionParentUpdateHtml) {
|
|
168
165
|
this.subscriptionParentUpdateHtml.remove();
|
|
169
166
|
}
|
|
170
|
-
|
|
171
167
|
if (this.subscriptionParentReplaceBlock) {
|
|
172
168
|
this.subscriptionParentReplaceBlock.remove();
|
|
173
169
|
}
|
|
174
|
-
|
|
175
170
|
if (this.subscriptionParentMediaAppend) {
|
|
176
171
|
this.subscriptionParentMediaAppend.remove();
|
|
177
172
|
}
|
|
178
|
-
|
|
179
173
|
if (this.subscriptionParentUpdateEditorSettings) {
|
|
180
174
|
this.subscriptionParentUpdateEditorSettings.remove();
|
|
181
175
|
}
|
|
182
|
-
|
|
183
176
|
if (this.subscriptionParentUpdateCapabilities) {
|
|
184
177
|
this.subscriptionParentUpdateCapabilities.remove();
|
|
185
178
|
}
|
|
186
|
-
|
|
187
179
|
if (this.subscriptionParentShowNotice) {
|
|
188
180
|
this.subscriptionParentShowNotice.remove();
|
|
189
181
|
}
|
|
190
|
-
|
|
191
182
|
if (this.subscriptionParentShowEditorHelp) {
|
|
192
183
|
this.subscriptionParentShowEditorHelp.remove();
|
|
193
184
|
}
|
|
194
185
|
}
|
|
195
|
-
|
|
196
186
|
getThemeColors({
|
|
197
187
|
rawStyles,
|
|
198
188
|
rawFeatures
|
|
@@ -201,31 +191,24 @@ class NativeEditorProvider extends Component {
|
|
|
201
191
|
defaultEditorColors,
|
|
202
192
|
defaultEditorGradients
|
|
203
193
|
} = this.props;
|
|
204
|
-
|
|
205
194
|
if (rawStyles && rawFeatures) {
|
|
206
195
|
return getGlobalStyles(rawStyles, rawFeatures);
|
|
207
196
|
}
|
|
208
|
-
|
|
209
197
|
return getColorsAndGradients(defaultEditorColors, defaultEditorGradients, rawFeatures);
|
|
210
198
|
}
|
|
211
|
-
|
|
212
199
|
componentDidUpdate(prevProps) {
|
|
213
200
|
if (!prevProps.isReady && this.props.isReady) {
|
|
214
201
|
const blocks = this.props.blocks;
|
|
215
|
-
|
|
216
202
|
const isUnsupportedBlock = ({
|
|
217
203
|
name
|
|
218
204
|
}) => name === getUnregisteredTypeHandlerName();
|
|
219
|
-
|
|
220
205
|
const unsupportedBlockNames = blocks.filter(isUnsupportedBlock).map(block => block.attributes.originalName);
|
|
221
206
|
RNReactNativeGutenbergBridge.editorDidMount(unsupportedBlockNames);
|
|
222
207
|
}
|
|
223
208
|
}
|
|
224
|
-
|
|
225
209
|
serializeToNativeAction() {
|
|
226
210
|
const title = this.props.title;
|
|
227
211
|
let html;
|
|
228
|
-
|
|
229
212
|
if (this.props.mode === 'text') {
|
|
230
213
|
// The HTMLTextInput component does not update the store when user is doing changes
|
|
231
214
|
// Let's request the HTML from the component's state directly.
|
|
@@ -233,48 +216,42 @@ class NativeEditorProvider extends Component {
|
|
|
233
216
|
} else {
|
|
234
217
|
html = serialize(this.props.blocks);
|
|
235
218
|
}
|
|
219
|
+
const hasChanges = title !== this.post.title.raw || html !== this.post.content.raw;
|
|
236
220
|
|
|
237
|
-
|
|
238
|
-
|
|
221
|
+
// Variable to store the content structure metrics.
|
|
239
222
|
const contentInfo = {};
|
|
240
223
|
contentInfo.characterCount = wordCount(html, 'characters_including_spaces');
|
|
241
224
|
contentInfo.wordCount = wordCount(html, 'words');
|
|
242
225
|
contentInfo.paragraphCount = this.props.paragraphCount;
|
|
243
226
|
contentInfo.blockCount = this.props.blockCount;
|
|
244
227
|
RNReactNativeGutenbergBridge.provideToNative_Html(html, title, hasChanges, contentInfo);
|
|
245
|
-
|
|
246
228
|
if (hasChanges) {
|
|
247
229
|
this.post.title.raw = title;
|
|
248
230
|
this.post.content.raw = html;
|
|
249
231
|
}
|
|
250
232
|
}
|
|
251
|
-
|
|
252
233
|
updateHtmlAction(html) {
|
|
253
234
|
const parsed = parse(html);
|
|
254
235
|
this.props.resetEditorBlocksWithoutUndoLevel(parsed);
|
|
255
236
|
}
|
|
256
|
-
|
|
257
237
|
replaceBlockAction(html, blockClientId) {
|
|
258
238
|
const parsed = parse(html);
|
|
259
239
|
this.props.replaceBlock(blockClientId, parsed);
|
|
260
240
|
}
|
|
261
|
-
|
|
262
241
|
toggleMode() {
|
|
263
242
|
const {
|
|
264
243
|
mode,
|
|
265
244
|
switchMode
|
|
266
|
-
} = this.props;
|
|
267
|
-
|
|
245
|
+
} = this.props;
|
|
246
|
+
// Refresh html content first.
|
|
268
247
|
this.serializeToNativeAction();
|
|
269
248
|
switchMode(mode === 'visual' ? 'text' : 'visual');
|
|
270
249
|
}
|
|
271
|
-
|
|
272
250
|
updateCapabilitiesAction(capabilities) {
|
|
273
251
|
this.props.updateEditorSettings({
|
|
274
252
|
capabilities
|
|
275
253
|
});
|
|
276
254
|
}
|
|
277
|
-
|
|
278
255
|
render() {
|
|
279
256
|
const {
|
|
280
257
|
children,
|
|
@@ -299,12 +276,9 @@ class NativeEditorProvider extends Component {
|
|
|
299
276
|
showSupport: capabilities?.supportSection === true
|
|
300
277
|
}));
|
|
301
278
|
}
|
|
302
|
-
|
|
303
279
|
}
|
|
304
|
-
|
|
305
280
|
const ComposedNativeProvider = compose([withSelect(select => {
|
|
306
281
|
var _settings$colors, _settings$gradients;
|
|
307
|
-
|
|
308
282
|
const {
|
|
309
283
|
__unstableIsEditorReady: isEditorReady,
|
|
310
284
|
getEditorBlocks,
|
|
@@ -363,25 +337,20 @@ const ComposedNativeProvider = compose([withSelect(select => {
|
|
|
363
337
|
addEntities,
|
|
364
338
|
insertBlock,
|
|
365
339
|
createSuccessNotice,
|
|
366
|
-
|
|
367
340
|
editTitle(title) {
|
|
368
341
|
editPost({
|
|
369
342
|
title
|
|
370
343
|
});
|
|
371
344
|
},
|
|
372
|
-
|
|
373
345
|
receiveEntityRecords,
|
|
374
|
-
|
|
375
346
|
resetEditorBlocksWithoutUndoLevel(blocks) {
|
|
376
347
|
resetEditorBlocks(blocks, {
|
|
377
348
|
__unstableShouldCreateUndoLevel: false
|
|
378
349
|
});
|
|
379
350
|
},
|
|
380
|
-
|
|
381
351
|
switchMode(mode) {
|
|
382
352
|
switchEditorMode(mode);
|
|
383
353
|
},
|
|
384
|
-
|
|
385
354
|
replaceBlock
|
|
386
355
|
};
|
|
387
356
|
})])(NativeEditorProvider);
|