@wordpress/edit-site 5.12.11 → 5.12.12
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/global-styles/screen-revisions/index.js +8 -2
- package/build/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +31 -25
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build/components/keyboard-shortcuts/edit-mode.js +7 -5
- package/build/components/keyboard-shortcuts/edit-mode.js.map +1 -1
- package/build/components/layout/index.js +6 -0
- package/build/components/layout/index.js.map +1 -1
- package/build/components/page-template-parts/index.js +1 -2
- package/build/components/page-template-parts/index.js.map +1 -1
- package/build/components/resizable-frame/index.js +11 -19
- package/build/components/resizable-frame/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +15 -13
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +8 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pages/index.js +2 -0
- package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/index.js +0 -9
- package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates/index.js +1 -10
- package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/index.js +9 -0
- package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build/hooks/commands/use-edit-mode-commands.js +30 -0
- package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build/store/private-actions.js +2 -1
- package/build/store/private-actions.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/index.js +9 -3
- package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +27 -21
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/edit-mode.js +7 -5
- package/build-module/components/keyboard-shortcuts/edit-mode.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/page-template-parts/index.js +1 -2
- package/build-module/components/page-template-parts/index.js.map +1 -1
- package/build-module/components/resizable-frame/index.js +12 -20
- package/build-module/components/resizable-frame/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +13 -13
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +7 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pages/index.js +2 -0
- package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.js +0 -7
- package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates/index.js +1 -8
- package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +7 -0
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build-module/hooks/commands/use-edit-mode-commands.js +29 -0
- package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build-module/store/private-actions.js +2 -1
- package/build-module/store/private-actions.js.map +1 -1
- package/build-style/style-rtl.css +3 -0
- package/build-style/style.css +3 -0
- package/package.json +20 -20
- package/src/components/global-styles/screen-revisions/index.js +76 -58
- package/src/components/global-styles/screen-revisions/test/use-global-styles-revisions.js +14 -1
- package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +63 -48
- package/src/components/keyboard-shortcuts/edit-mode.js +4 -5
- package/src/components/layout/index.js +6 -0
- package/src/components/page-patterns/style.scss +3 -0
- package/src/components/page-template-parts/index.js +0 -1
- package/src/components/resizable-frame/index.js +10 -25
- package/src/components/sidebar-navigation-screen/index.js +13 -15
- package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +27 -15
- package/src/components/sidebar-navigation-screen-pages/index.js +9 -4
- package/src/components/sidebar-navigation-screen-patterns/index.js +0 -8
- package/src/components/sidebar-navigation-screen-templates/index.js +1 -9
- package/src/components/sidebar-navigation-screen-templates-browse/index.js +10 -0
- package/src/hooks/commands/use-edit-mode-commands.js +34 -3
- package/src/store/private-actions.js +5 -1
|
@@ -101,12 +101,13 @@ function ScreenRevisions() {
|
|
|
101
101
|
};
|
|
102
102
|
|
|
103
103
|
const isLoadButtonEnabled = !!globalStylesRevision?.id && !areGlobalStyleConfigsEqual(globalStylesRevision, userConfig);
|
|
104
|
+
const shouldShowRevisions = !isLoading && revisions.length;
|
|
104
105
|
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_header.default, {
|
|
105
106
|
title: (0, _i18n.__)('Revisions'),
|
|
106
107
|
description: (0, _i18n.__)('Revisions are added to the timeline when style changes are saved.')
|
|
107
108
|
}), isLoading && (0, _element.createElement)(_components.Spinner, {
|
|
108
109
|
className: "edit-site-global-styles-screen-revisions__loading"
|
|
109
|
-
}),
|
|
110
|
+
}), shouldShowRevisions ? (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_revisions.default, {
|
|
110
111
|
blocks: blocks,
|
|
111
112
|
userConfig: globalStylesRevision,
|
|
112
113
|
onClose: onCloseRevisions
|
|
@@ -133,7 +134,12 @@ function ScreenRevisions() {
|
|
|
133
134
|
confirmButtonText: (0, _i18n.__)(' Discard unsaved changes'),
|
|
134
135
|
onConfirm: () => restoreRevision(globalStylesRevision),
|
|
135
136
|
onCancel: () => setIsLoadingRevisionWithUnsavedChanges(false)
|
|
136
|
-
}, (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)("h2", null, (0, _i18n.__)('Loading this revision will discard all unsaved changes.')), (0, _element.createElement)("p", null, (0, _i18n.__)('Do you want to replace your unsaved changes in the editor?')))))
|
|
137
|
+
}, (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)("h2", null, (0, _i18n.__)('Loading this revision will discard all unsaved changes.')), (0, _element.createElement)("p", null, (0, _i18n.__)('Do you want to replace your unsaved changes in the editor?'))))) : (0, _element.createElement)(_components.__experimentalSpacer, {
|
|
138
|
+
marginX: 4,
|
|
139
|
+
"data-testid": "global-styles-no-revisions"
|
|
140
|
+
}, // Adding an existing translation here in case these changes are shipped to WordPress 6.3.
|
|
141
|
+
// Later we could update to something better, e.g., "There are currently no style revisions.".
|
|
142
|
+
(0, _i18n.__)('No results found.')));
|
|
137
143
|
}
|
|
138
144
|
|
|
139
145
|
var _default = ScreenRevisions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-revisions/index.js"],"names":["GlobalStylesContext","areGlobalStyleConfigsEqual","blockEditorPrivateApis","ScreenRevisions","goBack","user","userConfig","setUserConfig","blocks","editorCanvasContainerView","select","editSiteStore","getEditorCanvasContainerView","blockEditorStore","getBlocks","revisions","isLoading","hasUnsavedChanges","selectedRevisionId","setSelectedRevisionId","globalStylesRevision","setGlobalStylesRevision","isLoadingRevisionWithUnsavedChanges","setIsLoadingRevisionWithUnsavedChanges","setEditorCanvasContainerView","onCloseRevisions","restoreRevision","revision","styles","settings","selectRevision","id","isLoadButtonEnabled"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-revisions/index.js"],"names":["GlobalStylesContext","areGlobalStyleConfigsEqual","blockEditorPrivateApis","ScreenRevisions","goBack","user","userConfig","setUserConfig","blocks","editorCanvasContainerView","select","editSiteStore","getEditorCanvasContainerView","blockEditorStore","getBlocks","revisions","isLoading","hasUnsavedChanges","selectedRevisionId","setSelectedRevisionId","globalStylesRevision","setGlobalStylesRevision","isLoadingRevisionWithUnsavedChanges","setIsLoadingRevisionWithUnsavedChanges","setEditorCanvasContainerView","onCloseRevisions","restoreRevision","revision","styles","settings","selectRevision","id","isLoadButtonEnabled","shouldShowRevisions","length"],"mappings":";;;;;;;;;AAYA;;AATA;;AACA;;AAOA;;AAEA;;AAQA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AA3BA;AACA;AACA;;AAgBA;AACA;AACA;AASA,MAAM;AAAEA,EAAAA,mBAAF;AAAuBC,EAAAA;AAAvB,IAAsD,wBAC3DC,wBAD2D,CAA5D;;AAIA,SAASC,eAAT,GAA2B;AAC1B,QAAM;AAAEC,IAAAA;AAAF,MAAa,6CAAnB;AACA,QAAM;AAAEC,IAAAA,IAAI,EAAEC,UAAR;AAAoBC,IAAAA;AAApB,MACL,yBAAYP,mBAAZ,CADD;AAEA,QAAM;AAAEQ,IAAAA,MAAF;AAAUC,IAAAA;AAAV,MAAwC,qBAAaC,MAAF,IAAc;AACtE,WAAO;AACND,MAAAA,yBAAyB,EAAE,wBAC1BC,MAAM,CAAEC,YAAF,CADoB,EAEzBC,4BAFyB,EADrB;AAINJ,MAAAA,MAAM,EAAEE,MAAM,CAAEG,kBAAF,CAAN,CAA2BC,SAA3B;AAJF,KAAP;AAMA,GAP6C,EAO3C,EAP2C,CAA9C;AAQA,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA,SAAb;AAAwBC,IAAAA;AAAxB,MACL,wCADD;AAEA,QAAM,CAAEC,kBAAF,EAAsBC,qBAAtB,IAAgD,wBAAtD;AACA,QAAM,CAAEC,oBAAF,EAAwBC,uBAAxB,IACL,uBAAUf,UAAV,CADD;AAEA,QAAM,CACLgB,mCADK,EAELC,sCAFK,IAGF,uBAAU,KAAV,CAHJ;AAIA,QAAM;AAAEC,IAAAA;AAAF,MAAmC,wBACxC,uBAAab,YAAb,CADwC,CAAzC;AAIA,0BAAW,MAAM;AAChB,QAAKF,yBAAyB,KAAK,yBAAnC,EAA+D;AAC9DL,MA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AAO,EAAGK;AAHX,IADD,EAMC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,yBAAD;AACC,IAAA,QAAQ,EAAGK,cADZ;AAEC,IAAA,kBAAkB,EAAGZ,kBAFtB;AAGC,IAAA,aAAa,EAAGH;AAHjB,IADD,EAMGiB,mBAAmB,IACpB,4BAAC,2BAAD,QACC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAC,SADT;AAEC,IAAA,SAAS,EAAC,kDAFX;AAGC,IAAA,QAAQ,EACP,CAAEZ,oBAAoB,EAAEW,EAAxB,IACAX,oBAAoB,EAAEW,EAAtB,KAA6B,SAL/B;AAOC,IAAA,OAAO,EAAG,MAAM;AACf,UAAKd,iBAAL,EAAyB;AACxBM,QAAAA,sCAAsC,CACrC,IADqC,CAAtC;AAGA,OAJD,MAIO;AACNG,QAAAA,eAAe,CACdN,oBADc,CAAf;AAGA;AACD;AAjBF,KAmBG,cAAI,OAAJ,CAnBH,CADD,CAPF,CAND,EAsCGE,mCAAmC,IACpC,4BAAC,uCAAD;AACC,IAAA,KAAK,EAAG,cACP,yDADO,CADT;AAIC,IAAA,MAAM,EAAGA,mCAJV;AAKC,IAAA,iBAAiB,EAAG,cACnB,0BADmB,CALrB;AAQC,IAAA,SAAS,EAAG,MACXI,eAAe,CAAEN,oBAAF,CATjB;AAWC,IAAA,QAAQ,EAAG,MACVG,sCAAsC,CAAE,KAAF;AAZxC,KAeC,qDACC,wCACG,cACD,yDADC,CADH,CADD,EAMC,uCACG,cACD,4DADC,CADH,CAND,CAfD,CAvCF,CADoB,GAuEpB,4BAAC,gCAAD;AAAQ,IAAA,OAAO,EAAG,CAAlB;AAAsB,mBAAY;AAAlC,KAEE;AACA;AACA,gBAAI,mBAAJ,CAJF,CAjFF,CADD;AA4FA;;eAEcpB,e","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tButton,\n\t__experimentalUseNavigator as useNavigator,\n\t__experimentalConfirmDialog as ConfirmDialog,\n\tSpinner,\n\t__experimentalSpacer as Spacer,\n} from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useContext, useState, useEffect } from '@wordpress/element';\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport ScreenHeader from '../header';\nimport { unlock } from '../../../lock-unlock';\nimport Revisions from '../../revisions';\nimport SidebarFixedBottom from '../../sidebar-edit-mode/sidebar-fixed-bottom';\nimport { store as editSiteStore } from '../../../store';\nimport useGlobalStylesRevisions from './use-global-styles-revisions';\nimport RevisionsButtons from './revisions-buttons';\n\nconst { GlobalStylesContext, areGlobalStyleConfigsEqual } = unlock(\n\tblockEditorPrivateApis\n);\n\nfunction ScreenRevisions() {\n\tconst { goBack } = useNavigator();\n\tconst { user: userConfig, setUserConfig } =\n\t\tuseContext( GlobalStylesContext );\n\tconst { blocks, editorCanvasContainerView } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\teditorCanvasContainerView: unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t).getEditorCanvasContainerView(),\n\t\t\tblocks: select( blockEditorStore ).getBlocks(),\n\t\t};\n\t}, [] );\n\tconst { revisions, isLoading, hasUnsavedChanges } =\n\t\tuseGlobalStylesRevisions();\n\tconst [ selectedRevisionId, setSelectedRevisionId ] = useState();\n\tconst [ globalStylesRevision, setGlobalStylesRevision ] =\n\t\tuseState( userConfig );\n\tconst [\n\t\tisLoadingRevisionWithUnsavedChanges,\n\t\tsetIsLoadingRevisionWithUnsavedChanges,\n\t] = useState( false );\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\n\tuseEffect( () => {\n\t\tif ( editorCanvasContainerView !== 'global-styles-revisions' ) {\n\t\t\tgoBack();\n\t\t\tsetEditorCanvasContainerView( editorCanvasContainerView );\n\t\t}\n\t}, [ editorCanvasContainerView ] );\n\n\tconst onCloseRevisions = () => {\n\t\tgoBack();\n\t};\n\n\tconst restoreRevision = ( revision ) => {\n\t\tsetUserConfig( () => ( {\n\t\t\tstyles: revision?.styles,\n\t\t\tsettings: revision?.settings,\n\t\t} ) );\n\t\tsetIsLoadingRevisionWithUnsavedChanges( false );\n\t\tonCloseRevisions();\n\t};\n\n\tconst selectRevision = ( revision ) => {\n\t\tsetGlobalStylesRevision( {\n\t\t\tstyles: revision?.styles,\n\t\t\tsettings: revision?.settings,\n\t\t\tid: revision?.id,\n\t\t} );\n\t\tsetSelectedRevisionId( revision?.id );\n\t};\n\n\tconst isLoadButtonEnabled =\n\t\t!! globalStylesRevision?.id &&\n\t\t! areGlobalStyleConfigsEqual( globalStylesRevision, userConfig );\n\tconst shouldShowRevisions = ! isLoading && revisions.length;\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ __( 'Revisions' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Revisions are added to the timeline when style changes are saved.'\n\t\t\t\t) }\n\t\t\t/>\n\t\t\t{ isLoading && (\n\t\t\t\t<Spinner className=\"edit-site-global-styles-screen-revisions__loading\" />\n\t\t\t) }\n\t\t\t{ shouldShowRevisions ? (\n\t\t\t\t<>\n\t\t\t\t\t<Revisions\n\t\t\t\t\t\tblocks={ blocks }\n\t\t\t\t\t\tuserConfig={ globalStylesRevision }\n\t\t\t\t\t\tonClose={ onCloseRevisions }\n\t\t\t\t\t/>\n\t\t\t\t\t<div className=\"edit-site-global-styles-screen-revisions\">\n\t\t\t\t\t\t<RevisionsButtons\n\t\t\t\t\t\t\tonChange={ selectRevision }\n\t\t\t\t\t\t\tselectedRevisionId={ selectedRevisionId }\n\t\t\t\t\t\t\tuserRevisions={ revisions }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ isLoadButtonEnabled && (\n\t\t\t\t\t\t\t<SidebarFixedBottom>\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\t\tclassName=\"edit-site-global-styles-screen-revisions__button\"\n\t\t\t\t\t\t\t\t\tdisabled={\n\t\t\t\t\t\t\t\t\t\t! globalStylesRevision?.id ||\n\t\t\t\t\t\t\t\t\t\tglobalStylesRevision?.id === 'unsaved'\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tif ( hasUnsavedChanges ) {\n\t\t\t\t\t\t\t\t\t\t\tsetIsLoadingRevisionWithUnsavedChanges(\n\t\t\t\t\t\t\t\t\t\t\t\ttrue\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\trestoreRevision(\n\t\t\t\t\t\t\t\t\t\t\t\tglobalStylesRevision\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\t\t{ __( 'Apply' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</SidebarFixedBottom>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</div>\n\t\t\t\t\t{ isLoadingRevisionWithUnsavedChanges && (\n\t\t\t\t\t\t<ConfirmDialog\n\t\t\t\t\t\t\ttitle={ __(\n\t\t\t\t\t\t\t\t'Loading this revision will discard all unsaved changes.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tisOpen={ isLoadingRevisionWithUnsavedChanges }\n\t\t\t\t\t\t\tconfirmButtonText={ __(\n\t\t\t\t\t\t\t\t' Discard unsaved changes'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tonConfirm={ () =>\n\t\t\t\t\t\t\t\trestoreRevision( globalStylesRevision )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonCancel={ () =>\n\t\t\t\t\t\t\t\tsetIsLoadingRevisionWithUnsavedChanges( false )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<h2>\n\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t'Loading this revision will discard all unsaved changes.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t'Do you want to replace your unsaved changes in the editor?'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t</ConfirmDialog>\n\t\t\t\t\t) }\n\t\t\t\t</>\n\t\t\t) : (\n\t\t\t\t<Spacer marginX={ 4 } data-testid=\"global-styles-no-revisions\">\n\t\t\t\t\t{\n\t\t\t\t\t\t// Adding an existing translation here in case these changes are shipped to WordPress 6.3.\n\t\t\t\t\t\t// Later we could update to something better, e.g., \"There are currently no style revisions.\".\n\t\t\t\t\t\t__( 'No results found.' )\n\t\t\t\t\t}\n\t\t\t\t</Spacer>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default ScreenRevisions;\n"]}
|
|
@@ -41,13 +41,15 @@ function useGlobalStylesRevisions() {
|
|
|
41
41
|
authors,
|
|
42
42
|
currentUser,
|
|
43
43
|
isDirty,
|
|
44
|
-
revisions
|
|
44
|
+
revisions,
|
|
45
|
+
isLoadingGlobalStylesRevisions
|
|
45
46
|
} = (0, _data.useSelect)(select => {
|
|
46
47
|
const {
|
|
47
48
|
__experimentalGetDirtyEntityRecords,
|
|
48
49
|
getCurrentUser,
|
|
49
50
|
getUsers,
|
|
50
|
-
getCurrentThemeGlobalStylesRevisions
|
|
51
|
+
getCurrentThemeGlobalStylesRevisions,
|
|
52
|
+
isResolving
|
|
51
53
|
} = select(_coreData.store);
|
|
52
54
|
|
|
53
55
|
const dirtyEntityRecords = __experimentalGetDirtyEntityRecords();
|
|
@@ -64,13 +66,14 @@ function useGlobalStylesRevisions() {
|
|
|
64
66
|
authors: _authors,
|
|
65
67
|
currentUser: _currentUser,
|
|
66
68
|
isDirty: _isDirty,
|
|
67
|
-
revisions: globalStylesRevisions
|
|
69
|
+
revisions: globalStylesRevisions,
|
|
70
|
+
isLoadingGlobalStylesRevisions: isResolving('getCurrentThemeGlobalStylesRevisions')
|
|
68
71
|
};
|
|
69
72
|
}, []);
|
|
70
73
|
return (0, _element.useMemo)(() => {
|
|
71
74
|
let _modifiedRevisions = [];
|
|
72
75
|
|
|
73
|
-
if (!authors.length ||
|
|
76
|
+
if (!authors.length || isLoadingGlobalStylesRevisions) {
|
|
74
77
|
return {
|
|
75
78
|
revisions: _modifiedRevisions,
|
|
76
79
|
hasUnsavedChanges: isDirty,
|
|
@@ -83,26 +86,29 @@ function useGlobalStylesRevisions() {
|
|
|
83
86
|
return { ...revision,
|
|
84
87
|
author: authors.find(author => author.id === revision.author)
|
|
85
88
|
};
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
if (_modifiedRevisions
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
if (_modifiedRevisions.length) {
|
|
92
|
+
// Flags the most current saved revision.
|
|
93
|
+
if (_modifiedRevisions[0].id !== 'unsaved') {
|
|
94
|
+
_modifiedRevisions[0].isLatest = true;
|
|
95
|
+
} // Adds an item for unsaved changes.
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
if (isDirty && userConfig && Object.keys(userConfig).length > 0 && currentUser) {
|
|
99
|
+
const unsavedRevision = {
|
|
100
|
+
id: 'unsaved',
|
|
101
|
+
styles: userConfig?.styles,
|
|
102
|
+
settings: userConfig?.settings,
|
|
103
|
+
author: {
|
|
104
|
+
name: currentUser?.name,
|
|
105
|
+
avatar_urls: currentUser?.avatar_urls
|
|
106
|
+
},
|
|
107
|
+
modified: new Date()
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
_modifiedRevisions.unshift(unsavedRevision);
|
|
111
|
+
}
|
|
106
112
|
}
|
|
107
113
|
|
|
108
114
|
return {
|
|
@@ -110,6 +116,6 @@ function useGlobalStylesRevisions() {
|
|
|
110
116
|
hasUnsavedChanges: isDirty,
|
|
111
117
|
isLoading: false
|
|
112
118
|
};
|
|
113
|
-
}, [isDirty, revisions, currentUser, authors, userConfig]);
|
|
119
|
+
}, [isDirty, revisions, currentUser, authors, userConfig, isLoadingGlobalStylesRevisions]);
|
|
114
120
|
}
|
|
115
121
|
//# sourceMappingURL=use-global-styles-revisions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-revisions/use-global-styles-revisions.js"],"names":["SITE_EDITOR_AUTHORS_QUERY","per_page","_fields","context","capabilities","EMPTY_ARRAY","GlobalStylesContext","blockEditorPrivateApis","useGlobalStylesRevisions","user","userConfig","authors","currentUser","isDirty","revisions","select","__experimentalGetDirtyEntityRecords","getCurrentUser","getUsers","getCurrentThemeGlobalStylesRevisions","coreStore","dirtyEntityRecords","_currentUser","_isDirty","length","globalStylesRevisions","_authors","_modifiedRevisions","hasUnsavedChanges","isLoading","map","revision","author","find","id","isLatest","Object","keys","unsavedRevision","styles","settings","name","avatar_urls","modified","Date","unshift"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AACA;;AAKA;;AAXA;AACA;AACA;;AAMA;AACA;AACA;AAGA,MAAMA,yBAAyB,GAAG;AACjCC,EAAAA,QAAQ,EAAE,CAAC,CADsB;AAEjCC,EAAAA,OAAO,EAAE,qBAFwB;AAGjCC,EAAAA,OAAO,EAAE,MAHwB;AAIjCC,EAAAA,YAAY,EAAE,CAAE,oBAAF;AAJmB,CAAlC;AAMA,MAAMC,WAAW,GAAG,EAApB;AACA,MAAM;AAAEC,EAAAA;AAAF,IAA0B,wBAAQC,wBAAR,CAAhC;;AACe,SAASC,wBAAT,GAAoC;AAClD,QAAM;AAAEC,IAAAA,IAAI,EAAEC;AAAR,MAAuB,yBAAYJ,mBAAZ,CAA7B;AACA,QAAM;
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-revisions/use-global-styles-revisions.js"],"names":["SITE_EDITOR_AUTHORS_QUERY","per_page","_fields","context","capabilities","EMPTY_ARRAY","GlobalStylesContext","blockEditorPrivateApis","useGlobalStylesRevisions","user","userConfig","authors","currentUser","isDirty","revisions","isLoadingGlobalStylesRevisions","select","__experimentalGetDirtyEntityRecords","getCurrentUser","getUsers","getCurrentThemeGlobalStylesRevisions","isResolving","coreStore","dirtyEntityRecords","_currentUser","_isDirty","length","globalStylesRevisions","_authors","_modifiedRevisions","hasUnsavedChanges","isLoading","map","revision","author","find","id","isLatest","Object","keys","unsavedRevision","styles","settings","name","avatar_urls","modified","Date","unshift"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AACA;;AAKA;;AAXA;AACA;AACA;;AAMA;AACA;AACA;AAGA,MAAMA,yBAAyB,GAAG;AACjCC,EAAAA,QAAQ,EAAE,CAAC,CADsB;AAEjCC,EAAAA,OAAO,EAAE,qBAFwB;AAGjCC,EAAAA,OAAO,EAAE,MAHwB;AAIjCC,EAAAA,YAAY,EAAE,CAAE,oBAAF;AAJmB,CAAlC;AAMA,MAAMC,WAAW,GAAG,EAApB;AACA,MAAM;AAAEC,EAAAA;AAAF,IAA0B,wBAAQC,wBAAR,CAAhC;;AACe,SAASC,wBAAT,GAAoC;AAClD,QAAM;AAAEC,IAAAA,IAAI,EAAEC;AAAR,MAAuB,yBAAYJ,mBAAZ,CAA7B;AACA,QAAM;AACLK,IAAAA,OADK;AAELC,IAAAA,WAFK;AAGLC,IAAAA,OAHK;A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B;;AASA,QAAKL,kBAAkB,CAACH,MAAxB,EAAiC;AAChC;AACA,UAAKG,kBAAkB,CAAE,CAAF,CAAlB,CAAwBO,EAAxB,KAA+B,SAApC,EAAgD;AAC/CP,QAAAA,kBAAkB,CAAE,CAAF,CAAlB,CAAwBQ,QAAxB,GAAmC,IAAnC;AACA,OAJ+B,CAMhC;;;AACA,UACCxB,OAAO,IACPH,UADA,IAEA4B,MAAM,CAACC,IAAP,CAAa7B,UAAb,EAA0BgB,MAA1B,GAAmC,CAFnC,IAGAd,WAJD,EAKE;AACD,cAAM4B,eAAe,GAAG;AACvBJ,UAAAA,EAAE,EAAE,SADmB;AAEvBK,UAAAA,MAAM,EAAE/B,UAAU,EAAE+B,MAFG;AAGvBC,UAAAA,QAAQ,EAAEhC,UAAU,EAAEgC,QAHC;AAIvBR,UAAAA,MAAM,EAAE;AACPS,YAAAA,IAAI,EAAE/B,WAAW,EAAE+B,IADZ;AAEPC,YAAAA,WAAW,EAAEhC,WAAW,EAAEgC;AAFnB,WAJe;AAQvBC,UAAAA,QAAQ,EAAE,IAAIC,IAAJ;AARa,SAAxB;;AAWAjB,QAAAA,kBAAkB,CAACkB,OAAnB,CAA4BP,eAA5B;AACA;AACD;;AAED,WAAO;AACN1B,MAAAA,SAAS,EAAEe,kBADL;AAENC,MAAAA,iBAAiB,EAAEjB,OAFb;AAGNkB,MAAAA,SAAS,EAAE;AAHL,KAAP;AAKA,GArDM,EAqDJ,CACFlB,OADE,EAEFC,SAFE,EAGFF,WAHE,EAIFD,OAJE,EAKFD,UALE,EAMFK,8BANE,CArDI,CAAP;AA6DA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useContext, useMemo } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\n\nconst SITE_EDITOR_AUTHORS_QUERY = {\n\tper_page: -1,\n\t_fields: 'id,name,avatar_urls',\n\tcontext: 'view',\n\tcapabilities: [ 'edit_theme_options' ],\n};\nconst EMPTY_ARRAY = [];\nconst { GlobalStylesContext } = unlock( blockEditorPrivateApis );\nexport default function useGlobalStylesRevisions() {\n\tconst { user: userConfig } = useContext( GlobalStylesContext );\n\tconst {\n\t\tauthors,\n\t\tcurrentUser,\n\t\tisDirty,\n\t\trevisions,\n\t\tisLoadingGlobalStylesRevisions,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\tgetCurrentUser,\n\t\t\tgetUsers,\n\t\t\tgetCurrentThemeGlobalStylesRevisions,\n\t\t\tisResolving,\n\t\t} = select( coreStore );\n\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\tconst _currentUser = getCurrentUser();\n\t\tconst _isDirty = dirtyEntityRecords.length > 0;\n\t\tconst globalStylesRevisions =\n\t\t\tgetCurrentThemeGlobalStylesRevisions() || EMPTY_ARRAY;\n\t\tconst _authors = getUsers( SITE_EDITOR_AUTHORS_QUERY ) || EMPTY_ARRAY;\n\n\t\treturn {\n\t\t\tauthors: _authors,\n\t\t\tcurrentUser: _currentUser,\n\t\t\tisDirty: _isDirty,\n\t\t\trevisions: globalStylesRevisions,\n\t\t\tisLoadingGlobalStylesRevisions: isResolving(\n\t\t\t\t'getCurrentThemeGlobalStylesRevisions'\n\t\t\t),\n\t\t};\n\t}, [] );\n\treturn useMemo( () => {\n\t\tlet _modifiedRevisions = [];\n\t\tif ( ! authors.length || isLoadingGlobalStylesRevisions ) {\n\t\t\treturn {\n\t\t\t\trevisions: _modifiedRevisions,\n\t\t\t\thasUnsavedChanges: isDirty,\n\t\t\t\tisLoading: true,\n\t\t\t};\n\t\t}\n\n\t\t// Adds author details to each revision.\n\t\t_modifiedRevisions = revisions.map( ( revision ) => {\n\t\t\treturn {\n\t\t\t\t...revision,\n\t\t\t\tauthor: authors.find(\n\t\t\t\t\t( author ) => author.id === revision.author\n\t\t\t\t),\n\t\t\t};\n\t\t} );\n\n\t\tif ( _modifiedRevisions.length ) {\n\t\t\t// Flags the most current saved revision.\n\t\t\tif ( _modifiedRevisions[ 0 ].id !== 'unsaved' ) {\n\t\t\t\t_modifiedRevisions[ 0 ].isLatest = true;\n\t\t\t}\n\n\t\t\t// Adds an item for unsaved changes.\n\t\t\tif (\n\t\t\t\tisDirty &&\n\t\t\t\tuserConfig &&\n\t\t\t\tObject.keys( userConfig ).length > 0 &&\n\t\t\t\tcurrentUser\n\t\t\t) {\n\t\t\t\tconst unsavedRevision = {\n\t\t\t\t\tid: 'unsaved',\n\t\t\t\t\tstyles: userConfig?.styles,\n\t\t\t\t\tsettings: userConfig?.settings,\n\t\t\t\t\tauthor: {\n\t\t\t\t\t\tname: currentUser?.name,\n\t\t\t\t\t\tavatar_urls: currentUser?.avatar_urls,\n\t\t\t\t\t},\n\t\t\t\t\tmodified: new Date(),\n\t\t\t\t};\n\n\t\t\t\t_modifiedRevisions.unshift( unsavedRevision );\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\trevisions: _modifiedRevisions,\n\t\t\thasUnsavedChanges: isDirty,\n\t\t\tisLoading: false,\n\t\t};\n\t}, [\n\t\tisDirty,\n\t\trevisions,\n\t\tcurrentUser,\n\t\tauthors,\n\t\tuserConfig,\n\t\tisLoadingGlobalStylesRevisions,\n\t] );\n}\n"]}
|
|
@@ -47,10 +47,8 @@ function KeyboardShortcutsEditMode() {
|
|
|
47
47
|
undo
|
|
48
48
|
} = (0, _data.useDispatch)(_coreData.store);
|
|
49
49
|
const {
|
|
50
|
-
isFeatureActive,
|
|
51
50
|
setIsListViewOpened,
|
|
52
51
|
switchEditorMode,
|
|
53
|
-
toggleFeature,
|
|
54
52
|
setIsInserterOpened,
|
|
55
53
|
closeGeneralSidebar
|
|
56
54
|
} = (0, _data.useDispatch)(_store.store);
|
|
@@ -67,7 +65,11 @@ function KeyboardShortcutsEditMode() {
|
|
|
67
65
|
getBlockAttributes
|
|
68
66
|
} = (0, _data.useSelect)(_blockEditor.store);
|
|
69
67
|
const {
|
|
70
|
-
|
|
68
|
+
get: getPreference
|
|
69
|
+
} = (0, _data.useSelect)(_preferences.store);
|
|
70
|
+
const {
|
|
71
|
+
set: setPreference,
|
|
72
|
+
toggle
|
|
71
73
|
} = (0, _data.useDispatch)(_preferences.store);
|
|
72
74
|
const {
|
|
73
75
|
createInfoNotice
|
|
@@ -146,8 +148,8 @@ function KeyboardShortcutsEditMode() {
|
|
|
146
148
|
});
|
|
147
149
|
(0, _keyboardShortcuts.useShortcut)('core/edit-site/toggle-distraction-free', () => {
|
|
148
150
|
toggleDistractionFree();
|
|
149
|
-
|
|
150
|
-
createInfoNotice(
|
|
151
|
+
toggle('core/edit-site', 'distractionFree');
|
|
152
|
+
createInfoNotice(getPreference('core/edit-site', 'distractionFree') ? (0, _i18n.__)('Distraction free mode turned on.') : (0, _i18n.__)('Distraction free mode turned off.'), {
|
|
151
153
|
id: 'core/edit-site/distraction-free-mode/notice',
|
|
152
154
|
type: 'snackbar'
|
|
153
155
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/keyboard-shortcuts/edit-mode.js"],"names":["KeyboardShortcutsEditMode","getEditorMode","editSiteStore","isListViewOpen","select","isListViewOpened","isBlockInspectorOpen","interfaceStore","getActiveComplementaryArea","name","SIDEBAR_BLOCK","redo","undo","coreStore","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/keyboard-shortcuts/edit-mode.js"],"names":["KeyboardShortcutsEditMode","getEditorMode","editSiteStore","isListViewOpen","select","isListViewOpened","isBlockInspectorOpen","interfaceStore","getActiveComplementaryArea","name","SIDEBAR_BLOCK","redo","undo","coreStore","setIsListViewOpened","switchEditorMode","setIsInserterOpened","closeGeneralSidebar","enableComplementaryArea","disableComplementaryArea","replaceBlocks","blockEditorStore","getBlockName","getSelectedBlockClientId","getBlockAttributes","get","getPreference","preferencesStore","set","setPreference","toggle","createInfoNotice","noticesStore","toggleDistractionFree","handleTextLevelShortcut","event","level","preventDefault","destinationBlockName","currentClientId","blockName","attributes","textAlign","destinationTextAlign","content","STORE_NAME","forEach","id","type"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAlBA;AACA;AACA;;AAWA;AACA;AACA;AAKA,SAASA,yBAAT,GAAqC;AACpC,QAAM;AAAEC,IAAAA;AAAF,MAAoB,qBAAWC,YAAX,CAA1B;AACA,QAAMC,cAAc,GAAG,qBACpBC,MAAF,IAAcA,MAAM,CAAEF,YAAF,CAAN,CAAwBG,gBAAxB,EADQ,EAEtB,EAFsB,CAAvB;AAIA,QAAMC,oBAAoB,GAAG,qBAC1BF,MAAF,IACCA,MAAM,CAAEG,gBAAF,CAAN,CAAyBC,0BAAzB,CACCN,aAAcO,IADf,MAEMC,wBAJqB,EAK5B,EAL4B,CAA7B;AAOA,QAAM;AAAEC,IAAAA,IAAF;AAAQC,IAAAA;AAAR,MAAiB,uBAAaC,eAAb,CAAvB;AACA,QAAM;AACLC,IAAAA,mBADK;AAELC,IAAAA,gBAFK;AAGLC,IAAAA,mBAHK;AAILC,IAAAA;AAJK,MAKF,uBAAaf,YAAb,CALJ;AAMA,QAAM;AAAEgB,IAAAA,uBAAF;AAA2BC,IAAAA;AAA3B,MACL,uBAAaZ,gBAAb,CADD;AAGA,QAAM;AAAEa,IAAAA;AAAF,MAAoB,uBAAaC,kBAAb,CAA1B;AACA,QAAM;AAAEC,IAAAA,YAAF;AAAgBC,IAAAA,wBAAhB;AAA0CC,IAAAA;AAA1C,MACL,qBAAWH,kBAAX,CADD;AAGA,QAAM;AAAEI,IAAAA,GAAG,EAAEC;AAAP,MAAyB,qBAAWC,kBAAX,CAA/B;AACA,QAAM;AAAEC,IAAAA,GAAG,EAAEC,aAAP;AAAsBC,IAAAA;AAAtB,MAAiC,uBA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CADL;AAECC,MAAAA,IAAI,EAAE;AAFP,KAJe,CAAhB;AASA,GAZD;AAcA,SAAO,IAAP;AACA;;eAEchD,yB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { createBlock } from '@wordpress/blocks';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { SIDEBAR_BLOCK } from '../sidebar-edit-mode/constants';\nimport { STORE_NAME } from '../../store/constants';\n\nfunction KeyboardShortcutsEditMode() {\n\tconst { getEditorMode } = useSelect( editSiteStore );\n\tconst isListViewOpen = useSelect(\n\t\t( select ) => select( editSiteStore ).isListViewOpened(),\n\t\t[]\n\t);\n\tconst isBlockInspectorOpen = useSelect(\n\t\t( select ) =>\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea(\n\t\t\t\teditSiteStore.name\n\t\t\t) === SIDEBAR_BLOCK,\n\t\t[]\n\t);\n\tconst { redo, undo } = useDispatch( coreStore );\n\tconst {\n\t\tsetIsListViewOpened,\n\t\tswitchEditorMode,\n\t\tsetIsInserterOpened,\n\t\tcloseGeneralSidebar,\n\t} = useDispatch( editSiteStore );\n\tconst { enableComplementaryArea, disableComplementaryArea } =\n\t\tuseDispatch( interfaceStore );\n\n\tconst { replaceBlocks } = useDispatch( blockEditorStore );\n\tconst { getBlockName, getSelectedBlockClientId, getBlockAttributes } =\n\t\tuseSelect( blockEditorStore );\n\n\tconst { get: getPreference } = useSelect( preferencesStore );\n\tconst { set: setPreference, toggle } = useDispatch( preferencesStore );\n\tconst { createInfoNotice } = useDispatch( noticesStore );\n\n\tconst toggleDistractionFree = () => {\n\t\tsetPreference( 'core/edit-site', 'fixedToolbar', false );\n\t\tsetIsInserterOpened( false );\n\t\tsetIsListViewOpened( false );\n\t\tcloseGeneralSidebar();\n\t};\n\n\tconst handleTextLevelShortcut = ( event, level ) => {\n\t\tevent.preventDefault();\n\t\tconst destinationBlockName =\n\t\t\tlevel === 0 ? 'core/paragraph' : 'core/heading';\n\t\tconst currentClientId = getSelectedBlockClientId();\n\t\tif ( currentClientId === null ) {\n\t\t\treturn;\n\t\t}\n\t\tconst blockName = getBlockName( currentClientId );\n\t\tif ( blockName !== 'core/paragraph' && blockName !== 'core/heading' ) {\n\t\t\treturn;\n\t\t}\n\t\tconst attributes = getBlockAttributes( currentClientId );\n\t\tconst textAlign =\n\t\t\tblockName === 'core/paragraph' ? 'align' : 'textAlign';\n\t\tconst destinationTextAlign =\n\t\t\tdestinationBlockName === 'core/paragraph' ? 'align' : 'textAlign';\n\n\t\treplaceBlocks(\n\t\t\tcurrentClientId,\n\t\t\tcreateBlock( destinationBlockName, {\n\t\t\t\tlevel,\n\t\t\t\tcontent: attributes.content,\n\t\t\t\t...{ [ destinationTextAlign ]: attributes[ textAlign ] },\n\t\t\t} )\n\t\t);\n\t};\n\n\tuseShortcut( 'core/edit-site/undo', ( event ) => {\n\t\tundo();\n\t\tevent.preventDefault();\n\t} );\n\n\tuseShortcut( 'core/edit-site/redo', ( event ) => {\n\t\tredo();\n\t\tevent.preventDefault();\n\t} );\n\n\t// Only opens the list view. Other functionality for this shortcut happens in the rendered sidebar.\n\tuseShortcut( 'core/edit-site/toggle-list-view', () => {\n\t\tif ( isListViewOpen ) {\n\t\t\treturn;\n\t\t}\n\t\tsetIsListViewOpened( true );\n\t} );\n\n\tuseShortcut( 'core/edit-site/toggle-block-settings-sidebar', ( event ) => {\n\t\t// This shortcut has no known clashes, but use preventDefault to prevent any\n\t\t// obscure shortcuts from triggering.\n\t\tevent.preventDefault();\n\n\t\tif ( isBlockInspectorOpen ) {\n\t\t\tdisableComplementaryArea( STORE_NAME );\n\t\t} else {\n\t\t\tenableComplementaryArea( STORE_NAME, SIDEBAR_BLOCK );\n\t\t}\n\t} );\n\n\tuseShortcut( 'core/edit-site/toggle-mode', () => {\n\t\tswitchEditorMode( getEditorMode() === 'visual' ? 'text' : 'visual' );\n\t} );\n\n\tuseShortcut( 'core/edit-site/transform-heading-to-paragraph', ( event ) =>\n\t\thandleTextLevelShortcut( event, 0 )\n\t);\n\n\t[ 1, 2, 3, 4, 5, 6 ].forEach( ( level ) => {\n\t\t//the loop is based off on a constant therefore\n\t\t//the hook will execute the same way every time\n\t\t//eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tuseShortcut(\n\t\t\t`core/edit-site/transform-paragraph-to-heading-${ level }`,\n\t\t\t( event ) => handleTextLevelShortcut( event, level )\n\t\t);\n\t} );\n\n\tuseShortcut( 'core/edit-site/toggle-distraction-free', () => {\n\t\ttoggleDistractionFree();\n\t\ttoggle( 'core/edit-site', 'distractionFree' );\n\t\tcreateInfoNotice(\n\t\t\tgetPreference( 'core/edit-site', 'distractionFree' )\n\t\t\t\t? __( 'Distraction free mode turned on.' )\n\t\t\t\t: __( 'Distraction free mode turned off.' ),\n\t\t\t{\n\t\t\t\tid: 'core/edit-site/distraction-free-mode/notice',\n\t\t\t\ttype: 'snackbar',\n\t\t\t}\n\t\t);\n\t} );\n\n\treturn null;\n}\n\nexport default KeyboardShortcutsEditMode;\n"]}
|
|
@@ -315,6 +315,12 @@ function Layout() {
|
|
|
315
315
|
}, (0, _element.createElement)(_errorBoundary.default, null, (0, _element.createElement)(_resizableFrame.default, {
|
|
316
316
|
isReady: !isEditorLoading,
|
|
317
317
|
isFullWidth: isEditing,
|
|
318
|
+
defaultSize: {
|
|
319
|
+
width: canvasSize.width - 24
|
|
320
|
+
/* $canvas-padding */
|
|
321
|
+
,
|
|
322
|
+
height: canvasSize.height
|
|
323
|
+
},
|
|
318
324
|
isOversized: isResizableFrameOversized,
|
|
319
325
|
setIsOversized: setIsResizableFrameOversized,
|
|
320
326
|
innerContentStyle: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/layout/index.js"],"names":["useCommands","coreCommandsPrivateApis","useCommandContext","commandsPrivateApis","useLocation","routerPrivateApis","useGlobalStyle","blockEditorPrivateApis","ANIMATION_DURATION","Layout","hubRef","params","isMobileViewport","isListPage","isEditorPage","isDistractionFree","hasFixedToolbar","canvasMode","previousShortcut","nextShortcut","select","getAllShortcutKeyCombinations","keyboardShortcutsStore","getCanvasMode","editSiteStore","preferencesStore","get","isEditing","navigateRegionsProps","previous","next","disableMotion","showSidebar","showCanvas","isFullCanvas","canvasResizer","canvasSize","fullResizer","isResizing","isEditorLoading","isResizableFrameOversized","setIsResizableFrameOversized","headerAnimationState","commandContext","backgroundColor","gradientValue","ref","className","opacity","transition","type","delay","delayChildren","isDistractionFreeHovering","view","edit","undefined","motion","div","x","y","duration","ease","width","scale","background"],"mappings":";;;;;;;;;AAoBA;;AAjBA;;AAKA;;AACA;;AAKA;;AAKA;;AAEA;;AACA;;AACA;;AAIA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AApDA;AACA;AACA;;AAGA;AACA;AACA;;AAyBA;AACA;AACA;AAoBA,MAAM;AAAEA,EAAAA;AAAF,IAAkB,wBAAQC,yBAAR,CAAxB;AACA,MAAM;AAAEC,EAAAA;AAAF,IAAwB,wBAAQC,qBAAR,CAA9B;AACA,MAAM;AAAEC,EAAAA;AAAF,IAAkB,wBAAQC,mBAAR,CAAxB;AACA,MAAM;AAAEC,EAAAA;AAAF,IAAqB,wBAAQC,wBAAR,CAA3B;AAEA,MAAMC,kBAAkB,GAAG,GAA3B;;AAEe,SAASC,MAAT,GAAkB;AAChC;AACA;AACA;AACAT,EAAAA,WAAW;AACX;AACA;AAEA,QAAMU,MAAM,GAAG,sBAAf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,EAAG,yBACX,0BADW,EAEX;AACC,0BACCtB;AAFF,KAFW,CAnBb;AA0BC,IAAA,UAAU,EAAG;AACZU,MAAAA,IAAI,EAAE,OADM;AAEZW,MAAAA,QAAQ,EACP9B,aAAa,IAAIO,UAAjB,GACG,CADH,GAEG9B,kBALQ;AAMZsD,MAAAA,IAAI,EAAE;AANM;AA1Bd,KAmCC,4BAAC,sBAAD,QACC,4BAAC,uBAAD;AACC,IAAA,OAAO,EACN,CAAEvB,eAFJ;AAIC,IAAA,WAAW,EAAGZ,SAJf;AAKC,IAAA,WAAW,EACVa,yBANF;AAQC,IAAA,cAAc,EACbC,4BATF;AAWC,IAAA,iBAAiB,EAAG;AACnBwB,MAAAA,UAAU,EACTpB,aADS,aACTA,aADS,cACTA,aADS,GAETD;AAHkB;AAXrB,KAiBC,4BAAC,eAAD;AACC,IAAA,SAAS,EACRL;AAFF,IAjBD,CADD,CAnCD,CAVF,CAHF,CA3BF,CA3FD,CALD,CADD;AA+MA","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} 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';\nimport {\n\tCommandMenu,\n\tprivateApis as commandsPrivateApis,\n} from '@wordpress/commands';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { privateApis as coreCommandsPrivateApis } from '@wordpress/core-commands';\n\n/**\n * Internal dependencies\n */\nimport Sidebar from '../sidebar';\nimport Editor from '../editor';\nimport ErrorBoundary from '../error-boundary';\nimport { store as editSiteStore } from '../../store';\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 ResizableFrame from '../resizable-frame';\nimport useSyncCanvasModeWithURL from '../sync-state-with-url/use-sync-canvas-mode-with-url';\nimport { unlock } from '../../lock-unlock';\nimport SavePanel from '../save-panel';\nimport KeyboardShortcutsRegister from '../keyboard-shortcuts/register';\nimport KeyboardShortcutsGlobal from '../keyboard-shortcuts/global';\nimport { useCommonCommands } from '../../hooks/commands/use-common-commands';\nimport { useEditModeCommands } from '../../hooks/commands/use-edit-mode-commands';\nimport PageMain from '../page-main';\nimport { useIsSiteEditorLoading } from './hooks';\n\nconst { useCommands } = unlock( coreCommandsPrivateApis );\nconst { useCommandContext } = unlock( commandsPrivateApis );\nconst { useLocation } = unlock( routerPrivateApis );\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\n\nconst ANIMATION_DURATION = 0.5;\n\nexport default function Layout() {\n\t// This ensures the edited entity id and type are initialized properly.\n\tuseInitEditedEntityFromURL();\n\tuseSyncCanvasModeWithURL();\n\tuseCommands();\n\tuseEditModeCommands();\n\tuseCommonCommands();\n\n\tconst hubRef = useRef();\n\tconst { params } = useLocation();\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isListPage = getIsListPage( params, isMobileViewport );\n\tconst isEditorPage = ! isListPage;\n\n\tconst {\n\t\tisDistractionFree,\n\t\thasFixedToolbar,\n\t\tcanvasMode,\n\t\tpreviousShortcut,\n\t\tnextShortcut,\n\t} = useSelect( ( select ) => {\n\t\tconst { getAllShortcutKeyCombinations } = select(\n\t\t\tkeyboardShortcutsStore\n\t\t);\n\t\tconst { getCanvasMode } = unlock( select( editSiteStore ) );\n\t\treturn {\n\t\t\tcanvasMode: getCanvasMode(),\n\t\t\tpreviousShortcut: getAllShortcutKeyCombinations(\n\t\t\t\t'core/edit-site/previous-region'\n\t\t\t),\n\t\t\tnextShortcut: getAllShortcutKeyCombinations(\n\t\t\t\t'core/edit-site/next-region'\n\t\t\t),\n\t\t\thasFixedToolbar: select( preferencesStore ).get(\n\t\t\t\t'core/edit-site',\n\t\t\t\t'fixedToolbar'\n\t\t\t),\n\t\t\tisDistractionFree: select( preferencesStore ).get(\n\t\t\t\t'core/edit-site',\n\t\t\t\t'distractionFree'\n\t\t\t),\n\t\t};\n\t}, [] );\n\tconst isEditing = canvasMode === 'edit';\n\tconst navigateRegionsProps = useNavigateRegions( {\n\t\tprevious: previousShortcut,\n\t\tnext: nextShortcut,\n\t} );\n\tconst disableMotion = useReducedMotion();\n\tconst showSidebar =\n\t\t( isMobileViewport && ! isListPage ) ||\n\t\t( ! isMobileViewport && ( canvasMode === 'view' || ! isEditorPage ) );\n\tconst showCanvas =\n\t\t( isMobileViewport && isEditorPage && isEditing ) ||\n\t\t! isMobileViewport ||\n\t\t! isEditorPage;\n\tconst isFullCanvas =\n\t\t( isMobileViewport && isListPage ) || ( isEditorPage && isEditing );\n\tconst [ canvasResizer, canvasSize ] = useResizeObserver();\n\tconst [ fullResizer ] = useResizeObserver();\n\tconst [ isResizing ] = useState( false );\n\tconst isEditorLoading = useIsSiteEditorLoading();\n\tconst [ isResizableFrameOversized, setIsResizableFrameOversized ] =\n\t\tuseState( false );\n\n\t// This determines which animation variant should apply to the header.\n\t// There is also a `isDistractionFreeHovering` state that gets priority\n\t// when hovering the `edit-site-layout__header-container` in distraction\n\t// free mode. It's set via framer and trickles down to all the children\n\t// so they can use this variant state too.\n\t//\n\t// TODO: The issue with this is we want to have the hover state stick when hovering\n\t// a popover opened via the header. We'll probably need to lift this state to\n\t// handle it ourselves. Also, focusWithin the header needs to be handled.\n\tlet headerAnimationState;\n\n\tif ( canvasMode === 'view' ) {\n\t\t// We need 'view' to always take priority so 'isDistractionFree'\n\t\t// doesn't bleed over into the view (sidebar) state\n\t\theaderAnimationState = 'view';\n\t} else if ( isDistractionFree ) {\n\t\theaderAnimationState = 'isDistractionFree';\n\t} else {\n\t\theaderAnimationState = canvasMode; // edit, view, init\n\t}\n\n\t// Sets the right context for the command palette\n\tconst commandContext =\n\t\tcanvasMode === 'edit' && isEditorPage\n\t\t\t? 'site-editor-edit'\n\t\t\t: 'site-editor';\n\tuseCommandContext( commandContext );\n\n\tconst [ backgroundColor ] = useGlobalStyle( 'color.background' );\n\tconst [ gradientValue ] = useGlobalStyle( 'color.gradient' );\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<CommandMenu />\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-distraction-free': isDistractionFree && isEditing,\n\t\t\t\t\t\t'is-full-canvas': isFullCanvas,\n\t\t\t\t\t\t'is-edit-mode': isEditing,\n\t\t\t\t\t\t'has-fixed-toolbar': hasFixedToolbar,\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<motion.div\n\t\t\t\t\tclassName=\"edit-site-layout__header-container\"\n\t\t\t\t\tvariants={ {\n\t\t\t\t\t\tisDistractionFree: {\n\t\t\t\t\t\t\topacity: 0,\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\tdelay: 0.8,\n\t\t\t\t\t\t\t\tdelayChildren: 0.8,\n\t\t\t\t\t\t\t}, // How long to wait before the header exits\n\t\t\t\t\t\t},\n\t\t\t\t\t\tisDistractionFreeHovering: {\n\t\t\t\t\t\t\topacity: 1,\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\tdelay: 0.2,\n\t\t\t\t\t\t\t\tdelayChildren: 0.2,\n\t\t\t\t\t\t\t}, // How long to wait before the header shows\n\t\t\t\t\t\t},\n\t\t\t\t\t\tview: { opacity: 1 },\n\t\t\t\t\t\tedit: { opacity: 1 },\n\t\t\t\t\t} }\n\t\t\t\t\twhileHover={\n\t\t\t\t\t\tisDistractionFree\n\t\t\t\t\t\t\t? 'isDistractionFreeHovering'\n\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t}\n\t\t\t\t\tanimate={ headerAnimationState }\n\t\t\t\t>\n\t\t\t\t\t<SiteHub\n\t\t\t\t\t\tas={ motion.div }\n\t\t\t\t\t\tvariants={ {\n\t\t\t\t\t\t\tisDistractionFree: { x: '-100%' },\n\t\t\t\t\t\t\tisDistractionFreeHovering: { x: 0 },\n\t\t\t\t\t\t\tview: { x: 0 },\n\t\t\t\t\t\t\tedit: { x: 0 },\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tref={ hubRef }\n\t\t\t\t\t\tisTransparent={ isResizableFrameOversized }\n\t\t\t\t\t\tclassName=\"edit-site-layout__hub\"\n\t\t\t\t\t/>\n\n\t\t\t\t\t<AnimatePresence initial={ false }>\n\t\t\t\t\t\t{ isEditorPage && isEditing && (\n\t\t\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\t\t\tkey=\"header\"\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\tvariants={ {\n\t\t\t\t\t\t\t\t\tisDistractionFree: { opacity: 0, y: 0 },\n\t\t\t\t\t\t\t\t\tisDistractionFreeHovering: {\n\t\t\t\t\t\t\t\t\t\topacity: 1,\n\t\t\t\t\t\t\t\t\t\ty: 0,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tview: { opacity: 1, y: '-100%' },\n\t\t\t\t\t\t\t\t\tedit: { opacity: 1, y: 0 },\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\tinitial={ {\n\t\t\t\t\t\t\t\t\topacity: isDistractionFree ? 1 : 0,\n\t\t\t\t\t\t\t\t\ty: isDistractionFree ? 0 : '-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 ? 0 : 0.2,\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<Header />\n\t\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</AnimatePresence>\n\t\t\t\t</motion.div>\n\n\t\t\t\t<div className=\"edit-site-layout__content\">\n\t\t\t\t\t<motion.div\n\t\t\t\t\t\t// The sidebar is needed for routing on mobile\n\t\t\t\t\t\t// (https://github.com/WordPress/gutenberg/pull/51558/files#r1231763003),\n\t\t\t\t\t\t// so we can't remove the element entirely. Using `inert` will make\n\t\t\t\t\t\t// it inaccessible to screen readers and keyboard navigation.\n\t\t\t\t\t\tinert={ showSidebar ? undefined : 'inert' }\n\t\t\t\t\t\tanimate={ { opacity: showSidebar ? 1 : 0 } }\n\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\tduration:\n\t\t\t\t\t\t\t\t// Disable transition in mobile to emulate a full page transition.\n\t\t\t\t\t\t\t\tdisableMotion || isMobileViewport\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\tease: 'easeOut',\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tclassName=\"edit-site-layout__sidebar\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<NavigableRegion ariaLabel={ __( 'Navigation' ) }>\n\t\t\t\t\t\t\t<Sidebar />\n\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t</motion.div>\n\n\t\t\t\t\t<SavePanel />\n\n\t\t\t\t\t{ showCanvas && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{ isListPage && <PageMain /> }\n\t\t\t\t\t\t\t{ isEditorPage && (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t\t\t'edit-site-layout__canvas-container',\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t'is-resizing': isResizing,\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\t\t{ canvasResizer }\n\t\t\t\t\t\t\t\t\t{ !! canvasSize.width && (\n\t\t\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\t\t\twhileHover={\n\t\t\t\t\t\t\t\t\t\t\t\tisEditorPage &&\n\t\t\t\t\t\t\t\t\t\t\t\tcanvasMode === 'view'\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\tscale: 1.005,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttransition: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tduration:\n\t\t\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\t\t\tisResizing\n\t\t\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\t\t: 0.5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tease: 'easeOut',\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 }\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\tinitial={ false }\n\t\t\t\t\t\t\t\t\t\t\tlayout=\"position\"\n\t\t\t\t\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t\t\t\t\t'edit-site-layout__canvas',\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t'is-right-aligned':\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tisResizableFrameOversized,\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\t\t\t\t\t\ttype: 'tween',\n\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\tdisableMotion || isResizing\n\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: ANIMATION_DURATION,\n\t\t\t\t\t\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t\t\t<ResizableFrame\n\t\t\t\t\t\t\t\t\t\t\t\t\tisReady={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t! isEditorLoading\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\tisFullWidth={ isEditing }\n\t\t\t\t\t\t\t\t\t\t\t\t\tisOversized={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tisResizableFrameOversized\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tsetIsOversized={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetIsResizableFrameOversized\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\tinnerContentStyle={ {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbackground:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgradientValue ??\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbackgroundColor,\n\t\t\t\t\t\t\t\t\t\t\t\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<Editor\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tisLoading={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tisEditorLoading\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</ResizableFrame>\n\t\t\t\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</>\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":["useCommands","coreCommandsPrivateApis","useCommandContext","commandsPrivateApis","useLocation","routerPrivateApis","useGlobalStyle","blockEditorPrivateApis","ANIMATION_DURATION","Layout","hubRef","params","isMobileViewport","isListPage","isEditorPage","isDistractionFree","hasFixedToolbar","canvasMode","previousShortcut","nextShortcut","select","getAllShortcutKeyCombinations","keyboardShortcutsStore","getCanvasMode","editSiteStore","preferencesStore","get","isEditing","navigateRegionsProps","previous","next","disableMotion","showSidebar","showCanvas","isFullCanvas","canvasResizer","canvasSize","fullResizer","isResizing","isEditorLoading","isResizableFrameOversized","setIsResizableFrameOversized","headerAnimationState","commandContext","backgroundColor","gradientValue","ref","className","opacity","transition","type","delay","delayChildren","isDistractionFreeHovering","view","edit","undefined","motion","div","x","y","duration","ease","width","scale","height","background"],"mappings":";;;;;;;;;AAoBA;;AAjBA;;AAKA;;AACA;;AAKA;;AAKA;;AAEA;;AACA;;AACA;;AAIA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AApDA;AACA;AACA;;AAGA;AACA;AACA;;AAyBA;AACA;AACA;AAoBA,MAAM;AAAEA,EAAAA;AAAF,IAAkB,wBAAQC,yBAAR,CAAxB;AACA,MAAM;AAAEC,EAAAA;AAAF,IAAwB,wBAAQC,qBAAR,CAA9B;AACA,MAAM;AAAEC,EAAAA;AAAF,IAAkB,wBAAQC,mBAAR,CAAxB;AACA,MAAM;AAAEC,EAAAA;AAAF,IAAqB,wBAAQC,wBAAR,CAA3B;AAEA,MAAMC,kBAAkB,GAAG,GAA3B;;AAEe,SAASC,MAAT,GAAkB;AAChC;AACA;AACA;AACAT,EAAAA,WAAW;AACX;AACA;AAEA,QAAMU,MAAM,GAAG,sBAAf;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAaP,WAAW,EAA9B;AACA,QAAMQ,gBAAgB,GAAG,+BAAkB,QAAlB,EAA4B,GAA5B,CAAzB;AACA,QAAMC,UAAU,GAAG,4BAAeF,MAAf,EAAuBC,gBAAvB,CAAnB;AACA,QAAME,YAAY,GAAG,CAAED,UAAvB;AAEA,QAAM;AACLE,IAAAA,iBADK;AAELC,IAAAA,eAFK;AAGLC,IAAAA,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AAO,EACN,CAAEvB,eAFJ;AAIC,IAAA,WAAW,EAAGZ,SAJf;AAKC,IAAA,WAAW,EAAG;AACboC,MAAAA,KAAK,EACJ3B,UAAU,CAAC2B,KAAX,GACA;AAAG;AAHS;AAIbE,MAAAA,MAAM,EAAE7B,UAAU,CAAC6B;AAJN,KALf;AAWC,IAAA,WAAW,EACVzB,yBAZF;AAcC,IAAA,cAAc,EACbC,4BAfF;AAiBC,IAAA,iBAAiB,EAAG;AACnByB,MAAAA,UAAU,EACTrB,aADS,aACTA,aADS,cACTA,aADS,GAETD;AAHkB;AAjBrB,KAuBC,4BAAC,eAAD;AACC,IAAA,SAAS,EACRL;AAFF,IAvBD,CADD,CAnCD,CAVF,CAHF,CA3BF,CA3FD,CALD,CADD;AAqNA","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} 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';\nimport {\n\tCommandMenu,\n\tprivateApis as commandsPrivateApis,\n} from '@wordpress/commands';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { privateApis as coreCommandsPrivateApis } from '@wordpress/core-commands';\n\n/**\n * Internal dependencies\n */\nimport Sidebar from '../sidebar';\nimport Editor from '../editor';\nimport ErrorBoundary from '../error-boundary';\nimport { store as editSiteStore } from '../../store';\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 ResizableFrame from '../resizable-frame';\nimport useSyncCanvasModeWithURL from '../sync-state-with-url/use-sync-canvas-mode-with-url';\nimport { unlock } from '../../lock-unlock';\nimport SavePanel from '../save-panel';\nimport KeyboardShortcutsRegister from '../keyboard-shortcuts/register';\nimport KeyboardShortcutsGlobal from '../keyboard-shortcuts/global';\nimport { useCommonCommands } from '../../hooks/commands/use-common-commands';\nimport { useEditModeCommands } from '../../hooks/commands/use-edit-mode-commands';\nimport PageMain from '../page-main';\nimport { useIsSiteEditorLoading } from './hooks';\n\nconst { useCommands } = unlock( coreCommandsPrivateApis );\nconst { useCommandContext } = unlock( commandsPrivateApis );\nconst { useLocation } = unlock( routerPrivateApis );\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\n\nconst ANIMATION_DURATION = 0.5;\n\nexport default function Layout() {\n\t// This ensures the edited entity id and type are initialized properly.\n\tuseInitEditedEntityFromURL();\n\tuseSyncCanvasModeWithURL();\n\tuseCommands();\n\tuseEditModeCommands();\n\tuseCommonCommands();\n\n\tconst hubRef = useRef();\n\tconst { params } = useLocation();\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isListPage = getIsListPage( params, isMobileViewport );\n\tconst isEditorPage = ! isListPage;\n\n\tconst {\n\t\tisDistractionFree,\n\t\thasFixedToolbar,\n\t\tcanvasMode,\n\t\tpreviousShortcut,\n\t\tnextShortcut,\n\t} = useSelect( ( select ) => {\n\t\tconst { getAllShortcutKeyCombinations } = select(\n\t\t\tkeyboardShortcutsStore\n\t\t);\n\t\tconst { getCanvasMode } = unlock( select( editSiteStore ) );\n\t\treturn {\n\t\t\tcanvasMode: getCanvasMode(),\n\t\t\tpreviousShortcut: getAllShortcutKeyCombinations(\n\t\t\t\t'core/edit-site/previous-region'\n\t\t\t),\n\t\t\tnextShortcut: getAllShortcutKeyCombinations(\n\t\t\t\t'core/edit-site/next-region'\n\t\t\t),\n\t\t\thasFixedToolbar: select( preferencesStore ).get(\n\t\t\t\t'core/edit-site',\n\t\t\t\t'fixedToolbar'\n\t\t\t),\n\t\t\tisDistractionFree: select( preferencesStore ).get(\n\t\t\t\t'core/edit-site',\n\t\t\t\t'distractionFree'\n\t\t\t),\n\t\t};\n\t}, [] );\n\tconst isEditing = canvasMode === 'edit';\n\tconst navigateRegionsProps = useNavigateRegions( {\n\t\tprevious: previousShortcut,\n\t\tnext: nextShortcut,\n\t} );\n\tconst disableMotion = useReducedMotion();\n\tconst showSidebar =\n\t\t( isMobileViewport && ! isListPage ) ||\n\t\t( ! isMobileViewport && ( canvasMode === 'view' || ! isEditorPage ) );\n\tconst showCanvas =\n\t\t( isMobileViewport && isEditorPage && isEditing ) ||\n\t\t! isMobileViewport ||\n\t\t! isEditorPage;\n\tconst isFullCanvas =\n\t\t( isMobileViewport && isListPage ) || ( isEditorPage && isEditing );\n\tconst [ canvasResizer, canvasSize ] = useResizeObserver();\n\tconst [ fullResizer ] = useResizeObserver();\n\tconst [ isResizing ] = useState( false );\n\tconst isEditorLoading = useIsSiteEditorLoading();\n\tconst [ isResizableFrameOversized, setIsResizableFrameOversized ] =\n\t\tuseState( false );\n\n\t// This determines which animation variant should apply to the header.\n\t// There is also a `isDistractionFreeHovering` state that gets priority\n\t// when hovering the `edit-site-layout__header-container` in distraction\n\t// free mode. It's set via framer and trickles down to all the children\n\t// so they can use this variant state too.\n\t//\n\t// TODO: The issue with this is we want to have the hover state stick when hovering\n\t// a popover opened via the header. We'll probably need to lift this state to\n\t// handle it ourselves. Also, focusWithin the header needs to be handled.\n\tlet headerAnimationState;\n\n\tif ( canvasMode === 'view' ) {\n\t\t// We need 'view' to always take priority so 'isDistractionFree'\n\t\t// doesn't bleed over into the view (sidebar) state\n\t\theaderAnimationState = 'view';\n\t} else if ( isDistractionFree ) {\n\t\theaderAnimationState = 'isDistractionFree';\n\t} else {\n\t\theaderAnimationState = canvasMode; // edit, view, init\n\t}\n\n\t// Sets the right context for the command palette\n\tconst commandContext =\n\t\tcanvasMode === 'edit' && isEditorPage\n\t\t\t? 'site-editor-edit'\n\t\t\t: 'site-editor';\n\tuseCommandContext( commandContext );\n\n\tconst [ backgroundColor ] = useGlobalStyle( 'color.background' );\n\tconst [ gradientValue ] = useGlobalStyle( 'color.gradient' );\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<CommandMenu />\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-distraction-free': isDistractionFree && isEditing,\n\t\t\t\t\t\t'is-full-canvas': isFullCanvas,\n\t\t\t\t\t\t'is-edit-mode': isEditing,\n\t\t\t\t\t\t'has-fixed-toolbar': hasFixedToolbar,\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<motion.div\n\t\t\t\t\tclassName=\"edit-site-layout__header-container\"\n\t\t\t\t\tvariants={ {\n\t\t\t\t\t\tisDistractionFree: {\n\t\t\t\t\t\t\topacity: 0,\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\tdelay: 0.8,\n\t\t\t\t\t\t\t\tdelayChildren: 0.8,\n\t\t\t\t\t\t\t}, // How long to wait before the header exits\n\t\t\t\t\t\t},\n\t\t\t\t\t\tisDistractionFreeHovering: {\n\t\t\t\t\t\t\topacity: 1,\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\tdelay: 0.2,\n\t\t\t\t\t\t\t\tdelayChildren: 0.2,\n\t\t\t\t\t\t\t}, // How long to wait before the header shows\n\t\t\t\t\t\t},\n\t\t\t\t\t\tview: { opacity: 1 },\n\t\t\t\t\t\tedit: { opacity: 1 },\n\t\t\t\t\t} }\n\t\t\t\t\twhileHover={\n\t\t\t\t\t\tisDistractionFree\n\t\t\t\t\t\t\t? 'isDistractionFreeHovering'\n\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t}\n\t\t\t\t\tanimate={ headerAnimationState }\n\t\t\t\t>\n\t\t\t\t\t<SiteHub\n\t\t\t\t\t\tas={ motion.div }\n\t\t\t\t\t\tvariants={ {\n\t\t\t\t\t\t\tisDistractionFree: { x: '-100%' },\n\t\t\t\t\t\t\tisDistractionFreeHovering: { x: 0 },\n\t\t\t\t\t\t\tview: { x: 0 },\n\t\t\t\t\t\t\tedit: { x: 0 },\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tref={ hubRef }\n\t\t\t\t\t\tisTransparent={ isResizableFrameOversized }\n\t\t\t\t\t\tclassName=\"edit-site-layout__hub\"\n\t\t\t\t\t/>\n\n\t\t\t\t\t<AnimatePresence initial={ false }>\n\t\t\t\t\t\t{ isEditorPage && isEditing && (\n\t\t\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\t\t\tkey=\"header\"\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\tvariants={ {\n\t\t\t\t\t\t\t\t\tisDistractionFree: { opacity: 0, y: 0 },\n\t\t\t\t\t\t\t\t\tisDistractionFreeHovering: {\n\t\t\t\t\t\t\t\t\t\topacity: 1,\n\t\t\t\t\t\t\t\t\t\ty: 0,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tview: { opacity: 1, y: '-100%' },\n\t\t\t\t\t\t\t\t\tedit: { opacity: 1, y: 0 },\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\tinitial={ {\n\t\t\t\t\t\t\t\t\topacity: isDistractionFree ? 1 : 0,\n\t\t\t\t\t\t\t\t\ty: isDistractionFree ? 0 : '-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 ? 0 : 0.2,\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<Header />\n\t\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</AnimatePresence>\n\t\t\t\t</motion.div>\n\n\t\t\t\t<div className=\"edit-site-layout__content\">\n\t\t\t\t\t<motion.div\n\t\t\t\t\t\t// The sidebar is needed for routing on mobile\n\t\t\t\t\t\t// (https://github.com/WordPress/gutenberg/pull/51558/files#r1231763003),\n\t\t\t\t\t\t// so we can't remove the element entirely. Using `inert` will make\n\t\t\t\t\t\t// it inaccessible to screen readers and keyboard navigation.\n\t\t\t\t\t\tinert={ showSidebar ? undefined : 'inert' }\n\t\t\t\t\t\tanimate={ { opacity: showSidebar ? 1 : 0 } }\n\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\tduration:\n\t\t\t\t\t\t\t\t// Disable transition in mobile to emulate a full page transition.\n\t\t\t\t\t\t\t\tdisableMotion || isMobileViewport\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\tease: 'easeOut',\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tclassName=\"edit-site-layout__sidebar\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<NavigableRegion ariaLabel={ __( 'Navigation' ) }>\n\t\t\t\t\t\t\t<Sidebar />\n\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t</motion.div>\n\n\t\t\t\t\t<SavePanel />\n\n\t\t\t\t\t{ showCanvas && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{ isListPage && <PageMain /> }\n\t\t\t\t\t\t\t{ isEditorPage && (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t\t\t'edit-site-layout__canvas-container',\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t'is-resizing': isResizing,\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\t\t{ canvasResizer }\n\t\t\t\t\t\t\t\t\t{ !! canvasSize.width && (\n\t\t\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\t\t\twhileHover={\n\t\t\t\t\t\t\t\t\t\t\t\tisEditorPage &&\n\t\t\t\t\t\t\t\t\t\t\t\tcanvasMode === 'view'\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\tscale: 1.005,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttransition: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tduration:\n\t\t\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\t\t\tisResizing\n\t\t\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\t\t: 0.5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tease: 'easeOut',\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 }\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\tinitial={ false }\n\t\t\t\t\t\t\t\t\t\t\tlayout=\"position\"\n\t\t\t\t\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t\t\t\t\t'edit-site-layout__canvas',\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t'is-right-aligned':\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tisResizableFrameOversized,\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\t\t\t\t\t\ttype: 'tween',\n\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\tdisableMotion || isResizing\n\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: ANIMATION_DURATION,\n\t\t\t\t\t\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t\t\t<ResizableFrame\n\t\t\t\t\t\t\t\t\t\t\t\t\tisReady={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t! isEditorLoading\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\tisFullWidth={ isEditing }\n\t\t\t\t\t\t\t\t\t\t\t\t\tdefaultSize={ {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcanvasSize.width -\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t24 /* $canvas-padding */,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\theight: canvasSize.height,\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\tisOversized={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tisResizableFrameOversized\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tsetIsOversized={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetIsResizableFrameOversized\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\tinnerContentStyle={ {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbackground:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgradientValue ??\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbackgroundColor,\n\t\t\t\t\t\t\t\t\t\t\t\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<Editor\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tisLoading={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tisEditorLoading\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</ResizableFrame>\n\t\t\t\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"]}
|
|
@@ -50,8 +50,7 @@ function PageTemplateParts() {
|
|
|
50
50
|
}, (0, _element.createElement)(_link.default, {
|
|
51
51
|
params: {
|
|
52
52
|
postId: templatePart.id,
|
|
53
|
-
postType: templatePart.type
|
|
54
|
-
canvas: 'view'
|
|
53
|
+
postType: templatePart.type
|
|
55
54
|
},
|
|
56
55
|
state: {
|
|
57
56
|
backPath: '/wp_template_part/all'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/page-template-parts/index.js"],"names":["PageTemplateParts","records","templateParts","per_page","columns","header","cell","templatePart","postId","id","postType","type","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/page-template-parts/index.js"],"names":["PageTemplateParts","records","templateParts","per_page","columns","header","cell","templatePart","postId","id","postType","type","backPath","title","rendered","slug","maxWidth"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AApBA;AACA;AACA;;AAUA;AACA;AACA;AAQe,SAASA,iBAAT,GAA6B;AAC3C,QAAM;AAAEC,IAAAA,OAAO,EAAEC;AAAX,MAA6B,gCAClC,UADkC,EAElC,kBAFkC,EAGlC;AACCC,IAAAA,QAAQ,EAAE,CAAC;AADZ,GAHkC,CAAnC;AAQA,QAAMC,OAAO,GAAG,CACf;AACCC,IAAAA,MAAM,EAAE,cAAI,eAAJ,CADT;AAECC,IAAAA,IAAI,EAAIC,YAAF,IACL,4BAAC,gCAAD,QACC,4BAAC,iCAAD;AAAS,MAAA,EAAE,EAAC,IAAZ;AAAiB,MAAA,KAAK,EAAG;AAAzB,OACC,4BAAC,aAAD;AACC,MAAA,MAAM,EAAG;AACRC,QAAAA,MAAM,EAAED,YAAY,CAACE,EADb;AAERC,QAAAA,QAAQ,EAAEH,YAAY,CAACI;AAFf,OADV;AAKC,MAAA,KAAK,EAAG;AAAEC,QAAAA,QAAQ,EAAE;AAAZ;AALT,OAOG,kCACDL,YAAY,CAACM,KAAb,EAAoBC,QAApB,IACCP,YAAY,CAACQ,IAFb,CAPH,CADD,CADD,CAHF;AAoBCC,IAAAA,QAAQ,EAAE;AApBX,GADe,EAuBf;AACCX,IAAAA,MAAM,EAAE,cAAI,UAAJ,CADT;AAECC,IAAAA,IAAI,EAAIC,YAAF,IACL,4BAAC,gBAAD;AACC,MAAA,QAAQ,EAAGA,YAAY,CAACI,IADzB;AAEC,MAAA,MAAM,EAAGJ,YAAY,CAACE;AAFvB;AAHF,GAvBe,EAgCf;AACCJ,IAAAA,MAAM,EAAE,4BAAC,0BAAD,QAAkB,cAAI,SAAJ,CAAlB,CADT;AAECC,IAAAA,IAAI,EAAIC,YAAF,IACL,4BAAC,wBAAD;AACC,MAAA,QAAQ,EAAGA,YAAY,CAACI,IADzB;AAEC,MAAA,MAAM,EAAGJ,YAAY,CAACE;AAFvB;AAHF,GAhCe,CAAhB;AA2CA,SACC,4BAAC,aAAD;AACC,IAAA,KAAK,EAAG,cAAI,gBAAJ,CADT;AAEC,IAAA,OAAO,EAAG,4BAAC,2BAAD;AAFX,KAIGP,aAAa,IACd,4BAAC,cAAD;AAAO,IAAA,IAAI,EAAGA,aAAd;AAA8B,IAAA,OAAO,EAAGE;AAAxC,IALF,CADD;AAUA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tVisuallyHidden,\n\t__experimentalHeading as Heading,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useEntityRecords } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport Page from '../page';\nimport Table from '../table';\nimport Link from '../routes/link';\nimport AddedBy from '../list/added-by';\nimport TemplateActions from '../template-actions';\nimport AddNewTemplatePart from './add-new-template-part';\n\nexport default function PageTemplateParts() {\n\tconst { records: templateParts } = useEntityRecords(\n\t\t'postType',\n\t\t'wp_template_part',\n\t\t{\n\t\t\tper_page: -1,\n\t\t}\n\t);\n\n\tconst columns = [\n\t\t{\n\t\t\theader: __( 'Template Part' ),\n\t\t\tcell: ( templatePart ) => (\n\t\t\t\t<VStack>\n\t\t\t\t\t<Heading as=\"h3\" level={ 5 }>\n\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\tparams={ {\n\t\t\t\t\t\t\t\tpostId: templatePart.id,\n\t\t\t\t\t\t\t\tpostType: templatePart.type,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tstate={ { backPath: '/wp_template_part/all' } }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ decodeEntities(\n\t\t\t\t\t\t\t\ttemplatePart.title?.rendered ||\n\t\t\t\t\t\t\t\t\ttemplatePart.slug\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Link>\n\t\t\t\t\t</Heading>\n\t\t\t\t</VStack>\n\t\t\t),\n\t\t\tmaxWidth: 400,\n\t\t},\n\t\t{\n\t\t\theader: __( 'Added by' ),\n\t\t\tcell: ( templatePart ) => (\n\t\t\t\t<AddedBy\n\t\t\t\t\tpostType={ templatePart.type }\n\t\t\t\t\tpostId={ templatePart.id }\n\t\t\t\t/>\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\theader: <VisuallyHidden>{ __( 'Actions' ) }</VisuallyHidden>,\n\t\t\tcell: ( templatePart ) => (\n\t\t\t\t<TemplateActions\n\t\t\t\t\tpostType={ templatePart.type }\n\t\t\t\t\tpostId={ templatePart.id }\n\t\t\t\t/>\n\t\t\t),\n\t\t},\n\t];\n\n\treturn (\n\t\t<Page\n\t\t\ttitle={ __( 'Template Parts' ) }\n\t\t\tactions={ <AddNewTemplatePart /> }\n\t\t>\n\t\t\t{ templateParts && (\n\t\t\t\t<Table data={ templateParts } columns={ columns } />\n\t\t\t) }\n\t\t</Page>\n\t);\n}\n"]}
|
|
@@ -81,6 +81,9 @@ function ResizableFrame({
|
|
|
81
81
|
setIsOversized,
|
|
82
82
|
isReady,
|
|
83
83
|
children,
|
|
84
|
+
|
|
85
|
+
/** The default (unresized) width/height of the frame, based on the space availalbe in the viewport. */
|
|
86
|
+
defaultSize,
|
|
84
87
|
innerContentStyle
|
|
85
88
|
}) {
|
|
86
89
|
const [frameSize, setFrameSize] = (0, _element.useState)(INITIAL_FRAME_SIZE); // The width of the resizable frame when a new resize gesture starts.
|
|
@@ -93,24 +96,13 @@ function ResizableFrame({
|
|
|
93
96
|
const {
|
|
94
97
|
setCanvasMode
|
|
95
98
|
} = (0, _lockUnlock.unlock)((0, _data.useDispatch)(_store.store));
|
|
96
|
-
const initialAspectRatioRef = (0, _element.useRef)(null); // The width of the resizable frame on initial render.
|
|
97
|
-
|
|
98
|
-
const initialComputedWidthRef = (0, _element.useRef)(null);
|
|
99
99
|
const FRAME_TRANSITION = {
|
|
100
100
|
type: 'tween',
|
|
101
101
|
duration: isResizing ? 0 : 0.5
|
|
102
102
|
};
|
|
103
103
|
const frameRef = (0, _element.useRef)(null);
|
|
104
|
-
const resizableHandleHelpId = (0, _compose.useInstanceId)(ResizableFrame, 'edit-site-resizable-frame-handle-help');
|
|
105
|
-
|
|
106
|
-
(0, _element.useEffect)(() => {
|
|
107
|
-
const {
|
|
108
|
-
offsetWidth,
|
|
109
|
-
offsetHeight
|
|
110
|
-
} = frameRef.current.resizable;
|
|
111
|
-
initialComputedWidthRef.current = offsetWidth;
|
|
112
|
-
initialAspectRatioRef.current = offsetWidth / offsetHeight;
|
|
113
|
-
}, []);
|
|
104
|
+
const resizableHandleHelpId = (0, _compose.useInstanceId)(ResizableFrame, 'edit-site-resizable-frame-handle-help');
|
|
105
|
+
const defaultAspectRatio = defaultSize.width / defaultSize.height;
|
|
114
106
|
|
|
115
107
|
const handleResizeStart = (_event, _direction, ref) => {
|
|
116
108
|
// Remember the starting width so we don't have to get `ref.offsetWidth` on
|
|
@@ -124,17 +116,17 @@ function ResizableFrame({
|
|
|
124
116
|
const normalizedDelta = delta.width / resizeRatio;
|
|
125
117
|
const deltaAbs = Math.abs(normalizedDelta);
|
|
126
118
|
const maxDoubledDelta = delta.width < 0 // is shrinking
|
|
127
|
-
? deltaAbs : (
|
|
119
|
+
? deltaAbs : (defaultSize.width - startingWidth) / 2;
|
|
128
120
|
const deltaToDouble = Math.min(deltaAbs, maxDoubledDelta);
|
|
129
121
|
const doubleSegment = deltaAbs === 0 ? 0 : deltaToDouble / deltaAbs;
|
|
130
122
|
const singleSegment = 1 - doubleSegment;
|
|
131
123
|
setResizeRatio(singleSegment + doubleSegment * 2);
|
|
132
124
|
const updatedWidth = startingWidth + delta.width;
|
|
133
|
-
setIsOversized(updatedWidth >
|
|
125
|
+
setIsOversized(updatedWidth > defaultSize.width); // Width will be controlled by the library (via `resizeRatio`),
|
|
134
126
|
// so we only need to update the height.
|
|
135
127
|
|
|
136
128
|
setFrameSize({
|
|
137
|
-
height: isOversized ? '100%' : calculateNewHeight(updatedWidth,
|
|
129
|
+
height: isOversized ? '100%' : calculateNewHeight(updatedWidth, defaultAspectRatio)
|
|
138
130
|
});
|
|
139
131
|
};
|
|
140
132
|
|
|
@@ -167,10 +159,10 @@ function ResizableFrame({
|
|
|
167
159
|
event.preventDefault();
|
|
168
160
|
const step = 20 * (event.shiftKey ? 5 : 1);
|
|
169
161
|
const delta = step * (event.key === 'ArrowLeft' ? 1 : -1);
|
|
170
|
-
const newWidth = Math.min(Math.max(FRAME_MIN_WIDTH, frameRef.current.resizable.offsetWidth + delta),
|
|
162
|
+
const newWidth = Math.min(Math.max(FRAME_MIN_WIDTH, frameRef.current.resizable.offsetWidth + delta), defaultSize.width);
|
|
171
163
|
setFrameSize({
|
|
172
164
|
width: newWidth,
|
|
173
|
-
height: calculateNewHeight(newWidth,
|
|
165
|
+
height: calculateNewHeight(newWidth, defaultAspectRatio)
|
|
174
166
|
});
|
|
175
167
|
};
|
|
176
168
|
|
|
@@ -262,7 +254,7 @@ function ResizableFrame({
|
|
|
262
254
|
"aria-describedby": resizableHandleHelpId,
|
|
263
255
|
"aria-valuenow": frameRef.current?.resizable?.offsetWidth || undefined,
|
|
264
256
|
"aria-valuemin": FRAME_MIN_WIDTH,
|
|
265
|
-
"aria-valuemax":
|
|
257
|
+
"aria-valuemax": defaultSize.width,
|
|
266
258
|
onKeyDown: handleResizableHandleKeyDown,
|
|
267
259
|
initial: "hidden",
|
|
268
260
|
exit: "hidden",
|