react-semaphor 0.1.179 → 0.1.180
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-CeT5saB7.js → dashboard-controls-Baw7eUyM.js} +3 -3
- package/dist/chunks/{dashboard-controls-O2Vl2SaH.js → dashboard-controls-CS3pAVZi.js} +339 -337
- package/dist/chunks/{dashboard-json--jGkpREU.js → dashboard-json-ClalWYi4.js} +1 -1
- package/dist/chunks/{dashboard-json-d1qZ8OYo.js → dashboard-json-Cz4bNnCC.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-ViDNkE8Q.js → edit-dashboard-visual-BMElXt-n.js} +30 -35
- package/dist/chunks/{edit-dashboard-visual-BsP87bZV.js → edit-dashboard-visual-DFJ5FJ7y.js} +11 -22
- package/dist/chunks/editor-action-buttons-DVWnnC_r.js +11 -0
- package/dist/chunks/{editor-action-buttons-F4_UU-Mk.js → editor-action-buttons-MtNYw1Bb.js} +57 -45
- package/dist/chunks/{index-v6ayK5K2.js → index-CAeKp6K8.js} +22589 -22037
- package/dist/chunks/{index-CFWw2cJ5.js → index-CfPKTeUk.js} +232 -227
- package/dist/chunks/notification-bell-2dZI5OV0.js +21 -0
- package/dist/chunks/notification-bell-YZ8VqdwA.js +870 -0
- package/dist/chunks/{resource-management-panel-Cn1aOr6L.js → resource-management-panel-Buhi-kvP.js} +1 -1
- package/dist/chunks/{resource-management-panel-CApVr9Vd.js → resource-management-panel-pxL28GXq.js} +133 -133
- package/dist/chunks/{use-role-aware-display-preferences-C-N0-Iik.js → use-role-aware-display-preferences-B_i2f9tn.js} +1 -1
- package/dist/chunks/{use-role-aware-display-preferences-Bxp6i8c7.js → use-role-aware-display-preferences-JljRcjrP.js} +1 -1
- package/dist/chunks/{use-visual-utils-D9lMGeVv.js → use-visual-utils-D3HjbsKO.js} +38 -38
- package/dist/chunks/{use-visual-utils-D19qzwzI.js → use-visual-utils-DPEHcmFT.js} +1 -1
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -6
- package/dist/index.js +133 -126
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +1 -1
- package/dist/types/main.d.ts +262 -0
- package/package.json +1 -1
- package/dist/chunks/editor-action-buttons-DseT424l.js +0 -6
- package/dist/chunks/schedule-dashboard-B4KUKLfW.js +0 -416
- package/dist/chunks/schedule-dashboard-vvFw8B1E.js +0 -6
package/dist/chunks/{resource-management-panel-CApVr9Vd.js → resource-management-panel-pxL28GXq.js}
RENAMED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsx as e, jsxs as a, Fragment as ge } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { aF as Ze, u as me, au as $e, aO as re, aS as Je, aT as Qe, c as J, aU as ke, aV as et, aW as tt, B as _, aX as st, aY as at, aZ as W, a_ as pe, aG as oe, a$ as nt, b0 as it, b1 as rt, b2 as ve, b3 as De, b4 as ot, b5 as lt, I as dt, b6 as ye, e as le, b7 as Se, b8 as Ee, b9 as ct, L as Ve, R as Le, ba as Ae, bb as Te, bc as Oe, bd as Re, be as Pe, bf as Ue, bg as Ie, bh as je, bi as Fe, bj as ut, bk as ht, bl as Me, bm as ze, bn as Be, bo as mt, bp as He, bq as pt, A as ne, aN as ft, br as _e, bs as gt, bt as Dt, bu as xt, bv as bt, bw as Nt, bx as wt, by as vt, bz as Ce, bA as fe, bB as Ct, bC as yt, bD as St, bE as Et, bF as Vt } from "./index-CAeKp6K8.js";
|
|
3
3
|
import Lt, { useRef as At, useEffect as ie, useState as x } from "react";
|
|
4
|
-
import { a as
|
|
5
|
-
import { u as Tt } from "./use-role-aware-display-preferences-
|
|
4
|
+
import { a as Ge } from "./use-visual-utils-D3HjbsKO.js";
|
|
5
|
+
import { u as Tt } from "./use-role-aware-display-preferences-B_i2f9tn.js";
|
|
6
6
|
/**
|
|
7
7
|
* @license lucide-react v0.453.0 - ISC
|
|
8
8
|
*
|
|
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 Ot =
|
|
12
|
+
const Ot = Ze("FolderOpen", [
|
|
13
13
|
[
|
|
14
14
|
"path",
|
|
15
15
|
{
|
|
@@ -30,7 +30,7 @@ function Rt(t, f = {}) {
|
|
|
30
30
|
};
|
|
31
31
|
}, [t, h, r]), o;
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function Ke() {
|
|
34
34
|
return /* @__PURE__ */ e("div", { className: "space-y-1 px-2 py-2", children: [...Array(5)].map((t, f) => /* @__PURE__ */ a(
|
|
35
35
|
"div",
|
|
36
36
|
{
|
|
@@ -47,7 +47,7 @@ function Ge() {
|
|
|
47
47
|
)) });
|
|
48
48
|
}
|
|
49
49
|
const Pt = (t) => {
|
|
50
|
-
const f = me((o) => o.isVisualEditing), h = me((o) => o.selectedFrameId), r =
|
|
50
|
+
const f = me((o) => o.isVisualEditing), h = me((o) => o.selectedFrameId), r = $e((o) => o.frame);
|
|
51
51
|
return !!(f && h && (r == null ? void 0 : r.visualId) === t);
|
|
52
52
|
};
|
|
53
53
|
function Ut({
|
|
@@ -60,15 +60,15 @@ function Ut({
|
|
|
60
60
|
onDeleteClick: D,
|
|
61
61
|
onDuplicateVisual: i,
|
|
62
62
|
// onTogglePrivacy,
|
|
63
|
-
onShareVisual:
|
|
63
|
+
onShareVisual: b,
|
|
64
64
|
formatDate: y
|
|
65
65
|
}) {
|
|
66
66
|
var T, S, P, v;
|
|
67
|
-
const { selectVisual: d } = re(), c =
|
|
67
|
+
const { selectVisual: d } = re(), c = Je(t.id), m = Pt(t.id), { isConsoleMode: E } = Qe(), V = Lt.useRef(null), [w, C] = x(!1), [L, A] = x(!1);
|
|
68
68
|
ie(() => {
|
|
69
69
|
h ? (C(!0), A(!0)) : L && (C(!1), A(!1));
|
|
70
70
|
}, [h, L]), ie(() => {
|
|
71
|
-
m &&
|
|
71
|
+
m && V.current && V.current.scrollIntoView({
|
|
72
72
|
behavior: "smooth",
|
|
73
73
|
block: "center"
|
|
74
74
|
});
|
|
@@ -79,8 +79,8 @@ function Ut({
|
|
|
79
79
|
return /* @__PURE__ */ a(
|
|
80
80
|
"div",
|
|
81
81
|
{
|
|
82
|
-
ref:
|
|
83
|
-
className:
|
|
82
|
+
ref: V,
|
|
83
|
+
className: J(
|
|
84
84
|
"group flex cursor-pointer items-start gap-3 rounded-md px-2 py-2 transition-colors hover:bg-muted",
|
|
85
85
|
m ? "bg-purple-500/10" : c && "bg-muted/80"
|
|
86
86
|
),
|
|
@@ -175,7 +175,7 @@ function Ut({
|
|
|
175
175
|
W,
|
|
176
176
|
{
|
|
177
177
|
onClick: (p) => {
|
|
178
|
-
p.stopPropagation(),
|
|
178
|
+
p.stopPropagation(), b(t);
|
|
179
179
|
},
|
|
180
180
|
children: [
|
|
181
181
|
/* @__PURE__ */ e(rt, { className: "mr-2 h-3 w-3" }),
|
|
@@ -201,7 +201,7 @@ function Ut({
|
|
|
201
201
|
] }),
|
|
202
202
|
/* @__PURE__ */ e(ve, {}),
|
|
203
203
|
/* @__PURE__ */ a("div", { className: "space-y-1 px-2 py-2 text-xs text-slate-500 dark:text-slate-400", children: [
|
|
204
|
-
(((S = t.ownership.createdBy) == null ? void 0 : S.type) === "tenant" || ((P = t.ownership.createdBy) == null ? void 0 : P.type) === "organization" &&
|
|
204
|
+
(((S = t.ownership.createdBy) == null ? void 0 : S.type) === "tenant" || ((P = t.ownership.createdBy) == null ? void 0 : P.type) === "organization" && E) && /* @__PURE__ */ a("div", { className: "flex items-center gap-1", children: [
|
|
205
205
|
/* @__PURE__ */ e(ot, { className: "h-3 w-3" }),
|
|
206
206
|
/* @__PURE__ */ e("span", { children: ((v = t.ownership.createdBy) == null ? void 0 : v.name) || "Unknown" })
|
|
207
207
|
] }),
|
|
@@ -241,9 +241,9 @@ function Ut({
|
|
|
241
241
|
function It({ searchQuery: t }) {
|
|
242
242
|
const [f, h] = x(!1), [r, o] = x(
|
|
243
243
|
null
|
|
244
|
-
), [g, D] = x(!1), [i,
|
|
244
|
+
), [g, D] = x(!1), [i, b] = x(null), [y, d] = x(null), [c, m] = x(
|
|
245
245
|
null
|
|
246
|
-
), { selectVisual:
|
|
246
|
+
), { selectVisual: E } = re(), { handleEditLibraryVisual: V, handleAddLibraryVisual: w } = Ge(), {
|
|
247
247
|
resources: C,
|
|
248
248
|
isLoading: L,
|
|
249
249
|
isError: A,
|
|
@@ -253,23 +253,23 @@ function It({ searchQuery: t }) {
|
|
|
253
253
|
duplicateResource: P,
|
|
254
254
|
isDeleting: v,
|
|
255
255
|
isDuplicating: p,
|
|
256
|
-
isUpdating:
|
|
256
|
+
isUpdating: z
|
|
257
257
|
} = ye(() => {
|
|
258
|
-
D(!1),
|
|
258
|
+
D(!1), b(null);
|
|
259
259
|
});
|
|
260
260
|
le();
|
|
261
|
-
const
|
|
261
|
+
const Q = C.filter(
|
|
262
262
|
(n) => {
|
|
263
263
|
var O, l;
|
|
264
264
|
return ((O = n == null ? void 0 : n.title) == null ? void 0 : O.toLowerCase().includes(t.toLowerCase())) || ((l = n == null ? void 0 : n.description) == null ? void 0 : l.toLowerCase().includes(t.toLowerCase()));
|
|
265
265
|
}
|
|
266
|
-
),
|
|
266
|
+
), F = (n) => new Date(n).toLocaleDateString("en-US", {
|
|
267
267
|
month: "short",
|
|
268
268
|
day: "numeric",
|
|
269
269
|
year: "numeric"
|
|
270
|
-
}),
|
|
271
|
-
|
|
272
|
-
},
|
|
270
|
+
}), Y = (n) => {
|
|
271
|
+
b(n), D(!0);
|
|
272
|
+
}, G = () => {
|
|
273
273
|
i && S(i.id);
|
|
274
274
|
}, {
|
|
275
275
|
startUpdating: k,
|
|
@@ -277,39 +277,39 @@ function It({ searchQuery: t }) {
|
|
|
277
277
|
isUpdating: ee
|
|
278
278
|
} = Se(), te = (n, O, l) => {
|
|
279
279
|
var ae;
|
|
280
|
-
const
|
|
280
|
+
const X = Object.fromEntries(
|
|
281
281
|
Object.entries(O).filter(([, I]) => I !== void 0)
|
|
282
282
|
);
|
|
283
|
-
if (Object.keys(
|
|
283
|
+
if (Object.keys(X).length === 0) {
|
|
284
284
|
(ae = l == null ? void 0 : l.onSuccess) == null || ae.call(l);
|
|
285
285
|
return;
|
|
286
286
|
}
|
|
287
|
-
const
|
|
288
|
-
k(n,
|
|
287
|
+
const Z = Object.keys(X), $ = Z.length === 1 ? Z[0] : void 0;
|
|
288
|
+
k(n, $), T(
|
|
289
289
|
{
|
|
290
290
|
resourceId: n,
|
|
291
|
-
data:
|
|
291
|
+
data: X
|
|
292
292
|
},
|
|
293
293
|
{
|
|
294
294
|
onSuccess: () => {
|
|
295
295
|
var I;
|
|
296
|
-
R(n,
|
|
296
|
+
R(n, $), (I = l == null ? void 0 : l.onSuccess) == null || I.call(l);
|
|
297
297
|
},
|
|
298
298
|
onError: () => {
|
|
299
299
|
var I;
|
|
300
|
-
R(n,
|
|
300
|
+
R(n, $), (I = l == null ? void 0 : l.onError) == null || I.call(l);
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
303
|
);
|
|
304
|
-
},
|
|
304
|
+
}, B = (n) => {
|
|
305
305
|
d(n), P(n, {
|
|
306
306
|
onSettled: () => d(null)
|
|
307
307
|
});
|
|
308
|
-
},
|
|
309
|
-
|
|
310
|
-
},
|
|
308
|
+
}, M = (n) => {
|
|
309
|
+
V(n);
|
|
310
|
+
}, K = (n) => {
|
|
311
311
|
w(n);
|
|
312
|
-
},
|
|
312
|
+
}, N = (n) => {
|
|
313
313
|
const O = C.find((l) => l.id === n);
|
|
314
314
|
O && T({
|
|
315
315
|
resourceId: n,
|
|
@@ -317,7 +317,7 @@ function It({ searchQuery: t }) {
|
|
|
317
317
|
isPrivate: !O.isPrivate
|
|
318
318
|
}
|
|
319
319
|
});
|
|
320
|
-
},
|
|
320
|
+
}, q = (n) => {
|
|
321
321
|
o(n), h(!0);
|
|
322
322
|
}, se = (n) => {
|
|
323
323
|
m(n);
|
|
@@ -336,7 +336,7 @@ function It({ searchQuery: t }) {
|
|
|
336
336
|
}
|
|
337
337
|
});
|
|
338
338
|
};
|
|
339
|
-
return L ? /* @__PURE__ */ e(
|
|
339
|
+
return L ? /* @__PURE__ */ e(Ke, {}) : A ? /* @__PURE__ */ e(Ee, { className: "w-full flex-1 pr-2", children: /* @__PURE__ */ a("div", { className: "py-8 text-center text-muted-foreground", children: [
|
|
340
340
|
/* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: "Failed to load visuals" }),
|
|
341
341
|
/* @__PURE__ */ e(
|
|
342
342
|
_,
|
|
@@ -349,29 +349,29 @@ function It({ searchQuery: t }) {
|
|
|
349
349
|
}
|
|
350
350
|
)
|
|
351
351
|
] }) }) : /* @__PURE__ */ a("div", { className: "flex h-full flex-1 flex-col", children: [
|
|
352
|
-
/* @__PURE__ */ e("div", { className: "flex flex-1 basis-0 flex-col gap-3 overflow-y-auto", children:
|
|
352
|
+
/* @__PURE__ */ e("div", { className: "flex flex-1 basis-0 flex-col gap-3 overflow-y-auto", children: Q.length === 0 ? /* @__PURE__ */ a("div", { className: "py-8 text-center", children: [
|
|
353
353
|
/* @__PURE__ */ e("div", { className: "mb-3", children: /* @__PURE__ */ e(ct, { className: "mx-auto h-12 w-12 text-muted-foreground/50" }) }),
|
|
354
354
|
/* @__PURE__ */ e("h3", { className: "mb-1 font-medium text-foreground", children: t ? "No visuals found" : "No visuals yet" }),
|
|
355
355
|
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: t ? "Try adjusting your search" : 'Click "Create" above to add your first visual' })
|
|
356
|
-
] }) :
|
|
356
|
+
] }) : Q.map((n) => /* @__PURE__ */ e(
|
|
357
357
|
Ut,
|
|
358
358
|
{
|
|
359
359
|
visual: n,
|
|
360
|
-
onAddVisual:
|
|
361
|
-
onOpenVisual:
|
|
360
|
+
onAddVisual: K,
|
|
361
|
+
onOpenVisual: M,
|
|
362
362
|
onEditDetails: se,
|
|
363
|
-
onDeleteClick:
|
|
364
|
-
onDuplicateVisual:
|
|
365
|
-
onTogglePrivacy:
|
|
366
|
-
onShareVisual:
|
|
363
|
+
onDeleteClick: Y,
|
|
364
|
+
onDuplicateVisual: B,
|
|
365
|
+
onTogglePrivacy: N,
|
|
366
|
+
onShareVisual: q,
|
|
367
367
|
isDeleting: v,
|
|
368
368
|
isDuplicating: y === n.id,
|
|
369
|
-
formatDate:
|
|
369
|
+
formatDate: F
|
|
370
370
|
},
|
|
371
371
|
n.id
|
|
372
372
|
)) }),
|
|
373
373
|
f && r && /* @__PURE__ */ e(
|
|
374
|
-
|
|
374
|
+
Ve,
|
|
375
375
|
{
|
|
376
376
|
resource: r,
|
|
377
377
|
resourceType: Le.VISUAL,
|
|
@@ -397,7 +397,7 @@ function It({ searchQuery: t }) {
|
|
|
397
397
|
{
|
|
398
398
|
open: g,
|
|
399
399
|
onOpenChange: (n) => {
|
|
400
|
-
!n && v || (D(n), n ||
|
|
400
|
+
!n && v || (D(n), n || b(null));
|
|
401
401
|
},
|
|
402
402
|
children: /* @__PURE__ */ a(Oe, { children: [
|
|
403
403
|
/* @__PURE__ */ a(Re, { children: [
|
|
@@ -411,10 +411,10 @@ function It({ searchQuery: t }) {
|
|
|
411
411
|
/* @__PURE__ */ a(Ie, { children: [
|
|
412
412
|
/* @__PURE__ */ e(je, { disabled: v, children: "Cancel" }),
|
|
413
413
|
/* @__PURE__ */ a(
|
|
414
|
-
|
|
414
|
+
Fe,
|
|
415
415
|
{
|
|
416
416
|
onClick: (n) => {
|
|
417
|
-
n.preventDefault(), n.stopPropagation(),
|
|
417
|
+
n.preventDefault(), n.stopPropagation(), G();
|
|
418
418
|
},
|
|
419
419
|
className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
420
420
|
disabled: v,
|
|
@@ -439,27 +439,27 @@ function jt({
|
|
|
439
439
|
onEditDetails: g,
|
|
440
440
|
onDeleteClick: D,
|
|
441
441
|
onDuplicateDashboard: i,
|
|
442
|
-
onShareDashboard:
|
|
442
|
+
onShareDashboard: b,
|
|
443
443
|
formatDate: y,
|
|
444
444
|
onDashboardItemClick: d
|
|
445
445
|
}) {
|
|
446
446
|
var T, S;
|
|
447
|
-
const { selectDashboard: c } = re(), m = ut(t.id), { userContext:
|
|
447
|
+
const { selectDashboard: c } = re(), m = ut(t.id), { userContext: E, isLoading: V } = le(), { mutate: w } = ht(), C = ((T = E == null ? void 0 : E.permissions) == null ? void 0 : T.canEdit) ?? !1, L = V || !C, A = () => {
|
|
448
448
|
c(t), o(t.id), d == null || d(t.id);
|
|
449
449
|
}, j = (P) => {
|
|
450
450
|
P.stopPropagation(), w({ dashboardId: r ? null : t.id });
|
|
451
451
|
};
|
|
452
|
-
return /* @__PURE__ */ e(
|
|
452
|
+
return /* @__PURE__ */ e(Me, { children: /* @__PURE__ */ a(
|
|
453
453
|
"div",
|
|
454
454
|
{
|
|
455
|
-
className:
|
|
455
|
+
className: J(
|
|
456
456
|
"group flex cursor-pointer items-start gap-3 rounded-md px-2 py-2 transition-colors hover:bg-muted",
|
|
457
457
|
m && "bg-muted/80"
|
|
458
458
|
),
|
|
459
459
|
onClick: A,
|
|
460
460
|
children: [
|
|
461
|
-
/* @__PURE__ */ a(
|
|
462
|
-
/* @__PURE__ */ e(
|
|
461
|
+
/* @__PURE__ */ a(ze, { children: [
|
|
462
|
+
/* @__PURE__ */ e(Be, { asChild: !0, children: /* @__PURE__ */ e(
|
|
463
463
|
"button",
|
|
464
464
|
{
|
|
465
465
|
onClick: j,
|
|
@@ -467,7 +467,7 @@ function jt({
|
|
|
467
467
|
children: /* @__PURE__ */ e(
|
|
468
468
|
mt,
|
|
469
469
|
{
|
|
470
|
-
className:
|
|
470
|
+
className: J(
|
|
471
471
|
"h-4 w-4 transition-colors",
|
|
472
472
|
r ? "fill-yellow-400 text-yellow-400" : "text-muted-foreground/40 hover:text-yellow-400"
|
|
473
473
|
)
|
|
@@ -506,7 +506,7 @@ function jt({
|
|
|
506
506
|
onEditDetails: g,
|
|
507
507
|
onDeleteClick: D,
|
|
508
508
|
onDuplicateDashboard: i,
|
|
509
|
-
onShareDashboard:
|
|
509
|
+
onShareDashboard: b,
|
|
510
510
|
formatDate: y
|
|
511
511
|
}
|
|
512
512
|
) })
|
|
@@ -516,17 +516,17 @@ function jt({
|
|
|
516
516
|
t.id
|
|
517
517
|
) });
|
|
518
518
|
}
|
|
519
|
-
function
|
|
520
|
-
return /* @__PURE__ */ e(
|
|
519
|
+
function Ft({ onRetry: t }) {
|
|
520
|
+
return /* @__PURE__ */ e(Ee, { className: "w-full flex-1 pr-2", children: /* @__PURE__ */ a("div", { className: "py-8 text-center text-muted-foreground", children: [
|
|
521
521
|
/* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: "Failed to load dashboards" }),
|
|
522
522
|
/* @__PURE__ */ e(_, { variant: "outline", size: "sm", className: "mt-2", onClick: t, children: "Retry" })
|
|
523
523
|
] }) });
|
|
524
524
|
}
|
|
525
|
-
function
|
|
526
|
-
var xe,
|
|
527
|
-
const { searchQuery: f, onLoadDashboard: h, onEditDashboard: r, onDashboardItemClick: o } = t, [g, D] = x(!1), [i,
|
|
525
|
+
function Mt(t) {
|
|
526
|
+
var xe, be;
|
|
527
|
+
const { searchQuery: f, onLoadDashboard: h, onEditDashboard: r, onDashboardItemClick: o } = t, [g, D] = x(!1), [i, b] = x(
|
|
528
528
|
null
|
|
529
|
-
), [y, d] = x(!1), [c, m] = x(null), [
|
|
529
|
+
), [y, d] = x(!1), [c, m] = x(null), [E, V] = x(null), [w, C] = x(null), L = ne(
|
|
530
530
|
(s) => s.lastSelectedDashboard
|
|
531
531
|
), A = ne(
|
|
532
532
|
(s) => s.selectedDashboard
|
|
@@ -539,11 +539,11 @@ function Ft(t) {
|
|
|
539
539
|
const {
|
|
540
540
|
resources: v,
|
|
541
541
|
isLoading: p,
|
|
542
|
-
isError:
|
|
543
|
-
isFetching:
|
|
544
|
-
updateResource:
|
|
545
|
-
deleteResource:
|
|
546
|
-
duplicateResource:
|
|
542
|
+
isError: z,
|
|
543
|
+
isFetching: Q,
|
|
544
|
+
updateResource: F,
|
|
545
|
+
deleteResource: Y,
|
|
546
|
+
duplicateResource: G,
|
|
547
547
|
isUpdating: k,
|
|
548
548
|
isDeleting: R,
|
|
549
549
|
isDuplicating: ee,
|
|
@@ -552,7 +552,7 @@ function Ft(t) {
|
|
|
552
552
|
d(!1);
|
|
553
553
|
const s = c == null ? void 0 : c.id;
|
|
554
554
|
m(null), (A == null ? void 0 : A.id) === s && (!(S != null && S.dashboard_id) && !P ? T() : L && L.id !== s && j(L));
|
|
555
|
-
}), { currentUser:
|
|
555
|
+
}), { currentUser: B, userContext: M } = le(), K = ((xe = M == null ? void 0 : M.permissions) == null ? void 0 : xe.canCreateDashboard) ?? !1, { data: N } = gt(), q = ((be = N == null ? void 0 : N.preference) == null ? void 0 : be.defaultDashboardId) || null, se = v.filter(
|
|
556
556
|
(s) => {
|
|
557
557
|
var U, u;
|
|
558
558
|
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()));
|
|
@@ -566,15 +566,15 @@ function Ft(t) {
|
|
|
566
566
|
}, n = (s) => {
|
|
567
567
|
m(s), d(!0);
|
|
568
568
|
}, O = () => {
|
|
569
|
-
c &&
|
|
569
|
+
c && Y(c.id);
|
|
570
570
|
}, l = (s) => {
|
|
571
|
-
|
|
572
|
-
onSettled: () =>
|
|
571
|
+
V(s), G(s, {
|
|
572
|
+
onSettled: () => V(null)
|
|
573
573
|
});
|
|
574
574
|
}, {
|
|
575
|
-
startUpdating:
|
|
576
|
-
stopUpdating:
|
|
577
|
-
isUpdating:
|
|
575
|
+
startUpdating: X,
|
|
576
|
+
stopUpdating: Z,
|
|
577
|
+
isUpdating: $
|
|
578
578
|
} = Se(), ae = (s, U, u) => {
|
|
579
579
|
var we;
|
|
580
580
|
const ue = Object.fromEntries(
|
|
@@ -584,8 +584,8 @@ function Ft(t) {
|
|
|
584
584
|
(we = u == null ? void 0 : u.onSuccess) == null || we.call(u);
|
|
585
585
|
return;
|
|
586
586
|
}
|
|
587
|
-
const
|
|
588
|
-
|
|
587
|
+
const Ne = Object.keys(ue), he = Ne.length === 1 ? Ne[0] : void 0;
|
|
588
|
+
X(s, he), F(
|
|
589
589
|
{
|
|
590
590
|
resourceId: s,
|
|
591
591
|
data: ue
|
|
@@ -593,11 +593,11 @@ function Ft(t) {
|
|
|
593
593
|
{
|
|
594
594
|
onSuccess: () => {
|
|
595
595
|
var H;
|
|
596
|
-
|
|
596
|
+
Z(s, he), (H = u == null ? void 0 : u.onSuccess) == null || H.call(u);
|
|
597
597
|
},
|
|
598
598
|
onError: () => {
|
|
599
599
|
var H;
|
|
600
|
-
|
|
600
|
+
Z(s, he), (H = u == null ? void 0 : u.onError) == null || H.call(u);
|
|
601
601
|
}
|
|
602
602
|
}
|
|
603
603
|
);
|
|
@@ -605,19 +605,19 @@ function Ft(t) {
|
|
|
605
605
|
const U = v.find(
|
|
606
606
|
(u) => u.id === s
|
|
607
607
|
);
|
|
608
|
-
U &&
|
|
608
|
+
U && F({
|
|
609
609
|
resourceId: s,
|
|
610
610
|
data: {
|
|
611
611
|
isPrivate: !U.isPrivate
|
|
612
612
|
}
|
|
613
613
|
});
|
|
614
614
|
}, We = (s) => {
|
|
615
|
-
|
|
616
|
-
},
|
|
615
|
+
b(s), B == null || B.type, D(!0);
|
|
616
|
+
}, Ye = (s) => {
|
|
617
617
|
r == null || r(s.id), C(s);
|
|
618
|
-
},
|
|
618
|
+
}, qe = () => {
|
|
619
619
|
C(null);
|
|
620
|
-
},
|
|
620
|
+
}, Xe = ({
|
|
621
621
|
title: s,
|
|
622
622
|
description: U
|
|
623
623
|
}) => {
|
|
@@ -630,20 +630,20 @@ function Ft(t) {
|
|
|
630
630
|
}
|
|
631
631
|
});
|
|
632
632
|
};
|
|
633
|
-
return p ? /* @__PURE__ */ e(
|
|
633
|
+
return p ? /* @__PURE__ */ e(Ke, {}) : z ? /* @__PURE__ */ e(Ft, { onRetry: () => window.location.reload() }) : /* @__PURE__ */ a("div", { className: "flex h-full flex-1 flex-col", children: [
|
|
634
634
|
/* @__PURE__ */ e("div", { className: "flex flex-1 basis-0 flex-col gap-3 overflow-y-auto", children: se.length === 0 ? /* @__PURE__ */ a("div", { className: "py-8 text-center", children: [
|
|
635
635
|
/* @__PURE__ */ e("div", { className: "mb-3", children: /* @__PURE__ */ e(Dt, { className: "mx-auto h-12 w-12 text-muted-foreground/50" }) }),
|
|
636
636
|
/* @__PURE__ */ e("h3", { className: "mb-1 font-medium text-foreground", children: f ? "No dashboards found" : "No dashboards yet" }),
|
|
637
|
-
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: f ? "Try adjusting your search" :
|
|
637
|
+
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: f ? "Try adjusting your search" : K ? 'Click "Create" above to add your first dashboard' : "No dashboards have been shared with you yet" })
|
|
638
638
|
] }) : se.map((s) => /* @__PURE__ */ e(
|
|
639
639
|
jt,
|
|
640
640
|
{
|
|
641
641
|
dashboard: s,
|
|
642
642
|
isDeleting: R,
|
|
643
|
-
isDuplicating:
|
|
644
|
-
isDefault: s.id ===
|
|
643
|
+
isDuplicating: E === s.id,
|
|
644
|
+
isDefault: s.id === q,
|
|
645
645
|
onLoadDashboard: ce,
|
|
646
|
-
onEditDetails:
|
|
646
|
+
onEditDetails: Ye,
|
|
647
647
|
onDeleteClick: n,
|
|
648
648
|
onDuplicateDashboard: l,
|
|
649
649
|
onTogglePrivacy: I,
|
|
@@ -654,12 +654,12 @@ function Ft(t) {
|
|
|
654
654
|
s.id
|
|
655
655
|
)) }),
|
|
656
656
|
g && i && /* @__PURE__ */ e(
|
|
657
|
-
|
|
657
|
+
Ve,
|
|
658
658
|
{
|
|
659
659
|
resource: i,
|
|
660
660
|
resourceType: Le.DASHBOARD,
|
|
661
661
|
onClose: () => {
|
|
662
|
-
D(!1),
|
|
662
|
+
D(!1), b(null);
|
|
663
663
|
}
|
|
664
664
|
}
|
|
665
665
|
),
|
|
@@ -682,7 +682,7 @@ function Ft(t) {
|
|
|
682
682
|
/* @__PURE__ */ a(Ie, { children: [
|
|
683
683
|
/* @__PURE__ */ e(je, { disabled: R, children: "Cancel" }),
|
|
684
684
|
/* @__PURE__ */ a(
|
|
685
|
-
|
|
685
|
+
Fe,
|
|
686
686
|
{
|
|
687
687
|
onClick: (s) => {
|
|
688
688
|
s.preventDefault(), s.stopPropagation(), O();
|
|
@@ -706,14 +706,14 @@ function Ft(t) {
|
|
|
706
706
|
resourceLabel: "Dashboard",
|
|
707
707
|
initialTitle: w.title || "",
|
|
708
708
|
initialDescription: w.description || "",
|
|
709
|
-
onClose:
|
|
710
|
-
onSave:
|
|
711
|
-
isSaving:
|
|
709
|
+
onClose: qe,
|
|
710
|
+
onSave: Xe,
|
|
711
|
+
isSaving: $(w.id)
|
|
712
712
|
}
|
|
713
713
|
)
|
|
714
714
|
] });
|
|
715
715
|
}
|
|
716
|
-
function
|
|
716
|
+
function zt({
|
|
717
717
|
open: t,
|
|
718
718
|
onOpenChange: f,
|
|
719
719
|
onSubmit: h,
|
|
@@ -723,13 +723,13 @@ function Bt({
|
|
|
723
723
|
ie(() => {
|
|
724
724
|
t || (g(""), i(""));
|
|
725
725
|
}, [t]);
|
|
726
|
-
const
|
|
726
|
+
const b = () => {
|
|
727
727
|
o.trim() && h({ title: o, description: D });
|
|
728
728
|
}, y = (d) => {
|
|
729
729
|
f(d);
|
|
730
730
|
};
|
|
731
|
-
return /* @__PURE__ */ e(xt, { open: t, onOpenChange: y, children: /* @__PURE__ */ a(
|
|
732
|
-
/* @__PURE__ */ a(
|
|
731
|
+
return /* @__PURE__ */ e(xt, { open: t, onOpenChange: y, children: /* @__PURE__ */ a(bt, { children: [
|
|
732
|
+
/* @__PURE__ */ a(Nt, { children: [
|
|
733
733
|
/* @__PURE__ */ e(wt, { children: "Create New Visual" }),
|
|
734
734
|
/* @__PURE__ */ e(vt, { children: "Add a new visual to your library. You can configure it after creation." })
|
|
735
735
|
] }),
|
|
@@ -745,7 +745,7 @@ function Bt({
|
|
|
745
745
|
onChange: (d) => g(d.target.value),
|
|
746
746
|
disabled: r,
|
|
747
747
|
onKeyDown: (d) => {
|
|
748
|
-
d.key === "Enter" && !d.shiftKey && (d.preventDefault(),
|
|
748
|
+
d.key === "Enter" && !d.shiftKey && (d.preventDefault(), b());
|
|
749
749
|
}
|
|
750
750
|
}
|
|
751
751
|
)
|
|
@@ -777,7 +777,7 @@ function Bt({
|
|
|
777
777
|
/* @__PURE__ */ e(
|
|
778
778
|
_,
|
|
779
779
|
{
|
|
780
|
-
onClick:
|
|
780
|
+
onClick: b,
|
|
781
781
|
disabled: !o.trim() || r,
|
|
782
782
|
children: r ? /* @__PURE__ */ a(ge, { children: [
|
|
783
783
|
/* @__PURE__ */ e(oe, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
@@ -795,37 +795,37 @@ function Wt({
|
|
|
795
795
|
onDashboardItemClick: r,
|
|
796
796
|
variant: o = "inline"
|
|
797
797
|
}) {
|
|
798
|
-
var
|
|
798
|
+
var M, K;
|
|
799
799
|
const g = me(
|
|
800
|
-
(
|
|
801
|
-
), [D, i] = x(!1), [
|
|
800
|
+
(N) => N.isDashboardEditing
|
|
801
|
+
), [D, i] = x(!1), [b, y] = x(""), [d, c] = x(!1), { currentUser: m, userContext: E } = le(), V = ((M = E == null ? void 0 : E.permissions) == null ? void 0 : M.canCreateDashboard) ?? !1, { onCreateSuccess: w } = yt({
|
|
802
802
|
onDashboardSelect: r
|
|
803
|
-
}), { selectVisual: C } = re(), { handleEditLibraryVisual: L } =
|
|
803
|
+
}), { selectVisual: C } = re(), { handleEditLibraryVisual: L } = Ge(), {
|
|
804
804
|
createResource: A,
|
|
805
805
|
isCreating: j,
|
|
806
806
|
refetch: T
|
|
807
807
|
} = _e(), { createResource: S, isCreating: P } = ye(
|
|
808
808
|
void 0,
|
|
809
809
|
// onDeleteSuccess (not needed here)
|
|
810
|
-
(
|
|
811
|
-
i(!1),
|
|
810
|
+
(N) => {
|
|
811
|
+
i(!1), N && (C(N), L(N));
|
|
812
812
|
}
|
|
813
|
-
), v = o === "overlay", p = ((m == null ? void 0 : m.name) ?? "").trim(),
|
|
813
|
+
), v = o === "overlay", p = ((m == null ? void 0 : m.name) ?? "").trim(), z = ((m == null ? void 0 : m.email) ?? "").trim(), F = p && p.toLowerCase() !== "undefined" ? p : z || "Current user", Y = ((K = F.charAt(0)) == null ? void 0 : K.toUpperCase()) || "?", G = z && z.toLowerCase() !== "undefined" ? z : "", k = Rt(f, {
|
|
814
814
|
enabled: t && v
|
|
815
|
-
}), R =
|
|
815
|
+
}), R = J(
|
|
816
816
|
"flex h-full flex-col border-r bg-background",
|
|
817
|
-
v ?
|
|
817
|
+
v ? J(
|
|
818
818
|
"absolute inset-y-0 left-0 z-[51] w-60 shadow-lg transition-transform duration-300 ease-in-out",
|
|
819
819
|
t ? "translate-x-0" : "pointer-events-none -translate-x-full"
|
|
820
820
|
) : "w-full max-w-[17rem] min-w-[11rem] overflow-hidden shadow-sm",
|
|
821
821
|
h
|
|
822
|
-
), ee = (
|
|
823
|
-
}, te = (
|
|
824
|
-
console.log("Editing dashboard:",
|
|
825
|
-
},
|
|
826
|
-
A(
|
|
827
|
-
onSuccess: (
|
|
828
|
-
i(!1), w(
|
|
822
|
+
), ee = (N) => {
|
|
823
|
+
}, te = (N) => {
|
|
824
|
+
console.log("Editing dashboard:", N);
|
|
825
|
+
}, B = (N) => {
|
|
826
|
+
A(N, {
|
|
827
|
+
onSuccess: (q) => {
|
|
828
|
+
i(!1), w(q, T);
|
|
829
829
|
}
|
|
830
830
|
});
|
|
831
831
|
};
|
|
@@ -844,7 +844,7 @@ function Wt({
|
|
|
844
844
|
children: /* @__PURE__ */ e(St, { className: "h-3.5 w-3.5" })
|
|
845
845
|
}
|
|
846
846
|
),
|
|
847
|
-
(g ||
|
|
847
|
+
(g || V) && /* @__PURE__ */ e(
|
|
848
848
|
_,
|
|
849
849
|
{
|
|
850
850
|
size: "sm",
|
|
@@ -860,38 +860,38 @@ function Wt({
|
|
|
860
860
|
fe,
|
|
861
861
|
{
|
|
862
862
|
placeholder: "Search...",
|
|
863
|
-
value:
|
|
864
|
-
onChange: (
|
|
863
|
+
value: b,
|
|
864
|
+
onChange: (N) => y(N.target.value),
|
|
865
865
|
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",
|
|
866
866
|
autoFocus: !0
|
|
867
867
|
}
|
|
868
868
|
) })
|
|
869
869
|
] }),
|
|
870
|
-
/* @__PURE__ */ e("div", { className: "flex flex-1 flex-col overflow-auto px-2 py-2", children: g ? /* @__PURE__ */ e(It, { searchQuery:
|
|
871
|
-
|
|
870
|
+
/* @__PURE__ */ e("div", { className: "flex flex-1 flex-col overflow-auto px-2 py-2", children: g ? /* @__PURE__ */ e(It, { searchQuery: b }) : /* @__PURE__ */ e(
|
|
871
|
+
Mt,
|
|
872
872
|
{
|
|
873
|
-
searchQuery:
|
|
873
|
+
searchQuery: b,
|
|
874
874
|
onLoadDashboard: ee,
|
|
875
875
|
onEditDashboard: te,
|
|
876
876
|
onDashboardItemClick: r
|
|
877
877
|
}
|
|
878
878
|
) }),
|
|
879
|
-
m && /* @__PURE__ */ e(
|
|
880
|
-
/* @__PURE__ */ a(
|
|
881
|
-
/* @__PURE__ */ e(
|
|
879
|
+
m && /* @__PURE__ */ e(Me, { children: /* @__PURE__ */ e("div", { className: "border-t border-border px-4 py-2", children: /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
880
|
+
/* @__PURE__ */ a(ze, { children: [
|
|
881
|
+
/* @__PURE__ */ e(Be, { 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: Y }) }) }),
|
|
882
882
|
/* @__PURE__ */ e(He, { side: "top", className: "max-w-xs", children: /* @__PURE__ */ a("div", { className: "space-y-1", children: [
|
|
883
|
-
/* @__PURE__ */ e("div", { className: "font-medium", children:
|
|
884
|
-
|
|
883
|
+
/* @__PURE__ */ e("div", { className: "font-medium", children: F }),
|
|
884
|
+
G && /* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground", children: G }),
|
|
885
885
|
m.role && /* @__PURE__ */ a("div", { className: "text-xs text-muted-foreground", children: [
|
|
886
886
|
"Role: ",
|
|
887
|
-
|
|
887
|
+
Et(m.role.replace(/_/g, " "))
|
|
888
888
|
] })
|
|
889
889
|
] }) })
|
|
890
890
|
] }),
|
|
891
|
-
/* @__PURE__ */ e("span", { className: "truncate text-xs text-muted-foreground", children:
|
|
891
|
+
/* @__PURE__ */ e("span", { className: "truncate text-xs text-muted-foreground", children: F })
|
|
892
892
|
] }) }) }),
|
|
893
893
|
g ? /* @__PURE__ */ e(
|
|
894
|
-
|
|
894
|
+
zt,
|
|
895
895
|
{
|
|
896
896
|
open: D,
|
|
897
897
|
onOpenChange: i,
|
|
@@ -899,11 +899,11 @@ function Wt({
|
|
|
899
899
|
isCreating: P
|
|
900
900
|
}
|
|
901
901
|
) : /* @__PURE__ */ e(
|
|
902
|
-
|
|
902
|
+
Vt,
|
|
903
903
|
{
|
|
904
904
|
open: D,
|
|
905
905
|
onOpenChange: i,
|
|
906
|
-
onSubmit:
|
|
906
|
+
onSubmit: B,
|
|
907
907
|
isCreating: j
|
|
908
908
|
}
|
|
909
909
|
)
|