@wordpress/edit-widgets 6.9.0 → 6.10.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/blocks/widget-area/edit/index.js.map +1 -1
- package/build/components/header/document-tools/index.js +1 -1
- package/build/components/header/document-tools/index.js.map +1 -1
- package/build/components/layout/index.js +15 -8
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/interface.js +3 -12
- package/build/components/layout/interface.js.map +1 -1
- package/build/components/secondary-sidebar/inserter-sidebar.js +1 -1
- package/build/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build/index.js +7 -1
- package/build/index.js.map +1 -1
- package/build/store/actions.js +2 -2
- package/build/store/actions.js.map +1 -1
- package/build/store/selectors.js.map +1 -1
- package/build/store/utils.js.map +1 -1
- package/build-module/blocks/widget-area/edit/index.js.map +1 -1
- package/build-module/components/header/document-tools/index.js +2 -4
- package/build-module/components/header/document-tools/index.js.map +1 -1
- package/build-module/components/header/index.js +1 -3
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +1 -2
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +1 -3
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build-module/components/layout/index.js +16 -10
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/interface.js +4 -14
- package/build-module/components/layout/interface.js.map +1 -1
- package/build-module/components/more-menu/index.js +1 -3
- package/build-module/components/more-menu/index.js.map +1 -1
- package/build-module/components/notices/index.js +1 -3
- package/build-module/components/notices/index.js.map +1 -1
- package/build-module/components/secondary-sidebar/inserter-sidebar.js +2 -3
- package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +1 -2
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build-module/components/sidebar/index.js +1 -2
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar/widget-areas.js +1 -2
- package/build-module/components/sidebar/widget-areas.js.map +1 -1
- package/build-module/components/welcome-guide/index.js +1 -3
- package/build-module/components/welcome-guide/index.js.map +1 -1
- package/build-module/components/widget-areas-block-editor-content/index.js +1 -2
- package/build-module/components/widget-areas-block-editor-content/index.js.map +1 -1
- package/build-module/components/widget-areas-block-editor-provider/index.js +1 -2
- package/build-module/components/widget-areas-block-editor-provider/index.js.map +1 -1
- package/build-module/filters/move-to-widget-area.js +1 -3
- package/build-module/filters/move-to-widget-area.js.map +1 -1
- package/build-module/index.js +7 -1
- package/build-module/index.js.map +1 -1
- package/build-module/store/actions.js +2 -2
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/utils.js.map +1 -1
- package/package.json +30 -29
- package/src/components/header/document-tools/index.js +1 -1
- package/src/components/layout/index.js +17 -8
- package/src/components/layout/interface.js +0 -15
- package/src/components/secondary-sidebar/inserter-sidebar.js +1 -1
- package/src/index.js +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_data","_coreData","_components","_innerBlocks","_interopRequireDefault","_store","_useIsDraggingWithin","_jsxRuntime","WidgetAreaEdit","clientId","className","attributes","id","name","isOpen","useSelect","select","editWidgetsStore","getIsWidgetAreaOpen","setIsWidgetAreaOpen","useDispatch","wrapper","useRef","setOpen","useCallback","openState","isDragging","useIsDragging","isDraggingWithin","useIsDraggingWithin","openedWhileDragging","setOpenedWhileDragging","useState","useEffect","jsx","Panel","ref","children","PanelBody","title","opened","onToggle","scrollAfterOpen","__unstableDisclosureContent","visible","EntityProvider","kind","type","default","elementRef","setIsDragging","ownerDocument","current","handleDragStart","handleDragEnd","addEventListener","removeEventListener"],"sources":["@wordpress/edit-widgets/src/blocks/widget-area/edit/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useState, useCallback, useRef } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { EntityProvider } from '@wordpress/core-data';\nimport {\n\t__unstableDisclosureContent as DisclosureContent,\n\tPanel,\n\tPanelBody,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport WidgetAreaInnerBlocks from './inner-blocks';\nimport { store as editWidgetsStore } from '../../../store';\nimport useIsDraggingWithin from './use-is-dragging-within';\n\n/** @typedef {import('@wordpress/element').RefObject} RefObject */\n\nexport default function WidgetAreaEdit( {\n\tclientId,\n\tclassName,\n\tattributes: { id, name },\n} ) {\n\tconst isOpen = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editWidgetsStore ).getIsWidgetAreaOpen( clientId ),\n\t\t[ clientId ]\n\t);\n\tconst { setIsWidgetAreaOpen } = useDispatch( editWidgetsStore );\n\n\tconst wrapper = useRef();\n\tconst setOpen = useCallback(\n\t\t( openState ) => setIsWidgetAreaOpen( clientId, openState ),\n\t\t[ clientId ]\n\t);\n\tconst isDragging = useIsDragging( wrapper );\n\tconst isDraggingWithin = useIsDraggingWithin( wrapper );\n\n\tconst [ openedWhileDragging, setOpenedWhileDragging ] = useState( false );\n\tuseEffect( () => {\n\t\tif ( ! isDragging ) {\n\t\t\tsetOpenedWhileDragging( false );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isDraggingWithin && ! isOpen ) {\n\t\t\tsetOpen( true );\n\t\t\tsetOpenedWhileDragging( true );\n\t\t} else if ( ! isDraggingWithin && isOpen && openedWhileDragging ) {\n\t\t\tsetOpen( false );\n\t\t}\n\t}, [ isOpen, isDragging, isDraggingWithin, openedWhileDragging ] );\n\n\treturn (\n\t\t<Panel className={ className } ref={ wrapper }>\n\t\t\t<PanelBody\n\t\t\t\ttitle={ name }\n\t\t\t\topened={ isOpen }\n\t\t\t\tonToggle={ () => {\n\t\t\t\t\tsetIsWidgetAreaOpen( clientId, ! isOpen );\n\t\t\t\t} }\n\t\t\t\tscrollAfterOpen={ ! isDragging }\n\t\t\t>\n\t\t\t\t{ ( { opened } ) => (\n\t\t\t\t\t// This is required to ensure LegacyWidget blocks are not\n\t\t\t\t\t// unmounted when the panel is collapsed. Unmounting legacy\n\t\t\t\t\t// widgets may have unintended consequences (e.g. TinyMCE\n\t\t\t\t\t// not being properly reinitialized)\n\t\t\t\t\t<DisclosureContent\n\t\t\t\t\t\tclassName=\"wp-block-widget-area__panel-body-content\"\n\t\t\t\t\t\tvisible={ opened }\n\t\t\t\t\t>\n\t\t\t\t\t\t<EntityProvider\n\t\t\t\t\t\t\tkind=\"root\"\n\t\t\t\t\t\t\ttype=\"postType\"\n\t\t\t\t\t\t\tid={ `widget-area-${ id }` }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<WidgetAreaInnerBlocks id={ id } />\n\t\t\t\t\t\t</EntityProvider>\n\t\t\t\t\t</DisclosureContent>\n\t\t\t\t) }\n\t\t\t</PanelBody>\n\t\t</Panel>\n\t);\n}\n\n/**\n * A React hook to determine if dragging is active.\n *\n * @param {RefObject<HTMLElement>} elementRef The target elementRef object.\n *\n * @return {boolean} Is dragging within the entire document.\n */\nconst useIsDragging = ( elementRef ) => {\n\tconst [ isDragging, setIsDragging ] = useState( false );\n\n\tuseEffect( () => {\n\t\tconst { ownerDocument } = elementRef.current;\n\n\t\tfunction handleDragStart() {\n\t\t\tsetIsDragging( true );\n\t\t}\n\n\t\tfunction handleDragEnd() {\n\t\t\tsetIsDragging( false );\n\t\t}\n\n\t\townerDocument.addEventListener( 'dragstart', handleDragStart );\n\t\townerDocument.addEventListener( 'dragend', handleDragEnd );\n\n\t\treturn () => {\n\t\t\townerDocument.removeEventListener( 'dragstart', handleDragStart );\n\t\t\townerDocument.removeEventListener( 'dragend', handleDragEnd );\n\t\t};\n\t}, [] );\n\n\treturn isDragging;\n};\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD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AC,MAAM,IAAK,CAAEH,gBAAgB,IAAId,MAAM,IAAIgB,mBAAmB,EAAG;MACjEP,OAAO,CAAE,KAAM,CAAC;IACjB;EACD,CAAC,EAAE,CAAET,MAAM,EAAEY,UAAU,EAAEE,gBAAgB,EAAEE,mBAAmB,CAAG,CAAC;EAElE,oBACC,IAAAvB,WAAA,CAAA2B,GAAA,EAAChC,WAAA,CAAAiC,KAAK;IAACzB,SAAS,EAAGA,SAAW;IAAC0B,GAAG,EAAGf,OAAS;IAAAgB,QAAA,eAC7C,IAAA9B,WAAA,CAAA2B,GAAA,EAAChC,WAAA,CAAAoC,SAAS;MACTC,KAAK,EAAG1B,IAAM;MACd2B,MAAM,EAAG1B,MAAQ;MACjB2B,QAAQ,EAAGA,CAAA,KAAM;QAChBtB,mBAAmB,CAAEV,QAAQ,EAAE,CAAEK,MAAO,CAAC;MAC1C,CAAG;MACH4B,eAAe,EAAG,CAAEhB,UAAY;MAAAW,QAAA,EAE9BA,CAAE;QAAEG;MAAO,CAAC;MAAA;MACb;MACA;MACA;MACA;MACA,IAAAjC,WAAA,CAAA2B,GAAA,EAAChC,WAAA,CAAAyC,2BAAiB;QACjBjC,SAAS,EAAC,0CAA0C;QACpDkC,OAAO,EAAGJ,MAAQ;QAAAH,QAAA,eAElB,IAAA9B,WAAA,CAAA2B,GAAA,EAACjC,SAAA,CAAA4C,cAAc;UACdC,IAAI,EAAC,MAAM;UACXC,IAAI,EAAC,UAAU;UACfnC,EAAE,
|
|
1
|
+
{"version":3,"names":["_element","require","_data","_coreData","_components","_innerBlocks","_interopRequireDefault","_store","_useIsDraggingWithin","_jsxRuntime","WidgetAreaEdit","clientId","className","attributes","id","name","isOpen","useSelect","select","editWidgetsStore","getIsWidgetAreaOpen","setIsWidgetAreaOpen","useDispatch","wrapper","useRef","setOpen","useCallback","openState","isDragging","useIsDragging","isDraggingWithin","useIsDraggingWithin","openedWhileDragging","setOpenedWhileDragging","useState","useEffect","jsx","Panel","ref","children","PanelBody","title","opened","onToggle","scrollAfterOpen","__unstableDisclosureContent","visible","EntityProvider","kind","type","default","elementRef","setIsDragging","ownerDocument","current","handleDragStart","handleDragEnd","addEventListener","removeEventListener"],"sources":["@wordpress/edit-widgets/src/blocks/widget-area/edit/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useState, useCallback, useRef } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { EntityProvider } from '@wordpress/core-data';\nimport {\n\t__unstableDisclosureContent as DisclosureContent,\n\tPanel,\n\tPanelBody,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport WidgetAreaInnerBlocks from './inner-blocks';\nimport { store as editWidgetsStore } from '../../../store';\nimport useIsDraggingWithin from './use-is-dragging-within';\n\n/** @typedef {import('@wordpress/element').RefObject} RefObject */\n\nexport default function WidgetAreaEdit( {\n\tclientId,\n\tclassName,\n\tattributes: { id, name },\n} ) {\n\tconst isOpen = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editWidgetsStore ).getIsWidgetAreaOpen( clientId ),\n\t\t[ clientId ]\n\t);\n\tconst { setIsWidgetAreaOpen } = useDispatch( editWidgetsStore );\n\n\tconst wrapper = useRef();\n\tconst setOpen = useCallback(\n\t\t( openState ) => setIsWidgetAreaOpen( clientId, openState ),\n\t\t[ clientId ]\n\t);\n\tconst isDragging = useIsDragging( wrapper );\n\tconst isDraggingWithin = useIsDraggingWithin( wrapper );\n\n\tconst [ openedWhileDragging, setOpenedWhileDragging ] = useState( false );\n\tuseEffect( () => {\n\t\tif ( ! isDragging ) {\n\t\t\tsetOpenedWhileDragging( false );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isDraggingWithin && ! isOpen ) {\n\t\t\tsetOpen( true );\n\t\t\tsetOpenedWhileDragging( true );\n\t\t} else if ( ! isDraggingWithin && isOpen && openedWhileDragging ) {\n\t\t\tsetOpen( false );\n\t\t}\n\t}, [ isOpen, isDragging, isDraggingWithin, openedWhileDragging ] );\n\n\treturn (\n\t\t<Panel className={ className } ref={ wrapper }>\n\t\t\t<PanelBody\n\t\t\t\ttitle={ name }\n\t\t\t\topened={ isOpen }\n\t\t\t\tonToggle={ () => {\n\t\t\t\t\tsetIsWidgetAreaOpen( clientId, ! isOpen );\n\t\t\t\t} }\n\t\t\t\tscrollAfterOpen={ ! isDragging }\n\t\t\t>\n\t\t\t\t{ ( { opened } ) => (\n\t\t\t\t\t// This is required to ensure LegacyWidget blocks are not\n\t\t\t\t\t// unmounted when the panel is collapsed. Unmounting legacy\n\t\t\t\t\t// widgets may have unintended consequences (e.g. TinyMCE\n\t\t\t\t\t// not being properly reinitialized)\n\t\t\t\t\t<DisclosureContent\n\t\t\t\t\t\tclassName=\"wp-block-widget-area__panel-body-content\"\n\t\t\t\t\t\tvisible={ opened }\n\t\t\t\t\t>\n\t\t\t\t\t\t<EntityProvider\n\t\t\t\t\t\t\tkind=\"root\"\n\t\t\t\t\t\t\ttype=\"postType\"\n\t\t\t\t\t\t\tid={ `widget-area-${ id }` }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<WidgetAreaInnerBlocks id={ id } />\n\t\t\t\t\t\t</EntityProvider>\n\t\t\t\t\t</DisclosureContent>\n\t\t\t\t) }\n\t\t\t</PanelBody>\n\t\t</Panel>\n\t);\n}\n\n/**\n * A React hook to determine if dragging is active.\n *\n * @param {RefObject<HTMLElement>} elementRef The target elementRef object.\n *\n * @return {boolean} Is dragging within the entire document.\n */\nconst useIsDragging = ( elementRef ) => {\n\tconst [ isDragging, setIsDragging ] = useState( false );\n\n\tuseEffect( () => {\n\t\tconst { ownerDocument } = elementRef.current;\n\n\t\tfunction handleDragStart() {\n\t\t\tsetIsDragging( true );\n\t\t}\n\n\t\tfunction handleDragEnd() {\n\t\t\tsetIsDragging( false );\n\t\t}\n\n\t\townerDocument.addEventListener( 'dragstart', handleDragStart );\n\t\townerDocument.addEventListener( 'dragend', handleDragEnd );\n\n\t\treturn () => {\n\t\t\townerDocument.removeEventListener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C,CACpB;MAAC,CACC;IACnB,CACS;EAAC,CACN,CAAC;AAEV;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMe,aAAa,GAAKsB,UAAU,IAAM;EACvC,MAAM,CAAEvB,UAAU,EAAEwB,aAAa,CAAE,GAAG,IAAAlB,iBAAQ,EAAE,KAAM,CAAC;EAEvD,IAAAC,kBAAS,EAAE,MAAM;IAChB,MAAM;MAAEkB;IAAc,CAAC,GAAGF,UAAU,CAACG,OAAO;IAE5C,SAASC,eAAeA,CAAA,EAAG;MAC1BH,aAAa,CAAE,IAAK,CAAC;IACtB;IAEA,SAASI,aAAaA,CAAA,EAAG;MACxBJ,aAAa,CAAE,KAAM,CAAC;IACvB;IAEAC,aAAa,CAACI,gBAAgB,CAAE,WAAW,EAAEF,eAAgB,CAAC;IAC9DF,aAAa,CAACI,gBAAgB,CAAE,SAAS,EAAED,aAAc,CAAC;IAE1D,OAAO,MAAM;MACZH,aAAa,CAACK,mBAAmB,CAAE,WAAW,EAAEH,eAAgB,CAAC;MACjEF,aAAa,CAACK,mBAAmB,CAAE,SAAS,EAAEF,aAAc,CAAC;IAC9D,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,OAAO5B,UAAU;AAClB,CAAC","ignoreList":[]}
|
|
@@ -69,7 +69,7 @@ function DocumentTools() {
|
|
|
69
69
|
icon: _icons.plus
|
|
70
70
|
/* translators: button label text should, if possible, be under 16
|
|
71
71
|
characters. */,
|
|
72
|
-
label: (0, _i18n._x)('
|
|
72
|
+
label: (0, _i18n._x)('Block Inserter', 'Generic label for block inserter button'),
|
|
73
73
|
size: "compact"
|
|
74
74
|
}), isMediumViewport && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
75
75
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarItem, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_i18n","_components","_blockEditor","_icons","_element","_compose","_undo","_interopRequireDefault","_redo","_store","_lockUnlock","_jsxRuntime","DocumentTools","isMediumViewport","useViewportMatch","isInserterOpen","isListViewOpen","inserterSidebarToggleRef","listViewToggleRef","useSelect","select","isInserterOpened","getInserterSidebarToggleRef","isListViewOpened","getListViewToggleRef","unlock","editWidgetsStore","setIsInserterOpened","setIsListViewOpened","useDispatch","toggleListView","useCallback","toggleInserterSidebar","jsxs","NavigableToolbar","className","__","variant","children","jsx","ToolbarItem","ref","as","Button","isPressed","onMouseDown","event","preventDefault","onClick","icon","plus","label","_x","size","Fragment","UndoButton","RedoButton","listView","_default","exports","default"],"sources":["@wordpress/edit-widgets/src/components/header/document-tools/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport { Button, ToolbarItem } from '@wordpress/components';\nimport { NavigableToolbar } from '@wordpress/block-editor';\nimport { listView, plus } from '@wordpress/icons';\nimport { useCallback } from '@wordpress/element';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport UndoButton from '../undo-redo/undo';\nimport RedoButton from '../undo-redo/redo';\nimport { store as editWidgetsStore } from '../../../store';\nimport { unlock } from '../../../lock-unlock';\n\nfunction DocumentTools() {\n\tconst isMediumViewport = useViewportMatch( 'medium' );\n\n\tconst {\n\t\tisInserterOpen,\n\t\tisListViewOpen,\n\t\tinserterSidebarToggleRef,\n\t\tlistViewToggleRef,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tisInserterOpened,\n\t\t\tgetInserterSidebarToggleRef,\n\t\t\tisListViewOpened,\n\t\t\tgetListViewToggleRef,\n\t\t} = unlock( select( editWidgetsStore ) );\n\t\treturn {\n\t\t\tisInserterOpen: isInserterOpened(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tinserterSidebarToggleRef: getInserterSidebarToggleRef(),\n\t\t\tlistViewToggleRef: getListViewToggleRef(),\n\t\t};\n\t}, [] );\n\tconst { setIsInserterOpened, setIsListViewOpened } =\n\t\tuseDispatch( editWidgetsStore );\n\n\tconst toggleListView = useCallback(\n\t\t() => setIsListViewOpened( ! isListViewOpen ),\n\t\t[ setIsListViewOpened, isListViewOpen ]\n\t);\n\n\tconst toggleInserterSidebar = useCallback(\n\t\t() => setIsInserterOpened( ! isInserterOpen ),\n\t\t[ setIsInserterOpened, isInserterOpen ]\n\t);\n\n\treturn (\n\t\t<NavigableToolbar\n\t\t\tclassName=\"edit-widgets-header-toolbar\"\n\t\t\taria-label={ __( 'Document tools' ) }\n\t\t\tvariant=\"unstyled\"\n\t\t>\n\t\t\t<ToolbarItem\n\t\t\t\tref={ inserterSidebarToggleRef }\n\t\t\t\tas={ Button }\n\t\t\t\tclassName=\"edit-widgets-header-toolbar__inserter-toggle\"\n\t\t\t\tvariant=\"primary\"\n\t\t\t\tisPressed={ isInserterOpen }\n\t\t\t\tonMouseDown={ ( event ) => {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t} }\n\t\t\t\tonClick={ toggleInserterSidebar }\n\t\t\t\ticon={ plus }\n\t\t\t\t/* translators: button label text should, if possible, be under 16\n\t\t\t\t\tcharacters. */\n\t\t\t\tlabel={ _x(\n\t\t\t\t\t'
|
|
1
|
+
{"version":3,"names":["_data","require","_i18n","_components","_blockEditor","_icons","_element","_compose","_undo","_interopRequireDefault","_redo","_store","_lockUnlock","_jsxRuntime","DocumentTools","isMediumViewport","useViewportMatch","isInserterOpen","isListViewOpen","inserterSidebarToggleRef","listViewToggleRef","useSelect","select","isInserterOpened","getInserterSidebarToggleRef","isListViewOpened","getListViewToggleRef","unlock","editWidgetsStore","setIsInserterOpened","setIsListViewOpened","useDispatch","toggleListView","useCallback","toggleInserterSidebar","jsxs","NavigableToolbar","className","__","variant","children","jsx","ToolbarItem","ref","as","Button","isPressed","onMouseDown","event","preventDefault","onClick","icon","plus","label","_x","size","Fragment","UndoButton","RedoButton","listView","_default","exports","default"],"sources":["@wordpress/edit-widgets/src/components/header/document-tools/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport { Button, ToolbarItem } from '@wordpress/components';\nimport { NavigableToolbar } from '@wordpress/block-editor';\nimport { listView, plus } from '@wordpress/icons';\nimport { useCallback } from '@wordpress/element';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport UndoButton from '../undo-redo/undo';\nimport RedoButton from '../undo-redo/redo';\nimport { store as editWidgetsStore } from '../../../store';\nimport { unlock } from '../../../lock-unlock';\n\nfunction DocumentTools() {\n\tconst isMediumViewport = useViewportMatch( 'medium' );\n\n\tconst {\n\t\tisInserterOpen,\n\t\tisListViewOpen,\n\t\tinserterSidebarToggleRef,\n\t\tlistViewToggleRef,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tisInserterOpened,\n\t\t\tgetInserterSidebarToggleRef,\n\t\t\tisListViewOpened,\n\t\t\tgetListViewToggleRef,\n\t\t} = unlock( select( editWidgetsStore ) );\n\t\treturn {\n\t\t\tisInserterOpen: isInserterOpened(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tinserterSidebarToggleRef: getInserterSidebarToggleRef(),\n\t\t\tlistViewToggleRef: getListViewToggleRef(),\n\t\t};\n\t}, [] );\n\tconst { setIsInserterOpened, setIsListViewOpened } =\n\t\tuseDispatch( editWidgetsStore );\n\n\tconst toggleListView = useCallback(\n\t\t() => setIsListViewOpened( ! isListViewOpen ),\n\t\t[ setIsListViewOpened, isListViewOpen ]\n\t);\n\n\tconst toggleInserterSidebar = useCallback(\n\t\t() => setIsInserterOpened( ! isInserterOpen ),\n\t\t[ setIsInserterOpened, isInserterOpen ]\n\t);\n\n\treturn (\n\t\t<NavigableToolbar\n\t\t\tclassName=\"edit-widgets-header-toolbar\"\n\t\t\taria-label={ __( 'Document tools' ) }\n\t\t\tvariant=\"unstyled\"\n\t\t>\n\t\t\t<ToolbarItem\n\t\t\t\tref={ inserterSidebarToggleRef }\n\t\t\t\tas={ Button }\n\t\t\t\tclassName=\"edit-widgets-header-toolbar__inserter-toggle\"\n\t\t\t\tvariant=\"primary\"\n\t\t\t\tisPressed={ isInserterOpen }\n\t\t\t\tonMouseDown={ ( event ) => {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t} }\n\t\t\t\tonClick={ toggleInserterSidebar }\n\t\t\t\ticon={ plus }\n\t\t\t\t/* translators: button label text should, if possible, be under 16\n\t\t\t\t\tcharacters. */\n\t\t\t\tlabel={ _x(\n\t\t\t\t\t'Block Inserter',\n\t\t\t\t\t'Generic label for block inserter button'\n\t\t\t\t) }\n\t\t\t\tsize=\"compact\"\n\t\t\t/>\n\t\t\t{ isMediumViewport && (\n\t\t\t\t<>\n\t\t\t\t\t<ToolbarItem as={ UndoButton } />\n\t\t\t\t\t<ToolbarItem as={ RedoButton } />\n\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\tas={ Button }\n\t\t\t\t\t\tclassName=\"edit-widgets-header-toolbar__list-view-toggle\"\n\t\t\t\t\t\ticon={ listView }\n\t\t\t\t\t\tisPressed={ isListViewOpen }\n\t\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\t\tlabel={ __( 'List View' ) }\n\t\t\t\t\t\tonClick={ toggleListView }\n\t\t\t\t\t\tref={ listViewToggleRef }\n\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t) }\n\t\t</NavigableToolbar>\n\t);\n}\n\nexport default DocumentTools;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA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,OAAA,CAAAC,OAAA,GAEchD,aAAa","ignoreList":[]}
|
|
@@ -9,6 +9,7 @@ var _i18n = require("@wordpress/i18n");
|
|
|
9
9
|
var _data = require("@wordpress/data");
|
|
10
10
|
var _plugins = require("@wordpress/plugins");
|
|
11
11
|
var _notices = require("@wordpress/notices");
|
|
12
|
+
var _components = require("@wordpress/components");
|
|
12
13
|
var _errorBoundary = _interopRequireDefault(require("../error-boundary"));
|
|
13
14
|
var _widgetAreasBlockEditorProvider = _interopRequireDefault(require("../widget-areas-block-editor-provider"));
|
|
14
15
|
var _sidebar = _interopRequireDefault(require("../sidebar"));
|
|
@@ -31,17 +32,23 @@ function Layout({
|
|
|
31
32
|
createErrorNotice
|
|
32
33
|
} = (0, _data.useDispatch)(_notices.store);
|
|
33
34
|
function onPluginAreaError(name) {
|
|
34
|
-
createErrorNotice((0, _i18n.sprintf)(
|
|
35
|
+
createErrorNotice((0, _i18n.sprintf)(/* translators: %s: plugin name */
|
|
35
36
|
(0, _i18n.__)('The "%s" plugin has encountered an error and cannot be rendered.'), name));
|
|
36
37
|
}
|
|
38
|
+
const navigateRegionsProps = (0, _components.__unstableUseNavigateRegions)();
|
|
37
39
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_errorBoundary.default, {
|
|
38
|
-
children: /*#__PURE__*/(0, _jsxRuntime.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
41
|
+
className: navigateRegionsProps.className,
|
|
42
|
+
...navigateRegionsProps,
|
|
43
|
+
ref: navigateRegionsProps.ref,
|
|
44
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_widgetAreasBlockEditorProvider.default, {
|
|
45
|
+
blockEditorSettings: blockEditorSettings,
|
|
46
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_interface.default, {
|
|
47
|
+
blockEditorSettings: blockEditorSettings
|
|
48
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebar.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_plugins.PluginArea, {
|
|
49
|
+
onError: onPluginAreaError
|
|
50
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_unsavedChangesWarning.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_welcomeGuide.default, {})]
|
|
51
|
+
})
|
|
45
52
|
})
|
|
46
53
|
});
|
|
47
54
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_data","_plugins","_notices","_errorBoundary","_interopRequireDefault","_widgetAreasBlockEditorProvider","_sidebar","_interface","_unsavedChangesWarning","_welcomeGuide","_jsxRuntime","Layout","blockEditorSettings","createErrorNotice","useDispatch","noticesStore","onPluginAreaError","name","sprintf","__","jsx","default","children","jsxs","PluginArea","onError","_default","exports"],"sources":["@wordpress/edit-widgets/src/components/layout/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport { PluginArea } from '@wordpress/plugins';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport ErrorBoundary from '../error-boundary';\nimport WidgetAreasBlockEditorProvider from '../widget-areas-block-editor-provider';\nimport Sidebar from '../sidebar';\nimport Interface from './interface';\nimport UnsavedChangesWarning from './unsaved-changes-warning';\nimport WelcomeGuide from '../welcome-guide';\n\nfunction Layout( { blockEditorSettings } ) {\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\n\tfunction onPluginAreaError( name ) {\n\t\tcreateErrorNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: plugin name */\n\t\t\t\t__(\n\t\t\t\t\t'The \"%s\" plugin has encountered an error and cannot be rendered.'\n\t\t\t\t),\n\t\t\t\tname\n\t\t\t)\n\t\t);\n\t}\n\n\treturn (\n\t\t<ErrorBoundary>\n\t\t\t<WidgetAreasBlockEditorProvider\n\t\t\t\tblockEditorSettings={ blockEditorSettings }\n\t\t\t>\n\t\t\t\t<Interface blockEditorSettings={ blockEditorSettings } />\n\t\t\t\t<Sidebar />\n\t\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t\t\t<UnsavedChangesWarning />\n\t\t\t\t<WelcomeGuide />\n\t\t\t</WidgetAreasBlockEditorProvider>\n\t\t</ErrorBoundary>\n\t);\n}\n\nexport default Layout;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;
|
|
1
|
+
{"version":3,"names":["_i18n","require","_data","_plugins","_notices","_components","_errorBoundary","_interopRequireDefault","_widgetAreasBlockEditorProvider","_sidebar","_interface","_unsavedChangesWarning","_welcomeGuide","_jsxRuntime","Layout","blockEditorSettings","createErrorNotice","useDispatch","noticesStore","onPluginAreaError","name","sprintf","__","navigateRegionsProps","useNavigateRegions","jsx","default","children","className","ref","jsxs","PluginArea","onError","_default","exports"],"sources":["@wordpress/edit-widgets/src/components/layout/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport { PluginArea } from '@wordpress/plugins';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { __unstableUseNavigateRegions as useNavigateRegions } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport ErrorBoundary from '../error-boundary';\nimport WidgetAreasBlockEditorProvider from '../widget-areas-block-editor-provider';\nimport Sidebar from '../sidebar';\nimport Interface from './interface';\nimport UnsavedChangesWarning from './unsaved-changes-warning';\nimport WelcomeGuide from '../welcome-guide';\n\nfunction Layout( { blockEditorSettings } ) {\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\n\tfunction onPluginAreaError( name ) {\n\t\tcreateErrorNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: plugin name */\n\t\t\t\t__(\n\t\t\t\t\t'The \"%s\" plugin has encountered an error and cannot be rendered.'\n\t\t\t\t),\n\t\t\t\tname\n\t\t\t)\n\t\t);\n\t}\n\n\tconst navigateRegionsProps = useNavigateRegions();\n\n\treturn (\n\t\t<ErrorBoundary>\n\t\t\t<div\n\t\t\t\tclassName={ navigateRegionsProps.className }\n\t\t\t\t{ ...navigateRegionsProps }\n\t\t\t\tref={ navigateRegionsProps.ref }\n\t\t\t>\n\t\t\t\t<WidgetAreasBlockEditorProvider\n\t\t\t\t\tblockEditorSettings={ blockEditorSettings }\n\t\t\t\t>\n\t\t\t\t\t<Interface blockEditorSettings={ blockEditorSettings } />\n\t\t\t\t\t<Sidebar />\n\t\t\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t\t\t\t<UnsavedChangesWarning />\n\t\t\t\t\t<WelcomeGuide />\n\t\t\t\t</WidgetAreasBlockEditorProvider>\n\t\t\t</div>\n\t\t</ErrorBoundary>\n\t);\n}\n\nexport default Layout;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAKA,IAAAK,cAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,+BAAA,GAAAD,sBAAA,CAAAN,OAAA;AACA,IAAAQ,QAAA,GAAAF,sBAAA,CAAAN,OAAA;AACA,IAAAS,UAAA,GAAAH,sBAAA,CAAAN,OAAA;AACA,IAAAU,sBAAA,GAAAJ,sBAAA,CAAAN,OAAA;AACA,IAAAW,aAAA,GAAAL,sBAAA,CAAAN,OAAA;AAA4C,IAAAY,WAAA,GAAAZ,OAAA;AAjB5C;AACA;AACA;;AAOA;AACA;AACA;;AAQA,SAASa,MAAMA,CAAE;EAAEC;AAAo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data");
|
|
12
12
|
var _interface = require("@wordpress/interface");
|
|
13
13
|
var _i18n = require("@wordpress/i18n");
|
|
14
|
-
var _keyboardShortcuts = require("@wordpress/keyboard-shortcuts");
|
|
15
14
|
var _preferences = require("@wordpress/preferences");
|
|
16
15
|
var _header = _interopRequireDefault(require("../header"));
|
|
17
16
|
var _widgetAreasBlockEditorContent = _interopRequireDefault(require("../widget-areas-block-editor-content"));
|
|
@@ -50,16 +49,12 @@ function Interface({
|
|
|
50
49
|
hasBlockBreadCrumbsEnabled,
|
|
51
50
|
hasSidebarEnabled,
|
|
52
51
|
isInserterOpened,
|
|
53
|
-
isListViewOpened
|
|
54
|
-
previousShortcut,
|
|
55
|
-
nextShortcut
|
|
52
|
+
isListViewOpened
|
|
56
53
|
} = (0, _data.useSelect)(select => ({
|
|
57
54
|
hasSidebarEnabled: !!select(_interface.store).getActiveComplementaryArea(_store.store.name),
|
|
58
55
|
isInserterOpened: !!select(_store.store).isInserterOpened(),
|
|
59
56
|
isListViewOpened: !!select(_store.store).isListViewOpened(),
|
|
60
|
-
hasBlockBreadCrumbsEnabled: !!select(_preferences.store).get('core/edit-widgets', 'showBlockBreadcrumbs')
|
|
61
|
-
previousShortcut: select(_keyboardShortcuts.store).getAllShortcutKeyCombinations('core/edit-widgets/previous-region'),
|
|
62
|
-
nextShortcut: select(_keyboardShortcuts.store).getAllShortcutKeyCombinations('core/edit-widgets/next-region')
|
|
57
|
+
hasBlockBreadCrumbsEnabled: !!select(_preferences.store).get('core/edit-widgets', 'showBlockBreadcrumbs')
|
|
63
58
|
}), []);
|
|
64
59
|
|
|
65
60
|
// Inserter and Sidebars are mutually exclusive
|
|
@@ -96,11 +91,7 @@ function Interface({
|
|
|
96
91
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.BlockBreadcrumb, {
|
|
97
92
|
rootLabelText: (0, _i18n.__)('Widgets')
|
|
98
93
|
})
|
|
99
|
-
})
|
|
100
|
-
shortcuts: {
|
|
101
|
-
previous: previousShortcut,
|
|
102
|
-
next: nextShortcut
|
|
103
|
-
}
|
|
94
|
+
})
|
|
104
95
|
});
|
|
105
96
|
}
|
|
106
97
|
var _default = exports.default = Interface;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_compose","require","_blockEditor","_element","_data","_interface","_i18n","
|
|
1
|
+
{"version":3,"names":["_compose","require","_blockEditor","_element","_data","_interface","_i18n","_preferences","_header","_interopRequireDefault","_widgetAreasBlockEditorContent","_store","_secondarySidebar","_jsxRuntime","interfaceLabels","header","__","body","sidebar","footer","Interface","blockEditorSettings","isMobileViewport","useViewportMatch","isHugeViewport","setIsInserterOpened","setIsListViewOpened","closeGeneralSidebar","useDispatch","editWidgetsStore","hasBlockBreadCrumbsEnabled","hasSidebarEnabled","isInserterOpened","isListViewOpened","useSelect","select","interfaceStore","getActiveComplementaryArea","name","preferencesStore","get","useEffect","secondarySidebarLabel","hasSecondarySidebar","jsx","InterfaceSkeleton","labels","secondarySidebar","default","ComplementaryArea","Slot","scope","content","Fragment","children","className","BlockBreadcrumb","rootLabelText","_default","exports"],"sources":["@wordpress/edit-widgets/src/components/layout/interface.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport { BlockBreadcrumb } from '@wordpress/block-editor';\nimport { useEffect } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tInterfaceSkeleton,\n\tComplementaryArea,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport Header from '../header';\nimport WidgetAreasBlockEditorContent from '../widget-areas-block-editor-content';\nimport { store as editWidgetsStore } from '../../store';\nimport SecondarySidebar from '../secondary-sidebar';\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the widgets screen top bar landmark region. */\n\theader: __( 'Widgets top bar' ),\n\t/* translators: accessibility text for the widgets screen content landmark region. */\n\tbody: __( 'Widgets and blocks' ),\n\t/* translators: accessibility text for the widgets screen settings landmark region. */\n\tsidebar: __( 'Widgets settings' ),\n\t/* translators: accessibility text for the widgets screen footer landmark region. */\n\tfooter: __( 'Widgets footer' ),\n};\n\nfunction Interface( { blockEditorSettings } ) {\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isHugeViewport = useViewportMatch( 'huge', '>=' );\n\tconst { setIsInserterOpened, setIsListViewOpened, closeGeneralSidebar } =\n\t\tuseDispatch( editWidgetsStore );\n\tconst {\n\t\thasBlockBreadCrumbsEnabled,\n\t\thasSidebarEnabled,\n\t\tisInserterOpened,\n\t\tisListViewOpened,\n\t} = useSelect(\n\t\t( select ) => ( {\n\t\t\thasSidebarEnabled: !! select(\n\t\t\t\tinterfaceStore\n\t\t\t).getActiveComplementaryArea( editWidgetsStore.name ),\n\t\t\tisInserterOpened: !! select( editWidgetsStore ).isInserterOpened(),\n\t\t\tisListViewOpened: !! select( editWidgetsStore ).isListViewOpened(),\n\t\t\thasBlockBreadCrumbsEnabled: !! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'showBlockBreadcrumbs'\n\t\t\t),\n\t\t} ),\n\t\t[]\n\t);\n\n\t// Inserter and Sidebars are mutually exclusive\n\tuseEffect( () => {\n\t\tif ( hasSidebarEnabled && ! isHugeViewport ) {\n\t\t\tsetIsInserterOpened( false );\n\t\t\tsetIsListViewOpened( false );\n\t\t}\n\t}, [ hasSidebarEnabled, isHugeViewport ] );\n\n\tuseEffect( () => {\n\t\tif ( ( isInserterOpened || isListViewOpened ) && ! isHugeViewport ) {\n\t\t\tcloseGeneralSidebar();\n\t\t}\n\t}, [ isInserterOpened, isListViewOpened, isHugeViewport ] );\n\n\tconst secondarySidebarLabel = isListViewOpened\n\t\t? __( 'List View' )\n\t\t: __( 'Block Library' );\n\n\tconst hasSecondarySidebar = isListViewOpened || isInserterOpened;\n\n\treturn (\n\t\t<InterfaceSkeleton\n\t\t\tlabels={ {\n\t\t\t\t...interfaceLabels,\n\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t} }\n\t\t\theader={ <Header /> }\n\t\t\tsecondarySidebar={ hasSecondarySidebar && <SecondarySidebar /> }\n\t\t\tsidebar={ <ComplementaryArea.Slot scope=\"core/edit-widgets\" /> }\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t<WidgetAreasBlockEditorContent\n\t\t\t\t\t\tblockEditorSettings={ blockEditorSettings }\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t}\n\t\t\tfooter={\n\t\t\t\thasBlockBreadCrumbsEnabled &&\n\t\t\t\t! isMobileViewport && (\n\t\t\t\t\t<div className=\"edit-widgets-layout__footer\">\n\t\t\t\t\t\t<BlockBreadcrumb rootLabelText={ __( 'Widgets' ) } />\n\t\t\t\t\t</div>\n\t\t\t\t)\n\t\t\t}\n\t\t/>\n\t);\n}\n\nexport default Interface;\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AAKA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AAKA,IAAAO,OAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,8BAAA,GAAAD,sBAAA,CAAAR,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AACA,IAAAW,iBAAA,GAAAH,sBAAA,CAAAR,OAAA;AAAoD,IAAAY,WAAA,GAAAZ,OAAA;AArBpD;AACA;AACA;;AAaA;AACA;AACA;;AAMA,MAAMa,eAAe,GAAG;EACvB;EACAC,MAAM,EAAE,IAAAC,QAAE,EAAE,iBAAkB,CAAC;EAC/B;EACAC,IAAI,EAAE,IAAAD,QAAE,EAAE,oBAAqB,CAAC;EAChC;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AG,CAAE;IAAC,CACjD;EAEN,CACD,CAAC;AAEJ;AAAC,IAAA0C,QAAA,GAAAC,OAAA,CAAAX,OAAA,GAEc5B,SAAS","ignoreList":[]}
|
|
@@ -51,7 +51,7 @@ function InserterSidebar() {
|
|
|
51
51
|
__next40pxDefaultSize: true,
|
|
52
52
|
icon: _icons.close,
|
|
53
53
|
onClick: closeInserter,
|
|
54
|
-
label: (0, _i18n.__)('Close
|
|
54
|
+
label: (0, _i18n.__)('Close Block Inserter')
|
|
55
55
|
})
|
|
56
56
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
57
57
|
className: "edit-widgets-layout__inserter-panel-content",
|
|
@@ -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\t__next40pxDefaultSize\n\t\t\t\t\ticon={ close }\n\t\t\t\t\tonClick={ closeInserter }\n\t\t\t\t\tlabel={ __( 'Close
|
|
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,WAA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AAA,eAC9D,IAAAxB,WAAA,CAAAyB,GAAA,EAACpC,WAAA,CAAAqC,MAAM;QACNC,qBAAqB;QACrBC,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":[]}
|
package/build/index.js
CHANGED
|
@@ -16,6 +16,7 @@ Object.defineProperty(exports, "store", {
|
|
|
16
16
|
var _blocks = require("@wordpress/blocks");
|
|
17
17
|
var _data = require("@wordpress/data");
|
|
18
18
|
var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
|
|
19
|
+
var _editor = require("@wordpress/editor");
|
|
19
20
|
var _element = require("@wordpress/element");
|
|
20
21
|
var _blockLibrary = require("@wordpress/block-library");
|
|
21
22
|
var _coreData = require("@wordpress/core-data");
|
|
@@ -24,6 +25,7 @@ var _preferences = require("@wordpress/preferences");
|
|
|
24
25
|
var _store = require("./store");
|
|
25
26
|
require("./filters");
|
|
26
27
|
var widgetArea = _interopRequireWildcard(require("./blocks/widget-area"));
|
|
28
|
+
var _lockUnlock = require("./lock-unlock");
|
|
27
29
|
var _layout = _interopRequireDefault(require("./components/layout"));
|
|
28
30
|
var _constants = require("./constants");
|
|
29
31
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -38,6 +40,9 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
38
40
|
*/
|
|
39
41
|
|
|
40
42
|
const disabledBlocks = ['core/more', 'core/freeform', 'core/template-part', ...(_constants.ALLOW_REUSABLE_BLOCKS ? [] : ['core/block'])];
|
|
43
|
+
const {
|
|
44
|
+
registerCoreBlockBindingsSources
|
|
45
|
+
} = (0, _lockUnlock.unlock)(_editor.privateApis);
|
|
41
46
|
|
|
42
47
|
/**
|
|
43
48
|
* Initializes the block editor in the widgets screen.
|
|
@@ -59,6 +64,7 @@ function initializeEditor(id, settings) {
|
|
|
59
64
|
});
|
|
60
65
|
(0, _data.dispatch)(_blocks.store).reapplyBlockTypeFilters();
|
|
61
66
|
(0, _blockLibrary.registerCoreBlocks)(coreBlocks);
|
|
67
|
+
registerCoreBlockBindingsSources();
|
|
62
68
|
(0, _widgets.registerLegacyWidgetBlock)();
|
|
63
69
|
if (globalThis.IS_GUTENBERG_PLUGIN) {
|
|
64
70
|
(0, _blockLibrary.__experimentalRegisterExperimentalCoreBlocks)({
|
|
@@ -75,7 +81,7 @@ function initializeEditor(id, settings) {
|
|
|
75
81
|
// do this will result in errors in the default block parser.
|
|
76
82
|
// see: https://github.com/WordPress/gutenberg/issues/33097
|
|
77
83
|
(0, _blocks.setFreeformContentHandlerName)('core/html');
|
|
78
|
-
root.render(
|
|
84
|
+
root.render(/*#__PURE__*/(0, _jsxRuntime.jsx)(_element.StrictMode, {
|
|
79
85
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_layout.default, {
|
|
80
86
|
blockEditorSettings: settings
|
|
81
87
|
})
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blocks","require","_data","_deprecated","_interopRequireDefault","_element","_blockLibrary","_coreData","_widgets","_preferences","_store","widgetArea","_interopRequireWildcard","_layout","_constants","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","disabledBlocks","ALLOW_REUSABLE_BLOCKS","initializeEditor","id","settings","target","document","getElementById","root","createRoot","coreBlocks","__experimentalGetCoreBlocks","filter","block","includes","name","startsWith","dispatch","preferencesStore","setDefaults","fixedToolbar","welcomeGuide","showBlockBreadcrumbs","themeStyles","blocksStore","reapplyBlockTypeFilters","registerCoreBlocks","registerLegacyWidgetBlock","globalThis","IS_GUTENBERG_PLUGIN","__experimentalRegisterExperimentalCoreBlocks","enableFSEBlocks","ENABLE_EXPERIMENTAL_FSE_BLOCKS","registerLegacyWidgetVariations","registerBlock","registerWidgetGroupBlock","__experimentalFetchLinkSuggestions","search","searchOptions","fetchLinkSuggestions","setFreeformContentHandlerName","render","jsx","StrictMode","children","blockEditorSettings","initialize","exports","reinitializeEditor","deprecated","since","version","metadata","unstable__bootstrapServerSideBlockDefinitions","registerBlockType"],"sources":["@wordpress/edit-widgets/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tregisterBlockType,\n\tunstable__bootstrapServerSideBlockDefinitions, // eslint-disable-line camelcase\n\tsetFreeformContentHandlerName,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport { dispatch } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { StrictMode, createRoot } from '@wordpress/element';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalGetCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport { __experimentalFetchLinkSuggestions as fetchLinkSuggestions } from '@wordpress/core-data';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterLegacyWidgetVariations,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport './store';\nimport './filters';\nimport * as widgetArea from './blocks/widget-area';\
|
|
1
|
+
{"version":3,"names":["_blocks","require","_data","_deprecated","_interopRequireDefault","_editor","_element","_blockLibrary","_coreData","_widgets","_preferences","_store","widgetArea","_interopRequireWildcard","_lockUnlock","_layout","_constants","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","disabledBlocks","ALLOW_REUSABLE_BLOCKS","registerCoreBlockBindingsSources","unlock","editorPrivateApis","initializeEditor","id","settings","target","document","getElementById","root","createRoot","coreBlocks","__experimentalGetCoreBlocks","filter","block","includes","name","startsWith","dispatch","preferencesStore","setDefaults","fixedToolbar","welcomeGuide","showBlockBreadcrumbs","themeStyles","blocksStore","reapplyBlockTypeFilters","registerCoreBlocks","registerLegacyWidgetBlock","globalThis","IS_GUTENBERG_PLUGIN","__experimentalRegisterExperimentalCoreBlocks","enableFSEBlocks","ENABLE_EXPERIMENTAL_FSE_BLOCKS","registerLegacyWidgetVariations","registerBlock","registerWidgetGroupBlock","__experimentalFetchLinkSuggestions","search","searchOptions","fetchLinkSuggestions","setFreeformContentHandlerName","render","jsx","StrictMode","children","blockEditorSettings","initialize","exports","reinitializeEditor","deprecated","since","version","metadata","unstable__bootstrapServerSideBlockDefinitions","registerBlockType"],"sources":["@wordpress/edit-widgets/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tregisterBlockType,\n\tunstable__bootstrapServerSideBlockDefinitions, // eslint-disable-line camelcase\n\tsetFreeformContentHandlerName,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport { dispatch } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { StrictMode, createRoot } from '@wordpress/element';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalGetCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport { __experimentalFetchLinkSuggestions as fetchLinkSuggestions } from '@wordpress/core-data';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterLegacyWidgetVariations,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport './store';\nimport './filters';\nimport * as widgetArea from './blocks/widget-area';\nimport { unlock } from './lock-unlock';\nimport Layout from './components/layout';\nimport {\n\tALLOW_REUSABLE_BLOCKS,\n\tENABLE_EXPERIMENTAL_FSE_BLOCKS,\n} from './constants';\n\nconst disabledBlocks = [\n\t'core/more',\n\t'core/freeform',\n\t'core/template-part',\n\t...( ALLOW_REUSABLE_BLOCKS ? [] : [ 'core/block' ] ),\n];\n\nconst { registerCoreBlockBindingsSources } = unlock( editorPrivateApis );\n\n/**\n * Initializes the block editor in the widgets screen.\n *\n * @param {string} id ID of the root element to render the screen in.\n * @param {Object} settings Block editor settings.\n */\nexport function initializeEditor( id, settings ) {\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tconst coreBlocks = __experimentalGetCoreBlocks().filter( ( block ) => {\n\t\treturn ! (\n\t\t\tdisabledBlocks.includes( block.name ) ||\n\t\t\tblock.name.startsWith( 'core/post' ) ||\n\t\t\tblock.name.startsWith( 'core/query' ) ||\n\t\t\tblock.name.startsWith( 'core/site' ) ||\n\t\t\tblock.name.startsWith( 'core/navigation' )\n\t\t);\n\t} );\n\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-widgets', {\n\t\tfixedToolbar: false,\n\t\twelcomeGuide: true,\n\t\tshowBlockBreadcrumbs: true,\n\t\tthemeStyles: true,\n\t} );\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\tregisterCoreBlocks( coreBlocks );\n\tregisterCoreBlockBindingsSources();\n\tregisterLegacyWidgetBlock();\n\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: ENABLE_EXPERIMENTAL_FSE_BLOCKS,\n\t\t} );\n\t}\n\tregisterLegacyWidgetVariations( settings );\n\tregisterBlock( widgetArea );\n\tregisterWidgetGroupBlock();\n\n\tsettings.__experimentalFetchLinkSuggestions = ( search, searchOptions ) =>\n\t\tfetchLinkSuggestions( search, searchOptions, settings );\n\n\t// As we are unregistering `core/freeform` to avoid the Classic block, we must\n\t// replace it with something as the default freeform content handler. Failure to\n\t// do this will result in errors in the default block parser.\n\t// see: https://github.com/WordPress/gutenberg/issues/33097\n\tsetFreeformContentHandlerName( 'core/html' );\n\n\troot.render(\n\t\t<StrictMode>\n\t\t\t<Layout blockEditorSettings={ settings } />\n\t\t</StrictMode>\n\t);\n\n\treturn root;\n}\n\n/**\n * Compatibility export under the old `initialize` name.\n */\nexport const initialize = initializeEditor;\n\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editWidgets.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\n/**\n * Function to register an individual block.\n *\n * @param {Object} block The block to be registered.\n */\nconst registerBlock = ( block ) => {\n\tif ( ! block ) {\n\t\treturn;\n\t}\n\tconst { metadata, settings, name } = block;\n\tif ( metadata ) {\n\t\tunstable__bootstrapServerSideBlockDefinitions( { [ name ]: metadata } );\n\t}\n\tregisterBlockType( name, settings );\n};\n\nexport { store } from './store';\n"],"mappings":";;;;;;;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAMA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AAKA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AAKA,IAAAS,YAAA,GAAAT,OAAA;AAKA,IAAAU,MAAA,GAAAV,OAAA;AACAA,OAAA;AACA,IAAAW,UAAA,GAAAC,uBAAA,CAAAZ,OAAA;AACA,IAAAa,WAAA,GAAAb,OAAA;AACA,IAAAc,OAAA,GAAAX,sBAAA,CAAAH,OAAA;AACA,IAAAe,UAAA,GA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
|
|
69
69
|
});
|
|
70
70
|
} catch (e) {
|
|
71
|
-
registry.dispatch(_notices.store).createErrorNotice(
|
|
71
|
+
registry.dispatch(_notices.store).createErrorNotice(/* translators: %s: The error message. */
|
|
72
72
|
(0, _i18n.sprintf)((0, _i18n.__)('There was an error. %s'), e.message), {
|
|
73
73
|
type: 'snackbar'
|
|
74
74
|
});
|
|
@@ -220,7 +220,7 @@ const saveWidgetArea = widgetAreaId => async ({
|
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
222
|
if (failedWidgetNames.length) {
|
|
223
|
-
throw new Error((0, _i18n.sprintf)(
|
|
223
|
+
throw new Error((0, _i18n.sprintf)(/* translators: %s: List of widget names */
|
|
224
224
|
(0, _i18n.__)('Could not save the following widgets: %s.'), failedWidgetNames.join(', ')));
|
|
225
225
|
}
|
|
226
226
|
registry.dispatch(_coreData.store).editEntityRecord(_utils.KIND, _utils.WIDGET_AREA_ENTITY_TYPE, widgetAreaId, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_notices","_interface","_widgets","_coreData","_blockEditor","_transformers","_utils","_constants","persistStubPost","id","blocks","registry","stubPost","createStubPost","dispatch","coreStore","receiveEntityRecords","KIND","POST_TYPE","exports","saveEditedWidgetAreas","select","editedWidgetAreas","getEditedWidgetAreas","length","saveWidgetAreas","noticesStore","createSuccessNotice","__","type","e","createErrorNotice","sprintf","message","widgetAreas","widgetArea","saveWidgetArea","finishResolution","WIDGET_AREA_ENTITY_TYPE","buildWidgetAreasQuery","widgetAreaId","widgets","getWidgets","post","getEditedEntityRecord","buildWidgetAreaPostId","areaWidgets","Object","values","filter","sidebar","usedReferenceWidgets","widgetsBlocks","block","attributes","name","includes","push","deletedWidgets","widget","widgetsNewArea","getWidgetAreaForWidgetId","batchMeta","batchTasks","sidebarWidgetsIds","i","widgetId","getWidgetIdFromBlock","oldWidget","transformBlockToWidget","editEntityRecord","undoIgnore","hasEdits","hasEditsForEntityRecord","saveEditedEntityRecord","saveEntityRecord","position","clientId","deleteEntityRecord","force","records","__experimentalBatch","preservedRecords","record","hasOwnProperty","failedWidgetNames","__internalWidgetId","error","getLastEntitySaveError","Error","join","trySaveWidgetArea","undefined","throwOnError","setWidgetIdForClientId","setWidgetAreasOpenState","widgetAreasOpenState","setIsWidgetAreaOpen","isOpen","setIsInserterOpened","value","setIsListViewOpened","closeGeneralSidebar","interfaceStore","disableComplementaryArea","editWidgetsStoreName","moveBlockToWidgetArea","sourceRootClientId","blockEditorStore","getBlockRootClientId","getBlocks","destinationWidgetAreaBlock","find","destinationRootClientId","destinationInnerBlocksClientIds","getBlockOrder","destinationIndex","isDestinationWidgetAreaOpen","getIsWidgetAreaOpen","moveBlocksToPosition"],"sources":["@wordpress/edit-widgets/src/store/actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { getWidgetIdFromBlock } from '@wordpress/widgets';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { transformBlockToWidget } from './transformers';\nimport {\n\tbuildWidgetAreaPostId,\n\tbuildWidgetAreasQuery,\n\tcreateStubPost,\n\tKIND,\n\tPOST_TYPE,\n\tWIDGET_AREA_ENTITY_TYPE,\n} from './utils';\nimport { STORE_NAME as editWidgetsStoreName } from './constants';\n\n/**\n * Persists a stub post with given ID to core data store. The post is meant to be in-memory only and\n * shouldn't be saved via the API.\n *\n * @param {string} id Post ID.\n * @param {Array} blocks Blocks the post should consist of.\n * @return {Object} The post object.\n */\nexport const persistStubPost =\n\t( id, blocks ) =>\n\t( { registry } ) => {\n\t\tconst stubPost = createStubPost( id, blocks );\n\t\tregistry\n\t\t\t.dispatch( coreStore )\n\t\t\t.receiveEntityRecords(\n\t\t\t\tKIND,\n\t\t\t\tPOST_TYPE,\n\t\t\t\tstubPost,\n\t\t\t\t{ id: stubPost.id },\n\t\t\t\tfalse\n\t\t\t);\n\t\treturn stubPost;\n\t};\n\n/**\n * Converts all the blocks from edited widget areas into widgets,\n * and submits a batch request to save everything at once.\n *\n * Creates a snackbar notice on either success or error.\n *\n * @return {Function} An action creator.\n */\nexport const saveEditedWidgetAreas =\n\t() =>\n\tasync ( { select, dispatch, registry } ) => {\n\t\tconst editedWidgetAreas = select.getEditedWidgetAreas();\n\t\tif ( ! editedWidgetAreas?.length ) {\n\t\t\treturn;\n\t\t}\n\t\ttry {\n\t\t\tawait dispatch.saveWidgetAreas( editedWidgetAreas );\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createSuccessNotice( __( 'Widgets saved.' ), {\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t} );\n\t\t} catch ( e ) {\n\t\t\tregistry.dispatch( noticesStore ).createErrorNotice(\n\t\t\t\t/* translators: %s: The error message. */\n\t\t\t\tsprintf( __( 'There was an error. %s' ), e.message ),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t};\n\n/**\n * Converts all the blocks from specified widget areas into widgets,\n * and submits a batch request to save everything at once.\n *\n * @param {Object[]} widgetAreas Widget areas to save.\n * @return {Function} An action creator.\n */\nexport const saveWidgetAreas =\n\t( widgetAreas ) =>\n\tasync ( { dispatch, registry } ) => {\n\t\ttry {\n\t\t\tfor ( const widgetArea of widgetAreas ) {\n\t\t\t\tawait dispatch.saveWidgetArea( widgetArea.id );\n\t\t\t}\n\t\t} finally {\n\t\t\t// saveEditedEntityRecord resets the resolution status, let's fix it manually.\n\t\t\tawait registry\n\t\t\t\t.dispatch( coreStore )\n\t\t\t\t.finishResolution(\n\t\t\t\t\t'getEntityRecord',\n\t\t\t\t\tKIND,\n\t\t\t\t\tWIDGET_AREA_ENTITY_TYPE,\n\t\t\t\t\tbuildWidgetAreasQuery()\n\t\t\t\t);\n\t\t}\n\t};\n\n/**\n * Converts all the blocks from a widget area specified by ID into widgets,\n * and submits a batch request to save everything at once.\n *\n * @param {string} widgetAreaId ID of the widget area to process.\n * @return {Function} An action creator.\n */\nexport const saveWidgetArea =\n\t( widgetAreaId ) =>\n\tasync ( { dispatch, select, registry } ) => {\n\t\tconst widgets = select.getWidgets();\n\n\t\tconst post = registry\n\t\t\t.select( coreStore )\n\t\t\t.getEditedEntityRecord(\n\t\t\t\tKIND,\n\t\t\t\tPOST_TYPE,\n\t\t\t\tbuildWidgetAreaPostId( widgetAreaId )\n\t\t\t);\n\n\t\t// Get all widgets from this area\n\t\tconst areaWidgets = Object.values( widgets ).filter(\n\t\t\t( { sidebar } ) => sidebar === widgetAreaId\n\t\t);\n\n\t\t// Remove all duplicate reference widget instances for legacy widgets.\n\t\t// Why? We filter out the widgets with duplicate IDs to prevent adding more than one instance of a widget\n\t\t// implemented using a function. WordPress doesn't support having more than one instance of these, if you try to\n\t\t// save multiple instances of these in different sidebars you will run into undefined behaviors.\n\t\tconst usedReferenceWidgets = [];\n\t\tconst widgetsBlocks = post.blocks.filter( ( block ) => {\n\t\t\tconst { id } = block.attributes;\n\n\t\t\tif ( block.name === 'core/legacy-widget' && id ) {\n\t\t\t\tif ( usedReferenceWidgets.includes( id ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tusedReferenceWidgets.push( id );\n\t\t\t}\n\t\t\treturn true;\n\t\t} );\n\n\t\t// Determine which widgets have been deleted. We can tell if a widget is\n\t\t// deleted and not just moved to a different area by looking to see if\n\t\t// getWidgetAreaForWidgetId() finds something.\n\t\tconst deletedWidgets = [];\n\t\tfor ( const widget of areaWidgets ) {\n\t\t\tconst widgetsNewArea = select.getWidgetAreaForWidgetId( widget.id );\n\t\t\tif ( ! widgetsNewArea ) {\n\t\t\t\tdeletedWidgets.push( widget );\n\t\t\t}\n\t\t}\n\n\t\tconst batchMeta = [];\n\t\tconst batchTasks = [];\n\t\tconst sidebarWidgetsIds = [];\n\t\tfor ( let i = 0; i < widgetsBlocks.length; i++ ) {\n\t\t\tconst block = widgetsBlocks[ i ];\n\t\t\tconst widgetId = getWidgetIdFromBlock( block );\n\t\t\tconst oldWidget = widgets[ widgetId ];\n\t\t\tconst widget = transformBlockToWidget( block, oldWidget );\n\n\t\t\t// We'll replace the null widgetId after save, but we track it here\n\t\t\t// since order is important.\n\t\t\tsidebarWidgetsIds.push( widgetId );\n\n\t\t\t// Check oldWidget as widgetId might refer to an ID which has been\n\t\t\t// deleted, e.g. if a deleted block is restored via undo after saving.\n\t\t\tif ( oldWidget ) {\n\t\t\t\t// Update an existing widget.\n\t\t\t\tregistry.dispatch( coreStore ).editEntityRecord(\n\t\t\t\t\t'root',\n\t\t\t\t\t'widget',\n\t\t\t\t\twidgetId,\n\t\t\t\t\t{\n\t\t\t\t\t\t...widget,\n\t\t\t\t\t\tsidebar: widgetAreaId,\n\t\t\t\t\t},\n\t\t\t\t\t{ undoIgnore: true }\n\t\t\t\t);\n\n\t\t\t\tconst hasEdits = registry\n\t\t\t\t\t.select( coreStore )\n\t\t\t\t\t.hasEditsForEntityRecord( 'root', 'widget', widgetId );\n\n\t\t\t\tif ( ! hasEdits ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tbatchTasks.push( ( { saveEditedEntityRecord } ) =>\n\t\t\t\t\tsaveEditedEntityRecord( 'root', 'widget', widgetId )\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t// Create a new widget.\n\t\t\t\tbatchTasks.push( ( { saveEntityRecord } ) =>\n\t\t\t\t\tsaveEntityRecord( 'root', 'widget', {\n\t\t\t\t\t\t...widget,\n\t\t\t\t\t\tsidebar: widgetAreaId,\n\t\t\t\t\t} )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tbatchMeta.push( {\n\t\t\t\tblock,\n\t\t\t\tposition: i,\n\t\t\t\tclientId: block.clientId,\n\t\t\t} );\n\t\t}\n\t\tfor ( const widget of deletedWidgets ) {\n\t\t\tbatchTasks.push( ( { deleteEntityRecord } ) =>\n\t\t\t\tdeleteEntityRecord( 'root', 'widget', widget.id, {\n\t\t\t\t\tforce: true,\n\t\t\t\t} )\n\t\t\t);\n\t\t}\n\n\t\tconst records = await registry\n\t\t\t.dispatch( coreStore )\n\t\t\t.__experimentalBatch( batchTasks );\n\t\tconst preservedRecords = records.filter(\n\t\t\t( record ) => ! record.hasOwnProperty( 'deleted' )\n\t\t);\n\n\t\tconst failedWidgetNames = [];\n\n\t\tfor ( let i = 0; i < preservedRecords.length; i++ ) {\n\t\t\tconst widget = preservedRecords[ i ];\n\t\t\tconst { block, position } = batchMeta[ i ];\n\n\t\t\t// Set __internalWidgetId on the block. This will be persisted to the\n\t\t\t// store when we dispatch receiveEntityRecords( post ) below.\n\t\t\tpost.blocks[ position ].attributes.__internalWidgetId = widget.id;\n\n\t\t\tconst error = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getLastEntitySaveError( 'root', 'widget', widget.id );\n\t\t\tif ( error ) {\n\t\t\t\tfailedWidgetNames.push( block.attributes?.name || block?.name );\n\t\t\t}\n\n\t\t\tif ( ! sidebarWidgetsIds[ position ] ) {\n\t\t\t\tsidebarWidgetsIds[ position ] = widget.id;\n\t\t\t}\n\t\t}\n\n\t\tif ( failedWidgetNames.length ) {\n\t\t\tthrow new Error(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: List of widget names */\n\t\t\t\t\t__( 'Could not save the following widgets: %s.' ),\n\t\t\t\t\tfailedWidgetNames.join( ', ' )\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tregistry.dispatch( coreStore ).editEntityRecord(\n\t\t\tKIND,\n\t\t\tWIDGET_AREA_ENTITY_TYPE,\n\t\t\twidgetAreaId,\n\t\t\t{\n\t\t\t\twidgets: sidebarWidgetsIds,\n\t\t\t},\n\t\t\t{ undoIgnore: true }\n\t\t);\n\n\t\tdispatch( trySaveWidgetArea( widgetAreaId ) );\n\n\t\tregistry\n\t\t\t.dispatch( coreStore )\n\t\t\t.receiveEntityRecords( KIND, POST_TYPE, post, undefined );\n\t};\n\nconst trySaveWidgetArea =\n\t( widgetAreaId ) =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( coreStore )\n\t\t\t.saveEditedEntityRecord(\n\t\t\t\tKIND,\n\t\t\t\tWIDGET_AREA_ENTITY_TYPE,\n\t\t\t\twidgetAreaId,\n\t\t\t\t{\n\t\t\t\t\tthrowOnError: true,\n\t\t\t\t}\n\t\t\t);\n\t};\n\n/**\n * Sets the clientId stored for a particular widgetId.\n *\n * @param {number} clientId Client id.\n * @param {number} widgetId Widget id.\n *\n * @return {Object} Action.\n */\nexport function setWidgetIdForClientId( clientId, widgetId ) {\n\treturn {\n\t\ttype: 'SET_WIDGET_ID_FOR_CLIENT_ID',\n\t\tclientId,\n\t\twidgetId,\n\t};\n}\n\n/**\n * Sets the open state of all the widget areas.\n *\n * @param {Object} widgetAreasOpenState The open states of all the widget areas.\n *\n * @return {Object} Action.\n */\nexport function setWidgetAreasOpenState( widgetAreasOpenState ) {\n\treturn {\n\t\ttype: 'SET_WIDGET_AREAS_OPEN_STATE',\n\t\twidgetAreasOpenState,\n\t};\n}\n\n/**\n * Sets the open state of the widget area.\n *\n * @param {string} clientId The clientId of the widget area.\n * @param {boolean} isOpen Whether the widget area should be opened.\n *\n * @return {Object} Action.\n */\nexport function setIsWidgetAreaOpen( clientId, isOpen ) {\n\treturn {\n\t\ttype: 'SET_IS_WIDGET_AREA_OPEN',\n\t\tclientId,\n\t\tisOpen,\n\t};\n}\n\n/**\n * Returns an action object used to open/close the inserter.\n *\n * @param {boolean|Object} value Whether the inserter should be\n * opened (true) or closed (false).\n * To specify an insertion point,\n * use an object.\n * @param {string} value.rootClientId The root client ID to insert at.\n * @param {number} value.insertionIndex The index to insert at.\n *\n * @return {Object} Action object.\n */\nexport function setIsInserterOpened( value ) {\n\treturn {\n\t\ttype: 'SET_IS_INSERTER_OPENED',\n\t\tvalue,\n\t};\n}\n\n/**\n * Returns an action object used to open/close the list view.\n *\n * @param {boolean} isOpen A boolean representing whether the list view should be opened or closed.\n * @return {Object} Action object.\n */\nexport function setIsListViewOpened( isOpen ) {\n\treturn {\n\t\ttype: 'SET_IS_LIST_VIEW_OPENED',\n\t\tisOpen,\n\t};\n}\n\n/**\n * Returns an action object signalling that the user closed the sidebar.\n *\n * @return {Object} Action creator.\n */\nexport const closeGeneralSidebar =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t.disableComplementaryArea( editWidgetsStoreName );\n\t};\n\n/**\n * Action that handles moving a block between widget areas\n *\n * @param {string} clientId The clientId of the block to move.\n * @param {string} widgetAreaId The id of the widget area to move the block to.\n */\nexport const moveBlockToWidgetArea =\n\t( clientId, widgetAreaId ) =>\n\tasync ( { dispatch, select, registry } ) => {\n\t\tconst sourceRootClientId = registry\n\t\t\t.select( blockEditorStore )\n\t\t\t.getBlockRootClientId( clientId );\n\n\t\t// Search the top level blocks (widget areas) for the one with the matching\n\t\t// id attribute. Makes the assumption that all top-level blocks are widget\n\t\t// areas.\n\t\tconst widgetAreas = registry.select( blockEditorStore ).getBlocks();\n\t\tconst destinationWidgetAreaBlock = widgetAreas.find(\n\t\t\t( { attributes } ) => attributes.id === widgetAreaId\n\t\t);\n\t\tconst destinationRootClientId = destinationWidgetAreaBlock.clientId;\n\n\t\t// Get the index for moving to the end of the destination widget area.\n\t\tconst destinationInnerBlocksClientIds = registry\n\t\t\t.select( blockEditorStore )\n\t\t\t.getBlockOrder( destinationRootClientId );\n\t\tconst destinationIndex = destinationInnerBlocksClientIds.length;\n\n\t\t// Reveal the widget area, if it's not open.\n\t\tconst isDestinationWidgetAreaOpen = select.getIsWidgetAreaOpen(\n\t\t\tdestinationRootClientId\n\t\t);\n\n\t\tif ( ! isDestinationWidgetAreaOpen ) {\n\t\t\tdispatch.setIsWidgetAreaOpen( destinationRootClientId, true );\n\t\t}\n\n\t\t// Move the block.\n\t\tregistry\n\t\t\t.dispatch( blockEditorStore )\n\t\t\t.moveBlocksToPosition(\n\t\t\t\t[ clientId ],\n\t\t\t\tsourceRootClientId,\n\t\t\t\tdestinationRootClientId,\n\t\t\t\tdestinationIndex\n\t\t\t);\n\t};\n"],"mappings":";;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAKA,IAAAM,aAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAQA,IAAAQ,UAAA,GAAAR,OAAA;AAtBA;AACA;AACA;;AAQA;AACA;AACA;;AAYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMS,eAAe,GAC3BA,CAAEC,EAAE,EAAEC,MAAM,KACZ,CAAE;EAAEC;AAAS,CAAC,KAAM;EACnB,MAAMC,QAAQ,GAAG,IAAAC,qBAAc,EAAEJ,EAAE,EAAEC,MAAO,CAAC;EAC7CC,QAAQ,CACNG,QAAQ,CAAEC,eAAU,CAAC,CACrBC,oBAAoB,CACpBC,WAAI,EACJC,gBAAS,EACTN,QAAQ,EACR;IAAEH,EAAE,EAAEG,QAAQ,CAACH;EAAG,CAAC,EACnB,KACD,CAAC;EACF,OAAOG,QAAQ;AAChB,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPAO,OAAA,CAAAX,eAAA,GAAAA,eAAA;AAQO,MAAMY,qBAAqB,GACjCA,CAAA,KACA,OAAQ;EAAEC,MAAM;EAAEP,QAAQ;EAAEH;AAAS,CAAC,KAAM;EAC3C,MAAMW,iBAAiB,GAAGD,MAAM,CAACE,oBAAoB,CAAC,CAAC;EACvD,IAAK,CAAED,iBAAiB,EAAEE,MAAM,EAAG;IAClC;EACD;EACA,IAAI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1C,MAAMG,gBAAgB,GAAGF,+BAA+B,CAAC1F,MAAM;;EAE/D;EACA,MAAM6F,2BAA2B,GAAGhG,MAAM,CAACiG,mBAAmB,CAC7DL,uBACD,CAAC;EAED,IAAK,CAAEI,2BAA2B,EAAG;IACpCvG,QAAQ,CAACmF,mBAAmB,CAAEgB,uBAAuB,EAAE,IAAK,CAAC;EAC9D;;EAEA;EACAtG,QAAQ,CACNG,QAAQ,CAAE8F,kBAAiB,CAAC,CAC5BW,oBAAoB,CACpB,CAAE1C,QAAQ,CAAE,EACZ8B,kBAAkB,EAClBM,uBAAuB,EACvBG,gBACD,CAAC;AACH,CAAC;AAACjG,OAAA,CAAAuF,qBAAA,GAAAA,qBAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_i18n","require","_notices","_interface","_widgets","_coreData","_blockEditor","_transformers","_utils","_constants","persistStubPost","id","blocks","registry","stubPost","createStubPost","dispatch","coreStore","receiveEntityRecords","KIND","POST_TYPE","exports","saveEditedWidgetAreas","select","editedWidgetAreas","getEditedWidgetAreas","length","saveWidgetAreas","noticesStore","createSuccessNotice","__","type","e","createErrorNotice","sprintf","message","widgetAreas","widgetArea","saveWidgetArea","finishResolution","WIDGET_AREA_ENTITY_TYPE","buildWidgetAreasQuery","widgetAreaId","widgets","getWidgets","post","getEditedEntityRecord","buildWidgetAreaPostId","areaWidgets","Object","values","filter","sidebar","usedReferenceWidgets","widgetsBlocks","block","attributes","name","includes","push","deletedWidgets","widget","widgetsNewArea","getWidgetAreaForWidgetId","batchMeta","batchTasks","sidebarWidgetsIds","i","widgetId","getWidgetIdFromBlock","oldWidget","transformBlockToWidget","editEntityRecord","undoIgnore","hasEdits","hasEditsForEntityRecord","saveEditedEntityRecord","saveEntityRecord","position","clientId","deleteEntityRecord","force","records","__experimentalBatch","preservedRecords","record","hasOwnProperty","failedWidgetNames","__internalWidgetId","error","getLastEntitySaveError","Error","join","trySaveWidgetArea","undefined","throwOnError","setWidgetIdForClientId","setWidgetAreasOpenState","widgetAreasOpenState","setIsWidgetAreaOpen","isOpen","setIsInserterOpened","value","setIsListViewOpened","closeGeneralSidebar","interfaceStore","disableComplementaryArea","editWidgetsStoreName","moveBlockToWidgetArea","sourceRootClientId","blockEditorStore","getBlockRootClientId","getBlocks","destinationWidgetAreaBlock","find","destinationRootClientId","destinationInnerBlocksClientIds","getBlockOrder","destinationIndex","isDestinationWidgetAreaOpen","getIsWidgetAreaOpen","moveBlocksToPosition"],"sources":["@wordpress/edit-widgets/src/store/actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { getWidgetIdFromBlock } from '@wordpress/widgets';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { transformBlockToWidget } from './transformers';\nimport {\n\tbuildWidgetAreaPostId,\n\tbuildWidgetAreasQuery,\n\tcreateStubPost,\n\tKIND,\n\tPOST_TYPE,\n\tWIDGET_AREA_ENTITY_TYPE,\n} from './utils';\nimport { STORE_NAME as editWidgetsStoreName } from './constants';\n\n/**\n * Persists a stub post with given ID to core data store. The post is meant to be in-memory only and\n * shouldn't be saved via the API.\n *\n * @param {string} id Post ID.\n * @param {Array} blocks Blocks the post should consist of.\n * @return {Object} The post object.\n */\nexport const persistStubPost =\n\t( id, blocks ) =>\n\t( { registry } ) => {\n\t\tconst stubPost = createStubPost( id, blocks );\n\t\tregistry\n\t\t\t.dispatch( coreStore )\n\t\t\t.receiveEntityRecords(\n\t\t\t\tKIND,\n\t\t\t\tPOST_TYPE,\n\t\t\t\tstubPost,\n\t\t\t\t{ id: stubPost.id },\n\t\t\t\tfalse\n\t\t\t);\n\t\treturn stubPost;\n\t};\n\n/**\n * Converts all the blocks from edited widget areas into widgets,\n * and submits a batch request to save everything at once.\n *\n * Creates a snackbar notice on either success or error.\n *\n * @return {Function} An action creator.\n */\nexport const saveEditedWidgetAreas =\n\t() =>\n\tasync ( { select, dispatch, registry } ) => {\n\t\tconst editedWidgetAreas = select.getEditedWidgetAreas();\n\t\tif ( ! editedWidgetAreas?.length ) {\n\t\t\treturn;\n\t\t}\n\t\ttry {\n\t\t\tawait dispatch.saveWidgetAreas( editedWidgetAreas );\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createSuccessNotice( __( 'Widgets saved.' ), {\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t} );\n\t\t} catch ( e ) {\n\t\t\tregistry.dispatch( noticesStore ).createErrorNotice(\n\t\t\t\t/* translators: %s: The error message. */\n\t\t\t\tsprintf( __( 'There was an error. %s' ), e.message ),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t};\n\n/**\n * Converts all the blocks from specified widget areas into widgets,\n * and submits a batch request to save everything at once.\n *\n * @param {Object[]} widgetAreas Widget areas to save.\n * @return {Function} An action creator.\n */\nexport const saveWidgetAreas =\n\t( widgetAreas ) =>\n\tasync ( { dispatch, registry } ) => {\n\t\ttry {\n\t\t\tfor ( const widgetArea of widgetAreas ) {\n\t\t\t\tawait dispatch.saveWidgetArea( widgetArea.id );\n\t\t\t}\n\t\t} finally {\n\t\t\t// saveEditedEntityRecord resets the resolution status, let's fix it manually.\n\t\t\tawait registry\n\t\t\t\t.dispatch( coreStore )\n\t\t\t\t.finishResolution(\n\t\t\t\t\t'getEntityRecord',\n\t\t\t\t\tKIND,\n\t\t\t\t\tWIDGET_AREA_ENTITY_TYPE,\n\t\t\t\t\tbuildWidgetAreasQuery()\n\t\t\t\t);\n\t\t}\n\t};\n\n/**\n * Converts all the blocks from a widget area specified by ID into widgets,\n * and submits a batch request to save everything at once.\n *\n * @param {string} widgetAreaId ID of the widget area to process.\n * @return {Function} An action creator.\n */\nexport const saveWidgetArea =\n\t( widgetAreaId ) =>\n\tasync ( { dispatch, select, registry } ) => {\n\t\tconst widgets = select.getWidgets();\n\n\t\tconst post = registry\n\t\t\t.select( coreStore )\n\t\t\t.getEditedEntityRecord(\n\t\t\t\tKIND,\n\t\t\t\tPOST_TYPE,\n\t\t\t\tbuildWidgetAreaPostId( widgetAreaId )\n\t\t\t);\n\n\t\t// Get all widgets from this area\n\t\tconst areaWidgets = Object.values( widgets ).filter(\n\t\t\t( { sidebar } ) => sidebar === widgetAreaId\n\t\t);\n\n\t\t// Remove all duplicate reference widget instances for legacy widgets.\n\t\t// Why? We filter out the widgets with duplicate IDs to prevent adding more than one instance of a widget\n\t\t// implemented using a function. WordPress doesn't support having more than one instance of these, if you try to\n\t\t// save multiple instances of these in different sidebars you will run into undefined behaviors.\n\t\tconst usedReferenceWidgets = [];\n\t\tconst widgetsBlocks = post.blocks.filter( ( block ) => {\n\t\t\tconst { id } = block.attributes;\n\n\t\t\tif ( block.name === 'core/legacy-widget' && id ) {\n\t\t\t\tif ( usedReferenceWidgets.includes( id ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tusedReferenceWidgets.push( id );\n\t\t\t}\n\t\t\treturn true;\n\t\t} );\n\n\t\t// Determine which widgets have been deleted. We can tell if a widget is\n\t\t// deleted and not just moved to a different area by looking to see if\n\t\t// getWidgetAreaForWidgetId() finds something.\n\t\tconst deletedWidgets = [];\n\t\tfor ( const widget of areaWidgets ) {\n\t\t\tconst widgetsNewArea = select.getWidgetAreaForWidgetId( widget.id );\n\t\t\tif ( ! widgetsNewArea ) {\n\t\t\t\tdeletedWidgets.push( widget );\n\t\t\t}\n\t\t}\n\n\t\tconst batchMeta = [];\n\t\tconst batchTasks = [];\n\t\tconst sidebarWidgetsIds = [];\n\t\tfor ( let i = 0; i < widgetsBlocks.length; i++ ) {\n\t\t\tconst block = widgetsBlocks[ i ];\n\t\t\tconst widgetId = getWidgetIdFromBlock( block );\n\t\t\tconst oldWidget = widgets[ widgetId ];\n\t\t\tconst widget = transformBlockToWidget( block, oldWidget );\n\n\t\t\t// We'll replace the null widgetId after save, but we track it here\n\t\t\t// since order is important.\n\t\t\tsidebarWidgetsIds.push( widgetId );\n\n\t\t\t// Check oldWidget as widgetId might refer to an ID which has been\n\t\t\t// deleted, e.g. if a deleted block is restored via undo after saving.\n\t\t\tif ( oldWidget ) {\n\t\t\t\t// Update an existing widget.\n\t\t\t\tregistry.dispatch( coreStore ).editEntityRecord(\n\t\t\t\t\t'root',\n\t\t\t\t\t'widget',\n\t\t\t\t\twidgetId,\n\t\t\t\t\t{\n\t\t\t\t\t\t...widget,\n\t\t\t\t\t\tsidebar: widgetAreaId,\n\t\t\t\t\t},\n\t\t\t\t\t{ undoIgnore: true }\n\t\t\t\t);\n\n\t\t\t\tconst hasEdits = registry\n\t\t\t\t\t.select( coreStore )\n\t\t\t\t\t.hasEditsForEntityRecord( 'root', 'widget', widgetId );\n\n\t\t\t\tif ( ! hasEdits ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tbatchTasks.push( ( { saveEditedEntityRecord } ) =>\n\t\t\t\t\tsaveEditedEntityRecord( 'root', 'widget', widgetId )\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t// Create a new widget.\n\t\t\t\tbatchTasks.push( ( { saveEntityRecord } ) =>\n\t\t\t\t\tsaveEntityRecord( 'root', 'widget', {\n\t\t\t\t\t\t...widget,\n\t\t\t\t\t\tsidebar: widgetAreaId,\n\t\t\t\t\t} )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tbatchMeta.push( {\n\t\t\t\tblock,\n\t\t\t\tposition: i,\n\t\t\t\tclientId: block.clientId,\n\t\t\t} );\n\t\t}\n\t\tfor ( const widget of deletedWidgets ) {\n\t\t\tbatchTasks.push( ( { deleteEntityRecord } ) =>\n\t\t\t\tdeleteEntityRecord( 'root', 'widget', widget.id, {\n\t\t\t\t\tforce: true,\n\t\t\t\t} )\n\t\t\t);\n\t\t}\n\n\t\tconst records = await registry\n\t\t\t.dispatch( coreStore )\n\t\t\t.__experimentalBatch( batchTasks );\n\t\tconst preservedRecords = records.filter(\n\t\t\t( record ) => ! record.hasOwnProperty( 'deleted' )\n\t\t);\n\n\t\tconst failedWidgetNames = [];\n\n\t\tfor ( let i = 0; i < preservedRecords.length; i++ ) {\n\t\t\tconst widget = preservedRecords[ i ];\n\t\t\tconst { block, position } = batchMeta[ i ];\n\n\t\t\t// Set __internalWidgetId on the block. This will be persisted to the\n\t\t\t// store when we dispatch receiveEntityRecords( post ) below.\n\t\t\tpost.blocks[ position ].attributes.__internalWidgetId = widget.id;\n\n\t\t\tconst error = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getLastEntitySaveError( 'root', 'widget', widget.id );\n\t\t\tif ( error ) {\n\t\t\t\tfailedWidgetNames.push( block.attributes?.name || block?.name );\n\t\t\t}\n\n\t\t\tif ( ! sidebarWidgetsIds[ position ] ) {\n\t\t\t\tsidebarWidgetsIds[ position ] = widget.id;\n\t\t\t}\n\t\t}\n\n\t\tif ( failedWidgetNames.length ) {\n\t\t\tthrow new Error(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: List of widget names */\n\t\t\t\t\t__( 'Could not save the following widgets: %s.' ),\n\t\t\t\t\tfailedWidgetNames.join( ', ' )\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tregistry.dispatch( coreStore ).editEntityRecord(\n\t\t\tKIND,\n\t\t\tWIDGET_AREA_ENTITY_TYPE,\n\t\t\twidgetAreaId,\n\t\t\t{\n\t\t\t\twidgets: sidebarWidgetsIds,\n\t\t\t},\n\t\t\t{ undoIgnore: true }\n\t\t);\n\n\t\tdispatch( trySaveWidgetArea( widgetAreaId ) );\n\n\t\tregistry\n\t\t\t.dispatch( coreStore )\n\t\t\t.receiveEntityRecords( KIND, POST_TYPE, post, undefined );\n\t};\n\nconst trySaveWidgetArea =\n\t( widgetAreaId ) =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( coreStore )\n\t\t\t.saveEditedEntityRecord(\n\t\t\t\tKIND,\n\t\t\t\tWIDGET_AREA_ENTITY_TYPE,\n\t\t\t\twidgetAreaId,\n\t\t\t\t{\n\t\t\t\t\tthrowOnError: true,\n\t\t\t\t}\n\t\t\t);\n\t};\n\n/**\n * Sets the clientId stored for a particular widgetId.\n *\n * @param {number} clientId Client id.\n * @param {number} widgetId Widget id.\n *\n * @return {Object} Action.\n */\nexport function setWidgetIdForClientId( clientId, widgetId ) {\n\treturn {\n\t\ttype: 'SET_WIDGET_ID_FOR_CLIENT_ID',\n\t\tclientId,\n\t\twidgetId,\n\t};\n}\n\n/**\n * Sets the open state of all the widget areas.\n *\n * @param {Object} widgetAreasOpenState The open states of all the widget areas.\n *\n * @return {Object} Action.\n */\nexport function setWidgetAreasOpenState( widgetAreasOpenState ) {\n\treturn {\n\t\ttype: 'SET_WIDGET_AREAS_OPEN_STATE',\n\t\twidgetAreasOpenState,\n\t};\n}\n\n/**\n * Sets the open state of the widget area.\n *\n * @param {string} clientId The clientId of the widget area.\n * @param {boolean} isOpen Whether the widget area should be opened.\n *\n * @return {Object} Action.\n */\nexport function setIsWidgetAreaOpen( clientId, isOpen ) {\n\treturn {\n\t\ttype: 'SET_IS_WIDGET_AREA_OPEN',\n\t\tclientId,\n\t\tisOpen,\n\t};\n}\n\n/**\n * Returns an action object used to open/close the inserter.\n *\n * @param {boolean|Object} value Whether the inserter should be\n * opened (true) or closed (false).\n * To specify an insertion point,\n * use an object.\n * @param {string} value.rootClientId The root client ID to insert at.\n * @param {number} value.insertionIndex The index to insert at.\n *\n * @return {Object} Action object.\n */\nexport function setIsInserterOpened( value ) {\n\treturn {\n\t\ttype: 'SET_IS_INSERTER_OPENED',\n\t\tvalue,\n\t};\n}\n\n/**\n * Returns an action object used to open/close the list view.\n *\n * @param {boolean} isOpen A boolean representing whether the list view should be opened or closed.\n * @return {Object} Action object.\n */\nexport function setIsListViewOpened( isOpen ) {\n\treturn {\n\t\ttype: 'SET_IS_LIST_VIEW_OPENED',\n\t\tisOpen,\n\t};\n}\n\n/**\n * Returns an action object signalling that the user closed the sidebar.\n *\n * @return {Object} Action creator.\n */\nexport const closeGeneralSidebar =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t.disableComplementaryArea( editWidgetsStoreName );\n\t};\n\n/**\n * Action that handles moving a block between widget areas\n *\n * @param {string} clientId The clientId of the block to move.\n * @param {string} widgetAreaId The id of the widget area to move the block to.\n */\nexport const moveBlockToWidgetArea =\n\t( clientId, widgetAreaId ) =>\n\tasync ( { dispatch, select, registry } ) => {\n\t\tconst sourceRootClientId = registry\n\t\t\t.select( blockEditorStore )\n\t\t\t.getBlockRootClientId( clientId );\n\n\t\t// Search the top level blocks (widget areas) for the one with the matching\n\t\t// id attribute. Makes the assumption that all top-level blocks are widget\n\t\t// areas.\n\t\tconst widgetAreas = registry.select( blockEditorStore ).getBlocks();\n\t\tconst destinationWidgetAreaBlock = widgetAreas.find(\n\t\t\t( { attributes } ) => attributes.id === widgetAreaId\n\t\t);\n\t\tconst destinationRootClientId = destinationWidgetAreaBlock.clientId;\n\n\t\t// Get the index for moving to the end of the destination widget area.\n\t\tconst destinationInnerBlocksClientIds = registry\n\t\t\t.select( blockEditorStore )\n\t\t\t.getBlockOrder( destinationRootClientId );\n\t\tconst destinationIndex = destinationInnerBlocksClientIds.length;\n\n\t\t// Reveal the widget area, if it's not open.\n\t\tconst isDestinationWidgetAreaOpen = select.getIsWidgetAreaOpen(\n\t\t\tdestinationRootClientId\n\t\t);\n\n\t\tif ( ! isDestinationWidgetAreaOpen ) {\n\t\t\tdispatch.setIsWidgetAreaOpen( destinationRootClientId, true );\n\t\t}\n\n\t\t// Move the block.\n\t\tregistry\n\t\t\t.dispatch( blockEditorStore )\n\t\t\t.moveBlocksToPosition(\n\t\t\t\t[ clientId ],\n\t\t\t\tsourceRootClientId,\n\t\t\t\tdestinationRootClientId,\n\t\t\t\tdestinationIndex\n\t\t\t);\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