@wordpress/edit-site 6.50.0 → 6.50.1-next.v.202607070741.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/editor/index.cjs +33 -101
- package/build/components/editor/index.cjs.map +3 -3
- package/build/components/layout/index.cjs +12 -14
- package/build/components/layout/index.cjs.map +3 -3
- package/build/components/page-patterns/fields.cjs +0 -36
- package/build/components/page-patterns/fields.cjs.map +2 -2
- package/build/components/page-patterns/index.cjs +4 -15
- package/build/components/page-patterns/index.cjs.map +2 -2
- package/build/components/save-panel/index.cjs +1 -2
- package/build/components/save-panel/index.cjs.map +2 -2
- package/build/components/site-hub/index.cjs +24 -155
- package/build/components/site-hub/index.cjs.map +3 -3
- package/build/index.cjs +3 -1
- package/build/index.cjs.map +2 -2
- package/build-module/components/editor/index.mjs +36 -104
- package/build-module/components/editor/index.mjs.map +2 -2
- package/build-module/components/layout/index.mjs +12 -14
- package/build-module/components/layout/index.mjs.map +2 -2
- package/build-module/components/page-patterns/fields.mjs +2 -41
- package/build-module/components/page-patterns/fields.mjs.map +2 -2
- package/build-module/components/page-patterns/index.mjs +5 -16
- package/build-module/components/page-patterns/index.mjs.map +2 -2
- package/build-module/components/save-panel/index.mjs +1 -2
- package/build-module/components/save-panel/index.mjs.map +2 -2
- package/build-module/components/site-hub/index.mjs +27 -158
- package/build-module/components/site-hub/index.mjs.map +2 -2
- package/build-module/index.mjs +3 -1
- package/build-module/index.mjs.map +2 -2
- package/build-style/style-rtl.css +71 -189
- package/build-style/style.css +71 -189
- package/package.json +48 -48
- package/src/components/editor/index.js +18 -101
- package/src/components/editor/style.scss +8 -19
- package/src/components/layout/index.js +12 -15
- package/src/components/layout/style.scss +5 -7
- package/src/components/page-patterns/fields.js +2 -50
- package/src/components/page-patterns/index.js +5 -23
- package/src/components/page-patterns/style.scss +1 -1
- package/src/components/save-panel/index.js +1 -2
- package/src/components/sidebar/style.scss +2 -0
- package/src/components/sidebar-global-styles/style.scss +7 -4
- package/src/components/sidebar-navigation-screen/style.scss +1 -1
- package/src/components/site-hub/index.js +7 -141
- package/src/components/site-hub/style.scss +0 -72
- package/src/index.js +3 -1
- package/src/style.scss +14 -11
- package/build/components/site-icon/index.cjs +0 -73
- package/build/components/site-icon/index.cjs.map +0 -7
- package/build-module/components/site-icon/index.mjs +0 -42
- package/build-module/components/site-icon/index.mjs.map +0 -7
- package/build-style/experimental-omnibar-rtl.css +0 -103
- package/build-style/experimental-omnibar.css +0 -103
- package/src/components/site-icon/index.js +0 -51
- package/src/components/site-icon/style.scss +0 -41
- package/src/experimental-omnibar.scss +0 -75
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/editor/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { Button, __unstableMotion as motion } from '@wordpress/components';\nimport { useInstanceId, useReducedMotion } from '@wordpress/compose';\nimport {\n\tEditorKeyboardShortcutsRegister,\n\tprivateApis as editorPrivateApis,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { __, isRTL, sprintf } from '@wordpress/i18n';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { privateApis as blockLibraryPrivateApis } from '@wordpress/block-library';\nimport { useCallback } from '@wordpress/element';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { Icon, arrowUpLeft, arrowUpRight } from '@wordpress/icons';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport WelcomeGuide from '../welcome-guide';\nimport CanvasLoader from '../canvas-loader';\nimport { unlock } from '../../lock-unlock';\nimport { useSpecificEditorSettings } from '../block-editor/use-site-editor-settings';\nimport PluginTemplateSettingPanel from '../plugin-template-setting-panel';\nimport { isPreviewingTheme } from '../../utils/is-previewing-theme';\nimport SaveButton from '../save-button';\nimport SavePanel from '../save-panel';\nimport SiteEditorMoreMenu from '../more-menu';\nimport SiteIcon from '../site-icon';\nimport useEditorIframeProps from '../block-editor/use-editor-iframe-props';\nimport { ViewportSync } from '../block-editor/use-viewport-sync';\nimport useEditorTitle from './use-editor-title';\nimport { useIsSiteEditorLoading } from '../layout/hooks';\nimport { useAdaptEditorToCanvas } from './use-adapt-editor-to-canvas';\nimport {\n\tuseResolveEditedEntity,\n\tuseSyncDeprecatedEntityIntoState,\n} from './use-resolve-edited-entity';\nimport SitePreview from './site-preview';\n\nconst { Editor, BackButton } = unlock( editorPrivateApis );\nconst { useHistory, useLocation } = unlock( routerPrivateApis );\nconst { BlockKeyboardShortcuts } = unlock( blockLibraryPrivateApis );\n\nconst toggleHomeIconVariants = {\n\tedit: {\n\t\topacity: 0,\n\t\tscale: 0.2,\n\t},\n\thover: {\n\t\topacity: 1,\n\t\tscale: 1,\n\t\tclipPath: 'inset( 22% round 2px )',\n\t},\n};\n\nconst siteIconVariants = {\n\tedit: {\n\t\tclipPath: 'inset(0% round 0px)',\n\t},\n\thover: {\n\t\tclipPath: 'inset( 22% round 2px )',\n\t},\n\ttap: {\n\t\tclipPath: 'inset(0% round 0px)',\n\t},\n};\n\nfunction getListPathForPostType( postType ) {\n\tswitch ( postType ) {\n\t\tcase 'navigation':\n\t\t\treturn '/navigation';\n\t\tcase 'wp_block':\n\t\t\treturn '/pattern?postType=wp_block';\n\t\tcase 'wp_template_part':\n\t\t\treturn '/pattern?postType=wp_template_part';\n\t\tcase 'wp_template':\n\t\t\treturn '/template';\n\t\tcase 'page':\n\t\t\treturn '/page';\n\t\tcase 'post':\n\t\t\treturn '/';\n\t}\n\tthrow 'Unknown post type';\n}\n\nfunction getNavigationPath( location, postType ) {\n\tconst { path, name } = location;\n\tif (\n\t\t[\n\t\t\t'pattern-item',\n\t\t\t'template-part-item',\n\t\t\t'page-item',\n\t\t\t'template-item',\n\t\t\t'static-template-item',\n\t\t\t'post-item',\n\t\t].includes( name )\n\t) {\n\t\treturn getListPathForPostType( postType );\n\t}\n\treturn addQueryArgs( path, { canvas: undefined } );\n}\n\nexport default function EditSiteEditor( { isHomeRoute = false } ) {\n\tconst disableMotion = useReducedMotion();\n\tconst location = useLocation();\n\tconst history = useHistory();\n\tconst { canvas = 'view' } = location.query;\n\tconst isLoading = useIsSiteEditorLoading();\n\tuseAdaptEditorToCanvas( canvas );\n\tconst entity = useResolveEditedEntity();\n\t// deprecated sync state with url\n\tuseSyncDeprecatedEntityIntoState( entity );\n\tconst { postType, postId, context } = entity;\n\tconst { isBlockBasedTheme, hasSiteIcon } = useSelect( ( select ) => {\n\t\tconst { getCurrentTheme, getEntityRecord } = select( coreDataStore );\n\t\tconst siteData = getEntityRecord( 'root', '__unstableBase', undefined );\n\n\t\treturn {\n\t\t\tisBlockBasedTheme: getCurrentTheme()?.is_block_theme,\n\t\t\thasSiteIcon: !! siteData?.site_icon_url,\n\t\t};\n\t}, [] );\n\tconst postWithTemplate = !! context?.postId;\n\tuseEditorTitle(\n\t\tpostWithTemplate ? context.postType : postType,\n\t\tpostWithTemplate ? context.postId : postId\n\t);\n\tconst _isPreviewingTheme = isPreviewingTheme();\n\tconst iframeProps = useEditorIframeProps();\n\tconst isEditMode = canvas === 'edit';\n\tconst loadingProgressId = useInstanceId(\n\t\tCanvasLoader,\n\t\t'edit-site-editor__loading-progress'\n\t);\n\n\tconst editorSettings = useSpecificEditorSettings();\n\tconst { resetZoomLevel } = unlock( useDispatch( blockEditorStore ) );\n\tconst { setCurrentRevisionId } = unlock( useDispatch( editorStore ) );\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\tconst onActionPerformed = useCallback(\n\t\t( actionId, items ) => {\n\t\t\tswitch ( actionId ) {\n\t\t\t\tcase 'move-to-trash':\n\t\t\t\tcase 'delete-post':\n\t\t\t\t\t{\n\t\t\t\t\t\thistory.navigate(\n\t\t\t\t\t\t\tgetListPathForPostType(\n\t\t\t\t\t\t\t\tpostWithTemplate ? context.postType : postType\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'duplicate-post':\n\t\t\t\t\t{\n\t\t\t\t\t\tconst newItem = items[ 0 ];\n\t\t\t\t\t\tconst _title =\n\t\t\t\t\t\t\ttypeof newItem.title === 'string'\n\t\t\t\t\t\t\t\t? newItem.title\n\t\t\t\t\t\t\t\t: newItem.title?.rendered;\n\t\t\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t// translators: %s: Title of the created post or template, e.g: \"Hello world\".\n\t\t\t\t\t\t\t\t__( '\"%s\" successfully created.' ),\n\t\t\t\t\t\t\t\tdecodeEntities( _title ) || __( '(no title)' )\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\t\t\tid: 'duplicate-post-action',\n\t\t\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: __( 'Edit' ),\n\t\t\t\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\t\t\t\thistory.navigate(\n\t\t\t\t\t\t\t\t\t\t\t\t`/${ newItem.type }/${ newItem.id }?canvas=edit`\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\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}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t},\n\t\t[\n\t\t\tpostType,\n\t\t\tcontext?.postType,\n\t\t\tpostWithTemplate,\n\t\t\thistory,\n\t\t\tcreateSuccessNotice,\n\t\t]\n\t);\n\n\tconst isReady = ! isLoading;\n\tconst transition = {\n\t\tduration: disableMotion ? 0 : 0.2,\n\t};\n\n\tconst hasAdminBarInEditor = window.__experimentalAdminBarInEditor;\n\n\treturn ! isBlockBasedTheme && isHomeRoute ? (\n\t\t<SitePreview />\n\t) : (\n\t\t<>\n\t\t\t<EditorKeyboardShortcutsRegister />\n\t\t\t{ isEditMode && <BlockKeyboardShortcuts /> }\n\t\t\t{ ! isReady ? <CanvasLoader id={ loadingProgressId } /> : null }\n\t\t\t{ isEditMode && isReady && (\n\t\t\t\t<WelcomeGuide\n\t\t\t\t\tpostType={ postWithTemplate ? context.postType : postType }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ isReady && (\n\t\t\t\t<Editor\n\t\t\t\t\tpostType={ postWithTemplate ? context.postType : postType }\n\t\t\t\t\tpostId={ postWithTemplate ? context.postId : postId }\n\t\t\t\t\ttemplateId={ postWithTemplate ? postId : undefined }\n\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\tclassName=\"edit-site-editor__editor-interface\"\n\t\t\t\t\tcustomSaveButton={\n\t\t\t\t\t\t_isPreviewingTheme && <SaveButton size=\"compact\" />\n\t\t\t\t\t}\n\t\t\t\t\tcustomSavePanel={ _isPreviewingTheme && <SavePanel /> }\n\t\t\t\t\tiframeProps={ iframeProps }\n\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\textraSidebarPanels={\n\t\t\t\t\t\t! postWithTemplate && (\n\t\t\t\t\t\t\t<PluginTemplateSettingPanel.Slot />\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t{ isEditMode && <ViewportSync /> }\n\t\t\t\t\t{ isEditMode && (\n\t\t\t\t\t\t<BackButton>\n\t\t\t\t\t\t\t{ ( { length } ) =>\n\t\t\t\t\t\t\t\tlength <= 1 && (\n\t\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\t\tclassName=\"edit-site-editor__view-mode-toggle\"\n\t\t\t\t\t\t\t\t\t\ttransition={ transition }\n\t\t\t\t\t\t\t\t\t\tanimate=\"edit\"\n\t\t\t\t\t\t\t\t\t\tinitial=\"edit\"\n\t\t\t\t\t\t\t\t\t\twhileHover=\"hover\"\n\t\t\t\t\t\t\t\t\t\twhileTap=\"tap\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Open Navigation' ) }\n\t\t\t\t\t\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t\t\t\t\t\t\ttooltipPosition=\"middle right\"\n\t\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\t\tresetZoomLevel();\n\t\t\t\t\t\t\t\t\t\t\t\tsetCurrentRevisionId( null );\n\t\t\t\t\t\t\t\t\t\t\t\thistory.navigate(\n\t\t\t\t\t\t\t\t\t\t\t\t\tgetNavigationPath(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocation,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpostWithTemplate\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? context.postType\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: postType\n\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttransition:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'canvas-mode-view-transition',\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ ! hasAdminBarInEditor && (\n\t\t\t\t\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\t\t\t\t\tvariants={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t! disableMotion &&\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsiteIconVariants\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<SiteIcon className=\"edit-site-editor__view-mode-toggle-icon\" />\n\t\t\t\t\t\t\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t\t{ hasAdminBarInEditor ? (\n\t\t\t\t\t\t\t\t\t\t\t<div className=\"edit-site-editor__back-icon\">\n\t\t\t\t\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tisRTL()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? arrowUpRight\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: arrowUpLeft\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'edit-site-editor__back-icon',\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'has-site-icon':\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thasSiteIcon,\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\tvariants={\n\t\t\t\t\t\t\t\t\t\t\t\t\t! disableMotion &&\n\t\t\t\t\t\t\t\t\t\t\t\t\ttoggleHomeIconVariants\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tisRTL()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? arrowUpRight\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: arrowUpLeft\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</BackButton>\n\t\t\t\t\t) }\n\t\t\t\t\t<SiteEditorMoreMenu />\n\t\t\t\t</Editor>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],
|
|
5
|
-
"mappings": ";AAGA,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { Button } from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport {\n\tEditorKeyboardShortcutsRegister,\n\tprivateApis as editorPrivateApis,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { __, isRTL, sprintf } from '@wordpress/i18n';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { privateApis as blockLibraryPrivateApis } from '@wordpress/block-library';\nimport { useCallback } from '@wordpress/element';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { Icon, chevronLeft, chevronRight } from '@wordpress/icons';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport WelcomeGuide from '../welcome-guide';\nimport CanvasLoader from '../canvas-loader';\nimport { unlock } from '../../lock-unlock';\nimport { useSpecificEditorSettings } from '../block-editor/use-site-editor-settings';\nimport PluginTemplateSettingPanel from '../plugin-template-setting-panel';\nimport { isPreviewingTheme } from '../../utils/is-previewing-theme';\nimport SaveButton from '../save-button';\nimport SavePanel from '../save-panel';\nimport SiteEditorMoreMenu from '../more-menu';\nimport useEditorIframeProps from '../block-editor/use-editor-iframe-props';\nimport { ViewportSync } from '../block-editor/use-viewport-sync';\nimport useEditorTitle from './use-editor-title';\nimport { useIsSiteEditorLoading } from '../layout/hooks';\nimport { useAdaptEditorToCanvas } from './use-adapt-editor-to-canvas';\nimport {\n\tuseResolveEditedEntity,\n\tuseSyncDeprecatedEntityIntoState,\n} from './use-resolve-edited-entity';\nimport SitePreview from './site-preview';\n\nconst { Editor, BackButton } = unlock( editorPrivateApis );\nconst { useHistory, useLocation } = unlock( routerPrivateApis );\nconst { BlockKeyboardShortcuts } = unlock( blockLibraryPrivateApis );\n\nfunction getListPathForPostType( postType ) {\n\tswitch ( postType ) {\n\t\tcase 'navigation':\n\t\t\treturn '/navigation';\n\t\tcase 'wp_block':\n\t\t\treturn '/pattern?postType=wp_block';\n\t\tcase 'wp_template_part':\n\t\t\treturn '/pattern?postType=wp_template_part';\n\t\tcase 'wp_template':\n\t\t\treturn '/template';\n\t\tcase 'page':\n\t\t\treturn '/page';\n\t\tcase 'post':\n\t\t\treturn '/';\n\t}\n\tthrow 'Unknown post type';\n}\n\nfunction getNavigationPath( location, postType ) {\n\tconst { path, name } = location;\n\tif (\n\t\t[\n\t\t\t'pattern-item',\n\t\t\t'template-part-item',\n\t\t\t'page-item',\n\t\t\t'template-item',\n\t\t\t'static-template-item',\n\t\t\t'post-item',\n\t\t].includes( name )\n\t) {\n\t\treturn getListPathForPostType( postType );\n\t}\n\treturn addQueryArgs( path, { canvas: undefined } );\n}\n\nexport default function EditSiteEditor( { isHomeRoute = false } ) {\n\tconst location = useLocation();\n\tconst history = useHistory();\n\tconst { canvas = 'view' } = location.query;\n\tconst isLoading = useIsSiteEditorLoading();\n\tuseAdaptEditorToCanvas( canvas );\n\tconst entity = useResolveEditedEntity();\n\t// deprecated sync state with url\n\tuseSyncDeprecatedEntityIntoState( entity );\n\tconst { postType, postId, context } = entity;\n\tconst isBlockBasedTheme = useSelect(\n\t\t( select ) => select( coreDataStore ).getCurrentTheme()?.is_block_theme,\n\t\t[]\n\t);\n\tconst postWithTemplate = !! context?.postId;\n\tuseEditorTitle(\n\t\tpostWithTemplate ? context.postType : postType,\n\t\tpostWithTemplate ? context.postId : postId\n\t);\n\tconst _isPreviewingTheme = isPreviewingTheme();\n\tconst iframeProps = useEditorIframeProps();\n\tconst isEditMode = canvas === 'edit';\n\tconst loadingProgressId = useInstanceId(\n\t\tCanvasLoader,\n\t\t'edit-site-editor__loading-progress'\n\t);\n\n\tconst editorSettings = useSpecificEditorSettings();\n\tconst { resetZoomLevel } = unlock( useDispatch( blockEditorStore ) );\n\tconst { setCurrentRevisionId } = unlock( useDispatch( editorStore ) );\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\tconst onActionPerformed = useCallback(\n\t\t( actionId, items ) => {\n\t\t\tswitch ( actionId ) {\n\t\t\t\tcase 'move-to-trash':\n\t\t\t\tcase 'delete-post':\n\t\t\t\t\t{\n\t\t\t\t\t\thistory.navigate(\n\t\t\t\t\t\t\tgetListPathForPostType(\n\t\t\t\t\t\t\t\tpostWithTemplate ? context.postType : postType\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'duplicate-post':\n\t\t\t\t\t{\n\t\t\t\t\t\tconst newItem = items[ 0 ];\n\t\t\t\t\t\tconst _title =\n\t\t\t\t\t\t\ttypeof newItem.title === 'string'\n\t\t\t\t\t\t\t\t? newItem.title\n\t\t\t\t\t\t\t\t: newItem.title?.rendered;\n\t\t\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t// translators: %s: Title of the created post or template, e.g: \"Hello world\".\n\t\t\t\t\t\t\t\t__( '\"%s\" successfully created.' ),\n\t\t\t\t\t\t\t\tdecodeEntities( _title ) || __( '(no title)' )\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\t\t\tid: 'duplicate-post-action',\n\t\t\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: __( 'Edit' ),\n\t\t\t\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\t\t\t\thistory.navigate(\n\t\t\t\t\t\t\t\t\t\t\t\t`/${ newItem.type }/${ newItem.id }?canvas=edit`\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\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}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t},\n\t\t[\n\t\t\tpostType,\n\t\t\tcontext?.postType,\n\t\t\tpostWithTemplate,\n\t\t\thistory,\n\t\t\tcreateSuccessNotice,\n\t\t]\n\t);\n\n\tconst isReady = ! isLoading;\n\n\treturn ! isBlockBasedTheme && isHomeRoute ? (\n\t\t<SitePreview />\n\t) : (\n\t\t<>\n\t\t\t<EditorKeyboardShortcutsRegister />\n\t\t\t{ isEditMode && <BlockKeyboardShortcuts /> }\n\t\t\t{ ! isReady ? <CanvasLoader id={ loadingProgressId } /> : null }\n\t\t\t{ isEditMode && isReady && (\n\t\t\t\t<WelcomeGuide\n\t\t\t\t\tpostType={ postWithTemplate ? context.postType : postType }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ isReady && (\n\t\t\t\t<Editor\n\t\t\t\t\tpostType={ postWithTemplate ? context.postType : postType }\n\t\t\t\t\tpostId={ postWithTemplate ? context.postId : postId }\n\t\t\t\t\ttemplateId={ postWithTemplate ? postId : undefined }\n\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\tclassName=\"edit-site-editor__editor-interface\"\n\t\t\t\t\tcustomSaveButton={\n\t\t\t\t\t\t_isPreviewingTheme && <SaveButton size=\"compact\" />\n\t\t\t\t\t}\n\t\t\t\t\tcustomSavePanel={ _isPreviewingTheme && <SavePanel /> }\n\t\t\t\t\tiframeProps={ iframeProps }\n\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\textraSidebarPanels={\n\t\t\t\t\t\t! postWithTemplate && (\n\t\t\t\t\t\t\t<PluginTemplateSettingPanel.Slot />\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t{ isEditMode && <ViewportSync /> }\n\t\t\t\t\t{ isEditMode && (\n\t\t\t\t\t\t<BackButton>\n\t\t\t\t\t\t\t{ ( { length } ) =>\n\t\t\t\t\t\t\t\tlength <= 1 && (\n\t\t\t\t\t\t\t\t\t<div className=\"edit-site-editor__view-mode-toggle\">\n\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Open Navigation' ) }\n\t\t\t\t\t\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t\t\t\t\t\t\ttooltipPosition=\"middle right\"\n\t\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\t\tresetZoomLevel();\n\t\t\t\t\t\t\t\t\t\t\t\tsetCurrentRevisionId( null );\n\t\t\t\t\t\t\t\t\t\t\t\thistory.navigate(\n\t\t\t\t\t\t\t\t\t\t\t\t\tgetNavigationPath(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocation,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpostWithTemplate\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? context.postType\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: postType\n\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttransition:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'canvas-mode-view-transition',\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t<div className=\"edit-site-editor__back-icon\">\n\t\t\t\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\t\t\tisRTL()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t? chevronRight\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: chevronLeft\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</BackButton>\n\t\t\t\t\t) }\n\t\t\t\t\t<SiteEditorMoreMenu />\n\t\t\t\t</Editor>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,aAAa,iBAAiB;AACvC,SAAS,cAAc;AACvB,SAAS,qBAAqB;AAC9B;AAAA,EACC;AAAA,EACA,eAAe;AAAA,EACf,SAAS;AAAA,OACH;AACP,SAAS,IAAI,OAAO,eAAe;AACnC,SAAS,SAAS,qBAAqB;AACvC,SAAS,eAAe,+BAA+B;AACvD,SAAS,mBAAmB;AAC5B,SAAS,SAAS,oBAAoB;AACtC,SAAS,eAAe,yBAAyB;AACjD,SAAS,sBAAsB;AAC/B,SAAS,MAAM,aAAa,oBAAoB;AAChD,SAAS,SAAS,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AsB,IAAK;AAC3B,0BAAQ;AAAA,oBACP;AAAA,sBACC;AAAA,sBACA,mBACG,QAAQ,WACR;AAAA,oBACJ;AAAA,oBACA;AAAA,sBACC,YACC;AAAA,oBACF;AAAA,kBACD;AAAA,gBACD;AAAA;AAAA,YACD;AAAA,YACA,oBAAC,SAAI,WAAU,+BACd;AAAA,cAAC;AAAA;AAAA,gBACA,MACC,MAAM,IACH,eACA;AAAA;AAAA,YAEL,GACD;AAAA,aACD,GAGH;AAAA,UAED,oBAAC,sBAAmB;AAAA;AAAA;AAAA,IACrB;AAAA,KAEF;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
useResizeObserver,
|
|
14
14
|
usePrevious
|
|
15
15
|
} from "@wordpress/compose";
|
|
16
|
+
import { focus } from "@wordpress/dom";
|
|
16
17
|
import { __, sprintf } from "@wordpress/i18n";
|
|
17
18
|
import { useState, useRef, useEffect, useMemo } from "@wordpress/element";
|
|
18
19
|
import {
|
|
@@ -27,7 +28,7 @@ import { SnackbarNotices, store as noticesStore } from "@wordpress/notices";
|
|
|
27
28
|
import { useDispatch, useSelect } from "@wordpress/data";
|
|
28
29
|
import { store as preferencesStore } from "@wordpress/preferences";
|
|
29
30
|
import { Tooltip } from "@wordpress/ui";
|
|
30
|
-
import {
|
|
31
|
+
import { SiteHubMobile } from "../site-hub/index.mjs";
|
|
31
32
|
import ResizableFrame from "../resizable-frame/index.mjs";
|
|
32
33
|
import { unlock } from "../../lock-unlock.mjs";
|
|
33
34
|
import SaveKeyboardShortcut from "../save-keyboard-shortcut/index.mjs";
|
|
@@ -44,12 +45,11 @@ var CONTENT_COLOR = { background: "#ffffff" };
|
|
|
44
45
|
function Layout() {
|
|
45
46
|
const { query, name: routeKey, areas, widths } = useLocation();
|
|
46
47
|
const canvas = routeKey === "notfound" ? "view" : query?.canvas ?? "view";
|
|
47
|
-
const
|
|
48
|
-
const showDesktopSiteHub = !hasAdminBarInEditor;
|
|
49
|
-
const showMobileSiteHub = !hasAdminBarInEditor || routeKey !== "home";
|
|
48
|
+
const showMobileSiteHub = !!areas.mobileContent;
|
|
50
49
|
const hasMobileAreas = areas.mobileSidebar || areas.mobileContent || areas.preview;
|
|
51
50
|
const isMobileViewport = useViewportMatch("medium", "<");
|
|
52
|
-
const
|
|
51
|
+
const mobileToggleRef = useRef();
|
|
52
|
+
const sidebarRegionRef = useRef();
|
|
53
53
|
const navigateRegionsProps = useNavigateRegions();
|
|
54
54
|
const disableMotion = useReducedMotion();
|
|
55
55
|
const [canvasResizer, canvasSize] = useResizeObserver();
|
|
@@ -71,7 +71,11 @@ function Layout() {
|
|
|
71
71
|
const previousCanvaMode = usePrevious(canvas);
|
|
72
72
|
useEffect(() => {
|
|
73
73
|
if (previousCanvaMode === "edit") {
|
|
74
|
-
|
|
74
|
+
const desktopToggle = sidebarRegionRef.current ? (
|
|
75
|
+
// We're typically expecting the `<DashboardBackButton />` component as the first tabbable element.
|
|
76
|
+
focus.tabbable.find(sidebarRegionRef.current)[0]
|
|
77
|
+
) : void 0;
|
|
78
|
+
(desktopToggle ?? mobileToggleRef.current)?.focus();
|
|
75
79
|
}
|
|
76
80
|
}, [canvas]);
|
|
77
81
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -94,6 +98,7 @@ function Layout() {
|
|
|
94
98
|
(!isMobileViewport || !hasMobileAreas) && /* @__PURE__ */ jsx(
|
|
95
99
|
NavigableRegion,
|
|
96
100
|
{
|
|
101
|
+
ref: sidebarRegionRef,
|
|
97
102
|
ariaLabel: __("Navigation"),
|
|
98
103
|
className: "edit-site-layout__sidebar-region",
|
|
99
104
|
children: /* @__PURE__ */ jsx(AnimatePresence, { children: canvas === "view" && /* @__PURE__ */ jsxs(
|
|
@@ -112,13 +117,6 @@ function Layout() {
|
|
|
112
117
|
},
|
|
113
118
|
className: "edit-site-layout__sidebar",
|
|
114
119
|
children: [
|
|
115
|
-
showDesktopSiteHub && /* @__PURE__ */ jsx(
|
|
116
|
-
SiteHub,
|
|
117
|
-
{
|
|
118
|
-
ref: toggleRef,
|
|
119
|
-
isTransparent: isResizableFrameOversized
|
|
120
|
-
}
|
|
121
|
-
),
|
|
122
120
|
/* @__PURE__ */ jsx(SidebarNavigationProvider, { children: /* @__PURE__ */ jsx(
|
|
123
121
|
SidebarContent,
|
|
124
122
|
{
|
|
@@ -140,7 +138,7 @@ function Layout() {
|
|
|
140
138
|
showMobileSiteHub && /* @__PURE__ */ jsx(
|
|
141
139
|
SiteHubMobile,
|
|
142
140
|
{
|
|
143
|
-
ref:
|
|
141
|
+
ref: mobileToggleRef,
|
|
144
142
|
isTransparent: isResizableFrameOversized
|
|
145
143
|
}
|
|
146
144
|
),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/layout/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { NavigableRegion, getAdminThemeColors } from '@wordpress/admin-ui';\nimport {\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n\t__unstableUseNavigateRegions as useNavigateRegions,\n\tSlotFillProvider,\n} from '@wordpress/components';\nimport {\n\tuseReducedMotion,\n\tuseViewportMatch,\n\tuseResizeObserver,\n\tusePrevious,\n} from '@wordpress/compose';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useState, useRef, useEffect, useMemo } from '@wordpress/element';\nimport {\n\tUnsavedChangesWarning,\n\tErrorBoundary,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { ThemeProvider } from '@wordpress/theme';\nimport { PluginArea } from '@wordpress/plugins';\nimport { SnackbarNotices, store as noticesStore } from '@wordpress/notices';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { Tooltip } from '@wordpress/ui';\n\n/**\n * Internal dependencies\n */\nimport { default as SiteHub, SiteHubMobile } from '../site-hub';\nimport ResizableFrame from '../resizable-frame';\nimport { unlock } from '../../lock-unlock';\nimport SaveKeyboardShortcut from '../save-keyboard-shortcut';\nimport { useIsSiteEditorLoading } from './hooks';\nimport useMovingAnimation from './animation';\nimport { SidebarContent, SidebarNavigationProvider } from '../sidebar';\nimport SaveHub from '../save-hub';\nimport SavePanel from '../save-panel';\n\nconst { useLocation } = unlock( routerPrivateApis );\nconst { useStyle, UploadProgressSnackbar } = unlock( editorPrivateApis );\n\nconst ANIMATION_DURATION = 0.3;\nconst CONTENT_COLOR = { background: '#ffffff' };\n\nfunction Layout() {\n\tconst { query, name: routeKey, areas, widths } = useLocation();\n\t// Force canvas to 'view' on notfound route to show the error message and allow navigation.\n\tconst canvas = routeKey === 'notfound' ? 'view' : query?.canvas ?? 'view';\n\tconst hasAdminBarInEditor = window.__experimentalAdminBarInEditor;\n\tconst showDesktopSiteHub = ! hasAdminBarInEditor;\n\tconst showMobileSiteHub = ! hasAdminBarInEditor || routeKey !== 'home';\n\tconst hasMobileAreas =\n\t\tareas.mobileSidebar || areas.mobileContent || areas.preview;\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst toggleRef = useRef();\n\tconst navigateRegionsProps = useNavigateRegions();\n\tconst disableMotion = useReducedMotion();\n\tconst [ canvasResizer, canvasSize ] = useResizeObserver();\n\tconst isEditorLoading = useIsSiteEditorLoading();\n\tconst [ isResizableFrameOversized, setIsResizableFrameOversized ] =\n\t\tuseState( false );\n\tconst animationRef = useMovingAnimation( {\n\t\ttriggerAnimationOnChange: routeKey + '-' + canvas,\n\t} );\n\n\tconst { showIconLabels } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tshowIconLabels: select( preferencesStore ).get(\n\t\t\t\t'core',\n\t\t\t\t'showIconLabels'\n\t\t\t),\n\t\t};\n\t} );\n\n\tconst backgroundColor = useStyle( 'color.background' );\n\tconst gradientValue = useStyle( 'color.gradient' );\n\tconst previousCanvaMode = usePrevious( canvas );\n\tuseEffect( () => {\n\t\tif ( previousCanvaMode === 'edit' ) {\n\t\t\ttoggleRef.current?.focus();\n\t\t}\n\t\t// Should not depend on the previous canvas mode value but the next.\n\t}, [ canvas ] );\n\n\treturn (\n\t\t<>\n\t\t\t<UnsavedChangesWarning />\n\t\t\t{ canvas === 'view' && <SaveKeyboardShortcut /> }\n\t\t\t<div\n\t\t\t\t{ ...navigateRegionsProps }\n\t\t\t\tref={ navigateRegionsProps.ref }\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'edit-site-layout',\n\t\t\t\t\tnavigateRegionsProps.className,\n\t\t\t\t\t{\n\t\t\t\t\t\t'is-full-canvas': canvas === 'edit',\n\t\t\t\t\t\t'show-icon-labels': showIconLabels,\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<div className=\"edit-site-layout__content\">\n\t\t\t\t\t{ /*\n\t\t\t\t\t\tThe NavigableRegion must always be rendered and not use\n\t\t\t\t\t\t`inert` otherwise `useNavigateRegions` will fail.\n\t\t\t\t\t*/ }\n\t\t\t\t\t{ ( ! isMobileViewport || ! hasMobileAreas ) && (\n\t\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\t\tariaLabel={ __( 'Navigation' ) }\n\t\t\t\t\t\t\tclassName=\"edit-site-layout__sidebar-region\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<AnimatePresence>\n\t\t\t\t\t\t\t\t{ canvas === 'view' && (\n\t\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\t\tinitial={ { opacity: 0 } }\n\t\t\t\t\t\t\t\t\t\tanimate={ { opacity: 1 } }\n\t\t\t\t\t\t\t\t\t\texit={ { opacity: 0 } }\n\t\t\t\t\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\t\t\t\tduration:\n\t\t\t\t\t\t\t\t\t\t\t\t// Disable transition in mobile to emulate a full page transition.\n\t\t\t\t\t\t\t\t\t\t\t\tdisableMotion ||\n\t\t\t\t\t\t\t\t\t\t\t\tisMobileViewport\n\t\t\t\t\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t\t\t\t\t: ANIMATION_DURATION,\n\t\t\t\t\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tclassName=\"edit-site-layout__sidebar\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ showDesktopSiteHub && (\n\t\t\t\t\t\t\t\t\t\t\t<SiteHub\n\t\t\t\t\t\t\t\t\t\t\t\tref={ toggleRef }\n\t\t\t\t\t\t\t\t\t\t\t\tisTransparent={\n\t\t\t\t\t\t\t\t\t\t\t\t\tisResizableFrameOversized\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t<SidebarNavigationProvider>\n\t\t\t\t\t\t\t\t\t\t\t<SidebarContent\n\t\t\t\t\t\t\t\t\t\t\t\tshouldAnimate={\n\t\t\t\t\t\t\t\t\t\t\t\t\trouteKey !== 'styles' &&\n\t\t\t\t\t\t\t\t\t\t\t\t\trouteKey !== 'identity'\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\trouteKey={ routeKey }\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ areas.sidebar }\n\t\t\t\t\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t\t</SidebarContent>\n\t\t\t\t\t\t\t\t\t\t</SidebarNavigationProvider>\n\t\t\t\t\t\t\t\t\t\t<SaveHub />\n\t\t\t\t\t\t\t\t\t\t<SavePanel />\n\t\t\t\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</AnimatePresence>\n\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t) }\n\n\t\t\t\t\t<SnackbarNotices className=\"edit-site-layout__snackbar\" />\n\t\t\t\t\t<UploadProgressSnackbar />\n\n\t\t\t\t\t{ isMobileViewport && hasMobileAreas && (\n\t\t\t\t\t\t<div className=\"edit-site-layout__mobile\">\n\t\t\t\t\t\t\t<SidebarNavigationProvider>\n\t\t\t\t\t\t\t\t{ canvas !== 'edit' ? (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t{ showMobileSiteHub && (\n\t\t\t\t\t\t\t\t\t\t\t<SiteHubMobile\n\t\t\t\t\t\t\t\t\t\t\t\tref={ toggleRef }\n\t\t\t\t\t\t\t\t\t\t\t\tisTransparent={\n\t\t\t\t\t\t\t\t\t\t\t\t\tisResizableFrameOversized\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t{ areas.mobileContent ? (\n\t\t\t\t\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t\t\t\t\t * ThemeProvider wraps SidebarContent (rather than\n\t\t\t\t\t\t\t\t\t\t\t * just the content) so the scroll wrapper it renders\n\t\t\t\t\t\t\t\t\t\t\t * inherits the content background tokens. See\n\t\t\t\t\t\t\t\t\t\t\t * `.edit-site-sidebar__screen-wrapper` in style.scss.\n\t\t\t\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\t\t\t\t<ThemeProvider\n\t\t\t\t\t\t\t\t\t\t\t\tcolor={ CONTENT_COLOR }\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<SidebarContent\n\t\t\t\t\t\t\t\t\t\t\t\t\trouteKey={ routeKey }\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div className=\"edit-site-layout__mobile-content\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tareas.mobileContent\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t</SidebarContent>\n\t\t\t\t\t\t\t\t\t\t\t</ThemeProvider>\n\t\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t\t<SidebarContent\n\t\t\t\t\t\t\t\t\t\t\t\trouteKey={ routeKey }\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ areas.mobileSidebar }\n\t\t\t\t\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t\t</SidebarContent>\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t<SaveHub />\n\t\t\t\t\t\t\t\t\t\t<SavePanel />\n\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<ThemeProvider color={ CONTENT_COLOR }>\n\t\t\t\t\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t\t{ areas.preview }\n\t\t\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t\t\t</ThemeProvider>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</SidebarNavigationProvider>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ ! isMobileViewport &&\n\t\t\t\t\t\tareas.content &&\n\t\t\t\t\t\tcanvas !== 'edit' && (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclassName=\"edit-site-layout__area\"\n\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\tmaxWidth: widths?.content,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<ThemeProvider color={ CONTENT_COLOR }>\n\t\t\t\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t{ areas.content }\n\t\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t\t</ThemeProvider>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\n\t\t\t\t\t{ ! isMobileViewport && areas.edit && canvas !== 'edit' && (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName=\"edit-site-layout__area\"\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\tmaxWidth: widths?.edit,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ThemeProvider color={ CONTENT_COLOR }>\n\t\t\t\t\t\t\t\t<ErrorBoundary>{ areas.edit }</ErrorBoundary>\n\t\t\t\t\t\t\t</ThemeProvider>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ ! isMobileViewport && areas.preview && (\n\t\t\t\t\t\t<div className=\"edit-site-layout__canvas-container\">\n\t\t\t\t\t\t\t{ canvasResizer }\n\t\t\t\t\t\t\t{ !! canvasSize.width && (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t\t\t'edit-site-layout__canvas',\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t'is-right-aligned':\n\t\t\t\t\t\t\t\t\t\t\t\tisResizableFrameOversized,\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tref={ animationRef }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t<ResizableFrame\n\t\t\t\t\t\t\t\t\t\t\tisReady={ ! isEditorLoading }\n\t\t\t\t\t\t\t\t\t\t\tisFullWidth={ canvas === 'edit' }\n\t\t\t\t\t\t\t\t\t\t\tdefaultSize={ {\n\t\t\t\t\t\t\t\t\t\t\t\twidth:\n\t\t\t\t\t\t\t\t\t\t\t\t\tcanvasSize.width -\n\t\t\t\t\t\t\t\t\t\t\t\t\t24 /* $canvas-padding */,\n\t\t\t\t\t\t\t\t\t\t\t\theight: canvasSize.height,\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\tisOversized={\n\t\t\t\t\t\t\t\t\t\t\t\tisResizableFrameOversized\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tsetIsOversized={\n\t\t\t\t\t\t\t\t\t\t\t\tsetIsResizableFrameOversized\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tinnerContentStyle={ {\n\t\t\t\t\t\t\t\t\t\t\t\tbackground:\n\t\t\t\t\t\t\t\t\t\t\t\t\tgradientValue ??\n\t\t\t\t\t\t\t\t\t\t\t\t\tbackgroundColor,\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<ThemeProvider\n\t\t\t\t\t\t\t\t\t\t\t\tcolor={ CONTENT_COLOR }\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t{ areas.preview }\n\t\t\t\t\t\t\t\t\t\t\t</ThemeProvider>\n\t\t\t\t\t\t\t\t\t\t</ResizableFrame>\n\t\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default function LayoutWithGlobalStylesProvider( props ) {\n\tconst themeColors = useMemo( getAdminThemeColors, [] );\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tfunction onPluginAreaError( name ) {\n\t\tcreateErrorNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: plugin name */\n\t\t\t\t__(\n\t\t\t\t\t'The \"%s\" plugin has encountered an error and cannot be rendered.'\n\t\t\t\t),\n\t\t\t\tname\n\t\t\t)\n\t\t);\n\t}\n\n\treturn (\n\t\t<SlotFillProvider>\n\t\t\t<Tooltip.Provider>\n\t\t\t\t{ /** This needs to be within the SlotFillProvider */ }\n\t\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t\t\t<ThemeProvider color={ themeColors }>\n\t\t\t\t\t<Layout { ...props } />\n\t\t\t\t</ThemeProvider>\n\t\t\t</Tooltip.Provider>\n\t\t</SlotFillProvider>\n\t);\n}\n"],
|
|
5
|
-
"mappings": ";AAGA,OAAO,UAAU;AAKjB,SAAS,iBAAiB,2BAA2B;AACrD;AAAA,EACC,oBAAoB;AAAA,EACpB,6BAA6B;AAAA,EAC7B,gCAAgC;AAAA,EAChC;AAAA,OACM;AACP;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,IAAI,eAAe;AAC5B,SAAS,UAAU,QAAQ,WAAW,eAAe;AACrD;AAAA,EACC;AAAA,EACA;AAAA,EACA,eAAe;AAAA,OACT;AACP,SAAS,eAAe,yBAAyB;AACjD,SAAS,qBAAqB;AAC9B,SAAS,kBAAkB;AAC3B,SAAS,iBAAiB,SAAS,oBAAoB;AACvD,SAAS,aAAa,iBAAiB;AACvC,SAAS,SAAS,wBAAwB;AAC1C,SAAS,eAAe;AAKxB,SAAS,
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { NavigableRegion, getAdminThemeColors } from '@wordpress/admin-ui';\nimport {\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n\t__unstableUseNavigateRegions as useNavigateRegions,\n\tSlotFillProvider,\n} from '@wordpress/components';\nimport {\n\tuseReducedMotion,\n\tuseViewportMatch,\n\tuseResizeObserver,\n\tusePrevious,\n} from '@wordpress/compose';\nimport { focus } from '@wordpress/dom';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useState, useRef, useEffect, useMemo } from '@wordpress/element';\nimport {\n\tUnsavedChangesWarning,\n\tErrorBoundary,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { ThemeProvider } from '@wordpress/theme';\nimport { PluginArea } from '@wordpress/plugins';\nimport { SnackbarNotices, store as noticesStore } from '@wordpress/notices';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { Tooltip } from '@wordpress/ui';\n\n/**\n * Internal dependencies\n */\nimport { SiteHubMobile } from '../site-hub';\nimport ResizableFrame from '../resizable-frame';\nimport { unlock } from '../../lock-unlock';\nimport SaveKeyboardShortcut from '../save-keyboard-shortcut';\nimport { useIsSiteEditorLoading } from './hooks';\nimport useMovingAnimation from './animation';\nimport { SidebarContent, SidebarNavigationProvider } from '../sidebar';\nimport SaveHub from '../save-hub';\nimport SavePanel from '../save-panel';\n\nconst { useLocation } = unlock( routerPrivateApis );\nconst { useStyle, UploadProgressSnackbar } = unlock( editorPrivateApis );\n\nconst ANIMATION_DURATION = 0.3;\nconst CONTENT_COLOR = { background: '#ffffff' };\n\nfunction Layout() {\n\tconst { query, name: routeKey, areas, widths } = useLocation();\n\t// Force canvas to 'view' on notfound route to show the error message and allow navigation.\n\tconst canvas = routeKey === 'notfound' ? 'view' : query?.canvas ?? 'view';\n\tconst showMobileSiteHub = !! areas.mobileContent;\n\tconst hasMobileAreas =\n\t\tareas.mobileSidebar || areas.mobileContent || areas.preview;\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst mobileToggleRef = useRef();\n\tconst sidebarRegionRef = useRef();\n\tconst navigateRegionsProps = useNavigateRegions();\n\tconst disableMotion = useReducedMotion();\n\tconst [ canvasResizer, canvasSize ] = useResizeObserver();\n\tconst isEditorLoading = useIsSiteEditorLoading();\n\tconst [ isResizableFrameOversized, setIsResizableFrameOversized ] =\n\t\tuseState( false );\n\tconst animationRef = useMovingAnimation( {\n\t\ttriggerAnimationOnChange: routeKey + '-' + canvas,\n\t} );\n\n\tconst { showIconLabels } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tshowIconLabels: select( preferencesStore ).get(\n\t\t\t\t'core',\n\t\t\t\t'showIconLabels'\n\t\t\t),\n\t\t};\n\t} );\n\n\tconst backgroundColor = useStyle( 'color.background' );\n\tconst gradientValue = useStyle( 'color.gradient' );\n\tconst previousCanvaMode = usePrevious( canvas );\n\tuseEffect( () => {\n\t\tif ( previousCanvaMode === 'edit' ) {\n\t\t\tconst desktopToggle = sidebarRegionRef.current\n\t\t\t\t? // We're typically expecting the `<DashboardBackButton />` component as the first tabbable element.\n\t\t\t\t focus.tabbable.find( sidebarRegionRef.current )[ 0 ]\n\t\t\t\t: undefined;\n\t\t\t( desktopToggle ?? mobileToggleRef.current )?.focus();\n\t\t}\n\t\t// Should not depend on the previous canvas mode value but the next.\n\t}, [ canvas ] );\n\n\treturn (\n\t\t<>\n\t\t\t<UnsavedChangesWarning />\n\t\t\t{ canvas === 'view' && <SaveKeyboardShortcut /> }\n\t\t\t<div\n\t\t\t\t{ ...navigateRegionsProps }\n\t\t\t\tref={ navigateRegionsProps.ref }\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'edit-site-layout',\n\t\t\t\t\tnavigateRegionsProps.className,\n\t\t\t\t\t{\n\t\t\t\t\t\t'is-full-canvas': canvas === 'edit',\n\t\t\t\t\t\t'show-icon-labels': showIconLabels,\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<div className=\"edit-site-layout__content\">\n\t\t\t\t\t{ /*\n\t\t\t\t\t\tThe NavigableRegion must always be rendered and not use\n\t\t\t\t\t\t`inert` otherwise `useNavigateRegions` will fail.\n\t\t\t\t\t*/ }\n\t\t\t\t\t{ ( ! isMobileViewport || ! hasMobileAreas ) && (\n\t\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\t\tref={ sidebarRegionRef }\n\t\t\t\t\t\t\tariaLabel={ __( 'Navigation' ) }\n\t\t\t\t\t\t\tclassName=\"edit-site-layout__sidebar-region\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<AnimatePresence>\n\t\t\t\t\t\t\t\t{ canvas === 'view' && (\n\t\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\t\tinitial={ { opacity: 0 } }\n\t\t\t\t\t\t\t\t\t\tanimate={ { opacity: 1 } }\n\t\t\t\t\t\t\t\t\t\texit={ { opacity: 0 } }\n\t\t\t\t\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\t\t\t\tduration:\n\t\t\t\t\t\t\t\t\t\t\t\t// Disable transition in mobile to emulate a full page transition.\n\t\t\t\t\t\t\t\t\t\t\t\tdisableMotion ||\n\t\t\t\t\t\t\t\t\t\t\t\tisMobileViewport\n\t\t\t\t\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t\t\t\t\t: ANIMATION_DURATION,\n\t\t\t\t\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tclassName=\"edit-site-layout__sidebar\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<SidebarNavigationProvider>\n\t\t\t\t\t\t\t\t\t\t\t<SidebarContent\n\t\t\t\t\t\t\t\t\t\t\t\tshouldAnimate={\n\t\t\t\t\t\t\t\t\t\t\t\t\trouteKey !== 'styles' &&\n\t\t\t\t\t\t\t\t\t\t\t\t\trouteKey !== 'identity'\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\trouteKey={ routeKey }\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ areas.sidebar }\n\t\t\t\t\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t\t</SidebarContent>\n\t\t\t\t\t\t\t\t\t\t</SidebarNavigationProvider>\n\t\t\t\t\t\t\t\t\t\t<SaveHub />\n\t\t\t\t\t\t\t\t\t\t<SavePanel />\n\t\t\t\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</AnimatePresence>\n\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t) }\n\n\t\t\t\t\t<SnackbarNotices className=\"edit-site-layout__snackbar\" />\n\t\t\t\t\t<UploadProgressSnackbar />\n\n\t\t\t\t\t{ isMobileViewport && hasMobileAreas && (\n\t\t\t\t\t\t<div className=\"edit-site-layout__mobile\">\n\t\t\t\t\t\t\t<SidebarNavigationProvider>\n\t\t\t\t\t\t\t\t{ canvas !== 'edit' ? (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t{ showMobileSiteHub && (\n\t\t\t\t\t\t\t\t\t\t\t<SiteHubMobile\n\t\t\t\t\t\t\t\t\t\t\t\tref={ mobileToggleRef }\n\t\t\t\t\t\t\t\t\t\t\t\tisTransparent={\n\t\t\t\t\t\t\t\t\t\t\t\t\tisResizableFrameOversized\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t{ areas.mobileContent ? (\n\t\t\t\t\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t\t\t\t\t * ThemeProvider wraps SidebarContent (rather than\n\t\t\t\t\t\t\t\t\t\t\t * just the content) so the scroll wrapper it renders\n\t\t\t\t\t\t\t\t\t\t\t * inherits the content background tokens. See\n\t\t\t\t\t\t\t\t\t\t\t * `.edit-site-sidebar__screen-wrapper` in style.scss.\n\t\t\t\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\t\t\t\t<ThemeProvider\n\t\t\t\t\t\t\t\t\t\t\t\tcolor={ CONTENT_COLOR }\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<SidebarContent\n\t\t\t\t\t\t\t\t\t\t\t\t\trouteKey={ routeKey }\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div className=\"edit-site-layout__mobile-content\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tareas.mobileContent\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t</SidebarContent>\n\t\t\t\t\t\t\t\t\t\t\t</ThemeProvider>\n\t\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t\t<SidebarContent\n\t\t\t\t\t\t\t\t\t\t\t\trouteKey={ routeKey }\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ areas.mobileSidebar }\n\t\t\t\t\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t\t</SidebarContent>\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t<SaveHub />\n\t\t\t\t\t\t\t\t\t\t<SavePanel />\n\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<ThemeProvider color={ CONTENT_COLOR }>\n\t\t\t\t\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t\t{ areas.preview }\n\t\t\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t\t\t</ThemeProvider>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</SidebarNavigationProvider>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ ! isMobileViewport &&\n\t\t\t\t\t\tareas.content &&\n\t\t\t\t\t\tcanvas !== 'edit' && (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclassName=\"edit-site-layout__area\"\n\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\tmaxWidth: widths?.content,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<ThemeProvider color={ CONTENT_COLOR }>\n\t\t\t\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t{ areas.content }\n\t\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t\t</ThemeProvider>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\n\t\t\t\t\t{ ! isMobileViewport && areas.edit && canvas !== 'edit' && (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName=\"edit-site-layout__area\"\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\tmaxWidth: widths?.edit,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ThemeProvider color={ CONTENT_COLOR }>\n\t\t\t\t\t\t\t\t<ErrorBoundary>{ areas.edit }</ErrorBoundary>\n\t\t\t\t\t\t\t</ThemeProvider>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ ! isMobileViewport && areas.preview && (\n\t\t\t\t\t\t<div className=\"edit-site-layout__canvas-container\">\n\t\t\t\t\t\t\t{ canvasResizer }\n\t\t\t\t\t\t\t{ !! canvasSize.width && (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t\t\t'edit-site-layout__canvas',\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t'is-right-aligned':\n\t\t\t\t\t\t\t\t\t\t\t\tisResizableFrameOversized,\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tref={ animationRef }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t<ResizableFrame\n\t\t\t\t\t\t\t\t\t\t\tisReady={ ! isEditorLoading }\n\t\t\t\t\t\t\t\t\t\t\tisFullWidth={ canvas === 'edit' }\n\t\t\t\t\t\t\t\t\t\t\tdefaultSize={ {\n\t\t\t\t\t\t\t\t\t\t\t\twidth:\n\t\t\t\t\t\t\t\t\t\t\t\t\tcanvasSize.width -\n\t\t\t\t\t\t\t\t\t\t\t\t\t24 /* $canvas-padding */,\n\t\t\t\t\t\t\t\t\t\t\t\theight: canvasSize.height,\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\tisOversized={\n\t\t\t\t\t\t\t\t\t\t\t\tisResizableFrameOversized\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tsetIsOversized={\n\t\t\t\t\t\t\t\t\t\t\t\tsetIsResizableFrameOversized\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tinnerContentStyle={ {\n\t\t\t\t\t\t\t\t\t\t\t\tbackground:\n\t\t\t\t\t\t\t\t\t\t\t\t\tgradientValue ??\n\t\t\t\t\t\t\t\t\t\t\t\t\tbackgroundColor,\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<ThemeProvider\n\t\t\t\t\t\t\t\t\t\t\t\tcolor={ CONTENT_COLOR }\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t{ areas.preview }\n\t\t\t\t\t\t\t\t\t\t\t</ThemeProvider>\n\t\t\t\t\t\t\t\t\t\t</ResizableFrame>\n\t\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default function LayoutWithGlobalStylesProvider( props ) {\n\tconst themeColors = useMemo( getAdminThemeColors, [] );\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tfunction onPluginAreaError( name ) {\n\t\tcreateErrorNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: plugin name */\n\t\t\t\t__(\n\t\t\t\t\t'The \"%s\" plugin has encountered an error and cannot be rendered.'\n\t\t\t\t),\n\t\t\t\tname\n\t\t\t)\n\t\t);\n\t}\n\n\treturn (\n\t\t<SlotFillProvider>\n\t\t\t<Tooltip.Provider>\n\t\t\t\t{ /** This needs to be within the SlotFillProvider */ }\n\t\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t\t\t<ThemeProvider color={ themeColors }>\n\t\t\t\t\t<Layout { ...props } />\n\t\t\t\t</ThemeProvider>\n\t\t\t</Tooltip.Provider>\n\t\t</SlotFillProvider>\n\t);\n}\n"],
|
|
5
|
+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c,QAAS,qBAAqB,CAAC,CAAE;AACrD,QAAM,EAAE,kBAAkB,IAAI,YAAa,YAAa;AACxD,WAAS,kBAAmB,MAAO;AAClC;AAAA,MACC;AAAA;AAAA,QAEC;AAAA,UACC;AAAA,QACD;AAAA,QACA;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAEA,SACC,oBAAC,oBACA,+BAAC,QAAQ,UAAR,EAEA;AAAA,wBAAC,cAAW,SAAU,mBAAoB;AAAA,IAC1C,oBAAC,iBAAc,OAAQ,aACtB,8BAAC,UAAS,GAAG,OAAQ,GACtB;AAAA,KACD,GACD;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
// packages/edit-site/src/components/page-patterns/fields.js
|
|
2
|
-
import { __
|
|
2
|
+
import { __ } from "@wordpress/i18n";
|
|
3
3
|
import { useMemo, useId } from "@wordpress/element";
|
|
4
4
|
import { BlockPreview } from "@wordpress/block-editor";
|
|
5
5
|
import { parse } from "@wordpress/blocks";
|
|
6
6
|
import { privateApis as editorPrivateApis } from "@wordpress/editor";
|
|
7
|
-
import {
|
|
8
|
-
TEMPLATE_PART_POST_TYPE,
|
|
9
|
-
PATTERN_SYNC_TYPES,
|
|
10
|
-
OPERATOR_IS
|
|
11
|
-
} from "../../utils/constants.mjs";
|
|
7
|
+
import { TEMPLATE_PART_POST_TYPE } from "../../utils/constants.mjs";
|
|
12
8
|
import { unlock } from "../../lock-unlock.mjs";
|
|
13
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
10
|
var { useStyle } = unlock(editorPrivateApis);
|
|
@@ -50,42 +46,7 @@ var previewField = {
|
|
|
50
46
|
render: PreviewField,
|
|
51
47
|
enableSorting: false
|
|
52
48
|
};
|
|
53
|
-
var SYNC_FILTERS = [
|
|
54
|
-
{
|
|
55
|
-
value: PATTERN_SYNC_TYPES.full,
|
|
56
|
-
label: _x("Synced", "pattern (singular)"),
|
|
57
|
-
description: __("Patterns that are kept in sync across the site.")
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
value: PATTERN_SYNC_TYPES.unsynced,
|
|
61
|
-
label: _x("Not synced", "pattern (singular)"),
|
|
62
|
-
description: __(
|
|
63
|
-
"Patterns that can be changed freely without affecting the site."
|
|
64
|
-
)
|
|
65
|
-
}
|
|
66
|
-
];
|
|
67
|
-
var patternStatusField = {
|
|
68
|
-
label: __("Sync status"),
|
|
69
|
-
id: "sync-status",
|
|
70
|
-
render: ({ item }) => {
|
|
71
|
-
const syncStatus = "wp_pattern_sync_status" in item ? item.wp_pattern_sync_status || PATTERN_SYNC_TYPES.full : PATTERN_SYNC_TYPES.unsynced;
|
|
72
|
-
return /* @__PURE__ */ jsx(
|
|
73
|
-
"span",
|
|
74
|
-
{
|
|
75
|
-
className: `edit-site-patterns__field-sync-status-${syncStatus}`,
|
|
76
|
-
children: SYNC_FILTERS.find(({ value }) => value === syncStatus).label
|
|
77
|
-
}
|
|
78
|
-
);
|
|
79
|
-
},
|
|
80
|
-
elements: SYNC_FILTERS,
|
|
81
|
-
filterBy: {
|
|
82
|
-
operators: [OPERATOR_IS],
|
|
83
|
-
isPrimary: true
|
|
84
|
-
},
|
|
85
|
-
enableSorting: false
|
|
86
|
-
};
|
|
87
49
|
export {
|
|
88
|
-
patternStatusField,
|
|
89
50
|
previewField
|
|
90
51
|
};
|
|
91
52
|
//# sourceMappingURL=fields.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/page-patterns/fields.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __
|
|
5
|
-
"mappings": ";AAGA,SAAS,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useMemo, useId } from '@wordpress/element';\nimport { BlockPreview } from '@wordpress/block-editor';\nimport { parse } from '@wordpress/blocks';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { TEMPLATE_PART_POST_TYPE } from '../../utils/constants';\nimport { unlock } from '../../lock-unlock';\n\nconst { useStyle } = unlock( editorPrivateApis );\n\nfunction PreviewField( { item } ) {\n\tconst descriptionId = useId();\n\tconst description = item.description || item?.excerpt?.raw;\n\tconst isTemplatePart = item.type === TEMPLATE_PART_POST_TYPE;\n\tconst backgroundColor = useStyle( 'color.background' );\n\tconst blocks = useMemo( () => {\n\t\treturn (\n\t\t\titem.blocks ??\n\t\t\tparse( item.content.raw, {\n\t\t\t\t__unstableSkipMigrationLogs: true,\n\t\t\t} )\n\t\t);\n\t}, [ item?.content?.raw, item.blocks ] );\n\tconst isEmpty = ! blocks?.length;\n\n\treturn (\n\t\t<div\n\t\t\tclassName=\"page-patterns-preview-field\"\n\t\t\tstyle={ { backgroundColor } }\n\t\t\taria-describedby={ !! description ? descriptionId : undefined }\n\t\t>\n\t\t\t{ isEmpty && isTemplatePart && __( 'Empty template part' ) }\n\t\t\t{ isEmpty && ! isTemplatePart && __( 'Empty pattern' ) }\n\t\t\t{ ! isEmpty && (\n\t\t\t\t<BlockPreview.Async>\n\t\t\t\t\t<BlockPreview\n\t\t\t\t\t\tblocks={ blocks }\n\t\t\t\t\t\tviewportWidth={ item.viewportWidth }\n\t\t\t\t\t/>\n\t\t\t\t</BlockPreview.Async>\n\t\t\t) }\n\t\t\t{ !! description && (\n\t\t\t\t<div hidden id={ descriptionId }>\n\t\t\t\t\t{ description }\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nexport const previewField = {\n\tlabel: __( 'Preview' ),\n\tid: 'preview',\n\trender: PreviewField,\n\tenableSorting: false,\n};\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,UAAU;AACnB,SAAS,SAAS,aAAa;AAC/B,SAAS,oBAAoB;AAC7B,SAAS,aAAa;AACtB,SAAS,eAAe,yBAAyB;AAKjD,SAAS,+BAA+B;AACxC,SAAS,cAAc;AAoBrB,SASG,KATH;AAlBF,IAAM,EAAE,SAAS,IAAI,OAAQ,iBAAkB;AAE/C,SAAS,aAAc,EAAE,KAAK,GAAI;AACjC,QAAM,gBAAgB,MAAM;AAC5B,QAAM,cAAc,KAAK,eAAe,MAAM,SAAS;AACvD,QAAM,iBAAiB,KAAK,SAAS;AACrC,QAAM,kBAAkB,SAAU,kBAAmB;AACrD,QAAM,SAAS,QAAS,MAAM;AAC7B,WACC,KAAK,UACL,MAAO,KAAK,QAAQ,KAAK;AAAA,MACxB,6BAA6B;AAAA,IAC9B,CAAE;AAAA,EAEJ,GAAG,CAAE,MAAM,SAAS,KAAK,KAAK,MAAO,CAAE;AACvC,QAAM,UAAU,CAAE,QAAQ;AAE1B,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV,OAAQ,EAAE,gBAAgB;AAAA,MAC1B,oBAAmB,CAAC,CAAE,cAAc,gBAAgB;AAAA,MAElD;AAAA,mBAAW,kBAAkB,GAAI,qBAAsB;AAAA,QACvD,WAAW,CAAE,kBAAkB,GAAI,eAAgB;AAAA,QACnD,CAAE,WACH,oBAAC,aAAa,OAAb,EACA;AAAA,UAAC;AAAA;AAAA,YACA;AAAA,YACA,eAAgB,KAAK;AAAA;AAAA,QACtB,GACD;AAAA,QAEC,CAAC,CAAE,eACJ,oBAAC,SAAI,QAAM,MAAC,IAAK,eACd,uBACH;AAAA;AAAA;AAAA,EAEF;AAEF;AAEO,IAAM,eAAe;AAAA,EAC3B,OAAO,GAAI,SAAU;AAAA,EACrB,IAAI;AAAA,EACJ,QAAQ;AAAA,EACR,eAAe;AAChB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -20,11 +20,11 @@ import { unlock } from "../../lock-unlock.mjs";
|
|
|
20
20
|
import usePatterns, { useAugmentPatternsWithPermissions } from "./use-patterns.mjs";
|
|
21
21
|
import PatternsActions from "./actions.mjs";
|
|
22
22
|
import { useEditPostAction } from "../dataviews-actions/index.mjs";
|
|
23
|
-
import {
|
|
23
|
+
import { previewField } from "./fields.mjs";
|
|
24
24
|
import usePatternCategories from "../sidebar-navigation-screen-patterns/use-pattern-categories.mjs";
|
|
25
25
|
import { jsx } from "react/jsx-runtime";
|
|
26
26
|
var { ExperimentalBlockEditorProvider } = unlock(blockEditorPrivateApis);
|
|
27
|
-
var { usePostActions, usePostFields
|
|
27
|
+
var { usePostActions, usePostFields } = unlock(editorPrivateApis);
|
|
28
28
|
var { useLocation, useHistory } = unlock(routerPrivateApis);
|
|
29
29
|
var EMPTY_ARRAY = [];
|
|
30
30
|
var VIEW_CONFIG_FIELDS = ["default_view", "default_layouts"];
|
|
@@ -87,21 +87,10 @@ function DataviewsPatterns() {
|
|
|
87
87
|
search: view.search,
|
|
88
88
|
syncStatus: viewSyncStatus
|
|
89
89
|
});
|
|
90
|
-
const
|
|
91
|
-
postType: TEMPLATE_PART_POST_TYPE
|
|
92
|
-
});
|
|
93
|
-
const templatePartAuthorField = templatePartFields.find(
|
|
94
|
-
(field) => field.id === "author"
|
|
95
|
-
);
|
|
90
|
+
const postTypeFields = usePostFields({ postType });
|
|
96
91
|
const fields = useMemo(() => {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
_fields.push(patternStatusField);
|
|
100
|
-
} else if (postType === TEMPLATE_PART_POST_TYPE && templatePartAuthorField) {
|
|
101
|
-
_fields.push(templatePartAuthorField);
|
|
102
|
-
}
|
|
103
|
-
return _fields;
|
|
104
|
-
}, [postType, templatePartAuthorField]);
|
|
92
|
+
return [previewField, ...postTypeFields || []];
|
|
93
|
+
}, [postTypeFields]);
|
|
105
94
|
const { data, paginationInfo } = useMemo(() => {
|
|
106
95
|
const viewWithoutFilters = { ...view };
|
|
107
96
|
delete viewWithoutFilters.search;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/page-patterns/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { Page } from '@wordpress/admin-ui';\nimport { __ } from '@wordpress/i18n';\nimport { useMemo } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { DataViews, filterSortAndPaginate } from '@wordpress/dataviews';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useView, useViewConfig } from '@wordpress/views';\nimport { useSelect } from '@wordpress/data';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport {\n\tPATTERN_TYPES,\n\tTEMPLATE_PART_POST_TYPE,\n\tPATTERN_DEFAULT_CATEGORY,\n} from '../../utils/constants';\nimport usePatternSettings from './use-pattern-settings';\nimport { unlock } from '../../lock-unlock';\nimport usePatterns, { useAugmentPatternsWithPermissions } from './use-patterns';\nimport PatternsActions from './actions';\nimport { useEditPostAction } from '../dataviews-actions';\nimport {
|
|
5
|
-
"mappings": ";AAGA,SAAS,YAAY;AACrB,SAAS,UAAU;AACnB,SAAS,eAAe;AACxB,SAAS,eAAe,8BAA8B;AACtD,SAAS,WAAW,6BAA6B;AACjD,SAAS,SAAS,iBAAiB;AACnC,SAAS,eAAe,yBAAyB;AACjD,SAAS,eAAe,yBAAyB;AACjD,SAAS,SAAS,qBAAqB;AACvC,SAAS,iBAAiB;AAC1B,SAAS,oBAAoB;AAK7B;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,OAAO,wBAAwB;AAC/B,SAAS,cAAc;AACvB,OAAO,eAAe,yCAAyC;AAC/D,OAAO,qBAAqB;AAC5B,SAAS,yBAAyB;AAClC,SAAS,oBAAoB
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { Page } from '@wordpress/admin-ui';\nimport { __ } from '@wordpress/i18n';\nimport { useMemo } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { DataViews, filterSortAndPaginate } from '@wordpress/dataviews';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useView, useViewConfig } from '@wordpress/views';\nimport { useSelect } from '@wordpress/data';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport {\n\tPATTERN_TYPES,\n\tTEMPLATE_PART_POST_TYPE,\n\tPATTERN_DEFAULT_CATEGORY,\n} from '../../utils/constants';\nimport usePatternSettings from './use-pattern-settings';\nimport { unlock } from '../../lock-unlock';\nimport usePatterns, { useAugmentPatternsWithPermissions } from './use-patterns';\nimport PatternsActions from './actions';\nimport { useEditPostAction } from '../dataviews-actions';\nimport { previewField } from './fields';\nimport usePatternCategories from '../sidebar-navigation-screen-patterns/use-pattern-categories';\n\nconst { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );\nconst { usePostActions, usePostFields } = unlock( editorPrivateApis );\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\n\nconst EMPTY_ARRAY = [];\nconst VIEW_CONFIG_FIELDS = [ 'default_view', 'default_layouts' ];\n\nfunction usePagePatternsHeader( type, categoryId ) {\n\tconst { patternCategories } = usePatternCategories();\n\tconst templatePartAreas = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getCurrentTheme()\n\t\t\t\t?.default_template_part_areas || [],\n\t\t[]\n\t);\n\tlet title, description, patternCategory;\n\tif ( type === TEMPLATE_PART_POST_TYPE ) {\n\t\tconst templatePartArea = templatePartAreas.find(\n\t\t\t( area ) => area.area === categoryId\n\t\t);\n\t\ttitle = templatePartArea?.label || __( 'All Template Parts' );\n\t\tdescription =\n\t\t\ttemplatePartArea?.description ||\n\t\t\t__( 'Includes every template part defined for any area.' );\n\t} else if ( type === PATTERN_TYPES.user && !! categoryId ) {\n\t\tpatternCategory = patternCategories.find(\n\t\t\t( category ) => category.name === categoryId\n\t\t);\n\t\ttitle = patternCategory?.label;\n\t\tdescription = patternCategory?.description;\n\t}\n\n\treturn { title, description };\n}\n\nexport default function DataviewsPatterns() {\n\tconst { path, query } = useLocation();\n\tconst { postType = 'wp_block', categoryId: categoryIdFromURL } = query;\n\tconst history = useHistory();\n\tconst categoryId = categoryIdFromURL || PATTERN_DEFAULT_CATEGORY;\n\tconst { default_view: defaultView, default_layouts: defaultLayouts } =\n\t\tuseViewConfig( {\n\t\t\tkind: 'postType',\n\t\t\tname: postType,\n\t\t\tfields: VIEW_CONFIG_FIELDS,\n\t\t} );\n\tconst { view, updateView, isModified, resetToDefault } = useView( {\n\t\tkind: 'postType',\n\t\tname: postType,\n\t\tslug: 'default',\n\t\tdefaultView,\n\t\tdefaultLayouts,\n\t\tqueryParams: {\n\t\t\tpage: query.pageNumber,\n\t\t\tsearch: query.search,\n\t\t},\n\t\tonChangeQueryParams: ( params ) => {\n\t\t\thistory.navigate(\n\t\t\t\taddQueryArgs( path, {\n\t\t\t\t\t...query,\n\t\t\t\t\tpageNumber: params.page,\n\t\t\t\t\tsearch: params.search,\n\t\t\t\t} )\n\t\t\t);\n\t\t},\n\t} );\n\tconst viewSyncStatus = view.filters?.find(\n\t\t( { field } ) => field === 'sync-status'\n\t)?.value;\n\tconst { patterns, isResolving } = usePatterns( postType, categoryId, {\n\t\tsearch: view.search,\n\t\tsyncStatus: viewSyncStatus,\n\t} );\n\n\tconst postTypeFields = usePostFields( { postType } );\n\tconst fields = useMemo( () => {\n\t\treturn [ previewField, ...( postTypeFields || [] ) ];\n\t}, [ postTypeFields ] );\n\n\tconst { data, paginationInfo } = useMemo( () => {\n\t\t// Search is managed server-side as well as filters for patterns.\n\t\t// However, the author filter in template parts is done client-side.\n\t\tconst viewWithoutFilters = { ...view };\n\t\tdelete viewWithoutFilters.search;\n\t\tif ( postType !== TEMPLATE_PART_POST_TYPE ) {\n\t\t\tviewWithoutFilters.filters = [];\n\t\t}\n\t\treturn filterSortAndPaginate( patterns, viewWithoutFilters, fields );\n\t}, [ patterns, view, fields, postType ] );\n\n\tconst dataWithPermissions = useAugmentPatternsWithPermissions( data );\n\n\tconst templatePartActions = usePostActions( {\n\t\tpostType: TEMPLATE_PART_POST_TYPE,\n\t\tcontext: 'list',\n\t} );\n\tconst patternActions = usePostActions( {\n\t\tpostType: PATTERN_TYPES.user,\n\t\tcontext: 'list',\n\t} );\n\tconst editAction = useEditPostAction();\n\n\tconst actions = useMemo( () => {\n\t\tif ( postType === TEMPLATE_PART_POST_TYPE ) {\n\t\t\treturn [ editAction, ...templatePartActions ].filter( Boolean );\n\t\t}\n\t\treturn [ editAction, ...patternActions ].filter( Boolean );\n\t}, [ editAction, postType, templatePartActions, patternActions ] );\n\tconst settings = usePatternSettings();\n\tconst { title, description } = usePagePatternsHeader(\n\t\tpostType,\n\t\tcategoryId\n\t);\n\n\t// Wrap everything in a block editor provider.\n\t// This ensures 'styles' that are needed for the previews are synced\n\t// from the site editor store to the block editor store.\n\treturn (\n\t\t<ExperimentalBlockEditorProvider settings={ settings }>\n\t\t\t<Page\n\t\t\t\tclassName=\"edit-site-page-patterns-dataviews\"\n\t\t\t\ttitle={ title }\n\t\t\t\theadingLevel={ 2 }\n\t\t\t\tsubTitle={ description }\n\t\t\t\tactions={\n\t\t\t\t\t<PatternsActions\n\t\t\t\t\t\tcategoryId={ categoryId }\n\t\t\t\t\t\ttype={ postType }\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t<DataViews\n\t\t\t\t\tkey={ categoryId + postType }\n\t\t\t\t\tpaginationInfo={ paginationInfo }\n\t\t\t\t\tfields={ fields }\n\t\t\t\t\tactions={ actions }\n\t\t\t\t\tdata={ dataWithPermissions || EMPTY_ARRAY }\n\t\t\t\t\tgetItemId={ ( item ) => item.name ?? item.id }\n\t\t\t\t\tisLoading={ isResolving }\n\t\t\t\t\tisItemClickable={ ( item ) =>\n\t\t\t\t\t\titem.type !== PATTERN_TYPES.theme\n\t\t\t\t\t}\n\t\t\t\t\tonClickItem={ ( item ) => {\n\t\t\t\t\t\thistory.navigate(\n\t\t\t\t\t\t\t`/${ item.type }/${\n\t\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t\tPATTERN_TYPES.user,\n\t\t\t\t\t\t\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\t\t\t\t\t\t].includes( item.type )\n\t\t\t\t\t\t\t\t\t? item.id\n\t\t\t\t\t\t\t\t\t: item.name\n\t\t\t\t\t\t\t}?canvas=edit`\n\t\t\t\t\t\t);\n\t\t\t\t\t} }\n\t\t\t\t\tview={ view }\n\t\t\t\t\tonChangeView={ updateView }\n\t\t\t\t\tdefaultLayouts={ defaultLayouts }\n\t\t\t\t\tonReset={ isModified ? resetToDefault : false }\n\t\t\t\t/>\n\t\t\t</Page>\n\t\t</ExperimentalBlockEditorProvider>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,YAAY;AACrB,SAAS,UAAU;AACnB,SAAS,eAAe;AACxB,SAAS,eAAe,8BAA8B;AACtD,SAAS,WAAW,6BAA6B;AACjD,SAAS,SAAS,iBAAiB;AACnC,SAAS,eAAe,yBAAyB;AACjD,SAAS,eAAe,yBAAyB;AACjD,SAAS,SAAS,qBAAqB;AACvC,SAAS,iBAAiB;AAC1B,SAAS,oBAAoB;AAK7B;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,OAAO,wBAAwB;AAC/B,SAAS,cAAc;AACvB,OAAO,eAAe,yCAAyC;AAC/D,OAAO,qBAAqB;AAC5B,SAAS,yBAAyB;AAClC,SAAS,oBAAoB;AAC7B,OAAO,0BAA0B;AA+H5B;AA7HL,IAAM,EAAE,gCAAgC,IAAI,OAAQ,sBAAuB;AAC3E,IAAM,EAAE,gBAAgB,cAAc,IAAI,OAAQ,iBAAkB;AACpE,IAAM,EAAE,aAAa,WAAW,IAAI,OAAQ,iBAAkB;AAE9D,IAAM,cAAc,CAAC;AACrB,IAAM,qBA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AAW,mBAAmB;AACpC,QAAM,EAAE,OAAO,YAAY,IAAI;AAAA,IAC9B;AAAA,IACA;AAAA,EACD;AAKA,SACC,oBAAC,mCAAgC,UAChC;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV;AAAA,MACA,cAAe;AAAA,MACf,UAAW;AAAA,MACX,SACC;AAAA,QAAC;AAAA;AAAA,UACA;AAAA,UACA,MAAO;AAAA;AAAA,MACR;AAAA,MAGD;AAAA,QAAC;AAAA;AAAA,UAEA;AAAA,UACA;AAAA,UACA;AAAA,UACA,MAAO,uBAAuB;AAAA,UAC9B,WAAY,CAAE,SAAU,KAAK,QAAQ,KAAK;AAAA,UAC1C,WAAY;AAAA,UACZ,iBAAkB,CAAE,SACnB,KAAK,SAAS,cAAc;AAAA,UAE7B,aAAc,CAAE,SAAU;AACzB,oBAAQ;AAAA,cACP,IAAK,KAAK,IAAK,IACd;AAAA,gBACC,cAAc;AAAA,gBACd;AAAA,cACD,EAAE,SAAU,KAAK,IAAK,IACnB,KAAK,KACL,KAAK,IACT;AAAA,YACD;AAAA,UACD;AAAA,UACA;AAAA,UACA,cAAe;AAAA,UACf;AAAA,UACA,SAAU,aAAa,iBAAiB;AAAA;AAAA,QAzBlC,aAAa;AAAA,MA0BpB;AAAA;AAAA,EACD,GACD;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -48,9 +48,8 @@ var EntitiesSavedStatesForPreview = ({
|
|
|
48
48
|
previewingTheme?.name?.rendered ?? "..."
|
|
49
49
|
) });
|
|
50
50
|
const activateTheme = useActivateTheme();
|
|
51
|
-
const onSave = async (
|
|
51
|
+
const onSave = async () => {
|
|
52
52
|
await activateTheme();
|
|
53
|
-
return values;
|
|
54
53
|
};
|
|
55
54
|
return /* @__PURE__ */ jsx(
|
|
56
55
|
EntitiesSavedStatesExtensible,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/save-panel/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { NavigableRegion } from '@wordpress/admin-ui';\nimport { Button, Modal } from '@wordpress/components';\nimport {\n\tEntitiesSavedStates,\n\tuseEntitiesSavedStatesIsDirty,\n\tprivateApis,\n} from '@wordpress/editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { useActivateTheme } from '../../utils/use-activate-theme';\nimport { useActualCurrentTheme } from '../../utils/use-actual-current-theme';\nimport { isPreviewingTheme } from '../../utils/is-previewing-theme';\n\nconst { EntitiesSavedStatesExtensible } = unlock( privateApis );\nconst { useLocation } = unlock( routerPrivateApis );\n\nconst EntitiesSavedStatesForPreview = ( {\n\tonClose,\n\trenderDialog,\n\tvariant,\n} ) => {\n\tconst isDirtyProps = useEntitiesSavedStatesIsDirty();\n\tlet activateSaveLabel, successNoticeContent;\n\tif ( isDirtyProps.isDirty ) {\n\t\tactivateSaveLabel = __( 'Activate & Save' );\n\t\tsuccessNoticeContent = __( 'Theme activated and site updated.' );\n\t} else {\n\t\tactivateSaveLabel = __( 'Activate' );\n\t\tsuccessNoticeContent = __( 'Theme activated.' );\n\t}\n\n\tconst currentTheme = useActualCurrentTheme();\n\n\tconst previewingTheme = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme(),\n\t\t[]\n\t);\n\n\tconst additionalPrompt = (\n\t\t<p>\n\t\t\t{ sprintf(\n\t\t\t\t/* translators: 1: The name of active theme, 2: The name of theme to be activated. */\n\t\t\t\t__(\n\t\t\t\t\t'Saving your changes will change your active theme from %1$s to %2$s.'\n\t\t\t\t),\n\t\t\t\tcurrentTheme?.name?.rendered ?? '...',\n\t\t\t\tpreviewingTheme?.name?.rendered ?? '...'\n\t\t\t) }\n\t\t</p>\n\t);\n\n\tconst activateTheme = useActivateTheme();\n\tconst onSave = async (
|
|
5
|
-
"mappings": ";AAGA,OAAO,UAAU;AAKjB,SAAS,uBAAuB;AAChC,SAAS,QAAQ,aAAa;AAC9B;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,aAAa,iBAAiB;AACvC,SAAS,IAAI,eAAe;AAC5B,SAAS,SAAS,iBAAiB;AACnC,SAAS,eAAe,yBAAyB;AACjD,SAAS,iBAAiB;AAK1B,SAAS,SAAS,qBAAqB;AACvC,SAAS,cAAc;AACvB,SAAS,wBAAwB;AACjC,SAAS,6BAA6B;AACtC,SAAS,yBAAyB;AA4BhC,
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { NavigableRegion } from '@wordpress/admin-ui';\nimport { Button, Modal } from '@wordpress/components';\nimport {\n\tEntitiesSavedStates,\n\tuseEntitiesSavedStatesIsDirty,\n\tprivateApis,\n} from '@wordpress/editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { useActivateTheme } from '../../utils/use-activate-theme';\nimport { useActualCurrentTheme } from '../../utils/use-actual-current-theme';\nimport { isPreviewingTheme } from '../../utils/is-previewing-theme';\n\nconst { EntitiesSavedStatesExtensible } = unlock( privateApis );\nconst { useLocation } = unlock( routerPrivateApis );\n\nconst EntitiesSavedStatesForPreview = ( {\n\tonClose,\n\trenderDialog,\n\tvariant,\n} ) => {\n\tconst isDirtyProps = useEntitiesSavedStatesIsDirty();\n\tlet activateSaveLabel, successNoticeContent;\n\tif ( isDirtyProps.isDirty ) {\n\t\tactivateSaveLabel = __( 'Activate & Save' );\n\t\tsuccessNoticeContent = __( 'Theme activated and site updated.' );\n\t} else {\n\t\tactivateSaveLabel = __( 'Activate' );\n\t\tsuccessNoticeContent = __( 'Theme activated.' );\n\t}\n\n\tconst currentTheme = useActualCurrentTheme();\n\n\tconst previewingTheme = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme(),\n\t\t[]\n\t);\n\n\tconst additionalPrompt = (\n\t\t<p>\n\t\t\t{ sprintf(\n\t\t\t\t/* translators: 1: The name of active theme, 2: The name of theme to be activated. */\n\t\t\t\t__(\n\t\t\t\t\t'Saving your changes will change your active theme from %1$s to %2$s.'\n\t\t\t\t),\n\t\t\t\tcurrentTheme?.name?.rendered ?? '...',\n\t\t\t\tpreviewingTheme?.name?.rendered ?? '...'\n\t\t\t) }\n\t\t</p>\n\t);\n\n\tconst activateTheme = useActivateTheme();\n\tconst onSave = async () => {\n\t\tawait activateTheme();\n\t};\n\n\treturn (\n\t\t<EntitiesSavedStatesExtensible\n\t\t\t{ ...{\n\t\t\t\t...isDirtyProps,\n\t\t\t\tadditionalPrompt,\n\t\t\t\tclose: onClose,\n\t\t\t\tonSave,\n\t\t\t\tsaveEnabled: true,\n\t\t\t\tsaveLabel: activateSaveLabel,\n\t\t\t\trenderDialog,\n\t\t\t\tvariant,\n\t\t\t\tsuccessNoticeContent,\n\t\t\t} }\n\t\t/>\n\t);\n};\n\nconst _EntitiesSavedStates = ( { onClose, renderDialog, variant } ) => {\n\tif ( isPreviewingTheme() ) {\n\t\treturn (\n\t\t\t<EntitiesSavedStatesForPreview\n\t\t\t\tonClose={ onClose }\n\t\t\t\trenderDialog={ renderDialog }\n\t\t\t\tvariant={ variant }\n\t\t\t/>\n\t\t);\n\t}\n\treturn (\n\t\t<EntitiesSavedStates\n\t\t\tclose={ onClose }\n\t\t\trenderDialog={ renderDialog }\n\t\t\tvariant={ variant }\n\t\t/>\n\t);\n};\n\nexport default function SavePanel() {\n\tconst { query } = useLocation();\n\tconst { canvas = 'view' } = query;\n\tconst { isSaveViewOpen, isDirty, isSaving } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\tisSavingEntityRecord,\n\t\t\tisResolving,\n\t\t} = select( coreStore );\n\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\tconst isActivatingTheme = isResolving( 'activateTheme' );\n\t\tconst { isSaveViewOpened } = unlock( select( editSiteStore ) );\n\n\t\t// The currently selected entity to display.\n\t\t// Typically template or template part in the site editor.\n\t\treturn {\n\t\t\tisSaveViewOpen: isSaveViewOpened(),\n\t\t\tisDirty: dirtyEntityRecords.length > 0,\n\t\t\tisSaving:\n\t\t\t\tdirtyEntityRecords.some( ( record ) =>\n\t\t\t\t\tisSavingEntityRecord( record.kind, record.name, record.key )\n\t\t\t\t) || isActivatingTheme,\n\t\t};\n\t}, [] );\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\tconst onClose = () => setIsSaveViewOpened( false );\n\tuseEffect( () => {\n\t\tsetIsSaveViewOpened( false );\n\t}, [ canvas, setIsSaveViewOpened ] );\n\n\tif ( canvas === 'view' ) {\n\t\treturn isSaveViewOpen ? (\n\t\t\t<Modal\n\t\t\t\tclassName=\"edit-site-save-panel__modal\"\n\t\t\t\tonRequestClose={ onClose }\n\t\t\t\ttitle={ __( 'Review changes' ) }\n\t\t\t\tsize=\"small\"\n\t\t\t>\n\t\t\t\t<_EntitiesSavedStates onClose={ onClose } variant=\"inline\" />\n\t\t\t</Modal>\n\t\t) : null;\n\t}\n\tconst activateSaveEnabled = isPreviewingTheme() || isDirty;\n\tconst disabled = isSaving || ! activateSaveEnabled;\n\treturn (\n\t\t<NavigableRegion\n\t\t\tclassName={ clsx( 'edit-site-layout__actions', {\n\t\t\t\t'is-entity-save-view-open': isSaveViewOpen,\n\t\t\t} ) }\n\t\t\tariaLabel={ __( 'Save panel' ) }\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName={ clsx( 'edit-site-editor__toggle-save-panel', {\n\t\t\t\t\t'screen-reader-text': isSaveViewOpen,\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t<Button\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tclassName=\"edit-site-editor__toggle-save-panel-button\"\n\t\t\t\t\tonClick={ () => setIsSaveViewOpened( true ) }\n\t\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Open save panel' ) }\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t\t{ isSaveViewOpen && (\n\t\t\t\t<_EntitiesSavedStates onClose={ onClose } renderDialog />\n\t\t\t) }\n\t\t</NavigableRegion>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";AAGA,OAAO,UAAU;AAKjB,SAAS,uBAAuB;AAChC,SAAS,QAAQ,aAAa;AAC9B;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,aAAa,iBAAiB;AACvC,SAAS,IAAI,eAAe;AAC5B,SAAS,SAAS,iBAAiB;AACnC,SAAS,eAAe,yBAAyB;AACjD,SAAS,iBAAiB;AAK1B,SAAS,SAAS,qBAAqB;AACvC,SAAS,cAAc;AACvB,SAAS,wBAAwB;AACjC,SAAS,6BAA6B;AACtC,SAAS,yBAAyB;AA4BhC,cAkGA,YAlGA;AA1BF,IAAM,EAAE,8BAA8B,IAAI,OAAQ,WAAY;AAC9D,IAAM,EAAE,YAAY,IAAI,OAAQ,iBAAkB;AAElD,IAAM,gCAAgC,CAAE;AAAA,EACvC;AAAA,EACA;AAAA,EACA;AACD,MAAO;AACN,QAAM,eAAe,8BAA8B;AACnD,MAAI,mBAAmB;AACvB,MAAK,aAAa,SAAU;AAC3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