@wordpress/editor 13.10.0 → 13.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/build/components/autosave-monitor/index.js +1 -2
- package/build/components/autosave-monitor/index.js.map +1 -1
- package/build/components/deprecated.js +3 -4
- package/build/components/deprecated.js.map +1 -1
- package/build/components/document-outline/check.js +4 -5
- package/build/components/document-outline/check.js.map +1 -1
- package/build/components/document-outline/index.js +12 -16
- package/build/components/document-outline/index.js.map +1 -1
- package/build/components/document-outline/item.js +22 -25
- package/build/components/document-outline/item.js.map +1 -1
- package/build/components/editor-help/help-detail-navigation-screen.native.js +4 -5
- package/build/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
- package/build/components/editor-help/help-get-support-button.native.js +4 -5
- package/build/components/editor-help/help-get-support-button.native.js.map +1 -1
- package/build/components/editor-help/help-section-title.native.js +3 -4
- package/build/components/editor-help/help-section-title.native.js.map +1 -1
- package/build/components/editor-help/help-topic-row.native.js +6 -7
- package/build/components/editor-help/help-topic-row.native.js.map +1 -1
- package/build/components/editor-help/index.native.js +19 -24
- package/build/components/editor-help/index.native.js.map +1 -1
- package/build/components/editor-help/view-sections.native.js +16 -20
- package/build/components/editor-help/view-sections.native.js.map +1 -1
- package/build/components/editor-notices/index.js +12 -19
- package/build/components/editor-notices/index.js.map +1 -1
- package/build/components/editor-snackbars/index.js +3 -6
- package/build/components/editor-snackbars/index.js.map +1 -1
- package/build/components/entities-saved-states/entity-record-item.js +7 -10
- package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
- package/build/components/entities-saved-states/entity-type-list.js +6 -7
- package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build/components/entities-saved-states/hooks/use-is-dirty.js +84 -0
- package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -0
- package/build/components/entities-saved-states/index.js +42 -110
- package/build/components/entities-saved-states/index.js.map +1 -1
- package/build/components/error-boundary/index.js +4 -5
- package/build/components/error-boundary/index.js.map +1 -1
- package/build/components/global-keyboard-shortcuts/save-shortcut.js +3 -4
- package/build/components/global-keyboard-shortcuts/save-shortcut.js.map +1 -1
- package/build/components/index.js +9 -0
- package/build/components/index.js.map +1 -1
- package/build/components/media-categories/index.js +25 -42
- package/build/components/media-categories/index.js.map +1 -1
- package/build/components/page-attributes/check.js +4 -7
- package/build/components/page-attributes/check.js.map +1 -1
- package/build/components/page-attributes/order.js +5 -8
- package/build/components/page-attributes/order.js.map +1 -1
- package/build/components/page-attributes/parent.js +5 -12
- package/build/components/page-attributes/parent.js.map +1 -1
- package/build/components/post-author/check.js +6 -7
- package/build/components/post-author/check.js.map +1 -1
- package/build/components/post-author/combobox.js +3 -6
- package/build/components/post-author/combobox.js.map +1 -1
- package/build/components/post-author/index.js +1 -1
- package/build/components/post-author/index.js.map +1 -1
- package/build/components/post-comments/index.js +4 -6
- package/build/components/post-comments/index.js.map +1 -1
- package/build/components/post-excerpt/index.js +4 -5
- package/build/components/post-excerpt/index.js.map +1 -1
- package/build/components/post-featured-image/index.js +56 -69
- package/build/components/post-featured-image/index.js.map +1 -1
- package/build/components/post-format/check.js +4 -5
- package/build/components/post-format/check.js.map +1 -1
- package/build/components/post-format/index.js +1 -1
- package/build/components/post-format/index.js.map +1 -1
- package/build/components/post-last-revision/check.js +5 -7
- package/build/components/post-last-revision/check.js.map +1 -1
- package/build/components/post-last-revision/index.js +4 -5
- package/build/components/post-last-revision/index.js.map +1 -1
- package/build/components/post-locked-modal/index.js +1 -1
- package/build/components/post-locked-modal/index.js.map +1 -1
- package/build/components/post-pending-status/check.js +7 -9
- package/build/components/post-pending-status/check.js.map +1 -1
- package/build/components/post-pending-status/index.js +4 -6
- package/build/components/post-pending-status/index.js.map +1 -1
- package/build/components/post-pingbacks/index.js +4 -6
- package/build/components/post-pingbacks/index.js.map +1 -1
- package/build/components/post-preview-button/index.js +8 -12
- package/build/components/post-preview-button/index.js.map +1 -1
- package/build/components/post-publish-button/index.js +6 -13
- package/build/components/post-publish-button/index.js.map +1 -1
- package/build/components/post-publish-button/label.js +14 -17
- package/build/components/post-publish-button/label.js.map +1 -1
- package/build/components/post-publish-panel/index.js +6 -7
- package/build/components/post-publish-panel/index.js.map +1 -1
- package/build/components/post-publish-panel/maybe-category-panel.js +2 -4
- package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-post-format-panel.js +9 -12
- package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-tags-panel.js +4 -7
- package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
- package/build/components/post-publish-panel/postpublish.js +8 -11
- package/build/components/post-publish-panel/postpublish.js.map +1 -1
- package/build/components/post-publish-panel/prepublish.js +5 -6
- package/build/components/post-publish-panel/prepublish.js.map +1 -1
- package/build/components/post-saved-state/index.js +13 -8
- package/build/components/post-saved-state/index.js.map +1 -1
- package/build/components/post-schedule/check.js +6 -8
- package/build/components/post-schedule/check.js.map +1 -1
- package/build/components/post-schedule/index.js +8 -12
- package/build/components/post-schedule/index.js.map +1 -1
- package/build/components/post-schedule/label.js +7 -10
- package/build/components/post-schedule/label.js.map +1 -1
- package/build/components/post-slug/check.js +3 -4
- package/build/components/post-slug/check.js.map +1 -1
- package/build/components/post-slug/index.js +5 -6
- package/build/components/post-slug/index.js.map +1 -1
- package/build/components/post-sticky/check.js +7 -9
- package/build/components/post-sticky/check.js.map +1 -1
- package/build/components/post-sticky/index.js +4 -5
- package/build/components/post-sticky/index.js.map +1 -1
- package/build/components/post-switch-to-draft-button/index.js +6 -7
- package/build/components/post-switch-to-draft-button/index.js.map +1 -1
- package/build/components/post-taxonomies/check.js +6 -7
- package/build/components/post-taxonomies/check.js.map +1 -1
- package/build/components/post-taxonomies/flat-term-selector.js +13 -14
- package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/hierarchical-term-selector.js +13 -14
- package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/index.js +6 -11
- package/build/components/post-taxonomies/index.js.map +1 -1
- package/build/components/post-taxonomies/most-used-terms.js +5 -6
- package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build/components/post-template/index.js +6 -9
- package/build/components/post-template/index.js.map +1 -1
- package/build/components/post-title/index.js +2 -6
- package/build/components/post-title/index.js.map +1 -1
- package/build/components/post-title/index.native.js +8 -11
- package/build/components/post-title/index.native.js.map +1 -1
- package/build/components/post-trash/check.js +7 -9
- package/build/components/post-trash/check.js.map +1 -1
- package/build/components/post-type-support-check/index.js +5 -6
- package/build/components/post-type-support-check/index.js.map +1 -1
- package/build/components/post-url/check.js +4 -5
- package/build/components/post-url/check.js.map +1 -1
- package/build/components/post-url/index.js +8 -9
- package/build/components/post-url/index.js.map +1 -1
- package/build/components/post-visibility/check.js +6 -7
- package/build/components/post-visibility/check.js.map +1 -1
- package/build/components/post-visibility/index.js +10 -12
- package/build/components/post-visibility/index.js.map +1 -1
- package/build/components/post-visibility/label.js +1 -3
- package/build/components/post-visibility/label.js.map +1 -1
- package/build/components/provider/index.js +9 -10
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/index.native.js +14 -20
- package/build/components/provider/index.native.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.js +6 -10
- package/build/components/provider/use-block-editor-settings.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.native.js +1 -3
- package/build/components/provider/use-block-editor-settings.native.js.map +1 -1
- package/build/components/table-of-contents/index.js +26 -33
- package/build/components/table-of-contents/index.js.map +1 -1
- package/build/components/table-of-contents/panel.js +4 -5
- package/build/components/table-of-contents/panel.js.map +1 -1
- package/build/components/template-validation-notice/index.js +4 -6
- package/build/components/template-validation-notice/index.js.map +1 -1
- package/build/components/theme-support-check/index.js +7 -8
- package/build/components/theme-support-check/index.js.map +1 -1
- package/build/hooks/custom-sources-backwards-compatibility.js +16 -35
- package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
- package/build/hooks/default-autocompleters.js +1 -2
- package/build/hooks/default-autocompleters.js.map +1 -1
- package/build/private-apis.js +4 -1
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +147 -179
- package/build/store/actions.js.map +1 -1
- package/build/store/actions.native.js +1 -2
- package/build/store/actions.native.js.map +1 -1
- package/build/store/reducer.js +14 -44
- package/build/store/reducer.js.map +1 -1
- package/build/store/reducer.native.js +3 -12
- package/build/store/reducer.native.js.map +1 -1
- package/build/store/selectors.js +23 -54
- package/build/store/selectors.js.map +1 -1
- package/build/store/utils/notice-builder.js +3 -3
- package/build/store/utils/notice-builder.js.map +1 -1
- package/build/utils/media-upload/index.js +11 -15
- package/build/utils/media-upload/index.js.map +1 -1
- package/build/utils/terms.js +3 -6
- package/build/utils/terms.js.map +1 -1
- package/build-module/components/autosave-monitor/index.js +1 -2
- package/build-module/components/autosave-monitor/index.js.map +1 -1
- package/build-module/components/deprecated.js +3 -4
- package/build-module/components/deprecated.js.map +1 -1
- package/build-module/components/document-outline/check.js +4 -5
- package/build-module/components/document-outline/check.js.map +1 -1
- package/build-module/components/document-outline/index.js +12 -16
- package/build-module/components/document-outline/index.js.map +1 -1
- package/build-module/components/document-outline/item.js +22 -25
- package/build-module/components/document-outline/item.js.map +1 -1
- package/build-module/components/editor-help/help-detail-navigation-screen.native.js +4 -5
- package/build-module/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
- package/build-module/components/editor-help/help-get-support-button.native.js +4 -5
- package/build-module/components/editor-help/help-get-support-button.native.js.map +1 -1
- package/build-module/components/editor-help/help-section-title.native.js +3 -4
- package/build-module/components/editor-help/help-section-title.native.js.map +1 -1
- package/build-module/components/editor-help/help-topic-row.native.js +6 -7
- package/build-module/components/editor-help/help-topic-row.native.js.map +1 -1
- package/build-module/components/editor-help/index.native.js +19 -23
- package/build-module/components/editor-help/index.native.js.map +1 -1
- package/build-module/components/editor-help/view-sections.native.js +16 -20
- package/build-module/components/editor-help/view-sections.native.js.map +1 -1
- package/build-module/components/editor-notices/index.js +12 -19
- package/build-module/components/editor-notices/index.js.map +1 -1
- package/build-module/components/editor-snackbars/index.js +3 -6
- package/build-module/components/editor-snackbars/index.js.map +1 -1
- package/build-module/components/entities-saved-states/entity-record-item.js +7 -10
- package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
- package/build-module/components/entities-saved-states/entity-type-list.js +6 -7
- package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build-module/components/entities-saved-states/hooks/use-is-dirty.js +70 -0
- package/build-module/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -0
- package/build-module/components/entities-saved-states/index.js +43 -113
- package/build-module/components/entities-saved-states/index.js.map +1 -1
- package/build-module/components/error-boundary/index.js +4 -5
- package/build-module/components/error-boundary/index.js.map +1 -1
- package/build-module/components/global-keyboard-shortcuts/save-shortcut.js +3 -4
- package/build-module/components/global-keyboard-shortcuts/save-shortcut.js.map +1 -1
- package/build-module/components/index.js +1 -0
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/media-categories/index.js +25 -42
- package/build-module/components/media-categories/index.js.map +1 -1
- package/build-module/components/page-attributes/check.js +4 -7
- package/build-module/components/page-attributes/check.js.map +1 -1
- package/build-module/components/page-attributes/order.js +5 -8
- package/build-module/components/page-attributes/order.js.map +1 -1
- package/build-module/components/page-attributes/parent.js +5 -12
- package/build-module/components/page-attributes/parent.js.map +1 -1
- package/build-module/components/post-author/check.js +6 -7
- package/build-module/components/post-author/check.js.map +1 -1
- package/build-module/components/post-author/combobox.js +3 -6
- package/build-module/components/post-author/combobox.js.map +1 -1
- package/build-module/components/post-author/index.js +1 -1
- package/build-module/components/post-author/index.js.map +1 -1
- package/build-module/components/post-comments/index.js +4 -6
- package/build-module/components/post-comments/index.js.map +1 -1
- package/build-module/components/post-excerpt/index.js +4 -5
- package/build-module/components/post-excerpt/index.js.map +1 -1
- package/build-module/components/post-featured-image/index.js +56 -69
- package/build-module/components/post-featured-image/index.js.map +1 -1
- package/build-module/components/post-format/check.js +4 -5
- package/build-module/components/post-format/check.js.map +1 -1
- package/build-module/components/post-format/index.js +1 -1
- package/build-module/components/post-format/index.js.map +1 -1
- package/build-module/components/post-last-revision/check.js +5 -7
- package/build-module/components/post-last-revision/check.js.map +1 -1
- package/build-module/components/post-last-revision/index.js +4 -5
- package/build-module/components/post-last-revision/index.js.map +1 -1
- package/build-module/components/post-locked-modal/index.js +1 -1
- package/build-module/components/post-locked-modal/index.js.map +1 -1
- package/build-module/components/post-pending-status/check.js +7 -9
- package/build-module/components/post-pending-status/check.js.map +1 -1
- package/build-module/components/post-pending-status/index.js +4 -6
- package/build-module/components/post-pending-status/index.js.map +1 -1
- package/build-module/components/post-pingbacks/index.js +4 -6
- package/build-module/components/post-pingbacks/index.js.map +1 -1
- package/build-module/components/post-preview-button/index.js +8 -12
- package/build-module/components/post-preview-button/index.js.map +1 -1
- package/build-module/components/post-publish-button/index.js +6 -13
- package/build-module/components/post-publish-button/index.js.map +1 -1
- package/build-module/components/post-publish-button/label.js +14 -17
- package/build-module/components/post-publish-button/label.js.map +1 -1
- package/build-module/components/post-publish-panel/index.js +6 -7
- package/build-module/components/post-publish-panel/index.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-category-panel.js +2 -4
- package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-post-format-panel.js +9 -12
- package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-tags-panel.js +4 -7
- package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/postpublish.js +8 -11
- package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
- package/build-module/components/post-publish-panel/prepublish.js +5 -6
- package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
- package/build-module/components/post-saved-state/index.js +13 -8
- package/build-module/components/post-saved-state/index.js.map +1 -1
- package/build-module/components/post-schedule/check.js +6 -8
- package/build-module/components/post-schedule/check.js.map +1 -1
- package/build-module/components/post-schedule/index.js +8 -12
- package/build-module/components/post-schedule/index.js.map +1 -1
- package/build-module/components/post-schedule/label.js +7 -10
- package/build-module/components/post-schedule/label.js.map +1 -1
- package/build-module/components/post-slug/check.js +3 -4
- package/build-module/components/post-slug/check.js.map +1 -1
- package/build-module/components/post-slug/index.js +5 -6
- package/build-module/components/post-slug/index.js.map +1 -1
- package/build-module/components/post-sticky/check.js +7 -9
- package/build-module/components/post-sticky/check.js.map +1 -1
- package/build-module/components/post-sticky/index.js +4 -5
- package/build-module/components/post-sticky/index.js.map +1 -1
- package/build-module/components/post-switch-to-draft-button/index.js +6 -7
- package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
- package/build-module/components/post-taxonomies/check.js +6 -7
- package/build-module/components/post-taxonomies/check.js.map +1 -1
- package/build-module/components/post-taxonomies/flat-term-selector.js +13 -14
- package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js +13 -14
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/index.js +6 -11
- package/build-module/components/post-taxonomies/index.js.map +1 -1
- package/build-module/components/post-taxonomies/most-used-terms.js +5 -6
- package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build-module/components/post-template/index.js +6 -9
- package/build-module/components/post-template/index.js.map +1 -1
- package/build-module/components/post-title/index.js +2 -6
- package/build-module/components/post-title/index.js.map +1 -1
- package/build-module/components/post-title/index.native.js +8 -11
- package/build-module/components/post-title/index.native.js.map +1 -1
- package/build-module/components/post-trash/check.js +7 -9
- package/build-module/components/post-trash/check.js.map +1 -1
- package/build-module/components/post-type-support-check/index.js +5 -6
- package/build-module/components/post-type-support-check/index.js.map +1 -1
- package/build-module/components/post-url/check.js +4 -5
- package/build-module/components/post-url/check.js.map +1 -1
- package/build-module/components/post-url/index.js +8 -9
- package/build-module/components/post-url/index.js.map +1 -1
- package/build-module/components/post-visibility/check.js +6 -7
- package/build-module/components/post-visibility/check.js.map +1 -1
- package/build-module/components/post-visibility/index.js +10 -12
- package/build-module/components/post-visibility/index.js.map +1 -1
- package/build-module/components/post-visibility/label.js +1 -3
- package/build-module/components/post-visibility/label.js.map +1 -1
- package/build-module/components/provider/index.js +9 -10
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/index.native.js +14 -20
- package/build-module/components/provider/index.native.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.js +6 -10
- package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.native.js +1 -3
- package/build-module/components/provider/use-block-editor-settings.native.js.map +1 -1
- package/build-module/components/table-of-contents/index.js +26 -33
- package/build-module/components/table-of-contents/index.js.map +1 -1
- package/build-module/components/table-of-contents/panel.js +4 -5
- package/build-module/components/table-of-contents/panel.js.map +1 -1
- package/build-module/components/template-validation-notice/index.js +4 -6
- package/build-module/components/template-validation-notice/index.js.map +1 -1
- package/build-module/components/theme-support-check/index.js +7 -8
- package/build-module/components/theme-support-check/index.js.map +1 -1
- package/build-module/hooks/custom-sources-backwards-compatibility.js +16 -35
- package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
- package/build-module/hooks/default-autocompleters.js +1 -2
- package/build-module/hooks/default-autocompleters.js.map +1 -1
- package/build-module/private-apis.js +3 -1
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +147 -179
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/actions.native.js +1 -2
- package/build-module/store/actions.native.js.map +1 -1
- package/build-module/store/reducer.js +14 -44
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/reducer.native.js +3 -12
- package/build-module/store/reducer.native.js.map +1 -1
- package/build-module/store/selectors.js +21 -54
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/utils/notice-builder.js +3 -3
- package/build-module/store/utils/notice-builder.js.map +1 -1
- package/build-module/utils/media-upload/index.js +11 -15
- package/build-module/utils/media-upload/index.js.map +1 -1
- package/build-module/utils/terms.js +3 -6
- package/build-module/utils/terms.js.map +1 -1
- package/build-style/style-rtl.css +1 -1
- package/build-style/style.css +1 -1
- package/package.json +31 -31
- package/src/components/entities-saved-states/hooks/use-is-dirty.js +85 -0
- package/src/components/entities-saved-states/index.js +29 -107
- package/src/components/entities-saved-states/test/use-is-dirty.js +94 -0
- package/src/components/index.js +1 -0
- package/src/components/post-saved-state/index.js +6 -0
- package/src/components/post-taxonomies/flat-term-selector.js +1 -1
- package/src/components/post-title/index.js +2 -1
- package/src/components/provider/use-block-editor-settings.js +1 -0
- package/src/private-apis.js +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -79,8 +79,7 @@ class AutosaveMonitor extends _element.Component {
|
|
|
79
79
|
clearTimeout(this.timerId);
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
setAutosaveTimer() {
|
|
83
|
-
let timeout = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props.interval * 1000;
|
|
82
|
+
setAutosaveTimer(timeout = this.props.interval * 1000) {
|
|
84
83
|
this.timerId = setTimeout(() => {
|
|
85
84
|
this.autosaveTimerHandler();
|
|
86
85
|
}, timeout);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/autosave-monitor/index.js"],"names":["AutosaveMonitor","Component","constructor","props","needsAutosave","isDirty","isAutosaveable","componentDidMount","disableIntervalChecks","setAutosaveTimer","componentDidUpdate","prevProps","editsReference","autosave","interval","clearTimeout","timerId","isAutosaving","componentWillUnmount","timeout","setTimeout","autosaveTimerHandler","render","select","ownProps","getReferenceByDistinctEdits","coreStore","isEditedPostDirty","isEditedPostAutosaveable","isAutosavingPost","getEditorSettings","editorStore","autosaveInterval","dispatch"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AACA;;AAKA;;AAXA;AACA;AACA;;AAMA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,eAAN,SAA8BC,kBAA9B,CAAwC;AAC9CC,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":["AutosaveMonitor","Component","constructor","props","needsAutosave","isDirty","isAutosaveable","componentDidMount","disableIntervalChecks","setAutosaveTimer","componentDidUpdate","prevProps","editsReference","autosave","interval","clearTimeout","timerId","isAutosaving","componentWillUnmount","timeout","setTimeout","autosaveTimerHandler","render","select","ownProps","getReferenceByDistinctEdits","coreStore","isEditedPostDirty","isEditedPostAutosaveable","isAutosavingPost","getEditorSettings","editorStore","autosaveInterval","dispatch"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AACA;;AAKA;;AAXA;AACA;AACA;;AAMA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,eAAN,SAA8BC,kBAA9B,CAAwC;AAC9CC,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,E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BAAwB,EAHlC;AAINX,IAAAA,YAAY,EAAEY,gBAAgB,EAJxB;AAKNf,IAAAA;AALM,GAAP;AAOA,CAnBD,CADuB,EAqBvB,wBAAc,CAAEmB,QAAF,EAAYT,QAAZ,MAA4B;AACzCX,EAAAA,QAAQ,GAAG;AACV,UAAM;AAAEA,MAAAA,QAAQ,GAAGoB,QAAQ,CAAEF,YAAF,CAAR,CAAwBlB;AAArC,QAAkDW,QAAxD;AACAX,IAAAA,QAAQ;AACR;;AAJwC,CAA5B,CAAd,CArBuB,CAAT,EA2BVb,eA3BU,C","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"]}
|
|
@@ -29,8 +29,7 @@ var _serverSideRender = _interopRequireDefault(require("@wordpress/server-side-r
|
|
|
29
29
|
/**
|
|
30
30
|
* WordPress dependencies
|
|
31
31
|
*/
|
|
32
|
-
function deprecateComponent(name, Wrapped) {
|
|
33
|
-
let staticsToHoist = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
32
|
+
function deprecateComponent(name, Wrapped, staticsToHoist = []) {
|
|
34
33
|
const Component = (0, _element.forwardRef)((props, ref) => {
|
|
35
34
|
(0, _deprecated.default)('wp.editor.' + name, {
|
|
36
35
|
since: '5.3',
|
|
@@ -48,13 +47,13 @@ function deprecateComponent(name, Wrapped) {
|
|
|
48
47
|
}
|
|
49
48
|
|
|
50
49
|
function deprecateFunction(name, func) {
|
|
51
|
-
return
|
|
50
|
+
return (...args) => {
|
|
52
51
|
(0, _deprecated.default)('wp.editor.' + name, {
|
|
53
52
|
since: '5.3',
|
|
54
53
|
alternative: 'wp.blockEditor.' + name,
|
|
55
54
|
version: '6.2'
|
|
56
55
|
});
|
|
57
|
-
return func(...
|
|
56
|
+
return func(...args);
|
|
58
57
|
};
|
|
59
58
|
}
|
|
60
59
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/deprecated.js"],"names":["deprecateComponent","name","Wrapped","staticsToHoist","Component","props","ref","since","alternative","version","forEach","staticName","deprecateFunction","func","RichText","RootRichText","isEmpty","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","DefaultBlockAppender","RootDefaultBlockAppender","FontSizePicker","RootFontSizePicker","Inserter","RootInserter","InnerBlocks","RootInnerBlocks","InspectorAdvancedControls","RootInspectorAdvancedControls","InspectorControls","RootInspectorControls","PanelColorSettings","RootPanelColorSettings","PlainText","RootPlainText","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","createCustomColorsHOC","rootCreateCustomColorsHOC","getColorClassName","rootGetColorClassName","getColorObjectByAttributeValues","rootGetColorObjectByAttributeValues","getColorObjectByColorValue","rootGetColorObjectByColorValue","getFontSize","rootGetFontSize","getFontSizeClass","rootGetFontSizeClass","withColorContext","rootWithColorContext","withColors","rootWithColors","withFontSizes","rootWithFontSizes"],"mappings":";;;;;;;;;;;;;;;;AAKA;;;;AADA;;AAEA;;AAuDA;;AA7DA;;AACA;AACA;AACA;AA4DA,SAASA,kBAAT,CAA6BC,IAA7B,EAAmCC,OAAnC,EAAkE;AAAA,MAAtBC,cAAsB,uEAAL,EAAK;AACjE,QAAMC,SAAS,GAAG,yBAAY,CAAEC,KAAF,EAASC,GAAT,KAAkB;AAC/C,6BAAY,eAAeL,IAA3B,EAAiC;AAChCM,MAAAA,KAAK,EAAE,KADyB;AAEhCC,MAAAA,WAAW,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\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":["deprecateComponent","name","Wrapped","staticsToHoist","Component","props","ref","since","alternative","version","forEach","staticName","deprecateFunction","func","args","RichText","RootRichText","isEmpty","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","DefaultBlockAppender","RootDefaultBlockAppender","FontSizePicker","RootFontSizePicker","Inserter","RootInserter","InnerBlocks","RootInnerBlocks","InspectorAdvancedControls","RootInspectorAdvancedControls","InspectorControls","RootInspectorControls","PanelColorSettings","RootPanelColorSettings","PlainText","RootPlainText","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","createCustomColorsHOC","rootCreateCustomColorsHOC","getColorClassName","rootGetColorClassName","getColorObjectByAttributeValues","rootGetColorObjectByAttributeValues","getColorObjectByColorValue","rootGetColorObjectByColorValue","getFontSize","rootGetFontSize","getFontSizeClass","rootGetFontSizeClass","withColorContext","rootWithColorContext","withColors","rootWithColors","withFontSizes","rootWithFontSizes"],"mappings":";;;;;;;;;;;;;;;;AAKA;;;;AADA;;AAEA;;AAuDA;;AA7DA;;AACA;AACA;AACA;AA4DA,SAASA,kBAAT,CAA6BC,IAA7B,EAAmCC,OAAnC,EAA4CC,cAAc,GAAG,EAA7D,EAAkE;AACjE,QAAMC,SAAS,GAAG,yBAAY,CAAEC,KAAF,EAASC,GAAT,KAAkB;AAC/C,6BAAY,eAAeL,IAA3B,EAAiC;AAChCM,MAAAA,KAAK,EAAE,KADyB;AAEhCC,MAAAA,WAAW,EAAE,oBAAoBP,IAFD;AAGhCQ,MAAAA,OAAO,EAAE;AAHuB,KAAjC;AAMA,WAAO,4BAAC,OAAD;AAAS,MAAA,GAAG,EAAGH;AAAf,OAA0BD,KAA1B,EAAP;AACA,GARiB,CAAlB;AAUAF,EAAAA,cAAc,CAACO,OAAf,CAA0BC,UAAF,IAAkB;AACzCP,IAAAA,SAAS,CAAEO,UAAF,CAAT,GAA0BX,kBAAkB,CAC3CC,IAAI,GAAG,GAAP,GAAaU,UAD8B,EAE3CT,OAAO,CAAES,UAAF,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,UAAU,GAAGhG,kBAAkB,CAAE,YAAF,EAAgBiG,uBAAhB,CAArC;;AACA,MAAMC,OAAO,GAAGlG,kBAAkB,CAAE,SAAF,EAAamG,oBAAb,CAAlC;;AACA,MAAMC,WAAW,GAAGpG,kBAAkB,CAAE,aAAF,EAAiBqG,wBAAjB,CAAtC;;AAEA,MAAMC,qBAAqB,GAAG1F,iBAAiB,CACrD,uBADqD,EAErD2F,kCAFqD,CAA/C;;AAIA,MAAMC,iBAAiB,GAAG5F,iBAAiB,CACjD,mBADiD,EAEjD6F,8BAFiD,CAA3C;;AAIA,MAAMC,+BAA+B,GAAG9F,iBAAiB,CAC/D,iCAD+D,EAE/D+F,4CAF+D,CAAzD;;AAIA,MAAMC,0BAA0B,GAAGhG,iBAAiB,CAC1D,4BAD0D,EAE1DiG,uCAF0D,CAApD;;AAIA,MAAMC,WAAW,GAAGlG,iBAAiB,CAAE,aAAF,EAAiBmG,wBAAjB,CAArC;;AACA,MAAMC,gBAAgB,GAAGpG,iBAAiB,CAChD,kBADgD,EAEhDqG,6BAFgD,CAA1C;;AAIA,MAAMC,gBAAgB,GAAGtG,iBAAiB,CAChD,kBADgD,EAEhDuG,6BAFgD,CAA1C;;AAIA,MAAMC,UAAU,GAAGxG,iBAAiB,CAAE,YAAF,EAAgByG,uBAAhB,CAApC;;AACA,MAAMC,aAAa,GAAG1G,iBAAiB,CAC7C,eAD6C,EAE7C2G,0BAF6C,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"]}
|
|
@@ -12,11 +12,10 @@ var _blockEditor = require("@wordpress/block-editor");
|
|
|
12
12
|
/**
|
|
13
13
|
* WordPress dependencies
|
|
14
14
|
*/
|
|
15
|
-
function DocumentOutlineCheck(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
} = _ref;
|
|
15
|
+
function DocumentOutlineCheck({
|
|
16
|
+
blocks,
|
|
17
|
+
children
|
|
18
|
+
}) {
|
|
20
19
|
const headings = blocks.filter(block => block.name === 'core/heading');
|
|
21
20
|
|
|
22
21
|
if (headings.length < 1) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/document-outline/check.js"],"names":["DocumentOutlineCheck","blocks","children","headings","filter","block","name","length","select","blockEditorStore","getBlocks"],"mappings":";;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;AAIA,SAASA,oBAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/document-outline/check.js"],"names":["DocumentOutlineCheck","blocks","children","headings","filter","block","name","length","select","blockEditorStore","getBlocks"],"mappings":";;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;AAIA,SAASA,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;;eAEc,sBAAcM,MAAF,KAAgB;AAC1CP,EAAAA,MAAM,EAAEO,MAAM,CAAEC,kBAAF,CAAN,CAA2BC,SAA3B;AADkC,CAAhB,CAAZ,EAERV,oBAFQ,C","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"]}
|
|
@@ -62,11 +62,8 @@ const multipleH1Headings = [(0, _element.createElement)("br", {
|
|
|
62
62
|
* @return {Array} An array of heading blocks enhanced with the properties described above.
|
|
63
63
|
*/
|
|
64
64
|
|
|
65
|
-
const computeOutlineHeadings =
|
|
66
|
-
|
|
67
|
-
return blocks.flatMap(function () {
|
|
68
|
-
let block = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
69
|
-
|
|
65
|
+
const computeOutlineHeadings = (blocks = []) => {
|
|
66
|
+
return blocks.flatMap((block = {}) => {
|
|
70
67
|
if (block.name === 'core/heading') {
|
|
71
68
|
return { ...block,
|
|
72
69
|
level: block.attributes.level,
|
|
@@ -80,14 +77,13 @@ const computeOutlineHeadings = function () {
|
|
|
80
77
|
|
|
81
78
|
const isEmptyHeading = heading => !heading.attributes.content || heading.attributes.content.length === 0;
|
|
82
79
|
|
|
83
|
-
const DocumentOutline =
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
} = _ref;
|
|
80
|
+
const DocumentOutline = ({
|
|
81
|
+
blocks = [],
|
|
82
|
+
title,
|
|
83
|
+
onSelect,
|
|
84
|
+
isTitleSupported,
|
|
85
|
+
hasOutlineItemsDisabled
|
|
86
|
+
}) => {
|
|
91
87
|
const headings = computeOutlineHeadings(blocks);
|
|
92
88
|
const {
|
|
93
89
|
selectBlock
|
|
@@ -127,7 +123,7 @@ const DocumentOutline = _ref => {
|
|
|
127
123
|
href: `#block-${item.clientId}`,
|
|
128
124
|
onSelect: () => {
|
|
129
125
|
selectBlock(item.clientId);
|
|
130
|
-
onSelect
|
|
126
|
+
onSelect?.();
|
|
131
127
|
}
|
|
132
128
|
}, item.isEmpty ? emptyHeadingContent : (0, _richText.getTextContent)((0, _richText.create)({
|
|
133
129
|
html: item.attributes.content
|
|
@@ -138,7 +134,7 @@ const DocumentOutline = _ref => {
|
|
|
138
134
|
exports.DocumentOutline = DocumentOutline;
|
|
139
135
|
|
|
140
136
|
var _default = (0, _compose.compose)((0, _data.withSelect)(select => {
|
|
141
|
-
var _postType$supports$ti
|
|
137
|
+
var _postType$supports$ti;
|
|
142
138
|
|
|
143
139
|
const {
|
|
144
140
|
getBlocks
|
|
@@ -153,7 +149,7 @@ var _default = (0, _compose.compose)((0, _data.withSelect)(select => {
|
|
|
153
149
|
return {
|
|
154
150
|
title: getEditedPostAttribute('title'),
|
|
155
151
|
blocks: getBlocks(),
|
|
156
|
-
isTitleSupported: (_postType$supports$ti = postType
|
|
152
|
+
isTitleSupported: (_postType$supports$ti = postType?.supports?.title) !== null && _postType$supports$ti !== void 0 ? _postType$supports$ti : false
|
|
157
153
|
};
|
|
158
154
|
}))(DocumentOutline);
|
|
159
155
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/document-outline/index.js"],"names":["emptyHeadingContent","incorrectLevelContent","singleH1Headings","multipleH1Headings","computeOutlineHeadings","blocks","flatMap","block","name","level","attributes","isEmpty","isEmptyHeading","innerBlocks","heading","content","length","DocumentOutline","title","onSelect","isTitleSupported","hasOutlineItemsDisabled","headings","selectBlock","blockEditorStore","prevHeadingLevel","titleNode","document","querySelector","hasTitle","countByLevel","reduce","acc","hasMultipleH1","id","map","item","index","isIncorrectLevel","isValid","clientId","html","select","getBlocks","getEditedPostAttribute","editorStore","getPostType","coreStore","postType","supports"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAdA;AACA;AACA;;AAQA;AACA;AACA;;AAIA;AACA;AACA;AACA,MAAMA,mBAAmB,GAAG,wCAAM,cAAI,iBAAJ,CAAN,CAA5B;AACA,MAAMC,qBAAqB,GAAG,CAC7B;AAAI,EAAA,GAAG,EAAC;AAAR,EAD6B,EAE7B;AAAI,EAAA,GAAG,EAAC;AAAR,GAA8B,cAAI,2BAAJ,CAA9B,CAF6B,CAA9B;AAIA,MAAMC,gBAAgB,GAAG,CACxB;AAAI,EAAA,GAAG,EAAC;AAAR,EADwB,EAExB;AAAI,EAAA,GAAG,EAAC;AAAR,GACG,cAAI,sDAAJ,CADH,CAFwB,CAAzB;AAMA,MAAMC,kBAAkB,GAAG,CAC1B;AAAI,EAAA,GAAG,EAAC;AAAR,EAD0B,EAE1B;AAAI,EAAA,GAAG,EAAC;AAAR,GACG,cAAI,4CAAJ,CADH,CAF0B,CAA3B;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMC,sBAAsB,GAAG,
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/document-outline/index.js"],"names":["emptyHeadingContent","incorrectLevelContent","singleH1Headings","multipleH1Headings","computeOutlineHeadings","blocks","flatMap","block","name","level","attributes","isEmpty","isEmptyHeading","innerBlocks","heading","content","length","DocumentOutline","title","onSelect","isTitleSupported","hasOutlineItemsDisabled","headings","selectBlock","blockEditorStore","prevHeadingLevel","titleNode","document","querySelector","hasTitle","countByLevel","reduce","acc","hasMultipleH1","id","map","item","index","isIncorrectLevel","isValid","clientId","html","select","getBlocks","getEditedPostAttribute","editorStore","getPostType","coreStore","postType","supports"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAdA;AACA;AACA;;AAQA;AACA;AACA;;AAIA;AACA;AACA;AACA,MAAMA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,CAAE,MAAF,CAAxB,CAA5B;AAEA,SAAO;AACN1B,IAAAA,KAAK,EAAE0B,sBAAsB,CAAE,OAAF,CADvB;AAENvC,IAAAA,MAAM,EAAEsC,SAAS,EAFX;AAGNvB,IAAAA,gBAAgB,2BAAE4B,QAAQ,EAAEC,QAAV,EAAoB/B,KAAtB,yEAA+B;AAHzC,GAAP;AAKA,CAXD,CADc,EAaZD,eAbY,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { compose } from '@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"]}
|
|
@@ -14,31 +14,28 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
14
14
|
/**
|
|
15
15
|
* External dependencies
|
|
16
16
|
*/
|
|
17
|
-
const TableOfContentsItem =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
className: "document-outline__item-content"
|
|
40
|
-
}, children)));
|
|
41
|
-
};
|
|
17
|
+
const TableOfContentsItem = ({
|
|
18
|
+
children,
|
|
19
|
+
isValid,
|
|
20
|
+
level,
|
|
21
|
+
href,
|
|
22
|
+
onSelect
|
|
23
|
+
}) => (0, _element.createElement)("li", {
|
|
24
|
+
className: (0, _classnames.default)('document-outline__item', `is-${level.toLowerCase()}`, {
|
|
25
|
+
'is-invalid': !isValid
|
|
26
|
+
})
|
|
27
|
+
}, (0, _element.createElement)("a", {
|
|
28
|
+
href: href,
|
|
29
|
+
className: "document-outline__button",
|
|
30
|
+
onClick: onSelect
|
|
31
|
+
}, (0, _element.createElement)("span", {
|
|
32
|
+
className: "document-outline__emdash",
|
|
33
|
+
"aria-hidden": "true"
|
|
34
|
+
}), (0, _element.createElement)("strong", {
|
|
35
|
+
className: "document-outline__level"
|
|
36
|
+
}, level), (0, _element.createElement)("span", {
|
|
37
|
+
className: "document-outline__item-content"
|
|
38
|
+
}, children)));
|
|
42
39
|
|
|
43
40
|
var _default = TableOfContentsItem;
|
|
44
41
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/document-outline/item.js"],"names":["TableOfContentsItem","children","isValid","level","href","onSelect","toLowerCase"],"mappings":";;;;;;;;;;;AAGA;;AAHA;AACA;AACA;AAGA,MAAMA,mBAAmB,GAAG
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/document-outline/item.js"],"names":["TableOfContentsItem","children","isValid","level","href","onSelect","toLowerCase"],"mappings":";;;;;;;;;;;AAGA;;AAHA;AACA;AACA;AAGA,MAAMA,mBAAmB,GAAG,CAAE;AAC7BC,EAAAA,QAD6B;AAE7BC,EAAAA,OAF6B;AAG7BC,EAAAA,KAH6B;AAI7BC,EAAAA,IAJ6B;AAK7BC,EAAAA;AAL6B,CAAF,KAO3B;AACC,EAAA,SAAS,EAAG,yBACX,wBADW,EAEV,MAAMF,KAAK,CAACG,WAAN,EAAqB,EAFjB,EAGX;AACC,kBAAc,CAAEJ;AADjB,GAHW;AADb,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;;eA+BeD,mB","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"]}
|
|
@@ -30,11 +30,10 @@ var _style = _interopRequireDefault(require("./style.scss"));
|
|
|
30
30
|
/**
|
|
31
31
|
* Internal dependencies
|
|
32
32
|
*/
|
|
33
|
-
const HelpDetailNavigationScreen =
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
} = _ref;
|
|
33
|
+
const HelpDetailNavigationScreen = ({
|
|
34
|
+
content,
|
|
35
|
+
label
|
|
36
|
+
}) => {
|
|
38
37
|
const navigation = (0, _native.useNavigation)();
|
|
39
38
|
const {
|
|
40
39
|
listProps
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/editor-help/help-detail-navigation-screen.native.js"],"names":["HelpDetailNavigationScreen","content","label","navigation","listProps","BottomSheetContext","contentContainerStyle","StyleSheet","flatten","styles","container","goBack","paddingBottom","Math","max","safeAreaBottomInset","marginTop"],"mappings":";;;;;;;;;AAeA;;;;AAZA;;AAMA;;AAKA;;AAMA;;AApBA;AACA;AACA;;AASA;AACA;AACA;;AAIA;AACA;AACA;AAGA,MAAMA,0BAA0B,GAAG,
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/editor-help/help-detail-navigation-screen.native.js"],"names":["HelpDetailNavigationScreen","content","label","navigation","listProps","BottomSheetContext","contentContainerStyle","StyleSheet","flatten","styles","container","goBack","paddingBottom","Math","max","safeAreaBottomInset","marginTop"],"mappings":";;;;;;;;;AAeA;;;;AAZA;;AAMA;;AAKA;;AAMA;;AApBA;AACA;AACA;;AASA;AACA;AACA;;AAIA;AACA;AACA;AAGA,MAAMA,0BAA0B,GAAG,CAAE;AAAEC,EAAAA,OAAF;AAAWC,EAAAA;AAAX,CAAF,KAA0B;AAC5D,QAAMC,UAAU,GAAG,4BAAnB;AAEA,QAAM;AAAEC,IAAAA;AAAF,MAAgB,yBAAYC,8BAAZ,CAAtB;;AACA,QAAMC,qBAAqB,GAAGC,wBAAWC,OAAX,CAC7BJ,SAAS,CAACE,qBADmB,CAA9B;;AAIA,SACC,4BAAC,uBAAD,CAAa,gBAAb;AAA8B,IAAA,YAAY,MAA1C;AAA2C,IAAA,UAAU;AAArD,KACC,4BAAC,iBAAD;AAAM,IAAA,KAAK,EAAGG,eAAOC;AAArB,KACC,4BAAC,uBAAD,CAAa,MAAb,QACC,4BAAC,uBAAD,CAAa,MAAb,CAAoB,UAApB;AACC,IAAA,OAAO,EAAGP,UAAU,CAACQ;AADtB,IADD,EAIC,4BAAC,uBAAD,CAAa,MAAb,CAAoB,OAApB,QACGT,KADH,CAJD,CADD,EASC,4BAAC,uBAAD,6BACME,SADN;AAEC,IAAA,qBAAqB,EAAG,EACvB,GAAGE,qBADoB;AAEvBM,MAAAA,aAAa,EAAEC,IAAI,CAACC,GAAL,CACdV,SAAS,CAACW,mBADI,EAEdT,qBAAqB,CAACM,aAFR,CAFQ;;AAMvB;AACN;AACA;AACA;AACA;AACMI,MAAAA,SAAS,EAAE;AAXY;AAFzB,MAgBC,4BAAC,qCAAD;AAA0B,IAAA,UAAU,EAAG;AAAvC,KACC,4BAAC,iBAAD,QAAQf,OAAR,CADD,CAhBD,CATD,CADD,CADD;AAkCA,CA1CD;;eA4CeD,0B","sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tScrollView,\n\tStyleSheet,\n\tTouchableWithoutFeedback,\n\tView,\n} from 'react-native';\nimport { useNavigation } from '@react-navigation/native';\n\n/**\n * WordPress dependencies\n */\nimport { BottomSheet, BottomSheetContext } from '@wordpress/components';\nimport { useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\n\nconst HelpDetailNavigationScreen = ( { content, label } ) => {\n\tconst navigation = useNavigation();\n\n\tconst { listProps } = useContext( BottomSheetContext );\n\tconst contentContainerStyle = StyleSheet.flatten(\n\t\tlistProps.contentContainerStyle\n\t);\n\n\treturn (\n\t\t<BottomSheet.NavigationScreen isScrollable fullScreen>\n\t\t\t<View style={ styles.container }>\n\t\t\t\t<BottomSheet.NavBar>\n\t\t\t\t\t<BottomSheet.NavBar.BackButton\n\t\t\t\t\t\tonPress={ navigation.goBack }\n\t\t\t\t\t/>\n\t\t\t\t\t<BottomSheet.NavBar.Heading>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</BottomSheet.NavBar.Heading>\n\t\t\t\t</BottomSheet.NavBar>\n\t\t\t\t<ScrollView\n\t\t\t\t\t{ ...listProps }\n\t\t\t\t\tcontentContainerStyle={ {\n\t\t\t\t\t\t...contentContainerStyle,\n\t\t\t\t\t\tpaddingBottom: Math.max(\n\t\t\t\t\t\t\tlistProps.safeAreaBottomInset,\n\t\t\t\t\t\t\tcontentContainerStyle.paddingBottom\n\t\t\t\t\t\t),\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Remove margin set via `hideHeader`. Combining a header\n\t\t\t\t\t\t * and navigation in this bottom sheet is at odds with the\n\t\t\t\t\t\t * current `BottomSheet` implementation.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tmarginTop: 0,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<TouchableWithoutFeedback accessible={ false }>\n\t\t\t\t\t\t<View>{ content }</View>\n\t\t\t\t\t</TouchableWithoutFeedback>\n\t\t\t\t</ScrollView>\n\t\t\t</View>\n\t\t</BottomSheet.NavigationScreen>\n\t);\n};\n\nexport default HelpDetailNavigationScreen;\n"]}
|
|
@@ -26,11 +26,10 @@ var _style = _interopRequireDefault(require("./style.scss"));
|
|
|
26
26
|
/**
|
|
27
27
|
* Internal dependencies
|
|
28
28
|
*/
|
|
29
|
-
const HelpGetSupportButton =
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
} = _ref;
|
|
29
|
+
const HelpGetSupportButton = ({
|
|
30
|
+
onPress,
|
|
31
|
+
title
|
|
32
|
+
}) => {
|
|
34
33
|
const buttonStyle = (0, _compose.usePreferredColorSchemeStyle)(_style.default.button, _style.default.buttonDark);
|
|
35
34
|
const textStyle = (0, _compose.usePreferredColorSchemeStyle)(_style.default.buttonText, _style.default.buttonTextDark);
|
|
36
35
|
return (0, _element.createElement)(_reactNative.Pressable, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/editor-help/help-get-support-button.native.js"],"names":["HelpGetSupportButton","onPress","title","buttonStyle","styles","button","buttonDark","textStyle","buttonText","buttonTextDark"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AAKA;;AAbA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AAGA,MAAMA,oBAAoB,GAAG,
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/editor-help/help-get-support-button.native.js"],"names":["HelpGetSupportButton","onPress","title","buttonStyle","styles","button","buttonDark","textStyle","buttonText","buttonTextDark"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AAKA;;AAbA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AAGA,MAAMA,oBAAoB,GAAG,CAAE;AAAEC,EAAAA,OAAF;AAAWC,EAAAA;AAAX,CAAF,KAA0B;AACtD,QAAMC,WAAW,GAAG,2CACnBC,eAAOC,MADY,EAEnBD,eAAOE,UAFY,CAApB;AAKA,QAAMC,SAAS,GAAG,2CACjBH,eAAOI,UADU,EAEjBJ,eAAOK,cAFU,CAAlB;AAKA,SACC,4BAAC,sBAAD;AACC,IAAA,KAAK,EAAGN,WADT;AAEC,IAAA,OAAO,EAAGF,OAFX;AAGC,IAAA,iBAAiB,EAAG;AAHrB,KAKC,4BAAC,iBAAD;AAAM,IAAA,KAAK,EAAGM;AAAd,KAA4BL,KAA5B,CALD,CADD;AASA,CApBD;;eAsBeF,oB","sourcesContent":["/**\n * External dependencies\n */\nimport { Pressable, Text } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\n\nconst HelpGetSupportButton = ( { onPress, title } ) => {\n\tconst buttonStyle = usePreferredColorSchemeStyle(\n\t\tstyles.button,\n\t\tstyles.buttonDark\n\t);\n\n\tconst textStyle = usePreferredColorSchemeStyle(\n\t\tstyles.buttonText,\n\t\tstyles.buttonTextDark\n\t);\n\n\treturn (\n\t\t<Pressable\n\t\t\tstyle={ buttonStyle }\n\t\t\tonPress={ onPress }\n\t\t\taccessibilityRole={ 'button' }\n\t\t>\n\t\t\t<Text style={ textStyle }>{ title }</Text>\n\t\t</Pressable>\n\t);\n};\n\nexport default HelpGetSupportButton;\n"]}
|
|
@@ -26,10 +26,9 @@ var _style = _interopRequireDefault(require("./style.scss"));
|
|
|
26
26
|
/**
|
|
27
27
|
* Internal dependencies
|
|
28
28
|
*/
|
|
29
|
-
const HelpSectionTitle =
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
} = _ref;
|
|
29
|
+
const HelpSectionTitle = ({
|
|
30
|
+
children
|
|
31
|
+
}) => {
|
|
33
32
|
const helpSectionTitle = (0, _compose.usePreferredColorSchemeStyle)(_style.default.helpSectionTitle, _style.default.helpSectionTitleDark);
|
|
34
33
|
return (0, _element.createElement)(_reactNative.View, {
|
|
35
34
|
style: _style.default.helpSectionTitleContainer
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/editor-help/help-section-title.native.js"],"names":["HelpSectionTitle","children","helpSectionTitle","styles","helpSectionTitleDark","helpSectionTitleContainer"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AAKA;;AAbA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AAGA,MAAMA,gBAAgB,GAAG,
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/editor-help/help-section-title.native.js"],"names":["HelpSectionTitle","children","helpSectionTitle","styles","helpSectionTitleDark","helpSectionTitleContainer"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AAKA;;AAbA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AAGA,MAAMA,gBAAgB,GAAG,CAAE;AAAEC,EAAAA;AAAF,CAAF,KAAoB;AAC5C,QAAMC,gBAAgB,GAAG,2CACxBC,eAAOD,gBADiB,EAExBC,eAAOC,oBAFiB,CAAzB;AAKA,SACC,4BAAC,iBAAD;AAAM,IAAA,KAAK,EAAGD,eAAOE;AAArB,KACC,4BAAC,iBAAD;AAAM,IAAA,KAAK,EAAGH;AAAd,KAAmCD,QAAnC,CADD,CADD;AAKA,CAXD;;eAaeD,gB","sourcesContent":["/**\n * External dependencies\n */\nimport { Text, View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\n\nconst HelpSectionTitle = ( { children } ) => {\n\tconst helpSectionTitle = usePreferredColorSchemeStyle(\n\t\tstyles.helpSectionTitle,\n\t\tstyles.helpSectionTitleDark\n\t);\n\n\treturn (\n\t\t<View style={ styles.helpSectionTitleContainer }>\n\t\t\t<Text style={ helpSectionTitle }>{ children }</Text>\n\t\t</View>\n\t);\n};\n\nexport default HelpSectionTitle;\n"]}
|
|
@@ -20,13 +20,12 @@ var _icons = require("@wordpress/icons");
|
|
|
20
20
|
/**
|
|
21
21
|
* WordPress dependencies
|
|
22
22
|
*/
|
|
23
|
-
const HelpTopicRow =
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
} = _ref;
|
|
23
|
+
const HelpTopicRow = ({
|
|
24
|
+
label,
|
|
25
|
+
icon,
|
|
26
|
+
screenName,
|
|
27
|
+
isLastItem
|
|
28
|
+
}) => {
|
|
30
29
|
const navigation = (0, _native.useNavigation)();
|
|
31
30
|
|
|
32
31
|
const openSubSheet = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/editor-help/help-topic-row.native.js"],"names":["HelpTopicRow","label","icon","screenName","isLastItem","navigation","openSubSheet","navigate","chevronRight"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AATA;AACA;AACA;;AAGA;AACA;AACA;AAIA,MAAMA,YAAY,GAAG,
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/editor-help/help-topic-row.native.js"],"names":["HelpTopicRow","label","icon","screenName","isLastItem","navigation","openSubSheet","navigate","chevronRight"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AATA;AACA;AACA;;AAGA;AACA;AACA;AAIA,MAAMA,YAAY,GAAG,CAAE;AAAEC,EAAAA,KAAF;AAASC,EAAAA,IAAT;AAAeC,EAAAA,UAAf;AAA2BC,EAAAA;AAA3B,CAAF,KAA+C;AACnE,QAAMC,UAAU,GAAG,4BAAnB;;AAEA,QAAMC,YAAY,GAAG,MAAM;AAC1BD,IAAAA,UAAU,CAACE,QAAX,CAAqBJ,UAArB;AACA,GAFD;;AAIA,SACC,4BAAC,uBAAD;AACC,IAAA,aAAa,EAAGC,UAAU,GAAG,MAAH,GAAY,YADvC;AAEC,IAAA,kBAAkB,MAFnB;AAGC,IAAA,SAAS,MAHV;AAIC,IAAA,OAAO,EAAGE,YAJX;AAKC,IAAA,KAAK,EAAGL,KALT;AAMC,IAAA,IAAI,EAAGC;AANR,KAQC,4BAAC,gBAAD;AAAM,IAAA,IAAI,EAAGM;AAAb,IARD,CADD;AAYA,CAnBD;;eAqBeR,Y","sourcesContent":["/**\n * External dependencies\n */\nimport { useNavigation } from '@react-navigation/native';\n\n/**\n * WordPress dependencies\n */\nimport { TextControl, Icon } from '@wordpress/components';\nimport { chevronRight } from '@wordpress/icons';\n\nconst HelpTopicRow = ( { label, icon, screenName, isLastItem } ) => {\n\tconst navigation = useNavigation();\n\n\tconst openSubSheet = () => {\n\t\tnavigation.navigate( screenName );\n\t};\n\n\treturn (\n\t\t<TextControl\n\t\t\tseparatorType={ isLastItem ? 'none' : 'leftMargin' }\n\t\t\tcustomActionButton\n\t\t\tleftAlign\n\t\t\tonPress={ openSubSheet }\n\t\t\tlabel={ label }\n\t\t\ticon={ icon }\n\t\t>\n\t\t\t<Icon icon={ chevronRight } />\n\t\t</TextControl>\n\t);\n};\n\nexport default HelpTopicRow;\n"]}
|
|
@@ -87,13 +87,12 @@ const HELP_TOPICS = [{
|
|
|
87
87
|
view: (0, _element.createElement)(_customizeBlocks.default, null)
|
|
88
88
|
}];
|
|
89
89
|
|
|
90
|
-
function EditorHelpTopics(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
} = _ref;
|
|
90
|
+
function EditorHelpTopics({
|
|
91
|
+
close,
|
|
92
|
+
isVisible,
|
|
93
|
+
onClose,
|
|
94
|
+
showSupport
|
|
95
|
+
}) {
|
|
97
96
|
const {
|
|
98
97
|
postType
|
|
99
98
|
} = (0, _data.useSelect)(select => ({
|
|
@@ -127,11 +126,9 @@ function EditorHelpTopics(_ref) {
|
|
|
127
126
|
}, (0, _element.createElement)(_components.BottomSheet.NavBar, null, (0, _element.createElement)(_components.BottomSheet.NavBar.DismissButton, {
|
|
128
127
|
onPress: close,
|
|
129
128
|
iosText: (0, _i18n.__)('Close')
|
|
130
|
-
}), (0, _element.createElement)(_components.BottomSheet.NavBar.Heading, null, title)), (0, _element.createElement)(_components.BottomSheetConsumer, null,
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
} = _ref2;
|
|
134
|
-
|
|
129
|
+
}), (0, _element.createElement)(_components.BottomSheet.NavBar.Heading, null, title)), (0, _element.createElement)(_components.BottomSheetConsumer, null, ({
|
|
130
|
+
listProps
|
|
131
|
+
}) => {
|
|
135
132
|
const contentContainerStyle = _reactNative.StyleSheet.flatten(listProps.contentContainerStyle);
|
|
136
133
|
|
|
137
134
|
return (0, _element.createElement)(_reactNative.ScrollView, (0, _extends2.default)({}, listProps, {
|
|
@@ -145,12 +142,11 @@ function EditorHelpTopics(_ref) {
|
|
|
145
142
|
*/
|
|
146
143
|
marginTop: 0
|
|
147
144
|
}
|
|
148
|
-
}), (0, _element.createElement)(_components.PanelBody, null, (0, _element.createElement)(_helpSectionTitle.default, null, (0, _i18n.__)('The basics')), HELP_TOPICS.map((
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
} = _ref3;
|
|
145
|
+
}), (0, _element.createElement)(_components.PanelBody, null, (0, _element.createElement)(_helpSectionTitle.default, null, (0, _i18n.__)('The basics')), HELP_TOPICS.map(({
|
|
146
|
+
label,
|
|
147
|
+
icon,
|
|
148
|
+
slug
|
|
149
|
+
}, index) => {
|
|
154
150
|
const isLastItem = index === HELP_TOPICS.length - 1;
|
|
155
151
|
return (0, _element.createElement)(_helpTopicRow.default, {
|
|
156
152
|
key: slug,
|
|
@@ -160,12 +156,11 @@ function EditorHelpTopics(_ref) {
|
|
|
160
156
|
isLastItem: isLastItem
|
|
161
157
|
});
|
|
162
158
|
}), showSupport && supportSection));
|
|
163
|
-
}))), HELP_TOPICS.map(
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
} = _ref4;
|
|
159
|
+
}))), HELP_TOPICS.map(({
|
|
160
|
+
view,
|
|
161
|
+
label,
|
|
162
|
+
slug
|
|
163
|
+
}) => {
|
|
169
164
|
return (0, _element.createElement)(_helpDetailNavigationScreen.default, {
|
|
170
165
|
key: slug,
|
|
171
166
|
name: slug,
|