@vc-shell/framework 2.4.0 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai-agent/index.js +3 -3
- package/dist/chunks/{VcAiAgentPanel.vue_vue_type_script_setup_true_lang-Cm_izaFs.js → VcAiAgentPanel.vue_vue_type_script_setup_true_lang-9mBLzIi1.js} +490 -468
- package/dist/chunks/VcAiAgentPanel.vue_vue_type_script_setup_true_lang-9mBLzIi1.js.map +1 -0
- package/dist/chunks/{VcAiAgentPanel.vue_vue_type_style_index_0_lang-DrGobYkj.js → VcAiAgentPanel.vue_vue_type_style_index_0_lang-CZdY18Hq.js} +74 -68
- package/dist/chunks/{VcAiAgentPanel.vue_vue_type_style_index_0_lang-DrGobYkj.js.map → VcAiAgentPanel.vue_vue_type_style_index_0_lang-CZdY18Hq.js.map} +1 -1
- package/dist/chunks/{VcScheduler.vue_vue_type_script_setup_true_lang-B-xA79lJ.js → VcScheduler.vue_vue_type_script_setup_true_lang-BmlVL_rn.js} +6388 -6183
- package/dist/chunks/VcScheduler.vue_vue_type_script_setup_true_lang-BmlVL_rn.js.map +1 -0
- package/dist/chunks/{VcScheduler.vue_vue_type_style_index_0_lang-BSvjI-39.js → VcScheduler.vue_vue_type_style_index_0_lang-BTg4PjTB.js} +533 -521
- package/dist/chunks/VcScheduler.vue_vue_type_style_index_0_lang-BTg4PjTB.js.map +1 -0
- package/dist/chunks/dashboard-feed-row.vue_vue_type_script_setup_true_lang-BCsJG_hk.js +724 -0
- package/dist/chunks/dashboard-feed-row.vue_vue_type_script_setup_true_lang-BCsJG_hk.js.map +1 -0
- package/dist/chunks/{index-C-SEYj46.js → index-B7RhGTNx.js} +2 -2
- package/dist/chunks/{index-C-SEYj46.js.map → index-B7RhGTNx.js.map} +1 -1
- package/dist/core/blade-navigation/utils/bladeRouterGuard.d.ts +1 -2
- package/dist/core/blade-navigation/utils/bladeRouterGuard.d.ts.map +1 -1
- package/dist/core/composables/index.d.ts +1 -0
- package/dist/core/composables/index.d.ts.map +1 -1
- package/dist/core/composables/useLatestRequest/index.d.ts +43 -0
- package/dist/core/composables/useLatestRequest/index.d.ts.map +1 -0
- package/dist/core/composables/usePopup/index.d.ts +12 -3
- package/dist/core/composables/usePopup/index.d.ts.map +1 -1
- package/dist/core/composables/usePopup/keys.d.ts +3 -1
- package/dist/core/composables/usePopup/keys.d.ts.map +1 -1
- package/dist/core/composables/usePopup/types.d.ts +32 -1
- package/dist/core/composables/usePopup/types.d.ts.map +1 -1
- package/dist/core/interceptors/index.d.ts.map +1 -1
- package/dist/core/plugins/ai-agent/components/VcAiAgentPanel.vue.d.ts +4 -1
- package/dist/core/plugins/ai-agent/components/VcAiAgentPanel.vue.d.ts.map +1 -1
- package/dist/core/plugins/ai-agent/services/ai-agent-service.d.ts.map +1 -1
- package/dist/core/plugins/ai-agent/services/message-transport.d.ts +2 -0
- package/dist/core/plugins/ai-agent/services/message-transport.d.ts.map +1 -1
- package/dist/core/plugins/ai-agent/types.d.ts +1 -1
- package/dist/core/plugins/ai-agent/types.d.ts.map +1 -1
- package/dist/core/utilities/error.d.ts.map +1 -1
- package/dist/core/utilities/focus.d.ts +25 -0
- package/dist/core/utilities/focus.d.ts.map +1 -0
- package/dist/core/utilities/index.d.ts +1 -0
- package/dist/core/utilities/index.d.ts.map +1 -1
- package/dist/core/utilities/sessionExpiration.d.ts +14 -0
- package/dist/core/utilities/sessionExpiration.d.ts.map +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/framework.js +1300 -1262
- package/dist/framework.js.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/injection-keys.d.ts +1 -2
- package/dist/injection-keys.d.ts.map +1 -1
- package/dist/locales/de.js +3 -0
- package/dist/locales/en.js +3 -0
- package/dist/locales/en.json +3 -0
- package/dist/locales/types.d.ts +3 -0
- package/dist/shell/_internal/blade-navigation/components/vc-blade-navigation/focus-target.d.ts +20 -0
- package/dist/shell/_internal/blade-navigation/components/vc-blade-navigation/focus-target.d.ts.map +1 -0
- package/dist/shell/_internal/blade-navigation/components/vc-blade-navigation/vc-blade-navigation-new.vue.d.ts.map +1 -1
- package/dist/shell/_internal/blade-navigation/components/vc-blade-slot/vc-blade-slot.vue.d.ts +5 -0
- package/dist/shell/_internal/blade-navigation/components/vc-blade-slot/vc-blade-slot.vue.d.ts.map +1 -1
- package/dist/shell/_internal/popup/components/vc-popup-container/PopupInstanceProvider.vue.d.ts +30 -0
- package/dist/shell/_internal/popup/components/vc-popup-container/PopupInstanceProvider.vue.d.ts.map +1 -0
- package/dist/shell/_internal/popup/components/vc-popup-container/vc-popup-container.vue.d.ts.map +1 -1
- package/dist/shell/auth/ChangePasswordPage/components/change-password/ChangePassword.vue.d.ts.map +1 -1
- package/dist/shell/auth/InvitePage/components/invite/Invite.vue.d.ts.map +1 -1
- package/dist/shell/auth/ResetPasswordPage/components/reset-password/ResetPassword.vue.d.ts.map +1 -1
- package/dist/shell/components/change-password/change-password.vue.d.ts.map +1 -1
- package/dist/shell/dashboard/draggable-dashboard/GridstackDashboard.vue.d.ts.map +1 -1
- package/dist/shell/dashboard/draggable-dashboard/composables/useGridstack.d.ts +5 -8
- package/dist/shell/dashboard/draggable-dashboard/composables/useGridstack.d.ts.map +1 -1
- package/dist/shell/dashboard/draggable-dashboard/composables/useGridstackAdapter.d.ts +6 -6
- package/dist/shell/dashboard/draggable-dashboard/composables/useGridstackAdapter.d.ts.map +1 -1
- package/dist/shell/dashboard/draggable-dashboard/types.d.ts +11 -0
- package/dist/shell/dashboard/draggable-dashboard/types.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui/components/molecules/vc-color-input/vc-color-input.vue.d.ts +2 -2
- package/dist/ui/components/molecules/vc-date-picker/vc-date-picker.vue.d.ts +2 -2
- package/dist/ui/components/molecules/vc-input/vc-input.vue.d.ts +2 -2
- package/dist/ui/components/molecules/vc-multivalue/_internal/MultivalueTrigger.vue.d.ts +2 -2
- package/dist/ui/components/molecules/vc-popover/vc-popover.vue.d.ts +4 -0
- package/dist/ui/components/molecules/vc-popover/vc-popover.vue.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-select/_internal/SelectTrigger.vue.d.ts +2 -2
- package/dist/ui/components/organisms/vc-app/_internal/app-bar/components/MenuSidebar.vue.d.ts +1 -0
- package/dist/ui/components/organisms/vc-app/_internal/app-bar/components/MenuSidebar.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/_internal/layouts/DesktopLayout.vue.d.ts +8 -0
- package/dist/ui/components/organisms/vc-app/_internal/layouts/DesktopLayout.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/_internal/layouts/MobileLayout.vue.d.ts +5 -0
- package/dist/ui/components/organisms/vc-app/_internal/layouts/MobileLayout.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/_internal/sidebar/SidebarHeader.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-blade/_internal/BladeHeader.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-blade/useBladeSkeleton.d.ts +16 -0
- package/dist/ui/components/organisms/vc-blade/useBladeSkeleton.d.ts.map +1 -0
- package/dist/ui/components/organisms/vc-blade/vc-blade.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-data-table/VcDataTable.vue.d.ts +1 -2
- package/dist/ui/components/organisms/vc-data-table/VcDataTable.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-data-table/components/GlobalFiltersPanel.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-data-table/components/TableSearchHeader.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-data-table/components/mobile/PullToRefresh.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-popup/vc-popup.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-scheduler/VcScheduler.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-scheduler/_internal/SchedulerToolbar.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-scheduler/_internal/month/MonthEventBar.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-scheduler/_internal/month/MonthMorePopover.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-scheduler/_internal/month/MonthWeekRow.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-scheduler/_internal/views/SchedulerTimelineView.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-scheduler/composables/useTimelineTimeGrid.d.ts +2 -0
- package/dist/ui/components/organisms/vc-scheduler/composables/useTimelineTimeGrid.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-sidebar/vc-sidebar.vue.d.ts +1 -0
- package/dist/ui/components/organisms/vc-sidebar/vc-sidebar.vue.d.ts.map +1 -1
- package/dist/ui/composables/useDataTablePagination.d.ts +22 -1
- package/dist/ui/composables/useDataTablePagination.d.ts.map +1 -1
- package/dist/ui/index.js +3 -3
- package/package.json +4 -4
- package/dist/chunks/VcAiAgentPanel.vue_vue_type_script_setup_true_lang-Cm_izaFs.js.map +0 -1
- package/dist/chunks/VcScheduler.vue_vue_type_script_setup_true_lang-B-xA79lJ.js.map +0 -1
- package/dist/chunks/VcScheduler.vue_vue_type_style_index_0_lang-BSvjI-39.js.map +0 -1
- package/dist/chunks/dashboard-feed-row.vue_vue_type_script_setup_true_lang-BXDneKBz.js +0 -679
- package/dist/chunks/dashboard-feed-row.vue_vue_type_script_setup_true_lang-BXDneKBz.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard-feed-row.vue_vue_type_script_setup_true_lang-BCsJG_hk.js","sources":["../../shell/dashboard/draggable-dashboard/composables/useGridstackAdapter.ts","../../shell/dashboard/draggable-dashboard/composables/useGridstack.ts","../../shell/dashboard/draggable-dashboard/DashboardWidgetSkeleton.vue","../../shell/dashboard/draggable-dashboard/GridstackDashboard.vue","../../shell/dashboard/draggable-dashboard/DraggableDashboard.vue","../../shell/dashboard/draggable-dashboard/index.ts","../../shell/dashboard/dashboard-widget-card/dashboard-widget-card.vue","../../shell/dashboard/dashboard-widget-card/dashboard-stat-item.vue","../../shell/dashboard/dashboard-widget-card/dashboard-feed-list.vue","../../shell/dashboard/dashboard-widget-card/dashboard-feed-row.vue"],"sourcesContent":["/**\r\n * Gridstack Type Adapter\r\n *\r\n * Converts between our IDashboardWidget types and Gridstack's GridStackWidget types.\r\n * Handles localStorage format migration for backwards compatibility.\r\n */\r\n\r\nimport type { GridStackWidget, GridStackNode } from \"gridstack\";\r\nimport type {\r\n IDashboardWidget,\r\n DashboardWidgetPosition,\r\n DashboardWidgetPlacement,\r\n DashboardWidgetSize,\r\n} from \"@shell/dashboard/draggable-dashboard/types\";\r\n\r\n/**\r\n * LocalStorage key for layout persistence\r\n */\r\nexport const LAYOUT_STORAGE_KEY = \"vc-dashboard-layout\";\r\n\r\n/**\r\n * Old localStorage format (Map serialized as object)\r\n */\r\ninterface LegacyLayoutFormat {\r\n [widgetId: string]: DashboardWidgetPosition;\r\n}\r\n\r\n/**\r\n * Converts our widget type to Gridstack widget format\r\n */\r\nexport function toGridstackWidget(widget: IDashboardWidget, placement?: DashboardWidgetPlacement): GridStackWidget {\r\n const pos = placement ?? widget.position;\r\n return {\r\n id: widget.id,\r\n x: pos?.x ?? 0,\r\n y: pos?.y ?? 0,\r\n // A placement size wins over the declared one, so a saved or live resize is\r\n // restored instead of snapping back to the widget's default.\r\n w: placement?.width ?? widget.size.width,\r\n h: placement?.height ?? widget.size.height,\r\n minW: 2,\r\n minH: 2,\r\n };\r\n}\r\n\r\n/**\r\n * Extracts position from Gridstack node\r\n */\r\nexport function fromGridstackNode(node: GridStackNode): {\r\n id: string;\r\n position: DashboardWidgetPosition;\r\n size: DashboardWidgetSize;\r\n} {\r\n return {\r\n id: node.id ?? \"\",\r\n position: {\r\n x: node.x ?? 0,\r\n y: node.y ?? 0,\r\n },\r\n size: {\r\n width: node.w ?? 1,\r\n height: node.h ?? 1,\r\n },\r\n };\r\n}\r\n\r\n/**\r\n * Converts Gridstack nodes array to our layout Map format\r\n */\r\nexport function gridstackNodesToLayoutMap(nodes: GridStackNode[]): Map<string, DashboardWidgetPlacement> {\r\n const layout = new Map<string, DashboardWidgetPlacement>();\r\n\r\n for (const node of nodes) {\r\n if (node.id) {\r\n layout.set(node.id, {\r\n x: node.x ?? 0,\r\n y: node.y ?? 0,\r\n // Size is carried through as well; dropping it here is what used to make\r\n // every resize — mouse or keyboard — invisible to state and to storage.\r\n ...(typeof node.w === \"number\" ? { width: node.w } : {}),\r\n ...(typeof node.h === \"number\" ? { height: node.h } : {}),\r\n });\r\n }\r\n }\r\n\r\n return layout;\r\n}\r\n\r\n/**\r\n * Loads layout from localStorage with legacy format support\r\n */\r\nexport function loadLayoutFromStorage(): Map<string, DashboardWidgetPlacement> | null {\r\n try {\r\n const stored = localStorage.getItem(LAYOUT_STORAGE_KEY);\r\n if (!stored) return null;\r\n\r\n const parsed = JSON.parse(stored);\r\n\r\n // Check if it's the new Gridstack array format\r\n if (Array.isArray(parsed)) {\r\n return gridstackNodesToLayoutMap(parsed as GridStackNode[]);\r\n }\r\n\r\n // Legacy format: object with widget IDs as keys. It never carried a size, so\r\n // those entries stay size-less and fall back to the widget's declared size.\r\n if (typeof parsed === \"object\" && parsed !== null) {\r\n const layout = new Map<string, DashboardWidgetPlacement>();\r\n for (const [id, pos] of Object.entries(parsed as LegacyLayoutFormat)) {\r\n if (pos && typeof pos.x === \"number\" && typeof pos.y === \"number\") {\r\n layout.set(id, { x: pos.x, y: pos.y });\r\n }\r\n }\r\n return layout;\r\n }\r\n\r\n return null;\r\n } catch (error) {\r\n console.warn(\"[GridstackAdapter] Failed to load layout from storage:\", error);\r\n return null;\r\n }\r\n}\r\n\r\n/**\r\n * Saves layout to localStorage in Gridstack format\r\n */\r\nexport function saveLayoutToStorage(widgets: IDashboardWidget[], layout: Map<string, DashboardWidgetPlacement>): void {\r\n try {\r\n const gridstackFormat: GridStackWidget[] = widgets.map((widget) => {\r\n const placement = layout.get(widget.id);\r\n return {\r\n id: widget.id,\r\n x: placement?.x ?? widget.position?.x ?? 0,\r\n y: placement?.y ?? widget.position?.y ?? 0,\r\n // Prefer the live size. Reading `widget.size` unconditionally is what used\r\n // to discard every resize on reload, since that prop is never written back.\r\n w: placement?.width ?? widget.size.width,\r\n h: placement?.height ?? widget.size.height,\r\n };\r\n });\r\n\r\n localStorage.setItem(LAYOUT_STORAGE_KEY, JSON.stringify(gridstackFormat));\r\n } catch (error) {\r\n console.warn(\"[GridstackAdapter] Failed to save layout to storage:\", error);\r\n }\r\n}\r\n\r\n/**\r\n * Clears layout from localStorage\r\n */\r\nexport function clearLayoutStorage(): void {\r\n try {\r\n localStorage.removeItem(LAYOUT_STORAGE_KEY);\r\n } catch (error) {\r\n console.warn(\"[GridstackAdapter] Failed to clear layout storage:\", error);\r\n }\r\n}\r\n\r\n/**\r\n * Auto-arrange widgets in a grid layout\r\n * Places widgets side by side when possible, wrapping to next row\r\n */\r\nfunction autoArrangeWidgets(widgets: IDashboardWidget[], columns: number = 12): Map<string, DashboardWidgetPlacement> {\r\n const layout = new Map<string, DashboardWidgetPlacement>();\r\n\r\n // Track occupied cells in each row\r\n const rowOccupancy: Map<number, number[]> = new Map();\r\n\r\n const isPositionFree = (x: number, y: number, width: number, height: number): boolean => {\r\n for (let row = y; row < y + height; row++) {\r\n const occupied = rowOccupancy.get(row) || [];\r\n for (let col = x; col < x + width; col++) {\r\n if (occupied.includes(col)) return false;\r\n }\r\n }\r\n return true;\r\n };\r\n\r\n const occupyPosition = (x: number, y: number, width: number, height: number): void => {\r\n for (let row = y; row < y + height; row++) {\r\n const occupied = rowOccupancy.get(row) || [];\r\n for (let col = x; col < x + width; col++) {\r\n occupied.push(col);\r\n }\r\n rowOccupancy.set(row, occupied);\r\n }\r\n };\r\n\r\n const findFreePosition = (width: number, height: number): DashboardWidgetPosition => {\r\n let y = 0;\r\n while (true) {\r\n for (let x = 0; x <= columns - width; x++) {\r\n if (isPositionFree(x, y, width, height)) {\r\n return { x, y };\r\n }\r\n }\r\n y++;\r\n // Safety limit\r\n if (y > 100) break;\r\n }\r\n return { x: 0, y };\r\n };\r\n\r\n for (const widget of widgets) {\r\n const position = findFreePosition(widget.size.width, widget.size.height);\r\n layout.set(widget.id, position);\r\n occupyPosition(position.x, position.y, widget.size.width, widget.size.height);\r\n }\r\n\r\n return layout;\r\n}\r\n\r\n/**\r\n * Merges saved layout with widget defaults\r\n * Handles cases where widgets have been added/removed\r\n * Auto-arranges widgets that don't have positions\r\n */\r\nexport function mergeLayoutWithWidgets(\r\n widgets: IDashboardWidget[],\r\n savedLayout: Map<string, DashboardWidgetPlacement> | null,\r\n): Map<string, DashboardWidgetPlacement> {\r\n // If we have a saved layout with positions, use it\r\n if (savedLayout && savedLayout.size > 0) {\r\n const layout = new Map<string, DashboardWidgetPlacement>();\r\n\r\n for (const widget of widgets) {\r\n // Carries the saved size through as well — dropping it here would restore\r\n // the position but snap the widget back to its declared size.\r\n const savedPlacement = savedLayout.get(widget.id);\r\n const builtInPos = widget.position;\r\n const placement = savedPlacement ?? builtInPos ?? { x: 0, y: 0 };\r\n layout.set(widget.id, placement);\r\n }\r\n\r\n return layout;\r\n }\r\n\r\n // Check if all widgets have built-in positions\r\n const allHavePositions = widgets.every((w) => w.position !== undefined);\r\n\r\n if (allHavePositions) {\r\n const layout = new Map<string, DashboardWidgetPlacement>();\r\n for (const widget of widgets) {\r\n layout.set(widget.id, widget.position!);\r\n }\r\n return layout;\r\n }\r\n\r\n // Auto-arrange widgets\r\n return autoArrangeWidgets(widgets);\r\n}\r\n","/**\r\n * Gridstack Integration Composable\r\n *\r\n * Provides Vue 3 integration with Gridstack.js library.\r\n * Handles initialization, event binding, and cleanup.\r\n */\r\n\r\nimport { ref, shallowRef, onUnmounted, watch, nextTick, type Ref, type ShallowRef } from \"vue\";\r\nimport { GridStack, type GridStackOptions, type GridStackNode } from \"gridstack\";\r\nimport type {\r\n IDashboardWidget,\r\n DashboardWidgetPosition,\r\n DashboardWidgetPlacement,\r\n DashboardWidgetSize,\r\n} from \"@shell/dashboard/draggable-dashboard/types\";\r\nimport {\r\n toGridstackWidget,\r\n fromGridstackNode,\r\n loadLayoutFromStorage,\r\n saveLayoutToStorage,\r\n mergeLayoutWithWidgets,\r\n} from \"@shell/dashboard/draggable-dashboard/composables/useGridstackAdapter\";\r\n\r\n/**\r\n * Default Gridstack configuration\r\n */\r\nconst DEFAULT_OPTIONS: GridStackOptions = {\r\n column: 12,\r\n cellHeight: 80,\r\n margin: \"10px\",\r\n float: false,\r\n animate: true,\r\n // Disable responsive column changes - always use 12 columns\r\n columnOpts: {\r\n breakpoints: [{ w: 0, c: 12 }], // Always 12 columns regardless of width\r\n },\r\n draggable: {\r\n handle: \".grid-stack-item-content\",\r\n },\r\n resizable: {\r\n handles: \"se\", // Only bottom-right corner\r\n },\r\n};\r\n\r\n/**\r\n * Options for useGridstack composable\r\n */\r\nexport interface UseGridstackOptions {\r\n /** Gridstack configuration options */\r\n gridOptions?: Partial<GridStackOptions>;\r\n /** Enable widget resizing */\r\n resizable?: boolean;\r\n /** Auto-save layout to localStorage */\r\n autoSave?: boolean;\r\n /** Callback when layout changes */\r\n onLayoutChange?: (layout: Map<string, DashboardWidgetPlacement>) => void;\r\n}\r\n\r\n/**\r\n * Return type for useGridstack composable\r\n */\r\nexport interface UseGridstackReturn {\r\n /** Reference to GridStack instance */\r\n grid: ShallowRef<GridStack | null>;\r\n /** Current layout map: live position and, once known, live size */\r\n layout: Ref<Map<string, DashboardWidgetPlacement>>;\r\n /** Whether grid is initialized */\r\n isInitialized: Ref<boolean>;\r\n /** Initialize grid on element */\r\n initGrid: (element: HTMLElement) => void;\r\n /** Destroy grid instance */\r\n destroyGrid: () => void;\r\n /** Add a widget to the grid */\r\n addWidget: (widget: IDashboardWidget) => void;\r\n /** Remove a widget from the grid */\r\n removeWidget: (widgetId: string) => void;\r\n /** Update widget position */\r\n updateWidgetPosition: (widgetId: string, position: DashboardWidgetPosition) => void;\r\n updateWidgetSize: (widgetId: string, size: DashboardWidgetSize) => void;\r\n /** Save current layout */\r\n saveLayout: () => void;\r\n /** Load layout from storage */\r\n loadLayout: () => void;\r\n /** Reset to built-in positions */\r\n resetToDefaults: () => void;\r\n /** Batch update mode (disable animations) */\r\n batchUpdate: (fn: () => void) => void;\r\n}\r\n\r\n/**\r\n * Vue 3 composable for Gridstack integration\r\n */\r\nexport function useGridstack(widgets: Ref<IDashboardWidget[]>, options: UseGridstackOptions = {}): UseGridstackReturn {\r\n const { gridOptions = {}, resizable = false, autoSave = true, onLayoutChange } = options;\r\n\r\n // State\r\n const grid = shallowRef<GridStack | null>(null);\r\n const layout = ref<Map<string, DashboardWidgetPlacement>>(new Map());\r\n const isInitialized = ref(false);\r\n const isUpdating = ref(false);\r\n\r\n /**\r\n * Merge options with defaults\r\n */\r\n const mergedOptions: GridStackOptions = {\r\n ...DEFAULT_OPTIONS,\r\n ...gridOptions,\r\n disableResize: !resizable,\r\n };\r\n\r\n /**\r\n * Initialize the grid on a DOM element\r\n */\r\n const initGrid = (element: HTMLElement): void => {\r\n if (grid.value) {\r\n console.warn(\"[useGridstack] Grid already initialized\");\r\n return;\r\n }\r\n\r\n // Load saved layout\r\n const savedLayout = loadLayoutFromStorage();\r\n layout.value = mergeLayoutWithWidgets(widgets.value, savedLayout);\r\n\r\n // Initialize Gridstack\r\n grid.value = GridStack.init(mergedOptions, element);\r\n\r\n // Bind event handlers\r\n grid.value.on(\"change\", handleChange);\r\n grid.value.on(\"added\", handleAdded);\r\n grid.value.on(\"removed\", handleRemoved);\r\n\r\n // Explicitly load widgets with their positions to ensure proper layout\r\n // This is needed because Vue renders DOM after Gridstack.init() processes children\r\n const widgetData = widgets.value.map((widget) => {\r\n const position = layout.value.get(widget.id);\r\n return toGridstackWidget(widget, position);\r\n });\r\n\r\n // Use load() to apply positions - this updates existing items\r\n grid.value.load(widgetData);\r\n\r\n isInitialized.value = true;\r\n };\r\n\r\n /**\r\n * Handle grid change events (drag/resize)\r\n */\r\n const handleChange = (_event: Event, nodes: GridStackNode[]): void => {\r\n if (isUpdating.value) return;\r\n\r\n for (const node of nodes) {\r\n const { id, position } = fromGridstackNode(node);\r\n if (id) {\r\n // Size is recorded too, so a mouse resize reaches state and storage. Read\r\n // straight off the node rather than via fromGridstackNode, which defaults\r\n // a missing w/h to 1 — persisting that invented 1 would shrink the widget.\r\n const previous = layout.value.get(id);\r\n const width = typeof node.w === \"number\" ? node.w : previous?.width;\r\n const height = typeof node.h === \"number\" ? node.h : previous?.height;\r\n layout.value.set(id, {\r\n ...position,\r\n ...(typeof width === \"number\" ? { width } : {}),\r\n ...(typeof height === \"number\" ? { height } : {}),\r\n });\r\n }\r\n }\r\n\r\n // Trigger reactivity\r\n layout.value = new Map(layout.value);\r\n\r\n // Notify callback\r\n onLayoutChange?.(layout.value);\r\n\r\n // Auto-save\r\n if (autoSave) {\r\n saveLayout();\r\n }\r\n };\r\n\r\n /**\r\n * Handle widget added event\r\n */\r\n const handleAdded = (_event: Event, nodes: GridStackNode[]): void => {\r\n for (const node of nodes) {\r\n const { id, position } = fromGridstackNode(node);\r\n if (id && !layout.value.has(id)) {\r\n layout.value.set(id, position);\r\n }\r\n }\r\n layout.value = new Map(layout.value);\r\n };\r\n\r\n /**\r\n * Handle widget removed event\r\n */\r\n const handleRemoved = (_event: Event, nodes: GridStackNode[]): void => {\r\n for (const node of nodes) {\r\n if (node.id) {\r\n layout.value.delete(node.id);\r\n }\r\n }\r\n layout.value = new Map(layout.value);\r\n };\r\n\r\n /**\r\n * Destroy the grid instance\r\n */\r\n const destroyGrid = (): void => {\r\n if (grid.value) {\r\n grid.value.off(\"change\");\r\n grid.value.off(\"added\");\r\n grid.value.off(\"removed\");\r\n grid.value.destroy(false); // false = don't remove DOM elements\r\n grid.value = null;\r\n isInitialized.value = false;\r\n }\r\n };\r\n\r\n /**\r\n * Add a widget to the grid\r\n */\r\n const addWidget = (widget: IDashboardWidget): void => {\r\n if (!grid.value) return;\r\n\r\n const position = layout.value.get(widget.id) ?? widget.position;\r\n const gsWidget = toGridstackWidget(widget, position);\r\n\r\n // Find the DOM element for this widget\r\n const element = document.querySelector(`[gs-id=\"${widget.id}\"]`);\r\n if (element) {\r\n grid.value.makeWidget(element as HTMLElement, gsWidget);\r\n }\r\n };\r\n\r\n /**\r\n * Remove a widget from the grid\r\n */\r\n const removeWidget = (widgetId: string): void => {\r\n if (!grid.value) return;\r\n\r\n const element = document.querySelector(`[gs-id=\"${widgetId}\"]`);\r\n if (element) {\r\n grid.value.removeWidget(element as HTMLElement, false);\r\n }\r\n layout.value.delete(widgetId);\r\n };\r\n\r\n /**\r\n * Records where a widget actually ended up after a programmatic update.\r\n *\r\n * Reads the values back off the Gridstack node rather than trusting the ones we\r\n * asked for: Gridstack clamps to the grid edges and compacts the rows, so the\r\n * requested cell and the resulting cell often differ. Writing the requested\r\n * values instead is what made the layout state — and every announcement derived\r\n * from it — disagree with the DOM.\r\n *\r\n * `requested` is the fallback for environments where the node is not exposed\r\n * (notably unit tests with a stubbed grid).\r\n */\r\n const recordPlacementFromNode = (\r\n widgetId: string,\r\n element: Element,\r\n requestedPosition?: DashboardWidgetPosition,\r\n requestedSize?: DashboardWidgetSize,\r\n ): void => {\r\n const node = (element as HTMLElement & { gridstackNode?: GridStackNode }).gridstackNode;\r\n const previous = layout.value.get(widgetId);\r\n\r\n const x = node?.x ?? requestedPosition?.x ?? previous?.x ?? 0;\r\n const y = node?.y ?? requestedPosition?.y ?? previous?.y ?? 0;\r\n const width = node?.w ?? requestedSize?.width ?? previous?.width;\r\n const height = node?.h ?? requestedSize?.height ?? previous?.height;\r\n\r\n layout.value.set(widgetId, {\r\n x,\r\n y,\r\n ...(typeof width === \"number\" ? { width } : {}),\r\n ...(typeof height === \"number\" ? { height } : {}),\r\n });\r\n layout.value = new Map(layout.value);\r\n };\r\n\r\n /**\r\n * Update widget position programmatically\r\n */\r\n const updateWidgetPosition = (widgetId: string, position: DashboardWidgetPosition): void => {\r\n if (!grid.value) return;\r\n\r\n const element = document.querySelector(`[gs-id=\"${widgetId}\"]`);\r\n if (element) {\r\n isUpdating.value = true;\r\n grid.value.update(element as HTMLElement, { x: position.x, y: position.y });\r\n recordPlacementFromNode(widgetId, element, position);\r\n isUpdating.value = false;\r\n }\r\n };\r\n\r\n /**\r\n * Counterpart of updateWidgetPosition for the size axis, so a widget can be\r\n * resized programmatically — keyboard resizing has no drag handle to simulate.\r\n */\r\n const updateWidgetSize = (widgetId: string, size: DashboardWidgetSize): void => {\r\n if (!grid.value) return;\r\n\r\n const element = document.querySelector(`[gs-id=\"${widgetId}\"]`);\r\n if (element) {\r\n isUpdating.value = true;\r\n grid.value.update(element as HTMLElement, { w: size.width, h: size.height });\r\n recordPlacementFromNode(widgetId, element, undefined, size);\r\n isUpdating.value = false;\r\n }\r\n };\r\n\r\n /**\r\n * Save current layout to localStorage\r\n */\r\n const saveLayout = (): void => {\r\n saveLayoutToStorage(widgets.value, layout.value);\r\n };\r\n\r\n /**\r\n * Load layout from localStorage\r\n */\r\n const loadLayout = (): void => {\r\n const savedLayout = loadLayoutFromStorage();\r\n if (savedLayout) {\r\n layout.value = mergeLayoutWithWidgets(widgets.value, savedLayout);\r\n applyLayoutToGrid();\r\n }\r\n };\r\n\r\n /**\r\n * Reset to built-in widget positions\r\n */\r\n const resetToDefaults = (): void => {\r\n layout.value = new Map();\r\n for (const widget of widgets.value) {\r\n if (widget.position) {\r\n layout.value.set(widget.id, { ...widget.position });\r\n }\r\n }\r\n applyLayoutToGrid();\r\n saveLayout();\r\n };\r\n\r\n /**\r\n * Apply current layout to grid\r\n */\r\n const applyLayoutToGrid = (): void => {\r\n if (!grid.value) return;\r\n\r\n isUpdating.value = true;\r\n grid.value.batchUpdate();\r\n\r\n for (const widget of widgets.value) {\r\n const placement = layout.value.get(widget.id);\r\n if (placement) {\r\n const element = document.querySelector(`[gs-id=\"${widget.id}\"]`);\r\n if (element) {\r\n grid.value.update(element as HTMLElement, {\r\n x: placement.x,\r\n y: placement.y,\r\n // Restores a persisted size; omitted when unknown so Gridstack keeps\r\n // whatever the element already declares.\r\n ...(typeof placement.width === \"number\" ? { w: placement.width } : {}),\r\n ...(typeof placement.height === \"number\" ? { h: placement.height } : {}),\r\n });\r\n }\r\n }\r\n }\r\n\r\n grid.value.batchUpdate(false);\r\n isUpdating.value = false;\r\n };\r\n\r\n /**\r\n * Execute function in batch update mode\r\n */\r\n const batchUpdate = (fn: () => void): void => {\r\n if (!grid.value) {\r\n fn();\r\n return;\r\n }\r\n\r\n isUpdating.value = true;\r\n grid.value.batchUpdate();\r\n fn();\r\n grid.value.batchUpdate(false);\r\n isUpdating.value = false;\r\n };\r\n\r\n // Watch for widget changes\r\n watch(\r\n widgets,\r\n async (newWidgets, oldWidgets) => {\r\n if (!grid.value || !isInitialized.value) return;\r\n\r\n await nextTick();\r\n\r\n // Find added widgets\r\n const addedWidgets = newWidgets.filter((w) => !oldWidgets?.some((ow) => ow.id === w.id));\r\n\r\n // Find removed widgets\r\n const removedWidgetIds =\r\n oldWidgets?.filter((w) => !newWidgets.some((nw) => nw.id === w.id)).map((w) => w.id) ?? [];\r\n\r\n // Remove old widgets\r\n for (const id of removedWidgetIds) {\r\n removeWidget(id);\r\n }\r\n\r\n // Add new widgets\r\n for (const widget of addedWidgets) {\r\n addWidget(widget);\r\n }\r\n },\r\n { deep: false },\r\n );\r\n\r\n // Cleanup on unmount\r\n onUnmounted(() => {\r\n destroyGrid();\r\n });\r\n\r\n return {\r\n grid,\r\n layout,\r\n isInitialized,\r\n initGrid,\r\n destroyGrid,\r\n addWidget,\r\n removeWidget,\r\n updateWidgetPosition,\r\n updateWidgetSize,\r\n saveLayout,\r\n loadLayout,\r\n resetToDefaults,\r\n batchUpdate,\r\n };\r\n}\r\n","<template>\n <div\n class=\"dashboard-widget-skeleton\"\n aria-hidden=\"true\"\n >\n <div class=\"dashboard-widget-skeleton__header\">\n <div class=\"dashboard-widget-skeleton__icon\" />\n <div class=\"dashboard-widget-skeleton__title\" />\n </div>\n <div class=\"dashboard-widget-skeleton__stats\">\n <div class=\"dashboard-widget-skeleton__stat\" />\n <div class=\"dashboard-widget-skeleton__stat\" />\n <div class=\"dashboard-widget-skeleton__stat\" />\n </div>\n <div class=\"dashboard-widget-skeleton__body\">\n <div class=\"dashboard-widget-skeleton__line dashboard-widget-skeleton__line--w80\" />\n <div class=\"dashboard-widget-skeleton__line dashboard-widget-skeleton__line--w60\" />\n <div class=\"dashboard-widget-skeleton__line dashboard-widget-skeleton__line--w90\" />\n <div class=\"dashboard-widget-skeleton__line dashboard-widget-skeleton__line--w70\" />\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\"></script>\n\n<style lang=\"scss\">\n:root {\n --dashboard-widget-skeleton-bg: var(--dashboard-widget-card-background, var(--additional-50));\n --dashboard-widget-skeleton-border-color: var(--dashboard-widget-card-border-color, var(--neutrals-200));\n --dashboard-widget-skeleton-radius: var(--dashboard-widget-card-border-radius, 8px);\n --dashboard-widget-skeleton-shadow: var(\n --dashboard-widget-card-shadow,\n 0 1px 3px rgba(0, 0, 0, 0.08) 0 1px 2px rgba(0, 0, 0, 0.06)\n );\n --dashboard-widget-skeleton-shimmer-from: var(--neutrals-100);\n --dashboard-widget-skeleton-shimmer-to: var(--neutrals-200);\n}\n\n@keyframes dashboard-widget-skeleton-shimmer {\n 0% {\n background-position: -400px 0;\n }\n 100% {\n background-position: 400px 0;\n }\n}\n\n.dashboard-widget-skeleton {\n @apply tw-overflow-hidden tw-h-full tw-flex tw-flex-col;\n background: var(--dashboard-widget-skeleton-bg);\n border: 1px solid var(--dashboard-widget-skeleton-border-color);\n border-radius: var(--dashboard-widget-skeleton-radius);\n box-shadow: var(--dashboard-widget-skeleton-shadow);\n\n %shimmer {\n background: linear-gradient(\n 90deg,\n var(--dashboard-widget-skeleton-shimmer-from) 0%,\n var(--dashboard-widget-skeleton-shimmer-to) 50%,\n var(--dashboard-widget-skeleton-shimmer-from) 100%\n );\n background-size: 800px 100%;\n animation: dashboard-widget-skeleton-shimmer 1.4s ease-in-out infinite;\n border-radius: 4px;\n }\n\n &__header {\n @apply tw-px-5 tw-py-4 tw-flex tw-items-center tw-gap-3;\n }\n\n &__icon {\n @apply tw-w-9 tw-h-9 tw-rounded-lg tw-flex-shrink-0;\n @extend %shimmer;\n }\n\n &__title {\n @apply tw-h-5 tw-flex-1 tw-max-w-[180px];\n @extend %shimmer;\n }\n\n &__stats {\n @apply tw-px-5 tw-py-3 tw-flex tw-items-center tw-gap-6;\n border-top: 1px solid var(--dashboard-widget-skeleton-border-color);\n border-bottom: 1px solid var(--dashboard-widget-skeleton-border-color);\n }\n\n &__stat {\n @apply tw-h-6 tw-flex-1;\n @extend %shimmer;\n }\n\n &__body {\n @apply tw-flex-1 tw-min-h-0 tw-px-5 tw-py-4 tw-flex tw-flex-col tw-gap-3;\n }\n\n &__line {\n @apply tw-h-3;\n @extend %shimmer;\n\n &--w60 {\n @apply tw-w-3/5;\n }\n &--w70 {\n @apply tw-w-7/12;\n }\n &--w80 {\n @apply tw-w-4/5;\n }\n &--w90 {\n @apply tw-w-11/12;\n }\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .dashboard-widget-skeleton {\n %shimmer {\n animation: none;\n }\n }\n}\n</style>\n","<template>\n <VcContainer\n no-padding\n class=\"vc-gridstack-dashboard\"\n >\n <div\n v-if=\"!modulesReady\"\n class=\"vc-gridstack-dashboard__skeleton-grid\"\n role=\"status\"\n aria-busy=\"true\"\n :aria-label=\"ariaLabel\"\n >\n <DashboardWidgetSkeleton\n v-for=\"(item, index) in skeletonItems\"\n :key=\"`skeleton-${index}`\"\n class=\"vc-gridstack-dashboard__skeleton-item\"\n :style=\"skeletonItemStyle(item)\"\n />\n </div>\n <div\n v-else\n ref=\"gridRef\"\n class=\"grid-stack vc-gridstack-dashboard__grid\"\n role=\"list\"\n :aria-label=\"ariaLabel\"\n >\n <div\n v-for=\"(widget, index) in widgets\"\n :key=\"widget.id\"\n class=\"grid-stack-item\"\n :class=\"{ 'vc-gridstack-dashboard__item--grabbed': grabbedWidgetId === widget.id }\"\n :gs-id=\"widget.id\"\n :gs-x=\"getPosition(widget.id)?.x ?? widget.position?.x ?? 0\"\n :gs-y=\"getPosition(widget.id)?.y ?? widget.position?.y ?? 0\"\n :gs-w=\"sizeOf(widget).width\"\n :gs-h=\"sizeOf(widget).height\"\n :gs-min-w=\"2\"\n :gs-min-h=\"2\"\n role=\"listitem\"\n tabindex=\"0\"\n :aria-label=\"getWidgetAriaLabel(widget, index)\"\n @keydown=\"onWidgetKeydown($event, widget)\"\n >\n <div class=\"grid-stack-item-content\">\n <!-- Drag handle (optional) -->\n <div\n v-if=\"showDragHandles\"\n class=\"vc-gridstack-dashboard__drag-handle\"\n aria-hidden=\"true\"\n >\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n >\n <circle\n cx=\"5\"\n cy=\"3\"\n r=\"1.5\"\n />\n <circle\n cx=\"11\"\n cy=\"3\"\n r=\"1.5\"\n />\n <circle\n cx=\"5\"\n cy=\"8\"\n r=\"1.5\"\n />\n <circle\n cx=\"11\"\n cy=\"8\"\n r=\"1.5\"\n />\n <circle\n cx=\"5\"\n cy=\"13\"\n r=\"1.5\"\n />\n <circle\n cx=\"11\"\n cy=\"13\"\n r=\"1.5\"\n />\n </svg>\n </div>\n\n <!-- Widget content -->\n <component\n :is=\"widget.component\"\n v-bind=\"widget.props || {}\"\n class=\"vc-gridstack-dashboard__widget-content\"\n />\n </div>\n </div>\n </div>\n\n <!-- Screen reader announcements -->\n <div\n class=\"vc-gridstack-dashboard__live-region\"\n role=\"status\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n {{ liveAnnouncement }}\n </div>\n </VcContainer>\n</template>\n\n<script setup lang=\"ts\">\n/**\n * GridstackDashboard Component\n *\n * A flexible dashboard powered by Gridstack.js that allows widgets to be\n * dragged and arranged in a grid layout.\n *\n * Features:\n * - Drag and drop interface for arranging widgets\n * - Optional widget resizing\n * - Automatic layout persistence in localStorage\n * - Support for built-in widget positions\n * - Accessibility support\n */\nimport { ref, computed, onMounted, nextTick, inject, watch } from \"vue\";\nimport type {\n IDashboardWidget,\n DashboardWidgetPosition,\n DashboardWidgetSize,\n} from \"@shell/dashboard/draggable-dashboard/types\";\nimport { useDashboard } from \"@core/composables/useDashboard\";\nimport { useGridstack } from \"@shell/dashboard/draggable-dashboard/composables/useGridstack\";\nimport VcContainer from \"@ui/components/atoms/vc-container/vc-container.vue\";\nimport DashboardWidgetSkeleton from \"@shell/dashboard/draggable-dashboard/DashboardWidgetSkeleton.vue\";\nimport { ModulesReadyKey } from \"@framework/injection-keys\";\nimport { LAYOUT_STORAGE_KEY } from \"@shell/dashboard/draggable-dashboard/composables/useGridstackAdapter\";\nimport \"gridstack/dist/gridstack.min.css\";\n\ninterface SkeletonItem {\n x: number;\n y: number;\n w: number;\n h: number;\n}\n\n// Default placeholders shown when there's no persisted layout yet (first visit).\n// 6×6 matches the typical real widget size in vc-shell apps.\nconst DEFAULT_SKELETONS: SkeletonItem[] = [\n { x: 0, y: 0, w: 6, h: 6 },\n { x: 6, y: 0, w: 6, h: 6 },\n { x: 0, y: 6, w: 6, h: 6 },\n { x: 6, y: 6, w: 6, h: 6 },\n];\n\nfunction readPersistedSkeletons(): SkeletonItem[] | null {\n if (typeof window === \"undefined\") return null;\n try {\n const raw = window.localStorage.getItem(LAYOUT_STORAGE_KEY);\n if (!raw) return null;\n const parsed = JSON.parse(raw);\n if (!Array.isArray(parsed)) return null;\n const items = parsed\n .filter(\n (n: unknown): n is SkeletonItem =>\n !!n &&\n typeof n === \"object\" &&\n typeof (n as SkeletonItem).w === \"number\" &&\n typeof (n as SkeletonItem).h === \"number\" &&\n typeof (n as SkeletonItem).x === \"number\" &&\n typeof (n as SkeletonItem).y === \"number\",\n )\n .map((n) => ({ x: n.x, y: n.y, w: n.w, h: n.h }));\n return items.length > 0 ? items : null;\n } catch {\n return null;\n }\n}\n\n// Props\ninterface Props {\n /** Show drag handle icons on widgets */\n showDragHandles?: boolean;\n /** Enable widget resizing */\n resizable?: boolean;\n /** Aria label for the dashboard container */\n ariaLabel?: string;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n showDragHandles: false,\n resizable: false,\n ariaLabel: \"Dashboard widgets. Drag a widget, or focus one and press Enter to rearrange with the arrow keys.\",\n});\n\n// Refs\nconst gridRef = ref<HTMLElement | null>(null);\nconst liveAnnouncement = ref(\"\");\n\n// Gate dashboard rendering until remote modules finish installing.\n// Without this, widgets preregistered during loadRemote() can mount before\n// their owning module's `defineAppModule.install` runs `mergeLocaleMessage`,\n// causing missing translations. Fallback `ref(true)` keeps tests/stories and\n// hosts without MF working unchanged.\nconst modulesReady = inject(ModulesReadyKey, ref(true));\n\n// Skeleton placeholders shown until modules finish loading. Pulled from the last\n// persisted layout (so returning users see card sizes matching their real dashboard);\n// fallback to a generic 4-card grid on first visit.\nconst skeletonItems = computed<SkeletonItem[]>(() => {\n if (modulesReady.value) return [];\n return readPersistedSkeletons() ?? DEFAULT_SKELETONS;\n});\n\nconst skeletonItemStyle = (item: SkeletonItem): Record<string, string> => ({\n gridColumn: `${item.x + 1} / span ${item.w}`,\n gridRow: `${item.y + 1} / span ${item.h}`,\n});\n\n// Dashboard service\nconst dashboard = useDashboard();\nconst widgets = computed(() => dashboard.getWidgets() as IDashboardWidget[]);\n\n// Gridstack integration\nconst { layout, isInitialized, initGrid, saveLayout, resetToDefaults, updateWidgetPosition, updateWidgetSize } =\n useGridstack(widgets, {\n resizable: props.resizable,\n autoSave: true,\n gridOptions: {\n draggable: {\n handle: props.showDragHandles ? \".vc-gridstack-dashboard__drag-handle\" : \".grid-stack-item-content\",\n },\n },\n onLayoutChange: (newLayout) => {\n // Sync with dashboard service\n for (const [widgetId, position] of newLayout) {\n dashboard.updateWidgetPosition(widgetId, position);\n }\n announceToScreenReader(\"Widget positions updated\");\n },\n });\n\n// Helper to get widget position\nconst getPosition = (widgetId: string): DashboardWidgetPosition | undefined => {\n return layout.value.get(widgetId);\n};\n\n// --- Keyboard reordering (WCAG 2.5.7: dragging must have a non-drag alternative) ---\n//\n// Gridstack only offers pointer dragging, so the widget itself becomes the control:\n// Enter/Space picks it up, arrows move it a cell at a time, Shift+arrows resize,\n// Enter drops, Escape restores the position it was picked up from.\nconst grabbedWidgetId = ref<string | null>(null);\nconst grabbedOrigin = ref<DashboardWidgetPosition | null>(null);\n// Escape has to restore the size too, now that Shift+arrows can change it.\nconst grabbedOriginSize = ref<DashboardWidgetSize | null>(null);\n\n// Mirrors gs-min-w / gs-min-h on the item.\nconst MIN_WIDGET_SPAN = 2;\n\nconst positionOf = (widget: IDashboardWidget): DashboardWidgetPosition =>\n layout.value.get(widget.id) ?? widget.position ?? { x: 0, y: 0 };\n\n// The live size, mirroring positionOf. `widget.size` is only the declared default\n// and is never written back to, so reading it directly made every resize compute\n// from the same baseline instead of from the current size.\nconst sizeOf = (widget: IDashboardWidget): DashboardWidgetSize => {\n const placement = layout.value.get(widget.id);\n return {\n width: placement?.width ?? widget.size.width,\n height: placement?.height ?? widget.size.height,\n };\n};\n\nconst widgetName = (widget: IDashboardWidget): string => widget.name || widget.id;\n\nconst pickUpWidget = (widget: IDashboardWidget): void => {\n grabbedWidgetId.value = widget.id;\n grabbedOrigin.value = { ...positionOf(widget) };\n grabbedOriginSize.value = { ...sizeOf(widget) };\n announceToScreenReader(\n `${widgetName(widget)} picked up. Use arrow keys to move, Shift and arrow keys to resize, Enter to drop, Escape to cancel.`,\n );\n};\n\nconst dropWidget = (widget: IDashboardWidget): void => {\n grabbedWidgetId.value = null;\n grabbedOrigin.value = null;\n grabbedOriginSize.value = null;\n saveLayout();\n const { x, y } = positionOf(widget);\n announceToScreenReader(`${widgetName(widget)} dropped at column ${x + 1}, row ${y + 1}.`);\n};\n\nconst cancelWidgetMove = (widget: IDashboardWidget): void => {\n const origin = grabbedOrigin.value;\n const originSize = grabbedOriginSize.value;\n const current = sizeOf(widget);\n\n if (originSize && (originSize.width !== current.width || originSize.height !== current.height)) {\n updateWidgetSize(widget.id, originSize);\n }\n if (origin) {\n updateWidgetPosition(widget.id, origin);\n }\n\n grabbedWidgetId.value = null;\n grabbedOrigin.value = null;\n grabbedOriginSize.value = null;\n announceToScreenReader(`Move cancelled. ${widgetName(widget)} returned to its original position and size.`);\n};\n\nconst moveWidgetBy = (widget: IDashboardWidget, dx: number, dy: number): void => {\n const current = positionOf(widget);\n const next = { x: current.x + dx, y: current.y + dy };\n // Gridstack clamps silently; refusing the move keeps the announcement honest.\n if (next.x < 0 || next.y < 0) return;\n\n updateWidgetPosition(widget.id, next);\n // Announce where the widget actually landed, not where it was asked to go —\n // Gridstack compacts rows, so the two differ.\n // Announce where the widget actually landed, not where it was asked to go —\n // Gridstack compacts rows, so the two differ.\n const landed = positionOf(widget);\n announceToScreenReader(`${widgetName(widget)} moved to column ${landed.x + 1}, row ${landed.y + 1}.`);\n};\n\nconst resizeWidgetBy = (widget: IDashboardWidget, dw: number, dh: number): void => {\n const current = sizeOf(widget);\n // Only the requested axis changes; sending both would drag the untouched one\n // back to its baseline.\n const width = dw ? Math.max(MIN_WIDGET_SPAN, current.width + dw) : current.width;\n const height = dh ? Math.max(MIN_WIDGET_SPAN, current.height + dh) : current.height;\n if (width === current.width && height === current.height) return;\n\n updateWidgetSize(widget.id, { width, height });\n const applied = sizeOf(widget);\n announceToScreenReader(`${widgetName(widget)} resized to ${applied.width} by ${applied.height} cells.`);\n};\n\nconst onWidgetKeydown = (event: KeyboardEvent, widget: IDashboardWidget): void => {\n if (event.target !== event.currentTarget) return;\n\n const isGrabbed = grabbedWidgetId.value === widget.id;\n\n if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault();\n if (isGrabbed) dropWidget(widget);\n else {\n // Starting another move cancels the unfinished one so its origin is not lost.\n const grabbedWidget = widgets.value.find((candidate) => candidate.id === grabbedWidgetId.value);\n if (grabbedWidget) cancelWidgetMove(grabbedWidget);\n pickUpWidget(widget);\n }\n return;\n }\n\n if (event.key === \"Escape\" && isGrabbed) {\n event.preventDefault();\n cancelWidgetMove(widget);\n return;\n }\n\n const dx = event.key === \"ArrowLeft\" ? -1 : event.key === \"ArrowRight\" ? 1 : 0;\n const dy = event.key === \"ArrowUp\" ? -1 : event.key === \"ArrowDown\" ? 1 : 0;\n if ((dx === 0 && dy === 0) || !isGrabbed) return;\n\n event.preventDefault();\n if (event.shiftKey) {\n if (props.resizable) resizeWidgetBy(widget, dx, dy);\n } else {\n moveWidgetBy(widget, dx, dy);\n }\n};\n\n// Accessibility helpers\nconst getWidgetAriaLabel = (widget: IDashboardWidget, index: number): string => {\n const name = widget.name || widget.id;\n const state =\n grabbedWidgetId.value === widget.id\n ? \"Picked up. Arrow keys move, Enter drops, Escape cancels.\"\n : \"Press Enter to pick up and rearrange with the arrow keys.\";\n return `${name}, widget ${index + 1} of ${widgets.value.length}. ${state}`;\n};\n\nconst announceToScreenReader = (message: string): void => {\n liveAnnouncement.value = message;\n setTimeout(() => {\n liveAnnouncement.value = \"\";\n }, 1000);\n};\n\nconst tryInitGrid = async (): Promise<void> => {\n await nextTick();\n if (gridRef.value && !isInitialized.value) {\n initGrid(gridRef.value);\n }\n};\n\nonMounted(tryInitGrid);\n\n// When modules finish loading, the v-if mounts gridRef — initialize gridstack then.\nwatch(modulesReady, (ready) => {\n if (ready) tryInitGrid();\n});\n\n// Public methods\nconst rearrangeWidgets = (): void => {\n resetToDefaults();\n};\n\nconst recalculateLayout = (): void => {\n // Gridstack handles this automatically\n};\n\nconst useBuiltInPositions = (): boolean => {\n resetToDefaults();\n return true;\n};\n\n// Expose public methods\ndefineExpose({\n rearrangeWidgets,\n recalculateLayout,\n saveLayout,\n useBuiltInPositions,\n});\n</script>\n\n<style lang=\"scss\">\n@import \"gridstack/dist/gridstack.min.css\";\n\n:root {\n --gridstack-dashboard-background: var(--additional-50);\n --gridstack-widget-background: var(--additional-50);\n --gridstack-widget-border-radius: 8px;\n --gridstack-widget-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);\n --gridstack-widget-shadow-dragging: 0 8px 24px rgba(0, 0, 0, 0.15);\n --gridstack-placeholder-background: rgba(59, 130, 246, 0.1);\n --gridstack-placeholder-border: rgba(59, 130, 246, 0.5);\n --gridstack-drag-handle-color: var(--neutrals-400);\n --gridstack-drag-handle-color-hover: var(--neutrals-600);\n --gridstack-widget-focus-ring-color: var(--primary-500);\n}\n\n.vc-gridstack-dashboard {\n background-color: var(--gridstack-dashboard-background);\n min-height: 100%;\n\n &__grid {\n padding: 24px 18px;\n min-height: calc(80px * 8 + 24px * 2); // 8 rows minimum\n }\n\n // Widgets are focusable so they can be rearranged from the keyboard.\n .grid-stack-item:focus-visible {\n @apply tw-outline-none tw-ring-[3px] tw-ring-[color:var(--gridstack-widget-focus-ring-color)];\n border-radius: var(--gridstack-widget-border-radius);\n }\n\n // Picked up for a keyboard move: the pointer equivalent of \"being dragged\".\n &__item--grabbed {\n z-index: var(--z-local-above);\n\n .grid-stack-item-content {\n box-shadow: var(--gridstack-widget-shadow-dragging);\n outline: 2px dashed var(--gridstack-placeholder-border);\n outline-offset: 2px;\n }\n }\n\n // Skeleton grid mirrors gridstack's 12-column geometry. Row height and gap are\n // tuned so a 6×6 placeholder visually matches a real 6×6 widget rendered by\n // gridstack (which collapses margins differently than a plain CSS grid).\n &__skeleton-grid {\n display: grid;\n grid-template-columns: repeat(12, 1fr);\n grid-auto-rows: 55px;\n gap: 20px;\n padding: 24px 18px;\n min-height: calc(55px * 8 + 24px * 2);\n }\n\n &__skeleton-item {\n min-width: 0;\n min-height: 0;\n }\n\n // Widget item styling\n .grid-stack-item {\n &-content {\n background: var(--gridstack-widget-background);\n border-radius: var(--gridstack-widget-border-radius);\n box-shadow: var(--gridstack-widget-shadow);\n overflow: hidden;\n // Note: Don't set height: 100% - Gridstack uses position: absolute with inset for margins\n transition: box-shadow 0.2s ease;\n }\n\n // Dragging state\n &.ui-draggable-dragging {\n .grid-stack-item-content {\n box-shadow: var(--gridstack-widget-shadow-dragging);\n }\n }\n\n // Resizing state\n &.ui-resizable-resizing {\n .grid-stack-item-content {\n box-shadow: var(--gridstack-widget-shadow-dragging);\n }\n }\n }\n\n // Placeholder styling\n .grid-stack-placeholder {\n > .placeholder-content {\n background: var(--gridstack-placeholder-background);\n border: 2px dashed var(--gridstack-placeholder-border);\n border-radius: var(--gridstack-widget-border-radius);\n }\n }\n\n // Drag handle\n &__drag-handle {\n position: absolute;\n top: 8px;\n right: 8px;\n z-index: var(--z-local-sticky);\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n color: var(--gridstack-drag-handle-color);\n cursor: grab;\n border-radius: 4px;\n transition:\n color 0.15s ease,\n background-color 0.15s ease;\n\n &:hover {\n color: var(--gridstack-drag-handle-color-hover);\n background-color: rgba(0, 0, 0, 0.05);\n }\n\n &:active {\n cursor: grabbing;\n }\n }\n\n // Widget content\n &__widget-content {\n width: 100%;\n height: 100%;\n }\n\n // Screen reader only\n &__live-region {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n }\n}\n\n// Respect reduced motion preference\n@media (prefers-reduced-motion: reduce) {\n .vc-gridstack-dashboard {\n .grid-stack-item {\n transition: none !important;\n\n &-content {\n transition: none !important;\n }\n }\n }\n\n .grid-stack {\n &.grid-stack-animate {\n .grid-stack-item {\n transition: none !important;\n }\n }\n }\n}\n</style>\n","<template>\n <GridstackDashboard\n ref=\"dashboardRef\"\n :show-drag-handles=\"showDragHandles\"\n :resizable=\"resizable\"\n :aria-label=\"ariaLabel\"\n />\n</template>\n\n<script setup lang=\"ts\">\n/**\n * DraggableDashboard Component\n *\n * A flexible dashboard powered by Gridstack.js that allows widgets to be\n * dragged and arranged in a grid layout.\n *\n * Features:\n * - Drag and drop interface for arranging widgets\n * - Automatic layout persistence in localStorage\n * - Support for built-in widget positions\n * - Accessibility support (a11y)\n * - Optional widget resizing\n */\nimport { ref } from \"vue\";\nimport GridstackDashboard from \"@shell/dashboard/draggable-dashboard/GridstackDashboard.vue\";\n\n// Props\ninterface Props {\n /** Show drag handle icons on widgets */\n showDragHandles?: boolean;\n /** Enable widget resizing */\n resizable?: boolean;\n /** Aria label for the dashboard container */\n ariaLabel?: string;\n}\n\nwithDefaults(defineProps<Props>(), {\n showDragHandles: false,\n resizable: false,\n ariaLabel: \"Dashboard widgets. Drag widgets to rearrange.\",\n});\n\n// State\nconst dashboardRef = ref<InstanceType<typeof GridstackDashboard> | null>(null);\n\n// Public methods (delegated to GridstackDashboard)\nconst rearrangeWidgets = (): void => {\n dashboardRef.value?.rearrangeWidgets?.();\n};\n\nconst recalculateLayout = (): void => {\n dashboardRef.value?.recalculateLayout?.();\n};\n\nconst saveLayout = (): void => {\n dashboardRef.value?.saveLayout?.();\n};\n\nconst useBuiltInPositions = (): boolean => {\n return dashboardRef.value?.useBuiltInPositions?.() ?? false;\n};\n\n// Expose public methods\ndefineExpose({\n rearrangeWidgets,\n recalculateLayout,\n saveLayout,\n useBuiltInPositions,\n});\n</script>\n","// Main component\nexport { default as DraggableDashboard } from \"@shell/dashboard/draggable-dashboard/DraggableDashboard.vue\";\n\n// Types\nexport type {\n IDashboardWidget,\n DashboardWidgetPosition,\n DashboardWidgetSize,\n DashboardDragEvent,\n DashboardGridConfig,\n} from \"@shell/dashboard/draggable-dashboard/types\";\n\n// Gridstack composables (for advanced usage)\nexport { useGridstack } from \"@shell/dashboard/draggable-dashboard/composables/useGridstack\";\nexport type {\n UseGridstackOptions,\n UseGridstackReturn,\n} from \"@shell/dashboard/draggable-dashboard/composables/useGridstack\";\n\n// Import and re-export to avoid Storybook docgen issues with direct re-exports\nimport {\n toGridstackWidget as _toGridstackWidget,\n fromGridstackNode as _fromGridstackNode,\n loadLayoutFromStorage as _loadLayoutFromStorage,\n saveLayoutToStorage as _saveLayoutToStorage,\n mergeLayoutWithWidgets as _mergeLayoutWithWidgets,\n clearLayoutStorage as _clearLayoutStorage,\n LAYOUT_STORAGE_KEY as _LAYOUT_STORAGE_KEY,\n} from \"@shell/dashboard/draggable-dashboard/composables/useGridstackAdapter\";\n\nexport const toGridstackWidget = _toGridstackWidget;\nexport const fromGridstackNode = _fromGridstackNode;\nexport const loadLayoutFromStorage = _loadLayoutFromStorage;\nexport const saveLayoutToStorage = _saveLayoutToStorage;\nexport const mergeLayoutWithWidgets = _mergeLayoutWithWidgets;\nexport const clearLayoutStorage = _clearLayoutStorage;\nexport const LAYOUT_STORAGE_KEY = _LAYOUT_STORAGE_KEY;\n","<template>\n <div class=\"dashboard-widget-card\">\n <div class=\"dashboard-widget-card__header\">\n <slot name=\"header\">\n <div class=\"dashboard-widget-card__header-content\">\n <div\n v-if=\"icon\"\n class=\"dashboard-widget-card__icon-wrapper\"\n >\n <VcIcon\n class=\"dashboard-widget-card__icon\"\n :icon=\"icon\"\n size=\"l\"\n />\n </div>\n <div class=\"dashboard-widget-card__title\">{{ props.header }}</div>\n </div>\n </slot>\n <div\n v-if=\"$slots.actions\"\n class=\"dashboard-widget-card__actions\"\n >\n <slot name=\"actions\"></slot>\n </div>\n </div>\n\n <div\n v-if=\"$slots.stats\"\n class=\"dashboard-widget-card__stats\"\n >\n <slot name=\"stats\"></slot>\n </div>\n\n <div\n v-loading=\"loading\"\n class=\"dashboard-widget-card__body\"\n >\n <slot name=\"content\"></slot>\n </div>\n\n <div\n v-if=\"$slots.footer\"\n class=\"dashboard-widget-card__footer\"\n >\n <slot name=\"footer\"></slot>\n </div>\n </div>\n</template>\n\n<!-- eslint-disable @typescript-eslint/no-explicit-any -->\n<script setup lang=\"ts\">\nexport interface Props {\n header?: string;\n icon?: string;\n loading?: boolean;\n}\n\nimport { VcIcon } from \"@ui/components\";\nimport { vLoading } from \"@core/directives\";\n\nconst props = defineProps<Props>();\n\ndefineSlots<{\n header?: (props: any) => any;\n actions?: (props: any) => any;\n stats?: (props: any) => any;\n content?: (props: any) => any;\n footer?: (props: any) => any;\n}>();\n</script>\n\n<style lang=\"scss\">\n:root {\n // Legacy variables (preserved for backward compat)\n --dashboard-widget-card-header-color: var(--additional-50);\n --dashboard-widget-card-header-text-color: var(--neutrals-950);\n --dashboard-widget-card-icon-color: var(--primary-600);\n --dashboard-widget-card-header-border-color: var(--neutrals-200);\n\n // New variables\n --dashboard-widget-card-background: var(--additional-50);\n --dashboard-widget-card-border-color: var(--neutrals-200);\n --dashboard-widget-card-border-radius: 8px;\n --dashboard-widget-card-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);\n --dashboard-widget-card-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.1);\n --dashboard-widget-card-icon-bg: var(--primary-50);\n --dashboard-widget-card-stats-bg: var(--neutrals-50);\n --dashboard-widget-card-footer-color: var(--primary-700);\n}\n\n.dashboard-widget-card {\n @apply tw-overflow-hidden tw-h-full tw-flex tw-flex-col;\n background: var(--dashboard-widget-card-background);\n border: 1px solid var(--dashboard-widget-card-border-color);\n border-radius: var(--dashboard-widget-card-border-radius);\n box-shadow: var(--dashboard-widget-card-shadow);\n transition: box-shadow 0.2s ease;\n\n &:hover {\n box-shadow: var(--dashboard-widget-card-shadow-hover);\n }\n\n &__header {\n @apply tw-px-5 tw-py-4 tw-flex tw-justify-between tw-items-center tw-gap-3;\n }\n\n &__header-content {\n @apply tw-flex tw-items-center tw-gap-3 tw-min-w-0;\n }\n\n &__icon-wrapper {\n @apply tw-flex tw-items-center tw-justify-center tw-w-9 tw-h-9 tw-rounded-lg tw-flex-shrink-0;\n background: var(--dashboard-widget-card-icon-bg);\n }\n\n &__icon {\n @apply tw-text-[var(--dashboard-widget-card-icon-color)];\n }\n\n &__title {\n @apply tw-text-lg tw-font-semibold tw-truncate;\n color: var(--dashboard-widget-card-header-text-color);\n }\n\n &__actions {\n @apply tw-flex tw-items-center tw-gap-2 tw-flex-shrink-0;\n }\n\n &__stats {\n @apply tw-px-5 tw-py-3 tw-flex tw-items-center tw-gap-6;\n background: var(--dashboard-widget-card-stats-bg);\n border-top: 1px solid var(--dashboard-widget-card-border-color);\n border-bottom: 1px solid var(--dashboard-widget-card-border-color);\n }\n\n &__body {\n @apply tw-flex-1 tw-min-h-0;\n }\n\n &__footer {\n @apply tw-px-5 tw-py-3 tw-text-center;\n border-top: 1px solid var(--dashboard-widget-card-border-color);\n\n a,\n button {\n @apply tw-text-sm tw-font-medium tw-no-underline;\n color: var(--dashboard-widget-card-footer-color);\n transition: opacity 0.15s ease;\n\n &:hover {\n @apply tw-underline;\n opacity: 0.85;\n }\n }\n }\n}\n\n// Shared activity-feed row style for dashboard card content\n.dashboard-feed-row {\n @apply tw-flex tw-items-center tw-justify-between tw-px-5 tw-py-2.5 tw-cursor-pointer tw-transition-colors;\n\n &:hover {\n background: var(--dashboard-widget-card-icon-bg, var(--primary-50));\n }\n}\n</style>\n","<template>\n <div class=\"dashboard-stat-item\">\n <div\n class=\"dashboard-stat-item__value\"\n :class=\"variant ? `dashboard-stat-item__value--${variant}` : ''\"\n >\n {{ value }}\n </div>\n <div class=\"dashboard-stat-item__label\">{{ label }}</div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nexport interface DashboardStatItemProps {\n /** The metric value to display */\n value: string | number;\n /** Descriptive label below the value */\n label: string;\n /** Color variant for the value */\n variant?: \"default\" | \"success\" | \"warning\" | \"danger\";\n}\n\ndefineProps<DashboardStatItemProps>();\n</script>\n\n<style lang=\"scss\">\n:root {\n --dashboard-stat-item-value-color: var(--neutrals-950);\n --dashboard-stat-item-label-color: var(--neutrals-500);\n}\n\n.dashboard-stat-item {\n @apply tw-flex tw-flex-col tw-items-center tw-min-w-0;\n\n &__value {\n @apply tw-text-lg tw-font-semibold tw-leading-tight tw-text-[var(--dashboard-stat-item-value-color)] tw-truncate tw-max-w-full;\n\n &--success {\n @apply tw-text-[var(--success-600)];\n }\n\n &--warning {\n @apply tw-text-[var(--warning-600)];\n }\n\n &--danger {\n @apply tw-text-[var(--danger-600)];\n }\n }\n\n &__label {\n @apply tw-text-xs tw-text-[var(--dashboard-stat-item-label-color)] tw-mt-0.5 tw-truncate tw-max-w-full;\n }\n}\n</style>\n","<!-- eslint-disable @typescript-eslint/no-explicit-any -->\n<template>\n <div class=\"tw-divide-y tw-divide-[var(--neutrals-200)]\">\n <slot />\n </div>\n</template>\n\n<script setup lang=\"ts\">\ndefineSlots<{\n default: (props: any) => any;\n}>();\n</script>\n","<!-- eslint-disable @typescript-eslint/no-explicit-any -->\n<template>\n <div\n class=\"dashboard-feed-row\"\n @click=\"$emit('click')\"\n >\n <div class=\"tw-flex tw-items-center tw-gap-2.5 tw-min-w-0\">\n <slot />\n </div>\n <div\n v-if=\"$slots.trailing\"\n class=\"tw-flex tw-items-center tw-gap-3 tw-flex-shrink-0 tw-ml-3\"\n >\n <slot name=\"trailing\" />\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\ndefineEmits<{\n click: [];\n}>();\n\ndefineSlots<{\n default: (props: any) => any;\n trailing: (props: any) => any;\n}>();\n</script>\n"],"names":["LAYOUT_STORAGE_KEY","toGridstackWidget","widget","placement","pos","fromGridstackNode","node","gridstackNodesToLayoutMap","nodes","layout","loadLayoutFromStorage","stored","parsed","id","error","saveLayoutToStorage","widgets","gridstackFormat","clearLayoutStorage","autoArrangeWidgets","columns","rowOccupancy","isPositionFree","x","width","height","row","occupied","col","occupyPosition","findFreePosition","y","position","mergeLayoutWithWidgets","savedLayout","savedPlacement","builtInPos","w","DEFAULT_OPTIONS","useGridstack","options","gridOptions","resizable","autoSave","onLayoutChange","grid","shallowRef","ref","isInitialized","isUpdating","mergedOptions","initGrid","element","GridStack","handleChange","handleAdded","handleRemoved","widgetData","_event","previous","saveLayout","destroyGrid","addWidget","gsWidget","removeWidget","widgetId","recordPlacementFromNode","requestedPosition","requestedSize","updateWidgetPosition","updateWidgetSize","size","loadLayout","applyLayoutToGrid","resetToDefaults","batchUpdate","fn","watch","newWidgets","oldWidgets","nextTick","addedWidgets","ow","removedWidgetIds","nw","onUnmounted","_openBlock","_createElementBlock","_hoisted_1","_cache","MIN_WIDGET_SPAN","DEFAULT_SKELETONS","readPersistedSkeletons","raw","items","n","props","__props","gridRef","liveAnnouncement","modulesReady","inject","ModulesReadyKey","skeletonItems","computed","skeletonItemStyle","item","dashboard","useDashboard","newLayout","announceToScreenReader","getPosition","grabbedWidgetId","grabbedOrigin","grabbedOriginSize","positionOf","sizeOf","widgetName","pickUpWidget","dropWidget","cancelWidgetMove","origin","originSize","current","moveWidgetBy","dx","dy","next","landed","resizeWidgetBy","dw","dh","applied","onWidgetKeydown","event","isGrabbed","grabbedWidget","candidate","getWidgetAriaLabel","index","name","state","message","tryInitGrid","onMounted","ready","__expose","_createBlock","VcContainer","_unref","_Fragment","_renderList","$event","_createElementVNode","_hoisted_4","_hoisted_5","_resolveDynamicComponent","_mergeProps","DashboardWidgetSkeleton","_normalizeStyle","_hoisted_6","_toDisplayString","dashboardRef","GridstackDashboard","_toGridstackWidget","_fromGridstackNode","_loadLayoutFromStorage","_saveLayoutToStorage","_mergeLayoutWithWidgets","_clearLayoutStorage","_LAYOUT_STORAGE_KEY","_hoisted_2","_renderSlot","_ctx","_hoisted_3","_createVNode","VcIcon","$slots","_hoisted_7","_withDirectives","_hoisted_8","_hoisted_9","_normalizeClass","$emit"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBO,MAAMA,IAAqB;AAY3B,SAASC,GAAkBC,GAA0BC,GAAuD;AACjH,QAAMC,IAAMD,KAAaD,EAAO;AAChC,SAAO;AAAA,IACL,IAAIA,EAAO;AAAA,IACX,GAAGE,GAAK,KAAK;AAAA,IACb,GAAGA,GAAK,KAAK;AAAA;AAAA;AAAA,IAGb,GAAGD,GAAW,SAASD,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F,IAKM;AAAA,QADJC,EAAwBC,EAAA,QAAA,UAAA;AAAA,MAAA;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { inject as c, computed as b, watch as m, onUnmounted as _ } from "vue";
|
|
2
|
-
import { A as v, B as y, c as p } from "./VcAiAgentPanel.vue_vue_type_style_index_0_lang-
|
|
3
|
-
import { D as C, A as x } from "./VcAiAgentPanel.vue_vue_type_script_setup_true_lang-
|
|
2
|
+
import { A as v, B as y, c as p } from "./VcAiAgentPanel.vue_vue_type_style_index_0_lang-CZdY18Hq.js";
|
|
3
|
+
import { D as C, A as x } from "./VcAiAgentPanel.vue_vue_type_script_setup_true_lang-9mBLzIi1.js";
|
|
4
4
|
const s = p("use-ai-agent-context");
|
|
5
5
|
function D(e) {
|
|
6
6
|
return Array.isArray(e.value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-B7RhGTNx.js","sources":["../../core/plugins/ai-agent/composables/useAiAgentContext.ts","../../core/plugins/ai-agent/index.ts"],"sourcesContent":["import { inject, computed, watch, onUnmounted, type Ref } from \"vue\";\nimport { AiAgentServiceKey } from \"@framework/injection-keys\";\nimport { BladeDescriptorKey } from \"@core/blade-navigation/types\";\nimport type { IAiAgentServiceInternal } from \"@core/plugins/ai-agent/services/ai-agent-service\";\nimport type { UseAiAgentContextOptions, AiAgentContextType } from \"@core/plugins/ai-agent/types\";\nimport { createLogger } from \"@core/utilities\";\n\nconst logger = createLogger(\"use-ai-agent-context\");\n\n/**\n * Checks if the ref value is an array\n */\nfunction isArrayRef<T>(dataRef: Ref<T> | Ref<T[]>): dataRef is Ref<T[]> {\n return Array.isArray(dataRef.value);\n}\n\n/**\n * Normalizes any ref value to an array for sending to the AI agent\n */\nfunction normalizeToArray<T>(value: T | T[]): T[] {\n if (Array.isArray(value)) {\n return value;\n }\n return value != null ? [value] : [];\n}\n\n/**\n * Composable for binding blade data to AI agent context.\n *\n * Sends data updates to the AI agent when dataRef changes and normalizes\n * single objects to arrays for the agent protocol.\n *\n * @example List blade (array of selected items)\n * ```typescript\n * const { selectedItems } = useTableSelection<Offer>();\n *\n * useAiAgentContext({ dataRef: selectedItems });\n * ```\n *\n * @example Details blade (single object - automatically wrapped in array)\n * ```typescript\n * const offer = ref<Offer>({});\n *\n * useAiAgentContext({ dataRef: offer });\n * ```\n *\n * @example With custom suggestions\n * ```typescript\n * useAiAgentContext({\n * dataRef: offer,\n * suggestions: [\n * {\n * id: \"translate\",\n * title: \"Translate description\",\n * icon: \"translation\",\n * iconColor: \"#FF4A4A\",\n * prompt: \"Translate the offer description to English\"\n * },\n * ],\n * });\n * ```\n */\nexport function useAiAgentContext<\n T extends {\n id?: string | undefined;\n objectType?: string | undefined;\n name?: string | undefined;\n },\n>(options: UseAiAgentContextOptions<T>): void {\n const { dataRef, suggestions } = options;\n\n // Try to get the service (may not be available if plugin not installed)\n const service = inject(AiAgentServiceKey) as IAiAgentServiceInternal | undefined;\n\n // Get current blade descriptor to identify which blade this context belongs to\n const bladeDescriptor = inject(BladeDescriptorKey, null);\n const bladeId = computed(() => bladeDescriptor?.value?.id);\n\n // If service is not available, nothing to bind\n if (!service) {\n logger.debug(\"AiAgentService not available, context binding disabled\");\n return;\n }\n\n // Determine context type based on dataRef type\n // Array ref = list blade (multiple selected items)\n // Single object ref = details blade (single item being edited)\n const detectedContextType: AiAgentContextType = isArrayRef(dataRef) ? \"list\" : \"details\";\n\n // Set context data in service (items, contextType, and suggestions)\n // Always sends an array to the service, normalizing single objects\n // Context is bound to specific blade ID\n const updateContextData = () => {\n const raw = normalizeToArray(dataRef.value);\n const items =\n detectedContextType === \"details\"\n ? raw.map((item) => ({ ...item }))\n : raw.map((item) => ({ id: item.id, objectType: item.objectType, name: item.name }));\n service._setContextData(items, detectedContextType, suggestions, bladeId.value);\n logger.debug(`Context updated: ${items.length} items, type: ${detectedContextType}, blade: ${bladeId.value}`);\n };\n\n // Watch dataRef for changes and update context\n const stopWatch = watch(dataRef, updateContextData, { deep: true, immediate: true });\n\n // Cleanup on unmount\n onUnmounted(() => {\n stopWatch();\n // Clear context for this specific blade when component unmounts\n service._setContextData([], \"list\", undefined, bladeId.value);\n logger.debug(`Context cleared on unmount for blade: ${bladeId.value}`);\n });\n}\n","import type { App } from \"vue\";\r\nimport type { IAiAgentConfig } from \"@core/plugins/ai-agent/types\";\r\nimport { DEFAULT_AI_AGENT_CONFIG, AI_AGENT_URL_ENV_KEY } from \"@core/plugins/ai-agent/constants\";\r\nimport { createLogger } from \"@core/utilities\";\r\n\r\nconst logger = createLogger(\"ai-agent-plugin\");\r\n\r\n/**\r\n * Options for the AI Agent Plugin\r\n */\r\nexport interface AiAgentPluginOptions {\r\n /**\r\n * AI Agent configuration.\r\n * URL can also be set via APP_AI_AGENT_URL environment variable.\r\n */\r\n config?: Partial<IAiAgentConfig>;\r\n\r\n /**\r\n * Whether to add the AI button to all blade toolbars automatically.\r\n * Default: true\r\n */\r\n addGlobalToolbarButton?: boolean;\r\n}\r\n\r\n/**\r\n * Vue plugin for AI Agent integration.\r\n *\r\n * @example\r\n * ```typescript\r\n * import { createApp } from \"vue\";\r\n * import { aiAgentPlugin } from \"@vc-shell/framework\";\r\n *\r\n * const app = createApp(App);\r\n *\r\n * // Install with options\r\n * app.use(aiAgentPlugin, {\r\n * config: {\r\n * title: \"AI Assistant\",\r\n * width: 400,\r\n * },\r\n * addGlobalToolbarButton: true,\r\n * });\r\n * ```\r\n */\r\nexport const aiAgentPlugin = {\r\n install(app: App, options: AiAgentPluginOptions = {}) {\r\n const { config = {}, addGlobalToolbarButton = true } = options;\r\n\r\n // Get URL from environment variable if not provided\r\n let url = config.url || \"\";\r\n if (!url && typeof import.meta !== \"undefined\" && import.meta.env) {\r\n url = import.meta.env[AI_AGENT_URL_ENV_KEY] || \"\";\r\n }\r\n\r\n // Skip installation if no URL configured\r\n if (!url) {\r\n logger.info(\r\n \"AI Agent plugin skipped: no URL configured. Set APP_AI_AGENT_URL env variable or pass config.url option.\",\r\n );\r\n return;\r\n }\r\n\r\n // Merge config with defaults\r\n const finalConfig: IAiAgentConfig = {\r\n ...DEFAULT_AI_AGENT_CONFIG,\r\n ...config,\r\n url,\r\n };\r\n\r\n // Store config in app global properties for access during service creation\r\n app.config.globalProperties.$aiAgentConfig = finalConfig;\r\n app.provide(\"aiAgentConfig\", finalConfig);\r\n app.provide(\"aiAgentAddGlobalToolbarButton\", addGlobalToolbarButton);\r\n\r\n logger.info(`AI Agent plugin installed. URL: ${url}, addGlobalToolbarButton: ${addGlobalToolbarButton}`);\r\n },\r\n};\r\n\r\n// Re-export all types\r\nexport * from \"@core/plugins/ai-agent/types\";\r\nexport * from \"@core/plugins/ai-agent/constants\";\r\n\r\n// Re-export composables\r\nexport {\r\n useAiAgent,\r\n provideAiAgentService,\r\n createAiAgentToolbarButton,\r\n} from \"@core/plugins/ai-agent/composables/useAiAgent\";\r\nexport type { UseAiAgentReturn, ProvideAiAgentServiceOptions } from \"@core/plugins/ai-agent/composables/useAiAgent\";\r\n\r\nexport { useAiAgentContext } from \"@core/plugins/ai-agent/composables/useAiAgentContext\";\r\n\r\n// Re-export components\r\nexport { VcAiAgentPanel } from \"@core/plugins/ai-agent/components\";\r\n\r\n// Re-export service types\r\nexport type {\r\n IAiAgentServiceInternal,\r\n CreateAiAgentServiceOptions,\r\n} from \"@core/plugins/ai-agent/services/ai-agent-service\";\r\n"],"names":["logger","createLogger","isArrayRef","dataRef","normalizeToArray","value","useAiAgentContext","options","suggestions","service","inject","AiAgentServiceKey","bladeDescriptor","BladeDescriptorKey","bladeId","computed","detectedContextType","stopWatch","watch","raw","items","item","onUnmounted","aiAgentPlugin","app","config","addGlobalToolbarButton","url","__vite_import_meta_env__","AI_AGENT_URL_ENV_KEY","finalConfig","DEFAULT_AI_AGENT_CONFIG"],"mappings":";;;AAOA,MAAMA,IAASC,EAAa,sBAAsB;AAKlD,SAASC,EAAcC,GAAiD;AACtE,SAAO,MAAM,QAAQA,E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AI,wBAAAC,IAAyB,OAASnB;AAGvD,QAAIoB,IAAMF,EAAO,OAAO;AAMxB,QALI,CAACE,KAAO,OAAO,cAAgB,OAAeC,MAChDD,IAAMC,EAAgBC,CAAoB,KAAK,KAI7C,CAACF,GAAK;AACR,MAAA3B,EAAO;AAAA,QACL;AAAA,MAAA;AAEF;AAAA,IACF;AAGA,UAAM8B,IAA8B;AAAA,MAClC,GAAGC;AAAA,MACH,GAAGN;AAAA,MACH,KAAAE;AAAA,IAAA;AAIF,IAAAH,EAAI,OAAO,iBAAiB,iBAAiBM,GAC7CN,EAAI,QAAQ,iBAAiBM,CAAW,GACxCN,EAAI,QAAQ,iCAAiCE,CAAsB,GAEnE1B,EAAO,KAAK,mCAAmC2B,CAAG,6BAA6BD,CAAsB,EAAE;AAAA,EACzG;AACF;"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { RouteLocationNormalized } from "vue-router";
|
|
2
|
-
import type { Router } from "vue-router";
|
|
1
|
+
import type { RouteLocationNormalized, Router } from "vue-router";
|
|
3
2
|
import type { UseBladeRegistryReturn } from "../../composables/useBladeRegistry";
|
|
4
3
|
import type { IBladeStack } from "../../blade-navigation/types";
|
|
5
4
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bladeRouterGuard.d.ts","sourceRoot":"","sources":["../../../../core/blade-navigation/utils/bladeRouterGuard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"bladeRouterGuard.d.ts","sourceRoot":"","sources":["../../../../core/blade-navigation/utils/bladeRouterGuard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAClE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AACjF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAIhE;;;;;;GAMG;AACH,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,KAAK,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,OAAO,EAAE,IAAI,CAAA;CAAE,CAAC;AAyBlH;;;;;;;;;;;;;GAaG;AACH,wBAAsB,gBAAgB,CACpC,EAAE,EAAE,uBAAuB,EAC3B,UAAU,EAAE,WAAW,EACvB,aAAa,EAAE,sBAAsB,EACrC,SAAS,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,KAAK,OAAO,EACnE,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,gBAAgB,CAAC,CAqD3B"}
|
|
@@ -6,6 +6,7 @@ export * from "../composables/usePermissions";
|
|
|
6
6
|
export * from "../composables/useAsync";
|
|
7
7
|
export * from "../composables/useApiClient";
|
|
8
8
|
export * from "../composables/useLoading";
|
|
9
|
+
export * from "../composables/useLatestRequest";
|
|
9
10
|
export * from "../composables/useErrorHandler";
|
|
10
11
|
export * from "../composables/useAssets";
|
|
11
12
|
export * from "../composables/useAssetsManager";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../core/composables/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oCAAoC,CAAC;AACnD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC;AACjD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mCAAmC,CAAC;AAClD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oCAAoC,CAAC;AACnD,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAClD,cAAc,gCAAgC,CAAC;AAC/C,cA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AAC3C,cAAc,mCAAmC,CAAC;AAClD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC;AAClD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0CAA0C,CAAC;AACzD,cAAc,mCAAmC,CAAC;AAClD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,sCAAsC,CAAC;AACrD,cAAc,wCAAwC,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type Ref } from "vue";
|
|
2
|
+
export interface LatestRequest {
|
|
3
|
+
/** False once a newer request started, or once the tracker was invalidated or disposed. */
|
|
4
|
+
isCurrent(): boolean;
|
|
5
|
+
/** Marks this request finished. Idempotent; only the current request clears `pending`. */
|
|
6
|
+
complete(): void;
|
|
7
|
+
}
|
|
8
|
+
export interface UseLatestRequestReturn {
|
|
9
|
+
/** Starts a request and supersedes any earlier one. */
|
|
10
|
+
begin(): LatestRequest;
|
|
11
|
+
/** Supersedes the in-flight request without starting a new one — e.g. on selection change. */
|
|
12
|
+
invalidate(): void;
|
|
13
|
+
/** Permanently supersedes everything. Called automatically when the owning scope stops. */
|
|
14
|
+
dispose(): void;
|
|
15
|
+
/** True while the newest request is still running. */
|
|
16
|
+
pending: Readonly<Ref<boolean>>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Latest-wins sequencing: lets a caller drop a response that a newer request
|
|
20
|
+
* already superseded.
|
|
21
|
+
*
|
|
22
|
+
* ```ts
|
|
23
|
+
* const search = useLatestRequest();
|
|
24
|
+
*
|
|
25
|
+
* async function load(criteria) {
|
|
26
|
+
* const request = search.begin();
|
|
27
|
+
* try {
|
|
28
|
+
* const result = await api.search(criteria);
|
|
29
|
+
* if (!request.isCurrent()) return; // a newer search won
|
|
30
|
+
* items.value = result;
|
|
31
|
+
* } finally {
|
|
32
|
+
* request.complete();
|
|
33
|
+
* }
|
|
34
|
+
* }
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* This discards the late result rather than cancelling the request: the
|
|
38
|
+
* generated API clients build their own `RequestInit` and take no `AbortSignal`,
|
|
39
|
+
* so there is nothing to cancel through. Aborting would additionally save the
|
|
40
|
+
* round trip and belongs with a client that accepts a signal.
|
|
41
|
+
*/
|
|
42
|
+
export declare function useLatestRequest(): UseLatestRequestReturn;
|
|
43
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../core/composables/useLatestRequest/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkD,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AAE/E,MAAM,WAAW,aAAa;IAC5B,2FAA2F;IAC3F,SAAS,IAAI,OAAO,CAAC;IACrB,0FAA0F;IAC1F,QAAQ,IAAI,IAAI,CAAC;CAClB;AAED,MAAM,WAAW,sBAAsB;IACrC,uDAAuD;IACvD,KAAK,IAAI,aAAa,CAAC;IACvB,8FAA8F;IAC9F,UAAU,IAAI,IAAI,CAAC;IACnB,2FAA2F;IAC3F,OAAO,IAAI,IAAI,CAAC;IAChB,sDAAsD;IACtD,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,gBAAgB,IAAI,sBAAsB,CA2CzD"}
|
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
import { Ref, MaybeRef, Component } from "vue";
|
|
2
2
|
import type { UsePopupProps } from "../../composables/usePopup/types";
|
|
3
|
+
export interface PopupMessageOptions {
|
|
4
|
+
/**
|
|
5
|
+
* Render the message as HTML instead of text. Off by default: messages are
|
|
6
|
+
* built by interpolating server data into a translation, and as markup an
|
|
7
|
+
* entity name can restyle or add links to a dialog the user is meant to
|
|
8
|
+
* trust. Opt in only for markup you author yourself.
|
|
9
|
+
*/
|
|
10
|
+
html?: boolean;
|
|
11
|
+
}
|
|
3
12
|
interface IUsePopup {
|
|
4
13
|
open(): void;
|
|
5
14
|
close(): void;
|
|
6
|
-
showConfirmation(message: string | Ref<string
|
|
7
|
-
showError(message: string | Ref<string
|
|
8
|
-
showInfo(message: string | Ref<string
|
|
15
|
+
showConfirmation(message: string | Ref<string>, options?: PopupMessageOptions): Promise<boolean>;
|
|
16
|
+
showError(message: string | Ref<string>, options?: PopupMessageOptions): void;
|
|
17
|
+
showInfo(message: string | Ref<string>, options?: PopupMessageOptions): void;
|
|
9
18
|
}
|
|
10
19
|
export declare function usePopup<T extends Component = Component>(options?: MaybeRef<UsePopupProps<T>>): IUsePopup;
|
|
11
20
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../core/composables/usePopup/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,GAAG,EAEH,QAAQ,EAER,SAAS,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../core/composables/usePopup/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,GAAG,EAEH,QAAQ,EAER,SAAS,EAEV,MAAM,KAAK,CAAC;AAEb,OAAO,KAAK,EAAiC,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAerG,MAAM,WAAW,mBAAmB;IAClC;;;;;OAKG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,UAAU,SAAS;IACjB,IAAI,IAAI,IAAI,CAAC;IACb,KAAK,IAAI,IAAI,CAAC;IACd,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACjG,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAC;IAC9E,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAC;CAC9E;AAmBD,wBAAgB,QAAQ,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS,EAAE,OAAO,CAAC,EAAE,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAuPzG"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { InjectionKey } from "vue";
|
|
2
|
-
import type { PopupPlugin } from "../../composables/usePopup/types";
|
|
2
|
+
import type { PopupPlugin, PopupInstanceContext } from "../../composables/usePopup/types";
|
|
3
3
|
export declare const PopupPluginKey: InjectionKey<PopupPlugin>;
|
|
4
|
+
/** Provided per rendered popup so the dialog can drive its own close sequence. */
|
|
5
|
+
export declare const PopupInstanceKey: InjectionKey<PopupInstanceContext>;
|
|
4
6
|
//# sourceMappingURL=keys.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../../../core/composables/usePopup/keys.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,KAAK,CAAC;AACxC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../../../core/composables/usePopup/keys.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,KAAK,CAAC;AACxC,OAAO,KAAK,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAE1F,eAAO,MAAM,cAAc,EAAE,YAAY,CAAC,WAAW,CAAyB,CAAC;AAE/E,kFAAkF;AAClF,eAAO,MAAM,gBAAgB,EAAE,YAAY,CAAC,oBAAoB,CAA2B,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, Slot as VueSlot } from "vue";
|
|
1
|
+
import { Component, Slot as VueSlot, type Ref } from "vue";
|
|
2
2
|
import type { ComponentProps } from "vue-component-type-helpers";
|
|
3
3
|
export type RawProps<T extends Component> = Omit<ComponentProps<T>, `on${string}`>;
|
|
4
4
|
export type RawEmits<T extends Component> = Pick<ComponentProps<T>, Extract<keyof ComponentProps<T>, `on${string}`>>;
|
|
@@ -7,6 +7,37 @@ export interface UsePopupInternal {
|
|
|
7
7
|
id: symbol;
|
|
8
8
|
open: () => void;
|
|
9
9
|
close: () => void;
|
|
10
|
+
/**
|
|
11
|
+
* Set by `close()` to start the closing phase. The instance stays mounted until
|
|
12
|
+
* the popup reports its leave transition finished (or the safety timer fires),
|
|
13
|
+
* so the dialog can run its own close sequence — which is what restores focus
|
|
14
|
+
* to the element that opened it.
|
|
15
|
+
*/
|
|
16
|
+
closing: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* The control that had focus when the popup was opened. Focus returns here once
|
|
19
|
+
* the popup is gone, provided focus was lost to `<body>` in the meantime
|
|
20
|
+
* (WCAG 2.4.3). Kept raw — this is a DOM node, not reactive state.
|
|
21
|
+
*/
|
|
22
|
+
opener?: HTMLElement;
|
|
23
|
+
/**
|
|
24
|
+
* Unmounts the instance now. Called by the popup once its leave transition ends;
|
|
25
|
+
* the single removal path, so restoring focus cannot be skipped.
|
|
26
|
+
*/
|
|
27
|
+
finalize: () => void;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Per-popup context handed to the rendered popup through provide/inject.
|
|
31
|
+
*
|
|
32
|
+
* Injected rather than passed as a prop because the container renders an
|
|
33
|
+
* arbitrary component: writing `modelValue` into it would collide with popups
|
|
34
|
+
* that own that prop themselves.
|
|
35
|
+
*/
|
|
36
|
+
export interface PopupInstanceContext {
|
|
37
|
+
/** True once closing has started and the leave transition should run. */
|
|
38
|
+
closing: Readonly<Ref<boolean>>;
|
|
39
|
+
/** Called by the popup when its leave transition has finished. */
|
|
40
|
+
finalize: () => void;
|
|
10
41
|
}
|
|
11
42
|
export interface PopupPlugin {
|
|
12
43
|
popups: Partial<UsePopupProps & UsePopupInternal>[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../core/composables/usePopup/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../core/composables/usePopup/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,IAAI,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjE,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,SAAS,IAAI,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,KAAK,MAAM,EAAE,CAAC,CAAC;AACnF,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,SAAS,IAAI,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,MAAM,cAAc,CAAC,CAAC,CAAC,EAAE,KAAK,MAAM,EAAE,CAAC,CAAC,CAAC;AACrH,MAAM,MAAM,IAAI,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;AAEhD,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB;;;;;OAKG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;;OAGG;IACH,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB;IACnC,yEAAyE;IACzE,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;IAChC,kEAAkE;IAClE,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,OAAO,CAAC,aAAa,GAAG,gBAAgB,CAAC,EAAE,CAAC;CACrD;AAED,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS;IAC5D,SAAS,EAAE,CAAC,CAAC;IACb,KAAK,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IACpB,KAAK,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IACpB,KAAK,CAAC,EAAE;QACN,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;KACrB,CAAC;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../core/interceptors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AA2CpC,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../core/interceptors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AA2CpC,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,wFA6KlD"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
inert?: boolean;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
2
5
|
declare const _default: typeof __VLS_export;
|
|
3
6
|
export default _default;
|
|
4
7
|
//# sourceMappingURL=VcAiAgentPanel.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VcAiAgentPanel.vue.d.ts","sourceRoot":"","sources":["../../../../../core/plugins/ai-agent/components/VcAiAgentPanel.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"VcAiAgentPanel.vue.d.ts","sourceRoot":"","sources":["../../../../../core/plugins/ai-agent/components/VcAiAgentPanel.vue"],"names":[],"mappings":"AAoLA,KAAK,WAAW,GAAG;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAkLF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-agent-service.d.ts","sourceRoot":"","sources":["../../../../../core/plugins/ai-agent/services/ai-agent-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,UAAU,EAAE,MAAM,KAAK,CAAC;AAE5D,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EAGd,WAAW,EACX,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,8BAA8B,CAAC;AAQtC;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,+CAA+C;IAC/C,UAAU,EAAE,MAAM,mBAAmB,GAAG,SAAS,CAAC;IAClD,4CAA4C;IAC5C,WAAW,EAAE,MAAM,oBAAoB,GAAG,IAAI,CAAC;IAC/C,kCAAkC;IAClC,YAAY,EAAE,MAAM,MAAM,CAAC;IAC3B,+DAA+D;IAC/D,WAAW,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC3C,oCAAoC;IACpC,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IACjG,4BAA4B;IAC5B,aAAa,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;IACxC,2EAA2E;IAC3E,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAwB,SAAQ,eAAe;IAC9D,yDAAyD;IACzD,SAAS,EAAE,UAAU,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;IAChD,qDAAqD;IACrD,aAAa,EAAE,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,KAAK,IAAI,CAAC;IAC1D,6CAA6C;IAC7C,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,4CAA4C;IAC5C,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,oEAAoE;IACpE,eAAe,EAAE,CACf,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAChC,IAAI,EAAE,kBAAkB,EACxB,WAAW,CAAC,EAAE,WAAW,EAAE,EAC3B,OAAO,CAAC,EAAE,MAAM,KACb,IAAI,CAAC;CACX;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,2BAA2B,GAAG,uBAAuB,
|
|
1
|
+
{"version":3,"file":"ai-agent-service.d.ts","sourceRoot":"","sources":["../../../../../core/plugins/ai-agent/services/ai-agent-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,UAAU,EAAE,MAAM,KAAK,CAAC;AAE5D,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EAGd,WAAW,EACX,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,8BAA8B,CAAC;AAQtC;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,+CAA+C;IAC/C,UAAU,EAAE,MAAM,mBAAmB,GAAG,SAAS,CAAC;IAClD,4CAA4C;IAC5C,WAAW,EAAE,MAAM,oBAAoB,GAAG,IAAI,CAAC;IAC/C,kCAAkC;IAClC,YAAY,EAAE,MAAM,MAAM,CAAC;IAC3B,+DAA+D;IAC/D,WAAW,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC3C,oCAAoC;IACpC,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IACjG,4BAA4B;IAC5B,aAAa,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;IACxC,2EAA2E;IAC3E,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAwB,SAAQ,eAAe;IAC9D,yDAAyD;IACzD,SAAS,EAAE,UAAU,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;IAChD,qDAAqD;IACrD,aAAa,EAAE,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,KAAK,IAAI,CAAC;IAC1D,6CAA6C;IAC7C,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,4CAA4C;IAC5C,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,oEAAoE;IACpE,eAAe,EAAE,CACf,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAChC,IAAI,EAAE,kBAAkB,EACxB,WAAW,CAAC,EAAE,WAAW,EAAE,EAC3B,OAAO,CAAC,EAAE,MAAM,KACb,IAAI,CAAC;CACX;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,2BAA2B,GAAG,uBAAuB,CA0JlG"}
|
|
@@ -4,6 +4,8 @@ export interface MessageTransportOptions {
|
|
|
4
4
|
getConfig: () => IAiAgentConfig;
|
|
5
5
|
isEmbedded: boolean;
|
|
6
6
|
navigateToBlade?: (bladeName: string, param?: string, options?: Record<string, unknown>) => void;
|
|
7
|
+
/** Invoked on a CLOSE_PANEL message — the chatbot's only way to close the panel it has focus in. */
|
|
8
|
+
closePanel?: () => void;
|
|
7
9
|
}
|
|
8
10
|
export interface MessageTransport {
|
|
9
11
|
iframeRef: ShallowRef<HTMLIFrameElement | null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-transport.d.ts","sourceRoot":"","sources":["../../../../../core/plugins/ai-agent/services/message-transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAc,KAAK,UAAU,EAAE,MAAM,KAAK,CAAC;AAEvD,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EAIhB,MAAM,8BAA8B,CAAC;AAItC,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,MAAM,cAAc,CAAC;IAChC,UAAU,EAAE,OAAO,CAAC;IACpB,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"message-transport.d.ts","sourceRoot":"","sources":["../../../../../core/plugins/ai-agent/services/message-transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAc,KAAK,UAAU,EAAE,MAAM,KAAK,CAAC;AAEvD,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EAIhB,MAAM,8BAA8B,CAAC;AAItC,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,MAAM,cAAc,CAAC;IAChC,UAAU,EAAE,OAAO,CAAC;IACpB,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IACjG,oGAAoG;IACpG,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,UAAU,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;IAChD,kBAAkB,EAAE,UAAU,CAAC,OAAO,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;IACpD,oBAAoB,EAAE,UAAU,CAAC,OAAO,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;IACtD,YAAY,EAAE,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,KAAK,IAAI,CAAC;IACzD,YAAY,EAAE,CAAC,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;IACrE,YAAY,EAAE,CAAC,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;IACrE,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,IAAI,KAAK,MAAM,IAAI,CAAC;IACjD,SAAS,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,KAAK,MAAM,IAAI,CAAC;CACtE;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,uBAAuB,GAAG,gBAAgB,CAyLzF"}
|
|
@@ -142,7 +142,7 @@ export type ShellToChatMessageType = "INIT_CONTEXT" | "UPDATE_CONTEXT";
|
|
|
142
142
|
/**
|
|
143
143
|
* Message types sent from Chatbot to Shell
|
|
144
144
|
*/
|
|
145
|
-
export type ChatToShellMessageType = "CHAT_READY" | "NAVIGATE_TO_APP" | "EXPAND_IN_CHAT" | "SHOW_MORE";
|
|
145
|
+
export type ChatToShellMessageType = "CHAT_READY" | "NAVIGATE_TO_APP" | "EXPAND_IN_CHAT" | "SHOW_MORE" | "CLOSE_PANEL";
|
|
146
146
|
/**
|
|
147
147
|
* Combined message types
|
|
148
148
|
*/
|
|
@@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IAChC,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IACjC,sCAAsC;IACtC,WAAW,CAAC,EAAE,WAAW,EAAE,CAAC;IAC5B,uCAAuC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2DAA2D;IAC3D,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,0DAA0D;AAC1D,MAAM,WAAW,qBAAqB;IACpC,yBAAyB;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yBAAyB;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAMD;;GAEG;AACH,MAAM,MAAM,yBAAyB,GACjC,oBAAoB,GACpB,iBAAiB,GACjB,mBAAmB,GACnB,kBAAkB,CAAC;AAEvB;;GAEG;AACH,MAAM,MAAM,yBAAyB,GACjC,qBAAqB,GACrB,iBAAiB,CAAC;AAEtB,qCAAqC;AACrC,MAAM,WAAW,wBAAwB;IACvC,iBAAiB,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED,iEAAiE;AACjE,MAAM,MAAM,uBAAuB,GAAG,mBAAmB,CAAC;AAE1D,8DAA8D;AAC9D,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,sBAAsB,CAAC;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../core/utilities/error.ts"],"names":[],"mappings":"AACA,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,OAAO,CAAC;gBAEX,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO;CAM1E;
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../core/utilities/error.ts"],"names":[],"mappings":"AACA,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,OAAO,CAAC;gBAEX,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO;CAM1E;AAgBD;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,YAAY,EAAE,OAAO,GAAG,gBAAgB,CA8FlE"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Focuses `getTarget()` — but only if nothing meaningful holds focus by then.
|
|
3
|
+
*
|
|
4
|
+
* Use it where the shell changes context (a route change, a panel opening, a control
|
|
5
|
+
* being replaced) and focus would otherwise be left on `<body>`, making the next Tab
|
|
6
|
+
* restart from the top of the document (WCAG 2.4.3 Focus Order).
|
|
7
|
+
*
|
|
8
|
+
* Two details make this a shared helper rather than an inline `focus()` call:
|
|
9
|
+
*
|
|
10
|
+
* - **The check must happen after the DOM is patched.** At call time the node the
|
|
11
|
+
* user interacted with is usually still focused *and still connected*, and only
|
|
12
|
+
* becomes detached during the patch that follows. Testing "was focus lost?" any
|
|
13
|
+
* earlier answers "no", so the call is skipped — and focus drops to `<body>` a tick
|
|
14
|
+
* later.
|
|
15
|
+
* - **It must decline when focus is held.** A view that autofocuses a field keeps it,
|
|
16
|
+
* and a user who has already moved on is not interrupted. This repairs lost focus;
|
|
17
|
+
* it does not dictate focus.
|
|
18
|
+
*
|
|
19
|
+
* For deliberately taking focus (opening a menu, entering an editor) call `focus()`
|
|
20
|
+
* directly — this helper will refuse.
|
|
21
|
+
*
|
|
22
|
+
* `getTarget` is a callback because the target often does not exist yet at call time.
|
|
23
|
+
*/
|
|
24
|
+
export declare function focusIfLoose(getTarget: () => HTMLElement | null | undefined): void;
|
|
25
|
+
//# sourceMappingURL=focus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"focus.d.ts","sourceRoot":"","sources":["../../../core/utilities/focus.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,WAAW,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,CAWlF"}
|
|
@@ -5,6 +5,7 @@ export * from "../utilities/generateId";
|
|
|
5
5
|
export * from "../utilities/logger";
|
|
6
6
|
export * from "../utilities/errorTypes";
|
|
7
7
|
export * from "../utilities/error";
|
|
8
|
+
export * from "../utilities/focus";
|
|
8
9
|
export * from "./date";
|
|
9
10
|
export * from "../utilities/assets";
|
|
10
11
|
export * from "../utilities/colorUtils";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../core/utilities/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,QAAQ,CAAC;AACvB,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kCAAkC,CAAC;AACjD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../core/utilities/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,QAAQ,CAAC;AACvB,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kCAAkC,CAAC;AACjD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC"}
|