@wordpress/edit-post 7.15.0 → 7.16.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 +2 -0
- package/build/components/header/{document-title → document-actions}/index.js +10 -11
- package/build/components/header/document-actions/index.js.map +1 -0
- package/build/components/header/header-toolbar/index.native.js +2 -1
- package/build/components/header/header-toolbar/index.native.js.map +1 -1
- package/build/components/header/index.js +3 -3
- package/build/components/header/index.js.map +1 -1
- package/build/components/header/mode-switcher/index.js +23 -4
- package/build/components/header/mode-switcher/index.js.map +1 -1
- package/build/components/layout/index.js +38 -5
- package/build/components/layout/index.js.map +1 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +2 -2
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build/components/sidebar/discussion-panel/index.js +20 -20
- package/build/components/sidebar/discussion-panel/index.js.map +1 -1
- package/build/editor.js +2 -39
- package/build/editor.js.map +1 -1
- package/build/hooks/commands/use-common-commands.js +61 -4
- package/build/hooks/commands/use-common-commands.js.map +1 -1
- package/build/index.js +2 -1
- package/build/index.js.map +1 -1
- package/build-module/components/header/{document-title → document-actions}/index.js +10 -11
- package/build-module/components/header/document-actions/index.js.map +1 -0
- package/build-module/components/header/header-toolbar/index.native.js +2 -1
- package/build-module/components/header/header-toolbar/index.native.js.map +1 -1
- package/build-module/components/header/index.js +3 -3
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/header/mode-switcher/index.js +23 -4
- package/build-module/components/header/mode-switcher/index.js.map +1 -1
- package/build-module/components/layout/index.js +38 -6
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +3 -3
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build-module/components/sidebar/discussion-panel/index.js +21 -19
- package/build-module/components/sidebar/discussion-panel/index.js.map +1 -1
- package/build-module/editor.js +2 -38
- package/build-module/editor.js.map +1 -1
- package/build-module/hooks/commands/use-common-commands.js +60 -5
- package/build-module/hooks/commands/use-common-commands.js.map +1 -1
- package/build-module/index.js +2 -1
- package/build-module/index.js.map +1 -1
- package/build-style/style-rtl.css +21 -18
- package/build-style/style.css +21 -18
- package/package.json +32 -32
- package/src/components/header/{document-title → document-actions}/index.js +22 -23
- package/src/components/header/{document-title → document-actions}/style.scss +25 -22
- package/src/components/header/header-toolbar/index.native.js +1 -0
- package/src/components/header/header-toolbar/style.scss +4 -0
- package/src/components/header/index.js +3 -3
- package/src/components/header/mode-switcher/index.js +23 -4
- package/src/components/header/style.scss +1 -1
- package/src/components/layout/index.js +47 -2
- package/src/components/preferences-modal/test/__snapshots__/index.js.snap +5 -2
- package/src/components/preferences-modal/test/index.js +4 -4
- package/src/components/secondary-sidebar/list-view-sidebar.js +3 -3
- package/src/components/sidebar/discussion-panel/index.js +15 -20
- package/src/editor.js +2 -47
- package/src/hooks/commands/use-common-commands.js +81 -15
- package/src/index.js +5 -1
- package/src/style.scss +1 -1
- package/src/test/editor.native.js +4 -3
- package/build/components/header/document-title/index.js.map +0 -1
- package/build-module/components/header/document-title/index.js.map +0 -1
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
5
5
|
import { __, isRTL } from '@wordpress/i18n';
|
|
6
|
-
import { code, cog, drawerLeft, drawerRight, blockDefault,
|
|
6
|
+
import { code, cog, drawerLeft, drawerRight, blockDefault, keyboard, desktop, listView, external, formatListBullets } from '@wordpress/icons';
|
|
7
7
|
import { useCommand } from '@wordpress/commands';
|
|
8
8
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
9
9
|
import { store as interfaceStore } from '@wordpress/interface';
|
|
10
|
+
import { store as editorStore } from '@wordpress/editor';
|
|
11
|
+
import { store as noticesStore } from '@wordpress/notices';
|
|
10
12
|
/**
|
|
11
13
|
* Internal dependencies
|
|
12
14
|
*/
|
|
@@ -27,21 +29,32 @@ export default function useCommonCommands() {
|
|
|
27
29
|
const {
|
|
28
30
|
editorMode,
|
|
29
31
|
activeSidebar,
|
|
30
|
-
isListViewOpen
|
|
32
|
+
isListViewOpen,
|
|
33
|
+
isPublishSidebarEnabled,
|
|
34
|
+
showBlockBreadcrumbs
|
|
31
35
|
} = useSelect(select => {
|
|
32
36
|
const {
|
|
33
37
|
getEditorMode,
|
|
34
|
-
isListViewOpened
|
|
38
|
+
isListViewOpened,
|
|
39
|
+
isFeatureActive
|
|
35
40
|
} = select(editPostStore);
|
|
36
41
|
return {
|
|
37
42
|
activeSidebar: select(interfaceStore).getActiveComplementaryArea(editPostStore.name),
|
|
38
43
|
editorMode: getEditorMode(),
|
|
39
|
-
isListViewOpen: isListViewOpened()
|
|
44
|
+
isListViewOpen: isListViewOpened(),
|
|
45
|
+
isPublishSidebarEnabled: select(editorStore).isPublishSidebarEnabled(),
|
|
46
|
+
showBlockBreadcrumbs: isFeatureActive('showBlockBreadcrumbs')
|
|
40
47
|
};
|
|
41
48
|
}, []);
|
|
42
49
|
const {
|
|
43
50
|
toggle
|
|
44
51
|
} = useDispatch(preferencesStore);
|
|
52
|
+
const {
|
|
53
|
+
createInfoNotice
|
|
54
|
+
} = useDispatch(noticesStore);
|
|
55
|
+
const {
|
|
56
|
+
__unstableSaveForPreview
|
|
57
|
+
} = useDispatch(editorStore);
|
|
45
58
|
useCommand({
|
|
46
59
|
name: 'core/open-settings-sidebar',
|
|
47
60
|
label: __('Toggle settings sidebar'),
|
|
@@ -151,10 +164,52 @@ export default function useCommonCommands() {
|
|
|
151
164
|
useCommand({
|
|
152
165
|
name: 'core/open-shortcut-help',
|
|
153
166
|
label: __('Open keyboard shortcuts'),
|
|
154
|
-
icon:
|
|
167
|
+
icon: keyboard,
|
|
155
168
|
callback: () => {
|
|
156
169
|
openModal(KEYBOARD_SHORTCUT_HELP_MODAL_NAME);
|
|
157
170
|
}
|
|
158
171
|
});
|
|
172
|
+
useCommand({
|
|
173
|
+
name: 'core/toggle-breadcrumbs',
|
|
174
|
+
label: showBlockBreadcrumbs ? __('Hide block breadcrumbs') : __('Show block breadcrumbs'),
|
|
175
|
+
icon: cog,
|
|
176
|
+
callback: ({
|
|
177
|
+
close
|
|
178
|
+
}) => {
|
|
179
|
+
toggle('core/edit-post', 'showBlockBreadcrumbs');
|
|
180
|
+
close();
|
|
181
|
+
createInfoNotice(showBlockBreadcrumbs ? __('Breadcrumbs off.') : __('Breadcrumbs on.'), {
|
|
182
|
+
id: 'core/edit-post/toggle-breadcrumbs/notice',
|
|
183
|
+
type: 'snackbar'
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
useCommand({
|
|
188
|
+
name: 'core/toggle-publish-sidebar',
|
|
189
|
+
label: isPublishSidebarEnabled ? __('Disable pre-publish checklist') : __('Enable pre-publish checklist'),
|
|
190
|
+
icon: formatListBullets,
|
|
191
|
+
callback: ({
|
|
192
|
+
close
|
|
193
|
+
}) => {
|
|
194
|
+
close();
|
|
195
|
+
toggle('core/edit-post', 'isPublishSidebarEnabled');
|
|
196
|
+
createInfoNotice(isPublishSidebarEnabled ? __('Pre-publish checklist off.') : __('Pre-publish checklist on.'), {
|
|
197
|
+
id: 'core/edit-post/publish-sidebar/notice',
|
|
198
|
+
type: 'snackbar'
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
useCommand({
|
|
203
|
+
name: 'core/preview-link',
|
|
204
|
+
label: __('Preview in a new tab'),
|
|
205
|
+
icon: external,
|
|
206
|
+
callback: async ({
|
|
207
|
+
close
|
|
208
|
+
}) => {
|
|
209
|
+
close();
|
|
210
|
+
const link = await __unstableSaveForPreview({});
|
|
211
|
+
window.open(link, '_blank');
|
|
212
|
+
}
|
|
213
|
+
});
|
|
159
214
|
}
|
|
160
215
|
//# sourceMappingURL=use-common-commands.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/hooks/commands/use-common-commands.js"],"names":["useSelect","useDispatch","__","isRTL","code","cog","drawerLeft","drawerRight","blockDefault","keyboardClose","desktop","listView","useCommand","store","preferencesStore","interfaceStore","KEYBOARD_SHORTCUT_HELP_MODAL_NAME","PREFERENCES_MODAL_NAME","editPostStore","useCommonCommands","openGeneralSidebar","closeGeneralSidebar","switchEditorMode","setIsListViewOpened","openModal","editorMode","activeSidebar","isListViewOpen","select","getEditorMode","isListViewOpened","getActiveComplementaryArea","name","toggle","label","icon","callback","close"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,EAAT,EAAaC,KAAb,QAA0B,iBAA1B;AACA,SACCC,IADD,EAECC,GAFD,EAGCC,UAHD,EAICC,WAJD,EAKCC,YALD,EAMCC,aAND,EAOCC,OAPD,EAQCC,QARD,QASO,kBATP;AAUA,SAASC,UAAT,QAA2B,qBAA3B;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,wBAA1C;AACA,SAASD,KAAK,IAAIE,cAAlB,QAAwC,sBAAxC;AAEA;AACA;AACA;;AACA,SAASC,iCAAT,QAAkD,+CAAlD;AACA,SAASC,sBAAT,QAAuC,oCAAvC;AACA,SAASJ,KAAK,IAAIK,aAAlB,QAAuC,aAAvC;AAEA,eAAe,SAASC,iBAAT,GAA6B;AAC3C,QAAM;AACLC,IAAAA,kBADK;AAELC,IAAAA,mBAFK;AAGLC,IAAAA,gBAHK;AAILC,IAAAA;AAJK,MAKFtB,WAAW,CAAEiB,aAAF,CALf;AAMA,QAAM;AAAEM,IAAAA;AAAF,MAAgBvB,WAAW,CAAEc,cAAF,CAAjC;AACA,QAAM;AAAEU,IAAAA,UAAF;AAAcC,IAAAA,aAAd;AAA6BC,IAAAA;AAA7B,MAAgD3B,SAAS,CAC5D4B,MAAF,IAAc;AACb,UAAM;AAAEC,MAAAA,aAAF;AAAiBC,MAAAA;AAAjB,QAAsCF,MAAM,CAAEV,aAAF,CAAlD;AACA,WAAO;AACNQ,MA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CAFE;AAGXiC,IAAAA,IAAI,EAAE9B,GAHK;AAIX+B,IAAAA,QAAQ,EAAE,CAAE;AAAEC,MAAAA;AAAF,KAAF,KAAiB;AAC1BJ,MAAAA,MAAM,CAAE,gBAAF,EAAoB,cAApB,CAAN;AACAI,MAAAA,KAAK;AACL;AAPU,GAAF,CAAV;AAUAzB,EAAAA,UAAU,CAAE;AACXoB,IAAAA,IAAI,EAAE,yBADK;AAEXE,IAAAA,KAAK,EAAEhC,EAAE,CAAE,oBAAF,CAFE;AAGXiC,IAAAA,IAAI,EAAE/B,IAHK;AAIXgC,IAAAA,QAAQ,EAAE,CAAE;AAAEC,MAAAA;AAAF,KAAF,KAAiB;AAC1Bf,MAAAA,gBAAgB,CAAEG,UAAU,KAAK,QAAf,GAA0B,MAA1B,GAAmC,QAArC,CAAhB;AACAY,MAAAA,KAAK;AACL;AAPU,GAAF,CAAV;AAUAzB,EAAAA,UAAU,CAAE;AACXoB,IAAAA,IAAI,EAAE,uBADK;AAEXE,IAAAA,KAAK,EAAEhC,EAAE,CAAE,yBAAF,CAFE;AAGXiC,IAAAA,IAAI,EAAE9B,GAHK;AAIX+B,IAAAA,QAAQ,EAAE,MAAM;AACfZ,MAAAA,SAAS,CAAEP,sBAAF,CAAT;AACA;AANU,GAAF,CAAV;AASAL,EAAAA,UAAU,CAAE;AACXoB,IAAAA,IAAI,EAAE,yBADK;AAEXE,IAAAA,KAAK,EAAEhC,EAAE,CAAE,yBAAF,CAFE;AAGXiC,IAAAA,IAAI,EAAE1B,aAHK;AAIX2B,IAAAA,QAAQ,EAAE,MAAM;AACfZ,MAAAA,SAAS,CAAER,iCAAF,CAAT;AACA;AANU,GAAF,CAAV;AAQA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, isRTL } from '@wordpress/i18n';\nimport {\n\tcode,\n\tcog,\n\tdrawerLeft,\n\tdrawerRight,\n\tblockDefault,\n\tkeyboardClose,\n\tdesktop,\n\tlistView,\n} from '@wordpress/icons';\nimport { useCommand } from '@wordpress/commands';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { KEYBOARD_SHORTCUT_HELP_MODAL_NAME } from '../../components/keyboard-shortcut-help-modal';\nimport { PREFERENCES_MODAL_NAME } from '../../components/preferences-modal';\nimport { store as editPostStore } from '../../store';\n\nexport default function useCommonCommands() {\n\tconst {\n\t\topenGeneralSidebar,\n\t\tcloseGeneralSidebar,\n\t\tswitchEditorMode,\n\t\tsetIsListViewOpened,\n\t} = useDispatch( editPostStore );\n\tconst { openModal } = useDispatch( interfaceStore );\n\tconst { editorMode, activeSidebar, isListViewOpen } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditorMode, isListViewOpened } = select( editPostStore );\n\t\t\treturn {\n\t\t\t\tactiveSidebar: select(\n\t\t\t\t\tinterfaceStore\n\t\t\t\t).getActiveComplementaryArea( editPostStore.name ),\n\t\t\t\teditorMode: getEditorMode(),\n\t\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst { toggle } = useDispatch( preferencesStore );\n\n\tuseCommand( {\n\t\tname: 'core/open-settings-sidebar',\n\t\tlabel: __( 'Toggle settings sidebar' ),\n\t\ticon: isRTL() ? drawerLeft : drawerRight,\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\tif ( activeSidebar === 'edit-post/document' ) {\n\t\t\t\tcloseGeneralSidebar();\n\t\t\t} else {\n\t\t\t\topenGeneralSidebar( 'edit-post/document' );\n\t\t\t}\n\t\t},\n\t} );\n\n\tuseCommand( {\n\t\tname: 'core/open-block-inspector',\n\t\tlabel: __( 'Toggle block inspector' ),\n\t\ticon: blockDefault,\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\tif ( activeSidebar === 'edit-post/block' ) {\n\t\t\t\tcloseGeneralSidebar();\n\t\t\t} else {\n\t\t\t\topenGeneralSidebar( 'edit-post/block' );\n\t\t\t}\n\t\t},\n\t} );\n\n\tuseCommand( {\n\t\tname: 'core/toggle-distraction-free',\n\t\tlabel: __( 'Toggle distraction free' ),\n\t\ticon: cog,\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core/edit-post', 'distractionFree' );\n\t\t\tclose();\n\t\t},\n\t} );\n\n\tuseCommand( {\n\t\tname: 'core/toggle-spotlight-mode',\n\t\tlabel: __( 'Toggle spotlight mode' ),\n\t\ticon: cog,\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core/edit-post', 'focusMode' );\n\t\t\tclose();\n\t\t},\n\t} );\n\n\tuseCommand( {\n\t\tname: 'core/toggle-fullscreen-mode',\n\t\tlabel: __( 'Toggle fullscreen mode' ),\n\t\ticon: desktop,\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core/edit-post', 'fullscreenMode' );\n\t\t\tclose();\n\t\t},\n\t} );\n\n\tuseCommand( {\n\t\tname: 'core/toggle-list-view',\n\t\tlabel: __( 'Toggle list view' ),\n\t\ticon: listView,\n\t\tcallback: ( { close } ) => {\n\t\t\tsetIsListViewOpened( ! isListViewOpen );\n\t\t\tclose();\n\t\t},\n\t} );\n\n\tuseCommand( {\n\t\tname: 'core/toggle-top-toolbar',\n\t\tlabel: __( 'Toggle top toolbar' ),\n\t\ticon: cog,\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core/edit-post', 'fixedToolbar' );\n\t\t\tclose();\n\t\t},\n\t} );\n\n\tuseCommand( {\n\t\tname: 'core/toggle-code-editor',\n\t\tlabel: __( 'Toggle code editor' ),\n\t\ticon: code,\n\t\tcallback: ( { close } ) => {\n\t\t\tswitchEditorMode( editorMode === 'visual' ? 'text' : 'visual' );\n\t\t\tclose();\n\t\t},\n\t} );\n\n\tuseCommand( {\n\t\tname: 'core/open-preferences',\n\t\tlabel: __( 'Open editor preferences' ),\n\t\ticon: cog,\n\t\tcallback: () => {\n\t\t\topenModal( PREFERENCES_MODAL_NAME );\n\t\t},\n\t} );\n\n\tuseCommand( {\n\t\tname: 'core/open-shortcut-help',\n\t\tlabel: __( 'Open keyboard shortcuts' ),\n\t\ticon: keyboardClose,\n\t\tcallback: () => {\n\t\t\topenModal( KEYBOARD_SHORTCUT_HELP_MODAL_NAME );\n\t\t},\n\t} );\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/hooks/commands/use-common-commands.js"],"names":["useSelect","useDispatch","__","isRTL","code","cog","drawerLeft","drawerRight","blockDefault","keyboard","desktop","listView","external","formatListBullets","useCommand","store","preferencesStore","interfaceStore","editorStore","noticesStore","KEYBOARD_SHORTCUT_HELP_MODAL_NAME","PREFERENCES_MODAL_NAME","editPostStore","useCommonCommands","openGeneralSidebar","closeGeneralSidebar","switchEditorMode","setIsListViewOpened","openModal","editorMode","activeSidebar","isListViewOpen","isPublishSidebarEnabled","showBlockBreadcrumbs","select","getEditorMode","isListViewOpened","isFeatureActive","getActiveComplementaryArea","name","toggle","createInfoNotice","__unstableSaveForPreview","label","icon","callback","close","id","type","link","window","open"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,EAAT,EAAaC,KAAb,QAA0B,iBAA1B;AACA,SACCC,IADD,EAECC,GAFD,EAGCC,UAHD,EAICC,WAJD,EAKCC,YALD,EAMCC,QAND,EAOCC,OAPD,EAQCC,QARD,EASCC,QATD,EAUCC,iBAVD,QAWO,kBAXP;AAYA,SAASC,UAAT,QAA2B,qBAA3B;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,wBAA1C;AACA,SAASD,KAAK,IAAIE,cAAlB,QAAwC,sBAAxC;AACA,SAASF,KAAK,IAAIG,WAAlB,QAAqC,mBAArC;AACA,SAASH,KAAK,IAAII,YAAlB,QAAsC,oBAAtC;AAEA;AACA;AACA;;AACA,SAASC,iCAAT,QAAkD,+CAAlD;AACA,SAASC,s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,CAAE;AACXyB,IAAAA,IAAI,EAAE,6BADK;AAEXI,IAAAA,KAAK,EAAEX,uBAAuB,GAC3B9B,EAAE,CAAE,+BAAF,CADyB,GAE3BA,EAAE,CAAE,8BAAF,CAJM;AAKX0C,IAAAA,IAAI,EAAE/B,iBALK;AAMXgC,IAAAA,QAAQ,EAAE,CAAE;AAAEC,MAAAA;AAAF,KAAF,KAAiB;AAC1BA,MAAAA,KAAK;AACLN,MAAAA,MAAM,CAAE,gBAAF,EAAoB,yBAApB,CAAN;AACAC,MAAAA,gBAAgB,CACfT,uBAAuB,GACpB9B,EAAE,CAAE,4BAAF,CADkB,GAEpBA,EAAE,CAAE,2BAAF,CAHU,EAIf;AACC6C,QAAAA,EAAE,EAAE,uCADL;AAECC,QAAAA,IAAI,EAAE;AAFP,OAJe,CAAhB;AASA;AAlBU,GAAF,CAAV;AAqBAlC,EAAAA,UAAU,CAAE;AACXyB,IAAAA,IAAI,EAAE,mBADK;AAEXI,IAAAA,KAAK,EAAEzC,EAAE,CAAE,sBAAF,CAFE;AAGX0C,IAAAA,IAAI,EAAEhC,QAHK;AAIXiC,IAAAA,QAAQ,EAAE,OAAQ;AAAEC,MAAAA;AAAF,KAAR,KAAuB;AAChCA,MAAAA,KAAK;AACL,YAAMG,IAAI,GAAG,MAAMP,wBAAwB,CAAE,EAAF,CAA3C;AACAQ,MAAAA,MAAM,CAACC,IAAP,CAAaF,IAAb,EAAmB,QAAnB;AACA;AARU,GAAF,CAAV;AAUA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, isRTL } from '@wordpress/i18n';\nimport {\n\tcode,\n\tcog,\n\tdrawerLeft,\n\tdrawerRight,\n\tblockDefault,\n\tkeyboard,\n\tdesktop,\n\tlistView,\n\texternal,\n\tformatListBullets,\n} from '@wordpress/icons';\nimport { useCommand } from '@wordpress/commands';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport { KEYBOARD_SHORTCUT_HELP_MODAL_NAME } from '../../components/keyboard-shortcut-help-modal';\nimport { PREFERENCES_MODAL_NAME } from '../../components/preferences-modal';\nimport { store as editPostStore } from '../../store';\n\nexport default function useCommonCommands() {\n\tconst {\n\t\topenGeneralSidebar,\n\t\tcloseGeneralSidebar,\n\t\tswitchEditorMode,\n\t\tsetIsListViewOpened,\n\t} = useDispatch( editPostStore );\n\tconst { openModal } = useDispatch( interfaceStore );\n\tconst {\n\t\teditorMode,\n\t\tactiveSidebar,\n\t\tisListViewOpen,\n\t\tisPublishSidebarEnabled,\n\t\tshowBlockBreadcrumbs,\n\t} = useSelect( ( select ) => {\n\t\tconst { getEditorMode, isListViewOpened, isFeatureActive } =\n\t\t\tselect( editPostStore );\n\t\treturn {\n\t\t\tactiveSidebar: select( interfaceStore ).getActiveComplementaryArea(\n\t\t\t\teditPostStore.name\n\t\t\t),\n\t\t\teditorMode: getEditorMode(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tisPublishSidebarEnabled:\n\t\t\t\tselect( editorStore ).isPublishSidebarEnabled(),\n\t\t\tshowBlockBreadcrumbs: isFeatureActive( 'showBlockBreadcrumbs' ),\n\t\t};\n\t}, [] );\n\tconst { toggle } = useDispatch( preferencesStore );\n\tconst { createInfoNotice } = useDispatch( noticesStore );\n\tconst { __unstableSaveForPreview } = useDispatch( editorStore );\n\n\tuseCommand( {\n\t\tname: 'core/open-settings-sidebar',\n\t\tlabel: __( 'Toggle settings sidebar' ),\n\t\ticon: isRTL() ? drawerLeft : drawerRight,\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\tif ( activeSidebar === 'edit-post/document' ) {\n\t\t\t\tcloseGeneralSidebar();\n\t\t\t} else {\n\t\t\t\topenGeneralSidebar( 'edit-post/document' );\n\t\t\t}\n\t\t},\n\t} );\n\n\tuseCommand( {\n\t\tname: 'core/open-block-inspector',\n\t\tlabel: __( 'Toggle block inspector' ),\n\t\ticon: blockDefault,\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\tif ( activeSidebar === 'edit-post/block' ) {\n\t\t\t\tcloseGeneralSidebar();\n\t\t\t} else {\n\t\t\t\topenGeneralSidebar( 'edit-post/block' );\n\t\t\t}\n\t\t},\n\t} );\n\n\tuseCommand( {\n\t\tname: 'core/toggle-distraction-free',\n\t\tlabel: __( 'Toggle distraction free' ),\n\t\ticon: cog,\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core/edit-post', 'distractionFree' );\n\t\t\tclose();\n\t\t},\n\t} );\n\n\tuseCommand( {\n\t\tname: 'core/toggle-spotlight-mode',\n\t\tlabel: __( 'Toggle spotlight mode' ),\n\t\ticon: cog,\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core/edit-post', 'focusMode' );\n\t\t\tclose();\n\t\t},\n\t} );\n\n\tuseCommand( {\n\t\tname: 'core/toggle-fullscreen-mode',\n\t\tlabel: __( 'Toggle fullscreen mode' ),\n\t\ticon: desktop,\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core/edit-post', 'fullscreenMode' );\n\t\t\tclose();\n\t\t},\n\t} );\n\n\tuseCommand( {\n\t\tname: 'core/toggle-list-view',\n\t\tlabel: __( 'Toggle list view' ),\n\t\ticon: listView,\n\t\tcallback: ( { close } ) => {\n\t\t\tsetIsListViewOpened( ! isListViewOpen );\n\t\t\tclose();\n\t\t},\n\t} );\n\n\tuseCommand( {\n\t\tname: 'core/toggle-top-toolbar',\n\t\tlabel: __( 'Toggle top toolbar' ),\n\t\ticon: cog,\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core/edit-post', 'fixedToolbar' );\n\t\t\tclose();\n\t\t},\n\t} );\n\n\tuseCommand( {\n\t\tname: 'core/toggle-code-editor',\n\t\tlabel: __( 'Toggle code editor' ),\n\t\ticon: code,\n\t\tcallback: ( { close } ) => {\n\t\t\tswitchEditorMode( editorMode === 'visual' ? 'text' : 'visual' );\n\t\t\tclose();\n\t\t},\n\t} );\n\n\tuseCommand( {\n\t\tname: 'core/open-preferences',\n\t\tlabel: __( 'Open editor preferences' ),\n\t\ticon: cog,\n\t\tcallback: () => {\n\t\t\topenModal( PREFERENCES_MODAL_NAME );\n\t\t},\n\t} );\n\n\tuseCommand( {\n\t\tname: 'core/open-shortcut-help',\n\t\tlabel: __( 'Open keyboard shortcuts' ),\n\t\ticon: keyboard,\n\t\tcallback: () => {\n\t\t\topenModal( KEYBOARD_SHORTCUT_HELP_MODAL_NAME );\n\t\t},\n\t} );\n\n\tuseCommand( {\n\t\tname: 'core/toggle-breadcrumbs',\n\t\tlabel: showBlockBreadcrumbs\n\t\t\t? __( 'Hide block breadcrumbs' )\n\t\t\t: __( 'Show block breadcrumbs' ),\n\t\ticon: cog,\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core/edit-post', 'showBlockBreadcrumbs' );\n\t\t\tclose();\n\t\t\tcreateInfoNotice(\n\t\t\t\tshowBlockBreadcrumbs\n\t\t\t\t\t? __( 'Breadcrumbs off.' )\n\t\t\t\t\t: __( 'Breadcrumbs on.' ),\n\t\t\t\t{\n\t\t\t\t\tid: 'core/edit-post/toggle-breadcrumbs/notice',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\t} );\n\n\tuseCommand( {\n\t\tname: 'core/toggle-publish-sidebar',\n\t\tlabel: isPublishSidebarEnabled\n\t\t\t? __( 'Disable pre-publish checklist' )\n\t\t\t: __( 'Enable pre-publish checklist' ),\n\t\ticon: formatListBullets,\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\ttoggle( 'core/edit-post', 'isPublishSidebarEnabled' );\n\t\t\tcreateInfoNotice(\n\t\t\t\tisPublishSidebarEnabled\n\t\t\t\t\t? __( 'Pre-publish checklist off.' )\n\t\t\t\t\t: __( 'Pre-publish checklist on.' ),\n\t\t\t\t{\n\t\t\t\t\tid: 'core/edit-post/publish-sidebar/notice',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\t} );\n\n\tuseCommand( {\n\t\tname: 'core/preview-link',\n\t\tlabel: __( 'Preview in a new tab' ),\n\t\ticon: external,\n\t\tcallback: async ( { close } ) => {\n\t\t\tclose();\n\t\t\tconst link = await __unstableSaveForPreview( {} );\n\t\t\twindow.open( link, '_blank' );\n\t\t},\n\t} );\n}\n"]}
|
package/build-module/index.js
CHANGED
|
@@ -52,9 +52,10 @@ export function initializeEditor(id, postType, postId, settings, initialEdits) {
|
|
|
52
52
|
});
|
|
53
53
|
|
|
54
54
|
dispatch(blocksStore).__experimentalReapplyBlockTypeFilters(); // Check if the block list view should be open by default.
|
|
55
|
+
// If `distractionFree` mode is enabled, the block list view should not be open.
|
|
55
56
|
|
|
56
57
|
|
|
57
|
-
if (select(editPostStore).isFeatureActive('showListViewByDefault')) {
|
|
58
|
+
if (select(editPostStore).isFeatureActive('showListViewByDefault') && !select(editPostStore).isFeatureActive('distractionFree')) {
|
|
58
59
|
dispatch(editPostStore).setIsListViewOpened(true);
|
|
59
60
|
}
|
|
60
61
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/index.js"],"names":["store","blocksStore","registerCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","deprecated","createRoot","dispatch","select","addFilter","preferencesStore","registerLegacyWidgetBlock","registerWidgetGroupBlock","Editor","editPostStore","initializeEditor","id","postType","postId","settings","initialEdits","target","document","getElementById","root","setDefaults","editorMode","fixedToolbar","fullscreenMode","hiddenBlockTypes","inactivePanels","isPublishSidebarEnabled","openPanels","preferredStyleVariations","showBlockBreadcrumbs","showIconLabels","showListViewByDefault","themeStyles","welcomeGuide","welcomeGuideTemplate","__experimentalReapplyBlockTypeFilters","isFeatureActive","setIsListViewOpened","inserter","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","__unstableEnableFullSiteEditingBlocks","canInsert","blockType","isEditingTemplate","name","rootClientId","getBlockParentsByBlockName","length","documentMode","compatMode","console","warn","isIphone","window","navigator","userAgent","indexOf","addEventListener","event","editorScrollContainer","getElementsByClassName","scrollY","scrollTop","scrollTo","e","preventDefault","render","reinitializeEditor","since","version","default","PluginBlockSettingsMenuItem","PluginDocumentSettingPanel","PluginMoreMenuItem","PluginPostPublishPanel","PluginPostStatusInfo","PluginPrePublishPanel","PluginSidebar","PluginSidebarMoreMenuItem","__experimentalFullscreenModeClose","__experimentalMainDashboardButton"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAlB,QAAqC,mBAArC;AACA,SACCC,kBADD,EAECC,4CAFD,QAGO,0BAHP;AAIA,OAAOC,UAAP,MAAuB,uBAAvB;AACA,SAASC,UAAT,QAA2B,oBAA3B;AACA,SAASC,QAAT,EAAmBC,MAAnB,QAAiC,iBAAjC;AACA,SAASC,SAAT,QAA0B,kBAA1B;AACA,SAASR,KAAK,IAAIS,gBAAlB,QAA0C,wBAA1C;AACA,SACCC,yBADD,EAECC,wBAFD,QAGO,oBAHP;AAKA;AACA;AACA;;AACA,OAAO,SAAP;AACA,OAAO,WAAP;AACA,OAAOC,MAAP,MAAmB,UAAnB;AACA,SAASZ,KAAK,IAAIa,aAAlB,QAAuC,SAAvC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,gBAAT,CACNC,EADM,EAENC,QAFM,EAGNC,MAHM,EAINC,QAJM,EAKNC,YALM,EAML;AACD,QAAMC,MAAM,GAAGC,QAAQ,CAACC,cAAT,CAAyBP,EAAzB,CAAf;AACA,QAAMQ,IAAI,GAAGlB,UAAU,CAAEe,MAAF,CAAvB;AAEAd,EAAAA,QAAQ,CAAEG,gBAAF,CAAR,CAA6Be,WAA7B,CAA0C,gBAA1C,EAA4D;AAC3DC,IAAAA,UAAU,EA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SAASR,OAAO,IAAIS,iCAApB,QAA6D,2CAA7D;AACA,SAAST,OAAO,IAAIU,iCAApB,QAA6D,2CAA7D;AACA,SAASvF,KAAT,QAAsB,SAAtB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot } from '@wordpress/element';\nimport { dispatch, select } from '@wordpress/data';\nimport { addFilter } from '@wordpress/hooks';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport './plugins';\nimport Editor from './editor';\nimport { store as editPostStore } from './store';\n\n/**\n * Initializes and returns an instance of Editor.\n *\n * @param {string} id Unique identifier for editor instance.\n * @param {string} postType Post type of the post to edit.\n * @param {Object} postId ID of the post to edit.\n * @param {?Object} settings Editor settings object.\n * @param {Object} initialEdits Programmatic edits to apply initially, to be\n * considered as non-user-initiated (bypass for\n * unsaved changes prompt).\n */\nexport function initializeEditor(\n\tid,\n\tpostType,\n\tpostId,\n\tsettings,\n\tinitialEdits\n) {\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-post', {\n\t\teditorMode: 'visual',\n\t\tfixedToolbar: false,\n\t\tfullscreenMode: true,\n\t\thiddenBlockTypes: [],\n\t\tinactivePanels: [],\n\t\tisPublishSidebarEnabled: true,\n\t\topenPanels: [ 'post-status' ],\n\t\tpreferredStyleVariations: {},\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowIconLabels: false,\n\t\tshowListViewByDefault: false,\n\t\tthemeStyles: true,\n\t\twelcomeGuide: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( blocksStore ).__experimentalReapplyBlockTypeFilters();\n\n\t// Check if the block list view should be open by default.\n\tif ( select( editPostStore ).isFeatureActive( 'showListViewByDefault' ) ) {\n\t\tdispatch( editPostStore ).setIsListViewOpened( true );\n\t}\n\n\tregisterCoreBlocks();\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: settings.__unstableEnableFullSiteEditingBlocks,\n\t\t} );\n\t}\n\n\t/*\n\t * Prevent adding template part in the post editor.\n\t * Only add the filter when the post editor is initialized, not imported.\n\t * Also only add the filter(s) after registerCoreBlocks()\n\t * so that common filters in the block library are not overwritten.\n\t */\n\taddFilter(\n\t\t'blockEditor.__unstableCanInsertBlockType',\n\t\t'removeTemplatePartsFromInserter',\n\t\t( canInsert, blockType ) => {\n\t\t\tif (\n\t\t\t\t! select( editPostStore ).isEditingTemplate() &&\n\t\t\t\tblockType.name === 'core/template-part'\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn canInsert;\n\t\t}\n\t);\n\n\t/*\n\t * Prevent adding post content block (except in query block) in the post editor.\n\t * Only add the filter when the post editor is initialized, not imported.\n\t * Also only add the filter(s) after registerCoreBlocks()\n\t * so that common filters in the block library are not overwritten.\n\t */\n\taddFilter(\n\t\t'blockEditor.__unstableCanInsertBlockType',\n\t\t'removePostContentFromInserter',\n\t\t(\n\t\t\tcanInsert,\n\t\t\tblockType,\n\t\t\trootClientId,\n\t\t\t{ getBlockParentsByBlockName }\n\t\t) => {\n\t\t\tif (\n\t\t\t\t! select( editPostStore ).isEditingTemplate() &&\n\t\t\t\tblockType.name === 'core/post-content'\n\t\t\t) {\n\t\t\t\treturn (\n\t\t\t\t\tgetBlockParentsByBlockName( rootClientId, 'core/query' )\n\t\t\t\t\t\t.length > 0\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn canInsert;\n\t\t}\n\t);\n\n\t// Show a console log warning if the browser is not in Standards rendering mode.\n\tconst documentMode =\n\t\tdocument.compatMode === 'CSS1Compat' ? 'Standards' : 'Quirks';\n\tif ( documentMode !== 'Standards' ) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn(\n\t\t\t\"Your browser is using Quirks Mode. \\nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening <!DOCTYPE html>. Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins.\"\n\t\t);\n\t}\n\n\t// This is a temporary fix for a couple of issues specific to Webkit on iOS.\n\t// Without this hack the browser scrolls the mobile toolbar off-screen.\n\t// Once supported in Safari we can replace this in favor of preventScroll.\n\t// For details see issue #18632 and PR #18686\n\t// Specifically, we scroll `interface-interface-skeleton__body` to enable a fixed top toolbar.\n\t// But Mobile Safari forces the `html` element to scroll upwards, hiding the toolbar.\n\n\tconst isIphone = window.navigator.userAgent.indexOf( 'iPhone' ) !== -1;\n\tif ( isIphone ) {\n\t\twindow.addEventListener( 'scroll', ( event ) => {\n\t\t\tconst editorScrollContainer = document.getElementsByClassName(\n\t\t\t\t'interface-interface-skeleton__body'\n\t\t\t)[ 0 ];\n\t\t\tif ( event.target === document ) {\n\t\t\t\t// Scroll element into view by scrolling the editor container by the same amount\n\t\t\t\t// that Mobile Safari tried to scroll the html element upwards.\n\t\t\t\tif ( window.scrollY > 100 ) {\n\t\t\t\t\teditorScrollContainer.scrollTop =\n\t\t\t\t\t\teditorScrollContainer.scrollTop + window.scrollY;\n\t\t\t\t}\n\t\t\t\t// Undo unwanted scroll on html element, but only in the visual editor.\n\t\t\t\tif (\n\t\t\t\t\tdocument.getElementsByClassName( 'is-mode-visual' )[ 0 ]\n\t\t\t\t) {\n\t\t\t\t\twindow.scrollTo( 0, 0 );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render(\n\t\t<Editor\n\t\t\tsettings={ settings }\n\t\t\tpostId={ postId }\n\t\t\tpostType={ postType }\n\t\t\tinitialEdits={ initialEdits }\n\t\t/>\n\t);\n\n\treturn root;\n}\n\n/**\n * Used to reinitialize the editor after an error. Now it's a deprecated noop function.\n */\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editPost.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { default as PluginBlockSettingsMenuItem } from './components/block-settings-menu/plugin-block-settings-menu-item';\nexport { default as PluginDocumentSettingPanel } from './components/sidebar/plugin-document-setting-panel';\nexport { default as PluginMoreMenuItem } from './components/header/plugin-more-menu-item';\nexport { default as PluginPostPublishPanel } from './components/sidebar/plugin-post-publish-panel';\nexport { default as PluginPostStatusInfo } from './components/sidebar/plugin-post-status-info';\nexport { default as PluginPrePublishPanel } from './components/sidebar/plugin-pre-publish-panel';\nexport { default as PluginSidebar } from './components/sidebar/plugin-sidebar';\nexport { default as PluginSidebarMoreMenuItem } from './components/header/plugin-sidebar-more-menu-item';\nexport { default as __experimentalFullscreenModeClose } from './components/header/fullscreen-mode-close';\nexport { default as __experimentalMainDashboardButton } from './components/header/main-dashboard-button';\nexport { store } from './store';\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/index.js"],"names":["store","blocksStore","registerCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","deprecated","createRoot","dispatch","select","addFilter","preferencesStore","registerLegacyWidgetBlock","registerWidgetGroupBlock","Editor","editPostStore","initializeEditor","id","postType","postId","settings","initialEdits","target","document","getElementById","root","setDefaults","editorMode","fixedToolbar","fullscreenMode","hiddenBlockTypes","inactivePanels","isPublishSidebarEnabled","openPanels","preferredStyleVariations","showBlockBreadcrumbs","showIconLabels","showListViewByDefault","themeStyles","welcomeGuide","welcomeGuideTemplate","__experimentalReapplyBlockTypeFilters","isFeatureActive","setIsListViewOpened","inserter","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","__unstableEnableFullSiteEditingBlocks","canInsert","blockType","isEditingTemplate","name","rootClientId","getBlockParentsByBlockName","length","documentMode","compatMode","console","warn","isIphone","window","navigator","userAgent","indexOf","addEventListener","event","editorScrollContainer","getElementsByClassName","scrollY","scrollTop","scrollTo","e","preventDefault","render","reinitializeEditor","since","version","default","PluginBlockSettingsMenuItem","PluginDocumentSettingPanel","PluginMoreMenuItem","PluginPostPublishPanel","PluginPostStatusInfo","PluginPrePublishPanel","PluginSidebar","PluginSidebarMoreMenuItem","__experimentalFullscreenModeClose","__experimentalMainDashboardButton"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAlB,QAAqC,mBAArC;AACA,SACCC,kBADD,EAECC,4CAFD,QAGO,0BAHP;AAIA,OAAOC,UAAP,MAAuB,uBAAvB;AACA,SAASC,UAAT,QAA2B,oBAA3B;AACA,SAASC,QAAT,EAAmBC,MAAnB,QAAiC,iBAAjC;AACA,SAASC,SAAT,QAA0B,kBAA1B;AACA,SAASR,KAAK,IAAIS,gBAAlB,QAA0C,wBAA1C;AACA,SACCC,yBADD,EAECC,wBAFD,QAGO,oBAHP;AAKA;AACA;AACA;;AACA,OAAO,SAAP;AACA,OAAO,WAAP;AACA,OAAOC,MAAP,MAAmB,UAAnB;AACA,SAASZ,KAAK,IAAIa,aAAlB,QAAuC,SAAvC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,gBAAT,CACNC,EADM,EAENC,QAFM,EAGNC,MAHM,EAINC,QAJM,EAKNC,YALM,EAML;AACD,QAAMC,MAAM,GAAGC,QAAQ,CAACC,cAAT,CAAyBP,EAAzB,CAAf;AACA,QAAMQ,IAAI,GAAGlB,UAAU,CAAEe,MAAF,CAAvB;AAEAd,EAAAA,QAAQ,CAAEG,gB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AACA,SAASL,OAAO,IAAIM,qBAApB,QAAiD,+CAAjD;AACA,SAASN,OAAO,IAAIO,aAApB,QAAyC,qCAAzC;AACA,SAASP,OAAO,IAAIQ,yBAApB,QAAqD,mDAArD;AACA,SAASR,OAAO,IAAIS,iCAApB,QAA6D,2CAA7D;AACA,SAAST,OAAO,IAAIU,iCAApB,QAA6D,2CAA7D;AACA,SAASvF,KAAT,QAAsB,SAAtB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot } from '@wordpress/element';\nimport { dispatch, select } from '@wordpress/data';\nimport { addFilter } from '@wordpress/hooks';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport './plugins';\nimport Editor from './editor';\nimport { store as editPostStore } from './store';\n\n/**\n * Initializes and returns an instance of Editor.\n *\n * @param {string} id Unique identifier for editor instance.\n * @param {string} postType Post type of the post to edit.\n * @param {Object} postId ID of the post to edit.\n * @param {?Object} settings Editor settings object.\n * @param {Object} initialEdits Programmatic edits to apply initially, to be\n * considered as non-user-initiated (bypass for\n * unsaved changes prompt).\n */\nexport function initializeEditor(\n\tid,\n\tpostType,\n\tpostId,\n\tsettings,\n\tinitialEdits\n) {\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-post', {\n\t\teditorMode: 'visual',\n\t\tfixedToolbar: false,\n\t\tfullscreenMode: true,\n\t\thiddenBlockTypes: [],\n\t\tinactivePanels: [],\n\t\tisPublishSidebarEnabled: true,\n\t\topenPanels: [ 'post-status' ],\n\t\tpreferredStyleVariations: {},\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowIconLabels: false,\n\t\tshowListViewByDefault: false,\n\t\tthemeStyles: true,\n\t\twelcomeGuide: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( blocksStore ).__experimentalReapplyBlockTypeFilters();\n\n\t// Check if the block list view should be open by default.\n\t// If `distractionFree` mode is enabled, the block list view should not be open.\n\tif (\n\t\tselect( editPostStore ).isFeatureActive( 'showListViewByDefault' ) &&\n\t\t! select( editPostStore ).isFeatureActive( 'distractionFree' )\n\t) {\n\t\tdispatch( editPostStore ).setIsListViewOpened( true );\n\t}\n\n\tregisterCoreBlocks();\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: settings.__unstableEnableFullSiteEditingBlocks,\n\t\t} );\n\t}\n\n\t/*\n\t * Prevent adding template part in the post editor.\n\t * Only add the filter when the post editor is initialized, not imported.\n\t * Also only add the filter(s) after registerCoreBlocks()\n\t * so that common filters in the block library are not overwritten.\n\t */\n\taddFilter(\n\t\t'blockEditor.__unstableCanInsertBlockType',\n\t\t'removeTemplatePartsFromInserter',\n\t\t( canInsert, blockType ) => {\n\t\t\tif (\n\t\t\t\t! select( editPostStore ).isEditingTemplate() &&\n\t\t\t\tblockType.name === 'core/template-part'\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn canInsert;\n\t\t}\n\t);\n\n\t/*\n\t * Prevent adding post content block (except in query block) in the post editor.\n\t * Only add the filter when the post editor is initialized, not imported.\n\t * Also only add the filter(s) after registerCoreBlocks()\n\t * so that common filters in the block library are not overwritten.\n\t */\n\taddFilter(\n\t\t'blockEditor.__unstableCanInsertBlockType',\n\t\t'removePostContentFromInserter',\n\t\t(\n\t\t\tcanInsert,\n\t\t\tblockType,\n\t\t\trootClientId,\n\t\t\t{ getBlockParentsByBlockName }\n\t\t) => {\n\t\t\tif (\n\t\t\t\t! select( editPostStore ).isEditingTemplate() &&\n\t\t\t\tblockType.name === 'core/post-content'\n\t\t\t) {\n\t\t\t\treturn (\n\t\t\t\t\tgetBlockParentsByBlockName( rootClientId, 'core/query' )\n\t\t\t\t\t\t.length > 0\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn canInsert;\n\t\t}\n\t);\n\n\t// Show a console log warning if the browser is not in Standards rendering mode.\n\tconst documentMode =\n\t\tdocument.compatMode === 'CSS1Compat' ? 'Standards' : 'Quirks';\n\tif ( documentMode !== 'Standards' ) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn(\n\t\t\t\"Your browser is using Quirks Mode. \\nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening <!DOCTYPE html>. Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins.\"\n\t\t);\n\t}\n\n\t// This is a temporary fix for a couple of issues specific to Webkit on iOS.\n\t// Without this hack the browser scrolls the mobile toolbar off-screen.\n\t// Once supported in Safari we can replace this in favor of preventScroll.\n\t// For details see issue #18632 and PR #18686\n\t// Specifically, we scroll `interface-interface-skeleton__body` to enable a fixed top toolbar.\n\t// But Mobile Safari forces the `html` element to scroll upwards, hiding the toolbar.\n\n\tconst isIphone = window.navigator.userAgent.indexOf( 'iPhone' ) !== -1;\n\tif ( isIphone ) {\n\t\twindow.addEventListener( 'scroll', ( event ) => {\n\t\t\tconst editorScrollContainer = document.getElementsByClassName(\n\t\t\t\t'interface-interface-skeleton__body'\n\t\t\t)[ 0 ];\n\t\t\tif ( event.target === document ) {\n\t\t\t\t// Scroll element into view by scrolling the editor container by the same amount\n\t\t\t\t// that Mobile Safari tried to scroll the html element upwards.\n\t\t\t\tif ( window.scrollY > 100 ) {\n\t\t\t\t\teditorScrollContainer.scrollTop =\n\t\t\t\t\t\teditorScrollContainer.scrollTop + window.scrollY;\n\t\t\t\t}\n\t\t\t\t// Undo unwanted scroll on html element, but only in the visual editor.\n\t\t\t\tif (\n\t\t\t\t\tdocument.getElementsByClassName( 'is-mode-visual' )[ 0 ]\n\t\t\t\t) {\n\t\t\t\t\twindow.scrollTo( 0, 0 );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render(\n\t\t<Editor\n\t\t\tsettings={ settings }\n\t\t\tpostId={ postId }\n\t\t\tpostType={ postType }\n\t\t\tinitialEdits={ initialEdits }\n\t\t/>\n\t);\n\n\treturn root;\n}\n\n/**\n * Used to reinitialize the editor after an error. Now it's a deprecated noop function.\n */\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editPost.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { default as PluginBlockSettingsMenuItem } from './components/block-settings-menu/plugin-block-settings-menu-item';\nexport { default as PluginDocumentSettingPanel } from './components/sidebar/plugin-document-setting-panel';\nexport { default as PluginMoreMenuItem } from './components/header/plugin-more-menu-item';\nexport { default as PluginPostPublishPanel } from './components/sidebar/plugin-post-publish-panel';\nexport { default as PluginPostStatusInfo } from './components/sidebar/plugin-post-status-info';\nexport { default as PluginPrePublishPanel } from './components/sidebar/plugin-pre-publish-panel';\nexport { default as PluginSidebar } from './components/sidebar/plugin-sidebar';\nexport { default as PluginSidebarMoreMenuItem } from './components/header/plugin-sidebar-more-menu-item';\nexport { default as __experimentalFullscreenModeClose } from './components/header/fullscreen-mode-close';\nexport { default as __experimentalMainDashboardButton } from './components/header/main-dashboard-button';\nexport { store } from './store';\n"]}
|
|
@@ -606,7 +606,7 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
606
606
|
}
|
|
607
607
|
}
|
|
608
608
|
|
|
609
|
-
.edit-post-
|
|
609
|
+
.edit-post-header__center {
|
|
610
610
|
flex-grow: 1;
|
|
611
611
|
display: flex;
|
|
612
612
|
justify-content: center;
|
|
@@ -948,6 +948,7 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
948
948
|
display: inline-flex;
|
|
949
949
|
align-items: center;
|
|
950
950
|
padding-right: 8px;
|
|
951
|
+
margin-left: 8px;
|
|
951
952
|
}
|
|
952
953
|
@media (min-width: 600px) {
|
|
953
954
|
.edit-post-header-toolbar__left {
|
|
@@ -977,7 +978,7 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
977
978
|
margin-right: 8px;
|
|
978
979
|
}
|
|
979
980
|
|
|
980
|
-
.edit-post-document-
|
|
981
|
+
.edit-post-document-actions {
|
|
981
982
|
display: flex;
|
|
982
983
|
align-items: center;
|
|
983
984
|
gap: 8px;
|
|
@@ -988,44 +989,46 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
988
989
|
border-radius: 4px;
|
|
989
990
|
width: min(100%, 450px);
|
|
990
991
|
}
|
|
991
|
-
.edit-post-document-
|
|
992
|
-
color:
|
|
992
|
+
.edit-post-document-actions .components-button:hover {
|
|
993
|
+
color: var(--wp-block-synced-color);
|
|
993
994
|
background: #e0e0e0;
|
|
994
995
|
}
|
|
995
996
|
|
|
996
|
-
.edit-post-document-
|
|
997
|
+
.edit-post-document-actions__command {
|
|
997
998
|
flex-grow: 1;
|
|
998
999
|
color: var(--wp-block-synced-color);
|
|
999
1000
|
overflow: hidden;
|
|
1000
1001
|
}
|
|
1001
|
-
|
|
1002
|
+
|
|
1003
|
+
.edit-post-document-actions__title {
|
|
1004
|
+
flex-grow: 1;
|
|
1002
1005
|
color: var(--wp-block-synced-color);
|
|
1006
|
+
overflow: hidden;
|
|
1003
1007
|
}
|
|
1004
|
-
.edit-post-document-
|
|
1008
|
+
.edit-post-document-actions__title:hover {
|
|
1005
1009
|
color: var(--wp-block-synced-color);
|
|
1010
|
+
}
|
|
1011
|
+
.edit-post-document-actions__title .block-editor-block-icon {
|
|
1012
|
+
flex-shrink: 0;
|
|
1013
|
+
}
|
|
1014
|
+
.edit-post-document-actions__title h1 {
|
|
1006
1015
|
white-space: nowrap;
|
|
1007
1016
|
overflow: hidden;
|
|
1008
1017
|
text-overflow: ellipsis;
|
|
1018
|
+
color: var(--wp-block-synced-color);
|
|
1009
1019
|
}
|
|
1010
1020
|
|
|
1011
|
-
.edit-post-document-
|
|
1012
|
-
|
|
1013
|
-
color: #757575;
|
|
1014
|
-
padding: 0 12px;
|
|
1015
|
-
}
|
|
1016
|
-
.edit-post-document-title__shortcut:hover {
|
|
1017
|
-
color: #757575;
|
|
1021
|
+
.edit-post-document-actions__shortcut {
|
|
1022
|
+
color: #2f2f2f;
|
|
1018
1023
|
}
|
|
1019
1024
|
|
|
1020
|
-
.edit-post-document-
|
|
1025
|
+
.edit-post-document-actions__back.components-button.has-icon.has-text {
|
|
1021
1026
|
min-width: 36px;
|
|
1022
1027
|
flex-shrink: 0;
|
|
1023
|
-
}
|
|
1024
|
-
.edit-post-document-title__left .components-button.has-icon.has-text {
|
|
1025
1028
|
color: #757575;
|
|
1026
1029
|
gap: 0;
|
|
1027
1030
|
}
|
|
1028
|
-
.edit-post-document-
|
|
1031
|
+
.edit-post-document-actions__back.components-button.has-icon.has-text:hover {
|
|
1029
1032
|
color: currentColor;
|
|
1030
1033
|
}
|
|
1031
1034
|
|
package/build-style/style.css
CHANGED
|
@@ -606,7 +606,7 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
606
606
|
}
|
|
607
607
|
}
|
|
608
608
|
|
|
609
|
-
.edit-post-
|
|
609
|
+
.edit-post-header__center {
|
|
610
610
|
flex-grow: 1;
|
|
611
611
|
display: flex;
|
|
612
612
|
justify-content: center;
|
|
@@ -948,6 +948,7 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
948
948
|
display: inline-flex;
|
|
949
949
|
align-items: center;
|
|
950
950
|
padding-left: 8px;
|
|
951
|
+
margin-right: 8px;
|
|
951
952
|
}
|
|
952
953
|
@media (min-width: 600px) {
|
|
953
954
|
.edit-post-header-toolbar__left {
|
|
@@ -977,7 +978,7 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
977
978
|
margin-left: 8px;
|
|
978
979
|
}
|
|
979
980
|
|
|
980
|
-
.edit-post-document-
|
|
981
|
+
.edit-post-document-actions {
|
|
981
982
|
display: flex;
|
|
982
983
|
align-items: center;
|
|
983
984
|
gap: 8px;
|
|
@@ -988,44 +989,46 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
988
989
|
border-radius: 4px;
|
|
989
990
|
width: min(100%, 450px);
|
|
990
991
|
}
|
|
991
|
-
.edit-post-document-
|
|
992
|
-
color:
|
|
992
|
+
.edit-post-document-actions .components-button:hover {
|
|
993
|
+
color: var(--wp-block-synced-color);
|
|
993
994
|
background: #e0e0e0;
|
|
994
995
|
}
|
|
995
996
|
|
|
996
|
-
.edit-post-document-
|
|
997
|
+
.edit-post-document-actions__command {
|
|
997
998
|
flex-grow: 1;
|
|
998
999
|
color: var(--wp-block-synced-color);
|
|
999
1000
|
overflow: hidden;
|
|
1000
1001
|
}
|
|
1001
|
-
|
|
1002
|
+
|
|
1003
|
+
.edit-post-document-actions__title {
|
|
1004
|
+
flex-grow: 1;
|
|
1002
1005
|
color: var(--wp-block-synced-color);
|
|
1006
|
+
overflow: hidden;
|
|
1003
1007
|
}
|
|
1004
|
-
.edit-post-document-
|
|
1008
|
+
.edit-post-document-actions__title:hover {
|
|
1005
1009
|
color: var(--wp-block-synced-color);
|
|
1010
|
+
}
|
|
1011
|
+
.edit-post-document-actions__title .block-editor-block-icon {
|
|
1012
|
+
flex-shrink: 0;
|
|
1013
|
+
}
|
|
1014
|
+
.edit-post-document-actions__title h1 {
|
|
1006
1015
|
white-space: nowrap;
|
|
1007
1016
|
overflow: hidden;
|
|
1008
1017
|
text-overflow: ellipsis;
|
|
1018
|
+
color: var(--wp-block-synced-color);
|
|
1009
1019
|
}
|
|
1010
1020
|
|
|
1011
|
-
.edit-post-document-
|
|
1012
|
-
|
|
1013
|
-
color: #757575;
|
|
1014
|
-
padding: 0 12px;
|
|
1015
|
-
}
|
|
1016
|
-
.edit-post-document-title__shortcut:hover {
|
|
1017
|
-
color: #757575;
|
|
1021
|
+
.edit-post-document-actions__shortcut {
|
|
1022
|
+
color: #2f2f2f;
|
|
1018
1023
|
}
|
|
1019
1024
|
|
|
1020
|
-
.edit-post-document-
|
|
1025
|
+
.edit-post-document-actions__back.components-button.has-icon.has-text {
|
|
1021
1026
|
min-width: 36px;
|
|
1022
1027
|
flex-shrink: 0;
|
|
1023
|
-
}
|
|
1024
|
-
.edit-post-document-title__left .components-button.has-icon.has-text {
|
|
1025
1028
|
color: #757575;
|
|
1026
1029
|
gap: 0;
|
|
1027
1030
|
}
|
|
1028
|
-
.edit-post-document-
|
|
1031
|
+
.edit-post-document-actions__back.components-button.has-icon.has-text:hover {
|
|
1029
1032
|
color: currentColor;
|
|
1030
1033
|
}
|
|
1031
1034
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/edit-post",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.16.0",
|
|
4
4
|
"description": "Edit Post module for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -27,36 +27,36 @@
|
|
|
27
27
|
"react-native": "src/index",
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@babel/runtime": "^7.16.0",
|
|
30
|
-
"@wordpress/a11y": "^3.
|
|
31
|
-
"@wordpress/api-fetch": "^6.
|
|
32
|
-
"@wordpress/block-editor": "^12.
|
|
33
|
-
"@wordpress/block-library": "^8.
|
|
34
|
-
"@wordpress/blocks": "^12.
|
|
35
|
-
"@wordpress/commands": "^0.
|
|
36
|
-
"@wordpress/components": "^25.
|
|
37
|
-
"@wordpress/compose": "^6.
|
|
38
|
-
"@wordpress/core-commands": "^0.
|
|
39
|
-
"@wordpress/core-data": "^6.
|
|
40
|
-
"@wordpress/data": "^9.
|
|
41
|
-
"@wordpress/deprecated": "^3.
|
|
42
|
-
"@wordpress/dom": "^3.
|
|
43
|
-
"@wordpress/editor": "^13.
|
|
44
|
-
"@wordpress/element": "^5.
|
|
45
|
-
"@wordpress/hooks": "^3.
|
|
46
|
-
"@wordpress/i18n": "^4.
|
|
47
|
-
"@wordpress/icons": "^9.
|
|
48
|
-
"@wordpress/interface": "^5.
|
|
49
|
-
"@wordpress/keyboard-shortcuts": "^4.
|
|
50
|
-
"@wordpress/keycodes": "^3.
|
|
51
|
-
"@wordpress/media-utils": "^4.
|
|
52
|
-
"@wordpress/notices": "^4.
|
|
53
|
-
"@wordpress/plugins": "^6.
|
|
54
|
-
"@wordpress/preferences": "^3.
|
|
55
|
-
"@wordpress/private-apis": "^0.
|
|
56
|
-
"@wordpress/url": "^3.
|
|
57
|
-
"@wordpress/viewport": "^5.
|
|
58
|
-
"@wordpress/warning": "^2.
|
|
59
|
-
"@wordpress/widgets": "^3.
|
|
30
|
+
"@wordpress/a11y": "^3.39.0",
|
|
31
|
+
"@wordpress/api-fetch": "^6.36.0",
|
|
32
|
+
"@wordpress/block-editor": "^12.7.0",
|
|
33
|
+
"@wordpress/block-library": "^8.16.0",
|
|
34
|
+
"@wordpress/blocks": "^12.16.0",
|
|
35
|
+
"@wordpress/commands": "^0.10.0",
|
|
36
|
+
"@wordpress/components": "^25.5.0",
|
|
37
|
+
"@wordpress/compose": "^6.16.0",
|
|
38
|
+
"@wordpress/core-commands": "^0.8.0",
|
|
39
|
+
"@wordpress/core-data": "^6.16.0",
|
|
40
|
+
"@wordpress/data": "^9.9.0",
|
|
41
|
+
"@wordpress/deprecated": "^3.39.0",
|
|
42
|
+
"@wordpress/dom": "^3.39.0",
|
|
43
|
+
"@wordpress/editor": "^13.16.0",
|
|
44
|
+
"@wordpress/element": "^5.16.0",
|
|
45
|
+
"@wordpress/hooks": "^3.39.0",
|
|
46
|
+
"@wordpress/i18n": "^4.39.0",
|
|
47
|
+
"@wordpress/icons": "^9.30.0",
|
|
48
|
+
"@wordpress/interface": "^5.16.0",
|
|
49
|
+
"@wordpress/keyboard-shortcuts": "^4.16.0",
|
|
50
|
+
"@wordpress/keycodes": "^3.39.0",
|
|
51
|
+
"@wordpress/media-utils": "^4.30.0",
|
|
52
|
+
"@wordpress/notices": "^4.7.0",
|
|
53
|
+
"@wordpress/plugins": "^6.7.0",
|
|
54
|
+
"@wordpress/preferences": "^3.16.0",
|
|
55
|
+
"@wordpress/private-apis": "^0.21.0",
|
|
56
|
+
"@wordpress/url": "^3.40.0",
|
|
57
|
+
"@wordpress/viewport": "^5.16.0",
|
|
58
|
+
"@wordpress/warning": "^2.39.0",
|
|
59
|
+
"@wordpress/widgets": "^3.16.0",
|
|
60
60
|
"classnames": "^2.3.1",
|
|
61
61
|
"memize": "^2.1.0",
|
|
62
62
|
"rememo": "^4.0.2"
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"publishConfig": {
|
|
69
69
|
"access": "public"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "b898cf1dc8e70841d1647ea0994ac6278acc18a7"
|
|
72
72
|
}
|
|
@@ -19,7 +19,7 @@ import { displayShortcut } from '@wordpress/keycodes';
|
|
|
19
19
|
*/
|
|
20
20
|
import { store as editPostStore } from '../../../store';
|
|
21
21
|
|
|
22
|
-
function
|
|
22
|
+
function DocumentActions() {
|
|
23
23
|
const { template, isEditing } = useSelect( ( select ) => {
|
|
24
24
|
const { isEditingTemplate, getEditedPostTemplate } =
|
|
25
25
|
select( editPostStore );
|
|
@@ -46,24 +46,26 @@ function DocumentTitle() {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
return (
|
|
49
|
-
<div className="edit-post-document-
|
|
50
|
-
<
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
</span>
|
|
61
|
-
|
|
49
|
+
<div className="edit-post-document-actions">
|
|
50
|
+
<Button
|
|
51
|
+
className="edit-post-document-actions__back"
|
|
52
|
+
onClick={ () => {
|
|
53
|
+
clearSelectedBlock();
|
|
54
|
+
setIsEditingTemplate( false );
|
|
55
|
+
} }
|
|
56
|
+
icon={ isRTL() ? chevronRightSmall : chevronLeftSmall }
|
|
57
|
+
>
|
|
58
|
+
{ __( 'Back' ) }
|
|
59
|
+
</Button>
|
|
62
60
|
<Button
|
|
63
|
-
className="edit-post-document-
|
|
61
|
+
className="edit-post-document-actions__command"
|
|
64
62
|
onClick={ () => openCommandCenter() }
|
|
65
63
|
>
|
|
66
|
-
<HStack
|
|
64
|
+
<HStack
|
|
65
|
+
className="edit-post-document-actions__title"
|
|
66
|
+
spacing={ 1 }
|
|
67
|
+
justify="center"
|
|
68
|
+
>
|
|
67
69
|
<BlockIcon icon={ layout } />
|
|
68
70
|
<Text size="body" as="h1">
|
|
69
71
|
<VisuallyHidden as="span">
|
|
@@ -72,15 +74,12 @@ function DocumentTitle() {
|
|
|
72
74
|
{ templateTitle }
|
|
73
75
|
</Text>
|
|
74
76
|
</HStack>
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
onClick={ () => openCommandCenter() }
|
|
79
|
-
>
|
|
80
|
-
{ displayShortcut.primary( 'k' ) }
|
|
77
|
+
<span className="edit-post-document-actions__shortcut">
|
|
78
|
+
{ displayShortcut.primary( 'k' ) }
|
|
79
|
+
</span>
|
|
81
80
|
</Button>
|
|
82
81
|
</div>
|
|
83
82
|
);
|
|
84
83
|
}
|
|
85
84
|
|
|
86
|
-
export default
|
|
85
|
+
export default DocumentActions;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.edit-post-document-
|
|
1
|
+
.edit-post-document-actions {
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
gap: $grid-unit;
|
|
@@ -13,13 +13,21 @@
|
|
|
13
13
|
border-radius: 4px;
|
|
14
14
|
width: min(100%, 450px);
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
.components-button {
|
|
17
|
+
&:hover {
|
|
18
|
+
color: var(--wp-block-synced-color);
|
|
19
|
+
background: $gray-200;
|
|
20
|
+
}
|
|
19
21
|
}
|
|
20
22
|
}
|
|
21
23
|
|
|
22
|
-
.edit-post-document-
|
|
24
|
+
.edit-post-document-actions__command {
|
|
25
|
+
flex-grow: 1;
|
|
26
|
+
color: var(--wp-block-synced-color);
|
|
27
|
+
overflow: hidden;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.edit-post-document-actions__title {
|
|
23
31
|
flex-grow: 1;
|
|
24
32
|
color: var(--wp-block-synced-color);
|
|
25
33
|
overflow: hidden;
|
|
@@ -28,34 +36,29 @@
|
|
|
28
36
|
color: var(--wp-block-synced-color);
|
|
29
37
|
}
|
|
30
38
|
|
|
39
|
+
.block-editor-block-icon {
|
|
40
|
+
flex-shrink: 0;
|
|
41
|
+
}
|
|
42
|
+
|
|
31
43
|
h1 {
|
|
32
|
-
color: var(--wp-block-synced-color);
|
|
33
44
|
white-space: nowrap;
|
|
34
45
|
overflow: hidden;
|
|
35
46
|
text-overflow: ellipsis;
|
|
47
|
+
color: var(--wp-block-synced-color);
|
|
36
48
|
}
|
|
37
49
|
}
|
|
38
50
|
|
|
39
|
-
.edit-post-document-
|
|
40
|
-
|
|
41
|
-
color: $gray-700;
|
|
42
|
-
padding: 0 $grid-unit-15;
|
|
43
|
-
|
|
44
|
-
&:hover {
|
|
45
|
-
color: $gray-700;
|
|
46
|
-
}
|
|
51
|
+
.edit-post-document-actions__shortcut {
|
|
52
|
+
color: $gray-800;
|
|
47
53
|
}
|
|
48
54
|
|
|
49
|
-
.edit-post-document-
|
|
55
|
+
.edit-post-document-actions__back.components-button.has-icon.has-text {
|
|
50
56
|
min-width: $button-size;
|
|
51
57
|
flex-shrink: 0;
|
|
58
|
+
color: $gray-700;
|
|
59
|
+
gap: 0;
|
|
52
60
|
|
|
53
|
-
|
|
54
|
-
color:
|
|
55
|
-
gap: 0;
|
|
56
|
-
|
|
57
|
-
&:hover {
|
|
58
|
-
color: currentColor;
|
|
59
|
-
}
|
|
61
|
+
&:hover {
|
|
62
|
+
color: currentColor;
|
|
60
63
|
}
|
|
61
64
|
}
|