@webiny/app-admin-ui 0.0.0-unstable.a4f3e4ea8b → 0.0.0-unstable.a85ef555b2
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/Breadcrumbs/Breadcrumbs.d.ts +14 -0
- package/Breadcrumbs/Breadcrumbs.js +74 -0
- package/Breadcrumbs/Breadcrumbs.js.map +1 -0
- package/CommandPalette/CommandPalette.d.ts +2 -2
- package/CommandPalette/CommandPalette.js +106 -75
- package/CommandPalette/CommandPalette.js.map +1 -1
- package/CommandPalette/components/AiModeBadge.d.ts +3 -0
- package/CommandPalette/components/AiModeBadge.js +11 -0
- package/CommandPalette/components/AiModeBadge.js.map +1 -0
- package/CommandPalette/components/AiSuggestions.d.ts +9 -0
- package/CommandPalette/components/AiSuggestions.js +32 -0
- package/CommandPalette/components/AiSuggestions.js.map +1 -0
- package/CommandPalette/components/AiTurn.d.ts +11 -0
- package/CommandPalette/components/AiTurn.js +61 -0
- package/CommandPalette/components/AiTurn.js.map +1 -0
- package/CommandPalette/components/AnswerSkeleton.d.ts +6 -0
- package/CommandPalette/components/AnswerSkeleton.js +20 -0
- package/CommandPalette/components/AnswerSkeleton.js.map +1 -0
- package/CommandPalette/components/ApprovalPlan.d.ts +16 -0
- package/CommandPalette/components/ApprovalPlan.js +56 -0
- package/CommandPalette/components/ApprovalPlan.js.map +1 -0
- package/CommandPalette/components/CommandItemRow.js +4 -2
- package/CommandPalette/components/CommandItemRow.js.map +1 -1
- package/CommandPalette/components/NoResults.d.ts +13 -0
- package/CommandPalette/components/NoResults.js +33 -0
- package/CommandPalette/components/NoResults.js.map +1 -0
- package/CommandPalette/components/PaletteFooter.d.ts +13 -0
- package/CommandPalette/components/PaletteFooter.js +18 -0
- package/CommandPalette/components/PaletteFooter.js.map +1 -0
- package/CommandPalette/components/ToolChip.d.ts +7 -0
- package/CommandPalette/components/ToolChip.js +32 -0
- package/CommandPalette/components/ToolChip.js.map +1 -0
- package/CommandPalette/components/index.d.ts +13 -5
- package/CommandPalette/components/index.js +13 -5
- package/CommandPalette/modes/PaletteMode.d.ts +73 -0
- package/CommandPalette/modes/PaletteMode.js +0 -0
- package/CommandPalette/modes/createAiMode.d.ts +13 -0
- package/CommandPalette/modes/createAiMode.js +80 -0
- package/CommandPalette/modes/createAiMode.js.map +1 -0
- package/CommandPalette/modes/index.d.ts +2 -0
- package/CommandPalette/modes/index.js +1 -0
- package/CommandPalette/usePaletteHotkeys.d.ts +16 -0
- package/CommandPalette/usePaletteHotkeys.js +38 -0
- package/CommandPalette/usePaletteHotkeys.js.map +1 -0
- package/Dashboard/Welcome.d.ts +4 -1
- package/Dashboard/Welcome.js +111 -24
- package/Dashboard/Welcome.js.map +1 -1
- package/Dashboard/components/DashboardToolbar.d.ts +11 -0
- package/Dashboard/components/DashboardToolbar.js +48 -0
- package/Dashboard/components/DashboardToolbar.js.map +1 -0
- package/Dashboard/components/addWidgetDrawer/AddToColumnMenu.d.ts +10 -0
- package/Dashboard/components/addWidgetDrawer/AddToColumnMenu.js +30 -0
- package/Dashboard/components/addWidgetDrawer/AddToColumnMenu.js.map +1 -0
- package/Dashboard/components/addWidgetDrawer/AddWidgetDrawer.d.ts +12 -0
- package/Dashboard/components/addWidgetDrawer/AddWidgetDrawer.js +61 -0
- package/Dashboard/components/addWidgetDrawer/AddWidgetDrawer.js.map +1 -0
- package/Dashboard/components/addWidgetDrawer/DrawerWidgetRow.d.ts +10 -0
- package/Dashboard/components/addWidgetDrawer/DrawerWidgetRow.js +38 -0
- package/Dashboard/components/addWidgetDrawer/DrawerWidgetRow.js.map +1 -0
- package/Dashboard/components/addWidgetDrawer/WidgetPreviewFrame.d.ts +7 -0
- package/Dashboard/components/addWidgetDrawer/WidgetPreviewFrame.js +44 -0
- package/Dashboard/components/addWidgetDrawer/WidgetPreviewFrame.js.map +1 -0
- package/Dashboard/components/addWidgetDrawer/WidgetSketch.d.ts +4 -0
- package/Dashboard/components/addWidgetDrawer/WidgetSketch.js +20 -0
- package/Dashboard/components/addWidgetDrawer/WidgetSketch.js.map +1 -0
- package/Dashboard/components/addWidgetDrawer/WidgetTabContent.d.ts +14 -0
- package/Dashboard/components/addWidgetDrawer/WidgetTabContent.js +76 -0
- package/Dashboard/components/addWidgetDrawer/WidgetTabContent.js.map +1 -0
- package/Dashboard/components/addWidgetDrawer/types.d.ts +10 -0
- package/Dashboard/components/addWidgetDrawer/types.js +0 -0
- package/Dashboard/components/dnd/ColumnCountControl.d.ts +9 -0
- package/Dashboard/components/dnd/ColumnCountControl.js +52 -0
- package/Dashboard/components/dnd/ColumnCountControl.js.map +1 -0
- package/Dashboard/components/dnd/ColumnEmptyState.d.ts +10 -0
- package/Dashboard/components/dnd/ColumnEmptyState.js +52 -0
- package/Dashboard/components/dnd/ColumnEmptyState.js.map +1 -0
- package/Dashboard/components/dnd/DashboardDragLayer.d.ts +6 -0
- package/Dashboard/components/dnd/DashboardDragLayer.js +28 -0
- package/Dashboard/components/dnd/DashboardDragLayer.js.map +1 -0
- package/Dashboard/components/dnd/DashboardWidgetCard.d.ts +13 -0
- package/Dashboard/components/dnd/DashboardWidgetCard.js +59 -0
- package/Dashboard/components/dnd/DashboardWidgetCard.js.map +1 -0
- package/Dashboard/components/dnd/DashboardWidgetColumn.d.ts +19 -0
- package/Dashboard/components/dnd/DashboardWidgetColumn.js +72 -0
- package/Dashboard/components/dnd/DashboardWidgetColumn.js.map +1 -0
- package/Dashboard/components/dnd/WidgetDropIndicator.d.ts +11 -0
- package/Dashboard/components/dnd/WidgetDropIndicator.js +29 -0
- package/Dashboard/components/dnd/WidgetDropIndicator.js.map +1 -0
- package/Dashboard/components/dnd/WidgetSlot.d.ts +6 -0
- package/Dashboard/components/dnd/WidgetSlot.js +9 -0
- package/Dashboard/components/dnd/WidgetSlot.js.map +1 -0
- package/Dashboard/components/dnd/dragItem.d.ts +6 -0
- package/Dashboard/components/dnd/dragItem.js +4 -0
- package/Dashboard/components/dnd/dragItem.js.map +1 -0
- package/Dashboard/components/dnd/useWidgetHosts.d.ts +1 -0
- package/Dashboard/components/dnd/useWidgetHosts.js +16 -0
- package/Dashboard/components/dnd/useWidgetHosts.js.map +1 -0
- package/Dashboard/components/layout/EditableColumns.d.ts +13 -0
- package/Dashboard/components/layout/EditableColumns.js +25 -0
- package/Dashboard/components/layout/EditableColumns.js.map +1 -0
- package/Dashboard/components/layout/StaticColumns.d.ts +8 -0
- package/Dashboard/components/layout/StaticColumns.js +20 -0
- package/Dashboard/components/layout/StaticColumns.js.map +1 -0
- package/Dashboard/components/layout/collapseColumns.d.ts +1 -0
- package/Dashboard/components/layout/collapseColumns.js +16 -0
- package/Dashboard/components/layout/collapseColumns.js.map +1 -0
- package/Dashboard/components/layout/layoutConstants.d.ts +2 -0
- package/Dashboard/components/layout/layoutConstants.js +5 -0
- package/Dashboard/components/layout/layoutConstants.js.map +1 -0
- package/Dashboard/components/layout/useColumnsThatFit.d.ts +6 -0
- package/Dashboard/components/layout/useColumnsThatFit.js +30 -0
- package/Dashboard/components/layout/useColumnsThatFit.js.map +1 -0
- package/Dashboard/components/layout/useWidgetPortals.d.ts +5 -0
- package/Dashboard/components/layout/useWidgetPortals.js +26 -0
- package/Dashboard/components/layout/useWidgetPortals.js.map +1 -0
- package/Dashboard/dashboardLayout/loadLayout/FetchDashboardLayoutUseCase.d.ts +12 -0
- package/Dashboard/dashboardLayout/loadLayout/FetchDashboardLayoutUseCase.js +19 -0
- package/Dashboard/dashboardLayout/loadLayout/FetchDashboardLayoutUseCase.js.map +1 -0
- package/Dashboard/dashboardLayout/loadLayout/GetCachedDashboardLayoutUseCase.d.ts +12 -0
- package/Dashboard/dashboardLayout/loadLayout/GetCachedDashboardLayoutUseCase.js +19 -0
- package/Dashboard/dashboardLayout/loadLayout/GetCachedDashboardLayoutUseCase.js.map +1 -0
- package/Dashboard/dashboardLayout/loadLayout/abstractions.d.ts +15 -0
- package/Dashboard/dashboardLayout/loadLayout/abstractions.js +6 -0
- package/Dashboard/dashboardLayout/loadLayout/abstractions.js.map +1 -0
- package/Dashboard/dashboardLayout/loadLayout/feature.d.ts +1 -0
- package/Dashboard/dashboardLayout/loadLayout/feature.js +13 -0
- package/Dashboard/dashboardLayout/loadLayout/feature.js.map +1 -0
- package/Dashboard/dashboardLayout/presenter/DashboardLayoutPresenter.d.ts +56 -0
- package/Dashboard/dashboardLayout/presenter/DashboardLayoutPresenter.js +308 -0
- package/Dashboard/dashboardLayout/presenter/DashboardLayoutPresenter.js.map +1 -0
- package/Dashboard/dashboardLayout/presenter/abstractions.d.ts +46 -0
- package/Dashboard/dashboardLayout/presenter/abstractions.js +5 -0
- package/Dashboard/dashboardLayout/presenter/abstractions.js.map +1 -0
- package/Dashboard/dashboardLayout/presenter/feature.d.ts +3 -0
- package/Dashboard/dashboardLayout/presenter/feature.js +23 -0
- package/Dashboard/dashboardLayout/presenter/feature.js.map +1 -0
- package/Dashboard/dashboardLayout/presenter/useDashboardLayoutPresenter.d.ts +1 -0
- package/Dashboard/dashboardLayout/presenter/useDashboardLayoutPresenter.js +6 -0
- package/Dashboard/dashboardLayout/presenter/useDashboardLayoutPresenter.js.map +1 -0
- package/Dashboard/dashboardLayout/repository/DashboardLayoutGateway.d.ts +13 -0
- package/Dashboard/dashboardLayout/repository/DashboardLayoutGateway.js +67 -0
- package/Dashboard/dashboardLayout/repository/DashboardLayoutGateway.js.map +1 -0
- package/Dashboard/dashboardLayout/repository/DashboardLayoutRepository.d.ts +20 -0
- package/Dashboard/dashboardLayout/repository/DashboardLayoutRepository.js +49 -0
- package/Dashboard/dashboardLayout/repository/DashboardLayoutRepository.js.map +1 -0
- package/Dashboard/dashboardLayout/repository/abstractions.d.ts +25 -0
- package/Dashboard/dashboardLayout/repository/abstractions.js +6 -0
- package/Dashboard/dashboardLayout/repository/abstractions.js.map +1 -0
- package/Dashboard/dashboardLayout/repository/feature.d.ts +1 -0
- package/Dashboard/dashboardLayout/repository/feature.js +13 -0
- package/Dashboard/dashboardLayout/repository/feature.js.map +1 -0
- package/Dashboard/dashboardLayout/saveLayout/SaveDashboardLayoutUseCase.d.ts +12 -0
- package/Dashboard/dashboardLayout/saveLayout/SaveDashboardLayoutUseCase.js +19 -0
- package/Dashboard/dashboardLayout/saveLayout/SaveDashboardLayoutUseCase.js.map +1 -0
- package/Dashboard/dashboardLayout/saveLayout/abstractions.d.ts +8 -0
- package/Dashboard/dashboardLayout/saveLayout/abstractions.js +5 -0
- package/Dashboard/dashboardLayout/saveLayout/abstractions.js.map +1 -0
- package/Dashboard/dashboardLayout/saveLayout/feature.d.ts +1 -0
- package/Dashboard/dashboardLayout/saveLayout/feature.js +11 -0
- package/Dashboard/dashboardLayout/saveLayout/feature.js.map +1 -0
- package/Dashboard/dashboardLayout/toColumnIndex.d.ts +1 -0
- package/Dashboard/dashboardLayout/toColumnIndex.js +7 -0
- package/Dashboard/dashboardLayout/toColumnIndex.js.map +1 -0
- package/Dashboard/dashboardLayout/types.d.ts +15 -0
- package/Dashboard/dashboardLayout/types.js +6 -0
- package/Dashboard/dashboardLayout/types.js.map +1 -0
- package/Layout.js +7 -5
- package/Layout.js.map +1 -1
- package/index.js +15 -4
- package/index.js.map +1 -1
- package/package.json +13 -7
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dashboard/components/dnd/useWidgetHosts.js","sources":["../../../../src/Dashboard/components/dnd/useWidgetHosts.ts"],"sourcesContent":["import { useCallback } from \"react\";\nimport { useRef } from \"react\";\n\n/*\n * One detached container per widget, created once and kept for the life of the dashboard.\n *\n * Each widget renders into its container through a portal, and `WidgetSlot` moves the container\n * to wherever the widget currently sits. The portal's container never changes, so React never\n * remounts the widget: switching Customize mode or dropping a widget into another column doesn't\n * reload it.\n */\nexport const useWidgetHosts = () => {\n const hosts = useRef(new Map<string, HTMLDivElement>());\n\n return useCallback((name: string): HTMLDivElement => {\n let host = hosts.current.get(name);\n if (!host) {\n host = document.createElement(\"div\");\n host.dataset.widgetHost = name;\n hosts.current.set(name, host);\n }\n return host;\n }, []);\n};\n"],"names":["useWidgetHosts","hosts","useRef","Map","useCallback","name","host","document"],"mappings":";AAWO,MAAMA,iBAAiB;IAC1B,MAAMC,QAAQC,OAAO,IAAIC;IAEzB,OAAOC,YAAY,CAACC;QAChB,IAAIC,OAAOL,MAAM,OAAO,CAAC,GAAG,CAACI;QAC7B,IAAI,CAACC,MAAM;YACPA,OAAOC,SAAS,aAAa,CAAC;YAC9BD,KAAK,OAAO,CAAC,UAAU,GAAGD;YAC1BJ,MAAM,OAAO,CAAC,GAAG,CAACI,MAAMC;QAC5B;QACA,OAAOA;IACX,GAAG,EAAE;AACT"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { DashboardLayoutPresenter } from "../../dashboardLayout/presenter/abstractions.js";
|
|
3
|
+
interface EditableColumnsProps {
|
|
4
|
+
vm: DashboardLayoutPresenter.ViewModel;
|
|
5
|
+
slots: Map<string, React.ReactElement>;
|
|
6
|
+
titles: Map<string, {
|
|
7
|
+
title: string;
|
|
8
|
+
}>;
|
|
9
|
+
presenter: DashboardLayoutPresenter.Interface;
|
|
10
|
+
onBrowseWidgets: () => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const EditableColumns: ({ vm, slots, titles, presenter, onBrowseWidgets }: EditableColumnsProps) => React.JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import react from "react";
|
|
2
|
+
import { DashboardDragLayer } from "../dnd/DashboardDragLayer.js";
|
|
3
|
+
import { DashboardWidgetColumn } from "../dnd/DashboardWidgetColumn.js";
|
|
4
|
+
import { MIN_COLUMN_COUNT } from "../../dashboardLayout/types.js";
|
|
5
|
+
import { DASHBOARD_MAX_WIDTH } from "./layoutConstants.js";
|
|
6
|
+
const EditableColumns = ({ vm, slots, titles, presenter, onBrowseWidgets })=>/*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement(DashboardDragLayer, null), /*#__PURE__*/ react.createElement("div", {
|
|
7
|
+
className: "flex gap-lg",
|
|
8
|
+
style: {
|
|
9
|
+
maxWidth: DASHBOARD_MAX_WIDTH
|
|
10
|
+
}
|
|
11
|
+
}, vm.columns.map((names, index)=>/*#__PURE__*/ react.createElement(DashboardWidgetColumn, {
|
|
12
|
+
key: index,
|
|
13
|
+
columnIndex: index,
|
|
14
|
+
names: names,
|
|
15
|
+
draggingName: vm.draggingName,
|
|
16
|
+
dropTarget: vm.dropTarget,
|
|
17
|
+
canRemoveColumn: vm.columnCount > MIN_COLUMN_COUNT,
|
|
18
|
+
elements: slots,
|
|
19
|
+
titles: titles,
|
|
20
|
+
presenter: presenter,
|
|
21
|
+
onBrowseWidgets: onBrowseWidgets
|
|
22
|
+
}))));
|
|
23
|
+
export { EditableColumns };
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=EditableColumns.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dashboard/components/layout/EditableColumns.js","sources":["../../../../src/Dashboard/components/layout/EditableColumns.tsx"],"sourcesContent":["import React from \"react\";\nimport { DashboardDragLayer } from \"../dnd/DashboardDragLayer.js\";\nimport { DashboardWidgetColumn } from \"../dnd/DashboardWidgetColumn.js\";\nimport { MIN_COLUMN_COUNT } from \"../../dashboardLayout/types.js\";\nimport type { DashboardLayoutPresenter } from \"../../dashboardLayout/presenter/abstractions.js\";\nimport { DASHBOARD_MAX_WIDTH } from \"./layoutConstants.js\";\n\ninterface EditableColumnsProps {\n vm: DashboardLayoutPresenter.ViewModel;\n slots: Map<string, React.ReactElement>;\n titles: Map<string, { title: string }>;\n presenter: DashboardLayoutPresenter.Interface;\n onBrowseWidgets: () => void;\n}\n\n// Customize mode: every column is a drop target and every widget can be dragged or removed.\nexport const EditableColumns = ({\n vm,\n slots,\n titles,\n presenter,\n onBrowseWidgets\n}: EditableColumnsProps) => {\n return (\n <>\n <DashboardDragLayer />\n <div className={\"flex gap-lg\"} style={{ maxWidth: DASHBOARD_MAX_WIDTH }}>\n {vm.columns.map((names, index) => (\n <DashboardWidgetColumn\n key={index}\n columnIndex={index}\n names={names}\n draggingName={vm.draggingName}\n dropTarget={vm.dropTarget}\n canRemoveColumn={vm.columnCount > MIN_COLUMN_COUNT}\n elements={slots}\n titles={titles}\n presenter={presenter}\n onBrowseWidgets={onBrowseWidgets}\n />\n ))}\n </div>\n </>\n );\n};\n"],"names":["EditableColumns","vm","slots","titles","presenter","onBrowseWidgets","DashboardDragLayer","DASHBOARD_MAX_WIDTH","names","index","DashboardWidgetColumn","MIN_COLUMN_COUNT"],"mappings":";;;;;AAgBO,MAAMA,kBAAkB,CAAC,EAC5BC,EAAE,EACFC,KAAK,EACLC,MAAM,EACNC,SAAS,EACTC,eAAe,EACI,GACZ,WAAP,GACI,wDACI,oBAACC,oBAAkBA,OAAAA,WAAAA,GACnB,oBAAC;QAAI,WAAW;QAAe,OAAO;YAAE,UAAUC;QAAoB;OACjEN,GAAG,OAAO,CAAC,GAAG,CAAC,CAACO,OAAOC,QAAAA,WAAAA,GACpB,oBAACC,uBAAqBA;YAClB,KAAKD;YACL,aAAaA;YACb,OAAOD;YACP,cAAcP,GAAG,YAAY;YAC7B,YAAYA,GAAG,UAAU;YACzB,iBAAiBA,GAAG,WAAW,GAAGU;YAClC,UAAUT;YACV,QAAQC;YACR,WAAWC;YACX,iBAAiBC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface StaticColumnsProps {
|
|
3
|
+
columns: string[][];
|
|
4
|
+
visibleCount: number;
|
|
5
|
+
slots: Map<string, React.ReactElement>;
|
|
6
|
+
}
|
|
7
|
+
export declare const StaticColumns: ({ columns, visibleCount, slots }: StaticColumnsProps) => React.JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import react from "react";
|
|
2
|
+
import { collapseColumns } from "./collapseColumns.js";
|
|
3
|
+
import { DASHBOARD_MAX_WIDTH } from "./layoutConstants.js";
|
|
4
|
+
const StaticColumns = ({ columns, visibleCount, slots })=>{
|
|
5
|
+
const collapsed = collapseColumns(columns, visibleCount);
|
|
6
|
+
return /*#__PURE__*/ react.createElement("div", {
|
|
7
|
+
className: "flex gap-lg",
|
|
8
|
+
style: {
|
|
9
|
+
maxWidth: DASHBOARD_MAX_WIDTH
|
|
10
|
+
}
|
|
11
|
+
}, collapsed.map((names, index)=>/*#__PURE__*/ react.createElement("div", {
|
|
12
|
+
key: index,
|
|
13
|
+
className: "flex flex-1 flex-col gap-lg"
|
|
14
|
+
}, names.map((name)=>/*#__PURE__*/ react.createElement(react.Fragment, {
|
|
15
|
+
key: name
|
|
16
|
+
}, slots.get(name))))));
|
|
17
|
+
};
|
|
18
|
+
export { StaticColumns };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=StaticColumns.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dashboard/components/layout/StaticColumns.js","sources":["../../../../src/Dashboard/components/layout/StaticColumns.tsx"],"sourcesContent":["import React from \"react\";\nimport { collapseColumns } from \"./collapseColumns.js\";\nimport { DASHBOARD_MAX_WIDTH } from \"./layoutConstants.js\";\n\ninterface StaticColumnsProps {\n columns: string[][];\n // How many columns fit on screen; fewer than `columns.length` folds them together.\n visibleCount: number;\n slots: Map<string, React.ReactElement>;\n}\n\n// The everyday dashboard: widgets laid out in their columns, nothing to drag.\nexport const StaticColumns = ({ columns, visibleCount, slots }: StaticColumnsProps) => {\n const collapsed = collapseColumns(columns, visibleCount);\n return (\n <div className={\"flex gap-lg\"} style={{ maxWidth: DASHBOARD_MAX_WIDTH }}>\n {collapsed.map((names, index) => (\n <div key={index} className={\"flex flex-1 flex-col gap-lg\"}>\n {names.map(name => (\n <React.Fragment key={name}>{slots.get(name)}</React.Fragment>\n ))}\n </div>\n ))}\n </div>\n );\n};\n"],"names":["StaticColumns","columns","visibleCount","slots","collapsed","collapseColumns","DASHBOARD_MAX_WIDTH","names","index","name","React"],"mappings":";;;AAYO,MAAMA,gBAAgB,CAAC,EAAEC,OAAO,EAAEC,YAAY,EAAEC,KAAK,EAAsB;IAC9E,MAAMC,YAAYC,gBAAgBJ,SAASC;IAC3C,OAAO,WAAP,GACI,oBAAC;QAAI,WAAW;QAAe,OAAO;YAAE,UAAUI;QAAoB;OACjEF,UAAU,GAAG,CAAC,CAACG,OAAOC,QAAAA,WAAAA,GACnB,oBAAC;YAAI,KAAKA;YAAO,WAAW;WACvBD,MAAM,GAAG,CAACE,CAAAA,OAAAA,WAAAA,GACP,oBAACC,MAAAA,QAAc;gBAAC,KAAKD;eAAON,MAAM,GAAG,CAACM;AAM9D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const collapseColumns: (columns: string[][], count: number) => string[][];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const collapseColumns = (columns, count)=>{
|
|
2
|
+
const result = Array.from({
|
|
3
|
+
length: count
|
|
4
|
+
}, ()=>[]);
|
|
5
|
+
const perColumn = Math.ceil(columns.length / count);
|
|
6
|
+
const groupSize = Math.max(1, perColumn);
|
|
7
|
+
columns.forEach((column, index)=>{
|
|
8
|
+
const group = Math.floor(index / groupSize);
|
|
9
|
+
const target = Math.min(group, count - 1);
|
|
10
|
+
result[target].push(...column);
|
|
11
|
+
});
|
|
12
|
+
return result;
|
|
13
|
+
};
|
|
14
|
+
export { collapseColumns };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=collapseColumns.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dashboard/components/layout/collapseColumns.js","sources":["../../../../src/Dashboard/components/layout/collapseColumns.ts"],"sourcesContent":["// Folds `columns` into `count` visual columns, keeping neighbors together and reading order intact.\nexport const collapseColumns = (columns: string[][], count: number): string[][] => {\n const result: string[][] = Array.from({ length: count }, () => []);\n const perColumn = Math.ceil(columns.length / count);\n const groupSize = Math.max(1, perColumn);\n columns.forEach((column, index) => {\n const group = Math.floor(index / groupSize);\n const target = Math.min(group, count - 1);\n result[target].push(...column);\n });\n return result;\n};\n"],"names":["collapseColumns","columns","count","result","Array","perColumn","Math","groupSize","column","index","group","target"],"mappings":"AACO,MAAMA,kBAAkB,CAACC,SAAqBC;IACjD,MAAMC,SAAqBC,MAAM,IAAI,CAAC;QAAE,QAAQF;IAAM,GAAG,IAAM,EAAE;IACjE,MAAMG,YAAYC,KAAK,IAAI,CAACL,QAAQ,MAAM,GAAGC;IAC7C,MAAMK,YAAYD,KAAK,GAAG,CAAC,GAAGD;IAC9BJ,QAAQ,OAAO,CAAC,CAACO,QAAQC;QACrB,MAAMC,QAAQJ,KAAK,KAAK,CAACG,QAAQF;QACjC,MAAMI,SAASL,KAAK,GAAG,CAACI,OAAOR,QAAQ;QACvCC,MAAM,CAACQ,OAAO,CAAC,IAAI,IAAIH;IAC3B;IACA,OAAOL;AACX"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dashboard/components/layout/layoutConstants.js","sources":["../../../../src/Dashboard/components/layout/layoutConstants.ts"],"sourcesContent":["// One width for every column count, so switching columns doesn't move the toolbar or the cards.\nexport const DASHBOARD_MAX_WIDTH = 1600;\n\n// Minimum width a column needs before the dashboard folds into fewer columns.\nexport const MIN_COLUMN_WIDTH = 360;\n"],"names":["DASHBOARD_MAX_WIDTH","MIN_COLUMN_WIDTH"],"mappings":"AACO,MAAMA,sBAAsB;AAG5B,MAAMC,mBAAmB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import react, { useEffect, useState } from "react";
|
|
2
|
+
import { MIN_COLUMN_WIDTH } from "./layoutConstants.js";
|
|
3
|
+
const useColumnsThatFit = (columnCount)=>{
|
|
4
|
+
const ref = react.useRef(null);
|
|
5
|
+
const [width, setWidth] = useState(0);
|
|
6
|
+
useEffect(()=>{
|
|
7
|
+
const node = ref.current;
|
|
8
|
+
if (!node) return;
|
|
9
|
+
setWidth(node.clientWidth);
|
|
10
|
+
const observer = new ResizeObserver((entries)=>{
|
|
11
|
+
setWidth(entries[0].contentRect.width);
|
|
12
|
+
});
|
|
13
|
+
observer.observe(node);
|
|
14
|
+
return ()=>observer.disconnect();
|
|
15
|
+
}, []);
|
|
16
|
+
let fitCount = columnCount;
|
|
17
|
+
if (width > 0) {
|
|
18
|
+
const columnsThatFit = Math.floor(width / MIN_COLUMN_WIDTH);
|
|
19
|
+
fitCount = Math.max(1, columnsThatFit);
|
|
20
|
+
}
|
|
21
|
+
const visibleCount = Math.min(columnCount, fitCount);
|
|
22
|
+
return {
|
|
23
|
+
ref,
|
|
24
|
+
visibleCount,
|
|
25
|
+
allFit: visibleCount === columnCount
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export { useColumnsThatFit };
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=useColumnsThatFit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dashboard/components/layout/useColumnsThatFit.js","sources":["../../../../src/Dashboard/components/layout/useColumnsThatFit.ts"],"sourcesContent":["import React from \"react\";\nimport { useEffect } from \"react\";\nimport { useState } from \"react\";\nimport { MIN_COLUMN_WIDTH } from \"./layoutConstants.js\";\n\n/*\n * Measures the dashboard and works out how many of the chosen columns fit. When fewer fit, the\n * dashboard shows `visibleCount` columns and `allFit` is false (Customize mode needs all of them).\n */\nexport const useColumnsThatFit = (columnCount: number) => {\n const ref = React.useRef<HTMLDivElement>(null);\n const [width, setWidth] = useState(0);\n\n useEffect(() => {\n const node = ref.current;\n if (!node) {\n return;\n }\n setWidth(node.clientWidth);\n const observer = new ResizeObserver(entries => {\n setWidth(entries[0].contentRect.width);\n });\n observer.observe(node);\n return () => observer.disconnect();\n }, []);\n\n let fitCount = columnCount;\n if (width > 0) {\n const columnsThatFit = Math.floor(width / MIN_COLUMN_WIDTH);\n fitCount = Math.max(1, columnsThatFit);\n }\n const visibleCount = Math.min(columnCount, fitCount);\n\n return { ref, visibleCount, allFit: visibleCount === columnCount };\n};\n"],"names":["useColumnsThatFit","columnCount","ref","React","width","setWidth","useState","useEffect","node","observer","ResizeObserver","entries","fitCount","columnsThatFit","Math","MIN_COLUMN_WIDTH","visibleCount"],"mappings":";;AASO,MAAMA,oBAAoB,CAACC;IAC9B,MAAMC,MAAMC,MAAAA,MAAY,CAAiB;IACzC,MAAM,CAACC,OAAOC,SAAS,GAAGC,SAAS;IAEnCC,UAAU;QACN,MAAMC,OAAON,IAAI,OAAO;QACxB,IAAI,CAACM,MACD;QAEJH,SAASG,KAAK,WAAW;QACzB,MAAMC,WAAW,IAAIC,eAAeC,CAAAA;YAChCN,SAASM,OAAO,CAAC,EAAE,CAAC,WAAW,CAAC,KAAK;QACzC;QACAF,SAAS,OAAO,CAACD;QACjB,OAAO,IAAMC,SAAS,UAAU;IACpC,GAAG,EAAE;IAEL,IAAIG,WAAWX;IACf,IAAIG,QAAQ,GAAG;QACX,MAAMS,iBAAiBC,KAAK,KAAK,CAACV,QAAQW;QAC1CH,WAAWE,KAAK,GAAG,CAAC,GAAGD;IAC3B;IACA,MAAMG,eAAeF,KAAK,GAAG,CAACb,aAAaW;IAE3C,OAAO;QAAEV;QAAKc;QAAc,QAAQA,iBAAiBf;IAAY;AACrE"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import react from "react";
|
|
2
|
+
import { createPortal } from "react-dom";
|
|
3
|
+
import { WidgetSlot } from "../dnd/WidgetSlot.js";
|
|
4
|
+
import { useWidgetHosts } from "../dnd/useWidgetHosts.js";
|
|
5
|
+
const useWidgetPortals = (placed, elements)=>{
|
|
6
|
+
const getHost = useWidgetHosts();
|
|
7
|
+
const slots = new Map();
|
|
8
|
+
const portals = [];
|
|
9
|
+
for (const name of placed){
|
|
10
|
+
const element = elements.get(name);
|
|
11
|
+
if (!element) continue;
|
|
12
|
+
const host = getHost(name);
|
|
13
|
+
slots.set(name, /*#__PURE__*/ react.createElement(WidgetSlot, {
|
|
14
|
+
host: host
|
|
15
|
+
}));
|
|
16
|
+
const portal = /*#__PURE__*/ createPortal(element, host, name);
|
|
17
|
+
portals.push(portal);
|
|
18
|
+
}
|
|
19
|
+
return {
|
|
20
|
+
slots,
|
|
21
|
+
portals
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export { useWidgetPortals };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=useWidgetPortals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dashboard/components/layout/useWidgetPortals.js","sources":["../../../../src/Dashboard/components/layout/useWidgetPortals.tsx"],"sourcesContent":["import React from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { WidgetSlot } from \"../dnd/WidgetSlot.js\";\nimport { useWidgetHosts } from \"../dnd/useWidgetHosts.js\";\n\n/*\n * Renders every placed widget once, into its own container, and returns a slot per widget for the\n * layouts to place. Moving a slot moves the widget without remounting it; see `useWidgetHosts`.\n * Render `portals` once, anywhere stable; render `slots.get(name)` wherever the widget goes.\n */\nexport const useWidgetPortals = (placed: string[], elements: Map<string, React.ReactElement>) => {\n const getHost = useWidgetHosts();\n const slots = new Map<string, React.ReactElement>();\n const portals: React.ReactNode[] = [];\n\n for (const name of placed) {\n const element = elements.get(name);\n if (!element) {\n continue;\n }\n const host = getHost(name);\n slots.set(name, <WidgetSlot host={host} />);\n const portal = createPortal(element, host, name);\n portals.push(portal);\n }\n\n return { slots, portals };\n};\n"],"names":["useWidgetPortals","placed","elements","getHost","useWidgetHosts","slots","Map","portals","name","element","host","WidgetSlot","portal","createPortal"],"mappings":";;;;AAUO,MAAMA,mBAAmB,CAACC,QAAkBC;IAC/C,MAAMC,UAAUC;IAChB,MAAMC,QAAQ,IAAIC;IAClB,MAAMC,UAA6B,EAAE;IAErC,KAAK,MAAMC,QAAQP,OAAQ;QACvB,MAAMQ,UAAUP,SAAS,GAAG,CAACM;QAC7B,IAAI,CAACC,SACD;QAEJ,MAAMC,OAAOP,QAAQK;QACrBH,MAAM,GAAG,CAACG,MAAM,WAANA,GAAM,oBAACG,YAAUA;YAAC,MAAMD;;QAClC,MAAME,SAAS,WAATA,GAASC,aAAaJ,SAASC,MAAMF;QAC3CD,QAAQ,IAAI,CAACK;IACjB;IAEA,OAAO;QAAEP;QAAOE;IAAQ;AAC5B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DashboardLayoutRepository } from "../repository/abstractions.js";
|
|
2
|
+
import { FetchDashboardLayoutUseCase as UseCaseAbstraction } from "./abstractions.js";
|
|
3
|
+
import type { DashboardLayoutData } from "../types.js";
|
|
4
|
+
declare class FetchDashboardLayoutUseCaseImpl implements UseCaseAbstraction.Interface {
|
|
5
|
+
private repository;
|
|
6
|
+
constructor(repository: DashboardLayoutRepository.Interface);
|
|
7
|
+
execute(userId: string): Promise<DashboardLayoutData | null>;
|
|
8
|
+
}
|
|
9
|
+
export declare const FetchDashboardLayoutUseCase: typeof FetchDashboardLayoutUseCaseImpl & {
|
|
10
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IFetchDashboardLayoutUseCase>;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { DashboardLayoutRepository } from "../repository/abstractions.js";
|
|
2
|
+
import { FetchDashboardLayoutUseCase } from "./abstractions.js";
|
|
3
|
+
class FetchDashboardLayoutUseCaseImpl {
|
|
4
|
+
constructor(repository){
|
|
5
|
+
this.repository = repository;
|
|
6
|
+
}
|
|
7
|
+
async execute(userId) {
|
|
8
|
+
return await this.repository.fetch(userId);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
const FetchDashboardLayoutUseCase_FetchDashboardLayoutUseCase = FetchDashboardLayoutUseCase.createImplementation({
|
|
12
|
+
implementation: FetchDashboardLayoutUseCaseImpl,
|
|
13
|
+
dependencies: [
|
|
14
|
+
DashboardLayoutRepository
|
|
15
|
+
]
|
|
16
|
+
});
|
|
17
|
+
export { FetchDashboardLayoutUseCase_FetchDashboardLayoutUseCase as FetchDashboardLayoutUseCase };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=FetchDashboardLayoutUseCase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dashboard/dashboardLayout/loadLayout/FetchDashboardLayoutUseCase.js","sources":["../../../../src/Dashboard/dashboardLayout/loadLayout/FetchDashboardLayoutUseCase.ts"],"sourcesContent":["import { DashboardLayoutRepository } from \"../repository/abstractions.js\";\nimport { FetchDashboardLayoutUseCase as UseCaseAbstraction } from \"./abstractions.js\";\nimport type { DashboardLayoutData } from \"../types.js\";\n\nclass FetchDashboardLayoutUseCaseImpl implements UseCaseAbstraction.Interface {\n constructor(private repository: DashboardLayoutRepository.Interface) {}\n\n async execute(userId: string): Promise<DashboardLayoutData | null> {\n return await this.repository.fetch(userId);\n }\n}\n\nexport const FetchDashboardLayoutUseCase = UseCaseAbstraction.createImplementation({\n implementation: FetchDashboardLayoutUseCaseImpl,\n dependencies: [DashboardLayoutRepository]\n});\n"],"names":["FetchDashboardLayoutUseCaseImpl","repository","userId","FetchDashboardLayoutUseCase","UseCaseAbstraction","DashboardLayoutRepository"],"mappings":";;AAIA,MAAMA;IACF,YAAoBC,UAA+C,CAAE;aAAjDA,UAAU,GAAVA;IAAkD;IAEtE,MAAM,QAAQC,MAAc,EAAuC;QAC/D,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,CAACA;IACvC;AACJ;AAEO,MAAMC,0DAA8BC,4BAAAA,oBAAuC,CAAC;IAC/E,gBAAgBJ;IAChB,cAAc;QAACK;KAA0B;AAC7C"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DashboardLayoutRepository } from "../repository/abstractions.js";
|
|
2
|
+
import { GetCachedDashboardLayoutUseCase as UseCaseAbstraction } from "./abstractions.js";
|
|
3
|
+
import type { DashboardLayoutData } from "../types.js";
|
|
4
|
+
declare class GetCachedDashboardLayoutUseCaseImpl implements UseCaseAbstraction.Interface {
|
|
5
|
+
private repository;
|
|
6
|
+
constructor(repository: DashboardLayoutRepository.Interface);
|
|
7
|
+
execute(userId: string): DashboardLayoutData | null;
|
|
8
|
+
}
|
|
9
|
+
export declare const GetCachedDashboardLayoutUseCase: typeof GetCachedDashboardLayoutUseCaseImpl & {
|
|
10
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IGetCachedDashboardLayoutUseCase>;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { DashboardLayoutRepository } from "../repository/abstractions.js";
|
|
2
|
+
import { GetCachedDashboardLayoutUseCase } from "./abstractions.js";
|
|
3
|
+
class GetCachedDashboardLayoutUseCaseImpl {
|
|
4
|
+
constructor(repository){
|
|
5
|
+
this.repository = repository;
|
|
6
|
+
}
|
|
7
|
+
execute(userId) {
|
|
8
|
+
return this.repository.getCached(userId);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
const GetCachedDashboardLayoutUseCase_GetCachedDashboardLayoutUseCase = GetCachedDashboardLayoutUseCase.createImplementation({
|
|
12
|
+
implementation: GetCachedDashboardLayoutUseCaseImpl,
|
|
13
|
+
dependencies: [
|
|
14
|
+
DashboardLayoutRepository
|
|
15
|
+
]
|
|
16
|
+
});
|
|
17
|
+
export { GetCachedDashboardLayoutUseCase_GetCachedDashboardLayoutUseCase as GetCachedDashboardLayoutUseCase };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=GetCachedDashboardLayoutUseCase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dashboard/dashboardLayout/loadLayout/GetCachedDashboardLayoutUseCase.js","sources":["../../../../src/Dashboard/dashboardLayout/loadLayout/GetCachedDashboardLayoutUseCase.ts"],"sourcesContent":["import { DashboardLayoutRepository } from \"../repository/abstractions.js\";\nimport { GetCachedDashboardLayoutUseCase as UseCaseAbstraction } from \"./abstractions.js\";\nimport type { DashboardLayoutData } from \"../types.js\";\n\nclass GetCachedDashboardLayoutUseCaseImpl implements UseCaseAbstraction.Interface {\n constructor(private repository: DashboardLayoutRepository.Interface) {}\n\n execute(userId: string): DashboardLayoutData | null {\n return this.repository.getCached(userId);\n }\n}\n\nexport const GetCachedDashboardLayoutUseCase = UseCaseAbstraction.createImplementation({\n implementation: GetCachedDashboardLayoutUseCaseImpl,\n dependencies: [DashboardLayoutRepository]\n});\n"],"names":["GetCachedDashboardLayoutUseCaseImpl","repository","userId","GetCachedDashboardLayoutUseCase","UseCaseAbstraction","DashboardLayoutRepository"],"mappings":";;AAIA,MAAMA;IACF,YAAoBC,UAA+C,CAAE;aAAjDA,UAAU,GAAVA;IAAkD;IAEtE,QAAQC,MAAc,EAA8B;QAChD,OAAO,IAAI,CAAC,UAAU,CAAC,SAAS,CAACA;IACrC;AACJ;AAEO,MAAMC,kEAAkCC,gCAAAA,oBAAuC,CAAC;IACnF,gBAAgBJ;IAChB,cAAc;QAACK;KAA0B;AAC7C"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { DashboardLayoutData } from "../types.js";
|
|
2
|
+
export interface IGetCachedDashboardLayoutUseCase {
|
|
3
|
+
execute(userId: string): DashboardLayoutData | null;
|
|
4
|
+
}
|
|
5
|
+
export declare const GetCachedDashboardLayoutUseCase: import("@webiny/di").Abstraction<IGetCachedDashboardLayoutUseCase>;
|
|
6
|
+
export declare namespace GetCachedDashboardLayoutUseCase {
|
|
7
|
+
type Interface = IGetCachedDashboardLayoutUseCase;
|
|
8
|
+
}
|
|
9
|
+
export interface IFetchDashboardLayoutUseCase {
|
|
10
|
+
execute(userId: string): Promise<DashboardLayoutData | null>;
|
|
11
|
+
}
|
|
12
|
+
export declare const FetchDashboardLayoutUseCase: import("@webiny/di").Abstraction<IFetchDashboardLayoutUseCase>;
|
|
13
|
+
export declare namespace FetchDashboardLayoutUseCase {
|
|
14
|
+
type Interface = IFetchDashboardLayoutUseCase;
|
|
15
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { createAbstraction } from "@webiny/feature/admin";
|
|
2
|
+
const GetCachedDashboardLayoutUseCase = createAbstraction("GetCachedDashboardLayoutUseCase");
|
|
3
|
+
const FetchDashboardLayoutUseCase = createAbstraction("FetchDashboardLayoutUseCase");
|
|
4
|
+
export { FetchDashboardLayoutUseCase, GetCachedDashboardLayoutUseCase };
|
|
5
|
+
|
|
6
|
+
//# sourceMappingURL=abstractions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dashboard/dashboardLayout/loadLayout/abstractions.js","sources":["../../../../src/Dashboard/dashboardLayout/loadLayout/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/admin\";\nimport type { DashboardLayoutData } from \"../types.js\";\n\n// Returns the cached layout without a request, so the dashboard can render it straight away.\nexport interface IGetCachedDashboardLayoutUseCase {\n execute(userId: string): DashboardLayoutData | null;\n}\n\nexport const GetCachedDashboardLayoutUseCase = createAbstraction<IGetCachedDashboardLayoutUseCase>(\n \"GetCachedDashboardLayoutUseCase\"\n);\n\nexport namespace GetCachedDashboardLayoutUseCase {\n export type Interface = IGetCachedDashboardLayoutUseCase;\n}\n\n// Fetches the stored layout from the API. `null` means the user never customized their dashboard.\nexport interface IFetchDashboardLayoutUseCase {\n execute(userId: string): Promise<DashboardLayoutData | null>;\n}\n\nexport const FetchDashboardLayoutUseCase = createAbstraction<IFetchDashboardLayoutUseCase>(\n \"FetchDashboardLayoutUseCase\"\n);\n\nexport namespace FetchDashboardLayoutUseCase {\n export type Interface = IFetchDashboardLayoutUseCase;\n}\n"],"names":["GetCachedDashboardLayoutUseCase","createAbstraction","FetchDashboardLayoutUseCase"],"mappings":";AAQO,MAAMA,kCAAkCC,kBAC3C;AAYG,MAAMC,8BAA8BD,kBACvC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const LoadDashboardLayoutFeature: import("@webiny/feature/admin").FeatureDefinition<any, []>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/admin";
|
|
2
|
+
import { GetCachedDashboardLayoutUseCase } from "./GetCachedDashboardLayoutUseCase.js";
|
|
3
|
+
import { FetchDashboardLayoutUseCase } from "./FetchDashboardLayoutUseCase.js";
|
|
4
|
+
const LoadDashboardLayoutFeature = createFeature({
|
|
5
|
+
name: "AdminUI/LoadDashboardLayout",
|
|
6
|
+
register (container) {
|
|
7
|
+
container.register(GetCachedDashboardLayoutUseCase);
|
|
8
|
+
container.register(FetchDashboardLayoutUseCase);
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
export { LoadDashboardLayoutFeature };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dashboard/dashboardLayout/loadLayout/feature.js","sources":["../../../../src/Dashboard/dashboardLayout/loadLayout/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/admin\";\nimport { GetCachedDashboardLayoutUseCase } from \"./GetCachedDashboardLayoutUseCase.js\";\nimport { FetchDashboardLayoutUseCase } from \"./FetchDashboardLayoutUseCase.js\";\n\nexport const LoadDashboardLayoutFeature = createFeature({\n name: \"AdminUI/LoadDashboardLayout\",\n register(container) {\n container.register(GetCachedDashboardLayoutUseCase);\n container.register(FetchDashboardLayoutUseCase);\n }\n});\n"],"names":["LoadDashboardLayoutFeature","createFeature","container","GetCachedDashboardLayoutUseCase","FetchDashboardLayoutUseCase"],"mappings":";;;AAIO,MAAMA,6BAA6BC,cAAc;IACpD,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;QACnBD,UAAU,QAAQ,CAACE;IACvB;AACJ"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { GetCachedDashboardLayoutUseCase } from "../loadLayout/abstractions.js";
|
|
2
|
+
import { FetchDashboardLayoutUseCase } from "../loadLayout/abstractions.js";
|
|
3
|
+
import { SaveDashboardLayoutUseCase } from "../saveLayout/abstractions.js";
|
|
4
|
+
import type { DashboardLayoutData } from "../types.js";
|
|
5
|
+
import { DashboardLayoutPresenter as Abstraction } from "./abstractions.js";
|
|
6
|
+
import type { DashboardWidgetInput } from "./abstractions.js";
|
|
7
|
+
declare class DashboardLayoutPresenterImpl implements Abstraction.Interface {
|
|
8
|
+
private getCachedDashboardLayoutUseCase;
|
|
9
|
+
private fetchDashboardLayoutUseCase;
|
|
10
|
+
private saveDashboardLayoutUseCase;
|
|
11
|
+
private _userId;
|
|
12
|
+
private _columns;
|
|
13
|
+
private _columnCount;
|
|
14
|
+
private _hidden;
|
|
15
|
+
private _draggingName;
|
|
16
|
+
private _dropColumn;
|
|
17
|
+
private _dropBeforeName;
|
|
18
|
+
private _editing;
|
|
19
|
+
private _defaultColumns;
|
|
20
|
+
private _widgets;
|
|
21
|
+
private _changed;
|
|
22
|
+
private _saving;
|
|
23
|
+
private _pendingSave;
|
|
24
|
+
constructor(getCachedDashboardLayoutUseCase: GetCachedDashboardLayoutUseCase.Interface, fetchDashboardLayoutUseCase: FetchDashboardLayoutUseCase.Interface, saveDashboardLayoutUseCase: SaveDashboardLayoutUseCase.Interface);
|
|
25
|
+
get vm(): Abstraction.ViewModel;
|
|
26
|
+
init(userId: string, widgets: DashboardWidgetInput[]): void;
|
|
27
|
+
beginDrag: (name: string) => void;
|
|
28
|
+
hoverSlot: (column: number, beforeName: string | null) => void;
|
|
29
|
+
drop: () => void;
|
|
30
|
+
endDrag: () => void;
|
|
31
|
+
removeWidget: (name: string) => void;
|
|
32
|
+
addWidget: (name: string, column?: number) => void;
|
|
33
|
+
setColumnCount: (count: number) => void;
|
|
34
|
+
removeColumn: (index: number) => void;
|
|
35
|
+
startEditing: () => void;
|
|
36
|
+
stopEditing: () => void;
|
|
37
|
+
dispose: () => void;
|
|
38
|
+
resetToDefault: () => void;
|
|
39
|
+
applyFetchedLayout: (userId: string, fetched: DashboardLayoutData | null) => void;
|
|
40
|
+
/**
|
|
41
|
+
* Rebuild the columns and hidden list from a base state, keeping only currently registered
|
|
42
|
+
* widgets. Widgets neither placed nor hidden are treated as newly registered and appended to
|
|
43
|
+
* their default column.
|
|
44
|
+
*/
|
|
45
|
+
private applyOrder;
|
|
46
|
+
/** Pure computation of the resulting columns if `name` were dropped before `beforeName`. */
|
|
47
|
+
private computeMove;
|
|
48
|
+
private clampColumn;
|
|
49
|
+
private revalidate;
|
|
50
|
+
private persist;
|
|
51
|
+
private flushSaves;
|
|
52
|
+
}
|
|
53
|
+
export declare const DashboardLayoutPresenter: typeof DashboardLayoutPresenterImpl & {
|
|
54
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").IDashboardLayoutPresenter>;
|
|
55
|
+
};
|
|
56
|
+
export {};
|