@wordpress/edit-widgets 6.32.0 → 6.32.1-next.ff1cebbba.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/blocks/widget-area/block.json +26 -0
- package/build/blocks/widget-area/edit/index.js +94 -87
- package/build/blocks/widget-area/edit/index.js.map +7 -1
- package/build/blocks/widget-area/edit/inner-blocks.js +68 -50
- package/build/blocks/widget-area/edit/inner-blocks.js.map +7 -1
- package/build/blocks/widget-area/edit/use-is-dragging-within.js +34 -40
- package/build/blocks/widget-area/edit/use-is-dragging-within.js.map +7 -1
- package/build/blocks/widget-area/index.js +49 -52
- package/build/blocks/widget-area/index.js.map +7 -1
- package/build/components/error-boundary/index.js +49 -51
- package/build/components/error-boundary/index.js.map +7 -1
- package/build/components/header/document-tools/index.js +104 -74
- package/build/components/header/document-tools/index.js.map +7 -1
- package/build/components/header/index.js +81 -62
- package/build/components/header/index.js.map +7 -1
- package/build/components/header/undo-redo/redo.js +50 -38
- package/build/components/header/undo-redo/redo.js.map +7 -1
- package/build/components/header/undo-redo/undo.js +49 -37
- package/build/components/header/undo-redo/undo.js.map +7 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +74 -71
- package/build/components/keyboard-shortcut-help-modal/config.js.map +7 -1
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +61 -44
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +7 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +154 -103
- package/build/components/keyboard-shortcut-help-modal/index.js.map +7 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +74 -56
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +7 -1
- package/build/components/keyboard-shortcuts/index.js +89 -82
- package/build/components/keyboard-shortcuts/index.js.map +7 -1
- package/build/components/layout/index.js +75 -49
- package/build/components/layout/index.js.map +7 -1
- package/build/components/layout/interface.js +89 -75
- package/build/components/layout/interface.js.map +7 -1
- package/build/components/layout/unsaved-changes-warning.js +35 -42
- package/build/components/layout/unsaved-changes-warning.js.map +7 -1
- package/build/components/more-menu/index.js +189 -108
- package/build/components/more-menu/index.js.map +7 -1
- package/build/components/more-menu/tools-more-menu-group.js +29 -23
- package/build/components/more-menu/tools-more-menu-group.js.map +7 -1
- package/build/components/notices/index.js +62 -48
- package/build/components/notices/index.js.map +7 -1
- package/build/components/save-button/index.js +55 -47
- package/build/components/save-button/index.js.map +7 -1
- package/build/components/secondary-sidebar/index.js +41 -34
- package/build/components/secondary-sidebar/index.js.map +7 -1
- package/build/components/secondary-sidebar/inserter-sidebar.js +55 -46
- package/build/components/secondary-sidebar/inserter-sidebar.js.map +7 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +76 -67
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +7 -1
- package/build/components/sidebar/index.js +149 -138
- package/build/components/sidebar/index.js.map +7 -1
- package/build/components/sidebar/widget-areas.js +73 -57
- package/build/components/sidebar/widget-areas.js.map +7 -1
- package/build/components/welcome-guide/index.js +182 -137
- package/build/components/welcome-guide/index.js.map +7 -1
- package/build/components/widget-areas-block-editor-content/index.js +64 -43
- package/build/components/widget-areas-block-editor-content/index.js.map +7 -1
- package/build/components/widget-areas-block-editor-provider/index.js +115 -92
- package/build/components/widget-areas-block-editor-provider/index.js.map +7 -1
- package/build/constants.js +30 -8
- package/build/constants.js.map +7 -1
- package/build/filters/index.js +3 -5
- package/build/filters/index.js.map +7 -1
- package/build/filters/move-to-widget-area.js +52 -59
- package/build/filters/move-to-widget-area.js.map +7 -1
- package/build/filters/replace-media-upload.js +9 -11
- package/build/filters/replace-media-upload.js.map +7 -1
- package/build/hooks/use-last-selected-widget-area.js +38 -44
- package/build/hooks/use-last-selected-widget-area.js.map +7 -1
- package/build/hooks/use-widget-library-insertion-point.js +60 -55
- package/build/hooks/use-widget-library-insertion-point.js.map +7 -1
- package/build/index.js +86 -93
- package/build/index.js.map +7 -1
- package/build/lock-unlock.js +31 -15
- package/build/lock-unlock.js.map +7 -1
- package/build/store/actions.js +181 -313
- package/build/store/actions.js.map +7 -1
- package/build/store/constants.js +27 -10
- package/build/store/constants.js.map +7 -1
- package/build/store/index.js +51 -51
- package/build/store/index.js.map +7 -1
- package/build/store/private-selectors.js +28 -7
- package/build/store/private-selectors.js.map +7 -1
- package/build/store/reducer.js +65 -118
- package/build/store/reducer.js.map +7 -1
- package/build/store/resolvers.js +64 -63
- package/build/store/resolvers.js.map +7 -1
- package/build/store/selectors.js +194 -231
- package/build/store/selectors.js.map +7 -1
- package/build/store/transformers.js +47 -41
- package/build/store/transformers.js.map +7 -1
- package/build/store/utils.js +47 -70
- package/build/store/utils.js.map +7 -1
- package/build-module/blocks/widget-area/block.json +26 -0
- package/build-module/blocks/widget-area/edit/index.js +63 -75
- package/build-module/blocks/widget-area/edit/index.js.map +7 -1
- package/build-module/blocks/widget-area/edit/inner-blocks.js +38 -41
- package/build-module/blocks/widget-area/edit/inner-blocks.js.map +7 -1
- package/build-module/blocks/widget-area/edit/use-is-dragging-within.js +14 -33
- package/build-module/blocks/widget-area/edit/use-is-dragging-within.js.map +7 -1
- package/build-module/blocks/widget-area/index.js +14 -46
- package/build-module/blocks/widget-area/index.js.map +7 -1
- package/build-module/components/error-boundary/index.js +30 -43
- package/build-module/components/error-boundary/index.js.map +7 -1
- package/build-module/components/header/document-tools/index.js +75 -66
- package/build-module/components/header/document-tools/index.js.map +7 -1
- package/build-module/components/header/index.js +52 -54
- package/build-module/components/header/index.js.map +7 -1
- package/build-module/components/header/undo-redo/redo.js +32 -32
- package/build-module/components/header/undo-redo/redo.js.map +7 -1
- package/build-module/components/header/undo-redo/undo.js +31 -31
- package/build-module/components/header/undo-redo/undo.js.map +7 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js +62 -75
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +7 -1
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +33 -37
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +7 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +130 -97
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +7 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +56 -50
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +7 -1
- package/build-module/components/keyboard-shortcuts/index.js +73 -75
- package/build-module/components/keyboard-shortcuts/index.js.map +7 -1
- package/build-module/components/layout/index.js +46 -41
- package/build-module/components/layout/index.js.map +7 -1
- package/build-module/components/layout/interface.js +63 -66
- package/build-module/components/layout/interface.js.map +7 -1
- package/build-module/components/layout/unsaved-changes-warning.js +17 -37
- package/build-module/components/layout/unsaved-changes-warning.js.map +7 -1
- package/build-module/components/more-menu/index.js +167 -102
- package/build-module/components/more-menu/index.js.map +7 -1
- package/build-module/components/more-menu/tools-more-menu-group.js +11 -17
- package/build-module/components/more-menu/tools-more-menu-group.js.map +7 -1
- package/build-module/components/notices/index.js +43 -42
- package/build-module/components/notices/index.js.map +7 -1
- package/build-module/components/save-button/index.js +37 -41
- package/build-module/components/save-button/index.js.map +7 -1
- package/build-module/components/secondary-sidebar/index.js +14 -27
- package/build-module/components/secondary-sidebar/index.js.map +7 -1
- package/build-module/components/secondary-sidebar/inserter-sidebar.js +26 -38
- package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +7 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +57 -60
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +7 -1
- package/build-module/components/sidebar/index.js +129 -127
- package/build-module/components/sidebar/index.js.map +7 -1
- package/build-module/components/sidebar/widget-areas.js +53 -49
- package/build-module/components/sidebar/widget-areas.js.map +7 -1
- package/build-module/components/welcome-guide/index.js +165 -132
- package/build-module/components/welcome-guide/index.js.map +7 -1
- package/build-module/components/widget-areas-block-editor-content/index.js +43 -36
- package/build-module/components/widget-areas-block-editor-content/index.js.map +7 -1
- package/build-module/components/widget-areas-block-editor-provider/index.js +85 -83
- package/build-module/components/widget-areas-block-editor-provider/index.js.map +7 -1
- package/build-module/constants.js +7 -3
- package/build-module/constants.js.map +7 -1
- package/build-module/filters/index.js +3 -6
- package/build-module/filters/index.js.map +7 -1
- package/build-module/filters/move-to-widget-area.js +52 -57
- package/build-module/filters/move-to-widget-area.js.map +7 -1
- package/build-module/filters/replace-media-upload.js +8 -7
- package/build-module/filters/replace-media-upload.js.map +7 -1
- package/build-module/hooks/use-last-selected-widget-area.js +20 -39
- package/build-module/hooks/use-last-selected-widget-area.js.map +7 -1
- package/build-module/hooks/use-widget-library-insertion-point.js +42 -49
- package/build-module/hooks/use-widget-library-insertion-point.js.map +7 -1
- package/build-module/index.js +60 -72
- package/build-module/index.js.map +7 -1
- package/build-module/lock-unlock.js +8 -7
- package/build-module/lock-unlock.js.map +7 -1
- package/build-module/store/actions.js +153 -293
- package/build-module/store/actions.js.map +7 -1
- package/build-module/store/constants.js +5 -5
- package/build-module/store/constants.js.map +7 -1
- package/build-module/store/index.js +16 -40
- package/build-module/store/index.js.map +7 -1
- package/build-module/store/private-selectors.js +7 -3
- package/build-module/store/private-selectors.js.map +7 -1
- package/build-module/store/reducer.js +42 -111
- package/build-module/store/reducer.js.map +7 -1
- package/build-module/store/resolvers.js +43 -51
- package/build-module/store/resolvers.js.map +7 -1
- package/build-module/store/selectors.js +171 -224
- package/build-module/store/selectors.js.map +7 -1
- package/build-module/store/transformers.js +23 -34
- package/build-module/store/transformers.js.map +7 -1
- package/build-module/store/utils.js +22 -63
- package/build-module/store/utils.js.map +7 -1
- package/build-style/style-rtl.css +216 -88
- package/build-style/style.css +216 -88
- package/package.json +36 -29
- package/src/blocks/widget-area/editor.scss +3 -0
- package/src/components/customizer-edit-widgets-initializer/style.scss +3 -0
- package/src/components/error-boundary/style.scss +2 -0
- package/src/components/header/style.scss +5 -0
- package/src/components/keyboard-shortcut-help-modal/style.scss +2 -0
- package/src/components/layout/style.scss +3 -0
- package/src/components/more-menu/style.scss +2 -0
- package/src/components/notices/style.scss +3 -0
- package/src/components/secondary-sidebar/style.scss +4 -0
- package/src/components/sidebar/style.scss +2 -0
- package/src/components/welcome-guide/style.scss +2 -0
- package/src/components/widget-areas-block-editor-content/style.scss +2 -0
- package/src/style.scss +16 -13
|
@@ -1,45 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Internal dependencies
|
|
15
|
-
*/
|
|
16
|
-
import useIsDraggingWithin from './use-is-dragging-within';
|
|
17
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
-
export default function WidgetAreaInnerBlocks({
|
|
19
|
-
id
|
|
20
|
-
}) {
|
|
21
|
-
const [blocks, onInput, onChange] = useEntityBlockEditor('root', 'postType');
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import { useEntityBlockEditor } from "@wordpress/core-data";
|
|
4
|
+
import { InnerBlocks, useInnerBlocksProps } from "@wordpress/block-editor";
|
|
5
|
+
import { useRef } from "@wordpress/element";
|
|
6
|
+
import useIsDraggingWithin from "./use-is-dragging-within";
|
|
7
|
+
function WidgetAreaInnerBlocks({ id }) {
|
|
8
|
+
const [blocks, onInput, onChange] = useEntityBlockEditor(
|
|
9
|
+
"root",
|
|
10
|
+
"postType"
|
|
11
|
+
);
|
|
22
12
|
const innerBlocksRef = useRef();
|
|
23
13
|
const isDraggingWithinInnerBlocks = useIsDraggingWithin(innerBlocksRef);
|
|
24
14
|
const shouldHighlightDropZone = isDraggingWithinInnerBlocks;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
15
|
+
const innerBlocksProps = useInnerBlocksProps(
|
|
16
|
+
{ ref: innerBlocksRef },
|
|
17
|
+
{
|
|
18
|
+
value: blocks,
|
|
19
|
+
onInput,
|
|
20
|
+
onChange,
|
|
21
|
+
templateLock: false,
|
|
22
|
+
renderAppender: InnerBlocks.ButtonBlockAppender
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
return /* @__PURE__ */ jsx(
|
|
26
|
+
"div",
|
|
27
|
+
{
|
|
28
|
+
"data-widget-area-id": id,
|
|
29
|
+
className: clsx(
|
|
30
|
+
"wp-block-widget-area__inner-blocks block-editor-inner-blocks editor-styles-wrapper",
|
|
31
|
+
{
|
|
32
|
+
"wp-block-widget-area__highlight-drop-zone": shouldHighlightDropZone
|
|
33
|
+
}
|
|
34
|
+
),
|
|
35
|
+
children: /* @__PURE__ */ jsx("div", { ...innerBlocksProps })
|
|
36
|
+
}
|
|
37
|
+
);
|
|
44
38
|
}
|
|
45
|
-
|
|
39
|
+
export {
|
|
40
|
+
WidgetAreaInnerBlocks as default
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=inner-blocks.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/blocks/widget-area/edit/inner-blocks.js"],
|
|
4
|
+
"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"],
|
|
5
|
+
"mappings": "AAgDG;AA7CH,OAAO,UAAU;AAKjB,SAAS,4BAA4B;AACrC,SAAS,aAAa,2BAA2B;AACjD,SAAS,cAAc;AAKvB,OAAO,yBAAyB;AAEjB,SAAR,sBAAwC,EAAE,GAAG,GAAI;AACvD,QAAM,CAAE,QAAQ,SAAS,QAAS,IAAI;AAAA,IACrC;AAAA,IACA;AAAA,EACD;AACA,QAAM,iBAAiB,OAAO;AAC9B,QAAM,8BAA8B,oBAAqB,cAAe;AACxE,QAAM,0BAA0B;AAEhC,QAAM,mBAAmB;AAAA,IACxB,EAAE,KAAK,eAAe;AAAA,IACtB;AAAA,MACC,OAAO;AAAA,MACP;AAAA,MACA;AAAA,MACA,cAAc;AAAA,MACd,gBAAgB,YAAY;AAAA,IAC7B;AAAA,EACD;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,uBAAsB;AAAA,MACtB,WAAY;AAAA,QACX;AAAA,QACA;AAAA,UACC,6CACC;AAAA,QACF;AAAA,MACD;AAAA,MAEA,8BAAC,SAAM,GAAG,kBAAmB;AAAA;AAAA,EAC9B;AAEF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,53 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*/
|
|
4
|
-
import { useState, useEffect } from '@wordpress/element';
|
|
5
|
-
|
|
6
|
-
/** @typedef {import('@wordpress/element').RefObject} RefObject */
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* A React hook to determine if it's dragging within the target element.
|
|
10
|
-
*
|
|
11
|
-
* @param {RefObject<HTMLElement>} elementRef The target elementRef object.
|
|
12
|
-
*
|
|
13
|
-
* @return {boolean} Is dragging within the target element.
|
|
14
|
-
*/
|
|
15
|
-
const useIsDraggingWithin = elementRef => {
|
|
1
|
+
import { useState, useEffect } from "@wordpress/element";
|
|
2
|
+
const useIsDraggingWithin = (elementRef) => {
|
|
16
3
|
const [isDraggingWithin, setIsDraggingWithin] = useState(false);
|
|
17
4
|
useEffect(() => {
|
|
18
|
-
const {
|
|
19
|
-
ownerDocument
|
|
20
|
-
} = elementRef.current;
|
|
5
|
+
const { ownerDocument } = elementRef.current;
|
|
21
6
|
function handleDragStart(event) {
|
|
22
|
-
// Check the first time when the dragging starts.
|
|
23
7
|
handleDragEnter(event);
|
|
24
8
|
}
|
|
25
|
-
|
|
26
|
-
// Set to false whenever the user cancel the drag event by either releasing the mouse or press Escape.
|
|
27
9
|
function handleDragEnd() {
|
|
28
10
|
setIsDraggingWithin(false);
|
|
29
11
|
}
|
|
30
12
|
function handleDragEnter(event) {
|
|
31
|
-
// Check if the current target is inside the item element.
|
|
32
13
|
if (elementRef.current.contains(event.target)) {
|
|
33
14
|
setIsDraggingWithin(true);
|
|
34
15
|
} else {
|
|
35
16
|
setIsDraggingWithin(false);
|
|
36
17
|
}
|
|
37
18
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
ownerDocument.addEventListener('dragstart', handleDragStart);
|
|
42
|
-
ownerDocument.addEventListener('dragend', handleDragEnd);
|
|
43
|
-
ownerDocument.addEventListener('dragenter', handleDragEnter);
|
|
19
|
+
ownerDocument.addEventListener("dragstart", handleDragStart);
|
|
20
|
+
ownerDocument.addEventListener("dragend", handleDragEnd);
|
|
21
|
+
ownerDocument.addEventListener("dragenter", handleDragEnter);
|
|
44
22
|
return () => {
|
|
45
|
-
ownerDocument.removeEventListener(
|
|
46
|
-
ownerDocument.removeEventListener(
|
|
47
|
-
ownerDocument.removeEventListener(
|
|
23
|
+
ownerDocument.removeEventListener("dragstart", handleDragStart);
|
|
24
|
+
ownerDocument.removeEventListener("dragend", handleDragEnd);
|
|
25
|
+
ownerDocument.removeEventListener("dragenter", handleDragEnter);
|
|
48
26
|
};
|
|
49
27
|
}, []);
|
|
50
28
|
return isDraggingWithin;
|
|
51
29
|
};
|
|
52
|
-
|
|
53
|
-
|
|
30
|
+
var use_is_dragging_within_default = useIsDraggingWithin;
|
|
31
|
+
export {
|
|
32
|
+
use_is_dragging_within_default as default
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=use-is-dragging-within.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/blocks/widget-area/edit/use-is-dragging-within.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useState, useEffect } from '@wordpress/element';\n\n/** @typedef {import('@wordpress/element').RefObject} RefObject */\n\n/**\n * A React hook to determine if it's dragging within the target element.\n *\n * @param {RefObject<HTMLElement>} elementRef The target elementRef object.\n *\n * @return {boolean} Is dragging within the target element.\n */\nconst useIsDraggingWithin = ( elementRef ) => {\n\tconst [ isDraggingWithin, setIsDraggingWithin ] = useState( false );\n\n\tuseEffect( () => {\n\t\tconst { ownerDocument } = elementRef.current;\n\n\t\tfunction handleDragStart( event ) {\n\t\t\t// Check the first time when the dragging starts.\n\t\t\thandleDragEnter( event );\n\t\t}\n\n\t\t// Set to false whenever the user cancel the drag event by either releasing the mouse or press Escape.\n\t\tfunction handleDragEnd() {\n\t\t\tsetIsDraggingWithin( false );\n\t\t}\n\n\t\tfunction handleDragEnter( event ) {\n\t\t\t// Check if the current target is inside the item element.\n\t\t\tif ( elementRef.current.contains( event.target ) ) {\n\t\t\t\tsetIsDraggingWithin( true );\n\t\t\t} else {\n\t\t\t\tsetIsDraggingWithin( false );\n\t\t\t}\n\t\t}\n\n\t\t// Bind these events to the document to catch all drag events.\n\t\t// Ideally, we can also use `event.relatedTarget`, but sadly that doesn't work in Safari.\n\t\townerDocument.addEventListener( 'dragstart', handleDragStart );\n\t\townerDocument.addEventListener( 'dragend', handleDragEnd );\n\t\townerDocument.addEventListener( 'dragenter', handleDragEnter );\n\n\t\treturn () => {\n\t\t\townerDocument.removeEventListener( 'dragstart', handleDragStart );\n\t\t\townerDocument.removeEventListener( 'dragend', handleDragEnd );\n\t\t\townerDocument.removeEventListener( 'dragenter', handleDragEnter );\n\t\t};\n\t}, [] );\n\n\treturn isDraggingWithin;\n};\n\nexport default useIsDraggingWithin;\n"],
|
|
5
|
+
"mappings": "AAGA,SAAS,UAAU,iBAAiB;AAWpC,MAAM,sBAAsB,CAAE,eAAgB;AAC7C,QAAM,CAAE,kBAAkB,mBAAoB,IAAI,SAAU,KAAM;AAElE,YAAW,MAAM;AAChB,UAAM,EAAE,cAAc,IAAI,WAAW;AAErC,aAAS,gBAAiB,OAAQ;AAEjC,sBAAiB,KAAM;AAAA,IACxB;AAGA,aAAS,gBAAgB;AACxB,0BAAqB,KAAM;AAAA,IAC5B;AAEA,aAAS,gBAAiB,OAAQ;AAEjC,UAAK,WAAW,QAAQ,SAAU,MAAM,MAAO,GAAI;AAClD,4BAAqB,IAAK;AAAA,MAC3B,OAAO;AACN,4BAAqB,KAAM;AAAA,MAC5B;AAAA,IACD;AAIA,kBAAc,iBAAkB,aAAa,eAAgB;AAC7D,kBAAc,iBAAkB,WAAW,aAAc;AACzD,kBAAc,iBAAkB,aAAa,eAAgB;AAE7D,WAAO,MAAM;AACZ,oBAAc,oBAAqB,aAAa,eAAgB;AAChE,oBAAc,oBAAqB,WAAW,aAAc;AAC5D,oBAAc,oBAAqB,aAAa,eAAgB;AAAA,IACjE;AAAA,EACD,GAAG,CAAC,CAAE;AAEN,SAAO;AACR;AAEA,IAAO,iCAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,48 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const metadata = {
|
|
10
|
-
$schema: "https://schemas.wp.org/trunk/block.json",
|
|
11
|
-
apiVersion: 3,
|
|
12
|
-
name: "core/widget-area",
|
|
13
|
-
title: "Widget Area",
|
|
14
|
-
category: "widgets",
|
|
15
|
-
attributes: {
|
|
16
|
-
id: {
|
|
17
|
-
type: "string"
|
|
18
|
-
},
|
|
19
|
-
name: {
|
|
20
|
-
type: "string"
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
supports: {
|
|
24
|
-
html: false,
|
|
25
|
-
inserter: false,
|
|
26
|
-
customClassName: false,
|
|
27
|
-
reusable: false,
|
|
28
|
-
__experimentalToolbar: false,
|
|
29
|
-
__experimentalParentSelector: false,
|
|
30
|
-
__experimentalDisableBlockOverlay: true
|
|
31
|
-
},
|
|
32
|
-
editorStyle: "wp-block-widget-area-editor",
|
|
33
|
-
style: "wp-block-widget-area"
|
|
34
|
-
};
|
|
35
|
-
import edit from './edit';
|
|
36
|
-
const {
|
|
37
|
-
name
|
|
38
|
-
} = metadata;
|
|
39
|
-
export { metadata, name };
|
|
40
|
-
export const settings = {
|
|
41
|
-
title: __('Widget Area'),
|
|
42
|
-
description: __('A widget area container.'),
|
|
43
|
-
__experimentalLabel: ({
|
|
44
|
-
name: label
|
|
45
|
-
}) => label,
|
|
1
|
+
import { __ } from "@wordpress/i18n";
|
|
2
|
+
import metadata from "./block.json";
|
|
3
|
+
import edit from "./edit";
|
|
4
|
+
const { name } = metadata;
|
|
5
|
+
const settings = {
|
|
6
|
+
title: __("Widget Area"),
|
|
7
|
+
description: __("A widget area container."),
|
|
8
|
+
__experimentalLabel: ({ name: label }) => label,
|
|
46
9
|
edit
|
|
47
10
|
};
|
|
48
|
-
|
|
11
|
+
export {
|
|
12
|
+
metadata,
|
|
13
|
+
name,
|
|
14
|
+
settings
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/blocks/widget-area/index.js"],
|
|
4
|
+
"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"],
|
|
5
|
+
"mappings": "AAGA,SAAS,UAAU;AAKnB,OAAO,cAAc;AACrB,OAAO,UAAU;AAEjB,MAAM,EAAE,KAAK,IAAI;AAGV,MAAM,WAAW;AAAA,EACvB,OAAO,GAAI,aAAc;AAAA,EACzB,aAAa,GAAI,0BAA2B;AAAA,EAC5C,qBAAqB,CAAE,EAAE,MAAM,MAAM,MAAO;AAAA,EAC5C;AACD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,40 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
import { doAction } from '@wordpress/hooks';
|
|
10
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
-
function CopyButton({
|
|
12
|
-
text,
|
|
13
|
-
children
|
|
14
|
-
}) {
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Component } from "@wordpress/element";
|
|
3
|
+
import { __ } from "@wordpress/i18n";
|
|
4
|
+
import { Button } from "@wordpress/components";
|
|
5
|
+
import { Warning } from "@wordpress/block-editor";
|
|
6
|
+
import { useCopyToClipboard } from "@wordpress/compose";
|
|
7
|
+
import { doAction } from "@wordpress/hooks";
|
|
8
|
+
function CopyButton({ text, children }) {
|
|
15
9
|
const ref = useCopyToClipboard(text);
|
|
16
|
-
return
|
|
17
|
-
__next40pxDefaultSize: true,
|
|
18
|
-
variant: "secondary",
|
|
19
|
-
ref: ref,
|
|
20
|
-
children: children
|
|
21
|
-
});
|
|
10
|
+
return /* @__PURE__ */ jsx(Button, { __next40pxDefaultSize: true, variant: "secondary", ref, children });
|
|
22
11
|
}
|
|
23
|
-
function ErrorBoundaryWarning({
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
text: error.stack,
|
|
29
|
-
children: __('Copy Error')
|
|
30
|
-
}, "copy-error")];
|
|
31
|
-
return /*#__PURE__*/_jsx(Warning, {
|
|
32
|
-
className: "edit-widgets-error-boundary",
|
|
33
|
-
actions: actions,
|
|
34
|
-
children: message
|
|
35
|
-
});
|
|
12
|
+
function ErrorBoundaryWarning({ message, error }) {
|
|
13
|
+
const actions = [
|
|
14
|
+
/* @__PURE__ */ jsx(CopyButton, { text: error.stack, children: __("Copy Error") }, "copy-error")
|
|
15
|
+
];
|
|
16
|
+
return /* @__PURE__ */ jsx(Warning, { className: "edit-widgets-error-boundary", actions, children: message });
|
|
36
17
|
}
|
|
37
|
-
|
|
18
|
+
class ErrorBoundary extends Component {
|
|
38
19
|
constructor() {
|
|
39
20
|
super(...arguments);
|
|
40
21
|
this.state = {
|
|
@@ -42,21 +23,27 @@ export default class ErrorBoundary extends Component {
|
|
|
42
23
|
};
|
|
43
24
|
}
|
|
44
25
|
componentDidCatch(error) {
|
|
45
|
-
doAction(
|
|
26
|
+
doAction("editor.ErrorBoundary.errorLogged", error);
|
|
46
27
|
}
|
|
47
28
|
static getDerivedStateFromError(error) {
|
|
48
|
-
return {
|
|
49
|
-
error
|
|
50
|
-
};
|
|
29
|
+
return { error };
|
|
51
30
|
}
|
|
52
31
|
render() {
|
|
53
32
|
if (!this.state.error) {
|
|
54
33
|
return this.props.children;
|
|
55
34
|
}
|
|
56
|
-
return
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
35
|
+
return /* @__PURE__ */ jsx(
|
|
36
|
+
ErrorBoundaryWarning,
|
|
37
|
+
{
|
|
38
|
+
message: __(
|
|
39
|
+
"The editor has encountered an unexpected error."
|
|
40
|
+
),
|
|
41
|
+
error: this.state.error
|
|
42
|
+
}
|
|
43
|
+
);
|
|
60
44
|
}
|
|
61
45
|
}
|
|
62
|
-
|
|
46
|
+
export {
|
|
47
|
+
ErrorBoundary as default
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/error-boundary/index.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { Warning } from '@wordpress/block-editor';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { doAction } from '@wordpress/hooks';\n\nfunction CopyButton( { text, children } ) {\n\tconst ref = useCopyToClipboard( text );\n\treturn (\n\t\t<Button __next40pxDefaultSize variant=\"secondary\" ref={ ref }>\n\t\t\t{ children }\n\t\t</Button>\n\t);\n}\n\nfunction ErrorBoundaryWarning( { message, error } ) {\n\tconst actions = [\n\t\t<CopyButton key=\"copy-error\" text={ error.stack }>\n\t\t\t{ __( 'Copy Error' ) }\n\t\t</CopyButton>,\n\t];\n\n\treturn (\n\t\t<Warning className=\"edit-widgets-error-boundary\" actions={ actions }>\n\t\t\t{ message }\n\t\t</Warning>\n\t);\n}\n\nexport default class ErrorBoundary extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.state = {\n\t\t\terror: null,\n\t\t};\n\t}\n\n\tcomponentDidCatch( error ) {\n\t\tdoAction( 'editor.ErrorBoundary.errorLogged', error );\n\t}\n\n\tstatic getDerivedStateFromError( error ) {\n\t\treturn { error };\n\t}\n\n\trender() {\n\t\tif ( ! this.state.error ) {\n\t\t\treturn this.props.children;\n\t\t}\n\n\t\treturn (\n\t\t\t<ErrorBoundaryWarning\n\t\t\t\tmessage={ __(\n\t\t\t\t\t'The editor has encountered an unexpected error.'\n\t\t\t\t) }\n\t\t\t\terror={ this.state.error }\n\t\t\t/>\n\t\t);\n\t}\n}\n"],
|
|
5
|
+
"mappings": "AAaE;AAVF,SAAS,iBAAiB;AAC1B,SAAS,UAAU;AACnB,SAAS,cAAc;AACvB,SAAS,eAAe;AACxB,SAAS,0BAA0B;AACnC,SAAS,gBAAgB;AAEzB,SAAS,WAAY,EAAE,MAAM,SAAS,GAAI;AACzC,QAAM,MAAM,mBAAoB,IAAK;AACrC,SACC,oBAAC,UAAO,uBAAqB,MAAC,SAAQ,aAAY,KAC/C,UACH;AAEF;AAEA,SAAS,qBAAsB,EAAE,SAAS,MAAM,GAAI;AACnD,QAAM,UAAU;AAAA,IACf,oBAAC,cAA4B,MAAO,MAAM,OACvC,aAAI,YAAa,KADJ,YAEhB;AAAA,EACD;AAEA,SACC,oBAAC,WAAQ,WAAU,+BAA8B,SAC9C,mBACH;AAEF;AAEA,MAAO,sBAAoC,UAAU;AAAA,EACpD,cAAc;AACb,UAAO,GAAG,SAAU;AAEpB,SAAK,QAAQ;AAAA,MACZ,OAAO;AAAA,IACR;AAAA,EACD;AAAA,EAEA,kBAAmB,OAAQ;AAC1B,aAAU,oCAAoC,KAAM;AAAA,EACrD;AAAA,EAEA,OAAO,yBAA0B,OAAQ;AACxC,WAAO,EAAE,MAAM;AAAA,EAChB;AAAA,EAEA,SAAS;AACR,QAAK,CAAE,KAAK,MAAM,OAAQ;AACzB,aAAO,KAAK,MAAM;AAAA,IACnB;AAEA,WACC;AAAA,MAAC;AAAA;AAAA,QACA,SAAU;AAAA,UACT;AAAA,QACD;AAAA,QACA,OAAQ,KAAK,MAAM;AAAA;AAAA,IACpB;AAAA,EAEF;AACD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,30 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
* Internal dependencies
|
|
14
|
-
*/
|
|
15
|
-
import UndoButton from '../undo-redo/undo';
|
|
16
|
-
import RedoButton from '../undo-redo/redo';
|
|
17
|
-
import { store as editWidgetsStore } from '../../../store';
|
|
18
|
-
import { unlock } from '../../../lock-unlock';
|
|
19
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useSelect, useDispatch } from "@wordpress/data";
|
|
3
|
+
import { __, _x } from "@wordpress/i18n";
|
|
4
|
+
import { Button, ToolbarItem } from "@wordpress/components";
|
|
5
|
+
import { NavigableToolbar } from "@wordpress/block-editor";
|
|
6
|
+
import { listView, plus } from "@wordpress/icons";
|
|
7
|
+
import { useCallback } from "@wordpress/element";
|
|
8
|
+
import { useViewportMatch } from "@wordpress/compose";
|
|
9
|
+
import UndoButton from "../undo-redo/undo";
|
|
10
|
+
import RedoButton from "../undo-redo/redo";
|
|
11
|
+
import { store as editWidgetsStore } from "../../../store";
|
|
12
|
+
import { unlock } from "../../../lock-unlock";
|
|
20
13
|
function DocumentTools() {
|
|
21
|
-
const isMediumViewport = useViewportMatch(
|
|
14
|
+
const isMediumViewport = useViewportMatch("medium");
|
|
22
15
|
const {
|
|
23
16
|
isInserterOpen,
|
|
24
17
|
isListViewOpen,
|
|
25
18
|
inserterSidebarToggleRef,
|
|
26
19
|
listViewToggleRef
|
|
27
|
-
} = useSelect(select => {
|
|
20
|
+
} = useSelect((select) => {
|
|
28
21
|
const {
|
|
29
22
|
isInserterOpened,
|
|
30
23
|
getInserterSidebarToggleRef,
|
|
@@ -38,49 +31,65 @@ function DocumentTools() {
|
|
|
38
31
|
listViewToggleRef: getListViewToggleRef()
|
|
39
32
|
};
|
|
40
33
|
}, []);
|
|
41
|
-
const {
|
|
42
|
-
|
|
43
|
-
setIsListViewOpened
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const toggleInserterSidebar = useCallback(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
variant: "
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
34
|
+
const { setIsInserterOpened, setIsListViewOpened } = useDispatch(editWidgetsStore);
|
|
35
|
+
const toggleListView = useCallback(
|
|
36
|
+
() => setIsListViewOpened(!isListViewOpen),
|
|
37
|
+
[setIsListViewOpened, isListViewOpen]
|
|
38
|
+
);
|
|
39
|
+
const toggleInserterSidebar = useCallback(
|
|
40
|
+
() => setIsInserterOpened(!isInserterOpen),
|
|
41
|
+
[setIsInserterOpened, isInserterOpen]
|
|
42
|
+
);
|
|
43
|
+
return /* @__PURE__ */ jsxs(
|
|
44
|
+
NavigableToolbar,
|
|
45
|
+
{
|
|
46
|
+
className: "edit-widgets-header-toolbar",
|
|
47
|
+
"aria-label": __("Document tools"),
|
|
48
|
+
variant: "unstyled",
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ jsx(
|
|
51
|
+
ToolbarItem,
|
|
52
|
+
{
|
|
53
|
+
ref: inserterSidebarToggleRef,
|
|
54
|
+
as: Button,
|
|
55
|
+
className: "edit-widgets-header-toolbar__inserter-toggle",
|
|
56
|
+
variant: "primary",
|
|
57
|
+
isPressed: isInserterOpen,
|
|
58
|
+
onMouseDown: (event) => {
|
|
59
|
+
event.preventDefault();
|
|
60
|
+
},
|
|
61
|
+
onClick: toggleInserterSidebar,
|
|
62
|
+
icon: plus,
|
|
63
|
+
label: _x(
|
|
64
|
+
"Block Inserter",
|
|
65
|
+
"Generic label for block inserter button"
|
|
66
|
+
),
|
|
67
|
+
size: "compact"
|
|
68
|
+
}
|
|
69
|
+
),
|
|
70
|
+
isMediumViewport && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
71
|
+
/* @__PURE__ */ jsx(ToolbarItem, { as: UndoButton }),
|
|
72
|
+
/* @__PURE__ */ jsx(ToolbarItem, { as: RedoButton }),
|
|
73
|
+
/* @__PURE__ */ jsx(
|
|
74
|
+
ToolbarItem,
|
|
75
|
+
{
|
|
76
|
+
as: Button,
|
|
77
|
+
className: "edit-widgets-header-toolbar__list-view-toggle",
|
|
78
|
+
icon: listView,
|
|
79
|
+
isPressed: isListViewOpen,
|
|
80
|
+
label: __("List View"),
|
|
81
|
+
onClick: toggleListView,
|
|
82
|
+
ref: listViewToggleRef,
|
|
83
|
+
size: "compact"
|
|
84
|
+
}
|
|
85
|
+
)
|
|
86
|
+
] })
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
);
|
|
84
90
|
}
|
|
85
|
-
|
|
86
|
-
|
|
91
|
+
var document_tools_default = DocumentTools;
|
|
92
|
+
export {
|
|
93
|
+
document_tools_default as default
|
|
94
|
+
};
|
|
95
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/components/header/document-tools/index.js"],
|
|
4
|
+
"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'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"],
|
|
5
|
+
"mappings": "AA4DG,SAoBC,UApBD,KAoBC,YApBD;AAzDH,SAAS,WAAW,mBAAmB;AACvC,SAAS,IAAI,UAAU;AACvB,SAAS,QAAQ,mBAAmB;AACpC,SAAS,wBAAwB;AACjC,SAAS,UAAU,YAAY;AAC/B,SAAS,mBAAmB;AAC5B,SAAS,wBAAwB;AAKjC,OAAO,gBAAgB;AACvB,OAAO,gBAAgB;AACvB,SAAS,SAAS,wBAAwB;AAC1C,SAAS,cAAc;AAEvB,SAAS,gBAAgB;AACxB,QAAM,mBAAmB,iBAAkB,QAAS;AAEpD,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,IAAI,UAAW,CAAE,WAAY;AAC5B,UAAM;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD,IAAI,OAAQ,OAAQ,gBAAiB,CAAE;AACvC,WAAO;AAAA,MACN,gBAAgB,iBAAiB;AAAA,MACjC,gBAAgB,iBAAiB;AAAA,MACjC,0BAA0B,4BAA4B;AAAA,MACtD,mBAAmB,qBAAqB;AAAA,IACzC;AAAA,EACD,GAAG,CAAC,CAAE;AACN,QAAM,EAAE,qBAAqB,oBAAoB,IAChD,YAAa,gBAAiB;AAE/B,QAAM,iBAAiB;AAAA,IACtB,MAAM,oBAAqB,CAAE,cAAe;AAAA,IAC5C,CAAE,qBAAqB,cAAe;AAAA,EACvC;AAEA,QAAM,wBAAwB;AAAA,IAC7B,MAAM,oBAAqB,CAAE,cAAe;AAAA,IAC5C,CAAE,qBAAqB,cAAe;AAAA,EACvC;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV,cAAa,GAAI,gBAAiB;AAAA,MAClC,SAAQ;AAAA,MAER;AAAA;AAAA,UAAC;AAAA;AAAA,YACA,KAAM;AAAA,YACN,IAAK;AAAA,YACL,WAAU;AAAA,YACV,SAAQ;AAAA,YACR,WAAY;AAAA,YACZ,aAAc,CAAE,UAAW;AAC1B,oBAAM,eAAe;AAAA,YACtB;AAAA,YACA,SAAU;AAAA,YACV,MAAO;AAAA,YAGP,OAAQ;AAAA,cACP;AAAA,cACA;AAAA,YACD;AAAA,YACA,MAAK;AAAA;AAAA,QACN;AAAA,QACE,oBACD,iCACC;AAAA,8BAAC,eAAY,IAAK,YAAa;AAAA,UAC/B,oBAAC,eAAY,IAAK,YAAa;AAAA,UAC/B;AAAA,YAAC;AAAA;AAAA,cACA,IAAK;AAAA,cACL,WAAU;AAAA,cACV,MAAO;AAAA,cACP,WAAY;AAAA,cAEZ,OAAQ,GAAI,WAAY;AAAA,cACxB,SAAU;AAAA,cACV,KAAM;AAAA,cACN,MAAK;AAAA;AAAA,UACN;AAAA,WACD;AAAA;AAAA;AAAA,EAEF;AAEF;AAEA,IAAO,yBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|