@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
|
@@ -28,7 +28,7 @@ var _constants = require("../constants");
|
|
|
28
28
|
* notification should be sent.
|
|
29
29
|
*/
|
|
30
30
|
function getNotificationArgumentsForSaveSuccess(data) {
|
|
31
|
-
var
|
|
31
|
+
var _postType$viewable;
|
|
32
32
|
|
|
33
33
|
const {
|
|
34
34
|
previousPost,
|
|
@@ -36,7 +36,7 @@ function getNotificationArgumentsForSaveSuccess(data) {
|
|
|
36
36
|
postType
|
|
37
37
|
} = data; // Autosaves are neither shown a notice nor redirected.
|
|
38
38
|
|
|
39
|
-
if (
|
|
39
|
+
if (data.options?.isAutosave) {
|
|
40
40
|
return [];
|
|
41
41
|
} // No notice is shown after trashing a post
|
|
42
42
|
|
|
@@ -49,7 +49,7 @@ function getNotificationArgumentsForSaveSuccess(data) {
|
|
|
49
49
|
const isPublished = publishStatus.includes(previousPost.status);
|
|
50
50
|
const willPublish = publishStatus.includes(post.status);
|
|
51
51
|
let noticeMessage;
|
|
52
|
-
let shouldShowLink = (_postType$viewable = postType
|
|
52
|
+
let shouldShowLink = (_postType$viewable = postType?.viewable) !== null && _postType$viewable !== void 0 ? _postType$viewable : false;
|
|
53
53
|
let isDraft; // Always should a notice, which will be spoken for accessibility.
|
|
54
54
|
|
|
55
55
|
if (!isPublished && !willPublish) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/store/utils/notice-builder.js"],"names":["getNotificationArgumentsForSaveSuccess","data","previousPost","post","postType","options","isAutosave","status","publishStatus","isPublished","includes","willPublish","noticeMessage","shouldShowLink","viewable","isDraft","labels","item_reverted_to_draft","publish","item_published","private","item_published_privately","future","item_scheduled","item_updated","actions","push","label","view_item","url","link","id","SAVE_POST_NOTICE_ID","type","getNotificationArgumentsForSaveFail","edits","error","code","indexOf","messages","message","test","join","getNotificationArgumentsForTrashFail","TRASH_POST_NOTICE_ID"],"mappings":";;;;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,sCAAT,CAAiDC,IAAjD,EAAwD;AAAA;;AAC9D,QAAM;AAAEC,IAAAA,YAAF;AAAgBC,IAAAA,IAAhB;AAAsBC,IAAAA;AAAtB,MAAmCH,IAAzC,CAD8D,CAE9D;;AACA,
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/store/utils/notice-builder.js"],"names":["getNotificationArgumentsForSaveSuccess","data","previousPost","post","postType","options","isAutosave","status","publishStatus","isPublished","includes","willPublish","noticeMessage","shouldShowLink","viewable","isDraft","labels","item_reverted_to_draft","publish","item_published","private","item_published_privately","future","item_scheduled","item_updated","actions","push","label","view_item","url","link","id","SAVE_POST_NOTICE_ID","type","getNotificationArgumentsForSaveFail","edits","error","code","indexOf","messages","message","test","join","getNotificationArgumentsForTrashFail","TRASH_POST_NOTICE_ID"],"mappings":";;;;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,sCAAT,CAAiDC,IAAjD,EAAwD;AAAA;;AAC9D,QAAM;AAAEC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C5B,MAA7B,MAA0C,CAAC,CAA5D,GACGgC,QAAQ,CAAEJ,KAAK,CAAC5B,MAAR,CADX,GAEG,cAAI,kBAAJ,CAHJ,CAjB2D,CAsB3D;AACA;;AACA,MAAK6B,KAAK,CAACI,OAAN,IAAiB,CAAE,aAAaC,IAAb,CAAmBL,KAAK,CAACI,OAAzB,CAAxB,EAA6D;AAC5D5B,IAAAA,aAAa,GAAG,CAAEA,aAAF,EAAiBwB,KAAK,CAACI,OAAvB,EAAiCE,IAAjC,CAAuC,GAAvC,CAAhB;AACA;;AACD,SAAO,CACN9B,aADM,EAEN;AACCmB,IAAAA,EAAE,EAAEC;AADL,GAFM,CAAP;AAMA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASW,oCAAT,CAA+C1C,IAA/C,EAAsD;AAC5D,SAAO,CACNA,IAAI,CAACmC,KAAL,CAAWI,OAAX,IAAsBvC,IAAI,CAACmC,KAAL,CAAWC,IAAX,KAAoB,eAA1C,GACGpC,IAAI,CAACmC,KAAL,CAAWI,OADd,GAEG,cAAI,iBAAJ,CAHG,EAIN;AACCT,IAAAA,EAAE,EAAEa;AADL,GAJM,CAAP;AAQA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { SAVE_POST_NOTICE_ID, TRASH_POST_NOTICE_ID } from '../constants';\n\n/**\n * Builds the arguments for a success notification dispatch.\n *\n * @param {Object} data Incoming data to build the arguments from.\n *\n * @return {Array} Arguments for dispatch. An empty array signals no\n * notification should be sent.\n */\nexport function getNotificationArgumentsForSaveSuccess( data ) {\n\tconst { previousPost, post, postType } = data;\n\t// Autosaves are neither shown a notice nor redirected.\n\tif ( data.options?.isAutosave ) {\n\t\treturn [];\n\t}\n\n\t// No notice is shown after trashing a post\n\tif ( post.status === 'trash' && previousPost.status !== 'trash' ) {\n\t\treturn [];\n\t}\n\n\tconst publishStatus = [ 'publish', 'private', 'future' ];\n\tconst isPublished = publishStatus.includes( previousPost.status );\n\tconst willPublish = publishStatus.includes( post.status );\n\n\tlet noticeMessage;\n\tlet shouldShowLink = postType?.viewable ?? false;\n\tlet isDraft;\n\n\t// Always should a notice, which will be spoken for accessibility.\n\tif ( ! isPublished && ! willPublish ) {\n\t\t// If saving a non-published post, don't show notice.\n\t\tnoticeMessage = __( 'Draft saved.' );\n\t\tisDraft = true;\n\t} else if ( isPublished && ! willPublish ) {\n\t\t// If undoing publish status, show specific notice.\n\t\tnoticeMessage = postType.labels.item_reverted_to_draft;\n\t\tshouldShowLink = false;\n\t} else if ( ! isPublished && willPublish ) {\n\t\t// If publishing or scheduling a post, show the corresponding\n\t\t// publish message.\n\t\tnoticeMessage = {\n\t\t\tpublish: postType.labels.item_published,\n\t\t\tprivate: postType.labels.item_published_privately,\n\t\t\tfuture: postType.labels.item_scheduled,\n\t\t}[ post.status ];\n\t} else {\n\t\t// Generic fallback notice.\n\t\tnoticeMessage = postType.labels.item_updated;\n\t}\n\n\tconst actions = [];\n\tif ( shouldShowLink ) {\n\t\tactions.push( {\n\t\t\tlabel: isDraft ? __( 'View Preview' ) : postType.labels.view_item,\n\t\t\turl: post.link,\n\t\t} );\n\t}\n\treturn [\n\t\tnoticeMessage,\n\t\t{\n\t\t\tid: SAVE_POST_NOTICE_ID,\n\t\t\ttype: 'snackbar',\n\t\t\tactions,\n\t\t},\n\t];\n}\n\n/**\n * Builds the fail notification arguments for dispatch.\n *\n * @param {Object} data Incoming data to build the arguments with.\n *\n * @return {Array} Arguments for dispatch. An empty array signals no\n * notification should be sent.\n */\nexport function getNotificationArgumentsForSaveFail( data ) {\n\tconst { post, edits, error } = data;\n\tif ( error && 'rest_autosave_no_changes' === error.code ) {\n\t\t// Autosave requested a new autosave, but there were no changes. This shouldn't\n\t\t// result in an error notice for the user.\n\t\treturn [];\n\t}\n\n\tconst publishStatus = [ 'publish', 'private', 'future' ];\n\tconst isPublished = publishStatus.indexOf( post.status ) !== -1;\n\t// If the post was being published, we show the corresponding publish error message\n\t// Unless we publish an \"updating failed\" message.\n\tconst messages = {\n\t\tpublish: __( 'Publishing failed.' ),\n\t\tprivate: __( 'Publishing failed.' ),\n\t\tfuture: __( 'Scheduling failed.' ),\n\t};\n\tlet noticeMessage =\n\t\t! isPublished && publishStatus.indexOf( edits.status ) !== -1\n\t\t\t? messages[ edits.status ]\n\t\t\t: __( 'Updating failed.' );\n\n\t// Check if message string contains HTML. Notice text is currently only\n\t// supported as plaintext, and stripping the tags may muddle the meaning.\n\tif ( error.message && ! /<\\/?[^>]*>/.test( error.message ) ) {\n\t\tnoticeMessage = [ noticeMessage, error.message ].join( ' ' );\n\t}\n\treturn [\n\t\tnoticeMessage,\n\t\t{\n\t\t\tid: SAVE_POST_NOTICE_ID,\n\t\t},\n\t];\n}\n\n/**\n * Builds the trash fail notification arguments for dispatch.\n *\n * @param {Object} data\n *\n * @return {Array} Arguments for dispatch.\n */\nexport function getNotificationArgumentsForTrashFail( data ) {\n\treturn [\n\t\tdata.error.message && data.error.code !== 'unknown_error'\n\t\t\t? data.error.message\n\t\t\t: __( 'Trashing failed' ),\n\t\t{\n\t\t\tid: TRASH_POST_NOTICE_ID,\n\t\t},\n\t];\n}\n"]}
|
|
@@ -33,15 +33,14 @@ const noop = () => {};
|
|
|
33
33
|
*/
|
|
34
34
|
|
|
35
35
|
|
|
36
|
-
function mediaUpload(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
} = _ref;
|
|
36
|
+
function mediaUpload({
|
|
37
|
+
additionalData = {},
|
|
38
|
+
allowedTypes,
|
|
39
|
+
filesList,
|
|
40
|
+
maxUploadFileSize,
|
|
41
|
+
onError = noop,
|
|
42
|
+
onFileChange
|
|
43
|
+
}) {
|
|
45
44
|
const {
|
|
46
45
|
getCurrentPostId,
|
|
47
46
|
getEditorSettings
|
|
@@ -57,12 +56,9 @@ function mediaUpload(_ref) {
|
|
|
57
56
|
...additionalData
|
|
58
57
|
},
|
|
59
58
|
maxUploadFileSize,
|
|
60
|
-
onError:
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
} = _ref2;
|
|
64
|
-
return onError(message);
|
|
65
|
-
},
|
|
59
|
+
onError: ({
|
|
60
|
+
message
|
|
61
|
+
}) => onError(message),
|
|
66
62
|
wpAllowedMimeTypes
|
|
67
63
|
});
|
|
68
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/utils/media-upload/index.js"],"names":["noop","mediaUpload","additionalData","allowedTypes","filesList","maxUploadFileSize","onError","onFileChange","getCurrentPostId","getEditorSettings","editorStore","wpAllowedMimeTypes","allowedMimeTypes","post","message"],"mappings":";;;;;;;AAGA;;AACA;;AAKA;;AATA;AACA;AACA;;AAIA;AACA;AACA;AAGA,MAAMA,IAAI,GAAG,MAAM,CAAE,CAArB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACe,SAASC,WAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/utils/media-upload/index.js"],"names":["noop","mediaUpload","additionalData","allowedTypes","filesList","maxUploadFileSize","onError","onFileChange","getCurrentPostId","getEditorSettings","editorStore","wpAllowedMimeTypes","allowedMimeTypes","post","message"],"mappings":";;;;;;;AAGA;;AACA;;AAKA;;AATA;AACA;AACA;;AAIA;AACA;AACA;AAGA,MAAMA,IAAI,GAAG,MAAM,CAAE,CAArB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACe,SAASC,WAAT,CAAsB;AACpCC,EAAAA,cAAc,GAAG,EADmB;AAEpCC,EAAAA,YAFoC;AAGpCC,EAAAA,SAHoC;AAIpCC,EAAAA,iBAJoC;AAKpCC,EAAAA,OAAO,GAAGN,IAL0B;AAMpCO,EAAAA;AANoC,CAAtB,EAOX;AACH,QAAM;AAAEC,IAAAA,gBAAF;AAAoBC,IAAAA;AAApB,MAA0C,kBAAQC,YAAR,CAAhD;AACA,QAAMC,kBAAkB,GAAGF,iBAAiB,GAAGG,gBAA/C;AACAP,EAAAA,iBAAiB,GAChBA,iBAAiB,IAAII,iBAAiB,GAAGJ,iBAD1C;AAGA,+BAAa;AACZF,IAAAA,YADY;AAEZC,IAAAA,SAFY;AAGZG,IAAAA,YAHY;AAIZL,IAAAA,cAAc,EAAE;AACfW,MAAAA,IAAI,EAAEL,gBAAgB,EADP;AAEf,SAAGN;AAFY,KAJJ;AAQZG,IAAAA,iBARY;AASZC,IAAAA,OAAO,EAAE,CAAE;AAAEQ,MAAAA;AAAF,KAAF,KAAmBR,OAAO,CAAEQ,OAAF,CATvB;AAUZH,IAAAA;AAVY,GAAb;AAYA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { select } from '@wordpress/data';\nimport { uploadMedia } from '@wordpress/media-utils';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nconst noop = () => {};\n\n/**\n * Upload a media file when the file upload button is activated.\n * Wrapper around mediaUpload() that injects the current post ID.\n *\n * @param {Object} $0 Parameters object passed to the function.\n * @param {?Object} $0.additionalData Additional data to include in the request.\n * @param {string} $0.allowedTypes Array with the types of media that can be uploaded, if unset all types are allowed.\n * @param {Array} $0.filesList List of files.\n * @param {?number} $0.maxUploadFileSize Maximum upload size in bytes allowed for the site.\n * @param {Function} $0.onError Function called when an error happens.\n * @param {Function} $0.onFileChange Function called each time a file or a temporary representation of the file is available.\n */\nexport default function mediaUpload( {\n\tadditionalData = {},\n\tallowedTypes,\n\tfilesList,\n\tmaxUploadFileSize,\n\tonError = noop,\n\tonFileChange,\n} ) {\n\tconst { getCurrentPostId, getEditorSettings } = select( editorStore );\n\tconst wpAllowedMimeTypes = getEditorSettings().allowedMimeTypes;\n\tmaxUploadFileSize =\n\t\tmaxUploadFileSize || getEditorSettings().maxUploadFileSize;\n\n\tuploadMedia( {\n\t\tallowedTypes,\n\t\tfilesList,\n\t\tonFileChange,\n\t\tadditionalData: {\n\t\t\tpost: getCurrentPostId(),\n\t\t\t...additionalData,\n\t\t},\n\t\tmaxUploadFileSize,\n\t\tonError: ( { message } ) => onError( message ),\n\t\twpAllowedMimeTypes,\n\t} );\n}\n"]}
|
package/build/utils/terms.js
CHANGED
|
@@ -28,12 +28,9 @@ function buildTermsTree(flatTerms) {
|
|
|
28
28
|
};
|
|
29
29
|
}); // All terms should have a `parent` because we're about to index them by it.
|
|
30
30
|
|
|
31
|
-
if (flatTermsWithParentAndChildren.some(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
} = _ref;
|
|
35
|
-
return parent === null;
|
|
36
|
-
})) {
|
|
31
|
+
if (flatTermsWithParentAndChildren.some(({
|
|
32
|
+
parent
|
|
33
|
+
}) => parent === null)) {
|
|
37
34
|
return flatTermsWithParentAndChildren;
|
|
38
35
|
}
|
|
39
36
|
|
package/build/utils/terms.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/utils/terms.js"],"names":["buildTermsTree","flatTerms","flatTermsWithParentAndChildren","map","term","children","parent","some","termsByParent","reduce","acc","push","fillWithChildren","terms","id","length","unescapeString","arg","unescapeTerm","name","unescapeTerms"],"mappings":";;;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,cAAT,CAAyBC,SAAzB,EAAqC;AAC3C,QAAMC,8BAA8B,GAAGD,SAAS,CAACE,GAAV,CAAiBC,IAAF,IAAY;AACjE,WAAO;AACNC,MAAAA,QAAQ,EAAE,EADJ;AAENC,MAAAA,MAAM,EAAE,IAFF;AAGN,SAAGF;AAHG,KAAP;AAKA,GANsC,CAAvC,CAD2C,CAS3C;;AACA,MACCF,8BAA8B,CAACK,IAA/B,CAAqC
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/utils/terms.js"],"names":["buildTermsTree","flatTerms","flatTermsWithParentAndChildren","map","term","children","parent","some","termsByParent","reduce","acc","push","fillWithChildren","terms","id","length","unescapeString","arg","unescapeTerm","name","unescapeTerms"],"mappings":";;;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,cAAT,CAAyBC,SAAzB,EAAqC;AAC3C,QAAMC,8BAA8B,GAAGD,SAAS,CAACE,GAAV,CAAiBC,IAAF,IAAY;AACjE,WAAO;AACNC,MAAAA,QAAQ,EAAE,EADJ;AAENC,MAAAA,MAAM,EAAE,IAFF;AAGN,SAAGF;AAHG,KAAP;AAKA,GANsC,CAAvC,CAD2C,CAS3C;;AACA,MACCF,8BAA8B,CAACK,IAA/B,CAAqC,CAAE;AAAED,IAAAA;AAAF,GAAF,KAAkBA,MAAM,KAAK,IAAlE,CADD,EAEE;AACD,WAAOJ,8BAAP;AACA;;AAED,QAAMM,aAAa,GAAGN,8BAA8B,CAACO,MAA/B,CACrB,CAAEC,GAAF,EAAON,IAAP,KAAiB;AAChB,UAAM;AAAEE,MAAAA;AAAF,QAAaF,IAAnB;;AACA,QAAK,CAAEM,GAAG,CAAEJ,MAAF,CAAV,EAAuB;AACtBI,MAAAA,GAAG,CAAEJ,MAAF,CAAH,GAAgB,EAAhB;AACA;;AACDI,IAAAA,GAAG,CAAEJ,MAAF,CAAH,CAAcK,IAAd,CAAoBP,IAApB;AACA,WAAOM,GAAP;AACA,GARoB,EASrB,EATqB,CAAtB;;AAYA,QAAME,gBAAgB,GAAKC,KAAF,IAAa;AACrC,WAAOA,KAAK,CAACV,GAAN,CAAaC,IAAF,IAAY;AAC7B,YAAMC,QAAQ,GAAGG,aAAa,CAAEJ,IAAI,CAACU,EAAP,CAA9B;AACA,aAAO,EACN,GAAGV,IADG;AAENC,QAAAA,QAAQ,EACPA,QAAQ,IAAIA,QAAQ,CAACU,MAArB,GACGH,gBAAgB,CAAEP,QAAF,CADnB,GAEG;AALE,OAAP;AAOA,KATM,CAAP;AAUA,GAXD;;AAaA,SAAOO,gBAAgB,CAAEJ,aAAa,CAAE,GAAF,CAAb,IAAwB,EAA1B,CAAvB;AACA;;AAEM,MAAMQ,cAAc,GAAKC,GAAF,IAAW;AACxC,SAAO,kCAAgBA,GAAhB,CAAP;AACA,CAFM;AAIP;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAMC,YAAY,GAAKd,IAAF,IAAY;AACvC,SAAO,EACN,GAAGA,IADG;AAENe,IAAAA,IAAI,EAAEH,cAAc,CAAEZ,IAAI,CAACe,IAAP;AAFd,GAAP;AAIA,CALM;AAOP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAMC,aAAa,GAAKP,KAAF,IAAa;AACzC,SAAO,CAAEA,KAAF,aAAEA,KAAF,cAAEA,KAAF,GAAW,EAAX,EAAgBV,GAAhB,CAAqBe,YAArB,CAAP;AACA,CAFM","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Returns terms in a tree form.\n *\n * @param {Array} flatTerms Array of terms in flat format.\n *\n * @return {Array} Array of terms in tree format.\n */\nexport function buildTermsTree( flatTerms ) {\n\tconst flatTermsWithParentAndChildren = flatTerms.map( ( term ) => {\n\t\treturn {\n\t\t\tchildren: [],\n\t\t\tparent: null,\n\t\t\t...term,\n\t\t};\n\t} );\n\n\t// All terms should have a `parent` because we're about to index them by it.\n\tif (\n\t\tflatTermsWithParentAndChildren.some( ( { parent } ) => parent === null )\n\t) {\n\t\treturn flatTermsWithParentAndChildren;\n\t}\n\n\tconst termsByParent = flatTermsWithParentAndChildren.reduce(\n\t\t( acc, term ) => {\n\t\t\tconst { parent } = term;\n\t\t\tif ( ! acc[ parent ] ) {\n\t\t\t\tacc[ parent ] = [];\n\t\t\t}\n\t\t\tacc[ parent ].push( term );\n\t\t\treturn acc;\n\t\t},\n\t\t{}\n\t);\n\n\tconst fillWithChildren = ( terms ) => {\n\t\treturn terms.map( ( term ) => {\n\t\t\tconst children = termsByParent[ term.id ];\n\t\t\treturn {\n\t\t\t\t...term,\n\t\t\t\tchildren:\n\t\t\t\t\tchildren && children.length\n\t\t\t\t\t\t? fillWithChildren( children )\n\t\t\t\t\t\t: [],\n\t\t\t};\n\t\t} );\n\t};\n\n\treturn fillWithChildren( termsByParent[ '0' ] || [] );\n}\n\nexport const unescapeString = ( arg ) => {\n\treturn decodeEntities( arg );\n};\n\n/**\n * Returns a term object with name unescaped.\n *\n * @param {Object} term The term object to unescape.\n *\n * @return {Object} Term object with name property unescaped.\n */\nexport const unescapeTerm = ( term ) => {\n\treturn {\n\t\t...term,\n\t\tname: unescapeString( term.name ),\n\t};\n};\n\n/**\n * Returns an array of term objects with names unescaped.\n * The unescape of each term is performed using the unescapeTerm function.\n *\n * @param {Object[]} terms Array of term objects to unescape.\n *\n * @return {Object[]} Array of term objects unescaped.\n */\nexport const unescapeTerms = ( terms ) => {\n\treturn ( terms ?? [] ).map( unescapeTerm );\n};\n"]}
|
|
@@ -67,8 +67,7 @@ export class AutosaveMonitor extends Component {
|
|
|
67
67
|
clearTimeout(this.timerId);
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
setAutosaveTimer() {
|
|
71
|
-
let timeout = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props.interval * 1000;
|
|
70
|
+
setAutosaveTimer(timeout = this.props.interval * 1000) {
|
|
72
71
|
this.timerId = setTimeout(() => {
|
|
73
72
|
this.autosaveTimerHandler();
|
|
74
73
|
}, timeout);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/autosave-monitor/index.js"],"names":["Component","compose","withSelect","withDispatch","store","coreStore","editorStore","AutosaveMonitor","constructor","props","needsAutosave","isDirty","isAutosaveable","componentDidMount","disableIntervalChecks","setAutosaveTimer","componentDidUpdate","prevProps","editsReference","autosave","interval","clearTimeout","timerId","isAutosaving","componentWillUnmount","timeout","setTimeout","autosaveTimerHandler","render","select","ownProps","getReferenceByDistinctEdits","isEditedPostDirty","isEditedPostAutosaveable","isAutosavingPost","getEditorSettings","autosaveInterval","dispatch"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,oBAA1B;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,UAAT,EAAqBC,YAArB,QAAyC,iBAAzC;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;;AACA,SAASD,KAAK,IAAIE,WAAlB,QAAqC,aAArC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,eAAN,SAA8BP,SAA9B,CAAwC;AAC9CQ,EAAAA,WAAW,CAAEC,KAAF,EAAU;AACpB,UAAOA,KAAP;AACA,SAAKC,aAAL,GAAqB,CAAC,EAAID,KAAK,CAACE,OAAN,IAAiBF,KAAK,CAACG,cAA3B,CAAtB;AACA;;AAEDC,EAAAA,iBAAiB,GAAG;AACnB,QAAK,CAAE,KAAKJ,KAAL,CAAWK,qBAAlB,EAA0C;AACzC,WAAKC,gBAAL;AACA;AACD;;AAEDC,EAAAA,kBAAkB,CAAEC,SAAF,EAAc;AAC/B,QAAK,KAAKR,KAAL,CAAWK,qBAAhB,EAAwC;AACvC,UAAK,KAAKL,KAAL,CAAWS,cAAX,KAA8BD,SAAS,CAACC,cAA7C,EAA8D;AAC7D,aAAKT,KAAL,CAAWU,QAAX;AACA;;AACD;AACA;;AAED,QAAK,KAAKV,KAAL,CAAWW,QAAX,KAAwBH,SAAS,CAACG,QAAvC,EAAkD;AACjDC,MAAAA,YAAY,CAAE,KAAKC,OAAP,CAAZ;AACA,WAAKP,gBAAL;AACA;;AAED,QAAK,CAAE,KAAKN,KAAL,CAAWE,OAAlB,EAA4B;AAC3B,WAAKD,aAAL,GAAqB,KAArB;AACA;AACA;;AAED,QAAK,KAAKD,KAAL,CAAWc,YAAX,IAA2B,CAAEN,SAAS,CAACM,YAA5C,EAA2D;AAC1D,WAAKb,aAAL,GAAqB,KAArB;AACA;AACA;;AAED,QAAK,KAAKD,KAAL,CAAWS,cAAX,KAA8BD,SAAS,CAACC,cAA7C,EAA8D;AAC7D,WAAKR,aAAL,GAAqB,IAArB;AACA;AACD;;AAEDc,EAAAA,oBAAoB,GAAG;AACtBH,IAAAA,YAAY,CAAE,KAAKC,OAAP,CAAZ;AACA;;AAEDP,EAAAA,gBAAgB,
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/autosave-monitor/index.js"],"names":["Component","compose","withSelect","withDispatch","store","coreStore","editorStore","AutosaveMonitor","constructor","props","needsAutosave","isDirty","isAutosaveable","componentDidMount","disableIntervalChecks","setAutosaveTimer","componentDidUpdate","prevProps","editsReference","autosave","interval","clearTimeout","timerId","isAutosaving","componentWillUnmount","timeout","setTimeout","autosaveTimerHandler","render","select","ownProps","getReferenceByDistinctEdits","isEditedPostDirty","isEditedPostAutosaveable","isAutosavingPost","getEditorSettings","autosaveInterval","dispatch"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,oBAA1B;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,UAAT,EAAqBC,YAArB,QAAyC,iBAAzC;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;;AACA,SAASD,KAAK,IAAIE,WAAlB,QAAqC,aAArC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,eAAN,SAA8BP,SAA9B,CAAwC;AAC9CQ,EAAAA,WAAW,CAAEC,KAAF,EAAU;AACpB,UAAOA,KAAP;AACA,SAAKC,aAAL,GAAqB,CAAC,EAAID,KAAK,CAACE,OAAN,IAAiBF,KAAK,CAACG,cAA3B,CAAtB;AACA;;AAEDC,EAAAA,iBAAiB,GAAG;AACnB,QAAK,CAAE,KAAKJ,KAAL,CAAWK,qBAAlB,EAA0C;AACzC,WAAKC,gBAAL;AACA;AACD;;AAEDC,EAAAA,kBAA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,GAAG;AACR,WAAO,IAAP;AACA;;AAlE6C;AAqE/C,eAAe3B,OAAO,CAAE,CACvBC,UAAU,CAAE,CAAE2B,MAAF,EAAUC,QAAV,KAAwB;AACnC,QAAM;AAAEC,IAAAA;AAAF,MAAkCF,MAAM,CAAExB,SAAF,CAA9C;AAEA,QAAM;AACL2B,IAAAA,iBADK;AAELC,IAAAA,wBAFK;AAGLC,IAAAA,gBAHK;AAILC,IAAAA;AAJK,MAKFN,MAAM,CAAEvB,WAAF,CALV;AAOA,QAAM;AAAEc,IAAAA,QAAQ,GAAGe,iBAAiB,GAAGC;AAAjC,MAAsDN,QAA5D;AAEA,SAAO;AACNZ,IAAAA,cAAc,EAAEa,2BAA2B,EADrC;AAENpB,IAAAA,OAAO,EAAEqB,iBAAiB,EAFpB;AAGNpB,IAAAA,cAAc,EAAEqB,wBAAwB,EAHlC;AAINV,IAAAA,YAAY,EAAEW,gBAAgB,EAJxB;AAKNd,IAAAA;AALM,GAAP;AAOA,CAnBS,CADa,EAqBvBjB,YAAY,CAAE,CAAEkC,QAAF,EAAYP,QAAZ,MAA4B;AACzCX,EAAAA,QAAQ,GAAG;AACV,UAAM;AAAEA,MAAAA,QAAQ,GAAGkB,QAAQ,CAAE/B,WAAF,CAAR,CAAwBa;AAArC,QAAkDW,QAAxD;AACAX,IAAAA,QAAQ;AACR;;AAJwC,CAA5B,CAAF,CArBW,CAAF,CAAP,CA2BVZ,eA3BU,CAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { compose } from '@wordpress/compose';\nimport { withSelect, withDispatch } 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 * AutosaveMonitor invokes `props.autosave()` within at most `interval` seconds after an unsaved change is detected.\n *\n * The logic is straightforward: a check is performed every `props.interval` seconds. If any changes are detected, `props.autosave()` is called.\n * The time between the change and the autosave varies but is no larger than `props.interval` seconds. Refer to the code below for more details, such as\n * the specific way of detecting changes.\n *\n * There are two caveats:\n * * If `props.isAutosaveable` happens to be false at a time of checking for changes, the check is retried every second.\n * * The timer may be disabled by setting `props.disableIntervalChecks` to `true`. In that mode, any change will immediately trigger `props.autosave()`.\n */\nexport class AutosaveMonitor extends Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\t\tthis.needsAutosave = !! ( props.isDirty && props.isAutosaveable );\n\t}\n\n\tcomponentDidMount() {\n\t\tif ( ! this.props.disableIntervalChecks ) {\n\t\t\tthis.setAutosaveTimer();\n\t\t}\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( this.props.disableIntervalChecks ) {\n\t\t\tif ( this.props.editsReference !== prevProps.editsReference ) {\n\t\t\t\tthis.props.autosave();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.props.interval !== prevProps.interval ) {\n\t\t\tclearTimeout( this.timerId );\n\t\t\tthis.setAutosaveTimer();\n\t\t}\n\n\t\tif ( ! this.props.isDirty ) {\n\t\t\tthis.needsAutosave = false;\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.props.isAutosaving && ! prevProps.isAutosaving ) {\n\t\t\tthis.needsAutosave = false;\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.props.editsReference !== prevProps.editsReference ) {\n\t\t\tthis.needsAutosave = true;\n\t\t}\n\t}\n\n\tcomponentWillUnmount() {\n\t\tclearTimeout( this.timerId );\n\t}\n\n\tsetAutosaveTimer( timeout = this.props.interval * 1000 ) {\n\t\tthis.timerId = setTimeout( () => {\n\t\t\tthis.autosaveTimerHandler();\n\t\t}, timeout );\n\t}\n\n\tautosaveTimerHandler() {\n\t\tif ( ! this.props.isAutosaveable ) {\n\t\t\tthis.setAutosaveTimer( 1000 );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.needsAutosave ) {\n\t\t\tthis.needsAutosave = false;\n\t\t\tthis.props.autosave();\n\t\t}\n\n\t\tthis.setAutosaveTimer();\n\t}\n\n\trender() {\n\t\treturn null;\n\t}\n}\n\nexport default compose( [\n\twithSelect( ( select, ownProps ) => {\n\t\tconst { getReferenceByDistinctEdits } = select( coreStore );\n\n\t\tconst {\n\t\t\tisEditedPostDirty,\n\t\t\tisEditedPostAutosaveable,\n\t\t\tisAutosavingPost,\n\t\t\tgetEditorSettings,\n\t\t} = select( editorStore );\n\n\t\tconst { interval = getEditorSettings().autosaveInterval } = ownProps;\n\n\t\treturn {\n\t\t\teditsReference: getReferenceByDistinctEdits(),\n\t\t\tisDirty: isEditedPostDirty(),\n\t\t\tisAutosaveable: isEditedPostAutosaveable(),\n\t\t\tisAutosaving: isAutosavingPost(),\n\t\t\tinterval,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch, ownProps ) => ( {\n\t\tautosave() {\n\t\t\tconst { autosave = dispatch( editorStore ).autosave } = ownProps;\n\t\t\tautosave();\n\t\t},\n\t} ) ),\n] )( AutosaveMonitor );\n"]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
1
|
import { createElement } from "@wordpress/element";
|
|
3
2
|
// Block Creation Components.
|
|
4
3
|
|
|
@@ -10,17 +9,17 @@ import { forwardRef } from '@wordpress/element';
|
|
|
10
9
|
import { Autocomplete as RootAutocomplete, AlignmentToolbar as RootAlignmentToolbar, BlockAlignmentToolbar as RootBlockAlignmentToolbar, BlockControls as RootBlockControls, BlockEdit as RootBlockEdit, BlockEditorKeyboardShortcuts as RootBlockEditorKeyboardShortcuts, BlockFormatControls as RootBlockFormatControls, BlockIcon as RootBlockIcon, BlockInspector as RootBlockInspector, BlockList as RootBlockList, BlockMover as RootBlockMover, BlockNavigationDropdown as RootBlockNavigationDropdown, BlockSelectionClearer as RootBlockSelectionClearer, BlockSettingsMenu as RootBlockSettingsMenu, BlockTitle as RootBlockTitle, BlockToolbar as RootBlockToolbar, ColorPalette as RootColorPalette, ContrastChecker as RootContrastChecker, CopyHandler as RootCopyHandler, createCustomColorsHOC as rootCreateCustomColorsHOC, DefaultBlockAppender as RootDefaultBlockAppender, FontSizePicker as RootFontSizePicker, getColorClassName as rootGetColorClassName, getColorObjectByAttributeValues as rootGetColorObjectByAttributeValues, getColorObjectByColorValue as rootGetColorObjectByColorValue, getFontSize as rootGetFontSize, getFontSizeClass as rootGetFontSizeClass, Inserter as RootInserter, InnerBlocks as RootInnerBlocks, InspectorAdvancedControls as RootInspectorAdvancedControls, InspectorControls as RootInspectorControls, PanelColorSettings as RootPanelColorSettings, PlainText as RootPlainText, RichText as RootRichText, RichTextShortcut as RootRichTextShortcut, RichTextToolbarButton as RootRichTextToolbarButton, __unstableRichTextInputEvent as __unstableRootRichTextInputEvent, MediaPlaceholder as RootMediaPlaceholder, MediaUpload as RootMediaUpload, MediaUploadCheck as RootMediaUploadCheck, MultiSelectScrollIntoView as RootMultiSelectScrollIntoView, NavigableToolbar as RootNavigableToolbar, ObserveTyping as RootObserveTyping, SkipToSelectedBlock as RootSkipToSelectedBlock, URLInput as RootURLInput, URLInputButton as RootURLInputButton, URLPopover as RootURLPopover, Warning as RootWarning, WritingFlow as RootWritingFlow, withColorContext as rootWithColorContext, withColors as rootWithColors, withFontSizes as rootWithFontSizes } from '@wordpress/block-editor';
|
|
11
10
|
export { default as ServerSideRender } from '@wordpress/server-side-render';
|
|
12
11
|
|
|
13
|
-
function deprecateComponent(name, Wrapped) {
|
|
14
|
-
let staticsToHoist = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
12
|
+
function deprecateComponent(name, Wrapped, staticsToHoist = []) {
|
|
15
13
|
const Component = forwardRef((props, ref) => {
|
|
16
14
|
deprecated('wp.editor.' + name, {
|
|
17
15
|
since: '5.3',
|
|
18
16
|
alternative: 'wp.blockEditor.' + name,
|
|
19
17
|
version: '6.2'
|
|
20
18
|
});
|
|
21
|
-
return createElement(Wrapped,
|
|
22
|
-
ref: ref
|
|
23
|
-
|
|
19
|
+
return createElement(Wrapped, {
|
|
20
|
+
ref: ref,
|
|
21
|
+
...props
|
|
22
|
+
});
|
|
24
23
|
});
|
|
25
24
|
staticsToHoist.forEach(staticName => {
|
|
26
25
|
Component[staticName] = deprecateComponent(name + '.' + staticName, Wrapped[staticName]);
|
|
@@ -29,13 +28,13 @@ function deprecateComponent(name, Wrapped) {
|
|
|
29
28
|
}
|
|
30
29
|
|
|
31
30
|
function deprecateFunction(name, func) {
|
|
32
|
-
return
|
|
31
|
+
return (...args) => {
|
|
33
32
|
deprecated('wp.editor.' + name, {
|
|
34
33
|
since: '5.3',
|
|
35
34
|
alternative: 'wp.blockEditor.' + name,
|
|
36
35
|
version: '6.2'
|
|
37
36
|
});
|
|
38
|
-
return func(...
|
|
37
|
+
return func(...args);
|
|
39
38
|
};
|
|
40
39
|
}
|
|
41
40
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/deprecated.js"],"names":["deprecated","forwardRef","Autocomplete","RootAutocomplete","AlignmentToolbar","RootAlignmentToolbar","BlockAlignmentToolbar","RootBlockAlignmentToolbar","BlockControls","RootBlockControls","BlockEdit","RootBlockEdit","BlockEditorKeyboardShortcuts","RootBlockEditorKeyboardShortcuts","BlockFormatControls","RootBlockFormatControls","BlockIcon","RootBlockIcon","BlockInspector","RootBlockInspector","BlockList","RootBlockList","BlockMover","RootBlockMover","BlockNavigationDropdown","RootBlockNavigationDropdown","BlockSelectionClearer","RootBlockSelectionClearer","BlockSettingsMenu","RootBlockSettingsMenu","BlockTitle","RootBlockTitle","BlockToolbar","RootBlockToolbar","ColorPalette","RootColorPalette","ContrastChecker","RootContrastChecker","CopyHandler","RootCopyHandler","createCustomColorsHOC","rootCreateCustomColorsHOC","DefaultBlockAppender","RootDefaultBlockAppender","FontSizePicker","RootFontSizePicker","getColorClassName","rootGetColorClassName","getColorObjectByAttributeValues","rootGetColorObjectByAttributeValues","getColorObjectByColorValue","rootGetColorObjectByColorValue","getFontSize","rootGetFontSize","getFontSizeClass","rootGetFontSizeClass","Inserter","RootInserter","InnerBlocks","RootInnerBlocks","InspectorAdvancedControls","RootInspectorAdvancedControls","InspectorControls","RootInspectorControls","PanelColorSettings","RootPanelColorSettings","PlainText","RootPlainText","RichText","RootRichText","RichTextShortcut","RootRichTextShortcut","RichTextToolbarButton","RootRichTextToolbarButton","__unstableRichTextInputEvent","__unstableRootRichTextInputEvent","MediaPlaceholder","RootMediaPlaceholder","MediaUpload","RootMediaUpload","MediaUploadCheck","RootMediaUploadCheck","MultiSelectScrollIntoView","RootMultiSelectScrollIntoView","NavigableToolbar","RootNavigableToolbar","ObserveTyping","RootObserveTyping","SkipToSelectedBlock","RootSkipToSelectedBlock","URLInput","RootURLInput","URLInputButton","RootURLInputButton","URLPopover","RootURLPopover","Warning","RootWarning","WritingFlow","RootWritingFlow","withColorContext","rootWithColorContext","withColors","rootWithColors","withFontSizes","rootWithFontSizes","default","ServerSideRender","deprecateComponent","name","Wrapped","staticsToHoist","Component","props","ref","since","alternative","version","forEach","staticName","deprecateFunction","func","isEmpty"],"mappings":";;AAAA;;AACA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,uBAAvB;AACA,SAASC,UAAT,QAA2B,oBAA3B;AACA,SACCC,YAAY,IAAIC,gBADjB,EAECC,gBAAgB,IAAIC,oBAFrB,EAGCC,qBAAqB,IAAIC,yBAH1B,EAICC,aAAa,IAAIC,iBAJlB,EAKCC,SAAS,IAAIC,aALd,EAMCC,4BAA4B,IAAIC,gCANjC,EAOCC,mBAAmB,IAAIC,uBAPxB,EAQCC,SAAS,IAAIC,aARd,EASCC,cAAc,IAAIC,kBATnB,EAUCC,SAAS,IAAIC,aAVd,EAWCC,UAAU,IAAIC,cAXf,EAYCC,uBAAuB,IAAIC,2BAZ5B,EAaCC,qBAAqB,IAAIC,yBAb1B,EAcCC,iBAAiB,IAAIC,qBAdtB,EAeCC,UAAU,IAAIC,cAff,EAgBCC,YAAY,IAAIC,gBAhBjB,EAiBCC,YAAY,IAAIC,gBAjB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,MAAMC,0BAA0B,GAAGsE,iBAAiB,CAC1D,4BAD0D,EAE1DrE,8BAF0D,CAApD;AAIP,OAAO,MAAMC,WAAW,GAAGoE,iBAAiB,CAAE,aAAF,EAAiBnE,eAAjB,CAArC;AACP,OAAO,MAAMC,gBAAgB,GAAGkE,iBAAiB,CAChD,kBADgD,EAEhDjE,oBAFgD,CAA1C;AAIP,OAAO,MAAM6C,gBAAgB,GAAGoB,iBAAiB,CAChD,kBADgD,EAEhDnB,oBAFgD,CAA1C;AAIP,OAAO,MAAMC,UAAU,GAAGkB,iBAAiB,CAAE,YAAF,EAAgBjB,cAAhB,CAApC;AACP,OAAO,MAAMC,aAAa,GAAGgB,iBAAiB,CAC7C,eAD6C,EAE7Cf,iBAF6C,CAAvC","sourcesContent":["// Block Creation Components.\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { forwardRef } from '@wordpress/element';\nimport {\n\tAutocomplete as RootAutocomplete,\n\tAlignmentToolbar as RootAlignmentToolbar,\n\tBlockAlignmentToolbar as RootBlockAlignmentToolbar,\n\tBlockControls as RootBlockControls,\n\tBlockEdit as RootBlockEdit,\n\tBlockEditorKeyboardShortcuts as RootBlockEditorKeyboardShortcuts,\n\tBlockFormatControls as RootBlockFormatControls,\n\tBlockIcon as RootBlockIcon,\n\tBlockInspector as RootBlockInspector,\n\tBlockList as RootBlockList,\n\tBlockMover as RootBlockMover,\n\tBlockNavigationDropdown as RootBlockNavigationDropdown,\n\tBlockSelectionClearer as RootBlockSelectionClearer,\n\tBlockSettingsMenu as RootBlockSettingsMenu,\n\tBlockTitle as RootBlockTitle,\n\tBlockToolbar as RootBlockToolbar,\n\tColorPalette as RootColorPalette,\n\tContrastChecker as RootContrastChecker,\n\tCopyHandler as RootCopyHandler,\n\tcreateCustomColorsHOC as rootCreateCustomColorsHOC,\n\tDefaultBlockAppender as RootDefaultBlockAppender,\n\tFontSizePicker as RootFontSizePicker,\n\tgetColorClassName as rootGetColorClassName,\n\tgetColorObjectByAttributeValues as rootGetColorObjectByAttributeValues,\n\tgetColorObjectByColorValue as rootGetColorObjectByColorValue,\n\tgetFontSize as rootGetFontSize,\n\tgetFontSizeClass as rootGetFontSizeClass,\n\tInserter as RootInserter,\n\tInnerBlocks as RootInnerBlocks,\n\tInspectorAdvancedControls as RootInspectorAdvancedControls,\n\tInspectorControls as RootInspectorControls,\n\tPanelColorSettings as RootPanelColorSettings,\n\tPlainText as RootPlainText,\n\tRichText as RootRichText,\n\tRichTextShortcut as RootRichTextShortcut,\n\tRichTextToolbarButton as RootRichTextToolbarButton,\n\t__unstableRichTextInputEvent as __unstableRootRichTextInputEvent,\n\tMediaPlaceholder as RootMediaPlaceholder,\n\tMediaUpload as RootMediaUpload,\n\tMediaUploadCheck as RootMediaUploadCheck,\n\tMultiSelectScrollIntoView as RootMultiSelectScrollIntoView,\n\tNavigableToolbar as RootNavigableToolbar,\n\tObserveTyping as RootObserveTyping,\n\tSkipToSelectedBlock as RootSkipToSelectedBlock,\n\tURLInput as RootURLInput,\n\tURLInputButton as RootURLInputButton,\n\tURLPopover as RootURLPopover,\n\tWarning as RootWarning,\n\tWritingFlow as RootWritingFlow,\n\twithColorContext as rootWithColorContext,\n\twithColors as rootWithColors,\n\twithFontSizes as rootWithFontSizes,\n} from '@wordpress/block-editor';\n\nexport { default as ServerSideRender } from '@wordpress/server-side-render';\n\nfunction deprecateComponent( name, Wrapped, staticsToHoist = [] ) {\n\tconst Component = forwardRef( ( props, ref ) => {\n\t\tdeprecated( 'wp.editor.' + name, {\n\t\t\tsince: '5.3',\n\t\t\talternative: 'wp.blockEditor.' + name,\n\t\t\tversion: '6.2',\n\t\t} );\n\n\t\treturn <Wrapped ref={ ref } { ...props } />;\n\t} );\n\n\tstaticsToHoist.forEach( ( staticName ) => {\n\t\tComponent[ staticName ] = deprecateComponent(\n\t\t\tname + '.' + staticName,\n\t\t\tWrapped[ staticName ]\n\t\t);\n\t} );\n\n\treturn Component;\n}\n\nfunction deprecateFunction( name, func ) {\n\treturn ( ...args ) => {\n\t\tdeprecated( 'wp.editor.' + name, {\n\t\t\tsince: '5.3',\n\t\t\talternative: 'wp.blockEditor.' + name,\n\t\t\tversion: '6.2',\n\t\t} );\n\n\t\treturn func( ...args );\n\t};\n}\n\nconst RichText = deprecateComponent( 'RichText', RootRichText, [ 'Content' ] );\nRichText.isEmpty = deprecateFunction(\n\t'RichText.isEmpty',\n\tRootRichText.isEmpty\n);\n\nexport { RichText };\nexport const Autocomplete = deprecateComponent(\n\t'Autocomplete',\n\tRootAutocomplete\n);\nexport const AlignmentToolbar = deprecateComponent(\n\t'AlignmentToolbar',\n\tRootAlignmentToolbar\n);\nexport const BlockAlignmentToolbar = deprecateComponent(\n\t'BlockAlignmentToolbar',\n\tRootBlockAlignmentToolbar\n);\nexport const BlockControls = deprecateComponent(\n\t'BlockControls',\n\tRootBlockControls,\n\t[ 'Slot' ]\n);\nexport const BlockEdit = deprecateComponent( 'BlockEdit', RootBlockEdit );\nexport const BlockEditorKeyboardShortcuts = deprecateComponent(\n\t'BlockEditorKeyboardShortcuts',\n\tRootBlockEditorKeyboardShortcuts\n);\nexport const BlockFormatControls = deprecateComponent(\n\t'BlockFormatControls',\n\tRootBlockFormatControls,\n\t[ 'Slot' ]\n);\nexport const BlockIcon = deprecateComponent( 'BlockIcon', RootBlockIcon );\nexport const BlockInspector = deprecateComponent(\n\t'BlockInspector',\n\tRootBlockInspector\n);\nexport const BlockList = deprecateComponent( 'BlockList', RootBlockList );\nexport const BlockMover = deprecateComponent( 'BlockMover', RootBlockMover );\nexport const BlockNavigationDropdown = deprecateComponent(\n\t'BlockNavigationDropdown',\n\tRootBlockNavigationDropdown\n);\nexport const BlockSelectionClearer = deprecateComponent(\n\t'BlockSelectionClearer',\n\tRootBlockSelectionClearer\n);\nexport const BlockSettingsMenu = deprecateComponent(\n\t'BlockSettingsMenu',\n\tRootBlockSettingsMenu\n);\nexport const BlockTitle = deprecateComponent( 'BlockTitle', RootBlockTitle );\nexport const BlockToolbar = deprecateComponent(\n\t'BlockToolbar',\n\tRootBlockToolbar\n);\nexport const ColorPalette = deprecateComponent(\n\t'ColorPalette',\n\tRootColorPalette\n);\nexport const ContrastChecker = deprecateComponent(\n\t'ContrastChecker',\n\tRootContrastChecker\n);\nexport const CopyHandler = deprecateComponent( 'CopyHandler', RootCopyHandler );\nexport const DefaultBlockAppender = deprecateComponent(\n\t'DefaultBlockAppender',\n\tRootDefaultBlockAppender\n);\nexport const FontSizePicker = deprecateComponent(\n\t'FontSizePicker',\n\tRootFontSizePicker\n);\nexport const Inserter = deprecateComponent( 'Inserter', RootInserter );\nexport const InnerBlocks = deprecateComponent( 'InnerBlocks', RootInnerBlocks, [\n\t'ButtonBlockAppender',\n\t'DefaultBlockAppender',\n\t'Content',\n] );\nexport const InspectorAdvancedControls = deprecateComponent(\n\t'InspectorAdvancedControls',\n\tRootInspectorAdvancedControls,\n\t[ 'Slot' ]\n);\nexport const InspectorControls = deprecateComponent(\n\t'InspectorControls',\n\tRootInspectorControls,\n\t[ 'Slot' ]\n);\nexport const PanelColorSettings = deprecateComponent(\n\t'PanelColorSettings',\n\tRootPanelColorSettings\n);\nexport const PlainText = deprecateComponent( 'PlainText', RootPlainText );\nexport const RichTextShortcut = deprecateComponent(\n\t'RichTextShortcut',\n\tRootRichTextShortcut\n);\nexport const RichTextToolbarButton = deprecateComponent(\n\t'RichTextToolbarButton',\n\tRootRichTextToolbarButton\n);\nexport const __unstableRichTextInputEvent = deprecateComponent(\n\t'__unstableRichTextInputEvent',\n\t__unstableRootRichTextInputEvent\n);\nexport const MediaPlaceholder = deprecateComponent(\n\t'MediaPlaceholder',\n\tRootMediaPlaceholder\n);\nexport const MediaUpload = deprecateComponent( 'MediaUpload', RootMediaUpload );\nexport const MediaUploadCheck = deprecateComponent(\n\t'MediaUploadCheck',\n\tRootMediaUploadCheck\n);\nexport const MultiSelectScrollIntoView = deprecateComponent(\n\t'MultiSelectScrollIntoView',\n\tRootMultiSelectScrollIntoView\n);\nexport const NavigableToolbar = deprecateComponent(\n\t'NavigableToolbar',\n\tRootNavigableToolbar\n);\nexport const ObserveTyping = deprecateComponent(\n\t'ObserveTyping',\n\tRootObserveTyping\n);\nexport const SkipToSelectedBlock = deprecateComponent(\n\t'SkipToSelectedBlock',\n\tRootSkipToSelectedBlock\n);\nexport const URLInput = deprecateComponent( 'URLInput', RootURLInput );\nexport const URLInputButton = deprecateComponent(\n\t'URLInputButton',\n\tRootURLInputButton\n);\nexport const URLPopover = deprecateComponent( 'URLPopover', RootURLPopover );\nexport const Warning = deprecateComponent( 'Warning', RootWarning );\nexport const WritingFlow = deprecateComponent( 'WritingFlow', RootWritingFlow );\n\nexport const createCustomColorsHOC = deprecateFunction(\n\t'createCustomColorsHOC',\n\trootCreateCustomColorsHOC\n);\nexport const getColorClassName = deprecateFunction(\n\t'getColorClassName',\n\trootGetColorClassName\n);\nexport const getColorObjectByAttributeValues = deprecateFunction(\n\t'getColorObjectByAttributeValues',\n\trootGetColorObjectByAttributeValues\n);\nexport const getColorObjectByColorValue = deprecateFunction(\n\t'getColorObjectByColorValue',\n\trootGetColorObjectByColorValue\n);\nexport const getFontSize = deprecateFunction( 'getFontSize', rootGetFontSize );\nexport const getFontSizeClass = deprecateFunction(\n\t'getFontSizeClass',\n\trootGetFontSizeClass\n);\nexport const withColorContext = deprecateFunction(\n\t'withColorContext',\n\trootWithColorContext\n);\nexport const withColors = deprecateFunction( 'withColors', rootWithColors );\nexport const withFontSizes = deprecateFunction(\n\t'withFontSizes',\n\trootWithFontSizes\n);\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/deprecated.js"],"names":["deprecated","forwardRef","Autocomplete","RootAutocomplete","AlignmentToolbar","RootAlignmentToolbar","BlockAlignmentToolbar","RootBlockAlignmentToolbar","BlockControls","RootBlockControls","BlockEdit","RootBlockEdit","BlockEditorKeyboardShortcuts","RootBlockEditorKeyboardShortcuts","BlockFormatControls","RootBlockFormatControls","BlockIcon","RootBlockIcon","BlockInspector","RootBlockInspector","BlockList","RootBlockList","BlockMover","RootBlockMover","BlockNavigationDropdown","RootBlockNavigationDropdown","BlockSelectionClearer","RootBlockSelectionClearer","BlockSettingsMenu","RootBlockSettingsMenu","BlockTitle","RootBlockTitle","BlockToolbar","RootBlockToolbar","ColorPalette","RootColorPalette","ContrastChecker","RootContrastChecker","CopyHandler","RootCopyHandler","createCustomColorsHOC","rootCreateCustomColorsHOC","DefaultBlockAppender","RootDefaultBlockAppender","FontSizePicker","RootFontSizePicker","getColorClassName","rootGetColorClassName","getColorObjectByAttributeValues","rootGetColorObjectByAttributeValues","getColorObjectByColorValue","rootGetColorObjectByColorValue","getFontSize","rootGetFontSize","getFontSizeClass","rootGetFontSizeClass","Inserter","RootInserter","InnerBlocks","RootInnerBlocks","InspectorAdvancedControls","RootInspectorAdvancedControls","InspectorControls","RootInspectorControls","PanelColorSettings","RootPanelColorSettings","PlainText","RootPlainText","RichText","RootRichText","RichTextShortcut","RootRichTextShortcut","RichTextToolbarButton","RootRichTextToolbarButton","__unstableRichTextInputEvent","__unstableRootRichTextInputEvent","MediaPlaceholder","RootMediaPlaceholder","MediaUpload","RootMediaUpload","MediaUploadCheck","RootMediaUploadCheck","MultiSelectScrollIntoView","RootMultiSelectScrollIntoView","NavigableToolbar","RootNavigableToolbar","ObserveTyping","RootObserveTyping","SkipToSelectedBlock","RootSkipToSelectedBlock","URLInput","RootURLInput","URLInputButton","RootURLInputButton","URLPopover","RootURLPopover","Warning","RootWarning","WritingFlow","RootWritingFlow","withColorContext","rootWithColorContext","withColors","rootWithColors","withFontSizes","rootWithFontSizes","default","ServerSideRender","deprecateComponent","name","Wrapped","staticsToHoist","Component","props","ref","since","alternative","version","forEach","staticName","deprecateFunction","func","args","isEmpty"],"mappings":";AAAA;;AACA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,uBAAvB;AACA,SAASC,UAAT,QAA2B,oBAA3B;AACA,SACCC,YAAY,IAAIC,gBADjB,EAECC,gBA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AO,MAAMC,UAAU,GAAGc,kBAAkB,CAAE,YAAF,EAAgBb,cAAhB,CAArC;AACP,OAAO,MAAMC,OAAO,GAAGY,kBAAkB,CAAE,SAAF,EAAaX,WAAb,CAAlC;AACP,OAAO,MAAMC,WAAW,GAAGU,kBAAkB,CAAE,aAAF,EAAiBT,eAAjB,CAAtC;AAEP,OAAO,MAAM3D,qBAAqB,GAAGgF,iBAAiB,CACrD,uBADqD,EAErD/E,yBAFqD,CAA/C;AAIP,OAAO,MAAMK,iBAAiB,GAAG0E,iBAAiB,CACjD,mBADiD,EAEjDzE,qBAFiD,CAA3C;AAIP,OAAO,MAAMC,+BAA+B,GAAGwE,iBAAiB,CAC/D,iCAD+D,EAE/DvE,mCAF+D,CAAzD;AAIP,OAAO,MAAMC,0BAA0B,GAAGsE,iBAAiB,CAC1D,4BAD0D,EAE1DrE,8BAF0D,CAApD;AAIP,OAAO,MAAMC,WAAW,GAAGoE,iBAAiB,CAAE,aAAF,EAAiBnE,eAAjB,CAArC;AACP,OAAO,MAAMC,gBAAgB,GAAGkE,iBAAiB,CAChD,kBADgD,EAEhDjE,oBAFgD,CAA1C;AAIP,OAAO,MAAM6C,gBAAgB,GAAGoB,iBAAiB,CAChD,kBADgD,EAEhDnB,oBAFgD,CAA1C;AAIP,OAAO,MAAMC,UAAU,GAAGkB,iBAAiB,CAAE,YAAF,EAAgBjB,cAAhB,CAApC;AACP,OAAO,MAAMC,aAAa,GAAGgB,iBAAiB,CAC7C,eAD6C,EAE7Cf,iBAF6C,CAAvC","sourcesContent":["// Block Creation Components.\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { forwardRef } from '@wordpress/element';\nimport {\n\tAutocomplete as RootAutocomplete,\n\tAlignmentToolbar as RootAlignmentToolbar,\n\tBlockAlignmentToolbar as RootBlockAlignmentToolbar,\n\tBlockControls as RootBlockControls,\n\tBlockEdit as RootBlockEdit,\n\tBlockEditorKeyboardShortcuts as RootBlockEditorKeyboardShortcuts,\n\tBlockFormatControls as RootBlockFormatControls,\n\tBlockIcon as RootBlockIcon,\n\tBlockInspector as RootBlockInspector,\n\tBlockList as RootBlockList,\n\tBlockMover as RootBlockMover,\n\tBlockNavigationDropdown as RootBlockNavigationDropdown,\n\tBlockSelectionClearer as RootBlockSelectionClearer,\n\tBlockSettingsMenu as RootBlockSettingsMenu,\n\tBlockTitle as RootBlockTitle,\n\tBlockToolbar as RootBlockToolbar,\n\tColorPalette as RootColorPalette,\n\tContrastChecker as RootContrastChecker,\n\tCopyHandler as RootCopyHandler,\n\tcreateCustomColorsHOC as rootCreateCustomColorsHOC,\n\tDefaultBlockAppender as RootDefaultBlockAppender,\n\tFontSizePicker as RootFontSizePicker,\n\tgetColorClassName as rootGetColorClassName,\n\tgetColorObjectByAttributeValues as rootGetColorObjectByAttributeValues,\n\tgetColorObjectByColorValue as rootGetColorObjectByColorValue,\n\tgetFontSize as rootGetFontSize,\n\tgetFontSizeClass as rootGetFontSizeClass,\n\tInserter as RootInserter,\n\tInnerBlocks as RootInnerBlocks,\n\tInspectorAdvancedControls as RootInspectorAdvancedControls,\n\tInspectorControls as RootInspectorControls,\n\tPanelColorSettings as RootPanelColorSettings,\n\tPlainText as RootPlainText,\n\tRichText as RootRichText,\n\tRichTextShortcut as RootRichTextShortcut,\n\tRichTextToolbarButton as RootRichTextToolbarButton,\n\t__unstableRichTextInputEvent as __unstableRootRichTextInputEvent,\n\tMediaPlaceholder as RootMediaPlaceholder,\n\tMediaUpload as RootMediaUpload,\n\tMediaUploadCheck as RootMediaUploadCheck,\n\tMultiSelectScrollIntoView as RootMultiSelectScrollIntoView,\n\tNavigableToolbar as RootNavigableToolbar,\n\tObserveTyping as RootObserveTyping,\n\tSkipToSelectedBlock as RootSkipToSelectedBlock,\n\tURLInput as RootURLInput,\n\tURLInputButton as RootURLInputButton,\n\tURLPopover as RootURLPopover,\n\tWarning as RootWarning,\n\tWritingFlow as RootWritingFlow,\n\twithColorContext as rootWithColorContext,\n\twithColors as rootWithColors,\n\twithFontSizes as rootWithFontSizes,\n} from '@wordpress/block-editor';\n\nexport { default as ServerSideRender } from '@wordpress/server-side-render';\n\nfunction deprecateComponent( name, Wrapped, staticsToHoist = [] ) {\n\tconst Component = forwardRef( ( props, ref ) => {\n\t\tdeprecated( 'wp.editor.' + name, {\n\t\t\tsince: '5.3',\n\t\t\talternative: 'wp.blockEditor.' + name,\n\t\t\tversion: '6.2',\n\t\t} );\n\n\t\treturn <Wrapped ref={ ref } { ...props } />;\n\t} );\n\n\tstaticsToHoist.forEach( ( staticName ) => {\n\t\tComponent[ staticName ] = deprecateComponent(\n\t\t\tname + '.' + staticName,\n\t\t\tWrapped[ staticName ]\n\t\t);\n\t} );\n\n\treturn Component;\n}\n\nfunction deprecateFunction( name, func ) {\n\treturn ( ...args ) => {\n\t\tdeprecated( 'wp.editor.' + name, {\n\t\t\tsince: '5.3',\n\t\t\talternative: 'wp.blockEditor.' + name,\n\t\t\tversion: '6.2',\n\t\t} );\n\n\t\treturn func( ...args );\n\t};\n}\n\nconst RichText = deprecateComponent( 'RichText', RootRichText, [ 'Content' ] );\nRichText.isEmpty = deprecateFunction(\n\t'RichText.isEmpty',\n\tRootRichText.isEmpty\n);\n\nexport { RichText };\nexport const Autocomplete = deprecateComponent(\n\t'Autocomplete',\n\tRootAutocomplete\n);\nexport const AlignmentToolbar = deprecateComponent(\n\t'AlignmentToolbar',\n\tRootAlignmentToolbar\n);\nexport const BlockAlignmentToolbar = deprecateComponent(\n\t'BlockAlignmentToolbar',\n\tRootBlockAlignmentToolbar\n);\nexport const BlockControls = deprecateComponent(\n\t'BlockControls',\n\tRootBlockControls,\n\t[ 'Slot' ]\n);\nexport const BlockEdit = deprecateComponent( 'BlockEdit', RootBlockEdit );\nexport const BlockEditorKeyboardShortcuts = deprecateComponent(\n\t'BlockEditorKeyboardShortcuts',\n\tRootBlockEditorKeyboardShortcuts\n);\nexport const BlockFormatControls = deprecateComponent(\n\t'BlockFormatControls',\n\tRootBlockFormatControls,\n\t[ 'Slot' ]\n);\nexport const BlockIcon = deprecateComponent( 'BlockIcon', RootBlockIcon );\nexport const BlockInspector = deprecateComponent(\n\t'BlockInspector',\n\tRootBlockInspector\n);\nexport const BlockList = deprecateComponent( 'BlockList', RootBlockList );\nexport const BlockMover = deprecateComponent( 'BlockMover', RootBlockMover );\nexport const BlockNavigationDropdown = deprecateComponent(\n\t'BlockNavigationDropdown',\n\tRootBlockNavigationDropdown\n);\nexport const BlockSelectionClearer = deprecateComponent(\n\t'BlockSelectionClearer',\n\tRootBlockSelectionClearer\n);\nexport const BlockSettingsMenu = deprecateComponent(\n\t'BlockSettingsMenu',\n\tRootBlockSettingsMenu\n);\nexport const BlockTitle = deprecateComponent( 'BlockTitle', RootBlockTitle );\nexport const BlockToolbar = deprecateComponent(\n\t'BlockToolbar',\n\tRootBlockToolbar\n);\nexport const ColorPalette = deprecateComponent(\n\t'ColorPalette',\n\tRootColorPalette\n);\nexport const ContrastChecker = deprecateComponent(\n\t'ContrastChecker',\n\tRootContrastChecker\n);\nexport const CopyHandler = deprecateComponent( 'CopyHandler', RootCopyHandler );\nexport const DefaultBlockAppender = deprecateComponent(\n\t'DefaultBlockAppender',\n\tRootDefaultBlockAppender\n);\nexport const FontSizePicker = deprecateComponent(\n\t'FontSizePicker',\n\tRootFontSizePicker\n);\nexport const Inserter = deprecateComponent( 'Inserter', RootInserter );\nexport const InnerBlocks = deprecateComponent( 'InnerBlocks', RootInnerBlocks, [\n\t'ButtonBlockAppender',\n\t'DefaultBlockAppender',\n\t'Content',\n] );\nexport const InspectorAdvancedControls = deprecateComponent(\n\t'InspectorAdvancedControls',\n\tRootInspectorAdvancedControls,\n\t[ 'Slot' ]\n);\nexport const InspectorControls = deprecateComponent(\n\t'InspectorControls',\n\tRootInspectorControls,\n\t[ 'Slot' ]\n);\nexport const PanelColorSettings = deprecateComponent(\n\t'PanelColorSettings',\n\tRootPanelColorSettings\n);\nexport const PlainText = deprecateComponent( 'PlainText', RootPlainText );\nexport const RichTextShortcut = deprecateComponent(\n\t'RichTextShortcut',\n\tRootRichTextShortcut\n);\nexport const RichTextToolbarButton = deprecateComponent(\n\t'RichTextToolbarButton',\n\tRootRichTextToolbarButton\n);\nexport const __unstableRichTextInputEvent = deprecateComponent(\n\t'__unstableRichTextInputEvent',\n\t__unstableRootRichTextInputEvent\n);\nexport const MediaPlaceholder = deprecateComponent(\n\t'MediaPlaceholder',\n\tRootMediaPlaceholder\n);\nexport const MediaUpload = deprecateComponent( 'MediaUpload', RootMediaUpload );\nexport const MediaUploadCheck = deprecateComponent(\n\t'MediaUploadCheck',\n\tRootMediaUploadCheck\n);\nexport const MultiSelectScrollIntoView = deprecateComponent(\n\t'MultiSelectScrollIntoView',\n\tRootMultiSelectScrollIntoView\n);\nexport const NavigableToolbar = deprecateComponent(\n\t'NavigableToolbar',\n\tRootNavigableToolbar\n);\nexport const ObserveTyping = deprecateComponent(\n\t'ObserveTyping',\n\tRootObserveTyping\n);\nexport const SkipToSelectedBlock = deprecateComponent(\n\t'SkipToSelectedBlock',\n\tRootSkipToSelectedBlock\n);\nexport const URLInput = deprecateComponent( 'URLInput', RootURLInput );\nexport const URLInputButton = deprecateComponent(\n\t'URLInputButton',\n\tRootURLInputButton\n);\nexport const URLPopover = deprecateComponent( 'URLPopover', RootURLPopover );\nexport const Warning = deprecateComponent( 'Warning', RootWarning );\nexport const WritingFlow = deprecateComponent( 'WritingFlow', RootWritingFlow );\n\nexport const createCustomColorsHOC = deprecateFunction(\n\t'createCustomColorsHOC',\n\trootCreateCustomColorsHOC\n);\nexport const getColorClassName = deprecateFunction(\n\t'getColorClassName',\n\trootGetColorClassName\n);\nexport const getColorObjectByAttributeValues = deprecateFunction(\n\t'getColorObjectByAttributeValues',\n\trootGetColorObjectByAttributeValues\n);\nexport const getColorObjectByColorValue = deprecateFunction(\n\t'getColorObjectByColorValue',\n\trootGetColorObjectByColorValue\n);\nexport const getFontSize = deprecateFunction( 'getFontSize', rootGetFontSize );\nexport const getFontSizeClass = deprecateFunction(\n\t'getFontSizeClass',\n\trootGetFontSizeClass\n);\nexport const withColorContext = deprecateFunction(\n\t'withColorContext',\n\trootWithColorContext\n);\nexport const withColors = deprecateFunction( 'withColors', rootWithColors );\nexport const withFontSizes = deprecateFunction(\n\t'withFontSizes',\n\trootWithFontSizes\n);\n"]}
|
|
@@ -4,11 +4,10 @@
|
|
|
4
4
|
import { withSelect } from '@wordpress/data';
|
|
5
5
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
6
6
|
|
|
7
|
-
function DocumentOutlineCheck(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
} = _ref;
|
|
7
|
+
function DocumentOutlineCheck({
|
|
8
|
+
blocks,
|
|
9
|
+
children
|
|
10
|
+
}) {
|
|
12
11
|
const headings = blocks.filter(block => block.name === 'core/heading');
|
|
13
12
|
|
|
14
13
|
if (headings.length < 1) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/document-outline/check.js"],"names":["withSelect","store","blockEditorStore","DocumentOutlineCheck","blocks","children","headings","filter","block","name","length","select","getBlocks"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAT,QAA2B,iBAA3B;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,yBAA1C;;AAEA,SAASC,oBAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/document-outline/check.js"],"names":["withSelect","store","blockEditorStore","DocumentOutlineCheck","blocks","children","headings","filter","block","name","length","select","getBlocks"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAT,QAA2B,iBAA3B;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,yBAA1C;;AAEA,SAASC,oBAAT,CAA+B;AAAEC,EAAAA,MAAF;AAAUC,EAAAA;AAAV,CAA/B,EAAsD;AACrD,QAAMC,QAAQ,GAAGF,MAAM,CAACG,MAAP,CACdC,KAAF,IAAaA,KAAK,CAACC,IAAN,KAAe,cADZ,CAAjB;;AAIA,MAAKH,QAAQ,CAACI,MAAT,GAAkB,CAAvB,EAA2B;AAC1B,WAAO,IAAP;AACA;;AAED,SAAOL,QAAP;AACA;;AAED,eAAeL,UAAU,CAAIW,MAAF,KAAgB;AAC1CP,EAAAA,MAAM,EAAEO,MAAM,CAAET,gBAAF,CAAN,CAA2BU,SAA3B;AADkC,CAAhB,CAAF,CAAV,CAERT,oBAFQ,CAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { withSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\nfunction DocumentOutlineCheck( { blocks, children } ) {\n\tconst headings = blocks.filter(\n\t\t( block ) => block.name === 'core/heading'\n\t);\n\n\tif ( headings.length < 1 ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n\nexport default withSelect( ( select ) => ( {\n\tblocks: select( blockEditorStore ).getBlocks(),\n} ) )( DocumentOutlineCheck );\n"]}
|
|
@@ -45,11 +45,8 @@ const multipleH1Headings = [createElement("br", {
|
|
|
45
45
|
* @return {Array} An array of heading blocks enhanced with the properties described above.
|
|
46
46
|
*/
|
|
47
47
|
|
|
48
|
-
const computeOutlineHeadings =
|
|
49
|
-
|
|
50
|
-
return blocks.flatMap(function () {
|
|
51
|
-
let block = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
52
|
-
|
|
48
|
+
const computeOutlineHeadings = (blocks = []) => {
|
|
49
|
+
return blocks.flatMap((block = {}) => {
|
|
53
50
|
if (block.name === 'core/heading') {
|
|
54
51
|
return { ...block,
|
|
55
52
|
level: block.attributes.level,
|
|
@@ -63,14 +60,13 @@ const computeOutlineHeadings = function () {
|
|
|
63
60
|
|
|
64
61
|
const isEmptyHeading = heading => !heading.attributes.content || heading.attributes.content.length === 0;
|
|
65
62
|
|
|
66
|
-
export const DocumentOutline =
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
} = _ref;
|
|
63
|
+
export const DocumentOutline = ({
|
|
64
|
+
blocks = [],
|
|
65
|
+
title,
|
|
66
|
+
onSelect,
|
|
67
|
+
isTitleSupported,
|
|
68
|
+
hasOutlineItemsDisabled
|
|
69
|
+
}) => {
|
|
74
70
|
const headings = computeOutlineHeadings(blocks);
|
|
75
71
|
const {
|
|
76
72
|
selectBlock
|
|
@@ -110,7 +106,7 @@ export const DocumentOutline = _ref => {
|
|
|
110
106
|
href: `#block-${item.clientId}`,
|
|
111
107
|
onSelect: () => {
|
|
112
108
|
selectBlock(item.clientId);
|
|
113
|
-
onSelect
|
|
109
|
+
onSelect?.();
|
|
114
110
|
}
|
|
115
111
|
}, item.isEmpty ? emptyHeadingContent : getTextContent(create({
|
|
116
112
|
html: item.attributes.content
|
|
@@ -118,7 +114,7 @@ export const DocumentOutline = _ref => {
|
|
|
118
114
|
})));
|
|
119
115
|
};
|
|
120
116
|
export default compose(withSelect(select => {
|
|
121
|
-
var _postType$supports$ti
|
|
117
|
+
var _postType$supports$ti;
|
|
122
118
|
|
|
123
119
|
const {
|
|
124
120
|
getBlocks
|
|
@@ -133,7 +129,7 @@ export default compose(withSelect(select => {
|
|
|
133
129
|
return {
|
|
134
130
|
title: getEditedPostAttribute('title'),
|
|
135
131
|
blocks: getBlocks(),
|
|
136
|
-
isTitleSupported: (_postType$supports$ti = postType
|
|
132
|
+
isTitleSupported: (_postType$supports$ti = postType?.supports?.title) !== null && _postType$supports$ti !== void 0 ? _postType$supports$ti : false
|
|
137
133
|
};
|
|
138
134
|
}))(DocumentOutline);
|
|
139
135
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/document-outline/index.js"],"names":["__","compose","withSelect","useDispatch","create","getTextContent","store","blockEditorStore","coreStore","DocumentOutlineItem","editorStore","emptyHeadingContent","incorrectLevelContent","singleH1Headings","multipleH1Headings","computeOutlineHeadings","blocks","flatMap","block","name","level","attributes","isEmpty","isEmptyHeading","innerBlocks","heading","content","length","DocumentOutline","title","onSelect","isTitleSupported","hasOutlineItemsDisabled","headings","selectBlock","prevHeadingLevel","titleNode","document","querySelector","hasTitle","countByLevel","reduce","acc","hasMultipleH1","id","map","item","index","isIncorrectLevel","isValid","clientId","html","select","getBlocks","getEditedPostAttribute","getPostType","postType","supports"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,UAAT,EAAqBC,WAArB,QAAwC,iBAAxC;AACA,SAASC,MAAT,EAAiBC,cAAjB,QAAuC,sBAAvC;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,yBAA1C;AACA,SAASD,KAAK,IAAIE,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;;AACA,OAAOC,mBAAP,MAAgC,QAAhC;AACA,SAASH,KAAK,IAAII,WAAlB,QAAqC,aAArC;AAEA;AACA;AACA;;AACA,MAAMC,mBAAmB,GAAG,0BAAMX,EAAE,CAAE,iBAAF,CAAR,CAA5B;AACA,MAAMY,qBAAqB,GAAG,CAC7B;AAAI,EAAA,GAAG,EAAC;AAAR,EAD6B,EAE7B;AAAI,EAAA,GAAG,EAAC;AAAR,GAA8BZ,EAAE,CAAE,2BAAF,CAAhC,CAF6B,CAA9B;AAIA,MAAMa,gBAAgB,GAAG,CACxB;AAAI,EAAA,GAAG,EAAC;AAAR,EADwB,EAExB;AAAI,EAAA,GAAG,EAAC;AAAR,GACGb,EAAE,CAAE,sDAAF,CADL,CAFwB,CAAzB;AAMA,MAAMc,kBAAkB,GAAG,CAC1B;AAAI,EAAA,GAAG,EAAC;AAAR,EAD0B,EAE1B;AAAI,EAAA,GAAG,EAAC;AAAR,GACGd,EAAE,CAAE,4CAAF,CADL,CAF0B,CAA3B;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMe,sBAAsB,GAAG,
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/document-outline/index.js"],"names":["__","compose","withSelect","useDispatch","create","getTextContent","store","blockEditorStore","coreStore","DocumentOutlineItem","editorStore","emptyHeadingContent","incorrectLevelContent","singleH1Headings","multipleH1Headings","computeOutlineHeadings","blocks","flatMap","block","name","level","attributes","isEmpty","isEmptyHeading","innerBlocks","heading","content","length","DocumentOutline","title","onSelect","isTitleSupported","hasOutlineItemsDisabled","headings","selectBlock","prevHeadingLevel","titleNode","document","querySelector","hasTitle","countByLevel","reduce","acc","hasMultipleH1","id","map","item","index","isIncorrectLevel","isValid","clientId","html","select","getBlocks","getEditedPostAttribute","getPostType","postType","supports"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,UAAT,EAAqBC,WAArB,QAAwC,iBAAxC;AACA,SAASC,MAAT,EAAiBC,cAAjB,QAAuC,sBAAvC;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,yBAA1C;AACA,SAASD,KAAK,IAAIE,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;;AACA,OAAOC,mBAAP,MAAgC,QAAhC;AACA,SAASH,KAAK,IAAII,WAAlB,QAAqC,aAArC;AAEA;AACA;AACA;;AACA,MAAMC,mBAAmB,GAAG,0BAAMX,EAAE,CAAE,iBAAF,CAAR,CAA5B;AACA,MAAMY,qBAAqB,GAAG,CAC7B;AAAI,EAAA,GAAG,EAAC;AAAR,EAD6B,EAE7B;AAAI,EAAA,GAAG,EAAC;AAAR,GAA8BZ,EAAE,CAAE,2BAAF,CAAhC,CAF6B,CAA9B;AAIA,MAAMa,gBAAgB,GAAG,CACxB;AAAI,EAAA,GAAG,EAAC;AAAR,EADwB,EAExB;AAAI,EAAA,GAAG,EAAC;AAAR,GACGb,EAAE,CAAE,sDAAF,CADL,CAFwB,CAAzB;AAMA,MAAMc,kBAAkB,GAAG,CAC1B;AAAI,EAAA,GA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@wordpress/compose';\nimport { withSelect, useDispatch } from '@wordpress/data';\nimport { create, getTextContent } from '@wordpress/rich-text';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport DocumentOutlineItem from './item';\nimport { store as editorStore } from '../../store';\n\n/**\n * Module constants\n */\nconst emptyHeadingContent = <em>{ __( '(Empty heading)' ) }</em>;\nconst incorrectLevelContent = [\n\t<br key=\"incorrect-break\" />,\n\t<em key=\"incorrect-message\">{ __( '(Incorrect heading level)' ) }</em>,\n];\nconst singleH1Headings = [\n\t<br key=\"incorrect-break-h1\" />,\n\t<em key=\"incorrect-message-h1\">\n\t\t{ __( '(Your theme may already use a H1 for the post title)' ) }\n\t</em>,\n];\nconst multipleH1Headings = [\n\t<br key=\"incorrect-break-multiple-h1\" />,\n\t<em key=\"incorrect-message-multiple-h1\">\n\t\t{ __( '(Multiple H1 headings are not recommended)' ) }\n\t</em>,\n];\n\n/**\n * Returns an array of heading blocks enhanced with the following properties:\n * level - An integer with the heading level.\n * isEmpty - Flag indicating if the heading has no content.\n *\n * @param {?Array} blocks An array of blocks.\n *\n * @return {Array} An array of heading blocks enhanced with the properties described above.\n */\nconst computeOutlineHeadings = ( blocks = [] ) => {\n\treturn blocks.flatMap( ( block = {} ) => {\n\t\tif ( block.name === 'core/heading' ) {\n\t\t\treturn {\n\t\t\t\t...block,\n\t\t\t\tlevel: block.attributes.level,\n\t\t\t\tisEmpty: isEmptyHeading( block ),\n\t\t\t};\n\t\t}\n\t\treturn computeOutlineHeadings( block.innerBlocks );\n\t} );\n};\n\nconst isEmptyHeading = ( heading ) =>\n\t! heading.attributes.content || heading.attributes.content.length === 0;\n\nexport const DocumentOutline = ( {\n\tblocks = [],\n\ttitle,\n\tonSelect,\n\tisTitleSupported,\n\thasOutlineItemsDisabled,\n} ) => {\n\tconst headings = computeOutlineHeadings( blocks );\n\tconst { selectBlock } = useDispatch( blockEditorStore );\n\tif ( headings.length < 1 ) {\n\t\treturn null;\n\t}\n\n\tlet prevHeadingLevel = 1;\n\n\t// Not great but it's the simplest way to locate the title right now.\n\tconst titleNode = document.querySelector( '.editor-post-title__input' );\n\tconst hasTitle = isTitleSupported && title && titleNode;\n\tconst countByLevel = headings.reduce(\n\t\t( acc, heading ) => ( {\n\t\t\t...acc,\n\t\t\t[ heading.level ]: ( acc[ heading.level ] || 0 ) + 1,\n\t\t} ),\n\t\t{}\n\t);\n\tconst hasMultipleH1 = countByLevel[ 1 ] > 1;\n\n\treturn (\n\t\t<div className=\"document-outline\">\n\t\t\t<ul>\n\t\t\t\t{ hasTitle && (\n\t\t\t\t\t<DocumentOutlineItem\n\t\t\t\t\t\tlevel={ __( 'Title' ) }\n\t\t\t\t\t\tisValid\n\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\thref={ `#${ titleNode.id }` }\n\t\t\t\t\t\tisDisabled={ hasOutlineItemsDisabled }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ title }\n\t\t\t\t\t</DocumentOutlineItem>\n\t\t\t\t) }\n\t\t\t\t{ headings.map( ( item, index ) => {\n\t\t\t\t\t// Headings remain the same, go up by one, or down by any amount.\n\t\t\t\t\t// Otherwise there are missing levels.\n\t\t\t\t\tconst isIncorrectLevel = item.level > prevHeadingLevel + 1;\n\n\t\t\t\t\tconst isValid =\n\t\t\t\t\t\t! item.isEmpty &&\n\t\t\t\t\t\t! isIncorrectLevel &&\n\t\t\t\t\t\t!! item.level &&\n\t\t\t\t\t\t( item.level !== 1 ||\n\t\t\t\t\t\t\t( ! hasMultipleH1 && ! hasTitle ) );\n\t\t\t\t\tprevHeadingLevel = item.level;\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<DocumentOutlineItem\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\tlevel={ `H${ item.level }` }\n\t\t\t\t\t\t\tisValid={ isValid }\n\t\t\t\t\t\t\tisDisabled={ hasOutlineItemsDisabled }\n\t\t\t\t\t\t\thref={ `#block-${ item.clientId }` }\n\t\t\t\t\t\t\tonSelect={ () => {\n\t\t\t\t\t\t\t\tselectBlock( item.clientId );\n\t\t\t\t\t\t\t\tonSelect?.();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ item.isEmpty\n\t\t\t\t\t\t\t\t? emptyHeadingContent\n\t\t\t\t\t\t\t\t: getTextContent(\n\t\t\t\t\t\t\t\t\t\tcreate( {\n\t\t\t\t\t\t\t\t\t\t\thtml: item.attributes.content,\n\t\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t ) }\n\t\t\t\t\t\t\t{ isIncorrectLevel && incorrectLevelContent }\n\t\t\t\t\t\t\t{ item.level === 1 &&\n\t\t\t\t\t\t\t\thasMultipleH1 &&\n\t\t\t\t\t\t\t\tmultipleH1Headings }\n\t\t\t\t\t\t\t{ hasTitle &&\n\t\t\t\t\t\t\t\titem.level === 1 &&\n\t\t\t\t\t\t\t\t! hasMultipleH1 &&\n\t\t\t\t\t\t\t\tsingleH1Headings }\n\t\t\t\t\t\t</DocumentOutlineItem>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</ul>\n\t\t</div>\n\t);\n};\n\nexport default compose(\n\twithSelect( ( select ) => {\n\t\tconst { getBlocks } = select( blockEditorStore );\n\t\tconst { getEditedPostAttribute } = select( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\t\tconst postType = getPostType( getEditedPostAttribute( 'type' ) );\n\n\t\treturn {\n\t\t\ttitle: getEditedPostAttribute( 'title' ),\n\t\t\tblocks: getBlocks(),\n\t\t\tisTitleSupported: postType?.supports?.title ?? false,\n\t\t};\n\t} )\n)( DocumentOutline );\n"]}
|
|
@@ -5,31 +5,28 @@ import { createElement } from "@wordpress/element";
|
|
|
5
5
|
*/
|
|
6
6
|
import classnames from 'classnames';
|
|
7
7
|
|
|
8
|
-
const TableOfContentsItem =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
className: "document-outline__item-content"
|
|
31
|
-
}, children)));
|
|
32
|
-
};
|
|
8
|
+
const TableOfContentsItem = ({
|
|
9
|
+
children,
|
|
10
|
+
isValid,
|
|
11
|
+
level,
|
|
12
|
+
href,
|
|
13
|
+
onSelect
|
|
14
|
+
}) => createElement("li", {
|
|
15
|
+
className: classnames('document-outline__item', `is-${level.toLowerCase()}`, {
|
|
16
|
+
'is-invalid': !isValid
|
|
17
|
+
})
|
|
18
|
+
}, createElement("a", {
|
|
19
|
+
href: href,
|
|
20
|
+
className: "document-outline__button",
|
|
21
|
+
onClick: onSelect
|
|
22
|
+
}, createElement("span", {
|
|
23
|
+
className: "document-outline__emdash",
|
|
24
|
+
"aria-hidden": "true"
|
|
25
|
+
}), createElement("strong", {
|
|
26
|
+
className: "document-outline__level"
|
|
27
|
+
}, level), createElement("span", {
|
|
28
|
+
className: "document-outline__item-content"
|
|
29
|
+
}, children)));
|
|
33
30
|
|
|
34
31
|
export default TableOfContentsItem;
|
|
35
32
|
//# sourceMappingURL=item.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/document-outline/item.js"],"names":["classnames","TableOfContentsItem","children","isValid","level","href","onSelect","toLowerCase"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;;AAEA,MAAMC,mBAAmB,GAAG
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/document-outline/item.js"],"names":["classnames","TableOfContentsItem","children","isValid","level","href","onSelect","toLowerCase"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;;AAEA,MAAMC,mBAAmB,GAAG,CAAE;AAC7BC,EAAAA,QAD6B;AAE7BC,EAAAA,OAF6B;AAG7BC,EAAAA,KAH6B;AAI7BC,EAAAA,IAJ6B;AAK7BC,EAAAA;AAL6B,CAAF,KAO3B;AACC,EAAA,SAAS,EAAGN,UAAU,CACrB,wBADqB,EAEpB,MAAMI,KAAK,CAACG,WAAN,EAAqB,EAFP,EAGrB;AACC,kBAAc,CAAEJ;AADjB,GAHqB;AADvB,GASC;AACC,EAAA,IAAI,EAAGE,IADR;AAEC,EAAA,SAAS,EAAC,0BAFX;AAGC,EAAA,OAAO,EAAGC;AAHX,GAKC;AACC,EAAA,SAAS,EAAC,0BADX;AAEC,iBAAY;AAFb,EALD,EASC;AAAQ,EAAA,SAAS,EAAC;AAAlB,GAA8CF,KAA9C,CATD,EAUC;AAAM,EAAA,SAAS,EAAC;AAAhB,GAAmDF,QAAnD,CAVD,CATD,CAPD;;AA+BA,eAAeD,mBAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\nconst TableOfContentsItem = ( {\n\tchildren,\n\tisValid,\n\tlevel,\n\thref,\n\tonSelect,\n} ) => (\n\t<li\n\t\tclassName={ classnames(\n\t\t\t'document-outline__item',\n\t\t\t`is-${ level.toLowerCase() }`,\n\t\t\t{\n\t\t\t\t'is-invalid': ! isValid,\n\t\t\t}\n\t\t) }\n\t>\n\t\t<a\n\t\t\thref={ href }\n\t\t\tclassName=\"document-outline__button\"\n\t\t\tonClick={ onSelect }\n\t\t>\n\t\t\t<span\n\t\t\t\tclassName=\"document-outline__emdash\"\n\t\t\t\taria-hidden=\"true\"\n\t\t\t></span>\n\t\t\t<strong className=\"document-outline__level\">{ level }</strong>\n\t\t\t<span className=\"document-outline__item-content\">{ children }</span>\n\t\t</a>\n\t</li>\n);\n\nexport default TableOfContentsItem;\n"]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
1
|
import { createElement } from "@wordpress/element";
|
|
3
2
|
|
|
4
3
|
/**
|
|
@@ -18,11 +17,10 @@ import { useContext } from '@wordpress/element';
|
|
|
18
17
|
|
|
19
18
|
import styles from './style.scss';
|
|
20
19
|
|
|
21
|
-
const HelpDetailNavigationScreen =
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
} = _ref;
|
|
20
|
+
const HelpDetailNavigationScreen = ({
|
|
21
|
+
content,
|
|
22
|
+
label
|
|
23
|
+
}) => {
|
|
26
24
|
const navigation = useNavigation();
|
|
27
25
|
const {
|
|
28
26
|
listProps
|
|
@@ -35,7 +33,7 @@ const HelpDetailNavigationScreen = _ref => {
|
|
|
35
33
|
style: styles.container
|
|
36
34
|
}, createElement(BottomSheet.NavBar, null, createElement(BottomSheet.NavBar.BackButton, {
|
|
37
35
|
onPress: navigation.goBack
|
|
38
|
-
}), createElement(BottomSheet.NavBar.Heading, null, label)), createElement(ScrollView,
|
|
36
|
+
}), createElement(BottomSheet.NavBar.Heading, null, label)), createElement(ScrollView, { ...listProps,
|
|
39
37
|
contentContainerStyle: { ...contentContainerStyle,
|
|
40
38
|
paddingBottom: Math.max(listProps.safeAreaBottomInset, contentContainerStyle.paddingBottom),
|
|
41
39
|
|
|
@@ -46,7 +44,7 @@ const HelpDetailNavigationScreen = _ref => {
|
|
|
46
44
|
*/
|
|
47
45
|
marginTop: 0
|
|
48
46
|
}
|
|
49
|
-
}
|
|
47
|
+
}, createElement(TouchableWithoutFeedback, {
|
|
50
48
|
accessible: false
|
|
51
49
|
}, createElement(View, null, content)))));
|
|
52
50
|
};
|