@wordpress/editor 13.34.0 → 14.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -4
- 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 +71 -2
- 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 +140 -0
- package/build/components/block-settings-menu/content-only-settings-menu.js.map +1 -0
- package/build/components/block-settings-menu/content-only-settings-menu.native.js +11 -0
- package/build/components/block-settings-menu/content-only-settings-menu.native.js.map +1 -0
- 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 +22 -19
- 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 +96 -72
- 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 +20 -16
- package/build/components/document-outline/item.js.map +1 -1
- package/build/components/document-tools/index.js +69 -69
- package/build/components/document-tools/index.js.map +1 -1
- 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 +178 -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 +4 -5
- package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
- package/build/components/global-styles-provider/index.js +195 -0
- package/build/components/global-styles-provider/index.js.map +1 -0
- package/build/components/header/back-button.js +34 -0
- package/build/components/header/back-button.js.map +1 -0
- package/build/components/header/index.js +176 -0
- package/build/components/header/index.js.map +1 -0
- package/build/components/inserter-sidebar/index.js +83 -32
- 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 +54 -49
- 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/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 +454 -327
- 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 +71 -62
- 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 +46 -35
- package/build/components/post-card-panel/index.js.map +1 -1
- package/build/components/post-comments/index.js +44 -8
- 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 +122 -24
- 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 +93 -0
- package/build/components/post-format/panel.js.map +1 -0
- 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 +19 -13
- 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 +13 -10
- package/build/components/post-panel-row/index.js.map +1 -1
- package/build/components/post-panel-section/index.js +29 -0
- package/build/components/post-panel-section/index.js.map +1 -0
- 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 +15 -4
- package/build/components/post-pingbacks/index.js.map +1 -1
- package/build/components/post-preview-button/index.js +45 -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 +46 -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 +10 -10
- 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 +30 -0
- package/build/components/post-slug/panel.js.map +1 -0
- 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 +25 -0
- package/build/components/post-sticky/panel.js.map +1 -0
- 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 +31 -19
- 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 +12 -5
- 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/hooks.js +90 -0
- package/build/components/post-transform-panel/hooks.js.map +1 -0
- package/build/components/post-transform-panel/index.js +101 -0
- package/build/components/post-transform-panel/index.js.map +1 -0
- package/build/components/post-trash/index.js +19 -15
- package/build/components/post-trash/index.js.map +1 -1
- package/build/components/post-type-support-check/index.js +1 -1
- package/build/components/post-type-support-check/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 +33 -25
- 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/index.js +96 -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 +23 -4
- 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/constants.js +11 -0
- package/build/components/sidebar/constants.js.map +1 -0
- package/build/components/sidebar/header.js +56 -0
- package/build/components/sidebar/header.js.map +1 -0
- package/build/components/sidebar/index.js +161 -0
- package/build/components/sidebar/index.js.map +1 -0
- package/build/components/sidebar/post-summary.js +89 -0
- package/build/components/sidebar/post-summary.js.map +1 -0
- 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 +18 -18
- package/build/components/start-page-options/index.js.map +1 -1
- package/build/components/start-template-options/index.js +198 -0
- package/build/components/start-template-options/index.js.map +1 -0
- 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 +39 -0
- package/build/components/template-content-panel/index.js.map +1 -0
- 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 +130 -78
- 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 +25 -16
- package/build/hooks/pattern-overrides.js.map +1 -1
- package/build/private-apis.js +15 -38
- package/build/private-apis.js.map +1 -1
- package/build/private-apis.native.js +48 -0
- package/build/private-apis.native.js.map +1 -0
- 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 +45 -2
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +15 -0
- package/build/store/reducer.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 +70 -2
- 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 +135 -0
- package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -0
- package/build-module/components/block-settings-menu/content-only-settings-menu.native.js +5 -0
- package/build-module/components/block-settings-menu/content-only-settings-menu.native.js.map +1 -0
- 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 +24 -19
- 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 +95 -70
- 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 +21 -16
- package/build-module/components/document-outline/item.js.map +1 -1
- package/build-module/components/document-tools/index.js +72 -70
- package/build-module/components/document-tools/index.js.map +1 -1
- 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 +172 -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 +3 -3
- package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
- package/build-module/components/global-styles-provider/index.js +185 -0
- package/build-module/components/global-styles-provider/index.js.map +1 -0
- package/build-module/components/header/back-button.js +28 -0
- package/build-module/components/header/back-button.js.map +1 -0
- package/build-module/components/header/index.js +169 -0
- package/build-module/components/header/index.js.map +1 -0
- package/build-module/components/inserter-sidebar/index.js +85 -34
- 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 +55 -49
- 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/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 +458 -329
- 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 +73 -62
- 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 +49 -38
- package/build-module/components/post-card-panel/index.js.map +1 -1
- package/build-module/components/post-comments/index.js +47 -9
- 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 +125 -26
- 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 +86 -0
- package/build-module/components/post-format/panel.js.map +1 -0
- 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 +21 -13
- 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 +14 -10
- package/build-module/components/post-panel-row/index.js.map +1 -1
- package/build-module/components/post-panel-section/index.js +21 -0
- package/build-module/components/post-panel-section/index.js.map +1 -0
- 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 +16 -5
- package/build-module/components/post-pingbacks/index.js.map +1 -1
- package/build-module/components/post-preview-button/index.js +47 -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 +48 -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 +10 -8
- 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 +21 -0
- package/build-module/components/post-slug/panel.js.map +1 -0
- 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 +16 -0
- package/build-module/components/post-sticky/panel.js.map +1 -0
- 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 +31 -20
- 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 +13 -4
- 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/hooks.js +83 -0
- package/build-module/components/post-transform-panel/hooks.js.map +1 -0
- package/build-module/components/post-transform-panel/index.js +94 -0
- package/build-module/components/post-transform-panel/index.js.map +1 -0
- 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-type-support-check/index.js +1 -1
- package/build-module/components/post-type-support-check/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 +35 -24
- 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/index.js +98 -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 +23 -4
- 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/constants.js +5 -0
- package/build-module/components/sidebar/constants.js.map +1 -0
- package/build-module/components/sidebar/header.js +50 -0
- package/build-module/components/sidebar/header.js.map +1 -0
- package/build-module/components/sidebar/index.js +154 -0
- package/build-module/components/sidebar/index.js.map +1 -0
- package/build-module/components/sidebar/post-summary.js +85 -0
- package/build-module/components/sidebar/post-summary.js.map +1 -0
- 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 +18 -18
- package/build-module/components/start-page-options/index.js.map +1 -1
- package/build-module/components/start-template-options/index.js +192 -0
- package/build-module/components/start-template-options/index.js.map +1 -0
- 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 +32 -0
- package/build-module/components/template-content-panel/index.js.map +1 -0
- 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 +133 -79
- 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 +27 -16
- package/build-module/hooks/pattern-overrides.js.map +1 -1
- package/build-module/private-apis.js +15 -38
- package/build-module/private-apis.js.map +1 -1
- package/build-module/private-apis.native.js +38 -0
- package/build-module/private-apis.native.js.map +1 -0
- 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 +41 -1
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +14 -0
- package/build-module/store/reducer.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 +623 -85
- package/build-style/style.css +623 -85
- package/package.json +43 -37
- package/src/bindings/index.js +1 -4
- package/src/bindings/pattern-overrides.js +84 -2
- package/src/bindings/post-meta.js +46 -6
- package/src/components/autocompleters/style.scss +1 -2
- package/src/components/block-settings-menu/content-only-settings-menu.js +175 -0
- package/src/components/block-settings-menu/content-only-settings-menu.native.js +4 -0
- package/src/components/block-settings-menu/style.scss +4 -0
- package/src/components/blog-title/index.js +124 -0
- package/src/components/blog-title/style.scss +4 -0
- package/src/components/collapsible-block-toolbar/index.js +2 -2
- 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 +34 -23
- package/src/components/document-outline/item.js +2 -2
- package/src/components/document-tools/index.js +21 -28
- 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-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 +13 -0
- package/src/components/error-boundary/index.js +10 -0
- package/src/components/error-boundary/index.native.js +1 -1
- package/src/components/global-keyboard-shortcuts/register-shortcuts.js +1 -1
- package/src/components/global-styles-provider/index.js +254 -0
- package/src/components/header/back-button.js +27 -0
- package/src/components/header/index.js +169 -0
- package/src/components/header/style.scss +236 -0
- package/src/components/inserter-sidebar/index.js +92 -36
- package/src/components/inserter-sidebar/style.scss +1 -7
- package/src/components/keyboard-shortcut-help-modal/index.js +2 -2
- package/src/components/list-view-sidebar/style.scss +1 -0
- package/src/components/local-autosave-monitor/index.js +12 -0
- 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/page-attributes/test/order.js +5 -1
- 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 +522 -371
- 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 +20 -42
- 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 +56 -55
- package/src/components/post-card-panel/style.scss +23 -1
- package/src/components/post-comments/index.js +52 -9
- package/src/components/post-discussion/panel.js +115 -31
- package/src/components/post-discussion/style.scss +24 -0
- 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 +87 -0
- package/src/components/post-format/style.scss +12 -0
- package/src/components/post-last-revision/check.js +8 -0
- package/src/components/post-last-revision/index.js +7 -2
- package/src/components/post-last-revision/panel.js +5 -0
- package/src/components/post-last-revision/test/check.js +5 -1
- package/src/components/post-locked-modal/index.js +6 -0
- package/src/components/post-panel-row/index.js +2 -2
- package/src/components/post-panel-row/style.scss +15 -0
- package/src/components/post-panel-section/index.js +19 -0
- package/src/components/post-panel-section/style.scss +3 -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 +17 -2
- package/src/components/post-preview-button/index.js +15 -0
- package/src/components/post-publish-button/index.js +17 -4
- package/src/components/post-publish-panel/index.js +1 -0
- package/src/components/post-publish-panel/maybe-tags-panel.js +1 -1
- package/src/components/post-publish-panel/style.scss +5 -0
- package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +3 -3
- package/src/components/post-saved-state/index.js +2 -2
- 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-slug/panel.js +22 -0
- package/src/components/post-slug/style.scss +5 -0
- package/src/components/post-slug/test/index.js +5 -1
- 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/panel.js +18 -0
- package/src/components/post-sticky/style.scss +3 -0
- 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 +10 -3
- package/src/components/post-title/index.native.js +70 -35
- package/src/components/post-title/post-title-raw.js +10 -2
- 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/hooks.js +114 -0
- package/src/components/post-transform-panel/index.js +91 -0
- package/src/components/post-type-support-check/index.js +1 -1
- package/src/components/post-type-support-check/test/index.js +2 -2
- 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 +6 -1
- 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/preferences-modal/index.js +3 -3
- package/src/components/provider/index.js +72 -0
- package/src/components/provider/index.native.js +43 -2
- package/src/components/provider/use-block-editor-settings.js +19 -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/sidebar/constants.js +4 -0
- package/src/components/sidebar/header.js +49 -0
- package/src/components/sidebar/index.js +196 -0
- package/src/components/sidebar/post-summary.js +97 -0
- package/src/components/sidebar/style.scss +18 -0
- package/src/components/site-discussion/index.js +138 -0
- package/src/components/site-discussion/style.scss +19 -0
- package/src/components/start-page-options/index.js +6 -4
- package/src/components/start-template-options/index.js +219 -0
- package/src/components/start-template-options/style.scss +47 -0
- package/src/components/template-areas/index.js +15 -6
- package/src/components/template-areas/style.scss +0 -1
- package/src/components/template-content-panel/index.js +36 -0
- 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 +191 -110
- 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/hooks/pattern-overrides.js +12 -6
- package/src/private-apis.js +18 -38
- package/src/private-apis.native.js +37 -0
- package/src/store/constants.js +7 -0
- package/src/store/private-actions.js +22 -50
- package/src/store/private-selectors.js +48 -0
- package/src/store/reducer.js +12 -0
- package/src/store/selectors.js +1 -1
- package/src/style.scss +16 -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-module/components/editor-canvas/edit-template-blocks-notification.js.map +0 -1
- package/build-module/components/editor-canvas/index.js.map +0 -1
- package/src/components/post-slug/test/check.js +0 -17
- package/src/components/provider/README.md +0 -37
- /package/src/components/{editor-canvas → visual-editor}/edit-template-blocks-notification.js +0 -0
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
1
|
/**
|
|
3
2
|
* External dependencies
|
|
4
3
|
*/
|
|
@@ -19,10 +18,60 @@ import { store as blockEditorStore, RichText } from '@wordpress/block-editor';
|
|
|
19
18
|
import { store as editorStore } from '@wordpress/editor';
|
|
20
19
|
import { __unstableStripHTML as stripHTML } from '@wordpress/dom';
|
|
21
20
|
|
|
21
|
+
/** @typedef {import('./types').RichTextValue} RichTextValue */
|
|
22
|
+
|
|
22
23
|
/**
|
|
23
24
|
* Internal dependencies
|
|
24
25
|
*/
|
|
25
26
|
import styles from './style.scss';
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Inserts content with title
|
|
30
|
+
*
|
|
31
|
+
* This function processes the given content and title, updating the title
|
|
32
|
+
* and content based on certain conditions. If the content is an array of
|
|
33
|
+
* blocks, it will check the first block for a heading or paragraph to use
|
|
34
|
+
* as the title. If the content is a string, it will strip HTML and update
|
|
35
|
+
* the title and content accordingly.
|
|
36
|
+
*
|
|
37
|
+
* @param {string} title The post title.
|
|
38
|
+
* @param {Array | string} content The content to be processed. It can be an array of blocks or a string.
|
|
39
|
+
* @param {Function} onUpdateTitle Callback function to update the title.
|
|
40
|
+
* @param {Function} onUpdateContent Callback function to update the content.
|
|
41
|
+
* @param {RichTextValue} value The initial value object, default is an object with empty text.
|
|
42
|
+
*/
|
|
43
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
44
|
+
export function insertContentWithTitle(title, content, onUpdateTitle, onUpdateContent, value = create({
|
|
45
|
+
text: ''
|
|
46
|
+
})) {
|
|
47
|
+
if (!content.length) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
if (typeof content !== 'string') {
|
|
51
|
+
const [firstBlock] = content;
|
|
52
|
+
if (!title && (firstBlock.name === 'core/heading' || firstBlock.name === 'core/paragraph')) {
|
|
53
|
+
// Strip HTML to avoid unwanted HTML being added to the title.
|
|
54
|
+
// In the majority of cases it is assumed that HTML in the title
|
|
55
|
+
// is undesirable.
|
|
56
|
+
const contentNoHTML = stripHTML(firstBlock.attributes.content);
|
|
57
|
+
onUpdateTitle(contentNoHTML);
|
|
58
|
+
onUpdateContent(content.slice(1));
|
|
59
|
+
} else {
|
|
60
|
+
onUpdateContent(content);
|
|
61
|
+
}
|
|
62
|
+
} else {
|
|
63
|
+
// Strip HTML to avoid unwanted HTML being added to the title.
|
|
64
|
+
// In the majority of cases it is assumed that HTML in the title
|
|
65
|
+
// is undesirable.
|
|
66
|
+
const contentNoHTML = stripHTML(content);
|
|
67
|
+
const newValue = insert(value, create({
|
|
68
|
+
html: contentNoHTML
|
|
69
|
+
}));
|
|
70
|
+
onUpdateTitle(toHTMLString({
|
|
71
|
+
value: newValue
|
|
72
|
+
}));
|
|
73
|
+
}
|
|
74
|
+
}
|
|
26
75
|
class PostTitle extends Component {
|
|
27
76
|
constructor(props) {
|
|
28
77
|
super(props);
|
|
@@ -56,40 +105,14 @@ class PostTitle extends Component {
|
|
|
56
105
|
}) {
|
|
57
106
|
const {
|
|
58
107
|
title,
|
|
59
|
-
onInsertBlockAfter,
|
|
108
|
+
onInsertBlockAfter: onInsertBlocks,
|
|
60
109
|
onUpdate
|
|
61
110
|
} = this.props;
|
|
62
111
|
const content = pasteHandler({
|
|
63
112
|
HTML: html,
|
|
64
113
|
plainText
|
|
65
114
|
});
|
|
66
|
-
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
if (typeof content !== 'string') {
|
|
70
|
-
const [firstBlock] = content;
|
|
71
|
-
if (!title && (firstBlock.name === 'core/heading' || firstBlock.name === 'core/paragraph')) {
|
|
72
|
-
// Strip HTML to avoid unwanted HTML being added to the title.
|
|
73
|
-
// In the majority of cases it is assumed that HTML in the title
|
|
74
|
-
// is undesirable.
|
|
75
|
-
const contentNoHTML = stripHTML(firstBlock.attributes.content);
|
|
76
|
-
onUpdate(contentNoHTML);
|
|
77
|
-
onInsertBlockAfter(content.slice(1));
|
|
78
|
-
} else {
|
|
79
|
-
onInsertBlockAfter(content);
|
|
80
|
-
}
|
|
81
|
-
} else {
|
|
82
|
-
// Strip HTML to avoid unwanted HTML being added to the title.
|
|
83
|
-
// In the majority of cases it is assumed that HTML in the title
|
|
84
|
-
// is undesirable.
|
|
85
|
-
const contentNoHTML = stripHTML(content);
|
|
86
|
-
const newValue = insert(value, create({
|
|
87
|
-
html: contentNoHTML
|
|
88
|
-
}));
|
|
89
|
-
onUpdate(toHTMLString({
|
|
90
|
-
value: newValue
|
|
91
|
-
}));
|
|
92
|
-
}
|
|
115
|
+
insertContentWithTitle(title, content, onUpdate, onInsertBlocks, value);
|
|
93
116
|
}
|
|
94
117
|
setRef(richText) {
|
|
95
118
|
this.richTextRef = richText;
|
|
@@ -124,40 +147,41 @@ class PostTitle extends Component {
|
|
|
124
147
|
placeholderColor: globalStyles.text
|
|
125
148
|
})
|
|
126
149
|
};
|
|
127
|
-
return
|
|
150
|
+
return /*#__PURE__*/_jsx(View, {
|
|
128
151
|
testID: "post-title",
|
|
129
152
|
style: [styles.titleContainer, borderStyle, {
|
|
130
153
|
borderColor
|
|
131
154
|
}, isDimmed && styles.dimmed],
|
|
132
155
|
accessible: !this.props.isSelected,
|
|
133
156
|
accessibilityLabel: this.getTitle(title, postType),
|
|
134
|
-
accessibilityHint: __('Updates the title.')
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
157
|
+
accessibilityHint: __('Updates the title.'),
|
|
158
|
+
children: /*#__PURE__*/_jsx(RichText.Raw, {
|
|
159
|
+
ref: this.setRef,
|
|
160
|
+
accessibilityLabel: this.getTitle(title, postType),
|
|
161
|
+
tagName: "p",
|
|
162
|
+
tagsToEliminate: ['strong'],
|
|
163
|
+
unstableOnFocus: this.props.onSelect,
|
|
164
|
+
onBlur: this.props.onBlur // Always assign onBlur as a props.
|
|
165
|
+
,
|
|
166
|
+
style: titleStyles,
|
|
167
|
+
styles: styles,
|
|
168
|
+
fontSize: 24,
|
|
169
|
+
lineHeight: 1,
|
|
170
|
+
fontWeight: "bold",
|
|
171
|
+
deleteEnter: true,
|
|
172
|
+
onChange: value => {
|
|
173
|
+
this.props.onUpdate(value);
|
|
174
|
+
},
|
|
175
|
+
onPaste: this.onPaste,
|
|
176
|
+
placeholder: decodedPlaceholder,
|
|
177
|
+
value: title,
|
|
178
|
+
onSelectionChange: () => {},
|
|
179
|
+
onEnter: this.props.onEnterPress,
|
|
180
|
+
disableEditingMenu: true,
|
|
181
|
+
__unstableIsSelected: this.props.isSelected,
|
|
182
|
+
__unstableOnCreateUndoLevel: () => {}
|
|
183
|
+
})
|
|
184
|
+
});
|
|
161
185
|
}
|
|
162
186
|
}
|
|
163
187
|
export default compose(withSelect(select => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["View","Component","create","toHTMLString","insert","decodeEntities","withDispatch","withSelect","withFocusOutside","withInstanceId","compose","__","sprintf","pasteHandler","store","blockEditorStore","RichText","editorStore","__unstableStripHTML","stripHTML","styles","PostTitle","constructor","props","setRef","bind","onPaste","componentDidUpdate","prevProps","isSelected","isAnyBlockSelected","richTextRef","blur","onUnselect","componentDidMount","innerRef","handleFocusOutside","focus","onSelect","value","plainText","html","title","onInsertBlockAfter","onUpdate","content","HTML","length","firstBlock","name","contentNoHTML","attributes","slice","newValue","richText","getTitle","postType","render","placeholder","style","focusedBorderColor","borderStyle","isDimmed","globalStyles","decodedPlaceholder","borderColor","titleStyles","text","color","placeholderColor","createElement","testID","titleContainer","dimmed","accessible","accessibilityLabel","accessibilityHint","Raw","ref","tagName","tagsToEliminate","unstableOnFocus","onBlur","fontSize","lineHeight","fontWeight","deleteEnter","onChange","onSelectionChange","onEnter","onEnterPress","disableEditingMenu","__unstableIsSelected","__unstableOnCreateUndoLevel","select","isPostTitleSelected","getEditedPostAttribute","getSelectedBlockClientId","getBlockRootClientId","getSettings","selectedId","selectionIsNested","__experimentalGlobalStylesBaseStyles","dispatch","undo","redo","togglePostTitleSelection","editPost","clearSelectedBlock","insertDefaultBlock","insertBlocks","undefined","onUndo","onRedo","blocks"],"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":";AAAA;AACA;AACA;AACA,SAASA,IAAI,QAAQ,cAAc;;AAEnC;AACA;AACA;AACA,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,MAAM,EAAEC,YAAY,EAAEC,MAAM,QAAQ,sBAAsB;AACnE,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAAS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|
|
1
|
+
{"version":3,"names":["View","Component","create","toHTMLString","insert","decodeEntities","withDispatch","withSelect","withFocusOutside","withInstanceId","compose","__","sprintf","pasteHandler","store","blockEditorStore","RichText","editorStore","__unstableStripHTML","stripHTML","styles","jsx","_jsx","insertContentWithTitle","title","content","onUpdateTitle","onUpdateContent","value","text","length","firstBlock","name","contentNoHTML","attributes","slice","newValue","html","PostTitle","constructor","props","setRef","bind","onPaste","componentDidUpdate","prevProps","isSelected","isAnyBlockSelected","richTextRef","blur","onUnselect","componentDidMount","innerRef","handleFocusOutside","focus","onSelect","plainText","onInsertBlockAfter","onInsertBlocks","onUpdate","HTML","richText","getTitle","postType","render","placeholder","style","focusedBorderColor","borderStyle","isDimmed","globalStyles","decodedPlaceholder","borderColor","titleStyles","color","placeholderColor","testID","titleContainer","dimmed","accessible","accessibilityLabel","accessibilityHint","children","Raw","ref","tagName","tagsToEliminate","unstableOnFocus","onBlur","fontSize","lineHeight","fontWeight","deleteEnter","onChange","onSelectionChange","onEnter","onEnterPress","disableEditingMenu","__unstableIsSelected","__unstableOnCreateUndoLevel","select","isPostTitleSelected","getEditedPostAttribute","getSelectedBlockClientId","getBlockRootClientId","getSettings","selectedId","selectionIsNested","__experimentalGlobalStylesBaseStyles","dispatch","undo","redo","togglePostTitleSelection","editPost","clearSelectedBlock","insertDefaultBlock","insertBlocks","undefined","onUndo","onRedo","blocks"],"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":"AAAA;AACA;AACA;AACA,SAASA,IAAI,QAAQ,cAAc;;AAEnC;AACA;AACA;AACA,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,MAAM,EAAEC,YAAY,EAAEC,MAAM,QAAQ,sBAAsB;AACnE,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,YAAY,EAAEC,UAAU,QAAQ,iBAAiB;AAC1D,SAASC,gBAAgB,QAAQ,uBAAuB;AACxD,SAASC,cAAc,EAAEC,OAAO,QAAQ,oBAAoB;AAC5D,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,YAAY,QAAQ,mBAAmB;AAChD,SAASC,KAAK,IAAIC,gBAAgB,EAAEC,QAAQ,QAAQ,yBAAyB;AAC7E,SAASF,KAAK,IAAIG,WAAW,QAAQ,mBAAmB;AACxD,SAASC,mBAAmB,IAAIC,SAAS,QAAQ,gBAAgB;;AAEjE;;AAEA;AACA;AACA;AACA,OAAOC,MAAM,MAAM,cAAc;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAdA,SAAAC,GAAA,IAAAC,IAAA;AAeA,OAAO,SAASC,sBAAsBA,CACrCC,KAAK,EACLC,OAAO,EACPC,aAAa,EACbC,eAAe,EACfC,KAAK,GAAG1B,MAAM,CAAE;EAAE2B,IAAI,EAAE;AAAG,CAAE,CAAC,EAC7B;EACD,IAAK,CAAEJ,OAAO,CAACK,MAAM,EAAG;IACvB;EACD;EAEA,IAAK,OAAOL,OAAO,KAAK,QAAQ,EAAG;IAClC,MAAM,CAAEM,UAAU,CAAE,GAAGN,OAAO;IAE9B,IACC,CAAED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;IAAEC,wBAAwB;IAAEC;EAAS,CAAC,GACvDJ,QAAQ,CAAE5F,WAAY,CAAC;EAExB,MAAM;IAAEiG,kBAAkB;IAAEC,kBAAkB;IAAEC;EAAa,CAAC,GAC7DP,QAAQ,CAAE9F,gBAAiB,CAAC;EAE7B,OAAO;IACNiF,YAAYA,CAAA,EAAG;MACdmB,kBAAkB,CAAEE,SAAS,EAAEA,SAAS,EAAE,CAAE,CAAC;IAC9C,CAAC;IACDC,MAAM,EAAER,IAAI;IACZS,MAAM,EAAER,IAAI;IACZxD,QAAQA,CAAA,EAAG;MACVyD,wBAAwB,CAAE,IAAK,CAAC;MAChCE,kBAAkB,CAAC,CAAC;IACrB,CAAC;IACDhE,UAAUA,CAAA,EAAG;MACZ8D,wBAAwB,CAAE,KAAM,CAAC;IAClC,CAAC;IACDrD,QAAQA,CAAEnC,KAAK,EAAG;MACjByF,QAAQ,CAAE;QAAEzF;MAAM,CAAE,CAAC;IACtB,CAAC;IACDiC,kBAAkBA,CAAE+D,MAAM,EAAG;MAC5BJ,YAAY,CAAEI,MAAM,EAAE,CAAE,CAAC;IAC1B;EACD,CAAC;AACF,CAAE,CAAC,EACH/G,cAAc,EACdD,gBACD,CAAC,CAAE8B,SAAU,CAAC","ignoreList":[]}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
1
|
/**
|
|
3
2
|
* External dependencies
|
|
4
3
|
*/
|
|
5
|
-
import
|
|
4
|
+
import clsx from 'clsx';
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* WordPress dependencies
|
|
@@ -20,6 +19,16 @@ import { useState, forwardRef } from '@wordpress/element';
|
|
|
20
19
|
import { DEFAULT_CLASSNAMES, REGEXP_NEWLINES } from './constants';
|
|
21
20
|
import usePostTitleFocus from './use-post-title-focus';
|
|
22
21
|
import usePostTitle from './use-post-title';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Renders a raw post title input field.
|
|
25
|
+
*
|
|
26
|
+
* @param {Object} _ Unused parameter.
|
|
27
|
+
* @param {Element} forwardedRef Reference to the component's DOM node.
|
|
28
|
+
*
|
|
29
|
+
* @return {Component} The rendered component.
|
|
30
|
+
*/
|
|
31
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
23
32
|
function PostTitleRaw(_, forwardedRef) {
|
|
24
33
|
const {
|
|
25
34
|
placeholder,
|
|
@@ -57,13 +66,13 @@ function PostTitleRaw(_, forwardedRef) {
|
|
|
57
66
|
|
|
58
67
|
// The wp-block className is important for editor styles.
|
|
59
68
|
// This same block is used in both the visual and the code editor.
|
|
60
|
-
const className =
|
|
69
|
+
const className = clsx(DEFAULT_CLASSNAMES, {
|
|
61
70
|
'is-selected': isSelected,
|
|
62
71
|
'has-fixed-toolbar': hasFixedToolbar,
|
|
63
72
|
'is-raw-text': true
|
|
64
73
|
});
|
|
65
74
|
const decodedPlaceholder = decodeEntities(placeholder) || __('Add title');
|
|
66
|
-
return
|
|
75
|
+
return /*#__PURE__*/_jsx(TextareaControl, {
|
|
67
76
|
ref: focusRef,
|
|
68
77
|
value: title,
|
|
69
78
|
onChange: onChange,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["clsx","TextareaControl","__","decodeEntities","useSelect","store","blockEditorStore","useState","forwardRef","DEFAULT_CLASSNAMES","REGEXP_NEWLINES","usePostTitleFocus","usePostTitle","jsx","_jsx","PostTitleRaw","_","forwardedRef","placeholder","hasFixedToolbar","select","getSettings","titlePlaceholder","_hasFixedToolbar","isSelected","setIsSelected","title","setTitle","onUpdate","ref","focusRef","onChange","value","replace","onSelect","onUnselect","className","decodedPlaceholder","onFocus","onBlur","label","hideLabelFromVision","autoComplete","dir","rows","__nextHasNoMarginBottom"],"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":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,eAAe,QAAQ,uBAAuB;AACvD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASC,QAAQ,EAAEC,UAAU,QAAQ,oBAAoB;;AAEzD;AACA;AACA;AACA,SAASC,kBAAkB,EAAEC,eAAe,QAAQ,aAAa;AACjE,OAAOC,iBAAiB,MAAM,wBAAwB;AACtD,OAAOC,YAAY,MAAM,kBAAkB;;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,SAAAC,GAAA,IAAAC,IAAA;AAQA,SAASC,YAAYA,CAAEC,CAAC,EAAEC,YAAY,EAAG;EACxC,MAAM;IAAEC,WAAW;IAAEC;EAAgB,CAAC,GAAGf,SAAS,CAAIgB,MAAM,IAAM;IACjE,MAAM;MAAEC;IAAY,CAAC,GAAGD,MAAM,CAAEd,gBAAiB,CAAC;IAClD,MAAM;MAAEgB,gBAAgB;MAAEH,eAAe,EAAEI;IAAiB,CAAC,GAC5DF,WAAW,CAAC,CAAC;IAEd,OAAO;MACNH,WAAW,EAAEI,gBAAgB;MAC7BH,eAAe,EAAEI;IAClB,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAM,CAAEC,UAAU,EAAEC,aAAa,CAAE,GAAGlB,QAAQ,CAAE,KAAM,CAAC;EAEvD,MAAM;IAAEmB,KAAK;IAAEC,QAAQ,EAAEC;EAAS,CAAC,GAAGhB,YAAY,CAAC,CAAC;EACpD,MAAM;IAAEiB,GAAG,EAAEC;EAAS,CAAC,GAAGnB,iBAAiB,CAAEM,YAAa,CAAC;EAE3D,SAASc,QAAQA,CAAEC,KAAK,EAAG;IAC1BJ,QAAQ,CAAEI,KAAK,CAACC,OAAO,CAAEvB,eAAe,EAAE,GAAI,CAAE,CAAC;EAClD;EAEA,SAASwB,QAAQA,CAAA,EAAG;IACnBT,aAAa,CAAE,IAAK,CAAC;EACtB;EAEA,SAASU,UAAUA,CAAA,EAAG;IACrBV,aAAa,CAAE,KAAM,CAAC;EACvB;;EAEA;EACA;EACA,MAAMW,SAAS,GAAGpC,IAAI,CAAES,kBAAkB,EAAE;IAC3C,aAAa,EAAEe,UAAU;IACzB,mBAAmB,EAAEL,eAAe;IACpC,aAAa,EAAE;EAChB,CAAE,CAAC;EAEH,MAAMkB,kBAAkB,GACvBlC,cAAc,CAAEe,WAAY,CAAC,IAAIhB,EAAE,CAAE,WAAY,CAAC;EAEnD,oBACCY,IAAA,CAACb,eAAe;IACf4B,GAAG,EAAGC,QAAU;IAChBE,KAAK,EAAGN,KAAO;IACfK,QAAQ,EAAGA,QAAU;IACrBO,OAAO,EAAGJ,QAAU;IACpBK,MAAM,EAAGJ,UAAY;IACrBK,KAAK,EAAGtB,WAAa;IACrBkB,SAAS,EAAGA,SAAW;IACvBlB,WAAW,EAAGmB,kBAAoB;IAClCI,mBAAmB;IACnBC,YAAY,EAAC,KAAK;IAClBC,GAAG,EAAC,MAAM;IACVC,IAAI,EAAG,CAAG;IACVC,uBAAuB;EAAA,CACvB,CAAC;AAEJ;AAEA,eAAerC,UAAU,CAAEO,YAAa,CAAC","ignoreList":[]}
|
|
@@ -8,6 +8,14 @@ import { useSelect } from '@wordpress/data';
|
|
|
8
8
|
* Internal dependencies
|
|
9
9
|
*/
|
|
10
10
|
import { store as editorStore } from '../../store';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Custom hook that manages the focus behavior of the post title input field.
|
|
14
|
+
*
|
|
15
|
+
* @param {Element} forwardedRef - The forwarded ref for the input field.
|
|
16
|
+
*
|
|
17
|
+
* @return {Object} - The ref object.
|
|
18
|
+
*/
|
|
11
19
|
export default function usePostTitleFocus(forwardedRef) {
|
|
12
20
|
const ref = useRef();
|
|
13
21
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useEffect","useImperativeHandle","useRef","useSelect","store","editorStore","usePostTitleFocus","forwardedRef","ref","isCleanNewPost","select","_isCleanNewPost","focus","current","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":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,mBAAmB,EAAEC,MAAM,QAAQ,oBAAoB;AAC3E,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;
|
|
1
|
+
{"version":3,"names":["useEffect","useImperativeHandle","useRef","useSelect","store","editorStore","usePostTitleFocus","forwardedRef","ref","isCleanNewPost","select","_isCleanNewPost","focus","current","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":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,mBAAmB,EAAEC,MAAM,QAAQ,oBAAoB;AAC3E,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,iBAAiBA,CAAEC,YAAY,EAAG;EACzD,MAAMC,GAAG,GAAGN,MAAM,CAAC,CAAC;EAEpB,MAAM;IAAEO;EAAe,CAAC,GAAGN,SAAS,CAAIO,MAAM,IAAM;IACnD,MAAM;MAAED,cAAc,EAAEE;IAAgB,CAAC,GAAGD,MAAM,CAAEL,WAAY,CAAC;IAEjE,OAAO;MACNI,cAAc,EAAEE,eAAe,CAAC;IACjC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEPV,mBAAmB,CAAEM,YAAY,EAAE,OAAQ;IAC1CK,KAAK,EAAEA,CAAA,KAAM;MACZJ,GAAG,EAAEK,OAAO,EAAED,KAAK,CAAC,CAAC;IACtB;EACD,CAAC,CAAG,CAAC;EAELZ,SAAS,CAAE,MAAM;IAChB,IAAK,CAAEQ,GAAG,CAACK,OAAO,EAAG;MACpB;IACD;IAEA,MAAM;MAAEC;IAAY,CAAC,GAAGN,GAAG,CAACK,OAAO,CAACE,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,IAAKN,cAAc,KAAM,CAAEU,aAAa,IAAIC,IAAI,KAAKD,aAAa,CAAE,EAAG;MACtEX,GAAG,CAACK,OAAO,CAACD,KAAK,CAAC,CAAC;IACpB;EACD,CAAC,EAAE,CAAEH,cAAc,CAAG,CAAC;EAEvB,OAAO;IAAED;EAAI,CAAC;AACf","ignoreList":[]}
|
|
@@ -6,6 +6,12 @@ import { useSelect, useDispatch } from '@wordpress/data';
|
|
|
6
6
|
* Internal dependencies
|
|
7
7
|
*/
|
|
8
8
|
import { store as editorStore } from '../../store';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Custom hook for managing the post title in the editor.
|
|
12
|
+
*
|
|
13
|
+
* @return {Object} An object containing the current title and a function to update the title.
|
|
14
|
+
*/
|
|
9
15
|
export default function usePostTitle() {
|
|
10
16
|
const {
|
|
11
17
|
editPost
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSelect","useDispatch","store","editorStore","usePostTitle","editPost","title","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":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;
|
|
1
|
+
{"version":3,"names":["useSelect","useDispatch","store","editorStore","usePostTitle","editPost","title","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":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,YAAYA,CAAA,EAAG;EACtC,MAAM;IAAEC;EAAS,CAAC,GAAGJ,WAAW,CAAEE,WAAY,CAAC;EAC/C,MAAM;IAAEG;EAAM,CAAC,GAAGN,SAAS,CAAIO,MAAM,IAAM;IAC1C,MAAM;MAAEC;IAAuB,CAAC,GAAGD,MAAM,CAAEJ,WAAY,CAAC;IAExD,OAAO;MACNG,KAAK,EAAEE,sBAAsB,CAAE,OAAQ;IACxC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,SAASC,WAAWA,CAAEC,QAAQ,EAAG;IAChCL,QAAQ,CAAE;MAAEC,KAAK,EAAEI;IAAS,CAAE,CAAC;EAChC;EAEA,OAAO;IAAEJ,KAAK;IAAEK,QAAQ,EAAEF;EAAY,CAAC;AACxC","ignoreList":[]}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useSelect } from '@wordpress/data';
|
|
5
|
+
import { useMemo } from '@wordpress/element';
|
|
6
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
7
|
+
import { parse } from '@wordpress/blocks';
|
|
8
|
+
import { privateApis as patternsPrivateApis } from '@wordpress/patterns';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Internal dependencies
|
|
12
|
+
*/
|
|
13
|
+
import { unlock } from '../../lock-unlock';
|
|
14
|
+
import { store as editorStore } from '../../store';
|
|
15
|
+
const {
|
|
16
|
+
EXCLUDED_PATTERN_SOURCES,
|
|
17
|
+
PATTERN_TYPES
|
|
18
|
+
} = unlock(patternsPrivateApis);
|
|
19
|
+
function injectThemeAttributeInBlockTemplateContent(block, currentThemeStylesheet) {
|
|
20
|
+
block.innerBlocks = block.innerBlocks.map(innerBlock => {
|
|
21
|
+
return injectThemeAttributeInBlockTemplateContent(innerBlock, currentThemeStylesheet);
|
|
22
|
+
});
|
|
23
|
+
if (block.name === 'core/template-part' && block.attributes.theme === undefined) {
|
|
24
|
+
block.attributes.theme = currentThemeStylesheet;
|
|
25
|
+
}
|
|
26
|
+
return block;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Filter all patterns and return only the ones that are compatible with the current template.
|
|
31
|
+
*
|
|
32
|
+
* @param {Array} patterns An array of patterns.
|
|
33
|
+
* @param {Object} template The current template.
|
|
34
|
+
* @return {Array} Array of patterns that are compatible with the current template.
|
|
35
|
+
*/
|
|
36
|
+
function filterPatterns(patterns, template) {
|
|
37
|
+
// Filter out duplicates.
|
|
38
|
+
const filterOutDuplicatesByName = (currentItem, index, items) => index === items.findIndex(item => currentItem.name === item.name);
|
|
39
|
+
|
|
40
|
+
// Filter out core/directory patterns not included in theme.json.
|
|
41
|
+
const filterOutExcludedPatternSources = pattern => !EXCLUDED_PATTERN_SOURCES.includes(pattern.source);
|
|
42
|
+
|
|
43
|
+
// Looks for patterns that have the same template type as the current template,
|
|
44
|
+
// or have a block type that matches the current template area.
|
|
45
|
+
const filterCompatiblePatterns = pattern => pattern.templateTypes?.includes(template.slug) || pattern.blockTypes?.includes('core/template-part/' + template.area);
|
|
46
|
+
return patterns.filter((pattern, index, items) => {
|
|
47
|
+
return filterOutDuplicatesByName(pattern, index, items) && filterOutExcludedPatternSources(pattern) && filterCompatiblePatterns(pattern);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
function preparePatterns(patterns, currentThemeStylesheet) {
|
|
51
|
+
return patterns.map(pattern => ({
|
|
52
|
+
...pattern,
|
|
53
|
+
keywords: pattern.keywords || [],
|
|
54
|
+
type: PATTERN_TYPES.theme,
|
|
55
|
+
blocks: parse(pattern.content, {
|
|
56
|
+
__unstableSkipMigrationLogs: true
|
|
57
|
+
}).map(block => injectThemeAttributeInBlockTemplateContent(block, currentThemeStylesheet))
|
|
58
|
+
}));
|
|
59
|
+
}
|
|
60
|
+
export function useAvailablePatterns(template) {
|
|
61
|
+
const {
|
|
62
|
+
blockPatterns,
|
|
63
|
+
restBlockPatterns,
|
|
64
|
+
currentThemeStylesheet
|
|
65
|
+
} = useSelect(select => {
|
|
66
|
+
var _settings$__experimen;
|
|
67
|
+
const {
|
|
68
|
+
getEditorSettings
|
|
69
|
+
} = select(editorStore);
|
|
70
|
+
const settings = getEditorSettings();
|
|
71
|
+
return {
|
|
72
|
+
blockPatterns: (_settings$__experimen = settings.__experimentalAdditionalBlockPatterns) !== null && _settings$__experimen !== void 0 ? _settings$__experimen : settings.__experimentalBlockPatterns,
|
|
73
|
+
restBlockPatterns: select(coreStore).getBlockPatterns(),
|
|
74
|
+
currentThemeStylesheet: select(coreStore).getCurrentTheme().stylesheet
|
|
75
|
+
};
|
|
76
|
+
}, []);
|
|
77
|
+
return useMemo(() => {
|
|
78
|
+
const mergedPatterns = [...(blockPatterns || []), ...(restBlockPatterns || [])];
|
|
79
|
+
const filteredPatterns = filterPatterns(mergedPatterns, template);
|
|
80
|
+
return preparePatterns(filteredPatterns, template, currentThemeStylesheet);
|
|
81
|
+
}, [blockPatterns, restBlockPatterns, template, currentThemeStylesheet]);
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useSelect","useMemo","store","coreStore","parse","privateApis","patternsPrivateApis","unlock","editorStore","EXCLUDED_PATTERN_SOURCES","PATTERN_TYPES","injectThemeAttributeInBlockTemplateContent","block","currentThemeStylesheet","innerBlocks","map","innerBlock","name","attributes","theme","undefined","filterPatterns","patterns","template","filterOutDuplicatesByName","currentItem","index","items","findIndex","item","filterOutExcludedPatternSources","pattern","includes","source","filterCompatiblePatterns","templateTypes","slug","blockTypes","area","filter","preparePatterns","keywords","type","blocks","content","__unstableSkipMigrationLogs","useAvailablePatterns","blockPatterns","restBlockPatterns","select","_settings$__experimen","getEditorSettings","settings","__experimentalAdditionalBlockPatterns","__experimentalBlockPatterns","getBlockPatterns","getCurrentTheme","stylesheet","mergedPatterns","filteredPatterns"],"sources":["@wordpress/editor/src/components/post-transform-panel/hooks.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { parse } from '@wordpress/blocks';\nimport { privateApis as patternsPrivateApis } from '@wordpress/patterns';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\n\nconst { EXCLUDED_PATTERN_SOURCES, PATTERN_TYPES } =\n\tunlock( patternsPrivateApis );\n\nfunction injectThemeAttributeInBlockTemplateContent(\n\tblock,\n\tcurrentThemeStylesheet\n) {\n\tblock.innerBlocks = block.innerBlocks.map( ( innerBlock ) => {\n\t\treturn injectThemeAttributeInBlockTemplateContent(\n\t\t\tinnerBlock,\n\t\t\tcurrentThemeStylesheet\n\t\t);\n\t} );\n\n\tif (\n\t\tblock.name === 'core/template-part' &&\n\t\tblock.attributes.theme === undefined\n\t) {\n\t\tblock.attributes.theme = currentThemeStylesheet;\n\t}\n\treturn block;\n}\n\n/**\n * Filter all patterns and return only the ones that are compatible with the current template.\n *\n * @param {Array} patterns An array of patterns.\n * @param {Object} template The current template.\n * @return {Array} Array of patterns that are compatible with the current template.\n */\nfunction filterPatterns( patterns, template ) {\n\t// Filter out duplicates.\n\tconst filterOutDuplicatesByName = ( currentItem, index, items ) =>\n\t\tindex === items.findIndex( ( item ) => currentItem.name === item.name );\n\n\t// Filter out core/directory patterns not included in theme.json.\n\tconst filterOutExcludedPatternSources = ( pattern ) =>\n\t\t! EXCLUDED_PATTERN_SOURCES.includes( pattern.source );\n\n\t// Looks for patterns that have the same template type as the current template,\n\t// or have a block type that matches the current template area.\n\tconst filterCompatiblePatterns = ( pattern ) =>\n\t\tpattern.templateTypes?.includes( template.slug ) ||\n\t\tpattern.blockTypes?.includes( 'core/template-part/' + template.area );\n\n\treturn patterns.filter( ( pattern, index, items ) => {\n\t\treturn (\n\t\t\tfilterOutDuplicatesByName( pattern, index, items ) &&\n\t\t\tfilterOutExcludedPatternSources( pattern ) &&\n\t\t\tfilterCompatiblePatterns( pattern )\n\t\t);\n\t} );\n}\n\nfunction preparePatterns( patterns, currentThemeStylesheet ) {\n\treturn patterns.map( ( pattern ) => ( {\n\t\t...pattern,\n\t\tkeywords: pattern.keywords || [],\n\t\ttype: PATTERN_TYPES.theme,\n\t\tblocks: parse( pattern.content, {\n\t\t\t__unstableSkipMigrationLogs: true,\n\t\t} ).map( ( block ) =>\n\t\t\tinjectThemeAttributeInBlockTemplateContent(\n\t\t\t\tblock,\n\t\t\t\tcurrentThemeStylesheet\n\t\t\t)\n\t\t),\n\t} ) );\n}\n\nexport function useAvailablePatterns( template ) {\n\tconst { blockPatterns, restBlockPatterns, currentThemeStylesheet } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst { getEditorSettings } = select( editorStore );\n\t\t\tconst settings = getEditorSettings();\n\n\t\t\treturn {\n\t\t\t\tblockPatterns:\n\t\t\t\t\tsettings.__experimentalAdditionalBlockPatterns ??\n\t\t\t\t\tsettings.__experimentalBlockPatterns,\n\t\t\t\trestBlockPatterns: select( coreStore ).getBlockPatterns(),\n\t\t\t\tcurrentThemeStylesheet:\n\t\t\t\t\tselect( coreStore ).getCurrentTheme().stylesheet,\n\t\t\t};\n\t\t}, [] );\n\n\treturn useMemo( () => {\n\t\tconst mergedPatterns = [\n\t\t\t...( blockPatterns || [] ),\n\t\t\t...( restBlockPatterns || [] ),\n\t\t];\n\t\tconst filteredPatterns = filterPatterns( mergedPatterns, template );\n\t\treturn preparePatterns(\n\t\t\tfilteredPatterns,\n\t\t\ttemplate,\n\t\t\tcurrentThemeStylesheet\n\t\t);\n\t}, [ blockPatterns, restBlockPatterns, template, currentThemeStylesheet ] );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,KAAK,QAAQ,mBAAmB;AACzC,SAASC,WAAW,IAAIC,mBAAmB,QAAQ,qBAAqB;;AAExE;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASL,KAAK,IAAIM,WAAW,QAAQ,aAAa;AAElD,MAAM;EAAEC,wBAAwB;EAAEC;AAAc,CAAC,GAChDH,MAAM,CAAED,mBAAoB,CAAC;AAE9B,SAASK,0CAA0CA,CAClDC,KAAK,EACLC,sBAAsB,EACrB;EACDD,KAAK,CAACE,WAAW,GAAGF,KAAK,CAACE,WAAW,CAACC,GAAG,CAAIC,UAAU,IAAM;IAC5D,OAAOL,0CAA0C,CAChDK,UAAU,EACVH,sBACD,CAAC;EACF,CAAE,CAAC;EAEH,IACCD,KAAK,CAACK,IAAI,KAAK,oBAAoB,IACnCL,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|
|
3
|
+
*/
|
|
4
|
+
import { useSelect, useDispatch } from '@wordpress/data';
|
|
5
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
6
|
+
import { PanelBody } from '@wordpress/components';
|
|
7
|
+
import { __ } from '@wordpress/i18n';
|
|
8
|
+
import { useAsyncList } from '@wordpress/compose';
|
|
9
|
+
import { __experimentalBlockPatternsList as BlockPatternsList } from '@wordpress/block-editor';
|
|
10
|
+
import { serialize } from '@wordpress/blocks';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Internal dependencies
|
|
14
|
+
*/
|
|
15
|
+
import { store as editorStore } from '../../store';
|
|
16
|
+
import { useAvailablePatterns } from './hooks';
|
|
17
|
+
import { TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE } from '../../store/constants';
|
|
18
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
|
+
function TemplatesList({
|
|
20
|
+
availableTemplates,
|
|
21
|
+
onSelect
|
|
22
|
+
}) {
|
|
23
|
+
const shownTemplates = useAsyncList(availableTemplates);
|
|
24
|
+
if (!availableTemplates || availableTemplates?.length === 0) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
return /*#__PURE__*/_jsx(BlockPatternsList, {
|
|
28
|
+
label: __('Templates'),
|
|
29
|
+
blockPatterns: availableTemplates,
|
|
30
|
+
shownPatterns: shownTemplates,
|
|
31
|
+
onClickPattern: onSelect,
|
|
32
|
+
showTitlesAsTooltip: true
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
function PostTransform() {
|
|
36
|
+
const {
|
|
37
|
+
record,
|
|
38
|
+
postType,
|
|
39
|
+
postId
|
|
40
|
+
} = useSelect(select => {
|
|
41
|
+
const {
|
|
42
|
+
getCurrentPostType,
|
|
43
|
+
getCurrentPostId
|
|
44
|
+
} = select(editorStore);
|
|
45
|
+
const {
|
|
46
|
+
getEditedEntityRecord
|
|
47
|
+
} = select(coreStore);
|
|
48
|
+
const type = getCurrentPostType();
|
|
49
|
+
const id = getCurrentPostId();
|
|
50
|
+
return {
|
|
51
|
+
postType: type,
|
|
52
|
+
postId: id,
|
|
53
|
+
record: getEditedEntityRecord('postType', type, id)
|
|
54
|
+
};
|
|
55
|
+
}, []);
|
|
56
|
+
const {
|
|
57
|
+
editEntityRecord
|
|
58
|
+
} = useDispatch(coreStore);
|
|
59
|
+
const availablePatterns = useAvailablePatterns(record);
|
|
60
|
+
const onTemplateSelect = async selectedTemplate => {
|
|
61
|
+
await editEntityRecord('postType', postType, postId, {
|
|
62
|
+
blocks: selectedTemplate.blocks,
|
|
63
|
+
content: serialize(selectedTemplate.blocks)
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
if (!availablePatterns?.length) {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
return /*#__PURE__*/_jsx(PanelBody, {
|
|
70
|
+
title: __('Design'),
|
|
71
|
+
initialOpen: record.type === TEMPLATE_PART_POST_TYPE,
|
|
72
|
+
children: /*#__PURE__*/_jsx(TemplatesList, {
|
|
73
|
+
availableTemplates: availablePatterns,
|
|
74
|
+
onSelect: onTemplateSelect
|
|
75
|
+
})
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
export default function PostTransformPanel() {
|
|
79
|
+
const {
|
|
80
|
+
postType
|
|
81
|
+
} = useSelect(select => {
|
|
82
|
+
const {
|
|
83
|
+
getCurrentPostType
|
|
84
|
+
} = select(editorStore);
|
|
85
|
+
return {
|
|
86
|
+
postType: getCurrentPostType()
|
|
87
|
+
};
|
|
88
|
+
}, []);
|
|
89
|
+
if (![TEMPLATE_PART_POST_TYPE, TEMPLATE_POST_TYPE].includes(postType)) {
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
return /*#__PURE__*/_jsx(PostTransform, {});
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useSelect","useDispatch","store","coreStore","PanelBody","__","useAsyncList","__experimentalBlockPatternsList","BlockPatternsList","serialize","editorStore","useAvailablePatterns","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","jsx","_jsx","TemplatesList","availableTemplates","onSelect","shownTemplates","length","label","blockPatterns","shownPatterns","onClickPattern","showTitlesAsTooltip","PostTransform","record","postType","postId","select","getCurrentPostType","getCurrentPostId","getEditedEntityRecord","type","id","editEntityRecord","availablePatterns","onTemplateSelect","selectedTemplate","blocks","content","title","initialOpen","children","PostTransformPanel","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":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,SAAS,QAAQ,uBAAuB;AACjD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,YAAY,QAAQ,oBAAoB;AACjD,SAASC,+BAA+B,IAAIC,iBAAiB,QAAQ,yBAAyB;AAC9F,SAASC,SAAS,QAAQ,mBAAmB;;AAE7C;AACA;AACA;AACA,SAASP,KAAK,IAAIQ,WAAW,QAAQ,aAAa;AAClD,SAASC,oBAAoB,QAAQ,SA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