@wordpress/editor 14.10.0 → 14.11.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 +6 -0
- package/README.md +2 -2
- package/build/bindings/post-meta.js +2 -1
- package/build/bindings/post-meta.js.map +1 -1
- package/build/components/collab-sidebar/add-comment.js +120 -0
- package/build/components/collab-sidebar/add-comment.js.map +1 -0
- package/build/components/collab-sidebar/comment-button-toolbar.js +37 -0
- package/build/components/collab-sidebar/comment-button-toolbar.js.map +1 -0
- package/build/components/collab-sidebar/comment-button.js +37 -0
- package/build/components/collab-sidebar/comment-button.js.map +1 -0
- package/build/components/collab-sidebar/comments.js +321 -0
- package/build/components/collab-sidebar/comments.js.map +1 -0
- package/build/components/collab-sidebar/constants.js +8 -0
- package/build/components/collab-sidebar/constants.js.map +1 -0
- package/build/components/collab-sidebar/index.js +272 -0
- package/build/components/collab-sidebar/index.js.map +1 -0
- package/build/components/collab-sidebar/utils.js +16 -0
- package/build/components/collab-sidebar/utils.js.map +1 -0
- package/build/components/commands/index.js +6 -6
- package/build/components/commands/index.js.map +1 -1
- package/build/components/document-bar/index.js +8 -7
- package/build/components/document-bar/index.js.map +1 -1
- package/build/components/document-tools/index.js +1 -5
- package/build/components/document-tools/index.js.map +1 -1
- package/build/components/editor-interface/index.js +3 -2
- package/build/components/editor-interface/index.js.map +1 -1
- package/build/components/entities-saved-states/index.js +1 -1
- package/build/components/entities-saved-states/index.js.map +1 -1
- package/build/components/global-keyboard-shortcuts/register-shortcuts.js +3 -3
- package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
- package/build/components/global-styles-provider/index.js +13 -3
- package/build/components/global-styles-provider/index.js.map +1 -1
- package/build/components/header/index.js +5 -2
- package/build/components/header/index.js.map +1 -1
- package/build/components/inserter-sidebar/index.js +2 -2
- package/build/components/inserter-sidebar/index.js.map +1 -1
- package/build/components/page-attributes/parent.js +5 -5
- package/build/components/page-attributes/parent.js.map +1 -1
- package/build/components/plugin-more-menu-item/index.js +13 -11
- package/build/components/plugin-more-menu-item/index.js.map +1 -1
- package/build/components/plugin-preview-menu-item/index.js +15 -13
- package/build/components/plugin-preview-menu-item/index.js.map +1 -1
- package/build/components/plugin-sidebar/index.js +0 -15
- package/build/components/plugin-sidebar/index.js.map +1 -1
- package/build/components/post-actions/index.js +5 -5
- package/build/components/post-actions/index.js.map +1 -1
- package/build/components/post-author/panel.js +4 -4
- package/build/components/post-author/panel.js.map +1 -1
- package/build/components/post-card-panel/index.js +7 -36
- package/build/components/post-card-panel/index.js.map +1 -1
- package/build/components/post-content-information/index.js +1 -2
- package/build/components/post-content-information/index.js.map +1 -1
- package/build/components/post-featured-image/index.js +26 -7
- package/build/components/post-featured-image/index.js.map +1 -1
- package/build/components/post-last-revision/index.js +1 -1
- package/build/components/post-last-revision/index.js.map +1 -1
- package/build/components/post-schedule/label.js +1 -1
- package/build/components/post-schedule/label.js.map +1 -1
- package/build/components/post-taxonomies/flat-term-selector.js +9 -1
- package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/hierarchical-term-selector.js +2 -2
- package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build/components/post-url/index.js +1 -1
- package/build/components/post-url/index.js.map +1 -1
- package/build/components/post-url/panel.js +3 -3
- package/build/components/post-url/panel.js.map +1 -1
- package/build/components/preview-dropdown/index.js +0 -4
- package/build/components/preview-dropdown/index.js.map +1 -1
- package/build/components/provider/index.js +10 -12
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.js +1 -1
- package/build/components/provider/use-block-editor-settings.js.map +1 -1
- package/build/components/sidebar/header.js +2 -1
- package/build/components/sidebar/header.js.map +1 -1
- package/build/components/sidebar/index.js +3 -3
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/time-to-read/index.js +2 -2
- package/build/components/time-to-read/index.js.map +1 -1
- package/build/components/visual-editor/index.js +25 -27
- package/build/components/visual-editor/index.js.map +1 -1
- package/build/components/visual-editor/use-zoom-out-mode-exit.js +52 -0
- package/build/components/visual-editor/use-zoom-out-mode-exit.js.map +1 -0
- package/build/components/zoom-out-toggle/index.js +37 -5
- package/build/components/zoom-out-toggle/index.js.map +1 -1
- package/build/dataviews/actions/duplicate-template-part.js +2 -2
- package/build/dataviews/actions/duplicate-template-part.js.map +1 -1
- package/build/store/actions.js +4 -3
- package/build/store/actions.js.map +1 -1
- package/build/store/private-actions.js +2 -2
- package/build/store/private-actions.js.map +1 -1
- package/build/store/selectors.js +3 -2
- package/build/store/selectors.js.map +1 -1
- package/build/utils/pageTypeBadge.js +51 -0
- package/build/utils/pageTypeBadge.js.map +1 -0
- package/build/utils/terms.js +2 -2
- package/build/utils/terms.js.map +1 -1
- package/build-module/bindings/post-meta.js +2 -1
- package/build-module/bindings/post-meta.js.map +1 -1
- package/build-module/components/collab-sidebar/add-comment.js +114 -0
- package/build-module/components/collab-sidebar/add-comment.js.map +1 -0
- package/build-module/components/collab-sidebar/comment-button-toolbar.js +30 -0
- package/build-module/components/collab-sidebar/comment-button-toolbar.js.map +1 -0
- package/build-module/components/collab-sidebar/comment-button.js +30 -0
- package/build-module/components/collab-sidebar/comment-button.js.map +1 -0
- package/build-module/components/collab-sidebar/comments.js +314 -0
- package/build-module/components/collab-sidebar/comments.js.map +1 -0
- package/build-module/components/collab-sidebar/constants.js +2 -0
- package/build-module/components/collab-sidebar/constants.js.map +1 -0
- package/build-module/components/collab-sidebar/index.js +264 -0
- package/build-module/components/collab-sidebar/index.js.map +1 -0
- package/build-module/components/collab-sidebar/utils.js +10 -0
- package/build-module/components/collab-sidebar/utils.js.map +1 -0
- package/build-module/components/commands/index.js +6 -6
- package/build-module/components/commands/index.js.map +1 -1
- package/build-module/components/document-bar/index.js +9 -8
- package/build-module/components/document-bar/index.js.map +1 -1
- package/build-module/components/document-tools/index.js +2 -6
- package/build-module/components/document-tools/index.js.map +1 -1
- package/build-module/components/editor-interface/index.js +3 -2
- package/build-module/components/editor-interface/index.js.map +1 -1
- package/build-module/components/entities-saved-states/index.js +1 -1
- package/build-module/components/entities-saved-states/index.js.map +1 -1
- package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +3 -3
- package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
- package/build-module/components/global-styles-provider/index.js +13 -3
- package/build-module/components/global-styles-provider/index.js.map +1 -1
- package/build-module/components/header/index.js +5 -2
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/inserter-sidebar/index.js +2 -2
- package/build-module/components/inserter-sidebar/index.js.map +1 -1
- package/build-module/components/page-attributes/parent.js +5 -5
- package/build-module/components/page-attributes/parent.js.map +1 -1
- package/build-module/components/plugin-more-menu-item/index.js +12 -10
- package/build-module/components/plugin-more-menu-item/index.js.map +1 -1
- package/build-module/components/plugin-preview-menu-item/index.js +14 -12
- package/build-module/components/plugin-preview-menu-item/index.js.map +1 -1
- package/build-module/components/plugin-sidebar/index.js +0 -15
- package/build-module/components/plugin-sidebar/index.js.map +1 -1
- package/build-module/components/post-actions/index.js +5 -5
- package/build-module/components/post-actions/index.js.map +1 -1
- package/build-module/components/post-author/panel.js +4 -4
- package/build-module/components/post-author/panel.js.map +1 -1
- package/build-module/components/post-card-panel/index.js +8 -36
- package/build-module/components/post-card-panel/index.js.map +1 -1
- package/build-module/components/post-content-information/index.js +1 -2
- package/build-module/components/post-content-information/index.js.map +1 -1
- package/build-module/components/post-featured-image/index.js +26 -7
- package/build-module/components/post-featured-image/index.js.map +1 -1
- package/build-module/components/post-last-revision/index.js +1 -1
- package/build-module/components/post-last-revision/index.js.map +1 -1
- package/build-module/components/post-schedule/label.js +1 -1
- package/build-module/components/post-schedule/label.js.map +1 -1
- package/build-module/components/post-taxonomies/flat-term-selector.js +12 -4
- package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js +2 -2
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build-module/components/post-url/index.js +1 -1
- package/build-module/components/post-url/index.js.map +1 -1
- package/build-module/components/post-url/panel.js +3 -3
- package/build-module/components/post-url/panel.js.map +1 -1
- package/build-module/components/preview-dropdown/index.js +0 -4
- package/build-module/components/preview-dropdown/index.js.map +1 -1
- package/build-module/components/provider/index.js +10 -12
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.js +1 -1
- package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
- package/build-module/components/sidebar/header.js +2 -1
- package/build-module/components/sidebar/header.js.map +1 -1
- package/build-module/components/sidebar/index.js +4 -4
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/time-to-read/index.js +2 -2
- package/build-module/components/time-to-read/index.js.map +1 -1
- package/build-module/components/visual-editor/index.js +26 -28
- package/build-module/components/visual-editor/index.js.map +1 -1
- package/build-module/components/visual-editor/use-zoom-out-mode-exit.js +46 -0
- package/build-module/components/visual-editor/use-zoom-out-mode-exit.js.map +1 -0
- package/build-module/components/zoom-out-toggle/index.js +37 -5
- package/build-module/components/zoom-out-toggle/index.js.map +1 -1
- package/build-module/dataviews/actions/duplicate-template-part.js +3 -3
- package/build-module/dataviews/actions/duplicate-template-part.js.map +1 -1
- package/build-module/store/actions.js +4 -3
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/private-actions.js +3 -3
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/selectors.js +3 -2
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/pageTypeBadge.js +45 -0
- package/build-module/utils/pageTypeBadge.js.map +1 -0
- package/build-module/utils/terms.js +2 -2
- package/build-module/utils/terms.js.map +1 -1
- package/build-style/style-rtl.css +96 -54
- package/build-style/style.css +96 -54
- package/build-types/bindings/post-meta.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/add-comment.d.ts +15 -0
- package/build-types/components/collab-sidebar/add-comment.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/comment-button-toolbar.d.ts +5 -0
- package/build-types/components/collab-sidebar/comment-button-toolbar.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/comment-button.d.ts +5 -0
- package/build-types/components/collab-sidebar/comment-button.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/comments.d.ts +19 -0
- package/build-types/components/collab-sidebar/comments.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/constants.d.ts +2 -0
- package/build-types/components/collab-sidebar/constants.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/index.d.ts +5 -0
- package/build-types/components/collab-sidebar/index.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/utils.d.ts +8 -0
- package/build-types/components/collab-sidebar/utils.d.ts.map +1 -0
- package/build-types/components/commands/index.d.ts.map +1 -1
- package/build-types/components/document-bar/index.d.ts.map +1 -1
- package/build-types/components/document-tools/index.d.ts.map +1 -1
- package/build-types/components/editor-interface/index.d.ts.map +1 -1
- package/build-types/components/global-styles-provider/index.d.ts.map +1 -1
- package/build-types/components/header/index.d.ts.map +1 -1
- package/build-types/components/inserter-sidebar/index.d.ts.map +1 -1
- package/build-types/components/page-attributes/parent.d.ts.map +1 -1
- package/build-types/components/plugin-more-menu-item/index.d.ts +62 -2
- package/build-types/components/plugin-more-menu-item/index.d.ts.map +1 -1
- package/build-types/components/plugin-preview-menu-item/index.d.ts +41 -2
- package/build-types/components/plugin-preview-menu-item/index.d.ts.map +1 -1
- package/build-types/components/plugin-sidebar/index.d.ts.map +1 -1
- package/build-types/components/post-author/panel.d.ts.map +1 -1
- package/build-types/components/post-card-panel/index.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/flat-term-selector.d.ts.map +1 -1
- package/build-types/components/preview-dropdown/index.d.ts.map +1 -1
- package/build-types/components/provider/index.d.ts.map +1 -1
- package/build-types/components/sidebar/index.d.ts.map +1 -1
- package/build-types/components/visual-editor/index.d.ts.map +1 -1
- package/build-types/components/visual-editor/use-zoom-out-mode-exit.d.ts +5 -0
- package/build-types/components/visual-editor/use-zoom-out-mode-exit.d.ts.map +1 -0
- package/build-types/components/zoom-out-toggle/index.d.ts +3 -1
- package/build-types/components/zoom-out-toggle/index.d.ts.map +1 -1
- package/build-types/store/actions.d.ts.map +1 -1
- package/build-types/store/selectors.d.ts.map +1 -1
- package/build-types/utils/pageTypeBadge.d.ts +5 -0
- package/build-types/utils/pageTypeBadge.d.ts.map +1 -0
- package/build-types/utils/terms.d.ts.map +1 -1
- package/package.json +38 -37
- package/src/bindings/post-meta.js +1 -0
- package/src/components/collab-sidebar/add-comment.js +124 -0
- package/src/components/collab-sidebar/comment-button-toolbar.js +29 -0
- package/src/components/collab-sidebar/comment-button.js +31 -0
- package/src/components/collab-sidebar/comments.js +404 -0
- package/src/components/collab-sidebar/constants.js +1 -0
- package/src/components/collab-sidebar/index.js +307 -0
- package/src/components/collab-sidebar/style.scss +111 -0
- package/src/components/collab-sidebar/utils.js +9 -0
- package/src/components/commands/index.js +9 -7
- package/src/components/document-bar/index.js +15 -7
- package/src/components/document-bar/style.scss +0 -4
- package/src/components/document-tools/index.js +1 -7
- package/src/components/editor-interface/index.js +4 -3
- package/src/components/entities-saved-states/index.js +2 -2
- package/src/components/global-keyboard-shortcuts/register-shortcuts.js +3 -3
- package/src/components/global-styles-provider/index.js +20 -6
- package/src/components/header/index.js +3 -1
- package/src/components/inserter-sidebar/index.js +3 -6
- package/src/components/page-attributes/parent.js +6 -4
- package/src/components/plugin-more-menu-item/index.js +12 -11
- package/src/components/plugin-preview-menu-item/index.js +14 -13
- package/src/components/plugin-sidebar/index.js +0 -13
- package/src/components/post-actions/index.js +8 -11
- package/src/components/post-author/panel.js +4 -2
- package/src/components/post-card-panel/index.js +9 -43
- package/src/components/post-card-panel/style.scss +1 -9
- package/src/components/post-content-information/index.js +1 -1
- package/src/components/post-featured-image/index.js +31 -16
- package/src/components/post-featured-image/style.scss +5 -2
- package/src/components/post-last-revision/index.js +1 -1
- package/src/components/post-schedule/label.js +1 -1
- package/src/components/post-sticky/test/index.js +6 -6
- package/src/components/post-taxonomies/flat-term-selector.js +15 -4
- package/src/components/post-taxonomies/hierarchical-term-selector.js +2 -2
- package/src/components/post-url/index.js +1 -1
- package/src/components/post-url/panel.js +4 -2
- package/src/components/preview-dropdown/index.js +0 -2
- package/src/components/provider/index.js +31 -24
- package/src/components/provider/use-block-editor-settings.js +1 -1
- package/src/components/sidebar/header.js +3 -2
- package/src/components/sidebar/index.js +5 -3
- package/src/components/time-to-read/index.js +3 -3
- package/src/components/visual-editor/index.js +32 -41
- package/src/components/visual-editor/use-zoom-out-mode-exit.js +49 -0
- package/src/components/zoom-out-toggle/index.js +39 -5
- package/src/dataviews/actions/duplicate-template-part.tsx +3 -3
- package/src/store/actions.js +5 -3
- package/src/store/private-actions.js +3 -3
- package/src/store/selectors.js +3 -2
- package/src/style.scss +1 -0
- package/src/utils/pageTypeBadge.js +41 -0
- package/src/utils/terms.js +4 -2
- package/src/utils/test/terms.js +3 -3
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BlockInspector","store","blockEditorStore","useSelect","useDispatch","Platform","useCallback","useContext","useEffect","useRef","isRTL","__","drawerLeft","drawerRight","keyboardShortcutsStore","privateApis","componentsPrivateApis","interfaceStore","PatternOverridesPanel","PluginDocumentSettingPanel","PluginSidebar","PostSummary","PostTaxonomiesPanel","PostTransformPanel","SidebarHeader","TemplateContentPanel","TemplatePartContentPanel","useAutoSwitchEditorSidebars","sidebars","unlock","editorStore","NAVIGATION_POST_TYPE","TEMPLATE_PART_POST_TYPE","TEMPLATE_POST_TYPE","jsx","_jsx","jsxs","_jsxs","Tabs","SIDEBAR_ACTIVE_BY_DEFAULT","select","web","native","SidebarContent","tabName","keyboardShortcut","onActionPerformed","extraPanels","tabListRef","tabsContextValue","Context","tabsElements","Array","from","current","querySelectorAll","selectedTabElement","find","element","getAttribute","activeElement","ownerDocument","tabsHasFocus","some","id","focus","identifier","header","Provider","value","children","ref","closeLabel","className","headerClassName","title","toggleShortcut","icon","isActiveByDefault","TabPanel","tabId","document","focusable","Slot","block","Sidebar","showSummary","shortcut","getShortcutRepresentation","sidebar","getActiveComplementaryArea","_isEditorSidebarOpened","includes","_tabName","getBlockSelectionStart","getCurrentPostType","enableComplementaryArea","onTabSelect","newSelectedTabId","selectedTabId","onSelect","selectOnMove"],"sources":["@wordpress/editor/src/components/sidebar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tBlockInspector,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tPlatform,\n\tuseCallback,\n\tuseContext,\n\tuseEffect,\n\tuseRef,\n} from '@wordpress/element';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { drawerLeft, drawerRight } from '@wordpress/icons';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport PatternOverridesPanel from '../pattern-overrides-panel';\nimport PluginDocumentSettingPanel from '../plugin-document-setting-panel';\nimport PluginSidebar from '../plugin-sidebar';\nimport PostSummary from './post-summary';\nimport PostTaxonomiesPanel from '../post-taxonomies/panel';\nimport PostTransformPanel from '../post-transform-panel';\nimport SidebarHeader from './header';\nimport TemplateContentPanel from '../template-content-panel';\nimport TemplatePartContentPanel from '../template-part-content-panel';\nimport useAutoSwitchEditorSidebars from '../provider/use-auto-switch-editor-sidebars';\nimport { sidebars } from './constants';\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\nimport {\n\tNAVIGATION_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tTEMPLATE_POST_TYPE,\n} from '../../store/constants';\n\nconst { Tabs } = unlock( componentsPrivateApis );\n\nconst SIDEBAR_ACTIVE_BY_DEFAULT = Platform.select( {\n\tweb: true,\n\tnative: false,\n} );\n\nconst SidebarContent = ( {\n\ttabName,\n\tkeyboardShortcut,\n\tonActionPerformed,\n\textraPanels,\n} ) => {\n\tconst tabListRef = useRef( null );\n\t// Because `PluginSidebar` renders a `ComplementaryArea`, we\n\t// need to forward the `Tabs` context so it can be passed through the\n\t// underlying slot/fill.\n\tconst tabsContextValue = useContext( Tabs.Context );\n\n\t// This effect addresses a race condition caused by tabbing from the last\n\t// block in the editor into the settings sidebar. Without this effect, the\n\t// selected tab and browser focus can become separated in an unexpected way\n\t// (e.g the \"block\" tab is focused, but the \"post\" tab is selected).\n\tuseEffect( () => {\n\t\tconst tabsElements = Array.from(\n\t\t\ttabListRef.current?.querySelectorAll( '[role=\"tab\"]' ) || []\n\t\t);\n\t\tconst selectedTabElement = tabsElements.find(\n\t\t\t// We are purposefully using a custom `data-tab-id` attribute here\n\t\t\t// because we don't want rely on any assumptions about `Tabs`\n\t\t\t// component internals.\n\t\t\t( element ) => element.getAttribute( 'data-tab-id' ) === tabName\n\t\t);\n\t\tconst activeElement = selectedTabElement?.ownerDocument.activeElement;\n\t\tconst tabsHasFocus = tabsElements.some( ( element ) => {\n\t\t\treturn activeElement && activeElement.id === element.id;\n\t\t} );\n\t\tif (\n\t\t\ttabsHasFocus &&\n\t\t\tselectedTabElement &&\n\t\t\tselectedTabElement.id !== activeElement?.id\n\t\t) {\n\t\t\tselectedTabElement?.focus();\n\t\t}\n\t}, [ tabName ] );\n\n\treturn (\n\t\t<PluginSidebar\n\t\t\tidentifier={ tabName }\n\t\t\theader={\n\t\t\t\t<Tabs.Context.Provider value={ tabsContextValue }>\n\t\t\t\t\t<SidebarHeader ref={ tabListRef } />\n\t\t\t\t</Tabs.Context.Provider>\n\t\t\t}\n\t\t\tcloseLabel={ __( 'Close Settings' ) }\n\t\t\t// This classname is added so we can apply a corrective negative\n\t\t\t// margin to the panel.\n\t\t\t// see https://github.com/WordPress/gutenberg/pull/55360#pullrequestreview-1737671049\n\t\t\tclassName=\"editor-sidebar__panel\"\n\t\t\theaderClassName=\"editor-sidebar__panel-tabs\"\n\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\ttitle={ __( 'Settings' ) }\n\t\t\ttoggleShortcut={ keyboardShortcut }\n\t\t\ticon={ isRTL() ? drawerLeft : drawerRight }\n\t\t\tisActiveByDefault={ SIDEBAR_ACTIVE_BY_DEFAULT }\n\t\t>\n\t\t\t<Tabs.Context.Provider value={ tabsContextValue }>\n\t\t\t\t<Tabs.TabPanel tabId={ sidebars.document } focusable={ false }>\n\t\t\t\t\t<PostSummary onActionPerformed={ onActionPerformed } />\n\t\t\t\t\t<PluginDocumentSettingPanel.Slot />\n\t\t\t\t\t<TemplateContentPanel />\n\t\t\t\t\t<TemplatePartContentPanel />\n\t\t\t\t\t<PostTransformPanel />\n\t\t\t\t\t<PostTaxonomiesPanel />\n\t\t\t\t\t<PatternOverridesPanel />\n\t\t\t\t\t{ extraPanels }\n\t\t\t\t</Tabs.TabPanel>\n\t\t\t\t<Tabs.TabPanel tabId={ sidebars.block } focusable={ false }>\n\t\t\t\t\t<BlockInspector />\n\t\t\t\t</Tabs.TabPanel>\n\t\t\t</Tabs.Context.Provider>\n\t\t</PluginSidebar>\n\t);\n};\n\nconst Sidebar = ( { extraPanels, onActionPerformed } ) => {\n\tuseAutoSwitchEditorSidebars();\n\tconst { tabName, keyboardShortcut, showSummary } = useSelect(\n\t\t( select ) => {\n\t\t\tconst shortcut = select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getShortcutRepresentation( 'core/editor/toggle-sidebar' );\n\n\t\t\tconst sidebar =\n\t\t\t\tselect( interfaceStore ).getActiveComplementaryArea( 'core' );\n\t\t\tconst _isEditorSidebarOpened = [\n\t\t\t\tsidebars.block,\n\t\t\t\tsidebars.document,\n\t\t\t].includes( sidebar );\n\t\t\tlet _tabName = sidebar;\n\t\t\tif ( ! _isEditorSidebarOpened ) {\n\t\t\t\t_tabName = !! select(\n\t\t\t\t\tblockEditorStore\n\t\t\t\t).getBlockSelectionStart()\n\t\t\t\t\t? sidebars.block\n\t\t\t\t\t: sidebars.document;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\ttabName: _tabName,\n\t\t\t\tkeyboardShortcut: shortcut,\n\t\t\t\tshowSummary: ! [\n\t\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\t\t\tNAVIGATION_POST_TYPE,\n\t\t\t\t].includes( select( editorStore ).getCurrentPostType() ),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\n\tconst onTabSelect = useCallback(\n\t\t( newSelectedTabId ) => {\n\t\t\tif ( !! newSelectedTabId ) {\n\t\t\t\tenableComplementaryArea( 'core', newSelectedTabId );\n\t\t\t}\n\t\t},\n\t\t[ enableComplementaryArea ]\n\t);\n\n\treturn (\n\t\t<Tabs\n\t\t\tselectedTabId={ tabName }\n\t\t\tonSelect={ onTabSelect }\n\t\t\tselectOnMove={ false }\n\t\t>\n\t\t\t<SidebarContent\n\t\t\t\ttabName={ tabName }\n\t\t\t\tkeyboardShortcut={ keyboardShortcut }\n\t\t\t\tshowSummary={ showSummary }\n\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\textraPanels={ extraPanels }\n\t\t\t/>\n\t\t</Tabs>\n\t);\n};\n\nexport default Sidebar;\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,cAAc,EACdC,KAAK,IAAIC,gBAAgB,QACnB,yBAAyB;AAChC,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SACCC,QAAQ,EACRC,WAAW,EACXC,UAAU,EACVC,SAAS,EACTC,MAAM,QACA,oBAAoB;AAC3B,SAASC,KAAK,EAAEC,EAAE,QAAQ,iBAAiB;AAC3C,SAASC,UAAU,EAAEC,WAAW,QAAQ,kBAAkB;AAC1D,SAASZ,KAAK,IAAIa,sBAAsB,QAAQ,+BAA+B;AAC/E,SAASC,WAAW,IAAI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AGJ,OAAO;IACtB,IAAK,CAAEE,sBAAsB,EAAG;MAC/BE,QAAQ,GAAG,CAAC,CAAErD,MAAM,CACnBtC,gBACD,CAAC,CAAC4F,sBAAsB,CAAC,CAAC,GACvBlE,QAAQ,CAACwD,KAAK,GACdxD,QAAQ,CAACqD,QAAQ;IACrB;IAEA,OAAO;MACNrC,OAAO,EAAEiD,QAAQ;MACjBhD,gBAAgB,EAAE0C,QAAQ;MAC1BD,WAAW,EAAE,CAAE,CACdrD,kBAAkB,EAClBD,uBAAuB,EACvBD,oBAAoB,CACpB,CAAC6D,QAAQ,CAAEpD,MAAM,CAAEV,WAAY,CAAC,CAACiE,kBAAkB,CAAC,CAAE;IACxD,CAAC;EACF,CAAC,EACD,EACD,CAAC;EAED,MAAM;IAAEC;EAAwB,CAAC,GAAG5F,WAAW,CAAEa,cAAe,CAAC;EAEjE,MAAMgF,WAAW,GAAG3F,WAAW,CAC5B4F,gBAAgB,IAAM;IACvB,IAAK,CAAC,CAAEA,gBAAgB,EAAG;MAC1BF,uBAAuB,CAAE,MAAM,EAAEE,gBAAiB,CAAC;IACpD;EACD,CAAC,EACD,CAAEF,uBAAuB,CAC1B,CAAC;EAED,oBACC7D,IAAA,CAACG,IAAI;IACJ6D,aAAa,EAAGvD,OAAS;IACzBwD,QAAQ,EAAGH,WAAa;IACxBI,YAAY,EAAG,KAAO;IAAA/B,QAAA,eAEtBnC,IAAA,CAACQ,cAAc;MACdC,OAAO,EAAGA,OAAS;MACnBC,gBAAgB,EAAGA,gBAAkB;MACrCyC,WAAW,EAAGA,WAAa;MAC3BxC,iBAAiB,EAAGA,iBAAmB;MACvCC,WAAW,EAAGA;IAAa,CAC3B;EAAC,CACG,CAAC;AAET,CAAC;AAED,eAAesC,OAAO","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["BlockInspector","store","blockEditorStore","useSelect","useDispatch","Platform","useCallback","useContext","useEffect","useRef","isRTL","__","_x","drawerLeft","drawerRight","keyboardShortcutsStore","privateApis","componentsPrivateApis","interfaceStore","PatternOverridesPanel","PluginDocumentSettingPanel","PluginSidebar","PostSummary","PostTaxonomiesPanel","PostTransformPanel","SidebarHeader","TemplateContentPanel","TemplatePartContentPanel","useAutoSwitchEditorSidebars","sidebars","unlock","editorStore","NAVIGATION_POST_TYPE","TEMPLATE_PART_POST_TYPE","TEMPLATE_POST_TYPE","jsx","_jsx","jsxs","_jsxs","Tabs","SIDEBAR_ACTIVE_BY_DEFAULT","select","web","native","SidebarContent","tabName","keyboardShortcut","onActionPerformed","extraPanels","tabListRef","tabsContextValue","Context","tabsElements","Array","from","current","querySelectorAll","selectedTabElement","find","element","getAttribute","activeElement","ownerDocument","tabsHasFocus","some","id","focus","identifier","header","Provider","value","children","ref","closeLabel","className","headerClassName","title","toggleShortcut","icon","isActiveByDefault","TabPanel","tabId","document","focusable","Slot","block","Sidebar","showSummary","shortcut","getShortcutRepresentation","sidebar","getActiveComplementaryArea","_isEditorSidebarOpened","includes","_tabName","getBlockSelectionStart","getCurrentPostType","enableComplementaryArea","onTabSelect","newSelectedTabId","selectedTabId","onSelect","selectOnMove"],"sources":["@wordpress/editor/src/components/sidebar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tBlockInspector,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tPlatform,\n\tuseCallback,\n\tuseContext,\n\tuseEffect,\n\tuseRef,\n} from '@wordpress/element';\nimport { isRTL, __, _x } from '@wordpress/i18n';\nimport { drawerLeft, drawerRight } from '@wordpress/icons';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport PatternOverridesPanel from '../pattern-overrides-panel';\nimport PluginDocumentSettingPanel from '../plugin-document-setting-panel';\nimport PluginSidebar from '../plugin-sidebar';\nimport PostSummary from './post-summary';\nimport PostTaxonomiesPanel from '../post-taxonomies/panel';\nimport PostTransformPanel from '../post-transform-panel';\nimport SidebarHeader from './header';\nimport TemplateContentPanel from '../template-content-panel';\nimport TemplatePartContentPanel from '../template-part-content-panel';\nimport useAutoSwitchEditorSidebars from '../provider/use-auto-switch-editor-sidebars';\nimport { sidebars } from './constants';\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\nimport {\n\tNAVIGATION_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tTEMPLATE_POST_TYPE,\n} from '../../store/constants';\n\nconst { Tabs } = unlock( componentsPrivateApis );\n\nconst SIDEBAR_ACTIVE_BY_DEFAULT = Platform.select( {\n\tweb: true,\n\tnative: false,\n} );\n\nconst SidebarContent = ( {\n\ttabName,\n\tkeyboardShortcut,\n\tonActionPerformed,\n\textraPanels,\n} ) => {\n\tconst tabListRef = useRef( null );\n\t// Because `PluginSidebar` renders a `ComplementaryArea`, we\n\t// need to forward the `Tabs` context so it can be passed through the\n\t// underlying slot/fill.\n\tconst tabsContextValue = useContext( Tabs.Context );\n\n\t// This effect addresses a race condition caused by tabbing from the last\n\t// block in the editor into the settings sidebar. Without this effect, the\n\t// selected tab and browser focus can become separated in an unexpected way\n\t// (e.g the \"block\" tab is focused, but the \"post\" tab is selected).\n\tuseEffect( () => {\n\t\tconst tabsElements = Array.from(\n\t\t\ttabListRef.current?.querySelectorAll( '[role=\"tab\"]' ) || []\n\t\t);\n\t\tconst selectedTabElement = tabsElements.find(\n\t\t\t// We are purposefully using a custom `data-tab-id` attribute here\n\t\t\t// because we don't want rely on any assumptions about `Tabs`\n\t\t\t// component internals.\n\t\t\t( element ) => element.getAttribute( 'data-tab-id' ) === tabName\n\t\t);\n\t\tconst activeElement = selectedTabElement?.ownerDocument.activeElement;\n\t\tconst tabsHasFocus = tabsElements.some( ( element ) => {\n\t\t\treturn activeElement && activeElement.id === element.id;\n\t\t} );\n\t\tif (\n\t\t\ttabsHasFocus &&\n\t\t\tselectedTabElement &&\n\t\t\tselectedTabElement.id !== activeElement?.id\n\t\t) {\n\t\t\tselectedTabElement?.focus();\n\t\t}\n\t}, [ tabName ] );\n\n\treturn (\n\t\t<PluginSidebar\n\t\t\tidentifier={ tabName }\n\t\t\theader={\n\t\t\t\t<Tabs.Context.Provider value={ tabsContextValue }>\n\t\t\t\t\t<SidebarHeader ref={ tabListRef } />\n\t\t\t\t</Tabs.Context.Provider>\n\t\t\t}\n\t\t\tcloseLabel={ __( 'Close Settings' ) }\n\t\t\t// This classname is added so we can apply a corrective negative\n\t\t\t// margin to the panel.\n\t\t\t// see https://github.com/WordPress/gutenberg/pull/55360#pullrequestreview-1737671049\n\t\t\tclassName=\"editor-sidebar__panel\"\n\t\t\theaderClassName=\"editor-sidebar__panel-tabs\"\n\t\t\ttitle={\n\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t_x( 'Settings', 'sidebar button label' )\n\t\t\t}\n\t\t\ttoggleShortcut={ keyboardShortcut }\n\t\t\ticon={ isRTL() ? drawerLeft : drawerRight }\n\t\t\tisActiveByDefault={ SIDEBAR_ACTIVE_BY_DEFAULT }\n\t\t>\n\t\t\t<Tabs.Context.Provider value={ tabsContextValue }>\n\t\t\t\t<Tabs.TabPanel tabId={ sidebars.document } focusable={ false }>\n\t\t\t\t\t<PostSummary onActionPerformed={ onActionPerformed } />\n\t\t\t\t\t<PluginDocumentSettingPanel.Slot />\n\t\t\t\t\t<TemplateContentPanel />\n\t\t\t\t\t<TemplatePartContentPanel />\n\t\t\t\t\t<PostTransformPanel />\n\t\t\t\t\t<PostTaxonomiesPanel />\n\t\t\t\t\t<PatternOverridesPanel />\n\t\t\t\t\t{ extraPanels }\n\t\t\t\t</Tabs.TabPanel>\n\t\t\t\t<Tabs.TabPanel tabId={ sidebars.block } focusable={ false }>\n\t\t\t\t\t<BlockInspector />\n\t\t\t\t</Tabs.TabPanel>\n\t\t\t</Tabs.Context.Provider>\n\t\t</PluginSidebar>\n\t);\n};\n\nconst Sidebar = ( { extraPanels, onActionPerformed } ) => {\n\tuseAutoSwitchEditorSidebars();\n\tconst { tabName, keyboardShortcut, showSummary } = useSelect(\n\t\t( select ) => {\n\t\t\tconst shortcut = select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getShortcutRepresentation( 'core/editor/toggle-sidebar' );\n\n\t\t\tconst sidebar =\n\t\t\t\tselect( interfaceStore ).getActiveComplementaryArea( 'core' );\n\t\t\tconst _isEditorSidebarOpened = [\n\t\t\t\tsidebars.block,\n\t\t\t\tsidebars.document,\n\t\t\t].includes( sidebar );\n\t\t\tlet _tabName = sidebar;\n\t\t\tif ( ! _isEditorSidebarOpened ) {\n\t\t\t\t_tabName = !! select(\n\t\t\t\t\tblockEditorStore\n\t\t\t\t).getBlockSelectionStart()\n\t\t\t\t\t? sidebars.block\n\t\t\t\t\t: sidebars.document;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\ttabName: _tabName,\n\t\t\t\tkeyboardShortcut: shortcut,\n\t\t\t\tshowSummary: ! [\n\t\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\t\t\tNAVIGATION_POST_TYPE,\n\t\t\t\t].includes( select( editorStore ).getCurrentPostType() ),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\n\tconst onTabSelect = useCallback(\n\t\t( newSelectedTabId ) => {\n\t\t\tif ( !! newSelectedTabId ) {\n\t\t\t\tenableComplementaryArea( 'core', newSelectedTabId );\n\t\t\t}\n\t\t},\n\t\t[ enableComplementaryArea ]\n\t);\n\n\treturn (\n\t\t<Tabs\n\t\t\tselectedTabId={ tabName }\n\t\t\tonSelect={ onTabSelect }\n\t\t\tselectOnMove={ false }\n\t\t>\n\t\t\t<SidebarContent\n\t\t\t\ttabName={ tabName }\n\t\t\t\tkeyboardShortcut={ keyboardShortcut }\n\t\t\t\tshowSumm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ACD,CAAC,EACD,CAAEF,uBAAuB,CAC1B,CAAC;EAED,oBACC7D,IAAA,CAACG,IAAI;IACJ6D,aAAa,EAAGvD,OAAS;IACzBwD,QAAQ,EAAGH,WAAa;IACxBI,YAAY,EAAG,KAAO;IAAA/B,QAAA,eAEtBnC,IAAA,CAACQ,cAAc;MACdC,OAAO,EAAGA,OAAS;MACnBC,gBAAgB,EAAGA,gBAAkB;MACrCyC,WAAW,EAAGA,WAAa;MAC3BxC,iBAAiB,EAAGA,iBAAmB;MACvCC,WAAW,EAAGA;IAAa,CAC3B;EAAC,CACG,CAAC;AAET,CAAC;AAED,eAAesC,OAAO","ignoreList":[]}
|
|
@@ -38,8 +38,8 @@ export default function TimeToRead() {
|
|
|
38
38
|
const minutesToRead = Math.round(wordCount(content, wordCountType) / AVERAGE_READING_RATE);
|
|
39
39
|
const minutesToReadString = minutesToRead === 0 ? createInterpolateElement(__('<span>< 1</span> minute'), {
|
|
40
40
|
span: /*#__PURE__*/_jsx("span", {})
|
|
41
|
-
}) : createInterpolateElement(sprintf(/* translators: %s
|
|
42
|
-
_n('<span>%
|
|
41
|
+
}) : createInterpolateElement(sprintf(/* translators: %s: the number of minutes to read the post. */
|
|
42
|
+
_n('<span>%s</span> minute', '<span>%s</span> minutes', minutesToRead), minutesToRead), {
|
|
43
43
|
span: /*#__PURE__*/_jsx("span", {})
|
|
44
44
|
});
|
|
45
45
|
return /*#__PURE__*/_jsx("span", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSelect","_x","_n","__","sprintf","count","wordCount","createInterpolateElement","store","editorStore","jsx","_jsx","AVERAGE_READING_RATE","TimeToRead","content","select","getEditedPostAttribute","wordCountType","minutesToRead","Math","round","minutesToReadString","span","className","children"],"sources":["@wordpress/editor/src/components/time-to-read/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { _x, _n, __, sprintf } from '@wordpress/i18n';\nimport { count as wordCount } from '@wordpress/wordcount';\nimport { createInterpolateElement } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Average reading rate - based on average taken from\n * https://irisreading.com/average-reading-speed-in-various-languages/\n * (Characters/minute used for Chinese rather than words).\n *\n * @type {number} A rough estimate of the average reading rate across multiple languages.\n */\nconst AVERAGE_READING_RATE = 189;\n\n/**\n * Component for showing Time To Read in Content.\n *\n * @return {JSX.Element} The rendered TimeToRead component.\n */\nexport default function TimeToRead() {\n\tconst content = useSelect(\n\t\t( select ) => select( editorStore ).getEditedPostAttribute( 'content' ),\n\t\t[]\n\t);\n\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 minutesToRead = Math.round(\n\t\twordCount( content, wordCountType ) / AVERAGE_READING_RATE\n\t);\n\tconst minutesToReadString =\n\t\tminutesToRead === 0\n\t\t\t? createInterpolateElement( __( '<span>< 1</span> minute' ), {\n\t\t\t\t\tspan: <span />,\n\t\t\t } )\n\t\t\t: createInterpolateElement(\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: %s
|
|
1
|
+
{"version":3,"names":["useSelect","_x","_n","__","sprintf","count","wordCount","createInterpolateElement","store","editorStore","jsx","_jsx","AVERAGE_READING_RATE","TimeToRead","content","select","getEditedPostAttribute","wordCountType","minutesToRead","Math","round","minutesToReadString","span","className","children"],"sources":["@wordpress/editor/src/components/time-to-read/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { _x, _n, __, sprintf } from '@wordpress/i18n';\nimport { count as wordCount } from '@wordpress/wordcount';\nimport { createInterpolateElement } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Average reading rate - based on average taken from\n * https://irisreading.com/average-reading-speed-in-various-languages/\n * (Characters/minute used for Chinese rather than words).\n *\n * @type {number} A rough estimate of the average reading rate across multiple languages.\n */\nconst AVERAGE_READING_RATE = 189;\n\n/**\n * Component for showing Time To Read in Content.\n *\n * @return {JSX.Element} The rendered TimeToRead component.\n */\nexport default function TimeToRead() {\n\tconst content = useSelect(\n\t\t( select ) => select( editorStore ).getEditedPostAttribute( 'content' ),\n\t\t[]\n\t);\n\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 minutesToRead = Math.round(\n\t\twordCount( content, wordCountType ) / AVERAGE_READING_RATE\n\t);\n\tconst minutesToReadString =\n\t\tminutesToRead === 0\n\t\t\t? createInterpolateElement( __( '<span>< 1</span> minute' ), {\n\t\t\t\t\tspan: <span />,\n\t\t\t } )\n\t\t\t: createInterpolateElement(\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: %s: the number of minutes to read the post. */\n\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t'<span>%s</span> minute',\n\t\t\t\t\t\t\t'<span>%s</span> minutes',\n\t\t\t\t\t\t\tminutesToRead\n\t\t\t\t\t\t),\n\t\t\t\t\t\tminutesToRead\n\t\t\t\t\t),\n\t\t\t\t\t{\n\t\t\t\t\t\tspan: <span />,\n\t\t\t\t\t}\n\t\t\t );\n\n\treturn <span className=\"time-to-read\">{ minutesToReadString }</span>;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,EAAE,EAAEC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACrD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,wBAAwB,QAAQ,oBAAoB;;AAE7D;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AANA,SAAAC,GAAA,IAAAC,IAAA;AAOA,MAAMC,oBAAoB,GAAG,GAAG;;AAEhC;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,UAAUA,CAAA,EAAG;EACpC,MAAMC,OAAO,GAAGd,SAAS,CACtBe,MAAM,IAAMA,MAAM,CAAEN,WAAY,CAAC,CAACO,sBAAsB,CAAE,SAAU,CAAC,EACvE,EACD,CAAC;;EAED;AACD;AACA;AACA;AACA;EACC,MAAMC,aAAa,GAAGhB,EAAE,CAAE,OAAO,EAAE,oCAAqC,CAAC;EACzE,MAAMiB,aAAa,GAAGC,IAAI,CAACC,KAAK,CAC/Bd,SAAS,CAAEQ,OAAO,EAAEG,aAAc,CAAC,GAAGL,oBACvC,CAAC;EACD,MAAMS,mBAAmB,GACxBH,aAAa,KAAK,CAAC,GAChBX,wBAAwB,CAAEJ,EAAE,CAAE,yBAA0B,CAAC,EAAE;IAC3DmB,IAAI,eAAEX,IAAA,WAAO;EACb,CAAE,CAAC,GACHJ,wBAAwB,CACxBH,OAAO,CACN;EACAF,EAAE,CACD,wBAAwB,EACxB,yBAAyB,EACzBgB,aACD,CAAC,EACDA,aACD,CAAC,EACD;IACCI,IAAI,eAAEX,IAAA,WAAO;EACd,CACA,CAAC;EAEL,oBAAOA,IAAA;IAAMY,SAAS,EAAC,cAAc;IAAAC,QAAA,EAAGH;EAAmB,CAAQ,CAAC;AACrE","ignoreList":[]}
|
|
@@ -7,7 +7,7 @@ import clsx from 'clsx';
|
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
9
|
import { BlockList, store as blockEditorStore, __unstableUseTypewriter as useTypewriter, __unstableUseTypingObserver as useTypingObserver, useSettings, RecursionProvider, privateApis as blockEditorPrivateApis, __experimentalUseResizeCanvas as useResizeCanvas } from '@wordpress/block-editor';
|
|
10
|
-
import { useEffect, useRef, useMemo } from '@wordpress/element';
|
|
10
|
+
import { useEffect, useRef, useMemo, useState } from '@wordpress/element';
|
|
11
11
|
import { useSelect } from '@wordpress/data';
|
|
12
12
|
import { parse } from '@wordpress/blocks';
|
|
13
13
|
import { store as coreStore } from '@wordpress/core-data';
|
|
@@ -23,14 +23,14 @@ import EditTemplateBlocksNotification from './edit-template-blocks-notification'
|
|
|
23
23
|
import ResizableEditor from '../resizable-editor';
|
|
24
24
|
import useSelectNearestEditableBlock from './use-select-nearest-editable-block';
|
|
25
25
|
import { NAVIGATION_POST_TYPE, PATTERN_POST_TYPE, TEMPLATE_PART_POST_TYPE, TEMPLATE_POST_TYPE } from '../../store/constants';
|
|
26
|
+
import { useZoomOutModeExit } from './use-zoom-out-mode-exit';
|
|
26
27
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
27
28
|
const {
|
|
28
29
|
LayoutStyle,
|
|
29
30
|
useLayoutClasses,
|
|
30
31
|
useLayoutStyles,
|
|
31
32
|
ExperimentalBlockCanvas: BlockCanvas,
|
|
32
|
-
useFlashEditableBlocks
|
|
33
|
-
useZoomOutModeExit
|
|
33
|
+
useFlashEditableBlocks
|
|
34
34
|
} = unlock(blockEditorPrivateApis);
|
|
35
35
|
|
|
36
36
|
/**
|
|
@@ -78,9 +78,11 @@ function VisualEditor({
|
|
|
78
78
|
contentRef,
|
|
79
79
|
className
|
|
80
80
|
}) {
|
|
81
|
-
const [
|
|
81
|
+
const [contentHeight, setContentHeight] = useState('');
|
|
82
|
+
const effectContentHeight = useResizeObserver(([entry]) => {
|
|
83
|
+
setContentHeight(entry.borderBoxSize[0].blockSize);
|
|
84
|
+
});
|
|
82
85
|
const isMobileViewport = useViewportMatch('small', '<');
|
|
83
|
-
const isTabletViewport = useViewportMatch('medium', '<');
|
|
84
86
|
const {
|
|
85
87
|
renderingMode,
|
|
86
88
|
postContentAttributes,
|
|
@@ -130,7 +132,7 @@ function VisualEditor({
|
|
|
130
132
|
deviceType: getDeviceType(),
|
|
131
133
|
isFocusedEntity: !!editorSettings.onNavigateToPreviousEntityRecord,
|
|
132
134
|
postType: postTypeSlug,
|
|
133
|
-
isPreview: editorSettings.
|
|
135
|
+
isPreview: editorSettings.isPreviewMode
|
|
134
136
|
};
|
|
135
137
|
}, []);
|
|
136
138
|
const {
|
|
@@ -245,17 +247,6 @@ function VisualEditor({
|
|
|
245
247
|
.is-root-container.alignwide:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: var(--wp--style--global--wide-size);}
|
|
246
248
|
.is-root-container.alignfull { max-width: none; margin-left: auto; margin-right: auto;}
|
|
247
249
|
.is-root-container.alignfull:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: none;}`;
|
|
248
|
-
const localRef = useRef();
|
|
249
|
-
const typewriterRef = useTypewriter();
|
|
250
|
-
contentRef = useMergeRefs([localRef, contentRef, renderingMode === 'post-only' ? typewriterRef : null, useFlashEditableBlocks({
|
|
251
|
-
isEnabled: renderingMode === 'template-locked'
|
|
252
|
-
}), useSelectNearestEditableBlock({
|
|
253
|
-
isEnabled: renderingMode === 'template-locked'
|
|
254
|
-
}), useZoomOutModeExit()]);
|
|
255
|
-
const zoomOutProps = isZoomedOut && !isTabletViewport ? {
|
|
256
|
-
scale: 'default',
|
|
257
|
-
frameSize: '40px'
|
|
258
|
-
} : {};
|
|
259
250
|
const forceFullHeight = postType === NAVIGATION_POST_TYPE;
|
|
260
251
|
const enableResizing = [NAVIGATION_POST_TYPE, TEMPLATE_PART_POST_TYPE, PATTERN_POST_TYPE].includes(postType) &&
|
|
261
252
|
// Disable in previews / view mode.
|
|
@@ -264,34 +255,45 @@ function VisualEditor({
|
|
|
264
255
|
!isMobileViewport &&
|
|
265
256
|
// Dsiable resizing in zoomed-out mode.
|
|
266
257
|
!isZoomedOut;
|
|
267
|
-
const shouldIframe = !disableIframe || ['Tablet', 'Mobile'].includes(deviceType);
|
|
268
258
|
const iframeStyles = useMemo(() => {
|
|
269
259
|
return [...(styles !== null && styles !== void 0 ? styles : []), {
|
|
270
|
-
|
|
260
|
+
// Ensures margins of children are contained so that the body background paints behind them.
|
|
261
|
+
// Otherwise, the background of html (when zoomed out) would show there and appear broken. It’s
|
|
262
|
+
// important mostly for post-only views yet conceivably an issue in templated views too.
|
|
263
|
+
css: `:where(.block-editor-iframe__body){display:flow-root;}.is-root-container{display:flow-root;${
|
|
271
264
|
// Some themes will have `min-height: 100vh` for the root container,
|
|
272
265
|
// which isn't a requirement in auto resize mode.
|
|
273
266
|
enableResizing ? 'min-height:0!important;' : ''}}`
|
|
274
267
|
}];
|
|
275
268
|
}, [styles, enableResizing]);
|
|
269
|
+
const localRef = useRef();
|
|
270
|
+
const typewriterRef = useTypewriter();
|
|
271
|
+
contentRef = useMergeRefs([localRef, contentRef, renderingMode === 'post-only' ? typewriterRef : null, useFlashEditableBlocks({
|
|
272
|
+
isEnabled: renderingMode === 'template-locked'
|
|
273
|
+
}), useSelectNearestEditableBlock({
|
|
274
|
+
isEnabled: renderingMode === 'template-locked'
|
|
275
|
+
}), useZoomOutModeExit(),
|
|
276
|
+
// Avoid resize listeners when not needed, these will trigger
|
|
277
|
+
// unnecessary re-renders when animating the iframe width.
|
|
278
|
+
enableResizing ? effectContentHeight : null]);
|
|
276
279
|
return /*#__PURE__*/_jsx("div", {
|
|
277
280
|
className: clsx('editor-visual-editor',
|
|
278
281
|
// this class is here for backward compatibility reasons.
|
|
279
282
|
'edit-post-visual-editor', className, {
|
|
280
283
|
'has-padding': isFocusedEntity || enableResizing,
|
|
281
284
|
'is-resizable': enableResizing,
|
|
282
|
-
'is-iframed':
|
|
285
|
+
'is-iframed': !disableIframe
|
|
283
286
|
}),
|
|
284
287
|
children: /*#__PURE__*/_jsx(ResizableEditor, {
|
|
285
288
|
enableResizing: enableResizing,
|
|
286
|
-
height:
|
|
289
|
+
height: contentHeight && !forceFullHeight ? contentHeight : '100%',
|
|
287
290
|
children: /*#__PURE__*/_jsxs(BlockCanvas, {
|
|
288
|
-
shouldIframe:
|
|
291
|
+
shouldIframe: !disableIframe,
|
|
289
292
|
contentRef: contentRef,
|
|
290
293
|
styles: iframeStyles,
|
|
291
294
|
height: "100%",
|
|
292
295
|
iframeProps: {
|
|
293
296
|
...iframeProps,
|
|
294
|
-
...zoomOutProps,
|
|
295
297
|
style: {
|
|
296
298
|
...iframeProps?.style,
|
|
297
299
|
...deviceStyles
|
|
@@ -344,11 +346,7 @@ function VisualEditor({
|
|
|
344
346
|
}), renderingMode === 'template-locked' && /*#__PURE__*/_jsx(EditTemplateBlocksNotification, {
|
|
345
347
|
contentRef: localRef
|
|
346
348
|
})]
|
|
347
|
-
})
|
|
348
|
-
// Avoid resize listeners when not needed,
|
|
349
|
-
// these will trigger unnecessary re-renders
|
|
350
|
-
// when animating the iframe width.
|
|
351
|
-
enableResizing && resizeObserver]
|
|
349
|
+
})]
|
|
352
350
|
})
|
|
353
351
|
})
|
|
354
352
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","BlockList","store","blockEditorStore","__unstableUseTypewriter","useTypewriter","__unstableUseTypingObserver","useTypingObserver","useSettings","RecursionProvider","privateApis","blockEditorPrivateApis","__experimentalUseResizeCanvas","useResizeCanvas","useEffect","useRef","useMemo","useSelect","parse","coreStore","useMergeRefs","useViewportMatch","useResizeObserver","PostTitle","editorStore","unlock","EditTemplateBlocksNotification","ResizableEditor","useSelectNearestEditableBlock","NAVIGATION_POST_TYPE","PATTERN_POST_TYPE","TEMPLATE_PART_POST_TYPE","TEMPLATE_POST_TYPE","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","LayoutStyle","useLayoutClasses","useLayoutStyles","ExperimentalBlockCanvas","BlockCanvas","useFlashEditableBlocks","useZoomOutModeExit","DESIGN_POST_TYPES","getPostContentAttributes","blocks","i","length","name","attributes","innerBlocks","nestedPostContent","checkForPostContentAtRootLevel","VisualEditor","autoFocus","styles","disableIframe","iframeProps","contentRef","className","resizeObserver","sizes","isMobileViewport","isTabletViewport","renderingMode","postContentAttributes","editedPostTemplate","wrapperBlockName","wrapperUniqueId","deviceType","isFocusedEntity","isDesignPostType","postType","isPreview","select","getCurrentPostId","getCurrentPostType","getCurrentTemplateId","getEditorSettings","getRenderingMode","getDeviceType","getPostType","getEditedEntityRecord","postTypeSlug","_renderingMode","_wrapperBlockName","editorSettings","supportsTemplateMode","postTypeObject","currentTemplateId","template","undefined","includes","viewable","onNavigateToPreviousEntityRecord","__unstableIsPreviewMode","isCleanNewPost","hasRootPaddingAwareAlignments","themeHasDisabledLayoutStyles","themeSupportsLayout","isZoomedOut","getSettings","isZoomOut","_isZoomOut","_settings","disableLayoutStyles","supportsLayout","__experimentalFeatures","useRootPaddingAwareAlignments","deviceStyles","globalLayoutSettings","fallbackLayout","type","newestPostContentAttributes","content","parseableContent","hasPostContentAtRootLevel","layout","align","postContentLayoutClasses","blockListLayoutClass","postContentLayoutStyles","postContentLayout","inherit","contentSize","wideSize","blockListLayout","postEditorLayout","observeTypingRef","titleRef","current","focus","alignCSS","localRef","typewriterRef","isEnabled","zoomOutProps","scale","frameSize","forceFullHeight","enableResizing","shouldIframe","iframeStyles","css","children","height","style","selector","contentEditable","ref","marginTop","blockName","uniqueId","toLowerCase","dropZoneElement","parentNode","__unstableDisableDropZone"],"sources":["@wordpress/editor/src/components/visual-editor/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tBlockList,\n\tstore as blockEditorStore,\n\t__unstableUseTypewriter as useTypewriter,\n\t__unstableUseTypingObserver as useTypingObserver,\n\tuseSettings,\n\tRecursionProvider,\n\tprivateApis as blockEditorPrivateApis,\n\t__experimentalUseResizeCanvas as useResizeCanvas,\n} from '@wordpress/block-editor';\nimport { useEffect, useRef, useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { parse } from '@wordpress/blocks';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tuseMergeRefs,\n\tuseViewportMatch,\n\tuseResizeObserver,\n} from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport PostTitle from '../post-title';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport EditTemplateBlocksNotification from './edit-template-blocks-notification';\nimport ResizableEditor from '../resizable-editor';\nimport useSelectNearestEditableBlock from './use-select-nearest-editable-block';\nimport {\n\tNAVIGATION_POST_TYPE,\n\tPATTERN_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tTEMPLATE_POST_TYPE,\n} from '../../store/constants';\n\nconst {\n\tLayoutStyle,\n\tuseLayoutClasses,\n\tuseLayoutStyles,\n\tExperimentalBlockCanvas: BlockCanvas,\n\tuseFlashEditableBlocks,\n\tuseZoomOutModeExit,\n} = unlock( blockEditorPrivateApis );\n\n/**\n * These post types have a special editor where they don't allow you to fill the title\n * and they don't apply the layout styles.\n */\nconst DESIGN_POST_TYPES = [\n\tPATTERN_POST_TYPE,\n\tTEMPLATE_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n];\n\n/**\n * Given an array of nested blocks, find the first Post Content\n * block inside it, recursing through any nesting levels,\n * and return its attributes.\n *\n * @param {Array} blocks A list of blocks.\n *\n * @return {Object | undefined} The Post Content block.\n */\nfunction getPostContentAttributes( blocks ) {\n\tfor ( let i = 0; i < blocks.length; i++ ) {\n\t\tif ( blocks[ i ].name === 'core/post-content' ) {\n\t\t\treturn blocks[ i ].attributes;\n\t\t}\n\t\tif ( blocks[ i ].innerBlocks.length ) {\n\t\t\tconst nestedPostContent = getPostContentAttributes(\n\t\t\t\tblocks[ i ].innerBlocks\n\t\t\t);\n\n\t\t\tif ( nestedPostContent ) {\n\t\t\t\treturn nestedPostContent;\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction checkForPostContentAtRootLevel( blocks ) {\n\tfor ( let i = 0; i < blocks.length; i++ ) {\n\t\tif ( blocks[ i ].name === 'core/post-content' ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\nfunction VisualEditor( {\n\t// Ideally as we unify post and site editors, we won't need these props.\n\tautoFocus,\n\tstyles,\n\tdisableIframe = false,\n\tiframeProps,\n\tcontentRef,\n\tclassName,\n} ) {\n\tconst [ resizeObserver, sizes ] = useResizeObserver();\n\tconst isMobileViewport = useViewportMatch( 'small', '<' );\n\tconst isTabletViewport = useViewportMatch( 'medium', '<' );\n\tconst {\n\t\trenderingMode,\n\t\tpostContentAttributes,\n\t\teditedPostTemplate = {},\n\t\twrapperBlockName,\n\t\twrapperUniqueId,\n\t\tdeviceType,\n\t\tisFocusedEntity,\n\t\tisDesignPostType,\n\t\tpostType,\n\t\tisPreview,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetCurrentPostId,\n\t\t\tgetCurrentPostType,\n\t\t\tgetCurrentTemplateId,\n\t\t\tgetEditorSettings,\n\t\t\tgetRenderingMode,\n\t\t\tgetDeviceType,\n\t\t} = select( editorStore );\n\t\tconst { getPostType, getEditedEntityRecord } = select( coreStore );\n\t\tconst postTypeSlug = getCurrentPostType();\n\t\tconst _renderingMode = getRenderingMode();\n\t\tlet _wrapperBlockName;\n\n\t\tif ( postTypeSlug === PATTERN_POST_TYPE ) {\n\t\t\t_wrapperBlockName = 'core/block';\n\t\t} else if ( _renderingMode === 'post-only' ) {\n\t\t\t_wrapperBlockName = 'core/post-content';\n\t\t}\n\n\t\tconst editorSettings = getEditorSettings();\n\t\tconst supportsTemplateMode = editorSettings.supportsTemplateMode;\n\t\tconst postTypeObject = getPostType( postTypeSlug );\n\t\tconst currentTemplateId = getCurrentTemplateId();\n\t\tconst template = currentTemplateId\n\t\t\t? getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\t\tcurrentTemplateId\n\t\t\t )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\trenderingMode: _renderingMode,\n\t\t\tpostContentAttributes: editorSettings.postContentAttributes,\n\t\t\tisDesignPostType: DESIGN_POST_TYPES.includes( postTypeSlug ),\n\t\t\t// Post template fetch returns a 404 on classic themes, which\n\t\t\t// messes with e2e tests, so check it's a block theme first.\n\t\t\teditedPostTemplate:\n\t\t\t\tpostTypeObject?.viewable && supportsTemplateMode\n\t\t\t\t\t? template\n\t\t\t\t\t: undefined,\n\t\t\twrapperBlockName: _wrapperBlockName,\n\t\t\twrapperUniqueId: getCurrentPostId(),\n\t\t\tdeviceType: getDeviceType(),\n\t\t\tisFocusedEntity: !! editorSettings.onNavigateToPreviousEntityRecord,\n\t\t\tpostType: postTypeSlug,\n\t\t\tisPreview: editorSettings.__unstableIsPreviewMode,\n\t\t};\n\t}, [] );\n\tconst { isCleanNewPost } = useSelect( editorStore );\n\tconst {\n\t\thasRootPaddingAwareAlignments,\n\t\tthemeHasDisabledLayoutStyles,\n\t\tthemeSupportsLayout,\n\t\tisZoomedOut,\n\t} = useSelect( ( select ) => {\n\t\tconst { getSettings, isZoomOut: _isZoomOut } = unlock(\n\t\t\tselect( blockEditorStore )\n\t\t);\n\n\t\tconst _settings = getSettings();\n\t\treturn {\n\t\t\tthemeHasDisabledLayoutStyles: _settings.disableLayoutStyles,\n\t\t\tthemeSupportsLayout: _settings.supportsLayout,\n\t\t\thasRootPaddingAwareAlignments:\n\t\t\t\t_settings.__experimentalFeatures?.useRootPaddingAwareAlignments,\n\t\t\tisZoomedOut: _isZoomOut(),\n\t\t};\n\t}, [] );\n\n\tconst deviceStyles = useResizeCanvas( deviceType );\n\tconst [ globalLayoutSettings ] = useSettings( 'layout' );\n\n\t// fallbackLayout is used if there is no Post Content,\n\t// and for Post Title.\n\tconst fallbackLayout = useMemo( () => {\n\t\tif ( renderingMode !== 'post-only' || isDesignPostType ) {\n\t\t\treturn { type: 'default' };\n\t\t}\n\n\t\tif ( themeSupportsLayout ) {\n\t\t\t// We need to ensure support for wide and full alignments,\n\t\t\t// so we add the constrained type.\n\t\t\treturn { ...globalLayoutSettings, type: 'constrained' };\n\t\t}\n\t\t// Set default layout for classic themes so all alignments are supported.\n\t\treturn { type: 'default' };\n\t}, [\n\t\trenderingMode,\n\t\tthemeSupportsLayout,\n\t\tglobalLayoutSettings,\n\t\tisDesignPostType,\n\t] );\n\n\tconst newestPostContentAttributes = useMemo( () => {\n\t\tif (\n\t\t\t! editedPostTemplate?.content &&\n\t\t\t! editedPostTemplate?.blocks &&\n\t\t\tpostContentAttributes\n\t\t) {\n\t\t\treturn postContentAttributes;\n\t\t}\n\t\t// When in template editing mode, we can access the blocks directly.\n\t\tif ( editedPostTemplate?.blocks ) {\n\t\t\treturn getPostContentAttributes( editedPostTemplate?.blocks );\n\t\t}\n\t\t// If there are no blocks, we have to parse the content string.\n\t\t// Best double-check it's a string otherwise the parse function gets unhappy.\n\t\tconst parseableContent =\n\t\t\ttypeof editedPostTemplate?.content === 'string'\n\t\t\t\t? editedPostTemplate?.content\n\t\t\t\t: '';\n\n\t\treturn getPostContentAttributes( parse( parseableContent ) ) || {};\n\t}, [\n\t\teditedPostTemplate?.content,\n\t\teditedPostTemplate?.blocks,\n\t\tpostContentAttributes,\n\t] );\n\n\tconst hasPostContentAtRootLevel = useMemo( () => {\n\t\tif ( ! editedPostTemplate?.content && ! editedPostTemplate?.blocks ) {\n\t\t\treturn false;\n\t\t}\n\t\t// When in template editing mode, we can access the blocks directly.\n\t\tif ( editedPostTemplate?.blocks ) {\n\t\t\treturn checkForPostContentAtRootLevel( editedPostTemplate?.blocks );\n\t\t}\n\t\t// If there are no blocks, we have to parse the content string.\n\t\t// Best double-check it's a string otherwise the parse function gets unhappy.\n\t\tconst parseableContent =\n\t\t\ttypeof editedPostTemplate?.content === 'string'\n\t\t\t\t? editedPostTemplate?.content\n\t\t\t\t: '';\n\n\t\treturn (\n\t\t\tcheckForPostContentAtRootLevel( parse( parseableContent ) ) || false\n\t\t);\n\t}, [ editedPostTemplate?.content, editedPostTemplate?.blocks ] );\n\n\tconst { layout = {}, align = '' } = newestPostContentAttributes || {};\n\n\tconst postContentLayoutClasses = useLayoutClasses(\n\t\tnewestPostContentAttributes,\n\t\t'core/post-content'\n\t);\n\n\tconst blockListLayoutClass = clsx(\n\t\t{\n\t\t\t'is-layout-flow': ! themeSupportsLayout,\n\t\t},\n\t\tthemeSupportsLayout && postContentLayoutClasses,\n\t\talign && `align${ align }`\n\t);\n\n\tconst postContentLayoutStyles = useLayoutStyles(\n\t\tnewestPostContentAttributes,\n\t\t'core/post-content',\n\t\t'.block-editor-block-list__layout.is-root-container'\n\t);\n\n\t// Update type for blocks using legacy layouts.\n\tconst postContentLayout = useMemo( () => {\n\t\treturn layout &&\n\t\t\t( layout?.type === 'constrained' ||\n\t\t\t\tlayout?.inherit ||\n\t\t\t\tlayout?.contentSize ||\n\t\t\t\tlayout?.wideSize )\n\t\t\t? { ...globalLayoutSettings, ...layout, type: 'constrained' }\n\t\t\t: { ...globalLayoutSettings, ...layout, type: 'default' };\n\t}, [\n\t\tlayout?.type,\n\t\tlayout?.inherit,\n\t\tlayout?.contentSize,\n\t\tlayout?.wideSize,\n\t\tglobalLayoutSettings,\n\t] );\n\n\t// If there is a Post Content block we use its layout for the block list;\n\t// if not, this must be a classic theme, in which case we use the fallback layout.\n\tconst blockListLayout = postContentAttributes\n\t\t? postContentLayout\n\t\t: fallbackLayout;\n\n\tconst postEditorLayout =\n\t\tblockListLayout?.type === 'default' && ! hasPostContentAtRootLevel\n\t\t\t? fallbackLayout\n\t\t\t: blockListLayout;\n\tconst observeTypingRef = useTypingObserver();\n\tconst titleRef = useRef();\n\tuseEffect( () => {\n\t\tif ( ! autoFocus || ! isCleanNewPost() ) {\n\t\t\treturn;\n\t\t}\n\t\ttitleRef?.current?.focus();\n\t}, [ autoFocus, isCleanNewPost ] );\n\n\t// Add some styles for alignwide/alignfull Post Content and its children.\n\tconst alignCSS = `.is-root-container.alignwide { max-width: var(--wp--style--global--wide-size); margin-left: auto; margin-right: auto;}\n\t\t.is-root-container.alignwide:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: var(--wp--style--global--wide-size);}\n\t\t.is-root-container.alignfull { max-width: none; margin-left: auto; margin-right: auto;}\n\t\t.is-root-container.alignfull:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: none;}`;\n\n\tconst localRef = useRef();\n\tconst typewriterRef = useTypewriter();\n\tcontentRef = useMergeRefs( [\n\t\tlocalRef,\n\t\tcontentRef,\n\t\trenderingMode === 'post-only' ? typewriterRef : null,\n\t\tuseFlashEditableBlocks( {\n\t\t\tisEnabled: renderingMode === 'template-locked',\n\t\t} ),\n\t\tuseSelectNearestEditableBlock( {\n\t\t\tisEnabled: renderingMode === 'template-locked',\n\t\t} ),\n\t\tuseZoomOutModeExit(),\n\t] );\n\n\tconst zoomOutProps =\n\t\tisZoomedOut && ! isTabletViewport\n\t\t\t? {\n\t\t\t\t\tscale: 'default',\n\t\t\t\t\tframeSize: '40px',\n\t\t\t }\n\t\t\t: {};\n\n\tconst forceFullHeight = postType === NAVIGATION_POST_TYPE;\n\tconst enableResizing =\n\t\t[\n\t\t\tNAVIGATION_POST_TYPE,\n\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\tPATTERN_POST_TYPE,\n\t\t].includes( postType ) &&\n\t\t// Disable in previews / view mode.\n\t\t! isPreview &&\n\t\t// Disable resizing in mobile viewport.\n\t\t! isMobileViewport &&\n\t\t// Dsiable resizing in zoomed-out mode.\n\t\t! isZoomedOut;\n\tconst shouldIframe =\n\t\t! disableIframe || [ 'Tablet', 'Mobile' ].includes( deviceType );\n\n\tconst iframeStyles = useMemo( () => {\n\t\treturn [\n\t\t\t...( styles ?? [] ),\n\t\t\t{\n\t\t\t\tcss: `.is-root-container{display:flow-root;${\n\t\t\t\t\t// Some themes will have `min-height: 100vh` for the root container,\n\t\t\t\t\t// which isn't a requirement in auto resize mode.\n\t\t\t\t\tenableResizing ? 'min-height:0!important;' : ''\n\t\t\t\t}}`,\n\t\t\t},\n\t\t];\n\t}, [ styles, enableResizing ] );\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ clsx(\n\t\t\t\t'editor-visual-editor',\n\t\t\t\t// this class is here for backward compatibility reasons.\n\t\t\t\t'edit-post-visual-editor',\n\t\t\t\tclassName,\n\t\t\t\t{\n\t\t\t\t\t'has-padding': isFocusedEntity || enableResizing,\n\t\t\t\t\t'is-resizable': enableResizing,\n\t\t\t\t\t'is-iframed': shouldIframe,\n\t\t\t\t}\n\t\t\t) }\n\t\t>\n\t\t\t<ResizableEditor\n\t\t\t\tenableResizing={ enableResizing }\n\t\t\t\theight={\n\t\t\t\t\tsizes.height && ! forceFullHeight ? sizes.height : '100%'\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t<BlockCanvas\n\t\t\t\t\tshouldIframe={ shouldIframe }\n\t\t\t\t\tcontentRef={ contentRef }\n\t\t\t\t\tstyles={ iframeStyles }\n\t\t\t\t\theight=\"100%\"\n\t\t\t\t\tiframeProps={ {\n\t\t\t\t\t\t...iframeProps,\n\t\t\t\t\t\t...zoomOutProps,\n\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t...iframeProps?.style,\n\t\t\t\t\t\t\t...deviceStyles,\n\t\t\t\t\t\t},\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ themeSupportsLayout &&\n\t\t\t\t\t\t! themeHasDisabledLayoutStyles &&\n\t\t\t\t\t\trenderingMode === 'post-only' &&\n\t\t\t\t\t\t! isDesignPostType && (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\t\t\tselector=\".editor-visual-editor__post-title-wrapper\"\n\t\t\t\t\t\t\t\t\tlayout={ fallbackLayout }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\t\t\tselector=\".block-editor-block-list__layout.is-root-container\"\n\t\t\t\t\t\t\t\t\tlayout={ postEditorLayout }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{ align && <LayoutStyle css={ alignCSS } /> }\n\t\t\t\t\t\t\t\t{ postContentLayoutStyles && (\n\t\t\t\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\t\t\t\tlayout={ postContentLayout }\n\t\t\t\t\t\t\t\t\t\tcss={ postContentLayoutStyles }\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</>\n\t\t\t\t\t\t) }\n\t\t\t\t\t{ renderingMode === 'post-only' && ! isDesignPostType && (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t'editor-visual-editor__post-title-wrapper',\n\t\t\t\t\t\t\t\t// The following class is only here for backward comapatibility\n\t\t\t\t\t\t\t\t// some themes might be using it to style the post title.\n\t\t\t\t\t\t\t\t'edit-post-visual-editor__post-title-wrapper',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'has-global-padding':\n\t\t\t\t\t\t\t\t\t\thasRootPaddingAwareAlignments,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tcontentEditable={ false }\n\t\t\t\t\t\t\tref={ observeTypingRef }\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t// This is using inline styles\n\t\t\t\t\t\t\t\t// so it's applied for both iframed and non iframed editors.\n\t\t\t\t\t\t\t\tmarginTop: '4rem',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<PostTitle ref={ titleRef } />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t\t<RecursionProvider\n\t\t\t\t\t\tblockName={ wrapperBlockName }\n\t\t\t\t\t\tuniqueId={ wrapperUniqueId }\n\t\t\t\t\t>\n\t\t\t\t\t\t<BlockList\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t'is-' + deviceType.toLowerCase() + '-preview',\n\t\t\t\t\t\t\t\trenderingMode !== 'post-only' ||\n\t\t\t\t\t\t\t\t\tisDesignPostType\n\t\t\t\t\t\t\t\t\t? 'wp-site-blocks'\n\t\t\t\t\t\t\t\t\t: `${ blockListLayoutClass } wp-block-post-content` // Ensure root level blocks receive default/flow blockGap styling rules.\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlayout={ blockListLayout }\n\t\t\t\t\t\t\tdropZoneElement={\n\t\t\t\t\t\t\t\t// When iframed, pass in the html element of the iframe to\n\t\t\t\t\t\t\t\t// ensure the drop zone extends to the edges of the iframe.\n\t\t\t\t\t\t\t\tdisableIframe\n\t\t\t\t\t\t\t\t\t? localRef.current\n\t\t\t\t\t\t\t\t\t: localRef.current?.parentNode\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t__unstableDisableDropZone={\n\t\t\t\t\t\t\t\t// In template preview mode, disable drop zones at the root of the template.\n\t\t\t\t\t\t\t\trenderingMode === 'template-locked'\n\t\t\t\t\t\t\t\t\t? true\n\t\t\t\t\t\t\t\t\t: false\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ renderingMode === 'template-locked' && (\n\t\t\t\t\t\t\t<EditTemplateBlocksNotification\n\t\t\t\t\t\t\t\tcontentRef={ localRef }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</RecursionProvider>\n\t\t\t\t\t{\n\t\t\t\t\t\t// Avoid resize listeners when not needed,\n\t\t\t\t\t\t// these will trigger unnecessary re-renders\n\t\t\t\t\t\t// when animating the iframe width.\n\t\t\t\t\t\tenableResizing && resizeObserver\n\t\t\t\t\t}\n\t\t\t\t</BlockCanvas>\n\t\t\t</ResizableEditor>\n\t\t</div>\n\t);\n}\n\nexport default VisualEditor;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,SAAS,EACTC,KAAK,IAAIC,gBAAgB,EACz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names":["clsx","BlockList","store","blockEditorStore","__unstableUseTypewriter","useTypewriter","__unstableUseTypingObserver","useTypingObserver","useSettings","RecursionProvider","privateApis","blockEditorPrivateApis","__experimentalUseResizeCanvas","useResizeCanvas","useEffect","useRef","useMemo","useState","useSelect","parse","coreStore","useMergeRefs","useViewportMatch","useResizeObserver","PostTitle","editorStore","unlock","EditTemplateBlocksNotification","ResizableEditor","useSelectNearestEditableBlock","NAVIGATION_POST_TYPE","PATTERN_POST_TYPE","TEMPLATE_PART_POST_TYPE","TEMPLATE_POST_TYPE","useZoomOutModeExit","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","LayoutStyle","useLayoutClasses","useLayoutStyles","ExperimentalBlockCanvas","BlockCanvas","useFlashEditableBlocks","DESIGN_POST_TYPES","getPostContentAttributes","blocks","i","length","name","attributes","innerBlocks","nestedPostContent","checkForPostContentAtRootLevel","VisualEditor","autoFocus","styles","disableIframe","iframeProps","contentRef","className","contentHeight","setContentHeight","effectContentHeight","entry","borderBoxSize","blockSize","isMobileViewport","renderingMode","postContentAttributes","editedPostTemplate","wrapperBlockName","wrapperUniqueId","deviceType","isFocusedEntity","isDesignPostType","postType","isPreview","select","getCurrentPostId","getCurrentPostType","getCurrentTemplateId","getEditorSettings","getRenderingMode","getDeviceType","getPostType","getEditedEntityRecord","postTypeSlug","_renderingMode","_wrapperBlockName","editorSettings","supportsTemplateMode","postTypeObject","currentTemplateId","template","undefined","includes","viewable","onNavigateToPreviousEntityRecord","isPreviewMode","isCleanNewPost","hasRootPaddingAwareAlignments","themeHasDisabledLayoutStyles","themeSupportsLayout","isZoomedOut","getSettings","isZoomOut","_isZoomOut","_settings","disableLayoutStyles","supportsLayout","__experimentalFeatures","useRootPaddingAwareAlignments","deviceStyles","globalLayoutSettings","fallbackLayout","type","newestPostContentAttributes","content","parseableContent","hasPostContentAtRootLevel","layout","align","postContentLayoutClasses","blockListLayoutClass","postContentLayoutStyles","postContentLayout","inherit","contentSize","wideSize","blockListLayout","postEditorLayout","observeTypingRef","titleRef","current","focus","alignCSS","forceFullHeight","enableResizing","iframeStyles","css","localRef","typewriterRef","isEnabled","children","height","shouldIframe","style","selector","contentEditable","ref","marginTop","blockName","uniqueId","toLowerCase","dropZoneElement","parentNode","__unstableDisableDropZone"],"sources":["@wordpress/editor/src/components/visual-editor/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tBlockList,\n\tstore as blockEditorStore,\n\t__unstableUseTypewriter as useTypewriter,\n\t__unstableUseTypingObserver as useTypingObserver,\n\tuseSettings,\n\tRecursionProvider,\n\tprivateApis as blockEditorPrivateApis,\n\t__experimentalUseResizeCanvas as useResizeCanvas,\n} from '@wordpress/block-editor';\nimport { useEffect, useRef, useMemo, useState } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { parse } from '@wordpress/blocks';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tuseMergeRefs,\n\tuseViewportMatch,\n\tuseResizeObserver,\n} from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport PostTitle from '../post-title';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport EditTemplateBlocksNotification from './edit-template-blocks-notification';\nimport ResizableEditor from '../resizable-editor';\nimport useSelectNearestEditableBlock from './use-select-nearest-editable-block';\nimport {\n\tNAVIGATION_POST_TYPE,\n\tPATTERN_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tTEMPLATE_POST_TYPE,\n} from '../../store/constants';\nimport { useZoomOutModeExit } from './use-zoom-out-mode-exit';\n\nconst {\n\tLayoutStyle,\n\tuseLayoutClasses,\n\tuseLayoutStyles,\n\tExperimentalBlockCanvas: BlockCanvas,\n\tuseFlashEditableBlocks,\n} = unlock( blockEditorPrivateApis );\n\n/**\n * These post types have a special editor where they don't allow you to fill the title\n * and they don't apply the layout styles.\n */\nconst DESIGN_POST_TYPES = [\n\tPATTERN_POST_TYPE,\n\tTEMPLATE_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n];\n\n/**\n * Given an array of nested blocks, find the first Post Content\n * block inside it, recursing through any nesting levels,\n * and return its attributes.\n *\n * @param {Array} blocks A list of blocks.\n *\n * @return {Object | undefined} The Post Content block.\n */\nfunction getPostContentAttributes( blocks ) {\n\tfor ( let i = 0; i < blocks.length; i++ ) {\n\t\tif ( blocks[ i ].name === 'core/post-content' ) {\n\t\t\treturn blocks[ i ].attributes;\n\t\t}\n\t\tif ( blocks[ i ].innerBlocks.length ) {\n\t\t\tconst nestedPostContent = getPostContentAttributes(\n\t\t\t\tblocks[ i ].innerBlocks\n\t\t\t);\n\n\t\t\tif ( nestedPostContent ) {\n\t\t\t\treturn nestedPostContent;\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction checkForPostContentAtRootLevel( blocks ) {\n\tfor ( let i = 0; i < blocks.length; i++ ) {\n\t\tif ( blocks[ i ].name === 'core/post-content' ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\nfunction VisualEditor( {\n\t// Ideally as we unify post and site editors, we won't need these props.\n\tautoFocus,\n\tstyles,\n\tdisableIframe = false,\n\tiframeProps,\n\tcontentRef,\n\tclassName,\n} ) {\n\tconst [ contentHeight, setContentHeight ] = useState( '' );\n\tconst effectContentHeight = useResizeObserver( ( [ entry ] ) => {\n\t\tsetContentHeight( entry.borderBoxSize[ 0 ].blockSize );\n\t} );\n\tconst isMobileViewport = useViewportMatch( 'small', '<' );\n\tconst {\n\t\trenderingMode,\n\t\tpostContentAttributes,\n\t\teditedPostTemplate = {},\n\t\twrapperBlockName,\n\t\twrapperUniqueId,\n\t\tdeviceType,\n\t\tisFocusedEntity,\n\t\tisDesignPostType,\n\t\tpostType,\n\t\tisPreview,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetCurrentPostId,\n\t\t\tgetCurrentPostType,\n\t\t\tgetCurrentTemplateId,\n\t\t\tgetEditorSettings,\n\t\t\tgetRenderingMode,\n\t\t\tgetDeviceType,\n\t\t} = select( editorStore );\n\t\tconst { getPostType, getEditedEntityRecord } = select( coreStore );\n\t\tconst postTypeSlug = getCurrentPostType();\n\t\tconst _renderingMode = getRenderingMode();\n\t\tlet _wrapperBlockName;\n\n\t\tif ( postTypeSlug === PATTERN_POST_TYPE ) {\n\t\t\t_wrapperBlockName = 'core/block';\n\t\t} else if ( _renderingMode === 'post-only' ) {\n\t\t\t_wrapperBlockName = 'core/post-content';\n\t\t}\n\n\t\tconst editorSettings = getEditorSettings();\n\t\tconst supportsTemplateMode = editorSettings.supportsTemplateMode;\n\t\tconst postTypeObject = getPostType( postTypeSlug );\n\t\tconst currentTemplateId = getCurrentTemplateId();\n\t\tconst template = currentTemplateId\n\t\t\t? getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\t\tcurrentTemplateId\n\t\t\t )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\trenderingMode: _renderingMode,\n\t\t\tpostContentAttributes: editorSettings.postContentAttributes,\n\t\t\tisDesignPostType: DESIGN_POST_TYPES.includes( postTypeSlug ),\n\t\t\t// Post template fetch returns a 404 on classic themes, which\n\t\t\t// messes with e2e tests, so check it's a block theme first.\n\t\t\teditedPostTemplate:\n\t\t\t\tpostTypeObject?.viewable && supportsTemplateMode\n\t\t\t\t\t? template\n\t\t\t\t\t: undefined,\n\t\t\twrapperBlockName: _wrapperBlockName,\n\t\t\twrapperUniqueId: getCurrentPostId(),\n\t\t\tdeviceType: getDeviceType(),\n\t\t\tisFocusedEntity: !! editorSettings.onNavigateToPreviousEntityRecord,\n\t\t\tpostType: postTypeSlug,\n\t\t\tisPreview: editorSettings.isPreviewMode,\n\t\t};\n\t}, [] );\n\tconst { isCleanNewPost } = useSelect( editorStore );\n\tconst {\n\t\thasRootPaddingAwareAlignments,\n\t\tthemeHasDisabledLayoutStyles,\n\t\tthemeSupportsLayout,\n\t\tisZoomedOut,\n\t} = useSelect( ( select ) => {\n\t\tconst { getSettings, isZoomOut: _isZoomOut } = unlock(\n\t\t\tselect( blockEditorStore )\n\t\t);\n\n\t\tconst _settings = getSettings();\n\t\treturn {\n\t\t\tthemeHasDisabledLayoutStyles: _settings.disableLayoutStyles,\n\t\t\tthemeSupportsLayout: _settings.supportsLayout,\n\t\t\thasRootPaddingAwareAlignments:\n\t\t\t\t_settings.__experimentalFeatures?.useRootPaddingAwareAlignments,\n\t\t\tisZoomedOut: _isZoomOut(),\n\t\t};\n\t}, [] );\n\n\tconst deviceStyles = useResizeCanvas( deviceType );\n\tconst [ globalLayoutSettings ] = useSettings( 'layout' );\n\n\t// fallbackLayout is used if there is no Post Content,\n\t// and for Post Title.\n\tconst fallbackLayout = useMemo( () => {\n\t\tif ( renderingMode !== 'post-only' || isDesignPostType ) {\n\t\t\treturn { type: 'default' };\n\t\t}\n\n\t\tif ( themeSupportsLayout ) {\n\t\t\t// We need to ensure support for wide and full alignments,\n\t\t\t// so we add the constrained type.\n\t\t\treturn { ...globalLayoutSettings, type: 'constrained' };\n\t\t}\n\t\t// Set default layout for classic themes so all alignments are supported.\n\t\treturn { type: 'default' };\n\t}, [\n\t\trenderingMode,\n\t\tthemeSupportsLayout,\n\t\tglobalLayoutSettings,\n\t\tisDesignPostType,\n\t] );\n\n\tconst newestPostContentAttributes = useMemo( () => {\n\t\tif (\n\t\t\t! editedPostTemplate?.content &&\n\t\t\t! editedPostTemplate?.blocks &&\n\t\t\tpostContentAttributes\n\t\t) {\n\t\t\treturn postContentAttributes;\n\t\t}\n\t\t// When in template editing mode, we can access the blocks directly.\n\t\tif ( editedPostTemplate?.blocks ) {\n\t\t\treturn getPostContentAttributes( editedPostTemplate?.blocks );\n\t\t}\n\t\t// If there are no blocks, we have to parse the content string.\n\t\t// Best double-check it's a string otherwise the parse function gets unhappy.\n\t\tconst parseableContent =\n\t\t\ttypeof editedPostTemplate?.content === 'string'\n\t\t\t\t? editedPostTemplate?.content\n\t\t\t\t: '';\n\n\t\treturn getPostContentAttributes( parse( parseableContent ) ) || {};\n\t}, [\n\t\teditedPostTemplate?.content,\n\t\teditedPostTemplate?.blocks,\n\t\tpostContentAttributes,\n\t] );\n\n\tconst hasPostContentAtRootLevel = useMemo( () => {\n\t\tif ( ! editedPostTemplate?.content && ! editedPostTemplate?.blocks ) {\n\t\t\treturn false;\n\t\t}\n\t\t// When in template editing mode, we can access the blocks directly.\n\t\tif ( editedPostTemplate?.blocks ) {\n\t\t\treturn checkForPostContentAtRootLevel( editedPostTemplate?.blocks );\n\t\t}\n\t\t// If there are no blocks, we have to parse the content string.\n\t\t// Best double-check it's a string otherwise the parse function gets unhappy.\n\t\tconst parseableContent =\n\t\t\ttypeof editedPostTemplate?.content === 'string'\n\t\t\t\t? editedPostTemplate?.content\n\t\t\t\t: '';\n\n\t\treturn (\n\t\t\tcheckForPostContentAtRootLevel( parse( parseableContent ) ) || false\n\t\t);\n\t}, [ editedPostTemplate?.content, editedPostTemplate?.blocks ] );\n\n\tconst { layout = {}, align = '' } = newestPostContentAttributes || {};\n\n\tconst postContentLayoutClasses = useLayoutClasses(\n\t\tnewestPostContentAttributes,\n\t\t'core/post-content'\n\t);\n\n\tconst blockListLayoutClass = clsx(\n\t\t{\n\t\t\t'is-layout-flow': ! themeSupportsLayout,\n\t\t},\n\t\tthemeSupportsLayout && postContentLayoutClasses,\n\t\talign && `align${ align }`\n\t);\n\n\tconst postContentLayoutStyles = useLayoutStyles(\n\t\tnewestPostContentAttributes,\n\t\t'core/post-content',\n\t\t'.block-editor-block-list__layout.is-root-container'\n\t);\n\n\t// Update type for blocks using legacy layouts.\n\tconst postContentLayout = useMemo( () => {\n\t\treturn layout &&\n\t\t\t( layout?.type === 'constrained' ||\n\t\t\t\tlayout?.inherit ||\n\t\t\t\tlayout?.contentSize ||\n\t\t\t\tlayout?.wideSize )\n\t\t\t? { ...globalLayoutSettings, ...layout, type: 'constrained' }\n\t\t\t: { ...globalLayoutSettings, ...layout, type: 'default' };\n\t}, [\n\t\tlayout?.type,\n\t\tlayout?.inherit,\n\t\tlayout?.contentSize,\n\t\tlayout?.wideSize,\n\t\tglobalLayoutSettings,\n\t] );\n\n\t// If there is a Post Content block we use its layout for the block list;\n\t// if not, this must be a classic theme, in which case we use the fallback layout.\n\tconst blockListLayout = postContentAttributes\n\t\t? postContentLayout\n\t\t: fallbackLayout;\n\n\tconst postEditorLayout =\n\t\tblockListLayout?.type === 'default' && ! hasPostContentAtRootLevel\n\t\t\t? fallbackLayout\n\t\t\t: blockListLayout;\n\tconst observeTypingRef = useTypingObserver();\n\tconst titleRef = useRef();\n\tuseEffect( () => {\n\t\tif ( ! autoFocus || ! isCleanNewPost() ) {\n\t\t\treturn;\n\t\t}\n\t\ttitleRef?.current?.focus();\n\t}, [ autoFocus, isCleanNewPost ] );\n\n\t// Add some styles for alignwide/alignfull Post Content and its children.\n\tconst alignCSS = `.is-root-container.alignwide { max-width: var(--wp--style--global--wide-size); margin-left: auto; margin-right: auto;}\n\t\t.is-root-container.alignwide:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: var(--wp--style--global--wide-size);}\n\t\t.is-root-container.alignfull { max-width: none; margin-left: auto; margin-right: auto;}\n\t\t.is-root-container.alignfull:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: none;}`;\n\n\tconst forceFullHeight = postType === NAVIGATION_POST_TYPE;\n\tconst enableResizing =\n\t\t[\n\t\t\tNAVIGATION_POST_TYPE,\n\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\tPATTERN_POST_TYPE,\n\t\t].includes( postType ) &&\n\t\t// Disable in previews / view mode.\n\t\t! isPreview &&\n\t\t// Disable resizing in mobile viewport.\n\t\t! isMobileViewport &&\n\t\t// Dsiable resizing in zoomed-out mode.\n\t\t! isZoomedOut;\n\n\tconst iframeStyles = useMemo( () => {\n\t\treturn [\n\t\t\t...( styles ?? [] ),\n\t\t\t{\n\t\t\t\t// Ensures margins of children are contained so that the body background paints behind them.\n\t\t\t\t// Otherwise, the background of html (when zoomed out) would show there and appear broken. It’s\n\t\t\t\t// important mostly for post-only views yet conceivably an issue in templated views too.\n\t\t\t\tcss: `:where(.block-editor-iframe__body){display:flow-root;}.is-root-container{display:flow-root;${\n\t\t\t\t\t// Some themes will have `min-height: 100vh` for the root container,\n\t\t\t\t\t// which isn't a requirement in auto resize mode.\n\t\t\t\t\tenableResizing ? 'min-height:0!important;' : ''\n\t\t\t\t}}`,\n\t\t\t},\n\t\t];\n\t}, [ styles, enableResizing ] );\n\n\tconst localRef = useRef();\n\tconst typewriterRef = useTypewriter();\n\tcontentRef = useMergeRefs( [\n\t\tlocalRef,\n\t\tcontentRef,\n\t\trenderingMode === 'post-only' ? typewriterRef : null,\n\t\tuseFlashEditableBlocks( {\n\t\t\tisEnabled: renderingMode === 'template-locked',\n\t\t} ),\n\t\tuseSelectNearestEditableBlock( {\n\t\t\tisEnabled: renderingMode === 'template-locked',\n\t\t} ),\n\t\tuseZoomOutModeExit(),\n\t\t// Avoid resize listeners when not needed, these will trigger\n\t\t// unnecessary re-renders when animating the iframe width.\n\t\tenableResizing ? effectContentHeight : null,\n\t] );\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ clsx(\n\t\t\t\t'editor-visual-editor',\n\t\t\t\t// this class is here for backward compatibility reasons.\n\t\t\t\t'edit-post-visual-editor',\n\t\t\t\tclassName,\n\t\t\t\t{\n\t\t\t\t\t'has-padding': isFocusedEntity || enableResizing,\n\t\t\t\t\t'is-resizable': enableResizing,\n\t\t\t\t\t'is-iframed': ! disableIframe,\n\t\t\t\t}\n\t\t\t) }\n\t\t>\n\t\t\t<ResizableEditor\n\t\t\t\tenableResizing={ enableResizing }\n\t\t\t\theight={\n\t\t\t\t\tcontentHeight && ! forceFullHeight ? contentHeight : '100%'\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t<BlockCanvas\n\t\t\t\t\tshouldIframe={ ! disableIframe }\n\t\t\t\t\tcontentRef={ contentRef }\n\t\t\t\t\tstyles={ iframeStyles }\n\t\t\t\t\theight=\"100%\"\n\t\t\t\t\tiframeProps={ {\n\t\t\t\t\t\t...iframeProps,\n\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t...iframeProps?.style,\n\t\t\t\t\t\t\t...deviceStyles,\n\t\t\t\t\t\t},\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ themeSupportsLayout &&\n\t\t\t\t\t\t! themeHasDisabledLayoutStyles &&\n\t\t\t\t\t\trenderingMode === 'post-only' &&\n\t\t\t\t\t\t! isDesignPostType && (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\t\t\tselector=\".editor-visual-editor__post-title-wrapper\"\n\t\t\t\t\t\t\t\t\tlayout={ fallbackLayout }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\t\t\tselector=\".block-editor-block-list__layout.is-root-container\"\n\t\t\t\t\t\t\t\t\tlayout={ postEditorLayout }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{ align && <LayoutStyle css={ alignCSS } /> }\n\t\t\t\t\t\t\t\t{ postContentLayoutStyles && (\n\t\t\t\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\t\t\t\tlayout={ postContentLayout }\n\t\t\t\t\t\t\t\t\t\tcss={ postContentLayoutStyles }\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</>\n\t\t\t\t\t\t) }\n\t\t\t\t\t{ renderingMode === 'post-only' && ! isDesignPostType && (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t'editor-visual-editor__post-title-wrapper',\n\t\t\t\t\t\t\t\t// The following class is only here for backward comapatibility\n\t\t\t\t\t\t\t\t// some themes might be using it to style the post title.\n\t\t\t\t\t\t\t\t'edit-post-visual-editor__post-title-wrapper',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'has-global-padding':\n\t\t\t\t\t\t\t\t\t\thasRootPaddingAwareAlignments,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tcontentEditable={ false }\n\t\t\t\t\t\t\tref={ observeTypingRef }\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t// This is using inline styles\n\t\t\t\t\t\t\t\t// so it's applied for both iframed and non iframed editors.\n\t\t\t\t\t\t\t\tmarginTop: '4rem',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<PostTitle ref={ titleRef } />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t\t<RecursionProvider\n\t\t\t\t\t\tblockName={ wrapperBlockName }\n\t\t\t\t\t\tuniqueId={ wrapperUniqueId }\n\t\t\t\t\t>\n\t\t\t\t\t\t<BlockList\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t'is-' + deviceType.toLowerCase() + '-preview',\n\t\t\t\t\t\t\t\trenderingMode !== 'post-only' ||\n\t\t\t\t\t\t\t\t\tisDesignPostType\n\t\t\t\t\t\t\t\t\t? 'wp-site-blocks'\n\t\t\t\t\t\t\t\t\t: `${ blockListLayoutClass } wp-block-post-content` // Ensure root level blocks receive default/flow blockGap styling rules.\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlayout={ blockListLayout }\n\t\t\t\t\t\t\tdropZoneElement={\n\t\t\t\t\t\t\t\t// When iframed, pass in the html element of the iframe to\n\t\t\t\t\t\t\t\t// ensure the drop zone extends to the edges of the iframe.\n\t\t\t\t\t\t\t\tdisableIframe\n\t\t\t\t\t\t\t\t\t? localRef.current\n\t\t\t\t\t\t\t\t\t: localRef.current?.parentNode\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t__unstableDisableDropZone={\n\t\t\t\t\t\t\t\t// In template preview mode, disable drop zones at the root of the template.\n\t\t\t\t\t\t\t\trenderingMode === 'template-locked'\n\t\t\t\t\t\t\t\t\t? true\n\t\t\t\t\t\t\t\t\t: false\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ renderingMode === 'template-locked' && (\n\t\t\t\t\t\t\t<EditTemplateBlocksNotification\n\t\t\t\t\t\t\t\tcontentRef={ localRef }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</RecursionProvider>\n\t\t\t\t</BlockCanvas>\n\t\t\t</ResizableEditor>\n\t\t</div>\n\t);\n}\n\nexport default VisualEditor;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,SAAS,EACTC,KAAK,IAAIC,gBAAgB,EACzBC,uBAAuB,IAAIC,aAAa,EACxCC,2BAA2B,IAAIC,iBAAiB,EAChDC,WAAW,EACXC,iBAAiB,EACjBC,WAAW,IAAIC,sBAAsB,EACrCC,6BAA6B,IAAIC,eAAe,QAC1C,yBAAyB;AAChC,SAASC,SAAS,EAAEC,MAAM,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,oBAAoB;AACzE,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,QAAQ,mBAAmB;AACzC,SAASjB,KAAK,IAAIkB,SAAS,QAAQ,sBAAsB;AACzD,SACCC,YAAY,EACZC,gBAAgB,EAChBC,iBAAiB,QACX,oBAAoB;;AAE3B;AACA;AACA;AACA,OAAOC,SAAS,MAAM,eAAe;AACrC,SAAStB,KAAK,IAAIuB,WAAW,QAAQ,aAAa;AAClD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,8BAA8B,MAAM,qCAAqC;AAChF,OAAOC,eAAe,MAAM,qBAAqB;AACjD,OAAOC,6BAA6B,MAAM,qCAAqC;AAC/E,SACCC,oBAAoB,EACpBC,iBAAi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CAAC;YACtD,CAAG;YACHH,MAAM,EAAGS,eAAiB;YAC1ByB,eAAe;YACd;YACA;YACAlG,aAAa,GACVoF,QAAQ,CAACP,OAAO,GAChBO,QAAQ,CAACP,OAAO,EAAEsB,UACrB;YACDC,yBAAyB;YACxB;YACAzF,aAAa,KAAK,iBAAiB,GAChC,IAAI,GACJ;UACH,CACD,CAAC,EACAA,aAAa,KAAK,iBAAiB,iBACpCnC,IAAA,CAACT,8BAA8B;YAC9BmC,UAAU,EAAGkF;UAAU,CACvB,CACD;QAAA,CACiB,CAAC;MAAA,CACR;IAAC,CACE;EAAC,CACd,CAAC;AAER;AAEA,eAAevF,YAAY","ignoreList":[]}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useSelect, useDispatch } from '@wordpress/data';
|
|
5
|
+
import { useRefEffect } from '@wordpress/compose';
|
|
6
|
+
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Internal dependencies
|
|
10
|
+
*/
|
|
11
|
+
import { unlock } from '../../lock-unlock';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Allows Zoom Out mode to be exited by double clicking in the selected block.
|
|
15
|
+
*/
|
|
16
|
+
export function useZoomOutModeExit() {
|
|
17
|
+
const {
|
|
18
|
+
getSettings,
|
|
19
|
+
isZoomOut
|
|
20
|
+
} = unlock(useSelect(blockEditorStore));
|
|
21
|
+
const {
|
|
22
|
+
resetZoomLevel
|
|
23
|
+
} = unlock(useDispatch(blockEditorStore));
|
|
24
|
+
return useRefEffect(node => {
|
|
25
|
+
function onDoubleClick(event) {
|
|
26
|
+
if (!isZoomOut()) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
if (!event.defaultPrevented) {
|
|
30
|
+
event.preventDefault();
|
|
31
|
+
const {
|
|
32
|
+
__experimentalSetIsInserterOpened
|
|
33
|
+
} = getSettings();
|
|
34
|
+
if (typeof __experimentalSetIsInserterOpened === 'function') {
|
|
35
|
+
__experimentalSetIsInserterOpened(false);
|
|
36
|
+
}
|
|
37
|
+
resetZoomLevel();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
node.addEventListener('dblclick', onDoubleClick);
|
|
41
|
+
return () => {
|
|
42
|
+
node.removeEventListener('dblclick', onDoubleClick);
|
|
43
|
+
};
|
|
44
|
+
}, [getSettings, isZoomOut, resetZoomLevel]);
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=use-zoom-out-mode-exit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useSelect","useDispatch","useRefEffect","store","blockEditorStore","unlock","useZoomOutModeExit","getSettings","isZoomOut","resetZoomLevel","node","onDoubleClick","event","defaultPrevented","preventDefault","__experimentalSetIsInserterOpened","addEventListener","removeEventListener"],"sources":["@wordpress/editor/src/components/visual-editor/use-zoom-out-mode-exit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useRefEffect } from '@wordpress/compose';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\n/**\n * Allows Zoom Out mode to be exited by double clicking in the selected block.\n */\nexport function useZoomOutModeExit() {\n\tconst { getSettings, isZoomOut } = unlock( useSelect( blockEditorStore ) );\n\tconst { resetZoomLevel } = unlock( useDispatch( blockEditorStore ) );\n\n\treturn useRefEffect(\n\t\t( node ) => {\n\t\t\tfunction onDoubleClick( event ) {\n\t\t\t\tif ( ! isZoomOut() ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( ! event.defaultPrevented ) {\n\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\tconst { __experimentalSetIsInserterOpened } = getSettings();\n\n\t\t\t\t\tif (\n\t\t\t\t\t\ttypeof __experimentalSetIsInserterOpened === 'function'\n\t\t\t\t\t) {\n\t\t\t\t\t\t__experimentalSetIsInserterOpened( false );\n\t\t\t\t\t}\n\t\t\t\t\tresetZoomLevel();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tnode.addEventListener( 'dblclick', onDoubleClick );\n\n\t\t\treturn () => {\n\t\t\t\tnode.removeEventListener( 'dblclick', onDoubleClick );\n\t\t\t};\n\t\t},\n\t\t[ getSettings, isZoomOut, resetZoomLevel ]\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,YAAY,QAAQ,oBAAoB;AACjD,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;;AAEnE;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;;AAE1C;AACA;AACA;AACA,OAAO,SAASC,kBAAkBA,CAAA,EAAG;EACpC,MAAM;IAAEC,WAAW;IAAEC;EAAU,CAAC,GAAGH,MAAM,CAAEL,SAAS,CAAEI,gBAAiB,CAAE,CAAC;EAC1E,MAAM;IAAEK;EAAe,CAAC,GAAGJ,MAAM,CAAEJ,WAAW,CAAEG,gBAAiB,CAAE,CAAC;EAEpE,OAAOF,YAAY,CAChBQ,IAAI,IAAM;IACX,SAASC,aAAaA,CAAEC,KAAK,EAAG;MAC/B,IAAK,CAAEJ,SAAS,CAAC,CAAC,EAAG;QACpB;MACD;MAEA,IAAK,CAAEI,KAAK,CAACC,gBAAgB,EAAG;QAC/BD,KAAK,CAACE,cAAc,CAAC,CAAC;QAEtB,MAAM;UAAEC;QAAkC,CAAC,GAAGR,WAAW,CAAC,CAAC;QAE3D,IACC,OAAOQ,iCAAiC,KAAK,UAAU,EACtD;UACDA,iCAAiC,CAAE,KAAM,CAAC;QAC3C;QACAN,cAAc,CAAC,CAAC;MACjB;IACD;IAEAC,IAAI,CAACM,gBAAgB,CAAE,UAAU,EAAEL,aAAc,CAAC;IAElD,OAAO,MAAM;MACZD,IAAI,CAACO,mBAAmB,CAAE,UAAU,EAAEN,aAAc,CAAC;IACtD,CAAC;EACF,CAAC,EACD,CAAEJ,WAAW,EAAEC,SAAS,EAAEC,cAAc,CACzC,CAAC;AACF","ignoreList":[]}
|
|
@@ -3,17 +3,22 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { Button } from '@wordpress/components';
|
|
5
5
|
import { __ } from '@wordpress/i18n';
|
|
6
|
+
import { useEffect } from '@wordpress/element';
|
|
6
7
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
7
8
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
8
9
|
import { square as zoomOutIcon } from '@wordpress/icons';
|
|
9
10
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
11
|
+
import { useShortcut, store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
|
|
12
|
+
import { isAppleOS } from '@wordpress/keycodes';
|
|
10
13
|
|
|
11
14
|
/**
|
|
12
15
|
* Internal dependencies
|
|
13
16
|
*/
|
|
14
17
|
import { unlock } from '../../lock-unlock';
|
|
15
18
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
-
const ZoomOutToggle = (
|
|
19
|
+
const ZoomOutToggle = ({
|
|
20
|
+
disabled
|
|
21
|
+
}) => {
|
|
17
22
|
const {
|
|
18
23
|
isZoomOut,
|
|
19
24
|
showIconLabels
|
|
@@ -23,18 +28,45 @@ const ZoomOutToggle = () => {
|
|
|
23
28
|
}));
|
|
24
29
|
const {
|
|
25
30
|
resetZoomLevel,
|
|
26
|
-
setZoomLevel
|
|
27
|
-
__unstableSetEditorMode
|
|
31
|
+
setZoomLevel
|
|
28
32
|
} = unlock(useDispatch(blockEditorStore));
|
|
33
|
+
const {
|
|
34
|
+
registerShortcut,
|
|
35
|
+
unregisterShortcut
|
|
36
|
+
} = useDispatch(keyboardShortcutsStore);
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
registerShortcut({
|
|
39
|
+
name: 'core/editor/zoom',
|
|
40
|
+
category: 'global',
|
|
41
|
+
description: __('Enter or exit zoom out.'),
|
|
42
|
+
keyCombination: {
|
|
43
|
+
// `primaryShift+0` (`ctrl+shift+0`) is the shortcut for switching
|
|
44
|
+
// to input mode in Windows, so apply a different key combination.
|
|
45
|
+
modifier: isAppleOS() ? 'primaryShift' : 'secondary',
|
|
46
|
+
character: '0'
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
return () => {
|
|
50
|
+
unregisterShortcut('core/editor/zoom');
|
|
51
|
+
};
|
|
52
|
+
}, [registerShortcut, unregisterShortcut]);
|
|
53
|
+
useShortcut('core/editor/zoom', () => {
|
|
54
|
+
if (isZoomOut) {
|
|
55
|
+
resetZoomLevel();
|
|
56
|
+
} else {
|
|
57
|
+
setZoomLevel('auto-scaled');
|
|
58
|
+
}
|
|
59
|
+
});
|
|
29
60
|
const handleZoomOut = () => {
|
|
30
61
|
if (isZoomOut) {
|
|
31
62
|
resetZoomLevel();
|
|
32
63
|
} else {
|
|
33
|
-
setZoomLevel(
|
|
64
|
+
setZoomLevel('auto-scaled');
|
|
34
65
|
}
|
|
35
|
-
__unstableSetEditorMode(isZoomOut ? 'edit' : 'zoom-out');
|
|
36
66
|
};
|
|
37
67
|
return /*#__PURE__*/_jsx(Button, {
|
|
68
|
+
accessibleWhenDisabled: true,
|
|
69
|
+
disabled: disabled,
|
|
38
70
|
onClick: handleZoomOut,
|
|
39
71
|
icon: zoomOutIcon,
|
|
40
72
|
label: __('Zoom Out'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Button","__","useDispatch","useSelect","store","blockEditorStore","square","zoomOutIcon","preferencesStore","unlock","jsx","_jsx","ZoomOutToggle","isZoomOut","showIconLabels","select","get","resetZoomLevel","setZoomLevel","
|
|
1
|
+
{"version":3,"names":["Button","__","useEffect","useDispatch","useSelect","store","blockEditorStore","square","zoomOutIcon","preferencesStore","useShortcut","keyboardShortcutsStore","isAppleOS","unlock","jsx","_jsx","ZoomOutToggle","disabled","isZoomOut","showIconLabels","select","get","resetZoomLevel","setZoomLevel","registerShortcut","unregisterShortcut","name","category","description","keyCombination","modifier","character","handleZoomOut","accessibleWhenDisabled","onClick","icon","label","isPressed","size","showTooltip"],"sources":["@wordpress/editor/src/components/zoom-out-toggle/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useEffect } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { square as zoomOutIcon } from '@wordpress/icons';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { isAppleOS } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst ZoomOutToggle = ( { disabled } ) => {\n\tconst { isZoomOut, showIconLabels } = useSelect( ( select ) => ( {\n\t\tisZoomOut: unlock( select( blockEditorStore ) ).isZoomOut(),\n\t\tshowIconLabels: select( preferencesStore ).get(\n\t\t\t'core',\n\t\t\t'showIconLabels'\n\t\t),\n\t} ) );\n\n\tconst { resetZoomLevel, setZoomLevel } = unlock(\n\t\tuseDispatch( blockEditorStore )\n\t);\n\tconst { registerShortcut, unregisterShortcut } = useDispatch(\n\t\tkeyboardShortcutsStore\n\t);\n\n\tuseEffect( () => {\n\t\tregisterShortcut( {\n\t\t\tname: 'core/editor/zoom',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Enter or exit zoom out.' ),\n\t\t\tkeyCombination: {\n\t\t\t\t// `primaryShift+0` (`ctrl+shift+0`) is the shortcut for switching\n\t\t\t\t// to input mode in Windows, so apply a different key combination.\n\t\t\t\tmodifier: isAppleOS() ? 'primaryShift' : 'secondary',\n\t\t\t\tcharacter: '0',\n\t\t\t},\n\t\t} );\n\t\treturn () => {\n\t\t\tunregisterShortcut( 'core/editor/zoom' );\n\t\t};\n\t}, [ registerShortcut, unregisterShortcut ] );\n\n\tuseShortcut( 'core/editor/zoom', () => {\n\t\tif ( isZoomOut ) {\n\t\t\tresetZoomLevel();\n\t\t} else {\n\t\t\tsetZoomLevel( 'auto-scaled' );\n\t\t}\n\t} );\n\n\tconst handleZoomOut = () => {\n\t\tif ( isZoomOut ) {\n\t\t\tresetZoomLevel();\n\t\t} else {\n\t\t\tsetZoomLevel( 'auto-scaled' );\n\t\t}\n\t};\n\n\treturn (\n\t\t<Button\n\t\t\taccessibleWhenDisabled\n\t\t\tdisabled={ disabled }\n\t\t\tonClick={ handleZoomOut }\n\t\t\ticon={ zoomOutIcon }\n\t\t\tlabel={ __( 'Zoom Out' ) }\n\t\t\tisPressed={ isZoomOut }\n\t\t\tsize=\"compact\"\n\t\t\tshowTooltip={ ! showIconLabels }\n\t\t/>\n\t);\n};\n\nexport default ZoomOutToggle;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASC,MAAM,IAAIC,WAAW,QAAQ,kBAAkB;AACxD,SAASH,KAAK,IAAII,gBAAgB,QAAQ,wBAAwB;AAClE,SACCC,WAAW,EACXL,KAAK,IAAIM,sBAAsB,QACzB,+BAA+B;AACtC,SAASC,SAAS,QAAQ,qBAAqB;;AAE/C;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE3C,MAAMC,aAAa,GAAGA,CAAE;EAAEC;AAAS,CAAC,KAAM;EACzC,MAAM;IAAEC,SAAS;IAAEC;EAAe,CAAC,GAAGf,SAAS,CAAIgB,MAAM,KAAQ;IAChEF,SAAS,EAAEL,MA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B,KAAK,EAAGnC,EAAE,CAAE,UAAW,CAAG;IAC1BoC,SAAS,EAAGnB,SAAW;IACvBoB,IAAI,EAAC,SAAS;IACdC,WAAW,EAAG,CAAEpB;EAAgB,CAChC,CAAC;AAEJ,CAAC;AAED,eAAeH,aAAa","ignoreList":[]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { useDispatch } from '@wordpress/data';
|
|
5
|
-
import {
|
|
5
|
+
import { _x, sprintf } from '@wordpress/i18n';
|
|
6
6
|
import { store as noticesStore } from '@wordpress/notices';
|
|
7
7
|
import { useMemo } from '@wordpress/element';
|
|
8
8
|
// @ts-ignore
|
|
@@ -36,7 +36,7 @@ const duplicateTemplatePart = {
|
|
|
36
36
|
function onTemplatePartSuccess() {
|
|
37
37
|
createSuccessNotice(sprintf(
|
|
38
38
|
// translators: %s: The new template part's title e.g. 'Call to action (copy)'.
|
|
39
|
-
|
|
39
|
+
_x('"%s" duplicated.', 'template part'), getItemTitle(item)), {
|
|
40
40
|
type: 'snackbar',
|
|
41
41
|
id: 'edit-site-patterns-success'
|
|
42
42
|
});
|
|
@@ -46,7 +46,7 @@ const duplicateTemplatePart = {
|
|
|
46
46
|
blocks: blocks,
|
|
47
47
|
defaultArea: item.area,
|
|
48
48
|
defaultTitle: sprintf(/* translators: %s: Existing template part title */
|
|
49
|
-
|
|
49
|
+
_x('%s (Copy)', 'template part'), getItemTitle(item)),
|
|
50
50
|
onCreate: onTemplatePartSuccess,
|
|
51
51
|
onError: closeModal,
|
|
52
52
|
confirmLabel: _x('Duplicate', 'action label'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useDispatch","
|
|
1
|
+
{"version":3,"names":["useDispatch","_x","sprintf","store","noticesStore","useMemo","parse","TEMPLATE_PART_POST_TYPE","CreateTemplatePartModalContents","getItemTitle","jsx","_jsx","duplicateTemplatePart","id","label","isEligible","item","type","modalHeader","RenderModal","items","closeModal","blocks","_item$blocks","content","raw","__unstableSkipMigrationLogs","createSuccessNotice","onTemplatePartSuccess","defaultArea","area","defaultTitle","onCreate","onError","confirmLabel"],"sources":["@wordpress/editor/src/dataviews/actions/duplicate-template-part.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { _x, sprintf } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { useMemo } from '@wordpress/element';\n// @ts-ignore\nimport { parse } from '@wordpress/blocks';\nimport type { Action } from '@wordpress/dataviews';\n\n/**\n * Internal dependencies\n */\nimport { TEMPLATE_PART_POST_TYPE } from '../../store/constants';\nimport { CreateTemplatePartModalContents } from '../../components/create-template-part-modal';\nimport { getItemTitle } from './utils';\nimport type { TemplatePart } from '../types';\n\nconst duplicateTemplatePart: Action< TemplatePart > = {\n\tid: 'duplicate-template-part',\n\tlabel: _x( 'Duplicate', 'action label' ),\n\tisEligible: ( item ) => item.type === TEMPLATE_PART_POST_TYPE,\n\tmodalHeader: _x( 'Duplicate template part', 'action label' ),\n\tRenderModal: ( { items, closeModal } ) => {\n\t\tconst [ item ] = items;\n\t\tconst blocks = useMemo( () => {\n\t\t\treturn (\n\t\t\t\titem.blocks ??\n\t\t\t\tparse(\n\t\t\t\t\ttypeof item.content === 'string'\n\t\t\t\t\t\t? item.content\n\t\t\t\t\t\t: item.content.raw,\n\t\t\t\t\t{\n\t\t\t\t\t\t__unstableSkipMigrationLogs: true,\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\t);\n\t\t}, [ item.content, item.blocks ] );\n\t\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\t\tfunction onTemplatePartSuccess() {\n\t\t\tcreateSuccessNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t// translators: %s: The new template part's title e.g. 'Call to action (copy)'.\n\t\t\t\t\t_x( '\"%s\" duplicated.', 'template part' ),\n\t\t\t\t\tgetItemTitle( item )\n\t\t\t\t),\n\t\t\t\t{ type: 'snackbar', id: 'edit-site-patterns-success' }\n\t\t\t);\n\t\t\tcloseModal?.();\n\t\t}\n\t\treturn (\n\t\t\t<CreateTemplatePartModalContents\n\t\t\t\tblocks={ blocks }\n\t\t\t\tdefaultArea={ item.area }\n\t\t\t\tdefaultTitle={ sprintf(\n\t\t\t\t\t/* translators: %s: Existing template part title */\n\t\t\t\t\t_x( '%s (Copy)', 'template part' ),\n\t\t\t\t\tgetItemTitle( item )\n\t\t\t\t) }\n\t\t\t\tonCreate={ onTemplatePartSuccess }\n\t\t\t\tonError={ closeModal }\n\t\t\t\tconfirmLabel={ _x( 'Duplicate', 'action label' ) }\n\t\t\t\tcloseModal={ closeModal }\n\t\t\t/>\n\t\t);\n\t},\n};\n\nexport default duplicateTemplatePart;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,KAAK,IAAIC,YAAY,QAAQ,oBAAoB;AAC1D,SAASC,OAAO,QAAQ,oBAAoB;AAC5C;AACA,SAASC,KAAK,QAAQ,mBAAmB;AAGzC;AACA;AACA;AACA,SAASC,uBAAuB,QAAQ,uBAAuB;AAC/D,SAASC,+BAA+B,QAAQ,6CAA6C;AAC7F,SAASC,YAAY,QAAQ,SAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGvC,MAAMC,qBAA6C,GAAG;EACrDC,EAAE,EAAE,yBAAyB;EAC7BC,KAAK,EAAEb,EAAE,CAAE,WAAW,EAAE,cAAe,CAAC;EACxCc,UAAU,EAAIC,IAAI,IAAMA,IAAI,CAACC,IAAI,KAAKV,uBAAuB;EAC7DW,WAAW,EAAEjB,EAAE,CAAE,yBAAyB,EAAE,cAAe,CAAC;EAC5DkB,WAAW,EAAEA,CAAE;IAAEC,KAAK;IAAEC;EAAW,CAAC,KAAM;IACzC,MAAM,CAAEL,IAAI,CAAE,GAAGI,KAAK;IACtB,MAAME,MAAM,GAAGjB,OAAO,CAAE,MAAM;MAAA,IAAAkB,YAAA;MAC7B,QAAAA,YAAA,GACCP,IAAI,CAACM,MAAM,cAAAC,YAAA,cAAAA,YAAA,GACXjB,KAAK,CACJ,OAAOU,IAAI,CAACQ,OAAO,KAAK,QAAQ,GAC7BR,IAAI,CAACQ,OAAO,GACZR,IAAI,CAACQ,OAAO,CAACC,GAAG,EACnB;QACCC,2BAA2B,EAAE;MAC9B,CACD,CAAC;IAEH,CAAC,EAAE,CAAEV,IAAI,CAACQ,OAAO,EAAER,IAAI,CAACM,MAAM,CAAG,CAAC;IAClC,MAAM;MAAEK;IAAoB,CAAC,GAAG3B,WAAW,CAAEI,YAAa,CAAC;IAC3D,SAASwB,qBAAqBA,CAAA,EAAG;MAChCD,mBAAmB,CAClBzB,OAAO;MACN;MACAD,EAAE,CAAE,kBAAkB,EAAE,eAAgB,CAAC,EACzCQ,YAAY,CAAEO,IAAK,CACpB,CAAC,EACD;QAAEC,IAAI,EAAE,UAAU;QAAEJ,EAAE,EAAE;MAA6B,CACtD,CAAC;MACDQ,UAAU,GAAG,CAAC;IACf;IACA,oBACCV,IAAA,CAACH,+BAA+B;MAC/Bc,MAAM,EAAGA,MAAQ;MACjBO,WAAW,EAAGb,IAAI,CAACc,IAAM;MACzBC,YAAY,EAAG7B,OAAO,CACrB;MACAD,EAAE,CAAE,WAAW,EAAE,eAAgB,CAAC,EAClCQ,YAAY,CAAEO,IAAK,CACpB,CAAG;MACHgB,QAAQ,EAAGJ,qBAAuB;MAClCK,OAAO,EAAGZ,UAAY;MACtBa,YAAY,EAAGjC,EAAE,CAAE,WAAW,EAAE,cAAe,CAAG;MAClDoB,UAAU,EAAGA;IAAY,CACzB,CAAC;EAEJ;AACD,CAAC;AAED,eAAeT,qBAAqB","ignoreList":[]}
|
|
@@ -783,7 +783,7 @@ export const toggleDistractionFree = () => ({
|
|
|
783
783
|
}
|
|
784
784
|
registry.batch(() => {
|
|
785
785
|
registry.dispatch(preferencesStore).set('core', 'distractionFree', !isDistractionFree);
|
|
786
|
-
registry.dispatch(noticesStore).createInfoNotice(isDistractionFree ? __('Distraction free
|
|
786
|
+
registry.dispatch(noticesStore).createInfoNotice(isDistractionFree ? __('Distraction free mode deactivated.') : __('Distraction free mode activated.'), {
|
|
787
787
|
id: 'core/editor/distraction-free-mode/notice',
|
|
788
788
|
type: 'snackbar',
|
|
789
789
|
actions: [{
|
|
@@ -809,10 +809,11 @@ export const switchEditorMode = mode => ({
|
|
|
809
809
|
registry
|
|
810
810
|
}) => {
|
|
811
811
|
registry.dispatch(preferencesStore).set('core', 'editorMode', mode);
|
|
812
|
-
|
|
813
|
-
// Unselect blocks when we switch to a non visual mode.
|
|
814
812
|
if (mode !== 'visual') {
|
|
813
|
+
// Unselect blocks when we switch to a non visual mode.
|
|
815
814
|
registry.dispatch(blockEditorStore).clearSelectedBlock();
|
|
815
|
+
// Exit zoom out state when switching to a non visual mode.
|
|
816
|
+
unlock(registry.dispatch(blockEditorStore)).resetZoomLevel();
|
|
816
817
|
}
|
|
817
818
|
if (mode === 'visual') {
|
|
818
819
|
speak(__('Visual editor selected'), 'assertive');
|