@codesweep-ai/ui 0.2.1-dev.20260830023458.856ea8f
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/LICENSE +202 -0
- package/NOTICE +2 -0
- package/README.md +124 -0
- package/dist/BUILD.json +1 -0
- package/dist/chart.d.ts +3 -0
- package/dist/chart.d.ts.map +1 -0
- package/dist/chart.js +3 -0
- package/dist/code.d.ts +2 -0
- package/dist/code.d.ts.map +1 -0
- package/dist/code.js +2 -0
- package/dist/components/AgentStatus.d.ts +15 -0
- package/dist/components/AgentStatus.d.ts.map +1 -0
- package/dist/components/AgentStatus.js +38 -0
- package/dist/components/AgentTrace.d.ts +42 -0
- package/dist/components/AgentTrace.d.ts.map +1 -0
- package/dist/components/AgentTrace.js +140 -0
- package/dist/components/AppShell.d.ts +29 -0
- package/dist/components/AppShell.d.ts.map +1 -0
- package/dist/components/AppShell.js +71 -0
- package/dist/components/Button.d.ts +10 -0
- package/dist/components/Button.d.ts.map +1 -0
- package/dist/components/Button.js +41 -0
- package/dist/components/Card.d.ts +19 -0
- package/dist/components/Card.d.ts.map +1 -0
- package/dist/components/Card.js +96 -0
- package/dist/components/CardGroup.d.ts +16 -0
- package/dist/components/CardGroup.d.ts.map +1 -0
- package/dist/components/CardGroup.js +33 -0
- package/dist/components/CardGroupContext.d.ts +14 -0
- package/dist/components/CardGroupContext.d.ts.map +1 -0
- package/dist/components/CardGroupContext.js +8 -0
- package/dist/components/ChartFrame.d.ts +30 -0
- package/dist/components/ChartFrame.d.ts.map +1 -0
- package/dist/components/ChartFrame.js +96 -0
- package/dist/components/ChartTooltip.d.ts +22 -0
- package/dist/components/ChartTooltip.d.ts.map +1 -0
- package/dist/components/ChartTooltip.js +26 -0
- package/dist/components/CheckboxGroup.d.ts +37 -0
- package/dist/components/CheckboxGroup.d.ts.map +1 -0
- package/dist/components/CheckboxGroup.js +198 -0
- package/dist/components/Chip.d.ts +9 -0
- package/dist/components/Chip.d.ts.map +1 -0
- package/dist/components/Chip.js +31 -0
- package/dist/components/CodeBlock.d.ts +30 -0
- package/dist/components/CodeBlock.d.ts.map +1 -0
- package/dist/components/CodeBlock.js +112 -0
- package/dist/components/Dropdown.d.ts +28 -0
- package/dist/components/Dropdown.d.ts.map +1 -0
- package/dist/components/Dropdown.js +50 -0
- package/dist/components/EventLanes.d.ts +93 -0
- package/dist/components/EventLanes.d.ts.map +1 -0
- package/dist/components/EventLanes.js +445 -0
- package/dist/components/FormGroup.d.ts +29 -0
- package/dist/components/FormGroup.d.ts.map +1 -0
- package/dist/components/FormGroup.js +48 -0
- package/dist/components/HighlightText.d.ts +15 -0
- package/dist/components/HighlightText.d.ts.map +1 -0
- package/dist/components/HighlightText.js +28 -0
- package/dist/components/Input.d.ts +35 -0
- package/dist/components/Input.d.ts.map +1 -0
- package/dist/components/Input.js +61 -0
- package/dist/components/Legend.d.ts +21 -0
- package/dist/components/Legend.d.ts.map +1 -0
- package/dist/components/Legend.js +61 -0
- package/dist/components/LightweightMarkdown.d.ts +3 -0
- package/dist/components/LightweightMarkdown.d.ts.map +1 -0
- package/dist/components/LightweightMarkdown.js +249 -0
- package/dist/components/MarkdownMinimap.d.ts +7 -0
- package/dist/components/MarkdownMinimap.d.ts.map +1 -0
- package/dist/components/MarkdownMinimap.js +84 -0
- package/dist/components/MarkdownViewer.d.ts +51 -0
- package/dist/components/MarkdownViewer.d.ts.map +1 -0
- package/dist/components/MarkdownViewer.js +455 -0
- package/dist/components/MermaidDiagram.d.ts +11 -0
- package/dist/components/MermaidDiagram.d.ts.map +1 -0
- package/dist/components/MermaidDiagram.js +119 -0
- package/dist/components/Modal.d.ts +13 -0
- package/dist/components/Modal.d.ts.map +1 -0
- package/dist/components/Modal.js +91 -0
- package/dist/components/Panel.d.ts +13 -0
- package/dist/components/Panel.d.ts.map +1 -0
- package/dist/components/Panel.js +44 -0
- package/dist/components/PulseBadge.d.ts +15 -0
- package/dist/components/PulseBadge.d.ts.map +1 -0
- package/dist/components/PulseBadge.js +22 -0
- package/dist/components/RadioGroup.d.ts +20 -0
- package/dist/components/RadioGroup.d.ts.map +1 -0
- package/dist/components/RadioGroup.js +63 -0
- package/dist/components/RichMarkdownRenderer.d.ts +10 -0
- package/dist/components/RichMarkdownRenderer.d.ts.map +1 -0
- package/dist/components/RichMarkdownRenderer.js +18 -0
- package/dist/components/SearchInput.d.ts +25 -0
- package/dist/components/SearchInput.d.ts.map +1 -0
- package/dist/components/SearchInput.js +92 -0
- package/dist/components/SectionedTree.d.ts +36 -0
- package/dist/components/SectionedTree.d.ts.map +1 -0
- package/dist/components/SectionedTree.js +173 -0
- package/dist/components/SegmentedControl.d.ts +16 -0
- package/dist/components/SegmentedControl.d.ts.map +1 -0
- package/dist/components/SegmentedControl.js +48 -0
- package/dist/components/Skeleton.d.ts +8 -0
- package/dist/components/Skeleton.d.ts.map +1 -0
- package/dist/components/Skeleton.js +25 -0
- package/dist/components/SplitPane.d.ts +16 -0
- package/dist/components/SplitPane.d.ts.map +1 -0
- package/dist/components/SplitPane.js +118 -0
- package/dist/components/StatusBadge.d.ts +15 -0
- package/dist/components/StatusBadge.d.ts.map +1 -0
- package/dist/components/StatusBadge.js +40 -0
- package/dist/components/StreamingText.d.ts +20 -0
- package/dist/components/StreamingText.d.ts.map +1 -0
- package/dist/components/StreamingText.js +50 -0
- package/dist/components/Table.d.ts +62 -0
- package/dist/components/Table.d.ts.map +1 -0
- package/dist/components/Table.js +256 -0
- package/dist/components/ThemeToggle.d.ts +11 -0
- package/dist/components/ThemeToggle.d.ts.map +1 -0
- package/dist/components/ThemeToggle.js +55 -0
- package/dist/components/Toast.d.ts +8 -0
- package/dist/components/Toast.d.ts.map +1 -0
- package/dist/components/Toast.js +51 -0
- package/dist/components/ToastContainer.d.ts +5 -0
- package/dist/components/ToastContainer.d.ts.map +1 -0
- package/dist/components/ToastContainer.js +29 -0
- package/dist/components/Tree.d.ts +50 -0
- package/dist/components/Tree.d.ts.map +1 -0
- package/dist/components/Tree.js +528 -0
- package/dist/components/TreeDnd.d.ts +18 -0
- package/dist/components/TreeDnd.d.ts.map +1 -0
- package/dist/components/TreeDnd.js +39 -0
- package/dist/index.d.ts +50 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +35 -0
- package/dist/lib/accentToken.d.ts +3 -0
- package/dist/lib/accentToken.d.ts.map +1 -0
- package/dist/lib/accentToken.js +12 -0
- package/dist/lib/chartTheme.d.ts +45 -0
- package/dist/lib/chartTheme.d.ts.map +1 -0
- package/dist/lib/chartTheme.js +64 -0
- package/dist/lib/cn.d.ts +6 -0
- package/dist/lib/cn.d.ts.map +1 -0
- package/dist/lib/cn.js +11 -0
- package/dist/lib/forwardRefToRoot.d.ts +8 -0
- package/dist/lib/forwardRefToRoot.d.ts.map +1 -0
- package/dist/lib/forwardRefToRoot.js +18 -0
- package/dist/lib/markdownUrl.d.ts +5 -0
- package/dist/lib/markdownUrl.d.ts.map +1 -0
- package/dist/lib/markdownUrl.js +24 -0
- package/dist/lib/toast.d.ts +30 -0
- package/dist/lib/toast.d.ts.map +1 -0
- package/dist/lib/toast.js +34 -0
- package/dist/lib/useTheme.d.ts +22 -0
- package/dist/lib/useTheme.d.ts.map +1 -0
- package/dist/lib/useTheme.js +62 -0
- package/dist/markdown/rich.d.ts +10 -0
- package/dist/markdown/rich.d.ts.map +1 -0
- package/dist/markdown/rich.js +8 -0
- package/dist/markdown.d.ts +3 -0
- package/dist/markdown.d.ts.map +1 -0
- package/dist/markdown.js +2 -0
- package/dist/mermaid.d.ts +2 -0
- package/dist/mermaid.d.ts.map +1 -0
- package/dist/mermaid.js +2 -0
- package/dist/minimap.d.ts +2 -0
- package/dist/minimap.d.ts.map +1 -0
- package/dist/minimap.js +2 -0
- package/dist/styles/base.css +98 -0
- package/dist/styles/components/agent-status.css +52 -0
- package/dist/styles/components/agent-trace.css +206 -0
- package/dist/styles/components/app-shell.css +195 -0
- package/dist/styles/components/button.css +172 -0
- package/dist/styles/components/card-group.css +20 -0
- package/dist/styles/components/card.css +200 -0
- package/dist/styles/components/chart-frame.css +144 -0
- package/dist/styles/components/chart-tooltip.css +54 -0
- package/dist/styles/components/checkbox-group.css +281 -0
- package/dist/styles/components/chip.css +61 -0
- package/dist/styles/components/code-block.css +215 -0
- package/dist/styles/components/dropdown.css +131 -0
- package/dist/styles/components/event-lanes.css +159 -0
- package/dist/styles/components/form-group.css +34 -0
- package/dist/styles/components/highlight-text.css +17 -0
- package/dist/styles/components/input.css +168 -0
- package/dist/styles/components/legend.css +80 -0
- package/dist/styles/components/markdown-minimap.css +13 -0
- package/dist/styles/components/markdown-viewer.css +354 -0
- package/dist/styles/components/mermaid-diagram.css +8 -0
- package/dist/styles/components/modal.css +167 -0
- package/dist/styles/components/panel.css +126 -0
- package/dist/styles/components/pulse-badge.css +56 -0
- package/dist/styles/components/radio-group.css +89 -0
- package/dist/styles/components/search-input.css +153 -0
- package/dist/styles/components/sectioned-tree.css +183 -0
- package/dist/styles/components/segmented-control.css +54 -0
- package/dist/styles/components/skeleton.css +21 -0
- package/dist/styles/components/split-pane.css +78 -0
- package/dist/styles/components/status-badge.css +94 -0
- package/dist/styles/components/streaming-text.css +38 -0
- package/dist/styles/components/table.css +235 -0
- package/dist/styles/components/theme-toggle.css +123 -0
- package/dist/styles/components/toast-container.css +34 -0
- package/dist/styles/components/toast.css +169 -0
- package/dist/styles/components/tree.css +375 -0
- package/dist/styles/components.css +37 -0
- package/dist/styles/core.css +3 -0
- package/dist/styles/markdown-content.css +368 -0
- package/dist/styles/print.css +55 -0
- package/dist/styles/reset.css +202 -0
- package/dist/styles/syntax.css +62 -0
- package/dist/styles/tokens.css +344 -0
- package/dist/styles/utilities.css +7 -0
- package/dist/testing/index.d.ts +39 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +119 -0
- package/package.json +138 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accentToken.d.ts","sourceRoot":"","sources":["../../src/lib/accentToken.ts"],"names":[],"mappings":"AAIA,wBAAgB,oBAAoB,CAAC,MAAM,SAAK,GAAG,MAAM,CAExD;AAED,wBAAgB,WAAW,CAAC,MAAM,SAAK,GAAG,MAAM,CAE/C"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
//#region src/lib/accentToken.ts
|
|
4
|
+
var e = "--color-accent";
|
|
5
|
+
function t(t = "") {
|
|
6
|
+
return `${e}${t}`;
|
|
7
|
+
}
|
|
8
|
+
function n(e = "") {
|
|
9
|
+
return `var(${t(e)})`;
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { t as accentCustomProperty, n as accentToken };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export interface ChartTheme {
|
|
2
|
+
bg: string;
|
|
3
|
+
card: string;
|
|
4
|
+
border: string;
|
|
5
|
+
gridLine: string;
|
|
6
|
+
fg: string;
|
|
7
|
+
muted: string;
|
|
8
|
+
axisLabel: string;
|
|
9
|
+
accent: string;
|
|
10
|
+
accentSoft: string;
|
|
11
|
+
success: string;
|
|
12
|
+
warning: string;
|
|
13
|
+
error: string;
|
|
14
|
+
categorical: string[];
|
|
15
|
+
categoricalLight: string[];
|
|
16
|
+
categoricalMid: string[];
|
|
17
|
+
categoricalDark: string[];
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Resolve the current theme's chart colors as concrete JS values (d3 and most
|
|
21
|
+
* chart libraries want resolved values, not CSS custom properties). Re-reads
|
|
22
|
+
* the CSS variables whenever the resolved theme flips, so charts restyle on
|
|
23
|
+
* light/dark toggle. See patterns/Chart.md.
|
|
24
|
+
*/
|
|
25
|
+
export declare function useChartTheme(): ChartTheme;
|
|
26
|
+
/** Minimal structural shape of a d3 selection — keeps this lib d3-free. */
|
|
27
|
+
interface StylableSelection {
|
|
28
|
+
style: (prop: string, value: string) => StylableSelection;
|
|
29
|
+
}
|
|
30
|
+
interface AxisSelection {
|
|
31
|
+
selectAll: (selector: string) => StylableSelection;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Style a d3 axis selection with theme-driven colors. Kept loosely typed so
|
|
35
|
+
* this library doesn't take a hard dependency on d3.
|
|
36
|
+
*/
|
|
37
|
+
export declare function styleAxis(selection: AxisSelection, theme: ChartTheme): void;
|
|
38
|
+
/**
|
|
39
|
+
* Stable color assignment by key. Keys are sorted before assignment so the
|
|
40
|
+
* same series name ("auth") always maps to the same categorical color across
|
|
41
|
+
* different pages, regardless of arrival order.
|
|
42
|
+
*/
|
|
43
|
+
export declare function assignSeriesColors(keys: string[], theme: ChartTheme): Record<string, string>;
|
|
44
|
+
export {};
|
|
45
|
+
//# sourceMappingURL=chartTheme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chartTheme.d.ts","sourceRoot":"","sources":["../../src/lib/chartTheme.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B;AA2CD;;;;;GAKG;AACH,wBAAgB,aAAa,IAAI,UAAU,CAO1C;AAED,2EAA2E;AAC3E,UAAU,iBAAiB;IACzB,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,iBAAiB,CAAC;CAC3D;AACD,UAAU,aAAa;IACrB,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,iBAAiB,CAAC;CACpD;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,SAAS,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,GAAG,IAAI,CAO3E;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EAAE,EACd,KAAK,EAAE,UAAU,GAChB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAQxB"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
import { accentCustomProperty as e } from "./accentToken.js";
|
|
4
|
+
import { useTheme as t } from "./useTheme.js";
|
|
5
|
+
import { useEffect as n, useState as r } from "react";
|
|
6
|
+
//#region src/lib/chartTheme.ts
|
|
7
|
+
var i = 10;
|
|
8
|
+
function a() {
|
|
9
|
+
if (typeof document > "u" || !document.documentElement) {
|
|
10
|
+
let e = Array.from({ length: i }, () => "");
|
|
11
|
+
return {
|
|
12
|
+
bg: "",
|
|
13
|
+
card: "",
|
|
14
|
+
border: "",
|
|
15
|
+
gridLine: "",
|
|
16
|
+
fg: "",
|
|
17
|
+
muted: "",
|
|
18
|
+
axisLabel: "",
|
|
19
|
+
accent: "",
|
|
20
|
+
accentSoft: "",
|
|
21
|
+
success: "",
|
|
22
|
+
warning: "",
|
|
23
|
+
error: "",
|
|
24
|
+
categorical: e,
|
|
25
|
+
categoricalLight: [...e],
|
|
26
|
+
categoricalMid: [...e],
|
|
27
|
+
categoricalDark: [...e]
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
let t = getComputedStyle(document.documentElement), n = (e) => t.getPropertyValue(e).trim(), r = (e = "") => Array.from({ length: i }, (t, r) => n(`--color-cat-${r + 1}${e}`));
|
|
31
|
+
return {
|
|
32
|
+
bg: n("--bg"),
|
|
33
|
+
card: n("--card"),
|
|
34
|
+
border: n("--border"),
|
|
35
|
+
gridLine: n("--border"),
|
|
36
|
+
fg: n("--fg"),
|
|
37
|
+
muted: n("--muted"),
|
|
38
|
+
axisLabel: n("--muted"),
|
|
39
|
+
accent: n(e()),
|
|
40
|
+
accentSoft: n(e("-bg-strong")),
|
|
41
|
+
success: n("--color-success"),
|
|
42
|
+
warning: n("--color-warning"),
|
|
43
|
+
error: n("--color-error"),
|
|
44
|
+
categorical: r(),
|
|
45
|
+
categoricalLight: r("-light"),
|
|
46
|
+
categoricalMid: r("-mid"),
|
|
47
|
+
categoricalDark: r("-dark")
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function o() {
|
|
51
|
+
let { resolved: e } = t(), [i, o] = r(a);
|
|
52
|
+
return n(() => {
|
|
53
|
+
o(a());
|
|
54
|
+
}, [e]), i;
|
|
55
|
+
}
|
|
56
|
+
function s(e, t) {
|
|
57
|
+
e.selectAll("text").style("fill", t.axisLabel).style("font-family", "var(--font-family-mono)").style("font-size", "var(--font-size-chart-axis)"), e.selectAll("line, path").style("stroke", t.gridLine);
|
|
58
|
+
}
|
|
59
|
+
function c(e, t) {
|
|
60
|
+
let n = [...e].sort();
|
|
61
|
+
return Object.fromEntries(n.map((e, n) => [e, t.categorical[n % t.categorical.length]]));
|
|
62
|
+
}
|
|
63
|
+
//#endregion
|
|
64
|
+
export { c as assignSeriesColors, s as styleAxis, o as useChartTheme };
|
package/dist/lib/cn.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cn.d.ts","sourceRoot":"","sources":["../../src/lib/cn.ts"],"names":[],"mappings":"AAAA,KAAK,UAAU,GACX,MAAM,GACN,MAAM,GACN,KAAK,GACL,IAAI,GACJ,SAAS,GACT,UAAU,EAAE,GACZ;IAAE,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,CAAC;AAErC,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAgBzC"}
|
package/dist/lib/cn.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/lib/cn.ts
|
|
2
|
+
function e(...e) {
|
|
3
|
+
let t = [], n = (e) => {
|
|
4
|
+
if (e) if (typeof e == "string" || typeof e == "number") t.push(String(e));
|
|
5
|
+
else if (Array.isArray(e)) e.forEach(n);
|
|
6
|
+
else for (let [n, r] of Object.entries(e)) r && t.push(n);
|
|
7
|
+
};
|
|
8
|
+
return e.forEach(n), t.join(" ");
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { e as cn };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Preserve an existing component's render function while forwarding a ref to
|
|
4
|
+
* the DOM element it returns. Components passed here must return one root DOM
|
|
5
|
+
* element (or null) on every branch.
|
|
6
|
+
*/
|
|
7
|
+
export declare function forwardRefToRoot<T, P>(render: (props: P) => ReactNode): import("react").ForwardRefExoticComponent<import("react").PropsWithoutRef<P> & import("react").RefAttributes<T>>;
|
|
8
|
+
//# sourceMappingURL=forwardRefToRoot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forwardRefToRoot.d.ts","sourceRoot":"","sources":["../../src/lib/forwardRefToRoot.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AASf;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,SAAS,oHAcrE"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { cloneElement as e, forwardRef as t, isValidElement as n } from "react";
|
|
2
|
+
//#region src/lib/forwardRefToRoot.tsx
|
|
3
|
+
function r(e, t) {
|
|
4
|
+
typeof e == "function" ? e(t) : e && (e.current = t);
|
|
5
|
+
}
|
|
6
|
+
function i(i) {
|
|
7
|
+
let a = t((t, a) => {
|
|
8
|
+
let o = i(t);
|
|
9
|
+
if (!n(o) || a == null) return o;
|
|
10
|
+
let s = o.ref;
|
|
11
|
+
return e(o, { ref: (e) => {
|
|
12
|
+
r(s, e), r(a, e);
|
|
13
|
+
} });
|
|
14
|
+
});
|
|
15
|
+
return a.displayName = i.name.replace(/Impl$/, ""), a;
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { i as forwardRefToRoot };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Keep relative URLs and the documented network/message schemes. */
|
|
2
|
+
export declare function sanitizeMarkdownUrl(url: string): string;
|
|
3
|
+
/** Turn raw HTML openers into markdown text before any parser/plugin sees it. */
|
|
4
|
+
export declare function escapeMarkdownHtml(source: string): string;
|
|
5
|
+
//# sourceMappingURL=markdownUrl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdownUrl.d.ts","sourceRoot":"","sources":["../../src/lib/markdownUrl.ts"],"names":[],"mappings":"AASA,qEAAqE;AACrE,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,UAW9C;AAED,iFAAiF;AACjF,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,UAEhD"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//#region src/lib/markdownUrl.ts
|
|
2
|
+
var e = new Set([
|
|
3
|
+
"http",
|
|
4
|
+
"https",
|
|
5
|
+
"irc",
|
|
6
|
+
"ircs",
|
|
7
|
+
"mailto",
|
|
8
|
+
"xmpp"
|
|
9
|
+
]);
|
|
10
|
+
function t(t) {
|
|
11
|
+
let n = t.trim();
|
|
12
|
+
if (/[\u0000-\u001f\u007f]/.test(n)) return "";
|
|
13
|
+
let r = n.indexOf(":"), i = n.search(/[/?#]/);
|
|
14
|
+
if (r >= 0 && (i < 0 || r < i)) {
|
|
15
|
+
let t = n.slice(0, r);
|
|
16
|
+
if (!/^[a-z][a-z\d+.-]*$/i.test(t) || !e.has(t.toLowerCase())) return "";
|
|
17
|
+
}
|
|
18
|
+
return n;
|
|
19
|
+
}
|
|
20
|
+
function n(e) {
|
|
21
|
+
return e.replace(/<(?=\/?[a-z]|[!?])/gi, "<");
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { n as escapeMarkdownHtml, t as sanitizeMarkdownUrl };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export type ToastVariant = "success" | "warning" | "error" | "info";
|
|
2
|
+
export interface ToastOptions {
|
|
3
|
+
/** ms before auto-dismiss; pass `null` to disable. Default 4000. */
|
|
4
|
+
duration?: number | null;
|
|
5
|
+
/** When true: render with `role="alert"` and don't auto-dismiss. */
|
|
6
|
+
important?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface ToastItem {
|
|
9
|
+
id: string;
|
|
10
|
+
variant: ToastVariant;
|
|
11
|
+
message: string;
|
|
12
|
+
/** Effective duration after applying `important` (which forces null). */
|
|
13
|
+
duration: number | null;
|
|
14
|
+
important: boolean;
|
|
15
|
+
}
|
|
16
|
+
type Listener = (toasts: ToastItem[]) => void;
|
|
17
|
+
export declare const toast: {
|
|
18
|
+
success: (message: string, opts?: ToastOptions) => string;
|
|
19
|
+
warning: (message: string, opts?: ToastOptions) => string;
|
|
20
|
+
error: (message: string, opts?: ToastOptions) => string;
|
|
21
|
+
info: (message: string, opts?: ToastOptions) => string;
|
|
22
|
+
/** Dismiss a single toast by id. */
|
|
23
|
+
dismiss: (id: string) => void;
|
|
24
|
+
/** Clear all toasts. */
|
|
25
|
+
clear: () => void;
|
|
26
|
+
};
|
|
27
|
+
/** Subscribe to toast updates. Calls back immediately with the current list. */
|
|
28
|
+
export declare function subscribeToasts(listener: Listener): () => void;
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=toast.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast.d.ts","sourceRoot":"","sources":["../../src/lib/toast.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAEpE,MAAM,WAAW,YAAY;IAC3B,oEAAoE;IACpE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,oEAAoE;IACpE,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,YAAY,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,yEAAyE;IACzE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,KAAK,QAAQ,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,IAAI,CAAC;AA0B9C,eAAO,MAAM,KAAK;uBACG,MAAM,SAAS,YAAY;uBAC3B,MAAM,SAAS,YAAY;qBAC7B,MAAM,SAAS,YAAY;oBAC5B,MAAM,SAAS,YAAY;IAC3C,oCAAoC;kBACtB,MAAM,KAAG,IAAI;IAI3B,wBAAwB;iBACb,IAAI;CAIhB,CAAC;AAEF,gFAAgF;AAChF,wBAAgB,eAAe,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,IAAI,CAM9D"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
//#region src/lib/toast.ts
|
|
2
|
+
var e = 4e3, t = /* @__PURE__ */ new Set(), n = [], r = 0, i = () => `cs-toast-${++r}`;
|
|
3
|
+
function a() {
|
|
4
|
+
for (let e of t) e(n);
|
|
5
|
+
}
|
|
6
|
+
function o(t, r, o = {}) {
|
|
7
|
+
let s = i(), c = !!o.important, l = c || o.duration === null ? null : o.duration ?? e;
|
|
8
|
+
return n = [...n, {
|
|
9
|
+
id: s,
|
|
10
|
+
variant: t,
|
|
11
|
+
message: r,
|
|
12
|
+
duration: l,
|
|
13
|
+
important: c
|
|
14
|
+
}], a(), s;
|
|
15
|
+
}
|
|
16
|
+
var s = {
|
|
17
|
+
success: (e, t) => o("success", e, t),
|
|
18
|
+
warning: (e, t) => o("warning", e, t),
|
|
19
|
+
error: (e, t) => o("error", e, t),
|
|
20
|
+
info: (e, t) => o("info", e, t),
|
|
21
|
+
dismiss: (e) => {
|
|
22
|
+
n = n.filter((t) => t.id !== e), a();
|
|
23
|
+
},
|
|
24
|
+
clear: () => {
|
|
25
|
+
n = [], a();
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
function c(e) {
|
|
29
|
+
return t.add(e), e(n), () => {
|
|
30
|
+
t.delete(e);
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
export { c as subscribeToasts, s as toast };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
type ThemeMode = "light" | "dark" | "system";
|
|
2
|
+
type ResolvedTheme = "light" | "dark";
|
|
3
|
+
export interface UseThemeOptions {
|
|
4
|
+
/** localStorage key the chosen mode persists under. */
|
|
5
|
+
storageKey?: string;
|
|
6
|
+
/** Query parameter that overrides the mode for this load only (never saved); `false` disables it. */
|
|
7
|
+
urlParam?: string | false;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Return a synchronous, dependency-free boot script that applies the same
|
|
11
|
+
* URL → stored mode → system preference resolution as `useTheme` before React
|
|
12
|
+
* mounts. Insert the returned string in an inline script in the document head.
|
|
13
|
+
*/
|
|
14
|
+
export declare function themeBootScript(options?: UseThemeOptions): string;
|
|
15
|
+
export declare function useTheme(options?: UseThemeOptions): {
|
|
16
|
+
mode: ThemeMode;
|
|
17
|
+
resolved: ResolvedTheme;
|
|
18
|
+
setMode: (newMode: ThemeMode) => void;
|
|
19
|
+
cycle: () => void;
|
|
20
|
+
};
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=useTheme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../src/lib/useTheme.ts"],"names":[],"mappings":"AAIA,KAAK,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;AAC7C,KAAK,aAAa,GAAG,OAAO,GAAG,MAAM,CAAC;AAEtC,MAAM,WAAW,eAAe;IAC9B,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qGAAqG;IACrG,QAAQ,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;CAC3B;AA2CD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,OAAO,GAAE,eAAoB,GAAG,MAAM,CAOrE;AAED,wBAAgB,QAAQ,CAAC,OAAO,GAAE,eAAoB;;;uBAQd,SAAS;;EA8BhD"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
import { useCallback as e, useEffect as t, useState as n } from "react";
|
|
4
|
+
//#region src/lib/useTheme.ts
|
|
5
|
+
var r = "cs-theme", i = "theme";
|
|
6
|
+
function a(e) {
|
|
7
|
+
return e === "light" || e === "dark" || e === "system";
|
|
8
|
+
}
|
|
9
|
+
function o(e) {
|
|
10
|
+
if (!e || typeof window > "u") return null;
|
|
11
|
+
try {
|
|
12
|
+
let t = new URLSearchParams(window.location.search).get(e);
|
|
13
|
+
return a(t) ? t : null;
|
|
14
|
+
} catch {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function s() {
|
|
19
|
+
return typeof window > "u" || window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
20
|
+
}
|
|
21
|
+
function c(e) {
|
|
22
|
+
return e === "system" ? s() : e;
|
|
23
|
+
}
|
|
24
|
+
function l(e) {
|
|
25
|
+
document.documentElement.setAttribute("data-theme", e);
|
|
26
|
+
}
|
|
27
|
+
function u(e) {
|
|
28
|
+
try {
|
|
29
|
+
let t = localStorage.getItem(e);
|
|
30
|
+
if (a(t)) return t;
|
|
31
|
+
} catch {}
|
|
32
|
+
return "system";
|
|
33
|
+
}
|
|
34
|
+
function d(e = {}) {
|
|
35
|
+
return `(()=>{const k=${JSON.stringify(e.storageKey ?? r).replace(/</g, "\\u003c")},p=${e.urlParam === !1 ? "null" : JSON.stringify(e.urlParam ?? i).replace(/</g, "\\u003c")},ok=v=>v==="light"||v==="dark"||v==="system";let m=null;if(p){try{const q=new URLSearchParams(location.search).get(p);if(ok(q))m=q}catch{}}if(!m){try{const s=localStorage.getItem(k);if(ok(s))m=s}catch{}}if(!m)m="system";const r=m==="system"?(matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"):m;document.documentElement.setAttribute("data-theme",r)})();`;
|
|
36
|
+
}
|
|
37
|
+
function f(a = {}) {
|
|
38
|
+
let d = a.storageKey ?? r, f = a.urlParam ?? i, [p, m] = n(() => o(f) ?? u(d)), h = c(p), g = e((e) => {
|
|
39
|
+
m(e);
|
|
40
|
+
try {
|
|
41
|
+
localStorage.setItem(d, e);
|
|
42
|
+
} catch {}
|
|
43
|
+
l(c(e));
|
|
44
|
+
}, [d]), _ = e(() => {
|
|
45
|
+
g(p === "system" ? "light" : p === "light" ? "dark" : "system");
|
|
46
|
+
}, [p, g]);
|
|
47
|
+
return t(() => {
|
|
48
|
+
l(h);
|
|
49
|
+
}, [h]), t(() => {
|
|
50
|
+
let e = window.matchMedia("(prefers-color-scheme: dark)"), t = () => {
|
|
51
|
+
p === "system" && l(s());
|
|
52
|
+
};
|
|
53
|
+
return e.addEventListener("change", t), () => e.removeEventListener("change", t);
|
|
54
|
+
}, [p]), {
|
|
55
|
+
mode: p,
|
|
56
|
+
resolved: h,
|
|
57
|
+
setMode: g,
|
|
58
|
+
cycle: _
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
//#endregion
|
|
62
|
+
export { d as themeBootScript, f as useTheme };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type MarkdownViewerBaseProps } from "../components/MarkdownViewer";
|
|
2
|
+
import { type RichMarkdownOptions } from "../components/RichMarkdownRenderer";
|
|
3
|
+
export interface MarkdownViewerProps extends MarkdownViewerBaseProps, RichMarkdownOptions {
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Full CommonMark + GFM viewer with the remark/rehype plugin seam. Importing
|
|
7
|
+
* this entry is the build-time opt-in to the heavier parser pipeline.
|
|
8
|
+
*/
|
|
9
|
+
export declare const MarkdownViewer: import("react").ForwardRefExoticComponent<MarkdownViewerBaseProps & RichMarkdownOptions & import("react").RefAttributes<HTMLDivElement>>;
|
|
10
|
+
//# sourceMappingURL=rich.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rich.d.ts","sourceRoot":"","sources":["../../src/markdown/rich.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,oCAAoC,CAAC;AAE5C,MAAM,WAAW,mBACf,SAAQ,uBAAuB,EAC7B,mBAAmB;CAAG;AAE1B;;;GAGG;AACH,eAAO,MAAM,cAAc,0IAE1B,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
import { createMarkdownViewer as e } from "../components/MarkdownViewer.js";
|
|
4
|
+
import { RichMarkdownRenderer as t } from "../components/RichMarkdownRenderer.js";
|
|
5
|
+
//#region src/markdown/rich.ts
|
|
6
|
+
var n = e(t);
|
|
7
|
+
//#endregion
|
|
8
|
+
export { n as MarkdownViewer };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../src/markdown.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,YAAY,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC"}
|
package/dist/markdown.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mermaid.d.ts","sourceRoot":"","sources":["../src/mermaid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC"}
|
package/dist/mermaid.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"minimap.d.ts","sourceRoot":"","sources":["../src/minimap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC"}
|
package/dist/minimap.js
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
@import "./reset.css";
|
|
2
|
+
|
|
3
|
+
*,
|
|
4
|
+
*::before,
|
|
5
|
+
*::after {
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
margin: 0;
|
|
8
|
+
padding: 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
html,
|
|
12
|
+
body,
|
|
13
|
+
#root {
|
|
14
|
+
height: 100%;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
:root[data-theme="dark"] {
|
|
18
|
+
color-scheme: dark;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
:root[data-theme="light"] {
|
|
22
|
+
color-scheme: light;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
body {
|
|
26
|
+
font-family: var(--font-family-sans);
|
|
27
|
+
font-size: var(--font-size-sm);
|
|
28
|
+
line-height: var(--line-height-normal);
|
|
29
|
+
color: var(--fg);
|
|
30
|
+
background: var(--bg);
|
|
31
|
+
-webkit-font-smoothing: antialiased;
|
|
32
|
+
-moz-osx-font-smoothing: grayscale;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* Scrollbar */
|
|
36
|
+
::-webkit-scrollbar {
|
|
37
|
+
width: 8px;
|
|
38
|
+
height: 8px;
|
|
39
|
+
}
|
|
40
|
+
::-webkit-scrollbar-track {
|
|
41
|
+
background: transparent;
|
|
42
|
+
}
|
|
43
|
+
::-webkit-scrollbar-thumb {
|
|
44
|
+
background: var(--border);
|
|
45
|
+
border-radius: var(--radius-sm);
|
|
46
|
+
}
|
|
47
|
+
::-webkit-scrollbar-thumb:hover {
|
|
48
|
+
background: var(--muted);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* Prose — long-form / generated content. Apply to a container to restyle its
|
|
52
|
+
descendants with the prose type ramp (larger than app chrome). MarkdownViewer
|
|
53
|
+
has its own richer CSS (markdown-content.css) driven by the same tokens. */
|
|
54
|
+
.prose {
|
|
55
|
+
max-width: var(--max-width-prose);
|
|
56
|
+
font-size: var(--font-size-prose-body);
|
|
57
|
+
line-height: var(--line-height-prose);
|
|
58
|
+
color: var(--fg);
|
|
59
|
+
}
|
|
60
|
+
.prose h1,
|
|
61
|
+
.prose h2,
|
|
62
|
+
.prose h3,
|
|
63
|
+
.prose h4 {
|
|
64
|
+
font-weight: var(--font-weight-semibold);
|
|
65
|
+
line-height: var(--line-height-tight);
|
|
66
|
+
margin: var(--space-6) 0 var(--space-3);
|
|
67
|
+
}
|
|
68
|
+
.prose > :first-child {
|
|
69
|
+
margin-top: 0;
|
|
70
|
+
}
|
|
71
|
+
.prose h1 {
|
|
72
|
+
font-size: var(--font-size-prose-h1);
|
|
73
|
+
}
|
|
74
|
+
.prose h2 {
|
|
75
|
+
font-size: var(--font-size-prose-h2);
|
|
76
|
+
}
|
|
77
|
+
.prose h3 {
|
|
78
|
+
font-size: var(--font-size-prose-h3);
|
|
79
|
+
}
|
|
80
|
+
.prose h4 {
|
|
81
|
+
font-size: var(--font-size-prose-h4);
|
|
82
|
+
}
|
|
83
|
+
.prose p,
|
|
84
|
+
.prose ul,
|
|
85
|
+
.prose ol {
|
|
86
|
+
margin: 0 0 var(--space-4);
|
|
87
|
+
}
|
|
88
|
+
.prose ul,
|
|
89
|
+
.prose ol {
|
|
90
|
+
padding-left: var(--space-6);
|
|
91
|
+
}
|
|
92
|
+
.prose small {
|
|
93
|
+
font-size: var(--font-size-prose-small);
|
|
94
|
+
}
|
|
95
|
+
.prose pre,
|
|
96
|
+
.prose code {
|
|
97
|
+
font-family: var(--font-family-mono);
|
|
98
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
@import "./pulse-badge.css";
|
|
2
|
+
|
|
3
|
+
/* agent-status component styles. */
|
|
4
|
+
.cs-component-agent-status-21 {
|
|
5
|
+
display: inline-flex
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.cs-component-agent-status-16 {
|
|
9
|
+
height: var(--icon-size-sm)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.cs-component-agent-status-16 {
|
|
13
|
+
width: var(--icon-size-sm)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.cs-component-agent-status-16 {
|
|
17
|
+
flex-shrink: 0
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.cs-component-agent-status-21 {
|
|
21
|
+
align-items: center
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.cs-component-agent-status-21 {
|
|
25
|
+
gap: var(--space-2)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.cs-component-agent-status-23 {
|
|
29
|
+
overflow: hidden;
|
|
30
|
+
text-overflow: ellipsis;
|
|
31
|
+
white-space: nowrap
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.cs-component-agent-status-13 {
|
|
35
|
+
color: var(--color-error)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.cs-component-agent-status-12 {
|
|
39
|
+
color: var(--color-success)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.cs-component-agent-status-11 {
|
|
43
|
+
color: var(--color-warning)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.cs-component-agent-status-22 {
|
|
47
|
+
color: var(--fg)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.cs-component-agent-status-22 {
|
|
51
|
+
font-size: var(--font-size-sm)
|
|
52
|
+
}
|