react-semaphor 0.1.295 → 0.1.296
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/{braces-BdoTYzuj.js → braces-BNXseceK.js} +1 -1
- package/dist/chunks/{braces-DWldEFn5.js → braces-DVrX_3Q_.js} +1 -1
- package/dist/chunks/dashboard-controls-CKKZcVA5.js +2219 -0
- package/dist/chunks/dashboard-controls-DS2xJxHU.js +47 -0
- package/dist/chunks/dashboard-filter-controls-button-nqfmscB7.js +11 -0
- package/dist/chunks/{dashboard-filter-controls-button-XwenlcXw.js → dashboard-filter-controls-button-xPaIlNHP.js} +501 -495
- package/dist/chunks/{dashboard-json-CU55qPXj.js → dashboard-json-cuj9vYY9.js} +1 -1
- package/dist/chunks/{dashboard-json-V6m6lJ_c.js → dashboard-json-ovQyHWw6.js} +1 -1
- package/dist/chunks/{dashboard-summary-settings-dialog-DRLPzp1P.js → dashboard-summary-settings-dialog-BUg3Qyhh.js} +1 -1
- package/dist/chunks/{dashboard-summary-settings-dialog-0CIiWsKc.js → dashboard-summary-settings-dialog-DF076HeJ.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-8ha6EM_g.js → edit-dashboard-visual-32TAM00c.js} +5331 -5303
- package/dist/chunks/edit-dashboard-visual-BtiMcO-L.js +183 -0
- package/dist/chunks/{index-14M0TnH6.js → index-BDeJH9hO.js} +103265 -88338
- package/dist/chunks/index-Dbrs96G8.js +1533 -0
- package/dist/chunks/{resource-management-panel-CcDAn86l.js → resource-management-panel-2qcXsKwg.js} +2 -2
- package/dist/chunks/{resource-management-panel-BL5-5ouC.js → resource-management-panel-C4qoxy_g.js} +31 -30
- package/dist/chunks/use-create-flow-overlay-state-BMD3YRzU.js +21 -0
- package/dist/chunks/{use-create-flow-overlay-state-D3PxfjYv.js → use-create-flow-overlay-state-CHeppRNE.js} +572 -568
- package/dist/chunks/{use-visual-utils-CdIOq4nt.js → use-visual-utils-BIHLaVwh.js} +70 -68
- package/dist/chunks/use-visual-utils-dOYWf6nM.js +1 -0
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +113 -112
- 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 +235 -1
- package/dist/types/main.d.ts +288 -1
- package/dist/types/shared.d.ts +204 -1
- package/dist/types/surfboard.d.ts +235 -1
- package/dist/types/types.d.ts +235 -1
- package/package.json +7 -1
- package/dist/chunks/dashboard-controls-B3lrnI_r.js +0 -47
- package/dist/chunks/dashboard-controls-D7U6E1sB.js +0 -2014
- package/dist/chunks/dashboard-filter-controls-button-D0AsV28-.js +0 -11
- package/dist/chunks/edit-dashboard-visual-sSLAkmgf.js +0 -183
- package/dist/chunks/index-Ze8VskG1.js +0 -1435
- package/dist/chunks/use-create-flow-overlay-state-BbQVNDCj.js +0 -21
- package/dist/chunks/use-visual-utils-kh8p2QFm.js +0 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { c as
|
|
3
|
-
import { jsx as t, jsxs as s, Fragment as
|
|
4
|
-
import { V as
|
|
5
|
-
import { u as
|
|
6
|
-
import { k as
|
|
1
|
+
import Se, { useState as T, useRef as X, useCallback as _, useEffect as B, useContext as Ae } from "react";
|
|
2
|
+
import { c as le, d as K, aF as z, bM as W, bI as de, bJ as q, aG as ce, bH as Ie, e as ue, f as me, g as he, h as pe, i as fe, L as Z, I as Fe, dc as Le, w as Te, B as A, x as Q, W as j, M as ke, u as O, N as Pe, Q as J, c0 as ve, dd as Ue, de as ee, y as P, c2 as ge, c1 as G, ai as Me, cG as be, cH as xe, a9 as ye, cJ as we, cK as R, t as Ve, cO as Oe, cx as Be, O as ze, df as Re, b as $, dg as Y, dh as $e, cW as _e, cX as He, cY as je, cZ as Xe, c_ as Ge, c$ as Ke, d0 as We, bO as qe, X as Qe, di as Je, dj as Ye, cD as Ze, bK as te, ab as et, aI as tt, P as Ce, k as Ne, dk as at, m as De, dl as st, dm as rt, dn as ot, dp as nt, dq as it, dr as ae, ds as lt } from "./index-BDeJH9hO.js";
|
|
3
|
+
import { jsx as t, jsxs as s, Fragment as H } from "react/jsx-runtime";
|
|
4
|
+
import { V as dt, E as se, a as re, b as ct, c as ut, L as mt, d as ht, C as pt, u as ft, e as vt } from "./use-create-flow-overlay-state-CHeppRNE.js";
|
|
5
|
+
import { u as Ee } from "./use-visual-utils-BIHLaVwh.js";
|
|
6
|
+
import { k as oe } from "./date-formatter-vkCj9Ct-.js";
|
|
7
7
|
/**
|
|
8
8
|
* @license lucide-react v0.453.0 - ISC
|
|
9
9
|
*
|
|
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 ne = le("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" }],
|
|
@@ -22,157 +22,157 @@ const re = ne("FileDown", [
|
|
|
22
22
|
* This source code is licensed under the ISC license.
|
|
23
23
|
* See the LICENSE file in the root directory of this source tree.
|
|
24
24
|
*/
|
|
25
|
-
const gt =
|
|
25
|
+
const gt = le("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
|
-
]), bt = 1e4, xt = 15e3,
|
|
29
|
+
]), bt = 1e4, xt = 15e3, yt = 3e4, wt = 3e4, Ct = 12e4, ie = 2 * 60 * 60 * 1e3;
|
|
30
30
|
function Nt(e) {
|
|
31
31
|
const a = Date.now() - e.getTime();
|
|
32
|
-
return a <
|
|
32
|
+
return a < wt ? bt : a < Ct ? xt : yt;
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
const { authToken: e, tokenProps: a } =
|
|
34
|
+
function Vt() {
|
|
35
|
+
const { authToken: e, tokenProps: a } = K(), v = z((h) => h.activeExports), [l, n] = T(
|
|
36
36
|
typeof document < "u" ? !document.hidden : !0
|
|
37
|
-
),
|
|
38
|
-
const
|
|
39
|
-
return Array.from(
|
|
40
|
-
(
|
|
37
|
+
), c = X(null), d = X(!1), u = X(void 0), i = a == null ? void 0 : a.apiServiceUrl, r = e == null ? void 0 : e.accessToken, p = _(() => {
|
|
38
|
+
const h = z.getState().activeExports;
|
|
39
|
+
return Array.from(h.values()).filter(
|
|
40
|
+
(y) => W(y.status)
|
|
41
41
|
);
|
|
42
42
|
}, []);
|
|
43
|
-
|
|
43
|
+
B(() => {
|
|
44
44
|
if (typeof document > "u") return;
|
|
45
|
-
const
|
|
46
|
-
|
|
45
|
+
const h = () => {
|
|
46
|
+
n(!document.hidden);
|
|
47
47
|
};
|
|
48
|
-
return document.addEventListener("visibilitychange",
|
|
49
|
-
document.removeEventListener("visibilitychange",
|
|
48
|
+
return document.addEventListener("visibilitychange", h), () => {
|
|
49
|
+
document.removeEventListener("visibilitychange", h);
|
|
50
50
|
};
|
|
51
51
|
}, []);
|
|
52
|
-
const
|
|
53
|
-
if (!
|
|
54
|
-
|
|
52
|
+
const b = _(async () => {
|
|
53
|
+
if (!i || !r) {
|
|
54
|
+
d.current = !1;
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
|
-
const
|
|
58
|
-
if (
|
|
59
|
-
|
|
57
|
+
const h = p();
|
|
58
|
+
if (h.length === 0) {
|
|
59
|
+
d.current = !1;
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
|
-
const
|
|
63
|
-
(
|
|
62
|
+
const y = Date.now(), E = h.filter(
|
|
63
|
+
(o) => y - o.startedAt.getTime() > ie
|
|
64
64
|
);
|
|
65
|
-
if (
|
|
66
|
-
const { updateExport:
|
|
67
|
-
for (const
|
|
68
|
-
|
|
65
|
+
if (E.length > 0) {
|
|
66
|
+
const { updateExport: o } = z.getState().actions;
|
|
67
|
+
for (const x of E)
|
|
68
|
+
o(x.id, {
|
|
69
69
|
status: "failed",
|
|
70
70
|
error: "Export timed out. Please try again or contact support.",
|
|
71
71
|
lastUpdatedAt: /* @__PURE__ */ new Date()
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
|
-
const
|
|
75
|
-
(
|
|
74
|
+
const f = h.filter(
|
|
75
|
+
(o) => y - o.startedAt.getTime() <= ie
|
|
76
76
|
);
|
|
77
|
-
if (
|
|
78
|
-
|
|
77
|
+
if (f.length === 0) {
|
|
78
|
+
d.current = !1;
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
81
|
-
const
|
|
82
|
-
|
|
81
|
+
const w = await Promise.allSettled(
|
|
82
|
+
f.map(async (o) => {
|
|
83
83
|
try {
|
|
84
|
-
const
|
|
85
|
-
let
|
|
86
|
-
if (
|
|
84
|
+
const x = await de(i, r, o.id);
|
|
85
|
+
let D;
|
|
86
|
+
if (x.status === "completed")
|
|
87
87
|
try {
|
|
88
|
-
|
|
88
|
+
D = await q(i, r, o.id);
|
|
89
89
|
} catch (F) {
|
|
90
90
|
console.error(
|
|
91
|
-
`[useExportPolling] Failed to get download URL for ${
|
|
91
|
+
`[useExportPolling] Failed to get download URL for ${o.id}:`,
|
|
92
92
|
F
|
|
93
93
|
);
|
|
94
94
|
}
|
|
95
95
|
return {
|
|
96
|
-
id:
|
|
97
|
-
status:
|
|
98
|
-
progress:
|
|
99
|
-
completedChunks:
|
|
100
|
-
completedAt:
|
|
96
|
+
id: o.id,
|
|
97
|
+
status: x.status,
|
|
98
|
+
progress: x.progress,
|
|
99
|
+
completedChunks: x.completedChunks,
|
|
100
|
+
completedAt: x.completedAt ? new Date(x.completedAt) : void 0,
|
|
101
101
|
lastUpdatedAt: /* @__PURE__ */ new Date(),
|
|
102
|
-
fileSize:
|
|
103
|
-
error:
|
|
104
|
-
downloadUrl:
|
|
102
|
+
fileSize: x.fileSize,
|
|
103
|
+
error: x.error,
|
|
104
|
+
downloadUrl: D
|
|
105
105
|
};
|
|
106
|
-
} catch (
|
|
106
|
+
} catch (x) {
|
|
107
107
|
return console.error(
|
|
108
|
-
`[useExportPolling] Failed to poll export ${
|
|
109
|
-
|
|
108
|
+
`[useExportPolling] Failed to poll export ${o.id}:`,
|
|
109
|
+
x
|
|
110
110
|
), null;
|
|
111
111
|
}
|
|
112
112
|
})
|
|
113
|
-
), { updateExport:
|
|
114
|
-
for (const
|
|
115
|
-
|
|
116
|
-
const
|
|
117
|
-
if (
|
|
118
|
-
const
|
|
119
|
-
(
|
|
120
|
-
|
|
121
|
-
),
|
|
122
|
-
|
|
123
|
-
var
|
|
124
|
-
(
|
|
125
|
-
},
|
|
113
|
+
), { updateExport: S } = z.getState().actions;
|
|
114
|
+
for (const o of w)
|
|
115
|
+
o.status === "fulfilled" && o.value && S(o.value.id, o.value);
|
|
116
|
+
const C = p();
|
|
117
|
+
if (C.length > 0 && !document.hidden) {
|
|
118
|
+
const o = C.reduce(
|
|
119
|
+
(D, F) => F.startedAt < D ? F.startedAt : D,
|
|
120
|
+
C[0].startedAt
|
|
121
|
+
), x = Nt(o);
|
|
122
|
+
c.current && clearTimeout(c.current), c.current = setTimeout(() => {
|
|
123
|
+
var D;
|
|
124
|
+
(D = u.current) == null || D.call(u);
|
|
125
|
+
}, x);
|
|
126
126
|
} else
|
|
127
|
-
|
|
128
|
-
}, [
|
|
129
|
-
return
|
|
130
|
-
|
|
131
|
-
}, [
|
|
132
|
-
var
|
|
133
|
-
|
|
134
|
-
}, [
|
|
135
|
-
var
|
|
136
|
-
const
|
|
137
|
-
|
|
138
|
-
}, [
|
|
139
|
-
!
|
|
140
|
-
}, [
|
|
141
|
-
|
|
127
|
+
d.current = !1;
|
|
128
|
+
}, [i, r, p]);
|
|
129
|
+
return B(() => {
|
|
130
|
+
u.current = b;
|
|
131
|
+
}, [b]), B(() => {
|
|
132
|
+
var y;
|
|
133
|
+
p().length > 0 && l && !d.current && (d.current = !0, (y = u.current) == null || y.call(u));
|
|
134
|
+
}, [v, l, p]), B(() => {
|
|
135
|
+
var y;
|
|
136
|
+
const h = p();
|
|
137
|
+
l && h.length > 0 && !d.current && (d.current = !0, (y = u.current) == null || y.call(u));
|
|
138
|
+
}, [l, p]), B(() => {
|
|
139
|
+
!l && c.current && (clearTimeout(c.current), c.current = null, d.current = !1);
|
|
140
|
+
}, [l]), B(() => () => {
|
|
141
|
+
c.current && (clearTimeout(c.current), c.current = null);
|
|
142
142
|
}, []), {
|
|
143
|
-
isPolling:
|
|
144
|
-
isTabVisible:
|
|
145
|
-
inProgressCount:
|
|
143
|
+
isPolling: d.current,
|
|
144
|
+
isTabVisible: l,
|
|
145
|
+
inProgressCount: p().length
|
|
146
146
|
};
|
|
147
147
|
}
|
|
148
|
-
function
|
|
149
|
-
const { authToken: e, tokenProps: a } =
|
|
150
|
-
|
|
151
|
-
if (
|
|
148
|
+
function Ot() {
|
|
149
|
+
const { authToken: e, tokenProps: a } = K(), v = z((u) => u.activeExports), { addExport: l } = ce(), n = X(!1), c = a == null ? void 0 : a.apiServiceUrl, d = e == null ? void 0 : e.accessToken;
|
|
150
|
+
B(() => {
|
|
151
|
+
if (n.current || !c || !d) return;
|
|
152
152
|
(async () => {
|
|
153
153
|
try {
|
|
154
|
-
const { exports:
|
|
154
|
+
const { exports: i } = await Ie(c, d, {
|
|
155
155
|
status: ["pending", "processing", "chunking", "compacting", "completed", "failed"],
|
|
156
156
|
limit: 20
|
|
157
157
|
// Limit to recent exports
|
|
158
158
|
});
|
|
159
|
-
for (const r of
|
|
160
|
-
if (
|
|
161
|
-
const
|
|
162
|
-
let
|
|
159
|
+
for (const r of i) {
|
|
160
|
+
if (v.has(r.id)) continue;
|
|
161
|
+
const p = r.totalChunks ? Math.round(r.completedChunks / r.totalChunks * 100) : 0;
|
|
162
|
+
let b;
|
|
163
163
|
if (r.status === "completed")
|
|
164
164
|
try {
|
|
165
|
-
|
|
166
|
-
} catch (
|
|
165
|
+
b = await q(c, d, r.id);
|
|
166
|
+
} catch (y) {
|
|
167
167
|
console.error(
|
|
168
168
|
`[useExportRecovery] Failed to get download URL for ${r.id}:`,
|
|
169
|
-
|
|
169
|
+
y
|
|
170
170
|
);
|
|
171
171
|
}
|
|
172
|
-
const
|
|
172
|
+
const h = {
|
|
173
173
|
id: r.id,
|
|
174
174
|
status: r.status,
|
|
175
|
-
progress:
|
|
175
|
+
progress: p,
|
|
176
176
|
title: Dt(r),
|
|
177
177
|
totalRows: r.totalRows,
|
|
178
178
|
totalChunks: r.totalChunks,
|
|
@@ -183,46 +183,46 @@ function Bt() {
|
|
|
183
183
|
fileSize: r.fileSize,
|
|
184
184
|
error: r.error,
|
|
185
185
|
expiresAt: new Date(r.expiresAt),
|
|
186
|
-
downloadUrl:
|
|
186
|
+
downloadUrl: b
|
|
187
187
|
};
|
|
188
|
-
|
|
188
|
+
l(h);
|
|
189
189
|
}
|
|
190
|
-
|
|
191
|
-
} catch (
|
|
192
|
-
console.error("[useExportRecovery] Failed to recover exports:",
|
|
190
|
+
n.current = !0;
|
|
191
|
+
} catch (i) {
|
|
192
|
+
console.error("[useExportRecovery] Failed to recover exports:", i), n.current = !0;
|
|
193
193
|
}
|
|
194
194
|
})();
|
|
195
|
-
}, [
|
|
195
|
+
}, [c, d, l, v]);
|
|
196
196
|
}
|
|
197
197
|
function Dt(e) {
|
|
198
|
-
return e.title ? e.title :
|
|
198
|
+
return e.title ? e.title : W(
|
|
199
199
|
e.status
|
|
200
200
|
) ? "Export in progress..." : e.status === "completed" ? "Export completed" : e.status === "failed" ? "Export failed" : "Export";
|
|
201
201
|
}
|
|
202
202
|
function Et({
|
|
203
203
|
open: e,
|
|
204
204
|
onOpenChange: a,
|
|
205
|
-
isLibraryVisual:
|
|
206
|
-
currentVisualName:
|
|
207
|
-
isSaving:
|
|
208
|
-
destinationMode:
|
|
209
|
-
onConfirm:
|
|
205
|
+
isLibraryVisual: v,
|
|
206
|
+
currentVisualName: l,
|
|
207
|
+
isSaving: n = !1,
|
|
208
|
+
destinationMode: c = "both",
|
|
209
|
+
onConfirm: d
|
|
210
210
|
}) {
|
|
211
|
-
const [
|
|
212
|
-
|
|
213
|
-
), [r,
|
|
214
|
-
|
|
215
|
-
e && (
|
|
216
|
-
|
|
217
|
-
),
|
|
218
|
-
}, [e,
|
|
219
|
-
const
|
|
211
|
+
const [u, i] = T(
|
|
212
|
+
v && l ? `Copy of ${l}` : l || ""
|
|
213
|
+
), [r, p] = T("");
|
|
214
|
+
Se.useEffect(() => {
|
|
215
|
+
e && (i(
|
|
216
|
+
v && l ? `Copy of ${l}` : l || ""
|
|
217
|
+
), p(""));
|
|
218
|
+
}, [e, v, l]);
|
|
219
|
+
const b = !!u.trim(), h = c === "local" ? {
|
|
220
220
|
saveToLibrary: !1,
|
|
221
221
|
saveToCurrentDashboard: !0,
|
|
222
222
|
badgeType: "local",
|
|
223
223
|
description: "Creates a local copy on the current dashboard.",
|
|
224
224
|
actionLabel: "Add to Dashboard (Local)"
|
|
225
|
-
} :
|
|
225
|
+
} : c === "library" ? {
|
|
226
226
|
saveToLibrary: !0,
|
|
227
227
|
saveToCurrentDashboard: !1,
|
|
228
228
|
badgeType: "library",
|
|
@@ -234,152 +234,152 @@ function Et({
|
|
|
234
234
|
badgeType: "linked",
|
|
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
|
-
},
|
|
238
|
-
!
|
|
239
|
-
name:
|
|
237
|
+
}, y = () => {
|
|
238
|
+
!b || n || d({
|
|
239
|
+
name: u.trim(),
|
|
240
240
|
description: r.trim() || void 0,
|
|
241
|
-
saveToLibrary:
|
|
242
|
-
saveToCurrentDashboard:
|
|
241
|
+
saveToLibrary: h.saveToLibrary,
|
|
242
|
+
saveToCurrentDashboard: h.saveToCurrentDashboard
|
|
243
243
|
});
|
|
244
244
|
};
|
|
245
|
-
return /* @__PURE__ */ t(
|
|
246
|
-
/* @__PURE__ */ s(
|
|
247
|
-
/* @__PURE__ */ s(
|
|
245
|
+
return /* @__PURE__ */ t(ue, { open: e, onOpenChange: a, children: /* @__PURE__ */ s(me, { className: "sm:max-w-[500px]", children: [
|
|
246
|
+
/* @__PURE__ */ s(he, { children: [
|
|
247
|
+
/* @__PURE__ */ s(pe, { className: "flex items-center gap-2", children: [
|
|
248
248
|
/* @__PURE__ */ t("span", { children: "Save Visual As" }),
|
|
249
|
-
|
|
250
|
-
|
|
249
|
+
h.badgeType !== "local" && /* @__PURE__ */ t(
|
|
250
|
+
dt,
|
|
251
251
|
{
|
|
252
|
-
type:
|
|
252
|
+
type: h.badgeType,
|
|
253
253
|
showLabel: !0,
|
|
254
254
|
className: "px-2 py-0.5"
|
|
255
255
|
}
|
|
256
256
|
)
|
|
257
257
|
] }),
|
|
258
|
-
/* @__PURE__ */ t(
|
|
258
|
+
/* @__PURE__ */ t(fe, { children: h.description })
|
|
259
259
|
] }),
|
|
260
260
|
/* @__PURE__ */ s("div", { className: "grid gap-4 py-4", children: [
|
|
261
261
|
/* @__PURE__ */ s("div", { className: "grid gap-2", children: [
|
|
262
262
|
/* @__PURE__ */ t(Z, { htmlFor: "name", children: "Name" }),
|
|
263
263
|
/* @__PURE__ */ t(
|
|
264
|
-
|
|
264
|
+
Fe,
|
|
265
265
|
{
|
|
266
266
|
id: "name",
|
|
267
|
-
value:
|
|
268
|
-
onChange: (
|
|
267
|
+
value: u,
|
|
268
|
+
onChange: (E) => i(E.target.value),
|
|
269
269
|
placeholder: "Enter visual name",
|
|
270
|
-
disabled:
|
|
270
|
+
disabled: n
|
|
271
271
|
}
|
|
272
272
|
)
|
|
273
273
|
] }),
|
|
274
274
|
/* @__PURE__ */ s("div", { className: "grid gap-2", children: [
|
|
275
275
|
/* @__PURE__ */ t(Z, { htmlFor: "description", children: "Description (optional)" }),
|
|
276
276
|
/* @__PURE__ */ t(
|
|
277
|
-
|
|
277
|
+
Le,
|
|
278
278
|
{
|
|
279
279
|
id: "description",
|
|
280
280
|
value: r,
|
|
281
|
-
onChange: (
|
|
281
|
+
onChange: (E) => p(E.target.value),
|
|
282
282
|
placeholder: "Enter visual description",
|
|
283
283
|
rows: 3,
|
|
284
|
-
disabled:
|
|
284
|
+
disabled: n
|
|
285
285
|
}
|
|
286
286
|
)
|
|
287
287
|
] })
|
|
288
288
|
] }),
|
|
289
|
-
/* @__PURE__ */ s(
|
|
289
|
+
/* @__PURE__ */ s(Te, { children: [
|
|
290
290
|
/* @__PURE__ */ t(
|
|
291
291
|
A,
|
|
292
292
|
{
|
|
293
293
|
variant: "outline",
|
|
294
294
|
onClick: () => a(!1),
|
|
295
|
-
disabled:
|
|
295
|
+
disabled: n,
|
|
296
296
|
children: "Cancel"
|
|
297
297
|
}
|
|
298
298
|
),
|
|
299
|
-
/* @__PURE__ */ s(A, { onClick:
|
|
300
|
-
|
|
301
|
-
|
|
299
|
+
/* @__PURE__ */ s(A, { onClick: y, disabled: !b || n, children: [
|
|
300
|
+
n && /* @__PURE__ */ t(Q, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
301
|
+
h.actionLabel
|
|
302
302
|
] })
|
|
303
303
|
] })
|
|
304
304
|
] }) });
|
|
305
305
|
}
|
|
306
|
-
function
|
|
307
|
-
const [e, a] =
|
|
308
|
-
(
|
|
309
|
-
), { getUpdatedFrame:
|
|
310
|
-
var
|
|
311
|
-
return ((
|
|
312
|
-
})(), F =
|
|
313
|
-
|
|
306
|
+
function St() {
|
|
307
|
+
const [e, a] = T(!1), [v, l] = T(!1), [n, c] = T(null), [d, u] = T(null), i = j((m) => m.frame), r = j((m) => m.card), p = ke(), b = O((m) => m.selectedSheetId), h = O((m) => m.dashboard), y = O(
|
|
308
|
+
(m) => m.actions.setIsDashboardPanelOpen
|
|
309
|
+
), { getUpdatedFrame: E } = Ee(), { selectVisual: f } = Pe(), { addFrame: w, setSelectedFrameId: S, setIsVisualEditing: C } = J(), o = ve(), x = !!(i != null && i.visualId), D = (() => {
|
|
310
|
+
var m, g;
|
|
311
|
+
return ((m = i == null ? void 0 : i.cards) == null ? void 0 : m.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";
|
|
312
|
+
})(), F = Ue((m) => {
|
|
313
|
+
m != null && m.id && (f(m), v && n && d && b && (async () => {
|
|
314
314
|
try {
|
|
315
|
-
const
|
|
316
|
-
...
|
|
315
|
+
const g = {
|
|
316
|
+
...n,
|
|
317
317
|
id: ee(),
|
|
318
|
-
visualId:
|
|
318
|
+
visualId: m.id
|
|
319
319
|
// Link to the newly created library visual
|
|
320
320
|
};
|
|
321
|
-
|
|
321
|
+
w(b, g, {
|
|
322
322
|
position: "end",
|
|
323
|
-
semanticExecutionPayload:
|
|
324
|
-
}),
|
|
325
|
-
} catch (
|
|
323
|
+
semanticExecutionPayload: d
|
|
324
|
+
}), S(g.id), l(!1), c(null), u(null), C(!1);
|
|
325
|
+
} catch (g) {
|
|
326
326
|
console.error(
|
|
327
327
|
"Failed to promote semantic metadata for saved visual:",
|
|
328
|
-
|
|
329
|
-
),
|
|
330
|
-
|
|
328
|
+
g
|
|
329
|
+
), P.error(
|
|
330
|
+
g instanceof Error ? g.message : "Failed to prepare semantic metadata for the saved visual"
|
|
331
331
|
);
|
|
332
332
|
}
|
|
333
|
-
})(),
|
|
333
|
+
})(), y(!0), a(!1));
|
|
334
334
|
});
|
|
335
335
|
return {
|
|
336
336
|
saveAsDialogOpen: e,
|
|
337
337
|
setSaveAsDialogOpen: a,
|
|
338
|
-
handleSaveAs: async (
|
|
339
|
-
if (!
|
|
340
|
-
|
|
338
|
+
handleSaveAs: async (m) => {
|
|
339
|
+
if (!b) {
|
|
340
|
+
P.error("No sheet selected");
|
|
341
341
|
return;
|
|
342
342
|
}
|
|
343
|
-
const
|
|
344
|
-
if (
|
|
345
|
-
|
|
343
|
+
const g = E(), I = ge(g);
|
|
344
|
+
if (I) {
|
|
345
|
+
P.error(I);
|
|
346
346
|
return;
|
|
347
347
|
}
|
|
348
|
-
const k =
|
|
349
|
-
...
|
|
350
|
-
cards:
|
|
351
|
-
...
|
|
352
|
-
title:
|
|
348
|
+
const k = g.cards.length === 1 ? {
|
|
349
|
+
...g,
|
|
350
|
+
cards: g.cards.map((L) => ({
|
|
351
|
+
...L,
|
|
352
|
+
title: m.name
|
|
353
353
|
// Use visual name as card title
|
|
354
354
|
}))
|
|
355
|
-
} :
|
|
356
|
-
if (
|
|
357
|
-
let
|
|
358
|
-
if (
|
|
355
|
+
} : g;
|
|
356
|
+
if (m.saveToLibrary) {
|
|
357
|
+
let L = null;
|
|
358
|
+
if (m.saveToCurrentDashboard)
|
|
359
359
|
try {
|
|
360
|
-
|
|
361
|
-
previousFrame: G(
|
|
360
|
+
L = await o(k, {
|
|
361
|
+
previousFrame: G(h, k.id)
|
|
362
362
|
});
|
|
363
|
-
} catch (
|
|
363
|
+
} catch (V) {
|
|
364
364
|
console.error(
|
|
365
365
|
"Failed to prepare semantic metadata before saving visual:",
|
|
366
|
-
|
|
367
|
-
),
|
|
368
|
-
|
|
366
|
+
V
|
|
367
|
+
), P.error(
|
|
368
|
+
V instanceof Error ? V.message : "Failed to prepare semantic metadata for the saved visual"
|
|
369
369
|
);
|
|
370
370
|
return;
|
|
371
371
|
}
|
|
372
|
-
|
|
373
|
-
const
|
|
374
|
-
title:
|
|
375
|
-
description:
|
|
372
|
+
l(m.saveToCurrentDashboard), c(k), u(L);
|
|
373
|
+
const M = {
|
|
374
|
+
title: m.name,
|
|
375
|
+
description: m.description,
|
|
376
376
|
frameObject: k,
|
|
377
377
|
// Card title synced for single-card frames
|
|
378
378
|
isPrivate: !1
|
|
379
379
|
};
|
|
380
|
-
F.mutate(
|
|
381
|
-
} else if (
|
|
382
|
-
const
|
|
380
|
+
F.mutate(M);
|
|
381
|
+
} else if (m.saveToCurrentDashboard) {
|
|
382
|
+
const L = {
|
|
383
383
|
...k,
|
|
384
384
|
// Card title already synced
|
|
385
385
|
id: ee(),
|
|
@@ -387,146 +387,152 @@ function At() {
|
|
|
387
387
|
// Explicitly no visualId for local visuals
|
|
388
388
|
};
|
|
389
389
|
try {
|
|
390
|
-
const
|
|
391
|
-
previousFrame: G(
|
|
390
|
+
const M = await o(k, {
|
|
391
|
+
previousFrame: G(h, k.id)
|
|
392
392
|
});
|
|
393
|
-
|
|
393
|
+
w(b, L, {
|
|
394
394
|
position: "end",
|
|
395
|
-
semanticExecutionPayload:
|
|
396
|
-
}),
|
|
397
|
-
} catch (
|
|
398
|
-
console.error("Failed to save visual to dashboard:",
|
|
399
|
-
|
|
395
|
+
semanticExecutionPayload: M
|
|
396
|
+
}), S(L.id), P.success("Visual saved to dashboard"), a(!1), C(!1);
|
|
397
|
+
} catch (M) {
|
|
398
|
+
console.error("Failed to save visual to dashboard:", M), P.error(
|
|
399
|
+
M instanceof Error ? M.message : "Failed to prepare semantic metadata for the visual"
|
|
400
400
|
);
|
|
401
401
|
}
|
|
402
402
|
}
|
|
403
403
|
},
|
|
404
|
-
isLibraryVisual:
|
|
405
|
-
currentVisualName:
|
|
404
|
+
isLibraryVisual: x,
|
|
405
|
+
currentVisualName: D,
|
|
406
406
|
isSaving: F.isPending
|
|
407
407
|
};
|
|
408
408
|
}
|
|
409
|
-
function
|
|
410
|
-
const a = j((
|
|
409
|
+
function Bt(e = {}) {
|
|
410
|
+
const a = j((N) => N.frame), v = j((N) => N.editorContext), l = Me((N) => N.selectedVisual), n = O((N) => N.selectedFrameId), c = O((N) => N.selectedSheetId), d = O((N) => N.dashboard), { setIsVisualEditing: u, updateFrame: i } = J(), [r, p] = T(!1), [b, h] = T("both"), y = ve(), 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, {
|
|
411
411
|
saveAsDialogOpen: C,
|
|
412
|
-
setSaveAsDialogOpen:
|
|
413
|
-
handleSaveAs:
|
|
414
|
-
isLibraryVisual:
|
|
415
|
-
currentVisualName:
|
|
416
|
-
isSaving:
|
|
417
|
-
} =
|
|
418
|
-
|
|
419
|
-
|
|
412
|
+
setSaveAsDialogOpen: o,
|
|
413
|
+
handleSaveAs: x,
|
|
414
|
+
isLibraryVisual: D,
|
|
415
|
+
currentVisualName: F,
|
|
416
|
+
isSaving: U
|
|
417
|
+
} = St(), { getUpdatedFrame: m } = Ee();
|
|
418
|
+
if (E)
|
|
419
|
+
return /* @__PURE__ */ s(H, { children: [
|
|
420
|
+
/* @__PURE__ */ t(se, { className: "rounded-[5px]", variant: "default" }),
|
|
421
|
+
/* @__PURE__ */ t(re, {})
|
|
422
|
+
] });
|
|
423
|
+
const g = async () => {
|
|
424
|
+
if (!c) {
|
|
425
|
+
P.error("No sheet selected");
|
|
420
426
|
return;
|
|
421
427
|
}
|
|
422
|
-
if (
|
|
423
|
-
|
|
424
|
-
const
|
|
425
|
-
if (
|
|
426
|
-
|
|
428
|
+
if (r) return;
|
|
429
|
+
p(!0);
|
|
430
|
+
const N = m(), k = ge(N);
|
|
431
|
+
if (k) {
|
|
432
|
+
p(!1), P.error(k);
|
|
427
433
|
return;
|
|
428
434
|
}
|
|
429
|
-
const
|
|
430
|
-
...
|
|
435
|
+
const L = {
|
|
436
|
+
...N,
|
|
431
437
|
visualId: void 0
|
|
432
|
-
},
|
|
438
|
+
}, M = G(d, L.id);
|
|
433
439
|
try {
|
|
434
|
-
const
|
|
435
|
-
previousFrame:
|
|
440
|
+
const V = await y(L, {
|
|
441
|
+
previousFrame: M
|
|
436
442
|
});
|
|
437
|
-
|
|
438
|
-
semanticExecutionPayload:
|
|
443
|
+
i(c, L, {
|
|
444
|
+
semanticExecutionPayload: V
|
|
439
445
|
});
|
|
440
|
-
} catch (
|
|
441
|
-
console.error("Failed to apply local semantic metadata:",
|
|
442
|
-
|
|
446
|
+
} catch (V) {
|
|
447
|
+
console.error("Failed to apply local semantic metadata:", V), p(!1), P.error(
|
|
448
|
+
V instanceof Error ? V.message : "Failed to prepare semantic metadata for this visual"
|
|
443
449
|
);
|
|
444
450
|
return;
|
|
445
451
|
}
|
|
446
452
|
setTimeout(() => {
|
|
447
|
-
|
|
453
|
+
p(!1), P.success("Changes applied. Visual is now local to this dashboard"), u(!1);
|
|
448
454
|
}, 300);
|
|
449
|
-
},
|
|
450
|
-
|
|
455
|
+
}, I = (N) => {
|
|
456
|
+
h(N), o(!0);
|
|
451
457
|
};
|
|
452
|
-
return /* @__PURE__ */ s(
|
|
458
|
+
return /* @__PURE__ */ s(H, { children: [
|
|
453
459
|
/* @__PURE__ */ s("div", { className: "inline-flex items-center overflow-hidden rounded-[5px]", children: [
|
|
454
|
-
!
|
|
455
|
-
|
|
460
|
+
!f && /* @__PURE__ */ t(
|
|
461
|
+
se,
|
|
456
462
|
{
|
|
457
463
|
className: "rounded-none",
|
|
458
464
|
variant: "default"
|
|
459
465
|
}
|
|
460
466
|
),
|
|
461
|
-
|
|
462
|
-
|
|
467
|
+
f && S && /* @__PURE__ */ t(
|
|
468
|
+
ct,
|
|
463
469
|
{
|
|
464
470
|
className: "rounded-none",
|
|
465
471
|
variant: "default"
|
|
466
472
|
}
|
|
467
473
|
),
|
|
468
|
-
|
|
469
|
-
/* @__PURE__ */ s(
|
|
470
|
-
/* @__PURE__ */ t(
|
|
474
|
+
f && w && /* @__PURE__ */ t(ut, { className: "rounded-none" }),
|
|
475
|
+
/* @__PURE__ */ s(be, { modal: !1, children: [
|
|
476
|
+
/* @__PURE__ */ t(xe, { asChild: !0, children: /* @__PURE__ */ t(
|
|
471
477
|
A,
|
|
472
478
|
{
|
|
473
479
|
variant: "default",
|
|
474
480
|
size: "xs",
|
|
475
481
|
className: "w-7 rounded-none border-l border-primary-foreground/20 px-0",
|
|
476
482
|
"aria-label": "Open visual save options",
|
|
477
|
-
disabled:
|
|
478
|
-
children: /* @__PURE__ */ t(
|
|
483
|
+
disabled: U || r,
|
|
484
|
+
children: /* @__PURE__ */ t(ye, { className: "h-3.5 w-3.5" })
|
|
479
485
|
}
|
|
480
486
|
) }),
|
|
481
487
|
/* @__PURE__ */ s(
|
|
482
|
-
|
|
488
|
+
we,
|
|
483
489
|
{
|
|
484
490
|
align: "end",
|
|
485
491
|
className: "min-w-[220px] rounded-[6px] border border-border/60 p-1 shadow-sm",
|
|
486
492
|
children: [
|
|
487
|
-
|
|
493
|
+
w && /* @__PURE__ */ s(H, { children: [
|
|
488
494
|
/* @__PURE__ */ s(
|
|
489
|
-
|
|
495
|
+
R,
|
|
490
496
|
{
|
|
491
|
-
onClick:
|
|
492
|
-
disabled:
|
|
497
|
+
onClick: g,
|
|
498
|
+
disabled: r,
|
|
493
499
|
children: [
|
|
494
|
-
/* @__PURE__ */ t(
|
|
495
|
-
|
|
500
|
+
/* @__PURE__ */ t(Ve, { className: "h-3.5 w-3.5" }),
|
|
501
|
+
r ? "Applying..." : "Apply Locally"
|
|
496
502
|
]
|
|
497
503
|
}
|
|
498
504
|
),
|
|
499
|
-
/* @__PURE__ */ t(
|
|
505
|
+
/* @__PURE__ */ t(Oe, {})
|
|
500
506
|
] }),
|
|
501
507
|
/* @__PURE__ */ s(
|
|
502
|
-
|
|
508
|
+
R,
|
|
503
509
|
{
|
|
504
|
-
onClick: () =>
|
|
505
|
-
disabled:
|
|
510
|
+
onClick: () => I("local"),
|
|
511
|
+
disabled: U,
|
|
506
512
|
children: [
|
|
507
|
-
/* @__PURE__ */ t(
|
|
513
|
+
/* @__PURE__ */ t(Be, { className: "h-3.5 w-3.5" }),
|
|
508
514
|
"Add to Dashboard (Local)"
|
|
509
515
|
]
|
|
510
516
|
}
|
|
511
517
|
),
|
|
512
518
|
/* @__PURE__ */ s(
|
|
513
|
-
|
|
519
|
+
R,
|
|
514
520
|
{
|
|
515
|
-
onClick: () =>
|
|
516
|
-
disabled:
|
|
521
|
+
onClick: () => I("library"),
|
|
522
|
+
disabled: U,
|
|
517
523
|
children: [
|
|
518
|
-
/* @__PURE__ */ t(
|
|
524
|
+
/* @__PURE__ */ t(mt, { className: "h-3.5 w-3.5" }),
|
|
519
525
|
"Save as Library Visual"
|
|
520
526
|
]
|
|
521
527
|
}
|
|
522
528
|
),
|
|
523
529
|
/* @__PURE__ */ s(
|
|
524
|
-
|
|
530
|
+
R,
|
|
525
531
|
{
|
|
526
|
-
onClick: () =>
|
|
527
|
-
disabled:
|
|
532
|
+
onClick: () => I("both"),
|
|
533
|
+
disabled: U,
|
|
528
534
|
children: [
|
|
529
|
-
/* @__PURE__ */ t(
|
|
535
|
+
/* @__PURE__ */ t(ht, { className: "h-3.5 w-3.5" }),
|
|
530
536
|
"Save Copy as Linked Visual"
|
|
531
537
|
]
|
|
532
538
|
}
|
|
@@ -536,34 +542,34 @@ function Ot(e = {}) {
|
|
|
536
542
|
)
|
|
537
543
|
] })
|
|
538
544
|
] }),
|
|
539
|
-
/* @__PURE__ */ t(
|
|
545
|
+
/* @__PURE__ */ t(re, {}),
|
|
540
546
|
/* @__PURE__ */ t(
|
|
541
547
|
Et,
|
|
542
548
|
{
|
|
543
549
|
open: C,
|
|
544
|
-
onOpenChange: (
|
|
545
|
-
|
|
550
|
+
onOpenChange: (N) => {
|
|
551
|
+
U || o(N);
|
|
546
552
|
},
|
|
547
|
-
isLibraryVisual:
|
|
548
|
-
currentVisualName:
|
|
549
|
-
isSaving:
|
|
550
|
-
destinationMode:
|
|
551
|
-
onConfirm:
|
|
553
|
+
isLibraryVisual: D,
|
|
554
|
+
currentVisualName: F,
|
|
555
|
+
isSaving: U,
|
|
556
|
+
destinationMode: b,
|
|
557
|
+
onConfirm: x
|
|
552
558
|
}
|
|
553
559
|
)
|
|
554
560
|
] });
|
|
555
561
|
}
|
|
556
562
|
function zt({ className: e }) {
|
|
557
|
-
const a = j((
|
|
558
|
-
if (!
|
|
563
|
+
const a = j((i) => i.isDevMode), v = O((i) => i.isVisualEditing), { setIsDevMode: l } = ze(), { config: n } = Ae(Re).tokenProps, c = (n == null ? void 0 : n.showAdvancedMode) !== !1;
|
|
564
|
+
if (!v || !c)
|
|
559
565
|
return null;
|
|
560
|
-
const
|
|
566
|
+
const d = "h-full rounded-none border-0 bg-transparent px-2.5 shadow-none text-muted-foreground hover:bg-accent/50 hover:text-foreground", u = "bg-muted text-foreground hover:bg-muted";
|
|
561
567
|
return /* @__PURE__ */ s(
|
|
562
568
|
"div",
|
|
563
569
|
{
|
|
564
570
|
role: "radiogroup",
|
|
565
571
|
"aria-label": "Editor mode",
|
|
566
|
-
className:
|
|
572
|
+
className: $(
|
|
567
573
|
"inline-flex h-7 items-stretch overflow-hidden rounded-[5px] border border-input bg-background",
|
|
568
574
|
e
|
|
569
575
|
),
|
|
@@ -576,8 +582,8 @@ function zt({ className: e }) {
|
|
|
576
582
|
size: "xs",
|
|
577
583
|
role: "radio",
|
|
578
584
|
"aria-checked": !a,
|
|
579
|
-
className:
|
|
580
|
-
onClick: () =>
|
|
585
|
+
className: $(d, !a && u),
|
|
586
|
+
onClick: () => l(!1),
|
|
581
587
|
children: [
|
|
582
588
|
/* @__PURE__ */ t(Y, { className: "h-3.5 w-3.5" }),
|
|
583
589
|
"Drag & drop"
|
|
@@ -592,14 +598,14 @@ function zt({ className: e }) {
|
|
|
592
598
|
size: "xs",
|
|
593
599
|
role: "radio",
|
|
594
600
|
"aria-checked": a,
|
|
595
|
-
className:
|
|
596
|
-
|
|
601
|
+
className: $(
|
|
602
|
+
d,
|
|
597
603
|
"border-l border-border/60",
|
|
598
|
-
a &&
|
|
604
|
+
a && u
|
|
599
605
|
),
|
|
600
|
-
onClick: () =>
|
|
606
|
+
onClick: () => l(!0),
|
|
601
607
|
children: [
|
|
602
|
-
/* @__PURE__ */ t(
|
|
608
|
+
/* @__PURE__ */ t($e, { className: "h-3.5 w-3.5" }),
|
|
603
609
|
"SQL"
|
|
604
610
|
]
|
|
605
611
|
}
|
|
@@ -611,61 +617,61 @@ function zt({ className: e }) {
|
|
|
611
617
|
function Rt({
|
|
612
618
|
open: e,
|
|
613
619
|
onOpenChange: a,
|
|
614
|
-
onSave:
|
|
615
|
-
onDiscard:
|
|
616
|
-
isSaving:
|
|
617
|
-
title:
|
|
618
|
-
description:
|
|
619
|
-
cancelLabel:
|
|
620
|
-
discardLabel:
|
|
620
|
+
onSave: v,
|
|
621
|
+
onDiscard: l,
|
|
622
|
+
isSaving: n,
|
|
623
|
+
title: c = "Unsaved changes",
|
|
624
|
+
description: d = "You have unsaved changes to this dashboard. What would you like to do?",
|
|
625
|
+
cancelLabel: u = "Cancel",
|
|
626
|
+
discardLabel: i = "Discard",
|
|
621
627
|
saveLabel: r = "Save"
|
|
622
628
|
}) {
|
|
623
|
-
return /* @__PURE__ */ t(
|
|
624
|
-
!
|
|
625
|
-
}, children: /* @__PURE__ */ s(
|
|
626
|
-
/* @__PURE__ */ s(
|
|
627
|
-
/* @__PURE__ */ t(
|
|
628
|
-
/* @__PURE__ */ t(
|
|
629
|
+
return /* @__PURE__ */ t(_e, { open: e, onOpenChange: (b) => {
|
|
630
|
+
!b && n || a(b);
|
|
631
|
+
}, children: /* @__PURE__ */ s(He, { children: [
|
|
632
|
+
/* @__PURE__ */ s(je, { children: [
|
|
633
|
+
/* @__PURE__ */ t(Xe, { children: c }),
|
|
634
|
+
/* @__PURE__ */ t(Ge, { children: d })
|
|
629
635
|
] }),
|
|
630
|
-
/* @__PURE__ */ s(
|
|
636
|
+
/* @__PURE__ */ s(Ke, { children: [
|
|
631
637
|
/* @__PURE__ */ t(
|
|
632
638
|
A,
|
|
633
639
|
{
|
|
634
640
|
type: "button",
|
|
635
641
|
size: "xs",
|
|
636
|
-
onClick:
|
|
637
|
-
disabled:
|
|
642
|
+
onClick: l,
|
|
643
|
+
disabled: n,
|
|
638
644
|
variant: "ghost",
|
|
639
645
|
className: "mr-auto text-muted-foreground hover:bg-destructive/10 hover:text-destructive focus-visible:bg-destructive/10 focus-visible:text-destructive",
|
|
640
|
-
children:
|
|
646
|
+
children: i
|
|
641
647
|
}
|
|
642
648
|
),
|
|
643
|
-
/* @__PURE__ */ t(
|
|
644
|
-
/* @__PURE__ */ t(A, { type: "button", size: "xs", onClick:
|
|
645
|
-
/* @__PURE__ */ t(
|
|
649
|
+
/* @__PURE__ */ t(We, { disabled: n, children: u }),
|
|
650
|
+
/* @__PURE__ */ t(A, { type: "button", size: "xs", onClick: v, disabled: n, children: n ? /* @__PURE__ */ s(H, { children: [
|
|
651
|
+
/* @__PURE__ */ t(Q, { className: "mr-2 h-3.5 w-3.5 animate-spin" }),
|
|
646
652
|
"Saving..."
|
|
647
653
|
] }) : r })
|
|
648
654
|
] })
|
|
649
655
|
] }) });
|
|
650
656
|
}
|
|
651
|
-
function
|
|
657
|
+
function At({
|
|
652
658
|
export: e,
|
|
653
659
|
onRemove: a
|
|
654
660
|
}) {
|
|
655
|
-
const
|
|
661
|
+
const v = () => {
|
|
656
662
|
e.downloadUrl && window.open(e.downloadUrl, "_blank");
|
|
657
|
-
},
|
|
658
|
-
|
|
659
|
-
},
|
|
663
|
+
}, l = (u) => {
|
|
664
|
+
u.stopPropagation(), a == null || a(e.id);
|
|
665
|
+
}, n = () => {
|
|
660
666
|
switch (e.status) {
|
|
661
667
|
case "completed":
|
|
662
|
-
return /* @__PURE__ */ t(
|
|
668
|
+
return /* @__PURE__ */ t(Ze, { className: "mt-0.5 h-5 w-5 shrink-0 text-green-600" });
|
|
663
669
|
case "failed":
|
|
664
670
|
return /* @__PURE__ */ t(pt, { className: "mt-0.5 h-5 w-5 shrink-0 text-destructive" });
|
|
665
671
|
default:
|
|
666
|
-
return /* @__PURE__ */ t(
|
|
672
|
+
return /* @__PURE__ */ t(Q, { className: "text-foreground-muted mt-0.5 h-5 w-5 shrink-0 animate-spin" });
|
|
667
673
|
}
|
|
668
|
-
},
|
|
674
|
+
}, c = W(e.status), d = (() => {
|
|
669
675
|
switch (e.status) {
|
|
670
676
|
case "pending":
|
|
671
677
|
return "Queued...";
|
|
@@ -682,7 +688,7 @@ function St({
|
|
|
682
688
|
return /* @__PURE__ */ s("div", { className: "group p-4 transition-colors hover:bg-muted/50", children: [
|
|
683
689
|
/* @__PURE__ */ s("div", { className: "mb-2 flex items-start justify-between gap-3", children: [
|
|
684
690
|
/* @__PURE__ */ s("div", { className: "flex min-w-0 flex-1 items-start gap-3", children: [
|
|
685
|
-
|
|
691
|
+
n(),
|
|
686
692
|
/* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: [
|
|
687
693
|
/* @__PURE__ */ t("h4", { className: "mb-1 truncate text-sm font-medium", children: e.title }),
|
|
688
694
|
e.status === "completed" && /* @__PURE__ */ s("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
@@ -690,12 +696,12 @@ function St({
|
|
|
690
696
|
e.totalRows.toLocaleString(),
|
|
691
697
|
" rows"
|
|
692
698
|
] }),
|
|
693
|
-
e.fileSize && /* @__PURE__ */ s(
|
|
699
|
+
e.fileSize && /* @__PURE__ */ s(H, { children: [
|
|
694
700
|
/* @__PURE__ */ t("span", { children: "•" }),
|
|
695
|
-
/* @__PURE__ */ t("span", { children:
|
|
701
|
+
/* @__PURE__ */ t("span", { children: qe(e.fileSize) })
|
|
696
702
|
] })
|
|
697
703
|
] }),
|
|
698
|
-
|
|
704
|
+
c && /* @__PURE__ */ t("div", { className: "text-xs text-muted-foreground", children: d }),
|
|
699
705
|
e.status === "failed" && /* @__PURE__ */ t("div", { className: "line-clamp-2 text-xs text-destructive", children: e.error || "Export failed" })
|
|
700
706
|
] })
|
|
701
707
|
] }),
|
|
@@ -705,136 +711,136 @@ function St({
|
|
|
705
711
|
variant: "ghost",
|
|
706
712
|
size: "icon",
|
|
707
713
|
className: "h-6 w-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100",
|
|
708
|
-
onClick:
|
|
714
|
+
onClick: l,
|
|
709
715
|
"aria-label": "Remove notification",
|
|
710
|
-
children: /* @__PURE__ */ t(
|
|
716
|
+
children: /* @__PURE__ */ t(Qe, { className: "h-4 w-4" })
|
|
711
717
|
}
|
|
712
718
|
)
|
|
713
719
|
] }),
|
|
714
720
|
/* @__PURE__ */ s("div", { className: "ml-8", children: [
|
|
715
721
|
e.status === "completed" && /* @__PURE__ */ s("div", { className: "flex items-center justify-between", children: [
|
|
716
|
-
/* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children:
|
|
722
|
+
/* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children: oe(e.startedAt, { addSuffix: !0 }) }),
|
|
717
723
|
e.downloadUrl && /* @__PURE__ */ s(
|
|
718
724
|
A,
|
|
719
725
|
{
|
|
720
726
|
size: "sm",
|
|
721
727
|
variant: "outline",
|
|
722
728
|
className: "h-8 bg-transparent",
|
|
723
|
-
onClick:
|
|
729
|
+
onClick: v,
|
|
724
730
|
children: [
|
|
725
|
-
/* @__PURE__ */ t(
|
|
731
|
+
/* @__PURE__ */ t(Je, { className: "mr-1.5 h-3.5 w-3.5" }),
|
|
726
732
|
"Download"
|
|
727
733
|
]
|
|
728
734
|
}
|
|
729
735
|
)
|
|
730
736
|
] }),
|
|
731
|
-
|
|
732
|
-
/* @__PURE__ */ t(
|
|
737
|
+
c && /* @__PURE__ */ s("div", { children: [
|
|
738
|
+
/* @__PURE__ */ t(Ye, { value: e.progress, className: "h-1.5" }),
|
|
733
739
|
/* @__PURE__ */ s("span", { className: "mt-1 block text-xs text-muted-foreground", children: [
|
|
734
740
|
e.progress,
|
|
735
741
|
"% complete"
|
|
736
742
|
] })
|
|
737
743
|
] }),
|
|
738
|
-
e.status === "failed" && /* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children:
|
|
744
|
+
e.status === "failed" && /* @__PURE__ */ t("span", { className: "text-xs text-muted-foreground", children: oe(e.startedAt, { addSuffix: !0 }) })
|
|
739
745
|
] })
|
|
740
746
|
] });
|
|
741
747
|
}
|
|
742
748
|
function It() {
|
|
743
|
-
const { authToken: e, tokenProps: a } =
|
|
744
|
-
(
|
|
745
|
-
),
|
|
746
|
-
(
|
|
747
|
-
),
|
|
748
|
-
const
|
|
749
|
-
if (!(!
|
|
750
|
-
|
|
749
|
+
const { authToken: e, tokenProps: a } = K(), v = z((f) => f.activeExports), { clearCompleted: l, removeExport: n, updateExport: c } = ce(), [d, u] = T(!1), [i, r] = T(!1), p = Array.from(v.values()).sort(
|
|
750
|
+
(f, w) => w.startedAt.getTime() - f.startedAt.getTime()
|
|
751
|
+
), b = p.some(
|
|
752
|
+
(f) => f.status === "completed" || f.status === "failed"
|
|
753
|
+
), h = _(async () => {
|
|
754
|
+
const f = a == null ? void 0 : a.apiServiceUrl, w = e == null ? void 0 : e.accessToken;
|
|
755
|
+
if (!(!f || !w)) {
|
|
756
|
+
u(!0);
|
|
751
757
|
try {
|
|
752
|
-
const
|
|
758
|
+
const S = Array.from(v.values());
|
|
753
759
|
await Promise.all(
|
|
754
|
-
|
|
760
|
+
S.map(async (C) => {
|
|
755
761
|
try {
|
|
756
|
-
const
|
|
757
|
-
let
|
|
758
|
-
if (
|
|
762
|
+
const o = await de(f, w, C.id);
|
|
763
|
+
let x;
|
|
764
|
+
if (o.status === "completed")
|
|
759
765
|
try {
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
766
|
+
x = await q(
|
|
767
|
+
f,
|
|
768
|
+
w,
|
|
769
|
+
C.id
|
|
764
770
|
);
|
|
765
|
-
} catch (
|
|
766
|
-
console.error(`Failed to get download URL for ${
|
|
771
|
+
} catch (D) {
|
|
772
|
+
console.error(`Failed to get download URL for ${C.id}:`, D);
|
|
767
773
|
}
|
|
768
|
-
|
|
769
|
-
status:
|
|
770
|
-
progress:
|
|
771
|
-
completedChunks:
|
|
772
|
-
completedAt:
|
|
774
|
+
c(C.id, {
|
|
775
|
+
status: o.status,
|
|
776
|
+
progress: o.progress,
|
|
777
|
+
completedChunks: o.completedChunks,
|
|
778
|
+
completedAt: o.completedAt ? new Date(o.completedAt) : void 0,
|
|
773
779
|
lastUpdatedAt: /* @__PURE__ */ new Date(),
|
|
774
|
-
fileSize:
|
|
775
|
-
error:
|
|
776
|
-
downloadUrl:
|
|
780
|
+
fileSize: o.fileSize,
|
|
781
|
+
error: o.error,
|
|
782
|
+
downloadUrl: x
|
|
777
783
|
});
|
|
778
|
-
} catch (
|
|
779
|
-
console.error(`Failed to refresh export ${
|
|
784
|
+
} catch (o) {
|
|
785
|
+
console.error(`Failed to refresh export ${C.id}:`, o);
|
|
780
786
|
}
|
|
781
787
|
})
|
|
782
788
|
);
|
|
783
789
|
} finally {
|
|
784
|
-
|
|
790
|
+
u(!1);
|
|
785
791
|
}
|
|
786
792
|
}
|
|
787
793
|
}, [
|
|
788
|
-
|
|
794
|
+
v,
|
|
789
795
|
e == null ? void 0 : e.accessToken,
|
|
790
796
|
a == null ? void 0 : a.apiServiceUrl,
|
|
791
|
-
|
|
792
|
-
]),
|
|
793
|
-
const
|
|
794
|
-
if (!
|
|
795
|
-
|
|
797
|
+
c
|
|
798
|
+
]), y = _(async () => {
|
|
799
|
+
const f = a == null ? void 0 : a.apiServiceUrl, w = e == null ? void 0 : e.accessToken;
|
|
800
|
+
if (!f || !w) {
|
|
801
|
+
l();
|
|
796
802
|
return;
|
|
797
803
|
}
|
|
798
804
|
r(!0);
|
|
799
805
|
try {
|
|
800
|
-
const
|
|
801
|
-
(
|
|
802
|
-
),
|
|
803
|
-
|
|
806
|
+
const S = p.filter(
|
|
807
|
+
(o) => o.status === "completed" || o.status === "failed"
|
|
808
|
+
), C = await Promise.allSettled(
|
|
809
|
+
S.map(async (o) => (await te(f, w, o.id), o.id))
|
|
804
810
|
);
|
|
805
|
-
for (const
|
|
806
|
-
|
|
811
|
+
for (const o of C)
|
|
812
|
+
o.status === "fulfilled" ? n(o.value) : console.error("Failed to delete export:", o.reason);
|
|
807
813
|
} finally {
|
|
808
814
|
r(!1);
|
|
809
815
|
}
|
|
810
816
|
}, [
|
|
811
|
-
|
|
817
|
+
p,
|
|
812
818
|
a == null ? void 0 : a.apiServiceUrl,
|
|
813
819
|
e == null ? void 0 : e.accessToken,
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
]),
|
|
817
|
-
async (
|
|
818
|
-
const
|
|
819
|
-
if (
|
|
820
|
+
l,
|
|
821
|
+
n
|
|
822
|
+
]), E = _(
|
|
823
|
+
async (f) => {
|
|
824
|
+
const w = a == null ? void 0 : a.apiServiceUrl, S = e == null ? void 0 : e.accessToken;
|
|
825
|
+
if (w && S)
|
|
820
826
|
try {
|
|
821
|
-
await te(
|
|
827
|
+
await te(w, S, f), n(f);
|
|
822
828
|
return;
|
|
823
|
-
} catch (
|
|
824
|
-
console.error(`Failed to cancel export ${
|
|
829
|
+
} catch (C) {
|
|
830
|
+
console.error(`Failed to cancel export ${f}:`, C);
|
|
825
831
|
}
|
|
826
|
-
|
|
832
|
+
n(f);
|
|
827
833
|
},
|
|
828
|
-
[a == null ? void 0 : a.apiServiceUrl, e == null ? void 0 : e.accessToken,
|
|
834
|
+
[a == null ? void 0 : a.apiServiceUrl, e == null ? void 0 : e.accessToken, n]
|
|
829
835
|
);
|
|
830
|
-
return
|
|
831
|
-
/* @__PURE__ */ t(
|
|
836
|
+
return p.length === 0 ? /* @__PURE__ */ s("div", { className: "p-6 text-center", children: [
|
|
837
|
+
/* @__PURE__ */ t(ne, { className: "mx-auto mb-2 h-8 w-8 text-muted-foreground" }),
|
|
832
838
|
/* @__PURE__ */ t("p", { className: "text-sm text-muted-foreground", children: "No active exports" }),
|
|
833
839
|
/* @__PURE__ */ t("p", { className: "mt-1 text-xs text-muted-foreground", children: "Large exports will appear here" })
|
|
834
840
|
] }) : /* @__PURE__ */ s("div", { className: "flex flex-col", children: [
|
|
835
841
|
/* @__PURE__ */ s("div", { className: "flex items-center justify-between border-b px-4 py-3", children: [
|
|
836
842
|
/* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
|
|
837
|
-
/* @__PURE__ */ t(
|
|
843
|
+
/* @__PURE__ */ t(ne, { className: "h-5 w-5 text-muted-foreground" }),
|
|
838
844
|
/* @__PURE__ */ t("h4", { className: "font-semibold", children: "Exports" })
|
|
839
845
|
] }),
|
|
840
846
|
/* @__PURE__ */ s("div", { className: "flex items-center gap-1", children: [
|
|
@@ -844,48 +850,48 @@ function It() {
|
|
|
844
850
|
variant: "ghost",
|
|
845
851
|
size: "sm",
|
|
846
852
|
className: "h-7 w-7 p-0",
|
|
847
|
-
onClick:
|
|
848
|
-
disabled:
|
|
853
|
+
onClick: h,
|
|
854
|
+
disabled: d,
|
|
849
855
|
title: "Refresh status",
|
|
850
856
|
children: /* @__PURE__ */ t(
|
|
851
|
-
|
|
857
|
+
et,
|
|
852
858
|
{
|
|
853
|
-
className: `h-4 w-4 ${
|
|
859
|
+
className: `h-4 w-4 ${d ? "animate-spin" : ""}`
|
|
854
860
|
}
|
|
855
861
|
)
|
|
856
862
|
}
|
|
857
863
|
),
|
|
858
|
-
|
|
864
|
+
b && /* @__PURE__ */ t(
|
|
859
865
|
A,
|
|
860
866
|
{
|
|
861
867
|
variant: "ghost",
|
|
862
868
|
size: "sm",
|
|
863
869
|
className: "h-7 px-2 text-sm",
|
|
864
|
-
onClick:
|
|
865
|
-
disabled:
|
|
866
|
-
children:
|
|
870
|
+
onClick: y,
|
|
871
|
+
disabled: i,
|
|
872
|
+
children: i ? "Clearing..." : "Clear all"
|
|
867
873
|
}
|
|
868
874
|
)
|
|
869
875
|
] })
|
|
870
876
|
] }),
|
|
871
|
-
/* @__PURE__ */ t("div", { className: "max-h-[350px] overflow-y-auto", children: /* @__PURE__ */ t("div", { className: "divide-y", children:
|
|
872
|
-
|
|
877
|
+
/* @__PURE__ */ t("div", { className: "max-h-[350px] overflow-y-auto", children: /* @__PURE__ */ t("div", { className: "divide-y", children: p.map((f) => /* @__PURE__ */ t(
|
|
878
|
+
At,
|
|
873
879
|
{
|
|
874
|
-
export:
|
|
875
|
-
onRemove:
|
|
880
|
+
export: f,
|
|
881
|
+
onRemove: E
|
|
876
882
|
},
|
|
877
|
-
|
|
883
|
+
f.id
|
|
878
884
|
)) }) })
|
|
879
885
|
] });
|
|
880
886
|
}
|
|
881
|
-
function
|
|
887
|
+
function $t({
|
|
882
888
|
variant: e
|
|
883
889
|
}) {
|
|
884
|
-
const a =
|
|
885
|
-
(
|
|
886
|
-
),
|
|
887
|
-
return /* @__PURE__ */ s(
|
|
888
|
-
/* @__PURE__ */ t(
|
|
890
|
+
const a = z((i) => i.activeExports), v = tt(), l = a.size > 0, n = Array.from(a.values()).some(
|
|
891
|
+
(i) => i.status === "completed" || i.status === "failed"
|
|
892
|
+
), d = v > 0 ? v > 9 ? "9+" : String(v) : null;
|
|
893
|
+
return /* @__PURE__ */ s(Ce, { children: [
|
|
894
|
+
/* @__PURE__ */ t(Ne, { asChild: !0, children: /* @__PURE__ */ s(
|
|
889
895
|
A,
|
|
890
896
|
{
|
|
891
897
|
variant: e ?? "ghost",
|
|
@@ -893,18 +899,18 @@ function _t({
|
|
|
893
899
|
className: "relative w-7 px-0 text-muted-foreground hover:text-foreground",
|
|
894
900
|
"aria-label": "Export notifications",
|
|
895
901
|
children: [
|
|
896
|
-
/* @__PURE__ */ t(
|
|
897
|
-
|
|
902
|
+
/* @__PURE__ */ t(at, { className: "h-3.5 w-3.5" }),
|
|
903
|
+
l && /* @__PURE__ */ t(
|
|
898
904
|
"span",
|
|
899
905
|
{
|
|
900
|
-
className: `absolute flex items-center justify-center rounded-full bg-primary text-primary-foreground ${
|
|
901
|
-
children:
|
|
906
|
+
className: `absolute flex items-center justify-center rounded-full bg-primary text-primary-foreground ${d ? "-right-0.5 -top-0.5 h-3.5 min-w-3.5 px-0.5 text-[9px] font-semibold" : "right-1 top-1 h-1.5 w-1.5"}`,
|
|
907
|
+
children: d
|
|
902
908
|
}
|
|
903
909
|
)
|
|
904
910
|
]
|
|
905
911
|
}
|
|
906
912
|
) }),
|
|
907
|
-
/* @__PURE__ */ t(
|
|
913
|
+
/* @__PURE__ */ t(De, { className: "w-80 p-0", align: "end", sideOffset: 8, children: /* @__PURE__ */ t(It, {}) })
|
|
908
914
|
] });
|
|
909
915
|
}
|
|
910
916
|
function Ft(e) {
|
|
@@ -916,140 +922,140 @@ function Ft(e) {
|
|
|
916
922
|
affectedBindingControlIds: e.type === "add" || e.type === "update" ? e.affectedBindingControlIds : void 0
|
|
917
923
|
};
|
|
918
924
|
}
|
|
919
|
-
function
|
|
925
|
+
function _t({
|
|
920
926
|
open: e,
|
|
921
927
|
onOpenChange: a,
|
|
922
|
-
trigger:
|
|
923
|
-
showTrigger:
|
|
924
|
-
initialMode:
|
|
928
|
+
trigger: v,
|
|
929
|
+
showTrigger: l = !0,
|
|
930
|
+
initialMode: n = "manage"
|
|
925
931
|
}) {
|
|
926
|
-
const
|
|
927
|
-
forceClose:
|
|
928
|
-
handleOpenChange:
|
|
929
|
-
isCreateFlowActive:
|
|
932
|
+
const c = n === "create", {
|
|
933
|
+
forceClose: d,
|
|
934
|
+
handleOpenChange: u,
|
|
935
|
+
isCreateFlowActive: i,
|
|
930
936
|
preventPassiveDismissDuringCreate: r,
|
|
931
|
-
resolvedOpen:
|
|
932
|
-
setIsCreateFlowActive:
|
|
937
|
+
resolvedOpen: p,
|
|
938
|
+
setIsCreateFlowActive: b
|
|
933
939
|
} = ft({
|
|
934
940
|
open: e,
|
|
935
941
|
onOpenChange: a,
|
|
936
|
-
initialCreateFlowActive:
|
|
942
|
+
initialCreateFlowActive: n === "create",
|
|
937
943
|
// Dialog mode renders a built-in X close button — allow explicit
|
|
938
944
|
// closes through `handleOpenChange`. Popover mode has no X; its
|
|
939
945
|
// only close-via-trigger path is a re-click that would silently
|
|
940
946
|
// wipe the in-progress create flow, so block everything during
|
|
941
947
|
// create and make consumers use `forceClose()` from a dedicated
|
|
942
948
|
// button.
|
|
943
|
-
dismissMode:
|
|
944
|
-
}),
|
|
949
|
+
dismissMode: l ? "passive" : "explicit-only"
|
|
950
|
+
}), h = O((m) => m.dashboard), { setDashboardControlsModel: y } = J(), { participants: E } = st(rt(h)), f = Array.from(
|
|
945
951
|
new Map(
|
|
946
|
-
|
|
947
|
-
(
|
|
948
|
-
var
|
|
952
|
+
E.flatMap(
|
|
953
|
+
(m) => m.fieldChoices.map((g) => {
|
|
954
|
+
var I;
|
|
949
955
|
return [
|
|
950
|
-
|
|
956
|
+
g.value,
|
|
951
957
|
{
|
|
952
|
-
option:
|
|
953
|
-
target: (
|
|
958
|
+
option: g,
|
|
959
|
+
target: (I = m.fieldTargetMap) == null ? void 0 : I[g.value]
|
|
954
960
|
}
|
|
955
961
|
];
|
|
956
962
|
})
|
|
957
963
|
)
|
|
958
964
|
).values()
|
|
959
|
-
),
|
|
965
|
+
), w = Array.from(
|
|
960
966
|
new Map(
|
|
961
|
-
|
|
962
|
-
(
|
|
963
|
-
var
|
|
967
|
+
E.flatMap(
|
|
968
|
+
(m) => m.metricChoices.map((g) => {
|
|
969
|
+
var I;
|
|
964
970
|
return [
|
|
965
|
-
|
|
971
|
+
g.value,
|
|
966
972
|
{
|
|
967
|
-
option:
|
|
968
|
-
target: (
|
|
973
|
+
option: g,
|
|
974
|
+
target: (I = m.metricTargetMap) == null ? void 0 : I[g.value]
|
|
969
975
|
}
|
|
970
976
|
];
|
|
971
977
|
})
|
|
972
978
|
)
|
|
973
979
|
).values()
|
|
974
|
-
),
|
|
975
|
-
...
|
|
980
|
+
), S = ot({
|
|
981
|
+
...h || {},
|
|
976
982
|
controls: []
|
|
977
|
-
}),
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
Ft(
|
|
983
|
+
}), C = nt(h), o = (m, g, I) => {
|
|
984
|
+
y(
|
|
985
|
+
m,
|
|
986
|
+
g,
|
|
987
|
+
Ft(I)
|
|
982
988
|
);
|
|
983
|
-
},
|
|
984
|
-
if (
|
|
985
|
-
|
|
989
|
+
}, x = _(() => {
|
|
990
|
+
if (c) {
|
|
991
|
+
d();
|
|
986
992
|
return;
|
|
987
993
|
}
|
|
988
|
-
|
|
989
|
-
}, [
|
|
994
|
+
b(!1);
|
|
995
|
+
}, [c, d, b]), D = /* @__PURE__ */ t(
|
|
990
996
|
vt,
|
|
991
997
|
{
|
|
992
998
|
scope: "dashboard",
|
|
993
|
-
controls:
|
|
994
|
-
reservedControlIds:
|
|
995
|
-
defaultValues:
|
|
996
|
-
usageByControlId:
|
|
997
|
-
availableFieldChoices:
|
|
998
|
-
availableMetricChoices:
|
|
999
|
-
structuralParticipants:
|
|
1000
|
-
structuralParticipantIdsByControlId:
|
|
1001
|
-
initialCreateFlow:
|
|
1002
|
-
onCreateFlowActiveChange:
|
|
1003
|
-
onCreateFlowComplete:
|
|
1004
|
-
onChange:
|
|
999
|
+
controls: h.controls || [],
|
|
1000
|
+
reservedControlIds: S,
|
|
1001
|
+
defaultValues: h.defaultControlValues || {},
|
|
1002
|
+
usageByControlId: it(h),
|
|
1003
|
+
availableFieldChoices: f,
|
|
1004
|
+
availableMetricChoices: w,
|
|
1005
|
+
structuralParticipants: E,
|
|
1006
|
+
structuralParticipantIdsByControlId: C,
|
|
1007
|
+
initialCreateFlow: n === "create",
|
|
1008
|
+
onCreateFlowActiveChange: b,
|
|
1009
|
+
onCreateFlowComplete: x,
|
|
1010
|
+
onChange: o,
|
|
1005
1011
|
emptyMessage: "No dashboard controls yet."
|
|
1006
1012
|
}
|
|
1007
|
-
), F =
|
|
1013
|
+
), F = i ? "Add dashboard control" : "Dashboard Controls", U = /* @__PURE__ */ s(H, { children: [
|
|
1008
1014
|
/* @__PURE__ */ s("div", { className: "space-y-1", children: [
|
|
1009
1015
|
/* @__PURE__ */ t("h4", { className: "text-sm font-medium", children: "Dashboard Controls" }),
|
|
1010
1016
|
/* @__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." })
|
|
1011
1017
|
] }),
|
|
1012
|
-
|
|
1018
|
+
D
|
|
1013
1019
|
] });
|
|
1014
|
-
return
|
|
1015
|
-
/* @__PURE__ */ t(
|
|
1020
|
+
return l ? /* @__PURE__ */ s(Ce, { open: p, onOpenChange: u, children: [
|
|
1021
|
+
/* @__PURE__ */ t(Ne, { asChild: !0, children: v || /* @__PURE__ */ s(A, { variant: "outline", className: "h-7 px-2", size: "sm", children: [
|
|
1016
1022
|
/* @__PURE__ */ t(Y, { className: "mr-2 h-4 w-4" }),
|
|
1017
1023
|
"Controls"
|
|
1018
1024
|
] }) }),
|
|
1019
1025
|
/* @__PURE__ */ t(
|
|
1020
|
-
|
|
1026
|
+
De,
|
|
1021
1027
|
{
|
|
1022
1028
|
className: "w-[620px] max-w-[95vw] space-y-4",
|
|
1023
1029
|
align: "end",
|
|
1024
1030
|
onEscapeKeyDown: r,
|
|
1025
1031
|
onPointerDownOutside: r,
|
|
1026
|
-
children:
|
|
1032
|
+
children: U
|
|
1027
1033
|
}
|
|
1028
1034
|
)
|
|
1029
|
-
] }) : /* @__PURE__ */ t(
|
|
1030
|
-
|
|
1035
|
+
] }) : /* @__PURE__ */ t(ue, { open: p, onOpenChange: u, children: /* @__PURE__ */ s(
|
|
1036
|
+
me,
|
|
1031
1037
|
{
|
|
1032
1038
|
className: "flex max-h-[88vh] flex-col overflow-hidden sm:max-w-[600px]",
|
|
1033
1039
|
onEscapeKeyDown: r,
|
|
1034
1040
|
onPointerDownOutside: r,
|
|
1035
1041
|
children: [
|
|
1036
1042
|
/* @__PURE__ */ s(
|
|
1037
|
-
|
|
1043
|
+
he,
|
|
1038
1044
|
{
|
|
1039
|
-
className:
|
|
1045
|
+
className: i ? "space-y-0" : void 0,
|
|
1040
1046
|
children: [
|
|
1041
|
-
/* @__PURE__ */ t(
|
|
1047
|
+
/* @__PURE__ */ t(pe, { className: "text-[15px]", children: F }),
|
|
1042
1048
|
/* @__PURE__ */ t(
|
|
1043
|
-
|
|
1049
|
+
fe,
|
|
1044
1050
|
{
|
|
1045
|
-
className:
|
|
1046
|
-
children:
|
|
1051
|
+
className: i ? "sr-only" : "text-[13px]",
|
|
1052
|
+
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."
|
|
1047
1053
|
}
|
|
1048
1054
|
)
|
|
1049
1055
|
]
|
|
1050
1056
|
}
|
|
1051
1057
|
),
|
|
1052
|
-
/* @__PURE__ */ t("div", { className: "min-h-0 overflow-y-auto pr-1", children:
|
|
1058
|
+
/* @__PURE__ */ t("div", { className: "min-h-0 overflow-y-auto pr-1", children: D })
|
|
1053
1059
|
]
|
|
1054
1060
|
}
|
|
1055
1061
|
) });
|
|
@@ -1057,26 +1063,26 @@ function $t({
|
|
|
1057
1063
|
function Ht({
|
|
1058
1064
|
showFilters: e,
|
|
1059
1065
|
onToggleFilters: a,
|
|
1060
|
-
onAddFilter:
|
|
1061
|
-
onAddControl:
|
|
1062
|
-
onManageControls:
|
|
1063
|
-
size:
|
|
1064
|
-
className:
|
|
1065
|
-
primaryButtonClassName:
|
|
1066
|
-
secondaryButtonClassName:
|
|
1066
|
+
onAddFilter: v,
|
|
1067
|
+
onAddControl: l,
|
|
1068
|
+
onManageControls: n,
|
|
1069
|
+
size: c = "default",
|
|
1070
|
+
className: d,
|
|
1071
|
+
primaryButtonClassName: u,
|
|
1072
|
+
secondaryButtonClassName: i,
|
|
1067
1073
|
dropdownContentClassName: r
|
|
1068
1074
|
}) {
|
|
1069
1075
|
return /* @__PURE__ */ s(
|
|
1070
1076
|
"div",
|
|
1071
1077
|
{
|
|
1072
|
-
className:
|
|
1078
|
+
className: $(
|
|
1073
1079
|
// Height lives on the shell so the outer border is part of the
|
|
1074
1080
|
// h-7 box (matches regular `size="xs"` buttons). Inner buttons
|
|
1075
1081
|
// stretch to fill via `h-full`, avoiding the 2px stack-up that
|
|
1076
1082
|
// makes the combo taller than a sibling `<Button size="xs">`.
|
|
1077
1083
|
"relative inline-flex items-stretch overflow-hidden rounded-[5px] border border-input bg-background",
|
|
1078
|
-
|
|
1079
|
-
|
|
1084
|
+
c === "toolbar" ? "h-8" : "h-7",
|
|
1085
|
+
d
|
|
1080
1086
|
),
|
|
1081
1087
|
children: [
|
|
1082
1088
|
/* @__PURE__ */ s(
|
|
@@ -1084,9 +1090,9 @@ function Ht({
|
|
|
1084
1090
|
{
|
|
1085
1091
|
variant: "ghost",
|
|
1086
1092
|
size: "xs",
|
|
1087
|
-
className:
|
|
1093
|
+
className: $(
|
|
1088
1094
|
"h-full rounded-none border-0 bg-transparent pl-2.5 pr-2 shadow-none hover:bg-accent/50",
|
|
1089
|
-
|
|
1095
|
+
u
|
|
1090
1096
|
),
|
|
1091
1097
|
onClick: a,
|
|
1092
1098
|
children: [
|
|
@@ -1095,39 +1101,39 @@ function Ht({
|
|
|
1095
1101
|
]
|
|
1096
1102
|
}
|
|
1097
1103
|
),
|
|
1098
|
-
/* @__PURE__ */ s(
|
|
1099
|
-
/* @__PURE__ */ t(
|
|
1104
|
+
/* @__PURE__ */ s(be, { children: [
|
|
1105
|
+
/* @__PURE__ */ t(xe, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1100
1106
|
A,
|
|
1101
1107
|
{
|
|
1102
1108
|
variant: "ghost",
|
|
1103
1109
|
size: "xs",
|
|
1104
|
-
className:
|
|
1110
|
+
className: $(
|
|
1105
1111
|
"h-full w-7 rounded-none border-0 border-l border-border/60 bg-transparent px-0 shadow-none hover:bg-accent/50",
|
|
1106
|
-
|
|
1112
|
+
i
|
|
1107
1113
|
),
|
|
1108
1114
|
"aria-label": "Filter and control actions",
|
|
1109
|
-
children: /* @__PURE__ */ t(
|
|
1115
|
+
children: /* @__PURE__ */ t(ye, { className: "h-3.5 w-3.5" })
|
|
1110
1116
|
}
|
|
1111
1117
|
) }),
|
|
1112
1118
|
/* @__PURE__ */ s(
|
|
1113
|
-
|
|
1119
|
+
we,
|
|
1114
1120
|
{
|
|
1115
1121
|
align: "start",
|
|
1116
|
-
className:
|
|
1122
|
+
className: $(
|
|
1117
1123
|
"min-w-[180px] rounded-[6px] border border-border/60 p-1 shadow-sm",
|
|
1118
1124
|
r
|
|
1119
1125
|
),
|
|
1120
1126
|
children: [
|
|
1121
|
-
/* @__PURE__ */ s(
|
|
1127
|
+
/* @__PURE__ */ s(R, { onSelect: v, children: [
|
|
1122
1128
|
/* @__PURE__ */ t(ae, { className: "h-3.5 w-3.5" }),
|
|
1123
1129
|
"Add filter"
|
|
1124
1130
|
] }),
|
|
1125
|
-
/* @__PURE__ */ s(
|
|
1131
|
+
/* @__PURE__ */ s(R, { onSelect: l, children: [
|
|
1126
1132
|
/* @__PURE__ */ t(Y, { className: "h-3.5 w-3.5" }),
|
|
1127
1133
|
"Add control"
|
|
1128
1134
|
] }),
|
|
1129
|
-
/* @__PURE__ */ s(
|
|
1130
|
-
/* @__PURE__ */ t(
|
|
1135
|
+
/* @__PURE__ */ s(R, { onSelect: n, children: [
|
|
1136
|
+
/* @__PURE__ */ t(lt, { className: "h-3.5 w-3.5" }),
|
|
1131
1137
|
"Manage controls"
|
|
1132
1138
|
] })
|
|
1133
1139
|
]
|
|
@@ -1140,13 +1146,13 @@ function Ht({
|
|
|
1140
1146
|
}
|
|
1141
1147
|
export {
|
|
1142
1148
|
zt as A,
|
|
1143
|
-
|
|
1149
|
+
_t as D,
|
|
1144
1150
|
It as E,
|
|
1145
|
-
|
|
1151
|
+
$t as N,
|
|
1146
1152
|
Rt as U,
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1153
|
+
Bt as V,
|
|
1154
|
+
At as a,
|
|
1155
|
+
Ot as b,
|
|
1150
1156
|
Ht as c,
|
|
1151
|
-
|
|
1157
|
+
Vt as u
|
|
1152
1158
|
};
|