@wordpress/customize-widgets 4.19.3 → 4.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/block-appender/index.js +2 -1
- package/build/components/block-appender/index.js.map +1 -1
- package/build/components/block-inspector-button/index.js +2 -1
- package/build/components/block-inspector-button/index.js.map +1 -1
- package/build/components/customize-widgets/index.js +6 -5
- package/build/components/customize-widgets/index.js.map +1 -1
- package/build/components/error-boundary/index.js +4 -3
- package/build/components/error-boundary/index.js.map +1 -1
- package/build/components/focus-control/index.js +2 -1
- package/build/components/focus-control/index.js.map +1 -1
- package/build/components/header/index.js +8 -7
- package/build/components/header/index.js.map +1 -1
- package/build/components/inserter/index.js +7 -7
- package/build/components/inserter/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +2 -2
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +15 -15
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +8 -7
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build/components/more-menu/index.js +13 -12
- package/build/components/more-menu/index.js.map +1 -1
- package/build/components/sidebar-block-editor/index.js +11 -10
- package/build/components/sidebar-block-editor/index.js.map +1 -1
- package/build/components/sidebar-block-editor/sidebar-editor-provider.js +2 -2
- package/build/components/sidebar-block-editor/sidebar-editor-provider.js.map +1 -1
- package/build/components/sidebar-controls/index.js +2 -1
- package/build/components/sidebar-controls/index.js.map +1 -1
- package/build/components/welcome-guide/index.js +13 -13
- package/build/components/welcome-guide/index.js.map +1 -1
- package/build/filters/move-to-sidebar.js +3 -3
- package/build/filters/move-to-sidebar.js.map +1 -1
- package/build/filters/wide-widget-display.js +2 -2
- package/build/filters/wide-widget-display.js.map +1 -1
- package/build/index.js +2 -1
- package/build/index.js.map +1 -1
- package/build/store/actions.js +1 -1
- package/build/store/actions.js.map +1 -1
- package/build-module/components/block-appender/index.js +1 -1
- package/build-module/components/block-inspector-button/index.js +1 -1
- package/build-module/components/customize-widgets/index.js +1 -1
- package/build-module/components/error-boundary/index.js +1 -1
- package/build-module/components/focus-control/index.js +1 -1
- package/build-module/components/header/index.js +1 -1
- package/build-module/components/inserter/index.js +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +1 -1
- package/build-module/components/more-menu/index.js +1 -1
- package/build-module/components/sidebar-block-editor/index.js +1 -1
- package/build-module/components/sidebar-block-editor/sidebar-editor-provider.js +1 -1
- package/build-module/components/sidebar-controls/index.js +1 -1
- package/build-module/components/welcome-guide/index.js +1 -1
- package/build-module/filters/move-to-sidebar.js +1 -1
- package/build-module/filters/wide-widget-display.js +1 -1
- package/build-module/index.js +1 -1
- package/build-module/store/actions.js +1 -1
- package/build-module/store/actions.js.map +1 -1
- package/build-style/style-rtl.css +1 -1
- package/build-style/style.css +1 -1
- package/package.json +22 -22
- package/src/store/actions.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = BlockAppender;
|
|
7
|
+
var _react = require("react");
|
|
7
8
|
var _element = require("@wordpress/element");
|
|
8
9
|
var _blockEditor = require("@wordpress/block-editor");
|
|
9
10
|
var _data = require("@wordpress/data");
|
|
@@ -27,7 +28,7 @@ function BlockAppender(props) {
|
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
30
|
}, [isBlocksListEmpty]);
|
|
30
|
-
return (0,
|
|
31
|
+
return (0, _react.createElement)(_blockEditor.ButtonBlockAppender, {
|
|
31
32
|
...props,
|
|
32
33
|
ref: ref
|
|
33
34
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_blockEditor","_data","BlockAppender","props","ref","useRef","isBlocksListEmpty","useSelect","select","blockEditorStore","getBlockCount","useEffect","current","ownerDocument","activeElement","body","focus","createElement","ButtonBlockAppender"],"sources":["@wordpress/customize-widgets/src/components/block-appender/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRef, useEffect } from '@wordpress/element';\nimport {\n\tButtonBlockAppender,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\n\nexport default function BlockAppender( props ) {\n\tconst ref = useRef();\n\tconst isBlocksListEmpty = useSelect(\n\t\t( select ) => select( blockEditorStore ).getBlockCount() === 0\n\t);\n\n\t// Move the focus to the block appender to prevent focus from\n\t// being lost when emptying the widget area.\n\tuseEffect( () => {\n\t\tif ( isBlocksListEmpty && ref.current ) {\n\t\t\tconst { ownerDocument } = ref.current;\n\n\t\t\tif (\n\t\t\t\t! ownerDocument.activeElement ||\n\t\t\t\townerDocument.activeElement === ownerDocument.body\n\t\t\t) {\n\t\t\t\tref.current.focus();\n\t\t\t}\n\t\t}\n\t}, [ isBlocksListEmpty ] );\n\n\treturn <ButtonBlockAppender { ...props } ref={ ref } />;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_element","require","_blockEditor","_data","BlockAppender","props","ref","useRef","isBlocksListEmpty","useSelect","select","blockEditorStore","getBlockCount","useEffect","current","ownerDocument","activeElement","body","focus","_react","createElement","ButtonBlockAppender"],"sources":["@wordpress/customize-widgets/src/components/block-appender/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRef, useEffect } from '@wordpress/element';\nimport {\n\tButtonBlockAppender,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\n\nexport default function BlockAppender( props ) {\n\tconst ref = useRef();\n\tconst isBlocksListEmpty = useSelect(\n\t\t( select ) => select( blockEditorStore ).getBlockCount() === 0\n\t);\n\n\t// Move the focus to the block appender to prevent focus from\n\t// being lost when emptying the widget area.\n\tuseEffect( () => {\n\t\tif ( isBlocksListEmpty && ref.current ) {\n\t\t\tconst { ownerDocument } = ref.current;\n\n\t\t\tif (\n\t\t\t\t! ownerDocument.activeElement ||\n\t\t\t\townerDocument.activeElement === ownerDocument.body\n\t\t\t) {\n\t\t\t\tref.current.focus();\n\t\t\t}\n\t\t}\n\t}, [ isBlocksListEmpty ] );\n\n\treturn <ButtonBlockAppender { ...props } ref={ ref } />;\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAIA,IAAAE,KAAA,GAAAF,OAAA;AARA;AACA;AACA;;AAQe,SAASG,aAAaA,CAAEC,KAAK,EAAG;EAC9C,MAAMC,GAAG,GAAG,IAAAC,eAAM,EAAC,CAAC;EACpB,MAAMC,iBAAiB,GAAG,IAAAC,eAAS,EAChCC,MAAM,IAAMA,MAAM,CAAEC,kBAAiB,CAAC,CAACC,aAAa,CAAC,CAAC,KAAK,CAC9D,CAAC;;EAED;EACA;EACA,IAAAC,kBAAS,EAAE,MAAM;IAChB,IAAKL,iBAAiB,IAAIF,GAAG,CAACQ,OAAO,EAAG;MACvC,MAAM;QAAEC;MAAc,CAAC,GAAGT,GAAG,CAACQ,OAAO;MAErC,IACC,CAAEC,aAAa,CAACC,aAAa,IAC7BD,aAAa,CAACC,aAAa,KAAKD,aAAa,CAACE,IAAI,EACjD;QACDX,GAAG,CAACQ,OAAO,CAACI,KAAK,CAAC,CAAC;MACpB;IACD;EACD,CAAC,EAAE,CAAEV,iBAAiB,CAAG,CAAC;EAE1B,OAAO,IAAAW,MAAA,CAAAC,aAAA,EAAClB,YAAA,CAAAmB,mBAAmB;IAAA,GAAMhB,KAAK;IAAGC,GAAG,EAAGA;EAAK,CAAE,CAAC;AACxD"}
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
var _react = require("react");
|
|
7
8
|
var _element = require("@wordpress/element");
|
|
8
9
|
var _i18n = require("@wordpress/i18n");
|
|
9
10
|
var _components = require("@wordpress/components");
|
|
@@ -20,7 +21,7 @@ function BlockInspectorButton({
|
|
|
20
21
|
}) {
|
|
21
22
|
const selectedBlockClientId = (0, _data.useSelect)(select => select(_blockEditor.store).getSelectedBlockClientId(), []);
|
|
22
23
|
const selectedBlock = (0, _element.useMemo)(() => document.getElementById(`block-${selectedBlockClientId}`), [selectedBlockClientId]);
|
|
23
|
-
return (0,
|
|
24
|
+
return (0, _react.createElement)(_components.MenuItem, {
|
|
24
25
|
onClick: () => {
|
|
25
26
|
// Open the inspector.
|
|
26
27
|
inspector.open({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_i18n","_components","_data","_blockEditor","BlockInspectorButton","inspector","closeMenu","props","selectedBlockClientId","useSelect","select","blockEditorStore","getSelectedBlockClientId","selectedBlock","useMemo","document","getElementById","createElement","MenuItem","onClick","open","returnFocusWhenClose","__","_default","exports","default"],"sources":["@wordpress/customize-widgets/src/components/block-inspector-button/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { MenuItem } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\nfunction BlockInspectorButton( { inspector, closeMenu, ...props } ) {\n\tconst selectedBlockClientId = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSelectedBlockClientId(),\n\t\t[]\n\t);\n\n\tconst selectedBlock = useMemo(\n\t\t() => document.getElementById( `block-${ selectedBlockClientId }` ),\n\t\t[ selectedBlockClientId ]\n\t);\n\n\treturn (\n\t\t<MenuItem\n\t\t\tonClick={ () => {\n\t\t\t\t// Open the inspector.\n\t\t\t\tinspector.open( {\n\t\t\t\t\treturnFocusWhenClose: selectedBlock,\n\t\t\t\t} );\n\t\t\t\t// Then close the dropdown menu.\n\t\t\t\tcloseMenu();\n\t\t\t} }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t{ __( 'Show more settings' ) }\n\t\t</MenuItem>\n\t);\n}\n\nexport default BlockInspectorButton;\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_element","require","_i18n","_components","_data","_blockEditor","BlockInspectorButton","inspector","closeMenu","props","selectedBlockClientId","useSelect","select","blockEditorStore","getSelectedBlockClientId","selectedBlock","useMemo","document","getElementById","_react","createElement","MenuItem","onClick","open","returnFocusWhenClose","__","_default","exports","default"],"sources":["@wordpress/customize-widgets/src/components/block-inspector-button/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { MenuItem } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\nfunction BlockInspectorButton( { inspector, closeMenu, ...props } ) {\n\tconst selectedBlockClientId = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSelectedBlockClientId(),\n\t\t[]\n\t);\n\n\tconst selectedBlock = useMemo(\n\t\t() => document.getElementById( `block-${ selectedBlockClientId }` ),\n\t\t[ selectedBlockClientId ]\n\t);\n\n\treturn (\n\t\t<MenuItem\n\t\t\tonClick={ () => {\n\t\t\t\t// Open the inspector.\n\t\t\t\tinspector.open( {\n\t\t\t\t\treturnFocusWhenClose: selectedBlock,\n\t\t\t\t} );\n\t\t\t\t// Then close the dropdown menu.\n\t\t\t\tcloseMenu();\n\t\t\t} }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t{ __( 'Show more settings' ) }\n\t\t</MenuItem>\n\t);\n}\n\nexport default BlockInspectorButton;\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAPA;AACA;AACA;;AAOA,SAASK,oBAAoBA,CAAE;EAAEC,SAAS;EAAEC,SAAS;EAAE,GAAGC;AAAM,CAAC,EAAG;EACnE,MAAMC,qBAAqB,GAAG,IAAAC,eAAS,EACpCC,MAAM,IAAMA,MAAM,CAAEC,kBAAiB,CAAC,CAACC,wBAAwB,CAAC,CAAC,EACnE,EACD,CAAC;EAED,MAAMC,aAAa,GAAG,IAAAC,gBAAO,EAC5B,MAAMC,QAAQ,CAACC,cAAc,CAAG,SAASR,qBAAuB,EAAE,CAAC,EACnE,CAAEA,qBAAqB,CACxB,CAAC;EAED,OACC,IAAAS,MAAA,CAAAC,aAAA,EAACjB,WAAA,CAAAkB,QAAQ;IACRC,OAAO,EAAGA,CAAA,KAAM;MACf;MACAf,SAAS,CAACgB,IAAI,CAAE;QACfC,oBAAoB,EAAET;MACvB,CAAE,CAAC;MACH;MACAP,SAAS,CAAC,CAAC;IACZ,CAAG;IAAA,GACEC;EAAK,GAER,IAAAgB,QAAE,EAAE,oBAAqB,CAClB,CAAC;AAEb;AAAC,IAAAC,QAAA,GAEcpB,oBAAoB;AAAAqB,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = CustomizeWidgets;
|
|
8
|
+
var _react = require("react");
|
|
8
9
|
var _element = require("@wordpress/element");
|
|
9
10
|
var _components = require("@wordpress/components");
|
|
10
11
|
var _errorBoundary = _interopRequireDefault(require("../error-boundary"));
|
|
@@ -39,7 +40,7 @@ function CustomizeWidgets({
|
|
|
39
40
|
unsubscribers.forEach(unsubscriber => unsubscriber());
|
|
40
41
|
};
|
|
41
42
|
}, [sidebarControls]);
|
|
42
|
-
const activeSidebar = activeSidebarControl && (0, _element.createPortal)((0,
|
|
43
|
+
const activeSidebar = activeSidebarControl && (0, _element.createPortal)((0, _react.createElement)(_errorBoundary.default, null, (0, _react.createElement)(_sidebarBlockEditor.default, {
|
|
43
44
|
key: activeSidebarControl.id,
|
|
44
45
|
blockEditorSettings: blockEditorSettings,
|
|
45
46
|
sidebar: activeSidebarControl.sidebarAdapter,
|
|
@@ -49,14 +50,14 @@ function CustomizeWidgets({
|
|
|
49
50
|
|
|
50
51
|
// We have to portal this to the parent of both the editor and the inspector,
|
|
51
52
|
// so that the popovers will appear above both of them.
|
|
52
|
-
const popover = parentContainer && (0, _element.createPortal)((0,
|
|
53
|
+
const popover = parentContainer && (0, _element.createPortal)((0, _react.createElement)("div", {
|
|
53
54
|
className: "customize-widgets-popover",
|
|
54
55
|
ref: popoverRef
|
|
55
|
-
}, (0,
|
|
56
|
-
return (0,
|
|
56
|
+
}, (0, _react.createElement)(_components.Popover.Slot, null)), parentContainer);
|
|
57
|
+
return (0, _react.createElement)(_components.SlotFillProvider, null, (0, _react.createElement)(_sidebarControls.default, {
|
|
57
58
|
sidebarControls: sidebarControls,
|
|
58
59
|
activeSidebarControl: activeSidebarControl
|
|
59
|
-
}, (0,
|
|
60
|
+
}, (0, _react.createElement)(_focusControl.default, {
|
|
60
61
|
api: api,
|
|
61
62
|
sidebarControls: sidebarControls
|
|
62
63
|
}, activeSidebar, popover)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_components","_errorBoundary","_interopRequireDefault","_sidebarBlockEditor","_focusControl","_sidebarControls","_useClearSelectedBlock","CustomizeWidgets","api","sidebarControls","blockEditorSettings","activeSidebarControl","setActiveSidebarControl","useState","parentContainer","document","getElementById","popoverRef","useRef","useClearSelectedBlock","useEffect","unsubscribers","map","sidebarControl","subscribe","expanded","forEach","unsubscriber","activeSidebar","createPortal","createElement","default","key","id","sidebar","sidebarAdapter","inserter","inspector","container","popover","className","ref","Popover","Slot","SlotFillProvider"],"sources":["@wordpress/customize-widgets/src/components/customize-widgets/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useEffect, useRef, createPortal } from '@wordpress/element';\nimport { SlotFillProvider, Popover } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport ErrorBoundary from '../error-boundary';\nimport SidebarBlockEditor from '../sidebar-block-editor';\nimport FocusControl from '../focus-control';\nimport SidebarControls from '../sidebar-controls';\nimport useClearSelectedBlock from './use-clear-selected-block';\n\nexport default function CustomizeWidgets( {\n\tapi,\n\tsidebarControls,\n\tblockEditorSettings,\n} ) {\n\tconst [ activeSidebarControl, setActiveSidebarControl ] = useState( null );\n\tconst parentContainer = document.getElementById(\n\t\t'customize-theme-controls'\n\t);\n\tconst popoverRef = useRef();\n\n\tuseClearSelectedBlock( activeSidebarControl, popoverRef );\n\n\tuseEffect( () => {\n\t\tconst unsubscribers = sidebarControls.map( ( sidebarControl ) =>\n\t\t\tsidebarControl.subscribe( ( expanded ) => {\n\t\t\t\tif ( expanded ) {\n\t\t\t\t\tsetActiveSidebarControl( sidebarControl );\n\t\t\t\t}\n\t\t\t} )\n\t\t);\n\n\t\treturn () => {\n\t\t\tunsubscribers.forEach( ( unsubscriber ) => unsubscriber() );\n\t\t};\n\t}, [ sidebarControls ] );\n\n\tconst activeSidebar =\n\t\tactiveSidebarControl &&\n\t\tcreatePortal(\n\t\t\t<ErrorBoundary>\n\t\t\t\t<SidebarBlockEditor\n\t\t\t\t\tkey={ activeSidebarControl.id }\n\t\t\t\t\tblockEditorSettings={ blockEditorSettings }\n\t\t\t\t\tsidebar={ activeSidebarControl.sidebarAdapter }\n\t\t\t\t\tinserter={ activeSidebarControl.inserter }\n\t\t\t\t\tinspector={ activeSidebarControl.inspector }\n\t\t\t\t/>\n\t\t\t</ErrorBoundary>,\n\t\t\tactiveSidebarControl.container[ 0 ]\n\t\t);\n\n\t// We have to portal this to the parent of both the editor and the inspector,\n\t// so that the popovers will appear above both of them.\n\tconst popover =\n\t\tparentContainer &&\n\t\tcreatePortal(\n\t\t\t<div className=\"customize-widgets-popover\" ref={ popoverRef }>\n\t\t\t\t<Popover.Slot />\n\t\t\t</div>,\n\t\t\tparentContainer\n\t\t);\n\n\treturn (\n\t\t<SlotFillProvider>\n\t\t\t<SidebarControls\n\t\t\t\tsidebarControls={ sidebarControls }\n\t\t\t\tactiveSidebarControl={ activeSidebarControl }\n\t\t\t>\n\t\t\t\t<FocusControl api={ api } sidebarControls={ sidebarControls }>\n\t\t\t\t\t{ activeSidebar }\n\t\t\t\t\t{ popover }\n\t\t\t\t</FocusControl>\n\t\t\t</SidebarControls>\n\t\t</SlotFillProvider>\n\t);\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_element","require","_components","_errorBoundary","_interopRequireDefault","_sidebarBlockEditor","_focusControl","_sidebarControls","_useClearSelectedBlock","CustomizeWidgets","api","sidebarControls","blockEditorSettings","activeSidebarControl","setActiveSidebarControl","useState","parentContainer","document","getElementById","popoverRef","useRef","useClearSelectedBlock","useEffect","unsubscribers","map","sidebarControl","subscribe","expanded","forEach","unsubscriber","activeSidebar","createPortal","_react","createElement","default","key","id","sidebar","sidebarAdapter","inserter","inspector","container","popover","className","ref","Popover","Slot","SlotFillProvider"],"sources":["@wordpress/customize-widgets/src/components/customize-widgets/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useEffect, useRef, createPortal } from '@wordpress/element';\nimport { SlotFillProvider, Popover } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport ErrorBoundary from '../error-boundary';\nimport SidebarBlockEditor from '../sidebar-block-editor';\nimport FocusControl from '../focus-control';\nimport SidebarControls from '../sidebar-controls';\nimport useClearSelectedBlock from './use-clear-selected-block';\n\nexport default function CustomizeWidgets( {\n\tapi,\n\tsidebarControls,\n\tblockEditorSettings,\n} ) {\n\tconst [ activeSidebarControl, setActiveSidebarControl ] = useState( null );\n\tconst parentContainer = document.getElementById(\n\t\t'customize-theme-controls'\n\t);\n\tconst popoverRef = useRef();\n\n\tuseClearSelectedBlock( activeSidebarControl, popoverRef );\n\n\tuseEffect( () => {\n\t\tconst unsubscribers = sidebarControls.map( ( sidebarControl ) =>\n\t\t\tsidebarControl.subscribe( ( expanded ) => {\n\t\t\t\tif ( expanded ) {\n\t\t\t\t\tsetActiveSidebarControl( sidebarControl );\n\t\t\t\t}\n\t\t\t} )\n\t\t);\n\n\t\treturn () => {\n\t\t\tunsubscribers.forEach( ( unsubscriber ) => unsubscriber() );\n\t\t};\n\t}, [ sidebarControls ] );\n\n\tconst activeSidebar =\n\t\tactiveSidebarControl &&\n\t\tcreatePortal(\n\t\t\t<ErrorBoundary>\n\t\t\t\t<SidebarBlockEditor\n\t\t\t\t\tkey={ activeSidebarControl.id }\n\t\t\t\t\tblockEditorSettings={ blockEditorSettings }\n\t\t\t\t\tsidebar={ activeSidebarControl.sidebarAdapter }\n\t\t\t\t\tinserter={ activeSidebarControl.inserter }\n\t\t\t\t\tinspector={ activeSidebarControl.inspector }\n\t\t\t\t/>\n\t\t\t</ErrorBoundary>,\n\t\t\tactiveSidebarControl.container[ 0 ]\n\t\t);\n\n\t// We have to portal this to the parent of both the editor and the inspector,\n\t// so that the popovers will appear above both of them.\n\tconst popover =\n\t\tparentContainer &&\n\t\tcreatePortal(\n\t\t\t<div className=\"customize-widgets-popover\" ref={ popoverRef }>\n\t\t\t\t<Popover.Slot />\n\t\t\t</div>,\n\t\t\tparentContainer\n\t\t);\n\n\treturn (\n\t\t<SlotFillProvider>\n\t\t\t<SidebarControls\n\t\t\t\tsidebarControls={ sidebarControls }\n\t\t\t\tactiveSidebarControl={ activeSidebarControl }\n\t\t\t>\n\t\t\t\t<FocusControl api={ api } sidebarControls={ sidebarControls }>\n\t\t\t\t\t{ activeSidebar }\n\t\t\t\t\t{ popover }\n\t\t\t\t</FocusControl>\n\t\t\t</SidebarControls>\n\t\t</SlotFillProvider>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD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mBAAqB;IAC3CyB,OAAO,EAAGxB,oBAAoB,CAACyB,cAAgB;IAC/CC,QAAQ,EAAG1B,oBAAoB,CAAC0B,QAAU;IAC1CC,SAAS,EAAG3B,oBAAoB,CAAC2B;EAAW,CAC5C,CACa,CAAC,EAChB3B,oBAAoB,CAAC4B,SAAS,CAAE,CAAC,CAClC,CAAC;;EAEF;EACA;EACA,MAAMC,OAAO,GACZ1B,eAAe,IACf,IAAAe,qBAAY,EACX,IAAAC,MAAA,CAAAC,aAAA;IAAKU,SAAS,EAAC,2BAA2B;IAACC,GAAG,EAAGzB;EAAY,GAC5D,IAAAa,MAAA,CAAAC,aAAA,EAAC/B,WAAA,CAAA2C,OAAO,CAACC,IAAI,MAAE,CACX,CAAC,EACN9B,eACD,CAAC;EAEF,OACC,IAAAgB,MAAA,CAAAC,aAAA,EAAC/B,WAAA,CAAA6C,gBAAgB,QAChB,IAAAf,MAAA,CAAAC,aAAA,EAAC1B,gBAAA,CAAA2B,OAAe;IACfvB,eAAe,EAAGA,eAAiB;IACnCE,oBAAoB,EAAGA;EAAsB,GAE7C,IAAAmB,MAAA,CAAAC,aAAA,EAAC3B,aAAA,CAAA4B,OAAY;IAACxB,GAAG,EAAGA,GAAK;IAACC,eAAe,EAAGA;EAAiB,GAC1DmB,aAAa,EACbY,OACW,CACE,CACA,CAAC;AAErB"}
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
var _react = require("react");
|
|
7
8
|
var _element = require("@wordpress/element");
|
|
8
9
|
var _i18n = require("@wordpress/i18n");
|
|
9
10
|
var _components = require("@wordpress/components");
|
|
@@ -19,7 +20,7 @@ function CopyButton({
|
|
|
19
20
|
children
|
|
20
21
|
}) {
|
|
21
22
|
const ref = (0, _compose.useCopyToClipboard)(text);
|
|
22
|
-
return (0,
|
|
23
|
+
return (0, _react.createElement)(_components.Button, {
|
|
23
24
|
variant: "secondary",
|
|
24
25
|
ref: ref
|
|
25
26
|
}, children);
|
|
@@ -44,9 +45,9 @@ class ErrorBoundary extends _element.Component {
|
|
|
44
45
|
if (!error) {
|
|
45
46
|
return this.props.children;
|
|
46
47
|
}
|
|
47
|
-
return (0,
|
|
48
|
+
return (0, _react.createElement)(_blockEditor.Warning, {
|
|
48
49
|
className: "customize-widgets-error-boundary",
|
|
49
|
-
actions: [(0,
|
|
50
|
+
actions: [(0, _react.createElement)(CopyButton, {
|
|
50
51
|
key: "copy-error",
|
|
51
52
|
text: error.stack
|
|
52
53
|
}, (0, _i18n.__)('Copy Error'))]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_i18n","_components","_blockEditor","_compose","_hooks","CopyButton","text","children","ref","useCopyToClipboard","createElement","Button","variant","ErrorBoundary","Component","constructor","arguments","state","error","componentDidCatch","setState","doAction","render","props","Warning","className","actions","key","stack","__","exports","default"],"sources":["@wordpress/customize-widgets/src/components/error-boundary/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { Warning } from '@wordpress/block-editor';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { doAction } from '@wordpress/hooks';\n\nfunction CopyButton( { text, children } ) {\n\tconst ref = useCopyToClipboard( text );\n\treturn (\n\t\t<Button variant=\"secondary\" ref={ ref }>\n\t\t\t{ children }\n\t\t</Button>\n\t);\n}\n\nexport default class ErrorBoundary extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\t\tthis.state = {\n\t\t\terror: null,\n\t\t};\n\t}\n\n\tcomponentDidCatch( error ) {\n\t\tthis.setState( { error } );\n\n\t\tdoAction( 'editor.ErrorBoundary.errorLogged', error );\n\t}\n\n\trender() {\n\t\tconst { error } = this.state;\n\t\tif ( ! error ) {\n\t\t\treturn this.props.children;\n\t\t}\n\n\t\treturn (\n\t\t\t<Warning\n\t\t\t\tclassName=\"customize-widgets-error-boundary\"\n\t\t\t\tactions={ [\n\t\t\t\t\t<CopyButton key=\"copy-error\" text={ error.stack }>\n\t\t\t\t\t\t{ __( 'Copy Error' ) }\n\t\t\t\t\t</CopyButton>,\n\t\t\t\t] }\n\t\t\t>\n\t\t\t\t{ __( 'The editor has encountered an unexpected error.' ) }\n\t\t\t</Warning>\n\t\t);\n\t}\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_element","require","_i18n","_components","_blockEditor","_compose","_hooks","CopyButton","text","children","ref","useCopyToClipboard","_react","createElement","Button","variant","ErrorBoundary","Component","constructor","arguments","state","error","componentDidCatch","setState","doAction","render","props","Warning","className","actions","key","stack","__","exports","default"],"sources":["@wordpress/customize-widgets/src/components/error-boundary/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { Warning } from '@wordpress/block-editor';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { doAction } from '@wordpress/hooks';\n\nfunction CopyButton( { text, children } ) {\n\tconst ref = useCopyToClipboard( text );\n\treturn (\n\t\t<Button variant=\"secondary\" ref={ ref }>\n\t\t\t{ children }\n\t\t</Button>\n\t);\n}\n\nexport default class ErrorBoundary extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\t\tthis.state = {\n\t\t\terror: null,\n\t\t};\n\t}\n\n\tcomponentDidCatch( error ) {\n\t\tthis.setState( { error } );\n\n\t\tdoAction( 'editor.ErrorBoundary.errorLogged', error );\n\t}\n\n\trender() {\n\t\tconst { error } = this.state;\n\t\tif ( ! error ) {\n\t\t\treturn this.props.children;\n\t\t}\n\n\t\treturn (\n\t\t\t<Warning\n\t\t\t\tclassName=\"customize-widgets-error-boundary\"\n\t\t\t\tactions={ [\n\t\t\t\t\t<CopyButton key=\"copy-error\" text={ error.stack }>\n\t\t\t\t\t\t{ __( 'Copy Error' ) }\n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,EAACN,UAAU;QAACuB,GAAG,EAAC,YAAY;QAACtB,IAAI,EAAGa,KAAK,CAACU;MAAO,GAC9C,IAAAC,QAAE,EAAE,YAAa,CACR,CAAC;IACX,GAED,IAAAA,QAAE,EAAE,iDAAkD,CAChD,CAAC;EAEZ;AACD;AAACC,OAAA,CAAAC,OAAA,GAAAlB,aAAA"}
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = FocusControl;
|
|
7
7
|
exports.useFocusControl = void 0;
|
|
8
|
+
var _react = require("react");
|
|
8
9
|
var _element = require("@wordpress/element");
|
|
9
10
|
var _utils = require("../../utils");
|
|
10
11
|
/**
|
|
@@ -62,7 +63,7 @@ function FocusControl({
|
|
|
62
63
|
};
|
|
63
64
|
}, [api, focusWidget]);
|
|
64
65
|
const context = (0, _element.useMemo)(() => [focusedWidgetIdRef, focusWidget], [focusedWidgetIdRef, focusWidget]);
|
|
65
|
-
return (0,
|
|
66
|
+
return (0, _react.createElement)(FocusControlContext.Provider, {
|
|
66
67
|
value: context
|
|
67
68
|
}, children);
|
|
68
69
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_utils","FocusControlContext","createContext","FocusControl","api","sidebarControls","children","focusedWidgetIdRef","setFocusedWidgetIdRef","useState","current","focusWidget","useCallback","widgetId","sidebarControl","widgets","setting","get","includes","sectionInstance","expand","completeCallback","useEffect","handleFocus","settingId","settingIdToWidgetId","previewBound","handleReady","previewer","preview","bind","unbind","context","useMemo","createElement","Provider","value","useFocusControl","useContext","exports"],"sources":["@wordpress/customize-widgets/src/components/focus-control/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tcreateContext,\n\tuseState,\n\tuseEffect,\n\tuseContext,\n\tuseCallback,\n\tuseMemo,\n} from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { settingIdToWidgetId } from '../../utils';\n\nconst FocusControlContext = createContext();\n\nexport default function FocusControl( { api, sidebarControls, children } ) {\n\tconst [ focusedWidgetIdRef, setFocusedWidgetIdRef ] = useState( {\n\t\tcurrent: null,\n\t} );\n\n\tconst focusWidget = useCallback(\n\t\t( widgetId ) => {\n\t\t\tfor ( const sidebarControl of sidebarControls ) {\n\t\t\t\tconst widgets = sidebarControl.setting.get();\n\n\t\t\t\tif ( widgets.includes( widgetId ) ) {\n\t\t\t\t\tsidebarControl.sectionInstance.expand( {\n\t\t\t\t\t\t// Schedule it after the complete callback so that\n\t\t\t\t\t\t// it won't be overridden by the \"Back\" button focus.\n\t\t\t\t\t\tcompleteCallback() {\n\t\t\t\t\t\t\t// Create a \"ref-like\" object every time to ensure\n\t\t\t\t\t\t\t// the same widget id can also triggers the focus control.\n\t\t\t\t\t\t\tsetFocusedWidgetIdRef( { current: widgetId } );\n\t\t\t\t\t\t},\n\t\t\t\t\t} );\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[ sidebarControls ]\n\t);\n\n\tuseEffect( () => {\n\t\tfunction handleFocus( settingId ) {\n\t\t\tconst widgetId = settingIdToWidgetId( settingId );\n\n\t\t\tfocusWidget( widgetId );\n\t\t}\n\n\t\tlet previewBound = false;\n\n\t\tfunction handleReady() {\n\t\t\tapi.previewer.preview.bind(\n\t\t\t\t'focus-control-for-setting',\n\t\t\t\thandleFocus\n\t\t\t);\n\t\t\tpreviewBound = true;\n\t\t}\n\n\t\tapi.previewer.bind( 'ready', handleReady );\n\n\t\treturn () => {\n\t\t\tapi.previewer.unbind( 'ready', handleReady );\n\t\t\tif ( previewBound ) {\n\t\t\t\tapi.previewer.preview.unbind(\n\t\t\t\t\t'focus-control-for-setting',\n\t\t\t\t\thandleFocus\n\t\t\t\t);\n\t\t\t}\n\t\t};\n\t}, [ api, focusWidget ] );\n\n\tconst context = useMemo(\n\t\t() => [ focusedWidgetIdRef, focusWidget ],\n\t\t[ focusedWidgetIdRef, focusWidget ]\n\t);\n\n\treturn (\n\t\t<FocusControlContext.Provider value={ context }>\n\t\t\t{ children }\n\t\t</FocusControlContext.Provider>\n\t);\n}\n\nexport const useFocusControl = () => useContext( FocusControlContext );\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_element","require","_utils","FocusControlContext","createContext","FocusControl","api","sidebarControls","children","focusedWidgetIdRef","setFocusedWidgetIdRef","useState","current","focusWidget","useCallback","widgetId","sidebarControl","widgets","setting","get","includes","sectionInstance","expand","completeCallback","useEffect","handleFocus","settingId","settingIdToWidgetId","previewBound","handleReady","previewer","preview","bind","unbind","context","useMemo","_react","createElement","Provider","value","useFocusControl","useContext","exports"],"sources":["@wordpress/customize-widgets/src/components/focus-control/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tcreateContext,\n\tuseState,\n\tuseEffect,\n\tuseContext,\n\tuseCallback,\n\tuseMemo,\n} from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { settingIdToWidgetId } from '../../utils';\n\nconst FocusControlContext = createContext();\n\nexport default function FocusControl( { api, sidebarControls, children } ) {\n\tconst [ focusedWidgetIdRef, setFocusedWidgetIdRef ] = useState( {\n\t\tcurrent: null,\n\t} );\n\n\tconst focusWidget = useCallback(\n\t\t( widgetId ) => {\n\t\t\tfor ( const sidebarControl of sidebarControls ) {\n\t\t\t\tconst widgets = sidebarControl.setting.get();\n\n\t\t\t\tif ( widgets.includes( widgetId ) ) {\n\t\t\t\t\tsidebarControl.sectionInstance.expand( {\n\t\t\t\t\t\t// Schedule it after the complete callback so that\n\t\t\t\t\t\t// it won't be overridden by the \"Back\" button focus.\n\t\t\t\t\t\tcompleteCallback() {\n\t\t\t\t\t\t\t// Create a \"ref-like\" object every time to ensure\n\t\t\t\t\t\t\t// the same widget id can also triggers the focus control.\n\t\t\t\t\t\t\tsetFocusedWidgetIdRef( { current: widgetId } );\n\t\t\t\t\t\t},\n\t\t\t\t\t} );\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[ sidebarControls ]\n\t);\n\n\tuseEffect( () => {\n\t\tfunction handleFocus( settingId ) {\n\t\t\tconst widgetId = settingIdToWidgetId( settingId );\n\n\t\t\tfocusWidget( widgetId );\n\t\t}\n\n\t\tlet previewBound = false;\n\n\t\tfunction handleReady() {\n\t\t\tapi.previewer.preview.bind(\n\t\t\t\t'focus-control-for-setting',\n\t\t\t\thandleFocus\n\t\t\t);\n\t\t\tpreviewBound = true;\n\t\t}\n\n\t\tapi.previewer.bind( 'ready', handleReady );\n\n\t\treturn () => {\n\t\t\tapi.previewer.unbind( 'ready', handleReady );\n\t\t\tif ( previewBound ) {\n\t\t\t\tapi.previewer.preview.unbind(\n\t\t\t\t\t'focus-control-for-setting',\n\t\t\t\t\thandleFocus\n\t\t\t\t);\n\t\t\t}\n\t\t};\n\t}, [ api, focusWidget ] );\n\n\tconst context = useMemo(\n\t\t() => [ focusedWidgetIdRef, focusWidget ],\n\t\t[ focusedWidgetIdRef, focusWidget ]\n\t);\n\n\treturn (\n\t\t<FocusControlContext.Provider value={ context }>\n\t\t\t{ children }\n\t\t</FocusControlContext.Provider>\n\t);\n}\n\nexport const useFocusControl = () => useContext( FocusControlContext );\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAYA,IAAAC,MAAA,GAAAD,OAAA;AAfA;AACA;AACA;;AAUA;AACA;AACA;;AAGA,MAAME,mBAAmB,GAAG,IAAAC,sBAAa,EAAC,CAAC;AAE5B,SAASC,YAAYA,CAAE;EAAEC,GAAG;EAAEC,eAAe;EAAEC;AAAS,CAAC,EAAG;EAC1E,MAAM,CAAEC,kBAAkB,EAAEC,qBAAqB,CAAE,GAAG,IAAAC,iBAAQ,EAAE;IAC/DC,OAAO,EAAE;EACV,CAAE,CAAC;EAEH,MAAMC,WAAW,GAAG,IAAAC,oBAAW,EAC5BC,QAAQ,IAAM;IACf,KAAM,MAAMC,cAAc,IAAIT,eAAe,EAAG;MAC/C,MAAMU,OAAO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C,QAAQ;IAACC,KAAK,EAAGL;EAAS,GAC5C1B,QAC2B,CAAC;AAEjC;AAEO,MAAMgC,eAAe,GAAGA,CAAA,KAAM,IAAAC,mBAAU,EAAEtC,mBAAoB,CAAC;AAACuC,OAAA,CAAAF,eAAA,GAAAA,eAAA"}
|
|
@@ -5,8 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var
|
|
8
|
+
var _react = require("react");
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
+
var _element = require("@wordpress/element");
|
|
10
11
|
var _i18n = require("@wordpress/i18n");
|
|
11
12
|
var _components = require("@wordpress/components");
|
|
12
13
|
var _blockEditor = require("@wordpress/block-editor");
|
|
@@ -40,14 +41,14 @@ function Header({
|
|
|
40
41
|
setUndoRedo([sidebar.hasUndo(), sidebar.hasRedo()]);
|
|
41
42
|
});
|
|
42
43
|
}, [sidebar]);
|
|
43
|
-
return (0,
|
|
44
|
+
return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)("div", {
|
|
44
45
|
className: (0, _classnames.default)('customize-widgets-header', {
|
|
45
46
|
'is-fixed-toolbar-active': isFixedToolbarActive
|
|
46
47
|
})
|
|
47
|
-
}, (0,
|
|
48
|
+
}, (0, _react.createElement)(_blockEditor.NavigableToolbar, {
|
|
48
49
|
className: "customize-widgets-header-toolbar",
|
|
49
50
|
"aria-label": (0, _i18n.__)('Document tools')
|
|
50
|
-
}, (0,
|
|
51
|
+
}, (0, _react.createElement)(_components.ToolbarButton, {
|
|
51
52
|
icon: !(0, _i18n.isRTL)() ? _icons.undo : _icons.redo
|
|
52
53
|
/* translators: button label text should, if possible, be under 16 characters. */,
|
|
53
54
|
label: (0, _i18n.__)('Undo'),
|
|
@@ -59,7 +60,7 @@ function Header({
|
|
|
59
60
|
"aria-disabled": !hasUndo,
|
|
60
61
|
onClick: sidebar.undo,
|
|
61
62
|
className: "customize-widgets-editor-history-button undo-button"
|
|
62
|
-
}), (0,
|
|
63
|
+
}), (0, _react.createElement)(_components.ToolbarButton, {
|
|
63
64
|
icon: !(0, _i18n.isRTL)() ? _icons.redo : _icons.undo
|
|
64
65
|
/* translators: button label text should, if possible, be under 16 characters. */,
|
|
65
66
|
label: (0, _i18n.__)('Redo'),
|
|
@@ -71,7 +72,7 @@ function Header({
|
|
|
71
72
|
"aria-disabled": !hasRedo,
|
|
72
73
|
onClick: sidebar.redo,
|
|
73
74
|
className: "customize-widgets-editor-history-button redo-button"
|
|
74
|
-
}), (0,
|
|
75
|
+
}), (0, _react.createElement)(_components.ToolbarButton, {
|
|
75
76
|
className: "customize-widgets-header-toolbar__inserter-toggle",
|
|
76
77
|
isPressed: isInserterOpened,
|
|
77
78
|
variant: "primary",
|
|
@@ -80,7 +81,7 @@ function Header({
|
|
|
80
81
|
onClick: () => {
|
|
81
82
|
setIsInserterOpened(isOpen => !isOpen);
|
|
82
83
|
}
|
|
83
|
-
}), (0,
|
|
84
|
+
}), (0, _react.createElement)(_moreMenu.default, null))), (0, _element.createPortal)((0, _react.createElement)(_inserter.default, {
|
|
84
85
|
setIsOpened: setIsInserterOpened
|
|
85
86
|
}), inserter.contentContainer[0]));
|
|
86
87
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_classnames","_interopRequireDefault","require","_element","_i18n","_components","_blockEditor","_keycodes","_icons","_inserter","_moreMenu","Header","sidebar","inserter","isInserterOpened","setIsInserterOpened","isFixedToolbarActive","hasUndo","hasRedo","setUndoRedo","useState","shortcut","isAppleOS","displayShortcut","primaryShift","primary","useEffect","subscribeHistory","_react","createElement","Fragment","className","classnames","NavigableToolbar","__","ToolbarButton","icon","isRTL","undoIcon","redoIcon","label","onClick","undo","redo","isPressed","variant","plus","_x","isOpen","default","createPortal","setIsOpened","contentContainer","_default","exports"],"sources":["@wordpress/customize-widgets/src/components/header/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { createPortal, useState, useEffect } from '@wordpress/element';\nimport { __, _x, isRTL } from '@wordpress/i18n';\nimport { ToolbarButton } from '@wordpress/components';\nimport { NavigableToolbar } from '@wordpress/block-editor';\nimport { displayShortcut, isAppleOS } from '@wordpress/keycodes';\nimport { plus, undo as undoIcon, redo as redoIcon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport Inserter from '../inserter';\nimport MoreMenu from '../more-menu';\n\nfunction Header( {\n\tsidebar,\n\tinserter,\n\tisInserterOpened,\n\tsetIsInserterOpened,\n\tisFixedToolbarActive,\n} ) {\n\tconst [ [ hasUndo, hasRedo ], setUndoRedo ] = useState( [\n\t\tsidebar.hasUndo(),\n\t\tsidebar.hasRedo(),\n\t] );\n\n\tconst shortcut = isAppleOS()\n\t\t? displayShortcut.primaryShift( 'z' )\n\t\t: displayShortcut.primary( 'y' );\n\n\tuseEffect( () => {\n\t\treturn sidebar.subscribeHistory( () => {\n\t\t\tsetUndoRedo( [ sidebar.hasUndo(), sidebar.hasRedo() ] );\n\t\t} );\n\t}, [ sidebar ] );\n\n\treturn (\n\t\t<>\n\t\t\t<div\n\t\t\t\tclassName={ classnames( 'customize-widgets-header', {\n\t\t\t\t\t'is-fixed-toolbar-active': isFixedToolbarActive,\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t<NavigableToolbar\n\t\t\t\t\tclassName=\"customize-widgets-header-toolbar\"\n\t\t\t\t\taria-label={ __( 'Document tools' ) }\n\t\t\t\t>\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\ticon={ ! isRTL() ? undoIcon : redoIcon }\n\t\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\t\tlabel={ __( 'Undo' ) }\n\t\t\t\t\t\tshortcut={ displayShortcut.primary( 'z' ) }\n\t\t\t\t\t\t// If there are no undo levels we don't want to actually disable this\n\t\t\t\t\t\t// button, because it will remove focus for keyboard users.\n\t\t\t\t\t\t// See: https://github.com/WordPress/gutenberg/issues/3486\n\t\t\t\t\t\taria-disabled={ ! hasUndo }\n\t\t\t\t\t\tonClick={ sidebar.undo }\n\t\t\t\t\t\tclassName=\"customize-widgets-editor-history-button undo-button\"\n\t\t\t\t\t/>\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\ticon={ ! isRTL() ? redoIcon : undoIcon }\n\t\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\t\tlabel={ __( 'Redo' ) }\n\t\t\t\t\t\tshortcut={ shortcut }\n\t\t\t\t\t\t// If there are no undo levels we don't want to actually disable this\n\t\t\t\t\t\t// button, because it will remove focus for keyboard users.\n\t\t\t\t\t\t// See: https://github.com/WordPress/gutenberg/issues/3486\n\t\t\t\t\t\taria-disabled={ ! hasRedo }\n\t\t\t\t\t\tonClick={ sidebar.redo }\n\t\t\t\t\t\tclassName=\"customize-widgets-editor-history-button redo-button\"\n\t\t\t\t\t/>\n\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\tclassName=\"customize-widgets-header-toolbar__inserter-toggle\"\n\t\t\t\t\t\tisPressed={ isInserterOpened }\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\ticon={ plus }\n\t\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t\t'Add block',\n\t\t\t\t\t\t\t'Generic label for block inserter button'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tsetIsInserterOpened( ( isOpen ) => ! isOpen );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t\t<MoreMenu />\n\t\t\t\t</NavigableToolbar>\n\t\t\t</div>\n\n\t\t\t{ createPortal(\n\t\t\t\t<Inserter setIsOpened={ setIsInserterOpened } />,\n\t\t\t\tinserter.contentContainer[ 0 ]\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default Header;\n"],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,IAAApB,MAAA,CAAAC,aAAA,EAACnB,SAAA,CAAAuC,OAAQ,MAAE,CACM,CACd,CAAC,EAEJ,IAAAC,qBAAY,EACb,IAAAtB,MAAA,CAAAC,aAAA,EAACpB,SAAA,CAAAwC,OAAQ;IAACE,WAAW,EAAGpC;EAAqB,CAAE,CAAC,EAChDF,QAAQ,CAACuC,gBAAgB,CAAE,CAAC,CAC7B,CACC,CAAC;AAEL;AAAC,IAAAC,QAAA,GAEc1C,MAAM;AAAA2C,OAAA,CAAAL,OAAA,GAAAI,QAAA"}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _react = require("react");
|
|
8
8
|
var _i18n = require("@wordpress/i18n");
|
|
9
9
|
var _blockEditor = require("@wordpress/block-editor");
|
|
10
10
|
var _components = require("@wordpress/components");
|
|
@@ -25,22 +25,22 @@ function Inserter({
|
|
|
25
25
|
}) {
|
|
26
26
|
const inserterTitleId = (0, _compose.useInstanceId)(Inserter, 'customize-widget-layout__inserter-panel-title');
|
|
27
27
|
const insertionPoint = (0, _data.useSelect)(select => select(_store.store).__experimentalGetInsertionPoint(), []);
|
|
28
|
-
return (0,
|
|
28
|
+
return (0, _react.createElement)("div", {
|
|
29
29
|
className: "customize-widgets-layout__inserter-panel",
|
|
30
30
|
"aria-labelledby": inserterTitleId
|
|
31
|
-
}, (0,
|
|
31
|
+
}, (0, _react.createElement)("div", {
|
|
32
32
|
className: "customize-widgets-layout__inserter-panel-header"
|
|
33
|
-
}, (0,
|
|
33
|
+
}, (0, _react.createElement)("h2", {
|
|
34
34
|
id: inserterTitleId,
|
|
35
35
|
className: "customize-widgets-layout__inserter-panel-header-title"
|
|
36
|
-
}, (0, _i18n.__)('Add a block')), (0,
|
|
36
|
+
}, (0, _i18n.__)('Add a block')), (0, _react.createElement)(_components.Button, {
|
|
37
37
|
className: "customize-widgets-layout__inserter-panel-header-close-button",
|
|
38
38
|
icon: _icons.closeSmall,
|
|
39
39
|
onClick: () => setIsOpened(false),
|
|
40
40
|
"aria-label": (0, _i18n.__)('Close inserter')
|
|
41
|
-
})), (0,
|
|
41
|
+
})), (0, _react.createElement)("div", {
|
|
42
42
|
className: "customize-widgets-layout__inserter-panel-content"
|
|
43
|
-
}, (0,
|
|
43
|
+
}, (0, _react.createElement)(_blockEditor.__experimentalLibrary, {
|
|
44
44
|
rootClientId: insertionPoint.rootClientId,
|
|
45
45
|
__experimentalInsertionIndex: insertionPoint.insertionIndex,
|
|
46
46
|
showInserterHelpPanel: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_blockEditor","_components","_compose","_data","_icons","_store","Inserter","setIsOpened","inserterTitleId","useInstanceId","insertionPoint","useSelect","select","customizeWidgetsStore","__experimentalGetInsertionPoint","
|
|
1
|
+
{"version":3,"names":["_i18n","require","_blockEditor","_components","_compose","_data","_icons","_store","Inserter","setIsOpened","inserterTitleId","useInstanceId","insertionPoint","useSelect","select","customizeWidgetsStore","__experimentalGetInsertionPoint","_react","createElement","className","id","__","Button","icon","closeSmall","onClick","__experimentalLibrary","rootClientId","__experimentalInsertionIndex","insertionIndex","showInserterHelpPanel","onSelect","_default","exports","default"],"sources":["@wordpress/customize-widgets/src/components/inserter/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { __experimentalLibrary as Library } from '@wordpress/block-editor';\nimport { Button } from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport { closeSmall } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { store as customizeWidgetsStore } from '../../store';\n\nfunction Inserter( { setIsOpened } ) {\n\tconst inserterTitleId = useInstanceId(\n\t\tInserter,\n\t\t'customize-widget-layout__inserter-panel-title'\n\t);\n\tconst insertionPoint = useSelect(\n\t\t( select ) =>\n\t\t\tselect( customizeWidgetsStore ).__experimentalGetInsertionPoint(),\n\t\t[]\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tclassName=\"customize-widgets-layout__inserter-panel\"\n\t\t\taria-labelledby={ inserterTitleId }\n\t\t>\n\t\t\t<div className=\"customize-widgets-layout__inserter-panel-header\">\n\t\t\t\t<h2\n\t\t\t\t\tid={ inserterTitleId }\n\t\t\t\t\tclassName=\"customize-widgets-layout__inserter-panel-header-title\"\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Add a block' ) }\n\t\t\t\t</h2>\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"customize-widgets-layout__inserter-panel-header-close-button\"\n\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\tonClick={ () => setIsOpened( false ) }\n\t\t\t\t\taria-label={ __( 'Close inserter' ) }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<div className=\"customize-widgets-layout__inserter-panel-content\">\n\t\t\t\t<Library\n\t\t\t\t\trootClientId={ insertionPoint.rootClientId }\n\t\t\t\t\t__experimentalInsertionIndex={\n\t\t\t\t\t\tinsertionPoint.insertionIndex\n\t\t\t\t\t}\n\t\t\t\t\tshowInserterHelpPanel\n\t\t\t\t\tonSelect={ () => setIsOpened( false ) }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nexport default Inserter;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAKA,IAAAM,MAAA,GAAAN,OAAA;AAbA;AACA;AACA;;AAQA;AACA;AACA;;AAGA,SAASO,QAAQA,CAAE;EAAEC;AAAY,CAAC,EAAG;EACpC,MAAMC,eAAe,GAAG,IAAAC,sBAAa,EACpCH,QAAQ,EACR,+CACD,CAAC;EACD,MAAMI,cAAc,GAAG,IAAAC,eAAS,EAC7BC,MAAM,IACPA,MAAM,CAAEC,YAAsB,CAAC,CAACC,+BAA+B,CAAC,CAAC,EAClE,EACD,CAAC;EAED,OACC,IAAAC,MAAA,CAAAC,aAAA;IACCC,SAAS,EAAC,0CAA0C;IACpD,mBAAkBT;EAAiB,GAEnC,IAAAO,MAAA,CAAAC,aAAA;IAAKC,SAAS,EAAC;EAAiD,GAC/D,IAAAF,MAAA,CAAAC,aAAA;IACCE,EAAE,EAAGV,eAAiB;IACtBS,SAAS,EAAC;EAAuD,GAE/D,IAAAE,QAAE,EAAE,aAAc,CACjB,CAAC,EACL,IAAAJ,MAAA,CAAAC,aAAA,EAACf,WAAA,CAAAmB,MAAM;IACNH,SAAS,EAAC,8DAA8D;IACxEI,IAAI,EAAGC,iBAAY;IACnBC,OAAO,EAAGA,CAAA,KAAMhB,WAAW,CAAE,KAAM,CAAG;IACtC,cAAa,IAAAY,QAAE,EAAE,gBAAiB;EAAG,CACrC,CACG,CAAC,EACN,IAAAJ,MAAA,CAAAC,aAAA;IAAKC,SAAS,EAAC;EAAkD,GAChE,IAAAF,MAAA,CAAAC,aAAA,EAAChB,YAAA,CAAAwB,qBAAO;IACPC,YAAY,EAAGf,cAAc,CAACe,YAAc;IAC5CC,4BAA4B,EAC3BhB,cAAc,CAACiB,cACf;IACDC,qBAAqB;IACrBC,QAAQ,EAAGA,CAAA,KAAMtB,WAAW,CAAE,KAAM;EAAG,CACvC,CACG,CACD,CAAC;AAER;AAAC,IAAAuB,QAAA,GAEcxB,QAAQ;AAAAyB,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var
|
|
8
|
+
var _react = require("react");
|
|
9
9
|
var _data = require("@wordpress/data");
|
|
10
10
|
var _keyboardShortcuts = require("@wordpress/keyboard-shortcuts");
|
|
11
11
|
var _shortcut = _interopRequireDefault(require("./shortcut"));
|
|
@@ -39,7 +39,7 @@ function DynamicShortcut({
|
|
|
39
39
|
if (!keyCombination) {
|
|
40
40
|
return null;
|
|
41
41
|
}
|
|
42
|
-
return (0,
|
|
42
|
+
return (0, _react.createElement)(_shortcut.default, {
|
|
43
43
|
keyCombination: keyCombination,
|
|
44
44
|
description: description,
|
|
45
45
|
aliases: aliases
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_keyboardShortcuts","_shortcut","_interopRequireDefault","DynamicShortcut","name","keyCombination","description","aliases","useSelect","select","getShortcutKeyCombination","getShortcutDescription","getShortcutAliases","keyboardShortcutsStore","
|
|
1
|
+
{"version":3,"names":["_data","require","_keyboardShortcuts","_shortcut","_interopRequireDefault","DynamicShortcut","name","keyCombination","description","aliases","useSelect","select","getShortcutKeyCombination","getShortcutDescription","getShortcutAliases","keyboardShortcutsStore","_react","createElement","default","_default","exports"],"sources":["@wordpress/customize-widgets/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js"],"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"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AAKA,IAAAE,SAAA,GAAAC,sBAAA,CAAAH,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGA,SAASI,eAAeA,CAAE;EAAEC;AAAK,CAAC,EAAG;EACpC,MAAM;IAAEC,cAAc;IAAEC,WAAW;IAAEC;EAAQ,CAAC,GAAG,IAAAC,eAAS,EACvDC,MAAM,IAAM;IACb,MAAM;MACLC,yBAAyB;MACzBC,sBAAsB;MACtBC;IACD,CAAC,GAAGH,MAAM,CAAEI,wBAAuB,CAAC;IAEpC,OAAO;MACNR,cAAc,EAAEK,yBAAyB,CAAEN,IAAK,CAAC;MACjDG,OAAO,EAAEK,kBAAkB,CAAER,IAAK,CAAC;MACnCE,WAAW,EAAEK,sBAAsB,CAAEP,IAAK;IAC3C,CAAC;EACF,CAAC,EACD,CAAEA,IAAI,CACP,CAAC;EAED,IAAK,CAAEC,cAAc,EAAG;IACvB,OAAO,IAAI;EACZ;EAEA,OACC,IAAAS,MAAA,CAAAC,aAAA,EAACd,SAAA,CAAAe,OAAQ;IACRX,cAAc,EAAGA,cAAgB;IACjCC,WAAW,EAAGA,WAAa;IAC3BC,OAAO,EAAGA;EAAS,CACnB,CAAC;AAEJ;AAAC,IAAAU,QAAA,GAEcd,eAAe;AAAAe,OAAA,CAAAF,OAAA,GAAAC,QAAA"}
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = KeyboardShortcutHelpModal;
|
|
8
|
-
var
|
|
8
|
+
var _react = require("react");
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
10
|
var _components = require("@wordpress/components");
|
|
11
11
|
var _i18n = require("@wordpress/i18n");
|
|
@@ -34,15 +34,15 @@ const ShortcutList = ({
|
|
|
34
34
|
* Safari+VoiceOver won't announce the list otherwise.
|
|
35
35
|
*/
|
|
36
36
|
/* eslint-disable jsx-a11y/no-redundant-roles */
|
|
37
|
-
(0,
|
|
37
|
+
(0, _react.createElement)("ul", {
|
|
38
38
|
className: "customize-widgets-keyboard-shortcut-help-modal__shortcut-list",
|
|
39
39
|
role: "list"
|
|
40
|
-
}, shortcuts.map((shortcut, index) => (0,
|
|
40
|
+
}, shortcuts.map((shortcut, index) => (0, _react.createElement)("li", {
|
|
41
41
|
className: "customize-widgets-keyboard-shortcut-help-modal__shortcut",
|
|
42
42
|
key: index
|
|
43
|
-
}, typeof shortcut === 'string' ? (0,
|
|
43
|
+
}, typeof shortcut === 'string' ? (0, _react.createElement)(_dynamicShortcut.default, {
|
|
44
44
|
name: shortcut
|
|
45
|
-
}) : (0,
|
|
45
|
+
}) : (0, _react.createElement)(_shortcut.default, {
|
|
46
46
|
...shortcut
|
|
47
47
|
}))))
|
|
48
48
|
/* eslint-enable jsx-a11y/no-redundant-roles */;
|
|
@@ -51,11 +51,11 @@ const ShortcutSection = ({
|
|
|
51
51
|
title,
|
|
52
52
|
shortcuts,
|
|
53
53
|
className
|
|
54
|
-
}) => (0,
|
|
54
|
+
}) => (0, _react.createElement)("section", {
|
|
55
55
|
className: (0, _classnames.default)('customize-widgets-keyboard-shortcut-help-modal__section', className)
|
|
56
|
-
}, !!title && (0,
|
|
56
|
+
}, !!title && (0, _react.createElement)("h2", {
|
|
57
57
|
className: "customize-widgets-keyboard-shortcut-help-modal__section-title"
|
|
58
|
-
}, title), (0,
|
|
58
|
+
}, title), (0, _react.createElement)(ShortcutList, {
|
|
59
59
|
shortcuts: shortcuts
|
|
60
60
|
}));
|
|
61
61
|
const ShortcutCategorySection = ({
|
|
@@ -66,7 +66,7 @@ const ShortcutCategorySection = ({
|
|
|
66
66
|
const categoryShortcuts = (0, _data.useSelect)(select => {
|
|
67
67
|
return select(_keyboardShortcuts.store).getCategoryShortcuts(categoryName);
|
|
68
68
|
}, [categoryName]);
|
|
69
|
-
return (0,
|
|
69
|
+
return (0, _react.createElement)(ShortcutSection, {
|
|
70
70
|
title: title,
|
|
71
71
|
shortcuts: categoryShortcuts.concat(additionalShortcuts)
|
|
72
72
|
});
|
|
@@ -91,20 +91,20 @@ function KeyboardShortcutHelpModal({
|
|
|
91
91
|
if (!isModalActive) {
|
|
92
92
|
return null;
|
|
93
93
|
}
|
|
94
|
-
return (0,
|
|
94
|
+
return (0, _react.createElement)(_components.Modal, {
|
|
95
95
|
className: "customize-widgets-keyboard-shortcut-help-modal",
|
|
96
96
|
title: (0, _i18n.__)('Keyboard shortcuts'),
|
|
97
97
|
onRequestClose: toggleModal
|
|
98
|
-
}, (0,
|
|
98
|
+
}, (0, _react.createElement)(ShortcutSection, {
|
|
99
99
|
className: "customize-widgets-keyboard-shortcut-help-modal__main-shortcuts",
|
|
100
100
|
shortcuts: ['core/customize-widgets/keyboard-shortcuts']
|
|
101
|
-
}), (0,
|
|
101
|
+
}), (0, _react.createElement)(ShortcutCategorySection, {
|
|
102
102
|
title: (0, _i18n.__)('Global shortcuts'),
|
|
103
103
|
categoryName: "global"
|
|
104
|
-
}), (0,
|
|
104
|
+
}), (0, _react.createElement)(ShortcutCategorySection, {
|
|
105
105
|
title: (0, _i18n.__)('Selection shortcuts'),
|
|
106
106
|
categoryName: "selection"
|
|
107
|
-
}), (0,
|
|
107
|
+
}), (0, _react.createElement)(ShortcutCategorySection, {
|
|
108
108
|
title: (0, _i18n.__)('Block shortcuts'),
|
|
109
109
|
categoryName: "block",
|
|
110
110
|
additionalShortcuts: [{
|
|
@@ -115,7 +115,7 @@ function KeyboardShortcutHelpModal({
|
|
|
115
115
|
/* translators: The forward-slash character. e.g. '/'. */
|
|
116
116
|
ariaLabel: (0, _i18n.__)('Forward-slash')
|
|
117
117
|
}]
|
|
118
|
-
}), (0,
|
|
118
|
+
}), (0, _react.createElement)(ShortcutSection, {
|
|
119
119
|
title: (0, _i18n.__)('Text formatting'),
|
|
120
120
|
shortcuts: _config.textFormattingShortcuts
|
|
121
121
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","_components","_i18n","_keyboardShortcuts","_data","_config","_shortcut","_dynamicShortcut","ShortcutList","shortcuts","
|
|
1
|
+
{"version":3,"names":["_classnames","_interopRequireDefault","require","_components","_i18n","_keyboardShortcuts","_data","_config","_shortcut","_dynamicShortcut","ShortcutList","shortcuts","_react","createElement","className","role","map","shortcut","index","key","default","name","ShortcutSection","title","classnames","ShortcutCategorySection","categoryName","additionalShortcuts","categoryShortcuts","useSelect","select","keyboardShortcutsStore","getCategoryShortcuts","concat","KeyboardShortcutHelpModal","isModalActive","toggleModal","registerShortcut","useDispatch","category","description","__","keyCombination","modifier","character","useShortcut","Modal","onRequestClose","ariaLabel","textFormattingShortcuts"],"sources":["@wordpress/customize-widgets/src/components/keyboard-shortcut-help-modal/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Modal } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { useDispatch, 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=\"customize-widgets-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=\"customize-widgets-keyboard-shortcut-help-modal__shortcut\"\n\t\t\t\tkey={ index }\n\t\t\t>\n\t\t\t\t{ typeof shortcut === 'string' ? (\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'customize-widgets-keyboard-shortcut-help-modal__section',\n\t\t\tclassName\n\t\t) }\n\t>\n\t\t{ !! title && (\n\t\t\t<h2 className=\"customize-widgets-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\tconst { registerShortcut } = useDispatch( keyboardShortcutsStore );\n\tregisterShortcut( {\n\t\tname: 'core/customize-widgets/keyboard-shortcuts',\n\t\tcategory: 'main',\n\t\tdescription: __( 'Display these keyboard shortcuts.' ),\n\t\tkeyCombination: {\n\t\t\tmodifier: 'access',\n\t\t\tcharacter: 'h',\n\t\t},\n\t} );\n\n\tuseShortcut( 'core/customize-widgets/keyboard-shortcuts', toggleModal );\n\n\tif ( ! isModalActive ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Modal\n\t\t\tclassName=\"customize-widgets-keyboard-shortcut-help-modal\"\n\t\t\ttitle={ __( 'Keyboard shortcuts' ) }\n\t\t\tonRequestClose={ toggleModal }\n\t\t>\n\t\t\t<ShortcutSection\n\t\t\t\tclassName=\"customize-widgets-keyboard-shortcut-help-modal__main-shortcuts\"\n\t\t\t\tshortcuts={ [ 'core/customize-widgets/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"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAH,OAAA;AAIA,IAAAI,KAAA,GAAAJ,OAAA;AAKA,IAAAK,OAAA,GAA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K,EAAG,IAAAkB,QAAE,EAAE,qBAAsB,CAAG;IACrCf,YAAY,EAAC;EAAW,CACxB,CAAC,EAEF,IAAAd,MAAA,CAAAC,aAAA,EAACY,uBAAuB;IACvBF,KAAK,EAAG,IAAAkB,QAAE,EAAE,iBAAkB,CAAG;IACjCf,YAAY,EAAC,OAAO;IACpBC,mBAAmB,EAAG,CACrB;MACCe,cAAc,EAAE;QAAEE,SAAS,EAAE;MAAI,CAAC;MAClCJ,WAAW,EAAE,IAAAC,QAAE,EACd,qDACD,CAAC;MACD;MACAO,SAAS,EAAE,IAAAP,QAAE,EAAE,eAAgB;IAChC,CAAC;EACC,CACH,CAAC,EACF,IAAA7B,MAAA,CAAAC,aAAA,EAACS,eAAe;IACfC,KAAK,EAAG,IAAAkB,QAAE,EAAE,iBAAkB,CAAG;IACjC9B,SAAS,EAAGsC;EAAyB,CACrC,CACK,CAAC;AAEV"}
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
var _react = require("react");
|
|
7
8
|
var _element = require("@wordpress/element");
|
|
8
9
|
var _keycodes = require("@wordpress/keycodes");
|
|
9
10
|
/**
|
|
@@ -16,16 +17,16 @@ function KeyCombination({
|
|
|
16
17
|
}) {
|
|
17
18
|
const shortcut = keyCombination.modifier ? _keycodes.displayShortcutList[keyCombination.modifier](keyCombination.character) : keyCombination.character;
|
|
18
19
|
const ariaLabel = keyCombination.modifier ? _keycodes.shortcutAriaLabel[keyCombination.modifier](keyCombination.character) : keyCombination.character;
|
|
19
|
-
return (0,
|
|
20
|
+
return (0, _react.createElement)("kbd", {
|
|
20
21
|
className: "customize-widgets-keyboard-shortcut-help-modal__shortcut-key-combination",
|
|
21
22
|
"aria-label": forceAriaLabel || ariaLabel
|
|
22
23
|
}, (Array.isArray(shortcut) ? shortcut : [shortcut]).map((character, index) => {
|
|
23
24
|
if (character === '+') {
|
|
24
|
-
return (0,
|
|
25
|
+
return (0, _react.createElement)(_element.Fragment, {
|
|
25
26
|
key: index
|
|
26
27
|
}, character);
|
|
27
28
|
}
|
|
28
|
-
return (0,
|
|
29
|
+
return (0, _react.createElement)("kbd", {
|
|
29
30
|
key: index,
|
|
30
31
|
className: "customize-widgets-keyboard-shortcut-help-modal__shortcut-key"
|
|
31
32
|
}, character);
|
|
@@ -37,14 +38,14 @@ function Shortcut({
|
|
|
37
38
|
aliases = [],
|
|
38
39
|
ariaLabel
|
|
39
40
|
}) {
|
|
40
|
-
return (0,
|
|
41
|
+
return (0, _react.createElement)(_element.Fragment, null, (0, _react.createElement)("div", {
|
|
41
42
|
className: "customize-widgets-keyboard-shortcut-help-modal__shortcut-description"
|
|
42
|
-
}, description), (0,
|
|
43
|
+
}, description), (0, _react.createElement)("div", {
|
|
43
44
|
className: "customize-widgets-keyboard-shortcut-help-modal__shortcut-term"
|
|
44
|
-
}, (0,
|
|
45
|
+
}, (0, _react.createElement)(KeyCombination, {
|
|
45
46
|
keyCombination: keyCombination,
|
|
46
47
|
forceAriaLabel: ariaLabel
|
|
47
|
-
}), aliases.map((alias, index) => (0,
|
|
48
|
+
}), aliases.map((alias, index) => (0, _react.createElement)(KeyCombination, {
|
|
48
49
|
keyCombination: alias,
|
|
49
50
|
forceAriaLabel: ariaLabel,
|
|
50
51
|
key: index
|