@wordpress/edit-widgets 5.27.2 → 5.28.1
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/use-is-dragging-within.js +1 -2
- package/build/blocks/widget-area/edit/use-is-dragging-within.js.map +1 -1
- package/build/blocks/widget-area/index.js +2 -4
- package/build/blocks/widget-area/index.js.map +1 -1
- package/build/components/header/document-tools/index.js +1 -2
- package/build/components/header/document-tools/index.js.map +1 -1
- package/build/components/header/index.js +1 -2
- package/build/components/header/index.js.map +1 -1
- package/build/components/header/undo-redo/redo.js +1 -2
- package/build/components/header/undo-redo/redo.js.map +1 -1
- package/build/components/header/undo-redo/undo.js +1 -2
- package/build/components/header/undo-redo/undo.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +1 -2
- package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +1 -2
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +0 -1
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +1 -2
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js +1 -2
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/layout/index.js +1 -2
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/interface.js +1 -2
- package/build/components/layout/interface.js.map +1 -1
- package/build/components/more-menu/tools-more-menu-group.js +1 -2
- package/build/components/more-menu/tools-more-menu-group.js.map +1 -1
- package/build/components/notices/index.js +4 -3
- package/build/components/notices/index.js.map +1 -1
- package/build/components/save-button/index.js +4 -5
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/sidebar/index.js +89 -58
- package/build/components/sidebar/index.js.map +1 -1
- package/build/constants.js +2 -4
- package/build/constants.js.map +1 -1
- package/build/hooks/use-last-selected-widget-area.js +1 -2
- package/build/hooks/use-last-selected-widget-area.js.map +1 -1
- package/build/hooks/use-widget-library-insertion-point.js +1 -2
- package/build/hooks/use-widget-library-insertion-point.js.map +1 -1
- package/build/index.js +3 -4
- package/build/index.js.map +1 -1
- package/build/store/constants.js +1 -2
- package/build/store/constants.js.map +1 -1
- package/build/store/index.js +3 -4
- package/build/store/index.js.map +1 -1
- package/build/store/reducer.js +1 -2
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +9 -19
- package/build/store/selectors.js.map +1 -1
- package/build/store/utils.js +3 -6
- package/build/store/utils.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +0 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/notices/index.js +4 -1
- package/build-module/components/notices/index.js.map +1 -1
- package/build-module/components/save-button/index.js +3 -3
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +92 -61
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/store/selectors.js +0 -1
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +27 -86
- package/build-style/style.css +27 -86
- package/package.json +28 -28
- package/src/components/header/style.scss +39 -3
- package/src/components/notices/index.js +6 -3
- package/src/components/save-button/index.js +4 -3
- package/src/components/sidebar/index.js +138 -101
- package/src/components/sidebar/style.scss +0 -94
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_data","_notices","Notices","removeNotice","useDispatch","noticesStore","notices","useSelect","select","getNotices","dismissibleNotices","filter","isDismissible","type","nonDismissibleNotices","snackbarNotices","_react","createElement","Fragment","NoticeList","className","onRemove","SnackbarList","_default","exports","default"],"sources":["@wordpress/edit-widgets/src/components/notices/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { NoticeList, SnackbarList } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\n\nfunction Notices() {\n\tconst { removeNotice } = useDispatch( noticesStore );\n\tconst { notices } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tnotices: select( noticesStore ).getNotices(),\n\t\t};\n\t}, [] );\n\n\tconst dismissibleNotices = notices.filter(\n\t\t( { isDismissible, type } ) => isDismissible && type === 'default'\n\t);\n\tconst nonDismissibleNotices = notices.filter(\n\t\t( { isDismissible, type } ) => ! isDismissible && type === 'default'\n\t);\n\tconst snackbarNotices = notices
|
|
1
|
+
{"version":3,"names":["_components","require","_data","_notices","MAX_VISIBLE_NOTICES","Notices","removeNotice","useDispatch","noticesStore","notices","useSelect","select","getNotices","dismissibleNotices","filter","isDismissible","type","nonDismissibleNotices","snackbarNotices","slice","_react","createElement","Fragment","NoticeList","className","onRemove","SnackbarList","_default","exports","default"],"sources":["@wordpress/edit-widgets/src/components/notices/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { NoticeList, SnackbarList } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\n\n// Last three notices. Slices from the tail end of the list.\nconst MAX_VISIBLE_NOTICES = -3;\n\nfunction Notices() {\n\tconst { removeNotice } = useDispatch( noticesStore );\n\tconst { notices } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tnotices: select( noticesStore ).getNotices(),\n\t\t};\n\t}, [] );\n\n\tconst dismissibleNotices = notices.filter(\n\t\t( { isDismissible, type } ) => isDismissible && type === 'default'\n\t);\n\tconst nonDismissibleNotices = notices.filter(\n\t\t( { isDismissible, type } ) => ! isDismissible && type === 'default'\n\t);\n\tconst snackbarNotices = notices\n\t\t.filter( ( { type } ) => type === 'snackbar' )\n\t\t.slice( MAX_VISIBLE_NOTICES );\n\n\treturn (\n\t\t<>\n\t\t\t<NoticeList\n\t\t\t\tnotices={ nonDismissibleNotices }\n\t\t\t\tclassName=\"edit-widgets-notices__pinned\"\n\t\t\t/>\n\t\t\t<NoticeList\n\t\t\t\tnotices={ dismissibleNotices }\n\t\t\t\tclassName=\"edit-widgets-notices__dismissible\"\n\t\t\t\tonRemove={ removeNotice }\n\t\t\t/>\n\t\t\t<SnackbarList\n\t\t\t\tnotices={ snackbarNotices }\n\t\t\t\tclassName=\"edit-widgets-notices__snackbar\"\n\t\t\t\tonRemove={ removeNotice }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default Notices;\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AALA;AACA;AACA;;AAKA;AACA,MAAMG,mBAAmB,GAAG,CAAC,CAAC;AAE9B,SAASC,OAAOA,CAAA,EAAG;EAClB,MAAM;IAAEC;EAAa,CAAC,GAAG,IAAAC,iBAAW,EAAEC,cAAa,CAAC;EACpD,MAAM;IAAEC;EAAQ,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAC5C,OAAO;MACNF,OAAO,EAAEE,MAAM,CAAEH,cAAa,CAAC,CAACI,UAAU,CAAC;IAC5C,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAMC,kBAAkB,GAAGJ,OAAO,CAACK,MAAM,CACxC,CAAE;IAAEC,aAAa;IAAEC;EAAK,CAAC,KAAMD,aAAa,IAAIC,IAAI,KAAK,SAC1D,CAAC;EACD,MAAMC,qBAAqB,GAAGR,OAAO,CAACK,MAAM,CAC3C,CAAE;IAAEC,aAAa;IAAEC;EAAK,CAAC,KAAM,CAAED,aAAa,IAAIC,IAAI,KAAK,SAC5D,CAAC;EACD,MAAME,eAAe,GAAGT,OAAO,CAC7BK,MAAM,CAAE,CAAE;IAAEE;EAAK,CAAC,KAAMA,IAAI,KAAK,UAAW,CAAC,CAC7CG,KAAK,CAAEf,mBAAoB,CAAC;EAE9B,OACC,IAAAgB,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAE,QAAA,QACC,IAAAF,MAAA,CAAAC,aAAA,EAACrB,WAAA,CAAAuB,UAAU;IACVd,OAAO,EAAGQ,qBAAuB;IACjCO,SAAS,EAAC;EAA8B,CACxC,CAAC,EACF,IAAAJ,MAAA,CAAAC,aAAA,EAACrB,WAAA,CAAAuB,UAAU;IACVd,OAAO,EAAGI,kBAAoB;IAC9BW,SAAS,EAAC,mCAAmC;IAC7CC,QAAQ,EAAGnB;EAAc,CACzB,CAAC,EACF,IAAAc,MAAA,CAAAC,aAAA,EAACrB,WAAA,CAAA0B,YAAY;IACZjB,OAAO,EAAGS,eAAiB;IAC3BM,SAAS,EAAC,gCAAgC;IAC1CC,QAAQ,EAAGnB;EAAc,CACzB,CACA,CAAC;AAEL;AAAC,IAAAqB,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcxB,OAAO"}
|
|
@@ -34,14 +34,13 @@ function SaveButton() {
|
|
|
34
34
|
const {
|
|
35
35
|
saveEditedWidgetAreas
|
|
36
36
|
} = (0, _data.useDispatch)(_store.store);
|
|
37
|
+
const isDisabled = isSaving || !hasEditedWidgetAreaIds;
|
|
37
38
|
return (0, _react.createElement)(_components.Button, {
|
|
38
39
|
variant: "primary",
|
|
39
40
|
isBusy: isSaving,
|
|
40
|
-
"aria-disabled":
|
|
41
|
-
onClick:
|
|
42
|
-
disabled: !hasEditedWidgetAreaIds
|
|
41
|
+
"aria-disabled": isDisabled,
|
|
42
|
+
onClick: isDisabled ? undefined : saveEditedWidgetAreas
|
|
43
43
|
}, isSaving ? (0, _i18n.__)('Saving…') : (0, _i18n.__)('Update'));
|
|
44
44
|
}
|
|
45
|
-
var _default = SaveButton;
|
|
46
|
-
exports.default = _default;
|
|
45
|
+
var _default = exports.default = SaveButton;
|
|
47
46
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_i18n","_data","_store","SaveButton","hasEditedWidgetAreaIds","isSaving","useSelect","select","getEditedWidgetAreas","isSavingWidgetAreas","editWidgetsStore","length","saveEditedWidgetAreas","useDispatch","_react","createElement","Button","variant","isBusy","onClick","undefined","
|
|
1
|
+
{"version":3,"names":["_components","require","_i18n","_data","_store","SaveButton","hasEditedWidgetAreaIds","isSaving","useSelect","select","getEditedWidgetAreas","isSavingWidgetAreas","editWidgetsStore","length","saveEditedWidgetAreas","useDispatch","isDisabled","_react","createElement","Button","variant","isBusy","onClick","undefined","__","_default","exports","default"],"sources":["@wordpress/edit-widgets/src/components/save-button/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editWidgetsStore } from '../../store';\n\nfunction SaveButton() {\n\tconst { hasEditedWidgetAreaIds, isSaving } = useSelect( ( select ) => {\n\t\tconst { getEditedWidgetAreas, isSavingWidgetAreas } =\n\t\t\tselect( editWidgetsStore );\n\n\t\treturn {\n\t\t\thasEditedWidgetAreaIds: getEditedWidgetAreas()?.length > 0,\n\t\t\tisSaving: isSavingWidgetAreas(),\n\t\t};\n\t}, [] );\n\tconst { saveEditedWidgetAreas } = useDispatch( editWidgetsStore );\n\n\tconst isDisabled = isSaving || ! hasEditedWidgetAreaIds;\n\n\treturn (\n\t\t<Button\n\t\t\tvariant=\"primary\"\n\t\t\tisBusy={ isSaving }\n\t\t\taria-disabled={ isDisabled }\n\t\t\tonClick={ isDisabled ? undefined : saveEditedWidgetAreas }\n\t\t>\n\t\t\t{ isSaving ? __( 'Saving…' ) : __( 'Update' ) }\n\t\t</Button>\n\t);\n}\n\nexport default SaveButton;\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAKA,IAAAG,MAAA,GAAAH,OAAA;AAVA;AACA;AACA;;AAKA;AACA;AACA;;AAGA,SAASI,UAAUA,CAAA,EAAG;EACrB,MAAM;IAAEC,sBAAsB;IAAEC;EAAS,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACrE,MAAM;MAAEC,oBAAoB;MAAEC;IAAoB,CAAC,GAClDF,MAAM,CAAEG,YAAiB,CAAC;IAE3B,OAAO;MACNN,sBAAsB,EAAEI,oBAAoB,CAAC,CAAC,EAAEG,MAAM,GAAG,CAAC;MAC1DN,QAAQ,EAAEI,mBAAmB,CAAC;IAC/B,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,MAAM;IAAEG;EAAsB,CAAC,GAAG,IAAAC,iBAAW,EAAEH,YAAiB,CAAC;EAEjE,MAAMI,UAAU,GAAGT,QAAQ,IAAI,CAAED,sBAAsB;EAEvD,OACC,IAAAW,MAAA,CAAAC,aAAA,EAAClB,WAAA,CAAAmB,MAAM;IACNC,OAAO,EAAC,SAAS;IACjBC,MAAM,EAAGd,QAAU;IACnB,iBAAgBS,UAAY;IAC5BM,OAAO,EAAGN,UAAU,GAAGO,SAAS,GAAGT;EAAuB,GAExDP,QAAQ,GAAG,IAAAiB,QAAE,EAAE,SAAU,CAAC,GAAG,IAAAA,QAAE,EAAE,QAAS,CACrC,CAAC;AAEX;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEctB,UAAU"}
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = Sidebar;
|
|
8
8
|
var _react = require("react");
|
|
9
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
9
|
var _element = require("@wordpress/element");
|
|
11
10
|
var _i18n = require("@wordpress/i18n");
|
|
12
11
|
var _interface = require("@wordpress/interface");
|
|
@@ -16,10 +15,7 @@ var _components = require("@wordpress/components");
|
|
|
16
15
|
var _data = require("@wordpress/data");
|
|
17
16
|
var _widgetAreas = _interopRequireDefault(require("./widget-areas"));
|
|
18
17
|
var _store = require("../../store");
|
|
19
|
-
|
|
20
|
-
* External dependencies
|
|
21
|
-
*/
|
|
22
|
-
|
|
18
|
+
var _lockUnlock = require("../../lock-unlock");
|
|
23
19
|
/**
|
|
24
20
|
* WordPress dependencies
|
|
25
21
|
*/
|
|
@@ -38,29 +34,73 @@ const WIDGET_AREAS_IDENTIFIER = 'edit-widgets/block-areas';
|
|
|
38
34
|
* Internal dependencies
|
|
39
35
|
*/
|
|
40
36
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
37
|
+
const {
|
|
38
|
+
Tabs
|
|
39
|
+
} = (0, _lockUnlock.unlock)(_components.privateApis);
|
|
40
|
+
function SidebarHeader({
|
|
41
|
+
selectedWidgetAreaBlock
|
|
42
|
+
}) {
|
|
43
|
+
return (0, _react.createElement)(Tabs.TabList, null, (0, _react.createElement)(Tabs.Tab, {
|
|
44
|
+
tabId: WIDGET_AREAS_IDENTIFIER
|
|
45
|
+
}, selectedWidgetAreaBlock ? selectedWidgetAreaBlock.attributes.name : (0, _i18n.__)('Widget Areas')), (0, _react.createElement)(Tabs.Tab, {
|
|
46
|
+
tabId: BLOCK_INSPECTOR_IDENTIFIER
|
|
47
|
+
}, (0, _i18n.__)('Block')));
|
|
48
|
+
}
|
|
49
|
+
function SidebarContent({
|
|
50
|
+
hasSelectedNonAreaBlock,
|
|
51
|
+
currentArea,
|
|
52
|
+
isGeneralSidebarOpen,
|
|
53
|
+
selectedWidgetAreaBlock
|
|
45
54
|
}) {
|
|
46
55
|
const {
|
|
47
56
|
enableComplementaryArea
|
|
48
57
|
} = (0, _data.useDispatch)(_interface.store);
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
58
|
+
(0, _element.useEffect)(() => {
|
|
59
|
+
if (hasSelectedNonAreaBlock && currentArea === WIDGET_AREAS_IDENTIFIER && isGeneralSidebarOpen) {
|
|
60
|
+
enableComplementaryArea('core/edit-widgets', BLOCK_INSPECTOR_IDENTIFIER);
|
|
61
|
+
}
|
|
62
|
+
if (!hasSelectedNonAreaBlock && currentArea === BLOCK_INSPECTOR_IDENTIFIER && isGeneralSidebarOpen) {
|
|
63
|
+
enableComplementaryArea('core/edit-widgets', WIDGET_AREAS_IDENTIFIER);
|
|
64
|
+
}
|
|
65
|
+
// We're intentionally leaving `currentArea` and `isGeneralSidebarOpen`
|
|
66
|
+
// out of the dep array because we want this effect to run based on
|
|
67
|
+
// block selection changes, not sidebar state changes.
|
|
68
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
69
|
+
}, [hasSelectedNonAreaBlock, enableComplementaryArea]);
|
|
70
|
+
const tabsContextValue = (0, _element.useContext)(Tabs.Context);
|
|
71
|
+
return (0, _react.createElement)(_interface.ComplementaryArea, {
|
|
72
|
+
className: "edit-widgets-sidebar",
|
|
73
|
+
header: (0, _react.createElement)(Tabs.Context.Provider, {
|
|
74
|
+
value: tabsContextValue
|
|
75
|
+
}, (0, _react.createElement)(SidebarHeader, {
|
|
76
|
+
selectedWidgetAreaBlock: selectedWidgetAreaBlock
|
|
77
|
+
})),
|
|
78
|
+
headerClassName: "edit-widgets-sidebar__panel-tabs"
|
|
79
|
+
/* translators: button label text should, if possible, be under 16 characters. */,
|
|
80
|
+
title: (0, _i18n.__)('Settings'),
|
|
81
|
+
closeLabel: (0, _i18n.__)('Close Settings'),
|
|
82
|
+
scope: "core/edit-widgets",
|
|
83
|
+
identifier: currentArea,
|
|
84
|
+
icon: (0, _i18n.isRTL)() ? _icons.drawerLeft : _icons.drawerRight,
|
|
85
|
+
isActiveByDefault: SIDEBAR_ACTIVE_BY_DEFAULT
|
|
86
|
+
}, (0, _react.createElement)(Tabs.Context.Provider, {
|
|
87
|
+
value: tabsContextValue
|
|
88
|
+
}, (0, _react.createElement)(Tabs.TabPanel, {
|
|
89
|
+
tabId: WIDGET_AREAS_IDENTIFIER,
|
|
90
|
+
focusable: false
|
|
91
|
+
}, (0, _react.createElement)(_widgetAreas.default, {
|
|
92
|
+
selectedWidgetAreaId: selectedWidgetAreaBlock?.attributes.id
|
|
93
|
+
})), (0, _react.createElement)(Tabs.TabPanel, {
|
|
94
|
+
tabId: BLOCK_INSPECTOR_IDENTIFIER,
|
|
95
|
+
focusable: false
|
|
96
|
+
}, hasSelectedNonAreaBlock ? (0, _react.createElement)(_blockEditor.BlockInspector, null) :
|
|
97
|
+
// Pretend that Widget Areas are part of the UI by not
|
|
98
|
+
// showing the Block Inspector when one is selected.
|
|
99
|
+
(0, _react.createElement)("span", {
|
|
100
|
+
className: "block-editor-block-inspector__no-blocks"
|
|
101
|
+
}, (0, _i18n.__)('No block selected.')))));
|
|
59
102
|
}
|
|
60
103
|
function Sidebar() {
|
|
61
|
-
const {
|
|
62
|
-
enableComplementaryArea
|
|
63
|
-
} = (0, _data.useDispatch)(_interface.store);
|
|
64
104
|
const {
|
|
65
105
|
currentArea,
|
|
66
106
|
hasSelectedNonAreaBlock,
|
|
@@ -100,43 +140,34 @@ function Sidebar() {
|
|
|
100
140
|
selectedWidgetAreaBlock: widgetAreaBlock
|
|
101
141
|
};
|
|
102
142
|
}, []);
|
|
143
|
+
const {
|
|
144
|
+
enableComplementaryArea
|
|
145
|
+
} = (0, _data.useDispatch)(_interface.store);
|
|
103
146
|
|
|
104
|
-
//
|
|
105
|
-
//
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
147
|
+
// `newSelectedTabId` could technically be falsey if no tab is selected (i.e.
|
|
148
|
+
// the initial render) or when we don't want a tab displayed (i.e. the
|
|
149
|
+
// sidebar is closed). These cases should both be covered by the `!!` check
|
|
150
|
+
// below, so we shouldn't need any additional falsey handling.
|
|
151
|
+
const onTabSelect = (0, _element.useCallback)(newSelectedTabId => {
|
|
152
|
+
if (!!newSelectedTabId) {
|
|
153
|
+
enableComplementaryArea(_store.store.name, newSelectedTabId);
|
|
109
154
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
title: (0, _i18n.__)('Settings'),
|
|
128
|
-
closeLabel: (0, _i18n.__)('Close Settings'),
|
|
129
|
-
scope: "core/edit-widgets",
|
|
130
|
-
identifier: currentArea,
|
|
131
|
-
icon: (0, _i18n.isRTL)() ? _icons.drawerLeft : _icons.drawerRight,
|
|
132
|
-
isActiveByDefault: SIDEBAR_ACTIVE_BY_DEFAULT
|
|
133
|
-
}, currentArea === WIDGET_AREAS_IDENTIFIER && (0, _react.createElement)(_widgetAreas.default, {
|
|
134
|
-
selectedWidgetAreaId: selectedWidgetAreaBlock?.attributes.id
|
|
135
|
-
}), currentArea === BLOCK_INSPECTOR_IDENTIFIER && (hasSelectedNonAreaBlock ? (0, _react.createElement)(_blockEditor.BlockInspector, null) :
|
|
136
|
-
// Pretend that Widget Areas are part of the UI by not
|
|
137
|
-
// showing the Block Inspector when one is selected.
|
|
138
|
-
(0, _react.createElement)("span", {
|
|
139
|
-
className: "block-editor-block-inspector__no-blocks"
|
|
140
|
-
}, (0, _i18n.__)('No block selected.'))));
|
|
155
|
+
}, [enableComplementaryArea]);
|
|
156
|
+
return (0, _react.createElement)(Tabs
|
|
157
|
+
// Due to how this component is controlled (via a value from the
|
|
158
|
+
// `interfaceStore`), when the sidebar closes the currently selected
|
|
159
|
+
// tab can't be found. This causes the component to continuously reset
|
|
160
|
+
// the selection to `null` in an infinite loop. Proactively setting
|
|
161
|
+
// the selected tab to `null` avoids that.
|
|
162
|
+
, {
|
|
163
|
+
selectedTabId: isGeneralSidebarOpen ? currentArea : null,
|
|
164
|
+
onSelect: onTabSelect,
|
|
165
|
+
selectOnMove: false
|
|
166
|
+
}, (0, _react.createElement)(SidebarContent, {
|
|
167
|
+
hasSelectedNonAreaBlock: hasSelectedNonAreaBlock,
|
|
168
|
+
currentArea: currentArea,
|
|
169
|
+
isGeneralSidebarOpen: isGeneralSidebarOpen,
|
|
170
|
+
selectedWidgetAreaBlock: selectedWidgetAreaBlock
|
|
171
|
+
}));
|
|
141
172
|
}
|
|
142
173
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","_element","_i18n","_interface","_blockEditor","_icons","_components","_data","_widgetAreas","_store","SIDEBAR_ACTIVE_BY_DEFAULT","Platform","select","web","native","BLOCK_INSPECTOR_IDENTIFIER","WIDGET_AREAS_IDENTIFIER","ComplementaryAreaTab","identifier","label","isActive","enableComplementaryArea","useDispatch","interfaceStore","_react","createElement","Button","onClick","editWidgetsStore","name","className","classnames","sprintf","__","Sidebar","currentArea","hasSelectedNonAreaBlock","isGeneralSidebarOpen","selectedWidgetAreaBlock","useSelect","getSelectedBlock","getBlock","getBlockParentsByBlockName","blockEditorStore","getActiveComplementaryArea","selectedBlock","activeArea","currentSelection","widgetAreaBlock","clientId","useEffect","ComplementaryArea","header","attributes","headerClassName","title","closeLabel","scope","icon","isRTL","drawerLeft","drawerRight","isActiveByDefault","default","selectedWidgetAreaId","id","BlockInspector"],"sources":["@wordpress/edit-widgets/src/components/sidebar/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useEffect, Platform } from '@wordpress/element';\nimport { isRTL, __, sprintf } from '@wordpress/i18n';\nimport {\n\tComplementaryArea,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport {\n\tBlockInspector,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\n\nimport { drawerLeft, drawerRight } from '@wordpress/icons';\nimport { Button } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\n\nconst SIDEBAR_ACTIVE_BY_DEFAULT = Platform.select( {\n\tweb: true,\n\tnative: false,\n} );\n\nconst BLOCK_INSPECTOR_IDENTIFIER = 'edit-widgets/block-inspector';\n\n// Widget areas were one called block areas, so use 'edit-widgets/block-areas'\n// for backwards compatibility.\nconst WIDGET_AREAS_IDENTIFIER = 'edit-widgets/block-areas';\n\n/**\n * Internal dependencies\n */\nimport WidgetAreas from './widget-areas';\nimport { store as editWidgetsStore } from '../../store';\n\nfunction ComplementaryAreaTab( { identifier, label, isActive } ) {\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\treturn (\n\t\t<Button\n\t\t\tonClick={ () =>\n\t\t\t\tenableComplementaryArea( editWidgetsStore.name, identifier )\n\t\t\t}\n\t\t\tclassName={ classnames( 'edit-widgets-sidebar__panel-tab', {\n\t\t\t\t'is-active': isActive,\n\t\t\t} ) }\n\t\t\taria-label={\n\t\t\t\tisActive\n\t\t\t\t\t? // translators: %s: sidebar label e.g: \"Widget Areas\".\n\t\t\t\t\t sprintf( __( '%s (selected)' ), label )\n\t\t\t\t\t: label\n\t\t\t}\n\t\t\tdata-label={ label }\n\t\t>\n\t\t\t{ label }\n\t\t</Button>\n\t);\n}\n\nexport default function Sidebar() {\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\tconst {\n\t\tcurrentArea,\n\t\thasSelectedNonAreaBlock,\n\t\tisGeneralSidebarOpen,\n\t\tselectedWidgetAreaBlock,\n\t} = useSelect( ( select ) => {\n\t\tconst { getSelectedBlock, getBlock, getBlockParentsByBlockName } =\n\t\t\tselect( blockEditorStore );\n\t\tconst { getActiveComplementaryArea } = select( interfaceStore );\n\n\t\tconst selectedBlock = getSelectedBlock();\n\n\t\tconst activeArea = getActiveComplementaryArea( editWidgetsStore.name );\n\n\t\tlet currentSelection = activeArea;\n\t\tif ( ! currentSelection ) {\n\t\t\tif ( selectedBlock ) {\n\t\t\t\tcurrentSelection = BLOCK_INSPECTOR_IDENTIFIER;\n\t\t\t} else {\n\t\t\t\tcurrentSelection = WIDGET_AREAS_IDENTIFIER;\n\t\t\t}\n\t\t}\n\n\t\tlet widgetAreaBlock;\n\t\tif ( selectedBlock ) {\n\t\t\tif ( selectedBlock.name === 'core/widget-area' ) {\n\t\t\t\twidgetAreaBlock = selectedBlock;\n\t\t\t} else {\n\t\t\t\twidgetAreaBlock = getBlock(\n\t\t\t\t\tgetBlockParentsByBlockName(\n\t\t\t\t\t\tselectedBlock.clientId,\n\t\t\t\t\t\t'core/widget-area'\n\t\t\t\t\t)[ 0 ]\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tcurrentArea: currentSelection,\n\t\t\thasSelectedNonAreaBlock: !! (\n\t\t\t\tselectedBlock && selectedBlock.name !== 'core/widget-area'\n\t\t\t),\n\t\t\tisGeneralSidebarOpen: !! activeArea,\n\t\t\tselectedWidgetAreaBlock: widgetAreaBlock,\n\t\t};\n\t}, [] );\n\n\t// currentArea, and isGeneralSidebarOpen are intentionally left out from the dependencies,\n\t// because we want to run the effect when a block is selected/unselected and not when the sidebar state changes.\n\tuseEffect( () => {\n\t\tif (\n\t\t\thasSelectedNonAreaBlock &&\n\t\t\tcurrentArea === WIDGET_AREAS_IDENTIFIER &&\n\t\t\tisGeneralSidebarOpen\n\t\t) {\n\t\t\tenableComplementaryArea(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\tBLOCK_INSPECTOR_IDENTIFIER\n\t\t\t);\n\t\t}\n\t\tif (\n\t\t\t! hasSelectedNonAreaBlock &&\n\t\t\tcurrentArea === BLOCK_INSPECTOR_IDENTIFIER &&\n\t\t\tisGeneralSidebarOpen\n\t\t) {\n\t\t\tenableComplementaryArea(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\tWIDGET_AREAS_IDENTIFIER\n\t\t\t);\n\t\t}\n\t}, [ hasSelectedNonAreaBlock, enableComplementaryArea ] );\n\n\treturn (\n\t\t<ComplementaryArea\n\t\t\tclassName=\"edit-widgets-sidebar\"\n\t\t\theader={\n\t\t\t\t<ul>\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<ComplementaryAreaTab\n\t\t\t\t\t\t\tidentifier={ WIDGET_AREAS_IDENTIFIER }\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\tselectedWidgetAreaBlock\n\t\t\t\t\t\t\t\t\t? selectedWidgetAreaBlock.attributes.name\n\t\t\t\t\t\t\t\t\t: __( 'Widget Areas' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisActive={ currentArea === WIDGET_AREAS_IDENTIFIER }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<ComplementaryAreaTab\n\t\t\t\t\t\t\tidentifier={ BLOCK_INSPECTOR_IDENTIFIER }\n\t\t\t\t\t\t\tlabel={ __( 'Block' ) }\n\t\t\t\t\t\t\tisActive={\n\t\t\t\t\t\t\t\tcurrentArea === BLOCK_INSPECTOR_IDENTIFIER\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t}\n\t\t\theaderClassName=\"edit-widgets-sidebar__panel-tabs\"\n\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\ttitle={ __( 'Settings' ) }\n\t\t\tcloseLabel={ __( 'Close Settings' ) }\n\t\t\tscope=\"core/edit-widgets\"\n\t\t\tidentifier={ currentArea }\n\t\t\ticon={ isRTL() ? drawerLeft : drawerRight }\n\t\t\tisActiveByDefault={ SIDEBAR_ACTIVE_BY_DEFAULT }\n\t\t>\n\t\t\t{ currentArea === WIDGET_AREAS_IDENTIFIER && (\n\t\t\t\t<WidgetAreas\n\t\t\t\t\tselectedWidgetAreaId={\n\t\t\t\t\t\tselectedWidgetAreaBlock?.attributes.id\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ currentArea === BLOCK_INSPECTOR_IDENTIFIER &&\n\t\t\t\t( hasSelectedNonAreaBlock ? (\n\t\t\t\t\t<BlockInspector />\n\t\t\t\t) : (\n\t\t\t\t\t// Pretend that Widget Areas are part of the UI by not\n\t\t\t\t\t// showing the Block Inspector when one is selected.\n\t\t\t\t\t<span className=\"block-editor-block-inspector__no-blocks\">\n\t\t\t\t\t\t{ __( 'No block selected.' ) }\n\t\t\t\t\t</span>\n\t\t\t\t) ) }\n\t\t</ComplementaryArea>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AAIA,IAAAI,YAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AAgBA,IAAAQ,YAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AAtCA;AACA;AACA;;AAGA;AACA;AACA;;AAgBA,MAAMU,yBAAyB,GAAGC,iBAAQ,CAACC,MAAM,CAAE;EAClDC,GAAG,EAAE,IAAI;EACTC,MAAM,EAAE;AACT,CAAE,CAAC;AAEH,MAAMC,0BAA0B,GAAG,8BAA8B;;AAEjE;AACA;AACA,MAAMC,uBAAuB,GAAG,0BAA0B;;AAE1D;AACA;AACA;;AAIA,SAASC,oBAAoBA,CAAE;EAAEC,UAAU;EAAEC,KAAK;EAAEC;AAAS,CAAC,EAAG;EAChE,MAAM;IAAEC;EAAwB,CAAC,GAAG,IAAAC,iBAAW,EAAEC,gBAAe,CAAC;EACjE,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACnB,WAAA,CAAAoB,MAAM;IACNC,OAAO,EAAGA,CAAA,KACTN,uBAAuB,CAAEO,YAAgB,CAACC,IAAI,EAAEX,UAAW,CAC3D;IACDY,SAAS,EAAG,IAAAC,mBAAU,EAAE,iCAAiC,EAAE;MAC1D,WAAW,EAAEX;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AG,IAAAvB,QAAE,EAAE,gBAAiB,CAAG;IACrCwB,KAAK,EAAC,mBAAmB;IACzBvC,UAAU,EAAGiB,WAAa;IAC1BuB,IAAI,EAAG,IAAAC,WAAK,EAAC,CAAC,GAAGC,iBAAU,GAAGC,kBAAa;IAC3CC,iBAAiB,EAAGpD;EAA2B,GAE7CyB,WAAW,KAAKnB,uBAAuB,IACxC,IAAAQ,MAAA,CAAAC,aAAA,EAACjB,YAAA,CAAAuD,OAAW;IACXC,oBAAoB,EACnB1B,uBAAuB,EAAEe,UAAU,CAACY;EACpC,CACD,CACD,EACC9B,WAAW,KAAKpB,0BAA0B,KACzCqB,uBAAuB,GACxB,IAAAZ,MAAA,CAAAC,aAAA,EAACrB,YAAA,CAAA8D,cAAc,MAAE,CAAC;EAElB;EACA;EACA,IAAA1C,MAAA,CAAAC,aAAA;IAAMK,SAAS,EAAC;EAAyC,GACtD,IAAAG,QAAE,EAAE,oBAAqB,CACtB,CACN,CACgB,CAAC;AAEtB"}
|
|
1
|
+
{"version":3,"names":["_element","require","_i18n","_interface","_blockEditor","_icons","_components","_data","_widgetAreas","_interopRequireDefault","_store","_lockUnlock","SIDEBAR_ACTIVE_BY_DEFAULT","Platform","select","web","native","BLOCK_INSPECTOR_IDENTIFIER","WIDGET_AREAS_IDENTIFIER","Tabs","unlock","componentsPrivateApis","SidebarHeader","selectedWidgetAreaBlock","_react","createElement","TabList","Tab","tabId","attributes","name","__","SidebarContent","hasSelectedNonAreaBlock","currentArea","isGeneralSidebarOpen","enableComplementaryArea","useDispatch","interfaceStore","useEffect","tabsContextValue","useContext","Context","ComplementaryArea","className","header","Provider","value","headerClassName","title","closeLabel","scope","identifier","icon","isRTL","drawerLeft","drawerRight","isActiveByDefault","TabPanel","focusable","default","selectedWidgetAreaId","id","BlockInspector","Sidebar","useSelect","getSelectedBlock","getBlock","getBlockParentsByBlockName","blockEditorStore","getActiveComplementaryArea","selectedBlock","activeArea","editWidgetsStore","currentSelection","widgetAreaBlock","clientId","onTabSelect","useCallback","newSelectedTabId","selectedTabId","onSelect","selectOnMove"],"sources":["@wordpress/edit-widgets/src/components/sidebar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tuseEffect,\n\tPlatform,\n\tuseContext,\n\tuseCallback,\n} from '@wordpress/element';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport {\n\tComplementaryArea,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport {\n\tBlockInspector,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\n\nimport { drawerLeft, drawerRight } from '@wordpress/icons';\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\n\nconst SIDEBAR_ACTIVE_BY_DEFAULT = Platform.select( {\n\tweb: true,\n\tnative: false,\n} );\n\nconst BLOCK_INSPECTOR_IDENTIFIER = 'edit-widgets/block-inspector';\n\n// Widget areas were one called block areas, so use 'edit-widgets/block-areas'\n// for backwards compatibility.\nconst WIDGET_AREAS_IDENTIFIER = 'edit-widgets/block-areas';\n\n/**\n * Internal dependencies\n */\nimport WidgetAreas from './widget-areas';\nimport { store as editWidgetsStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { Tabs } = unlock( componentsPrivateApis );\n\nfunction SidebarHeader( { selectedWidgetAreaBlock } ) {\n\treturn (\n\t\t<Tabs.TabList>\n\t\t\t<Tabs.Tab tabId={ WIDGET_AREAS_IDENTIFIER }>\n\t\t\t\t{ selectedWidgetAreaBlock\n\t\t\t\t\t? selectedWidgetAreaBlock.attributes.name\n\t\t\t\t\t: __( 'Widget Areas' ) }\n\t\t\t</Tabs.Tab>\n\t\t\t<Tabs.Tab tabId={ BLOCK_INSPECTOR_IDENTIFIER }>\n\t\t\t\t{ __( 'Block' ) }\n\t\t\t</Tabs.Tab>\n\t\t</Tabs.TabList>\n\t);\n}\n\nfunction SidebarContent( {\n\thasSelectedNonAreaBlock,\n\tcurrentArea,\n\tisGeneralSidebarOpen,\n\tselectedWidgetAreaBlock,\n} ) {\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\n\tuseEffect( () => {\n\t\tif (\n\t\t\thasSelectedNonAreaBlock &&\n\t\t\tcurrentArea === WIDGET_AREAS_IDENTIFIER &&\n\t\t\tisGeneralSidebarOpen\n\t\t) {\n\t\t\tenableComplementaryArea(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\tBLOCK_INSPECTOR_IDENTIFIER\n\t\t\t);\n\t\t}\n\t\tif (\n\t\t\t! hasSelectedNonAreaBlock &&\n\t\t\tcurrentArea === BLOCK_INSPECTOR_IDENTIFIER &&\n\t\t\tisGeneralSidebarOpen\n\t\t) {\n\t\t\tenableComplementaryArea(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\tWIDGET_AREAS_IDENTIFIER\n\t\t\t);\n\t\t}\n\t\t// We're intentionally leaving `currentArea` and `isGeneralSidebarOpen`\n\t\t// out of the dep array because we want this effect to run based on\n\t\t// block selection changes, not sidebar state changes.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ hasSelectedNonAreaBlock, enableComplementaryArea ] );\n\n\tconst tabsContextValue = useContext( Tabs.Context );\n\n\treturn (\n\t\t<ComplementaryArea\n\t\t\tclassName=\"edit-widgets-sidebar\"\n\t\t\theader={\n\t\t\t\t<Tabs.Context.Provider value={ tabsContextValue }>\n\t\t\t\t\t<SidebarHeader\n\t\t\t\t\t\tselectedWidgetAreaBlock={ selectedWidgetAreaBlock }\n\t\t\t\t\t/>\n\t\t\t\t</Tabs.Context.Provider>\n\t\t\t}\n\t\t\theaderClassName=\"edit-widgets-sidebar__panel-tabs\"\n\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\ttitle={ __( 'Settings' ) }\n\t\t\tcloseLabel={ __( 'Close Settings' ) }\n\t\t\tscope=\"core/edit-widgets\"\n\t\t\tidentifier={ currentArea }\n\t\t\ticon={ isRTL() ? drawerLeft : drawerRight }\n\t\t\tisActiveByDefault={ SIDEBAR_ACTIVE_BY_DEFAULT }\n\t\t>\n\t\t\t<Tabs.Context.Provider value={ tabsContextValue }>\n\t\t\t\t<Tabs.TabPanel\n\t\t\t\t\ttabId={ WIDGET_AREAS_IDENTIFIER }\n\t\t\t\t\tfocusable={ false }\n\t\t\t\t>\n\t\t\t\t\t<WidgetAreas\n\t\t\t\t\t\tselectedWidgetAreaId={\n\t\t\t\t\t\t\tselectedWidgetAreaBlock?.attributes.id\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</Tabs.TabPanel>\n\t\t\t\t<Tabs.TabPanel\n\t\t\t\t\ttabId={ BLOCK_INSPECTOR_IDENTIFIER }\n\t\t\t\t\tfocusable={ false }\n\t\t\t\t>\n\t\t\t\t\t{ hasSelectedNonAreaBlock ? (\n\t\t\t\t\t\t<BlockInspector />\n\t\t\t\t\t) : (\n\t\t\t\t\t\t// Pretend that Widget Areas are part of the UI by not\n\t\t\t\t\t\t// showing the Block Inspector when one is selected.\n\t\t\t\t\t\t<span className=\"block-editor-block-inspector__no-blocks\">\n\t\t\t\t\t\t\t{ __( 'No block selected.' ) }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) }\n\t\t\t\t</Tabs.TabPanel>\n\t\t\t</Tabs.Context.Provider>\n\t\t</ComplementaryArea>\n\t);\n}\n\nexport default function Sidebar() {\n\tconst {\n\t\tcurrentArea,\n\t\thasSelectedNonAreaBlock,\n\t\tisGeneralSidebarOpen,\n\t\tselectedWidgetAreaBlock,\n\t} = useSelect( ( select ) => {\n\t\tconst { getSelectedBlock, getBlock, getBlockParentsByBlockName } =\n\t\t\tselect( blockEditorStore );\n\t\tconst { getActiveComplementaryArea } = select( interfaceStore );\n\n\t\tconst selectedBlock = getSelectedBlock();\n\n\t\tconst activeArea = getActiveComplementaryArea( editWidgetsStore.name );\n\n\t\tlet currentSelection = activeArea;\n\t\tif ( ! currentSelection ) {\n\t\t\tif ( selectedBlock ) {\n\t\t\t\tcurrentSelection = BLOCK_INSPECTOR_IDENTIFIER;\n\t\t\t} else {\n\t\t\t\tcurrentSelection = WIDGET_AREAS_IDENTIFIER;\n\t\t\t}\n\t\t}\n\n\t\tlet widgetAreaBlock;\n\t\tif ( selectedBlock ) {\n\t\t\tif ( selectedBlock.name === 'core/widget-area' ) {\n\t\t\t\twidgetAreaBlock = selectedBlock;\n\t\t\t} else {\n\t\t\t\twidgetAreaBlock = getBlock(\n\t\t\t\t\tgetBlockParentsByBlockName(\n\t\t\t\t\t\tselectedBlock.clientId,\n\t\t\t\t\t\t'core/widget-area'\n\t\t\t\t\t)[ 0 ]\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tcurrentArea: currentSelection,\n\t\t\thasSelectedNonAreaBlock: !! (\n\t\t\t\tselectedBlock && selectedBlock.name !== 'core/widget-area'\n\t\t\t),\n\t\t\tisGeneralSidebarOpen: !! activeArea,\n\t\t\tselectedWidgetAreaBlock: widgetAreaBlock,\n\t\t};\n\t}, [] );\n\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\n\t// `newSelectedTabId` could technically be falsey if no tab is selected (i.e.\n\t// the initial render) or when we don't want a tab displayed (i.e. the\n\t// sidebar is closed). These cases should both be covered by the `!!` check\n\t// below, so we shouldn't need any additional falsey handling.\n\tconst onTabSelect = useCallback(\n\t\t( newSelectedTabId ) => {\n\t\t\tif ( !! newSelectedTabId ) {\n\t\t\t\tenableComplementaryArea(\n\t\t\t\t\teditWidgetsStore.name,\n\t\t\t\t\tnewSelectedTabId\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\t[ enableComplementaryArea ]\n\t);\n\n\treturn (\n\t\t<Tabs\n\t\t\t// Due to how this component is controlled (via a value from the\n\t\t\t// `interfaceStore`), when the sidebar closes the currently selected\n\t\t\t// tab can't be found. This causes the component to continuously reset\n\t\t\t// the selection to `null` in an infinite loop. Proactively setting\n\t\t\t// the selected tab to `null` avoids that.\n\t\t\tselectedTabId={ isGeneralSidebarOpen ? currentArea : null }\n\t\t\tonSelect={ onTabSelect }\n\t\t\tselectOnMove={ false }\n\t\t>\n\t\t\t<SidebarContent\n\t\t\t\thasSelectedNonAreaBlock={ hasSelectedNonAreaBlock }\n\t\t\t\tcurrentArea={ currentArea }\n\t\t\t\tisGeneralSidebarOpen={ isGeneralSidebarOpen }\n\t\t\t\tselectedWidgetAreaBlock={ selectedWidgetAreaBlock }\n\t\t\t/>\n\t\t</Tabs>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAMA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAIA,IAAAG,YAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AAgBA,IAAAO,YAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,WAAA,GAAAV,OAAA;AAvCA;AACA;AACA;;AAqBA,MAAMW,yBAAyB,GAAGC,iBAAQ,CAACC,MAAM,CAAE;EAClDC,GAAG,EAAE,IAAI;EACTC,MAAM,EAAE;AACT,CAAE,CAAC;AAEH,MAAMC,0BAA0B,GAAG,8BAA8B;;AAEjE;AACA;AACA,MAAMC,uBAAuB,GAAG,0BAA0B;;AAE1D;AACA;AACA;;AAKA,MAAM;EAAEC;AAAK,CAAC,GAAG,IAAAC,kBAAM,EAAEC,uBAAsB,CAAC;AAEhD,SAASC,aAAaA,CAAE;EAAEC;AAAwB,CAAC,EAAG;EACrD,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACN,IAAI,CAACO,OAAO,QACZ,IAAAF,MAAA,CAAAC,aAAA,EAACN,IAAI,CAACQ,GAAG;IAACC,KAAK,EAAGV;EAAyB,GACxCK,uBAAuB,GACtBA,uBAAuB,CAACM,UAAU,CAACC,IAAI,GACvC,IAAAC,QAAE,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xBK,YAAY,EAAG;EAAO,GAEtB,IAAA1D,MAAA,CAAAC,aAAA,EAACO,cAAc;IACdC,uBAAuB,EAAGA,uBAAyB;IACnDC,WAAW,EAAGA,WAAa;IAC3BC,oBAAoB,EAAGA,oBAAsB;IAC7CZ,uBAAuB,EAAGA;EAAyB,CACnD,CACI,CAAC;AAET"}
|
package/build/constants.js
CHANGED
|
@@ -4,8 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.ENABLE_EXPERIMENTAL_FSE_BLOCKS = exports.ALLOW_REUSABLE_BLOCKS = void 0;
|
|
7
|
-
const ALLOW_REUSABLE_BLOCKS = false;
|
|
8
|
-
exports.
|
|
9
|
-
const ENABLE_EXPERIMENTAL_FSE_BLOCKS = false;
|
|
10
|
-
exports.ENABLE_EXPERIMENTAL_FSE_BLOCKS = ENABLE_EXPERIMENTAL_FSE_BLOCKS;
|
|
7
|
+
const ALLOW_REUSABLE_BLOCKS = exports.ALLOW_REUSABLE_BLOCKS = false;
|
|
8
|
+
const ENABLE_EXPERIMENTAL_FSE_BLOCKS = exports.ENABLE_EXPERIMENTAL_FSE_BLOCKS = false;
|
|
11
9
|
//# sourceMappingURL=constants.js.map
|
package/build/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ALLOW_REUSABLE_BLOCKS","exports","ENABLE_EXPERIMENTAL_FSE_BLOCKS"],"sources":["@wordpress/edit-widgets/src/constants.js"],"sourcesContent":["export const ALLOW_REUSABLE_BLOCKS = false;\nexport const ENABLE_EXPERIMENTAL_FSE_BLOCKS = false;\n"],"mappings":";;;;;;AAAO,MAAMA,qBAAqB,
|
|
1
|
+
{"version":3,"names":["ALLOW_REUSABLE_BLOCKS","exports","ENABLE_EXPERIMENTAL_FSE_BLOCKS"],"sources":["@wordpress/edit-widgets/src/constants.js"],"sourcesContent":["export const ALLOW_REUSABLE_BLOCKS = false;\nexport const ENABLE_EXPERIMENTAL_FSE_BLOCKS = false;\n"],"mappings":";;;;;;AAAO,MAAMA,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,GAAG,KAAK;AACnC,MAAME,8BAA8B,GAAAD,OAAA,CAAAC,8BAAA,GAAG,KAAK"}
|
|
@@ -51,6 +51,5 @@ const useLastSelectedWidgetArea = () => (0, _data.useSelect)(select => {
|
|
|
51
51
|
const widgetAreasPost = getEntityRecord(_utils.KIND, _utils.POST_TYPE, (0, _utils.buildWidgetAreasPostId)());
|
|
52
52
|
return widgetAreasPost?.blocks[0]?.clientId;
|
|
53
53
|
}, []);
|
|
54
|
-
var _default = useLastSelectedWidgetArea;
|
|
55
|
-
exports.default = _default;
|
|
54
|
+
var _default = exports.default = useLastSelectedWidgetArea;
|
|
56
55
|
//# sourceMappingURL=use-last-selected-widget-area.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_blockEditor","_coreData","_store","_utils","useLastSelectedWidgetArea","useSelect","select","getBlockSelectionEnd","getBlockName","blockEditorStore","selectionEndClientId","getParentWidgetAreaBlock","widgetsEditorStore","widgetAreaBlock","widgetAreaBlockClientId","clientId","getEntityRecord","coreStore","widgetAreasPost","KIND","POST_TYPE","buildWidgetAreasPostId","blocks","_default","exports","default"],"sources":["@wordpress/edit-widgets/src/hooks/use-last-selected-widget-area.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as widgetsEditorStore } from '../store';\nimport { buildWidgetAreasPostId, KIND, POST_TYPE } from '../store/utils';\n\n/**\n * A react hook that returns the client id of the last widget area to have\n * been selected, or to have a selected block within it.\n *\n * @return {string} clientId of the widget area last selected.\n */\nconst useLastSelectedWidgetArea = () =>\n\tuseSelect( ( select ) => {\n\t\tconst { getBlockSelectionEnd, getBlockName } =\n\t\t\tselect( blockEditorStore );\n\t\tconst selectionEndClientId = getBlockSelectionEnd();\n\n\t\t// If the selected block is a widget area, return its clientId.\n\t\tif ( getBlockName( selectionEndClientId ) === 'core/widget-area' ) {\n\t\t\treturn selectionEndClientId;\n\t\t}\n\n\t\tconst { getParentWidgetAreaBlock } = select( widgetsEditorStore );\n\t\tconst widgetAreaBlock =\n\t\t\tgetParentWidgetAreaBlock( selectionEndClientId );\n\t\tconst widgetAreaBlockClientId = widgetAreaBlock?.clientId;\n\n\t\tif ( widgetAreaBlockClientId ) {\n\t\t\treturn widgetAreaBlockClientId;\n\t\t}\n\n\t\t// If no widget area has been selected, return the clientId of the first\n\t\t// area.\n\t\tconst { getEntityRecord } = select( coreStore );\n\t\tconst widgetAreasPost = getEntityRecord(\n\t\t\tKIND,\n\t\t\tPOST_TYPE,\n\t\t\tbuildWidgetAreasPostId()\n\t\t);\n\t\treturn widgetAreasPost?.blocks[ 0 ]?.clientId;\n\t}, [] );\n\nexport default useLastSelectedWidgetArea;\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAKA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAXA;AACA;AACA;;AAKA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMK,yBAAyB,GAAGA,CAAA,KACjC,IAAAC,eAAS,EAAIC,MAAM,IAAM;EACxB,MAAM;IAAEC,oBAAoB;IAAEC;EAAa,CAAC,GAC3CF,MAAM,CAAEG,kBAAiB,CAAC;EAC3B,MAAMC,oBAAoB,GAAGH,oBAAoB,CAAC,CAAC;;EAEnD;EACA,IAAKC,YAAY,CAAEE,oBAAqB,CAAC,KAAK,kBAAkB,EAAG;IAClE,OAAOA,oBAAoB;EAC5B;EAEA,MAAM;IAAEC;EAAyB,CAAC,GAAGL,MAAM,CAAEM,YAAmB,CAAC;EACjE,MAAMC,eAAe,GACpBF,wBAAwB,CAAED,oBAAqB,CAAC;EACjD,MAAMI,uBAAuB,GAAGD,eAAe,EAAEE,QAAQ;EAEzD,IAAKD,uBAAuB,EAAG;IAC9B,OAAOA,uBAAuB;EAC/B;;EAEA;EACA;EACA,MAAM;IAAEE;EAAgB,CAAC,GAAGV,MAAM,CAAEW,eAAU,CAAC;EAC/C,MAAMC,eAAe,GAAGF,eAAe,CACtCG,WAAI,EACJC,gBAAS,EACT,IAAAC,6BAAsB,EAAC,CACxB,CAAC;EACD,OAAOH,eAAe,EAAEI,MAAM,CAAE,CAAC,CAAE,EAAEP,QAAQ;AAC9C,CAAC,EAAE,EAAG,CAAC;AAAC,IAAAQ,QAAA,
|
|
1
|
+
{"version":3,"names":["_data","require","_blockEditor","_coreData","_store","_utils","useLastSelectedWidgetArea","useSelect","select","getBlockSelectionEnd","getBlockName","blockEditorStore","selectionEndClientId","getParentWidgetAreaBlock","widgetsEditorStore","widgetAreaBlock","widgetAreaBlockClientId","clientId","getEntityRecord","coreStore","widgetAreasPost","KIND","POST_TYPE","buildWidgetAreasPostId","blocks","_default","exports","default"],"sources":["@wordpress/edit-widgets/src/hooks/use-last-selected-widget-area.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as widgetsEditorStore } from '../store';\nimport { buildWidgetAreasPostId, KIND, POST_TYPE } from '../store/utils';\n\n/**\n * A react hook that returns the client id of the last widget area to have\n * been selected, or to have a selected block within it.\n *\n * @return {string} clientId of the widget area last selected.\n */\nconst useLastSelectedWidgetArea = () =>\n\tuseSelect( ( select ) => {\n\t\tconst { getBlockSelectionEnd, getBlockName } =\n\t\t\tselect( blockEditorStore );\n\t\tconst selectionEndClientId = getBlockSelectionEnd();\n\n\t\t// If the selected block is a widget area, return its clientId.\n\t\tif ( getBlockName( selectionEndClientId ) === 'core/widget-area' ) {\n\t\t\treturn selectionEndClientId;\n\t\t}\n\n\t\tconst { getParentWidgetAreaBlock } = select( widgetsEditorStore );\n\t\tconst widgetAreaBlock =\n\t\t\tgetParentWidgetAreaBlock( selectionEndClientId );\n\t\tconst widgetAreaBlockClientId = widgetAreaBlock?.clientId;\n\n\t\tif ( widgetAreaBlockClientId ) {\n\t\t\treturn widgetAreaBlockClientId;\n\t\t}\n\n\t\t// If no widget area has been selected, return the clientId of the first\n\t\t// area.\n\t\tconst { getEntityRecord } = select( coreStore );\n\t\tconst widgetAreasPost = getEntityRecord(\n\t\t\tKIND,\n\t\t\tPOST_TYPE,\n\t\t\tbuildWidgetAreasPostId()\n\t\t);\n\t\treturn widgetAreasPost?.blocks[ 0 ]?.clientId;\n\t}, [] );\n\nexport default useLastSelectedWidgetArea;\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAKA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAXA;AACA;AACA;;AAKA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMK,yBAAyB,GAAGA,CAAA,KACjC,IAAAC,eAAS,EAAIC,MAAM,IAAM;EACxB,MAAM;IAAEC,oBAAoB;IAAEC;EAAa,CAAC,GAC3CF,MAAM,CAAEG,kBAAiB,CAAC;EAC3B,MAAMC,oBAAoB,GAAGH,oBAAoB,CAAC,CAAC;;EAEnD;EACA,IAAKC,YAAY,CAAEE,oBAAqB,CAAC,KAAK,kBAAkB,EAAG;IAClE,OAAOA,oBAAoB;EAC5B;EAEA,MAAM;IAAEC;EAAyB,CAAC,GAAGL,MAAM,CAAEM,YAAmB,CAAC;EACjE,MAAMC,eAAe,GACpBF,wBAAwB,CAAED,oBAAqB,CAAC;EACjD,MAAMI,uBAAuB,GAAGD,eAAe,EAAEE,QAAQ;EAEzD,IAAKD,uBAAuB,EAAG;IAC9B,OAAOA,uBAAuB;EAC/B;;EAEA;EACA;EACA,MAAM;IAAEE;EAAgB,CAAC,GAAGV,MAAM,CAAEW,eAAU,CAAC;EAC/C,MAAMC,eAAe,GAAGF,eAAe,CACtCG,WAAI,EACJC,gBAAS,EACT,IAAAC,6BAAsB,EAAC,CACxB,CAAC;EACD,OAAOH,eAAe,EAAEI,MAAM,CAAE,CAAC,CAAE,EAAEP,QAAQ;AAC9C,CAAC,EAAE,EAAG,CAAC;AAAC,IAAAQ,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEMrB,yBAAyB"}
|
|
@@ -58,6 +58,5 @@ const useWidgetLibraryInsertionPoint = () => {
|
|
|
58
58
|
};
|
|
59
59
|
}, [firstRootId]);
|
|
60
60
|
};
|
|
61
|
-
var _default = useWidgetLibraryInsertionPoint;
|
|
62
|
-
exports.default = _default;
|
|
61
|
+
var _default = exports.default = useWidgetLibraryInsertionPoint;
|
|
63
62
|
//# sourceMappingURL=use-widget-library-insertion-point.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_blockEditor","_coreData","_store","_utils","useWidgetLibraryInsertionPoint","firstRootId","useSelect","select","getEntityRecord","coreStore","widgetAreasPost","KIND","POST_TYPE","buildWidgetAreasPostId","blocks","clientId","getBlockRootClientId","getBlockSelectionEnd","getBlockOrder","getBlockIndex","blockEditorStore","insertionPoint","editWidgetsStore","__experimentalGetInsertionPoint","rootClientId","insertionIndex","length","_default","exports","default"],"sources":["@wordpress/edit-widgets/src/hooks/use-widget-library-insertion-point.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editWidgetsStore } from '../store';\nimport { buildWidgetAreasPostId, KIND, POST_TYPE } from '../store/utils';\n\nconst useWidgetLibraryInsertionPoint = () => {\n\tconst firstRootId = useSelect( ( select ) => {\n\t\t// Default to the first widget area\n\t\tconst { getEntityRecord } = select( coreStore );\n\t\tconst widgetAreasPost = getEntityRecord(\n\t\t\tKIND,\n\t\t\tPOST_TYPE,\n\t\t\tbuildWidgetAreasPostId()\n\t\t);\n\t\treturn widgetAreasPost?.blocks[ 0 ]?.clientId;\n\t}, [] );\n\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tgetBlockSelectionEnd,\n\t\t\t\tgetBlockOrder,\n\t\t\t\tgetBlockIndex,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tconst insertionPoint =\n\t\t\t\tselect( editWidgetsStore ).__experimentalGetInsertionPoint();\n\n\t\t\t// \"Browse all\" in the quick inserter will set the rootClientId to the current block.\n\t\t\t// Otherwise, it will just be undefined, and we'll have to handle it differently below.\n\t\t\tif ( insertionPoint.rootClientId ) {\n\t\t\t\treturn insertionPoint;\n\t\t\t}\n\n\t\t\tconst clientId = getBlockSelectionEnd() || firstRootId;\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\n\t\t\t// If the selected block is at the root level, it's a widget area and\n\t\t\t// blocks can't be inserted here. Return this block as the root and the\n\t\t\t// last child clientId indicating insertion at the end.\n\t\t\tif ( clientId && rootClientId === '' ) {\n\t\t\t\treturn {\n\t\t\t\t\trootClientId: clientId,\n\t\t\t\t\tinsertionIndex: getBlockOrder( clientId ).length,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\trootClientId,\n\t\t\t\tinsertionIndex: getBlockIndex( clientId ) + 1,\n\t\t\t};\n\t\t},\n\t\t[ firstRootId ]\n\t);\n};\n\nexport default useWidgetLibraryInsertionPoint;\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAKA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":3,"names":["_data","require","_blockEditor","_coreData","_store","_utils","useWidgetLibraryInsertionPoint","firstRootId","useSelect","select","getEntityRecord","coreStore","widgetAreasPost","KIND","POST_TYPE","buildWidgetAreasPostId","blocks","clientId","getBlockRootClientId","getBlockSelectionEnd","getBlockOrder","getBlockIndex","blockEditorStore","insertionPoint","editWidgetsStore","__experimentalGetInsertionPoint","rootClientId","insertionIndex","length","_default","exports","default"],"sources":["@wordpress/edit-widgets/src/hooks/use-widget-library-insertion-point.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editWidgetsStore } from '../store';\nimport { buildWidgetAreasPostId, KIND, POST_TYPE } from '../store/utils';\n\nconst useWidgetLibraryInsertionPoint = () => {\n\tconst firstRootId = useSelect( ( select ) => {\n\t\t// Default to the first widget area\n\t\tconst { getEntityRecord } = select( coreStore );\n\t\tconst widgetAreasPost = getEntityRecord(\n\t\t\tKIND,\n\t\t\tPOST_TYPE,\n\t\t\tbuildWidgetAreasPostId()\n\t\t);\n\t\treturn widgetAreasPost?.blocks[ 0 ]?.clientId;\n\t}, [] );\n\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tgetBlockSelectionEnd,\n\t\t\t\tgetBlockOrder,\n\t\t\t\tgetBlockIndex,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tconst insertionPoint =\n\t\t\t\tselect( editWidgetsStore ).__experimentalGetInsertionPoint();\n\n\t\t\t// \"Browse all\" in the quick inserter will set the rootClientId to the current block.\n\t\t\t// Otherwise, it will just be undefined, and we'll have to handle it differently below.\n\t\t\tif ( insertionPoint.rootClientId ) {\n\t\t\t\treturn insertionPoint;\n\t\t\t}\n\n\t\t\tconst clientId = getBlockSelectionEnd() || firstRootId;\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\n\t\t\t// If the selected block is at the root level, it's a widget area and\n\t\t\t// blocks can't be inserted here. Return this block as the root and the\n\t\t\t// last child clientId indicating insertion at the end.\n\t\t\tif ( clientId && rootClientId === '' ) {\n\t\t\t\treturn {\n\t\t\t\t\trootClientId: clientId,\n\t\t\t\t\tinsertionIndex: getBlockOrder( clientId ).length,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\trootClientId,\n\t\t\t\tinsertionIndex: getBlockIndex( clientId ) + 1,\n\t\t\t};\n\t\t},\n\t\t[ firstRootId ]\n\t);\n};\n\nexport default useWidgetLibraryInsertionPoint;\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAKA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAXA;AACA;AACA;;AAKA;AACA;AACA;;AAIA,MAAMK,8BAA8B,GAAGA,CAAA,KAAM;EAC5C,MAAMC,WAAW,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAC5C;IACA,MAAM;MAAEC;IAAgB,CAAC,GAAGD,MAAM,CAAEE,eAAU,CAAC;IAC/C,MAAMC,eAAe,GAAGF,eAAe,CACtCG,WAAI,EACJC,gBAAS,EACT,IAAAC,6BAAsB,EAAC,CACxB,CAAC;IACD,OAAOH,eAAe,EAAEI,MAAM,CAAE,CAAC,CAAE,EAAEC,QAAQ;EAC9C,CAAC,EAAE,EAAG,CAAC;EAEP,OAAO,IAAAT,eAAS,EACbC,MAAM,IAAM;IACb,MAAM;MACLS,oBAAoB;MACpBC,oBAAoB;MACpBC,aAAa;MACbC;IACD,CAAC,GAAGZ,MAAM,CAAEa,kBAAiB,CAAC;IAE9B,MAAMC,cAAc,GACnBd,MAAM,CAAEe,YAAiB,CAAC,CAACC,+BAA+B,CAAC,CAAC;;IAE7D;IACA;IACA,IAAKF,cAAc,CAACG,YAAY,EAAG;MAClC,OAAOH,cAAc;IACtB;IAEA,MAAMN,QAAQ,GAAGE,oBAAoB,CAAC,CAAC,IAAIZ,WAAW;IACtD,MAAMmB,YAAY,GAAGR,oBAAoB,CAAED,QAAS,CAAC;;IAErD;IACA;IACA;IACA,IAAKA,QAAQ,IAAIS,YAAY,KAAK,EAAE,EAAG;MACtC,OAAO;QACNA,YAAY,EAAET,QAAQ;QACtBU,cAAc,EAAEP,aAAa,CAAEH,QAAS,CAAC,CAACW;MAC3C,CAAC;IACF;IAEA,OAAO;MACNF,YAAY;MACZC,cAAc,EAAEN,aAAa,CAAEJ,QAAS,CAAC,GAAG;IAC7C,CAAC;EACF,CAAC,EACD,CAAEV,WAAW,CACd,CAAC;AACF,CAAC;AAAC,IAAAsB,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEazB,8BAA8B"}
|
package/build/index.js
CHANGED
|
@@ -27,8 +27,8 @@ require("./filters");
|
|
|
27
27
|
var widgetArea = _interopRequireWildcard(require("./blocks/widget-area"));
|
|
28
28
|
var _layout = _interopRequireDefault(require("./components/layout"));
|
|
29
29
|
var _constants = require("./constants");
|
|
30
|
-
function _getRequireWildcardCache(
|
|
31
|
-
function _interopRequireWildcard(
|
|
30
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
31
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
32
32
|
/**
|
|
33
33
|
* WordPress dependencies
|
|
34
34
|
*/
|
|
@@ -84,8 +84,7 @@ function initializeEditor(id, settings) {
|
|
|
84
84
|
/**
|
|
85
85
|
* Compatibility export under the old `initialize` name.
|
|
86
86
|
*/
|
|
87
|
-
const initialize = initializeEditor;
|
|
88
|
-
exports.initialize = initialize;
|
|
87
|
+
const initialize = exports.initialize = initializeEditor;
|
|
89
88
|
function reinitializeEditor() {
|
|
90
89
|
(0, _deprecated.default)('wp.editWidgets.reinitializeEditor', {
|
|
91
90
|
since: '6.2',
|
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","_getRequireWildcardCache","
|
|
1
|
+
{"version":3,"names":["_blocks","require","_data","_deprecated","_interopRequireDefault","_element","_blockLibrary","_coreData","_widgets","_preferences","_store","widgetArea","_interopRequireWildcard","_layout","_constants","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","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","process","env","IS_GUTENBERG_PLUGIN","__experimentalRegisterExperimentalCoreBlocks","enableFSEBlocks","ENABLE_EXPERIMENTAL_FSE_BLOCKS","registerLegacyWidgetVariations","registerBlock","registerWidgetGroupBlock","__experimentalFetchLinkSuggestions","search","searchOptions","fetchLinkSuggestions","setFreeformContentHandlerName","render","_react","createElement","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 { 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';\n\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\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\tregisterLegacyWidgetBlock();\n\tif ( process.env.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( <Layout blockEditorSettings={ settings } /> );\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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EACA,IAAAE,yBAAiB,EAAEvC,IAAI,EAAEX,QAAS,CAAC;AACpC,CAAC"}
|
package/build/store/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["STORE_NAME","exports"],"sources":["@wordpress/edit-widgets/src/store/constants.js"],"sourcesContent":["/**\n * Module Constants\n */\nexport const STORE_NAME = 'core/edit-widgets';\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACO,MAAMA,UAAU,
|
|
1
|
+
{"version":3,"names":["STORE_NAME","exports"],"sources":["@wordpress/edit-widgets/src/store/constants.js"],"sourcesContent":["/**\n * Module Constants\n */\nexport const STORE_NAME = 'core/edit-widgets';\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACO,MAAMA,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAG,mBAAmB"}
|
package/build/store/index.js
CHANGED
|
@@ -14,8 +14,8 @@ var actions = _interopRequireWildcard(require("./actions"));
|
|
|
14
14
|
var privateSelectors = _interopRequireWildcard(require("./private-selectors"));
|
|
15
15
|
var _constants = require("./constants");
|
|
16
16
|
var _lockUnlock = require("../lock-unlock");
|
|
17
|
-
function _getRequireWildcardCache(
|
|
18
|
-
function _interopRequireWildcard(
|
|
17
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
18
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
19
19
|
/**
|
|
20
20
|
* WordPress dependencies
|
|
21
21
|
*/
|
|
@@ -45,8 +45,7 @@ const storeConfig = {
|
|
|
45
45
|
*
|
|
46
46
|
* @type {Object}
|
|
47
47
|
*/
|
|
48
|
-
const store = (0, _data.createReduxStore)(_constants.STORE_NAME, storeConfig);
|
|
49
|
-
exports.store = store;
|
|
48
|
+
const store = exports.store = (0, _data.createReduxStore)(_constants.STORE_NAME, storeConfig);
|
|
50
49
|
(0, _data.register)(store);
|
|
51
50
|
|
|
52
51
|
// This package uses a few in-memory post types as wrappers for convenience.
|
package/build/store/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_apiFetch","_interopRequireDefault","require","_data","_reducer","resolvers","_interopRequireWildcard","selectors","actions","privateSelectors","_constants","_lockUnlock","_getRequireWildcardCache","
|
|
1
|
+
{"version":3,"names":["_apiFetch","_interopRequireDefault","require","_data","_reducer","resolvers","_interopRequireWildcard","selectors","actions","privateSelectors","_constants","_lockUnlock","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","storeConfig","reducer","store","exports","createReduxStore","STORE_NAME","register","apiFetch","use","options","next","path","indexOf","Promise","resolve","unlock","registerPrivateSelectors"],"sources":["@wordpress/edit-widgets/src/store/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\nimport { createReduxStore, register } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as resolvers from './resolvers';\nimport * as selectors from './selectors';\nimport * as actions from './actions';\nimport * as privateSelectors from './private-selectors';\nimport { STORE_NAME } from './constants';\nimport { unlock } from '../lock-unlock';\n\n/**\n * Block editor data store configuration.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#register\n *\n * @type {Object}\n */\nconst storeConfig = {\n\treducer,\n\tselectors,\n\tresolvers,\n\tactions,\n};\n\n/**\n * Store definition for the edit widgets namespace.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore\n *\n * @type {Object}\n */\nexport const store = createReduxStore( STORE_NAME, storeConfig );\nregister( store );\n\n// This package uses a few in-memory post types as wrappers for convenience.\n// This middleware prevents any network requests related to these types as they are\n// bound to fail anyway.\napiFetch.use( function ( options, next ) {\n\tif ( options.path?.indexOf( '/wp/v2/types/widget-area' ) === 0 ) {\n\t\treturn Promise.resolve( {} );\n\t}\n\n\treturn next( options );\n} );\n\nunlock( store ).registerPrivateSelectors( privateSelectors );\n"],"mappings":";;;;;;;AAGA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,QAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,SAAA,GAAAC,uBAAA,CAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAD,uBAAA,CAAAJ,OAAA;AACA,IAAAM,OAAA,GAAAF,uBAAA,CAAAJ,OAAA;AACA,IAAAO,gBAAA,GAAAH,uBAAA,CAAAJ,OAAA;AACA,IAAAQ,UAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AAAwC,SAAAU,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAP,wBAAAO,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,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I,CAAED,OAAQ,CAAC;AACvB,CAAE,CAAC;AAEH,IAAAM,kBAAM,EAAEb,KAAM,CAAC,CAACc,wBAAwB,CAAExC,gBAAiB,CAAC"}
|
package/build/store/reducer.js
CHANGED
|
@@ -98,10 +98,9 @@ function listViewToggleRef(state = {
|
|
|
98
98
|
}) {
|
|
99
99
|
return state;
|
|
100
100
|
}
|
|
101
|
-
var _default = (0, _data.combineReducers)({
|
|
101
|
+
var _default = exports.default = (0, _data.combineReducers)({
|
|
102
102
|
blockInserterPanel,
|
|
103
103
|
listViewPanel,
|
|
104
104
|
widgetAreasOpenState
|
|
105
105
|
});
|
|
106
|
-
exports.default = _default;
|
|
107
106
|
//# sourceMappingURL=reducer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","widgetAreasOpenState","state","action","type","clientId","isOpen","blockInserterPanel","value","listViewPanel","listViewToggleRef","current","_default","
|
|
1
|
+
{"version":3,"names":["_data","require","widgetAreasOpenState","state","action","type","clientId","isOpen","blockInserterPanel","value","listViewPanel","listViewToggleRef","current","_default","exports","default","combineReducers"],"sources":["@wordpress/edit-widgets/src/store/reducer.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Controls the open state of the widget areas.\n *\n * @param {Object} state Redux state.\n * @param {Object} action Redux action.\n *\n * @return {Array} Updated state.\n */\nexport function widgetAreasOpenState( state = {}, action ) {\n\tconst { type } = action;\n\tswitch ( type ) {\n\t\tcase 'SET_WIDGET_AREAS_OPEN_STATE': {\n\t\t\treturn action.widgetAreasOpenState;\n\t\t}\n\t\tcase 'SET_IS_WIDGET_AREA_OPEN': {\n\t\t\tconst { clientId, isOpen } = action;\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ clientId ]: isOpen,\n\t\t\t};\n\t\t}\n\t\tdefault: {\n\t\t\treturn state;\n\t\t}\n\t}\n}\n\n/**\n * Reducer to set the block inserter panel open or closed.\n *\n * Note: this reducer interacts with the list view panel reducer\n * to make sure that only one of the two panels is open at the same time.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function blockInserterPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_LIST_VIEW_OPENED':\n\t\t\treturn action.isOpen ? false : state;\n\t\tcase 'SET_IS_INSERTER_OPENED':\n\t\t\treturn action.value;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer to set the list view panel open or closed.\n *\n * Note: this reducer interacts with the inserter panel reducer\n * to make sure that only one of the two panels is open at the same time.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function listViewPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_INSERTER_OPENED':\n\t\t\treturn action.value ? false : state;\n\t\tcase 'SET_IS_LIST_VIEW_OPENED':\n\t\t\treturn action.isOpen;\n\t}\n\treturn state;\n}\n\n/**\n * This reducer does nothing aside initializing a ref to the list view toggle.\n * We will have a unique ref per \"editor\" instance.\n *\n * @param {Object} state\n * @return {Object} Reference to the list view toggle button.\n */\nexport function listViewToggleRef( state = { current: null } ) {\n\treturn state;\n}\n\nexport default combineReducers( {\n\tblockInserterPanel,\n\tlistViewPanel,\n\twidgetAreasOpenState,\n} );\n"],"mappings":";;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,oBAAoBA,CAAEC,KAAK,GAAG,CAAC,CAAC,EAAEC,MAAM,EAAG;EAC1D,MAAM;IAAEC;EAAK,CAAC,GAAGD,MAAM;EACvB,QAASC,IAAI;IACZ,KAAK,6BAA6B;MAAE;QACnC,OAAOD,MAAM,CAACF,oBAAoB;MACnC;IACA,KAAK,yBAAyB;MAAE;QAC/B,MAAM;UAAEI,QAAQ;UAAEC;QAAO,CAAC,GAAGH,MAAM;QACnC,OAAO;UACN,GAAGD,KAAK;UACR,CAAE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