react-semaphor 0.1.164 → 0.1.166
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-B9UPzyO5.js +26 -0
- package/dist/chunks/{dashboard-controls-CWQ_gUsq.js → dashboard-controls-CixEPYYv.js} +260 -285
- package/dist/chunks/{dashboard-json-05FNu5_c.js → dashboard-json-BYNwk3YG.js} +1 -1
- package/dist/chunks/{dashboard-json-BnUM90on.js → dashboard-json-LXUW-x_7.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-BQyiGFIJ.js → edit-dashboard-visual-CyW3aGrM.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-DvcXroC3.js → edit-dashboard-visual-DtiYOHX5.js} +2 -2
- package/dist/chunks/{editor-action-buttons-0lhAtWvK.js → editor-action-buttons-C2VJa0cF.js} +2 -2
- package/dist/chunks/{editor-action-buttons-DChxrcx_.js → editor-action-buttons-CFZZpeDq.js} +1 -1
- package/dist/chunks/index-CQ7RRL9U.js +1108 -0
- package/dist/chunks/{index-Ba7cbkS0.js → index-DYeBGt71.js} +19247 -18898
- package/dist/chunks/{resource-management-panel-BDDrOqYt.js → resource-management-panel-DJOLQsLL.js} +141 -141
- package/dist/chunks/{resource-management-panel-Dw5GP_kj.js → resource-management-panel-qqHHN4xT.js} +1 -1
- package/dist/chunks/schedule-dashboard-B5cLQ2sk.js +6 -0
- package/dist/chunks/schedule-dashboard-B9Y23qK6.js +416 -0
- package/dist/chunks/{use-role-aware-display-preferences-C9ydHtPN.js → use-role-aware-display-preferences-8gWJAMO3.js} +1 -1
- package/dist/chunks/{use-role-aware-display-preferences-Dk-fULeQ.js → use-role-aware-display-preferences-BJCLNjn8.js} +1 -1
- package/dist/chunks/{use-visual-utils-BOMHKg6C.js → use-visual-utils-Bsvc2KNu.js} +1 -1
- package/dist/chunks/{use-visual-utils-DfO9gvaA.js → use-visual-utils-DA9bk0Rh.js} +20 -20
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +111 -108
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +1 -1
- package/dist/types/dashboard.d.ts +5 -0
- package/dist/types/main.d.ts +5 -0
- package/dist/types/surfboard.d.ts +5 -0
- package/dist/types/types.d.ts +5 -0
- package/package.json +1 -1
- package/dist/chunks/dashboard-controls-Czfs9TsO.js +0 -26
- package/dist/chunks/dashboard-export-dialog-DiJIOI6i.js +0 -602
- package/dist/chunks/dashboard-export-dialog-zge97BYd.js +0 -6
- package/dist/chunks/index-SZ7sy6nw.js +0 -1103
package/dist/chunks/{resource-management-panel-BDDrOqYt.js → resource-management-panel-DJOLQsLL.js}
RENAMED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsx as e, jsxs as a, Fragment as ge } from "react/jsx-runtime";
|
|
2
|
-
import { l as
|
|
2
|
+
import { l as $e, u as me, n as Qe, aB as re, b9 as Xe, ba as Ze, c as X, bb as ke, aS as et, aT as tt, B as _, aU as st, aV as at, aW as W, bc as pe, L as oe, bd as nt, be as it, bf as rt, bg as ve, bh as De, bi as ot, bj as lt, K as dt, bk as ye, e as le, bl as Se, bm as Ve, bn as ct, _ as Ee, V as Le, bo as Ae, a_ as Te, a$ as Oe, b0 as Re, b2 as Pe, b3 as Ue, b4 as Ie, b5 as je, b6 as Me, bp as ut, bq as ht, br as Fe, bs as Be, bt as ze, bu as mt, bv as He, bw as pt, R as ne, aA as ft, bx as _e, by as gt, bz as Dt, aF as xt, aG as Nt, aH as bt, aI as wt, aJ as vt, aK as Ce, aL as fe, aO as Ct, bA as yt, bB as St, bC as Vt, bD as Et } from "./index-DYeBGt71.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 Ke } from "./use-visual-utils-DA9bk0Rh.js";
|
|
5
|
+
import { u as Tt } from "./use-role-aware-display-preferences-BJCLNjn8.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
|
|
12
|
+
const Ot = $e("FolderOpen", [
|
|
13
13
|
[
|
|
14
14
|
"path",
|
|
15
15
|
{
|
|
@@ -18,7 +18,7 @@ const Rt = qe("FolderOpen", [
|
|
|
18
18
|
}
|
|
19
19
|
]
|
|
20
20
|
]);
|
|
21
|
-
function
|
|
21
|
+
function Rt(t, f = {}) {
|
|
22
22
|
const { enabled: h = !0, eventType: r = "mousedown" } = f, o = At(null);
|
|
23
23
|
return ie(() => {
|
|
24
24
|
const g = (D) => {
|
|
@@ -30,7 +30,7 @@ function Ot(t, f = {}) {
|
|
|
30
30
|
};
|
|
31
31
|
}, [t, h, r]), o;
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function Ge() {
|
|
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 Je() {
|
|
|
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 = Qe((o) => o.frame);
|
|
51
51
|
return !!(f && h && (r == null ? void 0 : r.visualId) === t);
|
|
52
52
|
};
|
|
53
53
|
function Ut({
|
|
@@ -64,27 +64,27 @@ function Ut({
|
|
|
64
64
|
formatDate: y
|
|
65
65
|
}) {
|
|
66
66
|
var T, S, P, v;
|
|
67
|
-
const { selectVisual: d } = re(), c = Xe(t.id), m = Pt(t.id), { isConsoleMode:
|
|
67
|
+
const { selectVisual: d } = re(), c = Xe(t.id), m = Pt(t.id), { isConsoleMode: V } = Ze(), E = 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 && E.current && E.current.scrollIntoView({
|
|
72
72
|
behavior: "smooth",
|
|
73
73
|
block: "center"
|
|
74
74
|
});
|
|
75
75
|
}, [m]);
|
|
76
|
-
const
|
|
76
|
+
const j = () => {
|
|
77
77
|
d(t), o == null || o(t);
|
|
78
78
|
};
|
|
79
79
|
return /* @__PURE__ */ a(
|
|
80
80
|
"div",
|
|
81
81
|
{
|
|
82
|
-
ref:
|
|
82
|
+
ref: E,
|
|
83
83
|
className: X(
|
|
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
|
),
|
|
87
|
-
onClick:
|
|
87
|
+
onClick: j,
|
|
88
88
|
children: [
|
|
89
89
|
/* @__PURE__ */ e(ke, { className: "mt-0.5 h-4 w-4 flex-shrink-0 text-muted-foreground/50" }),
|
|
90
90
|
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ a("div", { className: "flex items-start justify-between gap-2", children: [
|
|
@@ -122,7 +122,7 @@ function Ut({
|
|
|
122
122
|
/* @__PURE__ */ e(tt, { asChild: !0, children: /* @__PURE__ */ e(_, { size: "sm", variant: "ghost", className: "h-6 w-6 p-0", children: /* @__PURE__ */ e(st, { className: "h-3 w-3" }) }) }),
|
|
123
123
|
/* @__PURE__ */ a(at, { align: "end", className: "z-[51] w-40", children: [
|
|
124
124
|
/* @__PURE__ */ a(
|
|
125
|
-
|
|
125
|
+
W,
|
|
126
126
|
{
|
|
127
127
|
onClick: (p) => {
|
|
128
128
|
p.stopPropagation(), r(t);
|
|
@@ -134,19 +134,19 @@ function Ut({
|
|
|
134
134
|
}
|
|
135
135
|
),
|
|
136
136
|
/* @__PURE__ */ a(
|
|
137
|
-
|
|
137
|
+
W,
|
|
138
138
|
{
|
|
139
139
|
onClick: (p) => {
|
|
140
140
|
p.stopPropagation(), o == null || o(t);
|
|
141
141
|
},
|
|
142
142
|
children: [
|
|
143
|
-
/* @__PURE__ */ e(
|
|
143
|
+
/* @__PURE__ */ e(Ot, { className: "mr-2 h-3 w-3" }),
|
|
144
144
|
"Open"
|
|
145
145
|
]
|
|
146
146
|
}
|
|
147
147
|
),
|
|
148
148
|
/* @__PURE__ */ a(
|
|
149
|
-
|
|
149
|
+
W,
|
|
150
150
|
{
|
|
151
151
|
onClick: (p) => {
|
|
152
152
|
p.preventDefault(), p.stopPropagation(), i(t.id);
|
|
@@ -160,7 +160,7 @@ function Ut({
|
|
|
160
160
|
),
|
|
161
161
|
t.ownership.isOwner && /* @__PURE__ */ a(ge, { children: [
|
|
162
162
|
/* @__PURE__ */ a(
|
|
163
|
-
|
|
163
|
+
W,
|
|
164
164
|
{
|
|
165
165
|
onClick: (p) => {
|
|
166
166
|
p.stopPropagation(), g == null || g(t);
|
|
@@ -172,7 +172,7 @@ function Ut({
|
|
|
172
172
|
}
|
|
173
173
|
),
|
|
174
174
|
/* @__PURE__ */ a(
|
|
175
|
-
|
|
175
|
+
W,
|
|
176
176
|
{
|
|
177
177
|
onClick: (p) => {
|
|
178
178
|
p.stopPropagation(), N(t);
|
|
@@ -185,7 +185,7 @@ function Ut({
|
|
|
185
185
|
),
|
|
186
186
|
/* @__PURE__ */ e(ve, {}),
|
|
187
187
|
/* @__PURE__ */ a(
|
|
188
|
-
|
|
188
|
+
W,
|
|
189
189
|
{
|
|
190
190
|
onClick: (p) => {
|
|
191
191
|
p.stopPropagation(), D(t);
|
|
@@ -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" && V) && /* @__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
|
] }),
|
|
@@ -243,81 +243,81 @@ function It({ searchQuery: t }) {
|
|
|
243
243
|
null
|
|
244
244
|
), [g, D] = x(!1), [i, N] = x(null), [y, d] = x(null), [c, m] = x(
|
|
245
245
|
null
|
|
246
|
-
), { selectVisual:
|
|
246
|
+
), { selectVisual: V } = re(), { handleEditLibraryVisual: E, handleAddLibraryVisual: w } = Ke(), {
|
|
247
247
|
resources: C,
|
|
248
248
|
isLoading: L,
|
|
249
249
|
isError: A,
|
|
250
|
-
isFetching:
|
|
250
|
+
isFetching: j,
|
|
251
251
|
updateResource: T,
|
|
252
252
|
deleteResource: S,
|
|
253
253
|
duplicateResource: P,
|
|
254
254
|
isDeleting: v,
|
|
255
255
|
isDuplicating: p,
|
|
256
|
-
isUpdating:
|
|
256
|
+
isUpdating: B
|
|
257
257
|
} = ye(() => {
|
|
258
258
|
D(!1), N(null);
|
|
259
259
|
});
|
|
260
260
|
le();
|
|
261
|
-
const
|
|
261
|
+
const Z = C.filter(
|
|
262
262
|
(n) => {
|
|
263
|
-
var
|
|
264
|
-
return ((
|
|
263
|
+
var O, l;
|
|
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
|
+
), M = (n) => new Date(n).toLocaleDateString("en-US", {
|
|
267
267
|
month: "short",
|
|
268
268
|
day: "numeric",
|
|
269
269
|
year: "numeric"
|
|
270
|
-
}),
|
|
270
|
+
}), q = (n) => {
|
|
271
271
|
N(n), D(!0);
|
|
272
|
-
},
|
|
272
|
+
}, K = () => {
|
|
273
273
|
i && S(i.id);
|
|
274
274
|
}, {
|
|
275
275
|
startUpdating: k,
|
|
276
|
-
stopUpdating:
|
|
276
|
+
stopUpdating: R,
|
|
277
277
|
isUpdating: ee
|
|
278
|
-
} = Se(), te = (n,
|
|
278
|
+
} = Se(), te = (n, O, l) => {
|
|
279
279
|
var ae;
|
|
280
|
-
const
|
|
281
|
-
Object.entries(
|
|
280
|
+
const Y = Object.fromEntries(
|
|
281
|
+
Object.entries(O).filter(([, I]) => I !== void 0)
|
|
282
282
|
);
|
|
283
|
-
if (Object.keys(
|
|
283
|
+
if (Object.keys(Y).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 $ = Object.keys(Y), Q = $.length === 1 ? $[0] : void 0;
|
|
288
|
+
k(n, Q), T(
|
|
289
289
|
{
|
|
290
290
|
resourceId: n,
|
|
291
|
-
data:
|
|
291
|
+
data: Y
|
|
292
292
|
},
|
|
293
293
|
{
|
|
294
294
|
onSuccess: () => {
|
|
295
295
|
var I;
|
|
296
|
-
|
|
296
|
+
R(n, Q), (I = l == null ? void 0 : l.onSuccess) == null || I.call(l);
|
|
297
297
|
},
|
|
298
298
|
onError: () => {
|
|
299
299
|
var I;
|
|
300
|
-
|
|
300
|
+
R(n, Q), (I = l == null ? void 0 : l.onError) == null || I.call(l);
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
303
|
);
|
|
304
|
-
},
|
|
304
|
+
}, z = (n) => {
|
|
305
305
|
d(n), P(n, {
|
|
306
306
|
onSettled: () => d(null)
|
|
307
307
|
});
|
|
308
308
|
}, F = (n) => {
|
|
309
|
-
|
|
310
|
-
},
|
|
309
|
+
E(n);
|
|
310
|
+
}, G = (n) => {
|
|
311
311
|
w(n);
|
|
312
312
|
}, b = (n) => {
|
|
313
|
-
const
|
|
314
|
-
|
|
313
|
+
const O = C.find((l) => l.id === n);
|
|
314
|
+
O && T({
|
|
315
315
|
resourceId: n,
|
|
316
316
|
data: {
|
|
317
|
-
isPrivate: !
|
|
317
|
+
isPrivate: !O.isPrivate
|
|
318
318
|
}
|
|
319
319
|
});
|
|
320
|
-
},
|
|
320
|
+
}, J = (n) => {
|
|
321
321
|
o(n), h(!0);
|
|
322
322
|
}, se = (n) => {
|
|
323
323
|
m(n);
|
|
@@ -325,18 +325,18 @@ function It({ searchQuery: t }) {
|
|
|
325
325
|
m(null);
|
|
326
326
|
}, ce = ({
|
|
327
327
|
title: n,
|
|
328
|
-
description:
|
|
328
|
+
description: O
|
|
329
329
|
}) => {
|
|
330
330
|
if (!c)
|
|
331
331
|
return;
|
|
332
332
|
const l = {};
|
|
333
|
-
n !== c.title && (l.title = n), (c.description || "") !==
|
|
333
|
+
n !== c.title && (l.title = n), (c.description || "") !== O && (l.description = O), te(c.id, l, {
|
|
334
334
|
onSuccess: () => {
|
|
335
335
|
m(null);
|
|
336
336
|
}
|
|
337
337
|
});
|
|
338
338
|
};
|
|
339
|
-
return L ? /* @__PURE__ */ e(
|
|
339
|
+
return L ? /* @__PURE__ */ e(Ge, {}) : A ? /* @__PURE__ */ e(Ve, { 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: Z.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
|
+
] }) : Z.map((n) => /* @__PURE__ */ e(
|
|
357
357
|
Ut,
|
|
358
358
|
{
|
|
359
359
|
visual: n,
|
|
360
|
-
onAddVisual:
|
|
360
|
+
onAddVisual: G,
|
|
361
361
|
onOpenVisual: F,
|
|
362
362
|
onEditDetails: se,
|
|
363
|
-
onDeleteClick:
|
|
364
|
-
onDuplicateVisual:
|
|
363
|
+
onDeleteClick: q,
|
|
364
|
+
onDuplicateVisual: z,
|
|
365
365
|
onTogglePrivacy: b,
|
|
366
|
-
onShareVisual:
|
|
366
|
+
onShareVisual: J,
|
|
367
367
|
isDeleting: v,
|
|
368
368
|
isDuplicating: y === n.id,
|
|
369
|
-
formatDate:
|
|
369
|
+
formatDate: M
|
|
370
370
|
},
|
|
371
371
|
n.id
|
|
372
372
|
)) }),
|
|
373
373
|
f && r && /* @__PURE__ */ e(
|
|
374
|
-
|
|
374
|
+
Ee,
|
|
375
375
|
{
|
|
376
376
|
resource: r,
|
|
377
377
|
resourceType: Le.VISUAL,
|
|
@@ -399,8 +399,8 @@ function It({ searchQuery: t }) {
|
|
|
399
399
|
onOpenChange: (n) => {
|
|
400
400
|
!n && v || (D(n), n || N(null));
|
|
401
401
|
},
|
|
402
|
-
children: /* @__PURE__ */ a(
|
|
403
|
-
/* @__PURE__ */ a(
|
|
402
|
+
children: /* @__PURE__ */ a(Oe, { children: [
|
|
403
|
+
/* @__PURE__ */ a(Re, { children: [
|
|
404
404
|
/* @__PURE__ */ e(Pe, { children: "Delete Visual" }),
|
|
405
405
|
/* @__PURE__ */ a(Ue, { children: [
|
|
406
406
|
'Are you sure you want to delete "',
|
|
@@ -409,12 +409,12 @@ function It({ searchQuery: t }) {
|
|
|
409
409
|
] })
|
|
410
410
|
] }),
|
|
411
411
|
/* @__PURE__ */ a(Ie, { children: [
|
|
412
|
-
/* @__PURE__ */ e(
|
|
412
|
+
/* @__PURE__ */ e(je, { disabled: v, children: "Cancel" }),
|
|
413
413
|
/* @__PURE__ */ a(
|
|
414
|
-
|
|
414
|
+
Me,
|
|
415
415
|
{
|
|
416
416
|
onClick: (n) => {
|
|
417
|
-
n.preventDefault(), n.stopPropagation(),
|
|
417
|
+
n.preventDefault(), n.stopPropagation(), K();
|
|
418
418
|
},
|
|
419
419
|
className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
420
420
|
disabled: v,
|
|
@@ -430,7 +430,7 @@ function It({ searchQuery: t }) {
|
|
|
430
430
|
)
|
|
431
431
|
] });
|
|
432
432
|
}
|
|
433
|
-
function
|
|
433
|
+
function jt({
|
|
434
434
|
dashboard: t,
|
|
435
435
|
isDeleting: f,
|
|
436
436
|
isDuplicating: h,
|
|
@@ -444,9 +444,9 @@ function Mt({
|
|
|
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: V, isLoading: E } = le(), { mutate: w } = ht(), C = ((T = V == null ? void 0 : V.permissions) == null ? void 0 : T.canEdit) ?? !1, L = E || !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
452
|
return /* @__PURE__ */ e(Fe, { children: /* @__PURE__ */ a(
|
|
@@ -458,11 +458,11 @@ function Mt({
|
|
|
458
458
|
),
|
|
459
459
|
onClick: A,
|
|
460
460
|
children: [
|
|
461
|
-
/* @__PURE__ */ a(
|
|
462
|
-
/* @__PURE__ */ e(
|
|
461
|
+
/* @__PURE__ */ a(Be, { children: [
|
|
462
|
+
/* @__PURE__ */ e(ze, { asChild: !0, children: /* @__PURE__ */ e(
|
|
463
463
|
"button",
|
|
464
464
|
{
|
|
465
|
-
onClick:
|
|
465
|
+
onClick: j,
|
|
466
466
|
className: "mt-0.5 flex-shrink-0 rounded p-0.5 hover:bg-muted",
|
|
467
467
|
children: /* @__PURE__ */ e(
|
|
468
468
|
mt,
|
|
@@ -516,8 +516,8 @@ function Mt({
|
|
|
516
516
|
t.id
|
|
517
517
|
) });
|
|
518
518
|
}
|
|
519
|
-
function
|
|
520
|
-
return /* @__PURE__ */ e(
|
|
519
|
+
function Mt({ onRetry: t }) {
|
|
520
|
+
return /* @__PURE__ */ e(Ve, { 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
|
] }) });
|
|
@@ -526,11 +526,11 @@ function Ft(t) {
|
|
|
526
526
|
var xe, Ne;
|
|
527
527
|
const { searchQuery: f, onLoadDashboard: h, onEditDashboard: r, onDashboardItemClick: o } = t, [g, D] = x(!1), [i, N] = x(
|
|
528
528
|
null
|
|
529
|
-
), [y, d] = x(!1), [c, m] = x(null), [
|
|
529
|
+
), [y, d] = x(!1), [c, m] = x(null), [V, E] = x(null), [w, C] = x(null), L = ne(
|
|
530
530
|
(s) => s.lastSelectedDashboard
|
|
531
531
|
), A = ne(
|
|
532
532
|
(s) => s.selectedDashboard
|
|
533
|
-
),
|
|
533
|
+
), j = ne(
|
|
534
534
|
(s) => s.actions.selectDashboard
|
|
535
535
|
), T = ne(
|
|
536
536
|
(s) => s.actions.clearSelectedDashboard
|
|
@@ -539,20 +539,20 @@ 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: B,
|
|
543
|
+
isFetching: Z,
|
|
544
|
+
updateResource: M,
|
|
545
|
+
deleteResource: q,
|
|
546
|
+
duplicateResource: K,
|
|
547
547
|
isUpdating: k,
|
|
548
|
-
isDeleting:
|
|
548
|
+
isDeleting: R,
|
|
549
549
|
isDuplicating: ee,
|
|
550
550
|
refetch: te
|
|
551
551
|
} = _e(() => {
|
|
552
552
|
d(!1);
|
|
553
553
|
const s = c == null ? void 0 : c.id;
|
|
554
|
-
m(null), (A == null ? void 0 : A.id) === s && (!(S != null && S.dashboard_id) && !P ? T() : L && L.id !== s &&
|
|
555
|
-
}), { currentUser:
|
|
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: z, userContext: F } = le(), G = ((xe = F == null ? void 0 : F.permissions) == null ? void 0 : xe.canCreateDashboard) ?? !1, { data: b } = gt(), J = ((Ne = b == null ? void 0 : b.preference) == null ? void 0 : Ne.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()));
|
|
@@ -565,16 +565,16 @@ function Ft(t) {
|
|
|
565
565
|
h == null || h(s);
|
|
566
566
|
}, n = (s) => {
|
|
567
567
|
m(s), d(!0);
|
|
568
|
-
},
|
|
569
|
-
c &&
|
|
568
|
+
}, O = () => {
|
|
569
|
+
c && q(c.id);
|
|
570
570
|
}, l = (s) => {
|
|
571
|
-
|
|
572
|
-
onSettled: () =>
|
|
571
|
+
E(s), K(s, {
|
|
572
|
+
onSettled: () => E(null)
|
|
573
573
|
});
|
|
574
574
|
}, {
|
|
575
|
-
startUpdating:
|
|
576
|
-
stopUpdating:
|
|
577
|
-
isUpdating:
|
|
575
|
+
startUpdating: Y,
|
|
576
|
+
stopUpdating: $,
|
|
577
|
+
isUpdating: Q
|
|
578
578
|
} = Se(), ae = (s, U, u) => {
|
|
579
579
|
var we;
|
|
580
580
|
const ue = Object.fromEntries(
|
|
@@ -585,7 +585,7 @@ function Ft(t) {
|
|
|
585
585
|
return;
|
|
586
586
|
}
|
|
587
587
|
const be = Object.keys(ue), he = be.length === 1 ? be[0] : void 0;
|
|
588
|
-
|
|
588
|
+
Y(s, he), M(
|
|
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
|
+
$(s, he), (H = u == null ? void 0 : u.onSuccess) == null || H.call(u);
|
|
597
597
|
},
|
|
598
598
|
onError: () => {
|
|
599
599
|
var H;
|
|
600
|
-
|
|
600
|
+
$(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 && M({
|
|
609
609
|
resourceId: s,
|
|
610
610
|
data: {
|
|
611
611
|
isPrivate: !U.isPrivate
|
|
612
612
|
}
|
|
613
613
|
});
|
|
614
|
-
},
|
|
615
|
-
N(s),
|
|
616
|
-
},
|
|
614
|
+
}, We = (s) => {
|
|
615
|
+
N(s), z == null || z.type, D(!0);
|
|
616
|
+
}, qe = (s) => {
|
|
617
617
|
r == null || r(s.id), C(s);
|
|
618
|
-
},
|
|
618
|
+
}, Je = () => {
|
|
619
619
|
C(null);
|
|
620
|
-
},
|
|
620
|
+
}, Ye = ({
|
|
621
621
|
title: s,
|
|
622
622
|
description: U
|
|
623
623
|
}) => {
|
|
@@ -630,31 +630,31 @@ function Ft(t) {
|
|
|
630
630
|
}
|
|
631
631
|
});
|
|
632
632
|
};
|
|
633
|
-
return p ? /* @__PURE__ */ e(
|
|
633
|
+
return p ? /* @__PURE__ */ e(Ge, {}) : B ? /* @__PURE__ */ e(Mt, { 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" : G ? '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
|
-
isDeleting:
|
|
643
|
-
isDuplicating:
|
|
644
|
-
isDefault: s.id ===
|
|
642
|
+
isDeleting: R,
|
|
643
|
+
isDuplicating: V === s.id,
|
|
644
|
+
isDefault: s.id === J,
|
|
645
645
|
onLoadDashboard: ce,
|
|
646
|
-
onEditDetails:
|
|
646
|
+
onEditDetails: qe,
|
|
647
647
|
onDeleteClick: n,
|
|
648
648
|
onDuplicateDashboard: l,
|
|
649
649
|
onTogglePrivacy: I,
|
|
650
|
-
onShareDashboard:
|
|
650
|
+
onShareDashboard: We,
|
|
651
651
|
formatDate: de,
|
|
652
652
|
onDashboardItemClick: o
|
|
653
653
|
},
|
|
654
654
|
s.id
|
|
655
655
|
)) }),
|
|
656
656
|
g && i && /* @__PURE__ */ e(
|
|
657
|
-
|
|
657
|
+
Ee,
|
|
658
658
|
{
|
|
659
659
|
resource: i,
|
|
660
660
|
resourceType: Le.DASHBOARD,
|
|
@@ -668,10 +668,10 @@ function Ft(t) {
|
|
|
668
668
|
{
|
|
669
669
|
open: y,
|
|
670
670
|
onOpenChange: (s) => {
|
|
671
|
-
!s &&
|
|
671
|
+
!s && R || (d(s), s || m(null));
|
|
672
672
|
},
|
|
673
|
-
children: /* @__PURE__ */ a(
|
|
674
|
-
/* @__PURE__ */ a(
|
|
673
|
+
children: /* @__PURE__ */ a(Oe, { children: [
|
|
674
|
+
/* @__PURE__ */ a(Re, { children: [
|
|
675
675
|
/* @__PURE__ */ e(Pe, { children: "Delete Dashboard" }),
|
|
676
676
|
/* @__PURE__ */ a(Ue, { children: [
|
|
677
677
|
'Are you sure you want to delete "',
|
|
@@ -680,18 +680,18 @@ function Ft(t) {
|
|
|
680
680
|
] })
|
|
681
681
|
] }),
|
|
682
682
|
/* @__PURE__ */ a(Ie, { children: [
|
|
683
|
-
/* @__PURE__ */ e(
|
|
683
|
+
/* @__PURE__ */ e(je, { disabled: R, children: "Cancel" }),
|
|
684
684
|
/* @__PURE__ */ a(
|
|
685
|
-
|
|
685
|
+
Me,
|
|
686
686
|
{
|
|
687
687
|
onClick: (s) => {
|
|
688
|
-
s.preventDefault(), s.stopPropagation(),
|
|
688
|
+
s.preventDefault(), s.stopPropagation(), O();
|
|
689
689
|
},
|
|
690
690
|
className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
691
|
-
disabled:
|
|
691
|
+
disabled: R,
|
|
692
692
|
children: [
|
|
693
|
-
|
|
694
|
-
|
|
693
|
+
R ? /* @__PURE__ */ e(oe, { className: "mr-2 h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(De, { className: "mr-2 h-3.5 w-3.5" }),
|
|
694
|
+
R ? "Deleting..." : "Delete"
|
|
695
695
|
]
|
|
696
696
|
}
|
|
697
697
|
)
|
|
@@ -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: Je,
|
|
710
|
+
onSave: Ye,
|
|
711
|
+
isSaving: Q(w.id)
|
|
712
712
|
}
|
|
713
713
|
)
|
|
714
714
|
] });
|
|
715
715
|
}
|
|
716
|
-
function
|
|
716
|
+
function Bt({
|
|
717
717
|
open: t,
|
|
718
718
|
onOpenChange: f,
|
|
719
719
|
onSubmit: h,
|
|
@@ -788,21 +788,21 @@ function zt({
|
|
|
788
788
|
] })
|
|
789
789
|
] }) });
|
|
790
790
|
}
|
|
791
|
-
function
|
|
791
|
+
function Wt({
|
|
792
792
|
isOpen: t,
|
|
793
793
|
onClose: f,
|
|
794
794
|
className: h,
|
|
795
795
|
onDashboardItemClick: r,
|
|
796
796
|
variant: o = "inline"
|
|
797
797
|
}) {
|
|
798
|
-
var F,
|
|
798
|
+
var F, G;
|
|
799
799
|
const g = me(
|
|
800
800
|
(b) => b.isDashboardEditing
|
|
801
|
-
), [D, i] = x(!1), [N, y] = x(""), [d, c] = x(!1), { currentUser: m, userContext:
|
|
801
|
+
), [D, i] = x(!1), [N, y] = x(""), [d, c] = x(!1), { currentUser: m, userContext: V } = le(), E = ((F = V == null ? void 0 : V.permissions) == null ? void 0 : F.canCreateDashboard) ?? !1, { onCreateSuccess: w } = yt({
|
|
802
802
|
onDashboardSelect: r
|
|
803
|
-
}), { selectVisual: C } = re(), { handleEditLibraryVisual: L } =
|
|
803
|
+
}), { selectVisual: C } = re(), { handleEditLibraryVisual: L } = Ke(), {
|
|
804
804
|
createResource: A,
|
|
805
|
-
isCreating:
|
|
805
|
+
isCreating: j,
|
|
806
806
|
refetch: T
|
|
807
807
|
} = _e(), { createResource: S, isCreating: P } = ye(
|
|
808
808
|
void 0,
|
|
@@ -810,9 +810,9 @@ function Kt({
|
|
|
810
810
|
(b) => {
|
|
811
811
|
i(!1), b && (C(b), L(b));
|
|
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(), B = ((m == null ? void 0 : m.email) ?? "").trim(), M = p && p.toLowerCase() !== "undefined" ? p : B || "Current user", q = ((G = M.charAt(0)) == null ? void 0 : G.toUpperCase()) || "?", K = B && B.toLowerCase() !== "undefined" ? B : "", k = Rt(f, {
|
|
814
814
|
enabled: t && v
|
|
815
|
-
}),
|
|
815
|
+
}), R = X(
|
|
816
816
|
"flex h-full flex-col border-r bg-background",
|
|
817
817
|
v ? X(
|
|
818
818
|
"absolute inset-y-0 left-0 z-[51] w-60 shadow-lg transition-transform duration-300 ease-in-out",
|
|
@@ -822,14 +822,14 @@ function Kt({
|
|
|
822
822
|
), ee = (b) => {
|
|
823
823
|
}, te = (b) => {
|
|
824
824
|
console.log("Editing dashboard:", b);
|
|
825
|
-
},
|
|
825
|
+
}, z = (b) => {
|
|
826
826
|
A(b, {
|
|
827
|
-
onSuccess: (
|
|
828
|
-
i(!1), w(
|
|
827
|
+
onSuccess: (J) => {
|
|
828
|
+
i(!1), w(J, T);
|
|
829
829
|
}
|
|
830
830
|
});
|
|
831
831
|
};
|
|
832
|
-
return /* @__PURE__ */ e(ge, { children: (!v || t) && /* @__PURE__ */ a("div", { ref: k, className:
|
|
832
|
+
return /* @__PURE__ */ e(ge, { children: (!v || t) && /* @__PURE__ */ a("div", { ref: k, className: R, children: [
|
|
833
833
|
/* @__PURE__ */ a("div", { className: "border-b border-border", children: [
|
|
834
834
|
/* @__PURE__ */ a("div", { className: "flex items-center justify-between px-4 py-1.5", children: [
|
|
835
835
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e("h2", { className: "whitespace-nowrap text-sm font-semibold", children: g ? "Visuals" : "Dashboards" }) }),
|
|
@@ -844,7 +844,7 @@ function Kt({
|
|
|
844
844
|
children: /* @__PURE__ */ e(St, { className: "h-3.5 w-3.5" })
|
|
845
845
|
}
|
|
846
846
|
),
|
|
847
|
-
(g ||
|
|
847
|
+
(g || E) && /* @__PURE__ */ e(
|
|
848
848
|
_,
|
|
849
849
|
{
|
|
850
850
|
size: "sm",
|
|
@@ -877,21 +877,21 @@ function Kt({
|
|
|
877
877
|
}
|
|
878
878
|
) }),
|
|
879
879
|
m && /* @__PURE__ */ e(Fe, { 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(
|
|
881
|
-
/* @__PURE__ */ e(
|
|
880
|
+
/* @__PURE__ */ a(Be, { children: [
|
|
881
|
+
/* @__PURE__ */ e(ze, { 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: q }) }) }),
|
|
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: M }),
|
|
884
|
+
K && /* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground", children: K }),
|
|
885
885
|
m.role && /* @__PURE__ */ a("div", { className: "text-xs text-muted-foreground", children: [
|
|
886
886
|
"Role: ",
|
|
887
|
-
|
|
887
|
+
Vt(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: M })
|
|
892
892
|
] }) }) }),
|
|
893
893
|
g ? /* @__PURE__ */ e(
|
|
894
|
-
|
|
894
|
+
Bt,
|
|
895
895
|
{
|
|
896
896
|
open: D,
|
|
897
897
|
onOpenChange: i,
|
|
@@ -899,16 +899,16 @@ function Kt({
|
|
|
899
899
|
isCreating: P
|
|
900
900
|
}
|
|
901
901
|
) : /* @__PURE__ */ e(
|
|
902
|
-
|
|
902
|
+
Et,
|
|
903
903
|
{
|
|
904
904
|
open: D,
|
|
905
905
|
onOpenChange: i,
|
|
906
|
-
onSubmit:
|
|
907
|
-
isCreating:
|
|
906
|
+
onSubmit: z,
|
|
907
|
+
isCreating: j
|
|
908
908
|
}
|
|
909
909
|
)
|
|
910
910
|
] }) });
|
|
911
911
|
}
|
|
912
912
|
export {
|
|
913
|
-
|
|
913
|
+
Wt as ResourceManagementPanel
|
|
914
914
|
};
|