react-semaphor 0.1.163 → 0.1.165
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-lOO1Kawo.js → dashboard-controls-BA7vyPHM.js} +104 -104
- package/dist/chunks/{dashboard-controls-ChqSrjnv.js → dashboard-controls-CEnWdjuE.js} +1 -1
- package/dist/chunks/{dashboard-export-dialog-BVBiNvo4.js → dashboard-export-dialog-9nJsWzgJ.js} +1 -1
- package/dist/chunks/{dashboard-export-dialog-h5owxj4H.js → dashboard-export-dialog-CEVJnrSj.js} +42 -42
- package/dist/chunks/{dashboard-json-Bp8U1SuM.js → dashboard-json-B4UTFvyR.js} +1 -1
- package/dist/chunks/{dashboard-json-D4Apm_Z0.js → dashboard-json-C8YFsFVt.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-BGY-Nj8j.js → edit-dashboard-visual-BMBiT_V_.js} +2 -2
- package/dist/chunks/{edit-dashboard-visual-ItNwbDeL.js → edit-dashboard-visual-DKqjPVRM.js} +467 -467
- package/dist/chunks/{editor-action-buttons-D91jaw9J.js → editor-action-buttons-De18jUjn.js} +2 -2
- package/dist/chunks/{editor-action-buttons-B2mhU48J.js → editor-action-buttons-xrbSWcSm.js} +1 -1
- package/dist/chunks/{index-BZpXKhl2.js → index-5dE6RqWv.js} +13528 -13412
- package/dist/chunks/{index-CM3-W6qg.js → index-odiH0LJA.js} +229 -224
- package/dist/chunks/{resource-management-panel-B_pm6Dv6.js → resource-management-panel-CK-wL4Jy.js} +1 -1
- package/dist/chunks/{resource-management-panel-CG1NjRIJ.js → resource-management-panel-CjWRsuif.js} +124 -124
- package/dist/chunks/{use-role-aware-display-preferences-DLpbW937.js → use-role-aware-display-preferences-Bj_-I3oD.js} +1 -1
- package/dist/chunks/{use-role-aware-display-preferences-VBz5V4SH.js → use-role-aware-display-preferences-Cm7hg_Us.js} +1 -1
- package/dist/chunks/{use-visual-utils-CRbrMwuR.js → use-visual-utils-Du173Ucu.js} +1 -1
- package/dist/chunks/{use-visual-utils-B1rNqRXZ.js → use-visual-utils-DwnVUHSd.js} +12 -12
- 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/package.json +1 -1
package/dist/chunks/{resource-management-panel-CG1NjRIJ.js → resource-management-panel-CjWRsuif.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 Ze, u as me, n as $e, aA as re, bg as Qe, bh as Xe, c as Q, bi as ke, aR as et, aS as tt, B as _, aT as st, aU as at, aV as J, bj as pe, L as oe, bk as nt, bl as it, bm as rt, bn as ve, bo as De, bp as ot, bq as lt, K as dt, br as ye, e as le, bs as Se, bt as Ee, bu as ct, _ as Ve, V as Le, bv as Ae, aZ as Re, a_ as Te, a$ as Oe, b1 as Pe, b2 as Ue, b3 as Ie, b4 as je, b5 as Fe, bw as ut, bx as ht, by as Me, bz as ze, bA as Be, bB as mt, bC as He, bD as pt, R as ne, az as ft, bE as _e, bF as gt, bG as Dt, aE as xt, aF as Nt, aG as bt, aH as wt, aI as vt, aJ as Ce, aK as fe, aN as Ct, bH as yt, bI as St, bJ as Et, bK as Vt } from "./index-5dE6RqWv.js";
|
|
3
3
|
import Lt, { useRef as At, useEffect as ie, useState as x } from "react";
|
|
4
|
-
import { a as
|
|
5
|
-
import { u as
|
|
4
|
+
import { a as Ke } from "./use-visual-utils-DwnVUHSd.js";
|
|
5
|
+
import { u as Rt } from "./use-role-aware-display-preferences-Cm7hg_Us.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 Tt = Ze("FolderOpen", [
|
|
13
13
|
[
|
|
14
14
|
"path",
|
|
15
15
|
{
|
|
@@ -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 = $e((o) => o.frame);
|
|
51
51
|
return !!(f && h && (r == null ? void 0 : r.visualId) === t);
|
|
52
52
|
};
|
|
53
53
|
function Ut({
|
|
@@ -63,8 +63,8 @@ function Ut({
|
|
|
63
63
|
onShareVisual: N,
|
|
64
64
|
formatDate: y
|
|
65
65
|
}) {
|
|
66
|
-
var
|
|
67
|
-
const { selectVisual: d } = re(), c =
|
|
66
|
+
var R, S, P, v;
|
|
67
|
+
const { selectVisual: d } = re(), c = Qe(t.id), m = Pt(t.id), { isConsoleMode: E } = Xe(), 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(() => {
|
|
@@ -73,18 +73,18 @@ function Ut({
|
|
|
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
82
|
ref: V,
|
|
83
|
-
className:
|
|
83
|
+
className: Q(
|
|
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: [
|
|
@@ -102,7 +102,7 @@ function Ut({
|
|
|
102
102
|
{
|
|
103
103
|
className: "truncate text-xs text-muted-foreground",
|
|
104
104
|
title: t.description || "No description",
|
|
105
|
-
children: (
|
|
105
|
+
children: (R = t.description) != null && R.trim() ? t.description : "No description"
|
|
106
106
|
}
|
|
107
107
|
)
|
|
108
108
|
] }),
|
|
@@ -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
|
+
J,
|
|
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
|
+
J,
|
|
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(Tt, { className: "mr-2 h-3 w-3" }),
|
|
144
144
|
"Open"
|
|
145
145
|
]
|
|
146
146
|
}
|
|
147
147
|
),
|
|
148
148
|
/* @__PURE__ */ a(
|
|
149
|
-
|
|
149
|
+
J,
|
|
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
|
+
J,
|
|
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
|
+
J,
|
|
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
|
+
J,
|
|
189
189
|
{
|
|
190
190
|
onClick: (p) => {
|
|
191
191
|
p.stopPropagation(), D(t);
|
|
@@ -243,12 +243,12 @@ 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: E } = re(), { handleEditLibraryVisual: V, handleAddLibraryVisual: w } =
|
|
246
|
+
), { selectVisual: E } = re(), { handleEditLibraryVisual: V, handleAddLibraryVisual: w } = Ke(), {
|
|
247
247
|
resources: C,
|
|
248
248
|
isLoading: L,
|
|
249
249
|
isError: A,
|
|
250
|
-
isFetching:
|
|
251
|
-
updateResource:
|
|
250
|
+
isFetching: j,
|
|
251
|
+
updateResource: R,
|
|
252
252
|
deleteResource: S,
|
|
253
253
|
duplicateResource: P,
|
|
254
254
|
isDeleting: v,
|
|
@@ -258,46 +258,46 @@ function It({ searchQuery: t }) {
|
|
|
258
258
|
D(!1), N(null);
|
|
259
259
|
});
|
|
260
260
|
le();
|
|
261
|
-
const
|
|
261
|
+
const X = C.filter(
|
|
262
262
|
(n) => {
|
|
263
|
-
var
|
|
264
|
-
return ((
|
|
263
|
+
var T, l;
|
|
264
|
+
return ((T = n == null ? void 0 : n.title) == null ? void 0 : T.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
|
-
}),
|
|
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
276
|
stopUpdating: O,
|
|
277
277
|
isUpdating: ee
|
|
278
|
-
} = Se(), te = (n,
|
|
278
|
+
} = Se(), te = (n, T, l) => {
|
|
279
279
|
var ae;
|
|
280
|
-
const
|
|
281
|
-
Object.entries(
|
|
280
|
+
const Y = Object.fromEntries(
|
|
281
|
+
Object.entries(T).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 Z = Object.keys(Y), $ = Z.length === 1 ? Z[0] : void 0;
|
|
288
|
+
k(n, $), R(
|
|
289
289
|
{
|
|
290
290
|
resourceId: n,
|
|
291
|
-
data:
|
|
291
|
+
data: Y
|
|
292
292
|
},
|
|
293
293
|
{
|
|
294
294
|
onSuccess: () => {
|
|
295
295
|
var I;
|
|
296
|
-
O(n,
|
|
296
|
+
O(n, $), (I = l == null ? void 0 : l.onSuccess) == null || I.call(l);
|
|
297
297
|
},
|
|
298
298
|
onError: () => {
|
|
299
299
|
var I;
|
|
300
|
-
O(n,
|
|
300
|
+
O(n, $), (I = l == null ? void 0 : l.onError) == null || I.call(l);
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
303
|
);
|
|
@@ -305,19 +305,19 @@ function It({ searchQuery: t }) {
|
|
|
305
305
|
d(n), P(n, {
|
|
306
306
|
onSettled: () => d(null)
|
|
307
307
|
});
|
|
308
|
-
},
|
|
308
|
+
}, M = (n) => {
|
|
309
309
|
V(n);
|
|
310
|
-
},
|
|
310
|
+
}, G = (n) => {
|
|
311
311
|
w(n);
|
|
312
312
|
}, b = (n) => {
|
|
313
|
-
const
|
|
314
|
-
|
|
313
|
+
const T = C.find((l) => l.id === n);
|
|
314
|
+
T && R({
|
|
315
315
|
resourceId: n,
|
|
316
316
|
data: {
|
|
317
|
-
isPrivate: !
|
|
317
|
+
isPrivate: !T.isPrivate
|
|
318
318
|
}
|
|
319
319
|
});
|
|
320
|
-
},
|
|
320
|
+
}, W = (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: T
|
|
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 || "") !== T && (l.description = T), 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(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,24 +349,24 @@ 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: X.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
|
+
] }) : X.map((n) => /* @__PURE__ */ e(
|
|
357
357
|
Ut,
|
|
358
358
|
{
|
|
359
359
|
visual: n,
|
|
360
|
-
onAddVisual:
|
|
361
|
-
onOpenVisual:
|
|
360
|
+
onAddVisual: G,
|
|
361
|
+
onOpenVisual: M,
|
|
362
362
|
onEditDetails: se,
|
|
363
|
-
onDeleteClick:
|
|
363
|
+
onDeleteClick: q,
|
|
364
364
|
onDuplicateVisual: B,
|
|
365
365
|
onTogglePrivacy: b,
|
|
366
|
-
onShareVisual:
|
|
366
|
+
onShareVisual: W,
|
|
367
367
|
isDeleting: v,
|
|
368
368
|
isDuplicating: y === n.id,
|
|
369
|
-
formatDate:
|
|
369
|
+
formatDate: F
|
|
370
370
|
},
|
|
371
371
|
n.id
|
|
372
372
|
)) }),
|
|
@@ -393,13 +393,13 @@ function It({ searchQuery: t }) {
|
|
|
393
393
|
}
|
|
394
394
|
),
|
|
395
395
|
/* @__PURE__ */ e(
|
|
396
|
-
|
|
396
|
+
Re,
|
|
397
397
|
{
|
|
398
398
|
open: g,
|
|
399
399
|
onOpenChange: (n) => {
|
|
400
400
|
!n && v || (D(n), n || N(null));
|
|
401
401
|
},
|
|
402
|
-
children: /* @__PURE__ */ a(
|
|
402
|
+
children: /* @__PURE__ */ a(Te, { children: [
|
|
403
403
|
/* @__PURE__ */ a(Oe, { children: [
|
|
404
404
|
/* @__PURE__ */ e(Pe, { children: "Delete Visual" }),
|
|
405
405
|
/* @__PURE__ */ a(Ue, { children: [
|
|
@@ -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
|
+
Fe,
|
|
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,
|
|
@@ -443,16 +443,16 @@ function Mt({
|
|
|
443
443
|
formatDate: y,
|
|
444
444
|
onDashboardItemClick: d
|
|
445
445
|
}) {
|
|
446
|
-
var
|
|
447
|
-
const { selectDashboard: c } = re(), m = ut(t.id), { userContext: E, isLoading: V } = le(), { mutate: w } = ht(), C = ((
|
|
446
|
+
var R, S;
|
|
447
|
+
const { selectDashboard: c } = re(), m = ut(t.id), { userContext: E, isLoading: V } = le(), { mutate: w } = ht(), C = ((R = E == null ? void 0 : E.permissions) == null ? void 0 : R.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: Q(
|
|
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
|
),
|
|
@@ -462,12 +462,12 @@ function Mt({
|
|
|
462
462
|
/* @__PURE__ */ e(Be, { 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,
|
|
469
469
|
{
|
|
470
|
-
className:
|
|
470
|
+
className: Q(
|
|
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
|
)
|
|
@@ -516,13 +516,13 @@ function Mt({
|
|
|
516
516
|
t.id
|
|
517
517
|
) });
|
|
518
518
|
}
|
|
519
|
-
function
|
|
519
|
+
function Ft({ onRetry: t }) {
|
|
520
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
|
|
525
|
+
function Mt(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
|
|
@@ -530,20 +530,20 @@ function Ft(t) {
|
|
|
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
|
+
), R = ne(
|
|
536
536
|
(s) => s.actions.clearSelectedDashboard
|
|
537
537
|
), { tokenProps: S, id: P } = ft();
|
|
538
|
-
|
|
538
|
+
Rt();
|
|
539
539
|
const {
|
|
540
540
|
resources: v,
|
|
541
541
|
isLoading: p,
|
|
542
542
|
isError: z,
|
|
543
|
-
isFetching:
|
|
544
|
-
updateResource:
|
|
545
|
-
deleteResource:
|
|
546
|
-
duplicateResource:
|
|
543
|
+
isFetching: X,
|
|
544
|
+
updateResource: F,
|
|
545
|
+
deleteResource: q,
|
|
546
|
+
duplicateResource: K,
|
|
547
547
|
isUpdating: k,
|
|
548
548
|
isDeleting: O,
|
|
549
549
|
isDuplicating: ee,
|
|
@@ -551,8 +551,8 @@ function Ft(t) {
|
|
|
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 ?
|
|
555
|
-
}), { currentUser: B, userContext:
|
|
554
|
+
m(null), (A == null ? void 0 : A.id) === s && (!(S != null && S.dashboard_id) && !P ? R() : L && L.id !== s && j(L));
|
|
555
|
+
}), { currentUser: B, userContext: M } = le(), G = ((xe = M == null ? void 0 : M.permissions) == null ? void 0 : xe.canCreateDashboard) ?? !1, { data: b } = gt(), W = ((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
|
+
}, T = () => {
|
|
569
|
+
c && q(c.id);
|
|
570
570
|
}, l = (s) => {
|
|
571
|
-
V(s),
|
|
571
|
+
V(s), K(s, {
|
|
572
572
|
onSettled: () => V(null)
|
|
573
573
|
});
|
|
574
574
|
}, {
|
|
575
|
-
startUpdating:
|
|
576
|
-
stopUpdating:
|
|
577
|
-
isUpdating:
|
|
575
|
+
startUpdating: Y,
|
|
576
|
+
stopUpdating: Z,
|
|
577
|
+
isUpdating: $
|
|
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), 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
|
+
}, Je = (s) => {
|
|
615
615
|
N(s), B == null || B.type, D(!0);
|
|
616
|
-
},
|
|
616
|
+
}, qe = (s) => {
|
|
617
617
|
r == null || r(s.id), C(s);
|
|
618
|
-
},
|
|
618
|
+
}, We = () => {
|
|
619
619
|
C(null);
|
|
620
|
-
},
|
|
620
|
+
}, Ye = ({
|
|
621
621
|
title: s,
|
|
622
622
|
description: U
|
|
623
623
|
}) => {
|
|
@@ -630,24 +630,24 @@ function Ft(t) {
|
|
|
630
630
|
}
|
|
631
631
|
});
|
|
632
632
|
};
|
|
633
|
-
return p ? /* @__PURE__ */ e(
|
|
633
|
+
return p ? /* @__PURE__ */ e(Ge, {}) : 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" : 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
642
|
isDeleting: O,
|
|
643
643
|
isDuplicating: E === s.id,
|
|
644
|
-
isDefault: s.id ===
|
|
644
|
+
isDefault: s.id === W,
|
|
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: Je,
|
|
651
651
|
formatDate: de,
|
|
652
652
|
onDashboardItemClick: o
|
|
653
653
|
},
|
|
@@ -664,13 +664,13 @@ function Ft(t) {
|
|
|
664
664
|
}
|
|
665
665
|
),
|
|
666
666
|
/* @__PURE__ */ e(
|
|
667
|
-
|
|
667
|
+
Re,
|
|
668
668
|
{
|
|
669
669
|
open: y,
|
|
670
670
|
onOpenChange: (s) => {
|
|
671
671
|
!s && O || (d(s), s || m(null));
|
|
672
672
|
},
|
|
673
|
-
children: /* @__PURE__ */ a(
|
|
673
|
+
children: /* @__PURE__ */ a(Te, { children: [
|
|
674
674
|
/* @__PURE__ */ a(Oe, { children: [
|
|
675
675
|
/* @__PURE__ */ e(Pe, { children: "Delete Dashboard" }),
|
|
676
676
|
/* @__PURE__ */ a(Ue, { children: [
|
|
@@ -680,12 +680,12 @@ function Ft(t) {
|
|
|
680
680
|
] })
|
|
681
681
|
] }),
|
|
682
682
|
/* @__PURE__ */ a(Ie, { children: [
|
|
683
|
-
/* @__PURE__ */ e(
|
|
683
|
+
/* @__PURE__ */ e(je, { disabled: O, children: "Cancel" }),
|
|
684
684
|
/* @__PURE__ */ a(
|
|
685
|
-
|
|
685
|
+
Fe,
|
|
686
686
|
{
|
|
687
687
|
onClick: (s) => {
|
|
688
|
-
s.preventDefault(), s.stopPropagation(),
|
|
688
|
+
s.preventDefault(), s.stopPropagation(), T();
|
|
689
689
|
},
|
|
690
690
|
className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
691
691
|
disabled: O,
|
|
@@ -706,9 +706,9 @@ 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: We,
|
|
710
|
+
onSave: Ye,
|
|
711
|
+
isSaving: $(w.id)
|
|
712
712
|
}
|
|
713
713
|
)
|
|
714
714
|
] });
|
|
@@ -788,33 +788,33 @@ function zt({
|
|
|
788
788
|
] })
|
|
789
789
|
] }) });
|
|
790
790
|
}
|
|
791
|
-
function
|
|
791
|
+
function Jt({
|
|
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
|
|
798
|
+
var M, 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: E } = le(), V = ((
|
|
801
|
+
), [D, i] = x(!1), [N, 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 } = Ke(), {
|
|
804
804
|
createResource: A,
|
|
805
|
-
isCreating:
|
|
806
|
-
refetch:
|
|
805
|
+
isCreating: j,
|
|
806
|
+
refetch: R
|
|
807
807
|
} = _e(), { createResource: S, isCreating: P } = ye(
|
|
808
808
|
void 0,
|
|
809
809
|
// onDeleteSuccess (not needed here)
|
|
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(), z = ((m == null ? void 0 : m.email) ?? "").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", q = ((G = F.charAt(0)) == null ? void 0 : G.toUpperCase()) || "?", K = z && z.toLowerCase() !== "undefined" ? z : "", k = Ot(f, {
|
|
814
814
|
enabled: t && v
|
|
815
|
-
}), O =
|
|
815
|
+
}), O = Q(
|
|
816
816
|
"flex h-full flex-col border-r bg-background",
|
|
817
|
-
v ?
|
|
817
|
+
v ? Q(
|
|
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",
|
|
@@ -824,8 +824,8 @@ function Kt({
|
|
|
824
824
|
console.log("Editing dashboard:", b);
|
|
825
825
|
}, B = (b) => {
|
|
826
826
|
A(b, {
|
|
827
|
-
onSuccess: (
|
|
828
|
-
i(!1), w(
|
|
827
|
+
onSuccess: (W) => {
|
|
828
|
+
i(!1), w(W, R);
|
|
829
829
|
}
|
|
830
830
|
});
|
|
831
831
|
};
|
|
@@ -868,7 +868,7 @@ function Kt({
|
|
|
868
868
|
) })
|
|
869
869
|
] }),
|
|
870
870
|
/* @__PURE__ */ e("div", { className: "flex flex-1 flex-col overflow-auto px-2 py-2", children: g ? /* @__PURE__ */ e(It, { searchQuery: N }) : /* @__PURE__ */ e(
|
|
871
|
-
|
|
871
|
+
Mt,
|
|
872
872
|
{
|
|
873
873
|
searchQuery: N,
|
|
874
874
|
onLoadDashboard: ee,
|
|
@@ -876,19 +876,19 @@ function Kt({
|
|
|
876
876
|
onDashboardItemClick: r
|
|
877
877
|
}
|
|
878
878
|
) }),
|
|
879
|
-
m && /* @__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
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:
|
|
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: 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: F }),
|
|
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
|
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,
|
|
@@ -904,11 +904,11 @@ function Kt({
|
|
|
904
904
|
open: D,
|
|
905
905
|
onOpenChange: i,
|
|
906
906
|
onSubmit: B,
|
|
907
|
-
isCreating:
|
|
907
|
+
isCreating: j
|
|
908
908
|
}
|
|
909
909
|
)
|
|
910
910
|
] }) });
|
|
911
911
|
}
|
|
912
912
|
export {
|
|
913
|
-
|
|
913
|
+
Jt as ResourceManagementPanel
|
|
914
914
|
};
|