@wordpress/editor 14.32.0 → 14.32.1-next.ff1cebbba.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/build/bindings/api.js +45 -33
- package/build/bindings/api.js.map +7 -1
- package/build/bindings/entity.js +78 -0
- package/build/bindings/entity.js.map +7 -0
- package/build/bindings/pattern-overrides.js +58 -65
- package/build/bindings/pattern-overrides.js.map +7 -1
- package/build/bindings/post-data.js +71 -91
- package/build/bindings/post-data.js.map +7 -1
- package/build/bindings/post-meta.js +74 -106
- package/build/bindings/post-meta.js.map +7 -1
- package/build/components/autocompleters/index.js +36 -11
- package/build/components/autocompleters/index.js.map +7 -1
- package/build/components/autocompleters/user.js +66 -54
- package/build/components/autocompleters/user.js.map +7 -1
- package/build/components/autosave-monitor/index.js +59 -73
- package/build/components/autosave-monitor/index.js.map +7 -1
- package/build/components/block-removal-warnings/index.js +81 -57
- package/build/components/block-removal-warnings/index.js.map +7 -1
- package/build/components/block-settings-menu/content-only-settings-menu.js +161 -121
- package/build/components/block-settings-menu/content-only-settings-menu.js.map +7 -1
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +42 -99
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +7 -1
- package/build/components/block-visibility/index.js +123 -0
- package/build/components/block-visibility/index.js.map +7 -0
- package/build/components/blog-title/index.js +127 -108
- package/build/components/blog-title/index.js.map +7 -1
- package/build/components/character-count/index.js +30 -23
- package/build/components/character-count/index.js.map +7 -1
- package/build/components/collab-sidebar/add-comment.js +89 -70
- package/build/components/collab-sidebar/add-comment.js.map +7 -1
- package/build/components/collab-sidebar/comment-author-info.js +72 -84
- package/build/components/collab-sidebar/comment-author-info.js.map +7 -1
- package/build/components/collab-sidebar/comment-form.js +92 -81
- package/build/components/collab-sidebar/comment-form.js.map +7 -1
- package/build/components/collab-sidebar/comment-indicator-toolbar.js +96 -83
- package/build/components/collab-sidebar/comment-indicator-toolbar.js.map +7 -1
- package/build/components/collab-sidebar/comment-menu-item.js +46 -0
- package/build/components/collab-sidebar/comment-menu-item.js.map +7 -0
- package/build/components/collab-sidebar/comments.js +544 -317
- package/build/components/collab-sidebar/comments.js.map +7 -1
- package/build/components/collab-sidebar/constants.js +30 -7
- package/build/components/collab-sidebar/constants.js.map +7 -1
- package/build/components/collab-sidebar/hooks.js +312 -58
- package/build/components/collab-sidebar/hooks.js.map +7 -1
- package/build/components/collab-sidebar/index.js +183 -252
- package/build/components/collab-sidebar/index.js.map +7 -1
- package/build/components/collab-sidebar/utils.js +94 -79
- package/build/components/collab-sidebar/utils.js.map +7 -1
- package/build/components/collapsible-block-toolbar/index.js +70 -60
- package/build/components/collapsible-block-toolbar/index.js.map +7 -1
- package/build/components/commands/index.js +218 -268
- package/build/components/commands/index.js.map +7 -1
- package/build/components/deprecated.js +328 -248
- package/build/components/deprecated.js.map +7 -1
- package/build/components/document-bar/index.js +145 -153
- package/build/components/document-bar/index.js.map +7 -1
- package/build/components/document-outline/check.js +28 -27
- package/build/components/document-outline/check.js.map +7 -1
- package/build/components/document-outline/index.js +169 -207
- package/build/components/document-outline/index.js.map +7 -1
- package/build/components/document-outline/item.js +68 -35
- package/build/components/document-outline/item.js.map +7 -1
- package/build/components/document-tools/index.js +145 -133
- package/build/components/document-tools/index.js.map +7 -1
- package/build/components/editor/index.js +99 -63
- package/build/components/editor/index.js.map +7 -1
- package/build/components/editor-history/redo.js +51 -54
- package/build/components/editor-history/redo.js.map +7 -1
- package/build/components/editor-history/undo.js +50 -53
- package/build/components/editor-history/undo.js.map +7 -1
- package/build/components/editor-interface/content-slot-fill.js +27 -12
- package/build/components/editor-interface/content-slot-fill.js.map +7 -1
- package/build/components/editor-interface/index.js +142 -127
- package/build/components/editor-interface/index.js.map +7 -1
- package/build/components/editor-notices/index.js +74 -58
- package/build/components/editor-notices/index.js.map +7 -1
- package/build/components/editor-snackbars/index.js +40 -32
- package/build/components/editor-snackbars/index.js.map +7 -1
- package/build/components/entities-saved-states/entity-record-item.js +70 -70
- package/build/components/entities-saved-states/entity-record-item.js.map +7 -1
- package/build/components/entities-saved-states/entity-type-list.js +108 -78
- package/build/components/entities-saved-states/entity-type-list.js.map +7 -1
- package/build/components/entities-saved-states/hooks/use-is-dirty.js +62 -61
- package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +7 -1
- package/build/components/entities-saved-states/index.js +177 -161
- package/build/components/entities-saved-states/index.js.map +7 -1
- package/build/components/error-boundary/index.js +59 -85
- package/build/components/error-boundary/index.js.map +7 -1
- package/build/components/global-keyboard-shortcuts/index.js +58 -71
- package/build/components/global-keyboard-shortcuts/index.js.map +7 -1
- package/build/components/global-keyboard-shortcuts/register-shortcuts.js +106 -93
- package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +7 -1
- package/build/components/global-styles-provider/index.js +173 -146
- package/build/components/global-styles-provider/index.js.map +7 -1
- package/build/components/header/back-button.js +40 -26
- package/build/components/header/back-button.js.map +7 -1
- package/build/components/header/index.js +175 -162
- package/build/components/header/index.js.map +7 -1
- package/build/components/index.js +311 -780
- package/build/components/index.js.map +7 -1
- package/build/components/inserter-sidebar/index.js +62 -71
- package/build/components/inserter-sidebar/index.js.map +7 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +74 -70
- package/build/components/keyboard-shortcut-help-modal/config.js.map +7 -1
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +61 -43
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +7 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +165 -111
- package/build/components/keyboard-shortcut-help-modal/index.js.map +7 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +76 -55
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +7 -1
- package/build/components/list-view-sidebar/index.js +117 -121
- package/build/components/list-view-sidebar/index.js.map +7 -1
- package/build/components/list-view-sidebar/list-view-outline.js +56 -41
- package/build/components/list-view-sidebar/list-view-outline.js.map +7 -1
- package/build/components/local-autosave-monitor/index.js +118 -148
- package/build/components/local-autosave-monitor/index.js.map +7 -1
- package/build/components/media-categories/index.js +160 -144
- package/build/components/media-categories/index.js.map +7 -1
- package/build/components/mode-switcher/index.js +68 -63
- package/build/components/mode-switcher/index.js.map +7 -1
- package/build/components/more-menu/copy-content-menu-item.js +46 -43
- package/build/components/more-menu/copy-content-menu-item.js.map +7 -1
- package/build/components/more-menu/index.js +174 -119
- package/build/components/more-menu/index.js.map +7 -1
- package/build/components/more-menu/tools-more-menu-group.js +27 -21
- package/build/components/more-menu/tools-more-menu-group.js.map +7 -1
- package/build/components/more-menu/view-more-menu-group.js +30 -22
- package/build/components/more-menu/view-more-menu-group.js.map +7 -1
- package/build/components/page-attributes/check.js +37 -40
- package/build/components/page-attributes/check.js.map +7 -1
- package/build/components/page-attributes/order.js +66 -64
- package/build/components/page-attributes/order.js.map +7 -1
- package/build/components/page-attributes/panel.js +45 -43
- package/build/components/page-attributes/panel.js.map +7 -1
- package/build/components/page-attributes/parent.js +224 -207
- package/build/components/page-attributes/parent.js.map +7 -1
- package/build/components/pattern-duplicate-modal/index.js +58 -48
- package/build/components/pattern-duplicate-modal/index.js.map +7 -1
- package/build/components/pattern-overrides-panel/index.js +33 -23
- package/build/components/pattern-overrides-panel/index.js.map +7 -1
- package/build/components/pattern-rename-modal/index.js +51 -47
- package/build/components/pattern-rename-modal/index.js.map +7 -1
- package/build/components/plugin-document-setting-panel/index.js +74 -114
- package/build/components/plugin-document-setting-panel/index.js.map +7 -1
- package/build/components/plugin-more-menu-item/index.js +37 -78
- package/build/components/plugin-more-menu-item/index.js.map +7 -1
- package/build/components/plugin-post-publish-panel/index.js +37 -59
- package/build/components/plugin-post-publish-panel/index.js.map +7 -1
- package/build/components/plugin-post-status-info/index.js +27 -73
- package/build/components/plugin-post-status-info/index.js.map +7 -1
- package/build/components/plugin-pre-publish-panel/index.js +37 -62
- package/build/components/plugin-pre-publish-panel/index.js.map +7 -1
- package/build/components/plugin-preview-menu-item/index.js +37 -57
- package/build/components/plugin-preview-menu-item/index.js.map +7 -1
- package/build/components/plugin-sidebar/index.js +34 -86
- package/build/components/plugin-sidebar/index.js.map +7 -1
- package/build/components/plugin-sidebar-more-menu-item/index.js +33 -67
- package/build/components/plugin-sidebar-more-menu-item/index.js.map +7 -1
- package/build/components/post-actions/actions.js +111 -103
- package/build/components/post-actions/actions.js.map +7 -1
- package/build/components/post-actions/index.js +126 -131
- package/build/components/post-actions/index.js.map +7 -1
- package/build/components/post-actions/set-as-homepage.js +123 -123
- package/build/components/post-actions/set-as-homepage.js.map +7 -1
- package/build/components/post-actions/set-as-posts-page.js +118 -120
- package/build/components/post-actions/set-as-posts-page.js.map +7 -1
- package/build/components/post-author/check.js +41 -38
- package/build/components/post-author/check.js.map +7 -1
- package/build/components/post-author/combobox.js +50 -52
- package/build/components/post-author/combobox.js.map +7 -1
- package/build/components/post-author/constants.js +34 -10
- package/build/components/post-author/constants.js.map +7 -1
- package/build/components/post-author/hook.js +71 -71
- package/build/components/post-author/hook.js.map +7 -1
- package/build/components/post-author/index.js +43 -31
- package/build/components/post-author/index.js.map +7 -1
- package/build/components/post-author/panel.js +106 -95
- package/build/components/post-author/panel.js.map +7 -1
- package/build/components/post-author/select.js +45 -40
- package/build/components/post-author/select.js.map +7 -1
- package/build/components/post-card-panel/index.js +128 -113
- package/build/components/post-card-panel/index.js.map +7 -1
- package/build/components/post-comments/index.js +60 -55
- package/build/components/post-comments/index.js.map +7 -1
- package/build/components/post-content-information/index.js +64 -65
- package/build/components/post-content-information/index.js.map +7 -1
- package/build/components/post-discussion/panel.js +114 -128
- package/build/components/post-discussion/panel.js.map +7 -1
- package/build/components/post-excerpt/check.js +37 -27
- package/build/components/post-excerpt/check.js.map +7 -1
- package/build/components/post-excerpt/index.js +75 -71
- package/build/components/post-excerpt/index.js.map +7 -1
- package/build/components/post-excerpt/panel.js +152 -141
- package/build/components/post-excerpt/panel.js.map +7 -1
- package/build/components/post-excerpt/plugin.js +28 -70
- package/build/components/post-excerpt/plugin.js.map +7 -1
- package/build/components/post-featured-image/check.js +38 -32
- package/build/components/post-featured-image/check.js.map +7 -1
- package/build/components/post-featured-image/index.js +224 -211
- package/build/components/post-featured-image/index.js.map +7 -1
- package/build/components/post-featured-image/panel.js +55 -59
- package/build/components/post-featured-image/panel.js.map +7 -1
- package/build/components/post-fields/index.js +55 -56
- package/build/components/post-fields/index.js.map +7 -1
- package/build/components/post-format/check.js +42 -33
- package/build/components/post-format/check.js.map +7 -1
- package/build/components/post-format/index.js +100 -113
- package/build/components/post-format/index.js.map +7 -1
- package/build/components/post-format/panel.js +91 -82
- package/build/components/post-format/panel.js.map +7 -1
- package/build/components/post-last-edited-panel/index.js +38 -29
- package/build/components/post-last-edited-panel/index.js.map +7 -1
- package/build/components/post-last-revision/check.js +41 -41
- package/build/components/post-last-revision/check.js.map +7 -1
- package/build/components/post-last-revision/index.js +75 -66
- package/build/components/post-last-revision/index.js.map +7 -1
- package/build/components/post-last-revision/panel.js +39 -30
- package/build/components/post-last-revision/panel.js.map +7 -1
- package/build/components/post-locked-modal/index.js +148 -145
- package/build/components/post-locked-modal/index.js.map +7 -1
- package/build/components/post-panel-row/index.js +49 -35
- package/build/components/post-panel-row/index.js.map +7 -1
- package/build/components/post-panel-section/index.js +38 -26
- package/build/components/post-panel-section/index.js.map +7 -1
- package/build/components/post-pending-status/check.js +34 -40
- package/build/components/post-pending-status/check.js.map +7 -1
- package/build/components/post-pending-status/index.js +58 -41
- package/build/components/post-pending-status/index.js.map +7 -1
- package/build/components/post-pingbacks/index.js +52 -44
- package/build/components/post-pingbacks/index.js.map +7 -1
- package/build/components/post-preview-button/index.js +90 -120
- package/build/components/post-preview-button/index.js.map +7 -1
- package/build/components/post-publish-button/index.js +125 -137
- package/build/components/post-publish-button/index.js.map +7 -1
- package/build/components/post-publish-button/label.js +39 -40
- package/build/components/post-publish-button/label.js.map +7 -1
- package/build/components/post-publish-button/post-publish-button-or-toggle.js +62 -68
- package/build/components/post-publish-button/post-publish-button-or-toggle.js.map +7 -1
- package/build/components/post-publish-panel/index.js +136 -135
- package/build/components/post-publish-panel/index.js.map +7 -1
- package/build/components/post-publish-panel/maybe-category-panel.js +71 -67
- package/build/components/post-publish-panel/maybe-category-panel.js.map +7 -1
- package/build/components/post-publish-panel/maybe-post-format-panel.js +72 -63
- package/build/components/post-publish-panel/maybe-post-format-panel.js.map +7 -1
- package/build/components/post-publish-panel/maybe-tags-panel.js +86 -80
- package/build/components/post-publish-panel/maybe-tags-panel.js.map +7 -1
- package/build/components/post-publish-panel/maybe-upload-media.js +172 -214
- package/build/components/post-publish-panel/maybe-upload-media.js.map +7 -1
- package/build/components/post-publish-panel/media-util.js +63 -72
- package/build/components/post-publish-panel/media-util.js.map +7 -1
- package/build/components/post-publish-panel/postpublish.js +135 -130
- package/build/components/post-publish-panel/postpublish.js.map +7 -1
- package/build/components/post-publish-panel/prepublish.js +137 -103
- package/build/components/post-publish-panel/prepublish.js.map +7 -1
- package/build/components/post-saved-state/index.js +115 -131
- package/build/components/post-saved-state/index.js.map +7 -1
- package/build/components/post-schedule/check.js +27 -29
- package/build/components/post-schedule/check.js.map +7 -1
- package/build/components/post-schedule/index.js +96 -93
- package/build/components/post-schedule/index.js.map +7 -1
- package/build/components/post-schedule/label.js +79 -86
- package/build/components/post-schedule/label.js.map +7 -1
- package/build/components/post-schedule/panel.js +88 -73
- package/build/components/post-schedule/panel.js.map +7 -1
- package/build/components/post-status/index.js +238 -202
- package/build/components/post-status/index.js.map +7 -1
- package/build/components/post-sticky/check.js +30 -35
- package/build/components/post-sticky/check.js.map +7 -1
- package/build/components/post-sticky/index.js +50 -40
- package/build/components/post-sticky/index.js.map +7 -1
- package/build/components/post-sticky/panel.js +43 -21
- package/build/components/post-sticky/panel.js.map +7 -1
- package/build/components/post-switch-to-draft-button/index.js +80 -75
- package/build/components/post-switch-to-draft-button/index.js.map +7 -1
- package/build/components/post-sync-status/index.js +45 -44
- package/build/components/post-sync-status/index.js.map +7 -1
- package/build/components/post-taxonomies/check.js +36 -33
- package/build/components/post-taxonomies/check.js.map +7 -1
- package/build/components/post-taxonomies/flat-term-selector.js +189 -189
- package/build/components/post-taxonomies/flat-term-selector.js.map +7 -1
- package/build/components/post-taxonomies/hierarchical-term-selector.js +244 -280
- package/build/components/post-taxonomies/hierarchical-term-selector.js.map +7 -1
- package/build/components/post-taxonomies/index.js +68 -58
- package/build/components/post-taxonomies/index.js.map +7 -1
- package/build/components/post-taxonomies/most-used-terms.js +73 -56
- package/build/components/post-taxonomies/most-used-terms.js.map +7 -1
- package/build/components/post-taxonomies/panel.js +66 -69
- package/build/components/post-taxonomies/panel.js.map +7 -1
- package/build/components/post-template/block-theme.js +165 -123
- package/build/components/post-template/block-theme.js.map +7 -1
- package/build/components/post-template/classic-theme.js +193 -187
- package/build/components/post-template/classic-theme.js.map +7 -1
- package/build/components/post-template/create-new-template-modal.js +139 -110
- package/build/components/post-template/create-new-template-modal.js.map +7 -1
- package/build/components/post-template/create-new-template.js +65 -46
- package/build/components/post-template/create-new-template.js.map +7 -1
- package/build/components/post-template/hooks.js +116 -84
- package/build/components/post-template/hooks.js.map +7 -1
- package/build/components/post-template/panel.js +56 -52
- package/build/components/post-template/panel.js.map +7 -1
- package/build/components/post-template/reset-default-template.js +49 -43
- package/build/components/post-template/reset-default-template.js.map +7 -1
- package/build/components/post-template/swap-template-button.js +109 -91
- package/build/components/post-template/swap-template-button.js.map +7 -1
- package/build/components/post-text-editor/index.js +80 -81
- package/build/components/post-text-editor/index.js.map +7 -1
- package/build/components/post-title/constants.js +30 -7
- package/build/components/post-title/constants.js.map +7 -1
- package/build/components/post-title/index.js +99 -126
- package/build/components/post-title/index.js.map +7 -1
- package/build/components/post-title/post-title-raw.js +74 -78
- package/build/components/post-title/post-title-raw.js.map +7 -1
- package/build/components/post-title/use-post-title-focus.js +35 -52
- package/build/components/post-title/use-post-title-focus.js.map +7 -1
- package/build/components/post-title/use-post-title.js +30 -37
- package/build/components/post-title/use-post-title.js.map +7 -1
- package/build/components/post-transform-panel/hooks.js +70 -67
- package/build/components/post-transform-panel/hooks.js.map +7 -1
- package/build/components/post-transform-panel/index.js +69 -75
- package/build/components/post-transform-panel/index.js.map +7 -1
- package/build/components/post-trash/check.js +33 -42
- package/build/components/post-trash/check.js.map +7 -1
- package/build/components/post-trash/index.js +78 -67
- package/build/components/post-trash/index.js.map +7 -1
- package/build/components/post-type-support-check/index.js +34 -47
- package/build/components/post-type-support-check/index.js.map +7 -1
- package/build/components/post-url/check.js +31 -32
- package/build/components/post-url/check.js.map +7 -1
- package/build/components/post-url/index.js +155 -156
- package/build/components/post-url/index.js.map +7 -1
- package/build/components/post-url/label.js +35 -30
- package/build/components/post-url/label.js.map +7 -1
- package/build/components/post-url/panel.js +111 -112
- package/build/components/post-url/panel.js.map +7 -1
- package/build/components/post-view-link/index.js +48 -47
- package/build/components/post-view-link/index.js.map +7 -1
- package/build/components/post-visibility/check.js +28 -33
- package/build/components/post-visibility/check.js.map +7 -1
- package/build/components/post-visibility/index.js +83 -84
- package/build/components/post-visibility/index.js.map +7 -1
- package/build/components/post-visibility/label.js +35 -30
- package/build/components/post-visibility/label.js.map +7 -1
- package/build/components/post-visibility/utils.js +44 -23
- package/build/components/post-visibility/utils.js.map +7 -1
- package/build/components/posts-per-page/index.js +110 -98
- package/build/components/posts-per-page/index.js.map +7 -1
- package/build/components/preferences-modal/enable-panel.js +47 -42
- package/build/components/preferences-modal/enable-panel.js.map +7 -1
- package/build/components/preferences-modal/enable-plugin-document-setting-panel.js +40 -31
- package/build/components/preferences-modal/enable-plugin-document-setting-panel.js.map +7 -1
- package/build/components/preferences-modal/enable-publish-sidebar.js +39 -32
- package/build/components/preferences-modal/enable-publish-sidebar.js.map +7 -1
- package/build/components/preferences-modal/index.js +391 -231
- package/build/components/preferences-modal/index.js.map +7 -1
- package/build/components/preview-dropdown/index.js +165 -151
- package/build/components/preview-dropdown/index.js.map +7 -1
- package/build/components/provider/disable-non-page-content-blocks.js +67 -82
- package/build/components/provider/disable-non-page-content-blocks.js.map +7 -1
- package/build/components/provider/index.js +283 -325
- package/build/components/provider/index.js.map +7 -1
- package/build/components/provider/navigation-block-editing-mode.js +32 -29
- package/build/components/provider/navigation-block-editing-mode.js.map +7 -1
- package/build/components/provider/use-auto-switch-editor-sidebars.js +48 -39
- package/build/components/provider/use-auto-switch-editor-sidebars.js.map +7 -1
- package/build/components/provider/use-block-editor-settings.js +249 -178
- package/build/components/provider/use-block-editor-settings.js.map +7 -1
- package/build/components/provider/use-hide-blocks-from-inserter.js +87 -46
- package/build/components/provider/use-hide-blocks-from-inserter.js.map +7 -1
- package/build/components/provider/use-post-content-blocks.js +48 -29
- package/build/components/provider/use-post-content-blocks.js.map +7 -1
- package/build/components/provider/with-registry-provider.js +52 -46
- package/build/components/provider/with-registry-provider.js.map +7 -1
- package/build/components/resizable-editor/index.js +99 -86
- package/build/components/resizable-editor/index.js.map +7 -1
- package/build/components/resizable-editor/resize-handle.js +42 -36
- package/build/components/resizable-editor/resize-handle.js.map +7 -1
- package/build/components/save-publish-panels/index.js +88 -69
- package/build/components/save-publish-panels/index.js.map +7 -1
- package/build/components/sidebar/constants.js +29 -8
- package/build/components/sidebar/constants.js.map +7 -1
- package/build/components/sidebar/header.js +56 -50
- package/build/components/sidebar/header.js.map +7 -1
- package/build/components/sidebar/index.js +156 -136
- package/build/components/sidebar/index.js.map +7 -1
- package/build/components/sidebar/post-summary.js +114 -91
- package/build/components/sidebar/post-summary.js.map +7 -1
- package/build/components/site-discussion/index.js +132 -113
- package/build/components/site-discussion/index.js.map +7 -1
- package/build/components/start-page-options/index.js +136 -146
- package/build/components/start-page-options/index.js.map +7 -1
- package/build/components/start-template-options/index.js +168 -157
- package/build/components/start-template-options/index.js.map +7 -1
- package/build/components/table-of-contents/index.js +78 -69
- package/build/components/table-of-contents/index.js.map +7 -1
- package/build/components/table-of-contents/panel.js +101 -94
- package/build/components/table-of-contents/panel.js.map +7 -1
- package/build/components/template-content-panel/index.js +74 -58
- package/build/components/template-content-panel/index.js.map +7 -1
- package/build/components/template-part-content-panel/index.js +51 -54
- package/build/components/template-part-content-panel/index.js.map +7 -1
- package/build/components/template-part-menu-items/convert-to-regular.js +44 -32
- package/build/components/template-part-menu-items/convert-to-regular.js.map +7 -1
- package/build/components/template-part-menu-items/convert-to-template-part.js +76 -68
- package/build/components/template-part-menu-items/convert-to-template-part.js.map +7 -1
- package/build/components/template-part-menu-items/index.js +62 -52
- package/build/components/template-part-menu-items/index.js.map +7 -1
- package/build/components/template-validation-notice/index.js +71 -47
- package/build/components/template-validation-notice/index.js.map +7 -1
- package/build/components/text-editor/index.js +68 -62
- package/build/components/text-editor/index.js.map +7 -1
- package/build/components/theme-support-check/index.js +32 -43
- package/build/components/theme-support-check/index.js.map +7 -1
- package/build/components/time-to-read/index.js +54 -51
- package/build/components/time-to-read/index.js.map +7 -1
- package/build/components/unsaved-changes-warning/index.js +34 -38
- package/build/components/unsaved-changes-warning/index.js.map +7 -1
- package/build/components/visual-editor/edit-template-blocks-notification.js +64 -68
- package/build/components/visual-editor/edit-template-blocks-notification.js.map +7 -1
- package/build/components/visual-editor/index.js +286 -247
- package/build/components/visual-editor/index.js.map +7 -1
- package/build/components/visual-editor/use-select-nearest-editable-block.js +75 -68
- package/build/components/visual-editor/use-select-nearest-editable-block.js.map +7 -1
- package/build/components/visual-editor/use-zoom-out-mode-exit.js +52 -46
- package/build/components/visual-editor/use-zoom-out-mode-exit.js.map +7 -1
- package/build/components/word-count/index.js +34 -35
- package/build/components/word-count/index.js.map +7 -1
- package/build/components/zoom-out-toggle/index.js +88 -72
- package/build/components/zoom-out-toggle/index.js.map +7 -1
- package/build/dataviews/api.js +47 -80
- package/build/dataviews/api.js.map +7 -1
- package/build/dataviews/fields/content-preview/content-preview-view.js +81 -89
- package/build/dataviews/fields/content-preview/content-preview-view.js.map +7 -1
- package/build/dataviews/fields/content-preview/index.js +39 -21
- package/build/dataviews/fields/content-preview/index.js.map +7 -1
- package/build/dataviews/store/private-actions.js +122 -56
- package/build/dataviews/store/private-actions.js.map +7 -1
- package/build/dataviews/store/private-selectors.js +32 -15
- package/build/dataviews/store/private-selectors.js.map +7 -1
- package/build/dataviews/store/reducer.js +50 -31
- package/build/dataviews/store/reducer.js.map +7 -1
- package/build/hooks/custom-sources-backwards-compatibility.js +70 -83
- package/build/hooks/custom-sources-backwards-compatibility.js.map +7 -1
- package/build/hooks/default-autocompleters.js +9 -17
- package/build/hooks/default-autocompleters.js.map +7 -1
- package/build/hooks/index.js +7 -7
- package/build/hooks/index.js.map +7 -1
- package/build/hooks/media-upload.js +8 -9
- package/build/hooks/media-upload.js.map +7 -1
- package/build/hooks/navigation-link-view-button.js +44 -66
- package/build/hooks/navigation-link-view-button.js.map +7 -1
- package/build/hooks/pattern-overrides.js +51 -70
- package/build/hooks/pattern-overrides.js.map +7 -1
- package/build/hooks/template-part-navigation-edit-button.js +91 -0
- package/build/hooks/template-part-navigation-edit-button.js.map +7 -0
- package/build/index.js +41 -77
- package/build/index.js.map +7 -1
- package/build/lock-unlock.js +31 -14
- package/build/lock-unlock.js.map +7 -1
- package/build/private-apis.js +76 -59
- package/build/private-apis.js.map +7 -1
- package/build/store/actions.js +516 -931
- package/build/store/actions.js.map +7 -1
- package/build/store/constants.js +70 -31
- package/build/store/constants.js.map +7 -1
- package/build/store/defaults.js +31 -33
- package/build/store/defaults.js.map +7 -1
- package/build/store/index.js +52 -41
- package/build/store/index.js.map +7 -1
- package/build/store/local-autosave.js +39 -27
- package/build/store/local-autosave.js.map +7 -1
- package/build/store/private-actions.js +290 -299
- package/build/store/private-actions.js.map +7 -1
- package/build/store/private-selectors.js +189 -188
- package/build/store/private-selectors.js.map +7 -1
- package/build/store/reducer.js +128 -280
- package/build/store/reducer.js.map +7 -1
- package/build/store/selectors.js +819 -1470
- package/build/store/selectors.js.map +7 -1
- package/build/store/utils/is-template-revertable.js +24 -19
- package/build/store/utils/is-template-revertable.js.map +7 -1
- package/build/store/utils/notice-builder.js +73 -94
- package/build/store/utils/notice-builder.js.map +7 -1
- package/build/utils/get-item-title.js +34 -25
- package/build/utils/get-item-title.js.map +7 -1
- package/build/utils/get-template-info.js +37 -46
- package/build/utils/get-template-info.js.map +7 -1
- package/build/utils/get-template-part-icon.js +34 -24
- package/build/utils/get-template-part-icon.js.map +7 -1
- package/build/utils/index.js +41 -24
- package/build/utils/index.js.map +7 -1
- package/build/utils/media-sideload/index.js +26 -19
- package/build/utils/media-sideload/index.js.map +7 -1
- package/build/utils/media-upload/index.js +46 -63
- package/build/utils/media-upload/index.js.map +7 -1
- package/build/utils/pageTypeBadge.js +33 -31
- package/build/utils/pageTypeBadge.js.map +7 -1
- package/build/utils/search-templates.js +45 -47
- package/build/utils/search-templates.js.map +7 -1
- package/build/utils/terms.js +57 -63
- package/build/utils/terms.js.map +7 -1
- package/build/utils/url.js +43 -33
- package/build/utils/url.js.map +7 -1
- package/build-module/bindings/api.js +11 -26
- package/build-module/bindings/api.js.map +7 -1
- package/build-module/bindings/entity.js +58 -0
- package/build-module/bindings/entity.js.map +7 -0
- package/build-module/bindings/pattern-overrides.js +39 -59
- package/build-module/bindings/pattern-overrides.js.map +7 -1
- package/build-module/bindings/post-data.js +53 -87
- package/build-module/bindings/post-data.js.map +7 -1
- package/build-module/bindings/post-meta.js +55 -101
- package/build-module/bindings/post-meta.js.map +7 -1
- package/build-module/components/autocompleters/index.js +5 -2
- package/build-module/components/autocompleters/index.js.map +7 -1
- package/build-module/components/autocompleters/user.js +45 -49
- package/build-module/components/autocompleters/user.js.map +7 -1
- package/build-module/components/autosave-monitor/index.js +37 -67
- package/build-module/components/autosave-monitor/index.js.map +7 -1
- package/build-module/components/block-removal-warnings/index.js +64 -54
- package/build-module/components/block-removal-warnings/index.js.map +7 -1
- package/build-module/components/block-settings-menu/content-only-settings-menu.js +136 -113
- package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +7 -1
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +23 -93
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +7 -1
- package/build-module/components/block-visibility/index.js +103 -0
- package/build-module/components/block-visibility/index.js.map +7 -0
- package/build-module/components/blog-title/index.js +102 -101
- package/build-module/components/blog-title/index.js.map +7 -1
- package/build-module/components/character-count/index.js +13 -20
- package/build-module/components/character-count/index.js.map +7 -1
- package/build-module/components/collab-sidebar/add-comment.js +64 -66
- package/build-module/components/collab-sidebar/add-comment.js.map +7 -1
- package/build-module/components/collab-sidebar/comment-author-info.js +55 -77
- package/build-module/components/collab-sidebar/comment-author-info.js.map +7 -1
- package/build-module/components/collab-sidebar/comment-form.js +68 -75
- package/build-module/components/collab-sidebar/comment-form.js.map +7 -1
- package/build-module/components/collab-sidebar/comment-indicator-toolbar.js +67 -76
- package/build-module/components/collab-sidebar/comment-indicator-toolbar.js.map +7 -1
- package/build-module/components/collab-sidebar/comment-menu-item.js +26 -0
- package/build-module/components/collab-sidebar/comment-menu-item.js.map +7 -0
- package/build-module/components/collab-sidebar/comments.js +521 -309
- package/build-module/components/collab-sidebar/comments.js.map +7 -1
- package/build-module/components/collab-sidebar/constants.js +7 -3
- package/build-module/components/collab-sidebar/constants.js.map +7 -1
- package/build-module/components/collab-sidebar/hooks.js +301 -54
- package/build-module/components/collab-sidebar/hooks.js.map +7 -1
- package/build-module/components/collab-sidebar/index.js +158 -245
- package/build-module/components/collab-sidebar/index.js.map +7 -1
- package/build-module/components/collab-sidebar/utils.js +71 -76
- package/build-module/components/collab-sidebar/utils.js.map +7 -1
- package/build-module/components/collapsible-block-toolbar/index.js +44 -52
- package/build-module/components/collapsible-block-toolbar/index.js.map +7 -1
- package/build-module/components/commands/index.js +188 -241
- package/build-module/components/commands/index.js.map +7 -1
- package/build-module/components/deprecated.js +297 -237
- package/build-module/components/deprecated.js.map +7 -1
- package/build-module/components/document-bar/index.js +114 -141
- package/build-module/components/document-bar/index.js.map +7 -1
- package/build-module/components/document-outline/check.js +10 -23
- package/build-module/components/document-outline/check.js.map +7 -1
- package/build-module/components/document-outline/index.js +141 -203
- package/build-module/components/document-outline/index.js.map +7 -1
- package/build-module/components/document-outline/item.js +40 -29
- package/build-module/components/document-outline/item.js.map +7 -1
- package/build-module/components/document-tools/index.js +115 -125
- package/build-module/components/document-tools/index.js.map +7 -1
- package/build-module/components/editor/index.js +71 -57
- package/build-module/components/editor/index.js.map +7 -1
- package/build-module/components/editor-history/redo.js +33 -49
- package/build-module/components/editor-history/redo.js.map +7 -1
- package/build-module/components/editor-history/undo.js +32 -48
- package/build-module/components/editor-history/undo.js.map +7 -1
- package/build-module/components/editor-interface/content-slot-fill.js +9 -7
- package/build-module/components/editor-interface/content-slot-fill.js.map +7 -1
- package/build-module/components/editor-interface/index.js +111 -118
- package/build-module/components/editor-interface/index.js.map +7 -1
- package/build-module/components/editor-notices/index.js +43 -53
- package/build-module/components/editor-notices/index.js.map +7 -1
- package/build-module/components/editor-snackbars/index.js +23 -29
- package/build-module/components/editor-snackbars/index.js.map +7 -1
- package/build-module/components/entities-saved-states/entity-record-item.js +52 -65
- package/build-module/components/entities-saved-states/entity-record-item.js.map +7 -1
- package/build-module/components/entities-saved-states/entity-type-list.js +81 -73
- package/build-module/components/entities-saved-states/entity-type-list.js.map +7 -1
- package/build-module/components/entities-saved-states/hooks/use-is-dirty.js +39 -55
- package/build-module/components/entities-saved-states/hooks/use-is-dirty.js.map +7 -1
- package/build-module/components/entities-saved-states/index.js +150 -152
- package/build-module/components/entities-saved-states/index.js.map +7 -1
- package/build-module/components/error-boundary/index.js +42 -77
- package/build-module/components/error-boundary/index.js.map +7 -1
- package/build-module/components/global-keyboard-shortcuts/index.js +39 -66
- package/build-module/components/global-keyboard-shortcuts/index.js.map +7 -1
- package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +86 -88
- package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +7 -1
- package/build-module/components/global-styles-provider/index.js +135 -134
- package/build-module/components/global-styles-provider/index.js.map +7 -1
- package/build-module/components/header/back-button.js +20 -20
- package/build-module/components/header/back-button.js.map +7 -1
- package/build-module/components/header/index.js +148 -151
- package/build-module/components/header/index.js.map +7 -1
- package/build-module/components/index.js +192 -118
- package/build-module/components/index.js.map +7 -1
- package/build-module/components/inserter-sidebar/index.js +45 -64
- package/build-module/components/inserter-sidebar/index.js.map +7 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js +62 -75
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +7 -1
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +33 -37
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +7 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +140 -105
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +7 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +58 -50
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +7 -1
- package/build-module/components/list-view-sidebar/index.js +86 -109
- package/build-module/components/list-view-sidebar/index.js.map +7 -1
- package/build-module/components/list-view-sidebar/list-view-outline.js +29 -36
- package/build-module/components/list-view-sidebar/list-view-outline.js.map +7 -1
- package/build-module/components/local-autosave-monitor/index.js +81 -130
- package/build-module/components/local-autosave-monitor/index.js.map +7 -1
- package/build-module/components/media-categories/index.js +139 -137
- package/build-module/components/media-categories/index.js.map +7 -1
- package/build-module/components/mode-switcher/index.js +50 -60
- package/build-module/components/mode-switcher/index.js.map +7 -1
- package/build-module/components/more-menu/copy-content-menu-item.js +27 -37
- package/build-module/components/more-menu/copy-content-menu-item.js.map +7 -1
- package/build-module/components/more-menu/index.js +154 -113
- package/build-module/components/more-menu/index.js.map +7 -1
- package/build-module/components/more-menu/tools-more-menu-group.js +9 -16
- package/build-module/components/more-menu/tools-more-menu-group.js.map +7 -1
- package/build-module/components/more-menu/view-more-menu-group.js +12 -17
- package/build-module/components/more-menu/view-more-menu-group.js.map +7 -1
- package/build-module/components/page-attributes/check.js +15 -35
- package/build-module/components/page-attributes/check.js.map +7 -1
- package/build-module/components/page-attributes/order.js +42 -58
- package/build-module/components/page-attributes/order.js.map +7 -1
- package/build-module/components/page-attributes/panel.js +18 -37
- package/build-module/components/page-attributes/panel.js.map +7 -1
- package/build-module/components/page-attributes/parent.js +198 -197
- package/build-module/components/page-attributes/parent.js.map +7 -1
- package/build-module/components/pattern-duplicate-modal/index.js +36 -42
- package/build-module/components/pattern-duplicate-modal/index.js.map +7 -1
- package/build-module/components/pattern-overrides-panel/index.js +16 -19
- package/build-module/components/pattern-overrides-panel/index.js.map +7 -1
- package/build-module/components/pattern-rename-modal/index.js +29 -41
- package/build-module/components/pattern-rename-modal/index.js.map +7 -1
- package/build-module/components/plugin-document-setting-panel/index.js +46 -108
- package/build-module/components/plugin-document-setting-panel/index.js.map +7 -1
- package/build-module/components/plugin-more-menu-item/index.js +18 -74
- package/build-module/components/plugin-more-menu-item/index.js.map +7 -1
- package/build-module/components/plugin-post-publish-panel/index.js +19 -54
- package/build-module/components/plugin-post-publish-panel/index.js.map +7 -1
- package/build-module/components/plugin-post-status-info/index.js +9 -68
- package/build-module/components/plugin-post-status-info/index.js.map +7 -1
- package/build-module/components/plugin-pre-publish-panel/index.js +19 -57
- package/build-module/components/plugin-pre-publish-panel/index.js.map +7 -1
- package/build-module/components/plugin-preview-menu-item/index.js +18 -53
- package/build-module/components/plugin-preview-menu-item/index.js.map +7 -1
- package/build-module/components/plugin-sidebar/index.js +16 -83
- package/build-module/components/plugin-sidebar/index.js.map +7 -1
- package/build-module/components/plugin-sidebar-more-menu-item/index.js +15 -64
- package/build-module/components/plugin-sidebar-more-menu-item/index.js.map +7 -1
- package/build-module/components/post-actions/actions.js +85 -94
- package/build-module/components/post-actions/actions.js.map +7 -1
- package/build-module/components/post-actions/index.js +104 -121
- package/build-module/components/post-actions/index.js.map +7 -1
- package/build-module/components/post-actions/set-as-homepage.js +104 -115
- package/build-module/components/post-actions/set-as-homepage.js.map +7 -1
- package/build-module/components/post-actions/set-as-posts-page.js +99 -112
- package/build-module/components/post-actions/set-as-posts-page.js.map +7 -1
- package/build-module/components/post-author/check.js +12 -33
- package/build-module/components/post-author/check.js.map +7 -1
- package/build-module/components/post-author/combobox.js +32 -47
- package/build-module/components/post-author/combobox.js.map +7 -1
- package/build-module/components/post-author/constants.js +11 -6
- package/build-module/components/post-author/constants.js.map +7 -1
- package/build-module/components/post-author/hook.js +48 -65
- package/build-module/components/post-author/hook.js.map +7 -1
- package/build-module/components/post-author/index.js +14 -24
- package/build-module/components/post-author/index.js.map +7 -1
- package/build-module/components/post-author/panel.js +73 -87
- package/build-module/components/post-author/panel.js.map +7 -1
- package/build-module/components/post-author/select.js +28 -36
- package/build-module/components/post-author/select.js.map +7 -1
- package/build-module/components/post-card-panel/index.js +107 -105
- package/build-module/components/post-card-panel/index.js.map +7 -1
- package/build-module/components/post-comments/index.js +45 -50
- package/build-module/components/post-comments/index.js.map +7 -1
- package/build-module/components/post-content-information/index.js +49 -61
- package/build-module/components/post-content-information/index.js.map +7 -1
- package/build-module/components/post-discussion/panel.js +90 -122
- package/build-module/components/post-discussion/panel.js.map +7 -1
- package/build-module/components/post-excerpt/check.js +9 -23
- package/build-module/components/post-excerpt/check.js.map +7 -1
- package/build-module/components/post-excerpt/index.js +57 -68
- package/build-module/components/post-excerpt/index.js.map +7 -1
- package/build-module/components/post-excerpt/panel.js +124 -134
- package/build-module/components/post-excerpt/panel.js.map +7 -1
- package/build-module/components/post-excerpt/plugin.js +10 -65
- package/build-module/components/post-excerpt/plugin.js.map +7 -1
- package/build-module/components/post-featured-image/check.js +10 -28
- package/build-module/components/post-featured-image/check.js.map +7 -1
- package/build-module/components/post-featured-image/index.js +203 -200
- package/build-module/components/post-featured-image/index.js.map +7 -1
- package/build-module/components/post-featured-image/panel.js +26 -52
- package/build-module/components/post-featured-image/panel.js.map +7 -1
- package/build-module/components/post-fields/index.js +36 -49
- package/build-module/components/post-fields/index.js.map +7 -1
- package/build-module/components/post-format/check.js +14 -29
- package/build-module/components/post-format/check.js.map +7 -1
- package/build-module/components/post-format/index.js +68 -107
- package/build-module/components/post-format/index.js.map +7 -1
- package/build-module/components/post-format/panel.js +60 -73
- package/build-module/components/post-format/panel.js.map +7 -1
- package/build-module/components/post-last-edited-panel/index.js +20 -24
- package/build-module/components/post-last-edited-panel/index.js.map +7 -1
- package/build-module/components/post-last-revision/check.js +13 -37
- package/build-module/components/post-last-revision/check.js.map +7 -1
- package/build-module/components/post-last-revision/index.js +43 -59
- package/build-module/components/post-last-revision/index.js.map +7 -1
- package/build-module/components/post-last-revision/panel.js +10 -25
- package/build-module/components/post-last-revision/panel.js.map +7 -1
- package/build-module/components/post-locked-modal/index.js +133 -137
- package/build-module/components/post-locked-modal/index.js.map +7 -1
- package/build-module/components/post-panel-row/index.js +21 -29
- package/build-module/components/post-panel-row/index.js.map +7 -1
- package/build-module/components/post-panel-section/index.js +10 -20
- package/build-module/components/post-panel-section/index.js.map +7 -1
- package/build-module/components/post-pending-status/check.js +12 -35
- package/build-module/components/post-pending-status/check.js.map +7 -1
- package/build-module/components/post-pending-status/index.js +27 -36
- package/build-module/components/post-pending-status/index.js.map +7 -1
- package/build-module/components/post-pingbacks/index.js +34 -39
- package/build-module/components/post-pingbacks/index.js.map +7 -1
- package/build-module/components/post-preview-button/index.js +71 -114
- package/build-module/components/post-preview-button/index.js.map +7 -1
- package/build-module/components/post-publish-button/index.js +93 -130
- package/build-module/components/post-publish-button/index.js.map +7 -1
- package/build-module/components/post-publish-button/label.js +20 -35
- package/build-module/components/post-publish-button/label.js.map +7 -1
- package/build-module/components/post-publish-button/post-publish-button-or-toggle.js +28 -56
- package/build-module/components/post-publish-button/post-publish-button-or-toggle.js.map +7 -1
- package/build-module/components/post-publish-panel/index.js +108 -126
- package/build-module/components/post-publish-panel/index.js.map +7 -1
- package/build-module/components/post-publish-panel/maybe-category-panel.js +40 -58
- package/build-module/components/post-publish-panel/maybe-category-panel.js.map +7 -1
- package/build-module/components/post-publish-panel/maybe-post-format-panel.js +55 -59
- package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +7 -1
- package/build-module/components/post-publish-panel/maybe-tags-panel.js +57 -73
- package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +7 -1
- package/build-module/components/post-publish-panel/maybe-upload-media.js +158 -207
- package/build-module/components/post-publish-panel/maybe-upload-media.js.map +7 -1
- package/build-module/components/post-publish-panel/media-util.js +42 -69
- package/build-module/components/post-publish-panel/media-util.js.map +7 -1
- package/build-module/components/post-publish-panel/postpublish.js +109 -120
- package/build-module/components/post-publish-panel/postpublish.js.map +7 -1
- package/build-module/components/post-publish-panel/prepublish.js +108 -96
- package/build-module/components/post-publish-panel/prepublish.js.map +7 -1
- package/build-module/components/post-saved-state/index.js +87 -124
- package/build-module/components/post-saved-state/index.js.map +7 -1
- package/build-module/components/post-schedule/check.js +9 -25
- package/build-module/components/post-schedule/check.js.map +7 -1
- package/build-module/components/post-schedule/index.js +75 -88
- package/build-module/components/post-schedule/index.js.map +7 -1
- package/build-module/components/post-schedule/label.js +49 -73
- package/build-module/components/post-schedule/label.js.map +7 -1
- package/build-module/components/post-schedule/panel.js +63 -65
- package/build-module/components/post-schedule/panel.js.map +7 -1
- package/build-module/components/post-status/index.js +223 -194
- package/build-module/components/post-status/index.js.map +7 -1
- package/build-module/components/post-sticky/check.js +10 -29
- package/build-module/components/post-sticky/check.js.map +7 -1
- package/build-module/components/post-sticky/index.js +22 -36
- package/build-module/components/post-sticky/index.js.map +7 -1
- package/build-module/components/post-sticky/panel.js +12 -15
- package/build-module/components/post-sticky/panel.js.map +7 -1
- package/build-module/components/post-switch-to-draft-button/index.js +54 -70
- package/build-module/components/post-switch-to-draft-button/index.js.map +7 -1
- package/build-module/components/post-sync-status/index.js +17 -40
- package/build-module/components/post-sync-status/index.js.map +7 -1
- package/build-module/components/post-taxonomies/check.js +17 -28
- package/build-module/components/post-taxonomies/check.js.map +7 -1
- package/build-module/components/post-taxonomies/flat-term-selector.js +154 -177
- package/build-module/components/post-taxonomies/flat-term-selector.js.map +7 -1
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js +232 -270
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +7 -1
- package/build-module/components/post-taxonomies/index.js +34 -49
- package/build-module/components/post-taxonomies/index.js.map +7 -1
- package/build-module/components/post-taxonomies/most-used-terms.js +54 -50
- package/build-module/components/post-taxonomies/most-used-terms.js.map +7 -1
- package/build-module/components/post-taxonomies/panel.js +39 -66
- package/build-module/components/post-taxonomies/panel.js.map +7 -1
- package/build-module/components/post-template/block-theme.js +134 -114
- package/build-module/components/post-template/block-theme.js.map +7 -1
- package/build-module/components/post-template/classic-theme.js +161 -177
- package/build-module/components/post-template/classic-theme.js.map +7 -1
- package/build-module/components/post-template/create-new-template-modal.js +126 -104
- package/build-module/components/post-template/create-new-template-modal.js.map +7 -1
- package/build-module/components/post-template/create-new-template.js +36 -39
- package/build-module/components/post-template/create-new-template.js.map +7 -1
- package/build-module/components/post-template/hooks.js +95 -80
- package/build-module/components/post-template/hooks.js.map +7 -1
- package/build-module/components/post-template/panel.js +25 -45
- package/build-module/components/post-template/panel.js.map +7 -1
- package/build-module/components/post-template/reset-default-template.js +33 -36
- package/build-module/components/post-template/reset-default-template.js.map +7 -1
- package/build-module/components/post-template/swap-template-button.js +86 -81
- package/build-module/components/post-template/swap-template-button.js.map +7 -1
- package/build-module/components/post-text-editor/index.js +49 -74
- package/build-module/components/post-text-editor/index.js.map +7 -1
- package/build-module/components/post-title/constants.js +7 -3
- package/build-module/components/post-title/constants.js.map +7 -1
- package/build-module/components/post-title/index.js +67 -111
- package/build-module/components/post-title/index.js.map +7 -1
- package/build-module/components/post-title/post-title-raw.js +43 -71
- package/build-module/components/post-title/post-title-raw.js.map +7 -1
- package/build-module/components/post-title/use-post-title-focus.js +15 -46
- package/build-module/components/post-title/use-post-title-focus.js.map +7 -1
- package/build-module/components/post-title/use-post-title.js +13 -33
- package/build-module/components/post-title/use-post-title.js.map +7 -1
- package/build-module/components/post-transform-panel/hooks.js +44 -58
- package/build-module/components/post-transform-panel/hooks.js.map +7 -1
- package/build-module/components/post-transform-panel/index.js +53 -69
- package/build-module/components/post-transform-panel/index.js.map +7 -1
- package/build-module/components/post-trash/check.js +14 -37
- package/build-module/components/post-trash/check.js.map +7 -1
- package/build-module/components/post-trash/index.js +49 -59
- package/build-module/components/post-trash/index.js.map +7 -1
- package/build-module/components/post-type-support-check/index.js +16 -42
- package/build-module/components/post-type-support-check/index.js.map +7 -1
- package/build-module/components/post-url/check.js +9 -24
- package/build-module/components/post-url/check.js.map +7 -1
- package/build-module/components/post-url/index.js +137 -146
- package/build-module/components/post-url/index.js.map +7 -1
- package/build-module/components/post-url/label.js +14 -26
- package/build-module/components/post-url/label.js.map +7 -1
- package/build-module/components/post-url/panel.js +80 -105
- package/build-module/components/post-url/panel.js.map +7 -1
- package/build-module/components/post-view-link/index.js +27 -39
- package/build-module/components/post-view-link/index.js.map +7 -1
- package/build-module/components/post-visibility/check.js +10 -29
- package/build-module/components/post-visibility/check.js.map +7 -1
- package/build-module/components/post-visibility/index.js +66 -78
- package/build-module/components/post-visibility/index.js.map +7 -1
- package/build-module/components/post-visibility/label.js +15 -27
- package/build-module/components/post-visibility/label.js.map +7 -1
- package/build-module/components/post-visibility/utils.js +22 -18
- package/build-module/components/post-visibility/utils.js.map +7 -1
- package/build-module/components/posts-per-page/index.js +85 -91
- package/build-module/components/posts-per-page/index.js.map +7 -1
- package/build-module/components/preferences-modal/enable-panel.js +30 -38
- package/build-module/components/preferences-modal/enable-panel.js.map +7 -1
- package/build-module/components/preferences-modal/enable-plugin-document-setting-panel.js +12 -25
- package/build-module/components/preferences-modal/enable-plugin-document-setting-panel.js.map +7 -1
- package/build-module/components/preferences-modal/enable-publish-sidebar.js +21 -27
- package/build-module/components/preferences-modal/enable-publish-sidebar.js.map +7 -1
- package/build-module/components/preferences-modal/index.js +365 -225
- package/build-module/components/preferences-modal/index.js.map +7 -1
- package/build-module/components/preview-dropdown/index.js +140 -141
- package/build-module/components/preview-dropdown/index.js.map +7 -1
- package/build-module/components/provider/disable-non-page-content-blocks.js +34 -72
- package/build-module/components/provider/disable-non-page-content-blocks.js.map +7 -1
- package/build-module/components/provider/index.js +257 -317
- package/build-module/components/provider/index.js.map +7 -1
- package/build-module/components/provider/navigation-block-editing-mode.js +14 -25
- package/build-module/components/provider/navigation-block-editing-mode.js.map +7 -1
- package/build-module/components/provider/use-auto-switch-editor-sidebars.js +28 -33
- package/build-module/components/provider/use-auto-switch-editor-sidebars.js.map +7 -1
- package/build-module/components/provider/use-block-editor-settings.js +223 -166
- package/build-module/components/provider/use-block-editor-settings.js.map +7 -1
- package/build-module/components/provider/use-hide-blocks-from-inserter.js +65 -42
- package/build-module/components/provider/use-hide-blocks-from-inserter.js.map +7 -1
- package/build-module/components/provider/use-post-content-blocks.js +31 -25
- package/build-module/components/provider/use-post-content-blocks.js.map +7 -1
- package/build-module/components/provider/with-registry-provider.js +34 -41
- package/build-module/components/provider/with-registry-provider.js.map +7 -1
- package/build-module/components/resizable-editor/index.js +70 -80
- package/build-module/components/resizable-editor/index.js.map +7 -1
- package/build-module/components/resizable-editor/resize-handle.js +27 -30
- package/build-module/components/resizable-editor/resize-handle.js.map +7 -1
- package/build-module/components/save-publish-panels/index.js +56 -62
- package/build-module/components/save-publish-panels/index.js.map +7 -1
- package/build-module/components/sidebar/constants.js +7 -4
- package/build-module/components/sidebar/constants.js.map +7 -1
- package/build-module/components/sidebar/header.js +38 -45
- package/build-module/components/sidebar/header.js.map +7 -1
- package/build-module/components/sidebar/index.js +136 -125
- package/build-module/components/sidebar/index.js.map +7 -1
- package/build-module/components/sidebar/post-summary.js +86 -87
- package/build-module/components/sidebar/post-summary.js.map +7 -1
- package/build-module/components/site-discussion/index.js +110 -107
- package/build-module/components/site-discussion/index.js.map +7 -1
- package/build-module/components/start-page-options/index.js +114 -137
- package/build-module/components/start-page-options/index.js.map +7 -1
- package/build-module/components/start-template-options/index.js +148 -150
- package/build-module/components/start-template-options/index.js.map +7 -1
- package/build-module/components/table-of-contents/index.js +50 -63
- package/build-module/components/table-of-contents/index.js.map +7 -1
- package/build-module/components/table-of-contents/panel.js +73 -88
- package/build-module/components/table-of-contents/panel.js.map +7 -1
- package/build-module/components/template-content-panel/index.js +57 -54
- package/build-module/components/template-content-panel/index.js.map +7 -1
- package/build-module/components/template-part-content-panel/index.js +35 -48
- package/build-module/components/template-part-content-panel/index.js.map +7 -1
- package/build-module/components/template-part-menu-items/convert-to-regular.js +26 -27
- package/build-module/components/template-part-menu-items/convert-to-regular.js.map +7 -1
- package/build-module/components/template-part-menu-items/convert-to-template-part.js +56 -61
- package/build-module/components/template-part-menu-items/convert-to-template-part.js.map +7 -1
- package/build-module/components/template-part-menu-items/index.js +38 -47
- package/build-module/components/template-part-menu-items/index.js.map +7 -1
- package/build-module/components/template-validation-notice/index.js +55 -41
- package/build-module/components/template-validation-notice/index.js.map +7 -1
- package/build-module/components/text-editor/index.js +38 -54
- package/build-module/components/text-editor/index.js.map +7 -1
- package/build-module/components/theme-support-check/index.js +13 -38
- package/build-module/components/theme-support-check/index.js.map +7 -1
- package/build-module/components/time-to-read/index.js +36 -48
- package/build-module/components/time-to-read/index.js.map +7 -1
- package/build-module/components/unsaved-changes-warning/index.js +16 -34
- package/build-module/components/unsaved-changes-warning/index.js.map +7 -1
- package/build-module/components/visual-editor/edit-template-blocks-notification.js +44 -63
- package/build-module/components/visual-editor/edit-template-blocks-notification.js.map +7 -1
- package/build-module/components/visual-editor/index.js +256 -225
- package/build-module/components/visual-editor/index.js.map +7 -1
- package/build-module/components/visual-editor/use-select-nearest-editable-block.js +58 -64
- package/build-module/components/visual-editor/use-select-nearest-editable-block.js.map +7 -1
- package/build-module/components/visual-editor/use-zoom-out-mode-exit.js +31 -43
- package/build-module/components/visual-editor/use-zoom-out-mode-exit.js.map +7 -1
- package/build-module/components/word-count/index.js +16 -32
- package/build-module/components/word-count/index.js.map +7 -1
- package/build-module/components/zoom-out-toggle/index.js +72 -66
- package/build-module/components/zoom-out-toggle/index.js.map +7 -1
- package/build-module/dataviews/api.js +26 -77
- package/build-module/dataviews/api.js.map +7 -1
- package/build-module/dataviews/fields/content-preview/content-preview-view.js +66 -85
- package/build-module/dataviews/fields/content-preview/content-preview-view.js.map +7 -1
- package/build-module/dataviews/fields/content-preview/index.js +10 -15
- package/build-module/dataviews/fields/content-preview/index.js.map +7 -1
- package/build-module/dataviews/store/private-actions.js +113 -43
- package/build-module/dataviews/store/private-actions.js.map +7 -1
- package/build-module/dataviews/store/private-selectors.js +11 -12
- package/build-module/dataviews/store/private-selectors.js.map +7 -1
- package/build-module/dataviews/store/reducer.js +32 -26
- package/build-module/dataviews/store/reducer.js.map +7 -1
- package/build-module/hooks/custom-sources-backwards-compatibility.js +70 -83
- package/build-module/hooks/custom-sources-backwards-compatibility.js.map +7 -1
- package/build-module/hooks/default-autocompleters.js +9 -15
- package/build-module/hooks/default-autocompleters.js.map +7 -1
- package/build-module/hooks/index.js +7 -9
- package/build-module/hooks/index.js.map +7 -1
- package/build-module/hooks/media-upload.js +8 -7
- package/build-module/hooks/media-upload.js.map +7 -1
- package/build-module/hooks/navigation-link-view-button.js +46 -63
- package/build-module/hooks/navigation-link-view-button.js.map +7 -1
- package/build-module/hooks/pattern-overrides.js +48 -67
- package/build-module/hooks/pattern-overrides.js.map +7 -1
- package/build-module/hooks/template-part-navigation-edit-button.js +97 -0
- package/build-module/hooks/template-part-navigation-edit-button.js.map +7 -0
- package/build-module/index.js +13 -15
- package/build-module/index.js.map +7 -1
- package/build-module/lock-unlock.js +8 -7
- package/build-module/lock-unlock.js.map +7 -1
- package/build-module/private-apis.js +31 -31
- package/build-module/private-apis.js.map +7 -1
- package/build-module/store/actions.js +424 -872
- package/build-module/store/actions.js.map +7 -1
- package/build-module/store/constants.js +36 -27
- package/build-module/store/constants.js.map +7 -1
- package/build-module/store/defaults.js +8 -28
- package/build-module/store/defaults.js.map +7 -1
- package/build-module/store/index.js +15 -30
- package/build-module/store/index.js.map +7 -1
- package/build-module/store/local-autosave.js +18 -24
- package/build-module/store/local-autosave.js.map +7 -1
- package/build-module/store/private-actions.js +242 -257
- package/build-module/store/private-actions.js.map +7 -1
- package/build-module/store/private-selectors.js +157 -174
- package/build-module/store/private-selectors.js.map +7 -1
- package/build-module/store/reducer.js +89 -267
- package/build-module/store/reducer.js.map +7 -1
- package/build-module/store/selectors.js +712 -1433
- package/build-module/store/selectors.js.map +7 -1
- package/build-module/store/utils/is-template-revertable.js +6 -15
- package/build-module/store/utils/is-template-revertable.js.map +7 -1
- package/build-module/store/utils/notice-builder.js +52 -91
- package/build-module/store/utils/notice-builder.js.map +7 -1
- package/build-module/utils/get-item-title.js +10 -19
- package/build-module/utils/get-item-title.js.map +7 -1
- package/build-module/utils/get-template-info.js +14 -38
- package/build-module/utils/get-template-info.js.map +7 -1
- package/build-module/utils/get-template-part-icon.js +14 -16
- package/build-module/utils/get-template-part-icon.js.map +7 -1
- package/build-module/utils/index.js +9 -8
- package/build-module/utils/index.js.map +7 -1
- package/build-module/utils/media-sideload/index.js +8 -14
- package/build-module/utils/media-sideload/index.js.map +7 -1
- package/build-module/utils/media-upload/index.js +26 -56
- package/build-module/utils/media-upload/index.js.map +7 -1
- package/build-module/utils/pageTypeBadge.js +16 -28
- package/build-module/utils/pageTypeBadge.js.map +7 -1
- package/build-module/utils/search-templates.js +12 -41
- package/build-module/utils/search-templates.js.map +7 -1
- package/build-module/utils/terms.js +32 -55
- package/build-module/utils/terms.js.map +7 -1
- package/build-module/utils/url.js +11 -28
- package/build-module/utils/url.js.map +7 -1
- package/build-style/style-rtl.css +327 -136
- package/build-style/style.css +327 -136
- package/build-types/bindings/entity.d.ts +16 -0
- package/build-types/bindings/entity.d.ts.map +1 -0
- package/build-types/bindings/post-data.d.ts +16 -0
- package/build-types/bindings/post-meta.d.ts +13 -0
- package/build-types/components/{preferences-modal/block-visibility.d.ts → block-visibility/index.d.ts} +1 -1
- package/build-types/components/block-visibility/index.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/add-comment.d.ts +6 -14
- package/build-types/components/collab-sidebar/add-comment.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/comment-form.d.ts +9 -18
- package/build-types/components/collab-sidebar/comment-form.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/comment-menu-item.d.ts +5 -0
- package/build-types/components/collab-sidebar/comment-menu-item.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/comments.d.ts +10 -1
- package/build-types/components/collab-sidebar/comments.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/hooks.d.ts +33 -0
- package/build-types/components/collab-sidebar/hooks.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/index.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/utils.d.ts +20 -0
- package/build-types/components/collab-sidebar/utils.d.ts.map +1 -1
- package/build-types/components/document-tools/index.d.ts.map +1 -1
- package/build-types/components/header/index.d.ts.map +1 -1
- package/build-types/components/post-excerpt/panel.d.ts.map +1 -1
- package/build-types/components/post-template/block-theme.d.ts.map +1 -1
- package/build-types/components/post-template/hooks.d.ts.map +1 -1
- package/build-types/components/provider/disable-non-page-content-blocks.d.ts.map +1 -1
- package/build-types/components/provider/use-hide-blocks-from-inserter.d.ts.map +1 -1
- package/build-types/components/visual-editor/index.d.ts.map +1 -1
- package/build-types/hooks/template-part-navigation-edit-button.d.ts +2 -0
- package/build-types/hooks/template-part-navigation-edit-button.d.ts.map +1 -0
- package/build-types/store/actions.d.ts.map +1 -1
- package/package.json +59 -39
- package/src/bindings/api.js +2 -2
- package/src/bindings/entity.js +89 -0
- package/src/bindings/post-data.js +23 -0
- package/src/bindings/post-meta.js +19 -0
- package/src/components/autocompleters/style.scss +2 -0
- package/src/components/block-settings-menu/style.scss +2 -0
- package/src/components/{preferences-modal/block-visibility.js → block-visibility/index.js} +37 -5
- package/src/components/block-visibility/style.scss +25 -0
- package/src/components/blog-title/style.scss +2 -0
- package/src/components/collab-sidebar/add-comment.js +18 -17
- package/src/components/collab-sidebar/comment-author-info.js +2 -2
- package/src/components/collab-sidebar/comment-form.js +15 -17
- package/src/components/collab-sidebar/comment-indicator-toolbar.js +2 -2
- package/src/components/collab-sidebar/{comment-button.js → comment-menu-item.js} +4 -4
- package/src/components/collab-sidebar/comments.js +413 -183
- package/src/components/collab-sidebar/hooks.js +343 -22
- package/src/components/collab-sidebar/index.js +94 -190
- package/src/components/collab-sidebar/style.scss +44 -26
- package/src/components/collab-sidebar/utils.js +55 -0
- package/src/components/collapsible-block-toolbar/style.scss +5 -1
- package/src/components/commands/index.js +2 -2
- package/src/components/document-bar/style.scss +5 -0
- package/src/components/document-outline/style.scss +3 -0
- package/src/components/document-tools/index.js +1 -20
- package/src/components/document-tools/style.scss +4 -0
- package/src/components/editor-help/style.scss +3 -0
- package/src/components/editor-interface/style.scss +2 -0
- package/src/components/editor-notices/style.scss +3 -0
- package/src/components/entities-saved-states/style.scss +3 -0
- package/src/components/error-boundary/style.scss +3 -0
- package/src/components/header/index.js +3 -8
- package/src/components/header/style.scss +6 -0
- package/src/components/inserter-sidebar/style.scss +2 -0
- package/src/components/keyboard-shortcut-help-modal/style.scss +2 -0
- package/src/components/list-view-sidebar/style.scss +4 -1
- package/src/components/page-attributes/style.scss +2 -0
- package/src/components/post-actions/style.scss +2 -0
- package/src/components/post-author/style.scss +2 -0
- package/src/components/post-card-panel/style.scss +4 -0
- package/src/components/post-content-information/style.scss +2 -0
- package/src/components/post-discussion/style.scss +2 -0
- package/src/components/post-excerpt/panel.js +12 -6
- package/src/components/post-excerpt/style.scss +2 -0
- package/src/components/post-featured-image/style.scss +7 -0
- package/src/components/post-format/style.scss +2 -0
- package/src/components/post-last-edited-panel/style.scss +2 -0
- package/src/components/post-last-revision/style.scss +3 -0
- package/src/components/post-locked-modal/style.scss +2 -0
- package/src/components/post-panel-row/style.scss +2 -0
- package/src/components/post-panel-section/style.scss +2 -0
- package/src/components/post-publish-button/post-publish-button-or-toggle.js +1 -1
- package/src/components/post-publish-panel/style.scss +5 -0
- package/src/components/post-saved-state/style.scss +4 -0
- package/src/components/post-schedule/style.scss +2 -0
- package/src/components/post-status/style.scss +3 -0
- package/src/components/post-sticky/style.scss +3 -0
- package/src/components/post-sync-status/style.scss +2 -0
- package/src/components/post-taxonomies/style.scss +2 -0
- package/src/components/post-template/block-theme.js +45 -3
- package/src/components/post-template/hooks.js +48 -21
- package/src/components/post-template/style.scss +5 -0
- package/src/components/post-text-editor/style.scss +4 -0
- package/src/components/post-title/style.scss +2 -0
- package/src/components/post-url/style.scss +2 -0
- package/src/components/posts-per-page/style.scss +2 -0
- package/src/components/preferences-modal/index.js +1 -1
- package/src/components/provider/disable-non-page-content-blocks.js +7 -13
- package/src/components/provider/use-hide-blocks-from-inserter.js +37 -6
- package/src/components/resizable-editor/style.scss +4 -0
- package/src/components/save-publish-panels/style.scss +4 -0
- package/src/components/sidebar/style.scss +3 -0
- package/src/components/site-discussion/style.scss +2 -1
- package/src/components/start-page-options/style.scss +5 -0
- package/src/components/start-template-options/style.scss +5 -0
- package/src/components/table-of-contents/style.scss +5 -0
- package/src/components/text-editor/style.scss +6 -0
- package/src/components/visual-editor/index.js +11 -21
- package/src/components/visual-editor/style.scss +3 -1
- package/src/dataviews/fields/content-preview/style.scss +2 -0
- package/src/hooks/index.js +1 -0
- package/src/hooks/template-part-navigation-edit-button.js +145 -0
- package/src/store/actions.js +6 -1
- package/src/style.scss +57 -56
- package/tsconfig.tsbuildinfo +1 -1
- package/build/bindings/term-data.js +0 -171
- package/build/bindings/term-data.js.map +0 -1
- package/build/components/block-settings-menu/content-only-settings-menu.native.js +0 -11
- package/build/components/block-settings-menu/content-only-settings-menu.native.js.map +0 -1
- package/build/components/collab-sidebar/comment-button.js +0 -42
- package/build/components/collab-sidebar/comment-button.js.map +0 -1
- package/build/components/commands/index.native.js +0 -9
- package/build/components/commands/index.native.js.map +0 -1
- package/build/components/deprecated.native.js +0 -121
- package/build/components/deprecated.native.js.map +0 -1
- package/build/components/editor-help/add-blocks.native.js +0 -41
- package/build/components/editor-help/add-blocks.native.js.map +0 -1
- package/build/components/editor-help/customize-blocks.native.js +0 -41
- package/build/components/editor-help/customize-blocks.native.js.map +0 -1
- package/build/components/editor-help/help-detail-navigation-screen.native.js +0 -69
- package/build/components/editor-help/help-detail-navigation-screen.native.js.map +0 -1
- package/build/components/editor-help/help-get-support-button.native.js +0 -41
- package/build/components/editor-help/help-get-support-button.native.js.map +0 -1
- package/build/components/editor-help/help-section-title.native.js +0 -37
- package/build/components/editor-help/help-section-title.native.js.map +0 -1
- package/build/components/editor-help/help-topic-row.native.js +0 -42
- package/build/components/editor-help/help-topic-row.native.js.map +0 -1
- package/build/components/editor-help/icon-move-blocks.native.js +0 -19
- package/build/components/editor-help/icon-move-blocks.native.js.map +0 -1
- package/build/components/editor-help/index.native.js +0 -173
- package/build/components/editor-help/index.native.js.map +0 -1
- package/build/components/editor-help/intro-to-blocks.native.js +0 -70
- package/build/components/editor-help/intro-to-blocks.native.js.map +0 -1
- package/build/components/editor-help/move-blocks.native.js +0 -52
- package/build/components/editor-help/move-blocks.native.js.map +0 -1
- package/build/components/editor-help/remove-blocks.native.js +0 -39
- package/build/components/editor-help/remove-blocks.native.js.map +0 -1
- package/build/components/editor-help/view-sections.native.js +0 -80
- package/build/components/editor-help/view-sections.native.js.map +0 -1
- package/build/components/error-boundary/index.native.js +0 -143
- package/build/components/error-boundary/index.native.js.map +0 -1
- package/build/components/index.native.js +0 -85
- package/build/components/index.native.js.map +0 -1
- package/build/components/offline-status/index.native.js +0 -83
- package/build/components/offline-status/index.native.js.map +0 -1
- package/build/components/post-title/index.native.js +0 -251
- package/build/components/post-title/index.native.js.map +0 -1
- package/build/components/preferences-modal/block-visibility.js +0 -88
- package/build/components/preferences-modal/block-visibility.js.map +0 -1
- package/build/components/provider/index.native.js +0 -426
- package/build/components/provider/index.native.js.map +0 -1
- package/build/components/provider/use-block-editor-settings.native.js +0 -46
- package/build/components/provider/use-block-editor-settings.native.js.map +0 -1
- package/build/components/template-part-menu-items/index.native.js +0 -10
- package/build/components/template-part-menu-items/index.native.js.map +0 -1
- package/build/hooks/index.native.js +0 -2
- package/build/hooks/index.native.js.map +0 -1
- package/build/index.native.js +0 -56
- package/build/index.native.js.map +0 -1
- package/build/private-apis.native.js +0 -44
- package/build/private-apis.native.js.map +0 -1
- package/build/store/actions.native.js +0 -51
- package/build/store/actions.native.js.map +0 -1
- package/build/store/reducer.native.js +0 -105
- package/build/store/reducer.native.js.map +0 -1
- package/build/store/selectors.native.js +0 -70
- package/build/store/selectors.native.js.map +0 -1
- package/build/utils/index.native.js +0 -14
- package/build/utils/index.native.js.map +0 -1
- package/build/utils/media-sideload/index.native.js +0 -8
- package/build/utils/media-sideload/index.native.js.map +0 -1
- package/build/utils/media-upload/index.native.js +0 -8
- package/build/utils/media-upload/index.native.js.map +0 -1
- package/build-module/bindings/term-data.js +0 -165
- package/build-module/bindings/term-data.js.map +0 -1
- package/build-module/components/block-settings-menu/content-only-settings-menu.native.js +0 -5
- package/build-module/components/block-settings-menu/content-only-settings-menu.native.js.map +0 -1
- package/build-module/components/collab-sidebar/comment-button.js +0 -35
- package/build-module/components/collab-sidebar/comment-button.js.map +0 -1
- package/build-module/components/commands/index.native.js +0 -3
- package/build-module/components/commands/index.native.js.map +0 -1
- package/build-module/components/deprecated.native.js +0 -7
- package/build-module/components/deprecated.native.js.map +0 -1
- package/build-module/components/editor-help/add-blocks.native.js +0 -33
- package/build-module/components/editor-help/add-blocks.native.js.map +0 -1
- package/build-module/components/editor-help/customize-blocks.native.js +0 -33
- package/build-module/components/editor-help/customize-blocks.native.js.map +0 -1
- package/build-module/components/editor-help/help-detail-navigation-screen.native.js +0 -61
- package/build-module/components/editor-help/help-detail-navigation-screen.native.js.map +0 -1
- package/build-module/components/editor-help/help-get-support-button.native.js +0 -33
- package/build-module/components/editor-help/help-get-support-button.native.js.map +0 -1
- package/build-module/components/editor-help/help-section-title.native.js +0 -29
- package/build-module/components/editor-help/help-section-title.native.js.map +0 -1
- package/build-module/components/editor-help/help-topic-row.native.js +0 -35
- package/build-module/components/editor-help/help-topic-row.native.js.map +0 -1
- package/build-module/components/editor-help/icon-move-blocks.native.js +0 -13
- package/build-module/components/editor-help/icon-move-blocks.native.js.map +0 -1
- package/build-module/components/editor-help/index.native.js +0 -165
- package/build-module/components/editor-help/index.native.js.map +0 -1
- package/build-module/components/editor-help/intro-to-blocks.native.js +0 -62
- package/build-module/components/editor-help/intro-to-blocks.native.js.map +0 -1
- package/build-module/components/editor-help/move-blocks.native.js +0 -44
- package/build-module/components/editor-help/move-blocks.native.js.map +0 -1
- package/build-module/components/editor-help/remove-blocks.native.js +0 -31
- package/build-module/components/editor-help/remove-blocks.native.js.map +0 -1
- package/build-module/components/editor-help/view-sections.native.js +0 -69
- package/build-module/components/editor-help/view-sections.native.js.map +0 -1
- package/build-module/components/error-boundary/index.native.js +0 -135
- package/build-module/components/error-boundary/index.native.js.map +0 -1
- package/build-module/components/index.native.js +0 -15
- package/build-module/components/index.native.js.map +0 -1
- package/build-module/components/offline-status/index.native.js +0 -77
- package/build-module/components/offline-status/index.native.js.map +0 -1
- package/build-module/components/post-title/index.native.js +0 -243
- package/build-module/components/post-title/index.native.js.map +0 -1
- package/build-module/components/preferences-modal/block-visibility.js +0 -81
- package/build-module/components/preferences-modal/block-visibility.js.map +0 -1
- package/build-module/components/provider/index.native.js +0 -416
- package/build-module/components/provider/index.native.js.map +0 -1
- package/build-module/components/provider/use-block-editor-settings.native.js +0 -38
- package/build-module/components/provider/use-block-editor-settings.native.js.map +0 -1
- package/build-module/components/template-part-menu-items/index.native.js +0 -4
- package/build-module/components/template-part-menu-items/index.native.js.map +0 -1
- package/build-module/hooks/index.native.js +0 -2
- package/build-module/hooks/index.native.js.map +0 -1
- package/build-module/index.native.js +0 -16
- package/build-module/index.native.js.map +0 -1
- package/build-module/private-apis.native.js +0 -34
- package/build-module/private-apis.native.js.map +0 -1
- package/build-module/store/actions.native.js +0 -27
- package/build-module/store/actions.native.js.map +0 -1
- package/build-module/store/reducer.native.js +0 -81
- package/build-module/store/reducer.native.js.map +0 -1
- package/build-module/store/selectors.native.js +0 -49
- package/build-module/store/selectors.native.js.map +0 -1
- package/build-module/utils/index.native.js +0 -6
- package/build-module/utils/index.native.js.map +0 -1
- package/build-module/utils/media-sideload/index.native.js +0 -2
- package/build-module/utils/media-sideload/index.native.js.map +0 -1
- package/build-module/utils/media-upload/index.native.js +0 -2
- package/build-module/utils/media-upload/index.native.js.map +0 -1
- package/build-types/bindings/term-data.d.ts +0 -25
- package/build-types/bindings/term-data.d.ts.map +0 -1
- package/build-types/components/collab-sidebar/comment-button.d.ts +0 -5
- package/build-types/components/collab-sidebar/comment-button.d.ts.map +0 -1
- package/build-types/components/preferences-modal/block-visibility.d.ts.map +0 -1
- package/src/bindings/term-data.js +0 -159
package/build/store/actions.js
CHANGED
|
@@ -1,1183 +1,768 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
Object.
|
|
5
|
-
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var actions_exports = {};
|
|
30
|
+
__export(actions_exports, {
|
|
31
|
+
__experimentalTearDownEditor: () => __experimentalTearDownEditor,
|
|
32
|
+
__unstableSaveForPreview: () => __unstableSaveForPreview,
|
|
33
|
+
autosave: () => autosave,
|
|
34
|
+
clearSelectedBlock: () => clearSelectedBlock,
|
|
35
|
+
closePublishSidebar: () => closePublishSidebar,
|
|
36
|
+
createUndoLevel: () => createUndoLevel,
|
|
37
|
+
disablePublishSidebar: () => disablePublishSidebar,
|
|
38
|
+
editPost: () => editPost,
|
|
39
|
+
enablePublishSidebar: () => enablePublishSidebar,
|
|
40
|
+
enterFormattedText: () => enterFormattedText,
|
|
41
|
+
exitFormattedText: () => exitFormattedText,
|
|
42
|
+
hideInsertionPoint: () => hideInsertionPoint,
|
|
43
|
+
insertBlock: () => insertBlock,
|
|
44
|
+
insertBlocks: () => insertBlocks,
|
|
45
|
+
insertDefaultBlock: () => insertDefaultBlock,
|
|
46
|
+
lockPostAutosaving: () => lockPostAutosaving,
|
|
47
|
+
lockPostSaving: () => lockPostSaving,
|
|
48
|
+
mergeBlocks: () => mergeBlocks,
|
|
49
|
+
moveBlockToPosition: () => moveBlockToPosition,
|
|
50
|
+
moveBlocksDown: () => moveBlocksDown,
|
|
51
|
+
moveBlocksUp: () => moveBlocksUp,
|
|
52
|
+
multiSelect: () => multiSelect,
|
|
53
|
+
openPublishSidebar: () => openPublishSidebar,
|
|
54
|
+
receiveBlocks: () => receiveBlocks,
|
|
55
|
+
redo: () => redo,
|
|
56
|
+
refreshPost: () => refreshPost,
|
|
57
|
+
removeBlock: () => removeBlock,
|
|
58
|
+
removeBlocks: () => removeBlocks,
|
|
59
|
+
removeEditorPanel: () => removeEditorPanel,
|
|
60
|
+
replaceBlock: () => replaceBlock,
|
|
61
|
+
replaceBlocks: () => replaceBlocks,
|
|
62
|
+
resetBlocks: () => resetBlocks,
|
|
63
|
+
resetEditorBlocks: () => resetEditorBlocks,
|
|
64
|
+
resetPost: () => resetPost,
|
|
65
|
+
savePost: () => savePost,
|
|
66
|
+
selectBlock: () => selectBlock,
|
|
67
|
+
setDeviceType: () => setDeviceType,
|
|
68
|
+
setEditedPost: () => setEditedPost,
|
|
69
|
+
setIsInserterOpened: () => setIsInserterOpened,
|
|
70
|
+
setIsListViewOpened: () => setIsListViewOpened,
|
|
71
|
+
setRenderingMode: () => setRenderingMode,
|
|
72
|
+
setTemplateValidity: () => setTemplateValidity,
|
|
73
|
+
setupEditor: () => setupEditor,
|
|
74
|
+
setupEditorState: () => setupEditorState,
|
|
75
|
+
showInsertionPoint: () => showInsertionPoint,
|
|
76
|
+
startMultiSelect: () => startMultiSelect,
|
|
77
|
+
startTyping: () => startTyping,
|
|
78
|
+
stopMultiSelect: () => stopMultiSelect,
|
|
79
|
+
stopTyping: () => stopTyping,
|
|
80
|
+
switchEditorMode: () => switchEditorMode,
|
|
81
|
+
synchronizeTemplate: () => synchronizeTemplate,
|
|
82
|
+
toggleBlockMode: () => toggleBlockMode,
|
|
83
|
+
toggleDistractionFree: () => toggleDistractionFree,
|
|
84
|
+
toggleEditorPanelEnabled: () => toggleEditorPanelEnabled,
|
|
85
|
+
toggleEditorPanelOpened: () => toggleEditorPanelOpened,
|
|
86
|
+
togglePublishSidebar: () => togglePublishSidebar,
|
|
87
|
+
toggleSelection: () => toggleSelection,
|
|
88
|
+
toggleSpotlightMode: () => toggleSpotlightMode,
|
|
89
|
+
toggleTopToolbar: () => toggleTopToolbar,
|
|
90
|
+
trashPost: () => trashPost,
|
|
91
|
+
undo: () => undo,
|
|
92
|
+
unlockPostAutosaving: () => unlockPostAutosaving,
|
|
93
|
+
unlockPostSaving: () => unlockPostSaving,
|
|
94
|
+
updateBlock: () => updateBlock,
|
|
95
|
+
updateBlockAttributes: () => updateBlockAttributes,
|
|
96
|
+
updateBlockListSettings: () => updateBlockListSettings,
|
|
97
|
+
updateEditorSettings: () => updateEditorSettings,
|
|
98
|
+
updatePost: () => updatePost,
|
|
99
|
+
updatePostLock: () => updatePostLock
|
|
6
100
|
});
|
|
7
|
-
exports
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
exports.selectBlock = exports.savePost = void 0;
|
|
23
|
-
exports.setDeviceType = setDeviceType;
|
|
24
|
-
exports.setEditedPost = setEditedPost;
|
|
25
|
-
exports.setIsInserterOpened = void 0;
|
|
26
|
-
exports.setIsListViewOpened = setIsListViewOpened;
|
|
27
|
-
exports.setupEditor = exports.setTemplateValidity = exports.setRenderingMode = void 0;
|
|
28
|
-
exports.setupEditorState = setupEditorState;
|
|
29
|
-
exports.toggleEditorPanelOpened = exports.toggleEditorPanelEnabled = exports.toggleDistractionFree = exports.toggleBlockMode = exports.synchronizeTemplate = exports.switchEditorMode = exports.stopTyping = exports.stopMultiSelect = exports.startTyping = exports.startMultiSelect = exports.showInsertionPoint = void 0;
|
|
30
|
-
exports.togglePublishSidebar = togglePublishSidebar;
|
|
31
|
-
exports.undo = exports.trashPost = exports.toggleTopToolbar = exports.toggleSpotlightMode = exports.toggleSelection = void 0;
|
|
32
|
-
exports.unlockPostAutosaving = unlockPostAutosaving;
|
|
33
|
-
exports.unlockPostSaving = unlockPostSaving;
|
|
34
|
-
exports.updateBlockListSettings = exports.updateBlockAttributes = exports.updateBlock = void 0;
|
|
35
|
-
exports.updateEditorSettings = updateEditorSettings;
|
|
36
|
-
exports.updatePost = updatePost;
|
|
37
|
-
exports.updatePostLock = updatePostLock;
|
|
38
|
-
var _a11y = require("@wordpress/a11y");
|
|
39
|
-
var _apiFetch = _interopRequireDefault(require("@wordpress/api-fetch"));
|
|
40
|
-
var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
|
|
41
|
-
var _blocks = require("@wordpress/blocks");
|
|
42
|
-
var _notices = require("@wordpress/notices");
|
|
43
|
-
var _coreData = require("@wordpress/core-data");
|
|
44
|
-
var _blockEditor = require("@wordpress/block-editor");
|
|
45
|
-
var _hooks = require("@wordpress/hooks");
|
|
46
|
-
var _preferences = require("@wordpress/preferences");
|
|
47
|
-
var _i18n = require("@wordpress/i18n");
|
|
48
|
-
var _localAutosave = require("./local-autosave");
|
|
49
|
-
var _noticeBuilder = require("./utils/notice-builder");
|
|
50
|
-
var _lockUnlock = require("../lock-unlock");
|
|
51
|
-
/**
|
|
52
|
-
* WordPress dependencies
|
|
53
|
-
*/
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Internal dependencies
|
|
57
|
-
*/
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Returns an action generator used in signalling that editor has initialized with
|
|
61
|
-
* the specified post object and editor settings.
|
|
62
|
-
*
|
|
63
|
-
* @param {Object} post Post object.
|
|
64
|
-
* @param {Object} edits Initial edited attributes object.
|
|
65
|
-
* @param {Array} [template] Block Template.
|
|
66
|
-
*/
|
|
67
|
-
const setupEditor = (post, edits, template) => ({
|
|
68
|
-
dispatch
|
|
69
|
-
}) => {
|
|
101
|
+
module.exports = __toCommonJS(actions_exports);
|
|
102
|
+
var import_a11y = require("@wordpress/a11y");
|
|
103
|
+
var import_api_fetch = __toESM(require("@wordpress/api-fetch"));
|
|
104
|
+
var import_deprecated = __toESM(require("@wordpress/deprecated"));
|
|
105
|
+
var import_blocks = require("@wordpress/blocks");
|
|
106
|
+
var import_notices = require("@wordpress/notices");
|
|
107
|
+
var import_core_data = require("@wordpress/core-data");
|
|
108
|
+
var import_block_editor = require("@wordpress/block-editor");
|
|
109
|
+
var import_hooks = require("@wordpress/hooks");
|
|
110
|
+
var import_preferences = require("@wordpress/preferences");
|
|
111
|
+
var import_i18n = require("@wordpress/i18n");
|
|
112
|
+
var import_local_autosave = require("./local-autosave");
|
|
113
|
+
var import_notice_builder = require("./utils/notice-builder");
|
|
114
|
+
var import_lock_unlock = require("../lock-unlock");
|
|
115
|
+
const setupEditor = (post, edits, template) => ({ dispatch }) => {
|
|
70
116
|
dispatch.setEditedPost(post.type, post.id);
|
|
71
|
-
|
|
72
|
-
const isNewPost = post.status === 'auto-draft';
|
|
117
|
+
const isNewPost = post.status === "auto-draft";
|
|
73
118
|
if (isNewPost && template) {
|
|
74
|
-
// In order to ensure maximum of a single parse during setup, edits are
|
|
75
|
-
// included as part of editor setup action. Assume edited content as
|
|
76
|
-
// canonical if provided, falling back to post.
|
|
77
119
|
let content;
|
|
78
|
-
if (
|
|
120
|
+
if ("content" in edits) {
|
|
79
121
|
content = edits.content;
|
|
80
122
|
} else {
|
|
81
123
|
content = post.content.raw;
|
|
82
124
|
}
|
|
83
|
-
let blocks = (0,
|
|
84
|
-
blocks = (0,
|
|
125
|
+
let blocks = (0, import_blocks.parse)(content);
|
|
126
|
+
blocks = (0, import_blocks.synchronizeBlocksWithTemplate)(blocks, template);
|
|
85
127
|
dispatch.resetEditorBlocks(blocks, {
|
|
86
128
|
__unstableShouldCreateUndoLevel: false
|
|
87
129
|
});
|
|
88
130
|
}
|
|
89
|
-
if (edits && Object.values(edits).some(
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
})) {
|
|
131
|
+
if (edits && Object.values(edits).some(
|
|
132
|
+
([key, edit]) => edit !== (post[key]?.raw ?? post[key])
|
|
133
|
+
)) {
|
|
93
134
|
dispatch.editPost(edits);
|
|
94
135
|
}
|
|
95
136
|
};
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* Returns an action object signalling that the editor is being destroyed and
|
|
99
|
-
* that any necessary state or side-effect cleanup should occur.
|
|
100
|
-
*
|
|
101
|
-
* @deprecated
|
|
102
|
-
*
|
|
103
|
-
* @return {Object} Action object.
|
|
104
|
-
*/
|
|
105
|
-
exports.setupEditor = setupEditor;
|
|
106
137
|
function __experimentalTearDownEditor() {
|
|
107
|
-
(0,
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
138
|
+
(0, import_deprecated.default)(
|
|
139
|
+
"wp.data.dispatch( 'core/editor' ).__experimentalTearDownEditor",
|
|
140
|
+
{
|
|
141
|
+
since: "6.5"
|
|
142
|
+
}
|
|
143
|
+
);
|
|
144
|
+
return { type: "DO_NOTHING" };
|
|
113
145
|
}
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Returns an action object used in signalling that the latest version of the
|
|
117
|
-
* post has been received, either by initialization or save.
|
|
118
|
-
*
|
|
119
|
-
* @deprecated Since WordPress 6.0.
|
|
120
|
-
*/
|
|
121
146
|
function resetPost() {
|
|
122
|
-
(0,
|
|
123
|
-
since:
|
|
124
|
-
version:
|
|
125
|
-
alternative:
|
|
147
|
+
(0, import_deprecated.default)("wp.data.dispatch( 'core/editor' ).resetPost", {
|
|
148
|
+
since: "6.0",
|
|
149
|
+
version: "6.3",
|
|
150
|
+
alternative: "Initialize the editor with the setupEditorState action"
|
|
126
151
|
});
|
|
127
|
-
return {
|
|
128
|
-
type: 'DO_NOTHING'
|
|
129
|
-
};
|
|
152
|
+
return { type: "DO_NOTHING" };
|
|
130
153
|
}
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Returns an action object used in signalling that a patch of updates for the
|
|
134
|
-
* latest version of the post have been received.
|
|
135
|
-
*
|
|
136
|
-
* @return {Object} Action object.
|
|
137
|
-
* @deprecated since Gutenberg 9.7.0.
|
|
138
|
-
*/
|
|
139
154
|
function updatePost() {
|
|
140
|
-
(0,
|
|
141
|
-
since:
|
|
142
|
-
alternative:
|
|
155
|
+
(0, import_deprecated.default)("wp.data.dispatch( 'core/editor' ).updatePost", {
|
|
156
|
+
since: "5.7",
|
|
157
|
+
alternative: "Use the core entities store instead"
|
|
143
158
|
});
|
|
144
159
|
return {
|
|
145
|
-
type:
|
|
160
|
+
type: "DO_NOTHING"
|
|
146
161
|
};
|
|
147
162
|
}
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Setup the editor state.
|
|
151
|
-
*
|
|
152
|
-
* @deprecated
|
|
153
|
-
*
|
|
154
|
-
* @param {Object} post Post object.
|
|
155
|
-
*/
|
|
156
163
|
function setupEditorState(post) {
|
|
157
|
-
(0,
|
|
158
|
-
since:
|
|
164
|
+
(0, import_deprecated.default)("wp.data.dispatch( 'core/editor' ).setupEditorState", {
|
|
165
|
+
since: "6.5",
|
|
159
166
|
alternative: "wp.data.dispatch( 'core/editor' ).setEditedPost"
|
|
160
167
|
});
|
|
161
168
|
return setEditedPost(post.type, post.id);
|
|
162
169
|
}
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* Returns an action that sets the current post Type and post ID.
|
|
166
|
-
*
|
|
167
|
-
* @param {string} postType Post Type.
|
|
168
|
-
* @param {string} postId Post ID.
|
|
169
|
-
*
|
|
170
|
-
* @return {Object} Action object.
|
|
171
|
-
*/
|
|
172
170
|
function setEditedPost(postType, postId) {
|
|
173
171
|
return {
|
|
174
|
-
type:
|
|
172
|
+
type: "SET_EDITED_POST",
|
|
175
173
|
postType,
|
|
176
174
|
postId
|
|
177
175
|
};
|
|
178
176
|
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
* been edited.
|
|
183
|
-
*
|
|
184
|
-
* @param {Object} edits Post attributes to edit.
|
|
185
|
-
* @param {Object} [options] Options for the edit.
|
|
186
|
-
*
|
|
187
|
-
* @example
|
|
188
|
-
* ```js
|
|
189
|
-
* // Update the post title
|
|
190
|
-
* wp.data.dispatch( 'core/editor' ).editPost( { title: `${ newTitle }` } );
|
|
191
|
-
* ```
|
|
192
|
-
*
|
|
193
|
-
* @return {Object} Action object
|
|
194
|
-
*/
|
|
195
|
-
const editPost = (edits, options) => ({
|
|
196
|
-
select,
|
|
197
|
-
registry
|
|
198
|
-
}) => {
|
|
199
|
-
const {
|
|
200
|
-
id,
|
|
201
|
-
type
|
|
202
|
-
} = select.getCurrentPost();
|
|
203
|
-
registry.dispatch(_coreData.store).editEntityRecord('postType', type, id, edits, options);
|
|
177
|
+
const editPost = (edits, options) => ({ select, registry }) => {
|
|
178
|
+
const { id, type } = select.getCurrentPost();
|
|
179
|
+
registry.dispatch(import_core_data.store).editEntityRecord("postType", type, id, edits, options);
|
|
204
180
|
};
|
|
205
|
-
|
|
206
|
-
/**
|
|
207
|
-
* Action for saving the current post in the editor.
|
|
208
|
-
*
|
|
209
|
-
* @param {Object} [options]
|
|
210
|
-
*/
|
|
211
|
-
exports.editPost = editPost;
|
|
212
|
-
const savePost = (options = {}) => async ({
|
|
213
|
-
select,
|
|
214
|
-
dispatch,
|
|
215
|
-
registry
|
|
216
|
-
}) => {
|
|
181
|
+
const savePost = (options = {}) => async ({ select, dispatch, registry }) => {
|
|
217
182
|
if (!select.isEditedPostSaveable()) {
|
|
218
183
|
return;
|
|
219
184
|
}
|
|
220
185
|
const content = select.getEditedPostContent();
|
|
221
186
|
if (!options.isAutosave) {
|
|
222
|
-
dispatch.editPost({
|
|
223
|
-
content
|
|
224
|
-
}, {
|
|
225
|
-
undoIgnore: true
|
|
226
|
-
});
|
|
187
|
+
dispatch.editPost({ content }, { undoIgnore: true });
|
|
227
188
|
}
|
|
228
189
|
const previousRecord = select.getCurrentPost();
|
|
229
190
|
let edits = {
|
|
230
191
|
id: previousRecord.id,
|
|
231
|
-
...registry.select(
|
|
192
|
+
...registry.select(import_core_data.store).getEntityRecordNonTransientEdits(
|
|
193
|
+
"postType",
|
|
194
|
+
previousRecord.type,
|
|
195
|
+
previousRecord.id
|
|
196
|
+
),
|
|
232
197
|
content
|
|
233
198
|
};
|
|
234
|
-
dispatch({
|
|
235
|
-
type: 'REQUEST_POST_UPDATE_START',
|
|
236
|
-
options
|
|
237
|
-
});
|
|
199
|
+
dispatch({ type: "REQUEST_POST_UPDATE_START", options });
|
|
238
200
|
let error = false;
|
|
239
201
|
try {
|
|
240
|
-
edits = await (0,
|
|
202
|
+
edits = await (0, import_hooks.applyFiltersAsync)(
|
|
203
|
+
"editor.preSavePost",
|
|
204
|
+
edits,
|
|
205
|
+
options
|
|
206
|
+
);
|
|
241
207
|
} catch (err) {
|
|
242
208
|
error = err;
|
|
243
209
|
}
|
|
244
210
|
if (!error) {
|
|
245
211
|
try {
|
|
246
|
-
await registry.dispatch(
|
|
212
|
+
await registry.dispatch(import_core_data.store).saveEntityRecord(
|
|
213
|
+
"postType",
|
|
214
|
+
previousRecord.type,
|
|
215
|
+
edits,
|
|
216
|
+
options
|
|
217
|
+
);
|
|
247
218
|
} catch (err) {
|
|
248
|
-
error = err.message && err.code !==
|
|
219
|
+
error = err.message && err.code !== "unknown_error" ? err.message : (0, import_i18n.__)("An error occurred while updating.");
|
|
249
220
|
}
|
|
250
221
|
}
|
|
251
222
|
if (!error) {
|
|
252
|
-
error = registry.select(
|
|
223
|
+
error = registry.select(import_core_data.store).getLastEntitySaveError(
|
|
224
|
+
"postType",
|
|
225
|
+
previousRecord.type,
|
|
226
|
+
previousRecord.id
|
|
227
|
+
);
|
|
253
228
|
}
|
|
254
|
-
|
|
255
|
-
// Run the hook with legacy unstable name for backward compatibility
|
|
256
229
|
if (!error) {
|
|
257
230
|
try {
|
|
258
|
-
await (0,
|
|
231
|
+
await (0, import_hooks.applyFilters)(
|
|
232
|
+
"editor.__unstableSavePost",
|
|
233
|
+
Promise.resolve(),
|
|
234
|
+
options
|
|
235
|
+
);
|
|
259
236
|
} catch (err) {
|
|
260
237
|
error = err;
|
|
261
238
|
}
|
|
262
239
|
}
|
|
263
240
|
if (!error) {
|
|
264
241
|
try {
|
|
265
|
-
await (0,
|
|
266
|
-
|
|
267
|
-
type: previousRecord.type
|
|
268
|
-
|
|
242
|
+
await (0, import_hooks.doActionAsync)(
|
|
243
|
+
"editor.savePost",
|
|
244
|
+
{ id: previousRecord.id, type: previousRecord.type },
|
|
245
|
+
options
|
|
246
|
+
);
|
|
269
247
|
} catch (err) {
|
|
270
248
|
error = err;
|
|
271
249
|
}
|
|
272
250
|
}
|
|
273
|
-
dispatch({
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
});
|
|
277
|
-
if (!options.isAutosave && previousRecord.type === 'wp_template') {
|
|
278
|
-
templateActivationNotice({
|
|
279
|
-
select,
|
|
280
|
-
dispatch,
|
|
281
|
-
registry
|
|
282
|
-
});
|
|
251
|
+
dispatch({ type: "REQUEST_POST_UPDATE_FINISH", options });
|
|
252
|
+
if (!options.isAutosave && previousRecord.type === "wp_template" && (typeof previousRecord.id === "number" || /^\d+$/.test(previousRecord.id))) {
|
|
253
|
+
templateActivationNotice({ select, dispatch, registry });
|
|
283
254
|
}
|
|
284
255
|
if (error) {
|
|
285
|
-
const args = (0,
|
|
256
|
+
const args = (0, import_notice_builder.getNotificationArgumentsForSaveFail)({
|
|
286
257
|
post: previousRecord,
|
|
287
258
|
edits,
|
|
288
259
|
error
|
|
289
260
|
});
|
|
290
261
|
if (args.length) {
|
|
291
|
-
registry.dispatch(
|
|
262
|
+
registry.dispatch(import_notices.store).createErrorNotice(...args);
|
|
292
263
|
}
|
|
293
264
|
} else {
|
|
294
265
|
const updatedRecord = select.getCurrentPost();
|
|
295
|
-
const args = (0,
|
|
266
|
+
const args = (0, import_notice_builder.getNotificationArgumentsForSaveSuccess)({
|
|
296
267
|
previousPost: previousRecord,
|
|
297
268
|
post: updatedRecord,
|
|
298
|
-
postType: await registry.resolveSelect(
|
|
269
|
+
postType: await registry.resolveSelect(import_core_data.store).getPostType(updatedRecord.type),
|
|
299
270
|
options
|
|
300
271
|
});
|
|
301
272
|
if (args.length) {
|
|
302
|
-
registry.dispatch(
|
|
273
|
+
registry.dispatch(import_notices.store).createSuccessNotice(...args);
|
|
303
274
|
}
|
|
304
|
-
// Make sure that any edits after saving create an undo level and are
|
|
305
|
-
// considered for change detection.
|
|
306
275
|
if (!options.isAutosave) {
|
|
307
|
-
registry.dispatch(
|
|
276
|
+
registry.dispatch(import_block_editor.store).__unstableMarkLastChangeAsPersistent();
|
|
308
277
|
}
|
|
309
278
|
}
|
|
310
279
|
};
|
|
311
|
-
|
|
312
|
-
async function templateActivationNotice({
|
|
313
|
-
select,
|
|
314
|
-
registry
|
|
315
|
-
}) {
|
|
280
|
+
async function templateActivationNotice({ select, registry }) {
|
|
316
281
|
const editorSettings = select.getEditorSettings();
|
|
317
|
-
|
|
318
|
-
// Don't open for focused entity.
|
|
319
282
|
if (editorSettings.onNavigateToPreviousEntityRecord) {
|
|
320
283
|
return;
|
|
321
284
|
}
|
|
322
|
-
const {
|
|
323
|
-
|
|
324
|
-
slug
|
|
325
|
-
} = select.getCurrentPost();
|
|
326
|
-
const site = await registry.select(_coreData.store).getEntityRecord('root', 'site');
|
|
327
|
-
|
|
328
|
-
// Already active.
|
|
285
|
+
const { id, slug } = select.getCurrentPost();
|
|
286
|
+
const site = await registry.select(import_core_data.store).getEntityRecord("root", "site");
|
|
329
287
|
if (site.active_templates[slug] === id) {
|
|
330
288
|
return;
|
|
331
289
|
}
|
|
332
|
-
await registry.dispatch(
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
290
|
+
await registry.dispatch(import_notices.store).createNotice(
|
|
291
|
+
"info",
|
|
292
|
+
(0, import_i18n.sprintf)(
|
|
293
|
+
// translators: %s: template slug
|
|
294
|
+
(0, import_i18n.__)('This is a "%s" template. Do you want to activate it?'),
|
|
295
|
+
slug
|
|
296
|
+
),
|
|
297
|
+
{
|
|
298
|
+
id: "template-activate-notice",
|
|
299
|
+
actions: [
|
|
300
|
+
{
|
|
301
|
+
label: (0, import_i18n.__)("Activate"),
|
|
302
|
+
onClick: async () => {
|
|
303
|
+
await registry.dispatch(import_notices.store).removeNotice("template-activate-notice");
|
|
304
|
+
await registry.dispatch(import_notices.store).createNotice(
|
|
305
|
+
"info",
|
|
306
|
+
(0, import_i18n.__)("Activating template\u2026"),
|
|
307
|
+
{
|
|
308
|
+
id: "template-activating-notice"
|
|
309
|
+
}
|
|
310
|
+
);
|
|
311
|
+
try {
|
|
312
|
+
const currentSite = await registry.select(import_core_data.store).getEntityRecord("root", "site");
|
|
313
|
+
await registry.dispatch(import_core_data.store).saveEntityRecord(
|
|
314
|
+
"root",
|
|
315
|
+
"site",
|
|
316
|
+
{
|
|
317
|
+
active_templates: {
|
|
318
|
+
...currentSite.active_templates,
|
|
319
|
+
[slug]: id
|
|
320
|
+
}
|
|
321
|
+
},
|
|
322
|
+
{ throwOnError: true }
|
|
323
|
+
);
|
|
324
|
+
await registry.dispatch(import_notices.store).removeNotice("template-activating-notice");
|
|
325
|
+
await registry.dispatch(import_notices.store).createSuccessNotice(
|
|
326
|
+
(0, import_i18n.__)("Template activated.")
|
|
327
|
+
);
|
|
328
|
+
} catch (error) {
|
|
329
|
+
await registry.dispatch(import_notices.store).removeNotice("template-activating-notice");
|
|
330
|
+
await registry.dispatch(import_notices.store).createErrorNotice(
|
|
331
|
+
(0, import_i18n.__)("Template activation failed.")
|
|
332
|
+
);
|
|
333
|
+
throw error;
|
|
349
334
|
}
|
|
350
|
-
}
|
|
351
|
-
throwOnError: true
|
|
352
|
-
});
|
|
353
|
-
await registry.dispatch(_notices.store).removeNotice('template-activating-notice');
|
|
354
|
-
await registry.dispatch(_notices.store).createSuccessNotice((0, _i18n.__)('Template activated.'));
|
|
355
|
-
} catch (error) {
|
|
356
|
-
await registry.dispatch(_notices.store).removeNotice('template-activating-notice');
|
|
357
|
-
await registry.dispatch(_notices.store).createErrorNotice((0, _i18n.__)('Template activation failed.'));
|
|
358
|
-
// Rethrow for debugging.
|
|
359
|
-
throw error;
|
|
335
|
+
}
|
|
360
336
|
}
|
|
361
|
-
|
|
362
|
-
}
|
|
363
|
-
|
|
337
|
+
]
|
|
338
|
+
}
|
|
339
|
+
);
|
|
364
340
|
}
|
|
365
|
-
|
|
366
|
-
/**
|
|
367
|
-
* Action for refreshing the current post.
|
|
368
|
-
*
|
|
369
|
-
* @deprecated Since WordPress 6.0.
|
|
370
|
-
*/
|
|
371
341
|
function refreshPost() {
|
|
372
|
-
(0,
|
|
373
|
-
since:
|
|
374
|
-
version:
|
|
375
|
-
alternative:
|
|
342
|
+
(0, import_deprecated.default)("wp.data.dispatch( 'core/editor' ).refreshPost", {
|
|
343
|
+
since: "6.0",
|
|
344
|
+
version: "6.3",
|
|
345
|
+
alternative: "Use the core entities store instead"
|
|
376
346
|
});
|
|
377
|
-
return {
|
|
378
|
-
type: 'DO_NOTHING'
|
|
379
|
-
};
|
|
347
|
+
return { type: "DO_NOTHING" };
|
|
380
348
|
}
|
|
381
|
-
|
|
382
|
-
/**
|
|
383
|
-
* Action for trashing the current post in the editor.
|
|
384
|
-
*/
|
|
385
|
-
const trashPost = () => async ({
|
|
386
|
-
select,
|
|
387
|
-
dispatch,
|
|
388
|
-
registry
|
|
389
|
-
}) => {
|
|
349
|
+
const trashPost = () => async ({ select, dispatch, registry }) => {
|
|
390
350
|
const postTypeSlug = select.getCurrentPostType();
|
|
391
|
-
const postType = await registry.resolveSelect(
|
|
392
|
-
const {
|
|
393
|
-
|
|
394
|
-
rest_namespace: restNamespace = 'wp/v2'
|
|
395
|
-
} = postType;
|
|
396
|
-
dispatch({
|
|
397
|
-
type: 'REQUEST_POST_DELETE_START'
|
|
398
|
-
});
|
|
351
|
+
const postType = await registry.resolveSelect(import_core_data.store).getPostType(postTypeSlug);
|
|
352
|
+
const { rest_base: restBase, rest_namespace: restNamespace = "wp/v2" } = postType;
|
|
353
|
+
dispatch({ type: "REQUEST_POST_DELETE_START" });
|
|
399
354
|
try {
|
|
400
355
|
const post = select.getCurrentPost();
|
|
401
|
-
await (0,
|
|
356
|
+
await (0, import_api_fetch.default)({
|
|
402
357
|
path: `/${restNamespace}/${restBase}/${post.id}`,
|
|
403
|
-
method:
|
|
358
|
+
method: "DELETE"
|
|
404
359
|
});
|
|
405
360
|
await dispatch.savePost();
|
|
406
361
|
} catch (error) {
|
|
407
|
-
registry.dispatch(
|
|
408
|
-
error
|
|
409
|
-
|
|
362
|
+
registry.dispatch(import_notices.store).createErrorNotice(
|
|
363
|
+
...(0, import_notice_builder.getNotificationArgumentsForTrashFail)({ error })
|
|
364
|
+
);
|
|
410
365
|
}
|
|
411
|
-
dispatch({
|
|
412
|
-
type: 'REQUEST_POST_DELETE_FINISH'
|
|
413
|
-
});
|
|
366
|
+
dispatch({ type: "REQUEST_POST_DELETE_FINISH" });
|
|
414
367
|
};
|
|
415
|
-
|
|
416
|
-
/**
|
|
417
|
-
* Action that autosaves the current post. This
|
|
418
|
-
* includes server-side autosaving (default) and client-side (a.k.a. local)
|
|
419
|
-
* autosaving (e.g. on the Web, the post might be committed to Session
|
|
420
|
-
* Storage).
|
|
421
|
-
*
|
|
422
|
-
* @param {Object} [options] Extra flags to identify the autosave.
|
|
423
|
-
* @param {boolean} [options.local] Whether to perform a local autosave.
|
|
424
|
-
*/
|
|
425
|
-
exports.trashPost = trashPost;
|
|
426
|
-
const autosave = ({
|
|
427
|
-
local = false,
|
|
428
|
-
...options
|
|
429
|
-
} = {}) => async ({
|
|
430
|
-
select,
|
|
431
|
-
dispatch
|
|
432
|
-
}) => {
|
|
368
|
+
const autosave = ({ local = false, ...options } = {}) => async ({ select, dispatch }) => {
|
|
433
369
|
const post = select.getCurrentPost();
|
|
434
|
-
|
|
435
|
-
// Currently template autosaving is not supported.
|
|
436
|
-
if (post.type === 'wp_template') {
|
|
370
|
+
if (post.type === "wp_template") {
|
|
437
371
|
return;
|
|
438
372
|
}
|
|
439
373
|
if (local) {
|
|
440
374
|
const isPostNew = select.isEditedPostNew();
|
|
441
|
-
const title = select.getEditedPostAttribute(
|
|
442
|
-
const content = select.getEditedPostAttribute(
|
|
443
|
-
const excerpt = select.getEditedPostAttribute(
|
|
444
|
-
(0,
|
|
375
|
+
const title = select.getEditedPostAttribute("title");
|
|
376
|
+
const content = select.getEditedPostAttribute("content");
|
|
377
|
+
const excerpt = select.getEditedPostAttribute("excerpt");
|
|
378
|
+
(0, import_local_autosave.localAutosaveSet)(post.id, isPostNew, title, content, excerpt);
|
|
445
379
|
} else {
|
|
446
|
-
await dispatch.savePost({
|
|
447
|
-
isAutosave: true,
|
|
448
|
-
...options
|
|
449
|
-
});
|
|
380
|
+
await dispatch.savePost({ isAutosave: true, ...options });
|
|
450
381
|
}
|
|
451
382
|
};
|
|
452
|
-
|
|
453
|
-
const __unstableSaveForPreview = ({
|
|
454
|
-
forceIsAutosaveable
|
|
455
|
-
} = {}) => async ({
|
|
456
|
-
select,
|
|
457
|
-
dispatch
|
|
458
|
-
}) => {
|
|
383
|
+
const __unstableSaveForPreview = ({ forceIsAutosaveable } = {}) => async ({ select, dispatch }) => {
|
|
459
384
|
if ((forceIsAutosaveable || select.isEditedPostAutosaveable()) && !select.isPostLocked()) {
|
|
460
|
-
const isDraft = [
|
|
385
|
+
const isDraft = ["draft", "auto-draft"].includes(
|
|
386
|
+
select.getEditedPostAttribute("status")
|
|
387
|
+
);
|
|
461
388
|
if (isDraft) {
|
|
462
|
-
await dispatch.savePost({
|
|
463
|
-
isPreview: true
|
|
464
|
-
});
|
|
389
|
+
await dispatch.savePost({ isPreview: true });
|
|
465
390
|
} else {
|
|
466
|
-
await dispatch.autosave({
|
|
467
|
-
isPreview: true
|
|
468
|
-
});
|
|
391
|
+
await dispatch.autosave({ isPreview: true });
|
|
469
392
|
}
|
|
470
393
|
}
|
|
471
394
|
return select.getEditedPostPreviewLink();
|
|
472
395
|
};
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
* Action that restores last popped state in undo history.
|
|
476
|
-
*/
|
|
477
|
-
exports.__unstableSaveForPreview = __unstableSaveForPreview;
|
|
478
|
-
const redo = () => ({
|
|
479
|
-
registry
|
|
480
|
-
}) => {
|
|
481
|
-
registry.dispatch(_coreData.store).redo();
|
|
396
|
+
const redo = () => ({ registry }) => {
|
|
397
|
+
registry.dispatch(import_core_data.store).redo();
|
|
482
398
|
};
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
* Action that pops a record from undo history and undoes the edit.
|
|
486
|
-
*/
|
|
487
|
-
exports.redo = redo;
|
|
488
|
-
const undo = () => ({
|
|
489
|
-
registry
|
|
490
|
-
}) => {
|
|
491
|
-
registry.dispatch(_coreData.store).undo();
|
|
399
|
+
const undo = () => ({ registry }) => {
|
|
400
|
+
registry.dispatch(import_core_data.store).undo();
|
|
492
401
|
};
|
|
493
|
-
|
|
494
|
-
/**
|
|
495
|
-
* Action that creates an undo history record.
|
|
496
|
-
*
|
|
497
|
-
* @deprecated Since WordPress 6.0
|
|
498
|
-
*/
|
|
499
|
-
exports.undo = undo;
|
|
500
402
|
function createUndoLevel() {
|
|
501
|
-
(0,
|
|
502
|
-
since:
|
|
503
|
-
version:
|
|
504
|
-
alternative:
|
|
403
|
+
(0, import_deprecated.default)("wp.data.dispatch( 'core/editor' ).createUndoLevel", {
|
|
404
|
+
since: "6.0",
|
|
405
|
+
version: "6.3",
|
|
406
|
+
alternative: "Use the core entities store instead"
|
|
505
407
|
});
|
|
506
|
-
return {
|
|
507
|
-
type: 'DO_NOTHING'
|
|
508
|
-
};
|
|
408
|
+
return { type: "DO_NOTHING" };
|
|
509
409
|
}
|
|
510
|
-
|
|
511
|
-
/**
|
|
512
|
-
* Action that locks the editor.
|
|
513
|
-
*
|
|
514
|
-
* @param {Object} lock Details about the post lock status, user, and nonce.
|
|
515
|
-
* @return {Object} Action object.
|
|
516
|
-
*/
|
|
517
410
|
function updatePostLock(lock) {
|
|
518
411
|
return {
|
|
519
|
-
type:
|
|
412
|
+
type: "UPDATE_POST_LOCK",
|
|
520
413
|
lock
|
|
521
414
|
};
|
|
522
415
|
}
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
* Enable the publish sidebar.
|
|
526
|
-
*/
|
|
527
|
-
const enablePublishSidebar = () => ({
|
|
528
|
-
registry
|
|
529
|
-
}) => {
|
|
530
|
-
registry.dispatch(_preferences.store).set('core', 'isPublishSidebarEnabled', true);
|
|
416
|
+
const enablePublishSidebar = () => ({ registry }) => {
|
|
417
|
+
registry.dispatch(import_preferences.store).set("core", "isPublishSidebarEnabled", true);
|
|
531
418
|
};
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
* Disables the publish sidebar.
|
|
535
|
-
*/
|
|
536
|
-
exports.enablePublishSidebar = enablePublishSidebar;
|
|
537
|
-
const disablePublishSidebar = () => ({
|
|
538
|
-
registry
|
|
539
|
-
}) => {
|
|
540
|
-
registry.dispatch(_preferences.store).set('core', 'isPublishSidebarEnabled', false);
|
|
419
|
+
const disablePublishSidebar = () => ({ registry }) => {
|
|
420
|
+
registry.dispatch(import_preferences.store).set("core", "isPublishSidebarEnabled", false);
|
|
541
421
|
};
|
|
542
|
-
|
|
543
|
-
/**
|
|
544
|
-
* Action that locks post saving.
|
|
545
|
-
*
|
|
546
|
-
* @param {string} lockName The lock name.
|
|
547
|
-
*
|
|
548
|
-
* @example
|
|
549
|
-
* ```
|
|
550
|
-
* const { subscribe } = wp.data;
|
|
551
|
-
*
|
|
552
|
-
* const initialPostStatus = wp.data.select( 'core/editor' ).getEditedPostAttribute( 'status' );
|
|
553
|
-
*
|
|
554
|
-
* // Only allow publishing posts that are set to a future date.
|
|
555
|
-
* if ( 'publish' !== initialPostStatus ) {
|
|
556
|
-
*
|
|
557
|
-
* // Track locking.
|
|
558
|
-
* let locked = false;
|
|
559
|
-
*
|
|
560
|
-
* // Watch for the publish event.
|
|
561
|
-
* let unssubscribe = subscribe( () => {
|
|
562
|
-
* const currentPostStatus = wp.data.select( 'core/editor' ).getEditedPostAttribute( 'status' );
|
|
563
|
-
* if ( 'publish' !== currentPostStatus ) {
|
|
564
|
-
*
|
|
565
|
-
* // Compare the post date to the current date, lock the post if the date isn't in the future.
|
|
566
|
-
* const postDate = new Date( wp.data.select( 'core/editor' ).getEditedPostAttribute( 'date' ) );
|
|
567
|
-
* const currentDate = new Date();
|
|
568
|
-
* if ( postDate.getTime() <= currentDate.getTime() ) {
|
|
569
|
-
* if ( ! locked ) {
|
|
570
|
-
* locked = true;
|
|
571
|
-
* wp.data.dispatch( 'core/editor' ).lockPostSaving( 'futurelock' );
|
|
572
|
-
* }
|
|
573
|
-
* } else {
|
|
574
|
-
* if ( locked ) {
|
|
575
|
-
* locked = false;
|
|
576
|
-
* wp.data.dispatch( 'core/editor' ).unlockPostSaving( 'futurelock' );
|
|
577
|
-
* }
|
|
578
|
-
* }
|
|
579
|
-
* }
|
|
580
|
-
* } );
|
|
581
|
-
* }
|
|
582
|
-
* ```
|
|
583
|
-
*
|
|
584
|
-
* @return {Object} Action object
|
|
585
|
-
*/
|
|
586
|
-
exports.disablePublishSidebar = disablePublishSidebar;
|
|
587
422
|
function lockPostSaving(lockName) {
|
|
588
423
|
return {
|
|
589
|
-
type:
|
|
424
|
+
type: "LOCK_POST_SAVING",
|
|
590
425
|
lockName
|
|
591
426
|
};
|
|
592
427
|
}
|
|
593
|
-
|
|
594
|
-
/**
|
|
595
|
-
* Action that unlocks post saving.
|
|
596
|
-
*
|
|
597
|
-
* @param {string} lockName The lock name.
|
|
598
|
-
*
|
|
599
|
-
* @example
|
|
600
|
-
* ```
|
|
601
|
-
* // Unlock post saving with the lock key `mylock`:
|
|
602
|
-
* wp.data.dispatch( 'core/editor' ).unlockPostSaving( 'mylock' );
|
|
603
|
-
* ```
|
|
604
|
-
*
|
|
605
|
-
* @return {Object} Action object
|
|
606
|
-
*/
|
|
607
428
|
function unlockPostSaving(lockName) {
|
|
608
429
|
return {
|
|
609
|
-
type:
|
|
430
|
+
type: "UNLOCK_POST_SAVING",
|
|
610
431
|
lockName
|
|
611
432
|
};
|
|
612
433
|
}
|
|
613
|
-
|
|
614
|
-
/**
|
|
615
|
-
* Action that locks post autosaving.
|
|
616
|
-
*
|
|
617
|
-
* @param {string} lockName The lock name.
|
|
618
|
-
*
|
|
619
|
-
* @example
|
|
620
|
-
* ```
|
|
621
|
-
* // Lock post autosaving with the lock key `mylock`:
|
|
622
|
-
* wp.data.dispatch( 'core/editor' ).lockPostAutosaving( 'mylock' );
|
|
623
|
-
* ```
|
|
624
|
-
*
|
|
625
|
-
* @return {Object} Action object
|
|
626
|
-
*/
|
|
627
434
|
function lockPostAutosaving(lockName) {
|
|
628
435
|
return {
|
|
629
|
-
type:
|
|
436
|
+
type: "LOCK_POST_AUTOSAVING",
|
|
630
437
|
lockName
|
|
631
438
|
};
|
|
632
439
|
}
|
|
633
|
-
|
|
634
|
-
/**
|
|
635
|
-
* Action that unlocks post autosaving.
|
|
636
|
-
*
|
|
637
|
-
* @param {string} lockName The lock name.
|
|
638
|
-
*
|
|
639
|
-
* @example
|
|
640
|
-
* ```
|
|
641
|
-
* // Unlock post saving with the lock key `mylock`:
|
|
642
|
-
* wp.data.dispatch( 'core/editor' ).unlockPostAutosaving( 'mylock' );
|
|
643
|
-
* ```
|
|
644
|
-
*
|
|
645
|
-
* @return {Object} Action object
|
|
646
|
-
*/
|
|
647
440
|
function unlockPostAutosaving(lockName) {
|
|
648
441
|
return {
|
|
649
|
-
type:
|
|
442
|
+
type: "UNLOCK_POST_AUTOSAVING",
|
|
650
443
|
lockName
|
|
651
444
|
};
|
|
652
445
|
}
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
*
|
|
657
|
-
* @param {Array} blocks Block Array.
|
|
658
|
-
* @param {Object} [options] Optional options.
|
|
659
|
-
*/
|
|
660
|
-
const resetEditorBlocks = (blocks, options = {}) => ({
|
|
661
|
-
select,
|
|
662
|
-
dispatch,
|
|
663
|
-
registry
|
|
664
|
-
}) => {
|
|
665
|
-
const {
|
|
666
|
-
__unstableShouldCreateUndoLevel,
|
|
667
|
-
selection
|
|
668
|
-
} = options;
|
|
669
|
-
const edits = {
|
|
670
|
-
blocks,
|
|
671
|
-
selection
|
|
672
|
-
};
|
|
446
|
+
const resetEditorBlocks = (blocks, options = {}) => ({ select, dispatch, registry }) => {
|
|
447
|
+
const { __unstableShouldCreateUndoLevel, selection } = options;
|
|
448
|
+
const edits = { blocks, selection };
|
|
673
449
|
if (__unstableShouldCreateUndoLevel !== false) {
|
|
674
|
-
const {
|
|
675
|
-
|
|
676
|
-
type
|
|
677
|
-
} = select.getCurrentPost();
|
|
678
|
-
const noChange = registry.select(_coreData.store).getEditedEntityRecord('postType', type, id).blocks === edits.blocks;
|
|
450
|
+
const { id, type } = select.getCurrentPost();
|
|
451
|
+
const noChange = registry.select(import_core_data.store).getEditedEntityRecord("postType", type, id).blocks === edits.blocks;
|
|
679
452
|
if (noChange) {
|
|
680
|
-
registry.dispatch(
|
|
453
|
+
registry.dispatch(import_core_data.store).__unstableCreateUndoLevel("postType", type, id);
|
|
681
454
|
return;
|
|
682
455
|
}
|
|
683
|
-
|
|
684
|
-
// We create a new function here on every persistent edit
|
|
685
|
-
// to make sure the edit makes the post dirty and creates
|
|
686
|
-
// a new undo level.
|
|
687
|
-
edits.content = ({
|
|
688
|
-
blocks: blocksForSerialization = []
|
|
689
|
-
}) => (0, _blocks.__unstableSerializeAndClean)(blocksForSerialization);
|
|
456
|
+
edits.content = ({ blocks: blocksForSerialization = [] }) => (0, import_blocks.__unstableSerializeAndClean)(blocksForSerialization);
|
|
690
457
|
}
|
|
691
458
|
dispatch.editPost(edits);
|
|
692
459
|
};
|
|
693
|
-
|
|
694
|
-
/*
|
|
695
|
-
* Returns an action object used in signalling that the post editor settings have been updated.
|
|
696
|
-
*
|
|
697
|
-
* @param {Object} settings Updated settings
|
|
698
|
-
*
|
|
699
|
-
* @return {Object} Action object
|
|
700
|
-
*/
|
|
701
|
-
exports.resetEditorBlocks = resetEditorBlocks;
|
|
702
460
|
function updateEditorSettings(settings) {
|
|
703
461
|
return {
|
|
704
|
-
type:
|
|
462
|
+
type: "UPDATE_EDITOR_SETTINGS",
|
|
705
463
|
settings
|
|
706
464
|
};
|
|
707
465
|
}
|
|
708
|
-
|
|
709
|
-
/**
|
|
710
|
-
* Returns an action used to set the rendering mode of the post editor. We support multiple rendering modes:
|
|
711
|
-
*
|
|
712
|
-
* - `post-only`: This mode extracts the post blocks from the template and renders only those. The idea is to allow the user to edit the post/page in isolation without the wrapping template.
|
|
713
|
-
* - `template-locked`: This mode renders both the template and the post blocks but the template blocks are locked and can't be edited. The post blocks are editable.
|
|
714
|
-
*
|
|
715
|
-
* @param {string} mode Mode (one of 'post-only' or 'template-locked').
|
|
716
|
-
*/
|
|
717
|
-
const setRenderingMode = mode => ({
|
|
718
|
-
dispatch,
|
|
719
|
-
registry,
|
|
720
|
-
select
|
|
721
|
-
}) => {
|
|
466
|
+
const setRenderingMode = (mode) => ({ dispatch, registry, select }) => {
|
|
722
467
|
if (select.__unstableIsEditorReady()) {
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
dispatch.editPost({
|
|
726
|
-
selection: undefined
|
|
727
|
-
}, {
|
|
728
|
-
undoIgnore: true
|
|
729
|
-
});
|
|
468
|
+
registry.dispatch(import_block_editor.store).clearSelectedBlock();
|
|
469
|
+
dispatch.editPost({ selection: void 0 }, { undoIgnore: true });
|
|
730
470
|
}
|
|
731
471
|
dispatch({
|
|
732
|
-
type:
|
|
472
|
+
type: "SET_RENDERING_MODE",
|
|
733
473
|
mode
|
|
734
474
|
});
|
|
735
475
|
};
|
|
736
|
-
|
|
737
|
-
/**
|
|
738
|
-
* Action that changes the width of the editing canvas.
|
|
739
|
-
*
|
|
740
|
-
* @param {string} deviceType
|
|
741
|
-
*
|
|
742
|
-
* @return {Object} Action object.
|
|
743
|
-
*/
|
|
744
|
-
exports.setRenderingMode = setRenderingMode;
|
|
745
476
|
function setDeviceType(deviceType) {
|
|
746
477
|
return {
|
|
747
|
-
type:
|
|
478
|
+
type: "SET_DEVICE_TYPE",
|
|
748
479
|
deviceType
|
|
749
480
|
};
|
|
750
481
|
}
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
* Returns an action object used to enable or disable a panel in the editor.
|
|
754
|
-
*
|
|
755
|
-
* @param {string} panelName A string that identifies the panel to enable or disable.
|
|
756
|
-
*
|
|
757
|
-
* @return {Object} Action object.
|
|
758
|
-
*/
|
|
759
|
-
const toggleEditorPanelEnabled = panelName => ({
|
|
760
|
-
registry
|
|
761
|
-
}) => {
|
|
762
|
-
var _registry$select$get;
|
|
763
|
-
const inactivePanels = (_registry$select$get = registry.select(_preferences.store).get('core', 'inactivePanels')) !== null && _registry$select$get !== void 0 ? _registry$select$get : [];
|
|
482
|
+
const toggleEditorPanelEnabled = (panelName) => ({ registry }) => {
|
|
483
|
+
const inactivePanels = registry.select(import_preferences.store).get("core", "inactivePanels") ?? [];
|
|
764
484
|
const isPanelInactive = !!inactivePanels?.includes(panelName);
|
|
765
|
-
|
|
766
|
-
// If the panel is inactive, remove it to enable it, else add it to
|
|
767
|
-
// make it inactive.
|
|
768
485
|
let updatedInactivePanels;
|
|
769
486
|
if (isPanelInactive) {
|
|
770
|
-
updatedInactivePanels = inactivePanels.filter(
|
|
487
|
+
updatedInactivePanels = inactivePanels.filter(
|
|
488
|
+
(invactivePanelName) => invactivePanelName !== panelName
|
|
489
|
+
);
|
|
771
490
|
} else {
|
|
772
491
|
updatedInactivePanels = [...inactivePanels, panelName];
|
|
773
492
|
}
|
|
774
|
-
registry.dispatch(
|
|
493
|
+
registry.dispatch(import_preferences.store).set("core", "inactivePanels", updatedInactivePanels);
|
|
775
494
|
};
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
* Opens a closed panel and closes an open panel.
|
|
779
|
-
*
|
|
780
|
-
* @param {string} panelName A string that identifies the panel to open or close.
|
|
781
|
-
*/
|
|
782
|
-
exports.toggleEditorPanelEnabled = toggleEditorPanelEnabled;
|
|
783
|
-
const toggleEditorPanelOpened = panelName => ({
|
|
784
|
-
registry
|
|
785
|
-
}) => {
|
|
786
|
-
var _registry$select$get2;
|
|
787
|
-
const openPanels = (_registry$select$get2 = registry.select(_preferences.store).get('core', 'openPanels')) !== null && _registry$select$get2 !== void 0 ? _registry$select$get2 : [];
|
|
495
|
+
const toggleEditorPanelOpened = (panelName) => ({ registry }) => {
|
|
496
|
+
const openPanels = registry.select(import_preferences.store).get("core", "openPanels") ?? [];
|
|
788
497
|
const isPanelOpen = !!openPanels?.includes(panelName);
|
|
789
|
-
|
|
790
|
-
// If the panel is open, remove it to close it, else add it to
|
|
791
|
-
// make it open.
|
|
792
498
|
let updatedOpenPanels;
|
|
793
499
|
if (isPanelOpen) {
|
|
794
|
-
updatedOpenPanels = openPanels.filter(
|
|
500
|
+
updatedOpenPanels = openPanels.filter(
|
|
501
|
+
(openPanelName) => openPanelName !== panelName
|
|
502
|
+
);
|
|
795
503
|
} else {
|
|
796
504
|
updatedOpenPanels = [...openPanels, panelName];
|
|
797
505
|
}
|
|
798
|
-
registry.dispatch(
|
|
506
|
+
registry.dispatch(import_preferences.store).set("core", "openPanels", updatedOpenPanels);
|
|
799
507
|
};
|
|
800
|
-
|
|
801
|
-
/**
|
|
802
|
-
* Returns an action object used to remove a panel from the editor.
|
|
803
|
-
*
|
|
804
|
-
* @param {string} panelName A string that identifies the panel to remove.
|
|
805
|
-
*
|
|
806
|
-
* @return {Object} Action object.
|
|
807
|
-
*/
|
|
808
|
-
exports.toggleEditorPanelOpened = toggleEditorPanelOpened;
|
|
809
508
|
function removeEditorPanel(panelName) {
|
|
810
509
|
return {
|
|
811
|
-
type:
|
|
510
|
+
type: "REMOVE_PANEL",
|
|
812
511
|
panelName
|
|
813
512
|
};
|
|
814
513
|
}
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
*
|
|
819
|
-
* @param {boolean|Object} value Whether the inserter should be
|
|
820
|
-
* opened (true) or closed (false).
|
|
821
|
-
* To specify an insertion point,
|
|
822
|
-
* use an object.
|
|
823
|
-
* @param {string} value.rootClientId The root client ID to insert at.
|
|
824
|
-
* @param {number} value.insertionIndex The index to insert at.
|
|
825
|
-
* @param {string} value.filterValue A query to filter the inserter results.
|
|
826
|
-
* @param {Function} value.onSelect A callback when an item is selected.
|
|
827
|
-
* @param {string} value.tab The tab to open in the inserter.
|
|
828
|
-
* @param {string} value.category The category to initialize in the inserter.
|
|
829
|
-
*
|
|
830
|
-
* @return {Object} Action object.
|
|
831
|
-
*/
|
|
832
|
-
const setIsInserterOpened = value => ({
|
|
833
|
-
dispatch,
|
|
834
|
-
registry
|
|
835
|
-
}) => {
|
|
836
|
-
if (typeof value === 'object' && value.hasOwnProperty('rootClientId') && value.hasOwnProperty('insertionIndex')) {
|
|
837
|
-
(0, _lockUnlock.unlock)(registry.dispatch(_blockEditor.store)).setInsertionPoint({
|
|
514
|
+
const setIsInserterOpened = (value) => ({ dispatch, registry }) => {
|
|
515
|
+
if (typeof value === "object" && value.hasOwnProperty("rootClientId") && value.hasOwnProperty("insertionIndex")) {
|
|
516
|
+
(0, import_lock_unlock.unlock)(registry.dispatch(import_block_editor.store)).setInsertionPoint({
|
|
838
517
|
rootClientId: value.rootClientId,
|
|
839
518
|
index: value.insertionIndex
|
|
840
519
|
});
|
|
841
520
|
}
|
|
842
521
|
dispatch({
|
|
843
|
-
type:
|
|
522
|
+
type: "SET_IS_INSERTER_OPENED",
|
|
844
523
|
value
|
|
845
524
|
});
|
|
846
525
|
};
|
|
847
|
-
|
|
848
|
-
/**
|
|
849
|
-
* Returns an action object used to open/close the list view.
|
|
850
|
-
*
|
|
851
|
-
* @param {boolean} isOpen A boolean representing whether the list view should be opened or closed.
|
|
852
|
-
* @return {Object} Action object.
|
|
853
|
-
*/
|
|
854
|
-
exports.setIsInserterOpened = setIsInserterOpened;
|
|
855
526
|
function setIsListViewOpened(isOpen) {
|
|
856
527
|
return {
|
|
857
|
-
type:
|
|
528
|
+
type: "SET_IS_LIST_VIEW_OPENED",
|
|
858
529
|
isOpen
|
|
859
530
|
};
|
|
860
531
|
}
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
* Action that toggles Distraction free mode.
|
|
864
|
-
* Distraction free mode expects there are no sidebars, as due to the
|
|
865
|
-
* z-index values set, you can't close sidebars.
|
|
866
|
-
*
|
|
867
|
-
* @param {Object} [options={}] Optional configuration object
|
|
868
|
-
* @param {boolean} [options.createNotice=true] Whether to create a notice
|
|
869
|
-
*/
|
|
870
|
-
const toggleDistractionFree = ({
|
|
871
|
-
createNotice = true
|
|
872
|
-
} = {}) => ({
|
|
873
|
-
dispatch,
|
|
874
|
-
registry
|
|
875
|
-
}) => {
|
|
876
|
-
const isDistractionFree = registry.select(_preferences.store).get('core', 'distractionFree');
|
|
532
|
+
const toggleDistractionFree = ({ createNotice = true } = {}) => ({ dispatch, registry }) => {
|
|
533
|
+
const isDistractionFree = registry.select(import_preferences.store).get("core", "distractionFree");
|
|
877
534
|
if (isDistractionFree) {
|
|
878
|
-
registry.dispatch(
|
|
535
|
+
registry.dispatch(import_preferences.store).set("core", "fixedToolbar", false);
|
|
879
536
|
}
|
|
880
537
|
if (!isDistractionFree) {
|
|
881
538
|
registry.batch(() => {
|
|
882
|
-
registry.dispatch(
|
|
539
|
+
registry.dispatch(import_preferences.store).set("core", "fixedToolbar", true);
|
|
883
540
|
dispatch.setIsInserterOpened(false);
|
|
884
541
|
dispatch.setIsListViewOpened(false);
|
|
885
|
-
(0,
|
|
542
|
+
(0, import_lock_unlock.unlock)(
|
|
543
|
+
registry.dispatch(import_block_editor.store)
|
|
544
|
+
).resetZoomLevel();
|
|
886
545
|
});
|
|
887
546
|
}
|
|
888
547
|
registry.batch(() => {
|
|
889
|
-
registry.dispatch(
|
|
548
|
+
registry.dispatch(import_preferences.store).set("core", "distractionFree", !isDistractionFree);
|
|
890
549
|
if (createNotice) {
|
|
891
|
-
registry.dispatch(
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
550
|
+
registry.dispatch(import_notices.store).createInfoNotice(
|
|
551
|
+
isDistractionFree ? (0, import_i18n.__)("Distraction free mode deactivated.") : (0, import_i18n.__)("Distraction free mode activated."),
|
|
552
|
+
{
|
|
553
|
+
id: "core/editor/distraction-free-mode/notice",
|
|
554
|
+
type: "snackbar",
|
|
555
|
+
actions: [
|
|
556
|
+
{
|
|
557
|
+
label: (0, import_i18n.__)("Undo"),
|
|
558
|
+
onClick: () => {
|
|
559
|
+
registry.batch(() => {
|
|
560
|
+
registry.dispatch(import_preferences.store).set(
|
|
561
|
+
"core",
|
|
562
|
+
"fixedToolbar",
|
|
563
|
+
isDistractionFree
|
|
564
|
+
);
|
|
565
|
+
registry.dispatch(import_preferences.store).toggle(
|
|
566
|
+
"core",
|
|
567
|
+
"distractionFree"
|
|
568
|
+
);
|
|
569
|
+
});
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
]
|
|
573
|
+
}
|
|
574
|
+
);
|
|
904
575
|
}
|
|
905
576
|
});
|
|
906
577
|
};
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
}]
|
|
926
|
-
});
|
|
578
|
+
const toggleSpotlightMode = () => ({ registry }) => {
|
|
579
|
+
registry.dispatch(import_preferences.store).toggle("core", "focusMode");
|
|
580
|
+
const isFocusMode = registry.select(import_preferences.store).get("core", "focusMode");
|
|
581
|
+
registry.dispatch(import_notices.store).createInfoNotice(
|
|
582
|
+
isFocusMode ? (0, import_i18n.__)("Spotlight mode activated.") : (0, import_i18n.__)("Spotlight mode deactivated."),
|
|
583
|
+
{
|
|
584
|
+
id: "core/editor/toggle-spotlight-mode/notice",
|
|
585
|
+
type: "snackbar",
|
|
586
|
+
actions: [
|
|
587
|
+
{
|
|
588
|
+
label: (0, import_i18n.__)("Undo"),
|
|
589
|
+
onClick: () => {
|
|
590
|
+
registry.dispatch(import_preferences.store).toggle("core", "focusMode");
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
]
|
|
594
|
+
}
|
|
595
|
+
);
|
|
927
596
|
};
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
}]
|
|
947
|
-
});
|
|
597
|
+
const toggleTopToolbar = () => ({ registry }) => {
|
|
598
|
+
registry.dispatch(import_preferences.store).toggle("core", "fixedToolbar");
|
|
599
|
+
const isTopToolbar = registry.select(import_preferences.store).get("core", "fixedToolbar");
|
|
600
|
+
registry.dispatch(import_notices.store).createInfoNotice(
|
|
601
|
+
isTopToolbar ? (0, import_i18n.__)("Top toolbar activated.") : (0, import_i18n.__)("Top toolbar deactivated."),
|
|
602
|
+
{
|
|
603
|
+
id: "core/editor/toggle-top-toolbar/notice",
|
|
604
|
+
type: "snackbar",
|
|
605
|
+
actions: [
|
|
606
|
+
{
|
|
607
|
+
label: (0, import_i18n.__)("Undo"),
|
|
608
|
+
onClick: () => {
|
|
609
|
+
registry.dispatch(import_preferences.store).toggle("core", "fixedToolbar");
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
]
|
|
613
|
+
}
|
|
614
|
+
);
|
|
948
615
|
};
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
*/
|
|
955
|
-
exports.toggleTopToolbar = toggleTopToolbar;
|
|
956
|
-
const switchEditorMode = mode => ({
|
|
957
|
-
dispatch,
|
|
958
|
-
registry
|
|
959
|
-
}) => {
|
|
960
|
-
registry.dispatch(_preferences.store).set('core', 'editorMode', mode);
|
|
961
|
-
if (mode !== 'visual') {
|
|
962
|
-
// Unselect blocks when we switch to a non visual mode.
|
|
963
|
-
registry.dispatch(_blockEditor.store).clearSelectedBlock();
|
|
964
|
-
// Exit zoom out state when switching to a non visual mode.
|
|
965
|
-
(0, _lockUnlock.unlock)(registry.dispatch(_blockEditor.store)).resetZoomLevel();
|
|
616
|
+
const switchEditorMode = (mode) => ({ dispatch, registry }) => {
|
|
617
|
+
registry.dispatch(import_preferences.store).set("core", "editorMode", mode);
|
|
618
|
+
if (mode !== "visual") {
|
|
619
|
+
registry.dispatch(import_block_editor.store).clearSelectedBlock();
|
|
620
|
+
(0, import_lock_unlock.unlock)(registry.dispatch(import_block_editor.store)).resetZoomLevel();
|
|
966
621
|
}
|
|
967
|
-
if (mode ===
|
|
968
|
-
(0,
|
|
969
|
-
} else if (mode ===
|
|
970
|
-
const isDistractionFree = registry.select(
|
|
622
|
+
if (mode === "visual") {
|
|
623
|
+
(0, import_a11y.speak)((0, import_i18n.__)("Visual editor selected"), "assertive");
|
|
624
|
+
} else if (mode === "text") {
|
|
625
|
+
const isDistractionFree = registry.select(import_preferences.store).get("core", "distractionFree");
|
|
971
626
|
if (isDistractionFree) {
|
|
972
627
|
dispatch.toggleDistractionFree();
|
|
973
628
|
}
|
|
974
|
-
(0,
|
|
629
|
+
(0, import_a11y.speak)((0, import_i18n.__)("Code editor selected"), "assertive");
|
|
975
630
|
}
|
|
976
631
|
};
|
|
977
|
-
|
|
978
|
-
/**
|
|
979
|
-
* Returns an action object used in signalling that the user opened the publish
|
|
980
|
-
* sidebar.
|
|
981
|
-
*
|
|
982
|
-
* @return {Object} Action object
|
|
983
|
-
*/
|
|
984
|
-
exports.switchEditorMode = switchEditorMode;
|
|
985
632
|
function openPublishSidebar() {
|
|
986
633
|
return {
|
|
987
|
-
type:
|
|
634
|
+
type: "OPEN_PUBLISH_SIDEBAR"
|
|
988
635
|
};
|
|
989
636
|
}
|
|
990
|
-
|
|
991
|
-
/**
|
|
992
|
-
* Returns an action object used in signalling that the user closed the
|
|
993
|
-
* publish sidebar.
|
|
994
|
-
*
|
|
995
|
-
* @return {Object} Action object.
|
|
996
|
-
*/
|
|
997
637
|
function closePublishSidebar() {
|
|
998
638
|
return {
|
|
999
|
-
type:
|
|
639
|
+
type: "CLOSE_PUBLISH_SIDEBAR"
|
|
1000
640
|
};
|
|
1001
641
|
}
|
|
1002
|
-
|
|
1003
|
-
/**
|
|
1004
|
-
* Returns an action object used in signalling that the user toggles the publish sidebar.
|
|
1005
|
-
*
|
|
1006
|
-
* @return {Object} Action object
|
|
1007
|
-
*/
|
|
1008
642
|
function togglePublishSidebar() {
|
|
1009
643
|
return {
|
|
1010
|
-
type:
|
|
644
|
+
type: "TOGGLE_PUBLISH_SIDEBAR"
|
|
1011
645
|
};
|
|
1012
646
|
}
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
const getBlockEditorAction = name => (...args) => ({
|
|
1019
|
-
registry
|
|
1020
|
-
}) => {
|
|
1021
|
-
(0, _deprecated.default)("`wp.data.dispatch( 'core/editor' )." + name + '`', {
|
|
1022
|
-
since: '5.3',
|
|
1023
|
-
alternative: "`wp.data.dispatch( 'core/block-editor' )." + name + '`',
|
|
1024
|
-
version: '6.2'
|
|
647
|
+
const getBlockEditorAction = (name) => (...args) => ({ registry }) => {
|
|
648
|
+
(0, import_deprecated.default)("`wp.data.dispatch( 'core/editor' )." + name + "`", {
|
|
649
|
+
since: "5.3",
|
|
650
|
+
alternative: "`wp.data.dispatch( 'core/block-editor' )." + name + "`",
|
|
651
|
+
version: "6.2"
|
|
1025
652
|
});
|
|
1026
|
-
registry.dispatch(
|
|
653
|
+
registry.dispatch(import_block_editor.store)[name](...args);
|
|
1027
654
|
};
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
const
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
const
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
const
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
const
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
const
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
const removeBlocks = exports.removeBlocks = getBlockEditorAction('removeBlocks');
|
|
1143
|
-
|
|
1144
|
-
/**
|
|
1145
|
-
* @see removeBlock in core/block-editor store.
|
|
1146
|
-
*/
|
|
1147
|
-
const removeBlock = exports.removeBlock = getBlockEditorAction('removeBlock');
|
|
1148
|
-
|
|
1149
|
-
/**
|
|
1150
|
-
* @see toggleBlockMode in core/block-editor store.
|
|
1151
|
-
*/
|
|
1152
|
-
const toggleBlockMode = exports.toggleBlockMode = getBlockEditorAction('toggleBlockMode');
|
|
1153
|
-
|
|
1154
|
-
/**
|
|
1155
|
-
* @see startTyping in core/block-editor store.
|
|
1156
|
-
*/
|
|
1157
|
-
const startTyping = exports.startTyping = getBlockEditorAction('startTyping');
|
|
1158
|
-
|
|
1159
|
-
/**
|
|
1160
|
-
* @see stopTyping in core/block-editor store.
|
|
1161
|
-
*/
|
|
1162
|
-
const stopTyping = exports.stopTyping = getBlockEditorAction('stopTyping');
|
|
1163
|
-
|
|
1164
|
-
/**
|
|
1165
|
-
* @see enterFormattedText in core/block-editor store.
|
|
1166
|
-
*/
|
|
1167
|
-
const enterFormattedText = exports.enterFormattedText = getBlockEditorAction('enterFormattedText');
|
|
1168
|
-
|
|
1169
|
-
/**
|
|
1170
|
-
* @see exitFormattedText in core/block-editor store.
|
|
1171
|
-
*/
|
|
1172
|
-
const exitFormattedText = exports.exitFormattedText = getBlockEditorAction('exitFormattedText');
|
|
1173
|
-
|
|
1174
|
-
/**
|
|
1175
|
-
* @see insertDefaultBlock in core/block-editor store.
|
|
1176
|
-
*/
|
|
1177
|
-
const insertDefaultBlock = exports.insertDefaultBlock = getBlockEditorAction('insertDefaultBlock');
|
|
1178
|
-
|
|
1179
|
-
/**
|
|
1180
|
-
* @see updateBlockListSettings in core/block-editor store.
|
|
1181
|
-
*/
|
|
1182
|
-
const updateBlockListSettings = exports.updateBlockListSettings = getBlockEditorAction('updateBlockListSettings');
|
|
1183
|
-
//# sourceMappingURL=actions.js.map
|
|
655
|
+
const resetBlocks = getBlockEditorAction("resetBlocks");
|
|
656
|
+
const receiveBlocks = getBlockEditorAction("receiveBlocks");
|
|
657
|
+
const updateBlock = getBlockEditorAction("updateBlock");
|
|
658
|
+
const updateBlockAttributes = getBlockEditorAction(
|
|
659
|
+
"updateBlockAttributes"
|
|
660
|
+
);
|
|
661
|
+
const selectBlock = getBlockEditorAction("selectBlock");
|
|
662
|
+
const startMultiSelect = getBlockEditorAction("startMultiSelect");
|
|
663
|
+
const stopMultiSelect = getBlockEditorAction("stopMultiSelect");
|
|
664
|
+
const multiSelect = getBlockEditorAction("multiSelect");
|
|
665
|
+
const clearSelectedBlock = getBlockEditorAction("clearSelectedBlock");
|
|
666
|
+
const toggleSelection = getBlockEditorAction("toggleSelection");
|
|
667
|
+
const replaceBlocks = getBlockEditorAction("replaceBlocks");
|
|
668
|
+
const replaceBlock = getBlockEditorAction("replaceBlock");
|
|
669
|
+
const moveBlocksDown = getBlockEditorAction("moveBlocksDown");
|
|
670
|
+
const moveBlocksUp = getBlockEditorAction("moveBlocksUp");
|
|
671
|
+
const moveBlockToPosition = getBlockEditorAction(
|
|
672
|
+
"moveBlockToPosition"
|
|
673
|
+
);
|
|
674
|
+
const insertBlock = getBlockEditorAction("insertBlock");
|
|
675
|
+
const insertBlocks = getBlockEditorAction("insertBlocks");
|
|
676
|
+
const showInsertionPoint = getBlockEditorAction("showInsertionPoint");
|
|
677
|
+
const hideInsertionPoint = getBlockEditorAction("hideInsertionPoint");
|
|
678
|
+
const setTemplateValidity = getBlockEditorAction(
|
|
679
|
+
"setTemplateValidity"
|
|
680
|
+
);
|
|
681
|
+
const synchronizeTemplate = getBlockEditorAction(
|
|
682
|
+
"synchronizeTemplate"
|
|
683
|
+
);
|
|
684
|
+
const mergeBlocks = getBlockEditorAction("mergeBlocks");
|
|
685
|
+
const removeBlocks = getBlockEditorAction("removeBlocks");
|
|
686
|
+
const removeBlock = getBlockEditorAction("removeBlock");
|
|
687
|
+
const toggleBlockMode = getBlockEditorAction("toggleBlockMode");
|
|
688
|
+
const startTyping = getBlockEditorAction("startTyping");
|
|
689
|
+
const stopTyping = getBlockEditorAction("stopTyping");
|
|
690
|
+
const enterFormattedText = getBlockEditorAction("enterFormattedText");
|
|
691
|
+
const exitFormattedText = getBlockEditorAction("exitFormattedText");
|
|
692
|
+
const insertDefaultBlock = getBlockEditorAction("insertDefaultBlock");
|
|
693
|
+
const updateBlockListSettings = getBlockEditorAction(
|
|
694
|
+
"updateBlockListSettings"
|
|
695
|
+
);
|
|
696
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
697
|
+
0 && (module.exports = {
|
|
698
|
+
__experimentalTearDownEditor,
|
|
699
|
+
__unstableSaveForPreview,
|
|
700
|
+
autosave,
|
|
701
|
+
clearSelectedBlock,
|
|
702
|
+
closePublishSidebar,
|
|
703
|
+
createUndoLevel,
|
|
704
|
+
disablePublishSidebar,
|
|
705
|
+
editPost,
|
|
706
|
+
enablePublishSidebar,
|
|
707
|
+
enterFormattedText,
|
|
708
|
+
exitFormattedText,
|
|
709
|
+
hideInsertionPoint,
|
|
710
|
+
insertBlock,
|
|
711
|
+
insertBlocks,
|
|
712
|
+
insertDefaultBlock,
|
|
713
|
+
lockPostAutosaving,
|
|
714
|
+
lockPostSaving,
|
|
715
|
+
mergeBlocks,
|
|
716
|
+
moveBlockToPosition,
|
|
717
|
+
moveBlocksDown,
|
|
718
|
+
moveBlocksUp,
|
|
719
|
+
multiSelect,
|
|
720
|
+
openPublishSidebar,
|
|
721
|
+
receiveBlocks,
|
|
722
|
+
redo,
|
|
723
|
+
refreshPost,
|
|
724
|
+
removeBlock,
|
|
725
|
+
removeBlocks,
|
|
726
|
+
removeEditorPanel,
|
|
727
|
+
replaceBlock,
|
|
728
|
+
replaceBlocks,
|
|
729
|
+
resetBlocks,
|
|
730
|
+
resetEditorBlocks,
|
|
731
|
+
resetPost,
|
|
732
|
+
savePost,
|
|
733
|
+
selectBlock,
|
|
734
|
+
setDeviceType,
|
|
735
|
+
setEditedPost,
|
|
736
|
+
setIsInserterOpened,
|
|
737
|
+
setIsListViewOpened,
|
|
738
|
+
setRenderingMode,
|
|
739
|
+
setTemplateValidity,
|
|
740
|
+
setupEditor,
|
|
741
|
+
setupEditorState,
|
|
742
|
+
showInsertionPoint,
|
|
743
|
+
startMultiSelect,
|
|
744
|
+
startTyping,
|
|
745
|
+
stopMultiSelect,
|
|
746
|
+
stopTyping,
|
|
747
|
+
switchEditorMode,
|
|
748
|
+
synchronizeTemplate,
|
|
749
|
+
toggleBlockMode,
|
|
750
|
+
toggleDistractionFree,
|
|
751
|
+
toggleEditorPanelEnabled,
|
|
752
|
+
toggleEditorPanelOpened,
|
|
753
|
+
togglePublishSidebar,
|
|
754
|
+
toggleSelection,
|
|
755
|
+
toggleSpotlightMode,
|
|
756
|
+
toggleTopToolbar,
|
|
757
|
+
trashPost,
|
|
758
|
+
undo,
|
|
759
|
+
unlockPostAutosaving,
|
|
760
|
+
unlockPostSaving,
|
|
761
|
+
updateBlock,
|
|
762
|
+
updateBlockAttributes,
|
|
763
|
+
updateBlockListSettings,
|
|
764
|
+
updateEditorSettings,
|
|
765
|
+
updatePost,
|
|
766
|
+
updatePostLock
|
|
767
|
+
});
|
|
768
|
+
//# sourceMappingURL=actions.js.map
|