@wordpress/edit-widgets 6.6.1 → 6.7.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 +2 -0
- package/build/components/error-boundary/index.js +4 -1
- package/build/components/error-boundary/index.js.map +1 -1
- package/build/components/secondary-sidebar/inserter-sidebar.js +4 -1
- package/build/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +4 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build/components/sidebar/widget-areas.js +4 -1
- package/build/components/sidebar/widget-areas.js.map +1 -1
- package/build/components/widget-areas-block-editor-content/index.js +1 -1
- package/build/components/widget-areas-block-editor-content/index.js.map +1 -1
- package/build-module/components/error-boundary/index.js +4 -1
- package/build-module/components/error-boundary/index.js.map +1 -1
- package/build-module/components/secondary-sidebar/inserter-sidebar.js +4 -1
- package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +4 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build-module/components/sidebar/widget-areas.js +4 -1
- package/build-module/components/sidebar/widget-areas.js.map +1 -1
- package/build-module/components/widget-areas-block-editor-content/index.js +1 -1
- package/build-module/components/widget-areas-block-editor-content/index.js.map +1 -1
- package/package.json +28 -28
- package/src/components/error-boundary/index.js +6 -1
- package/src/components/secondary-sidebar/inserter-sidebar.js +2 -0
- package/src/components/secondary-sidebar/list-view-sidebar.js +2 -0
- package/src/components/sidebar/widget-areas.js +2 -0
- package/src/components/widget-areas-block-editor-content/index.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -20,7 +20,10 @@ function CopyButton({
|
|
|
20
20
|
children
|
|
21
21
|
}) {
|
|
22
22
|
const ref = (0, _compose.useCopyToClipboard)(text);
|
|
23
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button
|
|
23
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button
|
|
24
|
+
// TODO: Switch to `true` (40px size) if possible
|
|
25
|
+
, {
|
|
26
|
+
__next40pxDefaultSize: false,
|
|
24
27
|
variant: "secondary",
|
|
25
28
|
ref: ref,
|
|
26
29
|
children: children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_i18n","_components","_blockEditor","_compose","_hooks","_jsxRuntime","CopyButton","text","children","ref","useCopyToClipboard","jsx","Button","variant","ErrorBoundaryWarning","message","error","actions","stack","__","Warning","className","ErrorBoundary","Component","constructor","arguments","state","componentDidCatch","doAction","getDerivedStateFromError","render","props","exports","default"],"sources":["@wordpress/edit-widgets/src/components/error-boundary/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { Warning } from '@wordpress/block-editor';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { doAction } from '@wordpress/hooks';\n\nfunction CopyButton( { text, children } ) {\n\tconst ref = useCopyToClipboard( text );\n\treturn (\n\t\t<Button
|
|
1
|
+
{"version":3,"names":["_element","require","_i18n","_components","_blockEditor","_compose","_hooks","_jsxRuntime","CopyButton","text","children","ref","useCopyToClipboard","jsx","Button","__next40pxDefaultSize","variant","ErrorBoundaryWarning","message","error","actions","stack","__","Warning","className","ErrorBoundary","Component","constructor","arguments","state","componentDidCatch","doAction","getDerivedStateFromError","render","props","exports","default"],"sources":["@wordpress/edit-widgets/src/components/error-boundary/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { Warning } from '@wordpress/block-editor';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { doAction } from '@wordpress/hooks';\n\nfunction CopyButton( { text, children } ) {\n\tconst ref = useCopyToClipboard( text );\n\treturn (\n\t\t<Button\n\t\t\t// TODO: Switch to `true` (40px size) if possible\n\t\t\t__next40pxDefaultSize={ false }\n\t\t\tvariant=\"secondary\"\n\t\t\tref={ ref }\n\t\t>\n\t\t\t{ children }\n\t\t</Button>\n\t);\n}\n\nfunction ErrorBoundaryWarning( { message, error } ) {\n\tconst actions = [\n\t\t<CopyButton key=\"copy-error\" text={ error.stack }>\n\t\t\t{ __( 'Copy Error' ) }\n\t\t</CopyButton>,\n\t];\n\n\treturn (\n\t\t<Warning className=\"edit-widgets-error-boundary\" actions={ actions }>\n\t\t\t{ message }\n\t\t</Warning>\n\t);\n}\n\nexport default class ErrorBoundary extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.state = {\n\t\t\terror: null,\n\t\t};\n\t}\n\n\tcomponentDidCatch( error ) {\n\t\tdoAction( 'editor.ErrorBoundary.errorLogged', error );\n\t}\n\n\tstatic getDerivedStateFromError( error ) {\n\t\treturn { error };\n\t}\n\n\trender() {\n\t\tif ( ! this.state.error ) {\n\t\t\treturn this.props.children;\n\t\t}\n\n\t\treturn (\n\t\t\t<ErrorBoundaryWarning\n\t\t\t\tmessage={ __(\n\t\t\t\t\t'The editor has encountered an unexpected error.'\n\t\t\t\t) }\n\t\t\t\terror={ this.state.error }\n\t\t\t/>\n\t\t);\n\t}\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAA4C,IAAAM,WAAA,GAAAN,OAAA;AAR5C;AACA;AACA;;AAQA,SAASO,UAAUA,CAAE;EAAEC,IAAI;EAAEC;AAAS,CAAC,EAAG;EACzC,MAAMC,GAAG,GAAG,IAAAC,2BAAkB,EAAEH,IAAK,CAAC;EACtC,oBACC,IAAAF,WAAA,CAAAM,GAAA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AAC,OAAA,GAAAX,aAAA","ignoreList":[]}
|
|
@@ -47,7 +47,10 @@ function InserterSidebar() {
|
|
|
47
47
|
className: "edit-widgets-layout__inserter-panel",
|
|
48
48
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(TagName, {
|
|
49
49
|
className: "edit-widgets-layout__inserter-panel-header",
|
|
50
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button
|
|
50
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button
|
|
51
|
+
// TODO: Switch to `true` (40px size) if possible
|
|
52
|
+
, {
|
|
53
|
+
__next40pxDefaultSize: false,
|
|
51
54
|
icon: _icons.close,
|
|
52
55
|
onClick: closeInserter,
|
|
53
56
|
label: (0, _i18n.__)('Close block inserter')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_icons","_blockEditor","_compose","_element","_data","_i18n","_useWidgetLibraryInsertionPoint","_interopRequireDefault","_store","_jsxRuntime","InserterSidebar","isMobileViewport","useViewportMatch","rootClientId","insertionIndex","useWidgetLibraryInsertionPoint","setIsInserterOpened","useDispatch","editWidgetsStore","closeInserter","useCallback","TagName","VisuallyHidden","inserterDialogRef","inserterDialogProps","useDialog","onClose","focusOnMount","libraryRef","useRef","jsxs","ref","className","children","jsx","Button","icon","close","onClick","label","__","__experimentalLibrary","showInserterHelpPanel","shouldFocusBlock","__experimentalInsertionIndex"],"sources":["@wordpress/edit-widgets/src/components/secondary-sidebar/inserter-sidebar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button, VisuallyHidden } from '@wordpress/components';\nimport { close } from '@wordpress/icons';\nimport { __experimentalLibrary as Library } from '@wordpress/block-editor';\nimport {\n\tuseViewportMatch,\n\t__experimentalUseDialog as useDialog,\n} from '@wordpress/compose';\nimport { useCallback, useRef } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport useWidgetLibraryInsertionPoint from '../../hooks/use-widget-library-insertion-point';\nimport { store as editWidgetsStore } from '../../store';\n\nexport default function InserterSidebar() {\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst { rootClientId, insertionIndex } = useWidgetLibraryInsertionPoint();\n\n\tconst { setIsInserterOpened } = useDispatch( editWidgetsStore );\n\n\tconst closeInserter = useCallback( () => {\n\t\treturn setIsInserterOpened( false );\n\t}, [ setIsInserterOpened ] );\n\n\tconst TagName = ! isMobileViewport ? VisuallyHidden : 'div';\n\tconst [ inserterDialogRef, inserterDialogProps ] = useDialog( {\n\t\tonClose: closeInserter,\n\t\tfocusOnMount: true,\n\t} );\n\n\tconst libraryRef = useRef();\n\n\treturn (\n\t\t<div\n\t\t\tref={ inserterDialogRef }\n\t\t\t{ ...inserterDialogProps }\n\t\t\tclassName=\"edit-widgets-layout__inserter-panel\"\n\t\t>\n\t\t\t<TagName className=\"edit-widgets-layout__inserter-panel-header\">\n\t\t\t\t<Button\n\t\t\t\t\ticon={ close }\n\t\t\t\t\tonClick={ closeInserter }\n\t\t\t\t\tlabel={ __( 'Close block inserter' ) }\n\t\t\t\t/>\n\t\t\t</TagName>\n\t\t\t<div className=\"edit-widgets-layout__inserter-panel-content\">\n\t\t\t\t<Library\n\t\t\t\t\tshowInserterHelpPanel\n\t\t\t\t\tshouldFocusBlock={ isMobileViewport }\n\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t__experimentalInsertionIndex={ insertionIndex }\n\t\t\t\t\tref={ libraryRef }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAIA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AAKA,IAAAO,+BAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AAAwD,IAAAU,WAAA,GAAAV,OAAA;AAlBxD;AACA;AACA;;AAYA;AACA;AACA;;AAIe,SAASW,eAAeA,CAAA,EAAG;EACzC,MAAMC,gBAAgB,GAAG,IAAAC,yBAAgB,EAAE,QAAQ,EAAE,GAAI,CAAC;EAC1D,MAAM;IAAEC,YAAY;IAAEC;EAAe,CAAC,GAAG,IAAAC,uCAA8B,EAAC,CAAC;EAEzE,MAAM;IAAEC;EAAoB,CAAC,GAAG,IAAAC,iBAAW,EAAEC,YAAiB,CAAC;EAE/D,MAAMC,aAAa,GAAG,IAAAC,oBAAW,EAAE,MAAM;IACxC,OAAOJ,mBAAmB,CAAE,KAAM,CAAC;EACpC,CAAC,EAAE,CAAEA,mBAAmB,CAAG,CAAC;EAE5B,MAAMK,OAAO,GAAG,CAAEV,gBAAgB,GAAGW,0BAAc,GAAG,KAAK;EAC3D,MAAM,CAAEC,iBAAiB,EAAEC,mBAAmB,CAAE,GAAG,IAAAC,gCAAS,EAAE;IAC7DC,OAAO,EAAEP,aAAa;IACtBQ,YAAY,EAAE;EACf,CAAE,CAAC;EAEH,MAAMC,UAAU,GAAG,IAAAC,eAAM,EAAC,CAAC;EAE3B,oBACC,IAAApB,WAAA,CAAAqB,IAAA;IACCC,GAAG,EAAGR,iBAAmB;IAAA,GACpBC,mBAAmB;IACxBQ,SAAS,EAAC,qCAAqC;IAAAC,QAAA,gBAE/C,IAAAxB,WAAA,CAAAyB,GAAA,EAACb,OAAO;MAACW,SAAS,EAAC,4CAA4C;MAAAC,QAAA,eAC9D,IAAAxB,WAAA,CAAAyB,GAAA,EAACpC,WAAA,CAAAqC,
|
|
1
|
+
{"version":3,"names":["_components","require","_icons","_blockEditor","_compose","_element","_data","_i18n","_useWidgetLibraryInsertionPoint","_interopRequireDefault","_store","_jsxRuntime","InserterSidebar","isMobileViewport","useViewportMatch","rootClientId","insertionIndex","useWidgetLibraryInsertionPoint","setIsInserterOpened","useDispatch","editWidgetsStore","closeInserter","useCallback","TagName","VisuallyHidden","inserterDialogRef","inserterDialogProps","useDialog","onClose","focusOnMount","libraryRef","useRef","jsxs","ref","className","children","jsx","Button","__next40pxDefaultSize","icon","close","onClick","label","__","__experimentalLibrary","showInserterHelpPanel","shouldFocusBlock","__experimentalInsertionIndex"],"sources":["@wordpress/edit-widgets/src/components/secondary-sidebar/inserter-sidebar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button, VisuallyHidden } from '@wordpress/components';\nimport { close } from '@wordpress/icons';\nimport { __experimentalLibrary as Library } from '@wordpress/block-editor';\nimport {\n\tuseViewportMatch,\n\t__experimentalUseDialog as useDialog,\n} from '@wordpress/compose';\nimport { useCallback, useRef } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport useWidgetLibraryInsertionPoint from '../../hooks/use-widget-library-insertion-point';\nimport { store as editWidgetsStore } from '../../store';\n\nexport default function InserterSidebar() {\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst { rootClientId, insertionIndex } = useWidgetLibraryInsertionPoint();\n\n\tconst { setIsInserterOpened } = useDispatch( editWidgetsStore );\n\n\tconst closeInserter = useCallback( () => {\n\t\treturn setIsInserterOpened( false );\n\t}, [ setIsInserterOpened ] );\n\n\tconst TagName = ! isMobileViewport ? VisuallyHidden : 'div';\n\tconst [ inserterDialogRef, inserterDialogProps ] = useDialog( {\n\t\tonClose: closeInserter,\n\t\tfocusOnMount: true,\n\t} );\n\n\tconst libraryRef = useRef();\n\n\treturn (\n\t\t<div\n\t\t\tref={ inserterDialogRef }\n\t\t\t{ ...inserterDialogProps }\n\t\t\tclassName=\"edit-widgets-layout__inserter-panel\"\n\t\t>\n\t\t\t<TagName className=\"edit-widgets-layout__inserter-panel-header\">\n\t\t\t\t<Button\n\t\t\t\t\t// TODO: Switch to `true` (40px size) if possible\n\t\t\t\t\t__next40pxDefaultSize={ false }\n\t\t\t\t\ticon={ close }\n\t\t\t\t\tonClick={ closeInserter }\n\t\t\t\t\tlabel={ __( 'Close block inserter' ) }\n\t\t\t\t/>\n\t\t\t</TagName>\n\t\t\t<div className=\"edit-widgets-layout__inserter-panel-content\">\n\t\t\t\t<Library\n\t\t\t\t\tshowInserterHelpPanel\n\t\t\t\t\tshouldFocusBlock={ isMobileViewport }\n\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t__experimentalInsertionIndex={ insertionIndex }\n\t\t\t\t\tref={ libraryRef }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAIA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AAKA,IAAAO,+BAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AAAwD,IAAAU,WAAA,GAAAV,OAAA;AAlBxD;AACA;AACA;;AAYA;AACA;AACA;;AAIe,SAASW,eAAeA,CAAA,EAAG;EACzC,MAAMC,gBAAgB,GAAG,IAAAC,yBAAgB,EAAE,QAAQ,EAAE,GAAI,CAAC;EAC1D,MAAM;IAAEC,YAAY;IAAEC;EAAe,CAAC,GAAG,IAAAC,uCAA8B,EAAC,CAAC;EAEzE,MAAM;IAAEC;EAAoB,CAAC,GAAG,IAAAC,iBAAW,EAAEC,YAAiB,CAAC;EAE/D,MAAMC,aAAa,GAAG,IAAAC,oBAAW,EAAE,MAAM;IACxC,OAAOJ,mBAAmB,CAAE,KAAM,CAAC;EACpC,CAAC,EAAE,CAAEA,mBAAmB,CAAG,CAAC;EAE5B,MAAMK,OAAO,GAAG,CAAEV,gBAAgB,GAAGW,0BAAc,GAAG,KAAK;EAC3D,MAAM,CAAEC,iBAAiB,EAAEC,mBAAmB,CAAE,GAAG,IAAAC,gCAAS,EAAE;IAC7DC,OAAO,EAAEP,aAAa;IACtBQ,YAAY,EAAE;EACf,CAAE,CAAC;EAEH,MAAMC,UAAU,GAAG,IAAAC,eAAM,EAAC,CAAC;EAE3B,oBACC,IAAApB,WAAA,CAAAqB,IAAA;IACCC,GAAG,EAAGR,iBAAmB;IAAA,GACpBC,mBAAmB;IACxBQ,SAAS,EAAC,qCAAqC;IAAAC,QAAA,gBAE/C,IAAAxB,WAAA,CAAAyB,GAAA,EAACb,OAAO;MAACW,SAAS,EAAC,4CAA4C;MAAAC,QAAA,eAC9D,IAAAxB,WAAA,CAAAyB,GAAA,EAACpC,WAAA,CAAAqC;MACA;MAAA;QACAC,qBAAqB,EAAG,KAAO;QAC/BC,IAAI,EAAGC,YAAO;QACdC,OAAO,EAAGpB,aAAe;QACzBqB,KAAK,EAAG,IAAAC,QAAE,EAAE,sBAAuB;MAAG,CACtC;IAAC,CACM,CAAC,eACV,IAAAhC,WAAA,CAAAyB,GAAA;MAAKF,SAAS,EAAC,6CAA6C;MAAAC,QAAA,eAC3D,IAAAxB,WAAA,CAAAyB,GAAA,EAACjC,YAAA,CAAAyC,qBAAO;QACPC,qBAAqB;QACrBC,gBAAgB,EAAGjC,gBAAkB;QACrCE,YAAY,EAAGA,YAAc;QAC7BgC,4BAA4B,EAAG/B,cAAgB;QAC/CiB,GAAG,EAAGH;MAAY,CAClB;IAAC,CACE,CAAC;EAAA,CACF,CAAC;AAER","ignoreList":[]}
|
|
@@ -57,7 +57,10 @@ function ListViewSidebar() {
|
|
|
57
57
|
className: "edit-widgets-editor__list-view-panel-header",
|
|
58
58
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("strong", {
|
|
59
59
|
children: (0, _i18n.__)('List View')
|
|
60
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button
|
|
60
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button
|
|
61
|
+
// TODO: Switch to `true` (40px size) if possible
|
|
62
|
+
, {
|
|
63
|
+
__next40pxDefaultSize: false,
|
|
61
64
|
icon: _icons.closeSmall,
|
|
62
65
|
label: (0, _i18n.__)('Close'),
|
|
63
66
|
onClick: closeListView
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blockEditor","require","_components","_compose","_data","_element","_i18n","_icons","_keycodes","_store","_lockUnlock","_jsxRuntime","ListViewSidebar","setIsListViewOpened","useDispatch","editWidgetsStore","getListViewToggleRef","unlock","useSelect","dropZoneElement","setDropZoneElement","useState","focusOnMountRef","useFocusOnMount","closeListView","useCallback","current","focus","closeOnEscape","event","keyCode","ESCAPE","defaultPrevented","preventDefault","jsxs","className","onKeyDown","children","jsx","__","Button","icon","closeSmall","label","onClick","ref","useMergeRefs","__experimentalListView"],"sources":["@wordpress/edit-widgets/src/components/secondary-sidebar/list-view-sidebar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalListView as ListView } from '@wordpress/block-editor';\nimport { Button } from '@wordpress/components';\nimport { useFocusOnMount, useMergeRefs } from '@wordpress/compose';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useCallback, useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { closeSmall } from '@wordpress/icons';\nimport { ESCAPE } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as editWidgetsStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nexport default function ListViewSidebar() {\n\tconst { setIsListViewOpened } = useDispatch( editWidgetsStore );\n\tconst { getListViewToggleRef } = unlock( useSelect( editWidgetsStore ) );\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the dropZoneElement updates.\n\tconst [ dropZoneElement, setDropZoneElement ] = useState( null );\n\n\tconst focusOnMountRef = useFocusOnMount( 'firstElement' );\n\n\t// When closing the list view, focus should return to the toggle button.\n\tconst closeListView = useCallback( () => {\n\t\tsetIsListViewOpened( false );\n\t\tgetListViewToggleRef().current?.focus();\n\t}, [ getListViewToggleRef, setIsListViewOpened ] );\n\n\tconst closeOnEscape = useCallback(\n\t\t( event ) => {\n\t\t\tif ( event.keyCode === ESCAPE && ! event.defaultPrevented ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tcloseListView();\n\t\t\t}\n\t\t},\n\t\t[ closeListView ]\n\t);\n\n\treturn (\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div\n\t\t\tclassName=\"edit-widgets-editor__list-view-panel\"\n\t\t\tonKeyDown={ closeOnEscape }\n\t\t>\n\t\t\t<div className=\"edit-widgets-editor__list-view-panel-header\">\n\t\t\t\t<strong>{ __( 'List View' ) }</strong>\n\t\t\t\t<Button\n\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\tlabel={ __( 'Close' ) }\n\t\t\t\t\tonClick={ closeListView }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\tclassName=\"edit-widgets-editor__list-view-panel-content\"\n\t\t\t\tref={ useMergeRefs( [ focusOnMountRef, setDropZoneElement ] ) }\n\t\t\t>\n\t\t\t\t<ListView dropZoneElement={ dropZoneElement } />\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AAKA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AAA2C,IAAAU,WAAA,GAAAV,OAAA;AAhB3C;AAC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,"names":["_blockEditor","require","_components","_compose","_data","_element","_i18n","_icons","_keycodes","_store","_lockUnlock","_jsxRuntime","ListViewSidebar","setIsListViewOpened","useDispatch","editWidgetsStore","getListViewToggleRef","unlock","useSelect","dropZoneElement","setDropZoneElement","useState","focusOnMountRef","useFocusOnMount","closeListView","useCallback","current","focus","closeOnEscape","event","keyCode","ESCAPE","defaultPrevented","preventDefault","jsxs","className","onKeyDown","children","jsx","__","Button","__next40pxDefaultSize","icon","closeSmall","label","onClick","ref","useMergeRefs","__experimentalListView"],"sources":["@wordpress/edit-widgets/src/components/secondary-sidebar/list-view-sidebar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalListView as ListView } from '@wordpress/block-editor';\nimport { Button } from '@wordpress/components';\nimport { useFocusOnMount, useMergeRefs } from '@wordpress/compose';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useCallback, useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { closeSmall } from '@wordpress/icons';\nimport { ESCAPE } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as editWidgetsStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nexport default function ListViewSidebar() {\n\tconst { setIsListViewOpened } = useDispatch( editWidgetsStore );\n\tconst { getListViewToggleRef } = unlock( useSelect( editWidgetsStore ) );\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the dropZoneElement updates.\n\tconst [ dropZoneElement, setDropZoneElement ] = useState( null );\n\n\tconst focusOnMountRef = useFocusOnMount( 'firstElement' );\n\n\t// When closing the list view, focus should return to the toggle button.\n\tconst closeListView = useCallback( () => {\n\t\tsetIsListViewOpened( false );\n\t\tgetListViewToggleRef().current?.focus();\n\t}, [ getListViewToggleRef, setIsListViewOpened ] );\n\n\tconst closeOnEscape = useCallback(\n\t\t( event ) => {\n\t\t\tif ( event.keyCode === ESCAPE && ! event.defaultPrevented ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tcloseListView();\n\t\t\t}\n\t\t},\n\t\t[ closeListView ]\n\t);\n\n\treturn (\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div\n\t\t\tclassName=\"edit-widgets-editor__list-view-panel\"\n\t\t\tonKeyDown={ closeOnEscape }\n\t\t>\n\t\t\t<div className=\"edit-widgets-editor__list-view-panel-header\">\n\t\t\t\t<strong>{ __( 'List View' ) }</strong>\n\t\t\t\t<Button\n\t\t\t\t\t// TODO: Switch to `true` (40px size) if possible\n\t\t\t\t\t__next40pxDefaultSize={ false }\n\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\tlabel={ __( 'Close' ) }\n\t\t\t\t\tonClick={ closeListView }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\tclassName=\"edit-widgets-editor__list-view-panel-content\"\n\t\t\t\tref={ useMergeRefs( [ focusOnMountRef, setDropZoneElement ] ) }\n\t\t\t>\n\t\t\t\t<ListView dropZoneElement={ dropZoneElement } />\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AAKA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AAA2C,IAAAU,WAAA,GAAAV,OAAA;AAhB3C;AACA;AACA;;AAUA;AACA;AACA;;AAIe,SAASW,eAAeA,CAAA,EAAG;EACzC,MAAM;IAAEC;EAAoB,CAAC,GAAG,IAAAC,iBAAW,EAAEC,YAAiB,CAAC;EAC/D,MAAM;IAAEC;EAAqB,CAAC,GAAG,IAAAC,kBAAM,EAAE,IAAAC,eAA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AAC,8CAA8C;QACxDW,GAAG,EAAG,IAAAC,qBAAY,EAAE,CAAEzB,eAAe,EAAEF,kBAAkB,CAAG,CAAG;QAAAiB,QAAA,eAE/D,IAAA1B,WAAA,CAAA2B,GAAA,EAACtC,YAAA,CAAAgD,sBAAQ;UAAC7B,eAAe,EAAGA;QAAiB,CAAE;MAAC,CAC5C,CAAC;IAAA,CACF;EAAC;AAER","ignoreList":[]}
|
|
@@ -52,7 +52,10 @@ function WidgetAreas({
|
|
|
52
52
|
}
|
|
53
53
|
}), widgetAreas?.length === 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
54
54
|
children: (0, _i18n.__)('Your theme does not contain any Widget Areas.')
|
|
55
|
-
}), !selectedWidgetArea && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button
|
|
55
|
+
}), !selectedWidgetArea && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button
|
|
56
|
+
// TODO: Switch to `true` (40px size) if possible
|
|
57
|
+
, {
|
|
58
|
+
__next40pxDefaultSize: false,
|
|
56
59
|
href: (0, _url.addQueryArgs)('customize.php', {
|
|
57
60
|
'autofocus[panel]': 'widgets',
|
|
58
61
|
return: window.location.pathname
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_element","_icons","_blockEditor","_components","_i18n","_url","_dom","_store","_jsxRuntime","WidgetAreas","selectedWidgetAreaId","widgetAreas","useSelect","select","editWidgetsStore","getWidgetAreas","selectedWidgetArea","useMemo","find","widgetArea","id","description","__","jsx","className","children","jsxs","BlockIcon","icon","blockDefault","dangerouslySetInnerHTML","__html","safeHTML","length","Button","href","addQueryArgs","return","window","location","pathname","variant"],"sources":["@wordpress/edit-widgets/src/components/sidebar/widget-areas.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { blockDefault } from '@wordpress/icons';\nimport { BlockIcon } from '@wordpress/block-editor';\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { addQueryArgs } from '@wordpress/url';\nimport { safeHTML } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport { store as editWidgetsStore } from '../../store';\n\nexport default function WidgetAreas( { selectedWidgetAreaId } ) {\n\tconst widgetAreas = useSelect(\n\t\t( select ) => select( editWidgetsStore ).getWidgetAreas(),\n\t\t[]\n\t);\n\n\tconst selectedWidgetArea = useMemo(\n\t\t() =>\n\t\t\tselectedWidgetAreaId &&\n\t\t\twidgetAreas?.find(\n\t\t\t\t( widgetArea ) => widgetArea.id === selectedWidgetAreaId\n\t\t\t),\n\t\t[ selectedWidgetAreaId, widgetAreas ]\n\t);\n\n\tlet description;\n\tif ( ! selectedWidgetArea ) {\n\t\tdescription = __(\n\t\t\t'Widget Areas are global parts in your site’s layout that can accept blocks. These vary by theme, but are typically parts like your Sidebar or Footer.'\n\t\t);\n\t} else if ( selectedWidgetAreaId === 'wp_inactive_widgets' ) {\n\t\tdescription = __(\n\t\t\t'Blocks in this Widget Area will not be displayed in your site.'\n\t\t);\n\t} else {\n\t\tdescription = selectedWidgetArea.description;\n\t}\n\n\treturn (\n\t\t<div className=\"edit-widgets-widget-areas\">\n\t\t\t<div className=\"edit-widgets-widget-areas__top-container\">\n\t\t\t\t<BlockIcon icon={ blockDefault } />\n\t\t\t\t<div>\n\t\t\t\t\t<p\n\t\t\t\t\t\t// Use `dangerouslySetInnerHTML` to keep backwards\n\t\t\t\t\t\t// compatibility. Basic markup in the description is an\n\t\t\t\t\t\t// established feature of WordPress.\n\t\t\t\t\t\t// @see https://github.com/WordPress/gutenberg/issues/33106\n\t\t\t\t\t\tdangerouslySetInnerHTML={ {\n\t\t\t\t\t\t\t__html: safeHTML( description ),\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t\t{ widgetAreas?.length === 0 && (\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'Your theme does not contain any Widget Areas.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! selectedWidgetArea && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\thref={ addQueryArgs( 'customize.php', {\n\t\t\t\t\t\t\t\t'autofocus[panel]': 'widgets',\n\t\t\t\t\t\t\t\treturn: window.location.pathname,\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Manage with live preview' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,IAAA,GAAAN,OAAA;AACA,IAAAO,IAAA,GAAAP,OAAA;AAKA,IAAAQ,MAAA,GAAAR,OAAA;AAAwD,IAAAS,WAAA,GAAAT,OAAA;AAfxD;AACA;AACA;;AAUA;AACA;AACA;;AAGe,SAASU,WAAWA,CAAE;EAAEC;AAAqB,CAAC,EAAG;EAC/D,MAAMC,WAAW,GAAG,IAAAC,eAAS,EAC1BC,MAAM,IAAMA,MAAM,CAAEC,YAAiB,CAAC,CAACC,cAAc,CAAC,CAAC,EACzD,EACD,CAAC;EAED,MAAMC,kBAAkB,GAAG,IAAAC,gBAAO,EACjC,MACCP,oBAAoB,IACpBC,WAAW,EAAEO,IAAI,CACdC,UAAU,IAAMA,UAAU,CAACC,EAAE,KAAKV,oBACrC,CAAC,EACF,CAAEA,oBAAoB,EAAEC,WAAW,CACpC,CAAC;EAED,IAAIU,WAAW;EACf,IAAK,CAAEL,kBAAkB,EAAG;IAC3BK,WAAW,GAAG,IAAAC,QAAE,EACf,uJACD,CAAC;EACF,CAAC,MAAM,IAAKZ,oBAAoB,KAAK,qBAAqB,EAAG;IAC5DW,WAAW,GAAG,IAAAC,QAAE,EACf,gEACD,CAAC;EACF,CAAC,MAAM;IACND,WAAW,GAAGL,kBAAkB,CAACK,WAAW;EAC7C;EAEA,oBACC,IAAAb,WAAA,CAAAe,GAAA;IAAKC,SAAS,EAAC,2BAA2B;IAAAC,QAAA,eACzC,IAAAjB,WAAA,CAAAkB,IAAA;MAAKF,SAAS,EAAC,0CAA0C;MAAAC,QAAA,gBACxD,IAAAjB,WAAA,CAAAe,GAAA,EAACrB,YAAA,CAAAyB,SAAS;QAACC,IAAI,EAAGC;MAAc,CAAE,CAAC,eACnC,IAAArB,WAAA,CAAAkB,IAAA;QAAAD,QAAA,gBACC,IAAAjB,WAAA,CAAAe,GAAA;UACC;UACA;UACA;UACA;UACAO,uBAAuB,EAAG;YACzBC,MAAM,EAAE,IAAAC,aAAQ,EAAEX,WAAY;UAC/B;QAAG,CACH,CAAC,EACAV,WAAW,EAAEsB,MAAM,KAAK,CAAC,iBAC1B,IAAAzB,WAAA,CAAAe,GAAA;UAAAE,QAAA,EACG,IAAAH,QAAE,EACH,+CACD;QAAC,CACC,CACH,EACC,CAAEN,kBAAkB,iBACrB,IAAAR,WAAA,CAAAe,GAAA,EAACpB,WAAA,CAAA+B,
|
|
1
|
+
{"version":3,"names":["_data","require","_element","_icons","_blockEditor","_components","_i18n","_url","_dom","_store","_jsxRuntime","WidgetAreas","selectedWidgetAreaId","widgetAreas","useSelect","select","editWidgetsStore","getWidgetAreas","selectedWidgetArea","useMemo","find","widgetArea","id","description","__","jsx","className","children","jsxs","BlockIcon","icon","blockDefault","dangerouslySetInnerHTML","__html","safeHTML","length","Button","__next40pxDefaultSize","href","addQueryArgs","return","window","location","pathname","variant"],"sources":["@wordpress/edit-widgets/src/components/sidebar/widget-areas.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { blockDefault } from '@wordpress/icons';\nimport { BlockIcon } from '@wordpress/block-editor';\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { addQueryArgs } from '@wordpress/url';\nimport { safeHTML } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport { store as editWidgetsStore } from '../../store';\n\nexport default function WidgetAreas( { selectedWidgetAreaId } ) {\n\tconst widgetAreas = useSelect(\n\t\t( select ) => select( editWidgetsStore ).getWidgetAreas(),\n\t\t[]\n\t);\n\n\tconst selectedWidgetArea = useMemo(\n\t\t() =>\n\t\t\tselectedWidgetAreaId &&\n\t\t\twidgetAreas?.find(\n\t\t\t\t( widgetArea ) => widgetArea.id === selectedWidgetAreaId\n\t\t\t),\n\t\t[ selectedWidgetAreaId, widgetAreas ]\n\t);\n\n\tlet description;\n\tif ( ! selectedWidgetArea ) {\n\t\tdescription = __(\n\t\t\t'Widget Areas are global parts in your site’s layout that can accept blocks. These vary by theme, but are typically parts like your Sidebar or Footer.'\n\t\t);\n\t} else if ( selectedWidgetAreaId === 'wp_inactive_widgets' ) {\n\t\tdescription = __(\n\t\t\t'Blocks in this Widget Area will not be displayed in your site.'\n\t\t);\n\t} else {\n\t\tdescription = selectedWidgetArea.description;\n\t}\n\n\treturn (\n\t\t<div className=\"edit-widgets-widget-areas\">\n\t\t\t<div className=\"edit-widgets-widget-areas__top-container\">\n\t\t\t\t<BlockIcon icon={ blockDefault } />\n\t\t\t\t<div>\n\t\t\t\t\t<p\n\t\t\t\t\t\t// Use `dangerouslySetInnerHTML` to keep backwards\n\t\t\t\t\t\t// compatibility. Basic markup in the description is an\n\t\t\t\t\t\t// established feature of WordPress.\n\t\t\t\t\t\t// @see https://github.com/WordPress/gutenberg/issues/33106\n\t\t\t\t\t\tdangerouslySetInnerHTML={ {\n\t\t\t\t\t\t\t__html: safeHTML( description ),\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t\t{ widgetAreas?.length === 0 && (\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'Your theme does not contain any Widget Areas.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! selectedWidgetArea && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t// TODO: Switch to `true` (40px size) if possible\n\t\t\t\t\t\t\t__next40pxDefaultSize={ false }\n\t\t\t\t\t\t\thref={ addQueryArgs( 'customize.php', {\n\t\t\t\t\t\t\t\t'autofocus[panel]': 'widgets',\n\t\t\t\t\t\t\t\treturn: window.location.pathname,\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Manage with live preview' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,IAAA,GAAAN,OAAA;AACA,IAAAO,IAAA,GAAAP,OAAA;AAKA,IAAAQ,MAAA,GAAAR,OAAA;AAAwD,IAAAS,WAAA,GAAAT,OAAA;AAfxD;AACA;AACA;;AAUA;AACA;AACA;;AAGe,SAASU,WAAWA,CAAE;EAAEC;AAAqB,CAAC,EAAG;EAC/D,MAAMC,WAAW,GAAG,IAAAC,eAAS,EAC1BC,MAAM,IAAMA,MAAM,CAAEC,YAAiB,CAAC,CAACC,cAAc,CAAC,CAAC,EACzD,EACD,CAAC;EAED,MAAMC,kBAAk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C,MAAM,CAACC,QAAQ,CAACC;UACzB,CAAE,CAAG;UACLC,OAAO,EAAC,UAAU;UAAAjB,QAAA,EAEhB,IAAAH,QAAE,EAAE,0BAA2B;QAAC,CAC3B,CACR;MAAA,CACG,CAAC;IAAA,CACF;EAAC,CACF,CAAC;AAER","ignoreList":[]}
|
|
@@ -36,7 +36,7 @@ function WidgetAreasBlockEditorContent({
|
|
|
36
36
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_blockEditor.BlockTools, {
|
|
37
37
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_keyboardShortcuts.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.__unstableEditorStyles, {
|
|
38
38
|
styles: styles,
|
|
39
|
-
scope: ".editor-styles-wrapper"
|
|
39
|
+
scope: ":where(.editor-styles-wrapper)"
|
|
40
40
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.BlockSelectionClearer, {
|
|
41
41
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.WritingFlow, {
|
|
42
42
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.BlockList, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blockEditor","require","_compose","_data","_element","_preferences","_notices","_interopRequireDefault","_keyboardShortcuts","_jsxRuntime","WidgetAreasBlockEditorContent","blockEditorSettings","hasThemeStyles","useSelect","select","preferencesStore","get","isLargeViewport","useViewportMatch","styles","useMemo","jsxs","className","children","jsx","default","BlockToolbar","hideDragHandle","BlockTools","__unstableEditorStyles","scope","BlockSelectionClearer","WritingFlow","BlockList"],"sources":["@wordpress/edit-widgets/src/components/widget-areas-block-editor-content/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\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';\n\n/**\n * Internal dependencies\n */\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=\".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"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAQA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAKA,IAAAK,QAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,kBAAA,GAAAD,sBAAA,CAAAN,OAAA;AAAsD,IAAAQ,WAAA,GAAAR,OAAA;AApBtD;AACA;AACA;;AAcA;AACA;AACA;;AAIe,SAASS,6BAA6BA,CAAE;EACtDC;AACD,CAAC,EAAG;EACH,MAAMC,cAAc,GAAG,IAAAC,eAAS,EAC7BC,MAAM,IACP,CAAC,CAAEA,MAAM,CAAEC,kBAAiB,CAAC,CAACC,GAAG,CAChC,mBAAmB,EACnB,aACD,CAAC,EACF,EACD,CAAC;EACD,MAAMC,eAAe,GAAG,IAAAC,yBAAgB,EAAE,QAAS,CAAC;EAEpD,MAAMC,MAAM,GAAG,IAAAC,gBAAO,EAAE,MAAM;IAC7B,OAAOR,cAAc,GAAGD,mBAAmB,CAACQ,MAAM,GAAG,EAAE;EACxD,CAAC,EAAE,CAAER,mBAAmB,EAAEC,cAAc,CAAG,CAAC;EAE5C,oBACC,IAAAH,WAAA,CAAAY,IAAA;IAAKC,SAAS,EAAC,2BAA2B;IAAAC,QAAA,gBACzC,IAAAd,WAAA,CAAAe,GAAA,EAAClB,QAAA,CAAAmB,OAAO,IAAE,CAAC,EACT,CAAER,eAAe,iBAAI,IAAAR,WAAA,CAAAe,GAAA,EAACxB,YAAA,CAAA0B,YAAY;MAACC,cAAc;IAAA,CAAE,CAAC,eACtD,IAAAlB,WAAA,CAAAY,IAAA,EAACrB,YAAA,CAAA4B,UAAU;MAAAL,QAAA,gBACV,IAAAd,WAAA,CAAAe,GAAA,EAAChB,kBAAA,CAAAiB,OAAiB,IAAE,CAAC,eACrB,IAAAhB,WAAA,CAAAe,GAAA,EAACxB,YAAA,CAAA6B,sBAAY;QACZV,MAAM,EAAGA,MAAQ;QACjBW,KAAK,EAAC;
|
|
1
|
+
{"version":3,"names":["_blockEditor","require","_compose","_data","_element","_preferences","_notices","_interopRequireDefault","_keyboardShortcuts","_jsxRuntime","WidgetAreasBlockEditorContent","blockEditorSettings","hasThemeStyles","useSelect","select","preferencesStore","get","isLargeViewport","useViewportMatch","styles","useMemo","jsxs","className","children","jsx","default","BlockToolbar","hideDragHandle","BlockTools","__unstableEditorStyles","scope","BlockSelectionClearer","WritingFlow","BlockList"],"sources":["@wordpress/edit-widgets/src/components/widget-areas-block-editor-content/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\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';\n\n/**\n * Internal dependencies\n */\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"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAQA,IAAAC,QAAA,GAAAD,OA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,CAAC,eACF,IAAArB,WAAA,CAAAe,GAAA,EAACxB,YAAA,CAAA+B,qBAAqB;QAAAR,QAAA,eACrB,IAAAd,WAAA,CAAAe,GAAA,EAACxB,YAAA,CAAAgC,WAAW;UAAAT,QAAA,eACX,IAAAd,WAAA,CAAAe,GAAA,EAACxB,YAAA,CAAAiC,SAAS;YAACX,SAAS,EAAC;UAA8B,CAAE;QAAC,CAC1C;MAAC,CACQ,CAAC;IAAA,CACb,CAAC;EAAA,CACT,CAAC;AAER","ignoreList":[]}
|
|
@@ -13,7 +13,10 @@ function CopyButton({
|
|
|
13
13
|
children
|
|
14
14
|
}) {
|
|
15
15
|
const ref = useCopyToClipboard(text);
|
|
16
|
-
return /*#__PURE__*/_jsx(Button
|
|
16
|
+
return /*#__PURE__*/_jsx(Button
|
|
17
|
+
// TODO: Switch to `true` (40px size) if possible
|
|
18
|
+
, {
|
|
19
|
+
__next40pxDefaultSize: false,
|
|
17
20
|
variant: "secondary",
|
|
18
21
|
ref: ref,
|
|
19
22
|
children: children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Component","__","Button","Warning","useCopyToClipboard","doAction","jsx","_jsx","CopyButton","text","children","ref","variant","ErrorBoundaryWarning","message","error","actions","stack","className","ErrorBoundary","constructor","arguments","state","componentDidCatch","getDerivedStateFromError","render","props"],"sources":["@wordpress/edit-widgets/src/components/error-boundary/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { Warning } from '@wordpress/block-editor';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { doAction } from '@wordpress/hooks';\n\nfunction CopyButton( { text, children } ) {\n\tconst ref = useCopyToClipboard( text );\n\treturn (\n\t\t<Button
|
|
1
|
+
{"version":3,"names":["Component","__","Button","Warning","useCopyToClipboard","doAction","jsx","_jsx","CopyButton","text","children","ref","__next40pxDefaultSize","variant","ErrorBoundaryWarning","message","error","actions","stack","className","ErrorBoundary","constructor","arguments","state","componentDidCatch","getDerivedStateFromError","render","props"],"sources":["@wordpress/edit-widgets/src/components/error-boundary/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { Warning } from '@wordpress/block-editor';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { doAction } from '@wordpress/hooks';\n\nfunction CopyButton( { text, children } ) {\n\tconst ref = useCopyToClipboard( text );\n\treturn (\n\t\t<Button\n\t\t\t// TODO: Switch to `true` (40px size) if possible\n\t\t\t__next40pxDefaultSize={ false }\n\t\t\tvariant=\"secondary\"\n\t\t\tref={ ref }\n\t\t>\n\t\t\t{ children }\n\t\t</Button>\n\t);\n}\n\nfunction ErrorBoundaryWarning( { message, error } ) {\n\tconst actions = [\n\t\t<CopyButton key=\"copy-error\" text={ error.stack }>\n\t\t\t{ __( 'Copy Error' ) }\n\t\t</CopyButton>,\n\t];\n\n\treturn (\n\t\t<Warning className=\"edit-widgets-error-boundary\" actions={ actions }>\n\t\t\t{ message }\n\t\t</Warning>\n\t);\n}\n\nexport default class ErrorBoundary extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.state = {\n\t\t\terror: null,\n\t\t};\n\t}\n\n\tcomponentDidCatch( error ) {\n\t\tdoAction( 'editor.ErrorBoundary.errorLogged', error );\n\t}\n\n\tstatic getDerivedStateFromError( error ) {\n\t\treturn { error };\n\t}\n\n\trender() {\n\t\tif ( ! this.state.error ) {\n\t\t\treturn this.props.children;\n\t\t}\n\n\t\treturn (\n\t\t\t<ErrorBoundaryWarning\n\t\t\t\tmessage={ __(\n\t\t\t\t\t'The editor has encountered an unexpected error.'\n\t\t\t\t) }\n\t\t\t\terror={ this.state.error }\n\t\t\t/>\n\t\t);\n\t}\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,oBAAoB;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H,KAAK,CAACP,KAAK,EAAG;MACzB,OAAO,IAAI,CAACW,KAAK,CAACjB,QAAQ;IAC3B;IAEA,oBACCH,IAAA,CAACO,oBAAoB;MACpBC,OAAO,EAAGd,EAAE,CACX,iDACD,CAAG;MACHe,KAAK,EAAG,IAAI,CAACO,KAAK,CAACP;IAAO,CAC1B,CAAC;EAEJ;AACD","ignoreList":[]}
|
|
@@ -40,7 +40,10 @@ export default function InserterSidebar() {
|
|
|
40
40
|
className: "edit-widgets-layout__inserter-panel",
|
|
41
41
|
children: [/*#__PURE__*/_jsx(TagName, {
|
|
42
42
|
className: "edit-widgets-layout__inserter-panel-header",
|
|
43
|
-
children: /*#__PURE__*/_jsx(Button
|
|
43
|
+
children: /*#__PURE__*/_jsx(Button
|
|
44
|
+
// TODO: Switch to `true` (40px size) if possible
|
|
45
|
+
, {
|
|
46
|
+
__next40pxDefaultSize: false,
|
|
44
47
|
icon: close,
|
|
45
48
|
onClick: closeInserter,
|
|
46
49
|
label: __('Close block inserter')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Button","VisuallyHidden","close","__experimentalLibrary","Library","useViewportMatch","__experimentalUseDialog","useDialog","useCallback","useRef","useDispatch","__","useWidgetLibraryInsertionPoint","store","editWidgetsStore","jsx","_jsx","jsxs","_jsxs","InserterSidebar","isMobileViewport","rootClientId","insertionIndex","setIsInserterOpened","closeInserter","TagName","inserterDialogRef","inserterDialogProps","onClose","focusOnMount","libraryRef","ref","className","children","icon","onClick","label","showInserterHelpPanel","shouldFocusBlock","__experimentalInsertionIndex"],"sources":["@wordpress/edit-widgets/src/components/secondary-sidebar/inserter-sidebar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button, VisuallyHidden } from '@wordpress/components';\nimport { close } from '@wordpress/icons';\nimport { __experimentalLibrary as Library } from '@wordpress/block-editor';\nimport {\n\tuseViewportMatch,\n\t__experimentalUseDialog as useDialog,\n} from '@wordpress/compose';\nimport { useCallback, useRef } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport useWidgetLibraryInsertionPoint from '../../hooks/use-widget-library-insertion-point';\nimport { store as editWidgetsStore } from '../../store';\n\nexport default function InserterSidebar() {\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst { rootClientId, insertionIndex } = useWidgetLibraryInsertionPoint();\n\n\tconst { setIsInserterOpened } = useDispatch( editWidgetsStore );\n\n\tconst closeInserter = useCallback( () => {\n\t\treturn setIsInserterOpened( false );\n\t}, [ setIsInserterOpened ] );\n\n\tconst TagName = ! isMobileViewport ? VisuallyHidden : 'div';\n\tconst [ inserterDialogRef, inserterDialogProps ] = useDialog( {\n\t\tonClose: closeInserter,\n\t\tfocusOnMount: true,\n\t} );\n\n\tconst libraryRef = useRef();\n\n\treturn (\n\t\t<div\n\t\t\tref={ inserterDialogRef }\n\t\t\t{ ...inserterDialogProps }\n\t\t\tclassName=\"edit-widgets-layout__inserter-panel\"\n\t\t>\n\t\t\t<TagName className=\"edit-widgets-layout__inserter-panel-header\">\n\t\t\t\t<Button\n\t\t\t\t\ticon={ close }\n\t\t\t\t\tonClick={ closeInserter }\n\t\t\t\t\tlabel={ __( 'Close block inserter' ) }\n\t\t\t\t/>\n\t\t\t</TagName>\n\t\t\t<div className=\"edit-widgets-layout__inserter-panel-content\">\n\t\t\t\t<Library\n\t\t\t\t\tshowInserterHelpPanel\n\t\t\t\t\tshouldFocusBlock={ isMobileViewport }\n\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t__experimentalInsertionIndex={ insertionIndex }\n\t\t\t\t\tref={ libraryRef }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,MAAM,EAAEC,cAAc,QAAQ,uBAAuB;AAC9D,SAASC,KAAK,QAAQ,kBAAkB;AACxC,SAASC,qBAAqB,IAAIC,OAAO,QAAQ,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close","__experimentalLibrary","Library","useViewportMatch","__experimentalUseDialog","useDialog","useCallback","useRef","useDispatch","__","useWidgetLibraryInsertionPoint","store","editWidgetsStore","jsx","_jsx","jsxs","_jsxs","InserterSidebar","isMobileViewport","rootClientId","insertionIndex","setIsInserterOpened","closeInserter","TagName","inserterDialogRef","inserterDialogProps","onClose","focusOnMount","libraryRef","ref","className","children","__next40pxDefaultSize","icon","onClick","label","showInserterHelpPanel","shouldFocusBlock","__experimentalInsertionIndex"],"sources":["@wordpress/edit-widgets/src/components/secondary-sidebar/inserter-sidebar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button, VisuallyHidden } from '@wordpress/components';\nimport { close } from '@wordpress/icons';\nimport { __experimentalLibrary as Library } from '@wordpress/block-editor';\nimport {\n\tuseViewportMatch,\n\t__experimentalUseDialog as useDialog,\n} from '@wordpress/compose';\nimport { useCallback, useRef } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport useWidgetLibraryInsertionPoint from '../../hooks/use-widget-library-insertion-point';\nimport { store as editWidgetsStore } from '../../store';\n\nexport default function InserterSidebar() {\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst { rootClientId, insertionIndex } = useWidgetLibraryInsertionPoint();\n\n\tconst { setIsInserterOpened } = useDispatch( editWidgetsStore );\n\n\tconst closeInserter = useCallback( () => {\n\t\treturn setIsInserterOpened( false );\n\t}, [ setIsInserterOpened ] );\n\n\tconst TagName = ! isMobileViewport ? VisuallyHidden : 'div';\n\tconst [ inserterDialogRef, inserterDialogProps ] = useDialog( {\n\t\tonClose: closeInserter,\n\t\tfocusOnMount: true,\n\t} );\n\n\tconst libraryRef = useRef();\n\n\treturn (\n\t\t<div\n\t\t\tref={ inserterDialogRef }\n\t\t\t{ ...inserterDialogProps }\n\t\t\tclassName=\"edit-widgets-layout__inserter-panel\"\n\t\t>\n\t\t\t<TagName className=\"edit-widgets-layout__inserter-panel-header\">\n\t\t\t\t<Button\n\t\t\t\t\t// TODO: Switch to `true` (40px size) if possible\n\t\t\t\t\t__next40pxDefaultSize={ false }\n\t\t\t\t\ticon={ close }\n\t\t\t\t\tonClick={ closeInserter }\n\t\t\t\t\tlabel={ __( 'Close block inserter' ) }\n\t\t\t\t/>\n\t\t\t</TagName>\n\t\t\t<div className=\"edit-widgets-layout__inserter-panel-content\">\n\t\t\t\t<Library\n\t\t\t\t\tshowInserterHelpPanel\n\t\t\t\t\tshouldFocusBlock={ isMobileViewport }\n\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t__experimentalInsertionIndex={ insertionIndex }\n\t\t\t\t\tref={ libraryRef }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,MAAM,EAAEC,cAAc,QAAQ,uBAAuB;AAC9D,SAASC,KAAK,QAAQ,kBAAkB;AACxC,SAASC,qBAAqB,IAAIC,OAAO,QAAQ,yBAAyB;AAC1E,SACCC,gBAAgB,EAChBC,uBAAuB,IAAIC,SAAS,QAC9B,oBAAoB;AAC3B,SAASC,WAAW,EAAEC,MAAM,QAAQ,oBAAoB;AACxD,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,OAAOC,8BAA8B,MAAM,gDAAgD;AAC3F,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAExD,eAAe,SAASC,eAAeA,CAAA,EAAG;EACzC,MAAMC,gBAAgB,GAAGf,gBAAgB,CAAE,QAAQ,EAAE,GAAI,CAAC;EAC1D,MAAM;IAAEgB,YAAY;IAAEC;EAAe,CAAC,GAAGV,8BAA8B,CAAC,CAAC;EAEzE,MAAM;IAAEW;EAAoB,CAAC,GAAGb,WAAW,CAAEI,gBAAiB,CAAC;EAE/D,MAAMU,aAAa,GAAGhB,WAAW,CAAE,MAAM;IACxC,OAAOe,mBAAmB,CAAE,KAAM,CAAC;EACpC,CAAC,EAAE,CAAEA,mBAAmB,CAAG,CAAC;EAE5B,MAAME,OAAO,GAAG,CAAEL,gBAAgB,GAAGnB,cAAc,GAAG,KAAK;EAC3D,MAAM,CAAEyB,iBAAiB,EAAEC,mBAAmB,CAAE,GAAGpB,SAAS,CAAE;IAC7DqB,OAAO,EAAEJ,aAAa;IACtBK,YAAY,EAAE;EACf,CAAE,CAAC;EAEH,MAAMC,UAAU,GAAGrB,MAAM,CAAC,CAAC;EAE3B,oBACCS,KAAA;IACCa,GAAG,EAAGL,iBAAmB;IAAA,GACpBC,mBAAmB;IACxBK,SAAS,EAAC,qCAAqC;IAAAC,QAAA,gBAE/CjB,IAAA,CAACS,OAAO;MAACO,SAAS,EAAC,4CAA4C;MAAAC,QAAA,eAC9DjB,IAAA,CAAChB;MACA;MAAA;QACAkC,qBAAqB,EAAG,KAAO;QAC/BC,IAAI,EAAGjC,KAAO;QACdkC,OAAO,EAAGZ,aAAe;QACzBa,KAAK,EAAG1B,EAAE,CAAE,sBAAuB;MAAG,CACtC;IAAC,CACM,CAAC,eACVK,IAAA;MAAKgB,SAAS,EAAC,6CAA6C;MAAAC,QAAA,eAC3DjB,IAAA,CAACZ,OAAO;QACPkC,qBAAqB;QACrBC,gBAAgB,EAAGnB,gBAAkB;QACrCC,YAAY,EAAGA,YAAc;QAC7BmB,4BAA4B,EAAGlB,cAAgB;QAC/CS,GAAG,EAAGD;MAAY,CAClB;IAAC,CACE,CAAC;EAAA,CACF,CAAC;AAER","ignoreList":[]}
|
|
@@ -51,7 +51,10 @@ export default function ListViewSidebar() {
|
|
|
51
51
|
className: "edit-widgets-editor__list-view-panel-header",
|
|
52
52
|
children: [/*#__PURE__*/_jsx("strong", {
|
|
53
53
|
children: __('List View')
|
|
54
|
-
}), /*#__PURE__*/_jsx(Button
|
|
54
|
+
}), /*#__PURE__*/_jsx(Button
|
|
55
|
+
// TODO: Switch to `true` (40px size) if possible
|
|
56
|
+
, {
|
|
57
|
+
__next40pxDefaultSize: false,
|
|
55
58
|
icon: closeSmall,
|
|
56
59
|
label: __('Close'),
|
|
57
60
|
onClick: closeListView
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__experimentalListView","ListView","Button","useFocusOnMount","useMergeRefs","useDispatch","useSelect","useCallback","useState","__","closeSmall","ESCAPE","store","editWidgetsStore","unlock","jsx","_jsx","jsxs","_jsxs","ListViewSidebar","setIsListViewOpened","getListViewToggleRef","dropZoneElement","setDropZoneElement","focusOnMountRef","closeListView","current","focus","closeOnEscape","event","keyCode","defaultPrevented","preventDefault","className","onKeyDown","children","icon","label","onClick","ref"],"sources":["@wordpress/edit-widgets/src/components/secondary-sidebar/list-view-sidebar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalListView as ListView } from '@wordpress/block-editor';\nimport { Button } from '@wordpress/components';\nimport { useFocusOnMount, useMergeRefs } from '@wordpress/compose';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useCallback, useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { closeSmall } from '@wordpress/icons';\nimport { ESCAPE } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as editWidgetsStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nexport default function ListViewSidebar() {\n\tconst { setIsListViewOpened } = useDispatch( editWidgetsStore );\n\tconst { getListViewToggleRef } = unlock( useSelect( editWidgetsStore ) );\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the dropZoneElement updates.\n\tconst [ dropZoneElement, setDropZoneElement ] = useState( null );\n\n\tconst focusOnMountRef = useFocusOnMount( 'firstElement' );\n\n\t// When closing the list view, focus should return to the toggle button.\n\tconst closeListView = useCallback( () => {\n\t\tsetIsListViewOpened( false );\n\t\tgetListViewToggleRef().current?.focus();\n\t}, [ getListViewToggleRef, setIsListViewOpened ] );\n\n\tconst closeOnEscape = useCallback(\n\t\t( event ) => {\n\t\t\tif ( event.keyCode === ESCAPE && ! event.defaultPrevented ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tcloseListView();\n\t\t\t}\n\t\t},\n\t\t[ closeListView ]\n\t);\n\n\treturn (\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div\n\t\t\tclassName=\"edit-widgets-editor__list-view-panel\"\n\t\t\tonKeyDown={ closeOnEscape }\n\t\t>\n\t\t\t<div className=\"edit-widgets-editor__list-view-panel-header\">\n\t\t\t\t<strong>{ __( 'List View' ) }</strong>\n\t\t\t\t<Button\n\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\tlabel={ __( 'Close' ) }\n\t\t\t\t\tonClick={ closeListView }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\tclassName=\"edit-widgets-editor__list-view-panel-content\"\n\t\t\t\tref={ useMergeRefs( [ focusOnMountRef, setDropZoneElement ] ) }\n\t\t\t>\n\t\t\t\t<ListView dropZoneElement={ dropZoneElement } />\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,sBAAsB,IAAIC,QAAQ,QAAQ,yBAAyB;AAC5E,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,eAAe,EAAEC,YAAY,QAAQ,oBAAoB;AAClE,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,WAAW,EAAEC,QAAQ,QAAQ,oBAAoB;AAC1D,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,SAASC,MAAM,QAAQ,qBAAqB;;AAE5C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AACvD,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAE3C,eAAe,SAASC,eAAeA,CAAA,EAAG;EACzC,MAAM;IAAEC;EAAoB,CAAC,GAAGf,WAAW,CAAEQ,gBAAiB,CAAC;EAC/D,MAAM;IAAEQ;EAAqB,CAAC,GAAGP,MAAM,CAAER,SAAS,CAAEO,gBAAiB,CAAE,CAAC;;EAExE;EACA;EACA,MAAM,CAAES,eAAe,EAAEC,kBAAkB,CAAE,GAAGf,QAAQ,CAAE,IAAK,CAAC;EAEhE,MAAMgB,eAAe,GAAGrB,eAAe,CAAE,cAAe,CAAC;;EAEzD;EACA,MAAMsB,aAAa,GAAGlB,WAAW,CAAE,MAAM;IACxCa,mBAAmB,CAAE,KAAM,CAAC;IAC5BC,oBAAoB,CAAC,CAAC,CAACK,OAAO,EAAEC,KAAK,CAAC,CAAC;EACxC,CAAC,EAAE,CAAEN,oBAAoB,EAAED,mBAAmB,CAAG,CAAC;EAElD,MAAMQ,aAAa,GAAGrB,WAAW,CAC9BsB,KAAK,IAAM;IACZ,IAAKA,KAAK,CAACC,OAAO,KAAKnB,MAAM,IAAI,CAAEkB,KAAK,CAACE,gBAAgB,EAAG;MAC3DF,KAAK,CAACG,cAAc,CAAC,CAAC;MACtBP,aAAa,CAAC,CAAC;IAChB;EACD,CAAC,EACD,CAAEA,aAAa,CAChB,CAAC;EAED;IAAA;IACC;IACAP,KAAA;MACCe,SAAS,EAAC,sCAAsC;MAChDC,SAAS,EAAGN,aAAe;MAAAO,QAAA,gBAE3BjB,KAAA;QAAKe,SAAS,EAAC,6CAA6C;QAAAE,QAAA,gBAC3DnB,IAAA;UAAAmB,QAAA,EAAU1B,EAAE,CAAE,WAAY;QAAC,CAAU,CAAC,eACtCO,IAAA,CAACd,
|
|
1
|
+
{"version":3,"names":["__experimentalListView","ListView","Button","useFocusOnMount","useMergeRefs","useDispatch","useSelect","useCallback","useState","__","closeSmall","ESCAPE","store","editWidgetsStore","unlock","jsx","_jsx","jsxs","_jsxs","ListViewSidebar","setIsListViewOpened","getListViewToggleRef","dropZoneElement","setDropZoneElement","focusOnMountRef","closeListView","current","focus","closeOnEscape","event","keyCode","defaultPrevented","preventDefault","className","onKeyDown","children","__next40pxDefaultSize","icon","label","onClick","ref"],"sources":["@wordpress/edit-widgets/src/components/secondary-sidebar/list-view-sidebar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalListView as ListView } from '@wordpress/block-editor';\nimport { Button } from '@wordpress/components';\nimport { useFocusOnMount, useMergeRefs } from '@wordpress/compose';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useCallback, useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { closeSmall } from '@wordpress/icons';\nimport { ESCAPE } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as editWidgetsStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nexport default function ListViewSidebar() {\n\tconst { setIsListViewOpened } = useDispatch( editWidgetsStore );\n\tconst { getListViewToggleRef } = unlock( useSelect( editWidgetsStore ) );\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the dropZoneElement updates.\n\tconst [ dropZoneElement, setDropZoneElement ] = useState( null );\n\n\tconst focusOnMountRef = useFocusOnMount( 'firstElement' );\n\n\t// When closing the list view, focus should return to the toggle button.\n\tconst closeListView = useCallback( () => {\n\t\tsetIsListViewOpened( false );\n\t\tgetListViewToggleRef().current?.focus();\n\t}, [ getListViewToggleRef, setIsListViewOpened ] );\n\n\tconst closeOnEscape = useCallback(\n\t\t( event ) => {\n\t\t\tif ( event.keyCode === ESCAPE && ! event.defaultPrevented ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tcloseListView();\n\t\t\t}\n\t\t},\n\t\t[ closeListView ]\n\t);\n\n\treturn (\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div\n\t\t\tclassName=\"edit-widgets-editor__list-view-panel\"\n\t\t\tonKeyDown={ closeOnEscape }\n\t\t>\n\t\t\t<div className=\"edit-widgets-editor__list-view-panel-header\">\n\t\t\t\t<strong>{ __( 'List View' ) }</strong>\n\t\t\t\t<Button\n\t\t\t\t\t// TODO: Switch to `true` (40px size) if possible\n\t\t\t\t\t__next40pxDefaultSize={ false }\n\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\tlabel={ __( 'Close' ) }\n\t\t\t\t\tonClick={ closeListView }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\tclassName=\"edit-widgets-editor__list-view-panel-content\"\n\t\t\t\tref={ useMergeRefs( [ focusOnMountRef, setDropZoneElement ] ) }\n\t\t\t>\n\t\t\t\t<ListView dropZoneElement={ dropZoneElement } />\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,sBAAsB,IAAIC,QAAQ,QAAQ,yBAAyB;AAC5E,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,eAAe,EAAEC,YAAY,QAAQ,oBAAoB;AAClE,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,WAAW,EAAEC,QAAQ,QAAQ,oBAAoB;AAC1D,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,SAASC,MAAM,QAAQ,qBAAqB;;AAE5C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AACvD,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAE3C,eAAe,SAASC,eAAeA,CAAA,EAAG;EACzC,MAAM;IAAEC;EAAoB,CAAC,GAAGf,WAAW,CAAEQ,gBAAiB,CAAC;EAC/D,MAAM;IAAEQ;EAAqB,CAAC,GAAGP,MAAM,CAAER,SAAS,CAAEO,gBAAiB,CAAE,CAAC;;EAExE;EACA;EACA,MAAM,CAAES,eAAe,EAAEC,kBAAkB,CAAE,G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,10 @@ export default function WidgetAreas({
|
|
|
46
46
|
}
|
|
47
47
|
}), widgetAreas?.length === 0 && /*#__PURE__*/_jsx("p", {
|
|
48
48
|
children: __('Your theme does not contain any Widget Areas.')
|
|
49
|
-
}), !selectedWidgetArea && /*#__PURE__*/_jsx(Button
|
|
49
|
+
}), !selectedWidgetArea && /*#__PURE__*/_jsx(Button
|
|
50
|
+
// TODO: Switch to `true` (40px size) if possible
|
|
51
|
+
, {
|
|
52
|
+
__next40pxDefaultSize: false,
|
|
50
53
|
href: addQueryArgs('customize.php', {
|
|
51
54
|
'autofocus[panel]': 'widgets',
|
|
52
55
|
return: window.location.pathname
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSelect","useMemo","blockDefault","BlockIcon","Button","__","addQueryArgs","safeHTML","store","editWidgetsStore","jsx","_jsx","jsxs","_jsxs","WidgetAreas","selectedWidgetAreaId","widgetAreas","select","getWidgetAreas","selectedWidgetArea","find","widgetArea","id","description","className","children","icon","dangerouslySetInnerHTML","__html","length","href","return","window","location","pathname","variant"],"sources":["@wordpress/edit-widgets/src/components/sidebar/widget-areas.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { blockDefault } from '@wordpress/icons';\nimport { BlockIcon } from '@wordpress/block-editor';\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { addQueryArgs } from '@wordpress/url';\nimport { safeHTML } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport { store as editWidgetsStore } from '../../store';\n\nexport default function WidgetAreas( { selectedWidgetAreaId } ) {\n\tconst widgetAreas = useSelect(\n\t\t( select ) => select( editWidgetsStore ).getWidgetAreas(),\n\t\t[]\n\t);\n\n\tconst selectedWidgetArea = useMemo(\n\t\t() =>\n\t\t\tselectedWidgetAreaId &&\n\t\t\twidgetAreas?.find(\n\t\t\t\t( widgetArea ) => widgetArea.id === selectedWidgetAreaId\n\t\t\t),\n\t\t[ selectedWidgetAreaId, widgetAreas ]\n\t);\n\n\tlet description;\n\tif ( ! selectedWidgetArea ) {\n\t\tdescription = __(\n\t\t\t'Widget Areas are global parts in your site’s layout that can accept blocks. These vary by theme, but are typically parts like your Sidebar or Footer.'\n\t\t);\n\t} else if ( selectedWidgetAreaId === 'wp_inactive_widgets' ) {\n\t\tdescription = __(\n\t\t\t'Blocks in this Widget Area will not be displayed in your site.'\n\t\t);\n\t} else {\n\t\tdescription = selectedWidgetArea.description;\n\t}\n\n\treturn (\n\t\t<div className=\"edit-widgets-widget-areas\">\n\t\t\t<div className=\"edit-widgets-widget-areas__top-container\">\n\t\t\t\t<BlockIcon icon={ blockDefault } />\n\t\t\t\t<div>\n\t\t\t\t\t<p\n\t\t\t\t\t\t// Use `dangerouslySetInnerHTML` to keep backwards\n\t\t\t\t\t\t// compatibility. Basic markup in the description is an\n\t\t\t\t\t\t// established feature of WordPress.\n\t\t\t\t\t\t// @see https://github.com/WordPress/gutenberg/issues/33106\n\t\t\t\t\t\tdangerouslySetInnerHTML={ {\n\t\t\t\t\t\t\t__html: safeHTML( description ),\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t\t{ widgetAreas?.length === 0 && (\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'Your theme does not contain any Widget Areas.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! selectedWidgetArea && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\thref={ addQueryArgs( 'customize.php', {\n\t\t\t\t\t\t\t\t'autofocus[panel]': 'widgets',\n\t\t\t\t\t\t\t\treturn: window.location.pathname,\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Manage with live preview' ) }\n\t\t\t\t\t\t</Button>\n\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AAC,QAAA,gBACxDd,IAAA,CAACR,SAAS;QAACuB,IAAI,EAAGxB;MAAc,CAAE,CAAC,eACnCW,KAAA;QAAAY,QAAA,gBACCd,IAAA;UACC;UACA;UACA;UACA;UACAgB,uBAAuB,EAAG;YACzBC,MAAM,EAAErB,QAAQ,CAAEgB,WAAY;UAC/B;QAAG,CACH,CAAC,EACAP,WAAW,EAAEa,MAAM,KAAK,CAAC,iBAC1BlB,IAAA;UAAAc,QAAA,EACGpB,EAAE,CACH,+CACD;QAAC,CACC,CACH,EACC,CAAEc,kBAAkB,iBACrBR,IAAA,CAACP,
|
|
1
|
+
{"version":3,"names":["useSelect","useMemo","blockDefault","BlockIcon","Button","__","addQueryArgs","safeHTML","store","editWidgetsStore","jsx","_jsx","jsxs","_jsxs","WidgetAreas","selectedWidgetAreaId","widgetAreas","select","getWidgetAreas","selectedWidgetArea","find","widgetArea","id","description","className","children","icon","dangerouslySetInnerHTML","__html","length","__next40pxDefaultSize","href","return","window","location","pathname","variant"],"sources":["@wordpress/edit-widgets/src/components/sidebar/widget-areas.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { blockDefault } from '@wordpress/icons';\nimport { BlockIcon } from '@wordpress/block-editor';\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { addQueryArgs } from '@wordpress/url';\nimport { safeHTML } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport { store as editWidgetsStore } from '../../store';\n\nexport default function WidgetAreas( { selectedWidgetAreaId } ) {\n\tconst widgetAreas = useSelect(\n\t\t( select ) => select( editWidgetsStore ).getWidgetAreas(),\n\t\t[]\n\t);\n\n\tconst selectedWidgetArea = useMemo(\n\t\t() =>\n\t\t\tselectedWidgetAreaId &&\n\t\t\twidgetAreas?.find(\n\t\t\t\t( widgetArea ) => widgetArea.id === selectedWidgetAreaId\n\t\t\t),\n\t\t[ selectedWidgetAreaId, widgetAreas ]\n\t);\n\n\tlet description;\n\tif ( ! selectedWidgetArea ) {\n\t\tdescription = __(\n\t\t\t'Widget Areas are global parts in your site’s layout that can accept blocks. These vary by theme, but are typically parts like your Sidebar or Footer.'\n\t\t);\n\t} else if ( selectedWidgetAreaId === 'wp_inactive_widgets' ) {\n\t\tdescription = __(\n\t\t\t'Blocks in this Widget Area will not be displayed in your site.'\n\t\t);\n\t} else {\n\t\tdescription = selectedWidgetArea.description;\n\t}\n\n\treturn (\n\t\t<div className=\"edit-widgets-widget-areas\">\n\t\t\t<div className=\"edit-widgets-widget-areas__top-container\">\n\t\t\t\t<BlockIcon icon={ blockDefault } />\n\t\t\t\t<div>\n\t\t\t\t\t<p\n\t\t\t\t\t\t// Use `dangerouslySetInnerHTML` to keep backwards\n\t\t\t\t\t\t// compatibility. Basic markup in the description is an\n\t\t\t\t\t\t// established feature of WordPress.\n\t\t\t\t\t\t// @see https://github.com/WordPress/gutenberg/issues/33106\n\t\t\t\t\t\tdangerouslySetInnerHTML={ {\n\t\t\t\t\t\t\t__html: safeHTML( description ),\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t\t{ widgetAreas?.length === 0 && (\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'Your theme does not contain any Widget Areas.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! selectedWidgetArea && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t// TODO: Switch to `true` (40px size) if possible\n\t\t\t\t\t\t\t__next40pxDefaultSize={ false }\n\t\t\t\t\t\t\thref={ addQueryArgs( 'customize.php', {\n\t\t\t\t\t\t\t\t'autofocus[panel]': 'widgets',\n\t\t\t\t\t\t\t\treturn: window.location.pathname,\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{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eACzCZ,KAAA;MAAKW,SAAS,EAAC,0CAA0C;MAAAC,QAAA,gBACxDd,IAAA,CAACR,SAAS;QAACuB,IAAI,EAAGxB;MAAc,CAAE,CAAC,eACnCW,KAAA;QAAAY,QAAA,gBACCd,IAAA;UACC;UACA;UACA;UACA;UACAgB,uBAAuB,EAAG;YACzBC,MAAM,EAAErB,QAAQ,CAAEgB,WAAY;UAC/B;QAAG,CACH,CAAC,EACAP,WAAW,EAAEa,MAAM,KAAK,CAAC,iBAC1BlB,IAAA;UAAAc,QAAA,EACGpB,EAAE,CACH,+CACD;QAAC,CACC,CACH,EACC,CAAEc,kBAAkB,iBACrBR,IAAA,CAACP;QACA;QAAA;UACA0B,qBAAqB,EAAG,KAAO;UAC/BC,IAAI,EAAGzB,YAAY,CAAE,eAAe,EAAE;YACrC,kBAAkB,EAAE,SAAS;YAC7B0B,MAAM,EAAEC,MAAM,CAACC,QAAQ,CAACC;UACzB,CAAE,CAAG;UACLC,OAAO,EAAC,UAAU;UAAAX,QAAA,EAEhBpB,EAAE,CAAE,0BAA2B;QAAC,CAC3B,CACR;MAAA,CACG,CAAC;IAAA,CACF;EAAC,CACF,CAAC;AAER","ignoreList":[]}
|
|
@@ -29,7 +29,7 @@ export default function WidgetAreasBlockEditorContent({
|
|
|
29
29
|
}), /*#__PURE__*/_jsxs(BlockTools, {
|
|
30
30
|
children: [/*#__PURE__*/_jsx(KeyboardShortcuts, {}), /*#__PURE__*/_jsx(EditorStyles, {
|
|
31
31
|
styles: styles,
|
|
32
|
-
scope: ".editor-styles-wrapper"
|
|
32
|
+
scope: ":where(.editor-styles-wrapper)"
|
|
33
33
|
}), /*#__PURE__*/_jsx(BlockSelectionClearer, {
|
|
34
34
|
children: /*#__PURE__*/_jsx(WritingFlow, {
|
|
35
35
|
children: /*#__PURE__*/_jsx(BlockList, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BlockList","BlockToolbar","BlockTools","BlockSelectionClearer","WritingFlow","__unstableEditorStyles","EditorStyles","useViewportMatch","useSelect","useMemo","store","preferencesStore","Notices","KeyboardShortcuts","jsx","_jsx","jsxs","_jsxs","WidgetAreasBlockEditorContent","blockEditorSettings","hasThemeStyles","select","get","isLargeViewport","styles","className","children","hideDragHandle","scope"],"sources":["@wordpress/edit-widgets/src/components/widget-areas-block-editor-content/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\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';\n\n/**\n * Internal dependencies\n */\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=\".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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GA,MAAQ;QACjBI,KAAK,EAAC;
|
|
1
|
+
{"version":3,"names":["BlockList","BlockToolbar","BlockTools","BlockSelectionClearer","WritingFlow","__unstableEditorStyles","EditorStyles","useViewportMatch","useSelect","useMemo","store","preferencesStore","Notices","KeyboardShortcuts","jsx","_jsx","jsxs","_jsxs","WidgetAreasBlockEditorContent","blockEditorSettings","hasThemeStyles","select","get","isLargeViewport","styles","className","children","hideDragHandle","scope"],"sources":["@wordpress/edit-widgets/src/components/widget-areas-block-editor-content/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\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';\n\n/**\n * Internal dependencies\n */\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"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,SAAS,EACTC,YAAY,EACZC,UAAU,EACVC,qBAAqB,EACrBC,WAAW,EACXC,sBAAsB,IAAIC,YAAY,QAChC,yBAAyB;AAChC,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA,OAAOC,OAAO,MAAM,YAAY;AAChC,OAAOC,iBAAiB,MAAM,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAEtD,eAAe,SAASC,6BAA6BA,CAAE;EACtDC;AACD,CAAC,EAAG;EACH,MAAMC,cAAc,GAAGZ,SAAS,CAC7Ba,MAAM,IACP,CAAC,CAAEA,MAAM,CAAEV,gBAAiB,CAAC,CAACW,GAAG,CAChC,mBAAmB,EACnB,aACD,CAAC,EACF,EACD,CAAC;EACD,MAAMC,eAAe,GAAGhB,gBAAgB,CAAE,QAAS,CAAC;EAEpD,MAAMiB,MAAM,GAAGf,OAAO,CAAE,MAAM;IAC7B,OAAOW,cAAc,GAAGD,mBAAmB,CAACK,MAAM,GAAG,EAAE;EACxD,CAAC,EAAE,CAAEL,mBAAmB,EAAEC,cAAc,CAAG,CAAC;EAE5C,oBACCH,KAAA;IAAKQ,SAAS,EAAC,2BAA2B;IAAAC,QAAA,gBACzCX,IAAA,CAACH,OAAO,IAAE,CAAC,EACT,CAAEW,eAAe,iBAAIR,IAAA,CAACd,YAAY;MAAC0B,cAAc;IAAA,CAAE,CAAC,eACtDV,KAAA,CAACf,UAAU;MAAAwB,QAAA,gBACVX,IAAA,CAACF,iBAAiB,IAAE,CAAC,eACrBE,IAAA,CAACT,YAAY;QACZkB,MAAM,EAAGA,MAAQ;QACjBI,KAAK,EAAC;MAAgC,CACtC,CAAC,eACFb,IAAA,CAACZ,qBAAqB;QAAAuB,QAAA,eACrBX,IAAA,CAACX,WAAW;UAAAsB,QAAA,eACXX,IAAA,CAACf,SAAS;YAACyB,SAAS,EAAC;UAA8B,CAAE;QAAC,CAC1C;MAAC,CACQ,CAAC;IAAA,CACb,CAAC;EAAA,CACT,CAAC;AAER","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/edit-widgets",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.7.0",
|
|
4
4
|
"description": "Widgets Page module for WordPress..",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -28,32 +28,32 @@
|
|
|
28
28
|
"react-native": "src/index",
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@babel/runtime": "^7.16.0",
|
|
31
|
-
"@wordpress/api-fetch": "^7.
|
|
32
|
-
"@wordpress/block-editor": "^14.
|
|
33
|
-
"@wordpress/block-library": "^9.
|
|
34
|
-
"@wordpress/blocks": "^13.
|
|
35
|
-
"@wordpress/components": "^28.
|
|
36
|
-
"@wordpress/compose": "^7.
|
|
37
|
-
"@wordpress/core-data": "^7.
|
|
38
|
-
"@wordpress/data": "^10.
|
|
39
|
-
"@wordpress/deprecated": "^4.
|
|
40
|
-
"@wordpress/dom": "^4.
|
|
41
|
-
"@wordpress/element": "^6.
|
|
42
|
-
"@wordpress/hooks": "^4.
|
|
43
|
-
"@wordpress/i18n": "^5.
|
|
44
|
-
"@wordpress/icons": "^10.
|
|
45
|
-
"@wordpress/interface": "^6.
|
|
46
|
-
"@wordpress/keyboard-shortcuts": "^5.
|
|
47
|
-
"@wordpress/keycodes": "^4.
|
|
48
|
-
"@wordpress/media-utils": "^5.
|
|
49
|
-
"@wordpress/notices": "^5.
|
|
50
|
-
"@wordpress/patterns": "^2.
|
|
51
|
-
"@wordpress/plugins": "^7.
|
|
52
|
-
"@wordpress/preferences": "^4.
|
|
53
|
-
"@wordpress/private-apis": "^1.
|
|
54
|
-
"@wordpress/reusable-blocks": "^5.
|
|
55
|
-
"@wordpress/url": "^4.
|
|
56
|
-
"@wordpress/widgets": "^4.
|
|
31
|
+
"@wordpress/api-fetch": "^7.7.0",
|
|
32
|
+
"@wordpress/block-editor": "^14.2.0",
|
|
33
|
+
"@wordpress/block-library": "^9.7.0",
|
|
34
|
+
"@wordpress/blocks": "^13.7.0",
|
|
35
|
+
"@wordpress/components": "^28.7.0",
|
|
36
|
+
"@wordpress/compose": "^7.7.0",
|
|
37
|
+
"@wordpress/core-data": "^7.7.0",
|
|
38
|
+
"@wordpress/data": "^10.7.0",
|
|
39
|
+
"@wordpress/deprecated": "^4.7.0",
|
|
40
|
+
"@wordpress/dom": "^4.7.0",
|
|
41
|
+
"@wordpress/element": "^6.7.0",
|
|
42
|
+
"@wordpress/hooks": "^4.7.0",
|
|
43
|
+
"@wordpress/i18n": "^5.7.0",
|
|
44
|
+
"@wordpress/icons": "^10.7.0",
|
|
45
|
+
"@wordpress/interface": "^6.7.0",
|
|
46
|
+
"@wordpress/keyboard-shortcuts": "^5.7.0",
|
|
47
|
+
"@wordpress/keycodes": "^4.7.0",
|
|
48
|
+
"@wordpress/media-utils": "^5.7.0",
|
|
49
|
+
"@wordpress/notices": "^5.7.0",
|
|
50
|
+
"@wordpress/patterns": "^2.7.0",
|
|
51
|
+
"@wordpress/plugins": "^7.7.0",
|
|
52
|
+
"@wordpress/preferences": "^4.7.0",
|
|
53
|
+
"@wordpress/private-apis": "^1.7.0",
|
|
54
|
+
"@wordpress/reusable-blocks": "^5.7.0",
|
|
55
|
+
"@wordpress/url": "^4.7.0",
|
|
56
|
+
"@wordpress/widgets": "^4.7.0",
|
|
57
57
|
"clsx": "^2.1.1"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"publishConfig": {
|
|
64
64
|
"access": "public"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "c90d920de07c53dff82c5914635b56fafa503b7f"
|
|
67
67
|
}
|
|
@@ -11,7 +11,12 @@ import { doAction } from '@wordpress/hooks';
|
|
|
11
11
|
function CopyButton( { text, children } ) {
|
|
12
12
|
const ref = useCopyToClipboard( text );
|
|
13
13
|
return (
|
|
14
|
-
<Button
|
|
14
|
+
<Button
|
|
15
|
+
// TODO: Switch to `true` (40px size) if possible
|
|
16
|
+
__next40pxDefaultSize={ false }
|
|
17
|
+
variant="secondary"
|
|
18
|
+
ref={ ref }
|
|
19
|
+
>
|
|
15
20
|
{ children }
|
|
16
21
|
</Button>
|
|
17
22
|
);
|
|
@@ -44,6 +44,8 @@ export default function InserterSidebar() {
|
|
|
44
44
|
>
|
|
45
45
|
<TagName className="edit-widgets-layout__inserter-panel-header">
|
|
46
46
|
<Button
|
|
47
|
+
// TODO: Switch to `true` (40px size) if possible
|
|
48
|
+
__next40pxDefaultSize={ false }
|
|
47
49
|
icon={ close }
|
|
48
50
|
onClick={ closeInserter }
|
|
49
51
|
label={ __( 'Close block inserter' ) }
|
|
@@ -51,6 +51,8 @@ export default function ListViewSidebar() {
|
|
|
51
51
|
<div className="edit-widgets-editor__list-view-panel-header">
|
|
52
52
|
<strong>{ __( 'List View' ) }</strong>
|
|
53
53
|
<Button
|
|
54
|
+
// TODO: Switch to `true` (40px size) if possible
|
|
55
|
+
__next40pxDefaultSize={ false }
|
|
54
56
|
icon={ closeSmall }
|
|
55
57
|
label={ __( 'Close' ) }
|
|
56
58
|
onClick={ closeListView }
|
|
@@ -66,6 +66,8 @@ export default function WidgetAreas( { selectedWidgetAreaId } ) {
|
|
|
66
66
|
) }
|
|
67
67
|
{ ! selectedWidgetArea && (
|
|
68
68
|
<Button
|
|
69
|
+
// TODO: Switch to `true` (40px size) if possible
|
|
70
|
+
__next40pxDefaultSize={ false }
|
|
69
71
|
href={ addQueryArgs( 'customize.php', {
|
|
70
72
|
'autofocus[panel]': 'widgets',
|
|
71
73
|
return: window.location.pathname,
|