@wordpress/edit-widgets 6.57.0 → 7.1.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/edit/index.cjs +106 -116
- package/build/blocks/widget-area/edit/index.cjs.map +1 -7
- package/build/blocks/widget-area/edit/inner-blocks.cjs +44 -62
- package/build/blocks/widget-area/edit/inner-blocks.cjs.map +1 -7
- package/build/blocks/widget-area/edit/use-is-dragging-within.cjs +41 -53
- package/build/blocks/widget-area/edit/use-is-dragging-within.cjs.map +1 -7
- package/build/blocks/widget-area/index.cjs +40 -44
- package/build/blocks/widget-area/index.cjs.map +1 -7
- package/build/components/error-boundary/index.cjs +115 -155
- package/build/components/error-boundary/index.cjs.map +1 -7
- package/build/components/header/document-tools/index.cjs +80 -115
- package/build/components/header/document-tools/index.cjs.map +1 -7
- package/build/components/header/index.cjs +72 -80
- package/build/components/header/index.cjs.map +1 -7
- package/build/components/header/undo-redo/redo.cjs +30 -52
- package/build/components/header/undo-redo/redo.cjs.map +1 -7
- package/build/components/header/undo-redo/undo.cjs +29 -51
- package/build/components/header/undo-redo/undo.cjs.map +1 -7
- package/build/components/keyboard-shortcut-help-modal/config.cjs +88 -85
- package/build/components/keyboard-shortcut-help-modal/config.cjs.map +1 -7
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.cjs +40 -57
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.cjs.map +1 -7
- package/build/components/keyboard-shortcut-help-modal/index.cjs +94 -161
- package/build/components/keyboard-shortcut-help-modal/index.cjs.map +1 -7
- package/build/components/keyboard-shortcut-help-modal/shortcut.cjs +37 -75
- package/build/components/keyboard-shortcut-help-modal/shortcut.cjs.map +1 -7
- package/build/components/keyboard-shortcuts/index.cjs +107 -140
- package/build/components/keyboard-shortcuts/index.cjs.map +1 -7
- package/build/components/layout/index.cjs +65 -74
- package/build/components/layout/index.cjs.map +1 -7
- package/build/components/layout/interface.cjs +82 -102
- package/build/components/layout/interface.cjs.map +1 -7
- package/build/components/layout/unsaved-changes-warning.cjs +44 -48
- package/build/components/layout/unsaved-changes-warning.cjs.map +1 -7
- package/build/components/more-menu/index.cjs +125 -191
- package/build/components/more-menu/index.cjs.map +1 -7
- package/build/components/more-menu/tools-more-menu-group.cjs +9 -29
- package/build/components/more-menu/tools-more-menu-group.cjs.map +1 -7
- package/build/components/notices/index.cjs +19 -39
- package/build/components/notices/index.cjs.map +1 -7
- package/build/components/save-button/index.cjs +31 -58
- package/build/components/save-button/index.cjs.map +1 -7
- package/build/components/secondary-sidebar/index.cjs +38 -45
- package/build/components/secondary-sidebar/index.cjs.map +1 -7
- package/build/components/secondary-sidebar/inserter-sidebar.cjs +50 -51
- package/build/components/secondary-sidebar/inserter-sidebar.cjs.map +1 -7
- package/build/components/secondary-sidebar/list-view-sidebar.cjs +51 -82
- package/build/components/secondary-sidebar/list-view-sidebar.cjs.map +1 -7
- package/build/components/sidebar/index.cjs +117 -180
- package/build/components/sidebar/index.cjs.map +1 -7
- package/build/components/sidebar/widget-areas.cjs +43 -85
- package/build/components/sidebar/widget-areas.cjs.map +1 -7
- package/build/components/welcome-guide/index.cjs +110 -186
- package/build/components/welcome-guide/index.cjs.map +1 -7
- package/build/components/widget-areas-block-editor-content/index.cjs +59 -63
- package/build/components/widget-areas-block-editor-content/index.cjs.map +1 -7
- package/build/components/widget-areas-block-editor-provider/index.cjs +105 -140
- package/build/components/widget-areas-block-editor-provider/index.cjs.map +1 -7
- package/build/constants.cjs +11 -32
- package/build/constants.cjs.map +1 -7
- package/build/filters/index.cjs +7 -4
- package/build/filters/move-to-widget-area.cjs +38 -53
- package/build/filters/move-to-widget-area.cjs.map +1 -7
- package/build/filters/replace-media-upload.cjs +11 -9
- package/build/filters/replace-media-upload.cjs.map +1 -7
- package/build/hooks/use-last-selected-widget-area.cjs +28 -49
- package/build/hooks/use-last-selected-widget-area.cjs.map +1 -7
- package/build/hooks/use-widget-library-insertion-point.cjs +33 -67
- package/build/hooks/use-widget-library-insertion-point.cjs.map +1 -7
- package/build/index.cjs +96 -97
- package/build/index.cjs.map +1 -7
- package/build/lock-unlock.cjs +10 -35
- package/build/lock-unlock.cjs.map +1 -7
- package/build/store/actions.cjs +269 -278
- package/build/store/actions.cjs.map +1 -7
- package/build/store/constants.cjs +12 -29
- package/build/store/constants.cjs.map +1 -7
- package/build/store/index.cjs +61 -52
- package/build/store/index.cjs.map +1 -7
- package/build/store/private-selectors.cjs +11 -32
- package/build/store/private-selectors.cjs.map +1 -7
- package/build/store/reducer.cjs +107 -88
- package/build/store/reducer.cjs.map +1 -7
- package/build/store/resolvers.cjs +60 -91
- package/build/store/resolvers.cjs.map +1 -7
- package/build/store/selectors.cjs +196 -229
- package/build/store/selectors.cjs.map +1 -7
- package/build/store/transformers.cjs +51 -82
- package/build/store/transformers.cjs.map +1 -7
- package/build/store/utils.cjs +76 -63
- package/build/store/utils.cjs.map +1 -7
- package/build-module/blocks/widget-area/edit/index.mjs +82 -94
- package/build-module/blocks/widget-area/edit/index.mjs.map +1 -7
- package/build-module/blocks/widget-area/edit/inner-blocks.mjs +19 -35
- package/build-module/blocks/widget-area/edit/inner-blocks.mjs.map +1 -7
- package/build-module/blocks/widget-area/edit/use-is-dragging-within.mjs +36 -33
- package/build-module/blocks/widget-area/edit/use-is-dragging-within.mjs.map +1 -7
- package/build-module/blocks/widget-area/index.mjs +12 -15
- package/build-module/blocks/widget-area/index.mjs.map +1 -7
- package/build-module/components/error-boundary/index.mjs +103 -128
- package/build-module/components/error-boundary/index.mjs.map +1 -7
- package/build-module/components/header/document-tools/index.mjs +51 -84
- package/build-module/components/header/document-tools/index.mjs.map +1 -7
- package/build-module/components/header/index.mjs +40 -47
- package/build-module/components/header/index.mjs.map +1 -7
- package/build-module/components/header/undo-redo/redo.mjs +20 -27
- package/build-module/components/header/undo-redo/redo.mjs.map +1 -7
- package/build-module/components/header/undo-redo/undo.mjs +19 -26
- package/build-module/components/header/undo-redo/undo.mjs.map +1 -7
- package/build-module/components/keyboard-shortcut-help-modal/config.mjs +83 -61
- package/build-module/components/keyboard-shortcut-help-modal/config.mjs.map +1 -7
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.mjs +19 -33
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.mjs.map +1 -7
- package/build-module/components/keyboard-shortcut-help-modal/index.mjs +67 -136
- package/build-module/components/keyboard-shortcut-help-modal/index.mjs.map +1 -7
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.mjs +31 -54
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.mjs.map +1 -7
- package/build-module/components/keyboard-shortcuts/index.mjs +99 -119
- package/build-module/components/keyboard-shortcuts/index.mjs.map +1 -7
- package/build-module/components/layout/index.mjs +29 -40
- package/build-module/components/layout/index.mjs.map +1 -7
- package/build-module/components/layout/interface.mjs +53 -76
- package/build-module/components/layout/interface.mjs.map +1 -7
- package/build-module/components/layout/unsaved-changes-warning.mjs +37 -26
- package/build-module/components/layout/unsaved-changes-warning.mjs.map +1 -7
- package/build-module/components/more-menu/index.mjs +95 -162
- package/build-module/components/more-menu/index.mjs.map +1 -7
- package/build-module/components/more-menu/tools-more-menu-group.mjs +5 -9
- package/build-module/components/more-menu/tools-more-menu-group.mjs.map +1 -7
- package/build-module/components/notices/index.mjs +12 -17
- package/build-module/components/notices/index.mjs.map +1 -7
- package/build-module/components/save-button/index.mjs +23 -35
- package/build-module/components/save-button/index.mjs.map +1 -7
- package/build-module/components/secondary-sidebar/index.mjs +15 -20
- package/build-module/components/secondary-sidebar/index.mjs.map +1 -7
- package/build-module/components/secondary-sidebar/inserter-sidebar.mjs +27 -25
- package/build-module/components/secondary-sidebar/inserter-sidebar.mjs.map +1 -7
- package/build-module/components/secondary-sidebar/list-view-sidebar.mjs +39 -55
- package/build-module/components/secondary-sidebar/list-view-sidebar.mjs.map +1 -7
- package/build-module/components/sidebar/index.mjs +96 -162
- package/build-module/components/sidebar/index.mjs.map +1 -7
- package/build-module/components/sidebar/widget-areas.mjs +30 -57
- package/build-module/components/sidebar/widget-areas.mjs.map +1 -7
- package/build-module/components/welcome-guide/index.mjs +103 -164
- package/build-module/components/welcome-guide/index.mjs.map +1 -7
- package/build-module/components/widget-areas-block-editor-content/index.mjs +35 -44
- package/build-module/components/widget-areas-block-editor-content/index.mjs.map +1 -7
- package/build-module/components/widget-areas-block-editor-provider/index.mjs +76 -109
- package/build-module/components/widget-areas-block-editor-provider/index.mjs.map +1 -7
- package/build-module/constants.mjs +5 -7
- package/build-module/constants.mjs.map +1 -7
- package/build-module/filters/index.mjs +0 -2
- package/build-module/filters/move-to-widget-area.mjs +28 -48
- package/build-module/filters/move-to-widget-area.mjs.map +1 -7
- package/build-module/filters/replace-media-upload.mjs +5 -8
- package/build-module/filters/replace-media-upload.mjs.map +1 -7
- package/build-module/hooks/use-last-selected-widget-area.mjs +23 -29
- package/build-module/hooks/use-last-selected-widget-area.mjs.map +1 -7
- package/build-module/hooks/use-widget-library-insertion-point.mjs +28 -47
- package/build-module/hooks/use-widget-library-insertion-point.mjs.map +1 -7
- package/build-module/index.mjs +62 -79
- package/build-module/index.mjs.map +1 -7
- package/build-module/lock-unlock.mjs +5 -10
- package/build-module/lock-unlock.mjs.map +1 -7
- package/build-module/store/actions.mjs +250 -247
- package/build-module/store/actions.mjs.map +1 -7
- package/build-module/store/constants.mjs +7 -5
- package/build-module/store/constants.mjs.map +1 -7
- package/build-module/store/index.mjs +18 -16
- package/build-module/store/index.mjs.map +1 -7
- package/build-module/store/private-selectors.mjs +5 -7
- package/build-module/store/private-selectors.mjs.map +1 -7
- package/build-module/store/reducer.mjs +95 -58
- package/build-module/store/reducer.mjs.map +1 -7
- package/build-module/store/resolvers.mjs +52 -71
- package/build-module/store/resolvers.mjs.map +1 -7
- package/build-module/store/selectors.mjs +178 -199
- package/build-module/store/selectors.mjs.map +1 -7
- package/build-module/store/transformers.mjs +44 -56
- package/build-module/store/transformers.mjs.map +1 -7
- package/build-module/store/utils.mjs +64 -32
- package/build-module/store/utils.mjs.map +1 -7
- package/build-style/style-rtl.css +12 -12
- package/build-style/style.css +12 -12
- package/package.json +35 -36
- package/src/components/header/index.jsx +2 -2
- package/src/components/layout/interface.jsx +4 -1
- package/src/components/layout/style.scss +11 -0
- package/src/components/notices/style.scss +2 -2
- package/src/components/sidebar/index.jsx +18 -18
- package/src/components/welcome-guide/index.jsx +4 -2
- package/src/components/widget-areas-block-editor-content/index.jsx +4 -3
- package/CHANGELOG.md +0 -325
- package/build/filters/index.cjs.map +0 -7
- package/build-module/filters/index.mjs.map +0 -7
|
@@ -1,43 +1,27 @@
|
|
|
1
|
-
// packages/edit-widgets/src/blocks/widget-area/edit/inner-blocks.jsx
|
|
2
1
|
import clsx from "clsx";
|
|
3
2
|
import { useEntityBlockEditor } from "@wordpress/core-data";
|
|
4
3
|
import { InnerBlocks, useInnerBlocksProps } from "@wordpress/block-editor";
|
|
5
4
|
import { useRef } from "@wordpress/element";
|
|
6
5
|
import useIsDraggingWithin from "./use-is-dragging-within.mjs";
|
|
7
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
// packages/edit-widgets/src/blocks/widget-area/edit/inner-blocks.jsx
|
|
8
8
|
function WidgetAreaInnerBlocks({ id }) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
);
|
|
26
|
-
return /* @__PURE__ */ jsx(
|
|
27
|
-
"div",
|
|
28
|
-
{
|
|
29
|
-
"data-widget-area-id": id,
|
|
30
|
-
className: clsx(
|
|
31
|
-
"wp-block-widget-area__inner-blocks block-editor-inner-blocks editor-styles-wrapper",
|
|
32
|
-
{
|
|
33
|
-
"wp-block-widget-area__highlight-drop-zone": shouldHighlightDropZone
|
|
34
|
-
}
|
|
35
|
-
),
|
|
36
|
-
children: /* @__PURE__ */ jsx("div", { ...innerBlocksProps })
|
|
37
|
-
}
|
|
38
|
-
);
|
|
9
|
+
const [blocks, onInput, onChange] = useEntityBlockEditor("root", "postType");
|
|
10
|
+
const innerBlocksRef = useRef();
|
|
11
|
+
const shouldHighlightDropZone = useIsDraggingWithin(innerBlocksRef);
|
|
12
|
+
const innerBlocksProps = useInnerBlocksProps({ ref: innerBlocksRef }, {
|
|
13
|
+
value: blocks,
|
|
14
|
+
onInput,
|
|
15
|
+
onChange,
|
|
16
|
+
templateLock: false,
|
|
17
|
+
renderAppender: InnerBlocks.ButtonBlockAppender
|
|
18
|
+
});
|
|
19
|
+
return /* @__PURE__ */ jsx("div", {
|
|
20
|
+
"data-widget-area-id": id,
|
|
21
|
+
className: clsx("wp-block-widget-area__inner-blocks block-editor-inner-blocks editor-styles-wrapper", { "wp-block-widget-area__highlight-drop-zone": shouldHighlightDropZone }),
|
|
22
|
+
children: /* @__PURE__ */ jsx("div", { ...innerBlocksProps })
|
|
23
|
+
});
|
|
39
24
|
}
|
|
40
|
-
export {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
//# sourceMappingURL=inner-blocks.mjs.map
|
|
25
|
+
export { WidgetAreaInnerBlocks as default };
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=inner-blocks.mjs.map
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/blocks/widget-area/edit/inner-blocks.jsx"],
|
|
4
|
-
"sourcesContent": ["import clsx from 'clsx';\nimport { useEntityBlockEditor } from '@wordpress/core-data';\nimport { InnerBlocks, useInnerBlocksProps } from '@wordpress/block-editor';\nimport { useRef } from '@wordpress/element';\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": ";AAAA,OAAO,UAAU;AACjB,SAAS,4BAA4B;AACrC,SAAS,aAAa,2BAA2B;AACjD,SAAS,cAAc;AACvB,OAAO,yBAAyB;AAiC7B;AA/BY,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
|
+
{"version":3,"file":"inner-blocks.mjs","names":[],"sources":["../../../../src/blocks/widget-area/edit/inner-blocks.jsx"],"sourcesContent":["import clsx from 'clsx';\nimport { useEntityBlockEditor } from '@wordpress/core-data';\nimport { InnerBlocks, useInnerBlocksProps } from '@wordpress/block-editor';\nimport { useRef } from '@wordpress/element';\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":";;;;;;;AAMA,SAAwB,sBAAuB,EAAE,MAAO;CACvD,MAAM,CAAE,QAAQ,SAAS,YAAa,qBACrC,QACA,UACD;CACA,MAAM,iBAAiB,OAAO;CAE9B,MAAM,0BAD8B,oBAAqB,cACC;CAE1D,MAAM,mBAAmB,oBACxB,EAAE,KAAK,eAAe,GACtB;EACC,OAAO;EACP;EACA;EACA,cAAc;EACd,gBAAgB,YAAY;CAC7B,CACD;CAEA,OACC,oBAAC,OAAD;EACC,uBAAsB;EACtB,WAAY,KACX,sFACA,EACC,6CACC,wBACF,CACD;EAEA,UAAA,oBAAC,OAAD,EAAK,GAAK,iBAAoB,CAAA;CAC1B,CAAA;AAEP"}
|
|
@@ -1,35 +1,38 @@
|
|
|
1
|
+
import { useEffect, useState } from "@wordpress/element";
|
|
1
2
|
// packages/edit-widgets/src/blocks/widget-area/edit/use-is-dragging-within.js
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
3
|
+
/** @typedef {import('@wordpress/element').RefObject} RefObject */
|
|
4
|
+
/**
|
|
5
|
+
* A React hook to determine if it's dragging within the target element.
|
|
6
|
+
*
|
|
7
|
+
* @param {RefObject<HTMLElement>} elementRef The target elementRef object.
|
|
8
|
+
*
|
|
9
|
+
* @return {boolean} Is dragging within the target element.
|
|
10
|
+
*/
|
|
11
|
+
const useIsDraggingWithin = (elementRef) => {
|
|
12
|
+
const [isDraggingWithin, setIsDraggingWithin] = useState(false);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
const { ownerDocument } = elementRef.current;
|
|
15
|
+
function handleDragStart(event) {
|
|
16
|
+
handleDragEnter(event);
|
|
17
|
+
}
|
|
18
|
+
function handleDragEnd() {
|
|
19
|
+
setIsDraggingWithin(false);
|
|
20
|
+
}
|
|
21
|
+
function handleDragEnter(event) {
|
|
22
|
+
if (elementRef.current.contains(event.target)) setIsDraggingWithin(true);
|
|
23
|
+
else setIsDraggingWithin(false);
|
|
24
|
+
}
|
|
25
|
+
ownerDocument.addEventListener("dragstart", handleDragStart);
|
|
26
|
+
ownerDocument.addEventListener("dragend", handleDragEnd);
|
|
27
|
+
ownerDocument.addEventListener("dragenter", handleDragEnter);
|
|
28
|
+
return () => {
|
|
29
|
+
ownerDocument.removeEventListener("dragstart", handleDragStart);
|
|
30
|
+
ownerDocument.removeEventListener("dragend", handleDragEnd);
|
|
31
|
+
ownerDocument.removeEventListener("dragenter", handleDragEnter);
|
|
32
|
+
};
|
|
33
|
+
}, []);
|
|
34
|
+
return isDraggingWithin;
|
|
30
35
|
};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
};
|
|
35
|
-
//# sourceMappingURL=use-is-dragging-within.mjs.map
|
|
36
|
+
export { useIsDraggingWithin as default };
|
|
37
|
+
|
|
38
|
+
//# sourceMappingURL=use-is-dragging-within.mjs.map
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/blocks/widget-area/edit/use-is-dragging-within.js"],
|
|
4
|
-
"sourcesContent": ["import { 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": ";AAAA,SAAS,UAAU,iBAAiB;AAWpC,IAAM,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
|
+
{"version":3,"file":"use-is-dragging-within.mjs","names":[],"sources":["../../../../src/blocks/widget-area/edit/use-is-dragging-within.js"],"sourcesContent":["import { 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"],"mappings":";;;;;;;;;;AAWA,MAAM,uBAAwB,eAAgB;CAC7C,MAAM,CAAE,kBAAkB,uBAAwB,SAAU,KAAM;CAElE,gBAAiB;EAChB,MAAM,EAAE,kBAAkB,WAAW;EAErC,SAAS,gBAAiB,OAAQ;GAEjC,gBAAiB,KAAM;EACxB;EAGA,SAAS,gBAAgB;GACxB,oBAAqB,KAAM;EAC5B;EAEA,SAAS,gBAAiB,OAAQ;GAEjC,IAAK,WAAW,QAAQ,SAAU,MAAM,MAAO,GAC9C,oBAAqB,IAAK;QAE1B,oBAAqB,KAAM;EAE7B;EAIA,cAAc,iBAAkB,aAAa,eAAgB;EAC7D,cAAc,iBAAkB,WAAW,aAAc;EACzD,cAAc,iBAAkB,aAAa,eAAgB;EAE7D,aAAa;GACZ,cAAc,oBAAqB,aAAa,eAAgB;GAChE,cAAc,oBAAqB,WAAW,aAAc;GAC5D,cAAc,oBAAqB,aAAa,eAAgB;EACjE;CACD,GAAG,CAAC,CAAE;CAEN,OAAO;AACR"}
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
// packages/edit-widgets/src/blocks/widget-area/index.js
|
|
2
1
|
import { __ } from "@wordpress/i18n";
|
|
3
|
-
import { layout
|
|
2
|
+
import { layout } from "@wordpress/icons";
|
|
4
3
|
import metadata from "./block.json";
|
|
5
4
|
import edit from "./edit/index.mjs";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export {
|
|
15
|
-
metadata,
|
|
16
|
-
name,
|
|
17
|
-
settings
|
|
5
|
+
// packages/edit-widgets/src/blocks/widget-area/index.js
|
|
6
|
+
const { name } = metadata;
|
|
7
|
+
const settings = {
|
|
8
|
+
title: __("Widget Area"),
|
|
9
|
+
description: __("A widget area container."),
|
|
10
|
+
__experimentalLabel: ({ name: label }) => label,
|
|
11
|
+
icon: layout,
|
|
12
|
+
edit
|
|
18
13
|
};
|
|
19
|
-
|
|
14
|
+
export { metadata, name, settings };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/blocks/widget-area/index.js"],
|
|
4
|
-
"sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport { layout as icon } from '@wordpress/icons';\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\ticon,\n\tedit,\n};\n"],
|
|
5
|
-
"mappings": ";AAAA,SAAS,UAAU;AACnB,SAAS,UAAU,YAAY;AAC/B,OAAO,cAAc;AACrB,OAAO,UAAU;AAEjB,IAAM,EAAE,KAAK,IAAI;AAGV,IAAM,WAAW;AAAA,EACvB,OAAO,GAAI,aAAc;AAAA,EACzB,aAAa,GAAI,0BAA2B;AAAA,EAC5C,qBAAqB,CAAE,EAAE,MAAM,MAAM,MAAO;AAAA,EAC5C;AAAA,EACA;AACD;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../src/blocks/widget-area/index.js"],"sourcesContent":["import { __ } from '@wordpress/i18n';\nimport { layout as icon } from '@wordpress/icons';\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\ticon,\n\tedit,\n};\n"],"mappings":";;;;;AAKA,MAAM,EAAE,SAAS;AAGjB,MAAa,WAAW;CACvB,OAAO,GAAI,aAAc;CACzB,aAAa,GAAI,0BAA2B;CAC5C,sBAAuB,EAAE,MAAM,YAAa;CAC5C,MAAA;CACA;AACD"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// packages/edit-widgets/src/components/error-boundary/index.jsx
|
|
2
1
|
import { Component } from "@wordpress/element";
|
|
3
2
|
import { speak } from "@wordpress/a11y";
|
|
4
3
|
import { __ } from "@wordpress/i18n";
|
|
@@ -6,148 +5,124 @@ import { Card, CollapsibleCard, Notice, Stack, Text } from "@wordpress/ui";
|
|
|
6
5
|
import { useCopyToClipboard } from "@wordpress/compose";
|
|
7
6
|
import { doAction } from "@wordpress/hooks";
|
|
8
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
// packages/edit-widgets/src/components/error-boundary/index.jsx
|
|
9
9
|
function getErrorNotice() {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
)
|
|
15
|
-
};
|
|
10
|
+
return {
|
|
11
|
+
title: __("The editor has crashed"),
|
|
12
|
+
description: __("An unknown error occurred. Reload your browser to try again, or copy the error to report the problem or search.")
|
|
13
|
+
};
|
|
16
14
|
}
|
|
17
15
|
function getErrorName(error) {
|
|
18
|
-
|
|
16
|
+
return error instanceof Error && error.name || "Error";
|
|
19
17
|
}
|
|
20
18
|
function getErrorMessage(error) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
if (typeof error?.message === "string" && error.message) {
|
|
25
|
-
return error.message;
|
|
26
|
-
}
|
|
27
|
-
return "An unknown error occurred.";
|
|
19
|
+
if (typeof error === "string" && error) return error;
|
|
20
|
+
if (typeof error?.message === "string" && error.message) return error.message;
|
|
21
|
+
return "An unknown error occurred.";
|
|
28
22
|
}
|
|
29
23
|
function getErrorSections(error, componentStack) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
preformatted: true
|
|
51
|
-
});
|
|
52
|
-
return sections;
|
|
24
|
+
const sections = [{
|
|
25
|
+
label: getErrorName(error),
|
|
26
|
+
content: getErrorMessage(error)
|
|
27
|
+
}];
|
|
28
|
+
if (error?.stack) sections.push({
|
|
29
|
+
label: "Stack",
|
|
30
|
+
content: error.stack.trim(),
|
|
31
|
+
preformatted: true
|
|
32
|
+
});
|
|
33
|
+
if (componentStack) sections.push({
|
|
34
|
+
label: "Component stack",
|
|
35
|
+
content: componentStack.trim(),
|
|
36
|
+
preformatted: true
|
|
37
|
+
});
|
|
38
|
+
sections.push({
|
|
39
|
+
label: "Environment",
|
|
40
|
+
content: `User agent: ${window.navigator.userAgent}`,
|
|
41
|
+
preformatted: true
|
|
42
|
+
});
|
|
43
|
+
return sections;
|
|
53
44
|
}
|
|
54
45
|
function getErrorReport(error, componentStack) {
|
|
55
|
-
|
|
56
|
-
({ label, content, preformatted }) => `**${label}**
|
|
57
|
-
|
|
58
|
-
${preformatted ? `\`\`\`
|
|
59
|
-
${content}
|
|
60
|
-
\`\`\`` : content}`
|
|
61
|
-
);
|
|
62
|
-
return ["### Error report", ...sections].join("\n\n");
|
|
46
|
+
return ["### Error report", ...getErrorSections(error, componentStack).map(({ label, content, preformatted }) => `**${label}**\n\n${preformatted ? `\`\`\`\n${content}\n\`\`\`` : content}`)].join("\n\n");
|
|
63
47
|
}
|
|
64
48
|
function CopyButton({ text, children, variant = "outline" }) {
|
|
65
|
-
|
|
66
|
-
|
|
49
|
+
const ref = useCopyToClipboard(text);
|
|
50
|
+
return /* @__PURE__ */ jsx(Notice.ActionButton, {
|
|
51
|
+
variant,
|
|
52
|
+
ref,
|
|
53
|
+
children
|
|
54
|
+
});
|
|
67
55
|
}
|
|
68
56
|
function ErrorReport({ error, componentStack }) {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
57
|
+
return /* @__PURE__ */ jsx(Stack, {
|
|
58
|
+
className: "edit-widgets-error-boundary__report",
|
|
59
|
+
direction: "column",
|
|
60
|
+
gap: "md",
|
|
61
|
+
children: getErrorSections(error, componentStack).map(({ label, content }) => /* @__PURE__ */ jsxs(Stack, {
|
|
62
|
+
direction: "column",
|
|
63
|
+
gap: "xs",
|
|
64
|
+
children: [/* @__PURE__ */ jsx(Text, {
|
|
65
|
+
variant: "heading-md",
|
|
66
|
+
children: label
|
|
67
|
+
}), /* @__PURE__ */ jsx("pre", {
|
|
68
|
+
className: "edit-widgets-error-boundary__report-section",
|
|
69
|
+
children: content
|
|
70
|
+
})]
|
|
71
|
+
}, label))
|
|
72
|
+
});
|
|
83
73
|
}
|
|
84
74
|
function ErrorDetails({ error, componentStack }) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
) })
|
|
94
|
-
] });
|
|
75
|
+
return /* @__PURE__ */ jsxs(CollapsibleCard.Root, {
|
|
76
|
+
className: "edit-widgets-error-boundary__details",
|
|
77
|
+
children: [/* @__PURE__ */ jsx(CollapsibleCard.Header, { children: /* @__PURE__ */ jsx(Card.Title, { children: __("Error details") }) }), /* @__PURE__ */ jsx(CollapsibleCard.Content, { children: /* @__PURE__ */ jsx(ErrorReport, {
|
|
78
|
+
error,
|
|
79
|
+
componentStack
|
|
80
|
+
}) })]
|
|
81
|
+
});
|
|
95
82
|
}
|
|
96
83
|
var ErrorBoundary = class extends Component {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
globalThis.SCRIPT_DEBUG ? /* @__PURE__ */ jsx(
|
|
139
|
-
ErrorDetails,
|
|
140
|
-
{
|
|
141
|
-
error,
|
|
142
|
-
componentStack
|
|
143
|
-
}
|
|
144
|
-
) : null
|
|
145
|
-
]
|
|
146
|
-
}
|
|
147
|
-
);
|
|
148
|
-
}
|
|
84
|
+
constructor() {
|
|
85
|
+
super(...arguments);
|
|
86
|
+
this.state = {
|
|
87
|
+
error: null,
|
|
88
|
+
componentStack: null
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
componentDidCatch(error, errorInfo) {
|
|
92
|
+
const { title, description } = getErrorNotice();
|
|
93
|
+
speak(`${title}. ${description}`, "assertive");
|
|
94
|
+
this.setState({ componentStack: errorInfo?.componentStack });
|
|
95
|
+
doAction("editor.ErrorBoundary.errorLogged", error, errorInfo);
|
|
96
|
+
}
|
|
97
|
+
static getDerivedStateFromError(error) {
|
|
98
|
+
return { error };
|
|
99
|
+
}
|
|
100
|
+
render() {
|
|
101
|
+
const { error, componentStack } = this.state;
|
|
102
|
+
if (!error) return this.props.children;
|
|
103
|
+
const { title, description } = getErrorNotice();
|
|
104
|
+
return /* @__PURE__ */ jsxs(Stack, {
|
|
105
|
+
className: "edit-widgets-error-boundary",
|
|
106
|
+
direction: "column",
|
|
107
|
+
gap: "lg",
|
|
108
|
+
children: [/* @__PURE__ */ jsxs(Notice.Root, {
|
|
109
|
+
intent: "error",
|
|
110
|
+
children: [
|
|
111
|
+
/* @__PURE__ */ jsx(Notice.Title, { children: title }),
|
|
112
|
+
/* @__PURE__ */ jsx(Notice.Description, { children: description }),
|
|
113
|
+
/* @__PURE__ */ jsx(Notice.Actions, { children: /* @__PURE__ */ jsx(CopyButton, {
|
|
114
|
+
variant: "solid",
|
|
115
|
+
text: () => getErrorReport(error, componentStack),
|
|
116
|
+
children: __("Copy error")
|
|
117
|
+
}) })
|
|
118
|
+
]
|
|
119
|
+
}), globalThis.SCRIPT_DEBUG ? /* @__PURE__ */ jsx(ErrorDetails, {
|
|
120
|
+
error,
|
|
121
|
+
componentStack
|
|
122
|
+
}) : null]
|
|
123
|
+
});
|
|
124
|
+
}
|
|
149
125
|
};
|
|
150
|
-
export {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
//# sourceMappingURL=index.mjs.map
|
|
126
|
+
export { ErrorBoundary as default };
|
|
127
|
+
|
|
128
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/error-boundary/index.jsx"],
|
|
4
|
-
"sourcesContent": ["import { Component } from '@wordpress/element';\nimport { speak } from '@wordpress/a11y';\nimport { __ } from '@wordpress/i18n';\nimport { Card, CollapsibleCard, Notice, Stack, Text } from '@wordpress/ui';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { doAction } from '@wordpress/hooks';\n\nfunction getErrorNotice() {\n\treturn {\n\t\ttitle: __( 'The editor has crashed' ),\n\t\tdescription: __(\n\t\t\t'An unknown error occurred. Reload your browser to try again, or copy the error to report the problem or search.'\n\t\t),\n\t};\n}\n\n// A boundary catches whatever was thrown, which is not always an `Error`.\nfunction getErrorName( error ) {\n\treturn ( error instanceof Error && error.name ) || 'Error';\n}\n\nfunction getErrorMessage( error ) {\n\tif ( typeof error === 'string' && error ) {\n\t\treturn error;\n\t}\n\n\tif ( typeof error?.message === 'string' && error.message ) {\n\t\treturn error.message;\n\t}\n\n\treturn 'An unknown error occurred.';\n}\n\n// The sections of the report, shared by the copied Markdown and the details\n// panel so that the two cannot drift apart. Deliberately untranslated: both\n// are developer-facing, and the report is pasted into a bug report.\nfunction getErrorSections( error, componentStack ) {\n\tconst sections = [\n\t\t{ label: getErrorName( error ), content: getErrorMessage( error ) },\n\t];\n\n\tif ( error?.stack ) {\n\t\tsections.push( {\n\t\t\tlabel: 'Stack',\n\t\t\tcontent: error.stack.trim(),\n\t\t\tpreformatted: true,\n\t\t} );\n\t}\n\n\tif ( componentStack ) {\n\t\tsections.push( {\n\t\t\tlabel: 'Component stack',\n\t\t\tcontent: componentStack.trim(),\n\t\t\tpreformatted: true,\n\t\t} );\n\t}\n\n\tsections.push( {\n\t\tlabel: 'Environment',\n\t\tcontent: `User agent: ${ window.navigator.userAgent }`,\n\t\tpreformatted: true,\n\t} );\n\n\treturn sections;\n}\n\n// Markdown, so the report stays readable as plain text and renders when pasted\n// into a bug report.\nfunction getErrorReport( error, componentStack ) {\n\tconst sections = getErrorSections( error, componentStack ).map(\n\t\t( { label, content, preformatted } ) =>\n\t\t\t`**${ label }**\\n\\n${\n\t\t\t\tpreformatted ? `\\`\\`\\`\\n${ content }\\n\\`\\`\\`` : content\n\t\t\t}`\n\t);\n\n\treturn [ '### Error report', ...sections ].join( '\\n\\n' );\n}\n\nfunction CopyButton( { text, children, variant = 'outline' } ) {\n\tconst ref = useCopyToClipboard( text );\n\treturn (\n\t\t<Notice.ActionButton variant={ variant } ref={ ref }>\n\t\t\t{ children }\n\t\t</Notice.ActionButton>\n\t);\n}\n\nfunction ErrorReport( { error, componentStack } ) {\n\treturn (\n\t\t<Stack\n\t\t\tclassName=\"edit-widgets-error-boundary__report\"\n\t\t\tdirection=\"column\"\n\t\t\tgap=\"md\"\n\t\t>\n\t\t\t{ getErrorSections( error, componentStack ).map(\n\t\t\t\t( { label, content } ) => (\n\t\t\t\t\t<Stack key={ label } direction=\"column\" gap=\"xs\">\n\t\t\t\t\t\t<Text variant=\"heading-md\">{ label }</Text>\n\t\t\t\t\t\t<pre className=\"edit-widgets-error-boundary__report-section\">\n\t\t\t\t\t\t\t{ content }\n\t\t\t\t\t\t</pre>\n\t\t\t\t\t</Stack>\n\t\t\t\t)\n\t\t\t) }\n\t\t</Stack>\n\t);\n}\n\nfunction ErrorDetails( { error, componentStack } ) {\n\treturn (\n\t\t<CollapsibleCard.Root className=\"edit-widgets-error-boundary__details\">\n\t\t\t<CollapsibleCard.Header>\n\t\t\t\t<Card.Title>{ __( 'Error details' ) }</Card.Title>\n\t\t\t</CollapsibleCard.Header>\n\t\t\t<CollapsibleCard.Content>\n\t\t\t\t<ErrorReport\n\t\t\t\t\terror={ error }\n\t\t\t\t\tcomponentStack={ componentStack }\n\t\t\t\t/>\n\t\t\t</CollapsibleCard.Content>\n\t\t</CollapsibleCard.Root>\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\tcomponentStack: null,\n\t\t};\n\t}\n\n\tcomponentDidCatch( error, errorInfo ) {\n\t\tconst { title, description } = getErrorNotice();\n\t\tspeak( `${ title }. ${ description }`, 'assertive' );\n\t\tthis.setState( { componentStack: errorInfo?.componentStack } );\n\t\tdoAction( 'editor.ErrorBoundary.errorLogged', error, errorInfo );\n\t}\n\n\tstatic getDerivedStateFromError( error ) {\n\t\treturn { error };\n\t}\n\n\trender() {\n\t\tconst { error, componentStack } = this.state;\n\t\tif ( ! error ) {\n\t\t\treturn this.props.children;\n\t\t}\n\n\t\tconst { title, description } = getErrorNotice();\n\n\t\treturn (\n\t\t\t<Stack\n\t\t\t\tclassName=\"edit-widgets-error-boundary\"\n\t\t\t\tdirection=\"column\"\n\t\t\t\tgap=\"lg\"\n\t\t\t>\n\t\t\t\t<Notice.Root intent=\"error\">\n\t\t\t\t\t<Notice.Title>{ title }</Notice.Title>\n\t\t\t\t\t<Notice.Description>{ description }</Notice.Description>\n\t\t\t\t\t<Notice.Actions>\n\t\t\t\t\t\t<CopyButton\n\t\t\t\t\t\t\tvariant=\"solid\"\n\t\t\t\t\t\t\ttext={ () =>\n\t\t\t\t\t\t\t\tgetErrorReport( error, componentStack )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Copy error' ) }\n\t\t\t\t\t\t</CopyButton>\n\t\t\t\t\t</Notice.Actions>\n\t\t\t\t</Notice.Root>\n\t\t\t\t{ globalThis.SCRIPT_DEBUG ? (\n\t\t\t\t\t<ErrorDetails\n\t\t\t\t\t\terror={ error }\n\t\t\t\t\t\tcomponentStack={ componentStack }\n\t\t\t\t\t/>\n\t\t\t\t) : null }\n\t\t\t</Stack>\n\t\t);\n\t}\n}\n"],
|
|
5
|
-
"mappings": ";AAAA,SAAS,iBAAiB;AAC1B,SAAS,aAAa;AACtB,SAAS,UAAU;AACnB,SAAS,MAAM,iBAAiB,QAAQ,OAAO,YAAY;AAC3D,SAAS,0BAA0B;AACnC,SAAS,gBAAgB;AA6EvB,cAeG,YAfH;AA3EF,SAAS,iBAAiB;AACzB,SAAO;AAAA,IACN,OAAO,GAAI,wBAAyB;AAAA,IACpC,aAAa;AAAA,MACZ;AAAA,IACD;AAAA,EACD;AACD;AAGA,SAAS,aAAc,OAAQ;AAC9B,SAAS,iBAAiB,SAAS,MAAM,QAAU;AACpD;AAEA,SAAS,gBAAiB,OAAQ;AACjC,MAAK,OAAO,UAAU,YAAY,OAAQ;AACzC,WAAO;AAAA,EACR;AAEA,MAAK,OAAO,OAAO,YAAY,YAAY,MAAM,SAAU;AAC1D,WAAO,MAAM;AAAA,EACd;AAEA,SAAO;AACR;AAKA,SAAS,iBAAkB,OAAO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,SAAP,EACA;AAAA,cAAC;AAAA;AAAA,gBACA,SAAQ;AAAA,gBACR,MAAO,MACN,eAAgB,OAAO,cAAe;AAAA,gBAGrC,aAAI,YAAa;AAAA;AAAA,YACpB,GACD;AAAA,aACD;AAAA,UACE,WAAW,eACZ;AAAA,YAAC;AAAA;AAAA,cACA;AAAA,cACA;AAAA;AAAA,UACD,IACG;AAAA;AAAA;AAAA,IACL;AAAA,EAEF;AACD;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../src/components/error-boundary/index.jsx"],"sourcesContent":["import { Component } from '@wordpress/element';\nimport { speak } from '@wordpress/a11y';\nimport { __ } from '@wordpress/i18n';\nimport { Card, CollapsibleCard, Notice, Stack, Text } from '@wordpress/ui';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { doAction } from '@wordpress/hooks';\n\nfunction getErrorNotice() {\n\treturn {\n\t\ttitle: __( 'The editor has crashed' ),\n\t\tdescription: __(\n\t\t\t'An unknown error occurred. Reload your browser to try again, or copy the error to report the problem or search.'\n\t\t),\n\t};\n}\n\n// A boundary catches whatever was thrown, which is not always an `Error`.\nfunction getErrorName( error ) {\n\treturn ( error instanceof Error && error.name ) || 'Error';\n}\n\nfunction getErrorMessage( error ) {\n\tif ( typeof error === 'string' && error ) {\n\t\treturn error;\n\t}\n\n\tif ( typeof error?.message === 'string' && error.message ) {\n\t\treturn error.message;\n\t}\n\n\treturn 'An unknown error occurred.';\n}\n\n// The sections of the report, shared by the copied Markdown and the details\n// panel so that the two cannot drift apart. Deliberately untranslated: both\n// are developer-facing, and the report is pasted into a bug report.\nfunction getErrorSections( error, componentStack ) {\n\tconst sections = [\n\t\t{ label: getErrorName( error ), content: getErrorMessage( error ) },\n\t];\n\n\tif ( error?.stack ) {\n\t\tsections.push( {\n\t\t\tlabel: 'Stack',\n\t\t\tcontent: error.stack.trim(),\n\t\t\tpreformatted: true,\n\t\t} );\n\t}\n\n\tif ( componentStack ) {\n\t\tsections.push( {\n\t\t\tlabel: 'Component stack',\n\t\t\tcontent: componentStack.trim(),\n\t\t\tpreformatted: true,\n\t\t} );\n\t}\n\n\tsections.push( {\n\t\tlabel: 'Environment',\n\t\tcontent: `User agent: ${ window.navigator.userAgent }`,\n\t\tpreformatted: true,\n\t} );\n\n\treturn sections;\n}\n\n// Markdown, so the report stays readable as plain text and renders when pasted\n// into a bug report.\nfunction getErrorReport( error, componentStack ) {\n\tconst sections = getErrorSections( error, componentStack ).map(\n\t\t( { label, content, preformatted } ) =>\n\t\t\t`**${ label }**\\n\\n${\n\t\t\t\tpreformatted ? `\\`\\`\\`\\n${ content }\\n\\`\\`\\`` : content\n\t\t\t}`\n\t);\n\n\treturn [ '### Error report', ...sections ].join( '\\n\\n' );\n}\n\nfunction CopyButton( { text, children, variant = 'outline' } ) {\n\tconst ref = useCopyToClipboard( text );\n\treturn (\n\t\t<Notice.ActionButton variant={ variant } ref={ ref }>\n\t\t\t{ children }\n\t\t</Notice.ActionButton>\n\t);\n}\n\nfunction ErrorReport( { error, componentStack } ) {\n\treturn (\n\t\t<Stack\n\t\t\tclassName=\"edit-widgets-error-boundary__report\"\n\t\t\tdirection=\"column\"\n\t\t\tgap=\"md\"\n\t\t>\n\t\t\t{ getErrorSections( error, componentStack ).map(\n\t\t\t\t( { label, content } ) => (\n\t\t\t\t\t<Stack key={ label } direction=\"column\" gap=\"xs\">\n\t\t\t\t\t\t<Text variant=\"heading-md\">{ label }</Text>\n\t\t\t\t\t\t<pre className=\"edit-widgets-error-boundary__report-section\">\n\t\t\t\t\t\t\t{ content }\n\t\t\t\t\t\t</pre>\n\t\t\t\t\t</Stack>\n\t\t\t\t)\n\t\t\t) }\n\t\t</Stack>\n\t);\n}\n\nfunction ErrorDetails( { error, componentStack } ) {\n\treturn (\n\t\t<CollapsibleCard.Root className=\"edit-widgets-error-boundary__details\">\n\t\t\t<CollapsibleCard.Header>\n\t\t\t\t<Card.Title>{ __( 'Error details' ) }</Card.Title>\n\t\t\t</CollapsibleCard.Header>\n\t\t\t<CollapsibleCard.Content>\n\t\t\t\t<ErrorReport\n\t\t\t\t\terror={ error }\n\t\t\t\t\tcomponentStack={ componentStack }\n\t\t\t\t/>\n\t\t\t</CollapsibleCard.Content>\n\t\t</CollapsibleCard.Root>\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\tcomponentStack: null,\n\t\t};\n\t}\n\n\tcomponentDidCatch( error, errorInfo ) {\n\t\tconst { title, description } = getErrorNotice();\n\t\tspeak( `${ title }. ${ description }`, 'assertive' );\n\t\tthis.setState( { componentStack: errorInfo?.componentStack } );\n\t\tdoAction( 'editor.ErrorBoundary.errorLogged', error, errorInfo );\n\t}\n\n\tstatic getDerivedStateFromError( error ) {\n\t\treturn { error };\n\t}\n\n\trender() {\n\t\tconst { error, componentStack } = this.state;\n\t\tif ( ! error ) {\n\t\t\treturn this.props.children;\n\t\t}\n\n\t\tconst { title, description } = getErrorNotice();\n\n\t\treturn (\n\t\t\t<Stack\n\t\t\t\tclassName=\"edit-widgets-error-boundary\"\n\t\t\t\tdirection=\"column\"\n\t\t\t\tgap=\"lg\"\n\t\t\t>\n\t\t\t\t<Notice.Root intent=\"error\">\n\t\t\t\t\t<Notice.Title>{ title }</Notice.Title>\n\t\t\t\t\t<Notice.Description>{ description }</Notice.Description>\n\t\t\t\t\t<Notice.Actions>\n\t\t\t\t\t\t<CopyButton\n\t\t\t\t\t\t\tvariant=\"solid\"\n\t\t\t\t\t\t\ttext={ () =>\n\t\t\t\t\t\t\t\tgetErrorReport( error, componentStack )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Copy error' ) }\n\t\t\t\t\t\t</CopyButton>\n\t\t\t\t\t</Notice.Actions>\n\t\t\t\t</Notice.Root>\n\t\t\t\t{ globalThis.SCRIPT_DEBUG ? (\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