@zaly/tui 0.0.4 → 0.0.6

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.
Files changed (156) hide show
  1. package/dist/actions-CnVzKVID.d.mts +41 -0
  2. package/dist/actions-CnVzKVID.d.mts.map +1 -0
  3. package/dist/actions-DEIKF2ts.mjs +48 -0
  4. package/dist/actions-DEIKF2ts.mjs.map +1 -0
  5. package/dist/{box-DyaByEiG.mjs → box-DepqUtuo.mjs} +2 -2
  6. package/dist/{box-DyaByEiG.mjs.map → box-DepqUtuo.mjs.map} +1 -1
  7. package/dist/{builder-D49ECBEf.mjs → builder-DTz5mppV.mjs} +2 -2
  8. package/dist/{builder-D49ECBEf.mjs.map → builder-DTz5mppV.mjs.map} +1 -1
  9. package/dist/{callbacks-CNjGNxVw.mjs → callbacks-DcMBGQEO.mjs} +2 -2
  10. package/dist/{callbacks-CNjGNxVw.mjs.map → callbacks-DcMBGQEO.mjs.map} +1 -1
  11. package/dist/{client-D6C_uczF.mjs → client-BBdtbLp4.mjs} +5 -10
  12. package/dist/client-BBdtbLp4.mjs.map +1 -0
  13. package/dist/client-cIckDgAj.mjs +2 -0
  14. package/dist/clipboard-l_TWxxTf.mjs +404 -0
  15. package/dist/clipboard-l_TWxxTf.mjs.map +1 -0
  16. package/dist/clipboard.mjs +1 -403
  17. package/dist/ctx-Bt4VlRPg.mjs +2 -0
  18. package/dist/ctx-DjJ1zSbs.mjs +43 -0
  19. package/dist/ctx-DjJ1zSbs.mjs.map +1 -0
  20. package/dist/divider-cclEAdPx.mjs +9 -0
  21. package/dist/divider-cclEAdPx.mjs.map +1 -0
  22. package/dist/files-Aw3iWpXD.d.mts +29 -0
  23. package/dist/files-Aw3iWpXD.d.mts.map +1 -0
  24. package/dist/files-BvThQpOf.mjs +42 -0
  25. package/dist/files-BvThQpOf.mjs.map +1 -0
  26. package/dist/github-Cy2hfWJ7.mjs +137 -0
  27. package/dist/github-Cy2hfWJ7.mjs.map +1 -0
  28. package/dist/github-DS00VoOj.d.mts +64 -0
  29. package/dist/github-DS00VoOj.d.mts.map +1 -0
  30. package/dist/image-BTxDPPiT.d.mts +37 -0
  31. package/dist/image-BTxDPPiT.d.mts.map +1 -0
  32. package/dist/index.mjs +6 -202
  33. package/dist/index.mjs.map +1 -1
  34. package/dist/input-CRBuTrsL.mjs +497 -0
  35. package/dist/input-CRBuTrsL.mjs.map +1 -0
  36. package/dist/{inspect-D1d9t-ni.mjs → inspect-DE5goDzB.mjs} +2 -2
  37. package/dist/{inspect-D1d9t-ni.mjs.map → inspect-DE5goDzB.mjs.map} +1 -1
  38. package/dist/log-Djvrxqk0.mjs +130 -0
  39. package/dist/log-Djvrxqk0.mjs.map +1 -0
  40. package/dist/logger-DDrt03So.mjs +71 -0
  41. package/dist/logger-DDrt03So.mjs.map +1 -0
  42. package/dist/markdown-CTlPe5ks.mjs +124 -0
  43. package/dist/markdown-CTlPe5ks.mjs.map +1 -0
  44. package/dist/markdown.mjs +1 -1
  45. package/dist/overlay-9xNgsuuy.mjs +18 -0
  46. package/dist/overlay-9xNgsuuy.mjs.map +1 -0
  47. package/dist/{picker-ndVVt6qF.mjs → picker-cH-rc7-X.mjs} +5 -5
  48. package/dist/{picker-ndVVt6qF.mjs.map → picker-cH-rc7-X.mjs.map} +1 -1
  49. package/dist/queries-B_lOwEiE.mjs +200 -0
  50. package/dist/queries-B_lOwEiE.mjs.map +1 -0
  51. package/dist/{registry-U654j61Y.mjs → registry-w_w7gZr_.mjs} +3 -5
  52. package/dist/registry-w_w7gZr_.mjs.map +1 -0
  53. package/dist/render-F8pVXN7h.mjs +33 -0
  54. package/dist/render-F8pVXN7h.mjs.map +1 -0
  55. package/dist/renderer-Dgj_qEOA.mjs +2 -0
  56. package/dist/{renderer-CdLCkJB-.mjs → renderer-qSMVeNSV.mjs} +3 -5
  57. package/dist/{renderer-CdLCkJB-.mjs.map → renderer-qSMVeNSV.mjs.map} +1 -1
  58. package/dist/{renderer-CxL4xbkl.mjs → renderer-uMeDzF9B.mjs} +8 -7
  59. package/dist/{renderer-CxL4xbkl.mjs.map → renderer-uMeDzF9B.mjs.map} +1 -1
  60. package/dist/select-m7NE6Rwa.mjs +195 -0
  61. package/dist/select-m7NE6Rwa.mjs.map +1 -0
  62. package/dist/services/logger.mjs +1 -70
  63. package/dist/services/notifier.mjs +2 -2
  64. package/dist/services/picker.d.mts +1 -1
  65. package/dist/services/picker.mjs +6 -6
  66. package/dist/services/prompt.d.mts +1 -1
  67. package/dist/services/prompt.mjs +5 -5
  68. package/dist/shiki/server.d.mts +1 -0
  69. package/dist/shiki/server.mjs +129 -0
  70. package/dist/shiki/server.mjs.map +1 -0
  71. package/dist/{shiki-BrjVUkeh.mjs → shiki-B5NwIiot.mjs} +5 -10
  72. package/dist/shiki-B5NwIiot.mjs.map +1 -0
  73. package/dist/shiki-BK-v9CtF.mjs +12 -0
  74. package/dist/shiki-BK-v9CtF.mjs.map +1 -0
  75. package/dist/show-DR2x1YFc.mjs +85 -0
  76. package/dist/show-DR2x1YFc.mjs.map +1 -0
  77. package/dist/style.mjs +2 -2
  78. package/dist/text-9lwQeqYr.d.mts +33 -0
  79. package/dist/text-9lwQeqYr.d.mts.map +1 -0
  80. package/dist/text-DILrol9j.mjs +32 -0
  81. package/dist/text-DILrol9j.mjs.map +1 -0
  82. package/dist/text-q26V6_Sc.mjs +111 -0
  83. package/dist/text-q26V6_Sc.mjs.map +1 -0
  84. package/dist/text.d.mts +2 -33
  85. package/dist/text.mjs +1 -110
  86. package/dist/{theme.config-CU3B50HN.mjs → theme.config-BptYUq4K.mjs} +4 -4
  87. package/dist/{theme.config-CU3B50HN.mjs.map → theme.config-BptYUq4K.mjs.map} +1 -1
  88. package/dist/themes.mjs +1 -1
  89. package/dist/tree-Bo1afYhe.mjs +73 -0
  90. package/dist/tree-Bo1afYhe.mjs.map +1 -0
  91. package/dist/widget-BkMwhY2p.mjs +40 -0
  92. package/dist/widget-BkMwhY2p.mjs.map +1 -0
  93. package/dist/widget-M7jD8Rgg.d.mts +49 -0
  94. package/dist/widget-M7jD8Rgg.d.mts.map +1 -0
  95. package/dist/widgets/autocomplete.mjs +2 -2
  96. package/dist/widgets/box.mjs +1 -1
  97. package/dist/widgets/code.mjs +7 -7
  98. package/dist/widgets/completions/actions.d.mts +2 -41
  99. package/dist/widgets/completions/actions.mjs +1 -47
  100. package/dist/widgets/completions/files.d.mts +2 -29
  101. package/dist/widgets/completions/files.mjs +1 -41
  102. package/dist/widgets/completions/github.d.mts +2 -64
  103. package/dist/widgets/completions/github.mjs +1 -136
  104. package/dist/widgets/completions/index.d.mts +3 -3
  105. package/dist/widgets/completions/index.mjs +3 -3
  106. package/dist/widgets/diff.d.mts +1 -1
  107. package/dist/widgets/diff.mjs +3 -3
  108. package/dist/widgets/divider.mjs +1 -8
  109. package/dist/widgets/image.d.mts +2 -37
  110. package/dist/widgets/image.mjs +1 -1
  111. package/dist/widgets/input.mjs +1 -496
  112. package/dist/widgets/log.mjs +1 -129
  113. package/dist/widgets/markdown.d.mts +2 -2
  114. package/dist/widgets/markdown.mjs +1 -123
  115. package/dist/widgets/overlay.mjs +1 -17
  116. package/dist/widgets/picker.mjs +1 -1
  117. package/dist/widgets/select.mjs +1 -194
  118. package/dist/widgets/show.mjs +1 -84
  119. package/dist/widgets/text.mjs +1 -31
  120. package/dist/widgets/tree.mjs +1 -72
  121. package/dist/widgets/widget.d.mts +2 -49
  122. package/dist/widgets/widget.mjs +1 -39
  123. package/dist/worker-BvRm4OsW.mjs +2 -0
  124. package/dist/worker-T6SdPzUH.mjs +52 -0
  125. package/dist/worker-T6SdPzUH.mjs.map +1 -0
  126. package/package.json +7 -3
  127. package/dist/client-D6C_uczF.mjs.map +0 -1
  128. package/dist/clipboard.mjs.map +0 -1
  129. package/dist/registry-U654j61Y.mjs.map +0 -1
  130. package/dist/render-DxVLqqB9.mjs +0 -74
  131. package/dist/render-DxVLqqB9.mjs.map +0 -1
  132. package/dist/rolldown-runtime-D7D4PA-g.mjs +0 -13
  133. package/dist/services/logger.mjs.map +0 -1
  134. package/dist/shiki-BrjVUkeh.mjs.map +0 -1
  135. package/dist/text.d.mts.map +0 -1
  136. package/dist/text.mjs.map +0 -1
  137. package/dist/widgets/completions/actions.d.mts.map +0 -1
  138. package/dist/widgets/completions/actions.mjs.map +0 -1
  139. package/dist/widgets/completions/files.d.mts.map +0 -1
  140. package/dist/widgets/completions/files.mjs.map +0 -1
  141. package/dist/widgets/completions/github.d.mts.map +0 -1
  142. package/dist/widgets/completions/github.mjs.map +0 -1
  143. package/dist/widgets/divider.mjs.map +0 -1
  144. package/dist/widgets/image.d.mts.map +0 -1
  145. package/dist/widgets/input.mjs.map +0 -1
  146. package/dist/widgets/log.mjs.map +0 -1
  147. package/dist/widgets/markdown.mjs.map +0 -1
  148. package/dist/widgets/overlay.mjs.map +0 -1
  149. package/dist/widgets/select.mjs.map +0 -1
  150. package/dist/widgets/show.mjs.map +0 -1
  151. package/dist/widgets/text.mjs.map +0 -1
  152. package/dist/widgets/tree.mjs.map +0 -1
  153. package/dist/widgets/widget.d.mts.map +0 -1
  154. package/dist/widgets/widget.mjs.map +0 -1
  155. package/dist/worker-DjHuQSbY.mjs +0 -27
  156. package/dist/worker-DjHuQSbY.mjs.map +0 -1
