@wordpress/edit-widgets 3.1.2 → 3.1.6
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/edit/index.js +29 -24
- package/build/blocks/widget-area/edit/index.js.map +1 -1
- package/build/blocks/widget-area/edit/inner-blocks.js +4 -3
- package/build/blocks/widget-area/edit/inner-blocks.js.map +1 -1
- package/build/blocks/widget-area/index.js +6 -3
- package/build/blocks/widget-area/index.js.map +1 -1
- package/build/components/error-boundary/index.js +5 -4
- package/build/components/error-boundary/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +4 -3
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +50 -41
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +12 -10
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build/components/layout/index.js +5 -4
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/interface.js +4 -3
- package/build/components/layout/interface.js.map +1 -1
- package/build/components/sidebar/index.js +6 -5
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar/widget-areas.js +4 -3
- package/build/components/sidebar/widget-areas.js.map +1 -1
- package/build/components/welcome-guide/index.js +5 -4
- package/build/components/welcome-guide/index.js.map +1 -1
- package/build/components/widget-areas-block-editor-content/index.js +4 -3
- package/build/components/widget-areas-block-editor-content/index.js.map +1 -1
- package/build/components/widget-areas-block-editor-provider/index.js +17 -12
- package/build/components/widget-areas-block-editor-provider/index.js.map +1 -1
- package/build/index.js +5 -3
- package/build/index.js.map +1 -1
- package/build/store/actions.js +74 -51
- package/build/store/actions.js.map +1 -1
- package/build/store/index.js +4 -2
- package/build/store/index.js.map +1 -1
- package/build/store/reducer.js +13 -5
- package/build/store/reducer.js.map +1 -1
- package/build/store/resolvers.js +10 -8
- package/build/store/resolvers.js.map +1 -1
- package/build/store/selectors.js +28 -14
- package/build/store/selectors.js.map +1 -1
- package/build/store/transformers.js +3 -2
- package/build/store/transformers.js.map +1 -1
- package/build/store/utils.js +2 -1
- package/build/store/utils.js.map +1 -1
- package/build-module/blocks/widget-area/edit/index.js +29 -24
- package/build-module/blocks/widget-area/edit/index.js.map +1 -1
- package/build-module/blocks/widget-area/edit/inner-blocks.js +4 -3
- package/build-module/blocks/widget-area/edit/inner-blocks.js.map +1 -1
- package/build-module/blocks/widget-area/index.js +6 -3
- package/build-module/blocks/widget-area/index.js.map +1 -1
- package/build-module/components/error-boundary/index.js +5 -4
- package/build-module/components/error-boundary/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +4 -3
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +48 -39
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +12 -10
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build-module/components/layout/index.js +5 -4
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/interface.js +4 -3
- package/build-module/components/layout/interface.js.map +1 -1
- package/build-module/components/sidebar/index.js +6 -5
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar/widget-areas.js +4 -3
- package/build-module/components/sidebar/widget-areas.js.map +1 -1
- package/build-module/components/welcome-guide/index.js +5 -4
- package/build-module/components/welcome-guide/index.js.map +1 -1
- package/build-module/components/widget-areas-block-editor-content/index.js +4 -3
- package/build-module/components/widget-areas-block-editor-content/index.js.map +1 -1
- package/build-module/components/widget-areas-block-editor-provider/index.js +17 -12
- package/build-module/components/widget-areas-block-editor-provider/index.js.map +1 -1
- package/build-module/index.js +2 -2
- package/build-module/index.js.map +1 -1
- package/build-module/store/actions.js +70 -47
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/reducer.js +11 -3
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/resolvers.js +10 -8
- package/build-module/store/resolvers.js.map +1 -1
- package/build-module/store/selectors.js +25 -12
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/transformers.js +2 -1
- package/build-module/store/transformers.js.map +1 -1
- package/package.json +27 -27
|
@@ -30,14 +30,15 @@ var _useIsDraggingWithin = _interopRequireDefault(require("./use-is-dragging-wit
|
|
|
30
30
|
*/
|
|
31
31
|
|
|
32
32
|
/** @typedef {import('@wordpress/element').RefObject} RefObject */
|
|
33
|
-
function WidgetAreaEdit({
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
33
|
+
function WidgetAreaEdit(_ref) {
|
|
34
|
+
let {
|
|
35
|
+
clientId,
|
|
36
|
+
className,
|
|
37
|
+
attributes: {
|
|
38
|
+
id,
|
|
39
|
+
name
|
|
40
|
+
}
|
|
41
|
+
} = _ref;
|
|
41
42
|
const isOpen = (0, _data.useSelect)(select => select(_store.store).getIsWidgetAreaOpen(clientId), [clientId]);
|
|
42
43
|
const {
|
|
43
44
|
setIsWidgetAreaOpen
|
|
@@ -70,22 +71,26 @@ function WidgetAreaEdit({
|
|
|
70
71
|
setIsWidgetAreaOpen(clientId, !isOpen);
|
|
71
72
|
},
|
|
72
73
|
scrollAfterOpen: !isDragging
|
|
73
|
-
},
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
74
|
+
}, _ref2 => {
|
|
75
|
+
let {
|
|
76
|
+
opened
|
|
77
|
+
} = _ref2;
|
|
78
|
+
return (// This is required to ensure LegacyWidget blocks are not
|
|
79
|
+
// unmounted when the panel is collapsed. Unmounting legacy
|
|
80
|
+
// widgets may have unintended consequences (e.g. TinyMCE
|
|
81
|
+
// not being properly reinitialized)
|
|
82
|
+
(0, _element.createElement)(_components.__unstableDisclosureContent, {
|
|
83
|
+
className: "wp-block-widget-area__panel-body-content",
|
|
84
|
+
visible: opened
|
|
85
|
+
}, (0, _element.createElement)(_coreData.EntityProvider, {
|
|
86
|
+
kind: "root",
|
|
87
|
+
type: "postType",
|
|
88
|
+
id: `widget-area-${id}`
|
|
89
|
+
}, (0, _element.createElement)(_innerBlocks.default, {
|
|
90
|
+
id: id
|
|
91
|
+
})))
|
|
92
|
+
);
|
|
93
|
+
}));
|
|
89
94
|
}
|
|
90
95
|
/**
|
|
91
96
|
* A React hook to determine if dragging is active.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-widgets/src/blocks/widget-area/edit/index.js"],"names":["WidgetAreaEdit","clientId","className","attributes","id","name","isOpen","select","editWidgetsStore","getIsWidgetAreaOpen","setIsWidgetAreaOpen","wrapper","setOpen","openState","isDragging","useIsDragging","isDraggingWithin","openedWhileDragging","setOpenedWhileDragging","opened","elementRef","setIsDragging","ownerDocument","current","handleDragStart","handleDragEnd","addEventListener","removeEventListener"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AASA;;AACA;;AACA;;AAjBA;AACA;AACA;;AAUA;AACA;AACA;;AAKA;AAEe,SAASA,cAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-widgets/src/blocks/widget-area/edit/index.js"],"names":["WidgetAreaEdit","clientId","className","attributes","id","name","isOpen","select","editWidgetsStore","getIsWidgetAreaOpen","setIsWidgetAreaOpen","wrapper","setOpen","openState","isDragging","useIsDragging","isDraggingWithin","openedWhileDragging","setOpenedWhileDragging","opened","elementRef","setIsDragging","ownerDocument","current","handleDragStart","handleDragEnd","addEventListener","removeEventListener"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AASA;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C,SAAnC,EAA8CF,aAA9C;AACA,KAHD;AAIA,GAlBD,EAkBG,EAlBH;AAoBA,SAAOX,UAAP;AACA,CAxBD","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useState, useCallback, useRef } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { EntityProvider } from '@wordpress/core-data';\nimport {\n\t__unstableDisclosureContent as DisclosureContent,\n\tPanel,\n\tPanelBody,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport WidgetAreaInnerBlocks from './inner-blocks';\nimport { store as editWidgetsStore } from '../../../store';\nimport useIsDraggingWithin from './use-is-dragging-within';\n\n/** @typedef {import('@wordpress/element').RefObject} RefObject */\n\nexport default function WidgetAreaEdit( {\n\tclientId,\n\tclassName,\n\tattributes: { id, name },\n} ) {\n\tconst isOpen = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editWidgetsStore ).getIsWidgetAreaOpen( clientId ),\n\t\t[ clientId ]\n\t);\n\tconst { setIsWidgetAreaOpen } = useDispatch( editWidgetsStore );\n\n\tconst wrapper = useRef();\n\tconst setOpen = useCallback(\n\t\t( openState ) => setIsWidgetAreaOpen( clientId, openState ),\n\t\t[ clientId ]\n\t);\n\tconst isDragging = useIsDragging( wrapper );\n\tconst isDraggingWithin = useIsDraggingWithin( wrapper );\n\n\tconst [ openedWhileDragging, setOpenedWhileDragging ] = useState( false );\n\tuseEffect( () => {\n\t\tif ( ! isDragging ) {\n\t\t\tsetOpenedWhileDragging( false );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isDraggingWithin && ! isOpen ) {\n\t\t\tsetOpen( true );\n\t\t\tsetOpenedWhileDragging( true );\n\t\t} else if ( ! isDraggingWithin && isOpen && openedWhileDragging ) {\n\t\t\tsetOpen( false );\n\t\t}\n\t}, [ isOpen, isDragging, isDraggingWithin, openedWhileDragging ] );\n\n\treturn (\n\t\t<Panel className={ className } ref={ wrapper }>\n\t\t\t<PanelBody\n\t\t\t\ttitle={ name }\n\t\t\t\topened={ isOpen }\n\t\t\t\tonToggle={ () => {\n\t\t\t\t\tsetIsWidgetAreaOpen( clientId, ! isOpen );\n\t\t\t\t} }\n\t\t\t\tscrollAfterOpen={ ! isDragging }\n\t\t\t>\n\t\t\t\t{ ( { opened } ) => (\n\t\t\t\t\t// This is required to ensure LegacyWidget blocks are not\n\t\t\t\t\t// unmounted when the panel is collapsed. Unmounting legacy\n\t\t\t\t\t// widgets may have unintended consequences (e.g. TinyMCE\n\t\t\t\t\t// not being properly reinitialized)\n\t\t\t\t\t<DisclosureContent\n\t\t\t\t\t\tclassName=\"wp-block-widget-area__panel-body-content\"\n\t\t\t\t\t\tvisible={ opened }\n\t\t\t\t\t>\n\t\t\t\t\t\t<EntityProvider\n\t\t\t\t\t\t\tkind=\"root\"\n\t\t\t\t\t\t\ttype=\"postType\"\n\t\t\t\t\t\t\tid={ `widget-area-${ id }` }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<WidgetAreaInnerBlocks id={ id } />\n\t\t\t\t\t\t</EntityProvider>\n\t\t\t\t\t</DisclosureContent>\n\t\t\t\t) }\n\t\t\t</PanelBody>\n\t\t</Panel>\n\t);\n}\n\n/**\n * A React hook to determine if dragging is active.\n *\n * @param {RefObject<HTMLElement>} elementRef The target elementRef object.\n *\n * @return {boolean} Is dragging within the entire document.\n */\nconst useIsDragging = ( elementRef ) => {\n\tconst [ isDragging, setIsDragging ] = useState( false );\n\n\tuseEffect( () => {\n\t\tconst { ownerDocument } = elementRef.current;\n\n\t\tfunction handleDragStart() {\n\t\t\tsetIsDragging( true );\n\t\t}\n\n\t\tfunction handleDragEnd() {\n\t\t\tsetIsDragging( false );\n\t\t}\n\n\t\townerDocument.addEventListener( 'dragstart', handleDragStart );\n\t\townerDocument.addEventListener( 'dragend', handleDragEnd );\n\n\t\treturn () => {\n\t\t\townerDocument.removeEventListener( 'dragstart', handleDragStart );\n\t\t\townerDocument.removeEventListener( 'dragend', handleDragEnd );\n\t\t};\n\t}, [] );\n\n\treturn isDragging;\n};\n"]}
|
|
@@ -28,9 +28,10 @@ var _useIsDraggingWithin = _interopRequireDefault(require("./use-is-dragging-wit
|
|
|
28
28
|
/**
|
|
29
29
|
* Internal dependencies
|
|
30
30
|
*/
|
|
31
|
-
function WidgetAreaInnerBlocks({
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
function WidgetAreaInnerBlocks(_ref) {
|
|
32
|
+
let {
|
|
33
|
+
id
|
|
34
|
+
} = _ref;
|
|
34
35
|
const [blocks, onInput, onChange] = (0, _coreData.useEntityBlockEditor)('root', 'postType');
|
|
35
36
|
const innerBlocksRef = (0, _element.useRef)();
|
|
36
37
|
const isDraggingWithinInnerBlocks = (0, _useIsDraggingWithin.default)(innerBlocksRef);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-widgets/src/blocks/widget-area/edit/inner-blocks.js"],"names":["WidgetAreaInnerBlocks","id","blocks","onInput","onChange","innerBlocksRef","isDraggingWithinInnerBlocks","shouldHighlightDropZone","innerBlocksProps","ref","value","templateLock","renderAppender","InnerBlocks","ButtonBlockAppender"],"mappings":";;;;;;;;;AAUA;;AAPA;;AAKA;;AACA;;AAMA;;AAfA;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;AAGe,SAASA,qBAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-widgets/src/blocks/widget-area/edit/inner-blocks.js"],"names":["WidgetAreaInnerBlocks","id","blocks","onInput","onChange","innerBlocksRef","isDraggingWithinInnerBlocks","shouldHighlightDropZone","innerBlocksProps","ref","value","templateLock","renderAppender","InnerBlocks","ButtonBlockAppender"],"mappings":";;;;;;;;;AAUA;;AAPA;;AAKA;;AACA;;AAMA;;AAfA;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;AAGe,SAASA,qBAAT,OAAyC;AAAA,MAAT;AAAEC,IAAAA;AAAF,GAAS;AACvD,QAAM,CAAEC,MAAF,EAAUC,OAAV,EAAmBC,QAAnB,IAAgC,oCACrC,MADqC,EAErC,UAFqC,CAAtC;AAIA,QAAMC,cAAc,GAAG,sBAAvB;AACA,QAAMC,2BAA2B,GAAG,kCAAqBD,cAArB,CAApC;AACA,QAAME,uBAAuB,GAAGD,2BAAhC,CAPuD,CAQvD;;AACA,QAAME,gBAAgB,GAAG,sCACxB;AAAEC,IAAAA,GAAG,EAAEJ;AAAP,GADwB,EAExB;AACCK,IAAAA,KAAK,EAAER,MADR;AAECC,IAAAA,OAFD;AAGCC,IAAAA,QAHD;AAICO,IAAAA,YAAY,EAAE,KAJf;AAKCC,IAAAA,cAAc,EAAEC,yBAAYC;AAL7B,GAFwB,CAAzB;AAWA,SACC;AACC,2BAAsBb,EADvB;AAEC,IAAA,SAAS,EAAG,yBACX,oFADW,EAEX;AACC,mDAA6CM;AAD9C,KAFW;AAFb,KASC,mCAAUC,gBAAV,CATD,CADD;AAaA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useEntityBlockEditor } from '@wordpress/core-data';\nimport { InnerBlocks, useInnerBlocksProps } from '@wordpress/block-editor';\nimport { useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport useIsDraggingWithin from './use-is-dragging-within';\n\nexport default function WidgetAreaInnerBlocks( { id } ) {\n\tconst [ blocks, onInput, onChange ] = useEntityBlockEditor(\n\t\t'root',\n\t\t'postType'\n\t);\n\tconst innerBlocksRef = useRef();\n\tconst isDraggingWithinInnerBlocks = useIsDraggingWithin( innerBlocksRef );\n\tconst shouldHighlightDropZone = isDraggingWithinInnerBlocks;\n\t// Using the experimental hook so that we can control the className of the element.\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{ ref: innerBlocksRef },\n\t\t{\n\t\t\tvalue: blocks,\n\t\t\tonInput,\n\t\t\tonChange,\n\t\t\ttemplateLock: false,\n\t\t\trenderAppender: InnerBlocks.ButtonBlockAppender,\n\t\t}\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tdata-widget-area-id={ id }\n\t\t\tclassName={ classnames(\n\t\t\t\t'wp-block-widget-area__inner-blocks block-editor-inner-blocks editor-styles-wrapper',\n\t\t\t\t{\n\t\t\t\t\t'wp-block-widget-area__highlight-drop-zone': shouldHighlightDropZone,\n\t\t\t\t}\n\t\t\t) }\n\t\t>\n\t\t\t<div { ...innerBlocksProps } />\n\t\t</div>\n\t);\n}\n"]}
|
|
@@ -48,9 +48,12 @@ exports.name = name;
|
|
|
48
48
|
const settings = {
|
|
49
49
|
title: (0, _i18n.__)('Widget Area'),
|
|
50
50
|
description: (0, _i18n.__)('A widget area container.'),
|
|
51
|
-
__experimentalLabel:
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
__experimentalLabel: _ref => {
|
|
52
|
+
let {
|
|
53
|
+
name: label
|
|
54
|
+
} = _ref;
|
|
55
|
+
return label;
|
|
56
|
+
},
|
|
54
57
|
edit: _edit.default
|
|
55
58
|
};
|
|
56
59
|
exports.settings = settings;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-widgets/src/blocks/widget-area/index.js"],"names":["name","metadata","settings","title","description","__experimentalLabel","label","edit"],"mappings":";;;;;;;;;AAGA;;AAMA;;AATA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;AAIA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAGO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,KAAK,EAAE,cAAI,aAAJ,CADgB;AAEvBC,EAAAA,WAAW,EAAE,cAAI,0BAAJ,CAFU;AAGvBC,EAAAA,mBAAmB,EAAE,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-widgets/src/blocks/widget-area/index.js"],"names":["name","metadata","settings","title","description","__experimentalLabel","label","edit"],"mappings":";;;;;;;;;AAGA;;AAMA;;AATA;AACA;AACA;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;AAIA,MAAM;AAAEA,EAAAA;AAAF,IAAWC,QAAjB;;AAGO,MAAMC,QAAQ,GAAG;AACvBC,EAAAA,KAAK,EAAE,cAAI,aAAJ,CADgB;AAEvBC,EAAAA,WAAW,EAAE,cAAI,0BAAJ,CAFU;AAGvBC,EAAAA,mBAAmB,EAAE;AAAA,QAAE;AAAEL,MAAAA,IAAI,EAAEM;AAAR,KAAF;AAAA,WAAuBA,KAAvB;AAAA,GAHE;AAIvBC,EAAAA,IAAI,EAAJA;AAJuB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport metadata from './block.json';\nimport edit from './edit';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ttitle: __( 'Widget Area' ),\n\tdescription: __( 'A widget area container.' ),\n\t__experimentalLabel: ( { name: label } ) => label,\n\tedit,\n};\n"]}
|
|
@@ -18,10 +18,11 @@ var _compose = require("@wordpress/compose");
|
|
|
18
18
|
/**
|
|
19
19
|
* WordPress dependencies
|
|
20
20
|
*/
|
|
21
|
-
function CopyButton({
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
function CopyButton(_ref) {
|
|
22
|
+
let {
|
|
23
|
+
text,
|
|
24
|
+
children
|
|
25
|
+
} = _ref;
|
|
25
26
|
const ref = (0, _compose.useCopyToClipboard)(text);
|
|
26
27
|
return (0, _element.createElement)(_components.Button, {
|
|
27
28
|
variant: "secondary",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-widgets/src/components/error-boundary/index.js"],"names":["CopyButton","text","children","ref","ErrorBoundary","Component","constructor","arguments","reboot","bind","state","error","componentDidCatch","setState","props","onError","render","stack"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAPA;AACA;AACA;AAOA,SAASA,UAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-widgets/src/components/error-boundary/index.js"],"names":["CopyButton","text","children","ref","ErrorBoundary","Component","constructor","arguments","reboot","bind","state","error","componentDidCatch","setState","props","onError","render","stack"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAPA;AACA;AACA;AAOA,SAASA,UAAT,OAA0C;AAAA,MAArB;AAAEC,IAAAA,IAAF;AAAQC,IAAAA;AAAR,GAAqB;AACzC,QAAMC,GAAG,GAAG,iCAAoBF,IAApB,CAAZ;AACA,SACC,4BAAC,kBAAD;AAAQ,IAAA,OAAO,EAAC,WAAhB;AAA4B,IAAA,GAAG,EAAGE;AAAlC,KACGD,QADH,CADD;AAKA;;AAEc,MAAME,aAAN,SAA4BC,kBAA5B,CAAsC;AACpDC,EAAAA,WAAW,GAAG;AACb,UAAO,GAAGC,SAAV;AAEA,SAAKC,MAAL,GAAc,KAAKA,MAAL,CAAYC,IAAZ,CAAkB,IAAlB,CAAd;AAEA,SAAKC,KAAL,GAAa;AACZC,MAAAA,KAAK,EAAE;AADK,KAAb;AAGA;;AAEDC,EAAAA,iBAAiB,CAAED,KAAF,EAAU;AAC1B,SAAKE,QAAL,CAAe;AAAEF,MAAAA;AAAF,KAAf;AACA;;AAEDH,EAAAA,MAAM,GAAG;AACR,SAAKM,KAAL,CAAWC,OAAX;AACA;;AAEDC,EAAAA,MAAM,GAAG;AACR,UAAM;AAAEL,MAAAA;AAAF,QAAY,KAAKD,KAAvB;;AACA,QAAK,CAAEC,KAAP,EAAe;AACd,aAAO,KAAKG,KAAL,CAAWZ,QAAlB;AACA;;AAED,WACC,4BAAC,oBAAD;AACC,MAAA,SAAS,EAAC,6BADX;AAEC,MAAA,OAAO,EAAG,CACT,4BAAC,kBAAD;AACC,QAAA,GAAG,EAAC,UADL;AAEC,QAAA,OAAO,EAAG,KAAKM,MAFhB;AAGC,QAAA,OAAO,EAAC;AAHT,SAKG,cAAI,kBAAJ,CALH,CADS,EAQT,4BAAC,UAAD;AAAY,QAAA,GAAG,EAAC,YAAhB;AAA6B,QAAA,IAAI,EAAGG,KAAK,CAACM;AAA1C,SACG,cAAI,YAAJ,CADH,CARS;AAFX,OAeG,cAAI,iDAAJ,CAfH,CADD;AAmBA;;AA5CmD","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';\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\n\t\tthis.reboot = this.reboot.bind( this );\n\n\t\tthis.state = {\n\t\t\terror: null,\n\t\t};\n\t}\n\n\tcomponentDidCatch( error ) {\n\t\tthis.setState( { error } );\n\t}\n\n\treboot() {\n\t\tthis.props.onError();\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=\"edit-widgets-error-boundary\"\n\t\t\t\tactions={ [\n\t\t\t\t\t<Button\n\t\t\t\t\t\tkey=\"recovery\"\n\t\t\t\t\t\tonClick={ this.reboot }\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Attempt Recovery' ) }\n\t\t\t\t\t</Button>,\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"]}
|
|
@@ -22,9 +22,10 @@ var _shortcut = _interopRequireDefault(require("./shortcut"));
|
|
|
22
22
|
/**
|
|
23
23
|
* Internal dependencies
|
|
24
24
|
*/
|
|
25
|
-
function DynamicShortcut({
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
function DynamicShortcut(_ref) {
|
|
26
|
+
let {
|
|
27
|
+
name
|
|
28
|
+
} = _ref;
|
|
28
29
|
const {
|
|
29
30
|
keyCombination,
|
|
30
31
|
description,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-widgets/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js"],"names":["DynamicShortcut","name","keyCombination","description","aliases","select","getShortcutKeyCombination","getShortcutDescription","getShortcutAliases","keyboardShortcutsStore"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AAKA;;AATA;AACA;AACA;;AAIA;AACA;AACA;AAGA,SAASA,eAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-widgets/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js"],"names":["DynamicShortcut","name","keyCombination","description","aliases","select","getShortcutKeyCombination","getShortcutDescription","getShortcutAliases","keyboardShortcutsStore"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AAKA;;AATA;AACA;AACA;;AAIA;AACA;AACA;AAGA,SAASA,eAAT,OAAqC;AAAA,MAAX;AAAEC,IAAAA;AAAF,GAAW;AACpC,QAAM;AAAEC,IAAAA,cAAF;AAAkBC,IAAAA,WAAlB;AAA+BC,IAAAA;AAA/B,MAA2C,qBAC9CC,MAAF,IAAc;AACb,UAAM;AACLC,MAAAA,yBADK;AAELC,MAAAA,sBAFK;AAGLC,MAAAA;AAHK,QAIFH,MAAM,CAAEI,wBAAF,CAJV;AAMA,WAAO;AACNP,MAAAA,cAAc,EAAEI,yBAAyB,CAAEL,IAAF,CADnC;AAENG,MAAAA,OAAO,EAAEI,kBAAkB,CAAEP,IAAF,CAFrB;AAGNE,MAAAA,WAAW,EAAEI,sBAAsB,CAAEN,IAAF;AAH7B,KAAP;AAKA,GAb+C,EAchD,CAAEA,IAAF,CAdgD,CAAjD;;AAiBA,MAAK,CAAEC,cAAP,EAAwB;AACvB,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,iBAAD;AACC,IAAA,cAAc,EAAGA,cADlB;AAEC,IAAA,WAAW,EAAGC,WAFf;AAGC,IAAA,OAAO,EAAGC;AAHX,IADD;AAOA;;eAEcJ,e","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"]}
|
|
@@ -38,44 +38,52 @@ var _dynamicShortcut = _interopRequireDefault(require("./dynamic-shortcut"));
|
|
|
38
38
|
/**
|
|
39
39
|
* Internal dependencies
|
|
40
40
|
*/
|
|
41
|
-
const ShortcutList =
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
const ShortcutList = _ref => {
|
|
42
|
+
let {
|
|
43
|
+
shortcuts
|
|
44
|
+
} = _ref;
|
|
45
|
+
return (
|
|
46
|
+
/*
|
|
47
|
+
* Disable reason: The `list` ARIA role is redundant but
|
|
48
|
+
* Safari+VoiceOver won't announce the list otherwise.
|
|
49
|
+
*/
|
|
50
|
+
|
|
51
|
+
/* eslint-disable jsx-a11y/no-redundant-roles */
|
|
52
|
+
(0, _element.createElement)("ul", {
|
|
53
|
+
className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-list",
|
|
54
|
+
role: "list"
|
|
55
|
+
}, shortcuts.map((shortcut, index) => (0, _element.createElement)("li", {
|
|
56
|
+
className: "edit-widgets-keyboard-shortcut-help-modal__shortcut",
|
|
57
|
+
key: index
|
|
58
|
+
}, (0, _lodash.isString)(shortcut) ? (0, _element.createElement)(_dynamicShortcut.default, {
|
|
59
|
+
name: shortcut
|
|
60
|
+
}) : (0, _element.createElement)(_shortcut.default, shortcut))))
|
|
61
|
+
/* eslint-enable jsx-a11y/no-redundant-roles */
|
|
62
|
+
|
|
63
|
+
);
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
const ShortcutSection = _ref2 => {
|
|
67
|
+
let {
|
|
68
|
+
title,
|
|
69
|
+
shortcuts,
|
|
70
|
+
className
|
|
71
|
+
} = _ref2;
|
|
72
|
+
return (0, _element.createElement)("section", {
|
|
73
|
+
className: (0, _classnames.default)('edit-widgets-keyboard-shortcut-help-modal__section', className)
|
|
74
|
+
}, !!title && (0, _element.createElement)("h2", {
|
|
75
|
+
className: "edit-widgets-keyboard-shortcut-help-modal__section-title"
|
|
76
|
+
}, title), (0, _element.createElement)(ShortcutList, {
|
|
77
|
+
shortcuts: shortcuts
|
|
78
|
+
}));
|
|
79
|
+
};
|
|
48
80
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
key: index
|
|
56
|
-
}, (0, _lodash.isString)(shortcut) ? (0, _element.createElement)(_dynamicShortcut.default, {
|
|
57
|
-
name: shortcut
|
|
58
|
-
}) : (0, _element.createElement)(_shortcut.default, shortcut))))
|
|
59
|
-
/* eslint-enable jsx-a11y/no-redundant-roles */
|
|
60
|
-
;
|
|
61
|
-
|
|
62
|
-
const ShortcutSection = ({
|
|
63
|
-
title,
|
|
64
|
-
shortcuts,
|
|
65
|
-
className
|
|
66
|
-
}) => (0, _element.createElement)("section", {
|
|
67
|
-
className: (0, _classnames.default)('edit-widgets-keyboard-shortcut-help-modal__section', className)
|
|
68
|
-
}, !!title && (0, _element.createElement)("h2", {
|
|
69
|
-
className: "edit-widgets-keyboard-shortcut-help-modal__section-title"
|
|
70
|
-
}, title), (0, _element.createElement)(ShortcutList, {
|
|
71
|
-
shortcuts: shortcuts
|
|
72
|
-
}));
|
|
73
|
-
|
|
74
|
-
const ShortcutCategorySection = ({
|
|
75
|
-
title,
|
|
76
|
-
categoryName,
|
|
77
|
-
additionalShortcuts = []
|
|
78
|
-
}) => {
|
|
81
|
+
const ShortcutCategorySection = _ref3 => {
|
|
82
|
+
let {
|
|
83
|
+
title,
|
|
84
|
+
categoryName,
|
|
85
|
+
additionalShortcuts = []
|
|
86
|
+
} = _ref3;
|
|
79
87
|
const categoryShortcuts = (0, _data.useSelect)(select => {
|
|
80
88
|
return select(_keyboardShortcuts.store).getCategoryShortcuts(categoryName);
|
|
81
89
|
}, [categoryName]);
|
|
@@ -85,10 +93,11 @@ const ShortcutCategorySection = ({
|
|
|
85
93
|
});
|
|
86
94
|
};
|
|
87
95
|
|
|
88
|
-
function KeyboardShortcutHelpModal({
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
96
|
+
function KeyboardShortcutHelpModal(_ref4) {
|
|
97
|
+
let {
|
|
98
|
+
isModalActive,
|
|
99
|
+
toggleModal
|
|
100
|
+
} = _ref4;
|
|
92
101
|
(0, _keyboardShortcuts.useShortcut)('core/edit-widgets/keyboard-shortcuts', toggleModal, {
|
|
93
102
|
bindGlobal: true
|
|
94
103
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-widgets/src/components/keyboard-shortcut-help-modal/index.js"],"names":["ShortcutList","shortcuts","map","shortcut","index","ShortcutSection","title","className","ShortcutCategorySection","categoryName","additionalShortcuts","categoryShortcuts","select","keyboardShortcutsStore","getCategoryShortcuts","concat","KeyboardShortcutHelpModal","isModalActive","toggleModal","bindGlobal","keyCombination","character","description","ariaLabel","textFormattingShortcuts"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AACA;;AAIA;;AAKA;;AACA;;AACA;;AAtBA;AACA;AACA;;AAIA;AACA;AACA;;AASA;AACA;AACA;AAKA,MAAMA,YAAY,GAAG,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-widgets/src/components/keyboard-shortcut-help-modal/index.js"],"names":["ShortcutList","shortcuts","map","shortcut","index","ShortcutSection","title","className","ShortcutCategorySection","categoryName","additionalShortcuts","categoryShortcuts","select","keyboardShortcutsStore","getCategoryShortcuts","concat","KeyboardShortcutHelpModal","isModalActive","toggleModal","bindGlobal","keyCombination","character","description","ariaLabel","textFormattingShortcuts"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AACA;;AAIA;;AAKA;;AACA;;AACA;;AAtBA;AACA;AACA;;AAIA;AACA;AACA;;AASA;AACA;AACA;AAKA,MAAMA,YAAY,GAAG;AAAA,MAAE;AAAEC,IAAAA;AAAF,GAAF;AAAA;AACpB;AACD;AACA;AACA;;AACC;AACA;AACC,MAAA,SAAS,EAAC,0DADX;AAEC,MAAA,IAAI,EAAC;AAFN,OAIGA,SAAS,CAACC,GAAV,CAAe,CAAEC,QAAF,EAAYC,KAAZ,KAChB;AACC,MAAA,SAAS,EAAC,qDADX;AAEC,MAAA,GAAG,EAAGA;AAFP,OAIG,sBAAUD,QAAV,IACD,4BAAC,wBAAD;AAAiB,MAAA,IAAI,EAAGA;AAAxB,MADC,GAGD,4BAAC,iBAAD,EAAeA,QAAf,CAPF,CADC,CAJH;AAiBA;;AAvBoB;AAAA,CAArB;;AA0BA,MAAME,eAAe,GAAG;AAAA,MAAE;A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AAC,uBAAD;AACC,IAAA,KAAK,EAAG,cAAI,kBAAJ,CADT;AAEC,IAAA,YAAY,EAAC;AAFd,IAVD,EAeC,4BAAC,uBAAD;AACC,IAAA,KAAK,EAAG,cAAI,qBAAJ,CADT;AAEC,IAAA,YAAY,EAAC;AAFd,IAfD,EAoBC,4BAAC,uBAAD;AACC,IAAA,KAAK,EAAG,cAAI,iBAAJ,CADT;AAEC,IAAA,YAAY,EAAC,OAFd;AAGC,IAAA,mBAAmB,EAAG,CACrB;AACCE,MAAAA,cAAc,EAAE;AAAEC,QAAAA,SAAS,EAAE;AAAb,OADjB;AAECC,MAAAA,WAAW,EAAE,cACZ,qDADY,CAFd;;AAKC;AACAC,MAAAA,SAAS,EAAE,cAAI,eAAJ;AANZ,KADqB;AAHvB,IApBD,EAkCC,4BAAC,eAAD;AACC,IAAA,KAAK,EAAG,cAAI,iBAAJ,CADT;AAEC,IAAA,SAAS,EAAGC;AAFb,IAlCD,CADD;AAyCA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport { isString } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { Modal } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { textFormattingShortcuts } from './config';\nimport Shortcut from './shortcut';\nimport DynamicShortcut from './dynamic-shortcut';\n\nconst ShortcutList = ( { shortcuts } ) => (\n\t/*\n\t * Disable reason: The `list` ARIA role is redundant but\n\t * Safari+VoiceOver won't announce the list otherwise.\n\t */\n\t/* eslint-disable jsx-a11y/no-redundant-roles */\n\t<ul\n\t\tclassName=\"edit-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=\"edit-widgets-keyboard-shortcut-help-modal__shortcut\"\n\t\t\t\tkey={ index }\n\t\t\t>\n\t\t\t\t{ isString( shortcut ) ? (\n\t\t\t\t\t<DynamicShortcut name={ shortcut } />\n\t\t\t\t) : (\n\t\t\t\t\t<Shortcut { ...shortcut } />\n\t\t\t\t) }\n\t\t\t</li>\n\t\t) ) }\n\t</ul>\n\t/* eslint-enable jsx-a11y/no-redundant-roles */\n);\n\nconst ShortcutSection = ( { title, shortcuts, className } ) => (\n\t<section\n\t\tclassName={ classnames(\n\t\t\t'edit-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=\"edit-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\tuseShortcut( 'core/edit-widgets/keyboard-shortcuts', toggleModal, {\n\t\tbindGlobal: true,\n\t} );\n\n\tif ( ! isModalActive ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Modal\n\t\t\tclassName=\"edit-widgets-keyboard-shortcut-help-modal\"\n\t\t\ttitle={ __( 'Keyboard shortcuts' ) }\n\t\t\tcloseLabel={ __( 'Close' ) }\n\t\t\tonRequestClose={ toggleModal }\n\t\t>\n\t\t\t<ShortcutSection\n\t\t\t\tclassName=\"edit-widgets-keyboard-shortcut-help-modal__main-shortcuts\"\n\t\t\t\tshortcuts={ [ 'core/edit-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"]}
|
|
@@ -18,10 +18,11 @@ var _keycodes = require("@wordpress/keycodes");
|
|
|
18
18
|
/**
|
|
19
19
|
* WordPress dependencies
|
|
20
20
|
*/
|
|
21
|
-
function KeyCombination({
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
function KeyCombination(_ref) {
|
|
22
|
+
let {
|
|
23
|
+
keyCombination,
|
|
24
|
+
forceAriaLabel
|
|
25
|
+
} = _ref;
|
|
25
26
|
const shortcut = keyCombination.modifier ? _keycodes.displayShortcutList[keyCombination.modifier](keyCombination.character) : keyCombination.character;
|
|
26
27
|
const ariaLabel = keyCombination.modifier ? _keycodes.shortcutAriaLabel[keyCombination.modifier](keyCombination.character) : keyCombination.character;
|
|
27
28
|
return (0, _element.createElement)("kbd", {
|
|
@@ -41,12 +42,13 @@ function KeyCombination({
|
|
|
41
42
|
}));
|
|
42
43
|
}
|
|
43
44
|
|
|
44
|
-
function Shortcut({
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
function Shortcut(_ref2) {
|
|
46
|
+
let {
|
|
47
|
+
description,
|
|
48
|
+
keyCombination,
|
|
49
|
+
aliases = [],
|
|
50
|
+
ariaLabel
|
|
51
|
+
} = _ref2;
|
|
50
52
|
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)("div", {
|
|
51
53
|
className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-description"
|
|
52
54
|
}, description), (0, _element.createElement)("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-widgets/src/components/keyboard-shortcut-help-modal/shortcut.js"],"names":["KeyCombination","keyCombination","forceAriaLabel","shortcut","modifier","displayShortcutList","character","ariaLabel","shortcutAriaLabel","map","index","Shortcut","description","aliases","alias"],"mappings":";;;;;;;AAQA;;AALA;;AAMA;;AATA;AACA;AACA;;AAGA;AACA;AACA;AAIA,SAASA,cAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-widgets/src/components/keyboard-shortcut-help-modal/shortcut.js"],"names":["KeyCombination","keyCombination","forceAriaLabel","shortcut","modifier","displayShortcutList","character","ariaLabel","shortcutAriaLabel","map","index","Shortcut","description","aliases","alias"],"mappings":";;;;;;;AAQA;;AALA;;AAMA;;AATA;AACA;AACA;;AAGA;AACA;AACA;AAIA,SAASA,cAAT,OAA8D;AAAA,MAArC;AAAEC,IAAAA,cAAF;AAAkBC,IAAAA;AAAlB,GAAqC;AAC7D,QAAMC,QAAQ,GAAGF,cAAc,CAACG,QAAf,GACdC,8BAAqBJ,cAAc,CAACG,QAApC,EACAH,cAAc,CAACK,SADf,CADc,GAIdL,cAAc,CAACK,SAJlB;AAKA,QAAMC,SAAS,GAAGN,cAAc,CAACG,QAAf,GACfI,4BAAmBP,cAAc,CAACG,QAAlC,EACAH,cAAc,CAACK,SADf,CADe,GAIfL,cAAc,CAACK,SAJlB;AAMA,SACC;AACC,IAAA,SAAS,EAAC,qEADX;AAEC,kBAAaJ,cAAc,IAAIK;AAFhC,KAIG,uBAAWJ,QAAX,EAAsBM,GAAtB,CAA2B,CAAEH,SAAF,EAAaI,KAAb,KAAwB;AACpD,QAAKJ,SAAS,KAAK,GAAnB,EAAyB;AACxB,aAAO,4BAAC,iBAAD;AAAU,QAAA,GAAG,EAAGI;AAAhB,SAA0BJ,SAA1B,CAAP;AACA;;AAED,WACC;AACC,MAAA,GAAG,EAAGI,KADP;AAEC,MAAA,SAAS,EAAC;AAFX,OAIGJ,SAJH,CADD;AAQA,GAbC,CAJH,CADD;AAqBA;;AAED,SAASK,QAAT,QAA8E;AAAA,MAA3D;AAAEC,IAAAA,WAAF;AAAeX,IAAAA,cAAf;AAA+BY,IAAAA,OAAO,GAAG,EAAzC;AAA6CN,IAAAA;AAA7C,GAA2D;AAC7E,SACC,qDACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGK,WADH,CADD,EAIC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,cAAD;AACC,IAAA,cAAc,EAAGX,cADlB;AAEC,IAAA,cAAc,EAAGM;AAFlB,IADD,EAKGM,OAAO,CAACJ,GAAR,CAAa,CAAEK,KAAF,EAASJ,KAAT,KACd,4BAAC,cAAD;AACC,IAAA,cAAc,EAAGI,KADlB;AAEC,IAAA,cAAc,EAAGP,SAFlB;AAGC,IAAA,GAAG,EAAGG;AAHP,IADC,CALH,CAJD,CADD;AAoBA;;eAEcC,Q","sourcesContent":["/**\n * External dependencies\n */\nimport { castArray } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { Fragment } from '@wordpress/element';\nimport { displayShortcutList, shortcutAriaLabel } from '@wordpress/keycodes';\n\nfunction KeyCombination( { keyCombination, forceAriaLabel } ) {\n\tconst shortcut = keyCombination.modifier\n\t\t? displayShortcutList[ keyCombination.modifier ](\n\t\t\t\tkeyCombination.character\n\t\t )\n\t\t: keyCombination.character;\n\tconst ariaLabel = keyCombination.modifier\n\t\t? shortcutAriaLabel[ keyCombination.modifier ](\n\t\t\t\tkeyCombination.character\n\t\t )\n\t\t: keyCombination.character;\n\n\treturn (\n\t\t<kbd\n\t\t\tclassName=\"edit-widgets-keyboard-shortcut-help-modal__shortcut-key-combination\"\n\t\t\taria-label={ forceAriaLabel || ariaLabel }\n\t\t>\n\t\t\t{ castArray( shortcut ).map( ( character, index ) => {\n\t\t\t\tif ( character === '+' ) {\n\t\t\t\t\treturn <Fragment key={ index }>{ character }</Fragment>;\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\t<kbd\n\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\tclassName=\"edit-widgets-keyboard-shortcut-help-modal__shortcut-key\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ character }\n\t\t\t\t\t</kbd>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</kbd>\n\t);\n}\n\nfunction Shortcut( { description, keyCombination, aliases = [], ariaLabel } ) {\n\treturn (\n\t\t<>\n\t\t\t<div className=\"edit-widgets-keyboard-shortcut-help-modal__shortcut-description\">\n\t\t\t\t{ description }\n\t\t\t</div>\n\t\t\t<div className=\"edit-widgets-keyboard-shortcut-help-modal__shortcut-term\">\n\t\t\t\t<KeyCombination\n\t\t\t\t\tkeyCombination={ keyCombination }\n\t\t\t\t\tforceAriaLabel={ ariaLabel }\n\t\t\t\t/>\n\t\t\t\t{ aliases.map( ( alias, index ) => (\n\t\t\t\t\t<KeyCombination\n\t\t\t\t\t\tkeyCombination={ alias }\n\t\t\t\t\t\tforceAriaLabel={ ariaLabel }\n\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default Shortcut;\n"]}
|
|
@@ -32,10 +32,11 @@ var _welcomeGuide = _interopRequireDefault(require("../welcome-guide"));
|
|
|
32
32
|
/**
|
|
33
33
|
* Internal dependencies
|
|
34
34
|
*/
|
|
35
|
-
function Layout({
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
function Layout(_ref) {
|
|
36
|
+
let {
|
|
37
|
+
blockEditorSettings,
|
|
38
|
+
onError
|
|
39
|
+
} = _ref;
|
|
39
40
|
return (0, _element.createElement)(_errorBoundary.default, {
|
|
40
41
|
onError: onError
|
|
41
42
|
}, (0, _element.createElement)(_widgetAreasBlockEditorProvider.default, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-widgets/src/components/layout/index.js"],"names":["Layout","blockEditorSettings","onError"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAdA;AACA;AACA;;AAIA;AACA;AACA;AAQA,SAASA,MAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-widgets/src/components/layout/index.js"],"names":["Layout","blockEditorSettings","onError"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAdA;AACA;AACA;;AAIA;AACA;AACA;AAQA,SAASA,MAAT,OAAoD;AAAA,MAAnC;AAAEC,IAAAA,mBAAF;AAAuBC,IAAAA;AAAvB,GAAmC;AACnD,SACC,4BAAC,sBAAD;AAAe,IAAA,OAAO,EAAGA;AAAzB,KACC,4BAAC,uCAAD;AACC,IAAA,mBAAmB,EAAGD;AADvB,KAGC,4BAAC,kBAAD;AAAW,IAAA,mBAAmB,EAAGA;AAAjC,IAHD,EAIC,4BAAC,gBAAD,OAJD,EAKC,4BAAC,mBAAD,CAAS,IAAT,OALD,EAMC,4BAAC,mBAAD,OAND,EAOC,4BAAC,8BAAD,OAPD,EAQC,4BAAC,qBAAD,OARD,CADD,CADD;AAcA;;eAEcD,M","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Popover } from '@wordpress/components';\nimport { PluginArea } from '@wordpress/plugins';\n\n/**\n * Internal dependencies\n */\nimport ErrorBoundary from '../error-boundary';\nimport WidgetAreasBlockEditorProvider from '../widget-areas-block-editor-provider';\nimport Sidebar from '../sidebar';\nimport Interface from './interface';\nimport UnsavedChangesWarning from './unsaved-changes-warning';\nimport WelcomeGuide from '../welcome-guide';\n\nfunction Layout( { blockEditorSettings, onError } ) {\n\treturn (\n\t\t<ErrorBoundary onError={ onError }>\n\t\t\t<WidgetAreasBlockEditorProvider\n\t\t\t\tblockEditorSettings={ blockEditorSettings }\n\t\t\t>\n\t\t\t\t<Interface blockEditorSettings={ blockEditorSettings } />\n\t\t\t\t<Sidebar />\n\t\t\t\t<Popover.Slot />\n\t\t\t\t<PluginArea />\n\t\t\t\t<UnsavedChangesWarning />\n\t\t\t\t<WelcomeGuide />\n\t\t\t</WidgetAreasBlockEditorProvider>\n\t\t</ErrorBoundary>\n\t);\n}\n\nexport default Layout;\n"]}
|
|
@@ -50,9 +50,10 @@ const interfaceLabels = {
|
|
|
50
50
|
footer: (0, _i18n.__)('Widgets footer')
|
|
51
51
|
};
|
|
52
52
|
|
|
53
|
-
function Interface({
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
function Interface(_ref) {
|
|
54
|
+
let {
|
|
55
|
+
blockEditorSettings
|
|
56
|
+
} = _ref;
|
|
56
57
|
const isMobileViewport = (0, _compose.useViewportMatch)('medium', '<');
|
|
57
58
|
const isHugeViewport = (0, _compose.useViewportMatch)('huge', '>=');
|
|
58
59
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-widgets/src/components/layout/interface.js"],"names":["interfaceLabels","header","body","sidebar","footer","Interface","blockEditorSettings","isMobileViewport","isHugeViewport","setIsInserterOpened","setIsListViewOpened","closeGeneralSidebar","editWidgetsStore","hasBlockBreadCrumbsEnabled","hasSidebarEnabled","isInserterOpened","isListViewOpened","previousShortcut","nextShortcut","select","interfaceStore","getActiveComplementaryArea","name","isFeatureActive","keyboardShortcutsStore","getAllShortcutKeyCombinations","previous","next"],"mappings":";;;;;;;;;AAKA;;AAFA;;AACA;;AAEA;;AACA;;AAKA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AArBA;AACA;AACA;;AAaA;AACA;AACA;AAMA,MAAMA,eAAe,GAAG;AACvB;AACAC,EAAAA,MAAM,EAAE,cAAI,iBAAJ,CAFe;;AAGvB;AACAC,EAAAA,IAAI,EAAE,cAAI,oBAAJ,CAJiB;;AAKvB;AACAC,EAAAA,OAAO,EAAE,cAAI,kBAAJ,CANc;;AAOvB;AACAC,EAAAA,MAAM,EAAE,cAAI,gBAAJ;AARe,CAAxB;;AAWA,SAASC,SAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-widgets/src/components/layout/interface.js"],"names":["interfaceLabels","header","body","sidebar","footer","Interface","blockEditorSettings","isMobileViewport","isHugeViewport","setIsInserterOpened","setIsListViewOpened","closeGeneralSidebar","editWidgetsStore","hasBlockBreadCrumbsEnabled","hasSidebarEnabled","isInserterOpened","isListViewOpened","previousShortcut","nextShortcut","select","interfaceStore","getActiveComplementaryArea","name","isFeatureActive","keyboardShortcutsStore","getAllShortcutKeyCombinations","previous","next"],"mappings":";;;;;;;;;AAKA;;AAFA;;AACA;;AAEA;;AACA;;AAKA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AArBA;AACA;AACA;;AAaA;AACA;AACA;AAMA,MAAMA,eAAe,GAAG;AACvB;AACAC,EAAAA,MAAM,EAAE,cAAI,iBAAJ,CAFe;;AAGvB;AACAC,EAAAA,IAAI,EAAE,cAAI,oBAAJ,CAJiB;;AAKvB;AACAC,EAAAA,OAAO,EAAE,cAAI,kBAAJ,CANc;;AAOvB;AACAC,EAAAA,MAAM,EAAE,cAAI,gBAAJ;AARe,CAAxB;;AAWA,SAASC,SAAT,OAA8C;AAAA,MAA1B;A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AqBN,cAArB,CALH;AAOA,0BAAW,MAAM;AAChB,QAAK,CAAEO,gBAAgB,IAAIC,gBAAtB,KAA4C,CAAER,cAAnD,EAAoE;AACnEG,MAAAA,mBAAmB;AACnB;AACD,GAJD,EAIG,CAAEI,gBAAF,EAAoBC,gBAApB,EAAsCR,cAAtC,CAJH;AAMA,SACC,4BAAC,4BAAD;AACC,IAAA,MAAM,EAAGR,eADV;AAEC,IAAA,MAAM,EAAG,4BAAC,eAAD,OAFV;AAGC,IAAA,gBAAgB,EAAG,4BAAC,yBAAD,OAHpB;AAIC,IAAA,OAAO,EACNc,iBAAiB,IAChB,4BAAC,4BAAD,CAAmB,IAAnB;AAAwB,MAAA,KAAK,EAAC;AAA9B,MANH;AASC,IAAA,OAAO,EACN,4BAAC,sCAAD;AACC,MAAA,mBAAmB,EAAGR;AADvB,MAVF;AAcC,IAAA,MAAM,EACLO,0BAA0B,IAC1B,CAAEN,gBADF,IAEC;AAAK,MAAA,SAAS,EAAC;AAAf,OACC,4BAAC,4BAAD;AAAiB,MAAA,aAAa,EAAG,cAAI,SAAJ;AAAjC,MADD,CAjBH;AAsBC,IAAA,SAAS,EAAG;AACXmB,MAAAA,QAAQ,EAAET,gBADC;AAEXU,MAAAA,IAAI,EAAET;AAFK;AAtBb,IADD;AA6BA;;eAEcb,S","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport { BlockBreadcrumb } from '@wordpress/block-editor';\nimport { useEffect } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tInterfaceSkeleton,\n\tComplementaryArea,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport { __ } from '@wordpress/i18n';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\n\n/**\n * Internal dependencies\n */\nimport Header from '../header';\nimport WidgetAreasBlockEditorContent from '../widget-areas-block-editor-content';\nimport { store as editWidgetsStore } from '../../store';\nimport SecondarySidebar from '../secondary-sidebar';\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the widgets screen top bar landmark region. */\n\theader: __( 'Widgets top bar' ),\n\t/* translators: accessibility text for the widgets screen content landmark region. */\n\tbody: __( 'Widgets and blocks' ),\n\t/* translators: accessibility text for the widgets screen settings landmark region. */\n\tsidebar: __( 'Widgets settings' ),\n\t/* translators: accessibility text for the widgets screen footer landmark region. */\n\tfooter: __( 'Widgets footer' ),\n};\n\nfunction Interface( { blockEditorSettings } ) {\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isHugeViewport = useViewportMatch( 'huge', '>=' );\n\tconst {\n\t\tsetIsInserterOpened,\n\t\tsetIsListViewOpened,\n\t\tcloseGeneralSidebar,\n\t} = useDispatch( editWidgetsStore );\n\tconst {\n\t\thasBlockBreadCrumbsEnabled,\n\t\thasSidebarEnabled,\n\t\tisInserterOpened,\n\t\tisListViewOpened,\n\t\tpreviousShortcut,\n\t\tnextShortcut,\n\t} = useSelect(\n\t\t( select ) => ( {\n\t\t\thasSidebarEnabled: !! select(\n\t\t\t\tinterfaceStore\n\t\t\t).getActiveComplementaryArea( editWidgetsStore.name ),\n\t\t\tisInserterOpened: !! select( editWidgetsStore ).isInserterOpened(),\n\t\t\tisListViewOpened: !! select( editWidgetsStore ).isListViewOpened(),\n\t\t\thasBlockBreadCrumbsEnabled: select(\n\t\t\t\tinterfaceStore\n\t\t\t).isFeatureActive( 'core/edit-widgets', 'showBlockBreadcrumbs' ),\n\t\t\tpreviousShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations(\n\t\t\t\t'core/edit-widgets/previous-region'\n\t\t\t),\n\t\t\tnextShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-widgets/next-region' ),\n\t\t} ),\n\t\t[]\n\t);\n\n\t// Inserter and Sidebars are mutually exclusive\n\tuseEffect( () => {\n\t\tif ( hasSidebarEnabled && ! isHugeViewport ) {\n\t\t\tsetIsInserterOpened( false );\n\t\t\tsetIsListViewOpened( false );\n\t\t}\n\t}, [ hasSidebarEnabled, isHugeViewport ] );\n\n\tuseEffect( () => {\n\t\tif ( ( isInserterOpened || isListViewOpened ) && ! isHugeViewport ) {\n\t\t\tcloseGeneralSidebar();\n\t\t}\n\t}, [ isInserterOpened, isListViewOpened, isHugeViewport ] );\n\n\treturn (\n\t\t<InterfaceSkeleton\n\t\t\tlabels={ interfaceLabels }\n\t\t\theader={ <Header /> }\n\t\t\tsecondarySidebar={ <SecondarySidebar /> }\n\t\t\tsidebar={\n\t\t\t\thasSidebarEnabled && (\n\t\t\t\t\t<ComplementaryArea.Slot scope=\"core/edit-widgets\" />\n\t\t\t\t)\n\t\t\t}\n\t\t\tcontent={\n\t\t\t\t<WidgetAreasBlockEditorContent\n\t\t\t\t\tblockEditorSettings={ blockEditorSettings }\n\t\t\t\t/>\n\t\t\t}\n\t\t\tfooter={\n\t\t\t\thasBlockBreadCrumbsEnabled &&\n\t\t\t\t! isMobileViewport && (\n\t\t\t\t\t<div className=\"edit-widgets-layout__footer\">\n\t\t\t\t\t\t<BlockBreadcrumb rootLabelText={ __( 'Widgets' ) } />\n\t\t\t\t\t</div>\n\t\t\t\t)\n\t\t\t}\n\t\t\tshortcuts={ {\n\t\t\t\tprevious: previousShortcut,\n\t\t\t\tnext: nextShortcut,\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nexport default Interface;\n"]}
|
|
@@ -47,11 +47,12 @@ const WIDGET_AREAS_IDENTIFIER = 'edit-widgets/block-areas';
|
|
|
47
47
|
* Internal dependencies
|
|
48
48
|
*/
|
|
49
49
|
|
|
50
|
-
function ComplementaryAreaTab({
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
function ComplementaryAreaTab(_ref) {
|
|
51
|
+
let {
|
|
52
|
+
identifier,
|
|
53
|
+
label,
|
|
54
|
+
isActive
|
|
55
|
+
} = _ref;
|
|
55
56
|
const {
|
|
56
57
|
enableComplementaryArea
|
|
57
58
|
} = (0, _data.useDispatch)(_interface.store);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-widgets/src/components/sidebar/index.js"],"names":["SIDEBAR_ACTIVE_BY_DEFAULT","Platform","select","web","native","BLOCK_INSPECTOR_IDENTIFIER","WIDGET_AREAS_IDENTIFIER","ComplementaryAreaTab","identifier","label","isActive","enableComplementaryArea","interfaceStore","editWidgetsStore","name","Sidebar","currentArea","hasSelectedNonAreaBlock","isGeneralSidebarOpen","selectedWidgetAreaBlock","getSelectedBlock","getBlock","getBlockParentsByBlockName","blockEditorStore","getActiveComplementaryArea","selectedBlock","activeArea","currentSelection","widgetAreaBlock","clientId","attributes","cog","id"],"mappings":";;;;;;;;;AAQA;;AALA;;AAMA;;AACA;;AAIA;;AAKA;;AACA;;AACA;;AAgBA;;AACA;;AAtCA;AACA;AACA;;AAGA;AACA;AACA;AAgBA,MAAMA,yBAAyB,GAAGC,kBAASC,MAAT,CAAiB;AAClDC,EAAAA,GAAG,EAAE,IAD6C;AAElDC,EAAAA,MAAM,EAAE;AAF0C,CAAjB,CAAlC;;AAKA,MAAMC,0BAA0B,GAAG,8BAAnC,C,CAEA;AACA;;AACA,MAAMC,uBAAuB,GAAG,0BAAhC;AAEA;AACA;AACA;;AAIA,SAASC,oBAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-widgets/src/components/sidebar/index.js"],"names":["SIDEBAR_ACTIVE_BY_DEFAULT","Platform","select","web","native","BLOCK_INSPECTOR_IDENTIFIER","WIDGET_AREAS_IDENTIFIER","ComplementaryAreaTab","identifier","label","isActive","enableComplementaryArea","interfaceStore","editWidgetsStore","name","Sidebar","currentArea","hasSelectedNonAreaBlock","isGeneralSidebarOpen","selectedWidgetAreaBlock","getSelectedBlock","getBlock","getBlockParentsByBlockName","blockEditorStore","getActiveComplementaryArea","selectedBlock","activeArea","currentSelection","widgetAreaBlock","clientId","attribut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CArBH;AAuBA,SACC,4BAAC,4BAAD;AACC,IAAA,SAAS,EAAC,sBADX;AAEC,IAAA,MAAM,EACL,wCACC,wCACC,4BAAC,oBAAD;AACC,MAAA,UAAU,EAAGL,uBADd;AAEC,MAAA,KAAK,EACJa,uBAAuB,GACpBA,uBAAuB,CAACW,UAAxB,CAAmChB,IADf,GAEpB,cAAI,cAAJ,CALL;AAOC,MAAA,QAAQ,EAAGE,WAAW,KAAKV;AAP5B,MADD,CADD,EAYC,wCACC,4BAAC,oBAAD;AACC,MAAA,UAAU,EAAGD,0BADd;AAEC,MAAA,KAAK,EAAG,cAAI,OAAJ,CAFT;AAGC,MAAA,QAAQ,EACPW,WAAW,KAAKX;AAJlB,MADD,CAZD,CAHF;AA0BC,IAAA,eAAe,EAAC;AAChB;AA3BD;AA4BC,IAAA,KAAK,EAAG,cAAI,UAAJ,CA5BT;AA6BC,IAAA,UAAU,EAAG,cAAI,gBAAJ,CA7Bd;AA8BC,IAAA,KAAK,EAAC,mBA9BP;AA+BC,IAAA,UAAU,EAAGW,WA/Bd;AAgCC,IAAA,IAAI,EAAGe,UAhCR;AAiCC,IAAA,iBAAiB,EAAG/B;AAjCrB,KAmCGgB,WAAW,KAAKV,uBAAhB,IACD,4BAAC,oBAAD;AACC,IAAA,oBAAoB,EACnBa,uBADmB,aACnBA,uBADmB,uBACnBA,uBAAuB,CAAEW,UAAzB,CAAoCE;AAFtC,IApCF,EA0CGhB,WAAW,KAAKX,0BAAhB,KACCY,uBAAuB,GACxB,4BAAC,2BAAD,OADwB,GAGxB;AACA;AACA;AAAM,IAAA,SAAS,EAAC;AAAhB,KACG,cAAI,oBAAJ,CADH,CANA,CA1CH,CADD;AAuDA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useEffect, Platform } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tComplementaryArea,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport {\n\tBlockInspector,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\n\nimport { cog } from '@wordpress/icons';\nimport { Button } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\n\nconst SIDEBAR_ACTIVE_BY_DEFAULT = Platform.select( {\n\tweb: true,\n\tnative: false,\n} );\n\nconst BLOCK_INSPECTOR_IDENTIFIER = 'edit-widgets/block-inspector';\n\n// Widget areas were one called block areas, so use 'edit-widgets/block-areas'\n// for backwards compatibility.\nconst WIDGET_AREAS_IDENTIFIER = 'edit-widgets/block-areas';\n\n/**\n * Internal dependencies\n */\nimport WidgetAreas from './widget-areas';\nimport { store as editWidgetsStore } from '../../store';\n\nfunction ComplementaryAreaTab( { identifier, label, isActive } ) {\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\treturn (\n\t\t<Button\n\t\t\tonClick={ () =>\n\t\t\t\tenableComplementaryArea( editWidgetsStore.name, identifier )\n\t\t\t}\n\t\t\tclassName={ classnames( 'edit-widgets-sidebar__panel-tab', {\n\t\t\t\t'is-active': isActive,\n\t\t\t} ) }\n\t\t\taria-label={\n\t\t\t\tisActive\n\t\t\t\t\t? // translators: %s: sidebar label e.g: \"Widget Areas\".\n\t\t\t\t\t sprintf( __( '%s (selected)' ), label )\n\t\t\t\t\t: label\n\t\t\t}\n\t\t\tdata-label={ label }\n\t\t>\n\t\t\t{ label }\n\t\t</Button>\n\t);\n}\n\nexport default function Sidebar() {\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\tconst {\n\t\tcurrentArea,\n\t\thasSelectedNonAreaBlock,\n\t\tisGeneralSidebarOpen,\n\t\tselectedWidgetAreaBlock,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetSelectedBlock,\n\t\t\tgetBlock,\n\t\t\tgetBlockParentsByBlockName,\n\t\t} = select( blockEditorStore );\n\t\tconst { getActiveComplementaryArea } = select( interfaceStore );\n\n\t\tconst selectedBlock = getSelectedBlock();\n\n\t\tconst activeArea = getActiveComplementaryArea( editWidgetsStore.name );\n\n\t\tlet currentSelection = activeArea;\n\t\tif ( ! currentSelection ) {\n\t\t\tif ( selectedBlock ) {\n\t\t\t\tcurrentSelection = BLOCK_INSPECTOR_IDENTIFIER;\n\t\t\t} else {\n\t\t\t\tcurrentSelection = WIDGET_AREAS_IDENTIFIER;\n\t\t\t}\n\t\t}\n\n\t\tlet widgetAreaBlock;\n\t\tif ( selectedBlock ) {\n\t\t\tif ( selectedBlock.name === 'core/widget-area' ) {\n\t\t\t\twidgetAreaBlock = selectedBlock;\n\t\t\t} else {\n\t\t\t\twidgetAreaBlock = getBlock(\n\t\t\t\t\tgetBlockParentsByBlockName(\n\t\t\t\t\t\tselectedBlock.clientId,\n\t\t\t\t\t\t'core/widget-area'\n\t\t\t\t\t)[ 0 ]\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tcurrentArea: currentSelection,\n\t\t\thasSelectedNonAreaBlock: !! (\n\t\t\t\tselectedBlock && selectedBlock.name !== 'core/widget-area'\n\t\t\t),\n\t\t\tisGeneralSidebarOpen: !! activeArea,\n\t\t\tselectedWidgetAreaBlock: widgetAreaBlock,\n\t\t};\n\t}, [] );\n\n\t// currentArea, and isGeneralSidebarOpen are intentionally left out from the dependencies,\n\t// because we want to run the effect when a block is selected/unselected and not when the sidebar state changes.\n\tuseEffect( () => {\n\t\tif (\n\t\t\thasSelectedNonAreaBlock &&\n\t\t\tcurrentArea === WIDGET_AREAS_IDENTIFIER &&\n\t\t\tisGeneralSidebarOpen\n\t\t) {\n\t\t\tenableComplementaryArea(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\tBLOCK_INSPECTOR_IDENTIFIER\n\t\t\t);\n\t\t}\n\t\tif (\n\t\t\t! hasSelectedNonAreaBlock &&\n\t\t\tcurrentArea === BLOCK_INSPECTOR_IDENTIFIER &&\n\t\t\tisGeneralSidebarOpen\n\t\t) {\n\t\t\tenableComplementaryArea(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\tWIDGET_AREAS_IDENTIFIER\n\t\t\t);\n\t\t}\n\t}, [ hasSelectedNonAreaBlock, enableComplementaryArea ] );\n\n\treturn (\n\t\t<ComplementaryArea\n\t\t\tclassName=\"edit-widgets-sidebar\"\n\t\t\theader={\n\t\t\t\t<ul>\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<ComplementaryAreaTab\n\t\t\t\t\t\t\tidentifier={ WIDGET_AREAS_IDENTIFIER }\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\tselectedWidgetAreaBlock\n\t\t\t\t\t\t\t\t\t? selectedWidgetAreaBlock.attributes.name\n\t\t\t\t\t\t\t\t\t: __( 'Widget Areas' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisActive={ currentArea === WIDGET_AREAS_IDENTIFIER }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<ComplementaryAreaTab\n\t\t\t\t\t\t\tidentifier={ BLOCK_INSPECTOR_IDENTIFIER }\n\t\t\t\t\t\t\tlabel={ __( 'Block' ) }\n\t\t\t\t\t\t\tisActive={\n\t\t\t\t\t\t\t\tcurrentArea === BLOCK_INSPECTOR_IDENTIFIER\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t}\n\t\t\theaderClassName=\"edit-widgets-sidebar__panel-tabs\"\n\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\ttitle={ __( 'Settings' ) }\n\t\t\tcloseLabel={ __( 'Close settings' ) }\n\t\t\tscope=\"core/edit-widgets\"\n\t\t\tidentifier={ currentArea }\n\t\t\ticon={ cog }\n\t\t\tisActiveByDefault={ SIDEBAR_ACTIVE_BY_DEFAULT }\n\t\t>\n\t\t\t{ currentArea === WIDGET_AREAS_IDENTIFIER && (\n\t\t\t\t<WidgetAreas\n\t\t\t\t\tselectedWidgetAreaId={\n\t\t\t\t\t\tselectedWidgetAreaBlock?.attributes.id\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ currentArea === BLOCK_INSPECTOR_IDENTIFIER &&\n\t\t\t\t( hasSelectedNonAreaBlock ? (\n\t\t\t\t\t<BlockInspector />\n\t\t\t\t) : (\n\t\t\t\t\t// Pretend that Widget Areas are part of the UI by not\n\t\t\t\t\t// showing the Block Inspector when one is selected.\n\t\t\t\t\t<span className=\"block-editor-block-inspector__no-blocks\">\n\t\t\t\t\t\t{ __( 'No block selected.' ) }\n\t\t\t\t\t</span>\n\t\t\t\t) ) }\n\t\t</ComplementaryArea>\n\t);\n}\n"]}
|
|
@@ -30,9 +30,10 @@ var _store = require("../../store");
|
|
|
30
30
|
/**
|
|
31
31
|
* Internal dependencies
|
|
32
32
|
*/
|
|
33
|
-
function WidgetAreas({
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
function WidgetAreas(_ref) {
|
|
34
|
+
let {
|
|
35
|
+
selectedWidgetAreaId
|
|
36
|
+
} = _ref;
|
|
36
37
|
const widgetAreas = (0, _data.useSelect)(select => select(_store.store).getWidgetAreas(), []);
|
|
37
38
|
const selectedWidgetArea = (0, _element.useMemo)(() => selectedWidgetAreaId && (widgetAreas === null || widgetAreas === void 0 ? void 0 : widgetAreas.find(widgetArea => widgetArea.id === selectedWidgetAreaId)), [selectedWidgetAreaId, widgetAreas]);
|
|
38
39
|
let description;
|