@wordpress/edit-widgets 5.33.0 → 5.35.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 +10 -2
- package/build/blocks/widget-area/edit/inner-blocks.js +2 -2
- package/build/blocks/widget-area/edit/inner-blocks.js.map +1 -1
- package/build/components/header/document-tools/index.js +6 -38
- package/build/components/header/document-tools/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +4 -0
- package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +2 -2
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js +0 -59
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/secondary-sidebar/inserter-sidebar.js +1 -4
- package/build/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build/components/widget-areas-block-editor-provider/index.js +5 -1
- package/build/components/widget-areas-block-editor-provider/index.js.map +1 -1
- package/build/store/private-selectors.js +4 -0
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +16 -0
- package/build/store/reducer.js.map +1 -1
- package/build-module/blocks/widget-area/edit/inner-blocks.js +2 -2
- package/build-module/blocks/widget-area/edit/inner-blocks.js.map +1 -1
- package/build-module/components/header/document-tools/index.js +8 -40
- package/build-module/components/header/document-tools/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js +4 -0
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +2 -2
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/index.js +1 -60
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/secondary-sidebar/inserter-sidebar.js +2 -5
- package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build-module/components/widget-areas-block-editor-provider/index.js +5 -1
- package/build-module/components/widget-areas-block-editor-provider/index.js.map +1 -1
- package/build-module/store/private-selectors.js +3 -0
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +15 -0
- package/build-module/store/reducer.js.map +1 -1
- package/build-style/style-rtl.css +17 -11
- package/build-style/style.css +17 -11
- package/package.json +29 -29
- package/src/blocks/widget-area/edit/inner-blocks.js +2 -2
- package/src/components/header/document-tools/index.js +29 -56
- package/src/components/keyboard-shortcut-help-modal/config.js +10 -1
- package/src/components/keyboard-shortcut-help-modal/index.js +2 -2
- package/src/components/keyboard-shortcuts/index.js +1 -72
- package/src/components/layout/style.scss +4 -0
- package/src/components/secondary-sidebar/inserter-sidebar.js +2 -5
- package/src/components/widget-areas-block-editor-provider/index.js +4 -0
- package/src/store/private-selectors.js +4 -0
- package/src/store/reducer.js +13 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 5.35.0 (2024-05-16)
|
|
6
|
+
|
|
7
|
+
### Internal
|
|
8
|
+
|
|
9
|
+
- Replaced `classnames` package with the faster and smaller `clsx` package ([#61138](https://github.com/WordPress/gutenberg/pull/61138)).
|
|
10
|
+
|
|
11
|
+
## 5.34.0 (2024-05-02)
|
|
12
|
+
|
|
5
13
|
## 5.33.0 (2024-04-19)
|
|
6
14
|
|
|
7
15
|
## 5.32.0 (2024-04-03)
|
|
@@ -144,8 +152,8 @@
|
|
|
144
152
|
|
|
145
153
|
### Breaking Changes
|
|
146
154
|
|
|
147
|
-
- Drop support for Internet Explorer 11 ([#31110](https://github.com/WordPress/gutenberg/pull/31110)). Learn more at https://make.wordpress.org/core/2021/04/22/ie-11-support-phase-out-plan
|
|
148
|
-
- Increase the minimum Node.js version to v12 matching Long Term Support releases ([#31270](https://github.com/WordPress/gutenberg/pull/31270)). Learn more at https://nodejs.org/en/about/releases
|
|
155
|
+
- Drop support for Internet Explorer 11 ([#31110](https://github.com/WordPress/gutenberg/pull/31110)). Learn more at <https://make.wordpress.org/core/2021/04/22/ie-11-support-phase-out-plan/>.
|
|
156
|
+
- Increase the minimum Node.js version to v12 matching Long Term Support releases ([#31270](https://github.com/WordPress/gutenberg/pull/31270)). Learn more at <https://nodejs.org/en/about/releases/>.
|
|
149
157
|
|
|
150
158
|
## 1.3.0 (2021-03-17)
|
|
151
159
|
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = WidgetAreaInnerBlocks;
|
|
8
8
|
var _react = require("react");
|
|
9
|
-
var
|
|
9
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
10
10
|
var _coreData = require("@wordpress/core-data");
|
|
11
11
|
var _blockEditor = require("@wordpress/block-editor");
|
|
12
12
|
var _element = require("@wordpress/element");
|
|
@@ -42,7 +42,7 @@ function WidgetAreaInnerBlocks({
|
|
|
42
42
|
});
|
|
43
43
|
return (0, _react.createElement)("div", {
|
|
44
44
|
"data-widget-area-id": id,
|
|
45
|
-
className: (0,
|
|
45
|
+
className: (0, _clsx.default)('wp-block-widget-area__inner-blocks block-editor-inner-blocks editor-styles-wrapper', {
|
|
46
46
|
'wp-block-widget-area__highlight-drop-zone': shouldHighlightDropZone
|
|
47
47
|
})
|
|
48
48
|
}, (0, _react.createElement)("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_coreData","_blockEditor","_element","_useIsDraggingWithin","WidgetAreaInnerBlocks","id","blocks","onInput","onChange","useEntityBlockEditor","innerBlocksRef","useRef","isDraggingWithinInnerBlocks","useIsDraggingWithin","shouldHighlightDropZone","innerBlocksProps","useInnerBlocksProps","ref","value","templateLock","renderAppender","InnerBlocks","ButtonBlockAppender","_react","createElement","className","clsx"],"sources":["@wordpress/edit-widgets/src/blocks/widget-area/edit/inner-blocks.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\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={ clsx(\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':\n\t\t\t\t\t\tshouldHighlightDropZone,\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"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAKA,IAAAI,oBAAA,GAAAL,sBAAA,CAAAC,OAAA;AAfA;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;;AAGe,SAASK,qBAAqBA,CAAE;EAAEC;AAAG,CAAC,EAAG;EACvD,MAAM,CAAEC,MAAM,EAAEC,OAAO,EAAEC,QAAQ,CAAE,GAAG,IAAAC,8BAAoB,EACzD,MAAM,EACN,UACD,CAAC;EACD,MAAMC,cAAc,GAAG,IAAAC,eAAM,EAAC,CAAC;EAC/B,MAAMC,2BAA2B,GAAG,IAAAC,4BAAmB,EAAEH,cAAe,CAAC;EACzE,MAAMI,uBAAuB,GAAGF,2BAA2B;EAC3D;EACA,MAAMG,gBAAgB,GAAG,IAAAC,gCAAmB,EAC3C;IAAEC,GAAG,EAAEP;EAAe,CAAC,EACvB;IACCQ,KAAK,EAAEZ,MAAM;IACbC,OAAO;IACPC,QAAQ;IACRW,YAAY,EAAE,KAAK;IACnBC,cAAc,EAAEC,wBAAW,CAACC;EAC7B,CACD,CAAC;EAED,OACC,IAAAC,MAAA,CAAAC,aAAA;IACC,uBAAsBnB,EAAI;IAC1BoB,SAAS,EAAG,IAAAC,aAAI,EACf,oFAAoF,EACpF;MACC,2CAA2C,EAC1CZ;IACF,CACD;EAAG,GAEH,IAAAS,MAAA,CAAAC,aAAA;IAAA,GAAUT;EAAgB,CAAI,CAC1B,CAAC;AAER","ignoreList":[]}
|
|
@@ -15,7 +15,6 @@ var _element = require("@wordpress/element");
|
|
|
15
15
|
var _compose = require("@wordpress/compose");
|
|
16
16
|
var _undo = _interopRequireDefault(require("../undo-redo/undo"));
|
|
17
17
|
var _redo = _interopRequireDefault(require("../undo-redo/redo"));
|
|
18
|
-
var _useLastSelectedWidgetArea = _interopRequireDefault(require("../../../hooks/use-last-selected-widget-area"));
|
|
19
18
|
var _store = require("../../../store");
|
|
20
19
|
var _lockUnlock = require("../../../lock-unlock");
|
|
21
20
|
/**
|
|
@@ -26,70 +25,39 @@ var _lockUnlock = require("../../../lock-unlock");
|
|
|
26
25
|
* Internal dependencies
|
|
27
26
|
*/
|
|
28
27
|
|
|
29
|
-
const {
|
|
30
|
-
useShowBlockTools
|
|
31
|
-
} = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
|
|
32
28
|
function DocumentTools() {
|
|
33
29
|
const isMediumViewport = (0, _compose.useViewportMatch)('medium');
|
|
34
|
-
const inserterButton = (0, _element.useRef)();
|
|
35
|
-
const widgetAreaClientId = (0, _useLastSelectedWidgetArea.default)();
|
|
36
|
-
const isLastSelectedWidgetAreaOpen = (0, _data.useSelect)(select => select(_store.store).getIsWidgetAreaOpen(widgetAreaClientId), [widgetAreaClientId]);
|
|
37
30
|
const {
|
|
38
31
|
isInserterOpen,
|
|
39
32
|
isListViewOpen,
|
|
33
|
+
inserterSidebarToggleRef,
|
|
40
34
|
listViewToggleRef
|
|
41
35
|
} = (0, _data.useSelect)(select => {
|
|
42
36
|
const {
|
|
43
37
|
isInserterOpened,
|
|
38
|
+
getInserterSidebarToggleRef,
|
|
44
39
|
isListViewOpened,
|
|
45
40
|
getListViewToggleRef
|
|
46
41
|
} = (0, _lockUnlock.unlock)(select(_store.store));
|
|
47
42
|
return {
|
|
48
43
|
isInserterOpen: isInserterOpened(),
|
|
49
44
|
isListViewOpen: isListViewOpened(),
|
|
45
|
+
inserterSidebarToggleRef: getInserterSidebarToggleRef(),
|
|
50
46
|
listViewToggleRef: getListViewToggleRef()
|
|
51
47
|
};
|
|
52
48
|
}, []);
|
|
53
49
|
const {
|
|
54
|
-
setIsWidgetAreaOpen,
|
|
55
50
|
setIsInserterOpened,
|
|
56
51
|
setIsListViewOpened
|
|
57
52
|
} = (0, _data.useDispatch)(_store.store);
|
|
58
|
-
const {
|
|
59
|
-
selectBlock
|
|
60
|
-
} = (0, _data.useDispatch)(_blockEditor.store);
|
|
61
|
-
const handleClick = () => {
|
|
62
|
-
if (isInserterOpen) {
|
|
63
|
-
// Focusing the inserter button closes the inserter popover.
|
|
64
|
-
setIsInserterOpened(false);
|
|
65
|
-
} else {
|
|
66
|
-
if (!isLastSelectedWidgetAreaOpen) {
|
|
67
|
-
// Select the last selected block if hasn't already.
|
|
68
|
-
selectBlock(widgetAreaClientId);
|
|
69
|
-
// Open the last selected widget area when opening the inserter.
|
|
70
|
-
setIsWidgetAreaOpen(widgetAreaClientId, true);
|
|
71
|
-
}
|
|
72
|
-
// The DOM updates resulting from selectBlock() and setIsInserterOpened() calls are applied the
|
|
73
|
-
// same tick and pretty much in a random order. The inserter is closed if any other part of the
|
|
74
|
-
// app receives focus. If selectBlock() happens to take effect after setIsInserterOpened() then
|
|
75
|
-
// the inserter is visible for a brief moment and then gets auto-closed due to focus moving to
|
|
76
|
-
// the selected block.
|
|
77
|
-
window.requestAnimationFrame(() => setIsInserterOpened(true));
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
53
|
const toggleListView = (0, _element.useCallback)(() => setIsListViewOpened(!isListViewOpen), [setIsListViewOpened, isListViewOpen]);
|
|
81
|
-
|
|
82
|
-
// If there's a block toolbar to be focused, disable the focus shortcut for the document toolbar.
|
|
83
|
-
const {
|
|
84
|
-
showFixedToolbar
|
|
85
|
-
} = useShowBlockTools();
|
|
54
|
+
const toggleInserterSidebar = (0, _element.useCallback)(() => setIsInserterOpened(!isInserterOpen), [setIsInserterOpened, isInserterOpen]);
|
|
86
55
|
return (0, _react.createElement)(_blockEditor.NavigableToolbar, {
|
|
87
56
|
className: "edit-widgets-header-toolbar",
|
|
88
57
|
"aria-label": (0, _i18n.__)('Document tools'),
|
|
89
|
-
shouldUseKeyboardFocusShortcut: !showFixedToolbar,
|
|
90
58
|
variant: "unstyled"
|
|
91
59
|
}, (0, _react.createElement)(_components.ToolbarItem, {
|
|
92
|
-
ref:
|
|
60
|
+
ref: inserterSidebarToggleRef,
|
|
93
61
|
as: _components.Button,
|
|
94
62
|
className: "edit-widgets-header-toolbar__inserter-toggle",
|
|
95
63
|
variant: "primary",
|
|
@@ -97,7 +65,7 @@ function DocumentTools() {
|
|
|
97
65
|
onMouseDown: event => {
|
|
98
66
|
event.preventDefault();
|
|
99
67
|
},
|
|
100
|
-
onClick:
|
|
68
|
+
onClick: toggleInserterSidebar,
|
|
101
69
|
icon: _icons.plus
|
|
102
70
|
/* translators: button label text should, if possible, be under 16
|
|
103
71
|
characters. */,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_i18n","_components","_blockEditor","_icons","_element","_compose","_undo","_interopRequireDefault","_redo","
|
|
1
|
+
{"version":3,"names":["_data","require","_i18n","_components","_blockEditor","_icons","_element","_compose","_undo","_interopRequireDefault","_redo","_store","_lockUnlock","DocumentTools","isMediumViewport","useViewportMatch","isInserterOpen","isListViewOpen","inserterSidebarToggleRef","listViewToggleRef","useSelect","select","isInserterOpened","getInserterSidebarToggleRef","isListViewOpened","getListViewToggleRef","unlock","editWidgetsStore","setIsInserterOpened","setIsListViewOpened","useDispatch","toggleListView","useCallback","toggleInserterSidebar","_react","createElement","NavigableToolbar","className","__","variant","ToolbarItem","ref","as","Button","isPressed","onMouseDown","event","preventDefault","onClick","icon","plus","label","_x","size","Fragment","UndoButton","RedoButton","listView","_default","exports","default"],"sources":["@wordpress/edit-widgets/src/components/header/document-tools/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport { Button, ToolbarItem } from '@wordpress/components';\nimport { NavigableToolbar } from '@wordpress/block-editor';\nimport { listView, plus } from '@wordpress/icons';\nimport { useCallback } from '@wordpress/element';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport UndoButton from '../undo-redo/undo';\nimport RedoButton from '../undo-redo/redo';\nimport { store as editWidgetsStore } from '../../../store';\nimport { unlock } from '../../../lock-unlock';\n\nfunction DocumentTools() {\n\tconst isMediumViewport = useViewportMatch( 'medium' );\n\n\tconst {\n\t\tisInserterOpen,\n\t\tisListViewOpen,\n\t\tinserterSidebarToggleRef,\n\t\tlistViewToggleRef,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tisInserterOpened,\n\t\t\tgetInserterSidebarToggleRef,\n\t\t\tisListViewOpened,\n\t\t\tgetListViewToggleRef,\n\t\t} = unlock( select( editWidgetsStore ) );\n\t\treturn {\n\t\t\tisInserterOpen: isInserterOpened(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tinserterSidebarToggleRef: getInserterSidebarToggleRef(),\n\t\t\tlistViewToggleRef: getListViewToggleRef(),\n\t\t};\n\t}, [] );\n\tconst { setIsInserterOpened, setIsListViewOpened } =\n\t\tuseDispatch( editWidgetsStore );\n\n\tconst toggleListView = useCallback(\n\t\t() => setIsListViewOpened( ! isListViewOpen ),\n\t\t[ setIsListViewOpened, isListViewOpen ]\n\t);\n\n\tconst toggleInserterSidebar = useCallback(\n\t\t() => setIsInserterOpened( ! isInserterOpen ),\n\t\t[ setIsInserterOpened, isInserterOpen ]\n\t);\n\n\treturn (\n\t\t<NavigableToolbar\n\t\t\tclassName=\"edit-widgets-header-toolbar\"\n\t\t\taria-label={ __( 'Document tools' ) }\n\t\t\tvariant=\"unstyled\"\n\t\t>\n\t\t\t<ToolbarItem\n\t\t\t\tref={ inserterSidebarToggleRef }\n\t\t\t\tas={ Button }\n\t\t\t\tclassName=\"edit-widgets-header-toolbar__inserter-toggle\"\n\t\t\t\tvariant=\"primary\"\n\t\t\t\tisPressed={ isInserterOpen }\n\t\t\t\tonMouseDown={ ( event ) => {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t} }\n\t\t\t\tonClick={ toggleInserterSidebar }\n\t\t\t\ticon={ plus }\n\t\t\t\t/* translators: button label text should, if possible, be under 16\n\t\t\t\t\tcharacters. */\n\t\t\t\tlabel={ _x(\n\t\t\t\t\t'Toggle block inserter',\n\t\t\t\t\t'Generic label for block inserter button'\n\t\t\t\t) }\n\t\t\t\tsize=\"compact\"\n\t\t\t/>\n\t\t\t{ isMediumViewport && (\n\t\t\t\t<>\n\t\t\t\t\t<ToolbarItem as={ UndoButton } />\n\t\t\t\t\t<ToolbarItem as={ RedoButton } />\n\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\tas={ Button }\n\t\t\t\t\t\tclassName=\"edit-widgets-header-toolbar__list-view-toggle\"\n\t\t\t\t\t\ticon={ listView }\n\t\t\t\t\t\tisPressed={ isListViewOpen }\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={ __( 'List View' ) }\n\t\t\t\t\t\tonClick={ toggleListView }\n\t\t\t\t\t\tref={ listViewToggleRef }\n\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t) }\n\t\t</NavigableToolbar>\n\t);\n}\n\nexport default DocumentTools;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AAKA,IAAAO,KAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,KAAA,GAAAD,sBAAA,CAAAR,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AACA,IAAAW,WAAA,GAAAX,OAAA;AAjBA;AACA;AACA;;AASA;AACA;AACA;;AAMA,SAASY,aAAaA,CAAA,EAAG;EACxB,MAAMC,gBAAgB,GAAG,IAAAC,yBAAgB,EAAE,QAAS,CAAC;EAErD,MAAM;IACLC,cAAc;IACdC,cAAc;IACdC,wBAAwB;IACxBC;EACD,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAC5B,MAAM;MACLC,gBAAgB;MAChBC,2BAA2B;MAC3BC,gBAAgB;MAChBC;IACD,CAAC,GAAG,IAAAC,kBAAM,EAAEL,MAAM,CAAEM,YAAiB,CAAE,CAAC;IACxC,OAAO;MACNX,cAAc,EAAEM,gBAAgB,CAAC,CAAC;MAClCL,cAAc,EAAEO,gBAAgB,C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,WAAA,CAAAqC,WAAW;IAACE,EAAE,EAAGa;EAAY,CAAE,CAAC,EACjC,IAAArB,MAAA,CAAAC,aAAA,EAAChC,WAAA,CAAAqC,WAAW;IAACE,EAAE,EAAGc;EAAY,CAAE,CAAC,EACjC,IAAAtB,MAAA,CAAAC,aAAA,EAAChC,WAAA,CAAAqC,WAAW;IACXE,EAAE,EAAGC,kBAAQ;IACbN,SAAS,EAAC,+CAA+C;IACzDY,IAAI,EAAGQ,eAAU;IACjBb,SAAS,EAAG3B;IACZ;IACAkC,KAAK,EAAG,IAAAb,QAAE,EAAE,WAAY,CAAG;IAC3BU,OAAO,EAAGjB,cAAgB;IAC1BU,GAAG,EAAGtB,iBAAmB;IACzBkC,IAAI,EAAC;EAAS,CACd,CACA,CAEc,CAAC;AAErB;AAAC,IAAAK,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc/C,aAAa","ignoreList":[]}
|
|
@@ -61,6 +61,10 @@ const textFormattingShortcuts = exports.textFormattingShortcuts = [{
|
|
|
61
61
|
modifier: 'access',
|
|
62
62
|
character: '0'
|
|
63
63
|
},
|
|
64
|
+
aliases: [{
|
|
65
|
+
modifier: 'access',
|
|
66
|
+
character: '7'
|
|
67
|
+
}],
|
|
64
68
|
description: (0, _i18n.__)('Convert the current heading to a paragraph.')
|
|
65
69
|
}, {
|
|
66
70
|
keyCombination: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","textFormattingShortcuts","exports","keyCombination","modifier","character","description","__"],"sources":["@wordpress/edit-widgets/src/components/keyboard-shortcut-help-modal/config.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\nexport const textFormattingShortcuts = [\n\t{\n\t\tkeyCombination: { modifier: 'primary', character: 'b' },\n\t\tdescription: __( 'Make the selected text bold.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primary', character: 'i' },\n\t\tdescription: __( 'Make the selected text italic.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primary', character: 'k' },\n\t\tdescription: __( 'Convert the selected text into a link.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primaryShift', character: 'k' },\n\t\tdescription: __( 'Remove a link.' ),\n\t},\n\t{\n\t\tkeyCombination: { character: '[[' },\n\t\tdescription: __( 'Insert a link to a post or page.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primary', character: 'u' },\n\t\tdescription: __( 'Underline the selected text.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'access', character: 'd' },\n\t\tdescription: __( 'Strikethrough the selected text.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'access', character: 'x' },\n\t\tdescription: __( 'Make the selected text inline code.' ),\n\t},\n\t{\n\t\tkeyCombination: {
|
|
1
|
+
{"version":3,"names":["_i18n","require","textFormattingShortcuts","exports","keyCombination","modifier","character","description","__","aliases"],"sources":["@wordpress/edit-widgets/src/components/keyboard-shortcut-help-modal/config.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\nexport const textFormattingShortcuts = [\n\t{\n\t\tkeyCombination: { modifier: 'primary', character: 'b' },\n\t\tdescription: __( 'Make the selected text bold.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primary', character: 'i' },\n\t\tdescription: __( 'Make the selected text italic.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primary', character: 'k' },\n\t\tdescription: __( 'Convert the selected text into a link.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primaryShift', character: 'k' },\n\t\tdescription: __( 'Remove a link.' ),\n\t},\n\t{\n\t\tkeyCombination: { character: '[[' },\n\t\tdescription: __( 'Insert a link to a post or page.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primary', character: 'u' },\n\t\tdescription: __( 'Underline the selected text.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'access', character: 'd' },\n\t\tdescription: __( 'Strikethrough the selected text.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'access', character: 'x' },\n\t\tdescription: __( 'Make the selected text inline code.' ),\n\t},\n\t{\n\t\tkeyCombination: {\n\t\t\tmodifier: 'access',\n\t\t\tcharacter: '0',\n\t\t},\n\t\taliases: [\n\t\t\t{\n\t\t\t\tmodifier: 'access',\n\t\t\t\tcharacter: '7',\n\t\t\t},\n\t\t],\n\t\tdescription: __( 'Convert the current heading to a paragraph.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'access', character: '1-6' },\n\t\tdescription: __(\n\t\t\t'Convert the current paragraph or heading to a heading of level 1 to 6.'\n\t\t),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primaryShift', character: 'SPACE' },\n\t\tdescription: __( 'Add non breaking space.' ),\n\t},\n];\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGO,MAAMC,uBAAuB,GAAAC,OAAA,CAAAD,uBAAA,GAAG,CACtC;EACCE,cAAc,EAAE;IAAEC,QAAQ,EAAE,SAAS;IAAEC,SAAS,EAAE;EAAI,CAAC;EACvDC,WAAW,EAAE,IAAAC,QAAE,EAAE,8BAA+B;AACjD,CAAC,EACD;EACCJ,cAAc,EAAE;IAAEC,QAAQ,EAAE,SAAS;IAAEC,SAAS,EAAE;EAAI,CAAC;EACvDC,WAAW,EAAE,IAAAC,QAAE,EAAE,gCAAiC;AACnD,CAAC,EACD;EACCJ,cAAc,EAAE;IAAEC,QAAQ,EAAE,SAAS;IAAEC,SAAS,EAAE;EAAI,CAAC;EACvDC,WAAW,EAAE,IAAAC,QAAE,EAAE,wCAAyC;AAC3D,CAAC,EACD;EACCJ,cAAc,EAAE;IAAEC,QAAQ,EAAE,cAAc;IAAEC,SAAS,EAAE;EAAI,CAAC;EAC5DC,WAAW,EAAE,IAAAC,QAAE,EAAE,gBAAiB;AACnC,CAAC,EACD;EACCJ,cAAc,EAAE;IAAEE,SAAS,EAAE;EAAK,CAAC;EACnCC,WAAW,EAAE,IAAAC,QAAE,EAAE,kCAAmC;AACrD,CAAC,EACD;EACCJ,cAAc,EAAE;IAAEC,QAAQ,EAAE,SAAS;IAAEC,SAAS,EAAE;EAAI,CAAC;EACvDC,WAAW,EAAE,IAAAC,QAAE,EAAE,8BAA+B;AACjD,CAAC,EACD;EACCJ,cAAc,EAAE;IAAEC,QAAQ,EAAE,QAAQ;IAAEC,SAAS,EAAE;EAAI,CAAC;EACtDC,WAAW,EAAE,IAAAC,QAAE,EAAE,kCAAmC;AACrD,CAAC,EACD;EACCJ,cAAc,EAAE;IAAEC,QAAQ,EAAE,QAAQ;IAAEC,SAAS,EAAE;EAAI,CAAC;EACtDC,WAAW,EAAE,IAAAC,QAAE,EAAE,qCAAsC;AACxD,CAAC,EACD;EACCJ,cAAc,EAAE;IACfC,QAAQ,EAAE,QAAQ;IAClBC,SAAS,EAAE;EACZ,CAAC;EACDG,OAAO,EAAE,CACR;IACCJ,QAAQ,EAAE,QAAQ;IAClBC,SAAS,EAAE;EACZ,CAAC,CACD;EACDC,WAAW,EAAE,IAAAC,QAAE,EAAE,6CAA8C;AAChE,CAAC,EACD;EACCJ,cAAc,EAAE;IAAEC,QAAQ,EAAE,QAAQ;IAAEC,SAAS,EAAE;EAAM,CAAC;EACxDC,WAAW,EAAE,IAAAC,QAAE,EACd,wEACD;AACD,CAAC,EACD;EACCJ,cAAc,EAAE;IAAEC,QAAQ,EAAE,cAAc;IAAEC,SAAS,EAAE;EAAQ,CAAC;EAChEC,WAAW,EAAE,IAAAC,QAAE,EAAE,yBAA0B;AAC5C,CAAC,CACD","ignoreList":[]}
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = KeyboardShortcutHelpModal;
|
|
8
8
|
var _react = require("react");
|
|
9
|
-
var
|
|
9
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
10
10
|
var _components = require("@wordpress/components");
|
|
11
11
|
var _i18n = require("@wordpress/i18n");
|
|
12
12
|
var _keyboardShortcuts = require("@wordpress/keyboard-shortcuts");
|
|
@@ -51,7 +51,7 @@ const ShortcutSection = ({
|
|
|
51
51
|
shortcuts,
|
|
52
52
|
className
|
|
53
53
|
}) => (0, _react.createElement)("section", {
|
|
54
|
-
className: (0,
|
|
54
|
+
className: (0, _clsx.default)('edit-widgets-keyboard-shortcut-help-modal__section', className)
|
|
55
55
|
}, !!title && (0, _react.createElement)("h2", {
|
|
56
56
|
className: "edit-widgets-keyboard-shortcut-help-modal__section-title"
|
|
57
57
|
}, title), (0, _react.createElement)(ShortcutList, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_i18n","_keyboardShortcuts","_data","_config","_shortcut","_dynamicShortcut","ShortcutList","shortcuts","_react","createElement","className","role","map","shortcut","index","key","default","name","ShortcutSection","title","clsx","ShortcutCategorySection","categoryName","additionalShortcuts","categoryShortcuts","useSelect","select","keyboardShortcutsStore","getCategoryShortcuts","concat","KeyboardShortcutHelpModal","isModalActive","toggleModal","useShortcut","bindGlobal","Modal","__","onRequestClose","keyCombination","character","description","ariaLabel","textFormattingShortcuts"],"sources":["@wordpress/edit-widgets/src/components/keyboard-shortcut-help-modal/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\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{ 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={ clsx(\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\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\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'List View shortcuts' ) }\n\t\t\t\tcategoryName=\"list-view\"\n\t\t\t/>\n\t\t</Modal>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAH,OAAA;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pBC,mBAAmB,EAAG,CACrB;MACCe,cAAc,EAAE;QAAEC,SAAS,EAAE;MAAI,CAAC;MAClCC,WAAW,EAAE,IAAAJ,QAAE,EACd,qDACD,CAAC;MACD;MACAK,SAAS,EAAE,IAAAL,QAAE,EAAE,eAAgB;IAChC,CAAC;EACC,CACH,CAAC,EACF,IAAA5B,MAAA,CAAAC,aAAA,EAACS,eAAe;IACfC,KAAK,EAAG,IAAAiB,QAAE,EAAE,iBAAkB,CAAG;IACjC7B,SAAS,EAAGmC;EAAyB,CACrC,CAAC,EACF,IAAAlC,MAAA,CAAAC,aAAA,EAACY,uBAAuB;IACvBF,KAAK,EAAG,IAAAiB,QAAE,EAAE,qBAAsB,CAAG;IACrCd,YAAY,EAAC;EAAW,CACxB,CACK,CAAC;AAEV","ignoreList":[]}
|
|
@@ -10,8 +10,6 @@ var _keycodes = require("@wordpress/keycodes");
|
|
|
10
10
|
var _data = require("@wordpress/data");
|
|
11
11
|
var _i18n = require("@wordpress/i18n");
|
|
12
12
|
var _coreData = require("@wordpress/core-data");
|
|
13
|
-
var _blockEditor = require("@wordpress/block-editor");
|
|
14
|
-
var _blocks = require("@wordpress/blocks");
|
|
15
13
|
var _store = require("../../store");
|
|
16
14
|
/**
|
|
17
15
|
* WordPress dependencies
|
|
@@ -29,36 +27,6 @@ function KeyboardShortcuts() {
|
|
|
29
27
|
const {
|
|
30
28
|
saveEditedWidgetAreas
|
|
31
29
|
} = (0, _data.useDispatch)(_store.store);
|
|
32
|
-
const {
|
|
33
|
-
replaceBlocks
|
|
34
|
-
} = (0, _data.useDispatch)(_blockEditor.store);
|
|
35
|
-
const {
|
|
36
|
-
getBlockName,
|
|
37
|
-
getSelectedBlockClientId,
|
|
38
|
-
getBlockAttributes
|
|
39
|
-
} = (0, _data.useSelect)(_blockEditor.store);
|
|
40
|
-
const handleTextLevelShortcut = (event, level) => {
|
|
41
|
-
event.preventDefault();
|
|
42
|
-
const destinationBlockName = level === 0 ? 'core/paragraph' : 'core/heading';
|
|
43
|
-
const currentClientId = getSelectedBlockClientId();
|
|
44
|
-
if (currentClientId === null) {
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
const blockName = getBlockName(currentClientId);
|
|
48
|
-
if (blockName !== 'core/paragraph' && blockName !== 'core/heading') {
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
const attributes = getBlockAttributes(currentClientId);
|
|
52
|
-
const textAlign = blockName === 'core/paragraph' ? 'align' : 'textAlign';
|
|
53
|
-
const destinationTextAlign = destinationBlockName === 'core/paragraph' ? 'align' : 'textAlign';
|
|
54
|
-
replaceBlocks(currentClientId, (0, _blocks.createBlock)(destinationBlockName, {
|
|
55
|
-
level,
|
|
56
|
-
content: attributes.content,
|
|
57
|
-
...{
|
|
58
|
-
[destinationTextAlign]: attributes[textAlign]
|
|
59
|
-
}
|
|
60
|
-
}));
|
|
61
|
-
};
|
|
62
30
|
(0, _keyboardShortcuts.useShortcut)('core/edit-widgets/undo', event => {
|
|
63
31
|
undo();
|
|
64
32
|
event.preventDefault();
|
|
@@ -71,13 +39,6 @@ function KeyboardShortcuts() {
|
|
|
71
39
|
event.preventDefault();
|
|
72
40
|
saveEditedWidgetAreas();
|
|
73
41
|
});
|
|
74
|
-
(0, _keyboardShortcuts.useShortcut)('core/edit-widgets/transform-heading-to-paragraph', event => handleTextLevelShortcut(event, 0));
|
|
75
|
-
[1, 2, 3, 4, 5, 6].forEach(level => {
|
|
76
|
-
//the loop is based off on a constant therefore
|
|
77
|
-
//the hook will execute the same way every time
|
|
78
|
-
//eslint-disable-next-line react-hooks/rules-of-hooks
|
|
79
|
-
(0, _keyboardShortcuts.useShortcut)(`core/edit-widgets/transform-paragraph-to-heading-${level}`, event => handleTextLevelShortcut(event, level));
|
|
80
|
-
});
|
|
81
42
|
return null;
|
|
82
43
|
}
|
|
83
44
|
function KeyboardShortcutsRegister() {
|
|
@@ -159,26 +120,6 @@ function KeyboardShortcutsRegister() {
|
|
|
159
120
|
character: '~'
|
|
160
121
|
}]
|
|
161
122
|
});
|
|
162
|
-
registerShortcut({
|
|
163
|
-
name: 'core/edit-widgets/transform-heading-to-paragraph',
|
|
164
|
-
category: 'block-library',
|
|
165
|
-
description: (0, _i18n.__)('Transform heading to paragraph.'),
|
|
166
|
-
keyCombination: {
|
|
167
|
-
modifier: 'access',
|
|
168
|
-
character: `0`
|
|
169
|
-
}
|
|
170
|
-
});
|
|
171
|
-
[1, 2, 3, 4, 5, 6].forEach(level => {
|
|
172
|
-
registerShortcut({
|
|
173
|
-
name: `core/edit-widgets/transform-paragraph-to-heading-${level}`,
|
|
174
|
-
category: 'block-library',
|
|
175
|
-
description: (0, _i18n.__)('Transform paragraph to heading.'),
|
|
176
|
-
keyCombination: {
|
|
177
|
-
modifier: 'access',
|
|
178
|
-
character: `${level}`
|
|
179
|
-
}
|
|
180
|
-
});
|
|
181
|
-
});
|
|
182
123
|
}, [registerShortcut]);
|
|
183
124
|
return null;
|
|
184
125
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_keyboardShortcuts","_keycodes","_data","_i18n","_coreData","_blockEditor","_blocks","_store","KeyboardShortcuts","redo","undo","useDispatch","coreStore","saveEditedWidgetAreas","editWidgetsStore","replaceBlocks","blockEditorStore","getBlockName","getSelectedBlockClientId","getBlockAttributes","useSelect","handleTextLevelShortcut","event","level","preventDefault","destinationBlockName","currentClientId","blockName","attributes","textAlign","destinationTextAlign","createBlock","content","useShortcut","forEach","KeyboardShortcutsRegister","registerShortcut","keyboardShortcutsStore","useEffect","name","category","description","__","keyCombination","modifier","character","aliases","isAppleOS","Register","_default","exports","default"],"sources":["@wordpress/edit-widgets/src/components/keyboard-shortcuts/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { isAppleOS } from '@wordpress/keycodes';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { createBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as editWidgetsStore } from '../../store';\n\nfunction KeyboardShortcuts() {\n\tconst { redo, undo } = useDispatch( coreStore );\n\tconst { saveEditedWidgetAreas } = useDispatch( editWidgetsStore );\n\n\tconst { replaceBlocks } = useDispatch( blockEditorStore );\n\tconst { getBlockName, getSelectedBlockClientId, getBlockAttributes } =\n\t\tuseSelect( blockEditorStore );\n\n\tconst handleTextLevelShortcut = ( event, level ) => {\n\t\tevent.preventDefault();\n\t\tconst destinationBlockName =\n\t\t\tlevel === 0 ? 'core/paragraph' : 'core/heading';\n\t\tconst currentClientId = getSelectedBlockClientId();\n\t\tif ( currentClientId === null ) {\n\t\t\treturn;\n\t\t}\n\t\tconst blockName = getBlockName( currentClientId );\n\t\tif ( blockName !== 'core/paragraph' && blockName !== 'core/heading' ) {\n\t\t\treturn;\n\t\t}\n\t\tconst attributes = getBlockAttributes( currentClientId );\n\t\tconst textAlign =\n\t\t\tblockName === 'core/paragraph' ? 'align' : 'textAlign';\n\t\tconst destinationTextAlign =\n\t\t\tdestinationBlockName === 'core/paragraph' ? 'align' : 'textAlign';\n\n\t\treplaceBlocks(\n\t\t\tcurrentClientId,\n\t\t\tcreateBlock( destinationBlockName, {\n\t\t\t\tlevel,\n\t\t\t\tcontent: attributes.content,\n\t\t\t\t...{ [ destinationTextAlign ]: attributes[ textAlign ] },\n\t\t\t} )\n\t\t);\n\t};\n\n\tuseShortcut( 'core/edit-widgets/undo', ( event ) => {\n\t\tundo();\n\t\tevent.preventDefault();\n\t} );\n\n\tuseShortcut( 'core/edit-widgets/redo', ( event ) => {\n\t\tredo();\n\t\tevent.preventDefault();\n\t} );\n\n\tuseShortcut( 'core/edit-widgets/save', ( event ) => {\n\t\tevent.preventDefault();\n\t\tsaveEditedWidgetAreas();\n\t} );\n\n\tuseShortcut(\n\t\t'core/edit-widgets/transform-heading-to-paragraph',\n\t\t( event ) => handleTextLevelShortcut( event, 0 )\n\t);\n\n\t[ 1, 2, 3, 4, 5, 6 ].forEach( ( level ) => {\n\t\t//the loop is based off on a constant therefore\n\t\t//the hook will execute the same way every time\n\t\t//eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tuseShortcut(\n\t\t\t`core/edit-widgets/transform-paragraph-to-heading-${ level }`,\n\t\t\t( event ) => handleTextLevelShortcut( event, level )\n\t\t);\n\t} );\n\n\treturn null;\n}\n\nfunction KeyboardShortcutsRegister() {\n\t// Registering the shortcuts.\n\tconst { registerShortcut } = useDispatch( keyboardShortcutsStore );\n\tuseEffect( () => {\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-widgets/undo',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Undo your last changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 'z',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-widgets/redo',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Redo your last undo.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primaryShift',\n\t\t\t\tcharacter: 'z',\n\t\t\t},\n\t\t\t// Disable on Apple OS because it conflicts with the browser's\n\t\t\t// history shortcut. It's a fine alias for both Windows and Linux.\n\t\t\t// Since there's no conflict for Ctrl+Shift+Z on both Windows and\n\t\t\t// Linux, we keep it as the default for consistency.\n\t\t\taliases: isAppleOS()\n\t\t\t\t? []\n\t\t\t\t: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmodifier: 'primary',\n\t\t\t\t\t\t\tcharacter: 'y',\n\t\t\t\t\t\t},\n\t\t\t\t ],\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-widgets/save',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Save your changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 's',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-widgets/keyboard-shortcuts',\n\t\t\tcategory: 'main',\n\t\t\tdescription: __( 'Display these keyboard shortcuts.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'access',\n\t\t\t\tcharacter: 'h',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-widgets/next-region',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Navigate to the next part of the editor.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'ctrl',\n\t\t\t\tcharacter: '`',\n\t\t\t},\n\t\t\taliases: [\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: 'n',\n\t\t\t\t},\n\t\t\t],\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-widgets/previous-region',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Navigate to the previous part of the editor.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'ctrlShift',\n\t\t\t\tcharacter: '`',\n\t\t\t},\n\t\t\taliases: [\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: 'p',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'ctrlShift',\n\t\t\t\t\tcharacter: '~',\n\t\t\t\t},\n\t\t\t],\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-widgets/transform-heading-to-paragraph',\n\t\t\tcategory: 'block-library',\n\t\t\tdescription: __( 'Transform heading to paragraph.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'access',\n\t\t\t\tcharacter: `0`,\n\t\t\t},\n\t\t} );\n\n\t\t[ 1, 2, 3, 4, 5, 6 ].forEach( ( level ) => {\n\t\t\tregisterShortcut( {\n\t\t\t\tname: `core/edit-widgets/transform-paragraph-to-heading-${ level }`,\n\t\t\t\tcategory: 'block-library',\n\t\t\t\tdescription: __( 'Transform paragraph to heading.' ),\n\t\t\t\tkeyCombination: {\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: `${ level }`,\n\t\t\t\t},\n\t\t\t} );\n\t\t} );\n\t}, [ registerShortcut ] );\n\n\treturn null;\n}\n\nKeyboardShortcuts.Register = KeyboardShortcutsRegister;\nexport default KeyboardShortcuts;\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AAIA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AAKA,IAAAQ,MAAA,GAAAR,OAAA;AAlBA;AACA;AACA;;AAaA;AACA;AACA;;AAGA,SAASS,iBAAiBA,CAAA,EAAG;EAC5B,MAAM;IAAEC,IAAI;IAAEC;EAAK,CAAC,GAAG,IAAAC,iBAAW,EAAEC,eAAU,CAAC;EAC/C,MAAM;IAAEC;EAAsB,CAAC,GAAG,IAAAF,iBAAW,EAAEG,YAAiB,CAAC;EAEjE,MAAM;IAAEC;EAAc,CAAC,GAAG,IAAAJ,iBAAW,EAAEK,kBAAiB,CAAC;EACzD,MAAM;IAAEC,YAAY;IAAEC,wBAAwB;IAAEC;EAAmB,CAAC,GACnE,IAAAC,eAAS,EAAEJ,kBAAiB,CAAC;EAE9B,MAAMK,uBAAuB,GAAGA,CAAEC,KAAK,EAAEC,KAAK,KAAM;IACnDD,KAAK,CAACE,cAAc,CAAC,CAAC;IACtB,MAAMC,oBAAoB,GACzBF,KAAK,KAAK,CAAC,GAAG,gBAAgB,GAAG,cAAc;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Ae;QACzBC,WAAW,EAAE,IAAAC,QAAE,EAAE,iCAAkC,CAAC;QACpDC,cAAc,EAAE;UACfC,QAAQ,EAAE,QAAQ;UAClBC,SAAS,EAAG,GAAGtB,KAAO;QACvB;MACD,CAAE,CAAC;IACJ,CAAE,CAAC;EACJ,CAAC,EAAE,CAAEa,gBAAgB,CAAG,CAAC;EAEzB,OAAO,IAAI;AACZ;AAEA5B,iBAAiB,CAACwC,QAAQ,GAAGb,yBAAyB;AAAC,IAAAc,QAAA,GAAAC,OAAA,CAAAC,OAAA,GACxC3C,iBAAiB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_element","require","_keyboardShortcuts","_keycodes","_data","_i18n","_coreData","_store","KeyboardShortcuts","redo","undo","useDispatch","coreStore","saveEditedWidgetAreas","editWidgetsStore","useShortcut","event","preventDefault","KeyboardShortcutsRegister","registerShortcut","keyboardShortcutsStore","useEffect","name","category","description","__","keyCombination","modifier","character","aliases","isAppleOS","Register","_default","exports","default"],"sources":["@wordpress/edit-widgets/src/components/keyboard-shortcuts/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { isAppleOS } from '@wordpress/keycodes';\nimport { useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editWidgetsStore } from '../../store';\n\nfunction KeyboardShortcuts() {\n\tconst { redo, undo } = useDispatch( coreStore );\n\tconst { saveEditedWidgetAreas } = useDispatch( editWidgetsStore );\n\n\tuseShortcut( 'core/edit-widgets/undo', ( event ) => {\n\t\tundo();\n\t\tevent.preventDefault();\n\t} );\n\n\tuseShortcut( 'core/edit-widgets/redo', ( event ) => {\n\t\tredo();\n\t\tevent.preventDefault();\n\t} );\n\n\tuseShortcut( 'core/edit-widgets/save', ( event ) => {\n\t\tevent.preventDefault();\n\t\tsaveEditedWidgetAreas();\n\t} );\n\n\treturn null;\n}\n\nfunction KeyboardShortcutsRegister() {\n\t// Registering the shortcuts.\n\tconst { registerShortcut } = useDispatch( keyboardShortcutsStore );\n\tuseEffect( () => {\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-widgets/undo',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Undo your last changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 'z',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-widgets/redo',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Redo your last undo.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primaryShift',\n\t\t\t\tcharacter: 'z',\n\t\t\t},\n\t\t\t// Disable on Apple OS because it conflicts with the browser's\n\t\t\t// history shortcut. It's a fine alias for both Windows and Linux.\n\t\t\t// Since there's no conflict for Ctrl+Shift+Z on both Windows and\n\t\t\t// Linux, we keep it as the default for consistency.\n\t\t\taliases: isAppleOS()\n\t\t\t\t? []\n\t\t\t\t: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmodifier: 'primary',\n\t\t\t\t\t\t\tcharacter: 'y',\n\t\t\t\t\t\t},\n\t\t\t\t ],\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-widgets/save',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Save your changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 's',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-widgets/keyboard-shortcuts',\n\t\t\tcategory: 'main',\n\t\t\tdescription: __( 'Display these keyboard shortcuts.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'access',\n\t\t\t\tcharacter: 'h',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-widgets/next-region',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Navigate to the next part of the editor.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'ctrl',\n\t\t\t\tcharacter: '`',\n\t\t\t},\n\t\t\taliases: [\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: 'n',\n\t\t\t\t},\n\t\t\t],\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-widgets/previous-region',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Navigate to the previous part of the editor.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'ctrlShift',\n\t\t\t\tcharacter: '`',\n\t\t\t},\n\t\t\taliases: [\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: 'p',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'ctrlShift',\n\t\t\t\t\tcharacter: '~',\n\t\t\t\t},\n\t\t\t],\n\t\t} );\n\t}, [ registerShortcut ] );\n\n\treturn null;\n}\n\nKeyboardShortcuts.Register = KeyboardShortcutsRegister;\nexport default KeyboardShortcuts;\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AAIA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AAKA,IAAAM,MAAA,GAAAN,OAAA;AAhBA;AACA;AACA;;AAWA;AACA;AACA;;AAGA,SAASO,iBAAiBA,CAAA,EAAG;EAC5B,MAAM;IAAEC,IAAI;IAAEC;EAAK,CAAC,GAAG,IAAAC,iBAAW,EAAEC,eAAU,CAAC;EAC/C,MAAM;IAAEC;EAAsB,CAAC,GAAG,IAAAF,iBAAW,EA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ignoreList":[]}
|
|
@@ -38,12 +38,9 @@ function InserterSidebar() {
|
|
|
38
38
|
const TagName = !isMobileViewport ? _components.VisuallyHidden : 'div';
|
|
39
39
|
const [inserterDialogRef, inserterDialogProps] = (0, _compose.__experimentalUseDialog)({
|
|
40
40
|
onClose: closeInserter,
|
|
41
|
-
focusOnMount:
|
|
41
|
+
focusOnMount: true
|
|
42
42
|
});
|
|
43
43
|
const libraryRef = (0, _element.useRef)();
|
|
44
|
-
(0, _element.useEffect)(() => {
|
|
45
|
-
libraryRef.current.focusSearch();
|
|
46
|
-
}, []);
|
|
47
44
|
return (0, _react.createElement)("div", {
|
|
48
45
|
ref: inserterDialogRef,
|
|
49
46
|
...inserterDialogProps,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_icons","_blockEditor","_compose","_element","_data","_i18n","_useWidgetLibraryInsertionPoint","_interopRequireDefault","_store","InserterSidebar","isMobileViewport","useViewportMatch","rootClientId","insertionIndex","useWidgetLibraryInsertionPoint","setIsInserterOpened","useDispatch","editWidgetsStore","closeInserter","useCallback","TagName","VisuallyHidden","inserterDialogRef","inserterDialogProps","useDialog","onClose","focusOnMount","libraryRef","useRef","
|
|
1
|
+
{"version":3,"names":["_components","require","_icons","_blockEditor","_compose","_element","_data","_i18n","_useWidgetLibraryInsertionPoint","_interopRequireDefault","_store","InserterSidebar","isMobileViewport","useViewportMatch","rootClientId","insertionIndex","useWidgetLibraryInsertionPoint","setIsInserterOpened","useDispatch","editWidgetsStore","closeInserter","useCallback","TagName","VisuallyHidden","inserterDialogRef","inserterDialogProps","useDialog","onClose","focusOnMount","libraryRef","useRef","_react","createElement","ref","className","Button","icon","close","onClick","label","__","__experimentalLibrary","showInserterHelpPanel","shouldFocusBlock","__experimentalInsertionIndex"],"sources":["@wordpress/edit-widgets/src/components/secondary-sidebar/inserter-sidebar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button, VisuallyHidden } from '@wordpress/components';\nimport { close } from '@wordpress/icons';\nimport { __experimentalLibrary as Library } from '@wordpress/block-editor';\nimport {\n\tuseViewportMatch,\n\t__experimentalUseDialog as useDialog,\n} from '@wordpress/compose';\nimport { useCallback, useRef } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport useWidgetLibraryInsertionPoint from '../../hooks/use-widget-library-insertion-point';\nimport { store as editWidgetsStore } from '../../store';\n\nexport default function InserterSidebar() {\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst { rootClientId, insertionIndex } = useWidgetLibraryInsertionPoint();\n\n\tconst { setIsInserterOpened } = useDispatch( editWidgetsStore );\n\n\tconst closeInserter = useCallback( () => {\n\t\treturn setIsInserterOpened( false );\n\t}, [ setIsInserterOpened ] );\n\n\tconst TagName = ! isMobileViewport ? VisuallyHidden : 'div';\n\tconst [ inserterDialogRef, inserterDialogProps ] = useDialog( {\n\t\tonClose: closeInserter,\n\t\tfocusOnMount: true,\n\t} );\n\n\tconst libraryRef = useRef();\n\n\treturn (\n\t\t<div\n\t\t\tref={ inserterDialogRef }\n\t\t\t{ ...inserterDialogProps }\n\t\t\tclassName=\"edit-widgets-layout__inserter-panel\"\n\t\t>\n\t\t\t<TagName className=\"edit-widgets-layout__inserter-panel-header\">\n\t\t\t\t<Button\n\t\t\t\t\ticon={ close }\n\t\t\t\t\tonClick={ closeInserter }\n\t\t\t\t\tlabel={ __( 'Close block inserter' ) }\n\t\t\t\t/>\n\t\t\t</TagName>\n\t\t\t<div className=\"edit-widgets-layout__inserter-panel-content\">\n\t\t\t\t<Library\n\t\t\t\t\tshowInserterHelpPanel\n\t\t\t\t\tshouldFocusBlock={ isMobileViewport }\n\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t__experimentalInsertionIndex={ insertionIndex }\n\t\t\t\t\tref={ libraryRef }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;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A,CAAAmC,MAAM;IACNC,IAAI,EAAGC,YAAO;IACdC,OAAO,EAAGlB,aAAe;IACzBmB,KAAK,EAAG,IAAAC,QAAE,EAAE,sBAAuB;EAAG,CACtC,CACO,CAAC,EACV,IAAAT,MAAA,CAAAC,aAAA;IAAKE,SAAS,EAAC;EAA6C,GAC3D,IAAAH,MAAA,CAAAC,aAAA,EAAC7B,YAAA,CAAAsC,qBAAO;IACPC,qBAAqB;IACrBC,gBAAgB,EAAG/B,gBAAkB;IACrCE,YAAY,EAAGA,YAAc;IAC7B8B,4BAA4B,EAAG7B,cAAgB;IAC/CkB,GAAG,EAAGJ;EAAY,CAClB,CACG,CACD,CAAC;AAER","ignoreList":[]}
|
|
@@ -15,6 +15,7 @@ var _element = require("@wordpress/element");
|
|
|
15
15
|
var _blockEditor = require("@wordpress/block-editor");
|
|
16
16
|
var _patterns = require("@wordpress/patterns");
|
|
17
17
|
var _preferences = require("@wordpress/preferences");
|
|
18
|
+
var _blockLibrary = require("@wordpress/block-library");
|
|
18
19
|
var _keyboardShortcuts = _interopRequireDefault(require("../keyboard-shortcuts"));
|
|
19
20
|
var _utils = require("../../store/utils");
|
|
20
21
|
var _useLastSelectedWidgetArea = _interopRequireDefault(require("../../hooks/use-last-selected-widget-area"));
|
|
@@ -35,6 +36,9 @@ const {
|
|
|
35
36
|
const {
|
|
36
37
|
PatternsMenuItems
|
|
37
38
|
} = (0, _lockUnlock.unlock)(_patterns.privateApis);
|
|
39
|
+
const {
|
|
40
|
+
BlockKeyboardShortcuts
|
|
41
|
+
} = (0, _lockUnlock.unlock)(_blockLibrary.privateApis);
|
|
38
42
|
function WidgetAreasBlockEditorProvider({
|
|
39
43
|
blockEditorSettings,
|
|
40
44
|
children,
|
|
@@ -100,7 +104,7 @@ function WidgetAreasBlockEditorProvider({
|
|
|
100
104
|
const [blocks, onInput, onChange] = (0, _coreData.useEntityBlockEditor)(_utils.KIND, _utils.POST_TYPE, {
|
|
101
105
|
id: (0, _utils.buildWidgetAreasPostId)()
|
|
102
106
|
});
|
|
103
|
-
return (0, _react.createElement)(_components.SlotFillProvider, null, (0, _react.createElement)(_keyboardShortcuts.default.Register, null), (0, _react.createElement)(ExperimentalBlockEditorProvider, {
|
|
107
|
+
return (0, _react.createElement)(_components.SlotFillProvider, null, (0, _react.createElement)(_keyboardShortcuts.default.Register, null), (0, _react.createElement)(BlockKeyboardShortcuts, null), (0, _react.createElement)(ExperimentalBlockEditorProvider, {
|
|
104
108
|
value: blocks,
|
|
105
109
|
onInput: onInput,
|
|
106
110
|
onChange: onChange,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_compose","_mediaUtils","_data","_coreData","_element","_blockEditor","_patterns","_preferences","_keyboardShortcuts","_interopRequireDefault","_utils","_useLastSelectedWidgetArea","_store","_constants","_lockUnlock","ExperimentalBlockEditorProvider","unlock","blockEditorPrivateApis","PatternsMenuItems","editPatternsPrivateApis","WidgetAreasBlockEditorProvider","blockEditorSettings","children","props","mediaPermissions","useResourcePermissions","isLargeViewport","useViewportMatch","reusableBlocks","isFixedToolbarActive","keepCaretInsideBlock","pageOnFront","pageForPosts","useSelect","select","canUser","getEntityRecord","getEntityRecords","coreStore","siteSettings","undefined","widgetAreas","editWidgetsStore","getWidgetAreas","widgets","getWidgets","ALLOW_REUSABLE_BLOCKS","preferencesStore","get","page_on_front","page_for_posts","setIsInserterOpened","useDispatch","settings","useMemo","mediaUploadBlockEditor","canCreate","onError","argumentsObject","uploadMedia","wpAllowedMimeTypes","allowedMimeTypes","message","__experimentalReusableBlocks","hasFixedToolbar","mediaUpload","templateLock","__experimentalSetIsInserterOpened","widgetAreaId","useLastSelectedWidgetArea","blocks","onInput","onChange","useEntityBlockEditor","KIND","POST_TYPE","id","buildWidgetAreasPostId","_react","createElement","SlotFillProvider","default","Register","value","useSubRegistry","rootClientId"],"sources":["@wordpress/edit-widgets/src/components/widget-areas-block-editor-provider/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SlotFillProvider } from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { uploadMedia } from '@wordpress/media-utils';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tuseEntityBlockEditor,\n\tstore as coreStore,\n\tuseResourcePermissions,\n} from '@wordpress/core-data';\nimport { useMemo } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { privateApis as editPatternsPrivateApis } from '@wordpress/patterns';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport KeyboardShortcuts from '../keyboard-shortcuts';\nimport { buildWidgetAreasPostId, KIND, POST_TYPE } from '../../store/utils';\nimport useLastSelectedWidgetArea from '../../hooks/use-last-selected-widget-area';\nimport { store as editWidgetsStore } from '../../store';\nimport { ALLOW_REUSABLE_BLOCKS } from '../../constants';\nimport { unlock } from '../../lock-unlock';\n\nconst { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );\nconst { PatternsMenuItems } = unlock( editPatternsPrivateApis );\nexport default function WidgetAreasBlockEditorProvider( {\n\tblockEditorSettings,\n\tchildren,\n\t...props\n} ) {\n\tconst mediaPermissions = useResourcePermissions( 'media' );\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst {\n\t\treusableBlocks,\n\t\tisFixedToolbarActive,\n\t\tkeepCaretInsideBlock,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t} = useSelect( ( select ) => {\n\t\tconst { canUser, getEntityRecord, getEntityRecords } =\n\t\t\tselect( coreStore );\n\t\tconst siteSettings = canUser( 'read', 'settings' )\n\t\t\t? getEntityRecord( 'root', 'site' )\n\t\t\t: undefined;\n\t\treturn {\n\t\t\twidgetAreas: select( editWidgetsStore ).getWidgetAreas(),\n\t\t\twidgets: select( editWidgetsStore ).getWidgets(),\n\t\t\treusableBlocks: ALLOW_REUSABLE_BLOCKS\n\t\t\t\t? getEntityRecords( 'postType', 'wp_block' )\n\t\t\t\t: [],\n\t\t\tisFixedToolbarActive: !! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'fixedToolbar'\n\t\t\t),\n\t\t\tkeepCaretInsideBlock: !! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'keepCaretInsideBlock'\n\t\t\t),\n\t\t\tpageOnFront: siteSettings?.page_on_front,\n\t\t\tpageForPosts: siteSettings?.page_for_posts,\n\t\t};\n\t}, [] );\n\tconst { setIsInserterOpened } = useDispatch( editWidgetsStore );\n\n\tconst settings = useMemo( () => {\n\t\tlet mediaUploadBlockEditor;\n\t\tif ( mediaPermissions.canCreate ) {\n\t\t\tmediaUploadBlockEditor = ( { onError, ...argumentsObject } ) => {\n\t\t\t\tuploadMedia( {\n\t\t\t\t\twpAllowedMimeTypes: blockEditorSettings.allowedMimeTypes,\n\t\t\t\t\tonError: ( { message } ) => onError( message ),\n\t\t\t\t\t...argumentsObject,\n\t\t\t\t} );\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t...blockEditorSettings,\n\t\t\t__experimentalReusableBlocks: reusableBlocks,\n\t\t\thasFixedToolbar: isFixedToolbarActive || ! isLargeViewport,\n\t\t\tkeepCaretInsideBlock,\n\t\t\tmediaUpload: mediaUploadBlockEditor,\n\t\t\ttemplateLock: 'all',\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpened,\n\t\t\tpageOnFront,\n\t\t\tpageForPosts,\n\t\t};\n\t}, [\n\t\tblockEditorSettings,\n\t\tisFixedToolbarActive,\n\t\tisLargeViewport,\n\t\tkeepCaretInsideBlock,\n\t\tmediaPermissions.canCreate,\n\t\treusableBlocks,\n\t\tsetIsInserterOpened,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t] );\n\n\tconst widgetAreaId = useLastSelectedWidgetArea();\n\n\tconst [ blocks, onInput, onChange ] = useEntityBlockEditor(\n\t\tKIND,\n\t\tPOST_TYPE,\n\t\t{ id: buildWidgetAreasPostId() }\n\t);\n\n\treturn (\n\t\t<SlotFillProvider>\n\t\t\t<KeyboardShortcuts.Register />\n\t\t\t<ExperimentalBlockEditorProvider\n\t\t\t\tvalue={ blocks }\n\t\t\t\tonInput={ onInput }\n\t\t\t\tonChange={ onChange }\n\t\t\t\tsettings={ settings }\n\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t{ ...props }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t\t<PatternsMenuItems rootClientId={ widgetAreaId } />\n\t\t\t</ExperimentalBlockEditorProvider>\n\t\t</SlotFillProvider>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AAKA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAR,OAAA;
|
|
1
|
+
{"version":3,"names":["_components","require","_compose","_mediaUtils","_data","_coreData","_element","_blockEditor","_patterns","_preferences","_blockLibrary","_keyboardShortcuts","_interopRequireDefault","_utils","_useLastSelectedWidgetArea","_store","_constants","_lockUnlock","ExperimentalBlockEditorProvider","unlock","blockEditorPrivateApis","PatternsMenuItems","editPatternsPrivateApis","BlockKeyboardShortcuts","blockLibraryPrivateApis","WidgetAreasBlockEditorProvider","blockEditorSettings","children","props","mediaPermissions","useResourcePermissions","isLargeViewport","useViewportMatch","reusableBlocks","isFixedToolbarActive","keepCaretInsideBlock","pageOnFront","pageForPosts","useSelect","select","canUser","getEntityRecord","getEntityRecords","coreStore","siteSettings","undefined","widgetAreas","editWidgetsStore","getWidgetAreas","widgets","getWidgets","ALLOW_REUSABLE_BLOCKS","preferencesStore","get","page_on_front","page_for_posts","setIsInserterOpened","useDispatch","settings","useMemo","mediaUploadBlockEditor","canCreate","onError","argumentsObject","uploadMedia","wpAllowedMimeTypes","allowedMimeTypes","message","__experimentalReusableBlocks","hasFixedToolbar","mediaUpload","templateLock","__experimentalSetIsInserterOpened","widgetAreaId","useLastSelectedWidgetArea","blocks","onInput","onChange","useEntityBlockEditor","KIND","POST_TYPE","id","buildWidgetAreasPostId","_react","createElement","SlotFillProvider","default","Register","value","useSubRegistry","rootClientId"],"sources":["@wordpress/edit-widgets/src/components/widget-areas-block-editor-provider/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SlotFillProvider } from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { uploadMedia } from '@wordpress/media-utils';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tuseEntityBlockEditor,\n\tstore as coreStore,\n\tuseResourcePermissions,\n} from '@wordpress/core-data';\nimport { useMemo } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { privateApis as editPatternsPrivateApis } from '@wordpress/patterns';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { privateApis as blockLibraryPrivateApis } from '@wordpress/block-library';\n\n/**\n * Internal dependencies\n */\nimport KeyboardShortcuts from '../keyboard-shortcuts';\nimport { buildWidgetAreasPostId, KIND, POST_TYPE } from '../../store/utils';\nimport useLastSelectedWidgetArea from '../../hooks/use-last-selected-widget-area';\nimport { store as editWidgetsStore } from '../../store';\nimport { ALLOW_REUSABLE_BLOCKS } from '../../constants';\nimport { unlock } from '../../lock-unlock';\n\nconst { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );\nconst { PatternsMenuItems } = unlock( editPatternsPrivateApis );\nconst { BlockKeyboardShortcuts } = unlock( blockLibraryPrivateApis );\n\nexport default function WidgetAreasBlockEditorProvider( {\n\tblockEditorSettings,\n\tchildren,\n\t...props\n} ) {\n\tconst mediaPermissions = useResourcePermissions( 'media' );\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst {\n\t\treusableBlocks,\n\t\tisFixedToolbarActive,\n\t\tkeepCaretInsideBlock,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t} = useSelect( ( select ) => {\n\t\tconst { canUser, getEntityRecord, getEntityRecords } =\n\t\t\tselect( coreStore );\n\t\tconst siteSettings = canUser( 'read', 'settings' )\n\t\t\t? getEntityRecord( 'root', 'site' )\n\t\t\t: undefined;\n\t\treturn {\n\t\t\twidgetAreas: select( editWidgetsStore ).getWidgetAreas(),\n\t\t\twidgets: select( editWidgetsStore ).getWidgets(),\n\t\t\treusableBlocks: ALLOW_REUSABLE_BLOCKS\n\t\t\t\t? getEntityRecords( 'postType', 'wp_block' )\n\t\t\t\t: [],\n\t\t\tisFixedToolbarActive: !! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'fixedToolbar'\n\t\t\t),\n\t\t\tkeepCaretInsideBlock: !! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'keepCaretInsideBlock'\n\t\t\t),\n\t\t\tpageOnFront: siteSettings?.page_on_front,\n\t\t\tpageForPosts: siteSettings?.page_for_posts,\n\t\t};\n\t}, [] );\n\tconst { setIsInserterOpened } = useDispatch( editWidgetsStore );\n\n\tconst settings = useMemo( () => {\n\t\tlet mediaUploadBlockEditor;\n\t\tif ( mediaPermissions.canCreate ) {\n\t\t\tmediaUploadBlockEditor = ( { onError, ...argumentsObject } ) => {\n\t\t\t\tuploadMedia( {\n\t\t\t\t\twpAllowedMimeTypes: blockEditorSettings.allowedMimeTypes,\n\t\t\t\t\tonError: ( { message } ) => onError( message ),\n\t\t\t\t\t...argumentsObject,\n\t\t\t\t} );\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t...blockEditorSettings,\n\t\t\t__experimentalReusableBlocks: reusableBlocks,\n\t\t\thasFixedToolbar: isFixedToolbarActive || ! isLargeViewport,\n\t\t\tkeepCaretInsideBlock,\n\t\t\tmediaUpload: mediaUploadBlockEditor,\n\t\t\ttemplateLock: 'all',\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpened,\n\t\t\tpageOnFront,\n\t\t\tpageForPosts,\n\t\t};\n\t}, [\n\t\tblockEditorSettings,\n\t\tisFixedToolbarActive,\n\t\tisLargeViewport,\n\t\tkeepCaretInsideBlock,\n\t\tmediaPermissions.canCreate,\n\t\treusableBlocks,\n\t\tsetIsInserterOpened,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t] );\n\n\tconst widgetAreaId = useLastSelectedWidgetArea();\n\n\tconst [ blocks, onInput, onChange ] = useEntityBlockEditor(\n\t\tKIND,\n\t\tPOST_TYPE,\n\t\t{ id: buildWidgetAreasPostId() }\n\t);\n\n\treturn (\n\t\t<SlotFillProvider>\n\t\t\t<KeyboardShortcuts.Register />\n\t\t\t<BlockKeyboardShortcuts />\n\t\t\t<ExperimentalBlockEditorProvider\n\t\t\t\tvalue={ blocks }\n\t\t\t\tonInput={ onInput }\n\t\t\t\tonChange={ onChange }\n\t\t\t\tsettings={ settings }\n\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t{ ...props }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t\t<PatternsMenuItems rootClientId={ widgetAreaId } />\n\t\t\t</ExperimentalBlockEditorProvider>\n\t\t</SlotFillProvider>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AAKA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAR,OAAA;AACA,IAAAS,aAAA,GAAAT,OAAA;AAKA,IAAAU,kBAAA,GAAAC,sBAAA,CAAAX,OAAA;AACA,IAAAY,MAAA,GAAAZ,OAAA;AACA,IAAAa,0BAAA,G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D,MAAM,CAAEC,MAAM,EAAEC,OAAO,EAAEC,QAAQ,CAAE,GAAG,IAAAC,8BAAoB,EACzDC,WAAI,EACJC,gBAAS,EACT;IAAEC,EAAE,EAAE,IAAAC,6BAAsB,EAAC;EAAE,CAChC,CAAC;EAED,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACpF,WAAA,CAAAqF,gBAAgB,QAChB,IAAAF,MAAA,CAAAC,aAAA,EAACzE,kBAAA,CAAA2E,OAAiB,CAACC,QAAQ,MAAE,CAAC,EAC9B,IAAAJ,MAAA,CAAAC,aAAA,EAAC7D,sBAAsB,MAAE,CAAC,EAC1B,IAAA4D,MAAA,CAAAC,aAAA,EAAClE,+BAA+B;IAC/BsE,KAAK,EAAGb,MAAQ;IAChBC,OAAO,EAAGA,OAAS;IACnBC,QAAQ,EAAGA,QAAU;IACrBnB,QAAQ,EAAGA,QAAU;IACrB+B,cAAc,EAAG,KAAO;IAAA,GACnB7D;EAAK,GAERD,QAAQ,EACV,IAAAwD,MAAA,CAAAC,aAAA,EAAC/D,iBAAiB;IAACqE,YAAY,EAAGjB;EAAc,CAAE,CAClB,CAChB,CAAC;AAErB","ignoreList":[]}
|
|
@@ -3,8 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.getInserterSidebarToggleRef = getInserterSidebarToggleRef;
|
|
6
7
|
exports.getListViewToggleRef = getListViewToggleRef;
|
|
7
8
|
function getListViewToggleRef(state) {
|
|
8
9
|
return state.listViewToggleRef;
|
|
9
10
|
}
|
|
11
|
+
function getInserterSidebarToggleRef(state) {
|
|
12
|
+
return state.inserterSidebarToggleRef;
|
|
13
|
+
}
|
|
10
14
|
//# sourceMappingURL=private-selectors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getListViewToggleRef","state","listViewToggleRef"],"sources":["@wordpress/edit-widgets/src/store/private-selectors.js"],"sourcesContent":["export function getListViewToggleRef( state ) {\n\treturn state.listViewToggleRef;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["getListViewToggleRef","state","listViewToggleRef","getInserterSidebarToggleRef","inserterSidebarToggleRef"],"sources":["@wordpress/edit-widgets/src/store/private-selectors.js"],"sourcesContent":["export function getListViewToggleRef( state ) {\n\treturn state.listViewToggleRef;\n}\n\nexport function getInserterSidebarToggleRef( state ) {\n\treturn state.inserterSidebarToggleRef;\n}\n"],"mappings":";;;;;;;AAAO,SAASA,oBAAoBA,CAAEC,KAAK,EAAG;EAC7C,OAAOA,KAAK,CAACC,iBAAiB;AAC/B;AAEO,SAASC,2BAA2BA,CAAEF,KAAK,EAAG;EACpD,OAAOA,KAAK,CAACG,wBAAwB;AACtC","ignoreList":[]}
|
package/build/store/reducer.js
CHANGED
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.blockInserterPanel = blockInserterPanel;
|
|
7
7
|
exports.default = void 0;
|
|
8
|
+
exports.inserterSidebarToggleRef = inserterSidebarToggleRef;
|
|
8
9
|
exports.listViewPanel = listViewPanel;
|
|
9
10
|
exports.listViewToggleRef = listViewToggleRef;
|
|
10
11
|
exports.widgetAreasOpenState = widgetAreasOpenState;
|
|
@@ -98,9 +99,24 @@ function listViewToggleRef(state = {
|
|
|
98
99
|
}) {
|
|
99
100
|
return state;
|
|
100
101
|
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* This reducer does nothing aside initializing a ref to the inserter sidebar toggle.
|
|
105
|
+
* We will have a unique ref per "editor" instance.
|
|
106
|
+
*
|
|
107
|
+
* @param {Object} state
|
|
108
|
+
* @return {Object} Reference to the inserter sidebar toggle button.
|
|
109
|
+
*/
|
|
110
|
+
function inserterSidebarToggleRef(state = {
|
|
111
|
+
current: null
|
|
112
|
+
}) {
|
|
113
|
+
return state;
|
|
114
|
+
}
|
|
101
115
|
var _default = exports.default = (0, _data.combineReducers)({
|
|
102
116
|
blockInserterPanel,
|
|
117
|
+
inserterSidebarToggleRef,
|
|
103
118
|
listViewPanel,
|
|
119
|
+
listViewToggleRef,
|
|
104
120
|
widgetAreasOpenState
|
|
105
121
|
});
|
|
106
122
|
//# sourceMappingURL=reducer.js.map
|