@@ -1,29 +1,2 @@
1
- import { n as PickerItem } from "../../picker-D8OLb6kZ.mjs";
2
- import { o as CompletionSource } from "../../autocomplete-Dfw-yQDa.mjs";
3
- import { FindOptions } from "@zaly/shared/find";
4
- //#region src/widgets/completions/files.d.ts
5
- interface FilesSourceOptions extends FindOptions {
6
- /** Base directory relative queries resolve against. Default:
7
- * `process.cwd()`. */
8
- cwd?: string;
9
- /** Trigger regex. Default: `/(?<=^|\s)@/` — `@` preceded by start-of-
10
- * string or whitespace. Lookbehind keeps `match.start` on the `@`
11
- * itself so the leading space isn't eaten on insertion. */
12
- trigger?: RegExp;
13
- /** Prefix prepended to accepted values so the trigger character stays
14
- * in the input after a pick (letting users keep typing to drill into
15
- * subdirectories). Default: `"@"` — matches the default trigger.
16
- * When customizing `trigger`, set this to the character your trigger
17
- * represents. */
18
- prefix?: string;
19
- refreshInterval?: number;
20
- }
21
- type File = PickerItem & {
22
- file: string;
23
- };
24
- /** Completion source for files. Uses `@zaly/shared/find` under the hood, so
25
- * supports all the same options and respects .gitignore by default. */
26
- declare function filesSource(opts?: FilesSourceOptions): CompletionSource<File>;
27
- //#endregion
28
- export { FilesSourceOptions, filesSource };
29
- //# sourceMappingURL=files.d.mts.map
1
+ import { n as filesSource, t as FilesSourceOptions } from "../../files-Aw3iWpXD.mjs";
2
+ export { FilesSourceOptions, filesSource };
@@ -1,42 +1,2 @@
1
- import { a as createIterable, y as signal } from "../../reactive-f7NpAi69.mjs";
2
- import { normPath } from "@zaly/shared";
3
- //#region src/widgets/completions/files.ts
4
- /** Completion source for files. Uses `@zaly/shared/find` under the hood, so
5
- * supports all the same options and respects .gitignore by default. */
6
- function filesSource(opts = {}) {
7
- const cwd = normPath(opts.cwd);
8
- const trigger = opts.trigger ?? /(?<=^|\s)@/;
9
- const prefix = opts.prefix ?? "@";
10
- let results;
11
- const [gen, setGen] = signal(0);
12
- let lastRefresh = 0;
13
- return {
14
- accept: (item) => {
15
- const v = item.file;
16
- return `${prefix}${v}${v.endsWith("/") ? "" : " "}`;
17
- },
18
- get complete() {
19
- const now = performance.now();
20
- if (!results?.loading() && now - lastRefresh > (opts.refreshInterval ?? 1e4)) {
21
- setGen((g) => g + 1);
22
- lastRefresh = now;
23
- }
24
- return results ??= createIterable(async function* iterFiles() {
25
- gen();
26
- const { find } = await import("@zaly/shared/find");
27
- for await (const f of find({
28
- ...opts,
29
- cwd
30
- })) yield (Array.isArray(f) ? f : [f]).map((file) => ({
31
- file,
32
- text: file
33
- }));
34
- });
35
- },
36
- triggers: [trigger]
37
- };
38
- }
39
- //#endregion
1
+ import { t as filesSource } from "../../files-BvThQpOf.mjs";
40
2
  export { filesSource };
