@wordpress/editor 14.9.0 → 14.11.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 +8 -0
- package/README.md +2 -2
- package/build/bindings/api.js +0 -29
- package/build/bindings/api.js.map +1 -1
- package/build/bindings/post-meta.js +2 -1
- package/build/bindings/post-meta.js.map +1 -1
- package/build/components/autocompleters/user.js.map +1 -1
- package/build/components/block-manager/index.js +2 -2
- package/build/components/block-manager/index.js.map +1 -1
- package/build/components/collab-sidebar/add-comment.js +120 -0
- package/build/components/collab-sidebar/add-comment.js.map +1 -0
- package/build/components/collab-sidebar/comment-button-toolbar.js +37 -0
- package/build/components/collab-sidebar/comment-button-toolbar.js.map +1 -0
- package/build/components/collab-sidebar/comment-button.js +37 -0
- package/build/components/collab-sidebar/comment-button.js.map +1 -0
- package/build/components/collab-sidebar/comments.js +321 -0
- package/build/components/collab-sidebar/comments.js.map +1 -0
- package/build/components/collab-sidebar/constants.js +8 -0
- package/build/components/collab-sidebar/constants.js.map +1 -0
- package/build/components/collab-sidebar/index.js +272 -0
- package/build/components/collab-sidebar/index.js.map +1 -0
- package/build/components/collab-sidebar/utils.js +16 -0
- package/build/components/collab-sidebar/utils.js.map +1 -0
- package/build/components/commands/index.js +6 -6
- package/build/components/commands/index.js.map +1 -1
- package/build/components/create-template-part-modal/index.js.map +1 -1
- package/build/components/create-template-part-modal/utils.js.map +1 -1
- package/build/components/document-bar/index.js +8 -7
- package/build/components/document-bar/index.js.map +1 -1
- package/build/components/document-outline/index.js.map +1 -1
- package/build/components/document-outline/item.js.map +1 -1
- package/build/components/document-tools/index.js +2 -6
- package/build/components/document-tools/index.js.map +1 -1
- package/build/components/editor-interface/index.js +4 -14
- package/build/components/editor-interface/index.js.map +1 -1
- package/build/components/entities-saved-states/index.js +2 -2
- package/build/components/entities-saved-states/index.js.map +1 -1
- package/build/components/global-keyboard-shortcuts/register-shortcuts.js +3 -3
- package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
- package/build/components/global-styles-provider/index.js +13 -3
- package/build/components/global-styles-provider/index.js.map +1 -1
- package/build/components/header/index.js +5 -2
- package/build/components/header/index.js.map +1 -1
- package/build/components/inserter-sidebar/index.js +2 -2
- package/build/components/inserter-sidebar/index.js.map +1 -1
- package/build/components/media-categories/index.js.map +1 -1
- package/build/components/page-attributes/parent.js +5 -5
- package/build/components/page-attributes/parent.js.map +1 -1
- package/build/components/plugin-document-setting-panel/index.js.map +1 -1
- package/build/components/plugin-more-menu-item/index.js +13 -11
- package/build/components/plugin-more-menu-item/index.js.map +1 -1
- package/build/components/plugin-preview-menu-item/index.js +15 -13
- package/build/components/plugin-preview-menu-item/index.js.map +1 -1
- package/build/components/plugin-sidebar/index.js +0 -15
- package/build/components/plugin-sidebar/index.js.map +1 -1
- package/build/components/post-actions/index.js +5 -5
- package/build/components/post-actions/index.js.map +1 -1
- package/build/components/post-author/panel.js +4 -4
- package/build/components/post-author/panel.js.map +1 -1
- package/build/components/post-card-panel/index.js +7 -36
- package/build/components/post-card-panel/index.js.map +1 -1
- package/build/components/post-content-information/index.js +2 -3
- package/build/components/post-content-information/index.js.map +1 -1
- package/build/components/post-featured-image/index.js +26 -7
- package/build/components/post-featured-image/index.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/index.js +1 -1
- package/build/components/post-last-revision/index.js.map +1 -1
- package/build/components/post-locked-modal/index.js +2 -2
- package/build/components/post-locked-modal/index.js.map +1 -1
- package/build/components/post-preview-button/index.js +1 -1
- package/build/components/post-preview-button/index.js.map +1 -1
- package/build/components/post-publish-button/index.js.map +1 -1
- package/build/components/post-publish-panel/maybe-post-format-panel.js +1 -1
- package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-upload-media.js +1 -0
- package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
- package/build/components/post-publish-panel/media-util.js +1 -0
- package/build/components/post-publish-panel/media-util.js.map +1 -1
- package/build/components/post-publish-panel/postpublish.js +1 -1
- package/build/components/post-publish-panel/postpublish.js.map +1 -1
- package/build/components/post-schedule/label.js +1 -1
- package/build/components/post-schedule/label.js.map +1 -1
- package/build/components/post-taxonomies/flat-term-selector.js +13 -5
- package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/hierarchical-term-selector.js +3 -2
- package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/index.js +1 -1
- package/build/components/post-taxonomies/index.js.map +1 -1
- package/build/components/post-taxonomies/panel.js.map +1 -1
- package/build/components/post-template/classic-theme.js +2 -4
- package/build/components/post-template/classic-theme.js.map +1 -1
- package/build/components/post-text-editor/index.js.map +1 -1
- package/build/components/post-title/index.js +15 -19
- package/build/components/post-title/index.js.map +1 -1
- package/build/components/post-title/index.native.js +2 -2
- package/build/components/post-title/index.native.js.map +1 -1
- package/build/components/post-url/index.js +76 -63
- package/build/components/post-url/index.js.map +1 -1
- package/build/components/post-url/panel.js +49 -29
- package/build/components/post-url/panel.js.map +1 -1
- package/build/components/post-visibility/index.js.map +1 -1
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/preview-dropdown/index.js +0 -4
- package/build/components/preview-dropdown/index.js.map +1 -1
- package/build/components/provider/index.js +10 -12
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.js +1 -1
- package/build/components/provider/use-block-editor-settings.js.map +1 -1
- package/build/components/resizable-editor/resize-handle.js.map +1 -1
- package/build/components/sidebar/header.js +2 -1
- package/build/components/sidebar/header.js.map +1 -1
- package/build/components/sidebar/index.js +3 -3
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/time-to-read/index.js +2 -2
- package/build/components/time-to-read/index.js.map +1 -1
- package/build/components/visual-editor/edit-template-blocks-notification.js +4 -1
- package/build/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
- package/build/components/visual-editor/index.js +24 -25
- package/build/components/visual-editor/index.js.map +1 -1
- package/build/components/visual-editor/use-select-nearest-editable-block.js.map +1 -1
- package/build/components/visual-editor/use-zoom-out-mode-exit.js +52 -0
- package/build/components/visual-editor/use-zoom-out-mode-exit.js.map +1 -0
- package/build/components/zoom-out-toggle/index.js +37 -5
- package/build/components/zoom-out-toggle/index.js.map +1 -1
- package/build/dataviews/actions/duplicate-template-part.js +3 -3
- package/build/dataviews/actions/duplicate-template-part.js.map +1 -1
- package/build/private-apis.js +0 -1
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +30 -4
- package/build/store/actions.js.map +1 -1
- package/build/store/constants.js +1 -0
- package/build/store/constants.js.map +1 -1
- package/build/store/local-autosave.js.map +1 -1
- package/build/store/private-actions.js +8 -7
- package/build/store/private-actions.js.map +1 -1
- package/build/store/selectors.js +24 -2
- package/build/store/selectors.js.map +1 -1
- package/build/utils/media-upload/index.js.map +1 -1
- package/build/utils/pageTypeBadge.js +51 -0
- package/build/utils/pageTypeBadge.js.map +1 -0
- package/build/utils/terms.js +2 -2
- package/build/utils/terms.js.map +1 -1
- package/build-module/bindings/api.js +1 -29
- package/build-module/bindings/api.js.map +1 -1
- package/build-module/bindings/post-meta.js +2 -1
- package/build-module/bindings/post-meta.js.map +1 -1
- package/build-module/components/autocompleters/user.js +1 -3
- package/build-module/components/autocompleters/user.js.map +1 -1
- package/build-module/components/block-manager/category.js +1 -2
- package/build-module/components/block-manager/category.js.map +1 -1
- package/build-module/components/block-manager/checklist.js +1 -2
- package/build-module/components/block-manager/checklist.js.map +1 -1
- package/build-module/components/block-manager/index.js +3 -4
- package/build-module/components/block-manager/index.js.map +1 -1
- package/build-module/components/block-settings-menu/content-only-settings-menu.js +1 -3
- package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
- package/build-module/components/blog-title/index.js +1 -3
- package/build-module/components/blog-title/index.js.map +1 -1
- package/build-module/components/collab-sidebar/add-comment.js +114 -0
- package/build-module/components/collab-sidebar/add-comment.js.map +1 -0
- package/build-module/components/collab-sidebar/comment-button-toolbar.js +30 -0
- package/build-module/components/collab-sidebar/comment-button-toolbar.js.map +1 -0
- package/build-module/components/collab-sidebar/comment-button.js +30 -0
- package/build-module/components/collab-sidebar/comment-button.js.map +1 -0
- package/build-module/components/collab-sidebar/comments.js +314 -0
- package/build-module/components/collab-sidebar/comments.js.map +1 -0
- package/build-module/components/collab-sidebar/constants.js +2 -0
- package/build-module/components/collab-sidebar/constants.js.map +1 -0
- package/build-module/components/collab-sidebar/index.js +264 -0
- package/build-module/components/collab-sidebar/index.js.map +1 -0
- package/build-module/components/collab-sidebar/utils.js +10 -0
- package/build-module/components/collab-sidebar/utils.js.map +1 -0
- package/build-module/components/collapsible-block-toolbar/index.js +1 -3
- package/build-module/components/collapsible-block-toolbar/index.js.map +1 -1
- package/build-module/components/commands/index.js +6 -6
- package/build-module/components/commands/index.js.map +1 -1
- package/build-module/components/create-template-part-modal/index.js +1 -2
- package/build-module/components/create-template-part-modal/index.js.map +1 -1
- package/build-module/components/create-template-part-modal/utils.js.map +1 -1
- package/build-module/components/document-bar/index.js +10 -10
- package/build-module/components/document-bar/index.js.map +1 -1
- package/build-module/components/document-outline/index.js +1 -2
- package/build-module/components/document-outline/index.js.map +1 -1
- package/build-module/components/document-outline/item.js +1 -2
- package/build-module/components/document-outline/item.js.map +1 -1
- package/build-module/components/document-tools/index.js +4 -10
- package/build-module/components/document-tools/index.js.map +1 -1
- package/build-module/components/editor/index.js +1 -3
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-help/add-blocks.native.js +1 -3
- package/build-module/components/editor-help/add-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/customize-blocks.native.js +1 -3
- package/build-module/components/editor-help/customize-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/help-detail-navigation-screen.native.js +1 -2
- package/build-module/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
- package/build-module/components/editor-help/index.native.js +1 -3
- package/build-module/components/editor-help/index.native.js.map +1 -1
- package/build-module/components/editor-help/intro-to-blocks.native.js +1 -3
- package/build-module/components/editor-help/intro-to-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/move-blocks.native.js +1 -3
- package/build-module/components/editor-help/move-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/remove-blocks.native.js +1 -3
- package/build-module/components/editor-help/remove-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/view-sections.native.js +1 -2
- package/build-module/components/editor-help/view-sections.native.js.map +1 -1
- package/build-module/components/editor-interface/index.js +5 -17
- package/build-module/components/editor-interface/index.js.map +1 -1
- package/build-module/components/editor-notices/index.js +1 -3
- package/build-module/components/editor-notices/index.js.map +1 -1
- package/build-module/components/entities-saved-states/entity-record-item.js +1 -3
- 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 +1 -2
- package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build-module/components/entities-saved-states/index.js +3 -4
- package/build-module/components/entities-saved-states/index.js.map +1 -1
- package/build-module/components/error-boundary/index.native.js +1 -2
- package/build-module/components/error-boundary/index.native.js.map +1 -1
- package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +3 -3
- package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
- package/build-module/components/global-styles-provider/index.js +13 -3
- package/build-module/components/global-styles-provider/index.js.map +1 -1
- package/build-module/components/header/index.js +6 -4
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/inserter-sidebar/index.js +2 -2
- package/build-module/components/inserter-sidebar/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +1 -2
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +1 -3
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build-module/components/list-view-sidebar/list-view-outline.js +1 -3
- package/build-module/components/list-view-sidebar/list-view-outline.js.map +1 -1
- package/build-module/components/media-categories/index.js.map +1 -1
- package/build-module/components/more-menu/index.js +1 -3
- package/build-module/components/more-menu/index.js.map +1 -1
- package/build-module/components/offline-status/index.native.js +1 -2
- package/build-module/components/offline-status/index.native.js.map +1 -1
- package/build-module/components/page-attributes/parent.js +6 -7
- package/build-module/components/page-attributes/parent.js.map +1 -1
- package/build-module/components/plugin-document-setting-panel/index.js +1 -3
- package/build-module/components/plugin-document-setting-panel/index.js.map +1 -1
- package/build-module/components/plugin-more-menu-item/index.js +12 -10
- package/build-module/components/plugin-more-menu-item/index.js.map +1 -1
- package/build-module/components/plugin-preview-menu-item/index.js +14 -12
- package/build-module/components/plugin-preview-menu-item/index.js.map +1 -1
- package/build-module/components/plugin-sidebar/index.js +0 -15
- package/build-module/components/plugin-sidebar/index.js.map +1 -1
- package/build-module/components/post-actions/index.js +6 -8
- package/build-module/components/post-actions/index.js.map +1 -1
- package/build-module/components/post-author/panel.js +5 -6
- package/build-module/components/post-author/panel.js.map +1 -1
- package/build-module/components/post-card-panel/index.js +9 -38
- package/build-module/components/post-card-panel/index.js.map +1 -1
- package/build-module/components/post-content-information/index.js +2 -3
- package/build-module/components/post-content-information/index.js.map +1 -1
- package/build-module/components/post-discussion/panel.js +1 -2
- package/build-module/components/post-discussion/panel.js.map +1 -1
- package/build-module/components/post-excerpt/panel.js +1 -3
- package/build-module/components/post-excerpt/panel.js.map +1 -1
- package/build-module/components/post-featured-image/index.js +27 -9
- package/build-module/components/post-featured-image/index.js.map +1 -1
- package/build-module/components/post-format/index.js +2 -3
- package/build-module/components/post-format/index.js.map +1 -1
- package/build-module/components/post-format/panel.js +1 -2
- package/build-module/components/post-format/panel.js.map +1 -1
- package/build-module/components/post-last-revision/index.js +1 -1
- package/build-module/components/post-last-revision/index.js.map +1 -1
- package/build-module/components/post-locked-modal/index.js +3 -5
- package/build-module/components/post-locked-modal/index.js.map +1 -1
- package/build-module/components/post-panel-row/index.js +1 -2
- package/build-module/components/post-panel-row/index.js.map +1 -1
- package/build-module/components/post-preview-button/index.js +2 -4
- package/build-module/components/post-preview-button/index.js.map +1 -1
- package/build-module/components/post-publish-button/index.js +1 -2
- package/build-module/components/post-publish-button/index.js.map +1 -1
- package/build-module/components/post-publish-panel/index.js +1 -3
- package/build-module/components/post-publish-panel/index.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-category-panel.js +1 -2
- package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-post-format-panel.js +2 -3
- 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 +1 -2
- package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-upload-media.js +2 -2
- package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
- package/build-module/components/post-publish-panel/media-util.js +1 -0
- package/build-module/components/post-publish-panel/media-util.js.map +1 -1
- package/build-module/components/post-publish-panel/postpublish.js +2 -4
- package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
- package/build-module/components/post-publish-panel/prepublish.js +1 -3
- package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
- package/build-module/components/post-saved-state/index.js +1 -2
- package/build-module/components/post-saved-state/index.js.map +1 -1
- package/build-module/components/post-schedule/label.js +1 -1
- package/build-module/components/post-schedule/label.js.map +1 -1
- package/build-module/components/post-status/index.js +1 -3
- package/build-module/components/post-status/index.js.map +1 -1
- package/build-module/components/post-switch-to-draft-button/index.js +1 -3
- package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
- package/build-module/components/post-taxonomies/flat-term-selector.js +16 -10
- package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js +4 -4
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/index.js +1 -1
- package/build-module/components/post-taxonomies/index.js.map +1 -1
- package/build-module/components/post-taxonomies/most-used-terms.js +1 -2
- package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build-module/components/post-taxonomies/panel.js.map +1 -1
- package/build-module/components/post-template/block-theme.js +1 -3
- package/build-module/components/post-template/block-theme.js.map +1 -1
- package/build-module/components/post-template/classic-theme.js +3 -6
- package/build-module/components/post-template/classic-theme.js.map +1 -1
- package/build-module/components/post-template/create-new-template-modal.js +1 -2
- package/build-module/components/post-template/create-new-template-modal.js.map +1 -1
- package/build-module/components/post-template/create-new-template.js +1 -3
- package/build-module/components/post-template/create-new-template.js.map +1 -1
- package/build-module/components/post-template/swap-template-button.js +1 -3
- package/build-module/components/post-template/swap-template-button.js.map +1 -1
- package/build-module/components/post-text-editor/index.js +1 -3
- package/build-module/components/post-text-editor/index.js.map +1 -1
- package/build-module/components/post-title/index.js +15 -19
- package/build-module/components/post-title/index.js.map +1 -1
- package/build-module/components/post-title/index.native.js +2 -2
- package/build-module/components/post-title/index.native.js.map +1 -1
- package/build-module/components/post-trash/index.js +1 -2
- package/build-module/components/post-trash/index.js.map +1 -1
- package/build-module/components/post-url/index.js +78 -66
- package/build-module/components/post-url/index.js.map +1 -1
- package/build-module/components/post-url/panel.js +51 -31
- package/build-module/components/post-url/panel.js.map +1 -1
- package/build-module/components/post-visibility/index.js +1 -2
- package/build-module/components/post-visibility/index.js.map +1 -1
- package/build-module/components/posts-per-page/index.js +1 -3
- package/build-module/components/posts-per-page/index.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +1 -3
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/preview-dropdown/index.js +1 -7
- package/build-module/components/preview-dropdown/index.js.map +1 -1
- package/build-module/components/provider/index.js +11 -15
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/index.native.js +1 -3
- package/build-module/components/provider/index.native.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.js +1 -1
- package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
- package/build-module/components/resizable-editor/resize-handle.js +1 -3
- package/build-module/components/resizable-editor/resize-handle.js.map +1 -1
- package/build-module/components/save-publish-panels/index.js +1 -3
- package/build-module/components/save-publish-panels/index.js.map +1 -1
- package/build-module/components/sidebar/header.js +3 -3
- package/build-module/components/sidebar/header.js.map +1 -1
- package/build-module/components/sidebar/index.js +5 -6
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar/post-summary.js +1 -3
- package/build-module/components/sidebar/post-summary.js.map +1 -1
- package/build-module/components/site-discussion/index.js +1 -3
- package/build-module/components/site-discussion/index.js.map +1 -1
- package/build-module/components/start-template-options/index.js +1 -2
- package/build-module/components/start-template-options/index.js.map +1 -1
- package/build-module/components/table-of-contents/panel.js +1 -3
- package/build-module/components/table-of-contents/panel.js.map +1 -1
- package/build-module/components/template-part-menu-items/convert-to-template-part.js +1 -3
- package/build-module/components/template-part-menu-items/convert-to-template-part.js.map +1 -1
- package/build-module/components/template-validation-notice/index.js +1 -3
- package/build-module/components/template-validation-notice/index.js.map +1 -1
- package/build-module/components/text-editor/index.js +1 -2
- package/build-module/components/text-editor/index.js.map +1 -1
- package/build-module/components/time-to-read/index.js +2 -2
- package/build-module/components/time-to-read/index.js.map +1 -1
- package/build-module/components/visual-editor/edit-template-blocks-notification.js +4 -1
- package/build-module/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
- package/build-module/components/visual-editor/index.js +26 -29
- package/build-module/components/visual-editor/index.js.map +1 -1
- package/build-module/components/visual-editor/use-select-nearest-editable-block.js.map +1 -1
- package/build-module/components/visual-editor/use-zoom-out-mode-exit.js +46 -0
- package/build-module/components/visual-editor/use-zoom-out-mode-exit.js.map +1 -0
- package/build-module/components/zoom-out-toggle/index.js +37 -5
- package/build-module/components/zoom-out-toggle/index.js.map +1 -1
- package/build-module/dataviews/actions/duplicate-template-part.js +4 -4
- package/build-module/dataviews/actions/duplicate-template-part.js.map +1 -1
- package/build-module/hooks/pattern-overrides.js +1 -3
- package/build-module/hooks/pattern-overrides.js.map +1 -1
- package/build-module/private-apis.js +1 -2
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +30 -4
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/constants.js +1 -0
- package/build-module/store/constants.js.map +1 -1
- package/build-module/store/local-autosave.js.map +1 -1
- package/build-module/store/private-actions.js +9 -8
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/selectors.js +24 -2
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/media-upload/index.js.map +1 -1
- package/build-module/utils/pageTypeBadge.js +45 -0
- package/build-module/utils/pageTypeBadge.js.map +1 -0
- package/build-module/utils/terms.js +2 -2
- package/build-module/utils/terms.js.map +1 -1
- package/build-style/style-rtl.css +116 -59
- package/build-style/style.css +116 -59
- package/build-types/bindings/api.d.ts +0 -13
- package/build-types/bindings/api.d.ts.map +1 -1
- package/build-types/bindings/post-meta.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/add-comment.d.ts +15 -0
- package/build-types/components/collab-sidebar/add-comment.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/comment-button-toolbar.d.ts +5 -0
- package/build-types/components/collab-sidebar/comment-button-toolbar.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/comment-button.d.ts +5 -0
- package/build-types/components/collab-sidebar/comment-button.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/comments.d.ts +19 -0
- package/build-types/components/collab-sidebar/comments.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/constants.d.ts +2 -0
- package/build-types/components/collab-sidebar/constants.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/index.d.ts +5 -0
- package/build-types/components/collab-sidebar/index.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/utils.d.ts +8 -0
- package/build-types/components/collab-sidebar/utils.d.ts.map +1 -0
- package/build-types/components/commands/index.d.ts.map +1 -1
- package/build-types/components/document-bar/index.d.ts.map +1 -1
- package/build-types/components/document-tools/index.d.ts.map +1 -1
- package/build-types/components/editor-interface/index.d.ts +1 -2
- package/build-types/components/editor-interface/index.d.ts.map +1 -1
- package/build-types/components/global-styles-provider/index.d.ts.map +1 -1
- package/build-types/components/header/index.d.ts.map +1 -1
- package/build-types/components/inserter-sidebar/index.d.ts.map +1 -1
- package/build-types/components/page-attributes/parent.d.ts.map +1 -1
- package/build-types/components/plugin-more-menu-item/index.d.ts +62 -2
- package/build-types/components/plugin-more-menu-item/index.d.ts.map +1 -1
- package/build-types/components/plugin-preview-menu-item/index.d.ts +41 -2
- package/build-types/components/plugin-preview-menu-item/index.d.ts.map +1 -1
- package/build-types/components/plugin-sidebar/index.d.ts.map +1 -1
- package/build-types/components/post-author/panel.d.ts.map +1 -1
- package/build-types/components/post-card-panel/index.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/flat-term-selector.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts.map +1 -1
- package/build-types/components/post-template/classic-theme.d.ts.map +1 -1
- package/build-types/components/post-url/index.d.ts.map +1 -1
- package/build-types/components/post-url/panel.d.ts.map +1 -1
- package/build-types/components/preview-dropdown/index.d.ts.map +1 -1
- package/build-types/components/provider/index.d.ts.map +1 -1
- package/build-types/components/sidebar/index.d.ts.map +1 -1
- package/build-types/components/visual-editor/edit-template-blocks-notification.d.ts.map +1 -1
- package/build-types/components/visual-editor/index.d.ts.map +1 -1
- package/build-types/components/visual-editor/use-zoom-out-mode-exit.d.ts +5 -0
- package/build-types/components/visual-editor/use-zoom-out-mode-exit.d.ts.map +1 -0
- package/build-types/components/zoom-out-toggle/index.d.ts +3 -1
- package/build-types/components/zoom-out-toggle/index.d.ts.map +1 -1
- package/build-types/private-apis.d.ts.map +1 -1
- package/build-types/store/actions.d.ts +1 -4
- package/build-types/store/actions.d.ts.map +1 -1
- package/build-types/store/selectors.d.ts +21 -0
- package/build-types/store/selectors.d.ts.map +1 -1
- package/build-types/utils/pageTypeBadge.d.ts +5 -0
- package/build-types/utils/pageTypeBadge.d.ts.map +1 -0
- package/build-types/utils/terms.d.ts.map +1 -1
- package/package.json +39 -38
- package/src/bindings/api.js +1 -32
- package/src/bindings/post-meta.js +1 -0
- package/src/components/collab-sidebar/add-comment.js +124 -0
- package/src/components/collab-sidebar/comment-button-toolbar.js +29 -0
- package/src/components/collab-sidebar/comment-button.js +31 -0
- package/src/components/collab-sidebar/comments.js +404 -0
- package/src/components/collab-sidebar/constants.js +1 -0
- package/src/components/collab-sidebar/index.js +307 -0
- package/src/components/collab-sidebar/style.scss +111 -0
- package/src/components/collab-sidebar/utils.js +9 -0
- package/src/components/commands/index.js +9 -7
- package/src/components/document-bar/index.js +15 -7
- package/src/components/document-bar/style.scss +0 -4
- package/src/components/document-tools/index.js +2 -8
- package/src/components/editor-interface/index.js +4 -18
- package/src/components/entities-saved-states/index.js +2 -2
- package/src/components/global-keyboard-shortcuts/register-shortcuts.js +3 -3
- package/src/components/global-styles-provider/index.js +20 -6
- package/src/components/header/index.js +3 -1
- package/src/components/header/style.scss +1 -0
- package/src/components/inserter-sidebar/index.js +3 -6
- package/src/components/page-attributes/parent.js +6 -4
- package/src/components/plugin-more-menu-item/index.js +12 -11
- package/src/components/plugin-preview-menu-item/index.js +14 -13
- package/src/components/plugin-sidebar/index.js +0 -13
- package/src/components/post-actions/index.js +8 -11
- package/src/components/post-author/panel.js +4 -2
- package/src/components/post-card-panel/index.js +9 -43
- package/src/components/post-card-panel/style.scss +1 -9
- package/src/components/post-content-information/index.js +1 -1
- package/src/components/post-featured-image/index.js +31 -16
- package/src/components/post-featured-image/style.scss +5 -2
- package/src/components/post-last-revision/index.js +1 -1
- package/src/components/post-saved-state/test/__snapshots__/index.js.snap +1 -1
- package/src/components/post-schedule/label.js +1 -1
- package/src/components/post-sticky/test/index.js +6 -6
- package/src/components/post-taxonomies/flat-term-selector.js +15 -4
- package/src/components/post-taxonomies/hierarchical-term-selector.js +3 -2
- package/src/components/post-template/classic-theme.js +1 -2
- package/src/components/post-url/index.js +67 -55
- package/src/components/post-url/panel.js +61 -35
- package/src/components/post-url/style.scss +21 -3
- package/src/components/preview-dropdown/index.js +0 -2
- package/src/components/provider/index.js +32 -24
- package/src/components/provider/use-block-editor-settings.js +1 -1
- package/src/components/sidebar/header.js +3 -2
- package/src/components/sidebar/index.js +5 -3
- package/src/components/time-to-read/index.js +3 -3
- package/src/components/visual-editor/edit-template-blocks-notification.js +5 -1
- package/src/components/visual-editor/index.js +32 -39
- package/src/components/visual-editor/use-zoom-out-mode-exit.js +49 -0
- package/src/components/zoom-out-toggle/index.js +39 -5
- package/src/dataviews/actions/duplicate-template-part.tsx +3 -3
- package/src/private-apis.js +1 -5
- package/src/store/actions.js +33 -4
- package/src/store/private-actions.js +3 -3
- package/src/store/selectors.js +24 -2
- package/src/style.scss +1 -0
- package/src/utils/pageTypeBadge.js +41 -0
- package/src/utils/terms.js +4 -2
- package/src/utils/test/terms.js +3 -3
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -14,9 +14,7 @@ import { usePreferredColorSchemeStyle } from '@wordpress/compose';
|
|
|
14
14
|
*/
|
|
15
15
|
import styles from './style.scss';
|
|
16
16
|
import { HelpDetailBodyText, HelpDetailSectionHeadingText, HelpDetailImage } from './view-sections';
|
|
17
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
17
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
20
18
|
const IntroToBlocks = () => {
|
|
21
19
|
const titleStyle = usePreferredColorSchemeStyle(styles.helpDetailTitle, styles.helpDetailTitleDark);
|
|
22
20
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["View","Text","__","usePreferredColorSchemeStyle","styles","HelpDetailBodyText","HelpDetailSectionHeadingText","HelpDetailImage","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","IntroToBlocks","titleStyle","helpDetailTitle","helpDetailTitleDark","children","source","require","style","helpDetailContainer","accessibilityRole","selectable","text","accessible","accessibilityLabel","sourceDarkMode"],"sources":["@wordpress/editor/src/components/editor-help/intro-to-blocks.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View, Text } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\nimport {\n\tHelpDetailBodyText,\n\tHelpDetailSectionHeadingText,\n\tHelpDetailImage,\n} from './view-sections';\n\nconst IntroToBlocks = () => {\n\tconst titleStyle = usePreferredColorSchemeStyle(\n\t\tstyles.helpDetailTitle,\n\t\tstyles.helpDetailTitleDark\n\t);\n\treturn (\n\t\t<>\n\t\t\t<HelpDetailImage\n\t\t\t\tsource={ require( './images/block-layout-collage.png' ) }\n\t\t\t/>\n\t\t\t<View style={ styles.helpDetailContainer }>\n\t\t\t\t<Text\n\t\t\t\t\taccessibilityRole=\"header\"\n\t\t\t\t\tselectable\n\t\t\t\t\tstyle={ titleStyle }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Welcome to the world of blocks' ) }\n\t\t\t\t</Text>\n\t\t\t\t<HelpDetailBodyText\n\t\t\t\t\ttext={ __(\n\t\t\t\t\t\t'Blocks are pieces of content that you can insert, rearrange, and style without needing to know how to code. Blocks are an easy and modern way for you to create beautiful layouts.'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t\t<HelpDetailSectionHeadingText\n\t\t\t\t\ttext={ __( 'Rich text editing' ) }\n\t\t\t\t/>\n\t\t\t\t<HelpDetailBodyText\n\t\t\t\t\ttext={ __(\n\t\t\t\t\t\t'Blocks allow you to focus on writing your content, knowing that all the formatting tools you need are there to help you get your message across.'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t\t<HelpDetailImage\n\t\t\t\t\taccessible\n\t\t\t\t\taccessibilityLabel={ __(\n\t\t\t\t\t\t'Text formatting controls are located within the toolbar positioned above the keyboard while editing a text block'\n\t\t\t\t\t) }\n\t\t\t\t\tsource={ require( './images/rich-text-light.png' ) }\n\t\t\t\t\tsourceDarkMode={ require( './images/rich-text-dark.png' ) }\n\t\t\t\t/>\n\t\t\t\t<HelpDetailSectionHeadingText text={ __( 'Embed media' ) } />\n\t\t\t\t<HelpDetailBodyText\n\t\t\t\t\ttext={ __(\n\t\t\t\t\t\t'Make your content stand out by adding images, gifs, videos, and embedded media to your pages.'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t\t<HelpDetailImage\n\t\t\t\t\tsource={ require( './images/embed-media-light.png' ) }\n\t\t\t\t\tsourceDarkMode={ require( './images/embed-media-dark.png' ) }\n\t\t\t\t/>\n\t\t\t\t<HelpDetailSectionHeadingText text={ __( 'Build layouts' ) } />\n\t\t\t\t<HelpDetailBodyText\n\t\t\t\t\ttext={ __(\n\t\t\t\t\t\t'Arrange your content into columns, add Call to Action buttons, and overlay images with text.'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t\t<HelpDetailImage\n\t\t\t\t\tsource={ require( './images/build-layouts-light.png' ) }\n\t\t\t\t\tsourceDarkMode={ require( './images/build-layouts-dark.png' ) }\n\t\t\t\t/>\n\t\t\t\t<HelpDetailBodyText\n\t\t\t\t\ttext={ __(\n\t\t\t\t\t\t'Give it a try by adding a few blocks to your post or page!'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</View>\n\t\t</>\n\t);\n};\n\nexport default IntroToBlocks;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAI,EAAEC,IAAI,QAAQ,cAAc;;AAEzC;AACA;AACA;AACA,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,4BAA4B,QAAQ,oBAAoB;;AAEjE;AACA;AACA;AACA,OAAOC,MAAM,MAAM,cAAc;AACjC,SACCC,kBAAkB,EAClBC,4BAA4B,EAC5BC,eAAe,QACT,iBAAiB;AAAC,SAAAC,GAAA,IAAAC,IAAA
|
|
1
|
+
{"version":3,"names":["View","Text","__","usePreferredColorSchemeStyle","styles","HelpDetailBodyText","HelpDetailSectionHeadingText","HelpDetailImage","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","IntroToBlocks","titleStyle","helpDetailTitle","helpDetailTitleDark","children","source","require","style","helpDetailContainer","accessibilityRole","selectable","text","accessible","accessibilityLabel","sourceDarkMode"],"sources":["@wordpress/editor/src/components/editor-help/intro-to-blocks.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View, Text } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\nimport {\n\tHelpDetailBodyText,\n\tHelpDetailSectionHeadingText,\n\tHelpDetailImage,\n} from './view-sections';\n\nconst IntroToBlocks = () => {\n\tconst titleStyle = usePreferredColorSchemeStyle(\n\t\tstyles.helpDetailTitle,\n\t\tstyles.helpDetailTitleDark\n\t);\n\treturn (\n\t\t<>\n\t\t\t<HelpDetailImage\n\t\t\t\tsource={ require( './images/block-layout-collage.png' ) }\n\t\t\t/>\n\t\t\t<View style={ styles.helpDetailContainer }>\n\t\t\t\t<Text\n\t\t\t\t\taccessibilityRole=\"header\"\n\t\t\t\t\tselectable\n\t\t\t\t\tstyle={ titleStyle }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Welcome to the world of blocks' ) }\n\t\t\t\t</Text>\n\t\t\t\t<HelpDetailBodyText\n\t\t\t\t\ttext={ __(\n\t\t\t\t\t\t'Blocks are pieces of content that you can insert, rearrange, and style without needing to know how to code. Blocks are an easy and modern way for you to create beautiful layouts.'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t\t<HelpDetailSectionHeadingText\n\t\t\t\t\ttext={ __( 'Rich text editing' ) }\n\t\t\t\t/>\n\t\t\t\t<HelpDetailBodyText\n\t\t\t\t\ttext={ __(\n\t\t\t\t\t\t'Blocks allow you to focus on writing your content, knowing that all the formatting tools you need are there to help you get your message across.'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t\t<HelpDetailImage\n\t\t\t\t\taccessible\n\t\t\t\t\taccessibilityLabel={ __(\n\t\t\t\t\t\t'Text formatting controls are located within the toolbar positioned above the keyboard while editing a text block'\n\t\t\t\t\t) }\n\t\t\t\t\tsource={ require( './images/rich-text-light.png' ) }\n\t\t\t\t\tsourceDarkMode={ require( './images/rich-text-dark.png' ) }\n\t\t\t\t/>\n\t\t\t\t<HelpDetailSectionHeadingText text={ __( 'Embed media' ) } />\n\t\t\t\t<HelpDetailBodyText\n\t\t\t\t\ttext={ __(\n\t\t\t\t\t\t'Make your content stand out by adding images, gifs, videos, and embedded media to your pages.'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t\t<HelpDetailImage\n\t\t\t\t\tsource={ require( './images/embed-media-light.png' ) }\n\t\t\t\t\tsourceDarkMode={ require( './images/embed-media-dark.png' ) }\n\t\t\t\t/>\n\t\t\t\t<HelpDetailSectionHeadingText text={ __( 'Build layouts' ) } />\n\t\t\t\t<HelpDetailBodyText\n\t\t\t\t\ttext={ __(\n\t\t\t\t\t\t'Arrange your content into columns, add Call to Action buttons, and overlay images with text.'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t\t<HelpDetailImage\n\t\t\t\t\tsource={ require( './images/build-layouts-light.png' ) }\n\t\t\t\t\tsourceDarkMode={ require( './images/build-layouts-dark.png' ) }\n\t\t\t\t/>\n\t\t\t\t<HelpDetailBodyText\n\t\t\t\t\ttext={ __(\n\t\t\t\t\t\t'Give it a try by adding a few blocks to your post or page!'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</View>\n\t\t</>\n\t);\n};\n\nexport default IntroToBlocks;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAI,EAAEC,I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;MAAG,CAC3D,CAAC,eACFX,IAAA,CAACH,4BAA4B;QAACmB,IAAI,EAAGvB,EAAE,CAAE,aAAc;MAAG,CAAE,CAAC,eAC7DO,IAAA,CAACJ,kBAAkB;QAClBoB,IAAI,EAAGvB,EAAE,CACR,+FACD;MAAG,CACH,CAAC,eACFO,IAAA,CAACF,eAAe;QACfY,MAAM,EAAGC,OAAO,CAAE,gCAAiC,CAAG;QACtDQ,cAAc,EAAGR,OAAO,CAAE,+BAAgC;MAAG,CAC7D,CAAC,eACFX,IAAA,CAACH,4BAA4B;QAACmB,IAAI,EAAGvB,EAAE,CAAE,eAAgB;MAAG,CAAE,CAAC,eAC/DO,IAAA,CAACJ,kBAAkB;QAClBoB,IAAI,EAAGvB,EAAE,CACR,8FACD;MAAG,CACH,CAAC,eACFO,IAAA,CAACF,eAAe;QACfY,MAAM,EAAGC,OAAO,CAAE,kCAAmC,CAAG;QACxDQ,cAAc,EAAGR,OAAO,CAAE,iCAAkC;MAAG,CAC/D,CAAC,eACFX,IAAA,CAACJ,kBAAkB;QAClBoB,IAAI,EAAGvB,EAAE,CACR,4DACD;MAAG,CACH,CAAC;IAAA,CACG,CAAC;EAAA,CACN,CAAC;AAEL,CAAC;AAED,eAAeY,aAAa","ignoreList":[]}
|
|
@@ -13,9 +13,7 @@ import { __ } from '@wordpress/i18n';
|
|
|
13
13
|
*/
|
|
14
14
|
import styles from './style.scss';
|
|
15
15
|
import { HelpDetailBodyText, HelpDetailImage, HelpDetailSectionHeadingText } from './view-sections';
|
|
16
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
16
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
19
17
|
const MoveBlocks = () => {
|
|
20
18
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
21
19
|
children: [/*#__PURE__*/_jsx(HelpDetailImage, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["View","__","styles","HelpDetailBodyText","HelpDetailImage","HelpDetailSectionHeadingText","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","MoveBlocks","children","source","require","sourceDarkMode","style","helpDetailContainer","text","badge"],"sources":["@wordpress/editor/src/components/editor-help/move-blocks.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\nimport {\n\tHelpDetailBodyText,\n\tHelpDetailImage,\n\tHelpDetailSectionHeadingText,\n} from './view-sections';\n\nconst MoveBlocks = () => {\n\treturn (\n\t\t<>\n\t\t\t<HelpDetailImage\n\t\t\t\tsource={ require( './images/drag-and-drop-light.png' ) }\n\t\t\t\tsourceDarkMode={ require( './images/drag-and-drop-dark.png' ) }\n\t\t\t/>\n\t\t\t<View style={ styles.helpDetailContainer }>\n\t\t\t\t<HelpDetailSectionHeadingText\n\t\t\t\t\ttext={ __( 'Drag & drop' ) }\n\t\t\t\t\tbadge={ __( 'NEW' ) }\n\t\t\t\t/>\n\t\t\t\t<HelpDetailBodyText\n\t\t\t\t\ttext={ __(\n\t\t\t\t\t\t'Drag & drop makes rearranging blocks a breeze. Press and hold on a block, then drag it to its new location and release.'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</View>\n\t\t\t<HelpDetailImage\n\t\t\t\tsource={ require( './images/move-light.png' ) }\n\t\t\t\tsourceDarkMode={ require( './images/move-dark.png' ) }\n\t\t\t/>\n\t\t\t<View style={ styles.helpDetailContainer }>\n\t\t\t\t<HelpDetailSectionHeadingText text={ __( 'Arrow buttons' ) } />\n\t\t\t\t<HelpDetailBodyText\n\t\t\t\t\ttext={ __(\n\t\t\t\t\t\t'You can also rearrange blocks by tapping a block and then tapping the up and down arrows that appear on the bottom left side of the block to move it up or down.'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</View>\n\t\t</>\n\t);\n};\n\nexport default MoveBlocks;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAI,QAAQ,cAAc;;AAEnC;AACA;AACA;AACA,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,OAAOC,MAAM,MAAM,cAAc;AACjC,SACCC,kBAAkB,EAClBC,eAAe,EACfC,4BAA4B,QACtB,iBAAiB;AAAC,SAAAC,GAAA,IAAAC,IAAA
|
|
1
|
+
{"version":3,"names":["View","__","styles","HelpDetailBodyText","HelpDetailImage","HelpDetailSectionHeadingText","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","MoveBlocks","children","source","require","sourceDarkMode","style","helpDetailContainer","text","badge"],"sources":["@wordpress/editor/src/components/editor-help/move-blocks.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\nimport {\n\tHelpDetailBodyText,\n\tHelpDetailImage,\n\tHelpDetailSectionHeadingText,\n} from './view-sections';\n\nconst MoveBlocks = () => {\n\treturn (\n\t\t<>\n\t\t\t<HelpDetailImage\n\t\t\t\tsource={ require( './images/drag-and-drop-light.png' ) }\n\t\t\t\tsourceDarkMode={ require( './images/drag-and-drop-dark.png' ) }\n\t\t\t/>\n\t\t\t<View style={ styles.helpDetailContainer }>\n\t\t\t\t<HelpDetailSectionHeadingText\n\t\t\t\t\ttext={ __( 'Drag & drop' ) }\n\t\t\t\t\tbadge={ __( 'NEW' ) }\n\t\t\t\t/>\n\t\t\t\t<HelpDetailBodyText\n\t\t\t\t\ttext={ __(\n\t\t\t\t\t\t'Drag & drop makes rearranging blocks a breeze. Press and hold on a block, then drag it to its new location and release.'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</View>\n\t\t\t<HelpDetailImage\n\t\t\t\tsource={ require( './images/move-light.png' ) }\n\t\t\t\tsourceDarkMode={ require( './images/move-dark.png' ) }\n\t\t\t/>\n\t\t\t<View style={ styles.helpDetailContainer }>\n\t\t\t\t<HelpDetailSectionHeadingText text={ __( 'Arrow buttons' ) } />\n\t\t\t\t<HelpDetailBodyText\n\t\t\t\t\ttext={ __(\n\t\t\t\t\t\t'You can also rearrange blocks by tapping a block and then tapping the up and down arrows that appear on the bottom left side of the block to move it up or down.'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</View>\n\t\t</>\n\t);\n};\n\nexport default MoveBlocks;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAI,QAAQ,cAAc;;AAEnC;AACA;AACA;AACA,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,OAAOC,MAAM,MAAM,cAAc;AACjC,SACCC,kBAAkB,EAClBC,eAAe,EACfC,4BAA4B,QACtB,iBAAiB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAEzB,MAAMC,UAAU,GAAGA,CAAA,KAAM;EACxB,oBACCH,KAAA,CAAAE,SAAA;IAAAE,QAAA,gBACCN,IAAA,CAACH,eAAe;MACfU,MAAM,EAAGC,OAAO,CAAE,kCAAmC,CAAG;MACxDC,cAAc,EAAGD,OAAO,CAAE,iCAAkC;IAAG,CAC/D,CAAC,eACFN,KAAA,CAACT,IAAI;MAACiB,KAAK,EAAGf,MAAM,CAACgB,mBAAqB;MAAAL,QAAA,gBACzCN,IAAA,CAACF,4BAA4B;QAC5Bc,IAAI,EAAGlB,EAAE,CAAE,aAAc,CAAG;QAC5BmB,KAAK,EAAGnB,EAAE,CAAE,KAAM;MAAG,CACrB,CAAC,eACFM,IAAA,CAACJ,kBAAkB;QAClBgB,IAAI,EAAGlB,EAAE,CACR,yHACD;MAAG,CACH,CAAC;IAAA,CACG,CAAC,eACPM,IAAA,CAACH,eAAe;MACfU,MAAM,EAAGC,OAAO,CAAE,yBAA0B,CAAG;MAC/CC,cAAc,EAAGD,OAAO,CAAE,wBAAyB;IAAG,CACtD,CAAC,eACFN,KAAA,CAACT,IAAI;MAACiB,KAAK,EAAGf,MAAM,CAACgB,mBAAqB;MAAAL,QAAA,gBACzCN,IAAA,CAACF,4BAA4B;QAACc,IAAI,EAAGlB,EAAE,CAAE,eAAgB;MAAG,CAAE,CAAC,eAC/DM,IAAA,CAACJ,kBAAkB;QAClBgB,IAAI,EAAGlB,EAAE,CACR,kKACD;MAAG,CACH,CAAC;IAAA,CACG,CAAC;EAAA,CACN,CAAC;AAEL,CAAC;AAED,eAAeW,UAAU","ignoreList":[]}
|
|
@@ -13,9 +13,7 @@ import { __ } from '@wordpress/i18n';
|
|
|
13
13
|
*/
|
|
14
14
|
import styles from './style.scss';
|
|
15
15
|
import { HelpDetailBodyText, HelpDetailImage } from './view-sections';
|
|
16
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
18
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
17
|
const RemoveBlocks = () => {
|
|
20
18
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
21
19
|
children: [/*#__PURE__*/_jsx(HelpDetailImage, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["View","__","styles","HelpDetailBodyText","HelpDetailImage","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","RemoveBlocks","children","source","require","sourceDarkMode","style","helpDetailContainer","text"],"sources":["@wordpress/editor/src/components/editor-help/remove-blocks.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\nimport { HelpDetailBodyText, HelpDetailImage } from './view-sections';\n\nconst RemoveBlocks = () => {\n\treturn (\n\t\t<>\n\t\t\t<HelpDetailImage\n\t\t\t\tsource={ require( './images/options-light.png' ) }\n\t\t\t\tsourceDarkMode={ require( './images/options-dark.png' ) }\n\t\t\t/>\n\t\t\t<View style={ styles.helpDetailContainer }>\n\t\t\t\t<HelpDetailBodyText\n\t\t\t\t\ttext={ __(\n\t\t\t\t\t\t'To remove a block, select the block and click the three dots in the bottom right of the block to view the settings. From there, choose the option to remove the block.'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</View>\n\t\t</>\n\t);\n};\n\nexport default RemoveBlocks;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAI,QAAQ,cAAc;;AAEnC;AACA;AACA;AACA,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,OAAOC,MAAM,MAAM,cAAc;AACjC,SAASC,kBAAkB,EAAEC,eAAe,QAAQ,iBAAiB;AAAC,SAAAC,GAAA,IAAAC,IAAA
|
|
1
|
+
{"version":3,"names":["View","__","styles","HelpDetailBodyText","HelpDetailImage","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","RemoveBlocks","children","source","require","sourceDarkMode","style","helpDetailContainer","text"],"sources":["@wordpress/editor/src/components/editor-help/remove-blocks.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\nimport { HelpDetailBodyText, HelpDetailImage } from './view-sections';\n\nconst RemoveBlocks = () => {\n\treturn (\n\t\t<>\n\t\t\t<HelpDetailImage\n\t\t\t\tsource={ require( './images/options-light.png' ) }\n\t\t\t\tsourceDarkMode={ require( './images/options-dark.png' ) }\n\t\t\t/>\n\t\t\t<View style={ styles.helpDetailContainer }>\n\t\t\t\t<HelpDetailBodyText\n\t\t\t\t\ttext={ __(\n\t\t\t\t\t\t'To remove a block, select the block and click the three dots in the bottom right of the block to view the settings. From there, choose the option to remove the block.'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</View>\n\t\t</>\n\t);\n};\n\nexport default RemoveBlocks;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAI,QAAQ,cAAc;;AAEnC;AACA;AACA;AACA,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,OAAOC,MAAM,MAAM,cAAc;AACjC,SAASC,kBAAkB,EAAEC,eAAe,QAAQ,iBAAiB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAEtE,MAAMC,YAAY,GAAGA,CAAA,KAAM;EAC1B,oBACCD,KAAA,CAAAF,SAAA;IAAAI,QAAA,gBACCN,IAAA,CAACF,eAAe;MACfS,MAAM,EAAGC,OAAO,CAAE,4BAA6B,CAAG;MAClDC,cAAc,EAAGD,OAAO,CAAE,2BAA4B;IAAG,CACzD,CAAC,eACFR,IAAA,CAACN,IAAI;MAACgB,KAAK,EAAGd,MAAM,CAACe,mBAAqB;MAAAL,QAAA,eACzCN,IAAA,CAACH,kBAAkB;QAClBe,IAAI,EAAGjB,EAAE,CACR,wKACD;MAAG,CACH;IAAC,CACG,CAAC;EAAA,CACN,CAAC;AAEL,CAAC;AAED,eAAeU,YAAY","ignoreList":[]}
|
|
@@ -12,8 +12,7 @@ import { usePreferredColorScheme, usePreferredColorSchemeStyle } from '@wordpres
|
|
|
12
12
|
* Internal dependencies
|
|
13
13
|
*/
|
|
14
14
|
import styles from './style.scss';
|
|
15
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
16
|
export const HelpDetailBodyText = ({
|
|
18
17
|
text
|
|
19
18
|
}) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Text","Image","View","usePreferredColorScheme","usePreferredColorSchemeStyle","styles","jsx","_jsx","jsxs","_jsxs","HelpDetailBodyText","text","bodyStyle","helpDetailBody","helpDetailBodyDark","selectable","style","children","HelpDetailSectionHeadingText","badge","headingTextStyle","helpDetailSectionHeadingText","helpDetailSectionHeadingTextDark","helpDetailSectionHeading","HelpDetailBadge","accessibilityRole","HelpDetailImage","accessible","accessibilityLabel","source","sourceDarkMode","imageStyle","helpDetailImage","helpDetailImageDark","darkModeEnabled","helpDetailBadgeContainer","helpDetailBadgeText"],"sources":["@wordpress/editor/src/components/editor-help/view-sections.native.js"],"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"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAI,EAAEC,KAAK,EAAEC,IAAI,QAAQ,cAAc;;AAEhD;AACA;AACA;AACA,SACCC,uBAAuB,EACvBC,4BAA4B,QACtB,oBAAoB;;AAE3B;AACA;AACA;AACA,OAAOC,MAAM,MAAM,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA
|
|
1
|
+
{"version":3,"names":["Text","Image","View","usePreferredColorScheme","usePreferredColorSchemeStyle","styles","jsx","_jsx","jsxs","_jsxs","HelpDetailBodyText","text","bodyStyle","helpDetailBody","helpDetailBodyDark","selectable","style","children","HelpDetailSectionHeadingText","badge","headingTextStyle","helpDetailSectionHeadingText","helpDetailSectionHeadingTextDark","helpDetailSectionHeading","HelpDetailBadge","accessibilityRole","HelpDetailImage","accessible","accessibilityLabel","source","sourceDarkMode","imageStyle","helpDetailImage","helpDetailImageDark","darkModeEnabled","helpDetailBadgeContainer","helpDetailBadgeText"],"sources":["@wordpress/editor/src/components/editor-help/view-sections.native.js"],"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"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAI,EAAEC,KAAK,EAAEC,IAAI,QAAQ,cAAc;;AAEhD;AACA;AACA;AACA,SACCC,uBAAuB,EACvBC,4BA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zBC,kBAAkB,EAAGA,kBAAoB;IACzCC,MAAM,EACLK,eAAe,IAAIJ,cAAc,GAAGA,cAAc,GAAGD,MACrD;IACDb,KAAK,EAAGe;EAAY,CACpB,CAAC;AAEJ,CAAC;AAED,MAAMP,eAAe,GAAGA,CAAE;EAAEb;AAAK,CAAC,KAAM;EACvC,oBACCJ,IAAA,CAACL,IAAI;IAACc,KAAK,EAAGX,MAAM,CAAC8B,wBAA0B;IAAAlB,QAAA,eAC9CV,IAAA,CAACP,IAAI;MAACgB,KAAK,EAAGX,MAAM,CAAC+B,mBAAqB;MAAAnB,QAAA,EAAGN;IAAI,CAAQ;EAAC,CACrD,CAAC;AAET,CAAC","ignoreList":[]}
|
|
@@ -11,7 +11,6 @@ import { useSelect } from '@wordpress/data';
|
|
|
11
11
|
import { __, _x } from '@wordpress/i18n';
|
|
12
12
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
13
13
|
import { store as blockEditorStore, BlockBreadcrumb, BlockToolbar } from '@wordpress/block-editor';
|
|
14
|
-
import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
|
|
15
14
|
import { useViewportMatch } from '@wordpress/compose';
|
|
16
15
|
import { useState, useCallback } from '@wordpress/element';
|
|
17
16
|
|
|
@@ -28,9 +27,7 @@ import TextEditor from '../text-editor';
|
|
|
28
27
|
import VisualEditor from '../visual-editor';
|
|
29
28
|
import EditorContentSlotFill from './content-slot-fill';
|
|
30
29
|
import { unlock } from '../../lock-unlock';
|
|
31
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
32
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
33
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
30
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
34
31
|
const interfaceLabels = {
|
|
35
32
|
/* translators: accessibility text for the editor top bar landmark region. */
|
|
36
33
|
header: __('Editor top bar'),
|
|
@@ -45,7 +42,6 @@ const interfaceLabels = {
|
|
|
45
42
|
};
|
|
46
43
|
export default function EditorInterface({
|
|
47
44
|
className,
|
|
48
|
-
enableRegionNavigation,
|
|
49
45
|
styles,
|
|
50
46
|
children,
|
|
51
47
|
forceIsDirty,
|
|
@@ -65,8 +61,6 @@ export default function EditorInterface({
|
|
|
65
61
|
isListViewOpened,
|
|
66
62
|
isDistractionFree,
|
|
67
63
|
isPreviewMode,
|
|
68
|
-
previousShortcut,
|
|
69
|
-
nextShortcut,
|
|
70
64
|
showBlockBreadcrumbs,
|
|
71
65
|
documentLabel,
|
|
72
66
|
isZoomOut
|
|
@@ -89,12 +83,11 @@ export default function EditorInterface({
|
|
|
89
83
|
isInserterOpened: select(editorStore).isInserterOpened(),
|
|
90
84
|
isListViewOpened: select(editorStore).isListViewOpened(),
|
|
91
85
|
isDistractionFree: get('core', 'distractionFree'),
|
|
92
|
-
isPreviewMode: editorSettings.
|
|
93
|
-
previousShortcut: select(keyboardShortcutsStore).getAllShortcutKeyCombinations('core/editor/previous-region'),
|
|
94
|
-
nextShortcut: select(keyboardShortcutsStore).getAllShortcutKeyCombinations('core/editor/next-region'),
|
|
86
|
+
isPreviewMode: editorSettings.isPreviewMode,
|
|
95
87
|
showBlockBreadcrumbs: get('core', 'showBlockBreadcrumbs'),
|
|
88
|
+
documentLabel:
|
|
96
89
|
// translators: Default label for the Document in the Block Breadcrumb.
|
|
97
|
-
|
|
90
|
+
postTypeLabel || _x('Document', 'noun, breadcrumb'),
|
|
98
91
|
isZoomOut: _isZoomOut()
|
|
99
92
|
};
|
|
100
93
|
}, []);
|
|
@@ -111,7 +104,6 @@ export default function EditorInterface({
|
|
|
111
104
|
setEntitiesSavedStatesCallback(false);
|
|
112
105
|
}, [entitiesSavedStatesCallback]);
|
|
113
106
|
return /*#__PURE__*/_jsx(InterfaceSkeleton, {
|
|
114
|
-
enableRegionNavigation: enableRegionNavigation,
|
|
115
107
|
isDistractionFree: isDistractionFree,
|
|
116
108
|
className: clsx('editor-editor-interface', className, {
|
|
117
109
|
'is-entity-save-view-open': !!entitiesSavedStatesCallback,
|
|
@@ -165,11 +157,7 @@ export default function EditorInterface({
|
|
|
165
157
|
isEntitiesSavedStatesOpen: entitiesSavedStatesCallback,
|
|
166
158
|
setEntitiesSavedStatesCallback: setEntitiesSavedStatesCallback,
|
|
167
159
|
forceIsDirtyPublishPanel: forceIsDirty
|
|
168
|
-
}) : undefined
|
|
169
|
-
shortcuts: {
|
|
170
|
-
previous: previousShortcut,
|
|
171
|
-
next: nextShortcut
|
|
172
|
-
}
|
|
160
|
+
}) : undefined
|
|
173
161
|
});
|
|
174
162
|
}
|
|
175
163
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","InterfaceSkeleton","ComplementaryArea","useSelect","__","_x","store","preferencesStore","blockEditorStore","BlockBreadcrumb","BlockToolbar","keyboardShortcutsStore","useViewportMatch","useState","useCallback","editorStore","EditorNotices","Header","InserterSidebar","ListViewSidebar","SavePublishPanels","TextEditor","VisualEditor","EditorContentSlotFill","unlock","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","interfaceLabels","header","body","sidebar","actions","footer","EditorInterface","className","enableRegionNavigation","styles","children","forceIsDirty","contentRef","disableIframe","autoFocus","customSaveButton","customSavePanel","forceDisableBlockTools","title","iframeProps","mode","isRichEditingEnabled","isInserterOpened","isListViewOpened","isDistractionFree","isPreviewMode","previousShortcut","nextShortcut","showBlockBreadcrumbs","documentLabel","isZoomOut","select","get","getEditorSettings","getPostTypeLabel","editorSettings","postTypeLabel","_isZoomOut","getEditorMode","richEditingEnabled","__unstableIsPreviewMode","getAllShortcutKeyCombinations","isLargeViewport","secondarySidebarLabel","entitiesSavedStatesCallback","setEntitiesSavedStatesCallback","closeEntitiesSavedStates","arg","labels","secondarySidebar","isEditorIframed","editorNotices","Slot","scope","content","editorCanvasView","hideDragHandle","rootLabelText","isEntitiesSavedStatesOpen","forceIsDirtyPublishPanel","undefined","shortcuts","previous","next"],"sources":["@wordpress/editor/src/components/editor-interface/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { InterfaceSkeleton, ComplementaryArea } from '@wordpress/interface';\nimport { useSelect } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tstore as blockEditorStore,\n\tBlockBreadcrumb,\n\tBlockToolbar,\n} from '@wordpress/block-editor';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useState, useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport EditorNotices from '../editor-notices';\nimport Header from '../header';\nimport InserterSidebar from '../inserter-sidebar';\nimport ListViewSidebar from '../list-view-sidebar';\nimport SavePublishPanels from '../save-publish-panels';\nimport TextEditor from '../text-editor';\nimport VisualEditor from '../visual-editor';\nimport EditorContentSlotFill from './content-slot-fill';\n\nimport { unlock } from '../../lock-unlock';\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the editor top bar landmark region. */\n\theader: __( 'Editor top bar' ),\n\t/* translators: accessibility text for the editor content landmark region. */\n\tbody: __( 'Editor content' ),\n\t/* translators: accessibility text for the editor settings landmark region. */\n\tsidebar: __( 'Editor settings' ),\n\t/* translators: accessibility text for the editor publish landmark region. */\n\tactions: __( 'Editor publish' ),\n\t/* translators: accessibility text for the editor footer landmark region. */\n\tfooter: __( 'Editor footer' ),\n};\n\nexport default function EditorInterface( {\n\tclassName,\n\tenableRegionNavigation,\n\tstyles,\n\tchildren,\n\tforceIsDirty,\n\tcontentRef,\n\tdisableIframe,\n\tautoFocus,\n\tcustomSaveButton,\n\tcustomSavePanel,\n\tforceDisableBlockTools,\n\ttitle,\n\tiframeProps,\n} ) {\n\tconst {\n\t\tmode,\n\t\tisRichEditingEnabled,\n\t\tisInserterOpened,\n\t\tisListViewOpened,\n\t\tisDistractionFree,\n\t\tisPreviewMode,\n\t\tpreviousShortcut,\n\t\tnextShortcut,\n\t\tshowBlockBreadcrumbs,\n\t\tdocumentLabel,\n\t\tisZoomOut,\n\t} = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { getEditorSettings, getPostTypeLabel } = select( editorStore );\n\t\tconst editorSettings = getEditorSettings();\n\t\tconst postTypeLabel = getPostTypeLabel();\n\t\tconst { isZoomOut: _isZoomOut } = unlock( select( blockEditorStore ) );\n\n\t\treturn {\n\t\t\tmode: select( editorStore ).getEditorMode(),\n\t\t\tisRichEditingEnabled: editorSettings.richEditingEnabled,\n\t\t\tisInserterOpened: select( editorStore ).isInserterOpened(),\n\t\t\tisListViewOpened: select( editorStore ).isListViewOpened(),\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\tisPreviewMode: editorSettings.__unstableIsPreviewMode,\n\t\t\tpreviousShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/editor/previous-region' ),\n\t\t\tnextShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/editor/next-region' ),\n\t\t\tshowBlockBreadcrumbs: get( 'core', 'showBlockBreadcrumbs' ),\n\t\t\t// translators: Default label for the Document in the Block Breadcrumb.\n\t\t\tdocumentLabel: postTypeLabel || _x( 'Document', 'noun' ),\n\t\t\tisZoomOut: _isZoomOut(),\n\t\t};\n\t}, [] );\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst secondarySidebarLabel = isListViewOpened\n\t\t? __( 'Document Overview' )\n\t\t: __( 'Block Library' );\n\n\t// Local state for save panel.\n\t// Note 'truthy' callback implies an open panel.\n\tconst [ entitiesSavedStatesCallback, setEntitiesSavedStatesCallback ] =\n\t\tuseState( false );\n\tconst closeEntitiesSavedStates = useCallback(\n\t\t( arg ) => {\n\t\t\tif ( typeof entitiesSavedStatesCallback === 'function' ) {\n\t\t\t\tentitiesSavedStatesCallback( arg );\n\t\t\t}\n\t\t\tsetEntitiesSavedStatesCallback( false );\n\t\t},\n\t\t[ entitiesSavedStatesCallback ]\n\t);\n\n\treturn (\n\t\t<InterfaceSkeleton\n\t\t\tenableRegionNavigation={ enableRegionNavigation }\n\t\t\tisDistractionFree={ isDistractionFree }\n\t\t\tclassName={ clsx( 'editor-editor-interface', className, {\n\t\t\t\t'is-entity-save-view-open': !! entitiesSavedStatesCallback,\n\t\t\t\t'is-distraction-free': isDistractionFree && ! isPreviewMode,\n\t\t\t} ) }\n\t\t\tlabels={ {\n\t\t\t\t...interfaceLabels,\n\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t} }\n\t\t\theader={\n\t\t\t\t! isPreviewMode && (\n\t\t\t\t\t<Header\n\t\t\t\t\t\tforceIsDirty={ forceIsDirty }\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcustomSaveButton={ customSaveButton }\n\t\t\t\t\t\tforceDisableBlockTools={ forceDisableBlockTools }\n\t\t\t\t\t\ttitle={ title }\n\t\t\t\t\t\tisEditorIframed={ ! disableIframe }\n\t\t\t\t\t/>\n\t\t\t\t)\n\t\t\t}\n\t\t\teditorNotices={ <EditorNotices /> }\n\t\t\tsecondarySidebar={\n\t\t\t\t! isPreviewMode &&\n\t\t\t\tmode === 'visual' &&\n\t\t\t\t( ( isInserterOpened && <InserterSidebar /> ) ||\n\t\t\t\t\t( isListViewOpened && <ListViewSidebar /> ) )\n\t\t\t}\n\t\t\tsidebar={\n\t\t\t\t! isPreviewMode &&\n\t\t\t\t! isDistractionFree && <ComplementaryArea.Slot scope=\"core\" />\n\t\t\t}\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t{ ! isDistractionFree && ! isPreviewMode && (\n\t\t\t\t\t\t<EditorNotices />\n\t\t\t\t\t) }\n\n\t\t\t\t\t<EditorContentSlotFill.Slot>\n\t\t\t\t\t\t{ ( [ editorCanvasView ] ) =>\n\t\t\t\t\t\t\teditorCanvasView ? (\n\t\t\t\t\t\t\t\teditorCanvasView\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t{ ! isPreviewMode &&\n\t\t\t\t\t\t\t\t\t\t( mode === 'text' ||\n\t\t\t\t\t\t\t\t\t\t\t! isRichEditingEnabled ) && (\n\t\t\t\t\t\t\t\t\t\t\t<TextEditor\n\t\t\t\t\t\t\t\t\t\t\t\t// We should auto-focus the canvas (title) on load.\n\t\t\t\t\t\t\t\t\t\t\t\t// eslint-disable-next-line jsx-a11y/no-autofocus\n\t\t\t\t\t\t\t\t\t\t\t\tautoFocus={ autoFocus }\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{ ! isPreviewMode &&\n\t\t\t\t\t\t\t\t\t\t! isLargeViewport &&\n\t\t\t\t\t\t\t\t\t\tmode === 'visual' && (\n\t\t\t\t\t\t\t\t\t\t\t<BlockToolbar hideDragHandle />\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ ( isPreviewMode ||\n\t\t\t\t\t\t\t\t\t\t( isRichEditingEnabled &&\n\t\t\t\t\t\t\t\t\t\t\tmode === 'visual' ) ) && (\n\t\t\t\t\t\t\t\t\t\t<VisualEditor\n\t\t\t\t\t\t\t\t\t\t\tstyles={ styles }\n\t\t\t\t\t\t\t\t\t\t\tcontentRef={ contentRef }\n\t\t\t\t\t\t\t\t\t\t\tdisableIframe={ disableIframe }\n\t\t\t\t\t\t\t\t\t\t\t// We should auto-focus the canvas (title) on load.\n\t\t\t\t\t\t\t\t\t\t\t// eslint-disable-next-line jsx-a11y/no-autofocus\n\t\t\t\t\t\t\t\t\t\t\tautoFocus={ autoFocus }\n\t\t\t\t\t\t\t\t\t\t\tiframeProps={ iframeProps }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ children }\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</EditorContentSlotFill.Slot>\n\t\t\t\t</>\n\t\t\t}\n\t\t\tfooter={\n\t\t\t\t! isPreviewMode &&\n\t\t\t\t! isDistractionFree &&\n\t\t\t\tisLargeViewport &&\n\t\t\t\tshowBlockBreadcrumbs &&\n\t\t\t\tisRichEditingEnabled &&\n\t\t\t\t! isZoomOut &&\n\t\t\t\tmode === 'visual' && (\n\t\t\t\t\t<BlockBreadcrumb rootLabelText={ documentLabel } />\n\t\t\t\t)\n\t\t\t}\n\t\t\tactions={\n\t\t\t\t! isPreviewMode\n\t\t\t\t\t? customSavePanel || (\n\t\t\t\t\t\t\t<SavePublishPanels\n\t\t\t\t\t\t\t\tcloseEntitiesSavedStates={\n\t\t\t\t\t\t\t\t\tcloseEntitiesSavedStates\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tisEntitiesSavedStatesOpen={\n\t\t\t\t\t\t\t\t\tentitiesSavedStatesCallback\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tforceIsDirtyPublishPanel={ forceIsDirty }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t )\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t\tshortcuts={ {\n\t\t\t\tprevious: previousShortcut,\n\t\t\t\tnext: nextShortcut,\n\t\t\t} }\n\t\t/>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,iBAAiB,EAAEC,iBAAiB,QAAQ,s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AQ;QAAA,CACT;MACF,CAEyB,CAAC;IAAA,CAC5B,CACF;IACDL,MAAM,EACL,CAAEoB,aAAa,IACf,CAAED,iBAAiB,IACnBkB,eAAe,IACfd,oBAAoB,IACpBP,oBAAoB,IACpB,CAAES,SAAS,IACXV,IAAI,KAAK,QAAQ,iBAChBzB,IAAA,CAACjB,eAAe;MAAC+E,aAAa,EAAG5B;IAAe,CAAE,CAEnD;IACDzB,OAAO,EACN,CAAEqB,aAAa,GACZT,eAAe,iBACfrB,IAAA,CAACN,iBAAiB;MACjByD,wBAAwB,EACvBA,wBACA;MACDY,yBAAyB,EACxBd,2BACA;MACDC,8BAA8B,EAC7BA,8BACA;MACDc,wBAAwB,EAAGhD;IAAc,CACzC,CACA,GACDiD,SACH;IACDC,SAAS,EAAG;MACXC,QAAQ,EAAEpC,gBAAgB;MAC1BqC,IAAI,EAAEpC;IACP;EAAG,CACH,CAAC;AAEJ","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["clsx","InterfaceSkeleton","ComplementaryArea","useSelect","__","_x","store","preferencesStore","blockEditorStore","BlockBreadcrumb","BlockToolbar","useViewportMatch","useState","useCallback","editorStore","EditorNotices","Header","InserterSidebar","ListViewSidebar","SavePublishPanels","TextEditor","VisualEditor","EditorContentSlotFill","unlock","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","interfaceLabels","header","body","sidebar","actions","footer","EditorInterface","className","styles","children","forceIsDirty","contentRef","disableIframe","autoFocus","customSaveButton","customSavePanel","forceDisableBlockTools","title","iframeProps","mode","isRichEditingEnabled","isInserterOpened","isListViewOpened","isDistractionFree","isPreviewMode","showBlockBreadcrumbs","documentLabel","isZoomOut","select","get","getEditorSettings","getPostTypeLabel","editorSettings","postTypeLabel","_isZoomOut","getEditorMode","richEditingEnabled","isLargeViewport","secondarySidebarLabel","entitiesSavedStatesCallback","setEntitiesSavedStatesCallback","closeEntitiesSavedStates","arg","labels","secondarySidebar","isEditorIframed","editorNotices","Slot","scope","content","editorCanvasView","hideDragHandle","rootLabelText","isEntitiesSavedStatesOpen","forceIsDirtyPublishPanel","undefined"],"sources":["@wordpress/editor/src/components/editor-interface/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { InterfaceSkeleton, ComplementaryArea } from '@wordpress/interface';\nimport { useSelect } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tstore as blockEditorStore,\n\tBlockBreadcrumb,\n\tBlockToolbar,\n} from '@wordpress/block-editor';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useState, useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport EditorNotices from '../editor-notices';\nimport Header from '../header';\nimport InserterSidebar from '../inserter-sidebar';\nimport ListViewSidebar from '../list-view-sidebar';\nimport SavePublishPanels from '../save-publish-panels';\nimport TextEditor from '../text-editor';\nimport VisualEditor from '../visual-editor';\nimport EditorContentSlotFill from './content-slot-fill';\n\nimport { unlock } from '../../lock-unlock';\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the editor top bar landmark region. */\n\theader: __( 'Editor top bar' ),\n\t/* translators: accessibility text for the editor content landmark region. */\n\tbody: __( 'Editor content' ),\n\t/* translators: accessibility text for the editor settings landmark region. */\n\tsidebar: __( 'Editor settings' ),\n\t/* translators: accessibility text for the editor publish landmark region. */\n\tactions: __( 'Editor publish' ),\n\t/* translators: accessibility text for the editor footer landmark region. */\n\tfooter: __( 'Editor footer' ),\n};\n\nexport default function EditorInterface( {\n\tclassName,\n\tstyles,\n\tchildren,\n\tforceIsDirty,\n\tcontentRef,\n\tdisableIframe,\n\tautoFocus,\n\tcustomSaveButton,\n\tcustomSavePanel,\n\tforceDisableBlockTools,\n\ttitle,\n\tiframeProps,\n} ) {\n\tconst {\n\t\tmode,\n\t\tisRichEditingEnabled,\n\t\tisInserterOpened,\n\t\tisListViewOpened,\n\t\tisDistractionFree,\n\t\tisPreviewMode,\n\t\tshowBlockBreadcrumbs,\n\t\tdocumentLabel,\n\t\tisZoomOut,\n\t} = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { getEditorSettings, getPostTypeLabel } = select( editorStore );\n\t\tconst editorSettings = getEditorSettings();\n\t\tconst postTypeLabel = getPostTypeLabel();\n\t\tconst { isZoomOut: _isZoomOut } = unlock( select( blockEditorStore ) );\n\n\t\treturn {\n\t\t\tmode: select( editorStore ).getEditorMode(),\n\t\t\tisRichEditingEnabled: editorSettings.richEditingEnabled,\n\t\t\tisInserterOpened: select( editorStore ).isInserterOpened(),\n\t\t\tisListViewOpened: select( editorStore ).isListViewOpened(),\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\tisPreviewMode: editorSettings.isPreviewMode,\n\t\t\tshowBlockBreadcrumbs: get( 'core', 'showBlockBreadcrumbs' ),\n\t\t\tdocumentLabel:\n\t\t\t\t// translators: Default label for the Document in the Block Breadcrumb.\n\t\t\t\tpostTypeLabel || _x( 'Document', 'noun, breadcrumb' ),\n\t\t\tisZoomOut: _isZoomOut(),\n\t\t};\n\t}, [] );\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst secondarySidebarLabel = isListViewOpened\n\t\t? __( 'Document Overview' )\n\t\t: __( 'Block Library' );\n\n\t// Local state for save panel.\n\t// Note 'truthy' callback implies an open panel.\n\tconst [ entitiesSavedStatesCallback, setEntitiesSavedStatesCallback ] =\n\t\tuseState( false );\n\tconst closeEntitiesSavedStates = useCallback(\n\t\t( arg ) => {\n\t\t\tif ( typeof entitiesSavedStatesCallback === 'function' ) {\n\t\t\t\tentitiesSavedStatesCallback( arg );\n\t\t\t}\n\t\t\tsetEntitiesSavedStatesCallback( false );\n\t\t},\n\t\t[ entitiesSavedStatesCallback ]\n\t);\n\n\treturn (\n\t\t<InterfaceSkeleton\n\t\t\tisDistractionFree={ isDistractionFree }\n\t\t\tclassName={ clsx( 'editor-editor-interface', className, {\n\t\t\t\t'is-entity-save-view-open': !! entitiesSavedStatesCallback,\n\t\t\t\t'is-distraction-free': isDistractionFree && ! isPreviewMode,\n\t\t\t} ) }\n\t\t\tlabels={ {\n\t\t\t\t...interfaceLabels,\n\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t} }\n\t\t\theader={\n\t\t\t\t! isPreviewMode && (\n\t\t\t\t\t<Header\n\t\t\t\t\t\tforceIsDirty={ forceIsDirty }\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcustomSaveButton={ customSaveButton }\n\t\t\t\t\t\tforceDisableBlockTools={ forceDisableBlockTools }\n\t\t\t\t\t\ttitle={ title }\n\t\t\t\t\t\tisEditorIframed={ ! disableIframe }\n\t\t\t\t\t/>\n\t\t\t\t)\n\t\t\t}\n\t\t\teditorNotices={ <EditorNotices /> }\n\t\t\tsecondarySidebar={\n\t\t\t\t! isPreviewMode &&\n\t\t\t\tmode === 'visual' &&\n\t\t\t\t( ( isInserterOpened && <InserterSidebar /> ) ||\n\t\t\t\t\t( isListViewOpened && <ListViewSidebar /> ) )\n\t\t\t}\n\t\t\tsidebar={\n\t\t\t\t! isPreviewMode &&\n\t\t\t\t! isDistractionFree && <ComplementaryArea.Slot scope=\"core\" />\n\t\t\t}\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t{ ! isDistractionFree && ! isPreviewMode && (\n\t\t\t\t\t\t<EditorNotices />\n\t\t\t\t\t) }\n\n\t\t\t\t\t<EditorContentSlotFill.Slot>\n\t\t\t\t\t\t{ ( [ editorCanvasView ] ) =>\n\t\t\t\t\t\t\teditorCanvasView ? (\n\t\t\t\t\t\t\t\teditorCanvasView\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t{ ! isPreviewMode &&\n\t\t\t\t\t\t\t\t\t\t( mode === 'text' ||\n\t\t\t\t\t\t\t\t\t\t\t! isRichEditingEnabled ) && (\n\t\t\t\t\t\t\t\t\t\t\t<TextEditor\n\t\t\t\t\t\t\t\t\t\t\t\t// We should auto-focus the canvas (title) on load.\n\t\t\t\t\t\t\t\t\t\t\t\t// eslint-disable-next-line jsx-a11y/no-autofocus\n\t\t\t\t\t\t\t\t\t\t\t\tautoFocus={ autoFocus }\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{ ! isPreviewMode &&\n\t\t\t\t\t\t\t\t\t\t! isLargeViewport &&\n\t\t\t\t\t\t\t\t\t\tmode === 'visual' && (\n\t\t\t\t\t\t\t\t\t\t\t<BlockToolbar hideDragHandle />\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ ( isPreviewMode ||\n\t\t\t\t\t\t\t\t\t\t( isRichEditingEnabled &&\n\t\t\t\t\t\t\t\t\t\t\tmode === 'visual' ) ) && (\n\t\t\t\t\t\t\t\t\t\t<VisualEditor\n\t\t\t\t\t\t\t\t\t\t\tstyles={ styles }\n\t\t\t\t\t\t\t\t\t\t\tcontentRef={ contentRef }\n\t\t\t\t\t\t\t\t\t\t\tdisableIframe={ disableIframe }\n\t\t\t\t\t\t\t\t\t\t\t// We should auto-focus the canvas (title) on load.\n\t\t\t\t\t\t\t\t\t\t\t// eslint-disable-next-line jsx-a11y/no-autofocus\n\t\t\t\t\t\t\t\t\t\t\tautoFocus={ autoFocus }\n\t\t\t\t\t\t\t\t\t\t\tiframeProps={ iframeProps }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ children }\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</EditorContentSlotFill.Slot>\n\t\t\t\t</>\n\t\t\t}\n\t\t\tfooter={\n\t\t\t\t! isPreviewMode &&\n\t\t\t\t! isDistractionFree &&\n\t\t\t\tisLargeViewport &&\n\t\t\t\tshowBlockBreadcrumbs &&\n\t\t\t\tisRichEditingEnabled &&\n\t\t\t\t! isZoomOut &&\n\t\t\t\tmode === 'visual' && (\n\t\t\t\t\t<BlockBreadcrumb rootLabelText={ documentLabel } />\n\t\t\t\t)\n\t\t\t}\n\t\t\tactions={\n\t\t\t\t! isPreviewMode\n\t\t\t\t\t? customSavePanel || (\n\t\t\t\t\t\t\t<SavePublishPanels\n\t\t\t\t\t\t\t\tcloseEntitiesSavedStates={\n\t\t\t\t\t\t\t\t\tcloseEntitiesSavedStates\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tisEntitiesSavedStatesOpen={\n\t\t\t\t\t\t\t\t\tentitiesSavedStatesCallback\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tforceIsDirtyPublishPanel={ forceIsDirty }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t )\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t/>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,iBAAiB,EAAEC,iBAAiB,QAAQ,sBAAsB;AAC3E,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,wBAAwB;AAClE,SACCD,KAAK,IAAIE,gBAAgB,EACzBC,eAAe,EACfC,YAAY,QACN,yBAAyB;AAChC,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,QAAQ,EAAEC,WAAW,QAAQ,oBAAoB;;AAE1D;AACA;AACA;AACA,SAASP,KAAK,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AAgB,GACfA,gBAAgB,gBAEhBnD,KAAA,CAAAF,SAAA;UAAAY,QAAA,GACG,CAAEe,aAAa,KACdL,IAAI,KAAK,MAAM,IAChB,CAAEC,oBAAoB,CAAE,iBACxBzB,IAAA,CAACL;UACA;UACA;UAAA;YACAuB,SAAS,EAAGA;UAAW,CACvB,CACD,EACA,CAAEW,aAAa,IAChB,CAAEa,eAAe,IACjBlB,IAAI,KAAK,QAAQ,iBAChBxB,IAAA,CAACf,YAAY;YAACuE,cAAc;UAAA,CAAE,CAC9B,EACA,CAAE3B,aAAa,IACdJ,oBAAoB,IACrBD,IAAI,KAAK,QAAU,kBACpBxB,IAAA,CAACJ,YAAY;YACZiB,MAAM,EAAGA,MAAQ;YACjBG,UAAU,EAAGA,UAAY;YACzBC,aAAa,EAAGA;YAChB;YACA;YAAA;YACAC,SAAS,EAAGA,SAAW;YACvBK,WAAW,EAAGA;UAAa,CAC3B,CACD,EACCT,QAAQ;QAAA,CACT;MACF,CAEyB,CAAC;IAAA,CAC5B,CACF;IACDJ,MAAM,EACL,CAAEmB,aAAa,IACf,CAAED,iBAAiB,IACnBc,eAAe,IACfZ,oBAAoB,IACpBL,oBAAoB,IACpB,CAAEO,SAAS,IACXR,IAAI,KAAK,QAAQ,iBAChBxB,IAAA,CAAChB,eAAe;MAACyE,aAAa,EAAG1B;IAAe,CAAE,CAEnD;IACDtB,OAAO,EACN,CAAEoB,aAAa,GACZT,eAAe,iBACfpB,IAAA,CAACN,iBAAiB;MACjBoD,wBAAwB,EACvBA,wBACA;MACDY,yBAAyB,EACxBd,2BACA;MACDC,8BAA8B,EAC7BA,8BACA;MACDc,wBAAwB,EAAG5C;IAAc,CACzC,CACA,GACD6C;EACH,CACD,CAAC;AAEJ","ignoreList":[]}
|
|
@@ -20,9 +20,7 @@ import TemplateValidationNotice from '../template-validation-notice';
|
|
|
20
20
|
*
|
|
21
21
|
* @return {JSX.Element} The rendered EditorNotices component.
|
|
22
22
|
*/
|
|
23
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
25
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
26
24
|
export function EditorNotices() {
|
|
27
25
|
const {
|
|
28
26
|
notices
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NoticeList","useDispatch","useSelect","store","noticesStore","TemplateValidationNotice","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","EditorNotices","notices","select","getNotices","removeNotice","dismissibleNotices","filter","isDismissible","type","nonDismissibleNotices","children","className","onRemove"],"sources":["@wordpress/editor/src/components/editor-notices/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { NoticeList } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport TemplateValidationNotice from '../template-validation-notice';\n\n/**\n * This component renders the notices displayed in the editor. It displays pinned notices first, followed by dismissible\n *\n * @example\n * ```jsx\n * <EditorNotices />\n * ```\n *\n * @return {JSX.Element} The rendered EditorNotices component.\n */\nexport function EditorNotices() {\n\tconst { notices } = useSelect(\n\t\t( select ) => ( {\n\t\t\tnotices: select( noticesStore ).getNotices(),\n\t\t} ),\n\t\t[]\n\t);\n\tconst { removeNotice } = useDispatch( noticesStore );\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={ removeNotice }\n\t\t\t>\n\t\t\t\t<TemplateValidationNotice />\n\t\t\t</NoticeList>\n\t\t</>\n\t);\n}\n\nexport default EditorNotices;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAU,QAAQ,uBAAuB;AAClD,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,YAAY,QAAQ,oBAAoB;;AAE1D;AACA;AACA;AACA,OAAOC,wBAAwB,MAAM,+BAA+B;;AAEpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AATA,SAAAC,GAAA,IAAAC,IAAA
|
|
1
|
+
{"version":3,"names":["NoticeList","useDispatch","useSelect","store","noticesStore","TemplateValidationNotice","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","EditorNotices","notices","select","getNotices","removeNotice","dismissibleNotices","filter","isDismissible","type","nonDismissibleNotices","children","className","onRemove"],"sources":["@wordpress/editor/src/components/editor-notices/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { NoticeList } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport TemplateValidationNotice from '../template-validation-notice';\n\n/**\n * This component renders the notices displayed in the editor. It displays pinned notices first, followed by dismissible\n *\n * @example\n * ```jsx\n * <EditorNotices />\n * ```\n *\n * @return {JSX.Element} The rendered EditorNotices component.\n */\nexport function EditorNotices() {\n\tconst { notices } = useSelect(\n\t\t( select ) => ( {\n\t\t\tnotices: select( noticesStore ).getNotices(),\n\t\t} ),\n\t\t[]\n\t);\n\tconst { removeNotice } = useDispatch( noticesStore );\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={ removeNotice }\n\t\t\t>\n\t\t\t\t<TemplateValidationNotice />\n\t\t\t</NoticeList>\n\t\t</>\n\t);\n}\n\nexport default EditorNotices;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAU,QAAQ,uBAAuB;AAClD,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,YAAY,QAAQ,oBAAoB;;AAE1D;AACA;AACA;AACA,OAAOC,wBAAwB,MAAM,+BAA+B;;AAEpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AATA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAUA,OAAO,SAASC,aAAaA,CAAA,EAAG;EAC/B,MAAM;IAAEC;EAAQ,CAAC,GAAGX,SAAS,CAC1BY,MAAM,KAAQ;IACfD,OAAO,EAAEC,MAAM,CAAEV,YAAa,CAAC,CAACW,UAAU,CAAC;EAC5C,CAAC,CAAE,EACH,EACD,CAAC;EACD,MAAM;IAAEC;EAAa,CAAC,GAAGf,WAAW,CAAEG,YAAa,CAAC;EACpD,MAAMa,kBAAkB,GAAGJ,OAAO,CAACK,MAAM,CACxC,CAAE;IAAEC,aAAa;IAAEC;EAAK,CAAC,KAAMD,aAAa,IAAIC,IAAI,KAAK,SAC1D,CAAC;EACD,MAAMC,qBAAqB,GAAGR,OAAO,CAACK,MAAM,CAC3C,CAAE;IAAEC,aAAa;IAAEC;EAAK,CAAC,KAAM,CAAED,aAAa,IAAIC,IAAI,KAAK,SAC5D,CAAC;EAED,oBACCT,KAAA,CAAAF,SAAA;IAAAa,QAAA,gBACCf,IAAA,CAACP,UAAU;MACVa,OAAO,EAAGQ,qBAAuB;MACjCE,SAAS,EAAC;IAAmC,CAC7C,CAAC,eACFhB,IAAA,CAACP,UAAU;MACVa,OAAO,EAAGI,kBAAoB;MAC9BM,SAAS,EAAC,wCAAwC;MAClDC,QAAQ,EAAGR,YAAc;MAAAM,QAAA,eAEzBf,IAAA,CAACF,wBAAwB,IAAE;IAAC,CACjB,CAAC;EAAA,CACZ,CAAC;AAEL;AAEA,eAAeO,aAAa","ignoreList":[]}
|
|
@@ -12,9 +12,7 @@ import { decodeEntities } from '@wordpress/html-entities';
|
|
|
12
12
|
*/
|
|
13
13
|
import { store as editorStore } from '../../store';
|
|
14
14
|
import { unlock } from '../../lock-unlock';
|
|
15
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
17
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
16
|
export default function EntityRecordItem({
|
|
19
17
|
record,
|
|
20
18
|
checked,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CheckboxControl","PanelRow","__","useSelect","store","coreStore","decodeEntities","editorStore","unlock","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","EntityRecordItem","record","checked","onChange","name","kind","title","key","entityRecordTitle","hasPostMetaChanges","select","template","getEditedEntityRecord","__experimentalGetTemplateInfo","children","__nextHasNoMarginBottom","label","className"],"sources":["@wordpress/editor/src/components/entities-saved-states/entity-record-item.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { CheckboxControl, PanelRow } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\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';\nimport { unlock } from '../../lock-unlock';\n\nexport default function EntityRecordItem( { record, checked, onChange } ) {\n\tconst { name, kind, title, key } = record;\n\n\t// Handle templates that might use default descriptive titles.\n\tconst { entityRecordTitle, hasPostMetaChanges } = useSelect(\n\t\t( select ) => {\n\t\t\tif ( 'postType' !== kind || 'wp_template' !== name ) {\n\t\t\t\treturn {\n\t\t\t\t\tentityRecordTitle: title,\n\t\t\t\t\thasPostMetaChanges: unlock(\n\t\t\t\t\t\tselect( editorStore )\n\t\t\t\t\t).hasPostMetaChanges( name, key ),\n\t\t\t\t};\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 {\n\t\t\t\tentityRecordTitle:\n\t\t\t\t\tselect( editorStore ).__experimentalGetTemplateInfo(\n\t\t\t\t\t\ttemplate\n\t\t\t\t\t).title,\n\t\t\t\thasPostMetaChanges: unlock(\n\t\t\t\t\tselect( editorStore )\n\t\t\t\t).hasPostMetaChanges( name, key ),\n\t\t\t};\n\t\t},\n\t\t[ name, kind, title, key ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<PanelRow>\n\t\t\t\t<CheckboxControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={\n\t\t\t\t\t\tdecodeEntities( entityRecordTitle ) || __( 'Untitled' )\n\t\t\t\t\t}\n\t\t\t\t\tchecked={ checked }\n\t\t\t\t\tonChange={ onChange }\n\t\t\t\t/>\n\t\t\t</PanelRow>\n\t\t\t{ hasPostMetaChanges && (\n\t\t\t\t<ul className=\"entities-saved-states__changes\">\n\t\t\t\t\t<li>{ __( 'Post Meta.' ) }</li>\n\t\t\t\t</ul>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAe,EAAEC,QAAQ,QAAQ,uBAAuB;AACjE,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,cAAc,QAAQ,0BAA0B;;AAEzD;AACA;AACA;AACA,SAASF,KAAK,IAAIG,WAAW,QAAQ,aAAa;AAClD,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA
|
|
1
|
+
{"version":3,"names":["CheckboxControl","PanelRow","__","useSelect","store","coreStore","decodeEntities","editorStore","unlock","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","EntityRecordItem","record","checked","onChange","name","kind","title","key","entityRecordTitle","hasPostMetaChanges","select","template","getEditedEntityRecord","__experimentalGetTemplateInfo","children","__nextHasNoMarginBottom","label","className"],"sources":["@wordpress/editor/src/components/entities-saved-states/entity-record-item.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { CheckboxControl, PanelRow } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\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';\nimport { unlock } from '../../lock-unlock';\n\nexport default function EntityRecordItem( { record, checked, onChange } ) {\n\tconst { name, kind, title, key } = record;\n\n\t// Handle templates that might use default descriptive titles.\n\tconst { entityRecordTitle, hasPostMetaChanges } = useSelect(\n\t\t( select ) => {\n\t\t\tif ( 'postType' !== kind || 'wp_template' !== name ) {\n\t\t\t\treturn {\n\t\t\t\t\tentityRecordTitle: title,\n\t\t\t\t\thasPostMetaChanges: unlock(\n\t\t\t\t\t\tselect( editorStore )\n\t\t\t\t\t).hasPostMetaChanges( name, key ),\n\t\t\t\t};\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 {\n\t\t\t\tentityRecordTitle:\n\t\t\t\t\tselect( editorStore ).__experimentalGetTemplateInfo(\n\t\t\t\t\t\ttemplate\n\t\t\t\t\t).title,\n\t\t\t\thasPostMetaChanges: unlock(\n\t\t\t\t\tselect( editorStore )\n\t\t\t\t).hasPostMetaChanges( name, key ),\n\t\t\t};\n\t\t},\n\t\t[ name, kind, title, key ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<PanelRow>\n\t\t\t\t<CheckboxControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={\n\t\t\t\t\t\tdecodeEntities( entityRecordTitle ) || __( 'Untitled' )\n\t\t\t\t\t}\n\t\t\t\t\tchecked={ checked }\n\t\t\t\t\tonChange={ onChange }\n\t\t\t\t/>\n\t\t\t</PanelRow>\n\t\t\t{ hasPostMetaChanges && (\n\t\t\t\t<ul className=\"entities-saved-states__changes\">\n\t\t\t\t\t<li>{ __( 'Post Meta.' ) }</li>\n\t\t\t\t</ul>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAe,EAAEC,QAAQ,QAAQ,uBAAuB;AACjE,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,cAAc,QAAQ,0BAA0B;;AAEzD;AACA;AACA;AACA,SAASF,KAAK,IAAIG,WAAW,QAAQ,aAAa;AAClD,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAE3C,eAAe,SAASC,gBAAgBA,CAAE;EAAEC,MAAM;EAAEC,OAAO;EAAEC;AAAS,CAAC,EAAG;EACzE,MAAM;IAAEC,IAAI;IAAEC,IAAI;IAAEC,KAAK;IAAEC;EAAI,CAAC,GAAGN,MAAM;;EAEzC;EACA,MAAM;IAAEO,iBAAiB;I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|
13
13
|
*/
|
|
14
14
|
import EntityRecordItem from './entity-record-item';
|
|
15
15
|
import { unlock } from '../../lock-unlock';
|
|
16
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
17
|
const {
|
|
19
18
|
getGlobalStylesChanges,
|
|
20
19
|
GlobalStylesContext
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","useSelect","PanelBody","PanelRow","store","coreStore","privateApis","blockEditorPrivateApis","useContext","EntityRecordItem","unlock","jsx","_jsx","jsxs","_jsxs","getGlobalStylesChanges","GlobalStylesContext","getEntityDescription","entity","count","GlobalStylesDescription","record","user","currentEditorGlobalStyles","savedRecord","select","getEntityRecord","kind","name","key","globalStylesChanges","maxResults","length","className","children","map","change","EntityDescription","description","EntityTypeList","list","unselectedEntities","setUnselectedEntities","firstRecord","entityConfig","getEntityConfig","entityLabel","label","title","initialOpen","checked","some","elt","property","onChange","value"],"sources":["@wordpress/editor/src/components/entities-saved-states/entity-type-list.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { PanelBody, PanelRow } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport EntityRecordItem from './entity-record-item';\nimport { unlock } from '../../lock-unlock';\n\nconst { getGlobalStylesChanges, GlobalStylesContext } = unlock(\n\tblockEditorPrivateApis\n);\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 has been modified.' );\n\t}\n}\n\nfunction GlobalStylesDescription( { record } ) {\n\tconst { user: currentEditorGlobalStyles } =\n\t\tuseContext( GlobalStylesContext );\n\tconst savedRecord = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getEntityRecord(\n\t\t\t\trecord.kind,\n\t\t\t\trecord.name,\n\t\t\t\trecord.key\n\t\t\t),\n\t\t[ record.kind, record.name, record.key ]\n\t);\n\n\tconst globalStylesChanges = getGlobalStylesChanges(\n\t\tcurrentEditorGlobalStyles,\n\t\tsavedRecord,\n\t\t{\n\t\t\tmaxResults: 10,\n\t\t}\n\t);\n\treturn globalStylesChanges.length ? (\n\t\t<ul className=\"entities-saved-states__changes\">\n\t\t\t{ globalStylesChanges.map( ( change ) => (\n\t\t\t\t<li key={ change }>{ change }</li>\n\t\t\t) ) }\n\t\t</ul>\n\t) : null;\n}\n\nfunction EntityDescription( { record, count } ) {\n\tif ( 'globalStyles' === record?.name ) {\n\t\treturn null;\n\t}\n\tconst description = getEntityDescription( record?.name, count );\n\treturn description ? <PanelRow>{ description }</PanelRow> : null;\n}\n\nexport default function EntityTypeList( {\n\tlist,\n\tunselectedEntities,\n\tsetUnselectedEntities,\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\n\tlet entityLabel = entityConfig.label;\n\tif ( firstRecord?.name === 'wp_template_part' ) {\n\t\tentityLabel =\n\t\t\t1 === count ? __( 'Template Part' ) : __( 'Template Parts' );\n\t}\n\n\treturn (\n\t\t<PanelBody title={ entityLabel } initialOpen>\n\t\t\t<EntityDescription record={ firstRecord } count={ count } />\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/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t\t{ 'globalStyles' === firstRecord?.name && (\n\t\t\t\t<GlobalStylesDescription record={ firstRecord } />\n\t\t\t) }\n\t\t</PanelBody>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,SAAS,EAAEC,QAAQ,QAAQ,uBAAuB;AAC3D,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;AAC/E,SAASC,UAAU,QAAQ,oBAAoB;;AAE/C;AACA;AACA;AACA,OAAOC,gBAAgB,MAAM,sBAAsB;AACnD,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA
|
|
1
|
+
{"version":3,"names":["__","useSelect","PanelBody","PanelRow","store","coreStore","privateApis","blockEditorPrivateApis","useContext","EntityRecordItem","unlock","jsx","_jsx","jsxs","_jsxs","getGlobalStylesChanges","GlobalStylesContext","getEntityDescription","entity","count","GlobalStylesDescription","record","user","currentEditorGlobalStyles","savedRecord","select","getEntityRecord","kind","name","key","globalStylesChanges","maxResults","length","className","children","map","change","EntityDescription","description","EntityTypeList","list","unselectedEntities","setUnselectedEntities","firstRecord","entityConfig","getEntityConfig","entityLabel","label","title","initialOpen","checked","some","elt","property","onChange","value"],"sources":["@wordpress/editor/src/components/entities-saved-states/entity-type-list.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { PanelBody, PanelRow } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport EntityRecordItem from './entity-record-item';\nimport { unlock } from '../../lock-unlock';\n\nconst { getGlobalStylesChanges, GlobalStylesContext } = unlock(\n\tblockEditorPrivateApis\n);\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 has been modified.' );\n\t}\n}\n\nfunction GlobalStylesDescription( { record } ) {\n\tconst { user: currentEditorGlobalStyles } =\n\t\tuseContext( GlobalStylesContext );\n\tconst savedRecord = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getEntityRecord(\n\t\t\t\trecord.kind,\n\t\t\t\trecord.name,\n\t\t\t\trecord.key\n\t\t\t),\n\t\t[ record.kind, record.name, record.key ]\n\t);\n\n\tconst globalStylesChanges = getGlobalStylesChanges(\n\t\tcurrentEditorGlobalStyles,\n\t\tsavedRecord,\n\t\t{\n\t\t\tmaxResults: 10,\n\t\t}\n\t);\n\treturn globalStylesChanges.length ? (\n\t\t<ul className=\"entities-saved-states__changes\">\n\t\t\t{ globalStylesChanges.map( ( change ) => (\n\t\t\t\t<li key={ change }>{ change }</li>\n\t\t\t) ) }\n\t\t</ul>\n\t) : null;\n}\n\nfunction EntityDescription( { record, count } ) {\n\tif ( 'globalStyles' === record?.name ) {\n\t\treturn null;\n\t}\n\tconst description = getEntityDescription( record?.name, count );\n\treturn description ? <PanelRow>{ description }</PanelRow> : null;\n}\n\nexport default function EntityTypeList( {\n\tlist,\n\tunselectedEntities,\n\tsetUnselectedEntities,\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\n\tlet entityLabel = entityConfig.label;\n\tif ( firstRecord?.name === 'wp_template_part' ) {\n\t\tentityLabel =\n\t\t\t1 === count ? __( 'Template Part' ) : __( 'Template Parts' );\n\t}\n\n\treturn (\n\t\t<PanelBody title={ entityLabel } initialOpen>\n\t\t\t<EntityDescription record={ firstRecord } count={ count } />\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/>\n\t\t\t\t);\n\t\t\t} ) }\n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AKJ,WAAW,EAAEf,IAAI,KAAK,kBAAkB,EAAG;IAC/CkB,WAAW,GACV,CAAC,KAAK3B,KAAK,GAAGnB,EAAE,CAAE,eAAgB,CAAC,GAAGA,EAAE,CAAE,gBAAiB,CAAC;EAC9D;EAEA,oBACCc,KAAA,CAACZ,SAAS;IAAC8C,KAAK,EAAGF,WAAa;IAACG,WAAW;IAAAf,QAAA,gBAC3CtB,IAAA,CAACyB,iBAAiB;MAAChB,MAAM,EAAGsB,WAAa;MAACxB,KAAK,EAAGA;IAAO,CAAE,CAAC,EAC1DqB,IAAI,CAACL,GAAG,CAAId,MAAM,IAAM;MACzB,oBACCT,IAAA,CAACH,gBAAgB;QAEhBY,MAAM,EAAGA,MAAQ;QACjB6B,OAAO,EACN,CAAET,kBAAkB,CAACU,IAAI,CACtBC,GAAG,IACJA,GAAG,CAACzB,IAAI,KAAKN,MAAM,CAACM,IAAI,IACxByB,GAAG,CAACxB,IAAI,KAAKP,MAAM,CAACO,IAAI,IACxBwB,GAAG,CAACvB,GAAG,KAAKR,MAAM,CAACQ,GAAG,IACtBuB,GAAG,CAACC,QAAQ,KAAKhC,MAAM,CAACgC,QAC1B,CACA;QACDC,QAAQ,EAAKC,KAAK,IACjBb,qBAAqB,CAAErB,MAAM,EAAEkC,KAAM;MACrC,GAbKlC,MAAM,CAACQ,GAAG,IAAIR,MAAM,CAACgC,QAc3B,CAAC;IAEJ,CAAE,CAAC,EACD,cAAc,KAAKV,WAAW,EAAEf,IAAI,iBACrChB,IAAA,CAACQ,uBAAuB;MAACC,MAAM,EAAGsB;IAAa,CAAE,CACjD;EAAA,CACS,CAAC;AAEd","ignoreList":[]}
|
|
@@ -14,8 +14,7 @@ import EntityTypeList from './entity-type-list';
|
|
|
14
14
|
import { useIsDirty } from './hooks/use-is-dirty';
|
|
15
15
|
import { store as editorStore } from '../../store';
|
|
16
16
|
import { unlock } from '../../lock-unlock';
|
|
17
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
18
|
function identity(values) {
|
|
20
19
|
return values;
|
|
21
20
|
}
|
|
@@ -148,8 +147,8 @@ export function EntitiesSavedStatesExtensible({
|
|
|
148
147
|
}), additionalPrompt]
|
|
149
148
|
}), /*#__PURE__*/_jsx("p", {
|
|
150
149
|
id: renderDialog ? dialogDescription : undefined,
|
|
151
|
-
children: isDirty ? createInterpolateElement(sprintf(
|
|
152
|
-
_n('There is <strong>%d site change</strong> waiting to be saved.', 'There are <strong>%d site changes</strong> waiting to be saved.',
|
|
150
|
+
children: isDirty ? createInterpolateElement(sprintf(/* translators: %d: number of site changes waiting to be saved. */
|
|
151
|
+
_n('There is <strong>%d site change</strong> waiting to be saved.', 'There are <strong>%d site changes</strong> waiting to be saved.', dirtyEntityRecords.length), dirtyEntityRecords.length), {
|
|
153
152
|
strong: /*#__PURE__*/_jsx("strong", {})
|
|
154
153
|
}) : __('Select the items you want to save.')
|
|
155
154
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Button","Flex","FlexItem","__","_n","sprintf","useCallback","useRef","createInterpolateElement","__experimentalUseDialog","useDialog","useInstanceId","useDispatch","EntityTypeList","useIsDirty","store","editorStore","unlock","jsx","_jsx","jsxs","_jsxs","identity","values","EntitiesSavedStates","close","renderDialog","undefined","isDirtyProps","EntitiesSavedStatesExtensible","additionalPrompt","onSave","saveEnabled","saveEnabledProp","saveLabel","dirtyEntityRecords","isDirty","setUnselectedEntities","unselectedEntities","saveButtonRef","saveDirtyEntities","partitionedSavables","reduce","acc","record","name","push","site","siteSavables","wp_template","templateSavables","wp_template_part","templatePartSavables","contentSavables","sortedPartitionedSavables","Object","filter","Array","isArray","dismissPanel","saveDialogRef","saveDialogProps","onClose","dialogLabel","dialogDescription","ref","className","role","children","gap","isBlock","as","variant","size","onClick","disabled","accessibleWhenDisabled","entitiesToSkip","id","length","strong","map","list"],"sources":["@wordpress/editor/src/components/entities-saved-states/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button, Flex, FlexItem } from '@wordpress/components';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport {\n\tuseCallback,\n\tuseRef,\n\tcreateInterpolateElement,\n} from '@wordpress/element';\nimport {\n\t__experimentalUseDialog as useDialog,\n\tuseInstanceId,\n} from '@wordpress/compose';\nimport { useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport EntityTypeList from './entity-type-list';\nimport { useIsDirty } from './hooks/use-is-dirty';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nfunction identity( values ) {\n\treturn values;\n}\n\n/**\n * Renders the component for managing saved states of entities.\n *\n * @param {Object} props The component props.\n * @param {Function} props.close The function to close the dialog.\n * @param {Function} props.renderDialog The function to render the dialog.\n *\n * @return {JSX.Element} The rendered component.\n */\nexport default function EntitiesSavedStates( {\n\tclose,\n\trenderDialog = undefined,\n} ) {\n\tconst isDirtyProps = useIsDirty();\n\treturn (\n\t\t<EntitiesSavedStatesExtensible\n\t\t\tclose={ close }\n\t\t\trenderDialog={ renderDialog }\n\t\t\t{ ...isDirtyProps }\n\t\t/>\n\t);\n}\n\n/**\n * Renders a panel for saving entities with dirty records.\n *\n * @param {Object} props The component props.\n * @param {string} props.additionalPrompt Additional prompt to display.\n * @param {Function} props.close Function to close the panel.\n * @param {Function} props.onSave Function to call when saving entities.\n * @param {boolean} props.saveEnabled Flag indicating if save is enabled.\n * @param {string} props.saveLabel Label for the save button.\n * @param {Function} props.renderDialog Function to render a custom dialog.\n * @param {Array} props.dirtyEntityRecords Array of dirty entity records.\n * @param {boolean} props.isDirty Flag indicating if there are dirty entities.\n * @param {Function} props.setUnselectedEntities Function to set unselected entities.\n * @param {Array} props.unselectedEntities Array of unselected entities.\n *\n * @return {JSX.Element} The rendered component.\n */\nexport function EntitiesSavedStatesExtensible( {\n\tadditionalPrompt = undefined,\n\tclose,\n\tonSave = identity,\n\tsaveEnabled: saveEnabledProp = undefined,\n\tsaveLabel = __( 'Save' ),\n\trenderDialog = undefined,\n\tdirtyEntityRecords,\n\tisDirty,\n\tsetUnselectedEntities,\n\tunselectedEntities,\n} ) {\n\tconst saveButtonRef = useRef();\n\tconst { saveDirtyEntities } = unlock( useDispatch( editorStore ) );\n\t// To group entities by type.\n\tconst partitionedSavables = dirtyEntityRecords.reduce( ( acc, record ) => {\n\t\tconst { name } = record;\n\t\tif ( ! acc[ name ] ) {\n\t\t\tacc[ name ] = [];\n\t\t}\n\t\tacc[ name ].push( record );\n\t\treturn acc;\n\t}, {} );\n\n\t// Sort entity groups.\n\tconst {\n\t\tsite: siteSavables,\n\t\twp_template: templateSavables,\n\t\twp_template_part: templatePartSavables,\n\t\t...contentSavables\n\t} = partitionedSavables;\n\tconst sortedPartitionedSavables = [\n\t\tsiteSavables,\n\t\ttemplateSavables,\n\t\ttemplatePartSavables,\n\t\t...Object.values( contentSavables ),\n\t].filter( Array.isArray );\n\n\tconst saveEnabled = saveEnabledProp ?? isDirty;\n\t// Explicitly define this with no argument passed. Using `close` on\n\t// its own will use the event object in place of the expected saved entities.\n\tconst dismissPanel = useCallback( () => close(), [ close ] );\n\n\tconst [ saveDialogRef, saveDialogProps ] = useDialog( {\n\t\tonClose: () => dismissPanel(),\n\t} );\n\tconst dialogLabel = useInstanceId( EntitiesSavedStatesExtensible, 'label' );\n\tconst dialogDescription = useInstanceId(\n\t\tEntitiesSavedStatesExtensible,\n\t\t'description'\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tref={ saveDialogRef }\n\t\t\t{ ...saveDialogProps }\n\t\t\tclassName=\"entities-saved-states__panel\"\n\t\t\trole={ renderDialog ? 'dialog' : undefined }\n\t\t\taria-labelledby={ renderDialog ? dialogLabel : undefined }\n\t\t\taria-describedby={ renderDialog ? dialogDescription : undefined }\n\t\t>\n\t\t\t<Flex className=\"entities-saved-states__panel-header\" gap={ 2 }>\n\t\t\t\t<FlexItem\n\t\t\t\t\tisBlock\n\t\t\t\t\tas={ Button }\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\tonClick={ dismissPanel }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem\n\t\t\t\t\tisBlock\n\t\t\t\t\tas={ Button }\n\t\t\t\t\tref={ saveButtonRef }\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\tdisabled={ ! saveEnabled }\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\tsaveDirtyEntities( {\n\t\t\t\t\t\t\tonSave,\n\t\t\t\t\t\t\tdirtyEntityRecords,\n\t\t\t\t\t\t\tentitiesToSkip: unselectedEntities,\n\t\t\t\t\t\t\tclose,\n\t\t\t\t\t\t} )\n\t\t\t\t\t}\n\t\t\t\t\tclassName=\"editor-entities-saved-states__save-button\"\n\t\t\t\t>\n\t\t\t\t\t{ saveLabel }\n\t\t\t\t</FlexItem>\n\t\t\t</Flex>\n\n\t\t\t<div className=\"entities-saved-states__text-prompt\">\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"entities-saved-states__text-prompt--header-wrapper\"\n\t\t\t\t\tid={ renderDialog ? dialogLabel : undefined }\n\t\t\t\t>\n\t\t\t\t\t<strong className=\"entities-saved-states__text-prompt--header\">\n\t\t\t\t\t\t{ __( 'Are you ready to save?' ) }\n\t\t\t\t\t</strong>\n\t\t\t\t\t{ additionalPrompt }\n\t\t\t\t</div>\n\t\t\t\t<p id={ renderDialog ? dialogDescription : undefined }>\n\t\t\t\t\t{ isDirty\n\t\t\t\t\t\t? createInterpolateElement(\n\t\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t\t/* translators: %d: number of site changes waiting to be saved. */\n\t\t\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t\t\t'There is <strong>%d site change</strong> waiting to be saved.',\n\t\t\t\t\t\t\t\t\t\t'There are <strong>%d site changes</strong> waiting to be saved.',\n\t\t\t\t\t\t\t\t\t\tsortedPartitionedSavables.length\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tsortedPartitionedSavables.length\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t{ strong: <strong /> }\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: __( 'Select the items you want to save.' ) }\n\t\t\t\t</p>\n\t\t\t</div>\n\n\t\t\t{ sortedPartitionedSavables.map( ( list ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<EntityTypeList\n\t\t\t\t\t\tkey={ list[ 0 ].name }\n\t\t\t\t\t\tlist={ list }\n\t\t\t\t\t\tunselectedEntities={ unselectedEntities }\n\t\t\t\t\t\tsetUnselectedEntities={ setUnselectedEntities }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</div>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,MAAM,EAAEC,IAAI,EAAEC,QAAQ,QAAQ,uBAAuB;AAC9D,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SACCC,WAAW,EACXC,MAAM,EACNC,wBAAwB,QAClB,oBAAoB;AAC3B,SACCC,uBAAuB,IAAIC,SAAS,EACpCC,aAAa,QACP,oBAAoB;AAC3B,SAASC,WAAW,QAAQ,iBAAiB;;AAE7C;AACA;AACA;AACA,OAAOC,cAAc,MAAM,oBAAoB;AAC/C,SAASC,UAAU,QAAQ,sBAAsB;AACjD,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAClD,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAE3C,SAASC,QAAQA,CAAEC,MAAM,EAAG;EAC3B,OAAOA,MAAM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qE,IAAI,EAAGA,IAAM;QACb5C,kBAAkB,EAAGA,kBAAoB;QACzCD,qBAAqB,EAAGA;MAAuB,GAHzC6C,IAAI,CAAE,CAAC,CAAE,CAACrC,IAIhB,CAAC;IAEJ,CAAE,CAAC;EAAA,CACC,CAAC;AAER","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["Button","Flex","FlexItem","__","_n","sprintf","useCallback","useRef","createInterpolateElement","__experimentalUseDialog","useDialog","useInstanceId","useDispatch","EntityTypeList","useIsDirty","store","editorStore","unlock","jsx","_jsx","jsxs","_jsxs","identity","values","EntitiesSavedStates","close","renderDialog","undefined","isDirtyProps","EntitiesSavedStatesExtensible","additionalPrompt","onSave","saveEnabled","saveEnabledProp","saveLabel","dirtyEntityRecords","isDirty","setUnselectedEntities","unselectedEntities","saveButtonRef","saveDirtyEntities","partitionedSavables","reduce","acc","record","name","push","site","siteSavables","wp_template","templateSavables","wp_template_part","templatePartSavables","contentSavables","sortedPartitionedSavables","Object","filter","Array","isArray","dismissPanel","saveDialogRef","saveDialogProps","onClose","dialogLabel","dialogDescription","ref","className","role","children","gap","isBlock","as","variant","size","onClick","disabled","accessibleWhenDisabled","entitiesToSkip","id","length","strong","map","list"],"sources":["@wordpress/editor/src/components/entities-saved-states/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button, Flex, FlexItem } from '@wordpress/components';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport {\n\tuseCallback,\n\tuseRef,\n\tcreateInterpolateElement,\n} from '@wordpress/element';\nimport {\n\t__experimentalUseDialog as useDialog,\n\tuseInstanceId,\n} from '@wordpress/compose';\nimport { useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport EntityTypeList from './entity-type-list';\nimport { useIsDirty } from './hooks/use-is-dirty';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nfunction identity( values ) {\n\treturn values;\n}\n\n/**\n * Renders the component for managing saved states of entities.\n *\n * @param {Object} props The component props.\n * @param {Function} props.close The function to close the dialog.\n * @param {Function} props.renderDialog The function to render the dialog.\n *\n * @return {JSX.Element} The rendered component.\n */\nexport default function EntitiesSavedStates( {\n\tclose,\n\trenderDialog = undefined,\n} ) {\n\tconst isDirtyProps = useIsDirty();\n\treturn (\n\t\t<EntitiesSavedStatesExtensible\n\t\t\tclose={ close }\n\t\t\trenderDialog={ renderDialog }\n\t\t\t{ ...isDirtyProps }\n\t\t/>\n\t);\n}\n\n/**\n * Renders a panel for saving entities with dirty records.\n *\n * @param {Object} props The component props.\n * @param {string} props.additionalPrompt Additional prompt to display.\n * @param {Function} props.close Function to close the panel.\n * @param {Function} props.onSave Function to call when saving entities.\n * @param {boolean} props.saveEnabled Flag indicating if save is enabled.\n * @param {string} props.saveLabel Label for the save button.\n * @param {Function} props.renderDialog Function to render a custom dialog.\n * @param {Array} props.dirtyEntityRecords Array of dirty entity records.\n * @param {boolean} props.isDirty Flag indicating if there are dirty entities.\n * @param {Function} props.setUnselectedEntities Function to set unselected entities.\n * @param {Array} props.unselectedEntities Array of unselected entities.\n *\n * @return {JSX.Element} The rendered component.\n */\nexport function EntitiesSavedStatesExtensible( {\n\tadditionalPrompt = undefined,\n\tclose,\n\tonSave = identity,\n\tsaveEnabled: saveEnabledProp = undefined,\n\tsaveLabel = __( 'Save' ),\n\trenderDialog = undefined,\n\tdirtyEntityRecords,\n\tisDirty,\n\tsetUnselectedEntities,\n\tunselectedEntities,\n} ) {\n\tconst saveButtonRef = useRef();\n\tconst { saveDirtyEntities } = unlock( useDispatch( editorStore ) );\n\t// To group entities by type.\n\tconst partitionedSavables = dirtyEntityRecords.reduce( ( acc, record ) => {\n\t\tconst { name } = record;\n\t\tif ( ! acc[ name ] ) {\n\t\t\tacc[ name ] = [];\n\t\t}\n\t\tacc[ name ].push( record );\n\t\treturn acc;\n\t}, {} );\n\n\t// Sort entity groups.\n\tconst {\n\t\tsite: siteSavables,\n\t\twp_template: templateSavables,\n\t\twp_template_part: templatePartSavables,\n\t\t...contentSavables\n\t} = partitionedSavables;\n\tconst sortedPartitionedSavables = [\n\t\tsiteSavables,\n\t\ttemplateSavables,\n\t\ttemplatePartSavables,\n\t\t...Object.values( contentSavables ),\n\t].filter( Array.isArray );\n\n\tconst saveEnabled = saveEnabledProp ?? isDirty;\n\t// Explicitly define this with no argument passed. Using `close` on\n\t// its own will use the event object in place of the expected saved entities.\n\tconst dismissPanel = useCallback( () => close(), [ close ] );\n\n\tconst [ saveDialogRef, saveDialogProps ] = useDialog( {\n\t\tonClose: () => dismissPanel(),\n\t} );\n\tconst dialogLabel = useInstanceId( EntitiesSavedStatesExtensible, 'label' );\n\tconst dialogDescription = useInstanceId(\n\t\tEntitiesSavedStatesExtensible,\n\t\t'description'\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tref={ saveDialogRef }\n\t\t\t{ ...saveDialogProps }\n\t\t\tclassName=\"entities-saved-states__panel\"\n\t\t\trole={ renderDialog ? 'dialog' : undefined }\n\t\t\taria-labelledby={ renderDialog ? dialogLabel : undefined }\n\t\t\taria-describedby={ renderDialog ? dialogDescription : undefined }\n\t\t>\n\t\t\t<Flex className=\"entities-saved-states__panel-header\" gap={ 2 }>\n\t\t\t\t<FlexItem\n\t\t\t\t\tisBlock\n\t\t\t\t\tas={ Button }\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\tonClick={ dismissPanel }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem\n\t\t\t\t\tisBlock\n\t\t\t\t\tas={ Button }\n\t\t\t\t\tref={ saveButtonRef }\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\tdisabled={ ! saveEnabled }\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\tsaveDirtyEntities( {\n\t\t\t\t\t\t\tonSave,\n\t\t\t\t\t\t\tdirtyEntityRecords,\n\t\t\t\t\t\t\tentitiesToSkip: unselectedEntities,\n\t\t\t\t\t\t\tclose,\n\t\t\t\t\t\t} )\n\t\t\t\t\t}\n\t\t\t\t\tclassName=\"editor-entities-saved-states__save-button\"\n\t\t\t\t>\n\t\t\t\t\t{ saveLabel }\n\t\t\t\t</FlexItem>\n\t\t\t</Flex>\n\n\t\t\t<div className=\"entities-saved-states__text-prompt\">\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"entities-saved-states__text-prompt--header-wrapper\"\n\t\t\t\t\tid={ renderDialog ? dialogLabel : undefined }\n\t\t\t\t>\n\t\t\t\t\t<strong className=\"entities-saved-states__text-prompt--header\">\n\t\t\t\t\t\t{ __( 'Are you ready to save?' ) }\n\t\t\t\t\t</strong>\n\t\t\t\t\t{ additionalPrompt }\n\t\t\t\t</div>\n\t\t\t\t<p id={ renderDialog ? dialogDescription : undefined }>\n\t\t\t\t\t{ isDirty\n\t\t\t\t\t\t? createInterpolateElement(\n\t\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t\t/* translators: %d: number of site changes waiting to be saved. */\n\t\t\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t\t\t'There is <strong>%d site change</strong> waiting to be saved.',\n\t\t\t\t\t\t\t\t\t\t'There are <strong>%d site changes</strong> waiting to be saved.',\n\t\t\t\t\t\t\t\t\t\tdirtyEntityRecords.length\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tdirtyEntityRecords.length\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t{ strong: <strong /> }\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: __( 'Select the items you want to save.' ) }\n\t\t\t\t</p>\n\t\t\t</div>\n\n\t\t\t{ sortedPartitionedSavables.map( ( list ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<EntityTypeList\n\t\t\t\t\t\tkey={ list[ 0 ].name }\n\t\t\t\t\t\tlist={ list }\n\t\t\t\t\t\tunselectedEntities={ unselectedEntities }\n\t\t\t\t\t\tsetUnselectedEntities={ setUnselectedEntities }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</div>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,MAAM,EAAEC,IAAI,EAAEC,QAAQ,QAAQ,uBAAuB;AAC9D,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SACCC,WAAW,EACXC,MAAM,EACNC,wBAAwB,QAClB,oBAAoB;AAC3B,SACCC,uBAAuB,IAAIC,SAAS,EACpCC,aAAa,QACP,oBAAoB;AAC3B,SAASC,WAAW,QAAQ,iBAAiB;;AAE7C;AACA;AACA;AACA,OAAOC,cAAc,MAAM,oBAAoB;AAC/C,SAASC,UAAU,QAAQ,sBAAsB;AACjD,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAClD,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAE3C,SAASC,QAAQA,CAAEC,MAAM,EAAG;EAC3B,OAAOA,MAAM;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,mBAAmBA,CAAE;EAC5CC,KAAK;EACLC,YAAY,GAAGC;AAChB,CAAC,EAAG;EACH,MAAMC,YAAY,GAAGd,UAAU,CAAC,CAAC;EACjC,oBACCK,IAAA,CAACU,6BAA6B;IAC7BJ,KAAK,EAAGA,KAAO;IACfC,YAAY,EAAGA,YAAc;IAAA,GACxBE;EAAY,CACjB,CAAC;AAEJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,6BAA6BA,CAAE;EAC9CC,gBAAgB,GAAGH,SAAS;EAC5BF,KAAK;EACLM,MAAM,GAAGT,QAAQ;EACjBU,WAAW,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AAE,QAAA,gBAClD/C,KAAA;QACC6C,SAAS,EAAC,oDAAoD;QAC9DY,EAAE,EAAGpD,YAAY,GAAGqC,WAAW,GAAGpC,SAAW;QAAAyC,QAAA,gBAE7CjD,IAAA;UAAQ+C,SAAS,EAAC,4CAA4C;UAAAE,QAAA,EAC3DjE,EAAE,CAAE,wBAAyB;QAAC,CACzB,CAAC,EACP2B,gBAAgB;MAAA,CACd,CAAC,eACNX,IAAA;QAAG2D,EAAE,EAAGpD,YAAY,GAAGsC,iBAAiB,GAAGrC,SAAW;QAAAyC,QAAA,EACnDhC,OAAO,GACN5B,wBAAwB,CACxBH,OAAO,CACN;QACAD,EAAE,CACD,+DAA+D,EAC/D,iEAAiE,EACjE+B,kBAAkB,CAAC4C,MACpB,CAAC,EACD5C,kBAAkB,CAAC4C,MACpB,CAAC,EACD;UAAEC,MAAM,eAAE7D,IAAA,aAAS;QAAE,CACrB,CAAC,GACDhB,EAAE,CAAE,oCAAqC;MAAC,CAC3C,CAAC;IAAA,CACA,CAAC,EAEJmD,yBAAyB,CAAC2B,GAAG,CAAIC,IAAI,IAAM;MAC5C,oBACC/D,IAAA,CAACN,cAAc;QAEdqE,IAAI,EAAGA,IAAM;QACb5C,kBAAkB,EAAGA,kBAAoB;QACzCD,qBAAqB,EAAGA;MAAuB,GAHzC6C,IAAI,CAAE,CAAC,CAAE,CAACrC,IAIhB,CAAC;IAEJ,CAAE,CAAC;EAAA,CACC,CAAC;AAER","ignoreList":[]}
|
|
@@ -21,8 +21,7 @@ import { Icon } from '@wordpress/components';
|
|
|
21
21
|
*/
|
|
22
22
|
import { store as editorStore } from '../../store';
|
|
23
23
|
import styles from './style.scss';
|
|
24
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
25
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
26
25
|
function getContent() {
|
|
27
26
|
try {
|
|
28
27
|
// While `select` in a component is generally discouraged, it is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ScrollView","Text","TouchableOpacity","View","Clipboard","SafeAreaView","Component","__","select","logException","usePreferredColorSchemeStyle","withPreferredColorScheme","warning","Icon","store","editorStore","styles","jsx","_jsx","jsxs","_jsxs","getContent","getEditedPostContent","error","CopyButton","text","label","accessibilityLabel","accessibilityHint","secondary","containerStyle","containerSecondaryStyle","textStyle","textSecondaryStyle","activeOpacity","style","accessibilityRole","onPress","setString","children","ErrorBoundary","constructor","arguments","state","componentDidCatch","context","component_stack","componentStack","isHandled","handledBy","getDerivedStateFromError","render","props","getStylesFromColorScheme","iconContainerStyle","titleStyle","messageStyle","contentContainerStyle","icon","stack"],"sources":["@wordpress/editor/src/components/error-boundary/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { ScrollView, Text, TouchableOpacity, View } from 'react-native';\nimport Clipboard from '@react-native-clipboard/clipboard';\nimport { SafeAreaView } from 'react-native-safe-area-context';\n\n/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { select } from '@wordpress/data';\nimport { logException } from '@wordpress/react-native-bridge';\nimport {\n\tusePreferredColorSchemeStyle,\n\twithPreferredColorScheme,\n} from '@wordpress/compose';\nimport { warning } from '@wordpress/icons';\nimport { Icon } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport styles from './style.scss';\n\nfunction getContent() {\n\ttry {\n\t\t// While `select` in a component is generally discouraged, it is\n\t\t// used here because it (a) reduces the chance of data loss in the\n\t\t// case of additional errors by performing a direct retrieval and\n\t\t// (b) avoids the performance cost associated with unnecessary\n\t\t// content serialization throughout the lifetime of a non-erroring\n\t\t// application.\n\t\treturn select( editorStore ).getEditedPostContent();\n\t} catch ( error ) {}\n}\n\nfunction CopyButton( {\n\ttext,\n\tlabel,\n\taccessibilityLabel,\n\taccessibilityHint,\n\tsecondary = false,\n} ) {\n\tconst containerStyle = usePreferredColorSchemeStyle(\n\t\tstyles[ 'copy-button__container' ],\n\t\tstyles[ 'copy-button__container--dark' ]\n\t);\n\n\tconst containerSecondaryStyle = usePreferredColorSchemeStyle(\n\t\tstyles[ 'copy-button__container--secondary' ],\n\t\tstyles[ 'copy-button__container--secondary-dark' ]\n\t);\n\n\tconst textStyle = usePreferredColorSchemeStyle(\n\t\tstyles[ 'copy-button__text' ],\n\t\tstyles[ 'copy-button__text--dark' ]\n\t);\n\n\tconst textSecondaryStyle = usePreferredColorSchemeStyle(\n\t\tstyles[ 'copy-button__text--secondary' ],\n\t\tstyles[ 'copy-button__text--secondary-dark' ]\n\t);\n\n\treturn (\n\t\t<TouchableOpacity\n\t\t\tactiveOpacity={ 0.5 }\n\t\t\taccessibilityLabel={ accessibilityLabel }\n\t\t\tstyle={ [ containerStyle, secondary && containerSecondaryStyle ] }\n\t\t\taccessibilityRole=\"button\"\n\t\t\taccessibilityHint={ accessibilityHint }\n\t\t\tonPress={ () => {\n\t\t\t\tClipboard.setString(\n\t\t\t\t\ttypeof text === 'function' ? text() : text || ''\n\t\t\t\t);\n\t\t\t} }\n\t\t>\n\t\t\t<Text style={ [ textStyle, secondary && textSecondaryStyle ] }>\n\t\t\t\t{ label }\n\t\t\t</Text>\n\t\t</TouchableOpacity>\n\t);\n}\n\nclass ErrorBoundary extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.state = {\n\t\t\terror: null,\n\t\t};\n\t}\n\n\tcomponentDidCatch( error ) {\n\t\tlogException( error, {\n\t\t\tcontext: {\n\t\t\t\tcomponent_stack: error.componentStack,\n\t\t\t},\n\t\t\tisHandled: true,\n\t\t\thandledBy: 'Editor-level Error Boundary',\n\t\t} );\n\t}\n\n\tstatic getDerivedStateFromError( error ) {\n\t\treturn { error };\n\t}\n\n\trender() {\n\t\tconst { error } = this.state;\n\t\tif ( ! error ) {\n\t\t\treturn this.props.children;\n\t\t}\n\n\t\tconst { getStylesFromColorScheme } = this.props;\n\n\t\tconst iconContainerStyle = getStylesFromColorScheme(\n\t\t\tstyles[ 'error-boundary__icon-container' ],\n\t\t\tstyles[ 'error-boundary__icon-container--dark' ]\n\t\t);\n\n\t\tconst titleStyle = getStylesFromColorScheme(\n\t\t\tstyles[ 'error-boundary__title' ],\n\t\t\tstyles[ 'error-boundary__title--dark' ]\n\t\t);\n\n\t\tconst messageStyle = getStylesFromColorScheme(\n\t\t\tstyles[ 'error-boundary__message' ],\n\t\t\tstyles[ 'error-boundary__message--dark' ]\n\t\t);\n\n\t\treturn (\n\t\t\t<SafeAreaView>\n\t\t\t\t<ScrollView\n\t\t\t\t\tstyle={ styles[ 'error-boundary__scroll' ] }\n\t\t\t\t\tcontentContainerStyle={\n\t\t\t\t\t\tstyles[ 'error-boundary__scroll-container' ]\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t<View style={ styles[ 'error-boundary__container' ] }>\n\t\t\t\t\t\t<View style={ iconContainerStyle }>\n\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\ticon={ warning }\n\t\t\t\t\t\t\t\t{ ...styles[ 'error-boundary__icon' ] }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</View>\n\t\t\t\t\t\t<Text style={ titleStyle }>\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'The editor has encountered an unexpected error'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t<Text style={ messageStyle }>\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'You can copy your post text in case your content is impacted. Copy error details to debug and share with support.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t<View\n\t\t\t\t\t\t\tstyle={\n\t\t\t\t\t\t\t\tstyles[ 'error-boundary__actions-container' ]\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<CopyButton\n\t\t\t\t\t\t\t\tlabel={ __( 'Copy post text' ) }\n\t\t\t\t\t\t\t\taccessibilityLabel={ __(\n\t\t\t\t\t\t\t\t\t'Button to copy post text'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\taccessibilityHint={ __(\n\t\t\t\t\t\t\t\t\t'Tap here to copy post text'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\ttext={ getContent }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<CopyButton\n\t\t\t\t\t\t\t\tlabel={ __( 'Copy error details' ) }\n\t\t\t\t\t\t\t\taccessibilityLabel={ __(\n\t\t\t\t\t\t\t\t\t'Button to copy error details'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\taccessibilityHint={ __(\n\t\t\t\t\t\t\t\t\t'Tap here to copy error details'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\ttext={ error.stack }\n\t\t\t\t\t\t\t\tsecondary\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</View>\n\t\t\t\t\t</View>\n\t\t\t\t</ScrollView>\n\t\t\t</SafeAreaView>\n\t\t);\n\t}\n}\n\nexport default withPreferredColorScheme( ErrorBoundary );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAU,EAAEC,IAAI,EAAEC,gBAAgB,EAAEC,IAAI,QAAQ,cAAc;AACvE,OAAOC,SAAS,MAAM,mCAAmC;AACzD,SAASC,YAAY,QAAQ,gCAAgC;;AAE7D;AACA;AACA;AACA,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,MAAM,QAAQ,iBAAiB;AACxC,SAASC,YAAY,QAAQ,gCAAgC;AAC7D,SACCC,4BAA4B,EAC5BC,wBAAwB,QAClB,oBAAoB;AAC3B,SAASC,OAAO,QAAQ,kBAAkB;AAC1C,SAASC,IAAI,QAAQ,uBAAuB;;AAE5C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;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,eAAelB,wBAAwB,CAAE6B,aAAc,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["ScrollView","Text","TouchableOpacity","View","Clipboard","SafeAreaView","Component","__","select","logException","usePreferredColorSchemeStyle","withPreferredColorScheme","warning","Icon","store","editorStore","styles","jsx","_jsx","jsxs","_jsxs","getContent","getEditedPostContent","error","CopyButton","text","label","accessibilityLabel","accessibilityHint","secondary","containerStyle","containerSecondaryStyle","textStyle","textSecondaryStyle","activeOpacity","style","accessibilityRole","onPress","setString","children","ErrorBoundary","constructor","arguments","state","componentDidCatch","context","component_stack","componentStack","isHandled","handledBy","getDerivedStateFromError","render","props","getStylesFromColorScheme","iconContainerStyle","titleStyle","messageStyle","contentContainerStyle","icon","stack"],"sources":["@wordpress/editor/src/components/error-boundary/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { ScrollView, Text, TouchableOpacity, View } from 'react-native';\nimport Clipboard from '@react-native-clipboard/clipboard';\nimport { SafeAreaView } from 'react-native-safe-area-context';\n\n/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { select } from '@wordpress/data';\nimport { logException } from '@wordpress/react-native-bridge';\nimport {\n\tusePreferredColorSchemeStyle,\n\twithPreferredColorScheme,\n} from '@wordpress/compose';\nimport { warning } from '@wordpress/icons';\nimport { Icon } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport styles from './style.scss';\n\nfunction getContent() {\n\ttry {\n\t\t// While `select` in a component is generally discouraged, it is\n\t\t// used here because it (a) reduces the chance of data loss in the\n\t\t// case of additional errors by performing a direct retrieval and\n\t\t// (b) avoids the performance cost associated with unnecessary\n\t\t// content serialization throughout the lifetime of a non-erroring\n\t\t// application.\n\t\treturn select( editorStore ).getEditedPostContent();\n\t} catch ( error ) {}\n}\n\nfunction CopyButton( {\n\ttext,\n\tlabel,\n\taccessibilityLabel,\n\taccessibilityHint,\n\tsecondary = false,\n} ) {\n\tconst containerStyle = usePreferredColorSchemeStyle(\n\t\tstyles[ 'copy-button__container' ],\n\t\tstyles[ 'copy-button__container--dark' ]\n\t);\n\n\tconst containerSecondaryStyle = usePreferredColorSchemeStyle(\n\t\tstyles[ 'copy-button__container--secondary' ],\n\t\tstyles[ 'copy-button__container--secondary-dark' ]\n\t);\n\n\tconst textStyle = usePreferredColorSchemeStyle(\n\t\tstyles[ 'copy-button__text' ],\n\t\tstyles[ 'copy-button__text--dark' ]\n\t);\n\n\tconst textSecondaryStyle = usePreferredColorSchemeStyle(\n\t\tstyles[ 'copy-button__text--secondary' ],\n\t\tstyles[ 'copy-button__text--secondary-dark' ]\n\t);\n\n\treturn (\n\t\t<TouchableOpacity\n\t\t\tactiveOpacity={ 0.5 }\n\t\t\taccessibilityLabel={ accessibilityLabel }\n\t\t\tstyle={ [ containerStyle, secondary && containerSecondaryStyle ] }\n\t\t\taccessibilityRole=\"button\"\n\t\t\taccessibilityHint={ accessibilityHint }\n\t\t\tonPress={ () => {\n\t\t\t\tClipboard.setString(\n\t\t\t\t\ttypeof text === 'function' ? text() : text || ''\n\t\t\t\t);\n\t\t\t} }\n\t\t>\n\t\t\t<Text style={ [ textStyle, secondary && textSecondaryStyle ] }>\n\t\t\t\t{ label }\n\t\t\t</Text>\n\t\t</TouchableOpacity>\n\t);\n}\n\nclass ErrorBoundary extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.state = {\n\t\t\terror: null,\n\t\t};\n\t}\n\n\tcomponentDidCatch( error ) {\n\t\tlogException( error, {\n\t\t\tcontext: {\n\t\t\t\tcomponent_stack: error.componentStack,\n\t\t\t},\n\t\t\tisHandled: true,\n\t\t\thandledBy: 'Editor-level Error Boundary',\n\t\t} );\n\t}\n\n\tstatic getDerivedStateFromError( error ) {\n\t\treturn { error };\n\t}\n\n\trender() {\n\t\tconst { error } = this.state;\n\t\tif ( ! error ) {\n\t\t\treturn this.props.children;\n\t\t}\n\n\t\tconst { getStylesFromColorScheme } = this.props;\n\n\t\tconst iconContainerStyle = getStylesFromColorScheme(\n\t\t\tstyles[ 'error-boundary__icon-container' ],\n\t\t\tstyles[ 'error-boundary__icon-container--dark' ]\n\t\t);\n\n\t\tconst titleStyle = getStylesFromColorScheme(\n\t\t\tstyles[ 'error-boundary__title' ],\n\t\t\tstyles[ 'error-boundary__title--dark' ]\n\t\t);\n\n\t\tconst messageStyle = getStylesFromColorScheme(\n\t\t\tstyles[ 'error-boundary__message' ],\n\t\t\tstyles[ 'error-boundary__message--dark' ]\n\t\t);\n\n\t\treturn (\n\t\t\t<SafeAreaView>\n\t\t\t\t<ScrollView\n\t\t\t\t\tstyle={ styles[ 'error-boundary__scroll' ] }\n\t\t\t\t\tcontentContainerStyle={\n\t\t\t\t\t\tstyles[ 'error-boundary__scroll-container' ]\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t<View style={ styles[ 'error-boundary__container' ] }>\n\t\t\t\t\t\t<View style={ iconContainerStyle }>\n\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\ticon={ warning }\n\t\t\t\t\t\t\t\t{ ...styles[ 'error-boundary__icon' ] }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</View>\n\t\t\t\t\t\t<Text style={ titleStyle }>\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'The editor has encountered an unexpected error'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t<Text style={ messageStyle }>\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'You can copy your post text in case your content is impacted. Copy error details to debug and share with support.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t<View\n\t\t\t\t\t\t\tstyle={\n\t\t\t\t\t\t\t\tstyles[ 'error-boundary__actions-container' ]\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<CopyButton\n\t\t\t\t\t\t\t\tlabel={ __( 'Copy post text' ) }\n\t\t\t\t\t\t\t\taccessibilityLabel={ __(\n\t\t\t\t\t\t\t\t\t'Button to copy post text'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\taccessibilityHint={ __(\n\t\t\t\t\t\t\t\t\t'Tap here to copy post text'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\ttext={ getContent }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<CopyButton\n\t\t\t\t\t\t\t\tlabel={ __( 'Copy error details' ) }\n\t\t\t\t\t\t\t\taccessibilityLabel={ __(\n\t\t\t\t\t\t\t\t\t'Button to copy error details'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\taccessibilityHint={ __(\n\t\t\t\t\t\t\t\t\t'Tap here to copy error details'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\ttext={ error.stack }\n\t\t\t\t\t\t\t\tsecondary\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</View>\n\t\t\t\t\t</View>\n\t\t\t\t</ScrollView>\n\t\t\t</SafeAreaView>\n\t\t);\n\t}\n}\n\nexport default withPreferredColorScheme( ErrorBoundary );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAU,EAAEC,IAAI,EAAEC,gBAAgB,EAAEC,IAAI,QAAQ,cAAc;AACvE,OAAOC,SAAS,MAAM,mCAAmC;AACzD,SAASC,YAAY,QAAQ,gCAAgC;;AAE7D;AACA;AACA;AACA,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,MAAM,QAAQ,iBAAiB;AACxC,SAASC,YAAY,QAAQ,gCAAgC;AAC7D,SACCC,4BAA4B,EAC5BC,wBAAwB,QAClB,oBAAoB;AAC3B,SAASC,OAAO,QAAQ,kBAAkB;AAC1C,SAASC,IAAI,QAAQ,uBAAuB;;AAE5C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW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ACD;AAEA,eAAelB,wBAAwB,CAAE6B,aAAc,CAAC","ignoreList":[]}
|
|
@@ -67,7 +67,7 @@ function EditorKeyboardShortcutsRegister() {
|
|
|
67
67
|
registerShortcut({
|
|
68
68
|
name: 'core/editor/toggle-list-view',
|
|
69
69
|
category: 'global',
|
|
70
|
-
description: __('
|
|
70
|
+
description: __('Show or hide the List View.'),
|
|
71
71
|
keyCombination: {
|
|
72
72
|
modifier: 'access',
|
|
73
73
|
character: 'o'
|
|
@@ -76,7 +76,7 @@ function EditorKeyboardShortcutsRegister() {
|
|
|
76
76
|
registerShortcut({
|
|
77
77
|
name: 'core/editor/toggle-distraction-free',
|
|
78
78
|
category: 'global',
|
|
79
|
-
description: __('
|
|
79
|
+
description: __('Enter or exit distraction free mode.'),
|
|
80
80
|
keyCombination: {
|
|
81
81
|
modifier: 'primaryShift',
|
|
82
82
|
character: '\\'
|
|
@@ -85,7 +85,7 @@ function EditorKeyboardShortcutsRegister() {
|
|
|
85
85
|
registerShortcut({
|
|
86
86
|
name: 'core/editor/toggle-sidebar',
|
|
87
87
|
category: 'global',
|
|
88
|
-
description: __('Show or hide the Settings
|
|
88
|
+
description: __('Show or hide the Settings panel.'),
|
|
89
89
|
keyCombination: {
|
|
90
90
|
modifier: 'primaryShift',
|
|
91
91
|
character: ','
|