react-semaphor 0.1.281 → 0.1.283
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-D3R8Z79V.js → dashboard-controls-DN8jYCON.js} +102 -102
- package/dist/chunks/{dashboard-controls-CLd_NTpW.js → dashboard-controls-wfMo3T6T.js} +1 -1
- package/dist/chunks/{dashboard-filter-controls-button-DLjcoN1G.js → dashboard-filter-controls-button-DKc_6T_O.js} +2 -2
- package/dist/chunks/{dashboard-filter-controls-button-zj4HH2IS.js → dashboard-filter-controls-button-zeiatmo1.js} +125 -113
- package/dist/chunks/{dashboard-json-BcdeYcFr.js → dashboard-json-DK_hQ4vs.js} +1 -1
- package/dist/chunks/{dashboard-json-CPyonfsi.js → dashboard-json-DyJBSpIU.js} +1 -1
- package/dist/chunks/{dashboard-summary-settings-dialog-Cpb9FCXf.js → dashboard-summary-settings-dialog-BPyawgMV.js} +1 -1
- package/dist/chunks/{dashboard-summary-settings-dialog-BYQfaQGZ.js → dashboard-summary-settings-dialog-CWtlFDFP.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-NyBBQhsY.js → edit-dashboard-visual-0lBlwTCM.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-CsTmOttj.js → edit-dashboard-visual-4nQV1U_c.js} +319 -319
- package/dist/chunks/{index-CsX3UmQg.js → index-B7kUtCgG.js} +26420 -25515
- package/dist/chunks/{index-DvAOngur.js → index-BHWWNpG6.js} +223 -223
- package/dist/chunks/{resource-management-panel-lglhpWpc.js → resource-management-panel-D8xvqypt.js} +1 -1
- package/dist/chunks/{resource-management-panel-BxJ99bHx.js → resource-management-panel-Dpin6Ffw.js} +2 -2
- package/dist/chunks/use-create-flow-overlay-state-VwKDgVAy.js +1597 -0
- package/dist/chunks/use-create-flow-overlay-state-XkHgf9f3.js +21 -0
- package/dist/chunks/{use-visual-utils-C54WwvId.js → use-visual-utils-C8YSTPfX.js} +1 -1
- package/dist/chunks/{use-visual-utils-C7wVd3rs.js → use-visual-utils-CBocWNV1.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 +2 -2
- package/dist/types/dashboard.d.ts +9 -1
- package/dist/types/main.d.ts +9 -1
- package/dist/types/shared.d.ts +9 -1
- package/dist/types/surfboard.d.ts +9 -1
- package/dist/types/types.d.ts +9 -1
- package/package.json +1 -1
- package/dist/chunks/use-create-flow-overlay-state-BjV5Q6Lb.js +0 -1443
- package/dist/chunks/use-create-flow-overlay-state-BrmQZdh2.js +0 -21
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import ge, { useState as F, useRef as z, useCallback as V, useEffect as T, useContext as be } from "react";
|
|
2
|
-
import { bM as Z, b as $, aC as U, bJ as _, bF as ee, bG as H, aD as te, bE as Ce, e as ae, f as se, g as re, h as oe, i as ne, L as G, I as we,
|
|
2
|
+
import { bM as Z, b as $, aC as U, bJ as _, bF as ee, bG as H, aD as te, bE as Ce, e as ae, f as se, g as re, h as oe, i as ne, L as G, I as we, d8 as ye, v as xe, B as I, w as j, U as R, J as Ne, u as B, K as De, N as X, d9 as Ae, da as K, x as P, b_ as ie, af as Se, c as L, cC as le, cD as de, a6 as ce, cF as ue, cG as M, s as Ee, cK as Ie, ct as Le, M as Fe, db as Te, dc as ke, dd as Ue, cS as Me, cT as Ve, cU as Pe, cV as Be, cW as Oe, cX as ze, cY as Re, as as $e, bL as _e, X as He, de as je, df as Xe, cz as Ge, bH as W, a8 as Ke, aF as We, P as he, k as me, dg as qe, l as pe, dh as Je, di as Ye, dj as Qe, dk as Ze, dl as et, dm as fe, dn as q, dp as tt } from "./index-B7kUtCgG.js";
|
|
3
3
|
import { jsx as t, jsxs as s, Fragment as O } from "react/jsx-runtime";
|
|
4
|
-
import { V as at, E as st, a as rt, b as ot, L as nt, c as it, d as lt, C as dt, u as ct, e as ut } from "./use-create-flow-overlay-state-
|
|
5
|
-
import { u as ve } from "./use-visual-utils-
|
|
4
|
+
import { V as at, E as st, a as rt, b as ot, L as nt, c as it, d as lt, C as dt, u as ct, e as ut } from "./use-create-flow-overlay-state-VwKDgVAy.js";
|
|
5
|
+
import { u as ve } from "./use-visual-utils-CBocWNV1.js";
|
|
6
6
|
import { k as J } from "./date-formatter-vkCj9Ct-.js";
|
|
7
7
|
/**
|
|
8
8
|
* @license lucide-react v0.453.0 - ISC
|
|
@@ -10,7 +10,7 @@ import { k as J } from "./date-formatter-vkCj9Ct-.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
|
|
13
|
+
const Y = Z("FileDown", [
|
|
14
14
|
["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
|
|
15
15
|
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
|
|
16
16
|
["path", { d: "M12 18v-6", key: "17g6i2" }],
|
|
@@ -26,13 +26,13 @@ const ht = Z("FilterX", [
|
|
|
26
26
|
["path", { d: "M13.013 3H2l8 9.46V19l4 2v-8.54l.9-1.055", key: "1fi1da" }],
|
|
27
27
|
["path", { d: "m22 3-5 5", key: "12jva0" }],
|
|
28
28
|
["path", { d: "m17 3 5 5", key: "k36vhe" }]
|
|
29
|
-
]), mt = 1e4, pt = 15e3, ft = 3e4, vt = 3e4, gt = 12e4,
|
|
29
|
+
]), mt = 1e4, pt = 15e3, ft = 3e4, vt = 3e4, gt = 12e4, Q = 2 * 60 * 60 * 1e3;
|
|
30
30
|
function bt(e) {
|
|
31
31
|
const a = Date.now() - e.getTime();
|
|
32
32
|
return a < vt ? mt : a < gt ? pt : ft;
|
|
33
33
|
}
|
|
34
34
|
function Tt() {
|
|
35
|
-
const { authToken: e, tokenProps: a } = $(), p = U((m) => m.activeExports), [
|
|
35
|
+
const { authToken: e, tokenProps: a } = $(), p = U((m) => m.activeExports), [d, c] = F(
|
|
36
36
|
typeof document < "u" ? !document.hidden : !0
|
|
37
37
|
), u = z(null), n = z(!1), l = z(void 0), h = a == null ? void 0 : a.apiServiceUrl, o = e == null ? void 0 : e.accessToken, v = V(() => {
|
|
38
38
|
const m = U.getState().activeExports;
|
|
@@ -43,7 +43,7 @@ function Tt() {
|
|
|
43
43
|
T(() => {
|
|
44
44
|
if (typeof document > "u") return;
|
|
45
45
|
const m = () => {
|
|
46
|
-
|
|
46
|
+
c(!document.hidden);
|
|
47
47
|
};
|
|
48
48
|
return document.addEventListener("visibilitychange", m), () => {
|
|
49
49
|
document.removeEventListener("visibilitychange", m);
|
|
@@ -59,12 +59,12 @@ function Tt() {
|
|
|
59
59
|
n.current = !1;
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
|
-
const C = Date.now(),
|
|
63
|
-
(r) => C - r.startedAt.getTime() >
|
|
62
|
+
const C = Date.now(), N = m.filter(
|
|
63
|
+
(r) => C - r.startedAt.getTime() > Q
|
|
64
64
|
);
|
|
65
|
-
if (
|
|
65
|
+
if (N.length > 0) {
|
|
66
66
|
const { updateExport: r } = U.getState().actions;
|
|
67
|
-
for (const i of
|
|
67
|
+
for (const i of N)
|
|
68
68
|
r(i.id, {
|
|
69
69
|
status: "failed",
|
|
70
70
|
error: "Export timed out. Please try again or contact support.",
|
|
@@ -72,7 +72,7 @@ function Tt() {
|
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
74
|
const f = m.filter(
|
|
75
|
-
(r) => C - r.startedAt.getTime() <=
|
|
75
|
+
(r) => C - r.startedAt.getTime() <= Q
|
|
76
76
|
);
|
|
77
77
|
if (f.length === 0) {
|
|
78
78
|
n.current = !1;
|
|
@@ -130,25 +130,25 @@ function Tt() {
|
|
|
130
130
|
l.current = b;
|
|
131
131
|
}, [b]), T(() => {
|
|
132
132
|
var C;
|
|
133
|
-
v().length > 0 &&
|
|
134
|
-
}, [p,
|
|
133
|
+
v().length > 0 && d && !n.current && (n.current = !0, (C = l.current) == null || C.call(l));
|
|
134
|
+
}, [p, d, v]), T(() => {
|
|
135
135
|
var C;
|
|
136
136
|
const m = v();
|
|
137
|
-
|
|
138
|
-
}, [
|
|
139
|
-
!
|
|
140
|
-
}, [
|
|
137
|
+
d && m.length > 0 && !n.current && (n.current = !0, (C = l.current) == null || C.call(l));
|
|
138
|
+
}, [d, v]), T(() => {
|
|
139
|
+
!d && u.current && (clearTimeout(u.current), u.current = null, n.current = !1);
|
|
140
|
+
}, [d]), T(() => () => {
|
|
141
141
|
u.current && (clearTimeout(u.current), u.current = null);
|
|
142
142
|
}, []), {
|
|
143
143
|
isPolling: n.current,
|
|
144
|
-
isTabVisible:
|
|
144
|
+
isTabVisible: d,
|
|
145
145
|
inProgressCount: v().length
|
|
146
146
|
};
|
|
147
147
|
}
|
|
148
148
|
function kt() {
|
|
149
|
-
const { authToken: e, tokenProps: a } = $(), p = U((l) => l.activeExports), { addExport:
|
|
149
|
+
const { authToken: e, tokenProps: a } = $(), p = U((l) => l.activeExports), { addExport: d } = te(), c = z(!1), u = a == null ? void 0 : a.apiServiceUrl, n = e == null ? void 0 : e.accessToken;
|
|
150
150
|
T(() => {
|
|
151
|
-
if (
|
|
151
|
+
if (c.current || !u || !n) return;
|
|
152
152
|
(async () => {
|
|
153
153
|
try {
|
|
154
154
|
const { exports: h } = await Ce(u, n, {
|
|
@@ -185,14 +185,14 @@ function kt() {
|
|
|
185
185
|
expiresAt: new Date(o.expiresAt),
|
|
186
186
|
downloadUrl: b
|
|
187
187
|
};
|
|
188
|
-
|
|
188
|
+
d(m);
|
|
189
189
|
}
|
|
190
|
-
|
|
190
|
+
c.current = !0;
|
|
191
191
|
} catch (h) {
|
|
192
|
-
console.error("[useExportRecovery] Failed to recover exports:", h),
|
|
192
|
+
console.error("[useExportRecovery] Failed to recover exports:", h), c.current = !0;
|
|
193
193
|
}
|
|
194
194
|
})();
|
|
195
|
-
}, [u, n,
|
|
195
|
+
}, [u, n, d, p]);
|
|
196
196
|
}
|
|
197
197
|
function Ct(e) {
|
|
198
198
|
return e.title ? e.title : _(
|
|
@@ -203,19 +203,19 @@ function wt({
|
|
|
203
203
|
open: e,
|
|
204
204
|
onOpenChange: a,
|
|
205
205
|
isLibraryVisual: p,
|
|
206
|
-
currentVisualName:
|
|
207
|
-
isSaving:
|
|
206
|
+
currentVisualName: d,
|
|
207
|
+
isSaving: c = !1,
|
|
208
208
|
destinationMode: u = "both",
|
|
209
209
|
onConfirm: n
|
|
210
210
|
}) {
|
|
211
211
|
const [l, h] = F(
|
|
212
|
-
p &&
|
|
212
|
+
p && d ? `Copy of ${d}` : d || ""
|
|
213
213
|
), [o, v] = F("");
|
|
214
214
|
ge.useEffect(() => {
|
|
215
215
|
e && (h(
|
|
216
|
-
p &&
|
|
216
|
+
p && d ? `Copy of ${d}` : d || ""
|
|
217
217
|
), v(""));
|
|
218
|
-
}, [e, p,
|
|
218
|
+
}, [e, p, d]);
|
|
219
219
|
const b = !!l.trim(), m = u === "local" ? {
|
|
220
220
|
saveToLibrary: !1,
|
|
221
221
|
saveToCurrentDashboard: !0,
|
|
@@ -235,7 +235,7 @@ function wt({
|
|
|
235
235
|
description: "Creates a new library visual and adds a linked copy to this dashboard.",
|
|
236
236
|
actionLabel: "Save Copy as Linked Visual"
|
|
237
237
|
}, C = () => {
|
|
238
|
-
!b ||
|
|
238
|
+
!b || c || n({
|
|
239
239
|
name: l.trim(),
|
|
240
240
|
description: o.trim() || void 0,
|
|
241
241
|
saveToLibrary: m.saveToLibrary,
|
|
@@ -265,9 +265,9 @@ function wt({
|
|
|
265
265
|
{
|
|
266
266
|
id: "name",
|
|
267
267
|
value: l,
|
|
268
|
-
onChange: (
|
|
268
|
+
onChange: (N) => h(N.target.value),
|
|
269
269
|
placeholder: "Enter visual name",
|
|
270
|
-
disabled:
|
|
270
|
+
disabled: c
|
|
271
271
|
}
|
|
272
272
|
)
|
|
273
273
|
] }),
|
|
@@ -278,10 +278,10 @@ function wt({
|
|
|
278
278
|
{
|
|
279
279
|
id: "description",
|
|
280
280
|
value: o,
|
|
281
|
-
onChange: (
|
|
281
|
+
onChange: (N) => v(N.target.value),
|
|
282
282
|
placeholder: "Enter visual description",
|
|
283
283
|
rows: 3,
|
|
284
|
-
disabled:
|
|
284
|
+
disabled: c
|
|
285
285
|
}
|
|
286
286
|
)
|
|
287
287
|
] })
|
|
@@ -292,33 +292,33 @@ function wt({
|
|
|
292
292
|
{
|
|
293
293
|
variant: "outline",
|
|
294
294
|
onClick: () => a(!1),
|
|
295
|
-
disabled:
|
|
295
|
+
disabled: c,
|
|
296
296
|
children: "Cancel"
|
|
297
297
|
}
|
|
298
298
|
),
|
|
299
|
-
/* @__PURE__ */ s(I, { onClick: C, disabled: !b ||
|
|
300
|
-
|
|
299
|
+
/* @__PURE__ */ s(I, { onClick: C, disabled: !b || c, children: [
|
|
300
|
+
c && /* @__PURE__ */ t(j, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
301
301
|
m.actionLabel
|
|
302
302
|
] })
|
|
303
303
|
] })
|
|
304
304
|
] }) });
|
|
305
305
|
}
|
|
306
306
|
function yt() {
|
|
307
|
-
const [e, a] = F(!1), [p,
|
|
307
|
+
const [e, a] = F(!1), [p, d] = F(!1), [c, u] = F(null), n = R((i) => i.frame), l = R((i) => i.card), h = Ne(), o = B((i) => i.selectedSheetId), v = B(
|
|
308
308
|
(i) => i.actions.setIsDashboardPanelOpen
|
|
309
|
-
), { getUpdatedFrame: b } = ve(), { selectVisual: m } =
|
|
309
|
+
), { getUpdatedFrame: b } = ve(), { selectVisual: m } = De(), { addFrame: C, setSelectedFrameId: N, setIsVisualEditing: f } = X(), y = !!(n != null && n.visualId), S = (() => {
|
|
310
310
|
var i, g;
|
|
311
311
|
return ((i = n == null ? void 0 : n.cards) == null ? void 0 : i.length) === 1 && ((g = n.cards[0]) != null && g.title) ? n.cards[0].title : h != null && h.title ? h.title : (l == null ? void 0 : l.title) || "Untitled Visual";
|
|
312
312
|
})(), w = Ae((i) => {
|
|
313
313
|
if (i != null && i.id) {
|
|
314
|
-
if (m(i), p &&
|
|
314
|
+
if (m(i), p && c && o) {
|
|
315
315
|
const g = {
|
|
316
|
-
...
|
|
316
|
+
...c,
|
|
317
317
|
id: K(),
|
|
318
318
|
visualId: i.id
|
|
319
319
|
// Link to the newly created library visual
|
|
320
320
|
};
|
|
321
|
-
C(o, g, "end"),
|
|
321
|
+
C(o, g, "end"), N(g.id), d(!1), u(null), f(!1);
|
|
322
322
|
}
|
|
323
323
|
v(!0), a(!1);
|
|
324
324
|
}
|
|
@@ -345,7 +345,7 @@ function yt() {
|
|
|
345
345
|
}))
|
|
346
346
|
} : g;
|
|
347
347
|
if (i.saveToLibrary) {
|
|
348
|
-
|
|
348
|
+
d(i.saveToCurrentDashboard), u(A);
|
|
349
349
|
const x = {
|
|
350
350
|
title: i.name,
|
|
351
351
|
description: i.description,
|
|
@@ -362,7 +362,7 @@ function yt() {
|
|
|
362
362
|
visualId: void 0
|
|
363
363
|
// Explicitly no visualId for local visuals
|
|
364
364
|
};
|
|
365
|
-
C(o, x, "end"),
|
|
365
|
+
C(o, x, "end"), N(x.id), P.success("Visual saved to dashboard"), a(!1), f(!1);
|
|
366
366
|
}
|
|
367
367
|
},
|
|
368
368
|
isLibraryVisual: y,
|
|
@@ -373,34 +373,34 @@ function yt() {
|
|
|
373
373
|
function Ut({
|
|
374
374
|
className: e
|
|
375
375
|
}) {
|
|
376
|
-
const a = R((
|
|
377
|
-
saveAsDialogOpen:
|
|
376
|
+
const a = R((D) => D.frame), p = Se((D) => D.selectedVisual), d = B((D) => D.selectedFrameId), c = B((D) => D.selectedSheetId), { setIsVisualEditing: u, updateFrame: n } = X(), [l, h] = F(!1), [o, v] = F("both"), b = !!(a != null && a.visualId || p != null && p.id), m = !!(a != null && a.visualId && d), C = b && !m, {
|
|
377
|
+
saveAsDialogOpen: N,
|
|
378
378
|
setSaveAsDialogOpen: f,
|
|
379
379
|
handleSaveAs: y,
|
|
380
380
|
isLibraryVisual: S,
|
|
381
381
|
currentVisualName: w,
|
|
382
382
|
isSaving: r
|
|
383
383
|
} = yt(), { getUpdatedFrame: i } = ve(), g = () => {
|
|
384
|
-
if (!
|
|
384
|
+
if (!c) {
|
|
385
385
|
P.error("No sheet selected");
|
|
386
386
|
return;
|
|
387
387
|
}
|
|
388
388
|
if (l) return;
|
|
389
389
|
h(!0);
|
|
390
|
-
const
|
|
390
|
+
const D = i(), A = ie(D);
|
|
391
391
|
if (A) {
|
|
392
392
|
h(!1), P.error(A);
|
|
393
393
|
return;
|
|
394
394
|
}
|
|
395
395
|
const x = {
|
|
396
|
-
...
|
|
396
|
+
...D,
|
|
397
397
|
visualId: void 0
|
|
398
398
|
};
|
|
399
|
-
n(
|
|
399
|
+
n(c, x), setTimeout(() => {
|
|
400
400
|
h(!1), P.success("Changes applied. Visual is now local to this dashboard"), u(!1);
|
|
401
401
|
}, 300);
|
|
402
|
-
}, E = (
|
|
403
|
-
v(
|
|
402
|
+
}, E = (D) => {
|
|
403
|
+
v(D), f(!0);
|
|
404
404
|
};
|
|
405
405
|
return /* @__PURE__ */ s(O, { children: [
|
|
406
406
|
/* @__PURE__ */ s("div", { className: "inline-flex items-center overflow-hidden rounded-md border border-input", children: [
|
|
@@ -494,9 +494,9 @@ function Ut({
|
|
|
494
494
|
/* @__PURE__ */ t(
|
|
495
495
|
wt,
|
|
496
496
|
{
|
|
497
|
-
open:
|
|
498
|
-
onOpenChange: (
|
|
499
|
-
r || f(
|
|
497
|
+
open: N,
|
|
498
|
+
onOpenChange: (D) => {
|
|
499
|
+
r || f(D);
|
|
500
500
|
},
|
|
501
501
|
isLibraryVisual: S,
|
|
502
502
|
currentVisualName: w,
|
|
@@ -512,14 +512,14 @@ function Mt({
|
|
|
512
512
|
//labelClassName,
|
|
513
513
|
switchClassName: a
|
|
514
514
|
}) {
|
|
515
|
-
const p = R((l) => l.isDevMode),
|
|
516
|
-
return !
|
|
515
|
+
const p = R((l) => l.isDevMode), d = B((l) => l.isVisualEditing), { setIsDevMode: c } = Fe(), { config: u } = be(Te).tokenProps, n = (u == null ? void 0 : u.showAdvancedMode) !== !1;
|
|
516
|
+
return !d || !n ? null : /* @__PURE__ */ s("div", { className: L("flex items-center space-x-2", e), children: [
|
|
517
517
|
/* @__PURE__ */ t(
|
|
518
518
|
ke,
|
|
519
519
|
{
|
|
520
520
|
className: L("", a),
|
|
521
521
|
checked: p,
|
|
522
|
-
onCheckedChange: () =>
|
|
522
|
+
onCheckedChange: () => c(!p),
|
|
523
523
|
id: "advanced-mode",
|
|
524
524
|
icon: /* @__PURE__ */ t(Ue, { className: "h-4 w-4" }),
|
|
525
525
|
tooltip: "Advanced Mode"
|
|
@@ -532,8 +532,8 @@ function Vt({
|
|
|
532
532
|
open: e,
|
|
533
533
|
onOpenChange: a,
|
|
534
534
|
onSave: p,
|
|
535
|
-
onDiscard:
|
|
536
|
-
isSaving:
|
|
535
|
+
onDiscard: d,
|
|
536
|
+
isSaving: c,
|
|
537
537
|
title: u = "Unsaved changes",
|
|
538
538
|
description: n = "You have unsaved changes to this dashboard. What would you like to do?",
|
|
539
539
|
cancelLabel: l = "Cancel",
|
|
@@ -541,36 +541,36 @@ function Vt({
|
|
|
541
541
|
saveLabel: o = "Save"
|
|
542
542
|
}) {
|
|
543
543
|
return /* @__PURE__ */ t(Me, { open: e, onOpenChange: (b) => {
|
|
544
|
-
!b &&
|
|
544
|
+
!b && c || a(b);
|
|
545
545
|
}, children: /* @__PURE__ */ s(Ve, { children: [
|
|
546
546
|
/* @__PURE__ */ s(Pe, { children: [
|
|
547
547
|
/* @__PURE__ */ t(Be, { children: u }),
|
|
548
548
|
/* @__PURE__ */ t(Oe, { children: n })
|
|
549
549
|
] }),
|
|
550
550
|
/* @__PURE__ */ s(ze, { children: [
|
|
551
|
-
/* @__PURE__ */ t(Re, { disabled:
|
|
551
|
+
/* @__PURE__ */ t(Re, { disabled: c, children: l }),
|
|
552
552
|
/* @__PURE__ */ t(
|
|
553
553
|
I,
|
|
554
554
|
{
|
|
555
555
|
type: "button",
|
|
556
|
-
onClick:
|
|
557
|
-
disabled:
|
|
556
|
+
onClick: d,
|
|
557
|
+
disabled: c,
|
|
558
558
|
variant: "destructive",
|
|
559
559
|
className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
560
560
|
children: h
|
|
561
561
|
}
|
|
562
562
|
),
|
|
563
|
-
/* @__PURE__ */ t(I, { type: "button", onClick: p, disabled:
|
|
563
|
+
/* @__PURE__ */ t(I, { type: "button", onClick: p, disabled: c, children: c ? /* @__PURE__ */ s(O, { children: [
|
|
564
564
|
/* @__PURE__ */ t(j, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
565
565
|
"Saving..."
|
|
566
566
|
] }) : o })
|
|
567
567
|
] })
|
|
568
568
|
] }) });
|
|
569
569
|
}
|
|
570
|
-
function Pt(e, a, p,
|
|
570
|
+
function Pt(e, a, p, d) {
|
|
571
571
|
T(() => {
|
|
572
|
-
e && !p && a &&
|
|
573
|
-
}, [e, p, a,
|
|
572
|
+
e && !p && a && d($e(a));
|
|
573
|
+
}, [e, p, a, d]);
|
|
574
574
|
}
|
|
575
575
|
function xt({
|
|
576
576
|
export: e,
|
|
@@ -578,9 +578,9 @@ function xt({
|
|
|
578
578
|
}) {
|
|
579
579
|
const p = () => {
|
|
580
580
|
e.downloadUrl && window.open(e.downloadUrl, "_blank");
|
|
581
|
-
},
|
|
581
|
+
}, d = (l) => {
|
|
582
582
|
l.stopPropagation(), a == null || a(e.id);
|
|
583
|
-
},
|
|
583
|
+
}, c = () => {
|
|
584
584
|
switch (e.status) {
|
|
585
585
|
case "completed":
|
|
586
586
|
return /* @__PURE__ */ t(Ge, { className: "mt-0.5 h-5 w-5 shrink-0 text-green-600" });
|
|
@@ -606,7 +606,7 @@ function xt({
|
|
|
606
606
|
return /* @__PURE__ */ s("div", { className: "group p-4 transition-colors hover:bg-muted/50", children: [
|
|
607
607
|
/* @__PURE__ */ s("div", { className: "mb-2 flex items-start justify-between gap-3", children: [
|
|
608
608
|
/* @__PURE__ */ s("div", { className: "flex min-w-0 flex-1 items-start gap-3", children: [
|
|
609
|
-
|
|
609
|
+
c(),
|
|
610
610
|
/* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: [
|
|
611
611
|
/* @__PURE__ */ t("h4", { className: "mb-1 truncate text-sm font-medium", children: e.title }),
|
|
612
612
|
e.status === "completed" && /* @__PURE__ */ s("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
@@ -629,7 +629,7 @@ function xt({
|
|
|
629
629
|
variant: "ghost",
|
|
630
630
|
size: "icon",
|
|
631
631
|
className: "h-6 w-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100",
|
|
632
|
-
onClick:
|
|
632
|
+
onClick: d,
|
|
633
633
|
"aria-label": "Remove notification",
|
|
634
634
|
children: /* @__PURE__ */ t(He, { className: "h-4 w-4" })
|
|
635
635
|
}
|
|
@@ -663,8 +663,8 @@ function xt({
|
|
|
663
663
|
] })
|
|
664
664
|
] });
|
|
665
665
|
}
|
|
666
|
-
function
|
|
667
|
-
const { authToken: e, tokenProps: a } = $(), p = U((f) => f.activeExports), { clearCompleted:
|
|
666
|
+
function Nt() {
|
|
667
|
+
const { authToken: e, tokenProps: a } = $(), p = U((f) => f.activeExports), { clearCompleted: d, removeExport: c, updateExport: u } = te(), [n, l] = F(!1), [h, o] = F(!1), v = Array.from(p.values()).sort(
|
|
668
668
|
(f, y) => y.startedAt.getTime() - f.startedAt.getTime()
|
|
669
669
|
), b = v.some(
|
|
670
670
|
(f) => f.status === "completed" || f.status === "failed"
|
|
@@ -716,7 +716,7 @@ function Dt() {
|
|
|
716
716
|
]), C = V(async () => {
|
|
717
717
|
const f = a == null ? void 0 : a.apiServiceUrl, y = e == null ? void 0 : e.accessToken;
|
|
718
718
|
if (!f || !y) {
|
|
719
|
-
|
|
719
|
+
d();
|
|
720
720
|
return;
|
|
721
721
|
}
|
|
722
722
|
o(!0);
|
|
@@ -727,7 +727,7 @@ function Dt() {
|
|
|
727
727
|
S.map(async (r) => (await W(f, y, r.id), r.id))
|
|
728
728
|
);
|
|
729
729
|
for (const r of w)
|
|
730
|
-
r.status === "fulfilled" ?
|
|
730
|
+
r.status === "fulfilled" ? c(r.value) : console.error("Failed to delete export:", r.reason);
|
|
731
731
|
} finally {
|
|
732
732
|
o(!1);
|
|
733
733
|
}
|
|
@@ -735,30 +735,30 @@ function Dt() {
|
|
|
735
735
|
v,
|
|
736
736
|
a == null ? void 0 : a.apiServiceUrl,
|
|
737
737
|
e == null ? void 0 : e.accessToken,
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
]),
|
|
738
|
+
d,
|
|
739
|
+
c
|
|
740
|
+
]), N = V(
|
|
741
741
|
async (f) => {
|
|
742
742
|
const y = a == null ? void 0 : a.apiServiceUrl, S = e == null ? void 0 : e.accessToken;
|
|
743
743
|
if (y && S)
|
|
744
744
|
try {
|
|
745
|
-
await W(y, S, f),
|
|
745
|
+
await W(y, S, f), c(f);
|
|
746
746
|
return;
|
|
747
747
|
} catch (w) {
|
|
748
748
|
console.error(`Failed to cancel export ${f}:`, w);
|
|
749
749
|
}
|
|
750
|
-
|
|
750
|
+
c(f);
|
|
751
751
|
},
|
|
752
|
-
[a == null ? void 0 : a.apiServiceUrl, e == null ? void 0 : e.accessToken,
|
|
752
|
+
[a == null ? void 0 : a.apiServiceUrl, e == null ? void 0 : e.accessToken, c]
|
|
753
753
|
);
|
|
754
754
|
return v.length === 0 ? /* @__PURE__ */ s("div", { className: "p-6 text-center", children: [
|
|
755
|
-
/* @__PURE__ */ t(
|
|
755
|
+
/* @__PURE__ */ t(Y, { className: "mx-auto mb-2 h-8 w-8 text-muted-foreground" }),
|
|
756
756
|
/* @__PURE__ */ t("p", { className: "text-sm text-muted-foreground", children: "No active exports" }),
|
|
757
757
|
/* @__PURE__ */ t("p", { className: "mt-1 text-xs text-muted-foreground", children: "Large exports will appear here" })
|
|
758
758
|
] }) : /* @__PURE__ */ s("div", { className: "flex flex-col", children: [
|
|
759
759
|
/* @__PURE__ */ s("div", { className: "flex items-center justify-between border-b px-4 py-3", children: [
|
|
760
760
|
/* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
|
|
761
|
-
/* @__PURE__ */ t(
|
|
761
|
+
/* @__PURE__ */ t(Y, { className: "h-5 w-5 text-muted-foreground" }),
|
|
762
762
|
/* @__PURE__ */ t("h4", { className: "font-semibold", children: "Exports" })
|
|
763
763
|
] }),
|
|
764
764
|
/* @__PURE__ */ s("div", { className: "flex items-center gap-1", children: [
|
|
@@ -796,7 +796,7 @@ function Dt() {
|
|
|
796
796
|
xt,
|
|
797
797
|
{
|
|
798
798
|
export: f,
|
|
799
|
-
onRemove:
|
|
799
|
+
onRemove: N
|
|
800
800
|
},
|
|
801
801
|
f.id
|
|
802
802
|
)) }) })
|
|
@@ -805,7 +805,7 @@ function Dt() {
|
|
|
805
805
|
function Bt({
|
|
806
806
|
variant: e
|
|
807
807
|
}) {
|
|
808
|
-
const a = U((h) => h.activeExports), p = We(),
|
|
808
|
+
const a = U((h) => h.activeExports), p = We(), d = a.size > 0, c = Array.from(a.values()).some(
|
|
809
809
|
(h) => h.status === "completed" || h.status === "failed"
|
|
810
810
|
), n = p > 0 ? p > 9 ? "9+" : String(p) : null;
|
|
811
811
|
return /* @__PURE__ */ s(he, { children: [
|
|
@@ -818,7 +818,7 @@ function Bt({
|
|
|
818
818
|
"aria-label": "Export notifications",
|
|
819
819
|
children: [
|
|
820
820
|
/* @__PURE__ */ t(qe, { className: "h-4 w-4" }),
|
|
821
|
-
|
|
821
|
+
d && /* @__PURE__ */ t(
|
|
822
822
|
"span",
|
|
823
823
|
{
|
|
824
824
|
className: `absolute flex items-center justify-center rounded-full bg-primary text-primary-foreground ${n ? "-right-0.5 -top-0.5 h-4 min-w-4 px-0.5 text-[10px] font-semibold" : "right-0.5 top-0.5 h-2 w-2"}`,
|
|
@@ -828,10 +828,10 @@ function Bt({
|
|
|
828
828
|
]
|
|
829
829
|
}
|
|
830
830
|
) }),
|
|
831
|
-
/* @__PURE__ */ t(pe, { className: "w-80 p-0", align: "end", sideOffset: 8, children: /* @__PURE__ */ t(
|
|
831
|
+
/* @__PURE__ */ t(pe, { className: "w-80 p-0", align: "end", sideOffset: 8, children: /* @__PURE__ */ t(Nt, {}) })
|
|
832
832
|
] });
|
|
833
833
|
}
|
|
834
|
-
function
|
|
834
|
+
function Dt(e) {
|
|
835
835
|
if (e)
|
|
836
836
|
return {
|
|
837
837
|
renamed: e.type === "rename" ? { oldId: e.oldId, newId: e.newId } : void 0,
|
|
@@ -844,10 +844,10 @@ function Ot({
|
|
|
844
844
|
open: e,
|
|
845
845
|
onOpenChange: a,
|
|
846
846
|
trigger: p,
|
|
847
|
-
showTrigger:
|
|
848
|
-
initialMode:
|
|
847
|
+
showTrigger: d = !0,
|
|
848
|
+
initialMode: c = "manage"
|
|
849
849
|
}) {
|
|
850
|
-
const u =
|
|
850
|
+
const u = c === "create", {
|
|
851
851
|
forceClose: n,
|
|
852
852
|
handleOpenChange: l,
|
|
853
853
|
isCreateFlowActive: h,
|
|
@@ -857,10 +857,17 @@ function Ot({
|
|
|
857
857
|
} = ct({
|
|
858
858
|
open: e,
|
|
859
859
|
onOpenChange: a,
|
|
860
|
-
initialCreateFlowActive:
|
|
861
|
-
|
|
860
|
+
initialCreateFlowActive: c === "create",
|
|
861
|
+
// Dialog mode renders a built-in X close button — allow explicit
|
|
862
|
+
// closes through `handleOpenChange`. Popover mode has no X; its
|
|
863
|
+
// only close-via-trigger path is a re-click that would silently
|
|
864
|
+
// wipe the in-progress create flow, so block everything during
|
|
865
|
+
// create and make consumers use `forceClose()` from a dedicated
|
|
866
|
+
// button.
|
|
867
|
+
dismissMode: d ? "passive" : "explicit-only"
|
|
868
|
+
}), m = B((A) => A.dashboard), { setDashboardControlsModel: C } = X(), { participants: N } = Je(Ye(m)), f = Array.from(
|
|
862
869
|
new Map(
|
|
863
|
-
|
|
870
|
+
N.flatMap(
|
|
864
871
|
(A) => A.fieldChoices.map((x) => {
|
|
865
872
|
var k;
|
|
866
873
|
return [
|
|
@@ -875,7 +882,7 @@ function Ot({
|
|
|
875
882
|
).values()
|
|
876
883
|
), y = Array.from(
|
|
877
884
|
new Map(
|
|
878
|
-
|
|
885
|
+
N.flatMap(
|
|
879
886
|
(A) => A.metricChoices.map((x) => {
|
|
880
887
|
var k;
|
|
881
888
|
return [
|
|
@@ -888,14 +895,14 @@ function Ot({
|
|
|
888
895
|
})
|
|
889
896
|
)
|
|
890
897
|
).values()
|
|
891
|
-
), S =
|
|
898
|
+
), S = Qe({
|
|
892
899
|
...m || {},
|
|
893
900
|
controls: []
|
|
894
901
|
}), w = Ze(m), r = (A, x, k) => {
|
|
895
902
|
C(
|
|
896
903
|
A,
|
|
897
904
|
x,
|
|
898
|
-
|
|
905
|
+
Dt(k)
|
|
899
906
|
);
|
|
900
907
|
}, i = V(() => {
|
|
901
908
|
if (u) {
|
|
@@ -913,22 +920,22 @@ function Ot({
|
|
|
913
920
|
usageByControlId: et(m),
|
|
914
921
|
availableFieldChoices: f,
|
|
915
922
|
availableMetricChoices: y,
|
|
916
|
-
structuralParticipants:
|
|
923
|
+
structuralParticipants: N,
|
|
917
924
|
structuralParticipantIdsByControlId: w,
|
|
918
|
-
initialCreateFlow:
|
|
925
|
+
initialCreateFlow: c === "create",
|
|
919
926
|
onCreateFlowActiveChange: b,
|
|
920
927
|
onCreateFlowComplete: i,
|
|
921
928
|
onChange: r,
|
|
922
929
|
emptyMessage: "No dashboard controls yet."
|
|
923
930
|
}
|
|
924
|
-
), E = h ? "Add dashboard control" : "Dashboard Controls",
|
|
931
|
+
), E = h ? "Add dashboard control" : "Dashboard Controls", D = /* @__PURE__ */ s(O, { children: [
|
|
925
932
|
/* @__PURE__ */ s("div", { className: "space-y-1", children: [
|
|
926
933
|
/* @__PURE__ */ t("h4", { className: "text-sm font-medium", children: "Dashboard Controls" }),
|
|
927
934
|
/* @__PURE__ */ t("p", { className: "text-xs text-muted-foreground", children: "Add shared controls viewers can use across the dashboard. Each card can decide how to respond to the same control." })
|
|
928
935
|
] }),
|
|
929
936
|
g
|
|
930
937
|
] });
|
|
931
|
-
return
|
|
938
|
+
return d ? /* @__PURE__ */ s(he, { open: v, onOpenChange: l, children: [
|
|
932
939
|
/* @__PURE__ */ t(me, { asChild: !0, children: p || /* @__PURE__ */ s(I, { variant: "outline", className: "h-7 px-2", size: "sm", children: [
|
|
933
940
|
/* @__PURE__ */ t(fe, { className: "mr-2 h-4 w-4" }),
|
|
934
941
|
"Controls"
|
|
@@ -940,14 +947,13 @@ function Ot({
|
|
|
940
947
|
align: "end",
|
|
941
948
|
onEscapeKeyDown: o,
|
|
942
949
|
onPointerDownOutside: o,
|
|
943
|
-
children:
|
|
950
|
+
children: D
|
|
944
951
|
}
|
|
945
952
|
)
|
|
946
953
|
] }) : /* @__PURE__ */ t(ae, { open: v, onOpenChange: l, children: /* @__PURE__ */ s(
|
|
947
954
|
se,
|
|
948
955
|
{
|
|
949
|
-
className: "flex max-h-[88vh]
|
|
950
|
-
showCloseButton: !h,
|
|
956
|
+
className: "flex max-h-[88vh] flex-col overflow-hidden sm:max-w-[600px]",
|
|
951
957
|
onEscapeKeyDown: o,
|
|
952
958
|
onPointerDownOutside: o,
|
|
953
959
|
children: [
|
|
@@ -956,8 +962,14 @@ function Ot({
|
|
|
956
962
|
{
|
|
957
963
|
className: h ? "space-y-0" : void 0,
|
|
958
964
|
children: [
|
|
959
|
-
/* @__PURE__ */ t(oe, { children: E }),
|
|
960
|
-
/* @__PURE__ */ t(
|
|
965
|
+
/* @__PURE__ */ t(oe, { className: "text-[15px]", children: E }),
|
|
966
|
+
/* @__PURE__ */ t(
|
|
967
|
+
ne,
|
|
968
|
+
{
|
|
969
|
+
className: h ? "sr-only" : "text-[13px]",
|
|
970
|
+
children: h ? "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."
|
|
971
|
+
}
|
|
972
|
+
)
|
|
961
973
|
]
|
|
962
974
|
}
|
|
963
975
|
),
|
|
@@ -970,8 +982,8 @@ function zt({
|
|
|
970
982
|
showFilters: e,
|
|
971
983
|
onToggleFilters: a,
|
|
972
984
|
onAddFilter: p,
|
|
973
|
-
onAddControl:
|
|
974
|
-
onManageControls:
|
|
985
|
+
onAddControl: d,
|
|
986
|
+
onManageControls: c,
|
|
975
987
|
size: u = "default",
|
|
976
988
|
className: n,
|
|
977
989
|
primaryButtonClassName: l,
|
|
@@ -1029,11 +1041,11 @@ function zt({
|
|
|
1029
1041
|
/* @__PURE__ */ t(q, { className: "mr-2 h-4 w-4" }),
|
|
1030
1042
|
"Add filter"
|
|
1031
1043
|
] }),
|
|
1032
|
-
/* @__PURE__ */ s(M, { onSelect:
|
|
1044
|
+
/* @__PURE__ */ s(M, { onSelect: d, children: [
|
|
1033
1045
|
/* @__PURE__ */ t(fe, { className: "mr-2 h-4 w-4" }),
|
|
1034
1046
|
"Add control"
|
|
1035
1047
|
] }),
|
|
1036
|
-
/* @__PURE__ */ s(M, { onSelect:
|
|
1048
|
+
/* @__PURE__ */ s(M, { onSelect: c, children: [
|
|
1037
1049
|
/* @__PURE__ */ t(tt, { className: "mr-2 h-4 w-4" }),
|
|
1038
1050
|
"Manage controls"
|
|
1039
1051
|
] })
|
|
@@ -1048,7 +1060,7 @@ function zt({
|
|
|
1048
1060
|
export {
|
|
1049
1061
|
Mt as A,
|
|
1050
1062
|
Ot as D,
|
|
1051
|
-
|
|
1063
|
+
Nt as E,
|
|
1052
1064
|
Bt as N,
|
|
1053
1065
|
Vt as U,
|
|
1054
1066
|
Ut as V,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as o, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { u as s, c as l, B as h, X as d, d as c } from "./index-
|
|
2
|
+
import { u as s, c as l, B as h, X as d, d as c } from "./index-B7kUtCgG.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "react-dom";
|
|
5
5
|
function N() {
|