41
-
42
- //# sourceMappingURL=files.mjs.map
@@ -1,64 +1,2 @@
1
- import { n as PickerItem } from "../../picker-D8OLb6kZ.mjs";
2
- import { o as CompletionSource } from "../../autocomplete-Dfw-yQDa.mjs";
3
- //#region src/widgets/completions/github.d.ts
4
- /** A GitHub issue or pull request returned by `githubSource`. Shape
5
- * mirrors the `gh` CLI's `--json number,title,state,author,url`
6
- * output, with `type` added to distinguish issues from PRs. */
7
- type GithubItem = PickerItem & {
8
- number: number;
9
- title: string;
10
- /** `"open"` / `"closed"` for issues; `"open"` / `"closed"` / `"merged"`
11
- * for PRs. Kept as a string so we don't trip if gh evolves. */
12
- state: string;
13
- type: "issue" | "pr";
14
- url: string;
15
- author?: {
16
- login?: string;
17
- };
18
- };
19
- type GithubState = "open" | "closed" | "all";
20
- type GithubFetcher = (cwd: string, state: GithubState) => Promise<GithubItem[]>;
21
- interface GithubSourceOptions {
22
- /** Working directory used to locate the repo. `gh` resolves the repo
23
- * from the git remote of this dir. Default: `process.cwd()`. */
24
- cwd?: string;
25
- /** Trigger regex. Default: `/(?<=^|\s)#/` — `#` preceded by start-of-
26
- * string or whitespace (same lookbehind trick as `filesSource`). */
27
- trigger?: RegExp;
28
- /** Prepended to the accepted value so the trigger character stays in
29
- * the input. Default: `"#"`. */
30
- prefix?: string;
31
- /** Which issues / PRs to include. Default: `"open"`. */
32
- state?: GithubState;
33
- /** Per-kind cap passed to `gh`. Default: `50`. */
34
- limit?: number;
35
- /** Override the fetch implementation. Mainly useful for tests — the
36
- * default shells out to `gh`. The fetcher is called at most once per
37
- * `githubSource` instance; results are cached thereafter. */
38
- fetcher?: GithubFetcher;
39
- }
40
- /**
41
- * Completion source for GitHub issues and pull requests from the repo
42
- * at `cwd`. Shells out to the `gh` CLI on first use, caches the result,
43
- * and fuzzy-filters locally on subsequent calls so typing stays snappy.
44
- *
45
- * Accepts insert `#123 ` into the input — ready for a markdown-style
46
- * reference in a chat message or commit subject.
47
- *
48
- * ```ts
49
- * autocomplete({
50
- * input: "chat-input",
51
- * sources: {
52
- * gh: githubSource(),
53
- * },
54
- * })
55
- * ```
56
- *
57
- * Silently returns no items when `gh` isn't installed, the user isn't
58
- * authenticated, or the directory isn't a GitHub repo — so it's safe
59
- * to wire up unconditionally.
60
- */
61
- declare function githubSource(opts?: GithubSourceOptions): CompletionSource<GithubItem>;
62
- //#endregion
63
- export { GithubFetcher, GithubItem, GithubSourceOptions, GithubState, githubSource };
64
- //# sourceMappingURL=github.d.mts.map
1
+ import { a as githubSource, i as GithubState, n as GithubItem, r as GithubSourceOptions, t as GithubFetcher } from "../../github-DS00VoOj.mjs";
2
+ export { GithubFetcher, GithubItem, GithubSourceOptions, GithubState, githubSource };
@@ -1,137 +1,2 @@
1
- import { stringWidth } from "@zaly/shared/ansi";
2
- import { spawn } from "node:child_process";
3
- //#region src/widgets/completions/github.ts
4
- /**
5
- * Completion source for GitHub issues and pull requests from the repo
6
- * at `cwd`. Shells out to the `gh` CLI on first use, caches the result,
7
- * and fuzzy-filters locally on subsequent calls so typing stays snappy.
8
- *
9
- * Accepts insert `#123 ` into the input — ready for a markdown-style
10
- * reference in a chat message or commit subject.
11
- *
12
- * ```ts
13
- * autocomplete({
14
- * input: "chat-input",
15
- * sources: {
16
- * gh: githubSource(),
17
- * },
18
- * })
19
- * ```
20
- *
21
- * Silently returns no items when `gh` isn't installed, the user isn't
22
- * authenticated, or the directory isn't a GitHub repo — so it's safe
23
- * to wire up unconditionally.
24
- */
25
- function githubSource(opts = {}) {
26
- const cwd = opts.cwd ?? process.cwd();
27
- const trigger = opts.trigger ?? /(?<=^|\s)#/;
28
- const prefix = opts.prefix ?? "#";
29
- const state = opts.state ?? "open";
30
- const limit = opts.limit ?? 50;
31
- const fetcher = opts.fetcher ?? defaultFetcher(limit);
32
- let cache;
33
- return {
34
- accept: (item) => `${prefix}${item.number} `,
35
- async complete(_query, match) {
36
- cache ??= fetcher(cwd, state).catch(() => []);
37
- const items = await cache;
38
- const out = [];
39
- for (const item of items) {
40
- const score = match(`#${item.number} ${item.title}`);
41
- if (!score) continue;
42
- out.push({
43
- ...item,
44
- score
45
- });
46
- }
47
- return out;
48
- },
49
- render: defaultRender,
50
- triggers: [trigger]
51
- };
52
- }
53
- const defaultRender = (item, ctx) => {
54
- const { style } = ctx;
55
- const num = `#${item.number}`;
56
- const stateSlot = stateStyleSlot(item.state);
57
- const typeLabel = item.type === "pr" ? "pr" : "issue";
58
- const author = item.author?.login ? `@${item.author.login}` : "";
59
- const lead = `${style.add("optionName")(num)} ${style.add(stateSlot)(`${item.state}·${typeLabel}`)} ${item.title}`;
60
- if (author === "") return lead;
61
- const gap = 2;
62
- const leadW = stringWidth(lead);
63
- const hintW = stringWidth(author);
64
- const padded = ctx.width - leadW - hintW - gap;
65
- if (padded < 1) return lead;
66
- return lead + " ".repeat(padded + gap) + style.add("optionDesc")(author);
67
- };
68
- function stateStyleSlot(state) {
69
- if (state === "open") return "success";
70
- if (state === "merged") return "accent";
71
- return "muted";
72
- }
73
- /** Default fetcher — shells out to `gh issue list` + `gh pr list` in
74
- * parallel. Either failing is swallowed so a repo with only issues
75
- * (or only PRs) still works. */
76
- function defaultFetcher(limit) {
77
- const fields = "number,title,state,author,url";
78
- return async (cwd, state) => {
79
- const [issues, prs] = await Promise.all([runGh(cwd, [
80
- "issue",
81
- "list",
82
- "--state",
83
- state,
84
- "--json",
85
- fields,
86
- "--limit",
87
- String(limit)
88
- ]), runGh(cwd, [
89
- "pr",
90
- "list",
91
- "--state",
92
- state,
93
- "--json",
94
- fields,
95
- "--limit",
96
- String(limit)
97
- ])]);
98
- return [...parse(issues).map((x) => Object.assign(x, { type: "issue" })), ...parse(prs).map((x) => Object.assign(x, { type: "pr" }))].map((item) => Object.assign(item, { text: `#${item.number} ${item.title}` }));
99
- };
100
- }
101
- function parse(out) {
102
- try {
103
- return JSON.parse(out);
104
- } catch {
105
- return [];
106
- }
107
- }
108
- function runGh(cwd, args) {
109
- return new Promise((resolve) => {
110
- try {
111
- const child = spawn("gh", args, {
112
- cwd,
113
- stdio: [
114
- "ignore",
115
- "pipe",
116
- "ignore"
117
- ]
118
- });
119
- let stdout = "";
120
- child.stdout.on("data", (chunk) => {
121
- stdout += chunk.toString("utf8");
122
- });
123
- child.on("close", (code) => {
124
- resolve(code === 0 ? stdout : "");
125
- });
126
- child.on("error", () => {
127
- resolve("");
128
- });
129
- } catch {
130
- resolve("");
131
- }
132
- });
133
- }
134
- //#endregion
1
+ import { t as githubSource } from "../../github-Cy2hfWJ7.mjs";
135
2
  export { githubSource };
