@wordpress/editor 13.11.0 → 13.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/autosave-monitor/index.js +1 -2
- package/build/components/autosave-monitor/index.js.map +1 -1
- package/build/components/deprecated.js +7 -9
- package/build/components/deprecated.js.map +1 -1
- package/build/components/document-outline/check.js +4 -5
- package/build/components/document-outline/check.js.map +1 -1
- package/build/components/document-outline/index.js +12 -16
- package/build/components/document-outline/index.js.map +1 -1
- package/build/components/document-outline/item.js +22 -25
- package/build/components/document-outline/item.js.map +1 -1
- package/build/components/editor-help/help-detail-navigation-screen.native.js +6 -9
- package/build/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
- package/build/components/editor-help/help-get-support-button.native.js +4 -5
- package/build/components/editor-help/help-get-support-button.native.js.map +1 -1
- package/build/components/editor-help/help-section-title.native.js +3 -4
- package/build/components/editor-help/help-section-title.native.js.map +1 -1
- package/build/components/editor-help/help-topic-row.native.js +6 -7
- package/build/components/editor-help/help-topic-row.native.js.map +1 -1
- package/build/components/editor-help/index.native.js +20 -27
- package/build/components/editor-help/index.native.js.map +1 -1
- package/build/components/editor-help/view-sections.native.js +16 -20
- package/build/components/editor-help/view-sections.native.js.map +1 -1
- package/build/components/editor-history/redo.js +2 -6
- package/build/components/editor-history/redo.js.map +1 -1
- package/build/components/editor-history/undo.js +2 -6
- package/build/components/editor-history/undo.js.map +1 -1
- package/build/components/editor-notices/index.js +12 -19
- package/build/components/editor-notices/index.js.map +1 -1
- package/build/components/editor-snackbars/index.js +3 -6
- package/build/components/editor-snackbars/index.js.map +1 -1
- package/build/components/entities-saved-states/entity-record-item.js +7 -10
- package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
- package/build/components/entities-saved-states/entity-type-list.js +6 -7
- package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build/components/entities-saved-states/hooks/use-is-dirty.js +86 -0
- package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -0
- package/build/components/entities-saved-states/index.js +43 -116
- package/build/components/entities-saved-states/index.js.map +1 -1
- package/build/components/error-boundary/index.js +4 -5
- package/build/components/error-boundary/index.js.map +1 -1
- package/build/components/global-keyboard-shortcuts/save-shortcut.js +3 -4
- package/build/components/global-keyboard-shortcuts/save-shortcut.js.map +1 -1
- package/build/components/index.js +18 -0
- package/build/components/index.js.map +1 -1
- package/build/components/media-categories/index.js +25 -42
- package/build/components/media-categories/index.js.map +1 -1
- package/build/components/page-attributes/check.js +4 -7
- package/build/components/page-attributes/check.js.map +1 -1
- package/build/components/page-attributes/order.js +7 -9
- package/build/components/page-attributes/order.js.map +1 -1
- package/build/components/page-attributes/parent.js +5 -12
- package/build/components/page-attributes/parent.js.map +1 -1
- package/build/components/post-author/check.js +6 -7
- package/build/components/post-author/check.js.map +1 -1
- package/build/components/post-author/combobox.js +3 -6
- package/build/components/post-author/combobox.js.map +1 -1
- package/build/components/post-author/index.js +1 -1
- package/build/components/post-author/index.js.map +1 -1
- package/build/components/post-comments/index.js +4 -6
- package/build/components/post-comments/index.js.map +1 -1
- package/build/components/post-excerpt/check.js +2 -4
- package/build/components/post-excerpt/check.js.map +1 -1
- package/build/components/post-excerpt/index.js +4 -5
- package/build/components/post-excerpt/index.js.map +1 -1
- package/build/components/post-featured-image/check.js +2 -4
- package/build/components/post-featured-image/check.js.map +1 -1
- package/build/components/post-featured-image/index.js +56 -69
- package/build/components/post-featured-image/index.js.map +1 -1
- package/build/components/post-format/check.js +6 -9
- package/build/components/post-format/check.js.map +1 -1
- package/build/components/post-format/index.js +1 -1
- package/build/components/post-format/index.js.map +1 -1
- package/build/components/post-last-revision/check.js +5 -7
- package/build/components/post-last-revision/check.js.map +1 -1
- package/build/components/post-last-revision/index.js +4 -5
- package/build/components/post-last-revision/index.js.map +1 -1
- package/build/components/post-locked-modal/index.js +1 -1
- package/build/components/post-locked-modal/index.js.map +1 -1
- package/build/components/post-pending-status/check.js +7 -9
- package/build/components/post-pending-status/check.js.map +1 -1
- package/build/components/post-pending-status/index.js +4 -6
- package/build/components/post-pending-status/index.js.map +1 -1
- package/build/components/post-pingbacks/index.js +4 -6
- package/build/components/post-pingbacks/index.js.map +1 -1
- package/build/components/post-preview-button/index.js +8 -12
- package/build/components/post-preview-button/index.js.map +1 -1
- package/build/components/post-publish-button/index.js +10 -19
- package/build/components/post-publish-button/index.js.map +1 -1
- package/build/components/post-publish-button/label.js +14 -17
- package/build/components/post-publish-button/label.js.map +1 -1
- package/build/components/post-publish-panel/index.js +10 -12
- package/build/components/post-publish-panel/index.js.map +1 -1
- package/build/components/post-publish-panel/maybe-category-panel.js +2 -4
- package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-post-format-panel.js +9 -12
- package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-tags-panel.js +4 -7
- package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-upload-media.js +150 -0
- package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -0
- package/build/components/post-publish-panel/postpublish.js +8 -11
- package/build/components/post-publish-panel/postpublish.js.map +1 -1
- package/build/components/post-publish-panel/prepublish.js +8 -7
- package/build/components/post-publish-panel/prepublish.js.map +1 -1
- package/build/components/post-saved-state/index.js +13 -8
- package/build/components/post-saved-state/index.js.map +1 -1
- package/build/components/post-schedule/check.js +6 -8
- package/build/components/post-schedule/check.js.map +1 -1
- package/build/components/post-schedule/index.js +8 -12
- package/build/components/post-schedule/index.js.map +1 -1
- package/build/components/post-schedule/label.js +7 -10
- package/build/components/post-schedule/label.js.map +1 -1
- package/build/components/post-slug/check.js +3 -4
- package/build/components/post-slug/check.js.map +1 -1
- package/build/components/post-slug/index.js +5 -6
- package/build/components/post-slug/index.js.map +1 -1
- package/build/components/post-sticky/check.js +7 -9
- package/build/components/post-sticky/check.js.map +1 -1
- package/build/components/post-sticky/index.js +4 -5
- package/build/components/post-sticky/index.js.map +1 -1
- package/build/components/post-switch-to-draft-button/index.js +6 -7
- package/build/components/post-switch-to-draft-button/index.js.map +1 -1
- package/build/components/post-sync-status/index.js +67 -0
- package/build/components/post-sync-status/index.js.map +1 -0
- package/build/components/post-taxonomies/check.js +6 -7
- package/build/components/post-taxonomies/check.js.map +1 -1
- package/build/components/post-taxonomies/flat-term-selector.js +36 -46
- package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/hierarchical-term-selector.js +13 -14
- package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/index.js +6 -11
- package/build/components/post-taxonomies/index.js.map +1 -1
- package/build/components/post-taxonomies/most-used-terms.js +5 -6
- package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build/components/post-template/index.js +6 -9
- package/build/components/post-template/index.js.map +1 -1
- package/build/components/post-title/index.js +8 -5
- package/build/components/post-title/index.js.map +1 -1
- package/build/components/post-title/index.native.js +8 -11
- package/build/components/post-title/index.native.js.map +1 -1
- package/build/components/post-trash/check.js +7 -9
- package/build/components/post-trash/check.js.map +1 -1
- package/build/components/post-type-support-check/index.js +5 -6
- package/build/components/post-type-support-check/index.js.map +1 -1
- package/build/components/post-url/check.js +4 -5
- package/build/components/post-url/check.js.map +1 -1
- package/build/components/post-url/index.js +8 -9
- package/build/components/post-url/index.js.map +1 -1
- package/build/components/post-visibility/check.js +6 -7
- package/build/components/post-visibility/check.js.map +1 -1
- package/build/components/post-visibility/index.js +14 -19
- package/build/components/post-visibility/index.js.map +1 -1
- package/build/components/post-visibility/label.js +1 -3
- package/build/components/post-visibility/label.js.map +1 -1
- package/build/components/provider/index.js +12 -15
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/index.native.js +19 -30
- package/build/components/provider/index.native.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.js +5 -9
- package/build/components/provider/use-block-editor-settings.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.native.js +1 -3
- package/build/components/provider/use-block-editor-settings.native.js.map +1 -1
- package/build/components/provider/with-registry-provider.js +4 -2
- package/build/components/provider/with-registry-provider.js.map +1 -1
- package/build/components/table-of-contents/index.js +26 -35
- package/build/components/table-of-contents/index.js.map +1 -1
- package/build/components/table-of-contents/panel.js +4 -5
- package/build/components/table-of-contents/panel.js.map +1 -1
- package/build/components/template-validation-notice/index.js +4 -6
- package/build/components/template-validation-notice/index.js.map +1 -1
- package/build/components/theme-support-check/index.js +7 -8
- package/build/components/theme-support-check/index.js.map +1 -1
- package/build/hooks/custom-sources-backwards-compatibility.js +20 -42
- package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
- package/build/hooks/default-autocompleters.js +1 -2
- package/build/hooks/default-autocompleters.js.map +1 -1
- package/build/{lockUnlock.js → lock-unlock.js} +1 -1
- package/build/lock-unlock.js.map +1 -0
- package/build/private-apis.js +5 -2
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +147 -179
- package/build/store/actions.js.map +1 -1
- package/build/store/actions.native.js +1 -2
- package/build/store/actions.native.js.map +1 -1
- package/build/store/reducer.js +14 -44
- package/build/store/reducer.js.map +1 -1
- package/build/store/reducer.native.js +3 -12
- package/build/store/reducer.native.js.map +1 -1
- package/build/store/selectors.js +23 -54
- package/build/store/selectors.js.map +1 -1
- package/build/store/utils/notice-builder.js +3 -3
- package/build/store/utils/notice-builder.js.map +1 -1
- package/build/utils/media-upload/index.js +11 -15
- package/build/utils/media-upload/index.js.map +1 -1
- package/build/utils/terms.js +3 -6
- package/build/utils/terms.js.map +1 -1
- package/build-module/components/autosave-monitor/index.js +1 -2
- package/build-module/components/autosave-monitor/index.js.map +1 -1
- package/build-module/components/deprecated.js +7 -8
- package/build-module/components/deprecated.js.map +1 -1
- package/build-module/components/document-outline/check.js +4 -5
- package/build-module/components/document-outline/check.js.map +1 -1
- package/build-module/components/document-outline/index.js +12 -16
- package/build-module/components/document-outline/index.js.map +1 -1
- package/build-module/components/document-outline/item.js +22 -25
- package/build-module/components/document-outline/item.js.map +1 -1
- package/build-module/components/editor-help/help-detail-navigation-screen.native.js +6 -8
- package/build-module/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
- package/build-module/components/editor-help/help-get-support-button.native.js +4 -5
- package/build-module/components/editor-help/help-get-support-button.native.js.map +1 -1
- package/build-module/components/editor-help/help-section-title.native.js +3 -4
- package/build-module/components/editor-help/help-section-title.native.js.map +1 -1
- package/build-module/components/editor-help/help-topic-row.native.js +6 -7
- package/build-module/components/editor-help/help-topic-row.native.js.map +1 -1
- package/build-module/components/editor-help/index.native.js +20 -25
- package/build-module/components/editor-help/index.native.js.map +1 -1
- package/build-module/components/editor-help/view-sections.native.js +16 -20
- package/build-module/components/editor-help/view-sections.native.js.map +1 -1
- package/build-module/components/editor-history/redo.js +2 -3
- package/build-module/components/editor-history/redo.js.map +1 -1
- package/build-module/components/editor-history/undo.js +2 -3
- package/build-module/components/editor-history/undo.js.map +1 -1
- package/build-module/components/editor-notices/index.js +12 -19
- package/build-module/components/editor-notices/index.js.map +1 -1
- package/build-module/components/editor-snackbars/index.js +3 -6
- package/build-module/components/editor-snackbars/index.js.map +1 -1
- package/build-module/components/entities-saved-states/entity-record-item.js +7 -10
- package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
- package/build-module/components/entities-saved-states/entity-type-list.js +6 -7
- package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build-module/components/entities-saved-states/hooks/use-is-dirty.js +72 -0
- package/build-module/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -0
- package/build-module/components/entities-saved-states/index.js +44 -118
- package/build-module/components/entities-saved-states/index.js.map +1 -1
- package/build-module/components/error-boundary/index.js +4 -5
- package/build-module/components/error-boundary/index.js.map +1 -1
- package/build-module/components/global-keyboard-shortcuts/save-shortcut.js +3 -4
- package/build-module/components/global-keyboard-shortcuts/save-shortcut.js.map +1 -1
- package/build-module/components/index.js +2 -0
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/media-categories/index.js +25 -42
- package/build-module/components/media-categories/index.js.map +1 -1
- package/build-module/components/page-attributes/check.js +4 -7
- package/build-module/components/page-attributes/check.js.map +1 -1
- package/build-module/components/page-attributes/order.js +7 -9
- package/build-module/components/page-attributes/order.js.map +1 -1
- package/build-module/components/page-attributes/parent.js +5 -12
- package/build-module/components/page-attributes/parent.js.map +1 -1
- package/build-module/components/post-author/check.js +6 -7
- package/build-module/components/post-author/check.js.map +1 -1
- package/build-module/components/post-author/combobox.js +3 -6
- package/build-module/components/post-author/combobox.js.map +1 -1
- package/build-module/components/post-author/index.js +1 -1
- package/build-module/components/post-author/index.js.map +1 -1
- package/build-module/components/post-comments/index.js +4 -6
- package/build-module/components/post-comments/index.js.map +1 -1
- package/build-module/components/post-excerpt/check.js +2 -3
- package/build-module/components/post-excerpt/check.js.map +1 -1
- package/build-module/components/post-excerpt/index.js +4 -5
- package/build-module/components/post-excerpt/index.js.map +1 -1
- package/build-module/components/post-featured-image/check.js +2 -3
- package/build-module/components/post-featured-image/check.js.map +1 -1
- package/build-module/components/post-featured-image/index.js +56 -69
- package/build-module/components/post-featured-image/index.js.map +1 -1
- package/build-module/components/post-format/check.js +6 -8
- package/build-module/components/post-format/check.js.map +1 -1
- package/build-module/components/post-format/index.js +1 -1
- package/build-module/components/post-format/index.js.map +1 -1
- package/build-module/components/post-last-revision/check.js +5 -7
- package/build-module/components/post-last-revision/check.js.map +1 -1
- package/build-module/components/post-last-revision/index.js +4 -5
- package/build-module/components/post-last-revision/index.js.map +1 -1
- package/build-module/components/post-locked-modal/index.js +1 -1
- package/build-module/components/post-locked-modal/index.js.map +1 -1
- package/build-module/components/post-pending-status/check.js +7 -9
- package/build-module/components/post-pending-status/check.js.map +1 -1
- package/build-module/components/post-pending-status/index.js +4 -6
- package/build-module/components/post-pending-status/index.js.map +1 -1
- package/build-module/components/post-pingbacks/index.js +4 -6
- package/build-module/components/post-pingbacks/index.js.map +1 -1
- package/build-module/components/post-preview-button/index.js +8 -12
- package/build-module/components/post-preview-button/index.js.map +1 -1
- package/build-module/components/post-publish-button/index.js +10 -18
- package/build-module/components/post-publish-button/index.js.map +1 -1
- package/build-module/components/post-publish-button/label.js +14 -17
- package/build-module/components/post-publish-button/label.js.map +1 -1
- package/build-module/components/post-publish-panel/index.js +10 -11
- package/build-module/components/post-publish-panel/index.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-category-panel.js +2 -4
- package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-post-format-panel.js +9 -12
- package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-tags-panel.js +4 -7
- package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-upload-media.js +138 -0
- package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -0
- package/build-module/components/post-publish-panel/postpublish.js +8 -11
- package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
- package/build-module/components/post-publish-panel/prepublish.js +7 -7
- package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
- package/build-module/components/post-saved-state/index.js +13 -8
- package/build-module/components/post-saved-state/index.js.map +1 -1
- package/build-module/components/post-schedule/check.js +6 -8
- package/build-module/components/post-schedule/check.js.map +1 -1
- package/build-module/components/post-schedule/index.js +8 -12
- package/build-module/components/post-schedule/index.js.map +1 -1
- package/build-module/components/post-schedule/label.js +7 -10
- package/build-module/components/post-schedule/label.js.map +1 -1
- package/build-module/components/post-slug/check.js +3 -4
- package/build-module/components/post-slug/check.js.map +1 -1
- package/build-module/components/post-slug/index.js +5 -6
- package/build-module/components/post-slug/index.js.map +1 -1
- package/build-module/components/post-sticky/check.js +7 -9
- package/build-module/components/post-sticky/check.js.map +1 -1
- package/build-module/components/post-sticky/index.js +4 -5
- package/build-module/components/post-sticky/index.js.map +1 -1
- package/build-module/components/post-switch-to-draft-button/index.js +6 -7
- package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
- package/build-module/components/post-sync-status/index.js +56 -0
- package/build-module/components/post-sync-status/index.js.map +1 -0
- package/build-module/components/post-taxonomies/check.js +6 -7
- package/build-module/components/post-taxonomies/check.js.map +1 -1
- package/build-module/components/post-taxonomies/flat-term-selector.js +36 -44
- package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js +13 -14
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/index.js +6 -11
- package/build-module/components/post-taxonomies/index.js.map +1 -1
- package/build-module/components/post-taxonomies/most-used-terms.js +5 -6
- package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build-module/components/post-template/index.js +6 -9
- package/build-module/components/post-template/index.js.map +1 -1
- package/build-module/components/post-title/index.js +8 -5
- package/build-module/components/post-title/index.js.map +1 -1
- package/build-module/components/post-title/index.native.js +8 -11
- package/build-module/components/post-title/index.native.js.map +1 -1
- package/build-module/components/post-trash/check.js +7 -9
- package/build-module/components/post-trash/check.js.map +1 -1
- package/build-module/components/post-type-support-check/index.js +5 -6
- package/build-module/components/post-type-support-check/index.js.map +1 -1
- package/build-module/components/post-url/check.js +4 -5
- package/build-module/components/post-url/check.js.map +1 -1
- package/build-module/components/post-url/index.js +8 -9
- package/build-module/components/post-url/index.js.map +1 -1
- package/build-module/components/post-visibility/check.js +6 -7
- package/build-module/components/post-visibility/check.js.map +1 -1
- package/build-module/components/post-visibility/index.js +14 -16
- package/build-module/components/post-visibility/index.js.map +1 -1
- package/build-module/components/post-visibility/label.js +1 -3
- package/build-module/components/post-visibility/label.js.map +1 -1
- package/build-module/components/provider/index.js +12 -14
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/index.native.js +19 -29
- package/build-module/components/provider/index.native.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.js +5 -9
- package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.native.js +1 -3
- package/build-module/components/provider/use-block-editor-settings.native.js.map +1 -1
- package/build-module/components/provider/with-registry-provider.js +4 -2
- package/build-module/components/provider/with-registry-provider.js.map +1 -1
- package/build-module/components/table-of-contents/index.js +26 -34
- package/build-module/components/table-of-contents/index.js.map +1 -1
- package/build-module/components/table-of-contents/panel.js +4 -5
- package/build-module/components/table-of-contents/panel.js.map +1 -1
- package/build-module/components/template-validation-notice/index.js +4 -6
- package/build-module/components/template-validation-notice/index.js.map +1 -1
- package/build-module/components/theme-support-check/index.js +7 -8
- package/build-module/components/theme-support-check/index.js.map +1 -1
- package/build-module/hooks/custom-sources-backwards-compatibility.js +20 -39
- package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
- package/build-module/hooks/default-autocompleters.js +1 -2
- package/build-module/hooks/default-autocompleters.js.map +1 -1
- package/build-module/{lockUnlock.js → lock-unlock.js} +1 -1
- package/build-module/lock-unlock.js.map +1 -0
- package/build-module/private-apis.js +4 -2
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +147 -179
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/actions.native.js +1 -2
- package/build-module/store/actions.native.js.map +1 -1
- package/build-module/store/reducer.js +14 -44
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/reducer.native.js +3 -12
- package/build-module/store/reducer.native.js.map +1 -1
- package/build-module/store/selectors.js +21 -54
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/utils/notice-builder.js +3 -3
- package/build-module/store/utils/notice-builder.js.map +1 -1
- package/build-module/utils/media-upload/index.js +11 -15
- package/build-module/utils/media-upload/index.js.map +1 -1
- package/build-module/utils/terms.js +3 -6
- package/build-module/utils/terms.js.map +1 -1
- package/build-style/style-rtl.css +15 -1
- package/build-style/style.css +15 -1
- package/package.json +30 -31
- package/src/components/editor-help/test/index.native.js +3 -2
- package/src/components/entities-saved-states/hooks/use-is-dirty.js +87 -0
- package/src/components/entities-saved-states/index.js +25 -106
- package/src/components/entities-saved-states/test/use-is-dirty.js +94 -0
- package/src/components/index.js +2 -0
- package/src/components/post-publish-panel/maybe-upload-media.js +167 -0
- package/src/components/post-publish-panel/prepublish.js +2 -0
- package/src/components/post-publish-panel/style.scss +1 -1
- package/src/components/post-saved-state/index.js +6 -0
- package/src/components/post-sync-status/index.js +55 -0
- package/src/components/post-sync-status/style.scss +16 -0
- package/src/components/post-taxonomies/flat-term-selector.js +20 -30
- package/src/components/post-title/index.js +4 -1
- package/src/components/provider/index.js +1 -1
- package/src/components/provider/index.native.js +2 -9
- package/src/private-apis.js +3 -1
- package/src/style.scss +1 -0
- package/build/lockUnlock.js.map +0 -1
- package/build-module/lockUnlock.js.map +0 -1
- /package/src/{lockUnlock.js → lock-unlock.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/post-trash/check.js"],"names":["PostTrashCheck","isNew","postId","canUserDelete","children","select","isEditedPostNew","getCurrentPostId","getCurrentPostType","editorStore","getPostType","canUser","coreStore","postType","resource","rest_base"],"mappings":";;;;;;;AAGA;;AACA;;AAKA;;AATA;AACA;AACA;;AAIA;AACA;AACA;AAGA,SAASA,cAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/post-trash/check.js"],"names":["PostTrashCheck","isNew","postId","canUserDelete","children","select","isEditedPostNew","getCurrentPostId","getCurrentPostType","editorStore","getPostType","canUser","coreStore","postType","resource","rest_base"],"mappings":";;;;;;;AAGA;;AACA;;AAKA;;AATA;AACA;AACA;;AAIA;AACA;AACA;AAGA,SAASA,cAAT,CAAyB;AAAEC,EAAAA,KAAF;AAASC,EAAAA,MAAT;AAAiBC,EAAAA,aAAjB;AAAgCC,EAAAA;AAAhC,CAAzB,EAAsE;AACrE,MAAKH,KAAK,IAAI,CAAEC,MAAX,IAAqB,CAAEC,aAA5B,EAA4C;AAC3C,WAAO,IAAP;AACA;;AAED,SAAOC,QAAP;AACA;;eAEc,sBAAcC,MAAF,IAAc;AACxC,QAAM;AAAEC,IAAAA,eAAF;AAAmBC,IAAAA,gBAAnB;AAAqCC,IAAAA;AAArC,MACLH,MAAM,CAAEI,YAAF,CADP;AAEA,QAAM;AAAEC,IAAAA,WAAF;AAAeC,IAAAA;AAAf,MAA2BN,MAAM,CAAEO,eAAF,CAAvC;AACA,QAAMV,MAAM,GAAGK,gBAAgB,EAA/B;AACA,QAAMM,QAAQ,GAAGH,WAAW,CAAEF,kBAAkB,EAApB,CAA5B;AACA,QAAMM,QAAQ,GAAGD,QAAQ,EAAEE,SAAV,IAAuB,EAAxC,CANwC,CAMI;;AAE5C,SAAO;AACNd,IAAAA,KAAK,EAAEK,eAAe,EADhB;AAENJ,IAAAA,MAFM;AAGNC,IAAAA,aAAa,EACZD,MAAM,IAAIY,QAAV,GAAqBH,OAAO,CAAE,QAAF,EAAYG,QAAZ,EAAsBZ,MAAtB,CAA5B,GAA6D;AAJxD,GAAP;AAMA,CAdc,EAcVF,cAdU,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { withSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction PostTrashCheck( { isNew, postId, canUserDelete, children } ) {\n\tif ( isNew || ! postId || ! canUserDelete ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n\nexport default withSelect( ( select ) => {\n\tconst { isEditedPostNew, getCurrentPostId, getCurrentPostType } =\n\t\tselect( editorStore );\n\tconst { getPostType, canUser } = select( coreStore );\n\tconst postId = getCurrentPostId();\n\tconst postType = getPostType( getCurrentPostType() );\n\tconst resource = postType?.rest_base || ''; // eslint-disable-line camelcase\n\n\treturn {\n\t\tisNew: isEditedPostNew(),\n\t\tpostId,\n\t\tcanUserDelete:\n\t\t\tpostId && resource ? canUser( 'delete', resource, postId ) : false,\n\t};\n} )( PostTrashCheck );\n"]}
|
|
@@ -33,12 +33,11 @@ var _store = require("../../store");
|
|
|
33
33
|
*
|
|
34
34
|
* @return {WPComponent} The component to be rendered.
|
|
35
35
|
*/
|
|
36
|
-
function PostTypeSupportCheck(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
} = _ref;
|
|
36
|
+
function PostTypeSupportCheck({
|
|
37
|
+
postType,
|
|
38
|
+
children,
|
|
39
|
+
supportKeys
|
|
40
|
+
}) {
|
|
42
41
|
let isSupported = true;
|
|
43
42
|
|
|
44
43
|
if (postType) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/post-type-support-check/index.js"],"names":["PostTypeSupportCheck","postType","children","supportKeys","isSupported","Array","isArray","some","key","supports","select","getEditedPostAttribute","editorStore","getPostType","coreStore"],"mappings":";;;;;;;;AAGA;;AACA;;AAKA;;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,oBAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/post-type-support-check/index.js"],"names":["PostTypeSupportCheck","postType","children","supportKeys","isSupported","Array","isArray","some","key","supports","select","getEditedPostAttribute","editorStore","getPostType","coreStore"],"mappings":";;;;;;;;AAGA;;AACA;;AAKA;;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,oBAAT,CAA+B;AAAEC,EAAAA,QAAF;AAAYC,EAAAA,QAAZ;AAAsBC,EAAAA;AAAtB,CAA/B,EAAqE;AAC3E,MAAIC,WAAW,GAAG,IAAlB;;AACA,MAAKH,QAAL,EAAgB;AACfG,IAAAA,WAAW,GAAG,CACbC,KAAK,CAACC,OAAN,CAAeH,WAAf,IAA+BA,WAA/B,GAA6C,CAAEA,WAAF,CADhC,EAEZI,IAFY,CAEJC,GAAF,IAAW,CAAC,CAAEP,QAAQ,CAACQ,QAAT,CAAmBD,GAAnB,CAFR,CAAd;AAGA;;AAED,MAAK,CAAEJ,WAAP,EAAqB;AACpB,WAAO,IAAP;AACA;;AAED,SAAOF,QAAP;AACA;;eAEc,sBAAcQ,MAAF,IAAc;AACxC,QAAM;AAAEC,IAAAA;AAAF,MAA6BD,MAAM,CAAEE,YAAF,CAAzC;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAkBH,MAAM,CAAEI,eAAF,CAA9B;AACA,SAAO;AACNb,IAAAA,QAAQ,EAAEY,WAAW,CAAEF,sBAAsB,CAAE,MAAF,CAAxB;AADf,GAAP;AAGA,CANc,EAMVX,oBANU,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { withSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * A component which renders its own children only if the current editor post\n * type supports one of the given `supportKeys` prop.\n *\n * @param {Object} props Props.\n * @param {string} [props.postType] Current post type.\n * @param {WPElement} props.children Children to be rendered if post\n * type supports.\n * @param {(string|string[])} props.supportKeys String or string array of keys\n * to test.\n *\n * @return {WPComponent} The component to be rendered.\n */\nexport function PostTypeSupportCheck( { postType, children, supportKeys } ) {\n\tlet isSupported = true;\n\tif ( postType ) {\n\t\tisSupported = (\n\t\t\tArray.isArray( supportKeys ) ? supportKeys : [ supportKeys ]\n\t\t).some( ( key ) => !! postType.supports[ key ] );\n\t}\n\n\tif ( ! isSupported ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n\nexport default withSelect( ( select ) => {\n\tconst { getEditedPostAttribute } = select( editorStore );\n\tconst { getPostType } = select( coreStore );\n\treturn {\n\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t};\n} )( PostTypeSupportCheck );\n"]}
|
|
@@ -18,15 +18,14 @@ var _store = require("../../store");
|
|
|
18
18
|
/**
|
|
19
19
|
* Internal dependencies
|
|
20
20
|
*/
|
|
21
|
-
function PostURLCheck(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
} = _ref;
|
|
21
|
+
function PostURLCheck({
|
|
22
|
+
children
|
|
23
|
+
}) {
|
|
25
24
|
const isVisible = (0, _data.useSelect)(select => {
|
|
26
25
|
const postTypeSlug = select(_store.store).getCurrentPostType();
|
|
27
26
|
const postType = select(_coreData.store).getPostType(postTypeSlug);
|
|
28
27
|
|
|
29
|
-
if (!
|
|
28
|
+
if (!postType?.viewable) {
|
|
30
29
|
return false;
|
|
31
30
|
}
|
|
32
31
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/post-url/check.js"],"names":["PostURLCheck","children","isVisible","select","postTypeSlug","editorStore","getCurrentPostType","postType","coreStore","getPostType","viewable","post","getCurrentPost","link","permalinkParts","getPermalinkParts"],"mappings":";;;;;;;AAGA;;AACA;;AAKA;;AATA;AACA;AACA;;AAIA;AACA;AACA;AAGe,SAASA,YAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/post-url/check.js"],"names":["PostURLCheck","children","isVisible","select","postTypeSlug","editorStore","getCurrentPostType","postType","coreStore","getPostType","viewable","post","getCurrentPost","link","permalinkParts","getPermalinkParts"],"mappings":";;;;;;;AAGA;;AACA;;AAKA;;AATA;AACA;AACA;;AAIA;AACA;AACA;AAGe,SAASA,YAAT,CAAuB;AAAEC,EAAAA;AAAF,CAAvB,EAAsC;AACpD,QAAMC,SAAS,GAAG,qBAAaC,MAAF,IAAc;AAC1C,UAAMC,YAAY,GAAGD,MAAM,CAAEE,YAAF,CAAN,CAAsBC,kBAAtB,EAArB;AACA,UAAMC,QAAQ,GAAGJ,MAAM,CAAEK,eAAF,CAAN,CAAoBC,WAApB,CAAiCL,YAAjC,CAAjB;;AACA,QAAK,CAAEG,QAAQ,EAAEG,QAAjB,EAA4B;AAC3B,aAAO,KAAP;AACA;;AAED,UAAMC,IAAI,GAAGR,MAAM,CAAEE,YAAF,CAAN,CAAsBO,cAAtB,EAAb;;AACA,QAAK,CAAED,IAAI,CAACE,IAAZ,EAAmB;AAClB,aAAO,KAAP;AACA;;AAED,UAAMC,cAAc,GAAGX,MAAM,CAAEE,YAAF,CAAN,CAAsBU,iBAAtB,EAAvB;;AACA,QAAK,CAAED,cAAP,EAAwB;AACvB,aAAO,KAAP;AACA;;AAED,WAAO,IAAP;AACA,GAlBiB,EAkBf,EAlBe,CAAlB;;AAoBA,MAAK,CAAEZ,SAAP,EAAmB;AAClB,WAAO,IAAP;AACA;;AAED,SAAOD,QAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport default function PostURLCheck( { children } ) {\n\tconst isVisible = useSelect( ( select ) => {\n\t\tconst postTypeSlug = select( editorStore ).getCurrentPostType();\n\t\tconst postType = select( coreStore ).getPostType( postTypeSlug );\n\t\tif ( ! postType?.viewable ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst post = select( editorStore ).getCurrentPost();\n\t\tif ( ! post.link ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst permalinkParts = select( editorStore ).getPermalinkParts();\n\t\tif ( ! permalinkParts ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}, [] );\n\n\tif ( ! isVisible ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n"]}
|
|
@@ -28,10 +28,9 @@ var _store = require("../../store");
|
|
|
28
28
|
/**
|
|
29
29
|
* Internal dependencies
|
|
30
30
|
*/
|
|
31
|
-
function PostURL(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
} = _ref;
|
|
31
|
+
function PostURL({
|
|
32
|
+
onClose
|
|
33
|
+
}) {
|
|
35
34
|
const {
|
|
36
35
|
isEditable,
|
|
37
36
|
postSlug,
|
|
@@ -40,20 +39,20 @@ function PostURL(_ref) {
|
|
|
40
39
|
permalinkPrefix,
|
|
41
40
|
permalinkSuffix
|
|
42
41
|
} = (0, _data.useSelect)(select => {
|
|
43
|
-
var _post$_links$wpActio
|
|
42
|
+
var _post$_links$wpActio;
|
|
44
43
|
|
|
45
44
|
const post = select(_store.store).getCurrentPost();
|
|
46
45
|
const postTypeSlug = select(_store.store).getCurrentPostType();
|
|
47
46
|
const postType = select(_coreData.store).getPostType(postTypeSlug);
|
|
48
47
|
const permalinkParts = select(_store.store).getPermalinkParts();
|
|
49
|
-
const hasPublishAction = (_post$_links$wpActio = post
|
|
48
|
+
const hasPublishAction = (_post$_links$wpActio = post?._links?.['wp:action-publish']) !== null && _post$_links$wpActio !== void 0 ? _post$_links$wpActio : false;
|
|
50
49
|
return {
|
|
51
50
|
isEditable: select(_store.store).isPermalinkEditable() && hasPublishAction,
|
|
52
51
|
postSlug: (0, _url.safeDecodeURIComponent)(select(_store.store).getEditedPostSlug()),
|
|
53
|
-
viewPostLabel: postType
|
|
52
|
+
viewPostLabel: postType?.labels.view_item,
|
|
54
53
|
postLink: post.link,
|
|
55
|
-
permalinkPrefix: permalinkParts
|
|
56
|
-
permalinkSuffix: permalinkParts
|
|
54
|
+
permalinkPrefix: permalinkParts?.prefix,
|
|
55
|
+
permalinkSuffix: permalinkParts?.suffix
|
|
57
56
|
};
|
|
58
57
|
}, []);
|
|
59
58
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/post-url/index.js"],"names":["PostURL","onClose","isEditable","postSlug","viewPostLabel","postLink","permalinkPrefix","permalinkSuffix","select","post","editorStore","getCurrentPost","postTypeSlug","getCurrentPostType","postType","coreStore","getPostType","permalinkParts","getPermalinkParts","hasPublishAction","_links","isPermalinkEditable","getEditedPostSlug","labels","view_item","link","prefix","suffix","editPost","forceEmptyField","setForceEmptyField","newValue","slug","event","target","value"],"mappings":";;;;;;;AAKA;;AAFA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AAKA;;AAdA;AACA;AACA;;AASA;AACA;AACA;AAGe,SAASA,OAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/post-url/index.js"],"names":["PostURL","onClose","isEditable","postSlug","viewPostLabel","postLink","permalinkPrefix","permalinkSuffix","select","post","editorStore","getCurrentPost","postTypeSlug","getCurrentPostType","postType","coreStore","getPostType","permalinkParts","getPermalinkParts","hasPublishAction","_links","isPermalinkEditable","getEditedPostSlug","labels","view_item","link","prefix","suffix","editPost","forceEmptyField","setForceEmptyField","newValue","slug","event","target","value"],"mappings":";;;;;;;AAKA;;AAFA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AAKA;;AAdA;AACA;AACA;;AASA;AACA;AACA;AAGe,SAASA,OAAT,CAAkB;AAAEC,EAAAA;AAAF,CAAlB,EAAgC;AAC9C,QAAM;AACLC,IAAAA,UADK;AAELC,IAAAA,QAFK;AAGLC,IAAAA,aAHK;AAILC,IAAAA,QAJK;AAKLC,IAAAA,eALK;AAMLC,IAAAA;AANK,MAOF,qBAAaC,MAAF,IAAc;AAAA;;AAC5B,UAAMC,IAAI,GAAGD,MAAM,CAAEE,YAAF,CAAN,CAAsBC,cAAtB,EAAb;AACA,UAAMC,YAAY,GAAGJ,MAAM,CAAEE,YAAF,CAAN,CAAsBG,kBAAtB,EAArB;AACA,UAAMC,QAAQ,GAAGN,MAAM,CAAEO,eAAF,CAAN,CAAoBC,WAApB,CAAiCJ,YAAjC,CAAjB;AACA,UAAMK,cAAc,GAAGT,MAAM,CAAEE,YAAF,CAAN,CAAsBQ,iBAAtB,EAAvB;AACA,UAAMC,gBAAgB,2BAAGV,IAAI,EAAEW,MAAN,GAAgB,mBAAhB,CAAH,uEAA4C,KAAlE;AAEA,WAAO;AACNlB,MAAAA,UAAU,EACTM,MAAM,CAAEE,YAAF,CAAN,CAAsBW,mBAAtB,MAA+CF,gBAF1C;AAGNhB,MAAAA,QAAQ,EAAE,iCACTK,MAAM,CAAEE,YAAF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;AACtBC,QAAAA,kBAAkB,CAAE,KAAF,CAAlB;AACA;AACD,KAjCF;AAkCC,IAAA,MAAM,EAAKG,KAAF,IAAa;AACrBL,MAAAA,QAAQ,CAAE;AACTI,QAAAA,IAAI,EAAE,uBAAcC,KAAK,CAACC,MAAN,CAAaC,KAA3B;AADG,OAAF,CAAR;;AAGA,UAAKN,eAAL,EAAuB;AACtBC,QAAAA,kBAAkB,CAAE,KAAF,CAAlB;AACA;AACD;AAzCF,IAHF,EA+CG5B,UAAU,IACX;AAAI,IAAA,SAAS,EAAC;AAAd,KACGE,aADH,aACGA,aADH,cACGA,aADH,GACoB,cAAI,WAAJ,CADpB,CAhDF,EAoDC,uCACC,4BAAC,wBAAD;AACC,IAAA,SAAS,EAAC,uBADX;AAEC,IAAA,IAAI,EAAGC,QAFR;AAGC,IAAA,MAAM,EAAC;AAHR,KAKGH,UAAU,GACX,qDACC;AAAM,IAAA,SAAS,EAAC;AAAhB,KACGI,eADH,CADD,EAIC;AAAM,IAAA,SAAS,EAAC;AAAhB,KACGH,QADH,CAJD,EAOC;AAAM,IAAA,SAAS,EAAC;AAAhB,KACGI,eADH,CAPD,CADW,GAaXF,QAlBF,CADD,CApDD,CADD;AA8EA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { safeDecodeURIComponent, cleanForSlug } from '@wordpress/url';\nimport { useState } from '@wordpress/element';\nimport { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { TextControl, ExternalLink } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport default function PostURL( { onClose } ) {\n\tconst {\n\t\tisEditable,\n\t\tpostSlug,\n\t\tviewPostLabel,\n\t\tpostLink,\n\t\tpermalinkPrefix,\n\t\tpermalinkSuffix,\n\t} = useSelect( ( select ) => {\n\t\tconst post = select( editorStore ).getCurrentPost();\n\t\tconst postTypeSlug = select( editorStore ).getCurrentPostType();\n\t\tconst postType = select( coreStore ).getPostType( postTypeSlug );\n\t\tconst permalinkParts = select( editorStore ).getPermalinkParts();\n\t\tconst hasPublishAction = post?._links?.[ 'wp:action-publish' ] ?? false;\n\n\t\treturn {\n\t\t\tisEditable:\n\t\t\t\tselect( editorStore ).isPermalinkEditable() && hasPublishAction,\n\t\t\tpostSlug: safeDecodeURIComponent(\n\t\t\t\tselect( editorStore ).getEditedPostSlug()\n\t\t\t),\n\t\t\tviewPostLabel: postType?.labels.view_item,\n\t\t\tpostLink: post.link,\n\t\t\tpermalinkPrefix: permalinkParts?.prefix,\n\t\t\tpermalinkSuffix: permalinkParts?.suffix,\n\t\t};\n\t}, [] );\n\n\tconst { editPost } = useDispatch( editorStore );\n\n\tconst [ forceEmptyField, setForceEmptyField ] = useState( false );\n\n\treturn (\n\t\t<div className=\"editor-post-url\">\n\t\t\t<InspectorPopoverHeader title={ __( 'URL' ) } onClose={ onClose } />\n\t\t\t{ isEditable && (\n\t\t\t\t<TextControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Permalink' ) }\n\t\t\t\t\tvalue={ forceEmptyField ? '' : postSlug }\n\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\tspellCheck=\"false\"\n\t\t\t\t\thelp={\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{ __( 'The last part of the URL.' ) }{ ' ' }\n\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/page-post-settings-sidebar/#permalink'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Learn more.' ) }\n\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t</>\n\t\t\t\t\t}\n\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\teditPost( { slug: newValue } );\n\t\t\t\t\t\t// When we delete the field the permalink gets\n\t\t\t\t\t\t// reverted to the original value.\n\t\t\t\t\t\t// The forceEmptyField logic allows the user to have\n\t\t\t\t\t\t// the field temporarily empty while typing.\n\t\t\t\t\t\tif ( ! newValue ) {\n\t\t\t\t\t\t\tif ( ! forceEmptyField ) {\n\t\t\t\t\t\t\t\tsetForceEmptyField( true );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( forceEmptyField ) {\n\t\t\t\t\t\t\tsetForceEmptyField( false );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t\tonBlur={ ( event ) => {\n\t\t\t\t\t\teditPost( {\n\t\t\t\t\t\t\tslug: cleanForSlug( event.target.value ),\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tif ( forceEmptyField ) {\n\t\t\t\t\t\t\tsetForceEmptyField( false );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ isEditable && (\n\t\t\t\t<h3 className=\"editor-post-url__link-label\">\n\t\t\t\t\t{ viewPostLabel ?? __( 'View post' ) }\n\t\t\t\t</h3>\n\t\t\t) }\n\t\t\t<p>\n\t\t\t\t<ExternalLink\n\t\t\t\t\tclassName=\"editor-post-url__link\"\n\t\t\t\t\thref={ postLink }\n\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t>\n\t\t\t\t\t{ isEditable ? (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<span className=\"editor-post-url__link-prefix\">\n\t\t\t\t\t\t\t\t{ permalinkPrefix }\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<span className=\"editor-post-url__link-slug\">\n\t\t\t\t\t\t\t\t{ postSlug }\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<span className=\"editor-post-url__link-suffix\">\n\t\t\t\t\t\t\t\t{ permalinkSuffix }\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) : (\n\t\t\t\t\t\tpostLink\n\t\t\t\t\t) }\n\t\t\t\t</ExternalLink>\n\t\t\t</p>\n\t\t</div>\n\t);\n}\n"]}
|
|
@@ -19,11 +19,10 @@ var _store = require("../../store");
|
|
|
19
19
|
/**
|
|
20
20
|
* Internal dependencies
|
|
21
21
|
*/
|
|
22
|
-
function PostVisibilityCheck(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
} = _ref;
|
|
22
|
+
function PostVisibilityCheck({
|
|
23
|
+
hasPublishAction,
|
|
24
|
+
render
|
|
25
|
+
}) {
|
|
27
26
|
const canEdit = hasPublishAction;
|
|
28
27
|
return render({
|
|
29
28
|
canEdit
|
|
@@ -31,14 +30,14 @@ function PostVisibilityCheck(_ref) {
|
|
|
31
30
|
}
|
|
32
31
|
|
|
33
32
|
var _default = (0, _compose.compose)([(0, _data.withSelect)(select => {
|
|
34
|
-
var _getCurrentPost$_link
|
|
33
|
+
var _getCurrentPost$_link;
|
|
35
34
|
|
|
36
35
|
const {
|
|
37
36
|
getCurrentPost,
|
|
38
37
|
getCurrentPostType
|
|
39
38
|
} = select(_store.store);
|
|
40
39
|
return {
|
|
41
|
-
hasPublishAction: (_getCurrentPost$_link =
|
|
40
|
+
hasPublishAction: (_getCurrentPost$_link = getCurrentPost()._links?.['wp:action-publish']) !== null && _getCurrentPost$_link !== void 0 ? _getCurrentPost$_link : false,
|
|
42
41
|
postType: getCurrentPostType()
|
|
43
42
|
};
|
|
44
43
|
})])(PostVisibilityCheck);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/post-visibility/check.js"],"names":["PostVisibilityCheck","hasPublishAction","render","canEdit","select","getCurrentPost","getCurrentPostType","editorStore","_links","postType"],"mappings":";;;;;;;;AAGA;;AACA;;AAKA;;AATA;AACA;AACA;;AAIA;AACA;AACA;AAGO,SAASA,mBAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/post-visibility/check.js"],"names":["PostVisibilityCheck","hasPublishAction","render","canEdit","select","getCurrentPost","getCurrentPostType","editorStore","_links","postType"],"mappings":";;;;;;;;AAGA;;AACA;;AAKA;;AATA;AACA;AACA;;AAIA;AACA;AACA;AAGO,SAASA,mBAAT,CAA8B;AAAEC,EAAAA,gBAAF;AAAoBC,EAAAA;AAApB,CAA9B,EAA6D;AACnE,QAAMC,OAAO,GAAGF,gBAAhB;AACA,SAAOC,MAAM,CAAE;AAAEC,IAAAA;AAAF,GAAF,CAAb;AACA;;eAEc,sBAAS,CACvB,sBAAcC,MAAF,IAAc;AAAA;;AACzB,QAAM;AAAEC,IAAAA,cAAF;AAAkBC,IAAAA;AAAlB,MAAyCF,MAAM,CAAEG,YAAF,CAArD;AACA,SAAO;AACNN,IAAAA,gBAAgB,2BACfI,cAAc,GAAGG,MAAjB,GAA2B,mBAA3B,CADe,yEACqC,KAF/C;AAGNC,IAAAA,QAAQ,EAAEH,kBAAkB;AAHtB,GAAP;AAKA,CAPD,CADuB,CAAT,EASVN,mBATU,C","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"]}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
@@ -9,8 +7,6 @@ exports.default = PostVisibility;
|
|
|
9
7
|
|
|
10
8
|
var _element = require("@wordpress/element");
|
|
11
9
|
|
|
12
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
-
|
|
14
10
|
var _i18n = require("@wordpress/i18n");
|
|
15
11
|
|
|
16
12
|
var _components = require("@wordpress/components");
|
|
@@ -32,10 +28,9 @@ var _store = require("../../store");
|
|
|
32
28
|
/**
|
|
33
29
|
* Internal dependencies
|
|
34
30
|
*/
|
|
35
|
-
function PostVisibility(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
} = _ref;
|
|
31
|
+
function PostVisibility({
|
|
32
|
+
onClose
|
|
33
|
+
}) {
|
|
39
34
|
const instanceId = (0, _compose.useInstanceId)(PostVisibility);
|
|
40
35
|
const {
|
|
41
36
|
status,
|
|
@@ -143,24 +138,24 @@ function PostVisibility(_ref) {
|
|
|
143
138
|
}, (0, _i18n.__)('Would you like to privately publish this post now?')));
|
|
144
139
|
}
|
|
145
140
|
|
|
146
|
-
function PostVisibilityChoice(
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
} = _ref2;
|
|
141
|
+
function PostVisibilityChoice({
|
|
142
|
+
instanceId,
|
|
143
|
+
value,
|
|
144
|
+
label,
|
|
145
|
+
info,
|
|
146
|
+
...props
|
|
147
|
+
}) {
|
|
154
148
|
return (0, _element.createElement)("div", {
|
|
155
149
|
className: "editor-post-visibility__choice"
|
|
156
|
-
}, (0, _element.createElement)("input",
|
|
150
|
+
}, (0, _element.createElement)("input", {
|
|
157
151
|
type: "radio",
|
|
158
152
|
name: `editor-post-visibility__setting-${instanceId}`,
|
|
159
153
|
value: value,
|
|
160
154
|
id: `editor-post-${value}-${instanceId}`,
|
|
161
155
|
"aria-describedby": `editor-post-${value}-${instanceId}-description`,
|
|
162
|
-
className: "editor-post-visibility__radio"
|
|
163
|
-
|
|
156
|
+
className: "editor-post-visibility__radio",
|
|
157
|
+
...props
|
|
158
|
+
}), (0, _element.createElement)("label", {
|
|
164
159
|
htmlFor: `editor-post-${value}-${instanceId}`,
|
|
165
160
|
className: "editor-post-visibility__label"
|
|
166
161
|
}, label), (0, _element.createElement)("p", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/post-visibility/index.js"],"names":["PostVisibility","onClose","instanceId","status","visibility","password","select","editorStore","getEditedPostAttribute","getEditedPostVisibility","editPost","savePost","hasPassword","setHasPassword","showPrivateConfirmDialog","setShowPrivateConfirmDialog","setPublic","setPrivate","confirmPrivate","handleDialogCancel","setPasswordProtected","updatePassword","event","target","value","visibilityOptions","public","label","info","private","PostVisibilityChoice","props"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/post-visibility/index.js"],"names":["PostVisibility","onClose","instanceId","status","visibility","password","select","editorStore","getEditedPostAttribute","getEditedPostVisibility","editPost","savePost","hasPassword","setHasPassword","showPrivateConfirmDialog","setShowPrivateConfirmDialog","setPublic","setPrivate","confirmPrivate","handleDialogCancel","setPasswordProtected","updatePassword","event","target","value","visibilityOptions","public","label","info","private","PostVisibilityChoice","props"],"mappings":";;;;;;;AAIA;;AADA;;AAEA;;AAIA;;AACA;;AACA;;AAKA;;AACA;;AAjBA;AACA;AACA;;AAWA;AACA;AACA;AAIe,SAASA,cAAT,CAAyB;AAAEC,EAAAA;AAAF,CAAzB,EAAuC;AACrD,QAAMC,UAAU,GAAG,4BAAeF,cAAf,CAAnB;AAEA,QAAM;AAAEG,IAAAA,MAAF;AAAUC,IAAAA,UAAV;AAAsBC,IAAAA;AAAtB,MAAmC,qBAAaC,MAAF,KAAgB;AACnEH,IAAAA,MAAM,EAAEG,MAAM,CAAEC,YAAF,CAAN,CAAsB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APN,IADD,EAUC;AACC,IAAA,OAAO,EAAI,eAAeP,KAAO,IAAItB,UAAY,EADlD;AAEC,IAAA,SAAS,EAAC;AAFX,KAIGyB,KAJH,CAVD,EAgBC;AACC,IAAA,EAAE,EAAI,eAAeH,KAAO,IAAItB,UAAY,cAD7C;AAEC,IAAA,SAAS,EAAC;AAFX,KAIG0B,IAJH,CAhBD,CADD;AAyBA","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"]}
|
|
@@ -24,9 +24,7 @@ function PostVisibilityLabel() {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
function usePostVisibilityLabel() {
|
|
27
|
-
var _visibilityOptions$vi;
|
|
28
|
-
|
|
29
27
|
const visibility = (0, _data.useSelect)(select => select(_store.store).getEditedPostVisibility());
|
|
30
|
-
return
|
|
28
|
+
return _utils.visibilityOptions[visibility]?.label;
|
|
31
29
|
}
|
|
32
30
|
//# sourceMappingURL=label.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/post-visibility/label.js"],"names":["PostVisibilityLabel","usePostVisibilityLabel","visibility","select","editorStore","getEditedPostVisibility","visibilityOptions","label"],"mappings":";;;;;;;;AAGA;;AAKA;;AACA;;AATA;AACA;AACA;;AAGA;AACA;AACA;AAIe,SAASA,mBAAT,GAA+B;AAC7C,SAAOC,sBAAsB,EAA7B;AACA;;AAEM,SAASA,sBAAT,GAAkC;
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/post-visibility/label.js"],"names":["PostVisibilityLabel","usePostVisibilityLabel","visibility","select","editorStore","getEditedPostVisibility","visibilityOptions","label"],"mappings":";;;;;;;;AAGA;;AAKA;;AACA;;AATA;AACA;AACA;;AAGA;AACA;AACA;AAIe,SAASA,mBAAT,GAA+B;AAC7C,SAAOC,sBAAsB,EAA7B;AACA;;AAEM,SAASA,sBAAT,GAAkC;AACxC,QAAMC,UAAU,GAAG,qBAAaC,MAAF,IAC7BA,MAAM,CAAEC,YAAF,CAAN,CAAsBC,uBAAtB,EADkB,CAAnB;AAGA,SAAOC,yBAAmBJ,UAAnB,GAAiCK,KAAxC;AACA","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"]}
|
|
@@ -10,8 +10,6 @@ exports.default = exports.ExperimentalEditorProvider = void 0;
|
|
|
10
10
|
|
|
11
11
|
var _element = require("@wordpress/element");
|
|
12
12
|
|
|
13
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
14
|
-
|
|
15
13
|
var _data = require("@wordpress/data");
|
|
16
14
|
|
|
17
15
|
var _i18n = require("@wordpress/i18n");
|
|
@@ -30,7 +28,7 @@ var _store = require("../../store");
|
|
|
30
28
|
|
|
31
29
|
var _useBlockEditorSettings = _interopRequireDefault(require("./use-block-editor-settings"));
|
|
32
30
|
|
|
33
|
-
var _lockUnlock = require("../../
|
|
31
|
+
var _lockUnlock = require("../../lock-unlock");
|
|
34
32
|
|
|
35
33
|
/**
|
|
36
34
|
* WordPress dependencies
|
|
@@ -42,16 +40,15 @@ var _lockUnlock = require("../../lockUnlock");
|
|
|
42
40
|
const {
|
|
43
41
|
ExperimentalBlockEditorProvider
|
|
44
42
|
} = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
|
|
45
|
-
const ExperimentalEditorProvider = (0, _withRegistryProvider.default)(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
} = _ref;
|
|
43
|
+
const ExperimentalEditorProvider = (0, _withRegistryProvider.default)(({
|
|
44
|
+
__unstableTemplate,
|
|
45
|
+
post,
|
|
46
|
+
settings,
|
|
47
|
+
recovery,
|
|
48
|
+
initialEdits,
|
|
49
|
+
children,
|
|
50
|
+
BlockEditorProviderComponent = ExperimentalBlockEditorProvider
|
|
51
|
+
}) => {
|
|
55
52
|
const defaultBlockContext = (0, _element.useMemo)(() => {
|
|
56
53
|
if (post.type === 'wp_template') {
|
|
57
54
|
return {};
|
|
@@ -150,9 +147,9 @@ const ExperimentalEditorProvider = (0, _withRegistryProvider.default)(_ref => {
|
|
|
150
147
|
exports.ExperimentalEditorProvider = ExperimentalEditorProvider;
|
|
151
148
|
|
|
152
149
|
function EditorProvider(props) {
|
|
153
|
-
return (0, _element.createElement)(ExperimentalEditorProvider,
|
|
150
|
+
return (0, _element.createElement)(ExperimentalEditorProvider, { ...props,
|
|
154
151
|
BlockEditorProviderComponent: _blockEditor.BlockEditorProvider
|
|
155
|
-
}
|
|
152
|
+
}, props.children);
|
|
156
153
|
}
|
|
157
154
|
|
|
158
155
|
var _default = EditorProvider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/provider/index.js"],"names":["ExperimentalBlockEditorProvider","blockEditorPrivateApis","ExperimentalEditorProvider","__unstableTemplate","post","settings","recovery","initialEdits","children","BlockEditorProviderComponent","defaultBlockContext","type","postId","id","postType","editorSettings","selection","isReady","select","getEditorSettings","getEditorSelection","__unstableIsEditorReady","editorStore","blocks","onInput","onChange","blockEditorSettings","updatePostLock","setupEditor","updateEditorSettings","__experimentalTearDownEditor","createWarningNotice","noticesStore","postLock","template","autosave","actions","label","url","editLink","EditorProvider","props","BlockEditorProvider"],"mappings":";;;;;;;;;;AAGA
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/provider/index.js"],"names":["ExperimentalBlockEditorProvider","blockEditorPrivateApis","ExperimentalEditorProvider","__unstableTemplate","post","settings","recovery","initialEdits","children","BlockEditorProviderComponent","defaultBlockContext","type","postId","id","postType","editorSettings","selection","isReady","select","getEditorSettings","getEditorSelection","__unstableIsEditorReady","editorStore","blocks","onInput","onChange","blockEditorSettings","updatePostLock","setupEditor","updateEditorSettings","__experimentalTearDownEditor","createWarningNotice","noticesStore","postLock","template","autosave","actions","label","url","editLink","EditorProvider","props","BlockEditorProvider"],"mappings":";;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AArBA;AACA;AACA;;AAaA;AACA;AACA;AAMA,MAAM;AAAEA,EAAAA;AAAF,IAAsC,wBAAQC,wBAAR,CAA5C;AAEO,MAAMC,0BAA0B,GAAG,mCACzC,CAAE;AACDC,EAAAA,kBADC;AAEDC,EAAAA,IAFC;AAGDC,EAAAA,QAHC;AAIDC,EAAAA,QAJC;AAKDC,EAAAA,YALC;AAMDC,EAAAA,QANC;AAODC,EAAAA,4BAA4B,GAAGT;AAP9B,CAAF,KAQO;AACN,QAAMU,mBAAmB,GAAG,sBAAS,MAAM;AAC1C,QAAKN,IAAI,CAACO,IAAL,KAAc,aAAnB,EAAmC;AAClC,aAAO,EAAP;AACA;;AACD,WAAO;AAAEC,MAAAA,MAAM,EAAER,IAAI,CAACS,EAAf;AAAmBC,MAAAA,QAAQ,EAAEV,IAAI,CAACO;AAAlC,KAAP;AACA,GAL2B,EAKzB,CAAEP,IAAI,CAACS,EAAP,EAAWT,IAAI,CAACO,IAAhB,CALyB,CAA5B;AAMA,QAAM;AAAEI,IAAAA,cAAF;AAAkBC,IAAAA,SAAlB;AAA6BC,IAAAA;AAA7B,MAAyC,qBAC5CC,MAAF,IAAc;AACb,UAAM;AACLC,MAAAA,iBADK;AAELC,MAAAA,kBAFK;AAGLC,MAAAA;AAHK,QAIFH,MAAM,CAAEI,YAAF,CAJV;AAKA,WAAO;AACNP,MAAAA,cAAc,EAAEI,iBAAiB,EAD3B;AAENF,MAAAA,OAAO,EAAEI,uBAAuB,EAF1B;AAGNL,MAAAA,SAAS,EAAEI,kBAAkB;AAHvB,KAAP;AAKA,GAZ6C,EAa9C,EAb8C,CAA/C;AAeA,QAAM;AAAEP,IAAAA,EAAF;AAAMF,IAAAA;AAAN,MAAeR,kBAAf,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AD;AAAgB,IAAA,IAAI,EAAC,MAArB;AAA4B,IAAA,IAAI,EAAC;AAAjC,KACC,4BAAC,wBAAD;AACC,IAAA,IAAI,EAAC,UADN;AAEC,IAAA,IAAI,EAAGb,IAAI,CAACO,IAFb;AAGC,IAAA,EAAE,EAAGP,IAAI,CAACS;AAHX,KAKC,4BAAC,iCAAD;AAAsB,IAAA,KAAK,EAAGH;AAA9B,KACC,4BAAC,4BAAD;AACC,IAAA,KAAK,EAAGa,MADT;AAEC,IAAA,QAAQ,EAAGE,QAFZ;AAGC,IAAA,OAAO,EAAGD,OAHX;AAIC,IAAA,SAAS,EAAGR,SAJb;AAKC,IAAA,QAAQ,EAAGU,mBALZ;AAMC,IAAA,cAAc,EAAG;AANlB,KAQGlB,QARH,EASC,4BAAC,uCAAD,OATD,CADD,CALD,CADD,CADD;AAuBA,CAjHwC,CAAnC;;;AAoHA,SAASgC,cAAT,CAAyBC,KAAzB,EAAiC;AACvC,SACC,4BAAC,0BAAD,OACMA,KADN;AAEC,IAAA,4BAA4B,EAAGC;AAFhC,KAIGD,KAAK,CAACjC,QAJT,CADD;AAQA;;eAEcgC,c","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 { ReusableBlocksMenuItems } from '@wordpress/reusable-blocks';\nimport { store as noticesStore } from '@wordpress/notices';\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 );\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<ReusableBlocksMenuItems />\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"]}
|
|
@@ -9,8 +9,6 @@ exports.default = exports.ExperimentalEditorProvider = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _element = require("@wordpress/element");
|
|
11
11
|
|
|
12
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
-
|
|
14
12
|
var _memize = _interopRequireDefault(require("memize"));
|
|
15
13
|
|
|
16
14
|
var _reactNativeSafeAreaContext = require("react-native-safe-area-context");
|
|
@@ -135,12 +133,10 @@ class NativeEditorProvider extends _element.Component {
|
|
|
135
133
|
const insertionIndex = indexAfterSelected || this.props.blockCount;
|
|
136
134
|
this.props.insertBlock(newBlock, insertionIndex);
|
|
137
135
|
});
|
|
138
|
-
this.subscriptionParentUpdateEditorSettings = (0, _reactNativeBridge.subscribeUpdateEditorSettings)(
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
} = _ref;
|
|
143
|
-
|
|
136
|
+
this.subscriptionParentUpdateEditorSettings = (0, _reactNativeBridge.subscribeUpdateEditorSettings)(({
|
|
137
|
+
galleryWithImageBlocks,
|
|
138
|
+
...editorSettings
|
|
139
|
+
}) => {
|
|
144
140
|
if (typeof galleryWithImageBlocks === 'boolean') {
|
|
145
141
|
window.wp.galleryBlockV2Enabled = galleryWithImageBlocks;
|
|
146
142
|
}
|
|
@@ -220,11 +216,10 @@ class NativeEditorProvider extends _element.Component {
|
|
|
220
216
|
}
|
|
221
217
|
}
|
|
222
218
|
|
|
223
|
-
getThemeColors(
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
} = _ref2;
|
|
219
|
+
getThemeColors({
|
|
220
|
+
rawStyles,
|
|
221
|
+
rawFeatures
|
|
222
|
+
}) {
|
|
228
223
|
const {
|
|
229
224
|
defaultEditorColors,
|
|
230
225
|
defaultEditorGradients
|
|
@@ -241,12 +236,9 @@ class NativeEditorProvider extends _element.Component {
|
|
|
241
236
|
if (!prevProps.isReady && this.props.isReady) {
|
|
242
237
|
const blocks = this.props.blocks;
|
|
243
238
|
|
|
244
|
-
const isUnsupportedBlock =
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
} = _ref3;
|
|
248
|
-
return name === (0, _blocks.getUnregisteredTypeHandlerName)();
|
|
249
|
-
};
|
|
239
|
+
const isUnsupportedBlock = ({
|
|
240
|
+
name
|
|
241
|
+
}) => name === (0, _blocks.getUnregisteredTypeHandlerName)();
|
|
250
242
|
|
|
251
243
|
const unsupportedBlockNames = blocks.filter(isUnsupportedBlock).map(block => block.attributes.originalName);
|
|
252
244
|
|
|
@@ -298,9 +290,7 @@ class NativeEditorProvider extends _element.Component {
|
|
|
298
290
|
switchMode
|
|
299
291
|
} = this.props; // Refresh html content first.
|
|
300
292
|
|
|
301
|
-
this.serializeToNativeAction();
|
|
302
|
-
|
|
303
|
-
this.props.clearSelectedBlock();
|
|
293
|
+
this.serializeToNativeAction();
|
|
304
294
|
switchMode(mode === 'visual' ? 'text' : 'visual');
|
|
305
295
|
}
|
|
306
296
|
|
|
@@ -319,10 +309,11 @@ class NativeEditorProvider extends _element.Component {
|
|
|
319
309
|
...props
|
|
320
310
|
} = this.props;
|
|
321
311
|
const editorSettings = this.getEditorSettings(settings, capabilities);
|
|
322
|
-
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_index.default,
|
|
312
|
+
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_index.default, {
|
|
323
313
|
post: this.post,
|
|
324
|
-
settings: editorSettings
|
|
325
|
-
|
|
314
|
+
settings: editorSettings,
|
|
315
|
+
...props
|
|
316
|
+
}, (0, _element.createElement)(_reactNativeSafeAreaContext.SafeAreaProvider, null, children)), (0, _element.createElement)(_editor.EditorHelpTopics, {
|
|
326
317
|
isVisible: this.state.isHelpVisible,
|
|
327
318
|
onClose: () => this.setState({
|
|
328
319
|
isHelpVisible: false
|
|
@@ -330,7 +321,7 @@ class NativeEditorProvider extends _element.Component {
|
|
|
330
321
|
close: () => this.setState({
|
|
331
322
|
isHelpVisible: false
|
|
332
323
|
}),
|
|
333
|
-
showSupport:
|
|
324
|
+
showSupport: capabilities?.supportSection === true
|
|
334
325
|
}));
|
|
335
326
|
}
|
|
336
327
|
|
|
@@ -355,8 +346,8 @@ const ComposedNativeProvider = (0, _compose.compose)([(0, _data.withSelect)(sele
|
|
|
355
346
|
getGlobalBlockCount
|
|
356
347
|
} = select(_blockEditor.store);
|
|
357
348
|
const settings = getEditorSettings();
|
|
358
|
-
const defaultEditorColors = (_settings$colors = settings
|
|
359
|
-
const defaultEditorGradients = (_settings$gradients = settings
|
|
349
|
+
const defaultEditorColors = (_settings$colors = settings?.colors) !== null && _settings$colors !== void 0 ? _settings$colors : [];
|
|
350
|
+
const defaultEditorGradients = (_settings$gradients = settings?.gradients) !== null && _settings$gradients !== void 0 ? _settings$gradients : [];
|
|
360
351
|
const selectedBlockClientId = getSelectedBlockClientId();
|
|
361
352
|
return {
|
|
362
353
|
mode: getEditorMode(),
|
|
@@ -378,7 +369,6 @@ const ComposedNativeProvider = (0, _compose.compose)([(0, _data.withSelect)(sele
|
|
|
378
369
|
} = dispatch(_editor.store);
|
|
379
370
|
const {
|
|
380
371
|
updateSettings,
|
|
381
|
-
clearSelectedBlock,
|
|
382
372
|
insertBlock,
|
|
383
373
|
replaceBlock
|
|
384
374
|
} = dispatch(_blockEditor.store);
|
|
@@ -396,7 +386,6 @@ const ComposedNativeProvider = (0, _compose.compose)([(0, _data.withSelect)(sele
|
|
|
396
386
|
updateBlockEditorSettings: updateSettings,
|
|
397
387
|
updateEditorSettings,
|
|
398
388
|
addEntities,
|
|
399
|
-
clearSelectedBlock,
|
|
400
389
|
insertBlock,
|
|
401
390
|
createSuccessNotice,
|
|
402
391
|
|