@tooee/view 0.7.3 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/subviews/code-subview.d.ts +2 -1
- package/dist/components/subviews/code-subview.d.ts.map +1 -1
- package/dist/components/subviews/code-subview.js +2 -15
- package/dist/components/subviews/code-subview.js.map +1 -1
- package/dist/components/subviews/custom-subview.d.ts +2 -1
- package/dist/components/subviews/custom-subview.d.ts.map +1 -1
- package/dist/components/subviews/custom-subview.js +3 -13
- package/dist/components/subviews/custom-subview.js.map +1 -1
- package/dist/components/subviews/diff-subview.d.ts +2 -1
- package/dist/components/subviews/diff-subview.d.ts.map +1 -1
- package/dist/components/subviews/diff-subview.js +23 -33
- package/dist/components/subviews/diff-subview.js.map +1 -1
- package/dist/components/subviews/image-subview.d.ts +2 -1
- package/dist/components/subviews/image-subview.d.ts.map +1 -1
- package/dist/components/subviews/image-subview.js +4 -9
- package/dist/components/subviews/image-subview.js.map +1 -1
- package/dist/components/subviews/markdown-subview.d.ts +2 -1
- package/dist/components/subviews/markdown-subview.d.ts.map +1 -1
- package/dist/components/subviews/markdown-subview.js +8 -15
- package/dist/components/subviews/markdown-subview.js.map +1 -1
- package/dist/components/subviews/table-subview.d.ts +2 -1
- package/dist/components/subviews/table-subview.d.ts.map +1 -1
- package/dist/components/subviews/table-subview.js +9 -48
- package/dist/components/subviews/table-subview.js.map +1 -1
- package/dist/components/view-state.d.ts +2 -1
- package/dist/components/view-state.d.ts.map +1 -1
- package/dist/components/view-state.js.map +1 -1
- package/dist/content-loader-store.d.ts +3 -2
- package/dist/content-loader-store.d.ts.map +1 -1
- package/dist/content-loader-store.js +5 -4
- package/dist/content-loader-store.js.map +1 -1
- package/dist/default-provider.d.ts.map +1 -1
- package/dist/default-provider.js +29 -29
- package/dist/default-provider.js.map +1 -1
- package/dist/directory-view.d.ts +2 -1
- package/dist/directory-view.d.ts.map +1 -1
- package/dist/directory-view.js +2 -1
- package/dist/directory-view.js.map +1 -1
- package/dist/hooks/use-content-commands.d.ts +5 -3
- package/dist/hooks/use-content-commands.d.ts.map +1 -1
- package/dist/hooks/use-content-commands.js.map +1 -1
- package/dist/hooks/use-content-document.d.ts +28 -0
- package/dist/hooks/use-content-document.d.ts.map +1 -0
- package/dist/hooks/use-content-document.js +21 -0
- package/dist/hooks/use-content-document.js.map +1 -0
- package/dist/hooks/use-content-loader.d.ts +10 -6
- package/dist/hooks/use-content-loader.d.ts.map +1 -1
- package/dist/hooks/use-content-loader.js +1 -1
- package/dist/hooks/use-content-loader.js.map +1 -1
- package/dist/hooks/use-view-command-context.d.ts +4 -2
- package/dist/hooks/use-view-command-context.d.ts.map +1 -1
- package/dist/hooks/use-view-command-context.js +6 -1
- package/dist/hooks/use-view-command-context.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/launch.d.ts +5 -0
- package/dist/launch.d.ts.map +1 -1
- package/dist/launch.js +15 -4
- package/dist/launch.js.map +1 -1
- package/dist/link-handlers.d.ts +21 -0
- package/dist/link-handlers.d.ts.map +1 -0
- package/dist/link-handlers.js +35 -0
- package/dist/link-handlers.js.map +1 -0
- package/dist/markdown-links.d.ts +21 -0
- package/dist/markdown-links.d.ts.map +1 -0
- package/dist/markdown-links.js +74 -0
- package/dist/markdown-links.js.map +1 -0
- package/dist/standalone-router.d.ts +11 -0
- package/dist/standalone-router.d.ts.map +1 -0
- package/dist/standalone-router.js +85 -0
- package/dist/standalone-router.js.map +1 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +3 -33
- package/dist/types.js.map +1 -1
- package/dist/view.d.ts +2 -1
- package/dist/view.d.ts.map +1 -1
- package/dist/view.js.map +1 -1
- package/package.json +14 -11
- package/src/components/subviews/code-subview.tsx +8 -20
- package/src/components/subviews/custom-subview.tsx +9 -19
- package/src/components/subviews/diff-subview.tsx +35 -43
- package/src/components/subviews/image-subview.tsx +12 -11
- package/src/components/subviews/markdown-subview.tsx +16 -22
- package/src/components/subviews/table-subview.tsx +16 -56
- package/src/components/view-state.tsx +2 -1
- package/src/content-loader-store.ts +8 -5
- package/src/default-provider.ts +34 -32
- package/src/directory-view.tsx +4 -2
- package/src/hooks/use-content-commands.ts +6 -1
- package/src/hooks/use-content-document.ts +54 -0
- package/src/hooks/use-content-loader.ts +17 -3
- package/src/hooks/use-view-command-context.ts +16 -4
- package/src/index.ts +4 -0
- package/src/launch.tsx +27 -10
- package/src/link-handlers.ts +60 -0
- package/src/markdown-links.ts +88 -0
- package/src/standalone-router.tsx +122 -0
- package/src/types.ts +4 -35
- package/src/view.tsx +2 -1
- package/dist/hooks/index.d.ts +0 -5
- package/dist/hooks/index.d.ts.map +0 -1
- package/dist/hooks/index.js +0 -4
- package/dist/hooks/index.js.map +0 -1
- package/src/hooks/index.ts +0 -11
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { statSync } from "node:fs";
|
|
2
|
+
import nodePath from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { Lexer } from "marked";
|
|
5
|
+
/** Existing local files only. Fragments are validated, then open at the file top. */
|
|
6
|
+
export const resolveMarkdownLink = function resolveMarkdownLink(href, baseDir, currentPath) {
|
|
7
|
+
try {
|
|
8
|
+
const decoded = decodeURIComponent(href);
|
|
9
|
+
if (/[\p{Cc}\\]/u.test(decoded)) {
|
|
10
|
+
return { status: "unsupported" };
|
|
11
|
+
}
|
|
12
|
+
const target = href.trim();
|
|
13
|
+
if (!target || target.startsWith("//")) {
|
|
14
|
+
return { status: "unsupported" };
|
|
15
|
+
}
|
|
16
|
+
const [rawPath] = target.split("#", 1);
|
|
17
|
+
if (rawPath.includes("?")) {
|
|
18
|
+
return { status: "unsupported" };
|
|
19
|
+
}
|
|
20
|
+
let path;
|
|
21
|
+
if (/^[a-zA-Z][a-zA-Z\d+.-]*:/u.test(rawPath)) {
|
|
22
|
+
// Check the authority before URL normalizes localhost into an empty host.
|
|
23
|
+
if (!/^file:\/\/\//iu.test(rawPath)) {
|
|
24
|
+
return { status: "unsupported" };
|
|
25
|
+
}
|
|
26
|
+
const url = new URL(rawPath);
|
|
27
|
+
if (url.hostname || url.search) {
|
|
28
|
+
return { status: "unsupported" };
|
|
29
|
+
}
|
|
30
|
+
path = fileURLToPath(url);
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
path = rawPath
|
|
34
|
+
? nodePath.resolve(baseDir, decodeURIComponent(rawPath))
|
|
35
|
+
: (currentPath ?? baseDir);
|
|
36
|
+
}
|
|
37
|
+
const absolute = nodePath.resolve(path);
|
|
38
|
+
try {
|
|
39
|
+
const stat = statSync(absolute);
|
|
40
|
+
if (stat.isFile()) {
|
|
41
|
+
return { path: absolute, status: "file" };
|
|
42
|
+
}
|
|
43
|
+
return stat.isDirectory()
|
|
44
|
+
? { path: absolute, status: "directory" }
|
|
45
|
+
: { status: "unsupported" };
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
return { path: absolute, status: "missing" };
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
return { status: "unsupported" };
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
/** Ordinary inline links in source order, skipping images and code spans. */
|
|
56
|
+
const collect = (tokens, links) => {
|
|
57
|
+
for (const token of tokens) {
|
|
58
|
+
if (token.type === "link" && "href" in token) {
|
|
59
|
+
// SAFETY: Marked's Generic token prevents discriminator narrowing.
|
|
60
|
+
// oxlint-disable-next-line typescript/no-unsafe-type-assertion -- checked Marked link discriminator
|
|
61
|
+
const { href, text } = token;
|
|
62
|
+
links.push({ href, text });
|
|
63
|
+
}
|
|
64
|
+
else if (["strong", "em", "del"].includes(token.type) && "tokens" in token && token.tokens) {
|
|
65
|
+
collect(token.tokens, links);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
export const markdownLinks = function markdownLinks(line) {
|
|
70
|
+
const links = [];
|
|
71
|
+
collect(Lexer.lexInline(line), links);
|
|
72
|
+
return links;
|
|
73
|
+
};
|
|
74
|
+
//# sourceMappingURL=markdown-links.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown-links.js","sourceRoot":"","sources":["../src/markdown-links.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAS/B,qFAAqF;AACrF,MAAM,CAAC,MAAM,mBAAmB,GAAG,SAAS,mBAAmB,CAC7D,IAAY,EACZ,OAAe,EACf,WAAoB;IAEpB,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;YAChC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC;QACnC,CAAC;QACD,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;QAC3B,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YACvC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC;QACnC,CAAC;QACD,MAAM,CAAC,OAAO,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;QACvC,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAC1B,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC;QACnC,CAAC;QACD,IAAI,IAAY,CAAC;QACjB,IAAI,2BAA2B,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;YAC9C,0EAA0E;YAC1E,IAAI,CA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E;AAC7E,MAAM,OAAO,GAAG,CAAC,MAAe,EAAE,KAAqB,EAAQ,EAAE;IAC/D,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,IAAI,MAAM,IAAI,KAAK,EAAE,CAAC;YAC7C,mEAAmE;YACnE,oGAAoG;YACpG,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,KAAoB,CAAC;YAC5C,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAC7B,CAAC;aAAM,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,QAAQ,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;YAC7F,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC;AACH,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,aAAa,CAAC,IAAY;IAC9D,MAAM,KAAK,GAAmB,EAAE,CAAC;IACjC,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC;IACtC,OAAO,KAAK,CAAC;AACf,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RouteDefinition, RouterInstance } from "@tooee/router";
|
|
2
|
+
import type { ViewLaunchOptions } from "./launch.js";
|
|
3
|
+
interface StandaloneRouter {
|
|
4
|
+
documentRoute: RouteDefinition<{
|
|
5
|
+
path?: string;
|
|
6
|
+
}>;
|
|
7
|
+
router: RouterInstance;
|
|
8
|
+
}
|
|
9
|
+
export declare const createStandaloneRouter: (options: ViewLaunchOptions) => StandaloneRouter;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=standalone-router.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"standalone-router.d.ts","sourceRoot":"","sources":["../src/standalone-router.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAS,eAAe,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAO5E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAoBrD,UAAU,gBAAgB;IACxB,aAAa,EAAE,eAAe,CAAC;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAClD,MAAM,EAAE,cAAc,CAAC;CACxB;AAED,eAAO,MAAM,sBAAsB,YACxB,iBAAiB,KACzB,gBAyEF,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@opentui/react/jsx-runtime";
|
|
2
|
+
/* oxlint-disable no-use-before-define -- the screen closes over the route initialized before router startup */
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
import { useChooseDialog } from "@tooee/choose";
|
|
5
|
+
import { useCommand } from "@tooee/commands";
|
|
6
|
+
import { createRoute, createRouter, useNavigate, useParams, useRouter, useRouterCommands, } from "@tooee/router";
|
|
7
|
+
import path from "node:path";
|
|
8
|
+
import { createFileProvider } from "./default-provider.js";
|
|
9
|
+
import { runLinkHandlers } from "./link-handlers.js";
|
|
10
|
+
import { markdownLinks } from "./markdown-links.js";
|
|
11
|
+
import { getTextContent } from "./types.js";
|
|
12
|
+
import { View } from "./view.js";
|
|
13
|
+
const documentParams = {
|
|
14
|
+
parse: (value) => {
|
|
15
|
+
/* oxlint-disable anti-slop/no-runtime-typeof -- route params are decoded at this boundary */
|
|
16
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
17
|
+
throw new TypeError("Expected document params");
|
|
18
|
+
}
|
|
19
|
+
if (!("path" in value) || value.path === undefined) {
|
|
20
|
+
return {};
|
|
21
|
+
}
|
|
22
|
+
if (typeof value.path !== "string" || !path.isAbsolute(value.path)) {
|
|
23
|
+
throw new TypeError("Expected an absolute document path");
|
|
24
|
+
}
|
|
25
|
+
/* oxlint-enable anti-slop/no-runtime-typeof */
|
|
26
|
+
return { path: value.path };
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
export const createStandaloneRouter = function createStandaloneRouter(options) {
|
|
30
|
+
const DocumentScreen = function DocumentScreen() {
|
|
31
|
+
useRouterCommands();
|
|
32
|
+
const { path: documentPath } = useParams(documentRoute);
|
|
33
|
+
const navigate = useNavigate();
|
|
34
|
+
const { stack } = useRouter();
|
|
35
|
+
const chooseLink = useChooseDialog();
|
|
36
|
+
const provider = useMemo(() => documentPath === undefined ? options.contentProvider : createFileProvider(documentPath), [documentPath]);
|
|
37
|
+
const activate = (href, command) => {
|
|
38
|
+
if (options.filePath === undefined) {
|
|
39
|
+
command.toast?.toast({ level: "info", message: "Links need a source file" });
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
const currentPath = path.resolve(documentPath ?? options.filePath);
|
|
43
|
+
return runLinkHandlers(options.linkHandlers ?? [], { baseDir: path.dirname(currentPath), currentPath, href }, { command, documentRoute, navigate });
|
|
44
|
+
};
|
|
45
|
+
useCommand({
|
|
46
|
+
handler: async (context) => {
|
|
47
|
+
// Source positions are zero-based, unlike the displayed line numbers.
|
|
48
|
+
const line = context.document?.activeAnchor?.source?.primary?.start.line;
|
|
49
|
+
const content = context.view?.content;
|
|
50
|
+
if (line === undefined || content === undefined) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const links = markdownLinks(getTextContent(content).split("\n")[line] ?? "");
|
|
54
|
+
// One link follows directly; several open a chooser so none is silently preferred.
|
|
55
|
+
const link = links.length > 1
|
|
56
|
+
? await chooseLink.open({
|
|
57
|
+
items: links,
|
|
58
|
+
prompt: "Follow link",
|
|
59
|
+
toItem: (item) => ({ description: item.href, text: item.text }),
|
|
60
|
+
})
|
|
61
|
+
: (links[0] ?? null);
|
|
62
|
+
if (link !== null) {
|
|
63
|
+
activate(link.href, context);
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
hotkey: "enter",
|
|
67
|
+
id: "view.follow-link",
|
|
68
|
+
modes: ["cursor"],
|
|
69
|
+
title: "Follow Markdown link",
|
|
70
|
+
when: (context) => context.view?.format === "markdown",
|
|
71
|
+
});
|
|
72
|
+
return (_jsx(View, { actions: options.actions, codeBlockRenderers: options.codeBlockRenderers, contentProvider: provider, onMarkdownLinkActivate: activate, renderers: options.renderers }, `${stack.length}:${documentPath ?? ""}`));
|
|
73
|
+
};
|
|
74
|
+
const documentRoute = createRoute({
|
|
75
|
+
component: DocumentScreen,
|
|
76
|
+
id: "view.document",
|
|
77
|
+
params: documentParams,
|
|
78
|
+
});
|
|
79
|
+
const router = createRouter({
|
|
80
|
+
initial: { routeId: documentRoute.id },
|
|
81
|
+
routes: [documentRoute],
|
|
82
|
+
});
|
|
83
|
+
return { documentRoute, router };
|
|
84
|
+
};
|
|
85
|
+
//# sourceMappingURL=standalone-router.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"standalone-router.js","sourceRoot":"","sources":["../src/standalone-router.tsx"],"names":[],"mappings":";AAAA,+GAA+G;AAC/G,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EACL,WAAW,EACX,YAAY,EACZ,WAAW,EACX,SAAS,EACT,SAAS,EACT,iBAAiB,GAClB,MAAM,eAAe,CAAC;AAEvB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,OA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|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,QAAQ,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAChF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,QAAQ,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAChF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAI5C,MAAM,MAAM,OAAO,GACf,eAAe,GACf,WAAW,GACX,WAAW,GACX,YAAY,GACZ,YAAY,GACZ,WAAW,CAAC;AAEhB,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAE9C,4EAA4E;AAE5E,MAAM,MAAM,2BAA2B,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC;AAE7F,UAAU,WAAW;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,eAAgB,SAAQ,WAAW;IAClD,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,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
|
+
import { formatTableCell } from "@tooee/renderers";
|
|
1
2
|
// === Utilities ===
|
|
2
3
|
const BUILTIN_FORMATS = new Set(["markdown", "code", "text", "image", "table", "diff"]);
|
|
3
4
|
export const isBuiltinContent = function isBuiltinContent(content) {
|
|
@@ -6,38 +7,6 @@ export const isBuiltinContent = function isBuiltinContent(content) {
|
|
|
6
7
|
export const isCustomContent = function isCustomContent(content) {
|
|
7
8
|
return !BUILTIN_FORMATS.has(content.format);
|
|
8
9
|
};
|
|
9
|
-
const stringifyCell = function stringifyCell(value) {
|
|
10
|
-
if (value === null || value === undefined) {
|
|
11
|
-
return "";
|
|
12
|
-
}
|
|
13
|
-
if (typeof value === "string") {
|
|
14
|
-
return value;
|
|
15
|
-
}
|
|
16
|
-
if (typeof value === "number" || typeof value === "boolean") {
|
|
17
|
-
return String(value);
|
|
18
|
-
}
|
|
19
|
-
if (typeof value === "string") {
|
|
20
|
-
return value;
|
|
21
|
-
}
|
|
22
|
-
if (typeof value === "number" ||
|
|
23
|
-
typeof value === "bigint" ||
|
|
24
|
-
typeof value === "boolean" ||
|
|
25
|
-
typeof value === "symbol") {
|
|
26
|
-
return value.toString();
|
|
27
|
-
}
|
|
28
|
-
if (value === null || value === undefined) {
|
|
29
|
-
return String(value);
|
|
30
|
-
}
|
|
31
|
-
if (typeof value === "function") {
|
|
32
|
-
return Function.prototype.toString.call(value);
|
|
33
|
-
}
|
|
34
|
-
try {
|
|
35
|
-
return JSON.stringify(value);
|
|
36
|
-
}
|
|
37
|
-
catch {
|
|
38
|
-
return Array.isArray(value) ? value.join(",") : Object.prototype.toString.call(value);
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
10
|
export const getTextContent = function getTextContent(content) {
|
|
42
11
|
if (content.getTextContent) {
|
|
43
12
|
return content.getTextContent();
|
|
@@ -59,6 +28,7 @@ export const getTextContent = function getTextContent(content) {
|
|
|
59
28
|
return content.text;
|
|
60
29
|
}
|
|
61
30
|
case "image": {
|
|
31
|
+
// oxlint-disable-next-line anti-slop/no-runtime-typeof -- ImageSource is OpenTUI's public string-or-binary union; only its string and URL variants have text content
|
|
62
32
|
if (typeof content.src === "string") {
|
|
63
33
|
return content.src;
|
|
64
34
|
}
|
|
@@ -66,7 +36,7 @@ export const getTextContent = function getTextContent(content) {
|
|
|
66
36
|
}
|
|
67
37
|
case "table": {
|
|
68
38
|
const headers = content.columns.map((column) => column.header ?? column.key);
|
|
69
|
-
const rowLines = content.rows.map((row) => content.columns.map((column) =>
|
|
39
|
+
const rowLines = content.rows.map((row) => content.columns.map((column) => formatTableCell(row[column.key])).join("\t"));
|
|
70
40
|
return [headers.join("\t"), ...rowLines].join("\n");
|
|
71
41
|
}
|
|
72
42
|
default: {
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AA2InD,oBAAoB;AAEpB,MAAM,eAAe,GAAG,IAAI,GAAG,CAAS,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;AAEhG,MAAM,CAAC,MAAM,gBAAgB,GAAG,SAAS,gBAAgB,CAAC,OAAmB;IAC3E,OAAO,eAAe,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AAC7C,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,SAAS,eAAe,CACrD,OAAmB;IAEnB,OAAO,CAAC,eAAe,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AAC9C,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,SAAS,cAAc,CAAC,OAAmB;IACvE,IAAI,OAAO,CAAC,cAAc,EAAE,CAA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OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACtD,CAAC;QACD,SAAS,CAAC;YACR,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;AACH,CAAC,CAAC"}
|
package/dist/view.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ActionDefinition } from "@tooee/commands";
|
|
2
2
|
import type { CodeBlockRenderer } from "@tooee/renderers";
|
|
3
3
|
import type { ContentProvider, ContentRenderer, MarkdownLinkActivateHandler } from "./types.js";
|
|
4
|
+
import type { ReactNode } from "react";
|
|
4
5
|
interface ViewProps {
|
|
5
6
|
contentProvider: ContentProvider;
|
|
6
7
|
actions?: ActionDefinition[];
|
|
@@ -13,6 +14,6 @@ interface ViewProps {
|
|
|
13
14
|
/** Handles primary-button activation of inline Markdown links. */
|
|
14
15
|
onMarkdownLinkActivate?: MarkdownLinkActivateHandler;
|
|
15
16
|
}
|
|
16
|
-
export declare const View: ({ contentProvider, actions, renderers, codeBlockRenderers, onMarkdownLinkActivate, }: ViewProps) =>
|
|
17
|
+
export declare const View: ({ contentProvider, actions, renderers, codeBlockRenderers, onMarkdownLinkActivate, }: ViewProps) => ReactNode;
|
|
17
18
|
export {};
|
|
18
19
|
//# sourceMappingURL=view.d.ts.map
|
package/dist/view.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../src/view.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAExD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAG1D,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../src/view.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAExD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAG1D,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC;AAWhG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,UAAU,SAAS;IACjB,eAAe,EAAE,eAAe,CAAC;IACjC,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAC5C;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IACvD,kEAAkE;IAClE,sBAAsB,CAAC,EAAE,2BAA2B,CAAC;CACtD;AAED,eAAO,MAAM,IAAI,yFAMd,SAAS,KAAG,SAoFd,CAAC"}
|
package/dist/view.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.js","sourceRoot":"","sources":["../src/view.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAIzC,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EACL,eAAe,EACf,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,aAAa,GACd,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"view.js","sourceRoot":"","sources":["../src/view.tsx"],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AAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,KAAM,MAAM,GAAI,CAAC;IAC/E,CAAC;IAED,QAAQ,OAAO,CAAC,MAAM,EAAE,CAAC;QACvB,KAAK,UAAU,EAAE,CAAC;YAChB,OAAO,CACL,KAAC,eAAe,IACd,OAAO,EAAE,OAAO,EAChB,kBAAkB,EAAE,wBAAwB,EAC5C,cAAc,EAAE,sBAAsB,KAClC,MAAM,GACV,CACH,CAAC;QACJ,CAAC;QACD,KAAK,MAAM,CAAC;QACZ,KAAK,MAAM,EAAE,CAAC;YACZ,OAAO,KAAC,WAAW,IAAC,OAAO,EAAE,OAAO,KAAM,MAAM,GAAI,CAAC;QACvD,CAAC;QACD,KAAK,OAAO,EAAE,CAAC;YACb,OAAO,KAAC,YAAY,IAAC,OAAO,EAAE,OAAO,KAAM,MAAM,GAAI,CAAC;QACxD,CAAC;QACD,KAAK,OAAO,EAAE,CAAC;YACb,OAAO,KAAC,YAAY,IAAC,OAAO,EAAE,OAAO,KAAM,MAAM,GAAI,CAAC;QACxD,CAAC;QACD,KAAK,MAAM,EAAE,CAAC;YACZ,OAAO,KAAC,WAAW,IAAC,OAAO,EAAE,OAAO,KAAM,MAAM,GAAI,CAAC;QACvD,CAAC;QACD,SAAS,CAAC;YACR,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;AACH,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tooee/view",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Terminal content viewer for markdown, code, text, images, and tables",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -40,16 +40,18 @@
|
|
|
40
40
|
"typecheck": "tsc --noEmit"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@tooee/
|
|
44
|
-
"@tooee/
|
|
45
|
-
"@tooee/
|
|
46
|
-
"@tooee/
|
|
47
|
-
"@tooee/
|
|
48
|
-
"@tooee/
|
|
49
|
-
"@tooee/
|
|
50
|
-
"@tooee/
|
|
51
|
-
"@tooee/
|
|
52
|
-
"@tooee/
|
|
43
|
+
"@tooee/choose": "0.9.0",
|
|
44
|
+
"@tooee/commands": "0.9.0",
|
|
45
|
+
"@tooee/config": "0.9.0",
|
|
46
|
+
"@tooee/diff": "0.9.0",
|
|
47
|
+
"@tooee/layout": "0.9.0",
|
|
48
|
+
"@tooee/marks": "0.9.0",
|
|
49
|
+
"@tooee/overlays": "0.9.0",
|
|
50
|
+
"@tooee/renderers": "0.9.0",
|
|
51
|
+
"@tooee/router": "0.9.0",
|
|
52
|
+
"@tooee/search": "0.9.0",
|
|
53
|
+
"@tooee/shell": "0.9.0",
|
|
54
|
+
"@tooee/themes": "0.9.0",
|
|
53
55
|
"@xstate/store": "^4",
|
|
54
56
|
"@xstate/store-react": "^2",
|
|
55
57
|
"marked": "^17.0.4"
|
|
@@ -57,6 +59,7 @@
|
|
|
57
59
|
"devDependencies": {
|
|
58
60
|
"@opentui/core": "^0.5.1",
|
|
59
61
|
"@opentui/react": "^0.5.1",
|
|
62
|
+
"@tooee/test-support": "0.7.3",
|
|
60
63
|
"@types/bun": "^1.3.10",
|
|
61
64
|
"@types/react": "^19.2.14",
|
|
62
65
|
"typescript": "^5.9.3"
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useMemo } from "react";
|
|
2
2
|
import { CodeView, sourceLines, sourceLineAdapter } from "@tooee/renderers";
|
|
3
3
|
import type { SourceLineRow } from "@tooee/renderers";
|
|
4
|
-
import { useDocumentController } from "@tooee/shell";
|
|
5
4
|
import type { CodeContent, TextContent } from "../../types.js";
|
|
6
|
-
import {
|
|
5
|
+
import { useContentDocument } from "../../hooks/use-content-document.js";
|
|
7
6
|
import { ViewScreen } from "../view-screen.js";
|
|
8
7
|
import type { SubviewProps } from "./types.js";
|
|
8
|
+
import type { ReactNode } from "react";
|
|
9
9
|
|
|
10
10
|
interface CodeSubviewProps extends SubviewProps {
|
|
11
11
|
content: CodeContent | TextContent;
|
|
@@ -16,28 +16,16 @@ export const CodeSubview = function CodeSubview({
|
|
|
16
16
|
decorations,
|
|
17
17
|
actions,
|
|
18
18
|
...screen
|
|
19
|
-
}: CodeSubviewProps):
|
|
19
|
+
}: CodeSubviewProps): ReactNode {
|
|
20
20
|
const textContent = content.format === "code" ? content.code : content.text;
|
|
21
21
|
// One navigation row per physical source line; row index is the source line.
|
|
22
22
|
const lineRows = useMemo(() => sourceLines(textContent), [textContent]);
|
|
23
23
|
|
|
24
|
-
const { showLineNumbers } =
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
contextMenu: actions,
|
|
30
|
-
decorations,
|
|
31
|
-
multiSelect: true,
|
|
32
|
-
rows: lineRows,
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
const statusItems = useMemo(
|
|
36
|
-
() => [
|
|
37
|
-
{ label: "Format:", value: content.format },
|
|
38
|
-
{ label: "Lines:", value: String(lineRows.length) },
|
|
39
|
-
],
|
|
40
|
-
[content.format, lineRows.length],
|
|
24
|
+
const { document, showLineNumbers, statusItems } = useContentDocument<SourceLineRow>(
|
|
25
|
+
lineRows,
|
|
26
|
+
sourceLineAdapter,
|
|
27
|
+
{ actions, content, decorations, textContent },
|
|
28
|
+
{ multiSelect: true },
|
|
41
29
|
);
|
|
42
30
|
|
|
43
31
|
return (
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { useMemo } from "react";
|
|
2
2
|
import { CodeView, sourceLines, sourceLineAdapter } from "@tooee/renderers";
|
|
3
3
|
import type { SourceLineRow } from "@tooee/renderers";
|
|
4
|
-
import { useDocumentController } from "@tooee/shell";
|
|
5
4
|
import { getTextContent } from "../../types.js";
|
|
6
5
|
import type { CustomContent, ContentRenderer } from "../../types.js";
|
|
7
|
-
import {
|
|
6
|
+
import { useContentDocument } from "../../hooks/use-content-document.js";
|
|
8
7
|
import { ViewScreen } from "../view-screen.js";
|
|
9
8
|
import type { SubviewProps } from "./types.js";
|
|
9
|
+
import type { ReactNode } from "react";
|
|
10
10
|
|
|
11
11
|
interface CustomSubviewProps extends SubviewProps {
|
|
12
12
|
content: CustomContent;
|
|
@@ -19,27 +19,17 @@ export const CustomSubview = function CustomSubview({
|
|
|
19
19
|
actions,
|
|
20
20
|
renderers,
|
|
21
21
|
...screen
|
|
22
|
-
}: CustomSubviewProps):
|
|
22
|
+
}: CustomSubviewProps): ReactNode {
|
|
23
23
|
const textContent = useMemo(() => getTextContent(content), [content]);
|
|
24
24
|
// Fallback rows are source lines; row index is the source line.
|
|
25
25
|
const lineRows = useMemo(() => sourceLines(textContent), [textContent]);
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
multiSelect: true,
|
|
34
|
-
rows: lineRows,
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
const statusItems = useMemo(
|
|
38
|
-
() => [
|
|
39
|
-
{ label: "Format:", value: content.format },
|
|
40
|
-
{ label: "Lines:", value: String(lineRows.length) },
|
|
41
|
-
],
|
|
42
|
-
[content.format, lineRows.length],
|
|
27
|
+
const { document, statusItems } = useContentDocument<SourceLineRow>(
|
|
28
|
+
lineRows,
|
|
29
|
+
sourceLineAdapter,
|
|
30
|
+
{ actions, content, decorations, textContent },
|
|
31
|
+
// Custom content has no action rows of its own, so no context menu is bound.
|
|
32
|
+
{ contextMenu: false, multiSelect: true },
|
|
43
33
|
);
|
|
44
34
|
|
|
45
35
|
const customRenderer = renderers?.[content.format];
|
|
@@ -5,13 +5,13 @@ import { useCommand } from "@tooee/commands";
|
|
|
5
5
|
import { useConfig } from "@tooee/config";
|
|
6
6
|
import { useOverlay } from "@tooee/overlays";
|
|
7
7
|
import type { OverlayCloseReason } from "@tooee/overlays";
|
|
8
|
-
import { useDocumentController } from "@tooee/shell";
|
|
9
8
|
import type { DocumentRowAdapter } from "@tooee/shell";
|
|
10
9
|
import type { DiffContent } from "../../types.js";
|
|
11
|
-
import {
|
|
10
|
+
import { useContentDocument } from "../../hooks/use-content-document.js";
|
|
12
11
|
import { ViewScreen } from "../view-screen.js";
|
|
13
12
|
import { DiffFilePickerOverlay } from "../diff-file-picker.js";
|
|
14
13
|
import type { SubviewProps } from "./types.js";
|
|
14
|
+
import type { ReactNode } from "react";
|
|
15
15
|
|
|
16
16
|
interface DiffSubviewProps extends SubviewProps {
|
|
17
17
|
content: DiffContent;
|
|
@@ -41,7 +41,7 @@ export const DiffSubview = function DiffSubview({
|
|
|
41
41
|
decorations,
|
|
42
42
|
actions,
|
|
43
43
|
...screen
|
|
44
|
-
}: DiffSubviewProps):
|
|
44
|
+
}: DiffSubviewProps): ReactNode {
|
|
45
45
|
const config = useConfig();
|
|
46
46
|
const overlay = useOverlay();
|
|
47
47
|
const textContent = content.patch;
|
|
@@ -53,17 +53,38 @@ export const DiffSubview = function DiffSubview({
|
|
|
53
53
|
const [wrapLines, setWrapLines] = useState(config.view?.wrap ?? false);
|
|
54
54
|
const [horizontalOffset, setHorizontalOffset] = useState(0);
|
|
55
55
|
|
|
56
|
-
const { showLineNumbers } =
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
56
|
+
const { document, showLineNumbers, statusItems } = useContentDocument<DiffRow>(
|
|
57
|
+
model.rows,
|
|
58
|
+
DIFF_ROW_ADAPTER,
|
|
59
|
+
{ actions, content, decorations, textContent },
|
|
60
|
+
{
|
|
61
|
+
buildStatusItems: (currentDocument) => {
|
|
62
|
+
const activeRow =
|
|
63
|
+
currentDocument.activeIndex === null
|
|
64
|
+
? undefined
|
|
65
|
+
: model.rows[currentDocument.activeIndex];
|
|
66
|
+
return [
|
|
67
|
+
{ label: "Format:", value: content.format },
|
|
68
|
+
{ label: "Files:", value: String(model.files.length) },
|
|
69
|
+
{ label: "Changes:", value: `+${model.stats.additions} -${model.stats.deletions}` },
|
|
70
|
+
{ label: "Layout:", value: layout },
|
|
71
|
+
...(activeRow
|
|
72
|
+
? [
|
|
73
|
+
{
|
|
74
|
+
label: "At:",
|
|
75
|
+
value:
|
|
76
|
+
activeRow.hunkIndex >= 0
|
|
77
|
+
? `${activeRow.parent.path ?? activeRow.fileId}:${activeRow.hunkIndex + 1}`
|
|
78
|
+
: (activeRow.parent.path ?? activeRow.fileId),
|
|
79
|
+
},
|
|
80
|
+
]
|
|
81
|
+
: []),
|
|
82
|
+
];
|
|
83
|
+
},
|
|
84
|
+
multiSelect: true,
|
|
85
|
+
preserveCursorByKey: true,
|
|
86
|
+
},
|
|
87
|
+
);
|
|
67
88
|
|
|
68
89
|
const { activeIndex } = document;
|
|
69
90
|
// `setCursor` rather than `selectRow`: the latter stands down while a modal
|
|
@@ -178,35 +199,6 @@ export const DiffSubview = function DiffSubview({
|
|
|
178
199
|
title: "Go to file",
|
|
179
200
|
});
|
|
180
201
|
|
|
181
|
-
const activeRow = activeIndex === null ? undefined : model.rows[activeIndex];
|
|
182
|
-
const statusItems = useMemo(
|
|
183
|
-
() => [
|
|
184
|
-
{ label: "Format:", value: content.format },
|
|
185
|
-
{ label: "Files:", value: String(model.files.length) },
|
|
186
|
-
{ label: "Changes:", value: `+${model.stats.additions} -${model.stats.deletions}` },
|
|
187
|
-
{ label: "Layout:", value: layout },
|
|
188
|
-
...(activeRow
|
|
189
|
-
? [
|
|
190
|
-
{
|
|
191
|
-
label: "At:",
|
|
192
|
-
value:
|
|
193
|
-
activeRow.hunkIndex >= 0
|
|
194
|
-
? `${activeRow.parent.path ?? activeRow.fileId}:${activeRow.hunkIndex + 1}`
|
|
195
|
-
: (activeRow.parent.path ?? activeRow.fileId),
|
|
196
|
-
},
|
|
197
|
-
]
|
|
198
|
-
: []),
|
|
199
|
-
],
|
|
200
|
-
[
|
|
201
|
-
activeRow,
|
|
202
|
-
content.format,
|
|
203
|
-
layout,
|
|
204
|
-
model.files.length,
|
|
205
|
-
model.stats.additions,
|
|
206
|
-
model.stats.deletions,
|
|
207
|
-
],
|
|
208
|
-
);
|
|
209
|
-
|
|
210
202
|
return (
|
|
211
203
|
<ViewScreen
|
|
212
204
|
content={content}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { useEffect, useMemo, useState } from "react";
|
|
2
2
|
import { sourceLineAdapter, sourceLines } from "@tooee/renderers";
|
|
3
|
-
import { useDocumentController } from "@tooee/shell";
|
|
4
3
|
import type { SourceLineRow } from "@tooee/renderers";
|
|
5
4
|
import type { ImageContent } from "../../types.js";
|
|
6
5
|
import { getTextContent } from "../../types.js";
|
|
7
|
-
import {
|
|
6
|
+
import { useContentDocument } from "../../hooks/use-content-document.js";
|
|
8
7
|
import { ViewScreen } from "../view-screen.js";
|
|
9
8
|
import type { SubviewProps } from "./types.js";
|
|
9
|
+
import type { ReactNode } from "react";
|
|
10
10
|
|
|
11
11
|
interface ImageSubviewProps extends SubviewProps {
|
|
12
12
|
content: ImageContent;
|
|
@@ -17,7 +17,7 @@ export const ImageSubview = function ImageSubview({
|
|
|
17
17
|
decorations,
|
|
18
18
|
actions,
|
|
19
19
|
...screen
|
|
20
|
-
}: ImageSubviewProps):
|
|
20
|
+
}: ImageSubviewProps): ReactNode {
|
|
21
21
|
const textContent = getTextContent(content);
|
|
22
22
|
const rows = useMemo(() => sourceLines(textContent), [textContent]);
|
|
23
23
|
const [error, setError] = useState(false);
|
|
@@ -26,21 +26,22 @@ export const ImageSubview = function ImageSubview({
|
|
|
26
26
|
setError(false);
|
|
27
27
|
}, [content.src]);
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
const document = useDocumentController<SourceLineRow>({
|
|
31
|
-
adapter: sourceLineAdapter,
|
|
32
|
-
contextMenu: actions,
|
|
33
|
-
decorations,
|
|
34
|
-
multiSelect: false,
|
|
29
|
+
const { document, statusItems } = useContentDocument<SourceLineRow>(
|
|
35
30
|
rows,
|
|
36
|
-
|
|
31
|
+
sourceLineAdapter,
|
|
32
|
+
{ actions, content, decorations, textContent },
|
|
33
|
+
{
|
|
34
|
+
multiSelect: false,
|
|
35
|
+
statusItems: [{ label: "Format:", value: content.format }],
|
|
36
|
+
},
|
|
37
|
+
);
|
|
37
38
|
|
|
38
39
|
return (
|
|
39
40
|
<ViewScreen
|
|
40
41
|
content={content}
|
|
41
42
|
controller={document}
|
|
42
43
|
actions={actions}
|
|
43
|
-
statusItems={
|
|
44
|
+
statusItems={statusItems}
|
|
44
45
|
{...screen}
|
|
45
46
|
>
|
|
46
47
|
<box style={{ flexDirection: "column", flexGrow: 1 }}>
|