@wordpress/editor 13.35.0 → 14.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/README.md +333 -39
- package/build/bindings/index.js +1 -3
- package/build/bindings/index.js.map +1 -1
- package/build/bindings/pattern-overrides.js +1 -1
- package/build/bindings/pattern-overrides.js.map +1 -1
- package/build/bindings/post-meta.js +38 -2
- package/build/bindings/post-meta.js.map +1 -1
- package/build/components/autocompleters/user.js +12 -8
- package/build/components/autocompleters/user.js.map +1 -1
- package/build/components/block-manager/category.js +19 -17
- package/build/components/block-manager/category.js.map +1 -1
- package/build/components/block-manager/checklist.js +15 -14
- package/build/components/block-manager/checklist.js.map +1 -1
- package/build/components/block-manager/index.js +37 -33
- package/build/components/block-manager/index.js.map +1 -1
- package/build/components/block-removal-warnings/index.js +2 -2
- package/build/components/block-removal-warnings/index.js.map +1 -1
- package/build/components/block-settings-menu/content-only-settings-menu.js +59 -36
- package/build/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +16 -13
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
- package/build/components/blog-title/index.js +116 -0
- package/build/components/blog-title/index.js.map +1 -0
- package/build/components/collapsible-block-toolbar/index.js +21 -18
- package/build/components/collapsible-block-toolbar/index.js.map +1 -1
- package/build/components/commands/index.js +109 -3
- package/build/components/commands/index.js.map +1 -1
- package/build/components/create-template-part-modal/index.js +167 -0
- package/build/components/create-template-part-modal/index.js.map +1 -0
- package/build/components/create-template-part-modal/utils.js +64 -0
- package/build/components/create-template-part-modal/utils.js.map +1 -0
- package/build/components/deprecated.js +2 -2
- package/build/components/deprecated.js.map +1 -1
- package/build/components/document-bar/index.js +94 -70
- package/build/components/document-bar/index.js.map +1 -1
- package/build/components/document-outline/index.js +124 -121
- package/build/components/document-outline/index.js.map +1 -1
- package/build/components/document-outline/item.js +18 -14
- package/build/components/document-outline/item.js.map +1 -1
- package/build/components/document-tools/index.js +56 -53
- package/build/components/document-tools/index.js.map +1 -1
- package/build/components/editor/index.js +83 -0
- package/build/components/editor/index.js.map +1 -0
- package/build/components/editor-help/add-blocks.native.js +14 -11
- package/build/components/editor-help/add-blocks.native.js.map +1 -1
- package/build/components/editor-help/customize-blocks.native.js +14 -11
- package/build/components/editor-help/customize-blocks.native.js.map +1 -1
- package/build/components/editor-help/help-detail-navigation-screen.native.js +32 -22
- package/build/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
- package/build/components/editor-help/help-get-support-button.native.js +8 -6
- package/build/components/editor-help/help-get-support-button.native.js.map +1 -1
- package/build/components/editor-help/help-section-title.native.js +8 -6
- package/build/components/editor-help/help-section-title.native.js.map +1 -1
- package/build/components/editor-help/help-topic-row.native.js +7 -6
- package/build/components/editor-help/help-topic-row.native.js.map +1 -1
- package/build/components/editor-help/icon-move-blocks.native.js +7 -6
- package/build/components/editor-help/icon-move-blocks.native.js.map +1 -1
- package/build/components/editor-help/index.native.js +94 -76
- package/build/components/editor-help/index.native.js.map +1 -1
- package/build/components/editor-help/intro-to-blocks.native.js +41 -37
- package/build/components/editor-help/intro-to-blocks.native.js.map +1 -1
- package/build/components/editor-help/move-blocks.native.js +25 -21
- package/build/components/editor-help/move-blocks.native.js.map +1 -1
- package/build/components/editor-help/remove-blocks.native.js +12 -9
- package/build/components/editor-help/remove-blocks.native.js.map +1 -1
- package/build/components/editor-help/view-sections.native.js +24 -19
- package/build/components/editor-help/view-sections.native.js.map +1 -1
- package/build/components/editor-history/redo.js +2 -2
- package/build/components/editor-history/redo.js.map +1 -1
- package/build/components/editor-history/undo.js +2 -2
- package/build/components/editor-history/undo.js.map +1 -1
- package/build/components/editor-interface/content-slot-fill.js +23 -0
- package/build/components/editor-interface/content-slot-fill.js.map +1 -0
- package/build/components/editor-interface/index.js +176 -0
- package/build/components/editor-interface/index.js.map +1 -0
- package/build/components/editor-notices/index.js +22 -9
- package/build/components/editor-notices/index.js.map +1 -1
- package/build/components/editor-snackbars/index.js +2 -2
- package/build/components/editor-snackbars/index.js.map +1 -1
- package/build/components/entities-saved-states/entity-record-item.js +37 -10
- package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
- package/build/components/entities-saved-states/entity-type-list.js +25 -22
- package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build/components/entities-saved-states/index.js +53 -46
- package/build/components/entities-saved-states/index.js.map +1 -1
- package/build/components/error-boundary/index.js +27 -14
- package/build/components/error-boundary/index.js.map +1 -1
- package/build/components/error-boundary/index.native.js +45 -35
- package/build/components/error-boundary/index.native.js.map +1 -1
- package/build/components/global-keyboard-shortcuts/register-shortcuts.js +3 -4
- package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
- package/build/components/global-styles-provider/index.js +81 -16
- package/build/components/global-styles-provider/index.js.map +1 -1
- package/build/components/header/back-button.js +37 -0
- package/build/components/header/back-button.js.map +1 -0
- package/build/components/header/index.js +85 -60
- package/build/components/header/index.js.map +1 -1
- package/build/components/inserter-sidebar/index.js +45 -19
- package/build/components/inserter-sidebar/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +2 -2
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +53 -48
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +30 -26
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build/components/list-view-sidebar/index.js +59 -47
- package/build/components/list-view-sidebar/index.js.map +1 -1
- package/build/components/list-view-sidebar/list-view-outline.js +21 -4
- package/build/components/list-view-sidebar/list-view-outline.js.map +1 -1
- package/build/components/local-autosave-monitor/index.js +15 -2
- package/build/components/local-autosave-monitor/index.js.map +1 -1
- package/build/components/media-categories/index.js +1 -1
- package/build/components/media-categories/index.js.map +1 -1
- package/build/components/mode-switcher/index.js +10 -10
- package/build/components/mode-switcher/index.js.map +1 -1
- package/build/components/more-menu/copy-content-menu-item.js +5 -4
- package/build/components/more-menu/copy-content-menu-item.js.map +1 -1
- package/build/components/more-menu/index.js +89 -76
- package/build/components/more-menu/index.js.map +1 -1
- package/build/components/more-menu/tools-more-menu-group.js +2 -2
- package/build/components/more-menu/tools-more-menu-group.js.map +1 -1
- package/build/components/more-menu/view-more-menu-group.js +2 -2
- package/build/components/more-menu/view-more-menu-group.js.map +1 -1
- package/build/components/offline-status/index.native.js +12 -11
- package/build/components/offline-status/index.native.js.map +1 -1
- package/build/components/page-attributes/order.js +87 -14
- package/build/components/page-attributes/order.js.map +1 -1
- package/build/components/page-attributes/panel.js +10 -19
- package/build/components/page-attributes/panel.js.map +1 -1
- package/build/components/page-attributes/parent.js +86 -3
- package/build/components/page-attributes/parent.js.map +1 -1
- package/build/components/pattern-duplicate-modal/index.js +59 -0
- package/build/components/pattern-duplicate-modal/index.js.map +1 -0
- package/build/components/pattern-overrides-panel/index.js +2 -2
- package/build/components/pattern-overrides-panel/index.js.map +1 -1
- package/build/components/pattern-rename-modal/index.js +58 -0
- package/build/components/pattern-rename-modal/index.js.map +1 -0
- package/build/components/plugin-document-setting-panel/index.js +17 -12
- package/build/components/plugin-document-setting-panel/index.js.map +1 -1
- package/build/components/plugin-post-publish-panel/index.js +10 -7
- package/build/components/plugin-post-publish-panel/index.js.map +1 -1
- package/build/components/plugin-post-status-info/index.js +7 -4
- package/build/components/plugin-post-status-info/index.js.map +1 -1
- package/build/components/plugin-pre-publish-panel/index.js +10 -7
- package/build/components/plugin-pre-publish-panel/index.js.map +1 -1
- package/build/components/plugin-sidebar/index.js +3 -4
- package/build/components/plugin-sidebar/index.js.map +1 -1
- package/build/components/plugin-sidebar-more-menu-item/index.js +3 -5
- package/build/components/plugin-sidebar-more-menu-item/index.js.map +1 -1
- package/build/components/post-actions/actions.js +379 -309
- package/build/components/post-actions/actions.js.map +1 -1
- package/build/components/post-actions/export-pattern-action.js +64 -0
- package/build/components/post-actions/export-pattern-action.js.map +1 -0
- package/build/components/post-actions/export-pattern-action.native.js +11 -0
- package/build/components/post-actions/export-pattern-action.native.js.map +1 -0
- package/build/components/post-actions/index.js +66 -50
- package/build/components/post-actions/index.js.map +1 -1
- package/build/components/post-author/check.js +6 -6
- package/build/components/post-author/check.js.map +1 -1
- package/build/components/post-author/combobox.js +4 -3
- package/build/components/post-author/combobox.js.map +1 -1
- package/build/components/post-author/hook.js +2 -1
- package/build/components/post-author/hook.js.map +1 -1
- package/build/components/post-author/index.js +3 -3
- package/build/components/post-author/index.js.map +1 -1
- package/build/components/post-author/panel.js +72 -4
- package/build/components/post-author/panel.js.map +1 -1
- package/build/components/post-author/select.js +4 -3
- package/build/components/post-author/select.js.map +1 -1
- package/build/components/post-card-panel/index.js +54 -19
- package/build/components/post-card-panel/index.js.map +1 -1
- package/build/components/post-comments/index.js +38 -22
- package/build/components/post-comments/index.js.map +1 -1
- package/build/components/post-content-information/index.js +8 -5
- package/build/components/post-content-information/index.js.map +1 -1
- package/build/components/post-discussion/panel.js +54 -38
- package/build/components/post-discussion/panel.js.map +1 -1
- package/build/components/post-excerpt/check.js +6 -6
- package/build/components/post-excerpt/check.js.map +1 -1
- package/build/components/post-excerpt/index.js +18 -17
- package/build/components/post-excerpt/index.js.map +1 -1
- package/build/components/post-excerpt/panel.js +59 -42
- package/build/components/post-excerpt/panel.js.map +1 -1
- package/build/components/post-excerpt/plugin.js +7 -4
- package/build/components/post-excerpt/plugin.js.map +1 -1
- package/build/components/post-featured-image/check.js +17 -7
- package/build/components/post-featured-image/check.js.map +1 -1
- package/build/components/post-featured-image/index.js +77 -49
- package/build/components/post-featured-image/index.js.map +1 -1
- package/build/components/post-featured-image/panel.js +22 -7
- package/build/components/post-featured-image/panel.js.map +1 -1
- package/build/components/post-format/check.js +14 -4
- package/build/components/post-format/check.js.map +1 -1
- package/build/components/post-format/index.js +37 -20
- package/build/components/post-format/index.js.map +1 -1
- package/build/components/post-format/panel.js +73 -7
- package/build/components/post-format/panel.js.map +1 -1
- package/build/components/post-last-edited-panel/index.js +7 -4
- package/build/components/post-last-edited-panel/index.js.map +1 -1
- package/build/components/post-last-revision/check.js +13 -5
- package/build/components/post-last-revision/check.js.map +1 -1
- package/build/components/post-last-revision/index.js +49 -17
- package/build/components/post-last-revision/index.js.map +1 -1
- package/build/components/post-last-revision/panel.js +12 -5
- package/build/components/post-last-revision/panel.js.map +1 -1
- package/build/components/post-locked-modal/index.js +57 -35
- package/build/components/post-locked-modal/index.js.map +1 -1
- package/build/components/post-panel-row/index.js +11 -8
- package/build/components/post-panel-row/index.js.map +1 -1
- package/build/components/post-panel-section/index.js +5 -4
- package/build/components/post-panel-section/index.js.map +1 -1
- package/build/components/post-pending-status/check.js +10 -0
- package/build/components/post-pending-status/check.js.map +1 -1
- package/build/components/post-pending-status/index.js +14 -7
- package/build/components/post-pending-status/index.js.map +1 -1
- package/build/components/post-pingbacks/index.js +13 -5
- package/build/components/post-pingbacks/index.js.map +1 -1
- package/build/components/post-preview-button/index.js +46 -21
- package/build/components/post-preview-button/index.js.map +1 -1
- package/build/components/post-publish-button/index.js +21 -11
- package/build/components/post-publish-button/index.js.map +1 -1
- package/build/components/post-publish-button/post-publish-button-or-toggle.js +2 -2
- package/build/components/post-publish-button/post-publish-button-or-toggle.js.map +1 -1
- package/build/components/post-publish-panel/index.js +47 -33
- package/build/components/post-publish-panel/index.js.map +1 -1
- package/build/components/post-publish-panel/maybe-category-panel.js +12 -9
- package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-post-format-panel.js +21 -15
- package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-tags-panel.js +13 -10
- package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-upload-media.js +29 -24
- package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
- package/build/components/post-publish-panel/postpublish.js +55 -38
- package/build/components/post-publish-panel/postpublish.js.map +1 -1
- package/build/components/post-publish-panel/prepublish.js +41 -26
- package/build/components/post-publish-panel/prepublish.js.map +1 -1
- package/build/components/post-saved-state/index.js +8 -8
- package/build/components/post-saved-state/index.js.map +1 -1
- package/build/components/post-schedule/check.js +8 -0
- package/build/components/post-schedule/check.js.map +1 -1
- package/build/components/post-schedule/index.js +30 -5
- package/build/components/post-schedule/index.js.map +1 -1
- package/build/components/post-schedule/label.js +16 -0
- package/build/components/post-schedule/label.js.map +1 -1
- package/build/components/post-schedule/panel.js +43 -30
- package/build/components/post-schedule/panel.js.map +1 -1
- package/build/components/post-slug/check.js +5 -4
- package/build/components/post-slug/check.js.map +1 -1
- package/build/components/post-slug/index.js +5 -3
- package/build/components/post-slug/index.js.map +1 -1
- package/build/components/post-slug/panel.js +7 -4
- package/build/components/post-slug/panel.js.map +1 -1
- package/build/components/post-status/index.js +118 -119
- package/build/components/post-status/index.js.map +1 -1
- package/build/components/post-sticky/index.js +16 -8
- package/build/components/post-sticky/index.js.map +1 -1
- package/build/components/post-sticky/panel.js +6 -2
- package/build/components/post-sticky/panel.js.map +1 -1
- package/build/components/post-switch-to-draft-button/index.js +25 -21
- package/build/components/post-switch-to-draft-button/index.js.map +1 -1
- package/build/components/post-sync-status/index.js +8 -6
- package/build/components/post-sync-status/index.js.map +1 -1
- package/build/components/post-taxonomies/flat-term-selector.js +21 -20
- package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/hierarchical-term-selector.js +71 -61
- package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/index.js +6 -6
- package/build/components/post-taxonomies/index.js.map +1 -1
- package/build/components/post-taxonomies/most-used-terms.js +19 -15
- package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build/components/post-taxonomies/panel.js +15 -11
- package/build/components/post-taxonomies/panel.js.map +1 -1
- package/build/components/post-template/block-theme.js +42 -32
- package/build/components/post-template/block-theme.js.map +1 -1
- package/build/components/post-template/classic-theme.js +73 -50
- package/build/components/post-template/classic-theme.js.map +1 -1
- package/build/components/post-template/create-new-template-modal.js +33 -27
- package/build/components/post-template/create-new-template-modal.js.map +1 -1
- package/build/components/post-template/create-new-template.js +14 -11
- package/build/components/post-template/create-new-template.js.map +1 -1
- package/build/components/post-template/panel.js +16 -10
- package/build/components/post-template/panel.js.map +1 -1
- package/build/components/post-template/reset-default-template.js +5 -4
- package/build/components/post-template/reset-default-template.js.map +1 -1
- package/build/components/post-template/swap-template-button.js +20 -15
- package/build/components/post-template/swap-template-button.js.map +1 -1
- package/build/components/post-text-editor/index.js +27 -20
- package/build/components/post-text-editor/index.js.map +1 -1
- package/build/components/post-title/index.js +29 -17
- package/build/components/post-title/index.js.map +1 -1
- package/build/components/post-title/index.native.js +81 -57
- package/build/components/post-title/index.native.js.map +1 -1
- package/build/components/post-title/post-title-raw.js +10 -3
- package/build/components/post-title/post-title-raw.js.map +1 -1
- package/build/components/post-title/use-post-title-focus.js +7 -0
- package/build/components/post-title/use-post-title-focus.js.map +1 -1
- package/build/components/post-title/use-post-title.js +5 -0
- package/build/components/post-title/use-post-title.js.map +1 -1
- package/build/components/post-transform-panel/index.js +11 -11
- package/build/components/post-transform-panel/index.js.map +1 -1
- package/build/components/post-trash/index.js +19 -15
- package/build/components/post-trash/index.js.map +1 -1
- package/build/components/post-url/check.js +8 -0
- package/build/components/post-url/check.js.map +1 -1
- package/build/components/post-url/index.js +98 -73
- package/build/components/post-url/index.js.map +1 -1
- package/build/components/post-url/label.js +11 -0
- package/build/components/post-url/label.js.map +1 -1
- package/build/components/post-url/panel.js +56 -26
- package/build/components/post-url/panel.js.map +1 -1
- package/build/components/post-view-link/index.js +2 -2
- package/build/components/post-view-link/index.js.map +1 -1
- package/build/components/post-visibility/check.js +9 -0
- package/build/components/post-visibility/check.js.map +1 -1
- package/build/components/post-visibility/index.js +83 -68
- package/build/components/post-visibility/index.js.map +1 -1
- package/build/components/post-visibility/label.js +11 -0
- package/build/components/post-visibility/label.js.map +1 -1
- package/build/components/posts-per-page/index.js +109 -0
- package/build/components/posts-per-page/index.js.map +1 -0
- package/build/components/preferences-modal/enable-plugin-document-setting-panel.js +7 -5
- package/build/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -1
- package/build/components/preferences-modal/index.js +124 -102
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/preview-dropdown/index.js +47 -31
- package/build/components/preview-dropdown/index.js.map +1 -1
- package/build/components/provider/disable-non-page-content-blocks.js +5 -3
- package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
- package/build/components/provider/index.js +94 -20
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/index.native.js +55 -19
- package/build/components/provider/index.native.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.js +7 -6
- package/build/components/provider/use-block-editor-settings.js.map +1 -1
- package/build/components/provider/with-registry-provider.js +31 -24
- package/build/components/provider/with-registry-provider.js.map +1 -1
- package/build/components/resizable-editor/index.js +96 -0
- package/build/components/resizable-editor/index.js.map +1 -0
- package/build/components/resizable-editor/resize-handle.js +59 -0
- package/build/components/resizable-editor/resize-handle.js.map +1 -0
- package/build/components/save-publish-panels/index.js +35 -26
- package/build/components/save-publish-panels/index.js.map +1 -1
- package/build/components/sidebar/header.js +17 -14
- package/build/components/sidebar/header.js.map +1 -1
- package/build/components/sidebar/index.js +36 -32
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar/post-summary.js +39 -33
- package/build/components/sidebar/post-summary.js.map +1 -1
- package/build/components/site-discussion/index.js +133 -0
- package/build/components/site-discussion/index.js.map +1 -0
- package/build/components/start-page-options/index.js +13 -11
- package/build/components/start-page-options/index.js.map +1 -1
- package/build/components/start-template-options/index.js +29 -23
- package/build/components/start-template-options/index.js.map +1 -1
- package/build/components/table-of-contents/index.js +4 -4
- package/build/components/table-of-contents/index.js.map +1 -1
- package/build/components/table-of-contents/panel.js +53 -35
- package/build/components/table-of-contents/panel.js.map +1 -1
- package/build/components/template-areas/index.js +36 -22
- package/build/components/template-areas/index.js.map +1 -1
- package/build/components/template-content-panel/index.js +7 -6
- package/build/components/template-content-panel/index.js.map +1 -1
- package/build/components/template-validation-notice/index.js +25 -21
- package/build/components/template-validation-notice/index.js.map +1 -1
- package/build/components/text-editor/index.js +73 -0
- package/build/components/text-editor/index.js.map +1 -0
- package/build/components/time-to-read/index.js +8 -8
- package/build/components/time-to-read/index.js.map +1 -1
- package/build/components/{editor-canvas → visual-editor}/edit-template-blocks-notification.js +6 -6
- package/build/components/visual-editor/edit-template-blocks-notification.js.map +1 -0
- package/build/components/{editor-canvas → visual-editor}/index.js +115 -74
- package/build/components/visual-editor/index.js.map +1 -0
- package/build/components/word-count/index.js +5 -4
- package/build/components/word-count/index.js.map +1 -1
- package/build/hooks/custom-sources-backwards-compatibility.js +3 -4
- package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
- package/build/hooks/index.js +1 -0
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/media-upload.js +10 -0
- package/build/hooks/media-upload.js.map +1 -0
- package/build/hooks/pattern-overrides.js +15 -11
- package/build/hooks/pattern-overrides.js.map +1 -1
- package/build/private-apis.js +12 -28
- package/build/private-apis.js.map +1 -1
- package/build/private-apis.native.js +2 -26
- package/build/private-apis.native.js.map +1 -1
- package/build/store/constants.js +4 -1
- package/build/store/constants.js.map +1 -1
- package/build/store/private-actions.js +10 -14
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +39 -1
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/selectors.js +1 -1
- package/build/store/selectors.js.map +1 -1
- package/build/utils/set-nested-value.js +44 -0
- package/build/utils/set-nested-value.js.map +1 -0
- package/build-module/bindings/index.js +1 -3
- package/build-module/bindings/index.js.map +1 -1
- package/build-module/bindings/pattern-overrides.js +1 -1
- package/build-module/bindings/pattern-overrides.js.map +1 -1
- package/build-module/bindings/post-meta.js +38 -2
- package/build-module/bindings/post-meta.js.map +1 -1
- package/build-module/components/autocompleters/user.js +14 -9
- package/build-module/components/autocompleters/user.js.map +1 -1
- package/build-module/components/block-manager/category.js +20 -17
- package/build-module/components/block-manager/category.js.map +1 -1
- package/build-module/components/block-manager/checklist.js +16 -14
- package/build-module/components/block-manager/checklist.js.map +1 -1
- package/build-module/components/block-manager/index.js +38 -33
- package/build-module/components/block-manager/index.js.map +1 -1
- package/build-module/components/block-removal-warnings/index.js +2 -2
- package/build-module/components/block-removal-warnings/index.js.map +1 -1
- package/build-module/components/block-settings-menu/content-only-settings-menu.js +61 -36
- package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +16 -13
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
- package/build-module/components/blog-title/index.js +110 -0
- package/build-module/components/blog-title/index.js.map +1 -0
- package/build-module/components/collapsible-block-toolbar/index.js +23 -18
- package/build-module/components/collapsible-block-toolbar/index.js.map +1 -1
- package/build-module/components/commands/index.js +111 -5
- package/build-module/components/commands/index.js.map +1 -1
- package/build-module/components/create-template-part-modal/index.js +160 -0
- package/build-module/components/create-template-part-modal/index.js.map +1 -0
- package/build-module/components/create-template-part-modal/utils.js +54 -0
- package/build-module/components/create-template-part-modal/utils.js.map +1 -0
- package/build-module/components/deprecated.js +2 -2
- package/build-module/components/deprecated.js.map +1 -1
- package/build-module/components/document-bar/index.js +93 -68
- package/build-module/components/document-bar/index.js.map +1 -1
- package/build-module/components/document-outline/index.js +125 -120
- package/build-module/components/document-outline/index.js.map +1 -1
- package/build-module/components/document-outline/item.js +19 -14
- package/build-module/components/document-outline/item.js.map +1 -1
- package/build-module/components/document-tools/index.js +58 -53
- package/build-module/components/document-tools/index.js.map +1 -1
- package/build-module/components/editor/index.js +76 -0
- package/build-module/components/editor/index.js.map +1 -0
- package/build-module/components/editor-help/add-blocks.native.js +16 -11
- package/build-module/components/editor-help/add-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/customize-blocks.native.js +16 -11
- 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 +33 -22
- package/build-module/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
- package/build-module/components/editor-help/help-get-support-button.native.js +8 -6
- package/build-module/components/editor-help/help-get-support-button.native.js.map +1 -1
- package/build-module/components/editor-help/help-section-title.native.js +8 -6
- package/build-module/components/editor-help/help-section-title.native.js.map +1 -1
- package/build-module/components/editor-help/help-topic-row.native.js +7 -6
- package/build-module/components/editor-help/help-topic-row.native.js.map +1 -1
- package/build-module/components/editor-help/icon-move-blocks.native.js +7 -6
- package/build-module/components/editor-help/icon-move-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/index.native.js +96 -76
- package/build-module/components/editor-help/index.native.js.map +1 -1
- package/build-module/components/editor-help/intro-to-blocks.native.js +43 -37
- package/build-module/components/editor-help/intro-to-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/move-blocks.native.js +27 -21
- package/build-module/components/editor-help/move-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/remove-blocks.native.js +14 -9
- package/build-module/components/editor-help/remove-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/view-sections.native.js +25 -19
- package/build-module/components/editor-help/view-sections.native.js.map +1 -1
- package/build-module/components/editor-history/redo.js +2 -2
- package/build-module/components/editor-history/redo.js.map +1 -1
- package/build-module/components/editor-history/undo.js +2 -2
- package/build-module/components/editor-history/undo.js.map +1 -1
- package/build-module/components/editor-interface/content-slot-fill.js +16 -0
- package/build-module/components/editor-interface/content-slot-fill.js.map +1 -0
- package/build-module/components/editor-interface/index.js +170 -0
- package/build-module/components/editor-interface/index.js.map +1 -0
- package/build-module/components/editor-notices/index.js +25 -9
- package/build-module/components/editor-notices/index.js.map +1 -1
- package/build-module/components/editor-snackbars/index.js +2 -2
- package/build-module/components/editor-snackbars/index.js.map +1 -1
- package/build-module/components/entities-saved-states/entity-record-item.js +40 -11
- 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 +26 -22
- package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build-module/components/entities-saved-states/index.js +54 -46
- package/build-module/components/entities-saved-states/index.js.map +1 -1
- package/build-module/components/error-boundary/index.js +27 -14
- package/build-module/components/error-boundary/index.js.map +1 -1
- package/build-module/components/error-boundary/index.native.js +46 -35
- package/build-module/components/error-boundary/index.native.js.map +1 -1
- package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +2 -2
- package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
- package/build-module/components/global-styles-provider/index.js +82 -17
- package/build-module/components/global-styles-provider/index.js.map +1 -1
- package/build-module/components/header/back-button.js +31 -0
- package/build-module/components/header/back-button.js.map +1 -0
- package/build-module/components/header/index.js +86 -60
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/inserter-sidebar/index.js +47 -21
- package/build-module/components/inserter-sidebar/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +2 -2
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +54 -48
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +32 -26
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build-module/components/list-view-sidebar/index.js +60 -47
- package/build-module/components/list-view-sidebar/index.js.map +1 -1
- package/build-module/components/list-view-sidebar/list-view-outline.js +23 -4
- package/build-module/components/list-view-sidebar/list-view-outline.js.map +1 -1
- package/build-module/components/local-autosave-monitor/index.js +15 -2
- package/build-module/components/local-autosave-monitor/index.js.map +1 -1
- package/build-module/components/media-categories/index.js +1 -1
- package/build-module/components/media-categories/index.js.map +1 -1
- package/build-module/components/mode-switcher/index.js +9 -8
- package/build-module/components/mode-switcher/index.js.map +1 -1
- package/build-module/components/more-menu/copy-content-menu-item.js +5 -4
- package/build-module/components/more-menu/copy-content-menu-item.js.map +1 -1
- package/build-module/components/more-menu/index.js +91 -76
- package/build-module/components/more-menu/index.js.map +1 -1
- package/build-module/components/more-menu/tools-more-menu-group.js +2 -2
- package/build-module/components/more-menu/tools-more-menu-group.js.map +1 -1
- package/build-module/components/more-menu/view-more-menu-group.js +2 -2
- package/build-module/components/more-menu/view-more-menu-group.js.map +1 -1
- package/build-module/components/offline-status/index.native.js +12 -9
- package/build-module/components/offline-status/index.native.js.map +1 -1
- package/build-module/components/page-attributes/order.js +90 -17
- package/build-module/components/page-attributes/order.js.map +1 -1
- package/build-module/components/page-attributes/panel.js +13 -21
- package/build-module/components/page-attributes/panel.js.map +1 -1
- package/build-module/components/page-attributes/parent.js +88 -5
- package/build-module/components/page-attributes/parent.js.map +1 -1
- package/build-module/components/pattern-duplicate-modal/index.js +51 -0
- package/build-module/components/pattern-duplicate-modal/index.js.map +1 -0
- package/build-module/components/pattern-overrides-panel/index.js +2 -2
- package/build-module/components/pattern-overrides-panel/index.js.map +1 -1
- package/build-module/components/pattern-rename-modal/index.js +50 -0
- package/build-module/components/pattern-rename-modal/index.js.map +1 -0
- package/build-module/components/plugin-document-setting-panel/index.js +19 -12
- package/build-module/components/plugin-document-setting-panel/index.js.map +1 -1
- package/build-module/components/plugin-post-publish-panel/index.js +10 -7
- package/build-module/components/plugin-post-publish-panel/index.js.map +1 -1
- package/build-module/components/plugin-post-status-info/index.js +7 -4
- package/build-module/components/plugin-post-status-info/index.js.map +1 -1
- package/build-module/components/plugin-pre-publish-panel/index.js +10 -7
- package/build-module/components/plugin-pre-publish-panel/index.js.map +1 -1
- package/build-module/components/plugin-sidebar/index.js +2 -2
- package/build-module/components/plugin-sidebar/index.js.map +1 -1
- package/build-module/components/plugin-sidebar-more-menu-item/index.js +2 -3
- package/build-module/components/plugin-sidebar-more-menu-item/index.js.map +1 -1
- package/build-module/components/post-actions/actions.js +380 -309
- package/build-module/components/post-actions/actions.js.map +1 -1
- package/build-module/components/post-actions/export-pattern-action.js +58 -0
- package/build-module/components/post-actions/export-pattern-action.js.map +1 -0
- package/build-module/components/post-actions/export-pattern-action.native.js +5 -0
- package/build-module/components/post-actions/export-pattern-action.native.js.map +1 -0
- package/build-module/components/post-actions/index.js +68 -50
- package/build-module/components/post-actions/index.js.map +1 -1
- package/build-module/components/post-author/check.js +5 -4
- package/build-module/components/post-author/check.js.map +1 -1
- package/build-module/components/post-author/combobox.js +4 -3
- package/build-module/components/post-author/combobox.js.map +1 -1
- package/build-module/components/post-author/hook.js +2 -1
- package/build-module/components/post-author/hook.js.map +1 -1
- package/build-module/components/post-author/index.js +3 -3
- package/build-module/components/post-author/index.js.map +1 -1
- package/build-module/components/post-author/panel.js +72 -4
- package/build-module/components/post-author/panel.js.map +1 -1
- package/build-module/components/post-author/select.js +4 -3
- package/build-module/components/post-author/select.js.map +1 -1
- package/build-module/components/post-card-panel/index.js +54 -20
- package/build-module/components/post-card-panel/index.js.map +1 -1
- package/build-module/components/post-comments/index.js +40 -22
- package/build-module/components/post-comments/index.js.map +1 -1
- package/build-module/components/post-content-information/index.js +8 -5
- package/build-module/components/post-content-information/index.js.map +1 -1
- package/build-module/components/post-discussion/panel.js +56 -39
- package/build-module/components/post-discussion/panel.js.map +1 -1
- package/build-module/components/post-excerpt/check.js +5 -4
- package/build-module/components/post-excerpt/check.js.map +1 -1
- package/build-module/components/post-excerpt/index.js +17 -15
- package/build-module/components/post-excerpt/index.js.map +1 -1
- package/build-module/components/post-excerpt/panel.js +60 -40
- package/build-module/components/post-excerpt/panel.js.map +1 -1
- package/build-module/components/post-excerpt/plugin.js +7 -4
- package/build-module/components/post-excerpt/plugin.js.map +1 -1
- package/build-module/components/post-featured-image/check.js +18 -6
- package/build-module/components/post-featured-image/check.js.map +1 -1
- package/build-module/components/post-featured-image/index.js +78 -49
- package/build-module/components/post-featured-image/index.js.map +1 -1
- package/build-module/components/post-featured-image/panel.js +22 -7
- package/build-module/components/post-featured-image/panel.js.map +1 -1
- package/build-module/components/post-format/check.js +14 -4
- package/build-module/components/post-format/check.js.map +1 -1
- package/build-module/components/post-format/index.js +39 -21
- package/build-module/components/post-format/index.js.map +1 -1
- package/build-module/components/post-format/panel.js +75 -7
- package/build-module/components/post-format/panel.js.map +1 -1
- package/build-module/components/post-last-edited-panel/index.js +7 -4
- package/build-module/components/post-last-edited-panel/index.js.map +1 -1
- package/build-module/components/post-last-revision/check.js +14 -4
- package/build-module/components/post-last-revision/check.js.map +1 -1
- package/build-module/components/post-last-revision/index.js +48 -17
- package/build-module/components/post-last-revision/index.js.map +1 -1
- package/build-module/components/post-last-revision/panel.js +13 -4
- package/build-module/components/post-last-revision/panel.js.map +1 -1
- package/build-module/components/post-locked-modal/index.js +60 -34
- package/build-module/components/post-locked-modal/index.js.map +1 -1
- package/build-module/components/post-panel-row/index.js +12 -8
- package/build-module/components/post-panel-row/index.js.map +1 -1
- package/build-module/components/post-panel-section/index.js +5 -4
- package/build-module/components/post-panel-section/index.js.map +1 -1
- package/build-module/components/post-pending-status/check.js +11 -0
- package/build-module/components/post-pending-status/check.js.map +1 -1
- package/build-module/components/post-pending-status/index.js +15 -7
- package/build-module/components/post-pending-status/index.js.map +1 -1
- package/build-module/components/post-pingbacks/index.js +13 -5
- package/build-module/components/post-pingbacks/index.js.map +1 -1
- package/build-module/components/post-preview-button/index.js +48 -21
- package/build-module/components/post-preview-button/index.js.map +1 -1
- package/build-module/components/post-publish-button/index.js +22 -11
- package/build-module/components/post-publish-button/index.js.map +1 -1
- package/build-module/components/post-publish-button/post-publish-button-or-toggle.js +2 -2
- package/build-module/components/post-publish-button/post-publish-button-or-toggle.js.map +1 -1
- package/build-module/components/post-publish-panel/index.js +49 -33
- package/build-module/components/post-publish-panel/index.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-category-panel.js +13 -9
- 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 +22 -15
- 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 +14 -10
- 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 +30 -24
- package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
- package/build-module/components/post-publish-panel/postpublish.js +57 -38
- package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
- package/build-module/components/post-publish-panel/prepublish.js +43 -26
- package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
- package/build-module/components/post-saved-state/index.js +8 -6
- package/build-module/components/post-saved-state/index.js.map +1 -1
- package/build-module/components/post-schedule/check.js +9 -0
- package/build-module/components/post-schedule/check.js.map +1 -1
- package/build-module/components/post-schedule/index.js +30 -6
- package/build-module/components/post-schedule/index.js.map +1 -1
- package/build-module/components/post-schedule/label.js +17 -0
- package/build-module/components/post-schedule/label.js.map +1 -1
- package/build-module/components/post-schedule/panel.js +43 -30
- package/build-module/components/post-schedule/panel.js.map +1 -1
- package/build-module/components/post-slug/check.js +5 -4
- package/build-module/components/post-slug/check.js.map +1 -1
- package/build-module/components/post-slug/index.js +5 -3
- package/build-module/components/post-slug/index.js.map +1 -1
- package/build-module/components/post-slug/panel.js +7 -4
- package/build-module/components/post-slug/panel.js.map +1 -1
- package/build-module/components/post-status/index.js +121 -120
- package/build-module/components/post-status/index.js.map +1 -1
- package/build-module/components/post-sticky/index.js +17 -9
- package/build-module/components/post-sticky/index.js.map +1 -1
- package/build-module/components/post-sticky/panel.js +6 -2
- package/build-module/components/post-sticky/panel.js.map +1 -1
- package/build-module/components/post-switch-to-draft-button/index.js +27 -21
- package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
- package/build-module/components/post-sync-status/index.js +8 -6
- package/build-module/components/post-sync-status/index.js.map +1 -1
- package/build-module/components/post-taxonomies/flat-term-selector.js +22 -18
- package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js +71 -59
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/index.js +6 -6
- package/build-module/components/post-taxonomies/index.js.map +1 -1
- package/build-module/components/post-taxonomies/most-used-terms.js +20 -15
- package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build-module/components/post-taxonomies/panel.js +15 -11
- package/build-module/components/post-taxonomies/panel.js.map +1 -1
- package/build-module/components/post-template/block-theme.js +44 -32
- package/build-module/components/post-template/block-theme.js.map +1 -1
- package/build-module/components/post-template/classic-theme.js +74 -50
- package/build-module/components/post-template/classic-theme.js.map +1 -1
- package/build-module/components/post-template/create-new-template-modal.js +34 -27
- package/build-module/components/post-template/create-new-template-modal.js.map +1 -1
- package/build-module/components/post-template/create-new-template.js +16 -11
- package/build-module/components/post-template/create-new-template.js.map +1 -1
- package/build-module/components/post-template/panel.js +17 -9
- package/build-module/components/post-template/panel.js.map +1 -1
- package/build-module/components/post-template/reset-default-template.js +5 -4
- package/build-module/components/post-template/reset-default-template.js.map +1 -1
- package/build-module/components/post-template/swap-template-button.js +22 -15
- package/build-module/components/post-template/swap-template-button.js.map +1 -1
- package/build-module/components/post-text-editor/index.js +30 -19
- package/build-module/components/post-text-editor/index.js.map +1 -1
- package/build-module/components/post-title/index.js +29 -18
- package/build-module/components/post-title/index.js.map +1 -1
- package/build-module/components/post-title/index.native.js +81 -57
- package/build-module/components/post-title/index.native.js.map +1 -1
- package/build-module/components/post-title/post-title-raw.js +11 -2
- package/build-module/components/post-title/post-title-raw.js.map +1 -1
- package/build-module/components/post-title/use-post-title-focus.js +8 -0
- package/build-module/components/post-title/use-post-title-focus.js.map +1 -1
- package/build-module/components/post-title/use-post-title.js +6 -0
- package/build-module/components/post-title/use-post-title.js.map +1 -1
- package/build-module/components/post-transform-panel/index.js +12 -12
- package/build-module/components/post-transform-panel/index.js.map +1 -1
- package/build-module/components/post-trash/index.js +21 -15
- package/build-module/components/post-trash/index.js.map +1 -1
- package/build-module/components/post-url/check.js +9 -0
- package/build-module/components/post-url/check.js.map +1 -1
- package/build-module/components/post-url/index.js +100 -72
- package/build-module/components/post-url/index.js.map +1 -1
- package/build-module/components/post-url/label.js +12 -0
- package/build-module/components/post-url/label.js.map +1 -1
- package/build-module/components/post-url/panel.js +59 -25
- package/build-module/components/post-url/panel.js.map +1 -1
- package/build-module/components/post-view-link/index.js +2 -2
- package/build-module/components/post-view-link/index.js.map +1 -1
- package/build-module/components/post-visibility/check.js +10 -0
- package/build-module/components/post-visibility/check.js.map +1 -1
- package/build-module/components/post-visibility/index.js +85 -67
- package/build-module/components/post-visibility/index.js.map +1 -1
- package/build-module/components/post-visibility/label.js +12 -0
- package/build-module/components/post-visibility/label.js.map +1 -1
- package/build-module/components/posts-per-page/index.js +103 -0
- package/build-module/components/posts-per-page/index.js.map +1 -0
- package/build-module/components/preferences-modal/enable-plugin-document-setting-panel.js +7 -5
- package/build-module/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +126 -102
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/preview-dropdown/index.js +49 -31
- package/build-module/components/preview-dropdown/index.js.map +1 -1
- package/build-module/components/provider/disable-non-page-content-blocks.js +5 -3
- package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
- package/build-module/components/provider/index.js +96 -20
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/index.native.js +58 -20
- package/build-module/components/provider/index.native.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.js +7 -6
- package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
- package/build-module/components/provider/with-registry-provider.js +33 -26
- package/build-module/components/provider/with-registry-provider.js.map +1 -1
- package/build-module/components/resizable-editor/index.js +89 -0
- package/build-module/components/resizable-editor/index.js.map +1 -0
- package/build-module/components/resizable-editor/resize-handle.js +54 -0
- package/build-module/components/resizable-editor/resize-handle.js.map +1 -0
- package/build-module/components/save-publish-panels/index.js +37 -26
- package/build-module/components/save-publish-panels/index.js.map +1 -1
- package/build-module/components/sidebar/header.js +18 -14
- package/build-module/components/sidebar/header.js.map +1 -1
- package/build-module/components/sidebar/index.js +36 -31
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar/post-summary.js +34 -25
- package/build-module/components/sidebar/post-summary.js.map +1 -1
- package/build-module/components/site-discussion/index.js +127 -0
- package/build-module/components/site-discussion/index.js.map +1 -0
- package/build-module/components/start-page-options/index.js +13 -11
- package/build-module/components/start-page-options/index.js.map +1 -1
- package/build-module/components/start-template-options/index.js +30 -23
- package/build-module/components/start-template-options/index.js.map +1 -1
- package/build-module/components/table-of-contents/index.js +4 -4
- package/build-module/components/table-of-contents/index.js.map +1 -1
- package/build-module/components/table-of-contents/panel.js +55 -35
- package/build-module/components/table-of-contents/panel.js.map +1 -1
- package/build-module/components/template-areas/index.js +37 -22
- package/build-module/components/template-areas/index.js.map +1 -1
- package/build-module/components/template-content-panel/index.js +7 -6
- package/build-module/components/template-content-panel/index.js.map +1 -1
- package/build-module/components/template-validation-notice/index.js +27 -21
- package/build-module/components/template-validation-notice/index.js.map +1 -1
- package/build-module/components/text-editor/index.js +66 -0
- package/build-module/components/text-editor/index.js.map +1 -0
- package/build-module/components/time-to-read/index.js +7 -6
- package/build-module/components/time-to-read/index.js.map +1 -1
- package/build-module/components/{editor-canvas → visual-editor}/edit-template-blocks-notification.js +5 -4
- package/build-module/components/visual-editor/edit-template-blocks-notification.js.map +1 -0
- package/build-module/components/{editor-canvas → visual-editor}/index.js +118 -75
- package/build-module/components/visual-editor/index.js.map +1 -0
- package/build-module/components/word-count/index.js +5 -4
- package/build-module/components/word-count/index.js.map +1 -1
- package/build-module/hooks/custom-sources-backwards-compatibility.js +2 -2
- package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
- package/build-module/hooks/index.js +1 -0
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/media-upload.js +7 -0
- package/build-module/hooks/media-upload.js.map +1 -0
- package/build-module/hooks/pattern-overrides.js +17 -11
- package/build-module/hooks/pattern-overrides.js.map +1 -1
- package/build-module/private-apis.js +12 -28
- package/build-module/private-apis.js.map +1 -1
- package/build-module/private-apis.native.js +2 -26
- package/build-module/private-apis.native.js.map +1 -1
- package/build-module/store/constants.js +3 -0
- package/build-module/store/constants.js.map +1 -1
- package/build-module/store/private-actions.js +10 -14
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +38 -1
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/selectors.js +1 -1
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/set-nested-value.js +38 -0
- package/build-module/utils/set-nested-value.js.map +1 -0
- package/build-style/style-rtl.css +344 -129
- package/build-style/style.css +344 -129
- package/package.json +40 -36
- package/src/bindings/index.js +1 -4
- package/src/bindings/pattern-overrides.js +1 -1
- package/src/bindings/post-meta.js +46 -6
- package/src/components/block-settings-menu/content-only-settings-menu.js +26 -12
- package/src/components/blog-title/index.js +124 -0
- package/src/components/blog-title/style.scss +4 -0
- package/src/components/collapsible-block-toolbar/style.scss +3 -1
- package/src/components/commands/index.js +113 -3
- package/src/components/create-template-part-modal/index.js +205 -0
- package/src/components/create-template-part-modal/style.scss +69 -0
- package/src/components/create-template-part-modal/test/utils.js +60 -0
- package/src/components/create-template-part-modal/utils.js +67 -0
- package/src/components/document-bar/index.js +32 -21
- package/src/components/document-tools/index.js +2 -7
- package/src/components/editor/index.js +93 -0
- package/src/components/editor-help/help-get-support-button.native.js +1 -1
- package/src/components/editor-interface/content-slot-fill.js +15 -0
- package/src/components/editor-interface/index.js +230 -0
- package/src/components/editor-interface/style.scss +3 -0
- package/src/components/editor-notices/index.js +10 -0
- package/src/components/entities-saved-states/entity-record-item.js +45 -16
- package/src/components/entities-saved-states/style.scss +11 -5
- package/src/components/error-boundary/index.js +10 -0
- package/src/components/error-boundary/index.native.js +1 -1
- package/src/components/global-styles-provider/index.js +100 -8
- package/src/components/header/back-button.js +32 -0
- package/src/components/header/index.js +26 -18
- package/src/components/header/style.scss +6 -1
- package/src/components/inserter-sidebar/index.js +65 -32
- package/src/components/inserter-sidebar/style.scss +0 -13
- package/src/components/local-autosave-monitor/index.js +12 -0
- package/src/components/media-categories/index.js +1 -3
- package/src/components/page-attributes/order.js +79 -3
- package/src/components/page-attributes/panel.js +10 -26
- package/src/components/page-attributes/parent.js +98 -2
- package/src/components/page-attributes/style.scss +19 -0
- package/src/components/pattern-duplicate-modal/index.js +50 -0
- package/src/components/pattern-rename-modal/index.js +44 -0
- package/src/components/post-actions/actions.js +308 -261
- package/src/components/post-actions/export-pattern-action.js +74 -0
- package/src/components/post-actions/export-pattern-action.native.js +4 -0
- package/src/components/post-actions/index.js +16 -5
- package/src/components/post-author/combobox.js +1 -0
- package/src/components/post-author/hook.js +1 -1
- package/src/components/post-author/panel.js +63 -2
- package/src/components/post-author/select.js +1 -0
- package/src/components/post-author/style.scss +6 -0
- package/src/components/post-card-panel/index.js +69 -22
- package/src/components/post-card-panel/style.scss +23 -1
- package/src/components/post-comments/index.js +5 -0
- package/src/components/post-discussion/panel.js +9 -2
- package/src/components/post-discussion/style.scss +1 -3
- package/src/components/post-excerpt/panel.js +45 -48
- package/src/components/post-excerpt/style.scss +0 -17
- package/src/components/post-featured-image/check.js +9 -0
- package/src/components/post-featured-image/index.js +15 -0
- package/src/components/post-featured-image/panel.js +9 -0
- package/src/components/post-format/check.js +8 -0
- package/src/components/post-format/index.js +15 -4
- package/src/components/post-format/panel.js +71 -6
- package/src/components/post-format/style.scss +10 -4
- package/src/components/post-last-revision/check.js +8 -0
- package/src/components/post-last-revision/index.js +31 -3
- package/src/components/post-last-revision/panel.js +5 -0
- package/src/components/post-last-revision/style.scss +4 -0
- package/src/components/post-locked-modal/index.js +6 -0
- package/src/components/post-panel-row/style.scss +16 -0
- package/src/components/post-pending-status/check.js +10 -0
- package/src/components/post-pending-status/index.js +5 -0
- package/src/components/post-pingbacks/index.js +6 -0
- package/src/components/post-preview-button/index.js +16 -0
- package/src/components/post-preview-button/test/index.js +10 -2
- package/src/components/post-publish-button/index.js +17 -4
- package/src/components/post-publish-panel/index.js +2 -0
- package/src/components/post-publish-panel/maybe-tags-panel.js +1 -1
- package/src/components/post-publish-panel/style.scss +28 -36
- package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +3 -3
- package/src/components/post-schedule/check.js +8 -0
- package/src/components/post-schedule/index.js +30 -3
- package/src/components/post-schedule/label.js +15 -0
- package/src/components/post-schedule/panel.js +9 -1
- package/src/components/post-schedule/style.scss +0 -11
- package/src/components/post-status/index.js +30 -52
- package/src/components/post-status/style.scss +4 -34
- package/src/components/post-sticky/index.js +12 -7
- package/src/components/post-sticky/style.scss +3 -0
- package/src/components/post-sync-status/index.js +2 -8
- package/src/components/post-template/block-theme.js +1 -0
- package/src/components/post-template/classic-theme.js +15 -0
- package/src/components/post-template/panel.js +5 -0
- package/src/components/post-template/style.scss +0 -8
- package/src/components/post-text-editor/index.js +5 -0
- package/src/components/post-title/index.js +8 -1
- package/src/components/post-title/index.native.js +70 -35
- package/src/components/post-title/post-title-raw.js +8 -0
- package/src/components/post-title/use-post-title-focus.js +7 -0
- package/src/components/post-title/use-post-title.js +5 -0
- package/src/components/post-transform-panel/index.js +2 -10
- package/src/components/post-url/check.js +8 -0
- package/src/components/post-url/index.js +41 -24
- package/src/components/post-url/label.js +10 -0
- package/src/components/post-url/panel.js +18 -5
- package/src/components/post-url/style.scss +0 -9
- package/src/components/post-visibility/check.js +9 -0
- package/src/components/post-visibility/index.js +7 -0
- package/src/components/post-visibility/label.js +10 -0
- package/src/components/posts-per-page/index.js +101 -0
- package/src/components/posts-per-page/style.scss +4 -0
- package/src/components/provider/disable-non-page-content-blocks.js +9 -4
- package/src/components/provider/index.js +68 -0
- package/src/components/provider/index.native.js +43 -2
- package/src/components/provider/use-block-editor-settings.js +4 -6
- package/src/components/provider/with-registry-provider.js +32 -31
- package/src/components/resizable-editor/index.js +90 -0
- package/src/components/resizable-editor/resize-handle.js +62 -0
- package/src/components/resizable-editor/style.scss +53 -0
- package/src/components/save-publish-panels/index.js +10 -2
- package/src/components/save-publish-panels/style.scss +0 -8
- package/src/components/sidebar/index.js +0 -4
- package/src/components/sidebar/post-summary.js +16 -21
- package/src/components/sidebar/style.scss +1 -1
- package/src/components/site-discussion/index.js +138 -0
- package/src/components/site-discussion/style.scss +19 -0
- package/src/components/start-template-options/style.scss +0 -8
- package/src/components/template-areas/index.js +15 -6
- package/src/components/text-editor/index.js +57 -0
- package/src/components/text-editor/style.scss +71 -0
- package/src/components/{editor-canvas → visual-editor}/index.js +177 -108
- package/src/components/visual-editor/style.scss +37 -0
- package/src/hooks/index.js +1 -0
- package/src/hooks/media-upload.js +11 -0
- package/src/private-apis.js +12 -28
- package/src/private-apis.native.js +2 -26
- package/src/store/constants.js +7 -0
- package/src/store/private-actions.js +22 -50
- package/src/store/private-selectors.js +45 -0
- package/src/store/selectors.js +1 -1
- package/src/style.scss +10 -0
- package/src/utils/set-nested-value.js +39 -0
- package/build/components/editor-canvas/edit-template-blocks-notification.js.map +0 -1
- package/build/components/editor-canvas/index.js.map +0 -1
- package/build/components/post-trash/panel.js +0 -18
- package/build/components/post-trash/panel.js.map +0 -1
- package/build-module/components/editor-canvas/edit-template-blocks-notification.js.map +0 -1
- package/build-module/components/editor-canvas/index.js.map +0 -1
- package/build-module/components/post-trash/panel.js +0 -10
- package/build-module/components/post-trash/panel.js.map +0 -1
- package/src/components/post-trash/panel.js +0 -13
- package/src/components/provider/README.md +0 -37
- /package/src/components/{editor-canvas → visual-editor}/edit-template-blocks-notification.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_element","_htmlEntities","_data","_blockEditor","_keycodes","_blocks","_richText","_compose","_dom","_constants","_usePostTitleFocus","_usePostTitle","_postTypeSupportCheck","PostTitle","_","forwardedRef","placeholder","hasFixedToolbar","useSelect","select","getSettings","blockEditorStore","titlePlaceholder","_hasFixedToolbar","isSelected","setIsSelected","useState","ref","focusRef","usePostTitleFocus","title","setTitle","onUpdate","usePostTitle","selection","setSelection","clearSelectedBlock","insertBlocks","insertDefaultBlock","useDispatch","onChange","value","replace","REGEXP_NEWLINES","onInsertBlockAfter","blocks","onSelect","onUnselect","onEnterPress","undefined","onKeyDown","event","keyCode","ENTER","preventDefault","onPaste","clipboardData","plainText","html","getData","error1","error2","window","console","log","content","pasteHandler","HTML","length","firstBlock","name","contentNoHTML","stripHTML","attributes","slice","create","newValue","insert","toHTMLString","start","end","decodedPlaceholder","decodeEntities","__","richTextRef","useRichText","selectionStart","selectionEnd","onSelectionChange","newStart","newEnd","sel","__unstableDisableFormats","className","clsx","DEFAULT_CLASSNAMES","_react","createElement","default","supportKeys","useMergeRefs","contentEditable","role","onFocus","onBlur","onKeyPress","_default","exports","forwardRef"],"sources":["@wordpress/editor/src/components/post-title/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { forwardRef, useState } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { ENTER } from '@wordpress/keycodes';\nimport { pasteHandler } from '@wordpress/blocks';\nimport {\n\t__unstableUseRichText as useRichText,\n\tcreate,\n\ttoHTMLString,\n\tinsert,\n} from '@wordpress/rich-text';\nimport { useMergeRefs } from '@wordpress/compose';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport { DEFAULT_CLASSNAMES, REGEXP_NEWLINES } from './constants';\nimport usePostTitleFocus from './use-post-title-focus';\nimport usePostTitle from './use-post-title';\nimport PostTypeSupportCheck from '../post-type-support-check';\n\nfunction PostTitle( _, forwardedRef ) {\n\tconst { placeholder, hasFixedToolbar } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst { titlePlaceholder, hasFixedToolbar: _hasFixedToolbar } =\n\t\t\tgetSettings();\n\n\t\treturn {\n\t\t\tplaceholder: titlePlaceholder,\n\t\t\thasFixedToolbar: _hasFixedToolbar,\n\t\t};\n\t}, [] );\n\n\tconst [ isSelected, setIsSelected ] = useState( false );\n\n\tconst { ref: focusRef } = usePostTitleFocus( forwardedRef );\n\n\tconst { title, setTitle: onUpdate } = usePostTitle();\n\n\tconst [ selection, setSelection ] = useState( {} );\n\n\tconst { clearSelectedBlock, insertBlocks, insertDefaultBlock } =\n\t\tuseDispatch( blockEditorStore );\n\n\tfunction onChange( value ) {\n\t\tonUpdate( value.replace( REGEXP_NEWLINES, ' ' ) );\n\t}\n\n\tfunction onInsertBlockAfter( blocks ) {\n\t\tinsertBlocks( blocks, 0 );\n\t}\n\n\tfunction onSelect() {\n\t\tsetIsSelected( true );\n\t\tclearSelectedBlock();\n\t}\n\n\tfunction onUnselect() {\n\t\tsetIsSelected( false );\n\t\tsetSelection( {} );\n\t}\n\n\tfunction onEnterPress() {\n\t\tinsertDefaultBlock( undefined, undefined, 0 );\n\t}\n\n\tfunction onKeyDown( event ) {\n\t\tif ( event.keyCode === ENTER ) {\n\t\t\tevent.preventDefault();\n\t\t\tonEnterPress();\n\t\t}\n\t}\n\n\tfunction onPaste( event ) {\n\t\tconst clipboardData = event.clipboardData;\n\n\t\tlet plainText = '';\n\t\tlet html = '';\n\n\t\t// IE11 only supports `Text` as an argument for `getData` and will\n\t\t// otherwise throw an invalid argument error, so we try the standard\n\t\t// arguments first, then fallback to `Text` if they fail.\n\t\ttry {\n\t\t\tplainText = clipboardData.getData( 'text/plain' );\n\t\t\thtml = clipboardData.getData( 'text/html' );\n\t\t} catch ( error1 ) {\n\t\t\ttry {\n\t\t\t\thtml = clipboardData.getData( 'Text' );\n\t\t\t} catch ( error2 ) {\n\t\t\t\t// Some browsers like UC Browser paste plain text by default and\n\t\t\t\t// don't support clipboardData at all, so allow default\n\t\t\t\t// behaviour.\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// Allows us to ask for this information when we get a report.\n\t\twindow.console.log( 'Received HTML:\\n\\n', html );\n\t\twindow.console.log( 'Received plain text:\\n\\n', plainText );\n\n\t\tconst content = pasteHandler( {\n\t\t\tHTML: html,\n\t\t\tplainText,\n\t\t} );\n\n\t\tevent.preventDefault();\n\n\t\tif ( ! content.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( typeof content !== 'string' ) {\n\t\t\tconst [ firstBlock ] = content;\n\n\t\t\tif (\n\t\t\t\t! title &&\n\t\t\t\t( firstBlock.name === 'core/heading' ||\n\t\t\t\t\tfirstBlock.name === 'core/paragraph' )\n\t\t\t) {\n\t\t\t\t// Strip HTML to avoid unwanted HTML being added to the title.\n\t\t\t\t// In the majority of cases it is assumed that HTML in the title\n\t\t\t\t// is undesirable.\n\t\t\t\tconst contentNoHTML = stripHTML(\n\t\t\t\t\tfirstBlock.attributes.content\n\t\t\t\t);\n\t\t\t\tonUpdate( contentNoHTML );\n\t\t\t\tonInsertBlockAfter( content.slice( 1 ) );\n\t\t\t} else {\n\t\t\t\tonInsertBlockAfter( content );\n\t\t\t}\n\t\t} else {\n\t\t\tconst value = {\n\t\t\t\t...create( { html: title } ),\n\t\t\t\t...selection,\n\t\t\t};\n\n\t\t\t// Strip HTML to avoid unwanted HTML being added to the title.\n\t\t\t// In the majority of cases it is assumed that HTML in the title\n\t\t\t// is undesirable.\n\t\t\tconst contentNoHTML = stripHTML( content );\n\n\t\t\tconst newValue = insert( value, create( { html: contentNoHTML } ) );\n\t\t\tonUpdate( toHTMLString( { value: newValue } ) );\n\t\t\tsetSelection( {\n\t\t\t\tstart: newValue.start,\n\t\t\t\tend: newValue.end,\n\t\t\t} );\n\t\t}\n\t}\n\n\tconst decodedPlaceholder =\n\t\tdecodeEntities( placeholder ) || __( 'Add title' );\n\n\tconst { ref: richTextRef } = useRichText( {\n\t\tvalue: title,\n\t\tonChange,\n\t\tplaceholder: decodedPlaceholder,\n\t\tselectionStart: selection.start,\n\t\tselectionEnd: selection.end,\n\t\tonSelectionChange( newStart, newEnd ) {\n\t\t\tsetSelection( ( sel ) => {\n\t\t\t\tconst { start, end } = sel;\n\t\t\t\tif ( start === newStart && end === newEnd ) {\n\t\t\t\t\treturn sel;\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tstart: newStart,\n\t\t\t\t\tend: newEnd,\n\t\t\t\t};\n\t\t\t} );\n\t\t},\n\t\t__unstableDisableFormats: false,\n\t} );\n\n\t// The wp-block className is important for editor styles.\n\t// This same block is used in both the visual and the code editor.\n\tconst className = clsx( DEFAULT_CLASSNAMES, {\n\t\t'is-selected': isSelected,\n\t\t'has-fixed-toolbar': hasFixedToolbar,\n\t} );\n\n\treturn (\n\t\t/* eslint-disable jsx-a11y/heading-has-content, jsx-a11y/no-noninteractive-element-to-interactive-role */\n\t\t<PostTypeSupportCheck supportKeys=\"title\">\n\t\t\t<h1\n\t\t\t\tref={ useMergeRefs( [ richTextRef, focusRef ] ) }\n\t\t\t\tcontentEditable\n\t\t\t\tclassName={ className }\n\t\t\t\taria-label={ decodedPlaceholder }\n\t\t\t\trole=\"textbox\"\n\t\t\t\taria-multiline=\"true\"\n\t\t\t\tonFocus={ onSelect }\n\t\t\t\tonBlur={ onUnselect }\n\t\t\t\tonKeyDown={ onKeyDown }\n\t\t\t\tonKeyPress={ onUnselect }\n\t\t\t\tonPaste={ onPaste }\n\t\t\t/>\n\t\t</PostTypeSupportCheck>\n\t\t/* eslint-enable jsx-a11y/heading-has-content, jsx-a11y/no-noninteractive-element-to-interactive-role */\n\t);\n}\n\nexport default forwardRef( PostTitle );\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAA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,CAAG,CAAG;MACjDyE,eAAe;MACfR,SAAS,EAAGA,SAAW;MACvB,cAAaZ,kBAAoB;MACjCqB,IAAI,EAAC,SAAS;MACd,kBAAe,MAAM;MACrBC,OAAO,EAAGzD,QAAU;MACpB0D,MAAM,EAAGzD,UAAY;MACrBG,SAAS,EAAGA,SAAW;MACvBuD,UAAU,EAAG1D,UAAY;MACzBQ,OAAO,EAAGA;IAAS,CACnB,CACoB;IACtB;EAAA;AAEF;AAAC,IAAAmD,QAAA,GAAAC,OAAA,CAAAT,OAAA,GAEc,IAAAU,mBAAU,EAAE/F,SAAU,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_element","_htmlEntities","_data","_blockEditor","_keycodes","_blocks","_richText","_compose","_dom","_constants","_usePostTitleFocus","_usePostTitle","_postTypeSupportCheck","_jsxRuntime","PostTitle","_","forwardedRef","placeholder","hasFixedToolbar","useSelect","select","getSettings","blockEditorStore","titlePlaceholder","_hasFixedToolbar","isSelected","setIsSelected","useState","ref","focusRef","usePostTitleFocus","title","setTitle","onUpdate","usePostTitle","selection","setSelection","clearSelectedBlock","insertBlocks","insertDefaultBlock","useDispatch","onChange","value","replace","REGEXP_NEWLINES","onInsertBlockAfter","blocks","onSelect","onUnselect","onEnterPress","undefined","onKeyDown","event","keyCode","ENTER","preventDefault","onPaste","clipboardData","plainText","html","getData","error1","error2","window","console","log","content","pasteHandler","HTML","length","firstBlock","name","contentNoHTML","stripHTML","attributes","slice","create","newValue","insert","toHTMLString","start","end","decodedPlaceholder","decodeEntities","__","richTextRef","useRichText","selectionStart","selectionEnd","onSelectionChange","newStart","newEnd","sel","__unstableDisableFormats","className","clsx","DEFAULT_CLASSNAMES","jsx","default","supportKeys","children","useMergeRefs","contentEditable","role","onFocus","onBlur","onKeyPress","_default","exports","forwardRef"],"sources":["@wordpress/editor/src/components/post-title/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { forwardRef, useState } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { ENTER } from '@wordpress/keycodes';\nimport { pasteHandler } from '@wordpress/blocks';\nimport {\n\t__unstableUseRichText as useRichText,\n\tcreate,\n\ttoHTMLString,\n\tinsert,\n} from '@wordpress/rich-text';\nimport { useMergeRefs } from '@wordpress/compose';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport { DEFAULT_CLASSNAMES, REGEXP_NEWLINES } from './constants';\nimport usePostTitleFocus from './use-post-title-focus';\nimport usePostTitle from './use-post-title';\nimport PostTypeSupportCheck from '../post-type-support-check';\n\nfunction PostTitle( _, forwardedRef ) {\n\tconst { placeholder, hasFixedToolbar } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst { titlePlaceholder, hasFixedToolbar: _hasFixedToolbar } =\n\t\t\tgetSettings();\n\n\t\treturn {\n\t\t\tplaceholder: titlePlaceholder,\n\t\t\thasFixedToolbar: _hasFixedToolbar,\n\t\t};\n\t}, [] );\n\n\tconst [ isSelected, setIsSelected ] = useState( false );\n\n\tconst { ref: focusRef } = usePostTitleFocus( forwardedRef );\n\n\tconst { title, setTitle: onUpdate } = usePostTitle();\n\n\tconst [ selection, setSelection ] = useState( {} );\n\n\tconst { clearSelectedBlock, insertBlocks, insertDefaultBlock } =\n\t\tuseDispatch( blockEditorStore );\n\n\tfunction onChange( value ) {\n\t\tonUpdate( value.replace( REGEXP_NEWLINES, ' ' ) );\n\t}\n\n\tfunction onInsertBlockAfter( blocks ) {\n\t\tinsertBlocks( blocks, 0 );\n\t}\n\n\tfunction onSelect() {\n\t\tsetIsSelected( true );\n\t\tclearSelectedBlock();\n\t}\n\n\tfunction onUnselect() {\n\t\tsetIsSelected( false );\n\t\tsetSelection( {} );\n\t}\n\n\tfunction onEnterPress() {\n\t\tinsertDefaultBlock( undefined, undefined, 0 );\n\t}\n\n\tfunction onKeyDown( event ) {\n\t\tif ( event.keyCode === ENTER ) {\n\t\t\tevent.preventDefault();\n\t\t\tonEnterPress();\n\t\t}\n\t}\n\n\tfunction onPaste( event ) {\n\t\tconst clipboardData = event.clipboardData;\n\n\t\tlet plainText = '';\n\t\tlet html = '';\n\n\t\t// IE11 only supports `Text` as an argument for `getData` and will\n\t\t// otherwise throw an invalid argument error, so we try the standard\n\t\t// arguments first, then fallback to `Text` if they fail.\n\t\ttry {\n\t\t\tplainText = clipboardData.getData( 'text/plain' );\n\t\t\thtml = clipboardData.getData( 'text/html' );\n\t\t} catch ( error1 ) {\n\t\t\ttry {\n\t\t\t\thtml = clipboardData.getData( 'Text' );\n\t\t\t} catch ( error2 ) {\n\t\t\t\t// Some browsers like UC Browser paste plain text by default and\n\t\t\t\t// don't support clipboardData at all, so allow default\n\t\t\t\t// behaviour.\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// Allows us to ask for this information when we get a report.\n\t\twindow.console.log( 'Received HTML:\\n\\n', html );\n\t\twindow.console.log( 'Received plain text:\\n\\n', plainText );\n\n\t\tconst content = pasteHandler( {\n\t\t\tHTML: html,\n\t\t\tplainText,\n\t\t} );\n\n\t\tevent.preventDefault();\n\n\t\tif ( ! content.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( typeof content !== 'string' ) {\n\t\t\tconst [ firstBlock ] = content;\n\n\t\t\tif (\n\t\t\t\t! title &&\n\t\t\t\t( firstBlock.name === 'core/heading' ||\n\t\t\t\t\tfirstBlock.name === 'core/paragraph' )\n\t\t\t) {\n\t\t\t\t// Strip HTML to avoid unwanted HTML being added to the title.\n\t\t\t\t// In the majority of cases it is assumed that HTML in the title\n\t\t\t\t// is undesirable.\n\t\t\t\tconst contentNoHTML = stripHTML(\n\t\t\t\t\tfirstBlock.attributes.content\n\t\t\t\t);\n\t\t\t\tonUpdate( contentNoHTML );\n\t\t\t\tonInsertBlockAfter( content.slice( 1 ) );\n\t\t\t} else {\n\t\t\t\tonInsertBlockAfter( content );\n\t\t\t}\n\t\t} else {\n\t\t\tconst value = {\n\t\t\t\t...create( { html: title } ),\n\t\t\t\t...selection,\n\t\t\t};\n\n\t\t\t// Strip HTML to avoid unwanted HTML being added to the title.\n\t\t\t// In the majority of cases it is assumed that HTML in the title\n\t\t\t// is undesirable.\n\t\t\tconst contentNoHTML = stripHTML( content );\n\n\t\t\tconst newValue = insert( value, create( { html: contentNoHTML } ) );\n\t\t\tonUpdate( toHTMLString( { value: newValue } ) );\n\t\t\tsetSelection( {\n\t\t\t\tstart: newValue.start,\n\t\t\t\tend: newValue.end,\n\t\t\t} );\n\t\t}\n\t}\n\n\tconst decodedPlaceholder =\n\t\tdecodeEntities( placeholder ) || __( 'Add title' );\n\n\tconst { ref: richTextRef } = useRichText( {\n\t\tvalue: title,\n\t\tonChange,\n\t\tplaceholder: decodedPlaceholder,\n\t\tselectionStart: selection.start,\n\t\tselectionEnd: selection.end,\n\t\tonSelectionChange( newStart, newEnd ) {\n\t\t\tsetSelection( ( sel ) => {\n\t\t\t\tconst { start, end } = sel;\n\t\t\t\tif ( start === newStart && end === newEnd ) {\n\t\t\t\t\treturn sel;\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tstart: newStart,\n\t\t\t\t\tend: newEnd,\n\t\t\t\t};\n\t\t\t} );\n\t\t},\n\t\t__unstableDisableFormats: false,\n\t} );\n\n\t// The wp-block className is important for editor styles.\n\t// This same block is used in both the visual and the code editor.\n\tconst className = clsx( DEFAULT_CLASSNAMES, {\n\t\t'is-selected': isSelected,\n\t\t'has-fixed-toolbar': hasFixedToolbar,\n\t} );\n\n\treturn (\n\t\t/* eslint-disable jsx-a11y/heading-has-content, jsx-a11y/no-noninteractive-element-to-interactive-role */\n\t\t<PostTypeSupportCheck supportKeys=\"title\">\n\t\t\t<h1\n\t\t\t\tref={ useMergeRefs( [ richTextRef, focusRef ] ) }\n\t\t\t\tcontentEditable\n\t\t\t\tclassName={ className }\n\t\t\t\taria-label={ decodedPlaceholder }\n\t\t\t\trole=\"textbox\"\n\t\t\t\taria-multiline=\"true\"\n\t\t\t\tonFocus={ onSelect }\n\t\t\t\tonBlur={ onUnselect }\n\t\t\t\tonKeyDown={ onKeyDown }\n\t\t\t\tonKeyPress={ onUnselect }\n\t\t\t\tonPaste={ onPaste }\n\t\t\t/>\n\t\t</PostTypeSupportCheck>\n\t\t/* eslint-enable jsx-a11y/heading-has-content, jsx-a11y/no-noninteractive-element-to-interactive-role */\n\t);\n}\n\n/**\n * Renders the `PostTitle` component.\n *\n * @param {Object} _ Unused parameter.\n * @param {Element} forwardedRef Forwarded ref for the component.\n *\n * @return {Component} The rendered PostTitle component.\n */\nexport default forwardRef( PostTitle );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAIA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,SAAA,GAAAR,OAAA;AAMA,IAAAS,QAAA,GAAAT,OAAA;AACA,IAAAU,IAAA,GAAAV,OAAA;AAKA,IAAAW,UAAA,GAAAX,OAAA;AACA,IAAAY,kBAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,IAAAa,aAAA,GAAAd,sBAAA,CAAAC,OAAA;AACA,IAAAc,qBAAA,GAAAf,sBAAA,CAAAC,OAAA;AAA8D,IAAAe,WAAA,GAAAf,OAAA;AA7B9D;AACA;AACA;;AAEA;AACA;AACA;;AAiBA;AACA;AACA;;AAMA,SAASgB,SAASA,CAAEC,CAAC,EAAEC,YAAY,EAAG;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8
|
-
|
|
8
|
+
exports.insertContentWithTitle = insertContentWithTitle;
|
|
9
9
|
var _reactNative = require("react-native");
|
|
10
10
|
var _element = require("@wordpress/element");
|
|
11
11
|
var _richText = require("@wordpress/rich-text");
|
|
@@ -19,6 +19,7 @@ var _blockEditor = require("@wordpress/block-editor");
|
|
|
19
19
|
var _editor = require("@wordpress/editor");
|
|
20
20
|
var _dom = require("@wordpress/dom");
|
|
21
21
|
var _style = _interopRequireDefault(require("./style.scss"));
|
|
22
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
22
23
|
/**
|
|
23
24
|
* External dependencies
|
|
24
25
|
*/
|
|
@@ -27,10 +28,58 @@ var _style = _interopRequireDefault(require("./style.scss"));
|
|
|
27
28
|
* WordPress dependencies
|
|
28
29
|
*/
|
|
29
30
|
|
|
31
|
+
/** @typedef {import('./types').RichTextValue} RichTextValue */
|
|
32
|
+
|
|
30
33
|
/**
|
|
31
34
|
* Internal dependencies
|
|
32
35
|
*/
|
|
33
36
|
|
|
37
|
+
/**
|
|
38
|
+
* Inserts content with title
|
|
39
|
+
*
|
|
40
|
+
* This function processes the given content and title, updating the title
|
|
41
|
+
* and content based on certain conditions. If the content is an array of
|
|
42
|
+
* blocks, it will check the first block for a heading or paragraph to use
|
|
43
|
+
* as the title. If the content is a string, it will strip HTML and update
|
|
44
|
+
* the title and content accordingly.
|
|
45
|
+
*
|
|
46
|
+
* @param {string} title The post title.
|
|
47
|
+
* @param {Array | string} content The content to be processed. It can be an array of blocks or a string.
|
|
48
|
+
* @param {Function} onUpdateTitle Callback function to update the title.
|
|
49
|
+
* @param {Function} onUpdateContent Callback function to update the content.
|
|
50
|
+
* @param {RichTextValue} value The initial value object, default is an object with empty text.
|
|
51
|
+
*/
|
|
52
|
+
function insertContentWithTitle(title, content, onUpdateTitle, onUpdateContent, value = (0, _richText.create)({
|
|
53
|
+
text: ''
|
|
54
|
+
})) {
|
|
55
|
+
if (!content.length) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
if (typeof content !== 'string') {
|
|
59
|
+
const [firstBlock] = content;
|
|
60
|
+
if (!title && (firstBlock.name === 'core/heading' || firstBlock.name === 'core/paragraph')) {
|
|
61
|
+
// Strip HTML to avoid unwanted HTML being added to the title.
|
|
62
|
+
// In the majority of cases it is assumed that HTML in the title
|
|
63
|
+
// is undesirable.
|
|
64
|
+
const contentNoHTML = (0, _dom.__unstableStripHTML)(firstBlock.attributes.content);
|
|
65
|
+
onUpdateTitle(contentNoHTML);
|
|
66
|
+
onUpdateContent(content.slice(1));
|
|
67
|
+
} else {
|
|
68
|
+
onUpdateContent(content);
|
|
69
|
+
}
|
|
70
|
+
} else {
|
|
71
|
+
// Strip HTML to avoid unwanted HTML being added to the title.
|
|
72
|
+
// In the majority of cases it is assumed that HTML in the title
|
|
73
|
+
// is undesirable.
|
|
74
|
+
const contentNoHTML = (0, _dom.__unstableStripHTML)(content);
|
|
75
|
+
const newValue = (0, _richText.insert)(value, (0, _richText.create)({
|
|
76
|
+
html: contentNoHTML
|
|
77
|
+
}));
|
|
78
|
+
onUpdateTitle((0, _richText.toHTMLString)({
|
|
79
|
+
value: newValue
|
|
80
|
+
}));
|
|
81
|
+
}
|
|
82
|
+
}
|
|
34
83
|
class PostTitle extends _element.Component {
|
|
35
84
|
constructor(props) {
|
|
36
85
|
super(props);
|
|
@@ -64,40 +113,14 @@ class PostTitle extends _element.Component {
|
|
|
64
113
|
}) {
|
|
65
114
|
const {
|
|
66
115
|
title,
|
|
67
|
-
onInsertBlockAfter,
|
|
116
|
+
onInsertBlockAfter: onInsertBlocks,
|
|
68
117
|
onUpdate
|
|
69
118
|
} = this.props;
|
|
70
119
|
const content = (0, _blocks.pasteHandler)({
|
|
71
120
|
HTML: html,
|
|
72
121
|
plainText
|
|
73
122
|
});
|
|
74
|
-
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
if (typeof content !== 'string') {
|
|
78
|
-
const [firstBlock] = content;
|
|
79
|
-
if (!title && (firstBlock.name === 'core/heading' || firstBlock.name === 'core/paragraph')) {
|
|
80
|
-
// Strip HTML to avoid unwanted HTML being added to the title.
|
|
81
|
-
// In the majority of cases it is assumed that HTML in the title
|
|
82
|
-
// is undesirable.
|
|
83
|
-
const contentNoHTML = (0, _dom.__unstableStripHTML)(firstBlock.attributes.content);
|
|
84
|
-
onUpdate(contentNoHTML);
|
|
85
|
-
onInsertBlockAfter(content.slice(1));
|
|
86
|
-
} else {
|
|
87
|
-
onInsertBlockAfter(content);
|
|
88
|
-
}
|
|
89
|
-
} else {
|
|
90
|
-
// Strip HTML to avoid unwanted HTML being added to the title.
|
|
91
|
-
// In the majority of cases it is assumed that HTML in the title
|
|
92
|
-
// is undesirable.
|
|
93
|
-
const contentNoHTML = (0, _dom.__unstableStripHTML)(content);
|
|
94
|
-
const newValue = (0, _richText.insert)(value, (0, _richText.create)({
|
|
95
|
-
html: contentNoHTML
|
|
96
|
-
}));
|
|
97
|
-
onUpdate((0, _richText.toHTMLString)({
|
|
98
|
-
value: newValue
|
|
99
|
-
}));
|
|
100
|
-
}
|
|
123
|
+
insertContentWithTitle(title, content, onUpdate, onInsertBlocks, value);
|
|
101
124
|
}
|
|
102
125
|
setRef(richText) {
|
|
103
126
|
this.richTextRef = richText;
|
|
@@ -132,40 +155,41 @@ class PostTitle extends _element.Component {
|
|
|
132
155
|
placeholderColor: globalStyles.text
|
|
133
156
|
})
|
|
134
157
|
};
|
|
135
|
-
return (0,
|
|
158
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
136
159
|
testID: "post-title",
|
|
137
160
|
style: [_style.default.titleContainer, borderStyle, {
|
|
138
161
|
borderColor
|
|
139
162
|
}, isDimmed && _style.default.dimmed],
|
|
140
163
|
accessible: !this.props.isSelected,
|
|
141
164
|
accessibilityLabel: this.getTitle(title, postType),
|
|
142
|
-
accessibilityHint: (0, _i18n.__)('Updates the title.')
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
165
|
+
accessibilityHint: (0, _i18n.__)('Updates the title.'),
|
|
166
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.RichText.Raw, {
|
|
167
|
+
ref: this.setRef,
|
|
168
|
+
accessibilityLabel: this.getTitle(title, postType),
|
|
169
|
+
tagName: "p",
|
|
170
|
+
tagsToEliminate: ['strong'],
|
|
171
|
+
unstableOnFocus: this.props.onSelect,
|
|
172
|
+
onBlur: this.props.onBlur // Always assign onBlur as a props.
|
|
173
|
+
,
|
|
174
|
+
style: titleStyles,
|
|
175
|
+
styles: _style.default,
|
|
176
|
+
fontSize: 24,
|
|
177
|
+
lineHeight: 1,
|
|
178
|
+
fontWeight: "bold",
|
|
179
|
+
deleteEnter: true,
|
|
180
|
+
onChange: value => {
|
|
181
|
+
this.props.onUpdate(value);
|
|
182
|
+
},
|
|
183
|
+
onPaste: this.onPaste,
|
|
184
|
+
placeholder: decodedPlaceholder,
|
|
185
|
+
value: title,
|
|
186
|
+
onSelectionChange: () => {},
|
|
187
|
+
onEnter: this.props.onEnterPress,
|
|
188
|
+
disableEditingMenu: true,
|
|
189
|
+
__unstableIsSelected: this.props.isSelected,
|
|
190
|
+
__unstableOnCreateUndoLevel: () => {}
|
|
191
|
+
})
|
|
192
|
+
});
|
|
169
193
|
}
|
|
170
194
|
}
|
|
171
195
|
var _default = exports.default = (0, _compose.compose)((0, _data.withSelect)(select => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_element","_richText","_htmlEntities","_data","_components","_compose","_i18n","_blocks","_blockEditor","_editor","_dom","_style","_interopRequireDefault","PostTitle","Component","constructor","props","setRef","bind","onPaste","componentDidUpdate","prevProps","isSelected","isAnyBlockSelected","richTextRef","blur","onUnselect","componentDidMount","innerRef","handleFocusOutside","focus","onSelect","value","plainText","html","title","onInsertBlockAfter","onUpdate","content","pasteHandler","HTML","length","firstBlock","name","contentNoHTML","stripHTML","attributes","slice","newValue","insert","create","toHTMLString","richText","getTitle","postType","__","sprintf","render","placeholder","style","focusedBorderColor","borderStyle","isDimmed","globalStyles","decodedPlaceholder","decodeEntities","borderColor","titleStyles","text","color","placeholderColor","_react","createElement","View","testID","styles","titleContainer","dimmed","accessible","accessibilityLabel","accessibilityHint","RichText","Raw","ref","tagName","tagsToEliminate","unstableOnFocus","onBlur","fontSize","lineHeight","fontWeight","deleteEnter","onChange","onSelectionChange","onEnter","onEnterPress","disableEditingMenu","__unstableIsSelected","__unstableOnCreateUndoLevel","_default","exports","default","compose","withSelect","select","isPostTitleSelected","getEditedPostAttribute","editorStore","getSelectedBlockClientId","getBlockRootClientId","getSettings","blockEditorStore","selectedId","selectionIsNested","__experimentalGlobalStylesBaseStyles","withDispatch","dispatch","undo","redo","togglePostTitleSelection","editPost","clearSelectedBlock","insertDefaultBlock","insertBlocks","undefined","onUndo","onRedo","blocks","withInstanceId","withFocusOutside"],"sources":["@wordpress/editor/src/components/post-title/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { create, toHTMLString, insert } from '@wordpress/rich-text';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { withFocusOutside } from '@wordpress/components';\nimport { withInstanceId, compose } from '@wordpress/compose';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { pasteHandler } from '@wordpress/blocks';\nimport { store as blockEditorStore, RichText } from '@wordpress/block-editor';\nimport { store as editorStore } from '@wordpress/editor';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\n\nclass PostTitle extends Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\n\t\tthis.setRef = this.setRef.bind( this );\n\t\tthis.onPaste = this.onPaste.bind( this );\n\t}\n\tcomponentDidUpdate( prevProps ) {\n\t\t// Unselect if any other block is selected and blur the RichText.\n\t\tif (\n\t\t\tthis.props.isSelected &&\n\t\t\t! prevProps.isAnyBlockSelected &&\n\t\t\tthis.props.isAnyBlockSelected\n\t\t) {\n\t\t\tif ( this.richTextRef ) {\n\t\t\t\tthis.richTextRef.blur();\n\t\t\t}\n\t\t\tthis.props.onUnselect();\n\t\t}\n\t}\n\n\tcomponentDidMount() {\n\t\tif ( this.props.innerRef ) {\n\t\t\tthis.props.innerRef( this );\n\t\t}\n\t}\n\n\thandleFocusOutside() {\n\t\tthis.props.onUnselect();\n\t}\n\n\tfocus() {\n\t\tthis.props.onSelect();\n\t}\n\n\tonPaste( { value, plainText, html } ) {\n\t\tconst { title, onInsertBlockAfter, onUpdate } = this.props;\n\n\t\tconst content = pasteHandler( {\n\t\t\tHTML: html,\n\t\t\tplainText,\n\t\t} );\n\n\t\tif ( ! content.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( typeof content !== 'string' ) {\n\t\t\tconst [ firstBlock ] = content;\n\n\t\t\tif (\n\t\t\t\t! title &&\n\t\t\t\t( firstBlock.name === 'core/heading' ||\n\t\t\t\t\tfirstBlock.name === 'core/paragraph' )\n\t\t\t) {\n\t\t\t\t// Strip HTML to avoid unwanted HTML being added to the title.\n\t\t\t\t// In the majority of cases it is assumed that HTML in the title\n\t\t\t\t// is undesirable.\n\t\t\t\tconst contentNoHTML = stripHTML(\n\t\t\t\t\tfirstBlock.attributes.content\n\t\t\t\t);\n\t\t\t\tonUpdate( contentNoHTML );\n\t\t\t\tonInsertBlockAfter( content.slice( 1 ) );\n\t\t\t} else {\n\t\t\t\tonInsertBlockAfter( content );\n\t\t\t}\n\t\t} else {\n\t\t\t// Strip HTML to avoid unwanted HTML being added to the title.\n\t\t\t// In the majority of cases it is assumed that HTML in the title\n\t\t\t// is undesirable.\n\t\t\tconst contentNoHTML = stripHTML( content );\n\n\t\t\tconst newValue = insert( value, create( { html: contentNoHTML } ) );\n\t\t\tonUpdate( toHTMLString( { value: newValue } ) );\n\t\t}\n\t}\n\n\tsetRef( richText ) {\n\t\tthis.richTextRef = richText;\n\t}\n\n\tgetTitle( title, postType ) {\n\t\tif ( 'page' === postType ) {\n\t\t\treturn ! title\n\t\t\t\t? /* translators: accessibility text. empty page title. */\n\t\t\t\t __( 'Page title. Empty' )\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t/* translators: accessibility text. %s: text content of the page title. */\n\t\t\t\t\t\t__( 'Page title. %s' ),\n\t\t\t\t\t\ttitle\n\t\t\t\t );\n\t\t}\n\n\t\treturn ! title\n\t\t\t? /* translators: accessibility text. empty post title. */\n\t\t\t __( 'Post title. Empty' )\n\t\t\t: sprintf(\n\t\t\t\t\t/* translators: accessibility text. %s: text content of the post title. */\n\t\t\t\t\t__( 'Post title. %s' ),\n\t\t\t\t\ttitle\n\t\t\t );\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tplaceholder,\n\t\t\tstyle,\n\t\t\ttitle,\n\t\t\tfocusedBorderColor,\n\t\t\tborderStyle,\n\t\t\tisDimmed,\n\t\t\tpostType,\n\t\t\tglobalStyles,\n\t\t} = this.props;\n\n\t\tconst decodedPlaceholder = decodeEntities( placeholder );\n\t\tconst borderColor = this.props.isSelected\n\t\t\t? focusedBorderColor\n\t\t\t: 'transparent';\n\t\tconst titleStyles = {\n\t\t\t...style,\n\t\t\t...( globalStyles?.text && {\n\t\t\t\tcolor: globalStyles.text,\n\t\t\t\tplaceholderColor: globalStyles.text,\n\t\t\t} ),\n\t\t};\n\n\t\treturn (\n\t\t\t<View\n\t\t\t\ttestID=\"post-title\"\n\t\t\t\tstyle={ [\n\t\t\t\t\tstyles.titleContainer,\n\t\t\t\t\tborderStyle,\n\t\t\t\t\t{ borderColor },\n\t\t\t\t\tisDimmed && styles.dimmed,\n\t\t\t\t] }\n\t\t\t\taccessible={ ! this.props.isSelected }\n\t\t\t\taccessibilityLabel={ this.getTitle( title, postType ) }\n\t\t\t\taccessibilityHint={ __( 'Updates the title.' ) }\n\t\t\t>\n\t\t\t\t<RichText.Raw\n\t\t\t\t\tref={ this.setRef }\n\t\t\t\t\taccessibilityLabel={ this.getTitle( title, postType ) }\n\t\t\t\t\ttagName={ 'p' }\n\t\t\t\t\ttagsToEliminate={ [ 'strong' ] }\n\t\t\t\t\tunstableOnFocus={ this.props.onSelect }\n\t\t\t\t\tonBlur={ this.props.onBlur } // Always assign onBlur as a props.\n\t\t\t\t\tstyle={ titleStyles }\n\t\t\t\t\tstyles={ styles }\n\t\t\t\t\tfontSize={ 24 }\n\t\t\t\t\tlineHeight={ 1 }\n\t\t\t\t\tfontWeight={ 'bold' }\n\t\t\t\t\tdeleteEnter\n\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\tthis.props.onUpdate( value );\n\t\t\t\t\t} }\n\t\t\t\t\tonPaste={ this.onPaste }\n\t\t\t\t\tplaceholder={ decodedPlaceholder }\n\t\t\t\t\tvalue={ title }\n\t\t\t\t\tonSelectionChange={ () => {} }\n\t\t\t\t\tonEnter={ this.props.onEnterPress }\n\t\t\t\t\tdisableEditingMenu\n\t\t\t\t\t__unstableIsSelected={ this.props.isSelected }\n\t\t\t\t\t__unstableOnCreateUndoLevel={ () => {} }\n\t\t\t\t/>\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nexport default compose(\n\twithSelect( ( select ) => {\n\t\tconst { isPostTitleSelected, getEditedPostAttribute } =\n\t\t\tselect( editorStore );\n\t\tconst { getSelectedBlockClientId, getBlockRootClientId, getSettings } =\n\t\t\tselect( blockEditorStore );\n\n\t\tconst selectedId = getSelectedBlockClientId();\n\t\tconst selectionIsNested = !! getBlockRootClientId( selectedId );\n\t\tconst globalStyles =\n\t\t\tgetSettings()?.__experimentalGlobalStylesBaseStyles?.color;\n\n\t\treturn {\n\t\t\tpostType: getEditedPostAttribute( 'type' ),\n\t\t\ttitle: getEditedPostAttribute( 'title' ),\n\t\t\tisAnyBlockSelected: !! selectedId,\n\t\t\tisSelected: isPostTitleSelected(),\n\t\t\tisDimmed: selectionIsNested,\n\t\t\tglobalStyles,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { undo, redo, togglePostTitleSelection, editPost } =\n\t\t\tdispatch( editorStore );\n\n\t\tconst { clearSelectedBlock, insertDefaultBlock, insertBlocks } =\n\t\t\tdispatch( blockEditorStore );\n\n\t\treturn {\n\t\t\tonEnterPress() {\n\t\t\t\tinsertDefaultBlock( undefined, undefined, 0 );\n\t\t\t},\n\t\t\tonUndo: undo,\n\t\t\tonRedo: redo,\n\t\t\tonSelect() {\n\t\t\t\ttogglePostTitleSelection( true );\n\t\t\t\tclearSelectedBlock();\n\t\t\t},\n\t\t\tonUnselect() {\n\t\t\t\ttogglePostTitleSelection( false );\n\t\t\t},\n\t\t\tonUpdate( title ) {\n\t\t\t\teditPost( { title } );\n\t\t\t},\n\t\t\tonInsertBlockAfter( blocks ) {\n\t\t\t\tinsertBlocks( blocks, 0 );\n\t\t\t},\n\t\t};\n\t} ),\n\twithInstanceId,\n\twithFocusOutside\n)( PostTitle );\n"],"mappings":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,YAAA,GAAAT,OAAA;AACA,IAAAU,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components","_compose","_i18n","_blocks","_blockEditor","_editor","_dom","_style","_interopRequireDefault","_jsxRuntime","insertContentWithTitle","title","content","onUpdateTitle","onUpdateContent","value","create","text","length","firstBlock","name","contentNoHTML","stripHTML","attributes","slice","newValue","insert","html","toHTMLString","PostTitle","Component","constructor","props","setRef","bind","onPaste","componentDidUpdate","prevProps","isSelected","isAnyBlockSelected","richTextRef","blur","onUnselect","componentDidMount","innerRef","handleFocusOutside","focus","onSelect","plainText","onInsertBlockAfter","onInsertBlocks","onUpdate","pasteHandler","HTML","richText","getTitle","postType","__","sprintf","render","placeholder","style","focusedBorderColor","borderStyle","isDimmed","globalStyles","decodedPlaceholder","decodeEntities","borderColor","titleStyles","color","placeholderColor","jsx","View","testID","styles","titleContainer","dimmed","accessible","accessibilityLabel","accessibilityHint","children","RichText","Raw","ref","tagName","tagsToEliminate","unstableOnFocus","onBlur","fontSize","lineHeight","fontWeight","deleteEnter","onChange","onSelectionChange","onEnter","onEnterPress","disableEditingMenu","__unstableIsSelected","__unstableOnCreateUndoLevel","_default","exports","default","compose","withSelect","select","isPostTitleSelected","getEditedPostAttribute","editorStore","getSelectedBlockClientId","getBlockRootClientId","getSettings","blockEditorStore","selectedId","selectionIsNested","__experimentalGlobalStylesBaseStyles","withDispatch","dispatch","undo","redo","togglePostTitleSelection","editPost","clearSelectedBlock","insertDefaultBlock","insertBlocks","undefined","onUndo","onRedo","blocks","withInstanceId","withFocusOutside"],"sources":["@wordpress/editor/src/components/post-title/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { create, toHTMLString, insert } from '@wordpress/rich-text';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { withFocusOutside } from '@wordpress/components';\nimport { withInstanceId, compose } from '@wordpress/compose';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { pasteHandler } from '@wordpress/blocks';\nimport { store as blockEditorStore, RichText } from '@wordpress/block-editor';\nimport { store as editorStore } from '@wordpress/editor';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\n\n/** @typedef {import('./types').RichTextValue} RichTextValue */\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\n\n/**\n * Inserts content with title\n *\n * This function processes the given content and title, updating the title\n * and content based on certain conditions. If the content is an array of\n * blocks, it will check the first block for a heading or paragraph to use\n * as the title. If the content is a string, it will strip HTML and update\n * the title and content accordingly.\n *\n * @param {string} title The post title.\n * @param {Array | string} content The content to be processed. It can be an array of blocks or a string.\n * @param {Function} onUpdateTitle Callback function to update the title.\n * @param {Function} onUpdateContent Callback function to update the content.\n * @param {RichTextValue} value The initial value object, default is an object with empty text.\n */\nexport function insertContentWithTitle(\n\ttitle,\n\tcontent,\n\tonUpdateTitle,\n\tonUpdateContent,\n\tvalue = create( { text: '' } )\n) {\n\tif ( ! content.length ) {\n\t\treturn;\n\t}\n\n\tif ( typeof content !== 'string' ) {\n\t\tconst [ firstBlock ] = content;\n\n\t\tif (\n\t\t\t! title &&\n\t\t\t( firstBlock.name === 'core/heading' ||\n\t\t\t\tfirstBlock.name === 'core/paragraph' )\n\t\t) {\n\t\t\t// Strip HTML to avoid unwanted HTML being added to the title.\n\t\t\t// In the majority of cases it is assumed that HTML in the title\n\t\t\t// is undesirable.\n\t\t\tconst contentNoHTML = stripHTML( firstBlock.attributes.content );\n\t\t\tonUpdateTitle( contentNoHTML );\n\t\t\tonUpdateContent( content.slice( 1 ) );\n\t\t} else {\n\t\t\tonUpdateContent( content );\n\t\t}\n\t} else {\n\t\t// Strip HTML to avoid unwanted HTML being added to the title.\n\t\t// In the majority of cases it is assumed that HTML in the title\n\t\t// is undesirable.\n\t\tconst contentNoHTML = stripHTML( content );\n\n\t\tconst newValue = insert( value, create( { html: contentNoHTML } ) );\n\t\tonUpdateTitle( toHTMLString( { value: newValue } ) );\n\t}\n}\n\nclass PostTitle extends Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\n\t\tthis.setRef = this.setRef.bind( this );\n\t\tthis.onPaste = this.onPaste.bind( this );\n\t}\n\tcomponentDidUpdate( prevProps ) {\n\t\t// Unselect if any other block is selected and blur the RichText.\n\t\tif (\n\t\t\tthis.props.isSelected &&\n\t\t\t! prevProps.isAnyBlockSelected &&\n\t\t\tthis.props.isAnyBlockSelected\n\t\t) {\n\t\t\tif ( this.richTextRef ) {\n\t\t\t\tthis.richTextRef.blur();\n\t\t\t}\n\t\t\tthis.props.onUnselect();\n\t\t}\n\t}\n\n\tcomponentDidMount() {\n\t\tif ( this.props.innerRef ) {\n\t\t\tthis.props.innerRef( this );\n\t\t}\n\t}\n\n\thandleFocusOutside() {\n\t\tthis.props.onUnselect();\n\t}\n\n\tfocus() {\n\t\tthis.props.onSelect();\n\t}\n\n\tonPaste( { value, plainText, html } ) {\n\t\tconst {\n\t\t\ttitle,\n\t\t\tonInsertBlockAfter: onInsertBlocks,\n\t\t\tonUpdate,\n\t\t} = this.props;\n\n\t\tconst content = pasteHandler( {\n\t\t\tHTML: html,\n\t\t\tplainText,\n\t\t} );\n\n\t\tinsertContentWithTitle(\n\t\t\ttitle,\n\t\t\tcontent,\n\t\t\tonUpdate,\n\t\t\tonInsertBlocks,\n\t\t\tvalue\n\t\t);\n\t}\n\n\tsetRef( richText ) {\n\t\tthis.richTextRef = richText;\n\t}\n\n\tgetTitle( title, postType ) {\n\t\tif ( 'page' === postType ) {\n\t\t\treturn ! title\n\t\t\t\t? /* translators: accessibility text. empty page title. */\n\t\t\t\t __( 'Page title. Empty' )\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t/* translators: accessibility text. %s: text content of the page title. */\n\t\t\t\t\t\t__( 'Page title. %s' ),\n\t\t\t\t\t\ttitle\n\t\t\t\t );\n\t\t}\n\n\t\treturn ! title\n\t\t\t? /* translators: accessibility text. empty post title. */\n\t\t\t __( 'Post title. Empty' )\n\t\t\t: sprintf(\n\t\t\t\t\t/* translators: accessibility text. %s: text content of the post title. */\n\t\t\t\t\t__( 'Post title. %s' ),\n\t\t\t\t\ttitle\n\t\t\t );\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tplaceholder,\n\t\t\tstyle,\n\t\t\ttitle,\n\t\t\tfocusedBorderColor,\n\t\t\tborderStyle,\n\t\t\tisDimmed,\n\t\t\tpostType,\n\t\t\tglobalStyles,\n\t\t} = this.props;\n\n\t\tconst decodedPlaceholder = decodeEntities( placeholder );\n\t\tconst borderColor = this.props.isSelected\n\t\t\t? focusedBorderColor\n\t\t\t: 'transparent';\n\t\tconst titleStyles = {\n\t\t\t...style,\n\t\t\t...( globalStyles?.text && {\n\t\t\t\tcolor: globalStyles.text,\n\t\t\t\tplaceholderColor: globalStyles.text,\n\t\t\t} ),\n\t\t};\n\n\t\treturn (\n\t\t\t<View\n\t\t\t\ttestID=\"post-title\"\n\t\t\t\tstyle={ [\n\t\t\t\t\tstyles.titleContainer,\n\t\t\t\t\tborderStyle,\n\t\t\t\t\t{ borderColor },\n\t\t\t\t\tisDimmed && styles.dimmed,\n\t\t\t\t] }\n\t\t\t\taccessible={ ! this.props.isSelected }\n\t\t\t\taccessibilityLabel={ this.getTitle( title, postType ) }\n\t\t\t\taccessibilityHint={ __( 'Updates the title.' ) }\n\t\t\t>\n\t\t\t\t<RichText.Raw\n\t\t\t\t\tref={ this.setRef }\n\t\t\t\t\taccessibilityLabel={ this.getTitle( title, postType ) }\n\t\t\t\t\ttagName=\"p\"\n\t\t\t\t\ttagsToEliminate={ [ 'strong' ] }\n\t\t\t\t\tunstableOnFocus={ this.props.onSelect }\n\t\t\t\t\tonBlur={ this.props.onBlur } // Always assign onBlur as a props.\n\t\t\t\t\tstyle={ titleStyles }\n\t\t\t\t\tstyles={ styles }\n\t\t\t\t\tfontSize={ 24 }\n\t\t\t\t\tlineHeight={ 1 }\n\t\t\t\t\tfontWeight=\"bold\"\n\t\t\t\t\tdeleteEnter\n\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\tthis.props.onUpdate( value );\n\t\t\t\t\t} }\n\t\t\t\t\tonPaste={ this.onPaste }\n\t\t\t\t\tplaceholder={ decodedPlaceholder }\n\t\t\t\t\tvalue={ title }\n\t\t\t\t\tonSelectionChange={ () => {} }\n\t\t\t\t\tonEnter={ this.props.onEnterPress }\n\t\t\t\t\tdisableEditingMenu\n\t\t\t\t\t__unstableIsSelected={ this.props.isSelected }\n\t\t\t\t\t__unstableOnCreateUndoLevel={ () => {} }\n\t\t\t\t/>\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nexport default compose(\n\twithSelect( ( select ) => {\n\t\tconst { isPostTitleSelected, getEditedPostAttribute } =\n\t\t\tselect( editorStore );\n\t\tconst { getSelectedBlockClientId, getBlockRootClientId, getSettings } =\n\t\t\tselect( blockEditorStore );\n\n\t\tconst selectedId = getSelectedBlockClientId();\n\t\tconst selectionIsNested = !! getBlockRootClientId( selectedId );\n\t\tconst globalStyles =\n\t\t\tgetSettings()?.__experimentalGlobalStylesBaseStyles?.color;\n\n\t\treturn {\n\t\t\tpostType: getEditedPostAttribute( 'type' ),\n\t\t\ttitle: getEditedPostAttribute( 'title' ),\n\t\t\tisAnyBlockSelected: !! selectedId,\n\t\t\tisSelected: isPostTitleSelected(),\n\t\t\tisDimmed: selectionIsNested,\n\t\t\tglobalStyles,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { undo, redo, togglePostTitleSelection, editPost } =\n\t\t\tdispatch( editorStore );\n\n\t\tconst { clearSelectedBlock, insertDefaultBlock, insertBlocks } =\n\t\t\tdispatch( blockEditorStore );\n\n\t\treturn {\n\t\t\tonEnterPress() {\n\t\t\t\tinsertDefaultBlock( undefined, undefined, 0 );\n\t\t\t},\n\t\t\tonUndo: undo,\n\t\t\tonRedo: redo,\n\t\t\tonSelect() {\n\t\t\t\ttogglePostTitleSelection( true );\n\t\t\t\tclearSelectedBlock();\n\t\t\t},\n\t\t\tonUnselect() {\n\t\t\t\ttogglePostTitleSelection( false );\n\t\t\t},\n\t\t\tonUpdate( title ) {\n\t\t\t\teditPost( { title } );\n\t\t\t},\n\t\t\tonInsertBlockAfter( blocks ) {\n\t\t\t\tinsertBlocks( blocks, 0 );\n\t\t\t},\n\t\t};\n\t} ),\n\twithInstanceId,\n\twithFocusOutside\n)( PostTitle );\n"],"mappings":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,YAAA,GAAAT,OAAA;AACA,IAAAU,OAAA,GAAAV,OAAA;AACA,IAAAW,IAAA,GAAAX,OAAA;AAOA,IAAAY,MAAA,GAAAC,sBAAA,CAAAb,OAAA;AAAkC,IAAAc,WAAA,GAAAd,OAAA;AAzBlC;AACA;AACA;;AAGA;AACA;AACA;;AAaA;;AAEA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASe,sBAAsBA,CACrCC,KAAK,EACLC,OAAO,EACPC,aAAa,EACbC,eAAe,EACfC,KAAK,GAAG,IAAAC,gBAAM,EAAE;EAAEC,IAAI,EAAE;AAAG,CAAE,CAAC,EAC7B;EACD,IAAK,CAAEL,OAAO,CAACM,MAAM,EAAG;IACvB;EACD;EAEA,IAAK,OAAON,OAAO,KAAK,QAAQ,EAAG;IAClC,MAAM,CAAEO,UAAU,CAAE,GAAGP,OAAO;IAE9B,IACC,CAAED,KAAK,KACLQ,UAAU,CAACC,IAAI,KAAK,cAAc,IACnCD,UAAU,CAACC,IAAI,KAAK,gBAAgB,CAAE,EACtC;MACD;MAC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ACD,CAAC;AACF,CAAE,CAAC,EACH,IAAAmD,kBAAY,EAAIC,QAAQ,IAAM;EAC7B,MAAM;IAAEC,IAAI;IAAEC,IAAI;IAAEC,wBAAwB;IAAEC;EAAS,CAAC,GACvDJ,QAAQ,CAAET,aAAY,CAAC;EAExB,MAAM;IAAEc,kBAAkB;IAAEC,kBAAkB;IAAEC;EAAa,CAAC,GAC7DP,QAAQ,CAAEL,kBAAiB,CAAC;EAE7B,OAAO;IACNhB,YAAYA,CAAA,EAAG;MACd2B,kBAAkB,CAAEE,SAAS,EAAEA,SAAS,EAAE,CAAE,CAAC;IAC9C,CAAC;IACDC,MAAM,EAAER,IAAI;IACZS,MAAM,EAAER,IAAI;IACZxE,QAAQA,CAAA,EAAG;MACVyE,wBAAwB,CAAE,IAAK,CAAC;MAChCE,kBAAkB,CAAC,CAAC;IACrB,CAAC;IACDhF,UAAUA,CAAA,EAAG;MACZ8E,wBAAwB,CAAE,KAAM,CAAC;IAClC,CAAC;IACDrE,QAAQA,CAAExC,KAAK,EAAG;MACjB8G,QAAQ,CAAE;QAAE9G;MAAM,CAAE,CAAC;IACtB,CAAC;IACDsC,kBAAkBA,CAAE+E,MAAM,EAAG;MAC5BJ,YAAY,CAAEI,MAAM,EAAE,CAAE,CAAC;IAC1B;EACD,CAAC;AACF,CAAE,CAAC,EACHC,uBAAc,EACdC,4BACD,CAAC,CAAErG,SAAU,CAAC","ignoreList":[]}
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var _react = require("react");
|
|
9
8
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
10
9
|
var _components = require("@wordpress/components");
|
|
11
10
|
var _i18n = require("@wordpress/i18n");
|
|
@@ -16,6 +15,7 @@ var _element = require("@wordpress/element");
|
|
|
16
15
|
var _constants = require("./constants");
|
|
17
16
|
var _usePostTitleFocus = _interopRequireDefault(require("./use-post-title-focus"));
|
|
18
17
|
var _usePostTitle = _interopRequireDefault(require("./use-post-title"));
|
|
18
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
19
|
/**
|
|
20
20
|
* External dependencies
|
|
21
21
|
*/
|
|
@@ -28,7 +28,14 @@ var _usePostTitle = _interopRequireDefault(require("./use-post-title"));
|
|
|
28
28
|
* Internal dependencies
|
|
29
29
|
*/
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Renders a raw post title input field.
|
|
33
|
+
*
|
|
34
|
+
* @param {Object} _ Unused parameter.
|
|
35
|
+
* @param {Element} forwardedRef Reference to the component's DOM node.
|
|
36
|
+
*
|
|
37
|
+
* @return {Component} The rendered component.
|
|
38
|
+
*/function PostTitleRaw(_, forwardedRef) {
|
|
32
39
|
const {
|
|
33
40
|
placeholder,
|
|
34
41
|
hasFixedToolbar
|
|
@@ -71,7 +78,7 @@ function PostTitleRaw(_, forwardedRef) {
|
|
|
71
78
|
'is-raw-text': true
|
|
72
79
|
});
|
|
73
80
|
const decodedPlaceholder = (0, _htmlEntities.decodeEntities)(placeholder) || (0, _i18n.__)('Add title');
|
|
74
|
-
return (0,
|
|
81
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.TextareaControl, {
|
|
75
82
|
ref: focusRef,
|
|
76
83
|
value: title,
|
|
77
84
|
onChange: onChange,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_i18n","_htmlEntities","_data","_blockEditor","_element","_constants","_usePostTitleFocus","_usePostTitle","PostTitleRaw","_","forwardedRef","placeholder","hasFixedToolbar","useSelect","select","getSettings","blockEditorStore","titlePlaceholder","_hasFixedToolbar","isSelected","setIsSelected","useState","title","setTitle","onUpdate","usePostTitle","ref","focusRef","usePostTitleFocus","onChange","value","replace","REGEXP_NEWLINES","onSelect","onUnselect","className","clsx","DEFAULT_CLASSNAMES","decodedPlaceholder","decodeEntities","__","
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_i18n","_htmlEntities","_data","_blockEditor","_element","_constants","_usePostTitleFocus","_usePostTitle","_jsxRuntime","PostTitleRaw","_","forwardedRef","placeholder","hasFixedToolbar","useSelect","select","getSettings","blockEditorStore","titlePlaceholder","_hasFixedToolbar","isSelected","setIsSelected","useState","title","setTitle","onUpdate","usePostTitle","ref","focusRef","usePostTitleFocus","onChange","value","replace","REGEXP_NEWLINES","onSelect","onUnselect","className","clsx","DEFAULT_CLASSNAMES","decodedPlaceholder","decodeEntities","__","jsx","TextareaControl","onFocus","onBlur","label","hideLabelFromVision","autoComplete","dir","rows","__nextHasNoMarginBottom","_default","exports","default","forwardRef"],"sources":["@wordpress/editor/src/components/post-title/post-title-raw.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { TextareaControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { useState, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { DEFAULT_CLASSNAMES, REGEXP_NEWLINES } from './constants';\nimport usePostTitleFocus from './use-post-title-focus';\nimport usePostTitle from './use-post-title';\n\n/**\n * Renders a raw post title input field.\n *\n * @param {Object} _ Unused parameter.\n * @param {Element} forwardedRef Reference to the component's DOM node.\n *\n * @return {Component} The rendered component.\n */\nfunction PostTitleRaw( _, forwardedRef ) {\n\tconst { placeholder, hasFixedToolbar } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst { titlePlaceholder, hasFixedToolbar: _hasFixedToolbar } =\n\t\t\tgetSettings();\n\n\t\treturn {\n\t\t\tplaceholder: titlePlaceholder,\n\t\t\thasFixedToolbar: _hasFixedToolbar,\n\t\t};\n\t}, [] );\n\n\tconst [ isSelected, setIsSelected ] = useState( false );\n\n\tconst { title, setTitle: onUpdate } = usePostTitle();\n\tconst { ref: focusRef } = usePostTitleFocus( forwardedRef );\n\n\tfunction onChange( value ) {\n\t\tonUpdate( value.replace( REGEXP_NEWLINES, ' ' ) );\n\t}\n\n\tfunction onSelect() {\n\t\tsetIsSelected( true );\n\t}\n\n\tfunction onUnselect() {\n\t\tsetIsSelected( false );\n\t}\n\n\t// The wp-block className is important for editor styles.\n\t// This same block is used in both the visual and the code editor.\n\tconst className = clsx( DEFAULT_CLASSNAMES, {\n\t\t'is-selected': isSelected,\n\t\t'has-fixed-toolbar': hasFixedToolbar,\n\t\t'is-raw-text': true,\n\t} );\n\n\tconst decodedPlaceholder =\n\t\tdecodeEntities( placeholder ) || __( 'Add title' );\n\n\treturn (\n\t\t<TextareaControl\n\t\t\tref={ focusRef }\n\t\t\tvalue={ title }\n\t\t\tonChange={ onChange }\n\t\t\tonFocus={ onSelect }\n\t\t\tonBlur={ onUnselect }\n\t\t\tlabel={ placeholder }\n\t\t\tclassName={ className }\n\t\t\tplaceholder={ decodedPlaceholder }\n\t\t\thideLabelFromVision\n\t\t\tautoComplete=\"off\"\n\t\t\tdir=\"auto\"\n\t\t\trows={ 1 }\n\t\t\t__nextHasNoMarginBottom\n\t\t/>\n\t);\n}\n\nexport default forwardRef( PostTitleRaw );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AAKA,IAAAO,UAAA,GAAAP,OAAA;AACA,IAAAQ,kBAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,aAAA,GAAAV,sBAAA,CAAAC,OAAA;AAA4C,IAAAU,WAAA,GAAAV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AY,CAAC,IAAI,IAAA6B,QAAE,EAAE,WAAY,CAAC;EAEnD,oBACC,IAAAjC,WAAA,CAAAkC,GAAA,EAAC3C,WAAA,CAAA4C,eAAe;IACfhB,GAAG,EAAGC,QAAU;IAChBG,KAAK,EAAGR,KAAO;IACfO,QAAQ,EAAGA,QAAU;IACrBc,OAAO,EAAGV,QAAU;IACpBW,MAAM,EAAGV,UAAY;IACrBW,KAAK,EAAGlC,WAAa;IACrBwB,SAAS,EAAGA,SAAW;IACvBxB,WAAW,EAAG2B,kBAAoB;IAClCQ,mBAAmB;IACnBC,YAAY,EAAC,KAAK;IAClBC,GAAG,EAAC,MAAM;IACVC,IAAI,EAAG,CAAG;IACVC,uBAAuB;EAAA,CACvB,CAAC;AAEJ;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc,IAAAC,mBAAU,EAAE9C,YAAa,CAAC","ignoreList":[]}
|
|
@@ -15,6 +15,13 @@ var _store = require("../../store");
|
|
|
15
15
|
* Internal dependencies
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
+
/**
|
|
19
|
+
* Custom hook that manages the focus behavior of the post title input field.
|
|
20
|
+
*
|
|
21
|
+
* @param {Element} forwardedRef - The forwarded ref for the input field.
|
|
22
|
+
*
|
|
23
|
+
* @return {Object} - The ref object.
|
|
24
|
+
*/
|
|
18
25
|
function usePostTitleFocus(forwardedRef) {
|
|
19
26
|
const ref = (0, _element.useRef)();
|
|
20
27
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_data","_store","usePostTitleFocus","forwardedRef","ref","useRef","isCleanNewPost","useSelect","select","_isCleanNewPost","editorStore","useImperativeHandle","focus","current","useEffect","defaultView","ownerDocument","name","parent","document","activeElement","body"],"sources":["@wordpress/editor/src/components/post-title/use-post-title-focus.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useImperativeHandle, useRef } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport default function usePostTitleFocus( forwardedRef ) {\n\tconst ref = useRef();\n\n\tconst { isCleanNewPost } = useSelect( ( select ) => {\n\t\tconst { isCleanNewPost: _isCleanNewPost } = select( editorStore );\n\n\t\treturn {\n\t\t\tisCleanNewPost: _isCleanNewPost(),\n\t\t};\n\t}, [] );\n\n\tuseImperativeHandle( forwardedRef, () => ( {\n\t\tfocus: () => {\n\t\t\tref?.current?.focus();\n\t\t},\n\t} ) );\n\n\tuseEffect( () => {\n\t\tif ( ! ref.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { defaultView } = ref.current.ownerDocument;\n\t\tconst { name, parent } = defaultView;\n\t\tconst ownerDocument =\n\t\t\tname === 'editor-canvas' ? parent.document : defaultView.document;\n\t\tconst { activeElement, body } = ownerDocument;\n\n\t\t// Only autofocus the title when the post is entirely empty. This should\n\t\t// only happen for a new post, which means we focus the title on new\n\t\t// post so the author can start typing right away, without needing to\n\t\t// click anything.\n\t\tif ( isCleanNewPost && ( ! activeElement || body === activeElement ) ) {\n\t\t\tref.current.focus();\n\t\t}\n\t}, [ isCleanNewPost ] );\n\n\treturn { ref };\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;
|
|
1
|
+
{"version":3,"names":["_element","require","_data","_store","usePostTitleFocus","forwardedRef","ref","useRef","isCleanNewPost","useSelect","select","_isCleanNewPost","editorStore","useImperativeHandle","focus","current","useEffect","defaultView","ownerDocument","name","parent","document","activeElement","body"],"sources":["@wordpress/editor/src/components/post-title/use-post-title-focus.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useImperativeHandle, useRef } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Custom hook that manages the focus behavior of the post title input field.\n *\n * @param {Element} forwardedRef - The forwarded ref for the input field.\n *\n * @return {Object} - The ref object.\n */\nexport default function usePostTitleFocus( forwardedRef ) {\n\tconst ref = useRef();\n\n\tconst { isCleanNewPost } = useSelect( ( select ) => {\n\t\tconst { isCleanNewPost: _isCleanNewPost } = select( editorStore );\n\n\t\treturn {\n\t\t\tisCleanNewPost: _isCleanNewPost(),\n\t\t};\n\t}, [] );\n\n\tuseImperativeHandle( forwardedRef, () => ( {\n\t\tfocus: () => {\n\t\t\tref?.current?.focus();\n\t\t},\n\t} ) );\n\n\tuseEffect( () => {\n\t\tif ( ! ref.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { defaultView } = ref.current.ownerDocument;\n\t\tconst { name, parent } = defaultView;\n\t\tconst ownerDocument =\n\t\t\tname === 'editor-canvas' ? parent.document : defaultView.document;\n\t\tconst { activeElement, body } = ownerDocument;\n\n\t\t// Only autofocus the title when the post is entirely empty. This should\n\t\t// only happen for a new post, which means we focus the title on new\n\t\t// post so the author can start typing right away, without needing to\n\t\t// click anything.\n\t\tif ( isCleanNewPost && ( ! activeElement || body === activeElement ) ) {\n\t\t\tref.current.focus();\n\t\t}\n\t}, [ isCleanNewPost ] );\n\n\treturn { ref };\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASG,iBAAiBA,CAAEC,YAAY,EAAG;EACzD,MAAMC,GAAG,GAAG,IAAAC,eAAM,EAAC,CAAC;EAEpB,MAAM;IAAEC;EAAe,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACnD,MAAM;MAAEF,cAAc,EAAEG;IAAgB,CAAC,GAAGD,MAAM,CAAEE,YAAY,CAAC;IAEjE,OAAO;MACNJ,cAAc,EAAEG,eAAe,CAAC;IACjC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,IAAAE,4BAAmB,EAAER,YAAY,EAAE,OAAQ;IAC1CS,KAAK,EAAEA,CAAA,KAAM;MACZR,GAAG,EAAES,OAAO,EAAED,KAAK,CAAC,CAAC;IACtB;EACD,CAAC,CAAG,CAAC;EAEL,IAAAE,kBAAS,EAAE,MAAM;IAChB,IAAK,CAAEV,GAAG,CAACS,OAAO,EAAG;MACpB;IACD;IAEA,MAAM;MAAEE;IAAY,CAAC,GAAGX,GAAG,CAACS,OAAO,CAACG,aAAa;IACjD,MAAM;MAAEC,IAAI;MAAEC;IAAO,CAAC,GAAGH,WAAW;IACpC,MAAMC,aAAa,GAClBC,IAAI,KAAK,eAAe,GAAGC,MAAM,CAACC,QAAQ,GAAGJ,WAAW,CAACI,QAAQ;IAClE,MAAM;MAAEC,aAAa;MAAEC;IAAK,CAAC,GAAGL,aAAa;;IAE7C;IACA;IACA;IACA;IACA,IAAKV,cAAc,KAAM,CAAEc,aAAa,IAAIC,IAAI,KAAKD,aAAa,CAAE,EAAG;MACtEhB,GAAG,CAACS,OAAO,CAACD,KAAK,CAAC,CAAC;IACpB;EACD,CAAC,EAAE,CAAEN,cAAc,CAAG,CAAC;EAEvB,OAAO;IAAEF;EAAI,CAAC;AACf","ignoreList":[]}
|
|
@@ -14,6 +14,11 @@ var _store = require("../../store");
|
|
|
14
14
|
* Internal dependencies
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Custom hook for managing the post title in the editor.
|
|
19
|
+
*
|
|
20
|
+
* @return {Object} An object containing the current title and a function to update the title.
|
|
21
|
+
*/
|
|
17
22
|
function usePostTitle() {
|
|
18
23
|
const {
|
|
19
24
|
editPost
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_store","usePostTitle","editPost","useDispatch","editorStore","title","useSelect","select","getEditedPostAttribute","updateTitle","newTitle","setTitle"],"sources":["@wordpress/editor/src/components/post-title/use-post-title.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport default function usePostTitle() {\n\tconst { editPost } = useDispatch( editorStore );\n\tconst { title } = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute } = select( editorStore );\n\n\t\treturn {\n\t\t\ttitle: getEditedPostAttribute( 'title' ),\n\t\t};\n\t}, [] );\n\n\tfunction updateTitle( newTitle ) {\n\t\teditPost( { title: newTitle } );\n\t}\n\n\treturn { title, setTitle: updateTitle };\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAIA,IAAAC,MAAA,GAAAD,OAAA;AAPA;AACA;AACA;;AAEA;AACA;AACA;;
|
|
1
|
+
{"version":3,"names":["_data","require","_store","usePostTitle","editPost","useDispatch","editorStore","title","useSelect","select","getEditedPostAttribute","updateTitle","newTitle","setTitle"],"sources":["@wordpress/editor/src/components/post-title/use-post-title.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Custom hook for managing the post title in the editor.\n *\n * @return {Object} An object containing the current title and a function to update the title.\n */\nexport default function usePostTitle() {\n\tconst { editPost } = useDispatch( editorStore );\n\tconst { title } = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute } = select( editorStore );\n\n\t\treturn {\n\t\t\ttitle: getEditedPostAttribute( 'title' ),\n\t\t};\n\t}, [] );\n\n\tfunction updateTitle( newTitle ) {\n\t\teditPost( { title: newTitle } );\n\t}\n\n\treturn { title, setTitle: updateTitle };\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAIA,IAAAC,MAAA,GAAAD,OAAA;AAPA;AACA;AACA;;AAEA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACe,SAASE,YAAYA,CAAA,EAAG;EACtC,MAAM;IAAEC;EAAS,CAAC,GAAG,IAAAC,iBAAW,EAAEC,YAAY,CAAC;EAC/C,MAAM;IAAEC;EAAM,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAC1C,MAAM;MAAEC;IAAuB,CAAC,GAAGD,MAAM,CAAEH,YAAY,CAAC;IAExD,OAAO;MACNC,KAAK,EAAEG,sBAAsB,CAAE,OAAQ;IACxC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,SAASC,WAAWA,CAAEC,QAAQ,EAAG;IAChCR,QAAQ,CAAE;MAAEG,KAAK,EAAEK;IAAS,CAAE,CAAC;EAChC;EAEA,OAAO;IAAEL,KAAK;IAAEM,QAAQ,EAAEF;EAAY,CAAC;AACxC","ignoreList":[]}
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = PostTransformPanel;
|
|
7
|
-
var _react = require("react");
|
|
8
7
|
var _data = require("@wordpress/data");
|
|
9
8
|
var _coreData = require("@wordpress/core-data");
|
|
10
9
|
var _components = require("@wordpress/components");
|
|
@@ -15,6 +14,7 @@ var _blocks = require("@wordpress/blocks");
|
|
|
15
14
|
var _store = require("../../store");
|
|
16
15
|
var _hooks = require("./hooks");
|
|
17
16
|
var _constants = require("../../store/constants");
|
|
17
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
18
|
/**
|
|
19
19
|
* WordPress dependencies
|
|
20
20
|
*/
|
|
@@ -31,7 +31,7 @@ function TemplatesList({
|
|
|
31
31
|
if (!availableTemplates || availableTemplates?.length === 0) {
|
|
32
32
|
return null;
|
|
33
33
|
}
|
|
34
|
-
return (0,
|
|
34
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.__experimentalBlockPatternsList, {
|
|
35
35
|
label: (0, _i18n.__)('Templates'),
|
|
36
36
|
blockPatterns: availableTemplates,
|
|
37
37
|
shownPatterns: shownTemplates,
|
|
@@ -73,14 +73,14 @@ function PostTransform() {
|
|
|
73
73
|
if (!availablePatterns?.length) {
|
|
74
74
|
return null;
|
|
75
75
|
}
|
|
76
|
-
return (0,
|
|
77
|
-
title: (0, _i18n.__)('
|
|
78
|
-
initialOpen: record.type === _constants.TEMPLATE_PART_POST_TYPE
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
})
|
|
76
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.PanelBody, {
|
|
77
|
+
title: (0, _i18n.__)('Design'),
|
|
78
|
+
initialOpen: record.type === _constants.TEMPLATE_PART_POST_TYPE,
|
|
79
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(TemplatesList, {
|
|
80
|
+
availableTemplates: availablePatterns,
|
|
81
|
+
onSelect: onTemplateSelect
|
|
82
|
+
})
|
|
83
|
+
});
|
|
84
84
|
}
|
|
85
85
|
function PostTransformPanel() {
|
|
86
86
|
const {
|
|
@@ -96,6 +96,6 @@ function PostTransformPanel() {
|
|
|
96
96
|
if (![_constants.TEMPLATE_PART_POST_TYPE, _constants.TEMPLATE_POST_TYPE].includes(postType)) {
|
|
97
97
|
return null;
|
|
98
98
|
}
|
|
99
|
-
return (0,
|
|
99
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(PostTransform, {});
|
|
100
100
|
}
|
|
101
101
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_coreData","_components","_i18n","_compose","_blockEditor","_blocks","_store","_hooks","_constants","TemplatesList","availableTemplates","onSelect","shownTemplates","useAsyncList","length","
|
|
1
|
+
{"version":3,"names":["_data","require","_coreData","_components","_i18n","_compose","_blockEditor","_blocks","_store","_hooks","_constants","_jsxRuntime","TemplatesList","availableTemplates","onSelect","shownTemplates","useAsyncList","length","jsx","__experimentalBlockPatternsList","label","__","blockPatterns","shownPatterns","onClickPattern","showTitlesAsTooltip","PostTransform","record","postType","postId","useSelect","select","getCurrentPostType","getCurrentPostId","editorStore","getEditedEntityRecord","coreStore","type","id","editEntityRecord","useDispatch","availablePatterns","useAvailablePatterns","onTemplateSelect","selectedTemplate","blocks","content","serialize","PanelBody","title","initialOpen","TEMPLATE_PART_POST_TYPE","children","PostTransformPanel","TEMPLATE_POST_TYPE","includes"],"sources":["@wordpress/editor/src/components/post-transform-panel/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { PanelBody } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useAsyncList } from '@wordpress/compose';\nimport { __experimentalBlockPatternsList as BlockPatternsList } from '@wordpress/block-editor';\nimport { serialize } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { useAvailablePatterns } from './hooks';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n} from '../../store/constants';\n\nfunction TemplatesList( { availableTemplates, onSelect } ) {\n\tconst shownTemplates = useAsyncList( availableTemplates );\n\tif ( ! availableTemplates || availableTemplates?.length === 0 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<BlockPatternsList\n\t\t\tlabel={ __( 'Templates' ) }\n\t\t\tblockPatterns={ availableTemplates }\n\t\t\tshownPatterns={ shownTemplates }\n\t\t\tonClickPattern={ onSelect }\n\t\t\tshowTitlesAsTooltip\n\t\t/>\n\t);\n}\n\nfunction PostTransform() {\n\tconst { record, postType, postId } = useSelect( ( select ) => {\n\t\tconst { getCurrentPostType, getCurrentPostId } = select( editorStore );\n\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\tconst type = getCurrentPostType();\n\t\tconst id = getCurrentPostId();\n\t\treturn {\n\t\t\tpostType: type,\n\t\t\tpostId: id,\n\t\t\trecord: getEditedEntityRecord( 'postType', type, id ),\n\t\t};\n\t}, [] );\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst availablePatterns = useAvailablePatterns( record );\n\tconst onTemplateSelect = async ( selectedTemplate ) => {\n\t\tawait editEntityRecord( 'postType', postType, postId, {\n\t\t\tblocks: selectedTemplate.blocks,\n\t\t\tcontent: serialize( selectedTemplate.blocks ),\n\t\t} );\n\t};\n\tif ( ! availablePatterns?.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PanelBody\n\t\t\ttitle={ __( 'Design' ) }\n\t\t\tinitialOpen={ record.type === TEMPLATE_PART_POST_TYPE }\n\t\t>\n\t\t\t<TemplatesList\n\t\t\t\tavailableTemplates={ availablePatterns }\n\t\t\t\tonSelect={ onTemplateSelect }\n\t\t\t/>\n\t\t</PanelBody>\n\t);\n}\n\nexport default function PostTransformPanel() {\n\tconst { postType } = useSelect( ( select ) => {\n\t\tconst { getCurrentPostType } = select( editorStore );\n\t\treturn {\n\t\t\tpostType: getCurrentPostType(),\n\t\t};\n\t}, [] );\n\n\tif (\n\t\t! [ TEMPLATE_PART_POST_TYPE, TEMPLATE_POST_TYPE ].includes( postType )\n\t) {\n\t\treturn null;\n\t}\n\n\treturn <PostTransform />;\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAKA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,UAAA,GAAAT,OAAA;AAG+B,IAAAU,WAAA,GAAAV,OAAA;AAnB/B;AACA;AACA;;AASA;AACA;AACA;;AAQA,SAASW,aAAaA,CAAE;EAAEC,kBAAkB;EAAEC;AAAS,CAAC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gB,CAACC,MAAM;MAC/BC,OAAO,EAAE,IAAAC,iBAAS,EAAEH,gBAAgB,CAACC,MAAO;IAC7C,CAAE,CAAC;EACJ,CAAC;EACD,IAAK,CAAEJ,iBAAiB,EAAExB,MAAM,EAAG;IAClC,OAAO,IAAI;EACZ;EAEA,oBACC,IAAAN,WAAA,CAAAO,GAAA,EAACf,WAAA,CAAA6C,SAAS;IACTC,KAAK,EAAG,IAAA5B,QAAE,EAAE,QAAS,CAAG;IACxB6B,WAAW,EAAGvB,MAAM,CAACU,IAAI,KAAKc,kCAAyB;IAAAC,QAAA,eAEvD,IAAAzC,WAAA,CAAAO,GAAA,EAACN,aAAa;MACbC,kBAAkB,EAAG4B,iBAAmB;MACxC3B,QAAQ,EAAG6B;IAAkB,CAC7B;EAAC,CACQ,CAAC;AAEd;AAEe,SAASU,kBAAkBA,CAAA,EAAG;EAC5C,MAAM;IAAEzB;EAAS,CAAC,GAAG,IAAAE,eAAS,EAAIC,MAAM,IAAM;IAC7C,MAAM;MAAEC;IAAmB,CAAC,GAAGD,MAAM,CAAEG,YAAY,CAAC;IACpD,OAAO;MACNN,QAAQ,EAAEI,kBAAkB,CAAC;IAC9B,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,IACC,CAAE,CAAEmB,kCAAuB,EAAEG,6BAAkB,CAAE,CAACC,QAAQ,CAAE3B,QAAS,CAAC,EACrE;IACD,OAAO,IAAI;EACZ;EAEA,oBAAO,IAAAjB,WAAA,CAAAO,GAAA,EAACQ,aAAa,IAAE,CAAC;AACzB","ignoreList":[]}
|
|
@@ -4,12 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = PostTrash;
|
|
7
|
-
var _react = require("react");
|
|
8
7
|
var _i18n = require("@wordpress/i18n");
|
|
9
8
|
var _components = require("@wordpress/components");
|
|
10
9
|
var _data = require("@wordpress/data");
|
|
11
10
|
var _element = require("@wordpress/element");
|
|
12
11
|
var _store = require("../../store");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
13
|
/**
|
|
14
14
|
* WordPress dependencies
|
|
15
15
|
*/
|
|
@@ -42,19 +42,23 @@ function PostTrash() {
|
|
|
42
42
|
setShowConfirmDialog(false);
|
|
43
43
|
trashPost();
|
|
44
44
|
};
|
|
45
|
-
return (0,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
45
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
46
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
47
|
+
__next40pxDefaultSize: true,
|
|
48
|
+
className: "editor-post-trash",
|
|
49
|
+
isDestructive: true,
|
|
50
|
+
variant: "secondary",
|
|
51
|
+
isBusy: isDeleting,
|
|
52
|
+
"aria-disabled": isDeleting,
|
|
53
|
+
onClick: isDeleting ? undefined : () => setShowConfirmDialog(true),
|
|
54
|
+
children: (0, _i18n.__)('Move to trash')
|
|
55
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalConfirmDialog, {
|
|
56
|
+
isOpen: showConfirmDialog,
|
|
57
|
+
onConfirm: handleConfirm,
|
|
58
|
+
onCancel: () => setShowConfirmDialog(false),
|
|
59
|
+
confirmButtonText: (0, _i18n.__)('Move to trash'),
|
|
60
|
+
children: (0, _i18n.__)('Are you sure you want to move this post to the trash?')
|
|
61
|
+
})]
|
|
62
|
+
});
|
|
59
63
|
}
|
|
60
64
|
//# sourceMappingURL=index.js.map
|