react-semaphor 0.1.143 → 0.1.145
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-BvAfEaAq.js → dashboard-controls-CK-TP9Qx.js} +3 -3
- package/dist/chunks/{dashboard-controls-B8NPZmKf.js → dashboard-controls-DhQZskp-.js} +1 -1
- package/dist/chunks/{dashboard-export-dialog-CZBcwimv.js → dashboard-export-dialog-D2JI5ycD.js} +1 -1
- package/dist/chunks/{dashboard-export-dialog-C1zTVaQi.js → dashboard-export-dialog-DWHbgRQ2.js} +3 -3
- package/dist/chunks/{dashboard-json-C-zBNwIA.js → dashboard-json-C_agr9Il.js} +1 -1
- package/dist/chunks/{dashboard-json-B2ImfUqL.js → dashboard-json-xIJDJDEK.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-D0CRVVGk.js → edit-dashboard-visual-CyWgFWeR.js} +3009 -3088
- package/dist/chunks/edit-dashboard-visual-DjlER5zs.js +195 -0
- package/dist/chunks/{editor-action-buttons-h2AMR_R5.js → editor-action-buttons-CRGFmZT-.js} +2 -2
- package/dist/chunks/{editor-action-buttons-l7f4cU54.js → editor-action-buttons-DPryoh3-.js} +1 -1
- package/dist/chunks/{index-DAD8b75l.js → index-DB87nSG-.js} +4 -4
- package/dist/chunks/{index-DO5lHjHR.js → index-DI6ZxR4E.js} +1 -1
- package/dist/chunks/{resource-management-panel-BXSlocUb.js → resource-management-panel-BOJcXuoC.js} +274 -263
- package/dist/chunks/resource-management-panel-BugB44JB.js +6 -0
- package/dist/chunks/{use-visual-utils-Dk2Ld2rb.js → use-visual-utils-CpYOpmej.js} +1 -1
- package/dist/chunks/{use-visual-utils-CMMHZeji.js → use-visual-utils-jua7RF1E.js} +1 -1
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +4 -4
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/edit-dashboard-visual-Dngktopr.js +0 -195
- package/dist/chunks/resource-management-panel-DfCPGggX.js +0 -6
- package/dist/chunks/use-click-outside-B9T3lmcw.js +0 -1
- package/dist/chunks/use-click-outside-CMeO_QFI.js +0 -16
package/dist/chunks/{resource-management-panel-BXSlocUb.js → resource-management-panel-BOJcXuoC.js}
RENAMED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { jsx as e, jsxs as a, Fragment as me } from "react/jsx-runtime";
|
|
2
|
-
import { b as We, u as
|
|
3
|
-
import St, {
|
|
4
|
-
import { a as ze } from "./use-visual-utils-
|
|
5
|
-
import { u as Vt } from "./use-click-outside-CMeO_QFI.js";
|
|
2
|
+
import { b as We, u as ce, f as qe, ao as ie, 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 ue, L as re, 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 oe, bi as ve, bj as ye, bk as rt, K as Ce, R as Se, bl as Ee, aO as Ve, aP as Le, aQ as Ae, aS as Te, aT as Oe, aU as Re, aV as Pe, 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 he, aB as bt, by as wt, bz as vt, bA as yt, bB as Ct } from "./index-DB87nSG-.js";
|
|
3
|
+
import St, { useRef as Et, useEffect as ne, useState as x } from "react";
|
|
4
|
+
import { a as ze } from "./use-visual-utils-CpYOpmej.js";
|
|
6
5
|
/**
|
|
7
6
|
* @license lucide-react v0.453.0 - ISC
|
|
8
7
|
*
|
|
9
8
|
* This source code is licensed under the ISC license.
|
|
10
9
|
* See the LICENSE file in the root directory of this source tree.
|
|
11
10
|
*/
|
|
12
|
-
const
|
|
11
|
+
const Vt = We("FolderOpen", [
|
|
13
12
|
[
|
|
14
13
|
"path",
|
|
15
14
|
{
|
|
@@ -18,6 +17,18 @@ const Et = We("FolderOpen", [
|
|
|
18
17
|
}
|
|
19
18
|
]
|
|
20
19
|
]);
|
|
20
|
+
function Lt(t, f = {}) {
|
|
21
|
+
const { enabled: m = !0, eventType: r = "mousedown" } = f, o = Et(null);
|
|
22
|
+
return ne(() => {
|
|
23
|
+
const g = (D) => {
|
|
24
|
+
const i = D.target;
|
|
25
|
+
o.current && o.current.contains(i) || i instanceof Element && (i.closest("[data-radix-popper-content-wrapper]") || i.closest("[data-radix-select-content]") || i.closest("[data-radix-popover-content]") || i.closest("[data-radix-dropdown-menu-content]") || i.closest("[data-radix-tooltip-content]") || i.closest('[role="listbox"]') || i.closest('[role="option"]') || i.closest('[role="combobox"]')) || i instanceof Element && i.hasAttribute("data-radix-") || t();
|
|
26
|
+
};
|
|
27
|
+
return m && document.addEventListener(r, g), () => {
|
|
28
|
+
document.removeEventListener(r, g);
|
|
29
|
+
};
|
|
30
|
+
}, [t, m, r]), o;
|
|
31
|
+
}
|
|
21
32
|
function He() {
|
|
22
33
|
return /* @__PURE__ */ e("div", { className: "space-y-1 px-2 py-2", children: [...Array(5)].map((t, f) => /* @__PURE__ */ a(
|
|
23
34
|
"div",
|
|
@@ -34,43 +45,43 @@ function He() {
|
|
|
34
45
|
f
|
|
35
46
|
)) });
|
|
36
47
|
}
|
|
37
|
-
const
|
|
38
|
-
const f =
|
|
39
|
-
return !!(f &&
|
|
48
|
+
const At = (t) => {
|
|
49
|
+
const f = ce((o) => o.isVisualEditing), m = ce((o) => o.selectedFrameId), r = qe((o) => o.frame);
|
|
50
|
+
return !!(f && m && (r == null ? void 0 : r.visualId) === t);
|
|
40
51
|
};
|
|
41
52
|
function Tt({
|
|
42
53
|
visual: t,
|
|
43
54
|
isDeleting: f,
|
|
44
|
-
isDuplicating:
|
|
45
|
-
onAddVisual:
|
|
46
|
-
onOpenVisual:
|
|
47
|
-
onEditDetails:
|
|
48
|
-
onDeleteClick:
|
|
49
|
-
onDuplicateVisual:
|
|
55
|
+
isDuplicating: m,
|
|
56
|
+
onAddVisual: r,
|
|
57
|
+
onOpenVisual: o,
|
|
58
|
+
onEditDetails: g,
|
|
59
|
+
onDeleteClick: D,
|
|
60
|
+
onDuplicateVisual: i,
|
|
50
61
|
// onTogglePrivacy,
|
|
51
62
|
onShareVisual: N,
|
|
52
|
-
formatDate:
|
|
63
|
+
formatDate: C
|
|
53
64
|
}) {
|
|
54
|
-
var
|
|
55
|
-
const { selectVisual:
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}, [
|
|
59
|
-
|
|
65
|
+
var R, S, v, T;
|
|
66
|
+
const { selectVisual: d } = ie(), c = Je(t.id), p = At(t.id), { isConsoleMode: E } = Qe(), V = St.useRef(null), [b, y] = x(!1), [L, A] = x(!1);
|
|
67
|
+
ne(() => {
|
|
68
|
+
m ? (y(!0), A(!0)) : L && (y(!1), A(!1));
|
|
69
|
+
}, [m, L]), ne(() => {
|
|
70
|
+
p && V.current && V.current.scrollIntoView({
|
|
60
71
|
behavior: "smooth",
|
|
61
72
|
block: "center"
|
|
62
73
|
});
|
|
63
|
-
}, [
|
|
74
|
+
}, [p]);
|
|
64
75
|
const I = () => {
|
|
65
|
-
|
|
76
|
+
d(t), o == null || o(t);
|
|
66
77
|
};
|
|
67
78
|
return /* @__PURE__ */ a(
|
|
68
79
|
"div",
|
|
69
80
|
{
|
|
70
|
-
ref:
|
|
81
|
+
ref: V,
|
|
71
82
|
className: ee(
|
|
72
83
|
"group flex cursor-pointer items-start gap-3 rounded-md px-2 py-2 transition-colors hover:bg-muted",
|
|
73
|
-
|
|
84
|
+
p ? "bg-purple-500/10" : c && "bg-muted/80"
|
|
74
85
|
),
|
|
75
86
|
onClick: I,
|
|
76
87
|
children: [
|
|
@@ -90,7 +101,7 @@ function Tt({
|
|
|
90
101
|
{
|
|
91
102
|
className: "truncate text-xs text-muted-foreground",
|
|
92
103
|
title: t.description || "No description",
|
|
93
|
-
children: (
|
|
104
|
+
children: (R = t.description) != null && R.trim() ? t.description : "No description"
|
|
94
105
|
}
|
|
95
106
|
)
|
|
96
107
|
] }),
|
|
@@ -98,25 +109,25 @@ function Tt({
|
|
|
98
109
|
"div",
|
|
99
110
|
{
|
|
100
111
|
className: "flex flex-shrink-0 items-center gap-1",
|
|
101
|
-
onClick: (
|
|
112
|
+
onClick: (u) => u.stopPropagation(),
|
|
102
113
|
children: [
|
|
103
114
|
/* @__PURE__ */ e("div", { className: "opacity-0 transition-opacity group-hover:opacity-100", children: /* @__PURE__ */ a(
|
|
104
115
|
Xe,
|
|
105
116
|
{
|
|
106
117
|
modal: !1,
|
|
107
118
|
open: b,
|
|
108
|
-
onOpenChange:
|
|
119
|
+
onOpenChange: y,
|
|
109
120
|
children: [
|
|
110
121
|
/* @__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
122
|
/* @__PURE__ */ a(ke, { align: "end", className: "z-[51] w-40", children: [
|
|
112
123
|
/* @__PURE__ */ a(
|
|
113
124
|
Q,
|
|
114
125
|
{
|
|
115
|
-
onClick: (
|
|
116
|
-
|
|
126
|
+
onClick: (u) => {
|
|
127
|
+
u.stopPropagation(), r(t);
|
|
117
128
|
},
|
|
118
129
|
children: [
|
|
119
|
-
/* @__PURE__ */ e(
|
|
130
|
+
/* @__PURE__ */ e(ue, { className: "mr-2 h-3 w-3" }),
|
|
120
131
|
"Add"
|
|
121
132
|
]
|
|
122
133
|
}
|
|
@@ -124,11 +135,11 @@ function Tt({
|
|
|
124
135
|
/* @__PURE__ */ a(
|
|
125
136
|
Q,
|
|
126
137
|
{
|
|
127
|
-
onClick: (
|
|
128
|
-
|
|
138
|
+
onClick: (u) => {
|
|
139
|
+
u.stopPropagation(), o == null || o(t);
|
|
129
140
|
},
|
|
130
141
|
children: [
|
|
131
|
-
/* @__PURE__ */ e(
|
|
142
|
+
/* @__PURE__ */ e(Vt, { className: "mr-2 h-3 w-3" }),
|
|
132
143
|
"Open"
|
|
133
144
|
]
|
|
134
145
|
}
|
|
@@ -136,13 +147,13 @@ function Tt({
|
|
|
136
147
|
/* @__PURE__ */ a(
|
|
137
148
|
Q,
|
|
138
149
|
{
|
|
139
|
-
onClick: (
|
|
140
|
-
|
|
150
|
+
onClick: (u) => {
|
|
151
|
+
u.preventDefault(), u.stopPropagation(), i(t.id);
|
|
141
152
|
},
|
|
142
|
-
disabled:
|
|
153
|
+
disabled: m,
|
|
143
154
|
children: [
|
|
144
|
-
|
|
145
|
-
|
|
155
|
+
m ? /* @__PURE__ */ e(re, { className: "mr-2 h-3 w-3 animate-spin" }) : /* @__PURE__ */ e(et, { className: "mr-2 h-3 w-3" }),
|
|
156
|
+
m ? "Duplicating..." : "Duplicate"
|
|
146
157
|
]
|
|
147
158
|
}
|
|
148
159
|
),
|
|
@@ -150,8 +161,8 @@ function Tt({
|
|
|
150
161
|
/* @__PURE__ */ a(
|
|
151
162
|
Q,
|
|
152
163
|
{
|
|
153
|
-
onClick: (
|
|
154
|
-
|
|
164
|
+
onClick: (u) => {
|
|
165
|
+
u.stopPropagation(), g == null || g(t);
|
|
155
166
|
},
|
|
156
167
|
children: [
|
|
157
168
|
/* @__PURE__ */ e(tt, { className: "mr-2 h-3 w-3" }),
|
|
@@ -162,8 +173,8 @@ function Tt({
|
|
|
162
173
|
/* @__PURE__ */ a(
|
|
163
174
|
Q,
|
|
164
175
|
{
|
|
165
|
-
onClick: (
|
|
166
|
-
|
|
176
|
+
onClick: (u) => {
|
|
177
|
+
u.stopPropagation(), N(t);
|
|
167
178
|
},
|
|
168
179
|
children: [
|
|
169
180
|
/* @__PURE__ */ e(st, { className: "mr-2 h-3 w-3" }),
|
|
@@ -175,8 +186,8 @@ function Tt({
|
|
|
175
186
|
/* @__PURE__ */ a(
|
|
176
187
|
Q,
|
|
177
188
|
{
|
|
178
|
-
onClick: (
|
|
179
|
-
|
|
189
|
+
onClick: (u) => {
|
|
190
|
+
u.stopPropagation(), D(t);
|
|
180
191
|
},
|
|
181
192
|
className: "text-destructive",
|
|
182
193
|
disabled: f,
|
|
@@ -189,13 +200,13 @@ function Tt({
|
|
|
189
200
|
] }),
|
|
190
201
|
/* @__PURE__ */ e(Ne, {}),
|
|
191
202
|
/* @__PURE__ */ a("div", { className: "space-y-1 px-2 py-2 text-xs text-slate-500 dark:text-slate-400", children: [
|
|
192
|
-
(((
|
|
203
|
+
(((S = t.ownership.createdBy) == null ? void 0 : S.type) === "tenant" || ((v = t.ownership.createdBy) == null ? void 0 : v.type) === "organization" && E) && /* @__PURE__ */ a("div", { className: "flex items-center gap-1", children: [
|
|
193
204
|
/* @__PURE__ */ e(at, { className: "h-3 w-3" }),
|
|
194
|
-
/* @__PURE__ */ e("span", { children: ((
|
|
205
|
+
/* @__PURE__ */ e("span", { children: ((T = t.ownership.createdBy) == null ? void 0 : T.name) || "Unknown" })
|
|
195
206
|
] }),
|
|
196
207
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-1", children: [
|
|
197
208
|
/* @__PURE__ */ e(nt, { className: "h-3 w-3" }),
|
|
198
|
-
/* @__PURE__ */ e("span", { children:
|
|
209
|
+
/* @__PURE__ */ e("span", { children: C(t.lastModified) })
|
|
199
210
|
] })
|
|
200
211
|
] })
|
|
201
212
|
] })
|
|
@@ -209,12 +220,12 @@ function Tt({
|
|
|
209
220
|
buttonProps: {
|
|
210
221
|
variant: "ghost",
|
|
211
222
|
size: "sm",
|
|
212
|
-
onClick: (
|
|
213
|
-
|
|
223
|
+
onClick: (u) => {
|
|
224
|
+
u.stopPropagation(), r(t);
|
|
214
225
|
}
|
|
215
226
|
},
|
|
216
227
|
className: "h-6 w-6 p-0",
|
|
217
|
-
children: /* @__PURE__ */ e(
|
|
228
|
+
children: /* @__PURE__ */ e(ue, { className: "h-3.5 w-3.5" })
|
|
218
229
|
}
|
|
219
230
|
)
|
|
220
231
|
]
|
|
@@ -226,47 +237,47 @@ function Tt({
|
|
|
226
237
|
t.id
|
|
227
238
|
);
|
|
228
239
|
}
|
|
229
|
-
function
|
|
230
|
-
const [f,
|
|
240
|
+
function Ot({ searchQuery: t }) {
|
|
241
|
+
const [f, m] = x(!1), [r, o] = x(
|
|
231
242
|
null
|
|
232
|
-
), [
|
|
243
|
+
), [g, D] = x(!1), [i, N] = x(null), [C, d] = x(null), [c, p] = x(
|
|
233
244
|
null
|
|
234
|
-
), { selectVisual:
|
|
235
|
-
resources:
|
|
245
|
+
), { selectVisual: E } = ie(), { handleEditLibraryVisual: V, handleAddLibraryVisual: b } = ze(), {
|
|
246
|
+
resources: y,
|
|
236
247
|
isLoading: L,
|
|
237
|
-
isError:
|
|
248
|
+
isError: A,
|
|
238
249
|
updateResource: I,
|
|
239
|
-
deleteResource:
|
|
240
|
-
duplicateResource:
|
|
241
|
-
isDeleting:
|
|
250
|
+
deleteResource: R,
|
|
251
|
+
duplicateResource: S,
|
|
252
|
+
isDeleting: v
|
|
242
253
|
} = we(() => {
|
|
243
|
-
|
|
254
|
+
D(!1), N(null);
|
|
244
255
|
});
|
|
245
|
-
|
|
246
|
-
const
|
|
256
|
+
oe();
|
|
257
|
+
const T = y.filter(
|
|
247
258
|
(n) => {
|
|
248
|
-
var O,
|
|
249
|
-
return ((O = n == null ? void 0 : n.title) == null ? void 0 : O.toLowerCase().includes(t.toLowerCase())) || ((
|
|
259
|
+
var O, l;
|
|
260
|
+
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()));
|
|
250
261
|
}
|
|
251
|
-
),
|
|
262
|
+
), u = (n) => new Date(n).toLocaleDateString("en-US", {
|
|
252
263
|
month: "short",
|
|
253
264
|
day: "numeric",
|
|
254
265
|
year: "numeric"
|
|
255
266
|
}), M = (n) => {
|
|
256
|
-
N(n),
|
|
267
|
+
N(n), D(!0);
|
|
257
268
|
}, Y = () => {
|
|
258
|
-
|
|
269
|
+
i && R(i.id);
|
|
259
270
|
}, {
|
|
260
271
|
startUpdating: F,
|
|
261
272
|
stopUpdating: W,
|
|
262
|
-
isUpdating:
|
|
263
|
-
} =
|
|
273
|
+
isUpdating: P
|
|
274
|
+
} = ve(), B = (n, O, l) => {
|
|
264
275
|
var se;
|
|
265
276
|
const J = Object.fromEntries(
|
|
266
277
|
Object.entries(O).filter(([, j]) => j !== void 0)
|
|
267
278
|
);
|
|
268
279
|
if (Object.keys(J).length === 0) {
|
|
269
|
-
(se =
|
|
280
|
+
(se = l == null ? void 0 : l.onSuccess) == null || se.call(l);
|
|
270
281
|
return;
|
|
271
282
|
}
|
|
272
283
|
const te = Object.keys(J), k = te.length === 1 ? te[0] : void 0;
|
|
@@ -278,24 +289,24 @@ function At({ searchQuery: t }) {
|
|
|
278
289
|
{
|
|
279
290
|
onSuccess: () => {
|
|
280
291
|
var j;
|
|
281
|
-
W(n, k), (j =
|
|
292
|
+
W(n, k), (j = l == null ? void 0 : l.onSuccess) == null || j.call(l);
|
|
282
293
|
},
|
|
283
294
|
onError: () => {
|
|
284
295
|
var j;
|
|
285
|
-
W(n, k), (j =
|
|
296
|
+
W(n, k), (j = l == null ? void 0 : l.onError) == null || j.call(l);
|
|
286
297
|
}
|
|
287
298
|
}
|
|
288
299
|
);
|
|
289
300
|
}, z = (n) => {
|
|
290
|
-
|
|
291
|
-
onSettled: () =>
|
|
301
|
+
d(n), S(n, {
|
|
302
|
+
onSettled: () => d(null)
|
|
292
303
|
});
|
|
293
304
|
}, X = (n) => {
|
|
294
|
-
|
|
305
|
+
V(n);
|
|
295
306
|
}, H = (n) => {
|
|
296
307
|
b(n);
|
|
297
308
|
}, Z = (n) => {
|
|
298
|
-
const O =
|
|
309
|
+
const O = y.find((l) => l.id === n);
|
|
299
310
|
O && I({
|
|
300
311
|
resourceId: n,
|
|
301
312
|
data: {
|
|
@@ -303,25 +314,25 @@ function At({ searchQuery: t }) {
|
|
|
303
314
|
}
|
|
304
315
|
});
|
|
305
316
|
}, _ = (n) => {
|
|
306
|
-
|
|
317
|
+
o(n), m(!0);
|
|
307
318
|
}, q = (n) => {
|
|
308
|
-
|
|
319
|
+
p(n);
|
|
309
320
|
}, w = () => {
|
|
310
|
-
|
|
321
|
+
p(null);
|
|
311
322
|
}, $ = ({
|
|
312
323
|
title: n,
|
|
313
324
|
description: O
|
|
314
325
|
}) => {
|
|
315
|
-
if (!
|
|
326
|
+
if (!c)
|
|
316
327
|
return;
|
|
317
|
-
const
|
|
318
|
-
n !==
|
|
328
|
+
const l = {};
|
|
329
|
+
n !== c.title && (l.title = n), (c.description || "") !== O && (l.description = O), B(c.id, l, {
|
|
319
330
|
onSuccess: () => {
|
|
320
|
-
|
|
331
|
+
p(null);
|
|
321
332
|
}
|
|
322
333
|
});
|
|
323
334
|
};
|
|
324
|
-
return L ? /* @__PURE__ */ e(He, {}) :
|
|
335
|
+
return L ? /* @__PURE__ */ e(He, {}) : A ? /* @__PURE__ */ e(ye, { className: "w-full flex-1 pr-2", children: /* @__PURE__ */ a("div", { className: "py-8 text-center text-muted-foreground", children: [
|
|
325
336
|
/* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: "Failed to load visuals" }),
|
|
326
337
|
/* @__PURE__ */ e(
|
|
327
338
|
G,
|
|
@@ -334,11 +345,11 @@ function At({ searchQuery: t }) {
|
|
|
334
345
|
}
|
|
335
346
|
)
|
|
336
347
|
] }) }) : /* @__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:
|
|
348
|
+
/* @__PURE__ */ e("div", { className: "flex flex-1 basis-0 flex-col gap-3 overflow-y-auto", children: T.length === 0 ? /* @__PURE__ */ a("div", { className: "py-8 text-center", children: [
|
|
338
349
|
/* @__PURE__ */ e("div", { className: "mb-3", children: /* @__PURE__ */ e(rt, { className: "mx-auto h-12 w-12 text-muted-foreground/50" }) }),
|
|
339
350
|
/* @__PURE__ */ e("h3", { className: "mb-1 font-medium text-foreground", children: t ? "No visuals found" : "No visuals yet" }),
|
|
340
351
|
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: t ? "Try adjusting your search" : 'Click "Create" above to add your first visual' })
|
|
341
|
-
] }) :
|
|
352
|
+
] }) : T.map((n) => /* @__PURE__ */ e(
|
|
342
353
|
Tt,
|
|
343
354
|
{
|
|
344
355
|
visual: n,
|
|
@@ -349,52 +360,52 @@ function At({ searchQuery: t }) {
|
|
|
349
360
|
onDuplicateVisual: z,
|
|
350
361
|
onTogglePrivacy: Z,
|
|
351
362
|
onShareVisual: _,
|
|
352
|
-
isDeleting:
|
|
353
|
-
isDuplicating:
|
|
354
|
-
formatDate:
|
|
363
|
+
isDeleting: v,
|
|
364
|
+
isDuplicating: C === n.id,
|
|
365
|
+
formatDate: u
|
|
355
366
|
},
|
|
356
367
|
n.id
|
|
357
368
|
)) }),
|
|
358
|
-
f &&
|
|
359
|
-
|
|
369
|
+
f && r && /* @__PURE__ */ e(
|
|
370
|
+
Ce,
|
|
360
371
|
{
|
|
361
|
-
resource:
|
|
372
|
+
resource: r,
|
|
362
373
|
resourceType: Se.VISUAL,
|
|
363
374
|
onClose: () => {
|
|
364
|
-
|
|
375
|
+
m(!1), o(null);
|
|
365
376
|
}
|
|
366
377
|
}
|
|
367
378
|
),
|
|
368
|
-
|
|
369
|
-
|
|
379
|
+
c && /* @__PURE__ */ e(
|
|
380
|
+
Ee,
|
|
370
381
|
{
|
|
371
|
-
open: !!
|
|
382
|
+
open: !!c,
|
|
372
383
|
resourceLabel: "Visual",
|
|
373
|
-
initialTitle:
|
|
374
|
-
initialDescription:
|
|
384
|
+
initialTitle: c.title || "",
|
|
385
|
+
initialDescription: c.description || "",
|
|
375
386
|
onClose: w,
|
|
376
387
|
onSave: $,
|
|
377
|
-
isSaving:
|
|
388
|
+
isSaving: P(c.id)
|
|
378
389
|
}
|
|
379
390
|
),
|
|
380
391
|
/* @__PURE__ */ e(
|
|
381
|
-
|
|
392
|
+
Ve,
|
|
382
393
|
{
|
|
383
|
-
open:
|
|
394
|
+
open: g,
|
|
384
395
|
onOpenChange: (n) => {
|
|
385
|
-
!n &&
|
|
396
|
+
!n && v || (D(n), n || N(null));
|
|
386
397
|
},
|
|
387
398
|
children: /* @__PURE__ */ a(Le, { children: [
|
|
388
|
-
/* @__PURE__ */ a(
|
|
389
|
-
/* @__PURE__ */ e(
|
|
399
|
+
/* @__PURE__ */ a(Ae, { children: [
|
|
400
|
+
/* @__PURE__ */ e(Te, { children: "Delete Visual" }),
|
|
390
401
|
/* @__PURE__ */ a(Oe, { children: [
|
|
391
402
|
'Are you sure you want to delete "',
|
|
392
|
-
|
|
403
|
+
i == null ? void 0 : i.title,
|
|
393
404
|
'"? This action cannot be undone.'
|
|
394
405
|
] })
|
|
395
406
|
] }),
|
|
396
|
-
/* @__PURE__ */ a(
|
|
397
|
-
/* @__PURE__ */ e(
|
|
407
|
+
/* @__PURE__ */ a(Re, { children: [
|
|
408
|
+
/* @__PURE__ */ e(Pe, { disabled: v, children: "Cancel" }),
|
|
398
409
|
/* @__PURE__ */ a(
|
|
399
410
|
Ie,
|
|
400
411
|
{
|
|
@@ -402,10 +413,10 @@ function At({ searchQuery: t }) {
|
|
|
402
413
|
n.preventDefault(), n.stopPropagation(), Y();
|
|
403
414
|
},
|
|
404
415
|
className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
405
|
-
disabled:
|
|
416
|
+
disabled: v,
|
|
406
417
|
children: [
|
|
407
|
-
|
|
408
|
-
|
|
418
|
+
v ? /* @__PURE__ */ e(re, { className: "mr-2 h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(pe, { className: "mr-2 h-3.5 w-3.5" }),
|
|
419
|
+
v ? "Deleting..." : "Delete"
|
|
409
420
|
]
|
|
410
421
|
}
|
|
411
422
|
)
|
|
@@ -415,33 +426,33 @@ function At({ searchQuery: t }) {
|
|
|
415
426
|
)
|
|
416
427
|
] });
|
|
417
428
|
}
|
|
418
|
-
function
|
|
429
|
+
function Rt({
|
|
419
430
|
dashboard: t,
|
|
420
431
|
isDeleting: f,
|
|
421
|
-
isDuplicating:
|
|
422
|
-
isDefault:
|
|
423
|
-
onLoadDashboard:
|
|
424
|
-
onEditDetails:
|
|
425
|
-
onDeleteClick:
|
|
426
|
-
onDuplicateDashboard:
|
|
432
|
+
isDuplicating: m,
|
|
433
|
+
isDefault: r,
|
|
434
|
+
onLoadDashboard: o,
|
|
435
|
+
onEditDetails: g,
|
|
436
|
+
onDeleteClick: D,
|
|
437
|
+
onDuplicateDashboard: i,
|
|
427
438
|
onShareDashboard: N,
|
|
428
|
-
formatDate:
|
|
429
|
-
onDashboardItemClick:
|
|
439
|
+
formatDate: C,
|
|
440
|
+
onDashboardItemClick: d
|
|
430
441
|
}) {
|
|
431
|
-
var
|
|
432
|
-
const { selectDashboard:
|
|
433
|
-
|
|
434
|
-
}, I = (
|
|
435
|
-
|
|
442
|
+
var R, S;
|
|
443
|
+
const { selectDashboard: c } = ie(), p = ot(t.id), { userContext: E, isLoading: V } = oe(), { mutate: b } = lt(), y = ((R = E == null ? void 0 : E.permissions) == null ? void 0 : R.canEdit) ?? !1, L = V || !y, A = () => {
|
|
444
|
+
c(t), o(t.id), d == null || d(t.id);
|
|
445
|
+
}, I = (v) => {
|
|
446
|
+
v.stopPropagation(), b({ dashboardId: r ? null : t.id });
|
|
436
447
|
};
|
|
437
448
|
return /* @__PURE__ */ e(Ue, { children: /* @__PURE__ */ a(
|
|
438
449
|
"div",
|
|
439
450
|
{
|
|
440
451
|
className: ee(
|
|
441
452
|
"group flex cursor-pointer items-start gap-3 rounded-md px-2 py-2 transition-colors hover:bg-muted",
|
|
442
|
-
|
|
453
|
+
p && "bg-muted/80"
|
|
443
454
|
),
|
|
444
|
-
onClick:
|
|
455
|
+
onClick: A,
|
|
445
456
|
children: [
|
|
446
457
|
/* @__PURE__ */ a(je, { children: [
|
|
447
458
|
/* @__PURE__ */ e(Me, { asChild: !0, children: /* @__PURE__ */ e(
|
|
@@ -454,13 +465,13 @@ function Ot({
|
|
|
454
465
|
{
|
|
455
466
|
className: ee(
|
|
456
467
|
"h-4 w-4 transition-colors",
|
|
457
|
-
|
|
468
|
+
r ? "fill-yellow-400 text-yellow-400" : "text-muted-foreground/40 hover:text-yellow-400"
|
|
458
469
|
)
|
|
459
470
|
}
|
|
460
471
|
)
|
|
461
472
|
}
|
|
462
473
|
) }),
|
|
463
|
-
/* @__PURE__ */ e(Fe, { side: "right", className: "text-xs", children:
|
|
474
|
+
/* @__PURE__ */ e(Fe, { side: "right", className: "text-xs", children: r ? "Remove as default" : "Set as default" })
|
|
464
475
|
] }),
|
|
465
476
|
/* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ a("div", { className: "flex items-start justify-between gap-2", children: [
|
|
466
477
|
/* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
|
|
@@ -477,7 +488,7 @@ function Ot({
|
|
|
477
488
|
{
|
|
478
489
|
className: "truncate text-xs text-muted-foreground",
|
|
479
490
|
title: t.description || "No description",
|
|
480
|
-
children: (
|
|
491
|
+
children: (S = t.description) != null && S.trim() ? t.description : "No description"
|
|
481
492
|
}
|
|
482
493
|
)
|
|
483
494
|
] }),
|
|
@@ -486,13 +497,13 @@ function Ot({
|
|
|
486
497
|
{
|
|
487
498
|
dashboard: t,
|
|
488
499
|
isDeleting: f,
|
|
489
|
-
isDuplicating:
|
|
500
|
+
isDuplicating: m,
|
|
490
501
|
shouldHideActions: L,
|
|
491
|
-
onEditDetails:
|
|
492
|
-
onDeleteClick:
|
|
493
|
-
onDuplicateDashboard:
|
|
502
|
+
onEditDetails: g,
|
|
503
|
+
onDeleteClick: D,
|
|
504
|
+
onDuplicateDashboard: i,
|
|
494
505
|
onShareDashboard: N,
|
|
495
|
-
formatDate:
|
|
506
|
+
formatDate: C
|
|
496
507
|
}
|
|
497
508
|
) })
|
|
498
509
|
] }) })
|
|
@@ -502,89 +513,89 @@ function Ot({
|
|
|
502
513
|
) });
|
|
503
514
|
}
|
|
504
515
|
function Pt({ onRetry: t }) {
|
|
505
|
-
return /* @__PURE__ */ e(
|
|
516
|
+
return /* @__PURE__ */ e(ye, { className: "w-full flex-1 pr-2", children: /* @__PURE__ */ a("div", { className: "py-8 text-center text-muted-foreground", children: [
|
|
506
517
|
/* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: "Failed to load dashboards" }),
|
|
507
518
|
/* @__PURE__ */ e(G, { variant: "outline", size: "sm", className: "mt-2", onClick: t, children: "Retry" })
|
|
508
519
|
] }) });
|
|
509
520
|
}
|
|
510
|
-
function
|
|
521
|
+
function It(t) {
|
|
511
522
|
var fe, ge;
|
|
512
|
-
const { searchQuery: f, onLoadDashboard:
|
|
523
|
+
const { searchQuery: f, onLoadDashboard: m, onEditDashboard: r, onDashboardItemClick: o } = t, [g, D] = x(!1), [i, N] = x(
|
|
513
524
|
null
|
|
514
|
-
), [
|
|
525
|
+
), [C, d] = x(!1), [c, p] = x(null), [E, V] = x(null), [b, y] = x(null), L = ae(
|
|
515
526
|
(s) => s.lastSelectedDashboard
|
|
516
|
-
),
|
|
527
|
+
), A = ae(
|
|
517
528
|
(s) => s.selectedDashboard
|
|
518
529
|
), I = ae(
|
|
519
530
|
(s) => s.actions.selectDashboard
|
|
520
|
-
),
|
|
531
|
+
), R = ae(
|
|
521
532
|
(s) => s.actions.clearSelectedDashboard
|
|
522
|
-
), { tokenProps:
|
|
533
|
+
), { tokenProps: S, id: v } = ut();
|
|
523
534
|
ht();
|
|
524
535
|
const {
|
|
525
|
-
resources:
|
|
526
|
-
isLoading:
|
|
536
|
+
resources: T,
|
|
537
|
+
isLoading: u,
|
|
527
538
|
isError: M,
|
|
528
539
|
updateResource: Y,
|
|
529
540
|
deleteResource: F,
|
|
530
541
|
duplicateResource: W,
|
|
531
|
-
isDeleting:
|
|
542
|
+
isDeleting: P
|
|
532
543
|
} = Be(() => {
|
|
533
|
-
|
|
534
|
-
const s =
|
|
535
|
-
|
|
536
|
-
}), { currentUser: B, userContext: z } =
|
|
544
|
+
d(!1);
|
|
545
|
+
const s = c == null ? void 0 : c.id;
|
|
546
|
+
p(null), (A == null ? void 0 : A.id) === s && (!(S != null && S.dashboard_id) && !v ? R() : L && L.id !== s && I(L));
|
|
547
|
+
}), { currentUser: B, userContext: z } = oe(), 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, _ = T.filter(
|
|
537
548
|
(s) => {
|
|
538
|
-
var U,
|
|
539
|
-
return ((U = s == null ? void 0 : s.title) == null ? void 0 : U.toLowerCase().includes(f.toLowerCase())) || ((
|
|
549
|
+
var U, h;
|
|
550
|
+
return ((U = s == null ? void 0 : s.title) == null ? void 0 : U.toLowerCase().includes(f.toLowerCase())) || ((h = s == null ? void 0 : s.description) == null ? void 0 : h.toLowerCase().includes(f.toLowerCase()));
|
|
540
551
|
}
|
|
541
552
|
), q = (s) => new Date(s).toLocaleDateString("en-US", {
|
|
542
553
|
month: "short",
|
|
543
554
|
day: "numeric",
|
|
544
555
|
year: "numeric"
|
|
545
556
|
}), w = (s) => {
|
|
546
|
-
|
|
557
|
+
m == null || m(s);
|
|
547
558
|
}, $ = (s) => {
|
|
548
|
-
|
|
559
|
+
p(s), d(!0);
|
|
549
560
|
}, n = () => {
|
|
550
|
-
|
|
561
|
+
c && F(c.id);
|
|
551
562
|
}, O = (s) => {
|
|
552
|
-
|
|
553
|
-
onSettled: () =>
|
|
563
|
+
V(s), W(s, {
|
|
564
|
+
onSettled: () => V(null)
|
|
554
565
|
});
|
|
555
566
|
}, {
|
|
556
|
-
startUpdating:
|
|
567
|
+
startUpdating: l,
|
|
557
568
|
stopUpdating: J,
|
|
558
569
|
isUpdating: te
|
|
559
|
-
} =
|
|
570
|
+
} = ve(), k = (s, U, h) => {
|
|
560
571
|
var xe;
|
|
561
|
-
const
|
|
572
|
+
const le = Object.fromEntries(
|
|
562
573
|
Object.entries(U).filter(([, K]) => K !== void 0)
|
|
563
574
|
);
|
|
564
|
-
if (Object.keys(
|
|
565
|
-
(xe =
|
|
575
|
+
if (Object.keys(le).length === 0) {
|
|
576
|
+
(xe = h == null ? void 0 : h.onSuccess) == null || xe.call(h);
|
|
566
577
|
return;
|
|
567
578
|
}
|
|
568
|
-
const De = Object.keys(
|
|
569
|
-
|
|
579
|
+
const De = Object.keys(le), de = De.length === 1 ? De[0] : void 0;
|
|
580
|
+
l(s, de), Y(
|
|
570
581
|
{
|
|
571
582
|
resourceId: s,
|
|
572
|
-
data:
|
|
583
|
+
data: le
|
|
573
584
|
},
|
|
574
585
|
{
|
|
575
586
|
onSuccess: () => {
|
|
576
587
|
var K;
|
|
577
|
-
J(s,
|
|
588
|
+
J(s, de), (K = h == null ? void 0 : h.onSuccess) == null || K.call(h);
|
|
578
589
|
},
|
|
579
590
|
onError: () => {
|
|
580
591
|
var K;
|
|
581
|
-
J(s,
|
|
592
|
+
J(s, de), (K = h == null ? void 0 : h.onError) == null || K.call(h);
|
|
582
593
|
}
|
|
583
594
|
}
|
|
584
595
|
);
|
|
585
596
|
}, se = (s) => {
|
|
586
|
-
const U =
|
|
587
|
-
(
|
|
597
|
+
const U = T.find(
|
|
598
|
+
(h) => h.id === s
|
|
588
599
|
);
|
|
589
600
|
U && Y({
|
|
590
601
|
resourceId: s,
|
|
@@ -593,35 +604,35 @@ function Rt(t) {
|
|
|
593
604
|
}
|
|
594
605
|
});
|
|
595
606
|
}, j = (s) => {
|
|
596
|
-
N(s), B == null || B.type,
|
|
607
|
+
N(s), B == null || B.type, D(!0);
|
|
597
608
|
}, _e = (s) => {
|
|
598
|
-
|
|
609
|
+
r == null || r(s.id), y(s);
|
|
599
610
|
}, Ke = () => {
|
|
600
|
-
|
|
611
|
+
y(null);
|
|
601
612
|
}, Ge = ({
|
|
602
613
|
title: s,
|
|
603
614
|
description: U
|
|
604
615
|
}) => {
|
|
605
616
|
if (!b)
|
|
606
617
|
return;
|
|
607
|
-
const
|
|
608
|
-
s !== b.title && (
|
|
618
|
+
const h = {};
|
|
619
|
+
s !== b.title && (h.title = s), (b.description || "") !== U && (h.description = U), k(b.id, h, {
|
|
609
620
|
onSuccess: () => {
|
|
610
|
-
|
|
621
|
+
y(null);
|
|
611
622
|
}
|
|
612
623
|
});
|
|
613
624
|
};
|
|
614
|
-
return
|
|
625
|
+
return u ? /* @__PURE__ */ e(He, {}) : M ? /* @__PURE__ */ e(Pt, { onRetry: () => window.location.reload() }) : /* @__PURE__ */ a("div", { className: "flex h-full flex-1 flex-col", children: [
|
|
615
626
|
/* @__PURE__ */ e("div", { className: "flex flex-1 basis-0 flex-col gap-3 overflow-y-auto", children: _.length === 0 ? /* @__PURE__ */ a("div", { className: "py-8 text-center", children: [
|
|
616
627
|
/* @__PURE__ */ e("div", { className: "mb-3", children: /* @__PURE__ */ e(pt, { className: "mx-auto h-12 w-12 text-muted-foreground/50" }) }),
|
|
617
628
|
/* @__PURE__ */ e("h3", { className: "mb-1 font-medium text-foreground", children: f ? "No dashboards found" : "No dashboards yet" }),
|
|
618
629
|
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: f ? "Try adjusting your search" : X ? 'Click "Create" above to add your first dashboard' : "No dashboards have been shared with you yet" })
|
|
619
630
|
] }) : _.map((s) => /* @__PURE__ */ e(
|
|
620
|
-
|
|
631
|
+
Rt,
|
|
621
632
|
{
|
|
622
633
|
dashboard: s,
|
|
623
|
-
isDeleting:
|
|
624
|
-
isDuplicating:
|
|
634
|
+
isDeleting: P,
|
|
635
|
+
isDuplicating: E === s.id,
|
|
625
636
|
isDefault: s.id === Z,
|
|
626
637
|
onLoadDashboard: w,
|
|
627
638
|
onEditDetails: _e,
|
|
@@ -630,38 +641,38 @@ function Rt(t) {
|
|
|
630
641
|
onTogglePrivacy: se,
|
|
631
642
|
onShareDashboard: j,
|
|
632
643
|
formatDate: q,
|
|
633
|
-
onDashboardItemClick:
|
|
644
|
+
onDashboardItemClick: o
|
|
634
645
|
},
|
|
635
646
|
s.id
|
|
636
647
|
)) }),
|
|
637
|
-
|
|
638
|
-
|
|
648
|
+
g && i && /* @__PURE__ */ e(
|
|
649
|
+
Ce,
|
|
639
650
|
{
|
|
640
|
-
resource:
|
|
651
|
+
resource: i,
|
|
641
652
|
resourceType: Se.DASHBOARD,
|
|
642
653
|
onClose: () => {
|
|
643
|
-
|
|
654
|
+
D(!1), N(null);
|
|
644
655
|
}
|
|
645
656
|
}
|
|
646
657
|
),
|
|
647
658
|
/* @__PURE__ */ e(
|
|
648
|
-
|
|
659
|
+
Ve,
|
|
649
660
|
{
|
|
650
|
-
open:
|
|
661
|
+
open: C,
|
|
651
662
|
onOpenChange: (s) => {
|
|
652
|
-
!s &&
|
|
663
|
+
!s && P || (d(s), s || p(null));
|
|
653
664
|
},
|
|
654
665
|
children: /* @__PURE__ */ a(Le, { children: [
|
|
655
|
-
/* @__PURE__ */ a(
|
|
656
|
-
/* @__PURE__ */ e(
|
|
666
|
+
/* @__PURE__ */ a(Ae, { children: [
|
|
667
|
+
/* @__PURE__ */ e(Te, { children: "Delete Dashboard" }),
|
|
657
668
|
/* @__PURE__ */ a(Oe, { children: [
|
|
658
669
|
'Are you sure you want to delete "',
|
|
659
|
-
|
|
670
|
+
c == null ? void 0 : c.title,
|
|
660
671
|
'"? This action cannot be undone.'
|
|
661
672
|
] })
|
|
662
673
|
] }),
|
|
663
|
-
/* @__PURE__ */ a(
|
|
664
|
-
/* @__PURE__ */ e(
|
|
674
|
+
/* @__PURE__ */ a(Re, { children: [
|
|
675
|
+
/* @__PURE__ */ e(Pe, { disabled: P, children: "Cancel" }),
|
|
665
676
|
/* @__PURE__ */ a(
|
|
666
677
|
Ie,
|
|
667
678
|
{
|
|
@@ -669,10 +680,10 @@ function Rt(t) {
|
|
|
669
680
|
s.preventDefault(), s.stopPropagation(), n();
|
|
670
681
|
},
|
|
671
682
|
className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
672
|
-
disabled:
|
|
683
|
+
disabled: P,
|
|
673
684
|
children: [
|
|
674
|
-
|
|
675
|
-
|
|
685
|
+
P ? /* @__PURE__ */ e(re, { className: "mr-2 h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(pe, { className: "mr-2 h-3.5 w-3.5" }),
|
|
686
|
+
P ? "Deleting..." : "Delete"
|
|
676
687
|
]
|
|
677
688
|
}
|
|
678
689
|
)
|
|
@@ -681,7 +692,7 @@ function Rt(t) {
|
|
|
681
692
|
}
|
|
682
693
|
),
|
|
683
694
|
b && /* @__PURE__ */ e(
|
|
684
|
-
|
|
695
|
+
Ee,
|
|
685
696
|
{
|
|
686
697
|
open: !!b,
|
|
687
698
|
resourceLabel: "Dashboard",
|
|
@@ -694,22 +705,22 @@ function Rt(t) {
|
|
|
694
705
|
)
|
|
695
706
|
] });
|
|
696
707
|
}
|
|
697
|
-
function
|
|
708
|
+
function Ut({
|
|
698
709
|
open: t,
|
|
699
710
|
onOpenChange: f,
|
|
700
|
-
onSubmit:
|
|
701
|
-
isCreating:
|
|
711
|
+
onSubmit: m,
|
|
712
|
+
isCreating: r
|
|
702
713
|
}) {
|
|
703
|
-
const [
|
|
704
|
-
|
|
705
|
-
t || (
|
|
714
|
+
const [o, g] = x(""), [D, i] = x("");
|
|
715
|
+
ne(() => {
|
|
716
|
+
t || (g(""), i(""));
|
|
706
717
|
}, [t]);
|
|
707
718
|
const N = () => {
|
|
708
|
-
|
|
709
|
-
},
|
|
710
|
-
f(
|
|
719
|
+
o.trim() && m({ title: o, description: D });
|
|
720
|
+
}, C = (d) => {
|
|
721
|
+
f(d);
|
|
711
722
|
};
|
|
712
|
-
return /* @__PURE__ */ e(ft, { open: t, onOpenChange:
|
|
723
|
+
return /* @__PURE__ */ e(ft, { open: t, onOpenChange: C, children: /* @__PURE__ */ a(gt, { children: [
|
|
713
724
|
/* @__PURE__ */ a(Dt, { children: [
|
|
714
725
|
/* @__PURE__ */ e(xt, { children: "Create New Visual" }),
|
|
715
726
|
/* @__PURE__ */ e(Nt, { children: "Add a new visual to your library. You can configure it after creation." })
|
|
@@ -718,15 +729,15 @@ function It({
|
|
|
718
729
|
/* @__PURE__ */ a("div", { className: "space-y-2", children: [
|
|
719
730
|
/* @__PURE__ */ e(be, { htmlFor: "title", children: "Visual Title" }),
|
|
720
731
|
/* @__PURE__ */ e(
|
|
721
|
-
|
|
732
|
+
he,
|
|
722
733
|
{
|
|
723
734
|
id: "title",
|
|
724
735
|
placeholder: "Enter visual title...",
|
|
725
|
-
value:
|
|
726
|
-
onChange: (
|
|
727
|
-
disabled:
|
|
728
|
-
onKeyDown: (
|
|
729
|
-
|
|
736
|
+
value: o,
|
|
737
|
+
onChange: (d) => g(d.target.value),
|
|
738
|
+
disabled: r,
|
|
739
|
+
onKeyDown: (d) => {
|
|
740
|
+
d.key === "Enter" && !d.shiftKey && (d.preventDefault(), N());
|
|
730
741
|
}
|
|
731
742
|
}
|
|
732
743
|
)
|
|
@@ -734,13 +745,13 @@ function It({
|
|
|
734
745
|
/* @__PURE__ */ a("div", { className: "space-y-2", children: [
|
|
735
746
|
/* @__PURE__ */ e(be, { htmlFor: "description", children: "Description (optional)" }),
|
|
736
747
|
/* @__PURE__ */ e(
|
|
737
|
-
|
|
748
|
+
he,
|
|
738
749
|
{
|
|
739
750
|
id: "description",
|
|
740
751
|
placeholder: "Enter visual description...",
|
|
741
|
-
value:
|
|
742
|
-
onChange: (
|
|
743
|
-
disabled:
|
|
752
|
+
value: D,
|
|
753
|
+
onChange: (d) => i(d.target.value),
|
|
754
|
+
disabled: r
|
|
744
755
|
}
|
|
745
756
|
)
|
|
746
757
|
] })
|
|
@@ -750,8 +761,8 @@ function It({
|
|
|
750
761
|
G,
|
|
751
762
|
{
|
|
752
763
|
variant: "outline",
|
|
753
|
-
onClick: () =>
|
|
754
|
-
disabled:
|
|
764
|
+
onClick: () => C(!1),
|
|
765
|
+
disabled: r,
|
|
755
766
|
children: "Cancel"
|
|
756
767
|
}
|
|
757
768
|
),
|
|
@@ -759,9 +770,9 @@ function It({
|
|
|
759
770
|
G,
|
|
760
771
|
{
|
|
761
772
|
onClick: N,
|
|
762
|
-
disabled: !
|
|
763
|
-
children:
|
|
764
|
-
/* @__PURE__ */ e(
|
|
773
|
+
disabled: !o.trim() || r,
|
|
774
|
+
children: r ? /* @__PURE__ */ a(me, { children: [
|
|
775
|
+
/* @__PURE__ */ e(re, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
765
776
|
"Creating..."
|
|
766
777
|
] }) : "Create Visual"
|
|
767
778
|
}
|
|
@@ -772,118 +783,118 @@ function It({
|
|
|
772
783
|
function zt({
|
|
773
784
|
isOpen: t,
|
|
774
785
|
onClose: f,
|
|
775
|
-
className:
|
|
776
|
-
onDashboardItemClick:
|
|
777
|
-
variant:
|
|
786
|
+
className: m,
|
|
787
|
+
onDashboardItemClick: r,
|
|
788
|
+
variant: o = "inline"
|
|
778
789
|
}) {
|
|
779
790
|
var _, q;
|
|
780
|
-
const
|
|
791
|
+
const g = ce(
|
|
781
792
|
(w) => w.isDashboardEditing
|
|
782
|
-
), [
|
|
783
|
-
onDashboardSelect:
|
|
784
|
-
}), { selectVisual:
|
|
785
|
-
createResource:
|
|
793
|
+
), [D, i] = x(!1), [N, C] = x(""), [d, c] = x(!1), { currentUser: p, userContext: E } = oe(), V = ((_ = E == null ? void 0 : E.permissions) == null ? void 0 : _.canCreateDashboard) ?? !1, { onCreateSuccess: b } = wt({
|
|
794
|
+
onDashboardSelect: r
|
|
795
|
+
}), { selectVisual: y } = ie(), { handleEditLibraryVisual: L } = ze(), {
|
|
796
|
+
createResource: A,
|
|
786
797
|
isCreating: I,
|
|
787
|
-
refetch:
|
|
788
|
-
} = Be(), { createResource:
|
|
798
|
+
refetch: R
|
|
799
|
+
} = Be(), { createResource: S, isCreating: v } = we(
|
|
789
800
|
void 0,
|
|
790
801
|
// onDeleteSuccess (not needed here)
|
|
791
802
|
(w) => {
|
|
792
|
-
|
|
803
|
+
i(!1), w && (y(w), L(w));
|
|
793
804
|
}
|
|
794
|
-
),
|
|
795
|
-
enabled: t &&
|
|
805
|
+
), T = o === "overlay", u = ((p == null ? void 0 : p.name) ?? "").trim(), M = ((p == null ? void 0 : p.email) ?? "").trim(), F = u && u.toLowerCase() !== "undefined" ? u : M || "Current user", W = ((q = F.charAt(0)) == null ? void 0 : q.toUpperCase()) || "?", P = M && M.toLowerCase() !== "undefined" ? M : "", B = Lt(f, {
|
|
806
|
+
enabled: t && T
|
|
796
807
|
}), z = ee(
|
|
797
808
|
"flex h-full flex-col border-r bg-background",
|
|
798
|
-
|
|
809
|
+
T ? ee(
|
|
799
810
|
"absolute inset-y-0 left-0 z-[51] w-60 shadow-lg transition-transform duration-300 ease-in-out",
|
|
800
811
|
t ? "translate-x-0" : "pointer-events-none -translate-x-full"
|
|
801
812
|
) : "w-full max-w-[17rem] min-w-[11rem] overflow-hidden shadow-sm",
|
|
802
|
-
|
|
813
|
+
m
|
|
803
814
|
), X = (w) => {
|
|
804
815
|
}, H = (w) => {
|
|
805
816
|
console.log("Editing dashboard:", w);
|
|
806
817
|
}, Z = (w) => {
|
|
807
|
-
|
|
818
|
+
A(w, {
|
|
808
819
|
onSuccess: ($) => {
|
|
809
|
-
|
|
820
|
+
i(!1), b($, R);
|
|
810
821
|
}
|
|
811
822
|
});
|
|
812
823
|
};
|
|
813
|
-
return /* @__PURE__ */ e(me, { children: (!
|
|
824
|
+
return /* @__PURE__ */ e(me, { children: (!T || t) && /* @__PURE__ */ a("div", { ref: B, className: z, children: [
|
|
814
825
|
/* @__PURE__ */ a("div", { className: "border-b border-border", children: [
|
|
815
826
|
/* @__PURE__ */ a("div", { className: "flex items-center justify-between px-4 py-1.5", children: [
|
|
816
|
-
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e("h2", { className: "whitespace-nowrap text-sm font-semibold", children:
|
|
827
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e("h2", { className: "whitespace-nowrap text-sm font-semibold", children: g ? "Visuals" : "Dashboards" }) }),
|
|
817
828
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-0", children: [
|
|
818
829
|
/* @__PURE__ */ e(
|
|
819
830
|
G,
|
|
820
831
|
{
|
|
821
832
|
size: "sm",
|
|
822
833
|
variant: "ghost",
|
|
823
|
-
onClick: () =>
|
|
834
|
+
onClick: () => c(!d),
|
|
824
835
|
className: "h-8 w-8 p-0",
|
|
825
|
-
children: /* @__PURE__ */ e(
|
|
836
|
+
children: /* @__PURE__ */ e(vt, { className: "h-3.5 w-3.5" })
|
|
826
837
|
}
|
|
827
838
|
),
|
|
828
|
-
(
|
|
839
|
+
(g || V) && /* @__PURE__ */ e(
|
|
829
840
|
G,
|
|
830
841
|
{
|
|
831
842
|
size: "sm",
|
|
832
843
|
variant: "ghost",
|
|
833
844
|
className: "h-8 w-8 whitespace-nowrap p-0",
|
|
834
|
-
onClick: () =>
|
|
835
|
-
children: /* @__PURE__ */ e(
|
|
845
|
+
onClick: () => i(!0),
|
|
846
|
+
children: /* @__PURE__ */ e(ue, { className: "h-3.5 w-3.5" })
|
|
836
847
|
}
|
|
837
848
|
)
|
|
838
849
|
] })
|
|
839
850
|
] }),
|
|
840
|
-
|
|
841
|
-
|
|
851
|
+
d && /* @__PURE__ */ e("div", { className: "bg-muted/30 px-4 pb-3", children: /* @__PURE__ */ e(
|
|
852
|
+
he,
|
|
842
853
|
{
|
|
843
854
|
placeholder: "Search...",
|
|
844
855
|
value: N,
|
|
845
|
-
onChange: (w) =>
|
|
856
|
+
onChange: (w) => C(w.target.value),
|
|
846
857
|
className: "h-8 border-muted-foreground/20 bg-background text-sm focus-visible:border-muted-foreground/40 focus-visible:ring-0 focus-visible:ring-offset-0",
|
|
847
858
|
autoFocus: !0
|
|
848
859
|
}
|
|
849
860
|
) })
|
|
850
861
|
] }),
|
|
851
|
-
/* @__PURE__ */ e("div", { className: "flex flex-1 flex-col overflow-auto px-2 py-2", children:
|
|
852
|
-
|
|
862
|
+
/* @__PURE__ */ e("div", { className: "flex flex-1 flex-col overflow-auto px-2 py-2", children: g ? /* @__PURE__ */ e(Ot, { searchQuery: N }) : /* @__PURE__ */ e(
|
|
863
|
+
It,
|
|
853
864
|
{
|
|
854
865
|
searchQuery: N,
|
|
855
866
|
onLoadDashboard: X,
|
|
856
867
|
onEditDashboard: H,
|
|
857
|
-
onDashboardItemClick:
|
|
868
|
+
onDashboardItemClick: r
|
|
858
869
|
}
|
|
859
870
|
) }),
|
|
860
|
-
|
|
871
|
+
p && /* @__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
872
|
/* @__PURE__ */ a(je, { children: [
|
|
862
873
|
/* @__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
874
|
/* @__PURE__ */ e(Fe, { side: "top", className: "max-w-xs", children: /* @__PURE__ */ a("div", { className: "space-y-1", children: [
|
|
864
875
|
/* @__PURE__ */ e("div", { className: "font-medium", children: F }),
|
|
865
|
-
|
|
866
|
-
|
|
876
|
+
P && /* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground", children: P }),
|
|
877
|
+
p.role && /* @__PURE__ */ a("div", { className: "text-xs text-muted-foreground", children: [
|
|
867
878
|
"Role: ",
|
|
868
|
-
|
|
879
|
+
yt(p.role.replace(/_/g, " "))
|
|
869
880
|
] })
|
|
870
881
|
] }) })
|
|
871
882
|
] }),
|
|
872
883
|
/* @__PURE__ */ e("span", { className: "truncate text-xs text-muted-foreground", children: F })
|
|
873
884
|
] }) }) }),
|
|
874
|
-
|
|
875
|
-
|
|
885
|
+
g ? /* @__PURE__ */ e(
|
|
886
|
+
Ut,
|
|
876
887
|
{
|
|
877
|
-
open:
|
|
878
|
-
onOpenChange:
|
|
879
|
-
onSubmit:
|
|
880
|
-
isCreating:
|
|
888
|
+
open: D,
|
|
889
|
+
onOpenChange: i,
|
|
890
|
+
onSubmit: S,
|
|
891
|
+
isCreating: v
|
|
881
892
|
}
|
|
882
893
|
) : /* @__PURE__ */ e(
|
|
883
|
-
|
|
894
|
+
Ct,
|
|
884
895
|
{
|
|
885
|
-
open:
|
|
886
|
-
onOpenChange:
|
|
896
|
+
open: D,
|
|
897
|
+
onOpenChange: i,
|
|
887
898
|
onSubmit: Z,
|
|
888
899
|
isCreating: I
|
|
889
900
|
}
|