@wordpress/edit-site 5.3.6 → 5.3.7
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/block-editor/editor-canvas.js +2 -1
- package/build/components/block-editor/editor-canvas.js.map +1 -1
- package/build/components/layout/index.js +6 -0
- package/build/components/layout/index.js.map +1 -1
- package/build/components/list/index.js +2 -1
- package/build/components/list/index.js.map +1 -1
- package/build/components/routes/link.js +4 -1
- package/build/components/routes/link.js.map +1 -1
- package/build/components/save-button/index.js +2 -5
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/save-hub/index.js +82 -0
- package/build/components/save-hub/index.js.map +1 -0
- package/build/components/sidebar/index.js +2 -4
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +5 -2
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +1 -0
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-item/index.js +9 -14
- package/build/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +139 -11
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/loader.js +19 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/loader.js.map +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +77 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -0
- package/build/components/sidebar-navigation-screen-template/index.js +18 -4
- package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates/index.js +5 -2
- package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/index.js +6 -3
- package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +24 -8
- package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
- package/build/components/sync-state-with-url/use-sync-path-with-url.js +9 -7
- package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
- package/build/components/template-details/index.js +0 -3
- package/build/components/template-details/index.js.map +1 -1
- package/build/components/use-edited-entity-record/index.js +6 -6
- package/build/components/use-edited-entity-record/index.js.map +1 -1
- package/build/index.js +3 -0
- package/build/index.js.map +1 -1
- package/build/utils/history.js +8 -2
- package/build/utils/history.js.map +1 -1
- package/build-module/components/block-editor/editor-canvas.js +2 -1
- package/build-module/components/block-editor/editor-canvas.js.map +1 -1
- package/build-module/components/layout/index.js +6 -0
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/list/index.js +2 -1
- package/build-module/components/list/index.js.map +1 -1
- package/build-module/components/routes/link.js +5 -2
- package/build-module/components/routes/link.js.map +1 -1
- package/build-module/components/save-button/index.js +2 -5
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/save-hub/index.js +68 -0
- package/build-module/components/save-hub/index.js.map +1 -0
- package/build-module/components/sidebar/index.js +2 -4
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +5 -2
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +1 -0
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-item/index.js +13 -18
- package/build-module/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +131 -11
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/loader.js +11 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/loader.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +66 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-template/index.js +18 -5
- package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates/index.js +5 -2
- package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +6 -3
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +24 -8
- package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +9 -7
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
- package/build-module/components/template-details/index.js +0 -3
- package/build-module/components/template-details/index.js.map +1 -1
- package/build-module/components/use-edited-entity-record/index.js +6 -6
- package/build-module/components/use-edited-entity-record/index.js.map +1 -1
- package/build-module/index.js +4 -1
- package/build-module/index.js.map +1 -1
- package/build-module/utils/history.js +9 -3
- package/build-module/utils/history.js.map +1 -1
- package/build-style/style-rtl.css +80 -67
- package/build-style/style.css +80 -67
- package/package.json +7 -7
- package/src/components/block-editor/editor-canvas.js +2 -1
- package/src/components/layout/index.js +14 -0
- package/src/components/layout/style.scss +1 -3
- package/src/components/list/index.js +3 -1
- package/src/components/routes/link.js +9 -2
- package/src/components/save-button/index.js +2 -2
- package/src/components/save-hub/index.js +78 -0
- package/src/components/save-hub/style.scss +15 -0
- package/src/components/sidebar/index.js +2 -3
- package/src/components/sidebar/style.scss +4 -3
- package/src/components/sidebar-button/style.scss +2 -1
- package/src/components/sidebar-navigation-item/style.scss +0 -20
- package/src/components/sidebar-navigation-screen/index.js +6 -0
- package/src/components/sidebar-navigation-screen/style.scss +15 -0
- package/src/components/sidebar-navigation-screen-main/index.js +3 -0
- package/src/components/sidebar-navigation-screen-navigation-item/index.js +30 -21
- package/src/components/sidebar-navigation-screen-navigation-menus/index.js +141 -10
- package/src/components/sidebar-navigation-screen-navigation-menus/loader.js +9 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +78 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +55 -4
- package/src/components/sidebar-navigation-screen-template/index.js +21 -7
- package/src/components/sidebar-navigation-screen-templates/index.js +7 -0
- package/src/components/sidebar-navigation-screen-templates-browse/index.js +12 -1
- package/src/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +38 -8
- package/src/components/sync-state-with-url/use-sync-path-with-url.js +12 -7
- package/src/components/template-details/index.js +0 -3
- package/src/components/use-edited-entity-record/index.js +26 -18
- package/src/index.js +5 -1
- package/src/style.scss +1 -1
- package/src/utils/history.js +13 -9
- package/build/components/navigation-inspector/index.js +0 -190
- package/build/components/navigation-inspector/index.js.map +0 -1
- package/build/components/navigation-inspector/navigation-menu.js +0 -62
- package/build/components/navigation-inspector/navigation-menu.js.map +0 -1
- package/build-module/components/navigation-inspector/index.js +0 -173
- package/build-module/components/navigation-inspector/index.js.map +0 -1
- package/build-module/components/navigation-inspector/navigation-menu.js +0 -52
- package/build-module/components/navigation-inspector/navigation-menu.js.map +0 -1
- package/src/components/navigation-inspector/index.js +0 -223
- package/src/components/navigation-inspector/navigation-menu.js +0 -66
- package/src/components/navigation-inspector/style.scss +0 -46
|
@@ -56,7 +56,8 @@ function EditorCanvas(_ref) {
|
|
|
56
56
|
}), (0, _element.createElement)("style", null, // Forming a "block formatting context" to prevent margin collapsing.
|
|
57
57
|
// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context
|
|
58
58
|
`.is-root-container { display: flow-root; }
|
|
59
|
-
body { position: relative;
|
|
59
|
+
body { position: relative;
|
|
60
|
+
${canvasMode === 'view' ? 'cursor: pointer;' : ''}}}`), enableResizing && (0, _element.createElement)("style", null, // Some themes will have `min-height: 100vh` for the root container,
|
|
60
61
|
// which isn't a requirement in auto resize mode.
|
|
61
62
|
`.is-root-container { min-height: 0 !important; }`)),
|
|
62
63
|
ref: mouseMoveTypingRef,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/block-editor/editor-canvas.js"],"names":["EditorCanvas","enableResizing","settings","children","props","canvasMode","deviceType","isZoomOutMode","select","editSiteStore","__experimentalGetPreviewDeviceType","blockEditorStore","__unstableGetEditorMode","getCanvasMode","setCanvasMode","deviceStyles","mouseMoveTypingRef","undefined","styles","svgFilters"],"mappings":";;;;;;;;;;;;;AAGA;;AAOA;;AAKA;;AACA;;AAhBA;AACA;AACA;;AAUA;AACA;AACA;AAIA,SAASA,YAAT,OAA0E;AAAA,MAAnD;AAAEC,IAAAA,cAAF;AAAkBC,IAAAA,QAAlB;AAA4BC,IAAAA,QAA5B;AAAsC,OAAGC;AAAzC,GAAmD;AACzE,QAAM;AAAEC,IAAAA,UAAF;AAAcC,IAAAA,UAAd;AAA0BC,IAAAA;AAA1B,MAA4C,qBAC/CC,MAAF,KAAgB;AACfF,IAAAA,UAAU,EACTE,MAAM,CAAEC,YAAF,CAAN,CAAwBC,kCAAxB,EAFc;AAGfH,IAAAA,aAAa,EACZC,MAAM,CAAEG,kBAAF,CAAN,CAA2BC,uBAA3B,OACA,UALc;AAMfP,IAAAA,UAAU,EAAE,yBAAQG,MAAM,CAAEC,YAAF,CAAd,EAAkCI,aAAlC;AANG,GAAhB,CADiD,EASjD,EATiD,CAAlD;AAWA,QAAM;AAAEC,IAAAA;AAAF,MAAoB,yBAAQ,uBAAaL,YAAb,CAAR,CAA1B;AACA,QAAMM,YAAY,GAAG,gDAAiBT,UAAjB,CAArB;AACA,QAAMU,kBAAkB,GAAG,qDAA3B;AACA,SACC,4BAAC,6BAAD;AACC,IAAA,KAAK,EAAKT,aAAa,IAAI,IAAnB,IAA6BU,SADtC;AAEC,IAAA,SAAS,EAAGV,aAAa,GAAG,GAAH,GAASU,SAFnC;AAGC,IAAA,KAAK,EAAGhB,cAAc,GAAG,EAAH,GAAQc,YAH/B;AAIC,IAAA,IAAI,EACH,qDACC,4BAAC,mCAAD;AAAc,MAAA,MAAM,EAAGb,QAAQ,CAACgB;AAAhC,MADD,EAEC,2CACC;AACA;AACC;AACP,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/block-editor/editor-canvas.js"],"names":["EditorCanvas","enableResizing","settings","children","props","canvasMode","deviceType","isZoomOutMode","select","editSiteStore","__experimentalGetPreviewDeviceType","blockEditorStore","__unstableGetEditorMode","getCanvasMode","setCanvasMode","deviceStyles","mouseMoveTypingRef","undefined","styles","svgFilters"],"mappings":";;;;;;;;;;;;;AAGA;;AAOA;;AAKA;;AACA;;AAhBA;AACA;AACA;;AAUA;AACA;AACA;AAIA,SAASA,YAAT,OAA0E;AAAA,MAAnD;AAAEC,IAAAA,cAAF;AAAkBC,IAAAA,QAAlB;AAA4BC,IAAAA,QAA5B;AAAsC,OAAGC;AAAzC,GAAmD;AACzE,QAAM;AAAEC,IAAAA,UAAF;AAAcC,IAAAA,UAAd;AAA0BC,IAAAA;AAA1B,MAA4C,qBAC/CC,MAAF,KAAgB;AACfF,IAAAA,UAAU,EACTE,MAAM,CAAEC,YAAF,CAAN,CAAwBC,kCAAxB,EAFc;AAGfH,IAAAA,aAAa,EACZC,MAAM,CAAEG,kBAAF,CAAN,CAA2BC,uBAA3B,OACA,UALc;AAMfP,IAAAA,UAAU,EAAE,yBAAQG,MAAM,CAAEC,YAAF,CAAd,EAAkCI,aAAlC;AANG,GAAhB,CADiD,EASjD,EATiD,CAAlD;AAWA,QAAM;AAAEC,IAAAA;AAAF,MAAoB,yBAAQ,uBAAaL,YAAb,CAAR,CAA1B;AACA,QAAMM,YAAY,GAAG,gDAAiBT,UAAjB,CAArB;AACA,QAAMU,kBAAkB,GAAG,qDAA3B;AACA,SACC,4BAAC,6BAAD;AACC,IAAA,KAAK,EAAKT,aAAa,IAAI,IAAnB,IAA6BU,SADtC;AAEC,IAAA,SAAS,EAAGV,aAAa,GAAG,GAAH,GAASU,SAFnC;AAGC,IAAA,KAAK,EAAGhB,cAAc,GAAG,EAAH,GAAQc,YAH/B;AAIC,IAAA,IAAI,EACH,qDACC,4BAAC,mCAAD;AAAc,MAAA,MAAM,EAAGb,QAAQ,CAACgB;AAAhC,MADD,EAEC,2CACC;AACA;AACC;AACP;AACA,SAAUb,UAAU,KAAK,MAAf,GAAwB,kBAAxB,GAA6C,EAAI,IALtD,CAFD,EASGJ,cAAc,IACf,2CAEE;AACA;AACC,sDAJH,CAVF,CALF;AAyBC,IAAA,GAAG,EAAGe,kBAzBP;AA0BC,IAAA,IAAI,EAAC,eA1BN;AA2BC,IAAA,SAAS,EAAC;AA3BX,KA4BMZ,KA5BN;AA6BC,IAAA,IAAI,EAAGC,UAAU,KAAK,MAAf,GAAwB,QAAxB,GAAmCY,SA7B3C;AA8BC,IAAA,OAAO,EACNZ,UAAU,KAAK,MAAf,GACG,MAAMS,aAAa,CAAE,MAAF,CADtB,GAEGG,SAjCL;AAmCC,IAAA,QAAQ,EAAGZ,UAAU,KAAK;AAnC3B,MAsCGH,QAAQ,CAACiB,UAtCZ,EAuCGhB,QAvCH,CADD;AA2CA;;eAEcH,Y","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalUseResizeCanvas as useResizeCanvas,\n\t__unstableEditorStyles as EditorStyles,\n\t__unstableIframe as Iframe,\n\t__unstableUseMouseMoveTypingReset as useMouseMoveTypingReset,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../private-apis';\nimport { store as editSiteStore } from '../../store';\n\nfunction EditorCanvas( { enableResizing, settings, children, ...props } ) {\n\tconst { canvasMode, deviceType, isZoomOutMode } = useSelect(\n\t\t( select ) => ( {\n\t\t\tdeviceType:\n\t\t\t\tselect( editSiteStore ).__experimentalGetPreviewDeviceType(),\n\t\t\tisZoomOutMode:\n\t\t\t\tselect( blockEditorStore ).__unstableGetEditorMode() ===\n\t\t\t\t'zoom-out',\n\t\t\tcanvasMode: unlock( select( editSiteStore ) ).getCanvasMode(),\n\t\t} ),\n\t\t[]\n\t);\n\tconst { setCanvasMode } = unlock( useDispatch( editSiteStore ) );\n\tconst deviceStyles = useResizeCanvas( deviceType );\n\tconst mouseMoveTypingRef = useMouseMoveTypingReset();\n\treturn (\n\t\t<Iframe\n\t\t\tscale={ ( isZoomOutMode && 0.45 ) || undefined }\n\t\t\tframeSize={ isZoomOutMode ? 100 : undefined }\n\t\t\tstyle={ enableResizing ? {} : deviceStyles }\n\t\t\thead={\n\t\t\t\t<>\n\t\t\t\t\t<EditorStyles styles={ settings.styles } />\n\t\t\t\t\t<style>{\n\t\t\t\t\t\t// Forming a \"block formatting context\" to prevent margin collapsing.\n\t\t\t\t\t\t// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context\n\t\t\t\t\t\t`.is-root-container { display: flow-root; }\n\t\t\t\t\t\t\tbody { position: relative;\n\t\t\t\t\t\t\t${ canvasMode === 'view' ? 'cursor: pointer;' : '' }}}`\n\t\t\t\t\t}</style>\n\t\t\t\t\t{ enableResizing && (\n\t\t\t\t\t\t<style>\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// Some themes will have `min-height: 100vh` for the root container,\n\t\t\t\t\t\t\t\t// which isn't a requirement in auto resize mode.\n\t\t\t\t\t\t\t\t`.is-root-container { min-height: 0 !important; }`\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</style>\n\t\t\t\t\t) }\n\t\t\t\t</>\n\t\t\t}\n\t\t\tref={ mouseMoveTypingRef }\n\t\t\tname=\"editor-canvas\"\n\t\t\tclassName=\"edit-site-visual-editor__editor-canvas\"\n\t\t\t{ ...props }\n\t\t\trole={ canvasMode === 'view' ? 'button' : undefined }\n\t\t\tonClick={\n\t\t\t\tcanvasMode === 'view'\n\t\t\t\t\t? () => setCanvasMode( 'edit' )\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t\treadonly={ canvasMode === 'view' }\n\t\t>\n\t\t\t{ /* Filters need to be rendered before children to avoid Safari rendering issues. */ }\n\t\t\t{ settings.svgFilters }\n\t\t\t{ children }\n\t\t</Iframe>\n\t);\n}\n\nexport default EditorCanvas;\n"]}
|
|
@@ -237,6 +237,12 @@ function Layout() {
|
|
|
237
237
|
paddingBottom: showFrame ? canvasPadding : 0
|
|
238
238
|
}
|
|
239
239
|
}, canvasResizer, !!canvasSize.width && (0, _element.createElement)(_components.__unstableMotion.div, {
|
|
240
|
+
whileHover: isEditorPage && canvasMode === 'view' ? {
|
|
241
|
+
scale: 1.01,
|
|
242
|
+
transition: {
|
|
243
|
+
duration: disableMotion || isResizing ? 0 : 0.2
|
|
244
|
+
}
|
|
245
|
+
} : {},
|
|
240
246
|
initial: false,
|
|
241
247
|
layout: "position",
|
|
242
248
|
className: "edit-site-layout__canvas",
|
|
@@ -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","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;;AAC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CAAQ,GAAR;AACC,IAAA,KAAK,EAAG;AACPnD,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,EAAEuC;AADE,KARX;AAWC,IAAA,UAAU,EAAG;AACZM,MAAAA,IAAI,EAAE,OADM;AAEZC,MAAAA,QAAQ,EACPxB,aAAa,IAAIa,UAAjB,GACG,CADH,GAEGzC,kBALQ;AAMZqD,MAAAA,IAAI,EAAE;AANM;AAXd,KAoBC,4BAAC,sBAAD,QACGrC,YAAY,IAAI,4BAAC,eAAD,OADnB,EAEGD,UAAU,IAAI,4BAAC,aAAD,OAFjB,CApBD,CAbD,CAdF,CArFF,CAnDD,CAJD,CADD;AAyMA","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, 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 '../../private-apis';\nimport SavePanel from '../save-panel';\nimport KeyboardShortcutsRegister from '../keyboard-shortcuts/register';\nimport KeyboardShortcutsGlobal from '../keyboard-shortcuts/global';\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 canvasPadding = isMobileViewport ? 0 : 24;\n\tconst showSidebar =\n\t\t( isMobileViewport && ! isListPage ) ||\n\t\t( ! isMobileViewport && ( canvasMode === 'view' || ! isEditorPage ) );\n\tconst showCanvas =\n\t\t( isMobileViewport && isEditorPage && canvasMode === 'edit' ) ||\n\t\t! isMobileViewport ||\n\t\t! isEditorPage;\n\tconst showFrame =\n\t\t( ! isEditorPage && ! isMobileViewport ) ||\n\t\t( ! isMobileViewport && isEditorPage && canvasMode === 'view' );\n\tconst isFullCanvas =\n\t\t( isMobileViewport && isListPage ) ||\n\t\t( isEditorPage && canvasMode === 'edit' );\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\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<KeyboardShortcutsRegister />\n\t\t\t<KeyboardShortcutsGlobal />\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/>\n\n\t\t\t\t<AnimatePresence initial={ false }>\n\t\t\t\t\t{ isEditorPage && canvasMode === 'edit' && (\n\t\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\t\tclassName=\"edit-site-layout__header\"\n\t\t\t\t\t\t\tariaLabel={ __( 'Editor top bar' ) }\n\t\t\t\t\t\t\tas={ motion.div }\n\t\t\t\t\t\t\tanimate={ {\n\t\t\t\t\t\t\t\ty: 0,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tinitial={ {\n\t\t\t\t\t\t\t\ty: '-100%',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\texit={ {\n\t\t\t\t\t\t\t\ty: '-100%',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\tduration: disableMotion\n\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t: ANIMATION_DURATION,\n\t\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ canvasMode === 'edit' && <Header /> }\n\t\t\t\t\t\t</NavigableRegion>\n\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"]}
|
|
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","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","scale","transition"],"mappings":";;;;;;;;;AAqBA;;;;AAlBA;;AAKA;;AACA;;AAMA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ALO;AAFZ,KADH,GAWG,EAbL;AAeC,IAAA,OAAO,EAAG,KAfX;AAgBC,IAAA,MAAM,EAAC,UAhBR;AAiBC,IAAA,SAAS,EAAC,0BAjBX;AAkBC,IAAA,UAAU,EAAG;AACZU,MAAAA,IAAI,EAAE,OADM;AAEZC,MAAAA,QAAQ,EACPxB,aAAa,IAAIa,UAAjB,GACG,CADH,GAEGzC,kBALQ;AAMZqD,MAAAA,IAAI,EAAE;AANM;AAlBd,KA2BC,4BAAC,4BAAD,CAAQ,GAAR;AACC,IAAA,KAAK,EAAG;AACPnD,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,EAAEuC;AADE,KARX;AAWC,IAAA,UAAU,EAAG;AACZM,MAAAA,IAAI,EAAE,OADM;AAEZC,MAAAA,QAAQ,EACPxB,aAAa,IAAIa,UAAjB,GACG,CADH,GAEGzC,kBALQ;AAMZqD,MAAAA,IAAI,EAAE;AANM;AAXd,KAoBC,4BAAC,sBAAD,QACGrC,YAAY,IAAI,4BAAC,eAAD,OADnB,EAEGD,UAAU,IAAI,4BAAC,aAAD,OAFjB,CApBD,CA3BD,CAdF,CArFF,CAnDD,CAJD,CADD;AAuNA","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, 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 '../../private-apis';\nimport SavePanel from '../save-panel';\nimport KeyboardShortcutsRegister from '../keyboard-shortcuts/register';\nimport KeyboardShortcutsGlobal from '../keyboard-shortcuts/global';\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 canvasPadding = isMobileViewport ? 0 : 24;\n\tconst showSidebar =\n\t\t( isMobileViewport && ! isListPage ) ||\n\t\t( ! isMobileViewport && ( canvasMode === 'view' || ! isEditorPage ) );\n\tconst showCanvas =\n\t\t( isMobileViewport && isEditorPage && canvasMode === 'edit' ) ||\n\t\t! isMobileViewport ||\n\t\t! isEditorPage;\n\tconst showFrame =\n\t\t( ! isEditorPage && ! isMobileViewport ) ||\n\t\t( ! isMobileViewport && isEditorPage && canvasMode === 'view' );\n\tconst isFullCanvas =\n\t\t( isMobileViewport && isListPage ) ||\n\t\t( isEditorPage && canvasMode === 'edit' );\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\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<KeyboardShortcutsRegister />\n\t\t\t<KeyboardShortcutsGlobal />\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/>\n\n\t\t\t\t<AnimatePresence initial={ false }>\n\t\t\t\t\t{ isEditorPage && canvasMode === 'edit' && (\n\t\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\t\tclassName=\"edit-site-layout__header\"\n\t\t\t\t\t\t\tariaLabel={ __( 'Editor top bar' ) }\n\t\t\t\t\t\t\tas={ motion.div }\n\t\t\t\t\t\t\tanimate={ {\n\t\t\t\t\t\t\t\ty: 0,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tinitial={ {\n\t\t\t\t\t\t\t\ty: '-100%',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\texit={ {\n\t\t\t\t\t\t\t\ty: '-100%',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\tduration: disableMotion\n\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t: ANIMATION_DURATION,\n\t\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ canvasMode === 'edit' && <Header /> }\n\t\t\t\t\t\t</NavigableRegion>\n\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\twhileHover={\n\t\t\t\t\t\t\t\t\t\tisEditorPage && canvasMode === 'view'\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\tscale: 1.01,\n\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\tduration:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdisableMotion ||\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tisResizing\n\t\t\t\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\t\t\t: 0.2,\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 }\n\t\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\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"]}
|
|
@@ -43,9 +43,10 @@ function List() {
|
|
|
43
43
|
|
|
44
44
|
const {
|
|
45
45
|
params: {
|
|
46
|
-
|
|
46
|
+
path
|
|
47
47
|
}
|
|
48
48
|
} = (0, _routes.useLocation)();
|
|
49
|
+
const templateType = path === '/wp_template/all' ? 'wp_template' : 'wp_template_part';
|
|
49
50
|
(0, _useRegisterShortcuts.default)();
|
|
50
51
|
const {
|
|
51
52
|
previousShortcut,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/list/index.js"],"names":["List","params","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/list/index.js"],"names":["List","params","path","templateType","previousShortcut","nextShortcut","select","keyboardShortcutsStore","getAllShortcutKeyCombinations","postType","coreStore","getPostType","labels","name","itemsListLabel","items_list","detailedRegionLabels","header","body","undefined","previous","next"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAjBA;AACA;AACA;;AAQA;AACA;AACA;AAOe,SAASA,IAAT,GAAgB;AAAA;;AAC9B,QAAM;AACLC,IAAAA,MAAM,EAAE;AAAEC,MAAAA;AAAF;AADH,MAEF,0BAFJ;AAGA,QAAMC,YAAY,GACjBD,IAAI,KAAK,kBAAT,GAA8B,aAA9B,GAA8C,kBAD/C;AAGA;AAEA,QAAM;AAAEE,IAAAA,gBAAF;AAAoBC,IA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ent":["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { InterfaceSkeleton } from '@wordpress/interface';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { EditorSnackbars } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport useRegisterShortcuts from './use-register-shortcuts';\nimport Header from './header';\nimport Table from './table';\nimport { useLocation } from '../routes';\nimport useTitle from '../routes/use-title';\n\nexport default function List() {\n\tconst {\n\t\tparams: { path },\n\t} = useLocation();\n\tconst templateType =\n\t\tpath === '/wp_template/all' ? 'wp_template' : 'wp_template_part';\n\n\tuseRegisterShortcuts();\n\n\tconst { previousShortcut, nextShortcut } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tpreviousShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-site/previous-region' ),\n\t\t\tnextShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-site/next-region' ),\n\t\t};\n\t}, [] );\n\n\tconst postType = useSelect(\n\t\t( select ) => select( coreStore ).getPostType( templateType ),\n\t\t[ templateType ]\n\t);\n\n\tuseTitle( postType?.labels?.name );\n\n\t// `postType` could load in asynchronously. Only provide the detailed region labels if\n\t// the postType has loaded, otherwise `InterfaceSkeleton` will fallback to the defaults.\n\tconst itemsListLabel = postType?.labels?.items_list;\n\tconst detailedRegionLabels = postType\n\t\t? {\n\t\t\t\theader: sprintf(\n\t\t\t\t\t// translators: %s - the name of the page, 'Header' as in the header area of that page.\n\t\t\t\t\t__( '%s - Header' ),\n\t\t\t\t\titemsListLabel\n\t\t\t\t),\n\t\t\t\tbody: sprintf(\n\t\t\t\t\t// translators: %s - the name of the page, 'Content' as in the content area of that page.\n\t\t\t\t\t__( '%s - Content' ),\n\t\t\t\t\titemsListLabel\n\t\t\t\t),\n\t\t }\n\t\t: undefined;\n\n\treturn (\n\t\t<InterfaceSkeleton\n\t\t\tclassName=\"edit-site-list\"\n\t\t\tlabels={ detailedRegionLabels }\n\t\t\theader={ <Header templateType={ templateType } /> }\n\t\t\tnotices={ <EditorSnackbars /> }\n\t\t\tcontent={ <Table templateType={ templateType } /> }\n\t\t\tshortcuts={ {\n\t\t\t\tprevious: previousShortcut,\n\t\t\t\tnext: nextShortcut,\n\t\t\t} }\n\t\t/>\n\t);\n}\n"]}
|
|
@@ -39,8 +39,11 @@ function useLink() {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
const currentArgs = (0, _url.getQueryArgs)(window.location.href);
|
|
43
|
+
const currentUrlWithoutArgs = (0, _url.removeQueryArgs)(window.location.href, ...Object.keys(currentArgs));
|
|
44
|
+
const newUrl = (0, _url.addQueryArgs)(currentUrlWithoutArgs, params);
|
|
42
45
|
return {
|
|
43
|
-
href:
|
|
46
|
+
href: newUrl,
|
|
44
47
|
onClick
|
|
45
48
|
};
|
|
46
49
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/routes/link.js"],"names":["useLink","params","state","shouldReplace","history","onClick","event","preventDefault","replace","push","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/routes/link.js"],"names":["useLink","params","state","shouldReplace","history","onClick","event","preventDefault","replace","push","currentArgs","window","location","href","currentUrlWithoutArgs","Object","keys","newUrl","Link","children","props"],"mappings":";;;;;;;;;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAGO,SAASA,OAAT,GAA8D;AAAA,MAA5CC,MAA4C,uEAAnC,EAAmC;AAAA,MAA/BC,KAA+B;AAAA,MAAxBC,aAAwB,uEAAR,KAAQ;AACpE,QAAMC,OAAO,GAAG,wBAAhB;;AAEA,WAASC,OAAT,CAAkBC,KAAlB,EAA0B;AACzBA,IAAAA,KAAK,CAACC,cAAN;;AAEA,QAAKJ,aAAL,EAAqB;AACpBC,MAAAA,OAAO,CAACI,OAAR,CAAiBP,MAAjB,EAAyBC,KAAzB;AACA,KAFD,MAEO;AACNE,MAAAA,OAAO,CAACK,IAAR,CAAcR,MAAd,EAAsBC,KAAtB;AACA;AACD;;AAED,QAAMQ,WAAW,GAAG,uBAAcC,MAAM,CAACC,QAAP,CAAgBC,IAA9B,CAApB;AACA,QAAMC,qBAAqB,GAAG,0BAC7BH,MAAM,CAACC,QAAP,CAAgBC,IADa,EAE7B,GAAGE,MAAM,CAACC,IAAP,CAAaN,WAAb,CAF0B,CAA9B;AAIA,QAAMO,MAAM,GAAG,uBAAcH,qBAAd,EAAqCb,MAArC,CAAf;AAEA,SAAO;AACNY,IAAAA,IAAI,EAAEI,MADA;AAENZ,IAAAA;AAFM,GAAP;AAIA;;AAEc,SAASa,IAAT,OAMX;AAAA,MAN0B;AAC7BjB,IAAAA,MAAM,GAAG,EADoB;AAE7BC,IAAAA,KAF6B;AAG7BM,IAAAA,OAAO,EAAEL,aAAa,GAAG,KAHI;AAI7BgB,IAAAA,QAJ6B;AAK7B,OAAGC;AAL0B,GAM1B;AACH,QAAM;AAAEP,IAAAA,IAAF;AAAQR,IAAAA;AAAR,MAAoBL,OAAO,CAAEC,MAAF,EAAUC,KAAV,EAAiBC,aAAjB,CAAjC;AAEA,SACC;AAAG,IAAA,IAAI,EAAGU,IAAV;AAAiB,IAAA,OAAO,EAAGR;AAA3B,KAA0Ce,KAA1C,GACGD,QADH,CADD;AAKA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addQueryArgs, getQueryArgs, removeQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { useHistory } from './index';\n\nexport function useLink( params = {}, state, shouldReplace = false ) {\n\tconst history = useHistory();\n\n\tfunction onClick( event ) {\n\t\tevent.preventDefault();\n\n\t\tif ( shouldReplace ) {\n\t\t\thistory.replace( params, state );\n\t\t} else {\n\t\t\thistory.push( params, state );\n\t\t}\n\t}\n\n\tconst currentArgs = getQueryArgs( window.location.href );\n\tconst currentUrlWithoutArgs = removeQueryArgs(\n\t\twindow.location.href,\n\t\t...Object.keys( currentArgs )\n\t);\n\tconst newUrl = addQueryArgs( currentUrlWithoutArgs, params );\n\n\treturn {\n\t\thref: newUrl,\n\t\tonClick,\n\t};\n}\n\nexport default function Link( {\n\tparams = {},\n\tstate,\n\treplace: shouldReplace = false,\n\tchildren,\n\t...props\n} ) {\n\tconst { href, onClick } = useLink( params, state, shouldReplace );\n\n\treturn (\n\t\t<a href={ href } onClick={ onClick } { ...props }>\n\t\t\t{ children }\n\t\t</a>\n\t);\n}\n"]}
|
|
@@ -26,10 +26,7 @@ var _store = require("../../store");
|
|
|
26
26
|
/**
|
|
27
27
|
* Internal dependencies
|
|
28
28
|
*/
|
|
29
|
-
function SaveButton(
|
|
30
|
-
let {
|
|
31
|
-
showTooltip = true
|
|
32
|
-
} = _ref;
|
|
29
|
+
function SaveButton() {
|
|
33
30
|
const {
|
|
34
31
|
isDirty,
|
|
35
32
|
isSaving,
|
|
@@ -77,7 +74,7 @@ function SaveButton(_ref) {
|
|
|
77
74
|
& the tooltip is always rendered even when there's no keyboard shortcut.
|
|
78
75
|
*/
|
|
79
76
|
,
|
|
80
|
-
showTooltip:
|
|
77
|
+
showTooltip: true
|
|
81
78
|
}, label);
|
|
82
79
|
}
|
|
83
80
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/save-button/index.js"],"names":["SaveButton","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/save-button/index.js"],"names":["SaveButton","isDirty","isSaving","isSaveViewOpen","select","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","coreStore","dirtyEntityRecords","isSaveViewOpened","editSiteStore","length","some","record","kind","name","key","setIsSaveViewOpened","disabled","label","undefined","displayShortcut","primary"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;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AgBC,OAAhB,CAAyB,GAAzB;AAClC;AACH;AACA;AACA;AACA;AACA;AAlBE;AAmBC,IAAA,WAAW;AAnBZ,KAqBGH,KArBH,CADD;AAyBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { displayShortcut } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\n\nexport default function SaveButton() {\n\tconst { isDirty, isSaving, isSaveViewOpen } = useSelect( ( select ) => {\n\t\tconst { __experimentalGetDirtyEntityRecords, isSavingEntityRecord } =\n\t\t\tselect( coreStore );\n\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\tconst { isSaveViewOpened } = select( editSiteStore );\n\t\treturn {\n\t\t\tisDirty: dirtyEntityRecords.length > 0,\n\t\t\tisSaving: dirtyEntityRecords.some( ( record ) =>\n\t\t\t\tisSavingEntityRecord( record.kind, record.name, record.key )\n\t\t\t),\n\t\t\tisSaveViewOpen: isSaveViewOpened(),\n\t\t};\n\t}, [] );\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\n\tconst disabled = ! isDirty || isSaving;\n\n\tconst label = __( 'Save' );\n\n\treturn (\n\t\t<Button\n\t\t\tvariant=\"primary\"\n\t\t\tclassName=\"edit-site-save-button__button\"\n\t\t\taria-disabled={ disabled }\n\t\t\taria-expanded={ isSaveViewOpen }\n\t\t\tisBusy={ isSaving }\n\t\t\tonClick={ disabled ? undefined : () => setIsSaveViewOpened( true ) }\n\t\t\tlabel={ label }\n\t\t\t/*\n\t\t\t * We want the tooltip to show the keyboard shortcut only when the\n\t\t\t * button does something, i.e. when it's not disabled.\n\t\t\t */\n\t\t\tshortcut={ disabled ? undefined : displayShortcut.primary( 's' ) }\n\t\t\t/*\n\t\t\t * Displaying the keyboard shortcut conditionally makes the tooltip\n\t\t\t * itself show conditionally. This would trigger a full-rerendering\n\t\t\t * of the button that we want to avoid. By setting `showTooltip`,\n\t\t\t & the tooltip is always rendered even when there's no keyboard shortcut.\n\t\t\t */\n\t\t\tshowTooltip\n\t\t>\n\t\t\t{ label }\n\t\t</Button>\n\t);\n}\n"]}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = SaveButton;
|
|
7
|
+
|
|
8
|
+
var _element = require("@wordpress/element");
|
|
9
|
+
|
|
10
|
+
var _data = require("@wordpress/data");
|
|
11
|
+
|
|
12
|
+
var _components = require("@wordpress/components");
|
|
13
|
+
|
|
14
|
+
var _i18n = require("@wordpress/i18n");
|
|
15
|
+
|
|
16
|
+
var _coreData = require("@wordpress/core-data");
|
|
17
|
+
|
|
18
|
+
var _keycodes = require("@wordpress/keycodes");
|
|
19
|
+
|
|
20
|
+
var _icons = require("@wordpress/icons");
|
|
21
|
+
|
|
22
|
+
var _store = require("../../store");
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* WordPress dependencies
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Internal dependencies
|
|
30
|
+
*/
|
|
31
|
+
function SaveButton() {
|
|
32
|
+
const {
|
|
33
|
+
countUnsavedChanges,
|
|
34
|
+
isDirty,
|
|
35
|
+
isSaving,
|
|
36
|
+
isSaveViewOpen
|
|
37
|
+
} = (0, _data.useSelect)(select => {
|
|
38
|
+
const {
|
|
39
|
+
__experimentalGetDirtyEntityRecords,
|
|
40
|
+
isSavingEntityRecord
|
|
41
|
+
} = select(_coreData.store);
|
|
42
|
+
|
|
43
|
+
const dirtyEntityRecords = __experimentalGetDirtyEntityRecords();
|
|
44
|
+
|
|
45
|
+
const {
|
|
46
|
+
isSaveViewOpened
|
|
47
|
+
} = select(_store.store);
|
|
48
|
+
return {
|
|
49
|
+
isDirty: dirtyEntityRecords.length > 0,
|
|
50
|
+
isSaving: dirtyEntityRecords.some(record => isSavingEntityRecord(record.kind, record.name, record.key)),
|
|
51
|
+
isSaveViewOpen: isSaveViewOpened(),
|
|
52
|
+
countUnsavedChanges: dirtyEntityRecords.length
|
|
53
|
+
};
|
|
54
|
+
}, []);
|
|
55
|
+
const {
|
|
56
|
+
setIsSaveViewOpened
|
|
57
|
+
} = (0, _data.useDispatch)(_store.store);
|
|
58
|
+
const disabled = !isDirty || isSaving;
|
|
59
|
+
const label = disabled ? (0, _i18n.__)('Saved') : (0, _i18n.__)('Save');
|
|
60
|
+
return (0, _element.createElement)(_components.__experimentalHStack, {
|
|
61
|
+
className: "edit-site-save-hub",
|
|
62
|
+
alignment: "right",
|
|
63
|
+
spacing: 4
|
|
64
|
+
}, isDirty && (0, _element.createElement)("span", null, (0, _i18n.sprintf)( // translators: %d: number of unsaved changes (number).
|
|
65
|
+
(0, _i18n._n)('%d unsaved change', '%d unsaved changes', countUnsavedChanges), countUnsavedChanges)), (0, _element.createElement)(_components.Button, {
|
|
66
|
+
className: "edit-site-save-hub__button",
|
|
67
|
+
variant: disabled ? undefined : 'primary',
|
|
68
|
+
"aria-disabled": disabled,
|
|
69
|
+
"aria-expanded": isSaveViewOpen,
|
|
70
|
+
isBusy: isSaving,
|
|
71
|
+
onClick: disabled ? undefined : () => setIsSaveViewOpened(true),
|
|
72
|
+
label: label
|
|
73
|
+
/*
|
|
74
|
+
* We want the tooltip to show the keyboard shortcut only when the
|
|
75
|
+
* button does something, i.e. when it's not disabled.
|
|
76
|
+
*/
|
|
77
|
+
,
|
|
78
|
+
shortcut: disabled ? undefined : _keycodes.displayShortcut.primary('s'),
|
|
79
|
+
icon: disabled ? _icons.check : undefined
|
|
80
|
+
}, label));
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/save-hub/index.js"],"names":["SaveButton","countUnsavedChanges","isDirty","isSaving","isSaveViewOpen","select","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","coreStore","dirtyEntityRecords","isSaveViewOpened","editSiteStore","length","some","record","kind","name","key","setIsSaveViewOpened","disabled","label","undefined","displayShortcut","primary","check"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAbA;AACA;AACA;;AAQA;AACA;AACA;AAGe,SAASA,UAAT,GAAsB;AACpC,QAAM;AAAEC,IAAAA,mBAAF;AAAuBC,IAAAA,OAAvB;AAAgCC,IAAAA,QAAhC;AAA0CC,IAAAA;AAA1C,MACL,qBAAaC,MAAF,IAAc;AACxB,UAAM;AACLC,MAAAA,mCADK;AAELC,MAAAA;AAFK,QAGFF,MAAM,CAAEG,eAAF,CAHV;;AAIA,UAAMC,kBAAkB,GAAGH,mCAAmC,EAA9D;;AACA,UAAM;AAAEI,MAAAA;AAAF,QAAuBL,MAAM,CAAEM,YAAF,CAAnC;AACA,WAAO;AACNT,MAAAA,OAAO,EAAEO,kBAAkB,CAACG,MAAnB,GAA4B,CAD/B;AAENT,MAAAA,QAAQ,EAAEM,kBAAkB,CAACI,IAAnB,CAA2BC,MAAF,IAClCP,oBAAoB,CAAEO,MAAM,CAACC,IAAT,EAAeD,MAAM,CAACE,IAAtB,EAA4BF,MAAM,CAACG,GAAnC,CADX,CAFJ;AAKNb,MAAAA,cAAc,EAAEM,gBAAgB,EAL1B;AAMNT,MAAAA,mBAAmB,EAAEQ,kBAAkB,CAACG;AANlC,KAAP;AAQA,GAfD,EAeG,EAfH,CADD;AAiBA,QAAM;AAAEM,IAAAA;AAAF,MAA0B,uBAAaP,YAAb,CAAhC;AAEA,QAAMQ,QAAQ,GAAG,CAAEjB,OAAF,IAAaC,QAA9B;AAEA,QAAMiB,KAAK,GAAGD,QAAQ,GAAG,cAAI,OAAJ,CAAH,GAAmB,cAAI,MAAJ,CAAzC;AAEA,SACC,4BAAC,gCAAD;AAAQ,IAAA,SAAS,EAAC,oBAAlB;AAAuC,IAAA,SAAS,EAAC,OAAjD;AAAyD,IAAA,OAAO,EAAG;AAAnE,KACGjB,OAAO,IACR,0CACG,oBACD;AACA,gBACC,mBADD,EAEC,oBAFD,EAGCD,mBAHD,CAFC,EAODA,mBAPC,CADH,CAFF,EAcC,4BAAC,kBAAD;AACC,IAAA,SAAS,EAAC,4BADX;AAEC,IAAA,OAAO,EAAGkB,QAAQ,GAAGE,SAAH,GAAe,SAFlC;AAGC,qBAAgBF,QAHjB;AAIC,qBAAgBf,cAJjB;AAKC,IAAA,MAAM,EAAGD,QALV;AAMC,IAAA,OAAO,EACNgB,QAAQ,GAAGE,SAAH,GAAe,MAAMH,mBAAmB,CAAE,IAAF,CAPlD;AASC,IAAA,KAAK,EAAGE;AACR;AACJ;AACA;AACA;AAbG;AAcC,IAAA,QAAQ,EACPD,QAAQ,GAAGE,SAAH,GAAeC,0BAAgBC,OAAhB,CAAyB,GAAzB,CAfzB;AAiBC,IAAA,IAAI,EAAGJ,QAAQ,GAAGK,YAAH,GAAWH;AAjB3B,KAmBGD,KAnBH,CAdD,CADD;AAsCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button, __experimentalHStack as HStack } from '@wordpress/components';\nimport { sprintf, __, _n } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { check } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\n\nexport default function SaveButton() {\n\tconst { countUnsavedChanges, isDirty, isSaving, isSaveViewOpen } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst {\n\t\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\t\tisSavingEntityRecord,\n\t\t\t} = select( coreStore );\n\t\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\t\tconst { isSaveViewOpened } = select( editSiteStore );\n\t\t\treturn {\n\t\t\t\tisDirty: dirtyEntityRecords.length > 0,\n\t\t\t\tisSaving: dirtyEntityRecords.some( ( record ) =>\n\t\t\t\t\tisSavingEntityRecord( record.kind, record.name, record.key )\n\t\t\t\t),\n\t\t\t\tisSaveViewOpen: isSaveViewOpened(),\n\t\t\t\tcountUnsavedChanges: dirtyEntityRecords.length,\n\t\t\t};\n\t\t}, [] );\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\n\tconst disabled = ! isDirty || isSaving;\n\n\tconst label = disabled ? __( 'Saved' ) : __( 'Save' );\n\n\treturn (\n\t\t<HStack className=\"edit-site-save-hub\" alignment=\"right\" spacing={ 4 }>\n\t\t\t{ isDirty && (\n\t\t\t\t<span>\n\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t// translators: %d: number of unsaved changes (number).\n\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t'%d unsaved change',\n\t\t\t\t\t\t\t'%d unsaved changes',\n\t\t\t\t\t\t\tcountUnsavedChanges\n\t\t\t\t\t\t),\n\t\t\t\t\t\tcountUnsavedChanges\n\t\t\t\t\t) }\n\t\t\t\t</span>\n\t\t\t) }\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-site-save-hub__button\"\n\t\t\t\tvariant={ disabled ? undefined : 'primary' }\n\t\t\t\taria-disabled={ disabled }\n\t\t\t\taria-expanded={ isSaveViewOpen }\n\t\t\t\tisBusy={ isSaving }\n\t\t\t\tonClick={\n\t\t\t\t\tdisabled ? undefined : () => setIsSaveViewOpened( true )\n\t\t\t\t}\n\t\t\t\tlabel={ label }\n\t\t\t\t/*\n\t\t\t\t * We want the tooltip to show the keyboard shortcut only when the\n\t\t\t\t * button does something, i.e. when it's not disabled.\n\t\t\t\t */\n\t\t\t\tshortcut={\n\t\t\t\t\tdisabled ? undefined : displayShortcut.primary( 's' )\n\t\t\t\t}\n\t\t\t\ticon={ disabled ? check : undefined }\n\t\t\t>\n\t\t\t\t{ label }\n\t\t\t</Button>\n\t\t</HStack>\n\t);\n}\n"]}
|
|
@@ -23,7 +23,7 @@ var _sidebarNavigationScreenNavigationMenus = _interopRequireDefault(require("..
|
|
|
23
23
|
|
|
24
24
|
var _sidebarNavigationScreenTemplatesBrowse = _interopRequireDefault(require("../sidebar-navigation-screen-templates-browse"));
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _saveHub = _interopRequireDefault(require("../save-hub"));
|
|
27
27
|
|
|
28
28
|
var _sidebarNavigationScreenNavigationItem = _interopRequireDefault(require("../sidebar-navigation-screen-navigation-item"));
|
|
29
29
|
|
|
@@ -67,9 +67,7 @@ function Sidebar() {
|
|
|
67
67
|
initialPath: initialPath.current
|
|
68
68
|
}, (0, _element.createElement)(SidebarScreens, null)), (0, _element.createElement)("div", {
|
|
69
69
|
className: "edit-site-sidebar__footer"
|
|
70
|
-
}, (0, _element.createElement)(
|
|
71
|
-
showTooltip: false
|
|
72
|
-
})));
|
|
70
|
+
}, (0, _element.createElement)(_saveHub.default, null)));
|
|
73
71
|
}
|
|
74
72
|
|
|
75
73
|
var _default = (0, _element.memo)(Sidebar);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/index.js"],"names":["SidebarScreens","Sidebar","params","urlParams","initialPath","current"],"mappings":";;;;;;;;;AAGA;;AACA;;AAQA;;AACA;;AACA;;AACA;;AAGA;;AACA;;AACA;;AACA;;AACA;;;;;;AAtBA;AACA;AACA;;AAOA;AACA;AACA;AAaA,SAASA,cAAT,GAA0B;AACzB;AAEA,SACC,qDACC,4BAAC,yCAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,4BAAC,oCAAD,OADD,CADD,EAIC,4BAAC,yCAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,4BAAC,+CAAD,OADD,CAJD,EAOC,4BAAC,yCAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,4BAAC,8CAAD,OADD,CAPD,EAUC,4BAAC,yCAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,4BAAC,yCAAD,OADD,CAVD,EAaC,4BAAC,yCAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,4BAAC,+CAAD,OADD,CAbD,EAgBC,4BAAC,yCAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,4BAAC,wCAAD,OADD,CAhBD,CADD;AAsBA;;AAED,SAASC,OAAT,GAAmB;AAClB,QAAM;AAAEC,IAAAA,MAAM,EAAEC;AAAV,MAAwB,0BAA9B;AACA,QAAMC,WAAW,GAAG,qBAAQ,wCAAgBD,SAAhB,CAAR,CAApB;AAEA,SACC,qDACC,4BAAC,2CAAD;AACC,IAAA,SAAS,EAAC,4BADX;AAEC,IAAA,WAAW,EAAGC,WAAW,CAACC;AAF3B,KAIC,4BAAC,cAAD,OAJD,CADD,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/index.js"],"names":["SidebarScreens","Sidebar","params","urlParams","initialPath","current"],"mappings":";;;;;;;;;AAGA;;AACA;;AAQA;;AACA;;AACA;;AACA;;AAGA;;AACA;;AACA;;AACA;;AACA;;;;;;AAtBA;AACA;AACA;;AAOA;AACA;AACA;AAaA,SAASA,cAAT,GAA0B;AACzB;AAEA,SACC,qDACC,4BAAC,yCAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,4BAAC,oCAAD,OADD,CADD,EAIC,4BAAC,yCAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,4BAAC,+CAAD,OADD,CAJD,EAOC,4BAAC,yCAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,4BAAC,8CAAD,OADD,CAPD,EAUC,4BAAC,yCAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,4BAAC,yCAAD,OADD,CAVD,EAaC,4BAAC,yCAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,4BAAC,+CAAD,OADD,CAbD,EAgBC,4BAAC,yCAAD;AAAiB,IAAA,IAAI,EAAC;AAAtB,KACC,4BAAC,wCAAD,OADD,CAhBD,CADD;AAsBA;;AAED,SAASC,OAAT,GAAmB;AAClB,QAAM;AAAEC,IAAAA,MAAM,EAAEC;AAAV,MAAwB,0BAA9B;AACA,QAAMC,WAAW,GAAG,qBAAQ,wCAAgBD,SAAhB,CAAR,CAApB;AAEA,SACC,qDACC,4BAAC,2CAAD;AACC,IAAA,SAAS,EAAC,4BADX;AAEC,IAAA,WAAW,EAAGC,WAAW,CAACC;AAF3B,KAIC,4BAAC,cAAD,OAJD,CADD,EAOC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,gBAAD,OADD,CAPD,CADD;AAaA;;eAEc,mBAAMJ,OAAN,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { memo, useRef } from '@wordpress/element';\nimport {\n\t__experimentalNavigatorProvider as NavigatorProvider,\n\t__experimentalNavigatorScreen as NavigatorScreen,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';\nimport SidebarNavigationScreenTemplates from '../sidebar-navigation-screen-templates';\nimport SidebarNavigationScreenTemplate from '../sidebar-navigation-screen-template';\nimport useSyncPathWithURL, {\n\tgetPathFromURL,\n} from '../sync-state-with-url/use-sync-path-with-url';\nimport SidebarNavigationScreenNavigationMenus from '../sidebar-navigation-screen-navigation-menus';\nimport SidebarNavigationScreenTemplatesBrowse from '../sidebar-navigation-screen-templates-browse';\nimport SaveHub from '../save-hub';\nimport SidebarNavigationScreenNavigationItem from '../sidebar-navigation-screen-navigation-item';\nimport { useLocation } from '../routes';\n\nfunction SidebarScreens() {\n\tuseSyncPathWithURL();\n\n\treturn (\n\t\t<>\n\t\t\t<NavigatorScreen path=\"/\">\n\t\t\t\t<SidebarNavigationScreenMain />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/navigation\">\n\t\t\t\t<SidebarNavigationScreenNavigationMenus />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/navigation/:postType/:postId\">\n\t\t\t\t<SidebarNavigationScreenNavigationItem />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/:postType(wp_template|wp_template_part)\">\n\t\t\t\t<SidebarNavigationScreenTemplates />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/:postType(wp_template|wp_template_part)/all\">\n\t\t\t\t<SidebarNavigationScreenTemplatesBrowse />\n\t\t\t</NavigatorScreen>\n\t\t\t<NavigatorScreen path=\"/:postType(wp_template|wp_template_part)/:postId\">\n\t\t\t\t<SidebarNavigationScreenTemplate />\n\t\t\t</NavigatorScreen>\n\t\t</>\n\t);\n}\n\nfunction Sidebar() {\n\tconst { params: urlParams } = useLocation();\n\tconst initialPath = useRef( getPathFromURL( urlParams ) );\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={ initialPath.current }\n\t\t\t>\n\t\t\t\t<SidebarScreens />\n\t\t\t</NavigatorProvider>\n\t\t\t<div className=\"edit-site-sidebar__footer\">\n\t\t\t\t<SaveHub />\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default memo( Sidebar );\n"]}
|
|
@@ -35,7 +35,8 @@ function SidebarNavigationScreen(_ref) {
|
|
|
35
35
|
isRoot,
|
|
36
36
|
title,
|
|
37
37
|
actions,
|
|
38
|
-
content
|
|
38
|
+
content,
|
|
39
|
+
description
|
|
39
40
|
} = _ref;
|
|
40
41
|
const {
|
|
41
42
|
dashboardLink
|
|
@@ -66,6 +67,8 @@ function SidebarNavigationScreen(_ref) {
|
|
|
66
67
|
className: "edit-site-sidebar-navigation-screen__title"
|
|
67
68
|
}, title), actions), (0, _element.createElement)("nav", {
|
|
68
69
|
className: "edit-site-sidebar-navigation-screen__content"
|
|
69
|
-
},
|
|
70
|
+
}, description && (0, _element.createElement)("p", {
|
|
71
|
+
className: "edit-site-sidebar-navigation-screen__description"
|
|
72
|
+
}, description), content));
|
|
70
73
|
}
|
|
71
74
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen/index.js"],"names":["SidebarNavigationScreen","isRoot","title","actions","content","dashboardLink","select","getSettings","editSiteStore","__experimentalDashboardLink","SidebarButton","chevronRight","chevronLeft"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAjBA;AACA;AACA;;AAUA;AACA;AACA;AAKe,SAASA,uBAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen/index.js"],"names":["SidebarNavigationScreen","isRoot","title","actions","content","description","dashboardLink","select","getSettings","editSiteStore","__experimentalDashboardLink","SidebarButton","chevronRight","chevronLeft"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAjBA;AACA;AACA;;AAUA;AACA;AACA;AAKe,SAASA,uBAAT,OAMX;AAAA,MAN6C;AAChDC,IAAAA,MADgD;AAEhDC,IAAAA,KAFgD;AAGhDC,IAAAA,OAHgD;AAIhDC,IAAAA,OAJgD;AAKhDC,IAAAA;AALgD,GAM7C;AACH,QAAM;AAAEC,IAAAA;AAAF,MAAoB,qBAAaC,MAAF,IAAc;AAClD,UAAM;AAAEC,MAAAA;AAAF,QAAkB,yBAAQD,MAAM,CAAEE,YAAF,CAAd,CAAxB;AACA,WAAO;AACNH,MAAAA,aAAa,EAAEE,WAAW,GAAGE;AADvB,KAAP;AAGA,GALyB,EAKvB,EALuB,CAA1B;AAOA,SACC,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACC,4BAAC,gCAAD;AACC,IAAA,OAAO,EAAG,CADX;AAEC,IAAA,OAAO,EAAC,YAFT;AAGC,IAAA,SAAS,EAAC;AAHX,KAKG,CAAET,MAAF,GACD,4BAAC,iDAAD;AACC,IAAA,EAAE,EAAGU,sBADN;AAEC,IAAA,IAAI,EAAG,qBAAUC,mBAAV,GAAyBC,kBAFjC;AAGC,kBAAa,cAAI,MAAJ;AAHd,IADC,GAOD,4BAAC,sBAAD;AACC,IAAA,IAAI,EAAG,qBAAUD,mBAAV,GAAyBC,kBADjC;AAEC,kBAAa,cAAI,2BAAJ,CAFd;AAGC,IAAA,IAAI,EAAGP,aAAa,IAAI,WAHzB;AAIC,IAAA,KAAK,EAAG,cAAI,WAAJ;AAJT,IAZF,EAmBC;AAAI,IAAA,SAAS,EAAC;AAAd,KACGJ,KADH,CAnBD,EAsBGC,OAtBH,CADD,EA0BC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGE,WAAW,IACZ;AAAG,IAAA,SAAS,EAAC;AAAb,KACGA,WADH,CAFF,EAMGD,OANH,CA1BD,CADD;AAqCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalNavigatorToParentButton as NavigatorToParentButton,\n} from '@wordpress/components';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { chevronRight, chevronLeft } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../private-apis';\nimport SidebarButton from '../sidebar-button';\n\nexport default function SidebarNavigationScreen( {\n\tisRoot,\n\ttitle,\n\tactions,\n\tcontent,\n\tdescription,\n} ) {\n\tconst { dashboardLink } = useSelect( ( select ) => {\n\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\t\treturn {\n\t\t\tdashboardLink: getSettings().__experimentalDashboardLink,\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<VStack spacing={ 2 }>\n\t\t\t<HStack\n\t\t\t\tspacing={ 4 }\n\t\t\t\tjustify=\"flex-start\"\n\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__title-icon\"\n\t\t\t>\n\t\t\t\t{ ! isRoot ? (\n\t\t\t\t\t<NavigatorToParentButton\n\t\t\t\t\t\tas={ SidebarButton }\n\t\t\t\t\t\ticon={ isRTL() ? chevronRight : chevronLeft }\n\t\t\t\t\t\taria-label={ __( 'Back' ) }\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\ticon={ isRTL() ? chevronRight : chevronLeft }\n\t\t\t\t\t\taria-label={ __( 'Navigate to the Dashboard' ) }\n\t\t\t\t\t\thref={ dashboardLink || 'index.php' }\n\t\t\t\t\t\tlabel={ __( 'Dashboard' ) }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<h2 className=\"edit-site-sidebar-navigation-screen__title\">\n\t\t\t\t\t{ title }\n\t\t\t\t</h2>\n\t\t\t\t{ actions }\n\t\t\t</HStack>\n\n\t\t\t<nav className=\"edit-site-sidebar-navigation-screen__content\">\n\t\t\t\t{ description && (\n\t\t\t\t\t<p className=\"edit-site-sidebar-navigation-screen__description\">\n\t\t\t\t\t\t{ description }\n\t\t\t\t\t</p>\n\t\t\t\t) }\n\t\t\t\t{ content }\n\t\t\t</nav>\n\t\t</VStack>\n\t);\n}\n"]}
|
|
@@ -47,6 +47,7 @@ function SidebarNavigationScreenMain() {
|
|
|
47
47
|
return (0, _element.createElement)(_sidebarNavigationScreen.default, {
|
|
48
48
|
isRoot: true,
|
|
49
49
|
title: (0, _i18n.__)('Design'),
|
|
50
|
+
description: (0, _i18n.__)('Customize the appearance of your website using the block editor.'),
|
|
50
51
|
content: (0, _element.createElement)(_components.__experimentalItemGroup, null, !!navigationMenus && navigationMenus.length > 0 && (0, _element.createElement)(_components.__experimentalNavigatorButton, {
|
|
51
52
|
as: _sidebarNavigationItem.default,
|
|
52
53
|
path: "/navigation",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-main/index.js"],"names":["SidebarNavigationScreenMain","navigationMenus","select","getEntityRecords","coreStore","per_page","status","length","SidebarNavigationItem","navigation","layout","symbolFilled"],"mappings":";;;;;;;;;;;AAGA;;AAIA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAhBA;AACA;AACA;;AAUA;AACA;AACA;AAIe,SAASA,2BAAT,GAAuC;AACrD,QAAM;AAAEC,IAAAA;AAAF,MAAsB,qBAAaC,MAAF,IAAc;AACpD,UAAM;AAAEC,MAAAA;AAAF,QAAuBD,MAAM,CAAEE,eAAF,CAAnC;AACA,WAAO;AACNH,MAAAA,eAAe,EAAEE,gBAAgB,CAAE,UAAF,EAAc,eAAd,EAA+B;AAC/DE,QAAAA,QAAQ,EAAE,CAAC,CADoD;AAE/DC,QAAAA,MAAM,EAAE;AAFuD,OAA/B;AAD3B,KAAP;AAMA,GAR2B,CAA5B;AAUA,SACC,4BAAC,gCAAD;AACC,IAAA,MAAM,MADP;AAEC,IAAA,KAAK,EAAG,cAAI,QAAJ,CAFT;AAGC,IAAA,OAAO,EACN,4BAAC,mCAAD,QACG,CAAC,CAAEL,eAAH,IAAsBA,eAAe,CAACM,MAAhB,GAAyB,CAA/C,IACD,4BAAC,yCAAD;AACC,MAAA,EAAE,EAAGC,8BADN;AAEC,MAAA,IAAI,EAAC,aAFN;AAGC,MAAA,WAAW,MAHZ;AAIC,MAAA,IAAI,EAAGC;AAJR,OAMG,cAAI,YAAJ,CANH,CAFF,EAWC,4BAAC,yCAAD;AACC,MAAA,EAAE,EAAGD,8BADN;AAEC,MAAA,IAAI,EAAC,cAFN;AAGC,MAAA,WAAW,MAHZ;AAIC,MAAA,IAAI,EAAGE;AAJR,OAMG,cAAI,WAAJ,CANH,CAXD,EAmBC,4BAAC,yCAAD;AACC,MAAA,EAAE,EAAGF,8BADN;AAEC,MAAA,IAAI,EAAC,mBAFN;AAGC,MAAA,WAAW,MAHZ;AAIC,MAAA,IAAI,EAAGG;AAJR,OAMG,cAAI,gBAAJ,CANH,CAnBD;
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-main/index.js"],"names":["SidebarNavigationScreenMain","navigationMenus","select","getEntityRecords","coreStore","per_page","status","length","SidebarNavigationItem","navigation","layout","symbolFilled"],"mappings":";;;;;;;;;;;AAGA;;AAIA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAhBA;AACA;AACA;;AAUA;AACA;AACA;AAIe,SAASA,2BAAT,GAAuC;AACrD,QAAM;AAAEC,IAAAA;AAAF,MAAsB,qBAAaC,MAAF,IAAc;AACpD,UAAM;AAAEC,MAAAA;AAAF,QAAuBD,MAAM,CAAEE,eAAF,CAAnC;AACA,WAAO;AACNH,MAAAA,eAAe,EAAEE,gBAAgB,CAAE,UAAF,EAAc,eAAd,EAA+B;AAC/DE,QAAAA,QAAQ,EAAE,CAAC,CADoD;AAE/DC,QAAAA,MAAM,EAAE;AAFuD,OAA/B;AAD3B,KAAP;AAMA,GAR2B,CAA5B;AAUA,SACC,4BAAC,gCAAD;AACC,IAAA,MAAM,MADP;AAEC,IAAA,KAAK,EAAG,cAAI,QAAJ,CAFT;AAGC,IAAA,WAAW,EAAG,cACb,kEADa,CAHf;AAMC,IAAA,OAAO,EACN,4BAAC,mCAAD,QACG,CAAC,CAAEL,eAAH,IAAsBA,eAAe,CAACM,MAAhB,GAAyB,CAA/C,IACD,4BAAC,yCAAD;AACC,MAAA,EAAE,EAAGC,8BADN;AAEC,MAAA,IAAI,EAAC,aAFN;AAGC,MAAA,WAAW,MAHZ;AAIC,MAAA,IAAI,EAAGC;AAJR,OAMG,cAAI,YAAJ,CANH,CAFF,EAWC,4BAAC,yCAAD;AACC,MAAA,EAAE,EAAGD,8BADN;AAEC,MAAA,IAAI,EAAC,cAFN;AAGC,MAAA,WAAW,MAHZ;AAIC,MAAA,IAAI,EAAGE;AAJR,OAMG,cAAI,WAAJ,CANH,CAXD,EAmBC,4BAAC,yCAAD;AACC,MAAA,EAAE,EAAGF,8BADN;AAEC,MAAA,IAAI,EAAC,mBAFN;AAGC,MAAA,WAAW,MAHZ;AAIC,MAAA,IAAI,EAAGG;AAJR,OAMG,cAAI,gBAAJ,CANH,CAnBD;AAPF,IADD;AAuCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalNavigatorButton as NavigatorButton,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { layout, symbolFilled, navigation } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\n\nexport default function SidebarNavigationScreenMain() {\n\tconst { navigationMenus } = useSelect( ( select ) => {\n\t\tconst { getEntityRecords } = select( coreStore );\n\t\treturn {\n\t\t\tnavigationMenus: getEntityRecords( 'postType', 'wp_navigation', {\n\t\t\t\tper_page: -1,\n\t\t\t\tstatus: 'publish',\n\t\t\t} ),\n\t\t};\n\t} );\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\tisRoot\n\t\t\ttitle={ __( 'Design' ) }\n\t\t\tdescription={ __(\n\t\t\t\t'Customize the appearance of your website using the block editor.'\n\t\t\t) }\n\t\t\tcontent={\n\t\t\t\t<ItemGroup>\n\t\t\t\t\t{ !! navigationMenus && navigationMenus.length > 0 && (\n\t\t\t\t\t\t<NavigatorButton\n\t\t\t\t\t\t\tas={ SidebarNavigationItem }\n\t\t\t\t\t\t\tpath=\"/navigation\"\n\t\t\t\t\t\t\twithChevron\n\t\t\t\t\t\t\ticon={ navigation }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Navigation' ) }\n\t\t\t\t\t\t</NavigatorButton>\n\t\t\t\t\t) }\n\t\t\t\t\t<NavigatorButton\n\t\t\t\t\t\tas={ SidebarNavigationItem }\n\t\t\t\t\t\tpath=\"/wp_template\"\n\t\t\t\t\t\twithChevron\n\t\t\t\t\t\ticon={ layout }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Templates' ) }\n\t\t\t\t\t</NavigatorButton>\n\t\t\t\t\t<NavigatorButton\n\t\t\t\t\t\tas={ SidebarNavigationItem }\n\t\t\t\t\t\tpath=\"/wp_template_part\"\n\t\t\t\t\t\twithChevron\n\t\t\t\t\t\ticon={ symbolFilled }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Template Parts' ) }\n\t\t\t\t\t</NavigatorButton>\n\t\t\t\t</ItemGroup>\n\t\t\t}\n\t\t/>\n\t);\n}\n"]}
|
|
@@ -37,7 +37,7 @@ var _sidebarButton = _interopRequireDefault(require("../sidebar-button"));
|
|
|
37
37
|
* Internal dependencies
|
|
38
38
|
*/
|
|
39
39
|
function SidebarNavigationScreenNavigationItem() {
|
|
40
|
-
var
|
|
40
|
+
var _record$title, _record$description;
|
|
41
41
|
|
|
42
42
|
const {
|
|
43
43
|
setCanvasMode
|
|
@@ -49,25 +49,20 @@ function SidebarNavigationScreenNavigationItem() {
|
|
|
49
49
|
}
|
|
50
50
|
} = (0, _components.__experimentalUseNavigator)();
|
|
51
51
|
const {
|
|
52
|
-
|
|
53
|
-
} = (0,
|
|
54
|
-
const {
|
|
55
|
-
getEntityRecord
|
|
56
|
-
} = select(_coreData.store); // The currently selected entity to display.
|
|
57
|
-
// Typically template or template part in the site editor.
|
|
58
|
-
|
|
59
|
-
return {
|
|
60
|
-
post: postId && postType ? getEntityRecord('postType', postType, postId) : null
|
|
61
|
-
};
|
|
62
|
-
}, [postType, postId]);
|
|
52
|
+
record
|
|
53
|
+
} = (0, _coreData.useEntityRecord)('postType', postType, postId);
|
|
63
54
|
return (0, _element.createElement)(_sidebarNavigationScreen.default, {
|
|
64
|
-
title:
|
|
55
|
+
title: record ? (0, _htmlEntities.decodeEntities)(record === null || record === void 0 ? void 0 : (_record$title = record.title) === null || _record$title === void 0 ? void 0 : _record$title.rendered) : null,
|
|
65
56
|
actions: (0, _element.createElement)(_sidebarButton.default, {
|
|
66
57
|
onClick: () => setCanvasMode('edit'),
|
|
67
58
|
label: (0, _i18n.__)('Edit'),
|
|
68
59
|
icon: _icons.pencil
|
|
69
60
|
}),
|
|
70
|
-
|
|
61
|
+
description: postType === 'page' ? (0, _i18n.__)('Pages are static and are not listed by date. Pages do not use tags or categories.') : (0, _i18n.__)('Posts are entries listed in reverse chronological order on the site homepage or on the posts page.'),
|
|
62
|
+
content: (0, _element.createElement)(_element.Fragment, null, record !== null && record !== void 0 && record.link ? (0, _element.createElement)(_components.ExternalLink, {
|
|
63
|
+
className: "edit-site-sidebar-navigation-screen__page-link",
|
|
64
|
+
href: record.link
|
|
65
|
+
}, record.link) : null, record ? (0, _htmlEntities.decodeEntities)(record === null || record === void 0 ? void 0 : (_record$description = record.description) === null || _record$description === void 0 ? void 0 : _record$description.rendered) : null)
|
|
71
66
|
});
|
|
72
67
|
}
|
|
73
68
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-item/index.js"],"names":["SidebarNavigationScreenNavigationItem","setCanvasMode","editSiteStore","params","postType","postId","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-item/index.js"],"names":["SidebarNavigationScreenNavigationItem","setCanvasMode","editSiteStore","params","postType","postId","record","title","rendered","pencil","link","description"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AAIA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAnBA;AACA;AACA;;AAWA;AACA;AACA;AAMe,SAASA,qCAAT,GAAiD;AAAA;;AAC/D,QAAM;AAAEC,IAAAA;AAAF,MAAoB,yBAAQ,uBAAaC,YAAb,CAAR,CAA1B;AACA,QAAM;AACLC,IAAAA,MAAM,EAAE;AAAEC,MAAAA,QAAF;AAAYC,MAAAA;AAAZ;AADH,MAEF,6CAFJ;AAGA,QAAM;AAAEC,IAAAA;AAAF,MAAa,+BAAiB,UAAjB,EAA6BF,QAA7B,EAAuCC,MAAvC,CAAnB;AAEA,SACC,4BAAC,gCAAD;AACC,IAAA,KAAK,EAAGC,MAAM,GAAG,kCAAgBA,MAAhB,aAAgBA,MAAhB,wCAAgBA,MAAM,CAAEC,KAAxB,kDAAgB,cAAeC,QAA/B,CAAH,GAA+C,IAD9D;AAEC,IAAA,OAAO,EACN,4BAAC,sBAAD;AACC,MAAA,OAAO,EAAG,MAAMP,aAAa,CAAE,MAAF,CAD9B;AAEC,MAAA,KAAK,EAAG,cAAI,MAAJ,CAFT;AAGC,MAAA,IAAI,EAAGQ;AAHR,MAHF;AASC,IAAA,WAAW,EACVL,QAAQ,KAAK,MAAb,GACG,cACA,mFADA,CADH,GAIG,cACA,oGADA,CAdL;AAkBC,IAAA,OAAO,EACN,qDACGE,MAAM,SAAN,IAAAA,MAAM,WAAN,IAAAA,MAAM,CAAEI,IAAR,GACD,4BAAC,wBAAD;AACC,MAAA,SAAS,EAAC,gDADX;AAEC,MAAA,IAAI,EAAGJ,MAAM,CAACI;AAFf,OAIGJ,MAAM,CAACI,IAJV,CADC,GAOE,IARL,EASGJ,MAAM,GACL,kCAAgBA,MAAhB,aAAgBA,MAAhB,8CAAgBA,MAAM,CAAEK,WAAxB,wDAAgB,oBAAqBH,QAArC,CADK,GAEL,IAXJ;AAnBF,IADD;AAoCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport {\n\t__experimentalUseNavigator as useNavigator,\n\tExternalLink,\n} from '@wordpress/components';\nimport { useEntityRecord } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { pencil } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport { unlock } from '../../private-apis';\nimport { store as editSiteStore } from '../../store';\nimport SidebarButton from '../sidebar-button';\n\nexport default function SidebarNavigationScreenNavigationItem() {\n\tconst { setCanvasMode } = unlock( useDispatch( editSiteStore ) );\n\tconst {\n\t\tparams: { postType, postId },\n\t} = useNavigator();\n\tconst { record } = useEntityRecord( 'postType', postType, postId );\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\ttitle={ record ? decodeEntities( record?.title?.rendered ) : null }\n\t\t\tactions={\n\t\t\t\t<SidebarButton\n\t\t\t\t\tonClick={ () => setCanvasMode( 'edit' ) }\n\t\t\t\t\tlabel={ __( 'Edit' ) }\n\t\t\t\t\ticon={ pencil }\n\t\t\t\t/>\n\t\t\t}\n\t\t\tdescription={\n\t\t\t\tpostType === 'page'\n\t\t\t\t\t? __(\n\t\t\t\t\t\t\t'Pages are static and are not listed by date. Pages do not use tags or categories.'\n\t\t\t\t\t )\n\t\t\t\t\t: __(\n\t\t\t\t\t\t\t'Posts are entries listed in reverse chronological order on the site homepage or on the posts page.'\n\t\t\t\t\t )\n\t\t\t}\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t{ record?.link ? (\n\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__page-link\"\n\t\t\t\t\t\t\thref={ record.link }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ record.link }\n\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t) : null }\n\t\t\t\t\t{ record\n\t\t\t\t\t\t? decodeEntities( record?.description?.rendered )\n\t\t\t\t\t\t: null }\n\t\t\t\t</>\n\t\t\t}\n\t\t/>\n\t);\n}\n"]}
|