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