@tenorlab/react-dashboard 1.6.3 → 1.6.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tenorlab/react-dashboard",
3
- "version": "1.6.3",
3
+ "version": "1.6.5",
4
4
  "description": "Foundation components for creating user-configurable dashboards in React",
5
5
  "author": "Damiano Fusco",
6
6
  "license": "MIT",
@@ -50,12 +50,12 @@
50
50
  "main": "./dist/react-dashboard.es.js",
51
51
  "module": "./dist/react-dashboard.es.js",
52
52
  "peerDependencies": {
53
- "react": "^18.0.0 || ^19.0.0",
54
- "react-dom": "^18.0.0 || ^19.0.0",
55
- "zustand": "^5.0.0 || ^5.0.9"
53
+ "react": "19.2.3",
54
+ "react-dom": "19.2.3",
55
+ "zustand": "5.0.9"
56
56
  },
57
57
  "devDependencies": {
58
- "@tenorlab/dashboard-core": "^1.6.2",
58
+ "@tenorlab/dashboard-core": "^1.6.4",
59
59
  "@types/node": "^24.10.1",
60
60
  "@types/react": "19.2.3",
61
61
  "@types/react-dom": "19.2.3",
@@ -68,6 +68,6 @@
68
68
  "vite": "^7.2.4",
69
69
  "vite-plugin-dts": "^4.5.4",
70
70
  "vitest": "^4.0.16",
71
- "zustand": "^5.0.9"
71
+ "zustand": "5.0.9"
72
72
  }
73
73
  }
