@wordpress/editor 13.32.0 → 13.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/README.md +225 -2
- package/build/bindings/index.js.map +1 -1
- package/build/bindings/pattern-overrides.js.map +1 -1
- package/build/bindings/post-meta.js +12 -30
- package/build/bindings/post-meta.js.map +1 -1
- package/build/components/autocompleters/index.js.map +1 -1
- package/build/components/autocompleters/user.js.map +1 -1
- package/build/components/autosave-monitor/index.js +10 -0
- package/build/components/autosave-monitor/index.js.map +1 -1
- package/build/components/block-manager/category.js.map +1 -1
- package/build/components/block-manager/checklist.js.map +1 -1
- package/build/components/block-manager/index.js.map +1 -1
- package/build/components/block-removal-warnings/index.js.map +1 -1
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
- package/build/components/character-count/index.js.map +1 -1
- package/build/components/commands/index.js +19 -0
- package/build/components/commands/index.js.map +1 -1
- package/build/components/commands/index.native.js.map +1 -1
- package/build/components/deprecated.js.map +1 -1
- package/build/components/deprecated.native.js.map +1 -1
- package/build/components/document-bar/index.js.map +1 -1
- package/build/components/document-outline/check.js.map +1 -1
- package/build/components/document-outline/index.js.map +1 -1
- package/build/components/document-outline/item.js.map +1 -1
- package/build/components/document-tools/index.js +1 -1
- package/build/components/document-tools/index.js.map +1 -1
- package/build/components/editor-canvas/edit-template-blocks-notification.js +13 -2
- package/build/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
- package/build/components/editor-canvas/index.js +2 -2
- package/build/components/editor-canvas/index.js.map +1 -1
- package/build/components/editor-help/add-blocks.native.js.map +1 -1
- package/build/components/editor-help/customize-blocks.native.js.map +1 -1
- package/build/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
- package/build/components/editor-help/help-get-support-button.native.js.map +1 -1
- package/build/components/editor-help/help-section-title.native.js.map +1 -1
- package/build/components/editor-help/help-topic-row.native.js.map +1 -1
- package/build/components/editor-help/icon-move-blocks.native.js.map +1 -1
- package/build/components/editor-help/index.native.js.map +1 -1
- package/build/components/editor-help/intro-to-blocks.native.js.map +1 -1
- package/build/components/editor-help/move-blocks.native.js.map +1 -1
- package/build/components/editor-help/remove-blocks.native.js.map +1 -1
- package/build/components/editor-help/view-sections.native.js.map +1 -1
- package/build/components/editor-history/redo.js.map +1 -1
- package/build/components/editor-history/undo.js.map +1 -1
- package/build/components/editor-notices/index.js.map +1 -1
- package/build/components/editor-snackbars/index.js.map +1 -1
- package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
- package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
- package/build/components/entities-saved-states/index.js.map +1 -1
- package/build/components/error-boundary/index.js.map +1 -1
- package/build/components/error-boundary/index.native.js.map +1 -1
- package/build/components/global-keyboard-shortcuts/index.js +24 -0
- package/build/components/global-keyboard-shortcuts/index.js.map +1 -1
- package/build/components/global-keyboard-shortcuts/register-shortcuts.js +18 -0
- package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
- package/build/components/index.js +33 -1
- package/build/components/index.js.map +1 -1
- package/build/components/index.native.js.map +1 -1
- package/build/components/inserter-sidebar/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +78 -0
- package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -0
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +49 -0
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -0
- package/build/components/keyboard-shortcut-help-modal/index.js +126 -0
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -0
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +55 -0
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -0
- package/build/components/list-view-sidebar/index.js.map +1 -1
- package/build/components/list-view-sidebar/list-view-outline.js.map +1 -1
- package/build/components/local-autosave-monitor/index.js.map +1 -1
- package/build/components/media-categories/index.js.map +1 -1
- package/build/components/mode-switcher/index.js.map +1 -1
- package/build/components/offline-status/index.native.js.map +1 -1
- package/build/components/page-attributes/check.js.map +1 -1
- package/build/components/page-attributes/order.js.map +1 -1
- package/build/components/page-attributes/panel.js.map +1 -1
- package/build/components/page-attributes/parent.js.map +1 -1
- package/build/components/pattern-overrides-panel/index.js.map +1 -1
- package/build/components/plugin-document-setting-panel/index.js.map +1 -1
- package/build/components/plugin-more-menu-item/index.js +78 -0
- package/build/components/plugin-more-menu-item/index.js.map +1 -0
- package/build/components/plugin-post-publish-panel/index.js.map +1 -1
- package/build/components/plugin-post-status-info/index.js +73 -0
- package/build/components/plugin-post-status-info/index.js.map +1 -0
- package/build/components/plugin-pre-publish-panel/index.js.map +1 -1
- package/build/components/plugin-sidebar/index.js +108 -0
- package/build/components/plugin-sidebar/index.js.map +1 -0
- package/build/components/plugin-sidebar-more-menu-item/index.js +71 -0
- package/build/components/plugin-sidebar-more-menu-item/index.js.map +1 -0
- package/build/components/post-actions/actions.js +218 -17
- package/build/components/post-actions/actions.js.map +1 -1
- package/build/components/post-actions/index.js +137 -0
- package/build/components/post-actions/index.js.map +1 -0
- package/build/components/post-author/check.js.map +1 -1
- package/build/components/post-author/combobox.js.map +1 -1
- package/build/components/post-author/constants.js.map +1 -1
- package/build/components/post-author/hook.js.map +1 -1
- package/build/components/post-author/index.js.map +1 -1
- package/build/components/post-author/panel.js.map +1 -1
- package/build/components/post-author/select.js.map +1 -1
- package/build/components/post-card-panel/index.js +40 -6
- package/build/components/post-card-panel/index.js.map +1 -1
- package/build/components/post-comments/index.js.map +1 -1
- package/build/components/post-discussion/panel.js.map +1 -1
- package/build/components/post-excerpt/check.js +8 -0
- package/build/components/post-excerpt/check.js.map +1 -1
- package/build/components/post-excerpt/index.js.map +1 -1
- package/build/components/post-excerpt/panel.js.map +1 -1
- package/build/components/post-excerpt/plugin.js.map +1 -1
- package/build/components/post-featured-image/check.js.map +1 -1
- package/build/components/post-featured-image/index.js.map +1 -1
- package/build/components/post-featured-image/panel.js.map +1 -1
- package/build/components/post-format/check.js.map +1 -1
- package/build/components/post-format/index.js.map +1 -1
- package/build/components/post-last-revision/check.js.map +1 -1
- package/build/components/post-last-revision/index.js.map +1 -1
- package/build/components/post-last-revision/panel.js.map +1 -1
- package/build/components/post-locked-modal/index.js.map +1 -1
- package/build/components/post-panel-row/index.js.map +1 -1
- package/build/components/post-pending-status/check.js.map +1 -1
- package/build/components/post-pending-status/index.js.map +1 -1
- package/build/components/post-pingbacks/index.js.map +1 -1
- package/build/components/post-preview-button/index.js.map +1 -1
- package/build/components/post-publish-button/index.js +31 -31
- package/build/components/post-publish-button/index.js.map +1 -1
- package/build/components/post-publish-button/label.js +51 -43
- package/build/components/post-publish-button/label.js.map +1 -1
- package/build/components/post-publish-panel/index.js.map +1 -1
- package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
- package/build/components/post-publish-panel/postpublish.js.map +1 -1
- package/build/components/post-publish-panel/prepublish.js.map +1 -1
- package/build/components/post-saved-state/index.js +10 -6
- package/build/components/post-saved-state/index.js.map +1 -1
- package/build/components/post-schedule/check.js.map +1 -1
- package/build/components/post-schedule/index.js.map +1 -1
- package/build/components/post-schedule/label.js.map +1 -1
- package/build/components/post-schedule/panel.js +8 -0
- package/build/components/post-schedule/panel.js.map +1 -1
- package/build/components/post-slug/check.js.map +1 -1
- package/build/components/post-slug/index.js +43 -68
- package/build/components/post-slug/index.js.map +1 -1
- package/build/components/post-status/index.js +239 -0
- package/build/components/post-status/index.js.map +1 -0
- package/build/components/post-sticky/check.js.map +1 -1
- package/build/components/post-sticky/index.js.map +1 -1
- package/build/components/post-switch-to-draft-button/index.js +6 -1
- package/build/components/post-switch-to-draft-button/index.js.map +1 -1
- package/build/components/post-sync-status/index.js.map +1 -1
- package/build/components/post-taxonomies/check.js.map +1 -1
- package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/index.js.map +1 -1
- package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build/components/post-taxonomies/panel.js.map +1 -1
- package/build/components/post-template/block-theme.js +6 -2
- package/build/components/post-template/block-theme.js.map +1 -1
- package/build/components/post-template/classic-theme.js.map +1 -1
- package/build/components/post-template/create-new-template-modal.js.map +1 -1
- package/build/components/post-template/create-new-template.js.map +1 -1
- package/build/components/post-template/hooks.js.map +1 -1
- package/build/components/post-template/panel.js.map +1 -1
- package/build/components/post-template/reset-default-template.js.map +1 -1
- package/build/components/post-template/swap-template-button.js.map +1 -1
- package/build/components/post-text-editor/index.js.map +1 -1
- package/build/components/post-title/constants.js.map +1 -1
- package/build/components/post-title/index.js.map +1 -1
- package/build/components/post-title/index.native.js.map +1 -1
- package/build/components/post-title/post-title-raw.js.map +1 -1
- package/build/components/post-title/use-post-title-focus.js.map +1 -1
- package/build/components/post-title/use-post-title.js.map +1 -1
- package/build/components/post-trash/check.js +23 -25
- package/build/components/post-trash/check.js.map +1 -1
- package/build/components/post-trash/index.js +2 -1
- package/build/components/post-trash/index.js.map +1 -1
- package/build/components/post-type-support-check/index.js.map +1 -1
- package/build/components/post-url/check.js.map +1 -1
- package/build/components/post-url/index.js +44 -19
- package/build/components/post-url/index.js.map +1 -1
- package/build/components/post-url/label.js.map +1 -1
- package/build/components/post-url/panel.js +14 -7
- package/build/components/post-url/panel.js.map +1 -1
- package/build/components/post-view-link/index.js.map +1 -1
- package/build/components/post-visibility/check.js.map +1 -1
- package/build/components/post-visibility/index.js +2 -1
- package/build/components/post-visibility/index.js.map +1 -1
- package/build/components/post-visibility/label.js.map +1 -1
- package/build/components/post-visibility/utils.js.map +1 -1
- package/build/components/preferences-modal/enable-panel.js.map +1 -1
- package/build/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -1
- package/build/components/preferences-modal/index.js +19 -17
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/preview-dropdown/index.js.map +1 -1
- package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
- package/build/components/provider/index.js +4 -2
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/index.native.js +6 -1
- package/build/components/provider/index.native.js.map +1 -1
- package/build/components/provider/navigation-block-editing-mode.js.map +1 -1
- package/build/components/provider/use-auto-switch-editor-sidebars.js +52 -0
- package/build/components/provider/use-auto-switch-editor-sidebars.js.map +1 -0
- package/build/components/provider/use-block-editor-settings.js +64 -43
- package/build/components/provider/use-block-editor-settings.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.native.js.map +1 -1
- package/build/components/provider/use-hide-blocks-from-inserter.js.map +1 -1
- package/build/components/provider/with-registry-provider.js +1 -0
- package/build/components/provider/with-registry-provider.js.map +1 -1
- package/build/components/start-page-options/index.js +139 -0
- package/build/components/start-page-options/index.js.map +1 -0
- package/build/components/table-of-contents/index.js.map +1 -1
- package/build/components/table-of-contents/panel.js.map +1 -1
- package/build/components/template-areas/index.js.map +1 -1
- package/build/components/template-validation-notice/index.js +23 -29
- package/build/components/template-validation-notice/index.js.map +1 -1
- package/build/components/theme-support-check/index.js +10 -16
- package/build/components/theme-support-check/index.js.map +1 -1
- package/build/components/time-to-read/index.js.map +1 -1
- package/build/components/unsaved-changes-warning/index.js.map +1 -1
- package/build/components/word-count/index.js.map +1 -1
- package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
- package/build/hooks/default-autocompleters.js.map +1 -1
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/index.native.js.map +1 -1
- package/build/hooks/pattern-overrides.js +22 -10
- package/build/hooks/pattern-overrides.js.map +1 -1
- package/build/hooks/use-select-nearest-editable-block.js.map +1 -1
- package/build/index.js.map +1 -1
- package/build/index.native.js.map +1 -1
- package/build/lock-unlock.js.map +1 -1
- package/build/private-apis.js +20 -1
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js.map +1 -1
- package/build/store/actions.native.js.map +1 -1
- package/build/store/constants.js +8 -1
- package/build/store/constants.js.map +1 -1
- package/build/store/defaults.js.map +1 -1
- package/build/store/index.js +1 -1
- package/build/store/index.js.map +1 -1
- package/build/store/local-autosave.js.map +1 -1
- package/build/store/private-actions.js +177 -4
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +1 -7
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js.map +1 -1
- package/build/store/reducer.native.js.map +1 -1
- package/build/store/selectors.js +5 -10
- package/build/store/selectors.js.map +1 -1
- package/build/store/selectors.native.js.map +1 -1
- package/build/store/utils/get-filtered-template-parts.js.map +1 -1
- package/build/store/utils/is-template-revertable.js +28 -0
- package/build/store/utils/is-template-revertable.js.map +1 -0
- package/build/store/utils/notice-builder.js.map +1 -1
- package/build/utils/get-template-part-icon.js.map +1 -1
- package/build/utils/index.js.map +1 -1
- package/build/utils/index.native.js.map +1 -1
- package/build/utils/media-upload/index.js.map +1 -1
- package/build/utils/media-upload/index.native.js.map +1 -1
- package/build/utils/terms.js.map +1 -1
- package/build/utils/url.js.map +1 -1
- package/build-module/bindings/index.js.map +1 -1
- package/build-module/bindings/pattern-overrides.js.map +1 -1
- package/build-module/bindings/post-meta.js +14 -31
- package/build-module/bindings/post-meta.js.map +1 -1
- package/build-module/components/autocompleters/index.js.map +1 -1
- package/build-module/components/autocompleters/user.js.map +1 -1
- package/build-module/components/autosave-monitor/index.js +10 -0
- package/build-module/components/autosave-monitor/index.js.map +1 -1
- package/build-module/components/block-manager/category.js.map +1 -1
- package/build-module/components/block-manager/checklist.js.map +1 -1
- package/build-module/components/block-manager/index.js.map +1 -1
- package/build-module/components/block-removal-warnings/index.js.map +1 -1
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
- package/build-module/components/character-count/index.js.map +1 -1
- package/build-module/components/commands/index.js +20 -1
- package/build-module/components/commands/index.js.map +1 -1
- package/build-module/components/commands/index.native.js.map +1 -1
- package/build-module/components/deprecated.js.map +1 -1
- package/build-module/components/deprecated.native.js.map +1 -1
- package/build-module/components/document-bar/index.js.map +1 -1
- package/build-module/components/document-outline/check.js.map +1 -1
- package/build-module/components/document-outline/index.js.map +1 -1
- package/build-module/components/document-outline/item.js.map +1 -1
- package/build-module/components/document-tools/index.js +1 -1
- package/build-module/components/document-tools/index.js.map +1 -1
- package/build-module/components/editor-canvas/edit-template-blocks-notification.js +13 -2
- package/build-module/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
- package/build-module/components/editor-canvas/index.js +2 -2
- package/build-module/components/editor-canvas/index.js.map +1 -1
- package/build-module/components/editor-help/add-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/customize-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
- package/build-module/components/editor-help/help-get-support-button.native.js.map +1 -1
- package/build-module/components/editor-help/help-section-title.native.js.map +1 -1
- package/build-module/components/editor-help/help-topic-row.native.js.map +1 -1
- package/build-module/components/editor-help/icon-move-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/index.native.js.map +1 -1
- package/build-module/components/editor-help/intro-to-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/move-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/remove-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/view-sections.native.js.map +1 -1
- package/build-module/components/editor-history/redo.js.map +1 -1
- package/build-module/components/editor-history/undo.js.map +1 -1
- package/build-module/components/editor-notices/index.js.map +1 -1
- package/build-module/components/editor-snackbars/index.js.map +1 -1
- package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
- package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build-module/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
- package/build-module/components/entities-saved-states/index.js.map +1 -1
- package/build-module/components/error-boundary/index.js.map +1 -1
- package/build-module/components/error-boundary/index.native.js.map +1 -1
- package/build-module/components/global-keyboard-shortcuts/index.js +24 -0
- package/build-module/components/global-keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +18 -0
- package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
- package/build-module/components/index.js +4 -0
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/index.native.js.map +1 -1
- package/build-module/components/inserter-sidebar/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js +71 -0
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -0
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +41 -0
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -0
- package/build-module/components/keyboard-shortcut-help-modal/index.js +118 -0
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -0
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +48 -0
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -0
- package/build-module/components/list-view-sidebar/index.js.map +1 -1
- package/build-module/components/list-view-sidebar/list-view-outline.js.map +1 -1
- package/build-module/components/local-autosave-monitor/index.js.map +1 -1
- package/build-module/components/media-categories/index.js.map +1 -1
- package/build-module/components/mode-switcher/index.js.map +1 -1
- package/build-module/components/offline-status/index.native.js.map +1 -1
- package/build-module/components/page-attributes/check.js.map +1 -1
- package/build-module/components/page-attributes/order.js.map +1 -1
- package/build-module/components/page-attributes/panel.js.map +1 -1
- package/build-module/components/page-attributes/parent.js.map +1 -1
- package/build-module/components/pattern-overrides-panel/index.js.map +1 -1
- package/build-module/components/plugin-document-setting-panel/index.js.map +1 -1
- package/build-module/components/plugin-more-menu-item/index.js +73 -0
- package/build-module/components/plugin-more-menu-item/index.js.map +1 -0
- package/build-module/components/plugin-post-publish-panel/index.js.map +1 -1
- package/build-module/components/plugin-post-status-info/index.js +66 -0
- package/build-module/components/plugin-post-status-info/index.js.map +1 -0
- package/build-module/components/plugin-pre-publish-panel/index.js.map +1 -1
- package/build-module/components/plugin-sidebar/index.js +102 -0
- package/build-module/components/plugin-sidebar/index.js.map +1 -0
- package/build-module/components/plugin-sidebar-more-menu-item/index.js +65 -0
- package/build-module/components/plugin-sidebar-more-menu-item/index.js.map +1 -0
- package/build-module/components/post-actions/actions.js +219 -15
- package/build-module/components/post-actions/actions.js.map +1 -1
- package/build-module/components/post-actions/index.js +130 -0
- package/build-module/components/post-actions/index.js.map +1 -0
- package/build-module/components/post-author/check.js.map +1 -1
- package/build-module/components/post-author/combobox.js.map +1 -1
- package/build-module/components/post-author/constants.js.map +1 -1
- package/build-module/components/post-author/hook.js.map +1 -1
- package/build-module/components/post-author/index.js.map +1 -1
- package/build-module/components/post-author/panel.js.map +1 -1
- package/build-module/components/post-author/select.js.map +1 -1
- package/build-module/components/post-card-panel/index.js +42 -8
- package/build-module/components/post-card-panel/index.js.map +1 -1
- package/build-module/components/post-comments/index.js.map +1 -1
- package/build-module/components/post-discussion/panel.js.map +1 -1
- package/build-module/components/post-excerpt/check.js +9 -0
- package/build-module/components/post-excerpt/check.js.map +1 -1
- package/build-module/components/post-excerpt/index.js.map +1 -1
- package/build-module/components/post-excerpt/panel.js.map +1 -1
- package/build-module/components/post-excerpt/plugin.js.map +1 -1
- package/build-module/components/post-featured-image/check.js.map +1 -1
- package/build-module/components/post-featured-image/index.js.map +1 -1
- package/build-module/components/post-featured-image/panel.js.map +1 -1
- package/build-module/components/post-format/check.js.map +1 -1
- package/build-module/components/post-format/index.js.map +1 -1
- package/build-module/components/post-last-revision/check.js.map +1 -1
- package/build-module/components/post-last-revision/index.js.map +1 -1
- package/build-module/components/post-last-revision/panel.js.map +1 -1
- package/build-module/components/post-locked-modal/index.js.map +1 -1
- package/build-module/components/post-panel-row/index.js.map +1 -1
- package/build-module/components/post-pending-status/check.js.map +1 -1
- package/build-module/components/post-pending-status/index.js.map +1 -1
- package/build-module/components/post-pingbacks/index.js.map +1 -1
- package/build-module/components/post-preview-button/index.js.map +1 -1
- package/build-module/components/post-publish-button/index.js +31 -31
- package/build-module/components/post-publish-button/index.js.map +1 -1
- package/build-module/components/post-publish-button/label.js +51 -42
- package/build-module/components/post-publish-button/label.js.map +1 -1
- package/build-module/components/post-publish-panel/index.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
- package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
- package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
- package/build-module/components/post-saved-state/index.js +10 -6
- package/build-module/components/post-saved-state/index.js.map +1 -1
- package/build-module/components/post-schedule/check.js.map +1 -1
- package/build-module/components/post-schedule/index.js.map +1 -1
- package/build-module/components/post-schedule/label.js.map +1 -1
- package/build-module/components/post-schedule/panel.js +8 -0
- package/build-module/components/post-schedule/panel.js.map +1 -1
- package/build-module/components/post-slug/check.js.map +1 -1
- package/build-module/components/post-slug/index.js +44 -68
- package/build-module/components/post-slug/index.js.map +1 -1
- package/build-module/components/post-status/index.js +231 -0
- package/build-module/components/post-status/index.js.map +1 -0
- package/build-module/components/post-sticky/check.js.map +1 -1
- package/build-module/components/post-sticky/index.js.map +1 -1
- package/build-module/components/post-switch-to-draft-button/index.js +7 -1
- package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
- package/build-module/components/post-sync-status/index.js.map +1 -1
- package/build-module/components/post-taxonomies/check.js.map +1 -1
- package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/index.js.map +1 -1
- package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build-module/components/post-taxonomies/panel.js.map +1 -1
- package/build-module/components/post-template/block-theme.js +7 -3
- package/build-module/components/post-template/block-theme.js.map +1 -1
- package/build-module/components/post-template/classic-theme.js.map +1 -1
- package/build-module/components/post-template/create-new-template-modal.js.map +1 -1
- package/build-module/components/post-template/create-new-template.js.map +1 -1
- package/build-module/components/post-template/hooks.js.map +1 -1
- package/build-module/components/post-template/panel.js.map +1 -1
- package/build-module/components/post-template/reset-default-template.js.map +1 -1
- package/build-module/components/post-template/swap-template-button.js.map +1 -1
- package/build-module/components/post-text-editor/index.js.map +1 -1
- package/build-module/components/post-title/constants.js.map +1 -1
- package/build-module/components/post-title/index.js.map +1 -1
- package/build-module/components/post-title/index.native.js.map +1 -1
- package/build-module/components/post-title/post-title-raw.js.map +1 -1
- package/build-module/components/post-title/use-post-title-focus.js.map +1 -1
- package/build-module/components/post-title/use-post-title.js.map +1 -1
- package/build-module/components/post-trash/check.js +24 -26
- package/build-module/components/post-trash/check.js.map +1 -1
- package/build-module/components/post-trash/index.js +2 -1
- package/build-module/components/post-trash/index.js.map +1 -1
- package/build-module/components/post-type-support-check/index.js.map +1 -1
- package/build-module/components/post-url/check.js.map +1 -1
- package/build-module/components/post-url/index.js +46 -21
- package/build-module/components/post-url/index.js.map +1 -1
- package/build-module/components/post-url/label.js.map +1 -1
- package/build-module/components/post-url/panel.js +14 -7
- package/build-module/components/post-url/panel.js.map +1 -1
- package/build-module/components/post-view-link/index.js.map +1 -1
- package/build-module/components/post-visibility/check.js.map +1 -1
- package/build-module/components/post-visibility/index.js +2 -1
- package/build-module/components/post-visibility/index.js.map +1 -1
- package/build-module/components/post-visibility/label.js.map +1 -1
- package/build-module/components/post-visibility/utils.js.map +1 -1
- package/build-module/components/preferences-modal/enable-panel.js.map +1 -1
- package/build-module/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +19 -17
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/preview-dropdown/index.js.map +1 -1
- package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
- package/build-module/components/provider/index.js +5 -3
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/index.native.js.map +1 -1
- package/build-module/components/provider/navigation-block-editing-mode.js.map +1 -1
- package/build-module/components/provider/use-auto-switch-editor-sidebars.js +46 -0
- package/build-module/components/provider/use-auto-switch-editor-sidebars.js.map +1 -0
- package/build-module/components/provider/use-block-editor-settings.js +66 -45
- package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.native.js.map +1 -1
- package/build-module/components/provider/use-hide-blocks-from-inserter.js.map +1 -1
- package/build-module/components/provider/with-registry-provider.js +1 -0
- package/build-module/components/provider/with-registry-provider.js.map +1 -1
- package/build-module/components/start-page-options/index.js +132 -0
- package/build-module/components/start-page-options/index.js.map +1 -0
- package/build-module/components/table-of-contents/index.js.map +1 -1
- package/build-module/components/table-of-contents/panel.js.map +1 -1
- package/build-module/components/template-areas/index.js.map +1 -1
- package/build-module/components/template-validation-notice/index.js +25 -31
- package/build-module/components/template-validation-notice/index.js.map +1 -1
- package/build-module/components/theme-support-check/index.js +11 -16
- package/build-module/components/theme-support-check/index.js.map +1 -1
- package/build-module/components/time-to-read/index.js.map +1 -1
- package/build-module/components/unsaved-changes-warning/index.js.map +1 -1
- package/build-module/components/word-count/index.js.map +1 -1
- package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
- package/build-module/hooks/default-autocompleters.js.map +1 -1
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/index.native.js.map +1 -1
- package/build-module/hooks/pattern-overrides.js +22 -10
- package/build-module/hooks/pattern-overrides.js.map +1 -1
- package/build-module/hooks/use-select-nearest-editable-block.js.map +1 -1
- package/build-module/index.js.map +1 -1
- package/build-module/index.native.js.map +1 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-module/private-apis.js +18 -1
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/actions.native.js.map +1 -1
- package/build-module/store/constants.js +7 -0
- package/build-module/store/constants.js.map +1 -1
- package/build-module/store/defaults.js.map +1 -1
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/local-autosave.js.map +1 -1
- package/build-module/store/private-actions.js +174 -4
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +1 -6
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/reducer.native.js.map +1 -1
- package/build-module/store/selectors.js +1 -6
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/selectors.native.js.map +1 -1
- package/build-module/store/utils/get-filtered-template-parts.js.map +1 -1
- package/build-module/store/utils/is-template-revertable.js +22 -0
- package/build-module/store/utils/is-template-revertable.js.map +1 -0
- package/build-module/store/utils/notice-builder.js.map +1 -1
- package/build-module/utils/get-template-part-icon.js.map +1 -1
- package/build-module/utils/index.js.map +1 -1
- package/build-module/utils/index.native.js.map +1 -1
- package/build-module/utils/media-upload/index.js.map +1 -1
- package/build-module/utils/media-upload/index.native.js.map +1 -1
- package/build-module/utils/terms.js.map +1 -1
- package/build-module/utils/url.js.map +1 -1
- package/build-style/style-rtl.css +498 -25
- package/build-style/style.css +498 -25
- package/package.json +35 -35
- package/src/bindings/post-meta.js +11 -27
- package/src/components/autosave-monitor/index.js +9 -0
- package/src/components/commands/index.js +20 -1
- package/src/components/document-tools/index.js +16 -14
- package/src/components/editor-canvas/edit-template-blocks-notification.js +16 -2
- package/src/components/editor-canvas/index.js +4 -4
- package/src/components/error-boundary/style.native.scss +1 -1
- package/src/components/global-keyboard-shortcuts/index.js +25 -0
- package/src/components/global-keyboard-shortcuts/register-shortcuts.js +20 -0
- package/src/components/index.js +4 -0
- package/src/components/keyboard-shortcut-help-modal/config.js +53 -0
- package/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +43 -0
- package/src/components/keyboard-shortcut-help-modal/index.js +160 -0
- package/src/components/keyboard-shortcut-help-modal/shortcut.js +67 -0
- package/src/components/keyboard-shortcut-help-modal/style.scss +61 -0
- package/src/components/plugin-more-menu-item/index.js +73 -0
- package/src/components/plugin-post-status-info/index.js +63 -0
- package/src/components/plugin-sidebar/index.js +98 -0
- package/src/components/plugin-sidebar-more-menu-item/index.js +64 -0
- package/src/components/post-actions/actions.js +294 -14
- package/src/components/post-actions/index.js +156 -0
- package/src/components/post-actions/style.scss +3 -0
- package/src/components/post-card-panel/index.js +69 -9
- package/src/components/post-excerpt/check.js +8 -0
- package/src/components/post-publish-button/index.js +23 -36
- package/src/components/post-publish-button/label.js +54 -39
- package/src/components/post-publish-button/test/index.js +15 -26
- package/src/components/post-publish-button/test/label.js +44 -21
- package/src/components/post-saved-state/index.js +13 -6
- package/src/components/post-saved-state/test/index.js +4 -0
- package/src/components/post-schedule/panel.js +22 -0
- package/src/components/post-slug/index.js +50 -68
- package/src/components/post-slug/test/index.js +29 -6
- package/src/components/post-status/index.js +310 -0
- package/src/components/post-status/style.scss +75 -0
- package/src/components/post-switch-to-draft-button/index.js +5 -0
- package/src/components/post-template/block-theme.js +31 -22
- package/src/components/post-trash/check.js +19 -19
- package/src/components/post-trash/index.js +1 -0
- package/src/components/post-url/index.js +131 -101
- package/src/components/post-url/panel.js +20 -7
- package/src/components/post-url/style.scss +8 -6
- package/src/components/post-visibility/index.js +1 -0
- package/src/components/preferences-modal/index.js +26 -22
- package/src/components/provider/index.js +17 -8
- package/src/components/provider/use-auto-switch-editor-sidebars.js +49 -0
- package/src/components/provider/use-block-editor-settings.js +59 -33
- package/src/components/provider/with-registry-provider.js +1 -0
- package/src/components/start-page-options/index.js +135 -0
- package/src/components/start-page-options/style.scss +26 -0
- package/src/components/template-validation-notice/index.js +48 -50
- package/src/components/theme-support-check/index.js +9 -16
- package/src/components/theme-support-check/test/index.js +44 -43
- package/src/hooks/pattern-overrides.js +25 -14
- package/src/private-apis.js +15 -0
- package/src/store/constants.js +7 -0
- package/src/store/private-actions.js +269 -4
- package/src/store/private-selectors.js +1 -6
- package/src/store/selectors.js +1 -6
- package/src/store/utils/is-template-revertable.js +23 -0
- package/src/style.scss +6 -2
- package/src/components/post-publish-button/style.scss +0 -8
- package/src/components/provider/test/disable-non-page-content-blocks.js +0 -111
- package/src/components/template-validation-notice/style.scss +0 -9
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -128,7 +128,13 @@ Example:
|
|
|
128
128
|
|
|
129
129
|
### AutosaveMonitor
|
|
130
130
|
|
|
131
|
-
|
|
131
|
+
AutosaveMonitor component. Monitors the changes made to the edited post and triggers autosave if necessary.
|
|
132
|
+
|
|
133
|
+
_Usage_
|
|
134
|
+
|
|
135
|
+
```jsx
|
|
136
|
+
<AutosaveMonitor interval={ 30000 } />
|
|
137
|
+
```
|
|
132
138
|
|
|
133
139
|
### BlockAlignmentToolbar
|
|
134
140
|
|
|
@@ -515,6 +521,63 @@ _Returns_
|
|
|
515
521
|
|
|
516
522
|
- `Component`: The component to be rendered.
|
|
517
523
|
|
|
524
|
+
### PluginMoreMenuItem
|
|
525
|
+
|
|
526
|
+
Renders a menu item in `Plugins` group in `More Menu` drop down, and can be used to as a button or link depending on the props provided. The text within the component appears as the menu item label.
|
|
527
|
+
|
|
528
|
+
_Usage_
|
|
529
|
+
|
|
530
|
+
```js
|
|
531
|
+
// Using ES5 syntax
|
|
532
|
+
var __ = wp.i18n.__;
|
|
533
|
+
var PluginMoreMenuItem = wp.editor.PluginMoreMenuItem;
|
|
534
|
+
var moreIcon = wp.element.createElement( 'svg' ); //... svg element.
|
|
535
|
+
|
|
536
|
+
function onButtonClick() {
|
|
537
|
+
alert( 'Button clicked.' );
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
function MyButtonMoreMenuItem() {
|
|
541
|
+
return wp.element.createElement(
|
|
542
|
+
PluginMoreMenuItem,
|
|
543
|
+
{
|
|
544
|
+
icon: moreIcon,
|
|
545
|
+
onClick: onButtonClick,
|
|
546
|
+
},
|
|
547
|
+
__( 'My button title' )
|
|
548
|
+
);
|
|
549
|
+
}
|
|
550
|
+
```
|
|
551
|
+
|
|
552
|
+
```jsx
|
|
553
|
+
// Using ESNext syntax
|
|
554
|
+
import { __ } from '@wordpress/i18n';
|
|
555
|
+
import { PluginMoreMenuItem } from '@wordpress/editor';
|
|
556
|
+
import { more } from '@wordpress/icons';
|
|
557
|
+
|
|
558
|
+
function onButtonClick() {
|
|
559
|
+
alert( 'Button clicked.' );
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
const MyButtonMoreMenuItem = () => (
|
|
563
|
+
<PluginMoreMenuItem icon={ more } onClick={ onButtonClick }>
|
|
564
|
+
{ __( 'My button title' ) }
|
|
565
|
+
</PluginMoreMenuItem>
|
|
566
|
+
);
|
|
567
|
+
```
|
|
568
|
+
|
|
569
|
+
_Parameters_
|
|
570
|
+
|
|
571
|
+
- _props_ `Object`: Component properties.
|
|
572
|
+
- _props.href_ `[string]`: When `href` is provided then the menu item is represented as an anchor rather than button. It corresponds to the `href` attribute of the anchor.
|
|
573
|
+
- _props.icon_ `[WPBlockTypeIconRender]`: The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered to the left of the menu item label.
|
|
574
|
+
- _props.onClick_ `[Function]`: The callback function to be executed when the user clicks the menu item.
|
|
575
|
+
- _props.other_ `[...*]`: Any additional props are passed through to the underlying [Button](/packages/components/src/button/README.md) component.
|
|
576
|
+
|
|
577
|
+
_Returns_
|
|
578
|
+
|
|
579
|
+
- `Component`: The component to be rendered.
|
|
580
|
+
|
|
518
581
|
### PluginPostPublishPanel
|
|
519
582
|
|
|
520
583
|
Renders provided content to the post-publish panel in the publish flow (side panel that opens after a user publishes the post).
|
|
@@ -550,6 +613,50 @@ _Returns_
|
|
|
550
613
|
|
|
551
614
|
- `Component`: The component to be rendered.
|
|
552
615
|
|
|
616
|
+
### PluginPostStatusInfo
|
|
617
|
+
|
|
618
|
+
Renders a row in the Summary panel of the Document sidebar. It should be noted that this is named and implemented around the function it serves and not its location, which may change in future iterations.
|
|
619
|
+
|
|
620
|
+
_Usage_
|
|
621
|
+
|
|
622
|
+
```js
|
|
623
|
+
// Using ES5 syntax
|
|
624
|
+
var __ = wp.i18n.__;
|
|
625
|
+
var PluginPostStatusInfo = wp.editor.PluginPostStatusInfo;
|
|
626
|
+
|
|
627
|
+
function MyPluginPostStatusInfo() {
|
|
628
|
+
return React.createElement(
|
|
629
|
+
PluginPostStatusInfo,
|
|
630
|
+
{
|
|
631
|
+
className: 'my-plugin-post-status-info',
|
|
632
|
+
},
|
|
633
|
+
__( 'My post status info' )
|
|
634
|
+
);
|
|
635
|
+
}
|
|
636
|
+
```
|
|
637
|
+
|
|
638
|
+
```jsx
|
|
639
|
+
// Using ESNext syntax
|
|
640
|
+
import { __ } from '@wordpress/i18n';
|
|
641
|
+
import { PluginPostStatusInfo } from '@wordpress/editor';
|
|
642
|
+
|
|
643
|
+
const MyPluginPostStatusInfo = () => (
|
|
644
|
+
<PluginPostStatusInfo className="my-plugin-post-status-info">
|
|
645
|
+
{ __( 'My post status info' ) }
|
|
646
|
+
</PluginPostStatusInfo>
|
|
647
|
+
);
|
|
648
|
+
```
|
|
649
|
+
|
|
650
|
+
_Parameters_
|
|
651
|
+
|
|
652
|
+
- _props_ `Object`: Component properties.
|
|
653
|
+
- _props.className_ `[string]`: An optional class name added to the row.
|
|
654
|
+
- _props.children_ `Element`: Children to be rendered.
|
|
655
|
+
|
|
656
|
+
_Returns_
|
|
657
|
+
|
|
658
|
+
- `Component`: The component to be rendered.
|
|
659
|
+
|
|
553
660
|
### PluginPrePublishPanel
|
|
554
661
|
|
|
555
662
|
Renders provided content to the pre-publish side panel in the publish flow (side panel that opens when a user first pushes "Publish" from the main editor).
|
|
@@ -585,6 +692,113 @@ _Returns_
|
|
|
585
692
|
|
|
586
693
|
- `Component`: The component to be rendered.
|
|
587
694
|
|
|
695
|
+
### PluginSidebar
|
|
696
|
+
|
|
697
|
+
Renders a sidebar when activated. The contents within the `PluginSidebar` will appear as content within the sidebar. It also automatically renders a corresponding `PluginSidebarMenuItem` component when `isPinnable` flag is set to `true`. If you wish to display the sidebar, you can with use the `PluginSidebarMoreMenuItem` component or the `wp.data.dispatch` API:
|
|
698
|
+
|
|
699
|
+
```js
|
|
700
|
+
wp.data
|
|
701
|
+
.dispatch( 'core/edit-post' )
|
|
702
|
+
.openGeneralSidebar( 'plugin-name/sidebar-name' );
|
|
703
|
+
```
|
|
704
|
+
|
|
705
|
+
_Related_
|
|
706
|
+
|
|
707
|
+
- PluginSidebarMoreMenuItem
|
|
708
|
+
|
|
709
|
+
_Usage_
|
|
710
|
+
|
|
711
|
+
```js
|
|
712
|
+
// Using ES5 syntax
|
|
713
|
+
var __ = wp.i18n.__;
|
|
714
|
+
var el = React.createElement;
|
|
715
|
+
var PanelBody = wp.components.PanelBody;
|
|
716
|
+
var PluginSidebar = wp.editor.PluginSidebar;
|
|
717
|
+
var moreIcon = React.createElement( 'svg' ); //... svg element.
|
|
718
|
+
|
|
719
|
+
function MyPluginSidebar() {
|
|
720
|
+
return el(
|
|
721
|
+
PluginSidebar,
|
|
722
|
+
{
|
|
723
|
+
name: 'my-sidebar',
|
|
724
|
+
title: 'My sidebar title',
|
|
725
|
+
icon: moreIcon,
|
|
726
|
+
},
|
|
727
|
+
el( PanelBody, {}, __( 'My sidebar content' ) )
|
|
728
|
+
);
|
|
729
|
+
}
|
|
730
|
+
```
|
|
731
|
+
|
|
732
|
+
```jsx
|
|
733
|
+
// Using ESNext syntax
|
|
734
|
+
import { __ } from '@wordpress/i18n';
|
|
735
|
+
import { PanelBody } from '@wordpress/components';
|
|
736
|
+
import { PluginSidebar } from '@wordpress/edit-post';
|
|
737
|
+
import { more } from '@wordpress/icons';
|
|
738
|
+
|
|
739
|
+
const MyPluginSidebar = () => (
|
|
740
|
+
<PluginSidebar name="my-sidebar" title="My sidebar title" icon={ more }>
|
|
741
|
+
<PanelBody>{ __( 'My sidebar content' ) }</PanelBody>
|
|
742
|
+
</PluginSidebar>
|
|
743
|
+
);
|
|
744
|
+
```
|
|
745
|
+
|
|
746
|
+
_Parameters_
|
|
747
|
+
|
|
748
|
+
- _props_ `Object`: Element props.
|
|
749
|
+
- _props.name_ `string`: A string identifying the sidebar. Must be unique for every sidebar registered within the scope of your plugin.
|
|
750
|
+
- _props.className_ `[string]`: An optional class name added to the sidebar body.
|
|
751
|
+
- _props.title_ `string`: Title displayed at the top of the sidebar.
|
|
752
|
+
- _props.isPinnable_ `[boolean]`: Whether to allow to pin sidebar to the toolbar. When set to `true` it also automatically renders a corresponding menu item.
|
|
753
|
+
- _props.icon_ `[WPBlockTypeIconRender]`: The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.
|
|
754
|
+
|
|
755
|
+
### PluginSidebarMoreMenuItem
|
|
756
|
+
|
|
757
|
+
Renders a menu item in `Plugins` group in `More Menu` drop down, and can be used to activate the corresponding `PluginSidebar` component. The text within the component appears as the menu item label.
|
|
758
|
+
|
|
759
|
+
_Usage_
|
|
760
|
+
|
|
761
|
+
```js
|
|
762
|
+
// Using ES5 syntax
|
|
763
|
+
var __ = wp.i18n.__;
|
|
764
|
+
var PluginSidebarMoreMenuItem = wp.editor.PluginSidebarMoreMenuItem;
|
|
765
|
+
var moreIcon = React.createElement( 'svg' ); //... svg element.
|
|
766
|
+
|
|
767
|
+
function MySidebarMoreMenuItem() {
|
|
768
|
+
return React.createElement(
|
|
769
|
+
PluginSidebarMoreMenuItem,
|
|
770
|
+
{
|
|
771
|
+
target: 'my-sidebar',
|
|
772
|
+
icon: moreIcon,
|
|
773
|
+
},
|
|
774
|
+
__( 'My sidebar title' )
|
|
775
|
+
);
|
|
776
|
+
}
|
|
777
|
+
```
|
|
778
|
+
|
|
779
|
+
```jsx
|
|
780
|
+
// Using ESNext syntax
|
|
781
|
+
import { __ } from '@wordpress/i18n';
|
|
782
|
+
import { PluginSidebarMoreMenuItem } from '@wordpress/editor';
|
|
783
|
+
import { more } from '@wordpress/icons';
|
|
784
|
+
|
|
785
|
+
const MySidebarMoreMenuItem = () => (
|
|
786
|
+
<PluginSidebarMoreMenuItem target="my-sidebar" icon={ more }>
|
|
787
|
+
{ __( 'My sidebar title' ) }
|
|
788
|
+
</PluginSidebarMoreMenuItem>
|
|
789
|
+
);
|
|
790
|
+
```
|
|
791
|
+
|
|
792
|
+
_Parameters_
|
|
793
|
+
|
|
794
|
+
- _props_ `Object`: Component props.
|
|
795
|
+
- _props.target_ `string`: A string identifying the target sidebar you wish to be activated by this menu item. Must be the same as the `name` prop you have given to that sidebar.
|
|
796
|
+
- _props.icon_ `[WPBlockTypeIconRender]`: The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered to the left of the menu item label.
|
|
797
|
+
|
|
798
|
+
_Returns_
|
|
799
|
+
|
|
800
|
+
- `Component`: The component to be rendered.
|
|
801
|
+
|
|
588
802
|
### PostAuthor
|
|
589
803
|
|
|
590
804
|
Undocumented declaration.
|
|
@@ -611,7 +825,16 @@ Undocumented declaration.
|
|
|
611
825
|
|
|
612
826
|
### PostExcerptCheck
|
|
613
827
|
|
|
614
|
-
|
|
828
|
+
Component for checking if the post type supports the excerpt field.
|
|
829
|
+
|
|
830
|
+
_Parameters_
|
|
831
|
+
|
|
832
|
+
- _props_ `Object`: Props.
|
|
833
|
+
- _props.children_ `Element`: Children to be rendered.
|
|
834
|
+
|
|
835
|
+
_Returns_
|
|
836
|
+
|
|
837
|
+
- `Component`: The component to be rendered.
|
|
615
838
|
|
|
616
839
|
### PostExcerptPanel
|
|
617
840
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blocks","require","_data","_lockUnlock","_patternOverrides","_interopRequireDefault","_postMeta","registerBlockBindingsSource","unlock","dispatch","blocksStore","postMeta","process","env","IS_GUTENBERG_PLUGIN","patternOverrides"],"sources":["@wordpress/editor/src/bindings/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { dispatch } from '@wordpress/data';\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\nimport patternOverrides from './pattern-overrides';\nimport postMeta from './post-meta';\n\nconst { registerBlockBindingsSource } = unlock( dispatch( blocksStore ) );\nregisterBlockBindingsSource( postMeta );\n\nif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\tregisterBlockBindingsSource( patternOverrides );\n}\n"],"mappings":";;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAIA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAD,sBAAA,CAAAJ,OAAA;AAVA;AACA;AACA;;AAGA;AACA;AACA;;AAKA,MAAM;EAAEM;AAA4B,CAAC,GAAG,IAAAC,kBAAM,EAAE,IAAAC,cAAQ,EAAEC,aAAY,CAAE,CAAC;AACzEH,2BAA2B,CAAEI,iBAAS,CAAC;AAEvC,IAAKC,OAAO,CAACC,GAAG,CAACC,mBAAmB,EAAG;EACtCP,2BAA2B,CAAEQ,yBAAiB,CAAC;AAChD"}
|
|
1
|
+
{"version":3,"names":["_blocks","require","_data","_lockUnlock","_patternOverrides","_interopRequireDefault","_postMeta","registerBlockBindingsSource","unlock","dispatch","blocksStore","postMeta","process","env","IS_GUTENBERG_PLUGIN","patternOverrides"],"sources":["@wordpress/editor/src/bindings/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { dispatch } from '@wordpress/data';\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\nimport patternOverrides from './pattern-overrides';\nimport postMeta from './post-meta';\n\nconst { registerBlockBindingsSource } = unlock( dispatch( blocksStore ) );\nregisterBlockBindingsSource( postMeta );\n\nif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\tregisterBlockBindingsSource( patternOverrides );\n}\n"],"mappings":";;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAIA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAD,sBAAA,CAAAJ,OAAA;AAVA;AACA;AACA;;AAGA;AACA;AACA;;AAKA,MAAM;EAAEM;AAA4B,CAAC,GAAG,IAAAC,kBAAM,EAAE,IAAAC,cAAQ,EAAEC,aAAY,CAAE,CAAC;AACzEH,2BAA2B,CAAEI,iBAAS,CAAC;AAEvC,IAAKC,OAAO,CAACC,GAAG,CAACC,mBAAmB,EAAG;EACtCP,2BAA2B,CAAEQ,yBAAiB,CAAC;AAChD","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_default","exports","default","name","label","_x","useSource","lockAttributesEditing"],"sources":["@wordpress/editor/src/bindings/pattern-overrides.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { _x } from '@wordpress/i18n';\n\nexport default {\n\tname: 'core/pattern-overrides',\n\tlabel: _x( 'Pattern Overrides', 'block bindings source' ),\n\tuseSource: null,\n\tlockAttributesEditing: false,\n};\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAHA;AACA;AACA;AAFA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAKe;EACdC,IAAI,EAAE,wBAAwB;EAC9BC,KAAK,EAAE,IAAAC,QAAE,EAAE,mBAAmB,EAAE,uBAAwB,CAAC;EACzDC,SAAS,EAAE,IAAI;EACfC,qBAAqB,EAAE;AACxB,CAAC"}
|
|
1
|
+
{"version":3,"names":["_i18n","require","_default","exports","default","name","label","_x","useSource","lockAttributesEditing"],"sources":["@wordpress/editor/src/bindings/pattern-overrides.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { _x } from '@wordpress/i18n';\n\nexport default {\n\tname: 'core/pattern-overrides',\n\tlabel: _x( 'Pattern Overrides', 'block bindings source' ),\n\tuseSource: null,\n\tlockAttributesEditing: false,\n};\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAHA;AACA;AACA;AAFA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAKe;EACdC,IAAI,EAAE,wBAAwB;EAC9BC,KAAK,EAAE,IAAAC,QAAE,EAAE,mBAAmB,EAAE,uBAAwB,CAAC;EACzDC,SAAS,EAAE,IAAI;EACfC,qBAAqB,EAAE;AACxB,CAAC","ignoreList":[]}
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _coreData = require("@wordpress/core-data");
|
|
8
|
-
var _data = require("@wordpress/data");
|
|
9
8
|
var _i18n = require("@wordpress/i18n");
|
|
10
9
|
var _store = require("../store");
|
|
11
10
|
/**
|
|
@@ -17,35 +16,18 @@ var _store = require("../store");
|
|
|
17
16
|
var _default = exports.default = {
|
|
18
17
|
name: 'core/post-meta',
|
|
19
18
|
label: (0, _i18n._x)('Post Meta', 'block bindings source'),
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const postType = context.postType ? context.postType : getCurrentPostType();
|
|
31
|
-
|
|
32
|
-
if (postType === 'wp_template') {
|
|
33
|
-
return {
|
|
34
|
-
placeholder: metaKey
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
const metaValue = meta[metaKey];
|
|
38
|
-
const updateMetaValue = newValue => {
|
|
39
|
-
setMeta({
|
|
40
|
-
...meta,
|
|
41
|
-
[metaKey]: newValue
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
return {
|
|
45
|
-
placeholder: metaKey,
|
|
46
|
-
value: metaValue,
|
|
47
|
-
updateValue: updateMetaValue
|
|
48
|
-
};
|
|
19
|
+
getPlaceholder({
|
|
20
|
+
args
|
|
21
|
+
}) {
|
|
22
|
+
return args.key;
|
|
23
|
+
},
|
|
24
|
+
getValue({
|
|
25
|
+
registry,
|
|
26
|
+
context,
|
|
27
|
+
args
|
|
28
|
+
}) {
|
|
29
|
+
const postType = context.postType ? context.postType : registry.select(_store.store).getCurrentPostType();
|
|
30
|
+
return registry.select(_coreData.store).getEditedEntityRecord('postType', postType, context.postId).meta?.[args.key];
|
|
49
31
|
}
|
|
50
32
|
};
|
|
51
33
|
//# sourceMappingURL=post-meta.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_coreData","require","
|
|
1
|
+
{"version":3,"names":["_coreData","require","_i18n","_store","_default","exports","default","name","label","_x","getPlaceholder","args","key","getValue","registry","context","postType","select","editorStore","getCurrentPostType","coreDataStore","getEditedEntityRecord","postId","meta"],"sources":["@wordpress/editor/src/bindings/post-meta.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { _x } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../store';\n\nexport default {\n\tname: 'core/post-meta',\n\tlabel: _x( 'Post Meta', 'block bindings source' ),\n\tgetPlaceholder( { args } ) {\n\t\treturn args.key;\n\t},\n\tgetValue( { registry, context, args } ) {\n\t\tconst postType = context.postType\n\t\t\t? context.postType\n\t\t\t: registry.select( editorStore ).getCurrentPostType();\n\n\t\treturn registry\n\t\t\t.select( coreDataStore )\n\t\t\t.getEditedEntityRecord( 'postType', postType, context.postId )\n\t\t\t.meta?.[ args.key ];\n\t},\n};\n"],"mappings":";;;;;;AAGA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AATA;AACA;AACA;AAIA;AACA;AACA;AAFA,IAAAG,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAKe;EACdC,IAAI,EAAE,gBAAgB;EACtBC,KAAK,EAAE,IAAAC,QAAE,EAAE,WAAW,EAAE,uBAAwB,CAAC;EACjDC,cAAcA,CAAE;IAAEC;EAAK,CAAC,EAAG;IAC1B,OAAOA,IAAI,CAACC,GAAG;EAChB,CAAC;EACDC,QAAQA,CAAE;IAAEC,QAAQ;IAAEC,OAAO;IAAEJ;EAAK,CAAC,EAAG;IACvC,MAAMK,QAAQ,GAAGD,OAAO,CAACC,QAAQ,GAC9BD,OAAO,CAACC,QAAQ,GAChBF,QAAQ,CAACG,MAAM,CAAEC,YAAY,CAAC,CAACC,kBAAkB,CAAC,CAAC;IAEtD,OAAOL,QAAQ,CACbG,MAAM,CAAEG,eAAc,CAAC,CACvBC,qBAAqB,CAAE,UAAU,EAAEL,QAAQ,EAAED,OAAO,CAACO,MAAO,CAAC,CAC7DC,IAAI,GAAIZ,IAAI,CAACC,GAAG,CAAE;EACrB;AACD,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_user","_interopRequireDefault","require"],"sources":["@wordpress/editor/src/components/autocompleters/index.js"],"sourcesContent":["export { default as userAutocompleter } from './user';\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA"}
|
|
1
|
+
{"version":3,"names":["_user","_interopRequireDefault","require"],"sources":["@wordpress/editor/src/components/autocompleters/index.js"],"sourcesContent":["export { default as userAutocompleter } from './user';\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_data","_coreData","getUserLabel","user","avatar","avatar_urls","_react","createElement","className","alt","src","Fragment","name","slug","_default","exports","default","triggerPrefix","useItems","filterValue","users","useSelect","select","getUsers","coreStore","context","search","encodeURIComponent","options","useMemo","map","key","value","label","getOptionCompletion"],"sources":["@wordpress/editor/src/components/autocompleters/user.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/** @typedef {import('@wordpress/components').WPCompleter} WPCompleter */\n\nexport function getUserLabel( user ) {\n\tconst avatar =\n\t\tuser.avatar_urls && user.avatar_urls[ 24 ] ? (\n\t\t\t<img\n\t\t\t\tclassName=\"editor-autocompleters__user-avatar\"\n\t\t\t\talt=\"\"\n\t\t\t\tsrc={ user.avatar_urls[ 24 ] }\n\t\t\t/>\n\t\t) : (\n\t\t\t<span className=\"editor-autocompleters__no-avatar\"></span>\n\t\t);\n\n\treturn (\n\t\t<>\n\t\t\t{ avatar }\n\t\t\t<span className=\"editor-autocompleters__user-name\">\n\t\t\t\t{ user.name }\n\t\t\t</span>\n\t\t\t<span className=\"editor-autocompleters__user-slug\">\n\t\t\t\t{ user.slug }\n\t\t\t</span>\n\t\t</>\n\t);\n}\n\n/**\n * A user mentions completer.\n *\n * @type {WPCompleter}\n */\nexport default {\n\tname: 'users',\n\tclassName: 'editor-autocompleters__user',\n\ttriggerPrefix: '@',\n\n\tuseItems( filterValue ) {\n\t\tconst users = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst { getUsers } = select( coreStore );\n\t\t\t\treturn getUsers( {\n\t\t\t\t\tcontext: 'view',\n\t\t\t\t\tsearch: encodeURIComponent( filterValue ),\n\t\t\t\t} );\n\t\t\t},\n\t\t\t[ filterValue ]\n\t\t);\n\n\t\tconst options = useMemo(\n\t\t\t() =>\n\t\t\t\tusers\n\t\t\t\t\t? users.map( ( user ) => ( {\n\t\t\t\t\t\t\tkey: `user-${ user.slug }`,\n\t\t\t\t\t\t\tvalue: user,\n\t\t\t\t\t\t\tlabel: getUserLabel( user ),\n\t\t\t\t\t } ) )\n\t\t\t\t\t: [],\n\t\t\t[ users ]\n\t\t);\n\n\t\treturn [ options ];\n\t},\n\n\tgetOptionCompletion( user ) {\n\t\treturn `@${ user.slug }`;\n\t},\n};\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AAG,IAAAC,gBAAO,EACtB,MACCT,KAAK,GACFA,KAAK,CAACU,GAAG,CAAI3B,IAAI,KAAQ;MACzB4B,GAAG,EAAG,QAAQ5B,IAAI,CAACU,IAAM,EAAC;MAC1BmB,KAAK,EAAE7B,IAAI;MACX8B,KAAK,EAAE/B,YAAY,CAAEC,IAAK;IAC1B,CAAC,CAAG,CAAC,GACL,EAAE,EACN,CAAEiB,KAAK,CACR,CAAC;IAED,OAAO,CAAEQ,OAAO,CAAE;EACnB,CAAC;EAEDM,mBAAmBA,CAAE/B,IAAI,EAAG;IAC3B,OAAQ,IAAIA,IAAI,CAACU,IAAM,EAAC;EACzB;AACD,CAAC"}
|
|
1
|
+
{"version":3,"names":["_element","require","_data","_coreData","getUserLabel","user","avatar","avatar_urls","_react","createElement","className","alt","src","Fragment","name","slug","_default","exports","default","triggerPrefix","useItems","filterValue","users","useSelect","select","getUsers","coreStore","context","search","encodeURIComponent","options","useMemo","map","key","value","label","getOptionCompletion"],"sources":["@wordpress/editor/src/components/autocompleters/user.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/** @typedef {import('@wordpress/components').WPCompleter} WPCompleter */\n\nexport function getUserLabel( user ) {\n\tconst avatar =\n\t\tuser.avatar_urls && user.avatar_urls[ 24 ] ? (\n\t\t\t<img\n\t\t\t\tclassName=\"editor-autocompleters__user-avatar\"\n\t\t\t\talt=\"\"\n\t\t\t\tsrc={ user.avatar_urls[ 24 ] }\n\t\t\t/>\n\t\t) : (\n\t\t\t<span className=\"editor-autocompleters__no-avatar\"></span>\n\t\t);\n\n\treturn (\n\t\t<>\n\t\t\t{ avatar }\n\t\t\t<span className=\"editor-autocompleters__user-name\">\n\t\t\t\t{ user.name }\n\t\t\t</span>\n\t\t\t<span className=\"editor-autocompleters__user-slug\">\n\t\t\t\t{ user.slug }\n\t\t\t</span>\n\t\t</>\n\t);\n}\n\n/**\n * A user mentions completer.\n *\n * @type {WPCompleter}\n */\nexport default {\n\tname: 'users',\n\tclassName: 'editor-autocompleters__user',\n\ttriggerPrefix: '@',\n\n\tuseItems( filterValue ) {\n\t\tconst users = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst { getUsers } = select( coreStore );\n\t\t\t\treturn getUsers( {\n\t\t\t\t\tcontext: 'view',\n\t\t\t\t\tsearch: encodeURIComponent( filterValue ),\n\t\t\t\t} );\n\t\t\t},\n\t\t\t[ filterValue ]\n\t\t);\n\n\t\tconst options = useMemo(\n\t\t\t() =>\n\t\t\t\tusers\n\t\t\t\t\t? users.map( ( user ) => ( {\n\t\t\t\t\t\t\tkey: `user-${ user.slug }`,\n\t\t\t\t\t\t\tvalue: user,\n\t\t\t\t\t\t\tlabel: getUserLabel( user ),\n\t\t\t\t\t } ) )\n\t\t\t\t\t: [],\n\t\t\t[ users ]\n\t\t);\n\n\t\treturn [ options ];\n\t},\n\n\tgetOptionCompletion( user ) {\n\t\treturn `@${ user.slug }`;\n\t},\n};\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AALA;AACA;AACA;;AAKA;;AAEO,SAASG,YAAYA,CAAEC,IAAI,EAAG;EACpC,MAAMC,MAAM,GACXD,IAAI,CAACE,WAAW,IAAIF,IAAI,CAACE,WAAW,CAAE,EAAE,CAAE,GACzC,IAAAC,MAAA,CAAAC,aAAA;IACCC,SAAS,EAAC,oCAAoC;IAC9CC,GAAG,EAAC,EAAE;IACNC,GAAG,EAAGP,IAAI,CAACE,WAAW,CAAE,EAAE;EAAI,CAC9B,CAAC,GAEF,IAAAC,MAAA,CAAAC,aAAA;IAAMC,SAAS,EAAC;EAAkC,CAAO,CACzD;EAEF,OACC,IAAAF,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAK,QAAA,QACGP,MAAM,EACR,IAA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Monitor component.
|
|
90
|
+
* Monitors the changes made to the edited post and triggers autosave if necessary.
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* ```jsx
|
|
94
|
+
* <AutosaveMonitor interval={30000} />
|
|
95
|
+
* ```
|
|
96
|
+
*/
|
|
87
97
|
exports.AutosaveMonitor = AutosaveMonitor;
|
|
88
98
|
var _default = exports.default = (0, _compose.compose)([(0, _data.withSelect)((select, ownProps) => {
|
|
89
99
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_compose","_data","_coreData","_store","AutosaveMonitor","Component","constructor","props","needsAutosave","isDirty","isAutosaveable","componentDidMount","disableIntervalChecks","setAutosaveTimer","componentDidUpdate","prevProps","editsReference","autosave","interval","clearTimeout","timerId","isAutosaving","componentWillUnmount","timeout","setTimeout","autosaveTimerHandler","render","exports","_default","default","compose","withSelect","select","ownProps","getReferenceByDistinctEdits","coreStore","isEditedPostDirty","isEditedPostAutosaveable","isAutosavingPost","getEditorSettings","editorStore","autosaveInterval","withDispatch","dispatch"],"sources":["@wordpress/editor/src/components/autosave-monitor/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { compose } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * AutosaveMonitor invokes `props.autosave()` within at most `interval` seconds after an unsaved change is detected.\n *\n * The logic is straightforward: a check is performed every `props.interval` seconds. If any changes are detected, `props.autosave()` is called.\n * The time between the change and the autosave varies but is no larger than `props.interval` seconds. Refer to the code below for more details, such as\n * the specific way of detecting changes.\n *\n * There are two caveats:\n * * If `props.isAutosaveable` happens to be false at a time of checking for changes, the check is retried every second.\n * * The timer may be disabled by setting `props.disableIntervalChecks` to `true`. In that mode, any change will immediately trigger `props.autosave()`.\n */\nexport class AutosaveMonitor extends Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\t\tthis.needsAutosave = !! ( props.isDirty && props.isAutosaveable );\n\t}\n\n\tcomponentDidMount() {\n\t\tif ( ! this.props.disableIntervalChecks ) {\n\t\t\tthis.setAutosaveTimer();\n\t\t}\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( this.props.disableIntervalChecks ) {\n\t\t\tif ( this.props.editsReference !== prevProps.editsReference ) {\n\t\t\t\tthis.props.autosave();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.props.interval !== prevProps.interval ) {\n\t\t\tclearTimeout( this.timerId );\n\t\t\tthis.setAutosaveTimer();\n\t\t}\n\n\t\tif ( ! this.props.isDirty ) {\n\t\t\tthis.needsAutosave = false;\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.props.isAutosaving && ! prevProps.isAutosaving ) {\n\t\t\tthis.needsAutosave = false;\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.props.editsReference !== prevProps.editsReference ) {\n\t\t\tthis.needsAutosave = true;\n\t\t}\n\t}\n\n\tcomponentWillUnmount() {\n\t\tclearTimeout( this.timerId );\n\t}\n\n\tsetAutosaveTimer( timeout = this.props.interval * 1000 ) {\n\t\tthis.timerId = setTimeout( () => {\n\t\t\tthis.autosaveTimerHandler();\n\t\t}, timeout );\n\t}\n\n\tautosaveTimerHandler() {\n\t\tif ( ! this.props.isAutosaveable ) {\n\t\t\tthis.setAutosaveTimer( 1000 );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.needsAutosave ) {\n\t\t\tthis.needsAutosave = false;\n\t\t\tthis.props.autosave();\n\t\t}\n\n\t\tthis.setAutosaveTimer();\n\t}\n\n\trender() {\n\t\treturn null;\n\t}\n}\n\nexport default compose( [\n\twithSelect( ( select, ownProps ) => {\n\t\tconst { getReferenceByDistinctEdits } = select( coreStore );\n\n\t\tconst {\n\t\t\tisEditedPostDirty,\n\t\t\tisEditedPostAutosaveable,\n\t\t\tisAutosavingPost,\n\t\t\tgetEditorSettings,\n\t\t} = select( editorStore );\n\n\t\tconst { interval = getEditorSettings().autosaveInterval } = ownProps;\n\n\t\treturn {\n\t\t\teditsReference: getReferenceByDistinctEdits(),\n\t\t\tisDirty: isEditedPostDirty(),\n\t\t\tisAutosaveable: isEditedPostAutosaveable(),\n\t\t\tisAutosaving: isAutosavingPost(),\n\t\t\tinterval,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch, ownProps ) => ( {\n\t\tautosave() {\n\t\t\tconst { autosave = dispatch( editorStore ).autosave } = ownProps;\n\t\t\tautosave();\n\t\t},\n\t} ) ),\n] )( AutosaveMonitor );\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAJ,OAAA;AAXA;AACA;AACA;;AAMA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMK,eAAe,SAASC,kBAAS,CAAC;EAC9CC,WAAWA,CAAEC,KAAK,EAAG;IACpB,KAAK,CAAEA,KAAM,CAAC;IACd,IAAI,CAACC,aAAa,GAAG,CAAC,EAAID,KAAK,CAACE,OAAO,IAAIF,KAAK,CAACG,cAAc,CAAE;EAClE;EAEAC,iBAAiBA,CAAA,EAAG;IACnB,IAAK,CAAE,IAAI,CAACJ,KAAK,CAACK,qBAAqB,EAAG;MACzC,IAAI,CAACC,gBAAgB,CAAC,CAAC;IACxB;EACD;EAEAC,kBAAkBA,CAAEC,SAAS,EAAG;IAC/B,IAAK,IAAI,CAACR,KAAK,CAACK,qBAAqB,EAAG;MACvC,IAAK,IAAI,CAACL,KAAK,CAACS,cAAc,KAAKD,SAAS,CAACC,cAAc,EAAG;QAC7D,IAAI,CAACT,KAAK,CAACU,QAAQ,CAAC,CAAC;MACtB;MACA;IACD;IAEA,IAAK,I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Component","constructor","props","needsAutosave","isDirty","isAutosaveable","componentDidMount","disableIntervalChecks","setAutosaveTimer","componentDidUpdate","prevProps","editsReference","autosave","interval","clearTimeout","timerId","isAutosaving","componentWillUnmount","timeout","setTimeout","autosaveTimerHandler","render","exports","_default","default","compose","withSelect","select","ownProps","getReferenceByDistinctEdits","coreStore","isEditedPostDirty","isEditedPostAutosaveable","isAutosavingPost","getEditorSettings","editorStore","autosaveInterval","withDispatch","dispatch"],"sources":["@wordpress/editor/src/components/autosave-monitor/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { compose } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * AutosaveMonitor invokes `props.autosave()` within at most `interval` seconds after an unsaved change is detected.\n *\n * The logic is straightforward: a check is performed every `props.interval` seconds. If any changes are detected, `props.autosave()` is called.\n * The time between the change and the autosave varies but is no larger than `props.interval` seconds. Refer to the code below for more details, such as\n * the specific way of detecting changes.\n *\n * There are two caveats:\n * * If `props.isAutosaveable` happens to be false at a time of checking for changes, the check is retried every second.\n * * The timer may be disabled by setting `props.disableIntervalChecks` to `true`. In that mode, any change will immediately trigger `props.autosave()`.\n */\nexport class AutosaveMonitor extends Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\t\tthis.needsAutosave = !! ( props.isDirty && props.isAutosaveable );\n\t}\n\n\tcomponentDidMount() {\n\t\tif ( ! this.props.disableIntervalChecks ) {\n\t\t\tthis.setAutosaveTimer();\n\t\t}\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( this.props.disableIntervalChecks ) {\n\t\t\tif ( this.props.editsReference !== prevProps.editsReference ) {\n\t\t\t\tthis.props.autosave();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.props.interval !== prevProps.interval ) {\n\t\t\tclearTimeout( this.timerId );\n\t\t\tthis.setAutosaveTimer();\n\t\t}\n\n\t\tif ( ! this.props.isDirty ) {\n\t\t\tthis.needsAutosave = false;\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.props.isAutosaving && ! prevProps.isAutosaving ) {\n\t\t\tthis.needsAutosave = false;\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.props.editsReference !== prevProps.editsReference ) {\n\t\t\tthis.needsAutosave = true;\n\t\t}\n\t}\n\n\tcomponentWillUnmount() {\n\t\tclearTimeout( this.timerId );\n\t}\n\n\tsetAutosaveTimer( timeout = this.props.interval * 1000 ) {\n\t\tthis.timerId = setTimeout( () => {\n\t\t\tthis.autosaveTimerHandler();\n\t\t}, timeout );\n\t}\n\n\tautosaveTimerHandler() {\n\t\tif ( ! this.props.isAutosaveable ) {\n\t\t\tthis.setAutosaveTimer( 1000 );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.needsAutosave ) {\n\t\t\tthis.needsAutosave = false;\n\t\t\tthis.props.autosave();\n\t\t}\n\n\t\tthis.setAutosaveTimer();\n\t}\n\n\trender() {\n\t\treturn null;\n\t}\n}\n\n/**\n * AutosaveMonitor component.\n * Monitors the changes made to the edited post and triggers autosave if necessary.\n *\n * @example\n * ```jsx\n * <AutosaveMonitor interval={30000} />\n * ```\n */\nexport default compose( [\n\twithSelect( ( select, ownProps ) => {\n\t\tconst { getReferenceByDistinctEdits } = select( coreStore );\n\n\t\tconst {\n\t\t\tisEditedPostDirty,\n\t\t\tisEditedPostAutosaveable,\n\t\t\tisAutosavingPost,\n\t\t\tgetEditorSettings,\n\t\t} = select( editorStore );\n\n\t\tconst { interval = getEditorSettings().autosaveInterval } = ownProps;\n\n\t\treturn {\n\t\t\teditsReference: getReferenceByDistinctEdits(),\n\t\t\tisDirty: isEditedPostDirty(),\n\t\t\tisAutosaveable: isEditedPostAutosaveable(),\n\t\t\tisAutosaving: isAutosavingPost(),\n\t\t\tinterval,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch, ownProps ) => ( {\n\t\tautosave() {\n\t\t\tconst { autosave = dispatch( editorStore ).autosave } = ownProps;\n\t\t\tautosave();\n\t\t},\n\t} ) ),\n] )( AutosaveMonitor );\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAJ,OAAA;AAXA;AACA;AACA;;AAMA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMK,eAAe,SAASC,kBAAS,CAAC;EAC9CC,WAAWA,CAAEC,KAAK,EAAG;IACpB,KAAK,CAAEA,KAAM,CAAC;IACd,IAAI,CAACC,aAAa,GAAG,CAAC,EAAID,KAAK,CAACE,OAAO,IAAIF,KAAK,CAACG,cAAc,CAAE;EAClE;EAEAC,iBAAiBA,CAAA,EAAG;IACnB,IAAK,CAAE,IAAI,CAACJ,KAAK,CAACK,qBAAqB,EAAG;MACzC,IAAI,CAACC,gBAAgB,CAAC,CAAC;IACxB;EACD;EAEAC,kBAAkBA,CAAEC,SAAS,EAAG;IAC/B,IAAK,IAAI,CAACR,KAAK,CAACK,qBAAqB,EAAG;MACvC,IAAK,IAAI,CAACL,KAAK,CAACS,cAAc,KAAKD,SAAS,CAACC,cAAc,EAAG;QAC7D,IAAI,CAACT,KAAK,CAACU,QAAQ,CAAC,CAAC;MACtB;MACA;IACD;IAEA,IAAK,IAAI,CAACV,KAAK,CAACW,QAAQ,KAAKH,SAAS,CAACG,QAAQ,EAAG;MACjDC,YAAY,CAAE,IAAI,CAACC,OAAQ,CAAC;MAC5B,IAAI,CAACP,gBAAgB,CAAC,CAAC;IACxB;IAEA,IAAK,CAAE,IAAI,CAACN,KAAK,CAACE,OAAO,EAAG;MAC3B,IAAI,CAACD,aAAa,GAAG,KAAK;MAC1B;IACD;IAEA,IA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IACxBC,gBAAgB;IAChBC;EACD,CAAC,GAAGP,MAAM,CAAEQ,YAAY,CAAC;EAEzB,MAAM;IAAEtB,QAAQ,GAAGqB,iBAAiB,CAAC,CAAC,CAACE;EAAiB,CAAC,GAAGR,QAAQ;EAEpE,OAAO;IACNjB,cAAc,EAAEkB,2BAA2B,CAAC,CAAC;IAC7CzB,OAAO,EAAE2B,iBAAiB,CAAC,CAAC;IAC5B1B,cAAc,EAAE2B,wBAAwB,CAAC,CAAC;IAC1ChB,YAAY,EAAEiB,gBAAgB,CAAC,CAAC;IAChCpB;EACD,CAAC;AACF,CAAE,CAAC,EACH,IAAAwB,kBAAY,EAAE,CAAEC,QAAQ,EAAEV,QAAQ,MAAQ;EACzChB,QAAQA,CAAA,EAAG;IACV,MAAM;MAAEA,QAAQ,GAAG0B,QAAQ,CAAEH,YAAY,CAAC,CAACvB;IAAS,CAAC,GAAGgB,QAAQ;IAChEhB,QAAQ,CAAC,CAAC;EACX;AACD,CAAC,CAAG,CAAC,CACJ,CAAC,CAAEb,eAAgB,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_data","_compose","_components","_preferences","_checklist","_interopRequireDefault","_store","_lockUnlock","BlockManagerCategory","title","blockTypes","instanceId","useInstanceId","allowedBlockTypes","hiddenBlockTypes","useSelect","select","getEditorSettings","editorStore","get","preferencesStore","filteredBlockTypes","useMemo","filter","name","includes","showBlockTypes","hideBlockTypes","unlock","useDispatch","toggleVisible","useCallback","blockName","nextIsChecked","toggleAllVisible","blockNames","map","length","checkedBlockNames","type","titleId","isAllChecked","isIndeterminate","_react","createElement","role","className","CheckboxControl","__nextHasNoMarginBottom","checked","onChange","indeterminate","label","id","default","value","onItemChange","_default","exports"],"sources":["@wordpress/editor/src/components/block-manager/category.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo, useCallback } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useInstanceId } from '@wordpress/compose';\nimport { CheckboxControl } from '@wordpress/components';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport BlockTypesChecklist from './checklist';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nfunction BlockManagerCategory( { title, blockTypes } ) {\n\tconst instanceId = useInstanceId( BlockManagerCategory );\n\tconst { allowedBlockTypes, hiddenBlockTypes } = useSelect( ( select ) => {\n\t\tconst { getEditorSettings } = select( editorStore );\n\t\tconst { get } = select( preferencesStore );\n\t\treturn {\n\t\t\tallowedBlockTypes: getEditorSettings().allowedBlockTypes,\n\t\t\thiddenBlockTypes: get( 'core', 'hiddenBlockTypes' ),\n\t\t};\n\t}, [] );\n\tconst filteredBlockTypes = useMemo( () => {\n\t\tif ( allowedBlockTypes === true ) {\n\t\t\treturn blockTypes;\n\t\t}\n\t\treturn blockTypes.filter( ( { name } ) => {\n\t\t\treturn allowedBlockTypes?.includes( name );\n\t\t} );\n\t}, [ allowedBlockTypes, blockTypes ] );\n\tconst { showBlockTypes, hideBlockTypes } = unlock(\n\t\tuseDispatch( editorStore )\n\t);\n\tconst toggleVisible = useCallback(\n\t\t( blockName, nextIsChecked ) => {\n\t\t\tif ( nextIsChecked ) {\n\t\t\t\tshowBlockTypes( blockName );\n\t\t\t} else {\n\t\t\t\thideBlockTypes( blockName );\n\t\t\t}\n\t\t},\n\t\t[ showBlockTypes, hideBlockTypes ]\n\t);\n\tconst toggleAllVisible = useCallback(\n\t\t( nextIsChecked ) => {\n\t\t\tconst blockNames = blockTypes.map( ( { name } ) => name );\n\t\t\tif ( nextIsChecked ) {\n\t\t\t\tshowBlockTypes( blockNames );\n\t\t\t} else {\n\t\t\t\thideBlockTypes( blockNames );\n\t\t\t}\n\t\t},\n\t\t[ blockTypes, showBlockTypes, hideBlockTypes ]\n\t);\n\n\tif ( ! filteredBlockTypes.length ) {\n\t\treturn null;\n\t}\n\n\tconst checkedBlockNames = filteredBlockTypes\n\t\t.map( ( { name } ) => name )\n\t\t.filter( ( type ) => ! ( hiddenBlockTypes ?? [] ).includes( type ) );\n\n\tconst titleId = 'editor-block-manager__category-title-' + instanceId;\n\n\tconst isAllChecked = checkedBlockNames.length === filteredBlockTypes.length;\n\tconst isIndeterminate = ! isAllChecked && checkedBlockNames.length > 0;\n\n\treturn (\n\t\t<div\n\t\t\trole=\"group\"\n\t\t\taria-labelledby={ titleId }\n\t\t\tclassName=\"editor-block-manager__category\"\n\t\t>\n\t\t\t<CheckboxControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tchecked={ isAllChecked }\n\t\t\t\tonChange={ toggleAllVisible }\n\t\t\t\tclassName=\"editor-block-manager__category-title\"\n\t\t\t\tindeterminate={ isIndeterminate }\n\t\t\t\tlabel={ <span id={ titleId }>{ title }</span> }\n\t\t\t/>\n\t\t\t<BlockTypesChecklist\n\t\t\t\tblockTypes={ filteredBlockTypes }\n\t\t\t\tvalue={ checkedBlockNames }\n\t\t\t\tonItemChange={ toggleVisible }\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nexport default BlockManagerCategory;\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAKA,IAAAK,UAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AAdA;AACA;AACA;;AAOA;AACA;AACA;;AAKA,SAASS,oBAAoBA,CAAE;EAAEC,KAAK;EAAEC;AAAW,CAAC,EAAG;EACtD,MAAMC,UAAU,GAAG,IAAAC,sBAAa,EAAEJ,oBAAqB,CAAC;EACxD,MAAM;IAAEK,iBAAiB;IAAEC;EAAiB,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACx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AJ,OAAA,GAEc9C,oBAAoB"}
|
|
1
|
+
{"version":3,"names":["_element","require","_data","_compose","_components","_preferences","_checklist","_interopRequireDefault","_store","_lockUnlock","BlockManagerCategory","title","blockTypes","instanceId","useInstanceId","allowedBlockTypes","hiddenBlockTypes","useSelect","select","getEditorSettings","editorStore","get","preferencesStore","filteredBlockTypes","useMemo","filter","name","includes","showBlockTypes","hideBlockTypes","unlock","useDispatch","toggleVisible","useCallback","blockName","nextIsChecked","toggleAllVisible","blockNames","map","length","checkedBlockNames","type","titleId","isAllChecked","isIndeterminate","_react","createElement","role","className","CheckboxControl","__nextHasNoMarginBottom","checked","onChange","indeterminate","label","id","default","value","onItemChange","_default","exports"],"sources":["@wordpress/editor/src/components/block-manager/category.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo, useCallback } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useInstanceId } from '@wordpress/compose';\nimport { CheckboxControl } from '@wordpress/components';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport BlockTypesChecklist from './checklist';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nfunction BlockManagerCategory( { title, blockTypes } ) {\n\tconst instanceId = useInstanceId( BlockManagerCategory );\n\tconst { allowedBlockTypes, hiddenBlockTypes } = useSelect( ( select ) => {\n\t\tconst { getEditorSettings } = select( editorStore );\n\t\tconst { get } = select( preferencesStore );\n\t\treturn {\n\t\t\tallowedBlockTypes: getEditorSettings().allowedBlockTypes,\n\t\t\thiddenBlockTypes: get( 'core', 'hiddenBlockTypes' ),\n\t\t};\n\t}, [] );\n\tconst filteredBlockTypes = useMemo( () => {\n\t\tif ( allowedBlockTypes === true ) {\n\t\t\treturn blockTypes;\n\t\t}\n\t\treturn blockTypes.filter( ( { name } ) => {\n\t\t\treturn allowedBlockTypes?.includes( name );\n\t\t} );\n\t}, [ allowedBlockTypes, blockTypes ] );\n\tconst { showBlockTypes, hideBlockTypes } = unlock(\n\t\tuseDispatch( editorStore )\n\t);\n\tconst toggleVisible = useCallback(\n\t\t( blockName, nextIsChecked ) => {\n\t\t\tif ( nextIsChecked ) {\n\t\t\t\tshowBlockTypes( blockName );\n\t\t\t} else {\n\t\t\t\thideBlockTypes( blockName );\n\t\t\t}\n\t\t},\n\t\t[ showBlockTypes, hideBlockTypes ]\n\t);\n\tconst toggleAllVisible = useCallback(\n\t\t( nextIsChecked ) => {\n\t\t\tconst blockNames = blockTypes.map( ( { name } ) => name );\n\t\t\tif ( nextIsChecked ) {\n\t\t\t\tshowBlockTypes( blockNames );\n\t\t\t} else {\n\t\t\t\thideBlockTypes( blockNames );\n\t\t\t}\n\t\t},\n\t\t[ blockTypes, showBlockTypes, hideBlockTypes ]\n\t);\n\n\tif ( ! filteredBlockTypes.length ) {\n\t\treturn null;\n\t}\n\n\tconst checkedBlockNames = filteredBlockTypes\n\t\t.map( ( { name } ) => name )\n\t\t.filter( ( type ) => ! ( hiddenBlockTypes ?? [] ).includes( type ) );\n\n\tconst titleId = 'editor-block-manager__category-title-' + instanceId;\n\n\tconst isAllChecked = checkedBlockNames.length === filteredBlockTypes.length;\n\tconst isIndeterminate = ! isAllChecked && checkedBlockNames.length > 0;\n\n\treturn (\n\t\t<div\n\t\t\trole=\"group\"\n\t\t\taria-labelledby={ titleId }\n\t\t\tclassName=\"editor-block-manager__category\"\n\t\t>\n\t\t\t<CheckboxControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tchecked={ isAllChecked }\n\t\t\t\tonChange={ toggleAllVisible }\n\t\t\t\tclassName=\"editor-block-manager__category-title\"\n\t\t\t\tindeterminate={ isIndeterminate }\n\t\t\t\tlabel={ <span id={ titleId }>{ title }</span> }\n\t\t\t/>\n\t\t\t<BlockTypesChecklist\n\t\t\t\tblockTypes={ filteredBlockTypes }\n\t\t\t\tvalue={ checkedBlockNames }\n\t\t\t\tonItemChange={ toggleVisible }\n\t\t\t/>\n\t\t</div>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,EAAC,OAAO;IACZ,mBAAkBL,OAAS;IAC3BM,SAAS,EAAC;EAAgC,GAE1C,IAAAH,MAAA,CAAAC,aAAA,EAAC1C,WAAA,CAAA6C,eAAe;IACfC,uBAAuB;IACvBC,OAAO,EAAGR,YAAc;IACxBS,QAAQ,EAAGhB,gBAAkB;IAC7BY,SAAS,EAAC,sCAAsC;IAChDK,aAAa,EAAGT,eAAiB;IACjCU,KAAK,EAAG,IAAAT,MAAA,CAAAC,aAAA;MAAMS,EAAE,EAAGb;IAAS,GAAG/B,KAAa;EAAG,CAC/C,CAAC,EACF,IAAAkC,MAAA,CAAAC,aAAA,EAACxC,UAAA,CAAAkD,OAAmB;IACnB5C,UAAU,EAAGW,kBAAoB;IACjCkC,KAAK,EAAGjB,iBAAmB;IAC3BkB,YAAY,EAAG1B;EAAe,CAC9B,CACG,CAAC;AAER;AAAC,IAAA2B,QAAA,GAAAC,OAAA,CAAAJ,OAAA,GAEc9C,oBAAoB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blockEditor","require","_components","BlockTypesChecklist","blockTypes","value","onItemChange","_react","createElement","className","map","blockType","key","name","CheckboxControl","__nextHasNoMarginBottom","label","title","checked","includes","onChange","args","BlockIcon","icon","_default","exports","default"],"sources":["@wordpress/editor/src/components/block-manager/checklist.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { BlockIcon } from '@wordpress/block-editor';\nimport { CheckboxControl } from '@wordpress/components';\n\nfunction BlockTypesChecklist( { blockTypes, value, onItemChange } ) {\n\treturn (\n\t\t<ul className=\"editor-block-manager__checklist\">\n\t\t\t{ blockTypes.map( ( blockType ) => (\n\t\t\t\t<li\n\t\t\t\t\tkey={ blockType.name }\n\t\t\t\t\tclassName=\"editor-block-manager__checklist-item\"\n\t\t\t\t>\n\t\t\t\t\t<CheckboxControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ blockType.title }\n\t\t\t\t\t\tchecked={ value.includes( blockType.name ) }\n\t\t\t\t\t\tonChange={ ( ...args ) =>\n\t\t\t\t\t\t\tonItemChange( blockType.name, ...args )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t<BlockIcon icon={ blockType.icon } />\n\t\t\t\t</li>\n\t\t\t) ) }\n\t\t</ul>\n\t);\n}\n\nexport default BlockTypesChecklist;\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA,SAASE,mBAAmBA,CAAE;EAAEC,UAAU;EAAEC,KAAK;EAAEC;AAAa,CAAC,EAAG;EACnE,OACC,IAAAC,MAAA,CAAAC,aAAA;IAAIC,SAAS,EAAC;EAAiC,GAC5CL,UAAU,CAACM,GAAG,CAAIC,SAAS,IAC5B,IAAAJ,MAAA,CAAAC,aAAA;IACCI,GAAG,EAAGD,SAAS,CAACE,IAAM;IACtBJ,SAAS,EAAC;EAAsC,GAEhD,IAAAF,MAAA,CAAAC,aAAA,EAACN,WAAA,CAAAY,eAAe;IACfC,uBAAuB;IACvBC,KAAK,EAAGL,SAAS,CAACM,KAAO;IACzBC,OAAO,EAAGb,KAAK,CAACc,QAAQ,CAAER,SAAS,CAACE,IAAK,CAAG;IAC5CO,QAAQ,EAAGA,CAAE,GAAGC,IAAI,KACnBf,YAAY,CAAEK,SAAS,CAACE,IAAI,EAAE,GAAGQ,IAAK;EACtC,CACD,CAAC,EACF,IAAAd,MAAA,CAAAC,aAAA,EAACR,YAAA,CAAAsB,SAAS;IAACC,IAAI,EAAGZ,SAAS,CAACY;EAAM,CAAE,CACjC,CACH,CACC,CAAC;AAEP;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcvB,mBAAmB"}
|
|
1
|
+
{"version":3,"names":["_blockEditor","require","_components","BlockTypesChecklist","blockTypes","value","onItemChange","_react","createElement","className","map","blockType","key","name","CheckboxControl","__nextHasNoMarginBottom","label","title","checked","includes","onChange","args","BlockIcon","icon","_default","exports","default"],"sources":["@wordpress/editor/src/components/block-manager/checklist.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { BlockIcon } from '@wordpress/block-editor';\nimport { CheckboxControl } from '@wordpress/components';\n\nfunction BlockTypesChecklist( { blockTypes, value, onItemChange } ) {\n\treturn (\n\t\t<ul className=\"editor-block-manager__checklist\">\n\t\t\t{ blockTypes.map( ( blockType ) => (\n\t\t\t\t<li\n\t\t\t\t\tkey={ blockType.name }\n\t\t\t\t\tclassName=\"editor-block-manager__checklist-item\"\n\t\t\t\t>\n\t\t\t\t\t<CheckboxControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ blockType.title }\n\t\t\t\t\t\tchecked={ value.includes( blockType.name ) }\n\t\t\t\t\t\tonChange={ ( ...args ) =>\n\t\t\t\t\t\t\tonItemChange( blockType.name, ...args )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t<BlockIcon icon={ blockType.icon } />\n\t\t\t\t</li>\n\t\t\t) ) }\n\t\t</ul>\n\t);\n}\n\nexport default BlockTypesChecklist;\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA,SAASE,mBAAmBA,CAAE;EAAEC,UAAU;EAAEC,KAAK;EAAEC;AAAa,CAAC,EAAG;EACnE,OACC,IAAAC,MAAA,CAAAC,aAAA;IAAIC,SAAS,EAAC;EAAiC,GAC5CL,UAAU,CAACM,GAAG,CAAIC,SAAS,IAC5B,IAAAJ,MAAA,CAAAC,aAAA;IACCI,GAAG,EAAGD,SAAS,CAACE,IAAM;IACtBJ,SAAS,EAAC;EAAsC,GAEhD,IAAAF,MAAA,CAAAC,aAAA,EAACN,WAAA,CAAAY,eAAe;IACfC,uBAAuB;IACvBC,KAAK,EAAGL,SAAS,CAACM,KAAO;IACzBC,OAAO,EAAGb,KAAK,CAACc,QAAQ,CAAER,SAAS,CAACE,IAAK,CAAG;IAC5CO,QAAQ,EAAGA,CAAE,GAAGC,IAAI,KACnBf,YAAY,CAAEK,SAAS,CAACE,IAAI,EAAE,GAAGQ,IAAK;EACtC,CACD,CAAC,EACF,IAAAd,MAAA,CAAAC,aAAA,EAACR,YAAA,CAAAsB,SAAS;IAACC,IAAI,EAAGZ,SAAS,CAACY;EAAM,CAAE,CACjC,CACH,CACC,CAAC;AAEP;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcvB,mBAAmB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blocks","require","_data","_components","_i18n","_element","_compose","_a11y","_preferences","_lockUnlock","_store","_category","_interopRequireDefault","BlockManager","blockTypes","categories","hasBlockSupport","isMatchingSearchTerm","numberOfHiddenBlocks","enableAllBlockTypes","debouncedSpeak","useDebounce","speak","search","setSearch","useState","filter","blockType","parent","includes","useEffect","count","length","resultsFoundMessage","sprintf","_n","_react","createElement","className","Button","variant","onClick","__","SearchControl","__nextHasNoMarginBottom","label","placeholder","value","onChange","nextSearch","tabIndex","role","map","category","default","key","slug","title","_default","exports","compose","withSelect","select","_get","getBlockTypes","getCategories","blocksStore","get","preferencesStore","hiddenBlockTypes","hiddenBlock","some","registeredBlock","name","Array","isArray","withDispatch","dispatch","showBlockTypes","unlock","editorStore","blockNames"],"sources":["@wordpress/editor/src/components/block-manager/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { SearchControl, Button } from '@wordpress/components';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { useEffect, useState } from '@wordpress/element';\nimport { useDebounce, compose } from '@wordpress/compose';\nimport { speak } from '@wordpress/a11y';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\nimport BlockManagerCategory from './category';\n\nfunction BlockManager( {\n\tblockTypes,\n\tcategories,\n\thasBlockSupport,\n\tisMatchingSearchTerm,\n\tnumberOfHiddenBlocks,\n\tenableAllBlockTypes,\n} ) {\n\tconst debouncedSpeak = useDebounce( speak, 500 );\n\tconst [ search, setSearch ] = useState( '' );\n\n\t// Filtering occurs here (as opposed to `withSelect`) to avoid\n\t// wasted renders by consequence of `Array#filter` producing\n\t// a new value reference on each call.\n\tblockTypes = blockTypes.filter(\n\t\t( blockType ) =>\n\t\t\thasBlockSupport( blockType, 'inserter', true ) &&\n\t\t\t( ! search || isMatchingSearchTerm( blockType, search ) ) &&\n\t\t\t( ! blockType.parent ||\n\t\t\t\tblockType.parent.includes( 'core/post-content' ) )\n\t);\n\n\t// Announce search results on change\n\tuseEffect( () => {\n\t\tif ( ! search ) {\n\t\t\treturn;\n\t\t}\n\t\tconst count = blockTypes.length;\n\t\tconst resultsFoundMessage = sprintf(\n\t\t\t/* translators: %d: number of results. */\n\t\t\t_n( '%d result found.', '%d results found.', count ),\n\t\t\tcount\n\t\t);\n\t\tdebouncedSpeak( resultsFoundMessage );\n\t}, [ blockTypes.length, search, debouncedSpeak ] );\n\n\treturn (\n\t\t<div className=\"editor-block-manager__content\">\n\t\t\t{ !! numberOfHiddenBlocks && (\n\t\t\t\t<div className=\"editor-block-manager__disabled-blocks-count\">\n\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t/* translators: %d: number of blocks. */\n\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t'%d block is hidden.',\n\t\t\t\t\t\t\t'%d blocks are hidden.',\n\t\t\t\t\t\t\tnumberOfHiddenBlocks\n\t\t\t\t\t\t),\n\t\t\t\t\t\tnumberOfHiddenBlocks\n\t\t\t\t\t) }\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\tonClick={ () => enableAllBlockTypes( blockTypes ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<SearchControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tlabel={ __( 'Search for a block' ) }\n\t\t\t\tplaceholder={ __( 'Search for a block' ) }\n\t\t\t\tvalue={ search }\n\t\t\t\tonChange={ ( nextSearch ) => setSearch( nextSearch ) }\n\t\t\t\tclassName=\"editor-block-manager__search\"\n\t\t\t/>\n\t\t\t<div\n\t\t\t\ttabIndex=\"0\"\n\t\t\t\trole=\"region\"\n\t\t\t\taria-label={ __( 'Available block types' ) }\n\t\t\t\tclassName=\"editor-block-manager__results\"\n\t\t\t>\n\t\t\t\t{ blockTypes.length === 0 && (\n\t\t\t\t\t<p className=\"editor-block-manager__no-results\">\n\t\t\t\t\t\t{ __( 'No blocks found.' ) }\n\t\t\t\t\t</p>\n\t\t\t\t) }\n\t\t\t\t{ categories.map( ( category ) => (\n\t\t\t\t\t<BlockManagerCategory\n\t\t\t\t\t\tkey={ category.slug }\n\t\t\t\t\t\ttitle={ category.title }\n\t\t\t\t\t\tblockTypes={ blockTypes.filter(\n\t\t\t\t\t\t\t( blockType ) =>\n\t\t\t\t\t\t\t\tblockType.category === category.slug\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t\t<BlockManagerCategory\n\t\t\t\t\ttitle={ __( 'Uncategorized' ) }\n\t\t\t\t\tblockTypes={ blockTypes.filter(\n\t\t\t\t\t\t( { category } ) => ! category\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetBlockTypes,\n\t\t\tgetCategories,\n\t\t\thasBlockSupport,\n\t\t\tisMatchingSearchTerm,\n\t\t} = select( blocksStore );\n\t\tconst { get } = select( preferencesStore );\n\n\t\t// Some hidden blocks become unregistered\n\t\t// by removing for instance the plugin that registered them, yet\n\t\t// they're still remain as hidden by the user's action.\n\t\t// We consider \"hidden\", blocks which were hidden and\n\t\t// are still registered.\n\t\tconst blockTypes = getBlockTypes();\n\t\tconst hiddenBlockTypes = (\n\t\t\tget( 'core', 'hiddenBlockTypes' ) ?? []\n\t\t).filter( ( hiddenBlock ) => {\n\t\t\treturn blockTypes.some(\n\t\t\t\t( registeredBlock ) => registeredBlock.name === hiddenBlock\n\t\t\t);\n\t\t} );\n\t\tconst numberOfHiddenBlocks =\n\t\t\tArray.isArray( hiddenBlockTypes ) && hiddenBlockTypes.length;\n\n\t\treturn {\n\t\t\tblockTypes,\n\t\t\tcategories: getCategories(),\n\t\t\thasBlockSupport,\n\t\t\tisMatchingSearchTerm,\n\t\t\tnumberOfHiddenBlocks,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { showBlockTypes } = unlock( dispatch( editorStore ) );\n\t\treturn {\n\t\t\tenableAllBlockTypes: ( blockTypes ) => {\n\t\t\t\tconst blockNames = blockTypes.map( ( { name } ) => name );\n\t\t\t\tshowBlockTypes( blockNames );\n\t\t\t},\n\t\t};\n\t} ),\n] )( BlockManager );\n"],"mappings":";;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AAKA,IAAAQ,WAAA,GAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,SAAA,GAAAC,sBAAA,CAAAX,OAAA;AAjBA;AACA;AACA;;AAUA;AACA;AACA;;AAKA,SAASY,YAAYA,CAAE;EACtBC,UAAU;EACVC,UAAU;EACVC,eAAe;EACfC,oBAAoB;EACpBC,oBAAo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AAE,CAAC,CACF,CAAC,CAAEpE,YAAa,CAAC"}
|
|
1
|
+
{"version":3,"names":["_blocks","require","_data","_components","_i18n","_element","_compose","_a11y","_preferences","_lockUnlock","_store","_category","_interopRequireDefault","BlockManager","blockTypes","categories","hasBlockSupport","isMatchingSearchTerm","numberOfHiddenBlocks","enableAllBlockTypes","debouncedSpeak","useDebounce","speak","search","setSearch","useState","filter","blockType","parent","includes","useEffect","count","length","resultsFoundMessage","sprintf","_n","_react","createElement","className","Button","variant","onClick","__","SearchControl","__nextHasNoMarginBottom","label","placeholder","value","onChange","nextSearch","tabIndex","role","map","category","default","key","slug","title","_default","exports","compose","withSelect","select","_get","getBlockTypes","getCategories","blocksStore","get","preferencesStore","hiddenBlockTypes","hiddenBlock","some","registeredBlock","name","Array","isArray","withDispatch","dispatch","showBlockTypes","unlock","editorStore","blockNames"],"sources":["@wordpress/editor/src/components/block-manager/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { SearchControl, Button } from '@wordpress/components';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { useEffect, useState } from '@wordpress/element';\nimport { useDebounce, compose } from '@wordpress/compose';\nimport { speak } from '@wordpress/a11y';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\nimport BlockManagerCategory from './category';\n\nfunction BlockManager( {\n\tblockTypes,\n\tcategories,\n\thasBlockSupport,\n\tisMatchingSearchTerm,\n\tnumberOfHiddenBlocks,\n\tenableAllBlockTypes,\n} ) {\n\tconst debouncedSpeak = useDebounce( speak, 500 );\n\tconst [ search, setSearch ] = useState( '' );\n\n\t// Filtering occurs here (as opposed to `withSelect`) to avoid\n\t// wasted renders by consequence of `Array#filter` producing\n\t// a new value reference on each call.\n\tblockTypes = blockTypes.filter(\n\t\t( blockType ) =>\n\t\t\thasBlockSupport( blockType, 'inserter', true ) &&\n\t\t\t( ! search || isMatchingSearchTerm( blockType, search ) ) &&\n\t\t\t( ! blockType.parent ||\n\t\t\t\tblockType.parent.includes( 'core/post-content' ) )\n\t);\n\n\t// Announce search results on change\n\tuseEffect( () => {\n\t\tif ( ! search ) {\n\t\t\treturn;\n\t\t}\n\t\tconst count = blockTypes.length;\n\t\tconst resultsFoundMessage = sprintf(\n\t\t\t/* translators: %d: number of results. */\n\t\t\t_n( '%d result found.', '%d results found.', count ),\n\t\t\tcount\n\t\t);\n\t\tdebouncedSpeak( resultsFoundMessage );\n\t}, [ blockTypes.length, search, debouncedSpeak ] );\n\n\treturn (\n\t\t<div className=\"editor-block-manager__content\">\n\t\t\t{ !! numberOfHiddenBlocks && (\n\t\t\t\t<div className=\"editor-block-manager__disabled-blocks-count\">\n\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t/* translators: %d: number of blocks. */\n\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t'%d block is hidden.',\n\t\t\t\t\t\t\t'%d blocks are hidden.',\n\t\t\t\t\t\t\tnumberOfHiddenBlocks\n\t\t\t\t\t\t),\n\t\t\t\t\t\tnumberOfHiddenBlocks\n\t\t\t\t\t) }\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\tonClick={ () => enableAllBlockTypes( blockTypes ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<SearchControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tlabel={ __( 'Search for a block' ) }\n\t\t\t\tplaceholder={ __( 'Search for a block' ) }\n\t\t\t\tvalue={ search }\n\t\t\t\tonChange={ ( nextSearch ) => setSearch( nextSearch ) }\n\t\t\t\tclassName=\"editor-block-manager__search\"\n\t\t\t/>\n\t\t\t<div\n\t\t\t\ttabIndex=\"0\"\n\t\t\t\trole=\"region\"\n\t\t\t\taria-label={ __( 'Available block types' ) }\n\t\t\t\tclassName=\"editor-block-manager__results\"\n\t\t\t>\n\t\t\t\t{ blockTypes.length === 0 && (\n\t\t\t\t\t<p className=\"editor-block-manager__no-results\">\n\t\t\t\t\t\t{ __( 'No blocks found.' ) }\n\t\t\t\t\t</p>\n\t\t\t\t) }\n\t\t\t\t{ categories.map( ( category ) => (\n\t\t\t\t\t<BlockManagerCategory\n\t\t\t\t\t\tkey={ category.slug }\n\t\t\t\t\t\ttitle={ category.title }\n\t\t\t\t\t\tblockTypes={ blockTypes.filter(\n\t\t\t\t\t\t\t( blockType ) =>\n\t\t\t\t\t\t\t\tblockType.category === category.slug\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t\t<BlockManagerCategory\n\t\t\t\t\ttitle={ __( 'Uncategorized' ) }\n\t\t\t\t\tblockTypes={ blockTypes.filter(\n\t\t\t\t\t\t( { category } ) => ! category\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetBlockTypes,\n\t\t\tgetCategories,\n\t\t\thasBlockSupport,\n\t\t\tisMatchingSearchTerm,\n\t\t} = select( blocksStore );\n\t\tconst { get } = select( preferencesStore );\n\n\t\t// Some hidden blocks become unregistered\n\t\t// by removing for instance the plugin that registered them, yet\n\t\t// they're still remain as hidden by the user's action.\n\t\t// We consider \"hidden\", blocks which were hidden and\n\t\t// are still registered.\n\t\tconst blockTypes = getBlockTypes();\n\t\tconst hiddenBlockTypes = (\n\t\t\tget( 'core', 'hiddenBlockTypes' ) ?? []\n\t\t).filter( ( hiddenBlock ) => {\n\t\t\treturn blockTypes.some(\n\t\t\t\t( registeredBlock ) => registeredBlock.name === hiddenBlock\n\t\t\t);\n\t\t} );\n\t\tconst numberOfHiddenBlocks =\n\t\t\tArray.isArray( hiddenBlockTypes ) && hiddenBlockTypes.length;\n\n\t\treturn {\n\t\t\tblockTypes,\n\t\t\tcategories: getCategories(),\n\t\t\thasBlockSupport,\n\t\t\tisMatchingSearchTerm,\n\t\t\tnumberOfHiddenBlocks,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { showBlockTypes } = unlock( dispatch( editorStore ) );\n\t\treturn {\n\t\t\tenableAllBlockTypes: ( blockTypes ) => {\n\t\t\t\tconst blockNames = blockTypes.map( ( { name } ) => name );\n\t\t\t\tshowBlockTypes( blockNames );\n\t\t\t},\n\t\t};\n\t} ),\n] )( BlockManager );\n"],"mappings":";;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AAKA,IAAAQ,WAAA,GAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,SAAA,GAAAC,sBAAA,CAAAX,OAAA;AAjBA;AACA;AACA;;AAUA;AACA;AACA;;AAKA,SAASY,YAAYA,CAAE;EACtBC,UAAU;EACVC,UAAU;EACVC,eAAe;EACfC,oBAAoB;EACpBC,oBAAoB;EACpBC;AACD,CAAC,EAAG;EACH,MAAMC,cAAc,GAAG,IAAAC,oBAAW,EAAEC,WAAK,EAAE,GAAI,CAAC;EAChD,MAAM,CAAEC,MAAM,EAAEC,SAAS,CAAE,GAAG,IAAAC,iBAAQ,EAAE,EAAG,CAAC;;EAE5C;EACA;EACA;EACAX,UAAU,GAAGA,UAAU,CAACY,MAAM,CAC3BC,SAAS,IACVX,eAAe,CAAEW,SAAS,EAAE,UAAU,EAAE,IAAK,CAAC,KAC5C,CAAEJ,MAAM,IAAIN,oBAAoB,CAAEU,S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A,MAAMtD,UAAU,GAAGkD,aAAa,CAAC,CAAC;EAClC,MAAMK,gBAAgB,GAAG,EAAAN,IAAA,GACxBI,GAAG,CAAE,MAAM,EAAE,kBAAmB,CAAC,cAAAJ,IAAA,cAAAA,IAAA,GAAI,EAAE,EACtCrC,MAAM,CAAI4C,WAAW,IAAM;IAC5B,OAAOxD,UAAU,CAACyD,IAAI,CACnBC,eAAe,IAAMA,eAAe,CAACC,IAAI,KAAKH,WACjD,CAAC;EACF,CAAE,CAAC;EACH,MAAMpD,oBAAoB,GACzBwD,KAAK,CAACC,OAAO,CAAEN,gBAAiB,CAAC,IAAIA,gBAAgB,CAACrC,MAAM;EAE7D,OAAO;IACNlB,UAAU;IACVC,UAAU,EAAEkD,aAAa,CAAC,CAAC;IAC3BjD,eAAe;IACfC,oBAAoB;IACpBC;EACD,CAAC;AACF,CAAE,CAAC,EACH,IAAA0D,kBAAY,EAAIC,QAAQ,IAAM;EAC7B,MAAM;IAAEC;EAAe,CAAC,GAAG,IAAAC,kBAAM,EAAEF,QAAQ,CAAEG,YAAY,CAAE,CAAC;EAC5D,OAAO;IACN7D,mBAAmB,EAAIL,UAAU,IAAM;MACtC,MAAMmE,UAAU,GAAGnE,UAAU,CAACsC,GAAG,CAAE,CAAE;QAAEqB;MAAK,CAAC,KAAMA,IAAK,CAAC;MACzDK,cAAc,CAAEG,UAAW,CAAC;IAC7B;EACD,CAAC;AACF,CAAE,CAAC,CACF,CAAC,CAAEpE,YAAa,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_blockEditor","_data","_element","_lockUnlock","_store","BlockRemovalWarningModal","unlock","blockEditorPrivateApis","TEMPLATE_BLOCKS","BLOCK_REMOVAL_RULES","postTypes","callback","removedBlocks","removedTemplateBlocks","filter","name","includes","length","_n","removedBlocksWithOverrides","attributes","metadata","bindings","Object","values","some","binding","source","BlockRemovalWarnings","currentPostType","useSelect","select","editorStore","getCurrentPostType","removalRulesForPostType","useMemo","rule","_react","createElement","rules"],"sources":["@wordpress/editor/src/components/block-removal-warnings/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { _n } from '@wordpress/i18n';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\n\nconst { BlockRemovalWarningModal } = unlock( blockEditorPrivateApis );\n\n// Prevent accidental removal of certain blocks, asking the user for confirmation first.\nconst TEMPLATE_BLOCKS = [\n\t'core/post-content',\n\t'core/post-template',\n\t'core/query',\n];\nconst BLOCK_REMOVAL_RULES = [\n\t{\n\t\t// Template blocks.\n\t\t// The warning is only shown when a user manipulates templates or template parts.\n\t\tpostTypes: [ 'wp_template', 'wp_template_part' ],\n\t\tcallback( removedBlocks ) {\n\t\t\tconst removedTemplateBlocks = removedBlocks.filter( ( { name } ) =>\n\t\t\t\tTEMPLATE_BLOCKS.includes( name )\n\t\t\t);\n\t\t\tif ( removedTemplateBlocks.length ) {\n\t\t\t\treturn _n(\n\t\t\t\t\t'Deleting this block will stop your post or page content from displaying on this template. It is not recommended.',\n\t\t\t\t\t'Some of the deleted blocks will stop your post or page content from displaying on this template. It is not recommended.',\n\t\t\t\t\tremovedBlocks.length\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t},\n\t{\n\t\t// Pattern overrides.\n\t\t// The warning is only shown when the user edits a pattern.\n\t\tpostTypes: [ 'wp_block' ],\n\t\tcallback( removedBlocks ) {\n\t\t\tconst removedBlocksWithOverrides = removedBlocks.filter(\n\t\t\t\t( { attributes } ) =>\n\t\t\t\t\tattributes?.metadata?.bindings &&\n\t\t\t\t\tObject.values( attributes.metadata.bindings ).some(\n\t\t\t\t\t\t( binding ) =>\n\t\t\t\t\t\t\tbinding.source === 'core/pattern-overrides'\n\t\t\t\t\t)\n\t\t\t);\n\t\t\tif ( removedBlocksWithOverrides.length ) {\n\t\t\t\treturn _n(\n\t\t\t\t\t'The deleted block allows instance overrides. Removing it may result in content not displaying where this pattern is used. Are you sure you want to proceed?',\n\t\t\t\t\t'Some of the deleted blocks allow instance overrides. Removing them may result in content not displaying where this pattern is used. Are you sure you want to proceed?',\n\t\t\t\t\tremovedBlocks.length\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t},\n];\n\nexport default function BlockRemovalWarnings() {\n\tconst currentPostType = useSelect(\n\t\t( select ) => select( editorStore ).getCurrentPostType(),\n\t\t[]\n\t);\n\n\tconst removalRulesForPostType = useMemo(\n\t\t() =>\n\t\t\tBLOCK_REMOVAL_RULES.filter( ( rule ) =>\n\t\t\t\trule.postTypes.includes( currentPostType )\n\t\t\t),\n\t\t[ currentPostType ]\n\t);\n\n\t// `BlockRemovalWarnings` is rendered in the editor provider, a shared component\n\t// across react native and web. However, `BlockRemovalWarningModal` is web only.\n\t// Check it exists before trying to render it.\n\tif ( ! BlockRemovalWarningModal ) {\n\t\treturn null;\n\t}\n\n\tif ( ! removalRulesForPostType ) {\n\t\treturn null;\n\t}\n\n\treturn <BlockRemovalWarningModal rules={ removalRulesForPostType } />;\n}\n"],"mappings":";;;;;;;AAIA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAKA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAbA;AACA;AACA;;AAOA;AACA;AACA;;AAIA,MAAM;EAAEM;AAAyB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;;AAErE;AACA,MAAMC,eAAe,GAAG,CACvB,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,CACZ;AACD,MAAMC,mBAAmB,GAAG,CAC3B;EACC;EACA;EACAC,SAAS,EAAE,CAAE,aAAa,EAAE,kBAAkB,CA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EAEA,IAAK,CAAE6B,uBAAuB,EAAG;IAChC,OAAO,IAAI;EACZ;EAEA,OAAO,IAAAG,MAAA,CAAAC,aAAA,EAACjC,wBAAwB;IAACkC,KAAK,EAAGL;EAAyB,CAAE,CAAC;AACtE"}
|
|
1
|
+
{"version":3,"names":["_i18n","require","_blockEditor","_data","_element","_lockUnlock","_store","BlockRemovalWarningModal","unlock","blockEditorPrivateApis","TEMPLATE_BLOCKS","BLOCK_REMOVAL_RULES","postTypes","callback","removedBlocks","removedTemplateBlocks","filter","name","includes","length","_n","removedBlocksWithOverrides","attributes","metadata","bindings","Object","values","some","binding","source","BlockRemovalWarnings","currentPostType","useSelect","select","editorStore","getCurrentPostType","removalRulesForPostType","useMemo","rule","_react","createElement","rules"],"sources":["@wordpress/editor/src/components/block-removal-warnings/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { _n } from '@wordpress/i18n';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\n\nconst { BlockRemovalWarningModal } = unlock( blockEditorPrivateApis );\n\n// Prevent accidental removal of certain blocks, asking the user for confirmation first.\nconst TEMPLATE_BLOCKS = [\n\t'core/post-content',\n\t'core/post-template',\n\t'core/query',\n];\nconst BLOCK_REMOVAL_RULES = [\n\t{\n\t\t// Template blocks.\n\t\t// The warning is only shown when a user manipulates templates or template parts.\n\t\tpostTypes: [ 'wp_template', 'wp_template_part' ],\n\t\tcallback( removedBlocks ) {\n\t\t\tconst removedTemplateBlocks = removedBlocks.filter( ( { name } ) =>\n\t\t\t\tTEMPLATE_BLOCKS.includes( name )\n\t\t\t);\n\t\t\tif ( removedTemplateBlocks.length ) {\n\t\t\t\treturn _n(\n\t\t\t\t\t'Deleting this block will stop your post or page content from displaying on this template. It is not recommended.',\n\t\t\t\t\t'Some of the deleted blocks will stop your post or page content from displaying on this template. It is not recommended.',\n\t\t\t\t\tremovedBlocks.length\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t},\n\t{\n\t\t// Pattern overrides.\n\t\t// The warning is only shown when the user edits a pattern.\n\t\tpostTypes: [ 'wp_block' ],\n\t\tcallback( removedBlocks ) {\n\t\t\tconst removedBlocksWithOverrides = removedBlocks.filter(\n\t\t\t\t( { attributes } ) =>\n\t\t\t\t\tattributes?.metadata?.bindings &&\n\t\t\t\t\tObject.values( attributes.metadata.bindings ).some(\n\t\t\t\t\t\t( binding ) =>\n\t\t\t\t\t\t\tbinding.source === 'core/pattern-overrides'\n\t\t\t\t\t)\n\t\t\t);\n\t\t\tif ( removedBlocksWithOverrides.length ) {\n\t\t\t\treturn _n(\n\t\t\t\t\t'The deleted block allows instance overrides. Removing it may result in content not displaying where this pattern is used. Are you sure you want to proceed?',\n\t\t\t\t\t'Some of the deleted blocks allow instance overrides. Removing them may result in content not displaying where this pattern is used. Are you sure you want to proceed?',\n\t\t\t\t\tremovedBlocks.length\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t},\n];\n\nexport default function BlockRemovalWarnings() {\n\tconst currentPostType = useSelect(\n\t\t( select ) => select( editorStore ).getCurrentPostType(),\n\t\t[]\n\t);\n\n\tconst removalRulesForPostType = useMemo(\n\t\t() =>\n\t\t\tBLOCK_REMOVAL_RULES.filter( ( rule ) =>\n\t\t\t\trule.postTypes.includes( currentPostType )\n\t\t\t),\n\t\t[ currentPostType ]\n\t);\n\n\t// `BlockRemovalWarnings` is rendered in the editor provider, a shared component\n\t// across react native and web. However, `BlockRemovalWarningModal` is web only.\n\t// Check it exists before trying to render it.\n\tif ( ! BlockRemovalWarningModal ) {\n\t\treturn null;\n\t}\n\n\tif ( ! removalRulesForPostType ) {\n\t\treturn null;\n\t}\n\n\treturn <BlockRemovalWarningModal rules={ removalRulesForPostType } />;\n}\n"],"mappings":";;;;;;;AAIA,IAAAA,KAAA,GAAAC,OAAA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D,CAAC,CACD;AAEc,SAASW,oBAAoBA,CAAA,EAAG;EAC9C,MAAMC,eAAe,GAAG,IAAAC,eAAS,EAC9BC,MAAM,IAAMA,MAAM,CAAEC,YAAY,CAAC,CAACC,kBAAkB,CAAC,CAAC,EACxD,EACD,CAAC;EAED,MAAMC,uBAAuB,GAAG,IAAAC,gBAAO,EACtC,MACC1B,mBAAmB,CAACK,MAAM,CAAIsB,IAAI,IACjCA,IAAI,CAAC1B,SAAS,CAACM,QAAQ,CAAEa,eAAgB,CAC1C,CAAC,EACF,CAAEA,eAAe,CAClB,CAAC;;EAED;EACA;EACA;EACA,IAAK,CAAExB,wBAAwB,EAAG;IACjC,OAAO,IAAI;EACZ;EAEA,IAAK,CAAE6B,uBAAuB,EAAG;IAChC,OAAO,IAAI;EACZ;EAEA,OAAO,IAAAG,MAAA,CAAAC,aAAA,EAACjC,wBAAwB;IAACkC,KAAK,EAAGL;EAAyB,CAAE,CAAC;AACtE","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blockEditor","require","_components","_compose","isEverySelectedBlockAllowed","selected","allowed","filter","id","includes","length","shouldRenderItem","selectedBlocks","allowedBlocks","Array","isArray","PluginBlockSettingsMenuItem","icon","label","onClick","small","role","_react","createElement","BlockSettingsMenuControls","onClose","MenuItem","compose","undefined","_default","exports","default"],"sources":["@wordpress/editor/src/components/block-settings-menu/plugin-block-settings-menu-item.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { BlockSettingsMenuControls } from '@wordpress/block-editor';\nimport { MenuItem } from '@wordpress/components';\nimport { compose } from '@wordpress/compose';\n\nconst isEverySelectedBlockAllowed = ( selected, allowed ) =>\n\tselected.filter( ( id ) => ! allowed.includes( id ) ).length === 0;\n\n/**\n * Plugins may want to add an item to the menu either for every block\n * or only for the specific ones provided in the `allowedBlocks` component property.\n *\n * If there are multiple blocks selected the item will be rendered if every block\n * is of one allowed type (not necessarily the same).\n *\n * @param {string[]} selectedBlocks Array containing the names of the blocks selected\n * @param {string[]} allowedBlocks Array containing the names of the blocks allowed\n * @return {boolean} Whether the item will be rendered or not.\n */\nconst shouldRenderItem = ( selectedBlocks, allowedBlocks ) =>\n\t! Array.isArray( allowedBlocks ) ||\n\tisEverySelectedBlockAllowed( selectedBlocks, allowedBlocks );\n\n/**\n * Renders a new item in the block settings menu.\n *\n * @param {Object} props Component props.\n * @param {Array} [props.allowedBlocks] An array containing a list of block names for which the item should be shown. If not present, it'll be rendered for any block. If multiple blocks are selected, it'll be shown if and only if all of them are in the allowed list.\n * @param {WPBlockTypeIconRender} [props.icon] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element.\n * @param {string} props.label The menu item text.\n * @param {Function} props.onClick Callback function to be executed when the user click the menu item.\n * @param {boolean} [props.small] Whether to render the label or not.\n * @param {string} [props.role] The ARIA role for the menu item.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var PluginBlockSettingsMenuItem = wp.editor.PluginBlockSettingsMenuItem;\n *\n * function doOnClick(){\n * \t// To be called when the user clicks the menu item.\n * }\n *\n * function MyPluginBlockSettingsMenuItem() {\n * \treturn React.createElement(\n * \t\tPluginBlockSettingsMenuItem,\n * \t\t{\n * \t\t\tallowedBlocks: [ 'core/paragraph' ],\n * \t\t\ticon: 'dashicon-name',\n * \t\t\tlabel: __( 'Menu item text' ),\n * \t\t\tonClick: doOnClick,\n * \t\t}\n * \t);\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PluginBlockSettingsMenuItem } from '@wordpress/editor';\n *\n * const doOnClick = ( ) => {\n * // To be called when the user clicks the menu item.\n * };\n *\n * const MyPluginBlockSettingsMenuItem = () => (\n * <PluginBlockSettingsMenuItem\n * \t\tallowedBlocks={ [ 'core/paragraph' ] }\n * \t\ticon='dashicon-name'\n * \t\tlabel={ __( 'Menu item text' ) }\n * \t\tonClick={ doOnClick } />\n * );\n * ```\n *\n * @return {Component} The component to be rendered.\n */\nconst PluginBlockSettingsMenuItem = ( {\n\tallowedBlocks,\n\ticon,\n\tlabel,\n\tonClick,\n\tsmall,\n\trole,\n} ) => (\n\t<BlockSettingsMenuControls>\n\t\t{ ( { selectedBlocks, onClose } ) => {\n\t\t\tif ( ! shouldRenderItem( selectedBlocks, allowedBlocks ) ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<MenuItem\n\t\t\t\t\tonClick={ compose( onClick, onClose ) }\n\t\t\t\t\ticon={ icon }\n\t\t\t\t\tlabel={ small ? label : undefined }\n\t\t\t\t\trole={ role }\n\t\t\t\t>\n\t\t\t\t\t{ ! small && label }\n\t\t\t\t</MenuItem>\n\t\t\t);\n\t\t} }\n\t</BlockSettingsMenuControls>\n);\n\nexport default PluginBlockSettingsMenuItem;\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AALA;AACA;AACA;;AAKA,MAAMG,2BAA2B,GAAGA,CAAEC,QAAQ,EAAEC,OAAO,KACtDD,QAAQ,CAACE,MAAM,CAAIC,EAAE,IAAM,CAAEF,OAAO,CAACG,QAAQ,CAAED,EAAG,CAAE,CAAC,CAACE,MAAM,KAAK,CAAC;;AAEnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,gBAAgB,GAAGA,CAAEC,cAAc,EAAEC,aAAa,KACvD,CAAEC,KAAK,CAACC,OAAO,CAAEF,aAAc,CAAC,IAChCT,2BAA2B,CAAEQ,cAAc,EAAEC,aAAc,CAAC;;AAE7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMG,2BAA2B,GAAGA,CAAE;EACrCH,aAAa;EACbI,IAAI;EACJC,KAAK;EACLC,OAAO;EACPC,KAAK;EACLC;AACD,CAAC,KACA,IAAAC,MAAA,CAAAC,aAAA,EAACvB,YAAA,CAAAwB,yBAAyB,QACvB,CAAE;EAAEZ,cAAc;EAAEa;AAAQ,CAAC,KAAM;EACpC,IAAK,CAAEd,gBAAgB,CAAEC,cAAc,EAAEC,aAAc,CAAC,EAAG;IAC1D,OAAO,IAAI;EACZ;EACA,OACC,IAAAS,MAAA,CAAAC,aAAA,EAACrB,WAAA,CAAAwB,QAAQ;IACRP,OAAO,EAAG,IAAAQ,gBAAO,EAAER,OAAO,EAAEM,OAAQ,CAAG;IACvCR,IAAI,EAAGA,IAAM;IACbC,KAAK,EAAGE,KAAK,GAAGF,KAAK,GAAGU,SAAW;IACnCP,IAAI,EAAGA;EAAM,GAEX,CAAED,KAAK,IAAIF,KACJ,CAAC;AAEb,CAC0B,CAC3B;AAAC,IAAAW,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEaf,2BAA2B"}
|
|
1
|
+
{"version":3,"names":["_blockEditor","require","_components","_compose","isEverySelectedBlockAllowed","selected","allowed","filter","id","includes","length","shouldRenderItem","selectedBlocks","allowedBlocks","Array","isArray","PluginBlockSettingsMenuItem","icon","label","onClick","small","role","_react","createElement","BlockSettingsMenuControls","onClose","MenuItem","compose","undefined","_default","exports","default"],"sources":["@wordpress/editor/src/components/block-settings-menu/plugin-block-settings-menu-item.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { BlockSettingsMenuControls } from '@wordpress/block-editor';\nimport { MenuItem } from '@wordpress/components';\nimport { compose } from '@wordpress/compose';\n\nconst isEverySelectedBlockAllowed = ( selected, allowed ) =>\n\tselected.filter( ( id ) => ! allowed.includes( id ) ).length === 0;\n\n/**\n * Plugins may want to add an item to the menu either for every block\n * or only for the specific ones provided in the `allowedBlocks` component property.\n *\n * If there are multiple blocks selected the item will be rendered if every block\n * is of one allowed type (not necessarily the same).\n *\n * @param {string[]} selectedBlocks Array containing the names of the blocks selected\n * @param {string[]} allowedBlocks Array containing the names of the blocks allowed\n * @return {boolean} Whether the item will be rendered or not.\n */\nconst shouldRenderItem = ( selectedBlocks, allowedBlocks ) =>\n\t! Array.isArray( allowedBlocks ) ||\n\tisEverySelectedBlockAllowed( selectedBlocks, allowedBlocks );\n\n/**\n * Renders a new item in the block settings menu.\n *\n * @param {Object} props Component props.\n * @param {Array} [props.allowedBlocks] An array containing a list of block names for which the item should be shown. If not present, it'll be rendered for any block. If multiple blocks are selected, it'll be shown if and only if all of them are in the allowed list.\n * @param {WPBlockTypeIconRender} [props.icon] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element.\n * @param {string} props.label The menu item text.\n * @param {Function} props.onClick Callback function to be executed when the user click the menu item.\n * @param {boolean} [props.small] Whether to render the label or not.\n * @param {string} [props.role] The ARIA role for the menu item.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var PluginBlockSettingsMenuItem = wp.editor.PluginBlockSettingsMenuItem;\n *\n * function doOnClick(){\n * \t// To be called when the user clicks the menu item.\n * }\n *\n * function MyPluginBlockSettingsMenuItem() {\n * \treturn React.createElement(\n * \t\tPluginBlockSettingsMenuItem,\n * \t\t{\n * \t\t\tallowedBlocks: [ 'core/paragraph' ],\n * \t\t\ticon: 'dashicon-name',\n * \t\t\tlabel: __( 'Menu item text' ),\n * \t\t\tonClick: doOnClick,\n * \t\t}\n * \t);\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PluginBlockSettingsMenuItem } from '@wordpress/editor';\n *\n * const doOnClick = ( ) => {\n * // To be called when the user clicks the menu item.\n * };\n *\n * const MyPluginBlockSettingsMenuItem = () => (\n * <PluginBlockSettingsMenuItem\n * \t\tallowedBlocks={ [ 'core/paragraph' ] }\n * \t\ticon='dashicon-name'\n * \t\tlabel={ __( 'Menu item text' ) }\n * \t\tonClick={ doOnClick } />\n * );\n * ```\n *\n * @return {Component} The component to be rendered.\n */\nconst PluginBlockSettingsMenuItem = ( {\n\tallowedBlocks,\n\ticon,\n\tlabel,\n\tonClick,\n\tsmall,\n\trole,\n} ) => (\n\t<BlockSettingsMenuControls>\n\t\t{ ( { selectedBlocks, onClose } ) => {\n\t\t\tif ( ! shouldRenderItem( selectedBlocks, allowedBlocks ) ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<MenuItem\n\t\t\t\t\tonClick={ compose( onClick, onClose ) }\n\t\t\t\t\ticon={ icon }\n\t\t\t\t\tlabel={ small ? label : undefined }\n\t\t\t\t\trole={ role }\n\t\t\t\t>\n\t\t\t\t\t{ ! small && label }\n\t\t\t\t</MenuItem>\n\t\t\t);\n\t\t} }\n\t</BlockSettingsMenuControls>\n);\n\nexport default PluginBlockSettingsMenuItem;\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AALA;AACA;AACA;;AAKA,MAAMG,2BAA2B,GAAGA,CAAEC,QAAQ,EAAEC,OAAO,KACtDD,QAAQ,CAACE,MAAM,CAAIC,EAAE,IAAM,CAAEF,OAAO,CAACG,QAAQ,CAAED,EAAG,CAAE,CAAC,CAACE,MAAM,KAAK,CAAC;;AAEnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,gBAAgB,GAAGA,CAAEC,cAAc,EAAEC,aAAa,KACvD,CAAEC,KAAK,CAACC,OAAO,CAAEF,aAAc,CAAC,IAChCT,2BAA2B,CAAEQ,cAAc,EAAEC,aAAc,CAAC;;AAE7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMG,2BAA2B,GAAGA,CAAE;EACrCH,aAAa;EACbI,IAAI;EACJC,KAAK;EACLC,OAAO;EACPC,KAAK;EACLC;AACD,CAAC,KACA,IAAAC,MAAA,CAAAC,aAAA,EAACvB,YAAA,CAAAwB,yBAAyB,QACvB,CAAE;EAAEZ,cAAc;EAAEa;AAAQ,CAAC,KAAM;EACpC,IAAK,CAAEd,gBAAgB,CAAEC,cAAc,EAAEC,aAAc,CAAC,EAAG;IAC1D,OAAO,IAAI;EACZ;EACA,OACC,IAAAS,MAAA,CAAAC,aAAA,EAACrB,WAAA,CAAAwB,QAAQ;IACRP,OAAO,EAAG,IAAAQ,gBAAO,EAAER,OAAO,EAAEM,OAAQ,CAAG;IACvCR,IAAI,EAAGA,IAAM;IACbC,KAAK,EAAGE,KAAK,GAAGF,KAAK,GAAGU,SAAW;IACnCP,IAAI,EAAGA;EAAM,GAEX,CAAED,KAAK,IAAIF,KACJ,CAAC;AAEb,CAC0B,CAC3B;AAAC,IAAAW,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEaf,2BAA2B","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_wordcount","_store","CharacterCount","content","useSelect","select","editorStore","getEditedPostAttribute","characterCount"],"sources":["@wordpress/editor/src/components/character-count/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { count as characterCount } from '@wordpress/wordcount';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport default function CharacterCount() {\n\tconst content = useSelect(\n\t\t( select ) => select( editorStore ).getEditedPostAttribute( 'content' ),\n\t\t[]\n\t);\n\n\treturn characterCount( content, 'characters_including_spaces' );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGe,SAASG,cAAcA,CAAA,EAAG;EACxC,MAAMC,OAAO,GAAG,IAAAC,eAAS,EACtBC,MAAM,IAAMA,MAAM,CAAEC,YAAY,CAAC,CAACC,sBAAsB,CAAE,SAAU,CAAC,EACvE,EACD,CAAC;EAED,OAAO,IAAAC,gBAAc,EAAEL,OAAO,EAAE,6BAA8B,CAAC;AAChE"}
|
|
1
|
+
{"version":3,"names":["_data","require","_wordcount","_store","CharacterCount","content","useSelect","select","editorStore","getEditedPostAttribute","characterCount"],"sources":["@wordpress/editor/src/components/character-count/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { count as characterCount } from '@wordpress/wordcount';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport default function CharacterCount() {\n\tconst content = useSelect(\n\t\t( select ) => select( editorStore ).getEditedPostAttribute( 'content' ),\n\t\t[]\n\t);\n\n\treturn characterCount( content, 'characters_including_spaces' );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGe,SAASG,cAAcA,CAAA,EAAG;EACxC,MAAMC,OAAO,GAAG,IAAAC,eAAS,EACtBC,MAAM,IAAMA,MAAM,CAAEC,YAAY,CAAC,CAACC,sBAAsB,CAAE,SAAU,CAAC,EACvE,EACD,CAAC;EAED,OAAO,IAAAC,gBAAc,EAAEL,OAAO,EAAE,6BAA8B,CAAC;AAChE","ignoreList":[]}
|