@nivaro/react 0.3.139 → 0.3.141
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/components/InlineGridField.js +95 -92
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +39 -2
- package/dist/shared/components/AudienceConfirmPanel.js +19 -19
- package/dist/shared/components/BroadcastView.js +213 -211
- package/dist/shared/components/CollectionBrowserView.js +2702 -2671
- package/dist/shared/components/ConfigHistory.js +45 -45
- package/dist/shared/components/ConformanceView.js +110 -110
- package/dist/shared/components/DataTable.js +51 -51
- package/dist/shared/components/FilePreviewLightbox.js +26 -25
- package/dist/shared/components/ItemEditForm.js +3475 -3458
- package/dist/shared/components/LiveCount.js +27 -23
- package/dist/shared/components/LiveTraceView.js +62 -61
- package/dist/shared/components/PageRenderer.js +422 -410
- package/dist/shared/components/ProfileView.js +199 -199
- package/dist/shared/components/QualityRulesView.js +70 -70
- package/dist/shared/components/QueryTable.js +131 -130
- package/dist/shared/components/RecordGraph.js +98 -98
- package/dist/shared/components/RecordReadView.js +287 -288
- package/dist/shared/components/ReportView.js +1279 -1259
- package/dist/shared/components/RowPresence.js +83 -76
- package/dist/shared/components/SlaRulesView.js +73 -74
- package/dist/shared/components/UnseenDot.js +183 -22
- package/dist/shared/components/WidgetSlot.js +73 -73
- package/dist/shared/components/ai/AiChart.js +36 -32
- package/dist/shared/components/ai/AiMarkdown.js +136 -129
- package/dist/shared/components/ai/TaskDo.js +87 -87
- package/dist/shared/components/ai/answer-formats.js +37 -30
- package/dist/shared/components/ai/call-log/format.js +17 -16
- package/dist/shared/components/bulk/BulkActionButtons.js +66 -66
- package/dist/shared/components/bulk/BulkFieldUpdate.js +59 -59
- package/dist/shared/components/bulk/BulkSelectionNotices.js +34 -34
- package/dist/shared/components/bulk/MessageStakeholders.js +31 -29
- package/dist/shared/components/bulk/PushBulkButtons.js +83 -82
- package/dist/shared/components/bulk/bulk-field-options.js +10 -10
- package/dist/shared/components/cbv/column-totals.js +53 -51
- package/dist/shared/components/chat/ChatAnalyticsView.js +87 -87
- package/dist/shared/components/collections-directory/CollectionsToolbar.js +18 -18
- package/dist/shared/components/command-center/announce.js +7 -6
- package/dist/shared/components/command-center/panels/AttentionPanel.js +32 -31
- package/dist/shared/components/command-center/panels/FlowPanel.js +29 -28
- package/dist/shared/components/command-center/panels/PeoplePanel.js +39 -39
- package/dist/shared/components/delegation/DelegationConsoleView.js +27 -27
- package/dist/shared/components/delivery-analytics/drill.js +32 -32
- package/dist/shared/components/imports/RunDetailSheet.js +1 -1
- package/dist/shared/components/integrations/IntegrationObligationsView.js +119 -119
- package/dist/shared/components/integrations/console/EventsView.js +35 -35
- package/dist/shared/components/integrations/console/FirefightView.js +15 -14
- package/dist/shared/components/integrations/console/PartnerDetail.js +78 -78
- package/dist/shared/components/integrations/console/ReadyToSendView.js +103 -103
- package/dist/shared/components/integrations/console/SignalCard.js +67 -67
- package/dist/shared/components/item-edit/CatalogPickerField.js +536 -527
- package/dist/shared/components/item-edit/ChangesTray.js +88 -74
- package/dist/shared/components/item-edit/FilePickerField.js +123 -123
- package/dist/shared/components/item-edit/GroupSection.js +301 -292
- package/dist/shared/components/item-edit/HeaderSummaryChip.js +54 -54
- package/dist/shared/components/item-edit/InlineGridField.js +45 -36
- package/dist/shared/components/item-edit/InlineTableField.js +1390 -1376
- package/dist/shared/components/item-edit/NestedRelationEditor.js +106 -99
- package/dist/shared/components/item-edit/RecordChatMentionsChip.js +11 -11
- package/dist/shared/components/item-edit/RecordRecapChanges.js +116 -74
- package/dist/shared/components/item-edit/RecordRecapStrip.js +148 -160
- package/dist/shared/components/item-edit/summary-layout-request.js +15 -0
- package/dist/shared/components/layout-editor/ai-forms/SlimPanel.js +43 -44
- package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
- package/dist/shared/components/layout-editor/settings/ResolveSettings.js +226 -157
- package/dist/shared/components/layout-editor/settings/WhoSection.js +53 -52
- package/dist/shared/components/layout-editor/settings/controls.js +98 -90
- package/dist/shared/components/layout-editor/settings/settings-registry.js +8 -0
- package/dist/shared/components/monitoring/ApiRequestLog.js +35 -35
- package/dist/shared/components/notifications/NotificationCenterView.js +268 -268
- package/dist/shared/components/ops-report/format.js +37 -36
- package/dist/shared/components/panels/ReferencedByPanel.js +21 -20
- package/dist/shared/components/panels/RevisionsPanel.js +306 -305
- package/dist/shared/components/pipeline/OwnerMatrixVersionsCard.js +12 -12
- package/dist/shared/components/pipeline/PipelineEditorView.js +483 -482
- package/dist/shared/components/pipeline/PipelineHealthCards.js +33 -32
- package/dist/shared/components/pipeline/TeamsView.js +189 -130
- package/dist/shared/components/profile/AgentsPanel.js +6 -6
- package/dist/shared/components/profile/DelegationCard.js +13 -12
- package/dist/shared/components/profile/PersonActivity.js +48 -48
- package/dist/shared/components/profile/PersonExtras.js +107 -107
- package/dist/shared/components/profile/PersonWeek.js +9 -9
- package/dist/shared/components/queue/QueueBulkBar.js +19 -18
- package/dist/shared/components/queue/QueueBulkMove.js +21 -20
- package/dist/shared/components/queue/QueueItemSheet.js +136 -131
- package/dist/shared/components/queue/QueueWorklist.js +884 -872
- package/dist/shared/components/queue/worklist-helpers.js +36 -21
- package/dist/shared/components/support/RequestList.js +123 -123
- package/dist/shared/components/support/SupportAnalytics.js +29 -29
- package/dist/shared/lib/activity-sentence.js +251 -229
- package/dist/shared/lib/format-value.js +5 -4
- package/dist/shared/lib/layout-resolve.js +64 -48
- package/dist/shared/lib/number-format.js +87 -0
- package/dist/shared/lib/number-kind.js +133 -0
- package/dist/shared/lib/utils.js +24 -20
- package/dist/shared/lib/watch-list.js +1 -1
- package/dist/shared/lib/widget-value-format.js +26 -12
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as v, useCallback as
|
|
3
|
-
import { PieChart as
|
|
4
|
-
import { cn as
|
|
1
|
+
import { jsxs as l, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useState as v, useCallback as S } from "react";
|
|
3
|
+
import { PieChart as w, Pie as x, Cell as p, Tooltip as h, LineChart as K, CartesianGrid as u, XAxis as b, YAxis as s, Line as L, BarChart as N, Bar as R } from "recharts";
|
|
4
|
+
import { cn as $ } from "../../lib/utils.js";
|
|
5
5
|
const g = [
|
|
6
6
|
"#0ea5e9",
|
|
7
7
|
"#6366f1",
|
|
@@ -11,12 +11,16 @@ const g = [
|
|
|
11
11
|
"#8b5cf6",
|
|
12
12
|
"#14b8a6",
|
|
13
13
|
"#f97316"
|
|
14
|
-
];
|
|
15
|
-
function
|
|
16
|
-
const
|
|
14
|
+
], z = new Intl.NumberFormat("en-US", { notation: "compact", maximumFractionDigits: 1 });
|
|
15
|
+
function O({ spec: e, onPoint: n }) {
|
|
16
|
+
const i = n ? (t) => t != null && n(String(t), e) : void 0, [y, f] = v(0), k = S((t) => {
|
|
17
17
|
if (!t) return;
|
|
18
|
-
|
|
19
|
-
}, []), d = e.type === "pie" ? 220 : 200,
|
|
18
|
+
f(t.getBoundingClientRect().width), new ResizeObserver(() => f(t.getBoundingClientRect().width)).observe(t);
|
|
19
|
+
}, []), d = e.type === "pie" ? 220 : 200, c = Math.max(240, Math.min(720, y || 400)), o = (t) => {
|
|
20
|
+
if (!Number.isFinite(t)) return String(t);
|
|
21
|
+
const r = Math.abs(t), C = r >= 1e3 ? z.format(r).replace(/K$/, "k") : r.toLocaleString();
|
|
22
|
+
return `${t < 0 ? "-" : ""}${e.unit === "currency" ? "$" : ""}${C}`;
|
|
23
|
+
}, m = {
|
|
20
24
|
contentStyle: {
|
|
21
25
|
background: "#0f172a",
|
|
22
26
|
border: "1px solid #334155",
|
|
@@ -27,18 +31,18 @@ function F({ spec: e, onPoint: o }) {
|
|
|
27
31
|
itemStyle: { color: "#f8fafc" },
|
|
28
32
|
labelStyle: { color: "#cbd5e1" }
|
|
29
33
|
};
|
|
30
|
-
return /* @__PURE__ */
|
|
34
|
+
return /* @__PURE__ */ l(
|
|
31
35
|
"div",
|
|
32
36
|
{
|
|
33
37
|
ref: k,
|
|
34
38
|
"data-ai-chart": e.type,
|
|
35
|
-
"data-ai-chart-drill":
|
|
36
|
-
className:
|
|
39
|
+
"data-ai-chart-drill": n ? "" : void 0,
|
|
40
|
+
className: $("my-2 w-full", n && "[&_.recharts-wrapper]:cursor-pointer"),
|
|
37
41
|
children: [
|
|
38
42
|
e.title && /* @__PURE__ */ a("div", { className: "mb-1 text-[0.9em] font-medium text-muted-foreground", children: e.title }),
|
|
39
|
-
e.type === "pie" ? /* @__PURE__ */
|
|
43
|
+
e.type === "pie" ? /* @__PURE__ */ l(w, { width: c, height: d, children: [
|
|
40
44
|
/* @__PURE__ */ a(
|
|
41
|
-
|
|
45
|
+
x,
|
|
42
46
|
{
|
|
43
47
|
data: e.data,
|
|
44
48
|
dataKey: "value",
|
|
@@ -46,26 +50,26 @@ function F({ spec: e, onPoint: o }) {
|
|
|
46
50
|
cx: "50%",
|
|
47
51
|
cy: "50%",
|
|
48
52
|
outerRadius: 80,
|
|
49
|
-
label: ({ name: t, percent:
|
|
53
|
+
label: ({ name: t, percent: r }) => `${t} ${Math.round((r ?? 0) * 100)}%`,
|
|
50
54
|
labelLine: !1,
|
|
51
|
-
onClick:
|
|
52
|
-
children: e.data.map((t,
|
|
55
|
+
onClick: i ? (t) => i((t == null ? void 0 : t.label) ?? (t == null ? void 0 : t.name)) : void 0,
|
|
56
|
+
children: e.data.map((t, r) => /* @__PURE__ */ a(p, { fill: g[r % g.length] }, t.label))
|
|
53
57
|
}
|
|
54
58
|
),
|
|
55
|
-
/* @__PURE__ */ a(
|
|
56
|
-
] }) : e.type === "line" ? /* @__PURE__ */
|
|
57
|
-
|
|
59
|
+
/* @__PURE__ */ a(h, { ...m, formatter: (t) => o(Number(t)) })
|
|
60
|
+
] }) : e.type === "line" ? /* @__PURE__ */ l(
|
|
61
|
+
K,
|
|
58
62
|
{
|
|
59
|
-
width:
|
|
63
|
+
width: c,
|
|
60
64
|
height: d,
|
|
61
65
|
data: e.data,
|
|
62
66
|
margin: { left: 4, right: 12 },
|
|
63
|
-
onClick:
|
|
67
|
+
onClick: i ? (t) => i(t == null ? void 0 : t.activeLabel) : void 0,
|
|
64
68
|
children: [
|
|
65
69
|
/* @__PURE__ */ a(u, { strokeDasharray: "3 3", stroke: "currentColor", opacity: 0.12 }),
|
|
66
70
|
/* @__PURE__ */ a(b, { dataKey: "label", tick: { fontSize: 11 }, interval: "preserveStartEnd" }),
|
|
67
|
-
/* @__PURE__ */ a(s, { tick: { fontSize: 11 }, tickFormatter:
|
|
68
|
-
/* @__PURE__ */ a(
|
|
71
|
+
/* @__PURE__ */ a(s, { tick: { fontSize: 11 }, tickFormatter: o, width: 44 }),
|
|
72
|
+
/* @__PURE__ */ a(h, { ...m, formatter: (t) => o(Number(t)) }),
|
|
69
73
|
/* @__PURE__ */ a(
|
|
70
74
|
L,
|
|
71
75
|
{
|
|
@@ -78,14 +82,14 @@ function F({ spec: e, onPoint: o }) {
|
|
|
78
82
|
)
|
|
79
83
|
]
|
|
80
84
|
}
|
|
81
|
-
) : /* @__PURE__ */
|
|
82
|
-
|
|
85
|
+
) : /* @__PURE__ */ l(
|
|
86
|
+
N,
|
|
83
87
|
{
|
|
84
|
-
width:
|
|
88
|
+
width: c,
|
|
85
89
|
height: d,
|
|
86
90
|
data: e.data,
|
|
87
91
|
margin: { left: 4, right: 12 },
|
|
88
|
-
onClick:
|
|
92
|
+
onClick: i ? (t) => i(t == null ? void 0 : t.activeLabel) : void 0,
|
|
89
93
|
children: [
|
|
90
94
|
/* @__PURE__ */ a(u, { strokeDasharray: "3 3", stroke: "currentColor", opacity: 0.12 }),
|
|
91
95
|
/* @__PURE__ */ a(
|
|
@@ -99,9 +103,9 @@ function F({ spec: e, onPoint: o }) {
|
|
|
99
103
|
height: e.data.length > 8 ? 56 : 30
|
|
100
104
|
}
|
|
101
105
|
),
|
|
102
|
-
/* @__PURE__ */ a(s, { tick: { fontSize: 11 }, tickFormatter:
|
|
103
|
-
/* @__PURE__ */ a(
|
|
104
|
-
/* @__PURE__ */ a(
|
|
106
|
+
/* @__PURE__ */ a(s, { tick: { fontSize: 11 }, tickFormatter: o, width: 44 }),
|
|
107
|
+
/* @__PURE__ */ a(h, { ...m, formatter: (t) => o(Number(t)) }),
|
|
108
|
+
/* @__PURE__ */ a(R, { dataKey: "value", fill: "#0ea5e9", radius: [3, 3, 0, 0] })
|
|
105
109
|
]
|
|
106
110
|
}
|
|
107
111
|
)
|
|
@@ -110,5 +114,5 @@ function F({ spec: e, onPoint: o }) {
|
|
|
110
114
|
);
|
|
111
115
|
}
|
|
112
116
|
export {
|
|
113
|
-
|
|
117
|
+
O as AiChart
|
|
114
118
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
2
|
-
import { useMemo as
|
|
1
|
+
import { jsx as a, jsxs as g } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as k, createContext as A, useState as O, useContext as S, Suspense as _, lazy as B } from "react";
|
|
3
3
|
import { useOptionalNivaroClient as I, useNavigation as P } from "../../context.js";
|
|
4
4
|
import { useGlossary as T, glossarySegments as j } from "../../lib/glossary.js";
|
|
5
5
|
import { cn as b } from "../../lib/utils.js";
|
|
@@ -8,41 +8,48 @@ import { formatsFor as K, rowsOfBlock as R, listOf as F, chartOf as H } from "./
|
|
|
8
8
|
import { useGlossaryHref as G, GlossaryMark as D } from "./GlossaryText.js";
|
|
9
9
|
function U(e) {
|
|
10
10
|
try {
|
|
11
|
-
const
|
|
12
|
-
|
|
11
|
+
const t = JSON.parse(e), s = t.type === "line" || t.type === "pie" ? t.type : "bar", n = Array.isArray(t.data) ? t.data.map((i) => ({ label: String((i == null ? void 0 : i.label) ?? ""), value: Number(i == null ? void 0 : i.value) })).filter((i) => i.label && Number.isFinite(i.value)).slice(0, 40) : [];
|
|
12
|
+
if (n.length < 2) return null;
|
|
13
|
+
const l = ["currency", "usd", "$", "money"].includes(String(t.unit ?? "").toLowerCase());
|
|
14
|
+
return {
|
|
15
|
+
type: s,
|
|
16
|
+
title: typeof t.title == "string" ? t.title : void 0,
|
|
17
|
+
data: n,
|
|
18
|
+
...l ? { unit: "currency" } : {}
|
|
19
|
+
};
|
|
13
20
|
} catch {
|
|
14
21
|
return null;
|
|
15
22
|
}
|
|
16
23
|
}
|
|
17
24
|
const y = /^\|?\s*:?-{2,}:?\s*(\|\s*:?-{2,}:?\s*)*\|?\s*$/;
|
|
18
|
-
function
|
|
19
|
-
return e.trim().replace(/^\|/, "").replace(/\|$/, "").split("|").map((
|
|
25
|
+
function C(e) {
|
|
26
|
+
return e.trim().replace(/^\|/, "").replace(/\|$/, "").split("|").map((t) => t.trim());
|
|
20
27
|
}
|
|
21
28
|
function z(e) {
|
|
22
29
|
return e.split(`
|
|
23
|
-
`).flatMap((
|
|
24
|
-
const s =
|
|
25
|
-
return !s.startsWith("|") || !/\|\s*\|\s*[:-]{2,}/.test(s) && !/\|\s+\|\s*\S/.test(s) ? [
|
|
30
|
+
`).flatMap((t) => {
|
|
31
|
+
const s = t.trim();
|
|
32
|
+
return !s.startsWith("|") || !/\|\s*\|\s*[:-]{2,}/.test(s) && !/\|\s+\|\s*\S/.test(s) ? [t] : (s.match(/\|\s+\|/g) ?? []).length < 1 ? [t] : s.split(/\|\s+(?=\|)/).map((n) => n.trim().endsWith("|") ? n.trim() : `${n.trim()} |`);
|
|
26
33
|
}).join(`
|
|
27
34
|
`);
|
|
28
35
|
}
|
|
29
|
-
function
|
|
30
|
-
const s =
|
|
36
|
+
function $(e, t = {}) {
|
|
37
|
+
const s = t.charts !== !1, n = z(e.replace(/\r\n/g, `
|
|
31
38
|
`)).split(`
|
|
32
|
-
`),
|
|
33
|
-
let
|
|
39
|
+
`), l = [];
|
|
40
|
+
let i = [];
|
|
34
41
|
const u = () => {
|
|
35
|
-
|
|
42
|
+
i.length && l.push({ kind: "p", text: i.join(" ") }), i = [];
|
|
36
43
|
};
|
|
37
|
-
for (let
|
|
38
|
-
const o =
|
|
44
|
+
for (let r = 0; r < n.length; r++) {
|
|
45
|
+
const o = n[r].trim();
|
|
39
46
|
if (o.startsWith("```")) {
|
|
40
47
|
u();
|
|
41
48
|
const p = o.slice(3).trim().toLowerCase(), m = [];
|
|
42
|
-
for (
|
|
49
|
+
for (r++; r < n.length && !n[r].trim().startsWith("```"); ) m.push(n[r++]);
|
|
43
50
|
const v = m.join(`
|
|
44
51
|
`), N = s && p === "chart" ? U(v) : null;
|
|
45
|
-
|
|
52
|
+
l.push(N ? { kind: "chart", spec: N } : { kind: "code", text: v });
|
|
46
53
|
continue;
|
|
47
54
|
}
|
|
48
55
|
if (o === "") {
|
|
@@ -51,95 +58,95 @@ function C(e, n = {}) {
|
|
|
51
58
|
}
|
|
52
59
|
const c = /^(#{1,4})\s+(.*)$/.exec(o);
|
|
53
60
|
if (c) {
|
|
54
|
-
u(),
|
|
61
|
+
u(), l.push({ kind: "h", level: c[1].length, text: c[2] });
|
|
55
62
|
continue;
|
|
56
63
|
}
|
|
57
|
-
if (o.startsWith("|") &&
|
|
64
|
+
if (o.startsWith("|") && r + 1 < n.length && y.test(n[r + 1].trim())) {
|
|
58
65
|
u();
|
|
59
|
-
const p =
|
|
60
|
-
for (
|
|
61
|
-
y.test(
|
|
62
|
-
|
|
66
|
+
const p = C(o), m = [];
|
|
67
|
+
for (r += 2; r < n.length && n[r].trim().startsWith("|"); )
|
|
68
|
+
y.test(n[r].trim()) || m.push(C(n[r])), r++;
|
|
69
|
+
r--, l.push({ kind: "table", header: p, rows: m });
|
|
63
70
|
continue;
|
|
64
71
|
}
|
|
65
72
|
const d = /^[-*•]\s+(.*)$/.exec(o);
|
|
66
73
|
if (d) {
|
|
67
74
|
u();
|
|
68
75
|
const p = [d[1]];
|
|
69
|
-
for (;
|
|
70
|
-
const m = /^[-*•]\s+(.*)$/.exec(
|
|
76
|
+
for (; r + 1 < n.length; ) {
|
|
77
|
+
const m = /^[-*•]\s+(.*)$/.exec(n[r + 1].trim());
|
|
71
78
|
if (!m) break;
|
|
72
|
-
p.push(m[1]),
|
|
79
|
+
p.push(m[1]), r++;
|
|
73
80
|
}
|
|
74
|
-
|
|
81
|
+
l.push({ kind: "ul", items: p });
|
|
75
82
|
continue;
|
|
76
83
|
}
|
|
77
84
|
const x = /^\d+[.)]\s+(.*)$/.exec(o);
|
|
78
85
|
if (x) {
|
|
79
86
|
u();
|
|
80
87
|
const p = [x[1]];
|
|
81
|
-
for (;
|
|
82
|
-
const m = /^\d+[.)]\s+(.*)$/.exec(
|
|
88
|
+
for (; r + 1 < n.length; ) {
|
|
89
|
+
const m = /^\d+[.)]\s+(.*)$/.exec(n[r + 1].trim());
|
|
83
90
|
if (!m) break;
|
|
84
|
-
p.push(m[1]),
|
|
91
|
+
p.push(m[1]), r++;
|
|
85
92
|
}
|
|
86
|
-
|
|
93
|
+
l.push({ kind: "ol", items: p });
|
|
87
94
|
continue;
|
|
88
95
|
}
|
|
89
|
-
|
|
96
|
+
i.push(o);
|
|
90
97
|
}
|
|
91
|
-
return u(),
|
|
98
|
+
return u(), l;
|
|
92
99
|
}
|
|
93
100
|
const J = /(\*\*[^*]+\*\*|`[^`]+`|\*[^*]+\*|\[[^\]]+\]\([^)]+\))/g;
|
|
94
|
-
function f(e,
|
|
95
|
-
const
|
|
96
|
-
let
|
|
97
|
-
const u = (h) =>
|
|
101
|
+
function f(e, t = !1, s) {
|
|
102
|
+
const n = [];
|
|
103
|
+
let l = 0, i = 0;
|
|
104
|
+
const u = (h) => t ? /* @__PURE__ */ a(E, { text: h, plain: !0 }, i++) : h, r = (h) => {
|
|
98
105
|
if (!(s != null && s.terms.length)) return u(h);
|
|
99
106
|
const o = j(h, s.terms, { once: s.once });
|
|
100
107
|
return o.length === 1 && !o[0].term ? u(h) : o.map(
|
|
101
108
|
(c) => {
|
|
102
109
|
var d;
|
|
103
|
-
return c.term ? /* @__PURE__ */ a(D, { term: c.term, href: (d = s.href) == null ? void 0 : d.call(s, c.term), children: c.text },
|
|
110
|
+
return c.term ? /* @__PURE__ */ a(D, { term: c.term, href: (d = s.href) == null ? void 0 : d.call(s, c.term), children: c.text }, i++) : u(c.text);
|
|
104
111
|
}
|
|
105
112
|
);
|
|
106
113
|
};
|
|
107
114
|
for (const h of e.matchAll(J)) {
|
|
108
115
|
const o = h.index ?? 0;
|
|
109
|
-
o >
|
|
116
|
+
o > l && n.push(r(e.slice(l, o)));
|
|
110
117
|
const c = h[0];
|
|
111
|
-
if (c.startsWith("**"))
|
|
118
|
+
if (c.startsWith("**")) n.push(/* @__PURE__ */ a("strong", { children: r(c.slice(2, -2)) }, i++));
|
|
112
119
|
else if (c.startsWith("`"))
|
|
113
|
-
|
|
120
|
+
n.push(
|
|
114
121
|
/* @__PURE__ */ a(
|
|
115
122
|
"code",
|
|
116
123
|
{
|
|
117
124
|
className: "rounded bg-black/[0.06] px-1 py-px font-mono text-[0.92em] dark:bg-white/10",
|
|
118
125
|
children: c.slice(1, -1)
|
|
119
126
|
},
|
|
120
|
-
|
|
127
|
+
i++
|
|
121
128
|
)
|
|
122
129
|
);
|
|
123
130
|
else if (c.startsWith("[")) {
|
|
124
131
|
const d = /^\[([^\]]+)\]\(([^)]+)\)$/.exec(c);
|
|
125
|
-
d && Q(d[2]) ?
|
|
126
|
-
} else
|
|
127
|
-
|
|
132
|
+
d && Q(d[2]) ? n.push(/* @__PURE__ */ a(Y, { href: d[2], label: d[1] }, i++)) : d && W(d[2]) ? n.push(/* @__PURE__ */ a(q, { href: d[2], label: d[1] }, i++)) : n.push(c);
|
|
133
|
+
} else n.push(/* @__PURE__ */ a("em", { children: c.slice(1, -1) }, i++));
|
|
134
|
+
l = o + c.length;
|
|
128
135
|
}
|
|
129
|
-
return
|
|
136
|
+
return l < e.length && n.push(r(e.slice(l))), n;
|
|
130
137
|
}
|
|
131
138
|
function W(e) {
|
|
132
139
|
if (!/^https?:\/\/\S+$/i.test(e)) return null;
|
|
133
140
|
try {
|
|
134
|
-
const
|
|
135
|
-
return
|
|
141
|
+
const t = new URL(e);
|
|
142
|
+
return t.username || t.password ? null : t.hostname || null;
|
|
136
143
|
} catch {
|
|
137
144
|
return null;
|
|
138
145
|
}
|
|
139
146
|
}
|
|
140
|
-
function q({ href: e, label:
|
|
141
|
-
const s = W(e) ?? "",
|
|
142
|
-
return /* @__PURE__ */
|
|
147
|
+
function q({ href: e, label: t }) {
|
|
148
|
+
const s = W(e) ?? "", n = t.trim() === e || t.trim() === s;
|
|
149
|
+
return /* @__PURE__ */ g(
|
|
143
150
|
"a",
|
|
144
151
|
{
|
|
145
152
|
href: e,
|
|
@@ -149,8 +156,8 @@ function q({ href: e, label: n }) {
|
|
|
149
156
|
rel: "noopener noreferrer nofollow",
|
|
150
157
|
"data-tip": e,
|
|
151
158
|
children: [
|
|
152
|
-
|
|
153
|
-
!
|
|
159
|
+
n ? s : t,
|
|
160
|
+
!n && /* @__PURE__ */ g("span", { className: "ml-1 whitespace-nowrap text-[0.85em] opacity-70", children: [
|
|
154
161
|
"(",
|
|
155
162
|
s,
|
|
156
163
|
" ↗)"
|
|
@@ -161,90 +168,90 @@ function q({ href: e, label: n }) {
|
|
|
161
168
|
}
|
|
162
169
|
function Q(e) {
|
|
163
170
|
if (!/^\/(?![\\/])/.test(e)) return !1;
|
|
164
|
-
for (let
|
|
165
|
-
const s = e.charCodeAt(
|
|
171
|
+
for (let t = 0; t < e.length; t++) {
|
|
172
|
+
const s = e.charCodeAt(t);
|
|
166
173
|
if (s <= 32 || s === 127 || s === 92) return !1;
|
|
167
174
|
}
|
|
168
175
|
return !0;
|
|
169
176
|
}
|
|
170
|
-
function V(e,
|
|
171
|
-
return
|
|
177
|
+
function V(e, t) {
|
|
178
|
+
return t && t !== "/help-videos" && /^\/help-videos(?=[?#/]|$)/.test(e) ? `${t}${e.slice(12)}` : e;
|
|
172
179
|
}
|
|
173
|
-
const L =
|
|
180
|
+
const L = A(!1);
|
|
174
181
|
function X(e) {
|
|
175
|
-
return e.replace(/!\[([^\]]*)\]\(([^)\s]+)\)/g, (
|
|
182
|
+
return e.replace(/!\[([^\]]*)\]\(([^)\s]+)\)/g, (t, s, n) => `[${s.replace(/[[\]]/g, "").trim() || "image"}](${n})`);
|
|
176
183
|
}
|
|
177
|
-
function Y({ href: e, label:
|
|
178
|
-
const s = S(L),
|
|
179
|
-
if (s) return /* @__PURE__ */ a("span", { "data-ai-link": "plain", children:
|
|
180
|
-
const
|
|
184
|
+
function Y({ href: e, label: t }) {
|
|
185
|
+
const s = S(L), n = P();
|
|
186
|
+
if (s) return /* @__PURE__ */ a("span", { "data-ai-link": "plain", children: t });
|
|
187
|
+
const l = V(e, n.helpVideosPath);
|
|
181
188
|
return /* @__PURE__ */ a(
|
|
182
189
|
"a",
|
|
183
190
|
{
|
|
184
|
-
href:
|
|
191
|
+
href: l,
|
|
185
192
|
"data-ai-link": "in-app",
|
|
186
193
|
className: "underline underline-offset-2",
|
|
187
|
-
onClick: (
|
|
188
|
-
|
|
194
|
+
onClick: (i) => {
|
|
195
|
+
i.defaultPrevented || i.button !== 0 || i.metaKey || i.ctrlKey || i.shiftKey || i.altKey || (i.preventDefault(), n.navigate(l));
|
|
189
196
|
},
|
|
190
|
-
children:
|
|
197
|
+
children: t
|
|
191
198
|
}
|
|
192
199
|
);
|
|
193
200
|
}
|
|
194
201
|
function Z({
|
|
195
202
|
header: e,
|
|
196
|
-
rows:
|
|
203
|
+
rows: t,
|
|
197
204
|
autolink: s
|
|
198
205
|
}) {
|
|
199
|
-
const
|
|
200
|
-
return /* @__PURE__ */
|
|
201
|
-
/* @__PURE__ */ a("ul", { className: "flex flex-col gap-1.5 sm:hidden", children:
|
|
206
|
+
const n = e.length;
|
|
207
|
+
return /* @__PURE__ */ g("div", { "data-ai-table": !0, className: "my-1.5", children: [
|
|
208
|
+
/* @__PURE__ */ a("ul", { className: "flex flex-col gap-1.5 sm:hidden", children: t.map((l, i) => (
|
|
202
209
|
// biome-ignore lint/suspicious/noArrayIndexKey: static content
|
|
203
|
-
/* @__PURE__ */
|
|
210
|
+
/* @__PURE__ */ g(
|
|
204
211
|
"li",
|
|
205
212
|
{
|
|
206
213
|
className: "rounded-lg border border-black/10 bg-background/60 px-2.5 py-2 dark:border-white/10",
|
|
207
214
|
children: [
|
|
208
|
-
/* @__PURE__ */ a("div", { className: "font-semibold leading-snug", children: f(
|
|
209
|
-
|
|
210
|
-
(u,
|
|
215
|
+
/* @__PURE__ */ a("div", { className: "font-semibold leading-snug", children: f(l[0] ?? "", s) }),
|
|
216
|
+
l.slice(1, n).map(
|
|
217
|
+
(u, r) => u ? (
|
|
211
218
|
// biome-ignore lint/suspicious/noArrayIndexKey: static content
|
|
212
|
-
/* @__PURE__ */
|
|
219
|
+
/* @__PURE__ */ g(
|
|
213
220
|
"div",
|
|
214
221
|
{
|
|
215
222
|
className: "mt-1 grid grid-cols-[minmax(0,34%)_1fr] gap-2 text-[0.94em] leading-snug",
|
|
216
223
|
children: [
|
|
217
|
-
/* @__PURE__ */ a("span", { className: "text-muted-foreground", children: e[
|
|
224
|
+
/* @__PURE__ */ a("span", { className: "text-muted-foreground", children: e[r + 1] }),
|
|
218
225
|
/* @__PURE__ */ a("span", { className: "min-w-0 break-words", children: f(u, s) })
|
|
219
226
|
]
|
|
220
227
|
},
|
|
221
|
-
|
|
228
|
+
r
|
|
222
229
|
)
|
|
223
230
|
) : null
|
|
224
231
|
)
|
|
225
232
|
]
|
|
226
233
|
},
|
|
227
|
-
|
|
234
|
+
i
|
|
228
235
|
)
|
|
229
236
|
)) }),
|
|
230
|
-
/* @__PURE__ */ a("div", { className: "hidden overflow-x-auto sm:block", children: /* @__PURE__ */
|
|
231
|
-
/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ a("tr", { className: "border-b border-black/10 text-[0.85em] uppercase tracking-wide text-muted-foreground dark:border-white/10", children: e.map((
|
|
237
|
+
/* @__PURE__ */ a("div", { className: "hidden overflow-x-auto sm:block", children: /* @__PURE__ */ g("table", { className: "w-auto min-w-[50%] text-left", children: [
|
|
238
|
+
/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ a("tr", { className: "border-b border-black/10 text-[0.85em] uppercase tracking-wide text-muted-foreground dark:border-white/10", children: e.map((l, i) => (
|
|
232
239
|
// biome-ignore lint/suspicious/noArrayIndexKey: static content
|
|
233
|
-
/* @__PURE__ */ a("th", { className: "py-1 pr-4 font-medium", children: f(
|
|
240
|
+
/* @__PURE__ */ a("th", { className: "py-1 pr-4 font-medium", children: f(l) }, i)
|
|
234
241
|
)) }) }),
|
|
235
|
-
/* @__PURE__ */ a("tbody", { className: "divide-y divide-black/5 dark:divide-white/10", children:
|
|
242
|
+
/* @__PURE__ */ a("tbody", { className: "divide-y divide-black/5 dark:divide-white/10", children: t.map((l, i) => (
|
|
236
243
|
// biome-ignore lint/suspicious/noArrayIndexKey: static content
|
|
237
|
-
/* @__PURE__ */ a("tr", { className: "align-top", children: e.map((u,
|
|
244
|
+
/* @__PURE__ */ a("tr", { className: "align-top", children: e.map((u, r) => (
|
|
238
245
|
// biome-ignore lint/suspicious/noArrayIndexKey: static content
|
|
239
|
-
/* @__PURE__ */ a("td", { className: "max-w-[28rem] py-1 pr-4", children: f(r
|
|
240
|
-
)) },
|
|
246
|
+
/* @__PURE__ */ a("td", { className: "max-w-[28rem] py-1 pr-4", children: f(l[r] ?? "", s) }, r)
|
|
247
|
+
)) }, i)
|
|
241
248
|
)) })
|
|
242
249
|
] }) })
|
|
243
250
|
] });
|
|
244
251
|
}
|
|
245
252
|
const ee = B(() => import("./AiChart.js").then((e) => ({ default: e.AiChart })));
|
|
246
253
|
function te({ spec: e }) {
|
|
247
|
-
const
|
|
254
|
+
const t = S(M);
|
|
248
255
|
return /* @__PURE__ */ a(
|
|
249
256
|
_,
|
|
250
257
|
{
|
|
@@ -256,86 +263,86 @@ function te({ spec: e }) {
|
|
|
256
263
|
style: { height: e.type === "pie" ? 220 : 200 }
|
|
257
264
|
}
|
|
258
265
|
),
|
|
259
|
-
children: /* @__PURE__ */ a(ee, { spec: e, onPoint:
|
|
266
|
+
children: /* @__PURE__ */ a(ee, { spec: e, onPoint: t })
|
|
260
267
|
}
|
|
261
268
|
);
|
|
262
269
|
}
|
|
263
|
-
function w({ b: e, link:
|
|
270
|
+
function w({ b: e, link: t, gl: s }) {
|
|
264
271
|
switch (e.kind) {
|
|
265
272
|
case "h":
|
|
266
|
-
return /* @__PURE__ */ a("p", { className: b("font-semibold", e.level <= 2 ? "text-[1.05em]" : ""), children: f(e.text,
|
|
273
|
+
return /* @__PURE__ */ a("p", { className: b("font-semibold", e.level <= 2 ? "text-[1.05em]" : ""), children: f(e.text, t, s) });
|
|
267
274
|
case "ul":
|
|
268
|
-
return /* @__PURE__ */ a("ul", { className: "list-disc space-y-0.5 pl-5", children: e.items.map((
|
|
275
|
+
return /* @__PURE__ */ a("ul", { className: "list-disc space-y-0.5 pl-5", children: e.items.map((n, l) => (
|
|
269
276
|
// biome-ignore lint/suspicious/noArrayIndexKey: static content
|
|
270
|
-
/* @__PURE__ */ a("li", { children: f(
|
|
277
|
+
/* @__PURE__ */ a("li", { children: f(n, t, s) }, l)
|
|
271
278
|
)) });
|
|
272
279
|
case "ol":
|
|
273
|
-
return /* @__PURE__ */ a("ol", { className: "list-decimal space-y-0.5 pl-5", children: e.items.map((
|
|
280
|
+
return /* @__PURE__ */ a("ol", { className: "list-decimal space-y-0.5 pl-5", children: e.items.map((n, l) => (
|
|
274
281
|
// biome-ignore lint/suspicious/noArrayIndexKey: static content
|
|
275
|
-
/* @__PURE__ */ a("li", { children: f(
|
|
282
|
+
/* @__PURE__ */ a("li", { children: f(n, t, s) }, l)
|
|
276
283
|
)) });
|
|
277
284
|
case "code":
|
|
278
285
|
return /* @__PURE__ */ a("pre", { className: "overflow-x-auto rounded-md bg-black/[0.05] p-2 font-mono text-[0.9em] dark:bg-white/10", children: e.text });
|
|
279
286
|
case "table":
|
|
280
|
-
return /* @__PURE__ */ a(Z, { header: e.header, rows: e.rows, autolink:
|
|
287
|
+
return /* @__PURE__ */ a(Z, { header: e.header, rows: e.rows, autolink: t });
|
|
281
288
|
case "chart":
|
|
282
289
|
return /* @__PURE__ */ a(te, { spec: e.spec });
|
|
283
290
|
default:
|
|
284
|
-
return /* @__PURE__ */ a("p", { children: f(e.text,
|
|
291
|
+
return /* @__PURE__ */ a("p", { children: f(e.text, t, s) });
|
|
285
292
|
}
|
|
286
293
|
}
|
|
287
294
|
const ne = { table: "Table", chart: "Chart", list: "List" };
|
|
288
|
-
function re({ b: e, link:
|
|
289
|
-
const
|
|
290
|
-
if (
|
|
291
|
-
const
|
|
292
|
-
if (!
|
|
293
|
-
if (
|
|
294
|
-
if (
|
|
295
|
-
const h = H(
|
|
295
|
+
function re({ b: e, link: t, gl: s }) {
|
|
296
|
+
const n = k(() => K(e), [e]), [l, i] = O(n[0]), u = k(() => {
|
|
297
|
+
if (l === n[0]) return e;
|
|
298
|
+
const r = R(e);
|
|
299
|
+
if (!r) return e;
|
|
300
|
+
if (l === "table") return { kind: "table", header: r.header, rows: r.rows };
|
|
301
|
+
if (l === "list") return { kind: "ul", items: F(r) };
|
|
302
|
+
const h = H(r);
|
|
296
303
|
return h ? { kind: "chart", spec: h } : e;
|
|
297
|
-
}, [e,
|
|
298
|
-
return
|
|
299
|
-
/* @__PURE__ */ a("fieldset", { className: "mb-0.5 flex min-w-0 justify-end gap-0.5", "aria-label": "Show as", children:
|
|
304
|
+
}, [e, l, n]);
|
|
305
|
+
return n.length < 2 ? /* @__PURE__ */ a(w, { b: e, link: t, gl: s }) : /* @__PURE__ */ g("div", { "data-ai-switchable": l, children: [
|
|
306
|
+
/* @__PURE__ */ a("fieldset", { className: "mb-0.5 flex min-w-0 justify-end gap-0.5", "aria-label": "Show as", children: n.map((r) => /* @__PURE__ */ a(
|
|
300
307
|
"button",
|
|
301
308
|
{
|
|
302
309
|
type: "button",
|
|
303
|
-
onClick: () =>
|
|
304
|
-
"aria-pressed":
|
|
305
|
-
"data-ai-format":
|
|
310
|
+
onClick: () => i(r),
|
|
311
|
+
"aria-pressed": r === l,
|
|
312
|
+
"data-ai-format": r,
|
|
306
313
|
className: b(
|
|
307
314
|
"rounded px-1.5 py-px text-[10.5px] font-medium transition-colors",
|
|
308
|
-
|
|
315
|
+
r === l ? "bg-accent text-foreground" : "text-muted-foreground hover:bg-muted hover:text-foreground"
|
|
309
316
|
),
|
|
310
|
-
children: ne[
|
|
317
|
+
children: ne[r]
|
|
311
318
|
},
|
|
312
|
-
|
|
319
|
+
r
|
|
313
320
|
)) }),
|
|
314
|
-
/* @__PURE__ */ a(w, { b: u, link:
|
|
321
|
+
/* @__PURE__ */ a(w, { b: u, link: t, gl: s })
|
|
315
322
|
] });
|
|
316
323
|
}
|
|
317
|
-
const M =
|
|
324
|
+
const M = A(void 0);
|
|
318
325
|
function me({
|
|
319
326
|
content: e,
|
|
320
|
-
className:
|
|
327
|
+
className: t,
|
|
321
328
|
autolink: s,
|
|
322
|
-
switchable:
|
|
323
|
-
onChartPoint:
|
|
324
|
-
mirrored:
|
|
329
|
+
switchable: n,
|
|
330
|
+
onChartPoint: l,
|
|
331
|
+
mirrored: i
|
|
325
332
|
}) {
|
|
326
|
-
const u =
|
|
327
|
-
() =>
|
|
328
|
-
[e,
|
|
329
|
-
),
|
|
330
|
-
return /* @__PURE__ */ a(L.Provider, { value: !!
|
|
333
|
+
const u = k(
|
|
334
|
+
() => i ? $(X(e), { charts: !1 }) : $(e),
|
|
335
|
+
[e, i]
|
|
336
|
+
), r = I(), h = i ? !1 : s ?? r != null, o = T(), c = G(), d = o.length ? { terms: o, once: /* @__PURE__ */ new Set(), href: c } : void 0;
|
|
337
|
+
return /* @__PURE__ */ a(L.Provider, { value: !!i, children: /* @__PURE__ */ a(M.Provider, { value: l, children: /* @__PURE__ */ a(
|
|
331
338
|
"div",
|
|
332
339
|
{
|
|
333
340
|
"data-ai-markdown": !0,
|
|
334
|
-
"data-ai-mirrored":
|
|
335
|
-
className: b("space-y-1.5 [&_strong]:font-semibold",
|
|
341
|
+
"data-ai-mirrored": i ? "" : void 0,
|
|
342
|
+
className: b("space-y-1.5 [&_strong]:font-semibold", t),
|
|
336
343
|
children: u.map((x, p) => {
|
|
337
344
|
const m = `${x.kind}-${p}`;
|
|
338
|
-
return
|
|
345
|
+
return n && !i && ie.has(x.kind) ? /* @__PURE__ */ a(re, { b: x, link: h, gl: d }, m) : /* @__PURE__ */ a(w, { b: x, link: h, gl: d }, m);
|
|
339
346
|
})
|
|
340
347
|
}
|
|
341
348
|
) }) });
|
|
@@ -347,7 +354,7 @@ export {
|
|
|
347
354
|
V as inAppHref,
|
|
348
355
|
Q as isSafeAppPath,
|
|
349
356
|
X as mirroredMarkdown,
|
|
350
|
-
|
|
357
|
+
$ as parseAiMarkdown,
|
|
351
358
|
U as parseChartSpec,
|
|
352
359
|
f as renderInline
|
|
353
360
|
};
|