react-semaphor 0.1.301 → 0.1.303
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/appearance/index.cjs +1 -0
- package/dist/appearance/index.js +9 -0
- package/dist/brand-studio/index.cjs +21 -0
- package/dist/brand-studio/index.js +1461 -0
- package/dist/chunks/dashboard-controls-BCJZOzrL.js +2226 -0
- package/dist/chunks/dashboard-controls-CVFoOPti.js +47 -0
- package/dist/chunks/dashboard-filter-controls-button-C-e7230k.js +11 -0
- package/dist/chunks/{dashboard-filter-controls-button-DjALRkvg.js → dashboard-filter-controls-button-Cfbac4Jw.js} +205 -216
- package/dist/chunks/dashboard-json-BM5ywMgp.js +1 -0
- package/dist/chunks/{dashboard-json-D-zIG46N.js → dashboard-json-BzvLPhGM.js} +14 -12
- package/dist/chunks/dashboard-summary-settings-dialog-BdxKl1UF.js +1 -0
- package/dist/chunks/{dashboard-summary-settings-dialog-D-F1eEJI.js → dashboard-summary-settings-dialog-ChK3344r.js} +64 -63
- package/dist/chunks/date-formatter-D9Bvw5Qk.js +1 -0
- package/dist/chunks/date-formatter-DyIOb6uC.js +333 -0
- package/dist/chunks/{edit-dashboard-visual-BjflrL8w.js → edit-dashboard-visual-D725CWD5.js} +6690 -6679
- package/dist/chunks/edit-dashboard-visual-nNaZ2IK1.js +183 -0
- package/dist/chunks/index-BWjB_9uz.js +1356 -0
- package/dist/chunks/index-CJdxSyQq.js +2578 -0
- package/dist/chunks/{index-DDA12yqV.js → index-CYWgnME0.js} +48994 -66425
- package/dist/chunks/index-D7KJindZ.js +1 -0
- package/dist/chunks/index-DFOb_6HB.js +1657 -0
- package/dist/chunks/index-DRlMUglg.js +4 -0
- package/dist/chunks/palette-B9DJXMGo.js +11 -0
- package/dist/chunks/palette-DGOzbtsn.js +43 -0
- package/dist/chunks/{resource-management-panel-B2558XA1.js → resource-management-panel-CE0-NcLL.js} +116 -115
- package/dist/chunks/resource-management-panel-mJmc5dMT.js +6 -0
- package/dist/chunks/rotate-ccw-Bs7YJn10.js +6 -0
- package/dist/chunks/rotate-ccw-YsjQwpKm.js +14 -0
- package/dist/chunks/save-Bj1y1rug.js +6 -0
- package/dist/chunks/save-CUrexoNl.js +21 -0
- package/dist/chunks/switch-CiEX68py.js +163 -0
- package/dist/chunks/switch-oojO-gal.js +19730 -0
- package/dist/chunks/{use-create-flow-overlay-state-BUw_JtLs.js → use-create-flow-overlay-state-BHDKxe7I.js} +396 -412
- package/dist/chunks/use-create-flow-overlay-state-D2I2wNey.js +16 -0
- package/dist/chunks/{use-visual-utils-C45OxsOf.js → use-visual-utils-CjFzlR0P.js} +54 -53
- package/dist/chunks/use-visual-utils-DYDXMl5v.js +1 -0
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/format-utils/index.cjs +1 -1
- package/dist/format-utils/index.js +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.js +210 -207
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/appearance.d.ts +176 -0
- package/dist/types/brand-studio.d.ts +245 -0
- package/dist/types/dashboard.d.ts +134 -0
- package/dist/types/main.d.ts +142 -1
- package/dist/types/surfboard.d.ts +134 -0
- package/dist/types/types.d.ts +139 -0
- package/package.json +13 -1
- package/dist/chunks/braces-Bhqo4iW1.js +0 -23
- package/dist/chunks/braces-BwK7fWd_.js +0 -6
- package/dist/chunks/dashboard-controls-BIRiWCUK.js +0 -47
- package/dist/chunks/dashboard-controls-DIlnYo96.js +0 -2219
- package/dist/chunks/dashboard-filter-controls-button-CK1-mKQh.js +0 -11
- package/dist/chunks/dashboard-json-DK4mQ1gS.js +0 -1
- package/dist/chunks/dashboard-summary-settings-dialog-DSxNqxFI.js +0 -1
- package/dist/chunks/date-formatter-CqXdM6JO.js +0 -1
- package/dist/chunks/date-formatter-vkCj9Ct-.js +0 -1982
- package/dist/chunks/edit-dashboard-visual-DCsrtJr_.js +0 -193
- package/dist/chunks/index-8GnvL1_L.js +0 -1523
- package/dist/chunks/resource-management-panel-CKp4_aem.js +0 -6
- package/dist/chunks/use-create-flow-overlay-state-CWcCdPbC.js +0 -21
- package/dist/chunks/use-visual-utils-DyaThRzf.js +0 -1
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import Se, { useState as T, useRef as X, useCallback as $, useEffect as
|
|
2
|
-
import {
|
|
1
|
+
import Se, { useState as T, useRef as X, useCallback as $, useEffect as O, useContext as Ae } from "react";
|
|
2
|
+
import { u as Q, ae as z, aZ as W, aV as le, aW as q, af as ce, aU as Ie, b as de, c as ue, d as me, e as he, f as pe, cg as Fe, o as Le, t as Te, v as ke, b8 as fe, ch as Pe, p as P, b9 as G, W as Ue, bN as ve, bO as ge, bQ as be, bR as R, bV as Ve, bE as Me, ci as Be, cj as Oe, c0 as ze, c1 as Re, c2 as $e, c3 as _e, c4 as je, c5 as He, c6 as Xe, a$ as Ge, ck as Qe, cl as We, bK as qe, aX as J, M as Ke, ah as Ze, cm as Ye, cn as Je, co as et, cp as tt, cq as at, cr as ee, cs as st } from "./index-CYWgnME0.js";
|
|
3
3
|
import { jsx as t, jsxs as s, Fragment as _ } from "react/jsx-runtime";
|
|
4
|
-
import {
|
|
5
|
-
import { u as
|
|
6
|
-
import {
|
|
4
|
+
import { c as xe, L as te, I as rt, B as I, f as K, n as H, u as B, m as Z, ag as ae, ae as ye, G as we, e as ot, l as nt, a as j, p as Y, X as it, P as Ce, b as Ne, d as De, ah as lt } from "./switch-oojO-gal.js";
|
|
5
|
+
import { V as ct, E as se, a as re, b as dt, c as ut, L as mt, d as ht, C as pt, u as ft, e as vt } from "./use-create-flow-overlay-state-BHDKxe7I.js";
|
|
6
|
+
import { u as Ee } from "./use-visual-utils-CjFzlR0P.js";
|
|
7
|
+
import { k as oe } from "./date-formatter-DyIOb6uC.js";
|
|
7
8
|
/**
|
|
8
9
|
* @license lucide-react v0.453.0 - ISC
|
|
9
10
|
*
|
|
10
11
|
* This source code is licensed under the ISC license.
|
|
11
12
|
* See the LICENSE file in the root directory of this source tree.
|
|
12
13
|
*/
|
|
13
|
-
const ne =
|
|
14
|
+
const ne = xe("FileDown", [
|
|
14
15
|
["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
|
|
15
16
|
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
|
|
16
17
|
["path", { d: "M12 18v-6", key: "17g6i2" }],
|
|
@@ -22,25 +23,25 @@ const ne = le("FileDown", [
|
|
|
22
23
|
* This source code is licensed under the ISC license.
|
|
23
24
|
* See the LICENSE file in the root directory of this source tree.
|
|
24
25
|
*/
|
|
25
|
-
const gt =
|
|
26
|
+
const gt = xe("FilterX", [
|
|
26
27
|
["path", { d: "M13.013 3H2l8 9.46V19l4 2v-8.54l.9-1.055", key: "1fi1da" }],
|
|
27
28
|
["path", { d: "m22 3-5 5", key: "12jva0" }],
|
|
28
29
|
["path", { d: "m17 3 5 5", key: "k36vhe" }]
|
|
29
30
|
]), bt = 1e4, xt = 15e3, yt = 3e4, wt = 3e4, Ct = 12e4, ie = 2 * 60 * 60 * 1e3;
|
|
30
|
-
function
|
|
31
|
+
function Nt(e) {
|
|
31
32
|
const a = Date.now() - e.getTime();
|
|
32
33
|
return a < wt ? bt : a < Ct ? xt : yt;
|
|
33
34
|
}
|
|
34
|
-
function
|
|
35
|
-
const { authToken: e, tokenProps: a } =
|
|
35
|
+
function Bt() {
|
|
36
|
+
const { authToken: e, tokenProps: a } = Q(), v = z((h) => h.activeExports), [l, n] = T(
|
|
36
37
|
typeof document < "u" ? !document.hidden : !0
|
|
37
|
-
),
|
|
38
|
+
), c = X(null), d = X(!1), m = X(void 0), i = a == null ? void 0 : a.apiServiceUrl, r = e == null ? void 0 : e.accessToken, p = $(() => {
|
|
38
39
|
const h = z.getState().activeExports;
|
|
39
40
|
return Array.from(h.values()).filter(
|
|
40
|
-
(y) =>
|
|
41
|
+
(y) => W(y.status)
|
|
41
42
|
);
|
|
42
43
|
}, []);
|
|
43
|
-
|
|
44
|
+
O(() => {
|
|
44
45
|
if (typeof document > "u") return;
|
|
45
46
|
const h = () => {
|
|
46
47
|
n(!document.hidden);
|
|
@@ -51,12 +52,12 @@ function Vt() {
|
|
|
51
52
|
}, []);
|
|
52
53
|
const b = $(async () => {
|
|
53
54
|
if (!i || !r) {
|
|
54
|
-
|
|
55
|
+
d.current = !1;
|
|
55
56
|
return;
|
|
56
57
|
}
|
|
57
58
|
const h = p();
|
|
58
59
|
if (h.length === 0) {
|
|
59
|
-
|
|
60
|
+
d.current = !1;
|
|
60
61
|
return;
|
|
61
62
|
}
|
|
62
63
|
const y = Date.now(), E = h.filter(
|
|
@@ -75,17 +76,17 @@ function Vt() {
|
|
|
75
76
|
(o) => y - o.startedAt.getTime() <= ie
|
|
76
77
|
);
|
|
77
78
|
if (f.length === 0) {
|
|
78
|
-
|
|
79
|
+
d.current = !1;
|
|
79
80
|
return;
|
|
80
81
|
}
|
|
81
82
|
const w = await Promise.allSettled(
|
|
82
83
|
f.map(async (o) => {
|
|
83
84
|
try {
|
|
84
|
-
const x = await
|
|
85
|
-
let
|
|
85
|
+
const x = await le(i, r, o.id);
|
|
86
|
+
let D;
|
|
86
87
|
if (x.status === "completed")
|
|
87
88
|
try {
|
|
88
|
-
|
|
89
|
+
D = await q(i, r, o.id);
|
|
89
90
|
} catch (F) {
|
|
90
91
|
console.error(
|
|
91
92
|
`[useExportPolling] Failed to get download URL for ${o.id}:`,
|
|
@@ -101,7 +102,7 @@ function Vt() {
|
|
|
101
102
|
lastUpdatedAt: /* @__PURE__ */ new Date(),
|
|
102
103
|
fileSize: x.fileSize,
|
|
103
104
|
error: x.error,
|
|
104
|
-
downloadUrl:
|
|
105
|
+
downloadUrl: D
|
|
105
106
|
};
|
|
106
107
|
} catch (x) {
|
|
107
108
|
return console.error(
|
|
@@ -116,42 +117,42 @@ function Vt() {
|
|
|
116
117
|
const C = p();
|
|
117
118
|
if (C.length > 0 && !document.hidden) {
|
|
118
119
|
const o = C.reduce(
|
|
119
|
-
(
|
|
120
|
+
(D, F) => F.startedAt < D ? F.startedAt : D,
|
|
120
121
|
C[0].startedAt
|
|
121
|
-
), x =
|
|
122
|
-
|
|
123
|
-
var
|
|
124
|
-
(
|
|
122
|
+
), x = Nt(o);
|
|
123
|
+
c.current && clearTimeout(c.current), c.current = setTimeout(() => {
|
|
124
|
+
var D;
|
|
125
|
+
(D = m.current) == null || D.call(m);
|
|
125
126
|
}, x);
|
|
126
127
|
} else
|
|
127
|
-
|
|
128
|
+
d.current = !1;
|
|
128
129
|
}, [i, r, p]);
|
|
129
|
-
return
|
|
130
|
+
return O(() => {
|
|
130
131
|
m.current = b;
|
|
131
|
-
}, [b]),
|
|
132
|
+
}, [b]), O(() => {
|
|
132
133
|
var y;
|
|
133
|
-
p().length > 0 && l && !
|
|
134
|
-
}, [v, l, p]),
|
|
134
|
+
p().length > 0 && l && !d.current && (d.current = !0, (y = m.current) == null || y.call(m));
|
|
135
|
+
}, [v, l, p]), O(() => {
|
|
135
136
|
var y;
|
|
136
137
|
const h = p();
|
|
137
|
-
l && h.length > 0 && !
|
|
138
|
-
}, [l, p]),
|
|
139
|
-
!l &&
|
|
140
|
-
}, [l]),
|
|
141
|
-
|
|
138
|
+
l && h.length > 0 && !d.current && (d.current = !0, (y = m.current) == null || y.call(m));
|
|
139
|
+
}, [l, p]), O(() => {
|
|
140
|
+
!l && c.current && (clearTimeout(c.current), c.current = null, d.current = !1);
|
|
141
|
+
}, [l]), O(() => () => {
|
|
142
|
+
c.current && (clearTimeout(c.current), c.current = null);
|
|
142
143
|
}, []), {
|
|
143
|
-
isPolling:
|
|
144
|
+
isPolling: d.current,
|
|
144
145
|
isTabVisible: l,
|
|
145
146
|
inProgressCount: p().length
|
|
146
147
|
};
|
|
147
148
|
}
|
|
148
149
|
function Ot() {
|
|
149
|
-
const { authToken: e, tokenProps: a } =
|
|
150
|
-
|
|
151
|
-
if (n.current || !
|
|
150
|
+
const { authToken: e, tokenProps: a } = Q(), v = z((m) => m.activeExports), { addExport: l } = ce(), n = X(!1), c = a == null ? void 0 : a.apiServiceUrl, d = e == null ? void 0 : e.accessToken;
|
|
151
|
+
O(() => {
|
|
152
|
+
if (n.current || !c || !d) return;
|
|
152
153
|
(async () => {
|
|
153
154
|
try {
|
|
154
|
-
const { exports: i } = await Ie(
|
|
155
|
+
const { exports: i } = await Ie(c, d, {
|
|
155
156
|
status: ["pending", "processing", "chunking", "compacting", "completed", "failed"],
|
|
156
157
|
limit: 20
|
|
157
158
|
// Limit to recent exports
|
|
@@ -162,7 +163,7 @@ function Ot() {
|
|
|
162
163
|
let b;
|
|
163
164
|
if (r.status === "completed")
|
|
164
165
|
try {
|
|
165
|
-
b = await
|
|
166
|
+
b = await q(c, d, r.id);
|
|
166
167
|
} catch (y) {
|
|
167
168
|
console.error(
|
|
168
169
|
`[useExportRecovery] Failed to get download URL for ${r.id}:`,
|
|
@@ -173,7 +174,7 @@ function Ot() {
|
|
|
173
174
|
id: r.id,
|
|
174
175
|
status: r.status,
|
|
175
176
|
progress: p,
|
|
176
|
-
title:
|
|
177
|
+
title: Dt(r),
|
|
177
178
|
totalRows: r.totalRows,
|
|
178
179
|
totalChunks: r.totalChunks,
|
|
179
180
|
completedChunks: r.completedChunks,
|
|
@@ -192,10 +193,10 @@ function Ot() {
|
|
|
192
193
|
console.error("[useExportRecovery] Failed to recover exports:", i), n.current = !0;
|
|
193
194
|
}
|
|
194
195
|
})();
|
|
195
|
-
}, [
|
|
196
|
+
}, [c, d, l, v]);
|
|
196
197
|
}
|
|
197
|
-
function
|
|
198
|
-
return e.title ? e.title :
|
|
198
|
+
function Dt(e) {
|
|
199
|
+
return e.title ? e.title : W(
|
|
199
200
|
e.status
|
|
200
201
|
) ? "Export in progress..." : e.status === "completed" ? "Export completed" : e.status === "failed" ? "Export failed" : "Export";
|
|
201
202
|
}
|
|
@@ -205,8 +206,8 @@ function Et({
|
|
|
205
206
|
isLibraryVisual: v,
|
|
206
207
|
currentVisualName: l,
|
|
207
208
|
isSaving: n = !1,
|
|
208
|
-
destinationMode:
|
|
209
|
-
onConfirm:
|
|
209
|
+
destinationMode: c = "both",
|
|
210
|
+
onConfirm: d
|
|
210
211
|
}) {
|
|
211
212
|
const [m, i] = T(
|
|
212
213
|
v && l ? `Copy of ${l}` : l || ""
|
|
@@ -216,13 +217,13 @@ function Et({
|
|
|
216
217
|
v && l ? `Copy of ${l}` : l || ""
|
|
217
218
|
), p(""));
|
|
218
219
|
}, [e, v, l]);
|
|
219
|
-
const b = !!m.trim(), h =
|
|
220
|
+
const b = !!m.trim(), h = c === "local" ? {
|
|
220
221
|
saveToLibrary: !1,
|
|
221
222
|
saveToCurrentDashboard: !0,
|
|
222
223
|
badgeType: "local",
|
|
223
224
|
description: "Creates a local copy on the current dashboard.",
|
|
224
225
|
actionLabel: "Add to Dashboard (Local)"
|
|
225
|
-
} :
|
|
226
|
+
} : c === "library" ? {
|
|
226
227
|
saveToLibrary: !0,
|
|
227
228
|
saveToCurrentDashboard: !1,
|
|
228
229
|
badgeType: "library",
|
|
@@ -235,19 +236,19 @@ function Et({
|
|
|
235
236
|
description: "Creates a new library visual and adds a linked copy to this dashboard.",
|
|
236
237
|
actionLabel: "Save Copy as Linked Visual"
|
|
237
238
|
}, y = () => {
|
|
238
|
-
!b || n ||
|
|
239
|
+
!b || n || d({
|
|
239
240
|
name: m.trim(),
|
|
240
241
|
description: r.trim() || void 0,
|
|
241
242
|
saveToLibrary: h.saveToLibrary,
|
|
242
243
|
saveToCurrentDashboard: h.saveToCurrentDashboard
|
|
243
244
|
});
|
|
244
245
|
};
|
|
245
|
-
return /* @__PURE__ */ t(
|
|
246
|
-
/* @__PURE__ */ s(
|
|
247
|
-
/* @__PURE__ */ s(
|
|
246
|
+
return /* @__PURE__ */ t(de, { open: e, onOpenChange: a, children: /* @__PURE__ */ s(ue, { className: "sm:max-w-[500px]", children: [
|
|
247
|
+
/* @__PURE__ */ s(me, { children: [
|
|
248
|
+
/* @__PURE__ */ s(he, { className: "flex items-center gap-2", children: [
|
|
248
249
|
/* @__PURE__ */ t("span", { children: "Save Visual As" }),
|
|
249
250
|
h.badgeType !== "local" && /* @__PURE__ */ t(
|
|
250
|
-
|
|
251
|
+
ct,
|
|
251
252
|
{
|
|
252
253
|
type: h.badgeType,
|
|
253
254
|
showLabel: !0,
|
|
@@ -255,13 +256,13 @@ function Et({
|
|
|
255
256
|
}
|
|
256
257
|
)
|
|
257
258
|
] }),
|
|
258
|
-
/* @__PURE__ */ t(
|
|
259
|
+
/* @__PURE__ */ t(pe, { children: h.description })
|
|
259
260
|
] }),
|
|
260
261
|
/* @__PURE__ */ s("div", { className: "grid gap-4 py-4", children: [
|
|
261
262
|
/* @__PURE__ */ s("div", { className: "grid gap-2", children: [
|
|
262
|
-
/* @__PURE__ */ t(
|
|
263
|
+
/* @__PURE__ */ t(te, { htmlFor: "name", children: "Name" }),
|
|
263
264
|
/* @__PURE__ */ t(
|
|
264
|
-
|
|
265
|
+
rt,
|
|
265
266
|
{
|
|
266
267
|
id: "name",
|
|
267
268
|
value: m,
|
|
@@ -272,9 +273,9 @@ function Et({
|
|
|
272
273
|
)
|
|
273
274
|
] }),
|
|
274
275
|
/* @__PURE__ */ s("div", { className: "grid gap-2", children: [
|
|
275
|
-
/* @__PURE__ */ t(
|
|
276
|
+
/* @__PURE__ */ t(te, { htmlFor: "description", children: "Description (optional)" }),
|
|
276
277
|
/* @__PURE__ */ t(
|
|
277
|
-
|
|
278
|
+
Fe,
|
|
278
279
|
{
|
|
279
280
|
id: "description",
|
|
280
281
|
value: r,
|
|
@@ -286,7 +287,7 @@ function Et({
|
|
|
286
287
|
)
|
|
287
288
|
] })
|
|
288
289
|
] }),
|
|
289
|
-
/* @__PURE__ */ s(
|
|
290
|
+
/* @__PURE__ */ s(Le, { children: [
|
|
290
291
|
/* @__PURE__ */ t(
|
|
291
292
|
I,
|
|
292
293
|
{
|
|
@@ -297,31 +298,31 @@ function Et({
|
|
|
297
298
|
}
|
|
298
299
|
),
|
|
299
300
|
/* @__PURE__ */ s(I, { onClick: y, disabled: !b || n, children: [
|
|
300
|
-
n && /* @__PURE__ */ t(
|
|
301
|
+
n && /* @__PURE__ */ t(K, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
301
302
|
h.actionLabel
|
|
302
303
|
] })
|
|
303
304
|
] })
|
|
304
305
|
] }) });
|
|
305
306
|
}
|
|
306
307
|
function St() {
|
|
307
|
-
const [e, a] = T(!1), [v, l] = T(!1), [n,
|
|
308
|
+
const [e, a] = T(!1), [v, l] = T(!1), [n, c] = T(null), [d, m] = T(null), i = H((u) => u.frame), r = H((u) => u.card), p = Te(), b = B((u) => u.selectedSheetId), h = B((u) => u.dashboard), y = B(
|
|
308
309
|
(u) => u.actions.setIsDashboardPanelOpen
|
|
309
|
-
), { getUpdatedFrame: E } = Ee(), { selectVisual: f } =
|
|
310
|
+
), { getUpdatedFrame: E } = Ee(), { selectVisual: f } = ke(), { addFrame: w, setSelectedFrameId: S, setIsVisualEditing: C } = Z(), o = fe(), x = !!(i != null && i.visualId), D = (() => {
|
|
310
311
|
var u, g;
|
|
311
312
|
return ((u = i == null ? void 0 : i.cards) == null ? void 0 : u.length) === 1 && ((g = i.cards[0]) != null && g.title) ? i.cards[0].title : p != null && p.title ? p.title : (r == null ? void 0 : r.title) || "Untitled Visual";
|
|
312
|
-
})(), F =
|
|
313
|
-
u != null && u.id && (f(u), v && n &&
|
|
313
|
+
})(), F = Pe((u) => {
|
|
314
|
+
u != null && u.id && (f(u), v && n && d && b && (async () => {
|
|
314
315
|
try {
|
|
315
316
|
const g = {
|
|
316
317
|
...n,
|
|
317
|
-
id:
|
|
318
|
+
id: ae(),
|
|
318
319
|
visualId: u.id
|
|
319
320
|
// Link to the newly created library visual
|
|
320
321
|
};
|
|
321
322
|
w(b, g, {
|
|
322
323
|
position: "end",
|
|
323
|
-
semanticExecutionPayload:
|
|
324
|
-
}), S(g.id), l(!1),
|
|
324
|
+
semanticExecutionPayload: d
|
|
325
|
+
}), S(g.id), l(!1), c(null), m(null), C(!1);
|
|
325
326
|
} catch (g) {
|
|
326
327
|
console.error(
|
|
327
328
|
"Failed to promote semantic metadata for saved visual:",
|
|
@@ -340,7 +341,7 @@ function St() {
|
|
|
340
341
|
P.error("No sheet selected");
|
|
341
342
|
return;
|
|
342
343
|
}
|
|
343
|
-
const g = E(), A =
|
|
344
|
+
const g = E(), A = ye(g);
|
|
344
345
|
if (A) {
|
|
345
346
|
P.error(A);
|
|
346
347
|
return;
|
|
@@ -360,135 +361,123 @@ function St() {
|
|
|
360
361
|
L = await o(k, {
|
|
361
362
|
previousFrame: G(h, k.id)
|
|
362
363
|
});
|
|
363
|
-
} catch (
|
|
364
|
+
} catch (M) {
|
|
364
365
|
console.error(
|
|
365
366
|
"Failed to prepare semantic metadata before saving visual:",
|
|
366
|
-
|
|
367
|
+
M
|
|
367
368
|
), P.error(
|
|
368
|
-
|
|
369
|
+
M instanceof Error ? M.message : "Failed to prepare semantic metadata for the saved visual"
|
|
369
370
|
);
|
|
370
371
|
return;
|
|
371
372
|
}
|
|
372
|
-
l(u.saveToCurrentDashboard),
|
|
373
|
-
const
|
|
373
|
+
l(u.saveToCurrentDashboard), c(k), m(L);
|
|
374
|
+
const V = {
|
|
374
375
|
title: u.name,
|
|
375
376
|
description: u.description,
|
|
376
377
|
frameObject: k,
|
|
377
378
|
// Card title synced for single-card frames
|
|
378
379
|
isPrivate: !1
|
|
379
380
|
};
|
|
380
|
-
F.mutate(
|
|
381
|
+
F.mutate(V);
|
|
381
382
|
} else if (u.saveToCurrentDashboard) {
|
|
382
383
|
const L = {
|
|
383
384
|
...k,
|
|
384
385
|
// Card title already synced
|
|
385
|
-
id:
|
|
386
|
+
id: ae(),
|
|
386
387
|
visualId: void 0
|
|
387
388
|
// Explicitly no visualId for local visuals
|
|
388
389
|
};
|
|
389
390
|
try {
|
|
390
|
-
const
|
|
391
|
+
const V = await o(k, {
|
|
391
392
|
previousFrame: G(h, k.id)
|
|
392
393
|
});
|
|
393
394
|
w(b, L, {
|
|
394
395
|
position: "end",
|
|
395
|
-
semanticExecutionPayload:
|
|
396
|
+
semanticExecutionPayload: V
|
|
396
397
|
}), S(L.id), P.success("Visual saved to dashboard"), a(!1), C(!1);
|
|
397
|
-
} catch (
|
|
398
|
-
console.error("Failed to save visual to dashboard:",
|
|
399
|
-
|
|
398
|
+
} catch (V) {
|
|
399
|
+
console.error("Failed to save visual to dashboard:", V), P.error(
|
|
400
|
+
V instanceof Error ? V.message : "Failed to prepare semantic metadata for the visual"
|
|
400
401
|
);
|
|
401
402
|
}
|
|
402
403
|
}
|
|
403
404
|
},
|
|
404
405
|
isLibraryVisual: x,
|
|
405
|
-
currentVisualName:
|
|
406
|
+
currentVisualName: D,
|
|
406
407
|
isSaving: F.isPending
|
|
407
408
|
};
|
|
408
409
|
}
|
|
409
|
-
function
|
|
410
|
-
const a =
|
|
410
|
+
function zt(e = {}) {
|
|
411
|
+
const a = H((N) => N.frame), v = H((N) => N.editorContext), l = Ue((N) => N.selectedVisual), n = B((N) => N.selectedFrameId), c = B((N) => N.selectedSheetId), d = B((N) => N.dashboard), { setIsVisualEditing: m, updateFrame: i } = Z(), [r, p] = T(!1), [b, h] = T("both"), y = fe(), 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
412
|
saveAsDialogOpen: C,
|
|
412
413
|
setSaveAsDialogOpen: o,
|
|
413
414
|
handleSaveAs: x,
|
|
414
|
-
isLibraryVisual:
|
|
415
|
+
isLibraryVisual: D,
|
|
415
416
|
currentVisualName: F,
|
|
416
417
|
isSaving: U
|
|
417
418
|
} = St(), { getUpdatedFrame: u } = Ee();
|
|
418
419
|
if (E)
|
|
419
420
|
return /* @__PURE__ */ s(_, { children: [
|
|
420
|
-
/* @__PURE__ */ t(se, { className: "rounded-
|
|
421
|
+
/* @__PURE__ */ t(se, { className: "rounded-control", variant: "default" }),
|
|
421
422
|
/* @__PURE__ */ t(re, {})
|
|
422
423
|
] });
|
|
423
424
|
const g = async () => {
|
|
424
|
-
if (!
|
|
425
|
+
if (!c) {
|
|
425
426
|
P.error("No sheet selected");
|
|
426
427
|
return;
|
|
427
428
|
}
|
|
428
429
|
if (r) return;
|
|
429
430
|
p(!0);
|
|
430
|
-
const
|
|
431
|
+
const N = u(), k = ye(N);
|
|
431
432
|
if (k) {
|
|
432
433
|
p(!1), P.error(k);
|
|
433
434
|
return;
|
|
434
435
|
}
|
|
435
436
|
const L = {
|
|
436
|
-
...
|
|
437
|
+
...N,
|
|
437
438
|
visualId: void 0
|
|
438
|
-
},
|
|
439
|
+
}, V = G(d, L.id);
|
|
439
440
|
try {
|
|
440
|
-
const
|
|
441
|
-
previousFrame:
|
|
441
|
+
const M = await y(L, {
|
|
442
|
+
previousFrame: V
|
|
442
443
|
});
|
|
443
|
-
i(
|
|
444
|
-
semanticExecutionPayload:
|
|
444
|
+
i(c, L, {
|
|
445
|
+
semanticExecutionPayload: M
|
|
445
446
|
});
|
|
446
|
-
} catch (
|
|
447
|
-
console.error("Failed to apply local semantic metadata:",
|
|
448
|
-
|
|
447
|
+
} catch (M) {
|
|
448
|
+
console.error("Failed to apply local semantic metadata:", M), p(!1), P.error(
|
|
449
|
+
M instanceof Error ? M.message : "Failed to prepare semantic metadata for this visual"
|
|
449
450
|
);
|
|
450
451
|
return;
|
|
451
452
|
}
|
|
452
453
|
setTimeout(() => {
|
|
453
454
|
p(!1), P.success("Changes applied. Visual is now local to this dashboard"), m(!1);
|
|
454
455
|
}, 300);
|
|
455
|
-
}, A = (
|
|
456
|
-
h(
|
|
456
|
+
}, A = (N) => {
|
|
457
|
+
h(N), o(!0);
|
|
457
458
|
};
|
|
458
459
|
return /* @__PURE__ */ s(_, { children: [
|
|
459
|
-
/* @__PURE__ */ s("div", { className: "inline-flex items-center overflow-hidden rounded-
|
|
460
|
-
!f && /* @__PURE__ */ t(
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
}
|
|
466
|
-
),
|
|
467
|
-
f && S && /* @__PURE__ */ t(
|
|
468
|
-
ct,
|
|
469
|
-
{
|
|
470
|
-
className: "rounded-none",
|
|
471
|
-
variant: "default"
|
|
472
|
-
}
|
|
473
|
-
),
|
|
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(
|
|
460
|
+
/* @__PURE__ */ s("div", { className: "inline-flex items-center overflow-hidden rounded-control", children: [
|
|
461
|
+
!f && /* @__PURE__ */ t(se, { className: "!rounded-none", variant: "default" }),
|
|
462
|
+
f && S && /* @__PURE__ */ t(dt, { className: "!rounded-none", variant: "default" }),
|
|
463
|
+
f && w && /* @__PURE__ */ t(ut, { className: "!rounded-none" }),
|
|
464
|
+
/* @__PURE__ */ s(ve, { modal: !1, children: [
|
|
465
|
+
/* @__PURE__ */ t(ge, { asChild: !0, children: /* @__PURE__ */ t(
|
|
477
466
|
I,
|
|
478
467
|
{
|
|
479
468
|
variant: "default",
|
|
480
469
|
size: "xs",
|
|
481
|
-
className: "w-7 rounded-none border-l border-primary-foreground/20 px-0",
|
|
470
|
+
className: "w-7 !rounded-none border-l border-primary-foreground/20 px-0",
|
|
482
471
|
"aria-label": "Open visual save options",
|
|
483
472
|
disabled: U || r,
|
|
484
|
-
children: /* @__PURE__ */ t(
|
|
473
|
+
children: /* @__PURE__ */ t(we, { className: "h-3.5 w-3.5" })
|
|
485
474
|
}
|
|
486
475
|
) }),
|
|
487
476
|
/* @__PURE__ */ s(
|
|
488
|
-
|
|
477
|
+
be,
|
|
489
478
|
{
|
|
490
479
|
align: "end",
|
|
491
|
-
className: "min-w-[220px] rounded-
|
|
480
|
+
className: "min-w-[220px] rounded-control border border-border/60 p-1 shadow-sm",
|
|
492
481
|
children: [
|
|
493
482
|
w && /* @__PURE__ */ s(_, { children: [
|
|
494
483
|
/* @__PURE__ */ s(
|
|
@@ -497,12 +486,12 @@ function Bt(e = {}) {
|
|
|
497
486
|
onClick: g,
|
|
498
487
|
disabled: r,
|
|
499
488
|
children: [
|
|
500
|
-
/* @__PURE__ */ t(
|
|
489
|
+
/* @__PURE__ */ t(ot, { className: "h-3.5 w-3.5" }),
|
|
501
490
|
r ? "Applying..." : "Apply Locally"
|
|
502
491
|
]
|
|
503
492
|
}
|
|
504
493
|
),
|
|
505
|
-
/* @__PURE__ */ t(
|
|
494
|
+
/* @__PURE__ */ t(Ve, {})
|
|
506
495
|
] }),
|
|
507
496
|
/* @__PURE__ */ s(
|
|
508
497
|
R,
|
|
@@ -510,7 +499,7 @@ function Bt(e = {}) {
|
|
|
510
499
|
onClick: () => A("local"),
|
|
511
500
|
disabled: U,
|
|
512
501
|
children: [
|
|
513
|
-
/* @__PURE__ */ t(
|
|
502
|
+
/* @__PURE__ */ t(Me, { className: "h-3.5 w-3.5" }),
|
|
514
503
|
"Add to Dashboard (Local)"
|
|
515
504
|
]
|
|
516
505
|
}
|
|
@@ -547,10 +536,10 @@ function Bt(e = {}) {
|
|
|
547
536
|
Et,
|
|
548
537
|
{
|
|
549
538
|
open: C,
|
|
550
|
-
onOpenChange: (
|
|
551
|
-
U || o(
|
|
539
|
+
onOpenChange: (N) => {
|
|
540
|
+
U || o(N);
|
|
552
541
|
},
|
|
553
|
-
isLibraryVisual:
|
|
542
|
+
isLibraryVisual: D,
|
|
554
543
|
currentVisualName: F,
|
|
555
544
|
isSaving: U,
|
|
556
545
|
destinationMode: b,
|
|
@@ -559,11 +548,11 @@ function Bt(e = {}) {
|
|
|
559
548
|
)
|
|
560
549
|
] });
|
|
561
550
|
}
|
|
562
|
-
function
|
|
563
|
-
const a =
|
|
564
|
-
if (!v || !
|
|
551
|
+
function Rt({ className: e }) {
|
|
552
|
+
const a = H((r) => r.isDevMode), v = B((r) => r.isVisualEditing), { setIsDevMode: l } = nt(), { config: n } = Ae(Be).tokenProps, c = (n == null ? void 0 : n.showAdvancedMode) !== !1;
|
|
553
|
+
if (!v || !c)
|
|
565
554
|
return null;
|
|
566
|
-
const
|
|
555
|
+
const d = a ? Y : Oe, m = a ? "Drag & drop" : "SQL", i = a ? "Switch to drag-and-drop mode" : "Switch to SQL mode";
|
|
567
556
|
return /* @__PURE__ */ s(
|
|
568
557
|
"button",
|
|
569
558
|
{
|
|
@@ -571,37 +560,37 @@ function zt({ className: e }) {
|
|
|
571
560
|
"aria-label": i,
|
|
572
561
|
title: i,
|
|
573
562
|
onClick: () => l(!a),
|
|
574
|
-
className:
|
|
575
|
-
"inline-flex h-7 items-center gap-1.5 rounded-
|
|
563
|
+
className: j(
|
|
564
|
+
"inline-flex h-7 items-center gap-1.5 rounded-control border border-input bg-background px-2 text-[12px] font-medium text-foreground transition-colors hover:bg-muted/40 focus-visible:border-ring focus-visible:outline-none",
|
|
576
565
|
e
|
|
577
566
|
),
|
|
578
567
|
children: [
|
|
579
|
-
/* @__PURE__ */ t(
|
|
568
|
+
/* @__PURE__ */ t(d, { className: "h-3 w-3 text-muted-foreground" }),
|
|
580
569
|
m
|
|
581
570
|
]
|
|
582
571
|
}
|
|
583
572
|
);
|
|
584
573
|
}
|
|
585
|
-
function
|
|
574
|
+
function $t({
|
|
586
575
|
open: e,
|
|
587
576
|
onOpenChange: a,
|
|
588
577
|
onSave: v,
|
|
589
578
|
onDiscard: l,
|
|
590
579
|
isSaving: n,
|
|
591
|
-
title:
|
|
592
|
-
description:
|
|
580
|
+
title: c = "Unsaved changes",
|
|
581
|
+
description: d = "You have unsaved changes to this dashboard. What would you like to do?",
|
|
593
582
|
cancelLabel: m = "Cancel",
|
|
594
583
|
discardLabel: i = "Discard",
|
|
595
584
|
saveLabel: r = "Save"
|
|
596
585
|
}) {
|
|
597
|
-
return /* @__PURE__ */ t(
|
|
586
|
+
return /* @__PURE__ */ t(ze, { open: e, onOpenChange: (b) => {
|
|
598
587
|
!b && n || a(b);
|
|
599
|
-
}, children: /* @__PURE__ */ s(
|
|
600
|
-
/* @__PURE__ */ s(
|
|
601
|
-
/* @__PURE__ */ t(
|
|
602
|
-
/* @__PURE__ */ t(
|
|
588
|
+
}, children: /* @__PURE__ */ s(Re, { children: [
|
|
589
|
+
/* @__PURE__ */ s($e, { children: [
|
|
590
|
+
/* @__PURE__ */ t(_e, { children: c }),
|
|
591
|
+
/* @__PURE__ */ t(je, { children: d })
|
|
603
592
|
] }),
|
|
604
|
-
/* @__PURE__ */ s(
|
|
593
|
+
/* @__PURE__ */ s(He, { children: [
|
|
605
594
|
/* @__PURE__ */ t(
|
|
606
595
|
I,
|
|
607
596
|
{
|
|
@@ -614,9 +603,9 @@ function Rt({
|
|
|
614
603
|
children: i
|
|
615
604
|
}
|
|
616
605
|
),
|
|
617
|
-
/* @__PURE__ */ t(
|
|
606
|
+
/* @__PURE__ */ t(Xe, { disabled: n, children: m }),
|
|
618
607
|
/* @__PURE__ */ t(I, { type: "button", size: "xs", onClick: v, disabled: n, children: n ? /* @__PURE__ */ s(_, { children: [
|
|
619
|
-
/* @__PURE__ */ t(
|
|
608
|
+
/* @__PURE__ */ t(K, { className: "mr-2 h-3.5 w-3.5 animate-spin" }),
|
|
620
609
|
"Saving..."
|
|
621
610
|
] }) : r })
|
|
622
611
|
] })
|
|
@@ -633,13 +622,13 @@ function At({
|
|
|
633
622
|
}, n = () => {
|
|
634
623
|
switch (e.status) {
|
|
635
624
|
case "completed":
|
|
636
|
-
return /* @__PURE__ */ t(
|
|
625
|
+
return /* @__PURE__ */ t(qe, { className: "mt-0.5 h-5 w-5 shrink-0 text-green-600" });
|
|
637
626
|
case "failed":
|
|
638
627
|
return /* @__PURE__ */ t(pt, { className: "mt-0.5 h-5 w-5 shrink-0 text-destructive" });
|
|
639
628
|
default:
|
|
640
|
-
return /* @__PURE__ */ t(
|
|
629
|
+
return /* @__PURE__ */ t(K, { className: "text-foreground-muted mt-0.5 h-5 w-5 shrink-0 animate-spin" });
|
|
641
630
|
}
|
|
642
|
-
},
|
|
631
|
+
}, c = W(e.status), d = (() => {
|
|
643
632
|
switch (e.status) {
|
|
644
633
|
case "pending":
|
|
645
634
|
return "Queued...";
|
|
@@ -666,10 +655,10 @@ function At({
|
|
|
666
655
|
] }),
|
|
667
656
|
e.fileSize && /* @__PURE__ */ s(_, { children: [
|
|
668
657
|
/* @__PURE__ */ t("span", { children: "•" }),
|
|
669
|
-
/* @__PURE__ */ t("span", { children:
|
|
658
|
+
/* @__PURE__ */ t("span", { children: Ge(e.fileSize) })
|
|
670
659
|
] })
|
|
671
660
|
] }),
|
|
672
|
-
|
|
661
|
+
c && /* @__PURE__ */ t("div", { className: "text-xs text-muted-foreground", children: d }),
|
|
673
662
|
e.status === "failed" && /* @__PURE__ */ t("div", { className: "line-clamp-2 text-xs text-destructive", children: e.error || "Export failed" })
|
|
674
663
|
] })
|
|
675
664
|
] }),
|
|
@@ -681,7 +670,7 @@ function At({
|
|
|
681
670
|
className: "h-6 w-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100",
|
|
682
671
|
onClick: l,
|
|
683
672
|
"aria-label": "Remove notification",
|
|
684
|
-
children: /* @__PURE__ */ t(
|
|
673
|
+
children: /* @__PURE__ */ t(it, { className: "h-4 w-4" })
|
|
685
674
|
}
|
|
686
675
|
)
|
|
687
676
|
] }),
|
|
@@ -696,14 +685,14 @@ function At({
|
|
|
696
685
|
className: "h-8 bg-transparent",
|
|
697
686
|
onClick: v,
|
|
698
687
|
children: [
|
|
699
|
-
/* @__PURE__ */ t(
|
|
688
|
+
/* @__PURE__ */ t(Qe, { className: "mr-1.5 h-3.5 w-3.5" }),
|
|
700
689
|
"Download"
|
|
701
690
|
]
|
|
702
691
|
}
|
|
703
692
|
)
|
|
704
693
|
] }),
|
|
705
|
-
|
|
706
|
-
/* @__PURE__ */ t(
|
|
694
|
+
c && /* @__PURE__ */ s("div", { children: [
|
|
695
|
+
/* @__PURE__ */ t(We, { value: e.progress, className: "h-1.5" }),
|
|
707
696
|
/* @__PURE__ */ s("span", { className: "mt-1 block text-xs text-muted-foreground", children: [
|
|
708
697
|
e.progress,
|
|
709
698
|
"% complete"
|
|
@@ -714,7 +703,7 @@ function At({
|
|
|
714
703
|
] });
|
|
715
704
|
}
|
|
716
705
|
function It() {
|
|
717
|
-
const { authToken: e, tokenProps: a } =
|
|
706
|
+
const { authToken: e, tokenProps: a } = Q(), v = z((f) => f.activeExports), { clearCompleted: l, removeExport: n, updateExport: c } = ce(), [d, m] = T(!1), [i, r] = T(!1), p = Array.from(v.values()).sort(
|
|
718
707
|
(f, w) => w.startedAt.getTime() - f.startedAt.getTime()
|
|
719
708
|
), b = p.some(
|
|
720
709
|
(f) => f.status === "completed" || f.status === "failed"
|
|
@@ -727,19 +716,19 @@ function It() {
|
|
|
727
716
|
await Promise.all(
|
|
728
717
|
S.map(async (C) => {
|
|
729
718
|
try {
|
|
730
|
-
const o = await
|
|
719
|
+
const o = await le(f, w, C.id);
|
|
731
720
|
let x;
|
|
732
721
|
if (o.status === "completed")
|
|
733
722
|
try {
|
|
734
|
-
x = await
|
|
723
|
+
x = await q(
|
|
735
724
|
f,
|
|
736
725
|
w,
|
|
737
726
|
C.id
|
|
738
727
|
);
|
|
739
|
-
} catch (
|
|
740
|
-
console.error(`Failed to get download URL for ${C.id}:`,
|
|
728
|
+
} catch (D) {
|
|
729
|
+
console.error(`Failed to get download URL for ${C.id}:`, D);
|
|
741
730
|
}
|
|
742
|
-
|
|
731
|
+
c(C.id, {
|
|
743
732
|
status: o.status,
|
|
744
733
|
progress: o.progress,
|
|
745
734
|
completedChunks: o.completedChunks,
|
|
@@ -762,7 +751,7 @@ function It() {
|
|
|
762
751
|
v,
|
|
763
752
|
e == null ? void 0 : e.accessToken,
|
|
764
753
|
a == null ? void 0 : a.apiServiceUrl,
|
|
765
|
-
|
|
754
|
+
c
|
|
766
755
|
]), y = $(async () => {
|
|
767
756
|
const f = a == null ? void 0 : a.apiServiceUrl, w = e == null ? void 0 : e.accessToken;
|
|
768
757
|
if (!f || !w) {
|
|
@@ -774,7 +763,7 @@ function It() {
|
|
|
774
763
|
const S = p.filter(
|
|
775
764
|
(o) => o.status === "completed" || o.status === "failed"
|
|
776
765
|
), C = await Promise.allSettled(
|
|
777
|
-
S.map(async (o) => (await
|
|
766
|
+
S.map(async (o) => (await J(f, w, o.id), o.id))
|
|
778
767
|
);
|
|
779
768
|
for (const o of C)
|
|
780
769
|
o.status === "fulfilled" ? n(o.value) : console.error("Failed to delete export:", o.reason);
|
|
@@ -792,7 +781,7 @@ function It() {
|
|
|
792
781
|
const w = a == null ? void 0 : a.apiServiceUrl, S = e == null ? void 0 : e.accessToken;
|
|
793
782
|
if (w && S)
|
|
794
783
|
try {
|
|
795
|
-
await
|
|
784
|
+
await J(w, S, f), n(f);
|
|
796
785
|
return;
|
|
797
786
|
} catch (C) {
|
|
798
787
|
console.error(`Failed to cancel export ${f}:`, C);
|
|
@@ -819,12 +808,12 @@ function It() {
|
|
|
819
808
|
size: "sm",
|
|
820
809
|
className: "h-7 w-7 p-0",
|
|
821
810
|
onClick: h,
|
|
822
|
-
disabled:
|
|
811
|
+
disabled: d,
|
|
823
812
|
title: "Refresh status",
|
|
824
813
|
children: /* @__PURE__ */ t(
|
|
825
|
-
|
|
814
|
+
Ke,
|
|
826
815
|
{
|
|
827
|
-
className: `h-4 w-4 ${
|
|
816
|
+
className: `h-4 w-4 ${d ? "animate-spin" : ""}`
|
|
828
817
|
}
|
|
829
818
|
)
|
|
830
819
|
}
|
|
@@ -852,14 +841,14 @@ function It() {
|
|
|
852
841
|
)) }) })
|
|
853
842
|
] });
|
|
854
843
|
}
|
|
855
|
-
function
|
|
844
|
+
function _t({
|
|
856
845
|
variant: e
|
|
857
846
|
}) {
|
|
858
|
-
const a = z((i) => i.activeExports), v =
|
|
847
|
+
const a = z((i) => i.activeExports), v = Ze(), l = a.size > 0, n = Array.from(a.values()).some(
|
|
859
848
|
(i) => i.status === "completed" || i.status === "failed"
|
|
860
|
-
),
|
|
849
|
+
), d = v > 0 ? v > 9 ? "9+" : String(v) : null;
|
|
861
850
|
return /* @__PURE__ */ s(Ce, { children: [
|
|
862
|
-
/* @__PURE__ */ t(
|
|
851
|
+
/* @__PURE__ */ t(Ne, { asChild: !0, children: /* @__PURE__ */ s(
|
|
863
852
|
I,
|
|
864
853
|
{
|
|
865
854
|
variant: e ?? "ghost",
|
|
@@ -867,18 +856,18 @@ function $t({
|
|
|
867
856
|
className: "relative w-7 px-0 text-muted-foreground hover:text-foreground",
|
|
868
857
|
"aria-label": "Export notifications",
|
|
869
858
|
children: [
|
|
870
|
-
/* @__PURE__ */ t(
|
|
859
|
+
/* @__PURE__ */ t(Ye, { className: "h-3.5 w-3.5" }),
|
|
871
860
|
l && /* @__PURE__ */ t(
|
|
872
861
|
"span",
|
|
873
862
|
{
|
|
874
|
-
className: `absolute flex items-center justify-center rounded-full bg-primary text-primary-foreground ${
|
|
875
|
-
children:
|
|
863
|
+
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"}`,
|
|
864
|
+
children: d
|
|
876
865
|
}
|
|
877
866
|
)
|
|
878
867
|
]
|
|
879
868
|
}
|
|
880
869
|
) }),
|
|
881
|
-
/* @__PURE__ */ t(
|
|
870
|
+
/* @__PURE__ */ t(De, { className: "w-80 p-0", align: "end", sideOffset: 8, children: /* @__PURE__ */ t(It, {}) })
|
|
882
871
|
] });
|
|
883
872
|
}
|
|
884
873
|
function Ft(e) {
|
|
@@ -890,15 +879,15 @@ function Ft(e) {
|
|
|
890
879
|
affectedBindingControlIds: e.type === "add" || e.type === "update" ? e.affectedBindingControlIds : void 0
|
|
891
880
|
};
|
|
892
881
|
}
|
|
893
|
-
function
|
|
882
|
+
function jt({
|
|
894
883
|
open: e,
|
|
895
884
|
onOpenChange: a,
|
|
896
885
|
trigger: v,
|
|
897
886
|
showTrigger: l = !0,
|
|
898
887
|
initialMode: n = "manage"
|
|
899
888
|
}) {
|
|
900
|
-
const
|
|
901
|
-
forceClose:
|
|
889
|
+
const c = n === "create", {
|
|
890
|
+
forceClose: d,
|
|
902
891
|
handleOpenChange: m,
|
|
903
892
|
isCreateFlowActive: i,
|
|
904
893
|
preventPassiveDismissDuringCreate: r,
|
|
@@ -915,7 +904,7 @@ function _t({
|
|
|
915
904
|
// create and make consumers use `forceClose()` from a dedicated
|
|
916
905
|
// button.
|
|
917
906
|
dismissMode: l ? "passive" : "explicit-only"
|
|
918
|
-
}), h =
|
|
907
|
+
}), h = B((u) => u.dashboard), { setDashboardControlsModel: y } = Z(), { participants: E } = Je(lt(h)), f = Array.from(
|
|
919
908
|
new Map(
|
|
920
909
|
E.flatMap(
|
|
921
910
|
(u) => u.fieldChoices.map((g) => {
|
|
@@ -945,29 +934,29 @@ function _t({
|
|
|
945
934
|
})
|
|
946
935
|
)
|
|
947
936
|
).values()
|
|
948
|
-
), S =
|
|
937
|
+
), S = et({
|
|
949
938
|
...h || {},
|
|
950
939
|
controls: []
|
|
951
|
-
}), C =
|
|
940
|
+
}), C = tt(h), o = (u, g, A) => {
|
|
952
941
|
y(
|
|
953
942
|
u,
|
|
954
943
|
g,
|
|
955
944
|
Ft(A)
|
|
956
945
|
);
|
|
957
946
|
}, x = $(() => {
|
|
958
|
-
if (
|
|
959
|
-
|
|
947
|
+
if (c) {
|
|
948
|
+
d();
|
|
960
949
|
return;
|
|
961
950
|
}
|
|
962
951
|
b(!1);
|
|
963
|
-
}, [
|
|
952
|
+
}, [c, d, b]), D = /* @__PURE__ */ t(
|
|
964
953
|
vt,
|
|
965
954
|
{
|
|
966
955
|
scope: "dashboard",
|
|
967
956
|
controls: h.controls || [],
|
|
968
957
|
reservedControlIds: S,
|
|
969
958
|
defaultValues: h.defaultControlValues || {},
|
|
970
|
-
usageByControlId:
|
|
959
|
+
usageByControlId: at(h),
|
|
971
960
|
availableFieldChoices: f,
|
|
972
961
|
availableMetricChoices: w,
|
|
973
962
|
structuralParticipants: E,
|
|
@@ -983,15 +972,15 @@ function _t({
|
|
|
983
972
|
/* @__PURE__ */ t("h4", { className: "text-sm font-medium", children: "Dashboard Controls" }),
|
|
984
973
|
/* @__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." })
|
|
985
974
|
] }),
|
|
986
|
-
|
|
975
|
+
D
|
|
987
976
|
] });
|
|
988
977
|
return l ? /* @__PURE__ */ s(Ce, { open: p, onOpenChange: m, children: [
|
|
989
|
-
/* @__PURE__ */ t(
|
|
978
|
+
/* @__PURE__ */ t(Ne, { asChild: !0, children: v || /* @__PURE__ */ s(I, { variant: "outline", className: "h-7 px-2", size: "sm", children: [
|
|
990
979
|
/* @__PURE__ */ t(Y, { className: "mr-2 h-4 w-4" }),
|
|
991
980
|
"Controls"
|
|
992
981
|
] }) }),
|
|
993
982
|
/* @__PURE__ */ t(
|
|
994
|
-
|
|
983
|
+
De,
|
|
995
984
|
{
|
|
996
985
|
className: "w-[620px] max-w-[95vw] space-y-4",
|
|
997
986
|
align: "end",
|
|
@@ -1000,21 +989,21 @@ function _t({
|
|
|
1000
989
|
children: U
|
|
1001
990
|
}
|
|
1002
991
|
)
|
|
1003
|
-
] }) : /* @__PURE__ */ t(
|
|
1004
|
-
|
|
992
|
+
] }) : /* @__PURE__ */ t(de, { open: p, onOpenChange: m, children: /* @__PURE__ */ s(
|
|
993
|
+
ue,
|
|
1005
994
|
{
|
|
1006
995
|
className: "flex max-h-[88vh] flex-col overflow-hidden sm:max-w-[600px]",
|
|
1007
996
|
onEscapeKeyDown: r,
|
|
1008
997
|
onPointerDownOutside: r,
|
|
1009
998
|
children: [
|
|
1010
999
|
/* @__PURE__ */ s(
|
|
1011
|
-
|
|
1000
|
+
me,
|
|
1012
1001
|
{
|
|
1013
1002
|
className: i ? "space-y-0" : void 0,
|
|
1014
1003
|
children: [
|
|
1015
|
-
/* @__PURE__ */ t(
|
|
1004
|
+
/* @__PURE__ */ t(he, { className: "text-[15px]", children: F }),
|
|
1016
1005
|
/* @__PURE__ */ t(
|
|
1017
|
-
|
|
1006
|
+
pe,
|
|
1018
1007
|
{
|
|
1019
1008
|
className: i ? "sr-only" : "text-[13px]",
|
|
1020
1009
|
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."
|
|
@@ -1023,7 +1012,7 @@ function _t({
|
|
|
1023
1012
|
]
|
|
1024
1013
|
}
|
|
1025
1014
|
),
|
|
1026
|
-
/* @__PURE__ */ t("div", { className: "min-h-0 overflow-y-auto pr-1", children:
|
|
1015
|
+
/* @__PURE__ */ t("div", { className: "min-h-0 overflow-y-auto pr-1", children: D })
|
|
1027
1016
|
]
|
|
1028
1017
|
}
|
|
1029
1018
|
) });
|
|
@@ -1034,8 +1023,8 @@ function Ht({
|
|
|
1034
1023
|
onAddFilter: v,
|
|
1035
1024
|
onAddControl: l,
|
|
1036
1025
|
onManageControls: n,
|
|
1037
|
-
size:
|
|
1038
|
-
className:
|
|
1026
|
+
size: c = "default",
|
|
1027
|
+
className: d,
|
|
1039
1028
|
primaryButtonClassName: m,
|
|
1040
1029
|
secondaryButtonClassName: i,
|
|
1041
1030
|
dropdownContentClassName: r
|
|
@@ -1043,14 +1032,14 @@ function Ht({
|
|
|
1043
1032
|
return /* @__PURE__ */ s(
|
|
1044
1033
|
"div",
|
|
1045
1034
|
{
|
|
1046
|
-
className:
|
|
1035
|
+
className: j(
|
|
1047
1036
|
// Height lives on the shell so the outer border is part of the
|
|
1048
1037
|
// h-7 box (matches regular `size="xs"` buttons). Inner buttons
|
|
1049
1038
|
// stretch to fill via `h-full`, avoiding the 2px stack-up that
|
|
1050
1039
|
// makes the combo taller than a sibling `<Button size="xs">`.
|
|
1051
|
-
"relative inline-flex items-stretch overflow-hidden rounded-
|
|
1052
|
-
|
|
1053
|
-
|
|
1040
|
+
"relative inline-flex items-stretch overflow-hidden rounded-control border border-input bg-background",
|
|
1041
|
+
c === "toolbar" ? "h-8" : "h-7",
|
|
1042
|
+
d
|
|
1054
1043
|
),
|
|
1055
1044
|
children: [
|
|
1056
1045
|
/* @__PURE__ */ s(
|
|
@@ -1058,42 +1047,42 @@ function Ht({
|
|
|
1058
1047
|
{
|
|
1059
1048
|
variant: "ghost",
|
|
1060
1049
|
size: "xs",
|
|
1061
|
-
className:
|
|
1050
|
+
className: j(
|
|
1062
1051
|
"h-full rounded-none border-0 bg-transparent pl-2.5 pr-2 shadow-none hover:bg-accent/50",
|
|
1063
1052
|
m
|
|
1064
1053
|
),
|
|
1065
1054
|
onClick: a,
|
|
1066
1055
|
children: [
|
|
1067
|
-
e ? /* @__PURE__ */ t(gt, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ t(
|
|
1056
|
+
e ? /* @__PURE__ */ t(gt, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ t(ee, { className: "h-3.5 w-3.5" }),
|
|
1068
1057
|
"Filter"
|
|
1069
1058
|
]
|
|
1070
1059
|
}
|
|
1071
1060
|
),
|
|
1072
|
-
/* @__PURE__ */ s(
|
|
1073
|
-
/* @__PURE__ */ t(
|
|
1061
|
+
/* @__PURE__ */ s(ve, { children: [
|
|
1062
|
+
/* @__PURE__ */ t(ge, { asChild: !0, children: /* @__PURE__ */ t(
|
|
1074
1063
|
I,
|
|
1075
1064
|
{
|
|
1076
1065
|
variant: "ghost",
|
|
1077
1066
|
size: "xs",
|
|
1078
|
-
className:
|
|
1067
|
+
className: j(
|
|
1079
1068
|
"h-full w-7 rounded-none border-0 border-l border-border/60 bg-transparent px-0 shadow-none hover:bg-accent/50",
|
|
1080
1069
|
i
|
|
1081
1070
|
),
|
|
1082
1071
|
"aria-label": "Filter and control actions",
|
|
1083
|
-
children: /* @__PURE__ */ t(
|
|
1072
|
+
children: /* @__PURE__ */ t(we, { className: "h-3.5 w-3.5" })
|
|
1084
1073
|
}
|
|
1085
1074
|
) }),
|
|
1086
1075
|
/* @__PURE__ */ s(
|
|
1087
|
-
|
|
1076
|
+
be,
|
|
1088
1077
|
{
|
|
1089
1078
|
align: "start",
|
|
1090
|
-
className:
|
|
1091
|
-
"min-w-[180px] rounded-
|
|
1079
|
+
className: j(
|
|
1080
|
+
"min-w-[180px] rounded-control border border-border/60 p-1 shadow-sm",
|
|
1092
1081
|
r
|
|
1093
1082
|
),
|
|
1094
1083
|
children: [
|
|
1095
1084
|
/* @__PURE__ */ s(R, { onSelect: v, children: [
|
|
1096
|
-
/* @__PURE__ */ t(
|
|
1085
|
+
/* @__PURE__ */ t(ee, { className: "h-3.5 w-3.5" }),
|
|
1097
1086
|
"Add filter"
|
|
1098
1087
|
] }),
|
|
1099
1088
|
/* @__PURE__ */ s(R, { onSelect: l, children: [
|
|
@@ -1101,7 +1090,7 @@ function Ht({
|
|
|
1101
1090
|
"Add control"
|
|
1102
1091
|
] }),
|
|
1103
1092
|
/* @__PURE__ */ s(R, { onSelect: n, children: [
|
|
1104
|
-
/* @__PURE__ */ t(
|
|
1093
|
+
/* @__PURE__ */ t(st, { className: "h-3.5 w-3.5" }),
|
|
1105
1094
|
"Manage controls"
|
|
1106
1095
|
] })
|
|
1107
1096
|
]
|
|
@@ -1113,14 +1102,14 @@ function Ht({
|
|
|
1113
1102
|
);
|
|
1114
1103
|
}
|
|
1115
1104
|
export {
|
|
1116
|
-
|
|
1117
|
-
|
|
1105
|
+
Rt as A,
|
|
1106
|
+
jt as D,
|
|
1118
1107
|
It as E,
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1108
|
+
_t as N,
|
|
1109
|
+
$t as U,
|
|
1110
|
+
zt as V,
|
|
1122
1111
|
At as a,
|
|
1123
1112
|
Ot as b,
|
|
1124
1113
|
Ht as c,
|
|
1125
|
-
|
|
1114
|
+
Bt as u
|
|
1126
1115
|
};
|