@logicplanes/kaeso-ui 0.4.3 → 0.4.4
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/ai/component-guides.md +30 -1
- package/ai/component-registry.json +89 -1
- package/ai/component-registry.md +20 -2
- package/ai/icons.md +2 -2
- package/ai/tokens.md +1 -1
- package/dist/chunks/{code-block-D5A-CGXG.js → code-block-BZIe_B9l.js} +40 -36
- package/dist/chunks/code-block-BZIe_B9l.js.map +1 -0
- package/dist/chunks/code-block-DdNPHEzI.js +344 -0
- package/dist/chunks/code-block-DdNPHEzI.js.map +1 -0
- package/dist/chunks/{de-CPXJh9cq.js → de-D_0mmG-k.js} +8 -1
- package/dist/chunks/de-D_0mmG-k.js.map +1 -0
- package/dist/chunks/icon-CPJWE2N-.js +95 -0
- package/dist/chunks/{icon-DVooQfk4.js.map → icon-CPJWE2N-.js.map} +1 -1
- package/dist/chunks/{markdown-DULktoTK.js → markdown-BupwFOae.js} +2 -2
- package/dist/chunks/{markdown-DULktoTK.js.map → markdown-BupwFOae.js.map} +1 -1
- package/dist/chunks/{zh-CN-29X4CDLE.js → zh-CN-Bm6UPIbW.js} +8 -1
- package/dist/chunks/zh-CN-Bm6UPIbW.js.map +1 -0
- package/dist/components/code-block.js +3 -2
- package/dist/components/icon.js +1 -1
- package/dist/components/kaeso/conversation.js +1 -1
- package/dist/components/kaeso/moments.js +1 -1
- package/dist/components/markdown.js +1 -1
- package/dist/components/playground.js +1 -1
- package/dist/i18n-provider.js +1 -1
- package/dist/index.js +36 -36
- package/dist/styles.css +1 -1
- package/dist/types/components/code-block/diff-view.d.ts +30 -0
- package/dist/types/components/code-block/diff.d.ts +26 -0
- package/dist/types/components/code-block/docs.d.ts +14 -0
- package/dist/types/components/code-block/index.d.ts +1 -0
- package/dist/types/icons/groups.d.ts +1 -1
- package/dist/types/icons/vocabulary.d.ts +5 -0
- package/package.json +2 -2
- package/dist/chunks/code-block-D5A-CGXG.js.map +0 -1
- package/dist/chunks/de-CPXJh9cq.js.map +0 -1
- package/dist/chunks/icon-DVooQfk4.js +0 -94
- package/dist/chunks/zh-CN-29X4CDLE.js.map +0 -1
package/ai/component-guides.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @logicplanes/kaeso-ui component guides
|
|
2
2
|
|
|
3
|
-
Version 0.4.
|
|
3
|
+
Version 0.4.4. Generated from the showcase's demo modules (apps/showcase/src/demos); do not edit. For each component: what it is for, its import, keyboard, accessibility, do and don't, and every example's code. Props and variants: `component-registry.md`.
|
|
4
4
|
|
|
5
5
|
## AgentAttribution
|
|
6
6
|
|
|
@@ -1686,6 +1686,35 @@ function CreateKey() {
|
|
|
1686
1686
|
}
|
|
1687
1687
|
```
|
|
1688
1688
|
|
|
1689
|
+
## DiffView
|
|
1690
|
+
|
|
1691
|
+
Two versions in one column: removed lines on red, added on green, changed words marked, unchanged runs folded.
|
|
1692
|
+
|
|
1693
|
+
`import { DiffView } from "@logicplanes/kaeso-ui";`
|
|
1694
|
+
|
|
1695
|
+
### Accessibility
|
|
1696
|
+
|
|
1697
|
+
- Each changed line starts with “Added” or “Removed” for screen readers; the + and − marks and the colour are only for sight.
|
|
1698
|
+
- The title bar says how many lines were added and removed, and each folded run is a button that names how many lines it shows.
|
|
1699
|
+
|
|
1700
|
+
### Examples
|
|
1701
|
+
|
|
1702
|
+
#### An audit event
|
|
1703
|
+
|
|
1704
|
+
```tsx
|
|
1705
|
+
<div className="w-560 max-w-full">
|
|
1706
|
+
<DiffView title="Before → after" lang="json" before={json(credential)} after={json(moved)} wrap />
|
|
1707
|
+
</div>
|
|
1708
|
+
```
|
|
1709
|
+
|
|
1710
|
+
#### With line numbers
|
|
1711
|
+
|
|
1712
|
+
```tsx
|
|
1713
|
+
<div className="w-560 max-w-full">
|
|
1714
|
+
<DiffView title="limit.json" lang="json" before={json(limit)} after={json(raised)} lineNumbers />
|
|
1715
|
+
</div>
|
|
1716
|
+
```
|
|
1717
|
+
|
|
1689
1718
|
## DisplayOptions
|
|
1690
1719
|
|
|
1691
1720
|
View, grouping and ordering, toggles, and the properties to show, behind one circle at the end of a toolbar.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"package": "@logicplanes/kaeso-ui",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"components": [
|
|
5
5
|
{
|
|
6
6
|
"entry": "agent-avatar",
|
|
@@ -2485,6 +2485,83 @@
|
|
|
2485
2485
|
],
|
|
2486
2486
|
"file": "src/components/code-block/code-block.tsx"
|
|
2487
2487
|
},
|
|
2488
|
+
{
|
|
2489
|
+
"name": "DiffView",
|
|
2490
|
+
"description": "Two versions of a text side by side in one column: removed lines on red, added lines on green, the changed words inside them marked, syntax highlighted, and long unchanged runs folded away.",
|
|
2491
|
+
"props": [
|
|
2492
|
+
{
|
|
2493
|
+
"name": "after",
|
|
2494
|
+
"type": "string",
|
|
2495
|
+
"required": true,
|
|
2496
|
+
"default": null,
|
|
2497
|
+
"description": "The new version."
|
|
2498
|
+
},
|
|
2499
|
+
{
|
|
2500
|
+
"name": "before",
|
|
2501
|
+
"type": "string",
|
|
2502
|
+
"required": true,
|
|
2503
|
+
"default": null,
|
|
2504
|
+
"description": "The old version."
|
|
2505
|
+
},
|
|
2506
|
+
{
|
|
2507
|
+
"name": "className",
|
|
2508
|
+
"type": "string",
|
|
2509
|
+
"required": false,
|
|
2510
|
+
"default": null,
|
|
2511
|
+
"description": "Classes for the layout of the outer element: margin, width and placement, never its look."
|
|
2512
|
+
},
|
|
2513
|
+
{
|
|
2514
|
+
"name": "context",
|
|
2515
|
+
"type": "number",
|
|
2516
|
+
"required": false,
|
|
2517
|
+
"default": "3",
|
|
2518
|
+
"description": "Unchanged lines kept around each change before the rest folds (3 by default)."
|
|
2519
|
+
},
|
|
2520
|
+
{
|
|
2521
|
+
"name": "copy",
|
|
2522
|
+
"type": "boolean",
|
|
2523
|
+
"required": false,
|
|
2524
|
+
"default": "true",
|
|
2525
|
+
"description": "Hide the copy circle, which copies the diff with + and - markers."
|
|
2526
|
+
},
|
|
2527
|
+
{
|
|
2528
|
+
"name": "lang",
|
|
2529
|
+
"type": "CodeLang",
|
|
2530
|
+
"required": false,
|
|
2531
|
+
"default": "text",
|
|
2532
|
+
"description": "The language of both versions, for highlighting (`text` by default)."
|
|
2533
|
+
},
|
|
2534
|
+
{
|
|
2535
|
+
"name": "lineNumbers",
|
|
2536
|
+
"type": "boolean",
|
|
2537
|
+
"required": false,
|
|
2538
|
+
"default": null,
|
|
2539
|
+
"description": "Shows the old and the new line numbers."
|
|
2540
|
+
},
|
|
2541
|
+
{
|
|
2542
|
+
"name": "surface",
|
|
2543
|
+
"type": "\"well\" | \"plain\"",
|
|
2544
|
+
"required": false,
|
|
2545
|
+
"default": "well",
|
|
2546
|
+
"description": "On a filled well (`well`) or on the panel itself (`plain`)."
|
|
2547
|
+
},
|
|
2548
|
+
{
|
|
2549
|
+
"name": "title",
|
|
2550
|
+
"type": "ReactNode",
|
|
2551
|
+
"required": false,
|
|
2552
|
+
"default": null,
|
|
2553
|
+
"description": "A name in the title bar, beside the count of added and removed lines."
|
|
2554
|
+
},
|
|
2555
|
+
{
|
|
2556
|
+
"name": "wrap",
|
|
2557
|
+
"type": "boolean",
|
|
2558
|
+
"required": false,
|
|
2559
|
+
"default": "false",
|
|
2560
|
+
"description": "Long lines wrap instead of scrolling sideways, keeping their indent: values in a narrow column such as a sheet."
|
|
2561
|
+
}
|
|
2562
|
+
],
|
|
2563
|
+
"file": "src/components/code-block/diff-view.tsx"
|
|
2564
|
+
},
|
|
2488
2565
|
{
|
|
2489
2566
|
"name": "JsonView",
|
|
2490
2567
|
"description": "A folding JSON tree: copy any path, highlight a search. For request and response bodies.",
|
|
@@ -2540,6 +2617,17 @@
|
|
|
2540
2617
|
"surface": "well"
|
|
2541
2618
|
}
|
|
2542
2619
|
},
|
|
2620
|
+
"DIFF_VIEW": {
|
|
2621
|
+
"axes": {
|
|
2622
|
+
"surface": {
|
|
2623
|
+
"well": "A well: radius 14, fill, no ring (default)",
|
|
2624
|
+
"plain": "No surface, inside another well"
|
|
2625
|
+
}
|
|
2626
|
+
},
|
|
2627
|
+
"defaults": {
|
|
2628
|
+
"surface": "well"
|
|
2629
|
+
}
|
|
2630
|
+
},
|
|
2543
2631
|
"JSON_VIEW": {
|
|
2544
2632
|
"axes": {
|
|
2545
2633
|
"surface": {
|
package/ai/component-registry.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @logicplanes/kaeso-ui component registry
|
|
2
2
|
|
|
3
|
-
Version 0.4.
|
|
3
|
+
Version 0.4.4. Generated from the component types, their descriptions and variants; do not edit.
|
|
4
4
|
|
|
5
5
|
## agent-avatar
|
|
6
6
|
|
|
@@ -530,9 +530,10 @@ Inline code: Geist Mono 13 on fill-1.
|
|
|
530
530
|
|
|
531
531
|
## code-block
|
|
532
532
|
|
|
533
|
-
`import { CodeBlock, CodeHighlighted, JsonView } from "@logicplanes/kaeso-ui/code-block";`
|
|
533
|
+
`import { CodeBlock, CodeHighlighted, DiffView, JsonView } from "@logicplanes/kaeso-ui/code-block";`
|
|
534
534
|
|
|
535
535
|
- **surface** (code_block): `well` (default) — A well: radius 14, fill, no ring (default); `plain` — No surface, inside another well
|
|
536
|
+
- **surface** (diff_view): `well` (default) — A well: radius 14, fill, no ring (default); `plain` — No surface, inside another well
|
|
536
537
|
- **surface** (json_view): `well` (default) — On a well (default); `plain` — No surface
|
|
537
538
|
|
|
538
539
|
### CodeBlock
|
|
@@ -575,6 +576,23 @@ The same component as `CodeBlock`, under another name.
|
|
|
575
576
|
| `title` | `ReactNode` | | A file name in the title bar. |
|
|
576
577
|
| `wrap` | `boolean \| "phone"` | `false` | Long lines wrap instead of scrolling sideways: code in a narrow column (a model's response). `phone` wraps them only below 640px, with wrapped parts indented, and scrolls from there up. |
|
|
577
578
|
|
|
579
|
+
### DiffView
|
|
580
|
+
|
|
581
|
+
Two versions of a text side by side in one column: removed lines on red, added lines on green, the changed words inside them marked, syntax highlighted, and long unchanged runs folded away.
|
|
582
|
+
|
|
583
|
+
| Prop | Type | Default | Description |
|
|
584
|
+
|---|---|---|---|
|
|
585
|
+
| `after` * | `string` | | The new version. |
|
|
586
|
+
| `before` * | `string` | | The old version. |
|
|
587
|
+
| `className` | `string` | | Classes for the layout of the outer element: margin, width and placement, never its look. |
|
|
588
|
+
| `context` | `number` | `3` | Unchanged lines kept around each change before the rest folds (3 by default). |
|
|
589
|
+
| `copy` | `boolean` | `true` | Hide the copy circle, which copies the diff with + and - markers. |
|
|
590
|
+
| `lang` | `CodeLang` | `text` | The language of both versions, for highlighting (`text` by default). |
|
|
591
|
+
| `lineNumbers` | `boolean` | | Shows the old and the new line numbers. |
|
|
592
|
+
| `surface` | `"well" \| "plain"` | `well` | On a filled well (`well`) or on the panel itself (`plain`). |
|
|
593
|
+
| `title` | `ReactNode` | | A name in the title bar, beside the count of added and removed lines. |
|
|
594
|
+
| `wrap` | `boolean` | `false` | Long lines wrap instead of scrolling sideways, keeping their indent: values in a narrow column such as a sheet. |
|
|
595
|
+
|
|
578
596
|
### JsonView
|
|
579
597
|
|
|
580
598
|
A folding JSON tree: copy any path, highlight a search. For request and response bodies.
|
package/ai/icons.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Icon vocabulary
|
|
2
2
|
|
|
3
|
-
Version 0.4.
|
|
3
|
+
Version 0.4.4. Generated from `src/icons/vocabulary.ts`; do not edit. Use the name, never an icon picked by look: `icons.key` always means a key. Hugeicons, Stroke Rounded. Rules: `foundations/icons.md`.
|
|
4
4
|
|
|
5
5
|
## Kaeso objects
|
|
6
6
|
|
|
@@ -12,7 +12,7 @@ Version 0.4.3. Generated from `src/icons/vocabulary.ts`; do not edit. Use the na
|
|
|
12
12
|
|
|
13
13
|
## Actions
|
|
14
14
|
|
|
15
|
-
`signOut`, `copy`, `externalLink`, `openExternal`, `add`, `close`, `edit`, `delete`, `download`, `upload`, `refresh`, `retry`, `search`, `filter`, `displayOptions`, `more`, `menu`, `sort`, `switcher`, `expand`, `collapse`, `show`, `hide`, `reveal`, `sidebar`, `sidePanel`, `list`, `board`, `stack`
|
|
15
|
+
`signOut`, `copy`, `externalLink`, `openExternal`, `add`, `close`, `edit`, `delete`, `download`, `upload`, `refresh`, `retry`, `search`, `filter`, `displayOptions`, `more`, `menu`, `sort`, `switcher`, `unfold`, `expand`, `collapse`, `show`, `hide`, `reveal`, `sidebar`, `sidePanel`, `list`, `board`, `stack`
|
|
16
16
|
|
|
17
17
|
## Status
|
|
18
18
|
|
package/ai/tokens.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @logicplanes/kaeso-ui tokens
|
|
2
2
|
|
|
3
|
-
Version 0.4.
|
|
3
|
+
Version 0.4.4. Generated from `@logicplanes/kaeso-tokens`; do not edit. Components use these through role names (`bg-panel`, `text-fg-secondary`, `h-36`, `rounded-pill`); a raw value never appears in a component. How to use them: `foundations/*.md`.
|
|
4
4
|
|
|
5
5
|
## Neutrals
|
|
6
6
|
|
|
@@ -220,34 +220,38 @@ function E(e, t, r) {
|
|
|
220
220
|
var D = { surface: {
|
|
221
221
|
well: { classes: "rounded-well bg-fill-1" },
|
|
222
222
|
plain: { classes: "bg-transparent" }
|
|
223
|
-
} }, O = { surface: "well" }
|
|
224
|
-
|
|
225
|
-
|
|
223
|
+
} }, O = { surface: "well" };
|
|
224
|
+
function k(e) {
|
|
225
|
+
return e.startsWith("+") && !e.startsWith("+++") ? "bg-diff-added" : e.startsWith("-") && !e.startsWith("---") ? "bg-diff-removed" : !1;
|
|
226
|
+
}
|
|
227
|
+
var A = /* @__PURE__ */ i(function({ code: n = "", lang: i = "ts", tabs: f, tab: p, onTabChange: m, title: h, lineNumbers: g, highlightLines: _ = [], collapseAfter: v = 24, surface: y = "well", copy: b = !0, wrap: x = !1, className: T }, O) {
|
|
228
|
+
let [A, j] = c(0), M = p === void 0 ? -1 : f?.findIndex((e) => e.label === p) ?? -1, N = M >= 0 ? M : A, P = (e) => {
|
|
229
|
+
j(e);
|
|
226
230
|
let t = f?.[e]?.label;
|
|
227
231
|
t !== void 0 && m?.(t);
|
|
228
|
-
},
|
|
232
|
+
}, F = t(), I = f?.[N] ?? {
|
|
229
233
|
label: "",
|
|
230
234
|
code: n,
|
|
231
235
|
lang: i
|
|
232
|
-
},
|
|
236
|
+
}, L = I.code.replace(/\n$/, ""), R = o(() => L.split("\n"), [L]), [z, B] = c(null), [V, H] = c(!1);
|
|
233
237
|
a(() => {
|
|
234
|
-
let e = !0, t =
|
|
235
|
-
return S(
|
|
236
|
-
text:
|
|
238
|
+
let e = !0, t = I.lang ?? "ts";
|
|
239
|
+
return S(L, t).then((n) => e && B({
|
|
240
|
+
text: L,
|
|
237
241
|
lang: t,
|
|
238
242
|
tokens: n
|
|
239
243
|
})).catch(() => void 0), () => {
|
|
240
244
|
e = !1;
|
|
241
245
|
};
|
|
242
|
-
}, [
|
|
243
|
-
let
|
|
244
|
-
E(
|
|
245
|
-
let
|
|
246
|
+
}, [L, I.lang]);
|
|
247
|
+
let U = z && z.lang === (I.lang ?? "ts") && z.text === L ? z.tokens : null, W = v > 0 && R.length > v && !V, G = W ? v : R.length, K = s(null);
|
|
248
|
+
E(K, "code", !!f);
|
|
249
|
+
let q = e("relative overflow-x-auto py-16 scrollbar-quiet scroll-fade-x focus-ring-inset", W && "overflow-y-hidden", b && "coarse:mr-40"), J = /* @__PURE__ */ l("pre", {
|
|
246
250
|
className: "mono text-small text-fg",
|
|
247
251
|
children: /* @__PURE__ */ l("code", {
|
|
248
252
|
className: e("grid", !x && "min-w-max", x === "phone" && "sm:min-w-max"),
|
|
249
|
-
children:
|
|
250
|
-
className: e("flex px-16 leading-code", x === !0 && "whitespace-pre-wrap wrap-anywhere", x === "phone" && "max-sm:whitespace-pre-wrap max-sm:wrap-anywhere", _.includes(n + 1) && "bg-fill-2"),
|
|
253
|
+
children: R.slice(0, G).map((t, n) => /* @__PURE__ */ u("span", {
|
|
254
|
+
className: e("flex px-16 leading-code", x === !0 && "whitespace-pre-wrap wrap-anywhere", x === "phone" && "max-sm:whitespace-pre-wrap max-sm:wrap-anywhere", I.lang === "diff" && k(t), _.includes(n + 1) && "bg-fill-2"),
|
|
251
255
|
children: [
|
|
252
256
|
g && /* @__PURE__ */ l("span", {
|
|
253
257
|
className: "mr-16 inline-block w-24 shrink-0 text-right text-fg-tertiary select-none tabular",
|
|
@@ -259,7 +263,7 @@ var D = { surface: {
|
|
|
259
263
|
}),
|
|
260
264
|
/* @__PURE__ */ l("span", {
|
|
261
265
|
className: e("min-w-0", x === !0 && "pl-16 -indent-16", x === "phone" && "max-sm:pl-16 max-sm:-indent-16"),
|
|
262
|
-
children:
|
|
266
|
+
children: U?.[n]?.length ? w(U[n], x ? C.exec(t)?.[0].length ?? 0 : 0).map((e, t) => /* @__PURE__ */ l("span", {
|
|
263
267
|
className: e.className || void 0,
|
|
264
268
|
children: e.content
|
|
265
269
|
}, t)) : (x ? t.replace(C, "") : t) || " "
|
|
@@ -273,58 +277,58 @@ var D = { surface: {
|
|
|
273
277
|
className: e("group/code relative min-w-0", D.surface[y].classes, T),
|
|
274
278
|
children: [
|
|
275
279
|
/* @__PURE__ */ u(d.Root, {
|
|
276
|
-
value:
|
|
277
|
-
onValueChange: (e) =>
|
|
280
|
+
value: N,
|
|
281
|
+
onValueChange: (e) => P(Number(e)),
|
|
278
282
|
children: [(h || f) && /* @__PURE__ */ u("div", {
|
|
279
283
|
className: "flex h-44 items-center gap-4 px-8 hairline-b",
|
|
280
284
|
children: [h && /* @__PURE__ */ l("span", {
|
|
281
285
|
className: "px-8 mono text-small text-fg-secondary",
|
|
282
286
|
children: h
|
|
283
287
|
}), f && /* @__PURE__ */ l(d.List, {
|
|
284
|
-
"aria-label":
|
|
288
|
+
"aria-label": F("codeBlock.language", "Language"),
|
|
285
289
|
className: "flex items-center gap-2",
|
|
286
290
|
children: f.map((t, n) => /* @__PURE__ */ l(d.Tab, {
|
|
287
291
|
value: n,
|
|
288
|
-
className: e("inline-flex h-28 cursor-pointer items-center rounded-pill px-10 text-small font-medium transition-control focus-ring", n ===
|
|
292
|
+
className: e("inline-flex h-28 cursor-pointer items-center rounded-pill px-10 text-small font-medium transition-control focus-ring", n === N ? "bg-fill-2 text-fg" : "text-fg-secondary hover:bg-fill-2 hover:text-fg"),
|
|
289
293
|
children: t.label
|
|
290
294
|
}, t.label))
|
|
291
295
|
})]
|
|
292
296
|
}), f ? /* @__PURE__ */ l(d.Panel, {
|
|
293
|
-
ref:
|
|
294
|
-
value:
|
|
295
|
-
className:
|
|
296
|
-
children:
|
|
297
|
+
ref: K,
|
|
298
|
+
value: N,
|
|
299
|
+
className: q,
|
|
300
|
+
children: J
|
|
297
301
|
}) : /* @__PURE__ */ l("div", {
|
|
298
|
-
ref:
|
|
302
|
+
ref: K,
|
|
299
303
|
tabIndex: 0,
|
|
300
304
|
role: "region",
|
|
301
|
-
"aria-label": typeof h == "string" ?
|
|
302
|
-
className:
|
|
303
|
-
children:
|
|
305
|
+
"aria-label": typeof h == "string" ? F("codeBlock.titledCode", "{title} code", { title: h }) : F("codeBlock.code", "Code"),
|
|
306
|
+
className: q,
|
|
307
|
+
children: J
|
|
304
308
|
})]
|
|
305
309
|
}),
|
|
306
|
-
v > 0 &&
|
|
310
|
+
v > 0 && R.length > v && /* @__PURE__ */ l("div", {
|
|
307
311
|
className: "flex justify-center pb-12",
|
|
308
312
|
children: /* @__PURE__ */ l("button", {
|
|
309
313
|
type: "button",
|
|
310
|
-
onClick: () =>
|
|
314
|
+
onClick: () => H((e) => !e),
|
|
311
315
|
className: "inline-flex h-28 cursor-pointer items-center rounded-pill px-12 text-small font-medium text-fg-secondary transition-control hover:bg-fill-2 hover:text-fg focus-ring",
|
|
312
|
-
children:
|
|
316
|
+
children: V ? F("codeBlock.showLess", "Show less") : F("codeBlock.showAllLines", "Show all {count} lines", { count: String(R.length) })
|
|
313
317
|
})
|
|
314
318
|
}),
|
|
315
319
|
b && /* @__PURE__ */ l("div", {
|
|
316
320
|
className: e("absolute right-8 opacity-0 transition-control group-hover/code:opacity-100 coarse:opacity-100 focus-within:opacity-100", h || f ? "top-52" : "top-8"),
|
|
317
321
|
children: /* @__PURE__ */ l(r, {
|
|
318
|
-
value:
|
|
319
|
-
label:
|
|
322
|
+
value: L,
|
|
323
|
+
label: F("codeBlock.copy", "Copy code")
|
|
320
324
|
})
|
|
321
325
|
})
|
|
322
326
|
]
|
|
323
327
|
});
|
|
324
328
|
});
|
|
325
|
-
process.env.NODE_ENV !== "production" && (
|
|
326
|
-
var
|
|
329
|
+
process.env.NODE_ENV !== "production" && (A.displayName = "CodeBlock");
|
|
330
|
+
var j = A;
|
|
327
331
|
//#endregion
|
|
328
|
-
export {
|
|
332
|
+
export { E as a, S as c, D as i, g as l, j as n, C as o, O as r, y as s, A as t };
|
|
329
333
|
|
|
330
|
-
//# sourceMappingURL=code-block-
|
|
334
|
+
//# sourceMappingURL=code-block-BZIe_B9l.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-block-BZIe_B9l.js","names":["BaseTabs","cn","useUiText","observeResize","CopyButton","TONES","ITALIC","BOLD","codeTokenClass","style","fontStyle","tone","color","kaesoShikiTheme","instance","HIGHLIGHT_MAX_LINE","CODE_LANGS","getHighlighter","createHighlighterCore","createJavaScriptRegexEngine","error","LOADERS","highlight","lang","code","h","loader","line","token","INDENT","dropIndent","left","n","tokens","t","cut","setLength","px","el","name","useScrollFadeX","ref","update","start","inner","content","stop","key","KAESO_CODE_BLOCK_VARIANTS","KAESO_CODE_BLOCK_DEFAULT_VARIANTS","diffLineClass","CodeBlock","chosen","own","setOwn","useState","match","tabs","item","tab","choose","i","label","onTabChange","current","text","lines","useMemo","highlighted","setHighlighted","expanded","setExpanded","alive","tokenLines","collapsed","collapseAfter","visible","scroller","useRef","codeClass","copy","source","wrap","highlightLines","lineNumbers","j","surface","className","Tabs","v","title","CodeHighlighted"],"sources":["../../src/components/code-block/kaeso-theme.ts","../../src/components/code-block/highlighter.ts","../../src/components/code-block/indent.ts","../../src/hooks/use-scroll-fade.ts","../../src/components/code-block/code-block.tsx"],"sourcesContent":["const TONES = {\n text: { color: \"var(--k-text)\", className: \"\" },\n quiet: { color: \"var(--k-text-tertiary)\", className: \"text-fg-tertiary\" },\n secondary: { color: \"var(--k-text-secondary)\", className: \"text-fg-secondary\" },\n string: { color: \"var(--k-info-text)\", className: \"text-info-text\" },\n constant: { color: \"var(--k-warning-text)\", className: \"text-warning-text\" },\n} as const;\n\nconst ITALIC = 1;\nconst BOLD = 2;\n\nexport function codeTokenClass(color: string | undefined, fontStyle: number | undefined): string {\n const style = fontStyle ?? 0;\n return [\n Object.values(TONES).find((tone) => tone.color === color?.toLowerCase())?.className ?? \"\",\n style & ITALIC ? \"italic\" : \"\",\n style & BOLD ? \"font-semibold\" : \"\",\n ]\n .filter(Boolean)\n .join(\" \");\n}\n\nexport const kaesoShikiTheme = {\n name: \"kaeso\",\n type: \"light\" as const,\n colors: { \"editor.background\": \"transparent\", \"editor.foreground\": TONES.text.color },\n settings: [\n { settings: { foreground: TONES.text.color, background: \"transparent\" } },\n { scope: [\"comment\", \"punctuation.definition.comment\"], settings: { foreground: TONES.quiet.color, fontStyle: \"italic\" } },\n {\n scope: [\"string\", \"string.quoted\", \"string.template\", \"punctuation.definition.string\", \"markup.inline.raw\"],\n settings: { foreground: TONES.string.color },\n },\n {\n scope: [\"constant.numeric\", \"constant.language.boolean\", \"constant.language.null\", \"constant.language\"],\n settings: { foreground: TONES.constant.color },\n },\n {\n scope: [\"keyword\", \"storage\", \"storage.type\", \"storage.modifier\", \"keyword.control\", \"keyword.operator.new\", \"variable.language\"],\n settings: { foreground: TONES.text.color, fontStyle: \"bold\" },\n },\n {\n scope: [\"punctuation\", \"meta.brace\", \"punctuation.separator\", \"punctuation.terminator\", \"keyword.operator\", \"meta.tag punctuation\"],\n settings: { foreground: TONES.quiet.color },\n },\n { scope: [\"entity.name.function\", \"support.function\", \"entity.name.tag\", \"support.class.component\"], settings: { foreground: TONES.text.color } },\n {\n scope: [\"support.type.property-name\", \"meta.object-literal.key\", \"entity.other.attribute-name\", \"variable.other.property\"],\n settings: { foreground: TONES.text.color },\n },\n { scope: [\"entity.name.type\", \"support.type\", \"entity.other.inherited-class\"], settings: { foreground: TONES.secondary.color } },\n ],\n};\n","import { codeTokenClass, kaesoShikiTheme } from \"./kaeso-theme.js\";\n\ntype Highlighter = {\n codeToTokens: (\n code: string,\n o: { lang: string; theme: string; tokenizeMaxLineLength?: number | undefined },\n ) => { tokens: { content: string; color?: string | undefined; fontStyle?: number | undefined }[][] };\n getLoadedLanguages: () => string[];\n loadLanguage: (...l: unknown[]) => Promise<void>;\n};\nlet instance: Promise<Highlighter> | null = null;\n\nexport const HIGHLIGHT_MAX_CHARS = 200_000;\n\nconst HIGHLIGHT_MAX_LINE = 2_000;\n\nexport const CODE_LANGS = [\"ts\", \"tsx\", \"js\", \"json\", \"bash\", \"python\", \"yaml\", \"diff\"] as const;\nexport type CodeLang = (typeof CODE_LANGS)[number] | \"text\";\n\nexport function getHighlighter(): Promise<Highlighter> {\n instance ??= (async () => {\n const [{ createHighlighterCore }, { createJavaScriptRegexEngine }] = await Promise.all([import(\"shiki/core\"), import(\"shiki/engine/javascript\")]);\n return (await createHighlighterCore({ themes: [kaesoShikiTheme as never], langs: [], engine: createJavaScriptRegexEngine() })) as unknown as Highlighter;\n })().catch((error: unknown) => {\n instance = null;\n throw error;\n });\n return instance;\n}\n\nconst LOADERS: Record<Exclude<CodeLang, \"text\">, () => Promise<{ default: unknown }>> = {\n ts: () => import(\"shiki/dist/langs/typescript.mjs\"),\n tsx: () => import(\"shiki/dist/langs/tsx.mjs\"),\n js: () => import(\"shiki/dist/langs/javascript.mjs\"),\n json: () => import(\"shiki/dist/langs/json.mjs\"),\n bash: () => import(\"shiki/dist/langs/bash.mjs\"),\n python: () => import(\"shiki/dist/langs/python.mjs\"),\n yaml: () => import(\"shiki/dist/langs/yaml.mjs\"),\n diff: () => import(\"shiki/dist/langs/diff.mjs\"),\n};\n\nexport interface CodeToken {\n content: string;\n className: string;\n}\n\nexport async function highlight(code: string, lang: CodeLang): Promise<CodeToken[][] | null> {\n if (lang === \"text\" || code.length > HIGHLIGHT_MAX_CHARS) return null;\n const h = await getHighlighter();\n if (!h.getLoadedLanguages().includes(lang)) {\n const loader = LOADERS[lang];\n if (!loader) return null;\n await h.loadLanguage((await loader()).default);\n }\n return h\n .codeToTokens(code, { lang, theme: \"kaeso\", tokenizeMaxLineLength: HIGHLIGHT_MAX_LINE })\n .tokens.map((line) => line.map((token) => ({ content: token.content, className: codeTokenClass(token.color, token.fontStyle) })));\n}\n","import type { CodeToken } from \"./highlighter.js\";\n\nexport const INDENT = /^[ \\t]+/;\n\nexport function dropIndent(tokens: CodeToken[], n: number): CodeToken[] {\n let left = n;\n return tokens.flatMap((t) => {\n if (left === 0) return [t];\n const cut = Math.min(left, t.content.length);\n left -= cut;\n return cut === t.content.length ? [] : [{ ...t, content: t.content.slice(cut) }];\n });\n}\n","import { useEffect, type RefObject } from \"react\";\nimport { observeResize } from \"../utils/observe-resize.js\";\n\nfunction setLength(el: HTMLElement, name: string, px: number) {\n if (px > 0) el.style.setProperty(name, `${px}px`);\n else el.style.removeProperty(name);\n}\n\nexport function useScrollFadeX(ref: RefObject<HTMLElement | null>, content: string, key?: unknown) {\n useEffect(() => {\n const el = ref.current;\n if (!el) return;\n const update = () => {\n const start = Math.abs(el.scrollLeft);\n setLength(el, \"--scroll-area-overflow-x-start\", start);\n setLength(el, \"--scroll-area-overflow-x-end\", el.scrollWidth - el.clientWidth - start);\n };\n update();\n el.addEventListener(\"scroll\", update, { passive: true });\n const inner = el.querySelector(content);\n const stop = observeResize(inner ? [el, inner] : [el], update);\n return () => {\n el.removeEventListener(\"scroll\", update);\n stop();\n };\n }, [ref, content, key]);\n}\n","import { forwardRef, useEffect, useMemo, useRef, useState, type ReactNode } from \"react\";\nimport { Tabs as BaseTabs } from \"@base-ui/react/tabs\";\nimport { cn } from \"../../utils/cn.js\";\nimport { CopyButton } from \"../copy-button/copy-button.js\";\nimport { highlight, type CodeLang, type CodeToken } from \"./highlighter.js\";\nimport { INDENT, dropIndent } from \"./indent.js\";\nimport { useUiText } from \"../../i18n/context.js\";\nimport { useScrollFadeX } from \"../../hooks/use-scroll-fade.js\";\n\nexport const KAESO_CODE_BLOCK_VARIANTS = {\n surface: {\n well: { classes: \"rounded-well bg-fill-1\" },\n plain: { classes: \"bg-transparent\" },\n },\n} as const;\nexport const KAESO_CODE_BLOCK_DEFAULT_VARIANTS = { surface: \"well\" } as const;\n\nfunction diffLineClass(line: string): string | false {\n if (line.startsWith(\"+\") && !line.startsWith(\"+++\")) return \"bg-diff-added\";\n if (line.startsWith(\"-\") && !line.startsWith(\"---\")) return \"bg-diff-removed\";\n return false;\n}\n\nexport interface CodeTab {\n label: string;\n code: string;\n lang?: CodeLang | undefined;\n}\n\nexport interface CodeBlockProps {\n code?: string | undefined;\n lang?: CodeLang | undefined;\n tabs?: CodeTab[] | undefined;\n tab?: string | undefined;\n onTabChange?: ((label: string) => void) | undefined;\n title?: ReactNode | undefined;\n lineNumbers?: boolean | undefined;\n highlightLines?: number[] | undefined;\n collapseAfter?: number | undefined;\n surface?: keyof typeof KAESO_CODE_BLOCK_VARIANTS.surface | undefined;\n copy?: boolean | undefined;\n wrap?: boolean | \"phone\" | undefined;\n className?: string | undefined;\n}\n\nexport const CodeBlock = /* @__PURE__ */ forwardRef<HTMLDivElement, CodeBlockProps>(function CodeBlock(\n {\n code = \"\",\n lang = \"ts\",\n tabs,\n tab: chosen,\n onTabChange,\n title,\n lineNumbers,\n highlightLines = [],\n collapseAfter = 24,\n surface = \"well\",\n copy = true,\n wrap = false,\n className,\n },\n ref,\n) {\n const [own, setOwn] = useState(0);\n const match = chosen === undefined ? -1 : (tabs?.findIndex((item) => item.label === chosen) ?? -1);\n const tab = match >= 0 ? match : own;\n const choose = (i: number) => {\n setOwn(i);\n const label = tabs?.[i]?.label;\n if (label !== undefined) onTabChange?.(label);\n };\n const t = useUiText();\n const current = tabs?.[tab] ?? { label: \"\", code, lang };\n const text = current.code.replace(/\\n$/, \"\");\n const lines = useMemo(() => text.split(\"\\n\"), [text]);\n const [highlighted, setHighlighted] = useState<{ text: string; lang: CodeLang; tokens: CodeToken[][] | null } | null>(null);\n const [expanded, setExpanded] = useState(false);\n useEffect(() => {\n let alive = true;\n const lang = current.lang ?? \"ts\";\n highlight(text, lang)\n .then((tokens) => alive && setHighlighted({ text, lang, tokens }))\n .catch(() => undefined);\n return () => {\n alive = false;\n };\n }, [text, current.lang]);\n const tokenLines = highlighted && highlighted.lang === (current.lang ?? \"ts\") && highlighted.text === text ? highlighted.tokens : null;\n const collapsed = collapseAfter > 0 && lines.length > collapseAfter && !expanded;\n const visible = collapsed ? collapseAfter : lines.length;\n const scroller = useRef<HTMLDivElement | null>(null);\n useScrollFadeX(scroller, \"code\", !!tabs);\n const codeClass = cn(\n \"relative overflow-x-auto py-16 scrollbar-quiet scroll-fade-x focus-ring-inset\",\n collapsed && \"overflow-y-hidden\",\n copy && \"coarse:mr-40\",\n );\n const source = (\n <pre className=\"mono text-small text-fg\">\n <code className={cn(\"grid\", !wrap && \"min-w-max\", wrap === \"phone\" && \"sm:min-w-max\")}>\n {lines.slice(0, visible).map((line, i) => (\n <span\n key={i}\n className={cn(\n \"flex px-16 leading-code\",\n wrap === true && \"whitespace-pre-wrap wrap-anywhere\",\n wrap === \"phone\" && \"max-sm:whitespace-pre-wrap max-sm:wrap-anywhere\",\n current.lang === \"diff\" && diffLineClass(line),\n highlightLines.includes(i + 1) && \"bg-fill-2\",\n )}\n >\n {lineNumbers && <span className=\"mr-16 inline-block w-24 shrink-0 text-right text-fg-tertiary select-none tabular\">{i + 1}</span>}\n {wrap && INDENT.test(line) && <span className=\"shrink-0 whitespace-pre\">{INDENT.exec(line)?.[0]}</span>}\n <span className={cn(\"min-w-0\", wrap === true && \"pl-16 -indent-16\", wrap === \"phone\" && \"max-sm:pl-16 max-sm:-indent-16\")}>\n {tokenLines?.[i]?.length\n ? dropIndent(tokenLines[i], wrap ? (INDENT.exec(line)?.[0].length ?? 0) : 0).map((token, j) => (\n <span key={j} className={token.className || undefined}>\n {token.content}\n </span>\n ))\n : (wrap ? line.replace(INDENT, \"\") : line) || \" \"}\n </span>\n </span>\n ))}\n </code>\n </pre>\n );\n\n return (\n <div ref={ref} className={cn(\"group/code relative min-w-0\", KAESO_CODE_BLOCK_VARIANTS.surface[surface].classes, className)}>\n <BaseTabs.Root value={tab} onValueChange={(v: unknown) => choose(Number(v))}>\n {(title || tabs) && (\n <div className=\"flex h-44 items-center gap-4 px-8 hairline-b\">\n {title && <span className=\"px-8 mono text-small text-fg-secondary\">{title}</span>}\n {tabs && (\n <BaseTabs.List aria-label={t(\"codeBlock.language\", \"Language\")} className=\"flex items-center gap-2\">\n {tabs.map((item, i) => (\n <BaseTabs.Tab\n key={item.label}\n value={i}\n className={cn(\n \"inline-flex h-28 cursor-pointer items-center rounded-pill px-10 text-small font-medium transition-control focus-ring\",\n i === tab ? \"bg-fill-2 text-fg\" : \"text-fg-secondary hover:bg-fill-2 hover:text-fg\",\n )}\n >\n {item.label}\n </BaseTabs.Tab>\n ))}\n </BaseTabs.List>\n )}\n </div>\n )}\n {tabs ? (\n <BaseTabs.Panel ref={scroller} value={tab} className={codeClass}>\n {source}\n </BaseTabs.Panel>\n ) : (\n <div\n ref={scroller}\n tabIndex={0}\n role=\"region\"\n aria-label={typeof title === \"string\" ? t(\"codeBlock.titledCode\", \"{title} code\", { title }) : t(\"codeBlock.code\", \"Code\")}\n className={codeClass}\n >\n {source}\n </div>\n )}\n </BaseTabs.Root>\n {collapseAfter > 0 && lines.length > collapseAfter && (\n <div className=\"flex justify-center pb-12\">\n <button\n type=\"button\"\n onClick={() => setExpanded((e) => !e)}\n className=\"inline-flex h-28 cursor-pointer items-center rounded-pill px-12 text-small font-medium text-fg-secondary transition-control hover:bg-fill-2 hover:text-fg focus-ring\"\n >\n {expanded ? t(\"codeBlock.showLess\", \"Show less\") : t(\"codeBlock.showAllLines\", \"Show all {count} lines\", { count: String(lines.length) })}\n </button>\n </div>\n )}\n {copy && (\n <div\n className={cn(\n \"absolute right-8 opacity-0 transition-control group-hover/code:opacity-100 coarse:opacity-100 focus-within:opacity-100\",\n title || tabs ? \"top-52\" : \"top-8\",\n )}\n >\n <CopyButton value={text} label={t(\"codeBlock.copy\", \"Copy code\")} />\n </div>\n )}\n </div>\n );\n});\nif (process.env.NODE_ENV !== \"production\") CodeBlock.displayName = \"CodeBlock\";\n\nexport const CodeHighlighted = CodeBlock;\n"],"mappings":";;;;;;;;;AAAA,IAAMK,IAAQ;CACZ,MAAM;EAAE,OAAO;EAAiB,WAAW;CAAG;CAC9C,OAAO;EAAE,OAAO;EAA0B,WAAW;CAAmB;CACxE,WAAW;EAAE,OAAO;EAA2B,WAAW;CAAoB;CAC9E,QAAQ;EAAE,OAAO;EAAsB,WAAW;CAAiB;CACnE,UAAU;EAAE,OAAO;EAAyB,WAAW;CAAoB;AAC7E,GAEMC,IAAS,GACTC,IAAO;AAEb,SAAgBC,EAAe,GAA2B,GAAuC;CAC/F,IAAMC,IAAQC,KAAa;CAC3B,OAAO;EACL,OAAO,OAAOL,CAAK,CAAC,CAAC,MAAM,MAASM,EAAK,UAAUC,GAAO,YAAY,CAAC,CAAC,EAAE,aAAa;EACvFH,IAAQH,IAAS,WAAW;EAC5BG,IAAQF,IAAO,kBAAkB;CACnC,CAAC,CACE,OAAO,OAAO,CAAC,CACf,KAAK,GAAG;AACb;AAEA,IAAaM,IAAkB;CAC7B,MAAM;CACN,MAAM;CACN,QAAQ;EAAE,qBAAqB;EAAe,qBAAqBR,EAAM,KAAK;CAAM;CACpF,UAAU;EACR,EAAE,UAAU;GAAE,YAAYA,EAAM,KAAK;GAAO,YAAY;EAAc,EAAE;EACxE;GAAE,OAAO,CAAC,WAAW,gCAAgC;G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