@wordpress/edit-widgets 6.32.0 → 6.32.1-next.ff1cebbba.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/build/blocks/widget-area/block.json +26 -0
- package/build/blocks/widget-area/edit/index.js +94 -87
- package/build/blocks/widget-area/edit/index.js.map +7 -1
- package/build/blocks/widget-area/edit/inner-blocks.js +68 -50
- package/build/blocks/widget-area/edit/inner-blocks.js.map +7 -1
- package/build/blocks/widget-area/edit/use-is-dragging-within.js +34 -40
- package/build/blocks/widget-area/edit/use-is-dragging-within.js.map +7 -1
- package/build/blocks/widget-area/index.js +49 -52
- package/build/blocks/widget-area/index.js.map +7 -1
- package/build/components/error-boundary/index.js +49 -51
- package/build/components/error-boundary/index.js.map +7 -1
- package/build/components/header/document-tools/index.js +104 -74
- package/build/components/header/document-tools/index.js.map +7 -1
- package/build/components/header/index.js +81 -62
- package/build/components/header/index.js.map +7 -1
- package/build/components/header/undo-redo/redo.js +50 -38
- package/build/components/header/undo-redo/redo.js.map +7 -1
- package/build/components/header/undo-redo/undo.js +49 -37
- package/build/components/header/undo-redo/undo.js.map +7 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +74 -71
- package/build/components/keyboard-shortcut-help-modal/config.js.map +7 -1
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +61 -44
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +7 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +154 -103
- package/build/components/keyboard-shortcut-help-modal/index.js.map +7 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +74 -56
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +7 -1
- package/build/components/keyboard-shortcuts/index.js +89 -82
- package/build/components/keyboard-shortcuts/index.js.map +7 -1
- package/build/components/layout/index.js +75 -49
- package/build/components/layout/index.js.map +7 -1
- package/build/components/layout/interface.js +89 -75
- package/build/components/layout/interface.js.map +7 -1
- package/build/components/layout/unsaved-changes-warning.js +35 -42
- package/build/components/layout/unsaved-changes-warning.js.map +7 -1
- package/build/components/more-menu/index.js +189 -108
- package/build/components/more-menu/index.js.map +7 -1
- package/build/components/more-menu/tools-more-menu-group.js +29 -23
- package/build/components/more-menu/tools-more-menu-group.js.map +7 -1
- package/build/components/notices/index.js +62 -48
- package/build/components/notices/index.js.map +7 -1
- package/build/components/save-button/index.js +55 -47
- package/build/components/save-button/index.js.map +7 -1
- package/build/components/secondary-sidebar/index.js +41 -34
- package/build/components/secondary-sidebar/index.js.map +7 -1
- package/build/components/secondary-sidebar/inserter-sidebar.js +55 -46
- package/build/components/secondary-sidebar/inserter-sidebar.js.map +7 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +76 -67
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +7 -1
- package/build/components/sidebar/index.js +149 -138
- package/build/components/sidebar/index.js.map +7 -1
- package/build/components/sidebar/widget-areas.js +73 -57
- package/build/components/sidebar/widget-areas.js.map +7 -1
- package/build/components/welcome-guide/index.js +182 -137
- package/build/components/welcome-guide/index.js.map +7 -1
- package/build/components/widget-areas-block-editor-content/index.js +64 -43
- package/build/components/widget-areas-block-editor-content/index.js.map +7 -1
- package/build/components/widget-areas-block-editor-provider/index.js +115 -92
- package/build/components/widget-areas-block-editor-provider/index.js.map +7 -1
- package/build/constants.js +30 -8
- package/build/constants.js.map +7 -1
- package/build/filters/index.js +3 -5
- package/build/filters/index.js.map +7 -1
- package/build/filters/move-to-widget-area.js +52 -59
- package/build/filters/move-to-widget-area.js.map +7 -1
- package/build/filters/replace-media-upload.js +9 -11
- package/build/filters/replace-media-upload.js.map +7 -1
- package/build/hooks/use-last-selected-widget-area.js +38 -44
- package/build/hooks/use-last-selected-widget-area.js.map +7 -1
- package/build/hooks/use-widget-library-insertion-point.js +60 -55
- package/build/hooks/use-widget-library-insertion-point.js.map +7 -1
- package/build/index.js +86 -93
- package/build/index.js.map +7 -1
- package/build/lock-unlock.js +31 -15
- package/build/lock-unlock.js.map +7 -1
- package/build/store/actions.js +181 -313
- package/build/store/actions.js.map +7 -1
- package/build/store/constants.js +27 -10
- package/build/store/constants.js.map +7 -1
- package/build/store/index.js +51 -51
- package/build/store/index.js.map +7 -1
- package/build/store/private-selectors.js +28 -7
- package/build/store/private-selectors.js.map +7 -1
- package/build/store/reducer.js +65 -118
- package/build/store/reducer.js.map +7 -1
- package/build/store/resolvers.js +64 -63
- package/build/store/resolvers.js.map +7 -1
- package/build/store/selectors.js +194 -231
- package/build/store/selectors.js.map +7 -1
- package/build/store/transformers.js +47 -41
- package/build/store/transformers.js.map +7 -1
- package/build/store/utils.js +47 -70
- package/build/store/utils.js.map +7 -1
- package/build-module/blocks/widget-area/block.json +26 -0
- package/build-module/blocks/widget-area/edit/index.js +63 -75
- package/build-module/blocks/widget-area/edit/index.js.map +7 -1
- package/build-module/blocks/widget-area/edit/inner-blocks.js +38 -41
- package/build-module/blocks/widget-area/edit/inner-blocks.js.map +7 -1
- package/build-module/blocks/widget-area/edit/use-is-dragging-within.js +14 -33
- package/build-module/blocks/widget-area/edit/use-is-dragging-within.js.map +7 -1
- package/build-module/blocks/widget-area/index.js +14 -46
- package/build-module/blocks/widget-area/index.js.map +7 -1
- package/build-module/components/error-boundary/index.js +30 -43
- package/build-module/components/error-boundary/index.js.map +7 -1
- package/build-module/components/header/document-tools/index.js +75 -66
- package/build-module/components/header/document-tools/index.js.map +7 -1
- package/build-module/components/header/index.js +52 -54
- package/build-module/components/header/index.js.map +7 -1
- package/build-module/components/header/undo-redo/redo.js +32 -32
- package/build-module/components/header/undo-redo/redo.js.map +7 -1
- package/build-module/components/header/undo-redo/undo.js +31 -31
- package/build-module/components/header/undo-redo/undo.js.map +7 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js +62 -75
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +7 -1
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +33 -37
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +7 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +130 -97
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +7 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +56 -50
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +7 -1
- package/build-module/components/keyboard-shortcuts/index.js +73 -75
- package/build-module/components/keyboard-shortcuts/index.js.map +7 -1
- package/build-module/components/layout/index.js +46 -41
- package/build-module/components/layout/index.js.map +7 -1
- package/build-module/components/layout/interface.js +63 -66
- package/build-module/components/layout/interface.js.map +7 -1
- package/build-module/components/layout/unsaved-changes-warning.js +17 -37
- package/build-module/components/layout/unsaved-changes-warning.js.map +7 -1
- package/build-module/components/more-menu/index.js +167 -102
- package/build-module/components/more-menu/index.js.map +7 -1
- package/build-module/components/more-menu/tools-more-menu-group.js +11 -17
- package/build-module/components/more-menu/tools-more-menu-group.js.map +7 -1
- package/build-module/components/notices/index.js +43 -42
- package/build-module/components/notices/index.js.map +7 -1
- package/build-module/components/save-button/index.js +37 -41
- package/build-module/components/save-button/index.js.map +7 -1
- package/build-module/components/secondary-sidebar/index.js +14 -27
- package/build-module/components/secondary-sidebar/index.js.map +7 -1
- package/build-module/components/secondary-sidebar/inserter-sidebar.js +26 -38
- package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +7 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +57 -60
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +7 -1
- package/build-module/components/sidebar/index.js +129 -127
- package/build-module/components/sidebar/index.js.map +7 -1
- package/build-module/components/sidebar/widget-areas.js +53 -49
- package/build-module/components/sidebar/widget-areas.js.map +7 -1
- package/build-module/components/welcome-guide/index.js +165 -132
- package/build-module/components/welcome-guide/index.js.map +7 -1
- package/build-module/components/widget-areas-block-editor-content/index.js +43 -36
- package/build-module/components/widget-areas-block-editor-content/index.js.map +7 -1
- package/build-module/components/widget-areas-block-editor-provider/index.js +85 -83
- package/build-module/components/widget-areas-block-editor-provider/index.js.map +7 -1
- package/build-module/constants.js +7 -3
- package/build-module/constants.js.map +7 -1
- package/build-module/filters/index.js +3 -6
- package/build-module/filters/index.js.map +7 -1
- package/build-module/filters/move-to-widget-area.js +52 -57
- package/build-module/filters/move-to-widget-area.js.map +7 -1
- package/build-module/filters/replace-media-upload.js +8 -7
- package/build-module/filters/replace-media-upload.js.map +7 -1
- package/build-module/hooks/use-last-selected-widget-area.js +20 -39
- package/build-module/hooks/use-last-selected-widget-area.js.map +7 -1
- package/build-module/hooks/use-widget-library-insertion-point.js +42 -49
- package/build-module/hooks/use-widget-library-insertion-point.js.map +7 -1
- package/build-module/index.js +60 -72
- package/build-module/index.js.map +7 -1
- package/build-module/lock-unlock.js +8 -7
- package/build-module/lock-unlock.js.map +7 -1
- package/build-module/store/actions.js +153 -293
- package/build-module/store/actions.js.map +7 -1
- package/build-module/store/constants.js +5 -5
- package/build-module/store/constants.js.map +7 -1
- package/build-module/store/index.js +16 -40
- package/build-module/store/index.js.map +7 -1
- package/build-module/store/private-selectors.js +7 -3
- package/build-module/store/private-selectors.js.map +7 -1
- package/build-module/store/reducer.js +42 -111
- package/build-module/store/reducer.js.map +7 -1
- package/build-module/store/resolvers.js +43 -51
- package/build-module/store/resolvers.js.map +7 -1
- package/build-module/store/selectors.js +171 -224
- package/build-module/store/selectors.js.map +7 -1
- package/build-module/store/transformers.js +23 -34
- package/build-module/store/transformers.js.map +7 -1
- package/build-module/store/utils.js +22 -63
- package/build-module/store/utils.js.map +7 -1
- package/build-style/style-rtl.css +216 -88
- package/build-style/style.css +216 -88
- package/package.json +36 -29
- package/src/blocks/widget-area/editor.scss +3 -0
- package/src/components/customizer-edit-widgets-initializer/style.scss +3 -0
- package/src/components/error-boundary/style.scss +2 -0
- package/src/components/header/style.scss +5 -0
- package/src/components/keyboard-shortcut-help-modal/style.scss +2 -0
- package/src/components/layout/style.scss +3 -0
- package/src/components/more-menu/style.scss +2 -0
- package/src/components/notices/style.scss +3 -0
- package/src/components/secondary-sidebar/style.scss +4 -0
- package/src/components/sidebar/style.scss +2 -0
- package/src/components/welcome-guide/style.scss +2 -0
- package/src/components/widget-areas-block-editor-content/style.scss +2 -0
- package/src/style.scss +16 -13
|
@@ -1,61 +1,59 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Internal dependencies
|
|
15
|
-
*/
|
|
16
|
-
import DocumentTools from './document-tools';
|
|
17
|
-
import SaveButton from '../save-button';
|
|
18
|
-
import MoreMenu from '../more-menu';
|
|
19
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { BlockToolbar } from "@wordpress/block-editor";
|
|
3
|
+
import { useSelect } from "@wordpress/data";
|
|
4
|
+
import { useRef } from "@wordpress/element";
|
|
5
|
+
import { __ } from "@wordpress/i18n";
|
|
6
|
+
import { Popover, VisuallyHidden } from "@wordpress/components";
|
|
7
|
+
import { PinnedItems } from "@wordpress/interface";
|
|
8
|
+
import { useViewportMatch } from "@wordpress/compose";
|
|
9
|
+
import { store as preferencesStore } from "@wordpress/preferences";
|
|
10
|
+
import DocumentTools from "./document-tools";
|
|
11
|
+
import SaveButton from "../save-button";
|
|
12
|
+
import MoreMenu from "../more-menu";
|
|
20
13
|
function Header() {
|
|
21
|
-
const isLargeViewport = useViewportMatch(
|
|
14
|
+
const isLargeViewport = useViewportMatch("medium");
|
|
22
15
|
const blockToolbarRef = useRef();
|
|
23
|
-
const {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
16
|
+
const { hasFixedToolbar } = useSelect(
|
|
17
|
+
(select) => ({
|
|
18
|
+
hasFixedToolbar: !!select(preferencesStore).get(
|
|
19
|
+
"core/edit-widgets",
|
|
20
|
+
"fixedToolbar"
|
|
21
|
+
)
|
|
22
|
+
}),
|
|
23
|
+
[]
|
|
24
|
+
);
|
|
25
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("div", { className: "edit-widgets-header", children: [
|
|
26
|
+
/* @__PURE__ */ jsxs("div", { className: "edit-widgets-header__navigable-toolbar-wrapper", children: [
|
|
27
|
+
isLargeViewport && /* @__PURE__ */ jsx("h1", { className: "edit-widgets-header__title", children: __("Widgets") }),
|
|
28
|
+
!isLargeViewport && /* @__PURE__ */ jsx(
|
|
29
|
+
VisuallyHidden,
|
|
30
|
+
{
|
|
37
31
|
as: "h1",
|
|
38
32
|
className: "edit-widgets-header__title",
|
|
39
|
-
children: __(
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
33
|
+
children: __("Widgets")
|
|
34
|
+
}
|
|
35
|
+
),
|
|
36
|
+
/* @__PURE__ */ jsx(DocumentTools, {}),
|
|
37
|
+
hasFixedToolbar && isLargeViewport && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
38
|
+
/* @__PURE__ */ jsx("div", { className: "selected-block-tools-wrapper", children: /* @__PURE__ */ jsx(BlockToolbar, { hideDragHandle: true }) }),
|
|
39
|
+
/* @__PURE__ */ jsx(
|
|
40
|
+
Popover.Slot,
|
|
41
|
+
{
|
|
47
42
|
ref: blockToolbarRef,
|
|
48
43
|
name: "block-toolbar"
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
})
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
})
|
|
57
|
-
})
|
|
58
|
-
});
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
] })
|
|
47
|
+
] }),
|
|
48
|
+
/* @__PURE__ */ jsxs("div", { className: "edit-widgets-header__actions", children: [
|
|
49
|
+
/* @__PURE__ */ jsx(PinnedItems.Slot, { scope: "core/edit-widgets" }),
|
|
50
|
+
/* @__PURE__ */ jsx(SaveButton, {}),
|
|
51
|
+
/* @__PURE__ */ jsx(MoreMenu, {})
|
|
52
|
+
] })
|
|
53
|
+
] }) });
|
|
59
54
|
}
|
|
60
|
-
|
|
61
|
-
|
|
55
|
+
var header_default = Header;
|
|
56
|
+
export {
|
|
57
|
+
header_default as default
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/header/index.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { BlockToolbar } from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { useRef } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Popover, VisuallyHidden } from '@wordpress/components';\nimport { PinnedItems } from '@wordpress/interface';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport DocumentTools from './document-tools';\nimport SaveButton from '../save-button';\nimport MoreMenu from '../more-menu';\n\nfunction Header() {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst blockToolbarRef = useRef();\n\tconst { hasFixedToolbar } = useSelect(\n\t\t( select ) => ( {\n\t\t\thasFixedToolbar: !! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'fixedToolbar'\n\t\t\t),\n\t\t} ),\n\t\t[]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<div className=\"edit-widgets-header\">\n\t\t\t\t<div className=\"edit-widgets-header__navigable-toolbar-wrapper\">\n\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t<h1 className=\"edit-widgets-header__title\">\n\t\t\t\t\t\t\t{ __( 'Widgets' ) }\n\t\t\t\t\t\t</h1>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! isLargeViewport && (\n\t\t\t\t\t\t<VisuallyHidden\n\t\t\t\t\t\t\tas=\"h1\"\n\t\t\t\t\t\t\tclassName=\"edit-widgets-header__title\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Widgets' ) }\n\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t) }\n\t\t\t\t\t<DocumentTools />\n\t\t\t\t\t{ hasFixedToolbar && isLargeViewport && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<div className=\"selected-block-tools-wrapper\">\n\t\t\t\t\t\t\t\t<BlockToolbar hideDragHandle />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<Popover.Slot\n\t\t\t\t\t\t\t\tref={ blockToolbarRef }\n\t\t\t\t\t\t\t\tname=\"block-toolbar\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t\t<div className=\"edit-widgets-header__actions\">\n\t\t\t\t\t<PinnedItems.Slot scope=\"core/edit-widgets\" />\n\t\t\t\t\t<SaveButton />\n\t\t\t\t\t<MoreMenu />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default Header;\n"],
|
|
5
|
+
"mappings": "AAqCM,SAcA,UAdA,KAcA,YAdA;AAlCN,SAAS,oBAAoB;AAC7B,SAAS,iBAAiB;AAC1B,SAAS,cAAc;AACvB,SAAS,UAAU;AACnB,SAAS,SAAS,sBAAsB;AACxC,SAAS,mBAAmB;AAC5B,SAAS,wBAAwB;AACjC,SAAS,SAAS,wBAAwB;AAK1C,OAAO,mBAAmB;AAC1B,OAAO,gBAAgB;AACvB,OAAO,cAAc;AAErB,SAAS,SAAS;AACjB,QAAM,kBAAkB,iBAAkB,QAAS;AACnD,QAAM,kBAAkB,OAAO;AAC/B,QAAM,EAAE,gBAAgB,IAAI;AAAA,IAC3B,CAAE,YAAc;AAAA,MACf,iBAAiB,CAAC,CAAE,OAAQ,gBAAiB,EAAE;AAAA,QAC9C;AAAA,QACA;AAAA,MACD;AAAA,IACD;AAAA,IACA,CAAC;AAAA,EACF;AAEA,SACC,gCACC,+BAAC,SAAI,WAAU,uBACd;AAAA,yBAAC,SAAI,WAAU,kDACZ;AAAA,yBACD,oBAAC,QAAG,WAAU,8BACX,aAAI,SAAU,GACjB;AAAA,MAEC,CAAE,mBACH;AAAA,QAAC;AAAA;AAAA,UACA,IAAG;AAAA,UACH,WAAU;AAAA,UAER,aAAI,SAAU;AAAA;AAAA,MACjB;AAAA,MAED,oBAAC,iBAAc;AAAA,MACb,mBAAmB,mBACpB,iCACC;AAAA,4BAAC,SAAI,WAAU,gCACd,8BAAC,gBAAa,gBAAc,MAAC,GAC9B;AAAA,QACA;AAAA,UAAC,QAAQ;AAAA,UAAR;AAAA,YACA,KAAM;AAAA,YACN,MAAK;AAAA;AAAA,QACN;AAAA,SACD;AAAA,OAEF;AAAA,IACA,qBAAC,SAAI,WAAU,gCACd;AAAA,0BAAC,YAAY,MAAZ,EAAiB,OAAM,qBAAoB;AAAA,MAC5C,oBAAC,cAAW;AAAA,MACZ,oBAAC,YAAS;AAAA,OACX;AAAA,KACD,GACD;AAEF;AAEA,IAAO,iBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { store as coreStore } from '@wordpress/core-data';
|
|
10
|
-
import { forwardRef } from '@wordpress/element';
|
|
11
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { __, isRTL } from "@wordpress/i18n";
|
|
3
|
+
import { Button } from "@wordpress/components";
|
|
4
|
+
import { useSelect, useDispatch } from "@wordpress/data";
|
|
5
|
+
import { redo as redoIcon, undo as undoIcon } from "@wordpress/icons";
|
|
6
|
+
import { displayShortcut, isAppleOS } from "@wordpress/keycodes";
|
|
7
|
+
import { store as coreStore } from "@wordpress/core-data";
|
|
8
|
+
import { forwardRef } from "@wordpress/element";
|
|
12
9
|
function RedoButton(props, ref) {
|
|
13
|
-
const shortcut = isAppleOS() ? displayShortcut.primaryShift(
|
|
14
|
-
const hasRedo = useSelect(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
10
|
+
const shortcut = isAppleOS() ? displayShortcut.primaryShift("z") : displayShortcut.primary("y");
|
|
11
|
+
const hasRedo = useSelect(
|
|
12
|
+
(select) => select(coreStore).hasRedo(),
|
|
13
|
+
[]
|
|
14
|
+
);
|
|
15
|
+
const { redo } = useDispatch(coreStore);
|
|
16
|
+
return /* @__PURE__ */ jsx(
|
|
17
|
+
Button,
|
|
18
|
+
{
|
|
19
|
+
...props,
|
|
20
|
+
ref,
|
|
21
|
+
icon: !isRTL() ? redoIcon : undoIcon,
|
|
22
|
+
label: __("Redo"),
|
|
23
|
+
shortcut,
|
|
24
|
+
"aria-disabled": !hasRedo,
|
|
25
|
+
onClick: hasRedo ? redo : void 0,
|
|
26
|
+
size: "compact"
|
|
27
|
+
}
|
|
28
|
+
);
|
|
32
29
|
}
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
var redo_default = forwardRef(RedoButton);
|
|
31
|
+
export {
|
|
32
|
+
redo_default as default
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=redo.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/components/header/undo-redo/redo.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __, isRTL } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { redo as redoIcon, undo as undoIcon } from '@wordpress/icons';\nimport { displayShortcut, isAppleOS } from '@wordpress/keycodes';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { forwardRef } from '@wordpress/element';\n\nfunction RedoButton( props, ref ) {\n\tconst shortcut = isAppleOS()\n\t\t? displayShortcut.primaryShift( 'z' )\n\t\t: displayShortcut.primary( 'y' );\n\n\tconst hasRedo = useSelect(\n\t\t( select ) => select( coreStore ).hasRedo(),\n\t\t[]\n\t);\n\tconst { redo } = useDispatch( coreStore );\n\treturn (\n\t\t<Button\n\t\t\t{ ...props }\n\t\t\tref={ ref }\n\t\t\ticon={ ! isRTL() ? redoIcon : undoIcon }\n\t\t\tlabel={ __( 'Redo' ) }\n\t\t\tshortcut={ shortcut }\n\t\t\t// If there are no undo levels we don't want to actually disable this\n\t\t\t// button, because it will remove focus for keyboard users.\n\t\t\t// See: https://github.com/WordPress/gutenberg/issues/3486\n\t\t\taria-disabled={ ! hasRedo }\n\t\t\tonClick={ hasRedo ? redo : undefined }\n\t\t\tsize=\"compact\"\n\t\t/>\n\t);\n}\n\nexport default forwardRef( RedoButton );\n"],
|
|
5
|
+
"mappings": "AAsBE;AAnBF,SAAS,IAAI,aAAa;AAC1B,SAAS,cAAc;AACvB,SAAS,WAAW,mBAAmB;AACvC,SAAS,QAAQ,UAAU,QAAQ,gBAAgB;AACnD,SAAS,iBAAiB,iBAAiB;AAC3C,SAAS,SAAS,iBAAiB;AACnC,SAAS,kBAAkB;AAE3B,SAAS,WAAY,OAAO,KAAM;AACjC,QAAM,WAAW,UAAU,IACxB,gBAAgB,aAAc,GAAI,IAClC,gBAAgB,QAAS,GAAI;AAEhC,QAAM,UAAU;AAAA,IACf,CAAE,WAAY,OAAQ,SAAU,EAAE,QAAQ;AAAA,IAC1C,CAAC;AAAA,EACF;AACA,QAAM,EAAE,KAAK,IAAI,YAAa,SAAU;AACxC,SACC;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACL;AAAA,MACA,MAAO,CAAE,MAAM,IAAI,WAAW;AAAA,MAC9B,OAAQ,GAAI,MAAO;AAAA,MACnB;AAAA,MAIA,iBAAgB,CAAE;AAAA,MAClB,SAAU,UAAU,OAAO;AAAA,MAC3B,MAAK;AAAA;AAAA,EACN;AAEF;AAEA,IAAO,eAAQ,WAAY,UAAW;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { store as coreStore } from '@wordpress/core-data';
|
|
10
|
-
import { forwardRef } from '@wordpress/element';
|
|
11
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { __, isRTL } from "@wordpress/i18n";
|
|
3
|
+
import { Button } from "@wordpress/components";
|
|
4
|
+
import { useSelect, useDispatch } from "@wordpress/data";
|
|
5
|
+
import { undo as undoIcon, redo as redoIcon } from "@wordpress/icons";
|
|
6
|
+
import { displayShortcut } from "@wordpress/keycodes";
|
|
7
|
+
import { store as coreStore } from "@wordpress/core-data";
|
|
8
|
+
import { forwardRef } from "@wordpress/element";
|
|
12
9
|
function UndoButton(props, ref) {
|
|
13
|
-
const hasUndo = useSelect(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
10
|
+
const hasUndo = useSelect(
|
|
11
|
+
(select) => select(coreStore).hasUndo(),
|
|
12
|
+
[]
|
|
13
|
+
);
|
|
14
|
+
const { undo } = useDispatch(coreStore);
|
|
15
|
+
return /* @__PURE__ */ jsx(
|
|
16
|
+
Button,
|
|
17
|
+
{
|
|
18
|
+
...props,
|
|
19
|
+
ref,
|
|
20
|
+
icon: !isRTL() ? undoIcon : redoIcon,
|
|
21
|
+
label: __("Undo"),
|
|
22
|
+
shortcut: displayShortcut.primary("z"),
|
|
23
|
+
"aria-disabled": !hasUndo,
|
|
24
|
+
onClick: hasUndo ? undo : void 0,
|
|
25
|
+
size: "compact"
|
|
26
|
+
}
|
|
27
|
+
);
|
|
31
28
|
}
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
var undo_default = forwardRef(UndoButton);
|
|
30
|
+
export {
|
|
31
|
+
undo_default as default
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=undo.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/components/header/undo-redo/undo.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __, isRTL } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { undo as undoIcon, redo as redoIcon } from '@wordpress/icons';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { forwardRef } from '@wordpress/element';\n\nfunction UndoButton( props, ref ) {\n\tconst hasUndo = useSelect(\n\t\t( select ) => select( coreStore ).hasUndo(),\n\t\t[]\n\t);\n\tconst { undo } = useDispatch( coreStore );\n\treturn (\n\t\t<Button\n\t\t\t{ ...props }\n\t\t\tref={ ref }\n\t\t\ticon={ ! isRTL() ? undoIcon : redoIcon }\n\t\t\tlabel={ __( 'Undo' ) }\n\t\t\tshortcut={ displayShortcut.primary( 'z' ) }\n\t\t\t// If there are no undo levels we don't want to actually disable this\n\t\t\t// button, because it will remove focus for keyboard users.\n\t\t\t// See: https://github.com/WordPress/gutenberg/issues/3486\n\t\t\taria-disabled={ ! hasUndo }\n\t\t\tonClick={ hasUndo ? undo : undefined }\n\t\t\tsize=\"compact\"\n\t\t/>\n\t);\n}\n\nexport default forwardRef( UndoButton );\n"],
|
|
5
|
+
"mappings": "AAkBE;AAfF,SAAS,IAAI,aAAa;AAC1B,SAAS,cAAc;AACvB,SAAS,WAAW,mBAAmB;AACvC,SAAS,QAAQ,UAAU,QAAQ,gBAAgB;AACnD,SAAS,uBAAuB;AAChC,SAAS,SAAS,iBAAiB;AACnC,SAAS,kBAAkB;AAE3B,SAAS,WAAY,OAAO,KAAM;AACjC,QAAM,UAAU;AAAA,IACf,CAAE,WAAY,OAAQ,SAAU,EAAE,QAAQ;AAAA,IAC1C,CAAC;AAAA,EACF;AACA,QAAM,EAAE,KAAK,IAAI,YAAa,SAAU;AACxC,SACC;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACL;AAAA,MACA,MAAO,CAAE,MAAM,IAAI,WAAW;AAAA,MAC9B,OAAQ,GAAI,MAAO;AAAA,MACnB,UAAW,gBAAgB,QAAS,GAAI;AAAA,MAIxC,iBAAgB,CAAE;AAAA,MAClB,SAAU,UAAU,OAAO;AAAA,MAC3B,MAAK;AAAA;AAAA,EACN;AAEF;AAEA,IAAO,eAAQ,WAAY,UAAW;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,75 +1,62 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
character:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
character:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
character:
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
character:
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
keyCombination: {
|
|
64
|
-
modifier: 'access',
|
|
65
|
-
character: '1-6'
|
|
66
|
-
},
|
|
67
|
-
description: __('Convert the current paragraph or heading to a heading of level 1 to 6.')
|
|
68
|
-
}, {
|
|
69
|
-
keyCombination: {
|
|
70
|
-
modifier: 'primaryShift',
|
|
71
|
-
character: 'SPACE'
|
|
72
|
-
},
|
|
73
|
-
description: __('Add non breaking space.')
|
|
74
|
-
}];
|
|
75
|
-
//# sourceMappingURL=config.js.map
|
|
1
|
+
import { __ } from "@wordpress/i18n";
|
|
2
|
+
const textFormattingShortcuts = [
|
|
3
|
+
{
|
|
4
|
+
keyCombination: { modifier: "primary", character: "b" },
|
|
5
|
+
description: __("Make the selected text bold.")
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
keyCombination: { modifier: "primary", character: "i" },
|
|
9
|
+
description: __("Make the selected text italic.")
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
keyCombination: { modifier: "primary", character: "k" },
|
|
13
|
+
description: __("Convert the selected text into a link.")
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
keyCombination: { modifier: "primaryShift", character: "k" },
|
|
17
|
+
description: __("Remove a link.")
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
keyCombination: { character: "[[" },
|
|
21
|
+
description: __("Insert a link to a post or page.")
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
keyCombination: { modifier: "primary", character: "u" },
|
|
25
|
+
description: __("Underline the selected text.")
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
keyCombination: { modifier: "access", character: "d" },
|
|
29
|
+
description: __("Strikethrough the selected text.")
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
keyCombination: { modifier: "access", character: "x" },
|
|
33
|
+
description: __("Make the selected text inline code.")
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
keyCombination: {
|
|
37
|
+
modifier: "access",
|
|
38
|
+
character: "0"
|
|
39
|
+
},
|
|
40
|
+
aliases: [
|
|
41
|
+
{
|
|
42
|
+
modifier: "access",
|
|
43
|
+
character: "7"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
description: __("Convert the current heading to a paragraph.")
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
keyCombination: { modifier: "access", character: "1-6" },
|
|
50
|
+
description: __(
|
|
51
|
+
"Convert the current paragraph or heading to a heading of level 1 to 6."
|
|
52
|
+
)
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
keyCombination: { modifier: "primaryShift", character: "SPACE" },
|
|
56
|
+
description: __("Add non breaking space.")
|
|
57
|
+
}
|
|
58
|
+
];
|
|
59
|
+
export {
|
|
60
|
+
textFormattingShortcuts
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/keyboard-shortcut-help-modal/config.js"],
|
|
4
|
+
"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: { character: '[[' },\n\t\tdescription: __( 'Insert a link to a post or page.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primary', character: 'u' },\n\t\tdescription: __( 'Underline the selected text.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'access', character: 'd' },\n\t\tdescription: __( 'Strikethrough the selected text.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'access', character: 'x' },\n\t\tdescription: __( 'Make the selected text inline code.' ),\n\t},\n\t{\n\t\tkeyCombination: {\n\t\t\tmodifier: 'access',\n\t\t\tcharacter: '0',\n\t\t},\n\t\taliases: [\n\t\t\t{\n\t\t\t\tmodifier: 'access',\n\t\t\t\tcharacter: '7',\n\t\t\t},\n\t\t],\n\t\tdescription: __( 'Convert the current heading to a paragraph.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'access', character: '1-6' },\n\t\tdescription: __(\n\t\t\t'Convert the current paragraph or heading to a heading of level 1 to 6.'\n\t\t),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primaryShift', character: 'SPACE' },\n\t\tdescription: __( 'Add non breaking space.' ),\n\t},\n];\n"],
|
|
5
|
+
"mappings": "AAGA,SAAS,UAAU;AAEZ,MAAM,0BAA0B;AAAA,EACtC;AAAA,IACC,gBAAgB,EAAE,UAAU,WAAW,WAAW,IAAI;AAAA,IACtD,aAAa,GAAI,8BAA+B;AAAA,EACjD;AAAA,EACA;AAAA,IACC,gBAAgB,EAAE,UAAU,WAAW,WAAW,IAAI;AAAA,IACtD,aAAa,GAAI,gCAAiC;AAAA,EACnD;AAAA,EACA;AAAA,IACC,gBAAgB,EAAE,UAAU,WAAW,WAAW,IAAI;AAAA,IACtD,aAAa,GAAI,wCAAyC;AAAA,EAC3D;AAAA,EACA;AAAA,IACC,gBAAgB,EAAE,UAAU,gBAAgB,WAAW,IAAI;AAAA,IAC3D,aAAa,GAAI,gBAAiB;AAAA,EACnC;AAAA,EACA;AAAA,IACC,gBAAgB,EAAE,WAAW,KAAK;AAAA,IAClC,aAAa,GAAI,kCAAmC;AAAA,EACrD;AAAA,EACA;AAAA,IACC,gBAAgB,EAAE,UAAU,WAAW,WAAW,IAAI;AAAA,IACtD,aAAa,GAAI,8BAA+B;AAAA,EACjD;AAAA,EACA;AAAA,IACC,gBAAgB,EAAE,UAAU,UAAU,WAAW,IAAI;AAAA,IACrD,aAAa,GAAI,kCAAmC;AAAA,EACrD;AAAA,EACA;AAAA,IACC,gBAAgB,EAAE,UAAU,UAAU,WAAW,IAAI;AAAA,IACrD,aAAa,GAAI,qCAAsC;AAAA,EACxD;AAAA,EACA;AAAA,IACC,gBAAgB;AAAA,MACf,UAAU;AAAA,MACV,WAAW;AAAA,IACZ;AAAA,IACA,SAAS;AAAA,MACR;AAAA,QACC,UAAU;AAAA,QACV,WAAW;AAAA,MACZ;AAAA,IACD;AAAA,IACA,aAAa,GAAI,6CAA8C;AAAA,EAChE;AAAA,EACA;AAAA,IACC,gBAAgB,EAAE,UAAU,UAAU,WAAW,MAAM;AAAA,IACvD,aAAa;AAAA,MACZ;AAAA,IACD;AAAA,EACD;AAAA,EACA;AAAA,IACC,gBAAgB,EAAE,UAAU,gBAAgB,WAAW,QAAQ;AAAA,IAC/D,aAAa,GAAI,yBAA0B;AAAA,EAC5C;AACD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,41 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
getShortcutKeyCombination,
|
|
22
|
-
getShortcutDescription,
|
|
23
|
-
getShortcutAliases
|
|
24
|
-
} = select(keyboardShortcutsStore);
|
|
25
|
-
return {
|
|
26
|
-
keyCombination: getShortcutKeyCombination(name),
|
|
27
|
-
aliases: getShortcutAliases(name),
|
|
28
|
-
description: getShortcutDescription(name)
|
|
29
|
-
};
|
|
30
|
-
}, [name]);
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useSelect } from "@wordpress/data";
|
|
3
|
+
import { store as keyboardShortcutsStore } from "@wordpress/keyboard-shortcuts";
|
|
4
|
+
import Shortcut from "./shortcut";
|
|
5
|
+
function DynamicShortcut({ name }) {
|
|
6
|
+
const { keyCombination, description, aliases } = useSelect(
|
|
7
|
+
(select) => {
|
|
8
|
+
const {
|
|
9
|
+
getShortcutKeyCombination,
|
|
10
|
+
getShortcutDescription,
|
|
11
|
+
getShortcutAliases
|
|
12
|
+
} = select(keyboardShortcutsStore);
|
|
13
|
+
return {
|
|
14
|
+
keyCombination: getShortcutKeyCombination(name),
|
|
15
|
+
aliases: getShortcutAliases(name),
|
|
16
|
+
description: getShortcutDescription(name)
|
|
17
|
+
};
|
|
18
|
+
},
|
|
19
|
+
[name]
|
|
20
|
+
);
|
|
31
21
|
if (!keyCombination) {
|
|
32
22
|
return null;
|
|
33
23
|
}
|
|
34
|
-
return
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
24
|
+
return /* @__PURE__ */ jsx(
|
|
25
|
+
Shortcut,
|
|
26
|
+
{
|
|
27
|
+
keyCombination,
|
|
28
|
+
description,
|
|
29
|
+
aliases
|
|
30
|
+
}
|
|
31
|
+
);
|
|
39
32
|
}
|
|
40
|
-
|
|
41
|
-
|
|
33
|
+
var dynamic_shortcut_default = DynamicShortcut;
|
|
34
|
+
export {
|
|
35
|
+
dynamic_shortcut_default as default
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=dynamic-shortcut.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js"],
|
|
4
|
+
"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\nfunction 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\nexport default DynamicShortcut;\n"],
|
|
5
|
+
"mappings": "AAkCE;AA/BF,SAAS,iBAAiB;AAC1B,SAAS,SAAS,8BAA8B;AAKhD,OAAO,cAAc;AAErB,SAAS,gBAAiB,EAAE,KAAK,GAAI;AACpC,QAAM,EAAE,gBAAgB,aAAa,QAAQ,IAAI;AAAA,IAChD,CAAE,WAAY;AACb,YAAM;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,MACD,IAAI,OAAQ,sBAAuB;AAEnC,aAAO;AAAA,QACN,gBAAgB,0BAA2B,IAAK;AAAA,QAChD,SAAS,mBAAoB,IAAK;AAAA,QAClC,aAAa,uBAAwB,IAAK;AAAA,MAC3C;AAAA,IACD;AAAA,IACA,CAAE,IAAK;AAAA,EACR;AAEA,MAAK,CAAE,gBAAiB;AACvB,WAAO;AAAA,EACR;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,EACD;AAEF;AAEA,IAAO,2BAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|