react-semaphor 0.1.303 → 0.1.305
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/brand-studio/index.cjs +1 -1
- package/dist/brand-studio/index.js +4 -4
- package/dist/chunks/common-types-C6cAQgyh.js +9 -0
- package/dist/chunks/common-types-nBuCd3u2.js +1 -0
- package/dist/chunks/dashboard-controls-BcwXajYv.js +47 -0
- package/dist/chunks/{dashboard-controls-BCJZOzrL.js → dashboard-controls-DjOO0fkG.js} +799 -774
- package/dist/chunks/{dashboard-filter-controls-button-C-e7230k.js → dashboard-filter-controls-button-CR0_duPw.js} +3 -3
- package/dist/chunks/{dashboard-filter-controls-button-Cfbac4Jw.js → dashboard-filter-controls-button-YvRfoUuN.js} +142 -142
- package/dist/chunks/{dashboard-json-BzvLPhGM.js → dashboard-json-BYLaWi0-.js} +2 -2
- package/dist/chunks/{dashboard-json-BM5ywMgp.js → dashboard-json-tOsNVccY.js} +1 -1
- package/dist/chunks/{dashboard-summary-settings-dialog-ChK3344r.js → dashboard-summary-settings-dialog-CMxi2arh.js} +2 -2
- package/dist/chunks/{dashboard-summary-settings-dialog-BdxKl1UF.js → dashboard-summary-settings-dialog-DioOegLQ.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-nNaZ2IK1.js → edit-dashboard-visual-331vOmKT.js} +2 -2
- package/dist/chunks/{edit-dashboard-visual-D725CWD5.js → edit-dashboard-visual-ClLcFLD_.js} +164 -164
- package/dist/chunks/index-BOGpMmRo.js +1360 -0
- package/dist/chunks/{index-CYWgnME0.js → index-DJFckbGE.js} +42308 -40062
- package/dist/chunks/{palette-B9DJXMGo.js → palette-BqJlrRto.js} +1 -1
- package/dist/chunks/{palette-DGOzbtsn.js → palette-DD-i7bNS.js} +1 -1
- package/dist/chunks/{resource-management-panel-CE0-NcLL.js → resource-management-panel-BS9nfJbb.js} +65 -65
- package/dist/chunks/{resource-management-panel-mJmc5dMT.js → resource-management-panel-CoHy6cOi.js} +1 -1
- package/dist/chunks/{rotate-ccw-Bs7YJn10.js → rotate-ccw-CdGW8Rxm.js} +1 -1
- package/dist/chunks/{rotate-ccw-YsjQwpKm.js → rotate-ccw-X8MbX_hF.js} +1 -1
- package/dist/chunks/{save-Bj1y1rug.js → save-CFBIhbHD.js} +1 -1
- package/dist/chunks/{save-CUrexoNl.js → save-j-clxFtx.js} +1 -1
- package/dist/chunks/{switch-oojO-gal.js → switch-BFhVVwh9.js} +4248 -3243
- package/dist/chunks/switch-BH17qlxH.js +163 -0
- package/dist/chunks/use-create-flow-overlay-state-BSUi4chy.js +16 -0
- package/dist/chunks/{use-create-flow-overlay-state-BHDKxe7I.js → use-create-flow-overlay-state-Lmk-mIkA.js} +318 -316
- package/dist/chunks/{use-visual-utils-DYDXMl5v.js → use-visual-utils-CR9nLyEz.js} +1 -1
- package/dist/chunks/{use-visual-utils-CjFzlR0P.js → use-visual-utils-CikIkKb2.js} +2 -2
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +5 -5
- package/dist/index.cjs +1 -1
- package/dist/index.js +60 -59
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +6 -6
- package/dist/types/dashboard.d.ts +168 -0
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.js +8 -11
- package/dist/types/main.d.ts +194 -2
- package/dist/types/shared.d.ts +120 -0
- package/dist/types/surfboard.d.ts +168 -0
- package/dist/types/types.d.ts +168 -0
- package/package.json +1 -1
- package/dist/chunks/dashboard-controls-CVFoOPti.js +0 -47
- package/dist/chunks/index-BWjB_9uz.js +0 -1356
- package/dist/chunks/switch-CiEX68py.js +0 -163
- package/dist/chunks/use-create-flow-overlay-state-D2I2wNey.js +0 -16
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { c as De, n as L, u as le, z as ft, A as ht, D as bt, a as ne, F as gt, ad as yt, B as
|
|
2
|
-
import { jsx as t, jsxs as d, Fragment as
|
|
3
|
-
import { b0 as
|
|
4
|
-
import { useMemo as z, useState as j, useRef as ke, useCallback as B, useEffect as Se, Fragment as
|
|
5
|
-
import { u as we } from "./use-visual-utils-
|
|
6
|
-
import { S as nt } from "./save-
|
|
1
|
+
import { c as De, n as L, u as le, z as ft, A as ht, D as bt, a as ne, F as gt, ad as yt, B as E, e as xt, l as Ne, X as Pe, m as Ye, f as Ge, ae as vt, af as Ct, ag as re, ah as Ae, ai as ze, aj as fe, ak as he, al as kt, am as Oe, an as Nt, ao as St, ap as se, aq as Dt, ar as Be, G as Me, as as Xe, at as He, au as Je, L as Y, I as We, g as be, h as ge, i as ye, j as xe, k as ve, av as Ze, aw as wt, ax as It, ay as Qe, az as Vt, aA as je, aB as Tt, aC as Ce } from "./switch-BFhVVwh9.js";
|
|
2
|
+
import { jsx as t, jsxs as d, Fragment as K } from "react/jsx-runtime";
|
|
3
|
+
import { b0 as et, b1 as Et, b2 as qt, b3 as Ft, b4 as _t, b5 as Lt, W as At, Q as zt, r as ie, b6 as tt, t as at, b7 as rt, b8 as Ot, p as Q, b9 as Bt, ba as Mt, bb as Re, bc as Qt, bd as jt, be as st, bf as lt, bg as Rt, bh as Ut, bi as $t, bj as Kt, bk as Pt, bl as Yt, bm as Gt, bn as Xt } from "./index-DJFckbGE.js";
|
|
4
|
+
import { useMemo as z, useState as j, useRef as ke, useCallback as B, useEffect as Se, Fragment as Ht } from "react";
|
|
5
|
+
import { u as we } from "./use-visual-utils-CikIkKb2.js";
|
|
6
|
+
import { S as nt } from "./save-j-clxFtx.js";
|
|
7
7
|
/**
|
|
8
8
|
* @license lucide-react v0.453.0 - ISC
|
|
9
9
|
*
|
|
10
10
|
* This source code is licensed under the ISC license.
|
|
11
11
|
* See the LICENSE file in the root directory of this source tree.
|
|
12
12
|
*/
|
|
13
|
-
const
|
|
13
|
+
const ca = De("CircleX", [
|
|
14
14
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
15
15
|
["path", { d: "m15 9-6 6", key: "1uzhvr" }],
|
|
16
16
|
["path", { d: "m9 9 6 6", key: "z0biqf" }]
|
|
@@ -21,7 +21,7 @@ const dr = De("CircleX", [
|
|
|
21
21
|
* This source code is licensed under the ISC license.
|
|
22
22
|
* See the LICENSE file in the root directory of this source tree.
|
|
23
23
|
*/
|
|
24
|
-
const
|
|
24
|
+
const Jt = De("Library", [
|
|
25
25
|
["path", { d: "m16 6 4 14", key: "ji33uf" }],
|
|
26
26
|
["path", { d: "M12 6v14", key: "1n7gus" }],
|
|
27
27
|
["path", { d: "M8 8v12", key: "1gg7y9" }],
|
|
@@ -33,17 +33,17 @@ const Ht = De("Library", [
|
|
|
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 Wt = De("Link2", [
|
|
37
37
|
["path", { d: "M9 17H7A5 5 0 0 1 7 7h2", key: "8i5ue5" }],
|
|
38
38
|
["path", { d: "M15 7h2a5 5 0 1 1 0 10h-2", key: "1b9ql8" }],
|
|
39
39
|
["line", { x1: "8", x2: "16", y1: "12", y2: "12", key: "1jonct" }]
|
|
40
40
|
]);
|
|
41
41
|
function ot() {
|
|
42
42
|
var h, C;
|
|
43
|
-
const s = L((y) => y.card),
|
|
44
|
-
() =>
|
|
45
|
-
[
|
|
46
|
-
), { manifest: i } =
|
|
43
|
+
const s = L((y) => y.card), r = L((y) => y.frame), o = z(
|
|
44
|
+
() => et(r, s),
|
|
45
|
+
[r, s]
|
|
46
|
+
), { manifest: i } = Et(
|
|
47
47
|
((h = o == null ? void 0 : o.customCardPreferences) == null ? void 0 : h.url) || ""
|
|
48
48
|
), f = z(
|
|
49
49
|
() => {
|
|
@@ -56,38 +56,38 @@ function ot() {
|
|
|
56
56
|
);
|
|
57
57
|
},
|
|
58
58
|
[i, (C = o == null ? void 0 : o.customCardPreferences) == null ? void 0 : C.componentName]
|
|
59
|
-
), u =
|
|
60
|
-
() =>
|
|
61
|
-
frame:
|
|
59
|
+
), u = qt(o, f), b = z(
|
|
60
|
+
() => Ft({
|
|
61
|
+
frame: r,
|
|
62
62
|
configCard: o,
|
|
63
63
|
isMultiInputVisual: u === "multiple"
|
|
64
64
|
}),
|
|
65
|
-
[
|
|
65
|
+
[r, o, u]
|
|
66
66
|
), x = z(() => {
|
|
67
67
|
const y = b.findIndex(
|
|
68
68
|
(m) => (m == null ? void 0 : m.id) === s.id
|
|
69
69
|
);
|
|
70
|
-
return y < 0 ? -1 :
|
|
70
|
+
return y < 0 ? -1 : _t(s, y);
|
|
71
71
|
}, [b, s]);
|
|
72
|
-
return z(() => !o || u !== "multiple" || x < 0 ? s.type :
|
|
72
|
+
return z(() => !o || u !== "multiple" || x < 0 ? s.type : Lt(
|
|
73
73
|
s,
|
|
74
74
|
x,
|
|
75
75
|
f == null ? void 0 : f.slots
|
|
76
76
|
) ?? s.type, [o, u, x, s, f == null ? void 0 : f.slots]);
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function ua({
|
|
79
79
|
type: s,
|
|
80
|
-
isLinked:
|
|
80
|
+
isLinked: r,
|
|
81
81
|
className: o,
|
|
82
82
|
showLabel: i = !1,
|
|
83
83
|
showLocal: f = !1
|
|
84
84
|
}) {
|
|
85
|
-
const u = le((N) => N.selectedFrameId), b =
|
|
85
|
+
const u = le((N) => N.selectedFrameId), b = At((N) => N.selectedVisual), x = L((N) => N.frame);
|
|
86
86
|
let h;
|
|
87
87
|
if (s)
|
|
88
88
|
h = s;
|
|
89
|
-
else if (
|
|
90
|
-
h =
|
|
89
|
+
else if (r !== void 0)
|
|
90
|
+
h = r ? "linked" : "library";
|
|
91
91
|
else if (!!!(x != null && x.visualId || b != null && b.id) && u)
|
|
92
92
|
h = "local";
|
|
93
93
|
else if (b && !u)
|
|
@@ -116,10 +116,10 @@ function cr({
|
|
|
116
116
|
local: "fill-slate-50 dark:fill-slate-900",
|
|
117
117
|
linked: "fill-purple-50 dark:fill-purple-950",
|
|
118
118
|
library: "fill-blue-50 dark:fill-blue-950"
|
|
119
|
-
},
|
|
119
|
+
}, V = {
|
|
120
120
|
local: /* @__PURE__ */ t("span", { className: "h-2 w-2 rounded-full bg-current/70" }),
|
|
121
|
-
linked: /* @__PURE__ */ t(
|
|
122
|
-
library: /* @__PURE__ */ t(
|
|
121
|
+
linked: /* @__PURE__ */ t(Wt, { className: "h-3.5 w-3.5" }),
|
|
122
|
+
library: /* @__PURE__ */ t(Jt, { className: "h-3.5 w-3.5" })
|
|
123
123
|
}, k = {
|
|
124
124
|
local: "Local",
|
|
125
125
|
linked: "Linked",
|
|
@@ -127,7 +127,7 @@ function cr({
|
|
|
127
127
|
};
|
|
128
128
|
return /* @__PURE__ */ t(ft, { children: /* @__PURE__ */ d(ht, { delayDuration: 300, children: [
|
|
129
129
|
/* @__PURE__ */ t(bt, { asChild: !0, children: /* @__PURE__ */ d(
|
|
130
|
-
|
|
130
|
+
zt,
|
|
131
131
|
{
|
|
132
132
|
variant: "outline",
|
|
133
133
|
className: ne(
|
|
@@ -136,7 +136,7 @@ function cr({
|
|
|
136
136
|
o
|
|
137
137
|
),
|
|
138
138
|
children: [
|
|
139
|
-
|
|
139
|
+
V[h],
|
|
140
140
|
i && /* @__PURE__ */ t("span", { className: "ml-1 text-xs font-medium leading-none", children: k[h] })
|
|
141
141
|
]
|
|
142
142
|
}
|
|
@@ -154,7 +154,7 @@ function cr({
|
|
|
154
154
|
)
|
|
155
155
|
] }) });
|
|
156
156
|
}
|
|
157
|
-
function
|
|
157
|
+
function Zt(s, r) {
|
|
158
158
|
return {
|
|
159
159
|
...s,
|
|
160
160
|
sql: "",
|
|
@@ -165,18 +165,18 @@ function Wt(s, a) {
|
|
|
165
165
|
interactionConfig: void 0,
|
|
166
166
|
linkedInteractionTargetOverrides: void 0,
|
|
167
167
|
dynamicCardPreferences: void 0,
|
|
168
|
-
customCardPreferences:
|
|
168
|
+
customCardPreferences: r ? s.customCardPreferences : void 0,
|
|
169
169
|
visualizationMode: "builtin",
|
|
170
|
-
type:
|
|
170
|
+
type: r ? s.type : "bar"
|
|
171
171
|
};
|
|
172
172
|
}
|
|
173
173
|
function Ie(s) {
|
|
174
|
-
const
|
|
175
|
-
return
|
|
174
|
+
const r = vt(s);
|
|
175
|
+
return r ? (Q.error(r), !1) : !0;
|
|
176
176
|
}
|
|
177
|
-
function
|
|
177
|
+
function pa({
|
|
178
178
|
className: s,
|
|
179
|
-
variant:
|
|
179
|
+
variant: r = "outline"
|
|
180
180
|
}) {
|
|
181
181
|
const o = L((u) => u.onSave), { getUpdatedFrame: i } = we();
|
|
182
182
|
function f() {
|
|
@@ -184,12 +184,12 @@ function ur({
|
|
|
184
184
|
Ie(u) && (o == null || o(u));
|
|
185
185
|
}
|
|
186
186
|
return /* @__PURE__ */ d(
|
|
187
|
-
|
|
187
|
+
E,
|
|
188
188
|
{
|
|
189
189
|
onClick: f,
|
|
190
190
|
className: s,
|
|
191
191
|
size: "xs",
|
|
192
|
-
variant:
|
|
192
|
+
variant: r,
|
|
193
193
|
children: [
|
|
194
194
|
/* @__PURE__ */ t(xt, { className: "h-3.5 w-3.5" }),
|
|
195
195
|
"Accept"
|
|
@@ -197,28 +197,28 @@ function ur({
|
|
|
197
197
|
}
|
|
198
198
|
);
|
|
199
199
|
}
|
|
200
|
-
function
|
|
200
|
+
function ma({
|
|
201
201
|
className: s,
|
|
202
|
-
variant:
|
|
202
|
+
variant: r = "default"
|
|
203
203
|
}) {
|
|
204
204
|
const o = ie(), [i, f] = j(!1), u = le(
|
|
205
205
|
(v) => v.actions.setIsDashboardPanelOpen
|
|
206
|
-
), { setIsVisualEditing: b } =
|
|
206
|
+
), { setIsVisualEditing: b } = Ye(), { getUpdatedFrame: x } = we(), h = at(), C = L((v) => v.frame), y = rt();
|
|
207
207
|
return /* @__PURE__ */ t(
|
|
208
|
-
|
|
208
|
+
E,
|
|
209
209
|
{
|
|
210
210
|
onClick: () => {
|
|
211
211
|
const v = x();
|
|
212
212
|
if (!Ie(v))
|
|
213
213
|
return;
|
|
214
|
-
const
|
|
215
|
-
if (!
|
|
214
|
+
const V = (C == null ? void 0 : C.visualId) || (h == null ? void 0 : h.id);
|
|
215
|
+
if (!V) {
|
|
216
216
|
Q.error("No visual to save");
|
|
217
217
|
return;
|
|
218
218
|
}
|
|
219
219
|
f(!0), y.mutate(
|
|
220
220
|
{
|
|
221
|
-
visualId:
|
|
221
|
+
visualId: V,
|
|
222
222
|
data: {
|
|
223
223
|
frameObject: v
|
|
224
224
|
}
|
|
@@ -226,7 +226,7 @@ function pr({
|
|
|
226
226
|
{
|
|
227
227
|
onSuccess: () => {
|
|
228
228
|
f(!1), u(!0), Q.success("Visual updated successfully"), o.invalidateQueries({
|
|
229
|
-
queryKey: ["resource-by-id", "visual",
|
|
229
|
+
queryKey: ["resource-by-id", "visual", V],
|
|
230
230
|
exact: !0
|
|
231
231
|
});
|
|
232
232
|
},
|
|
@@ -238,23 +238,23 @@ function pr({
|
|
|
238
238
|
},
|
|
239
239
|
className: s,
|
|
240
240
|
size: "xs",
|
|
241
|
-
variant:
|
|
242
|
-
children: i ? /* @__PURE__ */ d(
|
|
243
|
-
/* @__PURE__ */ t(
|
|
241
|
+
variant: r,
|
|
242
|
+
children: i ? /* @__PURE__ */ d(K, { children: [
|
|
243
|
+
/* @__PURE__ */ t(Ge, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
244
244
|
"Saving"
|
|
245
|
-
] }) : /* @__PURE__ */ d(
|
|
245
|
+
] }) : /* @__PURE__ */ d(K, { children: [
|
|
246
246
|
/* @__PURE__ */ t(nt, { className: "h-3.5 w-3.5" }),
|
|
247
247
|
"Save to Library"
|
|
248
248
|
] })
|
|
249
249
|
}
|
|
250
250
|
);
|
|
251
251
|
}
|
|
252
|
-
function
|
|
252
|
+
function fa({
|
|
253
253
|
className: s
|
|
254
254
|
}) {
|
|
255
|
-
const
|
|
255
|
+
const r = ie(), [o, i] = j(!1), f = at(), u = L((k) => k.frame), b = le((k) => k.selectedSheetId), x = le((k) => k.dashboard), { updateFrame: h, setIsVisualEditing: C } = Ye(), { getUpdatedFrame: y } = we(), m = rt(), v = Ot();
|
|
256
256
|
return /* @__PURE__ */ t(
|
|
257
|
-
|
|
257
|
+
E,
|
|
258
258
|
{
|
|
259
259
|
onClick: async () => {
|
|
260
260
|
if (!b) {
|
|
@@ -273,21 +273,21 @@ function mr({
|
|
|
273
273
|
i(!1);
|
|
274
274
|
return;
|
|
275
275
|
}
|
|
276
|
-
const
|
|
276
|
+
const F = {
|
|
277
277
|
...N,
|
|
278
278
|
visualId: k
|
|
279
279
|
// Keep the link to library visual
|
|
280
|
-
},
|
|
281
|
-
previousFrame:
|
|
280
|
+
}, G = Bt(x, F.id), X = await v(F, {
|
|
281
|
+
previousFrame: G
|
|
282
282
|
});
|
|
283
283
|
await m.mutateAsync({
|
|
284
284
|
visualId: k,
|
|
285
285
|
data: {
|
|
286
286
|
frameObject: N
|
|
287
287
|
}
|
|
288
|
-
}), h(b,
|
|
288
|
+
}), h(b, F, {
|
|
289
289
|
semanticExecutionPayload: X
|
|
290
|
-
}),
|
|
290
|
+
}), r.invalidateQueries({ queryKey: ["visuals"] }), r.invalidateQueries({ queryKey: ["visual", k] }), Q.success("Saved to library and applied locally"), setTimeout(() => {
|
|
291
291
|
C(!1);
|
|
292
292
|
}, 300);
|
|
293
293
|
} catch (N) {
|
|
@@ -302,18 +302,18 @@ function mr({
|
|
|
302
302
|
size: "xs",
|
|
303
303
|
variant: "default",
|
|
304
304
|
disabled: o,
|
|
305
|
-
children: o ? /* @__PURE__ */ d(
|
|
306
|
-
/* @__PURE__ */ t(
|
|
305
|
+
children: o ? /* @__PURE__ */ d(K, { children: [
|
|
306
|
+
/* @__PURE__ */ t(Ge, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
307
307
|
"Saving..."
|
|
308
|
-
] }) : /* @__PURE__ */ d(
|
|
308
|
+
] }) : /* @__PURE__ */ d(K, { children: [
|
|
309
309
|
/* @__PURE__ */ t(nt, { className: "h-3.5 w-3.5" }),
|
|
310
310
|
"Save & Apply"
|
|
311
311
|
] })
|
|
312
312
|
}
|
|
313
313
|
);
|
|
314
314
|
}
|
|
315
|
-
function
|
|
316
|
-
const { setTempQueryData:
|
|
315
|
+
function ha({ className: s }) {
|
|
316
|
+
const { setTempQueryData: r, setSqlGen: o } = Ne(), i = ie(), f = L((m) => m.tempQueryData), u = L((m) => m.onClose), b = L((m) => m.card), x = ot(), h = z(() => x !== b.type ? { ...b, type: x } : b, [b, x]), { queryKey: C } = tt(h);
|
|
317
317
|
function y() {
|
|
318
318
|
if (f) {
|
|
319
319
|
const { queryKey: m, queryData: v } = f;
|
|
@@ -322,7 +322,7 @@ function fr({ className: s }) {
|
|
|
322
322
|
o({}), u == null || u();
|
|
323
323
|
}
|
|
324
324
|
return /* @__PURE__ */ d(
|
|
325
|
-
|
|
325
|
+
E,
|
|
326
326
|
{
|
|
327
327
|
onClick: y,
|
|
328
328
|
className: s,
|
|
@@ -335,46 +335,46 @@ function fr({ className: s }) {
|
|
|
335
335
|
}
|
|
336
336
|
);
|
|
337
337
|
}
|
|
338
|
-
function
|
|
338
|
+
function ba({
|
|
339
339
|
label: s = "Clear",
|
|
340
|
-
variant:
|
|
340
|
+
variant: r = "secondary",
|
|
341
341
|
className: o
|
|
342
342
|
} = {}) {
|
|
343
|
-
const { setTempQueryData: i } = Ne(), f = ie(), u = L((O) => O.tempQueryData), b = L((O) => O.card), x = ot(), h = z(() => x !== b.type ? { ...b, type: x } : b, [b, x]), { queryKey: C } =
|
|
343
|
+
const { setTempQueryData: i } = Ne(), f = ie(), u = L((O) => O.tempQueryData), b = L((O) => O.card), x = ot(), h = z(() => x !== b.type ? { ...b, type: x } : b, [b, x]), { queryKey: C } = tt(h), {
|
|
344
344
|
setCardSql: y,
|
|
345
345
|
setSqlGen: m,
|
|
346
346
|
setCardPython: v,
|
|
347
|
-
setCardCustomCfg:
|
|
347
|
+
setCardCustomCfg: V,
|
|
348
348
|
setCardPreferences: k,
|
|
349
349
|
clearQueryConfig: N,
|
|
350
|
-
setCardConfig:
|
|
351
|
-
setCardType:
|
|
350
|
+
setCardConfig: F,
|
|
351
|
+
setCardType: G,
|
|
352
352
|
setFrame: X,
|
|
353
353
|
setCard: te,
|
|
354
354
|
setActiveTabCardId: H
|
|
355
355
|
} = Ne();
|
|
356
356
|
function de() {
|
|
357
|
-
var J,
|
|
357
|
+
var J, ae, q, W;
|
|
358
358
|
const O = f.getQueryData(C);
|
|
359
359
|
u != null && u.queryData || i({
|
|
360
360
|
queryKey: C,
|
|
361
361
|
queryData: O
|
|
362
|
-
}), f.setQueryData(C, null), f.removeQueries({ queryKey: C, exact: !0 }), y(""), m({}), N(),
|
|
363
|
-
const
|
|
362
|
+
}), f.setQueryData(C, null), f.removeQueries({ queryKey: C, exact: !0 }), y(""), m({}), N(), F(void 0), v(""), V(""), k({});
|
|
363
|
+
const a = L.getState().frame, I = L.getState().card, T = et(a, I), M = ((J = T == null ? void 0 : T.customCardPreferences) == null ? void 0 : J.visualType) === "multiple" || !!((ae = T == null ? void 0 : T.customCardPreferences) != null && ae.dataInputCardIds) || (((q = T == null ? void 0 : T.customCardPreferences) == null ? void 0 : q.minInputs) || 0) > 1 || (((W = T == null ? void 0 : T.customCardPreferences) == null ? void 0 : W.maxInputs) || 0) > 1, R = Zt(I, M);
|
|
364
364
|
X({
|
|
365
|
-
...
|
|
366
|
-
cards:
|
|
365
|
+
...a,
|
|
366
|
+
cards: a.cards.map(
|
|
367
367
|
(U) => U.id === R.id ? R : U
|
|
368
368
|
)
|
|
369
|
-
}), H(R.id), te(R), M ||
|
|
369
|
+
}), H(R.id), te(R), M || G("bar");
|
|
370
370
|
}
|
|
371
371
|
return /* @__PURE__ */ d(
|
|
372
|
-
|
|
372
|
+
E,
|
|
373
373
|
{
|
|
374
374
|
onClick: de,
|
|
375
375
|
className: o,
|
|
376
376
|
size: "xs",
|
|
377
|
-
variant:
|
|
377
|
+
variant: r,
|
|
378
378
|
children: [
|
|
379
379
|
/* @__PURE__ */ t(Pe, { className: "h-3.5 w-3.5" }),
|
|
380
380
|
s
|
|
@@ -383,25 +383,25 @@ function hr({
|
|
|
383
383
|
);
|
|
384
384
|
}
|
|
385
385
|
function it(s) {
|
|
386
|
-
const { control:
|
|
386
|
+
const { control: r, onChange: o } = s;
|
|
387
387
|
return /* @__PURE__ */ d("div", { className: "flex flex-col gap-1.5", children: [
|
|
388
|
-
/* @__PURE__ */ t(
|
|
388
|
+
/* @__PURE__ */ t(Y, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Label" }),
|
|
389
389
|
/* @__PURE__ */ t(
|
|
390
|
-
|
|
390
|
+
We,
|
|
391
391
|
{
|
|
392
392
|
size: "xs",
|
|
393
|
-
value:
|
|
393
|
+
value: r.label,
|
|
394
394
|
placeholder: "Control label",
|
|
395
395
|
onChange: (i) => o(i.target.value)
|
|
396
396
|
}
|
|
397
397
|
)
|
|
398
398
|
] });
|
|
399
399
|
}
|
|
400
|
-
function
|
|
401
|
-
const { currentStep:
|
|
400
|
+
function ea(s) {
|
|
401
|
+
const { currentStep: r, labels: o } = s;
|
|
402
402
|
return /* @__PURE__ */ t("div", { className: "sticky top-0 z-10 -mx-1 border-b border-border/60 bg-background/95 px-1 pb-2.5 pt-1 backdrop-blur supports-[backdrop-filter]:bg-background/85", children: /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-2 sm:gap-2.5", children: o.map((i, f) => {
|
|
403
|
-
const u = f + 1, b = u ===
|
|
404
|
-
return /* @__PURE__ */ d(
|
|
403
|
+
const u = f + 1, b = u === r, x = u < r;
|
|
404
|
+
return /* @__PURE__ */ d(Ht, { children: [
|
|
405
405
|
/* @__PURE__ */ d("div", { className: "flex items-center gap-1.5", children: [
|
|
406
406
|
/* @__PURE__ */ t(
|
|
407
407
|
"span",
|
|
@@ -435,27 +435,27 @@ function Zt(s) {
|
|
|
435
435
|
}) }) });
|
|
436
436
|
}
|
|
437
437
|
function oe(s) {
|
|
438
|
-
const { secondary:
|
|
438
|
+
const { secondary: r, tertiary: o, primary: i } = s;
|
|
439
439
|
return /* @__PURE__ */ d("div", { className: "sticky bottom-0 z-10 -mx-1 flex justify-end gap-2 border-t bg-background/95 px-1 pb-1 pt-3 backdrop-blur supports-[backdrop-filter]:bg-background/85", children: [
|
|
440
|
-
|
|
440
|
+
r,
|
|
441
441
|
o,
|
|
442
442
|
i
|
|
443
443
|
] });
|
|
444
444
|
}
|
|
445
|
-
function
|
|
446
|
-
const { control:
|
|
445
|
+
function ta(s) {
|
|
446
|
+
const { control: r, scope: o, detail: i } = s;
|
|
447
447
|
return /* @__PURE__ */ d("div", { className: "flex items-start gap-2.5 rounded-control border border-border/60 bg-muted/30 px-3 py-2.5", children: [
|
|
448
|
-
/* @__PURE__ */ t(
|
|
448
|
+
/* @__PURE__ */ t(Xt, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-foreground" }),
|
|
449
449
|
/* @__PURE__ */ d("div", { className: "min-w-0 space-y-0.5", children: [
|
|
450
|
-
/* @__PURE__ */ t("div", { className: "text-[13px] font-medium text-foreground", children:
|
|
450
|
+
/* @__PURE__ */ t("div", { className: "text-[13px] font-medium text-foreground", children: r.label }),
|
|
451
451
|
/* @__PURE__ */ d("div", { className: "text-[12px] text-muted-foreground", children: [
|
|
452
|
-
|
|
452
|
+
Xe(r.type).label,
|
|
453
453
|
" ·",
|
|
454
454
|
" ",
|
|
455
|
-
|
|
455
|
+
Je(r),
|
|
456
456
|
" ·",
|
|
457
457
|
" ",
|
|
458
|
-
|
|
458
|
+
He(o, r.placement)
|
|
459
459
|
] }),
|
|
460
460
|
i ? /* @__PURE__ */ t("div", { className: "text-[12px] text-muted-foreground", children: i }) : null
|
|
461
461
|
] })
|
|
@@ -463,7 +463,7 @@ function er(s) {
|
|
|
463
463
|
}
|
|
464
464
|
function Ue(s) {
|
|
465
465
|
const {
|
|
466
|
-
control:
|
|
466
|
+
control: r,
|
|
467
467
|
defaultValue: o,
|
|
468
468
|
availableFieldChoices: i,
|
|
469
469
|
availableMetricChoices: f,
|
|
@@ -477,11 +477,11 @@ function Ue(s) {
|
|
|
477
477
|
nextDisabled: v
|
|
478
478
|
} = s;
|
|
479
479
|
return /* @__PURE__ */ d("div", { className: "space-y-3", children: [
|
|
480
|
-
/* @__PURE__ */ t(it, { control:
|
|
480
|
+
/* @__PURE__ */ t(it, { control: r, onChange: h }),
|
|
481
481
|
/* @__PURE__ */ t(
|
|
482
482
|
st,
|
|
483
483
|
{
|
|
484
|
-
control:
|
|
484
|
+
control: r,
|
|
485
485
|
availableFieldChoices: i,
|
|
486
486
|
availableMetricChoices: f,
|
|
487
487
|
previewControlDefinitions: u,
|
|
@@ -493,7 +493,7 @@ function Ue(s) {
|
|
|
493
493
|
/* @__PURE__ */ t(
|
|
494
494
|
lt,
|
|
495
495
|
{
|
|
496
|
-
control:
|
|
496
|
+
control: r,
|
|
497
497
|
value: o,
|
|
498
498
|
onChange: C,
|
|
499
499
|
allowNoDefault: !0,
|
|
@@ -506,9 +506,9 @@ function Ue(s) {
|
|
|
506
506
|
/* @__PURE__ */ t(
|
|
507
507
|
oe,
|
|
508
508
|
{
|
|
509
|
-
secondary: /* @__PURE__ */ t(
|
|
509
|
+
secondary: /* @__PURE__ */ t(E, { type: "button", variant: "outline", size: "xs", onClick: y, children: "Back" }),
|
|
510
510
|
primary: /* @__PURE__ */ t(
|
|
511
|
-
|
|
511
|
+
E,
|
|
512
512
|
{
|
|
513
513
|
type: "button",
|
|
514
514
|
size: "xs",
|
|
@@ -521,14 +521,14 @@ function Ue(s) {
|
|
|
521
521
|
)
|
|
522
522
|
] });
|
|
523
523
|
}
|
|
524
|
-
const
|
|
524
|
+
const aa = /* @__PURE__ */ new Set([
|
|
525
525
|
"grain_selector",
|
|
526
526
|
"aggregation_selector",
|
|
527
527
|
"field_selector",
|
|
528
528
|
"metric_selector"
|
|
529
529
|
]);
|
|
530
|
-
function
|
|
531
|
-
const { text:
|
|
530
|
+
function $e(s) {
|
|
531
|
+
const { text: r, ariaLabel: o } = s, [i, f] = j(!1);
|
|
532
532
|
return /* @__PURE__ */ d(
|
|
533
533
|
"button",
|
|
534
534
|
{
|
|
@@ -536,22 +536,22 @@ function Ke(s) {
|
|
|
536
536
|
"aria-label": o,
|
|
537
537
|
onClick: async () => {
|
|
538
538
|
try {
|
|
539
|
-
await navigator.clipboard.writeText(
|
|
539
|
+
await navigator.clipboard.writeText(r), f(!0), setTimeout(() => f(!1), 1200);
|
|
540
540
|
} catch (u) {
|
|
541
541
|
console.error("Failed to copy", u);
|
|
542
542
|
}
|
|
543
543
|
},
|
|
544
544
|
className: "group flex w-full items-center justify-between gap-2 rounded-control bg-muted/40 px-2 py-1 text-left transition-colors hover:bg-muted/60 focus-visible:bg-muted/60 focus-visible:outline-none",
|
|
545
545
|
children: [
|
|
546
|
-
/* @__PURE__ */ t("code", { className: "min-w-0 truncate font-mono text-[12px] text-foreground", children:
|
|
546
|
+
/* @__PURE__ */ t("code", { className: "min-w-0 truncate font-mono text-[12px] text-foreground", children: r }),
|
|
547
547
|
/* @__PURE__ */ t("span", { className: "shrink-0 text-[11px] text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100", children: i ? "Copied" : "Click to copy" })
|
|
548
548
|
]
|
|
549
549
|
}
|
|
550
550
|
);
|
|
551
551
|
}
|
|
552
|
-
function
|
|
552
|
+
function Ke(s) {
|
|
553
553
|
const {
|
|
554
|
-
control:
|
|
554
|
+
control: r,
|
|
555
555
|
scope: o,
|
|
556
556
|
createdReference: i,
|
|
557
557
|
explorerContent: f,
|
|
@@ -560,12 +560,12 @@ function $e(s) {
|
|
|
560
560
|
onBack: x,
|
|
561
561
|
onCancel: h,
|
|
562
562
|
onDone: C
|
|
563
|
-
} = s, y =
|
|
563
|
+
} = s, y = aa.has(r.type), m = i.match(/\[\[param\.(.+?)\]\]/), v = m ? `{{ param('${m[1]}') }}` : "";
|
|
564
564
|
return /* @__PURE__ */ d("div", { className: "space-y-4", children: [
|
|
565
565
|
/* @__PURE__ */ t(
|
|
566
|
-
|
|
566
|
+
ta,
|
|
567
567
|
{
|
|
568
|
-
control:
|
|
568
|
+
control: r,
|
|
569
569
|
scope: o,
|
|
570
570
|
detail: b
|
|
571
571
|
}
|
|
@@ -580,14 +580,14 @@ function $e(s) {
|
|
|
580
580
|
/* @__PURE__ */ d("div", { className: "space-y-1.5 px-3 py-2.5", children: [
|
|
581
581
|
/* @__PURE__ */ t("p", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "SQL cards" }),
|
|
582
582
|
/* @__PURE__ */ t(
|
|
583
|
-
|
|
583
|
+
$e,
|
|
584
584
|
{
|
|
585
585
|
text: i,
|
|
586
586
|
ariaLabel: "Copy SQL control reference"
|
|
587
587
|
}
|
|
588
588
|
),
|
|
589
589
|
v ? /* @__PURE__ */ t(
|
|
590
|
-
|
|
590
|
+
$e,
|
|
591
591
|
{
|
|
592
592
|
text: v,
|
|
593
593
|
ariaLabel: "Copy Jinja control reference"
|
|
@@ -614,30 +614,30 @@ function $e(s) {
|
|
|
614
614
|
/* @__PURE__ */ t(
|
|
615
615
|
oe,
|
|
616
616
|
{
|
|
617
|
-
secondary: /* @__PURE__ */ t(
|
|
618
|
-
tertiary: /* @__PURE__ */ t(
|
|
619
|
-
primary: /* @__PURE__ */ t(
|
|
617
|
+
secondary: /* @__PURE__ */ t(E, { type: "button", variant: "outline", size: "xs", onClick: x, children: "Back" }),
|
|
618
|
+
tertiary: /* @__PURE__ */ t(E, { type: "button", variant: "outline", size: "xs", onClick: h, children: "Cancel" }),
|
|
619
|
+
primary: /* @__PURE__ */ t(E, { type: "button", size: "xs", onClick: C, children: "Done" })
|
|
620
620
|
}
|
|
621
621
|
)
|
|
622
622
|
] });
|
|
623
623
|
}
|
|
624
|
-
function
|
|
625
|
-
const
|
|
624
|
+
function ra(s) {
|
|
625
|
+
const r = re(
|
|
626
626
|
s.scope,
|
|
627
627
|
s.existingControls,
|
|
628
628
|
s.reservedIds
|
|
629
|
-
), o = s.type ===
|
|
630
|
-
...
|
|
629
|
+
), o = s.type === r.type ? {
|
|
630
|
+
...r,
|
|
631
631
|
label: Ce[s.type]
|
|
632
632
|
} : {
|
|
633
|
-
...
|
|
633
|
+
...Ze({
|
|
634
634
|
controls: [
|
|
635
635
|
{
|
|
636
|
-
...
|
|
636
|
+
...r,
|
|
637
637
|
label: Ce[s.type]
|
|
638
638
|
}
|
|
639
639
|
],
|
|
640
|
-
controlId:
|
|
640
|
+
controlId: r.id,
|
|
641
641
|
nextType: s.type
|
|
642
642
|
}).controls[0],
|
|
643
643
|
label: Ce[s.type]
|
|
@@ -648,9 +648,9 @@ function rr(s) {
|
|
|
648
648
|
defaultValue: se(o, void 0)
|
|
649
649
|
};
|
|
650
650
|
}
|
|
651
|
-
function
|
|
651
|
+
function ga({
|
|
652
652
|
scope: s,
|
|
653
|
-
controls:
|
|
653
|
+
controls: r,
|
|
654
654
|
reservedControlIds: o,
|
|
655
655
|
defaultValues: i,
|
|
656
656
|
onChange: f,
|
|
@@ -662,72 +662,72 @@ function br({
|
|
|
662
662
|
structuralParticipants: y,
|
|
663
663
|
structuralParticipantIdsByControlId: m,
|
|
664
664
|
card: v,
|
|
665
|
-
allowedControlTypes:
|
|
665
|
+
allowedControlTypes: V,
|
|
666
666
|
onCreateFlowActiveChange: k,
|
|
667
667
|
onCreateFlowComplete: N
|
|
668
668
|
}) {
|
|
669
|
-
const
|
|
669
|
+
const F = z(
|
|
670
670
|
() => new Set(o || []),
|
|
671
671
|
[o]
|
|
672
|
-
),
|
|
672
|
+
), G = wt(s), X = Ct(s), [te, H] = j(
|
|
673
673
|
null
|
|
674
674
|
), [de, O] = j(
|
|
675
675
|
null
|
|
676
|
-
), [
|
|
676
|
+
), [a, I] = j(
|
|
677
677
|
() => b ? {
|
|
678
678
|
step: 1,
|
|
679
|
-
control:
|
|
679
|
+
control: re(s, r, Array.from(F))
|
|
680
680
|
} : null
|
|
681
|
-
),
|
|
682
|
-
const e =
|
|
683
|
-
if (!
|
|
681
|
+
), T = ke({}), M = ke(void 0), R = ke(b), J = z(() => {
|
|
682
|
+
const e = Ae({ scope: s, card: v });
|
|
683
|
+
if (!V)
|
|
684
684
|
return e;
|
|
685
|
-
const n = new Set(
|
|
685
|
+
const n = new Set(V);
|
|
686
686
|
return e.filter((l) => n.has(l.value));
|
|
687
|
-
}, [
|
|
687
|
+
}, [V, v, s]), ae = B(
|
|
688
688
|
(e) => {
|
|
689
|
-
const n =
|
|
689
|
+
const n = Ae({
|
|
690
690
|
scope: s,
|
|
691
691
|
card: v,
|
|
692
|
-
includeType:
|
|
692
|
+
includeType: V ? void 0 : e
|
|
693
693
|
});
|
|
694
|
-
if (!
|
|
694
|
+
if (!V)
|
|
695
695
|
return n;
|
|
696
|
-
const l = new Set(
|
|
696
|
+
const l = new Set(V);
|
|
697
697
|
return n.filter((c) => l.has(c.value));
|
|
698
698
|
},
|
|
699
|
-
[
|
|
700
|
-
),
|
|
699
|
+
[V, v, s]
|
|
700
|
+
), q = B(
|
|
701
701
|
(e) => s === "dashboard" && (e === "field_selector" || e === "metric_selector"),
|
|
702
702
|
[s]
|
|
703
703
|
), W = z(
|
|
704
|
-
() =>
|
|
704
|
+
() => a ? ze(
|
|
705
705
|
y || [],
|
|
706
|
-
|
|
706
|
+
a.control.type
|
|
707
707
|
) : [],
|
|
708
|
-
[
|
|
708
|
+
[a, y]
|
|
709
709
|
), U = z(() => {
|
|
710
|
-
if (!
|
|
710
|
+
if (!a)
|
|
711
711
|
return {
|
|
712
712
|
fields: h || [],
|
|
713
713
|
metrics: C || []
|
|
714
714
|
};
|
|
715
|
-
if (!
|
|
715
|
+
if (!q(a.control.type))
|
|
716
716
|
return {
|
|
717
717
|
fields: h || [],
|
|
718
718
|
metrics: C || []
|
|
719
719
|
};
|
|
720
|
-
const e =
|
|
721
|
-
controlType:
|
|
720
|
+
const e = a.selectedCardIds || [], n = fe({
|
|
721
|
+
controlType: a.control.type,
|
|
722
722
|
participants: y || [],
|
|
723
723
|
selectedCardIds: e
|
|
724
724
|
});
|
|
725
725
|
return {
|
|
726
|
-
fields:
|
|
726
|
+
fields: a.control.type === "field_selector" ? n.choices.map((l) => ({
|
|
727
727
|
option: l,
|
|
728
728
|
target: n.fieldTargetMap[l.value]
|
|
729
729
|
})) : [],
|
|
730
|
-
metrics:
|
|
730
|
+
metrics: a.control.type === "metric_selector" ? n.choices.map((l) => ({
|
|
731
731
|
option: l,
|
|
732
732
|
target: n.metricTargetMap[l.value]
|
|
733
733
|
})) : []
|
|
@@ -735,21 +735,21 @@ function br({
|
|
|
735
735
|
}, [
|
|
736
736
|
h,
|
|
737
737
|
C,
|
|
738
|
-
|
|
739
|
-
|
|
738
|
+
a,
|
|
739
|
+
q,
|
|
740
740
|
y
|
|
741
741
|
]);
|
|
742
742
|
Se(() => {
|
|
743
|
-
k == null || k(!!
|
|
744
|
-
}, [
|
|
743
|
+
k == null || k(!!a);
|
|
744
|
+
}, [a, k]), Se(() => {
|
|
745
745
|
const e = b && !R.current;
|
|
746
746
|
R.current = b, e && (I({
|
|
747
747
|
step: 1,
|
|
748
|
-
control:
|
|
748
|
+
control: re(s, r, Array.from(F))
|
|
749
749
|
}), O(null), H(null));
|
|
750
|
-
}, [
|
|
750
|
+
}, [r, b, F, s]);
|
|
751
751
|
const dt = (e) => {
|
|
752
|
-
if (!
|
|
752
|
+
if (!q(e.type))
|
|
753
753
|
return {
|
|
754
754
|
fields: h || [],
|
|
755
755
|
metrics: C || []
|
|
@@ -760,7 +760,7 @@ function br({
|
|
|
760
760
|
fields: h || [],
|
|
761
761
|
metrics: C || []
|
|
762
762
|
};
|
|
763
|
-
const l =
|
|
763
|
+
const l = fe({
|
|
764
764
|
controlType: e.type,
|
|
765
765
|
participants: y || [],
|
|
766
766
|
selectedCardIds: n
|
|
@@ -775,17 +775,17 @@ function br({
|
|
|
775
775
|
target: l.metricTargetMap[c.value]
|
|
776
776
|
})) : []
|
|
777
777
|
};
|
|
778
|
-
},
|
|
779
|
-
if (!
|
|
778
|
+
}, Ve = (e) => {
|
|
779
|
+
if (!q(e.control.type))
|
|
780
780
|
return {
|
|
781
781
|
nextControl: e.control,
|
|
782
782
|
cardBindingsById: void 0
|
|
783
783
|
};
|
|
784
|
-
const n = (m == null ? void 0 : m[e.control.id]) || [], l =
|
|
784
|
+
const n = (m == null ? void 0 : m[e.control.id]) || [], l = fe({
|
|
785
785
|
controlType: e.control.type,
|
|
786
786
|
participants: y || [],
|
|
787
787
|
selectedCardIds: e.nextSelectedCardIds
|
|
788
|
-
}), c =
|
|
788
|
+
}), c = Tt({
|
|
789
789
|
control: e.control,
|
|
790
790
|
choices: l.choices
|
|
791
791
|
}), g = Object.fromEntries(
|
|
@@ -793,7 +793,7 @@ function br({
|
|
|
793
793
|
);
|
|
794
794
|
return e.nextSelectedCardIds.length > 0 && c.source.kind === "manual" && c.source.options.length > 0 && Object.assign(
|
|
795
795
|
g,
|
|
796
|
-
|
|
796
|
+
je({
|
|
797
797
|
control: c,
|
|
798
798
|
participants: y || [],
|
|
799
799
|
selectedCardIds: e.nextSelectedCardIds
|
|
@@ -804,31 +804,31 @@ function br({
|
|
|
804
804
|
};
|
|
805
805
|
}, A = B(
|
|
806
806
|
(e, n = i, l = { type: "update" }) => {
|
|
807
|
-
const c = e.map((g) => (
|
|
807
|
+
const c = e.map((g) => (he({
|
|
808
808
|
control: g,
|
|
809
809
|
defaultValues: n
|
|
810
|
-
}),
|
|
810
|
+
}), kt(
|
|
811
811
|
g
|
|
812
812
|
)));
|
|
813
813
|
f(c, n, l);
|
|
814
814
|
},
|
|
815
815
|
[i, f]
|
|
816
816
|
), Z = (e, n) => {
|
|
817
|
-
const l =
|
|
817
|
+
const l = r.find(
|
|
818
818
|
(w) => w.id === e
|
|
819
819
|
);
|
|
820
|
-
let c =
|
|
820
|
+
let c = r.map((w) => w.id !== e ? w : n(w));
|
|
821
821
|
const g = c.find(
|
|
822
822
|
(w) => w.id === e
|
|
823
823
|
);
|
|
824
824
|
let D, p;
|
|
825
825
|
if (g && s === "dashboard" && (g.type === "field_selector" || g.type === "metric_selector")) {
|
|
826
|
-
const w = (m == null ? void 0 : m[g.id]) || [], P =
|
|
826
|
+
const w = (m == null ? void 0 : m[g.id]) || [], P = Ve({
|
|
827
827
|
control: g,
|
|
828
828
|
nextSelectedCardIds: w
|
|
829
829
|
});
|
|
830
830
|
c = c.map(
|
|
831
|
-
(
|
|
831
|
+
($) => $.id === e ? P.nextControl : $
|
|
832
832
|
), D = P.cardBindingsById, p = [g.id];
|
|
833
833
|
} else if (l && s === "dashboard" && (l.type === "field_selector" || l.type === "metric_selector")) {
|
|
834
834
|
const w = (m == null ? void 0 : m[l.id]) || [];
|
|
@@ -841,18 +841,18 @@ function br({
|
|
|
841
841
|
);
|
|
842
842
|
let _ = i;
|
|
843
843
|
if (l && S) {
|
|
844
|
-
const w =
|
|
844
|
+
const w = he({
|
|
845
845
|
control: l,
|
|
846
846
|
defaultValues: i
|
|
847
847
|
});
|
|
848
|
-
l.source.kind === "manual" && S.source.kind === "sql_query" && (
|
|
849
|
-
const P = w === void 0 && l.source.kind === "sql_query" && S.source.kind === "manual" ?
|
|
848
|
+
l.source.kind === "manual" && S.source.kind === "sql_query" && (T.current[e] = w);
|
|
849
|
+
const P = w === void 0 && l.source.kind === "sql_query" && S.source.kind === "manual" ? T.current[e] : w, $ = Qe({
|
|
850
850
|
previousControl: l,
|
|
851
851
|
nextControl: S,
|
|
852
852
|
currentDefaultValue: P
|
|
853
853
|
});
|
|
854
|
-
S.source.kind === "manual" && (
|
|
855
|
-
(Le) => Le.id === e ? { ...S, defaultValue:
|
|
854
|
+
S.source.kind === "manual" && (T.current[e] = $), i && (_ = { ...i }, $ === void 0 ? delete _[e] : _[e] = $), c = c.map(
|
|
855
|
+
(Le) => Le.id === e ? { ...S, defaultValue: $ } : Le
|
|
856
856
|
);
|
|
857
857
|
}
|
|
858
858
|
A(c, _, {
|
|
@@ -861,12 +861,14 @@ function br({
|
|
|
861
861
|
affectedBindingControlIds: p
|
|
862
862
|
});
|
|
863
863
|
}, ct = (e, n) => {
|
|
864
|
-
|
|
865
|
-
|
|
864
|
+
if (!n.trim())
|
|
865
|
+
return;
|
|
866
|
+
const l = Gt(n);
|
|
867
|
+
if (l === e || F.has(l) || r.some(
|
|
866
868
|
(D) => D.id === l && D.id !== e
|
|
867
869
|
))
|
|
868
870
|
return;
|
|
869
|
-
const c =
|
|
871
|
+
const c = r.map(
|
|
870
872
|
(D) => D.id === e ? { ...D, id: l } : D
|
|
871
873
|
);
|
|
872
874
|
if (!i) {
|
|
@@ -884,7 +886,7 @@ function br({
|
|
|
884
886
|
newId: l
|
|
885
887
|
});
|
|
886
888
|
}, ut = (e) => {
|
|
887
|
-
const n =
|
|
889
|
+
const n = r.filter((c) => c.id !== e);
|
|
888
890
|
if (!i) {
|
|
889
891
|
A(n, void 0, { type: "remove", controlId: e });
|
|
890
892
|
return;
|
|
@@ -894,14 +896,14 @@ function br({
|
|
|
894
896
|
}, pt = B(() => {
|
|
895
897
|
M.current = void 0, I({
|
|
896
898
|
step: 1,
|
|
897
|
-
control:
|
|
899
|
+
control: re(s, r, Array.from(F))
|
|
898
900
|
}), O(null), H(null);
|
|
899
|
-
}, [
|
|
901
|
+
}, [r, F, s]), ee = (e) => {
|
|
900
902
|
I(
|
|
901
903
|
(n) => n && (() => {
|
|
902
904
|
const l = e(n.control);
|
|
903
905
|
n.control.source.kind === "manual" && l.source.kind === "sql_query" && (M.current = n.defaultValue);
|
|
904
|
-
const c = n.defaultValue === void 0 && n.control.source.kind === "sql_query" && l.source.kind === "manual" ? M.current : n.defaultValue, g =
|
|
906
|
+
const c = n.defaultValue === void 0 && n.control.source.kind === "sql_query" && l.source.kind === "manual" ? M.current : n.defaultValue, g = Qe({
|
|
905
907
|
previousControl: n.control,
|
|
906
908
|
nextControl: l,
|
|
907
909
|
currentDefaultValue: c
|
|
@@ -913,7 +915,7 @@ function br({
|
|
|
913
915
|
};
|
|
914
916
|
})()
|
|
915
917
|
);
|
|
916
|
-
},
|
|
918
|
+
}, Te = (e) => {
|
|
917
919
|
I(
|
|
918
920
|
(n) => n && (n.control.source.kind === "manual" && (M.current = e), {
|
|
919
921
|
...n,
|
|
@@ -921,14 +923,14 @@ function br({
|
|
|
921
923
|
})
|
|
922
924
|
);
|
|
923
925
|
}, ce = (() => {
|
|
924
|
-
if (!
|
|
926
|
+
if (!a)
|
|
925
927
|
return !1;
|
|
926
|
-
if (
|
|
927
|
-
return (
|
|
928
|
-
if (
|
|
928
|
+
if (a.step === 2 && q(a.control.type))
|
|
929
|
+
return (a.selectedCardIds || []).length > 0;
|
|
930
|
+
if (a.step !== 2 && a.step !== 3 || !a.control.label.trim())
|
|
929
931
|
return !1;
|
|
930
|
-
const n =
|
|
931
|
-
if (n.source.kind === "manual" && (
|
|
932
|
+
const n = a.control.source.kind === "sql_query" ? a.control : Oe(a.control);
|
|
933
|
+
if (n.source.kind === "manual" && (Nt(n) && n.source.options.length === 0 || n.source.options.some(
|
|
932
934
|
(c) => c.label.trim().length === 0 || c.value.trim().length === 0
|
|
933
935
|
)))
|
|
934
936
|
return !1;
|
|
@@ -936,53 +938,53 @@ function br({
|
|
|
936
938
|
const { connectionId: l, sql: c, valueColumn: g } = n.source;
|
|
937
939
|
return l.trim().length > 0 && c.trim().length > 0 && g.trim().length > 0;
|
|
938
940
|
}
|
|
939
|
-
return
|
|
940
|
-
se(n,
|
|
941
|
+
return St(
|
|
942
|
+
se(n, a.defaultValue)
|
|
941
943
|
);
|
|
942
|
-
})(),
|
|
944
|
+
})(), Ee = () => {
|
|
943
945
|
var D;
|
|
944
|
-
if (!
|
|
946
|
+
if (!a)
|
|
945
947
|
return;
|
|
946
|
-
const e =
|
|
948
|
+
const e = Oe(a.control), n = Vt({
|
|
947
949
|
label: e.label,
|
|
948
950
|
fallbackId: e.id,
|
|
949
|
-
existingControls:
|
|
950
|
-
reservedIds: Array.from(
|
|
951
|
+
existingControls: r,
|
|
952
|
+
reservedIds: Array.from(F)
|
|
951
953
|
}), l = {
|
|
952
954
|
...e,
|
|
953
955
|
id: n
|
|
954
|
-
}, c = s === "dashboard" && (l.type === "field_selector" || l.type === "metric_selector") && ((D =
|
|
956
|
+
}, c = s === "dashboard" && (l.type === "field_selector" || l.type === "metric_selector") && ((D = a.selectedCardIds) != null && D.length) ? je({
|
|
955
957
|
control: l,
|
|
956
958
|
participants: y || [],
|
|
957
|
-
selectedCardIds:
|
|
959
|
+
selectedCardIds: a.selectedCardIds
|
|
958
960
|
}) : void 0, g = se(
|
|
959
961
|
l,
|
|
960
|
-
|
|
962
|
+
a.defaultValue
|
|
961
963
|
);
|
|
962
964
|
I({
|
|
963
965
|
step: s === "dashboard" && (l.type === "field_selector" || l.type === "metric_selector") ? 4 : 3,
|
|
964
966
|
control: l,
|
|
965
967
|
defaultValue: g,
|
|
966
968
|
createdControlId: n,
|
|
967
|
-
selectedCardIds:
|
|
969
|
+
selectedCardIds: a.selectedCardIds,
|
|
968
970
|
cardBindingsById: c
|
|
969
971
|
});
|
|
970
972
|
}, ue = B(() => {
|
|
971
973
|
I(null);
|
|
972
|
-
}, []),
|
|
973
|
-
if (!(
|
|
974
|
+
}, []), qe = B(() => {
|
|
975
|
+
if (!(a != null && a.createdControlId)) {
|
|
974
976
|
I(null);
|
|
975
977
|
return;
|
|
976
978
|
}
|
|
977
|
-
const e =
|
|
979
|
+
const e = a.control, n = a.createdControlId, l = se(
|
|
978
980
|
e,
|
|
979
|
-
|
|
981
|
+
a.defaultValue
|
|
980
982
|
);
|
|
981
983
|
if (i) {
|
|
982
984
|
const c = { ...i };
|
|
983
985
|
l === void 0 ? delete c[n] : c[n] = l, A(
|
|
984
986
|
[
|
|
985
|
-
...
|
|
987
|
+
...r,
|
|
986
988
|
{
|
|
987
989
|
...e,
|
|
988
990
|
defaultValue: l
|
|
@@ -991,13 +993,13 @@ function br({
|
|
|
991
993
|
c,
|
|
992
994
|
{
|
|
993
995
|
type: "add",
|
|
994
|
-
cardBindingsById:
|
|
996
|
+
cardBindingsById: a.cardBindingsById
|
|
995
997
|
}
|
|
996
998
|
);
|
|
997
999
|
} else
|
|
998
1000
|
A(
|
|
999
1001
|
[
|
|
1000
|
-
...
|
|
1002
|
+
...r,
|
|
1001
1003
|
{
|
|
1002
1004
|
...e,
|
|
1003
1005
|
defaultValue: l
|
|
@@ -1006,33 +1008,33 @@ function br({
|
|
|
1006
1008
|
void 0,
|
|
1007
1009
|
{
|
|
1008
1010
|
type: "add",
|
|
1009
|
-
cardBindingsById:
|
|
1011
|
+
cardBindingsById: a.cardBindingsById
|
|
1010
1012
|
}
|
|
1011
1013
|
);
|
|
1012
1014
|
O(n), I(null), N == null || N();
|
|
1013
|
-
}, [
|
|
1014
|
-
controls:
|
|
1015
|
+
}, [r, a, i, A, N]), mt = a ? q(a.control.type) ? ["Choose type", "Select cards", "Configure", "Finish"] : ["Choose type", "Configure", "Finish"] : [], Fe = a != null && a.createdControlId ? `[[param.${a.createdControlId}]]` : a ? `[[param.${Dt(a.control.label) || a.control.id}]]` : "", pe = Be({
|
|
1016
|
+
controls: r,
|
|
1015
1017
|
defaultValues: i
|
|
1016
|
-
}), me =
|
|
1018
|
+
}), me = a ? [...r, a.control] : r, _e = a ? Be({
|
|
1017
1019
|
controls: me,
|
|
1018
1020
|
defaultValues: i,
|
|
1019
1021
|
overrides: [
|
|
1020
1022
|
{
|
|
1021
|
-
controlId:
|
|
1022
|
-
value:
|
|
1023
|
+
controlId: a.control.id,
|
|
1024
|
+
value: a.defaultValue
|
|
1023
1025
|
}
|
|
1024
1026
|
]
|
|
1025
1027
|
}) : pe;
|
|
1026
1028
|
return /* @__PURE__ */ d("div", { className: "space-y-4", children: [
|
|
1027
|
-
|
|
1029
|
+
a ? /* @__PURE__ */ d("div", { className: "space-y-4 pb-1", children: [
|
|
1028
1030
|
/* @__PURE__ */ t(
|
|
1029
|
-
|
|
1031
|
+
ea,
|
|
1030
1032
|
{
|
|
1031
|
-
currentStep:
|
|
1033
|
+
currentStep: a.step,
|
|
1032
1034
|
labels: mt
|
|
1033
1035
|
}
|
|
1034
1036
|
),
|
|
1035
|
-
|
|
1037
|
+
a.step === 1 && (() => {
|
|
1036
1038
|
const e = /* @__PURE__ */ new Set([
|
|
1037
1039
|
"grain_selector",
|
|
1038
1040
|
"aggregation_selector",
|
|
@@ -1048,10 +1050,10 @@ function br({
|
|
|
1048
1050
|
type: "button",
|
|
1049
1051
|
className: "rounded-control border border-border/60 bg-background px-3 py-2.5 text-left transition-colors hover:bg-muted/40 focus-visible:bg-muted/40 focus-visible:outline-none",
|
|
1050
1052
|
onClick: () => I(
|
|
1051
|
-
|
|
1053
|
+
ra({
|
|
1052
1054
|
scope: s,
|
|
1053
|
-
existingControls:
|
|
1054
|
-
reservedIds: Array.from(
|
|
1055
|
+
existingControls: r,
|
|
1056
|
+
reservedIds: Array.from(F),
|
|
1055
1057
|
type: g.value
|
|
1056
1058
|
})
|
|
1057
1059
|
),
|
|
@@ -1076,7 +1078,7 @@ function br({
|
|
|
1076
1078
|
oe,
|
|
1077
1079
|
{
|
|
1078
1080
|
secondary: /* @__PURE__ */ t(
|
|
1079
|
-
|
|
1081
|
+
E,
|
|
1080
1082
|
{
|
|
1081
1083
|
type: "button",
|
|
1082
1084
|
variant: "outline",
|
|
@@ -1089,12 +1091,12 @@ function br({
|
|
|
1089
1091
|
)
|
|
1090
1092
|
] });
|
|
1091
1093
|
})(),
|
|
1092
|
-
|
|
1094
|
+
a.step === 2 && q(a.control.type) && /* @__PURE__ */ d("div", { className: "space-y-3", children: [
|
|
1093
1095
|
/* @__PURE__ */ d("div", { className: "space-y-3", children: [
|
|
1094
1096
|
/* @__PURE__ */ t(
|
|
1095
1097
|
it,
|
|
1096
1098
|
{
|
|
1097
|
-
control:
|
|
1099
|
+
control: a.control,
|
|
1098
1100
|
onChange: (e) => ee((n) => ({
|
|
1099
1101
|
...n,
|
|
1100
1102
|
label: e
|
|
@@ -1104,14 +1106,14 @@ function br({
|
|
|
1104
1106
|
/* @__PURE__ */ t("p", { className: "text-[12px] text-muted-foreground", children: "Choose which cards should respond to this shared control." })
|
|
1105
1107
|
] }),
|
|
1106
1108
|
W.length === 0 ? /* @__PURE__ */ t("div", { className: "rounded-control border border-border/60 bg-muted/30 px-3 py-2.5 text-[12px] text-muted-foreground", children: "No eligible cards are available yet. Add compatible metrics or group-by fields to cards first." }) : /* @__PURE__ */ t("div", { className: "space-y-1 rounded-control border border-border/60 bg-background p-2", children: W.map((e) => {
|
|
1107
|
-
const n = (
|
|
1109
|
+
const n = (a.selectedCardIds || []).includes(e.cardId);
|
|
1108
1110
|
return /* @__PURE__ */ d(
|
|
1109
1111
|
"label",
|
|
1110
1112
|
{
|
|
1111
1113
|
className: "flex items-start gap-2 rounded-control px-1.5 py-1 text-[13px] hover:bg-muted/40",
|
|
1112
1114
|
children: [
|
|
1113
1115
|
/* @__PURE__ */ t(
|
|
1114
|
-
|
|
1116
|
+
Mt,
|
|
1115
1117
|
{
|
|
1116
1118
|
checked: n,
|
|
1117
1119
|
onCheckedChange: (l) => I(
|
|
@@ -1129,7 +1131,7 @@ function br({
|
|
|
1129
1131
|
),
|
|
1130
1132
|
/* @__PURE__ */ d("div", { className: "min-w-0", children: [
|
|
1131
1133
|
/* @__PURE__ */ t("div", { className: "font-medium text-foreground", children: e.title }),
|
|
1132
|
-
/* @__PURE__ */ t("div", { className: "text-[12px] text-muted-foreground", children:
|
|
1134
|
+
/* @__PURE__ */ t("div", { className: "text-[12px] text-muted-foreground", children: a.control.type === "field_selector" ? `${e.fieldChoices.length} compatible group-by fields` : `${e.metricChoices.length} compatible metrics` })
|
|
1133
1135
|
] })
|
|
1134
1136
|
]
|
|
1135
1137
|
},
|
|
@@ -1140,7 +1142,7 @@ function br({
|
|
|
1140
1142
|
oe,
|
|
1141
1143
|
{
|
|
1142
1144
|
secondary: /* @__PURE__ */ t(
|
|
1143
|
-
|
|
1145
|
+
E,
|
|
1144
1146
|
{
|
|
1145
1147
|
type: "button",
|
|
1146
1148
|
variant: "outline",
|
|
@@ -1156,7 +1158,7 @@ function br({
|
|
|
1156
1158
|
}
|
|
1157
1159
|
),
|
|
1158
1160
|
primary: /* @__PURE__ */ t(
|
|
1159
|
-
|
|
1161
|
+
E,
|
|
1160
1162
|
{
|
|
1161
1163
|
type: "button",
|
|
1162
1164
|
size: "xs",
|
|
@@ -1173,11 +1175,11 @@ function br({
|
|
|
1173
1175
|
}
|
|
1174
1176
|
)
|
|
1175
1177
|
] }),
|
|
1176
|
-
|
|
1178
|
+
a.step === 2 && !q(a.control.type) && /* @__PURE__ */ t(
|
|
1177
1179
|
Ue,
|
|
1178
1180
|
{
|
|
1179
|
-
control:
|
|
1180
|
-
defaultValue:
|
|
1181
|
+
control: a.control,
|
|
1182
|
+
defaultValue: a.defaultValue,
|
|
1181
1183
|
availableFieldChoices: U.fields,
|
|
1182
1184
|
availableMetricChoices: U.metrics,
|
|
1183
1185
|
previewControlDefinitions: me,
|
|
@@ -1187,22 +1189,22 @@ function br({
|
|
|
1187
1189
|
...n,
|
|
1188
1190
|
label: e
|
|
1189
1191
|
})),
|
|
1190
|
-
onDefaultValueChange:
|
|
1192
|
+
onDefaultValueChange: Te,
|
|
1191
1193
|
onBack: () => I(
|
|
1192
1194
|
(e) => e && {
|
|
1193
1195
|
...e,
|
|
1194
1196
|
step: 1
|
|
1195
1197
|
}
|
|
1196
1198
|
),
|
|
1197
|
-
onNext:
|
|
1199
|
+
onNext: Ee,
|
|
1198
1200
|
nextDisabled: !ce
|
|
1199
1201
|
}
|
|
1200
1202
|
),
|
|
1201
|
-
|
|
1203
|
+
a.step === 3 && q(a.control.type) && /* @__PURE__ */ t(
|
|
1202
1204
|
Ue,
|
|
1203
1205
|
{
|
|
1204
|
-
control:
|
|
1205
|
-
defaultValue:
|
|
1206
|
+
control: a.control,
|
|
1207
|
+
defaultValue: a.defaultValue,
|
|
1206
1208
|
availableFieldChoices: U.fields,
|
|
1207
1209
|
availableMetricChoices: U.metrics,
|
|
1208
1210
|
previewControlDefinitions: me,
|
|
@@ -1212,24 +1214,24 @@ function br({
|
|
|
1212
1214
|
...n,
|
|
1213
1215
|
label: e
|
|
1214
1216
|
})),
|
|
1215
|
-
onDefaultValueChange:
|
|
1217
|
+
onDefaultValueChange: Te,
|
|
1216
1218
|
onBack: () => I(
|
|
1217
1219
|
(e) => e && {
|
|
1218
1220
|
...e,
|
|
1219
1221
|
step: 2
|
|
1220
1222
|
}
|
|
1221
1223
|
),
|
|
1222
|
-
onNext:
|
|
1224
|
+
onNext: Ee,
|
|
1223
1225
|
nextDisabled: !ce
|
|
1224
1226
|
}
|
|
1225
1227
|
),
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
+
a.step === 3 && !q(a.control.type) && /* @__PURE__ */ t(
|
|
1229
|
+
Ke,
|
|
1228
1230
|
{
|
|
1229
|
-
control:
|
|
1231
|
+
control: a.control,
|
|
1230
1232
|
scope: s,
|
|
1231
|
-
createdReference:
|
|
1232
|
-
explorerContent: /* @__PURE__ */ d(
|
|
1233
|
+
createdReference: Fe,
|
|
1234
|
+
explorerContent: /* @__PURE__ */ d(K, { children: [
|
|
1233
1235
|
"Open the card and use",
|
|
1234
1236
|
" ",
|
|
1235
1237
|
/* @__PURE__ */ t("span", { className: "font-medium text-foreground", children: "Settings → Controls" }),
|
|
@@ -1244,22 +1246,22 @@ function br({
|
|
|
1244
1246
|
}
|
|
1245
1247
|
),
|
|
1246
1248
|
onCancel: ue,
|
|
1247
|
-
onDone:
|
|
1249
|
+
onDone: qe
|
|
1248
1250
|
}
|
|
1249
1251
|
),
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
+
a.step === 4 && q(a.control.type) && /* @__PURE__ */ t(
|
|
1253
|
+
Ke,
|
|
1252
1254
|
{
|
|
1253
|
-
control:
|
|
1255
|
+
control: a.control,
|
|
1254
1256
|
scope: s,
|
|
1255
|
-
createdReference:
|
|
1256
|
-
summaryDetail: /* @__PURE__ */ d(
|
|
1257
|
+
createdReference: Fe,
|
|
1258
|
+
summaryDetail: /* @__PURE__ */ d(K, { children: [
|
|
1257
1259
|
"Used by ",
|
|
1258
|
-
(
|
|
1260
|
+
(a.selectedCardIds || []).length,
|
|
1259
1261
|
" selected card",
|
|
1260
|
-
(
|
|
1262
|
+
(a.selectedCardIds || []).length === 1 ? "" : "s"
|
|
1261
1263
|
] }),
|
|
1262
|
-
explorerContent: /* @__PURE__ */ t(
|
|
1264
|
+
explorerContent: /* @__PURE__ */ t(K, { children: "Selected cards have been set up to respond to this control automatically." }),
|
|
1263
1265
|
sqlDescription: "SQL cards can still reference this control directly in the SQL editor.",
|
|
1264
1266
|
onBack: () => I(
|
|
1265
1267
|
(e) => e && {
|
|
@@ -1268,13 +1270,13 @@ function br({
|
|
|
1268
1270
|
}
|
|
1269
1271
|
),
|
|
1270
1272
|
onCancel: ue,
|
|
1271
|
-
onDone:
|
|
1273
|
+
onDone: qe
|
|
1272
1274
|
}
|
|
1273
1275
|
)
|
|
1274
1276
|
] }) : null,
|
|
1275
|
-
!
|
|
1276
|
-
!
|
|
1277
|
-
const n = dt(e), l = x == null ? void 0 : x[e.id], c =
|
|
1277
|
+
!a && r.length === 0 ? /* @__PURE__ */ t("div", { className: "rounded-md border border-dashed p-3 text-sm text-muted-foreground", children: u }) : null,
|
|
1278
|
+
!a && r.map((e) => {
|
|
1279
|
+
const n = dt(e), l = x == null ? void 0 : x[e.id], c = he({
|
|
1278
1280
|
control: e,
|
|
1279
1281
|
defaultValues: i
|
|
1280
1282
|
}), g = de === e.id, D = "inline-flex shrink-0 items-center rounded-[4px] border border-border/60 bg-muted/40 px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground";
|
|
@@ -1293,15 +1295,15 @@ function br({
|
|
|
1293
1295
|
(p) => p === e.id ? null : e.id
|
|
1294
1296
|
),
|
|
1295
1297
|
children: [
|
|
1296
|
-
g ? /* @__PURE__ */ t(
|
|
1298
|
+
g ? /* @__PURE__ */ t(Me, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" }) : /* @__PURE__ */ t(Re, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
1297
1299
|
/* @__PURE__ */ d("div", { className: "min-w-0", children: [
|
|
1298
1300
|
/* @__PURE__ */ d("div", { className: "flex flex-wrap items-center gap-1.5", children: [
|
|
1299
1301
|
/* @__PURE__ */ t("span", { className: "truncate text-[13px] font-medium text-foreground", children: e.label || "Untitled control" }),
|
|
1300
|
-
/* @__PURE__ */ t("span", { className: D, children:
|
|
1301
|
-
/* @__PURE__ */ t("span", { className: D, children:
|
|
1302
|
+
/* @__PURE__ */ t("span", { className: D, children: Xe(e.type).label }),
|
|
1303
|
+
/* @__PURE__ */ t("span", { className: D, children: He(s, e.placement) })
|
|
1302
1304
|
] }),
|
|
1303
1305
|
/* @__PURE__ */ d("div", { className: "mt-0.5 text-[12px] text-muted-foreground", children: [
|
|
1304
|
-
|
|
1306
|
+
Je(e),
|
|
1305
1307
|
l != null && l.status ? ` · ${l.status}` : ""
|
|
1306
1308
|
] })
|
|
1307
1309
|
] })
|
|
@@ -1309,7 +1311,7 @@ function br({
|
|
|
1309
1311
|
}
|
|
1310
1312
|
),
|
|
1311
1313
|
/* @__PURE__ */ t(
|
|
1312
|
-
|
|
1314
|
+
E,
|
|
1313
1315
|
{
|
|
1314
1316
|
type: "button",
|
|
1315
1317
|
size: "xs",
|
|
@@ -1317,16 +1319,16 @@ function br({
|
|
|
1317
1319
|
className: "h-7 w-7 shrink-0 p-0 text-muted-foreground",
|
|
1318
1320
|
onClick: () => ut(e.id),
|
|
1319
1321
|
"aria-label": `Remove ${e.label}`,
|
|
1320
|
-
children: /* @__PURE__ */ t(
|
|
1322
|
+
children: /* @__PURE__ */ t(Qt, { className: "h-3.5 w-3.5" })
|
|
1321
1323
|
}
|
|
1322
1324
|
)
|
|
1323
1325
|
] }),
|
|
1324
1326
|
g && /* @__PURE__ */ d("div", { className: "space-y-4 border-t border-border/60 px-3 py-3", children: [
|
|
1325
1327
|
/* @__PURE__ */ d("div", { className: "grid gap-3 md:grid-cols-3", children: [
|
|
1326
1328
|
/* @__PURE__ */ d("div", { className: "flex flex-col gap-1.5", children: [
|
|
1327
|
-
/* @__PURE__ */ t(
|
|
1329
|
+
/* @__PURE__ */ t(Y, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Label" }),
|
|
1328
1330
|
/* @__PURE__ */ t(
|
|
1329
|
-
|
|
1331
|
+
We,
|
|
1330
1332
|
{
|
|
1331
1333
|
size: "xs",
|
|
1332
1334
|
value: e.label,
|
|
@@ -1339,14 +1341,14 @@ function br({
|
|
|
1339
1341
|
)
|
|
1340
1342
|
] }),
|
|
1341
1343
|
/* @__PURE__ */ d("div", { className: "flex flex-col gap-1.5", children: [
|
|
1342
|
-
/* @__PURE__ */ t(
|
|
1344
|
+
/* @__PURE__ */ t(Y, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Type" }),
|
|
1343
1345
|
/* @__PURE__ */ d(
|
|
1344
|
-
|
|
1346
|
+
be,
|
|
1345
1347
|
{
|
|
1346
1348
|
value: e.type,
|
|
1347
1349
|
onValueChange: (p) => {
|
|
1348
|
-
const S =
|
|
1349
|
-
controls:
|
|
1350
|
+
const S = Ze({
|
|
1351
|
+
controls: r,
|
|
1350
1352
|
controlId: e.id,
|
|
1351
1353
|
nextType: p,
|
|
1352
1354
|
defaultValues: i
|
|
@@ -1354,10 +1356,10 @@ function br({
|
|
|
1354
1356
|
A(S.controls, S.defaultValues);
|
|
1355
1357
|
},
|
|
1356
1358
|
children: [
|
|
1357
|
-
/* @__PURE__ */ t(
|
|
1358
|
-
/* @__PURE__ */ t(
|
|
1359
|
+
/* @__PURE__ */ t(ge, { size: "xs", children: /* @__PURE__ */ t(ye, {}) }),
|
|
1360
|
+
/* @__PURE__ */ t(xe, { children: ae(e.type).map(
|
|
1359
1361
|
(p) => /* @__PURE__ */ t(
|
|
1360
|
-
|
|
1362
|
+
ve,
|
|
1361
1363
|
{
|
|
1362
1364
|
value: p.value,
|
|
1363
1365
|
children: p.label
|
|
@@ -1370,9 +1372,9 @@ function br({
|
|
|
1370
1372
|
)
|
|
1371
1373
|
] }),
|
|
1372
1374
|
/* @__PURE__ */ d("div", { className: "flex flex-col gap-1.5", children: [
|
|
1373
|
-
/* @__PURE__ */ t(
|
|
1375
|
+
/* @__PURE__ */ t(Y, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Show in" }),
|
|
1374
1376
|
/* @__PURE__ */ d(
|
|
1375
|
-
|
|
1377
|
+
be,
|
|
1376
1378
|
{
|
|
1377
1379
|
value: e.placement || X,
|
|
1378
1380
|
onValueChange: (p) => Z(e.id, (S) => ({
|
|
@@ -1380,18 +1382,18 @@ function br({
|
|
|
1380
1382
|
placement: p
|
|
1381
1383
|
})),
|
|
1382
1384
|
children: [
|
|
1383
|
-
/* @__PURE__ */ t(
|
|
1384
|
-
/* @__PURE__ */ t(
|
|
1385
|
+
/* @__PURE__ */ t(ge, { size: "xs", children: /* @__PURE__ */ t(ye, {}) }),
|
|
1386
|
+
/* @__PURE__ */ t(xe, { children: G.map((p) => /* @__PURE__ */ t(ve, { value: p.value, children: p.label }, p.value)) })
|
|
1385
1387
|
]
|
|
1386
1388
|
}
|
|
1387
1389
|
)
|
|
1388
1390
|
] })
|
|
1389
1391
|
] }),
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
+
q(e.type) ? /* @__PURE__ */ t(
|
|
1393
|
+
jt,
|
|
1392
1394
|
{
|
|
1393
1395
|
type: e.type,
|
|
1394
|
-
participants:
|
|
1396
|
+
participants: ze(
|
|
1395
1397
|
y || [],
|
|
1396
1398
|
e.type
|
|
1397
1399
|
).map((p) => ({
|
|
@@ -1401,10 +1403,10 @@ function br({
|
|
|
1401
1403
|
})),
|
|
1402
1404
|
selectedCardIds: (m == null ? void 0 : m[e.id]) || [],
|
|
1403
1405
|
onChange: (p) => {
|
|
1404
|
-
const S =
|
|
1406
|
+
const S = Ve({
|
|
1405
1407
|
control: e,
|
|
1406
1408
|
nextSelectedCardIds: p
|
|
1407
|
-
}), _ =
|
|
1409
|
+
}), _ = r.map(
|
|
1408
1410
|
(w) => w.id === e.id ? S.nextControl : w
|
|
1409
1411
|
);
|
|
1410
1412
|
A(_, i, {
|
|
@@ -1420,7 +1422,7 @@ function br({
|
|
|
1420
1422
|
control: e,
|
|
1421
1423
|
availableFieldChoices: n.fields,
|
|
1422
1424
|
availableMetricChoices: n.metrics,
|
|
1423
|
-
previewControlDefinitions:
|
|
1425
|
+
previewControlDefinitions: r,
|
|
1424
1426
|
previewControlValues: pe,
|
|
1425
1427
|
controlLifecycle: "edit",
|
|
1426
1428
|
onChange: (p) => Z(e.id, () => p)
|
|
@@ -1433,13 +1435,13 @@ function br({
|
|
|
1433
1435
|
value: c,
|
|
1434
1436
|
allowNoDefault: !0,
|
|
1435
1437
|
allowCardDefault: !0,
|
|
1436
|
-
previewControlDefinitions:
|
|
1438
|
+
previewControlDefinitions: r,
|
|
1437
1439
|
previewControlValues: pe,
|
|
1438
1440
|
onChange: (p) => {
|
|
1439
|
-
const S =
|
|
1441
|
+
const S = r.map(
|
|
1440
1442
|
(_) => _.id === e.id ? { ..._, defaultValue: p } : _
|
|
1441
1443
|
);
|
|
1442
|
-
if (e.source.kind === "manual" && (
|
|
1444
|
+
if (e.source.kind === "manual" && (T.current[e.id] = p), i) {
|
|
1443
1445
|
const _ = { ...i };
|
|
1444
1446
|
p === void 0 ? delete _[e.id] : _[e.id] = p, A(S, _);
|
|
1445
1447
|
return;
|
|
@@ -1449,30 +1451,30 @@ function br({
|
|
|
1449
1451
|
}
|
|
1450
1452
|
),
|
|
1451
1453
|
/* @__PURE__ */ d(
|
|
1452
|
-
|
|
1454
|
+
Rt,
|
|
1453
1455
|
{
|
|
1454
1456
|
open: te === e.id,
|
|
1455
1457
|
onOpenChange: (p) => H(p ? e.id : null),
|
|
1456
1458
|
children: [
|
|
1457
|
-
/* @__PURE__ */ t(
|
|
1458
|
-
|
|
1459
|
+
/* @__PURE__ */ t(Ut, { asChild: !0, children: /* @__PURE__ */ d(
|
|
1460
|
+
E,
|
|
1459
1461
|
{
|
|
1460
1462
|
type: "button",
|
|
1461
1463
|
variant: "ghost",
|
|
1462
1464
|
size: "xs",
|
|
1463
1465
|
className: "-ml-2 gap-1 text-muted-foreground hover:text-foreground",
|
|
1464
1466
|
children: [
|
|
1465
|
-
te === e.id ? /* @__PURE__ */ t(
|
|
1467
|
+
te === e.id ? /* @__PURE__ */ t(Me, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ t(Re, { className: "h-3.5 w-3.5" }),
|
|
1466
1468
|
"Advanced"
|
|
1467
1469
|
]
|
|
1468
1470
|
}
|
|
1469
1471
|
) }),
|
|
1470
|
-
/* @__PURE__ */ d(
|
|
1472
|
+
/* @__PURE__ */ d($t, { className: "space-y-3 pt-2", children: [
|
|
1471
1473
|
/* @__PURE__ */ d("div", { className: "grid gap-3 md:grid-cols-2", children: [
|
|
1472
1474
|
/* @__PURE__ */ d("div", { className: "flex flex-col gap-1.5", children: [
|
|
1473
|
-
/* @__PURE__ */ t(
|
|
1475
|
+
/* @__PURE__ */ t(Y, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Variable name" }),
|
|
1474
1476
|
/* @__PURE__ */ t(
|
|
1475
|
-
|
|
1477
|
+
Kt,
|
|
1476
1478
|
{
|
|
1477
1479
|
controlId: e.id,
|
|
1478
1480
|
onCommit: (p) => ct(e.id, p)
|
|
@@ -1481,9 +1483,9 @@ function br({
|
|
|
1481
1483
|
)
|
|
1482
1484
|
] }),
|
|
1483
1485
|
/* @__PURE__ */ d("div", { className: "flex flex-col gap-1.5", children: [
|
|
1484
|
-
/* @__PURE__ */ t(
|
|
1486
|
+
/* @__PURE__ */ t(Y, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Initial value" }),
|
|
1485
1487
|
/* @__PURE__ */ d(
|
|
1486
|
-
|
|
1488
|
+
be,
|
|
1487
1489
|
{
|
|
1488
1490
|
value: e.initialValueStrategy,
|
|
1489
1491
|
onValueChange: (p) => Z(e.id, (S) => ({
|
|
@@ -1491,9 +1493,9 @@ function br({
|
|
|
1491
1493
|
initialValueStrategy: p
|
|
1492
1494
|
})),
|
|
1493
1495
|
children: [
|
|
1494
|
-
/* @__PURE__ */ t(
|
|
1495
|
-
/* @__PURE__ */ t(
|
|
1496
|
-
|
|
1496
|
+
/* @__PURE__ */ t(ge, { size: "xs", children: /* @__PURE__ */ t(ye, {}) }),
|
|
1497
|
+
/* @__PURE__ */ t(xe, { children: It.map((p) => /* @__PURE__ */ t(
|
|
1498
|
+
ve,
|
|
1497
1499
|
{
|
|
1498
1500
|
value: p.value,
|
|
1499
1501
|
children: p.label
|
|
@@ -1506,7 +1508,7 @@ function br({
|
|
|
1506
1508
|
] })
|
|
1507
1509
|
] }),
|
|
1508
1510
|
/* @__PURE__ */ t(
|
|
1509
|
-
|
|
1511
|
+
Pt,
|
|
1510
1512
|
{
|
|
1511
1513
|
control: e,
|
|
1512
1514
|
onChange: (p) => Z(e.id, () => p)
|
|
@@ -1522,30 +1524,30 @@ function br({
|
|
|
1522
1524
|
e.id
|
|
1523
1525
|
);
|
|
1524
1526
|
}),
|
|
1525
|
-
!
|
|
1526
|
-
|
|
1527
|
+
!a && /* @__PURE__ */ d(
|
|
1528
|
+
E,
|
|
1527
1529
|
{
|
|
1528
1530
|
type: "button",
|
|
1529
1531
|
variant: "outline",
|
|
1530
1532
|
size: "xs",
|
|
1531
1533
|
onClick: pt,
|
|
1532
1534
|
children: [
|
|
1533
|
-
/* @__PURE__ */ t(
|
|
1535
|
+
/* @__PURE__ */ t(Yt, { className: "h-3.5 w-3.5" }),
|
|
1534
1536
|
"Add control"
|
|
1535
1537
|
]
|
|
1536
1538
|
}
|
|
1537
1539
|
)
|
|
1538
1540
|
] });
|
|
1539
1541
|
}
|
|
1540
|
-
function
|
|
1542
|
+
function ya(s) {
|
|
1541
1543
|
const {
|
|
1542
|
-
open:
|
|
1544
|
+
open: r,
|
|
1543
1545
|
onOpenChange: o,
|
|
1544
1546
|
initialCreateFlowActive: i = !1,
|
|
1545
1547
|
dismissMode: f = "passive"
|
|
1546
|
-
} = s, u =
|
|
1548
|
+
} = s, u = r !== void 0, [b, x] = j(!1), [h, C] = j(
|
|
1547
1549
|
i
|
|
1548
|
-
), y = u ?
|
|
1550
|
+
), y = u ? r : b, m = B(
|
|
1549
1551
|
(k) => {
|
|
1550
1552
|
!k && h && f === "passive" || (u || x(k), k || C(!1), o == null || o(k));
|
|
1551
1553
|
},
|
|
@@ -1556,7 +1558,7 @@ function gr(s) {
|
|
|
1556
1558
|
Se(() => {
|
|
1557
1559
|
y || C(!1);
|
|
1558
1560
|
}, [y]);
|
|
1559
|
-
const
|
|
1561
|
+
const V = B(
|
|
1560
1562
|
(k) => {
|
|
1561
1563
|
h && k.preventDefault();
|
|
1562
1564
|
},
|
|
@@ -1566,22 +1568,22 @@ function gr(s) {
|
|
|
1566
1568
|
forceClose: v,
|
|
1567
1569
|
handleOpenChange: m,
|
|
1568
1570
|
isCreateFlowActive: h,
|
|
1569
|
-
preventPassiveDismissDuringCreate:
|
|
1571
|
+
preventPassiveDismissDuringCreate: V,
|
|
1570
1572
|
resolvedOpen: y,
|
|
1571
1573
|
setIsCreateFlowActive: C
|
|
1572
1574
|
};
|
|
1573
1575
|
}
|
|
1574
1576
|
export {
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1577
|
+
ca as C,
|
|
1578
|
+
pa as E,
|
|
1579
|
+
Jt as L,
|
|
1580
|
+
ua as V,
|
|
1581
|
+
ha as a,
|
|
1582
|
+
ma as b,
|
|
1583
|
+
fa as c,
|
|
1584
|
+
Wt as d,
|
|
1585
|
+
ga as e,
|
|
1584
1586
|
ot as f,
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
+
ba as g,
|
|
1588
|
+
ya as u
|
|
1587
1589
|
};
|