@tenorlab/react-dashboard 1.5.26 → 1.5.42

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/core.es.js CHANGED
@@ -1,4 +1,4 @@
1
- const w = [
1
+ const W = [
2
2
  {
3
3
  key: "grid-gap",
4
4
  name: "Gap",
@@ -76,7 +76,7 @@ const w = [
76
76
  defaultValue: "1.0rem",
77
77
  value: "1.0rem"
78
78
  }
79
- ], S = ["rem", "pc", "cm", "in", "em", "vh", "vw", "%"], b = (e, t) => S.includes(e) ? t : 1, E = {
79
+ ], b = ["rem", "pc", "cm", "in", "em", "vh", "vw", "%"], S = (e, t) => b.includes(e) ? t : 1, E = {
80
80
  /**
81
81
  * @name incrementOrDecrementValue
82
82
  * @description Increments or decrement a value based on the direction parameter
@@ -85,65 +85,65 @@ const w = [
85
85
  * @returns the update item
86
86
  */
87
87
  incrementOrDecrementValue: (e, t) => {
88
- const a = e.value.match(/([\d.]+)/), i = a ? parseFloat(a[1]) : 0, s = e.value.match(/([^\d.]+)/), n = s ? s[1] : e.defaultUnit, r = b(n, e.step) * t, c = `${Math.max(i + r, e.minValue).toFixed(1)}${n}`;
88
+ const i = e.value.match(/([\d.]+)/), a = i ? parseFloat(i[1]) : 0, r = e.value.match(/([^\d.]+)/), n = r ? r[1] : e.defaultUnit, s = S(n, e.step) * t, l = `${Math.max(a + s, e.minValue).toFixed(1)}${n}`;
89
89
  return {
90
90
  ...e,
91
- value: c
91
+ value: l
92
92
  };
93
93
  }
94
- }, f = (e, t) => `dashboards_${t}_${e}`, v = async (e, t, a, i) => {
95
- const s = localStorage.getItem(f(e, t));
96
- if (s)
94
+ }, y = (e, t) => `dashboards_${t}_${e}`, v = async (e, t, i, a) => {
95
+ const r = localStorage.getItem(y(e, t));
96
+ if (r)
97
97
  try {
98
- const n = JSON.parse(s);
99
- return n.length < 1 ? [i] : (n.forEach((r) => {
100
- r.dashboardId || (r.dashboardId = "default"), r.dashboardName || (r.dashboardName = `Dashboard ${r.dashboardId}`), r.responsiveGrid = r.responsiveGrid ?? !1, (r.widgets || []).length < 1 && (r.widgets = i.widgets);
101
- const c = (r.cssSettings || []).filter(
102
- (o) => i.cssSettings.some((d) => d.key === o.key)
98
+ const n = JSON.parse(r);
99
+ return n.length < 1 ? [a] : (n.forEach((s) => {
100
+ s.dashboardId || (s.dashboardId = "default"), s.dashboardName || (s.dashboardName = `Dashboard ${s.dashboardId}`), s.responsiveGrid = s.responsiveGrid ?? !1, (s.widgets || []).length < 1 && (s.widgets = a.widgets);
101
+ const l = (s.cssSettings || []).filter(
102
+ (o) => a.cssSettings.some((d) => d.key === o.key)
103
103
  );
104
- if (c.length < 1)
105
- r.cssSettings = [...i.cssSettings];
104
+ if (l.length < 1)
105
+ s.cssSettings = [...a.cssSettings];
106
106
  else {
107
- c.forEach((d) => {
107
+ l.forEach((d) => {
108
108
  d.value = (d.value || "").replace(/NaN/g, "");
109
- const l = i.cssSettings.find(
109
+ const c = a.cssSettings.find(
110
110
  (g) => g.key === d.key
111
111
  );
112
- l && (Object.keys(l).forEach((g) => {
113
- g in d || (d[g] = l[g]);
114
- }), d.step = l.step, d.minValue = l.minValue, d.defaultValue = l.defaultValue, d.defaultUnit = l.defaultUnit, /\d+/g.test(d.value) === !1 && (d.value = l ? l.value : "1.0rem"));
112
+ c && (Object.keys(c).forEach((g) => {
113
+ g in d || (d[g] = c[g]);
114
+ }), d.step = c.step, d.minValue = c.minValue, d.defaultValue = c.defaultValue, d.defaultUnit = c.defaultUnit, /\d+/g.test(d.value) === !1 && (d.value = c ? c.value : "1.0rem"));
115
115
  });
116
- const o = i.cssSettings.filter((d) => !c.some(
117
- (l) => l.key === d.key
116
+ const o = a.cssSettings.filter((d) => !l.some(
117
+ (c) => c.key === d.key
118
118
  ));
119
- r.cssSettings = [...c, ...o];
119
+ s.cssSettings = [...l, ...o];
120
120
  }
121
- r.widgets = r.widgets.filter(
122
- (o) => o.includes("WidgetContainer") || a.has(o)
123
- ), r.childWidgetsConfig = r.childWidgetsConfig.filter(
124
- (o) => a.has(o.widgetKey)
125
- ), r.zoomScale ? r.zoomScale < 0.7 && (r.zoomScale = 0.7) : r.zoomScale = 1;
121
+ s.widgets = s.widgets.filter(
122
+ (o) => o.includes("WidgetContainer") || i.has(o)
123
+ ), s.childWidgetsConfig = s.childWidgetsConfig.filter(
124
+ (o) => i.has(o.widgetKey)
125
+ ), s.zoomScale ? s.zoomScale < 0.7 && (s.zoomScale = 0.7) : s.zoomScale = 1;
126
126
  }), n);
127
127
  } catch (n) {
128
128
  console.warn("Error parsing saved dashboard config:", n);
129
129
  }
130
- return [i];
131
- }, C = async (e, t, a, i) => {
132
- a.forEach((n) => {
130
+ return [a];
131
+ }, $ = async (e, t, i, a) => {
132
+ i.forEach((n) => {
133
133
  if (n.userID = e, n.clientAppKey = t, n.responsiveGrid = n.responsiveGrid ?? !1, typeof n != "object")
134
134
  throw new Error("Invalid dashboard configuration");
135
135
  n.widgets = n.widgets.filter(
136
- (r) => r.includes("WidgetContainer") || i.has(r)
136
+ (s) => s.includes("WidgetContainer") || a.has(s)
137
137
  ), n.childWidgetsConfig = n.childWidgetsConfig.filter(
138
- (r) => i.has(r.widgetKey)
138
+ (s) => a.has(s.widgetKey)
139
139
  ), n.zoomScale ? n.zoomScale < 0.7 && (n.zoomScale = 0.7) : n.zoomScale = 1;
140
140
  });
141
- const s = JSON.stringify(a);
142
- return localStorage.setItem(f(e, t), s), !0;
143
- }, W = {
141
+ const r = JSON.stringify(i);
142
+ return localStorage.setItem(y(e, t), r), !0;
143
+ }, D = {
144
144
  getSavedDashboards: v,
145
- saveDashboards: C
146
- }, P = () => W, z = {
145
+ saveDashboards: $
146
+ }, P = () => D, U = {
147
147
  userID: 0,
148
148
  clientAppKey: "",
149
149
  dashboardId: "default",
@@ -152,158 +152,323 @@ const w = [
152
152
  responsiveGrid: !1,
153
153
  widgets: [],
154
154
  childWidgetsConfig: [],
155
- cssSettings: [...w]
156
- }, U = (e) => {
155
+ cssSettings: [...W]
156
+ }, z = (e) => {
157
157
  const t = `${e}`.split("_");
158
158
  return t.length > 1 ? t[1].replace(/(\D)(\d+)/, "$1 $2") : "Container";
159
- }, u = 0.7, p = 1, V = 0.05, D = (e) => {
159
+ }, p = 0.7, h = 1, V = 0.05, K = (e) => {
160
160
  let t = Number(e || 0);
161
- return t < u && (t = u), t > p && (t = p), t;
162
- }, j = (e, t) => {
163
- let a = Number(Number((V * t).toFixed(2)).toFixed(2)), i = Number((Number(e) + a).toFixed(2));
164
- return D(i);
165
- }, N = (e) => {
161
+ return t < p && (t = p), t > h && (t = h), t;
162
+ }, L = (e, t) => {
163
+ let i = Number(Number((V * t).toFixed(2)).toFixed(2)), a = Number((Number(e) + i).toFixed(2));
164
+ return K(a);
165
+ }, j = (e) => {
166
166
  let t = {
167
167
  ...e
168
168
  };
169
- return t.widgets = t.widgets.filter((a) => {
170
- if (`${a}`.includes("WidgetContainer")) {
171
- const i = t.childWidgetsConfig.filter(
172
- (s) => s.parentWidgetKey === a
169
+ return t.widgets = t.widgets.filter((i) => {
170
+ if (`${i}`.includes("WidgetContainer")) {
171
+ const a = t.childWidgetsConfig.filter(
172
+ (r) => r.parentWidgetKey === i
173
173
  );
174
- if (!i || i.length === 0)
174
+ if (!a || a.length === 0)
175
175
  return t.widgets = t.widgets.filter(
176
- (s) => s !== a
176
+ (r) => r !== i
177
177
  ), !1;
178
178
  }
179
179
  return !0;
180
180
  }), t;
181
181
  }, x = (e) => {
182
182
  const t = e.widgets.filter(
183
- (i) => i.includes("WidgetContainer")
184
- ), a = {};
185
- return t.forEach((i, s) => {
186
- const n = `${i.split("_container")[0]}_container${s + 1}`;
187
- a[i] = n;
188
- }), e.widgets = e.widgets.map((i) => a[i] || i), e.childWidgetsConfig = e.childWidgetsConfig.map((i) => {
189
- const s = i.parentWidgetKey, n = a[s];
183
+ (a) => a.includes("WidgetContainer")
184
+ ), i = {};
185
+ return t.forEach((a, r) => {
186
+ const n = `${a.split("_container")[0]}_container${r + 1}`;
187
+ i[a] = n;
188
+ }), e.widgets = e.widgets.map((a) => i[a] || a), e.childWidgetsConfig = e.childWidgetsConfig.map((a) => {
189
+ const r = a.parentWidgetKey, n = i[r];
190
190
  return {
191
- ...i,
191
+ ...a,
192
192
  // If a new key exists, use it. If not, keep the original key.
193
- parentWidgetKey: n || s
193
+ parentWidgetKey: n || r
194
194
  };
195
195
  }), e;
196
196
  }, m = (e, t) => {
197
- const a = `${e}`.includes("Container"), i = a ? ["Container"] : ["Widget"], s = t?.name || e, n = t?.description || (a ? "Container" : "Unknown");
197
+ const i = `${e}`.includes("Container"), a = i ? ["Container"] : ["Widget"], r = t?.name || e, n = t?.description || (i ? "Container" : "Unknown");
198
198
  return {
199
- name: s,
199
+ name: r,
200
200
  description: n,
201
- categories: i,
201
+ categories: a,
202
202
  noDuplicatedWidgets: !0,
203
203
  icon: void 0,
204
204
  externalDependencies: []
205
205
  };
206
- }, I = (e, t, a) => t[e] || m(e, a), M = (e, t) => t.get(e)?.meta || m(e), k = (e, t, a) => {
207
- const i = a || m(e);
206
+ }, M = (e, t, i) => t[e] || m(e, i), I = (e, t) => t.get(e)?.meta || m(e), k = (e, t, i) => {
207
+ const a = i || m(e);
208
208
  return [
209
209
  e,
210
210
  {
211
211
  key: e,
212
- title: i.name,
212
+ title: a.name,
213
213
  isContainer: `${e}`.includes("Container"),
214
214
  isRemote: !1,
215
- meta: i,
215
+ meta: a,
216
216
  component: t
217
217
  }
218
218
  ];
219
- }, h = (e, t, a, i) => {
220
- const s = i || m(e);
219
+ }, C = (e, t, i, a) => {
220
+ const r = a || m(e);
221
221
  return [
222
222
  e,
223
223
  {
224
224
  key: e,
225
- title: s.name,
225
+ title: r.name,
226
226
  isContainer: !1,
227
- isRemote: a,
228
- meta: s,
227
+ isRemote: i,
228
+ meta: r,
229
229
  loader: t
230
230
  }
231
231
  ];
232
232
  }, F = (e) => {
233
233
  const t = e.match(/\/widget-([a-zA-Z0-9-]+)\/index\.ts$/);
234
234
  if (t && t[1]) {
235
- const a = t[1], i = a.split("-"), s = `Widget${i.map((r) => r.charAt(0).toUpperCase() + r.slice(1)).join("")}`, n = i.map((r) => r.charAt(0).toUpperCase() + r.slice(1)).join(" ");
235
+ const i = t[1], a = i.split("-"), r = `Widget${a.map((s) => s.charAt(0).toUpperCase() + s.slice(1)).join("")}`, n = a.map((s) => s.charAt(0).toUpperCase() + s.slice(1)).join(" ");
236
236
  return {
237
- key: s,
237
+ key: r,
238
238
  name: n,
239
- folder: a
239
+ folder: i
240
240
  };
241
241
  }
242
242
  return null;
243
- }, $ = (e, t, a, i) => {
244
- const s = `${t}/widget-${a}/meta.ts`, n = e[s];
243
+ }, N = (e, t, i, a) => {
244
+ const r = `${t}/widget-${i}/meta.ts`, n = e[r];
245
245
  if (!n)
246
246
  return;
247
- const r = `${i}Meta`;
248
- return n[r] || void 0;
249
- }, A = async (e) => new Promise(async (t, a) => {
250
- const i = [];
247
+ const s = `${a}Meta`;
248
+ return n[s] || void 0;
249
+ }, A = async (e) => new Promise(async (t, i) => {
250
+ const a = [];
251
251
  try {
252
- const s = await (await fetch(`${e}?${Math.random()}`)).json();
253
- for (const n in s) {
254
- const r = s[n], c = () => import(
252
+ const r = await (await fetch(`${e}?${Math.random()}`)).json();
253
+ for (const n in r) {
254
+ const s = r[n], l = () => import(
255
255
  /* @vite-ignore */
256
- r.url
256
+ s.url
257
257
  ), o = {
258
- name: r.meta?.name || "Unknown",
259
- description: r.meta?.description || "Remote Plugin",
260
- categories: r.meta?.categories || ["Widget"],
261
- noDuplicatedWidgets: r.meta?.noDuplicatedWidgets ?? !0,
258
+ name: s.meta?.name || "Unknown",
259
+ description: s.meta?.description || "Remote Plugin",
260
+ categories: s.meta?.categories || ["Widget"],
261
+ noDuplicatedWidgets: s.meta?.noDuplicatedWidgets ?? !0,
262
262
  icon: void 0,
263
263
  // Or a logic to map a string name to a Lucide component
264
- externalDependencies: r.meta?.externalDependencies || []
264
+ externalDependencies: s.meta?.externalDependencies || []
265
265
  };
266
- i.push(h(n, c, !0, o));
266
+ a.push(C(n, l, !0, o));
267
267
  }
268
268
  t({
269
- entries: i,
269
+ entries: a,
270
270
  message: "",
271
271
  details: ""
272
272
  });
273
- } catch (s) {
274
- console.error("Remote plugin discovery failed:", s), a({
273
+ } catch (r) {
274
+ console.error("Remote plugin discovery failed:", r), i({
275
275
  entries: [],
276
276
  message: "Remote plugin discovery failed:",
277
- details: typeof s == "object" ? JSON.stringify(s) : s
277
+ details: typeof r == "object" ? JSON.stringify(r) : r
278
278
  });
279
279
  }
280
- }), K = (e, t, a, i = !0) => {
281
- const s = [];
280
+ }), R = (e, t, i, a = !0) => {
281
+ const r = [];
282
282
  for (const n in t) {
283
- const r = t[n], c = F(n);
284
- if (c && r) {
285
- const { key: o, name: d, folder: l } = c;
286
- let g = $(a, e, l, o);
283
+ const s = t[n], l = F(n);
284
+ if (l && s) {
285
+ const { key: o, name: d, folder: c } = l;
286
+ let g = N(i, e, c, o);
287
287
  if (g || (g = m(o, {
288
288
  name: d,
289
- description: `Local ${i ? "dynamic" : "static"} widget`
290
- })), i)
291
- s.push(
292
- h(o, r, !1, g)
289
+ description: `Local ${a ? "dynamic" : "static"} widget`
290
+ })), a)
291
+ r.push(
292
+ C(o, s, !1, g)
293
293
  );
294
294
  else {
295
- const y = r.default || r;
296
- s.push(k(o, y, g));
295
+ const f = s.default || s;
296
+ r.push(k(o, f, g));
297
297
  }
298
298
  }
299
299
  }
300
- return s;
301
- }, R = (e, t = "color") => {
300
+ return r;
301
+ }, w = (e) => {
302
+ const t = e.widgets.filter((i) => i.includes("WidgetContainer")).map((i) => Number(i.split("_")[1].replace("container", "")));
303
+ return `container${t.length > 0 ? Math.max(...t) + 1 : 1}`;
304
+ }, O = {
305
+ /**
306
+ * @name getNextContainerName
307
+ * @description Generates the next container name based on existing containers in the dashboard configuration
308
+ * @param dashboardConfig
309
+ * @returns {string} The next container name in the format 'containerX', where X is the next available number
310
+ */
311
+ getNextContainerName: w,
312
+ /**
313
+ * @name getNextContainerKey
314
+ * @description Generates the next container widget key based on the dashboard configuration and a given container widget key
315
+ * @param dashboardConfig
316
+ * @param containerWidgetKey
317
+ * @returns {TDashboardWidgetKey} The next container widget key
318
+ */
319
+ getNextContainerKey: (e, t) => {
320
+ const i = w(e);
321
+ return `${t}_${i}`;
322
+ },
323
+ /**
324
+ * @description Adds a widget to the configuration. Supports root-level and nested containers.
325
+ * @param params - Configuration object for adding a widget.
326
+ * @param params.dashboardConfig - The current {@link IDashboardConfig}.
327
+ * @param params.widgetKey - The {@link TDashboardWidgetKey} to add.
328
+ * @param params.parentWidgetKey - Optional parent container key.
329
+ * @param params.noDuplicatedWidgets - If true, prevents adding the same key twice.
330
+ * @returns A {@link TCoreResponse} containing the success status and updated config.
331
+ */
332
+ addWidget: (e) => {
333
+ const { dashboardConfig: t, widgetKey: i, parentWidgetKey: a, noDuplicatedWidgets: r } = e;
334
+ if (a) {
335
+ if (r && t.childWidgetsConfig.find(
336
+ (s) => s.parentWidgetKey === a && s.widgetKey === i
337
+ ))
338
+ return {
339
+ success: !1,
340
+ message: `DashboardStore: addWidget: Widget already added (${i})`,
341
+ updatedDashboardConfig: t
342
+ };
343
+ const n = [
344
+ ...t.childWidgetsConfig,
345
+ { parentWidgetKey: a, widgetKey: i }
346
+ // new entry
347
+ ];
348
+ return {
349
+ success: !0,
350
+ updatedDashboardConfig: {
351
+ ...t,
352
+ childWidgetsConfig: n
353
+ }
354
+ };
355
+ } else {
356
+ if (r && t.widgets.includes(i))
357
+ return {
358
+ success: !1,
359
+ message: `DashboardStore: addWidget: Widget already added (${i})`,
360
+ updatedDashboardConfig: t
361
+ };
362
+ const n = [...t.widgets, i];
363
+ return {
364
+ success: !0,
365
+ updatedDashboardConfig: {
366
+ ...t,
367
+ widgets: n
368
+ }
369
+ };
370
+ }
371
+ },
372
+ /**
373
+ * @name removeWidget
374
+ * @description Removes a widget from the dashboard configuration, either from the root level or from a specified parent container
375
+ * @param dashboardConfig
376
+ * @param widgetKey
377
+ * @param parentWidgetKey
378
+ * @returns {TCoreResponse<TRemoveWidgetResponse>} The response indicating success or failure and the updated dashboard configuration
379
+ */
380
+ removeWidget: (e, t, i) => {
381
+ const a = `${t || ""}`.trim().toLowerCase(), r = `${i || ""}`.trim().toLowerCase();
382
+ if (r.length > 0) {
383
+ const n = e.childWidgetsConfig.filter(
384
+ (d) => `${d.parentWidgetKey}`.trim().toLowerCase() !== r
385
+ ), s = e.childWidgetsConfig.filter(
386
+ (d) => `${d.parentWidgetKey}`.trim().toLowerCase() === r && `${d.widgetKey}`.trim().toLowerCase() !== a
387
+ ), l = [...n, ...s];
388
+ let o = {
389
+ ...e,
390
+ childWidgetsConfig: l
391
+ };
392
+ return a.includes("container") && (o = x(o)), {
393
+ success: !0,
394
+ updatedDashboardConfig: o
395
+ };
396
+ } else {
397
+ const n = (e.widgets || []).filter(
398
+ (l) => `${l}`.trim().toLowerCase() !== a
399
+ ), s = e.childWidgetsConfig.filter(
400
+ (l) => `${l.parentWidgetKey}`.trim().toLowerCase() !== a
401
+ );
402
+ return {
403
+ success: !0,
404
+ updatedDashboardConfig: {
405
+ ...e,
406
+ widgets: n,
407
+ childWidgetsConfig: s
408
+ }
409
+ };
410
+ }
411
+ },
412
+ /**
413
+ * @description Moves a widget's position within its current depth (root or container).
414
+ * @param dashboardConfig - The current {@link IDashboardConfig}.
415
+ * @param direction - Use `1` for forward/down and `-1` for backward/up.
416
+ * @param widgetKey - The {@link TDashboardWidgetKey} to move.
417
+ * @param parentWidgetKey - The container key if the widget is nested.
418
+ * @returns A {@link TCoreResponse} with the new array order.
419
+ */
420
+ moveWidget: (e, t, i, a) => {
421
+ const r = `${i || ""}`.trim().toLowerCase(), n = `${a || ""}`.trim().toLowerCase();
422
+ if (n.length > 0) {
423
+ const s = e.childWidgetsConfig.filter(
424
+ (u) => `${u.parentWidgetKey}`.trim().toLowerCase() !== n
425
+ );
426
+ let l = e.childWidgetsConfig.filter(
427
+ (u) => `${u.parentWidgetKey}`.trim().toLowerCase() === n
428
+ );
429
+ const o = l.find(
430
+ (u) => `${u.widgetKey}`.trim().toLowerCase() === r
431
+ ), d = l.indexOf(o);
432
+ let c = d + t;
433
+ if (c = Math.max(0, c), c = Math.min(l.length - 1, c), c === d)
434
+ return {
435
+ success: !1,
436
+ message: `DashboardStore: moveWidget: Widget already at min/max position (${i})`,
437
+ updatedDashboardConfig: e
438
+ };
439
+ const g = [...l], [f] = g.splice(d, 1);
440
+ return g.splice(c, 0, f), {
441
+ success: !0,
442
+ updatedDashboardConfig: {
443
+ ...e,
444
+ childWidgetsConfig: [...s, ...g]
445
+ }
446
+ };
447
+ } else {
448
+ const s = e.widgets || [], l = s.map((g) => `${g}`.trim().toLowerCase()).indexOf(r);
449
+ let o = l + t;
450
+ if (o = Math.max(0, o), o = Math.min(s.length - 1, o), o === l)
451
+ return {
452
+ success: !1,
453
+ message: `DashboardStore: moveWidget: Widget already at min/max position (${i})`,
454
+ updatedDashboardConfig: e
455
+ };
456
+ const d = [...s], [c] = d.splice(l, 1);
457
+ return d.splice(o, 0, c), {
458
+ success: !0,
459
+ updatedDashboardConfig: {
460
+ ...e,
461
+ widgets: d
462
+ }
463
+ };
464
+ }
465
+ }
466
+ }, _ = (e, t = "color") => {
302
467
  if (typeof window > "u") return "#FFFFFF";
303
- const a = document.createElement("div");
304
- Array.isArray(e) ? e.forEach((s) => a.classList.add(s)) : e.split(" ").forEach((s) => a.classList.add(s)), a.style.display = "none", document.body.appendChild(a);
305
- const i = window.getComputedStyle(a)[t];
306
- return document.body.removeChild(a), i;
468
+ const i = document.createElement("div");
469
+ Array.isArray(e) ? e.forEach((r) => i.classList.add(r)) : e.split(" ").forEach((r) => i.classList.add(r)), i.style.display = "none", document.body.appendChild(i);
470
+ const a = window.getComputedStyle(i)[t];
471
+ return document.body.removeChild(i), a;
307
472
  }, G = {
308
473
  /**
309
474
  * @name getCssVariableValue
@@ -333,8 +498,8 @@ const w = [
333
498
  */
334
499
  restoreCssVarsFromSettings: (e) => {
335
500
  const t = document.documentElement;
336
- e.forEach((a) => {
337
- t.style.setProperty(a.cssProperty, a.value);
501
+ e.forEach((i) => {
502
+ t.style.setProperty(i.cssProperty, i.value);
338
503
  });
339
504
  }
340
505
  }, Z = (e, ...t) => [
@@ -343,28 +508,29 @@ const w = [
343
508
  )
344
509
  ].join(" ").trim();
345
510
  export {
346
- p as DashboardMaxZoomScale,
347
- u as DashboardMinZoomScale,
511
+ h as DashboardMaxZoomScale,
512
+ p as DashboardMinZoomScale,
348
513
  V as DashboardZoomStep,
349
- z as blankDashboardConfig,
350
- h as createDynamicEntry,
514
+ U as blankDashboardConfig,
515
+ C as createDynamicEntry,
351
516
  k as createStaticEntry,
352
- w as cssSettingsCatalog,
517
+ W as cssSettingsCatalog,
353
518
  G as cssVarsUtils,
354
519
  E as dashboardSettingsUtils,
520
+ O as dashboardStoreUtils,
355
521
  x as ensureContainersSequence,
356
- D as ensureZoomScaleIsWithinRange,
522
+ K as ensureZoomScaleIsWithinRange,
357
523
  m as getDefaultWidgetMetaFromKey,
358
- I as getDefaultWidgetMetaFromMap,
524
+ M as getDefaultWidgetMetaFromMap,
359
525
  Z as getDistinctCssClasses,
360
- $ as getMetaInfoFromFile,
361
- j as getNewZoomScaleWithinRange,
362
- M as getWidgetMetaFromCatalog,
363
- K as localWidgetDiscovery,
364
- U as parseContainerTitle,
526
+ N as getMetaInfoFromFile,
527
+ L as getNewZoomScaleWithinRange,
528
+ I as getWidgetMetaFromCatalog,
529
+ R as localWidgetDiscovery,
530
+ z as parseContainerTitle,
365
531
  F as parseKeyAndTitleFromFilePath,
366
532
  A as remoteWidgetDiscovery,
367
- N as removeEmptyContainers,
368
- R as resolveColorFromClass,
533
+ j as removeEmptyContainers,
534
+ _ as resolveColorFromClass,
369
535
  P as useDashboardStorageService
370
536
  };
@@ -323,6 +323,14 @@ export declare function SvgBaseWrapper({ children, className, }: {
323
323
 
324
324
  export declare function TabletSmartphoneIcon({ className }: TIconProps): JSX_2.Element;
325
325
 
326
+ /**
327
+ * @name TAddWidgetResponse
328
+ * @description Type for the response of the addWidget mutation
329
+ * @property {boolean} success - Indicates if the widget was added successfully
330
+ * @property {string} [message] - Optional message providing additional information
331
+ * @property {IDashboardConfig} updatedDashboardConfig - The updated dashboard configuration after adding the widget
332
+ * @property {IDashboardConfig[]} allUpdatedDashboardConfigs - All updated dashboard configurations
333
+ */
326
334
  declare type TAddWidgetResponse = {
327
335
  success: boolean;
328
336
  message?: string;
@@ -526,6 +534,14 @@ export declare type TWidgetCategory = 'Widget' | 'Chart' | 'Container';
526
534
  */
527
535
  export declare type TWidgetDirection = 'row' | 'column';
528
536
 
537
+ export declare type TWidgetErrorExtraProps = {
538
+ versionMismatch: boolean;
539
+ requiredVer: string;
540
+ hostVer: string;
541
+ errorMessage: string;
542
+ externalDependencies: string[];
543
+ };
544
+
529
545
  /**
530
546
  * @name TWidgetFactory
531
547
  * @description A type representing a widget factory function specific to React framework.