@wordpress/edit-site 6.1.0 → 6.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -6
- package/build/components/add-new-page/index.js +9 -1
- package/build/components/add-new-page/index.js.map +1 -1
- package/build/components/add-new-pattern/index.js +31 -16
- package/build/components/add-new-pattern/index.js.map +1 -1
- package/build/components/editor/index.js +11 -4
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor-canvas-container/index.js +18 -7
- package/build/components/editor-canvas-container/index.js.map +1 -1
- package/build/components/global-styles/font-families.js +17 -17
- package/build/components/global-styles/font-families.js.map +1 -1
- package/build/components/global-styles/font-library-modal/context.js +2 -2
- package/build/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build/components/global-styles/variations/variation.js +25 -19
- package/build/components/global-styles/variations/variation.js.map +1 -1
- package/build/components/global-styles/variations/variations-color.js +1 -0
- package/build/components/global-styles/variations/variations-color.js.map +1 -1
- package/build/components/global-styles/variations/variations-typography.js +1 -0
- package/build/components/global-styles/variations/variations-typography.js.map +1 -1
- package/build/components/page-pages/index.js +38 -6
- package/build/components/page-pages/index.js.map +1 -1
- package/build/components/page-patterns/index.js +8 -2
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/page-patterns/rename-category-menu-item.js +3 -1
- package/build/components/page-patterns/rename-category-menu-item.js.map +1 -1
- package/build/components/page-templates/index.js +10 -3
- package/build/components/page-templates/index.js.map +1 -1
- package/build/components/sidebar-dataviews/default-views.js +4 -4
- package/build/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +2 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
- package/build/deprecated.js +11 -0
- package/build/deprecated.js.map +1 -1
- package/build/hooks/commands/use-set-command-context.js +11 -0
- package/build/hooks/commands/use-set-command-context.js.map +1 -1
- package/build/lock-unlock.js +1 -1
- package/build/lock-unlock.js.map +1 -1
- package/build-module/components/add-new-page/index.js +10 -2
- package/build-module/components/add-new-page/index.js.map +1 -1
- package/build-module/components/add-new-pattern/index.js +31 -16
- package/build-module/components/add-new-pattern/index.js.map +1 -1
- package/build-module/components/editor/index.js +12 -5
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-canvas-container/index.js +19 -8
- package/build-module/components/editor-canvas-container/index.js.map +1 -1
- package/build-module/components/global-styles/font-families.js +18 -18
- package/build-module/components/global-styles/font-families.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/context.js +2 -2
- package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build-module/components/global-styles/variations/variation.js +25 -19
- package/build-module/components/global-styles/variations/variation.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-color.js +1 -0
- package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-typography.js +1 -0
- package/build-module/components/global-styles/variations/variations-typography.js.map +1 -1
- package/build-module/components/page-pages/index.js +38 -6
- package/build-module/components/page-pages/index.js.map +1 -1
- package/build-module/components/page-patterns/index.js +8 -2
- package/build-module/components/page-patterns/index.js.map +1 -1
- package/build-module/components/page-patterns/rename-category-menu-item.js +3 -1
- package/build-module/components/page-patterns/rename-category-menu-item.js.map +1 -1
- package/build-module/components/page-templates/index.js +10 -3
- package/build-module/components/page-templates/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/default-views.js +5 -5
- package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +2 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
- package/build-module/deprecated.js +11 -0
- package/build-module/deprecated.js.map +1 -1
- package/build-module/hooks/commands/use-set-command-context.js +11 -0
- package/build-module/hooks/commands/use-set-command-context.js.map +1 -1
- package/build-module/lock-unlock.js +1 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-style/style-rtl.css +19 -17
- package/build-style/style.css +19 -17
- package/lib/inflate.js +3188 -3937
- package/lib/lib-font.browser.js +32 -2
- package/lib/unbrotli.js +1818 -2458
- package/package.json +41 -41
- package/src/components/add-new-page/index.js +20 -2
- package/src/components/add-new-pattern/index.js +38 -23
- package/src/components/block-editor/style.scss +0 -11
- package/src/components/editor/index.js +13 -15
- package/src/components/editor-canvas-container/index.js +20 -8
- package/src/components/global-styles/font-families.js +28 -19
- package/src/components/global-styles/font-library-modal/context.js +2 -2
- package/src/components/global-styles/style.scss +2 -1
- package/src/components/global-styles/variations/variation.js +37 -22
- package/src/components/global-styles/variations/variations-color.js +1 -0
- package/src/components/global-styles/variations/variations-typography.js +1 -0
- package/src/components/page-pages/index.js +45 -11
- package/src/components/page-patterns/index.js +8 -2
- package/src/components/page-patterns/rename-category-menu-item.js +2 -0
- package/src/components/page-templates/index.js +9 -2
- package/src/components/sidebar-dataviews/default-views.js +13 -5
- package/src/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +6 -1
- package/src/deprecated.js +14 -0
- package/src/hooks/commands/use-set-command-context.js +12 -0
- package/src/lock-unlock.js +1 -1
- package/src/style.scss +13 -0
package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__experimentalHStack","HStack","__experimentalVStack","VStack","Button","TextControl","Modal","__","useState","jsx","_jsx","jsxs","_jsxs","notEmptyString","testString","trim","length","RenameModal","menuTitle","onClose","onSave","editedMenuTitle","setEditedMenuTitle","titleHasChanged","isEditedMenuTitleValid","title","onRequestClose","children","className","spacing","__nextHasNoMarginBottom","__next40pxDefaultSize","value","placeholder","onChange","justify","variant","onClick","__experimentalIsFocusable","disabled","type","e","preventDefault"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/rename-modal.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tButton,\n\tTextControl,\n\tModal,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\n\nconst notEmptyString = ( testString ) => testString?.trim()?.length > 0;\n\nexport default function RenameModal( { menuTitle, onClose, onSave } ) {\n\tconst [ editedMenuTitle, setEditedMenuTitle ] = useState( menuTitle );\n\n\tconst titleHasChanged = editedMenuTitle !== menuTitle;\n\n\tconst isEditedMenuTitleValid =\n\t\ttitleHasChanged && notEmptyString( editedMenuTitle );\n\n\treturn (\n\t\t<Modal
|
|
1
|
+
{"version":3,"names":["__experimentalHStack","HStack","__experimentalVStack","VStack","Button","TextControl","Modal","__","useState","jsx","_jsx","jsxs","_jsxs","notEmptyString","testString","trim","length","RenameModal","menuTitle","onClose","onSave","editedMenuTitle","setEditedMenuTitle","titleHasChanged","isEditedMenuTitleValid","title","onRequestClose","focusOnMount","size","children","className","spacing","__nextHasNoMarginBottom","__next40pxDefaultSize","value","placeholder","onChange","justify","variant","onClick","__experimentalIsFocusable","disabled","type","e","preventDefault"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/rename-modal.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tButton,\n\tTextControl,\n\tModal,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\n\nconst notEmptyString = ( testString ) => testString?.trim()?.length > 0;\n\nexport default function RenameModal( { menuTitle, onClose, onSave } ) {\n\tconst [ editedMenuTitle, setEditedMenuTitle ] = useState( menuTitle );\n\n\tconst titleHasChanged = editedMenuTitle !== menuTitle;\n\n\tconst isEditedMenuTitleValid =\n\t\ttitleHasChanged && notEmptyString( editedMenuTitle );\n\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ __( 'Rename' ) }\n\t\t\tonRequestClose={ onClose }\n\t\t\tfocusOnMount=\"firstContentElement\"\n\t\t\tsize=\"small\"\n\t\t>\n\t\t\t<form className=\"sidebar-navigation__rename-modal-form\">\n\t\t\t\t<VStack spacing=\"3\">\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvalue={ editedMenuTitle }\n\t\t\t\t\t\tplaceholder={ __( 'Navigation title' ) }\n\t\t\t\t\t\tonChange={ setEditedMenuTitle }\n\t\t\t\t\t/>\n\t\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t</Button>\n\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t__experimentalIsFocusable\n\t\t\t\t\t\t\tdisabled={ ! isEditedMenuTitleValid }\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\tonClick={ ( e ) => {\n\t\t\t\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\t\t\t\tif ( ! isEditedMenuTitleValid ) {\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonSave( { title: editedMenuTitle } );\n\n\t\t\t\t\t\t\t\t// Immediate close avoids ability to hit save multiple times.\n\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Save' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</HStack>\n\t\t\t\t</VStack>\n\t\t\t</form>\n\t\t</Modal>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,EAC9BC,MAAM,EACNC,WAAW,EACXC,KAAK,QACC,uBAAuB;AAC9B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,QAAQ,QAAQ,oBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAE9C,MAAMC,cAAc,GAAKC,UAAU,IAAMA,UAAU,EAAEC,IAAI,CAAC,CAAC,EAAEC,MAAM,GAAG,CAAC;AAEvE,eAAe,SAASC,WAAWA,CAAE;EAAEC,SAAS;EAAEC,OAAO;EAAEC;AAAO,CAAC,EAAG;EACrE,MAAM,CAAEC,eAAe,EAAEC,kBAAkB,CAAE,GAAGd,QAAQ,CAAEU,SAAU,CAAC;EAErE,MAAMK,eAAe,GAAGF,eAAe,KAAKH,SAAS;EAErD,MAAMM,sBAAsB,GAC3BD,eAAe,IAAIV,cAAc,CAAEQ,eAAgB,CAAC;EAErD,oBACCX,IAAA,CAACJ,KAAK;IACLmB,KAAK,EAAGlB,EAAE,CAAE,QAAS,CAAG;IACxBmB,cAAc,EAAGP,OAAS;IAC1BQ,YAAY,EAAC,qBAAqB;IAClCC,IAAI,EAAC,OAAO;IAAAC,QAAA,eAEZnB,IAAA;MAAMoB,SAAS,EAAC,uCAAuC;MAAAD,QAAA,eACtDjB,KAAA,CAACT,MAAM;QAAC4B,OAAO,EAAC,GAAG;QAAAF,QAAA,gBAClBnB,IAAA,CAACL,WAAW;UACX2B,uBAAuB;UACvBC,qBAAqB;UACrBC,KAAK,EAAGb,eAAiB;UACzBc,WAAW,EAAG5B,EAAE,CAAE,kBAAmB,CAAG;UACxC6B,QAAQ,EAAGd;QAAoB,CAC/B,CAAC,eACFV,KAAA,CAACX,MAAM;UAACoC,OAAO,EAAC,OAAO;UAAAR,QAAA,gBACtBnB,IAAA,CAACN,MAAM;YACN6B,qBAAqB;YACrBK,OAAO,EAAC,UAAU;YAClBC,OAAO,EAAGpB,OAAS;YAAAU,QAAA,EAEjBtB,EAAE,CAAE,QAAS;UAAC,CACT,CAAC,eAETG,IAAA,CAACN,MAAM;YACN6B,qBAAqB;YACrBO,yBAAyB;YACzBC,QAAQ,EAAG,CAAEjB,sBAAwB;YACrCc,OAAO,EAAC,SAAS;YACjBI,IAAI,EAAC,QAAQ;YACbH,OAAO,EAAKI,CAAC,IAAM;cAClBA,CAAC,CAACC,cAAc,CAAC,CAAC;cAElB,IAAK,CAAEpB,sBAAsB,EAAG;gBAC/B;cACD;cACAJ,MAAM,CAAE;gBAAEK,KAAK,EAAEJ;cAAgB,CAAE,CAAC;;cAEpC;cACAF,OAAO,CAAC,CAAC;YACV,CAAG;YAAAU,QAAA,EAEDtB,EAAE,CAAE,MAAO;UAAC,CACP,CAAC;QAAA,CACF,CAAC;MAAA,CACF;IAAC,CACJ;EAAC,CACD,CAAC;AAEV","ignoreList":[]}
|
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { PluginMoreMenuItem as EditorPluginMoreMenuItem, PluginSidebar as EditorPluginSidebar, PluginSidebarMoreMenuItem as EditorPluginSidebarMoreMenuItem } from '@wordpress/editor';
|
|
5
|
+
import { getPath } from '@wordpress/url';
|
|
5
6
|
import deprecated from '@wordpress/deprecated';
|
|
6
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
const isSiteEditor = getPath(window.location.href)?.includes('site-editor.php');
|
|
7
9
|
const deprecateSlot = name => {
|
|
8
10
|
deprecated(`wp.editPost.${name}`, {
|
|
9
11
|
since: '6.6',
|
|
@@ -16,6 +18,9 @@ const deprecateSlot = name => {
|
|
|
16
18
|
* @see PluginMoreMenuItem in @wordpress/editor package.
|
|
17
19
|
*/
|
|
18
20
|
export function PluginMoreMenuItem(props) {
|
|
21
|
+
if (!isSiteEditor) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
19
24
|
deprecateSlot('PluginMoreMenuItem');
|
|
20
25
|
return /*#__PURE__*/_jsx(EditorPluginMoreMenuItem, {
|
|
21
26
|
...props
|
|
@@ -26,6 +31,9 @@ export function PluginMoreMenuItem(props) {
|
|
|
26
31
|
* @see PluginSidebar in @wordpress/editor package.
|
|
27
32
|
*/
|
|
28
33
|
export function PluginSidebar(props) {
|
|
34
|
+
if (!isSiteEditor) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
29
37
|
deprecateSlot('PluginSidebar');
|
|
30
38
|
return /*#__PURE__*/_jsx(EditorPluginSidebar, {
|
|
31
39
|
...props
|
|
@@ -36,6 +44,9 @@ export function PluginSidebar(props) {
|
|
|
36
44
|
* @see PluginSidebarMoreMenuItem in @wordpress/editor package.
|
|
37
45
|
*/
|
|
38
46
|
export function PluginSidebarMoreMenuItem(props) {
|
|
47
|
+
if (!isSiteEditor) {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
39
50
|
deprecateSlot('PluginSidebarMoreMenuItem');
|
|
40
51
|
return /*#__PURE__*/_jsx(EditorPluginSidebarMoreMenuItem, {
|
|
41
52
|
...props
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["PluginMoreMenuItem","EditorPluginMoreMenuItem","PluginSidebar","EditorPluginSidebar","PluginSidebarMoreMenuItem","EditorPluginSidebarMoreMenuItem","deprecated","jsx","_jsx","deprecateSlot","name","since","alternative","props"],"sources":["@wordpress/edit-site/src/deprecated.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tPluginMoreMenuItem as EditorPluginMoreMenuItem,\n\tPluginSidebar as EditorPluginSidebar,\n\tPluginSidebarMoreMenuItem as EditorPluginSidebarMoreMenuItem,\n} from '@wordpress/editor';\nimport deprecated from '@wordpress/deprecated';\n\nconst deprecateSlot = ( name ) => {\n\tdeprecated( `wp.editPost.${ name }`, {\n\t\tsince: '6.6',\n\t\talternative: `wp.editor.${ name }`,\n\t} );\n};\n\n/* eslint-disable jsdoc/require-param */\n/**\n * @see PluginMoreMenuItem in @wordpress/editor package.\n */\nexport function PluginMoreMenuItem( props ) {\n\tdeprecateSlot( 'PluginMoreMenuItem' );\n\treturn <EditorPluginMoreMenuItem { ...props } />;\n}\n\n/**\n * @see PluginSidebar in @wordpress/editor package.\n */\nexport function PluginSidebar( props ) {\n\tdeprecateSlot( 'PluginSidebar' );\n\treturn <EditorPluginSidebar { ...props } />;\n}\n\n/**\n * @see PluginSidebarMoreMenuItem in @wordpress/editor package.\n */\nexport function PluginSidebarMoreMenuItem( props ) {\n\tdeprecateSlot( 'PluginSidebarMoreMenuItem' );\n\treturn <EditorPluginSidebarMoreMenuItem { ...props } />;\n}\n/* eslint-enable jsdoc/require-param */\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,kBAAkB,IAAIC,wBAAwB,EAC9CC,aAAa,IAAIC,mBAAmB,EACpCC,yBAAyB,IAAIC,+BAA+B,QACtD,mBAAmB;AAC1B,OAAOC,UAAU,MAAM,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE/C,MAAMC,aAAa,GAAKC,IAAI,IAAM;
|
|
1
|
+
{"version":3,"names":["PluginMoreMenuItem","EditorPluginMoreMenuItem","PluginSidebar","EditorPluginSidebar","PluginSidebarMoreMenuItem","EditorPluginSidebarMoreMenuItem","getPath","deprecated","jsx","_jsx","isSiteEditor","window","location","href","includes","deprecateSlot","name","since","alternative","props"],"sources":["@wordpress/edit-site/src/deprecated.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tPluginMoreMenuItem as EditorPluginMoreMenuItem,\n\tPluginSidebar as EditorPluginSidebar,\n\tPluginSidebarMoreMenuItem as EditorPluginSidebarMoreMenuItem,\n} from '@wordpress/editor';\nimport { getPath } from '@wordpress/url';\nimport deprecated from '@wordpress/deprecated';\n\nconst isSiteEditor = getPath( window.location.href )?.includes(\n\t'site-editor.php'\n);\n\nconst deprecateSlot = ( name ) => {\n\tdeprecated( `wp.editPost.${ name }`, {\n\t\tsince: '6.6',\n\t\talternative: `wp.editor.${ name }`,\n\t} );\n};\n\n/* eslint-disable jsdoc/require-param */\n/**\n * @see PluginMoreMenuItem in @wordpress/editor package.\n */\nexport function PluginMoreMenuItem( props ) {\n\tif ( ! isSiteEditor ) {\n\t\treturn null;\n\t}\n\tdeprecateSlot( 'PluginMoreMenuItem' );\n\treturn <EditorPluginMoreMenuItem { ...props } />;\n}\n\n/**\n * @see PluginSidebar in @wordpress/editor package.\n */\nexport function PluginSidebar( props ) {\n\tif ( ! isSiteEditor ) {\n\t\treturn null;\n\t}\n\tdeprecateSlot( 'PluginSidebar' );\n\treturn <EditorPluginSidebar { ...props } />;\n}\n\n/**\n * @see PluginSidebarMoreMenuItem in @wordpress/editor package.\n */\nexport function PluginSidebarMoreMenuItem( props ) {\n\tif ( ! isSiteEditor ) {\n\t\treturn null;\n\t}\n\tdeprecateSlot( 'PluginSidebarMoreMenuItem' );\n\treturn <EditorPluginSidebarMoreMenuItem { ...props } />;\n}\n/* eslint-enable jsdoc/require-param */\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,kBAAkB,IAAIC,wBAAwB,EAC9CC,aAAa,IAAIC,mBAAmB,EACpCC,yBAAyB,IAAIC,+BAA+B,QACtD,mBAAmB;AAC1B,SAASC,OAAO,QAAQ,gBAAgB;AACxC,OAAOC,UAAU,MAAM,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE/C,MAAMC,YAAY,GAAGJ,OAAO,CAAEK,MAAM,CAACC,QAAQ,CAACC,IAAK,CAAC,EAAEC,QAAQ,CAC7D,iBACD,CAAC;AAED,MAAMC,aAAa,GAAKC,IAAI,IAAM;EACjCT,UAAU,CAAG,eAAeS,IAAM,EAAC,EAAE;IACpCC,KAAK,EAAE,KAAK;IACZC,WAAW,EAAG,aAAaF,IAAM;EAClC,CAAE,CAAC;AACJ,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,SAAShB,kBAAkBA,CAAEmB,KAAK,EAAG;EAC3C,IAAK,CAAET,YAAY,EAAG;IACrB,OAAO,IAAI;EACZ;EACAK,aAAa,CAAE,oBAAqB,CAAC;EACrC,oBAAON,IAAA,CAACR,wBAAwB;IAAA,GAAMkB;EAAK,CAAI,CAAC;AACjD;;AAEA;AACA;AACA;AACA,OAAO,SAASjB,aAAaA,CAAEiB,KAAK,EAAG;EACtC,IAAK,CAAET,YAAY,EAAG;IACrB,OAAO,IAAI;EACZ;EACAK,aAAa,CAAE,eAAgB,CAAC;EAChC,oBAAON,IAAA,CAACN,mBAAmB;IAAA,GAAMgB;EAAK,CAAI,CAAC;AAC5C;;AAEA;AACA;AACA;AACA,OAAO,SAASf,yBAAyBA,CAAEe,KAAK,EAAG;EAClD,IAAK,CAAET,YAAY,EAAG;IACrB,OAAO,IAAI;EACZ;EACAK,aAAa,CAAE,2BAA4B,CAAC;EAC5C,oBAAON,IAAA,CAACJ,+BAA+B;IAAA,GAAMc;EAAK,CAAI,CAAC;AACxD;AACA","ignoreList":[]}
|
|
@@ -10,6 +10,7 @@ import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
|
10
10
|
*/
|
|
11
11
|
import { store as editSiteStore } from '../../store';
|
|
12
12
|
import { unlock } from '../../lock-unlock';
|
|
13
|
+
import { useHasEditorCanvasContainer } from '../../components/editor-canvas-container';
|
|
13
14
|
const {
|
|
14
15
|
useCommandContext
|
|
15
16
|
} = unlock(commandsPrivateApis);
|
|
@@ -33,6 +34,8 @@ export default function useSetCommandContext() {
|
|
|
33
34
|
hasBlockSelected: getBlockSelectionStart()
|
|
34
35
|
};
|
|
35
36
|
}, []);
|
|
37
|
+
const hasEditorCanvasContainer = useHasEditorCanvasContainer();
|
|
38
|
+
|
|
36
39
|
// Sets the right context for the command palette
|
|
37
40
|
let commandContext = 'site-editor';
|
|
38
41
|
if (canvasMode === 'edit') {
|
|
@@ -41,6 +44,14 @@ export default function useSetCommandContext() {
|
|
|
41
44
|
if (hasBlockSelected) {
|
|
42
45
|
commandContext = 'block-selection-edit';
|
|
43
46
|
}
|
|
47
|
+
if (hasEditorCanvasContainer) {
|
|
48
|
+
/*
|
|
49
|
+
* The editor canvas overlay will likely be deprecated in the future, so for now we clear the command context
|
|
50
|
+
* to remove the suggested commands that may not make sense with Style Book or Style Revisions open.
|
|
51
|
+
* See https://github.com/WordPress/gutenberg/issues/62216.
|
|
52
|
+
*/
|
|
53
|
+
commandContext = '';
|
|
54
|
+
}
|
|
44
55
|
useCommandContext(commandContext);
|
|
45
56
|
}
|
|
46
57
|
//# sourceMappingURL=use-set-command-context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSelect","privateApis","commandsPrivateApis","store","blockEditorStore","editSiteStore","unlock","useCommandContext","useSetCommandContext","hasBlockSelected","canvasMode","select","getCanvasMode","getBlockSelectionStart","commandContext"],"sources":["@wordpress/edit-site/src/hooks/commands/use-set-command-context.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { privateApis as commandsPrivateApis } from '@wordpress/commands';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { useCommandContext } = unlock( commandsPrivateApis );\n\n/**\n * React hook used to set the correct command context based on the current state.\n */\nexport default function useSetCommandContext() {\n\tconst { hasBlockSelected, canvasMode } = useSelect( ( select ) => {\n\t\tconst { getCanvasMode } = unlock( select( editSiteStore ) );\n\t\tconst { getBlockSelectionStart } = select( blockEditorStore );\n\t\treturn {\n\t\t\tcanvasMode: getCanvasMode(),\n\t\t\thasBlockSelected: getBlockSelectionStart(),\n\t\t};\n\t}, [] );\n\t// Sets the right context for the command palette\n\tlet commandContext = 'site-editor';\n\tif ( canvasMode === 'edit' ) {\n\t\tcommandContext = 'entity-edit';\n\t}\n\tif ( hasBlockSelected ) {\n\t\tcommandContext = 'block-selection-edit';\n\t}\n\tuseCommandContext( commandContext );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,WAAW,IAAIC,mBAAmB,QAAQ,qBAAqB;AACxE,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;;AAEnE;AACA;AACA;AACA,SAASD,KAAK,IAAIE,aAAa,QAAQ,aAAa;AACpD,SAASC,MAAM,QAAQ,mBAAmB;
|
|
1
|
+
{"version":3,"names":["useSelect","privateApis","commandsPrivateApis","store","blockEditorStore","editSiteStore","unlock","useHasEditorCanvasContainer","useCommandContext","useSetCommandContext","hasBlockSelected","canvasMode","select","getCanvasMode","getBlockSelectionStart","hasEditorCanvasContainer","commandContext"],"sources":["@wordpress/edit-site/src/hooks/commands/use-set-command-context.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { privateApis as commandsPrivateApis } from '@wordpress/commands';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { useHasEditorCanvasContainer } from '../../components/editor-canvas-container';\n\nconst { useCommandContext } = unlock( commandsPrivateApis );\n\n/**\n * React hook used to set the correct command context based on the current state.\n */\nexport default function useSetCommandContext() {\n\tconst { hasBlockSelected, canvasMode } = useSelect( ( select ) => {\n\t\tconst { getCanvasMode } = unlock( select( editSiteStore ) );\n\t\tconst { getBlockSelectionStart } = select( blockEditorStore );\n\t\treturn {\n\t\t\tcanvasMode: getCanvasMode(),\n\t\t\thasBlockSelected: getBlockSelectionStart(),\n\t\t};\n\t}, [] );\n\n\tconst hasEditorCanvasContainer = useHasEditorCanvasContainer();\n\n\t// Sets the right context for the command palette\n\tlet commandContext = 'site-editor';\n\tif ( canvasMode === 'edit' ) {\n\t\tcommandContext = 'entity-edit';\n\t}\n\tif ( hasBlockSelected ) {\n\t\tcommandContext = 'block-selection-edit';\n\t}\n\tif ( hasEditorCanvasContainer ) {\n\t\t/*\n\t\t * The editor canvas overlay will likely be deprecated in the future, so for now we clear the command context\n\t\t * to remove the suggested commands that may not make sense with Style Book or Style Revisions open.\n\t\t * See https://github.com/WordPress/gutenberg/issues/62216.\n\t\t */\n\t\tcommandContext = '';\n\t}\n\tuseCommandContext( commandContext );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,WAAW,IAAIC,mBAAmB,QAAQ,qBAAqB;AACxE,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;;AAEnE;AACA;AACA;AACA,SAASD,KAAK,IAAIE,aAAa,QAAQ,aAAa;AACpD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,2BAA2B,QAAQ,0CAA0C;AAEtF,MAAM;EAAEC;AAAkB,CAAC,GAAGF,MAAM,CAAEJ,mBAAoB,CAAC;;AAE3D;AACA;AACA;AACA,eAAe,SAASO,oBAAoBA,CAAA,EAAG;EAC9C,MAAM;IAAEC,gBAAgB;IAAEC;EAAW,CAAC,GAAGX,SAAS,CAAIY,MAAM,IAAM;IACjE,MAAM;MAAEC;IAAc,CAAC,GAAGP,MAAM,CAAEM,MAAM,CAAEP,aAAc,CAAE,CAAC;IAC3D,MAAM;MAAES;IAAuB,CAAC,GAAGF,MAAM,CAAER,gBAAiB,CAAC;IAC7D,OAAO;MACNO,UAAU,EAAEE,aAAa,CAAC,CAAC;MAC3BH,gBAAgB,EAAEI,sBAAsB,CAAC;IAC1C,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAMC,wBAAwB,GAAGR,2BAA2B,CAAC,CAAC;;EAE9D;EACA,IAAIS,cAAc,GAAG,aAAa;EAClC,IAAKL,UAAU,KAAK,MAAM,EAAG;IAC5BK,cAAc,GAAG,aAAa;EAC/B;EACA,IAAKN,gBAAgB,EAAG;IACvBM,cAAc,GAAG,sBAAsB;EACxC;EACA,IAAKD,wBAAwB,EAAG;IAC/B;AACF;AACA;AACA;AACA;IACEC,cAAc,GAAG,EAAE;EACpB;EACAR,iBAAiB,CAAEQ,cAAe,CAAC;AACpC","ignoreList":[]}
|
|
@@ -5,5 +5,5 @@ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/pri
|
|
|
5
5
|
export const {
|
|
6
6
|
lock,
|
|
7
7
|
unlock
|
|
8
|
-
} = __dangerousOptInToUnstableAPIsOnlyForCoreModules('I
|
|
8
|
+
} = __dangerousOptInToUnstableAPIsOnlyForCoreModules('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/edit-site');
|
|
9
9
|
//# sourceMappingURL=lock-unlock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__dangerousOptInToUnstableAPIsOnlyForCoreModules","lock","unlock"],"sources":["@wordpress/edit-site/src/lock-unlock.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I
|
|
1
|
+
{"version":3,"names":["__dangerousOptInToUnstableAPIsOnlyForCoreModules","lock","unlock"],"sources":["@wordpress/edit-site/src/lock-unlock.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.',\n\t\t'@wordpress/edit-site'\n\t);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gDAAgD,QAAQ,yBAAyB;AAE1F,OAAO,MAAM;EAAEC,IAAI;EAAEC;AAAO,CAAC,GAC5BF,gDAAgD,CAC/C,+HAA+H,EAC/H,sBACD,CAAC","ignoreList":[]}
|
|
@@ -1108,18 +1108,6 @@
|
|
|
1108
1108
|
align-items: flex-start;
|
|
1109
1109
|
}
|
|
1110
1110
|
|
|
1111
|
-
/* stylelint-disable -- Disable reason: View Transitions not supported properly by stylelint. */
|
|
1112
|
-
::view-transition-old(frame),
|
|
1113
|
-
::view-transition-new(frame) {
|
|
1114
|
-
animation-duration: 0;
|
|
1115
|
-
}
|
|
1116
|
-
|
|
1117
|
-
/* stylelint-enable */
|
|
1118
|
-
.edit-site-visual-editor__editor-canvas {
|
|
1119
|
-
/* stylelint-disable -- Disable reason: View Transitions not supported properly by stylelint. */
|
|
1120
|
-
view-transition-name: frame;
|
|
1121
|
-
/* stylelint-enable */
|
|
1122
|
-
}
|
|
1123
1111
|
.edit-site-visual-editor__editor-canvas.is-focused {
|
|
1124
1112
|
outline: calc(2 * var(--wp-admin-border-width-focus)) solid var(--wp-admin-theme-color);
|
|
1125
1113
|
outline-offset: calc(-2 * var(--wp-admin-border-width-focus));
|
|
@@ -1199,7 +1187,8 @@
|
|
|
1199
1187
|
color: #757575;
|
|
1200
1188
|
}
|
|
1201
1189
|
|
|
1202
|
-
.edit-site-global-styles-font-families__add-fonts
|
|
1190
|
+
.edit-site-global-styles-font-families__add-fonts,
|
|
1191
|
+
.edit-site-global-styles-font-families__manage-fonts {
|
|
1203
1192
|
justify-content: center;
|
|
1204
1193
|
}
|
|
1205
1194
|
|
|
@@ -2343,7 +2332,7 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
|
|
|
2343
2332
|
overflow-y: auto;
|
|
2344
2333
|
}
|
|
2345
2334
|
|
|
2346
|
-
@keyframes
|
|
2335
|
+
@keyframes _fcnwm_slide-from-right {
|
|
2347
2336
|
from {
|
|
2348
2337
|
transform: translateX(-50px);
|
|
2349
2338
|
opacity: 0;
|
|
@@ -2353,7 +2342,7 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
|
|
|
2353
2342
|
opacity: 1;
|
|
2354
2343
|
}
|
|
2355
2344
|
}
|
|
2356
|
-
@keyframes
|
|
2345
|
+
@keyframes _fcnwm_slide-from-left {
|
|
2357
2346
|
from {
|
|
2358
2347
|
transform: translateX(50px);
|
|
2359
2348
|
opacity: 0;
|
|
@@ -2409,10 +2398,10 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
|
|
|
2409
2398
|
}
|
|
2410
2399
|
}
|
|
2411
2400
|
.edit-site-sidebar__screen-wrapper.slide-from-left {
|
|
2412
|
-
animation-name:
|
|
2401
|
+
animation-name: _fcnwm_slide-from-left;
|
|
2413
2402
|
}
|
|
2414
2403
|
.edit-site-sidebar__screen-wrapper.slide-from-right {
|
|
2415
|
-
animation-name:
|
|
2404
|
+
animation-name: _fcnwm_slide-from-right;
|
|
2416
2405
|
}
|
|
2417
2406
|
|
|
2418
2407
|
.edit-site-sidebar-button {
|
|
@@ -3134,6 +3123,19 @@ button.font-library-modal__upload-area {
|
|
|
3134
3123
|
outline-color: var(--wp-admin-theme-color);
|
|
3135
3124
|
}
|
|
3136
3125
|
|
|
3126
|
+
/* stylelint-disable -- Disable reason: View Transitions not supported properly by stylelint. */
|
|
3127
|
+
::view-transition-image-pair(root) {
|
|
3128
|
+
isolation: auto;
|
|
3129
|
+
}
|
|
3130
|
+
|
|
3131
|
+
::view-transition-old(root),
|
|
3132
|
+
::view-transition-new(root) {
|
|
3133
|
+
animation: none;
|
|
3134
|
+
mix-blend-mode: normal;
|
|
3135
|
+
display: block;
|
|
3136
|
+
}
|
|
3137
|
+
|
|
3138
|
+
/* stylelint-enable */
|
|
3137
3139
|
body.js #wpadminbar {
|
|
3138
3140
|
display: none;
|
|
3139
3141
|
}
|
package/build-style/style.css
CHANGED
|
@@ -1108,18 +1108,6 @@
|
|
|
1108
1108
|
align-items: flex-start;
|
|
1109
1109
|
}
|
|
1110
1110
|
|
|
1111
|
-
/* stylelint-disable -- Disable reason: View Transitions not supported properly by stylelint. */
|
|
1112
|
-
::view-transition-old(frame),
|
|
1113
|
-
::view-transition-new(frame) {
|
|
1114
|
-
animation-duration: 0;
|
|
1115
|
-
}
|
|
1116
|
-
|
|
1117
|
-
/* stylelint-enable */
|
|
1118
|
-
.edit-site-visual-editor__editor-canvas {
|
|
1119
|
-
/* stylelint-disable -- Disable reason: View Transitions not supported properly by stylelint. */
|
|
1120
|
-
view-transition-name: frame;
|
|
1121
|
-
/* stylelint-enable */
|
|
1122
|
-
}
|
|
1123
1111
|
.edit-site-visual-editor__editor-canvas.is-focused {
|
|
1124
1112
|
outline: calc(2 * var(--wp-admin-border-width-focus)) solid var(--wp-admin-theme-color);
|
|
1125
1113
|
outline-offset: calc(-2 * var(--wp-admin-border-width-focus));
|
|
@@ -1199,7 +1187,8 @@
|
|
|
1199
1187
|
color: #757575;
|
|
1200
1188
|
}
|
|
1201
1189
|
|
|
1202
|
-
.edit-site-global-styles-font-families__add-fonts
|
|
1190
|
+
.edit-site-global-styles-font-families__add-fonts,
|
|
1191
|
+
.edit-site-global-styles-font-families__manage-fonts {
|
|
1203
1192
|
justify-content: center;
|
|
1204
1193
|
}
|
|
1205
1194
|
|
|
@@ -2344,7 +2333,7 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
|
|
|
2344
2333
|
overflow-y: auto;
|
|
2345
2334
|
}
|
|
2346
2335
|
|
|
2347
|
-
@keyframes
|
|
2336
|
+
@keyframes _fcnwm_slide-from-right {
|
|
2348
2337
|
from {
|
|
2349
2338
|
transform: translateX(50px);
|
|
2350
2339
|
opacity: 0;
|
|
@@ -2354,7 +2343,7 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
|
|
|
2354
2343
|
opacity: 1;
|
|
2355
2344
|
}
|
|
2356
2345
|
}
|
|
2357
|
-
@keyframes
|
|
2346
|
+
@keyframes _fcnwm_slide-from-left {
|
|
2358
2347
|
from {
|
|
2359
2348
|
transform: translateX(-50px);
|
|
2360
2349
|
opacity: 0;
|
|
@@ -2410,10 +2399,10 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
|
|
|
2410
2399
|
}
|
|
2411
2400
|
}
|
|
2412
2401
|
.edit-site-sidebar__screen-wrapper.slide-from-left {
|
|
2413
|
-
animation-name:
|
|
2402
|
+
animation-name: _fcnwm_slide-from-left;
|
|
2414
2403
|
}
|
|
2415
2404
|
.edit-site-sidebar__screen-wrapper.slide-from-right {
|
|
2416
|
-
animation-name:
|
|
2405
|
+
animation-name: _fcnwm_slide-from-right;
|
|
2417
2406
|
}
|
|
2418
2407
|
|
|
2419
2408
|
.edit-site-sidebar-button {
|
|
@@ -3135,6 +3124,19 @@ button.font-library-modal__upload-area {
|
|
|
3135
3124
|
outline-color: var(--wp-admin-theme-color);
|
|
3136
3125
|
}
|
|
3137
3126
|
|
|
3127
|
+
/* stylelint-disable -- Disable reason: View Transitions not supported properly by stylelint. */
|
|
3128
|
+
::view-transition-image-pair(root) {
|
|
3129
|
+
isolation: auto;
|
|
3130
|
+
}
|
|
3131
|
+
|
|
3132
|
+
::view-transition-old(root),
|
|
3133
|
+
::view-transition-new(root) {
|
|
3134
|
+
animation: none;
|
|
3135
|
+
mix-blend-mode: normal;
|
|
3136
|
+
display: block;
|
|
3137
|
+
}
|
|
3138
|
+
|
|
3139
|
+
/* stylelint-enable */
|
|
3138
3140
|
body.js #wpadminbar {
|
|
3139
3141
|
display: none;
|
|
3140
3142
|
}
|