136
-
137
- //# sourceMappingURL=github.mjs.map
@@ -1,4 +1,4 @@
1
- import { ActionCompletionItem, ActionsSourceOptions, actionsSource } from "./actions.mjs";
2
- import { FilesSourceOptions, filesSource } from "./files.mjs";
3
- import { GithubFetcher, GithubItem, GithubSourceOptions, GithubState, githubSource } from "./github.mjs";
1
+ import { n as ActionsSourceOptions, r as actionsSource, t as ActionCompletionItem } from "../../actions-CnVzKVID.mjs";
2
+ import { n as filesSource, t as FilesSourceOptions } from "../../files-Aw3iWpXD.mjs";
3
+ import { a as githubSource, i as GithubState, n as GithubItem, r as GithubSourceOptions, t as GithubFetcher } from "../../github-DS00VoOj.mjs";
4
4
  export { ActionCompletionItem, ActionsSourceOptions, FilesSourceOptions, GithubFetcher, GithubItem, GithubSourceOptions, GithubState, actionsSource, filesSource, githubSource };
@@ -1,4 +1,4 @@
1
- import { actionsSource } from "./actions.mjs";
2
- import { filesSource } from "./files.mjs";
3
- import { githubSource } from "./github.mjs";
1
+ import { t as actionsSource } from "../../actions-DEIKF2ts.mjs";
2
+ import { t as filesSource } from "../../files-BvThQpOf.mjs";
3
+ import { t as githubSource } from "../../github-Cy2hfWJ7.mjs";
4
4
  export { actionsSource, filesSource, githubSource };
