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