@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useSelect","useState","__","privateApis","componentsPrivateApis","Button","Modal","moreVertical","unlock","usePostActions","store","editorStore","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","PATTERN_POST_TYPE","DropdownMenuV2","DropdownMenu","DropdownMenuGroupV2","DropdownMenuGroup","DropdownMenuItemV2","DropdownMenuItem","DropdownMenuItemLabelV2","DropdownMenuItemLabel","kebabCase","POST_ACTIONS_WHILE_EDITING","PostActions","onActionPerformed","buttonProps","postType","item","select","getCurrentPostType","getCurrentPost","actions","includes","createElement","trigger","size","icon","label","disabled","length","className","placement","ActionsDropdownMenuGroup","DropdownMenuItemTrigger","action","onClick","hideOnClick","RenderModal","ActionWithModal","ActionTrigger","isModalOpen","setIsModalOpen","actionTriggerProps","hideModalHeader","Fragment","title","modalHeader","__experimentalHideHeader","onRequestClose","overlayClassName","id","items","closeModal","map","key","callback"],"sources":["@wordpress/editor/src/components/post-actions/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tprivateApis as componentsPrivateApis,\n\tButton,\n\tModal,\n} from '@wordpress/components';\nimport { moreVertical } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { usePostActions } from './actions';\nimport { store as editorStore } from '../../store';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tPATTERN_POST_TYPE,\n} from '../../store/constants';\n\nconst {\n\tDropdownMenuV2: DropdownMenu,\n\tDropdownMenuGroupV2: DropdownMenuGroup,\n\tDropdownMenuItemV2: DropdownMenuItem,\n\tDropdownMenuItemLabelV2: DropdownMenuItemLabel,\n\tkebabCase,\n} = unlock( componentsPrivateApis );\n\nconst POST_ACTIONS_WHILE_EDITING = [\n\t'view-post',\n\t'view-post-revisions',\n\t'rename-post',\n\t'move-to-trash',\n];\n\nexport default function PostActions( { onActionPerformed, buttonProps } ) {\n\tconst { postType, item } = useSelect( ( select ) => {\n\t\tconst { getCurrentPostType, getCurrentPost } = select( editorStore );\n\t\treturn {\n\t\t\tpostType: getCurrentPostType(),\n\t\t\titem: getCurrentPost(),\n\t\t};\n\t} );\n\tconst actions = usePostActions(\n\t\tonActionPerformed,\n\t\tPOST_ACTIONS_WHILE_EDITING\n\t);\n\n\tif (\n\t\t[\n\t\t\tTEMPLATE_POST_TYPE,\n\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\tPATTERN_POST_TYPE,\n\t\t].includes( postType )\n\t) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<DropdownMenu\n\t\t\ttrigger={\n\t\t\t\t<Button\n\t\t\t\t\tsize=\"small\"\n\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\tlabel={ __( 'Actions' ) }\n\t\t\t\t\tdisabled={ ! actions.length }\n\t\t\t\t\tclassName=\"editor-all-actions-button\"\n\t\t\t\t\t{ ...buttonProps }\n\t\t\t\t/>\n\t\t\t}\n\t\t\tplacement=\"bottom-end\"\n\t\t>\n\t\t\t<ActionsDropdownMenuGroup actions={ actions } item={ item } />\n\t\t</DropdownMenu>\n\t);\n}\n\n// From now on all the functions on this file are copied as from the dataviews packages,\n// The editor packages should not be using the dataviews packages directly,\n// and the dataviews package should not be using the editor packages directly,\n// so duplicating the code here seems like the least bad option.\n\n// Copied as is from packages/dataviews/src/item-actions.js\nfunction DropdownMenuItemTrigger( { action, onClick } ) {\n\treturn (\n\t\t<DropdownMenuItem\n\t\t\tonClick={ onClick }\n\t\t\thideOnClick={ ! action.RenderModal }\n\t\t>\n\t\t\t<DropdownMenuItemLabel>{ action.label }</DropdownMenuItemLabel>\n\t\t</DropdownMenuItem>\n\t);\n}\n\n// Copied as is from packages/dataviews/src/item-actions.js\nfunction ActionWithModal( { action, item, ActionTrigger } ) {\n\tconst [ isModalOpen, setIsModalOpen ] = useState( false );\n\tconst actionTriggerProps = {\n\t\taction,\n\t\tonClick: () => setIsModalOpen( true ),\n\t};\n\tconst { RenderModal, hideModalHeader } = action;\n\treturn (\n\t\t<>\n\t\t\t<ActionTrigger { ...actionTriggerProps } />\n\t\t\t{ isModalOpen && (\n\t\t\t\t<Modal\n\t\t\t\t\ttitle={ action.modalHeader || action.label }\n\t\t\t\t\t__experimentalHideHeader={ !! hideModalHeader }\n\t\t\t\t\tonRequestClose={ () => {\n\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t} }\n\t\t\t\t\toverlayClassName={ `editor-action-modal editor-action-modal__${ kebabCase(\n\t\t\t\t\t\taction.id\n\t\t\t\t\t) }` }\n\t\t\t\t>\n\t\t\t\t\t<RenderModal\n\t\t\t\t\t\titems={ [ item ] }\n\t\t\t\t\t\tcloseModal={ () => setIsModalOpen( false ) }\n\t\t\t\t\t/>\n\t\t\t\t</Modal>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\n// Copied as is from packages/dataviews/src/item-actions.js\nfunction ActionsDropdownMenuGroup( { actions, item } ) {\n\treturn (\n\t\t<DropdownMenuGroup>\n\t\t\t{ actions.map( ( action ) => {\n\t\t\t\tif ( action.RenderModal ) {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<ActionWithModal\n\t\t\t\t\t\t\tkey={ action.id }\n\t\t\t\t\t\t\taction={ action }\n\t\t\t\t\t\t\titem={ item }\n\t\t\t\t\t\t\tActionTrigger={ DropdownMenuItemTrigger }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn (\n\t\t\t\t\t<DropdownMenuItemTrigger\n\t\t\t\t\t\tkey={ action.id }\n\t\t\t\t\t\taction={ action }\n\t\t\t\t\t\tonClick={ () => action.call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aAAA,CAAC7B,KAAK;IACLmD,KAAK,EAAGX,MAAM,CAACY,WAAW,IAAIZ,MAAM,CAACP,KAAO;IAC5CoB,wBAAwB,EAAG,CAAC,CAAEJ,eAAiB;IAC/CK,cAAc,EAAGA,CAAA,KAAM;MACtBP,cAAc,CAAE,KAAM,CAAC;IACxB,CAAG;IACHQ,gBAAgB,EAAI,4CAA4CtC,SAAS,CACxEuB,MAAM,CAACgB,EACR,CAAG;EAAG,GAEN3B,aAAA,CAACc,WAAW;IACXc,KAAK,EAAG,CAAElC,IAAI,CAAI;IAClBmC,UAAU,EAAGA,CAAA,KAAMX,cAAc,CAAE,KAAM;EAAG,CAC5C,CACK,CAEP,CAAC;AAEL;;AAEA;AACA,SAAST,wBAAwBA,CAAE;EAAEX,OAAO;EAAEJ;AAAK,CAAC,EAAG;EACtD,OACCM,aAAA,CAACjB,iBAAiB,QACfe,OAAO,CAACgC,GAAG,CAAInB,MAAM,IAAM;IAC5B,IAAKA,MAAM,CAACG,WAAW,EAAG;MACzB,OACCd,aAAA,CAACe,eAAe;QACfgB,GAAG,EAAGpB,MAAM,CAACgB,EAAI;QACjBhB,MAAM,EAAGA,MAAQ;QACjBjB,IAAI,EAAGA,IAAM;QACbsB,aAAa,EAAGN;MAAyB,CACzC,CAAC;IAEJ;IACA,OACCV,aAAA,CAACU,uBAAuB;MACvBqB,GAAG,EAAGpB,MAAM,CAACgB,EAAI;MACjBhB,MAAM,EAAGA,MAAQ;MACjBC,OAAO,EAAGA,CAAA,KAAMD,MAAM,CAACqB,QAAQ,CAAE,CAAEtC,IAAI,CAAG;IAAG,CAC7C,CAAC;EAEJ,CAAE,CACgB,CAAC;AAEtB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSelect","store","coreStore","PostTypeSupportCheck","editorStore","AUTHORS_QUERY","PostAuthorCheck","children","hasAssignAuthorAction","hasAuthors","select","_post$_links$wpActio","post","getCurrentPost","authors","getUsers","_links","length","createElement","supportKeys"],"sources":["@wordpress/editor/src/components/post-author/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport PostTypeSupportCheck from '../post-type-support-check';\nimport { store as editorStore } from '../../store';\nimport { AUTHORS_QUERY } from './constants';\n\nexport default function PostAuthorCheck( { children } ) {\n\tconst { hasAssignAuthorAction, hasAuthors } = useSelect( ( select ) => {\n\t\tconst post = select( editorStore ).getCurrentPost();\n\t\tconst authors = select( coreStore ).getUsers( AUTHORS_QUERY );\n\t\treturn {\n\t\t\thasAssignAuthorAction:\n\t\t\t\tpost._links?.[ 'wp:action-assign-author' ] ?? false,\n\t\t\thasAuthors: authors?.length >= 1,\n\t\t};\n\t}, [] );\n\n\tif ( ! hasAssignAuthorAction || ! hasAuthors ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PostTypeSupportCheck supportKeys=\"author\">\n\t\t\t{ children }\n\t\t</PostTypeSupportCheck>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,4BAA4B;AAC7D,SAASF,KAAK,IAAIG,WAAW,QAAQ,aAAa;AAClD,SAASC,aAAa,QAAQ,aAAa;AAE3C,eAAe,SAASC,eAAeA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACvD,MAAM;IAAEC,qBAAqB;IAAEC;EAAW,CAAC,GAAGT,SAAS,CAAIU,MAAM,IAAM;IAAA,IAAAC,oBAAA;IACtE,MAAMC,IAAI,GAAGF,MAAM,CAAEN,WAAY,CAAC,CAACS,cAAc,CAAC,CAAC;IACnD,MAAMC,OAAO,GAAGJ,MAAM,CAAER,SAAU,CAAC,CAACa,QAAQ,CAAEV,aAAc,CAAC;IAC7D,OAAO;MACNG,qBAAqB,GAAAG,oBAAA,GACpBC,IAAI,CAACI,MAAM,GAAI,yBAAyB,CAAE,cAAAL,oBAAA,cAAAA,oBAAA,GAAI,KAAK;MACpDF,UAAU,EAAEK,OAAO,EAAEG,MAAM,IAAI;IAChC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,IAAK,CAAET,qBAAqB,IAAI,CAAEC,UAAU,EAAG;IAC9C,OAAO,IAAI;EACZ;EAEA,OACCS,aAAA,CAACf,oBAAoB;IAACgB,WAAW,EAAC;EAAQ,GACvCZ,QACmB,CAAC;AAEzB"}
|
|
1
|
+
{"version":3,"names":["useSelect","store","coreStore","PostTypeSupportCheck","editorStore","AUTHORS_QUERY","PostAuthorCheck","children","hasAssignAuthorAction","hasAuthors","select","_post$_links$wpActio","post","getCurrentPost","authors","getUsers","_links","length","createElement","supportKeys"],"sources":["@wordpress/editor/src/components/post-author/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport PostTypeSupportCheck from '../post-type-support-check';\nimport { store as editorStore } from '../../store';\nimport { AUTHORS_QUERY } from './constants';\n\nexport default function PostAuthorCheck( { children } ) {\n\tconst { hasAssignAuthorAction, hasAuthors } = useSelect( ( select ) => {\n\t\tconst post = select( editorStore ).getCurrentPost();\n\t\tconst authors = select( coreStore ).getUsers( AUTHORS_QUERY );\n\t\treturn {\n\t\t\thasAssignAuthorAction:\n\t\t\t\tpost._links?.[ 'wp:action-assign-author' ] ?? false,\n\t\t\thasAuthors: authors?.length >= 1,\n\t\t};\n\t}, [] );\n\n\tif ( ! hasAssignAuthorAction || ! hasAuthors ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PostTypeSupportCheck supportKeys=\"author\">\n\t\t\t{ children }\n\t\t</PostTypeSupportCheck>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,4BAA4B;AAC7D,SAASF,KAAK,IAAIG,WAAW,QAAQ,aAAa;AAClD,SAASC,aAAa,QAAQ,aAAa;AAE3C,eAAe,SAASC,eAAeA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACvD,MAAM;IAAEC,qBAAqB;IAAEC;EAAW,CAAC,GAAGT,SAAS,CAAIU,MAAM,IAAM;IAAA,IAAAC,oBAAA;IACtE,MAAMC,IAAI,GAAGF,MAAM,CAAEN,WAAY,CAAC,CAACS,cAAc,CAAC,CAAC;IACnD,MAAMC,OAAO,GAAGJ,MAAM,CAAER,SAAU,CAAC,CAACa,QAAQ,CAAEV,aAAc,CAAC;IAC7D,OAAO;MACNG,qBAAqB,GAAAG,oBAAA,GACpBC,IAAI,CAACI,MAAM,GAAI,yBAAyB,CAAE,cAAAL,oBAAA,cAAAA,oBAAA,GAAI,KAAK;MACpDF,UAAU,EAAEK,OAAO,EAAEG,MAAM,IAAI;IAChC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,IAAK,CAAET,qBAAqB,IAAI,CAAEC,UAAU,EAAG;IAC9C,OAAO,IAAI;EACZ;EAEA,OACCS,aAAA,CAACf,oBAAoB;IAACgB,WAAW,EAAC;EAAQ,GACvCZ,QACmB,CAAC;AAEzB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["debounce","useState","useDispatch","__","ComboboxControl","store","editorStore","useAuthorsQuery","PostAuthorCombobox","fieldValue","setFieldValue","editPost","authorId","authorOptions","handleSelect","postAuthorId","author","handleKeydown","inputValue","createElement","__nextHasNoMarginBottom","__next40pxDefaultSize","label","options","value","onFilterValueChange","onChange","allowReset"],"sources":["@wordpress/editor/src/components/post-author/combobox.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { debounce } from '@wordpress/compose';\nimport { useState } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { ComboboxControl } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { useAuthorsQuery } from './hook';\n\nexport default function PostAuthorCombobox() {\n\tconst [ fieldValue, setFieldValue ] = useState();\n\n\tconst { editPost } = useDispatch( editorStore );\n\tconst { authorId, authorOptions } = useAuthorsQuery( fieldValue );\n\n\t/**\n\t * Handle author selection.\n\t *\n\t * @param {number} postAuthorId The selected Author.\n\t */\n\tconst handleSelect = ( postAuthorId ) => {\n\t\tif ( ! postAuthorId ) {\n\t\t\treturn;\n\t\t}\n\t\teditPost( { author: postAuthorId } );\n\t};\n\n\t/**\n\t * Handle user input.\n\t *\n\t * @param {string} inputValue The current value of the input field.\n\t */\n\tconst handleKeydown = ( inputValue ) => {\n\t\tsetFieldValue( inputValue );\n\t};\n\n\treturn (\n\t\t<ComboboxControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\t__next40pxDefaultSize\n\t\t\tlabel={ __( 'Author' ) }\n\t\t\toptions={ authorOptions }\n\t\t\tvalue={ authorId }\n\t\t\tonFilterValueChange={ debounce( handleKeydown, 300 ) }\n\t\t\tonChange={ handleSelect }\n\t\t\tallowReset={ false }\n\t\t/>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,eAAe,QAAQ,uBAAuB;;AAEvD;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAClD,SAASC,eAAe,QAAQ,QAAQ;AAExC,eAAe,SAASC,kBAAkBA,CAAA,EAAG;EAC5C,MAAM,CAAEC,UAAU,EAAEC,aAAa,CAAE,GAAGT,QAAQ,CAAC,CAAC;EAEhD,MAAM;IAAEU;EAAS,CAAC,GAAGT,WAAW,CAAEI,WAAY,CAAC;EAC/C,MAAM;IAAEM,QAAQ;IAAEC;EAAc,CAAC,GAAGN,eAAe,CAAEE,UAAW,CAAC;;EAEjE;AACD;AACA;AACA;AACA;EACC,MAAMK,YAAY,GAAKC,YAAY,IAAM;IACxC,IAAK,CAAEA,YAAY,EAAG;MACrB;IACD;IACAJ,QAAQ,CAAE;MAAEK,MAAM,EAAED;IAAa,CAAE,CAAC;EACrC,CAAC;;EAED;AACD;AACA;AACA;AACA;EACC,MAAME,aAAa,GAAKC,UAAU,IAAM;IACvCR,aAAa,CAAEQ,UAAW,CAAC;EAC5B,CAAC;EAED,OACCC,aAAA,CAACf,eAAe;IACfgB,uBAAuB;IACvBC,qBAAqB;IACrBC,KAAK,EAAGnB,EAAE,CAAE,QAAS,CAAG;IACxBoB,OAAO,EAAGV,aAAe;IACzBW,KAAK,EAAGZ,QAAU;IAClBa,mBAAmB,EAAGzB,QAAQ,CAAEiB,aAAa,EAAE,GAAI,CAAG;IACtDS,QAAQ,EAAGZ,YAAc;IACzBa,UAAU,EAAG;EAAO,CACpB,CAAC;AAEJ"}
|
|
1
|
+
{"version":3,"names":["debounce","useState","useDispatch","__","ComboboxControl","store","editorStore","useAuthorsQuery","PostAuthorCombobox","fieldValue","setFieldValue","editPost","authorId","authorOptions","handleSelect","postAuthorId","author","handleKeydown","inputValue","createElement","__nextHasNoMarginBottom","__next40pxDefaultSize","label","options","value","onFilterValueChange","onChange","allowReset"],"sources":["@wordpress/editor/src/components/post-author/combobox.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { debounce } from '@wordpress/compose';\nimport { useState } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { ComboboxControl } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { useAuthorsQuery } from './hook';\n\nexport default function PostAuthorCombobox() {\n\tconst [ fieldValue, setFieldValue ] = useState();\n\n\tconst { editPost } = useDispatch( editorStore );\n\tconst { authorId, authorOptions } = useAuthorsQuery( fieldValue );\n\n\t/**\n\t * Handle author selection.\n\t *\n\t * @param {number} postAuthorId The selected Author.\n\t */\n\tconst handleSelect = ( postAuthorId ) => {\n\t\tif ( ! postAuthorId ) {\n\t\t\treturn;\n\t\t}\n\t\teditPost( { author: postAuthorId } );\n\t};\n\n\t/**\n\t * Handle user input.\n\t *\n\t * @param {string} inputValue The current value of the input field.\n\t */\n\tconst handleKeydown = ( inputValue ) => {\n\t\tsetFieldValue( inputValue );\n\t};\n\n\treturn (\n\t\t<ComboboxControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\t__next40pxDefaultSize\n\t\t\tlabel={ __( 'Author' ) }\n\t\t\toptions={ authorOptions }\n\t\t\tvalue={ authorId }\n\t\t\tonFilterValueChange={ debounce( handleKeydown, 300 ) }\n\t\t\tonChange={ handleSelect }\n\t\t\tallowReset={ false }\n\t\t/>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,eAAe,QAAQ,uBAAuB;;AAEvD;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAClD,SAASC,eAAe,QAAQ,QAAQ;AAExC,eAAe,SAASC,kBAAkBA,CAAA,EAAG;EAC5C,MAAM,CAAEC,UAAU,EAAEC,aAAa,CAAE,GAAGT,QAAQ,CAAC,CAAC;EAEhD,MAAM;IAAEU;EAAS,CAAC,GAAGT,WAAW,CAAEI,WAAY,CAAC;EAC/C,MAAM;IAAEM,QAAQ;IAAEC;EAAc,CAAC,GAAGN,eAAe,CAAEE,UAAW,CAAC;;EAEjE;AACD;AACA;AACA;AACA;EACC,MAAMK,YAAY,GAAKC,YAAY,IAAM;IACxC,IAAK,CAAEA,YAAY,EAAG;MACrB;IACD;IACAJ,QAAQ,CAAE;MAAEK,MAAM,EAAED;IAAa,CAAE,CAAC;EACrC,CAAC;;EAED;AACD;AACA;AACA;AACA;EACC,MAAME,aAAa,GAAKC,UAAU,IAAM;IACvCR,aAAa,CAAEQ,UAAW,CAAC;EAC5B,CAAC;EAED,OACCC,aAAA,CAACf,eAAe;IACfgB,uBAAuB;IACvBC,qBAAqB;IACrBC,KAAK,EAAGnB,EAAE,CAAE,QAAS,CAAG;IACxBoB,OAAO,EAAGV,aAAe;IACzBW,KAAK,EAAGZ,QAAU;IAClBa,mBAAmB,EAAGzB,QAAQ,CAAEiB,aAAa,EAAE,GAAI,CAAG;IACtDS,QAAQ,EAAGZ,YAAc;IACzBa,UAAU,EAAG;EAAO,CACpB,CAAC;AAEJ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BASE_QUERY","_fields","context","AUTHORS_QUERY","who","per_page"],"sources":["@wordpress/editor/src/components/post-author/constants.js"],"sourcesContent":["export const BASE_QUERY = {\n\t_fields: 'id,name',\n\tcontext: 'view', // Allows non-admins to perform requests.\n};\n\nexport const AUTHORS_QUERY = {\n\twho: 'authors',\n\tper_page: 50,\n\t...BASE_QUERY,\n};\n"],"mappings":"AAAA,OAAO,MAAMA,UAAU,GAAG;EACzBC,OAAO,EAAE,SAAS;EAClBC,OAAO,EAAE,MAAM,CAAE;AAClB,CAAC;AAED,OAAO,MAAMC,aAAa,GAAG;EAC5BC,GAAG,EAAE,SAAS;EACdC,QAAQ,EAAE,EAAE;EACZ,GAAGL;AACJ,CAAC"}
|
|
1
|
+
{"version":3,"names":["BASE_QUERY","_fields","context","AUTHORS_QUERY","who","per_page"],"sources":["@wordpress/editor/src/components/post-author/constants.js"],"sourcesContent":["export const BASE_QUERY = {\n\t_fields: 'id,name',\n\tcontext: 'view', // Allows non-admins to perform requests.\n};\n\nexport const AUTHORS_QUERY = {\n\twho: 'authors',\n\tper_page: 50,\n\t...BASE_QUERY,\n};\n"],"mappings":"AAAA,OAAO,MAAMA,UAAU,GAAG;EACzBC,OAAO,EAAE,SAAS;EAClBC,OAAO,EAAE,MAAM,CAAE;AAClB,CAAC;AAED,OAAO,MAAMC,aAAa,GAAG;EAC5BC,GAAG,EAAE,SAAS;EACdC,QAAQ,EAAE,EAAE;EACZ,GAAGL;AACJ,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useMemo","useSelect","decodeEntities","store","coreStore","editorStore","AUTHORS_QUERY","BASE_QUERY","useAuthorsQuery","search","authorId","authors","postAuthor","select","getUser","getUsers","getEditedPostAttribute","_authorId","query","authorOptions","fetchedAuthors","map","author","value","id","label","name","foundAuthor","findIndex"],"sources":["@wordpress/editor/src/components/post-author/hook.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { AUTHORS_QUERY, BASE_QUERY } from './constants';\n\nexport function useAuthorsQuery( search ) {\n\tconst { authorId, authors, postAuthor } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getUser, getUsers } = select( coreStore );\n\t\t\tconst { getEditedPostAttribute } = select( editorStore );\n\t\t\tconst _authorId = getEditedPostAttribute( 'author' );\n\t\t\tconst query = { ...AUTHORS_QUERY };\n\n\t\t\tif ( search ) {\n\t\t\t\tquery.search = search;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tauthorId: _authorId,\n\t\t\t\tauthors: getUsers( query ),\n\t\t\t\tpostAuthor: getUser( _authorId, BASE_QUERY ),\n\t\t\t};\n\t\t},\n\t\t[ search ]\n\t);\n\n\tconst authorOptions = useMemo( () => {\n\t\tconst fetchedAuthors = ( authors ?? [] ).map( ( author ) => {\n\t\t\treturn {\n\t\t\t\tvalue: author.id,\n\t\t\t\tlabel: decodeEntities( author.name ),\n\t\t\t};\n\t\t} );\n\n\t\t// Ensure the current author is included in the dropdown list.\n\t\tconst foundAuthor = fetchedAuthors.findIndex(\n\t\t\t( { value } ) => postAuthor?.id === value\n\t\t);\n\n\t\tif ( foundAuthor < 0 && postAuthor ) {\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tvalue: postAuthor.id,\n\t\t\t\t\tlabel: decodeEntities( postAuthor.name ),\n\t\t\t\t},\n\t\t\t\t...fetchedAuthors,\n\t\t\t];\n\t\t}\n\n\t\treturn fetchedAuthors;\n\t}, [ authors, postAuthor ] );\n\n\treturn { authorId, authorOptions };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASD,KAAK,IAAIE,WAAW,QAAQ,aAAa;AAClD,SAASC,aAAa,EAAEC,UAAU,QAAQ,aAAa;AAEvD,OAAO,SAASC,eAAeA,CAAEC,MAAM,EAAG;EACzC,MAAM;IAAEC,QAAQ;IAAEC,OAAO;IAAEC;EAAW,CAAC,GAAGX,SAAS,CAChDY,MAAM,IAAM;IACb,MAAM;MAAEC,OAAO;MAAEC;IAAS,CAAC,GAAGF,MAAM,CAAET,SAAU,CAAC;IACjD,MAAM;MAAEY;IAAuB,CAAC,GAAGH,MAAM,CAAER,WAAY,CAAC;IACxD,MAAMY,SAAS,GAAGD,sBAAsB,CAAE,QAAS,CAAC;IACpD,MAAME,KAAK,GAAG;MAAE,GAAGZ;IAAc,CAAC;IAElC,IAAKG,MAAM,EAAG;MACbS,KAAK,CAACT,MAAM,GAAGA,MAAM;IACtB;IAEA,OAAO;MACNC,QAAQ,EAAEO,SAAS;MACnBN,OAAO,EAAEI,QAAQ,CAAEG,KAAM,CAAC;MAC1BN,UAAU,EAAEE,OAAO,CAAEG,SAAS,EAAEV,UAAW;IAC5C,CAAC;EACF,CAAC,EACD,CAAEE,MAAM,CACT,CAAC;EAED,MAAMU,aAAa,GAAGnB,OAAO,CAAE,MAAM;IACpC,MAAMoB,cAAc,GAAG,CAAET,OAAO,aAAPA,OAAO,cAAPA,OAAO,GAAI,EAAE,EAAGU,GAAG,CAAIC,MAAM,IAAM;MAC3D,OAAO;QACNC,KAAK,EAAED,MAAM,CAACE,EAAE;QAChBC,KAAK,EAAEvB,cAAc,CAAEoB,MAAM,CAACI,IAAK;MACpC,CAAC;IACF,CAAE,CAAC;;IAEH;IACA,MAAMC,WAAW,GAAGP,cAAc,CAACQ,SAAS,CAC3C,CAAE;MAAEL;IAAM,CAAC,KAAMX,UAAU,EAAEY,EAAE,KAAKD,KACrC,CAAC;IAED,IAAKI,WAAW,GAAG,CAAC,IAAIf,UAAU,EAAG;MACpC,OAAO,CACN;QACCW,KAAK,EAAEX,UAAU,CAACY,EAAE;QACpBC,KAAK,EAAEvB,cAAc,CAAEU,UAAU,CAACc,IAAK;MACxC,CAAC,EACD,GAAGN,cAAc,CACjB;IACF;IAEA,OAAOA,cAAc;EACtB,CAAC,EAAE,CAAET,OAAO,EAAEC,UAAU,CAAG,CAAC;EAE5B,OAAO;IAAEF,QAAQ;IAAES;EAAc,CAAC;AACnC"}
|
|
1
|
+
{"version":3,"names":["useMemo","useSelect","decodeEntities","store","coreStore","editorStore","AUTHORS_QUERY","BASE_QUERY","useAuthorsQuery","search","authorId","authors","postAuthor","select","getUser","getUsers","getEditedPostAttribute","_authorId","query","authorOptions","fetchedAuthors","map","author","value","id","label","name","foundAuthor","findIndex"],"sources":["@wordpress/editor/src/components/post-author/hook.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { AUTHORS_QUERY, BASE_QUERY } from './constants';\n\nexport function useAuthorsQuery( search ) {\n\tconst { authorId, authors, postAuthor } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getUser, getUsers } = select( coreStore );\n\t\t\tconst { getEditedPostAttribute } = select( editorStore );\n\t\t\tconst _authorId = getEditedPostAttribute( 'author' );\n\t\t\tconst query = { ...AUTHORS_QUERY };\n\n\t\t\tif ( search ) {\n\t\t\t\tquery.search = search;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tauthorId: _authorId,\n\t\t\t\tauthors: getUsers( query ),\n\t\t\t\tpostAuthor: getUser( _authorId, BASE_QUERY ),\n\t\t\t};\n\t\t},\n\t\t[ search ]\n\t);\n\n\tconst authorOptions = useMemo( () => {\n\t\tconst fetchedAuthors = ( authors ?? [] ).map( ( author ) => {\n\t\t\treturn {\n\t\t\t\tvalue: author.id,\n\t\t\t\tlabel: decodeEntities( author.name ),\n\t\t\t};\n\t\t} );\n\n\t\t// Ensure the current author is included in the dropdown list.\n\t\tconst foundAuthor = fetchedAuthors.findIndex(\n\t\t\t( { value } ) => postAuthor?.id === value\n\t\t);\n\n\t\tif ( foundAuthor < 0 && postAuthor ) {\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tvalue: postAuthor.id,\n\t\t\t\t\tlabel: decodeEntities( postAuthor.name ),\n\t\t\t\t},\n\t\t\t\t...fetchedAuthors,\n\t\t\t];\n\t\t}\n\n\t\treturn fetchedAuthors;\n\t}, [ authors, postAuthor ] );\n\n\treturn { authorId, authorOptions };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASD,KAAK,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ACpBC,KAAK,EAAEvB,cAAc,CAAEU,UAAU,CAACc,IAAK;MACxC,CAAC,EACD,GAAGN,cAAc,CACjB;IACF;IAEA,OAAOA,cAAc;EACtB,CAAC,EAAE,CAAET,OAAO,EAAEC,UAAU,CAAG,CAAC;EAE5B,OAAO;IAAEF,QAAQ;IAAES;EAAc,CAAC;AACnC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSelect","store","coreStore","PostAuthorCombobox","PostAuthorSelect","AUTHORS_QUERY","minimumUsersForCombobox","PostAuthor","showCombobox","select","authors","getUsers","length","createElement"],"sources":["@wordpress/editor/src/components/post-author/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport PostAuthorCombobox from './combobox';\nimport PostAuthorSelect from './select';\nimport { AUTHORS_QUERY } from './constants';\n\nconst minimumUsersForCombobox = 25;\n\nfunction PostAuthor() {\n\tconst showCombobox = useSelect( ( select ) => {\n\t\tconst authors = select( coreStore ).getUsers( AUTHORS_QUERY );\n\n\t\treturn authors?.length >= minimumUsersForCombobox;\n\t}, [] );\n\n\tif ( showCombobox ) {\n\t\treturn <PostAuthorCombobox />;\n\t}\n\treturn <PostAuthorSelect />;\n}\n\nexport default PostAuthor;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,OAAOC,kBAAkB,MAAM,YAAY;AAC3C,OAAOC,gBAAgB,MAAM,UAAU;AACvC,SAASC,aAAa,QAAQ,aAAa;AAE3C,MAAMC,uBAAuB,GAAG,EAAE;AAElC,SAASC,UAAUA,CAAA,EAAG;EACrB,MAAMC,YAAY,GAAGR,SAAS,CAAIS,MAAM,IAAM;IAC7C,MAAMC,OAAO,GAAGD,MAAM,CAAEP,SAAU,CAAC,CAACS,QAAQ,CAAEN,aAAc,CAAC;IAE7D,OAAOK,OAAO,EAAEE,MAAM,IAAIN,uBAAuB;EAClD,CAAC,EAAE,EAAG,CAAC;EAEP,IAAKE,YAAY,EAAG;IACnB,OAAOK,aAAA,CAACV,kBAAkB,MAAE,CAAC;EAC9B;EACA,OAAOU,aAAA,CAACT,gBAAgB,MAAE,CAAC;AAC5B;AAEA,eAAeG,UAAU"}
|
|
1
|
+
{"version":3,"names":["useSelect","store","coreStore","PostAuthorCombobox","PostAuthorSelect","AUTHORS_QUERY","minimumUsersForCombobox","PostAuthor","showCombobox","select","authors","getUsers","length","createElement"],"sources":["@wordpress/editor/src/components/post-author/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport PostAuthorCombobox from './combobox';\nimport PostAuthorSelect from './select';\nimport { AUTHORS_QUERY } from './constants';\n\nconst minimumUsersForCombobox = 25;\n\nfunction PostAuthor() {\n\tconst showCombobox = useSelect( ( select ) => {\n\t\tconst authors = select( coreStore ).getUsers( AUTHORS_QUERY );\n\n\t\treturn authors?.length >= minimumUsersForCombobox;\n\t}, [] );\n\n\tif ( showCombobox ) {\n\t\treturn <PostAuthorCombobox />;\n\t}\n\treturn <PostAuthorSelect />;\n}\n\nexport default PostAuthor;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,OAAOC,kBAAkB,MAAM,YAAY;AAC3C,OAAOC,gBAAgB,MAAM,UAAU;AACvC,SAASC,aAAa,QAAQ,aAAa;AAE3C,MAAMC,uBAAuB,GAAG,EAAE;AAElC,SAASC,UAAUA,CAAA,EAAG;EACrB,MAAMC,YAAY,GAAGR,SAAS,CAAIS,MAAM,IAAM;IAC7C,MAAMC,OAAO,GAAGD,MAAM,CAAEP,SAAU,CAAC,CAACS,QAAQ,CAAEN,aAAc,CAAC;IAE7D,OAAOK,OAAO,EAAEE,MAAM,IAAIN,uBAAuB;EAClD,CAAC,EAAE,EAAG,CAAC;EAEP,IAAKE,YAAY,EAAG;IACnB,OAAOK,aAAA,CAACV,kBAAkB,MAAE,CAAC;EAC9B;EACA,OAAOU,aAAA,CAACT,gBAAgB,MAAE,CAAC;AAC5B;AAEA,eAAeG,UAAU","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["PostAuthorCheck","PostAuthorForm","PostPanelRow","PostAuthor","createElement","className"],"sources":["@wordpress/editor/src/components/post-author/panel.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport PostAuthorCheck from './check';\nimport PostAuthorForm from './index';\nimport PostPanelRow from '../post-panel-row';\n\nexport function PostAuthor() {\n\treturn (\n\t\t<PostAuthorCheck>\n\t\t\t<PostPanelRow className=\"editor-post-author__panel\">\n\t\t\t\t<PostAuthorForm />\n\t\t\t</PostPanelRow>\n\t\t</PostAuthorCheck>\n\t);\n}\n\nexport default PostAuthor;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,eAAe,MAAM,SAAS;AACrC,OAAOC,cAAc,MAAM,SAAS;AACpC,OAAOC,YAAY,MAAM,mBAAmB;AAE5C,OAAO,SAASC,UAAUA,CAAA,EAAG;EAC5B,OACCC,aAAA,CAACJ,eAAe,QACfI,aAAA,CAACF,YAAY;IAACG,SAAS,EAAC;EAA2B,GAClDD,aAAA,CAACH,cAAc,MAAE,CACJ,CACE,CAAC;AAEpB;AAEA,eAAeE,UAAU"}
|
|
1
|
+
{"version":3,"names":["PostAuthorCheck","PostAuthorForm","PostPanelRow","PostAuthor","createElement","className"],"sources":["@wordpress/editor/src/components/post-author/panel.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport PostAuthorCheck from './check';\nimport PostAuthorForm from './index';\nimport PostPanelRow from '../post-panel-row';\n\nexport function PostAuthor() {\n\treturn (\n\t\t<PostAuthorCheck>\n\t\t\t<PostPanelRow className=\"editor-post-author__panel\">\n\t\t\t\t<PostAuthorForm />\n\t\t\t</PostPanelRow>\n\t\t</PostAuthorCheck>\n\t);\n}\n\nexport default PostAuthor;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,eAAe,MAAM,SAAS;AACrC,OAAOC,cAAc,MAAM,SAAS;AACpC,OAAOC,YAAY,MAAM,mBAAmB;AAE5C,OAAO,SAASC,UAAUA,CAAA,EAAG;EAC5B,OACCC,aAAA,CAACJ,eAAe,QACfI,aAAA,CAACF,YAAY;IAACG,SAAS,EAAC;EAA2B,GAClDD,aAAA,CAACH,cAAc,MAAE,CACJ,CACE,CAAC;AAEpB;AAEA,eAAeE,UAAU","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","useDispatch","SelectControl","store","editorStore","useAuthorsQuery","PostAuthorSelect","editPost","authorId","authorOptions","setAuthorId","value","author","Number","createElement","__next40pxDefaultSize","__nextHasNoMarginBottom","className","label","options","onChange"],"sources":["@wordpress/editor/src/components/post-author/select.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport { SelectControl } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { useAuthorsQuery } from './hook';\n\nexport default function PostAuthorSelect() {\n\tconst { editPost } = useDispatch( editorStore );\n\tconst { authorId, authorOptions } = useAuthorsQuery();\n\n\tconst setAuthorId = ( value ) => {\n\t\tconst author = Number( value );\n\t\teditPost( { author } );\n\t};\n\n\treturn (\n\t\t<SelectControl\n\t\t\t__next40pxDefaultSize\n\t\t\t__nextHasNoMarginBottom\n\t\t\tclassName=\"post-author-selector\"\n\t\t\tlabel={ __( 'Author' ) }\n\t\t\toptions={ authorOptions }\n\t\t\tonChange={ setAuthorId }\n\t\t\tvalue={ authorId }\n\t\t/>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,aAAa,QAAQ,uBAAuB;;AAErD;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAClD,SAASC,eAAe,QAAQ,QAAQ;AAExC,eAAe,SAASC,gBAAgBA,CAAA,EAAG;EAC1C,MAAM;IAAEC;EAAS,CAAC,GAAGN,WAAW,CAAEG,WAAY,CAAC;EAC/C,MAAM;IAAEI,QAAQ;IAAEC;EAAc,CAAC,GAAGJ,eAAe,CAAC,CAAC;EAErD,MAAMK,WAAW,GAAKC,KAAK,IAAM;IAChC,MAAMC,MAAM,GAAGC,MAAM,CAAEF,KAAM,CAAC;IAC9BJ,QAAQ,CAAE;MAAEK;IAAO,CAAE,CAAC;EACvB,CAAC;EAED,OACCE,aAAA,CAACZ,aAAa;IACba,qBAAqB;IACrBC,uBAAuB;IACvBC,SAAS,EAAC,sBAAsB;IAChCC,KAAK,EAAGlB,EAAE,CAAE,QAAS,CAAG;IACxBmB,OAAO,EAAGV,aAAe;IACzBW,QAAQ,EAAGV,WAAa;IACxBC,KAAK,EAAGH;EAAU,CAClB,CAAC;AAEJ"}
|
|
1
|
+
{"version":3,"names":["__","useDispatch","SelectControl","store","editorStore","useAuthorsQuery","PostAuthorSelect","editPost","authorId","authorOptions","setAuthorId","value","author","Number","createElement","__next40pxDefaultSize","__nextHasNoMarginBottom","className","label","options","onChange"],"sources":["@wordpress/editor/src/components/post-author/select.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport { SelectControl } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { useAuthorsQuery } from './hook';\n\nexport default function PostAuthorSelect() {\n\tconst { editPost } = useDispatch( editorStore );\n\tconst { authorId, authorOptions } = useAuthorsQuery();\n\n\tconst setAuthorId = ( value ) => {\n\t\tconst author = Number( value );\n\t\teditPost( { author } );\n\t};\n\n\treturn (\n\t\t<SelectControl\n\t\t\t__next40pxDefaultSize\n\t\t\t__nextHasNoMarginBottom\n\t\t\tclassName=\"post-author-selector\"\n\t\t\tlabel={ __( 'Author' ) }\n\t\t\toptions={ authorOptions }\n\t\t\tonChange={ setAuthorId }\n\t\t\tvalue={ authorId }\n\t\t/>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,aAAa,QAAQ,uBAAuB;;AAErD;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAClD,SAASC,eAAe,QAAQ,QAAQ;AAExC,eAAe,SAASC,gBAAgBA,CAAA,EAAG;EAC1C,MAAM;IAAEC;EAAS,CAAC,GAAGN,WAAW,CAAEG,WAAY,CAAC;EAC/C,MAAM;IAAEI,QAAQ;IAAEC;EAAc,CAAC,GAAGJ,eAAe,CAAC,CAAC;EAErD,MAAMK,WAAW,GAAKC,KAAK,IAAM;IAChC,MAAMC,MAAM,GAAGC,MAAM,CAAEF,KAAM,CAAC;IAC9BJ,QAAQ,CAAE;MAAEK;IAAO,CAAE,CAAC;EACvB,CAAC;EAED,OACCE,aAAA,CAACZ,aAAa;IACba,qBAAqB;IACrBC,uBAAuB;IACvBC,SAAS,EAAC,sBAAsB;IAChCC,KAAK,EAAGlB,EAAE,CAAE,QAAS,CAAG;IACxBmB,OAAO,EAAGV,aAAe;IACzBW,QAAQ,EAAGV,WAAa;IACxBC,KAAK,EAAGH;EAAU,CAClB,CAAC;AAEJ","ignoreList":[]}
|
|
@@ -10,15 +10,17 @@ import classnames from 'classnames';
|
|
|
10
10
|
import { Icon, __experimentalHStack as HStack, __experimentalVStack as VStack, __experimentalText as Text, PanelBody } from '@wordpress/components';
|
|
11
11
|
import { store as coreStore } from '@wordpress/core-data';
|
|
12
12
|
import { useSelect } from '@wordpress/data';
|
|
13
|
-
import { __, sprintf } from '@wordpress/i18n';
|
|
13
|
+
import { __, _x, _n, sprintf } from '@wordpress/i18n';
|
|
14
14
|
import { humanTimeDiff } from '@wordpress/date';
|
|
15
15
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
16
|
+
import { count as wordCount } from '@wordpress/wordcount';
|
|
17
|
+
import { useMemo } from '@wordpress/element';
|
|
16
18
|
|
|
17
19
|
/**
|
|
18
20
|
* Internal dependencies
|
|
19
21
|
*/
|
|
20
22
|
import { store as editorStore } from '../../store';
|
|
21
|
-
import { TEMPLATE_POST_TYPE } from '../../store/constants';
|
|
23
|
+
import { TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE } from '../../store/constants';
|
|
22
24
|
import { unlock } from '../../lock-unlock';
|
|
23
25
|
import TemplateAreas from '../template-areas';
|
|
24
26
|
export default function PostCardPanel({
|
|
@@ -30,7 +32,8 @@ export default function PostCardPanel({
|
|
|
30
32
|
title,
|
|
31
33
|
templateInfo,
|
|
32
34
|
icon,
|
|
33
|
-
postType
|
|
35
|
+
postType,
|
|
36
|
+
isPostsPage
|
|
34
37
|
} = useSelect(select => {
|
|
35
38
|
const {
|
|
36
39
|
getEditedPostAttribute,
|
|
@@ -39,8 +42,10 @@ export default function PostCardPanel({
|
|
|
39
42
|
__experimentalGetTemplateInfo
|
|
40
43
|
} = select(editorStore);
|
|
41
44
|
const {
|
|
42
|
-
getEditedEntityRecord
|
|
45
|
+
getEditedEntityRecord,
|
|
46
|
+
getEntityRecord
|
|
43
47
|
} = select(coreStore);
|
|
48
|
+
const siteSettings = getEntityRecord('root', 'site');
|
|
44
49
|
const _type = getCurrentPostType();
|
|
45
50
|
const _id = getCurrentPostId();
|
|
46
51
|
const _record = getEditedEntityRecord('postType', _type, _id);
|
|
@@ -53,13 +58,15 @@ export default function PostCardPanel({
|
|
|
53
58
|
templateInfo: _templateInfo,
|
|
54
59
|
icon: unlock(select(editorStore)).getPostIcon(_type, {
|
|
55
60
|
area: _record?.area
|
|
56
|
-
})
|
|
61
|
+
}),
|
|
62
|
+
isPostsPage: +_id === siteSettings?.page_for_posts
|
|
57
63
|
};
|
|
58
|
-
});
|
|
64
|
+
}, []);
|
|
59
65
|
const description = templateInfo?.description;
|
|
60
66
|
const lastEditedText = modified && sprintf(
|
|
61
67
|
// translators: %s: Human-readable time difference, e.g. "2 days ago".
|
|
62
68
|
__('Last edited %s.'), humanTimeDiff(modified));
|
|
69
|
+
const showPostContentInfo = !isPostsPage && ![TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE].includes(postType);
|
|
63
70
|
return createElement(PanelBody, null, createElement("div", {
|
|
64
71
|
className: classnames('editor-post-card-panel', className)
|
|
65
72
|
}, createElement(HStack, {
|
|
@@ -77,9 +84,36 @@ export default function PostCardPanel({
|
|
|
77
84
|
as: "h2"
|
|
78
85
|
}, title ? decodeEntities(title) : __('No Title')), actions), createElement(VStack, {
|
|
79
86
|
className: "editor-post-card-panel__content"
|
|
80
|
-
}, (description || lastEditedText) && createElement(VStack, {
|
|
87
|
+
}, (description || lastEditedText || showPostContentInfo) && createElement(VStack, {
|
|
81
88
|
className: "editor-post-card-panel__description",
|
|
82
89
|
spacing: 2
|
|
83
|
-
}, description && createElement(Text, null, description), lastEditedText && createElement(Text, null, lastEditedText)), postType === TEMPLATE_POST_TYPE && createElement(TemplateAreas, null))));
|
|
90
|
+
}, description && createElement(Text, null, description), showPostContentInfo && createElement(PostContentInfo, null), lastEditedText && createElement(Text, null, lastEditedText)), postType === TEMPLATE_POST_TYPE && createElement(TemplateAreas, null))));
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// Taken from packages/editor/src/components/time-to-read/index.js.
|
|
94
|
+
const AVERAGE_READING_RATE = 189;
|
|
95
|
+
|
|
96
|
+
// This component renders the wordcount and reading time for the post.
|
|
97
|
+
function PostContentInfo() {
|
|
98
|
+
const postContent = useSelect(select => select(editorStore).getEditedPostAttribute('content'), []);
|
|
99
|
+
/*
|
|
100
|
+
* translators: If your word count is based on single characters (e.g. East Asian characters),
|
|
101
|
+
* enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.
|
|
102
|
+
* Do not translate into your own language.
|
|
103
|
+
*/
|
|
104
|
+
const wordCountType = _x('words', 'Word count type. Do not translate!');
|
|
105
|
+
const wordsCounted = useMemo(() => postContent ? wordCount(postContent, wordCountType) : 0, [postContent, wordCountType]);
|
|
106
|
+
if (!wordsCounted) {
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
const readingTime = Math.round(wordsCounted / AVERAGE_READING_RATE);
|
|
110
|
+
const wordsCountText = sprintf(
|
|
111
|
+
// translators: %s: the number of words in the post.
|
|
112
|
+
_n('%s word', '%s words', wordsCounted), wordsCounted.toLocaleString());
|
|
113
|
+
const minutesText = readingTime <= 1 ? __('1 minute') : sprintf(
|
|
114
|
+
// translators: %s: the number of minutes to read the post.
|
|
115
|
+
_n('%s minute', '%s minutes', readingTime), readingTime.toLocaleString());
|
|
116
|
+
return createElement(Text, null, sprintf( /* translators: 1: How many words a post has. 2: the number of minutes to read the post (e.g. 130 words, 2 minutes read time.) */
|
|
117
|
+
__('%1$s, %2$s read time.'), wordsCountText, minutesText));
|
|
84
118
|
}
|
|
85
119
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["classnames","Icon","__experimentalHStack","HStack","__experimentalVStack","VStack","__experimentalText","Text","PanelBody","store","coreStore","useSelect","__","sprintf","humanTimeDiff","decodeEntities","editorStore","TEMPLATE_POST_TYPE","unlock","TemplateAreas","PostCardPanel","className","actions","modified","title","templateInfo","icon","postType","select","getEditedPostAttribute","getCurrentPostType","getCurrentPostId","__experimentalGetTemplateInfo","getEditedEntityRecord","_type","_id","_record","_templateInfo","id","getPostIcon","area","description","lastEditedText","createElement","spacing","align","numberOfLines","truncate","weight","as"],"sources":["@wordpress/editor/src/components/post-card-panel/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tIcon,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalText as Text,\n\tPanelBody,\n} from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { humanTimeDiff } from '@wordpress/date';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { TEMPLATE_POST_TYPE } from '../../store/constants';\nimport { unlock } from '../../lock-unlock';\nimport TemplateAreas from '../template-areas';\n\nexport default function PostCardPanel( { className, actions } ) {\n\tconst { modified, title, templateInfo, icon, postType } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetEditedPostAttribute,\n\t\t\t\tgetCurrentPostType,\n\t\t\t\tgetCurrentPostId,\n\t\t\t\t__experimentalGetTemplateInfo,\n\t\t\t} = select( editorStore );\n\t\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\t\tconst _type = getCurrentPostType();\n\t\t\tconst _id = getCurrentPostId();\n\t\t\tconst _record = getEditedEntityRecord( 'postType', _type, _id );\n\t\t\tconst _templateInfo = __experimentalGetTemplateInfo( _record );\n\t\t\treturn {\n\t\t\t\ttitle:\n\t\t\t\t\t_templateInfo?.title || getEditedPostAttribute( 'title' ),\n\t\t\t\tmodified: getEditedPostAttribute( 'modified' ),\n\t\t\t\tid: _id,\n\t\t\t\tpostType: _type,\n\t\t\t\ttemplateInfo: _templateInfo,\n\t\t\t\ticon: unlock( select( editorStore ) ).getPostIcon( _type, {\n\t\t\t\t\tarea: _record?.area,\n\t\t\t\t} ),\n\t\t\t};\n\t\t}\n\t);\n\tconst description = templateInfo?.description;\n\tconst lastEditedText =\n\t\tmodified &&\n\t\tsprintf(\n\t\t\t// translators: %s: Human-readable time difference, e.g. \"2 days ago\".\n\t\t\t__( 'Last edited %s.' ),\n\t\t\thumanTimeDiff( modified )\n\t\t);\n\n\treturn (\n\t\t<PanelBody>\n\t\t\t<div\n\t\t\t\tclassName={ classnames( 'editor-post-card-panel', className ) }\n\t\t\t>\n\t\t\t\t<HStack\n\t\t\t\t\tspacing={ 2 }\n\t\t\t\t\tclassName=\"editor-post-card-panel__header\"\n\t\t\t\t\talign=\"flex-start\"\n\t\t\t\t>\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tclassName=\"editor-post-card-panel__icon\"\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t/>\n\t\t\t\t\t<Text\n\t\t\t\t\t\tnumberOfLines={ 2 }\n\t\t\t\t\t\ttruncate\n\t\t\t\t\t\tclassName=\"editor-post-card-panel__title\"\n\t\t\t\t\t\tweight={ 500 }\n\t\t\t\t\t\tas=\"h2\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ title ? decodeEntities( title ) : __( 'No Title' ) }\n\t\t\t\t\t</Text>\n\t\t\t\t\t{ actions }\n\t\t\t\t</HStack>\n\t\t\t\t<VStack className=\"editor-post-card-panel__content\">\n\t\t\t\t\t{ ( description || lastEditedText ) && (\n\t\t\t\t\t\t<VStack\n\t\t\t\t\t\t\tclassName=\"editor-post-card-panel__description\"\n\t\t\t\t\t\t\tspacing={ 2 }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ description && <Text>{ description }</Text> }\n\t\t\t\t\t\t\t{ lastEditedText && (\n\t\t\t\t\t\t\t\t<Text>{ lastEditedText }</Text>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t) }\n\t\t\t\t\t{ postType === TEMPLATE_POST_TYPE && <TemplateAreas /> }\n\t\t\t\t</VStack>\n\t\t\t</div>\n\t\t</PanelBody>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA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AA,CAACpC,IAAI,QAAGmC,cAAsB,CAExB,CACR,EACCf,QAAQ,KAAKV,kBAAkB,IAAI0B,aAAA,CAACxB,aAAa,MAAE,CAC9C,CACJ,CACK,CAAC;AAEd"}
|
|
1
|
+
{"version":3,"names":["classnames","Icon","__experimentalHStack","HStack","__experimentalVStack","VStack","__experimentalText","Text","PanelBody","store","coreStore","useSelect","__","_x","_n","sprintf","humanTimeDiff","decodeEntities","count","wordCount","useMemo","editorStore","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","unlock","TemplateAreas","PostCardPanel","className","actions","modified","title","templateInfo","icon","postType","isPostsPage","select","getEditedPostAttribute","getCurrentPostType","getCurrentPostId","__experimentalGetTemplateInfo","getEditedEntityRecord","getEntityRecord","siteSettings","_type","_id","_record","_templateInfo","id","getPostIcon","area","page_for_posts","description","lastEditedText","showPostContentInfo","includes","createElement","spacing","align","numberOfLines","truncate","weight","as","PostContentInfo","AVERAGE_READING_RATE","postContent","wordCountType","wordsCounted","readingTime","Math","round","wordsCountText","toLocaleString","minutesText"],"sources":["@wordpress/editor/src/components/post-card-panel/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tIcon,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalText as Text,\n\tPanelBody,\n} from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { __, _x, _n, sprintf } from '@wordpress/i18n';\nimport { humanTimeDiff } from '@wordpress/date';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { count as wordCount } from '@wordpress/wordcount';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n} from '../../store/constants';\nimport { unlock } from '../../lock-unlock';\nimport TemplateAreas from '../template-areas';\n\nexport default function PostCardPanel( { className, actions } ) {\n\tconst { modified, title, templateInfo, icon, postType, isPostsPage } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst {\n\t\t\t\tgetEditedPostAttribute,\n\t\t\t\tgetCurrentPostType,\n\t\t\t\tgetCurrentPostId,\n\t\t\t\t__experimentalGetTemplateInfo,\n\t\t\t} = select( editorStore );\n\t\t\tconst { getEditedEntityRecord, getEntityRecord } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst siteSettings = getEntityRecord( 'root', 'site' );\n\t\t\tconst _type = getCurrentPostType();\n\t\t\tconst _id = getCurrentPostId();\n\t\t\tconst _record = getEditedEntityRecord( 'postType', _type, _id );\n\t\t\tconst _templateInfo = __experimentalGetTemplateInfo( _record );\n\t\t\treturn {\n\t\t\t\ttitle:\n\t\t\t\t\t_templateInfo?.title || getEditedPostAttribute( 'title' ),\n\t\t\t\tmodified: getEditedPostAttribute( 'modified' ),\n\t\t\t\tid: _id,\n\t\t\t\tpostType: _type,\n\t\t\t\ttemplateInfo: _templateInfo,\n\t\t\t\ticon: unlock( select( editorStore ) ).getPostIcon( _type, {\n\t\t\t\t\tarea: _record?.area,\n\t\t\t\t} ),\n\t\t\t\tisPostsPage: +_id === siteSettings?.page_for_posts,\n\t\t\t};\n\t\t}, [] );\n\tconst description = templateInfo?.description;\n\tconst lastEditedText =\n\t\tmodified &&\n\t\tsprintf(\n\t\t\t// translators: %s: Human-readable time difference, e.g. \"2 days ago\".\n\t\t\t__( 'Last edited %s.' ),\n\t\t\thumanTimeDiff( modified )\n\t\t);\n\tconst showPostContentInfo =\n\t\t! isPostsPage &&\n\t\t! [ TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE ].includes( postType );\n\treturn (\n\t\t<PanelBody>\n\t\t\t<div\n\t\t\t\tclassName={ classnames( 'editor-post-card-panel', className ) }\n\t\t\t>\n\t\t\t\t<HStack\n\t\t\t\t\tspacing={ 2 }\n\t\t\t\t\tclassName=\"editor-post-card-panel__header\"\n\t\t\t\t\talign=\"flex-start\"\n\t\t\t\t>\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tclassName=\"editor-post-card-panel__icon\"\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t/>\n\t\t\t\t\t<Text\n\t\t\t\t\t\tnumberOfLines={ 2 }\n\t\t\t\t\t\ttruncate\n\t\t\t\t\t\tclassName=\"editor-post-card-panel__title\"\n\t\t\t\t\t\tweight={ 500 }\n\t\t\t\t\t\tas=\"h2\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ title ? decodeEntities( title ) : __( 'No Title' ) }\n\t\t\t\t\t</Text>\n\t\t\t\t\t{ actions }\n\t\t\t\t</HStack>\n\t\t\t\t<VStack className=\"editor-post-card-panel__content\">\n\t\t\t\t\t{ ( description ||\n\t\t\t\t\t\tlastEditedText ||\n\t\t\t\t\t\tshowPostContentInfo ) && (\n\t\t\t\t\t\t<VStack\n\t\t\t\t\t\t\tclassName=\"editor-post-card-panel__description\"\n\t\t\t\t\t\t\tspacing={ 2 }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ description && <Text>{ description }</Text> }\n\t\t\t\t\t\t\t{ showPostContentInfo && <PostContentInfo /> }\n\t\t\t\t\t\t\t{ lastEditedText && (\n\t\t\t\t\t\t\t\t<Text>{ lastEditedText }</Text>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t) }\n\t\t\t\t\t{ postType === TEMPLATE_POST_TYPE && <TemplateAreas /> }\n\t\t\t\t</VStack>\n\t\t\t</div>\n\t\t</PanelBody>\n\t);\n}\n\n// Taken from packages/editor/src/components/time-to-read/index.js.\nconst AVERAGE_READING_RATE = 189;\n\n// This component renders the wordcount and reading time for the post.\nfunction PostContentInfo() {\n\tconst postContent = useSelect(\n\t\t( select ) => select( editorStore ).getEditedPostAttribute( 'content' ),\n\t\t[]\n\t);\n\t/*\n\t * translators: If your word count is based on single characters (e.g. East Asian characters),\n\t * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.\n\t * Do not translate into your own language.\n\t */\n\tconst wordCountType = _x( 'words', 'Word count type. Do not translate!' );\n\tconst wordsCounted = useMemo(\n\t\t() => ( postContent ? wordCount( postContent, wordCountType ) : 0 ),\n\t\t[ postContent, wordCountType ]\n\t);\n\tif ( ! wordsCounted ) {\n\t\treturn null;\n\t}\n\tconst readingTime = Math.round( wordsCounted / AVERAGE_READING_RATE );\n\tconst wordsCountText = sprintf(\n\t\t// translators: %s: the number of words in the post.\n\t\t_n( '%s word', '%s words', wordsCounted ),\n\t\twordsCounted.toLocaleString()\n\t);\n\tconst minutesText =\n\t\treadingTime <= 1\n\t\t\t? __( '1 minute' )\n\t\t\t: sprintf(\n\t\t\t\t\t// translators: %s: the number of minutes to read the post.\n\t\t\t\t\t_n( '%s minute', '%s minutes', readingTime ),\n\t\t\t\t\treadingTime.toLocaleString()\n\t\t\t );\n\treturn (\n\t\t<Text>\n\t\t\t{ sprintf(\n\t\t\t\t/* translators: 1: How many words a post has. 2: the number of minutes to read the post (e.g. 130 words, 2 minutes read time.) */\n\t\t\t\t__( '%1$s, %2$s read time.' ),\n\t\t\t\twordsCountText,\n\t\t\t\tminutesText\n\t\t\t) }\n\t\t</Text>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SACCC,IAAI,EACJC,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,EAC9BC,kBAAkB,IAAIC,IAAI,EAC1BC,SAAS,QACH,uBAAuB;AAC9B,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,EAAE,EAAEC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACrD,SAASC,aAAa,QAAQ,iBAAiB;AAC/C,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC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AO,EACR;EACAH,EAAE,CAAE,uBAAwB,CAAC,EAC7B0D,cAAc,EACdE,WACD,CACK,CAAC;AAET","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","CheckboxControl","useDispatch","useSelect","store","editorStore","PostComments","commentStatus","select","_select$getEditedPost","getEditedPostAttribute","editPost","onToggleComments","comment_status","createElement","__nextHasNoMarginBottom","label","checked","onChange"],"sources":["@wordpress/editor/src/components/post-comments/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { CheckboxControl } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction PostComments() {\n\tconst commentStatus = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getEditedPostAttribute( 'comment_status' ) ??\n\t\t\t'open',\n\t\t[]\n\t);\n\tconst { editPost } = useDispatch( editorStore );\n\tconst onToggleComments = () =>\n\t\teditPost( {\n\t\t\tcomment_status: commentStatus === 'open' ? 'closed' : 'open',\n\t\t} );\n\n\treturn (\n\t\t<CheckboxControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\tlabel={ __( 'Allow comments' ) }\n\t\t\tchecked={ commentStatus === 'open' }\n\t\t\tonChange={ onToggleComments }\n\t\t/>\n\t);\n}\n\nexport default PostComments;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,eAAe,QAAQ,uBAAuB;AACvD,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;;AAExD;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAElD,SAASC,YAAYA,CAAA,EAAG;EACvB,MAAMC,aAAa,GAAGJ,SAAS,CAC5BK,MAAM;IAAA,IAAAC,qBAAA;IAAA,QAAAA,qBAAA,GACPD,MAAM,CAAEH,WAAY,CAAC,CAACK,sBAAsB,CAAE,gBAAiB,CAAC,cAAAD,qBAAA,cAAAA,qBAAA,GAChE,MAAM;EAAA,GACP,EACD,CAAC;EACD,MAAM;IAAEE;EAAS,CAAC,GAAGT,WAAW,CAAEG,WAAY,CAAC;EAC/C,MAAMO,gBAAgB,GAAGA,CAAA,KACxBD,QAAQ,CAAE;IACTE,cAAc,EAAEN,aAAa,KAAK,MAAM,GAAG,QAAQ,GAAG;EACvD,CAAE,CAAC;EAEJ,OACCO,aAAA,CAACb,eAAe;IACfc,uBAAuB;IACvBC,KAAK,EAAGhB,EAAE,CAAE,gBAAiB,CAAG;IAChCiB,OAAO,EAAGV,aAAa,KAAK,MAAQ;IACpCW,QAAQ,EAAGN;EAAkB,CAC7B,CAAC;AAEJ;AAEA,eAAeN,YAAY"}
|
|
1
|
+
{"version":3,"names":["__","CheckboxControl","useDispatch","useSelect","store","editorStore","PostComments","commentStatus","select","_select$getEditedPost","getEditedPostAttribute","editPost","onToggleComments","comment_status","createElement","__nextHasNoMarginBottom","label","checked","onChange"],"sources":["@wordpress/editor/src/components/post-comments/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { CheckboxControl } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction PostComments() {\n\tconst commentStatus = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getEditedPostAttribute( 'comment_status' ) ??\n\t\t\t'open',\n\t\t[]\n\t);\n\tconst { editPost } = useDispatch( editorStore );\n\tconst onToggleComments = () =>\n\t\teditPost( {\n\t\t\tcomment_status: commentStatus === 'open' ? 'closed' : 'open',\n\t\t} );\n\n\treturn (\n\t\t<CheckboxControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\tlabel={ __( 'Allow comments' ) }\n\t\t\tchecked={ commentStatus === 'open' }\n\t\t\tonChange={ onToggleComments }\n\t\t/>\n\t);\n}\n\nexport default PostComments;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,eAAe,QAAQ,uBAAuB;AACvD,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;;AAExD;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAElD,SAASC,YAAYA,CAAA,EAAG;EACvB,MAAMC,aAAa,GAAGJ,SAAS,CAC5BK,MAAM;IAAA,IAAAC,qBAAA;IAAA,QAAAA,qBAAA,GACPD,MAAM,CAAEH,WAAY,CAAC,CAACK,sBAAsB,CAAE,gBAAiB,CAAC,cAAAD,qBAAA,cAAAA,qBAAA,GAChE,MAAM;EAAA,GACP,EACD,CAAC;EACD,MAAM;IAAEE;EAAS,CAAC,GAAGT,WAAW,CAAEG,WAAY,CAAC;EAC/C,MAAMO,gBAAgB,GAAGA,CAAA,KACxBD,QAAQ,CAAE;IACTE,cAAc,EAAEN,aAAa,KAAK,MAAM,GAAG,QAAQ,GAAG;EACvD,CAAE,CAAC;EAEJ,OACCO,aAAA,CAACb,eAAe;IACfc,uBAAuB;IACvBC,KAAK,EAAGhB,EAAE,CAAE,gBAAiB,CAAG;IAChCiB,OAAO,EAAGV,aAAa,KAAK,MAAQ;IACpCW,QAAQ,EAAGN;EAAkB,CAC7B,CAAC;AAEJ;AAEA,eAAeN,YAAY","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","PanelBody","PanelRow","useDispatch","useSelect","store","editorStore","PostTypeSupportCheck","PostComments","PostPingbacks","PANEL_NAME","PostDiscussionPanel","isEnabled","isOpened","select","isEditorPanelEnabled","isEditorPanelOpened","toggleEditorPanelOpened","createElement","supportKeys","title","opened","onToggle"],"sources":["@wordpress/editor/src/components/post-discussion/panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { PanelBody, PanelRow } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport PostTypeSupportCheck from '../post-type-support-check';\nimport PostComments from '../post-comments';\nimport PostPingbacks from '../post-pingbacks';\n\nconst PANEL_NAME = 'discussion-panel';\n\nfunction PostDiscussionPanel() {\n\tconst { isEnabled, isOpened } = useSelect( ( select ) => {\n\t\tconst { isEditorPanelEnabled, isEditorPanelOpened } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\tisEnabled: isEditorPanelEnabled( PANEL_NAME ),\n\t\t\tisOpened: isEditorPanelOpened( PANEL_NAME ),\n\t\t};\n\t}, [] );\n\n\tconst { toggleEditorPanelOpened } = useDispatch( editorStore );\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PostTypeSupportCheck supportKeys={ [ 'comments', 'trackbacks' ] }>\n\t\t\t<PanelBody\n\t\t\t\ttitle={ __( 'Discussion' ) }\n\t\t\t\topened={ isOpened }\n\t\t\t\tonToggle={ () => toggleEditorPanelOpened( PANEL_NAME ) }\n\t\t\t>\n\t\t\t\t<PostTypeSupportCheck supportKeys=\"comments\">\n\t\t\t\t\t<PanelRow>\n\t\t\t\t\t\t<PostComments />\n\t\t\t\t\t</PanelRow>\n\t\t\t\t</PostTypeSupportCheck>\n\n\t\t\t\t<PostTypeSupportCheck supportKeys=\"trackbacks\">\n\t\t\t\t\t<PanelRow>\n\t\t\t\t\t\t<PostPingbacks />\n\t\t\t\t\t</PanelRow>\n\t\t\t\t</PostTypeSupportCheck>\n\t\t\t</PanelBody>\n\t\t</PostTypeSupportCheck>\n\t);\n}\n\nexport default PostDiscussionPanel;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,EAAEC,QAAQ,QAAQ,uBAAuB;AAC3D,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;;AAExD;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WA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ck","PostComments","PostPingbacks","PANEL_NAME","PostDiscussionPanel","isEnabled","isOpened","select","isEditorPanelEnabled","isEditorPanelOpened","toggleEditorPanelOpened","createElement","supportKeys","title","opened","onToggle"],"sources":["@wordpress/editor/src/components/post-discussion/panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { PanelBody, PanelRow } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport PostTypeSupportCheck from '../post-type-support-check';\nimport PostComments from '../post-comments';\nimport PostPingbacks from '../post-pingbacks';\n\nconst PANEL_NAME = 'discussion-panel';\n\nfunction PostDiscussionPanel() {\n\tconst { isEnabled, isOpened } = useSelect( ( select ) => {\n\t\tconst { isEditorPanelEnabled, isEditorPanelOpened } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\tisEnabled: isEditorPanelEnabled( PANEL_NAME ),\n\t\t\tisOpened: isEditorPanelOpened( PANEL_NAME ),\n\t\t};\n\t}, [] );\n\n\tconst { toggleEditorPanelOpened } = useDispatch( editorStore );\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PostTypeSupportCheck supportKeys={ [ 'comments', 'trackbacks' ] }>\n\t\t\t<PanelBody\n\t\t\t\ttitle={ __( 'Discussion' ) }\n\t\t\t\topened={ isOpened }\n\t\t\t\tonToggle={ () => toggleEditorPanelOpened( PANEL_NAME ) }\n\t\t\t>\n\t\t\t\t<PostTypeSupportCheck supportKeys=\"comments\">\n\t\t\t\t\t<PanelRow>\n\t\t\t\t\t\t<PostComments />\n\t\t\t\t\t</PanelRow>\n\t\t\t\t</PostTypeSupportCheck>\n\n\t\t\t\t<PostTypeSupportCheck supportKeys=\"trackbacks\">\n\t\t\t\t\t<PanelRow>\n\t\t\t\t\t\t<PostPingbacks />\n\t\t\t\t\t</PanelRow>\n\t\t\t\t</PostTypeSupportCheck>\n\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,MAAE,CACN,CACW,CAAC,EAEvBU,aAAA,CAACX,oBAAoB;IAACY,WAAW,EAAC;EAAY,GAC7CD,aAAA,CAAChB,QAAQ,QACRgB,aAAA,CAACT,aAAa,MAAE,CACP,CACW,CACZ,CACU,CAAC;AAEzB;AAEA,eAAeE,mBAAmB","ignoreList":[]}
|
|
@@ -9,6 +9,15 @@ import { useSelect } from '@wordpress/data';
|
|
|
9
9
|
*/
|
|
10
10
|
import PostTypeSupportCheck from '../post-type-support-check';
|
|
11
11
|
import { store as editorStore } from '../../store';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Component for checking if the post type supports the excerpt field.
|
|
15
|
+
*
|
|
16
|
+
* @param {Object} props Props.
|
|
17
|
+
* @param {Element} props.children Children to be rendered.
|
|
18
|
+
*
|
|
19
|
+
* @return {Component} The component to be rendered.
|
|
20
|
+
*/
|
|
12
21
|
function PostExcerptCheck({
|
|
13
22
|
children
|
|
14
23
|
}) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSelect","PostTypeSupportCheck","store","editorStore","PostExcerptCheck","children","postType","select","getEditedPostAttribute","includes","createElement","supportKeys"],"sources":["@wordpress/editor/src/components/post-excerpt/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport PostTypeSupportCheck from '../post-type-support-check';\nimport { store as editorStore } from '../../store';\n\nfunction PostExcerptCheck( { children } ) {\n\tconst postType = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute } = select( editorStore );\n\t\treturn getEditedPostAttribute( 'type' );\n\t}, [] );\n\n\t// This special case is unfortunate, but the REST API of wp_template and wp_template_part\n\t// support the excerpt field throught the \"description\" field rather than \"excerpt\" which means\n\t// the default ExcerptPanel won't work for these.\n\tif ( [ 'wp_template', 'wp_template_part' ].includes( postType ) ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PostTypeSupportCheck supportKeys=\"excerpt\">\n\t\t\t{ children }\n\t\t</PostTypeSupportCheck>\n\t);\n}\n\nexport default PostExcerptCheck;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,4BAA4B;AAC7D,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;
|
|
1
|
+
{"version":3,"names":["useSelect","PostTypeSupportCheck","store","editorStore","PostExcerptCheck","children","postType","select","getEditedPostAttribute","includes","createElement","supportKeys"],"sources":["@wordpress/editor/src/components/post-excerpt/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport PostTypeSupportCheck from '../post-type-support-check';\nimport { store as editorStore } from '../../store';\n\n/**\n * Component for checking if the post type supports the excerpt field.\n *\n * @param {Object} props Props.\n * @param {Element} props.children Children to be rendered.\n *\n * @return {Component} The component to be rendered.\n */\nfunction PostExcerptCheck( { children } ) {\n\tconst postType = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute } = select( editorStore );\n\t\treturn getEditedPostAttribute( 'type' );\n\t}, [] );\n\n\t// This special case is unfortunate, but the REST API of wp_template and wp_template_part\n\t// support the excerpt field throught the \"description\" field rather than \"excerpt\" which means\n\t// the default ExcerptPanel won't work for these.\n\tif ( [ 'wp_template', 'wp_template_part' ].includes( postType ) ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PostTypeSupportCheck supportKeys=\"excerpt\">\n\t\t\t{ children }\n\t\t</PostTypeSupportCheck>\n\t);\n}\n\nexport default PostExcerptCheck;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,4BAA4B;AAC7D,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,gBAAgBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACzC,MAAMC,QAAQ,GAAGN,SAAS,CAAIO,MAAM,IAAM;IACzC,MAAM;MAAEC;IAAuB,CAAC,GAAGD,MAAM,CAAEJ,WAAY,CAAC;IACxD,OAAOK,sBAAsB,CAAE,MAAO,CAAC;EACxC,CAAC,EAAE,EAAG,CAAC;;EAEP;EACA;EACA;EACA,IAAK,CAAE,aAAa,EAAE,kBAAkB,CAAE,CAACC,QAAQ,CAAEH,QAAS,CAAC,EAAG;IACjE,OAAO,IAAI;EACZ;EAEA,OACCI,aAAA,CAACT,oBAAoB;IAACU,WAAW,EAAC;EAAS,GACxCN,QACmB,CAAC;AAEzB;AAEA,eAAeD,gBAAgB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","ExternalLink","TextareaControl","useDispatch","useSelect","store","editorStore","PostExcerpt","excerpt","select","getEditedPostAttribute","editPost","createElement","className","__nextHasNoMarginBottom","label","onChange","value","href"],"sources":["@wordpress/editor/src/components/post-excerpt/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { ExternalLink, TextareaControl } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction PostExcerpt() {\n\tconst excerpt = useSelect(\n\t\t( select ) => select( editorStore ).getEditedPostAttribute( 'excerpt' ),\n\t\t[]\n\t);\n\tconst { editPost } = useDispatch( editorStore );\n\n\treturn (\n\t\t<div className=\"editor-post-excerpt\">\n\t\t\t<TextareaControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tlabel={ __( 'Write an excerpt (optional)' ) }\n\t\t\t\tclassName=\"editor-post-excerpt__textarea\"\n\t\t\t\tonChange={ ( value ) => editPost( { excerpt: value } ) }\n\t\t\t\tvalue={ excerpt }\n\t\t\t/>\n\t\t\t<ExternalLink\n\t\t\t\thref={ __(\n\t\t\t\t\t'https://wordpress.org/documentation/article/page-post-settings-sidebar/#excerpt'\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t{ __( 'Learn more about manual excerpts' ) }\n\t\t\t</ExternalLink>\n\t\t</div>\n\t);\n}\n\nexport default PostExcerpt;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,YAAY,EAAEC,eAAe,QAAQ,uBAAuB;AACrE,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;;AAExD;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAElD,SAASC,WAAWA,CAAA,EAAG;EACtB,MAAMC,OAAO,GAAGJ,SAAS,CACtBK,MAAM,IAAMA,MAAM,CAAEH,WAAY,CAAC,CAACI,sBAAsB,CAAE,SAAU,CAAC,EACvE,EACD,CAAC;EACD,MAAM;IAAEC;EAAS,CAAC,GAAGR,WAAW,CAAEG,WAAY,CAAC;EAE/C,OACCM,aAAA;IAAKC,SAAS,EAAC;EAAqB,GACnCD,aAAA,CAACV,eAAe;IACfY,uBAAuB;IACvBC,KAAK,EAAGf,EAAE,CAAE,6BAA8B,CAAG;IAC7Ca,SAAS,EAAC,+BAA+B;IACzCG,QAAQ,EAAKC,KAAK,IAAMN,QAAQ,CAAE;MAAEH,OAAO,EAAES;IAAM,CAAE,CAAG;IACxDA,KAAK,EAAGT;EAAS,CACjB,CAAC,EACFI,aAAA,CAACX,YAAY;IACZiB,IAAI,EAAGlB,EAAE,CACR,iFACD;EAAG,GAEDA,EAAE,CAAE,kCAAmC,CAC5B,CACV,CAAC;AAER;AAEA,eAAeO,WAAW"}
|
|
1
|
+
{"version":3,"names":["__","ExternalLink","TextareaControl","useDispatch","useSelect","store","editorStore","PostExcerpt","excerpt","select","getEditedPostAttribute","editPost","createElement","className","__nextHasNoMarginBottom","label","onChange","value","href"],"sources":["@wordpress/editor/src/components/post-excerpt/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { ExternalLink, TextareaControl } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction PostExcerpt() {\n\tconst excerpt = useSelect(\n\t\t( select ) => select( editorStore ).getEditedPostAttribute( 'excerpt' ),\n\t\t[]\n\t);\n\tconst { editPost } = useDispatch( editorStore );\n\n\treturn (\n\t\t<div className=\"editor-post-excerpt\">\n\t\t\t<TextareaControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tlabel={ __( 'Write an excerpt (optional)' ) }\n\t\t\t\tclassName=\"editor-post-excerpt__textarea\"\n\t\t\t\tonChange={ ( value ) => editPost( { excerpt: value } ) }\n\t\t\t\tvalue={ excerpt }\n\t\t\t/>\n\t\t\t<ExternalLink\n\t\t\t\thref={ __(\n\t\t\t\t\t'https://wordpress.org/documentation/article/page-post-settings-sidebar/#excerpt'\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t{ __( 'Learn more about manual excerpts' ) }\n\t\t\t</ExternalLink>\n\t\t</div>\n\t);\n}\n\nexport default PostExcerpt;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,YAAY,EAAEC,eAAe,QAAQ,uBAAuB;AACrE,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;;AAExD;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAElD,SAASC,WAAWA,CAAA,EAAG;EACtB,MAAMC,OAAO,GAAGJ,SAAS,CACtBK,MAAM,IAAMA,MAAM,CAAEH,WAAY,CAAC,CAACI,sBAAsB,CAAE,SAAU,CAAC,EACvE,EACD,CAAC;EACD,MAAM;IAAEC;EAAS,CAAC,GAAGR,WAAW,CAAEG,WAAY,CAAC;EAE/C,OACCM,aAAA;IAAKC,SAAS,EAAC;EAAqB,GACnCD,aAAA,CAACV,eAAe;IACfY,uBAAuB;IACvBC,KAAK,EAAGf,EAAE,CAAE,6BAA8B,CAAG;IAC7Ca,SAAS,EAAC,+BAA+B;IACzCG,QAAQ,EAAKC,KAAK,IAAMN,QAAQ,CAAE;MAAEH,OAAO,EAAES;IAAM,CAAE,CAAG;IACxDA,KAAK,EAAGT;EAAS,CACjB,CAAC,EACFI,aAAA,CAACX,YAAY;IACZiB,IAAI,EAAGlB,EAAE,CACR,iFACD;EAAG,GAEDA,EAAE,CAAE,kCAAmC,CAC5B,CACV,CAAC;AAER;AAEA,eAAeO,WAAW","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","PanelBody","useDispatch","useSelect","PostExcerptForm","PostExcerptCheck","PluginPostExcerpt","store","editorStore","PANEL_NAME","PostExcerptPanel","isOpened","isEnabled","select","isEditorPanelOpened","isEditorPanelEnabled","toggleEditorPanelOpened","toggleExcerptPanel","createElement","title","opened","onToggle","Slot","fills","Fragment"],"sources":["@wordpress/editor/src/components/post-excerpt/panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { PanelBody } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport PostExcerptForm from './index';\nimport PostExcerptCheck from './check';\nimport PluginPostExcerpt from './plugin';\nimport { store as editorStore } from '../../store';\n\n/**\n * Module Constants\n */\nconst PANEL_NAME = 'post-excerpt';\n\nexport default function PostExcerptPanel() {\n\tconst { isOpened, isEnabled } = useSelect( ( select ) => {\n\t\tconst { isEditorPanelOpened, isEditorPanelEnabled } =\n\t\t\tselect( editorStore );\n\n\t\treturn {\n\t\t\tisOpened: isEditorPanelOpened( PANEL_NAME ),\n\t\t\tisEnabled: isEditorPanelEnabled( PANEL_NAME ),\n\t\t};\n\t}, [] );\n\n\tconst { toggleEditorPanelOpened } = useDispatch( editorStore );\n\tconst toggleExcerptPanel = () => toggleEditorPanelOpened( PANEL_NAME );\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PostExcerptCheck>\n\t\t\t<PanelBody\n\t\t\t\ttitle={ __( 'Excerpt' ) }\n\t\t\t\topened={ isOpened }\n\t\t\t\tonToggle={ toggleExcerptPanel }\n\t\t\t>\n\t\t\t\t<PluginPostExcerpt.Slot>\n\t\t\t\t\t{ ( fills ) => (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<PostExcerptForm />\n\t\t\t\t\t\t\t{ fills }\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</PluginPostExcerpt.Slot>\n\t\t\t</PanelBody>\n\t\t</PostExcerptCheck>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,uBAAuB;AACjD,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;;AAExD;AACA;AACA;AACA,OAAOC,eAAe,MAAM,SAAS;AACrC,OAAOC,gBAAgB,MAAM,SAAS;AACtC,OAAOC,iBAAiB,MAAM,UAAU;AACxC,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA,MAAMC,UAAU,GAAG,cAAc;AAEjC,eAAe,SAASC,gBAAgBA,CAAA,EAAG;EAC1C,MAAM;IAAEC,QAAQ;IAAEC;EAAU,CAAC,GAAGT,SAAS,CAAIU,MAAM,IAAM;IACxD,MAAM;MAAEC,mBAAmB;MAAEC;IAAqB,CAAC,GAClDF,MAAM,CAAEL,WAAY,CAAC;IAEtB,OAAO;MACNG,QAAQ,EAAEG,mBAAmB,CAAEL,UAAW,CAAC;MAC3CG,SAAS,EAAEG,oBAAoB,CAAEN,UAAW;IAC7C,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAM;IAAEO;EAAwB,CAAC,GAAGd,WAAW,CAAEM,WAAY,CAAC;EAC9D,MAAMS,kBAAkB,GAAGA,CAAA,KAAMD,uBAAuB,CAAEP,UAAW,CAAC;EAEtE,IAAK,CAAEG,SAAS,EAAG;IAClB,OAAO,IAAI;EACZ;EAEA,OACCM,aAAA,CAACb,gBAAgB,QAChBa,aAAA,CAACjB,SAAS;IACTkB,KAAK,EAAGnB,EAAE,CAAE,SAAU,CAAG;IACzBoB,MAAM,EAAGT,QAAU;IACnBU,QAAQ,EAAGJ;EAAoB,GAE/BC,aAAA,CAACZ,iBAAiB,CAACgB,IAAI,QAClBC,KAAK,IACRL,aAAA,CAAAM,QAAA,QACCN,aAAA,CAACd,eAAe,MAAE,CAAC,EACjBmB,KACD,CAEoB,CACd,CACM,CAAC;AAErB"}
|
|
1
|
+
{"version":3,"names":["__","PanelBody","useDispatch","useSelect","PostExcerptForm","PostExcerptCheck","PluginPostExcerpt","store","editorStore","PANEL_NAME","PostExcerptPanel","isOpened","isEnabled","select","isEditorPanelOpened","isEditorPanelEnabled","toggleEditorPanelOpened","toggleExcerptPanel","createElement","title","opened","onToggle","Slot","fills","Fragment"],"sources":["@wordpress/editor/src/components/post-excerpt/panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { PanelBody } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport PostExcerptForm from './index';\nimport PostExcerptCheck from './check';\nimport PluginPostExcerpt from './plugin';\nimport { store as editorStore } from '../../store';\n\n/**\n * Module Constants\n */\nconst PANEL_NAME = 'post-excerpt';\n\nexport default function PostExcerptPanel() {\n\tconst { isOpened, isEnabled } = useSelect( ( select ) => {\n\t\tconst { isEditorPanelOpened, isEditorPanelEnabled } =\n\t\t\tselect( editorStore );\n\n\t\treturn {\n\t\t\tisOpened: isEditorPanelOpened( PANEL_NAME ),\n\t\t\tisEnabled: isEditorPanelEnabled( PANEL_NAME ),\n\t\t};\n\t}, [] );\n\n\tconst { toggleEditorPanelOpened } = useDispatch( editorStore );\n\tconst toggleExcerptPanel = () => toggleEditorPanelOpened( PANEL_NAME );\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PostExcerptCheck>\n\t\t\t<PanelBody\n\t\t\t\ttitle={ __( 'Excerpt' ) }\n\t\t\t\topened={ isOpened }\n\t\t\t\tonToggle={ toggleExcerptPanel }\n\t\t\t>\n\t\t\t\t<PluginPostExcerpt.Slot>\n\t\t\t\t\t{ ( fills ) => (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<PostExcerptForm />\n\t\t\t\t\t\t\t{ fills }\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</PluginPostExcerpt.Slot>\n\t\t\t</PanelBody>\n\t\t</PostExcerptCheck>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,uBAAuB;AACjD,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;;AAExD;AACA;AACA;AACA,OAAOC,eAAe,MAAM,SAAS;AACrC,OAAOC,gBAAgB,MAAM,SAAS;AACtC,OAAOC,iBAAiB,MAAM,UAAU;AACxC,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA,MAAMC,UAAU,GAAG,cAAc;AAEjC,eAAe,SAASC,gBAAgBA,CAAA,EAAG;EAC1C,MAAM;IAAEC,QAAQ;IAAEC;EAAU,CAAC,GAAGT,SAAS,CAAIU,MAAM,IAAM;IACxD,MAAM;MAAEC,mBAAmB;MAAEC;IAAqB,CAAC,GAClDF,MAAM,CAAEL,WAAY,CAAC;IAEtB,OAAO;MACNG,QAAQ,EAAEG,mBAAmB,CAAEL,UAAW,CAAC;MAC3CG,SAAS,EAAEG,oBAAoB,CAAEN,UAAW;IAC7C,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAM;IAAEO;EAAwB,CAAC,GAAGd,WAAW,CAAEM,WAAY,CAAC;EAC9D,MAAMS,kBAAkB,GAAGA,CAAA,KAAMD,uBAAuB,CAAEP,UAAW,CAAC;EAEtE,IAAK,CAAEG,SAAS,EAAG;IAClB,OAAO,IAAI;EACZ;EAEA,OACCM,aAAA,CAACb,gBAAgB,QAChBa,aAAA,CAACjB,SAAS;IACTkB,KAAK,EAAGnB,EAAE,CAAE,SAAU,CAAG;IACzBoB,MAAM,EAAGT,QAAU;IACnBU,QAAQ,EAAGJ;EAAoB,GAE/BC,aAAA,CAACZ,iBAAiB,CAACgB,IAAI,QAClBC,KAAK,IACRL,aAAA,CAAAM,QAAA,QACCN,aAAA,CAACd,eAAe,MAAE,CAAC,EACjBmB,KACD,CAEoB,CACd,CACM,CAAC;AAErB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createSlotFill","PanelRow","Fill","Slot","PluginPostExcerpt","children","className","createElement"],"sources":["@wordpress/editor/src/components/post-excerpt/plugin.js"],"sourcesContent":["/**\n * Defines as extensibility slot for the Excerpt panel.\n */\n\n/**\n * WordPress dependencies\n */\nimport { createSlotFill, PanelRow } from '@wordpress/components';\n\nconst { Fill, Slot } = createSlotFill( 'PluginPostExcerpt' );\n\n/**\n * Renders a post excerpt panel in the post sidebar.\n *\n * @param {Object} props Component properties.\n * @param {string} [props.className] An optional class name added to the row.\n * @param {Element} props.children Children to be rendered.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var PluginPostExcerpt = wp.editPost.PluginPostExcerpt;\n *\n * function MyPluginPostExcerpt() {\n * \treturn React.createElement(\n * \t\tPluginPostExcerpt,\n * \t\t{\n * \t\t\tclassName: 'my-plugin-post-excerpt',\n * \t\t},\n * \t\t__( 'Post excerpt custom content' )\n * \t)\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PluginPostExcerpt } from '@wordpress/edit-post';\n *\n * const MyPluginPostExcerpt = () => (\n * \t<PluginPostExcerpt className=\"my-plugin-post-excerpt\">\n * \t\t{ __( 'Post excerpt custom content' ) }\n * \t</PluginPostExcerpt>\n * );\n * ```\n *\n * @return {Component} The component to be rendered.\n */\nconst PluginPostExcerpt = ( { children, className } ) => {\n\treturn (\n\t\t<Fill>\n\t\t\t<PanelRow className={ className }>{ children }</PanelRow>\n\t\t</Fill>\n\t);\n};\n\nPluginPostExcerpt.Slot = Slot;\n\nexport default PluginPostExcerpt;\n"],"mappings":";AAAA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAASA,cAAc,EAAEC,QAAQ,QAAQ,uBAAuB;AAEhE,MAAM;EAAEC,IAAI;EAAEC;AAAK,CAAC,GAAGH,cAAc,CAAE,mBAAoB,CAAC;;AAE5D;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,MAAMI,iBAAiB,GAAGA,CAAE;EAAEC,QAAQ;EAAEC;AAAU,CAAC,KAAM;EACxD,OACCC,aAAA,CAACL,IAAI,QACJK,aAAA,CAACN,QAAQ;IAACK,SAAS,EAAGA;EAAW,GAAGD,QAAoB,CACnD,CAAC;AAET,CAAC;AAEDD,iBAAiB,CAACD,IAAI,GAAGA,IAAI;AAE7B,eAAeC,iBAAiB"}
|
|
1
|
+
{"version":3,"names":["createSlotFill","PanelRow","Fill","Slot","PluginPostExcerpt","children","className","createElement"],"sources":["@wordpress/editor/src/components/post-excerpt/plugin.js"],"sourcesContent":["/**\n * Defines as extensibility slot for the Excerpt panel.\n */\n\n/**\n * WordPress dependencies\n */\nimport { createSlotFill, PanelRow } from '@wordpress/components';\n\nconst { Fill, Slot } = createSlotFill( 'PluginPostExcerpt' );\n\n/**\n * Renders a post excerpt panel in the post sidebar.\n *\n * @param {Object} props Component properties.\n * @param {string} [props.className] An optional class name added to the row.\n * @param {Element} props.children Children to be rendered.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var PluginPostExcerpt = wp.editPost.PluginPostExcerpt;\n *\n * function MyPluginPostExcerpt() {\n * \treturn React.createElement(\n * \t\tPluginPostExcerpt,\n * \t\t{\n * \t\t\tclassName: 'my-plugin-post-excerpt',\n * \t\t},\n * \t\t__( 'Post excerpt custom content' )\n * \t)\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PluginPostExcerpt } from '@wordpress/edit-post';\n *\n * const MyPluginPostExcerpt = () => (\n * \t<PluginPostExcerpt className=\"my-plugin-post-excerpt\">\n * \t\t{ __( 'Post excerpt custom content' ) }\n * \t</PluginPostExcerpt>\n * );\n * ```\n *\n * @return {Component} The component to be rendered.\n */\nconst PluginPostExcerpt = ( { children, className } ) => {\n\treturn (\n\t\t<Fill>\n\t\t\t<PanelRow className={ className }>{ children }</PanelRow>\n\t\t</Fill>\n\t);\n};\n\nPluginPostExcerpt.Slot = Slot;\n\nexport default PluginPostExcerpt;\n"],"mappings":";AAAA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAASA,cAAc,EAAEC,QAAQ,QAAQ,uBAAuB;AAEhE,MAAM;EAAEC,IAAI;EAAEC;AAAK,CAAC,GAAGH,cAAc,CAAE,mBAAoB,CAAC;;AAE5D;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,MAAMI,iBAAiB,GAAGA,CAAE;EAAEC,QAAQ;EAAEC;AAAU,CAAC,KAAM;EACxD,OACCC,aAAA,CAACL,IAAI,QACJK,aAAA,CAACN,QAAQ;IAACK,SAAS,EAAGA;EAAW,GAAGD,QAAoB,CACnD,CAAC;AAET,CAAC;AAEDD,iBAAiB,CAACD,IAAI,GAAGA,IAAI;AAE7B,eAAeC,iBAAiB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["PostTypeSupportCheck","ThemeSupportCheck","PostFeaturedImageCheck","children","createElement","supportKeys"],"sources":["@wordpress/editor/src/components/post-featured-image/check.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport PostTypeSupportCheck from '../post-type-support-check';\nimport ThemeSupportCheck from '../theme-support-check';\n\nfunction PostFeaturedImageCheck( { children } ) {\n\treturn (\n\t\t<ThemeSupportCheck supportKeys=\"post-thumbnails\">\n\t\t\t<PostTypeSupportCheck supportKeys=\"thumbnail\">\n\t\t\t\t{ children }\n\t\t\t</PostTypeSupportCheck>\n\t\t</ThemeSupportCheck>\n\t);\n}\n\nexport default PostFeaturedImageCheck;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,oBAAoB,MAAM,4BAA4B;AAC7D,OAAOC,iBAAiB,MAAM,wBAAwB;AAEtD,SAASC,sBAAsBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EAC/C,OACCC,aAAA,CAACH,iBAAiB;IAACI,WAAW,EAAC;EAAiB,GAC/CD,aAAA,CAACJ,oBAAoB;IAACK,WAAW,EAAC;EAAW,GAC1CF,QACmB,CACJ,CAAC;AAEtB;AAEA,eAAeD,sBAAsB"}
|
|
1
|
+
{"version":3,"names":["PostTypeSupportCheck","ThemeSupportCheck","PostFeaturedImageCheck","children","createElement","supportKeys"],"sources":["@wordpress/editor/src/components/post-featured-image/check.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport PostTypeSupportCheck from '../post-type-support-check';\nimport ThemeSupportCheck from '../theme-support-check';\n\nfunction PostFeaturedImageCheck( { children } ) {\n\treturn (\n\t\t<ThemeSupportCheck supportKeys=\"post-thumbnails\">\n\t\t\t<PostTypeSupportCheck supportKeys=\"thumbnail\">\n\t\t\t\t{ children }\n\t\t\t</PostTypeSupportCheck>\n\t\t</ThemeSupportCheck>\n\t);\n}\n\nexport default PostFeaturedImageCheck;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,oBAAoB,MAAM,4BAA4B;AAC7D,OAAOC,iBAAiB,MAAM,wBAAwB;AAEtD,SAASC,sBAAsBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EAC/C,OACCC,aAAA,CAACH,iBAAiB;IAACI,WAAW,EAAC;EAAiB,GAC/CD,aAAA,CAACJ,oBAAoB;IAACK,WAAW,EAAC;EAAW,GAC1CF,QACmB,CACJ,CAAC;AAEtB;AAEA,eAAeD,sBAAsB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","sprintf","applyFilters","DropZone","Button","Spinner","withNotices","withFilters","__experimentalHStack","HStack","isBlobURL","useState","useRef","compose","useSelect","withDispatch","withSelect","MediaUpload","MediaUploadCheck","store","blockEditorStore","coreStore","PostFeaturedImageCheck","editorStore","ALLOWED_MEDIA_TYPES","DEFAULT_FEATURE_IMAGE_LABEL","DEFAULT_SET_FEATURE_IMAGE_LABEL","instructions","createElement","getMediaDetails","media","postId","_media$media_details$","_media$media_details$2","defaultSize","id","media_details","sizes","mediaWidth","width","mediaHeight","height","mediaSourceUrl","source_url","fallbackSize","PostFeaturedImage","currentPostId","featuredImageId","onUpdateImage","onRemoveImage","postType","noticeUI","noticeOperations","toggleRef","isLoading","setIsLoading","getSettings","onDropFiles","filesList","mediaUpload","allowedTypes","onFileChange","image","url","onError","message","removeAllNotices","createErrorNotice","className","alt_text","full","file","slug","fallback","title","labels","featured_image","onSelect","unstableFeaturedImageFlow","modalClass","render","open","ref","onClick","src","alt","set_featured_image","current","focus","onFilesDrop","value","applyWithSelect","select","getMedia","getPostType","getCurrentPostId","getEditedPostAttribute","context","applyWithDispatch","dispatch","editPost","featured_media","onDropImage"],"sources":["@wordpress/editor/src/components/post-featured-image/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { applyFilters } from '@wordpress/hooks';\nimport {\n\tDropZone,\n\tButton,\n\tSpinner,\n\twithNotices,\n\twithFilters,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { isBlobURL } from '@wordpress/blob';\nimport { useState, useRef } from '@wordpress/element';\nimport { compose } from '@wordpress/compose';\nimport { useSelect, withDispatch, withSelect } from '@wordpress/data';\nimport {\n\tMediaUpload,\n\tMediaUploadCheck,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport PostFeaturedImageCheck from './check';\nimport { store as editorStore } from '../../store';\n\nconst ALLOWED_MEDIA_TYPES = [ 'image' ];\n\n// Used when labels from post type were not yet loaded or when they are not present.\nconst DEFAULT_FEATURE_IMAGE_LABEL = __( 'Featured image' );\nconst DEFAULT_SET_FEATURE_IMAGE_LABEL = __( 'Set featured image' );\n\nconst instructions = (\n\t<p>\n\t\t{ __(\n\t\t\t'To edit the featured image, you need permission to upload media.'\n\t\t) }\n\t</p>\n);\n\nfunction getMediaDetails( media, postId ) {\n\tif ( ! media ) {\n\t\treturn {};\n\t}\n\n\tconst defaultSize = applyFilters(\n\t\t'editor.PostFeaturedImage.imageSize',\n\t\t'large',\n\t\tmedia.id,\n\t\tpostId\n\t);\n\tif ( defaultSize in ( media?.media_details?.sizes ?? {} ) ) {\n\t\treturn {\n\t\t\tmediaWidth: media.media_details.sizes[ defaultSize ].width,\n\t\t\tmediaHeight: media.media_details.sizes[ defaultSize ].height,\n\t\t\tmediaSourceUrl: media.media_details.sizes[ defaultSize ].source_url,\n\t\t};\n\t}\n\n\t// Use fallbackSize when defaultSize is not available.\n\tconst fallbackSize = applyFilters(\n\t\t'editor.PostFeaturedImage.imageSize',\n\t\t'thumbnail',\n\t\tmedia.id,\n\t\tpostId\n\t);\n\tif ( fallbackSize in ( media?.media_details?.sizes ?? {} ) ) {\n\t\treturn {\n\t\t\tmediaWidth: media.media_details.sizes[ fallbackSize ].width,\n\t\t\tmediaHeight: media.media_details.sizes[ fallbackSize ].height,\n\t\t\tmediaSourceUrl:\n\t\t\t\tmedia.media_details.sizes[ fallbackSize ].source_url,\n\t\t};\n\t}\n\n\t// Use full image size when fallbackSize and defaultSize are not available.\n\treturn {\n\t\tmediaWidth: media.media_details.width,\n\t\tmediaHeight: media.media_details.height,\n\t\tmediaSourceUrl: media.source_url,\n\t};\n}\n\nfunction PostFeaturedImage( {\n\tcurrentPostId,\n\tfeaturedImageId,\n\tonUpdateImage,\n\tonRemoveImage,\n\tmedia,\n\tpostType,\n\tnoticeUI,\n\tnoticeOperations,\n} ) {\n\tconst toggleRef = useRef();\n\tconst [ isLoading, setIsLoading ] = useState( false );\n\tconst { getSettings } = useSelect( blockEditorStore );\n\tconst { mediaSourceUrl } = getMediaDetails( media, currentPostId );\n\n\tfunction onDropFiles( filesList ) {\n\t\tgetSettings().mediaUpload( {\n\t\t\tallowedTypes: ALLOWED_MEDIA_TYPES,\n\t\t\tfilesList,\n\t\t\tonFileChange( [ image ] ) {\n\t\t\t\tif ( isBlobURL( image?.url ) ) {\n\t\t\t\t\tsetIsLoading( true );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif ( image ) {\n\t\t\t\t\tonUpdateImage( image );\n\t\t\t\t}\n\t\t\t\tsetIsLoading( false );\n\t\t\t},\n\t\t\tonError( message ) {\n\t\t\t\tnoticeOperations.removeAllNotices();\n\t\t\t\tnoticeOperations.createErrorNotice( message );\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn (\n\t\t<PostFeaturedImageCheck>\n\t\t\t{ noticeUI }\n\t\t\t<div className=\"editor-post-featured-image\">\n\t\t\t\t{ media && (\n\t\t\t\t\t<div\n\t\t\t\t\t\tid={ `editor-post-featured-image-${ featuredImageId }-describedby` }\n\t\t\t\t\t\tclassName=\"hidden\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ media.alt_text &&\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t// Translators: %s: The selected image alt text.\n\t\t\t\t\t\t\t\t__( 'Current image: %s' ),\n\t\t\t\t\t\t\t\tmedia.alt_text\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! media.alt_text &&\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t// Translators: %s: The selected image filename.\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'The current image has no alternative text. The file name is: %s'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tmedia.media_details.sizes?.full?.file ||\n\t\t\t\t\t\t\t\t\tmedia.slug\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t\t<MediaUploadCheck fallback={ instructions }>\n\t\t\t\t\t<MediaUpload\n\t\t\t\t\t\ttitle={\n\t\t\t\t\t\t\tpostType?.labels?.featured_image ||\n\t\t\t\t\t\t\tDEFAULT_FEATURE_IMAGE_LABEL\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonSelect={ onUpdateImage }\n\t\t\t\t\t\tunstableFeaturedImageFlow\n\t\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\t\tmodalClass=\"editor-post-featured-image__media-modal\"\n\t\t\t\t\t\trender={ ( { open } ) => (\n\t\t\t\t\t\t\t<div className=\"editor-post-featured-image__container\">\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tref={ toggleRef }\n\t\t\t\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\t\t\t\t! featuredImageId\n\t\t\t\t\t\t\t\t\t\t\t? 'editor-post-featured-image__toggle'\n\t\t\t\t\t\t\t\t\t\t\t: 'editor-post-featured-image__preview'\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tonClick={ open }\n\t\t\t\t\t\t\t\t\taria-label={\n\t\t\t\t\t\t\t\t\t\t! featuredImageId\n\t\t\t\t\t\t\t\t\t\t\t? null\n\t\t\t\t\t\t\t\t\t\t\t: __( 'Edit or replace the image' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\taria-describedby={\n\t\t\t\t\t\t\t\t\t\t! featuredImageId\n\t\t\t\t\t\t\t\t\t\t\t? null\n\t\t\t\t\t\t\t\t\t\t\t: `editor-post-featured-image-${ featuredImageId }-describedby`\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ !! featuredImageId && media && (\n\t\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"editor-post-featured-image__preview-image\"\n\t\t\t\t\t\t\t\t\t\t\tsrc={ mediaSourceUrl }\n\t\t\t\t\t\t\t\t\t\t\talt=\"\"\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ isLoading && <Spinner /> }\n\t\t\t\t\t\t\t\t\t{ ! featuredImageId &&\n\t\t\t\t\t\t\t\t\t\t! isLoading &&\n\t\t\t\t\t\t\t\t\t\t( postType?.labels\n\t\t\t\t\t\t\t\t\t\t\t?.set_featured_image ||\n\t\t\t\t\t\t\t\t\t\t\tDEFAULT_SET_FEATURE_IMAGE_LABEL ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t{ !! featuredImageId && (\n\t\t\t\t\t\t\t\t\t<HStack className=\"editor-post-featured-image__actions\">\n\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"editor-post-featured-image__action\"\n\t\t\t\t\t\t\t\t\t\t\tonClick={ open }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Replace' ) }\n\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"editor-post-featured-image__action\"\n\t\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\t\tonRemoveImage();\n\t\t\t\t\t\t\t\t\t\t\t\ttoggleRef.current.focus();\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Remove' ) }\n\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t<DropZone onFilesDrop={ onDropFiles } />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tvalue={ featuredImageId }\n\t\t\t\t\t/>\n\t\t\t\t</MediaUploadCheck>\n\t\t\t</div>\n\t\t</PostFeaturedImageCheck>\n\t);\n}\n\nconst applyWithSelect = withSelect( ( select ) => {\n\tconst { getMedia, getPostType } = select( coreStore );\n\tconst { getCurrentPostId, getEditedPostAttribute } = select( editorStore );\n\tconst featuredImageId = getEditedPostAttribute( 'featured_media' );\n\n\treturn {\n\t\tmedia: featuredImageId\n\t\t\t? getMedia( featuredImageId, { context: 'view' } )\n\t\t\t: null,\n\t\tcurrentPostId: getCurrentPostId(),\n\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\tfeaturedImageId,\n\t};\n} );\n\nconst applyWithDispatch = withDispatch(\n\t( dispatch, { noticeOperations }, { select } ) => {\n\t\tconst { editPost } = dispatch( editorStore );\n\t\treturn {\n\t\t\tonUpdateImage( image ) {\n\t\t\t\teditPost( { featured_media: image.id } );\n\t\t\t},\n\t\t\tonDropImage( filesList ) {\n\t\t\t\tselect( blockEditorStore )\n\t\t\t\t\t.getSettings()\n\t\t\t\t\t.mediaUpload( {\n\t\t\t\t\t\tallowedTypes: [ 'image' ],\n\t\t\t\t\t\tfilesList,\n\t\t\t\t\t\tonFileChange( [ image ] ) {\n\t\t\t\t\t\t\teditPost( { featured_media: image.id } );\n\t\t\t\t\t\t},\n\t\t\t\t\t\tonError( message ) {\n\t\t\t\t\t\t\tnoticeOperations.removeAllNotices();\n\t\t\t\t\t\t\tnoticeOperations.createErrorNotice( message );\n\t\t\t\t\t\t},\n\t\t\t\t\t} );\n\t\t\t},\n\t\t\tonRemoveImage() {\n\t\t\t\teditPost( { featured_media: 0 } );\n\t\t\t},\n\t\t};\n\t}\n);\n\nexport default compose(\n\twithNotices,\n\tapplyWithSelect,\n\tapplyWithDispatch,\n\twithFilters( 'editor.PostFeaturedImage' )\n)( PostFeaturedImage );\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SACCC,QAAQ,EACRC,MAAM,EACNC,OAAO,EACPC,WAAW,EACXC,WAAW,EACXC,oBAAoB,IAAIC,MAAM,QACxB,uBAAuB;AAC9B,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,QAAQ,EAAEC,MAAM,QAAQ,oBAAoB;AACrD,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,SAAS,EAAEC,YAAY,EAAEC,UAAU,QAAQ,iBAAiB;AACrE,SACCC,WAAW,EACXC,gBAAgB,EAChBC,KAAK,IAAIC,gBAAgB,QACnB,yBAAyB;AAChC,SAASD,KAAK,IAAIE,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,OAAOC,sBAAsB,MAAM,SAAS;AAC5C,SAASH,KAAK,IAAII,WAAW,QAAQ,aAAa;AAElD,MAAMC,mBAAmB,GAAG,CAAE,OAAO,CAAE;;AAEvC;AACA,MAAMC,2BAA2B,GAAGzB,EAAE,CAAE,gBAAiB,CAAC;AAC1D,MAAM0B,+BAA+B,GAAG1B,EAAE,CAAE,oBAAqB,CAAC;AAElE,MAAM2B,YAAY,GACjBC,aAAA,YACG5B,EAAE,CACH,kEACD,CACE,CACH;AAED,SAAS6B,eAAeA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AAS,CAAC,GAAGD,QAAQ,CAAE5E,WAAY,CAAC;EAC5C,OAAO;IACNyB,aAAaA,CAAEc,KAAK,EAAG;MACtBsC,QAAQ,CAAE;QAAEC,cAAc,EAAEvC,KAAK,CAAC3B;MAAG,CAAE,CAAC;IACzC,CAAC;IACDmE,WAAWA,CAAE5C,SAAS,EAAG;MACxBkC,MAAM,CAAExE,gBAAiB,CAAC,CACxBoC,WAAW,CAAC,CAAC,CACbG,WAAW,CAAE;QACbC,YAAY,EAAE,CAAE,OAAO,CAAE;QACzBF,SAAS;QACTG,YAAYA,CAAE,CAAEC,KAAK,CAAE,EAAG;UACzBsC,QAAQ,CAAE;YAAEC,cAAc,EAAEvC,KAAK,CAAC3B;UAAG,CAAE,CAAC;QACzC,CAAC;QACD6B,OAAOA,CAAEC,OAAO,EAAG;UAClBb,gBAAgB,CAACc,gBAAgB,CAAC,CAAC;UACnCd,gBAAgB,CAACe,iBAAiB,CAAEF,OAAQ,CAAC;QAC9C;MACD,CAAE,CAAC;IACL,CAAC;IACDhB,aAAaA,CAAA,EAAG;MACfmD,QAAQ,CAAE;QAAEC,cAAc,EAAE;MAAE,CAAE,CAAC;IAClC;EACD,CAAC;AACF,CACD,CAAC;AAED,eAAexF,OAAO,CACrBP,WAAW,EACXqF,eAAe,EACfO,iBAAiB,EACjB3F,WAAW,CAAE,0BAA2B,CACzC,CAAC,CAAEsC,iBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"names":["__","sprintf","applyFilters","DropZone","Button","Spinner","withNotices","withFilters","__experimentalHStack","HStack","isBlobURL","useState","useRef","compose","useSelect","withDispatch","withSelect","MediaUpload","MediaUploadCheck","store","blockEditorStore","coreStore","PostFeaturedImageCheck","editorStore","ALLOWED_MEDIA_TYPES","DEFAULT_FEATURE_IMAGE_LABEL","DEFAULT_SET_FEATURE_IMAGE_LABEL","instructions","createElement","getMediaDetails","media","postId","_media$media_details$","_media$media_details$2","defaultSize","id","media_details","sizes","mediaWidth","width","mediaHeight","height","mediaSourceUrl","source_url","fallbackSize","PostFeaturedImage","currentPostId","featuredImageId","onUpdateImage","onRemoveImage","postType","noticeUI","noticeOperations","toggleRef","isLoading","setIsLoading","getSettings","onDropFiles","filesList","mediaUpload","allowedTypes","onFileChange","image","url","onError","message","removeAllNotices","createErrorNotice","className","alt_text","full","file","slug","fallback","title","labels","featured_image","onSelect","unstableFeaturedImageFlow","modalClass","render","open","ref","onClick","src","alt","set_featured_image","current","focus","onFilesDrop","value","applyWithSelect","select","getMedia","getPostType","getCurrentPostId","getEditedPostAttribute","context","applyWithDispatch","dispatch","editPost","featured_media","onDropImage"],"sources":["@wordpress/editor/src/components/post-featured-image/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { applyFilters } from '@wordpress/hooks';\nimport {\n\tDropZone,\n\tButton,\n\tSpinner,\n\twithNotices,\n\twithFilters,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { isBlobURL } from '@wordpress/blob';\nimport { useState, useRef } from '@wordpress/element';\nimport { compose } from '@wordpress/compose';\nimport { useSelect, withDispatch, withSelect } from '@wordpress/data';\nimport {\n\tMediaUpload,\n\tMediaUploadCheck,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport PostFeaturedImageCheck from './check';\nimport { store as editorStore } from '../../store';\n\nconst ALLOWED_MEDIA_TYPES = [ 'image' ];\n\n// Used when labels from post type were not yet loaded or when they are not present.\nconst DEFAULT_FEATURE_IMAGE_LABEL = __( 'Featured image' );\nconst DEFAULT_SET_FEATURE_IMAGE_LABEL = __( 'Set featured image' );\n\nconst instructions = (\n\t<p>\n\t\t{ __(\n\t\t\t'To edit the featured image, you need permission to upload media.'\n\t\t) }\n\t</p>\n);\n\nfunction getMediaDetails( media, postId ) {\n\tif ( ! media ) {\n\t\treturn {};\n\t}\n\n\tconst defaultSize = applyFilters(\n\t\t'editor.PostFeaturedImage.imageSize',\n\t\t'large',\n\t\tmedia.id,\n\t\tpostId\n\t);\n\tif ( defaultSize in ( media?.media_details?.sizes ?? {} ) ) {\n\t\treturn {\n\t\t\tmediaWidth: media.media_details.sizes[ defaultSize ].width,\n\t\t\tmediaHeight: media.media_details.sizes[ defaultSize ].height,\n\t\t\tmediaSourceUrl: media.media_details.sizes[ defaultSize ].source_url,\n\t\t};\n\t}\n\n\t// Use fallbackSize when defaultSize is not available.\n\tconst fallbackSize = applyFilters(\n\t\t'editor.PostFeaturedImage.imageSize',\n\t\t'thumbnail',\n\t\tmedia.id,\n\t\tpostId\n\t);\n\tif ( fallbackSize in ( media?.media_details?.sizes ?? {} ) ) {\n\t\treturn {\n\t\t\tmediaWidth: media.media_details.sizes[ fallbackSize ].width,\n\t\t\tmediaHeight: media.media_details.sizes[ fallbackSize ].height,\n\t\t\tmediaSourceUrl:\n\t\t\t\tmedia.media_details.sizes[ fallbackSize ].source_url,\n\t\t};\n\t}\n\n\t// Use full image size when fallbackSize and defaultSize are not available.\n\treturn {\n\t\tmediaWidth: media.media_details.width,\n\t\tmediaHeight: media.media_details.height,\n\t\tmediaSourceUrl: media.source_url,\n\t};\n}\n\nfunction PostFeaturedImage( {\n\tcurrentPostId,\n\tfeaturedImageId,\n\tonUpdateImage,\n\tonRemoveImage,\n\tmedia,\n\tpostType,\n\tnoticeUI,\n\tnoticeOperations,\n} ) {\n\tconst toggleRef = useRef();\n\tconst [ isLoading, setIsLoading ] = useState( false );\n\tconst { getSettings } = useSelect( blockEditorStore );\n\tconst { mediaSourceUrl } = getMediaDetails( media, currentPostId );\n\n\tfunction onDropFiles( filesList ) {\n\t\tgetSettings().mediaUpload( {\n\t\t\tallowedTypes: ALLOWED_MEDIA_TYPES,\n\t\t\tfilesList,\n\t\t\tonFileChange( [ image ] ) {\n\t\t\t\tif ( isBlobURL( image?.url ) ) {\n\t\t\t\t\tsetIsLoading( true );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif ( image ) {\n\t\t\t\t\tonUpdateImage( image );\n\t\t\t\t}\n\t\t\t\tsetIsLoading( false );\n\t\t\t},\n\t\t\tonError( message ) {\n\t\t\t\tnoticeOperations.removeAllNotices();\n\t\t\t\tnoticeOperations.createErrorNotice( message );\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn (\n\t\t<PostFeaturedImageCheck>\n\t\t\t{ noticeUI }\n\t\t\t<div className=\"editor-post-featured-image\">\n\t\t\t\t{ media && (\n\t\t\t\t\t<div\n\t\t\t\t\t\tid={ `editor-post-featured-image-${ featuredImageId }-describedby` }\n\t\t\t\t\t\tclassName=\"hidden\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ media.alt_text &&\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t// Translators: %s: The selected image alt text.\n\t\t\t\t\t\t\t\t__( 'Current image: %s' ),\n\t\t\t\t\t\t\t\tmedia.alt_text\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! media.alt_text &&\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t// Translators: %s: The selected image filename.\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'The current image has no alternative text. The file name is: %s'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tmedia.media_details.sizes?.full?.file ||\n\t\t\t\t\t\t\t\t\tmedia.slug\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t\t<MediaUploadCheck fallback={ instructions }>\n\t\t\t\t\t<MediaUpload\n\t\t\t\t\t\ttitle={\n\t\t\t\t\t\t\tpostType?.labels?.featured_image ||\n\t\t\t\t\t\t\tDEFAULT_FEATURE_IMAGE_LABEL\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonSelect={ onUpdateImage }\n\t\t\t\t\t\tunstableFeaturedImageFlow\n\t\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\t\tmodalClass=\"editor-post-featured-image__media-modal\"\n\t\t\t\t\t\trender={ ( { open } ) => (\n\t\t\t\t\t\t\t<div className=\"editor-post-featured-image__container\">\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tref={ toggleRef }\n\t\t\t\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\t\t\t\t! featuredImageId\n\t\t\t\t\t\t\t\t\t\t\t? 'editor-post-featured-image__toggle'\n\t\t\t\t\t\t\t\t\t\t\t: 'editor-post-featured-image__preview'\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tonClick={ open }\n\t\t\t\t\t\t\t\t\taria-label={\n\t\t\t\t\t\t\t\t\t\t! featuredImageId\n\t\t\t\t\t\t\t\t\t\t\t? null\n\t\t\t\t\t\t\t\t\t\t\t: __( 'Edit or replace the image' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\taria-describedby={\n\t\t\t\t\t\t\t\t\t\t! featuredImageId\n\t\t\t\t\t\t\t\t\t\t\t? null\n\t\t\t\t\t\t\t\t\t\t\t: `editor-post-featured-image-${ featuredImageId }-describedby`\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ !! featuredImageId && media && (\n\t\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"editor-post-featured-image__preview-image\"\n\t\t\t\t\t\t\t\t\t\t\tsrc={ mediaSourceUrl }\n\t\t\t\t\t\t\t\t\t\t\talt=\"\"\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ isLoading && <Spinner /> }\n\t\t\t\t\t\t\t\t\t{ ! featuredImageId &&\n\t\t\t\t\t\t\t\t\t\t! isLoading &&\n\t\t\t\t\t\t\t\t\t\t( postType?.labels\n\t\t\t\t\t\t\t\t\t\t\t?.set_featured_image ||\n\t\t\t\t\t\t\t\t\t\t\tDEFAULT_SET_FEATURE_IMAGE_LABEL ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t{ !! featuredImageId && (\n\t\t\t\t\t\t\t\t\t<HStack className=\"editor-post-featured-image__actions\">\n\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"editor-post-featured-image__action\"\n\t\t\t\t\t\t\t\t\t\t\tonClick={ open }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Replace' ) }\n\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"editor-post-featured-image__action\"\n\t\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\t\tonRemoveImage();\n\t\t\t\t\t\t\t\t\t\t\t\ttoggleRef.current.focus();\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Remove' ) }\n\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t<DropZone onFilesDrop={ onDropFiles } />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tvalue={ featuredImageId }\n\t\t\t\t\t/>\n\t\t\t\t</MediaUploadCheck>\n\t\t\t</div>\n\t\t</PostFeaturedImageCheck>\n\t);\n}\n\nconst applyWithSelect = withSelect( ( select ) => {\n\tconst { getMedia, getPostType } = select( coreStore );\n\tconst { getCurrentPostId, getEditedPostAttribute } = select( editorStore );\n\tconst featuredImageId = getEditedPostAttribute( 'featured_media' );\n\n\treturn {\n\t\tmedia: featuredImageId\n\t\t\t? getMedia( featuredImageId, { context: 'view' } )\n\t\t\t: null,\n\t\tcurrentPostId: getCurrentPostId(),\n\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\tfeaturedImageId,\n\t};\n} );\n\nconst applyWithDispatch = withDispatch(\n\t( dispatch, { noticeOperations }, { select } ) => {\n\t\tconst { editPost } = dispatch( editorStore );\n\t\treturn {\n\t\t\tonUpdateImage( image ) {\n\t\t\t\teditPost( { featured_media: image.id } );\n\t\t\t},\n\t\t\tonDropImage( filesList ) {\n\t\t\t\tselect( blockEditorStore )\n\t\t\t\t\t.getSettings()\n\t\t\t\t\t.mediaUpload( {\n\t\t\t\t\t\tallowedTypes: [ 'image' ],\n\t\t\t\t\t\tfilesList,\n\t\t\t\t\t\tonFileChange( [ image ] ) {\n\t\t\t\t\t\t\teditPost( { featured_media: image.id } );\n\t\t\t\t\t\t},\n\t\t\t\t\t\tonError( message ) {\n\t\t\t\t\t\t\tnoticeOperations.removeAllNotices();\n\t\t\t\t\t\t\tnoticeOperations.createErrorNotice( message );\n\t\t\t\t\t\t},\n\t\t\t\t\t} );\n\t\t\t},\n\t\t\tonRemoveImage() {\n\t\t\t\teditPost( { featured_media: 0 } );\n\t\t\t},\n\t\t};\n\t}\n);\n\nexport default compose(\n\twithNotices,\n\tapplyWithSelect,\n\tapplyWithDispatch,\n\twithFilters( 'editor.PostFeaturedImage' )\n)( PostFeaturedImage );\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SACCC,QAAQ,EACRC,MAAM,EACNC,OAAO,EACPC,WAAW,EACXC,WAAW,EACXC,oBAAoB,IAAIC,MAAM,QACxB,uBAAuB;AAC9B,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,QAAQ,EAAEC,MAAM,QAAQ,oBAAoB;AACrD,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,SAAS,EAAEC,YAAY,EAAEC,UAAU,QAAQ,iBAAiB;AACrE,SACCC,WAAW,EACX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WAAW,EACXqF,eAAe,EACfO,iBAAiB,EACjB3F,WAAW,CAAE,0BAA2B,CACzC,CAAC,CAAEsC,iBAAkB,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","PanelBody","useSelect","useDispatch","store","coreStore","editorStore","PostFeaturedImage","PostFeaturedImageCheck","PANEL_NAME","PostFeaturedImagePanel","withPanelBody","_postType$labels$feat","postType","isEnabled","isOpened","select","getEditedPostAttribute","isEditorPanelEnabled","isEditorPanelOpened","getPostType","toggleEditorPanelOpened","createElement","title","labels","featured_image","opened","onToggle"],"sources":["@wordpress/editor/src/components/post-featured-image/panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { PanelBody } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport PostFeaturedImage from './index';\nimport PostFeaturedImageCheck from './check';\n\nconst PANEL_NAME = 'featured-image';\n\nexport default function PostFeaturedImagePanel( { withPanelBody = true } ) {\n\tconst { postType, isEnabled, isOpened } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetEditedPostAttribute,\n\t\t\tisEditorPanelEnabled,\n\t\t\tisEditorPanelOpened,\n\t\t} = select( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\n\t\treturn {\n\t\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\t\tisEnabled: isEditorPanelEnabled( PANEL_NAME ),\n\t\t\tisOpened: isEditorPanelOpened( PANEL_NAME ),\n\t\t};\n\t}, [] );\n\n\tconst { toggleEditorPanelOpened } = useDispatch( editorStore );\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\tif ( ! withPanelBody ) {\n\t\treturn (\n\t\t\t<PostFeaturedImageCheck>\n\t\t\t\t<PostFeaturedImage />\n\t\t\t</PostFeaturedImageCheck>\n\t\t);\n\t}\n\n\treturn (\n\t\t<PostFeaturedImageCheck>\n\t\t\t<PanelBody\n\t\t\t\ttitle={\n\t\t\t\t\tpostType?.labels?.featured_image ?? __( 'Featured image' )\n\t\t\t\t}\n\t\t\t\topened={ isOpened }\n\t\t\t\tonToggle={ () => toggleEditorPanelOpened( PANEL_NAME ) }\n\t\t\t>\n\t\t\t\t<PostFeaturedImage />\n\t\t\t</PanelBody>\n\t\t</PostFeaturedImageCheck>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,uBAAuB;AACjD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASD,KAAK,IAAIE,WAAW,QAAQ,aAAa;AAClD,OAAOC,iBAAiB,MAAM,SAAS;AACvC,OAAOC,sBAAsB,MAAM,SAAS;AAE5C,MAAMC,UAAU,GAAG,gBAAgB;AAEnC,eAAe,SAASC,sBAAsBA,CAAE;EAAEC,aAAa,GAAG;AAAK,CAAC,EAAG;EAAA,IAAAC,qBAAA;EAC1E,MAAM;IAAEC,QAAQ;IAAEC,SAAS;IAAEC;EAAS,CAAC,GAAGb,SAAS,CAAIc,MAAM,IAAM;IAClE,MAAM;MACLC,sBAAsB;MACtBC,oBAAoB;MACpBC;IACD,CAAC,GAAGH,MAAM,CAAEV,WAAY,CAAC;IACzB,MAAM;MAAEc;IAAY,CAAC,GAAGJ,MAAM,CAAEX,SAAU,CAAC;IAE3C,OAAO;MACNQ,QAAQ,EAAEO,WAAW,CAAEH,sBAAsB,CAAE,MAAO,CAAE,CAAC;MACzDH,SAAS,EAAEI,oBAAoB,CAAET,UAAW,CAAC;MAC7CM,QAAQ,EAAEI,mBAAmB,CAAEV,UAAW;IAC3C,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAM;IAAEY;EAAwB,CAAC,GAAGlB,WAAW,CAAEG,WAAY,CAAC;EAE9D,IAAK,CAAEQ,SAAS,EAAG;IAClB,OAAO,IAAI;EACZ;EAEA,IAAK,CAAEH,aAAa,EAAG;IACtB,OACCW,aAAA,CAACd,sBAAsB,QACtBc,aAAA,CAACf,iBAAiB,MAAE,CACG,CAAC;EAE3B;EAEA,OACCe,aAAA,CAACd,sBAAsB,QACtBc,aAAA,CAACrB,SAAS;IACTsB,KAAK,GAAAX,qBAAA,GACJC,QAAQ,EAAEW,MAAM,EAAEC,cAAc,cAAAb,qBAAA,cAAAA,qBAAA,GAAIZ,EAAE,CAAE,gBAAiB,CACzD;IACD0B,MAAM,EAAGX,QAAU;IACnBY,QAAQ,EAAGA,CAAA,KAAMN,uBAAuB,CAAEZ,UAAW;EAAG,GAExDa,aAAA,CAACf,iBAAiB,MAAE,CACV,CACY,CAAC;AAE3B"}
|
|
1
|
+
{"version":3,"names":["__","PanelBody","useSelect","useDispatch","store","coreStore","editorStore","PostFeaturedImage","PostFeaturedImageCheck","PANEL_NAME","PostFeaturedImagePanel","withPanelBody","_postType$labels$feat","postType","isEnabled","isOpened","select","getEditedPostAttribute","isEditorPanelEnabled","isEditorPanelOpened","getPostType","toggleEditorPanelOpened","createElement","title","labels","featured_image","opened","onToggle"],"sources":["@wordpress/editor/src/components/post-featured-image/panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { PanelBody } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport PostFeaturedImage from './index';\nimport PostFeaturedImageCheck from './check';\n\nconst PANEL_NAME = 'featured-image';\n\nexport default function PostFeaturedImagePanel( { withPanelBody = true } ) {\n\tconst { postType, isEnabled, isOpened } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetEditedPostAttribute,\n\t\t\tisEditorPanelEnabled,\n\t\t\tisEditorPanelOpened,\n\t\t} = select( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\n\t\treturn {\n\t\t\tpostType: getPostType( getEditedPostAttribute( 'type' ) ),\n\t\t\tisEnabled: isEditorPanelEnabled( PANEL_NAME ),\n\t\t\tisOpened: isEditorPanelOpened( PANEL_NAME ),\n\t\t};\n\t}, [] );\n\n\tconst { toggleEditorPanelOpened } = useDispatch( editorStore );\n\n\tif ( ! isEnabled ) {\n\t\treturn null;\n\t}\n\n\tif ( ! withPanelBody ) {\n\t\treturn (\n\t\t\t<PostFeaturedImageCheck>\n\t\t\t\t<PostFeaturedImage />\n\t\t\t</PostFeaturedImageCheck>\n\t\t);\n\t}\n\n\treturn (\n\t\t<PostFeaturedImageCheck>\n\t\t\t<PanelBody\n\t\t\t\ttitle={\n\t\t\t\t\tpostType?.labels?.featured_image ?? __( 'Featured image' )\n\t\t\t\t}\n\t\t\t\topened={ isOpened }\n\t\t\t\tonToggle={ () => toggleEditorPanelOpened( PANEL_NAME ) }\n\t\t\t>\n\t\t\t\t<PostFeaturedImage />\n\t\t\t</PanelBody>\n\t\t</PostFeaturedImageCheck>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,uBAAuB;AACjD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASD,KAAK,IAAIE,WAAW,QAAQ,aAAa;AAClD,OAAOC,iBAAiB,MAAM,SAAS;AACvC,OAAOC,sBAAsB,MAAM,SAAS;AAE5C,MAAMC,UAAU,GAAG,gBAAgB;AAEnC,eAAe,SAASC,sBAAsBA,CAAE;EAAEC,aAAa,GAAG;AAAK,CAAC,EAAG;EAAA,IAAAC,qBAAA;EAC1E,MAAM;IAAEC,QAAQ;IAAEC,SAAS;IAAEC;EAAS,CAAC,GAAGb,SAAS,CAAIc,MAAM,IAAM;IAClE,MAAM;MACLC,sBAAsB;MACtBC,oBAAoB;MACpBC;IACD,CAAC,GAAGH,MAAM,CAAEV,WAAY,CAAC;IACzB,MAAM;MAAEc;IAAY,CAAC,GAAGJ,MAAM,CAAEX,SAAU,CAAC;IAE3C,OAAO;MACNQ,QAAQ,EAAEO,WAAW,CAAEH,sBAAsB,CAAE,MAAO,CAAE,CAAC;MACzDH,SAAS,EAAEI,oBAAoB,CAAET,UAAW,CAAC;MAC7CM,QAAQ,EAAEI,mBAAmB,CAAEV,UAAW;IAC3C,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAM;IAAEY;EAAwB,CAAC,GAAGlB,WAAW,CAAEG,WAAY,CAAC;EAE9D,IAAK,CAAEQ,SAAS,EAAG;IAClB,OAAO,IAAI;EACZ;EAEA,IAAK,CAAEH,aAAa,EAAG;IACtB,OACCW,aAAA,CAACd,sBAAsB,QACtBc,aAAA,CAACf,iBAAiB,MAAE,CACG,CAAC;EAE3B;EAEA,OACCe,aAAA,CAACd,sBAAsB,QACtBc,aAAA,CAACrB,SAAS;IACTsB,KAAK,GAAAX,qBAAA,GACJC,QAAQ,EAAEW,MAAM,EAAEC,cAAc,cAAAb,qBAAA,cAAAA,qBAAA,GAAIZ,EAAE,CAAE,gBAAiB,CACzD;IACD0B,MAAM,EAAGX,QAAU;IACnBY,QAAQ,EAAGA,CAAA,KAAMN,uBAAuB,CAAEZ,UAAW;EAAG,GAExDa,aAAA,CAACf,iBAAiB,MAAE,CACV,CACY,CAAC;AAE3B","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSelect","PostTypeSupportCheck","store","editorStore","PostFormatCheck","children","disablePostFormats","select","getEditorSettings","createElement","supportKeys"],"sources":["@wordpress/editor/src/components/post-format/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport PostTypeSupportCheck from '../post-type-support-check';\nimport { store as editorStore } from '../../store';\n\nfunction PostFormatCheck( { children } ) {\n\tconst disablePostFormats = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getEditorSettings().disablePostFormats,\n\t\t[]\n\t);\n\n\tif ( disablePostFormats ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PostTypeSupportCheck supportKeys=\"post-formats\">\n\t\t\t{ children }\n\t\t</PostTypeSupportCheck>\n\t);\n}\n\nexport default PostFormatCheck;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,4BAA4B;AAC7D,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAElD,SAASC,eAAeA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACxC,MAAMC,kBAAkB,GAAGN,SAAS,CACjCO,MAAM,IACPA,MAAM,CAAEJ,WAAY,CAAC,CAACK,iBAAiB,CAAC,CAAC,CAACF,kBAAkB,EAC7D,EACD,CAAC;EAED,IAAKA,kBAAkB,EAAG;IACzB,OAAO,IAAI;EACZ;EAEA,OACCG,aAAA,CAACR,oBAAoB;IAACS,WAAW,EAAC;EAAc,GAC7CL,QACmB,CAAC;AAEzB;AAEA,eAAeD,eAAe"}
|
|
1
|
+
{"version":3,"names":["useSelect","PostTypeSupportCheck","store","editorStore","PostFormatCheck","children","disablePostFormats","select","getEditorSettings","createElement","supportKeys"],"sources":["@wordpress/editor/src/components/post-format/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport PostTypeSupportCheck from '../post-type-support-check';\nimport { store as editorStore } from '../../store';\n\nfunction PostFormatCheck( { children } ) {\n\tconst disablePostFormats = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getEditorSettings().disablePostFormats,\n\t\t[]\n\t);\n\n\tif ( disablePostFormats ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PostTypeSupportCheck supportKeys=\"post-formats\">\n\t\t\t{ children }\n\t\t</PostTypeSupportCheck>\n\t);\n}\n\nexport default PostFormatCheck;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,4BAA4B;AAC7D,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAElD,SAASC,eAAeA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACxC,MAAMC,kBAAkB,GAAGN,SAAS,CACjCO,MAAM,IACPA,MAAM,CAAEJ,WAAY,CAAC,CAACK,iBAAiB,CAAC,CAAC,CAACF,kBAAkB,EAC7D,EACD,CAAC;EAED,IAAKA,kBAAkB,EAAG;IACzB,OAAO,IAAI;EACZ;EAEA,OACCG,aAAA,CAACR,oBAAoB;IAACS,WAAW,EAAC;EAAc,GAC7CL,QACmB,CAAC;AAEzB;AAEA,eAAeD,eAAe","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","sprintf","Button","SelectControl","useDispatch","useSelect","useInstanceId","store","coreStore","PostFormatCheck","editorStore","POST_FORMATS","id","caption","sort","a","b","normalizedA","toUpperCase","normalizedB","PostFormat","instanceId","postFormatSelectorId","postFormat","suggestedFormat","supportedFormats","select","getEditedPostAttribute","getSuggestedPostFormat","_postFormat","themeSupports","getThemeSupports","formats","filter","format","includes","suggestion","find","editPost","onUpdatePostFormat","createElement","className","__nextHasNoMarginBottom","label","value","onChange","options","map","variant","onClick"],"sources":["@wordpress/editor/src/components/post-format/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Button, SelectControl } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useInstanceId } from '@wordpress/compose';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport PostFormatCheck from './check';\nimport { store as editorStore } from '../../store';\n\n// All WP post formats, sorted alphabetically by translated name.\nexport const POST_FORMATS = [\n\t{ id: 'aside', caption: __( 'Aside' ) },\n\t{ id: 'audio', caption: __( 'Audio' ) },\n\t{ id: 'chat', caption: __( 'Chat' ) },\n\t{ id: 'gallery', caption: __( 'Gallery' ) },\n\t{ id: 'image', caption: __( 'Image' ) },\n\t{ id: 'link', caption: __( 'Link' ) },\n\t{ id: 'quote', caption: __( 'Quote' ) },\n\t{ id: 'standard', caption: __( 'Standard' ) },\n\t{ id: 'status', caption: __( 'Status' ) },\n\t{ id: 'video', caption: __( 'Video' ) },\n].sort( ( a, b ) => {\n\tconst normalizedA = a.caption.toUpperCase();\n\tconst normalizedB = b.caption.toUpperCase();\n\n\tif ( normalizedA < normalizedB ) {\n\t\treturn -1;\n\t}\n\tif ( normalizedA > normalizedB ) {\n\t\treturn 1;\n\t}\n\treturn 0;\n} );\n\nexport default function PostFormat() {\n\tconst instanceId = useInstanceId( PostFormat );\n\tconst postFormatSelectorId = `post-format-selector-${ instanceId }`;\n\n\tconst { postFormat, suggestedFormat, supportedFormats } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedPostAttribute, getSuggestedPostFormat } =\n\t\t\t\tselect( editorStore );\n\t\t\tconst _postFormat = getEditedPostAttribute( 'format' );\n\t\t\tconst themeSupports = select( coreStore ).getThemeSupports();\n\t\t\treturn {\n\t\t\t\tpostFormat: _postFormat ?? 'standard',\n\t\t\t\tsuggestedFormat: getSuggestedPostFormat(),\n\t\t\t\tsupportedFormats: themeSupports.formats,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst formats = POST_FORMATS.filter( ( format ) => {\n\t\t// Ensure current format is always in the set.\n\t\t// The current format may not be a format supported by the theme.\n\t\treturn (\n\t\t\tsupportedFormats?.includes( format.id ) || postFormat === format.id\n\t\t);\n\t} );\n\tconst suggestion = formats.find(\n\t\t( format ) => format.id === suggestedFormat\n\t);\n\n\tconst { editPost } = useDispatch( editorStore );\n\n\tconst onUpdatePostFormat = ( format ) => editPost( { format } );\n\n\treturn (\n\t\t<PostFormatCheck>\n\t\t\t<div className=\"editor-post-format\">\n\t\t\t\t<SelectControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Post Format' ) }\n\t\t\t\t\tvalue={ postFormat }\n\t\t\t\t\tonChange={ ( format ) => onUpdatePostFormat( format ) }\n\t\t\t\t\tid={ postFormatSelectorId }\n\t\t\t\t\toptions={ formats.map( ( format ) => ( {\n\t\t\t\t\t\tlabel: format.caption,\n\t\t\t\t\t\tvalue: format.id,\n\t\t\t\t\t} ) ) }\n\t\t\t\t/>\n\t\t\t\t{ suggestion && suggestion.id !== postFormat && (\n\t\t\t\t\t<p className=\"editor-post-format__suggestion\">\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\tonUpdatePostFormat( suggestion.id )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: post format */\n\t\t\t\t\t\t\t\t__( 'Apply suggested format: %s' ),\n\t\t\t\t\t\t\t\tsuggestion.caption\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</p>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</PostFormatCheck>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,MAAM,EAAEC,aAAa,QAAQ,uBAAuB;AAC7D,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,OAAOC,eAAe,MAAM,SAAS;AACrC,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BAAuB;IACvBC,KAAK,EAAG3C,EAAE,CAAE,aAAc,CAAG;IAC7B4C,KAAK,EAAGrB,UAAY;IACpBsB,QAAQ,EAAKX,MAAM,IAAMK,kBAAkB,CAAEL,MAAO,CAAG;IACvDtB,EAAE,EAAGU,oBAAsB;IAC3BwB,OAAO,EAAGd,OAAO,CAACe,GAAG,CAAIb,MAAM,KAAQ;MACtCS,KAAK,EAAET,MAAM,CAACrB,OAAO;MACrB+B,KAAK,EAAEV,MAAM,CAACtB;IACf,CAAC,CAAG;EAAG,CACP,CAAC,EACAwB,UAAU,IAAIA,UAAU,CAACxB,EAAE,KAAKW,UAAU,IAC3CiB,aAAA;IAAGC,SAAS,EAAC;EAAgC,GAC5CD,aAAA,CAACtC,MAAM;IACN8C,OAAO,EAAC,MAAM;IACdC,OAAO,EAAGA,CAAA,KACTV,kBAAkB,CAAEH,UAAU,CAACxB,EAAG;EAClC,GAECX,OAAO,EACR;EACAD,EAAE,CAAE,4BAA6B,CAAC,EAClCoC,UAAU,CAACvB,OACZ,CACO,CACN,CAEA,CACW,CAAC;AAEpB"}
|
|
1
|
+
{"version":3,"names":["__","sprintf","Button","SelectControl","useDispatch","useSelect","useInstanceId","store","coreStore","PostFormatCheck","editorStore","POST_FORMATS","id","caption","sort","a","b","normalizedA","toUpperCase","normalizedB","PostFormat","instanceId","postFormatSelectorId","postFormat","suggestedFormat","supportedFormats","select","getEditedPostAttribute","getSuggestedPostFormat","_postFormat","themeSupports","getThemeSupports","formats","filter","format","includes","suggestion","find","editPost","onUpdatePostFormat","createElement","className","__nextHasNoMarginBottom","label","value","onChange","options","map","variant","onClick"],"sources":["@wordpress/editor/src/components/post-format/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Button, SelectControl } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useInstanceId } from '@wordpress/compose';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport PostFormatCheck from './check';\nimport { store as editorStore } from '../../store';\n\n// All WP post formats, sorted alphabetically by translated name.\nexport const POST_FORMATS = [\n\t{ id: 'aside', caption: __( 'Aside' ) },\n\t{ id: 'audio', caption: __( 'Audio' ) },\n\t{ id: 'chat', caption: __( 'Chat' ) },\n\t{ id: 'gallery', caption: __( 'Gallery' ) },\n\t{ id: 'image', caption: __( 'Image' ) },\n\t{ id: 'link', caption: __( 'Link' ) },\n\t{ id: 'quote', caption: __( 'Quote' ) },\n\t{ id: 'standard', caption: __( 'Standard' ) },\n\t{ id: 'status', caption: __( 'Status' ) },\n\t{ id: 'video', caption: __( 'Video' ) },\n].sort( ( a, b ) => {\n\tconst normalizedA = a.caption.toUpperCase();\n\tconst normalizedB = b.caption.toUpperCase();\n\n\tif ( normalizedA < normalizedB ) {\n\t\treturn -1;\n\t}\n\tif ( normalizedA > normalizedB ) {\n\t\treturn 1;\n\t}\n\treturn 0;\n} );\n\nexport default function PostFormat() {\n\tconst instanceId = useInstanceId( PostFormat );\n\tconst postFormatSelectorId = `post-format-selector-${ instanceId }`;\n\n\tconst { postFormat, suggestedFormat, supportedFormats } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedPostAttribute, getSuggestedPostFormat } =\n\t\t\t\tselect( editorStore );\n\t\t\tconst _postFormat = getEditedPostAttribute( 'format' );\n\t\t\tconst themeSupports = select( coreStore ).getThemeSupports();\n\t\t\treturn {\n\t\t\t\tpostFormat: _postFormat ?? 'standard',\n\t\t\t\tsuggestedFormat: getSuggestedPostFormat(),\n\t\t\t\tsupportedFormats: themeSupports.formats,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst formats = POST_FORMATS.filter( ( format ) => {\n\t\t// Ensure current format is always in the set.\n\t\t// The current format may not be a format supported by the theme.\n\t\treturn (\n\t\t\tsupportedFormats?.includes( format.id ) || postFormat === format.id\n\t\t);\n\t} );\n\tconst suggestion = formats.find(\n\t\t( format ) => format.id === suggestedFormat\n\t);\n\n\tconst { editPost } = useDispatch( editorStore );\n\n\tconst onUpdatePostFormat = ( format ) => editPost( { format } );\n\n\treturn (\n\t\t<PostFormatCheck>\n\t\t\t<div className=\"editor-post-format\">\n\t\t\t\t<SelectControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Post Format' ) }\n\t\t\t\t\tvalue={ postFormat }\n\t\t\t\t\tonChange={ ( format ) => onUpdatePostFormat( format ) }\n\t\t\t\t\tid={ postFormatSelectorId }\n\t\t\t\t\toptions={ formats.map( ( format ) => ( {\n\t\t\t\t\t\tlabel: format.caption,\n\t\t\t\t\t\tvalue: format.id,\n\t\t\t\t\t} ) ) }\n\t\t\t\t/>\n\t\t\t\t{ suggestion && suggestion.id !== postFormat && (\n\t\t\t\t\t<p className=\"editor-post-format__suggestion\">\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\tonUpdatePostFormat( suggestion.id )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: post format */\n\t\t\t\t\t\t\t\t__( 'Apply suggested format: %s' ),\n\t\t\t\t\t\t\t\tsuggestion.caption\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</p>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</PostFormatCheck>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,MAAM,EAAEC,aAAa,QAAQ,uBAAuB;AAC7D,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,OAAOC,eAAe,MAAM,SAA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IACbuC,uBAAuB;IACvBC,KAAK,EAAG3C,EAAE,CAAE,aAAc,CAAG;IAC7B4C,KAAK,EAAGrB,UAAY;IACpBsB,QAAQ,EAAKX,MAAM,IAAMK,kBAAkB,CAAEL,MAAO,CAAG;IACvDtB,EAAE,EAAGU,oBAAsB;IAC3BwB,OAAO,EAAGd,OAAO,CAACe,GAAG,CAAIb,MAAM,KAAQ;MACtCS,KAAK,EAAET,MAAM,CAACrB,OAAO;MACrB+B,KAAK,EAAEV,MAAM,CAACtB;IACf,CAAC,CAAG;EAAG,CACP,CAAC,EACAwB,UAAU,IAAIA,UAAU,CAACxB,EAAE,KAAKW,UAAU,IAC3CiB,aAAA;IAAGC,SAAS,EAAC;EAAgC,GAC5CD,aAAA,CAACtC,MAAM;IACN8C,OAAO,EAAC,MAAM;IACdC,OAAO,EAAGA,CAAA,KACTV,kBAAkB,CAAEH,UAAU,CAACxB,EAAG;EAClC,GAECX,OAAO,EACR;EACAD,EAAE,CAAE,4BAA6B,CAAC,EAClCoC,UAAU,CAACvB,OACZ,CACO,CACN,CAEA,CACW,CAAC;AAEpB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSelect","PostTypeSupportCheck","store","editorStore","PostLastRevisionCheck","children","lastRevisionId","revisionsCount","select","getCurrentPostLastRevisionId","getCurrentPostRevisionsCount","createElement","supportKeys"],"sources":["@wordpress/editor/src/components/post-last-revision/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport PostTypeSupportCheck from '../post-type-support-check';\nimport { store as editorStore } from '../../store';\n\nfunction PostLastRevisionCheck( { children } ) {\n\tconst { lastRevisionId, revisionsCount } = useSelect( ( select ) => {\n\t\tconst { getCurrentPostLastRevisionId, getCurrentPostRevisionsCount } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\tlastRevisionId: getCurrentPostLastRevisionId(),\n\t\t\trevisionsCount: getCurrentPostRevisionsCount(),\n\t\t};\n\t}, [] );\n\n\tif ( ! lastRevisionId || revisionsCount < 2 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PostTypeSupportCheck supportKeys=\"revisions\">\n\t\t\t{ children }\n\t\t</PostTypeSupportCheck>\n\t);\n}\n\nexport default PostLastRevisionCheck;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,4BAA4B;AAC7D,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAElD,SAASC,qBAAqBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EAC9C,MAAM;IAAEC,cAAc;IAAEC;EAAe,CAAC,GAAGP,SAAS,CAAIQ,MAAM,IAAM;IACnE,MAAM;MAAEC,4BAA4B;MAAEC;IAA6B,CAAC,GACnEF,MAAM,CAAEL,WAAY,CAAC;IACtB,OAAO;MACNG,cAAc,EAAEG,4BAA4B,CAAC,CAAC;MAC9CF,cAAc,EAAEG,4BAA4B,CAAC;IAC9C,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,IAAK,CAAEJ,cAAc,IAAIC,cAAc,GAAG,CAAC,EAAG;IAC7C,OAAO,IAAI;EACZ;EAEA,OACCI,aAAA,CAACV,oBAAoB;IAACW,WAAW,EAAC;EAAW,GAC1CP,QACmB,CAAC;AAEzB;AAEA,eAAeD,qBAAqB"}
|
|
1
|
+
{"version":3,"names":["useSelect","PostTypeSupportCheck","store","editorStore","PostLastRevisionCheck","children","lastRevisionId","revisionsCount","select","getCurrentPostLastRevisionId","getCurrentPostRevisionsCount","createElement","supportKeys"],"sources":["@wordpress/editor/src/components/post-last-revision/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport PostTypeSupportCheck from '../post-type-support-check';\nimport { store as editorStore } from '../../store';\n\nfunction PostLastRevisionCheck( { children } ) {\n\tconst { lastRevisionId, revisionsCount } = useSelect( ( select ) => {\n\t\tconst { getCurrentPostLastRevisionId, getCurrentPostRevisionsCount } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\tlastRevisionId: getCurrentPostLastRevisionId(),\n\t\t\trevisionsCount: getCurrentPostRevisionsCount(),\n\t\t};\n\t}, [] );\n\n\tif ( ! lastRevisionId || revisionsCount < 2 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PostTypeSupportCheck supportKeys=\"revisions\">\n\t\t\t{ children }\n\t\t</PostTypeSupportCheck>\n\t);\n}\n\nexport default PostLastRevisionCheck;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,4BAA4B;AAC7D,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAElD,SAASC,qBAAqBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EAC9C,MAAM;IAAEC,cAAc;IAAEC;EAAe,CAAC,GAAGP,SAAS,CAAIQ,MAAM,IAAM;IACnE,MAAM;MAAEC,4BAA4B;MAAEC;IAA6B,CAAC,GACnEF,MAAM,CAAEL,WAAY,CAAC;IACtB,OAAO;MACNG,cAAc,EAAEG,4BAA4B,CAAC,CAAC;MAC9CF,cAAc,EAAEG,4BAA4B,CAAC;IAC9C,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,IAAK,CAAEJ,cAAc,IAAIC,cAAc,GAAG,CAAC,EAAG;IAC7C,OAAO,IAAI;EACZ;EAEA,OACCI,aAAA,CAACV,oBAAoB;IAACW,WAAW,EAAC;EAAW,GAC1CP,QACmB,CAAC;AAEzB;AAEA,eAAeD,qBAAqB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["sprintf","__","Button","useSelect","backup","addQueryArgs","PostLastRevisionCheck","store","editorStore","LastRevision","lastRevisionId","revisionsCount","select","getCurrentPostLastRevisionId","getCurrentPostRevisionsCount","createElement","href","revision","className","icon","iconPosition","text"],"sources":["@wordpress/editor/src/components/post-last-revision/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { sprintf, __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { backup } from '@wordpress/icons';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport PostLastRevisionCheck from './check';\nimport { store as editorStore } from '../../store';\n\nfunction LastRevision() {\n\tconst { lastRevisionId, revisionsCount } = useSelect( ( select ) => {\n\t\tconst { getCurrentPostLastRevisionId, getCurrentPostRevisionsCount } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\tlastRevisionId: getCurrentPostLastRevisionId(),\n\t\t\trevisionsCount: getCurrentPostRevisionsCount(),\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<PostLastRevisionCheck>\n\t\t\t<Button\n\t\t\t\thref={ addQueryArgs( 'revision.php', {\n\t\t\t\t\trevision: lastRevisionId,\n\t\t\t\t} ) }\n\t\t\t\tclassName=\"editor-post-last-revision__title\"\n\t\t\t\ticon={ backup }\n\t\t\t\ticonPosition=\"right\"\n\t\t\t\ttext={ sprintf(\n\t\t\t\t\t/* translators: %s: number of revisions */\n\t\t\t\t\t__( 'Revisions (%s)' ),\n\t\t\t\t\trevisionsCount\n\t\t\t\t) }\n\t\t\t/>\n\t\t</PostLastRevisionCheck>\n\t);\n}\n\nexport default LastRevision;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,OAAO,EAAEC,EAAE,QAAQ,iBAAiB;AAC7C,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,MAAM,QAAQ,kBAAkB;AACzC,SAASC,YAAY,QAAQ,gBAAgB;;AAE7C;AACA;AACA;AACA,OAAOC,qBAAqB,MAAM,SAAS;AAC3C,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAElD,SAASC,YAAYA,CAAA,EAAG;EACvB,MAAM;IAAEC,cAAc;IAAEC;EAAe,CAAC,GAAGR,SAAS,CAAIS,MAAM,IAAM;IACnE,MAAM;MAAEC,4BAA4B;MAAEC;IAA6B,CAAC,GACnEF,MAAM,CAAEJ,WAAY,CAAC;IACtB,OAAO;MACNE,cAAc,EAAEG,4BAA4B,CAAC,CAAC;MAC9CF,cAAc,EAAEG,4BAA4B,CAAC;IAC9C,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,OACCC,aAAA,CAACT,qBAAqB,QACrBS,aAAA,CAACb,MAAM;IACNc,IAAI,EAAGX,YAAY,CAAE,cAAc,EAAE;MACpCY,QAAQ,EAAEP;IACX,CAAE,CAAG;IACLQ,SAAS,EAAC,kCAAkC;IAC5CC,IAAI,EAAGf,MAAQ;IACfgB,YAAY,EAAC,OAAO;IACpBC,IAAI,EAAGrB,OAAO,EACb;IACAC,EAAE,CAAE,gBAAiB,CAAC,EACtBU,cACD;EAAG,CACH,CACqB,CAAC;AAE1B;AAEA,eAAeF,YAAY"}
|
|
1
|
+
{"version":3,"names":["sprintf","__","Button","useSelect","backup","addQueryArgs","PostLastRevisionCheck","store","editorStore","LastRevision","lastRevisionId","revisionsCount","select","getCurrentPostLastRevisionId","getCurrentPostRevisionsCount","createElement","href","revision","className","icon","iconPosition","text"],"sources":["@wordpress/editor/src/components/post-last-revision/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { sprintf, __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { backup } from '@wordpress/icons';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport PostLastRevisionCheck from './check';\nimport { store as editorStore } from '../../store';\n\nfunction LastRevision() {\n\tconst { lastRevisionId, revisionsCount } = useSelect( ( select ) => {\n\t\tconst { getCurrentPostLastRevisionId, getCurrentPostRevisionsCount } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\tlastRevisionId: getCurrentPostLastRevisionId(),\n\t\t\trevisionsCount: getCurrentPostRevisionsCount(),\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<PostLastRevisionCheck>\n\t\t\t<Button\n\t\t\t\thref={ addQueryArgs( 'revision.php', {\n\t\t\t\t\trevision: lastRevisionId,\n\t\t\t\t} ) }\n\t\t\t\tclassName=\"editor-post-last-revision__title\"\n\t\t\t\ticon={ backup }\n\t\t\t\ticonPosition=\"right\"\n\t\t\t\ttext={ sprintf(\n\t\t\t\t\t/* translators: %s: number of revisions */\n\t\t\t\t\t__( 'Revisions (%s)' ),\n\t\t\t\t\trevisionsCount\n\t\t\t\t) }\n\t\t\t/>\n\t\t</PostLastRevisionCheck>\n\t);\n}\n\nexport default LastRevision;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,OAAO,EAAEC,EAAE,QAAQ,iBAAiB;AAC7C,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,MAAM,QAAQ,kBAAkB;AACzC,SAASC,YAAY,QAAQ,gBAAgB;;AAE7C;AACA;AACA;AACA,OAAOC,qBAAqB,MAAM,SAAS;AAC3C,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAElD,SAASC,YAAYA,CAAA,EAAG;EACvB,MAAM;IAAEC,cAAc;IAAEC;EAAe,CAAC,GAAGR,SAAS,CAAIS,MAAM,IAAM;IACnE,MAAM;MAAEC,4BAA4B;MAAEC;IAA6B,CAAC,GACnEF,MAAM,CAAEJ,WAAY,CAAC;IACtB,OAAO;MACNE,cAAc,EAAEG,4BAA4B,CAAC,CAAC;MAC9CF,cAAc,EAAEG,4BAA4B,CAAC;IAC9C,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,OACCC,aAAA,CAACT,qBAAqB,QACrBS,aAAA,CAACb,MAAM;IACNc,IAAI,EAAGX,YAAY,CAAE,cAAc,EAAE;MACpCY,QAAQ,EAAEP;IACX,CAAE,CAAG;IACLQ,SAAS,EAAC,kCAAkC;IAC5CC,IAAI,EAAGf,MAAQ;IACfgB,YAAY,EAAC,OAAO;IACpBC,IAAI,EAAGrB,OAAO,EACb;IACAC,EAAE,CAAE,gBAAiB,CAAC,EACtBU,cACD;EAAG,CACH,CACqB,CAAC;AAE1B;AAEA,eAAeF,YAAY","ignoreList":[]}
|