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