react-semaphor 0.1.180 → 0.1.182
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-CS3pAVZi.js → dashboard-controls-BnBXzFOj.js} +4 -4
- package/dist/chunks/{dashboard-controls-Baw7eUyM.js → dashboard-controls-pGlGtKRR.js} +1 -1
- package/dist/chunks/{dashboard-json-Cz4bNnCC.js → dashboard-json-CiIyCwJi.js} +1 -1
- package/dist/chunks/{dashboard-json-ClalWYi4.js → dashboard-json-UVBr47Qj.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-BMElXt-n.js → edit-dashboard-visual-CXvyi_qa.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-DFJ5FJ7y.js → edit-dashboard-visual-DoP_x_tT.js} +2 -2
- package/dist/chunks/{editor-action-buttons-MtNYw1Bb.js → editor-action-buttons-5UEhKl88.js} +2 -2
- package/dist/chunks/{editor-action-buttons-DVWnnC_r.js → editor-action-buttons-Bftd6Bfx.js} +1 -1
- package/dist/chunks/{index-CfPKTeUk.js → index-D59dkH2b.js} +111 -111
- package/dist/chunks/{index-CAeKp6K8.js → index-ahdw_esL.js} +5656 -5614
- package/dist/chunks/{notification-bell-YZ8VqdwA.js → notification-bell-CKI2j8jH.js} +153 -146
- package/dist/chunks/{notification-bell-2dZI5OV0.js → notification-bell-DtWcBdzp.js} +3 -8
- package/dist/chunks/{resource-management-panel-Buhi-kvP.js → resource-management-panel-BLiCtZZE.js} +1 -1
- package/dist/chunks/{resource-management-panel-pxL28GXq.js → resource-management-panel-qkl060k8.js} +3 -3
- package/dist/chunks/{use-role-aware-display-preferences-B_i2f9tn.js → use-role-aware-display-preferences-CLf3yEts.js} +1 -1
- package/dist/chunks/{use-role-aware-display-preferences-JljRcjrP.js → use-role-aware-display-preferences-JstD5WLE.js} +1 -1
- package/dist/chunks/{use-visual-utils-D3HjbsKO.js → use-visual-utils-BbN7rxtD.js} +1 -1
- package/dist/chunks/{use-visual-utils-DPEHcmFT.js → use-visual-utils-TGjvLx_R.js} +1 -1
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +5 -5
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import oe, { useState as A, useRef as V, useCallback as M, useEffect as D, useContext as ie } from "react";
|
|
2
|
-
import { aF as
|
|
2
|
+
import { aF as O, aN as B, a0 as I, aC as $, ay as ae, az as _, a1 as se, ax as le, bu as ce, bv as de, bw as ue, bx as me, by as he, bz as R, bA as pe, bG as fe, bH as j, bB as ge, B as S, aG as H, au as P, aI as ve, u as E, aO as be, as as re, bI as xe, bJ as G, aL as U, A as we, bK as Ce, c as T, aV as X, aW as q, aX as W, aY as Q, aZ as Y, av as Ne, bL as ye, bM as Ae, bN as Se, bb as Ee, bc as De, bd as Ie, bO as ke, be as Ue, bf as Te, bg as Fe, bh as Me, bi as Pe, W as Le, I as Ve, bP as ze, bQ as Re, aE as Oe, X as Be, bR as $e, bS as _e, bT as He, aA as Z, a3 as je, P as Ge, p as Xe, bU as qe, r as We } from "./index-ahdw_esL.js";
|
|
3
3
|
import { jsx as t, jsxs as r, Fragment as L } from "react/jsx-runtime";
|
|
4
|
-
import { E as
|
|
5
|
-
import { a as ne } from "./use-visual-utils-
|
|
4
|
+
import { E as Qe, V as Ye, a as Ze, b as Je, S as J, c as Ke, C as et } from "./editor-action-buttons-5UEhKl88.js";
|
|
5
|
+
import { a as ne } from "./use-visual-utils-BbN7rxtD.js";
|
|
6
6
|
import { a as K } from "./index-B4EhQdS9.js";
|
|
7
7
|
/**
|
|
8
8
|
* @license lucide-react v0.453.0 - ISC
|
|
@@ -10,17 +10,7 @@ import { a as K } from "./index-B4EhQdS9.js";
|
|
|
10
10
|
* This source code is licensed under the ISC license.
|
|
11
11
|
* See the LICENSE file in the root directory of this source tree.
|
|
12
12
|
*/
|
|
13
|
-
const
|
|
14
|
-
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
15
|
-
["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
|
|
16
|
-
]);
|
|
17
|
-
/**
|
|
18
|
-
* @license lucide-react v0.453.0 - ISC
|
|
19
|
-
*
|
|
20
|
-
* This source code is licensed under the ISC license.
|
|
21
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
22
|
-
*/
|
|
23
|
-
const tt = z("CirclePlus", [
|
|
13
|
+
const tt = O("CirclePlus", [
|
|
24
14
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
25
15
|
["path", { d: "M8 12h8", key: "1wcyev" }],
|
|
26
16
|
["path", { d: "M12 8v8", key: "napkw2" }]
|
|
@@ -31,7 +21,7 @@ const tt = z("CirclePlus", [
|
|
|
31
21
|
* This source code is licensed under the ISC license.
|
|
32
22
|
* See the LICENSE file in the root directory of this source tree.
|
|
33
23
|
*/
|
|
34
|
-
const ee =
|
|
24
|
+
const ee = O("FileDown", [
|
|
35
25
|
["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
|
|
36
26
|
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
|
|
37
27
|
["path", { d: "M12 18v-6", key: "17g6i2" }],
|
|
@@ -43,7 +33,7 @@ const ee = z("FileDown", [
|
|
|
43
33
|
* This source code is licensed under the ISC license.
|
|
44
34
|
* See the LICENSE file in the root directory of this source tree.
|
|
45
35
|
*/
|
|
46
|
-
const at =
|
|
36
|
+
const at = O("RefreshCw", [
|
|
47
37
|
["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", key: "v9h5vc" }],
|
|
48
38
|
["path", { d: "M21 3v5h-5", key: "1q7to0" }],
|
|
49
39
|
["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", key: "3uifl3" }],
|
|
@@ -54,21 +44,21 @@ function lt(e) {
|
|
|
54
44
|
return a < ot ? st : a < it ? rt : nt;
|
|
55
45
|
}
|
|
56
46
|
function wt() {
|
|
57
|
-
const { authToken: e, tokenProps: a } = B(), c = I((
|
|
47
|
+
const { authToken: e, tokenProps: a } = B(), c = I((g) => g.activeExports), [n, m] = A(
|
|
58
48
|
typeof document < "u" ? !document.hidden : !0
|
|
59
|
-
), l = V(null), o = V(!1), s = V(void 0), h = a == null ? void 0 : a.apiServiceUrl, d = e == null ? void 0 : e.accessToken,
|
|
60
|
-
const
|
|
61
|
-
return Array.from(
|
|
62
|
-
(
|
|
49
|
+
), l = V(null), o = V(!1), s = V(void 0), h = a == null ? void 0 : a.apiServiceUrl, d = e == null ? void 0 : e.accessToken, v = M(() => {
|
|
50
|
+
const g = I.getState().activeExports;
|
|
51
|
+
return Array.from(g.values()).filter(
|
|
52
|
+
(x) => $(x.status)
|
|
63
53
|
);
|
|
64
54
|
}, []);
|
|
65
55
|
D(() => {
|
|
66
56
|
if (typeof document > "u") return;
|
|
67
|
-
const
|
|
57
|
+
const g = () => {
|
|
68
58
|
m(!document.hidden);
|
|
69
59
|
};
|
|
70
|
-
return document.addEventListener("visibilitychange",
|
|
71
|
-
document.removeEventListener("visibilitychange",
|
|
60
|
+
return document.addEventListener("visibilitychange", g), () => {
|
|
61
|
+
document.removeEventListener("visibilitychange", g);
|
|
72
62
|
};
|
|
73
63
|
}, []);
|
|
74
64
|
const C = M(async () => {
|
|
@@ -76,13 +66,13 @@ function wt() {
|
|
|
76
66
|
o.current = !1;
|
|
77
67
|
return;
|
|
78
68
|
}
|
|
79
|
-
const
|
|
80
|
-
if (
|
|
69
|
+
const g = v();
|
|
70
|
+
if (g.length === 0) {
|
|
81
71
|
o.current = !1;
|
|
82
72
|
return;
|
|
83
73
|
}
|
|
84
|
-
const
|
|
85
|
-
(p) =>
|
|
74
|
+
const x = Date.now(), y = g.filter(
|
|
75
|
+
(p) => x - p.startedAt.getTime() > te
|
|
86
76
|
);
|
|
87
77
|
if (y.length > 0) {
|
|
88
78
|
const { updateExport: p } = I.getState().actions;
|
|
@@ -93,14 +83,14 @@ function wt() {
|
|
|
93
83
|
lastUpdatedAt: /* @__PURE__ */ new Date()
|
|
94
84
|
});
|
|
95
85
|
}
|
|
96
|
-
const f =
|
|
97
|
-
(p) =>
|
|
86
|
+
const f = g.filter(
|
|
87
|
+
(p) => x - p.startedAt.getTime() <= te
|
|
98
88
|
);
|
|
99
89
|
if (f.length === 0) {
|
|
100
90
|
o.current = !1;
|
|
101
91
|
return;
|
|
102
92
|
}
|
|
103
|
-
const
|
|
93
|
+
const b = await Promise.allSettled(
|
|
104
94
|
f.map(async (p) => {
|
|
105
95
|
try {
|
|
106
96
|
const i = await ae(h, d, p.id);
|
|
@@ -133,9 +123,9 @@ function wt() {
|
|
|
133
123
|
}
|
|
134
124
|
})
|
|
135
125
|
), { updateExport: N } = I.getState().actions;
|
|
136
|
-
for (const p of
|
|
126
|
+
for (const p of b)
|
|
137
127
|
p.status === "fulfilled" && p.value && N(p.value.id, p.value);
|
|
138
|
-
const u =
|
|
128
|
+
const u = v();
|
|
139
129
|
if (u.length > 0 && !document.hidden) {
|
|
140
130
|
const p = u.reduce(
|
|
141
131
|
(w, F) => F.startedAt < w ? F.startedAt : w,
|
|
@@ -147,24 +137,24 @@ function wt() {
|
|
|
147
137
|
}, i);
|
|
148
138
|
} else
|
|
149
139
|
o.current = !1;
|
|
150
|
-
}, [h, d,
|
|
140
|
+
}, [h, d, v]);
|
|
151
141
|
return D(() => {
|
|
152
142
|
s.current = C;
|
|
153
143
|
}, [C]), D(() => {
|
|
154
|
-
var
|
|
155
|
-
|
|
156
|
-
}, [c, n,
|
|
157
|
-
var
|
|
158
|
-
const
|
|
159
|
-
n &&
|
|
160
|
-
}, [n,
|
|
144
|
+
var x;
|
|
145
|
+
v().length > 0 && n && !o.current && (o.current = !0, (x = s.current) == null || x.call(s));
|
|
146
|
+
}, [c, n, v]), D(() => {
|
|
147
|
+
var x;
|
|
148
|
+
const g = v();
|
|
149
|
+
n && g.length > 0 && !o.current && (o.current = !0, (x = s.current) == null || x.call(s));
|
|
150
|
+
}, [n, v]), D(() => {
|
|
161
151
|
!n && l.current && (clearTimeout(l.current), l.current = null, o.current = !1);
|
|
162
152
|
}, [n]), D(() => () => {
|
|
163
153
|
l.current && (clearTimeout(l.current), l.current = null);
|
|
164
154
|
}, []), {
|
|
165
155
|
isPolling: o.current,
|
|
166
156
|
isTabVisible: n,
|
|
167
|
-
inProgressCount:
|
|
157
|
+
inProgressCount: v().length
|
|
168
158
|
};
|
|
169
159
|
}
|
|
170
160
|
function Ct() {
|
|
@@ -180,21 +170,21 @@ function Ct() {
|
|
|
180
170
|
});
|
|
181
171
|
for (const d of h) {
|
|
182
172
|
if (c.has(d.id)) continue;
|
|
183
|
-
const
|
|
173
|
+
const v = d.totalChunks ? Math.round(d.completedChunks / d.totalChunks * 100) : 0;
|
|
184
174
|
let C;
|
|
185
175
|
if (d.status === "completed")
|
|
186
176
|
try {
|
|
187
177
|
C = await _(l, o, d.id);
|
|
188
|
-
} catch (
|
|
178
|
+
} catch (x) {
|
|
189
179
|
console.error(
|
|
190
180
|
`[useExportRecovery] Failed to get download URL for ${d.id}:`,
|
|
191
|
-
|
|
181
|
+
x
|
|
192
182
|
);
|
|
193
183
|
}
|
|
194
|
-
const
|
|
184
|
+
const g = {
|
|
195
185
|
id: d.id,
|
|
196
186
|
status: d.status,
|
|
197
|
-
progress:
|
|
187
|
+
progress: v,
|
|
198
188
|
title: ct(d),
|
|
199
189
|
totalRows: d.totalRows,
|
|
200
190
|
totalChunks: d.totalChunks,
|
|
@@ -207,7 +197,7 @@ function Ct() {
|
|
|
207
197
|
expiresAt: new Date(d.expiresAt),
|
|
208
198
|
downloadUrl: C
|
|
209
199
|
};
|
|
210
|
-
n(
|
|
200
|
+
n(g);
|
|
211
201
|
}
|
|
212
202
|
m.current = !0;
|
|
213
203
|
} catch (h) {
|
|
@@ -231,20 +221,20 @@ function dt({
|
|
|
231
221
|
}) {
|
|
232
222
|
const [o, s] = A(
|
|
233
223
|
c && n ? `Copy of ${n}` : n || ""
|
|
234
|
-
), [h, d] = A(""), [
|
|
224
|
+
), [h, d] = A(""), [v, C] = A(!c), [g, x] = A(!0);
|
|
235
225
|
oe.useEffect(() => {
|
|
236
226
|
e && (s(
|
|
237
227
|
c && n ? `Copy of ${n}` : n || ""
|
|
238
|
-
), d(""), C(!c),
|
|
228
|
+
), d(""), C(!c), x(!0));
|
|
239
229
|
}, [e, c, n]);
|
|
240
230
|
const y = () => {
|
|
241
|
-
o.trim() && (!
|
|
231
|
+
o.trim() && (!v && !g || l({
|
|
242
232
|
name: o.trim(),
|
|
243
233
|
description: h.trim() || void 0,
|
|
244
|
-
saveToLibrary:
|
|
245
|
-
saveToCurrentDashboard:
|
|
234
|
+
saveToLibrary: v,
|
|
235
|
+
saveToCurrentDashboard: g
|
|
246
236
|
}));
|
|
247
|
-
}, f = o.trim() && (
|
|
237
|
+
}, f = o.trim() && (v || g);
|
|
248
238
|
return /* @__PURE__ */ t(ce, { open: e, onOpenChange: a, children: /* @__PURE__ */ r(de, { className: "sm:max-w-[425px]", children: [
|
|
249
239
|
/* @__PURE__ */ r(ue, { children: [
|
|
250
240
|
/* @__PURE__ */ t(me, { children: "Save Visual As" }),
|
|
@@ -252,26 +242,26 @@ function dt({
|
|
|
252
242
|
] }),
|
|
253
243
|
/* @__PURE__ */ r("div", { className: "grid gap-4 py-4", children: [
|
|
254
244
|
/* @__PURE__ */ r("div", { className: "grid gap-2", children: [
|
|
255
|
-
/* @__PURE__ */ t(
|
|
245
|
+
/* @__PURE__ */ t(R, { htmlFor: "name", children: "Name" }),
|
|
256
246
|
/* @__PURE__ */ t(
|
|
257
247
|
pe,
|
|
258
248
|
{
|
|
259
249
|
id: "name",
|
|
260
250
|
value: o,
|
|
261
|
-
onChange: (
|
|
251
|
+
onChange: (b) => s(b.target.value),
|
|
262
252
|
placeholder: "Enter visual name",
|
|
263
253
|
disabled: m
|
|
264
254
|
}
|
|
265
255
|
)
|
|
266
256
|
] }),
|
|
267
257
|
/* @__PURE__ */ r("div", { className: "grid gap-2", children: [
|
|
268
|
-
/* @__PURE__ */ t(
|
|
258
|
+
/* @__PURE__ */ t(R, { htmlFor: "description", children: "Description (optional)" }),
|
|
269
259
|
/* @__PURE__ */ t(
|
|
270
260
|
fe,
|
|
271
261
|
{
|
|
272
262
|
id: "description",
|
|
273
263
|
value: h,
|
|
274
|
-
onChange: (
|
|
264
|
+
onChange: (b) => d(b.target.value),
|
|
275
265
|
placeholder: "Enter visual description",
|
|
276
266
|
rows: 3,
|
|
277
267
|
disabled: m
|
|
@@ -279,15 +269,15 @@ function dt({
|
|
|
279
269
|
)
|
|
280
270
|
] }),
|
|
281
271
|
/* @__PURE__ */ r("div", { className: "space-y-4", children: [
|
|
282
|
-
/* @__PURE__ */ t(
|
|
272
|
+
/* @__PURE__ */ t(R, { children: "Save to:" }),
|
|
283
273
|
/* @__PURE__ */ r("div", { className: "space-y-2", children: [
|
|
284
274
|
/* @__PURE__ */ r("div", { className: "flex items-center space-x-2", children: [
|
|
285
275
|
/* @__PURE__ */ t(
|
|
286
276
|
j,
|
|
287
277
|
{
|
|
288
278
|
id: "save-to-dashboard",
|
|
289
|
-
checked:
|
|
290
|
-
onCheckedChange: (
|
|
279
|
+
checked: g,
|
|
280
|
+
onCheckedChange: (b) => x(!!b),
|
|
291
281
|
disabled: m
|
|
292
282
|
}
|
|
293
283
|
),
|
|
@@ -308,8 +298,8 @@ function dt({
|
|
|
308
298
|
j,
|
|
309
299
|
{
|
|
310
300
|
id: "save-to-library",
|
|
311
|
-
checked:
|
|
312
|
-
onCheckedChange: (
|
|
301
|
+
checked: v,
|
|
302
|
+
onCheckedChange: (b) => C(!!b),
|
|
313
303
|
disabled: m
|
|
314
304
|
}
|
|
315
305
|
),
|
|
@@ -326,7 +316,7 @@ function dt({
|
|
|
326
316
|
)
|
|
327
317
|
] })
|
|
328
318
|
] }),
|
|
329
|
-
!
|
|
319
|
+
!v && !g && /* @__PURE__ */ t("p", { className: "text-sm text-destructive", children: "Please select at least one destination" })
|
|
330
320
|
] })
|
|
331
321
|
] }),
|
|
332
322
|
/* @__PURE__ */ r(ge, { children: [
|
|
@@ -347,23 +337,23 @@ function dt({
|
|
|
347
337
|
] }) });
|
|
348
338
|
}
|
|
349
339
|
function ut() {
|
|
350
|
-
const [e, a] = A(!1), [c, n] = A(!1), [m, l] = A(null), o = P((i) => i.frame), s = P((i) => i.card), h = ve(), d = E((i) => i.selectedSheetId),
|
|
340
|
+
const [e, a] = A(!1), [c, n] = A(!1), [m, l] = A(null), o = P((i) => i.frame), s = P((i) => i.card), h = ve(), d = E((i) => i.selectedSheetId), v = E(
|
|
351
341
|
(i) => i.actions.setIsDashboardPanelOpen
|
|
352
|
-
), { getUpdatedFrame: C } = ne(), { selectVisual:
|
|
342
|
+
), { getUpdatedFrame: C } = ne(), { selectVisual: g } = be(), { addFrame: x, setSelectedFrameId: y, setIsVisualEditing: f } = re(), b = !!(o != null && o.visualId), N = (() => {
|
|
353
343
|
var i, w;
|
|
354
344
|
return ((i = o == null ? void 0 : o.cards) == null ? void 0 : i.length) === 1 && ((w = o.cards[0]) != null && w.title) ? o.cards[0].title : h != null && h.title ? h.title : (s == null ? void 0 : s.title) || "Untitled Visual";
|
|
355
|
-
})(), u =
|
|
345
|
+
})(), u = xe((i) => {
|
|
356
346
|
if (i != null && i.id) {
|
|
357
|
-
if (
|
|
347
|
+
if (g(i), c && m && d) {
|
|
358
348
|
const w = {
|
|
359
349
|
...m,
|
|
360
350
|
id: G(),
|
|
361
351
|
visualId: i.id
|
|
362
352
|
// Link to the newly created library visual
|
|
363
353
|
};
|
|
364
|
-
|
|
354
|
+
x(d, w, "end"), y(w.id), n(!1), l(null), f(!1);
|
|
365
355
|
}
|
|
366
|
-
|
|
356
|
+
v(!0), a(!1);
|
|
367
357
|
}
|
|
368
358
|
});
|
|
369
359
|
return {
|
|
@@ -371,10 +361,10 @@ function ut() {
|
|
|
371
361
|
setSaveAsDialogOpen: a,
|
|
372
362
|
handleSaveAs: async (i) => {
|
|
373
363
|
if (!d) {
|
|
374
|
-
|
|
364
|
+
U.error("No sheet selected");
|
|
375
365
|
return;
|
|
376
366
|
}
|
|
377
|
-
const w = C(),
|
|
367
|
+
const w = C(), z = w.cards.length === 1 ? {
|
|
378
368
|
...w,
|
|
379
369
|
cards: w.cards.map((k) => ({
|
|
380
370
|
...k,
|
|
@@ -383,27 +373,27 @@ function ut() {
|
|
|
383
373
|
}))
|
|
384
374
|
} : w;
|
|
385
375
|
if (i.saveToLibrary) {
|
|
386
|
-
n(i.saveToCurrentDashboard), l(
|
|
376
|
+
n(i.saveToCurrentDashboard), l(z);
|
|
387
377
|
const k = {
|
|
388
378
|
title: i.name,
|
|
389
379
|
description: i.description,
|
|
390
|
-
frameObject:
|
|
380
|
+
frameObject: z,
|
|
391
381
|
// Card title synced for single-card frames
|
|
392
382
|
isPrivate: !1
|
|
393
383
|
};
|
|
394
384
|
u.mutate(k);
|
|
395
385
|
} else if (i.saveToCurrentDashboard) {
|
|
396
386
|
const k = {
|
|
397
|
-
...
|
|
387
|
+
...z,
|
|
398
388
|
// Card title already synced
|
|
399
389
|
id: G(),
|
|
400
390
|
visualId: void 0
|
|
401
391
|
// Explicitly no visualId for local visuals
|
|
402
392
|
};
|
|
403
|
-
|
|
393
|
+
x(d, k, "end"), y(k.id), U.success("Visual saved to dashboard"), a(!1), f(!1);
|
|
404
394
|
}
|
|
405
395
|
},
|
|
406
|
-
isLibraryVisual:
|
|
396
|
+
isLibraryVisual: b,
|
|
407
397
|
currentVisualName: N,
|
|
408
398
|
isSaving: u.isPending
|
|
409
399
|
};
|
|
@@ -412,33 +402,33 @@ function Nt({
|
|
|
412
402
|
className: e
|
|
413
403
|
}) {
|
|
414
404
|
const a = P((u) => u.frame), c = P((u) => u.card), n = we((u) => u.selectedVisual), m = E((u) => u.selectedFrameId), l = E((u) => u.selectedSheetId), { setIsVisualEditing: o } = re(), s = !!(a != null && a.visualId || n != null && n.id), h = !!(a != null && a.visualId && m), d = s && !h, {
|
|
415
|
-
saveAsDialogOpen:
|
|
405
|
+
saveAsDialogOpen: v,
|
|
416
406
|
setSaveAsDialogOpen: C,
|
|
417
|
-
handleSaveAs:
|
|
418
|
-
isLibraryVisual:
|
|
407
|
+
handleSaveAs: g,
|
|
408
|
+
isLibraryVisual: x,
|
|
419
409
|
currentVisualName: y,
|
|
420
410
|
isSaving: f
|
|
421
|
-
} = ut(), { handleAddLibraryVisual:
|
|
411
|
+
} = ut(), { handleAddLibraryVisual: b } = ne(), N = async () => {
|
|
422
412
|
if (!l) {
|
|
423
|
-
|
|
413
|
+
U.error("No dashboard sheet selected");
|
|
424
414
|
return;
|
|
425
415
|
}
|
|
426
416
|
if (!n) {
|
|
427
|
-
|
|
417
|
+
U.error("No visual selected");
|
|
428
418
|
return;
|
|
429
419
|
}
|
|
430
|
-
const u = await
|
|
431
|
-
u.success ? (
|
|
420
|
+
const u = await b(n);
|
|
421
|
+
u.success ? (U.success("Visual added to dashboard"), o(!1)) : U.error(u.error || "Failed to add visual to dashboard");
|
|
432
422
|
};
|
|
433
423
|
return /* @__PURE__ */ r(L, { children: [
|
|
434
|
-
!s && /* @__PURE__ */ t(
|
|
424
|
+
!s && /* @__PURE__ */ t(Qe, { className: e, variant: "default" }),
|
|
435
425
|
s && /* @__PURE__ */ r(L, { children: [
|
|
436
|
-
h && /* @__PURE__ */ t(
|
|
426
|
+
h && /* @__PURE__ */ t(Ye, { className: e }),
|
|
437
427
|
d && l && c && (c.sql || Ce(c.config)) && /* @__PURE__ */ r(
|
|
438
428
|
S,
|
|
439
429
|
{
|
|
440
430
|
onClick: N,
|
|
441
|
-
className:
|
|
431
|
+
className: T(e),
|
|
442
432
|
size: "sm",
|
|
443
433
|
variant: "outline",
|
|
444
434
|
children: [
|
|
@@ -447,15 +437,15 @@ function Nt({
|
|
|
447
437
|
]
|
|
448
438
|
}
|
|
449
439
|
),
|
|
450
|
-
d && /* @__PURE__ */ t(
|
|
451
|
-
h && /* @__PURE__ */ t(
|
|
440
|
+
d && /* @__PURE__ */ t(Ze, { className: e, variant: "default" }),
|
|
441
|
+
h && /* @__PURE__ */ t(Je, { className: e }),
|
|
452
442
|
/* @__PURE__ */ r(X, { modal: !1, children: [
|
|
453
443
|
/* @__PURE__ */ t(q, { asChild: !0, children: /* @__PURE__ */ t(
|
|
454
444
|
S,
|
|
455
445
|
{
|
|
456
446
|
variant: "outline",
|
|
457
447
|
size: "sm",
|
|
458
|
-
className:
|
|
448
|
+
className: T(e, "w-8 p-0"),
|
|
459
449
|
children: /* @__PURE__ */ t(W, { className: "h-4 w-4" })
|
|
460
450
|
}
|
|
461
451
|
) }),
|
|
@@ -479,7 +469,7 @@ function Nt({
|
|
|
479
469
|
{
|
|
480
470
|
variant: "outline",
|
|
481
471
|
size: "sm",
|
|
482
|
-
className:
|
|
472
|
+
className: T(e, "w-8 p-0"),
|
|
483
473
|
children: /* @__PURE__ */ t(W, { className: "h-4 w-4" })
|
|
484
474
|
}
|
|
485
475
|
) }),
|
|
@@ -488,18 +478,18 @@ function Nt({
|
|
|
488
478
|
"Save As..."
|
|
489
479
|
] }) })
|
|
490
480
|
] }),
|
|
491
|
-
/* @__PURE__ */ t(
|
|
481
|
+
/* @__PURE__ */ t(Ke, { className: e }),
|
|
492
482
|
/* @__PURE__ */ t(
|
|
493
483
|
dt,
|
|
494
484
|
{
|
|
495
|
-
open:
|
|
485
|
+
open: v,
|
|
496
486
|
onOpenChange: (u) => {
|
|
497
487
|
f || C(u);
|
|
498
488
|
},
|
|
499
|
-
isLibraryVisual:
|
|
489
|
+
isLibraryVisual: x,
|
|
500
490
|
currentVisualName: y,
|
|
501
491
|
isSaving: f,
|
|
502
|
-
onConfirm:
|
|
492
|
+
onConfirm: g
|
|
503
493
|
}
|
|
504
494
|
)
|
|
505
495
|
] });
|
|
@@ -510,11 +500,11 @@ function yt({
|
|
|
510
500
|
switchClassName: a
|
|
511
501
|
}) {
|
|
512
502
|
const c = P((s) => s.isDevMode), n = E((s) => s.isVisualEditing), { setIsDevMode: m } = Ne(), { config: l } = ie(ye).tokenProps, o = (l == null ? void 0 : l.showAdvancedMode) !== !1;
|
|
513
|
-
return !n || !o ? null : /* @__PURE__ */ r("div", { className:
|
|
503
|
+
return !n || !o ? null : /* @__PURE__ */ r("div", { className: T("flex items-center space-x-2", e), children: [
|
|
514
504
|
/* @__PURE__ */ t(
|
|
515
505
|
Ae,
|
|
516
506
|
{
|
|
517
|
-
className:
|
|
507
|
+
className: T("", a),
|
|
518
508
|
checked: c,
|
|
519
509
|
onCheckedChange: () => m(!c),
|
|
520
510
|
id: "advanced-mode",
|
|
@@ -538,9 +528,9 @@ function At({
|
|
|
538
528
|
/* @__PURE__ */ r(Ie, { children: [
|
|
539
529
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-3", children: [
|
|
540
530
|
/* @__PURE__ */ t("div", { className: "flex h-10 w-10 items-center justify-center rounded-full bg-amber-100", children: /* @__PURE__ */ t(ke, { className: "h-5 w-5 text-amber-600" }) }),
|
|
541
|
-
/* @__PURE__ */ t(
|
|
531
|
+
/* @__PURE__ */ t(Ue, { className: "text-xl", children: "Unsaved Changes" })
|
|
542
532
|
] }),
|
|
543
|
-
/* @__PURE__ */ t(
|
|
533
|
+
/* @__PURE__ */ t(Te, { className: "pt-2 text-base leading-relaxed", children: "You have unsaved changes to this dashboard. What would you like to do?" })
|
|
544
534
|
] }),
|
|
545
535
|
/* @__PURE__ */ r(Fe, { className: "flex-col gap-2 sm:flex-row sm:gap-2", children: [
|
|
546
536
|
/* @__PURE__ */ t(
|
|
@@ -598,7 +588,7 @@ function Et({
|
|
|
598
588
|
Ve,
|
|
599
589
|
{
|
|
600
590
|
tooltip: "Schedule Dashboard",
|
|
601
|
-
className:
|
|
591
|
+
className: T("h-7 p-2", e),
|
|
602
592
|
onClick: () => c(!0),
|
|
603
593
|
children: /* @__PURE__ */ t(ze, { className: "size-4" })
|
|
604
594
|
}
|
|
@@ -625,9 +615,9 @@ function mt({
|
|
|
625
615
|
}, m = () => {
|
|
626
616
|
switch (e.status) {
|
|
627
617
|
case "completed":
|
|
628
|
-
return /* @__PURE__ */ t(
|
|
618
|
+
return /* @__PURE__ */ t(He, { className: "mt-0.5 h-5 w-5 shrink-0 text-green-600" });
|
|
629
619
|
case "failed":
|
|
630
|
-
return /* @__PURE__ */ t(
|
|
620
|
+
return /* @__PURE__ */ t(et, { className: "mt-0.5 h-5 w-5 shrink-0 text-destructive" });
|
|
631
621
|
default:
|
|
632
622
|
return /* @__PURE__ */ t(H, { className: "text-foreground-muted mt-0.5 h-5 w-5 shrink-0 animate-spin" });
|
|
633
623
|
}
|
|
@@ -706,24 +696,28 @@ function mt({
|
|
|
706
696
|
] });
|
|
707
697
|
}
|
|
708
698
|
function ht() {
|
|
709
|
-
const { authToken: e, tokenProps: a } = B(), c = I((f) => f.activeExports), { clearCompleted: n, removeExport: m, updateExport: l } = se(), [o, s] = A(!1), [h, d] = A(!1),
|
|
710
|
-
(f,
|
|
711
|
-
), C =
|
|
699
|
+
const { authToken: e, tokenProps: a } = B(), c = I((f) => f.activeExports), { clearCompleted: n, removeExport: m, updateExport: l } = se(), [o, s] = A(!1), [h, d] = A(!1), v = Array.from(c.values()).sort(
|
|
700
|
+
(f, b) => b.startedAt.getTime() - f.startedAt.getTime()
|
|
701
|
+
), C = v.some(
|
|
712
702
|
(f) => f.status === "completed" || f.status === "failed"
|
|
713
|
-
),
|
|
714
|
-
const f = a == null ? void 0 : a.apiServiceUrl,
|
|
715
|
-
if (!(!f || !
|
|
703
|
+
), g = M(async () => {
|
|
704
|
+
const f = a == null ? void 0 : a.apiServiceUrl, b = e == null ? void 0 : e.accessToken;
|
|
705
|
+
if (!(!f || !b)) {
|
|
716
706
|
s(!0);
|
|
717
707
|
try {
|
|
718
708
|
const N = Array.from(c.values());
|
|
719
709
|
await Promise.all(
|
|
720
710
|
N.map(async (u) => {
|
|
721
711
|
try {
|
|
722
|
-
const p = await ae(f,
|
|
712
|
+
const p = await ae(f, b, u.id);
|
|
723
713
|
let i;
|
|
724
714
|
if (p.status === "completed")
|
|
725
715
|
try {
|
|
726
|
-
i = await _(
|
|
716
|
+
i = await _(
|
|
717
|
+
f,
|
|
718
|
+
b,
|
|
719
|
+
u.id
|
|
720
|
+
);
|
|
727
721
|
} catch (w) {
|
|
728
722
|
console.error(`Failed to get download URL for ${u.id}:`, w);
|
|
729
723
|
}
|
|
@@ -746,20 +740,25 @@ function ht() {
|
|
|
746
740
|
s(!1);
|
|
747
741
|
}
|
|
748
742
|
}
|
|
749
|
-
}, [
|
|
750
|
-
|
|
751
|
-
|
|
743
|
+
}, [
|
|
744
|
+
c,
|
|
745
|
+
e == null ? void 0 : e.accessToken,
|
|
746
|
+
a == null ? void 0 : a.apiServiceUrl,
|
|
747
|
+
l
|
|
748
|
+
]), x = M(async () => {
|
|
749
|
+
const f = a == null ? void 0 : a.apiServiceUrl, b = e == null ? void 0 : e.accessToken;
|
|
750
|
+
if (!f || !b) {
|
|
752
751
|
n();
|
|
753
752
|
return;
|
|
754
753
|
}
|
|
755
754
|
d(!0);
|
|
756
755
|
try {
|
|
757
|
-
const N =
|
|
756
|
+
const N = v.filter(
|
|
758
757
|
(u) => u.status === "completed" || u.status === "failed"
|
|
759
758
|
);
|
|
760
759
|
await Promise.all(
|
|
761
760
|
N.map(
|
|
762
|
-
(u) => Z(f,
|
|
761
|
+
(u) => Z(f, b, u.id).catch(
|
|
763
762
|
(p) => console.error(`Failed to delete export ${u.id}:`, p)
|
|
764
763
|
)
|
|
765
764
|
)
|
|
@@ -767,22 +766,30 @@ function ht() {
|
|
|
767
766
|
} finally {
|
|
768
767
|
d(!1);
|
|
769
768
|
}
|
|
770
|
-
}, [
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
769
|
+
}, [
|
|
770
|
+
v,
|
|
771
|
+
a == null ? void 0 : a.apiServiceUrl,
|
|
772
|
+
e == null ? void 0 : e.accessToken,
|
|
773
|
+
n
|
|
774
|
+
]), y = M(
|
|
775
|
+
async (f) => {
|
|
776
|
+
const b = a == null ? void 0 : a.apiServiceUrl, N = e == null ? void 0 : e.accessToken;
|
|
777
|
+
if (b && N)
|
|
778
|
+
try {
|
|
779
|
+
await Z(b, N, f);
|
|
780
|
+
} catch (u) {
|
|
781
|
+
console.error(`Failed to cancel export ${f}:`, u);
|
|
782
|
+
}
|
|
783
|
+
m(f);
|
|
784
|
+
},
|
|
785
|
+
[a == null ? void 0 : a.apiServiceUrl, e == null ? void 0 : e.accessToken, m]
|
|
786
|
+
);
|
|
787
|
+
return v.length === 0 ? /* @__PURE__ */ r("div", { className: "p-6 text-center", children: [
|
|
788
|
+
/* @__PURE__ */ t(ee, { className: "mx-auto mb-2 h-8 w-8 text-muted-foreground" }),
|
|
782
789
|
/* @__PURE__ */ t("p", { className: "text-sm text-muted-foreground", children: "No active exports" }),
|
|
783
|
-
/* @__PURE__ */ t("p", { className: "text-xs text-muted-foreground
|
|
790
|
+
/* @__PURE__ */ t("p", { className: "mt-1 text-xs text-muted-foreground", children: "Large exports will appear here" })
|
|
784
791
|
] }) : /* @__PURE__ */ r("div", { className: "flex flex-col", children: [
|
|
785
|
-
/* @__PURE__ */ r("div", { className: "
|
|
792
|
+
/* @__PURE__ */ r("div", { className: "flex items-center justify-between border-b px-4 py-3", children: [
|
|
786
793
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
787
794
|
/* @__PURE__ */ t(ee, { className: "h-5 w-5 text-muted-foreground" }),
|
|
788
795
|
/* @__PURE__ */ t("h4", { className: "font-semibold", children: "Exports" })
|
|
@@ -794,10 +801,15 @@ function ht() {
|
|
|
794
801
|
variant: "ghost",
|
|
795
802
|
size: "sm",
|
|
796
803
|
className: "h-7 w-7 p-0",
|
|
797
|
-
onClick:
|
|
804
|
+
onClick: g,
|
|
798
805
|
disabled: o,
|
|
799
806
|
title: "Refresh status",
|
|
800
|
-
children: /* @__PURE__ */ t(
|
|
807
|
+
children: /* @__PURE__ */ t(
|
|
808
|
+
at,
|
|
809
|
+
{
|
|
810
|
+
className: `h-4 w-4 ${o ? "animate-spin" : ""}`
|
|
811
|
+
}
|
|
812
|
+
)
|
|
801
813
|
}
|
|
802
814
|
),
|
|
803
815
|
C && /* @__PURE__ */ t(
|
|
@@ -805,35 +817,30 @@ function ht() {
|
|
|
805
817
|
{
|
|
806
818
|
variant: "ghost",
|
|
807
819
|
size: "sm",
|
|
808
|
-
className: "h-7 text-sm
|
|
809
|
-
onClick:
|
|
820
|
+
className: "h-7 px-2 text-sm",
|
|
821
|
+
onClick: x,
|
|
810
822
|
disabled: h,
|
|
811
823
|
children: h ? "Clearing..." : "Clear all"
|
|
812
824
|
}
|
|
813
825
|
)
|
|
814
826
|
] })
|
|
815
827
|
] }),
|
|
816
|
-
/* @__PURE__ */ t("div", { className: "max-h-[350px] overflow-y-auto", children: /* @__PURE__ */ t("div", { className: "divide-y", children:
|
|
828
|
+
/* @__PURE__ */ t("div", { className: "max-h-[350px] overflow-y-auto", children: /* @__PURE__ */ t("div", { className: "divide-y", children: v.map((f) => /* @__PURE__ */ t(
|
|
817
829
|
mt,
|
|
818
830
|
{
|
|
819
831
|
export: f,
|
|
820
832
|
onRemove: y
|
|
821
833
|
},
|
|
822
834
|
f.id
|
|
823
|
-
)) }) })
|
|
824
|
-
/* @__PURE__ */ r("div", { className: "px-4 py-2 border-t text-sm text-muted-foreground text-center", children: [
|
|
825
|
-
g.length,
|
|
826
|
-
" total export",
|
|
827
|
-
g.length !== 1 ? "s" : ""
|
|
828
|
-
] })
|
|
835
|
+
)) }) })
|
|
829
836
|
] });
|
|
830
837
|
}
|
|
831
838
|
function Dt() {
|
|
832
|
-
const e = I((s) => s.activeExports), a =
|
|
839
|
+
const e = I((s) => s.activeExports), a = je(), c = e.size > 0, n = Array.from(e.values()).some(
|
|
833
840
|
(s) => s.status === "completed" || s.status === "failed"
|
|
834
841
|
), l = a > 0 ? a > 9 ? "9+" : String(a) : null;
|
|
835
|
-
return /* @__PURE__ */ r(
|
|
836
|
-
/* @__PURE__ */ t(
|
|
842
|
+
return /* @__PURE__ */ r(Ge, { children: [
|
|
843
|
+
/* @__PURE__ */ t(Xe, { asChild: !0, children: /* @__PURE__ */ r(
|
|
837
844
|
S,
|
|
838
845
|
{
|
|
839
846
|
variant: "ghost",
|
|
@@ -841,7 +848,7 @@ function Dt() {
|
|
|
841
848
|
className: "relative h-8 w-8",
|
|
842
849
|
"aria-label": "Export notifications",
|
|
843
850
|
children: [
|
|
844
|
-
/* @__PURE__ */ t(
|
|
851
|
+
/* @__PURE__ */ t(qe, { className: "h-4 w-4" }),
|
|
845
852
|
c && /* @__PURE__ */ t(
|
|
846
853
|
"span",
|
|
847
854
|
{
|
|
@@ -852,7 +859,7 @@ function Dt() {
|
|
|
852
859
|
]
|
|
853
860
|
}
|
|
854
861
|
) }),
|
|
855
|
-
/* @__PURE__ */ t(
|
|
862
|
+
/* @__PURE__ */ t(We, { className: "w-80 p-0", align: "end", sideOffset: 8, children: /* @__PURE__ */ t(ht, {}) })
|
|
856
863
|
] });
|
|
857
864
|
}
|
|
858
865
|
export {
|