react-semaphor 0.1.131 → 0.1.133
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-CLmhjguK.js → dashboard-controls-C1rIPoLI.js} +1 -1
- package/dist/chunks/{dashboard-controls-B2o_Ml98.js → dashboard-controls-YCOwB4c7.js} +207 -207
- package/dist/chunks/{dashboard-export-dialog-DwkHS7L_.js → dashboard-export-dialog-BpjTGwvL.js} +31 -31
- package/dist/chunks/{dashboard-export-dialog-Ch0ElsMI.js → dashboard-export-dialog-CsU5-_Nc.js} +1 -1
- package/dist/chunks/{dashboard-json-DawmOBwK.js → dashboard-json-BwJ6kZV2.js} +1 -1
- package/dist/chunks/{dashboard-json-BPO_6NQh.js → dashboard-json-DDxHEaDO.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-CE0f3H3D.js → edit-dashboard-visual-BoV4X2or.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-VH55I2qe.js → edit-dashboard-visual-DdK_bxBz.js} +191 -191
- package/dist/chunks/{editor-action-buttons-BCRzk-0n.js → editor-action-buttons-CK2siDBM.js} +2 -2
- package/dist/chunks/{editor-action-buttons-BCX2a6QA.js → editor-action-buttons-CmA0eoCZ.js} +1 -1
- package/dist/chunks/{index-D3VnAyrW.js → index-BCmbfOd2.js} +21 -21
- package/dist/chunks/{index-BiG_2DRk.js → index-DilTtW4W.js} +172 -164
- package/dist/chunks/{resource-management-panel-CFSAxmG5.js → resource-management-panel-Bt1zi1Yb.js} +116 -116
- package/dist/chunks/{resource-management-panel-DAc7CcYm.js → resource-management-panel-Fs9hg3pC.js} +1 -1
- package/dist/chunks/{use-visual-utils-iLF6cWs6.js → use-visual-utils-Cjv_OnmO.js} +1 -1
- package/dist/chunks/{use-visual-utils-_KE2a0K6.js → use-visual-utils-CzQAEa-2.js} +1 -1
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +30 -29
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +1 -1
- package/dist/types/main.d.ts +11 -0
- package/package.json +1 -1
package/dist/chunks/{resource-management-panel-CFSAxmG5.js → resource-management-panel-Bt1zi1Yb.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as e, jsxs as a, Fragment as me } from "react/jsx-runtime";
|
|
2
|
-
import { b as
|
|
2
|
+
import { b as We, u as de, f as qe, ao as ne, b5 as Je, b6 as Qe, c as ee, b7 as Ye, aG as Xe, aH as Ze, B as G, aI as $e, aJ as ke, aK as Q, b8 as ce, L as ie, b9 as et, ba as tt, bb as st, bc as Ne, bd as pe, be as at, bf as nt, I as it, bg as we, bh as re, bi as ye, bj as Ce, bk as rt, K as ve, R as Se, bl as Ve, aO as Ee, aP as Le, aQ as Te, aS as Ae, aT as Oe, aU as Pe, aV as Re, aW as Ie, bm as ot, bn as lt, bo as Ue, bp as je, bq as Me, br as dt, bs as Fe, bt as ct, aE as ae, an as ut, bu as ht, bv as Be, bw as mt, bx as pt, as as ft, at as gt, au as Dt, av as xt, aw as Nt, ax as be, ay as ue, aB as bt, by as wt, bz as yt, bA as Ct, bB as vt } from "./index-DilTtW4W.js";
|
|
3
3
|
import St, { useState as g, useEffect as he } from "react";
|
|
4
|
-
import { a as
|
|
4
|
+
import { a as ze } from "./use-visual-utils-CzQAEa-2.js";
|
|
5
5
|
import { u as Vt } from "./use-click-outside-CMeO_QFI.js";
|
|
6
6
|
/**
|
|
7
7
|
* @license lucide-react v0.453.0 - ISC
|
|
@@ -9,7 +9,7 @@ import { u as Vt } from "./use-click-outside-CMeO_QFI.js";
|
|
|
9
9
|
* This source code is licensed under the ISC license.
|
|
10
10
|
* See the LICENSE file in the root directory of this source tree.
|
|
11
11
|
*/
|
|
12
|
-
const Et =
|
|
12
|
+
const Et = We("FolderOpen", [
|
|
13
13
|
[
|
|
14
14
|
"path",
|
|
15
15
|
{
|
|
@@ -38,7 +38,7 @@ const Lt = (t) => {
|
|
|
38
38
|
const f = de((r) => r.isVisualEditing), p = de((r) => r.selectedFrameId), i = qe((r) => r.frame);
|
|
39
39
|
return !!(f && p && (i == null ? void 0 : i.visualId) === t);
|
|
40
40
|
};
|
|
41
|
-
function
|
|
41
|
+
function Tt({
|
|
42
42
|
visual: t,
|
|
43
43
|
isDeleting: f,
|
|
44
44
|
isDuplicating: p,
|
|
@@ -51,10 +51,10 @@ function At({
|
|
|
51
51
|
onShareVisual: N,
|
|
52
52
|
formatDate: S
|
|
53
53
|
}) {
|
|
54
|
-
var P,
|
|
55
|
-
const { selectVisual: l } = ne(), d =
|
|
54
|
+
var P, v, y, A;
|
|
55
|
+
const { selectVisual: l } = ne(), d = Je(t.id), h = Lt(t.id), { isConsoleMode: V } = Qe(), E = St.useRef(null), [b, C] = g(!1), [L, T] = g(!1);
|
|
56
56
|
he(() => {
|
|
57
|
-
p ? (
|
|
57
|
+
p ? (C(!0), T(!0)) : L && (C(!1), T(!1));
|
|
58
58
|
}, [p, L]), he(() => {
|
|
59
59
|
h && E.current && E.current.scrollIntoView({
|
|
60
60
|
behavior: "smooth",
|
|
@@ -74,7 +74,7 @@ function At({
|
|
|
74
74
|
),
|
|
75
75
|
onClick: I,
|
|
76
76
|
children: [
|
|
77
|
-
/* @__PURE__ */ e(
|
|
77
|
+
/* @__PURE__ */ e(Ye, { className: "mt-0.5 h-4 w-4 flex-shrink-0 text-muted-foreground/50" }),
|
|
78
78
|
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ a("div", { className: "flex items-start justify-between gap-2", children: [
|
|
79
79
|
/* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
|
|
80
80
|
/* @__PURE__ */ e(
|
|
@@ -105,12 +105,12 @@ function At({
|
|
|
105
105
|
{
|
|
106
106
|
modal: !1,
|
|
107
107
|
open: b,
|
|
108
|
-
onOpenChange:
|
|
108
|
+
onOpenChange: C,
|
|
109
109
|
children: [
|
|
110
|
-
/* @__PURE__ */ e(Ze, { asChild: !0, children: /* @__PURE__ */ e(
|
|
110
|
+
/* @__PURE__ */ e(Ze, { asChild: !0, children: /* @__PURE__ */ e(G, { size: "sm", variant: "ghost", className: "h-6 w-6 p-0", children: /* @__PURE__ */ e($e, { className: "h-3 w-3" }) }) }),
|
|
111
111
|
/* @__PURE__ */ a(ke, { align: "end", className: "z-[51] w-40", children: [
|
|
112
112
|
/* @__PURE__ */ a(
|
|
113
|
-
|
|
113
|
+
Q,
|
|
114
114
|
{
|
|
115
115
|
onClick: (c) => {
|
|
116
116
|
c.stopPropagation(), i(t);
|
|
@@ -122,7 +122,7 @@ function At({
|
|
|
122
122
|
}
|
|
123
123
|
),
|
|
124
124
|
/* @__PURE__ */ a(
|
|
125
|
-
|
|
125
|
+
Q,
|
|
126
126
|
{
|
|
127
127
|
onClick: (c) => {
|
|
128
128
|
c.stopPropagation(), r == null || r(t);
|
|
@@ -134,7 +134,7 @@ function At({
|
|
|
134
134
|
}
|
|
135
135
|
),
|
|
136
136
|
/* @__PURE__ */ a(
|
|
137
|
-
|
|
137
|
+
Q,
|
|
138
138
|
{
|
|
139
139
|
onClick: (c) => {
|
|
140
140
|
c.preventDefault(), c.stopPropagation(), m(t.id);
|
|
@@ -148,7 +148,7 @@ function At({
|
|
|
148
148
|
),
|
|
149
149
|
t.ownership.isOwner && /* @__PURE__ */ a(me, { children: [
|
|
150
150
|
/* @__PURE__ */ a(
|
|
151
|
-
|
|
151
|
+
Q,
|
|
152
152
|
{
|
|
153
153
|
onClick: (c) => {
|
|
154
154
|
c.stopPropagation(), D == null || D(t);
|
|
@@ -160,7 +160,7 @@ function At({
|
|
|
160
160
|
}
|
|
161
161
|
),
|
|
162
162
|
/* @__PURE__ */ a(
|
|
163
|
-
|
|
163
|
+
Q,
|
|
164
164
|
{
|
|
165
165
|
onClick: (c) => {
|
|
166
166
|
c.stopPropagation(), N(t);
|
|
@@ -173,7 +173,7 @@ function At({
|
|
|
173
173
|
),
|
|
174
174
|
/* @__PURE__ */ e(Ne, {}),
|
|
175
175
|
/* @__PURE__ */ a(
|
|
176
|
-
|
|
176
|
+
Q,
|
|
177
177
|
{
|
|
178
178
|
onClick: (c) => {
|
|
179
179
|
c.stopPropagation(), x(t);
|
|
@@ -189,9 +189,9 @@ function At({
|
|
|
189
189
|
] }),
|
|
190
190
|
/* @__PURE__ */ e(Ne, {}),
|
|
191
191
|
/* @__PURE__ */ a("div", { className: "space-y-1 px-2 py-2 text-xs text-slate-500 dark:text-slate-400", children: [
|
|
192
|
-
(((
|
|
192
|
+
(((v = t.ownership.createdBy) == null ? void 0 : v.type) === "tenant" || ((y = t.ownership.createdBy) == null ? void 0 : y.type) === "organization" && V) && /* @__PURE__ */ a("div", { className: "flex items-center gap-1", children: [
|
|
193
193
|
/* @__PURE__ */ e(at, { className: "h-3 w-3" }),
|
|
194
|
-
/* @__PURE__ */ e("span", { children: ((
|
|
194
|
+
/* @__PURE__ */ e("span", { children: ((A = t.ownership.createdBy) == null ? void 0 : A.name) || "Unknown" })
|
|
195
195
|
] }),
|
|
196
196
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-1", children: [
|
|
197
197
|
/* @__PURE__ */ e(nt, { className: "h-3 w-3" }),
|
|
@@ -226,24 +226,24 @@ function At({
|
|
|
226
226
|
t.id
|
|
227
227
|
);
|
|
228
228
|
}
|
|
229
|
-
function
|
|
229
|
+
function At({ searchQuery: t }) {
|
|
230
230
|
const [f, p] = g(!1), [i, r] = g(
|
|
231
231
|
null
|
|
232
232
|
), [D, x] = g(!1), [m, N] = g(null), [S, l] = g(null), [d, h] = g(
|
|
233
233
|
null
|
|
234
|
-
), { selectVisual: V } = ne(), { handleEditLibraryVisual: E, handleAddLibraryVisual: b } =
|
|
235
|
-
resources:
|
|
234
|
+
), { selectVisual: V } = ne(), { handleEditLibraryVisual: E, handleAddLibraryVisual: b } = ze(), {
|
|
235
|
+
resources: C,
|
|
236
236
|
isLoading: L,
|
|
237
|
-
isError:
|
|
237
|
+
isError: T,
|
|
238
238
|
updateResource: I,
|
|
239
239
|
deleteResource: P,
|
|
240
|
-
duplicateResource:
|
|
241
|
-
isDeleting:
|
|
240
|
+
duplicateResource: v,
|
|
241
|
+
isDeleting: y
|
|
242
242
|
} = we(() => {
|
|
243
243
|
x(!1), N(null);
|
|
244
244
|
});
|
|
245
245
|
re();
|
|
246
|
-
const
|
|
246
|
+
const A = C.filter(
|
|
247
247
|
(n) => {
|
|
248
248
|
var O, o;
|
|
249
249
|
return ((O = n == null ? void 0 : n.title) == null ? void 0 : O.toLowerCase().includes(t.toLowerCase())) || ((o = n == null ? void 0 : n.description) == null ? void 0 : o.toLowerCase().includes(t.toLowerCase()));
|
|
@@ -254,40 +254,40 @@ function Tt({ searchQuery: t }) {
|
|
|
254
254
|
year: "numeric"
|
|
255
255
|
}), M = (n) => {
|
|
256
256
|
N(n), x(!0);
|
|
257
|
-
},
|
|
257
|
+
}, Y = () => {
|
|
258
258
|
m && P(m.id);
|
|
259
259
|
}, {
|
|
260
260
|
startUpdating: F,
|
|
261
|
-
stopUpdating:
|
|
261
|
+
stopUpdating: W,
|
|
262
262
|
isUpdating: R
|
|
263
|
-
} =
|
|
263
|
+
} = ye(), B = (n, O, o) => {
|
|
264
264
|
var se;
|
|
265
|
-
const
|
|
265
|
+
const J = Object.fromEntries(
|
|
266
266
|
Object.entries(O).filter(([, j]) => j !== void 0)
|
|
267
267
|
);
|
|
268
|
-
if (Object.keys(
|
|
268
|
+
if (Object.keys(J).length === 0) {
|
|
269
269
|
(se = o == null ? void 0 : o.onSuccess) == null || se.call(o);
|
|
270
270
|
return;
|
|
271
271
|
}
|
|
272
|
-
const te = Object.keys(
|
|
272
|
+
const te = Object.keys(J), k = te.length === 1 ? te[0] : void 0;
|
|
273
273
|
F(n, k), I(
|
|
274
274
|
{
|
|
275
275
|
resourceId: n,
|
|
276
|
-
data:
|
|
276
|
+
data: J
|
|
277
277
|
},
|
|
278
278
|
{
|
|
279
279
|
onSuccess: () => {
|
|
280
280
|
var j;
|
|
281
|
-
|
|
281
|
+
W(n, k), (j = o == null ? void 0 : o.onSuccess) == null || j.call(o);
|
|
282
282
|
},
|
|
283
283
|
onError: () => {
|
|
284
284
|
var j;
|
|
285
|
-
|
|
285
|
+
W(n, k), (j = o == null ? void 0 : o.onError) == null || j.call(o);
|
|
286
286
|
}
|
|
287
287
|
}
|
|
288
288
|
);
|
|
289
|
-
},
|
|
290
|
-
l(n),
|
|
289
|
+
}, z = (n) => {
|
|
290
|
+
l(n), v(n, {
|
|
291
291
|
onSettled: () => l(null)
|
|
292
292
|
});
|
|
293
293
|
}, X = (n) => {
|
|
@@ -295,7 +295,7 @@ function Tt({ searchQuery: t }) {
|
|
|
295
295
|
}, H = (n) => {
|
|
296
296
|
b(n);
|
|
297
297
|
}, Z = (n) => {
|
|
298
|
-
const O =
|
|
298
|
+
const O = C.find((o) => o.id === n);
|
|
299
299
|
O && I({
|
|
300
300
|
resourceId: n,
|
|
301
301
|
data: {
|
|
@@ -315,16 +315,16 @@ function Tt({ searchQuery: t }) {
|
|
|
315
315
|
if (!d)
|
|
316
316
|
return;
|
|
317
317
|
const o = {};
|
|
318
|
-
n !== d.title && (o.title = n), (d.description || "") !== O && (o.description = O),
|
|
318
|
+
n !== d.title && (o.title = n), (d.description || "") !== O && (o.description = O), B(d.id, o, {
|
|
319
319
|
onSuccess: () => {
|
|
320
320
|
h(null);
|
|
321
321
|
}
|
|
322
322
|
});
|
|
323
323
|
};
|
|
324
|
-
return L ? /* @__PURE__ */ e(He, {}) :
|
|
324
|
+
return L ? /* @__PURE__ */ e(He, {}) : T ? /* @__PURE__ */ e(Ce, { className: "w-full flex-1 pr-2", children: /* @__PURE__ */ a("div", { className: "py-8 text-center text-muted-foreground", children: [
|
|
325
325
|
/* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: "Failed to load visuals" }),
|
|
326
326
|
/* @__PURE__ */ e(
|
|
327
|
-
|
|
327
|
+
G,
|
|
328
328
|
{
|
|
329
329
|
variant: "outline",
|
|
330
330
|
size: "sm",
|
|
@@ -334,29 +334,29 @@ function Tt({ searchQuery: t }) {
|
|
|
334
334
|
}
|
|
335
335
|
)
|
|
336
336
|
] }) }) : /* @__PURE__ */ a("div", { className: "flex h-full flex-1 flex-col", children: [
|
|
337
|
-
/* @__PURE__ */ e("div", { className: "flex flex-1 basis-0 flex-col gap-3 overflow-y-auto", children:
|
|
337
|
+
/* @__PURE__ */ e("div", { className: "flex flex-1 basis-0 flex-col gap-3 overflow-y-auto", children: A.length === 0 ? /* @__PURE__ */ a("div", { className: "py-8 text-center", children: [
|
|
338
338
|
/* @__PURE__ */ e("div", { className: "mb-3", children: /* @__PURE__ */ e(rt, { className: "mx-auto h-12 w-12 text-muted-foreground/50" }) }),
|
|
339
339
|
/* @__PURE__ */ e("h3", { className: "mb-1 font-medium text-foreground", children: t ? "No visuals found" : "No visuals yet" }),
|
|
340
340
|
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: t ? "Try adjusting your search" : 'Click "Create" above to add your first visual' })
|
|
341
|
-
] }) :
|
|
342
|
-
|
|
341
|
+
] }) : A.map((n) => /* @__PURE__ */ e(
|
|
342
|
+
Tt,
|
|
343
343
|
{
|
|
344
344
|
visual: n,
|
|
345
345
|
onAddVisual: H,
|
|
346
346
|
onOpenVisual: X,
|
|
347
347
|
onEditDetails: q,
|
|
348
348
|
onDeleteClick: M,
|
|
349
|
-
onDuplicateVisual:
|
|
349
|
+
onDuplicateVisual: z,
|
|
350
350
|
onTogglePrivacy: Z,
|
|
351
351
|
onShareVisual: _,
|
|
352
|
-
isDeleting:
|
|
352
|
+
isDeleting: y,
|
|
353
353
|
isDuplicating: S === n.id,
|
|
354
354
|
formatDate: c
|
|
355
355
|
},
|
|
356
356
|
n.id
|
|
357
357
|
)) }),
|
|
358
358
|
f && i && /* @__PURE__ */ e(
|
|
359
|
-
|
|
359
|
+
ve,
|
|
360
360
|
{
|
|
361
361
|
resource: i,
|
|
362
362
|
resourceType: Se.VISUAL,
|
|
@@ -382,11 +382,11 @@ function Tt({ searchQuery: t }) {
|
|
|
382
382
|
{
|
|
383
383
|
open: D,
|
|
384
384
|
onOpenChange: (n) => {
|
|
385
|
-
!n &&
|
|
385
|
+
!n && y || (x(n), n || N(null));
|
|
386
386
|
},
|
|
387
387
|
children: /* @__PURE__ */ a(Le, { children: [
|
|
388
|
-
/* @__PURE__ */ a(
|
|
389
|
-
/* @__PURE__ */ e(
|
|
388
|
+
/* @__PURE__ */ a(Te, { children: [
|
|
389
|
+
/* @__PURE__ */ e(Ae, { children: "Delete Visual" }),
|
|
390
390
|
/* @__PURE__ */ a(Oe, { children: [
|
|
391
391
|
'Are you sure you want to delete "',
|
|
392
392
|
m == null ? void 0 : m.title,
|
|
@@ -394,18 +394,18 @@ function Tt({ searchQuery: t }) {
|
|
|
394
394
|
] })
|
|
395
395
|
] }),
|
|
396
396
|
/* @__PURE__ */ a(Pe, { children: [
|
|
397
|
-
/* @__PURE__ */ e(Re, { disabled:
|
|
397
|
+
/* @__PURE__ */ e(Re, { disabled: y, children: "Cancel" }),
|
|
398
398
|
/* @__PURE__ */ a(
|
|
399
399
|
Ie,
|
|
400
400
|
{
|
|
401
401
|
onClick: (n) => {
|
|
402
|
-
n.preventDefault(), n.stopPropagation(),
|
|
402
|
+
n.preventDefault(), n.stopPropagation(), Y();
|
|
403
403
|
},
|
|
404
404
|
className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
405
|
-
disabled:
|
|
405
|
+
disabled: y,
|
|
406
406
|
children: [
|
|
407
|
-
|
|
408
|
-
|
|
407
|
+
y ? /* @__PURE__ */ e(ie, { className: "mr-2 h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(pe, { className: "mr-2 h-3.5 w-3.5" }),
|
|
408
|
+
y ? "Deleting..." : "Delete"
|
|
409
409
|
]
|
|
410
410
|
}
|
|
411
411
|
)
|
|
@@ -428,11 +428,11 @@ function Ot({
|
|
|
428
428
|
formatDate: S,
|
|
429
429
|
onDashboardItemClick: l
|
|
430
430
|
}) {
|
|
431
|
-
var P,
|
|
432
|
-
const { selectDashboard: d } = ne(), h = ot(t.id), { userContext: V, isLoading: E } = re(), { mutate: b } = lt(),
|
|
431
|
+
var P, v;
|
|
432
|
+
const { selectDashboard: d } = ne(), h = ot(t.id), { userContext: V, isLoading: E } = re(), { mutate: b } = lt(), C = ((P = V == null ? void 0 : V.permissions) == null ? void 0 : P.canEdit) ?? !1, L = E || !C, T = () => {
|
|
433
433
|
d(t), r(t.id), l == null || l(t.id);
|
|
434
|
-
}, I = (
|
|
435
|
-
|
|
434
|
+
}, I = (y) => {
|
|
435
|
+
y.stopPropagation(), b({ dashboardId: i ? null : t.id });
|
|
436
436
|
};
|
|
437
437
|
return /* @__PURE__ */ e(Ue, { children: /* @__PURE__ */ a(
|
|
438
438
|
"div",
|
|
@@ -441,7 +441,7 @@ function Ot({
|
|
|
441
441
|
"group flex cursor-pointer items-start gap-3 rounded-md px-2 py-2 transition-colors hover:bg-muted",
|
|
442
442
|
h && "bg-muted/80"
|
|
443
443
|
),
|
|
444
|
-
onClick:
|
|
444
|
+
onClick: T,
|
|
445
445
|
children: [
|
|
446
446
|
/* @__PURE__ */ a(je, { children: [
|
|
447
447
|
/* @__PURE__ */ e(Me, { asChild: !0, children: /* @__PURE__ */ e(
|
|
@@ -477,7 +477,7 @@ function Ot({
|
|
|
477
477
|
{
|
|
478
478
|
className: "truncate text-xs text-muted-foreground",
|
|
479
479
|
title: t.description || "No description",
|
|
480
|
-
children: (
|
|
480
|
+
children: (v = t.description) != null && v.trim() ? t.description : "No description"
|
|
481
481
|
}
|
|
482
482
|
)
|
|
483
483
|
] }),
|
|
@@ -502,38 +502,38 @@ function Ot({
|
|
|
502
502
|
) });
|
|
503
503
|
}
|
|
504
504
|
function Pt({ onRetry: t }) {
|
|
505
|
-
return /* @__PURE__ */ e(
|
|
505
|
+
return /* @__PURE__ */ e(Ce, { className: "w-full flex-1 pr-2", children: /* @__PURE__ */ a("div", { className: "py-8 text-center text-muted-foreground", children: [
|
|
506
506
|
/* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: "Failed to load dashboards" }),
|
|
507
|
-
/* @__PURE__ */ e(
|
|
507
|
+
/* @__PURE__ */ e(G, { variant: "outline", size: "sm", className: "mt-2", onClick: t, children: "Retry" })
|
|
508
508
|
] }) });
|
|
509
509
|
}
|
|
510
510
|
function Rt(t) {
|
|
511
511
|
var fe, ge;
|
|
512
512
|
const { searchQuery: f, onLoadDashboard: p, onEditDashboard: i, onDashboardItemClick: r } = t, [D, x] = g(!1), [m, N] = g(
|
|
513
513
|
null
|
|
514
|
-
), [S, l] = g(!1), [d, h] = g(null), [V, E] = g(null), [b,
|
|
514
|
+
), [S, l] = g(!1), [d, h] = g(null), [V, E] = g(null), [b, C] = g(null), L = ae(
|
|
515
515
|
(s) => s.lastSelectedDashboard
|
|
516
|
-
),
|
|
516
|
+
), T = ae(
|
|
517
517
|
(s) => s.selectedDashboard
|
|
518
518
|
), I = ae(
|
|
519
519
|
(s) => s.actions.selectDashboard
|
|
520
520
|
), P = ae(
|
|
521
521
|
(s) => s.actions.clearSelectedDashboard
|
|
522
|
-
), { tokenProps:
|
|
522
|
+
), { tokenProps: v, id: y } = ut();
|
|
523
523
|
ht();
|
|
524
524
|
const {
|
|
525
|
-
resources:
|
|
525
|
+
resources: A,
|
|
526
526
|
isLoading: c,
|
|
527
527
|
isError: M,
|
|
528
|
-
updateResource:
|
|
528
|
+
updateResource: Y,
|
|
529
529
|
deleteResource: F,
|
|
530
|
-
duplicateResource:
|
|
530
|
+
duplicateResource: W,
|
|
531
531
|
isDeleting: R
|
|
532
|
-
} =
|
|
532
|
+
} = Be(() => {
|
|
533
533
|
l(!1);
|
|
534
534
|
const s = d == null ? void 0 : d.id;
|
|
535
|
-
h(null), (
|
|
536
|
-
}), { currentUser:
|
|
535
|
+
h(null), (T == null ? void 0 : T.id) === s && (!(v != null && v.dashboard_id) && !y ? P() : L && L.id !== s && I(L));
|
|
536
|
+
}), { currentUser: B, userContext: z } = re(), X = ((fe = z == null ? void 0 : z.permissions) == null ? void 0 : fe.canCreateDashboard) ?? !1, { data: H } = mt(), Z = ((ge = H == null ? void 0 : H.preference) == null ? void 0 : ge.defaultDashboardId) || null, _ = A.filter(
|
|
537
537
|
(s) => {
|
|
538
538
|
var U, u;
|
|
539
539
|
return ((U = s == null ? void 0 : s.title) == null ? void 0 : U.toLowerCase().includes(f.toLowerCase())) || ((u = s == null ? void 0 : s.description) == null ? void 0 : u.toLowerCase().includes(f.toLowerCase()));
|
|
@@ -549,56 +549,56 @@ function Rt(t) {
|
|
|
549
549
|
}, n = () => {
|
|
550
550
|
d && F(d.id);
|
|
551
551
|
}, O = (s) => {
|
|
552
|
-
E(s),
|
|
552
|
+
E(s), W(s, {
|
|
553
553
|
onSettled: () => E(null)
|
|
554
554
|
});
|
|
555
555
|
}, {
|
|
556
556
|
startUpdating: o,
|
|
557
|
-
stopUpdating:
|
|
557
|
+
stopUpdating: J,
|
|
558
558
|
isUpdating: te
|
|
559
|
-
} =
|
|
559
|
+
} = ye(), k = (s, U, u) => {
|
|
560
560
|
var xe;
|
|
561
561
|
const oe = Object.fromEntries(
|
|
562
|
-
Object.entries(U).filter(([,
|
|
562
|
+
Object.entries(U).filter(([, K]) => K !== void 0)
|
|
563
563
|
);
|
|
564
564
|
if (Object.keys(oe).length === 0) {
|
|
565
565
|
(xe = u == null ? void 0 : u.onSuccess) == null || xe.call(u);
|
|
566
566
|
return;
|
|
567
567
|
}
|
|
568
568
|
const De = Object.keys(oe), le = De.length === 1 ? De[0] : void 0;
|
|
569
|
-
o(s, le),
|
|
569
|
+
o(s, le), Y(
|
|
570
570
|
{
|
|
571
571
|
resourceId: s,
|
|
572
572
|
data: oe
|
|
573
573
|
},
|
|
574
574
|
{
|
|
575
575
|
onSuccess: () => {
|
|
576
|
-
var
|
|
577
|
-
|
|
576
|
+
var K;
|
|
577
|
+
J(s, le), (K = u == null ? void 0 : u.onSuccess) == null || K.call(u);
|
|
578
578
|
},
|
|
579
579
|
onError: () => {
|
|
580
|
-
var
|
|
581
|
-
|
|
580
|
+
var K;
|
|
581
|
+
J(s, le), (K = u == null ? void 0 : u.onError) == null || K.call(u);
|
|
582
582
|
}
|
|
583
583
|
}
|
|
584
584
|
);
|
|
585
585
|
}, se = (s) => {
|
|
586
|
-
const U =
|
|
586
|
+
const U = A.find(
|
|
587
587
|
(u) => u.id === s
|
|
588
588
|
);
|
|
589
|
-
U &&
|
|
589
|
+
U && Y({
|
|
590
590
|
resourceId: s,
|
|
591
591
|
data: {
|
|
592
592
|
isPrivate: !U.isPrivate
|
|
593
593
|
}
|
|
594
594
|
});
|
|
595
595
|
}, j = (s) => {
|
|
596
|
-
N(s),
|
|
596
|
+
N(s), B == null || B.type, x(!0);
|
|
597
597
|
}, _e = (s) => {
|
|
598
|
-
i == null || i(s.id),
|
|
599
|
-
},
|
|
600
|
-
|
|
601
|
-
},
|
|
598
|
+
i == null || i(s.id), C(s);
|
|
599
|
+
}, Ke = () => {
|
|
600
|
+
C(null);
|
|
601
|
+
}, Ge = ({
|
|
602
602
|
title: s,
|
|
603
603
|
description: U
|
|
604
604
|
}) => {
|
|
@@ -607,7 +607,7 @@ function Rt(t) {
|
|
|
607
607
|
const u = {};
|
|
608
608
|
s !== b.title && (u.title = s), (b.description || "") !== U && (u.description = U), k(b.id, u, {
|
|
609
609
|
onSuccess: () => {
|
|
610
|
-
|
|
610
|
+
C(null);
|
|
611
611
|
}
|
|
612
612
|
});
|
|
613
613
|
};
|
|
@@ -635,7 +635,7 @@ function Rt(t) {
|
|
|
635
635
|
s.id
|
|
636
636
|
)) }),
|
|
637
637
|
D && m && /* @__PURE__ */ e(
|
|
638
|
-
|
|
638
|
+
ve,
|
|
639
639
|
{
|
|
640
640
|
resource: m,
|
|
641
641
|
resourceType: Se.DASHBOARD,
|
|
@@ -652,8 +652,8 @@ function Rt(t) {
|
|
|
652
652
|
!s && R || (l(s), s || h(null));
|
|
653
653
|
},
|
|
654
654
|
children: /* @__PURE__ */ a(Le, { children: [
|
|
655
|
-
/* @__PURE__ */ a(
|
|
656
|
-
/* @__PURE__ */ e(
|
|
655
|
+
/* @__PURE__ */ a(Te, { children: [
|
|
656
|
+
/* @__PURE__ */ e(Ae, { children: "Delete Dashboard" }),
|
|
657
657
|
/* @__PURE__ */ a(Oe, { children: [
|
|
658
658
|
'Are you sure you want to delete "',
|
|
659
659
|
d == null ? void 0 : d.title,
|
|
@@ -687,8 +687,8 @@ function Rt(t) {
|
|
|
687
687
|
resourceLabel: "Dashboard",
|
|
688
688
|
initialTitle: b.title || "",
|
|
689
689
|
initialDescription: b.description || "",
|
|
690
|
-
onClose:
|
|
691
|
-
onSave:
|
|
690
|
+
onClose: Ke,
|
|
691
|
+
onSave: Ge,
|
|
692
692
|
isSaving: te(b.id)
|
|
693
693
|
}
|
|
694
694
|
)
|
|
@@ -747,7 +747,7 @@ function It({
|
|
|
747
747
|
] }),
|
|
748
748
|
/* @__PURE__ */ a(bt, { children: [
|
|
749
749
|
/* @__PURE__ */ e(
|
|
750
|
-
|
|
750
|
+
G,
|
|
751
751
|
{
|
|
752
752
|
variant: "outline",
|
|
753
753
|
onClick: () => S(!1),
|
|
@@ -756,7 +756,7 @@ function It({
|
|
|
756
756
|
}
|
|
757
757
|
),
|
|
758
758
|
/* @__PURE__ */ e(
|
|
759
|
-
|
|
759
|
+
G,
|
|
760
760
|
{
|
|
761
761
|
onClick: N,
|
|
762
762
|
disabled: !r.trim() || i,
|
|
@@ -769,7 +769,7 @@ function It({
|
|
|
769
769
|
] })
|
|
770
770
|
] }) });
|
|
771
771
|
}
|
|
772
|
-
function
|
|
772
|
+
function zt({
|
|
773
773
|
isOpen: t,
|
|
774
774
|
onClose: f,
|
|
775
775
|
className: p,
|
|
@@ -781,21 +781,21 @@ function Bt({
|
|
|
781
781
|
(w) => w.isDashboardEditing
|
|
782
782
|
), [x, m] = g(!1), [N, S] = g(""), [l, d] = g(!1), { currentUser: h, userContext: V } = re(), E = ((_ = V == null ? void 0 : V.permissions) == null ? void 0 : _.canCreateDashboard) ?? !1, { onCreateSuccess: b } = wt({
|
|
783
783
|
onDashboardSelect: i
|
|
784
|
-
}), { selectVisual:
|
|
785
|
-
createResource:
|
|
784
|
+
}), { selectVisual: C } = ne(), { handleEditLibraryVisual: L } = ze(), {
|
|
785
|
+
createResource: T,
|
|
786
786
|
isCreating: I,
|
|
787
787
|
refetch: P
|
|
788
|
-
} =
|
|
788
|
+
} = Be(), { createResource: v, isCreating: y } = we(
|
|
789
789
|
void 0,
|
|
790
790
|
// onDeleteSuccess (not needed here)
|
|
791
791
|
(w) => {
|
|
792
|
-
m(!1), w && (
|
|
792
|
+
m(!1), w && (C(w), L(w));
|
|
793
793
|
}
|
|
794
|
-
),
|
|
795
|
-
enabled: t &&
|
|
796
|
-
}),
|
|
794
|
+
), A = r === "overlay", c = ((h == null ? void 0 : h.name) ?? "").trim(), M = ((h == null ? void 0 : h.email) ?? "").trim(), F = c && c.toLowerCase() !== "undefined" ? c : M || "Current user", W = ((q = F.charAt(0)) == null ? void 0 : q.toUpperCase()) || "?", R = M && M.toLowerCase() !== "undefined" ? M : "", B = Vt(f, {
|
|
795
|
+
enabled: t && A
|
|
796
|
+
}), z = ee(
|
|
797
797
|
"flex h-full flex-col border-r bg-background",
|
|
798
|
-
|
|
798
|
+
A ? ee(
|
|
799
799
|
"absolute inset-y-0 left-0 z-[51] w-60 shadow-lg transition-transform duration-300 ease-in-out",
|
|
800
800
|
t ? "translate-x-0" : "pointer-events-none -translate-x-full"
|
|
801
801
|
) : "w-full max-w-[17rem] min-w-[11rem] overflow-hidden shadow-sm",
|
|
@@ -804,29 +804,29 @@ function Bt({
|
|
|
804
804
|
}, H = (w) => {
|
|
805
805
|
console.log("Editing dashboard:", w);
|
|
806
806
|
}, Z = (w) => {
|
|
807
|
-
|
|
807
|
+
T(w, {
|
|
808
808
|
onSuccess: ($) => {
|
|
809
809
|
m(!1), b($, P);
|
|
810
810
|
}
|
|
811
811
|
});
|
|
812
812
|
};
|
|
813
|
-
return /* @__PURE__ */ e(me, { children: (!
|
|
813
|
+
return /* @__PURE__ */ e(me, { children: (!A || t) && /* @__PURE__ */ a("div", { ref: B, className: z, children: [
|
|
814
814
|
/* @__PURE__ */ a("div", { className: "border-b border-border", children: [
|
|
815
815
|
/* @__PURE__ */ a("div", { className: "flex items-center justify-between px-4 py-1.5", children: [
|
|
816
816
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e("h2", { className: "whitespace-nowrap text-sm font-semibold", children: D ? "Visuals" : "Dashboards" }) }),
|
|
817
817
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-0", children: [
|
|
818
818
|
/* @__PURE__ */ e(
|
|
819
|
-
|
|
819
|
+
G,
|
|
820
820
|
{
|
|
821
821
|
size: "sm",
|
|
822
822
|
variant: "ghost",
|
|
823
823
|
onClick: () => d(!l),
|
|
824
824
|
className: "h-8 w-8 p-0",
|
|
825
|
-
children: /* @__PURE__ */ e(
|
|
825
|
+
children: /* @__PURE__ */ e(yt, { className: "h-3.5 w-3.5" })
|
|
826
826
|
}
|
|
827
827
|
),
|
|
828
828
|
(D || E) && /* @__PURE__ */ e(
|
|
829
|
-
|
|
829
|
+
G,
|
|
830
830
|
{
|
|
831
831
|
size: "sm",
|
|
832
832
|
variant: "ghost",
|
|
@@ -848,7 +848,7 @@ function Bt({
|
|
|
848
848
|
}
|
|
849
849
|
) })
|
|
850
850
|
] }),
|
|
851
|
-
/* @__PURE__ */ e("div", { className: "flex flex-1 flex-col overflow-auto px-2 py-2", children: D ? /* @__PURE__ */ e(
|
|
851
|
+
/* @__PURE__ */ e("div", { className: "flex flex-1 flex-col overflow-auto px-2 py-2", children: D ? /* @__PURE__ */ e(At, { searchQuery: N }) : /* @__PURE__ */ e(
|
|
852
852
|
Rt,
|
|
853
853
|
{
|
|
854
854
|
searchQuery: N,
|
|
@@ -859,13 +859,13 @@ function Bt({
|
|
|
859
859
|
) }),
|
|
860
860
|
h && /* @__PURE__ */ e(Ue, { children: /* @__PURE__ */ e("div", { className: "border-t border-border px-4 py-2", children: /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
861
861
|
/* @__PURE__ */ a(je, { children: [
|
|
862
|
-
/* @__PURE__ */ e(Me, { asChild: !0, children: /* @__PURE__ */ e("div", { className: "flex h-6 w-6 cursor-default items-center justify-center rounded-full bg-primary/10", children: /* @__PURE__ */ e("span", { className: "text-xs font-medium text-primary", children:
|
|
862
|
+
/* @__PURE__ */ e(Me, { asChild: !0, children: /* @__PURE__ */ e("div", { className: "flex h-6 w-6 cursor-default items-center justify-center rounded-full bg-primary/10", children: /* @__PURE__ */ e("span", { className: "text-xs font-medium text-primary", children: W }) }) }),
|
|
863
863
|
/* @__PURE__ */ e(Fe, { side: "top", className: "max-w-xs", children: /* @__PURE__ */ a("div", { className: "space-y-1", children: [
|
|
864
864
|
/* @__PURE__ */ e("div", { className: "font-medium", children: F }),
|
|
865
865
|
R && /* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground", children: R }),
|
|
866
866
|
h.role && /* @__PURE__ */ a("div", { className: "text-xs text-muted-foreground", children: [
|
|
867
867
|
"Role: ",
|
|
868
|
-
|
|
868
|
+
Ct(h.role.replace(/_/g, " "))
|
|
869
869
|
] })
|
|
870
870
|
] }) })
|
|
871
871
|
] }),
|
|
@@ -876,11 +876,11 @@ function Bt({
|
|
|
876
876
|
{
|
|
877
877
|
open: x,
|
|
878
878
|
onOpenChange: m,
|
|
879
|
-
onSubmit:
|
|
880
|
-
isCreating:
|
|
879
|
+
onSubmit: v,
|
|
880
|
+
isCreating: y
|
|
881
881
|
}
|
|
882
882
|
) : /* @__PURE__ */ e(
|
|
883
|
-
|
|
883
|
+
vt,
|
|
884
884
|
{
|
|
885
885
|
open: x,
|
|
886
886
|
onOpenChange: m,
|
|
@@ -891,5 +891,5 @@ function Bt({
|
|
|
891
891
|
] }) });
|
|
892
892
|
}
|
|
893
893
|
export {
|
|
894
|
-
|
|
894
|
+
zt as ResourceManagementPanel
|
|
895
895
|
};
|
package/dist/chunks/{resource-management-panel-DAc7CcYm.js → resource-management-panel-Fs9hg3pC.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("./index-BCmbfOd2.js"),m=require("react"),re=require("./use-visual-utils-Cjv_OnmO.js"),ue=require("./use-click-outside-B9T3lmcw.js");/**
|
|
2
2
|
* @license lucide-react v0.453.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|