@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
|
@@ -1,241 +1,108 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import { store as
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
import {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
* returning a new object reference on every invocation, as in a connected or
|
|
26
|
-
* other pure component which performs `shouldComponentUpdate` check on props.
|
|
27
|
-
* This should be used as a last resort, since the normalized data should be
|
|
28
|
-
* maintained by the reducer result in state.
|
|
29
|
-
*/
|
|
1
|
+
import {
|
|
2
|
+
getFreeformContentHandlerName,
|
|
3
|
+
getDefaultBlockName,
|
|
4
|
+
__unstableSerializeAndClean,
|
|
5
|
+
parse
|
|
6
|
+
} from "@wordpress/blocks";
|
|
7
|
+
import { isInTheFuture, getDate } from "@wordpress/date";
|
|
8
|
+
import { addQueryArgs, cleanForSlug } from "@wordpress/url";
|
|
9
|
+
import { createSelector, createRegistrySelector } from "@wordpress/data";
|
|
10
|
+
import deprecated from "@wordpress/deprecated";
|
|
11
|
+
import { Platform } from "@wordpress/element";
|
|
12
|
+
import { store as blockEditorStore } from "@wordpress/block-editor";
|
|
13
|
+
import { store as coreStore } from "@wordpress/core-data";
|
|
14
|
+
import { store as preferencesStore } from "@wordpress/preferences";
|
|
15
|
+
import {
|
|
16
|
+
EDIT_MERGE_PROPERTIES,
|
|
17
|
+
PERMALINK_POSTNAME_REGEX,
|
|
18
|
+
ONE_MINUTE_IN_MS,
|
|
19
|
+
AUTOSAVE_PROPERTIES
|
|
20
|
+
} from "./constants";
|
|
21
|
+
import { getPostRawValue } from "./reducer";
|
|
22
|
+
import { getTemplatePartIcon } from "../utils/get-template-part-icon";
|
|
23
|
+
import { unlock } from "../lock-unlock";
|
|
24
|
+
import { getTemplateInfo } from "../utils/get-template-info";
|
|
30
25
|
const EMPTY_OBJECT = {};
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Returns true if any past editor history snapshots exist, or false otherwise.
|
|
34
|
-
*
|
|
35
|
-
* @param {Object} state Global application state.
|
|
36
|
-
*
|
|
37
|
-
* @return {boolean} Whether undo history exists.
|
|
38
|
-
*/
|
|
39
|
-
export const hasEditorUndo = createRegistrySelector(select => () => {
|
|
26
|
+
const hasEditorUndo = createRegistrySelector((select) => () => {
|
|
40
27
|
return select(coreStore).hasUndo();
|
|
41
28
|
});
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Returns true if any future editor history snapshots exist, or false
|
|
45
|
-
* otherwise.
|
|
46
|
-
*
|
|
47
|
-
* @param {Object} state Global application state.
|
|
48
|
-
*
|
|
49
|
-
* @return {boolean} Whether redo history exists.
|
|
50
|
-
*/
|
|
51
|
-
export const hasEditorRedo = createRegistrySelector(select => () => {
|
|
29
|
+
const hasEditorRedo = createRegistrySelector((select) => () => {
|
|
52
30
|
return select(coreStore).hasRedo();
|
|
53
31
|
});
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
* Returns true if the currently edited post is yet to be saved, or false if
|
|
57
|
-
* the post has been saved.
|
|
58
|
-
*
|
|
59
|
-
* @param {Object} state Global application state.
|
|
60
|
-
*
|
|
61
|
-
* @return {boolean} Whether the post is new.
|
|
62
|
-
*/
|
|
63
|
-
export function isEditedPostNew(state) {
|
|
64
|
-
return getCurrentPost(state).status === 'auto-draft';
|
|
32
|
+
function isEditedPostNew(state) {
|
|
33
|
+
return getCurrentPost(state).status === "auto-draft";
|
|
65
34
|
}
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Returns true if content includes unsaved changes, or false otherwise.
|
|
69
|
-
*
|
|
70
|
-
* @param {Object} state Editor state.
|
|
71
|
-
*
|
|
72
|
-
* @return {boolean} Whether content includes unsaved changes.
|
|
73
|
-
*/
|
|
74
|
-
export function hasChangedContent(state) {
|
|
35
|
+
function hasChangedContent(state) {
|
|
75
36
|
const edits = getPostEdits(state);
|
|
76
|
-
return
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
*
|
|
100
|
-
* @param {Object} state Global application state.
|
|
101
|
-
*
|
|
102
|
-
* @return {boolean} Whether there are edits or not.
|
|
103
|
-
*/
|
|
104
|
-
export const hasNonPostEntityChanges = createRegistrySelector(select => state => {
|
|
105
|
-
const dirtyEntityRecords = select(coreStore).__experimentalGetDirtyEntityRecords();
|
|
106
|
-
const {
|
|
107
|
-
type,
|
|
108
|
-
id
|
|
109
|
-
} = getCurrentPost(state);
|
|
110
|
-
return dirtyEntityRecords.some(entityRecord => entityRecord.kind !== 'postType' || entityRecord.name !== type || entityRecord.key !== id);
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Returns true if there are no unsaved values for the current edit session and
|
|
115
|
-
* if the currently edited post is new (has never been saved before).
|
|
116
|
-
*
|
|
117
|
-
* @param {Object} state Global application state.
|
|
118
|
-
*
|
|
119
|
-
* @return {boolean} Whether new post and unsaved values exist.
|
|
120
|
-
*/
|
|
121
|
-
export function isCleanNewPost(state) {
|
|
37
|
+
return "content" in edits;
|
|
38
|
+
}
|
|
39
|
+
const isEditedPostDirty = createRegistrySelector(
|
|
40
|
+
(select) => (state) => {
|
|
41
|
+
const postType = getCurrentPostType(state);
|
|
42
|
+
const postId = getCurrentPostId(state);
|
|
43
|
+
return select(coreStore).hasEditsForEntityRecord(
|
|
44
|
+
"postType",
|
|
45
|
+
postType,
|
|
46
|
+
postId
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
const hasNonPostEntityChanges = createRegistrySelector(
|
|
51
|
+
(select) => (state) => {
|
|
52
|
+
const dirtyEntityRecords = select(coreStore).__experimentalGetDirtyEntityRecords();
|
|
53
|
+
const { type, id } = getCurrentPost(state);
|
|
54
|
+
return dirtyEntityRecords.some(
|
|
55
|
+
(entityRecord) => entityRecord.kind !== "postType" || entityRecord.name !== type || entityRecord.key !== id
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
function isCleanNewPost(state) {
|
|
122
60
|
return !isEditedPostDirty(state) && isEditedPostNew(state);
|
|
123
61
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
const post = select(coreStore).getRawEntityRecord('postType', postType, postId);
|
|
138
|
-
if (post) {
|
|
139
|
-
return post;
|
|
62
|
+
const getCurrentPost = createRegistrySelector(
|
|
63
|
+
(select) => (state) => {
|
|
64
|
+
const postId = getCurrentPostId(state);
|
|
65
|
+
const postType = getCurrentPostType(state);
|
|
66
|
+
const post = select(coreStore).getRawEntityRecord(
|
|
67
|
+
"postType",
|
|
68
|
+
postType,
|
|
69
|
+
postId
|
|
70
|
+
);
|
|
71
|
+
if (post) {
|
|
72
|
+
return post;
|
|
73
|
+
}
|
|
74
|
+
return EMPTY_OBJECT;
|
|
140
75
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
// which would guarantee an object return based on the editor reducer's
|
|
144
|
-
// default empty object state.
|
|
145
|
-
return EMPTY_OBJECT;
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* Returns the post type of the post currently being edited.
|
|
150
|
-
*
|
|
151
|
-
* @param {Object} state Global application state.
|
|
152
|
-
*
|
|
153
|
-
* @example
|
|
154
|
-
*
|
|
155
|
-
*```js
|
|
156
|
-
* const currentPostType = wp.data.select( 'core/editor' ).getCurrentPostType();
|
|
157
|
-
*```
|
|
158
|
-
* @return {string} Post type.
|
|
159
|
-
*/
|
|
160
|
-
export function getCurrentPostType(state) {
|
|
76
|
+
);
|
|
77
|
+
function getCurrentPostType(state) {
|
|
161
78
|
return state.postType;
|
|
162
79
|
}
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* Returns the ID of the post currently being edited, or null if the post has
|
|
166
|
-
* not yet been saved.
|
|
167
|
-
*
|
|
168
|
-
* @param {Object} state Global application state.
|
|
169
|
-
*
|
|
170
|
-
* @return {?(number|string)} The current post ID (number) or template slug (string).
|
|
171
|
-
*/
|
|
172
|
-
export function getCurrentPostId(state) {
|
|
80
|
+
function getCurrentPostId(state) {
|
|
173
81
|
return state.postId;
|
|
174
82
|
}
|
|
175
|
-
|
|
176
|
-
/**
|
|
177
|
-
* Returns the template ID currently being rendered/edited
|
|
178
|
-
*
|
|
179
|
-
* @param {Object} state Global application state.
|
|
180
|
-
*
|
|
181
|
-
* @return {?string} Template ID.
|
|
182
|
-
*/
|
|
183
|
-
export function getCurrentTemplateId(state) {
|
|
83
|
+
function getCurrentTemplateId(state) {
|
|
184
84
|
return state.templateId;
|
|
185
85
|
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
* Returns the number of revisions of the post currently being edited.
|
|
189
|
-
*
|
|
190
|
-
* @param {Object} state Global application state.
|
|
191
|
-
*
|
|
192
|
-
* @return {number} Number of revisions.
|
|
193
|
-
*/
|
|
194
|
-
export function getCurrentPostRevisionsCount(state) {
|
|
195
|
-
var _getCurrentPost$_link;
|
|
196
|
-
return (_getCurrentPost$_link = getCurrentPost(state)._links?.['version-history']?.[0]?.count) !== null && _getCurrentPost$_link !== void 0 ? _getCurrentPost$_link : 0;
|
|
86
|
+
function getCurrentPostRevisionsCount(state) {
|
|
87
|
+
return getCurrentPost(state)._links?.["version-history"]?.[0]?.count ?? 0;
|
|
197
88
|
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
* Returns the last revision ID of the post currently being edited,
|
|
201
|
-
* or null if the post has no revisions.
|
|
202
|
-
*
|
|
203
|
-
* @param {Object} state Global application state.
|
|
204
|
-
*
|
|
205
|
-
* @return {?number} ID of the last revision.
|
|
206
|
-
*/
|
|
207
|
-
export function getCurrentPostLastRevisionId(state) {
|
|
208
|
-
var _getCurrentPost$_link2;
|
|
209
|
-
return (_getCurrentPost$_link2 = getCurrentPost(state)._links?.['predecessor-version']?.[0]?.id) !== null && _getCurrentPost$_link2 !== void 0 ? _getCurrentPost$_link2 : null;
|
|
89
|
+
function getCurrentPostLastRevisionId(state) {
|
|
90
|
+
return getCurrentPost(state)._links?.["predecessor-version"]?.[0]?.id ?? null;
|
|
210
91
|
}
|
|
211
|
-
|
|
212
|
-
/**
|
|
213
|
-
* Returns any post values which have been changed in the editor but not yet
|
|
214
|
-
* been saved.
|
|
215
|
-
*
|
|
216
|
-
* @param {Object} state Global application state.
|
|
217
|
-
*
|
|
218
|
-
* @return {Object} Object of key value pairs comprising unsaved edits.
|
|
219
|
-
*/
|
|
220
|
-
export const getPostEdits = createRegistrySelector(select => state => {
|
|
92
|
+
const getPostEdits = createRegistrySelector((select) => (state) => {
|
|
221
93
|
const postType = getCurrentPostType(state);
|
|
222
94
|
const postId = getCurrentPostId(state);
|
|
223
|
-
return select(coreStore).getEntityRecordEdits(
|
|
95
|
+
return select(coreStore).getEntityRecordEdits(
|
|
96
|
+
"postType",
|
|
97
|
+
postType,
|
|
98
|
+
postId
|
|
99
|
+
) || EMPTY_OBJECT;
|
|
224
100
|
});
|
|
225
|
-
|
|
226
|
-
/**
|
|
227
|
-
* Returns an attribute value of the saved post.
|
|
228
|
-
*
|
|
229
|
-
* @param {Object} state Global application state.
|
|
230
|
-
* @param {string} attributeName Post attribute name.
|
|
231
|
-
*
|
|
232
|
-
* @return {*} Post attribute value.
|
|
233
|
-
*/
|
|
234
|
-
export function getCurrentPostAttribute(state, attributeName) {
|
|
101
|
+
function getCurrentPostAttribute(state, attributeName) {
|
|
235
102
|
switch (attributeName) {
|
|
236
|
-
case
|
|
103
|
+
case "type":
|
|
237
104
|
return getCurrentPostType(state);
|
|
238
|
-
case
|
|
105
|
+
case "id":
|
|
239
106
|
return getCurrentPostId(state);
|
|
240
107
|
default:
|
|
241
108
|
const post = getCurrentPost(state);
|
|
@@ -245,1349 +112,761 @@ export function getCurrentPostAttribute(state, attributeName) {
|
|
|
245
112
|
return getPostRawValue(post[attributeName]);
|
|
246
113
|
}
|
|
247
114
|
}
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
...getCurrentPostAttribute(state, attributeName),
|
|
266
|
-
...edits[attributeName]
|
|
267
|
-
};
|
|
268
|
-
}, (state, attributeName) => [getCurrentPostAttribute(state, attributeName), getPostEdits(state)[attributeName]]);
|
|
269
|
-
|
|
270
|
-
/**
|
|
271
|
-
* Returns a single attribute of the post being edited, preferring the unsaved
|
|
272
|
-
* edit if one exists, but falling back to the attribute for the last known
|
|
273
|
-
* saved state of the post.
|
|
274
|
-
*
|
|
275
|
-
* @param {Object} state Global application state.
|
|
276
|
-
* @param {string} attributeName Post attribute name.
|
|
277
|
-
*
|
|
278
|
-
* @example
|
|
279
|
-
*
|
|
280
|
-
*```js
|
|
281
|
-
* // Get specific media size based on the featured media ID
|
|
282
|
-
* // Note: change sizes?.large for any registered size
|
|
283
|
-
* const getFeaturedMediaUrl = useSelect( ( select ) => {
|
|
284
|
-
* const getFeaturedMediaId =
|
|
285
|
-
* select( 'core/editor' ).getEditedPostAttribute( 'featured_media' );
|
|
286
|
-
* const media = select( 'core' ).getEntityRecord(
|
|
287
|
-
* 'postType',
|
|
288
|
-
* 'attachment',
|
|
289
|
-
* getFeaturedMediaId
|
|
290
|
-
* );
|
|
291
|
-
*
|
|
292
|
-
* return (
|
|
293
|
-
* media?.media_details?.sizes?.large?.source_url || media?.source_url || ''
|
|
294
|
-
* );
|
|
295
|
-
* }, [] );
|
|
296
|
-
*```
|
|
297
|
-
*
|
|
298
|
-
* @return {*} Post attribute value.
|
|
299
|
-
*/
|
|
300
|
-
export function getEditedPostAttribute(state, attributeName) {
|
|
301
|
-
// Special cases.
|
|
115
|
+
const getNestedEditedPostProperty = createSelector(
|
|
116
|
+
(state, attributeName) => {
|
|
117
|
+
const edits = getPostEdits(state);
|
|
118
|
+
if (!edits.hasOwnProperty(attributeName)) {
|
|
119
|
+
return getCurrentPostAttribute(state, attributeName);
|
|
120
|
+
}
|
|
121
|
+
return {
|
|
122
|
+
...getCurrentPostAttribute(state, attributeName),
|
|
123
|
+
...edits[attributeName]
|
|
124
|
+
};
|
|
125
|
+
},
|
|
126
|
+
(state, attributeName) => [
|
|
127
|
+
getCurrentPostAttribute(state, attributeName),
|
|
128
|
+
getPostEdits(state)[attributeName]
|
|
129
|
+
]
|
|
130
|
+
);
|
|
131
|
+
function getEditedPostAttribute(state, attributeName) {
|
|
302
132
|
switch (attributeName) {
|
|
303
|
-
case
|
|
133
|
+
case "content":
|
|
304
134
|
return getEditedPostContent(state);
|
|
305
135
|
}
|
|
306
|
-
|
|
307
|
-
// Fall back to saved post value if not edited.
|
|
308
136
|
const edits = getPostEdits(state);
|
|
309
137
|
if (!edits.hasOwnProperty(attributeName)) {
|
|
310
138
|
return getCurrentPostAttribute(state, attributeName);
|
|
311
139
|
}
|
|
312
|
-
|
|
313
|
-
// Merge properties are objects which contain only the patch edit in state,
|
|
314
|
-
// and thus must be merged with the current post attribute.
|
|
315
140
|
if (EDIT_MERGE_PROPERTIES.has(attributeName)) {
|
|
316
141
|
return getNestedEditedPostProperty(state, attributeName);
|
|
317
142
|
}
|
|
318
143
|
return edits[attributeName];
|
|
319
144
|
}
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
// Currently template autosaving is not supported.
|
|
341
|
-
if (postType === 'wp_template') {
|
|
342
|
-
return false;
|
|
343
|
-
}
|
|
344
|
-
const postId = getCurrentPostId(state);
|
|
345
|
-
const currentUserId = select(coreStore).getCurrentUser()?.id;
|
|
346
|
-
const autosave = select(coreStore).getAutosave(postType, postId, currentUserId);
|
|
347
|
-
if (autosave) {
|
|
348
|
-
return getPostRawValue(autosave[attributeName]);
|
|
145
|
+
const getAutosaveAttribute = createRegistrySelector(
|
|
146
|
+
(select) => (state, attributeName) => {
|
|
147
|
+
if (!AUTOSAVE_PROPERTIES.includes(attributeName) && attributeName !== "preview_link") {
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
const postType = getCurrentPostType(state);
|
|
151
|
+
if (postType === "wp_template") {
|
|
152
|
+
return false;
|
|
153
|
+
}
|
|
154
|
+
const postId = getCurrentPostId(state);
|
|
155
|
+
const currentUserId = select(coreStore).getCurrentUser()?.id;
|
|
156
|
+
const autosave = select(coreStore).getAutosave(
|
|
157
|
+
postType,
|
|
158
|
+
postId,
|
|
159
|
+
currentUserId
|
|
160
|
+
);
|
|
161
|
+
if (autosave) {
|
|
162
|
+
return getPostRawValue(autosave[attributeName]);
|
|
163
|
+
}
|
|
349
164
|
}
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
* "private", "password", or "public".
|
|
356
|
-
*
|
|
357
|
-
* @param {Object} state Global application state.
|
|
358
|
-
*
|
|
359
|
-
* @return {string} Post visibility.
|
|
360
|
-
*/
|
|
361
|
-
export function getEditedPostVisibility(state) {
|
|
362
|
-
const status = getEditedPostAttribute(state, 'status');
|
|
363
|
-
if (status === 'private') {
|
|
364
|
-
return 'private';
|
|
165
|
+
);
|
|
166
|
+
function getEditedPostVisibility(state) {
|
|
167
|
+
const status = getEditedPostAttribute(state, "status");
|
|
168
|
+
if (status === "private") {
|
|
169
|
+
return "private";
|
|
365
170
|
}
|
|
366
|
-
const password = getEditedPostAttribute(state,
|
|
171
|
+
const password = getEditedPostAttribute(state, "password");
|
|
367
172
|
if (password) {
|
|
368
|
-
return
|
|
173
|
+
return "password";
|
|
369
174
|
}
|
|
370
|
-
return
|
|
175
|
+
return "public";
|
|
371
176
|
}
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
* Returns true if post is pending review.
|
|
375
|
-
*
|
|
376
|
-
* @param {Object} state Global application state.
|
|
377
|
-
*
|
|
378
|
-
* @return {boolean} Whether current post is pending review.
|
|
379
|
-
*/
|
|
380
|
-
export function isCurrentPostPending(state) {
|
|
381
|
-
return getCurrentPost(state).status === 'pending';
|
|
177
|
+
function isCurrentPostPending(state) {
|
|
178
|
+
return getCurrentPost(state).status === "pending";
|
|
382
179
|
}
|
|
383
|
-
|
|
384
|
-
/**
|
|
385
|
-
* Return true if the current post has already been published.
|
|
386
|
-
*
|
|
387
|
-
* @param {Object} state Global application state.
|
|
388
|
-
* @param {Object} [currentPost] Explicit current post for bypassing registry selector.
|
|
389
|
-
*
|
|
390
|
-
* @return {boolean} Whether the post has been published.
|
|
391
|
-
*/
|
|
392
|
-
export function isCurrentPostPublished(state, currentPost) {
|
|
180
|
+
function isCurrentPostPublished(state, currentPost) {
|
|
393
181
|
const post = currentPost || getCurrentPost(state);
|
|
394
|
-
return [
|
|
182
|
+
return ["publish", "private"].indexOf(post.status) !== -1 || post.status === "future" && !isInTheFuture(
|
|
183
|
+
new Date(Number(getDate(post.date)) - ONE_MINUTE_IN_MS)
|
|
184
|
+
);
|
|
395
185
|
}
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
* Returns true if post is already scheduled.
|
|
399
|
-
*
|
|
400
|
-
* @param {Object} state Global application state.
|
|
401
|
-
*
|
|
402
|
-
* @return {boolean} Whether current post is scheduled to be posted.
|
|
403
|
-
*/
|
|
404
|
-
export function isCurrentPostScheduled(state) {
|
|
405
|
-
return getCurrentPost(state).status === 'future' && !isCurrentPostPublished(state);
|
|
186
|
+
function isCurrentPostScheduled(state) {
|
|
187
|
+
return getCurrentPost(state).status === "future" && !isCurrentPostPublished(state);
|
|
406
188
|
}
|
|
407
|
-
|
|
408
|
-
/**
|
|
409
|
-
* Return true if the post being edited can be published.
|
|
410
|
-
*
|
|
411
|
-
* @param {Object} state Global application state.
|
|
412
|
-
*
|
|
413
|
-
* @return {boolean} Whether the post can been published.
|
|
414
|
-
*/
|
|
415
|
-
export function isEditedPostPublishable(state) {
|
|
189
|
+
function isEditedPostPublishable(state) {
|
|
416
190
|
const post = getCurrentPost(state);
|
|
417
|
-
|
|
418
|
-
// TODO: Post being publishable should be superset of condition of post
|
|
419
|
-
// being saveable. Currently this restriction is imposed at UI.
|
|
420
|
-
//
|
|
421
|
-
// See: <PostPublishButton /> (`isButtonEnabled` assigned by `isSaveable`).
|
|
422
|
-
|
|
423
|
-
return isEditedPostDirty(state) || ['publish', 'private', 'future'].indexOf(post.status) === -1;
|
|
191
|
+
return isEditedPostDirty(state) || ["publish", "private", "future"].indexOf(post.status) === -1;
|
|
424
192
|
}
|
|
425
|
-
|
|
426
|
-
/**
|
|
427
|
-
* Returns true if the post can be saved, or false otherwise. A post must
|
|
428
|
-
* contain a title, an excerpt, or non-empty content to be valid for save.
|
|
429
|
-
*
|
|
430
|
-
* @param {Object} state Global application state.
|
|
431
|
-
*
|
|
432
|
-
* @return {boolean} Whether the post can be saved.
|
|
433
|
-
*/
|
|
434
|
-
export function isEditedPostSaveable(state) {
|
|
193
|
+
function isEditedPostSaveable(state) {
|
|
435
194
|
if (isSavingPost(state)) {
|
|
436
195
|
return false;
|
|
437
196
|
}
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
// this function can be called frequently, optimize for the fast case as a
|
|
465
|
-
// condition of the mere existence of blocks. Note that the value of edited
|
|
466
|
-
// content takes precedent over block content, and must fall through to the
|
|
467
|
-
// default logic.
|
|
468
|
-
const postId = getCurrentPostId(state);
|
|
469
|
-
const postType = getCurrentPostType(state);
|
|
470
|
-
const record = select(coreStore).getEditedEntityRecord('postType', postType, postId);
|
|
471
|
-
if (typeof record.content !== 'function') {
|
|
472
|
-
return !record.content;
|
|
473
|
-
}
|
|
474
|
-
const blocks = getEditedPostAttribute(state, 'blocks');
|
|
475
|
-
if (blocks.length === 0) {
|
|
476
|
-
return true;
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
// Pierce the abstraction of the serializer in knowing that blocks are
|
|
480
|
-
// joined with newlines such that even if every individual block
|
|
481
|
-
// produces an empty save result, the serialized content is non-empty.
|
|
482
|
-
if (blocks.length > 1) {
|
|
483
|
-
return false;
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
// There are two conditions under which the optimization cannot be
|
|
487
|
-
// assumed, and a fallthrough to getEditedPostContent must occur:
|
|
488
|
-
//
|
|
489
|
-
// 1. getBlocksForSerialization has special treatment in omitting a
|
|
490
|
-
// single unmodified default block.
|
|
491
|
-
// 2. Comment delimiters are omitted for a freeform or unregistered
|
|
492
|
-
// block in its serialization. The freeform block specifically may
|
|
493
|
-
// produce an empty string in its saved output.
|
|
494
|
-
//
|
|
495
|
-
// For all other content, the single block is assumed to make a post
|
|
496
|
-
// non-empty, if only by virtue of its own comment delimiters.
|
|
497
|
-
const blockName = blocks[0].name;
|
|
498
|
-
if (blockName !== getDefaultBlockName() && blockName !== getFreeformContentHandlerName()) {
|
|
499
|
-
return false;
|
|
500
|
-
}
|
|
501
|
-
return !getEditedPostContent(state);
|
|
502
|
-
});
|
|
503
|
-
|
|
504
|
-
/**
|
|
505
|
-
* Returns true if the post can be autosaved, or false otherwise.
|
|
506
|
-
*
|
|
507
|
-
* @param {Object} state Global application state.
|
|
508
|
-
* @param {Object} autosave A raw autosave object from the REST API.
|
|
509
|
-
*
|
|
510
|
-
* @return {boolean} Whether the post can be autosaved.
|
|
511
|
-
*/
|
|
512
|
-
export const isEditedPostAutosaveable = createRegistrySelector(select => state => {
|
|
513
|
-
// A post must contain a title, an excerpt, or non-empty content to be valid for autosaving.
|
|
514
|
-
if (!isEditedPostSaveable(state)) {
|
|
515
|
-
return false;
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
// A post is not autosavable when there is a post autosave lock.
|
|
519
|
-
if (isPostAutosavingLocked(state)) {
|
|
520
|
-
return false;
|
|
521
|
-
}
|
|
522
|
-
const postType = getCurrentPostType(state);
|
|
523
|
-
const postTypeObject = select(coreStore).getPostType(postType);
|
|
524
|
-
|
|
525
|
-
// Currently template autosaving is not supported.
|
|
526
|
-
// @todo: Remove hardcode check for template after bumping required WP version to 6.8.
|
|
527
|
-
if (postType === 'wp_template' || !postTypeObject?.supports?.autosave) {
|
|
528
|
-
return false;
|
|
529
|
-
}
|
|
530
|
-
const postId = getCurrentPostId(state);
|
|
531
|
-
const hasFetchedAutosave = select(coreStore).hasFetchedAutosaves(postType, postId);
|
|
532
|
-
const currentUserId = select(coreStore).getCurrentUser()?.id;
|
|
533
|
-
|
|
534
|
-
// Disable reason - this line causes the side-effect of fetching the autosave
|
|
535
|
-
// via a resolver, moving below the return would result in the autosave never
|
|
536
|
-
// being fetched.
|
|
537
|
-
// eslint-disable-next-line @wordpress/no-unused-vars-before-return
|
|
538
|
-
const autosave = select(coreStore).getAutosave(postType, postId, currentUserId);
|
|
539
|
-
|
|
540
|
-
// If any existing autosaves have not yet been fetched, this function is
|
|
541
|
-
// unable to determine if the post is autosaveable, so return false.
|
|
542
|
-
if (!hasFetchedAutosave) {
|
|
543
|
-
return false;
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
// If we don't already have an autosave, the post is autosaveable.
|
|
547
|
-
if (!autosave) {
|
|
548
|
-
return true;
|
|
549
|
-
}
|
|
550
|
-
|
|
551
|
-
// To avoid an expensive content serialization, use the content dirtiness
|
|
552
|
-
// flag in place of content field comparison against the known autosave.
|
|
553
|
-
// This is not strictly accurate, and relies on a tolerance toward autosave
|
|
554
|
-
// request failures for unnecessary saves.
|
|
555
|
-
if (hasChangedContent(state)) {
|
|
556
|
-
return true;
|
|
197
|
+
return !!getEditedPostAttribute(state, "title") || !!getEditedPostAttribute(state, "excerpt") || !isEditedPostEmpty(state) || Platform.OS === "native";
|
|
198
|
+
}
|
|
199
|
+
const isEditedPostEmpty = createRegistrySelector(
|
|
200
|
+
(select) => (state) => {
|
|
201
|
+
const postId = getCurrentPostId(state);
|
|
202
|
+
const postType = getCurrentPostType(state);
|
|
203
|
+
const record = select(coreStore).getEditedEntityRecord(
|
|
204
|
+
"postType",
|
|
205
|
+
postType,
|
|
206
|
+
postId
|
|
207
|
+
);
|
|
208
|
+
if (typeof record.content !== "function") {
|
|
209
|
+
return !record.content;
|
|
210
|
+
}
|
|
211
|
+
const blocks = getEditedPostAttribute(state, "blocks");
|
|
212
|
+
if (blocks.length === 0) {
|
|
213
|
+
return true;
|
|
214
|
+
}
|
|
215
|
+
if (blocks.length > 1) {
|
|
216
|
+
return false;
|
|
217
|
+
}
|
|
218
|
+
const blockName = blocks[0].name;
|
|
219
|
+
if (blockName !== getDefaultBlockName() && blockName !== getFreeformContentHandlerName()) {
|
|
220
|
+
return false;
|
|
221
|
+
}
|
|
222
|
+
return !getEditedPostContent(state);
|
|
557
223
|
}
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
224
|
+
);
|
|
225
|
+
const isEditedPostAutosaveable = createRegistrySelector(
|
|
226
|
+
(select) => (state) => {
|
|
227
|
+
if (!isEditedPostSaveable(state)) {
|
|
228
|
+
return false;
|
|
229
|
+
}
|
|
230
|
+
if (isPostAutosavingLocked(state)) {
|
|
231
|
+
return false;
|
|
232
|
+
}
|
|
233
|
+
const postType = getCurrentPostType(state);
|
|
234
|
+
const postTypeObject = select(coreStore).getPostType(postType);
|
|
235
|
+
if (postType === "wp_template" || !postTypeObject?.supports?.autosave) {
|
|
236
|
+
return false;
|
|
237
|
+
}
|
|
238
|
+
const postId = getCurrentPostId(state);
|
|
239
|
+
const hasFetchedAutosave = select(coreStore).hasFetchedAutosaves(
|
|
240
|
+
postType,
|
|
241
|
+
postId
|
|
242
|
+
);
|
|
243
|
+
const currentUserId = select(coreStore).getCurrentUser()?.id;
|
|
244
|
+
const autosave = select(coreStore).getAutosave(
|
|
245
|
+
postType,
|
|
246
|
+
postId,
|
|
247
|
+
currentUserId
|
|
248
|
+
);
|
|
249
|
+
if (!hasFetchedAutosave) {
|
|
250
|
+
return false;
|
|
251
|
+
}
|
|
252
|
+
if (!autosave) {
|
|
253
|
+
return true;
|
|
254
|
+
}
|
|
255
|
+
if (hasChangedContent(state)) {
|
|
256
|
+
return true;
|
|
257
|
+
}
|
|
258
|
+
return ["title", "excerpt", "meta"].some(
|
|
259
|
+
(field) => getPostRawValue(autosave[field]) !== getEditedPostAttribute(state, field)
|
|
260
|
+
);
|
|
261
|
+
}
|
|
262
|
+
);
|
|
263
|
+
function isEditedPostBeingScheduled(state) {
|
|
264
|
+
const date = getEditedPostAttribute(state, "date");
|
|
265
|
+
const checkedDate = new Date(
|
|
266
|
+
Number(getDate(date)) - ONE_MINUTE_IN_MS
|
|
267
|
+
);
|
|
575
268
|
return isInTheFuture(checkedDate);
|
|
576
269
|
}
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
* date (i.e. that it would publish "Immediately" rather than at a set time).
|
|
581
|
-
*
|
|
582
|
-
* Unlike in the PHP backend, the REST API returns a full date string for posts
|
|
583
|
-
* where the 0000-00-00T00:00:00 placeholder is present in the database. To
|
|
584
|
-
* infer that a post is set to publish "Immediately" we check whether the date
|
|
585
|
-
* and modified date are the same.
|
|
586
|
-
*
|
|
587
|
-
* @param {Object} state Editor state.
|
|
588
|
-
*
|
|
589
|
-
* @return {boolean} Whether the edited post has a floating date value.
|
|
590
|
-
*/
|
|
591
|
-
export function isEditedPostDateFloating(state) {
|
|
592
|
-
const date = getEditedPostAttribute(state, 'date');
|
|
593
|
-
const modified = getEditedPostAttribute(state, 'modified');
|
|
594
|
-
|
|
595
|
-
// This should be the status of the persisted post
|
|
596
|
-
// It shouldn't use the "edited" status otherwise it breaks the
|
|
597
|
-
// inferred post data floating status
|
|
598
|
-
// See https://github.com/WordPress/gutenberg/issues/28083.
|
|
270
|
+
function isEditedPostDateFloating(state) {
|
|
271
|
+
const date = getEditedPostAttribute(state, "date");
|
|
272
|
+
const modified = getEditedPostAttribute(state, "modified");
|
|
599
273
|
const status = getCurrentPost(state).status;
|
|
600
|
-
if (status ===
|
|
274
|
+
if (status === "draft" || status === "auto-draft" || status === "pending") {
|
|
601
275
|
return date === modified || date === null;
|
|
602
276
|
}
|
|
603
277
|
return false;
|
|
604
278
|
}
|
|
605
|
-
|
|
606
|
-
/**
|
|
607
|
-
* Returns true if the post is currently being deleted, or false otherwise.
|
|
608
|
-
*
|
|
609
|
-
* @param {Object} state Editor state.
|
|
610
|
-
*
|
|
611
|
-
* @return {boolean} Whether post is being deleted.
|
|
612
|
-
*/
|
|
613
|
-
export function isDeletingPost(state) {
|
|
279
|
+
function isDeletingPost(state) {
|
|
614
280
|
return !!state.deleting.pending;
|
|
615
281
|
}
|
|
616
|
-
|
|
617
|
-
/**
|
|
618
|
-
* Returns true if the post is currently being saved, or false otherwise.
|
|
619
|
-
*
|
|
620
|
-
* @param {Object} state Global application state.
|
|
621
|
-
*
|
|
622
|
-
* @return {boolean} Whether post is being saved.
|
|
623
|
-
*/
|
|
624
|
-
export function isSavingPost(state) {
|
|
282
|
+
function isSavingPost(state) {
|
|
625
283
|
return !!state.saving.pending;
|
|
626
284
|
}
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
}
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
* Returns true if a previous post save was attempted but failed, or false
|
|
660
|
-
* otherwise.
|
|
661
|
-
*
|
|
662
|
-
* @param {Object} state Global application state.
|
|
663
|
-
*
|
|
664
|
-
* @return {boolean} Whether the post save failed.
|
|
665
|
-
*/
|
|
666
|
-
export const didPostSaveRequestFail = createRegistrySelector(select => state => {
|
|
667
|
-
const postType = getCurrentPostType(state);
|
|
668
|
-
const postId = getCurrentPostId(state);
|
|
669
|
-
return !!select(coreStore).getLastEntitySaveError('postType', postType, postId);
|
|
670
|
-
});
|
|
671
|
-
|
|
672
|
-
/**
|
|
673
|
-
* Returns true if the post is autosaving, or false otherwise.
|
|
674
|
-
*
|
|
675
|
-
* @param {Object} state Global application state.
|
|
676
|
-
*
|
|
677
|
-
* @return {boolean} Whether the post is autosaving.
|
|
678
|
-
*/
|
|
679
|
-
export function isAutosavingPost(state) {
|
|
285
|
+
const isSavingNonPostEntityChanges = createRegistrySelector(
|
|
286
|
+
(select) => (state) => {
|
|
287
|
+
const entitiesBeingSaved = select(coreStore).__experimentalGetEntitiesBeingSaved();
|
|
288
|
+
const { type, id } = getCurrentPost(state);
|
|
289
|
+
return entitiesBeingSaved.some(
|
|
290
|
+
(entityRecord) => entityRecord.kind !== "postType" || entityRecord.name !== type || entityRecord.key !== id
|
|
291
|
+
);
|
|
292
|
+
}
|
|
293
|
+
);
|
|
294
|
+
const didPostSaveRequestSucceed = createRegistrySelector(
|
|
295
|
+
(select) => (state) => {
|
|
296
|
+
const postType = getCurrentPostType(state);
|
|
297
|
+
const postId = getCurrentPostId(state);
|
|
298
|
+
return !select(coreStore).getLastEntitySaveError(
|
|
299
|
+
"postType",
|
|
300
|
+
postType,
|
|
301
|
+
postId
|
|
302
|
+
);
|
|
303
|
+
}
|
|
304
|
+
);
|
|
305
|
+
const didPostSaveRequestFail = createRegistrySelector(
|
|
306
|
+
(select) => (state) => {
|
|
307
|
+
const postType = getCurrentPostType(state);
|
|
308
|
+
const postId = getCurrentPostId(state);
|
|
309
|
+
return !!select(coreStore).getLastEntitySaveError(
|
|
310
|
+
"postType",
|
|
311
|
+
postType,
|
|
312
|
+
postId
|
|
313
|
+
);
|
|
314
|
+
}
|
|
315
|
+
);
|
|
316
|
+
function isAutosavingPost(state) {
|
|
680
317
|
return isSavingPost(state) && Boolean(state.saving.options?.isAutosave);
|
|
681
318
|
}
|
|
682
|
-
|
|
683
|
-
/**
|
|
684
|
-
* Returns true if the post is being previewed, or false otherwise.
|
|
685
|
-
*
|
|
686
|
-
* @param {Object} state Global application state.
|
|
687
|
-
*
|
|
688
|
-
* @return {boolean} Whether the post is being previewed.
|
|
689
|
-
*/
|
|
690
|
-
export function isPreviewingPost(state) {
|
|
319
|
+
function isPreviewingPost(state) {
|
|
691
320
|
return isSavingPost(state) && Boolean(state.saving.options?.isPreview);
|
|
692
321
|
}
|
|
693
|
-
|
|
694
|
-
/**
|
|
695
|
-
* Returns the post preview link
|
|
696
|
-
*
|
|
697
|
-
* @param {Object} state Global application state.
|
|
698
|
-
*
|
|
699
|
-
* @return {string | undefined} Preview Link.
|
|
700
|
-
*/
|
|
701
|
-
export function getEditedPostPreviewLink(state) {
|
|
322
|
+
function getEditedPostPreviewLink(state) {
|
|
702
323
|
if (state.saving.pending || isSavingPost(state)) {
|
|
703
324
|
return;
|
|
704
325
|
}
|
|
705
|
-
let previewLink = getAutosaveAttribute(state,
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
// because the preview could be a stale autosave if the post was switched from
|
|
709
|
-
// published to draft.
|
|
710
|
-
// See: https://github.com/WordPress/gutenberg/pull/37952.
|
|
711
|
-
if (!previewLink || 'draft' === getCurrentPost(state).status) {
|
|
712
|
-
previewLink = getEditedPostAttribute(state, 'link');
|
|
326
|
+
let previewLink = getAutosaveAttribute(state, "preview_link");
|
|
327
|
+
if (!previewLink || "draft" === getCurrentPost(state).status) {
|
|
328
|
+
previewLink = getEditedPostAttribute(state, "link");
|
|
713
329
|
if (previewLink) {
|
|
714
|
-
previewLink = addQueryArgs(previewLink, {
|
|
715
|
-
preview: true
|
|
716
|
-
});
|
|
330
|
+
previewLink = addQueryArgs(previewLink, { preview: true });
|
|
717
331
|
}
|
|
718
332
|
}
|
|
719
|
-
const featuredImageId = getEditedPostAttribute(state,
|
|
333
|
+
const featuredImageId = getEditedPostAttribute(state, "featured_media");
|
|
720
334
|
if (previewLink && featuredImageId) {
|
|
721
|
-
return addQueryArgs(previewLink, {
|
|
722
|
-
_thumbnail_id: featuredImageId
|
|
723
|
-
});
|
|
335
|
+
return addQueryArgs(previewLink, { _thumbnail_id: featuredImageId });
|
|
724
336
|
}
|
|
725
337
|
return previewLink;
|
|
726
338
|
}
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
if (blocks.length === 1) {
|
|
744
|
-
name = blocks[0].name;
|
|
745
|
-
// Check for core/embed `video` and `audio` eligible suggestions.
|
|
746
|
-
if (name === 'core/embed') {
|
|
747
|
-
const provider = blocks[0].attributes?.providerNameSlug;
|
|
748
|
-
if (['youtube', 'vimeo'].includes(provider)) {
|
|
749
|
-
name = 'core/video';
|
|
750
|
-
} else if (['spotify', 'soundcloud'].includes(provider)) {
|
|
751
|
-
name = 'core/audio';
|
|
339
|
+
const getSuggestedPostFormat = createRegistrySelector(
|
|
340
|
+
(select) => () => {
|
|
341
|
+
const blocks = select(blockEditorStore).getBlocks();
|
|
342
|
+
if (blocks.length > 2) {
|
|
343
|
+
return null;
|
|
344
|
+
}
|
|
345
|
+
let name;
|
|
346
|
+
if (blocks.length === 1) {
|
|
347
|
+
name = blocks[0].name;
|
|
348
|
+
if (name === "core/embed") {
|
|
349
|
+
const provider = blocks[0].attributes?.providerNameSlug;
|
|
350
|
+
if (["youtube", "vimeo"].includes(provider)) {
|
|
351
|
+
name = "core/video";
|
|
352
|
+
} else if (["spotify", "soundcloud"].includes(provider)) {
|
|
353
|
+
name = "core/audio";
|
|
354
|
+
}
|
|
752
355
|
}
|
|
753
356
|
}
|
|
357
|
+
if (blocks.length === 2 && blocks[1].name === "core/paragraph") {
|
|
358
|
+
name = blocks[0].name;
|
|
359
|
+
}
|
|
360
|
+
switch (name) {
|
|
361
|
+
case "core/image":
|
|
362
|
+
return "image";
|
|
363
|
+
case "core/quote":
|
|
364
|
+
case "core/pullquote":
|
|
365
|
+
return "quote";
|
|
366
|
+
case "core/gallery":
|
|
367
|
+
return "gallery";
|
|
368
|
+
case "core/video":
|
|
369
|
+
return "video";
|
|
370
|
+
case "core/audio":
|
|
371
|
+
return "audio";
|
|
372
|
+
default:
|
|
373
|
+
return null;
|
|
374
|
+
}
|
|
754
375
|
}
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
case 'core/audio':
|
|
774
|
-
return 'audio';
|
|
775
|
-
default:
|
|
776
|
-
return null;
|
|
777
|
-
}
|
|
778
|
-
});
|
|
779
|
-
|
|
780
|
-
/**
|
|
781
|
-
* Returns the content of the post being edited.
|
|
782
|
-
*
|
|
783
|
-
* @param {Object} state Global application state.
|
|
784
|
-
*
|
|
785
|
-
* @return {string} Post content.
|
|
786
|
-
*/
|
|
787
|
-
export const getEditedPostContent = createRegistrySelector(select => state => {
|
|
788
|
-
const postId = getCurrentPostId(state);
|
|
789
|
-
const postType = getCurrentPostType(state);
|
|
790
|
-
const record = select(coreStore).getEditedEntityRecord('postType', postType, postId);
|
|
791
|
-
if (record) {
|
|
792
|
-
if (typeof record.content === 'function') {
|
|
793
|
-
return record.content(record);
|
|
794
|
-
} else if (record.blocks) {
|
|
795
|
-
return __unstableSerializeAndClean(record.blocks);
|
|
796
|
-
} else if (record.content) {
|
|
797
|
-
return record.content;
|
|
376
|
+
);
|
|
377
|
+
const getEditedPostContent = createRegistrySelector(
|
|
378
|
+
(select) => (state) => {
|
|
379
|
+
const postId = getCurrentPostId(state);
|
|
380
|
+
const postType = getCurrentPostType(state);
|
|
381
|
+
const record = select(coreStore).getEditedEntityRecord(
|
|
382
|
+
"postType",
|
|
383
|
+
postType,
|
|
384
|
+
postId
|
|
385
|
+
);
|
|
386
|
+
if (record) {
|
|
387
|
+
if (typeof record.content === "function") {
|
|
388
|
+
return record.content(record);
|
|
389
|
+
} else if (record.blocks) {
|
|
390
|
+
return __unstableSerializeAndClean(record.blocks);
|
|
391
|
+
} else if (record.content) {
|
|
392
|
+
return record.content;
|
|
393
|
+
}
|
|
798
394
|
}
|
|
395
|
+
return "";
|
|
799
396
|
}
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
/**
|
|
804
|
-
* Returns true if the post is being published, or false otherwise.
|
|
805
|
-
*
|
|
806
|
-
* @param {Object} state Global application state.
|
|
807
|
-
*
|
|
808
|
-
* @return {boolean} Whether post is being published.
|
|
809
|
-
*/
|
|
810
|
-
export function isPublishingPost(state) {
|
|
811
|
-
return isSavingPost(state) && !isCurrentPostPublished(state) && getEditedPostAttribute(state, 'status') === 'publish';
|
|
397
|
+
);
|
|
398
|
+
function isPublishingPost(state) {
|
|
399
|
+
return isSavingPost(state) && !isCurrentPostPublished(state) && getEditedPostAttribute(state, "status") === "publish";
|
|
812
400
|
}
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
*
|
|
819
|
-
* @return {boolean} Whether or not the permalink is editable.
|
|
820
|
-
*/
|
|
821
|
-
export function isPermalinkEditable(state) {
|
|
822
|
-
const permalinkTemplate = getEditedPostAttribute(state, 'permalink_template');
|
|
401
|
+
function isPermalinkEditable(state) {
|
|
402
|
+
const permalinkTemplate = getEditedPostAttribute(
|
|
403
|
+
state,
|
|
404
|
+
"permalink_template"
|
|
405
|
+
);
|
|
823
406
|
return PERMALINK_POSTNAME_REGEX.test(permalinkTemplate);
|
|
824
407
|
}
|
|
825
|
-
|
|
826
|
-
/**
|
|
827
|
-
* Returns the permalink for the post.
|
|
828
|
-
*
|
|
829
|
-
* @param {Object} state Editor state.
|
|
830
|
-
*
|
|
831
|
-
* @return {?string} The permalink, or null if the post is not viewable.
|
|
832
|
-
*/
|
|
833
|
-
export function getPermalink(state) {
|
|
408
|
+
function getPermalink(state) {
|
|
834
409
|
const permalinkParts = getPermalinkParts(state);
|
|
835
410
|
if (!permalinkParts) {
|
|
836
411
|
return null;
|
|
837
412
|
}
|
|
838
|
-
const {
|
|
839
|
-
prefix,
|
|
840
|
-
postName,
|
|
841
|
-
suffix
|
|
842
|
-
} = permalinkParts;
|
|
413
|
+
const { prefix, postName, suffix } = permalinkParts;
|
|
843
414
|
if (isPermalinkEditable(state)) {
|
|
844
415
|
return prefix + postName + suffix;
|
|
845
416
|
}
|
|
846
417
|
return prefix;
|
|
847
418
|
}
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
* Returns the slug for the post being edited, preferring a manually edited
|
|
851
|
-
* value if one exists, then a sanitized version of the current post title, and
|
|
852
|
-
* finally the post ID.
|
|
853
|
-
*
|
|
854
|
-
* @param {Object} state Editor state.
|
|
855
|
-
*
|
|
856
|
-
* @return {string} The current slug to be displayed in the editor
|
|
857
|
-
*/
|
|
858
|
-
export function getEditedPostSlug(state) {
|
|
859
|
-
return getEditedPostAttribute(state, 'slug') || cleanForSlug(getEditedPostAttribute(state, 'title')) || getCurrentPostId(state);
|
|
419
|
+
function getEditedPostSlug(state) {
|
|
420
|
+
return getEditedPostAttribute(state, "slug") || cleanForSlug(getEditedPostAttribute(state, "title")) || getCurrentPostId(state);
|
|
860
421
|
}
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
* @param {Object} state Editor state.
|
|
867
|
-
*
|
|
868
|
-
* @return {Object} An object containing the prefix, postName, and suffix for
|
|
869
|
-
* the permalink, or null if the post is not viewable.
|
|
870
|
-
*/
|
|
871
|
-
export function getPermalinkParts(state) {
|
|
872
|
-
const permalinkTemplate = getEditedPostAttribute(state, 'permalink_template');
|
|
422
|
+
function getPermalinkParts(state) {
|
|
423
|
+
const permalinkTemplate = getEditedPostAttribute(
|
|
424
|
+
state,
|
|
425
|
+
"permalink_template"
|
|
426
|
+
);
|
|
873
427
|
if (!permalinkTemplate) {
|
|
874
428
|
return null;
|
|
875
429
|
}
|
|
876
|
-
const postName = getEditedPostAttribute(state,
|
|
877
|
-
const [prefix, suffix] = permalinkTemplate.split(
|
|
430
|
+
const postName = getEditedPostAttribute(state, "slug") || getEditedPostAttribute(state, "generated_slug");
|
|
431
|
+
const [prefix, suffix] = permalinkTemplate.split(
|
|
432
|
+
PERMALINK_POSTNAME_REGEX
|
|
433
|
+
);
|
|
878
434
|
return {
|
|
879
435
|
prefix,
|
|
880
436
|
postName,
|
|
881
437
|
suffix
|
|
882
438
|
};
|
|
883
439
|
}
|
|
884
|
-
|
|
885
|
-
/**
|
|
886
|
-
* Returns whether the post is locked.
|
|
887
|
-
*
|
|
888
|
-
* @param {Object} state Global application state.
|
|
889
|
-
*
|
|
890
|
-
* @return {boolean} Is locked.
|
|
891
|
-
*/
|
|
892
|
-
export function isPostLocked(state) {
|
|
440
|
+
function isPostLocked(state) {
|
|
893
441
|
return state.postLock.isLocked;
|
|
894
442
|
}
|
|
895
|
-
|
|
896
|
-
/**
|
|
897
|
-
* Returns whether post saving is locked.
|
|
898
|
-
*
|
|
899
|
-
* @param {Object} state Global application state.
|
|
900
|
-
*
|
|
901
|
-
* @example
|
|
902
|
-
* ```jsx
|
|
903
|
-
* import { __ } from '@wordpress/i18n';
|
|
904
|
-
* import { store as editorStore } from '@wordpress/editor';
|
|
905
|
-
* import { useSelect } from '@wordpress/data';
|
|
906
|
-
*
|
|
907
|
-
* const ExampleComponent = () => {
|
|
908
|
-
* const isSavingLocked = useSelect(
|
|
909
|
-
* ( select ) => select( editorStore ).isPostSavingLocked(),
|
|
910
|
-
* []
|
|
911
|
-
* );
|
|
912
|
-
*
|
|
913
|
-
* return isSavingLocked ? (
|
|
914
|
-
* <p>{ __( 'Post saving is locked' ) }</p>
|
|
915
|
-
* ) : (
|
|
916
|
-
* <p>{ __( 'Post saving is not locked' ) }</p>
|
|
917
|
-
* );
|
|
918
|
-
* };
|
|
919
|
-
* ```
|
|
920
|
-
*
|
|
921
|
-
* @return {boolean} Is locked.
|
|
922
|
-
*/
|
|
923
|
-
export function isPostSavingLocked(state) {
|
|
443
|
+
function isPostSavingLocked(state) {
|
|
924
444
|
return Object.keys(state.postSavingLock).length > 0;
|
|
925
445
|
}
|
|
926
|
-
|
|
927
|
-
/**
|
|
928
|
-
* Returns whether post autosaving is locked.
|
|
929
|
-
*
|
|
930
|
-
* @param {Object} state Global application state.
|
|
931
|
-
*
|
|
932
|
-
* @example
|
|
933
|
-
* ```jsx
|
|
934
|
-
* import { __ } from '@wordpress/i18n';
|
|
935
|
-
* import { store as editorStore } from '@wordpress/editor';
|
|
936
|
-
* import { useSelect } from '@wordpress/data';
|
|
937
|
-
*
|
|
938
|
-
* const ExampleComponent = () => {
|
|
939
|
-
* const isAutoSavingLocked = useSelect(
|
|
940
|
-
* ( select ) => select( editorStore ).isPostAutosavingLocked(),
|
|
941
|
-
* []
|
|
942
|
-
* );
|
|
943
|
-
*
|
|
944
|
-
* return isAutoSavingLocked ? (
|
|
945
|
-
* <p>{ __( 'Post auto saving is locked' ) }</p>
|
|
946
|
-
* ) : (
|
|
947
|
-
* <p>{ __( 'Post auto saving is not locked' ) }</p>
|
|
948
|
-
* );
|
|
949
|
-
* };
|
|
950
|
-
* ```
|
|
951
|
-
*
|
|
952
|
-
* @return {boolean} Is locked.
|
|
953
|
-
*/
|
|
954
|
-
export function isPostAutosavingLocked(state) {
|
|
446
|
+
function isPostAutosavingLocked(state) {
|
|
955
447
|
return Object.keys(state.postAutosavingLock).length > 0;
|
|
956
448
|
}
|
|
957
|
-
|
|
958
|
-
/**
|
|
959
|
-
* Returns whether the edition of the post has been taken over.
|
|
960
|
-
*
|
|
961
|
-
* @param {Object} state Global application state.
|
|
962
|
-
*
|
|
963
|
-
* @return {boolean} Is post lock takeover.
|
|
964
|
-
*/
|
|
965
|
-
export function isPostLockTakeover(state) {
|
|
449
|
+
function isPostLockTakeover(state) {
|
|
966
450
|
return state.postLock.isTakeover;
|
|
967
451
|
}
|
|
968
|
-
|
|
969
|
-
/**
|
|
970
|
-
* Returns details about the post lock user.
|
|
971
|
-
*
|
|
972
|
-
* @param {Object} state Global application state.
|
|
973
|
-
*
|
|
974
|
-
* @return {Object} A user object.
|
|
975
|
-
*/
|
|
976
|
-
export function getPostLockUser(state) {
|
|
452
|
+
function getPostLockUser(state) {
|
|
977
453
|
return state.postLock.user;
|
|
978
454
|
}
|
|
979
|
-
|
|
980
|
-
/**
|
|
981
|
-
* Returns the active post lock.
|
|
982
|
-
*
|
|
983
|
-
* @param {Object} state Global application state.
|
|
984
|
-
*
|
|
985
|
-
* @return {Object} The lock object.
|
|
986
|
-
*/
|
|
987
|
-
export function getActivePostLock(state) {
|
|
455
|
+
function getActivePostLock(state) {
|
|
988
456
|
return state.postLock.activePostLock;
|
|
989
457
|
}
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
/**
|
|
1011
|
-
* Return the current block list.
|
|
1012
|
-
*
|
|
1013
|
-
* @param {Object} state
|
|
1014
|
-
* @return {Array} Block list.
|
|
1015
|
-
*/
|
|
1016
|
-
export const getEditorBlocks = createSelector(state => {
|
|
1017
|
-
return getEditedPostAttribute(state, 'blocks') || parse(getEditedPostContent(state));
|
|
1018
|
-
}, state => [getEditedPostAttribute(state, 'blocks'), getEditedPostContent(state)]);
|
|
1019
|
-
|
|
1020
|
-
/**
|
|
1021
|
-
* Returns true if the given panel was programmatically removed, or false otherwise.
|
|
1022
|
-
* All panels are not removed by default.
|
|
1023
|
-
*
|
|
1024
|
-
* @param {Object} state Global application state.
|
|
1025
|
-
* @param {string} panelName A string that identifies the panel.
|
|
1026
|
-
*
|
|
1027
|
-
* @return {boolean} Whether or not the panel is removed.
|
|
1028
|
-
*/
|
|
1029
|
-
export function isEditorPanelRemoved(state, panelName) {
|
|
458
|
+
function canUserUseUnfilteredHTML(state) {
|
|
459
|
+
return Boolean(
|
|
460
|
+
getCurrentPost(state)._links?.hasOwnProperty(
|
|
461
|
+
"wp:action-unfiltered-html"
|
|
462
|
+
)
|
|
463
|
+
);
|
|
464
|
+
}
|
|
465
|
+
const isPublishSidebarEnabled = createRegistrySelector(
|
|
466
|
+
(select) => () => !!select(preferencesStore).get("core", "isPublishSidebarEnabled")
|
|
467
|
+
);
|
|
468
|
+
const getEditorBlocks = createSelector(
|
|
469
|
+
(state) => {
|
|
470
|
+
return getEditedPostAttribute(state, "blocks") || parse(getEditedPostContent(state));
|
|
471
|
+
},
|
|
472
|
+
(state) => [
|
|
473
|
+
getEditedPostAttribute(state, "blocks"),
|
|
474
|
+
getEditedPostContent(state)
|
|
475
|
+
]
|
|
476
|
+
);
|
|
477
|
+
function isEditorPanelRemoved(state, panelName) {
|
|
1030
478
|
return state.removedPanels.includes(panelName);
|
|
1031
479
|
}
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
* closed by default.
|
|
1052
|
-
*
|
|
1053
|
-
* @param {Object} state Global application state.
|
|
1054
|
-
* @param {string} panelName A string that identifies the panel.
|
|
1055
|
-
*
|
|
1056
|
-
* @return {boolean} Whether or not the panel is open.
|
|
1057
|
-
*/
|
|
1058
|
-
export const isEditorPanelOpened = createRegistrySelector(select => (state, panelName) => {
|
|
1059
|
-
// For backward compatibility, we check edit-post
|
|
1060
|
-
// even though now this is in "editor" package.
|
|
1061
|
-
const openPanels = select(preferencesStore).get('core', 'openPanels');
|
|
1062
|
-
return !!openPanels?.includes(panelName);
|
|
1063
|
-
});
|
|
1064
|
-
|
|
1065
|
-
/**
|
|
1066
|
-
* A block selection object.
|
|
1067
|
-
*
|
|
1068
|
-
* @typedef {Object} WPBlockSelection
|
|
1069
|
-
*
|
|
1070
|
-
* @property {string} clientId A block client ID.
|
|
1071
|
-
* @property {string} attributeKey A block attribute key.
|
|
1072
|
-
* @property {number} offset An attribute value offset, based on the rich
|
|
1073
|
-
* text value. See `wp.richText.create`.
|
|
1074
|
-
*/
|
|
1075
|
-
|
|
1076
|
-
/**
|
|
1077
|
-
* Returns the current selection start.
|
|
1078
|
-
*
|
|
1079
|
-
* @deprecated since Gutenberg 10.0.0.
|
|
1080
|
-
*
|
|
1081
|
-
* @param {Object} state
|
|
1082
|
-
* @return {WPBlockSelection} The selection start.
|
|
1083
|
-
*/
|
|
1084
|
-
export function getEditorSelectionStart(state) {
|
|
480
|
+
const isEditorPanelEnabled = createRegistrySelector(
|
|
481
|
+
(select) => (state, panelName) => {
|
|
482
|
+
const inactivePanels = select(preferencesStore).get(
|
|
483
|
+
"core",
|
|
484
|
+
"inactivePanels"
|
|
485
|
+
);
|
|
486
|
+
return !isEditorPanelRemoved(state, panelName) && !inactivePanels?.includes(panelName);
|
|
487
|
+
}
|
|
488
|
+
);
|
|
489
|
+
const isEditorPanelOpened = createRegistrySelector(
|
|
490
|
+
(select) => (state, panelName) => {
|
|
491
|
+
const openPanels = select(preferencesStore).get(
|
|
492
|
+
"core",
|
|
493
|
+
"openPanels"
|
|
494
|
+
);
|
|
495
|
+
return !!openPanels?.includes(panelName);
|
|
496
|
+
}
|
|
497
|
+
);
|
|
498
|
+
function getEditorSelectionStart(state) {
|
|
1085
499
|
deprecated("select('core/editor').getEditorSelectionStart", {
|
|
1086
|
-
since:
|
|
500
|
+
since: "5.8",
|
|
1087
501
|
alternative: "select('core/editor').getEditorSelection"
|
|
1088
502
|
});
|
|
1089
|
-
return getEditedPostAttribute(state,
|
|
503
|
+
return getEditedPostAttribute(state, "selection")?.selectionStart;
|
|
1090
504
|
}
|
|
1091
|
-
|
|
1092
|
-
/**
|
|
1093
|
-
* Returns the current selection end.
|
|
1094
|
-
*
|
|
1095
|
-
* @deprecated since Gutenberg 10.0.0.
|
|
1096
|
-
*
|
|
1097
|
-
* @param {Object} state
|
|
1098
|
-
* @return {WPBlockSelection} The selection end.
|
|
1099
|
-
*/
|
|
1100
|
-
export function getEditorSelectionEnd(state) {
|
|
505
|
+
function getEditorSelectionEnd(state) {
|
|
1101
506
|
deprecated("select('core/editor').getEditorSelectionStart", {
|
|
1102
|
-
since:
|
|
507
|
+
since: "5.8",
|
|
1103
508
|
alternative: "select('core/editor').getEditorSelection"
|
|
1104
509
|
});
|
|
1105
|
-
return getEditedPostAttribute(state,
|
|
510
|
+
return getEditedPostAttribute(state, "selection")?.selectionEnd;
|
|
1106
511
|
}
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
* Returns the current selection.
|
|
1110
|
-
*
|
|
1111
|
-
* @param {Object} state
|
|
1112
|
-
* @return {WPBlockSelection} The selection end.
|
|
1113
|
-
*/
|
|
1114
|
-
export function getEditorSelection(state) {
|
|
1115
|
-
return getEditedPostAttribute(state, 'selection');
|
|
512
|
+
function getEditorSelection(state) {
|
|
513
|
+
return getEditedPostAttribute(state, "selection");
|
|
1116
514
|
}
|
|
1117
|
-
|
|
1118
|
-
/**
|
|
1119
|
-
* Is the editor ready
|
|
1120
|
-
*
|
|
1121
|
-
* @param {Object} state
|
|
1122
|
-
* @return {boolean} is Ready.
|
|
1123
|
-
*/
|
|
1124
|
-
export function __unstableIsEditorReady(state) {
|
|
515
|
+
function __unstableIsEditorReady(state) {
|
|
1125
516
|
return !!state.postId;
|
|
1126
517
|
}
|
|
1127
|
-
|
|
1128
|
-
/**
|
|
1129
|
-
* Returns the post editor settings.
|
|
1130
|
-
*
|
|
1131
|
-
* @param {Object} state Editor state.
|
|
1132
|
-
*
|
|
1133
|
-
* @return {Object} The editor settings object.
|
|
1134
|
-
*/
|
|
1135
|
-
export function getEditorSettings(state) {
|
|
518
|
+
function getEditorSettings(state) {
|
|
1136
519
|
return state.editorSettings;
|
|
1137
520
|
}
|
|
1138
|
-
|
|
1139
|
-
/**
|
|
1140
|
-
* Returns the post editor's rendering mode.
|
|
1141
|
-
*
|
|
1142
|
-
* @param {Object} state Editor state.
|
|
1143
|
-
*
|
|
1144
|
-
* @return {string} Rendering mode.
|
|
1145
|
-
*/
|
|
1146
|
-
export function getRenderingMode(state) {
|
|
521
|
+
function getRenderingMode(state) {
|
|
1147
522
|
return state.renderingMode;
|
|
1148
523
|
}
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
*/
|
|
1157
|
-
export const getDeviceType = createRegistrySelector(select => state => {
|
|
1158
|
-
const isZoomOut = unlock(select(blockEditorStore)).isZoomOut();
|
|
1159
|
-
if (isZoomOut) {
|
|
1160
|
-
return 'Desktop';
|
|
524
|
+
const getDeviceType = createRegistrySelector(
|
|
525
|
+
(select) => (state) => {
|
|
526
|
+
const isZoomOut = unlock(select(blockEditorStore)).isZoomOut();
|
|
527
|
+
if (isZoomOut) {
|
|
528
|
+
return "Desktop";
|
|
529
|
+
}
|
|
530
|
+
return state.deviceType;
|
|
1161
531
|
}
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
/**
|
|
1166
|
-
* Returns true if the list view is opened.
|
|
1167
|
-
*
|
|
1168
|
-
* @param {Object} state Global application state.
|
|
1169
|
-
*
|
|
1170
|
-
* @return {boolean} Whether the list view is opened.
|
|
1171
|
-
*/
|
|
1172
|
-
export function isListViewOpened(state) {
|
|
532
|
+
);
|
|
533
|
+
function isListViewOpened(state) {
|
|
1173
534
|
return state.listViewPanel;
|
|
1174
535
|
}
|
|
1175
|
-
|
|
1176
|
-
/**
|
|
1177
|
-
* Returns true if the inserter is opened.
|
|
1178
|
-
*
|
|
1179
|
-
* @param {Object} state Global application state.
|
|
1180
|
-
*
|
|
1181
|
-
* @return {boolean} Whether the inserter is opened.
|
|
1182
|
-
*/
|
|
1183
|
-
export function isInserterOpened(state) {
|
|
536
|
+
function isInserterOpened(state) {
|
|
1184
537
|
return !!state.blockInserterPanel;
|
|
1185
538
|
}
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
* @param {Object} state Global application state.
|
|
1191
|
-
*
|
|
1192
|
-
* @return {string} Editing mode.
|
|
1193
|
-
*/
|
|
1194
|
-
export const getEditorMode = createRegistrySelector(select => () => {
|
|
1195
|
-
var _select$get;
|
|
1196
|
-
return (_select$get = select(preferencesStore).get('core', 'editorMode')) !== null && _select$get !== void 0 ? _select$get : 'visual';
|
|
1197
|
-
});
|
|
1198
|
-
|
|
1199
|
-
/*
|
|
1200
|
-
* Backward compatibility
|
|
1201
|
-
*/
|
|
1202
|
-
|
|
1203
|
-
/**
|
|
1204
|
-
* Returns state object prior to a specified optimist transaction ID, or `null`
|
|
1205
|
-
* if the transaction corresponding to the given ID cannot be found.
|
|
1206
|
-
*
|
|
1207
|
-
* @deprecated since Gutenberg 9.7.0.
|
|
1208
|
-
*/
|
|
1209
|
-
export function getStateBeforeOptimisticTransaction() {
|
|
539
|
+
const getEditorMode = createRegistrySelector(
|
|
540
|
+
(select) => () => select(preferencesStore).get("core", "editorMode") ?? "visual"
|
|
541
|
+
);
|
|
542
|
+
function getStateBeforeOptimisticTransaction() {
|
|
1210
543
|
deprecated("select('core/editor').getStateBeforeOptimisticTransaction", {
|
|
1211
|
-
since:
|
|
1212
|
-
hint:
|
|
544
|
+
since: "5.7",
|
|
545
|
+
hint: "No state history is kept on this store anymore"
|
|
1213
546
|
});
|
|
1214
547
|
return null;
|
|
1215
548
|
}
|
|
1216
|
-
|
|
1217
|
-
* Returns true if an optimistic transaction is pending commit, for which the
|
|
1218
|
-
* before state satisfies the given predicate function.
|
|
1219
|
-
*
|
|
1220
|
-
* @deprecated since Gutenberg 9.7.0.
|
|
1221
|
-
*/
|
|
1222
|
-
export function inSomeHistory() {
|
|
549
|
+
function inSomeHistory() {
|
|
1223
550
|
deprecated("select('core/editor').inSomeHistory", {
|
|
1224
|
-
since:
|
|
1225
|
-
hint:
|
|
551
|
+
since: "5.7",
|
|
552
|
+
hint: "No state history is kept on this store anymore"
|
|
1226
553
|
});
|
|
1227
554
|
return false;
|
|
1228
555
|
}
|
|
1229
556
|
function getBlockEditorSelector(name) {
|
|
1230
|
-
return createRegistrySelector(select => (state, ...args) => {
|
|
1231
|
-
deprecated("`wp.data.select( 'core/editor' )." + name +
|
|
1232
|
-
since:
|
|
1233
|
-
alternative: "`wp.data.select( 'core/block-editor' )." + name +
|
|
1234
|
-
version:
|
|
557
|
+
return createRegistrySelector((select) => (state, ...args) => {
|
|
558
|
+
deprecated("`wp.data.select( 'core/editor' )." + name + "`", {
|
|
559
|
+
since: "5.3",
|
|
560
|
+
alternative: "`wp.data.select( 'core/block-editor' )." + name + "`",
|
|
561
|
+
version: "6.2"
|
|
1235
562
|
});
|
|
1236
563
|
return select(blockEditorStore)[name](...args);
|
|
1237
564
|
});
|
|
1238
565
|
}
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
export const isBlockWithinSelection = getBlockEditorSelector('isBlockWithinSelection');
|
|
1419
|
-
|
|
1420
|
-
/**
|
|
1421
|
-
* @see hasMultiSelection in core/block-editor store.
|
|
1422
|
-
*/
|
|
1423
|
-
export const hasMultiSelection = getBlockEditorSelector('hasMultiSelection');
|
|
1424
|
-
|
|
1425
|
-
/**
|
|
1426
|
-
* @see isMultiSelecting in core/block-editor store.
|
|
1427
|
-
*/
|
|
1428
|
-
export const isMultiSelecting = getBlockEditorSelector('isMultiSelecting');
|
|
1429
|
-
|
|
1430
|
-
/**
|
|
1431
|
-
* @see isSelectionEnabled in core/block-editor store.
|
|
1432
|
-
*/
|
|
1433
|
-
export const isSelectionEnabled = getBlockEditorSelector('isSelectionEnabled');
|
|
1434
|
-
|
|
1435
|
-
/**
|
|
1436
|
-
* @see getBlockMode in core/block-editor store.
|
|
1437
|
-
*/
|
|
1438
|
-
export const getBlockMode = getBlockEditorSelector('getBlockMode');
|
|
1439
|
-
|
|
1440
|
-
/**
|
|
1441
|
-
* @see isTyping in core/block-editor store.
|
|
1442
|
-
*/
|
|
1443
|
-
export const isTyping = getBlockEditorSelector('isTyping');
|
|
1444
|
-
|
|
1445
|
-
/**
|
|
1446
|
-
* @see isCaretWithinFormattedText in core/block-editor store.
|
|
1447
|
-
*/
|
|
1448
|
-
export const isCaretWithinFormattedText = getBlockEditorSelector('isCaretWithinFormattedText');
|
|
1449
|
-
|
|
1450
|
-
/**
|
|
1451
|
-
* @see getBlockInsertionPoint in core/block-editor store.
|
|
1452
|
-
*/
|
|
1453
|
-
export const getBlockInsertionPoint = getBlockEditorSelector('getBlockInsertionPoint');
|
|
1454
|
-
|
|
1455
|
-
/**
|
|
1456
|
-
* @see isBlockInsertionPointVisible in core/block-editor store.
|
|
1457
|
-
*/
|
|
1458
|
-
export const isBlockInsertionPointVisible = getBlockEditorSelector('isBlockInsertionPointVisible');
|
|
1459
|
-
|
|
1460
|
-
/**
|
|
1461
|
-
* @see isValidTemplate in core/block-editor store.
|
|
1462
|
-
*/
|
|
1463
|
-
export const isValidTemplate = getBlockEditorSelector('isValidTemplate');
|
|
1464
|
-
|
|
1465
|
-
/**
|
|
1466
|
-
* @see getTemplate in core/block-editor store.
|
|
1467
|
-
*/
|
|
1468
|
-
export const getTemplate = getBlockEditorSelector('getTemplate');
|
|
1469
|
-
|
|
1470
|
-
/**
|
|
1471
|
-
* @see getTemplateLock in core/block-editor store.
|
|
1472
|
-
*/
|
|
1473
|
-
export const getTemplateLock = getBlockEditorSelector('getTemplateLock');
|
|
1474
|
-
|
|
1475
|
-
/**
|
|
1476
|
-
* @see canInsertBlockType in core/block-editor store.
|
|
1477
|
-
*/
|
|
1478
|
-
export const canInsertBlockType = getBlockEditorSelector('canInsertBlockType');
|
|
1479
|
-
|
|
1480
|
-
/**
|
|
1481
|
-
* @see getInserterItems in core/block-editor store.
|
|
1482
|
-
*/
|
|
1483
|
-
export const getInserterItems = getBlockEditorSelector('getInserterItems');
|
|
1484
|
-
|
|
1485
|
-
/**
|
|
1486
|
-
* @see hasInserterItems in core/block-editor store.
|
|
1487
|
-
*/
|
|
1488
|
-
export const hasInserterItems = getBlockEditorSelector('hasInserterItems');
|
|
1489
|
-
|
|
1490
|
-
/**
|
|
1491
|
-
* @see getBlockListSettings in core/block-editor store.
|
|
1492
|
-
*/
|
|
1493
|
-
export const getBlockListSettings = getBlockEditorSelector('getBlockListSettings');
|
|
1494
|
-
export const __experimentalGetDefaultTemplateTypes = createRegistrySelector(select => () => {
|
|
1495
|
-
deprecated("select('core/editor').__experimentalGetDefaultTemplateTypes", {
|
|
1496
|
-
since: '6.8',
|
|
1497
|
-
alternative: "select('core/core-data').getCurrentTheme()?.default_template_types"
|
|
1498
|
-
});
|
|
1499
|
-
return select(coreStore).getCurrentTheme()?.default_template_types;
|
|
1500
|
-
});
|
|
1501
|
-
|
|
1502
|
-
/**
|
|
1503
|
-
* Returns the default template part areas.
|
|
1504
|
-
*
|
|
1505
|
-
* @param {Object} state Global application state.
|
|
1506
|
-
*
|
|
1507
|
-
* @return {Array} The template part areas.
|
|
1508
|
-
*/
|
|
1509
|
-
export const __experimentalGetDefaultTemplatePartAreas = createRegistrySelector(select => createSelector(() => {
|
|
1510
|
-
deprecated("select('core/editor').__experimentalGetDefaultTemplatePartAreas", {
|
|
1511
|
-
since: '6.8',
|
|
1512
|
-
alternative: "select('core/core-data').getCurrentTheme()?.default_template_part_areas"
|
|
1513
|
-
});
|
|
1514
|
-
const areas = select(coreStore).getCurrentTheme()?.default_template_part_areas || [];
|
|
1515
|
-
return areas.map(item => {
|
|
1516
|
-
return {
|
|
1517
|
-
...item,
|
|
1518
|
-
icon: getTemplatePartIcon(item.icon)
|
|
1519
|
-
};
|
|
1520
|
-
});
|
|
1521
|
-
}));
|
|
1522
|
-
|
|
1523
|
-
/**
|
|
1524
|
-
* Returns a default template type searched by slug.
|
|
1525
|
-
*
|
|
1526
|
-
* @param {Object} state Global application state.
|
|
1527
|
-
* @param {string} slug The template type slug.
|
|
1528
|
-
*
|
|
1529
|
-
* @return {Object} The template type.
|
|
1530
|
-
*/
|
|
1531
|
-
export const __experimentalGetDefaultTemplateType = createRegistrySelector(select => createSelector((state, slug) => {
|
|
1532
|
-
var _Object$values$find;
|
|
1533
|
-
deprecated("select('core/editor').__experimentalGetDefaultTemplateType", {
|
|
1534
|
-
since: '6.8'
|
|
1535
|
-
});
|
|
1536
|
-
const templateTypes = select(coreStore).getCurrentTheme()?.default_template_types;
|
|
1537
|
-
if (!templateTypes) {
|
|
1538
|
-
return EMPTY_OBJECT;
|
|
1539
|
-
}
|
|
1540
|
-
return (_Object$values$find = Object.values(templateTypes).find(type => type.slug === slug)) !== null && _Object$values$find !== void 0 ? _Object$values$find : EMPTY_OBJECT;
|
|
1541
|
-
}));
|
|
1542
|
-
|
|
1543
|
-
/**
|
|
1544
|
-
* Given a template entity, return information about it which is ready to be
|
|
1545
|
-
* rendered, such as the title, description, and icon.
|
|
1546
|
-
*
|
|
1547
|
-
* @param {Object} state Global application state.
|
|
1548
|
-
* @param {Object} template The template for which we need information.
|
|
1549
|
-
* @return {Object} Information about the template, including title, description, and icon.
|
|
1550
|
-
*/
|
|
1551
|
-
export const __experimentalGetTemplateInfo = createRegistrySelector(select => createSelector((state, template) => {
|
|
1552
|
-
deprecated("select('core/editor').__experimentalGetTemplateInfo", {
|
|
1553
|
-
since: '6.8'
|
|
1554
|
-
});
|
|
1555
|
-
if (!template) {
|
|
1556
|
-
return EMPTY_OBJECT;
|
|
1557
|
-
}
|
|
1558
|
-
const currentTheme = select(coreStore).getCurrentTheme();
|
|
1559
|
-
const templateTypes = currentTheme?.default_template_types || [];
|
|
1560
|
-
const templateAreas = currentTheme?.default_template_part_areas || [];
|
|
1561
|
-
return getTemplateInfo({
|
|
1562
|
-
template,
|
|
1563
|
-
templateAreas,
|
|
1564
|
-
templateTypes
|
|
1565
|
-
});
|
|
1566
|
-
}));
|
|
1567
|
-
|
|
1568
|
-
/**
|
|
1569
|
-
* Returns a post type label depending on the current post.
|
|
1570
|
-
*
|
|
1571
|
-
* @param {Object} state Global application state.
|
|
1572
|
-
*
|
|
1573
|
-
* @return {string|undefined} The post type label if available, otherwise undefined.
|
|
1574
|
-
*/
|
|
1575
|
-
export const getPostTypeLabel = createRegistrySelector(select => state => {
|
|
1576
|
-
const currentPostType = getCurrentPostType(state);
|
|
1577
|
-
const postType = select(coreStore).getPostType(currentPostType);
|
|
1578
|
-
// Disable reason: Post type labels object is shaped like this.
|
|
1579
|
-
// eslint-disable-next-line camelcase
|
|
1580
|
-
return postType?.labels?.singular_name;
|
|
1581
|
-
});
|
|
1582
|
-
|
|
1583
|
-
/**
|
|
1584
|
-
* Returns true if the publish sidebar is opened.
|
|
1585
|
-
*
|
|
1586
|
-
* @param {Object} state Global application state
|
|
1587
|
-
*
|
|
1588
|
-
* @return {boolean} Whether the publish sidebar is open.
|
|
1589
|
-
*/
|
|
1590
|
-
export function isPublishSidebarOpened(state) {
|
|
566
|
+
const getBlockName = getBlockEditorSelector("getBlockName");
|
|
567
|
+
const isBlockValid = getBlockEditorSelector("isBlockValid");
|
|
568
|
+
const getBlockAttributes = getBlockEditorSelector("getBlockAttributes");
|
|
569
|
+
const getBlock = getBlockEditorSelector("getBlock");
|
|
570
|
+
const getBlocks = getBlockEditorSelector("getBlocks");
|
|
571
|
+
const getClientIdsOfDescendants = getBlockEditorSelector(
|
|
572
|
+
"getClientIdsOfDescendants"
|
|
573
|
+
);
|
|
574
|
+
const getClientIdsWithDescendants = getBlockEditorSelector(
|
|
575
|
+
"getClientIdsWithDescendants"
|
|
576
|
+
);
|
|
577
|
+
const getGlobalBlockCount = getBlockEditorSelector(
|
|
578
|
+
"getGlobalBlockCount"
|
|
579
|
+
);
|
|
580
|
+
const getBlocksByClientId = getBlockEditorSelector(
|
|
581
|
+
"getBlocksByClientId"
|
|
582
|
+
);
|
|
583
|
+
const getBlockCount = getBlockEditorSelector("getBlockCount");
|
|
584
|
+
const getBlockSelectionStart = getBlockEditorSelector(
|
|
585
|
+
"getBlockSelectionStart"
|
|
586
|
+
);
|
|
587
|
+
const getBlockSelectionEnd = getBlockEditorSelector(
|
|
588
|
+
"getBlockSelectionEnd"
|
|
589
|
+
);
|
|
590
|
+
const getSelectedBlockCount = getBlockEditorSelector(
|
|
591
|
+
"getSelectedBlockCount"
|
|
592
|
+
);
|
|
593
|
+
const hasSelectedBlock = getBlockEditorSelector("hasSelectedBlock");
|
|
594
|
+
const getSelectedBlockClientId = getBlockEditorSelector(
|
|
595
|
+
"getSelectedBlockClientId"
|
|
596
|
+
);
|
|
597
|
+
const getSelectedBlock = getBlockEditorSelector("getSelectedBlock");
|
|
598
|
+
const getBlockRootClientId = getBlockEditorSelector(
|
|
599
|
+
"getBlockRootClientId"
|
|
600
|
+
);
|
|
601
|
+
const getBlockHierarchyRootClientId = getBlockEditorSelector(
|
|
602
|
+
"getBlockHierarchyRootClientId"
|
|
603
|
+
);
|
|
604
|
+
const getAdjacentBlockClientId = getBlockEditorSelector(
|
|
605
|
+
"getAdjacentBlockClientId"
|
|
606
|
+
);
|
|
607
|
+
const getPreviousBlockClientId = getBlockEditorSelector(
|
|
608
|
+
"getPreviousBlockClientId"
|
|
609
|
+
);
|
|
610
|
+
const getNextBlockClientId = getBlockEditorSelector(
|
|
611
|
+
"getNextBlockClientId"
|
|
612
|
+
);
|
|
613
|
+
const getSelectedBlocksInitialCaretPosition = getBlockEditorSelector(
|
|
614
|
+
"getSelectedBlocksInitialCaretPosition"
|
|
615
|
+
);
|
|
616
|
+
const getMultiSelectedBlockClientIds = getBlockEditorSelector(
|
|
617
|
+
"getMultiSelectedBlockClientIds"
|
|
618
|
+
);
|
|
619
|
+
const getMultiSelectedBlocks = getBlockEditorSelector(
|
|
620
|
+
"getMultiSelectedBlocks"
|
|
621
|
+
);
|
|
622
|
+
const getFirstMultiSelectedBlockClientId = getBlockEditorSelector(
|
|
623
|
+
"getFirstMultiSelectedBlockClientId"
|
|
624
|
+
);
|
|
625
|
+
const getLastMultiSelectedBlockClientId = getBlockEditorSelector(
|
|
626
|
+
"getLastMultiSelectedBlockClientId"
|
|
627
|
+
);
|
|
628
|
+
const isFirstMultiSelectedBlock = getBlockEditorSelector(
|
|
629
|
+
"isFirstMultiSelectedBlock"
|
|
630
|
+
);
|
|
631
|
+
const isBlockMultiSelected = getBlockEditorSelector(
|
|
632
|
+
"isBlockMultiSelected"
|
|
633
|
+
);
|
|
634
|
+
const isAncestorMultiSelected = getBlockEditorSelector(
|
|
635
|
+
"isAncestorMultiSelected"
|
|
636
|
+
);
|
|
637
|
+
const getMultiSelectedBlocksStartClientId = getBlockEditorSelector(
|
|
638
|
+
"getMultiSelectedBlocksStartClientId"
|
|
639
|
+
);
|
|
640
|
+
const getMultiSelectedBlocksEndClientId = getBlockEditorSelector(
|
|
641
|
+
"getMultiSelectedBlocksEndClientId"
|
|
642
|
+
);
|
|
643
|
+
const getBlockOrder = getBlockEditorSelector("getBlockOrder");
|
|
644
|
+
const getBlockIndex = getBlockEditorSelector("getBlockIndex");
|
|
645
|
+
const isBlockSelected = getBlockEditorSelector("isBlockSelected");
|
|
646
|
+
const hasSelectedInnerBlock = getBlockEditorSelector(
|
|
647
|
+
"hasSelectedInnerBlock"
|
|
648
|
+
);
|
|
649
|
+
const isBlockWithinSelection = getBlockEditorSelector(
|
|
650
|
+
"isBlockWithinSelection"
|
|
651
|
+
);
|
|
652
|
+
const hasMultiSelection = getBlockEditorSelector("hasMultiSelection");
|
|
653
|
+
const isMultiSelecting = getBlockEditorSelector("isMultiSelecting");
|
|
654
|
+
const isSelectionEnabled = getBlockEditorSelector("isSelectionEnabled");
|
|
655
|
+
const getBlockMode = getBlockEditorSelector("getBlockMode");
|
|
656
|
+
const isTyping = getBlockEditorSelector("isTyping");
|
|
657
|
+
const isCaretWithinFormattedText = getBlockEditorSelector(
|
|
658
|
+
"isCaretWithinFormattedText"
|
|
659
|
+
);
|
|
660
|
+
const getBlockInsertionPoint = getBlockEditorSelector(
|
|
661
|
+
"getBlockInsertionPoint"
|
|
662
|
+
);
|
|
663
|
+
const isBlockInsertionPointVisible = getBlockEditorSelector(
|
|
664
|
+
"isBlockInsertionPointVisible"
|
|
665
|
+
);
|
|
666
|
+
const isValidTemplate = getBlockEditorSelector("isValidTemplate");
|
|
667
|
+
const getTemplate = getBlockEditorSelector("getTemplate");
|
|
668
|
+
const getTemplateLock = getBlockEditorSelector("getTemplateLock");
|
|
669
|
+
const canInsertBlockType = getBlockEditorSelector("canInsertBlockType");
|
|
670
|
+
const getInserterItems = getBlockEditorSelector("getInserterItems");
|
|
671
|
+
const hasInserterItems = getBlockEditorSelector("hasInserterItems");
|
|
672
|
+
const getBlockListSettings = getBlockEditorSelector(
|
|
673
|
+
"getBlockListSettings"
|
|
674
|
+
);
|
|
675
|
+
const __experimentalGetDefaultTemplateTypes = createRegistrySelector(
|
|
676
|
+
(select) => () => {
|
|
677
|
+
deprecated(
|
|
678
|
+
"select('core/editor').__experimentalGetDefaultTemplateTypes",
|
|
679
|
+
{
|
|
680
|
+
since: "6.8",
|
|
681
|
+
alternative: "select('core/core-data').getCurrentTheme()?.default_template_types"
|
|
682
|
+
}
|
|
683
|
+
);
|
|
684
|
+
return select(coreStore).getCurrentTheme()?.default_template_types;
|
|
685
|
+
}
|
|
686
|
+
);
|
|
687
|
+
const __experimentalGetDefaultTemplatePartAreas = createRegistrySelector(
|
|
688
|
+
(select) => createSelector(() => {
|
|
689
|
+
deprecated(
|
|
690
|
+
"select('core/editor').__experimentalGetDefaultTemplatePartAreas",
|
|
691
|
+
{
|
|
692
|
+
since: "6.8",
|
|
693
|
+
alternative: "select('core/core-data').getCurrentTheme()?.default_template_part_areas"
|
|
694
|
+
}
|
|
695
|
+
);
|
|
696
|
+
const areas = select(coreStore).getCurrentTheme()?.default_template_part_areas || [];
|
|
697
|
+
return areas.map((item) => {
|
|
698
|
+
return { ...item, icon: getTemplatePartIcon(item.icon) };
|
|
699
|
+
});
|
|
700
|
+
})
|
|
701
|
+
);
|
|
702
|
+
const __experimentalGetDefaultTemplateType = createRegistrySelector(
|
|
703
|
+
(select) => createSelector((state, slug) => {
|
|
704
|
+
deprecated(
|
|
705
|
+
"select('core/editor').__experimentalGetDefaultTemplateType",
|
|
706
|
+
{
|
|
707
|
+
since: "6.8"
|
|
708
|
+
}
|
|
709
|
+
);
|
|
710
|
+
const templateTypes = select(coreStore).getCurrentTheme()?.default_template_types;
|
|
711
|
+
if (!templateTypes) {
|
|
712
|
+
return EMPTY_OBJECT;
|
|
713
|
+
}
|
|
714
|
+
return Object.values(templateTypes).find(
|
|
715
|
+
(type) => type.slug === slug
|
|
716
|
+
) ?? EMPTY_OBJECT;
|
|
717
|
+
})
|
|
718
|
+
);
|
|
719
|
+
const __experimentalGetTemplateInfo = createRegistrySelector(
|
|
720
|
+
(select) => createSelector((state, template) => {
|
|
721
|
+
deprecated("select('core/editor').__experimentalGetTemplateInfo", {
|
|
722
|
+
since: "6.8"
|
|
723
|
+
});
|
|
724
|
+
if (!template) {
|
|
725
|
+
return EMPTY_OBJECT;
|
|
726
|
+
}
|
|
727
|
+
const currentTheme = select(coreStore).getCurrentTheme();
|
|
728
|
+
const templateTypes = currentTheme?.default_template_types || [];
|
|
729
|
+
const templateAreas = currentTheme?.default_template_part_areas || [];
|
|
730
|
+
return getTemplateInfo({
|
|
731
|
+
template,
|
|
732
|
+
templateAreas,
|
|
733
|
+
templateTypes
|
|
734
|
+
});
|
|
735
|
+
})
|
|
736
|
+
);
|
|
737
|
+
const getPostTypeLabel = createRegistrySelector(
|
|
738
|
+
(select) => (state) => {
|
|
739
|
+
const currentPostType = getCurrentPostType(state);
|
|
740
|
+
const postType = select(coreStore).getPostType(currentPostType);
|
|
741
|
+
return postType?.labels?.singular_name;
|
|
742
|
+
}
|
|
743
|
+
);
|
|
744
|
+
function isPublishSidebarOpened(state) {
|
|
1591
745
|
return state.publishSidebarActive;
|
|
1592
746
|
}
|
|
1593
|
-
|
|
747
|
+
export {
|
|
748
|
+
__experimentalGetDefaultTemplatePartAreas,
|
|
749
|
+
__experimentalGetDefaultTemplateType,
|
|
750
|
+
__experimentalGetDefaultTemplateTypes,
|
|
751
|
+
__experimentalGetTemplateInfo,
|
|
752
|
+
__unstableIsEditorReady,
|
|
753
|
+
canInsertBlockType,
|
|
754
|
+
canUserUseUnfilteredHTML,
|
|
755
|
+
didPostSaveRequestFail,
|
|
756
|
+
didPostSaveRequestSucceed,
|
|
757
|
+
getActivePostLock,
|
|
758
|
+
getAdjacentBlockClientId,
|
|
759
|
+
getAutosaveAttribute,
|
|
760
|
+
getBlock,
|
|
761
|
+
getBlockAttributes,
|
|
762
|
+
getBlockCount,
|
|
763
|
+
getBlockHierarchyRootClientId,
|
|
764
|
+
getBlockIndex,
|
|
765
|
+
getBlockInsertionPoint,
|
|
766
|
+
getBlockListSettings,
|
|
767
|
+
getBlockMode,
|
|
768
|
+
getBlockName,
|
|
769
|
+
getBlockOrder,
|
|
770
|
+
getBlockRootClientId,
|
|
771
|
+
getBlockSelectionEnd,
|
|
772
|
+
getBlockSelectionStart,
|
|
773
|
+
getBlocks,
|
|
774
|
+
getBlocksByClientId,
|
|
775
|
+
getClientIdsOfDescendants,
|
|
776
|
+
getClientIdsWithDescendants,
|
|
777
|
+
getCurrentPost,
|
|
778
|
+
getCurrentPostAttribute,
|
|
779
|
+
getCurrentPostId,
|
|
780
|
+
getCurrentPostLastRevisionId,
|
|
781
|
+
getCurrentPostRevisionsCount,
|
|
782
|
+
getCurrentPostType,
|
|
783
|
+
getCurrentTemplateId,
|
|
784
|
+
getDeviceType,
|
|
785
|
+
getEditedPostAttribute,
|
|
786
|
+
getEditedPostContent,
|
|
787
|
+
getEditedPostPreviewLink,
|
|
788
|
+
getEditedPostSlug,
|
|
789
|
+
getEditedPostVisibility,
|
|
790
|
+
getEditorBlocks,
|
|
791
|
+
getEditorMode,
|
|
792
|
+
getEditorSelection,
|
|
793
|
+
getEditorSelectionEnd,
|
|
794
|
+
getEditorSelectionStart,
|
|
795
|
+
getEditorSettings,
|
|
796
|
+
getFirstMultiSelectedBlockClientId,
|
|
797
|
+
getGlobalBlockCount,
|
|
798
|
+
getInserterItems,
|
|
799
|
+
getLastMultiSelectedBlockClientId,
|
|
800
|
+
getMultiSelectedBlockClientIds,
|
|
801
|
+
getMultiSelectedBlocks,
|
|
802
|
+
getMultiSelectedBlocksEndClientId,
|
|
803
|
+
getMultiSelectedBlocksStartClientId,
|
|
804
|
+
getNextBlockClientId,
|
|
805
|
+
getPermalink,
|
|
806
|
+
getPermalinkParts,
|
|
807
|
+
getPostEdits,
|
|
808
|
+
getPostLockUser,
|
|
809
|
+
getPostTypeLabel,
|
|
810
|
+
getPreviousBlockClientId,
|
|
811
|
+
getRenderingMode,
|
|
812
|
+
getSelectedBlock,
|
|
813
|
+
getSelectedBlockClientId,
|
|
814
|
+
getSelectedBlockCount,
|
|
815
|
+
getSelectedBlocksInitialCaretPosition,
|
|
816
|
+
getStateBeforeOptimisticTransaction,
|
|
817
|
+
getSuggestedPostFormat,
|
|
818
|
+
getTemplate,
|
|
819
|
+
getTemplateLock,
|
|
820
|
+
hasChangedContent,
|
|
821
|
+
hasEditorRedo,
|
|
822
|
+
hasEditorUndo,
|
|
823
|
+
hasInserterItems,
|
|
824
|
+
hasMultiSelection,
|
|
825
|
+
hasNonPostEntityChanges,
|
|
826
|
+
hasSelectedBlock,
|
|
827
|
+
hasSelectedInnerBlock,
|
|
828
|
+
inSomeHistory,
|
|
829
|
+
isAncestorMultiSelected,
|
|
830
|
+
isAutosavingPost,
|
|
831
|
+
isBlockInsertionPointVisible,
|
|
832
|
+
isBlockMultiSelected,
|
|
833
|
+
isBlockSelected,
|
|
834
|
+
isBlockValid,
|
|
835
|
+
isBlockWithinSelection,
|
|
836
|
+
isCaretWithinFormattedText,
|
|
837
|
+
isCleanNewPost,
|
|
838
|
+
isCurrentPostPending,
|
|
839
|
+
isCurrentPostPublished,
|
|
840
|
+
isCurrentPostScheduled,
|
|
841
|
+
isDeletingPost,
|
|
842
|
+
isEditedPostAutosaveable,
|
|
843
|
+
isEditedPostBeingScheduled,
|
|
844
|
+
isEditedPostDateFloating,
|
|
845
|
+
isEditedPostDirty,
|
|
846
|
+
isEditedPostEmpty,
|
|
847
|
+
isEditedPostNew,
|
|
848
|
+
isEditedPostPublishable,
|
|
849
|
+
isEditedPostSaveable,
|
|
850
|
+
isEditorPanelEnabled,
|
|
851
|
+
isEditorPanelOpened,
|
|
852
|
+
isEditorPanelRemoved,
|
|
853
|
+
isFirstMultiSelectedBlock,
|
|
854
|
+
isInserterOpened,
|
|
855
|
+
isListViewOpened,
|
|
856
|
+
isMultiSelecting,
|
|
857
|
+
isPermalinkEditable,
|
|
858
|
+
isPostAutosavingLocked,
|
|
859
|
+
isPostLockTakeover,
|
|
860
|
+
isPostLocked,
|
|
861
|
+
isPostSavingLocked,
|
|
862
|
+
isPreviewingPost,
|
|
863
|
+
isPublishSidebarEnabled,
|
|
864
|
+
isPublishSidebarOpened,
|
|
865
|
+
isPublishingPost,
|
|
866
|
+
isSavingNonPostEntityChanges,
|
|
867
|
+
isSavingPost,
|
|
868
|
+
isSelectionEnabled,
|
|
869
|
+
isTyping,
|
|
870
|
+
isValidTemplate
|
|
871
|
+
};
|
|
872
|
+
//# sourceMappingURL=selectors.js.map
|