@wordpress/edit-site 3.0.26 → 3.1.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/LICENSE.md +1 -1
- package/build/components/block-editor/resizable-editor.js +1 -0
- package/build/components/block-editor/resizable-editor.js.map +1 -1
- package/build/components/code-editor/code-editor-text-area.js +95 -0
- package/build/components/code-editor/code-editor-text-area.js.map +1 -0
- package/build/components/code-editor/index.js +79 -0
- package/build/components/code-editor/index.js.map +1 -0
- package/build/components/editor/index.js +10 -5
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/border-panel.js +81 -22
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/context-menu.js +4 -6
- package/build/components/global-styles/context-menu.js.map +1 -1
- package/build/components/global-styles/global-styles-provider.js +1 -0
- package/build/components/global-styles/global-styles-provider.js.map +1 -1
- package/build/components/global-styles/header.js +2 -7
- package/build/components/global-styles/header.js.map +1 -1
- package/build/components/global-styles/navigation-button.js +27 -12
- package/build/components/global-styles/navigation-button.js.map +1 -1
- package/build/components/global-styles/palette.js +2 -2
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/preview.js +46 -15
- package/build/components/global-styles/preview.js.map +1 -1
- package/build/components/global-styles/screen-background-color.js +9 -12
- package/build/components/global-styles/screen-background-color.js.map +1 -1
- package/build/components/global-styles/screen-block-list.js +2 -3
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-block.js +0 -1
- package/build/components/global-styles/screen-block.js.map +1 -1
- package/build/components/global-styles/screen-color-palette.js +0 -2
- package/build/components/global-styles/screen-color-palette.js.map +1 -1
- package/build/components/global-styles/screen-colors.js +5 -6
- package/build/components/global-styles/screen-colors.js.map +1 -1
- package/build/components/global-styles/screen-layout.js +0 -2
- package/build/components/global-styles/screen-layout.js.map +1 -1
- package/build/components/global-styles/screen-link-color.js +6 -12
- package/build/components/global-styles/screen-link-color.js.map +1 -1
- package/build/components/global-styles/screen-root.js +22 -3
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/screen-style-variations.js +138 -0
- package/build/components/global-styles/screen-style-variations.js.map +1 -0
- package/build/components/global-styles/screen-text-color.js +6 -12
- package/build/components/global-styles/screen-text-color.js.map +1 -1
- package/build/components/global-styles/screen-typography-element.js +0 -2
- package/build/components/global-styles/screen-typography-element.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +2 -3
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/ui.js +31 -14
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/header/index.js +12 -4
- package/build/components/header/index.js.map +1 -1
- package/build/components/header/mode-switcher/index.js +78 -0
- package/build/components/header/mode-switcher/index.js.map +1 -0
- package/build/components/header/more-menu/copy-content-menu-item.js +74 -0
- package/build/components/header/more-menu/copy-content-menu-item.js.map +1 -0
- package/build/components/header/more-menu/index.js +72 -39
- package/build/components/header/more-menu/index.js.map +1 -1
- package/build/{plugins → components/header/more-menu}/site-export.js +0 -0
- package/build/components/header/more-menu/site-export.js.map +1 -0
- package/build/{plugins → components/header/more-menu}/welcome-guide-menu-item.js +1 -1
- package/build/components/header/more-menu/welcome-guide-menu-item.js.map +1 -0
- package/build/components/header/tools-more-menu-group/index.js +1 -5
- package/build/components/header/tools-more-menu-group/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +45 -0
- package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -0
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +56 -0
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -0
- package/build/components/keyboard-shortcut-help-modal/index.js +137 -0
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -0
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +65 -0
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -0
- package/build/components/keyboard-shortcuts/index.js +26 -1
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/list/actions/index.js +5 -4
- package/build/components/list/actions/index.js.map +1 -1
- package/build/components/list/actions/rename-menu-item.js +3 -3
- package/build/components/list/actions/rename-menu-item.js.map +1 -1
- package/build/components/list/added-by.js +51 -50
- package/build/components/list/added-by.js.map +1 -1
- package/build/components/routes/redirect-to-homepage.js +87 -0
- package/build/components/routes/redirect-to-homepage.js.map +1 -0
- package/build/components/secondary-sidebar/inserter-sidebar.js +13 -3
- package/build/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +7 -5
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build/components/sidebar/default-sidebar.js +4 -2
- package/build/components/sidebar/default-sidebar.js.map +1 -1
- package/build/components/sidebar/global-styles-sidebar.js +1 -0
- package/build/components/sidebar/global-styles-sidebar.js.map +1 -1
- package/build/components/url-query-controller/index.js +1 -38
- package/build/components/url-query-controller/index.js.map +1 -1
- package/build/index.js +9 -4
- package/build/index.js.map +1 -1
- package/build/store/actions.js +26 -25
- package/build/store/actions.js.map +1 -1
- package/build/store/defaults.js +2 -1
- package/build/store/defaults.js.map +1 -1
- package/build/store/reducer.js +11 -0
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +13 -0
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/block-editor/resizable-editor.js +1 -0
- package/build-module/components/block-editor/resizable-editor.js.map +1 -1
- package/build-module/components/code-editor/code-editor-text-area.js +83 -0
- package/build-module/components/code-editor/code-editor-text-area.js.map +1 -0
- package/build-module/components/code-editor/index.js +62 -0
- package/build-module/components/code-editor/index.js.map +1 -0
- package/build-module/components/editor/index.js +9 -5
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +82 -23
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/context-menu.js +1 -1
- package/build-module/components/global-styles/context-menu.js.map +1 -1
- package/build-module/components/global-styles/global-styles-provider.js +1 -1
- package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
- package/build-module/components/global-styles/header.js +2 -5
- package/build-module/components/global-styles/header.js.map +1 -1
- package/build-module/components/global-styles/navigation-button.js +27 -10
- package/build-module/components/global-styles/navigation-button.js.map +1 -1
- package/build-module/components/global-styles/palette.js +1 -1
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/global-styles/preview.js +45 -15
- package/build-module/components/global-styles/preview.js.map +1 -1
- package/build-module/components/global-styles/screen-background-color.js +9 -13
- package/build-module/components/global-styles/screen-background-color.js.map +1 -1
- package/build-module/components/global-styles/screen-block-list.js +1 -2
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-block.js +0 -1
- package/build-module/components/global-styles/screen-block.js.map +1 -1
- package/build-module/components/global-styles/screen-color-palette.js +0 -2
- package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
- package/build-module/components/global-styles/screen-colors.js +2 -3
- package/build-module/components/global-styles/screen-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-layout.js +0 -2
- package/build-module/components/global-styles/screen-layout.js.map +1 -1
- package/build-module/components/global-styles/screen-link-color.js +7 -13
- package/build-module/components/global-styles/screen-link-color.js.map +1 -1
- package/build-module/components/global-styles/screen-root.js +21 -4
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/screen-style-variations.js +119 -0
- package/build-module/components/global-styles/screen-style-variations.js.map +1 -0
- package/build-module/components/global-styles/screen-text-color.js +7 -13
- package/build-module/components/global-styles/screen-text-color.js.map +1 -1
- package/build-module/components/global-styles/screen-typography-element.js +0 -2
- package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +1 -2
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/ui.js +29 -14
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/header/index.js +13 -5
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/header/mode-switcher/index.js +65 -0
- package/build-module/components/header/mode-switcher/index.js.map +1 -0
- package/build-module/components/header/more-menu/copy-content-menu-item.js +59 -0
- package/build-module/components/header/more-menu/copy-content-menu-item.js.map +1 -0
- package/build-module/components/header/more-menu/index.js +67 -40
- package/build-module/components/header/more-menu/index.js.map +1 -1
- package/build-module/{plugins → components/header/more-menu}/site-export.js +0 -0
- package/build-module/components/header/more-menu/site-export.js.map +1 -0
- package/build-module/{plugins → components/header/more-menu}/welcome-guide-menu-item.js +1 -1
- package/build-module/components/header/more-menu/welcome-guide-menu-item.js.map +1 -0
- package/build-module/components/header/tools-more-menu-group/index.js +2 -5
- package/build-module/components/header/tools-more-menu-group/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js +36 -0
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -0
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +44 -0
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -0
- package/build-module/components/keyboard-shortcut-help-modal/index.js +120 -0
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -0
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +58 -0
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -0
- package/build-module/components/keyboard-shortcuts/index.js +26 -1
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/list/actions/index.js +5 -4
- package/build-module/components/list/actions/index.js.map +1 -1
- package/build-module/components/list/actions/rename-menu-item.js +3 -3
- package/build-module/components/list/actions/rename-menu-item.js.map +1 -1
- package/build-module/components/list/added-by.js +52 -51
- package/build-module/components/list/added-by.js.map +1 -1
- package/build-module/components/routes/redirect-to-homepage.js +75 -0
- package/build-module/components/routes/redirect-to-homepage.js.map +1 -0
- package/build-module/components/secondary-sidebar/inserter-sidebar.js +14 -4
- package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +7 -5
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build-module/components/sidebar/default-sidebar.js +4 -2
- package/build-module/components/sidebar/default-sidebar.js.map +1 -1
- package/build-module/components/sidebar/global-styles-sidebar.js +1 -0
- package/build-module/components/sidebar/global-styles-sidebar.js.map +1 -1
- package/build-module/components/url-query-controller/index.js +3 -40
- package/build-module/components/url-query-controller/index.js.map +1 -1
- package/build-module/index.js +8 -3
- package/build-module/index.js.map +1 -1
- package/build-module/store/actions.js +22 -23
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/defaults.js +2 -1
- package/build-module/store/defaults.js.map +1 -1
- package/build-module/store/reducer.js +11 -0
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +11 -0
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +199 -68
- package/build-style/style.css +199 -68
- package/package.json +29 -28
- package/src/components/block-editor/resizable-editor.js +1 -0
- package/src/components/block-editor/style.scss +10 -18
- package/src/components/code-editor/code-editor-text-area.js +79 -0
- package/src/components/code-editor/index.js +65 -0
- package/src/components/code-editor/style.scss +100 -0
- package/src/components/editor/index.js +16 -7
- package/src/components/global-styles/border-panel.js +106 -42
- package/src/components/global-styles/context-menu.js +1 -1
- package/src/components/global-styles/global-styles-provider.js +1 -2
- package/src/components/global-styles/header.js +3 -5
- package/src/components/global-styles/navigation-button.js +14 -10
- package/src/components/global-styles/palette.js +1 -1
- package/src/components/global-styles/preview.js +46 -18
- package/src/components/global-styles/screen-background-color.js +7 -12
- package/src/components/global-styles/screen-block-list.js +1 -2
- package/src/components/global-styles/screen-block.js +1 -1
- package/src/components/global-styles/screen-color-palette.js +0 -2
- package/src/components/global-styles/screen-colors.js +2 -3
- package/src/components/global-styles/screen-layout.js +1 -5
- package/src/components/global-styles/screen-link-color.js +6 -16
- package/src/components/global-styles/screen-root.js +32 -3
- package/src/components/global-styles/screen-style-variations.js +130 -0
- package/src/components/global-styles/screen-text-color.js +6 -16
- package/src/components/global-styles/screen-typography-element.js +0 -4
- package/src/components/global-styles/screen-typography.js +2 -3
- package/src/components/global-styles/style.scss +24 -25
- package/src/components/global-styles/ui.js +55 -25
- package/src/components/header/document-actions/style.scss +1 -9
- package/src/components/header/index.js +10 -2
- package/src/components/header/mode-switcher/index.js +67 -0
- package/src/components/header/more-menu/copy-content-menu-item.js +53 -0
- package/src/components/header/more-menu/index.js +107 -44
- package/src/{plugins → components/header/more-menu}/site-export.js +0 -0
- package/src/{plugins → components/header/more-menu}/welcome-guide-menu-item.js +1 -1
- package/src/components/header/style.scss +2 -1
- package/src/components/header/tools-more-menu-group/index.js +2 -7
- package/src/components/keyboard-shortcut-help-modal/config.js +27 -0
- package/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +41 -0
- package/src/components/keyboard-shortcut-help-modal/index.js +135 -0
- package/src/components/keyboard-shortcut-help-modal/shortcut.js +73 -0
- package/src/components/keyboard-shortcut-help-modal/style.scss +66 -0
- package/src/components/keyboard-shortcuts/index.js +27 -1
- package/src/components/list/actions/index.js +5 -4
- package/src/components/list/actions/rename-menu-item.js +3 -3
- package/src/components/list/added-by.js +57 -63
- package/src/components/routes/redirect-to-homepage.js +71 -0
- package/src/components/secondary-sidebar/inserter-sidebar.js +14 -3
- package/src/components/secondary-sidebar/list-view-sidebar.js +12 -5
- package/src/components/secondary-sidebar/style.scss +0 -4
- package/src/components/sidebar/default-sidebar.js +2 -0
- package/src/components/sidebar/global-styles-sidebar.js +1 -0
- package/src/components/sidebar/style.scss +21 -14
- package/src/components/url-query-controller/index.js +3 -35
- package/src/index.js +9 -2
- package/src/store/actions.js +22 -35
- package/src/store/defaults.js +1 -0
- package/src/store/reducer.js +6 -0
- package/src/store/selectors.js +11 -0
- package/src/store/test/actions.js +2 -92
- package/src/style.scss +2 -0
- package/build/plugins/index.js +0 -28
- package/build/plugins/index.js.map +0 -1
- package/build/plugins/site-export.js.map +0 -1
- package/build/plugins/welcome-guide-menu-item.js.map +0 -1
- package/build-module/plugins/index.js +0 -20
- package/build-module/plugins/index.js.map +0 -1
- package/build-module/plugins/site-export.js.map +0 -1
- package/build-module/plugins/welcome-guide-menu-item.js.map +0 -1
- package/src/plugins/index.js +0 -24
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/header/tools-more-menu-group/index.js"],"names":["Fill","ToolsMoreMenuGroup","Slot","fillProps","fills"],"mappings":";;;;;;;;;AAGA;;AAKA;;
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/header/tools-more-menu-group/index.js"],"names":["Fill","ToolsMoreMenuGroup","Slot","fillProps","fills"],"mappings":";;;;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAGA,MAAM;AAAEA,EAAAA,IAAI,EAAEC,kBAAR;AAA4BC,EAAAA;AAA5B,IAAqC,gCAC1C,4BAD0C,CAA3C;;AAIAD,kBAAkB,CAACC,IAAnB,GAA0B;AAAA,MAAE;AAAEC,IAAAA;AAAF,GAAF;AAAA,SACzB,4BAAC,IAAD;AAAM,IAAA,SAAS,EAAGA;AAAlB,KACKC,KAAF,IAAa,CAAE,qBAASA,KAAT,CAAF,IAAsBA,KADtC,CADyB;AAAA,CAA1B;;eAMeH,kB","sourcesContent":["/**\n * External dependencies\n */\nimport { isEmpty } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { createSlotFill } from '@wordpress/components';\n\nconst { Fill: ToolsMoreMenuGroup, Slot } = createSlotFill(\n\t'EditSiteToolsMoreMenuGroup'\n);\n\nToolsMoreMenuGroup.Slot = ( { fillProps } ) => (\n\t<Slot fillProps={ fillProps }>\n\t\t{ ( fills ) => ! isEmpty( fills ) && fills }\n\t</Slot>\n);\n\nexport default ToolsMoreMenuGroup;\n"]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.textFormattingShortcuts = void 0;
|
|
7
|
+
|
|
8
|
+
var _i18n = require("@wordpress/i18n");
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* WordPress dependencies
|
|
12
|
+
*/
|
|
13
|
+
const textFormattingShortcuts = [{
|
|
14
|
+
keyCombination: {
|
|
15
|
+
modifier: 'primary',
|
|
16
|
+
character: 'b'
|
|
17
|
+
},
|
|
18
|
+
description: (0, _i18n.__)('Make the selected text bold.')
|
|
19
|
+
}, {
|
|
20
|
+
keyCombination: {
|
|
21
|
+
modifier: 'primary',
|
|
22
|
+
character: 'i'
|
|
23
|
+
},
|
|
24
|
+
description: (0, _i18n.__)('Make the selected text italic.')
|
|
25
|
+
}, {
|
|
26
|
+
keyCombination: {
|
|
27
|
+
modifier: 'primary',
|
|
28
|
+
character: 'k'
|
|
29
|
+
},
|
|
30
|
+
description: (0, _i18n.__)('Convert the selected text into a link.')
|
|
31
|
+
}, {
|
|
32
|
+
keyCombination: {
|
|
33
|
+
modifier: 'primaryShift',
|
|
34
|
+
character: 'k'
|
|
35
|
+
},
|
|
36
|
+
description: (0, _i18n.__)('Remove a link.')
|
|
37
|
+
}, {
|
|
38
|
+
keyCombination: {
|
|
39
|
+
modifier: 'primary',
|
|
40
|
+
character: 'u'
|
|
41
|
+
},
|
|
42
|
+
description: (0, _i18n.__)('Underline the selected text.')
|
|
43
|
+
}];
|
|
44
|
+
exports.textFormattingShortcuts = textFormattingShortcuts;
|
|
45
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/keyboard-shortcut-help-modal/config.js"],"names":["textFormattingShortcuts","keyCombination","modifier","character","description"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;AAGO,MAAMA,uBAAuB,GAAG,CACtC;AACCC,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,SAAZ;AAAuBC,IAAAA,SAAS,EAAE;AAAlC,GADjB;AAECC,EAAAA,WAAW,EAAE,cAAI,8BAAJ;AAFd,CADsC,EAKtC;AACCH,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,SAAZ;AAAuBC,IAAAA,SAAS,EAAE;AAAlC,GADjB;AAECC,EAAAA,WAAW,EAAE,cAAI,gCAAJ;AAFd,CALsC,EAStC;AACCH,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,SAAZ;AAAuBC,IAAAA,SAAS,EAAE;AAAlC,GADjB;AAECC,EAAAA,WAAW,EAAE,cAAI,wCAAJ;AAFd,CATsC,EAatC;AACCH,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,cAAZ;AAA4BC,IAAAA,SAAS,EAAE;AAAvC,GADjB;AAECC,EAAAA,WAAW,EAAE,cAAI,gBAAJ;AAFd,CAbsC,EAiBtC;AACCH,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,SAAZ;AAAuBC,IAAAA,SAAS,EAAE;AAAlC,GADjB;AAECC,EAAAA,WAAW,EAAE,cAAI,8BAAJ;AAFd,CAjBsC,CAAhC","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\nexport const textFormattingShortcuts = [\n\t{\n\t\tkeyCombination: { modifier: 'primary', character: 'b' },\n\t\tdescription: __( 'Make the selected text bold.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primary', character: 'i' },\n\t\tdescription: __( 'Make the selected text italic.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primary', character: 'k' },\n\t\tdescription: __( 'Convert the selected text into a link.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primaryShift', character: 'k' },\n\t\tdescription: __( 'Remove a link.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primary', character: 'u' },\n\t\tdescription: __( 'Underline the selected text.' ),\n\t},\n];\n"]}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = DynamicShortcut;
|
|
9
|
+
|
|
10
|
+
var _element = require("@wordpress/element");
|
|
11
|
+
|
|
12
|
+
var _data = require("@wordpress/data");
|
|
13
|
+
|
|
14
|
+
var _keyboardShortcuts = require("@wordpress/keyboard-shortcuts");
|
|
15
|
+
|
|
16
|
+
var _shortcut = _interopRequireDefault(require("./shortcut"));
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* WordPress dependencies
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Internal dependencies
|
|
24
|
+
*/
|
|
25
|
+
function DynamicShortcut(_ref) {
|
|
26
|
+
let {
|
|
27
|
+
name
|
|
28
|
+
} = _ref;
|
|
29
|
+
const {
|
|
30
|
+
keyCombination,
|
|
31
|
+
description,
|
|
32
|
+
aliases
|
|
33
|
+
} = (0, _data.useSelect)(select => {
|
|
34
|
+
const {
|
|
35
|
+
getShortcutKeyCombination,
|
|
36
|
+
getShortcutDescription,
|
|
37
|
+
getShortcutAliases
|
|
38
|
+
} = select(_keyboardShortcuts.store);
|
|
39
|
+
return {
|
|
40
|
+
keyCombination: getShortcutKeyCombination(name),
|
|
41
|
+
aliases: getShortcutAliases(name),
|
|
42
|
+
description: getShortcutDescription(name)
|
|
43
|
+
};
|
|
44
|
+
}, [name]);
|
|
45
|
+
|
|
46
|
+
if (!keyCombination) {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return (0, _element.createElement)(_shortcut.default, {
|
|
51
|
+
keyCombination: keyCombination,
|
|
52
|
+
description: description,
|
|
53
|
+
aliases: aliases
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=dynamic-shortcut.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js"],"names":["DynamicShortcut","name","keyCombination","description","aliases","select","getShortcutKeyCombination","getShortcutDescription","getShortcutAliases","keyboardShortcutsStore"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AAKA;;AATA;AACA;AACA;;AAIA;AACA;AACA;AAGe,SAASA,eAAT,OAAqC;AAAA,MAAX;AAAEC,IAAAA;AAAF,GAAW;AACnD,QAAM;AAAEC,IAAAA,cAAF;AAAkBC,IAAAA,WAAlB;AAA+BC,IAAAA;AAA/B,MAA2C,qBAC9CC,MAAF,IAAc;AACb,UAAM;AACLC,MAAAA,yBADK;AAELC,MAAAA,sBAFK;AAGLC,MAAAA;AAHK,QAIFH,MAAM,CAAEI,wBAAF,CAJV;AAMA,WAAO;AACNP,MAAAA,cAAc,EAAEI,yBAAyB,CAAEL,IAAF,CADnC;AAENG,MAAAA,OAAO,EAAEI,kBAAkB,CAAEP,IAAF,CAFrB;AAGNE,MAAAA,WAAW,EAAEI,sBAAsB,CAAEN,IAAF;AAH7B,KAAP;AAKA,GAb+C,EAchD,CAAEA,IAAF,CAdgD,CAAjD;;AAiBA,MAAK,CAAEC,cAAP,EAAwB;AACvB,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,iBAAD;AACC,IAAA,cAAc,EAAGA,cADlB;AAEC,IAAA,WAAW,EAAGC,WAFf;AAGC,IAAA,OAAO,EAAGC;AAHX,IADD;AAOA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\n\n/**\n * Internal dependencies\n */\nimport Shortcut from './shortcut';\n\nexport default function DynamicShortcut( { name } ) {\n\tconst { keyCombination, description, aliases } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetShortcutKeyCombination,\n\t\t\t\tgetShortcutDescription,\n\t\t\t\tgetShortcutAliases,\n\t\t\t} = select( keyboardShortcutsStore );\n\n\t\t\treturn {\n\t\t\t\tkeyCombination: getShortcutKeyCombination( name ),\n\t\t\t\taliases: getShortcutAliases( name ),\n\t\t\t\tdescription: getShortcutDescription( name ),\n\t\t\t};\n\t\t},\n\t\t[ name ]\n\t);\n\n\tif ( ! keyCombination ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Shortcut\n\t\t\tkeyCombination={ keyCombination }\n\t\t\tdescription={ description }\n\t\t\taliases={ aliases }\n\t\t/>\n\t);\n}\n"]}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = KeyboardShortcutHelpModal;
|
|
9
|
+
|
|
10
|
+
var _element = require("@wordpress/element");
|
|
11
|
+
|
|
12
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
|
|
14
|
+
var _lodash = require("lodash");
|
|
15
|
+
|
|
16
|
+
var _components = require("@wordpress/components");
|
|
17
|
+
|
|
18
|
+
var _i18n = require("@wordpress/i18n");
|
|
19
|
+
|
|
20
|
+
var _keyboardShortcuts = require("@wordpress/keyboard-shortcuts");
|
|
21
|
+
|
|
22
|
+
var _data = require("@wordpress/data");
|
|
23
|
+
|
|
24
|
+
var _config = require("./config");
|
|
25
|
+
|
|
26
|
+
var _shortcut = _interopRequireDefault(require("./shortcut"));
|
|
27
|
+
|
|
28
|
+
var _dynamicShortcut = _interopRequireDefault(require("./dynamic-shortcut"));
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* External dependencies
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* WordPress dependencies
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Internal dependencies
|
|
40
|
+
*/
|
|
41
|
+
const ShortcutList = _ref => {
|
|
42
|
+
let {
|
|
43
|
+
shortcuts
|
|
44
|
+
} = _ref;
|
|
45
|
+
return (
|
|
46
|
+
/*
|
|
47
|
+
* Disable reason: The `list` ARIA role is redundant but
|
|
48
|
+
* Safari+VoiceOver won't announce the list otherwise.
|
|
49
|
+
*/
|
|
50
|
+
|
|
51
|
+
/* eslint-disable jsx-a11y/no-redundant-roles */
|
|
52
|
+
(0, _element.createElement)("ul", {
|
|
53
|
+
className: "edit-site-keyboard-shortcut-help-modal__shortcut-list",
|
|
54
|
+
role: "list"
|
|
55
|
+
}, shortcuts.map((shortcut, index) => (0, _element.createElement)("li", {
|
|
56
|
+
className: "edit-site-keyboard-shortcut-help-modal__shortcut",
|
|
57
|
+
key: index
|
|
58
|
+
}, (0, _lodash.isString)(shortcut) ? (0, _element.createElement)(_dynamicShortcut.default, {
|
|
59
|
+
name: shortcut
|
|
60
|
+
}) : (0, _element.createElement)(_shortcut.default, shortcut))))
|
|
61
|
+
/* eslint-enable jsx-a11y/no-redundant-roles */
|
|
62
|
+
|
|
63
|
+
);
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
const ShortcutSection = _ref2 => {
|
|
67
|
+
let {
|
|
68
|
+
title,
|
|
69
|
+
shortcuts,
|
|
70
|
+
className
|
|
71
|
+
} = _ref2;
|
|
72
|
+
return (0, _element.createElement)("section", {
|
|
73
|
+
className: (0, _classnames.default)('edit-site-keyboard-shortcut-help-modal__section', className)
|
|
74
|
+
}, !!title && (0, _element.createElement)("h2", {
|
|
75
|
+
className: "edit-site-keyboard-shortcut-help-modal__section-title"
|
|
76
|
+
}, title), (0, _element.createElement)(ShortcutList, {
|
|
77
|
+
shortcuts: shortcuts
|
|
78
|
+
}));
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const ShortcutCategorySection = _ref3 => {
|
|
82
|
+
let {
|
|
83
|
+
title,
|
|
84
|
+
categoryName,
|
|
85
|
+
additionalShortcuts = []
|
|
86
|
+
} = _ref3;
|
|
87
|
+
const categoryShortcuts = (0, _data.useSelect)(select => {
|
|
88
|
+
return select(_keyboardShortcuts.store).getCategoryShortcuts(categoryName);
|
|
89
|
+
}, [categoryName]);
|
|
90
|
+
return (0, _element.createElement)(ShortcutSection, {
|
|
91
|
+
title: title,
|
|
92
|
+
shortcuts: categoryShortcuts.concat(additionalShortcuts)
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
function KeyboardShortcutHelpModal(_ref4) {
|
|
97
|
+
let {
|
|
98
|
+
isModalActive,
|
|
99
|
+
toggleModal
|
|
100
|
+
} = _ref4;
|
|
101
|
+
|
|
102
|
+
if (!isModalActive) {
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return (0, _element.createElement)(_components.Modal, {
|
|
107
|
+
className: "edit-site-keyboard-shortcut-help-modal",
|
|
108
|
+
title: (0, _i18n.__)('Keyboard shortcuts'),
|
|
109
|
+
closeLabel: (0, _i18n.__)('Close'),
|
|
110
|
+
onRequestClose: toggleModal
|
|
111
|
+
}, (0, _element.createElement)(ShortcutSection, {
|
|
112
|
+
className: "edit-site-keyboard-shortcut-help-modal__main-shortcuts",
|
|
113
|
+
shortcuts: ['core/edit-site/keyboard-shortcuts']
|
|
114
|
+
}), (0, _element.createElement)(ShortcutCategorySection, {
|
|
115
|
+
title: (0, _i18n.__)('Global shortcuts'),
|
|
116
|
+
categoryName: "global"
|
|
117
|
+
}), (0, _element.createElement)(ShortcutCategorySection, {
|
|
118
|
+
title: (0, _i18n.__)('Selection shortcuts'),
|
|
119
|
+
categoryName: "selection"
|
|
120
|
+
}), (0, _element.createElement)(ShortcutCategorySection, {
|
|
121
|
+
title: (0, _i18n.__)('Block shortcuts'),
|
|
122
|
+
categoryName: "block",
|
|
123
|
+
additionalShortcuts: [{
|
|
124
|
+
keyCombination: {
|
|
125
|
+
character: '/'
|
|
126
|
+
},
|
|
127
|
+
description: (0, _i18n.__)('Change the block type after adding a new paragraph.'),
|
|
128
|
+
|
|
129
|
+
/* translators: The forward-slash character. e.g. '/'. */
|
|
130
|
+
ariaLabel: (0, _i18n.__)('Forward-slash')
|
|
131
|
+
}]
|
|
132
|
+
}), (0, _element.createElement)(ShortcutSection, {
|
|
133
|
+
title: (0, _i18n.__)('Text formatting'),
|
|
134
|
+
shortcuts: _config.textFormattingShortcuts
|
|
135
|
+
}));
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/keyboard-shortcut-help-modal/index.js"],"names":["ShortcutList","shortcuts","map","shortcut","index","ShortcutSection","title","className","ShortcutCategorySection","categoryName","additionalShortcuts","categoryShortcuts","select","keyboardShortcutsStore","getCategoryShortcuts","concat","KeyboardShortcutHelpModal","isModalActive","toggleModal","keyCombination","character","description","ariaLabel","textFormattingShortcuts"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAnBA;AACA;AACA;;AAIA;AACA;AACA;;AAMA;AACA;AACA;AAKA,MAAMA,YAAY,GAAG;AAAA,MAAE;AAAEC,IAAAA;AAAF,GAAF;AAAA;AACpB;AACD;AACA;AACA;;AACC;AACA;AACC,MAAA,SAAS,EAAC,uDADX;AAEC,MAAA,IAAI,EAAC;AAFN,OAIGA,SAAS,CAACC,GAAV,CAAe,CAAEC,QAAF,EAAYC,KAAZ,KAChB;AACC,MAAA,SAAS,EAAC,kDADX;AAEC,MAAA,GAAG,EAAGA;AAFP,OAIG,sBAAUD,QAAV,IACD,4BAAC,wBAAD;AAAiB,MAAA,IAAI,EAAGA;AAAxB,MADC,GAGD,4BAAC,iBAAD,EAAeA,QAAf,CAPF,CADC,CAJH;AAiBA;;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KAAK,EAAG,cAAI,kBAAJ,CADT;AAEC,IAAA,YAAY,EAAC;AAFd,IAVD,EAeC,4BAAC,uBAAD;AACC,IAAA,KAAK,EAAG,cAAI,qBAAJ,CADT;AAEC,IAAA,YAAY,EAAC;AAFd,IAfD,EAoBC,4BAAC,uBAAD;AACC,IAAA,KAAK,EAAG,cAAI,iBAAJ,CADT;AAEC,IAAA,YAAY,EAAC,OAFd;AAGC,IAAA,mBAAmB,EAAG,CACrB;AACCC,MAAAA,cAAc,EAAE;AAAEC,QAAAA,SAAS,EAAE;AAAb,OADjB;AAECC,MAAAA,WAAW,EAAE,cACZ,qDADY,CAFd;;AAKC;AACAC,MAAAA,SAAS,EAAE,cAAI,eAAJ;AANZ,KADqB;AAHvB,IApBD,EAkCC,4BAAC,eAAD;AACC,IAAA,KAAK,EAAG,cAAI,iBAAJ,CADT;AAEC,IAAA,SAAS,EAAGC;AAFb,IAlCD,CADD;AAyCA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport { isString } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { Modal } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { textFormattingShortcuts } from './config';\nimport Shortcut from './shortcut';\nimport DynamicShortcut from './dynamic-shortcut';\n\nconst ShortcutList = ( { shortcuts } ) => (\n\t/*\n\t * Disable reason: The `list` ARIA role is redundant but\n\t * Safari+VoiceOver won't announce the list otherwise.\n\t */\n\t/* eslint-disable jsx-a11y/no-redundant-roles */\n\t<ul\n\t\tclassName=\"edit-site-keyboard-shortcut-help-modal__shortcut-list\"\n\t\trole=\"list\"\n\t>\n\t\t{ shortcuts.map( ( shortcut, index ) => (\n\t\t\t<li\n\t\t\t\tclassName=\"edit-site-keyboard-shortcut-help-modal__shortcut\"\n\t\t\t\tkey={ index }\n\t\t\t>\n\t\t\t\t{ isString( shortcut ) ? (\n\t\t\t\t\t<DynamicShortcut name={ shortcut } />\n\t\t\t\t) : (\n\t\t\t\t\t<Shortcut { ...shortcut } />\n\t\t\t\t) }\n\t\t\t</li>\n\t\t) ) }\n\t</ul>\n\t/* eslint-enable jsx-a11y/no-redundant-roles */\n);\n\nconst ShortcutSection = ( { title, shortcuts, className } ) => (\n\t<section\n\t\tclassName={ classnames(\n\t\t\t'edit-site-keyboard-shortcut-help-modal__section',\n\t\t\tclassName\n\t\t) }\n\t>\n\t\t{ !! title && (\n\t\t\t<h2 className=\"edit-site-keyboard-shortcut-help-modal__section-title\">\n\t\t\t\t{ title }\n\t\t\t</h2>\n\t\t) }\n\t\t<ShortcutList shortcuts={ shortcuts } />\n\t</section>\n);\n\nconst ShortcutCategorySection = ( {\n\ttitle,\n\tcategoryName,\n\tadditionalShortcuts = [],\n} ) => {\n\tconst categoryShortcuts = useSelect(\n\t\t( select ) => {\n\t\t\treturn select( keyboardShortcutsStore ).getCategoryShortcuts(\n\t\t\t\tcategoryName\n\t\t\t);\n\t\t},\n\t\t[ categoryName ]\n\t);\n\n\treturn (\n\t\t<ShortcutSection\n\t\t\ttitle={ title }\n\t\t\tshortcuts={ categoryShortcuts.concat( additionalShortcuts ) }\n\t\t/>\n\t);\n};\n\nexport default function KeyboardShortcutHelpModal( {\n\tisModalActive,\n\ttoggleModal,\n} ) {\n\tif ( ! isModalActive ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Modal\n\t\t\tclassName=\"edit-site-keyboard-shortcut-help-modal\"\n\t\t\ttitle={ __( 'Keyboard shortcuts' ) }\n\t\t\tcloseLabel={ __( 'Close' ) }\n\t\t\tonRequestClose={ toggleModal }\n\t\t>\n\t\t\t<ShortcutSection\n\t\t\t\tclassName=\"edit-site-keyboard-shortcut-help-modal__main-shortcuts\"\n\t\t\t\tshortcuts={ [ 'core/edit-site/keyboard-shortcuts' ] }\n\t\t\t/>\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Global shortcuts' ) }\n\t\t\t\tcategoryName=\"global\"\n\t\t\t/>\n\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Selection shortcuts' ) }\n\t\t\t\tcategoryName=\"selection\"\n\t\t\t/>\n\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Block shortcuts' ) }\n\t\t\t\tcategoryName=\"block\"\n\t\t\t\tadditionalShortcuts={ [\n\t\t\t\t\t{\n\t\t\t\t\t\tkeyCombination: { character: '/' },\n\t\t\t\t\t\tdescription: __(\n\t\t\t\t\t\t\t'Change the block type after adding a new paragraph.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t/* translators: The forward-slash character. e.g. '/'. */\n\t\t\t\t\t\tariaLabel: __( 'Forward-slash' ),\n\t\t\t\t\t},\n\t\t\t\t] }\n\t\t\t/>\n\t\t\t<ShortcutSection\n\t\t\t\ttitle={ __( 'Text formatting' ) }\n\t\t\t\tshortcuts={ textFormattingShortcuts }\n\t\t\t/>\n\t\t</Modal>\n\t);\n}\n"]}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = Shortcut;
|
|
7
|
+
|
|
8
|
+
var _element = require("@wordpress/element");
|
|
9
|
+
|
|
10
|
+
var _lodash = require("lodash");
|
|
11
|
+
|
|
12
|
+
var _keycodes = require("@wordpress/keycodes");
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* External dependencies
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* WordPress dependencies
|
|
20
|
+
*/
|
|
21
|
+
function KeyCombination(_ref) {
|
|
22
|
+
let {
|
|
23
|
+
keyCombination,
|
|
24
|
+
forceAriaLabel
|
|
25
|
+
} = _ref;
|
|
26
|
+
const shortcut = keyCombination.modifier ? _keycodes.displayShortcutList[keyCombination.modifier](keyCombination.character) : keyCombination.character;
|
|
27
|
+
const ariaLabel = keyCombination.modifier ? _keycodes.shortcutAriaLabel[keyCombination.modifier](keyCombination.character) : keyCombination.character;
|
|
28
|
+
return (0, _element.createElement)("kbd", {
|
|
29
|
+
className: "edit-site-keyboard-shortcut-help-modal__shortcut-key-combination",
|
|
30
|
+
"aria-label": forceAriaLabel || ariaLabel
|
|
31
|
+
}, (0, _lodash.castArray)(shortcut).map((character, index) => {
|
|
32
|
+
if (character === '+') {
|
|
33
|
+
return (0, _element.createElement)(_element.Fragment, {
|
|
34
|
+
key: index
|
|
35
|
+
}, character);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return (0, _element.createElement)("kbd", {
|
|
39
|
+
key: index,
|
|
40
|
+
className: "edit-site-keyboard-shortcut-help-modal__shortcut-key"
|
|
41
|
+
}, character);
|
|
42
|
+
}));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function Shortcut(_ref2) {
|
|
46
|
+
let {
|
|
47
|
+
description,
|
|
48
|
+
keyCombination,
|
|
49
|
+
aliases = [],
|
|
50
|
+
ariaLabel
|
|
51
|
+
} = _ref2;
|
|
52
|
+
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)("div", {
|
|
53
|
+
className: "edit-site-keyboard-shortcut-help-modal__shortcut-description"
|
|
54
|
+
}, description), (0, _element.createElement)("div", {
|
|
55
|
+
className: "edit-site-keyboard-shortcut-help-modal__shortcut-term"
|
|
56
|
+
}, (0, _element.createElement)(KeyCombination, {
|
|
57
|
+
keyCombination: keyCombination,
|
|
58
|
+
forceAriaLabel: ariaLabel
|
|
59
|
+
}), aliases.map((alias, index) => (0, _element.createElement)(KeyCombination, {
|
|
60
|
+
keyCombination: alias,
|
|
61
|
+
forceAriaLabel: ariaLabel,
|
|
62
|
+
key: index
|
|
63
|
+
}))));
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=shortcut.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/keyboard-shortcut-help-modal/shortcut.js"],"names":["KeyCombination","keyCombination","forceAriaLabel","shortcut","modifier","displayShortcutList","character","ariaLabel","shortcutAriaLabel","map","index","Shortcut","description","aliases","alias"],"mappings":";;;;;;;AAQA;;AALA;;AAMA;;AATA;AACA;AACA;;AAGA;AACA;AACA;AAIA,SAASA,cAAT,OAA8D;AAAA,MAArC;AAAEC,IAAAA,cAAF;AAAkBC,IAAAA;AAAlB,GAAqC;AAC7D,QAAMC,QAAQ,GAAGF,cAAc,CAACG,QAAf,GACdC,8BAAqBJ,cAAc,CAACG,QAApC,EACAH,cAAc,CAACK,SADf,CADc,GAIdL,cAAc,CAACK,SAJlB;AAKA,QAAMC,SAAS,GAAGN,cAAc,CAACG,QAAf,GACfI,4BAAmBP,cAAc,CAACG,QAAlC,EACAH,cAAc,CAACK,SADf,CADe,GAIfL,cAAc,CAACK,SAJlB;AAMA,SACC;AACC,IAAA,SAAS,EAAC,kEADX;AAEC,kBAAaJ,cAAc,IAAIK;AAFhC,KAIG,uBAAWJ,QAAX,EAAsBM,GAAtB,CAA2B,CAAEH,SAAF,EAAaI,KAAb,KAAwB;AACpD,QAAKJ,SAAS,KAAK,GAAnB,EAAyB;AACxB,aAAO,4BAAC,iBAAD;AAAU,QAAA,GAAG,EAAGI;AAAhB,SAA0BJ,SAA1B,CAAP;AACA;;AAED,WACC;AACC,MAAA,GAAG,EAAGI,KADP;AAEC,MAAA,SAAS,EAAC;AAFX,OAIGJ,SAJH,CADD;AAQA,GAbC,CAJH,CADD;AAqBA;;AAEc,SAASK,QAAT,QAKX;AAAA,MAL8B;AACjCC,IAAAA,WADiC;AAEjCX,IAAAA,cAFiC;AAGjCY,IAAAA,OAAO,GAAG,EAHuB;AAIjCN,IAAAA;AAJiC,GAK9B;AACH,SACC,qDACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGK,WADH,CADD,EAIC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,cAAD;AACC,IAAA,cAAc,EAAGX,cADlB;AAEC,IAAA,cAAc,EAAGM;AAFlB,IADD,EAKGM,OAAO,CAACJ,GAAR,CAAa,CAAEK,KAAF,EAASJ,KAAT,KACd,4BAAC,cAAD;AACC,IAAA,cAAc,EAAGI,KADlB;AAEC,IAAA,cAAc,EAAGP,SAFlB;AAGC,IAAA,GAAG,EAAGG;AAHP,IADC,CALH,CAJD,CADD;AAoBA","sourcesContent":["/**\n * External dependencies\n */\nimport { castArray } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { Fragment } from '@wordpress/element';\nimport { displayShortcutList, shortcutAriaLabel } from '@wordpress/keycodes';\n\nfunction KeyCombination( { keyCombination, forceAriaLabel } ) {\n\tconst shortcut = keyCombination.modifier\n\t\t? displayShortcutList[ keyCombination.modifier ](\n\t\t\t\tkeyCombination.character\n\t\t )\n\t\t: keyCombination.character;\n\tconst ariaLabel = keyCombination.modifier\n\t\t? shortcutAriaLabel[ keyCombination.modifier ](\n\t\t\t\tkeyCombination.character\n\t\t )\n\t\t: keyCombination.character;\n\n\treturn (\n\t\t<kbd\n\t\t\tclassName=\"edit-site-keyboard-shortcut-help-modal__shortcut-key-combination\"\n\t\t\taria-label={ forceAriaLabel || ariaLabel }\n\t\t>\n\t\t\t{ castArray( shortcut ).map( ( character, index ) => {\n\t\t\t\tif ( character === '+' ) {\n\t\t\t\t\treturn <Fragment key={ index }>{ character }</Fragment>;\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\t<kbd\n\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\tclassName=\"edit-site-keyboard-shortcut-help-modal__shortcut-key\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ character }\n\t\t\t\t\t</kbd>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</kbd>\n\t);\n}\n\nexport default function Shortcut( {\n\tdescription,\n\tkeyCombination,\n\taliases = [],\n\tariaLabel,\n} ) {\n\treturn (\n\t\t<>\n\t\t\t<div className=\"edit-site-keyboard-shortcut-help-modal__shortcut-description\">\n\t\t\t\t{ description }\n\t\t\t</div>\n\t\t\t<div className=\"edit-site-keyboard-shortcut-help-modal__shortcut-term\">\n\t\t\t\t<KeyCombination\n\t\t\t\t\tkeyCombination={ keyCombination }\n\t\t\t\t\tforceAriaLabel={ ariaLabel }\n\t\t\t\t/>\n\t\t\t\t{ aliases.map( ( alias, index ) => (\n\t\t\t\t\t<KeyCombination\n\t\t\t\t\t\tkeyCombination={ alias }\n\t\t\t\t\t\tforceAriaLabel={ ariaLabel }\n\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"]}
|
|
@@ -38,6 +38,9 @@ function KeyboardShortcuts(_ref) {
|
|
|
38
38
|
__experimentalGetDirtyEntityRecords,
|
|
39
39
|
isSavingEntityRecord
|
|
40
40
|
} = (0, _data.useSelect)(_coreData.store);
|
|
41
|
+
const {
|
|
42
|
+
getEditorMode
|
|
43
|
+
} = (0, _data.useSelect)(_store.store);
|
|
41
44
|
const isListViewOpen = (0, _data.useSelect)(select => select(_store.store).isListViewOpened(), []);
|
|
42
45
|
const isBlockInspectorOpen = (0, _data.useSelect)(select => select(_interface.store).getActiveComplementaryArea(_store.store.name) === _constants.SIDEBAR_BLOCK, []);
|
|
43
46
|
const {
|
|
@@ -45,7 +48,8 @@ function KeyboardShortcuts(_ref) {
|
|
|
45
48
|
undo
|
|
46
49
|
} = (0, _data.useDispatch)(_coreData.store);
|
|
47
50
|
const {
|
|
48
|
-
setIsListViewOpened
|
|
51
|
+
setIsListViewOpened,
|
|
52
|
+
switchEditorMode
|
|
49
53
|
} = (0, _data.useDispatch)(_store.store);
|
|
50
54
|
const {
|
|
51
55
|
enableComplementaryArea,
|
|
@@ -85,6 +89,9 @@ function KeyboardShortcuts(_ref) {
|
|
|
85
89
|
enableComplementaryArea(_constants2.STORE_NAME, _constants.SIDEBAR_BLOCK);
|
|
86
90
|
}
|
|
87
91
|
});
|
|
92
|
+
(0, _keyboardShortcuts.useShortcut)('core/edit-site/toggle-mode', () => {
|
|
93
|
+
switchEditorMode(getEditorMode() === 'visual' ? 'text' : 'visual');
|
|
94
|
+
});
|
|
88
95
|
return null;
|
|
89
96
|
}
|
|
90
97
|
|
|
@@ -139,6 +146,15 @@ function KeyboardShortcutsRegister() {
|
|
|
139
146
|
character: ','
|
|
140
147
|
}
|
|
141
148
|
});
|
|
149
|
+
registerShortcut({
|
|
150
|
+
name: 'core/edit-site/keyboard-shortcuts',
|
|
151
|
+
category: 'main',
|
|
152
|
+
description: (0, _i18n.__)('Display these keyboard shortcuts.'),
|
|
153
|
+
keyCombination: {
|
|
154
|
+
modifier: 'access',
|
|
155
|
+
character: 'h'
|
|
156
|
+
}
|
|
157
|
+
});
|
|
142
158
|
registerShortcut({
|
|
143
159
|
name: 'core/edit-site/next-region',
|
|
144
160
|
category: 'global',
|
|
@@ -165,6 +181,15 @@ function KeyboardShortcutsRegister() {
|
|
|
165
181
|
character: 'p'
|
|
166
182
|
}]
|
|
167
183
|
});
|
|
184
|
+
registerShortcut({
|
|
185
|
+
name: 'core/edit-site/toggle-mode',
|
|
186
|
+
category: 'global',
|
|
187
|
+
description: (0, _i18n.__)('Switch between visual editor and code editor.'),
|
|
188
|
+
keyCombination: {
|
|
189
|
+
modifier: 'secondary',
|
|
190
|
+
character: 'm'
|
|
191
|
+
}
|
|
192
|
+
});
|
|
168
193
|
}, [registerShortcut]);
|
|
169
194
|
return null;
|
|
170
195
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/keyboard-shortcuts/index.js"],"names":["KeyboardShortcuts","openEntitiesSavedStates","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","coreStore","isListViewOpen","select","editSiteStore","isListViewOpened","isBlockInspectorOpen","interfaceStore","getActiveComplementaryArea","name","SIDEBAR_BLOCK","redo","undo","setIsListViewOpened","enableComplementaryArea","disableComplementaryArea","event","preventDefault","dirtyEntityRecords","isDirty","length","isSaving","some","record","kind","key","STORE_NAME","KeyboardShortcutsRegister","registerShortcut","keyboardShortcutsStore","category","description","keyCombination","modifier","character","aliases","Register"],"mappings":";;;;;;;AAGA;;AACA;;AAIA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAlBA;AACA;AACA;;AAWA;AACA;AACA;AAKA,SAASA,iBAAT,OAA0D;AAAA,MAA9B;AAAEC,IAAAA;AAAF,GAA8B;AACzD,QAAM;AACLC,IAAAA,mCADK;AAELC,IAAAA;AAFK,MAGF,qBAAWC,eAAX,CAHJ;AAIA,QAAMC,cAAc,GAAG,qBACpBC,MAAF,IAAcA,MAAM,CAAEC,YAAF,CAAN,CAAwBC,gBAAxB,EADQ,EAEtB,EAFsB,CAAvB;AAIA,QAAMC,oBAAoB,GAAG,qBAC1BH,MAAF,IACCA,MAAM,CAAEI,gBAAF,CAAN,CAAyBC,0BAAzB,CACCJ,aAAcK,IADf,MAEMC,wBAJqB,EAK5B,EAL4B,CAA7B;AAOA,QAAM;AAAEC,IAAAA,IAAF;AAAQC,IAAAA;AAAR,MAAiB,uBAAaX,eAAb,CAAvB;AACA,QAAM;AAAEY,IAAAA;AAAF,MAA0B,uBAAaT,YAAb,CAAhC;AACA,QAAM;AAAEU,IAAAA,uBAAF;AAA2BC,IAAAA;AAA3B,MAAwD,uBAC7DR,gBAD6D,CAA9D;AAIA,sCAAa,qBAAb,EAAsCS,KAAF,IAAa;AAChDA,IAAAA,KAAK,CAACC,cAAN;;AAEA,UAAMC,kBAAkB,GAAGnB,mCAAmC,EAA9D;;AACA,UAAMoB,OAAO,GAAG,CAAC,CAAED,kBAAkB,CAACE,MAAtC;AACA,UAAMC,QAAQ,GAAGH,kBAAkB,CAACI,IAAnB,CAA2BC,MAAF,IACzCvB,oBAAoB,CAAEuB,MAAM,CAACC,IAAT,EAAeD,MAAM,CAACd,IAAtB,EAA4Bc,MAAM,C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gBAN,IAAAA,gBAAgB,CAAE;AACjBnB,MAAAA,IAAI,EAAE,gCADW;AAEjBqB,MAAAA,QAAQ,EAAE,QAFO;AAGjBC,MAAAA,WAAW,EAAE,cAAI,8CAAJ,CAHI;AAIjBC,MAAAA,cAAc,EAAE;AACfC,QAAAA,QAAQ,EAAE,WADK;AAEfC,QAAAA,SAAS,EAAE;AAFI,OAJC;AAQjBC,MAAAA,OAAO,EAAE,CACR;AACCF,QAAAA,QAAQ,EAAE,QADX;AAECC,QAAAA,SAAS,EAAE;AAFZ,OADQ;AARQ,KAAF,CAAhB;AAeA,GAlFD,EAkFG,CAAEN,gBAAF,CAlFH;AAoFA,SAAO,IAAP;AACA;;AAED/B,iBAAiB,CAACuC,QAAlB,GAA6BT,yBAA7B;eACe9B,iB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { SIDEBAR_BLOCK } from '../sidebar/constants';\nimport { STORE_NAME } from '../../store/constants';\n\nfunction KeyboardShortcuts( { openEntitiesSavedStates } ) {\n\tconst {\n\t\t__experimentalGetDirtyEntityRecords,\n\t\tisSavingEntityRecord,\n\t} = useSelect( coreStore );\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 { setIsListViewOpened } = useDispatch( editSiteStore );\n\tconst { enableComplementaryArea, disableComplementaryArea } = useDispatch(\n\t\tinterfaceStore\n\t);\n\n\tuseShortcut( 'core/edit-site/save', ( event ) => {\n\t\tevent.preventDefault();\n\n\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\tconst isDirty = !! dirtyEntityRecords.length;\n\t\tconst isSaving = dirtyEntityRecords.some( ( record ) =>\n\t\t\tisSavingEntityRecord( record.kind, record.name, record.key )\n\t\t);\n\n\t\tif ( ! isSaving && isDirty ) {\n\t\t\topenEntitiesSavedStates();\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\tuseShortcut( 'core/edit-site/toggle-list-view', () => {\n\t\tsetIsListViewOpened( ! isListViewOpen );\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\treturn null;\n}\n\nfunction KeyboardShortcutsRegister() {\n\t// Registering the shortcuts\n\tconst { registerShortcut } = useDispatch( keyboardShortcutsStore );\n\tuseEffect( () => {\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-site/save',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Save your changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 's',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-site/undo',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Undo your last changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 'z',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-site/redo',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Redo your last undo.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primaryShift',\n\t\t\t\tcharacter: 'z',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-site/toggle-list-view',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Open the block list view.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'access',\n\t\t\t\tcharacter: 'o',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-site/toggle-block-settings-sidebar',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Show or hide the block settings sidebar.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primaryShift',\n\t\t\t\tcharacter: ',',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-site/next-region',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Navigate to the next part of the editor.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'ctrl',\n\t\t\t\tcharacter: '`',\n\t\t\t},\n\t\t\taliases: [\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: 'n',\n\t\t\t\t},\n\t\t\t],\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-site/previous-region',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Navigate to the previous part of the editor.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'ctrlShift',\n\t\t\t\tcharacter: '`',\n\t\t\t},\n\t\t\taliases: [\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: 'p',\n\t\t\t\t},\n\t\t\t],\n\t\t} );\n\t}, [ registerShortcut ] );\n\n\treturn null;\n}\n\nKeyboardShortcuts.Register = KeyboardShortcutsRegister;\nexport default KeyboardShortcuts;\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/keyboard-shortcuts/index.js"],"names":["KeyboardShortcuts","openEntitiesSavedStates","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","coreStore","getEditorMode","editSiteStore","isListViewOpen","select","isListViewOpened","isBlockInspectorOpen","interfaceStore","getActiveComplementaryArea","name","SIDEBAR_BLOCK","redo","undo","setIsListViewOpened","switchEditorMode","enableComplementaryArea","disableComplementaryArea","event","preventDefault","dirtyEntityRecords","isDirty","length","isSaving","some","record","kind","key","STORE_NAME","KeyboardShortcutsRegister","registerShortcut","keyboardShortcutsStore","category","description","keyCombination","modifier","character","aliases","Register"],"mappings":";;;;;;;AAGA;;AACA;;AAIA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AAlBA;AACA;AACA;;AAWA;AACA;AACA;AAKA,SAASA,iBAAT,OAA0D;AAAA,MAA9B;AAAEC,IAAAA;AAAF,GAA8B;AACzD,QAAM;AACLC,IAAAA,mCADK;AAELC,IAAAA;AAFK,MAGF,qBAAWC,eAAX,CAHJ;AAIA,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,uBAAaZ,eAAb,CAAvB;AACA,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ARQ,KAAF,CAAhB;AAeAN,IAAAA,gBAAgB,CAAE;AACjBpB,MAAAA,IAAI,EAAE,4BADW;AAEjBsB,MAAAA,QAAQ,EAAE,QAFO;AAGjBC,MAAAA,WAAW,EAAE,cAAI,+CAAJ,CAHI;AAIjBC,MAAAA,cAAc,EAAE;AACfC,QAAAA,QAAQ,EAAE,WADK;AAEfC,QAAAA,SAAS,EAAE;AAFI;AAJC,KAAF,CAAhB;AASA,GArGD,EAqGG,CAAEN,gBAAF,CArGH;AAuGA,SAAO,IAAP;AACA;;AAEDjC,iBAAiB,CAACyC,QAAlB,GAA6BT,yBAA7B;eACehC,iB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { SIDEBAR_BLOCK } from '../sidebar/constants';\nimport { STORE_NAME } from '../../store/constants';\n\nfunction KeyboardShortcuts( { openEntitiesSavedStates } ) {\n\tconst {\n\t\t__experimentalGetDirtyEntityRecords,\n\t\tisSavingEntityRecord,\n\t} = useSelect( coreStore );\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 { setIsListViewOpened, switchEditorMode } = useDispatch(\n\t\teditSiteStore\n\t);\n\tconst { enableComplementaryArea, disableComplementaryArea } = useDispatch(\n\t\tinterfaceStore\n\t);\n\n\tuseShortcut( 'core/edit-site/save', ( event ) => {\n\t\tevent.preventDefault();\n\n\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\tconst isDirty = !! dirtyEntityRecords.length;\n\t\tconst isSaving = dirtyEntityRecords.some( ( record ) =>\n\t\t\tisSavingEntityRecord( record.kind, record.name, record.key )\n\t\t);\n\n\t\tif ( ! isSaving && isDirty ) {\n\t\t\topenEntitiesSavedStates();\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\tuseShortcut( 'core/edit-site/toggle-list-view', () => {\n\t\tsetIsListViewOpened( ! isListViewOpen );\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\treturn null;\n}\n\nfunction KeyboardShortcutsRegister() {\n\t// Registering the shortcuts\n\tconst { registerShortcut } = useDispatch( keyboardShortcutsStore );\n\tuseEffect( () => {\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-site/save',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Save your changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 's',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-site/undo',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Undo your last changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 'z',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-site/redo',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Redo your last undo.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primaryShift',\n\t\t\t\tcharacter: 'z',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-site/toggle-list-view',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Open the block list view.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'access',\n\t\t\t\tcharacter: 'o',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-site/toggle-block-settings-sidebar',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Show or hide the block settings sidebar.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primaryShift',\n\t\t\t\tcharacter: ',',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-site/keyboard-shortcuts',\n\t\t\tcategory: 'main',\n\t\t\tdescription: __( 'Display these keyboard shortcuts.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'access',\n\t\t\t\tcharacter: 'h',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-site/next-region',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Navigate to the next part of the editor.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'ctrl',\n\t\t\t\tcharacter: '`',\n\t\t\t},\n\t\t\taliases: [\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: 'n',\n\t\t\t\t},\n\t\t\t],\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-site/previous-region',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Navigate to the previous part of the editor.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'ctrlShift',\n\t\t\t\tcharacter: '`',\n\t\t\t},\n\t\t\taliases: [\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: 'p',\n\t\t\t\t},\n\t\t\t],\n\t\t} );\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-site/toggle-mode',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Switch between visual editor and code editor.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'secondary',\n\t\t\t\tcharacter: 'm',\n\t\t\t},\n\t\t} );\n\t}, [ registerShortcut ] );\n\n\treturn null;\n}\n\nKeyboardShortcuts.Register = KeyboardShortcutsRegister;\nexport default KeyboardShortcuts;\n"]}
|
|
@@ -64,11 +64,11 @@ function Actions(_ref) {
|
|
|
64
64
|
allowUndo: false
|
|
65
65
|
});
|
|
66
66
|
await saveEditedEntityRecord('postType', template.type, template.id);
|
|
67
|
-
createSuccessNotice((0, _i18n.__)('
|
|
67
|
+
createSuccessNotice((0, _i18n.__)('Entity reverted.'), {
|
|
68
68
|
type: 'snackbar'
|
|
69
69
|
});
|
|
70
70
|
} catch (error) {
|
|
71
|
-
const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : (0, _i18n.__)('An error occurred while reverting the
|
|
71
|
+
const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : (0, _i18n.__)('An error occurred while reverting the entity.');
|
|
72
72
|
createErrorNotice(errorMessage, {
|
|
73
73
|
type: 'snackbar'
|
|
74
74
|
});
|
|
@@ -88,12 +88,13 @@ function Actions(_ref) {
|
|
|
88
88
|
onClose: onClose
|
|
89
89
|
}), (0, _element.createElement)(_components.MenuItem, {
|
|
90
90
|
isDestructive: true,
|
|
91
|
+
isTertiary: true,
|
|
91
92
|
onClick: () => {
|
|
92
93
|
removeTemplate(template);
|
|
93
94
|
onClose();
|
|
94
95
|
}
|
|
95
|
-
}, (0, _i18n.__)('Delete
|
|
96
|
-
info: (0, _i18n.__)('Restore
|
|
96
|
+
}, (0, _i18n.__)('Delete'))), isRevertable && (0, _element.createElement)(_components.MenuItem, {
|
|
97
|
+
info: (0, _i18n.__)('Restore to default state'),
|
|
97
98
|
onClick: () => {
|
|
98
99
|
revertAndSaveTemplate();
|
|
99
100
|
onClose();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/list/actions/index.js"],"names":["Actions","template","removeTemplate","revertTemplate","editSiteStore","saveEditedEntityRecord","coreStore","createSuccessNotice","createErrorNotice","noticesStore","isRemovable","isRevertable","revertAndSaveTemplate","allowUndo","type","id","error","errorMessage","message","code","moreVertical","onClose"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAhBA;AACA;AACA;;AAQA;AACA;AACA;AAMe,SAASA,OAAT,OAAiC;AAAA,MAAf;AAAEC,IAAAA;AAAF,GAAe;AAC/C,QAAM;AAAEC,IAAAA,cAAF;AAAkBC,IAAAA;AAAlB,MAAqC,uBAAaC,YAAb,CAA3C;AACA,QAAM;AAAEC,IAAAA;AAAF,MAA6B,uBAAaC,eAAb,CAAnC;AACA,QAAM;AAAEC,IAAAA,mBAAF;AAAuBC,IAAAA;AAAvB,MAA6C,uBAClDC,cADkD,CAAnD;AAIA,QAAMC,WAAW,GAAG,kCAAqBT,QAArB,CAApB;AACA,QAAMU,YAAY,GAAG,mCAAsBV,QAAtB,CAArB;;AAEA,MAAK,CAAES,WAAF,IAAiB,CAAEC,YAAxB,EAAuC;AACtC,WAAO,IAAP;AACA;;AAED,iBAAeC,qBAAf,GAAuC;AACtC,QAAI;AACH,YAAMT,cAAc,CAAEF,QAAF,EAAY;AAAEY,QAAAA,SAAS,EAAE;AAAb,OAAZ,CAApB;AACA,YAAMR,sBAAsB,CAC3B,UAD2B,EAE3BJ,QAAQ,CAACa,IAFkB,EAG3Bb,QAAQ,CAACc,EAHkB,CAA5B;AAMAR,MAAAA,mBAAmB,CAAE,cAAI,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/list/actions/index.js"],"names":["Actions","template","removeTemplate","revertTemplate","editSiteStore","saveEditedEntityRecord","coreStore","createSuccessNotice","createErrorNotice","noticesStore","isRemovable","isRevertable","revertAndSaveTemplate","allowUndo","type","id","error","errorMessage","message","code","moreVertical","onClose"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAhBA;AACA;AACA;;AAQA;AACA;AACA;AAMe,SAASA,OAAT,OAAiC;AAAA,MAAf;AAAEC,IAAAA;AAAF,GAAe;AAC/C,QAAM;AAAEC,IAAAA,cAAF;AAAkBC,IAAAA;AAAlB,MAAqC,uBAAaC,YAAb,CAA3C;AACA,QAAM;AAAEC,IAAAA;AAAF,MAA6B,uBAAaC,eAAb,CAAnC;AACA,QAAM;AAAEC,IAAAA,mBAAF;AAAuBC,IAAAA;AAAvB,MAA6C,uBAClDC,cADkD,CAAnD;AAIA,QAAMC,WAAW,GAAG,kCAAqBT,QAArB,CAApB;AACA,QAAMU,YAAY,GAAG,mCAAsBV,QAAtB,CAArB;;AAEA,MAAK,CAAES,WAAF,IAAiB,CAAEC,YAAxB,EAAuC;AACtC,WAAO,IAAP;AACA;;AAED,iBAAeC,qBAAf,GAAuC;AACtC,QAAI;AACH,YAAMT,cAAc,CAAEF,QAAF,EAAY;AAAEY,QAAAA,SAAS,EAAE;AAAb,OAAZ,CAApB;AACA,YAAMR,sBAAsB,CAC3B,UAD2B,EAE3BJ,QAAQ,CAACa,IAFkB,EAG3Bb,QAAQ,CAACc,EAHkB,CAA5B;AAMAR,MAAAA,mBAAmB,CAAE,cAAI,kBAAJ,CAAF,EAA4B;AAC9CO,QAAAA,IAAI,EAAE;AADwC,OAA5B,CAAnB;AAGA,KAXD,CAWE,OAAQE,KAAR,EAAgB;AACjB,YAAMC,YAAY,GACjBD,KAAK,CAACE,OAAN,IAAiBF,KAAK,CAACG,IAAN,KAAe,eAAhC,GACGH,KAAK,CAACE,OADT,GAEG,cAAI,+CAAJ,CAHJ;AAKAV,MAAAA,iBAAiB,CAAES,YAAF,EAAgB;AAAEH,QAAAA,IAAI,EAAE;AAAR,OAAhB,CAAjB;AACA;AACD;;AAED,SACC,4BAAC,wBAAD;AACC,IAAA,IAAI,EAAGM,mBADR;AAEC,IAAA,KAAK,EAAG,cAAI,SAAJ,CAFT;AAGC,IAAA,SAAS,EAAC;AAHX,KAKG;AAAA,QAAE;AAAEC,MAAAA;AAAF,KAAF;AAAA,WACD,4BAAC,qBAAD,QACGX,WAAW,IACZ,qDACC,4BAAC,uBAAD;AACC,MAAA,QAAQ,EAAGT,QADZ;AAEC,MAAA,OAAO,EAAGoB;AAFX,MADD,EAKC,4BAAC,oBAAD;AACC,MAAA,aAAa,MADd;AAEC,MAAA,UAAU,MAFX;AAGC,MAAA,OAAO,EAAG,MAAM;AACfnB,QAAAA,cAAc,CAAED,QAAF,CAAd;AACAoB,QAAAA,OAAO;AACP;AANF,OAQG,cAAI,QAAJ,CARH,CALD,CAFF,EAmBGV,YAAY,IACb,4BAAC,oBAAD;AACC,MAAA,IAAI,EAAG,cAAI,0BAAJ,CADR;AAEC,MAAA,OAAO,EAAG,MAAM;AACfC,QAAAA,qBAAqB;AACrBS,QAAAA,OAAO;AACP;AALF,OAOG,cAAI,sBAAJ,CAPH,CApBF,CADC;AAAA,GALH,CADD;AAyCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __ } from '@wordpress/i18n';\nimport { DropdownMenu, MenuGroup, MenuItem } from '@wordpress/components';\nimport { moreVertical } from '@wordpress/icons';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../../store';\nimport isTemplateRemovable from '../../../utils/is-template-removable';\nimport isTemplateRevertable from '../../../utils/is-template-revertable';\nimport RenameMenuItem from './rename-menu-item';\n\nexport default function Actions( { template } ) {\n\tconst { removeTemplate, revertTemplate } = useDispatch( editSiteStore );\n\tconst { saveEditedEntityRecord } = useDispatch( coreStore );\n\tconst { createSuccessNotice, createErrorNotice } = useDispatch(\n\t\tnoticesStore\n\t);\n\n\tconst isRemovable = isTemplateRemovable( template );\n\tconst isRevertable = isTemplateRevertable( template );\n\n\tif ( ! isRemovable && ! isRevertable ) {\n\t\treturn null;\n\t}\n\n\tasync function revertAndSaveTemplate() {\n\t\ttry {\n\t\t\tawait revertTemplate( template, { allowUndo: false } );\n\t\t\tawait saveEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\ttemplate.type,\n\t\t\t\ttemplate.id\n\t\t\t);\n\n\t\t\tcreateSuccessNotice( __( 'Entity reverted.' ), {\n\t\t\t\ttype: 'snackbar',\n\t\t\t} );\n\t\t} catch ( error ) {\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __( 'An error occurred while reverting the entity.' );\n\n\t\t\tcreateErrorNotice( errorMessage, { type: 'snackbar' } );\n\t\t}\n\t}\n\n\treturn (\n\t\t<DropdownMenu\n\t\t\ticon={ moreVertical }\n\t\t\tlabel={ __( 'Actions' ) }\n\t\t\tclassName=\"edit-site-list-table__actions\"\n\t\t>\n\t\t\t{ ( { onClose } ) => (\n\t\t\t\t<MenuGroup>\n\t\t\t\t\t{ isRemovable && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<RenameMenuItem\n\t\t\t\t\t\t\t\ttemplate={ template }\n\t\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tisDestructive\n\t\t\t\t\t\t\t\tisTertiary\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tremoveTemplate( template );\n\t\t\t\t\t\t\t\t\tonClose();\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{ __( 'Delete' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isRevertable && (\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tinfo={ __( 'Restore to default state' ) }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\trevertAndSaveTemplate();\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{ __( 'Clear customizations' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t) }\n\t\t\t\t</MenuGroup>\n\t\t\t) }\n\t\t</DropdownMenu>\n\t);\n}\n"]}
|
|
@@ -62,11 +62,11 @@ function RenameMenuItem(_ref) {
|
|
|
62
62
|
throw lastError;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
createSuccessNotice((0, _i18n.__)('
|
|
65
|
+
createSuccessNotice((0, _i18n.__)('Entity renamed.'), {
|
|
66
66
|
type: 'snackbar'
|
|
67
67
|
});
|
|
68
68
|
} catch (error) {
|
|
69
|
-
const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : (0, _i18n.__)('An error occurred while renaming the
|
|
69
|
+
const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : (0, _i18n.__)('An error occurred while renaming the entity.');
|
|
70
70
|
createErrorNotice(errorMessage, {
|
|
71
71
|
type: 'snackbar'
|
|
72
72
|
});
|
|
@@ -79,7 +79,7 @@ function RenameMenuItem(_ref) {
|
|
|
79
79
|
setTitle(template.title.rendered);
|
|
80
80
|
}
|
|
81
81
|
}, (0, _i18n.__)('Rename')), isModalOpen && (0, _element.createElement)(_components.Modal, {
|
|
82
|
-
title: (0, _i18n.__)('Rename
|
|
82
|
+
title: (0, _i18n.__)('Rename'),
|
|
83
83
|
closeLabel: (0, _i18n.__)('Close'),
|
|
84
84
|
onRequestClose: () => {
|
|
85
85
|
setIsModalOpen(false);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/list/actions/rename-menu-item.js"],"names":["RenameMenuItem","template","onClose","title","setTitle","rendered","isModalOpen","setIsModalOpen","getLastEntitySaveError","coreStore","editEntityRecord","saveEditedEntityRecord","createSuccessNotice","createErrorNotice","noticesStore","is_custom","onTemplateRename","event","preventDefault","type","id","lastError","error","errorMessage","message","code"],"mappings":";;;;;;;AAIA;;AADA;;AAEA;;AACA;;AAQA;;AACA;;AAfA;AACA;AACA;AAee,SAASA,cAAT,OAAiD;AAAA,MAAxB;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,GAAwB;AAC/D,QAAM,CAAEC,KAAF,EAASC,QAAT,IAAsB,uBAAU,MAAMH,QAAQ,CAACE,KAAT,CAAeE,QAA/B,CAA5B;AACA,QAAM,CAAEC,WAAF,EAAeC,cAAf,IAAkC,uBAAU,KAAV,CAAxC;AAEA,QAAM;AAAEC,IAAAA;AAAF,MAA6B,qBAAWC,eAAX,CAAnC;AACA,QAAM;AAAEC,IAAAA,gBAAF;AAAoBC,IAAAA;AAApB,MAA+C,uBACpDF,eADoD,CAArD;AAGA,QAAM;AAAEG,IAAAA,mBAAF;AAAuBC,IAAAA;AAAvB,MAA6C,uBAClDC,cADkD,CAAnD;;AAIA,MAAK,CAAEb,QAAQ,CAACc,SAAhB,EAA4B;AAC3B,WAAO,IAAP;AACA;;AAED,iBAAeC,gBAAf,CAAiCC,KAAjC,EAAyC;AACxCA,IAAAA,KAAK,CAACC,cAAN;;AAEA,QAAI;AACH,YAAMR,gBAAgB,CAAE,UAAF,EAAcT,QAAQ,CAACkB,IAAvB,EAA6BlB,QAAQ,CAACmB,EAAtC,EAA0C;AAC/DjB,QAAAA;AAD+D,OAA1C,CAAtB,CADG,CAKH;;AACAC,MAAAA,QAAQ,CAAE,EAAF,CAAR;AACAG,MAAAA,cAAc,CAAE,KAAF,CAAd;AACAL,MAAAA,OAAO,GARJ,CAUH;;AACA,YAAMS,sBAAsB,CAC3B,UAD2B,EAE3BV,QAAQ,CAACkB,IAFkB,EAG3BlB,QAAQ,CAACmB,EAHkB,CAA5B;AAMA,YAAMC,SAAS,GAAGb,sBAAsB,CACvC,UADuC,EAEvCP,QAAQ,CAACkB,IAF8B,EAGvClB,QAAQ,CAACmB,EAH8B,CAAxC;;AAMA,UAAKC,SAAL,EAAiB;AAChB,cAAMA,SAAN;AACA;;AAEDT,MAAAA,mBAAmB,CAAE,cAAI,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/list/actions/rename-menu-item.js"],"names":["RenameMenuItem","template","onClose","title","setTitle","rendered","isModalOpen","setIsModalOpen","getLastEntitySaveError","coreStore","editEntityRecord","saveEditedEntityRecord","createSuccessNotice","createErrorNotice","noticesStore","is_custom","onTemplateRename","event","preventDefault","type","id","lastError","error","errorMessage","message","code"],"mappings":";;;;;;;AAIA;;AADA;;AAEA;;AACA;;AAQA;;AACA;;AAfA;AACA;AACA;AAee,SAASA,cAAT,OAAiD;AAAA,MAAxB;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,GAAwB;AAC/D,QAAM,CAAEC,KAAF,EAASC,QAAT,IAAsB,uBAAU,MAAMH,QAAQ,CAACE,KAAT,CAAeE,QAA/B,CAA5B;AACA,QAAM,CAAEC,WAAF,EAAeC,cAAf,IAAkC,uBAAU,KAAV,CAAxC;AAEA,QAAM;AAAEC,IAAAA;AAAF,MAA6B,qBAAWC,eAAX,CAAnC;AACA,QAAM;AAAEC,IAAAA,gBAAF;AAAoBC,IAAAA;AAApB,MAA+C,uBACpDF,eADoD,CAArD;AAGA,QAAM;AAA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AF,CAAd;AACAH,MAAAA,QAAQ,CAAEH,QAAQ,CAACE,KAAT,CAAeE,QAAjB,CAAR;AACA;AAJF,KAMG,cAAI,QAAJ,CANH,CADD,EASGC,WAAW,IACZ,4BAAC,iBAAD;AACC,IAAA,KAAK,EAAG,cAAI,QAAJ,CADT;AAEC,IAAA,UAAU,EAAG,cAAI,OAAJ,CAFd;AAGC,IAAA,cAAc,EAAG,MAAM;AACtBC,MAAAA,cAAc,CAAE,KAAF,CAAd;AACA,KALF;AAMC,IAAA,gBAAgB,EAAC;AANlB,KAQC;AAAM,IAAA,QAAQ,EAAGS;AAAjB,KACC,4BAAC,gBAAD;AAAM,IAAA,KAAK,EAAC,YAAZ;AAAyB,IAAA,GAAG,EAAG;AAA/B,KACC,4BAAC,oBAAD,QACC,4BAAC,uBAAD;AACC,IAAA,KAAK,EAAG,cAAI,MAAJ,CADT;AAEC,IAAA,KAAK,EAAGb,KAFT;AAGC,IAAA,QAAQ,EAAGC,QAHZ;AAIC,IAAA,QAAQ;AAJT,IADD,CADD,CADD,EAYC,4BAAC,gBAAD;AACC,IAAA,SAAS,EAAC,sCADX;AAEC,IAAA,OAAO,EAAC,UAFT;AAGC,IAAA,QAAQ,EAAG;AAHZ,KAKC,4BAAC,oBAAD,QACC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAC,UADT;AAEC,IAAA,OAAO,EAAG,MAAM;AACfG,MAAAA,cAAc,CAAE,KAAF,CAAd;AACA;AAJF,KAMG,cAAI,QAAJ,CANH,CADD,CALD,EAeC,4BAAC,oBAAD,QACC,4BAAC,kBAAD;AAAQ,IAAA,OAAO,EAAC,SAAhB;AAA0B,IAAA,IAAI,EAAC;AAA/B,KACG,cAAI,MAAJ,CADH,CADD,CAfD,CAZD,CARD,CAVF,CADD;AAyDA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tButton,\n\tFlex,\n\tFlexItem,\n\tMenuItem,\n\tModal,\n\tTextControl,\n} from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as noticesStore } from '@wordpress/notices';\n\nexport default function RenameMenuItem( { template, onClose } ) {\n\tconst [ title, setTitle ] = useState( () => template.title.rendered );\n\tconst [ isModalOpen, setIsModalOpen ] = useState( false );\n\n\tconst { getLastEntitySaveError } = useSelect( coreStore );\n\tconst { editEntityRecord, saveEditedEntityRecord } = useDispatch(\n\t\tcoreStore\n\t);\n\tconst { createSuccessNotice, createErrorNotice } = useDispatch(\n\t\tnoticesStore\n\t);\n\n\tif ( ! template.is_custom ) {\n\t\treturn null;\n\t}\n\n\tasync function onTemplateRename( event ) {\n\t\tevent.preventDefault();\n\n\t\ttry {\n\t\t\tawait editEntityRecord( 'postType', template.type, template.id, {\n\t\t\t\ttitle,\n\t\t\t} );\n\n\t\t\t// Update state before saving rerenders the list.\n\t\t\tsetTitle( '' );\n\t\t\tsetIsModalOpen( false );\n\t\t\tonClose();\n\n\t\t\t// Persist edited entity.\n\t\t\tawait saveEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\ttemplate.type,\n\t\t\t\ttemplate.id\n\t\t\t);\n\n\t\t\tconst lastError = getLastEntitySaveError(\n\t\t\t\t'postType',\n\t\t\t\ttemplate.type,\n\t\t\t\ttemplate.id\n\t\t\t);\n\n\t\t\tif ( lastError ) {\n\t\t\t\tthrow lastError;\n\t\t\t}\n\n\t\t\tcreateSuccessNotice( __( 'Entity renamed.' ), {\n\t\t\t\ttype: 'snackbar',\n\t\t\t} );\n\t\t} catch ( error ) {\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __( 'An error occurred while renaming the entity.' );\n\n\t\t\tcreateErrorNotice( errorMessage, { type: 'snackbar' } );\n\t\t}\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<MenuItem\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetIsModalOpen( true );\n\t\t\t\t\tsetTitle( template.title.rendered );\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ __( 'Rename' ) }\n\t\t\t</MenuItem>\n\t\t\t{ isModalOpen && (\n\t\t\t\t<Modal\n\t\t\t\t\ttitle={ __( 'Rename' ) }\n\t\t\t\t\tcloseLabel={ __( 'Close' ) }\n\t\t\t\t\tonRequestClose={ () => {\n\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t} }\n\t\t\t\t\toverlayClassName=\"edit-site-list__rename-modal\"\n\t\t\t\t>\n\t\t\t\t\t<form onSubmit={ onTemplateRename }>\n\t\t\t\t\t\t<Flex align=\"flex-start\" gap={ 8 }>\n\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\t\t\t\t\tvalue={ title }\n\t\t\t\t\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t</Flex>\n\n\t\t\t\t\t\t<Flex\n\t\t\t\t\t\t\tclassName=\"edit-site-list__rename-modal-actions\"\n\t\t\t\t\t\t\tjustify=\"flex-end\"\n\t\t\t\t\t\t\texpanded={ false }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tsetIsModalOpen( false );\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{ __( 'Cancel' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t<Button variant=\"primary\" type=\"submit\">\n\t\t\t\t\t\t\t\t\t{ __( 'Save' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t</Flex>\n\t\t\t\t\t</form>\n\t\t\t\t</Modal>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"]}
|