react-semaphor 0.1.307 → 0.1.309
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/brand-studio/index.cjs +1 -1
- package/dist/brand-studio/index.js +4 -4
- package/dist/chunks/{braces-CkL8POe0.js → braces-BHDm9arh.js} +1 -1
- package/dist/chunks/{braces-e5qkN-I_.js → braces-DEq8EJtw.js} +1 -1
- package/dist/chunks/chevrons-up-down-Cbtggnqv.js +14 -0
- package/dist/chunks/chevrons-up-down-DDEY9beZ.js +6 -0
- package/dist/chunks/{dashboard-controls-Dwet_9h0.js → dashboard-controls-C_vjMmt2.js} +8 -3
- package/dist/chunks/{dashboard-controls-5bibC_5a.js → dashboard-controls-Cp41403T.js} +233 -223
- package/dist/chunks/{dashboard-filter-controls-button-D0k9NDci.js → dashboard-filter-controls-button-DFKZjkD4.js} +304 -303
- package/dist/chunks/dashboard-filter-controls-button-tfjDO4D4.js +11 -0
- package/dist/chunks/{dashboard-json-CfRKLL7C.js → dashboard-json-Cc8S_uIr.js} +2 -2
- package/dist/chunks/{dashboard-json-Bi5XdgG5.js → dashboard-json-QR7WNDuO.js} +1 -1
- package/dist/chunks/dashboard-summary-settings-dialog-CxXxzyRP.js +1 -0
- package/dist/chunks/{dashboard-summary-settings-dialog-Bj4_wBW9.js → dashboard-summary-settings-dialog-qH6FOt7O.js} +33 -32
- package/dist/chunks/{edit-dashboard-visual-Wfs53Kbn.js → edit-dashboard-visual-J7cHkCD6.js} +32 -32
- package/dist/chunks/{edit-dashboard-visual-DIuzuJfj.js → edit-dashboard-visual-_BZQa5yI.js} +130 -129
- package/dist/chunks/index-AerZtbg0.js +1330 -0
- package/dist/chunks/{index-DMFCfjgD.js → index-CSgoL0P9.js} +59994 -61918
- package/dist/chunks/{palette-Oa4O9jWG.js → palette-CNKSAIrt.js} +1 -1
- package/dist/chunks/{palette-D5Lorzf2.js → palette-CteErylX.js} +1 -1
- package/dist/chunks/{resource-management-panel-Dqc3gfYn.js → resource-management-panel-CcFT7lpL.js} +52 -52
- package/dist/chunks/resource-management-panel-DbYkAk1I.js +6 -0
- package/dist/chunks/{save-CDX2p4v1.js → save-B1-nDZwS.js} +1 -1
- package/dist/chunks/{save-zEdICevW.js → save-BVVnWGeb.js} +1 -1
- package/dist/chunks/{switch-BPFzGTzF.js → switch-BG4RWnrq.js} +25 -25
- package/dist/chunks/{switch-CKiXRRoh.js → switch-BZn7R_Cp.js} +696 -697
- package/dist/chunks/{use-create-flow-overlay-state-CLyv5c2m.js → use-create-flow-overlay-state-CczjbVZY.js} +49 -49
- package/dist/chunks/{use-create-flow-overlay-state-CSMe5Ls6.js → use-create-flow-overlay-state-DImkf832.js} +1 -1
- package/dist/chunks/{use-visual-utils-DDAs4dCz.js → use-visual-utils-BdHwrbtr.js} +1 -1
- package/dist/chunks/{use-visual-utils-Det6M3Wd.js → use-visual-utils-DczvWVbd.js} +2 -2
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +76 -76
- 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 +10 -2
- package/package.json +1 -1
- package/dist/chunks/dashboard-filter-controls-button-ZeYO5jux.js +0 -11
- package/dist/chunks/dashboard-summary-settings-dialog-DD9Aj2XH.js +0 -1
- package/dist/chunks/index-DQCMUspd.js +0 -1350
- package/dist/chunks/resource-management-panel-CNr6uMMf.js +0 -6
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import Se, { useState as T, useRef as X, useCallback as $, useEffect as O, useContext as Ae } from "react";
|
|
2
|
-
import { u as W, ae as z, aZ as q, aV as le, aW as K, af as de, aU as Ie, b as ce, c as ue, d as me, e as he, f as pe, bV as Fe, o as Le, t as Te, v as Pe, b8 as fe, bW as ke, p as k, b9 as G, W as Ue, bq as ve, br as ge, bt as be, bu as R, by as Ve, bl as Me, bX as Be, bY as Oe, bF as ze, bG as Re, bH as $e, bI as _e, bJ as He, bK as je, bL as Xe, a$ as Ge, bZ as We, b_ as qe, bn as Ke, aX as J, M as Qe, ah as Ze, b$ as Ye, c0 as Je, c1 as et, c2 as tt, c3 as ee, c4 as at } from "./index-DMFCfjgD.js";
|
|
3
1
|
import { jsx as t, jsxs as s, Fragment as _ } from "react/jsx-runtime";
|
|
4
|
-
import { c as
|
|
5
|
-
import { V as
|
|
6
|
-
import { u as
|
|
2
|
+
import { c as le, L as Z, I as Se, B as I, f as W, n as j, u as B, m as q, aF as ee, af as de, G as ce, e as Ae, l as Ie, a as H, p as K, X as Fe, P as ue, b as me, d as he, aG as Le, aH as Te } from "./switch-BZn7R_Cp.js";
|
|
3
|
+
import { b as pe, c as fe, d as ve, e as ge, f as be, bU as ke, n as Pe, s as Ue, t as Ve, b7 as xe, bV as Me, o as P, b8 as G, V as Be, bp as ye, bq as we, bs as Ce, bt as z, bx as Oe, bk as ze, bW as Re, bX as _e, bE as $e, bF as He, bG as je, bH as Xe, bI as Ge, bJ as We, bK as qe, u as Q, ad as R, aY as Y, aU as De, aV as J, ae as Ne, aT as Ke, a_ as Qe, bY as Ye, bZ as Je, bm as Ze, aW as te, J as et, ag as tt, b_ as at, b$ as st, c0 as rt, c1 as ot, c2 as ae, c3 as nt } from "./index-CSgoL0P9.js";
|
|
4
|
+
import { V as it, E as se, a as re, b as lt, c as dt, L as ct, d as ut, C as mt, u as ht, e as pt } from "./use-create-flow-overlay-state-CczjbVZY.js";
|
|
5
|
+
import ft, { useState as T, useContext as vt, useRef as X, useCallback as $, useEffect as O } from "react";
|
|
6
|
+
import { u as Ee } from "./use-visual-utils-DczvWVbd.js";
|
|
7
7
|
import { k as oe } from "./date-formatter-DyIOb6uC.js";
|
|
8
8
|
/**
|
|
9
9
|
* @license lucide-react v0.453.0 - ISC
|
|
@@ -11,7 +11,7 @@ import { k as oe } from "./date-formatter-DyIOb6uC.js";
|
|
|
11
11
|
* This source code is licensed under the ISC license.
|
|
12
12
|
* See the LICENSE file in the root directory of this source tree.
|
|
13
13
|
*/
|
|
14
|
-
const ne =
|
|
14
|
+
const ne = le("FileDown", [
|
|
15
15
|
["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
|
|
16
16
|
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
|
|
17
17
|
["path", { d: "M12 18v-6", key: "17g6i2" }],
|
|
@@ -23,184 +23,12 @@ const ne = xe("FileDown", [
|
|
|
23
23
|
* This source code is licensed under the ISC license.
|
|
24
24
|
* See the LICENSE file in the root directory of this source tree.
|
|
25
25
|
*/
|
|
26
|
-
const gt =
|
|
26
|
+
const gt = le("FilterX", [
|
|
27
27
|
["path", { d: "M13.013 3H2l8 9.46V19l4 2v-8.54l.9-1.055", key: "1fi1da" }],
|
|
28
28
|
["path", { d: "m22 3-5 5", key: "12jva0" }],
|
|
29
29
|
["path", { d: "m17 3 5 5", key: "k36vhe" }]
|
|
30
|
-
])
|
|
31
|
-
function
|
|
32
|
-
const a = Date.now() - e.getTime();
|
|
33
|
-
return a < wt ? bt : a < Ct ? xt : yt;
|
|
34
|
-
}
|
|
35
|
-
function Bt() {
|
|
36
|
-
const { authToken: e, tokenProps: a } = W(), v = z((h) => h.activeExports), [l, n] = T(
|
|
37
|
-
typeof document < "u" ? !document.hidden : !0
|
|
38
|
-
), d = X(null), c = X(!1), m = X(void 0), i = a == null ? void 0 : a.apiServiceUrl, r = e == null ? void 0 : e.accessToken, p = $(() => {
|
|
39
|
-
const h = z.getState().activeExports;
|
|
40
|
-
return Array.from(h.values()).filter(
|
|
41
|
-
(y) => q(y.status)
|
|
42
|
-
);
|
|
43
|
-
}, []);
|
|
44
|
-
O(() => {
|
|
45
|
-
if (typeof document > "u") return;
|
|
46
|
-
const h = () => {
|
|
47
|
-
n(!document.hidden);
|
|
48
|
-
};
|
|
49
|
-
return document.addEventListener("visibilitychange", h), () => {
|
|
50
|
-
document.removeEventListener("visibilitychange", h);
|
|
51
|
-
};
|
|
52
|
-
}, []);
|
|
53
|
-
const b = $(async () => {
|
|
54
|
-
if (!i || !r) {
|
|
55
|
-
c.current = !1;
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
const h = p();
|
|
59
|
-
if (h.length === 0) {
|
|
60
|
-
c.current = !1;
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
const y = Date.now(), E = h.filter(
|
|
64
|
-
(o) => y - o.startedAt.getTime() > ie
|
|
65
|
-
);
|
|
66
|
-
if (E.length > 0) {
|
|
67
|
-
const { updateExport: o } = z.getState().actions;
|
|
68
|
-
for (const x of E)
|
|
69
|
-
o(x.id, {
|
|
70
|
-
status: "failed",
|
|
71
|
-
error: "Export timed out. Please try again or contact support.",
|
|
72
|
-
lastUpdatedAt: /* @__PURE__ */ new Date()
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
const f = h.filter(
|
|
76
|
-
(o) => y - o.startedAt.getTime() <= ie
|
|
77
|
-
);
|
|
78
|
-
if (f.length === 0) {
|
|
79
|
-
c.current = !1;
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
const w = await Promise.allSettled(
|
|
83
|
-
f.map(async (o) => {
|
|
84
|
-
try {
|
|
85
|
-
const x = await le(i, r, o.id);
|
|
86
|
-
let N;
|
|
87
|
-
if (x.status === "completed")
|
|
88
|
-
try {
|
|
89
|
-
N = await K(i, r, o.id);
|
|
90
|
-
} catch (F) {
|
|
91
|
-
console.error(
|
|
92
|
-
`[useExportPolling] Failed to get download URL for ${o.id}:`,
|
|
93
|
-
F
|
|
94
|
-
);
|
|
95
|
-
}
|
|
96
|
-
return {
|
|
97
|
-
id: o.id,
|
|
98
|
-
status: x.status,
|
|
99
|
-
progress: x.progress,
|
|
100
|
-
completedChunks: x.completedChunks,
|
|
101
|
-
completedAt: x.completedAt ? new Date(x.completedAt) : void 0,
|
|
102
|
-
lastUpdatedAt: /* @__PURE__ */ new Date(),
|
|
103
|
-
fileSize: x.fileSize,
|
|
104
|
-
error: x.error,
|
|
105
|
-
downloadUrl: N
|
|
106
|
-
};
|
|
107
|
-
} catch (x) {
|
|
108
|
-
return console.error(
|
|
109
|
-
`[useExportPolling] Failed to poll export ${o.id}:`,
|
|
110
|
-
x
|
|
111
|
-
), null;
|
|
112
|
-
}
|
|
113
|
-
})
|
|
114
|
-
), { updateExport: S } = z.getState().actions;
|
|
115
|
-
for (const o of w)
|
|
116
|
-
o.status === "fulfilled" && o.value && S(o.value.id, o.value);
|
|
117
|
-
const C = p();
|
|
118
|
-
if (C.length > 0 && !document.hidden) {
|
|
119
|
-
const o = C.reduce(
|
|
120
|
-
(N, F) => F.startedAt < N ? F.startedAt : N,
|
|
121
|
-
C[0].startedAt
|
|
122
|
-
), x = Dt(o);
|
|
123
|
-
d.current && clearTimeout(d.current), d.current = setTimeout(() => {
|
|
124
|
-
var N;
|
|
125
|
-
(N = m.current) == null || N.call(m);
|
|
126
|
-
}, x);
|
|
127
|
-
} else
|
|
128
|
-
c.current = !1;
|
|
129
|
-
}, [i, r, p]);
|
|
130
|
-
return O(() => {
|
|
131
|
-
m.current = b;
|
|
132
|
-
}, [b]), O(() => {
|
|
133
|
-
var y;
|
|
134
|
-
p().length > 0 && l && !c.current && (c.current = !0, (y = m.current) == null || y.call(m));
|
|
135
|
-
}, [v, l, p]), O(() => {
|
|
136
|
-
var y;
|
|
137
|
-
const h = p();
|
|
138
|
-
l && h.length > 0 && !c.current && (c.current = !0, (y = m.current) == null || y.call(m));
|
|
139
|
-
}, [l, p]), O(() => {
|
|
140
|
-
!l && d.current && (clearTimeout(d.current), d.current = null, c.current = !1);
|
|
141
|
-
}, [l]), O(() => () => {
|
|
142
|
-
d.current && (clearTimeout(d.current), d.current = null);
|
|
143
|
-
}, []), {
|
|
144
|
-
isPolling: c.current,
|
|
145
|
-
isTabVisible: l,
|
|
146
|
-
inProgressCount: p().length
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
function Ot() {
|
|
150
|
-
const { authToken: e, tokenProps: a } = W(), v = z((m) => m.activeExports), { addExport: l } = de(), n = X(!1), d = a == null ? void 0 : a.apiServiceUrl, c = e == null ? void 0 : e.accessToken;
|
|
151
|
-
O(() => {
|
|
152
|
-
if (n.current || !d || !c) return;
|
|
153
|
-
(async () => {
|
|
154
|
-
try {
|
|
155
|
-
const { exports: i } = await Ie(d, c, {
|
|
156
|
-
status: ["pending", "processing", "chunking", "compacting", "completed", "failed"],
|
|
157
|
-
limit: 20
|
|
158
|
-
// Limit to recent exports
|
|
159
|
-
});
|
|
160
|
-
for (const r of i) {
|
|
161
|
-
if (v.has(r.id)) continue;
|
|
162
|
-
const p = r.totalChunks ? Math.round(r.completedChunks / r.totalChunks * 100) : 0;
|
|
163
|
-
let b;
|
|
164
|
-
if (r.status === "completed")
|
|
165
|
-
try {
|
|
166
|
-
b = await K(d, c, r.id);
|
|
167
|
-
} catch (y) {
|
|
168
|
-
console.error(
|
|
169
|
-
`[useExportRecovery] Failed to get download URL for ${r.id}:`,
|
|
170
|
-
y
|
|
171
|
-
);
|
|
172
|
-
}
|
|
173
|
-
const h = {
|
|
174
|
-
id: r.id,
|
|
175
|
-
status: r.status,
|
|
176
|
-
progress: p,
|
|
177
|
-
title: Nt(r),
|
|
178
|
-
totalRows: r.totalRows,
|
|
179
|
-
totalChunks: r.totalChunks,
|
|
180
|
-
completedChunks: r.completedChunks,
|
|
181
|
-
startedAt: new Date(r.createdAt),
|
|
182
|
-
lastUpdatedAt: /* @__PURE__ */ new Date(),
|
|
183
|
-
completedAt: r.completedAt ? new Date(r.completedAt) : void 0,
|
|
184
|
-
fileSize: r.fileSize,
|
|
185
|
-
error: r.error,
|
|
186
|
-
expiresAt: new Date(r.expiresAt),
|
|
187
|
-
downloadUrl: b
|
|
188
|
-
};
|
|
189
|
-
l(h);
|
|
190
|
-
}
|
|
191
|
-
n.current = !0;
|
|
192
|
-
} catch (i) {
|
|
193
|
-
console.error("[useExportRecovery] Failed to recover exports:", i), n.current = !0;
|
|
194
|
-
}
|
|
195
|
-
})();
|
|
196
|
-
}, [d, c, l, v]);
|
|
197
|
-
}
|
|
198
|
-
function Nt(e) {
|
|
199
|
-
return e.title ? e.title : q(
|
|
200
|
-
e.status
|
|
201
|
-
) ? "Export in progress..." : e.status === "completed" ? "Export completed" : e.status === "failed" ? "Export failed" : "Export";
|
|
202
|
-
}
|
|
203
|
-
function Et({
|
|
30
|
+
]);
|
|
31
|
+
function bt({
|
|
204
32
|
open: e,
|
|
205
33
|
onOpenChange: a,
|
|
206
34
|
isLibraryVisual: v,
|
|
@@ -212,7 +40,7 @@ function Et({
|
|
|
212
40
|
const [m, i] = T(
|
|
213
41
|
v && l ? `Copy of ${l}` : l || ""
|
|
214
42
|
), [r, p] = T("");
|
|
215
|
-
|
|
43
|
+
ft.useEffect(() => {
|
|
216
44
|
e && (i(
|
|
217
45
|
v && l ? `Copy of ${l}` : l || ""
|
|
218
46
|
), p(""));
|
|
@@ -243,12 +71,12 @@ function Et({
|
|
|
243
71
|
saveToCurrentDashboard: h.saveToCurrentDashboard
|
|
244
72
|
});
|
|
245
73
|
};
|
|
246
|
-
return /* @__PURE__ */ t(
|
|
247
|
-
/* @__PURE__ */ s(
|
|
248
|
-
/* @__PURE__ */ s(
|
|
74
|
+
return /* @__PURE__ */ t(pe, { open: e, onOpenChange: a, children: /* @__PURE__ */ s(fe, { className: "sm:max-w-[500px]", children: [
|
|
75
|
+
/* @__PURE__ */ s(ve, { children: [
|
|
76
|
+
/* @__PURE__ */ s(ge, { className: "flex items-center gap-2", children: [
|
|
249
77
|
/* @__PURE__ */ t("span", { children: "Save Visual As" }),
|
|
250
78
|
h.badgeType !== "local" && /* @__PURE__ */ t(
|
|
251
|
-
|
|
79
|
+
it,
|
|
252
80
|
{
|
|
253
81
|
type: h.badgeType,
|
|
254
82
|
showLabel: !0,
|
|
@@ -256,13 +84,13 @@ function Et({
|
|
|
256
84
|
}
|
|
257
85
|
)
|
|
258
86
|
] }),
|
|
259
|
-
/* @__PURE__ */ t(
|
|
87
|
+
/* @__PURE__ */ t(be, { children: h.description })
|
|
260
88
|
] }),
|
|
261
89
|
/* @__PURE__ */ s("div", { className: "grid gap-4 py-4", children: [
|
|
262
90
|
/* @__PURE__ */ s("div", { className: "grid gap-2", children: [
|
|
263
|
-
/* @__PURE__ */ t(
|
|
91
|
+
/* @__PURE__ */ t(Z, { htmlFor: "name", children: "Name" }),
|
|
264
92
|
/* @__PURE__ */ t(
|
|
265
|
-
|
|
93
|
+
Se,
|
|
266
94
|
{
|
|
267
95
|
id: "name",
|
|
268
96
|
value: m,
|
|
@@ -273,9 +101,9 @@ function Et({
|
|
|
273
101
|
)
|
|
274
102
|
] }),
|
|
275
103
|
/* @__PURE__ */ s("div", { className: "grid gap-2", children: [
|
|
276
|
-
/* @__PURE__ */ t(
|
|
104
|
+
/* @__PURE__ */ t(Z, { htmlFor: "description", children: "Description (optional)" }),
|
|
277
105
|
/* @__PURE__ */ t(
|
|
278
|
-
|
|
106
|
+
ke,
|
|
279
107
|
{
|
|
280
108
|
id: "description",
|
|
281
109
|
value: r,
|
|
@@ -287,7 +115,7 @@ function Et({
|
|
|
287
115
|
)
|
|
288
116
|
] })
|
|
289
117
|
] }),
|
|
290
|
-
/* @__PURE__ */ s(
|
|
118
|
+
/* @__PURE__ */ s(Pe, { children: [
|
|
291
119
|
/* @__PURE__ */ t(
|
|
292
120
|
I,
|
|
293
121
|
{
|
|
@@ -298,24 +126,24 @@ function Et({
|
|
|
298
126
|
}
|
|
299
127
|
),
|
|
300
128
|
/* @__PURE__ */ s(I, { onClick: y, disabled: !b || n, children: [
|
|
301
|
-
n && /* @__PURE__ */ t(
|
|
129
|
+
n && /* @__PURE__ */ t(W, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
302
130
|
h.actionLabel
|
|
303
131
|
] })
|
|
304
132
|
] })
|
|
305
133
|
] }) });
|
|
306
134
|
}
|
|
307
|
-
function
|
|
308
|
-
const [e, a] = T(!1), [v, l] = T(!1), [n, d] = T(null), [c, m] = T(null), i = j((u) => u.frame), r = j((u) => u.card), p =
|
|
135
|
+
function xt() {
|
|
136
|
+
const [e, a] = T(!1), [v, l] = T(!1), [n, d] = T(null), [c, m] = T(null), i = j((u) => u.frame), r = j((u) => u.card), p = Ue(), b = B((u) => u.selectedSheetId), h = B((u) => u.dashboard), y = B(
|
|
309
137
|
(u) => u.actions.setIsDashboardPanelOpen
|
|
310
|
-
), { getUpdatedFrame: E } = Ee(), { selectVisual: f } =
|
|
138
|
+
), { getUpdatedFrame: E } = Ee(), { selectVisual: f } = Ve(), { addFrame: w, setSelectedFrameId: S, setIsVisualEditing: C } = q(), o = xe(), x = !!(i != null && i.visualId), N = (() => {
|
|
311
139
|
var u, g;
|
|
312
140
|
return ((u = i == null ? void 0 : i.cards) == null ? void 0 : u.length) === 1 && ((g = i.cards[0]) != null && g.title) ? i.cards[0].title : p != null && p.title ? p.title : (r == null ? void 0 : r.title) || "Untitled Visual";
|
|
313
|
-
})(), F =
|
|
141
|
+
})(), F = Me((u) => {
|
|
314
142
|
u != null && u.id && (f(u), v && n && c && b && (async () => {
|
|
315
143
|
try {
|
|
316
144
|
const g = {
|
|
317
145
|
...n,
|
|
318
|
-
id:
|
|
146
|
+
id: ee(),
|
|
319
147
|
visualId: u.id
|
|
320
148
|
// Link to the newly created library visual
|
|
321
149
|
};
|
|
@@ -327,7 +155,7 @@ function St() {
|
|
|
327
155
|
console.error(
|
|
328
156
|
"Failed to promote semantic metadata for saved visual:",
|
|
329
157
|
g
|
|
330
|
-
),
|
|
158
|
+
), P.error(
|
|
331
159
|
g instanceof Error ? g.message : "Failed to prepare semantic metadata for the saved visual"
|
|
332
160
|
);
|
|
333
161
|
}
|
|
@@ -338,15 +166,15 @@ function St() {
|
|
|
338
166
|
setSaveAsDialogOpen: a,
|
|
339
167
|
handleSaveAs: async (u) => {
|
|
340
168
|
if (!b) {
|
|
341
|
-
|
|
169
|
+
P.error("No sheet selected");
|
|
342
170
|
return;
|
|
343
171
|
}
|
|
344
|
-
const g = E(), A =
|
|
172
|
+
const g = E(), A = de(g);
|
|
345
173
|
if (A) {
|
|
346
|
-
|
|
174
|
+
P.error(A);
|
|
347
175
|
return;
|
|
348
176
|
}
|
|
349
|
-
const
|
|
177
|
+
const k = g.cards.length === 1 ? {
|
|
350
178
|
...g,
|
|
351
179
|
cards: g.cards.map((L) => ({
|
|
352
180
|
...L,
|
|
@@ -358,45 +186,45 @@ function St() {
|
|
|
358
186
|
let L = null;
|
|
359
187
|
if (u.saveToCurrentDashboard)
|
|
360
188
|
try {
|
|
361
|
-
L = await o(
|
|
362
|
-
previousFrame: G(h,
|
|
189
|
+
L = await o(k, {
|
|
190
|
+
previousFrame: G(h, k.id)
|
|
363
191
|
});
|
|
364
192
|
} catch (M) {
|
|
365
193
|
console.error(
|
|
366
194
|
"Failed to prepare semantic metadata before saving visual:",
|
|
367
195
|
M
|
|
368
|
-
),
|
|
196
|
+
), P.error(
|
|
369
197
|
M instanceof Error ? M.message : "Failed to prepare semantic metadata for the saved visual"
|
|
370
198
|
);
|
|
371
199
|
return;
|
|
372
200
|
}
|
|
373
|
-
l(u.saveToCurrentDashboard), d(
|
|
201
|
+
l(u.saveToCurrentDashboard), d(k), m(L);
|
|
374
202
|
const V = {
|
|
375
203
|
title: u.name,
|
|
376
204
|
description: u.description,
|
|
377
|
-
frameObject:
|
|
205
|
+
frameObject: k,
|
|
378
206
|
// Card title synced for single-card frames
|
|
379
207
|
isPrivate: !1
|
|
380
208
|
};
|
|
381
209
|
F.mutate(V);
|
|
382
210
|
} else if (u.saveToCurrentDashboard) {
|
|
383
211
|
const L = {
|
|
384
|
-
...
|
|
212
|
+
...k,
|
|
385
213
|
// Card title already synced
|
|
386
|
-
id:
|
|
214
|
+
id: ee(),
|
|
387
215
|
visualId: void 0
|
|
388
216
|
// Explicitly no visualId for local visuals
|
|
389
217
|
};
|
|
390
218
|
try {
|
|
391
|
-
const V = await o(
|
|
392
|
-
previousFrame: G(h,
|
|
219
|
+
const V = await o(k, {
|
|
220
|
+
previousFrame: G(h, k.id)
|
|
393
221
|
});
|
|
394
222
|
w(b, L, {
|
|
395
223
|
position: "end",
|
|
396
224
|
semanticExecutionPayload: V
|
|
397
|
-
}), S(L.id),
|
|
225
|
+
}), S(L.id), P.success("Visual saved to dashboard"), a(!1), C(!1);
|
|
398
226
|
} catch (V) {
|
|
399
|
-
console.error("Failed to save visual to dashboard:", V),
|
|
227
|
+
console.error("Failed to save visual to dashboard:", V), P.error(
|
|
400
228
|
V instanceof Error ? V.message : "Failed to prepare semantic metadata for the visual"
|
|
401
229
|
);
|
|
402
230
|
}
|
|
@@ -407,15 +235,15 @@ function St() {
|
|
|
407
235
|
isSaving: F.isPending
|
|
408
236
|
};
|
|
409
237
|
}
|
|
410
|
-
function
|
|
411
|
-
const a = j((D) => D.frame), v = j((D) => D.editorContext), l =
|
|
238
|
+
function Bt(e = {}) {
|
|
239
|
+
const a = j((D) => D.frame), v = j((D) => D.editorContext), l = Be((D) => D.selectedVisual), n = B((D) => D.selectedFrameId), d = B((D) => D.selectedSheetId), c = B((D) => D.dashboard), { setIsVisualEditing: m, updateFrame: i } = q(), [r, p] = T(!1), [b, h] = T("both"), y = xe(), E = (v == null ? void 0 : v.type) === "documentSection", f = !!(a != null && a.visualId || l != null && l.id), w = !!(a != null && a.visualId && n), S = f && !w, {
|
|
412
240
|
saveAsDialogOpen: C,
|
|
413
241
|
setSaveAsDialogOpen: o,
|
|
414
242
|
handleSaveAs: x,
|
|
415
243
|
isLibraryVisual: N,
|
|
416
244
|
currentVisualName: F,
|
|
417
245
|
isSaving: U
|
|
418
|
-
} =
|
|
246
|
+
} = xt(), { getUpdatedFrame: u } = Ee();
|
|
419
247
|
if (E)
|
|
420
248
|
return /* @__PURE__ */ s(_, { children: [
|
|
421
249
|
/* @__PURE__ */ t(se, { className: "rounded-control", variant: "default" }),
|
|
@@ -423,14 +251,14 @@ function zt(e = {}) {
|
|
|
423
251
|
] });
|
|
424
252
|
const g = async () => {
|
|
425
253
|
if (!d) {
|
|
426
|
-
|
|
254
|
+
P.error("No sheet selected");
|
|
427
255
|
return;
|
|
428
256
|
}
|
|
429
257
|
if (r) return;
|
|
430
258
|
p(!0);
|
|
431
|
-
const D = u(),
|
|
432
|
-
if (
|
|
433
|
-
p(!1),
|
|
259
|
+
const D = u(), k = de(D);
|
|
260
|
+
if (k) {
|
|
261
|
+
p(!1), P.error(k);
|
|
434
262
|
return;
|
|
435
263
|
}
|
|
436
264
|
const L = {
|
|
@@ -445,13 +273,13 @@ function zt(e = {}) {
|
|
|
445
273
|
semanticExecutionPayload: M
|
|
446
274
|
});
|
|
447
275
|
} catch (M) {
|
|
448
|
-
console.error("Failed to apply local semantic metadata:", M), p(!1),
|
|
276
|
+
console.error("Failed to apply local semantic metadata:", M), p(!1), P.error(
|
|
449
277
|
M instanceof Error ? M.message : "Failed to prepare semantic metadata for this visual"
|
|
450
278
|
);
|
|
451
279
|
return;
|
|
452
280
|
}
|
|
453
281
|
setTimeout(() => {
|
|
454
|
-
p(!1),
|
|
282
|
+
p(!1), P.success("Changes applied. Visual is now local to this dashboard"), m(!1);
|
|
455
283
|
}, 300);
|
|
456
284
|
}, A = (D) => {
|
|
457
285
|
h(D), o(!0);
|
|
@@ -459,10 +287,10 @@ function zt(e = {}) {
|
|
|
459
287
|
return /* @__PURE__ */ s(_, { children: [
|
|
460
288
|
/* @__PURE__ */ s("div", { className: "inline-flex items-center overflow-hidden rounded-control", children: [
|
|
461
289
|
!f && /* @__PURE__ */ t(se, { className: "!rounded-none", variant: "default" }),
|
|
462
|
-
f && S && /* @__PURE__ */ t(
|
|
463
|
-
f && w && /* @__PURE__ */ t(
|
|
464
|
-
/* @__PURE__ */ s(
|
|
465
|
-
/* @__PURE__ */ t(
|
|
290
|
+
f && S && /* @__PURE__ */ t(lt, { className: "!rounded-none", variant: "default" }),
|
|
291
|
+
f && w && /* @__PURE__ */ t(dt, { className: "!rounded-none" }),
|
|
292
|
+
/* @__PURE__ */ s(ye, { modal: !1, children: [
|
|
293
|
+
/* @__PURE__ */ t(we, { asChild: !0, children: /* @__PURE__ */ t(
|
|
466
294
|
I,
|
|
467
295
|
{
|
|
468
296
|
variant: "default",
|
|
@@ -470,58 +298,58 @@ function zt(e = {}) {
|
|
|
470
298
|
className: "w-7 !rounded-none border-l border-primary-foreground/20 px-0",
|
|
471
299
|
"aria-label": "Open visual save options",
|
|
472
300
|
disabled: U || r,
|
|
473
|
-
children: /* @__PURE__ */ t(
|
|
301
|
+
children: /* @__PURE__ */ t(ce, { className: "h-3.5 w-3.5" })
|
|
474
302
|
}
|
|
475
303
|
) }),
|
|
476
304
|
/* @__PURE__ */ s(
|
|
477
|
-
|
|
305
|
+
Ce,
|
|
478
306
|
{
|
|
479
307
|
align: "end",
|
|
480
308
|
className: "min-w-[220px] rounded-control border border-border/60 p-1 shadow-sm",
|
|
481
309
|
children: [
|
|
482
310
|
w && /* @__PURE__ */ s(_, { children: [
|
|
483
311
|
/* @__PURE__ */ s(
|
|
484
|
-
|
|
312
|
+
z,
|
|
485
313
|
{
|
|
486
314
|
onClick: g,
|
|
487
315
|
disabled: r,
|
|
488
316
|
children: [
|
|
489
|
-
/* @__PURE__ */ t(
|
|
317
|
+
/* @__PURE__ */ t(Ae, { className: "h-3.5 w-3.5" }),
|
|
490
318
|
r ? "Applying..." : "Apply Locally"
|
|
491
319
|
]
|
|
492
320
|
}
|
|
493
321
|
),
|
|
494
|
-
/* @__PURE__ */ t(
|
|
322
|
+
/* @__PURE__ */ t(Oe, {})
|
|
495
323
|
] }),
|
|
496
324
|
/* @__PURE__ */ s(
|
|
497
|
-
|
|
325
|
+
z,
|
|
498
326
|
{
|
|
499
327
|
onClick: () => A("local"),
|
|
500
328
|
disabled: U,
|
|
501
329
|
children: [
|
|
502
|
-
/* @__PURE__ */ t(
|
|
330
|
+
/* @__PURE__ */ t(ze, { className: "h-3.5 w-3.5" }),
|
|
503
331
|
"Add to Dashboard (Local)"
|
|
504
332
|
]
|
|
505
333
|
}
|
|
506
334
|
),
|
|
507
335
|
/* @__PURE__ */ s(
|
|
508
|
-
|
|
336
|
+
z,
|
|
509
337
|
{
|
|
510
338
|
onClick: () => A("library"),
|
|
511
339
|
disabled: U,
|
|
512
340
|
children: [
|
|
513
|
-
/* @__PURE__ */ t(
|
|
341
|
+
/* @__PURE__ */ t(ct, { className: "h-3.5 w-3.5" }),
|
|
514
342
|
"Save as Library Visual"
|
|
515
343
|
]
|
|
516
344
|
}
|
|
517
345
|
),
|
|
518
346
|
/* @__PURE__ */ s(
|
|
519
|
-
|
|
347
|
+
z,
|
|
520
348
|
{
|
|
521
349
|
onClick: () => A("both"),
|
|
522
350
|
disabled: U,
|
|
523
351
|
children: [
|
|
524
|
-
/* @__PURE__ */ t(
|
|
352
|
+
/* @__PURE__ */ t(ut, { className: "h-3.5 w-3.5" }),
|
|
525
353
|
"Save Copy as Linked Visual"
|
|
526
354
|
]
|
|
527
355
|
}
|
|
@@ -533,7 +361,7 @@ function zt(e = {}) {
|
|
|
533
361
|
] }),
|
|
534
362
|
/* @__PURE__ */ t(re, {}),
|
|
535
363
|
/* @__PURE__ */ t(
|
|
536
|
-
|
|
364
|
+
bt,
|
|
537
365
|
{
|
|
538
366
|
open: C,
|
|
539
367
|
onOpenChange: (D) => {
|
|
@@ -548,11 +376,11 @@ function zt(e = {}) {
|
|
|
548
376
|
)
|
|
549
377
|
] });
|
|
550
378
|
}
|
|
551
|
-
function
|
|
552
|
-
const a = j((r) => r.isDevMode), v = B((r) => r.isVisualEditing), { setIsDevMode: l } =
|
|
379
|
+
function Ot({ className: e }) {
|
|
380
|
+
const a = j((r) => r.isDevMode), v = B((r) => r.isVisualEditing), { setIsDevMode: l } = Ie(), { config: n } = vt(Re).tokenProps, d = (n == null ? void 0 : n.showAdvancedMode) !== !1;
|
|
553
381
|
if (!v || !d)
|
|
554
382
|
return null;
|
|
555
|
-
const c = a ?
|
|
383
|
+
const c = a ? K : _e, m = a ? "Drag & drop" : "SQL", i = a ? "Switch to drag-and-drop mode" : "Switch to SQL mode";
|
|
556
384
|
return /* @__PURE__ */ s(
|
|
557
385
|
"button",
|
|
558
386
|
{
|
|
@@ -571,7 +399,7 @@ function Rt({ className: e }) {
|
|
|
571
399
|
}
|
|
572
400
|
);
|
|
573
401
|
}
|
|
574
|
-
function
|
|
402
|
+
function zt({
|
|
575
403
|
open: e,
|
|
576
404
|
onOpenChange: a,
|
|
577
405
|
onSave: v,
|
|
@@ -583,14 +411,14 @@ function $t({
|
|
|
583
411
|
discardLabel: i = "Discard",
|
|
584
412
|
saveLabel: r = "Save"
|
|
585
413
|
}) {
|
|
586
|
-
return /* @__PURE__ */ t(
|
|
414
|
+
return /* @__PURE__ */ t($e, { open: e, onOpenChange: (b) => {
|
|
587
415
|
!b && n || a(b);
|
|
588
|
-
}, children: /* @__PURE__ */ s(
|
|
589
|
-
/* @__PURE__ */ s($e, { children: [
|
|
590
|
-
/* @__PURE__ */ t(_e, { children: d }),
|
|
591
|
-
/* @__PURE__ */ t(He, { children: c })
|
|
592
|
-
] }),
|
|
416
|
+
}, children: /* @__PURE__ */ s(He, { children: [
|
|
593
417
|
/* @__PURE__ */ s(je, { children: [
|
|
418
|
+
/* @__PURE__ */ t(Xe, { children: d }),
|
|
419
|
+
/* @__PURE__ */ t(Ge, { children: c })
|
|
420
|
+
] }),
|
|
421
|
+
/* @__PURE__ */ s(We, { children: [
|
|
594
422
|
/* @__PURE__ */ t(
|
|
595
423
|
I,
|
|
596
424
|
{
|
|
@@ -603,14 +431,187 @@ function $t({
|
|
|
603
431
|
children: i
|
|
604
432
|
}
|
|
605
433
|
),
|
|
606
|
-
/* @__PURE__ */ t(
|
|
434
|
+
/* @__PURE__ */ t(qe, { disabled: n, children: m }),
|
|
607
435
|
/* @__PURE__ */ t(I, { type: "button", size: "xs", onClick: v, disabled: n, children: n ? /* @__PURE__ */ s(_, { children: [
|
|
608
|
-
/* @__PURE__ */ t(
|
|
436
|
+
/* @__PURE__ */ t(W, { className: "mr-2 h-3.5 w-3.5 animate-spin" }),
|
|
609
437
|
"Saving..."
|
|
610
438
|
] }) : r })
|
|
611
439
|
] })
|
|
612
440
|
] }) });
|
|
613
441
|
}
|
|
442
|
+
const yt = 1e4, wt = 15e3, Ct = 3e4, Dt = 3e4, Nt = 12e4, ie = 2 * 60 * 60 * 1e3;
|
|
443
|
+
function Et(e) {
|
|
444
|
+
const a = Date.now() - e.getTime();
|
|
445
|
+
return a < Dt ? yt : a < Nt ? wt : Ct;
|
|
446
|
+
}
|
|
447
|
+
function Rt() {
|
|
448
|
+
const { authToken: e, tokenProps: a } = Q(), v = R((h) => h.activeExports), [l, n] = T(
|
|
449
|
+
typeof document < "u" ? !document.hidden : !0
|
|
450
|
+
), d = X(null), c = X(!1), m = X(void 0), i = a == null ? void 0 : a.apiServiceUrl, r = e == null ? void 0 : e.accessToken, p = $(() => {
|
|
451
|
+
const h = R.getState().activeExports;
|
|
452
|
+
return Array.from(h.values()).filter(
|
|
453
|
+
(y) => Y(y.status)
|
|
454
|
+
);
|
|
455
|
+
}, []);
|
|
456
|
+
O(() => {
|
|
457
|
+
if (typeof document > "u") return;
|
|
458
|
+
const h = () => {
|
|
459
|
+
n(!document.hidden);
|
|
460
|
+
};
|
|
461
|
+
return document.addEventListener("visibilitychange", h), () => {
|
|
462
|
+
document.removeEventListener("visibilitychange", h);
|
|
463
|
+
};
|
|
464
|
+
}, []);
|
|
465
|
+
const b = $(async () => {
|
|
466
|
+
if (!i || !r) {
|
|
467
|
+
c.current = !1;
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
const h = p();
|
|
471
|
+
if (h.length === 0) {
|
|
472
|
+
c.current = !1;
|
|
473
|
+
return;
|
|
474
|
+
}
|
|
475
|
+
const y = Date.now(), E = h.filter(
|
|
476
|
+
(o) => y - o.startedAt.getTime() > ie
|
|
477
|
+
);
|
|
478
|
+
if (E.length > 0) {
|
|
479
|
+
const { updateExport: o } = R.getState().actions;
|
|
480
|
+
for (const x of E)
|
|
481
|
+
o(x.id, {
|
|
482
|
+
status: "failed",
|
|
483
|
+
error: "Export timed out. Please try again or contact support.",
|
|
484
|
+
lastUpdatedAt: /* @__PURE__ */ new Date()
|
|
485
|
+
});
|
|
486
|
+
}
|
|
487
|
+
const f = h.filter(
|
|
488
|
+
(o) => y - o.startedAt.getTime() <= ie
|
|
489
|
+
);
|
|
490
|
+
if (f.length === 0) {
|
|
491
|
+
c.current = !1;
|
|
492
|
+
return;
|
|
493
|
+
}
|
|
494
|
+
const w = await Promise.allSettled(
|
|
495
|
+
f.map(async (o) => {
|
|
496
|
+
try {
|
|
497
|
+
const x = await De(i, r, o.id);
|
|
498
|
+
let N;
|
|
499
|
+
if (x.status === "completed")
|
|
500
|
+
try {
|
|
501
|
+
N = await J(i, r, o.id);
|
|
502
|
+
} catch (F) {
|
|
503
|
+
console.error(
|
|
504
|
+
`[useExportPolling] Failed to get download URL for ${o.id}:`,
|
|
505
|
+
F
|
|
506
|
+
);
|
|
507
|
+
}
|
|
508
|
+
return {
|
|
509
|
+
id: o.id,
|
|
510
|
+
status: x.status,
|
|
511
|
+
progress: x.progress,
|
|
512
|
+
completedChunks: x.completedChunks,
|
|
513
|
+
completedAt: x.completedAt ? new Date(x.completedAt) : void 0,
|
|
514
|
+
lastUpdatedAt: /* @__PURE__ */ new Date(),
|
|
515
|
+
fileSize: x.fileSize,
|
|
516
|
+
error: x.error,
|
|
517
|
+
downloadUrl: N
|
|
518
|
+
};
|
|
519
|
+
} catch (x) {
|
|
520
|
+
return console.error(
|
|
521
|
+
`[useExportPolling] Failed to poll export ${o.id}:`,
|
|
522
|
+
x
|
|
523
|
+
), null;
|
|
524
|
+
}
|
|
525
|
+
})
|
|
526
|
+
), { updateExport: S } = R.getState().actions;
|
|
527
|
+
for (const o of w)
|
|
528
|
+
o.status === "fulfilled" && o.value && S(o.value.id, o.value);
|
|
529
|
+
const C = p();
|
|
530
|
+
if (C.length > 0 && !document.hidden) {
|
|
531
|
+
const o = C.reduce(
|
|
532
|
+
(N, F) => F.startedAt < N ? F.startedAt : N,
|
|
533
|
+
C[0].startedAt
|
|
534
|
+
), x = Et(o);
|
|
535
|
+
d.current && clearTimeout(d.current), d.current = setTimeout(() => {
|
|
536
|
+
var N;
|
|
537
|
+
(N = m.current) == null || N.call(m);
|
|
538
|
+
}, x);
|
|
539
|
+
} else
|
|
540
|
+
c.current = !1;
|
|
541
|
+
}, [i, r, p]);
|
|
542
|
+
return O(() => {
|
|
543
|
+
m.current = b;
|
|
544
|
+
}, [b]), O(() => {
|
|
545
|
+
var y;
|
|
546
|
+
p().length > 0 && l && !c.current && (c.current = !0, (y = m.current) == null || y.call(m));
|
|
547
|
+
}, [v, l, p]), O(() => {
|
|
548
|
+
var y;
|
|
549
|
+
const h = p();
|
|
550
|
+
l && h.length > 0 && !c.current && (c.current = !0, (y = m.current) == null || y.call(m));
|
|
551
|
+
}, [l, p]), O(() => {
|
|
552
|
+
!l && d.current && (clearTimeout(d.current), d.current = null, c.current = !1);
|
|
553
|
+
}, [l]), O(() => () => {
|
|
554
|
+
d.current && (clearTimeout(d.current), d.current = null);
|
|
555
|
+
}, []), {
|
|
556
|
+
isPolling: c.current,
|
|
557
|
+
isTabVisible: l,
|
|
558
|
+
inProgressCount: p().length
|
|
559
|
+
};
|
|
560
|
+
}
|
|
561
|
+
function _t() {
|
|
562
|
+
const { authToken: e, tokenProps: a } = Q(), v = R((m) => m.activeExports), { addExport: l } = Ne(), n = X(!1), d = a == null ? void 0 : a.apiServiceUrl, c = e == null ? void 0 : e.accessToken;
|
|
563
|
+
O(() => {
|
|
564
|
+
if (n.current || !d || !c) return;
|
|
565
|
+
(async () => {
|
|
566
|
+
try {
|
|
567
|
+
const { exports: i } = await Ke(d, c, {
|
|
568
|
+
status: ["pending", "processing", "chunking", "compacting", "completed", "failed"],
|
|
569
|
+
limit: 20
|
|
570
|
+
// Limit to recent exports
|
|
571
|
+
});
|
|
572
|
+
for (const r of i) {
|
|
573
|
+
if (v.has(r.id)) continue;
|
|
574
|
+
const p = r.totalChunks ? Math.round(r.completedChunks / r.totalChunks * 100) : 0;
|
|
575
|
+
let b;
|
|
576
|
+
if (r.status === "completed")
|
|
577
|
+
try {
|
|
578
|
+
b = await J(d, c, r.id);
|
|
579
|
+
} catch (y) {
|
|
580
|
+
console.error(
|
|
581
|
+
`[useExportRecovery] Failed to get download URL for ${r.id}:`,
|
|
582
|
+
y
|
|
583
|
+
);
|
|
584
|
+
}
|
|
585
|
+
const h = {
|
|
586
|
+
id: r.id,
|
|
587
|
+
status: r.status,
|
|
588
|
+
progress: p,
|
|
589
|
+
title: St(r),
|
|
590
|
+
totalRows: r.totalRows,
|
|
591
|
+
totalChunks: r.totalChunks,
|
|
592
|
+
completedChunks: r.completedChunks,
|
|
593
|
+
startedAt: new Date(r.createdAt),
|
|
594
|
+
lastUpdatedAt: /* @__PURE__ */ new Date(),
|
|
595
|
+
completedAt: r.completedAt ? new Date(r.completedAt) : void 0,
|
|
596
|
+
fileSize: r.fileSize,
|
|
597
|
+
error: r.error,
|
|
598
|
+
expiresAt: new Date(r.expiresAt),
|
|
599
|
+
downloadUrl: b
|
|
600
|
+
};
|
|
601
|
+
l(h);
|
|
602
|
+
}
|
|
603
|
+
n.current = !0;
|
|
604
|
+
} catch (i) {
|
|
605
|
+
console.error("[useExportRecovery] Failed to recover exports:", i), n.current = !0;
|
|
606
|
+
}
|
|
607
|
+
})();
|
|
608
|
+
}, [d, c, l, v]);
|
|
609
|
+
}
|
|
610
|
+
function St(e) {
|
|
611
|
+
return e.title ? e.title : Y(
|
|
612
|
+
e.status
|
|
613
|
+
) ? "Export in progress..." : e.status === "completed" ? "Export completed" : e.status === "failed" ? "Export failed" : "Export";
|
|
614
|
+
}
|
|
614
615
|
function At({
|
|
615
616
|
export: e,
|
|
616
617
|
onRemove: a
|
|
@@ -622,13 +623,13 @@ function At({
|
|
|
622
623
|
}, n = () => {
|
|
623
624
|
switch (e.status) {
|
|
624
625
|
case "completed":
|
|
625
|
-
return /* @__PURE__ */ t(
|
|
626
|
+
return /* @__PURE__ */ t(Ze, { className: "mt-0.5 h-5 w-5 shrink-0 text-green-600" });
|
|
626
627
|
case "failed":
|
|
627
|
-
return /* @__PURE__ */ t(
|
|
628
|
+
return /* @__PURE__ */ t(mt, { className: "mt-0.5 h-5 w-5 shrink-0 text-destructive" });
|
|
628
629
|
default:
|
|
629
|
-
return /* @__PURE__ */ t(
|
|
630
|
+
return /* @__PURE__ */ t(W, { className: "text-foreground-muted mt-0.5 h-5 w-5 shrink-0 animate-spin" });
|
|
630
631
|
}
|
|
631
|
-
}, d =
|
|
632
|
+
}, d = Y(e.status), c = (() => {
|
|
632
633
|
switch (e.status) {
|
|
633
634
|
case "pending":
|
|
634
635
|
return "Queued...";
|
|
@@ -655,7 +656,7 @@ function At({
|
|
|
655
656
|
] }),
|
|
656
657
|
e.fileSize && /* @__PURE__ */ s(_, { children: [
|
|
657
658
|
/* @__PURE__ */ t("span", { children: "•" }),
|
|
658
|
-
/* @__PURE__ */ t("span", { children:
|
|
659
|
+
/* @__PURE__ */ t("span", { children: Qe(e.fileSize) })
|
|
659
660
|
] })
|
|
660
661
|
] }),
|
|
661
662
|
d && /* @__PURE__ */ t("div", { className: "text-xs text-muted-foreground", children: c }),
|
|
@@ -670,7 +671,7 @@ function At({
|
|
|
670
671
|
className: "h-6 w-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100",
|
|
671
672
|
onClick: l,
|
|
672
673
|
"aria-label": "Remove notification",
|
|
673
|
-
children: /* @__PURE__ */ t(
|
|
674
|
+
children: /* @__PURE__ */ t(Fe, { className: "h-4 w-4" })
|
|
674
675
|
}
|
|
675
676
|
)
|
|
676
677
|
] }),
|
|
@@ -685,14 +686,14 @@ function At({
|
|
|
685
686
|
className: "h-8 bg-transparent",
|
|
686
687
|
onClick: v,
|
|
687
688
|
children: [
|
|
688
|
-
/* @__PURE__ */ t(
|
|
689
|
+
/* @__PURE__ */ t(Ye, { className: "mr-1.5 h-3.5 w-3.5" }),
|
|
689
690
|
"Download"
|
|
690
691
|
]
|
|
691
692
|
}
|
|
692
693
|
)
|
|
693
694
|
] }),
|
|
694
695
|
d && /* @__PURE__ */ s("div", { children: [
|
|
695
|
-
/* @__PURE__ */ t(
|
|
696
|
+
/* @__PURE__ */ t(Je, { value: e.progress, className: "h-1.5" }),
|
|
696
697
|
/* @__PURE__ */ s("span", { className: "mt-1 block text-xs text-muted-foreground", children: [
|
|
697
698
|
e.progress,
|
|
698
699
|
"% complete"
|
|
@@ -703,7 +704,7 @@ function At({
|
|
|
703
704
|
] });
|
|
704
705
|
}
|
|
705
706
|
function It() {
|
|
706
|
-
const { authToken: e, tokenProps: a } =
|
|
707
|
+
const { authToken: e, tokenProps: a } = Q(), v = R((f) => f.activeExports), { clearCompleted: l, removeExport: n, updateExport: d } = Ne(), [c, m] = T(!1), [i, r] = T(!1), p = Array.from(v.values()).sort(
|
|
707
708
|
(f, w) => w.startedAt.getTime() - f.startedAt.getTime()
|
|
708
709
|
), b = p.some(
|
|
709
710
|
(f) => f.status === "completed" || f.status === "failed"
|
|
@@ -716,11 +717,11 @@ function It() {
|
|
|
716
717
|
await Promise.all(
|
|
717
718
|
S.map(async (C) => {
|
|
718
719
|
try {
|
|
719
|
-
const o = await
|
|
720
|
+
const o = await De(f, w, C.id);
|
|
720
721
|
let x;
|
|
721
722
|
if (o.status === "completed")
|
|
722
723
|
try {
|
|
723
|
-
x = await
|
|
724
|
+
x = await J(
|
|
724
725
|
f,
|
|
725
726
|
w,
|
|
726
727
|
C.id
|
|
@@ -763,7 +764,7 @@ function It() {
|
|
|
763
764
|
const S = p.filter(
|
|
764
765
|
(o) => o.status === "completed" || o.status === "failed"
|
|
765
766
|
), C = await Promise.allSettled(
|
|
766
|
-
S.map(async (o) => (await
|
|
767
|
+
S.map(async (o) => (await te(f, w, o.id), o.id))
|
|
767
768
|
);
|
|
768
769
|
for (const o of C)
|
|
769
770
|
o.status === "fulfilled" ? n(o.value) : console.error("Failed to delete export:", o.reason);
|
|
@@ -781,7 +782,7 @@ function It() {
|
|
|
781
782
|
const w = a == null ? void 0 : a.apiServiceUrl, S = e == null ? void 0 : e.accessToken;
|
|
782
783
|
if (w && S)
|
|
783
784
|
try {
|
|
784
|
-
await
|
|
785
|
+
await te(w, S, f), n(f);
|
|
785
786
|
return;
|
|
786
787
|
} catch (C) {
|
|
787
788
|
console.error(`Failed to cancel export ${f}:`, C);
|
|
@@ -811,7 +812,7 @@ function It() {
|
|
|
811
812
|
disabled: c,
|
|
812
813
|
title: "Refresh status",
|
|
813
814
|
children: /* @__PURE__ */ t(
|
|
814
|
-
|
|
815
|
+
et,
|
|
815
816
|
{
|
|
816
817
|
className: `h-4 w-4 ${c ? "animate-spin" : ""}`
|
|
817
818
|
}
|
|
@@ -841,14 +842,14 @@ function It() {
|
|
|
841
842
|
)) }) })
|
|
842
843
|
] });
|
|
843
844
|
}
|
|
844
|
-
function
|
|
845
|
+
function $t({
|
|
845
846
|
variant: e
|
|
846
847
|
}) {
|
|
847
|
-
const a =
|
|
848
|
+
const a = R((i) => i.activeExports), v = tt(), l = a.size > 0, n = Array.from(a.values()).some(
|
|
848
849
|
(i) => i.status === "completed" || i.status === "failed"
|
|
849
850
|
), c = v > 0 ? v > 9 ? "9+" : String(v) : null;
|
|
850
|
-
return /* @__PURE__ */ s(
|
|
851
|
-
/* @__PURE__ */ t(
|
|
851
|
+
return /* @__PURE__ */ s(ue, { children: [
|
|
852
|
+
/* @__PURE__ */ t(me, { asChild: !0, children: /* @__PURE__ */ s(
|
|
852
853
|
I,
|
|
853
854
|
{
|
|
854
855
|
variant: e ?? "ghost",
|
|
@@ -856,7 +857,7 @@ function _t({
|
|
|
856
857
|
className: "relative w-7 px-0 text-muted-foreground hover:text-foreground",
|
|
857
858
|
"aria-label": "Export notifications",
|
|
858
859
|
children: [
|
|
859
|
-
/* @__PURE__ */ t(
|
|
860
|
+
/* @__PURE__ */ t(at, { className: "h-3.5 w-3.5" }),
|
|
860
861
|
l && /* @__PURE__ */ t(
|
|
861
862
|
"span",
|
|
862
863
|
{
|
|
@@ -867,7 +868,7 @@ function _t({
|
|
|
867
868
|
]
|
|
868
869
|
}
|
|
869
870
|
) }),
|
|
870
|
-
/* @__PURE__ */ t(
|
|
871
|
+
/* @__PURE__ */ t(he, { className: "w-80 p-0", align: "end", sideOffset: 8, children: /* @__PURE__ */ t(It, {}) })
|
|
871
872
|
] });
|
|
872
873
|
}
|
|
873
874
|
function Ft(e) {
|
|
@@ -893,7 +894,7 @@ function Ht({
|
|
|
893
894
|
preventPassiveDismissDuringCreate: r,
|
|
894
895
|
resolvedOpen: p,
|
|
895
896
|
setIsCreateFlowActive: b
|
|
896
|
-
} =
|
|
897
|
+
} = ht({
|
|
897
898
|
open: e,
|
|
898
899
|
onOpenChange: a,
|
|
899
900
|
initialCreateFlowActive: n === "create",
|
|
@@ -904,7 +905,7 @@ function Ht({
|
|
|
904
905
|
// create and make consumers use `forceClose()` from a dedicated
|
|
905
906
|
// button.
|
|
906
907
|
dismissMode: l ? "passive" : "explicit-only"
|
|
907
|
-
}), h = B((u) => u.dashboard), { setDashboardControlsModel: y } =
|
|
908
|
+
}), h = B((u) => u.dashboard), { setDashboardControlsModel: y } = q(), { participants: E } = st(Le(h)), f = Array.from(
|
|
908
909
|
new Map(
|
|
909
910
|
E.flatMap(
|
|
910
911
|
(u) => u.fieldChoices.map((g) => {
|
|
@@ -934,10 +935,10 @@ function Ht({
|
|
|
934
935
|
})
|
|
935
936
|
)
|
|
936
937
|
).values()
|
|
937
|
-
), S =
|
|
938
|
+
), S = Te({
|
|
938
939
|
...h || {},
|
|
939
940
|
controls: []
|
|
940
|
-
}), C =
|
|
941
|
+
}), C = rt(h), o = (u, g, A) => {
|
|
941
942
|
y(
|
|
942
943
|
u,
|
|
943
944
|
g,
|
|
@@ -950,13 +951,13 @@ function Ht({
|
|
|
950
951
|
}
|
|
951
952
|
b(!1);
|
|
952
953
|
}, [d, c, b]), N = /* @__PURE__ */ t(
|
|
953
|
-
|
|
954
|
+
pt,
|
|
954
955
|
{
|
|
955
956
|
scope: "dashboard",
|
|
956
957
|
controls: h.controls || [],
|
|
957
958
|
reservedControlIds: S,
|
|
958
959
|
defaultValues: h.defaultControlValues || {},
|
|
959
|
-
usageByControlId:
|
|
960
|
+
usageByControlId: ot(h),
|
|
960
961
|
availableFieldChoices: f,
|
|
961
962
|
availableMetricChoices: w,
|
|
962
963
|
structuralParticipants: E,
|
|
@@ -974,13 +975,13 @@ function Ht({
|
|
|
974
975
|
] }),
|
|
975
976
|
N
|
|
976
977
|
] });
|
|
977
|
-
return l ? /* @__PURE__ */ s(
|
|
978
|
-
/* @__PURE__ */ t(
|
|
979
|
-
/* @__PURE__ */ t(
|
|
978
|
+
return l ? /* @__PURE__ */ s(ue, { open: p, onOpenChange: m, children: [
|
|
979
|
+
/* @__PURE__ */ t(me, { asChild: !0, children: v || /* @__PURE__ */ s(I, { variant: "outline", className: "h-7 px-2", size: "sm", children: [
|
|
980
|
+
/* @__PURE__ */ t(K, { className: "mr-2 h-4 w-4" }),
|
|
980
981
|
"Controls"
|
|
981
982
|
] }) }),
|
|
982
983
|
/* @__PURE__ */ t(
|
|
983
|
-
|
|
984
|
+
he,
|
|
984
985
|
{
|
|
985
986
|
className: "w-[620px] max-w-[95vw] space-y-4",
|
|
986
987
|
align: "end",
|
|
@@ -989,21 +990,21 @@ function Ht({
|
|
|
989
990
|
children: U
|
|
990
991
|
}
|
|
991
992
|
)
|
|
992
|
-
] }) : /* @__PURE__ */ t(
|
|
993
|
-
|
|
993
|
+
] }) : /* @__PURE__ */ t(pe, { open: p, onOpenChange: m, children: /* @__PURE__ */ s(
|
|
994
|
+
fe,
|
|
994
995
|
{
|
|
995
996
|
className: "flex max-h-[88vh] flex-col overflow-hidden sm:max-w-[600px]",
|
|
996
997
|
onEscapeKeyDown: r,
|
|
997
998
|
onPointerDownOutside: r,
|
|
998
999
|
children: [
|
|
999
1000
|
/* @__PURE__ */ s(
|
|
1000
|
-
|
|
1001
|
+
ve,
|
|
1001
1002
|
{
|
|
1002
1003
|
className: i ? "space-y-0" : void 0,
|
|
1003
1004
|
children: [
|
|
1004
|
-
/* @__PURE__ */ t(
|
|
1005
|
+
/* @__PURE__ */ t(ge, { className: "text-[15px]", children: F }),
|
|
1005
1006
|
/* @__PURE__ */ t(
|
|
1006
|
-
|
|
1007
|
+
be,
|
|
1007
1008
|
{
|
|
1008
1009
|
className: i ? "sr-only" : "text-[13px]",
|
|
1009
1010
|
children: i ? "Configure and add a shared dashboard control." : "Add shared controls viewers can use across the dashboard. Each card can decide how to respond to the same control."
|
|
@@ -1053,13 +1054,13 @@ function jt({
|
|
|
1053
1054
|
),
|
|
1054
1055
|
onClick: a,
|
|
1055
1056
|
children: [
|
|
1056
|
-
e ? /* @__PURE__ */ t(gt, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ t(
|
|
1057
|
+
e ? /* @__PURE__ */ t(gt, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ t(ae, { className: "h-3.5 w-3.5" }),
|
|
1057
1058
|
"Filter"
|
|
1058
1059
|
]
|
|
1059
1060
|
}
|
|
1060
1061
|
),
|
|
1061
|
-
/* @__PURE__ */ s(
|
|
1062
|
-
/* @__PURE__ */ t(
|
|
1062
|
+
/* @__PURE__ */ s(ye, { children: [
|
|
1063
|
+
/* @__PURE__ */ t(we, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1063
1064
|
I,
|
|
1064
1065
|
{
|
|
1065
1066
|
variant: "ghost",
|
|
@@ -1069,11 +1070,11 @@ function jt({
|
|
|
1069
1070
|
i
|
|
1070
1071
|
),
|
|
1071
1072
|
"aria-label": "Filter and control actions",
|
|
1072
|
-
children: /* @__PURE__ */ t(
|
|
1073
|
+
children: /* @__PURE__ */ t(ce, { className: "h-3.5 w-3.5" })
|
|
1073
1074
|
}
|
|
1074
1075
|
) }),
|
|
1075
1076
|
/* @__PURE__ */ s(
|
|
1076
|
-
|
|
1077
|
+
Ce,
|
|
1077
1078
|
{
|
|
1078
1079
|
align: "start",
|
|
1079
1080
|
className: H(
|
|
@@ -1081,16 +1082,16 @@ function jt({
|
|
|
1081
1082
|
r
|
|
1082
1083
|
),
|
|
1083
1084
|
children: [
|
|
1084
|
-
/* @__PURE__ */ s(
|
|
1085
|
-
/* @__PURE__ */ t(
|
|
1085
|
+
/* @__PURE__ */ s(z, { onSelect: v, children: [
|
|
1086
|
+
/* @__PURE__ */ t(ae, { className: "h-3.5 w-3.5" }),
|
|
1086
1087
|
"Add filter"
|
|
1087
1088
|
] }),
|
|
1088
|
-
/* @__PURE__ */ s(
|
|
1089
|
-
/* @__PURE__ */ t(
|
|
1089
|
+
/* @__PURE__ */ s(z, { onSelect: l, children: [
|
|
1090
|
+
/* @__PURE__ */ t(K, { className: "h-3.5 w-3.5" }),
|
|
1090
1091
|
"Add control"
|
|
1091
1092
|
] }),
|
|
1092
|
-
/* @__PURE__ */ s(
|
|
1093
|
-
/* @__PURE__ */ t(
|
|
1093
|
+
/* @__PURE__ */ s(z, { onSelect: n, children: [
|
|
1094
|
+
/* @__PURE__ */ t(nt, { className: "h-3.5 w-3.5" }),
|
|
1094
1095
|
"Manage controls"
|
|
1095
1096
|
] })
|
|
1096
1097
|
]
|
|
@@ -1102,14 +1103,14 @@ function jt({
|
|
|
1102
1103
|
);
|
|
1103
1104
|
}
|
|
1104
1105
|
export {
|
|
1105
|
-
|
|
1106
|
+
Ot as A,
|
|
1106
1107
|
Ht as D,
|
|
1107
1108
|
It as E,
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1109
|
+
$t as N,
|
|
1110
|
+
zt as U,
|
|
1111
|
+
Bt as V,
|
|
1111
1112
|
At as a,
|
|
1112
|
-
|
|
1113
|
+
_t as b,
|
|
1113
1114
|
jt as c,
|
|
1114
|
-
|
|
1115
|
+
Rt as u
|
|
1115
1116
|
};
|