@wordpress/edit-widgets 6.7.1-next.1f6eadc42.0 → 6.8.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 +2 -4
- package/build/components/error-boundary/index.js.map +1 -1
- package/build/components/secondary-sidebar/inserter-sidebar.js +2 -4
- package/build/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +2 -4
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build/components/sidebar/widget-areas.js +2 -4
- package/build/components/sidebar/widget-areas.js.map +1 -1
- package/build-module/components/error-boundary/index.js +2 -4
- package/build-module/components/error-boundary/index.js.map +1 -1
- package/build-module/components/secondary-sidebar/inserter-sidebar.js +2 -4
- package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +2 -4
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build-module/components/sidebar/widget-areas.js +2 -4
- package/build-module/components/sidebar/widget-areas.js.map +1 -1
- package/build-style/style-rtl.css +1 -1
- package/build-style/style.css +1 -1
- package/package.json +28 -28
- package/src/components/error-boundary/index.js +1 -6
- package/src/components/secondary-sidebar/inserter-sidebar.js +1 -2
- package/src/components/secondary-sidebar/list-view-sidebar.js +1 -2
- package/src/components/sidebar/widget-areas.js +1 -2
package/CHANGELOG.md
CHANGED
|
@@ -20,10 +20,8 @@ function CopyButton({
|
|
|
20
20
|
children
|
|
21
21
|
}) {
|
|
22
22
|
const ref = (0, _compose.useCopyToClipboard)(text);
|
|
23
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button
|
|
24
|
-
|
|
25
|
-
, {
|
|
26
|
-
__next40pxDefaultSize: false,
|
|
23
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
24
|
+
__next40pxDefaultSize: true,
|
|
27
25
|
variant: "secondary",
|
|
28
26
|
ref: ref,
|
|
29
27
|
children: children
|
|
@@ -1 +1 @@
|
|
|
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
|
|
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 __next40pxDefaultSize variant=\"secondary\" ref={ ref }>\n\t\t\t{ children }\n\t\t</Button>\n\t);\n}\n\nfunction ErrorBoundaryWarning( { message, error } ) {\n\tconst actions = [\n\t\t<CopyButton key=\"copy-error\" text={ error.stack }>\n\t\t\t{ __( 'Copy Error' ) }\n\t\t</CopyButton>,\n\t];\n\n\treturn (\n\t\t<Warning className=\"edit-widgets-error-boundary\" actions={ actions }>\n\t\t\t{ message }\n\t\t</Warning>\n\t);\n}\n\nexport default class ErrorBoundary extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.state = {\n\t\t\terror: null,\n\t\t};\n\t}\n\n\tcomponentDidCatch( error ) {\n\t\tdoAction( 'editor.ErrorBoundary.errorLogged', error );\n\t}\n\n\tstatic getDerivedStateFromError( error ) {\n\t\treturn { error };\n\t}\n\n\trender() {\n\t\tif ( ! this.state.error ) {\n\t\t\treturn this.props.children;\n\t\t}\n\n\t\treturn (\n\t\t\t<ErrorBoundaryWarning\n\t\t\t\tmessage={ __(\n\t\t\t\t\t'The editor has encountered an unexpected error.'\n\t\t\t\t) }\n\t\t\t\terror={ this.state.error }\n\t\t\t/>\n\t\t);\n\t}\n}\n"],"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,EAACV,WAAA,CAAAW,MAAM;IAACC,qBAAqB;IAACC,OAAO,EAAC,WAAW;IAACL,GAAG,EAAGA,GAAK;IAAAD,QAAA,EAC1DA;EAAQ,CACH,CAAC;AAEX;AAEA,SAASO,oBAAoBA,CAAE;EAAEC,OAAO;EAAEC;AAAM,CAAC,EAAG;EACnD,MAAMC,OAAO,GAAG,cACf,IAAAb,WAAA,CAAAM,GAAA,EAACL,UAAU;IAAkBC,IAAI,EAAGU,KAAK,CAACE,KAAO;IAAAX,QAAA,EAC9C,IAAAY,QAAE,EAAE,YAAa;EAAC,GADL,YAEJ,CAAC,CACb;EAED,oBACC,IAAAf,WAAA,CAAAM,GAAA,EAACT,YAAA,CAAAmB,OAAO;IAACC,SAAS,EAAC,6BAA6B;IAACJ,OAAO,EAAGA,OAAS;IAAAV,QAAA,EACjEQ;EAAO,CACD,CAAC;AAEZ;AAEe,MAAMO,aAAa,SAASC,kBAAS,CAAC;EACpDC,WAAWA,CAAA,EAAG;IACb,KAAK,CAAE,GAAGC,SAAU,CAAC;IAErB,IAAI,CAACC,KAAK,GAAG;MACZV,KAAK,EAAE;IACR,CAAC;EACF;EAEAW,iBAAiBA,CAAEX,KAAK,EAAG;IAC1B,IAAAY,eAAQ,EAAE,kCAAkC,EAAEZ,KAAM,CAAC;EACtD;EAEA,OAAOa,wBAAwBA,CAAEb,KAAK,EAAG;IACxC,OAAO;MAAEA;IAAM,CAAC;EACjB;EAEAc,MAAMA,CAAA,EAAG;IACR,IAAK,CAAE,IAAI,CAACJ,KAAK,CAACV,KAAK,EAAG;MACzB,OAAO,IAAI,CAACe,KAAK,CAACxB,QAAQ;IAC3B;IAEA,oBACC,IAAAH,WAAA,CAAAM,GAAA,EAACI,oBAAoB;MACpBC,OAAO,EAAG,IAAAI,QAAE,EACX,iDACD,CAAG;MACHH,KAAK,EAAG,IAAI,CAACU,KAAK,CAACV;IAAO,CAC1B,CAAC;EAEJ;AACD;AAACgB,OAAA,CAAAC,OAAA,GAAAX,aAAA","ignoreList":[]}
|
|
@@ -47,10 +47,8 @@ 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
|
|
51
|
-
|
|
52
|
-
, {
|
|
53
|
-
__next40pxDefaultSize: false,
|
|
50
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
51
|
+
__next40pxDefaultSize: true,
|
|
54
52
|
icon: _icons.close,
|
|
55
53
|
onClick: closeInserter,
|
|
56
54
|
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","__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\
|
|
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__next40pxDefaultSize\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,I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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,10 +57,8 @@ 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
|
|
61
|
-
|
|
62
|
-
, {
|
|
63
|
-
__next40pxDefaultSize: false,
|
|
60
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
61
|
+
__next40pxDefaultSize: true,
|
|
64
62
|
icon: _icons.closeSmall,
|
|
65
63
|
label: (0, _i18n.__)('Close'),
|
|
66
64
|
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","__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\
|
|
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","__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__next40pxDefaultSize\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,eAAS,EAAEH,YAAiB,CAAE,CAAC;;EAExE;EACA;EACA,MAAM,CAAEI,eAAe,EAAEC,kBAAkB,CAAE,GAAG,IAAAC,iBAAQ,EAAE,IAAK,CAAC;EAEhE,MAAMC,eAAe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gD,sBAAQ;UAAC7B,eAAe,EAAGA;QAAiB,CAAE;MAAC,CAC5C,CAAC;IAAA,CACF;EAAC;AAER","ignoreList":[]}
|
|
@@ -52,10 +52,8 @@ 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
|
|
56
|
-
|
|
57
|
-
, {
|
|
58
|
-
__next40pxDefaultSize: false,
|
|
55
|
+
}), !selectedWidgetArea && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
56
|
+
__next40pxDefaultSize: true,
|
|
59
57
|
href: (0, _url.addQueryArgs)('customize.php', {
|
|
60
58
|
'autofocus[panel]': 'widgets',
|
|
61
59
|
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","__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\
|
|
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__next40pxDefaultSize\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,OAA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AC1B,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,MAAM;UACNC,qBAAqB;UACrBC,IAAI,EAAG,IAAAC,iBAAY,EAAE,eAAe,EAAE;YACrC,kBAAkB,EAAE,SAAS;YAC7BC,MAAM,EAAEC,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":[]}
|
|
@@ -13,10 +13,8 @@ function CopyButton({
|
|
|
13
13
|
children
|
|
14
14
|
}) {
|
|
15
15
|
const ref = useCopyToClipboard(text);
|
|
16
|
-
return /*#__PURE__*/_jsx(Button
|
|
17
|
-
|
|
18
|
-
, {
|
|
19
|
-
__next40pxDefaultSize: false,
|
|
16
|
+
return /*#__PURE__*/_jsx(Button, {
|
|
17
|
+
__next40pxDefaultSize: true,
|
|
20
18
|
variant: "secondary",
|
|
21
19
|
ref: ref,
|
|
22
20
|
children: children
|
|
@@ -1 +1 @@
|
|
|
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
|
|
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 __next40pxDefaultSize variant=\"secondary\" ref={ ref }>\n\t\t\t{ children }\n\t\t</Button>\n\t);\n}\n\nfunction ErrorBoundaryWarning( { message, error } ) {\n\tconst actions = [\n\t\t<CopyButton key=\"copy-error\" text={ error.stack }>\n\t\t\t{ __( 'Copy Error' ) }\n\t\t</CopyButton>,\n\t];\n\n\treturn (\n\t\t<Warning className=\"edit-widgets-error-boundary\" actions={ actions }>\n\t\t\t{ message }\n\t\t</Warning>\n\t);\n}\n\nexport default class ErrorBoundary extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.state = {\n\t\t\terror: null,\n\t\t};\n\t}\n\n\tcomponentDidCatch( error ) {\n\t\tdoAction( 'editor.ErrorBoundary.errorLogged', error );\n\t}\n\n\tstatic getDerivedStateFromError( error ) {\n\t\treturn { error };\n\t}\n\n\trender() {\n\t\tif ( ! this.state.error ) {\n\t\t\treturn this.props.children;\n\t\t}\n\n\t\treturn (\n\t\t\t<ErrorBoundaryWarning\n\t\t\t\tmessage={ __(\n\t\t\t\t\t'The editor has encountered an unexpected error.'\n\t\t\t\t) }\n\t\t\t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,OAAO;MAAEA;IAAM,CAAC;EACjB;EAEAU,MAAMA,CAAA,EAAG;IACR,IAAK,CAAE,IAAI,CAACH,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,10 +40,8 @@ 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
|
|
44
|
-
|
|
45
|
-
, {
|
|
46
|
-
__next40pxDefaultSize: false,
|
|
43
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
44
|
+
__next40pxDefaultSize: true,
|
|
47
45
|
icon: close,
|
|
48
46
|
onClick: closeInserter,
|
|
49
47
|
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","__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\
|
|
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","__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__next40pxDefaultSize\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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a,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,MAAM;QACNkC,qBAAqB;QACrBC,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,10 +51,8 @@ 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
|
|
55
|
-
|
|
56
|
-
, {
|
|
57
|
-
__next40pxDefaultSize: false,
|
|
54
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
55
|
+
__next40pxDefaultSize: true,
|
|
58
56
|
icon: closeSmall,
|
|
59
57
|
label: __('Close'),
|
|
60
58
|
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","__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\
|
|
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__next40pxDefaultSize\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;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DnB,IAAA,CAACf,QAAQ;UAACqB,eAAe,EAAGA;QAAiB,CAAE;MAAC,CAC5C,CAAC;IAAA,CACF;EAAC;AAER","ignoreList":[]}
|
|
@@ -46,10 +46,8 @@ 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
|
|
50
|
-
|
|
51
|
-
, {
|
|
52
|
-
__next40pxDefaultSize: false,
|
|
49
|
+
}), !selectedWidgetArea && /*#__PURE__*/_jsx(Button, {
|
|
50
|
+
__next40pxDefaultSize: true,
|
|
53
51
|
href: addQueryArgs('customize.php', {
|
|
54
52
|
'autofocus[panel]': 'widgets',
|
|
55
53
|
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","__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\
|
|
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__next40pxDefaultSize\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":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,SAAS,QAAQ,yBAAyB;AACnD,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,QAAQ,QAAQ,gBAAgB;;AAEzC;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA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AC7B0B,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":[]}
|
|
@@ -521,7 +521,7 @@ body.is-dragging-components-draggable .wp-block[data-type="core/widget-area"] .c
|
|
|
521
521
|
max-width: 780px;
|
|
522
522
|
padding: 20px;
|
|
523
523
|
margin-top: 60px;
|
|
524
|
-
box-shadow: 0
|
|
524
|
+
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08), 0 15px 27px rgba(0, 0, 0, 0.07), 0 30px 36px rgba(0, 0, 0, 0.04), 0 50px 43px rgba(0, 0, 0, 0.02);
|
|
525
525
|
}
|
|
526
526
|
|
|
527
527
|
.edit-widgets-header {
|
package/build-style/style.css
CHANGED
|
@@ -521,7 +521,7 @@ body.is-dragging-components-draggable .wp-block[data-type="core/widget-area"] .c
|
|
|
521
521
|
max-width: 780px;
|
|
522
522
|
padding: 20px;
|
|
523
523
|
margin-top: 60px;
|
|
524
|
-
box-shadow: 0
|
|
524
|
+
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08), 0 15px 27px rgba(0, 0, 0, 0.07), 0 30px 36px rgba(0, 0, 0, 0.04), 0 50px 43px rgba(0, 0, 0, 0.02);
|
|
525
525
|
}
|
|
526
526
|
|
|
527
527
|
.edit-widgets-header {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/edit-widgets",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.8.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.8.
|
|
36
|
-
"@wordpress/compose": "^7.8.
|
|
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.8.
|
|
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.8.0",
|
|
32
|
+
"@wordpress/block-editor": "^14.3.0",
|
|
33
|
+
"@wordpress/block-library": "^9.8.0",
|
|
34
|
+
"@wordpress/blocks": "^13.8.0",
|
|
35
|
+
"@wordpress/components": "^28.8.0",
|
|
36
|
+
"@wordpress/compose": "^7.8.0",
|
|
37
|
+
"@wordpress/core-data": "^7.8.0",
|
|
38
|
+
"@wordpress/data": "^10.8.0",
|
|
39
|
+
"@wordpress/deprecated": "^4.8.0",
|
|
40
|
+
"@wordpress/dom": "^4.8.0",
|
|
41
|
+
"@wordpress/element": "^6.8.0",
|
|
42
|
+
"@wordpress/hooks": "^4.8.0",
|
|
43
|
+
"@wordpress/i18n": "^5.8.0",
|
|
44
|
+
"@wordpress/icons": "^10.8.0",
|
|
45
|
+
"@wordpress/interface": "^6.8.0",
|
|
46
|
+
"@wordpress/keyboard-shortcuts": "^5.8.0",
|
|
47
|
+
"@wordpress/keycodes": "^4.8.0",
|
|
48
|
+
"@wordpress/media-utils": "^5.8.0",
|
|
49
|
+
"@wordpress/notices": "^5.8.0",
|
|
50
|
+
"@wordpress/patterns": "^2.8.0",
|
|
51
|
+
"@wordpress/plugins": "^7.8.0",
|
|
52
|
+
"@wordpress/preferences": "^4.8.0",
|
|
53
|
+
"@wordpress/private-apis": "^1.8.0",
|
|
54
|
+
"@wordpress/reusable-blocks": "^5.8.0",
|
|
55
|
+
"@wordpress/url": "^4.8.0",
|
|
56
|
+
"@wordpress/widgets": "^4.8.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": "cecf5e14d317aa67407f77a7e5c8b6a43016bd42"
|
|
67
67
|
}
|
|
@@ -11,12 +11,7 @@ import { doAction } from '@wordpress/hooks';
|
|
|
11
11
|
function CopyButton( { text, children } ) {
|
|
12
12
|
const ref = useCopyToClipboard( text );
|
|
13
13
|
return (
|
|
14
|
-
<Button
|
|
15
|
-
// TODO: Switch to `true` (40px size) if possible
|
|
16
|
-
__next40pxDefaultSize={ false }
|
|
17
|
-
variant="secondary"
|
|
18
|
-
ref={ ref }
|
|
19
|
-
>
|
|
14
|
+
<Button __next40pxDefaultSize variant="secondary" ref={ ref }>
|
|
20
15
|
{ children }
|
|
21
16
|
</Button>
|
|
22
17
|
);
|
|
@@ -44,8 +44,7 @@ export default function InserterSidebar() {
|
|
|
44
44
|
>
|
|
45
45
|
<TagName className="edit-widgets-layout__inserter-panel-header">
|
|
46
46
|
<Button
|
|
47
|
-
|
|
48
|
-
__next40pxDefaultSize={ false }
|
|
47
|
+
__next40pxDefaultSize
|
|
49
48
|
icon={ close }
|
|
50
49
|
onClick={ closeInserter }
|
|
51
50
|
label={ __( 'Close block inserter' ) }
|
|
@@ -51,8 +51,7 @@ 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
|
-
|
|
55
|
-
__next40pxDefaultSize={ false }
|
|
54
|
+
__next40pxDefaultSize
|
|
56
55
|
icon={ closeSmall }
|
|
57
56
|
label={ __( 'Close' ) }
|
|
58
57
|
onClick={ closeListView }
|
|
@@ -66,8 +66,7 @@ export default function WidgetAreas( { selectedWidgetAreaId } ) {
|
|
|
66
66
|
) }
|
|
67
67
|
{ ! selectedWidgetArea && (
|
|
68
68
|
<Button
|
|
69
|
-
|
|
70
|
-
__next40pxDefaultSize={ false }
|
|
69
|
+
__next40pxDefaultSize
|
|
71
70
|
href={ addQueryArgs( 'customize.php', {
|
|
72
71
|
'autofocus[panel]': 'widgets',
|
|
73
72
|
return: window.location.pathname,
|