react-semaphor 0.1.320 → 0.1.322
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/briefings/index.cjs +1 -1
- package/dist/briefings/index.js +278 -208
- package/dist/chunks/{braces-NfG5hX2c.js → braces-C7BeIXvM.js} +1 -1
- package/dist/chunks/{braces-CDPz6CF2.js → braces-ZjRH2Kl7.js} +1 -1
- package/dist/chunks/{calendar-preferences-dialog-CFXQBJ4A.js → calendar-preferences-dialog-CZqePF6B.js} +1 -1
- package/dist/chunks/{calendar-preferences-dialog-B7Z8OnuZ.js → calendar-preferences-dialog-t0OOALVd.js} +3 -3
- package/dist/chunks/{chevrons-up-down-BsdQRmJL.js → chevrons-up-down-CA-XvN1o.js} +1 -1
- package/dist/chunks/{chevrons-up-down-DiWloubI.js → chevrons-up-down-Cuilz9aY.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-DB16djcj.js → dashboard-briefing-launcher-BYbnbZ9e.js} +933 -910
- package/dist/chunks/{dashboard-briefing-launcher-DjDpGyD7.js → dashboard-briefing-launcher-d1_fm91W.js} +17 -17
- package/dist/chunks/dashboard-controls-B3HHMRPC.js +52 -0
- package/dist/chunks/dashboard-controls-BuChCKDm.js +2246 -0
- package/dist/chunks/{dashboard-json-C8-kkiyT.js → dashboard-json-DgoYjD0O.js} +2 -2
- package/dist/chunks/{dashboard-json-2nyFJ_-w.js → dashboard-json-M5-VFCtZ.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-BP77bJFI.js → edit-dashboard-visual-BH8DP1qq.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-D6oiTlXr.js → edit-dashboard-visual-DP31ytwJ.js} +6 -6
- package/dist/chunks/{index-Clw0hJzi.js → index-ChmS5nsv.js} +28873 -28145
- package/dist/chunks/{index-D8eouWYC.js → index-CodH6sqg.js} +217 -212
- package/dist/chunks/{palette-CJTdBzJB.js → palette-CanPG11m.js} +1 -1
- package/dist/chunks/{palette-BlxLchHy.js → palette-D96DOM7E.js} +1 -1
- package/dist/chunks/resource-management-panel-D3vO68dH.js +6 -0
- package/dist/chunks/{resource-management-panel-HcRJRZHO.js → resource-management-panel-gt__S0Pb.js} +451 -369
- package/dist/chunks/{save-B8x5Vi0W.js → save-CqrBQKG6.js} +1 -1
- package/dist/chunks/{save-DVRQBMeb.js → save-DxkSzUTZ.js} +1 -1
- package/dist/chunks/{switch-DPaKnsb8.js → switch-BXICAlvS.js} +2 -2
- package/dist/chunks/{switch-sauemjyY.js → switch-Deo2Ltmj.js} +133 -133
- package/dist/chunks/{use-create-flow-overlay-state-CdCldE6J.js → use-create-flow-overlay-state-BZaSpL-c.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-75l5mrVp.js → use-create-flow-overlay-state-OA3iI54p.js} +104 -104
- package/dist/chunks/{use-visual-utils-CMdEUnM5.js → use-visual-utils-CMucAqbS.js} +1 -1
- package/dist/chunks/{use-visual-utils-Bd4Cf9_B.js → use-visual-utils-CsXS-Zeh.js} +20 -20
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.cjs +3 -0
- package/dist/dashboard-authoring/index.js +532 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +131 -130
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/briefings.d.ts +15 -0
- package/dist/types/dashboard-authoring.d.ts +2703 -0
- package/dist/types/main.d.ts +145 -0
- package/package.json +6 -1
- package/dist/chunks/dashboard-controls-BisfskDD.js +0 -52
- package/dist/chunks/dashboard-controls-DPStW1kd.js +0 -1999
- package/dist/chunks/resource-management-panel-DTvY5OIq.js +0 -6
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { c as te, G as L, H as ne, u as oe, Y as ft, Z as ht, _ as bt, a as ie, a0 as gt,
|
|
1
|
+
import { c as te, G as L, H as ne, u as oe, Y as ft, Z as ht, _ as bt, a as ie, a0 as gt, a8 as yt, B as V, e as xt, X as $e, E as Ke, f as Ye, a9 as vt, aa as Ct, ab as se, ac as Ae, ad as ze, ae as ge, af as ye, ag as kt, ah as Me, ai as Nt, aj as St, ak as le, al as Dt, am as Oe, g as Be, an as Ge, ao as Xe, ap as Je, L as K, a1 as Ze, a2 as xe, a3 as ve, a4 as Ce, a5 as ke, a6 as Ne, aq as We, ar as wt, as as It, at as Re, au as Et, av as Qe, aw as Tt, ax as Se } from "./switch-Deo2Ltmj.js";
|
|
2
2
|
import { useEffect as de, useMemo as z, useState as Q, useRef as De, useCallback as O, Fragment as Vt } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import { jsx as t, jsxs as d, Fragment as
|
|
5
|
-
import { u as we } from "./use-visual-utils-
|
|
6
|
-
import { S as nt } from "./save-
|
|
3
|
+
import { ak as _t, al as et, am as qt, an as Ft, ao as Lt, ap as At, aq as zt, x as Mt, ar as Ot, ad as ue, as as tt, af as at, at as rt, au as Bt, o as R, av as Rt, aw as Qt, ax as je, ay as jt, az as Ut, aA as st, aB as lt, aC as Ht, aD as Pt, aE as $t, aF as Kt, aG as Yt, aH as Gt, aI as Xt, aJ as Jt } from "./index-ChmS5nsv.js";
|
|
4
|
+
import { jsx as t, jsxs as d, Fragment as P } from "react/jsx-runtime";
|
|
5
|
+
import { u as we } from "./use-visual-utils-CsXS-Zeh.js";
|
|
6
|
+
import { S as nt } from "./save-DxkSzUTZ.js";
|
|
7
7
|
/**
|
|
8
8
|
* @license lucide-react v0.453.0 - ISC
|
|
9
9
|
*
|
|
@@ -21,7 +21,7 @@ const ua = te("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 Zt = te("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" }],
|
|
@@ -168,7 +168,7 @@ function ha({
|
|
|
168
168
|
}, S = {
|
|
169
169
|
local: /* @__PURE__ */ t("span", { className: "h-2 w-2 rounded-full bg-current/70" }),
|
|
170
170
|
linked: /* @__PURE__ */ t(Wt, { className: "h-3.5 w-3.5" }),
|
|
171
|
-
library: /* @__PURE__ */ t(
|
|
171
|
+
library: /* @__PURE__ */ t(Zt, { className: "h-3.5 w-3.5" })
|
|
172
172
|
}, N = {
|
|
173
173
|
local: "Local",
|
|
174
174
|
linked: "Linked",
|
|
@@ -252,7 +252,7 @@ function ga({
|
|
|
252
252
|
}) {
|
|
253
253
|
const o = ue(), [i, p] = Q(!1), u = oe(
|
|
254
254
|
(x) => x.actions.setIsDashboardPanelOpen
|
|
255
|
-
), { setIsVisualEditing: h } =
|
|
255
|
+
), { setIsVisualEditing: h } = Ke(), { getUpdatedFrame: y } = we(), b = at(), v = L((x) => x.frame), g = rt();
|
|
256
256
|
return /* @__PURE__ */ t(
|
|
257
257
|
V,
|
|
258
258
|
{
|
|
@@ -288,10 +288,10 @@ function ga({
|
|
|
288
288
|
className: s,
|
|
289
289
|
size: "xs",
|
|
290
290
|
variant: r,
|
|
291
|
-
children: i ? /* @__PURE__ */ d(
|
|
292
|
-
/* @__PURE__ */ t(
|
|
291
|
+
children: i ? /* @__PURE__ */ d(P, { children: [
|
|
292
|
+
/* @__PURE__ */ t(Ye, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
293
293
|
"Saving"
|
|
294
|
-
] }) : /* @__PURE__ */ d(
|
|
294
|
+
] }) : /* @__PURE__ */ d(P, { children: [
|
|
295
295
|
/* @__PURE__ */ t(nt, { className: "h-3.5 w-3.5" }),
|
|
296
296
|
"Save to Library"
|
|
297
297
|
] })
|
|
@@ -301,7 +301,7 @@ function ga({
|
|
|
301
301
|
function ya({
|
|
302
302
|
className: s
|
|
303
303
|
}) {
|
|
304
|
-
const r = ue(), [o, i] = Q(!1), p = at(), u = L((N) => N.frame), h = oe((N) => N.selectedSheetId), y = oe((N) => N.dashboard), { updateFrame: b, setIsVisualEditing: v } =
|
|
304
|
+
const r = ue(), [o, i] = Q(!1), p = at(), u = L((N) => N.frame), h = oe((N) => N.selectedSheetId), y = oe((N) => N.dashboard), { updateFrame: b, setIsVisualEditing: v } = Ke(), { getUpdatedFrame: g } = we(), m = rt(), x = Bt();
|
|
305
305
|
return /* @__PURE__ */ t(
|
|
306
306
|
V,
|
|
307
307
|
{
|
|
@@ -326,8 +326,8 @@ function ya({
|
|
|
326
326
|
...D,
|
|
327
327
|
visualId: N
|
|
328
328
|
// Keep the link to library visual
|
|
329
|
-
},
|
|
330
|
-
previousFrame:
|
|
329
|
+
}, Y = Rt(y, q.id), G = await x(q, {
|
|
330
|
+
previousFrame: Y
|
|
331
331
|
});
|
|
332
332
|
await m.mutateAsync({
|
|
333
333
|
visualId: N,
|
|
@@ -335,7 +335,7 @@ function ya({
|
|
|
335
335
|
frameObject: D
|
|
336
336
|
}
|
|
337
337
|
}), b(h, q, {
|
|
338
|
-
semanticExecutionPayload:
|
|
338
|
+
semanticExecutionPayload: G
|
|
339
339
|
}), r.invalidateQueries({ queryKey: ["visuals"] }), r.invalidateQueries({ queryKey: ["visual", N] }), R.success("Saved to library and applied locally"), setTimeout(() => {
|
|
340
340
|
v(!1);
|
|
341
341
|
}, 300);
|
|
@@ -351,10 +351,10 @@ function ya({
|
|
|
351
351
|
size: "xs",
|
|
352
352
|
variant: "default",
|
|
353
353
|
disabled: o,
|
|
354
|
-
children: o ? /* @__PURE__ */ d(
|
|
355
|
-
/* @__PURE__ */ t(
|
|
354
|
+
children: o ? /* @__PURE__ */ d(P, { children: [
|
|
355
|
+
/* @__PURE__ */ t(Ye, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
356
356
|
"Saving..."
|
|
357
|
-
] }) : /* @__PURE__ */ d(
|
|
357
|
+
] }) : /* @__PURE__ */ d(P, { children: [
|
|
358
358
|
/* @__PURE__ */ t(nt, { className: "h-3.5 w-3.5" }),
|
|
359
359
|
"Save & Apply"
|
|
360
360
|
] })
|
|
@@ -378,7 +378,7 @@ function xa({ className: s }) {
|
|
|
378
378
|
size: "xs",
|
|
379
379
|
variant: "outline",
|
|
380
380
|
children: [
|
|
381
|
-
/* @__PURE__ */ t(
|
|
381
|
+
/* @__PURE__ */ t($e, { className: "h-3.5 w-3.5" }),
|
|
382
382
|
"Close"
|
|
383
383
|
]
|
|
384
384
|
}
|
|
@@ -397,25 +397,25 @@ function va({
|
|
|
397
397
|
setCardPreferences: N,
|
|
398
398
|
clearQueryConfig: D,
|
|
399
399
|
setCardConfig: q,
|
|
400
|
-
setCardType:
|
|
401
|
-
setFrame:
|
|
400
|
+
setCardType: Y,
|
|
401
|
+
setFrame: G,
|
|
402
402
|
setCard: ae,
|
|
403
|
-
setActiveTabCardId:
|
|
403
|
+
setActiveTabCardId: X
|
|
404
404
|
} = ne();
|
|
405
405
|
function pe() {
|
|
406
|
-
var
|
|
406
|
+
var J, re, _, Z;
|
|
407
407
|
const M = p.getQueryData(v);
|
|
408
408
|
u != null && u.queryData || i({
|
|
409
409
|
queryKey: v,
|
|
410
410
|
queryData: M
|
|
411
411
|
}), p.setQueryData(v, null), p.removeQueries({ queryKey: v, exact: !0 }), g(""), m({}), D(), q(void 0), x(""), S(""), N({});
|
|
412
|
-
const a = L.getState().frame,
|
|
413
|
-
|
|
412
|
+
const a = L.getState().frame, E = L.getState().card, T = et(a, E), B = ((J = T == null ? void 0 : T.customCardPreferences) == null ? void 0 : J.visualType) === "multiple" || !!((re = T == null ? void 0 : T.customCardPreferences) != null && re.dataInputCardIds) || (((_ = T == null ? void 0 : T.customCardPreferences) == null ? void 0 : _.minInputs) || 0) > 1 || (((Z = T == null ? void 0 : T.customCardPreferences) == null ? void 0 : Z.maxInputs) || 0) > 1, j = ea(E, B);
|
|
413
|
+
G({
|
|
414
414
|
...a,
|
|
415
415
|
cards: a.cards.map(
|
|
416
416
|
(U) => U.id === j.id ? j : U
|
|
417
417
|
)
|
|
418
|
-
}),
|
|
418
|
+
}), X(j.id), ae(j), B || Y("bar");
|
|
419
419
|
}
|
|
420
420
|
return /* @__PURE__ */ d(
|
|
421
421
|
V,
|
|
@@ -425,7 +425,7 @@ function va({
|
|
|
425
425
|
size: "xs",
|
|
426
426
|
variant: r,
|
|
427
427
|
children: [
|
|
428
|
-
/* @__PURE__ */ t(
|
|
428
|
+
/* @__PURE__ */ t($e, { className: "h-3.5 w-3.5" }),
|
|
429
429
|
s
|
|
430
430
|
]
|
|
431
431
|
}
|
|
@@ -434,9 +434,9 @@ function va({
|
|
|
434
434
|
function it(s) {
|
|
435
435
|
const { control: r, onChange: o } = s;
|
|
436
436
|
return /* @__PURE__ */ d("div", { className: "flex flex-col gap-1.5", children: [
|
|
437
|
-
/* @__PURE__ */ t(
|
|
437
|
+
/* @__PURE__ */ t(K, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Label" }),
|
|
438
438
|
/* @__PURE__ */ t(
|
|
439
|
-
|
|
439
|
+
Ze,
|
|
440
440
|
{
|
|
441
441
|
size: "xs",
|
|
442
442
|
value: r.label,
|
|
@@ -494,17 +494,17 @@ function ce(s) {
|
|
|
494
494
|
function aa(s) {
|
|
495
495
|
const { control: r, scope: o, detail: i } = s;
|
|
496
496
|
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: [
|
|
497
|
-
/* @__PURE__ */ t(
|
|
497
|
+
/* @__PURE__ */ t(Jt, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-foreground" }),
|
|
498
498
|
/* @__PURE__ */ d("div", { className: "min-w-0 space-y-0.5", children: [
|
|
499
499
|
/* @__PURE__ */ t("div", { className: "text-[13px] font-medium text-foreground", children: r.label }),
|
|
500
500
|
/* @__PURE__ */ d("div", { className: "text-[12px] text-muted-foreground", children: [
|
|
501
|
-
|
|
501
|
+
Ge(r.type).label,
|
|
502
502
|
" ·",
|
|
503
503
|
" ",
|
|
504
|
-
|
|
504
|
+
Je(r),
|
|
505
505
|
" ·",
|
|
506
506
|
" ",
|
|
507
|
-
|
|
507
|
+
Xe(o, r.placement)
|
|
508
508
|
] }),
|
|
509
509
|
i ? /* @__PURE__ */ t("div", { className: "text-[12px] text-muted-foreground", children: i }) : null
|
|
510
510
|
] })
|
|
@@ -576,7 +576,7 @@ const ra = /* @__PURE__ */ new Set([
|
|
|
576
576
|
"field_selector",
|
|
577
577
|
"metric_selector"
|
|
578
578
|
]);
|
|
579
|
-
function
|
|
579
|
+
function He(s) {
|
|
580
580
|
const { text: r, ariaLabel: o } = s, [i, p] = Q(!1);
|
|
581
581
|
return /* @__PURE__ */ d(
|
|
582
582
|
"button",
|
|
@@ -598,7 +598,7 @@ function $e(s) {
|
|
|
598
598
|
}
|
|
599
599
|
);
|
|
600
600
|
}
|
|
601
|
-
function
|
|
601
|
+
function Pe(s) {
|
|
602
602
|
const {
|
|
603
603
|
control: r,
|
|
604
604
|
scope: o,
|
|
@@ -629,14 +629,14 @@ function He(s) {
|
|
|
629
629
|
/* @__PURE__ */ d("div", { className: "space-y-1.5 px-3 py-2.5", children: [
|
|
630
630
|
/* @__PURE__ */ t("p", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "SQL cards" }),
|
|
631
631
|
/* @__PURE__ */ t(
|
|
632
|
-
|
|
632
|
+
He,
|
|
633
633
|
{
|
|
634
634
|
text: i,
|
|
635
635
|
ariaLabel: "Copy SQL control reference"
|
|
636
636
|
}
|
|
637
637
|
),
|
|
638
638
|
x ? /* @__PURE__ */ t(
|
|
639
|
-
|
|
639
|
+
He,
|
|
640
640
|
{
|
|
641
641
|
text: x,
|
|
642
642
|
ariaLabel: "Copy Jinja control reference"
|
|
@@ -718,16 +718,16 @@ function Ca({
|
|
|
718
718
|
const q = z(
|
|
719
719
|
() => new Set(o || []),
|
|
720
720
|
[o]
|
|
721
|
-
),
|
|
721
|
+
), Y = wt(s), G = Ct(s), [ae, X] = Q(
|
|
722
722
|
null
|
|
723
723
|
), [pe, M] = Q(
|
|
724
724
|
null
|
|
725
|
-
), [a,
|
|
725
|
+
), [a, E] = Q(
|
|
726
726
|
() => h ? {
|
|
727
727
|
step: 1,
|
|
728
728
|
control: se(s, r, Array.from(q))
|
|
729
729
|
} : null
|
|
730
|
-
),
|
|
730
|
+
), T = De({}), B = De(void 0), j = De(h), J = z(() => {
|
|
731
731
|
const e = Ae({ scope: s, card: x });
|
|
732
732
|
if (!S)
|
|
733
733
|
return e;
|
|
@@ -749,7 +749,7 @@ function Ca({
|
|
|
749
749
|
), _ = O(
|
|
750
750
|
(e) => s === "dashboard" && (e === "field_selector" || e === "metric_selector"),
|
|
751
751
|
[s]
|
|
752
|
-
),
|
|
752
|
+
), Z = z(
|
|
753
753
|
() => a ? ze(
|
|
754
754
|
g || [],
|
|
755
755
|
a.control.type
|
|
@@ -792,10 +792,10 @@ function Ca({
|
|
|
792
792
|
N == null || N(!!a);
|
|
793
793
|
}, [a, N]), de(() => {
|
|
794
794
|
const e = h && !j.current;
|
|
795
|
-
j.current = h, e && (
|
|
795
|
+
j.current = h, e && (E({
|
|
796
796
|
step: 1,
|
|
797
797
|
control: se(s, r, Array.from(q))
|
|
798
|
-
}), M(null),
|
|
798
|
+
}), M(null), X(null));
|
|
799
799
|
}, [r, h, q, s]);
|
|
800
800
|
const dt = (e) => {
|
|
801
801
|
if (!_(e.type))
|
|
@@ -824,7 +824,7 @@ function Ca({
|
|
|
824
824
|
target: l.metricTargetMap[c.value]
|
|
825
825
|
})) : []
|
|
826
826
|
};
|
|
827
|
-
},
|
|
827
|
+
}, Ee = (e) => {
|
|
828
828
|
if (!_(e.control.type))
|
|
829
829
|
return {
|
|
830
830
|
nextControl: e.control,
|
|
@@ -834,7 +834,7 @@ function Ca({
|
|
|
834
834
|
controlType: e.control.type,
|
|
835
835
|
participants: g || [],
|
|
836
836
|
selectedCardIds: e.nextSelectedCardIds
|
|
837
|
-
}), c =
|
|
837
|
+
}), c = Tt({
|
|
838
838
|
control: e.control,
|
|
839
839
|
choices: l.choices
|
|
840
840
|
}), C = Object.fromEntries(
|
|
@@ -872,17 +872,17 @@ function Ca({
|
|
|
872
872
|
);
|
|
873
873
|
let k, f;
|
|
874
874
|
if (C && s === "dashboard" && (C.type === "field_selector" || C.type === "metric_selector")) {
|
|
875
|
-
const I = (m == null ? void 0 : m[C.id]) || [],
|
|
875
|
+
const I = (m == null ? void 0 : m[C.id]) || [], $ = Ee({
|
|
876
876
|
control: C,
|
|
877
877
|
nextSelectedCardIds: I
|
|
878
878
|
});
|
|
879
879
|
c = c.map(
|
|
880
|
-
(
|
|
881
|
-
), k =
|
|
880
|
+
(H) => H.id === e ? $.nextControl : H
|
|
881
|
+
), k = $.cardBindingsById, f = [C.id];
|
|
882
882
|
} else if (l && s === "dashboard" && (l.type === "field_selector" || l.type === "metric_selector")) {
|
|
883
883
|
const I = (m == null ? void 0 : m[l.id]) || [];
|
|
884
884
|
k = Object.fromEntries(
|
|
885
|
-
I.map((
|
|
885
|
+
I.map(($) => [$, void 0])
|
|
886
886
|
), f = [l.id];
|
|
887
887
|
}
|
|
888
888
|
const w = c.find(
|
|
@@ -894,14 +894,14 @@ function Ca({
|
|
|
894
894
|
control: l,
|
|
895
895
|
defaultValues: i
|
|
896
896
|
});
|
|
897
|
-
l.source.kind === "manual" && w.source.kind === "sql_query" && (
|
|
898
|
-
const
|
|
897
|
+
l.source.kind === "manual" && w.source.kind === "sql_query" && (T.current[e] = I);
|
|
898
|
+
const $ = I === void 0 && l.source.kind === "sql_query" && w.source.kind === "manual" ? T.current[e] : I, H = Re({
|
|
899
899
|
previousControl: l,
|
|
900
900
|
nextControl: w,
|
|
901
|
-
currentDefaultValue:
|
|
901
|
+
currentDefaultValue: $
|
|
902
902
|
});
|
|
903
|
-
w.source.kind === "manual" && (
|
|
904
|
-
(Le) => Le.id === e ? { ...w, defaultValue:
|
|
903
|
+
w.source.kind === "manual" && (T.current[e] = H), i && (F = { ...i }, H === void 0 ? delete F[e] : F[e] = H), c = c.map(
|
|
904
|
+
(Le) => Le.id === e ? { ...w, defaultValue: H } : Le
|
|
905
905
|
);
|
|
906
906
|
}
|
|
907
907
|
A(c, F, {
|
|
@@ -912,7 +912,7 @@ function Ca({
|
|
|
912
912
|
}, ct = (e, n) => {
|
|
913
913
|
if (!n.trim())
|
|
914
914
|
return;
|
|
915
|
-
const l =
|
|
915
|
+
const l = Xt(n);
|
|
916
916
|
if (l === e || q.has(l) || r.some(
|
|
917
917
|
(k) => k.id === l && k.id !== e
|
|
918
918
|
))
|
|
@@ -943,12 +943,12 @@ function Ca({
|
|
|
943
943
|
const l = { ...i };
|
|
944
944
|
delete l[e], A(n, l, { type: "remove", controlId: e });
|
|
945
945
|
}, pt = O(() => {
|
|
946
|
-
B.current = void 0,
|
|
946
|
+
B.current = void 0, E({
|
|
947
947
|
step: 1,
|
|
948
948
|
control: se(s, r, Array.from(q))
|
|
949
|
-
}), M(null),
|
|
949
|
+
}), M(null), X(null);
|
|
950
950
|
}, [r, q, s]), ee = (e) => {
|
|
951
|
-
|
|
951
|
+
E(
|
|
952
952
|
(n) => n && (() => {
|
|
953
953
|
const l = e(n.control);
|
|
954
954
|
n.control.source.kind === "manual" && l.source.kind === "sql_query" && (B.current = n.defaultValue);
|
|
@@ -964,8 +964,8 @@ function Ca({
|
|
|
964
964
|
};
|
|
965
965
|
})()
|
|
966
966
|
);
|
|
967
|
-
},
|
|
968
|
-
|
|
967
|
+
}, Te = (e) => {
|
|
968
|
+
E(
|
|
969
969
|
(n) => n && (n.control.source.kind === "manual" && (B.current = e), {
|
|
970
970
|
...n,
|
|
971
971
|
defaultValue: e
|
|
@@ -994,7 +994,7 @@ function Ca({
|
|
|
994
994
|
var k;
|
|
995
995
|
if (!a)
|
|
996
996
|
return;
|
|
997
|
-
const e = Me(a.control), n =
|
|
997
|
+
const e = Me(a.control), n = Et({
|
|
998
998
|
label: e.label,
|
|
999
999
|
fallbackId: e.id,
|
|
1000
1000
|
existingControls: r,
|
|
@@ -1010,7 +1010,7 @@ function Ca({
|
|
|
1010
1010
|
l,
|
|
1011
1011
|
a.defaultValue
|
|
1012
1012
|
);
|
|
1013
|
-
|
|
1013
|
+
E({
|
|
1014
1014
|
step: s === "dashboard" && (l.type === "field_selector" || l.type === "metric_selector") ? 4 : 3,
|
|
1015
1015
|
control: l,
|
|
1016
1016
|
defaultValue: C,
|
|
@@ -1019,10 +1019,10 @@ function Ca({
|
|
|
1019
1019
|
cardBindingsById: c
|
|
1020
1020
|
});
|
|
1021
1021
|
}, fe = O(() => {
|
|
1022
|
-
|
|
1022
|
+
E(null);
|
|
1023
1023
|
}, []), _e = O(() => {
|
|
1024
1024
|
if (!(a != null && a.createdControlId)) {
|
|
1025
|
-
|
|
1025
|
+
E(null);
|
|
1026
1026
|
return;
|
|
1027
1027
|
}
|
|
1028
1028
|
const e = a.control, n = a.createdControlId, l = le(
|
|
@@ -1060,7 +1060,7 @@ function Ca({
|
|
|
1060
1060
|
cardBindingsById: a.cardBindingsById
|
|
1061
1061
|
}
|
|
1062
1062
|
);
|
|
1063
|
-
M(n),
|
|
1063
|
+
M(n), E(null), D == null || D();
|
|
1064
1064
|
}, [r, a, i, A, D]), mt = a ? _(a.control.type) ? ["Choose type", "Select cards", "Configure", "Finish"] : ["Choose type", "Configure", "Finish"] : [], qe = a != null && a.createdControlId ? `[[param.${a.createdControlId}]]` : a ? `[[param.${Dt(a.control.label) || a.control.id}]]` : "", he = Oe({
|
|
1065
1065
|
controls: r,
|
|
1066
1066
|
defaultValues: i
|
|
@@ -1094,16 +1094,16 @@ function Ca({
|
|
|
1094
1094
|
// keeping the shared definitions for existing controls.
|
|
1095
1095
|
"date",
|
|
1096
1096
|
"text"
|
|
1097
|
-
]), l =
|
|
1097
|
+
]), l = J.filter(
|
|
1098
1098
|
(k) => !e.has(k.value) && !n.has(k.value)
|
|
1099
|
-
), c =
|
|
1099
|
+
), c = J.filter(
|
|
1100
1100
|
(k) => e.has(k.value)
|
|
1101
1101
|
), C = (k) => /* @__PURE__ */ d(
|
|
1102
1102
|
"button",
|
|
1103
1103
|
{
|
|
1104
1104
|
type: "button",
|
|
1105
1105
|
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",
|
|
1106
|
-
onClick: () =>
|
|
1106
|
+
onClick: () => E(
|
|
1107
1107
|
sa({
|
|
1108
1108
|
scope: s,
|
|
1109
1109
|
existingControls: r,
|
|
@@ -1159,7 +1159,7 @@ function Ca({
|
|
|
1159
1159
|
),
|
|
1160
1160
|
/* @__PURE__ */ t("p", { className: "text-[12px] text-muted-foreground", children: "Choose which cards should respond to this shared control." })
|
|
1161
1161
|
] }),
|
|
1162
|
-
|
|
1162
|
+
Z.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: Z.map((e) => {
|
|
1163
1163
|
const n = (a.selectedCardIds || []).includes(e.cardId);
|
|
1164
1164
|
return /* @__PURE__ */ d(
|
|
1165
1165
|
"label",
|
|
@@ -1170,7 +1170,7 @@ function Ca({
|
|
|
1170
1170
|
Qt,
|
|
1171
1171
|
{
|
|
1172
1172
|
checked: n,
|
|
1173
|
-
onCheckedChange: (l) =>
|
|
1173
|
+
onCheckedChange: (l) => E(
|
|
1174
1174
|
(c) => c && {
|
|
1175
1175
|
...c,
|
|
1176
1176
|
selectedCardIds: l === !0 ? [
|
|
@@ -1201,7 +1201,7 @@ function Ca({
|
|
|
1201
1201
|
type: "button",
|
|
1202
1202
|
variant: "outline",
|
|
1203
1203
|
size: "xs",
|
|
1204
|
-
onClick: () =>
|
|
1204
|
+
onClick: () => E(
|
|
1205
1205
|
(e) => e && {
|
|
1206
1206
|
...e,
|
|
1207
1207
|
step: 1,
|
|
@@ -1216,7 +1216,7 @@ function Ca({
|
|
|
1216
1216
|
{
|
|
1217
1217
|
type: "button",
|
|
1218
1218
|
size: "xs",
|
|
1219
|
-
onClick: () =>
|
|
1219
|
+
onClick: () => E(
|
|
1220
1220
|
(e) => e && {
|
|
1221
1221
|
...e,
|
|
1222
1222
|
step: 3
|
|
@@ -1243,8 +1243,8 @@ function Ca({
|
|
|
1243
1243
|
...n,
|
|
1244
1244
|
label: e
|
|
1245
1245
|
})),
|
|
1246
|
-
onDefaultValueChange:
|
|
1247
|
-
onBack: () =>
|
|
1246
|
+
onDefaultValueChange: Te,
|
|
1247
|
+
onBack: () => E(
|
|
1248
1248
|
(e) => e && {
|
|
1249
1249
|
...e,
|
|
1250
1250
|
step: 1
|
|
@@ -1268,8 +1268,8 @@ function Ca({
|
|
|
1268
1268
|
...n,
|
|
1269
1269
|
label: e
|
|
1270
1270
|
})),
|
|
1271
|
-
onDefaultValueChange:
|
|
1272
|
-
onBack: () =>
|
|
1271
|
+
onDefaultValueChange: Te,
|
|
1272
|
+
onBack: () => E(
|
|
1273
1273
|
(e) => e && {
|
|
1274
1274
|
...e,
|
|
1275
1275
|
step: 2
|
|
@@ -1280,12 +1280,12 @@ function Ca({
|
|
|
1280
1280
|
}
|
|
1281
1281
|
),
|
|
1282
1282
|
a.step === 3 && !_(a.control.type) && /* @__PURE__ */ t(
|
|
1283
|
-
|
|
1283
|
+
Pe,
|
|
1284
1284
|
{
|
|
1285
1285
|
control: a.control,
|
|
1286
1286
|
scope: s,
|
|
1287
1287
|
createdReference: qe,
|
|
1288
|
-
explorerContent: /* @__PURE__ */ d(
|
|
1288
|
+
explorerContent: /* @__PURE__ */ d(P, { children: [
|
|
1289
1289
|
"Open the card and use",
|
|
1290
1290
|
" ",
|
|
1291
1291
|
/* @__PURE__ */ t("span", { className: "font-medium text-foreground", children: "Settings → Controls" }),
|
|
@@ -1293,7 +1293,7 @@ function Ca({
|
|
|
1293
1293
|
"to choose what this control changes."
|
|
1294
1294
|
] }),
|
|
1295
1295
|
sqlDescription: "Reference this control directly in the SQL editor.",
|
|
1296
|
-
onBack: () =>
|
|
1296
|
+
onBack: () => E(
|
|
1297
1297
|
(e) => e && {
|
|
1298
1298
|
...e,
|
|
1299
1299
|
step: 2
|
|
@@ -1304,20 +1304,20 @@ function Ca({
|
|
|
1304
1304
|
}
|
|
1305
1305
|
),
|
|
1306
1306
|
a.step === 4 && _(a.control.type) && /* @__PURE__ */ t(
|
|
1307
|
-
|
|
1307
|
+
Pe,
|
|
1308
1308
|
{
|
|
1309
1309
|
control: a.control,
|
|
1310
1310
|
scope: s,
|
|
1311
1311
|
createdReference: qe,
|
|
1312
|
-
summaryDetail: /* @__PURE__ */ d(
|
|
1312
|
+
summaryDetail: /* @__PURE__ */ d(P, { children: [
|
|
1313
1313
|
"Used by ",
|
|
1314
1314
|
(a.selectedCardIds || []).length,
|
|
1315
1315
|
" selected card",
|
|
1316
1316
|
(a.selectedCardIds || []).length === 1 ? "" : "s"
|
|
1317
1317
|
] }),
|
|
1318
|
-
explorerContent: /* @__PURE__ */ t(
|
|
1318
|
+
explorerContent: /* @__PURE__ */ t(P, { children: "Selected cards have been set up to respond to this control automatically." }),
|
|
1319
1319
|
sqlDescription: "SQL cards can still reference this control directly in the SQL editor.",
|
|
1320
|
-
onBack: () =>
|
|
1320
|
+
onBack: () => E(
|
|
1321
1321
|
(e) => e && {
|
|
1322
1322
|
...e,
|
|
1323
1323
|
step: 3
|
|
@@ -1353,11 +1353,11 @@ function Ca({
|
|
|
1353
1353
|
/* @__PURE__ */ d("div", { className: "min-w-0", children: [
|
|
1354
1354
|
/* @__PURE__ */ d("div", { className: "flex flex-wrap items-center gap-1.5", children: [
|
|
1355
1355
|
/* @__PURE__ */ t("span", { className: "truncate text-[13px] font-medium text-foreground", children: e.label || "Untitled control" }),
|
|
1356
|
-
/* @__PURE__ */ t("span", { className: k, children:
|
|
1357
|
-
/* @__PURE__ */ t("span", { className: k, children:
|
|
1356
|
+
/* @__PURE__ */ t("span", { className: k, children: Ge(e.type).label }),
|
|
1357
|
+
/* @__PURE__ */ t("span", { className: k, children: Xe(s, e.placement) })
|
|
1358
1358
|
] }),
|
|
1359
1359
|
/* @__PURE__ */ d("div", { className: "mt-0.5 text-[12px] text-muted-foreground", children: [
|
|
1360
|
-
|
|
1360
|
+
Je(e),
|
|
1361
1361
|
l != null && l.status ? ` · ${l.status}` : ""
|
|
1362
1362
|
] })
|
|
1363
1363
|
] })
|
|
@@ -1380,9 +1380,9 @@ function Ca({
|
|
|
1380
1380
|
C && /* @__PURE__ */ d("div", { className: "space-y-4 border-t border-border/60 px-3 py-3", children: [
|
|
1381
1381
|
/* @__PURE__ */ d("div", { className: "grid gap-3 md:grid-cols-3", children: [
|
|
1382
1382
|
/* @__PURE__ */ d("div", { className: "flex flex-col gap-1.5", children: [
|
|
1383
|
-
/* @__PURE__ */ t(
|
|
1383
|
+
/* @__PURE__ */ t(K, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Label" }),
|
|
1384
1384
|
/* @__PURE__ */ t(
|
|
1385
|
-
|
|
1385
|
+
Ze,
|
|
1386
1386
|
{
|
|
1387
1387
|
size: "xs",
|
|
1388
1388
|
value: e.label,
|
|
@@ -1395,7 +1395,7 @@ function Ca({
|
|
|
1395
1395
|
)
|
|
1396
1396
|
] }),
|
|
1397
1397
|
/* @__PURE__ */ d("div", { className: "flex flex-col gap-1.5", children: [
|
|
1398
|
-
/* @__PURE__ */ t(
|
|
1398
|
+
/* @__PURE__ */ t(K, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Type" }),
|
|
1399
1399
|
/* @__PURE__ */ d(
|
|
1400
1400
|
xe,
|
|
1401
1401
|
{
|
|
@@ -1426,18 +1426,18 @@ function Ca({
|
|
|
1426
1426
|
)
|
|
1427
1427
|
] }),
|
|
1428
1428
|
/* @__PURE__ */ d("div", { className: "flex flex-col gap-1.5", children: [
|
|
1429
|
-
/* @__PURE__ */ t(
|
|
1429
|
+
/* @__PURE__ */ t(K, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Show in" }),
|
|
1430
1430
|
/* @__PURE__ */ d(
|
|
1431
1431
|
xe,
|
|
1432
1432
|
{
|
|
1433
|
-
value: e.placement ||
|
|
1433
|
+
value: e.placement || G,
|
|
1434
1434
|
onValueChange: (f) => W(e.id, (w) => ({
|
|
1435
1435
|
...w,
|
|
1436
1436
|
placement: f
|
|
1437
1437
|
})),
|
|
1438
1438
|
children: [
|
|
1439
1439
|
/* @__PURE__ */ t(ve, { size: "xs", children: /* @__PURE__ */ t(Ce, {}) }),
|
|
1440
|
-
/* @__PURE__ */ t(ke, { children:
|
|
1440
|
+
/* @__PURE__ */ t(ke, { children: Y.map((f) => /* @__PURE__ */ t(Ne, { value: f.value, children: f.label }, f.value)) })
|
|
1441
1441
|
]
|
|
1442
1442
|
}
|
|
1443
1443
|
)
|
|
@@ -1457,7 +1457,7 @@ function Ca({
|
|
|
1457
1457
|
})),
|
|
1458
1458
|
selectedCardIds: (m == null ? void 0 : m[e.id]) || [],
|
|
1459
1459
|
onChange: (f) => {
|
|
1460
|
-
const w =
|
|
1460
|
+
const w = Ee({
|
|
1461
1461
|
control: e,
|
|
1462
1462
|
nextSelectedCardIds: f
|
|
1463
1463
|
}), F = r.map(
|
|
@@ -1495,7 +1495,7 @@ function Ca({
|
|
|
1495
1495
|
const w = r.map(
|
|
1496
1496
|
(F) => F.id === e.id ? { ...F, defaultValue: f } : F
|
|
1497
1497
|
);
|
|
1498
|
-
if (e.source.kind === "manual" && (
|
|
1498
|
+
if (e.source.kind === "manual" && (T.current[e.id] = f), i) {
|
|
1499
1499
|
const F = { ...i };
|
|
1500
1500
|
f === void 0 ? delete F[e.id] : F[e.id] = f, A(w, F);
|
|
1501
1501
|
return;
|
|
@@ -1505,12 +1505,12 @@ function Ca({
|
|
|
1505
1505
|
}
|
|
1506
1506
|
),
|
|
1507
1507
|
/* @__PURE__ */ d(
|
|
1508
|
-
|
|
1508
|
+
Ht,
|
|
1509
1509
|
{
|
|
1510
1510
|
open: ae === e.id,
|
|
1511
|
-
onOpenChange: (f) =>
|
|
1511
|
+
onOpenChange: (f) => X(f ? e.id : null),
|
|
1512
1512
|
children: [
|
|
1513
|
-
/* @__PURE__ */ t(
|
|
1513
|
+
/* @__PURE__ */ t(Pt, { asChild: !0, children: /* @__PURE__ */ d(
|
|
1514
1514
|
V,
|
|
1515
1515
|
{
|
|
1516
1516
|
type: "button",
|
|
@@ -1523,12 +1523,12 @@ function Ca({
|
|
|
1523
1523
|
]
|
|
1524
1524
|
}
|
|
1525
1525
|
) }),
|
|
1526
|
-
/* @__PURE__ */ d(
|
|
1526
|
+
/* @__PURE__ */ d($t, { className: "space-y-3 pt-2", children: [
|
|
1527
1527
|
/* @__PURE__ */ d("div", { className: "grid gap-3 md:grid-cols-2", children: [
|
|
1528
1528
|
/* @__PURE__ */ d("div", { className: "flex flex-col gap-1.5", children: [
|
|
1529
|
-
/* @__PURE__ */ t(
|
|
1529
|
+
/* @__PURE__ */ t(K, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Variable name" }),
|
|
1530
1530
|
/* @__PURE__ */ t(
|
|
1531
|
-
|
|
1531
|
+
Kt,
|
|
1532
1532
|
{
|
|
1533
1533
|
controlId: e.id,
|
|
1534
1534
|
onCommit: (f) => ct(e.id, f)
|
|
@@ -1537,7 +1537,7 @@ function Ca({
|
|
|
1537
1537
|
)
|
|
1538
1538
|
] }),
|
|
1539
1539
|
/* @__PURE__ */ d("div", { className: "flex flex-col gap-1.5", children: [
|
|
1540
|
-
/* @__PURE__ */ t(
|
|
1540
|
+
/* @__PURE__ */ t(K, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Initial value" }),
|
|
1541
1541
|
/* @__PURE__ */ d(
|
|
1542
1542
|
xe,
|
|
1543
1543
|
{
|
|
@@ -1562,7 +1562,7 @@ function Ca({
|
|
|
1562
1562
|
] })
|
|
1563
1563
|
] }),
|
|
1564
1564
|
/* @__PURE__ */ t(
|
|
1565
|
-
|
|
1565
|
+
Yt,
|
|
1566
1566
|
{
|
|
1567
1567
|
control: e,
|
|
1568
1568
|
onChange: (f) => W(e.id, () => f)
|
|
@@ -1586,7 +1586,7 @@ function Ca({
|
|
|
1586
1586
|
size: "xs",
|
|
1587
1587
|
onClick: pt,
|
|
1588
1588
|
children: [
|
|
1589
|
-
/* @__PURE__ */ t(
|
|
1589
|
+
/* @__PURE__ */ t(Gt, { className: "h-3.5 w-3.5" }),
|
|
1590
1590
|
"Add control"
|
|
1591
1591
|
]
|
|
1592
1592
|
}
|
|
@@ -1630,7 +1630,7 @@ function ka(s) {
|
|
|
1630
1630
|
export {
|
|
1631
1631
|
ua as C,
|
|
1632
1632
|
ba as E,
|
|
1633
|
-
|
|
1633
|
+
Zt as L,
|
|
1634
1634
|
pa as R,
|
|
1635
1635
|
ma as S,
|
|
1636
1636
|
ha as V,
|