@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/editor-help/index.native.js"],"names":["HELP_TOPICS","label","slug","icon","helpFilled","view","plusCircleFilled","moveBlocksIcon","trash","cog","EditorHelpTopics","close","isVisible","onClose","showSupport","postType","select","editorStore","getEditedPostAttribute","title","supportSection","requestContactCustomerSupport","requestGotoCustomerSupportOptions","styles","contentContainer","navigationContainer","container","listProps","contentContainerStyle","StyleSheet","flatten","paddingBottom","Math","max","safeAreaBottomInset","marginTop","map","index","isLastItem","length","gestureEnabled","TransitionPresets","DefaultTransition"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AAKA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAQA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AApCA;AACA;AACA;;AAIA;AACA;AACA;;AAeA;AACA;AACA;AAaA,MAAMA,WAAW,GAAG,CACnB;AACCC,EAAAA,KAAK,EAAE,cAAI,kBAAJ,CADR;AAECC,EAAAA,IAAI,EAAE,iBAFP;AAGCC,EAAAA,IAAI,EAAEC,iBAHP;AAICC,EAAAA,IAAI,EAAE,4BAAC,sBAAD;AAJP,CADmB,EAOnB;AACCJ,EAAAA,KAAK,EAAE,cAAI,YAAJ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AFzB,QAgBC,4BAAC,qBAAD,QACC,4BAAC,yBAAD,QACG,cAAI,YAAJ,CADH,CADD,EAKGnC,WAAW,CAACoC,GAAZ,CACD,QAECC,KAFD,KAGK;AAAA,UAFJ;AAAEpC,QAAAA,KAAF;AAASE,QAAAA,IAAT;AAAeD,QAAAA;AAAf,OAEI;AACJ,YAAMoC,UAAU,GACfD,KAAK,KACLrC,WAAW,CAACuC,MAAZ,GACC,CAHF;AAIA,aACC,4BAAC,qBAAD;AACC,QAAA,GAAG,EAAGrC,IADP;AAEC,QAAA,KAAK,EAAGD,KAFT;AAGC,QAAA,IAAI,EAAGE,IAHR;AAIC,QAAA,UAAU,EACTD,IALF;AAOC,QAAA,UAAU,EACToC;AARF,QADD;AAaA,KAtBA,CALH,EA6BGxB,WAAW,IACZM,cA9BF,CAhBD,CADD;AAmDA,GAzDF,CAVD,CALD,CALD,EAkFGpB,WAAW,CAACoC,GAAZ,CAAiB,SAA6B;AAAA,QAA3B;AAAE/B,MAAAA,IAAF;AAAQJ,MAAAA,KAAR;AAAeC,MAAAA;AAAf,KAA2B;AAC/C,WACC,4BAAC,mCAAD;AACC,MAAA,GAAG,EAAGA,IADP;AAEC,MAAA,IAAI,EAAGA,IAFR;AAGC,MAAA,OAAO,EAAGG,IAHX;AAIC,MAAA,KAAK,EAAGJ,KAJT;AAKC,MAAA,OAAO,EAAG;AACTuC,QAAAA,cAAc,EAAE,KADP;AAET,WAAGC,yBAAkBC;AAFZ;AALX,MADD;AAYA,GAbC,CAlFH,CADD,CARD,CADD;AA8GA;;eAEchC,gB","sourcesContent":["/**\n * External dependencies\n */\nimport { SafeAreaView, ScrollView, StyleSheet, View } from 'react-native';\nimport { TransitionPresets } from '@react-navigation/stack';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tBottomSheet,\n\tBottomSheetConsumer,\n\tPanelBody,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { helpFilled, plusCircleFilled, trash, cog } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport {\n\trequestContactCustomerSupport,\n\trequestGotoCustomerSupportOptions,\n} from '@wordpress/react-native-bridge';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\nimport HelpDetailNavigationScreen from './help-detail-navigation-screen';\nimport HelpTopicRow from './help-topic-row';\nimport HelpGetSupportButton from './help-get-support-button';\nimport IntroToBlocks from './intro-to-blocks';\nimport AddBlocks from './add-blocks';\nimport MoveBlocks from './move-blocks';\nimport RemoveBlocks from './remove-blocks';\nimport CustomizeBlocks from './customize-blocks';\nimport moveBlocksIcon from './icon-move-blocks';\nimport HelpSectionTitle from './help-section-title';\n\nconst HELP_TOPICS = [\n\t{\n\t\tlabel: __( 'What is a block?' ),\n\t\tslug: 'what-is-a-block',\n\t\ticon: helpFilled,\n\t\tview: <IntroToBlocks />,\n\t},\n\t{\n\t\tlabel: __( 'Add blocks' ),\n\t\tslug: 'add-blocks',\n\t\ticon: plusCircleFilled,\n\t\tview: <AddBlocks />,\n\t},\n\t{\n\t\tlabel: __( 'Move blocks' ),\n\t\tslug: 'move-blocks',\n\t\ticon: moveBlocksIcon,\n\t\tview: <MoveBlocks />,\n\t},\n\t{\n\t\tlabel: __( 'Remove blocks' ),\n\t\tslug: 'remove-blocks',\n\t\ticon: trash,\n\t\tview: <RemoveBlocks />,\n\t},\n\t{\n\t\tlabel: __( 'Customize blocks' ),\n\t\tslug: 'customize-blocks',\n\t\ticon: cog,\n\t\tview: <CustomizeBlocks />,\n\t},\n];\n\nfunction EditorHelpTopics( { close, isVisible, onClose, showSupport } ) {\n\tconst { postType } = useSelect( ( select ) => ( {\n\t\tpostType: select( editorStore ).getEditedPostAttribute( 'type' ),\n\t} ) );\n\n\tconst title =\n\t\tpostType === 'page'\n\t\t\t? __( 'How to edit your page' )\n\t\t\t: __( 'How to edit your post' );\n\n\tconst supportSection = (\n\t\t<>\n\t\t\t<HelpSectionTitle>{ __( 'Get support' ) }</HelpSectionTitle>\n\t\t\t<HelpGetSupportButton\n\t\t\t\ttitle={ __( 'Contact support' ) }\n\t\t\t\tonPress={ requestContactCustomerSupport }\n\t\t\t/>\n\t\t\t<HelpGetSupportButton\n\t\t\t\ttitle={ __( 'More support options' ) }\n\t\t\t\tonPress={ requestGotoCustomerSupportOptions }\n\t\t\t/>\n\t\t</>\n\t);\n\n\treturn (\n\t\t<BottomSheet\n\t\t\tisVisible={ isVisible }\n\t\t\tonClose={ onClose }\n\t\t\thideHeader\n\t\t\thasNavigation\n\t\t\tcontentStyle={ styles.contentContainer }\n\t\t\ttestID=\"editor-help-modal\"\n\t\t>\n\t\t\t<SafeAreaView>\n\t\t\t\t<BottomSheet.NavigationContainer\n\t\t\t\t\tanimate\n\t\t\t\t\tmain\n\t\t\t\t\tstyle={ styles.navigationContainer }\n\t\t\t\t>\n\t\t\t\t\t<BottomSheet.NavigationScreen\n\t\t\t\t\t\tisScrollable\n\t\t\t\t\t\tfullScreen\n\t\t\t\t\t\tname=\"help-topics\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<View style={ styles.container }>\n\t\t\t\t\t\t\t<BottomSheet.NavBar>\n\t\t\t\t\t\t\t\t<BottomSheet.NavBar.DismissButton\n\t\t\t\t\t\t\t\t\tonPress={ close }\n\t\t\t\t\t\t\t\t\tiosText={ __( 'Close' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<BottomSheet.NavBar.Heading>\n\t\t\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t\t\t</BottomSheet.NavBar.Heading>\n\t\t\t\t\t\t\t</BottomSheet.NavBar>\n\t\t\t\t\t\t\t<BottomSheetConsumer>\n\t\t\t\t\t\t\t\t{ ( { listProps } ) => {\n\t\t\t\t\t\t\t\t\tconst contentContainerStyle =\n\t\t\t\t\t\t\t\t\t\tStyleSheet.flatten(\n\t\t\t\t\t\t\t\t\t\t\tlistProps.contentContainerStyle\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t<ScrollView\n\t\t\t\t\t\t\t\t\t\t\t{ ...listProps }\n\t\t\t\t\t\t\t\t\t\t\tcontentContainerStyle={ {\n\t\t\t\t\t\t\t\t\t\t\t\t...contentContainerStyle,\n\t\t\t\t\t\t\t\t\t\t\t\tpaddingBottom: Math.max(\n\t\t\t\t\t\t\t\t\t\t\t\t\tlistProps.safeAreaBottomInset,\n\t\t\t\t\t\t\t\t\t\t\t\t\tcontentContainerStyle.paddingBottom\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t\t\t\t\t * Remove margin set via `hideHeader`. Combining a header\n\t\t\t\t\t\t\t\t\t\t\t\t * and navigation in this bottom sheet is at odds with the\n\t\t\t\t\t\t\t\t\t\t\t\t * current `BottomSheet` implementation.\n\t\t\t\t\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\t\t\t\t\tmarginTop: 0,\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<PanelBody>\n\t\t\t\t\t\t\t\t\t\t\t\t<HelpSectionTitle>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'The basics' ) }\n\t\t\t\t\t\t\t\t\t\t\t\t</HelpSectionTitle>\n\t\t\t\t\t\t\t\t\t\t\t\t{ /* Print out help topics. */ }\n\t\t\t\t\t\t\t\t\t\t\t\t{ HELP_TOPICS.map(\n\t\t\t\t\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{ label, icon, slug },\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tindex\n\t\t\t\t\t\t\t\t\t\t\t\t\t) => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst isLastItem =\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tindex ===\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tHELP_TOPICS.length -\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<HelpTopicRow\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tkey={ slug }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tscreenName={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tslug\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tisLastItem={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tisLastItem\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t{ showSupport &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tsupportSection }\n\t\t\t\t\t\t\t\t\t\t\t</PanelBody>\n\t\t\t\t\t\t\t\t\t\t</ScrollView>\n\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</BottomSheetConsumer>\n\t\t\t\t\t\t</View>\n\t\t\t\t\t</BottomSheet.NavigationScreen>\n\t\t\t\t\t{ /* Print out help detail screens. */ }\n\t\t\t\t\t{ HELP_TOPICS.map( ( { view, label, slug } ) => {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<HelpDetailNavigationScreen\n\t\t\t\t\t\t\t\tkey={ slug }\n\t\t\t\t\t\t\t\tname={ slug }\n\t\t\t\t\t\t\t\tcontent={ view }\n\t\t\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\t\t\toptions={ {\n\t\t\t\t\t\t\t\t\tgestureEnabled: false,\n\t\t\t\t\t\t\t\t\t...TransitionPresets.DefaultTransition,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t);\n\t\t\t\t\t} ) }\n\t\t\t\t</BottomSheet.NavigationContainer>\n\t\t\t</SafeAreaView>\n\t\t</BottomSheet>\n\t);\n}\n\nexport default EditorHelpTopics;\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/editor-help/index.native.js"],"names":["HELP_TOPICS","label","slug","icon","helpFilled","view","plusCircleFilled","moveBlocksIcon","trash","cog","EditorHelpTopics","close","isVisible","onClose","showSupport","postType","select","editorStore","getEditedPostAttribute","title","supportSection","requestContactCustomerSupport","requestGotoCustomerSupportOptions","styles","contentContainer","navigationContainer","container","listProps","contentContainerStyle","StyleSheet","flatten","paddingBottom","Math","max","safeAreaBottomInset","marginTop","map","index","isLastItem","length","gestureEnabled","TransitionPresets","DefaultTransition"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AAKA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAQA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AApCA;AACA;AACA;;AAIA;AACA;AACA;;AAeA;AACA;AACA;AAaA,MAAMA,WAAW,GAAG,CACnB;AACCC,EAAAA,KAAK,EAAE,cAAI,kBAAJ,CADR;AAECC,EAAAA,IAAI,EAAE,iBAFP;AAGCC,EAAAA,IAAI,EAAEC,iBAHP;AAICC,EAAAA,IAAI,EAAE,4BAAC,sBAAD;AAJP,CADmB,EAOnB;AACCJ,EAAAA,KAAK,EAAE,cAAI,YAAJ,CADR;AAECC,EAAAA,IAAI,EAAE,YAFP;AAGCC,EAAAA,IAAI,EAAEG,uBAHP;AAICD,EAAAA,IAAI,EAAE,4BAAC,kB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AAA,KAAF;AAASE,MAAAA,IAAT;AAAeD,MAAAA;AAAf,KADD,EAECmC,KAFD,KAGK;AACJ,YAAMC,UAAU,GACfD,KAAK,KACLrC,WAAW,CAACuC,MAAZ,GACC,CAHF;AAIA,aACC,4BAAC,qBAAD;AACC,QAAA,GAAG,EAAGrC,IADP;AAEC,QAAA,KAAK,EAAGD,KAFT;AAGC,QAAA,IAAI,EAAGE,IAHR;AAIC,QAAA,UAAU,EACTD,IALF;AAOC,QAAA,UAAU,EACToC;AARF,QADD;AAaA,KAtBA,CALH,EA6BGxB,WAAW,IACZM,cA9BF,CAhBD,CADD;AAmDA,GAzDF,CAVD,CALD,CALD,EAkFGpB,WAAW,CAACoC,GAAZ,CAAiB,CAAE;AAAE/B,IAAAA,IAAF;AAAQJ,IAAAA,KAAR;AAAeC,IAAAA;AAAf,GAAF,KAA6B;AAC/C,WACC,4BAAC,mCAAD;AACC,MAAA,GAAG,EAAGA,IADP;AAEC,MAAA,IAAI,EAAGA,IAFR;AAGC,MAAA,OAAO,EAAGG,IAHX;AAIC,MAAA,KAAK,EAAGJ,KAJT;AAKC,MAAA,OAAO,EAAG;AACTuC,QAAAA,cAAc,EAAE,KADP;AAET,WAAGC,yBAAkBC;AAFZ;AALX,MADD;AAYA,GAbC,CAlFH,CADD,CARD,CADD;AA8GA;;eAEchC,gB","sourcesContent":["/**\n * External dependencies\n */\nimport { SafeAreaView, ScrollView, StyleSheet, View } from 'react-native';\nimport { TransitionPresets } from '@react-navigation/stack';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tBottomSheet,\n\tBottomSheetConsumer,\n\tPanelBody,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { helpFilled, plusCircleFilled, trash, cog } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport {\n\trequestContactCustomerSupport,\n\trequestGotoCustomerSupportOptions,\n} from '@wordpress/react-native-bridge';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\nimport HelpDetailNavigationScreen from './help-detail-navigation-screen';\nimport HelpTopicRow from './help-topic-row';\nimport HelpGetSupportButton from './help-get-support-button';\nimport IntroToBlocks from './intro-to-blocks';\nimport AddBlocks from './add-blocks';\nimport MoveBlocks from './move-blocks';\nimport RemoveBlocks from './remove-blocks';\nimport CustomizeBlocks from './customize-blocks';\nimport moveBlocksIcon from './icon-move-blocks';\nimport HelpSectionTitle from './help-section-title';\n\nconst HELP_TOPICS = [\n\t{\n\t\tlabel: __( 'What is a block?' ),\n\t\tslug: 'what-is-a-block',\n\t\ticon: helpFilled,\n\t\tview: <IntroToBlocks />,\n\t},\n\t{\n\t\tlabel: __( 'Add blocks' ),\n\t\tslug: 'add-blocks',\n\t\ticon: plusCircleFilled,\n\t\tview: <AddBlocks />,\n\t},\n\t{\n\t\tlabel: __( 'Move blocks' ),\n\t\tslug: 'move-blocks',\n\t\ticon: moveBlocksIcon,\n\t\tview: <MoveBlocks />,\n\t},\n\t{\n\t\tlabel: __( 'Remove blocks' ),\n\t\tslug: 'remove-blocks',\n\t\ticon: trash,\n\t\tview: <RemoveBlocks />,\n\t},\n\t{\n\t\tlabel: __( 'Customize blocks' ),\n\t\tslug: 'customize-blocks',\n\t\ticon: cog,\n\t\tview: <CustomizeBlocks />,\n\t},\n];\n\nfunction EditorHelpTopics( { close, isVisible, onClose, showSupport } ) {\n\tconst { postType } = useSelect( ( select ) => ( {\n\t\tpostType: select( editorStore ).getEditedPostAttribute( 'type' ),\n\t} ) );\n\n\tconst title =\n\t\tpostType === 'page'\n\t\t\t? __( 'How to edit your page' )\n\t\t\t: __( 'How to edit your post' );\n\n\tconst supportSection = (\n\t\t<>\n\t\t\t<HelpSectionTitle>{ __( 'Get support' ) }</HelpSectionTitle>\n\t\t\t<HelpGetSupportButton\n\t\t\t\ttitle={ __( 'Contact support' ) }\n\t\t\t\tonPress={ requestContactCustomerSupport }\n\t\t\t/>\n\t\t\t<HelpGetSupportButton\n\t\t\t\ttitle={ __( 'More support options' ) }\n\t\t\t\tonPress={ requestGotoCustomerSupportOptions }\n\t\t\t/>\n\t\t</>\n\t);\n\n\treturn (\n\t\t<BottomSheet\n\t\t\tisVisible={ isVisible }\n\t\t\tonClose={ onClose }\n\t\t\thideHeader\n\t\t\thasNavigation\n\t\t\tcontentStyle={ styles.contentContainer }\n\t\t\ttestID=\"editor-help-modal\"\n\t\t>\n\t\t\t<SafeAreaView>\n\t\t\t\t<BottomSheet.NavigationContainer\n\t\t\t\t\tanimate\n\t\t\t\t\tmain\n\t\t\t\t\tstyle={ styles.navigationContainer }\n\t\t\t\t>\n\t\t\t\t\t<BottomSheet.NavigationScreen\n\t\t\t\t\t\tisScrollable\n\t\t\t\t\t\tfullScreen\n\t\t\t\t\t\tname=\"help-topics\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<View style={ styles.container }>\n\t\t\t\t\t\t\t<BottomSheet.NavBar>\n\t\t\t\t\t\t\t\t<BottomSheet.NavBar.DismissButton\n\t\t\t\t\t\t\t\t\tonPress={ close }\n\t\t\t\t\t\t\t\t\tiosText={ __( 'Close' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<BottomSheet.NavBar.Heading>\n\t\t\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t\t\t</BottomSheet.NavBar.Heading>\n\t\t\t\t\t\t\t</BottomSheet.NavBar>\n\t\t\t\t\t\t\t<BottomSheetConsumer>\n\t\t\t\t\t\t\t\t{ ( { listProps } ) => {\n\t\t\t\t\t\t\t\t\tconst contentContainerStyle =\n\t\t\t\t\t\t\t\t\t\tStyleSheet.flatten(\n\t\t\t\t\t\t\t\t\t\t\tlistProps.contentContainerStyle\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t<ScrollView\n\t\t\t\t\t\t\t\t\t\t\t{ ...listProps }\n\t\t\t\t\t\t\t\t\t\t\tcontentContainerStyle={ {\n\t\t\t\t\t\t\t\t\t\t\t\t...contentContainerStyle,\n\t\t\t\t\t\t\t\t\t\t\t\tpaddingBottom: Math.max(\n\t\t\t\t\t\t\t\t\t\t\t\t\tlistProps.safeAreaBottomInset,\n\t\t\t\t\t\t\t\t\t\t\t\t\tcontentContainerStyle.paddingBottom\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t\t\t\t\t * Remove margin set via `hideHeader`. Combining a header\n\t\t\t\t\t\t\t\t\t\t\t\t * and navigation in this bottom sheet is at odds with the\n\t\t\t\t\t\t\t\t\t\t\t\t * current `BottomSheet` implementation.\n\t\t\t\t\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\t\t\t\t\tmarginTop: 0,\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<PanelBody>\n\t\t\t\t\t\t\t\t\t\t\t\t<HelpSectionTitle>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'The basics' ) }\n\t\t\t\t\t\t\t\t\t\t\t\t</HelpSectionTitle>\n\t\t\t\t\t\t\t\t\t\t\t\t{ /* Print out help topics. */ }\n\t\t\t\t\t\t\t\t\t\t\t\t{ HELP_TOPICS.map(\n\t\t\t\t\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{ label, icon, slug },\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tindex\n\t\t\t\t\t\t\t\t\t\t\t\t\t) => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst isLastItem =\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tindex ===\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tHELP_TOPICS.length -\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<HelpTopicRow\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tkey={ slug }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tscreenName={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tslug\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tisLastItem={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tisLastItem\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t{ showSupport &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tsupportSection }\n\t\t\t\t\t\t\t\t\t\t\t</PanelBody>\n\t\t\t\t\t\t\t\t\t\t</ScrollView>\n\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</BottomSheetConsumer>\n\t\t\t\t\t\t</View>\n\t\t\t\t\t</BottomSheet.NavigationScreen>\n\t\t\t\t\t{ /* Print out help detail screens. */ }\n\t\t\t\t\t{ HELP_TOPICS.map( ( { view, label, slug } ) => {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<HelpDetailNavigationScreen\n\t\t\t\t\t\t\t\tkey={ slug }\n\t\t\t\t\t\t\t\tname={ slug }\n\t\t\t\t\t\t\t\tcontent={ view }\n\t\t\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\t\t\toptions={ {\n\t\t\t\t\t\t\t\t\tgestureEnabled: false,\n\t\t\t\t\t\t\t\t\t...TransitionPresets.DefaultTransition,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t);\n\t\t\t\t\t} ) }\n\t\t\t\t</BottomSheet.NavigationContainer>\n\t\t\t</SafeAreaView>\n\t\t</BottomSheet>\n\t);\n}\n\nexport default EditorHelpTopics;\n"]}
|
|
@@ -26,10 +26,9 @@ var _style = _interopRequireDefault(require("./style.scss"));
|
|
|
26
26
|
/**
|
|
27
27
|
* Internal dependencies
|
|
28
28
|
*/
|
|
29
|
-
const HelpDetailBodyText =
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
} = _ref;
|
|
29
|
+
const HelpDetailBodyText = ({
|
|
30
|
+
text
|
|
31
|
+
}) => {
|
|
33
32
|
const bodyStyle = (0, _compose.usePreferredColorSchemeStyle)(_style.default.helpDetailBody, _style.default.helpDetailBodyDark);
|
|
34
33
|
return (0, _element.createElement)(_reactNative.Text, {
|
|
35
34
|
selectable: true,
|
|
@@ -39,11 +38,10 @@ const HelpDetailBodyText = _ref => {
|
|
|
39
38
|
|
|
40
39
|
exports.HelpDetailBodyText = HelpDetailBodyText;
|
|
41
40
|
|
|
42
|
-
const HelpDetailSectionHeadingText =
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
} = _ref2;
|
|
41
|
+
const HelpDetailSectionHeadingText = ({
|
|
42
|
+
text,
|
|
43
|
+
badge
|
|
44
|
+
}) => {
|
|
47
45
|
const headingTextStyle = (0, _compose.usePreferredColorSchemeStyle)(_style.default.helpDetailSectionHeadingText, _style.default.helpDetailSectionHeadingTextDark);
|
|
48
46
|
return (0, _element.createElement)(_reactNative.View, {
|
|
49
47
|
style: _style.default.helpDetailSectionHeading
|
|
@@ -58,13 +56,12 @@ const HelpDetailSectionHeadingText = _ref2 => {
|
|
|
58
56
|
|
|
59
57
|
exports.HelpDetailSectionHeadingText = HelpDetailSectionHeadingText;
|
|
60
58
|
|
|
61
|
-
const HelpDetailImage =
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
} = _ref3;
|
|
59
|
+
const HelpDetailImage = ({
|
|
60
|
+
accessible,
|
|
61
|
+
accessibilityLabel,
|
|
62
|
+
source,
|
|
63
|
+
sourceDarkMode
|
|
64
|
+
}) => {
|
|
68
65
|
const imageStyle = (0, _compose.usePreferredColorSchemeStyle)(_style.default.helpDetailImage, _style.default.helpDetailImageDark);
|
|
69
66
|
const darkModeEnabled = (0, _compose.usePreferredColorScheme)() === 'dark';
|
|
70
67
|
return (0, _element.createElement)(_reactNative.Image, {
|
|
@@ -77,10 +74,9 @@ const HelpDetailImage = _ref3 => {
|
|
|
77
74
|
|
|
78
75
|
exports.HelpDetailImage = HelpDetailImage;
|
|
79
76
|
|
|
80
|
-
const HelpDetailBadge =
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
} = _ref4;
|
|
77
|
+
const HelpDetailBadge = ({
|
|
78
|
+
text
|
|
79
|
+
}) => {
|
|
84
80
|
return (0, _element.createElement)(_reactNative.View, {
|
|
85
81
|
style: _style.default.helpDetailBadgeContainer
|
|
86
82
|
}, (0, _element.createElement)(_reactNative.Text, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/editor-help/view-sections.native.js"],"names":["HelpDetailBodyText","text","bodyStyle","styles","helpDetailBody","helpDetailBodyDark","HelpDetailSectionHeadingText","badge","headingTextStyle","helpDetailSectionHeadingText","helpDetailSectionHeadingTextDark","helpDetailSectionHeading","HelpDetailImage","accessible","accessibilityLabel","source","sourceDarkMode","imageStyle","helpDetailImage","helpDetailImageDark","darkModeEnabled","HelpDetailBadge","helpDetailBadgeContainer","helpDetailBadgeText"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AAQA;;AAhBA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;AAGO,MAAMA,kBAAkB,GAAG,
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/editor-help/view-sections.native.js"],"names":["HelpDetailBodyText","text","bodyStyle","styles","helpDetailBody","helpDetailBodyDark","HelpDetailSectionHeadingText","badge","headingTextStyle","helpDetailSectionHeadingText","helpDetailSectionHeadingTextDark","helpDetailSectionHeading","HelpDetailImage","accessible","accessibilityLabel","source","sourceDarkMode","imageStyle","helpDetailImage","helpDetailImageDark","darkModeEnabled","HelpDetailBadge","helpDetailBadgeContainer","helpDetailBadgeText"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AAQA;;AAhBA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;AAGO,MAAMA,kBAAkB,GAAG,CAAE;AAAEC,EAAAA;AAAF,CAAF,KAAgB;AACjD,QAAMC,SAAS,GAAG,2CACjBC,eAAOC,cADU,EAEjBD,eAAOE,kBAFU,CAAlB;AAIA,SACC,4BAAC,iBAAD;AAAM,IAAA,UAAU,MAAhB;AAAiB,IAAA,KAAK,EAAGH;AAAzB,KACGD,IADH,CADD;AAKA,CAVM;;;;AAYA,MAAMK,4BAA4B,GAAG,CAAE;AAAEL,EAAAA,IAAF;AAAQM,EAAAA;AAAR,CAAF,KAAuB;AAClE,QAAMC,gBAAgB,GAAG,2CACxBL,eAAOM,4BADiB,EAExBN,eAAOO,gCAFiB,CAAzB;AAIA,SACC,4BAAC,iBAAD;AAAM,IAAA,KAAK,EAAGP,eAAOQ;AAArB,KACGJ,KAAK,IAAI,4BAAC,eAAD;AAAiB,IAAA,IAAI,EAAGA;AAAxB,IADZ,EAEC,4BAAC,iBAAD;AACC,IAAA,iBAAiB,EAAC,QADnB;AAEC,IAAA,UAAU,MAFX;AAGC,IAAA,KAAK,EAAGC;AAHT,KAKGP,IALH,CAFD,CADD;AAYA,CAjBM;;;;AAmBA,MAAMW,eAAe,GAAG,CAAE;AAChCC,EAAAA,UADgC;AAEhCC,EAAAA,kBAFgC;AAGhCC,EAAAA,MAHgC;AAIhCC,EAAAA;AAJgC,CAAF,KAKxB;AACN,QAAMC,UAAU,GAAG,2CAClBd,eAAOe,eADW,EAElBf,eAAOgB,mBAFW,CAAnB;AAIA,QAAMC,eAAe,GAAG,4CAA8B,MAAtD;AACA,SACC,4BAAC,kBAAD;AACC,IAAA,UAAU,EAAGP,UADd;AAEC,IAAA,kBAAkB,EAAGC,kBAFtB;AAGC,IAAA,MAAM,EACLM,eAAe,IAAIJ,cAAnB,GAAoCA,cAApC,GAAqDD,MAJvD;AAMC,IAAA,KAAK,EAAGE;AANT,IADD;AAUA,CArBM;;;;AAuBP,MAAMI,eAAe,GAAG,CAAE;AAAEpB,EAAAA;AAAF,CAAF,KAAgB;AACvC,SACC,4BAAC,iBAAD;AAAM,IAAA,KAAK,EAAGE,eAAOmB;AAArB,KACC,4BAAC,iBAAD;AAAM,IAAA,KAAK,EAAGnB,eAAOoB;AAArB,KAA6CtB,IAA7C,CADD,CADD;AAKA,CAND","sourcesContent":["/**\n * External dependencies\n */\nimport { Text, Image, View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tusePreferredColorScheme,\n\tusePreferredColorSchemeStyle,\n} from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\n\nexport const HelpDetailBodyText = ( { text } ) => {\n\tconst bodyStyle = usePreferredColorSchemeStyle(\n\t\tstyles.helpDetailBody,\n\t\tstyles.helpDetailBodyDark\n\t);\n\treturn (\n\t\t<Text selectable style={ bodyStyle }>\n\t\t\t{ text }\n\t\t</Text>\n\t);\n};\n\nexport const HelpDetailSectionHeadingText = ( { text, badge } ) => {\n\tconst headingTextStyle = usePreferredColorSchemeStyle(\n\t\tstyles.helpDetailSectionHeadingText,\n\t\tstyles.helpDetailSectionHeadingTextDark\n\t);\n\treturn (\n\t\t<View style={ styles.helpDetailSectionHeading }>\n\t\t\t{ badge && <HelpDetailBadge text={ badge } /> }\n\t\t\t<Text\n\t\t\t\taccessibilityRole=\"header\"\n\t\t\t\tselectable\n\t\t\t\tstyle={ headingTextStyle }\n\t\t\t>\n\t\t\t\t{ text }\n\t\t\t</Text>\n\t\t</View>\n\t);\n};\n\nexport const HelpDetailImage = ( {\n\taccessible,\n\taccessibilityLabel,\n\tsource,\n\tsourceDarkMode,\n} ) => {\n\tconst imageStyle = usePreferredColorSchemeStyle(\n\t\tstyles.helpDetailImage,\n\t\tstyles.helpDetailImageDark\n\t);\n\tconst darkModeEnabled = usePreferredColorScheme() === 'dark';\n\treturn (\n\t\t<Image\n\t\t\taccessible={ accessible }\n\t\t\taccessibilityLabel={ accessibilityLabel }\n\t\t\tsource={\n\t\t\t\tdarkModeEnabled && sourceDarkMode ? sourceDarkMode : source\n\t\t\t}\n\t\t\tstyle={ imageStyle }\n\t\t/>\n\t);\n};\n\nconst HelpDetailBadge = ( { text } ) => {\n\treturn (\n\t\t<View style={ styles.helpDetailBadgeContainer }>\n\t\t\t<Text style={ styles.helpDetailBadgeText }>{ text }</Text>\n\t\t</View>\n\t);\n};\n"]}
|
|
@@ -27,25 +27,18 @@ var _templateValidationNotice = _interopRequireDefault(require("../template-vali
|
|
|
27
27
|
/**
|
|
28
28
|
* Internal dependencies
|
|
29
29
|
*/
|
|
30
|
-
function EditorNotices(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
});
|
|
42
|
-
const nonDismissibleNotices = notices.filter(_ref3 => {
|
|
43
|
-
let {
|
|
44
|
-
isDismissible,
|
|
45
|
-
type
|
|
46
|
-
} = _ref3;
|
|
47
|
-
return !isDismissible && type === 'default';
|
|
48
|
-
});
|
|
30
|
+
function EditorNotices({
|
|
31
|
+
notices,
|
|
32
|
+
onRemove
|
|
33
|
+
}) {
|
|
34
|
+
const dismissibleNotices = notices.filter(({
|
|
35
|
+
isDismissible,
|
|
36
|
+
type
|
|
37
|
+
}) => isDismissible && type === 'default');
|
|
38
|
+
const nonDismissibleNotices = notices.filter(({
|
|
39
|
+
isDismissible,
|
|
40
|
+
type
|
|
41
|
+
}) => !isDismissible && type === 'default');
|
|
49
42
|
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_components.NoticeList, {
|
|
50
43
|
notices: nonDismissibleNotices,
|
|
51
44
|
className: "components-editor-notices__pinned"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/editor-notices/index.js"],"names":["EditorNotices","notices","onRemove","dismissibleNotices","filter","isDismissible","type","nonDismissibleNotices","select","noticesStore","getNotices","dispatch","removeNotice"],"mappings":";;;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AAKA;;AAXA;AACA;AACA;;AAMA;AACA;AACA;AAGO,SAASA,aAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/editor-notices/index.js"],"names":["EditorNotices","notices","onRemove","dismissibleNotices","filter","isDismissible","type","nonDismissibleNotices","select","noticesStore","getNotices","dispatch","removeNotice"],"mappings":";;;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AAKA;;AAXA;AACA;AACA;;AAMA;AACA;AACA;AAGO,SAASA,aAAT,CAAwB;AAAEC,EAAAA,OAAF;AAAWC,EAAAA;AAAX,CAAxB,EAAgD;AACtD,QAAMC,kBAAkB,GAAGF,OAAO,CAACG,MAAR,CAC1B,CAAE;AAAEC,IAAAA,aAAF;AAAiBC,IAAAA;AAAjB,GAAF,KAA+BD,aAAa,IAAIC,IAAI,KAAK,SAD/B,CAA3B;AAGA,QAAMC,qBAAqB,GAAGN,OAAO,CAACG,MAAR,CAC7B,CAAE;AAAEC,IAAAA,aAAF;AAAiBC,IAAAA;AAAjB,GAAF,KAA+B,CAAED,aAAF,IAAmBC,IAAI,KAAK,SAD9B,CAA9B;AAIA,SACC,qDACC,4BAAC,sBAAD;AACC,IAAA,OAAO,EAAGC,qBADX;AAEC,IAAA,SAAS,EAAC;AAFX,IADD,EAKC,4BAAC,sBAAD;AACC,IAAA,OAAO,EAAGJ,kBADX;AAEC,IAAA,SAAS,EAAC,wCAFX;AAGC,IAAA,QAAQ,EAAGD;AAHZ,KAKC,4BAAC,iCAAD,OALD,CALD,CADD;AAeA;;eAEc,sBAAS,CACvB,sBAAcM,MAAF,KAAgB;AAC3BP,EAAAA,OAAO,EAAEO,MAAM,CAAEC,cAAF,CAAN,CAAuBC,UAAvB;AADkB,CAAhB,CAAZ,CADuB,EAIvB,wBAAgBC,QAAF,KAAkB;AAC/BT,EAAAA,QAAQ,EAAES,QAAQ,CAAEF,cAAF,CAAR,CAAyBG;AADJ,CAAlB,CAAd,CAJuB,CAAT,EAOVZ,aAPU,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { NoticeList } from '@wordpress/components';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport TemplateValidationNotice from '../template-validation-notice';\n\nexport function EditorNotices( { notices, onRemove } ) {\n\tconst dismissibleNotices = notices.filter(\n\t\t( { isDismissible, type } ) => isDismissible && type === 'default'\n\t);\n\tconst nonDismissibleNotices = notices.filter(\n\t\t( { isDismissible, type } ) => ! isDismissible && type === 'default'\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<NoticeList\n\t\t\t\tnotices={ nonDismissibleNotices }\n\t\t\t\tclassName=\"components-editor-notices__pinned\"\n\t\t\t/>\n\t\t\t<NoticeList\n\t\t\t\tnotices={ dismissibleNotices }\n\t\t\t\tclassName=\"components-editor-notices__dismissible\"\n\t\t\t\tonRemove={ onRemove }\n\t\t\t>\n\t\t\t\t<TemplateValidationNotice />\n\t\t\t</NoticeList>\n\t\t</>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => ( {\n\t\tnotices: select( noticesStore ).getNotices(),\n\t} ) ),\n\twithDispatch( ( dispatch ) => ( {\n\t\tonRemove: dispatch( noticesStore ).removeNotice,\n\t} ) ),\n] )( EditorNotices );\n"]}
|
|
@@ -21,12 +21,9 @@ function EditorSnackbars() {
|
|
|
21
21
|
const {
|
|
22
22
|
removeNotice
|
|
23
23
|
} = (0, _data.useDispatch)(_notices.store);
|
|
24
|
-
const snackbarNotices = notices.filter(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
} = _ref;
|
|
28
|
-
return type === 'snackbar';
|
|
29
|
-
});
|
|
24
|
+
const snackbarNotices = notices.filter(({
|
|
25
|
+
type
|
|
26
|
+
}) => type === 'snackbar');
|
|
30
27
|
return (0, _element.createElement)(_components.SnackbarList, {
|
|
31
28
|
notices: snackbarNotices,
|
|
32
29
|
className: "components-editor-notices__snackbar",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/editor-snackbars/index.js"],"names":["EditorSnackbars","notices","select","noticesStore","getNotices","removeNotice","snackbarNotices","filter","type"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AALA;AACA;AACA;AAKe,SAASA,eAAT,GAA2B;AACzC,QAAMC,OAAO,GAAG,qBACbC,MAAF,IAAcA,MAAM,CAAEC,cAAF,CAAN,CAAuBC,UAAvB,EADC,EAEf,EAFe,CAAhB;AAIA,QAAM;AAAEC,IAAAA;AAAF,MAAmB,uBAAaF,cAAb,CAAzB;AACA,QAAMG,eAAe,GAAGL,OAAO,CAACM,MAAR,CACvB
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/editor-snackbars/index.js"],"names":["EditorSnackbars","notices","select","noticesStore","getNotices","removeNotice","snackbarNotices","filter","type"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AALA;AACA;AACA;AAKe,SAASA,eAAT,GAA2B;AACzC,QAAMC,OAAO,GAAG,qBACbC,MAAF,IAAcA,MAAM,CAAEC,cAAF,CAAN,CAAuBC,UAAvB,EADC,EAEf,EAFe,CAAhB;AAIA,QAAM;AAAEC,IAAAA;AAAF,MAAmB,uBAAaF,cAAb,CAAzB;AACA,QAAMG,eAAe,GAAGL,OAAO,CAACM,MAAR,CACvB,CAAE;AAAEC,IAAAA;AAAF,GAAF,KAAgBA,IAAI,KAAK,UADF,CAAxB;AAIA,SACC,4BAAC,wBAAD;AACC,IAAA,OAAO,EAAGF,eADX;AAEC,IAAA,SAAS,EAAC,qCAFX;AAGC,IAAA,QAAQ,EAAGD;AAHZ,IADD;AAOA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SnackbarList } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\n\nexport default function EditorSnackbars() {\n\tconst notices = useSelect(\n\t\t( select ) => select( noticesStore ).getNotices(),\n\t\t[]\n\t);\n\tconst { removeNotice } = useDispatch( noticesStore );\n\tconst snackbarNotices = notices.filter(\n\t\t( { type } ) => type === 'snackbar'\n\t);\n\n\treturn (\n\t\t<SnackbarList\n\t\t\tnotices={ snackbarNotices }\n\t\t\tclassName=\"components-editor-notices__snackbar\"\n\t\t\tonRemove={ removeNotice }\n\t\t/>\n\t);\n}\n"]}
|
|
@@ -28,13 +28,12 @@ var _store = require("../../store");
|
|
|
28
28
|
/**
|
|
29
29
|
* Internal dependencies
|
|
30
30
|
*/
|
|
31
|
-
function EntityRecordItem(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
} = _ref;
|
|
31
|
+
function EntityRecordItem({
|
|
32
|
+
record,
|
|
33
|
+
checked,
|
|
34
|
+
onChange,
|
|
35
|
+
closePanel
|
|
36
|
+
}) {
|
|
38
37
|
const {
|
|
39
38
|
name,
|
|
40
39
|
kind,
|
|
@@ -42,14 +41,12 @@ function EntityRecordItem(_ref) {
|
|
|
42
41
|
key
|
|
43
42
|
} = record;
|
|
44
43
|
const parentBlockId = (0, _data.useSelect)(select => {
|
|
45
|
-
var _blocks$;
|
|
46
|
-
|
|
47
44
|
// Get entity's blocks.
|
|
48
45
|
const {
|
|
49
46
|
blocks = []
|
|
50
47
|
} = select(_coreData.store).getEditedEntityRecord(kind, name, key); // Get parents of the entity's first block.
|
|
51
48
|
|
|
52
|
-
const parents = select(_blockEditor.store).getBlockParents(
|
|
49
|
+
const parents = select(_blockEditor.store).getBlockParents(blocks[0]?.clientId); // Return closest parent block's clientId.
|
|
53
50
|
|
|
54
51
|
return parents[parents.length - 1];
|
|
55
52
|
}, []); // Handle templates that might use default descriptive titles.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/entities-saved-states/entity-record-item.js"],"names":["EntityRecordItem","record","checked","onChange","closePanel","name","kind","title","key","parentBlockId","select","blocks","coreStore","getEditedEntityRecord","parents","blockEditorStore","getBlockParents","clientId","length","entityRecordTitle","template","editorStore","__experimentalGetTemplateInfo","isSelected","selectedBlockId","getSelectedBlockClientId","isSelectedText","selectBlock","selectParentBlock","selectAndDismiss"],"mappings":";;;;;;;AAMA;;AAHA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AAKA;;AAdA;AACA;AACA;;AASA;AACA;AACA;AAGe,SAASA,gBAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/entities-saved-states/entity-record-item.js"],"names":["EntityRecordItem","record","checked","onChange","closePanel","name","kind","title","key","parentBlockId","select","blocks","coreStore","getEditedEntityRecord","parents","blockEditorStore","getBlockParents","clientId","length","entityRecordTitle","template","editorStore","__experimentalGetTemplateInfo","isSelected","selectedBlockId","getSelectedBlockClientId","isSelectedText","selectBlock","selectParentBlock","selectAndDismiss"],"mappings":";;;;;;;AAMA;;AAHA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AAKA;;AAdA;AACA;AACA;;AASA;AACA;AACA;AAGe,SAASA,gBAAT,CAA2B;AACzCC,EAAAA,MADyC;AAEzCC,EAAAA,OAFyC;AAGzCC,EAAAA,QAHyC;AAIzCC,EAAAA;AAJyC,CAA3B,EAKX;AACH,QAAM;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,IAAR;AAAcC,IAAAA,KAAd;AAAqBC,IAAA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Ab,CAAxB;AACA,QAAMa,iBAAiB,GAAG,0BACzB,MAAMD,WAAW,CAAElB,aAAF,CADQ,EAEzB,CAAEA,aAAF,CAFyB,CAA1B;AAIA,QAAMoB,gBAAgB,GAAG,0BAAa,MAAM;AAC3CF,IAAAA,WAAW,CAAElB,aAAF,CAAX;AACAL,IAAAA,UAAU;AACV,GAHwB,EAGtB,CAAEK,aAAF,CAHsB,CAAzB;AAKA,SACC,4BAAC,oBAAD,QACC,4BAAC,2BAAD;AACC,IAAA,uBAAuB,MADxB;AAEC,IAAA,KAAK,EACJ,4CACG,kCAAgBU,iBAAhB,KACD,cAAI,UAAJ,CAFF,CAHF;AAQC,IAAA,OAAO,EAAGjB,OARX;AASC,IAAA,QAAQ,EAAGC;AATZ,IADD,EAYGM,aAAa,GACd,qDACC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAGmB,iBADX;AAEC,IAAA,SAAS,EAAC,oCAFX;AAGC,IAAA,QAAQ,EAAGL;AAHZ,KAKGG,cALH,CADD,EAQC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAGG,gBADX;AAEC,IAAA,SAAS,EAAC,0CAFX;AAGC,IAAA,QAAQ,EAAGN;AAHZ,KAKGG,cALH,CARD,CADc,GAiBX,IA7BL,CADD;AAiCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { CheckboxControl, Button, PanelRow } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useCallback } from '@wordpress/element';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport default function EntityRecordItem( {\n\trecord,\n\tchecked,\n\tonChange,\n\tclosePanel,\n} ) {\n\tconst { name, kind, title, key } = record;\n\tconst parentBlockId = useSelect( ( select ) => {\n\t\t// Get entity's blocks.\n\t\tconst { blocks = [] } = select( coreStore ).getEditedEntityRecord(\n\t\t\tkind,\n\t\t\tname,\n\t\t\tkey\n\t\t);\n\t\t// Get parents of the entity's first block.\n\t\tconst parents = select( blockEditorStore ).getBlockParents(\n\t\t\tblocks[ 0 ]?.clientId\n\t\t);\n\t\t// Return closest parent block's clientId.\n\t\treturn parents[ parents.length - 1 ];\n\t}, [] );\n\n\t// Handle templates that might use default descriptive titles.\n\tconst entityRecordTitle = useSelect(\n\t\t( select ) => {\n\t\t\tif ( 'postType' !== kind || 'wp_template' !== name ) {\n\t\t\t\treturn title;\n\t\t\t}\n\n\t\t\tconst template = select( coreStore ).getEditedEntityRecord(\n\t\t\t\tkind,\n\t\t\t\tname,\n\t\t\t\tkey\n\t\t\t);\n\t\t\treturn select( editorStore ).__experimentalGetTemplateInfo(\n\t\t\t\ttemplate\n\t\t\t).title;\n\t\t},\n\t\t[ name, kind, title, key ]\n\t);\n\n\tconst isSelected = useSelect(\n\t\t( select ) => {\n\t\t\tconst selectedBlockId =\n\t\t\t\tselect( blockEditorStore ).getSelectedBlockClientId();\n\t\t\treturn selectedBlockId === parentBlockId;\n\t\t},\n\t\t[ parentBlockId ]\n\t);\n\tconst isSelectedText = isSelected ? __( 'Selected' ) : __( 'Select' );\n\tconst { selectBlock } = useDispatch( blockEditorStore );\n\tconst selectParentBlock = useCallback(\n\t\t() => selectBlock( parentBlockId ),\n\t\t[ parentBlockId ]\n\t);\n\tconst selectAndDismiss = useCallback( () => {\n\t\tselectBlock( parentBlockId );\n\t\tclosePanel();\n\t}, [ parentBlockId ] );\n\n\treturn (\n\t\t<PanelRow>\n\t\t\t<CheckboxControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tlabel={\n\t\t\t\t\t<strong>\n\t\t\t\t\t\t{ decodeEntities( entityRecordTitle ) ||\n\t\t\t\t\t\t\t__( 'Untitled' ) }\n\t\t\t\t\t</strong>\n\t\t\t\t}\n\t\t\t\tchecked={ checked }\n\t\t\t\tonChange={ onChange }\n\t\t\t/>\n\t\t\t{ parentBlockId ? (\n\t\t\t\t<>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tonClick={ selectParentBlock }\n\t\t\t\t\t\tclassName=\"entities-saved-states__find-entity\"\n\t\t\t\t\t\tdisabled={ isSelected }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ isSelectedText }\n\t\t\t\t\t</Button>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tonClick={ selectAndDismiss }\n\t\t\t\t\t\tclassName=\"entities-saved-states__find-entity-small\"\n\t\t\t\t\t\tdisabled={ isSelected }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ isSelectedText }\n\t\t\t\t\t</Button>\n\t\t\t\t</>\n\t\t\t) : null }\n\t\t</PanelRow>\n\t);\n}\n"]}
|
|
@@ -40,13 +40,12 @@ function getEntityDescription(entity, count) {
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
function EntityTypeList(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
} = _ref;
|
|
43
|
+
function EntityTypeList({
|
|
44
|
+
list,
|
|
45
|
+
unselectedEntities,
|
|
46
|
+
setUnselectedEntities,
|
|
47
|
+
closePanel
|
|
48
|
+
}) {
|
|
50
49
|
const count = list.length;
|
|
51
50
|
const firstRecord = list[0];
|
|
52
51
|
const entityConfig = (0, _data.useSelect)(select => select(_coreData.store).getEntityConfig(firstRecord.kind, firstRecord.name), [firstRecord.kind, firstRecord.name]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/entities-saved-states/entity-type-list.js"],"names":["getEntityDescription","entity","count","EntityTypeList","list","unselectedEntities","setUnselectedEntities","closePanel","length","firstRecord","entityConfig","select","coreStore","getEntityConfig","kind","name","entityLabel","label","description","map","record","key","property","some","elt","value"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AAKA;;AAXA;AACA;AACA;;AAMA;AACA;AACA;AAGA,SAASA,oBAAT,CAA+BC,MAA/B,EAAuCC,KAAvC,EAA+C;AAC9C,UAASD,MAAT;AACC,SAAK,MAAL;AACC,aAAO,MAAMC,KAAN,GACJ,cAAI,0CAAJ,CADI,GAEJ,cAAI,4CAAJ,CAFH;;AAGD,SAAK,aAAL;AACC,aAAO,cACN,iEADM,CAAP;;AAGD,SAAK,MAAL;AACA,SAAK,MAAL;AACC,aAAO,cAAI,0CAAJ,CAAP;AAXF;AAaA;;AAEc,SAASC,cAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/entities-saved-states/entity-type-list.js"],"names":["getEntityDescription","entity","count","EntityTypeList","list","unselectedEntities","setUnselectedEntities","closePanel","length","firstRecord","entityConfig","select","coreStore","getEntityConfig","kind","name","entityLabel","label","description","map","record","key","property","some","elt","value"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AAKA;;AAXA;AACA;AACA;;AAMA;AACA;AACA;AAGA,SAASA,oBAAT,CAA+BC,MAA/B,EAAuCC,KAAvC,EAA+C;AAC9C,UAASD,MAAT;AACC,SAAK,MAAL;AACC,aAAO,MAAMC,KAAN,GACJ,cAAI,0CAAJ,CADI,GAEJ,cAAI,4CAAJ,CAFH;;AAGD,SAAK,aAAL;AACC,aAAO,cACN,iEADM,CAAP;;AAGD,SAAK,MAAL;AACA,SAAK,MAAL;AACC,aAAO,cAAI,0CAAJ,CAAP;AAXF;AAaA;;AAEc,SAASC,cAAT,CAAyB;AACvCC,EAAAA,IADuC;AAEvCC,EAAAA,kBAFuC;AAGvCC,EAAAA,qBAHuC;AAIvCC,EAAAA;AAJuC,CAAzB,EAKX;AACH,QAAML,KAAK,GAAGE,IAAI,CAACI,MAAnB;AACA,QAAMC,WAAW,GAAGL,IAAI,CAAE,CAAF,CAAxB;AACA,QAAMM,YAAY,GAAG,qBAClBC,MAAF,IACCA,MAAM,CAAEC,eAAF,CAAN,CAAoBC,eAApB,CACCJ,WAAW,CAACK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} from '@wordpress/data';\nimport { PanelBody, PanelRow } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport EntityRecordItem from './entity-record-item';\n\nfunction getEntityDescription( entity, count ) {\n\tswitch ( entity ) {\n\t\tcase 'site':\n\t\t\treturn 1 === count\n\t\t\t\t? __( 'This change will affect your whole site.' )\n\t\t\t\t: __( 'These changes will affect your whole site.' );\n\t\tcase 'wp_template':\n\t\t\treturn __(\n\t\t\t\t'This change will affect pages and posts that use this template.'\n\t\t\t);\n\t\tcase 'page':\n\t\tcase 'post':\n\t\t\treturn __( 'The following content has been modified.' );\n\t}\n}\n\nexport default function EntityTypeList( {\n\tlist,\n\tunselectedEntities,\n\tsetUnselectedEntities,\n\tclosePanel,\n} ) {\n\tconst count = list.length;\n\tconst firstRecord = list[ 0 ];\n\tconst entityConfig = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getEntityConfig(\n\t\t\t\tfirstRecord.kind,\n\t\t\t\tfirstRecord.name\n\t\t\t),\n\t\t[ firstRecord.kind, firstRecord.name ]\n\t);\n\tconst { name } = firstRecord;\n\n\tlet entityLabel = entityConfig.label;\n\tif ( name === 'wp_template_part' ) {\n\t\tentityLabel =\n\t\t\t1 === count ? __( 'Template Part' ) : __( 'Template Parts' );\n\t}\n\t// Set description based on type of entity.\n\tconst description = getEntityDescription( name, count );\n\n\treturn (\n\t\t<PanelBody title={ entityLabel } initialOpen={ true }>\n\t\t\t{ description && <PanelRow>{ description }</PanelRow> }\n\t\t\t{ list.map( ( record ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<EntityRecordItem\n\t\t\t\t\t\tkey={ record.key || record.property }\n\t\t\t\t\t\trecord={ record }\n\t\t\t\t\t\tchecked={\n\t\t\t\t\t\t\t! unselectedEntities.some(\n\t\t\t\t\t\t\t\t( elt ) =>\n\t\t\t\t\t\t\t\t\telt.kind === record.kind &&\n\t\t\t\t\t\t\t\t\telt.name === record.name &&\n\t\t\t\t\t\t\t\t\telt.key === record.key &&\n\t\t\t\t\t\t\t\t\telt.property === record.property\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tsetUnselectedEntities( record, value )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclosePanel={ closePanel }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</PanelBody>\n\t);\n}\n"]}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useIsDirty = void 0;
|
|
7
|
+
|
|
8
|
+
var _data = require("@wordpress/data");
|
|
9
|
+
|
|
10
|
+
var _coreData = require("@wordpress/core-data");
|
|
11
|
+
|
|
12
|
+
var _element = require("@wordpress/element");
|
|
13
|
+
|
|
14
|
+
var _i18n = require("@wordpress/i18n");
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* WordPress dependencies
|
|
18
|
+
*/
|
|
19
|
+
const TRANSLATED_SITE_PROPERTIES = {
|
|
20
|
+
title: (0, _i18n.__)('Title'),
|
|
21
|
+
description: (0, _i18n.__)('Tagline'),
|
|
22
|
+
site_logo: (0, _i18n.__)('Logo'),
|
|
23
|
+
site_icon: (0, _i18n.__)('Icon'),
|
|
24
|
+
show_on_front: (0, _i18n.__)('Show on front'),
|
|
25
|
+
page_on_front: (0, _i18n.__)('Page on front')
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const useIsDirty = () => {
|
|
29
|
+
const {
|
|
30
|
+
dirtyEntityRecords
|
|
31
|
+
} = (0, _data.useSelect)(select => {
|
|
32
|
+
const dirtyRecords = select(_coreData.store).__experimentalGetDirtyEntityRecords(); // Remove site object and decouple into its edited pieces.
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
const dirtyRecordsWithoutSite = dirtyRecords.filter(record => !(record.kind === 'root' && record.name === 'site'));
|
|
36
|
+
const siteEdits = select(_coreData.store).getEntityRecordEdits('root', 'site');
|
|
37
|
+
const siteEditsAsEntities = [];
|
|
38
|
+
|
|
39
|
+
for (const property in siteEdits) {
|
|
40
|
+
siteEditsAsEntities.push({
|
|
41
|
+
kind: 'root',
|
|
42
|
+
name: 'site',
|
|
43
|
+
title: TRANSLATED_SITE_PROPERTIES[property] || property,
|
|
44
|
+
property
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const dirtyRecordsWithSiteItems = [...dirtyRecordsWithoutSite, ...siteEditsAsEntities];
|
|
49
|
+
return {
|
|
50
|
+
dirtyEntityRecords: dirtyRecordsWithSiteItems
|
|
51
|
+
};
|
|
52
|
+
}, []); // Unchecked entities to be ignored by save function.
|
|
53
|
+
|
|
54
|
+
const [unselectedEntities, _setUnselectedEntities] = (0, _element.useState)([]);
|
|
55
|
+
|
|
56
|
+
const setUnselectedEntities = ({
|
|
57
|
+
kind,
|
|
58
|
+
name,
|
|
59
|
+
key,
|
|
60
|
+
property
|
|
61
|
+
}, checked) => {
|
|
62
|
+
if (checked) {
|
|
63
|
+
_setUnselectedEntities(unselectedEntities.filter(elt => elt.kind !== kind || elt.name !== name || elt.key !== key || elt.property !== property));
|
|
64
|
+
} else {
|
|
65
|
+
_setUnselectedEntities([...unselectedEntities, {
|
|
66
|
+
kind,
|
|
67
|
+
name,
|
|
68
|
+
key,
|
|
69
|
+
property
|
|
70
|
+
}]);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
const isDirty = dirtyEntityRecords.length - unselectedEntities.length > 0;
|
|
75
|
+
return {
|
|
76
|
+
dirtyEntityRecords,
|
|
77
|
+
isDirty,
|
|
78
|
+
setUnselectedEntities,
|
|
79
|
+
unselectedEntities
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
exports.useIsDirty = useIsDirty;
|
|
84
|
+
//# sourceMappingURL=use-is-dirty.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/entities-saved-states/hooks/use-is-dirty.js"],"names":["TRANSLATED_SITE_PROPERTIES","title","description","site_logo","site_icon","show_on_front","page_on_front","useIsDirty","dirtyEntityRecords","select","dirtyRecords","coreStore","__experimentalGetDirtyEntityRecords","dirtyRecordsWithoutSite","filter","record","kind","name","siteEdits","getEntityRecordEdits","siteEditsAsEntities","property","push","dirtyRecordsWithSiteItems","unselectedEntities","_setUnselectedEntities","setUnselectedEntities","key","checked","elt","isDirty","length"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AACA;;AANA;AACA;AACA;AAMA,MAAMA,0BAA0B,GAAG;AAClCC,EAAAA,KAAK,EAAE,cAAI,OAAJ,CAD2B;AAElCC,EAAAA,WAAW,EAAE,cAAI,SAAJ,CAFqB;AAGlCC,EAAAA,SAAS,EAAE,cAAI,MAAJ,CAHuB;AAIlCC,EAAAA,SAAS,EAAE,cAAI,MAAJ,CAJuB;AAKlCC,EAAAA,aAAa,EAAE,cAAI,eAAJ,CALmB;AAMlCC,EAAAA,aAAa,EAAE,cAAI,eAAJ;AANmB,CAAnC;;AASO,MAAMC,UAAU,GAAG,MAAM;AAC/B,QAAM;AAAEC,IAAAA;AAAF,MAAyB,qBAAaC,MAAF,IAAc;AACvD,UAAMC,YAAY,GACjBD,MAAM,CAAEE,eAAF,CAAN,CAAoBC,mCAApB,EADD,CADuD,CAIvD;;;AACA,UAAMC,uBAAuB,GAAGH,YAAY,CAACI,MAAb,CAC7BC,MAAF,IAAc,EAAIA,MAAM,CAACC,IAAP,KAAgB,MAAhB,IAA0BD,MAAM,CAACE,IAAP,KAAgB,MAA9C,CADiB,CAAhC;AAIA,UAAMC,SAAS,GAAGT,MAAM,CAAEE,eAAF,CAAN,CAAoBQ,oBAApB,CACjB,MADiB,EAEjB,MAFiB,CAAlB;AAKA,UAAMC,mBAAmB,GAAG,EAA5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A,SAAO;AACNvB,IAAAA,kBADM;AAENsB,IAAAA,OAFM;AAGNJ,IAAAA,qBAHM;AAINF,IAAAA;AAJM,GAAP;AAMA,CAnEM","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\nconst TRANSLATED_SITE_PROPERTIES = {\n\ttitle: __( 'Title' ),\n\tdescription: __( 'Tagline' ),\n\tsite_logo: __( 'Logo' ),\n\tsite_icon: __( 'Icon' ),\n\tshow_on_front: __( 'Show on front' ),\n\tpage_on_front: __( 'Page on front' ),\n};\n\nexport const useIsDirty = () => {\n\tconst { dirtyEntityRecords } = useSelect( ( select ) => {\n\t\tconst dirtyRecords =\n\t\t\tselect( coreStore ).__experimentalGetDirtyEntityRecords();\n\n\t\t// Remove site object and decouple into its edited pieces.\n\t\tconst dirtyRecordsWithoutSite = dirtyRecords.filter(\n\t\t\t( record ) => ! ( record.kind === 'root' && record.name === 'site' )\n\t\t);\n\n\t\tconst siteEdits = select( coreStore ).getEntityRecordEdits(\n\t\t\t'root',\n\t\t\t'site'\n\t\t);\n\n\t\tconst siteEditsAsEntities = [];\n\t\tfor ( const property in siteEdits ) {\n\t\t\tsiteEditsAsEntities.push( {\n\t\t\t\tkind: 'root',\n\t\t\t\tname: 'site',\n\t\t\t\ttitle: TRANSLATED_SITE_PROPERTIES[ property ] || property,\n\t\t\t\tproperty,\n\t\t\t} );\n\t\t}\n\t\tconst dirtyRecordsWithSiteItems = [\n\t\t\t...dirtyRecordsWithoutSite,\n\t\t\t...siteEditsAsEntities,\n\t\t];\n\n\t\treturn {\n\t\t\tdirtyEntityRecords: dirtyRecordsWithSiteItems,\n\t\t};\n\t}, [] );\n\n\t// Unchecked entities to be ignored by save function.\n\tconst [ unselectedEntities, _setUnselectedEntities ] = useState( [] );\n\n\tconst setUnselectedEntities = (\n\t\t{ kind, name, key, property },\n\t\tchecked\n\t) => {\n\t\tif ( checked ) {\n\t\t\t_setUnselectedEntities(\n\t\t\t\tunselectedEntities.filter(\n\t\t\t\t\t( elt ) =>\n\t\t\t\t\t\telt.kind !== kind ||\n\t\t\t\t\t\telt.name !== name ||\n\t\t\t\t\t\telt.key !== key ||\n\t\t\t\t\t\telt.property !== property\n\t\t\t\t)\n\t\t\t);\n\t\t} else {\n\t\t\t_setUnselectedEntities( [\n\t\t\t\t...unselectedEntities,\n\t\t\t\t{ kind, name, key, property },\n\t\t\t] );\n\t\t}\n\t};\n\n\tconst isDirty = dirtyEntityRecords.length - unselectedEntities.length > 0;\n\n\treturn {\n\t\tdirtyEntityRecords,\n\t\tisDirty,\n\t\tsetUnselectedEntities,\n\t\tunselectedEntities,\n\t};\n};\n"]}
|