@wordpress/edit-site 5.3.1 → 5.3.2
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.js +1 -15
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/block-preview-panel.js +10 -12
- package/build/components/global-styles/block-preview-panel.js.map +1 -1
- package/build/components/global-styles/context-menu.js +9 -2
- package/build/components/global-styles/context-menu.js.map +1 -1
- package/build/components/global-styles/screen-border.js +0 -6
- package/build/components/global-styles/screen-border.js.map +1 -1
- package/build/components/global-styles/screen-effects.js +53 -0
- package/build/components/global-styles/screen-effects.js.map +1 -0
- package/build/components/global-styles/shadow-panel.js +1 -1
- package/build/components/global-styles/shadow-panel.js.map +1 -1
- package/build/components/global-styles/ui.js +7 -0
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/layout/index.js +3 -1
- package/build/components/layout/index.js.map +1 -1
- package/build/components/save-panel/index.js +77 -0
- package/build/components/save-panel/index.js.map +1 -0
- package/build/components/sidebar/index.js +25 -2
- package/build/components/sidebar/index.js.map +1 -1
- package/build-module/components/editor/index.js +3 -17
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/block-preview-panel.js +10 -11
- package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
- package/build-module/components/global-styles/context-menu.js +9 -3
- package/build-module/components/global-styles/context-menu.js.map +1 -1
- package/build-module/components/global-styles/screen-border.js +0 -5
- package/build-module/components/global-styles/screen-border.js.map +1 -1
- package/build-module/components/global-styles/screen-effects.js +35 -0
- package/build-module/components/global-styles/screen-effects.js.map +1 -0
- package/build-module/components/global-styles/shadow-panel.js +1 -1
- package/build-module/components/global-styles/shadow-panel.js.map +1 -1
- package/build-module/components/global-styles/ui.js +6 -0
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/layout/index.js +2 -1
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/save-panel/index.js +63 -0
- package/build-module/components/save-panel/index.js.map +1 -0
- package/build-module/components/sidebar/index.js +22 -2
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-style/style-rtl.css +83 -26
- package/build-style/style.css +83 -26
- package/package.json +8 -8
- package/src/components/editor/index.js +3 -43
- package/src/components/editor/style.scss +2 -2
- package/src/components/global-styles/block-preview-panel.js +8 -12
- package/src/components/global-styles/context-menu.js +14 -2
- package/src/components/global-styles/screen-border.js +0 -5
- package/src/components/global-styles/screen-effects.js +28 -0
- package/src/components/global-styles/shadow-panel.js +1 -1
- package/src/components/global-styles/style.scss +0 -4
- package/src/components/global-styles/ui.js +5 -0
- package/src/components/layout/index.js +3 -0
- package/src/components/layout/style.scss +25 -3
- package/src/components/save-panel/index.js +65 -0
- package/src/components/save-panel/style.scss +5 -0
- package/src/components/sidebar/index.js +26 -6
- package/src/components/sidebar/style.scss +15 -0
- package/src/components/site-hub/style.scss +1 -0
- package/src/style.scss +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/layout/index.js"],"names":["ANIMATION_DURATION","emptyResizeHandleStyles","position","undefined","userSelect","cursor","width","height","top","right","bottom","left","Layout","hubRef","params","isListPage","isEditorPage","canvasMode","previousShortcut","nextShortcut","select","getAllShortcutKeyCombinations","keyboardShortcutsStore","getCanvasMode","editSiteStore","navigateRegionsProps","previous","next","disableMotion","isMobileViewport","isMobileCanvasVisible","setIsMobileCanvasVisible","canvasPadding","showSidebar","showCanvas","showFrame","isFullCanvas","canvasResizer","canvasSize","fullResizer","fullSize","forcedWidth","setForcedWidth","isResizing","setIsResizing","isResizingEnabled","defaultSidebarWidth","canvasWidth","ref","className","motion","div","y","type","duration","ease","opacity","event","direction","elt","clientWidth","current","style","delta","paddingTop","paddingBottom"],"mappings":";;;;;;;;;AAqBA;;;;AAlBA;;AAKA;;AACA;;AAMA;;AAKA;;AAEA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;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AAQ,GAAR;AACC,IAAA,OAAO,EAAG,KADX;AAEC,IAAA,MAAM,EAAC,UAFR;AAGC,IAAA,SAAS,EAAC,0BAHX;AAIC,IAAA,UAAU,EAAG;AACZ+C,MAAAA,IAAI,EAAE,OADM;AAEZC,MAAAA,QAAQ,EACP1B,aAAa,IAAIe,UAAjB,GACG,CADH,GAEG3C,kBALQ;AAMZuD,MAAAA,IAAI,EAAE;AANM;AAJd,KAaC,4BAAC,4BAAD,CAAQ,GAAR;AACC,IAAA,KAAK,EAAG;AACPrD,MAAAA,QAAQ,EAAE,UADH;AAEPM,MAAAA,GAAG,EAAE,CAFE;AAGPG,MAAAA,IAAI,EAAE,CAHC;AAIPD,MAAAA,MAAM,EAAE;AAJD,KADT;AAOC,IAAA,OAAO,EAAG,KAPX;AAQC,IAAA,OAAO,EAAG;AACTJ,MAAAA,KAAK,EAAEyC;AADE,KARX;AAWC,IAAA,UAAU,EAAG;AACZM,MAAAA,IAAI,EAAE,OADM;AAEZC,MAAAA,QAAQ,EACP1B,aAAa,IAAIe,UAAjB,GACG,CADH,GAEG3C,kBALQ;AAMZuD,MAAAA,IAAI,EAAE;AANM;AAXd,KAoBC,4BAAC,sBAAD,QACGvC,YAAY,IAAI,4BAAC,eAAD,OADnB,EAEGD,UAAU,IAAI,4BAAC,aAAD,OAFjB,CApBD,CAbD,CAdF,CAnFF,CAtDD,CAFD,CADD;AAwMA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n\t__unstableUseNavigateRegions as useNavigateRegions,\n\tResizableBox,\n} from '@wordpress/components';\nimport {\n\tuseReducedMotion,\n\tuseViewportMatch,\n\tuseResizeObserver,\n} from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { useState, useEffect, useRef } from '@wordpress/element';\nimport { NavigableRegion } from '@wordpress/interface';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\n\n/**\n * Internal dependencies\n */\nimport Sidebar from '../sidebar';\nimport Editor from '../editor';\nimport ListPage from '../list';\nimport ErrorBoundary from '../error-boundary';\nimport { store as editSiteStore } from '../../store';\nimport { useLocation } from '../routes';\nimport getIsListPage from '../../utils/get-is-list-page';\nimport Header from '../header-edit-mode';\nimport useInitEditedEntityFromURL from '../sync-state-with-url/use-init-edited-entity-from-url';\nimport SiteHub from '../site-hub';\nimport ResizeHandle from '../block-editor/resize-handle';\nimport useSyncCanvasModeWithURL from '../sync-state-with-url/use-sync-canvas-mode-with-url';\nimport { unlock } from '../../experiments';\n\nconst ANIMATION_DURATION = 0.5;\nconst emptyResizeHandleStyles = {\n\tposition: undefined,\n\tuserSelect: undefined,\n\tcursor: undefined,\n\twidth: undefined,\n\theight: undefined,\n\ttop: undefined,\n\tright: undefined,\n\tbottom: undefined,\n\tleft: undefined,\n};\n\nexport default function Layout() {\n\t// This ensures the edited entity id and type are initialized properly.\n\tuseInitEditedEntityFromURL();\n\tuseSyncCanvasModeWithURL();\n\n\tconst hubRef = useRef();\n\tconst { params } = useLocation();\n\tconst isListPage = getIsListPage( params );\n\tconst isEditorPage = ! isListPage;\n\tconst { canvasMode, previousShortcut, nextShortcut } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getAllShortcutKeyCombinations } = select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t);\n\t\t\tconst { getCanvasMode } = unlock( select( editSiteStore ) );\n\t\t\treturn {\n\t\t\t\tcanvasMode: getCanvasMode(),\n\t\t\t\tpreviousShortcut: getAllShortcutKeyCombinations(\n\t\t\t\t\t'core/edit-site/previous-region'\n\t\t\t\t),\n\t\t\t\tnextShortcut: getAllShortcutKeyCombinations(\n\t\t\t\t\t'core/edit-site/next-region'\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst navigateRegionsProps = useNavigateRegions( {\n\t\tprevious: previousShortcut,\n\t\tnext: nextShortcut,\n\t} );\n\tconst disableMotion = useReducedMotion();\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst [ isMobileCanvasVisible, setIsMobileCanvasVisible ] =\n\t\tuseState( false );\n\tconst canvasPadding = isMobileViewport ? 0 : 24;\n\tconst showSidebar =\n\t\t( isMobileViewport && ! isMobileCanvasVisible ) ||\n\t\t( ! isMobileViewport && ( canvasMode === 'view' || ! isEditorPage ) );\n\tconst showCanvas =\n\t\t( isMobileViewport && isMobileCanvasVisible ) || ! isMobileViewport;\n\tconst showFrame =\n\t\t! isEditorPage || ( canvasMode === 'view' && ! isMobileViewport );\n\n\tconst isFullCanvas =\n\t\t( isEditorPage && canvasMode === 'edit' && ! isMobileViewport ) ||\n\t\tisMobileCanvasVisible;\n\t// Ideally this effect could be removed if we move the \"isMobileCanvasVisible\" into the store.\n\tconst [ canvasResizer, canvasSize ] = useResizeObserver();\n\tconst [ fullResizer, fullSize ] = useResizeObserver();\n\tconst [ forcedWidth, setForcedWidth ] = useState( null );\n\tconst [ isResizing, setIsResizing ] = useState( false );\n\tconst isResizingEnabled = ! isMobileViewport && canvasMode === 'view';\n\tconst defaultSidebarWidth = isMobileViewport ? '100vw' : 360;\n\tlet canvasWidth = isResizing ? '100%' : fullSize.width;\n\tif ( showFrame && ! isResizing ) {\n\t\tcanvasWidth = canvasSize.width - canvasPadding;\n\t}\n\tuseEffect( () => {\n\t\tif ( canvasMode === 'view' && isMobileViewport ) {\n\t\t\tsetIsMobileCanvasVisible( false );\n\t\t}\n\n\t\tif ( canvasMode === 'edit' && isMobileViewport ) {\n\t\t\tsetIsMobileCanvasVisible( true );\n\t\t}\n\t}, [ canvasMode, isMobileViewport ] );\n\n\t// Synchronizing the URL with the store value of canvasMode happens in an effect\n\t// This condition ensures the component is only rendered after the synchronization happens\n\t// which prevents any animations due to potential canvasMode value change.\n\tif ( canvasMode === 'init' ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ fullResizer }\n\t\t\t<div\n\t\t\t\t{ ...navigateRegionsProps }\n\t\t\t\tref={ navigateRegionsProps.ref }\n\t\t\t\tclassName={ classnames(\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': isFullCanvas,\n\t\t\t\t\t\t'is-edit-mode': canvasMode === 'edit',\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<SiteHub\n\t\t\t\t\tref={ hubRef }\n\t\t\t\t\tclassName=\"edit-site-layout__hub\"\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\twidth:\n\t\t\t\t\t\t\tisResizingEnabled && forcedWidth\n\t\t\t\t\t\t\t\t? forcedWidth - 48\n\t\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t} }\n\t\t\t\t\tisMobileCanvasVisible={ isMobileCanvasVisible }\n\t\t\t\t\tsetIsMobileCanvasVisible={ setIsMobileCanvasVisible }\n\t\t\t\t/>\n\n\t\t\t\t<AnimatePresence initial={ false }>\n\t\t\t\t\t{ isEditorPage &&\n\t\t\t\t\t\t( canvasMode === 'edit' || isMobileCanvasVisible ) && (\n\t\t\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\t\t\tclassName=\"edit-site-layout__header\"\n\t\t\t\t\t\t\t\tariaLabel={ __( 'Editor top bar' ) }\n\t\t\t\t\t\t\t\tas={ motion.div }\n\t\t\t\t\t\t\t\tanimate={ {\n\t\t\t\t\t\t\t\t\ty: 0,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tinitial={ {\n\t\t\t\t\t\t\t\t\ty: '-100%',\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\texit={ {\n\t\t\t\t\t\t\t\t\ty: '-100%',\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\t\tduration: disableMotion\n\t\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t\t: ANIMATION_DURATION,\n\t\t\t\t\t\t\t\t\tease: 'easeOut',\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{ canvasMode === 'edit' && <Header /> }\n\t\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t\t) }\n\t\t\t\t</AnimatePresence>\n\n\t\t\t\t<div className=\"edit-site-layout__content\">\n\t\t\t\t\t<AnimatePresence initial={ false }>\n\t\t\t\t\t\t{ showSidebar && (\n\t\t\t\t\t\t\t<ResizableBox\n\t\t\t\t\t\t\t\tas={ motion.div }\n\t\t\t\t\t\t\t\tinitial={ {\n\t\t\t\t\t\t\t\t\topacity: 0,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tanimate={ {\n\t\t\t\t\t\t\t\t\topacity: 1,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\texit={ {\n\t\t\t\t\t\t\t\t\topacity: 0,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\t\tduration:\n\t\t\t\t\t\t\t\t\t\tdisableMotion || isResizing\n\t\t\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t\t\t: ANIMATION_DURATION,\n\t\t\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tsize={ {\n\t\t\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\t\t\twidth:\n\t\t\t\t\t\t\t\t\t\tisResizingEnabled && forcedWidth\n\t\t\t\t\t\t\t\t\t\t\t? forcedWidth\n\t\t\t\t\t\t\t\t\t\t\t: defaultSidebarWidth,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tclassName=\"edit-site-layout__sidebar\"\n\t\t\t\t\t\t\t\tenable={ {\n\t\t\t\t\t\t\t\t\tright: isResizingEnabled,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tonResizeStop={ ( event, direction, elt ) => {\n\t\t\t\t\t\t\t\t\tsetForcedWidth( elt.clientWidth );\n\t\t\t\t\t\t\t\t\tsetIsResizing( false );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tonResizeStart={ () => {\n\t\t\t\t\t\t\t\t\tsetIsResizing( true );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tonResize={ ( event, direction, elt ) => {\n\t\t\t\t\t\t\t\t\t// This is a performance optimization\n\t\t\t\t\t\t\t\t\t// We set the width imperatively to avoid re-rendering\n\t\t\t\t\t\t\t\t\t// the whole component while resizing.\n\t\t\t\t\t\t\t\t\thubRef.current.style.width =\n\t\t\t\t\t\t\t\t\t\telt.clientWidth - 48 + 'px';\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\thandleComponent={ {\n\t\t\t\t\t\t\t\t\tright: (\n\t\t\t\t\t\t\t\t\t\t<ResizeHandle\n\t\t\t\t\t\t\t\t\t\t\tdirection=\"right\"\n\t\t\t\t\t\t\t\t\t\t\tvariation=\"separator\"\n\t\t\t\t\t\t\t\t\t\t\tresizeWidthBy={ ( delta ) => {\n\t\t\t\t\t\t\t\t\t\t\t\tsetForcedWidth(\n\t\t\t\t\t\t\t\t\t\t\t\t\t( forcedWidth ??\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdefaultSidebarWidth ) +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelta\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),\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\thandleClasses={ undefined }\n\t\t\t\t\t\t\t\thandleStyles={ {\n\t\t\t\t\t\t\t\t\tright: emptyResizeHandleStyles,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tminWidth={ isResizingEnabled ? 320 : undefined }\n\t\t\t\t\t\t\t\tmaxWidth={\n\t\t\t\t\t\t\t\t\tisResizingEnabled && fullSize\n\t\t\t\t\t\t\t\t\t\t? fullSize.width - 360\n\t\t\t\t\t\t\t\t\t\t: undefined\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<NavigableRegion\n\t\t\t\t\t\t\t\t\tariaLabel={ __( 'Navigation sidebar' ) }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Sidebar />\n\t\t\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t\t\t</ResizableBox>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</AnimatePresence>\n\n\t\t\t\t\t{ showCanvas && (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t'edit-site-layout__canvas-container',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'is-resizing': isResizing,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\tpaddingTop: showFrame ? canvasPadding : 0,\n\t\t\t\t\t\t\t\tpaddingBottom: showFrame ? canvasPadding : 0,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\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<motion.div\n\t\t\t\t\t\t\t\t\tinitial={ false }\n\t\t\t\t\t\t\t\t\tlayout=\"position\"\n\t\t\t\t\t\t\t\t\tclassName=\"edit-site-layout__canvas\"\n\t\t\t\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\t\t\tduration:\n\t\t\t\t\t\t\t\t\t\t\tdisableMotion || isResizing\n\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: ANIMATION_DURATION,\n\t\t\t\t\t\t\t\t\t\tease: 'easeOut',\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<motion.div\n\t\t\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\t\t\t\t\t\ttop: 0,\n\t\t\t\t\t\t\t\t\t\t\tleft: 0,\n\t\t\t\t\t\t\t\t\t\t\tbottom: 0,\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tinitial={ false }\n\t\t\t\t\t\t\t\t\t\tanimate={ {\n\t\t\t\t\t\t\t\t\t\t\twidth: canvasWidth,\n\t\t\t\t\t\t\t\t\t\t} }\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\tdisableMotion || isResizing\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>\n\t\t\t\t\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t\t{ isEditorPage && <Editor /> }\n\t\t\t\t\t\t\t\t\t\t\t{ isListPage && <ListPage /> }\n\t\t\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t\t\t\t</motion.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"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/layout/index.js"],"names":["ANIMATION_DURATION","emptyResizeHandleStyles","position","undefined","userSelect","cursor","width","height","top","right","bottom","left","Layout","hubRef","params","isListPage","isEditorPage","canvasMode","previousShortcut","nextShortcut","select","getAllShortcutKeyCombinations","keyboardShortcutsStore","getCanvasMode","editSiteStore","navigateRegionsProps","previous","next","disableMotion","isMobileViewport","isMobileCanvasVisible","setIsMobileCanvasVisible","canvasPadding","showSidebar","showCanvas","showFrame","isFullCanvas","canvasResizer","canvasSize","fullResizer","fullSize","forcedWidth","setForcedWidth","isResizing","setIsResizing","isResizingEnabled","defaultSidebarWidth","canvasWidth","ref","className","motion","div","y","type","duration","ease","opacity","event","direction","elt","clientWidth","current","style","delta","paddingTop","paddingBottom"],"mappings":";;;;;;;;;AAqBA;;;;AAlBA;;AAKA;;AACA;;AAMA;;AAKA;;AAEA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAzCA;AACA;AACA;;AAGA;AACA;AACA;;AAkBA;AACA;AACA;AAgBA,MAAMA,kBAAkB,GAAG,GAA3B;AACA,MAAMC,uBAAuB,GAAG;AAC/BC,EAAAA,QAAQ,EAAEC,SADqB;AAE/BC,EAAAA,UAAU,EAAED,SAFmB;AAG/BE,EAAAA,MAAM,EAAEF,SAHuB;AAI/BG,EAAAA,KAAK,EAAEH,SAJwB;AAK/BI,EAAAA,MAAM,EAAEJ,SALuB;AAM/BK,EAAAA,GAAG,EAAEL,SAN0B;AAO/BM,EAAAA,KAAK,EAAEN,SAPwB;AAQ/BO,EAAAA,MAAM,EAAEP,SARuB;AAS/BQ,EAAAA,IAAI,EAAER;AATyB,CAAhC;;AAYe,SAASS,MAAT,GAAkB;AAChC;AACA;AACA;AAEA,QAAMC,MAAM,GAAG,sBAAf;AACA,QAAM;AAAEC,IAA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,KAAK,EAAEyC;AADE,KARX;AAWC,IAAA,UAAU,EAAG;AACZM,MAAAA,IAAI,EAAE,OADM;AAEZC,MAAAA,QAAQ,EACP1B,aAAa,IAAIe,UAAjB,GACG,CADH,GAEG3C,kBALQ;AAMZuD,MAAAA,IAAI,EAAE;AANM;AAXd,KAoBC,4BAAC,sBAAD,QACGvC,YAAY,IAAI,4BAAC,eAAD,OADnB,EAEGD,UAAU,IAAI,4BAAC,aAAD,OAFjB,CApBD,CAbD,CAdF,CArFF,CAtDD,CAFD,CADD;AA0MA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n\t__unstableUseNavigateRegions as useNavigateRegions,\n\tResizableBox,\n} from '@wordpress/components';\nimport {\n\tuseReducedMotion,\n\tuseViewportMatch,\n\tuseResizeObserver,\n} from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { useState, useEffect, useRef } from '@wordpress/element';\nimport { NavigableRegion } from '@wordpress/interface';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\n\n/**\n * Internal dependencies\n */\nimport Sidebar from '../sidebar';\nimport Editor from '../editor';\nimport ListPage from '../list';\nimport ErrorBoundary from '../error-boundary';\nimport { store as editSiteStore } from '../../store';\nimport { useLocation } from '../routes';\nimport getIsListPage from '../../utils/get-is-list-page';\nimport Header from '../header-edit-mode';\nimport useInitEditedEntityFromURL from '../sync-state-with-url/use-init-edited-entity-from-url';\nimport SiteHub from '../site-hub';\nimport ResizeHandle from '../block-editor/resize-handle';\nimport useSyncCanvasModeWithURL from '../sync-state-with-url/use-sync-canvas-mode-with-url';\nimport { unlock } from '../../experiments';\nimport SavePanel from '../save-panel';\n\nconst ANIMATION_DURATION = 0.5;\nconst emptyResizeHandleStyles = {\n\tposition: undefined,\n\tuserSelect: undefined,\n\tcursor: undefined,\n\twidth: undefined,\n\theight: undefined,\n\ttop: undefined,\n\tright: undefined,\n\tbottom: undefined,\n\tleft: undefined,\n};\n\nexport default function Layout() {\n\t// This ensures the edited entity id and type are initialized properly.\n\tuseInitEditedEntityFromURL();\n\tuseSyncCanvasModeWithURL();\n\n\tconst hubRef = useRef();\n\tconst { params } = useLocation();\n\tconst isListPage = getIsListPage( params );\n\tconst isEditorPage = ! isListPage;\n\tconst { canvasMode, previousShortcut, nextShortcut } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getAllShortcutKeyCombinations } = select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t);\n\t\t\tconst { getCanvasMode } = unlock( select( editSiteStore ) );\n\t\t\treturn {\n\t\t\t\tcanvasMode: getCanvasMode(),\n\t\t\t\tpreviousShortcut: getAllShortcutKeyCombinations(\n\t\t\t\t\t'core/edit-site/previous-region'\n\t\t\t\t),\n\t\t\t\tnextShortcut: getAllShortcutKeyCombinations(\n\t\t\t\t\t'core/edit-site/next-region'\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst navigateRegionsProps = useNavigateRegions( {\n\t\tprevious: previousShortcut,\n\t\tnext: nextShortcut,\n\t} );\n\tconst disableMotion = useReducedMotion();\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst [ isMobileCanvasVisible, setIsMobileCanvasVisible ] =\n\t\tuseState( false );\n\tconst canvasPadding = isMobileViewport ? 0 : 24;\n\tconst showSidebar =\n\t\t( isMobileViewport && ! isMobileCanvasVisible ) ||\n\t\t( ! isMobileViewport && ( canvasMode === 'view' || ! isEditorPage ) );\n\tconst showCanvas =\n\t\t( isMobileViewport && isMobileCanvasVisible ) || ! isMobileViewport;\n\tconst showFrame =\n\t\t! isEditorPage || ( canvasMode === 'view' && ! isMobileViewport );\n\n\tconst isFullCanvas =\n\t\t( isEditorPage && canvasMode === 'edit' && ! isMobileViewport ) ||\n\t\tisMobileCanvasVisible;\n\t// Ideally this effect could be removed if we move the \"isMobileCanvasVisible\" into the store.\n\tconst [ canvasResizer, canvasSize ] = useResizeObserver();\n\tconst [ fullResizer, fullSize ] = useResizeObserver();\n\tconst [ forcedWidth, setForcedWidth ] = useState( null );\n\tconst [ isResizing, setIsResizing ] = useState( false );\n\tconst isResizingEnabled = ! isMobileViewport && canvasMode === 'view';\n\tconst defaultSidebarWidth = isMobileViewport ? '100vw' : 360;\n\tlet canvasWidth = isResizing ? '100%' : fullSize.width;\n\tif ( showFrame && ! isResizing ) {\n\t\tcanvasWidth = canvasSize.width - canvasPadding;\n\t}\n\tuseEffect( () => {\n\t\tif ( canvasMode === 'view' && isMobileViewport ) {\n\t\t\tsetIsMobileCanvasVisible( false );\n\t\t}\n\n\t\tif ( canvasMode === 'edit' && isMobileViewport ) {\n\t\t\tsetIsMobileCanvasVisible( true );\n\t\t}\n\t}, [ canvasMode, isMobileViewport ] );\n\n\t// Synchronizing the URL with the store value of canvasMode happens in an effect\n\t// This condition ensures the component is only rendered after the synchronization happens\n\t// which prevents any animations due to potential canvasMode value change.\n\tif ( canvasMode === 'init' ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ fullResizer }\n\t\t\t<div\n\t\t\t\t{ ...navigateRegionsProps }\n\t\t\t\tref={ navigateRegionsProps.ref }\n\t\t\t\tclassName={ classnames(\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': isFullCanvas,\n\t\t\t\t\t\t'is-edit-mode': canvasMode === 'edit',\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<SiteHub\n\t\t\t\t\tref={ hubRef }\n\t\t\t\t\tclassName=\"edit-site-layout__hub\"\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\twidth:\n\t\t\t\t\t\t\tisResizingEnabled && forcedWidth\n\t\t\t\t\t\t\t\t? forcedWidth - 48\n\t\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t} }\n\t\t\t\t\tisMobileCanvasVisible={ isMobileCanvasVisible }\n\t\t\t\t\tsetIsMobileCanvasVisible={ setIsMobileCanvasVisible }\n\t\t\t\t/>\n\n\t\t\t\t<AnimatePresence initial={ false }>\n\t\t\t\t\t{ isEditorPage &&\n\t\t\t\t\t\t( canvasMode === 'edit' || isMobileCanvasVisible ) && (\n\t\t\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\t\t\tclassName=\"edit-site-layout__header\"\n\t\t\t\t\t\t\t\tariaLabel={ __( 'Editor top bar' ) }\n\t\t\t\t\t\t\t\tas={ motion.div }\n\t\t\t\t\t\t\t\tanimate={ {\n\t\t\t\t\t\t\t\t\ty: 0,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tinitial={ {\n\t\t\t\t\t\t\t\t\ty: '-100%',\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\texit={ {\n\t\t\t\t\t\t\t\t\ty: '-100%',\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\t\tduration: disableMotion\n\t\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t\t: ANIMATION_DURATION,\n\t\t\t\t\t\t\t\t\tease: 'easeOut',\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{ canvasMode === 'edit' && <Header /> }\n\t\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t\t) }\n\t\t\t\t</AnimatePresence>\n\n\t\t\t\t<div className=\"edit-site-layout__content\">\n\t\t\t\t\t<AnimatePresence initial={ false }>\n\t\t\t\t\t\t{ showSidebar && (\n\t\t\t\t\t\t\t<ResizableBox\n\t\t\t\t\t\t\t\tas={ motion.div }\n\t\t\t\t\t\t\t\tinitial={ {\n\t\t\t\t\t\t\t\t\topacity: 0,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tanimate={ {\n\t\t\t\t\t\t\t\t\topacity: 1,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\texit={ {\n\t\t\t\t\t\t\t\t\topacity: 0,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\t\tduration:\n\t\t\t\t\t\t\t\t\t\tdisableMotion || isResizing\n\t\t\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t\t\t: ANIMATION_DURATION,\n\t\t\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tsize={ {\n\t\t\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\t\t\twidth:\n\t\t\t\t\t\t\t\t\t\tisResizingEnabled && forcedWidth\n\t\t\t\t\t\t\t\t\t\t\t? forcedWidth\n\t\t\t\t\t\t\t\t\t\t\t: defaultSidebarWidth,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tclassName=\"edit-site-layout__sidebar\"\n\t\t\t\t\t\t\t\tenable={ {\n\t\t\t\t\t\t\t\t\tright: isResizingEnabled,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tonResizeStop={ ( event, direction, elt ) => {\n\t\t\t\t\t\t\t\t\tsetForcedWidth( elt.clientWidth );\n\t\t\t\t\t\t\t\t\tsetIsResizing( false );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tonResizeStart={ () => {\n\t\t\t\t\t\t\t\t\tsetIsResizing( true );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tonResize={ ( event, direction, elt ) => {\n\t\t\t\t\t\t\t\t\t// This is a performance optimization\n\t\t\t\t\t\t\t\t\t// We set the width imperatively to avoid re-rendering\n\t\t\t\t\t\t\t\t\t// the whole component while resizing.\n\t\t\t\t\t\t\t\t\thubRef.current.style.width =\n\t\t\t\t\t\t\t\t\t\telt.clientWidth - 48 + 'px';\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\thandleComponent={ {\n\t\t\t\t\t\t\t\t\tright: (\n\t\t\t\t\t\t\t\t\t\t<ResizeHandle\n\t\t\t\t\t\t\t\t\t\t\tdirection=\"right\"\n\t\t\t\t\t\t\t\t\t\t\tvariation=\"separator\"\n\t\t\t\t\t\t\t\t\t\t\tresizeWidthBy={ ( delta ) => {\n\t\t\t\t\t\t\t\t\t\t\t\tsetForcedWidth(\n\t\t\t\t\t\t\t\t\t\t\t\t\t( forcedWidth ??\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdefaultSidebarWidth ) +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelta\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),\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\thandleClasses={ undefined }\n\t\t\t\t\t\t\t\thandleStyles={ {\n\t\t\t\t\t\t\t\t\tright: emptyResizeHandleStyles,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tminWidth={ isResizingEnabled ? 320 : undefined }\n\t\t\t\t\t\t\t\tmaxWidth={\n\t\t\t\t\t\t\t\t\tisResizingEnabled && fullSize\n\t\t\t\t\t\t\t\t\t\t? fullSize.width - 360\n\t\t\t\t\t\t\t\t\t\t: undefined\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<NavigableRegion\n\t\t\t\t\t\t\t\t\tariaLabel={ __( 'Navigation sidebar' ) }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Sidebar />\n\t\t\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t\t\t</ResizableBox>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</AnimatePresence>\n\n\t\t\t\t\t<SavePanel />\n\n\t\t\t\t\t{ showCanvas && (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t'edit-site-layout__canvas-container',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'is-resizing': isResizing,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\tpaddingTop: showFrame ? canvasPadding : 0,\n\t\t\t\t\t\t\t\tpaddingBottom: showFrame ? canvasPadding : 0,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\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<motion.div\n\t\t\t\t\t\t\t\t\tinitial={ false }\n\t\t\t\t\t\t\t\t\tlayout=\"position\"\n\t\t\t\t\t\t\t\t\tclassName=\"edit-site-layout__canvas\"\n\t\t\t\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\t\t\tduration:\n\t\t\t\t\t\t\t\t\t\t\tdisableMotion || isResizing\n\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: ANIMATION_DURATION,\n\t\t\t\t\t\t\t\t\t\tease: 'easeOut',\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<motion.div\n\t\t\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\t\t\t\t\t\ttop: 0,\n\t\t\t\t\t\t\t\t\t\t\tleft: 0,\n\t\t\t\t\t\t\t\t\t\t\tbottom: 0,\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tinitial={ false }\n\t\t\t\t\t\t\t\t\t\tanimate={ {\n\t\t\t\t\t\t\t\t\t\t\twidth: canvasWidth,\n\t\t\t\t\t\t\t\t\t\t} }\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\tdisableMotion || isResizing\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>\n\t\t\t\t\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t\t{ isEditorPage && <Editor /> }\n\t\t\t\t\t\t\t\t\t\t\t{ isListPage && <ListPage /> }\n\t\t\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t\t\t\t</motion.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"]}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = SavePanel;
|
|
7
|
+
|
|
8
|
+
var _element = require("@wordpress/element");
|
|
9
|
+
|
|
10
|
+
var _components = require("@wordpress/components");
|
|
11
|
+
|
|
12
|
+
var _editor = require("@wordpress/editor");
|
|
13
|
+
|
|
14
|
+
var _data = require("@wordpress/data");
|
|
15
|
+
|
|
16
|
+
var _i18n = require("@wordpress/i18n");
|
|
17
|
+
|
|
18
|
+
var _interface = require("@wordpress/interface");
|
|
19
|
+
|
|
20
|
+
var _store = require("../../store");
|
|
21
|
+
|
|
22
|
+
var _experiments = require("../../experiments");
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* WordPress dependencies
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Internal dependencies
|
|
30
|
+
*/
|
|
31
|
+
function SavePanel() {
|
|
32
|
+
const {
|
|
33
|
+
isSaveViewOpen,
|
|
34
|
+
canvasMode
|
|
35
|
+
} = (0, _data.useSelect)(select => {
|
|
36
|
+
const {
|
|
37
|
+
isSaveViewOpened,
|
|
38
|
+
getCanvasMode
|
|
39
|
+
} = (0, _experiments.unlock)(select(_store.store)); // The currently selected entity to display.
|
|
40
|
+
// Typically template or template part in the site editor.
|
|
41
|
+
|
|
42
|
+
return {
|
|
43
|
+
isSaveViewOpen: isSaveViewOpened(),
|
|
44
|
+
canvasMode: getCanvasMode()
|
|
45
|
+
};
|
|
46
|
+
}, []);
|
|
47
|
+
const {
|
|
48
|
+
setIsSaveViewOpened
|
|
49
|
+
} = (0, _data.useDispatch)(_store.store);
|
|
50
|
+
|
|
51
|
+
const onClose = () => setIsSaveViewOpened(false);
|
|
52
|
+
|
|
53
|
+
if (canvasMode === 'view') {
|
|
54
|
+
return isSaveViewOpen ? (0, _element.createElement)(_components.Modal, {
|
|
55
|
+
className: "edit-site-save-panel__modal",
|
|
56
|
+
onRequestClose: onClose,
|
|
57
|
+
__experimentalHideHeader: true
|
|
58
|
+
}, (0, _element.createElement)(_editor.EntitiesSavedStates, {
|
|
59
|
+
close: onClose
|
|
60
|
+
})) : null;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return (0, _element.createElement)(_interface.NavigableRegion, {
|
|
64
|
+
className: "edit-site-layout__actions",
|
|
65
|
+
ariaLabel: (0, _i18n.__)('Save sidebar')
|
|
66
|
+
}, isSaveViewOpen ? (0, _element.createElement)(_editor.EntitiesSavedStates, {
|
|
67
|
+
close: onClose
|
|
68
|
+
}) : (0, _element.createElement)("div", {
|
|
69
|
+
className: "edit-site-editor__toggle-save-panel"
|
|
70
|
+
}, (0, _element.createElement)(_components.Button, {
|
|
71
|
+
variant: "secondary",
|
|
72
|
+
className: "edit-site-editor__toggle-save-panel-button",
|
|
73
|
+
onClick: () => setIsSaveViewOpened(true),
|
|
74
|
+
"aria-expanded": false
|
|
75
|
+
}, (0, _i18n.__)('Open save panel'))));
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/save-panel/index.js"],"names":["SavePanel","isSaveViewOpen","canvasMode","select","isSaveViewOpened","getCanvasMode","editSiteStore","setIsSaveViewOpened","onClose"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAbA;AACA;AACA;;AAOA;AACA;AACA;AAIe,SAASA,SAAT,GAAqB;AACnC,QAAM;AAAEC,IAAAA,cAAF;AAAkBC,IAAAA;AAAlB,MAAiC,qBAAaC,MAAF,IAAc;AAC/D,UAAM;AAAEC,MAAAA,gBAAF;AAAoBC,MAAAA;AAApB,QAAsC,yBAC3CF,MAAM,CAAEG,YAAF,CADqC,CAA5C,CAD+D,CAK/D;AACA;;AACA,WAAO;AACNL,MAAAA,cAAc,EAAEG,gBAAgB,EAD1B;AAENF,MAAAA,UAAU,EAAEG,aAAa;AAFnB,KAAP;AAIA,GAXsC,EAWpC,EAXoC,CAAvC;AAYA,QAAM;AAAEE,IAAAA;AAAF,MAA0B,uBAAaD,YAAb,CAAhC;;AACA,QAAME,OAAO,GAAG,MAAMD,mBAAmB,CAAE,KAAF,CAAzC;;AAEA,MAAKL,UAAU,KAAK,MAApB,EAA6B;AAC5B,WAAOD,cAAc,GACpB,4BAAC,iBAAD;AACC,MAAA,SAAS,EAAC,6BADX;AAEC,MAAA,cAAc,EAAGO,OAFlB;AAGC,MAAA,wBAAwB;AAHzB,OAKC,4BAAC,2BAAD;AAAqB,MAAA,KAAK,EAAGA;AAA7B,MALD,CADoB,GAQjB,IARJ;AASA;;AAED,SACC,4BAAC,0BAAD;AACC,IAAA,SAAS,EAAC,2BADX;AAEC,IAAA,SAAS,EAAG,cAAI,cAAJ;AAFb,KAIGP,cAAc,GACf,4BAAC,2BAAD;AAAqB,IAAA,KAAK,EAAGO;AAA7B,IADe,GAGf;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAC,WADT;AAEC,IAAA,SAAS,EAAC,4CAFX;AAGC,IAAA,OAAO,EAAG,MAAMD,mBAAmB,CAAE,IAAF,CAHpC;AAIC,qBAAgB;AAJjB,KAMG,cAAI,iBAAJ,CANH,CADD,CAPF,CADD;AAqBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button, Modal } from '@wordpress/components';\nimport { EntitiesSavedStates } from '@wordpress/editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { NavigableRegion } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../experiments';\n\nexport default function SavePanel() {\n\tconst { isSaveViewOpen, canvasMode } = useSelect( ( select ) => {\n\t\tconst { isSaveViewOpened, getCanvasMode } = unlock(\n\t\t\tselect( editSiteStore )\n\t\t);\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\tcanvasMode: getCanvasMode(),\n\t\t};\n\t}, [] );\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\tconst onClose = () => setIsSaveViewOpened( false );\n\n\tif ( canvasMode === '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\t__experimentalHideHeader\n\t\t\t>\n\t\t\t\t<EntitiesSavedStates close={ onClose } />\n\t\t\t</Modal>\n\t\t) : null;\n\t}\n\n\treturn (\n\t\t<NavigableRegion\n\t\t\tclassName=\"edit-site-layout__actions\"\n\t\t\tariaLabel={ __( 'Save sidebar' ) }\n\t\t>\n\t\t\t{ isSaveViewOpen ? (\n\t\t\t\t<EntitiesSavedStates close={ onClose } />\n\t\t\t) : (\n\t\t\t\t<div className=\"edit-site-editor__toggle-save-panel\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\tclassName=\"edit-site-editor__toggle-save-panel-button\"\n\t\t\t\t\t\tonClick={ () => setIsSaveViewOpened( true ) }\n\t\t\t\t\t\taria-expanded={ false }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Open save panel' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</NavigableRegion>\n\t);\n}\n"]}
|
|
@@ -9,8 +9,12 @@ exports.default = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _element = require("@wordpress/element");
|
|
11
11
|
|
|
12
|
+
var _data = require("@wordpress/data");
|
|
13
|
+
|
|
12
14
|
var _components = require("@wordpress/components");
|
|
13
15
|
|
|
16
|
+
var _coreData = require("@wordpress/core-data");
|
|
17
|
+
|
|
14
18
|
var _sidebarNavigationScreenMain = _interopRequireDefault(require("../sidebar-navigation-screen-main"));
|
|
15
19
|
|
|
16
20
|
var _sidebarNavigationScreenTemplates = _interopRequireDefault(require("../sidebar-navigation-screen-templates"));
|
|
@@ -19,6 +23,8 @@ var _useSyncSidebarPathWithUrl = _interopRequireDefault(require("../sync-state-w
|
|
|
19
23
|
|
|
20
24
|
var _sidebarNavigationScreenNavigationMenus = _interopRequireDefault(require("../sidebar-navigation-screen-navigation-menus"));
|
|
21
25
|
|
|
26
|
+
var _saveButton = _interopRequireDefault(require("../save-button"));
|
|
27
|
+
|
|
22
28
|
/**
|
|
23
29
|
* WordPress dependencies
|
|
24
30
|
*/
|
|
@@ -36,10 +42,27 @@ function SidebarScreens() {
|
|
|
36
42
|
}
|
|
37
43
|
|
|
38
44
|
function Sidebar() {
|
|
39
|
-
|
|
45
|
+
const {
|
|
46
|
+
isDirty
|
|
47
|
+
} = (0, _data.useSelect)(select => {
|
|
48
|
+
const {
|
|
49
|
+
__experimentalGetDirtyEntityRecords
|
|
50
|
+
} = select(_coreData.store);
|
|
51
|
+
|
|
52
|
+
const dirtyEntityRecords = __experimentalGetDirtyEntityRecords(); // The currently selected entity to display.
|
|
53
|
+
// Typically template or template part in the site editor.
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
return {
|
|
57
|
+
isDirty: dirtyEntityRecords.length > 0
|
|
58
|
+
};
|
|
59
|
+
}, []);
|
|
60
|
+
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_components.__experimentalNavigatorProvider, {
|
|
40
61
|
className: "edit-site-sidebar__content",
|
|
41
62
|
initialPath: "/"
|
|
42
|
-
}, (0, _element.createElement)(SidebarScreens, null))
|
|
63
|
+
}, (0, _element.createElement)(SidebarScreens, null)), isDirty && (0, _element.createElement)("div", {
|
|
64
|
+
className: "edit-site-sidebar__footer"
|
|
65
|
+
}, (0, _element.createElement)(_saveButton.default, null)));
|
|
43
66
|
}
|
|
44
67
|
|
|
45
68
|
var _default = (0, _element.memo)(Sidebar);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/index.js"],"names":["SidebarScreens","Sidebar"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AACA;;AACA;;
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/index.js"],"names":["SidebarScreens","Sidebar","isDirty","select","__experimentalGetDirtyEntityRecords","coreStore","dirtyEntityRecords","length"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAfA;AACA;AACA;;AAMA;AACA;AACA;AAOA,SAASA,cAAT,GAA0B;AACzB;AAEA,SACC,qDACC,4BAAC,oCAAD,OADD,EAEC,4BAAC,+CAAD,OAFD,EAGC,4BAAC,yCAAD;AAAkC,IAAA,QAAQ,EAAC;AAA3C,IAHD,EAIC,4BAAC,yCAAD;AAAkC,IAAA,QAAQ,EAAC;AAA3C,IAJD,CADD;AAQA;;AAED,SAASC,OAAT,GAAmB;AAClB,QAAM;AAAEC,IAAAA;AAAF,MAAc,qBAAaC,MAAF,IAAc;AAC5C,UAAM;AAAEC,MAAAA;AAAF,QAA0CD,MAAM,CAAEE,eAAF,CAAtD;;AACA,UAAMC,kBAAkB,GAAGF,mCAAmC,EAA9D,CAF4C,CAG5C;AACA;;;AACA,WAAO;AACNF,MAAAA,OAAO,EAAEI,kBAAkB,CAACC,MAAnB,GAA4B;AAD/B,KAAP;AAGA,GARmB,EAQjB,EARiB,CAApB;AAUA,SACC,qDACC,4BAAC,2CAAD;AACC,IAAA,SAAS,EAAC,4BADX;AAEC,IAAA,WAAW,EAAC;AAFb,KAIC,4BAAC,cAAD,OAJD,CADD,EAOGL,OAAO,IACR;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,mBAAD,OADD,CARF,CADD;AAeA;;eAEc,mBAAMD,OAAN,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { memo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { __experimentalNavigatorProvider as NavigatorProvider } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';\nimport SidebarNavigationScreenTemplates from '../sidebar-navigation-screen-templates';\nimport useSyncSidebarPathWithURL from '../sync-state-with-url/use-sync-sidebar-path-with-url';\nimport SidebarNavigationScreenNavigationMenus from '../sidebar-navigation-screen-navigation-menus';\nimport SaveButton from '../save-button';\n\nfunction SidebarScreens() {\n\tuseSyncSidebarPathWithURL();\n\n\treturn (\n\t\t<>\n\t\t\t<SidebarNavigationScreenMain />\n\t\t\t<SidebarNavigationScreenNavigationMenus />\n\t\t\t<SidebarNavigationScreenTemplates postType=\"wp_template\" />\n\t\t\t<SidebarNavigationScreenTemplates postType=\"wp_template_part\" />\n\t\t</>\n\t);\n}\n\nfunction Sidebar() {\n\tconst { isDirty } = useSelect( ( select ) => {\n\t\tconst { __experimentalGetDirtyEntityRecords } = select( coreStore );\n\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\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\tisDirty: dirtyEntityRecords.length > 0,\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<>\n\t\t\t<NavigatorProvider\n\t\t\t\tclassName=\"edit-site-sidebar__content\"\n\t\t\t\tinitialPath=\"/\"\n\t\t\t>\n\t\t\t\t<SidebarScreens />\n\t\t\t</NavigatorProvider>\n\t\t\t{ isDirty && (\n\t\t\t\t<div className=\"edit-site-sidebar__footer\">\n\t\t\t\t\t<SaveButton />\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default memo( Sidebar );\n"]}
|
|
@@ -5,12 +5,12 @@ import { createElement, Fragment } from "@wordpress/element";
|
|
|
5
5
|
*/
|
|
6
6
|
import { useMemo } from '@wordpress/element';
|
|
7
7
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
8
|
-
import {
|
|
8
|
+
import { Notice } from '@wordpress/components';
|
|
9
9
|
import { EntityProvider, store as coreStore } from '@wordpress/core-data';
|
|
10
10
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
11
11
|
import { BlockContextProvider, BlockBreadcrumb, store as blockEditorStore } from '@wordpress/block-editor';
|
|
12
12
|
import { InterfaceSkeleton, ComplementaryArea, store as interfaceStore } from '@wordpress/interface';
|
|
13
|
-
import { EditorNotices, EditorSnackbars
|
|
13
|
+
import { EditorNotices, EditorSnackbars } from '@wordpress/editor';
|
|
14
14
|
import { __ } from '@wordpress/i18n';
|
|
15
15
|
/**
|
|
16
16
|
* Internal dependencies
|
|
@@ -55,7 +55,6 @@ export default function Editor() {
|
|
|
55
55
|
isRightSidebarOpen,
|
|
56
56
|
isInserterOpen,
|
|
57
57
|
isListViewOpen,
|
|
58
|
-
isSaveViewOpen,
|
|
59
58
|
showIconLabels
|
|
60
59
|
} = useSelect(select => {
|
|
61
60
|
const {
|
|
@@ -65,8 +64,7 @@ export default function Editor() {
|
|
|
65
64
|
getEditorMode,
|
|
66
65
|
getCanvasMode,
|
|
67
66
|
isInserterOpened,
|
|
68
|
-
isListViewOpened
|
|
69
|
-
isSaveViewOpened
|
|
67
|
+
isListViewOpened
|
|
70
68
|
} = unlock(select(editSiteStore));
|
|
71
69
|
const {
|
|
72
70
|
hasFinishedResolution,
|
|
@@ -93,13 +91,11 @@ export default function Editor() {
|
|
|
93
91
|
blockEditorMode: __unstableGetEditorMode(),
|
|
94
92
|
isInserterOpen: isInserterOpened(),
|
|
95
93
|
isListViewOpen: isListViewOpened(),
|
|
96
|
-
isSaveViewOpen: isSaveViewOpened(),
|
|
97
94
|
isRightSidebarOpen: getActiveComplementaryArea(editSiteStore.name),
|
|
98
95
|
showIconLabels: select(preferencesStore).get('core/edit-site', 'showIconLabels')
|
|
99
96
|
};
|
|
100
97
|
}, []);
|
|
101
98
|
const {
|
|
102
|
-
setIsSaveViewOpened,
|
|
103
99
|
setEditedPostContext
|
|
104
100
|
} = useDispatch(editSiteStore);
|
|
105
101
|
const isViewMode = canvasMode === 'view';
|
|
@@ -148,16 +144,6 @@ export default function Editor() {
|
|
|
148
144
|
sidebar: isEditMode && isRightSidebarOpen && createElement(ComplementaryArea.Slot, {
|
|
149
145
|
scope: "core/edit-site"
|
|
150
146
|
}),
|
|
151
|
-
actions: isEditMode && createElement(Fragment, null, isSaveViewOpen ? createElement(EntitiesSavedStates, {
|
|
152
|
-
close: () => setIsSaveViewOpened(false)
|
|
153
|
-
}) : createElement("div", {
|
|
154
|
-
className: "edit-site-editor__toggle-save-panel"
|
|
155
|
-
}, createElement(Button, {
|
|
156
|
-
variant: "secondary",
|
|
157
|
-
className: "edit-site-editor__toggle-save-panel-button",
|
|
158
|
-
onClick: () => setIsSaveViewOpened(true),
|
|
159
|
-
"aria-expanded": false
|
|
160
|
-
}, __('Open save panel')))),
|
|
161
147
|
footer: showBlockBreakcrumb && createElement(BlockBreadcrumb, {
|
|
162
148
|
rootLabelText: __('Template')
|
|
163
149
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/editor/index.js"],"names":["useMemo","useSelect","useDispatch","Button","Notice","EntityProvider","store","coreStore","preferencesStore","BlockContextProvider","BlockBreadcrumb","blockEditorStore","InterfaceSkeleton","ComplementaryArea","interfaceStore","EditorNotices","EditorSnackbars","EntitiesSavedStates","__","SidebarComplementaryAreaFills","BlockEditor","CodeEditor","KeyboardShortcuts","InserterSidebar","ListViewSidebar","WelcomeGuide","editSiteStore","GlobalStylesRenderer","GlobalStylesProvider","useTitle","CanvasSpinner","unlock","interfaceLabels","body","sidebar","actions","footer","Editor","editedPostId","editedPostType","editedPost","context","hasLoadedPost","editorMode","canvasMode","blockEditorMode","isRightSidebarOpen","isInserterOpen","isListViewOpen","isSaveViewOpen","showIconLabels","select","getEditedPostType","getEditedPostId","getEditedPostContext","getEditorMode","getCanvasMode","isInserterOpened","isListViewOpened","isSaveViewOpened","hasFinishedResolution","getEntityRecord","__unstableGetEditorMode","getActiveComplementaryArea","postType","postId","name","get","setIsSaveViewOpened","setEditedPostContext","isViewMode","isEditMode","showVisualEditor","showBlockBreakcrumb","shouldShowInserter","shouldShowListView","secondarySidebarLabel","blockContext","queryContext","page","newQueryContext","isReady","undefined","secondarySidebar"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,OAAT,QAAwB,oBAAxB;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,MAAT,EAAiBC,MAAjB,QAA+B,uBAA/B;AACA,SAASC,cAAT,EAAyBC,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OAIGtB,EAAE,CACH,2EADG,CAJL,CAVF,EAmBGqD,UAAU,IAAI,cAAC,iBAAD,OAnBjB,CAPF;AA6BC,IAAA,gBAAgB,EACfA,UAAU,KACNG,kBAAkB,IACrB,cAAC,eAAD,OADC,IAGCC,kBAAkB,IACnB,cAAC,eAAD,OALQ,CA9BZ;AAsCC,IAAA,OAAO,EACNJ,UAAU,IACVzB,kBADA,IAEC,cAAC,iBAAD,CAAmB,IAAnB;AAAwB,MAAA,KAAK,EAAC;AAA9B,MAzCH;AA4CC,IAAA,OAAO,EACNyB,UAAU,IACT,8BACGtB,cAAc,GACf,cAAC,mBAAD;AACC,MAAA,KAAK,EAAG,MACPmB,mBAAmB,CAClB,KADkB;AAFrB,MADe,GASf;AAAK,MAAA,SAAS,EAAC;AAAf,OACC,cAAC,MAAD;AACC,MAAA,OAAO,EAAC,WADT;AAEC,MAAA,SAAS,EAAC,4CAFX;AAGC,MAAA,OAAO,EAAG,MACTA,mBAAmB,CAClB,IADkB,CAJrB;AAQC,uBAAgB;AARjB,OAUGlD,EAAE,CACH,iBADG,CAVL,CADD,CAVF,CA9CH;AA4EC,IAAA,MAAM,EACLuD,mBAAmB,IAClB,cAAC,eAAD;AACC,MAAA,aAAa,EAAGvD,EAAE,CAAE,UAAF;AADnB,MA9EH;AAmFC,IAAA,MAAM,EAAG,EACR,GAAGc,eADK;AAERmD,MAAAA,gBAAgB,EAAEP;AAFV;AAnFV,IAFD,CADD,CALD,CADD,CAHD,CADD;AA2GA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button, Notice } from '@wordpress/components';\nimport { EntityProvider, store as coreStore } from '@wordpress/core-data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tBlockContextProvider,\n\tBlockBreadcrumb,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport {\n\tInterfaceSkeleton,\n\tComplementaryArea,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport {\n\tEditorNotices,\n\tEditorSnackbars,\n\tEntitiesSavedStates,\n} from '@wordpress/editor';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { SidebarComplementaryAreaFills } from '../sidebar-edit-mode';\nimport BlockEditor from '../block-editor';\nimport CodeEditor from '../code-editor';\nimport KeyboardShortcuts from '../keyboard-shortcuts';\nimport InserterSidebar from '../secondary-sidebar/inserter-sidebar';\nimport ListViewSidebar from '../secondary-sidebar/list-view-sidebar';\nimport WelcomeGuide from '../welcome-guide';\nimport { store as editSiteStore } from '../../store';\nimport { GlobalStylesRenderer } from '../global-styles-renderer';\nimport { GlobalStylesProvider } from '../global-styles/global-styles-provider';\nimport useTitle from '../routes/use-title';\nimport CanvasSpinner from '../canvas-spinner';\nimport { unlock } from '../../experiments';\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the editor content landmark region. */\n\tbody: __( 'Editor content' ),\n\t/* translators: accessibility text for the editor settings landmark region. */\n\tsidebar: __( 'Editor settings' ),\n\t/* translators: accessibility text for the editor publish landmark region. */\n\tactions: __( 'Editor publish' ),\n\t/* translators: accessibility text for the editor footer landmark region. */\n\tfooter: __( 'Editor footer' ),\n};\n\nexport default function Editor() {\n\tconst {\n\t\teditedPostId,\n\t\teditedPostType,\n\t\teditedPost,\n\t\tcontext,\n\t\thasLoadedPost,\n\t\teditorMode,\n\t\tcanvasMode,\n\t\tblockEditorMode,\n\t\tisRightSidebarOpen,\n\t\tisInserterOpen,\n\t\tisListViewOpen,\n\t\tisSaveViewOpen,\n\t\tshowIconLabels,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetEditedPostType,\n\t\t\tgetEditedPostId,\n\t\t\tgetEditedPostContext,\n\t\t\tgetEditorMode,\n\t\t\tgetCanvasMode,\n\t\t\tisInserterOpened,\n\t\t\tisListViewOpened,\n\t\t\tisSaveViewOpened,\n\t\t} = unlock( select( editSiteStore ) );\n\t\tconst { hasFinishedResolution, getEntityRecord } = select( coreStore );\n\t\tconst { __unstableGetEditorMode } = select( blockEditorStore );\n\t\tconst { getActiveComplementaryArea } = select( interfaceStore );\n\t\tconst postType = getEditedPostType();\n\t\tconst postId = getEditedPostId();\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\teditedPostId: postId,\n\t\t\teditedPostType: postType,\n\t\t\teditedPost: postId\n\t\t\t\t? getEntityRecord( 'postType', postType, postId )\n\t\t\t\t: null,\n\t\t\tcontext: getEditedPostContext(),\n\t\t\thasLoadedPost: postId\n\t\t\t\t? hasFinishedResolution( 'getEntityRecord', [\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\tpostType,\n\t\t\t\t\t\tpostId,\n\t\t\t\t ] )\n\t\t\t\t: false,\n\t\t\teditorMode: getEditorMode(),\n\t\t\tcanvasMode: getCanvasMode(),\n\t\t\tblockEditorMode: __unstableGetEditorMode(),\n\t\t\tisInserterOpen: isInserterOpened(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tisSaveViewOpen: isSaveViewOpened(),\n\t\t\tisRightSidebarOpen: getActiveComplementaryArea(\n\t\t\t\teditSiteStore.name\n\t\t\t),\n\t\t\tshowIconLabels: select( preferencesStore ).get(\n\t\t\t\t'core/edit-site',\n\t\t\t\t'showIconLabels'\n\t\t\t),\n\t\t};\n\t}, [] );\n\tconst { setIsSaveViewOpened, setEditedPostContext } =\n\t\tuseDispatch( editSiteStore );\n\n\tconst isViewMode = canvasMode === 'view';\n\tconst isEditMode = canvasMode === 'edit';\n\tconst showVisualEditor = isViewMode || editorMode === 'visual';\n\tconst showBlockBreakcrumb =\n\t\tisEditMode && showVisualEditor && blockEditorMode !== 'zoom-out';\n\tconst shouldShowInserter = isEditMode && showVisualEditor && isInserterOpen;\n\tconst shouldShowListView = isEditMode && showVisualEditor && isListViewOpen;\n\tconst secondarySidebarLabel = isListViewOpen\n\t\t? __( 'List View' )\n\t\t: __( 'Block Library' );\n\tconst blockContext = useMemo(\n\t\t() => ( {\n\t\t\t...context,\n\t\t\tqueryContext: [\n\t\t\t\tcontext?.queryContext || { page: 1 },\n\t\t\t\t( newQueryContext ) =>\n\t\t\t\t\tsetEditedPostContext( {\n\t\t\t\t\t\t...context,\n\t\t\t\t\t\tqueryContext: {\n\t\t\t\t\t\t\t...context?.queryContext,\n\t\t\t\t\t\t\t...newQueryContext,\n\t\t\t\t\t\t},\n\t\t\t\t\t} ),\n\t\t\t],\n\t\t} ),\n\t\t[ context ]\n\t);\n\tconst isReady = editedPostType !== undefined && editedPostId !== undefined;\n\n\t// Only announce the title once the editor is ready to prevent \"Replace\"\n\t// action in <URlQueryController> from double-announcing.\n\tuseTitle( isReady && __( 'Editor (beta)' ) );\n\n\tif ( ! isReady ) {\n\t\treturn <CanvasSpinner />;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ isEditMode && <WelcomeGuide /> }\n\t\t\t<KeyboardShortcuts.Register />\n\t\t\t<EntityProvider kind=\"root\" type=\"site\">\n\t\t\t\t<EntityProvider\n\t\t\t\t\tkind=\"postType\"\n\t\t\t\t\ttype={ editedPostType }\n\t\t\t\t\tid={ editedPostId }\n\t\t\t\t>\n\t\t\t\t\t<GlobalStylesProvider>\n\t\t\t\t\t\t<BlockContextProvider value={ blockContext }>\n\t\t\t\t\t\t\t<SidebarComplementaryAreaFills />\n\t\t\t\t\t\t\t<InterfaceSkeleton\n\t\t\t\t\t\t\t\tenableRegionNavigation={ false }\n\t\t\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\t\t\tshowIconLabels && 'show-icon-labels'\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tnotices={ isEditMode && <EditorSnackbars /> }\n\t\t\t\t\t\t\t\tcontent={\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<GlobalStylesRenderer />\n\t\t\t\t\t\t\t\t\t\t{ isEditMode && <EditorNotices /> }\n\t\t\t\t\t\t\t\t\t\t{ showVisualEditor && editedPost && (\n\t\t\t\t\t\t\t\t\t\t\t<BlockEditor />\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t{ editorMode === 'text' &&\n\t\t\t\t\t\t\t\t\t\t\teditedPost &&\n\t\t\t\t\t\t\t\t\t\t\tisEditMode && <CodeEditor /> }\n\t\t\t\t\t\t\t\t\t\t{ hasLoadedPost && ! editedPost && (\n\t\t\t\t\t\t\t\t\t\t\t<Notice\n\t\t\t\t\t\t\t\t\t\t\t\tstatus=\"warning\"\n\t\t\t\t\t\t\t\t\t\t\t\tisDismissible={ false }\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{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"You attempted to edit an item that doesn't exist. Perhaps it was deleted?\"\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</Notice>\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t{ isEditMode && <KeyboardShortcuts /> }\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\tsecondarySidebar={\n\t\t\t\t\t\t\t\t\tisEditMode &&\n\t\t\t\t\t\t\t\t\t( ( shouldShowInserter && (\n\t\t\t\t\t\t\t\t\t\t<InserterSidebar />\n\t\t\t\t\t\t\t\t\t) ) ||\n\t\t\t\t\t\t\t\t\t\t( shouldShowListView && (\n\t\t\t\t\t\t\t\t\t\t\t<ListViewSidebar />\n\t\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\tsidebar={\n\t\t\t\t\t\t\t\t\tisEditMode &&\n\t\t\t\t\t\t\t\t\tisRightSidebarOpen && (\n\t\t\t\t\t\t\t\t\t\t<ComplementaryArea.Slot scope=\"core/edit-site\" />\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\tactions={\n\t\t\t\t\t\t\t\t\tisEditMode && (\n\t\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t\t{ isSaveViewOpen ? (\n\t\t\t\t\t\t\t\t\t\t\t\t<EntitiesSavedStates\n\t\t\t\t\t\t\t\t\t\t\t\t\tclose={ () =>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetIsSaveViewOpened(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfalse\n\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}\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<div className=\"edit-site-editor__toggle-save-panel\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"edit-site-editor__toggle-save-panel-button\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetIsSaveViewOpened(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttrue\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}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\taria-expanded={ false }\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{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Open save panel'\n\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</Button>\n\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) }\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\tfooter={\n\t\t\t\t\t\t\t\t\tshowBlockBreakcrumb && (\n\t\t\t\t\t\t\t\t\t\t<BlockBreadcrumb\n\t\t\t\t\t\t\t\t\t\t\trootLabelText={ __( 'Template' ) }\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\tlabels={ {\n\t\t\t\t\t\t\t\t\t...interfaceLabels,\n\t\t\t\t\t\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</BlockContextProvider>\n\t\t\t\t\t</GlobalStylesProvider>\n\t\t\t\t</EntityProvider>\n\t\t\t</EntityProvider>\n\t\t</>\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/editor/index.js"],"names":["useMemo","useSelect","useDispatch","Notice","EntityProvider","store","coreStore","preferencesStore","BlockContextProvider","BlockBreadcrumb","blockEditorStore","InterfaceSkeleton","ComplementaryArea","interfaceStore","EditorNotices","EditorSnackbars","__","SidebarComplementaryAreaFills","BlockEditor","CodeEditor","KeyboardShortcuts","InserterSidebar","ListViewSidebar","WelcomeGuide","editSiteStore","GlobalStylesRenderer","GlobalStylesProvider","useTitle","CanvasSpinner","unlock","interfaceLabels","body","sidebar","actions","footer","Editor","editedPostId","editedPostType","editedPost","context","hasLoadedPost","editorMode","canvasMode","blockEditorMode","isRightSidebarOpen","isInserterOpen","isListViewOpen","showIconLabels","select","getEditedPostType","getEditedPostId","getEditedPostContext","getEditorMode","getCanvasMode","isInserterOpened","isListViewOpened","hasFinishedResolution","getEntityRecord","__unstableGetEditorMode","getActiveComplementaryArea","postType","postId","name","get","setEditedPostContext","isViewMode","isEditMode","showVisualEditor","showBlockBreakcrumb","shouldShowInserter","shouldShowListView","secondarySidebarLabel","blockContext","queryContext","page","newQueryContext","isReady","undefined","secondarySidebar"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,OAAT,QAAwB,oBAAxB;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,MAAT,QAAuB,uBAAvB;AACA,SAASC,cAAT,EAAyBC,KAAK,IAAIC,SAAlC,QAAmD,sBAAnD;AACA,SAASD,KAAK,IAAIE,gBAAlB,QAA0C,wBAA1C;AACA,SACCC,oBADD,EAECC,eAFD,EAGCJ,KAAK,IAAIK,gBAHV,QAIO,yBAJP;AAKA,SACCC,iBADD,EAECC,iBAFD,EAGCP,KAAK,IAAIQ,cAHV,QAIO,sBAJP;AAKA,SAASC,aAAT,EAAwBC,eAAxB,QAA+C,mBAA/C;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,SAASC,6BAAT,QAA8C,sBAA9C;AACA,OAAOC,WAAP,MAAwB,iBAAxB;AACA,OAAOC,UAAP,MAAuB,gBAAvB;AACA,OAAOC,iBAAP,MAA8B,uBAA9B;AACA,OAAOC,eAAP,MAA4B,uCAA5B;AACA,OAAOC,eAAP,MAA4B,wCAA5B;AACA,OAAOC,YAAP,MAAyB,kBAAzB;AACA,SAASlB,KAAK,IAAImB,aAAlB,QAAuC,aAAvC;AACA,SAASC,oBAAT,QAAqC,2BAArC;AACA,SAASC,oBAAT,QAAqC,yCAArC;AACA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,SAASC,MAAT,QAAuB,mBAAvB;AAEA,MAAMC,eAAe,GAAG;AACvB;AACAC,EAAAA,IAAI,EAAEf,EAAE,CAAE,gBAAF,CAFe;;AAGvB;AACAgB,EAAAA,OAAO,EAAEhB,EAAE,CAAE,iBAAF,CAJY;;AAKvB;AACAiB,EAAAA,OAAO,EAAEjB,EAAE,CAAE,gBAAF,CANY;;AAOvB;AACAkB,EAAAA,MAAM,EA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IAAI,CAAEF,UAAnB,IACD,cAAC,MAAD;AACC,MAAA,MAAM,EAAC,SADR;AAEC,MAAA,aAAa,EAAG;AAFjB,OAIGtB,EAAE,CACH,2EADG,CAJL,CAVF,EAmBGkD,UAAU,IAAI,cAAC,iBAAD,OAnBjB,CAPF;AA6BC,IAAA,gBAAgB,EACfA,UAAU,KACNG,kBAAkB,IACrB,cAAC,eAAD,OADC,IAGCC,kBAAkB,IACnB,cAAC,eAAD,OALQ,CA9BZ;AAsCC,IAAA,OAAO,EACNJ,UAAU,IACVtB,kBADA,IAEC,cAAC,iBAAD,CAAmB,IAAnB;AAAwB,MAAA,KAAK,EAAC;AAA9B,MAzCH;AA4CC,IAAA,MAAM,EACLwB,mBAAmB,IAClB,cAAC,eAAD;AACC,MAAA,aAAa,EAAGpD,EAAE,CAAE,UAAF;AADnB,MA9CH;AAmDC,IAAA,MAAM,EAAG,EACR,GAAGc,eADK;AAERgD,MAAAA,gBAAgB,EAAEP;AAFV;AAnDV,IAFD,CADD,CALD,CADD,CAHD,CADD;AA2EA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Notice } from '@wordpress/components';\nimport { EntityProvider, store as coreStore } from '@wordpress/core-data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tBlockContextProvider,\n\tBlockBreadcrumb,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport {\n\tInterfaceSkeleton,\n\tComplementaryArea,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport { EditorNotices, EditorSnackbars } from '@wordpress/editor';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { SidebarComplementaryAreaFills } from '../sidebar-edit-mode';\nimport BlockEditor from '../block-editor';\nimport CodeEditor from '../code-editor';\nimport KeyboardShortcuts from '../keyboard-shortcuts';\nimport InserterSidebar from '../secondary-sidebar/inserter-sidebar';\nimport ListViewSidebar from '../secondary-sidebar/list-view-sidebar';\nimport WelcomeGuide from '../welcome-guide';\nimport { store as editSiteStore } from '../../store';\nimport { GlobalStylesRenderer } from '../global-styles-renderer';\nimport { GlobalStylesProvider } from '../global-styles/global-styles-provider';\nimport useTitle from '../routes/use-title';\nimport CanvasSpinner from '../canvas-spinner';\nimport { unlock } from '../../experiments';\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the editor content landmark region. */\n\tbody: __( 'Editor content' ),\n\t/* translators: accessibility text for the editor settings landmark region. */\n\tsidebar: __( 'Editor settings' ),\n\t/* translators: accessibility text for the editor publish landmark region. */\n\tactions: __( 'Editor publish' ),\n\t/* translators: accessibility text for the editor footer landmark region. */\n\tfooter: __( 'Editor footer' ),\n};\n\nexport default function Editor() {\n\tconst {\n\t\teditedPostId,\n\t\teditedPostType,\n\t\teditedPost,\n\t\tcontext,\n\t\thasLoadedPost,\n\t\teditorMode,\n\t\tcanvasMode,\n\t\tblockEditorMode,\n\t\tisRightSidebarOpen,\n\t\tisInserterOpen,\n\t\tisListViewOpen,\n\t\tshowIconLabels,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetEditedPostType,\n\t\t\tgetEditedPostId,\n\t\t\tgetEditedPostContext,\n\t\t\tgetEditorMode,\n\t\t\tgetCanvasMode,\n\t\t\tisInserterOpened,\n\t\t\tisListViewOpened,\n\t\t} = unlock( select( editSiteStore ) );\n\t\tconst { hasFinishedResolution, getEntityRecord } = select( coreStore );\n\t\tconst { __unstableGetEditorMode } = select( blockEditorStore );\n\t\tconst { getActiveComplementaryArea } = select( interfaceStore );\n\t\tconst postType = getEditedPostType();\n\t\tconst postId = getEditedPostId();\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\teditedPostId: postId,\n\t\t\teditedPostType: postType,\n\t\t\teditedPost: postId\n\t\t\t\t? getEntityRecord( 'postType', postType, postId )\n\t\t\t\t: null,\n\t\t\tcontext: getEditedPostContext(),\n\t\t\thasLoadedPost: postId\n\t\t\t\t? hasFinishedResolution( 'getEntityRecord', [\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\tpostType,\n\t\t\t\t\t\tpostId,\n\t\t\t\t ] )\n\t\t\t\t: false,\n\t\t\teditorMode: getEditorMode(),\n\t\t\tcanvasMode: getCanvasMode(),\n\t\t\tblockEditorMode: __unstableGetEditorMode(),\n\t\t\tisInserterOpen: isInserterOpened(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tisRightSidebarOpen: getActiveComplementaryArea(\n\t\t\t\teditSiteStore.name\n\t\t\t),\n\t\t\tshowIconLabels: select( preferencesStore ).get(\n\t\t\t\t'core/edit-site',\n\t\t\t\t'showIconLabels'\n\t\t\t),\n\t\t};\n\t}, [] );\n\tconst { setEditedPostContext } = useDispatch( editSiteStore );\n\n\tconst isViewMode = canvasMode === 'view';\n\tconst isEditMode = canvasMode === 'edit';\n\tconst showVisualEditor = isViewMode || editorMode === 'visual';\n\tconst showBlockBreakcrumb =\n\t\tisEditMode && showVisualEditor && blockEditorMode !== 'zoom-out';\n\tconst shouldShowInserter = isEditMode && showVisualEditor && isInserterOpen;\n\tconst shouldShowListView = isEditMode && showVisualEditor && isListViewOpen;\n\tconst secondarySidebarLabel = isListViewOpen\n\t\t? __( 'List View' )\n\t\t: __( 'Block Library' );\n\tconst blockContext = useMemo(\n\t\t() => ( {\n\t\t\t...context,\n\t\t\tqueryContext: [\n\t\t\t\tcontext?.queryContext || { page: 1 },\n\t\t\t\t( newQueryContext ) =>\n\t\t\t\t\tsetEditedPostContext( {\n\t\t\t\t\t\t...context,\n\t\t\t\t\t\tqueryContext: {\n\t\t\t\t\t\t\t...context?.queryContext,\n\t\t\t\t\t\t\t...newQueryContext,\n\t\t\t\t\t\t},\n\t\t\t\t\t} ),\n\t\t\t],\n\t\t} ),\n\t\t[ context ]\n\t);\n\tconst isReady = editedPostType !== undefined && editedPostId !== undefined;\n\n\t// Only announce the title once the editor is ready to prevent \"Replace\"\n\t// action in <URlQueryController> from double-announcing.\n\tuseTitle( isReady && __( 'Editor (beta)' ) );\n\n\tif ( ! isReady ) {\n\t\treturn <CanvasSpinner />;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ isEditMode && <WelcomeGuide /> }\n\t\t\t<KeyboardShortcuts.Register />\n\t\t\t<EntityProvider kind=\"root\" type=\"site\">\n\t\t\t\t<EntityProvider\n\t\t\t\t\tkind=\"postType\"\n\t\t\t\t\ttype={ editedPostType }\n\t\t\t\t\tid={ editedPostId }\n\t\t\t\t>\n\t\t\t\t\t<GlobalStylesProvider>\n\t\t\t\t\t\t<BlockContextProvider value={ blockContext }>\n\t\t\t\t\t\t\t<SidebarComplementaryAreaFills />\n\t\t\t\t\t\t\t<InterfaceSkeleton\n\t\t\t\t\t\t\t\tenableRegionNavigation={ false }\n\t\t\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\t\t\tshowIconLabels && 'show-icon-labels'\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tnotices={ isEditMode && <EditorSnackbars /> }\n\t\t\t\t\t\t\t\tcontent={\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<GlobalStylesRenderer />\n\t\t\t\t\t\t\t\t\t\t{ isEditMode && <EditorNotices /> }\n\t\t\t\t\t\t\t\t\t\t{ showVisualEditor && editedPost && (\n\t\t\t\t\t\t\t\t\t\t\t<BlockEditor />\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t{ editorMode === 'text' &&\n\t\t\t\t\t\t\t\t\t\t\teditedPost &&\n\t\t\t\t\t\t\t\t\t\t\tisEditMode && <CodeEditor /> }\n\t\t\t\t\t\t\t\t\t\t{ hasLoadedPost && ! editedPost && (\n\t\t\t\t\t\t\t\t\t\t\t<Notice\n\t\t\t\t\t\t\t\t\t\t\t\tstatus=\"warning\"\n\t\t\t\t\t\t\t\t\t\t\t\tisDismissible={ false }\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{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"You attempted to edit an item that doesn't exist. Perhaps it was deleted?\"\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</Notice>\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t{ isEditMode && <KeyboardShortcuts /> }\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\tsecondarySidebar={\n\t\t\t\t\t\t\t\t\tisEditMode &&\n\t\t\t\t\t\t\t\t\t( ( shouldShowInserter && (\n\t\t\t\t\t\t\t\t\t\t<InserterSidebar />\n\t\t\t\t\t\t\t\t\t) ) ||\n\t\t\t\t\t\t\t\t\t\t( shouldShowListView && (\n\t\t\t\t\t\t\t\t\t\t\t<ListViewSidebar />\n\t\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\tsidebar={\n\t\t\t\t\t\t\t\t\tisEditMode &&\n\t\t\t\t\t\t\t\t\tisRightSidebarOpen && (\n\t\t\t\t\t\t\t\t\t\t<ComplementaryArea.Slot scope=\"core/edit-site\" />\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\tfooter={\n\t\t\t\t\t\t\t\t\tshowBlockBreakcrumb && (\n\t\t\t\t\t\t\t\t\t\t<BlockBreadcrumb\n\t\t\t\t\t\t\t\t\t\t\trootLabelText={ __( 'Template' ) }\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\tlabels={ {\n\t\t\t\t\t\t\t\t\t...interfaceLabels,\n\t\t\t\t\t\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</BlockContextProvider>\n\t\t\t\t\t</GlobalStylesProvider>\n\t\t\t\t</EntityProvider>\n\t\t\t</EntityProvider>\n\t\t</>\n\t);\n}\n"]}
|
|
@@ -5,7 +5,6 @@ import { createElement } from "@wordpress/element";
|
|
|
5
5
|
*/
|
|
6
6
|
import { BlockPreview } from '@wordpress/block-editor';
|
|
7
7
|
import { getBlockType, getBlockFromExample } from '@wordpress/blocks';
|
|
8
|
-
import { useResizeObserver } from '@wordpress/compose';
|
|
9
8
|
import { __experimentalSpacer as Spacer } from '@wordpress/components';
|
|
10
9
|
|
|
11
10
|
const BlockPreviewPanel = _ref => {
|
|
@@ -15,10 +14,6 @@ const BlockPreviewPanel = _ref => {
|
|
|
15
14
|
name,
|
|
16
15
|
variation = ''
|
|
17
16
|
} = _ref;
|
|
18
|
-
const [containerResizeListener, {
|
|
19
|
-
width: containerWidth,
|
|
20
|
-
height: containerHeight
|
|
21
|
-
}] = useResizeObserver();
|
|
22
17
|
const blockExample = (_getBlockType = getBlockType(name)) === null || _getBlockType === void 0 ? void 0 : _getBlockType.example;
|
|
23
18
|
const blockExampleWithVariation = { ...blockExample,
|
|
24
19
|
attributes: { ...(blockExample === null || blockExample === void 0 ? void 0 : blockExample.attributes),
|
|
@@ -26,21 +21,25 @@ const BlockPreviewPanel = _ref => {
|
|
|
26
21
|
}
|
|
27
22
|
};
|
|
28
23
|
const blocks = blockExample && getBlockFromExample(name, variation ? blockExampleWithVariation : blockExample);
|
|
29
|
-
const viewportWidth = (blockExample === null || blockExample === void 0 ? void 0 : blockExample.viewportWidth) ||
|
|
30
|
-
const
|
|
24
|
+
const viewportWidth = (blockExample === null || blockExample === void 0 ? void 0 : blockExample.viewportWidth) || null;
|
|
25
|
+
const previewHeight = '150px';
|
|
31
26
|
return !blockExample ? null : createElement(Spacer, {
|
|
32
27
|
marginX: 4,
|
|
33
28
|
marginBottom: 4
|
|
34
29
|
}, createElement("div", {
|
|
35
|
-
className: "edit-site-global-styles__block-preview-panel"
|
|
36
|
-
|
|
30
|
+
className: "edit-site-global-styles__block-preview-panel",
|
|
31
|
+
style: {
|
|
32
|
+
maxHeight: previewHeight,
|
|
33
|
+
boxSizing: 'initial'
|
|
34
|
+
}
|
|
35
|
+
}, createElement(BlockPreview, {
|
|
37
36
|
blocks: blocks,
|
|
38
37
|
viewportWidth: viewportWidth,
|
|
39
|
-
minHeight:
|
|
38
|
+
minHeight: previewHeight,
|
|
40
39
|
additionalStyles: [{
|
|
41
40
|
css: `
|
|
42
41
|
body{
|
|
43
|
-
min-height:${
|
|
42
|
+
min-height:${previewHeight};
|
|
44
43
|
display:flex;align-items:center;justify-content:center;
|
|
45
44
|
}
|
|
46
45
|
`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/block-preview-panel.js"],"names":["BlockPreview","getBlockType","getBlockFromExample","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/block-preview-panel.js"],"names":["BlockPreview","getBlockType","getBlockFromExample","__experimentalSpacer","Spacer","BlockPreviewPanel","name","variation","blockExample","example","blockExampleWithVariation","attributes","className","blocks","viewportWidth","previewHeight","maxHeight","boxSizing","css"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,YAAT,QAA6B,yBAA7B;AACA,SAASC,YAAT,EAAuBC,mBAAvB,QAAkD,mBAAlD;AACA,SAASC,oBAAoB,IAAIC,MAAjC,QAA+C,uBAA/C;;AAEA,MAAMC,iBAAiB,GAAG,QAAgC;AAAA;;AAAA,MAA9B;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,SAAS,GAAG;AAApB,GAA8B;AACzD,QAAMC,YAAY,oBAAGP,YAAY,CAAEK,IAAF,CAAf,kDAAG,cAAsBG,OAA3C;AACA,QAAMC,yBAAyB,GAAG,EACjC,GAAGF,YAD8B;AAEjCG,IAAAA,UAAU,EAAE,EACX,IAAGH,YAAH,aAAGA,YAAH,uBAAGA,YAAY,CAAEG,UAAjB,CADW;AAEXC,MAAAA,SAAS,EAAEL;AAFA;AAFqB,GAAlC;AAOA,QAAMM,MAAM,GACXL,YAAY,IACZN,mBAAmB,CAClBI,IADkB,EAElBC,SAAS,GAAGG,yBAAH,GAA+BF,YAFtB,CAFpB;AAMA,QAAMM,aAAa,GAAG,CAAAN,YAAY,SAAZ,IAAAA,YAAY,WAAZ,YAAAA,YAAY,CAAEM,aAAd,KAA+B,IAArD;AACA,QAAMC,aAAa,GAAG,OAAtB;AAEA,SAAO,CAAEP,YAAF,GAAiB,IAAjB,GACN,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAG,CAAlB;AAAsB,IAAA,YAAY,EAAG;AAArC,KACC;AACC,IAAA,SAAS,EAAC,8CADX;AAEC,IAAA,KAAK,EAAG;AAAEQ,MAAAA,SAAS,EAAED,aAAb;AAA4BE,MAAAA,SAAS,EAAE;AAAvC;AAFT,KAIC,cAAC,YAAD;AACC,IAAA,MAAM,EAAGJ,MADV;AAEC,IAAA,aAAa,EAAGC,aAFjB;AAGC,IAAA,SAAS,EAAGC,aAHb;AAIC,IAAA,gBAAgB,EAAG,CAClB;AACCG,MAAAA,GAAG,EAAG;AACb;AACA,sBAAuBH,aAAe;AACtC;AACA;AACA;AANM,KADkB;AAJpB,IAJD,CADD,CADD;AAwBA,CA1CD;;AA4CA,eAAeV,iBAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { BlockPreview } from '@wordpress/block-editor';\nimport { getBlockType, getBlockFromExample } from '@wordpress/blocks';\nimport { __experimentalSpacer as Spacer } from '@wordpress/components';\n\nconst BlockPreviewPanel = ( { name, variation = '' } ) => {\n\tconst blockExample = getBlockType( name )?.example;\n\tconst blockExampleWithVariation = {\n\t\t...blockExample,\n\t\tattributes: {\n\t\t\t...blockExample?.attributes,\n\t\t\tclassName: variation,\n\t\t},\n\t};\n\tconst blocks =\n\t\tblockExample &&\n\t\tgetBlockFromExample(\n\t\t\tname,\n\t\t\tvariation ? blockExampleWithVariation : blockExample\n\t\t);\n\tconst viewportWidth = blockExample?.viewportWidth || null;\n\tconst previewHeight = '150px';\n\n\treturn ! blockExample ? null : (\n\t\t<Spacer marginX={ 4 } marginBottom={ 4 }>\n\t\t\t<div\n\t\t\t\tclassName=\"edit-site-global-styles__block-preview-panel\"\n\t\t\t\tstyle={ { maxHeight: previewHeight, boxSizing: 'initial' } }\n\t\t\t>\n\t\t\t\t<BlockPreview\n\t\t\t\t\tblocks={ blocks }\n\t\t\t\t\tviewportWidth={ viewportWidth }\n\t\t\t\t\tminHeight={ previewHeight }\n\t\t\t\t\tadditionalStyles={ [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcss: `\n\t\t\t\t\t\t\t\tbody{\n\t\t\t\t\t\t\t\t\tmin-height:${ previewHeight };\n\t\t\t\t\t\t\t\t\tdisplay:flex;align-items:center;justify-content:center;\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/>\n\t\t\t</div>\n\t\t</Spacer>\n\t);\n};\n\nexport default BlockPreviewPanel;\n"]}
|
|
@@ -4,7 +4,7 @@ import { createElement, Fragment } from "@wordpress/element";
|
|
|
4
4
|
* WordPress dependencies
|
|
5
5
|
*/
|
|
6
6
|
import { __experimentalItemGroup as ItemGroup, __experimentalHStack as HStack, __experimentalSpacer as Spacer, FlexItem, CardBody, CardDivider } from '@wordpress/components';
|
|
7
|
-
import { typography, border, color, layout, chevronLeft, chevronRight } from '@wordpress/icons';
|
|
7
|
+
import { typography, border, shadow, color, layout, chevronLeft, chevronRight } from '@wordpress/icons';
|
|
8
8
|
import { isRTL, __ } from '@wordpress/i18n';
|
|
9
9
|
import { useSelect } from '@wordpress/data';
|
|
10
10
|
import { store as coreStore } from '@wordpress/core-data';
|
|
@@ -20,6 +20,7 @@ import { useHasVariationsPanel } from './variations-panel';
|
|
|
20
20
|
import { NavigationButtonAsItem } from './navigation-button';
|
|
21
21
|
import { IconWithCurrentColor } from './icon-with-current-color';
|
|
22
22
|
import { ScreenVariations } from './screen-variations';
|
|
23
|
+
import { useHasShadowControl } from './shadow-panel';
|
|
23
24
|
|
|
24
25
|
function ContextMenu(_ref) {
|
|
25
26
|
let {
|
|
@@ -29,6 +30,7 @@ function ContextMenu(_ref) {
|
|
|
29
30
|
const hasTypographyPanel = useHasTypographyPanel(name);
|
|
30
31
|
const hasColorPanel = useHasColorPanel(name);
|
|
31
32
|
const hasBorderPanel = useHasBorderPanel(name);
|
|
33
|
+
const hasEffectsPanel = useHasShadowControl(name);
|
|
32
34
|
const hasDimensionsPanel = useHasDimensionsPanel(name);
|
|
33
35
|
const hasLayoutPanel = hasDimensionsPanel;
|
|
34
36
|
const hasVariationsPanel = useHasVariationsPanel(name, parentMenu);
|
|
@@ -61,8 +63,12 @@ function ContextMenu(_ref) {
|
|
|
61
63
|
}, __('Colors')), hasBorderPanel && createElement(NavigationButtonAsItem, {
|
|
62
64
|
icon: border,
|
|
63
65
|
path: parentMenu + '/border',
|
|
64
|
-
"aria-label": __('Border
|
|
65
|
-
}, __('Border
|
|
66
|
+
"aria-label": __('Border')
|
|
67
|
+
}, __('Border')), hasEffectsPanel && createElement(NavigationButtonAsItem, {
|
|
68
|
+
icon: shadow,
|
|
69
|
+
path: parentMenu + '/effects',
|
|
70
|
+
"aria-label": __('Shadow')
|
|
71
|
+
}, __('Shadow')), hasLayoutPanel && createElement(NavigationButtonAsItem, {
|
|
66
72
|
icon: layout,
|
|
67
73
|
path: parentMenu + '/layout',
|
|
68
74
|
"aria-label": __('Layout styles')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/context-menu.js"],"names":["__experimentalItemGroup","ItemGroup","__experimentalHStack","HStack","__experimentalSpacer","Spacer","FlexItem","CardBody","CardDivider","typography","border","color","layout","chevronLeft","chevronRight","isRTL","__","useSelect","store","coreStore","useHasBorderPanel","useHasColorPanel","useHasDimensionsPanel","useHasTypographyPanel","useHasVariationsPanel","NavigationButtonAsItem","IconWithCurrentColor","ScreenVariations","ContextMenu","name","parentMenu","hasTypographyPanel","hasColorPanel","hasBorderPanel","hasDimensionsPanel","hasLayoutPanel","hasVariationsPanel","canEditCSS","select","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","undefined","_links","isBlocksPanel","includes"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,uBAAuB,IAAIC,SAD5B,EAECC,oBAAoB,IAAIC,MAFzB,EAGCC,oBAAoB,IAAIC,MAHzB,EAICC,QAJD,EAKCC,QALD,EAMCC,WAND,QAOO,uBAPP;AAQA,SACCC,UADD,EAECC,MAFD,EAGCC,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/context-menu.js"],"names":["__experimentalItemGroup","ItemGroup","__experimentalHStack","HStack","__experimentalSpacer","Spacer","FlexItem","CardBody","CardDivider","typography","border","shadow","color","layout","chevronLeft","chevronRight","isRTL","__","useSelect","store","coreStore","useHasBorderPanel","useHasColorPanel","useHasDimensionsPanel","useHasTypographyPanel","useHasVariationsPanel","NavigationButtonAsItem","IconWithCurrentColor","ScreenVariations","useHasShadowControl","ContextMenu","name","parentMenu","hasTypographyPanel","hasColorPanel","hasBorderPanel","hasEffectsPanel","hasDimensionsPanel","hasLayoutPanel","hasVariationsPanel","canEditCSS","select","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","undefined","_links","isBlocksPanel","includes"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,uBAAuB,IAAIC,SAD5B,EAECC,oBAAoB,IAAIC,MAFzB,EAGCC,oBAAoB,IAAIC,MAHzB,EAICC,QAJD,EAKCC,QALD,EAMCC,WAND,QAOO,uBAPP;AAQA,SACCC,UADD,EAECC,MAFD,EAGCC,MAHD,EAICC,KAJD,EAKCC,MALD,EAMCC,WAND,EAOCC,YAPD,QAQO,kBARP;AASA,SAASC,KAAT,EAAgBC,EAAhB,QAA0B,iBA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B,kBAAkB,IACnB,cAAC,gBAAD;AAAkB,IAAA,IAAI,EAAGR,IAAzB;AAAgC,IAAA,IAAI,EAAGC;AAAvC,IA/CF,EAiDGgB,aAAa,IAAIR,UAAjB,IACD,8BACC,cAAC,WAAD,OADD,EAEC,cAAC,QAAD,QACC,cAAC,MAAD;AAAQ,IAAA,EAAE,EAAC,GAAX;AAAe,IAAA,UAAU,EAAG,CAA5B;AAAgC,IAAA,YAAY,EAAG;AAA/C,KACGvB,EAAE,CACH,qDADG,CADL,CADD,EAMC,cAAC,SAAD,QACC,cAAC,sBAAD;AACC,IAAA,IAAI,EAAGe,UAAU,GAAG,MADrB;AAEC,kBAAaf,EAAE,CAAE,sBAAF;AAFhB,KAIC,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAC;AAAhB,KACC,cAAC,QAAD,QACGA,EAAE,CAAE,sBAAF,CADL,CADD,EAIC,cAAC,oBAAD;AACC,IAAA,IAAI,EACHD,KAAK,KACFF,WADE,GAEFC;AAJL,IAJD,CAJD,CADD,CAND,CAFD,EA4BC,cAAC,WAAD,OA5BD,CAlDF,CADD,CADD;AAsFA;;AAED,eAAee,WAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalHStack as HStack,\n\t__experimentalSpacer as Spacer,\n\tFlexItem,\n\tCardBody,\n\tCardDivider,\n} from '@wordpress/components';\nimport {\n\ttypography,\n\tborder,\n\tshadow,\n\tcolor,\n\tlayout,\n\tchevronLeft,\n\tchevronRight,\n} from '@wordpress/icons';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { useHasBorderPanel } from './border-panel';\nimport { useHasColorPanel } from './color-utils';\nimport { useHasDimensionsPanel } from './dimensions-panel';\nimport { useHasTypographyPanel } from './typography-panel';\nimport { useHasVariationsPanel } from './variations-panel';\nimport { NavigationButtonAsItem } from './navigation-button';\nimport { IconWithCurrentColor } from './icon-with-current-color';\nimport { ScreenVariations } from './screen-variations';\nimport { useHasShadowControl } from './shadow-panel';\n\nfunction ContextMenu( { name, parentMenu = '' } ) {\n\tconst hasTypographyPanel = useHasTypographyPanel( name );\n\tconst hasColorPanel = useHasColorPanel( name );\n\tconst hasBorderPanel = useHasBorderPanel( name );\n\tconst hasEffectsPanel = useHasShadowControl( name );\n\tconst hasDimensionsPanel = useHasDimensionsPanel( name );\n\tconst hasLayoutPanel = hasDimensionsPanel;\n\tconst hasVariationsPanel = useHasVariationsPanel( name, parentMenu );\n\n\tconst { canEditCSS } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( coreStore );\n\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\tcanEditCSS:\n\t\t\t\t!! globalStyles?._links?.[ 'wp:action-edit-css' ] ?? false,\n\t\t};\n\t}, [] );\n\n\tconst isBlocksPanel =\n\t\tparentMenu.includes( 'blocks' ) &&\n\t\t! parentMenu.includes( 'variations' );\n\n\treturn (\n\t\t<>\n\t\t\t<ItemGroup>\n\t\t\t\t{ hasTypographyPanel && (\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\ticon={ typography }\n\t\t\t\t\t\tpath={ parentMenu + '/typography' }\n\t\t\t\t\t\taria-label={ __( 'Typography styles' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Typography' ) }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t) }\n\t\t\t\t{ hasColorPanel && (\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\ticon={ color }\n\t\t\t\t\t\tpath={ parentMenu + '/colors' }\n\t\t\t\t\t\taria-label={ __( 'Colors styles' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Colors' ) }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t) }\n\t\t\t\t{ hasBorderPanel && (\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\ticon={ border }\n\t\t\t\t\t\tpath={ parentMenu + '/border' }\n\t\t\t\t\t\taria-label={ __( 'Border' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Border' ) }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t) }\n\t\t\t\t{ hasEffectsPanel && (\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\ticon={ shadow }\n\t\t\t\t\t\tpath={ parentMenu + '/effects' }\n\t\t\t\t\t\taria-label={ __( 'Shadow' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Shadow' ) }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t) }\n\t\t\t\t{ hasLayoutPanel && (\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\ticon={ layout }\n\t\t\t\t\t\tpath={ parentMenu + '/layout' }\n\t\t\t\t\t\taria-label={ __( 'Layout styles' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Layout' ) }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t) }\n\t\t\t\t{ hasVariationsPanel && (\n\t\t\t\t\t<ScreenVariations name={ name } path={ parentMenu } />\n\t\t\t\t) }\n\t\t\t\t{ isBlocksPanel && canEditCSS && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<CardDivider />\n\t\t\t\t\t\t<CardBody>\n\t\t\t\t\t\t\t<Spacer as=\"p\" paddingTop={ 2 } marginBottom={ 4 }>\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Add your own CSS to customize the block appearance.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</Spacer>\n\t\t\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\t\t\t\tpath={ parentMenu + '/css' }\n\t\t\t\t\t\t\t\t\taria-label={ __( 'Additional block CSS' ) }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Additional block CSS' ) }\n\t\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t\t<IconWithCurrentColor\n\t\t\t\t\t\t\t\t\t\t\ticon={\n\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? chevronLeft\n\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}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t\t</CardBody>\n\t\t\t\t\t\t<CardDivider />\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</ItemGroup>\n\t\t</>\n\t);\n}\n\nexport default ContextMenu;\n"]}
|
|
@@ -12,7 +12,6 @@ import ScreenHeader from './header';
|
|
|
12
12
|
import BorderPanel, { useHasBorderPanel } from './border-panel';
|
|
13
13
|
import BlockPreviewPanel from './block-preview-panel';
|
|
14
14
|
import { getVariationClassName } from './utils';
|
|
15
|
-
import ShadowPanel, { useHasShadowControl } from './shadow-panel';
|
|
16
15
|
|
|
17
16
|
function ScreenBorder(_ref) {
|
|
18
17
|
let {
|
|
@@ -21,7 +20,6 @@ function ScreenBorder(_ref) {
|
|
|
21
20
|
} = _ref;
|
|
22
21
|
const hasBorderPanel = useHasBorderPanel(name);
|
|
23
22
|
const variationClassName = getVariationClassName(variation);
|
|
24
|
-
const hasShadowPanel = useHasShadowControl(name);
|
|
25
23
|
return createElement(Fragment, null, createElement(ScreenHeader, {
|
|
26
24
|
title: __('Border & Shadow')
|
|
27
25
|
}), createElement(BlockPreviewPanel, {
|
|
@@ -30,9 +28,6 @@ function ScreenBorder(_ref) {
|
|
|
30
28
|
}), hasBorderPanel && createElement(BorderPanel, {
|
|
31
29
|
name: name,
|
|
32
30
|
variation: variation
|
|
33
|
-
}), hasShadowPanel && createElement(ShadowPanel, {
|
|
34
|
-
name: name,
|
|
35
|
-
variation: variation
|
|
36
31
|
}));
|
|
37
32
|
}
|
|
38
33
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-border.js"],"names":["__","ScreenHeader","BorderPanel","useHasBorderPanel","BlockPreviewPanel","getVariationClassName","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-border.js"],"names":["__","ScreenHeader","BorderPanel","useHasBorderPanel","BlockPreviewPanel","getVariationClassName","ScreenBorder","name","variation","hasBorderPanel","variationClassName"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,OAAOC,YAAP,MAAyB,UAAzB;AACA,OAAOC,WAAP,IAAsBC,iBAAtB,QAA+C,gBAA/C;AACA,OAAOC,iBAAP,MAA8B,uBAA9B;AACA,SAASC,qBAAT,QAAsC,SAAtC;;AAEA,SAASC,YAAT,OAAkD;AAAA,MAA3B;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,SAAS,GAAG;AAApB,GAA2B;AACjD,QAAMC,cAAc,GAAGN,iBAAiB,CAAEI,IAAF,CAAxC;AACA,QAAMG,kBAAkB,GAAGL,qBAAqB,CAAEG,SAAF,CAAhD;AACA,SACC,8BACC,cAAC,YAAD;AAAc,IAAA,KAAK,EAAGR,EAAE,CAAE,iBAAF;AAAxB,IADD,EAEC,cAAC,iBAAD;AAAmB,IAAA,IAAI,EAAGO,IAA1B;AAAiC,IAAA,SAAS,EAAGG;AAA7C,IAFD,EAGGD,cAAc,IACf,cAAC,WAAD;AAAa,IAAA,IAAI,EAAGF,IAApB;AAA2B,IAAA,SAAS,EAAGC;AAAvC,IAJF,CADD;AASA;;AAED,eAAeF,YAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport ScreenHeader from './header';\nimport BorderPanel, { useHasBorderPanel } from './border-panel';\nimport BlockPreviewPanel from './block-preview-panel';\nimport { getVariationClassName } from './utils';\n\nfunction ScreenBorder( { name, variation = '' } ) {\n\tconst hasBorderPanel = useHasBorderPanel( name );\n\tconst variationClassName = getVariationClassName( variation );\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader title={ __( 'Border & Shadow' ) } />\n\t\t\t<BlockPreviewPanel name={ name } variation={ variationClassName } />\n\t\t\t{ hasBorderPanel && (\n\t\t\t\t<BorderPanel name={ name } variation={ variation } />\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default ScreenBorder;\n"]}
|