@wordpress/customize-widgets 5.54.2-next.v.202608281122.0 → 5.55.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 +6 -1
- package/build/components/error-boundary/index.cjs +114 -15
- package/build/components/error-boundary/index.cjs.map +2 -2
- package/build/components/sidebar-block-editor/index.cjs +0 -1
- package/build/components/sidebar-block-editor/index.cjs.map +2 -2
- package/build-module/components/error-boundary/index.mjs +115 -16
- package/build-module/components/error-boundary/index.mjs.map +2 -2
- package/build-module/components/sidebar-block-editor/index.mjs +0 -1
- package/build-module/components/sidebar-block-editor/index.mjs.map +2 -2
- package/build-style/style-rtl.css +17 -0
- package/build-style/style.css +17 -0
- package/package.json +27 -26
- package/src/components/error-boundary/index.jsx +144 -17
- package/src/components/error-boundary/style.scss +16 -0
- package/src/components/error-boundary/test/{error-boundary.jsx → error-boundary.jsdom.test.jsx} +7 -3
- package/src/components/sidebar-block-editor/index.jsx +0 -1
- package/src/style.scss +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,10 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
-
## 5.
|
|
5
|
+
## 5.55.0 (2026-09-10)
|
|
6
|
+
|
|
7
|
+
### Enhancements
|
|
8
|
+
|
|
9
|
+
- Error boundary: Surface debugging details ([#82099](https://github.com/WordPress/gutenberg/pull/82099)).
|
|
6
10
|
|
|
7
11
|
### Internal
|
|
8
12
|
|
|
13
|
+
- Stop passing the unused `editorTool` block editor setting; the selector that read it was removed with the Write/Design tool in [#72193](https://github.com/WordPress/gutenberg/pull/72193) ([#82677](https://github.com/WordPress/gutenberg/pull/82677)).
|
|
9
14
|
- Remove unused dependency `@wordpress/interface` ([#82103](https://github.com/WordPress/gutenberg/pull/82103)).
|
|
10
15
|
- Use the `.jsx` extension for JavaScript source files that contain JSX ([#80990](https://github.com/WordPress/gutenberg/pull/80990)).
|
|
11
16
|
|
|
@@ -24,39 +24,138 @@ __export(error_boundary_exports, {
|
|
|
24
24
|
module.exports = __toCommonJS(error_boundary_exports);
|
|
25
25
|
var import_element = require("@wordpress/element");
|
|
26
26
|
var import_i18n = require("@wordpress/i18n");
|
|
27
|
-
var
|
|
28
|
-
var import_block_editor = require("@wordpress/block-editor");
|
|
27
|
+
var import_ui = require("@wordpress/ui");
|
|
29
28
|
var import_compose = require("@wordpress/compose");
|
|
30
29
|
var import_hooks = require("@wordpress/hooks");
|
|
31
30
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
32
|
-
function
|
|
31
|
+
function getErrorName(error) {
|
|
32
|
+
return error instanceof Error && error.name || "Error";
|
|
33
|
+
}
|
|
34
|
+
function getErrorMessage(error) {
|
|
35
|
+
if (typeof error === "string" && error) {
|
|
36
|
+
return error;
|
|
37
|
+
}
|
|
38
|
+
if (typeof error?.message === "string" && error.message) {
|
|
39
|
+
return error.message;
|
|
40
|
+
}
|
|
41
|
+
return "An unknown error occurred.";
|
|
42
|
+
}
|
|
43
|
+
function getErrorSections(error, componentStack) {
|
|
44
|
+
const sections = [
|
|
45
|
+
{ label: getErrorName(error), content: getErrorMessage(error) }
|
|
46
|
+
];
|
|
47
|
+
if (error?.stack) {
|
|
48
|
+
sections.push({
|
|
49
|
+
label: "Stack",
|
|
50
|
+
content: error.stack.trim(),
|
|
51
|
+
preformatted: true
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
if (componentStack) {
|
|
55
|
+
sections.push({
|
|
56
|
+
label: "Component stack",
|
|
57
|
+
content: componentStack.trim(),
|
|
58
|
+
preformatted: true
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
sections.push({
|
|
62
|
+
label: "Environment",
|
|
63
|
+
content: `User agent: ${window.navigator.userAgent}`,
|
|
64
|
+
preformatted: true
|
|
65
|
+
});
|
|
66
|
+
return sections;
|
|
67
|
+
}
|
|
68
|
+
function getErrorReport(error, componentStack) {
|
|
69
|
+
const sections = getErrorSections(error, componentStack).map(
|
|
70
|
+
({ label, content, preformatted }) => `**${label}**
|
|
71
|
+
|
|
72
|
+
${preformatted ? `\`\`\`
|
|
73
|
+
${content}
|
|
74
|
+
\`\`\`` : content}`
|
|
75
|
+
);
|
|
76
|
+
return ["### Error report", ...sections].join("\n\n");
|
|
77
|
+
}
|
|
78
|
+
function CopyButton({ text, children, variant = "outline" }) {
|
|
33
79
|
const ref = (0, import_compose.useCopyToClipboard)(text);
|
|
34
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
80
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.Notice.ActionButton, { variant, ref, children });
|
|
81
|
+
}
|
|
82
|
+
function ErrorReport({ error, componentStack }) {
|
|
83
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
84
|
+
import_ui.Stack,
|
|
85
|
+
{
|
|
86
|
+
className: "customize-widgets-error-boundary__report",
|
|
87
|
+
direction: "column",
|
|
88
|
+
gap: "md",
|
|
89
|
+
children: getErrorSections(error, componentStack).map(
|
|
90
|
+
({ label, content }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ui.Stack, { direction: "column", gap: "xs", children: [
|
|
91
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.Text, { variant: "heading-md", children: label }),
|
|
92
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", { className: "customize-widgets-error-boundary__report-section", children: content })
|
|
93
|
+
] }, label)
|
|
94
|
+
)
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
function ErrorDetails({ error, componentStack }) {
|
|
99
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ui.CollapsibleCard.Root, { className: "customize-widgets-error-boundary__details", children: [
|
|
100
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.CollapsibleCard.Header, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.Card.Title, { children: (0, import_i18n.__)("Error details") }) }),
|
|
101
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.CollapsibleCard.Content, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
102
|
+
ErrorReport,
|
|
103
|
+
{
|
|
104
|
+
error,
|
|
105
|
+
componentStack
|
|
106
|
+
}
|
|
107
|
+
) })
|
|
108
|
+
] });
|
|
35
109
|
}
|
|
36
110
|
var ErrorBoundary = class extends import_element.Component {
|
|
37
111
|
constructor() {
|
|
38
112
|
super(...arguments);
|
|
39
113
|
this.state = {
|
|
40
|
-
error: null
|
|
114
|
+
error: null,
|
|
115
|
+
componentStack: null
|
|
41
116
|
};
|
|
42
117
|
}
|
|
43
|
-
componentDidCatch(error) {
|
|
44
|
-
this.setState({
|
|
45
|
-
(0, import_hooks.doAction)("editor.ErrorBoundary.errorLogged", error);
|
|
118
|
+
componentDidCatch(error, errorInfo) {
|
|
119
|
+
this.setState({ componentStack: errorInfo?.componentStack });
|
|
120
|
+
(0, import_hooks.doAction)("editor.ErrorBoundary.errorLogged", error, errorInfo);
|
|
121
|
+
}
|
|
122
|
+
static getDerivedStateFromError(error) {
|
|
123
|
+
return { error };
|
|
46
124
|
}
|
|
47
125
|
render() {
|
|
48
|
-
const { error } = this.state;
|
|
126
|
+
const { error, componentStack } = this.state;
|
|
49
127
|
if (!error) {
|
|
50
128
|
return this.props.children;
|
|
51
129
|
}
|
|
52
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.
|
|
53
|
-
|
|
130
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
131
|
+
import_ui.Stack,
|
|
54
132
|
{
|
|
55
133
|
className: "customize-widgets-error-boundary",
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
134
|
+
direction: "column",
|
|
135
|
+
gap: "lg",
|
|
136
|
+
children: [
|
|
137
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ui.Notice.Root, { intent: "error", children: [
|
|
138
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.Notice.Title, { children: (0, import_i18n.__)("The editor has crashed") }),
|
|
139
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.Notice.Description, { children: (0, import_i18n.__)(
|
|
140
|
+
"An unknown error occurred. Reload your browser to try again, or copy the error to report the problem or search."
|
|
141
|
+
) }),
|
|
142
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.Notice.Actions, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
143
|
+
CopyButton,
|
|
144
|
+
{
|
|
145
|
+
variant: "solid",
|
|
146
|
+
text: () => getErrorReport(error, componentStack),
|
|
147
|
+
children: (0, import_i18n.__)("Copy error")
|
|
148
|
+
}
|
|
149
|
+
) })
|
|
150
|
+
] }),
|
|
151
|
+
globalThis.SCRIPT_DEBUG ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
152
|
+
ErrorDetails,
|
|
153
|
+
{
|
|
154
|
+
error,
|
|
155
|
+
componentStack
|
|
156
|
+
}
|
|
157
|
+
) : null
|
|
158
|
+
]
|
|
60
159
|
}
|
|
61
160
|
);
|
|
62
161
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/error-boundary/index.jsx"],
|
|
4
|
-
"sourcesContent": ["import { Component } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAA0B;AAC1B,kBAAmB;
|
|
4
|
+
"sourcesContent": ["import { Component } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n// eslint-disable-next-line @wordpress/use-recommended-components -- The fallback UI renders outside the editor's notice system.\nimport { Card, CollapsibleCard, Notice, Stack, Text } from '@wordpress/ui';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { doAction } from '@wordpress/hooks';\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=\"customize-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=\"customize-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=\"customize-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\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\treturn (\n\t\t\t<Stack\n\t\t\t\tclassName=\"customize-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>\n\t\t\t\t\t\t{ __( 'The editor has crashed' ) }\n\t\t\t\t\t</Notice.Title>\n\t\t\t\t\t<Notice.Description>\n\t\t\t\t\t\t{ __(\n\t\t\t\t\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\t\t\t\t) }\n\t\t\t\t\t</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;AAAA;AAAA;AAAA;AAAA;AAAA,qBAA0B;AAC1B,kBAAmB;AAEnB,gBAA2D;AAC3D,qBAAmC;AACnC,mBAAyB;AAoEvB;AAjEF,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,O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AAAA,gBAGrC,8BAAI,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
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/sidebar-block-editor/index.jsx"],
|
|
4
|
-
"sourcesContent": ["import { useViewportMatch } from '@wordpress/compose';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo, createPortal } from '@wordpress/element';\nimport {\n\tBlockList,\n\tBlockToolbar,\n\tBlockInspector,\n\tprivateApis as blockEditorPrivateApis,\n\t__unstableBlockSettingsMenuFirstItem,\n} from '@wordpress/block-editor';\nimport { uploadMedia } from '@wordpress/media-utils';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport BlockInspectorButton from '../block-inspector-button';\nimport Header from '../header';\nimport useInserter from '../inserter/use-inserter';\nimport SidebarEditorProvider from './sidebar-editor-provider';\nimport WelcomeGuide from '../welcome-guide';\nimport KeyboardShortcuts from '../keyboard-shortcuts';\nimport BlockAppender from '../block-appender';\nimport { unlock } from '../../lock-unlock';\n\nconst { ExperimentalBlockCanvas: BlockCanvas } = unlock(\n\tblockEditorPrivateApis\n);\n\nexport default function SidebarBlockEditor( {\n\tblockEditorSettings,\n\tsidebar,\n\tinserter,\n\tinspector,\n} ) {\n\tconst [ isInserterOpened, setIsInserterOpened ] = useInserter( inserter );\n\tconst isMediumViewport = useViewportMatch( 'small' );\n\tconst {\n\t\thasUploadPermissions,\n\t\tisFixedToolbarActive,\n\t\tkeepCaretInsideBlock,\n\t\tisWelcomeGuideActive,\n\t} = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\treturn {\n\t\t\thasUploadPermissions:\n\t\t\t\tselect( coreStore ).canUser( 'create', {\n\t\t\t\t\tkind: 'postType',\n\t\t\t\t\tname: 'attachment',\n\t\t\t\t} ) ?? true,\n\t\t\tisFixedToolbarActive: !! get(\n\t\t\t\t'core/customize-widgets',\n\t\t\t\t'fixedToolbar'\n\t\t\t),\n\t\t\tkeepCaretInsideBlock: !! get(\n\t\t\t\t'core/customize-widgets',\n\t\t\t\t'keepCaretInsideBlock'\n\t\t\t),\n\t\t\tisWelcomeGuideActive: !! get(\n\t\t\t\t'core/customize-widgets',\n\t\t\t\t'welcomeGuide'\n\t\t\t),\n\t\t};\n\t}, [] );\n\tconst settings = useMemo( () => {\n\t\tlet mediaUploadBlockEditor;\n\t\tif ( hasUploadPermissions ) {\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\n\t\treturn {\n\t\t\t...blockEditorSettings,\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpened,\n\t\t\tmediaUpload: mediaUploadBlockEditor,\n\t\t\thasFixedToolbar: isFixedToolbarActive || ! isMediumViewport,\n\t\t\tkeepCaretInsideBlock,\n\t\t\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAiC;AACjC,uBAAmC;AACnC,kBAA0B;AAC1B,qBAAsC;AACtC,0BAMO;AACP,yBAA4B;AAC5B,yBAA0C;AAC1C,oCAAiC;AACjC,oBAAmB;AACnB,0BAAwB;AACxB,qCAAkC;AAClC,2BAAyB;AACzB,gCAA8B;AAC9B,4BAA0B;AAC1B,yBAAuB;
|
|
4
|
+
"sourcesContent": ["import { useViewportMatch } from '@wordpress/compose';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo, createPortal } from '@wordpress/element';\nimport {\n\tBlockList,\n\tBlockToolbar,\n\tBlockInspector,\n\tprivateApis as blockEditorPrivateApis,\n\t__unstableBlockSettingsMenuFirstItem,\n} from '@wordpress/block-editor';\nimport { uploadMedia } from '@wordpress/media-utils';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport BlockInspectorButton from '../block-inspector-button';\nimport Header from '../header';\nimport useInserter from '../inserter/use-inserter';\nimport SidebarEditorProvider from './sidebar-editor-provider';\nimport WelcomeGuide from '../welcome-guide';\nimport KeyboardShortcuts from '../keyboard-shortcuts';\nimport BlockAppender from '../block-appender';\nimport { unlock } from '../../lock-unlock';\n\nconst { ExperimentalBlockCanvas: BlockCanvas } = unlock(\n\tblockEditorPrivateApis\n);\n\nexport default function SidebarBlockEditor( {\n\tblockEditorSettings,\n\tsidebar,\n\tinserter,\n\tinspector,\n} ) {\n\tconst [ isInserterOpened, setIsInserterOpened ] = useInserter( inserter );\n\tconst isMediumViewport = useViewportMatch( 'small' );\n\tconst {\n\t\thasUploadPermissions,\n\t\tisFixedToolbarActive,\n\t\tkeepCaretInsideBlock,\n\t\tisWelcomeGuideActive,\n\t} = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\treturn {\n\t\t\thasUploadPermissions:\n\t\t\t\tselect( coreStore ).canUser( 'create', {\n\t\t\t\t\tkind: 'postType',\n\t\t\t\t\tname: 'attachment',\n\t\t\t\t} ) ?? true,\n\t\t\tisFixedToolbarActive: !! get(\n\t\t\t\t'core/customize-widgets',\n\t\t\t\t'fixedToolbar'\n\t\t\t),\n\t\t\tkeepCaretInsideBlock: !! get(\n\t\t\t\t'core/customize-widgets',\n\t\t\t\t'keepCaretInsideBlock'\n\t\t\t),\n\t\t\tisWelcomeGuideActive: !! get(\n\t\t\t\t'core/customize-widgets',\n\t\t\t\t'welcomeGuide'\n\t\t\t),\n\t\t};\n\t}, [] );\n\tconst settings = useMemo( () => {\n\t\tlet mediaUploadBlockEditor;\n\t\tif ( hasUploadPermissions ) {\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\n\t\treturn {\n\t\t\t...blockEditorSettings,\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpened,\n\t\t\tmediaUpload: mediaUploadBlockEditor,\n\t\t\thasFixedToolbar: isFixedToolbarActive || ! isMediumViewport,\n\t\t\tkeepCaretInsideBlock,\n\t\t\t__unstableHasCustomAppender: true,\n\t\t};\n\t}, [\n\t\thasUploadPermissions,\n\t\tblockEditorSettings,\n\t\tisFixedToolbarActive,\n\t\tisMediumViewport,\n\t\tkeepCaretInsideBlock,\n\t\tsetIsInserterOpened,\n\t] );\n\n\tif ( isWelcomeGuideActive ) {\n\t\treturn <WelcomeGuide sidebar={ sidebar } />;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<KeyboardShortcuts.Register />\n\n\t\t\t<SidebarEditorProvider sidebar={ sidebar } settings={ settings }>\n\t\t\t\t<KeyboardShortcuts\n\t\t\t\t\tundo={ sidebar.undo }\n\t\t\t\t\tredo={ sidebar.redo }\n\t\t\t\t\tsave={ sidebar.save }\n\t\t\t\t/>\n\n\t\t\t\t<Header\n\t\t\t\t\tsidebar={ sidebar }\n\t\t\t\t\tinserter={ inserter }\n\t\t\t\t\tisInserterOpened={ isInserterOpened }\n\t\t\t\t\tsetIsInserterOpened={ setIsInserterOpened }\n\t\t\t\t\tisFixedToolbarActive={\n\t\t\t\t\t\tisFixedToolbarActive || ! isMediumViewport\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t{ ( isFixedToolbarActive || ! isMediumViewport ) && (\n\t\t\t\t\t<BlockToolbar hideDragHandle />\n\t\t\t\t) }\n\t\t\t\t<BlockCanvas\n\t\t\t\t\tshouldIframe={ false }\n\t\t\t\t\tstyles={ settings.defaultEditorStyles }\n\t\t\t\t\theight=\"100%\"\n\t\t\t\t>\n\t\t\t\t\t<BlockList renderAppender={ BlockAppender } />\n\t\t\t\t</BlockCanvas>\n\n\t\t\t\t{ createPortal(\n\t\t\t\t\t// This is a temporary hack to prevent button component inside <BlockInspector>\n\t\t\t\t\t// from submitting form when type=\"button\" is not specified.\n\t\t\t\t\t<form onSubmit={ ( event ) => event.preventDefault() }>\n\t\t\t\t\t\t<BlockInspector />\n\t\t\t\t\t</form>,\n\t\t\t\t\tinspector.contentContainer[ 0 ]\n\t\t\t\t) }\n\t\t\t</SidebarEditorProvider>\n\n\t\t\t<__unstableBlockSettingsMenuFirstItem>\n\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t<BlockInspectorButton\n\t\t\t\t\t\tinspector={ inspector }\n\t\t\t\t\t\tcloseMenu={ onClose }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</__unstableBlockSettingsMenuFirstItem>\n\t\t</>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAiC;AACjC,uBAAmC;AACnC,kBAA0B;AAC1B,qBAAsC;AACtC,0BAMO;AACP,yBAA4B;AAC5B,yBAA0C;AAC1C,oCAAiC;AACjC,oBAAmB;AACnB,0BAAwB;AACxB,qCAAkC;AAClC,2BAAyB;AACzB,gCAA8B;AAC9B,4BAA0B;AAC1B,yBAAuB;AAuEd;AArET,IAAM,EAAE,yBAAyB,YAAY,QAAI;AAAA,EAChD,oBAAAA;AACD;AAEe,SAAR,mBAAqC;AAAA,EAC3C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,QAAM,CAAE,kBAAkB,mBAAoB,QAAI,oBAAAC,SAAa,QA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AAAC,SAAA,EAAsB,SAAoB,UAC1C;AAAA;AAAA,QAAC,0BAAAD;AAAA,QAAA;AAAA,UACA,MAAO,QAAQ;AAAA,UACf,MAAO,QAAQ;AAAA,UACf,MAAO,QAAQ;AAAA;AAAA,MAChB;AAAA,MAEA;AAAA,QAAC,cAAAE;AAAA,QAAA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA,sBACC,wBAAwB,CAAE;AAAA;AAAA,MAE5B;AAAA,OACI,wBAAwB,CAAE,qBAC7B,4CAAC,oCAAa,gBAAc,MAAC;AAAA,MAE9B;AAAA,QAAC;AAAA;AAAA,UACA,cAAe;AAAA,UACf,QAAS,SAAS;AAAA,UAClB,QAAO;AAAA,UAEP,sDAAC,iCAAU,gBAAiB,sBAAAC,SAAgB;AAAA;AAAA,MAC7C;AAAA,UAEE;AAAA;AAAA;AAAA,QAGD,4CAAC,UAAK,UAAW,CAAE,UAAW,MAAM,eAAe,GAClD,sDAAC,sCAAe,GACjB;AAAA,QACA,UAAU,iBAAkB,CAAE;AAAA,MAC/B;AAAA,OACD;AAAA,IAEA,4CAAC,4DACE,WAAE,EAAE,QAAQ,MACb;AAAA,MAAC,8BAAAC;AAAA,MAAA;AAAA,QACA;AAAA,QACA,WAAY;AAAA;AAAA,IACb,GAEF;AAAA,KACD;AAEF;",
|
|
6
6
|
"names": ["blockEditorPrivateApis", "useInserter", "preferencesStore", "coreStore", "WelcomeGuide", "KeyboardShortcuts", "SidebarEditorProvider", "Header", "BlockAppender", "BlockInspectorButton"]
|
|
7
7
|
}
|
|
@@ -1,39 +1,138 @@
|
|
|
1
1
|
// packages/customize-widgets/src/components/error-boundary/index.jsx
|
|
2
2
|
import { Component } from "@wordpress/element";
|
|
3
3
|
import { __ } from "@wordpress/i18n";
|
|
4
|
-
import {
|
|
5
|
-
import { Warning } from "@wordpress/block-editor";
|
|
4
|
+
import { Card, CollapsibleCard, Notice, Stack, Text } from "@wordpress/ui";
|
|
6
5
|
import { useCopyToClipboard } from "@wordpress/compose";
|
|
7
6
|
import { doAction } from "@wordpress/hooks";
|
|
8
|
-
import { jsx } from "react/jsx-runtime";
|
|
9
|
-
function
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
function getErrorName(error) {
|
|
9
|
+
return error instanceof Error && error.name || "Error";
|
|
10
|
+
}
|
|
11
|
+
function getErrorMessage(error) {
|
|
12
|
+
if (typeof error === "string" && error) {
|
|
13
|
+
return error;
|
|
14
|
+
}
|
|
15
|
+
if (typeof error?.message === "string" && error.message) {
|
|
16
|
+
return error.message;
|
|
17
|
+
}
|
|
18
|
+
return "An unknown error occurred.";
|
|
19
|
+
}
|
|
20
|
+
function getErrorSections(error, componentStack) {
|
|
21
|
+
const sections = [
|
|
22
|
+
{ label: getErrorName(error), content: getErrorMessage(error) }
|
|
23
|
+
];
|
|
24
|
+
if (error?.stack) {
|
|
25
|
+
sections.push({
|
|
26
|
+
label: "Stack",
|
|
27
|
+
content: error.stack.trim(),
|
|
28
|
+
preformatted: true
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
if (componentStack) {
|
|
32
|
+
sections.push({
|
|
33
|
+
label: "Component stack",
|
|
34
|
+
content: componentStack.trim(),
|
|
35
|
+
preformatted: true
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
sections.push({
|
|
39
|
+
label: "Environment",
|
|
40
|
+
content: `User agent: ${window.navigator.userAgent}`,
|
|
41
|
+
preformatted: true
|
|
42
|
+
});
|
|
43
|
+
return sections;
|
|
44
|
+
}
|
|
45
|
+
function getErrorReport(error, componentStack) {
|
|
46
|
+
const sections = getErrorSections(error, componentStack).map(
|
|
47
|
+
({ label, content, preformatted }) => `**${label}**
|
|
48
|
+
|
|
49
|
+
${preformatted ? `\`\`\`
|
|
50
|
+
${content}
|
|
51
|
+
\`\`\`` : content}`
|
|
52
|
+
);
|
|
53
|
+
return ["### Error report", ...sections].join("\n\n");
|
|
54
|
+
}
|
|
55
|
+
function CopyButton({ text, children, variant = "outline" }) {
|
|
10
56
|
const ref = useCopyToClipboard(text);
|
|
11
|
-
return /* @__PURE__ */ jsx(
|
|
57
|
+
return /* @__PURE__ */ jsx(Notice.ActionButton, { variant, ref, children });
|
|
58
|
+
}
|
|
59
|
+
function ErrorReport({ error, componentStack }) {
|
|
60
|
+
return /* @__PURE__ */ jsx(
|
|
61
|
+
Stack,
|
|
62
|
+
{
|
|
63
|
+
className: "customize-widgets-error-boundary__report",
|
|
64
|
+
direction: "column",
|
|
65
|
+
gap: "md",
|
|
66
|
+
children: getErrorSections(error, componentStack).map(
|
|
67
|
+
({ label, content }) => /* @__PURE__ */ jsxs(Stack, { direction: "column", gap: "xs", children: [
|
|
68
|
+
/* @__PURE__ */ jsx(Text, { variant: "heading-md", children: label }),
|
|
69
|
+
/* @__PURE__ */ jsx("pre", { className: "customize-widgets-error-boundary__report-section", children: content })
|
|
70
|
+
] }, label)
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
function ErrorDetails({ error, componentStack }) {
|
|
76
|
+
return /* @__PURE__ */ jsxs(CollapsibleCard.Root, { className: "customize-widgets-error-boundary__details", children: [
|
|
77
|
+
/* @__PURE__ */ jsx(CollapsibleCard.Header, { children: /* @__PURE__ */ jsx(Card.Title, { children: __("Error details") }) }),
|
|
78
|
+
/* @__PURE__ */ jsx(CollapsibleCard.Content, { children: /* @__PURE__ */ jsx(
|
|
79
|
+
ErrorReport,
|
|
80
|
+
{
|
|
81
|
+
error,
|
|
82
|
+
componentStack
|
|
83
|
+
}
|
|
84
|
+
) })
|
|
85
|
+
] });
|
|
12
86
|
}
|
|
13
87
|
var ErrorBoundary = class extends Component {
|
|
14
88
|
constructor() {
|
|
15
89
|
super(...arguments);
|
|
16
90
|
this.state = {
|
|
17
|
-
error: null
|
|
91
|
+
error: null,
|
|
92
|
+
componentStack: null
|
|
18
93
|
};
|
|
19
94
|
}
|
|
20
|
-
componentDidCatch(error) {
|
|
21
|
-
this.setState({
|
|
22
|
-
doAction("editor.ErrorBoundary.errorLogged", error);
|
|
95
|
+
componentDidCatch(error, errorInfo) {
|
|
96
|
+
this.setState({ componentStack: errorInfo?.componentStack });
|
|
97
|
+
doAction("editor.ErrorBoundary.errorLogged", error, errorInfo);
|
|
98
|
+
}
|
|
99
|
+
static getDerivedStateFromError(error) {
|
|
100
|
+
return { error };
|
|
23
101
|
}
|
|
24
102
|
render() {
|
|
25
|
-
const { error } = this.state;
|
|
103
|
+
const { error, componentStack } = this.state;
|
|
26
104
|
if (!error) {
|
|
27
105
|
return this.props.children;
|
|
28
106
|
}
|
|
29
|
-
return /* @__PURE__ */
|
|
30
|
-
|
|
107
|
+
return /* @__PURE__ */ jsxs(
|
|
108
|
+
Stack,
|
|
31
109
|
{
|
|
32
110
|
className: "customize-widgets-error-boundary",
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
111
|
+
direction: "column",
|
|
112
|
+
gap: "lg",
|
|
113
|
+
children: [
|
|
114
|
+
/* @__PURE__ */ jsxs(Notice.Root, { intent: "error", children: [
|
|
115
|
+
/* @__PURE__ */ jsx(Notice.Title, { children: __("The editor has crashed") }),
|
|
116
|
+
/* @__PURE__ */ jsx(Notice.Description, { children: __(
|
|
117
|
+
"An unknown error occurred. Reload your browser to try again, or copy the error to report the problem or search."
|
|
118
|
+
) }),
|
|
119
|
+
/* @__PURE__ */ jsx(Notice.Actions, { children: /* @__PURE__ */ jsx(
|
|
120
|
+
CopyButton,
|
|
121
|
+
{
|
|
122
|
+
variant: "solid",
|
|
123
|
+
text: () => getErrorReport(error, componentStack),
|
|
124
|
+
children: __("Copy error")
|
|
125
|
+
}
|
|
126
|
+
) })
|
|
127
|
+
] }),
|
|
128
|
+
globalThis.SCRIPT_DEBUG ? /* @__PURE__ */ jsx(
|
|
129
|
+
ErrorDetails,
|
|
130
|
+
{
|
|
131
|
+
error,
|
|
132
|
+
componentStack
|
|
133
|
+
}
|
|
134
|
+
) : null
|
|
135
|
+
]
|
|
37
136
|
}
|
|
38
137
|
);
|
|
39
138
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/error-boundary/index.jsx"],
|
|
4
|
-
"sourcesContent": ["import { Component } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\
|
|
5
|
-
"mappings": ";AAAA,SAAS,iBAAiB;AAC1B,SAAS,UAAU;AACnB,SAAS,cAAc;
|
|
4
|
+
"sourcesContent": ["import { Component } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n// eslint-disable-next-line @wordpress/use-recommended-components -- The fallback UI renders outside the editor's notice system.\nimport { Card, CollapsibleCard, Notice, Stack, Text } from '@wordpress/ui';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { doAction } from '@wordpress/hooks';\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=\"customize-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=\"customize-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=\"customize-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\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\treturn (\n\t\t\t<Stack\n\t\t\t\tclassName=\"customize-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>\n\t\t\t\t\t\t{ __( 'The editor has crashed' ) }\n\t\t\t\t\t</Notice.Title>\n\t\t\t\t\t<Notice.Description>\n\t\t\t\t\t\t{ __(\n\t\t\t\t\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\t\t\t\t) }\n\t\t\t\t\t</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={ component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AAO,EAAE,MAAM;AAAA,EAChB;AAAA,EAEA,SAAS;AACR,UAAM,EAAE,OAAO,eAAe,IAAI,KAAK;AACvC,QAAK,CAAE,OAAQ;AACd,aAAO,KAAK,MAAM;AAAA,IACnB;AAEA,WACC;AAAA,MAAC;AAAA;AAAA,QACA,WAAU;AAAA,QACV,WAAU;AAAA,QACV,KAAI;AAAA,QAEJ;AAAA,+BAAC,OAAO,MAAP,EAAY,QAAO,SACnB;AAAA,gCAAC,OAAO,OAAP,EACE,aAAI,wBAAyB,GAChC;AAAA,YACA,oBAAC,OAAO,aAAP,EACE;AAAA,cACD;AAAA,YACD,GACD;AAAA,YACA,oBAAC,OAAO,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
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/sidebar-block-editor/index.jsx"],
|
|
4
|
-
"sourcesContent": ["import { useViewportMatch } from '@wordpress/compose';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo, createPortal } from '@wordpress/element';\nimport {\n\tBlockList,\n\tBlockToolbar,\n\tBlockInspector,\n\tprivateApis as blockEditorPrivateApis,\n\t__unstableBlockSettingsMenuFirstItem,\n} from '@wordpress/block-editor';\nimport { uploadMedia } from '@wordpress/media-utils';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport BlockInspectorButton from '../block-inspector-button';\nimport Header from '../header';\nimport useInserter from '../inserter/use-inserter';\nimport SidebarEditorProvider from './sidebar-editor-provider';\nimport WelcomeGuide from '../welcome-guide';\nimport KeyboardShortcuts from '../keyboard-shortcuts';\nimport BlockAppender from '../block-appender';\nimport { unlock } from '../../lock-unlock';\n\nconst { ExperimentalBlockCanvas: BlockCanvas } = unlock(\n\tblockEditorPrivateApis\n);\n\nexport default function SidebarBlockEditor( {\n\tblockEditorSettings,\n\tsidebar,\n\tinserter,\n\tinspector,\n} ) {\n\tconst [ isInserterOpened, setIsInserterOpened ] = useInserter( inserter );\n\tconst isMediumViewport = useViewportMatch( 'small' );\n\tconst {\n\t\thasUploadPermissions,\n\t\tisFixedToolbarActive,\n\t\tkeepCaretInsideBlock,\n\t\tisWelcomeGuideActive,\n\t} = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\treturn {\n\t\t\thasUploadPermissions:\n\t\t\t\tselect( coreStore ).canUser( 'create', {\n\t\t\t\t\tkind: 'postType',\n\t\t\t\t\tname: 'attachment',\n\t\t\t\t} ) ?? true,\n\t\t\tisFixedToolbarActive: !! get(\n\t\t\t\t'core/customize-widgets',\n\t\t\t\t'fixedToolbar'\n\t\t\t),\n\t\t\tkeepCaretInsideBlock: !! get(\n\t\t\t\t'core/customize-widgets',\n\t\t\t\t'keepCaretInsideBlock'\n\t\t\t),\n\t\t\tisWelcomeGuideActive: !! get(\n\t\t\t\t'core/customize-widgets',\n\t\t\t\t'welcomeGuide'\n\t\t\t),\n\t\t};\n\t}, [] );\n\tconst settings = useMemo( () => {\n\t\tlet mediaUploadBlockEditor;\n\t\tif ( hasUploadPermissions ) {\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\n\t\treturn {\n\t\t\t...blockEditorSettings,\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpened,\n\t\t\tmediaUpload: mediaUploadBlockEditor,\n\t\t\thasFixedToolbar: isFixedToolbarActive || ! isMediumViewport,\n\t\t\tkeepCaretInsideBlock,\n\t\t\
|
|
5
|
-
"mappings": ";AAAA,SAAS,wBAAwB;AACjC,SAAS,SAAS,iBAAiB;AACnC,SAAS,iBAAiB;AAC1B,SAAS,SAAS,oBAAoB;AACtC;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AAAA,EACf;AAAA,OACM;AACP,SAAS,mBAAmB;AAC5B,SAAS,SAAS,wBAAwB;AAC1C,OAAO,0BAA0B;AACjC,OAAO,YAAY;AACnB,OAAO,iBAAiB;AACxB,OAAO,2BAA2B;AAClC,OAAO,kBAAkB;AACzB,OAAO,uBAAuB;AAC9B,OAAO,mBAAmB;AAC1B,SAAS,cAAc;
|
|
4
|
+
"sourcesContent": ["import { useViewportMatch } from '@wordpress/compose';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo, createPortal } from '@wordpress/element';\nimport {\n\tBlockList,\n\tBlockToolbar,\n\tBlockInspector,\n\tprivateApis as blockEditorPrivateApis,\n\t__unstableBlockSettingsMenuFirstItem,\n} from '@wordpress/block-editor';\nimport { uploadMedia } from '@wordpress/media-utils';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport BlockInspectorButton from '../block-inspector-button';\nimport Header from '../header';\nimport useInserter from '../inserter/use-inserter';\nimport SidebarEditorProvider from './sidebar-editor-provider';\nimport WelcomeGuide from '../welcome-guide';\nimport KeyboardShortcuts from '../keyboard-shortcuts';\nimport BlockAppender from '../block-appender';\nimport { unlock } from '../../lock-unlock';\n\nconst { ExperimentalBlockCanvas: BlockCanvas } = unlock(\n\tblockEditorPrivateApis\n);\n\nexport default function SidebarBlockEditor( {\n\tblockEditorSettings,\n\tsidebar,\n\tinserter,\n\tinspector,\n} ) {\n\tconst [ isInserterOpened, setIsInserterOpened ] = useInserter( inserter );\n\tconst isMediumViewport = useViewportMatch( 'small' );\n\tconst {\n\t\thasUploadPermissions,\n\t\tisFixedToolbarActive,\n\t\tkeepCaretInsideBlock,\n\t\tisWelcomeGuideActive,\n\t} = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\treturn {\n\t\t\thasUploadPermissions:\n\t\t\t\tselect( coreStore ).canUser( 'create', {\n\t\t\t\t\tkind: 'postType',\n\t\t\t\t\tname: 'attachment',\n\t\t\t\t} ) ?? true,\n\t\t\tisFixedToolbarActive: !! get(\n\t\t\t\t'core/customize-widgets',\n\t\t\t\t'fixedToolbar'\n\t\t\t),\n\t\t\tkeepCaretInsideBlock: !! get(\n\t\t\t\t'core/customize-widgets',\n\t\t\t\t'keepCaretInsideBlock'\n\t\t\t),\n\t\t\tisWelcomeGuideActive: !! get(\n\t\t\t\t'core/customize-widgets',\n\t\t\t\t'welcomeGuide'\n\t\t\t),\n\t\t};\n\t}, [] );\n\tconst settings = useMemo( () => {\n\t\tlet mediaUploadBlockEditor;\n\t\tif ( hasUploadPermissions ) {\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\n\t\treturn {\n\t\t\t...blockEditorSettings,\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpened,\n\t\t\tmediaUpload: mediaUploadBlockEditor,\n\t\t\thasFixedToolbar: isFixedToolbarActive || ! isMediumViewport,\n\t\t\tkeepCaretInsideBlock,\n\t\t\t__unstableHasCustomAppender: true,\n\t\t};\n\t}, [\n\t\thasUploadPermissions,\n\t\tblockEditorSettings,\n\t\tisFixedToolbarActive,\n\t\tisMediumViewport,\n\t\tkeepCaretInsideBlock,\n\t\tsetIsInserterOpened,\n\t] );\n\n\tif ( isWelcomeGuideActive ) {\n\t\treturn <WelcomeGuide sidebar={ sidebar } />;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<KeyboardShortcuts.Register />\n\n\t\t\t<SidebarEditorProvider sidebar={ sidebar } settings={ settings }>\n\t\t\t\t<KeyboardShortcuts\n\t\t\t\t\tundo={ sidebar.undo }\n\t\t\t\t\tredo={ sidebar.redo }\n\t\t\t\t\tsave={ sidebar.save }\n\t\t\t\t/>\n\n\t\t\t\t<Header\n\t\t\t\t\tsidebar={ sidebar }\n\t\t\t\t\tinserter={ inserter }\n\t\t\t\t\tisInserterOpened={ isInserterOpened }\n\t\t\t\t\tsetIsInserterOpened={ setIsInserterOpened }\n\t\t\t\t\tisFixedToolbarActive={\n\t\t\t\t\t\tisFixedToolbarActive || ! isMediumViewport\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t{ ( isFixedToolbarActive || ! isMediumViewport ) && (\n\t\t\t\t\t<BlockToolbar hideDragHandle />\n\t\t\t\t) }\n\t\t\t\t<BlockCanvas\n\t\t\t\t\tshouldIframe={ false }\n\t\t\t\t\tstyles={ settings.defaultEditorStyles }\n\t\t\t\t\theight=\"100%\"\n\t\t\t\t>\n\t\t\t\t\t<BlockList renderAppender={ BlockAppender } />\n\t\t\t\t</BlockCanvas>\n\n\t\t\t\t{ createPortal(\n\t\t\t\t\t// This is a temporary hack to prevent button component inside <BlockInspector>\n\t\t\t\t\t// from submitting form when type=\"button\" is not specified.\n\t\t\t\t\t<form onSubmit={ ( event ) => event.preventDefault() }>\n\t\t\t\t\t\t<BlockInspector />\n\t\t\t\t\t</form>,\n\t\t\t\t\tinspector.contentContainer[ 0 ]\n\t\t\t\t) }\n\t\t\t</SidebarEditorProvider>\n\n\t\t\t<__unstableBlockSettingsMenuFirstItem>\n\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t<BlockInspectorButton\n\t\t\t\t\t\tinspector={ inspector }\n\t\t\t\t\t\tcloseMenu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,kBAAe,GACjB;AAAA,QACA,UAAU,iBAAkB,CAAE;AAAA,MAC/B;AAAA,OACD;AAAA,IAEA,oBAAC,wCACE,WAAE,EAAE,QAAQ,MACb;AAAA,MAAC;AAAA;AAAA,QACA;AAAA,QACA,WAAY;AAAA;AAAA,IACb,GAEF;AAAA,KACD;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -130,6 +130,23 @@
|
|
|
130
130
|
transform: translateX(100%);
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
+
.customize-widgets-error-boundary {
|
|
134
|
+
font-family: var(--wpds-typography-font-family-body, -apple-system, system-ui, "Segoe UI", "Roboto", "Oxygen-Sans", "Ubuntu", "Cantarell", "Helvetica Neue", sans-serif);
|
|
135
|
+
padding: var(--wpds-dimension-padding-md, 12px);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.customize-widgets-error-boundary__report {
|
|
139
|
+
max-height: 420px;
|
|
140
|
+
overflow: auto;
|
|
141
|
+
overflow-anchor: none;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.customize-widgets-error-boundary__report-section {
|
|
145
|
+
margin: 0;
|
|
146
|
+
white-space: pre-wrap;
|
|
147
|
+
overflow-wrap: break-word;
|
|
148
|
+
}
|
|
149
|
+
|
|
133
150
|
@media (min-width: 600px) {
|
|
134
151
|
.customize-widgets-header {
|
|
135
152
|
margin-bottom: 44px;
|
package/build-style/style.css
CHANGED
|
@@ -130,6 +130,23 @@
|
|
|
130
130
|
transform: translateX(-100%);
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
+
.customize-widgets-error-boundary {
|
|
134
|
+
font-family: var(--wpds-typography-font-family-body, -apple-system, system-ui, "Segoe UI", "Roboto", "Oxygen-Sans", "Ubuntu", "Cantarell", "Helvetica Neue", sans-serif);
|
|
135
|
+
padding: var(--wpds-dimension-padding-md, 12px);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.customize-widgets-error-boundary__report {
|
|
139
|
+
max-height: 420px;
|
|
140
|
+
overflow: auto;
|
|
141
|
+
overflow-anchor: none;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.customize-widgets-error-boundary__report-section {
|
|
145
|
+
margin: 0;
|
|
146
|
+
white-space: pre-wrap;
|
|
147
|
+
overflow-wrap: break-word;
|
|
148
|
+
}
|
|
149
|
+
|
|
133
150
|
@media (min-width: 600px) {
|
|
134
151
|
.customize-widgets-header {
|
|
135
152
|
margin-bottom: 44px;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/customize-widgets",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.55.0",
|
|
4
4
|
"description": "Widgets blocks in Customizer Module for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -39,35 +39,36 @@
|
|
|
39
39
|
},
|
|
40
40
|
"wpScript": true,
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@wordpress/admin-ui": "^2.
|
|
43
|
-
"@wordpress/base-styles": "^13.
|
|
44
|
-
"@wordpress/block-editor": "^17.
|
|
45
|
-
"@wordpress/block-library": "^
|
|
46
|
-
"@wordpress/blocks": "^16.0.
|
|
47
|
-
"@wordpress/components": "^40.1.
|
|
48
|
-
"@wordpress/compose": "^8.
|
|
49
|
-
"@wordpress/core-data": "^
|
|
50
|
-
"@wordpress/data": "^10.
|
|
51
|
-
"@wordpress/dom": "^4.
|
|
52
|
-
"@wordpress/element": "^8.
|
|
53
|
-
"@wordpress/hooks": "^4.
|
|
54
|
-
"@wordpress/i18n": "^6.
|
|
55
|
-
"@wordpress/icons": "^
|
|
56
|
-
"@wordpress/is-shallow-equal": "^5.
|
|
57
|
-
"@wordpress/keyboard-shortcuts": "^5.
|
|
58
|
-
"@wordpress/keycodes": "^4.
|
|
59
|
-
"@wordpress/media-utils": "^5.
|
|
60
|
-
"@wordpress/preferences": "^4.
|
|
61
|
-
"@wordpress/private-apis": "^1.
|
|
62
|
-
"@wordpress/theme": "^2.1.
|
|
63
|
-
"@wordpress/ui": "^0.22.
|
|
64
|
-
"@wordpress/widgets": "^4.
|
|
42
|
+
"@wordpress/admin-ui": "^2.10.0",
|
|
43
|
+
"@wordpress/base-styles": "^13.1.0",
|
|
44
|
+
"@wordpress/block-editor": "^17.1.0",
|
|
45
|
+
"@wordpress/block-library": "^11.0.0",
|
|
46
|
+
"@wordpress/blocks": "^16.0.0",
|
|
47
|
+
"@wordpress/components": "^40.1.0",
|
|
48
|
+
"@wordpress/compose": "^8.8.0",
|
|
49
|
+
"@wordpress/core-data": "^8.0.0",
|
|
50
|
+
"@wordpress/data": "^10.55.0",
|
|
51
|
+
"@wordpress/dom": "^4.55.0",
|
|
52
|
+
"@wordpress/element": "^8.7.0",
|
|
53
|
+
"@wordpress/hooks": "^4.55.0",
|
|
54
|
+
"@wordpress/i18n": "^6.28.0",
|
|
55
|
+
"@wordpress/icons": "^16.0.0",
|
|
56
|
+
"@wordpress/is-shallow-equal": "^5.55.0",
|
|
57
|
+
"@wordpress/keyboard-shortcuts": "^5.55.0",
|
|
58
|
+
"@wordpress/keycodes": "^4.55.0",
|
|
59
|
+
"@wordpress/media-utils": "^5.55.0",
|
|
60
|
+
"@wordpress/preferences": "^4.55.0",
|
|
61
|
+
"@wordpress/private-apis": "^1.55.0",
|
|
62
|
+
"@wordpress/theme": "^2.1.0",
|
|
63
|
+
"@wordpress/ui": "^0.22.0",
|
|
64
|
+
"@wordpress/widgets": "^4.55.0",
|
|
65
65
|
"clsx": "^2.1.1",
|
|
66
66
|
"fast-deep-equal": "^3.1.3"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@testing-library/dom": "^10.4.1",
|
|
70
|
-
"@testing-library/react": "^16.3.
|
|
70
|
+
"@testing-library/react": "^16.3.3",
|
|
71
|
+
"vitest": "^5.0.0"
|
|
71
72
|
},
|
|
72
73
|
"peerDependencies": {
|
|
73
74
|
"react": "^18 || ^19",
|
|
@@ -76,5 +77,5 @@
|
|
|
76
77
|
"publishConfig": {
|
|
77
78
|
"access": "public"
|
|
78
79
|
},
|
|
79
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "485f42ae8a1c58ceea18371a507fd4acfa86fbd8"
|
|
80
81
|
}
|
|
@@ -1,50 +1,177 @@
|
|
|
1
1
|
import { Component } from '@wordpress/element';
|
|
2
2
|
import { __ } from '@wordpress/i18n';
|
|
3
|
-
|
|
4
|
-
import {
|
|
3
|
+
// eslint-disable-next-line @wordpress/use-recommended-components -- The fallback UI renders outside the editor's notice system.
|
|
4
|
+
import { Card, CollapsibleCard, Notice, Stack, Text } from '@wordpress/ui';
|
|
5
5
|
import { useCopyToClipboard } from '@wordpress/compose';
|
|
6
6
|
import { doAction } from '@wordpress/hooks';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
// A boundary catches whatever was thrown, which is not always an `Error`.
|
|
9
|
+
function getErrorName( error ) {
|
|
10
|
+
return ( error instanceof Error && error.name ) || 'Error';
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function getErrorMessage( error ) {
|
|
14
|
+
if ( typeof error === 'string' && error ) {
|
|
15
|
+
return error;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if ( typeof error?.message === 'string' && error.message ) {
|
|
19
|
+
return error.message;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return 'An unknown error occurred.';
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// The sections of the report, shared by the copied Markdown and the details
|
|
26
|
+
// panel so that the two cannot drift apart. Deliberately untranslated: both
|
|
27
|
+
// are developer-facing, and the report is pasted into a bug report.
|
|
28
|
+
function getErrorSections( error, componentStack ) {
|
|
29
|
+
const sections = [
|
|
30
|
+
{ label: getErrorName( error ), content: getErrorMessage( error ) },
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
if ( error?.stack ) {
|
|
34
|
+
sections.push( {
|
|
35
|
+
label: 'Stack',
|
|
36
|
+
content: error.stack.trim(),
|
|
37
|
+
preformatted: true,
|
|
38
|
+
} );
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if ( componentStack ) {
|
|
42
|
+
sections.push( {
|
|
43
|
+
label: 'Component stack',
|
|
44
|
+
content: componentStack.trim(),
|
|
45
|
+
preformatted: true,
|
|
46
|
+
} );
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
sections.push( {
|
|
50
|
+
label: 'Environment',
|
|
51
|
+
content: `User agent: ${ window.navigator.userAgent }`,
|
|
52
|
+
preformatted: true,
|
|
53
|
+
} );
|
|
54
|
+
|
|
55
|
+
return sections;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Markdown, so the report stays readable as plain text and renders when pasted
|
|
59
|
+
// into a bug report.
|
|
60
|
+
function getErrorReport( error, componentStack ) {
|
|
61
|
+
const sections = getErrorSections( error, componentStack ).map(
|
|
62
|
+
( { label, content, preformatted } ) =>
|
|
63
|
+
`**${ label }**\n\n${
|
|
64
|
+
preformatted ? `\`\`\`\n${ content }\n\`\`\`` : content
|
|
65
|
+
}`
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
return [ '### Error report', ...sections ].join( '\n\n' );
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function CopyButton( { text, children, variant = 'outline' } ) {
|
|
9
72
|
const ref = useCopyToClipboard( text );
|
|
10
73
|
return (
|
|
11
|
-
<
|
|
74
|
+
<Notice.ActionButton variant={ variant } ref={ ref }>
|
|
12
75
|
{ children }
|
|
13
|
-
</
|
|
76
|
+
</Notice.ActionButton>
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function ErrorReport( { error, componentStack } ) {
|
|
81
|
+
return (
|
|
82
|
+
<Stack
|
|
83
|
+
className="customize-widgets-error-boundary__report"
|
|
84
|
+
direction="column"
|
|
85
|
+
gap="md"
|
|
86
|
+
>
|
|
87
|
+
{ getErrorSections( error, componentStack ).map(
|
|
88
|
+
( { label, content } ) => (
|
|
89
|
+
<Stack key={ label } direction="column" gap="xs">
|
|
90
|
+
<Text variant="heading-md">{ label }</Text>
|
|
91
|
+
<pre className="customize-widgets-error-boundary__report-section">
|
|
92
|
+
{ content }
|
|
93
|
+
</pre>
|
|
94
|
+
</Stack>
|
|
95
|
+
)
|
|
96
|
+
) }
|
|
97
|
+
</Stack>
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function ErrorDetails( { error, componentStack } ) {
|
|
102
|
+
return (
|
|
103
|
+
<CollapsibleCard.Root className="customize-widgets-error-boundary__details">
|
|
104
|
+
<CollapsibleCard.Header>
|
|
105
|
+
<Card.Title>{ __( 'Error details' ) }</Card.Title>
|
|
106
|
+
</CollapsibleCard.Header>
|
|
107
|
+
<CollapsibleCard.Content>
|
|
108
|
+
<ErrorReport
|
|
109
|
+
error={ error }
|
|
110
|
+
componentStack={ componentStack }
|
|
111
|
+
/>
|
|
112
|
+
</CollapsibleCard.Content>
|
|
113
|
+
</CollapsibleCard.Root>
|
|
14
114
|
);
|
|
15
115
|
}
|
|
16
116
|
|
|
17
117
|
export default class ErrorBoundary extends Component {
|
|
18
118
|
constructor() {
|
|
19
119
|
super( ...arguments );
|
|
120
|
+
|
|
20
121
|
this.state = {
|
|
21
122
|
error: null,
|
|
123
|
+
componentStack: null,
|
|
22
124
|
};
|
|
23
125
|
}
|
|
24
126
|
|
|
25
|
-
componentDidCatch( error ) {
|
|
26
|
-
this.setState( {
|
|
127
|
+
componentDidCatch( error, errorInfo ) {
|
|
128
|
+
this.setState( { componentStack: errorInfo?.componentStack } );
|
|
129
|
+
doAction( 'editor.ErrorBoundary.errorLogged', error, errorInfo );
|
|
130
|
+
}
|
|
27
131
|
|
|
28
|
-
|
|
132
|
+
static getDerivedStateFromError( error ) {
|
|
133
|
+
return { error };
|
|
29
134
|
}
|
|
30
135
|
|
|
31
136
|
render() {
|
|
32
|
-
const { error } = this.state;
|
|
137
|
+
const { error, componentStack } = this.state;
|
|
33
138
|
if ( ! error ) {
|
|
34
139
|
return this.props.children;
|
|
35
140
|
}
|
|
36
141
|
|
|
37
142
|
return (
|
|
38
|
-
<
|
|
143
|
+
<Stack
|
|
39
144
|
className="customize-widgets-error-boundary"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
{ __( 'Copy Error' ) }
|
|
43
|
-
</CopyButton>,
|
|
44
|
-
] }
|
|
145
|
+
direction="column"
|
|
146
|
+
gap="lg"
|
|
45
147
|
>
|
|
46
|
-
|
|
47
|
-
|
|
148
|
+
<Notice.Root intent="error">
|
|
149
|
+
<Notice.Title>
|
|
150
|
+
{ __( 'The editor has crashed' ) }
|
|
151
|
+
</Notice.Title>
|
|
152
|
+
<Notice.Description>
|
|
153
|
+
{ __(
|
|
154
|
+
'An unknown error occurred. Reload your browser to try again, or copy the error to report the problem or search.'
|
|
155
|
+
) }
|
|
156
|
+
</Notice.Description>
|
|
157
|
+
<Notice.Actions>
|
|
158
|
+
<CopyButton
|
|
159
|
+
variant="solid"
|
|
160
|
+
text={ () =>
|
|
161
|
+
getErrorReport( error, componentStack )
|
|
162
|
+
}
|
|
163
|
+
>
|
|
164
|
+
{ __( 'Copy error' ) }
|
|
165
|
+
</CopyButton>
|
|
166
|
+
</Notice.Actions>
|
|
167
|
+
</Notice.Root>
|
|
168
|
+
{ globalThis.SCRIPT_DEBUG ? (
|
|
169
|
+
<ErrorDetails
|
|
170
|
+
error={ error }
|
|
171
|
+
componentStack={ componentStack }
|
|
172
|
+
/>
|
|
173
|
+
) : null }
|
|
174
|
+
</Stack>
|
|
48
175
|
);
|
|
49
176
|
}
|
|
50
177
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
.customize-widgets-error-boundary {
|
|
2
|
+
font-family: var(--wpds-typography-font-family-body);
|
|
3
|
+
padding: var(--wpds-dimension-padding-md);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.customize-widgets-error-boundary__report {
|
|
7
|
+
max-height: 420px;
|
|
8
|
+
overflow: auto;
|
|
9
|
+
overflow-anchor: none;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.customize-widgets-error-boundary__report-section {
|
|
13
|
+
margin: 0;
|
|
14
|
+
white-space: pre-wrap;
|
|
15
|
+
overflow-wrap: break-word;
|
|
16
|
+
}
|
package/src/components/error-boundary/test/{error-boundary.jsx → error-boundary.jsdom.test.jsx}
RENAMED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { describe, expect, it, vi } from 'vitest';
|
|
1
2
|
import { render } from '@testing-library/react';
|
|
2
3
|
import * as wpHooks from '@wordpress/hooks';
|
|
3
4
|
import ErrorBoundary from '../index';
|
|
@@ -10,8 +11,8 @@ const ChildComponent = () => {
|
|
|
10
11
|
|
|
11
12
|
describe( 'Error Boundary', () => {
|
|
12
13
|
describe( 'when error is thrown from a Child component', () => {
|
|
13
|
-
it( 'calls the `editor.ErrorBoundary.errorLogged` hook action with the error object', () => {
|
|
14
|
-
const doAction =
|
|
14
|
+
it( 'calls the `editor.ErrorBoundary.errorLogged` hook action with the error object and error info', () => {
|
|
15
|
+
const doAction = vi.spyOn( wpHooks, 'doAction' );
|
|
15
16
|
|
|
16
17
|
render(
|
|
17
18
|
<ErrorBoundary>
|
|
@@ -21,7 +22,10 @@ describe( 'Error Boundary', () => {
|
|
|
21
22
|
|
|
22
23
|
expect( doAction ).toHaveBeenCalledWith(
|
|
23
24
|
'editor.ErrorBoundary.errorLogged',
|
|
24
|
-
theError
|
|
25
|
+
theError,
|
|
26
|
+
expect.objectContaining( {
|
|
27
|
+
componentStack: expect.any( String ),
|
|
28
|
+
} )
|
|
25
29
|
);
|
|
26
30
|
expect( console ).toHaveErrored();
|
|
27
31
|
} );
|
package/src/style.scss
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
@use "@wordpress/base-styles/mixins" as *;
|
|
2
2
|
@use "@wordpress/base-styles/default-custom-properties";
|
|
3
3
|
@use "./components/block-inspector-button/style.scss" as *;
|
|
4
|
+
@use "./components/error-boundary/style.scss" as *;
|
|
4
5
|
@use "./components/header/style.scss" as *;
|
|
5
6
|
@use "./components/inserter/style.scss" as *;
|
|
6
7
|
@use "./components/keyboard-shortcut-help-modal/style.scss" as *;
|