react-semaphor 0.1.130 → 0.1.131
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-CyXjMFyG.js → dashboard-controls-B2o_Ml98.js} +3 -3
- package/dist/chunks/{dashboard-controls-D0NNMMTV.js → dashboard-controls-CLmhjguK.js} +1 -1
- package/dist/chunks/dashboard-export-dialog-Ch0ElsMI.js +6 -0
- package/dist/chunks/{dashboard-export-dialog-QHSc2H4A.js → dashboard-export-dialog-DwkHS7L_.js} +196 -195
- package/dist/chunks/{dashboard-json-B1EghOQb.js → dashboard-json-BPO_6NQh.js} +1 -1
- package/dist/chunks/{dashboard-json-CBKxJ8vr.js → dashboard-json-DawmOBwK.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-BbJWSwV8.js → edit-dashboard-visual-CE0f3H3D.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-hxtJTX_r.js → edit-dashboard-visual-VH55I2qe.js} +3 -3
- package/dist/chunks/{editor-action-buttons-DVUG-IfI.js → editor-action-buttons-BCRzk-0n.js} +2 -2
- package/dist/chunks/{editor-action-buttons-C-kNSpbT.js → editor-action-buttons-BCX2a6QA.js} +1 -1
- package/dist/chunks/{index-BwqkWrot.js → index-BiG_2DRk.js} +6157 -6155
- package/dist/chunks/{index-Dv8xdR3_.js → index-D3VnAyrW.js} +106 -106
- package/dist/chunks/{resource-management-panel-DzZ_mzro.js → resource-management-panel-CFSAxmG5.js} +2 -2
- package/dist/chunks/{resource-management-panel-BZsjvW6g.js → resource-management-panel-DAc7CcYm.js} +1 -1
- package/dist/chunks/{use-visual-utils-DtS7MAqv.js → use-visual-utils-_KE2a0K6.js} +1 -1
- package/dist/chunks/{use-visual-utils-BWlOHrm7.js → use-visual-utils-iLF6cWs6.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 +4 -4
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +1 -1
- package/dist/types/main.d.ts +1 -1
- package/package.json +1 -1
- package/dist/chunks/dashboard-export-dialog-74K44GrY.js +0 -6
package/dist/chunks/{dashboard-export-dialog-QHSc2H4A.js → dashboard-export-dialog-DwkHS7L_.js}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as e, jsxs as a, Fragment as F } from "react/jsx-runtime";
|
|
2
|
-
import { b as q, ar as $, as as H, at as W, au as _, av as K, aw as
|
|
3
|
-
import { E as Ee, V as Me, a as Ve, b as Te, S as j, c as Oe } from "./editor-action-buttons-
|
|
4
|
-
import Be, { useState as
|
|
5
|
-
import { a as Y } from "./use-visual-utils-
|
|
2
|
+
import { b as q, ar as $, as as H, at as W, au as _, av as K, aw as A, ax as J, ay as Z, az as V, aA as Q, B as P, L as T, f as E, i as ee, u as b, an as ae, g as X, aB as se, aC as O, l as v, aD as te, aE as re, c as I, aF as B, aG as L, aH as z, aI as U, aJ as G, e as oe, aK as le, aL as ne, aM as de, aN as ie, aO as ce, aP as he, aQ as ue, aR as me, aS as pe, aT as fe, aU as ve, aV as ge, Q as be, I as Ce, aW as we, aX as xe, am as De, aY as ye, aZ as R, a_ as Ne, a$ as Se, b0 as Ae, b1 as Pe, b2 as Fe, b3 as ke, V as Ie } from "./index-BiG_2DRk.js";
|
|
3
|
+
import { E as Ee, V as Me, a as Ve, b as Te, S as j, c as Oe } from "./editor-action-buttons-BCRzk-0n.js";
|
|
4
|
+
import Be, { useState as C, useContext as Le, useEffect as ze } from "react";
|
|
5
|
+
import { a as Y } from "./use-visual-utils-_KE2a0K6.js";
|
|
6
6
|
/**
|
|
7
7
|
* @license lucide-react v0.453.0 - ISC
|
|
8
8
|
*
|
|
@@ -17,71 +17,71 @@ const Ue = q("CirclePlus", [
|
|
|
17
17
|
function Ge({
|
|
18
18
|
open: c,
|
|
19
19
|
onOpenChange: i,
|
|
20
|
-
isLibraryVisual:
|
|
21
|
-
currentVisualName:
|
|
22
|
-
isSaving:
|
|
23
|
-
onConfirm:
|
|
20
|
+
isLibraryVisual: r,
|
|
21
|
+
currentVisualName: o,
|
|
22
|
+
isSaving: d = !1,
|
|
23
|
+
onConfirm: m
|
|
24
24
|
}) {
|
|
25
|
-
const [s,
|
|
26
|
-
|
|
27
|
-
), [
|
|
25
|
+
const [s, l] = C(
|
|
26
|
+
r && o ? `Copy of ${o}` : o || ""
|
|
27
|
+
), [n, f] = C(""), [g, w] = C(!r), [p, N] = C(!0);
|
|
28
28
|
Be.useEffect(() => {
|
|
29
|
-
c && (
|
|
30
|
-
|
|
31
|
-
), f(""),
|
|
32
|
-
}, [c,
|
|
33
|
-
const
|
|
34
|
-
s.trim() && (!
|
|
29
|
+
c && (l(
|
|
30
|
+
r && o ? `Copy of ${o}` : o || ""
|
|
31
|
+
), f(""), w(!r), N(!0));
|
|
32
|
+
}, [c, r, o]);
|
|
33
|
+
const x = () => {
|
|
34
|
+
s.trim() && (!g && !p || m({
|
|
35
35
|
name: s.trim(),
|
|
36
|
-
description:
|
|
37
|
-
saveToLibrary:
|
|
38
|
-
saveToCurrentDashboard:
|
|
36
|
+
description: n.trim() || void 0,
|
|
37
|
+
saveToLibrary: g,
|
|
38
|
+
saveToCurrentDashboard: p
|
|
39
39
|
}));
|
|
40
|
-
},
|
|
40
|
+
}, D = s.trim() && (g || p);
|
|
41
41
|
return /* @__PURE__ */ e($, { open: c, onOpenChange: i, children: /* @__PURE__ */ a(H, { className: "sm:max-w-[425px]", children: [
|
|
42
42
|
/* @__PURE__ */ a(W, { children: [
|
|
43
43
|
/* @__PURE__ */ e(_, { children: "Save Visual As" }),
|
|
44
|
-
/* @__PURE__ */ e(K, { children:
|
|
44
|
+
/* @__PURE__ */ e(K, { children: r ? "Create a copy of this visual with a new name" : "Save this visual to make it reusable" })
|
|
45
45
|
] }),
|
|
46
46
|
/* @__PURE__ */ a("div", { className: "grid gap-4 py-4", children: [
|
|
47
47
|
/* @__PURE__ */ a("div", { className: "grid gap-2", children: [
|
|
48
|
-
/* @__PURE__ */ e(
|
|
48
|
+
/* @__PURE__ */ e(A, { htmlFor: "name", children: "Name" }),
|
|
49
49
|
/* @__PURE__ */ e(
|
|
50
50
|
J,
|
|
51
51
|
{
|
|
52
52
|
id: "name",
|
|
53
53
|
value: s,
|
|
54
|
-
onChange: (
|
|
54
|
+
onChange: (t) => l(t.target.value),
|
|
55
55
|
placeholder: "Enter visual name",
|
|
56
|
-
disabled:
|
|
56
|
+
disabled: d
|
|
57
57
|
}
|
|
58
58
|
)
|
|
59
59
|
] }),
|
|
60
60
|
/* @__PURE__ */ a("div", { className: "grid gap-2", children: [
|
|
61
|
-
/* @__PURE__ */ e(
|
|
61
|
+
/* @__PURE__ */ e(A, { htmlFor: "description", children: "Description (optional)" }),
|
|
62
62
|
/* @__PURE__ */ e(
|
|
63
63
|
Z,
|
|
64
64
|
{
|
|
65
65
|
id: "description",
|
|
66
|
-
value:
|
|
67
|
-
onChange: (
|
|
66
|
+
value: n,
|
|
67
|
+
onChange: (t) => f(t.target.value),
|
|
68
68
|
placeholder: "Enter visual description",
|
|
69
69
|
rows: 3,
|
|
70
|
-
disabled:
|
|
70
|
+
disabled: d
|
|
71
71
|
}
|
|
72
72
|
)
|
|
73
73
|
] }),
|
|
74
74
|
/* @__PURE__ */ a("div", { className: "space-y-4", children: [
|
|
75
|
-
/* @__PURE__ */ e(
|
|
75
|
+
/* @__PURE__ */ e(A, { children: "Save to:" }),
|
|
76
76
|
/* @__PURE__ */ a("div", { className: "space-y-2", children: [
|
|
77
77
|
/* @__PURE__ */ a("div", { className: "flex items-center space-x-2", children: [
|
|
78
78
|
/* @__PURE__ */ e(
|
|
79
79
|
V,
|
|
80
80
|
{
|
|
81
81
|
id: "save-to-dashboard",
|
|
82
|
-
checked:
|
|
83
|
-
onCheckedChange: (
|
|
84
|
-
disabled:
|
|
82
|
+
checked: p,
|
|
83
|
+
onCheckedChange: (t) => N(!!t),
|
|
84
|
+
disabled: d
|
|
85
85
|
}
|
|
86
86
|
),
|
|
87
87
|
/* @__PURE__ */ a(
|
|
@@ -91,7 +91,7 @@ function Ge({
|
|
|
91
91
|
className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
92
92
|
children: [
|
|
93
93
|
"Current Dashboard",
|
|
94
|
-
/* @__PURE__ */ e("span", { className: "ml-2 text-xs text-muted-foreground", children:
|
|
94
|
+
/* @__PURE__ */ e("span", { className: "ml-2 text-xs text-muted-foreground", children: r ? "(add copy to this dashboard)" : "(keep as local visual)" })
|
|
95
95
|
]
|
|
96
96
|
}
|
|
97
97
|
)
|
|
@@ -101,9 +101,9 @@ function Ge({
|
|
|
101
101
|
V,
|
|
102
102
|
{
|
|
103
103
|
id: "save-to-library",
|
|
104
|
-
checked:
|
|
105
|
-
onCheckedChange: (
|
|
106
|
-
disabled:
|
|
104
|
+
checked: g,
|
|
105
|
+
onCheckedChange: (t) => w(!!t),
|
|
106
|
+
disabled: d
|
|
107
107
|
}
|
|
108
108
|
),
|
|
109
109
|
/* @__PURE__ */ a(
|
|
@@ -113,125 +113,125 @@ function Ge({
|
|
|
113
113
|
className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
114
114
|
children: [
|
|
115
115
|
"Visual Library",
|
|
116
|
-
/* @__PURE__ */ e("span", { className: "ml-2 text-xs text-muted-foreground", children:
|
|
116
|
+
/* @__PURE__ */ e("span", { className: "ml-2 text-xs text-muted-foreground", children: r ? "(save as new reusable visual)" : "(make available to all dashboards)" })
|
|
117
117
|
]
|
|
118
118
|
}
|
|
119
119
|
)
|
|
120
120
|
] })
|
|
121
121
|
] }),
|
|
122
|
-
!
|
|
122
|
+
!g && !p && /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: "Please select at least one destination" })
|
|
123
123
|
] })
|
|
124
124
|
] }),
|
|
125
125
|
/* @__PURE__ */ a(Q, { children: [
|
|
126
126
|
/* @__PURE__ */ e(
|
|
127
|
-
|
|
127
|
+
P,
|
|
128
128
|
{
|
|
129
129
|
variant: "outline",
|
|
130
130
|
onClick: () => i(!1),
|
|
131
|
-
disabled:
|
|
131
|
+
disabled: d,
|
|
132
132
|
children: "Cancel"
|
|
133
133
|
}
|
|
134
134
|
),
|
|
135
|
-
/* @__PURE__ */ a(
|
|
136
|
-
|
|
137
|
-
|
|
135
|
+
/* @__PURE__ */ a(P, { onClick: x, disabled: !D || d, children: [
|
|
136
|
+
d && /* @__PURE__ */ e(T, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
137
|
+
d ? "Saving..." : "Save"
|
|
138
138
|
] })
|
|
139
139
|
] })
|
|
140
140
|
] }) });
|
|
141
141
|
}
|
|
142
142
|
function Re() {
|
|
143
|
-
const [c, i] =
|
|
144
|
-
(
|
|
145
|
-
), { getUpdatedFrame:
|
|
146
|
-
var
|
|
147
|
-
return ((
|
|
148
|
-
})(),
|
|
149
|
-
if (
|
|
150
|
-
if (
|
|
143
|
+
const [c, i] = C(!1), [r, o] = C(!1), [d, m] = C(null), s = E((u) => u.frame), l = E((u) => u.card), n = ee(), f = b((u) => u.selectedSheetId), g = b(
|
|
144
|
+
(u) => u.actions.setIsDashboardPanelOpen
|
|
145
|
+
), { getUpdatedFrame: w } = Y(), { selectVisual: p } = ae(), { addFrame: N, setSelectedFrameId: x, setIsVisualEditing: D } = X(), t = !!(s != null && s.visualId), S = (() => {
|
|
146
|
+
var u, y;
|
|
147
|
+
return ((u = s == null ? void 0 : s.cards) == null ? void 0 : u.length) === 1 && ((y = s.cards[0]) != null && y.title) ? s.cards[0].title : n != null && n.title ? n.title : (l == null ? void 0 : l.title) || "Untitled Visual";
|
|
148
|
+
})(), h = se((u) => {
|
|
149
|
+
if (u != null && u.id) {
|
|
150
|
+
if (p(u), r && d && f) {
|
|
151
151
|
const y = {
|
|
152
|
-
...
|
|
152
|
+
...d,
|
|
153
153
|
id: O(),
|
|
154
|
-
visualId:
|
|
154
|
+
visualId: u.id
|
|
155
155
|
// Link to the newly created library visual
|
|
156
156
|
};
|
|
157
|
-
|
|
157
|
+
N(f, y, "end"), x(y.id), o(!1), m(null), D(!1);
|
|
158
158
|
}
|
|
159
|
-
|
|
159
|
+
g(!0), i(!1);
|
|
160
160
|
}
|
|
161
161
|
});
|
|
162
162
|
return {
|
|
163
163
|
saveAsDialogOpen: c,
|
|
164
164
|
setSaveAsDialogOpen: i,
|
|
165
|
-
handleSaveAs: async (
|
|
165
|
+
handleSaveAs: async (u) => {
|
|
166
166
|
if (!f) {
|
|
167
|
-
|
|
167
|
+
v.error("No sheet selected");
|
|
168
168
|
return;
|
|
169
169
|
}
|
|
170
|
-
const y =
|
|
170
|
+
const y = w(), M = y.cards.length === 1 ? {
|
|
171
171
|
...y,
|
|
172
|
-
cards: y.cards.map((
|
|
173
|
-
...
|
|
174
|
-
title:
|
|
172
|
+
cards: y.cards.map((k) => ({
|
|
173
|
+
...k,
|
|
174
|
+
title: u.name
|
|
175
175
|
// Use visual name as card title
|
|
176
176
|
}))
|
|
177
177
|
} : y;
|
|
178
|
-
if (
|
|
179
|
-
|
|
180
|
-
const
|
|
181
|
-
title:
|
|
182
|
-
description:
|
|
178
|
+
if (u.saveToLibrary) {
|
|
179
|
+
o(u.saveToCurrentDashboard), m(M);
|
|
180
|
+
const k = {
|
|
181
|
+
title: u.name,
|
|
182
|
+
description: u.description,
|
|
183
183
|
frameObject: M,
|
|
184
184
|
// Card title synced for single-card frames
|
|
185
185
|
isPrivate: !1
|
|
186
186
|
};
|
|
187
|
-
|
|
188
|
-
} else if (
|
|
189
|
-
const
|
|
187
|
+
h.mutate(k);
|
|
188
|
+
} else if (u.saveToCurrentDashboard) {
|
|
189
|
+
const k = {
|
|
190
190
|
...M,
|
|
191
191
|
// Card title already synced
|
|
192
192
|
id: O(),
|
|
193
193
|
visualId: void 0
|
|
194
194
|
// Explicitly no visualId for local visuals
|
|
195
195
|
};
|
|
196
|
-
|
|
196
|
+
N(f, k, "end"), x(k.id), v.success("Visual saved to dashboard"), i(!1), D(!1);
|
|
197
197
|
}
|
|
198
198
|
},
|
|
199
|
-
isLibraryVisual:
|
|
200
|
-
currentVisualName:
|
|
201
|
-
isSaving:
|
|
199
|
+
isLibraryVisual: t,
|
|
200
|
+
currentVisualName: S,
|
|
201
|
+
isSaving: h.isPending
|
|
202
202
|
};
|
|
203
203
|
}
|
|
204
204
|
function Xe({
|
|
205
205
|
className: c
|
|
206
206
|
}) {
|
|
207
|
-
const i = E((
|
|
208
|
-
saveAsDialogOpen:
|
|
209
|
-
setSaveAsDialogOpen:
|
|
210
|
-
handleSaveAs:
|
|
211
|
-
isLibraryVisual:
|
|
212
|
-
currentVisualName:
|
|
213
|
-
isSaving:
|
|
214
|
-
} = Re(), { handleAddLibraryVisual:
|
|
215
|
-
if (!
|
|
216
|
-
|
|
207
|
+
const i = E((h) => h.frame), r = E((h) => h.card), o = te((h) => h.selectedVisual), d = b((h) => h.selectedFrameId), m = b((h) => h.selectedSheetId), { setIsVisualEditing: s } = X(), l = !!(i != null && i.visualId || o != null && o.id), n = !!(i != null && i.visualId && d), f = l && !n, {
|
|
208
|
+
saveAsDialogOpen: g,
|
|
209
|
+
setSaveAsDialogOpen: w,
|
|
210
|
+
handleSaveAs: p,
|
|
211
|
+
isLibraryVisual: N,
|
|
212
|
+
currentVisualName: x,
|
|
213
|
+
isSaving: D
|
|
214
|
+
} = Re(), { handleAddLibraryVisual: t } = Y(), S = async () => {
|
|
215
|
+
if (!m) {
|
|
216
|
+
v.error("No dashboard sheet selected");
|
|
217
217
|
return;
|
|
218
218
|
}
|
|
219
|
-
if (!
|
|
220
|
-
|
|
219
|
+
if (!o) {
|
|
220
|
+
v.error("No visual selected");
|
|
221
221
|
return;
|
|
222
222
|
}
|
|
223
|
-
const
|
|
224
|
-
|
|
223
|
+
const h = await t(o);
|
|
224
|
+
h.success ? (v.success("Visual added to dashboard"), s(!1)) : v.error(h.error || "Failed to add visual to dashboard");
|
|
225
225
|
};
|
|
226
226
|
return /* @__PURE__ */ a(F, { children: [
|
|
227
|
-
!
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
f &&
|
|
231
|
-
|
|
227
|
+
!l && /* @__PURE__ */ e(Ee, { className: c, variant: "default" }),
|
|
228
|
+
l && /* @__PURE__ */ a(F, { children: [
|
|
229
|
+
n && /* @__PURE__ */ e(Me, { className: c }),
|
|
230
|
+
f && m && r && (r.sql || re(r.config)) && /* @__PURE__ */ a(
|
|
231
|
+
P,
|
|
232
232
|
{
|
|
233
|
-
onClick:
|
|
234
|
-
className:
|
|
233
|
+
onClick: S,
|
|
234
|
+
className: I(c),
|
|
235
235
|
size: "sm",
|
|
236
236
|
variant: "outline",
|
|
237
237
|
children: [
|
|
@@ -241,22 +241,22 @@ function Xe({
|
|
|
241
241
|
}
|
|
242
242
|
),
|
|
243
243
|
f && /* @__PURE__ */ e(Ve, { className: c, variant: "default" }),
|
|
244
|
-
|
|
244
|
+
n && /* @__PURE__ */ e(Te, { className: c }),
|
|
245
245
|
/* @__PURE__ */ a(B, { modal: !1, children: [
|
|
246
246
|
/* @__PURE__ */ e(L, { asChild: !0, children: /* @__PURE__ */ e(
|
|
247
|
-
|
|
247
|
+
P,
|
|
248
248
|
{
|
|
249
249
|
variant: "outline",
|
|
250
250
|
size: "sm",
|
|
251
|
-
className:
|
|
251
|
+
className: I(c, "w-8 p-0"),
|
|
252
252
|
children: /* @__PURE__ */ e(z, { className: "h-4 w-4" })
|
|
253
253
|
}
|
|
254
254
|
) }),
|
|
255
255
|
/* @__PURE__ */ e(U, { align: "end", children: /* @__PURE__ */ a(
|
|
256
256
|
G,
|
|
257
257
|
{
|
|
258
|
-
onClick: (
|
|
259
|
-
|
|
258
|
+
onClick: (h) => {
|
|
259
|
+
h.stopPropagation(), w(!0);
|
|
260
260
|
},
|
|
261
261
|
children: [
|
|
262
262
|
/* @__PURE__ */ e(j, { className: "mr-2 h-4 w-4" }),
|
|
@@ -266,17 +266,17 @@ function Xe({
|
|
|
266
266
|
) })
|
|
267
267
|
] })
|
|
268
268
|
] }),
|
|
269
|
-
!
|
|
269
|
+
!l && /* @__PURE__ */ a(B, { modal: !1, children: [
|
|
270
270
|
/* @__PURE__ */ e(L, { asChild: !0, children: /* @__PURE__ */ e(
|
|
271
|
-
|
|
271
|
+
P,
|
|
272
272
|
{
|
|
273
273
|
variant: "outline",
|
|
274
274
|
size: "sm",
|
|
275
|
-
className:
|
|
275
|
+
className: I(c, "w-8 p-0"),
|
|
276
276
|
children: /* @__PURE__ */ e(z, { className: "h-4 w-4" })
|
|
277
277
|
}
|
|
278
278
|
) }),
|
|
279
|
-
/* @__PURE__ */ e(U, { align: "end", children: /* @__PURE__ */ a(G, { onClick: () =>
|
|
279
|
+
/* @__PURE__ */ e(U, { align: "end", children: /* @__PURE__ */ a(G, { onClick: () => w(!0), children: [
|
|
280
280
|
/* @__PURE__ */ e(j, { className: "mr-2 h-4 w-4" }),
|
|
281
281
|
"Save As..."
|
|
282
282
|
] }) })
|
|
@@ -285,14 +285,14 @@ function Xe({
|
|
|
285
285
|
/* @__PURE__ */ e(
|
|
286
286
|
Ge,
|
|
287
287
|
{
|
|
288
|
-
open:
|
|
289
|
-
onOpenChange: (
|
|
290
|
-
|
|
288
|
+
open: g,
|
|
289
|
+
onOpenChange: (h) => {
|
|
290
|
+
D || w(h);
|
|
291
291
|
},
|
|
292
|
-
isLibraryVisual:
|
|
293
|
-
currentVisualName:
|
|
294
|
-
isSaving:
|
|
295
|
-
onConfirm:
|
|
292
|
+
isLibraryVisual: N,
|
|
293
|
+
currentVisualName: x,
|
|
294
|
+
isSaving: D,
|
|
295
|
+
onConfirm: p
|
|
296
296
|
}
|
|
297
297
|
)
|
|
298
298
|
] });
|
|
@@ -302,17 +302,17 @@ function Ye({
|
|
|
302
302
|
//labelClassName,
|
|
303
303
|
switchClassName: i
|
|
304
304
|
}) {
|
|
305
|
-
const
|
|
306
|
-
return !
|
|
305
|
+
const r = E((l) => l.isDevMode), o = b((l) => l.isVisualEditing), { setIsDevMode: d } = oe(), { config: m } = Le(le).tokenProps, s = (m == null ? void 0 : m.showAdvancedMode) !== !1;
|
|
306
|
+
return !o || !s ? null : /* @__PURE__ */ a("div", { className: I("flex items-center space-x-2", c), children: [
|
|
307
307
|
/* @__PURE__ */ e(
|
|
308
308
|
ne,
|
|
309
309
|
{
|
|
310
|
-
className:
|
|
311
|
-
checked:
|
|
312
|
-
onCheckedChange: () =>
|
|
310
|
+
className: I("", i),
|
|
311
|
+
checked: r,
|
|
312
|
+
onCheckedChange: () => d(!r),
|
|
313
313
|
id: "advanced-mode",
|
|
314
314
|
icon: /* @__PURE__ */ e(de, { className: "h-4 w-4" }),
|
|
315
|
-
tooltip:
|
|
315
|
+
tooltip: r ? "Standard Mode" : "Advanced Mode"
|
|
316
316
|
}
|
|
317
317
|
),
|
|
318
318
|
/* @__PURE__ */ e("label", { htmlFor: "advanced-mode", className: "sr-only", children: "Advanced Mode" })
|
|
@@ -321,12 +321,12 @@ function Ye({
|
|
|
321
321
|
function qe({
|
|
322
322
|
open: c,
|
|
323
323
|
onOpenChange: i,
|
|
324
|
-
onSave:
|
|
325
|
-
onDiscard:
|
|
326
|
-
isSaving:
|
|
324
|
+
onSave: r,
|
|
325
|
+
onDiscard: o,
|
|
326
|
+
isSaving: d
|
|
327
327
|
}) {
|
|
328
328
|
return /* @__PURE__ */ e(ie, { open: c, onOpenChange: (s) => {
|
|
329
|
-
!s &&
|
|
329
|
+
!s && d || i(s);
|
|
330
330
|
}, children: /* @__PURE__ */ a(ce, { className: "max-w-md", children: [
|
|
331
331
|
/* @__PURE__ */ a(he, { children: [
|
|
332
332
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-3", children: [
|
|
@@ -339,7 +339,7 @@ function qe({
|
|
|
339
339
|
/* @__PURE__ */ e(
|
|
340
340
|
ve,
|
|
341
341
|
{
|
|
342
|
-
disabled:
|
|
342
|
+
disabled: d,
|
|
343
343
|
className: "order-1 m-0 border-border/50 sm:order-1",
|
|
344
344
|
children: "Cancel"
|
|
345
345
|
}
|
|
@@ -347,8 +347,8 @@ function qe({
|
|
|
347
347
|
/* @__PURE__ */ e(
|
|
348
348
|
"button",
|
|
349
349
|
{
|
|
350
|
-
onClick:
|
|
351
|
-
disabled:
|
|
350
|
+
onClick: o,
|
|
351
|
+
disabled: d,
|
|
352
352
|
className: "order-2 rounded-md border border-destructive/20 bg-destructive/10 px-4 py-2 text-sm font-medium text-destructive transition-colors hover:bg-destructive/20 disabled:pointer-events-none disabled:opacity-50 sm:order-2",
|
|
353
353
|
children: "Discard"
|
|
354
354
|
}
|
|
@@ -356,10 +356,10 @@ function qe({
|
|
|
356
356
|
/* @__PURE__ */ e(
|
|
357
357
|
ge,
|
|
358
358
|
{
|
|
359
|
-
onClick:
|
|
360
|
-
disabled:
|
|
359
|
+
onClick: r,
|
|
360
|
+
disabled: d,
|
|
361
361
|
className: "order-3 m-0 bg-primary text-primary-foreground hover:bg-primary/90 sm:order-3",
|
|
362
|
-
children:
|
|
362
|
+
children: d ? /* @__PURE__ */ a(F, { children: [
|
|
363
363
|
/* @__PURE__ */ e(T, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
364
364
|
"Saving..."
|
|
365
365
|
] }) : "Save & Close"
|
|
@@ -368,31 +368,31 @@ function qe({
|
|
|
368
368
|
] })
|
|
369
369
|
] }) });
|
|
370
370
|
}
|
|
371
|
-
function Je(c, i,
|
|
371
|
+
function Je(c, i, r, o) {
|
|
372
372
|
ze(() => {
|
|
373
|
-
c && !
|
|
374
|
-
}, [c,
|
|
373
|
+
c && !r && i && o(be(i));
|
|
374
|
+
}, [c, r, i, o]);
|
|
375
375
|
}
|
|
376
376
|
function Ze({
|
|
377
377
|
triggerButtonClassName: c
|
|
378
378
|
}) {
|
|
379
|
-
const [i,
|
|
380
|
-
var
|
|
381
|
-
return (
|
|
382
|
-
}),
|
|
383
|
-
var
|
|
384
|
-
return (
|
|
385
|
-
}),
|
|
386
|
-
var
|
|
387
|
-
return (
|
|
388
|
-
}), s =
|
|
389
|
-
return
|
|
379
|
+
const [i, r] = C(!1), o = b((l) => {
|
|
380
|
+
var n;
|
|
381
|
+
return (n = l.dashboard) == null ? void 0 : n.id;
|
|
382
|
+
}), d = b((l) => {
|
|
383
|
+
var n;
|
|
384
|
+
return (n = l.dashboard) == null ? void 0 : n.title;
|
|
385
|
+
}), m = b((l) => {
|
|
386
|
+
var n;
|
|
387
|
+
return (n = l.dashboard) == null ? void 0 : n.sheets;
|
|
388
|
+
}), s = b((l) => l.selectedSheetId);
|
|
389
|
+
return m == null || m.find((l) => l.id === s), o ? /* @__PURE__ */ a(F, { children: [
|
|
390
390
|
/* @__PURE__ */ e(
|
|
391
391
|
Ce,
|
|
392
392
|
{
|
|
393
393
|
tooltip: "Schedule Dashboard",
|
|
394
|
-
className:
|
|
395
|
-
onClick: () =>
|
|
394
|
+
className: I("h-7 p-2", c),
|
|
395
|
+
onClick: () => r(!0),
|
|
396
396
|
children: /* @__PURE__ */ e(we, { className: "size-4" })
|
|
397
397
|
}
|
|
398
398
|
),
|
|
@@ -400,9 +400,9 @@ function Ze({
|
|
|
400
400
|
xe,
|
|
401
401
|
{
|
|
402
402
|
open: i,
|
|
403
|
-
onOpenChange:
|
|
404
|
-
dashboardId:
|
|
405
|
-
dashboardName:
|
|
403
|
+
onOpenChange: r,
|
|
404
|
+
dashboardId: o,
|
|
405
|
+
dashboardName: d
|
|
406
406
|
}
|
|
407
407
|
)
|
|
408
408
|
] }) : null;
|
|
@@ -411,53 +411,54 @@ function ea({
|
|
|
411
411
|
open: c,
|
|
412
412
|
onOpenChange: i
|
|
413
413
|
}) {
|
|
414
|
-
const [
|
|
414
|
+
const [r, o] = C(!1), [d, m] = C(!1), [s, l] = C({
|
|
415
415
|
sheetSelection: "current",
|
|
416
416
|
protectPdf: !1,
|
|
417
417
|
password: ""
|
|
418
|
-
}),
|
|
419
|
-
var
|
|
420
|
-
return (
|
|
421
|
-
}), f =
|
|
422
|
-
|
|
418
|
+
}), n = b((t) => {
|
|
419
|
+
var S;
|
|
420
|
+
return (S = t.dashboard) == null ? void 0 : S.sheets;
|
|
421
|
+
}), f = b((t) => t.selectedSheetId), { authToken: g, tokenProps: w } = De(), p = n == null ? void 0 : n.find((t) => t.id === f), N = ((n == null ? void 0 : n.length) || 0) > 1, x = () => {
|
|
422
|
+
l({
|
|
423
423
|
sheetSelection: "current",
|
|
424
424
|
protectPdf: !1,
|
|
425
425
|
password: ""
|
|
426
|
-
}),
|
|
426
|
+
}), o(!1), i(!1);
|
|
427
427
|
};
|
|
428
|
-
async function
|
|
428
|
+
async function D() {
|
|
429
429
|
if (s.protectPdf && !s.password) {
|
|
430
|
-
|
|
430
|
+
v.error("Please enter a password to protect the PDF");
|
|
431
431
|
return;
|
|
432
432
|
}
|
|
433
|
-
|
|
434
|
-
const
|
|
433
|
+
m(!0);
|
|
434
|
+
const t = s.sheetSelection === "all" ? "Generating PDF for all sheets... This may take a while." : s.protectPdf ? "Generating protected PDF... may take up to 60 seconds" : "Generating PDF... may take up to 60 seconds", S = v.loading(t);
|
|
435
435
|
try {
|
|
436
|
-
await
|
|
437
|
-
|
|
436
|
+
await Ie(
|
|
437
|
+
w.apiServiceUrl,
|
|
438
|
+
g,
|
|
438
439
|
s.protectPdf ? s.password : void 0,
|
|
439
440
|
s.sheetSelection
|
|
440
|
-
),
|
|
441
|
-
const
|
|
442
|
-
|
|
441
|
+
), v.dismiss(S);
|
|
442
|
+
const h = s.sheetSelection === "all" ? "All sheets PDF downloaded successfully!" : s.protectPdf ? "Protected PDF downloaded successfully!" : "PDF downloaded successfully!";
|
|
443
|
+
v.success(h, {
|
|
443
444
|
duration: 2e3
|
|
444
|
-
}),
|
|
445
|
-
} catch (
|
|
446
|
-
|
|
445
|
+
}), x();
|
|
446
|
+
} catch (h) {
|
|
447
|
+
v.dismiss(S), v.error("Failed to download PDF", {
|
|
447
448
|
description: "Please try again or contact support.",
|
|
448
449
|
richColors: !0
|
|
449
|
-
}), console.error("PDF download error:",
|
|
450
|
+
}), console.error("PDF download error:", h);
|
|
450
451
|
} finally {
|
|
451
|
-
|
|
452
|
+
m(!1);
|
|
452
453
|
}
|
|
453
454
|
}
|
|
454
455
|
return /* @__PURE__ */ e(
|
|
455
456
|
$,
|
|
456
457
|
{
|
|
457
458
|
open: c,
|
|
458
|
-
onOpenChange: (
|
|
459
|
-
if (!
|
|
460
|
-
|
|
459
|
+
onOpenChange: (t) => {
|
|
460
|
+
if (!t) {
|
|
461
|
+
x();
|
|
461
462
|
return;
|
|
462
463
|
}
|
|
463
464
|
i(!0);
|
|
@@ -468,28 +469,28 @@ function ea({
|
|
|
468
469
|
/* @__PURE__ */ e(K, { children: "Export your dashboard as a PDF document." })
|
|
469
470
|
] }),
|
|
470
471
|
/* @__PURE__ */ a("div", { className: "space-y-4 py-4", children: [
|
|
471
|
-
|
|
472
|
+
N && /* @__PURE__ */ a(F, { children: [
|
|
472
473
|
/* @__PURE__ */ a("div", { className: "space-y-3", children: [
|
|
473
|
-
/* @__PURE__ */ e(
|
|
474
|
+
/* @__PURE__ */ e(A, { children: "Export Scope" }),
|
|
474
475
|
/* @__PURE__ */ a(
|
|
475
476
|
ye,
|
|
476
477
|
{
|
|
477
478
|
value: s.sheetSelection,
|
|
478
|
-
onValueChange: (
|
|
479
|
+
onValueChange: (t) => l({
|
|
479
480
|
...s,
|
|
480
|
-
sheetSelection:
|
|
481
|
+
sheetSelection: t
|
|
481
482
|
}),
|
|
482
483
|
children: [
|
|
483
484
|
/* @__PURE__ */ a("div", { className: "flex items-center space-x-2", children: [
|
|
484
485
|
/* @__PURE__ */ e(R, { value: "current", id: "scope-current" }),
|
|
485
486
|
/* @__PURE__ */ a(
|
|
486
|
-
|
|
487
|
+
A,
|
|
487
488
|
{
|
|
488
489
|
htmlFor: "scope-current",
|
|
489
490
|
className: "cursor-pointer font-normal",
|
|
490
491
|
children: [
|
|
491
492
|
"This sheet (",
|
|
492
|
-
(
|
|
493
|
+
(p == null ? void 0 : p.title) || "Current",
|
|
493
494
|
")"
|
|
494
495
|
]
|
|
495
496
|
}
|
|
@@ -498,13 +499,13 @@ function ea({
|
|
|
498
499
|
/* @__PURE__ */ a("div", { className: "flex items-center space-x-2", children: [
|
|
499
500
|
/* @__PURE__ */ e(R, { value: "all", id: "scope-all" }),
|
|
500
501
|
/* @__PURE__ */ a(
|
|
501
|
-
|
|
502
|
+
A,
|
|
502
503
|
{
|
|
503
504
|
htmlFor: "scope-all",
|
|
504
505
|
className: "cursor-pointer font-normal",
|
|
505
506
|
children: [
|
|
506
507
|
"All sheets (",
|
|
507
|
-
|
|
508
|
+
n == null ? void 0 : n.length,
|
|
508
509
|
" sheets)"
|
|
509
510
|
]
|
|
510
511
|
}
|
|
@@ -523,17 +524,17 @@ function ea({
|
|
|
523
524
|
{
|
|
524
525
|
id: "protect-pdf",
|
|
525
526
|
checked: s.protectPdf,
|
|
526
|
-
onCheckedChange: (
|
|
527
|
-
|
|
527
|
+
onCheckedChange: (t) => {
|
|
528
|
+
l({
|
|
528
529
|
...s,
|
|
529
|
-
protectPdf:
|
|
530
|
-
password:
|
|
531
|
-
}),
|
|
530
|
+
protectPdf: t,
|
|
531
|
+
password: t ? s.password : ""
|
|
532
|
+
}), t || o(!1);
|
|
532
533
|
}
|
|
533
534
|
}
|
|
534
535
|
),
|
|
535
536
|
/* @__PURE__ */ a(
|
|
536
|
-
|
|
537
|
+
A,
|
|
537
538
|
{
|
|
538
539
|
htmlFor: "protect-pdf",
|
|
539
540
|
className: "flex cursor-pointer items-center text-sm font-normal",
|
|
@@ -545,31 +546,31 @@ function ea({
|
|
|
545
546
|
)
|
|
546
547
|
] }),
|
|
547
548
|
s.protectPdf && /* @__PURE__ */ a("div", { className: "ml-6 space-y-2", children: [
|
|
548
|
-
/* @__PURE__ */ e(
|
|
549
|
+
/* @__PURE__ */ e(A, { htmlFor: "pdf-password", className: "text-sm", children: "Password" }),
|
|
549
550
|
/* @__PURE__ */ a("div", { className: "relative", children: [
|
|
550
551
|
/* @__PURE__ */ e(
|
|
551
552
|
Ae,
|
|
552
553
|
{
|
|
553
554
|
id: "pdf-password",
|
|
554
|
-
type:
|
|
555
|
+
type: r ? "text" : "password",
|
|
555
556
|
value: s.password,
|
|
556
|
-
onChange: (
|
|
557
|
+
onChange: (t) => l({ ...s, password: t.target.value }),
|
|
557
558
|
placeholder: "Enter password",
|
|
558
559
|
className: "pr-10",
|
|
559
|
-
onKeyDown: (
|
|
560
|
-
|
|
560
|
+
onKeyDown: (t) => {
|
|
561
|
+
t.key === "Enter" && s.password && D();
|
|
561
562
|
}
|
|
562
563
|
}
|
|
563
564
|
),
|
|
564
565
|
/* @__PURE__ */ e(
|
|
565
|
-
|
|
566
|
+
P,
|
|
566
567
|
{
|
|
567
568
|
type: "button",
|
|
568
569
|
variant: "ghost",
|
|
569
570
|
size: "sm",
|
|
570
571
|
className: "absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent",
|
|
571
|
-
onClick: () =>
|
|
572
|
-
children:
|
|
572
|
+
onClick: () => o(!r),
|
|
573
|
+
children: r ? /* @__PURE__ */ e(Pe, { className: "h-4 w-4 text-muted-foreground" }) : /* @__PURE__ */ e(Fe, { className: "h-4 w-4 text-muted-foreground" })
|
|
573
574
|
}
|
|
574
575
|
)
|
|
575
576
|
] }),
|
|
@@ -578,12 +579,12 @@ function ea({
|
|
|
578
579
|
] })
|
|
579
580
|
] }),
|
|
580
581
|
/* @__PURE__ */ a(Q, { children: [
|
|
581
|
-
/* @__PURE__ */ e(
|
|
582
|
-
/* @__PURE__ */ e(
|
|
582
|
+
/* @__PURE__ */ e(P, { variant: "outline", onClick: x, disabled: d, children: "Cancel" }),
|
|
583
|
+
/* @__PURE__ */ e(P, { onClick: D, disabled: d, children: d ? /* @__PURE__ */ a(F, { children: [
|
|
583
584
|
/* @__PURE__ */ e(T, { className: "mr-2 h-4 w-4 animate-spin" }),
|
|
584
585
|
"Exporting..."
|
|
585
586
|
] }) : /* @__PURE__ */ a(F, { children: [
|
|
586
|
-
/* @__PURE__ */ e(
|
|
587
|
+
/* @__PURE__ */ e(ke, { className: "mr-2 h-4 w-4" }),
|
|
587
588
|
"Export"
|
|
588
589
|
] }) })
|
|
589
590
|
] })
|