@@ -1,5 +1,5 @@
1
1
  import { J as Layout, P as RenderCtx, X as State, nt as Reactive, p as Node } from "../queries-DH3bj74K.mjs";
2
- import { WrapMode } from "../text.mjs";
2
+ import { t as WrapMode } from "../text-9lwQeqYr.mjs";
3
3
  //#region src/widgets/diff.d.ts
4
4
  interface DiffState {
5
5
  /** Pre-state file content. Plain string or reactive accessor —
@@ -1,8 +1,8 @@
1
1
  import { S as unwrap, h as memo, r as createAsync, w as useContext } from "../reactive-f7NpAi69.mjs";
2
2
  import { t as Node } from "../node-BZ7f6HzU.mjs";
3
- import { calcLayout, countLines } from "../text.mjs";
4
- import { t as RenderContext } from "../render-DxVLqqB9.mjs";
5
- import { t as codeToAnsi } from "../shiki-BrjVUkeh.mjs";
3
+ import { r as countLines, t as calcLayout } from "../text-q26V6_Sc.mjs";
4
+ import { t as RenderContext } from "../render-F8pVXN7h.mjs";
5
+ import { t as codeToAnsi } from "../shiki-BK-v9CtF.mjs";
6
6
  import { splitAnsi, stringWidth, wrapAnsi } from "@zaly/shared/ansi";
7
7
  import { basename, extname } from "pathe";
8
8
  //#region src/widgets/diff.ts
@@ -1,9 +1,2 @@
1
- import { text } from "./text.mjs";
2
- //#region src/widgets/divider.ts
3
- function divider(state = { style: "divider" }) {
4
- return text((ctx) => (state.char ?? "─").repeat(state.length ?? ctx.width), state);
5
- }
6
- //#endregion
1
+ import { t as divider } from "../divider-cclEAdPx.mjs";
7
2
  export { divider };
8
-
9
- //# sourceMappingURL=divider.mjs.map
@@ -1,37 +1,2 @@
1
- import { J as Layout, P as RenderCtx, p as Node } from "../queries-DH3bj74K.mjs";
2
- //#region src/widgets/image.d.ts
3
- interface ImageState {
4
- /**
5
- * Path to an image file. PNG passes through with zero decoding; other
6
- * formats (JPEG/WebP/GIF/AVIF/SVG) are read via image-meta for
7
- * dimensions and — for KGP terminals — converted once to a cached
8
- * temp PNG via sharp. iTerm2 accepts all formats natively.
9
- */
10
- src: string;
11
- /** Display width in terminal cells. Defaults to `ctx.width`. */
12
- width?: number;
13
- /**
14
- * Display height in terminal cells. When omitted, computed from the
15
- * source aspect ratio + `cellAspect`.
16
- */
17
- height?: number;
18
- /** Fallback text shown on terminals without an image protocol. */
19
- alt?: string;
20
- /**
21
- * Character cell aspect ratio (cellHeight / cellWidth). Most terminals
22
- * land around 2.0. Tweak if aspect-preserved images look stretched.
23
- */
24
- cellAspect?: number;
25
- }
26
- declare class Image extends Node<ImageState> {
27
- #private;
28
- constructor(state: ImageState);
29
- get fallback(): string[];
30
- layout(): Layout;
31
- protected _render(ctx: RenderCtx): Promise<string[]>;
32
- }
33
- declare function image(src: string, style?: Omit<ImageState, "src">): Image;
34
- declare function image(state: ImageState): Image;
35
- //#endregion
36
- export { Image, ImageState, image };
37
- //# sourceMappingURL=image.d.mts.map
1
+ import { n as ImageState, r as image, t as Image } from "../image-BTxDPPiT.mjs";
2
+ export { Image, ImageState, image };
@@ -1,6 +1,6 @@
1
1
  import { S as unwrap, w as useContext } from "../reactive-f7NpAi69.mjs";
2
2
  import { t as Node } from "../node-BZ7f6HzU.mjs";
3
- import { t as RenderContext } from "../render-DxVLqqB9.mjs";
3
+ import { t as RenderContext } from "../render-F8pVXN7h.mjs";
4
4
  import { s as loadKittyGraphics } from "../kitty-JbCJC0iQ.mjs";
5
5
  import { fileDetect } from "@zaly/shared/detect";
6
6
  import { imageInfo } from "@zaly/shared/image";