react-semaphor 0.1.544 → 0.1.545
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/analytics-protocol/index.js +35 -34
- package/dist/assistant-context/index.js +1 -1
- package/dist/brand-studio/index.js +2 -2
- package/dist/briefings/index.js +50 -47
- package/dist/chunks/{class-utils-Df1OVOT1.js → _commonjsHelpers-DimLPMtv.js} +124 -98
- package/dist/chunks/{apply-dashboard-operations-Bz4n1Lq6.js → apply-dashboard-operations-CZEMsx8E.js} +778 -958
- package/dist/chunks/{assistant-chat-BNLkCDml.js → assistant-chat-D7sWTypJ.js} +308 -309
- package/dist/chunks/calendar-day-equality-dvoQp1xW.js +410 -0
- package/dist/chunks/{comparison-window-caption-BTkrN3W4.js → comparison-window-caption-D4E6IHPD.js} +56 -55
- package/dist/chunks/{custom-visual-inputs-DUtpYZOk.js → custom-visual-inputs-DLCD9Y5V.js} +8 -2
- package/dist/chunks/{dashboard-g5a4DKWq.js → dashboard-B1tMju0u.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-DQ_8O_e2.js → dashboard-briefing-launcher-CePgIu0Z.js} +771 -776
- package/dist/chunks/{dashboard-controls-8RyBTQUO.js → dashboard-controls-Cq05n3e0.js} +28 -28
- package/dist/chunks/{dashboard-json-7qT9jmfL.js → dashboard-json-CoYRPqxx.js} +3 -3
- package/dist/chunks/document-dashboard-inputs-BesAHZvB.js +3112 -0
- package/dist/chunks/{edit-dashboard-visual-BfJwnRIZ.js → edit-dashboard-visual-JPtNfJRb.js} +5624 -5615
- package/dist/chunks/{filter-value-text-CYsVYPuD.js → filter-value-text-ff7osJr7.js} +1 -1
- package/dist/chunks/{index-DkAyQvC6.js → index-DRWiuqyd.js} +378 -333
- package/dist/chunks/{matrix-formatter-CxJLkztA.js → matrix-formatter-DnCyRXJE.js} +13 -13
- package/dist/chunks/{numeric-presentation-DESvLiu9.js → numeric-presentation-7X_IrD58.js} +2571 -2572
- package/dist/chunks/{raw-temporal-presentation-CLiVi90c.js → raw-temporal-presentation-C3mUgnEx.js} +1 -1
- package/dist/chunks/{zoned-wall-clock-MulfA26h.js → relative-date-label-Bk2j94pA.js} +21 -64
- package/dist/chunks/rendered-file-D8xEuVVx.js +108 -0
- package/dist/chunks/{report-preferences-dialog-Df7VpRVW.js → report-preferences-dialog-DUtuUL_5.js} +631 -603
- package/dist/chunks/resolve-dashboard-input-context-DJ2tICwz.js +9415 -0
- package/dist/chunks/{saved-dashboard-context-B-mQ--nV.js → saved-dashboard-context-LrF_kW0l.js} +183 -211
- package/dist/chunks/selection-filter-compiler-BKXmyLrS.js +79 -0
- package/dist/chunks/{semaphor-ready-indicator-DDAxk8us.js → semaphor-ready-indicator-BxF96Yhv.js} +45764 -46519
- package/dist/chunks/{shelf-drop-preview-context-BSRPwaED.js → shelf-drop-preview-context-CNaM_Gmh.js} +885 -866
- package/dist/chunks/{switch-C3jLxlG0.js → switch-uDtPgQlQ.js} +44 -45
- package/dist/chunks/{table-export-sheet-CPfGAQ9X.js → table-export-sheet-YzMioA7Y.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-BxzFviM-.js → use-create-flow-overlay-state-CjB7ig1o.js} +105 -105
- package/dist/chunks/zoned-wall-clock-BkxV9jS2.js +46 -0
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.js +556 -544
- package/dist/data-app-sdk/index.js +1 -1
- package/dist/format-utils/index.js +163 -152
- package/dist/index.js +351 -323
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +1 -1
- package/dist/types/briefings/attachment-outcomes.d.ts +1 -1
- package/dist/types/briefings/attachments.d.ts +33 -6
- package/dist/types/briefings/index.d.ts +6 -5
- package/dist/types/components/surfboard/filter/types.d.ts +0 -14
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-authoring.d.ts +68 -82
- package/dist/types/lib/dashboard-inputs/dashboard-input-target-context.d.ts +0 -8
- package/dist/types/lib/dashboard-inputs/dashboard-input-values.d.ts +35 -1
- package/dist/types/lib/dashboard-inputs/filter-settings.d.ts +199 -0
- package/dist/types/lib/dashboard-inputs/resolve-dashboard-input-context.d.ts +7 -2
- package/dist/types/lib/dashboard-inputs/resolve-selection-input.d.ts +1 -1
- package/dist/types/lib/dashboard-viewer/captured-runtime-values.d.ts +40 -0
- package/dist/types/lib/dashboard-viewer/compatibility-input-storage.d.ts +16 -16
- package/dist/types/lib/dashboard-viewer/viewer-state.d.ts +11 -9
- package/dist/types/lib/download-pdf.d.ts +75 -1
- package/dist/types/lib/hooks/use-date-filter.d.ts +5 -0
- package/dist/types/lib/hooks/use-text-filter.d.ts +5 -0
- package/dist/types/lib/matrix-table/matrix-delivery-policy.d.ts +5 -4
- package/dist/types/lib/query-context/assemble-card-query.d.ts +158 -0
- package/dist/types/lib/query-context/build-card-query-context.d.ts +3 -3
- package/dist/types/lib/query-context/build-dashboard-card-query-contract.d.ts +15 -6
- package/dist/types/lib/query-context/build-dashboard-execution-snapshot.d.ts +11 -13
- package/dist/types/lib/query-context/compile-dashboard-card-filters.d.ts +22 -12
- package/dist/types/lib/stores/dashboard-store.d.ts +39 -55
- package/dist/types/lib/stores/editor-store.d.ts +0 -3
- package/dist/types/lib/types/common-types.d.ts +21 -6
- package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +4 -11
- package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +12 -12
- package/dist/types/shared/dashboard-authoring/dashboard-filter-mapping-contract.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/dashboard-input-scope.d.ts +92 -0
- package/dist/types/shared/dashboard-authoring/filter-model/ad-hoc-filter-values.d.ts +10 -0
- package/dist/types/shared/dashboard-authoring/filter-model/filter-definitions.d.ts +29 -0
- package/dist/types/shared/dashboard-authoring/filter-model/filter-values.d.ts +58 -0
- package/dist/types/shared/dashboard-authoring/filter-model/index.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/filter-model/prototype-document-inputs.d.ts +15 -0
- package/dist/types/shared/dashboard-authoring/filter-model/read-dashboard-filter-model.d.ts +78 -0
- package/dist/types/shared/dashboard-authoring/filter-model/stored-dashboard.d.ts +18 -0
- package/dist/types/shared/dashboard-authoring/filter-model/toolbar-filter-reach.d.ts +23 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +2 -0
- package/dist/types/shared/format-utils/exporters/index.d.ts +2 -0
- package/dist/types/shared/format-utils/exporters/rendered-file.d.ts +106 -0
- package/package.json +2 -2
- package/dist/chunks/_commonjsHelpers-BkfeUUK-.js +0 -28
- package/dist/chunks/calendar-day-equality-BmJAWduY.js +0 -460
- package/dist/chunks/document-dashboard-inputs-BC6p-ESg.js +0 -8087
- package/dist/chunks/document-sheet-utils-Duo9uLoH.js +0 -3619
- package/dist/chunks/sort-target-MT1WK1vX.js +0 -29
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-storage-transition.d.ts +0 -88
- package/dist/types/lib/dashboard-inputs/dashboard-input-scope.d.ts +0 -10
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { c as fe, C as Se } from "./x-4f5U2XwU.js";
|
|
2
|
-
import { useEffect as K, forwardRef as nt, useMemo as
|
|
3
|
-
import {
|
|
4
|
-
import { jsx as t, jsxs as o, Fragment as
|
|
2
|
+
import { useEffect as K, forwardRef as nt, useMemo as Y, useState as z, useRef as ne, useCallback as A, Fragment as st } from "react";
|
|
3
|
+
import { $ as qe, a0 as ot, aG as dt, u as it, i as ct, aH as ut, aI as mt, aJ as De, aK as pt, aL as ft, aM as Me, aN as ze, aO as ht, aP as gt, aQ as bt, aR as xt, aS as vt, aT as yt, aU as Ct } from "./semaphor-ready-indicator-BxF96Yhv.js";
|
|
4
|
+
import { jsx as t, jsxs as o, Fragment as G } from "react/jsx-runtime";
|
|
5
5
|
import "./index-CuHybtft.js";
|
|
6
6
|
import "./validators-DMHTpf7a.js";
|
|
7
7
|
import "./matrix-operation-contract-8OIO4gob.js";
|
|
8
8
|
import "./analytics-base-schemas-BFAoRlkU.js";
|
|
9
9
|
import "zod";
|
|
10
10
|
import "../value-format-preferences/index.js";
|
|
11
|
-
import { c as R } from "./
|
|
12
|
-
import { m as Re, n as je, o as Be, p as $e, x as Qe, B as E, l as M, q as Ue, r as se, s as oe, t as de, u as ie, v as ce } from "./switch-
|
|
13
|
-
import {
|
|
11
|
+
import { c as R } from "./_commonjsHelpers-DimLPMtv.js";
|
|
12
|
+
import { m as Re, n as je, o as Be, p as $e, x as Qe, B as E, l as M, q as Ue, r as se, s as oe, t as de, u as ie, v as ce } from "./switch-uDtPgQlQ.js";
|
|
13
|
+
import { ar as kt, as as Nt, at as J, au as we, av as Te, aw as ue, ax as me, ay as St, az as Dt, aA as _e, aB as wt, aC as Tt, aD as X, aE as _t, aF as Le, aG as He, aH as Ye, aI as Ge, aJ as Je, aK as Lt, aL as Vt, aM as Ve, aN as Et, aO as Ee, aP as It, aQ as At, aR as Ft, aS as Ot, aT as pe } from "./resolve-dashboard-input-context-DJ2tICwz.js";
|
|
14
14
|
import { C as Ie } from "./selection-reducer-Dj_8xD69.js";
|
|
15
15
|
/**
|
|
16
16
|
* @license lucide-react v0.453.0 - ISC
|
|
@@ -190,7 +190,7 @@ const zt = nt(
|
|
|
190
190
|
] }) })
|
|
191
191
|
);
|
|
192
192
|
zt.displayName = "IconButton";
|
|
193
|
-
function
|
|
193
|
+
function Xe(s) {
|
|
194
194
|
const { control: n, onChange: u } = s;
|
|
195
195
|
return /* @__PURE__ */ o("div", { className: "flex flex-col gap-1.5", children: [
|
|
196
196
|
/* @__PURE__ */ t(M, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Label" }),
|
|
@@ -242,7 +242,7 @@ function Rt(s) {
|
|
|
242
242
|
] }, i);
|
|
243
243
|
}) }) });
|
|
244
244
|
}
|
|
245
|
-
function
|
|
245
|
+
function W(s) {
|
|
246
246
|
const { secondary: n, tertiary: u, primary: i } = s;
|
|
247
247
|
return /* @__PURE__ */ o("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: [
|
|
248
248
|
n,
|
|
@@ -257,19 +257,19 @@ function jt(s) {
|
|
|
257
257
|
/* @__PURE__ */ o("div", { className: "min-w-0 space-y-0.5", children: [
|
|
258
258
|
/* @__PURE__ */ t("div", { className: "text-[13px] font-medium text-foreground", children: n.label }),
|
|
259
259
|
/* @__PURE__ */ o("div", { className: "text-[12px] text-muted-foreground", children: [
|
|
260
|
-
|
|
260
|
+
He(n.type).label,
|
|
261
261
|
" ·",
|
|
262
262
|
" ",
|
|
263
|
-
|
|
263
|
+
Ge(n),
|
|
264
264
|
" ·",
|
|
265
265
|
" ",
|
|
266
|
-
|
|
266
|
+
Ye(u, n.placement)
|
|
267
267
|
] }),
|
|
268
268
|
i ? /* @__PURE__ */ t("div", { className: "text-[12px] text-muted-foreground", children: i }) : null
|
|
269
269
|
] })
|
|
270
270
|
] });
|
|
271
271
|
}
|
|
272
|
-
function
|
|
272
|
+
function Ae(s) {
|
|
273
273
|
const {
|
|
274
274
|
control: n,
|
|
275
275
|
defaultValue: u,
|
|
@@ -285,7 +285,7 @@ function Fe(s) {
|
|
|
285
285
|
nextDisabled: S
|
|
286
286
|
} = s;
|
|
287
287
|
return /* @__PURE__ */ o("div", { className: "space-y-3", children: [
|
|
288
|
-
/* @__PURE__ */ t(
|
|
288
|
+
/* @__PURE__ */ t(Xe, { control: n, onChange: p }),
|
|
289
289
|
/* @__PURE__ */ t(
|
|
290
290
|
Me,
|
|
291
291
|
{
|
|
@@ -312,7 +312,7 @@ function Fe(s) {
|
|
|
312
312
|
}
|
|
313
313
|
),
|
|
314
314
|
/* @__PURE__ */ t(
|
|
315
|
-
|
|
315
|
+
W,
|
|
316
316
|
{
|
|
317
317
|
secondary: /* @__PURE__ */ t(E, { type: "button", variant: "outline", size: "xs", onClick: x, children: "Back" }),
|
|
318
318
|
primary: /* @__PURE__ */ t(
|
|
@@ -335,7 +335,7 @@ const Bt = /* @__PURE__ */ new Set([
|
|
|
335
335
|
"field_selector",
|
|
336
336
|
"metric_selector"
|
|
337
337
|
]);
|
|
338
|
-
function
|
|
338
|
+
function Fe(s) {
|
|
339
339
|
const { text: n, ariaLabel: u } = s, [i, k] = z(!1);
|
|
340
340
|
return /* @__PURE__ */ o(
|
|
341
341
|
"button",
|
|
@@ -357,7 +357,7 @@ function Oe(s) {
|
|
|
357
357
|
}
|
|
358
358
|
);
|
|
359
359
|
}
|
|
360
|
-
function
|
|
360
|
+
function Oe(s) {
|
|
361
361
|
const {
|
|
362
362
|
control: n,
|
|
363
363
|
scope: u,
|
|
@@ -388,14 +388,14 @@ function Ae(s) {
|
|
|
388
388
|
/* @__PURE__ */ o("div", { className: "space-y-1.5 px-3 py-2.5", children: [
|
|
389
389
|
/* @__PURE__ */ t("p", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "SQL cards" }),
|
|
390
390
|
/* @__PURE__ */ t(
|
|
391
|
-
|
|
391
|
+
Fe,
|
|
392
392
|
{
|
|
393
393
|
text: i,
|
|
394
394
|
ariaLabel: "Copy SQL control reference"
|
|
395
395
|
}
|
|
396
396
|
),
|
|
397
397
|
S ? /* @__PURE__ */ t(
|
|
398
|
-
|
|
398
|
+
Fe,
|
|
399
399
|
{
|
|
400
400
|
text: S,
|
|
401
401
|
ariaLabel: "Copy Jinja control reference"
|
|
@@ -420,7 +420,7 @@ function Ae(s) {
|
|
|
420
420
|
] })
|
|
421
421
|
] }),
|
|
422
422
|
/* @__PURE__ */ t(
|
|
423
|
-
|
|
423
|
+
W,
|
|
424
424
|
{
|
|
425
425
|
secondary: /* @__PURE__ */ t(E, { type: "button", variant: "outline", size: "xs", onClick: v, children: "Back" }),
|
|
426
426
|
tertiary: /* @__PURE__ */ t(E, { type: "button", variant: "outline", size: "xs", onClick: p, children: "Cancel" }),
|
|
@@ -430,7 +430,7 @@ function Ae(s) {
|
|
|
430
430
|
] });
|
|
431
431
|
}
|
|
432
432
|
function $t(s) {
|
|
433
|
-
const n =
|
|
433
|
+
const n = J(
|
|
434
434
|
s.scope,
|
|
435
435
|
s.existingControls,
|
|
436
436
|
s.reservedIds
|
|
@@ -438,7 +438,7 @@ function $t(s) {
|
|
|
438
438
|
...n,
|
|
439
439
|
label: pe[s.type]
|
|
440
440
|
} : {
|
|
441
|
-
...
|
|
441
|
+
...Je({
|
|
442
442
|
controls: [
|
|
443
443
|
{
|
|
444
444
|
...n,
|
|
@@ -453,7 +453,7 @@ function $t(s) {
|
|
|
453
453
|
return {
|
|
454
454
|
step: 2,
|
|
455
455
|
control: u,
|
|
456
|
-
defaultValue:
|
|
456
|
+
defaultValue: X(u, void 0)
|
|
457
457
|
};
|
|
458
458
|
}
|
|
459
459
|
function sa({
|
|
@@ -474,25 +474,25 @@ function sa({
|
|
|
474
474
|
onCreateFlowActiveChange: _,
|
|
475
475
|
onCreateFlowComplete: I
|
|
476
476
|
}) {
|
|
477
|
-
const
|
|
477
|
+
const F = Y(
|
|
478
478
|
() => new Set(u || []),
|
|
479
479
|
[u]
|
|
480
|
-
), Ke =
|
|
480
|
+
), Ke = Lt(s), We = Nt(s), [he, Z] = z(
|
|
481
481
|
null
|
|
482
|
-
), [
|
|
482
|
+
), [Ze, Q] = z(
|
|
483
483
|
null
|
|
484
484
|
), [a, D] = z(
|
|
485
485
|
() => g ? {
|
|
486
486
|
step: 1,
|
|
487
|
-
control:
|
|
487
|
+
control: J(s, n, Array.from(F))
|
|
488
488
|
} : null
|
|
489
|
-
), U = ne({}), j = ne(void 0), ge = ne(g), be =
|
|
489
|
+
), U = ne({}), j = ne(void 0), ge = ne(g), be = Y(() => {
|
|
490
490
|
const e = we({ scope: s, card: S });
|
|
491
491
|
if (!T)
|
|
492
492
|
return e;
|
|
493
493
|
const l = new Set(T);
|
|
494
494
|
return e.filter((r) => l.has(r.value));
|
|
495
|
-
}, [T, S, s]), Pe =
|
|
495
|
+
}, [T, S, s]), Pe = A(
|
|
496
496
|
(e) => {
|
|
497
497
|
const l = we({
|
|
498
498
|
scope: s,
|
|
@@ -505,22 +505,22 @@ function sa({
|
|
|
505
505
|
return l.filter((d) => r.has(d.value));
|
|
506
506
|
},
|
|
507
507
|
[T, S, s]
|
|
508
|
-
),
|
|
508
|
+
), V = A(
|
|
509
509
|
(e) => s === "dashboard" && (e === "field_selector" || e === "metric_selector"),
|
|
510
510
|
[s]
|
|
511
|
-
), P =
|
|
511
|
+
), P = Y(
|
|
512
512
|
() => a ? Te(
|
|
513
513
|
x || [],
|
|
514
514
|
a.control.type
|
|
515
515
|
) : [],
|
|
516
516
|
[a, x]
|
|
517
|
-
),
|
|
517
|
+
), H = Y(() => {
|
|
518
518
|
if (!a)
|
|
519
519
|
return {
|
|
520
520
|
fields: p || [],
|
|
521
521
|
metrics: N || []
|
|
522
522
|
};
|
|
523
|
-
if (!
|
|
523
|
+
if (!V(a.control.type))
|
|
524
524
|
return {
|
|
525
525
|
fields: p || [],
|
|
526
526
|
metrics: N || []
|
|
@@ -544,7 +544,7 @@ function sa({
|
|
|
544
544
|
p,
|
|
545
545
|
N,
|
|
546
546
|
a,
|
|
547
|
-
|
|
547
|
+
V,
|
|
548
548
|
x
|
|
549
549
|
]);
|
|
550
550
|
K(() => {
|
|
@@ -553,11 +553,11 @@ function sa({
|
|
|
553
553
|
const e = g && !ge.current;
|
|
554
554
|
ge.current = g, e && (D({
|
|
555
555
|
step: 1,
|
|
556
|
-
control:
|
|
557
|
-
}), Q(null),
|
|
558
|
-
}, [n, g,
|
|
556
|
+
control: J(s, n, Array.from(F))
|
|
557
|
+
}), Q(null), Z(null));
|
|
558
|
+
}, [n, g, F, s]);
|
|
559
559
|
const et = (e) => {
|
|
560
|
-
if (!
|
|
560
|
+
if (!V(e.type))
|
|
561
561
|
return {
|
|
562
562
|
fields: p || [],
|
|
563
563
|
metrics: N || []
|
|
@@ -584,7 +584,7 @@ function sa({
|
|
|
584
584
|
})) : []
|
|
585
585
|
};
|
|
586
586
|
}, ee = (e) => {
|
|
587
|
-
if (!
|
|
587
|
+
if (!V(e.control.type))
|
|
588
588
|
return {
|
|
589
589
|
nextControl: e.control,
|
|
590
590
|
cardBindingsById: void 0
|
|
@@ -593,7 +593,7 @@ function sa({
|
|
|
593
593
|
controlType: e.control.type,
|
|
594
594
|
participants: x || [],
|
|
595
595
|
selectedCardIds: e.nextSelectedCardIds
|
|
596
|
-
}), d =
|
|
596
|
+
}), d = Ft({
|
|
597
597
|
control: e.control,
|
|
598
598
|
choices: r.choices
|
|
599
599
|
}), m = Object.fromEntries(
|
|
@@ -611,7 +611,7 @@ function sa({
|
|
|
611
611
|
nextControl: d,
|
|
612
612
|
cardBindingsById: m
|
|
613
613
|
};
|
|
614
|
-
},
|
|
614
|
+
}, L = A(
|
|
615
615
|
(e, l = i, r = { type: "update" }) => {
|
|
616
616
|
const d = e.map((m) => (me({
|
|
617
617
|
control: m,
|
|
@@ -637,9 +637,9 @@ function sa({
|
|
|
637
637
|
nextSelectedCardIds: C
|
|
638
638
|
});
|
|
639
639
|
d = d.map(
|
|
640
|
-
(
|
|
640
|
+
(O) => O.id === e ? q.nextControl : O
|
|
641
641
|
), h = q.cardBindingsById, c = [m.id];
|
|
642
|
-
} else if (r && (!m || !
|
|
642
|
+
} else if (r && (!m || !At(m.type)) && s === "dashboard" && (r.type === "field_selector" || r.type === "metric_selector")) {
|
|
643
643
|
const C = (f == null ? void 0 : f[r.id]) || [];
|
|
644
644
|
h = Object.fromEntries(
|
|
645
645
|
C.map((q) => [q, void 0])
|
|
@@ -655,16 +655,16 @@ function sa({
|
|
|
655
655
|
defaultValues: i
|
|
656
656
|
});
|
|
657
657
|
r.source.kind === "manual" && y.source.kind === "sql_query" && (U.current[e] = C);
|
|
658
|
-
const q = C === void 0 && r.source.kind === "sql_query" && y.source.kind === "manual" ? U.current[e] : C,
|
|
658
|
+
const q = C === void 0 && r.source.kind === "sql_query" && y.source.kind === "manual" ? U.current[e] : C, O = Ve({
|
|
659
659
|
previousControl: r,
|
|
660
660
|
nextControl: y,
|
|
661
661
|
currentDefaultValue: q
|
|
662
662
|
});
|
|
663
|
-
y.source.kind === "manual" && (U.current[e] =
|
|
664
|
-
(Ne) => Ne.id === e ? { ...y, defaultValue:
|
|
663
|
+
y.source.kind === "manual" && (U.current[e] = O), i && (w = { ...i }, O === void 0 ? delete w[e] : w[e] = O), d = d.map(
|
|
664
|
+
(Ne) => Ne.id === e ? { ...y, defaultValue: O } : Ne
|
|
665
665
|
);
|
|
666
666
|
}
|
|
667
|
-
|
|
667
|
+
L(d, w, {
|
|
668
668
|
type: "update",
|
|
669
669
|
cardBindingsById: h,
|
|
670
670
|
affectedBindingControlIds: c
|
|
@@ -672,8 +672,8 @@ function sa({
|
|
|
672
672
|
}, tt = (e, l) => {
|
|
673
673
|
if (!l.trim())
|
|
674
674
|
return;
|
|
675
|
-
const r =
|
|
676
|
-
if (r === e ||
|
|
675
|
+
const r = Ot(l);
|
|
676
|
+
if (r === e || F.has(r) || n.some(
|
|
677
677
|
(h) => h.id === r && h.id !== e
|
|
678
678
|
))
|
|
679
679
|
return;
|
|
@@ -681,7 +681,7 @@ function sa({
|
|
|
681
681
|
(h) => h.id === e ? { ...h, id: r } : h
|
|
682
682
|
);
|
|
683
683
|
if (!i) {
|
|
684
|
-
|
|
684
|
+
L(d, void 0, {
|
|
685
685
|
type: "rename",
|
|
686
686
|
oldId: e,
|
|
687
687
|
newId: r
|
|
@@ -689,7 +689,7 @@ function sa({
|
|
|
689
689
|
return;
|
|
690
690
|
}
|
|
691
691
|
const m = { ...i };
|
|
692
|
-
Object.prototype.hasOwnProperty.call(m, e) && (m[r] = m[e], delete m[e]),
|
|
692
|
+
Object.prototype.hasOwnProperty.call(m, e) && (m[r] = m[e], delete m[e]), L(d, m, {
|
|
693
693
|
type: "rename",
|
|
694
694
|
oldId: e,
|
|
695
695
|
newId: r
|
|
@@ -697,22 +697,22 @@ function sa({
|
|
|
697
697
|
}, at = (e) => {
|
|
698
698
|
const l = n.filter((d) => d.id !== e);
|
|
699
699
|
if (!i) {
|
|
700
|
-
|
|
700
|
+
L(l, void 0, { type: "remove", controlId: e });
|
|
701
701
|
return;
|
|
702
702
|
}
|
|
703
703
|
const r = { ...i };
|
|
704
|
-
delete r[e],
|
|
705
|
-
}, rt =
|
|
704
|
+
delete r[e], L(l, r, { type: "remove", controlId: e });
|
|
705
|
+
}, rt = A(() => {
|
|
706
706
|
j.current = void 0, D({
|
|
707
707
|
step: 1,
|
|
708
|
-
control:
|
|
709
|
-
}), Q(null),
|
|
710
|
-
}, [n,
|
|
708
|
+
control: J(s, n, Array.from(F))
|
|
709
|
+
}), Q(null), Z(null);
|
|
710
|
+
}, [n, F, s]), $ = (e) => {
|
|
711
711
|
D(
|
|
712
712
|
(l) => l && (() => {
|
|
713
713
|
const r = e(l.control);
|
|
714
714
|
l.control.source.kind === "manual" && r.source.kind === "sql_query" && (j.current = l.defaultValue);
|
|
715
|
-
const d = l.defaultValue === void 0 && l.control.source.kind === "sql_query" && r.source.kind === "manual" ? j.current : l.defaultValue, m =
|
|
715
|
+
const d = l.defaultValue === void 0 && l.control.source.kind === "sql_query" && r.source.kind === "manual" ? j.current : l.defaultValue, m = Ve({
|
|
716
716
|
previousControl: l.control,
|
|
717
717
|
nextControl: r,
|
|
718
718
|
currentDefaultValue: d
|
|
@@ -734,7 +734,7 @@ function sa({
|
|
|
734
734
|
}, te = (() => {
|
|
735
735
|
if (!a)
|
|
736
736
|
return !1;
|
|
737
|
-
if (a.step === 2 &&
|
|
737
|
+
if (a.step === 2 && V(a.control.type))
|
|
738
738
|
return (a.selectedCardIds || []).length > 0 && Dt({
|
|
739
739
|
participants: x || [],
|
|
740
740
|
selectedCardIds: a.selectedCardIds || [],
|
|
@@ -753,7 +753,7 @@ function sa({
|
|
|
753
753
|
return r.trim().length > 0 && d.trim().length > 0 && m.trim().length > 0;
|
|
754
754
|
}
|
|
755
755
|
return Tt(
|
|
756
|
-
|
|
756
|
+
X(l, a.defaultValue)
|
|
757
757
|
);
|
|
758
758
|
})(), ve = () => {
|
|
759
759
|
var h;
|
|
@@ -763,7 +763,7 @@ function sa({
|
|
|
763
763
|
label: e.label,
|
|
764
764
|
fallbackId: e.id,
|
|
765
765
|
existingControls: n,
|
|
766
|
-
reservedIds: Array.from(
|
|
766
|
+
reservedIds: Array.from(F)
|
|
767
767
|
}), r = {
|
|
768
768
|
...e,
|
|
769
769
|
id: l
|
|
@@ -772,7 +772,7 @@ function sa({
|
|
|
772
772
|
participants: x || [],
|
|
773
773
|
selectedCardIds: a.selectedCardIds,
|
|
774
774
|
matrixTargetIds: a.matrixTargetIds
|
|
775
|
-
}) : void 0, m =
|
|
775
|
+
}) : void 0, m = X(
|
|
776
776
|
r,
|
|
777
777
|
a.defaultValue
|
|
778
778
|
);
|
|
@@ -785,20 +785,20 @@ function sa({
|
|
|
785
785
|
matrixTargetIds: a.matrixTargetIds,
|
|
786
786
|
cardBindingsById: d
|
|
787
787
|
});
|
|
788
|
-
}, ae =
|
|
788
|
+
}, ae = A(() => {
|
|
789
789
|
D(null);
|
|
790
|
-
}, []), ye =
|
|
790
|
+
}, []), ye = A(() => {
|
|
791
791
|
if (!(a != null && a.createdControlId)) {
|
|
792
792
|
D(null);
|
|
793
793
|
return;
|
|
794
794
|
}
|
|
795
|
-
const e = a.control, l = a.createdControlId, r =
|
|
795
|
+
const e = a.control, l = a.createdControlId, r = X(
|
|
796
796
|
e,
|
|
797
797
|
a.defaultValue
|
|
798
798
|
);
|
|
799
799
|
if (i) {
|
|
800
800
|
const d = { ...i };
|
|
801
|
-
r === void 0 ? delete d[l] : d[l] = r,
|
|
801
|
+
r === void 0 ? delete d[l] : d[l] = r, L(
|
|
802
802
|
[
|
|
803
803
|
...n,
|
|
804
804
|
{
|
|
@@ -813,7 +813,7 @@ function sa({
|
|
|
813
813
|
}
|
|
814
814
|
);
|
|
815
815
|
} else
|
|
816
|
-
|
|
816
|
+
L(
|
|
817
817
|
[
|
|
818
818
|
...n,
|
|
819
819
|
{
|
|
@@ -828,10 +828,10 @@ function sa({
|
|
|
828
828
|
}
|
|
829
829
|
);
|
|
830
830
|
Q(l), D(null), I == null || I();
|
|
831
|
-
}, [n, a, i,
|
|
831
|
+
}, [n, a, i, L, I]), lt = a ? V(a.control.type) ? ["Choose type", "Select cards", "Configure", "Finish"] : ["Choose type", "Configure", "Finish"] : [], Ce = a != null && a.createdControlId ? `[[param.${a.createdControlId}]]` : a ? `[[param.${_t(a.control.label) || a.control.id}]]` : "", re = Le({
|
|
832
832
|
controls: n,
|
|
833
833
|
defaultValues: i
|
|
834
|
-
}), le = a ? [...n, a.control] : n, ke = a ?
|
|
834
|
+
}), le = a ? [...n, a.control] : n, ke = a ? Le({
|
|
835
835
|
controls: le,
|
|
836
836
|
defaultValues: i,
|
|
837
837
|
overrides: [
|
|
@@ -874,7 +874,7 @@ function sa({
|
|
|
874
874
|
$t({
|
|
875
875
|
scope: s,
|
|
876
876
|
existingControls: n,
|
|
877
|
-
reservedIds: Array.from(
|
|
877
|
+
reservedIds: Array.from(F),
|
|
878
878
|
type: h.value
|
|
879
879
|
})
|
|
880
880
|
),
|
|
@@ -896,7 +896,7 @@ function sa({
|
|
|
896
896
|
/* @__PURE__ */ t("div", { className: "grid gap-1.5 sm:grid-cols-2", children: d.map(m) })
|
|
897
897
|
] }),
|
|
898
898
|
/* @__PURE__ */ t(
|
|
899
|
-
|
|
899
|
+
W,
|
|
900
900
|
{
|
|
901
901
|
secondary: /* @__PURE__ */ t(
|
|
902
902
|
E,
|
|
@@ -912,10 +912,10 @@ function sa({
|
|
|
912
912
|
)
|
|
913
913
|
] });
|
|
914
914
|
})(),
|
|
915
|
-
a.step === 2 &&
|
|
915
|
+
a.step === 2 && V(a.control.type) && /* @__PURE__ */ o("div", { className: "space-y-3", children: [
|
|
916
916
|
/* @__PURE__ */ o("div", { className: "space-y-3", children: [
|
|
917
917
|
/* @__PURE__ */ t(
|
|
918
|
-
|
|
918
|
+
Xe,
|
|
919
919
|
{
|
|
920
920
|
control: a.control,
|
|
921
921
|
onChange: (e) => $((l) => ({
|
|
@@ -970,7 +970,7 @@ function sa({
|
|
|
970
970
|
}
|
|
971
971
|
),
|
|
972
972
|
/* @__PURE__ */ t(
|
|
973
|
-
|
|
973
|
+
W,
|
|
974
974
|
{
|
|
975
975
|
secondary: /* @__PURE__ */ t(
|
|
976
976
|
E,
|
|
@@ -1006,13 +1006,13 @@ function sa({
|
|
|
1006
1006
|
}
|
|
1007
1007
|
)
|
|
1008
1008
|
] }),
|
|
1009
|
-
a.step === 2 && !
|
|
1010
|
-
|
|
1009
|
+
a.step === 2 && !V(a.control.type) && /* @__PURE__ */ t(
|
|
1010
|
+
Ae,
|
|
1011
1011
|
{
|
|
1012
1012
|
control: a.control,
|
|
1013
1013
|
defaultValue: a.defaultValue,
|
|
1014
|
-
availableFieldChoices:
|
|
1015
|
-
availableMetricChoices:
|
|
1014
|
+
availableFieldChoices: H.fields,
|
|
1015
|
+
availableMetricChoices: H.metrics,
|
|
1016
1016
|
previewControlDefinitions: le,
|
|
1017
1017
|
previewControlValues: ke,
|
|
1018
1018
|
onControlChange: (e) => $(() => e),
|
|
@@ -1031,13 +1031,13 @@ function sa({
|
|
|
1031
1031
|
nextDisabled: !te
|
|
1032
1032
|
}
|
|
1033
1033
|
),
|
|
1034
|
-
a.step === 3 &&
|
|
1035
|
-
|
|
1034
|
+
a.step === 3 && V(a.control.type) && /* @__PURE__ */ t(
|
|
1035
|
+
Ae,
|
|
1036
1036
|
{
|
|
1037
1037
|
control: a.control,
|
|
1038
1038
|
defaultValue: a.defaultValue,
|
|
1039
|
-
availableFieldChoices:
|
|
1040
|
-
availableMetricChoices:
|
|
1039
|
+
availableFieldChoices: H.fields,
|
|
1040
|
+
availableMetricChoices: H.metrics,
|
|
1041
1041
|
previewControlDefinitions: le,
|
|
1042
1042
|
previewControlValues: ke,
|
|
1043
1043
|
onControlChange: (e) => $(() => e),
|
|
@@ -1056,13 +1056,13 @@ function sa({
|
|
|
1056
1056
|
nextDisabled: !te
|
|
1057
1057
|
}
|
|
1058
1058
|
),
|
|
1059
|
-
a.step === 3 && !
|
|
1060
|
-
|
|
1059
|
+
a.step === 3 && !V(a.control.type) && /* @__PURE__ */ t(
|
|
1060
|
+
Oe,
|
|
1061
1061
|
{
|
|
1062
1062
|
control: a.control,
|
|
1063
1063
|
scope: s,
|
|
1064
1064
|
createdReference: Ce,
|
|
1065
|
-
explorerContent: /* @__PURE__ */ o(
|
|
1065
|
+
explorerContent: /* @__PURE__ */ o(G, { children: [
|
|
1066
1066
|
"Open the card and use",
|
|
1067
1067
|
" ",
|
|
1068
1068
|
/* @__PURE__ */ t("span", { className: "font-medium text-foreground", children: "Settings → Controls" }),
|
|
@@ -1080,19 +1080,19 @@ function sa({
|
|
|
1080
1080
|
onDone: ye
|
|
1081
1081
|
}
|
|
1082
1082
|
),
|
|
1083
|
-
a.step === 4 &&
|
|
1084
|
-
|
|
1083
|
+
a.step === 4 && V(a.control.type) && /* @__PURE__ */ t(
|
|
1084
|
+
Oe,
|
|
1085
1085
|
{
|
|
1086
1086
|
control: a.control,
|
|
1087
1087
|
scope: s,
|
|
1088
1088
|
createdReference: Ce,
|
|
1089
|
-
summaryDetail: /* @__PURE__ */ o(
|
|
1089
|
+
summaryDetail: /* @__PURE__ */ o(G, { children: [
|
|
1090
1090
|
"Used by ",
|
|
1091
1091
|
(a.selectedCardIds || []).length,
|
|
1092
1092
|
" selected card",
|
|
1093
1093
|
(a.selectedCardIds || []).length === 1 ? "" : "s"
|
|
1094
1094
|
] }),
|
|
1095
|
-
explorerContent: /* @__PURE__ */ t(
|
|
1095
|
+
explorerContent: /* @__PURE__ */ t(G, { children: "Selected cards have been set up to respond to this control automatically." }),
|
|
1096
1096
|
sqlDescription: "SQL cards can still reference this control directly in the SQL editor.",
|
|
1097
1097
|
onBack: () => D(
|
|
1098
1098
|
(e) => e && {
|
|
@@ -1110,7 +1110,7 @@ function sa({
|
|
|
1110
1110
|
const l = et(e), r = v == null ? void 0 : v[e.id], d = me({
|
|
1111
1111
|
control: e,
|
|
1112
1112
|
defaultValues: i
|
|
1113
|
-
}), m =
|
|
1113
|
+
}), m = Ze === e.id, h = "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";
|
|
1114
1114
|
return /* @__PURE__ */ o(
|
|
1115
1115
|
"div",
|
|
1116
1116
|
{
|
|
@@ -1130,11 +1130,11 @@ function sa({
|
|
|
1130
1130
|
/* @__PURE__ */ o("div", { className: "min-w-0", children: [
|
|
1131
1131
|
/* @__PURE__ */ o("div", { className: "flex flex-wrap items-center gap-1.5", children: [
|
|
1132
1132
|
/* @__PURE__ */ t("span", { className: "truncate text-[13px] font-medium text-foreground", children: e.label || "Untitled control" }),
|
|
1133
|
-
/* @__PURE__ */ t("span", { className: h, children:
|
|
1134
|
-
/* @__PURE__ */ t("span", { className: h, children:
|
|
1133
|
+
/* @__PURE__ */ t("span", { className: h, children: He(e.type).label }),
|
|
1134
|
+
/* @__PURE__ */ t("span", { className: h, children: Ye(s, e.placement) })
|
|
1135
1135
|
] }),
|
|
1136
1136
|
/* @__PURE__ */ o("div", { className: "mt-0.5 text-[12px] text-muted-foreground", children: [
|
|
1137
|
-
|
|
1137
|
+
Ge(e),
|
|
1138
1138
|
r != null && r.status ? ` · ${r.status}` : ""
|
|
1139
1139
|
] })
|
|
1140
1140
|
] })
|
|
@@ -1178,13 +1178,13 @@ function sa({
|
|
|
1178
1178
|
{
|
|
1179
1179
|
value: e.type,
|
|
1180
1180
|
onValueChange: (c) => {
|
|
1181
|
-
const y =
|
|
1181
|
+
const y = Je({
|
|
1182
1182
|
controls: n,
|
|
1183
1183
|
controlId: e.id,
|
|
1184
1184
|
nextType: c,
|
|
1185
1185
|
defaultValues: i
|
|
1186
1186
|
});
|
|
1187
|
-
|
|
1187
|
+
L(y.controls, y.defaultValues);
|
|
1188
1188
|
},
|
|
1189
1189
|
children: [
|
|
1190
1190
|
/* @__PURE__ */ t(oe, { size: "xs", children: /* @__PURE__ */ t(de, {}) }),
|
|
@@ -1207,7 +1207,7 @@ function sa({
|
|
|
1207
1207
|
/* @__PURE__ */ o(
|
|
1208
1208
|
se,
|
|
1209
1209
|
{
|
|
1210
|
-
value: e.placement ||
|
|
1210
|
+
value: e.placement || We,
|
|
1211
1211
|
onValueChange: (c) => B(e.id, (y) => ({
|
|
1212
1212
|
...y,
|
|
1213
1213
|
placement: c
|
|
@@ -1220,7 +1220,7 @@ function sa({
|
|
|
1220
1220
|
)
|
|
1221
1221
|
] })
|
|
1222
1222
|
] }),
|
|
1223
|
-
|
|
1223
|
+
V(e.type) ? /* @__PURE__ */ o(G, { children: [
|
|
1224
1224
|
/* @__PURE__ */ t(
|
|
1225
1225
|
ft,
|
|
1226
1226
|
{
|
|
@@ -1241,7 +1241,7 @@ function sa({
|
|
|
1241
1241
|
}), w = n.map(
|
|
1242
1242
|
(C) => C.id === e.id ? y.nextControl : C
|
|
1243
1243
|
);
|
|
1244
|
-
|
|
1244
|
+
L(w, i, {
|
|
1245
1245
|
type: "update",
|
|
1246
1246
|
cardBindingsById: y.cardBindingsById
|
|
1247
1247
|
});
|
|
@@ -1260,7 +1260,7 @@ function sa({
|
|
|
1260
1260
|
nextSelectedCardIds: (f == null ? void 0 : f[e.id]) || [],
|
|
1261
1261
|
matrixTargetIds: { [c]: y }
|
|
1262
1262
|
});
|
|
1263
|
-
|
|
1263
|
+
L(
|
|
1264
1264
|
n.map((C) => C.id === e.id ? w.nextControl : C),
|
|
1265
1265
|
i,
|
|
1266
1266
|
{ type: "update", cardBindingsById: w.cardBindingsById }
|
|
@@ -1296,10 +1296,10 @@ function sa({
|
|
|
1296
1296
|
);
|
|
1297
1297
|
if (e.source.kind === "manual" && (U.current[e.id] = c), i) {
|
|
1298
1298
|
const w = { ...i };
|
|
1299
|
-
c === void 0 ? delete w[e.id] : w[e.id] = c,
|
|
1299
|
+
c === void 0 ? delete w[e.id] : w[e.id] = c, L(y, w);
|
|
1300
1300
|
return;
|
|
1301
1301
|
}
|
|
1302
|
-
|
|
1302
|
+
L(y, void 0);
|
|
1303
1303
|
}
|
|
1304
1304
|
}
|
|
1305
1305
|
),
|
|
@@ -1307,7 +1307,7 @@ function sa({
|
|
|
1307
1307
|
ht,
|
|
1308
1308
|
{
|
|
1309
1309
|
open: he === e.id,
|
|
1310
|
-
onOpenChange: (c) =>
|
|
1310
|
+
onOpenChange: (c) => Z(c ? e.id : null),
|
|
1311
1311
|
children: [
|
|
1312
1312
|
/* @__PURE__ */ t(gt, { asChild: !0, children: /* @__PURE__ */ o(
|
|
1313
1313
|
E,
|
|
@@ -1347,7 +1347,7 @@ function sa({
|
|
|
1347
1347
|
})),
|
|
1348
1348
|
children: [
|
|
1349
1349
|
/* @__PURE__ */ t(oe, { size: "xs", children: /* @__PURE__ */ t(de, {}) }),
|
|
1350
|
-
/* @__PURE__ */ t(ie, { children:
|
|
1350
|
+
/* @__PURE__ */ t(ie, { children: Vt.map((c) => /* @__PURE__ */ t(
|
|
1351
1351
|
ce,
|
|
1352
1352
|
{
|
|
1353
1353
|
value: c.value,
|
|
@@ -1400,18 +1400,18 @@ function oa(s) {
|
|
|
1400
1400
|
dismissMode: k = "passive"
|
|
1401
1401
|
} = s, b = n !== void 0, [g, v] = z(!1), [p, N] = z(
|
|
1402
1402
|
i
|
|
1403
|
-
), x = b ? n : g, f =
|
|
1403
|
+
), x = b ? n : g, f = A(
|
|
1404
1404
|
(_) => {
|
|
1405
1405
|
!_ && p && k === "passive" || (b || v(_), _ || N(!1), u == null || u(_));
|
|
1406
1406
|
},
|
|
1407
1407
|
[b, p, k, u]
|
|
1408
|
-
), S =
|
|
1408
|
+
), S = A(() => {
|
|
1409
1409
|
b || v(!1), N(!1), u == null || u(!1);
|
|
1410
1410
|
}, [b, u]);
|
|
1411
1411
|
K(() => {
|
|
1412
1412
|
x || N(!1);
|
|
1413
1413
|
}, [x]);
|
|
1414
|
-
const T =
|
|
1414
|
+
const T = A(
|
|
1415
1415
|
(_) => {
|
|
1416
1416
|
p && _.preventDefault();
|
|
1417
1417
|
},
|