react-semaphor 0.1.315 → 0.1.317
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.js +65 -65
- package/dist/briefings/index.cjs +1 -0
- package/dist/briefings/index.js +848 -0
- package/dist/chunks/{braces-CWi8x9ww.js → braces-CDPz6CF2.js} +1 -1
- package/dist/chunks/{calendar-preferences-dialog-aODuCeYE.js → calendar-preferences-dialog-CUWcN-aO.js} +1 -1
- package/dist/chunks/{calendar-preferences-dialog-B3JYKgek.js → calendar-preferences-dialog-DsfRJICT.js} +3 -3
- package/dist/chunks/{chevrons-up-down-B2viXO2I.js → chevrons-up-down-BsdQRmJL.js} +1 -1
- package/dist/chunks/dashboard-briefing-launcher-CvFxCsvU.js +7380 -0
- package/dist/chunks/dashboard-briefing-launcher-DsomUnHQ.js +96 -0
- package/dist/chunks/dashboard-controls-Bvr4skpo.js +2009 -0
- package/dist/chunks/dashboard-controls-kSIXjX4k.js +57 -0
- package/dist/chunks/{dashboard-json-Duea3KSa.js → dashboard-json-4qbAgL-4.js} +1 -1
- package/dist/chunks/{dashboard-json-zKDTezgS.js → dashboard-json-CgAgzcWN.js} +2 -2
- package/dist/chunks/{edit-dashboard-visual-MZCJaPiq.js → edit-dashboard-visual-BgOLgfoq.js} +807 -822
- package/dist/chunks/edit-dashboard-visual-DOTGLbMS.js +178 -0
- package/dist/chunks/{index-CjRLHvSp.js → index-BSexp9WY.js} +41203 -46487
- package/dist/chunks/index-BToywf5X.js +1298 -0
- package/dist/chunks/{palette-CIuwlEiG.js → palette-BlxLchHy.js} +1 -1
- package/dist/chunks/{resource-management-panel-S0LXyguo.js → resource-management-panel-CcSUHqz0.js} +81 -81
- package/dist/chunks/{resource-management-panel-CM3Zsk9H.js → resource-management-panel-hQayeERR.js} +1 -1
- package/dist/chunks/{save-_ALpoMy6.js → save-DVRQBMeb.js} +1 -1
- package/dist/chunks/{switch-B6fh8nb-.js → switch-sauemjyY.js} +199 -199
- package/dist/chunks/{use-create-flow-overlay-state-Cp7PYD-t.js → use-create-flow-overlay-state-CO6FEpZr.js} +254 -225
- package/dist/chunks/use-create-flow-overlay-state-Cqp5Qe-9.js +26 -0
- package/dist/chunks/{use-visual-utils-D9DsvP1v.js → use-visual-utils-DnJdlEV8.js} +48 -48
- package/dist/chunks/{use-visual-utils-DDd0pAJ_.js → use-visual-utils-KIYmxQoV.js} +1 -1
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +232 -485
- 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 +240 -0
- package/dist/types/dashboard.d.ts +1 -0
- package/dist/types/main.d.ts +619 -1017
- package/dist/types/surfboard.d.ts +1 -0
- package/dist/types/types.d.ts +411 -261
- package/package.json +7 -2
- package/dist/chunks/dashboard-controls-CSunAZVx.js +0 -57
- package/dist/chunks/dashboard-controls-jvJF-AJC.js +0 -2021
- package/dist/chunks/dashboard-filter-controls-launcher-B0i9xSZZ.js +0 -11
- package/dist/chunks/dashboard-filter-controls-launcher-DG6yRPmx.js +0 -1540
- package/dist/chunks/edit-dashboard-visual-QjRIAadP.js +0 -183
- package/dist/chunks/index-B7C8qBWC.js +0 -1330
- package/dist/chunks/use-create-flow-overlay-state-CqTBDwBF.js +0 -16
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsxs as d, jsx as r, Fragment as ce } from "react/jsx-runtime";
|
|
2
2
|
import m from "react";
|
|
3
|
-
import { c as $, a as K, P as ge, b as be, B as C, d as fe, U as De, C as Ie, R as me, f as le, X as
|
|
4
|
-
import { r as He, v as
|
|
5
|
-
import { P as W } from "../chunks/palette-
|
|
6
|
-
import { B as Ke } from "../chunks/braces-
|
|
7
|
-
import { S as Qe } from "../chunks/save-
|
|
3
|
+
import { c as $, a as K, P as ge, b as be, B as C, d as fe, U as De, C as Ie, R as me, f as le, X as Je, S as se, e as je, T as Le, J as $e, K as M, M as _e, N as G, O as Ve, Q as Ue, V as Me, W as Ge, L as E, Y as Q, Z as ee, _ as re, $ as he, a0 as oe, a1 as ae, a2 as xe, a3 as ye, a4 as ke, a5 as ve, a6 as Ce, a7 as We } from "../chunks/switch-sauemjyY.js";
|
|
4
|
+
import { r as He, v as Ye, A as Xe, a as Ze, p as qe } from "../chunks/index-CJdxSyQq.js";
|
|
5
|
+
import { P as W } from "../chunks/palette-BlxLchHy.js";
|
|
6
|
+
import { B as Ke } from "../chunks/braces-CDPz6CF2.js";
|
|
7
|
+
import { S as Qe } from "../chunks/save-DVRQBMeb.js";
|
|
8
8
|
/**
|
|
9
9
|
* @license lucide-react v0.453.0 - ISC
|
|
10
10
|
*
|
|
@@ -208,18 +208,18 @@ const ar = $("Pipette", [
|
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
210
|
];
|
|
211
|
-
function
|
|
211
|
+
function j(e) {
|
|
212
212
|
const n = He({
|
|
213
213
|
organizationAppearance: e ?? void 0
|
|
214
214
|
});
|
|
215
|
-
return tr(
|
|
215
|
+
return tr(O(n));
|
|
216
216
|
}
|
|
217
217
|
function L(e) {
|
|
218
|
-
const n =
|
|
219
|
-
version:
|
|
218
|
+
const n = O({
|
|
219
|
+
version: Xe,
|
|
220
220
|
mode: e.mode,
|
|
221
221
|
schemes: e.schemes
|
|
222
|
-
}), t =
|
|
222
|
+
}), t = Ye(n);
|
|
223
223
|
if (!t.success) {
|
|
224
224
|
const u = t.issues[0];
|
|
225
225
|
throw new Error(
|
|
@@ -232,14 +232,14 @@ function nr(e, n) {
|
|
|
232
232
|
const t = Ne.find((c) => c.id === n);
|
|
233
233
|
if (!t)
|
|
234
234
|
return e;
|
|
235
|
-
const u =
|
|
235
|
+
const u = O(e);
|
|
236
236
|
return ue(u.schemes.light, t.light), ue(u.schemes.dark, t.dark), u;
|
|
237
237
|
}
|
|
238
238
|
function ue(e, n) {
|
|
239
239
|
e.tokens.color.background = n.background, e.tokens.color.foreground = n.foreground, e.tokens.color.muted = n.muted, e.tokens.color.mutedForeground = n.mutedForeground, e.tokens.color.border = n.border, e.tokens.color.input = n.border, e.tokens.color.primary = n.primary, e.tokens.color.primaryForeground = n.primaryForeground, e.tokens.color.accent = n.accent, e.tokens.color.accentForeground = n.accentForeground, e.tokens.color.card = n.card, e.tokens.color.cardForeground = n.cardForeground, e.components.dashboard.background = n.background, e.components.dashboard.foreground = n.foreground, e.components.dashboard.borderColor = n.border, e.components.card.background = n.card, e.components.card.foreground = n.cardForeground, e.components.card.borderColor = n.border, e.components.interactive.toolbarBackground = n.background, e.components.interactive.background = n.card, e.components.interactive.foreground = n.foreground, e.components.interactive.borderColor = n.border, e.components.chart.palette = [...n.chartPalette], e.components.chart.background = n.card, e.components.chart.foreground = n.foreground, e.components.chart.gridColor = n.border, e.components.chart.axisColor = n.mutedForeground, e.components.table.container.background = n.card, e.components.table.container.borderColor = n.border, e.components.table.header.background = n.muted, e.components.table.header.foreground = n.mutedForeground, e.components.table.header.dividerColor = n.border, e.components.table.row.dividerColor = n.border, e.components.table.row.zebraBackground = n.muted, e.components.table.pagination.background = n.card, e.components.table.pagination.foreground = n.foreground, e.components.table.pagination.borderColor = n.border, s(e, "aggregateTable"), s(e, "pivotTable");
|
|
240
240
|
}
|
|
241
241
|
function s(e, n) {
|
|
242
|
-
e.components[n] =
|
|
242
|
+
e.components[n] = O(e.components.table);
|
|
243
243
|
}
|
|
244
244
|
function pe(e, n, t) {
|
|
245
245
|
switch (e.tokens.color[n] = t, n) {
|
|
@@ -368,10 +368,10 @@ function tr(e) {
|
|
|
368
368
|
}, c.components.aggregateTable = k ? {
|
|
369
369
|
...B(i, l),
|
|
370
370
|
...k
|
|
371
|
-
} :
|
|
371
|
+
} : O(c.components.table), c.components.pivotTable = y ? {
|
|
372
372
|
...B(i, l),
|
|
373
373
|
...y
|
|
374
|
-
} :
|
|
374
|
+
} : O(c.components.table);
|
|
375
375
|
}
|
|
376
376
|
return e;
|
|
377
377
|
}
|
|
@@ -424,7 +424,7 @@ function B(e, n) {
|
|
|
424
424
|
}
|
|
425
425
|
};
|
|
426
426
|
}
|
|
427
|
-
function
|
|
427
|
+
function O(e) {
|
|
428
428
|
return JSON.parse(JSON.stringify(e));
|
|
429
429
|
}
|
|
430
430
|
const dr = [
|
|
@@ -443,7 +443,7 @@ const dr = [
|
|
|
443
443
|
["negative", "Negative"],
|
|
444
444
|
["warning", "Warning"],
|
|
445
445
|
["info", "Info"]
|
|
446
|
-
], ir = [0, 1, 2, 3, 4, 5],
|
|
446
|
+
], ir = [0, 1, 2, 3, 4, 5], Y = Ze, cr = [
|
|
447
447
|
"#ffffff",
|
|
448
448
|
"#f8fafc",
|
|
449
449
|
"#f4f4f5",
|
|
@@ -469,17 +469,17 @@ function vr({
|
|
|
469
469
|
onClearConfig: y,
|
|
470
470
|
onCancel: S
|
|
471
471
|
}) {
|
|
472
|
-
const [f, g] = m.useState(null), [T, F] = m.useState("light"), [_, z] = m.useState(!1), [we,
|
|
472
|
+
const [f, g] = m.useState(null), [T, F] = m.useState("light"), [_, z] = m.useState(!1), [we, R] = m.useState(
|
|
473
473
|
"idle"
|
|
474
|
-
), [ne, Se] = m.useState(!1), [D,
|
|
474
|
+
), [ne, Se] = m.useState(!1), [D, V] = m.useState(""), [I, h] = m.useState(null), te = m.useRef(null), J = m.useRef(i), A = m.useRef(!1);
|
|
475
475
|
m.useEffect(() => {
|
|
476
|
-
|
|
476
|
+
J.current = i;
|
|
477
477
|
}, [i]), m.useEffect(() => {
|
|
478
478
|
if (e === void 0) {
|
|
479
479
|
A.current = !0, g(null);
|
|
480
480
|
return;
|
|
481
481
|
}
|
|
482
|
-
const o =
|
|
482
|
+
const o = j(e);
|
|
483
483
|
A.current = !0, g(o), F("light"), h(null);
|
|
484
484
|
}, [e]), m.useEffect(() => {
|
|
485
485
|
var o;
|
|
@@ -490,7 +490,7 @@ function vr({
|
|
|
490
490
|
}
|
|
491
491
|
try {
|
|
492
492
|
const a = L(f);
|
|
493
|
-
(o =
|
|
493
|
+
(o = J.current) == null || o.call(J, a), h(null);
|
|
494
494
|
} catch (a) {
|
|
495
495
|
h(
|
|
496
496
|
a instanceof Error ? a.message : "Appearance is invalid"
|
|
@@ -498,7 +498,7 @@ function vr({
|
|
|
498
498
|
}
|
|
499
499
|
}
|
|
500
500
|
}, [f]);
|
|
501
|
-
const p = f == null ? void 0 : f.schemes[T],
|
|
501
|
+
const p = f == null ? void 0 : f.schemes[T], U = u || _, Te = m.useMemo(
|
|
502
502
|
() => p ? ur(p.tokens.radius.control) : void 0,
|
|
503
503
|
[p]
|
|
504
504
|
), Fe = (o) => {
|
|
@@ -529,13 +529,13 @@ function vr({
|
|
|
529
529
|
z(!1);
|
|
530
530
|
}
|
|
531
531
|
}, Be = () => {
|
|
532
|
-
const o =
|
|
533
|
-
|
|
534
|
-
},
|
|
532
|
+
const o = j(null);
|
|
533
|
+
R("idle"), g(o);
|
|
534
|
+
}, Oe = async () => {
|
|
535
535
|
if (y) {
|
|
536
|
-
z(!0), h(null),
|
|
536
|
+
z(!0), h(null), R("idle");
|
|
537
537
|
try {
|
|
538
|
-
await y(), A.current = !0, g(
|
|
538
|
+
await y(), A.current = !0, g(j(null)), F("light");
|
|
539
539
|
} catch (o) {
|
|
540
540
|
h(
|
|
541
541
|
o instanceof Error ? o.message : "Unable to clear organization appearance"
|
|
@@ -544,10 +544,10 @@ function vr({
|
|
|
544
544
|
z(!1);
|
|
545
545
|
}
|
|
546
546
|
}
|
|
547
|
-
}, de = m.useCallback(() => f ? JSON.stringify(L(f), null, 2) : "", [f]),
|
|
547
|
+
}, de = m.useCallback(() => f ? JSON.stringify(L(f), null, 2) : "", [f]), Re = (o) => {
|
|
548
548
|
if (Se(o), o)
|
|
549
549
|
try {
|
|
550
|
-
|
|
550
|
+
V(de()), h(null);
|
|
551
551
|
} catch (a) {
|
|
552
552
|
h(
|
|
553
553
|
a instanceof Error ? a.message : "Appearance is invalid"
|
|
@@ -557,15 +557,15 @@ function vr({
|
|
|
557
557
|
if (f)
|
|
558
558
|
try {
|
|
559
559
|
const o = ne && D ? D : de();
|
|
560
|
-
await navigator.clipboard.writeText(o), h(null),
|
|
560
|
+
await navigator.clipboard.writeText(o), h(null), R("copied");
|
|
561
561
|
} catch (o) {
|
|
562
562
|
h(
|
|
563
563
|
o instanceof Error ? o.message : "Unable to copy brand spec"
|
|
564
564
|
);
|
|
565
565
|
}
|
|
566
566
|
}, ie = (o) => {
|
|
567
|
-
const a = JSON.parse(o), x =
|
|
568
|
-
|
|
567
|
+
const a = JSON.parse(o), x = j(a), P = L(x);
|
|
568
|
+
R("idle"), F("light"), g(x), V(JSON.stringify(P, null, 2));
|
|
569
569
|
}, Ee = () => {
|
|
570
570
|
try {
|
|
571
571
|
ie(D);
|
|
@@ -608,7 +608,7 @@ function vr({
|
|
|
608
608
|
ge,
|
|
609
609
|
{
|
|
610
610
|
open: ne,
|
|
611
|
-
onOpenChange:
|
|
611
|
+
onOpenChange: Re,
|
|
612
612
|
children: [
|
|
613
613
|
/* @__PURE__ */ r(be, { asChild: !0, children: /* @__PURE__ */ d(C, { type: "button", size: "xs", variant: "ghost", disabled: !f, children: [
|
|
614
614
|
/* @__PURE__ */ r(Ke, { className: "h-3.5 w-3.5" }),
|
|
@@ -665,7 +665,7 @@ function vr({
|
|
|
665
665
|
ariaLabel: "Brand spec",
|
|
666
666
|
value: D,
|
|
667
667
|
onValueChange: (o) => {
|
|
668
|
-
|
|
668
|
+
V(o), R("idle");
|
|
669
669
|
},
|
|
670
670
|
language: "json",
|
|
671
671
|
embedded: !0,
|
|
@@ -710,8 +710,8 @@ function vr({
|
|
|
710
710
|
type: "button",
|
|
711
711
|
size: "xs",
|
|
712
712
|
variant: "ghost",
|
|
713
|
-
onClick:
|
|
714
|
-
disabled:
|
|
713
|
+
onClick: Oe,
|
|
714
|
+
disabled: U,
|
|
715
715
|
children: [
|
|
716
716
|
/* @__PURE__ */ r(er, { className: "h-3.5 w-3.5" }),
|
|
717
717
|
"No config"
|
|
@@ -724,9 +724,9 @@ function vr({
|
|
|
724
724
|
type: "button",
|
|
725
725
|
size: "xs",
|
|
726
726
|
onClick: Pe,
|
|
727
|
-
disabled: !f ||
|
|
727
|
+
disabled: !f || U || !!I || !k,
|
|
728
728
|
children: [
|
|
729
|
-
|
|
729
|
+
U ? /* @__PURE__ */ r(le, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ r(Qe, { className: "h-3.5 w-3.5" }),
|
|
730
730
|
"Save"
|
|
731
731
|
]
|
|
732
732
|
}
|
|
@@ -738,7 +738,7 @@ function vr({
|
|
|
738
738
|
"aria-label": "Close Brand Studio",
|
|
739
739
|
className: "flex h-7 w-7 items-center justify-center rounded-control text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
740
740
|
onClick: S,
|
|
741
|
-
children: /* @__PURE__ */ r(
|
|
741
|
+
children: /* @__PURE__ */ r(Je, { className: "h-3.5 w-3.5" })
|
|
742
742
|
}
|
|
743
743
|
)
|
|
744
744
|
] }),
|
|
@@ -747,7 +747,7 @@ function vr({
|
|
|
747
747
|
/* @__PURE__ */ r(se, { className: "h-3.5 w-3.5 text-destructive" }),
|
|
748
748
|
"Preview keeps the last valid draft"
|
|
749
749
|
] }) : /* @__PURE__ */ d(ce, { children: [
|
|
750
|
-
/* @__PURE__ */ r(
|
|
750
|
+
/* @__PURE__ */ r(je, { className: "h-3.5 w-3.5 text-emerald-500" }),
|
|
751
751
|
"Draft is applied to the live dashboard preview"
|
|
752
752
|
] }) }),
|
|
753
753
|
/* @__PURE__ */ r("div", { className: "inline-flex h-7 items-center overflow-hidden rounded-control border border-border/70", children: ["light", "dark"].map((o) => /* @__PURE__ */ r(
|
|
@@ -767,12 +767,12 @@ function vr({
|
|
|
767
767
|
I && /* @__PURE__ */ r("div", { className: "border-b border-destructive/20 bg-destructive/5 px-4 py-2 text-[12px] text-destructive", children: I }),
|
|
768
768
|
t ? /* @__PURE__ */ r("div", { className: "flex flex-1 items-center justify-center", children: /* @__PURE__ */ r(le, { className: "h-4 w-4 animate-spin text-muted-foreground" }) }) : c ? /* @__PURE__ */ r("div", { className: "p-4 text-[13px] text-muted-foreground", children: c }) : f && p ? /* @__PURE__ */ d(Le, { defaultValue: "style", className: "flex min-h-0 flex-1 flex-col", children: [
|
|
769
769
|
/* @__PURE__ */ r("div", { className: "shrink-0 px-4 pt-3", children: /* @__PURE__ */ d($e, { variant: "underline", className: "w-full gap-5", children: [
|
|
770
|
-
/* @__PURE__ */ r(
|
|
771
|
-
/* @__PURE__ */ r(
|
|
772
|
-
/* @__PURE__ */ r(
|
|
770
|
+
/* @__PURE__ */ r(M, { value: "style", children: "Style" }),
|
|
771
|
+
/* @__PURE__ */ r(M, { value: "surfaces", children: "Surfaces" }),
|
|
772
|
+
/* @__PURE__ */ r(M, { value: "data", children: "Data" })
|
|
773
773
|
] }) }),
|
|
774
774
|
/* @__PURE__ */ d(_e, { className: "min-h-0 flex-1", children: [
|
|
775
|
-
/* @__PURE__ */ d(
|
|
775
|
+
/* @__PURE__ */ d(G, { value: "style", className: "m-0 p-4", children: [
|
|
776
776
|
/* @__PURE__ */ r(
|
|
777
777
|
N,
|
|
778
778
|
{
|
|
@@ -837,7 +837,7 @@ function vr({
|
|
|
837
837
|
/* @__PURE__ */ d(
|
|
838
838
|
N,
|
|
839
839
|
{
|
|
840
|
-
icon:
|
|
840
|
+
icon: Ve,
|
|
841
841
|
title: "Typography",
|
|
842
842
|
description: "Fonts and density used by dashboard and workflow chrome.",
|
|
843
843
|
children: [
|
|
@@ -864,7 +864,7 @@ function vr({
|
|
|
864
864
|
}
|
|
865
865
|
),
|
|
866
866
|
/* @__PURE__ */ r(
|
|
867
|
-
|
|
867
|
+
Z,
|
|
868
868
|
{
|
|
869
869
|
label: "Density",
|
|
870
870
|
value: p.tokens.typography.density,
|
|
@@ -883,7 +883,7 @@ function vr({
|
|
|
883
883
|
}
|
|
884
884
|
)
|
|
885
885
|
] }),
|
|
886
|
-
/* @__PURE__ */ d(
|
|
886
|
+
/* @__PURE__ */ d(G, { value: "surfaces", className: "m-0 p-4", children: [
|
|
887
887
|
/* @__PURE__ */ d(
|
|
888
888
|
N,
|
|
889
889
|
{
|
|
@@ -1031,11 +1031,11 @@ function vr({
|
|
|
1031
1031
|
}
|
|
1032
1032
|
)
|
|
1033
1033
|
] }),
|
|
1034
|
-
/* @__PURE__ */ d(
|
|
1034
|
+
/* @__PURE__ */ d(G, { value: "data", className: "m-0 p-4", children: [
|
|
1035
1035
|
/* @__PURE__ */ d(
|
|
1036
1036
|
N,
|
|
1037
1037
|
{
|
|
1038
|
-
icon:
|
|
1038
|
+
icon: Ue,
|
|
1039
1039
|
title: "Charts",
|
|
1040
1040
|
description: "Palette and semantic chart text/grid colors.",
|
|
1041
1041
|
children: [
|
|
@@ -1078,13 +1078,13 @@ function vr({
|
|
|
1078
1078
|
/* @__PURE__ */ d(
|
|
1079
1079
|
N,
|
|
1080
1080
|
{
|
|
1081
|
-
icon:
|
|
1081
|
+
icon: Me,
|
|
1082
1082
|
title: "Tables",
|
|
1083
1083
|
description: "Flat, aggregate, and pivot tables share this V1 table appearance.",
|
|
1084
1084
|
children: [
|
|
1085
1085
|
/* @__PURE__ */ d("div", { className: "grid grid-cols-2 gap-2", children: [
|
|
1086
1086
|
/* @__PURE__ */ r(
|
|
1087
|
-
|
|
1087
|
+
Z,
|
|
1088
1088
|
{
|
|
1089
1089
|
label: "Density",
|
|
1090
1090
|
value: p.components.table.density,
|
|
@@ -1099,7 +1099,7 @@ function vr({
|
|
|
1099
1099
|
}
|
|
1100
1100
|
),
|
|
1101
1101
|
/* @__PURE__ */ r(
|
|
1102
|
-
|
|
1102
|
+
Z,
|
|
1103
1103
|
{
|
|
1104
1104
|
label: "Cell wrap",
|
|
1105
1105
|
value: p.components.table.cell.wrap,
|
|
@@ -1136,7 +1136,7 @@ function vr({
|
|
|
1136
1136
|
)
|
|
1137
1137
|
] }),
|
|
1138
1138
|
/* @__PURE__ */ r(
|
|
1139
|
-
|
|
1139
|
+
q,
|
|
1140
1140
|
{
|
|
1141
1141
|
label: "Zebra rows",
|
|
1142
1142
|
checked: p.components.table.row.zebra,
|
|
@@ -1146,7 +1146,7 @@ function vr({
|
|
|
1146
1146
|
}
|
|
1147
1147
|
),
|
|
1148
1148
|
/* @__PURE__ */ r(
|
|
1149
|
-
|
|
1149
|
+
q,
|
|
1150
1150
|
{
|
|
1151
1151
|
label: "Sticky headers",
|
|
1152
1152
|
checked: p.components.table.header.sticky,
|
|
@@ -1156,7 +1156,7 @@ function vr({
|
|
|
1156
1156
|
}
|
|
1157
1157
|
),
|
|
1158
1158
|
/* @__PURE__ */ r(
|
|
1159
|
-
|
|
1159
|
+
q,
|
|
1160
1160
|
{
|
|
1161
1161
|
label: "Uppercase headers",
|
|
1162
1162
|
checked: p.components.table.header.uppercase,
|
|
@@ -1190,7 +1190,7 @@ function N({
|
|
|
1190
1190
|
] })
|
|
1191
1191
|
] }),
|
|
1192
1192
|
/* @__PURE__ */ r("div", { className: "space-y-2", children: u }),
|
|
1193
|
-
/* @__PURE__ */ r(
|
|
1193
|
+
/* @__PURE__ */ r(Ge, { className: "mt-5 bg-border/60" })
|
|
1194
1194
|
] });
|
|
1195
1195
|
}
|
|
1196
1196
|
function lr({
|
|
@@ -1198,7 +1198,7 @@ function lr({
|
|
|
1198
1198
|
onChange: n
|
|
1199
1199
|
}) {
|
|
1200
1200
|
var u;
|
|
1201
|
-
const t = (u =
|
|
1201
|
+
const t = (u = Y.find((c) => c.value === e)) == null ? void 0 : u.id;
|
|
1202
1202
|
return /* @__PURE__ */ d("div", { children: [
|
|
1203
1203
|
/* @__PURE__ */ r(E, { className: "mb-1 block text-[11px] font-normal text-muted-foreground", children: "Font family" }),
|
|
1204
1204
|
/* @__PURE__ */ d("div", { className: "grid grid-cols-[minmax(0,1fr)_150px] gap-2", children: [
|
|
@@ -1207,14 +1207,14 @@ function lr({
|
|
|
1207
1207
|
{
|
|
1208
1208
|
value: t,
|
|
1209
1209
|
onValueChange: (c) => {
|
|
1210
|
-
const l =
|
|
1210
|
+
const l = Y.find(
|
|
1211
1211
|
(i) => i.id === c
|
|
1212
1212
|
);
|
|
1213
1213
|
l && n(l.value);
|
|
1214
1214
|
},
|
|
1215
1215
|
children: [
|
|
1216
1216
|
/* @__PURE__ */ r(ye, { size: "xs", "aria-label": "Font family preset", children: /* @__PURE__ */ r(ke, { placeholder: "Select font" }) }),
|
|
1217
|
-
/* @__PURE__ */ r(ve, { children:
|
|
1217
|
+
/* @__PURE__ */ r(ve, { children: Y.map((c) => /* @__PURE__ */ r(Ce, { value: c.id, children: c.label }, c.id)) })
|
|
1218
1218
|
]
|
|
1219
1219
|
}
|
|
1220
1220
|
),
|
|
@@ -1356,10 +1356,10 @@ function v({
|
|
|
1356
1356
|
] });
|
|
1357
1357
|
}
|
|
1358
1358
|
function sr(e) {
|
|
1359
|
-
const n =
|
|
1360
|
-
return n ? `#${
|
|
1359
|
+
const n = qe(e);
|
|
1360
|
+
return n ? `#${X(n.r)}${X(n.g)}${X(n.b)}` : "#000000";
|
|
1361
1361
|
}
|
|
1362
|
-
function
|
|
1362
|
+
function X(e) {
|
|
1363
1363
|
return Math.round(e).toString(16).padStart(2, "0");
|
|
1364
1364
|
}
|
|
1365
1365
|
function w({
|
|
@@ -1411,7 +1411,7 @@ function w({
|
|
|
1411
1411
|
)
|
|
1412
1412
|
] });
|
|
1413
1413
|
}
|
|
1414
|
-
function
|
|
1414
|
+
function Z({
|
|
1415
1415
|
label: e,
|
|
1416
1416
|
value: n,
|
|
1417
1417
|
options: t,
|
|
@@ -1425,7 +1425,7 @@ function q({
|
|
|
1425
1425
|
] })
|
|
1426
1426
|
] });
|
|
1427
1427
|
}
|
|
1428
|
-
function
|
|
1428
|
+
function q({
|
|
1429
1429
|
label: e,
|
|
1430
1430
|
checked: n,
|
|
1431
1431
|
onCheckedChange: t
|
|
@@ -1456,6 +1456,6 @@ export {
|
|
|
1456
1456
|
vr as BrandStudioEditor,
|
|
1457
1457
|
nr as applyBrandStudioPreset,
|
|
1458
1458
|
L as buildAppearanceSpecFromDraft,
|
|
1459
|
-
|
|
1459
|
+
j as createBrandStudioDraft,
|
|
1460
1460
|
s as mirrorTableAppearance
|
|
1461
1461
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var U=Object.defineProperty;var q=(t,n,e)=>n in t?U(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e;var R=(t,n,e)=>q(t,typeof n!="symbol"?n+"":n,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v="BRIEFING",O=["markdown","html"],A=["markdown"],$=20,c={name:500,description:2e3,instruction:5e4,customMessage:5e4,attachmentTitle:500,presentationAudience:1e3,presentationTone:500,presentationFormat:2e3,id:500},x=new Set(O),H=new Set(["EMAIL","WEBHOOK","SLACK","IN_APP","TELEGRAM"]),T={maxToolCalls:{min:1,max:100},maxRows:{min:1,max:1e5},timeoutMs:{min:1e3,max:30*6e4}},K=new Set(["letter","legal","a4","a3","tabloid"]),J=new Set(["portrait","landscape"]),X=new Set([",",";"," "]),W=["pageSize","orientation","includeFilters","includeTimestamp","delimiter","includeHeaders","useFormattedValues","sheetSelection","currentSheetId","currentSheetName","filterValues","inlineFilterValues","sheetFilterValues","filterLine","controlValues","controlDefinitions","cardControlDefinitions","controlBindings","tablePreferences","dashboardInputExecutionSnapshot","selectedSheetId","cardType","theme"];class C extends Error{constructor(e){super(e.map(r=>`${r.field}: ${r.message}`).join("; "));R(this,"issues");this.name="BriefingContractError",this.issues=e}}function D(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function d(t,n,e){t.push({field:n,message:e})}function m(t,n,e){return D(t)?t:(d(e,n,"Expected an object."),{})}function s(t,n,e,r){const o=new Set(e);Object.keys(t).forEach(i=>{o.has(i)||d(r,n?`${n}.${i}`:i,`Unexpected field "${i}".`)})}function f(t,n,e,r){if(typeof t!="string")return d(r,n,"Expected a string."),"";const o=t.trim();return o?(o.length>e&&d(r,n,`Must be ${e} characters or fewer.`),o):(d(r,n,"Required value cannot be empty."),"")}function u(t,n,e,r){if(t==null)return;if(typeof t!="string"){d(r,n,"Expected a string.");return}const o=t.trim();if(o)return o.length>e&&d(r,n,`Must be ${e} characters or fewer.`),o}function _(t,n,e,r){return t==null?n:typeof t!="boolean"?(d(r,e,"Expected a boolean."),n):t}function Y(t,n){return t==null?"ACTIVE":t==="ACTIVE"||t==="PAUSED"||t==="DISABLED"?t:(d(n,"status","Expected ACTIVE, PAUSED, or DISABLED."),"ACTIVE")}function Z(t){return t.includes("@")&&t.includes(".")&&!t.includes(" ")}function N(t,n){if(t==null)return{type:"project"};const e=m(t,"source",n),r=e.type;return r==="project"?(s(e,"source",["type"],n),{type:"project"}):r==="dashboard"?(s(e,"source",["type","dashboardId"],n),{type:"dashboard",dashboardId:f(e.dashboardId,"source.dashboardId",c.id,n)}):(d(n,"source.type","Expected project or dashboard."),{type:"project"})}function V(t,n){const e=m(t,"body",n),r=e.type;return r==="generated_analysis"?(s(e,"body",["type","instruction"],n),{type:"generated_analysis",instruction:f(e.instruction,"body.instruction",c.instruction,n)}):r==="custom_message"?(s(e,"body",["type","message"],n),{type:"custom_message",message:f(e.message,"body.message",c.customMessage,n)}):r==="none"?(s(e,"body",["type"],n),{type:"none"}):(d(n,"body.type","Expected generated_analysis, custom_message, or none."),{type:"none"})}function Q(t,n){if(t==null)return[...A];if(!Array.isArray(t))return d(n,"presentation.artifactFormats","Expected an array."),[...A];if(t.length===0)return d(n,"presentation.artifactFormats","Choose at least one artifact format."),[];const e=[];return t.forEach((r,o)=>{if(typeof r!="string"||!x.has(r)){d(n,`presentation.artifactFormats.${o}`,"Expected markdown or html.");return}e.includes(r)||e.push(r)}),e}function j(t,n){if(t==null)return{artifactFormats:[...A],includeEvidence:!0,includeSql:!0};const e=m(t,"presentation",n);s(e,"presentation",["artifactFormats","includeEvidence","includeSql","audience","tone","format"],n);const r={artifactFormats:Q(e.artifactFormats,n),includeEvidence:_(e.includeEvidence,!0,"presentation.includeEvidence",n),includeSql:_(e.includeSql,!0,"presentation.includeSql",n)},o=u(e.audience,"presentation.audience",c.presentationAudience,n),i=u(e.tone,"presentation.tone",c.presentationTone,n),a=u(e.format,"presentation.format",c.presentationFormat,n);return o&&(r.audience=o),i&&(r.tone=i),a&&(r.format=a),r}function g(t,n,e,r){return typeof t=="string"&&e.includes(t)?t:(d(r,n,`Expected ${e.join(" or ")}.`),e[0])}function I(t,n,e,r,o){if(t!=null){if(typeof t=="string"&&e.has(t))return t;d(o,n,`Expected ${r}.`)}}function ee(t,n,e){if(t!=null){if(!Array.isArray(t)){d(e,n,"Expected an array.");return}return t}}function te(t,n,e){if(t!=null){if(!D(t)){d(e,n,"Expected an object.");return}return t}}function ne(t,n,e){if(t==null)return;const r=m(t,n,e);s(r,n,W,e);const o={},i=I(r.pageSize,`${n}.pageSize`,K,"letter, legal, a4, a3, or tabloid",e),a=I(r.orientation,`${n}.orientation`,J,"portrait or landscape",e),p=I(r.delimiter,`${n}.delimiter`,X,"comma, semicolon, or tab",e),y=I(r.sheetSelection,`${n}.sheetSelection`,new Set(["current","all"]),"current or all",e);i&&(o.pageSize=i),a&&(o.orientation=a),p&&(o.delimiter=p),y&&(o.sheetSelection=y);for(const l of["includeFilters","includeTimestamp","includeHeaders","useFormattedValues"])if(!(r[l]===void 0||r[l]===null)){if(typeof r[l]!="boolean"){d(e,`${n}.${l}`,"Expected a boolean.");continue}o[l]=r[l]}for(const l of["currentSheetId","currentSheetName","filterLine","selectedSheetId","cardType","theme"]){const h=u(r[l],`${n}.${l}`,c.id,e);h&&(o[l]=h)}for(const l of["filterValues","inlineFilterValues","sheetFilterValues","controlDefinitions","cardControlDefinitions","controlBindings"]){const h=ee(r[l],`${n}.${l}`,e);h&&(o[l]=h)}for(const l of["controlValues","tablePreferences","dashboardInputExecutionSnapshot"]){const h=te(r[l],`${n}.${l}`,e);h&&(o[l]=h)}return Object.keys(o).length>0?o:void 0}function b(t,n,e,r){const o=u(n,e,c.attachmentTitle,r);return o&&(t.title=o),t}function E(t,n,e,r){const o=ne(n,e,r);return o&&(t.settings=o),t}function re(t,n,e){const r=`attachments.${n}`,o=m(t,r,e),i=o.type;if(i==="dashboard"){s(o,r,["type","dashboardId","format","title","settings"],e);const a=b({type:"dashboard",dashboardId:f(o.dashboardId,`${r}.dashboardId`,c.id,e),format:g(o.format,`${r}.format`,["pdf"],e)},o.title,`${r}.title`,e);return E(a,o.settings,`${r}.settings`,e)}if(i==="dashboard_sheet"||i==="document_sheet"){s(o,r,["type","dashboardId","sheetId","format","title","settings"],e);const a=b({type:i,dashboardId:f(o.dashboardId,`${r}.dashboardId`,c.id,e),sheetId:f(o.sheetId,`${r}.sheetId`,c.id,e),format:g(o.format,`${r}.format`,["pdf"],e)},o.title,`${r}.title`,e);return E(a,o.settings,`${r}.settings`,e)}if(i==="visual"){s(o,r,["type","dashboardId","visualId","format","title","settings"],e);const a=b({type:"visual",dashboardId:f(o.dashboardId,`${r}.dashboardId`,c.id,e),visualId:f(o.visualId,`${r}.visualId`,c.id,e),format:g(o.format,`${r}.format`,["pdf","png"],e)},o.title,`${r}.title`,e);return E(a,o.settings,`${r}.settings`,e)}if(i==="card"){s(o,r,["type","dashboardId","cardId","format","title","settings"],e);const a=b({type:"card",dashboardId:f(o.dashboardId,`${r}.dashboardId`,c.id,e),cardId:f(o.cardId,`${r}.cardId`,c.id,e),format:g(o.format,`${r}.format`,["csv","pdf","png"],e)},o.title,`${r}.title`,e);return E(a,o.settings,`${r}.settings`,e)}return d(e,`${r}.type`,"Expected dashboard, dashboard_sheet, document_sheet, visual, or card."),{type:"dashboard",dashboardId:"",format:"pdf"}}function oe(t){switch(t.type){case"dashboard":return`${t.type}:${t.dashboardId}:${t.format}`;case"dashboard_sheet":case"document_sheet":return`${t.type}:${t.dashboardId}:${t.sheetId}:${t.format}`;case"visual":return`${t.type}:${t.dashboardId}:${t.visualId}:${t.format}`;case"card":return`${t.type}:${t.dashboardId}:${t.cardId}:${t.format}`}}function w(t,n){if(t==null)return[];if(!Array.isArray(t))return d(n,"attachments","Expected an array."),[];t.length>$&&d(n,"attachments",`Choose ${$} attachments or fewer.`);const e=t.slice(0,$).map((o,i)=>re(o,i,n)),r=new Set;return e.forEach((o,i)=>{const a=oe(o);r.has(a)&&d(n,`attachments.${i}`,"Duplicate attachment."),r.add(a)}),e}function M(t,n){if(t==null)return;const e=m(t,"limits",n);s(e,"limits",Object.keys(T),n);const r={};return Object.keys(T).forEach(o=>{const i=e[o];if(i==null)return;const a=T[o];if(typeof i!="number"||!Number.isInteger(i)||i<a.min||i>a.max){d(n,`limits.${o}`,`Expected an integer between ${a.min} and ${a.max}.`);return}r[o]=i}),Object.keys(r).length>0?r:void 0}function k(t){if(t.length>0)throw new C(t)}function L(t,n,e){t.type==="none"&&n.length===0&&d(e,"body","Add briefing instructions, a custom message, or at least one attachment.")}function B(t){const n=[],e=m(t,"jobConfig",n);s(e,"jobConfig",["kind","source","body","attachments","presentation","limits"],n),e.kind!==v&&d(n,"kind","Expected BRIEFING.");const r=N(e.source,n),o=V(e.body,n),i=w(e.attachments,n),a=j(e.presentation,n),p=M(e.limits,n);return L(o,i,n),k(n),{kind:v,source:r,body:o,attachments:i,presentation:a,...p?{limits:p}:{}}}function ie(t){return B({...t,kind:v})}function ae(t,n,e){const r=`deliveryConfig.recipients.${n}`,o=m(t,r,e),i=o.type;if(i==="email"){s(o,r,["type","address","name"],e);const a=f(o.address,`${r}.address`,c.id,e),p=u(o.name,`${r}.name`,c.attachmentTitle,e);return a&&!Z(a)&&d(e,`${r}.address`,"Email address is invalid."),{type:"email",address:a,...p?{name:p}:{}}}return i==="user"?(s(o,r,["type","userId"],e),{type:"user",userId:f(o.userId,`${r}.userId`,c.id,e)}):i==="tenant_user"?(s(o,r,["type","tenantUserId"],e),{type:"tenant_user",tenantUserId:f(o.tenantUserId,`${r}.tenantUserId`,c.id,e)}):i==="group"?(s(o,r,["type","groupId"],e),{type:"group",groupId:f(o.groupId,`${r}.groupId`,c.id,e)}):(d(e,`${r}.type`,"Expected email, user, tenant_user, or group."),{type:"email",address:""})}function de(t,n){return Array.isArray(t)?t.map((e,r)=>ae(e,r,n)):(d(n,"deliveryConfig.recipients","Expected an array."),[])}function ce(t,n){if(!Array.isArray(t))return d(n,"deliveryConfig.channels","Expected an array."),[];const e=[];return t.forEach((r,o)=>{if(!F(r)){d(n,`deliveryConfig.channels.${o}`,"Expected EMAIL, WEBHOOK, SLACK, IN_APP, or TELEGRAM.");return}e.includes(r)||e.push(r)}),e}function le(t,n,e){if(t==null)return;const r=m(t,n,e),o={};return Object.entries(r).forEach(([i,a])=>{if(typeof a!="string"){d(e,`${n}.${i}`,"Expected a string.");return}o[i]=a.trim()}),Object.keys(o).length>0?o:void 0}function se(t,n,e){if(t==null)return;const r=m(t,n,e);s(r,n,["url","method","headers","secretEncrypted"],e);const o=r.method===void 0||r.method===null?void 0:g(r.method,`${n}.method`,["POST","PUT"],e),i=le(r.headers,`${n}.headers`,e),a=u(r.secretEncrypted,`${n}.secretEncrypted`,2e3,e);return{url:f(r.url,`${n}.url`,2e3,e),...o?{method:o}:{},...i?{headers:i}:{},...a?{secretEncrypted:a}:{}}}function fe(t,n,e){const r=m(t,n,e);s(r,n,["subjectOverride","titleOverride","summaryOverride","actionBlockVisible","webhookConfig"],e);const o=u(r.subjectOverride,`${n}.subjectOverride`,500,e),i=u(r.titleOverride,`${n}.titleOverride`,500,e),a=u(r.summaryOverride,`${n}.summaryOverride`,2e3,e),p=_(r.actionBlockVisible,!0,`${n}.actionBlockVisible`,e),y=se(r.webhookConfig,`${n}.webhookConfig`,e);return{...o?{subjectOverride:o}:{},...i?{titleOverride:i}:{},...a?{summaryOverride:a}:{},...r.actionBlockVisible!==void 0?{actionBlockVisible:p}:{},...y?{webhookConfig:y}:{}}}function me(t,n){if(t==null)return;const e=m(t,"deliveryConfig.channelConfigs",n),r={};return Object.entries(e).forEach(([o,i])=>{if(!F(o)){d(n,`deliveryConfig.channelConfigs.${o}`,"Expected a supported delivery channel.");return}r[o]=fe(i,`deliveryConfig.channelConfigs.${o}`,n)}),Object.keys(r).length>0?r:void 0}function ue(t,n){if(t==null)return null;const e=m(t,"deliveryConfig",n);s(e,"deliveryConfig",["recipients","channels","channelConfigs"],n);const r=me(e.channelConfigs,n),o=de(e.recipients,n),i=ce(e.channels,n);return o.length===0&&d(n,"deliveryConfig.recipients","Add at least one recipient or remove delivery config."),i.length===0&&d(n,"deliveryConfig.channels","Choose at least one delivery channel or remove delivery config."),{recipients:o,channels:i,...r?{channelConfigs:r}:{}}}function S(t){const n=[],e=m(t,"draft",n);s(e,"draft",["name","description","status","scheduleExpr","timezone","source","body","attachments","presentation","limits","deliveryConfig"],n);const r=f(e.name,"name",c.name,n),o=u(e.description,"description",c.description,n)??null,i=u(e.scheduleExpr,"scheduleExpr",500,n)??null,a=u(e.timezone,"timezone",200,n)??"UTC",p=Y(e.status,n),y=N(e.source,n),l=V(e.body,n),h=w(e.attachments,n),P=j(e.presentation,n),z=M(e.limits,n),G=ue(e.deliveryConfig,n);return L(l,h,n),k(n),{name:r,description:o,status:p,scheduleExpr:i,timezone:a,source:y,body:l,attachments:h,presentation:P,...z?{limits:z}:{},deliveryConfig:G}}function pe(t){return S(t)}function he(t){return S(t)}function ye(t){try{return{valid:!0,value:S(t),issues:[]}}catch(n){if(n instanceof C)return{valid:!1,issues:n.issues};throw n}}function ge(t){try{return{valid:!0,value:B(t),issues:[]}}catch(n){if(n instanceof C)return{valid:!1,issues:n.issues};throw n}}function Ie(t){return typeof t=="string"&&x.has(t)}function F(t){return typeof t=="string"&&H.has(t)}exports.BRIEFING_ARTIFACT_FORMATS=O;exports.BRIEFING_KIND=v;exports.BRIEFING_TEXT_LIMITS=c;exports.BriefingContractError=C;exports.DEFAULT_BRIEFING_ARTIFACT_FORMATS=A;exports.MAX_BRIEFING_ATTACHMENTS=$;exports.buildBriefingJobConfig=ie;exports.buildCreateBriefingRequest=pe;exports.buildUpdateBriefingRequest=he;exports.isBriefingArtifactFormat=Ie;exports.isBriefingDeliveryChannel=F;exports.normalizeBriefingDraft=S;exports.normalizeBriefingJobConfig=B;exports.validateBriefingDraft=ye;exports.validateBriefingJobConfig=ge;
|