react-semaphor 0.1.121 → 0.1.123
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/chunks/{dashboard-controls-CzcAbxpr.js → dashboard-controls-4-hApe-r.js} +1 -1
- package/dist/chunks/{dashboard-controls-CyhTMpZ2.js → dashboard-controls-D3NUafF1.js} +71 -71
- package/dist/chunks/{dashboard-json-BcB9WzEx.js → dashboard-json-BWrMOlwz.js} +1 -1
- package/dist/chunks/{dashboard-json-BQPFtG3z.js → dashboard-json-DUat0hoS.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-CLdMn0FN.js → edit-dashboard-visual-ClzaW7MR.js} +3 -3
- package/dist/chunks/{edit-dashboard-visual-D6KBQgRc.js → edit-dashboard-visual-Du049yu_.js} +1 -1
- package/dist/chunks/{editor-action-buttons-D8lG5LwM.js → editor-action-buttons-CVUUl8IQ.js} +1 -1
- package/dist/chunks/{editor-action-buttons-CEzZTeqn.js → editor-action-buttons-FUlZ__xi.js} +2 -2
- package/dist/chunks/{index-CJrseB0V.js → index-C9xqgHpT.js} +185 -185
- package/dist/chunks/{index-Cyic0UlN.js → index-Ci1UbzGA.js} +9057 -8996
- package/dist/chunks/{resource-management-panel-BNDpfKQl.js → resource-management-panel-Gn5D4PEs.js} +1 -1
- package/dist/chunks/{resource-management-panel-DDLB-UWe.js → resource-management-panel-rBUF-JVD.js} +139 -139
- package/dist/chunks/{schedule-dashboard-CqFcuP5E.js → schedule-dashboard-CHuBJfod.js} +1 -1
- package/dist/chunks/{schedule-dashboard-BEV7hj7t.js → schedule-dashboard-Xn9bMPcv.js} +22 -22
- package/dist/chunks/{use-visual-utils-BzfETcB4.js → use-visual-utils-BTE9nvU2.js} +1 -1
- package/dist/chunks/{use-visual-utils-GI2MN0MK.js → use-visual-utils-Dk9v6ZRs.js} +11 -11
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +70 -68
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +1 -1
- package/dist/types/main.d.ts +4 -0
- package/package.json +1 -1
package/dist/chunks/{resource-management-panel-DDLB-UWe.js → resource-management-panel-rBUF-JVD.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as e, jsxs as a, Fragment as me } from "react/jsx-runtime";
|
|
2
|
-
import { b as
|
|
2
|
+
import { b as Ke, u as de, f as We, am as ne, aO as Ye, aP as Je, c as ee, aQ as Qe, aE as Xe, aF as Ze, B as G, aG as $e, aH as ke, aI as J, aR as ce, L as ie, aS as et, aT as tt, aU as st, aV as Ne, aW as pe, aX as at, aY as nt, I as it, aZ as be, a_ as re, a$ as Ce, b0 as ve, b1 as rt, J as ye, R as Se, b2 as Ve, b3 as Ee, b4 as Le, b5 as Te, b6 as Oe, b7 as Ae, b8 as Pe, b9 as Re, ba as Ie, bb as ot, bc as lt, bd as Ue, be as je, bf as Me, bg as dt, bh as Fe, bi as ct, aC as ae, al as ut, bj as ht, bk as ze, bl as mt, bm as pt, aq as ft, ar as gt, as as Dt, at as xt, au as Nt, av as we, aw as ue, az as wt, bn as bt, bo as Ct, bp as vt, bq as yt } from "./index-Ci1UbzGA.js";
|
|
3
3
|
import St, { useState as g, useEffect as he } from "react";
|
|
4
|
-
import { a as Be } from "./use-visual-utils-
|
|
4
|
+
import { a as Be } from "./use-visual-utils-Dk9v6ZRs.js";
|
|
5
5
|
import { u as Vt } from "./use-click-outside-CMeO_QFI.js";
|
|
6
6
|
/**
|
|
7
7
|
* @license lucide-react v0.453.0 - ISC
|
|
@@ -9,7 +9,7 @@ import { u as Vt } from "./use-click-outside-CMeO_QFI.js";
|
|
|
9
9
|
* This source code is licensed under the ISC license.
|
|
10
10
|
* See the LICENSE file in the root directory of this source tree.
|
|
11
11
|
*/
|
|
12
|
-
const Et =
|
|
12
|
+
const Et = Ke("FolderOpen", [
|
|
13
13
|
[
|
|
14
14
|
"path",
|
|
15
15
|
{
|
|
@@ -35,7 +35,7 @@ function He() {
|
|
|
35
35
|
)) });
|
|
36
36
|
}
|
|
37
37
|
const Lt = (t) => {
|
|
38
|
-
const f = de((r) => r.isVisualEditing), p = de((r) => r.selectedFrameId), i =
|
|
38
|
+
const f = de((r) => r.isVisualEditing), p = de((r) => r.selectedFrameId), i = We((r) => r.frame);
|
|
39
39
|
return !!(f && p && (i == null ? void 0 : i.visualId) === t);
|
|
40
40
|
};
|
|
41
41
|
function Tt({
|
|
@@ -51,17 +51,17 @@ function Tt({
|
|
|
51
51
|
onShareVisual: N,
|
|
52
52
|
formatDate: S
|
|
53
53
|
}) {
|
|
54
|
-
var P,
|
|
55
|
-
const { selectVisual: l } = ne(), d =
|
|
54
|
+
var P, y, C, O;
|
|
55
|
+
const { selectVisual: l } = ne(), d = Ye(t.id), h = Lt(t.id), { isConsoleMode: V } = Je(), E = St.useRef(null), [w, v] = g(!1), [L, T] = g(!1);
|
|
56
56
|
he(() => {
|
|
57
|
-
p ? (
|
|
57
|
+
p ? (v(!0), T(!0)) : L && (v(!1), T(!1));
|
|
58
58
|
}, [p, L]), he(() => {
|
|
59
59
|
h && E.current && E.current.scrollIntoView({
|
|
60
60
|
behavior: "smooth",
|
|
61
61
|
block: "center"
|
|
62
62
|
});
|
|
63
63
|
}, [h]);
|
|
64
|
-
const
|
|
64
|
+
const I = () => {
|
|
65
65
|
l(t), r == null || r(t);
|
|
66
66
|
};
|
|
67
67
|
return /* @__PURE__ */ a(
|
|
@@ -72,7 +72,7 @@ function Tt({
|
|
|
72
72
|
"group flex cursor-pointer items-start gap-3 rounded-md px-2 py-2 transition-colors hover:bg-muted",
|
|
73
73
|
h ? "bg-purple-500/10" : d && "bg-muted/80"
|
|
74
74
|
),
|
|
75
|
-
onClick:
|
|
75
|
+
onClick: I,
|
|
76
76
|
children: [
|
|
77
77
|
/* @__PURE__ */ e(Qe, { className: "mt-0.5 h-4 w-4 flex-shrink-0 text-muted-foreground/50" }),
|
|
78
78
|
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ a("div", { className: "flex items-start justify-between gap-2", children: [
|
|
@@ -105,9 +105,9 @@ function Tt({
|
|
|
105
105
|
{
|
|
106
106
|
modal: !1,
|
|
107
107
|
open: w,
|
|
108
|
-
onOpenChange:
|
|
108
|
+
onOpenChange: v,
|
|
109
109
|
children: [
|
|
110
|
-
/* @__PURE__ */ e(Ze, { asChild: !0, children: /* @__PURE__ */ e(
|
|
110
|
+
/* @__PURE__ */ e(Ze, { asChild: !0, children: /* @__PURE__ */ e(G, { size: "sm", variant: "ghost", className: "h-6 w-6 p-0", children: /* @__PURE__ */ e($e, { className: "h-3 w-3" }) }) }),
|
|
111
111
|
/* @__PURE__ */ a(ke, { align: "end", className: "z-[51] w-40", children: [
|
|
112
112
|
/* @__PURE__ */ a(
|
|
113
113
|
J,
|
|
@@ -189,9 +189,9 @@ function Tt({
|
|
|
189
189
|
] }),
|
|
190
190
|
/* @__PURE__ */ e(Ne, {}),
|
|
191
191
|
/* @__PURE__ */ a("div", { className: "space-y-1 px-2 py-2 text-xs text-slate-500 dark:text-slate-400", children: [
|
|
192
|
-
(((
|
|
192
|
+
(((y = t.ownership.createdBy) == null ? void 0 : y.type) === "tenant" || ((C = t.ownership.createdBy) == null ? void 0 : C.type) === "organization" && V) && /* @__PURE__ */ a("div", { className: "flex items-center gap-1", children: [
|
|
193
193
|
/* @__PURE__ */ e(at, { className: "h-3 w-3" }),
|
|
194
|
-
/* @__PURE__ */ e("span", { children: ((
|
|
194
|
+
/* @__PURE__ */ e("span", { children: ((O = t.ownership.createdBy) == null ? void 0 : O.name) || "Unknown" })
|
|
195
195
|
] }),
|
|
196
196
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-1", children: [
|
|
197
197
|
/* @__PURE__ */ e(nt, { className: "h-3 w-3" }),
|
|
@@ -226,27 +226,27 @@ function Tt({
|
|
|
226
226
|
t.id
|
|
227
227
|
);
|
|
228
228
|
}
|
|
229
|
-
function
|
|
229
|
+
function Ot({ searchQuery: t }) {
|
|
230
230
|
const [f, p] = g(!1), [i, r] = g(
|
|
231
231
|
null
|
|
232
232
|
), [D, x] = g(!1), [m, N] = g(null), [S, l] = g(null), [d, h] = g(
|
|
233
233
|
null
|
|
234
234
|
), { selectVisual: V } = ne(), { handleEditLibraryVisual: E, handleAddLibraryVisual: w } = Be(), {
|
|
235
|
-
resources:
|
|
235
|
+
resources: v,
|
|
236
236
|
isLoading: L,
|
|
237
237
|
isError: T,
|
|
238
|
-
updateResource:
|
|
238
|
+
updateResource: I,
|
|
239
239
|
deleteResource: P,
|
|
240
|
-
duplicateResource:
|
|
241
|
-
isDeleting:
|
|
242
|
-
} =
|
|
240
|
+
duplicateResource: y,
|
|
241
|
+
isDeleting: C
|
|
242
|
+
} = be(() => {
|
|
243
243
|
x(!1), N(null);
|
|
244
244
|
});
|
|
245
245
|
re();
|
|
246
|
-
const
|
|
246
|
+
const O = v.filter(
|
|
247
247
|
(n) => {
|
|
248
|
-
var
|
|
249
|
-
return ((
|
|
248
|
+
var A, o;
|
|
249
|
+
return ((A = n == null ? void 0 : n.title) == null ? void 0 : A.toLowerCase().includes(t.toLowerCase())) || ((o = n == null ? void 0 : n.description) == null ? void 0 : o.toLowerCase().includes(t.toLowerCase()));
|
|
250
250
|
}
|
|
251
251
|
), c = (n) => new Date(n).toLocaleDateString("en-US", {
|
|
252
252
|
month: "short",
|
|
@@ -258,36 +258,36 @@ function At({ searchQuery: t }) {
|
|
|
258
258
|
m && P(m.id);
|
|
259
259
|
}, {
|
|
260
260
|
startUpdating: F,
|
|
261
|
-
stopUpdating:
|
|
261
|
+
stopUpdating: K,
|
|
262
262
|
isUpdating: R
|
|
263
|
-
} =
|
|
263
|
+
} = Ce(), z = (n, A, o) => {
|
|
264
264
|
var se;
|
|
265
|
-
const
|
|
266
|
-
Object.entries(
|
|
265
|
+
const Y = Object.fromEntries(
|
|
266
|
+
Object.entries(A).filter(([, j]) => j !== void 0)
|
|
267
267
|
);
|
|
268
|
-
if (Object.keys(
|
|
268
|
+
if (Object.keys(Y).length === 0) {
|
|
269
269
|
(se = o == null ? void 0 : o.onSuccess) == null || se.call(o);
|
|
270
270
|
return;
|
|
271
271
|
}
|
|
272
|
-
const te = Object.keys(
|
|
273
|
-
F(n, k),
|
|
272
|
+
const te = Object.keys(Y), k = te.length === 1 ? te[0] : void 0;
|
|
273
|
+
F(n, k), I(
|
|
274
274
|
{
|
|
275
275
|
resourceId: n,
|
|
276
|
-
data:
|
|
276
|
+
data: Y
|
|
277
277
|
},
|
|
278
278
|
{
|
|
279
279
|
onSuccess: () => {
|
|
280
280
|
var j;
|
|
281
|
-
|
|
281
|
+
K(n, k), (j = o == null ? void 0 : o.onSuccess) == null || j.call(o);
|
|
282
282
|
},
|
|
283
283
|
onError: () => {
|
|
284
284
|
var j;
|
|
285
|
-
|
|
285
|
+
K(n, k), (j = o == null ? void 0 : o.onError) == null || j.call(o);
|
|
286
286
|
}
|
|
287
287
|
}
|
|
288
288
|
);
|
|
289
289
|
}, B = (n) => {
|
|
290
|
-
l(n),
|
|
290
|
+
l(n), y(n, {
|
|
291
291
|
onSettled: () => l(null)
|
|
292
292
|
});
|
|
293
293
|
}, X = (n) => {
|
|
@@ -295,36 +295,36 @@ function At({ searchQuery: t }) {
|
|
|
295
295
|
}, H = (n) => {
|
|
296
296
|
w(n);
|
|
297
297
|
}, Z = (n) => {
|
|
298
|
-
const
|
|
299
|
-
|
|
298
|
+
const A = v.find((o) => o.id === n);
|
|
299
|
+
A && I({
|
|
300
300
|
resourceId: n,
|
|
301
301
|
data: {
|
|
302
|
-
isPrivate: !
|
|
302
|
+
isPrivate: !A.isPrivate
|
|
303
303
|
}
|
|
304
304
|
});
|
|
305
305
|
}, _ = (n) => {
|
|
306
306
|
r(n), p(!0);
|
|
307
|
-
},
|
|
307
|
+
}, W = (n) => {
|
|
308
308
|
h(n);
|
|
309
|
-
},
|
|
309
|
+
}, b = () => {
|
|
310
310
|
h(null);
|
|
311
311
|
}, $ = ({
|
|
312
312
|
title: n,
|
|
313
|
-
description:
|
|
313
|
+
description: A
|
|
314
314
|
}) => {
|
|
315
315
|
if (!d)
|
|
316
316
|
return;
|
|
317
317
|
const o = {};
|
|
318
|
-
n !== d.title && (o.title = n), (d.description || "") !==
|
|
318
|
+
n !== d.title && (o.title = n), (d.description || "") !== A && (o.description = A), z(d.id, o, {
|
|
319
319
|
onSuccess: () => {
|
|
320
320
|
h(null);
|
|
321
321
|
}
|
|
322
322
|
});
|
|
323
323
|
};
|
|
324
|
-
return L ? /* @__PURE__ */ e(He, {}) : T ? /* @__PURE__ */ e(
|
|
324
|
+
return L ? /* @__PURE__ */ e(He, {}) : T ? /* @__PURE__ */ e(ve, { className: "w-full flex-1 pr-2", children: /* @__PURE__ */ a("div", { className: "py-8 text-center text-muted-foreground", children: [
|
|
325
325
|
/* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: "Failed to load visuals" }),
|
|
326
326
|
/* @__PURE__ */ e(
|
|
327
|
-
|
|
327
|
+
G,
|
|
328
328
|
{
|
|
329
329
|
variant: "outline",
|
|
330
330
|
size: "sm",
|
|
@@ -334,29 +334,29 @@ function At({ searchQuery: t }) {
|
|
|
334
334
|
}
|
|
335
335
|
)
|
|
336
336
|
] }) }) : /* @__PURE__ */ a("div", { className: "flex h-full flex-1 flex-col", children: [
|
|
337
|
-
/* @__PURE__ */ e("div", { className: "flex flex-1 basis-0 flex-col gap-3 overflow-y-auto", children:
|
|
337
|
+
/* @__PURE__ */ e("div", { className: "flex flex-1 basis-0 flex-col gap-3 overflow-y-auto", children: O.length === 0 ? /* @__PURE__ */ a("div", { className: "py-8 text-center", children: [
|
|
338
338
|
/* @__PURE__ */ e("div", { className: "mb-3", children: /* @__PURE__ */ e(rt, { className: "mx-auto h-12 w-12 text-muted-foreground/50" }) }),
|
|
339
339
|
/* @__PURE__ */ e("h3", { className: "mb-1 font-medium text-foreground", children: t ? "No visuals found" : "No visuals yet" }),
|
|
340
340
|
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: t ? "Try adjusting your search" : 'Click "Create" above to add your first visual' })
|
|
341
|
-
] }) :
|
|
341
|
+
] }) : O.map((n) => /* @__PURE__ */ e(
|
|
342
342
|
Tt,
|
|
343
343
|
{
|
|
344
344
|
visual: n,
|
|
345
345
|
onAddVisual: H,
|
|
346
346
|
onOpenVisual: X,
|
|
347
|
-
onEditDetails:
|
|
347
|
+
onEditDetails: W,
|
|
348
348
|
onDeleteClick: M,
|
|
349
349
|
onDuplicateVisual: B,
|
|
350
350
|
onTogglePrivacy: Z,
|
|
351
351
|
onShareVisual: _,
|
|
352
|
-
isDeleting:
|
|
352
|
+
isDeleting: C,
|
|
353
353
|
isDuplicating: S === n.id,
|
|
354
354
|
formatDate: c
|
|
355
355
|
},
|
|
356
356
|
n.id
|
|
357
357
|
)) }),
|
|
358
358
|
f && i && /* @__PURE__ */ e(
|
|
359
|
-
|
|
359
|
+
ye,
|
|
360
360
|
{
|
|
361
361
|
resource: i,
|
|
362
362
|
resourceType: Se.VISUAL,
|
|
@@ -372,7 +372,7 @@ function At({ searchQuery: t }) {
|
|
|
372
372
|
resourceLabel: "Visual",
|
|
373
373
|
initialTitle: d.title || "",
|
|
374
374
|
initialDescription: d.description || "",
|
|
375
|
-
onClose:
|
|
375
|
+
onClose: b,
|
|
376
376
|
onSave: $,
|
|
377
377
|
isSaving: R(d.id)
|
|
378
378
|
}
|
|
@@ -382,30 +382,30 @@ function At({ searchQuery: t }) {
|
|
|
382
382
|
{
|
|
383
383
|
open: D,
|
|
384
384
|
onOpenChange: (n) => {
|
|
385
|
-
!n &&
|
|
385
|
+
!n && C || (x(n), n || N(null));
|
|
386
386
|
},
|
|
387
387
|
children: /* @__PURE__ */ a(Le, { children: [
|
|
388
388
|
/* @__PURE__ */ a(Te, { children: [
|
|
389
|
-
/* @__PURE__ */ e(
|
|
390
|
-
/* @__PURE__ */ a(
|
|
389
|
+
/* @__PURE__ */ e(Oe, { children: "Delete Visual" }),
|
|
390
|
+
/* @__PURE__ */ a(Ae, { children: [
|
|
391
391
|
'Are you sure you want to delete "',
|
|
392
392
|
m == null ? void 0 : m.title,
|
|
393
393
|
'"? This action cannot be undone.'
|
|
394
394
|
] })
|
|
395
395
|
] }),
|
|
396
396
|
/* @__PURE__ */ a(Pe, { children: [
|
|
397
|
-
/* @__PURE__ */ e(Re, { disabled:
|
|
397
|
+
/* @__PURE__ */ e(Re, { disabled: C, children: "Cancel" }),
|
|
398
398
|
/* @__PURE__ */ a(
|
|
399
|
-
|
|
399
|
+
Ie,
|
|
400
400
|
{
|
|
401
401
|
onClick: (n) => {
|
|
402
402
|
n.preventDefault(), n.stopPropagation(), Q();
|
|
403
403
|
},
|
|
404
404
|
className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
405
|
-
disabled:
|
|
405
|
+
disabled: C,
|
|
406
406
|
children: [
|
|
407
|
-
|
|
408
|
-
|
|
407
|
+
C ? /* @__PURE__ */ e(ie, { className: "mr-2 h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(pe, { className: "mr-2 h-3.5 w-3.5" }),
|
|
408
|
+
C ? "Deleting..." : "Delete"
|
|
409
409
|
]
|
|
410
410
|
}
|
|
411
411
|
)
|
|
@@ -415,7 +415,7 @@ function At({ searchQuery: t }) {
|
|
|
415
415
|
)
|
|
416
416
|
] });
|
|
417
417
|
}
|
|
418
|
-
function
|
|
418
|
+
function At({
|
|
419
419
|
dashboard: t,
|
|
420
420
|
isDeleting: f,
|
|
421
421
|
isDuplicating: p,
|
|
@@ -428,13 +428,13 @@ function Ot({
|
|
|
428
428
|
formatDate: S,
|
|
429
429
|
onDashboardItemClick: l
|
|
430
430
|
}) {
|
|
431
|
-
var P,
|
|
432
|
-
const { selectDashboard: d } = ne(), h = ot(t.id), { userContext: V, isLoading: E } = re(), { mutate: w } = lt(),
|
|
431
|
+
var P, y;
|
|
432
|
+
const { selectDashboard: d } = ne(), h = ot(t.id), { userContext: V, isLoading: E } = re(), { mutate: w } = lt(), v = ((P = V == null ? void 0 : V.permissions) == null ? void 0 : P.canEdit) ?? !1, L = E || !v, T = () => {
|
|
433
433
|
d(t), r(t.id), l == null || l(t.id);
|
|
434
|
-
},
|
|
435
|
-
|
|
434
|
+
}, I = (C) => {
|
|
435
|
+
C.stopPropagation(), w({ dashboardId: i ? null : t.id });
|
|
436
436
|
};
|
|
437
|
-
return /* @__PURE__ */ e(
|
|
437
|
+
return /* @__PURE__ */ e(Ue, { children: /* @__PURE__ */ a(
|
|
438
438
|
"div",
|
|
439
439
|
{
|
|
440
440
|
className: ee(
|
|
@@ -447,7 +447,7 @@ function Ot({
|
|
|
447
447
|
/* @__PURE__ */ e(Me, { asChild: !0, children: /* @__PURE__ */ e(
|
|
448
448
|
"button",
|
|
449
449
|
{
|
|
450
|
-
onClick:
|
|
450
|
+
onClick: I,
|
|
451
451
|
className: "mt-0.5 flex-shrink-0 rounded p-0.5 hover:bg-muted",
|
|
452
452
|
children: /* @__PURE__ */ e(
|
|
453
453
|
dt,
|
|
@@ -477,7 +477,7 @@ function Ot({
|
|
|
477
477
|
{
|
|
478
478
|
className: "truncate text-xs text-muted-foreground",
|
|
479
479
|
title: t.description || "No description",
|
|
480
|
-
children: (
|
|
480
|
+
children: (y = t.description) != null && y.trim() ? t.description : "No description"
|
|
481
481
|
}
|
|
482
482
|
)
|
|
483
483
|
] }),
|
|
@@ -502,64 +502,64 @@ function Ot({
|
|
|
502
502
|
) });
|
|
503
503
|
}
|
|
504
504
|
function Pt({ onRetry: t }) {
|
|
505
|
-
return /* @__PURE__ */ e(
|
|
505
|
+
return /* @__PURE__ */ e(ve, { className: "w-full flex-1 pr-2", children: /* @__PURE__ */ a("div", { className: "py-8 text-center text-muted-foreground", children: [
|
|
506
506
|
/* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: "Failed to load dashboards" }),
|
|
507
|
-
/* @__PURE__ */ e(
|
|
507
|
+
/* @__PURE__ */ e(G, { variant: "outline", size: "sm", className: "mt-2", onClick: t, children: "Retry" })
|
|
508
508
|
] }) });
|
|
509
509
|
}
|
|
510
510
|
function Rt(t) {
|
|
511
511
|
var fe, ge;
|
|
512
512
|
const { searchQuery: f, onLoadDashboard: p, onEditDashboard: i, onDashboardItemClick: r } = t, [D, x] = g(!1), [m, N] = g(
|
|
513
513
|
null
|
|
514
|
-
), [S, l] = g(!1), [d, h] = g(null), [V, E] = g(null), [w,
|
|
514
|
+
), [S, l] = g(!1), [d, h] = g(null), [V, E] = g(null), [w, v] = g(null), L = ae(
|
|
515
515
|
(s) => s.lastSelectedDashboard
|
|
516
516
|
), T = ae(
|
|
517
517
|
(s) => s.selectedDashboard
|
|
518
|
-
),
|
|
518
|
+
), I = ae(
|
|
519
519
|
(s) => s.actions.selectDashboard
|
|
520
520
|
), P = ae(
|
|
521
521
|
(s) => s.actions.clearSelectedDashboard
|
|
522
|
-
), { tokenProps:
|
|
522
|
+
), { tokenProps: y, id: C } = ut();
|
|
523
523
|
ht();
|
|
524
524
|
const {
|
|
525
|
-
resources:
|
|
525
|
+
resources: O,
|
|
526
526
|
isLoading: c,
|
|
527
527
|
isError: M,
|
|
528
528
|
updateResource: Q,
|
|
529
529
|
deleteResource: F,
|
|
530
|
-
duplicateResource:
|
|
530
|
+
duplicateResource: K,
|
|
531
531
|
isDeleting: R
|
|
532
532
|
} = ze(() => {
|
|
533
533
|
l(!1);
|
|
534
534
|
const s = d == null ? void 0 : d.id;
|
|
535
|
-
h(null), (T == null ? void 0 : T.id) === s && (!(
|
|
536
|
-
}), { currentUser: z, userContext: B } = re(), X = ((fe = B == null ? void 0 : B.permissions) == null ? void 0 : fe.canCreateDashboard) ?? !1, { data: H } = mt(), Z = ((ge = H == null ? void 0 : H.preference) == null ? void 0 : ge.defaultDashboardId) || null, _ =
|
|
535
|
+
h(null), (T == null ? void 0 : T.id) === s && (!(y != null && y.dashboard_id) && !C ? P() : L && L.id !== s && I(L));
|
|
536
|
+
}), { currentUser: z, userContext: B } = re(), X = ((fe = B == null ? void 0 : B.permissions) == null ? void 0 : fe.canCreateDashboard) ?? !1, { data: H } = mt(), Z = ((ge = H == null ? void 0 : H.preference) == null ? void 0 : ge.defaultDashboardId) || null, _ = O.filter(
|
|
537
537
|
(s) => {
|
|
538
|
-
var
|
|
539
|
-
return ((
|
|
538
|
+
var U, u;
|
|
539
|
+
return ((U = s == null ? void 0 : s.title) == null ? void 0 : U.toLowerCase().includes(f.toLowerCase())) || ((u = s == null ? void 0 : s.description) == null ? void 0 : u.toLowerCase().includes(f.toLowerCase()));
|
|
540
540
|
}
|
|
541
|
-
),
|
|
541
|
+
), W = (s) => new Date(s).toLocaleDateString("en-US", {
|
|
542
542
|
month: "short",
|
|
543
543
|
day: "numeric",
|
|
544
544
|
year: "numeric"
|
|
545
|
-
}),
|
|
545
|
+
}), b = (s) => {
|
|
546
546
|
p == null || p(s);
|
|
547
547
|
}, $ = (s) => {
|
|
548
548
|
h(s), l(!0);
|
|
549
549
|
}, n = () => {
|
|
550
550
|
d && F(d.id);
|
|
551
|
-
},
|
|
552
|
-
E(s),
|
|
551
|
+
}, A = (s) => {
|
|
552
|
+
E(s), K(s, {
|
|
553
553
|
onSettled: () => E(null)
|
|
554
554
|
});
|
|
555
555
|
}, {
|
|
556
556
|
startUpdating: o,
|
|
557
|
-
stopUpdating:
|
|
557
|
+
stopUpdating: Y,
|
|
558
558
|
isUpdating: te
|
|
559
|
-
} =
|
|
559
|
+
} = Ce(), k = (s, U, u) => {
|
|
560
560
|
var xe;
|
|
561
561
|
const oe = Object.fromEntries(
|
|
562
|
-
Object.entries(
|
|
562
|
+
Object.entries(U).filter(([, q]) => q !== void 0)
|
|
563
563
|
);
|
|
564
564
|
if (Object.keys(oe).length === 0) {
|
|
565
565
|
(xe = u == null ? void 0 : u.onSuccess) == null || xe.call(u);
|
|
@@ -573,41 +573,41 @@ function Rt(t) {
|
|
|
573
573
|
},
|
|
574
574
|
{
|
|
575
575
|
onSuccess: () => {
|
|
576
|
-
var
|
|
577
|
-
|
|
576
|
+
var q;
|
|
577
|
+
Y(s, le), (q = u == null ? void 0 : u.onSuccess) == null || q.call(u);
|
|
578
578
|
},
|
|
579
579
|
onError: () => {
|
|
580
|
-
var
|
|
581
|
-
|
|
580
|
+
var q;
|
|
581
|
+
Y(s, le), (q = u == null ? void 0 : u.onError) == null || q.call(u);
|
|
582
582
|
}
|
|
583
583
|
}
|
|
584
584
|
);
|
|
585
585
|
}, se = (s) => {
|
|
586
|
-
const
|
|
586
|
+
const U = O.find(
|
|
587
587
|
(u) => u.id === s
|
|
588
588
|
);
|
|
589
|
-
|
|
589
|
+
U && Q({
|
|
590
590
|
resourceId: s,
|
|
591
591
|
data: {
|
|
592
|
-
isPrivate: !
|
|
592
|
+
isPrivate: !U.isPrivate
|
|
593
593
|
}
|
|
594
594
|
});
|
|
595
595
|
}, j = (s) => {
|
|
596
596
|
N(s), z == null || z.type, x(!0);
|
|
597
597
|
}, _e = (s) => {
|
|
598
|
-
i == null || i(s.id),
|
|
599
|
-
},
|
|
600
|
-
|
|
601
|
-
},
|
|
598
|
+
i == null || i(s.id), v(s);
|
|
599
|
+
}, qe = () => {
|
|
600
|
+
v(null);
|
|
601
|
+
}, Ge = ({
|
|
602
602
|
title: s,
|
|
603
|
-
description:
|
|
603
|
+
description: U
|
|
604
604
|
}) => {
|
|
605
605
|
if (!w)
|
|
606
606
|
return;
|
|
607
607
|
const u = {};
|
|
608
|
-
s !== w.title && (u.title = s), (w.description || "") !==
|
|
608
|
+
s !== w.title && (u.title = s), (w.description || "") !== U && (u.description = U), k(w.id, u, {
|
|
609
609
|
onSuccess: () => {
|
|
610
|
-
|
|
610
|
+
v(null);
|
|
611
611
|
}
|
|
612
612
|
});
|
|
613
613
|
};
|
|
@@ -617,25 +617,25 @@ function Rt(t) {
|
|
|
617
617
|
/* @__PURE__ */ e("h3", { className: "mb-1 font-medium text-foreground", children: f ? "No dashboards found" : "No dashboards yet" }),
|
|
618
618
|
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: f ? "Try adjusting your search" : X ? 'Click "Create" above to add your first dashboard' : "No dashboards have been shared with you yet" })
|
|
619
619
|
] }) : _.map((s) => /* @__PURE__ */ e(
|
|
620
|
-
|
|
620
|
+
At,
|
|
621
621
|
{
|
|
622
622
|
dashboard: s,
|
|
623
623
|
isDeleting: R,
|
|
624
624
|
isDuplicating: V === s.id,
|
|
625
625
|
isDefault: s.id === Z,
|
|
626
|
-
onLoadDashboard:
|
|
626
|
+
onLoadDashboard: b,
|
|
627
627
|
onEditDetails: _e,
|
|
628
628
|
onDeleteClick: $,
|
|
629
|
-
onDuplicateDashboard:
|
|
629
|
+
onDuplicateDashboard: A,
|
|
630
630
|
onTogglePrivacy: se,
|
|
631
631
|
onShareDashboard: j,
|
|
632
|
-
formatDate:
|
|
632
|
+
formatDate: W,
|
|
633
633
|
onDashboardItemClick: r
|
|
634
634
|
},
|
|
635
635
|
s.id
|
|
636
636
|
)) }),
|
|
637
637
|
D && m && /* @__PURE__ */ e(
|
|
638
|
-
|
|
638
|
+
ye,
|
|
639
639
|
{
|
|
640
640
|
resource: m,
|
|
641
641
|
resourceType: Se.DASHBOARD,
|
|
@@ -653,8 +653,8 @@ function Rt(t) {
|
|
|
653
653
|
},
|
|
654
654
|
children: /* @__PURE__ */ a(Le, { children: [
|
|
655
655
|
/* @__PURE__ */ a(Te, { children: [
|
|
656
|
-
/* @__PURE__ */ e(
|
|
657
|
-
/* @__PURE__ */ a(
|
|
656
|
+
/* @__PURE__ */ e(Oe, { children: "Delete Dashboard" }),
|
|
657
|
+
/* @__PURE__ */ a(Ae, { children: [
|
|
658
658
|
'Are you sure you want to delete "',
|
|
659
659
|
d == null ? void 0 : d.title,
|
|
660
660
|
'"? This action cannot be undone.'
|
|
@@ -663,7 +663,7 @@ function Rt(t) {
|
|
|
663
663
|
/* @__PURE__ */ a(Pe, { children: [
|
|
664
664
|
/* @__PURE__ */ e(Re, { disabled: R, children: "Cancel" }),
|
|
665
665
|
/* @__PURE__ */ a(
|
|
666
|
-
|
|
666
|
+
Ie,
|
|
667
667
|
{
|
|
668
668
|
onClick: (s) => {
|
|
669
669
|
s.preventDefault(), s.stopPropagation(), n();
|
|
@@ -687,14 +687,14 @@ function Rt(t) {
|
|
|
687
687
|
resourceLabel: "Dashboard",
|
|
688
688
|
initialTitle: w.title || "",
|
|
689
689
|
initialDescription: w.description || "",
|
|
690
|
-
onClose:
|
|
691
|
-
onSave:
|
|
690
|
+
onClose: qe,
|
|
691
|
+
onSave: Ge,
|
|
692
692
|
isSaving: te(w.id)
|
|
693
693
|
}
|
|
694
694
|
)
|
|
695
695
|
] });
|
|
696
696
|
}
|
|
697
|
-
function
|
|
697
|
+
function It({
|
|
698
698
|
open: t,
|
|
699
699
|
onOpenChange: f,
|
|
700
700
|
onSubmit: p,
|
|
@@ -747,7 +747,7 @@ function Ut({
|
|
|
747
747
|
] }),
|
|
748
748
|
/* @__PURE__ */ a(wt, { children: [
|
|
749
749
|
/* @__PURE__ */ e(
|
|
750
|
-
|
|
750
|
+
G,
|
|
751
751
|
{
|
|
752
752
|
variant: "outline",
|
|
753
753
|
onClick: () => S(!1),
|
|
@@ -756,7 +756,7 @@ function Ut({
|
|
|
756
756
|
}
|
|
757
757
|
),
|
|
758
758
|
/* @__PURE__ */ e(
|
|
759
|
-
|
|
759
|
+
G,
|
|
760
760
|
{
|
|
761
761
|
onClick: N,
|
|
762
762
|
disabled: !r.trim() || i,
|
|
@@ -776,57 +776,57 @@ function Bt({
|
|
|
776
776
|
onDashboardItemClick: i,
|
|
777
777
|
variant: r = "inline"
|
|
778
778
|
}) {
|
|
779
|
-
var _,
|
|
779
|
+
var _, W;
|
|
780
780
|
const D = de(
|
|
781
|
-
(
|
|
782
|
-
), [x, m] = g(!1), [N, S] = g(""), [l, d] = g(!1), { currentUser: h, userContext: V } = re(), E = ((_ = V == null ? void 0 : V.permissions) == null ? void 0 : _.canCreateDashboard) ?? !1, { onCreateSuccess: w } =
|
|
781
|
+
(b) => b.isDashboardEditing
|
|
782
|
+
), [x, m] = g(!1), [N, S] = g(""), [l, d] = g(!1), { currentUser: h, userContext: V } = re(), E = ((_ = V == null ? void 0 : V.permissions) == null ? void 0 : _.canCreateDashboard) ?? !1, { onCreateSuccess: w } = bt({
|
|
783
783
|
onDashboardSelect: i
|
|
784
|
-
}), { selectVisual:
|
|
784
|
+
}), { selectVisual: v } = ne(), { handleEditLibraryVisual: L } = Be(), {
|
|
785
785
|
createResource: T,
|
|
786
|
-
isCreating:
|
|
786
|
+
isCreating: I,
|
|
787
787
|
refetch: P
|
|
788
|
-
} = ze(), { createResource:
|
|
788
|
+
} = ze(), { createResource: y, isCreating: C } = be(
|
|
789
789
|
void 0,
|
|
790
790
|
// onDeleteSuccess (not needed here)
|
|
791
|
-
(
|
|
792
|
-
m(!1),
|
|
791
|
+
(b) => {
|
|
792
|
+
m(!1), b && (v(b), L(b));
|
|
793
793
|
}
|
|
794
|
-
),
|
|
795
|
-
enabled: t &&
|
|
794
|
+
), O = r === "overlay", c = ((h == null ? void 0 : h.name) ?? "").trim(), M = ((h == null ? void 0 : h.email) ?? "").trim(), F = c && c.toLowerCase() !== "undefined" ? c : M || "Current user", K = ((W = F.charAt(0)) == null ? void 0 : W.toUpperCase()) || "?", R = M && M.toLowerCase() !== "undefined" ? M : "", z = Vt(f, {
|
|
795
|
+
enabled: t && O
|
|
796
796
|
}), B = ee(
|
|
797
797
|
"flex h-full flex-col border-r bg-background",
|
|
798
|
-
|
|
798
|
+
O ? ee(
|
|
799
799
|
"absolute inset-y-0 left-0 z-[51] w-60 shadow-lg transition-transform duration-300 ease-in-out",
|
|
800
800
|
t ? "translate-x-0" : "pointer-events-none -translate-x-full"
|
|
801
801
|
) : "w-full max-w-[17rem] min-w-[11rem] overflow-hidden shadow-sm",
|
|
802
802
|
p
|
|
803
|
-
), X = (
|
|
804
|
-
}, H = (
|
|
805
|
-
console.log("Editing dashboard:",
|
|
806
|
-
}, Z = (
|
|
807
|
-
T(
|
|
803
|
+
), X = (b) => {
|
|
804
|
+
}, H = (b) => {
|
|
805
|
+
console.log("Editing dashboard:", b);
|
|
806
|
+
}, Z = (b) => {
|
|
807
|
+
T(b, {
|
|
808
808
|
onSuccess: ($) => {
|
|
809
809
|
m(!1), w($, P);
|
|
810
810
|
}
|
|
811
811
|
});
|
|
812
812
|
};
|
|
813
|
-
return /* @__PURE__ */ e(me, { children: (!
|
|
813
|
+
return /* @__PURE__ */ e(me, { children: (!O || t) && /* @__PURE__ */ a("div", { ref: z, className: B, children: [
|
|
814
814
|
/* @__PURE__ */ a("div", { className: "border-b border-border", children: [
|
|
815
815
|
/* @__PURE__ */ a("div", { className: "flex items-center justify-between px-4 py-1.5", children: [
|
|
816
816
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e("h2", { className: "whitespace-nowrap text-sm font-semibold", children: D ? "Visuals" : "Dashboards" }) }),
|
|
817
817
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-0", children: [
|
|
818
818
|
/* @__PURE__ */ e(
|
|
819
|
-
|
|
819
|
+
G,
|
|
820
820
|
{
|
|
821
821
|
size: "sm",
|
|
822
822
|
variant: "ghost",
|
|
823
823
|
onClick: () => d(!l),
|
|
824
824
|
className: "h-8 w-8 p-0",
|
|
825
|
-
children: /* @__PURE__ */ e(
|
|
825
|
+
children: /* @__PURE__ */ e(Ct, { className: "h-3.5 w-3.5" })
|
|
826
826
|
}
|
|
827
827
|
),
|
|
828
828
|
(D || E) && /* @__PURE__ */ e(
|
|
829
|
-
|
|
829
|
+
G,
|
|
830
830
|
{
|
|
831
831
|
size: "sm",
|
|
832
832
|
variant: "ghost",
|
|
@@ -842,13 +842,13 @@ function Bt({
|
|
|
842
842
|
{
|
|
843
843
|
placeholder: "Search...",
|
|
844
844
|
value: N,
|
|
845
|
-
onChange: (
|
|
845
|
+
onChange: (b) => S(b.target.value),
|
|
846
846
|
className: "h-8 border-muted-foreground/20 bg-background text-sm focus-visible:border-muted-foreground/40 focus-visible:ring-0 focus-visible:ring-offset-0",
|
|
847
847
|
autoFocus: !0
|
|
848
848
|
}
|
|
849
849
|
) })
|
|
850
850
|
] }),
|
|
851
|
-
/* @__PURE__ */ e("div", { className: "flex flex-1 flex-col overflow-auto px-2 py-2", children: D ? /* @__PURE__ */ e(
|
|
851
|
+
/* @__PURE__ */ e("div", { className: "flex flex-1 flex-col overflow-auto px-2 py-2", children: D ? /* @__PURE__ */ e(Ot, { searchQuery: N }) : /* @__PURE__ */ e(
|
|
852
852
|
Rt,
|
|
853
853
|
{
|
|
854
854
|
searchQuery: N,
|
|
@@ -857,35 +857,35 @@ function Bt({
|
|
|
857
857
|
onDashboardItemClick: i
|
|
858
858
|
}
|
|
859
859
|
) }),
|
|
860
|
-
h && /* @__PURE__ */ e(
|
|
860
|
+
h && /* @__PURE__ */ e(Ue, { children: /* @__PURE__ */ e("div", { className: "border-t border-border px-4 py-2", children: /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
861
861
|
/* @__PURE__ */ a(je, { children: [
|
|
862
|
-
/* @__PURE__ */ e(Me, { asChild: !0, children: /* @__PURE__ */ e("div", { className: "flex h-6 w-6 cursor-default items-center justify-center rounded-full bg-primary/10", children: /* @__PURE__ */ e("span", { className: "text-xs font-medium text-primary", children:
|
|
862
|
+
/* @__PURE__ */ e(Me, { asChild: !0, children: /* @__PURE__ */ e("div", { className: "flex h-6 w-6 cursor-default items-center justify-center rounded-full bg-primary/10", children: /* @__PURE__ */ e("span", { className: "text-xs font-medium text-primary", children: K }) }) }),
|
|
863
863
|
/* @__PURE__ */ e(Fe, { side: "top", className: "max-w-xs", children: /* @__PURE__ */ a("div", { className: "space-y-1", children: [
|
|
864
864
|
/* @__PURE__ */ e("div", { className: "font-medium", children: F }),
|
|
865
865
|
R && /* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground", children: R }),
|
|
866
866
|
h.role && /* @__PURE__ */ a("div", { className: "text-xs text-muted-foreground", children: [
|
|
867
867
|
"Role: ",
|
|
868
|
-
|
|
868
|
+
vt(h.role.replace(/_/g, " "))
|
|
869
869
|
] })
|
|
870
870
|
] }) })
|
|
871
871
|
] }),
|
|
872
872
|
/* @__PURE__ */ e("span", { className: "truncate text-xs text-muted-foreground", children: F })
|
|
873
873
|
] }) }) }),
|
|
874
874
|
D ? /* @__PURE__ */ e(
|
|
875
|
-
|
|
875
|
+
It,
|
|
876
876
|
{
|
|
877
877
|
open: x,
|
|
878
878
|
onOpenChange: m,
|
|
879
|
-
onSubmit:
|
|
880
|
-
isCreating:
|
|
879
|
+
onSubmit: y,
|
|
880
|
+
isCreating: C
|
|
881
881
|
}
|
|
882
882
|
) : /* @__PURE__ */ e(
|
|
883
|
-
|
|
883
|
+
yt,
|
|
884
884
|
{
|
|
885
885
|
open: x,
|
|
886
886
|
onOpenChange: m,
|
|
887
887
|
onSubmit: Z,
|
|
888
|
-
isCreating:
|
|
888
|
+
isCreating: I
|
|
889
889
|
}
|
|
890
890
|
)
|
|
891
891
|
] }) });
|