package/dist/core.d.ts DELETED
@@ -1,579 +0,0 @@
1
- export declare const blankDashboardConfig: IDashboardConfig;
2
-
3
- /**
4
- * @name createDynamicEntry
5
- * Helper function to create dynamic entries
6
- * This helps keep the catalog registration clean
7
- */
8
- export declare const createDynamicEntry: (key: string, loader: TWidgetFactoryBase, isRemote: boolean, metaData: TWidgetMetaInfoBase) => [string, IDynamicWidgetCatalogEntryBase];
9
-
10
- /**
11
- * @name createStaticEntry
12
- * Helper function to create static entries
13
- * This helps keep the catalog registration clean
14
- */
15
- export declare const createStaticEntry: <TFrameworkComponentType = any>(key: string, component: TFrameworkComponentType, metaData?: TWidgetMetaInfoBase) => [string, IDynamicWidgetCatalogEntryBase];
16
-
17
- /**
18
- * @name cssSettingsCatalog
19
- * @description Catalog of available dashboard settings (array of IDashboardSettingEntry)
20
- * @see IDashboardSettingEntry
21
- * @remarks step should never be less than 0.1 as we do some rounding in other places ...
22
- */
23
- export declare const cssSettingsCatalog: IDashboardSettingEntry[];
24
-
25
- /**
26
- * @name cssVarsUtils
27
- * @description Provides helpers method like getCssVariableValue, setCssVariableValue etc
28
- */
29
- export declare const cssVarsUtils: {
30
- /**
31
- * @name getCssVariableValue
32
- * @description Return the value of a CSS custom property from the current HTML document
33
- * @param cssPropertyName
34
- * @returns
35
- */
36
- getCssVariableValue: (cssPropertyName: string) => string | null;
37
- /**
38
- * @name setCssVariableValue
39
- * @description Sets the value of a CSS custom property on the current HTML document
40
- * @param cssPropertyName
41
- * @param value
42
- */
43
- setCssVariableValue: (cssPropertyName: string, value: string) => void;
44
- /**
45
- * @name restoreCssVarsFromSettings
46
- * @description
47
- * Sets the values of many CSS custom properties on the current HTML document
48
- * from the list of dashboard settings provided
49
- * @param settings, an array of IDashboardSettingEntry
50
- */
51
- restoreCssVarsFromSettings: (settings: IDashboardSettingEntry[]) => void;
52
- };
53
-
54
- export declare const DashboardMaxZoomScale: 1;
55
-
56
- export declare const DashboardMinZoomScale: 0.7;
57
-
58
- /**
59
- * @name dashboardSettingsUtils
60
- * @description Contains utils for the dashboard custom settings
61
- */
62
- export declare const dashboardSettingsUtils: {
63
- /**
64
- * @name incrementOrDecrementValue
65
- * @description Increments or decrement a value based on the direction parameter
66
- * @param item: an instance of IDashboardSettingEntry
67
- * @param direction: -1 (for decrement) or 1 (for increment)
68
- * @returns the update item
69
- */
70
- incrementOrDecrementValue: (item: IDashboardSettingEntry, direction: -1 | 1) => IDashboardSettingEntry;
71
- };
72
-
73
- /**
74
- * @name dashboardStoreUtils
75
- * @description
76
- * Framework-agnostic helpers for managing dashboard state. These utilities
77
- * are designed to be consumed by specific store implementations.
78
- * @see {@link https://www.npmjs.com/package/@tenorlab/react-dashboard | @tenorlab/react-dashboard}
79
- * @see {@link https://www.npmjs.com/package/@tenorlab/vue-dashboard | @tenorlab/vue-dashboard}
80
- */
81
- export declare const dashboardStoreUtils: {
82
- /**
83
- * @name getNextContainerName
84
- * @description Generates the next container name based on existing containers in the dashboard configuration
85
- * @param dashboardConfig
86
- * @returns {string} The next container name in the format 'containerX', where X is the next available number
87
- */
88
- getNextContainerName: (dashboardConfig: IDashboardConfig) => string;
89
- /**
90
- * @name getNextContainerKey
91
- * @description Generates the next container widget key based on the dashboard configuration and a given container widget key
92
- * @param dashboardConfig
93
- * @param containerWidgetKey
94
- * @returns {TDashboardWidgetKey} The next container widget key
95
- */
96
- getNextContainerKey: (dashboardConfig: IDashboardConfig, containerWidgetKey: TDashboardWidgetKey) => TDashboardWidgetKey;
97
- /**
98
- * @description Adds a widget to the configuration. Supports root-level and nested containers.
99
- * @param params - Configuration object for adding a widget.
100
- * @param params.dashboardConfig - The current {@link IDashboardConfig}.
101
- * @param params.widgetKey - The {@link TDashboardWidgetKey} to add.
102
- * @param params.parentWidgetKey - Optional parent container key.
103
- * @param params.noDuplicatedWidgets - If true, prevents adding the same key twice.
104
- * @returns A {@link TCoreResponse} containing the success status and updated config.
105
- */
106
- addWidget: (params: {
107
- dashboardConfig: IDashboardConfig;
108
- widgetKey: TDashboardWidgetKey;
109
- parentWidgetKey?: TDashboardWidgetKey;
110
- noDuplicatedWidgets?: boolean;
111
- }) => TCoreResponse<TAddWidgetResponse>;
112
- /**
113
- * @name removeWidget
114
- * @description Removes a widget from the dashboard configuration, either from the root level or from a specified parent container
115
- * @param dashboardConfig
116
- * @param widgetKey
117
- * @param parentWidgetKey
118
- * @returns {TCoreResponse<TRemoveWidgetResponse>} The response indicating success or failure and the updated dashboard configuration
119
- */
120
- removeWidget: (dashboardConfig: IDashboardConfig, widgetKey: TDashboardWidgetKey, parentWidgetKey?: TDashboardWidgetKey) => TCoreResponse<TRemoveWidgetResponse>;
121
- /**
122
- * @description Moves a widget's position within its current depth (root or container).
123
- * @param dashboardConfig - The current {@link IDashboardConfig}.
124
- * @param direction - Use `1` for forward/down and `-1` for backward/up.
125
- * @param widgetKey - The {@link TDashboardWidgetKey} to move.
126
- * @param parentWidgetKey - The container key if the widget is nested.
127
- * @returns A {@link TCoreResponse} with the new array order.
128
- */
129
- moveWidget: (dashboardConfig: IDashboardConfig, direction: -1 | 1, widgetKey: TDashboardWidgetKey, parentWidgetKey?: TDashboardWidgetKey) => TCoreResponse<TMoveWidgetResponse>;
130
- };
131
-
132
- export declare const DashboardZoomStep: 0.05;
133
-
134
- /**
135
- * @name ensureContainersSequence
136
- * @description
137
- * Ensures that the container widgets are numbered sequentially in the dashboardConfig, but the original order is preserved.
138
- */
139
- export declare const ensureContainersSequence: (dashboardConfig: IDashboardConfig) => IDashboardConfig;
140
-
141
- export declare const ensureZoomScaleIsWithinRange: (value: number) => number;
142
-
143
- export declare const getDefaultWidgetMetaFromKey: TGetDefaultWidgetMetaFromKey;
144
-
145
- /**
146
- * @name getDefaultWidgetMetaFromMap
147
- * @description Helper to get widget meta info from the catalog by key.
148
- */
149
- export declare const getDefaultWidgetMetaFromMap: <TFrameworkElementType = any>(widgetKey: TDashboardWidgetKey, defaultWidgetMetaMap: Record<TDashboardWidgetKey, TWidgetMetaInfoBase<TFrameworkElementType>>, options?: {
150
- title?: string;
151
- description?: string;
152
- }) => TWidgetMetaInfoBase<TFrameworkElementType>;
153
-
154
- /**
155
- * @name getDistinctCssClasses
156
- * @description Ensures a distinct list off css classes, avoiding duplicates
157
- * @param defaultClasses
158
- * @param additionalClasses
159
- * @returns the distinct list as a string
160
- */
161
- export declare const getDistinctCssClasses: (defaultClasses: string, ...additionalClasses: string[]) => string;
162
-
163
- export declare const getMetaInfoFromFile: (widgetMetaModules: Record<string, Record<string, TWidgetMetaInfoBase>>, baseSrcPath: string, folder: string, key: string) => TWidgetMetaInfoBase | undefined;
164
-
165
- export declare const getNewZoomScaleWithinRange: (currentZoomScale: number, direction: -1 | 1) => number;
166
-
167
- /**
168
- * @name getWidgetMetaFromCatalog
169
- * @description Helper to get widget meta info from the catalog by key.
170
- */
171
- export declare const getWidgetMetaFromCatalog: <TFrameworkElementType = any, TFrameworkComponentType = any>(widgetKey: TDashboardWidgetKey, widgetsCatalog: TDashboardWidgetCatalogBase<TFrameworkElementType, TFrameworkComponentType>) => TWidgetMetaInfoBase<TFrameworkElementType>;
172
-
173
- /**
174
- * @name IChildWidgetConfigEntry
175
- * @description Interface for a child widget configuration entry
176
- * @remarks Used in IDashboardConfig
177
- * @see IDashboardConfig
178
- */
179
- export declare interface IChildWidgetConfigEntry {
180
- parentWidgetKey: TDashboardWidgetKey;
181
- widgetKey: TDashboardWidgetKey;
182
- }
183
-
184
- /**
185
- * @name IDashboardConfig
186
- * @description Interface for the dashboard configuration
187
- * @remarks Used to store the dashboard state
188
- * @see IChildWidgetConfigEntry
189
- * @see IDashboardSettingEntry
190
- */
191
- export declare interface IDashboardConfig {
192
- userID: number | string;
193
- clientAppKey: string;
194
- dashboardId: string;
195
- dashboardName: string;
196
- zoomScale: number;
197
- responsiveGrid: boolean;
198
- widgets: TDashboardWidgetKey[];
199
- childWidgetsConfig: IChildWidgetConfigEntry[];
200
- cssSettings: IDashboardSettingEntry[];
201
- _version?: number;
202
- _stateDescription?: string;
203
- }
204
-
205
- /**
206
- * @name IDashboardGridPropsBase
207
- * @description Base interface for dashboard grid props passed to widgets.
208
- * @remarks
209
- * - `zoomScale` represents a uniform zoom applied to the dashboard UI. Default
210
- * behavior in the runtime clamps this value to a minimum of `0.7` and default
211
- * is `1` when not explicitly set.
212
- * - `responsiveGrid` toggles responsive layout behaviors vs fixed grid sizing.
213
- */
214
- export declare interface IDashboardGridPropsBase {
215
- isEditing: boolean;
216
- zoomScale: number;
217
- responsiveGrid: boolean;
218
- }
219
-
220
- /**
221
- * @name IDashboardSettingEntry
222
- * @description Interface for a dashboard setting entry
223
- * @see cssSettingsCatalog in dashboard-settings.ts
224
- */
225
- export declare interface IDashboardSettingEntry {
226
- key: string;
227
- name: string;
228
- description: string;
229
- cssProperty: string;
230
- step: number;
231
- defaultUnit: string;
232
- minValue: number;
233
- defaultValue: string;
234
- value: string;
235
- }
236
-
237
- /**
238
- * @name IDashboardStorageService
239
- * @description Interface for the dashboard storage service
240
- * @remarks Used to define the storage service methods
241
- * @see TGetSavedDashboards
242
- * @see TSaveDashboards
243
- * @see IDashboardConfig
244
- */
245
- export declare interface IDashboardStorageService {
246
- getSavedDashboards: TGetSavedDashboards;
247
- saveDashboards: TSaveDashboards;
248
- }
249
-
250
- /**
251
- * @name IDashboardWidgetPropsBase
252
- * @description Props provided to every widget instance rendered by the dashboard.
253
- * @template TExtraProps - Additional, widget-specific props supplied by the
254
- * dashboard or integrator via the dynamic loader.
255
- * @remarks
256
- * - `index` and `maxIndex` indicate the widget's position and the current
257
- * maximum index used for ordering (zero-based indexing is typical).
258
- * - `widgetKey` is the stable `TDashboardWidgetKey` identifying the widget
259
- * type; `parentWidgetKey` is set for nested/child widgets.
260
- * - Boolean flags like `hideTitle`, `noShadow`, `noBorder`, `noPadding` are
261
- * layout/presentation hints; default behavior should be documented by the
262
- * concrete widget implementation.
263
- * - `direction` applies to container widgets only.
264
- * - `extraProps` is merged into the widget props by the `DynamicWidgetLoader`.
265
- */
266
- export declare interface IDashboardWidgetPropsBase<TExtraProps = any> {
267
- index: number;
268
- maxIndex: number;
269
- widgetKey: TDashboardWidgetKey;
270
- parentWidgetKey?: TDashboardWidgetKey;
271
- isEditing: boolean;
272
- highlight?: boolean;
273
- testId?: string;
274
- title?: string;
275
- size?: TWidgetSize;
276
- borderCssClasses?: string;
277
- backgroundCssClasses?: string;
278
- addCssClasses?: string;
279
- overrideCssClasses?: string;
280
- tags?: string[];
281
- hideTitle?: boolean;
282
- noShadow?: boolean;
283
- noBorder?: boolean;
284
- noPadding?: boolean;
285
- direction?: TWidgetDirection;
286
- extraProps?: TExtraProps;
287
- }
288
-
289
- /**
290
- * @name IDynamicWidgetCatalogEntryBase
291
- * @description Catalog entry describing how to create or load a widget.
292
- * @template TFrameworkElementType - Framework-specific element type (icon, element)
293
- * @template TFrameworkComponentType - Framework-specific component type
294
- * @remarks
295
- * - `key` must be unique and stable across versions because it is stored in
296
- * saved dashboard configurations.
297
- * - `title` is the display name for catalogs and selection UIs.
298
- * - `isContainer` indicates a widget that can host children.
299
- * - `isRemote` marks entries that are expected to be loaded remotely (CDN,
300
- * external script) and may require extra loading/initialization steps.
301
- * - `meta` contains presentation metadata (see `TWidgetMetaInfoBase`).
302
- * - `component` is a direct component reference (preferred for static/core widgets).
303
- * - `loader` is an async factory used for dynamic/plugin widgets. When both
304
- * `component` and `loader` are provided, loaders are typically used for
305
- * dynamic initialization; concrete loaders/components precedence should be
306
- * defined by the integrator.
307
- */
308
- export declare interface IDynamicWidgetCatalogEntryBase<TFrameworkElementType = any, TFrameworkComponentType = any> {
309
- key: TDashboardWidgetKey;
310
- title: string;
311
- isContainer?: boolean;
312
- isRemote?: boolean;
313
- meta?: TWidgetMetaInfoBase<TFrameworkElementType>;
314
- component?: TFrameworkComponentType;
315
- loader?: TWidgetFactoryBase<TFrameworkComponentType>;
316
- }
317
-
318
- /**
319
- * @name localWidgetDiscovery
320
- * @description Scans local directories for widgets.
321
- * If lazy is true, it registers loaders. If false, it registers static components.
322
- */
323
- export declare const localWidgetDiscovery: (baseSrcPath: string, // e.g., "/src/async-widgets" or "/src/bundled-widgets"
324
- widgetModules: Record<string, any>, widgetMetaModules: Record<string, any>, lazy?: boolean) => [string, IDynamicWidgetCatalogEntryBase][];
325
-
326
- export declare const parseContainerTitle: (containerWidgetKey: TDashboardWidgetKey) => string;
327
-
328
- /**
329
- * Enhanced helper to derive key and title from widget file paths.
330
- * Handles:
331
- * - widget-total-orders -> WidgetTotalOrders
332
- * - widget-revenue-trends1 -> WidgetRevenueTrends1
333
- * - widget-with-extraprops -> WidgetWithExtraprops
334
- * - widget-revenue-trends-async -> WidgetRevenueTrendsAsync
335
- */
336
- export declare const parseKeyAndTitleFromFilePath: (path: string) => {
337
- key: TDashboardWidgetKey;
338
- name: string;
339
- folder: string;
340
- } | null;
341
-
342
- export declare const remoteWidgetDiscovery: (manifestUrl: string) => Promise<{
343
- entries: [string, IDynamicWidgetCatalogEntryBase][];
344
- message: string;
345
- details: string;
346
- }>;
347
-
348
- export declare const removeEmptyContainers: (dashboardConfig: IDashboardConfig) => IDashboardConfig;
349
-
350
- /**
351
- * @name resolveColorFromClass
352
- * @description Resolves the current computed color using your existing CSS classes
353
- * @param classNames, i.e. 'bg-primary'
354
- * @param property to resolve, i.e. 'backgroundColor'
355
- * @returns
356
- */
357
- export declare const resolveColorFromClass: (classNames: string | string[], property?: "color" | "backgroundColor") => string;
358
-
359
- /**
360
- * @name TAddWidgetResponse
361
- * @description Type for the response of the addWidget mutation
362
- * @property {boolean} success - Indicates if the widget was added successfully
363
- * @property {string} [message] - Optional message providing additional information
364
- * @property {IDashboardConfig} updatedDashboardConfig - The updated dashboard configuration after adding the widget
365
- * @property {IDashboardConfig[]} allUpdatedDashboardConfigs - All updated dashboard configurations
366
- */
367
- export declare type TAddWidgetResponse = {
368
- success: boolean;
369
- message?: string;
370
- updatedDashboardConfig: IDashboardConfig;
371
- allUpdatedDashboardConfigs: IDashboardConfig[];
372
- };
373
-
374
- declare type TCoreResponse<T> = Omit<T, 'allUpdatedDashboardConfigs'>;
375
-
376
- /**
377
- * @name TDashboardUndoStatus
378
- * @description Type for the dashboard undo/redo status
379
- * @remarks Used in dashboard undo/redo functionality
380
- */
381
- export declare type TDashboardUndoStatus = {
382
- isUndoDisabled: boolean;
383
- isRedoDisabled: boolean;
384
- _currentIndex?: number;
385
- _historyLength?: number;
386
- };
387
-
388
- /**
389
- * @name TDashboardWidgetCatalogBase
390
- * @description Map of available widgets used by the dashboard at runtime.
391
- * @template TFrameworkElementType - Framework-specific element type
392
- * @template TFrameworkComponentType - Framework-specific component type
393
- * @remarks Keys are `TDashboardWidgetKey` and values are catalog entries. The
394
- * map is typically treated as a read-only registry; replace the map to update
395
- * the available widget set rather than mutating entries in-place.
396
- */
397
- export declare type TDashboardWidgetCatalogBase<TFrameworkElementType = any, TFrameworkComponentType = any> = Map<TDashboardWidgetKey, IDynamicWidgetCatalogEntryBase<TFrameworkElementType, TFrameworkComponentType>>;
398
-
399
- /**
400
- * @name TDashboardWidgetKey
401
- * @description Type for the unique key identifying a dashboard widget.
402
- * @remarks
403
- * This is a simple alias for `string` to allow flexibility in widget keys.
404
- * Recommended formats: stable short strings (e.g. `myApp.ChartWidget`),
405
- * namespaced identifiers or UUIDs. Consumers should avoid empty strings.
406
- */
407
- export declare type TDashboardWidgetKey = string;
408
-
409
- /**
410
- * @name TGetDefaultWidgetMetaFromKey
411
- * @description Function that returns default `TWidgetMetaInfoBase` metadata for a widget key.
412
- * @remarks Implementations should return a new object (not a shared reference)
413
- * so callers can safely mutate the result if needed.
414
- * @see TWidgetMetaInfoBase
415
- * @see TGetDefaultWidgetMetaFromKeyOptions
416
- * @returns `TWidgetMetaInfoBase`
417
- */
418
- export declare type TGetDefaultWidgetMetaFromKey = (widgetKey: TDashboardWidgetKey, options?: TGetDefaultWidgetMetaFromKeyOptions) => TWidgetMetaInfoBase<any>;
419
-
420
- /**
421
- * @name TGetDefaultWidgetMetaFromKeyOptions
422
- * @description Optional overrides when generating default widget metadata.
423
- * @remarks Fields provided here override the generated metadata's `title`
424
- * and/or `description`.
425
- */
426
- export declare type TGetDefaultWidgetMetaFromKeyOptions = {
427
- name?: string;
428
- description?: string;
429
- };
430
-
431
- /**
432
- * @name TGetSavedDashboards
433
- * @description Function type to get saved dashboards for a user
434
- * @remarks Used in IDashboardStorageService
435
- * @see IDashboardConfig
436
- * @see TDashboardWidgetCatalogBase
437
- * @return Promise<IDashboardConfig[]>
438
- */
439
- export declare type TGetSavedDashboards = (userID: number | string, clientAppKey: string, widgetCatalog: TDashboardWidgetCatalogBase, defaultDashboardConfig: IDashboardConfig) => Promise<IDashboardConfig[]>;
440
-
441
- /**
442
- * @name TManifestEntry
443
- * @description Entry describing a remote widget manifest or resource.
444
- * @remarks
445
- * - `url` should point to the resource or manifest (absolute URLs recommended).
446
- * - `meta` contains widget metadata (see `TWidgetMetaInfoBase`) describing the
447
- * remotely loaded widget.
448
- */
449
- export declare type TManifestEntry = {
450
- url: string;
451
- meta: TWidgetMetaInfoBase;
452
- };
453
-
454
- export declare type TMoveWidgetResponse = TAddWidgetResponse;
455
-
456
- export declare type TRemoveWidgetResponse = TAddWidgetResponse;
457
-
458
- /**
459
- * @name TSaveDashboards
460
- * @description Function type to save dashboards for a user
461
- * @remarks Used in IDashboardStorageService
462
- * @see IDashboardConfig
463
- * @see TDashboardWidgetCatalogBase
464
- * @return Promise<boolean>
465
- */
466
- export declare type TSaveDashboards = (userID: number | string, clientAppKey: string, dashboardConfigs: IDashboardConfig[], widgetCatalog: TDashboardWidgetCatalogBase) => Promise<boolean>;
467
-
468
- /**
469
- * @name TUndoHistoryEntry
470
- * @description Type for an undo history entry
471
- * @remarks Used in dashboard undo/redo functionality
472
- * @see IDashboardConfig
473
- */
474
- export declare type TUndoHistoryEntry = {
475
- undoIndex: number;
476
- config: IDashboardConfig;
477
- };
478
-
479
- /**
480
- * @name TWidgetCategory
481
- * @description Type for widget categories used for grouping and UI filters.
482
- * @remarks
483
- * Typical usage: categorizing widgets in a palette, grouping by behavior
484
- * (for instance `Container` widgets may host child widgets).
485
- */
486
- export declare type TWidgetCategory = 'Widget' | 'Chart' | 'Container';
487
-
488
- /**
489
- * @name TWidgetDirection
490
- * @description Direction for layout flow inside container widgets.
491
- * @remarks Only meaningful for container-type widgets that arrange children in
492
- * either `row` or `column` flow.
493
- */
494
- export declare type TWidgetDirection = 'row' | 'column';
495
-
496
- /**
497
- * @name TWidgetFactoryBase
498
- * @description Async factory used to lazily load a framework component for a widget.
499
- * @template TFrameworkComponent - Framework-specific component type (e.g., React component)
500
- * @returns Promise resolving to an object with a `default` export containing the component.
501
- * @remarks Implementations should throw on unrecoverable load errors so callers
502
- * can handle fallbacks; returning a stub is also acceptable when documented.
503
- */
504
- export declare type TWidgetFactoryBase<TFrameworkComponent = any> = () => Promise<{
505
- default: TFrameworkComponent;
506
- }>;
507
-
508
- /**
509
- * @name TWidgetMetaInfoBase
510
- * @description Base metadata for a widget used by catalogs and tooling.
511
- * @template TFrameworkElementType - Framework-specific element type (e.g. React element, Vue component)
512
- * @remarks
513
- * Fields:
514
- * - `name` (required): Human readable widget name.
515
- * - `description` (required): Short description shown in tooltips or catalog lists.
516
- * - `categories` (required): One or more `TWidgetCategory` values used for grouping.
517
- * - `noDuplicatedWidgets` (optional): When true, dashboard UI should prevent
518
- * adding multiple instances of this widget.
519
- * - `icon` (optional): Framework-specific icon element or component. May be
520
- * `undefined` when not provided.
521
- * - `externalDependencies` (required): Array of package identifiers or CDN
522
- * references (e.g. `react@19.2.3`, `https://cdn.example.com/widget.js`). Use
523
- * semantic versions or absolute URLs as appropriate.
524
- *
525
- * Example:
526
- * {
527
- * name: 'Simple Chart',
528
- * description: 'Displays a time series',
529
- * categories: ['Chart'],
530
- * noDuplicatedWidgets: false,
531
- * icon: undefined,
532
- * externalDependencies: ['d3@7.0.0']
533
- * }
534
- */
535
- export declare type TWidgetMetaInfoBase<TFrameworkElementType = any> = {
536
- name: string;
537
- description: string;
538
- categories: TWidgetCategory[];
539
- noDuplicatedWidgets?: boolean;
540
- icon?: TFrameworkElementType | undefined;
541
- externalDependencies: string[];
542
- };
543
-
544
- /**
545
- * @name TWidgetSize
546
- * @description Size hint for widgets that can affect layout or styling.
547
- * @remarks 'default' represents the standard size; 'large' and 'xlarge' are
548
- * larger variants where the dashboard may allocate more grid cells.
549
- */
550
- export declare type TWidgetSize = 'default' | 'large' | 'xlarge';
551
-
552
- /**
553
- * @name useDashboardStorageService
554
- * @description
555
- * LocalStorage-backed implementation of `IDashboardStorageService`.
556
- *
557
- * Behavior:
558
- * - Persists an array of `IDashboardConfig` objects under the key
559
- * `dashboards_<clientAppKey>_<userID>` in `localStorage`.
560
- * - `getSavedDashboards` performs lightweight validation and normalization when
561
- * reading saved data: fills missing `dashboardId`/`dashboardName`, sanitizes
562
- * CSS settings, filters unknown widget keys, and clamps `zoomScale`.
563
- * - `saveDashboards` filters invalid widget keys, ensures required metadata
564
- * (`userID`, `clientAppKey`, `responsiveGrid`, `zoomScale`) and writes the
565
- * JSON-serialized dashboards to `localStorage`.
566
- *
567
- * Notes / limitations:
568
- * - Uses synchronous browser `localStorage` with limited quota — not suitable
569
- * for very large datasets or high-frequency writes.
570
- * - Does not provide server-side persistence or multi-user synchronization. To
571
- * persist dashboards centrally, implement a custom service that adheres to
572
- * `IDashboardStorageService` and replace this implementation.
573
- *
574
- * @returns An object implementing `IDashboardStorageService` with
575
- * `getSavedDashboards` and `saveDashboards` methods.
576
- */
577
- export declare const useDashboardStorageService: () => IDashboardStorageService;
578
-
579
- export { }