react-semaphor 0.1.182 → 0.1.184
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/calendar-preferences-dialog-D9oF_URo.js +1 -0
- package/dist/chunks/calendar-preferences-dialog-DeXKY9JD.js +457 -0
- package/dist/chunks/common-types-CfJLrTJd.js +1 -0
- package/dist/chunks/common-types-DhqlRVrq.js +8 -0
- package/dist/chunks/{dashboard-controls-pGlGtKRR.js → dashboard-controls-CB8282ob.js} +8 -8
- package/dist/chunks/{dashboard-controls-BnBXzFOj.js → dashboard-controls-lRs5t5cg.js} +499 -484
- package/dist/chunks/{dashboard-json-UVBr47Qj.js → dashboard-json-BmzqRV5Q.js} +1 -1
- package/dist/chunks/{dashboard-json-CiIyCwJi.js → dashboard-json-Brn4hMd-.js} +1 -1
- package/dist/chunks/date-formatter-Sz6QDaM8.js +1 -0
- package/dist/chunks/{index-B4EhQdS9.js → date-formatter-Y8Za1ib3.js} +500 -544
- package/dist/chunks/{edit-dashboard-visual-DoP_x_tT.js → edit-dashboard-visual--FJBg3i3.js} +914 -914
- package/dist/chunks/{edit-dashboard-visual-CXvyi_qa.js → edit-dashboard-visual-DNq8ni5W.js} +8 -8
- package/dist/chunks/{editor-action-buttons-5UEhKl88.js → editor-action-buttons-COCkxvCM.js} +27 -27
- package/dist/chunks/{editor-action-buttons-Bftd6Bfx.js → editor-action-buttons-RPpMm3Zr.js} +1 -1
- package/dist/chunks/{index-ahdw_esL.js → index-CyYJ0bVW.js} +24904 -24743
- package/dist/chunks/{index-D59dkH2b.js → index-Dz2kwOQh.js} +229 -229
- package/dist/chunks/{notification-bell-CKI2j8jH.js → notification-bell-B86bWytX.js} +109 -109
- package/dist/chunks/{notification-bell-DtWcBdzp.js → notification-bell-Bdk-qQIx.js} +2 -2
- package/dist/chunks/{resource-management-panel-qkl060k8.js → resource-management-panel-BZKSwkRq.js} +160 -160
- package/dist/chunks/{resource-management-panel-BLiCtZZE.js → resource-management-panel-CvKBoIFQ.js} +1 -1
- package/dist/chunks/{use-role-aware-display-preferences-CLf3yEts.js → use-role-aware-display-preferences-D-jgaajh.js} +1 -1
- package/dist/chunks/{use-role-aware-display-preferences-JstD5WLE.js → use-role-aware-display-preferences-Kxc427Zx.js} +1 -1
- package/dist/chunks/{use-visual-utils-TGjvLx_R.js → use-visual-utils-Du4NIgMk.js} +1 -1
- package/dist/chunks/{use-visual-utils-BbN7rxtD.js → use-visual-utils-DwQQN6wI.js} +33 -33
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +3 -3
- package/dist/format-utils/index.cjs +5 -5
- package/dist/format-utils/index.js +200 -250
- package/dist/index.cjs +1 -1
- package/dist/index.js +75 -71
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +6 -4
- package/dist/types/dashboard.d.ts +6 -2
- package/dist/types/format-utils.d.ts +43 -20
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.js +8 -5
- package/dist/types/main.d.ts +99 -9
- package/dist/types/surfboard.d.ts +13 -2
- package/dist/types/types.d.ts +319 -2
- package/package.json +1 -1
- package/dist/chunks/index-8Crk3ROJ.js +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import oe, { useState as A, useRef as V, useCallback as
|
|
2
|
-
import {
|
|
3
|
-
import { jsx as t, jsxs as r, Fragment as
|
|
4
|
-
import { E as Qe, V as Ye, a as Ze, b as Je, S as J, c as Ke, C as et } from "./editor-action-buttons-
|
|
5
|
-
import { a as ne } from "./use-visual-utils-
|
|
6
|
-
import {
|
|
1
|
+
import oe, { useState as A, useRef as V, useCallback as F, useEffect as D, useContext as ie } from "react";
|
|
2
|
+
import { aT as O, l as B, ae as I, aQ as $, aM as se, aN as _, af as ae, aL as le, m as ce, n as de, o as ue, p as me, q as he, L as z, bF as pe, bK as fe, bL as j, G as ge, B as S, H, aI as L, aV as ve, u as E, aZ as be, aG as re, bM as xe, bN as q, I as T, Y as we, bO as Ce, c as U, b4 as G, b5 as X, b6 as W, b7 as Q, b8 as Y, aJ as Ne, bP as ye, bQ as Ae, bR as Se, bm as Ee, bn as De, bo as Ie, bS as ke, bp as Te, bq as Ue, br as Me, bs as Fe, bt as Le, a9 as Pe, W as Ve, bT as Re, bU as ze, aS as Oe, X as Be, bV as $e, bW as _e, bX as He, aO as Z, ah as je, P as qe, s as Ge, bY as Xe, t as We } from "./index-CyYJ0bVW.js";
|
|
3
|
+
import { jsx as t, jsxs as r, Fragment as P } from "react/jsx-runtime";
|
|
4
|
+
import { E as Qe, V as Ye, a as Ze, b as Je, S as J, c as Ke, C as et } from "./editor-action-buttons-COCkxvCM.js";
|
|
5
|
+
import { a as ne } from "./use-visual-utils-DwQQN6wI.js";
|
|
6
|
+
import { c as K } from "./date-formatter-Y8Za1ib3.js";
|
|
7
7
|
/**
|
|
8
8
|
* @license lucide-react v0.453.0 - ISC
|
|
9
9
|
*
|
|
@@ -33,20 +33,20 @@ const ee = O("FileDown", [
|
|
|
33
33
|
* This source code is licensed under the ISC license.
|
|
34
34
|
* See the LICENSE file in the root directory of this source tree.
|
|
35
35
|
*/
|
|
36
|
-
const
|
|
36
|
+
const st = O("RefreshCw", [
|
|
37
37
|
["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", key: "v9h5vc" }],
|
|
38
38
|
["path", { d: "M21 3v5h-5", key: "1q7to0" }],
|
|
39
39
|
["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", key: "3uifl3" }],
|
|
40
40
|
["path", { d: "M8 16H3v5", key: "1cv678" }]
|
|
41
|
-
]),
|
|
41
|
+
]), at = 1e4, rt = 15e3, nt = 3e4, ot = 3e4, it = 12e4, te = 2 * 60 * 60 * 1e3;
|
|
42
42
|
function lt(e) {
|
|
43
|
-
const
|
|
44
|
-
return
|
|
43
|
+
const s = Date.now() - e.getTime();
|
|
44
|
+
return s < ot ? at : s < it ? rt : nt;
|
|
45
45
|
}
|
|
46
46
|
function wt() {
|
|
47
|
-
const { authToken: e, tokenProps:
|
|
47
|
+
const { authToken: e, tokenProps: s } = B(), c = I((g) => g.activeExports), [n, m] = A(
|
|
48
48
|
typeof document < "u" ? !document.hidden : !0
|
|
49
|
-
), l = V(null), o = V(!1),
|
|
49
|
+
), l = V(null), o = V(!1), a = V(void 0), h = s == null ? void 0 : s.apiServiceUrl, d = e == null ? void 0 : e.accessToken, v = F(() => {
|
|
50
50
|
const g = I.getState().activeExports;
|
|
51
51
|
return Array.from(g.values()).filter(
|
|
52
52
|
(x) => $(x.status)
|
|
@@ -61,7 +61,7 @@ function wt() {
|
|
|
61
61
|
document.removeEventListener("visibilitychange", g);
|
|
62
62
|
};
|
|
63
63
|
}, []);
|
|
64
|
-
const C =
|
|
64
|
+
const C = F(async () => {
|
|
65
65
|
if (!h || !d) {
|
|
66
66
|
o.current = !1;
|
|
67
67
|
return;
|
|
@@ -93,15 +93,15 @@ function wt() {
|
|
|
93
93
|
const b = await Promise.allSettled(
|
|
94
94
|
f.map(async (p) => {
|
|
95
95
|
try {
|
|
96
|
-
const i = await
|
|
96
|
+
const i = await se(h, d, p.id);
|
|
97
97
|
let w;
|
|
98
98
|
if (i.status === "completed")
|
|
99
99
|
try {
|
|
100
100
|
w = await _(h, d, p.id);
|
|
101
|
-
} catch (
|
|
101
|
+
} catch (M) {
|
|
102
102
|
console.error(
|
|
103
103
|
`[useExportPolling] Failed to get download URL for ${p.id}:`,
|
|
104
|
-
|
|
104
|
+
M
|
|
105
105
|
);
|
|
106
106
|
}
|
|
107
107
|
return {
|
|
@@ -128,25 +128,25 @@ function wt() {
|
|
|
128
128
|
const u = v();
|
|
129
129
|
if (u.length > 0 && !document.hidden) {
|
|
130
130
|
const p = u.reduce(
|
|
131
|
-
(w,
|
|
131
|
+
(w, M) => M.startedAt < w ? M.startedAt : w,
|
|
132
132
|
u[0].startedAt
|
|
133
133
|
), i = lt(p);
|
|
134
134
|
l.current && clearTimeout(l.current), l.current = setTimeout(() => {
|
|
135
135
|
var w;
|
|
136
|
-
(w =
|
|
136
|
+
(w = a.current) == null || w.call(a);
|
|
137
137
|
}, i);
|
|
138
138
|
} else
|
|
139
139
|
o.current = !1;
|
|
140
140
|
}, [h, d, v]);
|
|
141
141
|
return D(() => {
|
|
142
|
-
|
|
142
|
+
a.current = C;
|
|
143
143
|
}, [C]), D(() => {
|
|
144
144
|
var x;
|
|
145
|
-
v().length > 0 && n && !o.current && (o.current = !0, (x =
|
|
145
|
+
v().length > 0 && n && !o.current && (o.current = !0, (x = a.current) == null || x.call(a));
|
|
146
146
|
}, [c, n, v]), D(() => {
|
|
147
147
|
var x;
|
|
148
148
|
const g = v();
|
|
149
|
-
n && g.length > 0 && !o.current && (o.current = !0, (x =
|
|
149
|
+
n && g.length > 0 && !o.current && (o.current = !0, (x = a.current) == null || x.call(a));
|
|
150
150
|
}, [n, v]), D(() => {
|
|
151
151
|
!n && l.current && (clearTimeout(l.current), l.current = null, o.current = !1);
|
|
152
152
|
}, [n]), D(() => () => {
|
|
@@ -158,7 +158,7 @@ function wt() {
|
|
|
158
158
|
};
|
|
159
159
|
}
|
|
160
160
|
function Ct() {
|
|
161
|
-
const { authToken: e, tokenProps:
|
|
161
|
+
const { authToken: e, tokenProps: s } = B(), c = I((a) => a.activeExports), { addExport: n } = ae(), m = V(!1), l = s == null ? void 0 : s.apiServiceUrl, o = e == null ? void 0 : e.accessToken;
|
|
162
162
|
D(() => {
|
|
163
163
|
if (m.current || !l || !o) return;
|
|
164
164
|
(async () => {
|
|
@@ -213,17 +213,17 @@ function ct(e) {
|
|
|
213
213
|
}
|
|
214
214
|
function dt({
|
|
215
215
|
open: e,
|
|
216
|
-
onOpenChange:
|
|
216
|
+
onOpenChange: s,
|
|
217
217
|
isLibraryVisual: c,
|
|
218
218
|
currentVisualName: n,
|
|
219
219
|
isSaving: m = !1,
|
|
220
220
|
onConfirm: l
|
|
221
221
|
}) {
|
|
222
|
-
const [o,
|
|
222
|
+
const [o, a] = A(
|
|
223
223
|
c && n ? `Copy of ${n}` : n || ""
|
|
224
224
|
), [h, d] = A(""), [v, C] = A(!c), [g, x] = A(!0);
|
|
225
225
|
oe.useEffect(() => {
|
|
226
|
-
e && (
|
|
226
|
+
e && (a(
|
|
227
227
|
c && n ? `Copy of ${n}` : n || ""
|
|
228
228
|
), d(""), C(!c), x(!0));
|
|
229
229
|
}, [e, c, n]);
|
|
@@ -235,27 +235,27 @@ function dt({
|
|
|
235
235
|
saveToCurrentDashboard: g
|
|
236
236
|
}));
|
|
237
237
|
}, f = o.trim() && (v || g);
|
|
238
|
-
return /* @__PURE__ */ t(ce, { open: e, onOpenChange:
|
|
238
|
+
return /* @__PURE__ */ t(ce, { open: e, onOpenChange: s, children: /* @__PURE__ */ r(de, { className: "sm:max-w-[425px]", children: [
|
|
239
239
|
/* @__PURE__ */ r(ue, { children: [
|
|
240
240
|
/* @__PURE__ */ t(me, { children: "Save Visual As" }),
|
|
241
241
|
/* @__PURE__ */ t(he, { children: c ? "Create a copy of this visual with a new name" : "Save this visual to make it reusable" })
|
|
242
242
|
] }),
|
|
243
243
|
/* @__PURE__ */ r("div", { className: "grid gap-4 py-4", children: [
|
|
244
244
|
/* @__PURE__ */ r("div", { className: "grid gap-2", children: [
|
|
245
|
-
/* @__PURE__ */ t(
|
|
245
|
+
/* @__PURE__ */ t(z, { htmlFor: "name", children: "Name" }),
|
|
246
246
|
/* @__PURE__ */ t(
|
|
247
247
|
pe,
|
|
248
248
|
{
|
|
249
249
|
id: "name",
|
|
250
250
|
value: o,
|
|
251
|
-
onChange: (b) =>
|
|
251
|
+
onChange: (b) => a(b.target.value),
|
|
252
252
|
placeholder: "Enter visual name",
|
|
253
253
|
disabled: m
|
|
254
254
|
}
|
|
255
255
|
)
|
|
256
256
|
] }),
|
|
257
257
|
/* @__PURE__ */ r("div", { className: "grid gap-2", children: [
|
|
258
|
-
/* @__PURE__ */ t(
|
|
258
|
+
/* @__PURE__ */ t(z, { htmlFor: "description", children: "Description (optional)" }),
|
|
259
259
|
/* @__PURE__ */ t(
|
|
260
260
|
fe,
|
|
261
261
|
{
|
|
@@ -269,7 +269,7 @@ function dt({
|
|
|
269
269
|
)
|
|
270
270
|
] }),
|
|
271
271
|
/* @__PURE__ */ r("div", { className: "space-y-4", children: [
|
|
272
|
-
/* @__PURE__ */ t(
|
|
272
|
+
/* @__PURE__ */ t(z, { children: "Save to:" }),
|
|
273
273
|
/* @__PURE__ */ r("div", { className: "space-y-2", children: [
|
|
274
274
|
/* @__PURE__ */ r("div", { className: "flex items-center space-x-2", children: [
|
|
275
275
|
/* @__PURE__ */ t(
|
|
@@ -324,7 +324,7 @@ function dt({
|
|
|
324
324
|
S,
|
|
325
325
|
{
|
|
326
326
|
variant: "outline",
|
|
327
|
-
onClick: () =>
|
|
327
|
+
onClick: () => s(!1),
|
|
328
328
|
disabled: m,
|
|
329
329
|
children: "Cancel"
|
|
330
330
|
}
|
|
@@ -337,34 +337,34 @@ function dt({
|
|
|
337
337
|
] }) });
|
|
338
338
|
}
|
|
339
339
|
function ut() {
|
|
340
|
-
const [e,
|
|
340
|
+
const [e, s] = A(!1), [c, n] = A(!1), [m, l] = A(null), o = L((i) => i.frame), a = L((i) => i.card), h = ve(), d = E((i) => i.selectedSheetId), v = E(
|
|
341
341
|
(i) => i.actions.setIsDashboardPanelOpen
|
|
342
342
|
), { getUpdatedFrame: C } = ne(), { selectVisual: g } = be(), { addFrame: x, setSelectedFrameId: y, setIsVisualEditing: f } = re(), b = !!(o != null && o.visualId), N = (() => {
|
|
343
343
|
var i, w;
|
|
344
|
-
return ((i = o == null ? void 0 : o.cards) == null ? void 0 : i.length) === 1 && ((w = o.cards[0]) != null && w.title) ? o.cards[0].title : h != null && h.title ? h.title : (
|
|
344
|
+
return ((i = o == null ? void 0 : o.cards) == null ? void 0 : i.length) === 1 && ((w = o.cards[0]) != null && w.title) ? o.cards[0].title : h != null && h.title ? h.title : (a == null ? void 0 : a.title) || "Untitled Visual";
|
|
345
345
|
})(), u = xe((i) => {
|
|
346
346
|
if (i != null && i.id) {
|
|
347
347
|
if (g(i), c && m && d) {
|
|
348
348
|
const w = {
|
|
349
349
|
...m,
|
|
350
|
-
id:
|
|
350
|
+
id: q(),
|
|
351
351
|
visualId: i.id
|
|
352
352
|
// Link to the newly created library visual
|
|
353
353
|
};
|
|
354
354
|
x(d, w, "end"), y(w.id), n(!1), l(null), f(!1);
|
|
355
355
|
}
|
|
356
|
-
v(!0),
|
|
356
|
+
v(!0), s(!1);
|
|
357
357
|
}
|
|
358
358
|
});
|
|
359
359
|
return {
|
|
360
360
|
saveAsDialogOpen: e,
|
|
361
|
-
setSaveAsDialogOpen:
|
|
361
|
+
setSaveAsDialogOpen: s,
|
|
362
362
|
handleSaveAs: async (i) => {
|
|
363
363
|
if (!d) {
|
|
364
|
-
|
|
364
|
+
T.error("No sheet selected");
|
|
365
365
|
return;
|
|
366
366
|
}
|
|
367
|
-
const w = C(),
|
|
367
|
+
const w = C(), R = w.cards.length === 1 ? {
|
|
368
368
|
...w,
|
|
369
369
|
cards: w.cards.map((k) => ({
|
|
370
370
|
...k,
|
|
@@ -373,24 +373,24 @@ function ut() {
|
|
|
373
373
|
}))
|
|
374
374
|
} : w;
|
|
375
375
|
if (i.saveToLibrary) {
|
|
376
|
-
n(i.saveToCurrentDashboard), l(
|
|
376
|
+
n(i.saveToCurrentDashboard), l(R);
|
|
377
377
|
const k = {
|
|
378
378
|
title: i.name,
|
|
379
379
|
description: i.description,
|
|
380
|
-
frameObject:
|
|
380
|
+
frameObject: R,
|
|
381
381
|
// Card title synced for single-card frames
|
|
382
382
|
isPrivate: !1
|
|
383
383
|
};
|
|
384
384
|
u.mutate(k);
|
|
385
385
|
} else if (i.saveToCurrentDashboard) {
|
|
386
386
|
const k = {
|
|
387
|
-
...
|
|
387
|
+
...R,
|
|
388
388
|
// Card title already synced
|
|
389
|
-
id:
|
|
389
|
+
id: q(),
|
|
390
390
|
visualId: void 0
|
|
391
391
|
// Explicitly no visualId for local visuals
|
|
392
392
|
};
|
|
393
|
-
x(d, k, "end"), y(k.id),
|
|
393
|
+
x(d, k, "end"), y(k.id), T.success("Visual saved to dashboard"), s(!1), f(!1);
|
|
394
394
|
}
|
|
395
395
|
},
|
|
396
396
|
isLibraryVisual: b,
|
|
@@ -401,7 +401,7 @@ function ut() {
|
|
|
401
401
|
function Nt({
|
|
402
402
|
className: e
|
|
403
403
|
}) {
|
|
404
|
-
const
|
|
404
|
+
const s = L((u) => u.frame), c = L((u) => u.card), n = we((u) => u.selectedVisual), m = E((u) => u.selectedFrameId), l = E((u) => u.selectedSheetId), { setIsVisualEditing: o } = re(), a = !!(s != null && s.visualId || n != null && n.id), h = !!(s != null && s.visualId && m), d = a && !h, {
|
|
405
405
|
saveAsDialogOpen: v,
|
|
406
406
|
setSaveAsDialogOpen: C,
|
|
407
407
|
handleSaveAs: g,
|
|
@@ -410,25 +410,25 @@ function Nt({
|
|
|
410
410
|
isSaving: f
|
|
411
411
|
} = ut(), { handleAddLibraryVisual: b } = ne(), N = async () => {
|
|
412
412
|
if (!l) {
|
|
413
|
-
|
|
413
|
+
T.error("No dashboard sheet selected");
|
|
414
414
|
return;
|
|
415
415
|
}
|
|
416
416
|
if (!n) {
|
|
417
|
-
|
|
417
|
+
T.error("No visual selected");
|
|
418
418
|
return;
|
|
419
419
|
}
|
|
420
420
|
const u = await b(n);
|
|
421
|
-
u.success ? (
|
|
421
|
+
u.success ? (T.success("Visual added to dashboard"), o(!1)) : T.error(u.error || "Failed to add visual to dashboard");
|
|
422
422
|
};
|
|
423
|
-
return /* @__PURE__ */ r(
|
|
424
|
-
!
|
|
425
|
-
|
|
423
|
+
return /* @__PURE__ */ r(P, { children: [
|
|
424
|
+
!a && /* @__PURE__ */ t(Qe, { className: e, variant: "default" }),
|
|
425
|
+
a && /* @__PURE__ */ r(P, { children: [
|
|
426
426
|
h && /* @__PURE__ */ t(Ye, { className: e }),
|
|
427
427
|
d && l && c && (c.sql || Ce(c.config)) && /* @__PURE__ */ r(
|
|
428
428
|
S,
|
|
429
429
|
{
|
|
430
430
|
onClick: N,
|
|
431
|
-
className:
|
|
431
|
+
className: U(e),
|
|
432
432
|
size: "sm",
|
|
433
433
|
variant: "outline",
|
|
434
434
|
children: [
|
|
@@ -439,13 +439,13 @@ function Nt({
|
|
|
439
439
|
),
|
|
440
440
|
d && /* @__PURE__ */ t(Ze, { className: e, variant: "default" }),
|
|
441
441
|
h && /* @__PURE__ */ t(Je, { className: e }),
|
|
442
|
-
/* @__PURE__ */ r(
|
|
443
|
-
/* @__PURE__ */ t(
|
|
442
|
+
/* @__PURE__ */ r(G, { modal: !1, children: [
|
|
443
|
+
/* @__PURE__ */ t(X, { asChild: !0, children: /* @__PURE__ */ t(
|
|
444
444
|
S,
|
|
445
445
|
{
|
|
446
446
|
variant: "outline",
|
|
447
447
|
size: "sm",
|
|
448
|
-
className:
|
|
448
|
+
className: U(e, "w-8 p-0"),
|
|
449
449
|
children: /* @__PURE__ */ t(W, { className: "h-4 w-4" })
|
|
450
450
|
}
|
|
451
451
|
) }),
|
|
@@ -463,13 +463,13 @@ function Nt({
|
|
|
463
463
|
) })
|
|
464
464
|
] })
|
|
465
465
|
] }),
|
|
466
|
-
!
|
|
467
|
-
/* @__PURE__ */ t(
|
|
466
|
+
!a && /* @__PURE__ */ r(G, { modal: !1, children: [
|
|
467
|
+
/* @__PURE__ */ t(X, { asChild: !0, children: /* @__PURE__ */ t(
|
|
468
468
|
S,
|
|
469
469
|
{
|
|
470
470
|
variant: "outline",
|
|
471
471
|
size: "sm",
|
|
472
|
-
className:
|
|
472
|
+
className: U(e, "w-8 p-0"),
|
|
473
473
|
children: /* @__PURE__ */ t(W, { className: "h-4 w-4" })
|
|
474
474
|
}
|
|
475
475
|
) }),
|
|
@@ -497,14 +497,14 @@ function Nt({
|
|
|
497
497
|
function yt({
|
|
498
498
|
className: e,
|
|
499
499
|
//labelClassName,
|
|
500
|
-
switchClassName:
|
|
500
|
+
switchClassName: s
|
|
501
501
|
}) {
|
|
502
|
-
const c =
|
|
503
|
-
return !n || !o ? null : /* @__PURE__ */ r("div", { className:
|
|
502
|
+
const c = L((a) => a.isDevMode), n = E((a) => a.isVisualEditing), { setIsDevMode: m } = Ne(), { config: l } = ie(ye).tokenProps, o = (l == null ? void 0 : l.showAdvancedMode) !== !1;
|
|
503
|
+
return !n || !o ? null : /* @__PURE__ */ r("div", { className: U("flex items-center space-x-2", e), children: [
|
|
504
504
|
/* @__PURE__ */ t(
|
|
505
505
|
Ae,
|
|
506
506
|
{
|
|
507
|
-
className:
|
|
507
|
+
className: U("", s),
|
|
508
508
|
checked: c,
|
|
509
509
|
onCheckedChange: () => m(!c),
|
|
510
510
|
id: "advanced-mode",
|
|
@@ -517,24 +517,24 @@ function yt({
|
|
|
517
517
|
}
|
|
518
518
|
function At({
|
|
519
519
|
open: e,
|
|
520
|
-
onOpenChange:
|
|
520
|
+
onOpenChange: s,
|
|
521
521
|
onSave: c,
|
|
522
522
|
onDiscard: n,
|
|
523
523
|
isSaving: m
|
|
524
524
|
}) {
|
|
525
525
|
return /* @__PURE__ */ t(Ee, { open: e, onOpenChange: (o) => {
|
|
526
|
-
!o && m ||
|
|
526
|
+
!o && m || s(o);
|
|
527
527
|
}, children: /* @__PURE__ */ r(De, { className: "max-w-md", children: [
|
|
528
528
|
/* @__PURE__ */ r(Ie, { children: [
|
|
529
529
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-3", children: [
|
|
530
530
|
/* @__PURE__ */ t("div", { className: "flex h-10 w-10 items-center justify-center rounded-full bg-amber-100", children: /* @__PURE__ */ t(ke, { className: "h-5 w-5 text-amber-600" }) }),
|
|
531
|
-
/* @__PURE__ */ t(
|
|
531
|
+
/* @__PURE__ */ t(Te, { className: "text-xl", children: "Unsaved Changes" })
|
|
532
532
|
] }),
|
|
533
|
-
/* @__PURE__ */ t(
|
|
533
|
+
/* @__PURE__ */ t(Ue, { className: "pt-2 text-base leading-relaxed", children: "You have unsaved changes to this dashboard. What would you like to do?" })
|
|
534
534
|
] }),
|
|
535
|
-
/* @__PURE__ */ r(
|
|
535
|
+
/* @__PURE__ */ r(Me, { className: "flex-col gap-2 sm:flex-row sm:gap-2", children: [
|
|
536
536
|
/* @__PURE__ */ t(
|
|
537
|
-
|
|
537
|
+
Fe,
|
|
538
538
|
{
|
|
539
539
|
disabled: m,
|
|
540
540
|
className: "order-1 m-0 border-border/50 sm:order-1",
|
|
@@ -551,12 +551,12 @@ function At({
|
|
|
551
551
|
}
|
|
552
552
|
),
|
|
553
553
|
/* @__PURE__ */ t(
|
|
554
|
-
|
|
554
|
+
Le,
|
|
555
555
|
{
|
|
556
556
|
onClick: c,
|
|
557
557
|
disabled: m,
|
|
558
558
|
className: "order-3 m-0 bg-primary text-primary-foreground hover:bg-primary/90 sm:order-3",
|
|
559
|
-
children: m ? /* @__PURE__ */ r(
|
|
559
|
+
children: m ? /* @__PURE__ */ r(P, { children: [
|
|
560
560
|
/* @__PURE__ */ t(H, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
561
561
|
"Saving..."
|
|
562
562
|
] }) : "Save & Close"
|
|
@@ -565,38 +565,38 @@ function At({
|
|
|
565
565
|
] })
|
|
566
566
|
] }) });
|
|
567
567
|
}
|
|
568
|
-
function St(e,
|
|
568
|
+
function St(e, s, c, n) {
|
|
569
569
|
D(() => {
|
|
570
|
-
e && !c &&
|
|
571
|
-
}, [e, c,
|
|
570
|
+
e && !c && s && n(Pe(s));
|
|
571
|
+
}, [e, c, s, n]);
|
|
572
572
|
}
|
|
573
573
|
function Et({
|
|
574
574
|
triggerButtonClassName: e
|
|
575
575
|
}) {
|
|
576
|
-
const [
|
|
576
|
+
const [s, c] = A(!1), n = E((a) => {
|
|
577
577
|
var h;
|
|
578
|
-
return (h =
|
|
579
|
-
}), m = E((
|
|
578
|
+
return (h = a.dashboard) == null ? void 0 : h.id;
|
|
579
|
+
}), m = E((a) => {
|
|
580
580
|
var h;
|
|
581
|
-
return (h =
|
|
582
|
-
}), l = E((
|
|
581
|
+
return (h = a.dashboard) == null ? void 0 : h.title;
|
|
582
|
+
}), l = E((a) => {
|
|
583
583
|
var h;
|
|
584
|
-
return (h =
|
|
585
|
-
}), o = E((
|
|
586
|
-
return l == null || l.find((
|
|
584
|
+
return (h = a.dashboard) == null ? void 0 : h.sheets;
|
|
585
|
+
}), o = E((a) => a.selectedSheetId);
|
|
586
|
+
return l == null || l.find((a) => a.id === o), n ? /* @__PURE__ */ r(P, { children: [
|
|
587
587
|
/* @__PURE__ */ t(
|
|
588
588
|
Ve,
|
|
589
589
|
{
|
|
590
590
|
tooltip: "Schedule Dashboard",
|
|
591
|
-
className:
|
|
591
|
+
className: U("h-7 p-2", e),
|
|
592
592
|
onClick: () => c(!0),
|
|
593
|
-
children: /* @__PURE__ */ t(
|
|
593
|
+
children: /* @__PURE__ */ t(Re, { className: "size-4" })
|
|
594
594
|
}
|
|
595
595
|
),
|
|
596
596
|
/* @__PURE__ */ t(
|
|
597
|
-
|
|
597
|
+
ze,
|
|
598
598
|
{
|
|
599
|
-
open:
|
|
599
|
+
open: s,
|
|
600
600
|
onOpenChange: c,
|
|
601
601
|
dashboardId: n,
|
|
602
602
|
dashboardName: m
|
|
@@ -606,12 +606,12 @@ function Et({
|
|
|
606
606
|
}
|
|
607
607
|
function mt({
|
|
608
608
|
export: e,
|
|
609
|
-
onRemove:
|
|
609
|
+
onRemove: s
|
|
610
610
|
}) {
|
|
611
611
|
const c = () => {
|
|
612
612
|
e.downloadUrl && window.open(e.downloadUrl, "_blank");
|
|
613
|
-
}, n = (
|
|
614
|
-
|
|
613
|
+
}, n = (a) => {
|
|
614
|
+
a.stopPropagation(), s == null || s(e.id);
|
|
615
615
|
}, m = () => {
|
|
616
616
|
switch (e.status) {
|
|
617
617
|
case "completed":
|
|
@@ -646,7 +646,7 @@ function mt({
|
|
|
646
646
|
e.totalRows.toLocaleString(),
|
|
647
647
|
" rows"
|
|
648
648
|
] }),
|
|
649
|
-
e.fileSize && /* @__PURE__ */ r(
|
|
649
|
+
e.fileSize && /* @__PURE__ */ r(P, { children: [
|
|
650
650
|
/* @__PURE__ */ t("span", { children: "•" }),
|
|
651
651
|
/* @__PURE__ */ t("span", { children: Oe(e.fileSize) })
|
|
652
652
|
] })
|
|
@@ -696,20 +696,20 @@ function mt({
|
|
|
696
696
|
] });
|
|
697
697
|
}
|
|
698
698
|
function ht() {
|
|
699
|
-
const { authToken: e, tokenProps:
|
|
699
|
+
const { authToken: e, tokenProps: s } = B(), c = I((f) => f.activeExports), { clearCompleted: n, removeExport: m, updateExport: l } = ae(), [o, a] = A(!1), [h, d] = A(!1), v = Array.from(c.values()).sort(
|
|
700
700
|
(f, b) => b.startedAt.getTime() - f.startedAt.getTime()
|
|
701
701
|
), C = v.some(
|
|
702
702
|
(f) => f.status === "completed" || f.status === "failed"
|
|
703
|
-
), g =
|
|
704
|
-
const f =
|
|
703
|
+
), g = F(async () => {
|
|
704
|
+
const f = s == null ? void 0 : s.apiServiceUrl, b = e == null ? void 0 : e.accessToken;
|
|
705
705
|
if (!(!f || !b)) {
|
|
706
|
-
|
|
706
|
+
a(!0);
|
|
707
707
|
try {
|
|
708
708
|
const N = Array.from(c.values());
|
|
709
709
|
await Promise.all(
|
|
710
710
|
N.map(async (u) => {
|
|
711
711
|
try {
|
|
712
|
-
const p = await
|
|
712
|
+
const p = await se(f, b, u.id);
|
|
713
713
|
let i;
|
|
714
714
|
if (p.status === "completed")
|
|
715
715
|
try {
|
|
@@ -737,16 +737,16 @@ function ht() {
|
|
|
737
737
|
})
|
|
738
738
|
);
|
|
739
739
|
} finally {
|
|
740
|
-
|
|
740
|
+
a(!1);
|
|
741
741
|
}
|
|
742
742
|
}
|
|
743
743
|
}, [
|
|
744
744
|
c,
|
|
745
745
|
e == null ? void 0 : e.accessToken,
|
|
746
|
-
|
|
746
|
+
s == null ? void 0 : s.apiServiceUrl,
|
|
747
747
|
l
|
|
748
|
-
]), x =
|
|
749
|
-
const f =
|
|
748
|
+
]), x = F(async () => {
|
|
749
|
+
const f = s == null ? void 0 : s.apiServiceUrl, b = e == null ? void 0 : e.accessToken;
|
|
750
750
|
if (!f || !b) {
|
|
751
751
|
n();
|
|
752
752
|
return;
|
|
@@ -768,12 +768,12 @@ function ht() {
|
|
|
768
768
|
}
|
|
769
769
|
}, [
|
|
770
770
|
v,
|
|
771
|
-
|
|
771
|
+
s == null ? void 0 : s.apiServiceUrl,
|
|
772
772
|
e == null ? void 0 : e.accessToken,
|
|
773
773
|
n
|
|
774
|
-
]), y =
|
|
774
|
+
]), y = F(
|
|
775
775
|
async (f) => {
|
|
776
|
-
const b =
|
|
776
|
+
const b = s == null ? void 0 : s.apiServiceUrl, N = e == null ? void 0 : e.accessToken;
|
|
777
777
|
if (b && N)
|
|
778
778
|
try {
|
|
779
779
|
await Z(b, N, f);
|
|
@@ -782,7 +782,7 @@ function ht() {
|
|
|
782
782
|
}
|
|
783
783
|
m(f);
|
|
784
784
|
},
|
|
785
|
-
[
|
|
785
|
+
[s == null ? void 0 : s.apiServiceUrl, e == null ? void 0 : e.accessToken, m]
|
|
786
786
|
);
|
|
787
787
|
return v.length === 0 ? /* @__PURE__ */ r("div", { className: "p-6 text-center", children: [
|
|
788
788
|
/* @__PURE__ */ t(ee, { className: "mx-auto mb-2 h-8 w-8 text-muted-foreground" }),
|
|
@@ -805,7 +805,7 @@ function ht() {
|
|
|
805
805
|
disabled: o,
|
|
806
806
|
title: "Refresh status",
|
|
807
807
|
children: /* @__PURE__ */ t(
|
|
808
|
-
|
|
808
|
+
st,
|
|
809
809
|
{
|
|
810
810
|
className: `h-4 w-4 ${o ? "animate-spin" : ""}`
|
|
811
811
|
}
|
|
@@ -836,11 +836,11 @@ function ht() {
|
|
|
836
836
|
] });
|
|
837
837
|
}
|
|
838
838
|
function Dt() {
|
|
839
|
-
const e = I((
|
|
840
|
-
(
|
|
841
|
-
), l =
|
|
842
|
-
return /* @__PURE__ */ r(
|
|
843
|
-
/* @__PURE__ */ t(
|
|
839
|
+
const e = I((a) => a.activeExports), s = je(), c = e.size > 0, n = Array.from(e.values()).some(
|
|
840
|
+
(a) => a.status === "completed" || a.status === "failed"
|
|
841
|
+
), l = s > 0 ? s > 9 ? "9+" : String(s) : null;
|
|
842
|
+
return /* @__PURE__ */ r(qe, { children: [
|
|
843
|
+
/* @__PURE__ */ t(Ge, { asChild: !0, children: /* @__PURE__ */ r(
|
|
844
844
|
S,
|
|
845
845
|
{
|
|
846
846
|
variant: "ghost",
|
|
@@ -848,7 +848,7 @@ function Dt() {
|
|
|
848
848
|
className: "relative h-8 w-8",
|
|
849
849
|
"aria-label": "Export notifications",
|
|
850
850
|
children: [
|
|
851
|
-
/* @__PURE__ */ t(
|
|
851
|
+
/* @__PURE__ */ t(Xe, { className: "h-4 w-4" }),
|
|
852
852
|
c && /* @__PURE__ */ t(
|
|
853
853
|
"span",
|
|
854
854
|
{
|
|
@@ -866,7 +866,7 @@ export {
|
|
|
866
866
|
yt as A,
|
|
867
867
|
ht as E,
|
|
868
868
|
Dt as N,
|
|
869
|
-
|
|
869
|
+
st as R,
|
|
870
870
|
Et as S,
|
|
871
871
|
At as U,
|
|
872
872
|
Nt as V,
|