react-semaphor 0.1.271 → 0.1.273
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-CXi0Kc8w.js → dashboard-controls-CWk_VHYO.js} +1 -1
- package/dist/chunks/{dashboard-controls-Dfgvs7VL.js → dashboard-controls-DXVPvtdv.js} +4 -4
- package/dist/chunks/{dashboard-filter-controls-button-YHsKcBkN.js → dashboard-filter-controls-button-BwfVbMAn.js} +251 -267
- package/dist/chunks/dashboard-filter-controls-button-CjRyfVQK.js +11 -0
- package/dist/chunks/{dashboard-json-CeiZb0oM.js → dashboard-json-BZQnb-zu.js} +1 -1
- package/dist/chunks/{dashboard-json-BgtFUcgD.js → dashboard-json-DF2gJo97.js} +1 -1
- package/dist/chunks/{dashboard-summary-settings-dialog-CoEmX_jV.js → dashboard-summary-settings-dialog-BpELD3wD.js} +1 -1
- package/dist/chunks/{dashboard-summary-settings-dialog-CuZFi7eP.js → dashboard-summary-settings-dialog-DdwG-S3r.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-CGYJdPQ8.js → edit-dashboard-visual-0hFfcZi2.js} +6766 -6740
- package/dist/chunks/edit-dashboard-visual-DGPiHVW5.js +193 -0
- package/dist/chunks/index-BOOgwnhm.js +1404 -0
- package/dist/chunks/{index-B9iVxfst.js → index-YLHt8XOf.js} +26260 -25953
- package/dist/chunks/{resource-management-panel-CDPB0Wn6.js → resource-management-panel-B9apTPo3.js} +2 -2
- package/dist/chunks/{resource-management-panel-Cqi9uzkw.js → resource-management-panel-ShFnXy_K.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-4H0O4LVk.js → use-create-flow-overlay-state-DSVyfQTu.js} +2 -2
- package/dist/chunks/{use-create-flow-overlay-state-B5mMajCH.js → use-create-flow-overlay-state-_csxpz3-.js} +1 -1
- package/dist/chunks/{use-visual-utils-S6wmOnYK.js → use-visual-utils-B1ukb8iy.js} +1 -1
- package/dist/chunks/{use-visual-utils-iRJXiZv1.js → use-visual-utils-Ck8d5hcW.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 +7 -1
- package/dist/types/main.d.ts +7 -1
- package/dist/types/shared.d.ts +7 -1
- package/dist/types/surfboard.d.ts +7 -1
- package/dist/types/types.d.ts +7 -1
- package/package.json +1 -1
- package/dist/chunks/dashboard-filter-controls-button-EN4T7uuF.js +0 -11
- package/dist/chunks/edit-dashboard-visual-D8AIf9tr.js +0 -193
- package/dist/chunks/index-Dx42zDJJ.js +0 -1404
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import ge, { useState as
|
|
2
|
-
import { bM as Z, b as $, aC as U, bJ as
|
|
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, d1 as we, d7 as ye, v as xe, B as I, w as j, U as R, J as De, u as B, K as Ne, N as X, d8 as Ae, d9 as K, x as P, b_ as ie, af as Se, c as L, cA as le, cB as de, a6 as ce, cD as ue, cE as M, s as Ee, cI as Ie, cr as Le, M as Fe, da as Te, db as ke, dc as Ue, cQ as Me, cR as Ve, cS as Pe, cT as Be, cU as Oe, cV as ze, cW as Re, as as $e, bL as _e, X as He, dd as je, de as Xe, cw as Ge, bH as W, a8 as Ke, aF as We, P as he, k as me, df as qe, l as pe, dg as Je, dh as Qe, di as Ye, dj as Ze, dk as et, dl as fe, dm as q, dn as tt } from "./index-YLHt8XOf.js";
|
|
3
3
|
import { jsx as t, jsxs as s, Fragment as O } from "react/jsx-runtime";
|
|
4
|
-
import { V as
|
|
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-DSVyfQTu.js";
|
|
5
|
+
import { u as ve } from "./use-visual-utils-B1ukb8iy.js";
|
|
6
6
|
import { k as J } from "./date-formatter-vkCj9Ct-.js";
|
|
7
7
|
/**
|
|
8
8
|
* @license lucide-react v0.453.0 - ISC
|
|
@@ -22,70 +22,70 @@ const Q = Z("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
|
|
25
|
+
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
|
-
]),
|
|
30
|
-
function
|
|
29
|
+
]), mt = 1e4, pt = 15e3, ft = 3e4, vt = 3e4, gt = 12e4, Y = 2 * 60 * 60 * 1e3;
|
|
30
|
+
function bt(e) {
|
|
31
31
|
const a = Date.now() - e.getTime();
|
|
32
|
-
return a <
|
|
32
|
+
return a < vt ? mt : a < gt ? pt : ft;
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
const { authToken: e, tokenProps: a } = $(), p = U((
|
|
34
|
+
function Tt() {
|
|
35
|
+
const { authToken: e, tokenProps: a } = $(), p = U((m) => m.activeExports), [c, d] = F(
|
|
36
36
|
typeof document < "u" ? !document.hidden : !0
|
|
37
|
-
), u = z(null), n = z(!1), l = z(void 0),
|
|
38
|
-
const
|
|
39
|
-
return Array.from(
|
|
40
|
-
(
|
|
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
|
+
const m = U.getState().activeExports;
|
|
39
|
+
return Array.from(m.values()).filter(
|
|
40
|
+
(C) => _(C.status)
|
|
41
41
|
);
|
|
42
42
|
}, []);
|
|
43
|
-
|
|
43
|
+
T(() => {
|
|
44
44
|
if (typeof document > "u") return;
|
|
45
|
-
const
|
|
45
|
+
const m = () => {
|
|
46
46
|
d(!document.hidden);
|
|
47
47
|
};
|
|
48
|
-
return document.addEventListener("visibilitychange",
|
|
49
|
-
document.removeEventListener("visibilitychange",
|
|
48
|
+
return document.addEventListener("visibilitychange", m), () => {
|
|
49
|
+
document.removeEventListener("visibilitychange", m);
|
|
50
50
|
};
|
|
51
51
|
}, []);
|
|
52
52
|
const b = V(async () => {
|
|
53
|
-
if (!
|
|
53
|
+
if (!h || !o) {
|
|
54
54
|
n.current = !1;
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
|
-
const
|
|
58
|
-
if (
|
|
57
|
+
const m = v();
|
|
58
|
+
if (m.length === 0) {
|
|
59
59
|
n.current = !1;
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
|
-
const
|
|
63
|
-
(r) =>
|
|
62
|
+
const C = Date.now(), D = m.filter(
|
|
63
|
+
(r) => C - r.startedAt.getTime() > Y
|
|
64
64
|
);
|
|
65
|
-
if (
|
|
65
|
+
if (D.length > 0) {
|
|
66
66
|
const { updateExport: r } = U.getState().actions;
|
|
67
|
-
for (const i of
|
|
67
|
+
for (const i of D)
|
|
68
68
|
r(i.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 f =
|
|
75
|
-
(r) =>
|
|
74
|
+
const f = m.filter(
|
|
75
|
+
(r) => C - r.startedAt.getTime() <= Y
|
|
76
76
|
);
|
|
77
77
|
if (f.length === 0) {
|
|
78
78
|
n.current = !1;
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
81
|
-
const
|
|
81
|
+
const y = await Promise.allSettled(
|
|
82
82
|
f.map(async (r) => {
|
|
83
83
|
try {
|
|
84
|
-
const i = await ee(
|
|
84
|
+
const i = await ee(h, o, r.id);
|
|
85
85
|
let g;
|
|
86
86
|
if (i.status === "completed")
|
|
87
87
|
try {
|
|
88
|
-
g = await
|
|
88
|
+
g = await H(h, o, r.id);
|
|
89
89
|
} catch (E) {
|
|
90
90
|
console.error(
|
|
91
91
|
`[useExportPolling] Failed to get download URL for ${r.id}:`,
|
|
@@ -111,33 +111,33 @@ function Ut() {
|
|
|
111
111
|
}
|
|
112
112
|
})
|
|
113
113
|
), { updateExport: S } = U.getState().actions;
|
|
114
|
-
for (const r of
|
|
114
|
+
for (const r of y)
|
|
115
115
|
r.status === "fulfilled" && r.value && S(r.value.id, r.value);
|
|
116
|
-
const
|
|
117
|
-
if (
|
|
118
|
-
const r =
|
|
116
|
+
const w = v();
|
|
117
|
+
if (w.length > 0 && !document.hidden) {
|
|
118
|
+
const r = w.reduce(
|
|
119
119
|
(g, E) => E.startedAt < g ? E.startedAt : g,
|
|
120
|
-
|
|
121
|
-
), i =
|
|
120
|
+
w[0].startedAt
|
|
121
|
+
), i = bt(r);
|
|
122
122
|
u.current && clearTimeout(u.current), u.current = setTimeout(() => {
|
|
123
123
|
var g;
|
|
124
124
|
(g = l.current) == null || g.call(l);
|
|
125
125
|
}, i);
|
|
126
126
|
} else
|
|
127
127
|
n.current = !1;
|
|
128
|
-
}, [
|
|
129
|
-
return
|
|
128
|
+
}, [h, o, v]);
|
|
129
|
+
return T(() => {
|
|
130
130
|
l.current = b;
|
|
131
|
-
}, [b]),
|
|
132
|
-
var
|
|
133
|
-
v().length > 0 && c && !n.current && (n.current = !0, (
|
|
134
|
-
}, [p, c, v]),
|
|
135
|
-
var
|
|
136
|
-
const
|
|
137
|
-
c &&
|
|
138
|
-
}, [c, v]),
|
|
131
|
+
}, [b]), T(() => {
|
|
132
|
+
var C;
|
|
133
|
+
v().length > 0 && c && !n.current && (n.current = !0, (C = l.current) == null || C.call(l));
|
|
134
|
+
}, [p, c, v]), T(() => {
|
|
135
|
+
var C;
|
|
136
|
+
const m = v();
|
|
137
|
+
c && m.length > 0 && !n.current && (n.current = !0, (C = l.current) == null || C.call(l));
|
|
138
|
+
}, [c, v]), T(() => {
|
|
139
139
|
!c && u.current && (clearTimeout(u.current), u.current = null, n.current = !1);
|
|
140
|
-
}, [c]),
|
|
140
|
+
}, [c]), T(() => () => {
|
|
141
141
|
u.current && (clearTimeout(u.current), u.current = null);
|
|
142
142
|
}, []), {
|
|
143
143
|
isPolling: n.current,
|
|
@@ -145,35 +145,35 @@ function Ut() {
|
|
|
145
145
|
inProgressCount: v().length
|
|
146
146
|
};
|
|
147
147
|
}
|
|
148
|
-
function
|
|
148
|
+
function kt() {
|
|
149
149
|
const { authToken: e, tokenProps: a } = $(), p = U((l) => l.activeExports), { addExport: c } = te(), d = z(!1), u = a == null ? void 0 : a.apiServiceUrl, n = e == null ? void 0 : e.accessToken;
|
|
150
|
-
|
|
150
|
+
T(() => {
|
|
151
151
|
if (d.current || !u || !n) return;
|
|
152
152
|
(async () => {
|
|
153
153
|
try {
|
|
154
|
-
const { exports:
|
|
154
|
+
const { exports: h } = await Ce(u, n, {
|
|
155
155
|
status: ["pending", "processing", "chunking", "compacting", "completed", "failed"],
|
|
156
156
|
limit: 20
|
|
157
157
|
// Limit to recent exports
|
|
158
158
|
});
|
|
159
|
-
for (const o of
|
|
159
|
+
for (const o of h) {
|
|
160
160
|
if (p.has(o.id)) continue;
|
|
161
161
|
const v = o.totalChunks ? Math.round(o.completedChunks / o.totalChunks * 100) : 0;
|
|
162
162
|
let b;
|
|
163
163
|
if (o.status === "completed")
|
|
164
164
|
try {
|
|
165
|
-
b = await
|
|
166
|
-
} catch (
|
|
165
|
+
b = await H(u, n, o.id);
|
|
166
|
+
} catch (C) {
|
|
167
167
|
console.error(
|
|
168
168
|
`[useExportRecovery] Failed to get download URL for ${o.id}:`,
|
|
169
|
-
|
|
169
|
+
C
|
|
170
170
|
);
|
|
171
171
|
}
|
|
172
|
-
const
|
|
172
|
+
const m = {
|
|
173
173
|
id: o.id,
|
|
174
174
|
status: o.status,
|
|
175
175
|
progress: v,
|
|
176
|
-
title:
|
|
176
|
+
title: Ct(o),
|
|
177
177
|
totalRows: o.totalRows,
|
|
178
178
|
totalChunks: o.totalChunks,
|
|
179
179
|
completedChunks: o.completedChunks,
|
|
@@ -185,21 +185,21 @@ function Mt() {
|
|
|
185
185
|
expiresAt: new Date(o.expiresAt),
|
|
186
186
|
downloadUrl: b
|
|
187
187
|
};
|
|
188
|
-
c(
|
|
188
|
+
c(m);
|
|
189
189
|
}
|
|
190
190
|
d.current = !0;
|
|
191
|
-
} catch (
|
|
192
|
-
console.error("[useExportRecovery] Failed to recover exports:",
|
|
191
|
+
} catch (h) {
|
|
192
|
+
console.error("[useExportRecovery] Failed to recover exports:", h), d.current = !0;
|
|
193
193
|
}
|
|
194
194
|
})();
|
|
195
195
|
}, [u, n, c, p]);
|
|
196
196
|
}
|
|
197
|
-
function
|
|
198
|
-
return e.title ? e.title :
|
|
197
|
+
function Ct(e) {
|
|
198
|
+
return e.title ? e.title : _(
|
|
199
199
|
e.status
|
|
200
200
|
) ? "Export in progress..." : e.status === "completed" ? "Export completed" : e.status === "failed" ? "Export failed" : "Export";
|
|
201
201
|
}
|
|
202
|
-
function
|
|
202
|
+
function wt({
|
|
203
203
|
open: e,
|
|
204
204
|
onOpenChange: a,
|
|
205
205
|
isLibraryVisual: p,
|
|
@@ -208,15 +208,15 @@ function yt({
|
|
|
208
208
|
destinationMode: u = "both",
|
|
209
209
|
onConfirm: n
|
|
210
210
|
}) {
|
|
211
|
-
const [l,
|
|
211
|
+
const [l, h] = F(
|
|
212
212
|
p && c ? `Copy of ${c}` : c || ""
|
|
213
|
-
), [o, v] =
|
|
213
|
+
), [o, v] = F("");
|
|
214
214
|
ge.useEffect(() => {
|
|
215
|
-
e && (
|
|
215
|
+
e && (h(
|
|
216
216
|
p && c ? `Copy of ${c}` : c || ""
|
|
217
217
|
), v(""));
|
|
218
218
|
}, [e, p, c]);
|
|
219
|
-
const b = !!l.trim(),
|
|
219
|
+
const b = !!l.trim(), m = u === "local" ? {
|
|
220
220
|
saveToLibrary: !1,
|
|
221
221
|
saveToCurrentDashboard: !0,
|
|
222
222
|
badgeType: "local",
|
|
@@ -234,38 +234,38 @@ function yt({
|
|
|
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
|
-
},
|
|
237
|
+
}, C = () => {
|
|
238
238
|
!b || d || n({
|
|
239
239
|
name: l.trim(),
|
|
240
240
|
description: o.trim() || void 0,
|
|
241
|
-
saveToLibrary:
|
|
242
|
-
saveToCurrentDashboard:
|
|
241
|
+
saveToLibrary: m.saveToLibrary,
|
|
242
|
+
saveToCurrentDashboard: m.saveToCurrentDashboard
|
|
243
243
|
});
|
|
244
244
|
};
|
|
245
245
|
return /* @__PURE__ */ t(ae, { open: e, onOpenChange: a, children: /* @__PURE__ */ s(se, { className: "sm:max-w-[500px]", children: [
|
|
246
246
|
/* @__PURE__ */ s(re, { children: [
|
|
247
247
|
/* @__PURE__ */ s(oe, { className: "flex items-center gap-2", children: [
|
|
248
248
|
/* @__PURE__ */ t("span", { children: "Save Visual As" }),
|
|
249
|
-
|
|
250
|
-
|
|
249
|
+
m.badgeType !== "local" && /* @__PURE__ */ t(
|
|
250
|
+
at,
|
|
251
251
|
{
|
|
252
|
-
type:
|
|
252
|
+
type: m.badgeType,
|
|
253
253
|
showLabel: !0,
|
|
254
254
|
className: "px-2 py-0.5"
|
|
255
255
|
}
|
|
256
256
|
)
|
|
257
257
|
] }),
|
|
258
|
-
/* @__PURE__ */ t(ne, { children:
|
|
258
|
+
/* @__PURE__ */ t(ne, { children: m.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(G, { htmlFor: "name", children: "Name" }),
|
|
263
263
|
/* @__PURE__ */ t(
|
|
264
|
-
|
|
264
|
+
we,
|
|
265
265
|
{
|
|
266
266
|
id: "name",
|
|
267
267
|
value: l,
|
|
268
|
-
onChange: (
|
|
268
|
+
onChange: (D) => h(D.target.value),
|
|
269
269
|
placeholder: "Enter visual name",
|
|
270
270
|
disabled: d
|
|
271
271
|
}
|
|
@@ -274,11 +274,11 @@ function yt({
|
|
|
274
274
|
/* @__PURE__ */ s("div", { className: "grid gap-2", children: [
|
|
275
275
|
/* @__PURE__ */ t(G, { htmlFor: "description", children: "Description (optional)" }),
|
|
276
276
|
/* @__PURE__ */ t(
|
|
277
|
-
|
|
277
|
+
ye,
|
|
278
278
|
{
|
|
279
279
|
id: "description",
|
|
280
280
|
value: o,
|
|
281
|
-
onChange: (
|
|
281
|
+
onChange: (D) => v(D.target.value),
|
|
282
282
|
placeholder: "Enter visual description",
|
|
283
283
|
rows: 3,
|
|
284
284
|
disabled: d
|
|
@@ -286,7 +286,7 @@ function yt({
|
|
|
286
286
|
)
|
|
287
287
|
] })
|
|
288
288
|
] }),
|
|
289
|
-
/* @__PURE__ */ s(
|
|
289
|
+
/* @__PURE__ */ s(xe, { children: [
|
|
290
290
|
/* @__PURE__ */ t(
|
|
291
291
|
I,
|
|
292
292
|
{
|
|
@@ -296,29 +296,29 @@ function yt({
|
|
|
296
296
|
children: "Cancel"
|
|
297
297
|
}
|
|
298
298
|
),
|
|
299
|
-
/* @__PURE__ */ s(I, { onClick:
|
|
300
|
-
d && /* @__PURE__ */ t(
|
|
301
|
-
|
|
299
|
+
/* @__PURE__ */ s(I, { onClick: C, disabled: !b || d, children: [
|
|
300
|
+
d && /* @__PURE__ */ t(j, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
301
|
+
m.actionLabel
|
|
302
302
|
] })
|
|
303
303
|
] })
|
|
304
304
|
] }) });
|
|
305
305
|
}
|
|
306
|
-
function
|
|
307
|
-
const [e, a] =
|
|
306
|
+
function yt() {
|
|
307
|
+
const [e, a] = F(!1), [p, c] = F(!1), [d, u] = F(null), n = R((i) => i.frame), l = R((i) => i.card), h = De(), o = B((i) => i.selectedSheetId), v = B(
|
|
308
308
|
(i) => i.actions.setIsDashboardPanelOpen
|
|
309
|
-
), { getUpdatedFrame: b } = ve(), { selectVisual:
|
|
309
|
+
), { getUpdatedFrame: b } = ve(), { selectVisual: m } = Ne(), { addFrame: C, setSelectedFrameId: D, setIsVisualEditing: f } = X(), y = !!(n != null && n.visualId), S = (() => {
|
|
310
310
|
var i, g;
|
|
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 :
|
|
312
|
-
})(),
|
|
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
|
+
})(), w = Ae((i) => {
|
|
313
313
|
if (i != null && i.id) {
|
|
314
|
-
if (
|
|
314
|
+
if (m(i), p && d && o) {
|
|
315
315
|
const g = {
|
|
316
316
|
...d,
|
|
317
317
|
id: K(),
|
|
318
318
|
visualId: i.id
|
|
319
319
|
// Link to the newly created library visual
|
|
320
320
|
};
|
|
321
|
-
|
|
321
|
+
C(o, g, "end"), D(g.id), c(!1), u(null), f(!1);
|
|
322
322
|
}
|
|
323
323
|
v(!0), a(!1);
|
|
324
324
|
}
|
|
@@ -338,88 +338,88 @@ function Nt() {
|
|
|
338
338
|
}
|
|
339
339
|
const A = g.cards.length === 1 ? {
|
|
340
340
|
...g,
|
|
341
|
-
cards: g.cards.map((
|
|
342
|
-
...
|
|
341
|
+
cards: g.cards.map((x) => ({
|
|
342
|
+
...x,
|
|
343
343
|
title: i.name
|
|
344
344
|
// Use visual name as card title
|
|
345
345
|
}))
|
|
346
346
|
} : g;
|
|
347
347
|
if (i.saveToLibrary) {
|
|
348
348
|
c(i.saveToCurrentDashboard), u(A);
|
|
349
|
-
const
|
|
349
|
+
const x = {
|
|
350
350
|
title: i.name,
|
|
351
351
|
description: i.description,
|
|
352
352
|
frameObject: A,
|
|
353
353
|
// Card title synced for single-card frames
|
|
354
354
|
isPrivate: !1
|
|
355
355
|
};
|
|
356
|
-
|
|
356
|
+
w.mutate(x);
|
|
357
357
|
} else if (i.saveToCurrentDashboard) {
|
|
358
|
-
const
|
|
358
|
+
const x = {
|
|
359
359
|
...A,
|
|
360
360
|
// Card title already synced
|
|
361
361
|
id: K(),
|
|
362
362
|
visualId: void 0
|
|
363
363
|
// Explicitly no visualId for local visuals
|
|
364
364
|
};
|
|
365
|
-
|
|
365
|
+
C(o, x, "end"), D(x.id), P.success("Visual saved to dashboard"), a(!1), f(!1);
|
|
366
366
|
}
|
|
367
367
|
},
|
|
368
|
-
isLibraryVisual:
|
|
368
|
+
isLibraryVisual: y,
|
|
369
369
|
currentVisualName: S,
|
|
370
|
-
isSaving:
|
|
370
|
+
isSaving: w.isPending
|
|
371
371
|
};
|
|
372
372
|
}
|
|
373
|
-
function
|
|
373
|
+
function Ut({
|
|
374
374
|
className: e
|
|
375
375
|
}) {
|
|
376
|
-
const a = R((
|
|
377
|
-
saveAsDialogOpen:
|
|
376
|
+
const a = R((N) => N.frame), p = Se((N) => N.selectedVisual), c = B((N) => N.selectedFrameId), d = B((N) => N.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 && c), C = b && !m, {
|
|
377
|
+
saveAsDialogOpen: D,
|
|
378
378
|
setSaveAsDialogOpen: f,
|
|
379
|
-
handleSaveAs:
|
|
379
|
+
handleSaveAs: y,
|
|
380
380
|
isLibraryVisual: S,
|
|
381
|
-
currentVisualName:
|
|
381
|
+
currentVisualName: w,
|
|
382
382
|
isSaving: r
|
|
383
|
-
} =
|
|
383
|
+
} = yt(), { getUpdatedFrame: i } = ve(), g = () => {
|
|
384
384
|
if (!d) {
|
|
385
385
|
P.error("No sheet selected");
|
|
386
386
|
return;
|
|
387
387
|
}
|
|
388
388
|
if (l) return;
|
|
389
|
-
|
|
390
|
-
const
|
|
389
|
+
h(!0);
|
|
390
|
+
const N = i(), A = ie(N);
|
|
391
391
|
if (A) {
|
|
392
|
-
|
|
392
|
+
h(!1), P.error(A);
|
|
393
393
|
return;
|
|
394
394
|
}
|
|
395
|
-
const
|
|
396
|
-
...
|
|
395
|
+
const x = {
|
|
396
|
+
...N,
|
|
397
397
|
visualId: void 0
|
|
398
398
|
};
|
|
399
|
-
n(d,
|
|
400
|
-
|
|
399
|
+
n(d, x), setTimeout(() => {
|
|
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 = (N) => {
|
|
403
|
+
v(N), 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: [
|
|
407
407
|
!b && /* @__PURE__ */ t(
|
|
408
|
-
|
|
408
|
+
st,
|
|
409
409
|
{
|
|
410
410
|
className: L(e, "rounded-none border-0"),
|
|
411
411
|
variant: "default"
|
|
412
412
|
}
|
|
413
413
|
),
|
|
414
|
-
b &&
|
|
415
|
-
|
|
414
|
+
b && C && /* @__PURE__ */ t(
|
|
415
|
+
rt,
|
|
416
416
|
{
|
|
417
417
|
className: L(e, "rounded-none border-0"),
|
|
418
418
|
variant: "default"
|
|
419
419
|
}
|
|
420
420
|
),
|
|
421
|
-
b &&
|
|
422
|
-
|
|
421
|
+
b && m && /* @__PURE__ */ t(
|
|
422
|
+
ot,
|
|
423
423
|
{
|
|
424
424
|
className: L(e, "rounded-none border-0")
|
|
425
425
|
}
|
|
@@ -440,7 +440,7 @@ function Vt({
|
|
|
440
440
|
}
|
|
441
441
|
) }),
|
|
442
442
|
/* @__PURE__ */ s(ue, { align: "end", children: [
|
|
443
|
-
|
|
443
|
+
m && /* @__PURE__ */ s(O, { children: [
|
|
444
444
|
/* @__PURE__ */ s(
|
|
445
445
|
M,
|
|
446
446
|
{
|
|
@@ -471,7 +471,7 @@ function Vt({
|
|
|
471
471
|
onClick: () => E("library"),
|
|
472
472
|
disabled: r,
|
|
473
473
|
children: [
|
|
474
|
-
/* @__PURE__ */ t(
|
|
474
|
+
/* @__PURE__ */ t(nt, { className: "mr-2 h-4 w-4" }),
|
|
475
475
|
"Save as Library Visual"
|
|
476
476
|
]
|
|
477
477
|
}
|
|
@@ -482,7 +482,7 @@ function Vt({
|
|
|
482
482
|
onClick: () => E("both"),
|
|
483
483
|
disabled: r,
|
|
484
484
|
children: [
|
|
485
|
-
/* @__PURE__ */ t(
|
|
485
|
+
/* @__PURE__ */ t(it, { className: "mr-2 h-4 w-4" }),
|
|
486
486
|
"Save Copy as Linked Visual"
|
|
487
487
|
]
|
|
488
488
|
}
|
|
@@ -490,29 +490,29 @@ function Vt({
|
|
|
490
490
|
] })
|
|
491
491
|
] })
|
|
492
492
|
] }),
|
|
493
|
-
/* @__PURE__ */ t(
|
|
493
|
+
/* @__PURE__ */ t(lt, { className: e }),
|
|
494
494
|
/* @__PURE__ */ t(
|
|
495
|
-
|
|
495
|
+
wt,
|
|
496
496
|
{
|
|
497
|
-
open:
|
|
498
|
-
onOpenChange: (
|
|
499
|
-
r || f(
|
|
497
|
+
open: D,
|
|
498
|
+
onOpenChange: (N) => {
|
|
499
|
+
r || f(N);
|
|
500
500
|
},
|
|
501
501
|
isLibraryVisual: S,
|
|
502
|
-
currentVisualName:
|
|
502
|
+
currentVisualName: w,
|
|
503
503
|
isSaving: r,
|
|
504
504
|
destinationMode: o,
|
|
505
|
-
onConfirm:
|
|
505
|
+
onConfirm: y
|
|
506
506
|
}
|
|
507
507
|
)
|
|
508
508
|
] });
|
|
509
509
|
}
|
|
510
|
-
function
|
|
510
|
+
function Mt({
|
|
511
511
|
className: e,
|
|
512
512
|
//labelClassName,
|
|
513
513
|
switchClassName: a
|
|
514
514
|
}) {
|
|
515
|
-
const p = R((l) => l.isDevMode), c = B((l) => l.isVisualEditing), { setIsDevMode: d } =
|
|
515
|
+
const p = R((l) => l.isDevMode), c = B((l) => l.isVisualEditing), { setIsDevMode: d } = Fe(), { config: u } = be(Te).tokenProps, n = (u == null ? void 0 : u.showAdvancedMode) !== !1;
|
|
516
516
|
return !c || !n ? null : /* @__PURE__ */ s("div", { className: L("flex items-center space-x-2", e), children: [
|
|
517
517
|
/* @__PURE__ */ t(
|
|
518
518
|
ke,
|
|
@@ -528,67 +528,51 @@ function Pt({
|
|
|
528
528
|
/* @__PURE__ */ t("label", { htmlFor: "advanced-mode", className: "sr-only", children: "Advanced Mode" })
|
|
529
529
|
] });
|
|
530
530
|
}
|
|
531
|
-
function
|
|
531
|
+
function Vt({
|
|
532
532
|
open: e,
|
|
533
533
|
onOpenChange: a,
|
|
534
534
|
onSave: p,
|
|
535
535
|
onDiscard: c,
|
|
536
536
|
isSaving: d,
|
|
537
|
-
title: u = "Unsaved
|
|
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",
|
|
540
|
-
discardLabel:
|
|
541
|
-
saveLabel: o = "Save
|
|
540
|
+
discardLabel: h = "Discard",
|
|
541
|
+
saveLabel: o = "Save"
|
|
542
542
|
}) {
|
|
543
543
|
return /* @__PURE__ */ t(Me, { open: e, onOpenChange: (b) => {
|
|
544
544
|
!b && d || a(b);
|
|
545
|
-
}, children: /* @__PURE__ */ s(Ve, {
|
|
546
|
-
/* @__PURE__ */ s(Pe, {
|
|
547
|
-
/* @__PURE__ */
|
|
548
|
-
|
|
549
|
-
/* @__PURE__ */ t(Oe, { className: "text-lg font-semibold tracking-tight", children: u })
|
|
550
|
-
] }),
|
|
551
|
-
/* @__PURE__ */ t(ze, { className: "text-sm leading-6 text-muted-foreground", children: n })
|
|
545
|
+
}, children: /* @__PURE__ */ s(Ve, { children: [
|
|
546
|
+
/* @__PURE__ */ s(Pe, { children: [
|
|
547
|
+
/* @__PURE__ */ t(Be, { children: u }),
|
|
548
|
+
/* @__PURE__ */ t(Oe, { children: n })
|
|
552
549
|
] }),
|
|
553
|
-
/* @__PURE__ */ s(
|
|
554
|
-
/* @__PURE__ */ t(
|
|
555
|
-
$e,
|
|
556
|
-
{
|
|
557
|
-
disabled: d,
|
|
558
|
-
className: "order-1 m-0 h-auto min-h-9 whitespace-normal border-border/60 px-4 py-2 text-center leading-5 sm:order-1",
|
|
559
|
-
children: l
|
|
560
|
-
}
|
|
561
|
-
),
|
|
550
|
+
/* @__PURE__ */ s(ze, { children: [
|
|
551
|
+
/* @__PURE__ */ t(Re, { disabled: d, children: l }),
|
|
562
552
|
/* @__PURE__ */ t(
|
|
563
|
-
|
|
553
|
+
I,
|
|
564
554
|
{
|
|
555
|
+
type: "button",
|
|
565
556
|
onClick: c,
|
|
566
557
|
disabled: d,
|
|
567
|
-
|
|
568
|
-
|
|
558
|
+
variant: "destructive",
|
|
559
|
+
className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
560
|
+
children: h
|
|
569
561
|
}
|
|
570
562
|
),
|
|
571
|
-
/* @__PURE__ */ t(
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
disabled: d,
|
|
576
|
-
className: "order-3 m-0 h-auto min-h-9 whitespace-normal px-4 py-2 text-center leading-5 sm:order-3",
|
|
577
|
-
children: d ? /* @__PURE__ */ s(O, { children: [
|
|
578
|
-
/* @__PURE__ */ t(H, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
579
|
-
"Saving..."
|
|
580
|
-
] }) : o
|
|
581
|
-
}
|
|
582
|
-
)
|
|
563
|
+
/* @__PURE__ */ t(I, { type: "button", onClick: p, disabled: d, children: d ? /* @__PURE__ */ s(O, { children: [
|
|
564
|
+
/* @__PURE__ */ t(j, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
565
|
+
"Saving..."
|
|
566
|
+
] }) : o })
|
|
583
567
|
] })
|
|
584
568
|
] }) });
|
|
585
569
|
}
|
|
586
|
-
function
|
|
587
|
-
|
|
588
|
-
e && !p && a && c(
|
|
570
|
+
function Pt(e, a, p, c) {
|
|
571
|
+
T(() => {
|
|
572
|
+
e && !p && a && c($e(a));
|
|
589
573
|
}, [e, p, a, c]);
|
|
590
574
|
}
|
|
591
|
-
function
|
|
575
|
+
function xt({
|
|
592
576
|
export: e,
|
|
593
577
|
onRemove: a
|
|
594
578
|
}) {
|
|
@@ -599,13 +583,13 @@ function Dt({
|
|
|
599
583
|
}, d = () => {
|
|
600
584
|
switch (e.status) {
|
|
601
585
|
case "completed":
|
|
602
|
-
return /* @__PURE__ */ t(
|
|
586
|
+
return /* @__PURE__ */ t(Ge, { className: "mt-0.5 h-5 w-5 shrink-0 text-green-600" });
|
|
603
587
|
case "failed":
|
|
604
|
-
return /* @__PURE__ */ t(
|
|
588
|
+
return /* @__PURE__ */ t(dt, { className: "mt-0.5 h-5 w-5 shrink-0 text-destructive" });
|
|
605
589
|
default:
|
|
606
|
-
return /* @__PURE__ */ t(
|
|
590
|
+
return /* @__PURE__ */ t(j, { className: "text-foreground-muted mt-0.5 h-5 w-5 shrink-0 animate-spin" });
|
|
607
591
|
}
|
|
608
|
-
}, u =
|
|
592
|
+
}, u = _(e.status), n = (() => {
|
|
609
593
|
switch (e.status) {
|
|
610
594
|
case "pending":
|
|
611
595
|
return "Queued...";
|
|
@@ -632,7 +616,7 @@ function Dt({
|
|
|
632
616
|
] }),
|
|
633
617
|
e.fileSize && /* @__PURE__ */ s(O, { children: [
|
|
634
618
|
/* @__PURE__ */ t("span", { children: "•" }),
|
|
635
|
-
/* @__PURE__ */ t("span", { children:
|
|
619
|
+
/* @__PURE__ */ t("span", { children: _e(e.fileSize) })
|
|
636
620
|
] })
|
|
637
621
|
] }),
|
|
638
622
|
u && /* @__PURE__ */ t("div", { className: "text-xs text-muted-foreground", children: n }),
|
|
@@ -647,7 +631,7 @@ function Dt({
|
|
|
647
631
|
className: "h-6 w-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100",
|
|
648
632
|
onClick: c,
|
|
649
633
|
"aria-label": "Remove notification",
|
|
650
|
-
children: /* @__PURE__ */ t(
|
|
634
|
+
children: /* @__PURE__ */ t(He, { className: "h-4 w-4" })
|
|
651
635
|
}
|
|
652
636
|
)
|
|
653
637
|
] }),
|
|
@@ -662,14 +646,14 @@ function Dt({
|
|
|
662
646
|
className: "h-8 bg-transparent",
|
|
663
647
|
onClick: p,
|
|
664
648
|
children: [
|
|
665
|
-
/* @__PURE__ */ t(
|
|
649
|
+
/* @__PURE__ */ t(je, { className: "mr-1.5 h-3.5 w-3.5" }),
|
|
666
650
|
"Download"
|
|
667
651
|
]
|
|
668
652
|
}
|
|
669
653
|
)
|
|
670
654
|
] }),
|
|
671
655
|
u && /* @__PURE__ */ s("div", { children: [
|
|
672
|
-
/* @__PURE__ */ t(
|
|
656
|
+
/* @__PURE__ */ t(Xe, { value: e.progress, className: "h-1.5" }),
|
|
673
657
|
/* @__PURE__ */ s("span", { className: "mt-1 block text-xs text-muted-foreground", children: [
|
|
674
658
|
e.progress,
|
|
675
659
|
"% complete"
|
|
@@ -679,33 +663,33 @@ function Dt({
|
|
|
679
663
|
] })
|
|
680
664
|
] });
|
|
681
665
|
}
|
|
682
|
-
function
|
|
683
|
-
const { authToken: e, tokenProps: a } = $(), p = U((f) => f.activeExports), { clearCompleted: c, removeExport: d, updateExport: u } = te(), [n, l] =
|
|
684
|
-
(f,
|
|
666
|
+
function Dt() {
|
|
667
|
+
const { authToken: e, tokenProps: a } = $(), p = U((f) => f.activeExports), { clearCompleted: c, removeExport: d, updateExport: u } = te(), [n, l] = F(!1), [h, o] = F(!1), v = Array.from(p.values()).sort(
|
|
668
|
+
(f, y) => y.startedAt.getTime() - f.startedAt.getTime()
|
|
685
669
|
), b = v.some(
|
|
686
670
|
(f) => f.status === "completed" || f.status === "failed"
|
|
687
|
-
),
|
|
688
|
-
const f = a == null ? void 0 : a.apiServiceUrl,
|
|
689
|
-
if (!(!f || !
|
|
671
|
+
), m = V(async () => {
|
|
672
|
+
const f = a == null ? void 0 : a.apiServiceUrl, y = e == null ? void 0 : e.accessToken;
|
|
673
|
+
if (!(!f || !y)) {
|
|
690
674
|
l(!0);
|
|
691
675
|
try {
|
|
692
676
|
const S = Array.from(p.values());
|
|
693
677
|
await Promise.all(
|
|
694
|
-
S.map(async (
|
|
678
|
+
S.map(async (w) => {
|
|
695
679
|
try {
|
|
696
|
-
const r = await ee(f,
|
|
680
|
+
const r = await ee(f, y, w.id);
|
|
697
681
|
let i;
|
|
698
682
|
if (r.status === "completed")
|
|
699
683
|
try {
|
|
700
|
-
i = await
|
|
684
|
+
i = await H(
|
|
701
685
|
f,
|
|
702
|
-
|
|
703
|
-
|
|
686
|
+
y,
|
|
687
|
+
w.id
|
|
704
688
|
);
|
|
705
689
|
} catch (g) {
|
|
706
|
-
console.error(`Failed to get download URL for ${
|
|
690
|
+
console.error(`Failed to get download URL for ${w.id}:`, g);
|
|
707
691
|
}
|
|
708
|
-
u(
|
|
692
|
+
u(w.id, {
|
|
709
693
|
status: r.status,
|
|
710
694
|
progress: r.progress,
|
|
711
695
|
completedChunks: r.completedChunks,
|
|
@@ -716,7 +700,7 @@ function At() {
|
|
|
716
700
|
downloadUrl: i
|
|
717
701
|
});
|
|
718
702
|
} catch (r) {
|
|
719
|
-
console.error(`Failed to refresh export ${
|
|
703
|
+
console.error(`Failed to refresh export ${w.id}:`, r);
|
|
720
704
|
}
|
|
721
705
|
})
|
|
722
706
|
);
|
|
@@ -729,9 +713,9 @@ function At() {
|
|
|
729
713
|
e == null ? void 0 : e.accessToken,
|
|
730
714
|
a == null ? void 0 : a.apiServiceUrl,
|
|
731
715
|
u
|
|
732
|
-
]),
|
|
733
|
-
const f = a == null ? void 0 : a.apiServiceUrl,
|
|
734
|
-
if (!f || !
|
|
716
|
+
]), C = V(async () => {
|
|
717
|
+
const f = a == null ? void 0 : a.apiServiceUrl, y = e == null ? void 0 : e.accessToken;
|
|
718
|
+
if (!f || !y) {
|
|
735
719
|
c();
|
|
736
720
|
return;
|
|
737
721
|
}
|
|
@@ -739,10 +723,10 @@ function At() {
|
|
|
739
723
|
try {
|
|
740
724
|
const S = v.filter(
|
|
741
725
|
(r) => r.status === "completed" || r.status === "failed"
|
|
742
|
-
),
|
|
743
|
-
S.map(async (r) => (await W(f,
|
|
726
|
+
), w = await Promise.allSettled(
|
|
727
|
+
S.map(async (r) => (await W(f, y, r.id), r.id))
|
|
744
728
|
);
|
|
745
|
-
for (const r of
|
|
729
|
+
for (const r of w)
|
|
746
730
|
r.status === "fulfilled" ? d(r.value) : console.error("Failed to delete export:", r.reason);
|
|
747
731
|
} finally {
|
|
748
732
|
o(!1);
|
|
@@ -753,15 +737,15 @@ function At() {
|
|
|
753
737
|
e == null ? void 0 : e.accessToken,
|
|
754
738
|
c,
|
|
755
739
|
d
|
|
756
|
-
]),
|
|
740
|
+
]), D = V(
|
|
757
741
|
async (f) => {
|
|
758
|
-
const
|
|
759
|
-
if (
|
|
742
|
+
const y = a == null ? void 0 : a.apiServiceUrl, S = e == null ? void 0 : e.accessToken;
|
|
743
|
+
if (y && S)
|
|
760
744
|
try {
|
|
761
|
-
await W(
|
|
745
|
+
await W(y, S, f), d(f);
|
|
762
746
|
return;
|
|
763
|
-
} catch (
|
|
764
|
-
console.error(`Failed to cancel export ${f}:`,
|
|
747
|
+
} catch (w) {
|
|
748
|
+
console.error(`Failed to cancel export ${f}:`, w);
|
|
765
749
|
}
|
|
766
750
|
d(f);
|
|
767
751
|
},
|
|
@@ -784,11 +768,11 @@ function At() {
|
|
|
784
768
|
variant: "ghost",
|
|
785
769
|
size: "sm",
|
|
786
770
|
className: "h-7 w-7 p-0",
|
|
787
|
-
onClick:
|
|
771
|
+
onClick: m,
|
|
788
772
|
disabled: n,
|
|
789
773
|
title: "Refresh status",
|
|
790
774
|
children: /* @__PURE__ */ t(
|
|
791
|
-
|
|
775
|
+
Ke,
|
|
792
776
|
{
|
|
793
777
|
className: `h-4 w-4 ${n ? "animate-spin" : ""}`
|
|
794
778
|
}
|
|
@@ -801,31 +785,31 @@ function At() {
|
|
|
801
785
|
variant: "ghost",
|
|
802
786
|
size: "sm",
|
|
803
787
|
className: "h-7 px-2 text-sm",
|
|
804
|
-
onClick:
|
|
805
|
-
disabled:
|
|
806
|
-
children:
|
|
788
|
+
onClick: C,
|
|
789
|
+
disabled: h,
|
|
790
|
+
children: h ? "Clearing..." : "Clear all"
|
|
807
791
|
}
|
|
808
792
|
)
|
|
809
793
|
] })
|
|
810
794
|
] }),
|
|
811
795
|
/* @__PURE__ */ t("div", { className: "max-h-[350px] overflow-y-auto", children: /* @__PURE__ */ t("div", { className: "divide-y", children: v.map((f) => /* @__PURE__ */ t(
|
|
812
|
-
|
|
796
|
+
xt,
|
|
813
797
|
{
|
|
814
798
|
export: f,
|
|
815
|
-
onRemove:
|
|
799
|
+
onRemove: D
|
|
816
800
|
},
|
|
817
801
|
f.id
|
|
818
802
|
)) }) })
|
|
819
803
|
] });
|
|
820
804
|
}
|
|
821
|
-
function
|
|
805
|
+
function Bt({
|
|
822
806
|
variant: e
|
|
823
807
|
}) {
|
|
824
|
-
const a = U((
|
|
825
|
-
(
|
|
808
|
+
const a = U((h) => h.activeExports), p = We(), c = a.size > 0, d = Array.from(a.values()).some(
|
|
809
|
+
(h) => h.status === "completed" || h.status === "failed"
|
|
826
810
|
), n = p > 0 ? p > 9 ? "9+" : String(p) : null;
|
|
827
|
-
return /* @__PURE__ */ s(
|
|
828
|
-
/* @__PURE__ */ t(
|
|
811
|
+
return /* @__PURE__ */ s(he, { children: [
|
|
812
|
+
/* @__PURE__ */ t(me, { asChild: !0, children: /* @__PURE__ */ s(
|
|
829
813
|
I,
|
|
830
814
|
{
|
|
831
815
|
variant: e ?? "ghost",
|
|
@@ -833,7 +817,7 @@ function zt({
|
|
|
833
817
|
className: "relative h-8 w-8",
|
|
834
818
|
"aria-label": "Export notifications",
|
|
835
819
|
children: [
|
|
836
|
-
/* @__PURE__ */ t(
|
|
820
|
+
/* @__PURE__ */ t(qe, { className: "h-4 w-4" }),
|
|
837
821
|
c && /* @__PURE__ */ t(
|
|
838
822
|
"span",
|
|
839
823
|
{
|
|
@@ -844,10 +828,10 @@ function zt({
|
|
|
844
828
|
]
|
|
845
829
|
}
|
|
846
830
|
) }),
|
|
847
|
-
/* @__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(Dt, {}) })
|
|
848
832
|
] });
|
|
849
833
|
}
|
|
850
|
-
function
|
|
834
|
+
function Nt(e) {
|
|
851
835
|
if (e)
|
|
852
836
|
return {
|
|
853
837
|
renamed: e.type === "rename" ? { oldId: e.oldId, newId: e.newId } : void 0,
|
|
@@ -856,7 +840,7 @@ function St(e) {
|
|
|
856
840
|
affectedBindingControlIds: e.type === "add" || e.type === "update" ? e.affectedBindingControlIds : void 0
|
|
857
841
|
};
|
|
858
842
|
}
|
|
859
|
-
function
|
|
843
|
+
function Ot({
|
|
860
844
|
open: e,
|
|
861
845
|
onOpenChange: a,
|
|
862
846
|
trigger: p,
|
|
@@ -866,52 +850,52 @@ function Rt({
|
|
|
866
850
|
const u = d === "create", {
|
|
867
851
|
forceClose: n,
|
|
868
852
|
handleOpenChange: l,
|
|
869
|
-
isCreateFlowActive:
|
|
853
|
+
isCreateFlowActive: h,
|
|
870
854
|
preventPassiveDismissDuringCreate: o,
|
|
871
855
|
resolvedOpen: v,
|
|
872
856
|
setIsCreateFlowActive: b
|
|
873
|
-
} =
|
|
857
|
+
} = ct({
|
|
874
858
|
open: e,
|
|
875
859
|
onOpenChange: a,
|
|
876
860
|
initialCreateFlowActive: d === "create"
|
|
877
|
-
}),
|
|
861
|
+
}), m = B((A) => A.dashboard), { setDashboardControlsModel: C } = X(), { participants: D } = Je(Qe(m)), f = Array.from(
|
|
878
862
|
new Map(
|
|
879
|
-
|
|
880
|
-
(A) => A.fieldChoices.map((
|
|
863
|
+
D.flatMap(
|
|
864
|
+
(A) => A.fieldChoices.map((x) => {
|
|
881
865
|
var k;
|
|
882
866
|
return [
|
|
883
|
-
|
|
867
|
+
x.value,
|
|
884
868
|
{
|
|
885
|
-
option:
|
|
886
|
-
target: (k = A.fieldTargetMap) == null ? void 0 : k[
|
|
869
|
+
option: x,
|
|
870
|
+
target: (k = A.fieldTargetMap) == null ? void 0 : k[x.value]
|
|
887
871
|
}
|
|
888
872
|
];
|
|
889
873
|
})
|
|
890
874
|
)
|
|
891
875
|
).values()
|
|
892
|
-
),
|
|
876
|
+
), y = Array.from(
|
|
893
877
|
new Map(
|
|
894
|
-
|
|
895
|
-
(A) => A.metricChoices.map((
|
|
878
|
+
D.flatMap(
|
|
879
|
+
(A) => A.metricChoices.map((x) => {
|
|
896
880
|
var k;
|
|
897
881
|
return [
|
|
898
|
-
|
|
882
|
+
x.value,
|
|
899
883
|
{
|
|
900
|
-
option:
|
|
901
|
-
target: (k = A.metricTargetMap) == null ? void 0 : k[
|
|
884
|
+
option: x,
|
|
885
|
+
target: (k = A.metricTargetMap) == null ? void 0 : k[x.value]
|
|
902
886
|
}
|
|
903
887
|
];
|
|
904
888
|
})
|
|
905
889
|
)
|
|
906
890
|
).values()
|
|
907
|
-
), S =
|
|
908
|
-
...
|
|
891
|
+
), S = Ye({
|
|
892
|
+
...m || {},
|
|
909
893
|
controls: []
|
|
910
|
-
}),
|
|
911
|
-
|
|
894
|
+
}), w = Ze(m), r = (A, x, k) => {
|
|
895
|
+
C(
|
|
912
896
|
A,
|
|
913
|
-
|
|
914
|
-
|
|
897
|
+
x,
|
|
898
|
+
Nt(k)
|
|
915
899
|
);
|
|
916
900
|
}, i = V(() => {
|
|
917
901
|
if (u) {
|
|
@@ -920,32 +904,32 @@ function Rt({
|
|
|
920
904
|
}
|
|
921
905
|
b(!1);
|
|
922
906
|
}, [u, n, b]), g = /* @__PURE__ */ t(
|
|
923
|
-
|
|
907
|
+
ut,
|
|
924
908
|
{
|
|
925
909
|
scope: "dashboard",
|
|
926
|
-
controls:
|
|
910
|
+
controls: m.controls || [],
|
|
927
911
|
reservedControlIds: S,
|
|
928
|
-
defaultValues:
|
|
929
|
-
usageByControlId:
|
|
912
|
+
defaultValues: m.defaultControlValues || {},
|
|
913
|
+
usageByControlId: et(m),
|
|
930
914
|
availableFieldChoices: f,
|
|
931
|
-
availableMetricChoices:
|
|
932
|
-
structuralParticipants:
|
|
933
|
-
structuralParticipantIdsByControlId:
|
|
915
|
+
availableMetricChoices: y,
|
|
916
|
+
structuralParticipants: D,
|
|
917
|
+
structuralParticipantIdsByControlId: w,
|
|
934
918
|
initialCreateFlow: d === "create",
|
|
935
919
|
onCreateFlowActiveChange: b,
|
|
936
920
|
onCreateFlowComplete: i,
|
|
937
921
|
onChange: r,
|
|
938
922
|
emptyMessage: "No dashboard controls yet."
|
|
939
923
|
}
|
|
940
|
-
), E =
|
|
924
|
+
), E = h ? "Add dashboard control" : "Dashboard Controls", N = /* @__PURE__ */ s(O, { children: [
|
|
941
925
|
/* @__PURE__ */ s("div", { className: "space-y-1", children: [
|
|
942
926
|
/* @__PURE__ */ t("h4", { className: "text-sm font-medium", children: "Dashboard Controls" }),
|
|
943
927
|
/* @__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." })
|
|
944
928
|
] }),
|
|
945
929
|
g
|
|
946
930
|
] });
|
|
947
|
-
return c ? /* @__PURE__ */ s(
|
|
948
|
-
/* @__PURE__ */ t(
|
|
931
|
+
return c ? /* @__PURE__ */ s(he, { open: v, onOpenChange: l, children: [
|
|
932
|
+
/* @__PURE__ */ t(me, { asChild: !0, children: p || /* @__PURE__ */ s(I, { variant: "outline", className: "h-7 px-2", size: "sm", children: [
|
|
949
933
|
/* @__PURE__ */ t(fe, { className: "mr-2 h-4 w-4" }),
|
|
950
934
|
"Controls"
|
|
951
935
|
] }) }),
|
|
@@ -956,24 +940,24 @@ function Rt({
|
|
|
956
940
|
align: "end",
|
|
957
941
|
onEscapeKeyDown: o,
|
|
958
942
|
onPointerDownOutside: o,
|
|
959
|
-
children:
|
|
943
|
+
children: N
|
|
960
944
|
}
|
|
961
945
|
)
|
|
962
946
|
] }) : /* @__PURE__ */ t(ae, { open: v, onOpenChange: l, children: /* @__PURE__ */ s(
|
|
963
947
|
se,
|
|
964
948
|
{
|
|
965
949
|
className: "flex max-h-[88vh] max-w-[980px] flex-col overflow-hidden",
|
|
966
|
-
showCloseButton: !
|
|
950
|
+
showCloseButton: !h,
|
|
967
951
|
onEscapeKeyDown: o,
|
|
968
952
|
onPointerDownOutside: o,
|
|
969
953
|
children: [
|
|
970
954
|
/* @__PURE__ */ s(
|
|
971
955
|
re,
|
|
972
956
|
{
|
|
973
|
-
className:
|
|
957
|
+
className: h ? "space-y-0" : void 0,
|
|
974
958
|
children: [
|
|
975
959
|
/* @__PURE__ */ t(oe, { children: E }),
|
|
976
|
-
/* @__PURE__ */ t(ne, { className:
|
|
960
|
+
/* @__PURE__ */ t(ne, { className: h ? "sr-only" : void 0, 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." })
|
|
977
961
|
]
|
|
978
962
|
}
|
|
979
963
|
),
|
|
@@ -982,7 +966,7 @@ function Rt({
|
|
|
982
966
|
}
|
|
983
967
|
) });
|
|
984
968
|
}
|
|
985
|
-
function
|
|
969
|
+
function zt({
|
|
986
970
|
showFilters: e,
|
|
987
971
|
onToggleFilters: a,
|
|
988
972
|
onAddFilter: p,
|
|
@@ -991,7 +975,7 @@ function $t({
|
|
|
991
975
|
size: u = "default",
|
|
992
976
|
className: n,
|
|
993
977
|
primaryButtonClassName: l,
|
|
994
|
-
secondaryButtonClassName:
|
|
978
|
+
secondaryButtonClassName: h,
|
|
995
979
|
dropdownContentClassName: o
|
|
996
980
|
}) {
|
|
997
981
|
const v = u === "toolbar";
|
|
@@ -1015,7 +999,7 @@ function $t({
|
|
|
1015
999
|
onClick: a,
|
|
1016
1000
|
size: "sm",
|
|
1017
1001
|
children: [
|
|
1018
|
-
e ? /* @__PURE__ */ t(
|
|
1002
|
+
e ? /* @__PURE__ */ t(ht, { className: "mr-2 h-4 w-4" }) : /* @__PURE__ */ t(q, { className: "mr-2 h-4 w-4" }),
|
|
1019
1003
|
"Filter"
|
|
1020
1004
|
]
|
|
1021
1005
|
}
|
|
@@ -1027,7 +1011,7 @@ function $t({
|
|
|
1027
1011
|
className: L(
|
|
1028
1012
|
v ? "h-8 w-8" : "h-7 w-8",
|
|
1029
1013
|
"rounded-none border-0 bg-transparent px-1 shadow-none hover:bg-accent/50",
|
|
1030
|
-
|
|
1014
|
+
h
|
|
1031
1015
|
),
|
|
1032
1016
|
variant: "ghost",
|
|
1033
1017
|
size: "sm",
|
|
@@ -1050,7 +1034,7 @@ function $t({
|
|
|
1050
1034
|
"Add control"
|
|
1051
1035
|
] }),
|
|
1052
1036
|
/* @__PURE__ */ s(M, { onSelect: d, children: [
|
|
1053
|
-
/* @__PURE__ */ t(
|
|
1037
|
+
/* @__PURE__ */ t(tt, { className: "mr-2 h-4 w-4" }),
|
|
1054
1038
|
"Manage controls"
|
|
1055
1039
|
] })
|
|
1056
1040
|
]
|
|
@@ -1062,15 +1046,15 @@ function $t({
|
|
|
1062
1046
|
);
|
|
1063
1047
|
}
|
|
1064
1048
|
export {
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1049
|
+
Mt as A,
|
|
1050
|
+
Ot as D,
|
|
1051
|
+
Dt as E,
|
|
1052
|
+
Bt as N,
|
|
1053
|
+
Vt as U,
|
|
1054
|
+
Ut as V,
|
|
1055
|
+
xt as a,
|
|
1056
|
+
kt as b,
|
|
1057
|
+
zt as c,
|
|
1058
|
+
Pt as d,
|
|
1059
|
+
Tt as u
|
|
1076
1060
|
};
|