@wordpress/edit-widgets 6.56.0 → 7.0.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/components/error-boundary/index.cjs +14 -4
- package/build/components/error-boundary/index.cjs.map +2 -2
- package/build/components/layout/interface.cjs +7 -1
- package/build/components/layout/interface.cjs.map +2 -2
- package/build/components/widget-areas-block-editor-content/index.cjs +3 -2
- package/build/components/widget-areas-block-editor-content/index.cjs.map +2 -2
- package/build-module/components/error-boundary/index.mjs +14 -4
- package/build-module/components/error-boundary/index.mjs.map +2 -2
- package/build-module/components/layout/interface.mjs +7 -1
- package/build-module/components/layout/interface.mjs.map +2 -2
- package/build-module/components/widget-areas-block-editor-content/index.mjs +4 -3
- package/build-module/components/widget-areas-block-editor-content/index.mjs.map +2 -2
- package/build-style/style-rtl.css +28 -13
- package/build-style/style.css +28 -13
- package/package.json +35 -35
- package/src/components/error-boundary/index.jsx +16 -9
- package/src/components/error-boundary/test/error-boundary.jsdom.test.jsx +23 -1
- 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/widget-areas-block-editor-content/index.jsx +4 -3
- package/CHANGELOG.md +0 -319
|
@@ -23,11 +23,20 @@ __export(error_boundary_exports, {
|
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(error_boundary_exports);
|
|
25
25
|
var import_element = require("@wordpress/element");
|
|
26
|
+
var import_a11y = require("@wordpress/a11y");
|
|
26
27
|
var import_i18n = require("@wordpress/i18n");
|
|
27
28
|
var import_ui = require("@wordpress/ui");
|
|
28
29
|
var import_compose = require("@wordpress/compose");
|
|
29
30
|
var import_hooks = require("@wordpress/hooks");
|
|
30
31
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
32
|
+
function getErrorNotice() {
|
|
33
|
+
return {
|
|
34
|
+
title: (0, import_i18n.__)("The editor has crashed"),
|
|
35
|
+
description: (0, import_i18n.__)(
|
|
36
|
+
"An unknown error occurred. Reload your browser to try again, or copy the error to report the problem or search."
|
|
37
|
+
)
|
|
38
|
+
};
|
|
39
|
+
}
|
|
31
40
|
function getErrorName(error) {
|
|
32
41
|
return error instanceof Error && error.name || "Error";
|
|
33
42
|
}
|
|
@@ -116,6 +125,8 @@ var ErrorBoundary = class extends import_element.Component {
|
|
|
116
125
|
};
|
|
117
126
|
}
|
|
118
127
|
componentDidCatch(error, errorInfo) {
|
|
128
|
+
const { title, description } = getErrorNotice();
|
|
129
|
+
(0, import_a11y.speak)(`${title}. ${description}`, "assertive");
|
|
119
130
|
this.setState({ componentStack: errorInfo?.componentStack });
|
|
120
131
|
(0, import_hooks.doAction)("editor.ErrorBoundary.errorLogged", error, errorInfo);
|
|
121
132
|
}
|
|
@@ -127,6 +138,7 @@ var ErrorBoundary = class extends import_element.Component {
|
|
|
127
138
|
if (!error) {
|
|
128
139
|
return this.props.children;
|
|
129
140
|
}
|
|
141
|
+
const { title, description } = getErrorNotice();
|
|
130
142
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
131
143
|
import_ui.Stack,
|
|
132
144
|
{
|
|
@@ -135,10 +147,8 @@ var ErrorBoundary = class extends import_element.Component {
|
|
|
135
147
|
gap: "lg",
|
|
136
148
|
children: [
|
|
137
149
|
/* @__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:
|
|
139
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.Notice.Description, { children:
|
|
140
|
-
"An unknown error occurred. Reload your browser to try again, or copy the error to report the problem or search."
|
|
141
|
-
) }),
|
|
150
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.Notice.Title, { children: title }),
|
|
151
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.Notice.Description, { children: description }),
|
|
142
152
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.Notice.Actions, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
143
153
|
CopyButton,
|
|
144
154
|
{
|
|
@@ -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 {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAA0B;AAC1B,kBAAmB;
|
|
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.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ACZ,OAAO;AAAA,MACP,gBAAgB;AAAA,IACjB;AAAA,EACD;AAAA,EAEA,kBAAmB,OAAO,WAAY;AACrC,UAAM,EAAE,OAAO,YAAY,IAAI,eAAe;AAC9C,2BAAO,GAAI,KAAM,KAAM,WAAY,IAAI,WAAY;AACnD,SAAK,SAAU,EAAE,gBAAgB,WAAW,eAAe,CAAE;AAC7D,+BAAU,oCAAoC,OAAO,SAAU;AAAA,EAChE;AAAA,EAEA,OAAO,yBAA0B,OAAQ;AACxC,WAAO,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,UAAM,EAAE,OAAO,YAAY,IAAI,eAAe;AAE9C,WACC;AAAA,MAAC;AAAA;AAAA,QACA,WAAU;AAAA,QACV,WAAU;AAAA,QACV,KAAI;AAAA,QAEJ;AAAA,uDAAC,iBAAO,MAAP,EAAY,QAAO,SACnB;AAAA,wDAAC,iBAAO,OAAP,EAAe,iBAAO;AAAA,YACvB,4CAAC,iBAAO,aAAP,EAAqB,uBAAa;AAAA,YACnC,4CAAC,iBAAO,SAAP,EACA;AAAA,cAAC;AAAA;AAAA,gBACA,SAAQ;AAAA,gBACR,MAAO,MACN,eAAgB,OAAO,cAAe;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
|
}
|
|
@@ -106,7 +106,13 @@ function Interface({ blockEditorSettings }) {
|
|
|
106
106
|
blockEditorSettings
|
|
107
107
|
}
|
|
108
108
|
) }),
|
|
109
|
-
footer: hasBlockBreadCrumbsEnabled && !isMobileViewport && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "edit-widgets-layout__footer", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
109
|
+
footer: hasBlockBreadCrumbsEnabled && !isMobileViewport && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "edit-widgets-layout__footer", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
110
|
+
import_block_editor.BlockBreadcrumb,
|
|
111
|
+
{
|
|
112
|
+
className: "edit-widgets-layout__breadcrumbs",
|
|
113
|
+
rootLabelText: (0, import_i18n.__)("Widgets")
|
|
114
|
+
}
|
|
115
|
+
) })
|
|
110
116
|
}
|
|
111
117
|
);
|
|
112
118
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/layout/interface.jsx"],
|
|
4
|
-
"sourcesContent": ["import { useViewportMatch } from '@wordpress/compose';\nimport { BlockBreadcrumb } from '@wordpress/block-editor';\nimport { useEffect } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tInterfaceSkeleton,\n\tComplementaryArea,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport Header from '../header';\nimport WidgetAreasBlockEditorContent from '../widget-areas-block-editor-content';\nimport { store as editWidgetsStore } from '../../store';\nimport SecondarySidebar from '../secondary-sidebar';\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the widgets screen top bar landmark region. */\n\theader: __( 'Widgets top bar' ),\n\t/* translators: accessibility text for the widgets screen content landmark region. */\n\tbody: __( 'Widgets and blocks' ),\n\t/* translators: accessibility text for the widgets screen settings landmark region. */\n\tsidebar: __( 'Widgets settings' ),\n\t/* translators: accessibility text for the widgets screen footer landmark region. */\n\tfooter: __( 'Widgets footer' ),\n};\n\nfunction Interface( { blockEditorSettings } ) {\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isHugeViewport = useViewportMatch( 'huge', '>=' );\n\tconst { setIsInserterOpened, setIsListViewOpened, closeGeneralSidebar } =\n\t\tuseDispatch( editWidgetsStore );\n\tconst {\n\t\thasBlockBreadCrumbsEnabled,\n\t\thasSidebarEnabled,\n\t\tisInserterOpened,\n\t\tisListViewOpened,\n\t} = useSelect(\n\t\t( select ) => ( {\n\t\t\thasSidebarEnabled: !! select(\n\t\t\t\tinterfaceStore\n\t\t\t).getActiveComplementaryArea( editWidgetsStore.name ),\n\t\t\tisInserterOpened: !! select( editWidgetsStore ).isInserterOpened(),\n\t\t\tisListViewOpened: !! select( editWidgetsStore ).isListViewOpened(),\n\t\t\thasBlockBreadCrumbsEnabled: !! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'showBlockBreadcrumbs'\n\t\t\t),\n\t\t} ),\n\t\t[]\n\t);\n\n\t// Inserter and Sidebars are mutually exclusive\n\tuseEffect( () => {\n\t\tif ( hasSidebarEnabled && ! isHugeViewport ) {\n\t\t\tsetIsInserterOpened( false );\n\t\t\tsetIsListViewOpened( false );\n\t\t}\n\t}, [ hasSidebarEnabled, isHugeViewport ] );\n\n\tuseEffect( () => {\n\t\tif ( ( isInserterOpened || isListViewOpened ) && ! isHugeViewport ) {\n\t\t\tcloseGeneralSidebar();\n\t\t}\n\t}, [ isInserterOpened, isListViewOpened, isHugeViewport ] );\n\n\tconst secondarySidebarLabel = isListViewOpened\n\t\t? __( 'List View' )\n\t\t: __( 'Block Library' );\n\n\tconst hasSecondarySidebar = isListViewOpened || isInserterOpened;\n\n\treturn (\n\t\t<InterfaceSkeleton\n\t\t\tlabels={ {\n\t\t\t\t...interfaceLabels,\n\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t} }\n\t\t\theader={ <Header /> }\n\t\t\tsecondarySidebar={ hasSecondarySidebar && <SecondarySidebar /> }\n\t\t\tsidebar={ <ComplementaryArea.Slot scope=\"core/edit-widgets\" /> }\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t<WidgetAreasBlockEditorContent\n\t\t\t\t\t\tblockEditorSettings={ blockEditorSettings }\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t}\n\t\t\tfooter={\n\t\t\t\thasBlockBreadCrumbsEnabled &&\n\t\t\t\t! isMobileViewport && (\n\t\t\t\t\t<div className=\"edit-widgets-layout__footer\">\n\t\t\t\t\t\t<BlockBreadcrumb
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAiC;AACjC,0BAAgC;AAChC,qBAA0B;AAC1B,kBAAuC;AACvC,uBAIO;AACP,kBAAmB;AACnB,yBAA0C;AAC1C,oBAAmB;AACnB,+CAA0C;AAC1C,mBAA0C;AAC1C,+BAA6B;AAgEjB;AA9DZ,IAAM,kBAAkB;AAAA;AAAA,EAEvB,YAAQ,gBAAI,iBAAkB;AAAA;AAAA,EAE9B,UAAM,gBAAI,oBAAqB;AAAA;AAAA,EAE/B,aAAS,gBAAI,kBAAmB;AAAA;AAAA,EAEhC,YAAQ,gBAAI,gBAAiB;AAC9B;AAEA,SAAS,UAAW,EAAE,oBAAoB,GAAI;AAC7C,QAAM,uBAAmB,iCAAkB,UAAU,GAAI;AACzD,QAAM,qBAAiB,iCAAkB,QAAQ,IAAK;AACtD,QAAM,EAAE,qBAAqB,qBAAqB,oBAAoB,QACrE,yBAAa,aAAAA,KAAiB;AAC/B,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,QAAI;AAAA,IACH,CAAE,YAAc;AAAA,MACf,mBAAmB,CAAC,CAAE;AAAA,QACrB,iBAAAC;AAAA,MACD,EAAE,2BAA4B,aAAAD,MAAiB,IAAK;AAAA,MACpD,kBAAkB,CAAC,CAAE,OAAQ,aAAAA,KAAiB,EAAE,iBAAiB;AAAA,MACjE,kBAAkB,CAAC,CAAE,OAAQ,aAAAA,KAAiB,EAAE,iBAAiB;AAAA,MACjE,4BAA4B,CAAC,CAAE,OAAQ,mBAAAE,KAAiB,EAAE;AAAA,QACzD;AAAA,QACA;AAAA,MACD;AAAA,IACD;AAAA,IACA,CAAC;AAAA,EACF;AAGA,gCAAW,MAAM;AAChB,QAAK,qBAAqB,CAAE,gBAAiB;AAC5C,0BAAqB,KAAM;AAC3B,0BAAqB,KAAM;AAAA,IAC5B;AAAA,EACD,GAAG,CAAE,mBAAmB,cAAe,CAAE;AAEzC,gCAAW,MAAM;AAChB,SAAO,oBAAoB,qBAAsB,CAAE,gBAAiB;AACnE,0BAAoB;AAAA,IACrB;AAAA,EACD,GAAG,CAAE,kBAAkB,kBAAkB,cAAe,CAAE;AAE1D,QAAM,wBAAwB,uBAC3B,gBAAI,WAAY,QAChB,gBAAI,eAAgB;AAEvB,QAAM,sBAAsB,oBAAoB;AAEhD,SACC;AAAA,IAAC;AAAA;AAAA,MACA,QAAS;AAAA,QACR,GAAG;AAAA,QACH,kBAAkB;AAAA,MACnB;AAAA,MACA,QAAS,4CAAC,cAAAC,SAAA,EAAO;AAAA,MACjB,kBAAmB,uBAAuB,4CAAC,yBAAAC,SAAA,EAAiB;AAAA,MAC5D,SAAU,4CAAC,mCAAkB,MAAlB,EAAuB,OAAM,qBAAoB;AAAA,MAC5D,SACC,2EACC;AAAA,QAAC,yCAAAC;AAAA,QAAA;AAAA,UACA;AAAA;AAAA,MACD,GACD;AAAA,MAED,QACC,8BACA,CAAE,oBACD,4CAAC,SAAI,WAAU,+BACd,
|
|
4
|
+
"sourcesContent": ["import { useViewportMatch } from '@wordpress/compose';\nimport { BlockBreadcrumb } from '@wordpress/block-editor';\nimport { useEffect } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tInterfaceSkeleton,\n\tComplementaryArea,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport Header from '../header';\nimport WidgetAreasBlockEditorContent from '../widget-areas-block-editor-content';\nimport { store as editWidgetsStore } from '../../store';\nimport SecondarySidebar from '../secondary-sidebar';\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the widgets screen top bar landmark region. */\n\theader: __( 'Widgets top bar' ),\n\t/* translators: accessibility text for the widgets screen content landmark region. */\n\tbody: __( 'Widgets and blocks' ),\n\t/* translators: accessibility text for the widgets screen settings landmark region. */\n\tsidebar: __( 'Widgets settings' ),\n\t/* translators: accessibility text for the widgets screen footer landmark region. */\n\tfooter: __( 'Widgets footer' ),\n};\n\nfunction Interface( { blockEditorSettings } ) {\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isHugeViewport = useViewportMatch( 'huge', '>=' );\n\tconst { setIsInserterOpened, setIsListViewOpened, closeGeneralSidebar } =\n\t\tuseDispatch( editWidgetsStore );\n\tconst {\n\t\thasBlockBreadCrumbsEnabled,\n\t\thasSidebarEnabled,\n\t\tisInserterOpened,\n\t\tisListViewOpened,\n\t} = useSelect(\n\t\t( select ) => ( {\n\t\t\thasSidebarEnabled: !! select(\n\t\t\t\tinterfaceStore\n\t\t\t).getActiveComplementaryArea( editWidgetsStore.name ),\n\t\t\tisInserterOpened: !! select( editWidgetsStore ).isInserterOpened(),\n\t\t\tisListViewOpened: !! select( editWidgetsStore ).isListViewOpened(),\n\t\t\thasBlockBreadCrumbsEnabled: !! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'showBlockBreadcrumbs'\n\t\t\t),\n\t\t} ),\n\t\t[]\n\t);\n\n\t// Inserter and Sidebars are mutually exclusive\n\tuseEffect( () => {\n\t\tif ( hasSidebarEnabled && ! isHugeViewport ) {\n\t\t\tsetIsInserterOpened( false );\n\t\t\tsetIsListViewOpened( false );\n\t\t}\n\t}, [ hasSidebarEnabled, isHugeViewport ] );\n\n\tuseEffect( () => {\n\t\tif ( ( isInserterOpened || isListViewOpened ) && ! isHugeViewport ) {\n\t\t\tcloseGeneralSidebar();\n\t\t}\n\t}, [ isInserterOpened, isListViewOpened, isHugeViewport ] );\n\n\tconst secondarySidebarLabel = isListViewOpened\n\t\t? __( 'List View' )\n\t\t: __( 'Block Library' );\n\n\tconst hasSecondarySidebar = isListViewOpened || isInserterOpened;\n\n\treturn (\n\t\t<InterfaceSkeleton\n\t\t\tlabels={ {\n\t\t\t\t...interfaceLabels,\n\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t} }\n\t\t\theader={ <Header /> }\n\t\t\tsecondarySidebar={ hasSecondarySidebar && <SecondarySidebar /> }\n\t\t\tsidebar={ <ComplementaryArea.Slot scope=\"core/edit-widgets\" /> }\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t<WidgetAreasBlockEditorContent\n\t\t\t\t\t\tblockEditorSettings={ blockEditorSettings }\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t}\n\t\t\tfooter={\n\t\t\t\thasBlockBreadCrumbsEnabled &&\n\t\t\t\t! isMobileViewport && (\n\t\t\t\t\t<div className=\"edit-widgets-layout__footer\">\n\t\t\t\t\t\t<BlockBreadcrumb\n\t\t\t\t\t\t\tclassName=\"edit-widgets-layout__breadcrumbs\"\n\t\t\t\t\t\t\trootLabelText={ __( 'Widgets' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t)\n\t\t\t}\n\t\t/>\n\t);\n}\n\nexport default Interface;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAiC;AACjC,0BAAgC;AAChC,qBAA0B;AAC1B,kBAAuC;AACvC,uBAIO;AACP,kBAAmB;AACnB,yBAA0C;AAC1C,oBAAmB;AACnB,+CAA0C;AAC1C,mBAA0C;AAC1C,+BAA6B;AAgEjB;AA9DZ,IAAM,kBAAkB;AAAA;AAAA,EAEvB,YAAQ,gBAAI,iBAAkB;AAAA;AAA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;AAAA,QACH,kBAAkB;AAAA,MACnB;AAAA,MACA,QAAS,4CAAC,cAAAC,SAAA,EAAO;AAAA,MACjB,kBAAmB,uBAAuB,4CAAC,yBAAAC,SAAA,EAAiB;AAAA,MAC5D,SAAU,4CAAC,mCAAkB,MAAlB,EAAuB,OAAM,qBAAoB;AAAA,MAC5D,SACC,2EACC;AAAA,QAAC,yCAAAC;AAAA,QAAA;AAAA,UACA;AAAA;AAAA,MACD,GACD;AAAA,MAED,QACC,8BACA,CAAE,oBACD,4CAAC,SAAI,WAAU,+BACd;AAAA,QAAC;AAAA;AAAA,UACA,WAAU;AAAA,UACV,mBAAgB,gBAAI,SAAU;AAAA;AAAA,MAC/B,GACD;AAAA;AAAA,EAGH;AAEF;AAEA,IAAO,oBAAQ;",
|
|
6
6
|
"names": ["editWidgetsStore", "interfaceStore", "preferencesStore", "Header", "SecondarySidebar", "WidgetAreasBlockEditorContent"]
|
|
7
7
|
}
|
|
@@ -51,13 +51,14 @@ function WidgetAreasBlockEditorContent({
|
|
|
51
51
|
[]
|
|
52
52
|
);
|
|
53
53
|
const isLargeViewport = (0, import_compose.useViewportMatch)("medium");
|
|
54
|
+
const contentRef = (0, import_element.useRef)();
|
|
54
55
|
const styles = (0, import_element.useMemo)(() => {
|
|
55
56
|
return hasThemeStyles ? blockEditorSettings.styles : [];
|
|
56
57
|
}, [blockEditorSettings, hasThemeStyles]);
|
|
57
58
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "edit-widgets-block-editor", children: [
|
|
58
59
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_notices.default, {}),
|
|
59
60
|
!isLargeViewport && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.BlockToolbar, { hideDragHandle: true }),
|
|
60
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_block_editor.BlockTools, { children: [
|
|
61
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_block_editor.BlockTools, { __unstableContentRef: contentRef, children: [
|
|
61
62
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_keyboard_shortcuts.default, {}),
|
|
62
63
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
63
64
|
import_block_editor.__unstableEditorStyles,
|
|
@@ -66,7 +67,7 @@ function WidgetAreasBlockEditorContent({
|
|
|
66
67
|
scope: ":where(.editor-styles-wrapper)"
|
|
67
68
|
}
|
|
68
69
|
),
|
|
69
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.BlockSelectionClearer, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.WritingFlow, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.BlockList, { className: "edit-widgets-main-block-list" }) }) })
|
|
70
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.BlockSelectionClearer, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.WritingFlow, { ref: contentRef, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.BlockList, { className: "edit-widgets-main-block-list" }) }) })
|
|
70
71
|
] })
|
|
71
72
|
] });
|
|
72
73
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/widget-areas-block-editor-content/index.jsx"],
|
|
4
|
-
"sourcesContent": ["import {\n\tBlockList,\n\tBlockToolbar,\n\tBlockTools,\n\tBlockSelectionClearer,\n\tWritingFlow,\n\t__unstableEditorStyles as EditorStyles,\n} from '@wordpress/block-editor';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport Notices from '../notices';\nimport KeyboardShortcuts from '../keyboard-shortcuts';\n\nexport default function WidgetAreasBlockEditorContent( {\n\tblockEditorSettings,\n} ) {\n\tconst hasThemeStyles = useSelect(\n\t\t( select ) =>\n\t\t\t!! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'themeStyles'\n\t\t\t),\n\t\t[]\n\t);\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\n\tconst styles = useMemo( () => {\n\t\treturn hasThemeStyles ? blockEditorSettings.styles : [];\n\t}, [ blockEditorSettings, hasThemeStyles ] );\n\n\treturn (\n\t\t<div className=\"edit-widgets-block-editor\">\n\t\t\t<Notices />\n\t\t\t{ ! isLargeViewport && <BlockToolbar hideDragHandle /> }\n\t\t\t<BlockTools>\n\t\t\t\t<KeyboardShortcuts />\n\t\t\t\t<EditorStyles\n\t\t\t\t\tstyles={ styles }\n\t\t\t\t\tscope=\":where(.editor-styles-wrapper)\"\n\t\t\t\t/>\n\t\t\t\t<BlockSelectionClearer>\n\t\t\t\t\t<WritingFlow>\n\t\t\t\t\t\t<BlockList className=\"edit-widgets-main-block-list\" />\n\t\t\t\t\t</WritingFlow>\n\t\t\t\t</BlockSelectionClearer>\n\t\t\t</BlockTools>\n\t\t</div>\n\t);\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAOO;AACP,qBAAiC;AACjC,kBAA0B;AAC1B,
|
|
4
|
+
"sourcesContent": ["import {\n\tBlockList,\n\tBlockToolbar,\n\tBlockTools,\n\tBlockSelectionClearer,\n\tWritingFlow,\n\t__unstableEditorStyles as EditorStyles,\n} from '@wordpress/block-editor';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo, useRef } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport Notices from '../notices';\nimport KeyboardShortcuts from '../keyboard-shortcuts';\n\nexport default function WidgetAreasBlockEditorContent( {\n\tblockEditorSettings,\n} ) {\n\tconst hasThemeStyles = useSelect(\n\t\t( select ) =>\n\t\t\t!! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'themeStyles'\n\t\t\t),\n\t\t[]\n\t);\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst contentRef = useRef();\n\n\tconst styles = useMemo( () => {\n\t\treturn hasThemeStyles ? blockEditorSettings.styles : [];\n\t}, [ blockEditorSettings, hasThemeStyles ] );\n\n\treturn (\n\t\t<div className=\"edit-widgets-block-editor\">\n\t\t\t<Notices />\n\t\t\t{ ! isLargeViewport && <BlockToolbar hideDragHandle /> }\n\t\t\t<BlockTools __unstableContentRef={ contentRef }>\n\t\t\t\t<KeyboardShortcuts />\n\t\t\t\t<EditorStyles\n\t\t\t\t\tstyles={ styles }\n\t\t\t\t\tscope=\":where(.editor-styles-wrapper)\"\n\t\t\t\t/>\n\t\t\t\t<BlockSelectionClearer>\n\t\t\t\t\t<WritingFlow ref={ contentRef }>\n\t\t\t\t\t\t<BlockList className=\"edit-widgets-main-block-list\" />\n\t\t\t\t\t</WritingFlow>\n\t\t\t\t</BlockSelectionClearer>\n\t\t\t</BlockTools>\n\t\t</div>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAOO;AACP,qBAAiC;AACjC,kBAA0B;AAC1B,qBAAgC;AAChC,yBAA0C;AAC1C,qBAAoB;AACpB,gCAA8B;AAsB3B;AApBY,SAAR,8BAAgD;AAAA,EACtD;AACD,GAAI;AACH,QAAM,qBAAiB;AAAA,IACtB,CAAE,WACD,CAAC,CAAE,OAAQ,mBAAAA,KAAiB,EAAE;AAAA,MAC7B;AAAA,MACA;AAAA,IACD;AAAA,IACD,CAAC;AAAA,EACF;AACA,QAAM,sBAAkB,iCAAkB,QAAS;AACnD,QAAM,iBAAa,uBAAO;AAE1B,QAAM,aAAS,wBAAS,MAAM;AAC7B,WAAO,iBAAiB,oBAAoB,SAAS,CAAC;AAAA,EACvD,GAAG,CAAE,qBAAqB,cAAe,CAAE;AAE3C,SACC,6CAAC,SAAI,WAAU,6BACd;AAAA,gDAAC,eAAAC,SAAA,EAAQ;AAAA,IACP,CAAE,mBAAmB,4CAAC,oCAAa,gBAAc,MAAC;AAAA,IACpD,6CAAC,kCAAW,sBAAuB,YAClC;AAAA,kDAAC,0BAAAC,SAAA,EAAkB;AAAA,MACnB;AAAA,QAAC,oBAAAC;AAAA,QAAA;AAAA,UACA;AAAA,UACA,OAAM;AAAA;AAAA,MACP;AAAA,MACA,4CAAC,6CACA,sDAAC,mCAAY,KAAM,YAClB,sDAAC,iCAAU,WAAU,gCAA+B,GACrD,GACD;AAAA,OACD;AAAA,KACD;AAEF;",
|
|
6
6
|
"names": ["preferencesStore", "Notices", "KeyboardShortcuts", "EditorStyles"]
|
|
7
7
|
}
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
// packages/edit-widgets/src/components/error-boundary/index.jsx
|
|
2
2
|
import { Component } from "@wordpress/element";
|
|
3
|
+
import { speak } from "@wordpress/a11y";
|
|
3
4
|
import { __ } from "@wordpress/i18n";
|
|
4
5
|
import { Card, CollapsibleCard, Notice, Stack, Text } from "@wordpress/ui";
|
|
5
6
|
import { useCopyToClipboard } from "@wordpress/compose";
|
|
6
7
|
import { doAction } from "@wordpress/hooks";
|
|
7
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
function getErrorNotice() {
|
|
10
|
+
return {
|
|
11
|
+
title: __("The editor has crashed"),
|
|
12
|
+
description: __(
|
|
13
|
+
"An unknown error occurred. Reload your browser to try again, or copy the error to report the problem or search."
|
|
14
|
+
)
|
|
15
|
+
};
|
|
16
|
+
}
|
|
8
17
|
function getErrorName(error) {
|
|
9
18
|
return error instanceof Error && error.name || "Error";
|
|
10
19
|
}
|
|
@@ -93,6 +102,8 @@ var ErrorBoundary = class extends Component {
|
|
|
93
102
|
};
|
|
94
103
|
}
|
|
95
104
|
componentDidCatch(error, errorInfo) {
|
|
105
|
+
const { title, description } = getErrorNotice();
|
|
106
|
+
speak(`${title}. ${description}`, "assertive");
|
|
96
107
|
this.setState({ componentStack: errorInfo?.componentStack });
|
|
97
108
|
doAction("editor.ErrorBoundary.errorLogged", error, errorInfo);
|
|
98
109
|
}
|
|
@@ -104,6 +115,7 @@ var ErrorBoundary = class extends Component {
|
|
|
104
115
|
if (!error) {
|
|
105
116
|
return this.props.children;
|
|
106
117
|
}
|
|
118
|
+
const { title, description } = getErrorNotice();
|
|
107
119
|
return /* @__PURE__ */ jsxs(
|
|
108
120
|
Stack,
|
|
109
121
|
{
|
|
@@ -112,10 +124,8 @@ var ErrorBoundary = class extends Component {
|
|
|
112
124
|
gap: "lg",
|
|
113
125
|
children: [
|
|
114
126
|
/* @__PURE__ */ jsxs(Notice.Root, { intent: "error", children: [
|
|
115
|
-
/* @__PURE__ */ jsx(Notice.Title, { children:
|
|
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
|
-
) }),
|
|
127
|
+
/* @__PURE__ */ jsx(Notice.Title, { children: title }),
|
|
128
|
+
/* @__PURE__ */ jsx(Notice.Description, { children: description }),
|
|
119
129
|
/* @__PURE__ */ jsx(Notice.Actions, { children: /* @__PURE__ */ jsx(
|
|
120
130
|
CopyButton,
|
|
121
131
|
{
|
|
@@ -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 {
|
|
5
|
-
"mappings": ";AAAA,SAAS,iBAAiB;AAC1B,SAAS,UAAU;
|
|
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,S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U;AAAA,QACV,WAAU;AAAA,QACV,KAAI;AAAA,QAEJ;AAAA,+BAAC,OAAO,MAAP,EAAY,QAAO,SACnB;AAAA,gCAAC,OAAO,OAAP,EAAe,iBAAO;AAAA,YACvB,oBAAC,OAAO,aAAP,EAAqB,uBAAa;AAAA,YACnC,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
|
}
|
|
@@ -77,7 +77,13 @@ function Interface({ blockEditorSettings }) {
|
|
|
77
77
|
blockEditorSettings
|
|
78
78
|
}
|
|
79
79
|
) }),
|
|
80
|
-
footer: hasBlockBreadCrumbsEnabled && !isMobileViewport && /* @__PURE__ */ jsx("div", { className: "edit-widgets-layout__footer", children: /* @__PURE__ */ jsx(
|
|
80
|
+
footer: hasBlockBreadCrumbsEnabled && !isMobileViewport && /* @__PURE__ */ jsx("div", { className: "edit-widgets-layout__footer", children: /* @__PURE__ */ jsx(
|
|
81
|
+
BlockBreadcrumb,
|
|
82
|
+
{
|
|
83
|
+
className: "edit-widgets-layout__breadcrumbs",
|
|
84
|
+
rootLabelText: __("Widgets")
|
|
85
|
+
}
|
|
86
|
+
) })
|
|
81
87
|
}
|
|
82
88
|
);
|
|
83
89
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/layout/interface.jsx"],
|
|
4
|
-
"sourcesContent": ["import { useViewportMatch } from '@wordpress/compose';\nimport { BlockBreadcrumb } from '@wordpress/block-editor';\nimport { useEffect } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tInterfaceSkeleton,\n\tComplementaryArea,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport Header from '../header';\nimport WidgetAreasBlockEditorContent from '../widget-areas-block-editor-content';\nimport { store as editWidgetsStore } from '../../store';\nimport SecondarySidebar from '../secondary-sidebar';\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the widgets screen top bar landmark region. */\n\theader: __( 'Widgets top bar' ),\n\t/* translators: accessibility text for the widgets screen content landmark region. */\n\tbody: __( 'Widgets and blocks' ),\n\t/* translators: accessibility text for the widgets screen settings landmark region. */\n\tsidebar: __( 'Widgets settings' ),\n\t/* translators: accessibility text for the widgets screen footer landmark region. */\n\tfooter: __( 'Widgets footer' ),\n};\n\nfunction Interface( { blockEditorSettings } ) {\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isHugeViewport = useViewportMatch( 'huge', '>=' );\n\tconst { setIsInserterOpened, setIsListViewOpened, closeGeneralSidebar } =\n\t\tuseDispatch( editWidgetsStore );\n\tconst {\n\t\thasBlockBreadCrumbsEnabled,\n\t\thasSidebarEnabled,\n\t\tisInserterOpened,\n\t\tisListViewOpened,\n\t} = useSelect(\n\t\t( select ) => ( {\n\t\t\thasSidebarEnabled: !! select(\n\t\t\t\tinterfaceStore\n\t\t\t).getActiveComplementaryArea( editWidgetsStore.name ),\n\t\t\tisInserterOpened: !! select( editWidgetsStore ).isInserterOpened(),\n\t\t\tisListViewOpened: !! select( editWidgetsStore ).isListViewOpened(),\n\t\t\thasBlockBreadCrumbsEnabled: !! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'showBlockBreadcrumbs'\n\t\t\t),\n\t\t} ),\n\t\t[]\n\t);\n\n\t// Inserter and Sidebars are mutually exclusive\n\tuseEffect( () => {\n\t\tif ( hasSidebarEnabled && ! isHugeViewport ) {\n\t\t\tsetIsInserterOpened( false );\n\t\t\tsetIsListViewOpened( false );\n\t\t}\n\t}, [ hasSidebarEnabled, isHugeViewport ] );\n\n\tuseEffect( () => {\n\t\tif ( ( isInserterOpened || isListViewOpened ) && ! isHugeViewport ) {\n\t\t\tcloseGeneralSidebar();\n\t\t}\n\t}, [ isInserterOpened, isListViewOpened, isHugeViewport ] );\n\n\tconst secondarySidebarLabel = isListViewOpened\n\t\t? __( 'List View' )\n\t\t: __( 'Block Library' );\n\n\tconst hasSecondarySidebar = isListViewOpened || isInserterOpened;\n\n\treturn (\n\t\t<InterfaceSkeleton\n\t\t\tlabels={ {\n\t\t\t\t...interfaceLabels,\n\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t} }\n\t\t\theader={ <Header /> }\n\t\t\tsecondarySidebar={ hasSecondarySidebar && <SecondarySidebar /> }\n\t\t\tsidebar={ <ComplementaryArea.Slot scope=\"core/edit-widgets\" /> }\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t<WidgetAreasBlockEditorContent\n\t\t\t\t\t\tblockEditorSettings={ blockEditorSettings }\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t}\n\t\t\tfooter={\n\t\t\t\thasBlockBreadCrumbsEnabled &&\n\t\t\t\t! isMobileViewport && (\n\t\t\t\t\t<div className=\"edit-widgets-layout__footer\">\n\t\t\t\t\t\t<BlockBreadcrumb
|
|
5
|
-
"mappings": ";AAAA,SAAS,wBAAwB;AACjC,SAAS,uBAAuB;AAChC,SAAS,iBAAiB;AAC1B,SAAS,aAAa,iBAAiB;AACvC;AAAA,EACC;AAAA,EACA;AAAA,EACA,SAAS;AAAA,OACH;AACP,SAAS,UAAU;AACnB,SAAS,SAAS,wBAAwB;AAC1C,OAAO,YAAY;AACnB,OAAO,mCAAmC;AAC1C,SAAS,SAAS,wBAAwB;AAC1C,OAAO,sBAAsB;AAgEjB,SAIR,UAJQ;AA9DZ,IAAM,kBAAkB;AAAA;AAAA,EAEv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AkB;AAAA,MACnB;AAAA,MACA,QAAS,oBAAC,UAAO;AAAA,MACjB,kBAAmB,uBAAuB,oBAAC,oBAAiB;AAAA,MAC5D,SAAU,oBAAC,kBAAkB,MAAlB,EAAuB,OAAM,qBAAoB;AAAA,MAC5D,SACC,gCACC;AAAA,QAAC;AAAA;AAAA,UACA;AAAA;AAAA,MACD,GACD;AAAA,MAED,QACC,8BACA,CAAE,oBACD,oBAAC,SAAI,WAAU,+BACd,
|
|
4
|
+
"sourcesContent": ["import { useViewportMatch } from '@wordpress/compose';\nimport { BlockBreadcrumb } from '@wordpress/block-editor';\nimport { useEffect } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tInterfaceSkeleton,\n\tComplementaryArea,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport Header from '../header';\nimport WidgetAreasBlockEditorContent from '../widget-areas-block-editor-content';\nimport { store as editWidgetsStore } from '../../store';\nimport SecondarySidebar from '../secondary-sidebar';\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the widgets screen top bar landmark region. */\n\theader: __( 'Widgets top bar' ),\n\t/* translators: accessibility text for the widgets screen content landmark region. */\n\tbody: __( 'Widgets and blocks' ),\n\t/* translators: accessibility text for the widgets screen settings landmark region. */\n\tsidebar: __( 'Widgets settings' ),\n\t/* translators: accessibility text for the widgets screen footer landmark region. */\n\tfooter: __( 'Widgets footer' ),\n};\n\nfunction Interface( { blockEditorSettings } ) {\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isHugeViewport = useViewportMatch( 'huge', '>=' );\n\tconst { setIsInserterOpened, setIsListViewOpened, closeGeneralSidebar } =\n\t\tuseDispatch( editWidgetsStore );\n\tconst {\n\t\thasBlockBreadCrumbsEnabled,\n\t\thasSidebarEnabled,\n\t\tisInserterOpened,\n\t\tisListViewOpened,\n\t} = useSelect(\n\t\t( select ) => ( {\n\t\t\thasSidebarEnabled: !! select(\n\t\t\t\tinterfaceStore\n\t\t\t).getActiveComplementaryArea( editWidgetsStore.name ),\n\t\t\tisInserterOpened: !! select( editWidgetsStore ).isInserterOpened(),\n\t\t\tisListViewOpened: !! select( editWidgetsStore ).isListViewOpened(),\n\t\t\thasBlockBreadCrumbsEnabled: !! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'showBlockBreadcrumbs'\n\t\t\t),\n\t\t} ),\n\t\t[]\n\t);\n\n\t// Inserter and Sidebars are mutually exclusive\n\tuseEffect( () => {\n\t\tif ( hasSidebarEnabled && ! isHugeViewport ) {\n\t\t\tsetIsInserterOpened( false );\n\t\t\tsetIsListViewOpened( false );\n\t\t}\n\t}, [ hasSidebarEnabled, isHugeViewport ] );\n\n\tuseEffect( () => {\n\t\tif ( ( isInserterOpened || isListViewOpened ) && ! isHugeViewport ) {\n\t\t\tcloseGeneralSidebar();\n\t\t}\n\t}, [ isInserterOpened, isListViewOpened, isHugeViewport ] );\n\n\tconst secondarySidebarLabel = isListViewOpened\n\t\t? __( 'List View' )\n\t\t: __( 'Block Library' );\n\n\tconst hasSecondarySidebar = isListViewOpened || isInserterOpened;\n\n\treturn (\n\t\t<InterfaceSkeleton\n\t\t\tlabels={ {\n\t\t\t\t...interfaceLabels,\n\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t} }\n\t\t\theader={ <Header /> }\n\t\t\tsecondarySidebar={ hasSecondarySidebar && <SecondarySidebar /> }\n\t\t\tsidebar={ <ComplementaryArea.Slot scope=\"core/edit-widgets\" /> }\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t<WidgetAreasBlockEditorContent\n\t\t\t\t\t\tblockEditorSettings={ blockEditorSettings }\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t}\n\t\t\tfooter={\n\t\t\t\thasBlockBreadCrumbsEnabled &&\n\t\t\t\t! isMobileViewport && (\n\t\t\t\t\t<div className=\"edit-widg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;AAAA,MACjE,4BAA4B,CAAC,CAAE,OAAQ,gBAAiB,EAAE;AAAA,QACzD;AAAA,QACA;AAAA,MACD;AAAA,IACD;AAAA,IACA,CAAC;AAAA,EACF;AAGA,YAAW,MAAM;AAChB,QAAK,qBAAqB,CAAE,gBAAiB;AAC5C,0BAAqB,KAAM;AAC3B,0BAAqB,KAAM;AAAA,IAC5B;AAAA,EACD,GAAG,CAAE,mBAAmB,cAAe,CAAE;AAEzC,YAAW,MAAM;AAChB,SAAO,oBAAoB,qBAAsB,CAAE,gBAAiB;AACnE,0BAAoB;AAAA,IACrB;AAAA,EACD,GAAG,CAAE,kBAAkB,kBAAkB,cAAe,CAAE;AAE1D,QAAM,wBAAwB,mBAC3B,GAAI,WAAY,IAChB,GAAI,eAAgB;AAEvB,QAAM,sBAAsB,oBAAoB;AAEhD,SACC;AAAA,IAAC;AAAA;AAAA,MACA,QAAS;AAAA,QACR,GAAG;AAAA,QACH,kBAAkB;AAAA,MACnB;AAAA,MACA,QAAS,oBAAC,UAAO;AAAA,MACjB,kBAAmB,uBAAuB,oBAAC,oBAAiB;AAAA,MAC5D,SAAU,oBAAC,kBAAkB,MAAlB,EAAuB,OAAM,qBAAoB;AAAA,MAC5D,SACC,gCACC;AAAA,QAAC;AAAA;AAAA,UACA;AAAA;AAAA,MACD,GACD;AAAA,MAED,QACC,8BACA,CAAE,oBACD,oBAAC,SAAI,WAAU,+BACd;AAAA,QAAC;AAAA;AAAA,UACA,WAAU;AAAA,UACV,eAAgB,GAAI,SAAU;AAAA;AAAA,MAC/B,GACD;AAAA;AAAA,EAGH;AAEF;AAEA,IAAO,oBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "@wordpress/block-editor";
|
|
10
10
|
import { useViewportMatch } from "@wordpress/compose";
|
|
11
11
|
import { useSelect } from "@wordpress/data";
|
|
12
|
-
import { useMemo } from "@wordpress/element";
|
|
12
|
+
import { useMemo, useRef } from "@wordpress/element";
|
|
13
13
|
import { store as preferencesStore } from "@wordpress/preferences";
|
|
14
14
|
import Notices from "../notices/index.mjs";
|
|
15
15
|
import KeyboardShortcuts from "../keyboard-shortcuts/index.mjs";
|
|
@@ -25,13 +25,14 @@ function WidgetAreasBlockEditorContent({
|
|
|
25
25
|
[]
|
|
26
26
|
);
|
|
27
27
|
const isLargeViewport = useViewportMatch("medium");
|
|
28
|
+
const contentRef = useRef();
|
|
28
29
|
const styles = useMemo(() => {
|
|
29
30
|
return hasThemeStyles ? blockEditorSettings.styles : [];
|
|
30
31
|
}, [blockEditorSettings, hasThemeStyles]);
|
|
31
32
|
return /* @__PURE__ */ jsxs("div", { className: "edit-widgets-block-editor", children: [
|
|
32
33
|
/* @__PURE__ */ jsx(Notices, {}),
|
|
33
34
|
!isLargeViewport && /* @__PURE__ */ jsx(BlockToolbar, { hideDragHandle: true }),
|
|
34
|
-
/* @__PURE__ */ jsxs(BlockTools, { children: [
|
|
35
|
+
/* @__PURE__ */ jsxs(BlockTools, { __unstableContentRef: contentRef, children: [
|
|
35
36
|
/* @__PURE__ */ jsx(KeyboardShortcuts, {}),
|
|
36
37
|
/* @__PURE__ */ jsx(
|
|
37
38
|
EditorStyles,
|
|
@@ -40,7 +41,7 @@ function WidgetAreasBlockEditorContent({
|
|
|
40
41
|
scope: ":where(.editor-styles-wrapper)"
|
|
41
42
|
}
|
|
42
43
|
),
|
|
43
|
-
/* @__PURE__ */ jsx(BlockSelectionClearer, { children: /* @__PURE__ */ jsx(WritingFlow, { children: /* @__PURE__ */ jsx(BlockList, { className: "edit-widgets-main-block-list" }) }) })
|
|
44
|
+
/* @__PURE__ */ jsx(BlockSelectionClearer, { children: /* @__PURE__ */ jsx(WritingFlow, { ref: contentRef, children: /* @__PURE__ */ jsx(BlockList, { className: "edit-widgets-main-block-list" }) }) })
|
|
44
45
|
] })
|
|
45
46
|
] });
|
|
46
47
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/widget-areas-block-editor-content/index.jsx"],
|
|
4
|
-
"sourcesContent": ["import {\n\tBlockList,\n\tBlockToolbar,\n\tBlockTools,\n\tBlockSelectionClearer,\n\tWritingFlow,\n\t__unstableEditorStyles as EditorStyles,\n} from '@wordpress/block-editor';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport Notices from '../notices';\nimport KeyboardShortcuts from '../keyboard-shortcuts';\n\nexport default function WidgetAreasBlockEditorContent( {\n\tblockEditorSettings,\n} ) {\n\tconst hasThemeStyles = useSelect(\n\t\t( select ) =>\n\t\t\t!! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'themeStyles'\n\t\t\t),\n\t\t[]\n\t);\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\n\tconst styles = useMemo( () => {\n\t\treturn hasThemeStyles ? blockEditorSettings.styles : [];\n\t}, [ blockEditorSettings, hasThemeStyles ] );\n\n\treturn (\n\t\t<div className=\"edit-widgets-block-editor\">\n\t\t\t<Notices />\n\t\t\t{ ! isLargeViewport && <BlockToolbar hideDragHandle /> }\n\t\t\t<BlockTools>\n\t\t\t\t<KeyboardShortcuts />\n\t\t\t\t<EditorStyles\n\t\t\t\t\tstyles={ styles }\n\t\t\t\t\tscope=\":where(.editor-styles-wrapper)\"\n\t\t\t\t/>\n\t\t\t\t<BlockSelectionClearer>\n\t\t\t\t\t<WritingFlow>\n\t\t\t\t\t\t<BlockList className=\"edit-widgets-main-block-list\" />\n\t\t\t\t\t</WritingFlow>\n\t\t\t\t</BlockSelectionClearer>\n\t\t\t</BlockTools>\n\t\t</div>\n\t);\n}\n"],
|
|
5
|
-
"mappings": ";AAAA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,0BAA0B;AAAA,OACpB;AACP,SAAS,wBAAwB;AACjC,SAAS,iBAAiB;AAC1B,SAAS,
|
|
4
|
+
"sourcesContent": ["import {\n\tBlockList,\n\tBlockToolbar,\n\tBlockTools,\n\tBlockSelectionClearer,\n\tWritingFlow,\n\t__unstableEditorStyles as EditorStyles,\n} from '@wordpress/block-editor';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo, useRef } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport Notices from '../notices';\nimport KeyboardShortcuts from '../keyboard-shortcuts';\n\nexport default function WidgetAreasBlockEditorContent( {\n\tblockEditorSettings,\n} ) {\n\tconst hasThemeStyles = useSelect(\n\t\t( select ) =>\n\t\t\t!! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'themeStyles'\n\t\t\t),\n\t\t[]\n\t);\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst contentRef = useRef();\n\n\tconst styles = useMemo( () => {\n\t\treturn hasThemeStyles ? blockEditorSettings.styles : [];\n\t}, [ blockEditorSettings, hasThemeStyles ] );\n\n\treturn (\n\t\t<div className=\"edit-widgets-block-editor\">\n\t\t\t<Notices />\n\t\t\t{ ! isLargeViewport && <BlockToolbar hideDragHandle /> }\n\t\t\t<BlockTools __unstableContentRef={ contentRef }>\n\t\t\t\t<KeyboardShortcuts />\n\t\t\t\t<EditorStyles\n\t\t\t\t\tstyles={ styles }\n\t\t\t\t\tscope=\":where(.editor-styles-wrapper)\"\n\t\t\t\t/>\n\t\t\t\t<BlockSelectionClearer>\n\t\t\t\t\t<WritingFlow ref={ contentRef }>\n\t\t\t\t\t\t<BlockList className=\"edit-widgets-main-block-list\" />\n\t\t\t\t\t</WritingFlow>\n\t\t\t\t</BlockSelectionClearer>\n\t\t\t</BlockTools>\n\t\t</div>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";AAAA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,0BAA0B;AAAA,OACpB;AACP,SAAS,wBAAwB;AACjC,SAAS,iBAAiB;AAC1B,SAAS,SAAS,cAAc;AAChC,SAAS,SAAS,wBAAwB;AAC1C,OAAO,aAAa;AACpB,OAAO,uBAAuB;AAsB3B,cAEA,YAFA;AApBY,SAAR,8BAAgD;AAAA,EACtD;AACD,GAAI;AACH,QAAM,iBAAiB;AAAA,IACtB,CAAE,WACD,CAAC,CAAE,OAAQ,gBAAiB,EAAE;AAAA,MAC7B;AAAA,MACA;AAAA,IACD;AAAA,IACD,CAAC;AAAA,EACF;AACA,QAAM,kBAAkB,iBAAkB,QAAS;AACnD,QAAM,aAAa,OAAO;AAE1B,QAAM,SAAS,QAAS,MAAM;AAC7B,WAAO,iBAAiB,oBAAoB,SAAS,CAAC;AAAA,EACvD,GAAG,CAAE,qBAAqB,cAAe,CAAE;AAE3C,SACC,qBAAC,SAAI,WAAU,6BACd;AAAA,wBAAC,WAAQ;AAAA,IACP,CAAE,mBAAmB,oBAAC,gBAAa,gBAAc,MAAC;AAAA,IACpD,qBAAC,cAAW,sBAAuB,YAClC;AAAA,0BAAC,qBAAkB;AAAA,MACnB;AAAA,QAAC;AAAA;AAAA,UACA;AAAA,UACA,OAAM;AAAA;AAAA,MACP;AAAA,MACA,oBAAC,yBACA,8BAAC,eAAY,KAAM,YAClB,8BAAC,aAAU,WAAU,gCAA+B,GACrD,GACD;AAAA,OACD;AAAA,KACD;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -98,6 +98,21 @@
|
|
|
98
98
|
--wp-block-synced-color--rgb: 122, 0, 223;
|
|
99
99
|
--wp-bound-block-color: var(--wp-block-synced-color);
|
|
100
100
|
--wp-editor-canvas-background: #ddd;
|
|
101
|
+
--wp-admin-theme-color: #3858e9;
|
|
102
|
+
--wp-admin-theme-color--rgb: 56, 88, 233;
|
|
103
|
+
--wp-admin-theme-color-darker-10: rgb(33.0384615385, 68.7307692308, 230.4615384615);
|
|
104
|
+
--wp-admin-theme-color-darker-10--rgb: 33.0384615385, 68.7307692308, 230.4615384615;
|
|
105
|
+
--wp-admin-theme-color-darker-20: rgb(23.6923076923, 58.1538461538, 214.3076923077);
|
|
106
|
+
--wp-admin-theme-color-darker-20--rgb: 23.6923076923, 58.1538461538, 214.3076923077;
|
|
107
|
+
--wp-admin-border-width-focus: 2px;
|
|
108
|
+
}
|
|
109
|
+
@media (min-resolution: 192dpi) {
|
|
110
|
+
:root {
|
|
111
|
+
--wp-admin-border-width-focus: 1.5px;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
body.admin-color-fresh {
|
|
101
116
|
--wp-admin-theme-color: #007cba;
|
|
102
117
|
--wp-admin-theme-color--rgb: 0, 124, 186;
|
|
103
118
|
--wp-admin-theme-color-darker-10: rgb(0, 107, 160.5);
|
|
@@ -107,7 +122,7 @@
|
|
|
107
122
|
--wp-admin-border-width-focus: 2px;
|
|
108
123
|
}
|
|
109
124
|
@media (min-resolution: 192dpi) {
|
|
110
|
-
|
|
125
|
+
body.admin-color-fresh {
|
|
111
126
|
--wp-admin-border-width-focus: 1.5px;
|
|
112
127
|
}
|
|
113
128
|
}
|
|
@@ -470,16 +485,6 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
470
485
|
display: flex;
|
|
471
486
|
}
|
|
472
487
|
}
|
|
473
|
-
.interface-interface-skeleton__footer .block-editor-block-breadcrumb {
|
|
474
|
-
z-index: 30;
|
|
475
|
-
display: flex;
|
|
476
|
-
background: #fff;
|
|
477
|
-
height: var(--wpds-dimension-size-md, 32px);
|
|
478
|
-
align-items: center;
|
|
479
|
-
font-size: 13px;
|
|
480
|
-
padding: 0 18px;
|
|
481
|
-
}
|
|
482
|
-
|
|
483
488
|
.interface-interface-skeleton__actions {
|
|
484
489
|
z-index: 100000;
|
|
485
490
|
position: fixed !important;
|
|
@@ -820,15 +825,25 @@ body.is-dragging-components-draggable .wp-block[data-type="core/widget-area"] .c
|
|
|
820
825
|
}
|
|
821
826
|
|
|
822
827
|
.edit-widgets-notices.notices-inline-notices-wrapper,
|
|
823
|
-
.edit-widgets-notices .
|
|
828
|
+
.edit-widgets-notices .notices-inline-notices__list {
|
|
824
829
|
gap: 0;
|
|
825
830
|
}
|
|
826
831
|
|
|
827
|
-
.edit-widgets-notices .
|
|
832
|
+
.edit-widgets-notices .notices-inline-notices__notice {
|
|
828
833
|
border-top-width: 0;
|
|
829
834
|
border-inline-width: 0;
|
|
830
835
|
}
|
|
831
836
|
|
|
837
|
+
.edit-widgets-layout__footer {
|
|
838
|
+
flex: 1 1 auto;
|
|
839
|
+
min-width: 0;
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
.edit-widgets-layout__breadcrumbs {
|
|
843
|
+
height: var(--wpds-dimension-size-md, 32px);
|
|
844
|
+
padding: 0 18px;
|
|
845
|
+
}
|
|
846
|
+
|
|
832
847
|
.edit-widgets-layout__inserter-panel {
|
|
833
848
|
height: 100%;
|
|
834
849
|
display: flex;
|
package/build-style/style.css
CHANGED
|
@@ -98,6 +98,21 @@
|
|
|
98
98
|
--wp-block-synced-color--rgb: 122, 0, 223;
|
|
99
99
|
--wp-bound-block-color: var(--wp-block-synced-color);
|
|
100
100
|
--wp-editor-canvas-background: #ddd;
|
|
101
|
+
--wp-admin-theme-color: #3858e9;
|
|
102
|
+
--wp-admin-theme-color--rgb: 56, 88, 233;
|
|
103
|
+
--wp-admin-theme-color-darker-10: rgb(33.0384615385, 68.7307692308, 230.4615384615);
|
|
104
|
+
--wp-admin-theme-color-darker-10--rgb: 33.0384615385, 68.7307692308, 230.4615384615;
|
|
105
|
+
--wp-admin-theme-color-darker-20: rgb(23.6923076923, 58.1538461538, 214.3076923077);
|
|
106
|
+
--wp-admin-theme-color-darker-20--rgb: 23.6923076923, 58.1538461538, 214.3076923077;
|
|
107
|
+
--wp-admin-border-width-focus: 2px;
|
|
108
|
+
}
|
|
109
|
+
@media (min-resolution: 192dpi) {
|
|
110
|
+
:root {
|
|
111
|
+
--wp-admin-border-width-focus: 1.5px;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
body.admin-color-fresh {
|
|
101
116
|
--wp-admin-theme-color: #007cba;
|
|
102
117
|
--wp-admin-theme-color--rgb: 0, 124, 186;
|
|
103
118
|
--wp-admin-theme-color-darker-10: rgb(0, 107, 160.5);
|
|
@@ -107,7 +122,7 @@
|
|
|
107
122
|
--wp-admin-border-width-focus: 2px;
|
|
108
123
|
}
|
|
109
124
|
@media (min-resolution: 192dpi) {
|
|
110
|
-
|
|
125
|
+
body.admin-color-fresh {
|
|
111
126
|
--wp-admin-border-width-focus: 1.5px;
|
|
112
127
|
}
|
|
113
128
|
}
|
|
@@ -470,16 +485,6 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
470
485
|
display: flex;
|
|
471
486
|
}
|
|
472
487
|
}
|
|
473
|
-
.interface-interface-skeleton__footer .block-editor-block-breadcrumb {
|
|
474
|
-
z-index: 30;
|
|
475
|
-
display: flex;
|
|
476
|
-
background: #fff;
|
|
477
|
-
height: var(--wpds-dimension-size-md, 32px);
|
|
478
|
-
align-items: center;
|
|
479
|
-
font-size: 13px;
|
|
480
|
-
padding: 0 18px;
|
|
481
|
-
}
|
|
482
|
-
|
|
483
488
|
.interface-interface-skeleton__actions {
|
|
484
489
|
z-index: 100000;
|
|
485
490
|
position: fixed !important;
|
|
@@ -820,15 +825,25 @@ body.is-dragging-components-draggable .wp-block[data-type="core/widget-area"] .c
|
|
|
820
825
|
}
|
|
821
826
|
|
|
822
827
|
.edit-widgets-notices.notices-inline-notices-wrapper,
|
|
823
|
-
.edit-widgets-notices .
|
|
828
|
+
.edit-widgets-notices .notices-inline-notices__list {
|
|
824
829
|
gap: 0;
|
|
825
830
|
}
|
|
826
831
|
|
|
827
|
-
.edit-widgets-notices .
|
|
832
|
+
.edit-widgets-notices .notices-inline-notices__notice {
|
|
828
833
|
border-top-width: 0;
|
|
829
834
|
border-inline-width: 0;
|
|
830
835
|
}
|
|
831
836
|
|
|
837
|
+
.edit-widgets-layout__footer {
|
|
838
|
+
flex: 1 1 auto;
|
|
839
|
+
min-width: 0;
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
.edit-widgets-layout__breadcrumbs {
|
|
843
|
+
height: var(--wpds-dimension-size-md, 32px);
|
|
844
|
+
padding: 0 18px;
|
|
845
|
+
}
|
|
846
|
+
|
|
832
847
|
.edit-widgets-layout__inserter-panel {
|
|
833
848
|
height: 100%;
|
|
834
849
|
display: flex;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/edit-widgets",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"description": "Widgets Page module for WordPress..",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -20,15 +20,14 @@
|
|
|
20
20
|
"url": "https://github.com/WordPress/gutenberg/issues"
|
|
21
21
|
},
|
|
22
22
|
"engines": {
|
|
23
|
-
"node": ">=
|
|
23
|
+
"node": ">=22.13.0"
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
26
|
"src",
|
|
27
27
|
"build",
|
|
28
28
|
"build-module",
|
|
29
29
|
"build-style",
|
|
30
|
-
"build-types"
|
|
31
|
-
"*.md"
|
|
30
|
+
"build-types"
|
|
32
31
|
],
|
|
33
32
|
"main": "build/index.cjs",
|
|
34
33
|
"module": "build-module/index.mjs",
|
|
@@ -46,42 +45,43 @@
|
|
|
46
45
|
]
|
|
47
46
|
},
|
|
48
47
|
"dependencies": {
|
|
49
|
-
"@wordpress/
|
|
50
|
-
"@wordpress/
|
|
51
|
-
"@wordpress/
|
|
52
|
-
"@wordpress/
|
|
53
|
-
"@wordpress/block-
|
|
54
|
-
"@wordpress/
|
|
55
|
-
"@wordpress/
|
|
56
|
-
"@wordpress/
|
|
57
|
-
"@wordpress/
|
|
58
|
-
"@wordpress/data": "^
|
|
59
|
-
"@wordpress/
|
|
60
|
-
"@wordpress/
|
|
61
|
-
"@wordpress/
|
|
62
|
-
"@wordpress/
|
|
63
|
-
"@wordpress/
|
|
64
|
-
"@wordpress/
|
|
65
|
-
"@wordpress/
|
|
66
|
-
"@wordpress/
|
|
67
|
-
"@wordpress/
|
|
68
|
-
"@wordpress/
|
|
69
|
-
"@wordpress/
|
|
70
|
-
"@wordpress/
|
|
71
|
-
"@wordpress/
|
|
72
|
-
"@wordpress/
|
|
73
|
-
"@wordpress/
|
|
74
|
-
"@wordpress/
|
|
75
|
-
"@wordpress/
|
|
76
|
-
"@wordpress/
|
|
77
|
-
"@wordpress/
|
|
48
|
+
"@wordpress/a11y": "^5.0.0",
|
|
49
|
+
"@wordpress/admin-ui": "^3.0.0",
|
|
50
|
+
"@wordpress/api-fetch": "^8.0.0",
|
|
51
|
+
"@wordpress/base-styles": "^14.0.0",
|
|
52
|
+
"@wordpress/block-editor": "^19.0.0",
|
|
53
|
+
"@wordpress/block-library": "^12.0.0",
|
|
54
|
+
"@wordpress/blocks": "^17.0.0",
|
|
55
|
+
"@wordpress/components": "^43.0.0",
|
|
56
|
+
"@wordpress/compose": "^9.0.0",
|
|
57
|
+
"@wordpress/core-data": "^9.0.0",
|
|
58
|
+
"@wordpress/data": "^11.0.0",
|
|
59
|
+
"@wordpress/deprecated": "^5.0.0",
|
|
60
|
+
"@wordpress/dom": "^5.0.0",
|
|
61
|
+
"@wordpress/element": "^10.0.0",
|
|
62
|
+
"@wordpress/hooks": "^5.0.0",
|
|
63
|
+
"@wordpress/i18n": "^7.0.0",
|
|
64
|
+
"@wordpress/icons": "^19.0.0",
|
|
65
|
+
"@wordpress/interface": "^11.0.0",
|
|
66
|
+
"@wordpress/keyboard-shortcuts": "^6.0.0",
|
|
67
|
+
"@wordpress/keycodes": "^5.0.0",
|
|
68
|
+
"@wordpress/media-utils": "^6.0.0",
|
|
69
|
+
"@wordpress/notices": "^6.0.0",
|
|
70
|
+
"@wordpress/patterns": "^3.0.0",
|
|
71
|
+
"@wordpress/plugins": "^8.0.0",
|
|
72
|
+
"@wordpress/preferences": "^5.0.0",
|
|
73
|
+
"@wordpress/private-apis": "^3.0.0",
|
|
74
|
+
"@wordpress/theme": "^3.0.0",
|
|
75
|
+
"@wordpress/ui": "^0.25.0",
|
|
76
|
+
"@wordpress/url": "^5.0.0",
|
|
77
|
+
"@wordpress/widgets": "^5.0.0",
|
|
78
78
|
"clsx": "^2.1.1"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
81
|
"@testing-library/dom": "^10.4.2",
|
|
82
82
|
"@testing-library/react": "^16.3.3",
|
|
83
83
|
"deep-freeze": "^0.0.1",
|
|
84
|
-
"vitest": "^5.0.
|
|
84
|
+
"vitest": "^5.0.3"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
87
|
"react": "^18 || ^19",
|
|
@@ -90,5 +90,5 @@
|
|
|
90
90
|
"publishConfig": {
|
|
91
91
|
"access": "public"
|
|
92
92
|
},
|
|
93
|
-
"gitHead": "
|
|
93
|
+
"gitHead": "8d30f92cbbde3ddf781c8799443c649befbbcb88"
|
|
94
94
|
}
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import { Component } from '@wordpress/element';
|
|
2
|
+
import { speak } from '@wordpress/a11y';
|
|
2
3
|
import { __ } from '@wordpress/i18n';
|
|
3
|
-
// eslint-disable-next-line @wordpress/use-recommended-components -- The fallback UI renders outside the editor's notice system.
|
|
4
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
|
+
function getErrorNotice() {
|
|
9
|
+
return {
|
|
10
|
+
title: __( 'The editor has crashed' ),
|
|
11
|
+
description: __(
|
|
12
|
+
'An unknown error occurred. Reload your browser to try again, or copy the error to report the problem or search.'
|
|
13
|
+
),
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
8
17
|
// A boundary catches whatever was thrown, which is not always an `Error`.
|
|
9
18
|
function getErrorName( error ) {
|
|
10
19
|
return ( error instanceof Error && error.name ) || 'Error';
|
|
@@ -125,6 +134,8 @@ export default class ErrorBoundary extends Component {
|
|
|
125
134
|
}
|
|
126
135
|
|
|
127
136
|
componentDidCatch( error, errorInfo ) {
|
|
137
|
+
const { title, description } = getErrorNotice();
|
|
138
|
+
speak( `${ title }. ${ description }`, 'assertive' );
|
|
128
139
|
this.setState( { componentStack: errorInfo?.componentStack } );
|
|
129
140
|
doAction( 'editor.ErrorBoundary.errorLogged', error, errorInfo );
|
|
130
141
|
}
|
|
@@ -139,6 +150,8 @@ export default class ErrorBoundary extends Component {
|
|
|
139
150
|
return this.props.children;
|
|
140
151
|
}
|
|
141
152
|
|
|
153
|
+
const { title, description } = getErrorNotice();
|
|
154
|
+
|
|
142
155
|
return (
|
|
143
156
|
<Stack
|
|
144
157
|
className="edit-widgets-error-boundary"
|
|
@@ -146,14 +159,8 @@ export default class ErrorBoundary extends Component {
|
|
|
146
159
|
gap="lg"
|
|
147
160
|
>
|
|
148
161
|
<Notice.Root intent="error">
|
|
149
|
-
<Notice.Title>
|
|
150
|
-
|
|
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>
|
|
162
|
+
<Notice.Title>{ title }</Notice.Title>
|
|
163
|
+
<Notice.Description>{ description }</Notice.Description>
|
|
157
164
|
<Notice.Actions>
|
|
158
165
|
<CopyButton
|
|
159
166
|
variant="solid"
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { describe, expect, it, vi } from 'vitest';
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import { speak } from '@wordpress/a11y';
|
|
3
4
|
import * as wpHooks from '@wordpress/hooks';
|
|
4
5
|
import ErrorBoundary from '../index';
|
|
5
6
|
|
|
7
|
+
vi.mock( import( '@wordpress/a11y' ), () => ( { speak: vi.fn() } ) );
|
|
8
|
+
|
|
6
9
|
const theError = new Error( 'Kaboom' );
|
|
7
10
|
|
|
8
11
|
const ChildComponent = () => {
|
|
@@ -11,6 +14,25 @@ const ChildComponent = () => {
|
|
|
11
14
|
|
|
12
15
|
describe( 'Error Boundary', () => {
|
|
13
16
|
describe( 'when error is thrown from a Child component', () => {
|
|
17
|
+
it( 'announces the error title and description without action labels', () => {
|
|
18
|
+
render(
|
|
19
|
+
<ErrorBoundary>
|
|
20
|
+
<ChildComponent />
|
|
21
|
+
</ErrorBoundary>
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
expect( console ).toHaveErrored();
|
|
25
|
+
expect( speak ).toHaveBeenCalledExactlyOnceWith(
|
|
26
|
+
'The editor has crashed. An unknown error occurred. Reload your browser to try again, or copy the error to report the problem or search.',
|
|
27
|
+
'assertive'
|
|
28
|
+
);
|
|
29
|
+
expect( screen.queryByRole( 'alert' ) ).not.toBeInTheDocument();
|
|
30
|
+
const copyError = screen.getByRole( 'button', {
|
|
31
|
+
name: 'Copy error',
|
|
32
|
+
} );
|
|
33
|
+
expect( copyError ).toBeVisible();
|
|
34
|
+
} );
|
|
35
|
+
|
|
14
36
|
it( 'calls the `editor.ErrorBoundary.errorLogged` hook action with the error object and error info', () => {
|
|
15
37
|
const doAction = vi.spyOn( wpHooks, 'doAction' );
|
|
16
38
|
|
|
@@ -90,7 +90,10 @@ function Interface( { blockEditorSettings } ) {
|
|
|
90
90
|
hasBlockBreadCrumbsEnabled &&
|
|
91
91
|
! isMobileViewport && (
|
|
92
92
|
<div className="edit-widgets-layout__footer">
|
|
93
|
-
<BlockBreadcrumb
|
|
93
|
+
<BlockBreadcrumb
|
|
94
|
+
className="edit-widgets-layout__breadcrumbs"
|
|
95
|
+
rootLabelText={ __( 'Widgets' ) }
|
|
96
|
+
/>
|
|
94
97
|
</div>
|
|
95
98
|
)
|
|
96
99
|
}
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
@use "@wordpress/base-styles/mixins" as *;
|
|
2
2
|
@use "@wordpress/base-styles/variables" as *;
|
|
3
3
|
|
|
4
|
+
.edit-widgets-layout__footer {
|
|
5
|
+
flex: 1 1 auto;
|
|
6
|
+
// Let the flex item shrink below the trail's content width so breadcrumbs can collapse.
|
|
7
|
+
min-width: 0;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.edit-widgets-layout__breadcrumbs {
|
|
11
|
+
height: var(--wpds-dimension-size-md);
|
|
12
|
+
padding: 0 ($grid-unit-15 + 6px);
|
|
13
|
+
}
|
|
14
|
+
|
|
4
15
|
.edit-widgets-layout__inserter-panel {
|
|
5
16
|
height: 100%;
|
|
6
17
|
display: flex;
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
.edit-widgets-notices.notices-inline-notices-wrapper,
|
|
9
|
-
.edit-widgets-notices .
|
|
9
|
+
.edit-widgets-notices .notices-inline-notices__list {
|
|
10
10
|
gap: 0;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
.edit-widgets-notices .
|
|
13
|
+
.edit-widgets-notices .notices-inline-notices__notice {
|
|
14
14
|
border-top-width: 0;
|
|
15
15
|
border-inline-width: 0;
|
|
16
16
|
}
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from '@wordpress/block-editor';
|
|
9
9
|
import { useViewportMatch } from '@wordpress/compose';
|
|
10
10
|
import { useSelect } from '@wordpress/data';
|
|
11
|
-
import { useMemo } from '@wordpress/element';
|
|
11
|
+
import { useMemo, useRef } from '@wordpress/element';
|
|
12
12
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
13
13
|
import Notices from '../notices';
|
|
14
14
|
import KeyboardShortcuts from '../keyboard-shortcuts';
|
|
@@ -25,6 +25,7 @@ export default function WidgetAreasBlockEditorContent( {
|
|
|
25
25
|
[]
|
|
26
26
|
);
|
|
27
27
|
const isLargeViewport = useViewportMatch( 'medium' );
|
|
28
|
+
const contentRef = useRef();
|
|
28
29
|
|
|
29
30
|
const styles = useMemo( () => {
|
|
30
31
|
return hasThemeStyles ? blockEditorSettings.styles : [];
|
|
@@ -34,14 +35,14 @@ export default function WidgetAreasBlockEditorContent( {
|
|
|
34
35
|
<div className="edit-widgets-block-editor">
|
|
35
36
|
<Notices />
|
|
36
37
|
{ ! isLargeViewport && <BlockToolbar hideDragHandle /> }
|
|
37
|
-
<BlockTools>
|
|
38
|
+
<BlockTools __unstableContentRef={ contentRef }>
|
|
38
39
|
<KeyboardShortcuts />
|
|
39
40
|
<EditorStyles
|
|
40
41
|
styles={ styles }
|
|
41
42
|
scope=":where(.editor-styles-wrapper)"
|
|
42
43
|
/>
|
|
43
44
|
<BlockSelectionClearer>
|
|
44
|
-
<WritingFlow>
|
|
45
|
+
<WritingFlow ref={ contentRef }>
|
|
45
46
|
<BlockList className="edit-widgets-main-block-list" />
|
|
46
47
|
</WritingFlow>
|
|
47
48
|
</BlockSelectionClearer>
|
package/CHANGELOG.md
DELETED
|
@@ -1,319 +0,0 @@
|
|
|
1
|
-
<!-- Learn how to maintain this file at https://github.com/WordPress/gutenberg/tree/HEAD/packages#maintaining-changelogs. -->
|
|
2
|
-
|
|
3
|
-
## Unreleased
|
|
4
|
-
|
|
5
|
-
## 6.56.0 (2026-09-23)
|
|
6
|
-
|
|
7
|
-
### Bug Fixes
|
|
8
|
-
|
|
9
|
-
- Open the Welcome Guide from a plain menu item instead of a preference toggle, so the Options menu no longer announces "Preference activated - Welcome Guide" ([#82395](https://github.com/WordPress/gutenberg/pull/82395)).
|
|
10
|
-
|
|
11
|
-
## 6.55.0 (2026-09-10)
|
|
12
|
-
|
|
13
|
-
### Enhancements
|
|
14
|
-
|
|
15
|
-
- Error boundary: Surface debugging details ([#82099](https://github.com/WordPress/gutenberg/pull/82099)).
|
|
16
|
-
- Widget areas: Use the `layout` icon instead of the default block icon ([#61028](https://github.com/WordPress/gutenberg/issues/61028)).
|
|
17
|
-
|
|
18
|
-
### Bug Fixes
|
|
19
|
-
|
|
20
|
-
- `WelcomeGuide`: Keep the modal close icon white on hover now that it is stroke-based. ([#78812](https://github.com/WordPress/gutenberg/pull/78812))
|
|
21
|
-
- Prevent an error in `canInsertBlockInWidgetArea` when no widget area blocks are present.
|
|
22
|
-
|
|
23
|
-
### Internal
|
|
24
|
-
|
|
25
|
-
- 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)).
|
|
26
|
-
- Remove unused dependency `@wordpress/reusable-blocks` ([#82103](https://github.com/WordPress/gutenberg/pull/82103)).
|
|
27
|
-
- Use the `.jsx` extension for JavaScript source files that contain JSX ([#80990](https://github.com/WordPress/gutenberg/pull/80990)).
|
|
28
|
-
|
|
29
|
-
## 6.54.0 (2026-08-26)
|
|
30
|
-
|
|
31
|
-
## 6.53.0 (2026-08-12)
|
|
32
|
-
|
|
33
|
-
### Enhancements
|
|
34
|
-
|
|
35
|
-
- Wrap the widgets editor layout in `ThemeProvider`, seeded with the active admin color scheme primary color ([#81173](https://github.com/WordPress/gutenberg/pull/81173)).
|
|
36
|
-
|
|
37
|
-
### Bug Fixes
|
|
38
|
-
|
|
39
|
-
- Header toolbar: Fix icon button focus styles to use the design system `outset-ring__focus` mixin ([#81176](https://github.com/WordPress/gutenberg/pull/81176)).
|
|
40
|
-
|
|
41
|
-
## 6.52.0 (2026-07-29)
|
|
42
|
-
|
|
43
|
-
## 6.51.0 (2026-07-14)
|
|
44
|
-
|
|
45
|
-
### Enhancements
|
|
46
|
-
|
|
47
|
-
- Widen React peer dependency ranges to `^18 || ^19` to support both React 18 and React 19 environments ([#80024](https://github.com/WordPress/gutenberg/pull/80024)).
|
|
48
|
-
|
|
49
|
-
## 6.50.0 (2026-07-01)
|
|
50
|
-
|
|
51
|
-
## 6.49.0 (2026-06-24)
|
|
52
|
-
|
|
53
|
-
## 6.48.1 (2026-06-16)
|
|
54
|
-
|
|
55
|
-
## 6.48.0 (2026-06-10)
|
|
56
|
-
|
|
57
|
-
## 6.47.0 (2026-05-27)
|
|
58
|
-
|
|
59
|
-
## 6.46.0 (2026-05-14)
|
|
60
|
-
|
|
61
|
-
## 6.45.0 (2026-04-29)
|
|
62
|
-
|
|
63
|
-
## 6.44.0 (2026-04-15)
|
|
64
|
-
|
|
65
|
-
## 6.43.0 (2026-04-01)
|
|
66
|
-
|
|
67
|
-
## 6.42.0 (2026-03-18)
|
|
68
|
-
|
|
69
|
-
## 6.41.0 (2026-03-04)
|
|
70
|
-
|
|
71
|
-
## 6.40.0 (2026-02-18)
|
|
72
|
-
|
|
73
|
-
## 6.39.0 (2026-01-29)
|
|
74
|
-
|
|
75
|
-
## 6.38.0 (2026-01-16)
|
|
76
|
-
|
|
77
|
-
## 6.36.0 (2025-11-26)
|
|
78
|
-
|
|
79
|
-
### Internal
|
|
80
|
-
|
|
81
|
-
- Updated the `welcome-guide` implementation to specify its own close-button hover color, matching previous behavior after changes in the `Guide` component.
|
|
82
|
-
|
|
83
|
-
## 6.35.0 (2025-11-12)
|
|
84
|
-
|
|
85
|
-
## 6.34.0 (2025-10-29)
|
|
86
|
-
|
|
87
|
-
## 6.33.0 (2025-10-17)
|
|
88
|
-
|
|
89
|
-
## 6.32.0 (2025-10-01)
|
|
90
|
-
|
|
91
|
-
## 6.31.0 (2025-09-17)
|
|
92
|
-
|
|
93
|
-
## 6.30.0 (2025-09-03)
|
|
94
|
-
|
|
95
|
-
## 6.29.0 (2025-08-20)
|
|
96
|
-
|
|
97
|
-
## 6.28.0 (2025-08-07)
|
|
98
|
-
|
|
99
|
-
## 6.27.0 (2025-07-23)
|
|
100
|
-
|
|
101
|
-
## 6.26.0 (2025-06-25)
|
|
102
|
-
|
|
103
|
-
## 6.25.0 (2025-06-04)
|
|
104
|
-
|
|
105
|
-
## 6.24.0 (2025-05-22)
|
|
106
|
-
|
|
107
|
-
## 6.23.0 (2025-05-07)
|
|
108
|
-
|
|
109
|
-
## 6.22.0 (2025-04-11)
|
|
110
|
-
|
|
111
|
-
## 6.21.0 (2025-03-27)
|
|
112
|
-
|
|
113
|
-
## 6.20.0 (2025-03-13)
|
|
114
|
-
|
|
115
|
-
## 6.19.0 (2025-02-28)
|
|
116
|
-
|
|
117
|
-
## 6.18.0 (2025-02-12)
|
|
118
|
-
|
|
119
|
-
## 6.17.0 (2025-01-29)
|
|
120
|
-
|
|
121
|
-
## 6.16.0 (2025-01-15)
|
|
122
|
-
|
|
123
|
-
## 6.15.0 (2025-01-02)
|
|
124
|
-
|
|
125
|
-
## 6.14.0 (2024-12-11)
|
|
126
|
-
|
|
127
|
-
## 6.13.0 (2024-11-27)
|
|
128
|
-
|
|
129
|
-
## 6.12.0 (2024-11-16)
|
|
130
|
-
|
|
131
|
-
## 6.11.0 (2024-10-30)
|
|
132
|
-
|
|
133
|
-
## 6.10.0 (2024-10-16)
|
|
134
|
-
|
|
135
|
-
## 6.9.0 (2024-10-03)
|
|
136
|
-
|
|
137
|
-
## 6.8.0 (2024-09-19)
|
|
138
|
-
|
|
139
|
-
## 6.7.0 (2024-09-05)
|
|
140
|
-
|
|
141
|
-
## 6.6.0 (2024-08-21)
|
|
142
|
-
|
|
143
|
-
## 6.5.0 (2024-08-07)
|
|
144
|
-
|
|
145
|
-
## 6.4.0 (2024-07-24)
|
|
146
|
-
|
|
147
|
-
## 6.3.0 (2024-07-10)
|
|
148
|
-
|
|
149
|
-
## 6.2.0 (2024-06-26)
|
|
150
|
-
|
|
151
|
-
## 6.1.0 (2024-06-15)
|
|
152
|
-
|
|
153
|
-
## 6.0.0 (2024-05-31)
|
|
154
|
-
|
|
155
|
-
### Breaking Changes
|
|
156
|
-
|
|
157
|
-
- Variables like `process.env.IS_GUTENBERG_PLUGIN` have been replaced by `globalThis.IS_GUTENBERG_PLUGIN`. Build systems using `process.env` should be updated ([#61486](https://github.com/WordPress/gutenberg/pull/61486)).
|
|
158
|
-
- Increase the minimum required Node.js version to v18.12.0 matching long-term support releases ([#31270](https://github.com/WordPress/gutenberg/pull/61930)). Learn more about [Node.js releases](https://nodejs.org/en/about/previous-releases).
|
|
159
|
-
|
|
160
|
-
## 5.35.0 (2024-05-16)
|
|
161
|
-
|
|
162
|
-
### Internal
|
|
163
|
-
|
|
164
|
-
- Replaced `classnames` package with the faster and smaller `clsx` package ([#61138](https://github.com/WordPress/gutenberg/pull/61138)).
|
|
165
|
-
|
|
166
|
-
## 5.34.0 (2024-05-02)
|
|
167
|
-
|
|
168
|
-
## 5.33.0 (2024-04-19)
|
|
169
|
-
|
|
170
|
-
## 5.32.0 (2024-04-03)
|
|
171
|
-
|
|
172
|
-
## 5.31.0 (2024-03-21)
|
|
173
|
-
|
|
174
|
-
## 5.30.0 (2024-03-06)
|
|
175
|
-
|
|
176
|
-
## 5.29.0 (2024-02-21)
|
|
177
|
-
|
|
178
|
-
## 5.28.0 (2024-02-09)
|
|
179
|
-
|
|
180
|
-
## 5.27.0 (2024-01-24)
|
|
181
|
-
|
|
182
|
-
## 5.26.0 (2024-01-10)
|
|
183
|
-
|
|
184
|
-
## 5.25.0 (2023-12-13)
|
|
185
|
-
|
|
186
|
-
## 5.24.0 (2023-11-29)
|
|
187
|
-
|
|
188
|
-
## 5.23.0 (2023-11-16)
|
|
189
|
-
|
|
190
|
-
## 5.22.0 (2023-11-02)
|
|
191
|
-
|
|
192
|
-
## 5.21.0 (2023-10-18)
|
|
193
|
-
|
|
194
|
-
## 5.20.0 (2023-10-05)
|
|
195
|
-
|
|
196
|
-
## 5.19.0 (2023-09-20)
|
|
197
|
-
|
|
198
|
-
## 5.18.0 (2023-08-31)
|
|
199
|
-
|
|
200
|
-
## 5.17.0 (2023-08-16)
|
|
201
|
-
|
|
202
|
-
## 5.16.0 (2023-08-10)
|
|
203
|
-
|
|
204
|
-
## 5.15.0 (2023-07-20)
|
|
205
|
-
|
|
206
|
-
## 5.14.0 (2023-07-05)
|
|
207
|
-
|
|
208
|
-
## 5.13.0 (2023-06-23)
|
|
209
|
-
|
|
210
|
-
## 5.12.0 (2023-06-07)
|
|
211
|
-
|
|
212
|
-
## 5.11.0 (2023-05-24)
|
|
213
|
-
|
|
214
|
-
## 5.10.0 (2023-05-10)
|
|
215
|
-
|
|
216
|
-
## 5.9.0 (2023-04-26)
|
|
217
|
-
|
|
218
|
-
## 5.8.0 (2023-04-12)
|
|
219
|
-
|
|
220
|
-
## 5.7.0 (2023-03-29)
|
|
221
|
-
|
|
222
|
-
## 5.6.0 (2023-03-15)
|
|
223
|
-
|
|
224
|
-
## 5.5.0 (2023-03-01)
|
|
225
|
-
|
|
226
|
-
## 5.4.0 (2023-02-15)
|
|
227
|
-
|
|
228
|
-
## 5.3.0 (2023-02-01)
|
|
229
|
-
|
|
230
|
-
## 5.2.0 (2023-01-11)
|
|
231
|
-
|
|
232
|
-
## 5.1.0 (2023-01-02)
|
|
233
|
-
|
|
234
|
-
## 5.0.0 (2022-12-14)
|
|
235
|
-
|
|
236
|
-
### Breaking Changes
|
|
237
|
-
|
|
238
|
-
- Updated dependencies to require React 18 ([45235](https://github.com/WordPress/gutenberg/pull/45235))
|
|
239
|
-
|
|
240
|
-
## 4.19.0 (2022-11-16)
|
|
241
|
-
|
|
242
|
-
## 4.18.0 (2022-11-02)
|
|
243
|
-
|
|
244
|
-
## 4.17.0 (2022-10-19)
|
|
245
|
-
|
|
246
|
-
## 4.16.0 (2022-10-05)
|
|
247
|
-
|
|
248
|
-
## 4.15.0 (2022-09-21)
|
|
249
|
-
|
|
250
|
-
## 4.14.0 (2022-09-13)
|
|
251
|
-
|
|
252
|
-
## 4.13.0 (2022-08-24)
|
|
253
|
-
|
|
254
|
-
## 4.12.0 (2022-08-10)
|
|
255
|
-
|
|
256
|
-
## 4.11.0 (2022-07-27)
|
|
257
|
-
|
|
258
|
-
## 4.10.0 (2022-07-13)
|
|
259
|
-
|
|
260
|
-
## 4.9.0 (2022-06-29)
|
|
261
|
-
|
|
262
|
-
## 4.8.0 (2022-06-15)
|
|
263
|
-
|
|
264
|
-
## 4.7.0 (2022-06-01)
|
|
265
|
-
|
|
266
|
-
## 4.6.0 (2022-05-18)
|
|
267
|
-
|
|
268
|
-
## 4.5.0 (2022-05-04)
|
|
269
|
-
|
|
270
|
-
## 4.4.0 (2022-04-21)
|
|
271
|
-
|
|
272
|
-
## 4.3.0 (2022-04-08)
|
|
273
|
-
|
|
274
|
-
## 4.2.0 (2022-03-23)
|
|
275
|
-
|
|
276
|
-
## 4.1.0 (2022-03-11)
|
|
277
|
-
|
|
278
|
-
## 4.0.0 (2022-02-10)
|
|
279
|
-
|
|
280
|
-
### Breaking Changes
|
|
281
|
-
|
|
282
|
-
- The `GUTENBERG_PHASE` environment variable has been renamed to `IS_GUTENBERG_PLUGIN` and is now a boolean ([#38202](https://github.com/WordPress/gutenberg/pull/38202)).
|
|
283
|
-
|
|
284
|
-
### Bug Fixes
|
|
285
|
-
|
|
286
|
-
- Removed unused `@wordpress/a11y`, `@wordpress/server-side-render`, `rememo` and `uuid` dependencies ([#38388](https://github.com/WordPress/gutenberg/pull/38388)).
|
|
287
|
-
|
|
288
|
-
## 3.2.0 (2022-01-27)
|
|
289
|
-
|
|
290
|
-
## 3.1.0 (2021-11-07)
|
|
291
|
-
|
|
292
|
-
### Enhancements
|
|
293
|
-
|
|
294
|
-
- Enable persistent List View in the widget editor [#35706](https://github.com/WordPress/gutenberg/pull/35706).
|
|
295
|
-
|
|
296
|
-
## 3.0.0 (2021-07-29)
|
|
297
|
-
|
|
298
|
-
### Breaking Changes
|
|
299
|
-
|
|
300
|
-
- Upgraded React components to work with v17.0 ([#29118](https://github.com/WordPress/gutenberg/pull/29118)). There are no new features in React v17.0 as explained in the [blog post](https://reactjs.org/blog/2020/10/20/react-v17.html).
|
|
301
|
-
|
|
302
|
-
## 2.2.0 (2021-07-21)
|
|
303
|
-
|
|
304
|
-
## 2.1.0 (2021-05-20)
|
|
305
|
-
|
|
306
|
-
## 2.0.0 (2021-05-14)
|
|
307
|
-
|
|
308
|
-
### Breaking Changes
|
|
309
|
-
|
|
310
|
-
- Drop support for Internet Explorer 11 ([#31110](https://github.com/WordPress/gutenberg/pull/31110)). Learn more at <https://make.wordpress.org/core/2021/04/22/ie-11-support-phase-out-plan/>.
|
|
311
|
-
- Increase the minimum Node.js version to v12 matching Long Term Support releases ([#31270](https://github.com/WordPress/gutenberg/pull/31270)). Learn more at <https://nodejs.org/en/about/releases/>.
|
|
312
|
-
|
|
313
|
-
## 1.3.0 (2021-03-17)
|
|
314
|
-
|
|
315
|
-
## 0.1.0 (2019-03-06)
|
|
316
|
-
|
|
317
|
-
### New Features
|
|
318
|
-
|
|
319
|
-
- Initial version of the package.
|