@flanksource/clicky-ui 0.3.45 → 0.3.46
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/README.md +22 -0
- package/dist/data/AccessMark.cjs +23 -0
- package/dist/data/AccessMark.cjs.map +1 -0
- package/dist/data/AccessMark.d.ts +11 -0
- package/dist/data/AccessMark.d.ts.map +1 -0
- package/dist/data/AccessMark.js +23 -0
- package/dist/data/AccessMark.js.map +1 -0
- package/dist/data/CodeDiff.cjs +116 -23
- package/dist/data/CodeDiff.cjs.map +1 -1
- package/dist/data/CodeDiff.d.ts +26 -0
- package/dist/data/CodeDiff.d.ts.map +1 -1
- package/dist/data/CodeDiff.js +116 -23
- package/dist/data/CodeDiff.js.map +1 -1
- package/dist/data/GraphDiagram.cjs +65 -13
- package/dist/data/GraphDiagram.cjs.map +1 -1
- package/dist/data/GraphDiagram.d.ts +9 -2
- package/dist/data/GraphDiagram.d.ts.map +1 -1
- package/dist/data/GraphDiagram.js +66 -14
- package/dist/data/GraphDiagram.js.map +1 -1
- package/dist/data/GraphDiagramGroups.cjs +100 -0
- package/dist/data/GraphDiagramGroups.cjs.map +1 -0
- package/dist/data/GraphDiagramGroups.d.ts +24 -0
- package/dist/data/GraphDiagramGroups.d.ts.map +1 -0
- package/dist/data/GraphDiagramGroups.js +100 -0
- package/dist/data/GraphDiagramGroups.js.map +1 -0
- package/dist/data/GraphDiagramNodes.cjs +17 -31
- package/dist/data/GraphDiagramNodes.cjs.map +1 -1
- package/dist/data/GraphDiagramNodes.d.ts +6 -13
- package/dist/data/GraphDiagramNodes.d.ts.map +1 -1
- package/dist/data/GraphDiagramNodes.js +17 -31
- package/dist/data/GraphDiagramNodes.js.map +1 -1
- package/dist/data/TreeNode.cjs +1 -1
- package/dist/data/TreeNode.cjs.map +1 -1
- package/dist/data/TreeNode.d.ts.map +1 -1
- package/dist/data/TreeNode.js +1 -1
- package/dist/data/TreeNode.js.map +1 -1
- package/dist/data/call-graph/CallGraph.cjs +50 -31
- package/dist/data/call-graph/CallGraph.cjs.map +1 -1
- package/dist/data/call-graph/CallGraph.d.ts +10 -1
- package/dist/data/call-graph/CallGraph.d.ts.map +1 -1
- package/dist/data/call-graph/CallGraph.js +52 -33
- package/dist/data/call-graph/CallGraph.js.map +1 -1
- package/dist/data/call-graph/CallGraphMembers.cjs +5 -4
- package/dist/data/call-graph/CallGraphMembers.cjs.map +1 -1
- package/dist/data/call-graph/CallGraphMembers.d.ts +1 -1
- package/dist/data/call-graph/CallGraphMembers.d.ts.map +1 -1
- package/dist/data/call-graph/CallGraphMembers.js +5 -4
- package/dist/data/call-graph/CallGraphMembers.js.map +1 -1
- package/dist/data/call-graph/CallGraphToolbar.cjs +17 -5
- package/dist/data/call-graph/CallGraphToolbar.cjs.map +1 -1
- package/dist/data/call-graph/CallGraphToolbar.d.ts +10 -0
- package/dist/data/call-graph/CallGraphToolbar.d.ts.map +1 -1
- package/dist/data/call-graph/CallGraphToolbar.js +18 -6
- package/dist/data/call-graph/CallGraphToolbar.js.map +1 -1
- package/dist/data/call-graph/call-graph-model.cjs +169 -18
- package/dist/data/call-graph/call-graph-model.cjs.map +1 -1
- package/dist/data/call-graph/call-graph-model.d.ts +40 -4
- package/dist/data/call-graph/call-graph-model.d.ts.map +1 -1
- package/dist/data/call-graph/call-graph-model.js +170 -19
- package/dist/data/call-graph/call-graph-model.js.map +1 -1
- package/dist/data/call-graph/call-graph-vocabulary.cjs +19 -1
- package/dist/data/call-graph/call-graph-vocabulary.cjs.map +1 -1
- package/dist/data/call-graph/call-graph-vocabulary.d.ts +4 -0
- package/dist/data/call-graph/call-graph-vocabulary.d.ts.map +1 -1
- package/dist/data/call-graph/call-graph-vocabulary.js +19 -1
- package/dist/data/call-graph/call-graph-vocabulary.js.map +1 -1
- package/dist/data/call-graph/call-graph.fixtures.d.ts.map +1 -1
- package/dist/data/call-graph/index.d.ts +2 -2
- package/dist/data/call-graph/index.d.ts.map +1 -1
- package/dist/data/call-graph/types.cjs.map +1 -1
- package/dist/data/call-graph/types.d.ts +7 -2
- package/dist/data/call-graph/types.d.ts.map +1 -1
- package/dist/data/call-graph/types.js.map +1 -1
- package/dist/data/data-access.cjs +8 -0
- package/dist/data/data-access.cjs.map +1 -0
- package/dist/data/data-access.d.ts +5 -0
- package/dist/data/data-access.d.ts.map +1 -0
- package/dist/data/data-access.js +8 -0
- package/dist/data/data-access.js.map +1 -0
- package/dist/data/git/GitChangeList.cjs +6 -2
- package/dist/data/git/GitChangeList.cjs.map +1 -1
- package/dist/data/git/GitChangeList.d.ts +6 -1
- package/dist/data/git/GitChangeList.d.ts.map +1 -1
- package/dist/data/git/GitChangeList.js +6 -2
- package/dist/data/git/GitChangeList.js.map +1 -1
- package/dist/data/graph-columns-layout.cjs +47 -16
- package/dist/data/graph-columns-layout.cjs.map +1 -1
- package/dist/data/graph-columns-layout.d.ts +34 -0
- package/dist/data/graph-columns-layout.d.ts.map +1 -1
- package/dist/data/graph-columns-layout.js +47 -16
- package/dist/data/graph-columns-layout.js.map +1 -1
- package/dist/data/graph-diagram-model.cjs +5 -0
- package/dist/data/graph-diagram-model.cjs.map +1 -1
- package/dist/data/graph-diagram-model.d.ts +19 -0
- package/dist/data/graph-diagram-model.d.ts.map +1 -1
- package/dist/data/graph-diagram-model.js +5 -0
- package/dist/data/graph-diagram-model.js.map +1 -1
- package/dist/data/graph-group-window.cjs +60 -0
- package/dist/data/graph-group-window.cjs.map +1 -0
- package/dist/data/graph-group-window.d.ts +33 -0
- package/dist/data/graph-group-window.d.ts.map +1 -0
- package/dist/data/graph-group-window.js +60 -0
- package/dist/data/graph-group-window.js.map +1 -0
- package/dist/data/use-group-windows.cjs +50 -0
- package/dist/data/use-group-windows.cjs.map +1 -0
- package/dist/data/use-group-windows.d.ts +27 -0
- package/dist/data/use-group-windows.d.ts.map +1 -0
- package/dist/data/use-group-windows.js +50 -0
- package/dist/data/use-group-windows.js.map +1 -0
- package/dist/data/version-info.cjs +3 -3
- package/dist/data/version-info.js +3 -3
- package/dist/data.cjs +10 -0
- package/dist/data.cjs.map +1 -1
- package/dist/data.d.ts +4 -2
- package/dist/data.d.ts.map +1 -1
- package/dist/data.js +13 -3
- package/dist/data.js.map +1 -1
- package/dist/hooks/event-hub.cjs +229 -0
- package/dist/hooks/event-hub.cjs.map +1 -0
- package/dist/hooks/event-hub.d.ts +26 -0
- package/dist/hooks/event-hub.d.ts.map +1 -0
- package/dist/hooks/event-hub.js +229 -0
- package/dist/hooks/event-hub.js.map +1 -0
- package/dist/hooks.cjs +2 -0
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.d.ts +1 -0
- package/dist/hooks.d.ts.map +1 -1
- package/dist/hooks.js +2 -0
- package/dist/hooks.js.map +1 -1
- package/dist/index.cjs +12 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +15 -3
- package/dist/index.js.map +1 -1
- package/dist/overlay/modalStack.cjs +13 -6
- package/dist/overlay/modalStack.cjs.map +1 -1
- package/dist/overlay/modalStack.d.ts.map +1 -1
- package/dist/overlay/modalStack.js +13 -6
- package/dist/overlay/modalStack.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { UiSqlTable } from "../../icons/components/UiSqlTable.js";
|
|
2
2
|
import { UiSqlColumn } from "../../icons/components/UiSqlColumn.js";
|
|
3
|
+
import { UiKey } from "../../icons/components/UiKey.js";
|
|
3
4
|
import { UiSqlStoredProc } from "../../icons/components/UiSqlStoredProc.js";
|
|
4
5
|
import { UiTableProperties } from "../../icons/components/UiTableProperties.js";
|
|
5
6
|
import { UiField } from "../../icons/components/UiField.js";
|
|
@@ -55,6 +56,7 @@ const DATA_KIND_WORDS = {
|
|
|
55
56
|
const CALL_GRAPH_DATA_GLYPHS = [
|
|
56
57
|
{ id: "table", name: "table", icon: UiSqlTable },
|
|
57
58
|
{ id: "column", name: "column", icon: UiSqlColumn },
|
|
59
|
+
{ id: "primary_key", name: "primary key column", icon: UiKey },
|
|
58
60
|
{ id: "procedure", name: "stored procedure", icon: UiSqlStoredProc },
|
|
59
61
|
{ id: "entity", name: "entity", icon: UiTableProperties },
|
|
60
62
|
{ id: "field", name: "field", icon: UiField }
|
|
@@ -62,6 +64,18 @@ const CALL_GRAPH_DATA_GLYPHS = [
|
|
|
62
64
|
function isDataNode(node) {
|
|
63
65
|
return Object.hasOwn(DATA_KIND_WORDS, node.kind);
|
|
64
66
|
}
|
|
67
|
+
const DATA_MEMBER_OWNER = { column: "table", field: "entity" };
|
|
68
|
+
function isDataMember(node) {
|
|
69
|
+
return isDataNode(node) && Object.hasOwn(DATA_MEMBER_OWNER, node.kind);
|
|
70
|
+
}
|
|
71
|
+
function dataNodeGlyph(node) {
|
|
72
|
+
var _a;
|
|
73
|
+
return node.kind === "column" && ((_a = node.properties) == null ? void 0 : _a.primaryKey) === "true" ? "primary_key" : node.kind;
|
|
74
|
+
}
|
|
75
|
+
function dataMemberAside(node) {
|
|
76
|
+
var _a;
|
|
77
|
+
return node.kind === "column" ? (_a = node.properties) == null ? void 0 : _a.sqlType : void 0;
|
|
78
|
+
}
|
|
65
79
|
function dataName(node) {
|
|
66
80
|
const prefix = `${node.kind}:`;
|
|
67
81
|
return node.id.startsWith(prefix) ? node.id.slice(prefix.length) : node.label;
|
|
@@ -111,7 +125,7 @@ function uirGlyph(graph, node) {
|
|
|
111
125
|
if (node.unresolved) return "unresolved";
|
|
112
126
|
if (isBuiltin(node)) return "builtin";
|
|
113
127
|
if (isPackageScope(node)) return "package";
|
|
114
|
-
if (isDataNode(node)) return node
|
|
128
|
+
if (isDataNode(node)) return dataNodeGlyph(node);
|
|
115
129
|
if (callsItself(graph, node)) return "recursive";
|
|
116
130
|
if (isExternal(node) && node.kind === "func") return "external_func";
|
|
117
131
|
if (interfaceMethods(graph).has(node.id)) return "interface_method";
|
|
@@ -161,12 +175,16 @@ const UIR_CALL_GRAPH_VOCABULARY = {
|
|
|
161
175
|
export {
|
|
162
176
|
CALL_GRAPH_DATA_GLYPHS,
|
|
163
177
|
DATA_KIND_WORDS,
|
|
178
|
+
DATA_MEMBER_OWNER,
|
|
164
179
|
UIR_CALL_GRAPH_VOCABULARY,
|
|
165
180
|
callsItself,
|
|
181
|
+
dataMemberAside,
|
|
166
182
|
dataNodeBacking,
|
|
183
|
+
dataNodeGlyph,
|
|
167
184
|
dataNodeStatus,
|
|
168
185
|
interfaceMethods,
|
|
169
186
|
isBuiltin,
|
|
187
|
+
isDataMember,
|
|
170
188
|
isDataNode,
|
|
171
189
|
isExternal,
|
|
172
190
|
nodeTitle,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"call-graph-vocabulary.js","sources":["../../../src/data/call-graph/call-graph-vocabulary.ts"],"sourcesContent":["// What a node kind means and how it is drawn. A host whose source names its own kinds (OIPA's\n// transactions, copybooks and functions) passes its own vocabulary; the default is the one uir's\n// `graph.Build` reports without a Theme: uir node types, a builtin, a package scope and an index\n// location for every node with a source.\nimport {\n UiConstant,\n UiField,\n UiFunction,\n UiFunction1,\n UiFunction1Dark,\n UiFunctionSquare,\n UiInterface,\n UiMethod,\n UiMethod11,\n UiMethod11Dark,\n UiPackage,\n UiSqlColumn,\n UiSqlStoredProc,\n UiSqlTable,\n UiSymbol,\n UiSymbolDark,\n UiTableProperties,\n UiTypeParameter,\n UiUnknown,\n UiVariable,\n type IconComponent,\n} from \"../../icons\";\nimport type { CallGraph, CallGraphNode } from \"./types\";\n\nexport interface CallGraphGlyph {\n id: string;\n /** The legend's name for it. */\n name: string;\n icon: IconComponent;\n /** Drawn instead of `icon` in the dark theme, for coloured artwork. */\n darkIcon?: IconComponent;\n}\n\nexport interface CallGraphVocabulary {\n /** Every glyph the vocabulary draws, in legend order. */\n glyphs: readonly CallGraphGlyph[];\n /** The id of the one glyph a node shows. */\n glyphOf(graph: CallGraph, node: CallGraphNode): string;\n /** What the node is, in words: `method`, `external function`, `copybook`. */\n kindOf(graph: CallGraph, node: CallGraphNode): string;\n /** The node has a body the source walks: it can be expanded and opened. */\n hasSource(node: CallGraphNode): boolean;\n /** The graph can be drawn around the node: Focus is offered for it, with or without a source. */\n canRoot(node: CallGraphNode): boolean;\n /** A table, column, procedure, entity or field: its details count readers and writers. */\n isData(node: CallGraphNode): boolean;\n /** Drawn dimmed: the node leads nowhere further. */\n muted(node: CallGraphNode): boolean;\n /** The node's status line in its details. */\n status(node: CallGraphNode): string;\n /** The node a data node stands for, such as the column behind a field, offered as a Focus link. */\n backing?(node: CallGraphNode): { id: string; label: string } | undefined;\n /** What a group is, and the icon its box caption shows. */\n group: { noun: string; plural: string; icon: IconComponent; patternHint: string };\n}\n\n/** The glyph with that id, failing on one the vocabulary does not list. */\nexport function requireGlyph(vocabulary: CallGraphVocabulary, id: string): CallGraphGlyph {\n const glyph = vocabulary.glyphs.find((candidate) => candidate.id === id);\n if (!glyph) throw new Error(`call graph: the vocabulary has no glyph \"${id}\"`);\n return glyph;\n}\n\n/** The glyphs the graph's nodes use, once each, in legend order. */\nexport function usedGlyphs(graph: CallGraph, vocabulary: CallGraphVocabulary): CallGraphGlyph[] {\n const used = new Set(graph.nodes.map((node) => vocabulary.glyphOf(graph, node)));\n return vocabulary.glyphs.filter((glyph) => used.has(glyph.id));\n}\n\n/** The node's tooltip: its kind, its label and its group's full label. */\nexport function nodeTitle(graph: CallGraph, node: CallGraphNode, vocabulary: CallGraphVocabulary): string {\n const group = graph.groups?.find((candidate) => candidate.id === node.group)?.label ?? node.group;\n return `${vocabulary.kindOf(graph, node)} ${node.label}${group ? ` in ${group}` : \"\"}`;\n}\n\nexport function callsItself(graph: CallGraph, node: CallGraphNode): boolean {\n return graph.edges.some((edge) => edge.from === node.id && edge.to === node.id);\n}\n\nexport function siteKey(site: { path?: string; line?: number; column?: number }): string {\n return `${site.path}:${site.line}:${site.column}`;\n}\n\n// uir node types that have a glyph of their own, and the words for each.\nconst UIR_KINDS = new Map<string, { glyph: string; words: string }>([\n [\"func\", { glyph: \"func\", words: \"function\" }],\n [\"method\", { glyph: \"method\", words: \"method\" }],\n [\"builtin\", { glyph: \"builtin\", words: \"builtin\" }],\n [\"type\", { glyph: \"type\", words: \"type\" }],\n [\"field\", { glyph: \"field\", words: \"field\" }],\n [\"var\", { glyph: \"var\", words: \"variable\" }],\n [\"const\", { glyph: \"const\", words: \"constant\" }],\n [\"package\", { glyph: \"package\", words: \"package scope\" }],\n]);\n\n// Data access, as the graph's data model names it: `table:AsPolicy`, `column:AsPolicy.STATUSCODE`,\n// `procedure:Update_ClassGroup`, `entity:Policy` and `field:Policy.StatusCode`, a field carrying\n// `column` (its `x-oipa-column`) or `storage` (the table a dynamic field is kept in).\n\nexport const DATA_KIND_WORDS: Readonly<Record<string, string>> = {\n table: \"table\",\n column: \"column\",\n procedure: \"stored procedure\",\n entity: \"entity\",\n field: \"field\",\n};\n\nexport const CALL_GRAPH_DATA_GLYPHS: readonly CallGraphGlyph[] = [\n { id: \"table\", name: \"table\", icon: UiSqlTable },\n { id: \"column\", name: \"column\", icon: UiSqlColumn },\n { id: \"procedure\", name: \"stored procedure\", icon: UiSqlStoredProc },\n { id: \"entity\", name: \"entity\", icon: UiTableProperties },\n { id: \"field\", name: \"field\", icon: UiField },\n];\n\nexport function isDataNode(node: CallGraphNode): boolean {\n return Object.hasOwn(DATA_KIND_WORDS, node.kind);\n}\n\n/** The data node's name: its id after `<kind>:`, else its label. */\nfunction dataName(node: CallGraphNode): string {\n const prefix = `${node.kind}:`;\n return node.id.startsWith(prefix) ? node.id.slice(prefix.length) : node.label;\n}\n\nexport function dataNodeStatus(node: CallGraphNode): string {\n const name = dataName(node);\n switch (node.kind) {\n case \"table\": return `Table ${name}`;\n case \"column\": return `Column ${name}`;\n case \"procedure\": return `Stored procedure ${name}`;\n case \"entity\": return `${name} fields`;\n }\n const entity = name.includes(\".\") ? name.slice(0, name.indexOf(\".\")) : (node.group ?? \"\");\n const { column, storage } = node.properties ?? {};\n if (column) return `${entity} field → ${column}`;\n if (storage) return `${entity} field, dynamic, stored in ${storage}`;\n return `${entity} field`;\n}\n\n/** The column behind a field, by its `column` property. */\nexport function dataNodeBacking(node: CallGraphNode): { id: string; label: string } | undefined {\n const column = node.kind === \"field\" ? node.properties?.column : undefined;\n return column ? { id: `column:${column}`, label: column } : undefined;\n}\n\nexport function isBuiltin(node: CallGraphNode): boolean {\n return node.kind === \"builtin\";\n}\n\n/** The node standing for the calls a package makes outside any declaration. */\nfunction isPackageScope(node: CallGraphNode): boolean {\n return node.kind === \"package\";\n}\n\n/** A symbol declared outside the indexed snapshots: it has no source, so it cannot be opened or expanded. */\nexport function isExternal(node: CallGraphNode): boolean {\n return !node.location && !node.unresolved && !isBuiltin(node) && !isPackageScope(node) && !isDataNode(node);\n}\n\n/**\n * The index has no kind for an interface method: it is a `method`. It shows in the graph as the target\n * of a call whose site also carries a dispatch edge from the same caller, because the source adds that\n * dispatch edge to each implementation of the interface method called there.\n */\nexport function interfaceMethods(graph: CallGraph): Set<string> {\n const dispatched = new Set(\n graph.edges.filter((edge) => edge.type === \"dispatch\").flatMap((edge) => edge.sites.map((site) => `${edge.from} ${siteKey(site)}`)),\n );\n return new Set(\n graph.edges\n .filter((edge) => edge.type === \"call\" && edge.sites.some((site) => dispatched.has(`${edge.from} ${siteKey(site)}`)))\n .map((edge) => edge.to),\n );\n}\n\n/**\n * The one glyph a node shows. An unresolved call, a builtin and a package scope are what they are;\n * after those, a symbol that calls itself, an external function and an interface method outrank the\n * plain kind. An external method keeps the method glyph: its dimmed box already says it has no source.\n */\nfunction uirGlyph(graph: CallGraph, node: CallGraphNode): string {\n if (node.unresolved) return \"unresolved\";\n if (isBuiltin(node)) return \"builtin\";\n if (isPackageScope(node)) return \"package\";\n if (isDataNode(node)) return node.kind;\n if (callsItself(graph, node)) return \"recursive\";\n if (isExternal(node) && node.kind === \"func\") return \"external_func\";\n if (interfaceMethods(graph).has(node.id)) return \"interface_method\";\n return UIR_KINDS.get(node.kind)?.glyph ?? \"symbol\";\n}\n\nfunction uirKind(graph: CallGraph, node: CallGraphNode): string {\n if (node.unresolved) return \"unresolved call\";\n const kind = interfaceMethods(graph).has(node.id) ? \"interface method\" : (UIR_KINDS.get(node.kind)?.words ?? DATA_KIND_WORDS[node.kind] ?? node.kind.replaceAll(\"_\", \" \"));\n return [isExternal(node) ? \"external\" : \"\", callsItself(graph, node) ? \"recursive\" : \"\", kind].filter(Boolean).join(\" \");\n}\n\nfunction uirStatus(node: CallGraphNode): string {\n if (node.unresolved) return \"Unresolved: the index has no target for this call\";\n if (isBuiltin(node)) return \"Builtin: no source\";\n if (isExternal(node)) return \"External: declared outside the indexed snapshots\";\n if (node.location) return \"Indexed\";\n return isDataNode(node) ? dataNodeStatus(node) : \"Package scope: calls made outside any declaration\";\n}\n\nexport const UIR_CALL_GRAPH_VOCABULARY: CallGraphVocabulary = {\n glyphs: [\n { id: \"func\", name: \"function\", icon: UiFunction },\n { id: \"method\", name: \"method\", icon: UiMethod },\n { id: \"interface_method\", name: \"interface method\", icon: UiInterface },\n { id: \"recursive\", name: \"calls itself\", icon: UiMethod11, darkIcon: UiMethod11Dark },\n { id: \"external_func\", name: \"external function\", icon: UiFunction1, darkIcon: UiFunction1Dark },\n { id: \"builtin\", name: \"builtin\", icon: UiFunctionSquare },\n { id: \"type\", name: \"type\", icon: UiTypeParameter },\n { id: \"field\", name: \"field\", icon: UiField },\n { id: \"var\", name: \"variable\", icon: UiVariable },\n { id: \"const\", name: \"constant\", icon: UiConstant },\n { id: \"package\", name: \"package scope\", icon: UiPackage },\n // uir's `field` is already a glyph of its own: a struct field is data too.\n ...CALL_GRAPH_DATA_GLYPHS.filter((glyph) => glyph.id !== \"field\"),\n { id: \"unresolved\", name: \"unresolved call\", icon: UiUnknown },\n { id: \"symbol\", name: \"other symbol\", icon: UiSymbol, darkIcon: UiSymbolDark },\n ],\n glyphOf: uirGlyph,\n kindOf: uirKind,\n hasSource: (node) => Boolean(node.location),\n canRoot: (node) => Boolean(node.location) || isDataNode(node),\n isData: isDataNode,\n muted: (node) => Boolean(node.unresolved) || isBuiltin(node) || isExternal(node),\n status: uirStatus,\n backing: dataNodeBacking,\n group: { noun: \"package\", plural: \"packages\", icon: UiPackage, patternHint: \"example.com/module/...\" },\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AA8DO,SAAS,aAAa,YAAiC,IAA4B;AACxF,QAAM,QAAQ,WAAW,OAAO,KAAK,CAAC,cAAc,UAAU,OAAO,EAAE;AACvE,MAAI,CAAC,MAAO,OAAM,IAAI,MAAM,4CAA4C,EAAE,GAAG;AAC7E,SAAO;AACT;AAGO,SAAS,WAAW,OAAkB,YAAmD;AAC9F,QAAM,OAAO,IAAI,IAAI,MAAM,MAAM,IAAI,CAAC,SAAS,WAAW,QAAQ,OAAO,IAAI,CAAC,CAAC;AAC/E,SAAO,WAAW,OAAO,OAAO,CAAC,UAAU,KAAK,IAAI,MAAM,EAAE,CAAC;AAC/D;AAGO,SAAS,UAAU,OAAkB,MAAqB,YAAyC;;AACxG,QAAM,UAAQ,iBAAM,WAAN,mBAAc,KAAK,CAAC,cAAc,UAAU,OAAO,KAAK,WAAxD,mBAAgE,UAAS,KAAK;AAC5F,SAAO,GAAG,WAAW,OAAO,OAAO,IAAI,CAAC,IAAI,KAAK,KAAK,GAAG,QAAQ,OAAO,KAAK,KAAK,EAAE;AACtF;AAEO,SAAS,YAAY,OAAkB,MAA8B;AAC1E,SAAO,MAAM,MAAM,KAAK,CAAC,SAAS,KAAK,SAAS,KAAK,MAAM,KAAK,OAAO,KAAK,EAAE;AAChF;AAEO,SAAS,QAAQ,MAAiE;AACvF,SAAO,GAAG,KAAK,IAAI,IAAI,KAAK,IAAI,IAAI,KAAK,MAAM;AACjD;AAGA,MAAM,gCAAgB,IAA8C;AAAA,EAClE,CAAC,QAAQ,EAAE,OAAO,QAAQ,OAAO,YAAY;AAAA,EAC7C,CAAC,UAAU,EAAE,OAAO,UAAU,OAAO,UAAU;AAAA,EAC/C,CAAC,WAAW,EAAE,OAAO,WAA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IAAI,iBAAiB,MAAM,qBAAqB,MAAM,aAAa,UAAU,gBAAA;AAAA,IAC/E,EAAE,IAAI,WAAW,MAAM,WAAW,MAAM,iBAAA;AAAA,IACxC,EAAE,IAAI,QAAQ,MAAM,QAAQ,MAAM,gBAAA;AAAA,IAClC,EAAE,IAAI,SAAS,MAAM,SAAS,MAAM,QAAA;AAAA,IACpC,EAAE,IAAI,OAAO,MAAM,YAAY,MAAM,WAAA;AAAA,IACrC,EAAE,IAAI,SAAS,MAAM,YAAY,MAAM,WAAA;AAAA,IACvC,EAAE,IAAI,WAAW,MAAM,iBAAiB,MAAM,UAAA;AAAA;AAAA,IAE9C,GAAG,uBAAuB,OAAO,CAAC,UAAU,MAAM,OAAO,OAAO;AAAA,IAChE,EAAE,IAAI,cAAc,MAAM,mBAAmB,MAAM,UAAA;AAAA,IACnD,EAAE,IAAI,UAAU,MAAM,gBAAgB,MAAM,UAAU,UAAU,aAAA;AAAA,EAAa;AAAA,EAE/E,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,WAAW,CAAC,SAAS,QAAQ,KAAK,QAAQ;AAAA,EAC1C,SAAS,CAAC,SAAS,QAAQ,KAAK,QAAQ,KAAK,WAAW,IAAI;AAAA,EAC5D,QAAQ;AAAA,EACR,OAAO,CAAC,SAAS,QAAQ,KAAK,UAAU,KAAK,UAAU,IAAI,KAAK,WAAW,IAAI;AAAA,EAC/E,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,OAAO,EAAE,MAAM,WAAW,QAAQ,YAAY,MAAM,WAAW,aAAa,yBAAA;AAC9E;"}
|
|
1
|
+
{"version":3,"file":"call-graph-vocabulary.js","sources":["../../../src/data/call-graph/call-graph-vocabulary.ts"],"sourcesContent":["// What a node kind means and how it is drawn. A host whose source names its own kinds (OIPA's\n// transactions, copybooks and functions) passes its own vocabulary; the default is the one uir's\n// `graph.Build` reports without a Theme: uir node types, a builtin, a package scope and an index\n// location for every node with a source.\nimport {\n UiConstant,\n UiField,\n UiFunction,\n UiFunction1,\n UiFunction1Dark,\n UiFunctionSquare,\n UiInterface,\n UiKey,\n UiMethod,\n UiMethod11,\n UiMethod11Dark,\n UiPackage,\n UiSqlColumn,\n UiSqlStoredProc,\n UiSqlTable,\n UiSymbol,\n UiSymbolDark,\n UiTableProperties,\n UiTypeParameter,\n UiUnknown,\n UiVariable,\n type IconComponent,\n} from \"../../icons\";\nimport type { CallGraph, CallGraphNode } from \"./types\";\n\nexport interface CallGraphGlyph {\n id: string;\n /** The legend's name for it. */\n name: string;\n icon: IconComponent;\n /** Drawn instead of `icon` in the dark theme, for coloured artwork. */\n darkIcon?: IconComponent;\n}\n\nexport interface CallGraphVocabulary {\n /** Every glyph the vocabulary draws, in legend order. */\n glyphs: readonly CallGraphGlyph[];\n /** The id of the one glyph a node shows. */\n glyphOf(graph: CallGraph, node: CallGraphNode): string;\n /** What the node is, in words: `method`, `external function`, `copybook`. */\n kindOf(graph: CallGraph, node: CallGraphNode): string;\n /** The node has a body the source walks: it can be expanded and opened. */\n hasSource(node: CallGraphNode): boolean;\n /** The graph can be drawn around the node: Focus is offered for it, with or without a source. */\n canRoot(node: CallGraphNode): boolean;\n /** A table, column, procedure, entity or field: its details count readers and writers. */\n isData(node: CallGraphNode): boolean;\n /** Drawn dimmed: the node leads nowhere further. */\n muted(node: CallGraphNode): boolean;\n /** The node's status line in its details. */\n status(node: CallGraphNode): string;\n /** The node a data node stands for, such as the column behind a field, offered as a Focus link. */\n backing?(node: CallGraphNode): { id: string; label: string } | undefined;\n /** What a group is, and the icon its box caption shows. */\n group: { noun: string; plural: string; icon: IconComponent; patternHint: string };\n}\n\n/** The glyph with that id, failing on one the vocabulary does not list. */\nexport function requireGlyph(vocabulary: CallGraphVocabulary, id: string): CallGraphGlyph {\n const glyph = vocabulary.glyphs.find((candidate) => candidate.id === id);\n if (!glyph) throw new Error(`call graph: the vocabulary has no glyph \"${id}\"`);\n return glyph;\n}\n\n/** The glyphs the graph's nodes use, once each, in legend order. */\nexport function usedGlyphs(graph: CallGraph, vocabulary: CallGraphVocabulary): CallGraphGlyph[] {\n const used = new Set(graph.nodes.map((node) => vocabulary.glyphOf(graph, node)));\n return vocabulary.glyphs.filter((glyph) => used.has(glyph.id));\n}\n\n/** The node's tooltip: its kind, its label and its group's full label. */\nexport function nodeTitle(graph: CallGraph, node: CallGraphNode, vocabulary: CallGraphVocabulary): string {\n const group = graph.groups?.find((candidate) => candidate.id === node.group)?.label ?? node.group;\n return `${vocabulary.kindOf(graph, node)} ${node.label}${group ? ` in ${group}` : \"\"}`;\n}\n\nexport function callsItself(graph: CallGraph, node: CallGraphNode): boolean {\n return graph.edges.some((edge) => edge.from === node.id && edge.to === node.id);\n}\n\nexport function siteKey(site: { path?: string; line?: number; column?: number }): string {\n return `${site.path}:${site.line}:${site.column}`;\n}\n\n// uir node types that have a glyph of their own, and the words for each.\nconst UIR_KINDS = new Map<string, { glyph: string; words: string }>([\n [\"func\", { glyph: \"func\", words: \"function\" }],\n [\"method\", { glyph: \"method\", words: \"method\" }],\n [\"builtin\", { glyph: \"builtin\", words: \"builtin\" }],\n [\"type\", { glyph: \"type\", words: \"type\" }],\n [\"field\", { glyph: \"field\", words: \"field\" }],\n [\"var\", { glyph: \"var\", words: \"variable\" }],\n [\"const\", { glyph: \"const\", words: \"constant\" }],\n [\"package\", { glyph: \"package\", words: \"package scope\" }],\n]);\n\n// Data access, as the graph's data model names it: `table:AsPolicy`, `column:AsPolicy.STATUSCODE`,\n// `procedure:Update_ClassGroup`, `entity:Policy` and `field:Policy.StatusCode`, a field carrying\n// `column` (its `x-oipa-column`) or `storage` (the table a dynamic field is kept in).\n\nexport const DATA_KIND_WORDS: Readonly<Record<string, string>> = {\n table: \"table\",\n column: \"column\",\n procedure: \"stored procedure\",\n entity: \"entity\",\n field: \"field\",\n};\n\nexport const CALL_GRAPH_DATA_GLYPHS: readonly CallGraphGlyph[] = [\n { id: \"table\", name: \"table\", icon: UiSqlTable },\n { id: \"column\", name: \"column\", icon: UiSqlColumn },\n { id: \"primary_key\", name: \"primary key column\", icon: UiKey },\n { id: \"procedure\", name: \"stored procedure\", icon: UiSqlStoredProc },\n { id: \"entity\", name: \"entity\", icon: UiTableProperties },\n { id: \"field\", name: \"field\", icon: UiField },\n];\n\nexport function isDataNode(node: CallGraphNode): boolean {\n return Object.hasOwn(DATA_KIND_WORDS, node.kind);\n}\n\nexport const DATA_MEMBER_OWNER: Readonly<Record<string, string>> = { column: \"table\", field: \"entity\" };\n\nexport function isDataMember(node: CallGraphNode): boolean {\n return isDataNode(node) && Object.hasOwn(DATA_MEMBER_OWNER, node.kind);\n}\n\nexport function dataNodeGlyph(node: CallGraphNode): string {\n return node.kind === \"column\" && node.properties?.primaryKey === \"true\" ? \"primary_key\" : node.kind;\n}\n\nexport function dataMemberAside(node: CallGraphNode): string | undefined {\n return node.kind === \"column\" ? node.properties?.sqlType : undefined;\n}\n\n/** The data node's name: its id after `<kind>:`, else its label. */\nfunction dataName(node: CallGraphNode): string {\n const prefix = `${node.kind}:`;\n return node.id.startsWith(prefix) ? node.id.slice(prefix.length) : node.label;\n}\n\nexport function dataNodeStatus(node: CallGraphNode): string {\n const name = dataName(node);\n switch (node.kind) {\n case \"table\": return `Table ${name}`;\n case \"column\": return `Column ${name}`;\n case \"procedure\": return `Stored procedure ${name}`;\n case \"entity\": return `${name} fields`;\n }\n const entity = name.includes(\".\") ? name.slice(0, name.indexOf(\".\")) : (node.group ?? \"\");\n const { column, storage } = node.properties ?? {};\n if (column) return `${entity} field → ${column}`;\n if (storage) return `${entity} field, dynamic, stored in ${storage}`;\n return `${entity} field`;\n}\n\n/** The column behind a field, by its `column` property. */\nexport function dataNodeBacking(node: CallGraphNode): { id: string; label: string } | undefined {\n const column = node.kind === \"field\" ? node.properties?.column : undefined;\n return column ? { id: `column:${column}`, label: column } : undefined;\n}\n\nexport function isBuiltin(node: CallGraphNode): boolean {\n return node.kind === \"builtin\";\n}\n\n/** The node standing for the calls a package makes outside any declaration. */\nfunction isPackageScope(node: CallGraphNode): boolean {\n return node.kind === \"package\";\n}\n\n/** A symbol declared outside the indexed snapshots: it has no source, so it cannot be opened or expanded. */\nexport function isExternal(node: CallGraphNode): boolean {\n return !node.location && !node.unresolved && !isBuiltin(node) && !isPackageScope(node) && !isDataNode(node);\n}\n\n/**\n * The index has no kind for an interface method: it is a `method`. It shows in the graph as the target\n * of a call whose site also carries a dispatch edge from the same caller, because the source adds that\n * dispatch edge to each implementation of the interface method called there.\n */\nexport function interfaceMethods(graph: CallGraph): Set<string> {\n const dispatched = new Set(\n graph.edges.filter((edge) => edge.type === \"dispatch\").flatMap((edge) => edge.sites.map((site) => `${edge.from} ${siteKey(site)}`)),\n );\n return new Set(\n graph.edges\n .filter((edge) => edge.type === \"call\" && edge.sites.some((site) => dispatched.has(`${edge.from} ${siteKey(site)}`)))\n .map((edge) => edge.to),\n );\n}\n\n/**\n * The one glyph a node shows. An unresolved call, a builtin and a package scope are what they are;\n * after those, a symbol that calls itself, an external function and an interface method outrank the\n * plain kind. An external method keeps the method glyph: its dimmed box already says it has no source.\n */\nfunction uirGlyph(graph: CallGraph, node: CallGraphNode): string {\n if (node.unresolved) return \"unresolved\";\n if (isBuiltin(node)) return \"builtin\";\n if (isPackageScope(node)) return \"package\";\n if (isDataNode(node)) return dataNodeGlyph(node);\n if (callsItself(graph, node)) return \"recursive\";\n if (isExternal(node) && node.kind === \"func\") return \"external_func\";\n if (interfaceMethods(graph).has(node.id)) return \"interface_method\";\n return UIR_KINDS.get(node.kind)?.glyph ?? \"symbol\";\n}\n\nfunction uirKind(graph: CallGraph, node: CallGraphNode): string {\n if (node.unresolved) return \"unresolved call\";\n const kind = interfaceMethods(graph).has(node.id) ? \"interface method\" : (UIR_KINDS.get(node.kind)?.words ?? DATA_KIND_WORDS[node.kind] ?? node.kind.replaceAll(\"_\", \" \"));\n return [isExternal(node) ? \"external\" : \"\", callsItself(graph, node) ? \"recursive\" : \"\", kind].filter(Boolean).join(\" \");\n}\n\nfunction uirStatus(node: CallGraphNode): string {\n if (node.unresolved) return \"Unresolved: the index has no target for this call\";\n if (isBuiltin(node)) return \"Builtin: no source\";\n if (isExternal(node)) return \"External: declared outside the indexed snapshots\";\n if (node.location) return \"Indexed\";\n return isDataNode(node) ? dataNodeStatus(node) : \"Package scope: calls made outside any declaration\";\n}\n\nexport const UIR_CALL_GRAPH_VOCABULARY: CallGraphVocabulary = {\n glyphs: [\n { id: \"func\", name: \"function\", icon: UiFunction },\n { id: \"method\", name: \"method\", icon: UiMethod },\n { id: \"interface_method\", name: \"interface method\", icon: UiInterface },\n { id: \"recursive\", name: \"calls itself\", icon: UiMethod11, darkIcon: UiMethod11Dark },\n { id: \"external_func\", name: \"external function\", icon: UiFunction1, darkIcon: UiFunction1Dark },\n { id: \"builtin\", name: \"builtin\", icon: UiFunctionSquare },\n { id: \"type\", name: \"type\", icon: UiTypeParameter },\n { id: \"field\", name: \"field\", icon: UiField },\n { id: \"var\", name: \"variable\", icon: UiVariable },\n { id: \"const\", name: \"constant\", icon: UiConstant },\n { id: \"package\", name: \"package scope\", icon: UiPackage },\n // uir's `field` is already a glyph of its own: a struct field is data too.\n ...CALL_GRAPH_DATA_GLYPHS.filter((glyph) => glyph.id !== \"field\"),\n { id: \"unresolved\", name: \"unresolved call\", icon: UiUnknown },\n { id: \"symbol\", name: \"other symbol\", icon: UiSymbol, darkIcon: UiSymbolDark },\n ],\n glyphOf: uirGlyph,\n kindOf: uirKind,\n hasSource: (node) => Boolean(node.location),\n canRoot: (node) => Boolean(node.location) || isDataNode(node),\n isData: isDataNode,\n muted: (node) => Boolean(node.unresolved) || isBuiltin(node) || isExternal(node),\n status: uirStatus,\n backing: dataNodeBacking,\n group: { noun: \"package\", plural: \"packages\", icon: UiPackage, patternHint: \"example.com/module/...\" },\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AA+DO,SAAS,aAAa,YAAiC,IAA4B;AACxF,QAAM,QAAQ,WAAW,OAAO,KAAK,CAAC,cAAc,UAAU,OAAO,EA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eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,EAAE,CAEvD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { CallGraph, type CallGraphProps } from './CallGraph.js';
|
|
2
2
|
export { CALL_GRAPH_ACCESS } from './types.js';
|
|
3
3
|
export type { CallGraph as CallGraphData, CallGraphAccess, CallGraphDirection, CallGraphEdge, CallGraphEdgeLabels, CallGraphEdgeType, CallGraphFetchParams, CallGraphGroup, CallGraphGroupFact, CallGraphIdentifier, CallGraphLocation, CallGraphNode, CallGraphOmitted, CallGraphSelection, CallGraphSite, } from './types.js';
|
|
4
|
-
export { CALL_GRAPH_DATA_GLYPHS, callsItself, DATA_KIND_WORDS as CALL_GRAPH_DATA_KIND_WORDS, dataNodeBacking, dataNodeStatus, interfaceMethods, isDataNode, UIR_CALL_GRAPH_VOCABULARY, type CallGraphGlyph, type CallGraphVocabulary, } from './call-graph-vocabulary.js';
|
|
4
|
+
export { CALL_GRAPH_DATA_GLYPHS, callsItself, DATA_KIND_WORDS as CALL_GRAPH_DATA_KIND_WORDS, dataNodeBacking, DATA_MEMBER_OWNER, dataMemberAside, dataNodeGlyph, dataNodeStatus, interfaceMethods, isDataNode, isDataMember, UIR_CALL_GRAPH_VOCABULARY, type CallGraphGlyph, type CallGraphVocabulary, } from './call-graph-vocabulary.js';
|
|
5
5
|
export { callGraphGroupFacts, EXCLUDE_EXTERNAL as CALL_GRAPH_EXCLUDE_EXTERNAL, formatExclude as formatCallGraphExclude, matchesExclude as matchesCallGraphExclude, parseExclude as parseCallGraphExclude, type ExcludeMatcher as CallGraphExcludeMatcher, } from './call-graph-exclude.js';
|
|
6
|
-
export { CALL_GRAPH_DEFAULT_DEPTH, CALL_GRAPH_MAX_DEPTH, mergeGraph as mergeCallGraph, toggleAccess as toggleCallGraphAccess, } from './call-graph-model.js';
|
|
6
|
+
export { CALL_GRAPH_DEFAULT_DEPTH, CALL_GRAPH_MAX_DEPTH, baseAccess as baseCallGraphAccess, mergeGraph as mergeCallGraph, toggleAccess as toggleCallGraphAccess, } from './call-graph-model.js';
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/data/call-graph/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,YAAY,EACV,SAAS,IAAI,aAAa,EAC1B,eAAe,EACf,kBAAkB,EAClB,aAAa,EACb,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,sBAAsB,EACtB,WAAW,EACX,eAAe,IAAI,0BAA0B,EAC7C,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,UAAU,EACV,yBAAyB,EACzB,KAAK,cAAc,EACnB,KAAK,mBAAmB,GACzB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,mBAAmB,EACnB,gBAAgB,IAAI,2BAA2B,EAC/C,aAAa,IAAI,sBAAsB,EACvC,cAAc,IAAI,uBAAuB,EACzC,YAAY,IAAI,qBAAqB,EACrC,KAAK,cAAc,IAAI,uBAAuB,GAC/C,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,UAAU,IAAI,cAAc,EAC5B,YAAY,IAAI,qBAAqB,GACtC,MAAM,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/data/call-graph/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,YAAY,EACV,SAAS,IAAI,aAAa,EAC1B,eAAe,EACf,kBAAkB,EAClB,aAAa,EACb,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,sBAAsB,EACtB,WAAW,EACX,eAAe,IAAI,0BAA0B,EAC7C,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,yBAAyB,EACzB,KAAK,cAAc,EACnB,KAAK,mBAAmB,GACzB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,mBAAmB,EACnB,gBAAgB,IAAI,2BAA2B,EAC/C,aAAa,IAAI,sBAAsB,EACvC,cAAc,IAAI,uBAAuB,EACzC,YAAY,IAAI,qBAAqB,EACrC,KAAK,cAAc,IAAI,uBAAuB,GAC/C,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,UAAU,IAAI,mBAAmB,EACjC,UAAU,IAAI,cAAc,EAC5B,YAAY,IAAI,qBAAqB,GACtC,MAAM,oBAAoB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.cjs","sources":["../../../src/data/call-graph/types.ts"],"sourcesContent":["// The call graph as uir's `graph.Graph` serialises it (github.com/flanksource/uir/graph, model.go). The\n// field names are its JSON tags, so a host hands a response straight in. Nothing here is specific to a\n// language: what a node kind means and how it is drawn comes from a CallGraphVocabulary.\n\n/** Which side of the root a graph walks. */\nexport type CallGraphDirection = \"callees\" | \"callers\" | \"both\";\n\n/** A call site behind an edge. `guards` are the conditions that must hold to reach it, outermost first. */\nexport interface CallGraphSite {\n path?: string;\n line?: number;\n column?: number;\n /** The call as written. */\n text?: string;\n guards?: string[];\n}\n\n/** uir.Identifier: where a node sits in a module, package, type and method. */\nexport interface CallGraphIdentifier {\n id?: string;\n module?: string;\n package?: string;\n type?: string;\n method?: string;\n field?: string;\n signature?: string;\n node_type?: string;\n}\n\n/** Where a node is declared, in the terms an index addresses it by. */\nexport interface CallGraphLocation {\n root_key?: string;\n checkout_path?: string;\n snapshot_id?: string;\n source_id?: string;\n path?: string;\n identity_key?: string;\n line?: number;\n column?: number;\n}\n\nexport interface CallGraphNode {\n id: string;\n identifier: CallGraphIdentifier;\n kind: string;\n label: string;\n /** A `CallGraphGroup` id. */\n group?: string;\n /** 0 for a root, negative for its callers and positive for its callees. */\n depth: number;\n /** Incoming edges: a total on the side the walk asked about, else the edges drawn. */\n in: number;\n /** Outgoing edges: a total on the side the walk asked about, else the edges drawn. */\n out: number;\n /** A target the source could not place; drawn as a leaf. */\n unresolved?: boolean;\n location?: CallGraphLocation;\n tone?: string;\n icon?: string;\n properties?: Record<string, string>;\n}\n\n/** A call, a call one of several targets is chosen for at run time, or a read or write of data. */\nexport type CallGraphEdgeType = \"call\" | \"dispatch\" | \"read\" | \"write\";\n\n
|
|
1
|
+
{"version":3,"file":"types.cjs","sources":["../../../src/data/call-graph/types.ts"],"sourcesContent":["// The call graph as uir's `graph.Graph` serialises it (github.com/flanksource/uir/graph, model.go). The\n// field names are its JSON tags, so a host hands a response straight in. Nothing here is specific to a\n// language: what a node kind means and how it is drawn comes from a CallGraphVocabulary.\n\n/** Which side of the root a graph walks. */\nexport type CallGraphDirection = \"callees\" | \"callers\" | \"both\";\n\n/** A call site behind an edge. `guards` are the conditions that must hold to reach it, outermost first. */\nexport interface CallGraphSite {\n path?: string;\n line?: number;\n column?: number;\n /** The call as written. */\n text?: string;\n guards?: string[];\n}\n\n/** uir.Identifier: where a node sits in a module, package, type and method. */\nexport interface CallGraphIdentifier {\n id?: string;\n module?: string;\n package?: string;\n type?: string;\n method?: string;\n field?: string;\n signature?: string;\n node_type?: string;\n}\n\n/** Where a node is declared, in the terms an index addresses it by. */\nexport interface CallGraphLocation {\n root_key?: string;\n checkout_path?: string;\n snapshot_id?: string;\n source_id?: string;\n path?: string;\n identity_key?: string;\n line?: number;\n column?: number;\n}\n\nexport interface CallGraphNode {\n id: string;\n identifier: CallGraphIdentifier;\n kind: string;\n label: string;\n /** A `CallGraphGroup` id. */\n group?: string;\n /** 0 for a root, negative for its callers and positive for its callees. */\n depth: number;\n /** Incoming edges: a total on the side the walk asked about, else the edges drawn. */\n in: number;\n /** Outgoing edges: a total on the side the walk asked about, else the edges drawn. */\n out: number;\n /** A target the source could not place; drawn as a leaf. */\n unresolved?: boolean;\n location?: CallGraphLocation;\n tone?: string;\n icon?: string;\n properties?: Record<string, string>;\n}\n\n/** A call, a call one of several targets is chosen for at run time, or a read or write of data. */\nexport type CallGraphEdgeType = \"call\" | \"dispatch\" | \"read\" | \"write\";\n\n/**\n * What `fetchGraph` asks the graph to follow: `call` covers dispatch too.\n * `variable` follows the variables a body reads and writes, on top of the\n * others, for a host that offers it (`variableAccess`).\n */\nexport type CallGraphAccess = \"call\" | \"read\" | \"write\" | \"variable\";\n\n/** The access types a graph follows by default; at least one of them stays on. */\nexport const CALL_GRAPH_ACCESS: readonly CallGraphAccess[] = [\"call\", \"read\", \"write\"];\n\nexport interface CallGraphEdge {\n /** `from|to|type`. */\n id: string;\n from: string;\n to: string;\n type: CallGraphEdgeType;\n /** The construct behind the edge, such as `copybook`, `attached`, `sql` or `copyto`. */\n kind?: string;\n sites: CallGraphSite[];\n /**\n * Facts about the edge, such as the plans that select a dispatch target, or `columns`/`fields`: the\n * members a read or write of a collapsed table or entity touches, comma separated.\n */\n properties?: Record<string, string>;\n}\n\nexport interface CallGraphGroup {\n id: string;\n label: string;\n parent?: string;\n}\n\n/** What the graph leaves out. */\nexport interface CallGraphOmitted {\n node_limit?: boolean;\n beyond_depth?: number;\n unresolved?: number;\n unreadable_source?: string[];\n /** Distinct nodes the exclusions left out, per group. */\n excluded?: Record<string, number>;\n}\n\nexport interface CallGraph {\n roots: string[];\n nodes: CallGraphNode[];\n edges: CallGraphEdge[];\n groups?: CallGraphGroup[];\n omitted: CallGraphOmitted;\n}\n\n/** What `fetchGraph` is asked for. `exclude` undefined takes the host's defaults; `[]` excludes nothing. */\nexport interface CallGraphFetchParams {\n root: string;\n direction: CallGraphDirection;\n depth: number;\n exclude: string[] | undefined;\n /** The edge types to follow, never empty. Filtered by the host, so the `+N` counts agree. */\n access: CallGraphAccess[];\n /** Columns and fields as nodes of their own, rather than collapsed into their table or entity. */\n columns: boolean;\n /** `load` draws the graph around `root`; `expand` loads one more hop around a drawn node, to merge in. */\n purpose: \"load\" | \"expand\";\n signal: AbortSignal;\n}\n\n/** A group the graph reached, drawn or excluded; `nodes` counts both. */\nexport interface CallGraphGroupFact {\n name: string;\n /** Shown instead of `name`. */\n label?: string;\n /** Outside the indexed scope: \"Hide all external\" covers it. */\n external?: boolean;\n nodes: number;\n excluded: boolean;\n}\n\nexport interface CallGraphSelection {\n kind: \"node\" | \"edge\";\n id: string;\n}\n\n/** The guards fetched for a selected edge whose response came without them. */\nexport type SiteGuardsState = { status: \"loading\" } | { status: \"loaded\"; sites: CallGraphSite[] } | { status: \"failed\"; error: string };\n\n/** The words an edge's type is drawn with: its pill's accessible name, its tooltip and its legend entry. */\nexport type CallGraphEdgeLabels = Record<CallGraphEdgeType, string>;\n"],"names":[],"mappings":";;AAyEO,MAAM,oBAAgD,CAAC,QAAQ,QAAQ,OAAO;;"}
|
|
@@ -53,8 +53,13 @@ export interface CallGraphNode {
|
|
|
53
53
|
}
|
|
54
54
|
/** A call, a call one of several targets is chosen for at run time, or a read or write of data. */
|
|
55
55
|
export type CallGraphEdgeType = "call" | "dispatch" | "read" | "write";
|
|
56
|
-
/**
|
|
57
|
-
|
|
56
|
+
/**
|
|
57
|
+
* What `fetchGraph` asks the graph to follow: `call` covers dispatch too.
|
|
58
|
+
* `variable` follows the variables a body reads and writes, on top of the
|
|
59
|
+
* others, for a host that offers it (`variableAccess`).
|
|
60
|
+
*/
|
|
61
|
+
export type CallGraphAccess = "call" | "read" | "write" | "variable";
|
|
62
|
+
/** The access types a graph follows by default; at least one of them stays on. */
|
|
58
63
|
export declare const CALL_GRAPH_ACCESS: readonly CallGraphAccess[];
|
|
59
64
|
export interface CallGraphEdge {
|
|
60
65
|
/** `from|to|type`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/data/call-graph/types.ts"],"names":[],"mappings":"AAIA,4CAA4C;AAC5C,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;AAEhE,2GAA2G;AAC3G,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2BAA2B;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,+EAA+E;AAC/E,MAAM,WAAW,mBAAmB;IAClC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,uEAAuE;AACvE,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CA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AAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,kBAAkB,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IAC9B,6FAA6F;IAC7F,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B,kGAAkG;IAClG,OAAO,EAAE,OAAO,CAAC;IACjB,0GAA0G;IAC1G,OAAO,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC3B,MAAM,EAAE,WAAW,CAAC;CACrB;AAED,yEAAyE;AACzE,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,+BAA+B;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gEAAgE;IAChE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,+EAA+E;AAC/E,MAAM,MAAM,eAAe,GAAG;IAAE,MAAM,EAAE,SAAS,CAAA;CAAE,GAAG;IAAE,MAAM,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,aAAa,EAAE,CAAA;CAAE,GAAG;IAAE,MAAM,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzI,4GAA4G;AAC5G,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sources":["../../../src/data/call-graph/types.ts"],"sourcesContent":["// The call graph as uir's `graph.Graph` serialises it (github.com/flanksource/uir/graph, model.go). The\n// field names are its JSON tags, so a host hands a response straight in. Nothing here is specific to a\n// language: what a node kind means and how it is drawn comes from a CallGraphVocabulary.\n\n/** Which side of the root a graph walks. */\nexport type CallGraphDirection = \"callees\" | \"callers\" | \"both\";\n\n/** A call site behind an edge. `guards` are the conditions that must hold to reach it, outermost first. */\nexport interface CallGraphSite {\n path?: string;\n line?: number;\n column?: number;\n /** The call as written. */\n text?: string;\n guards?: string[];\n}\n\n/** uir.Identifier: where a node sits in a module, package, type and method. */\nexport interface CallGraphIdentifier {\n id?: string;\n module?: string;\n package?: string;\n type?: string;\n method?: string;\n field?: string;\n signature?: string;\n node_type?: string;\n}\n\n/** Where a node is declared, in the terms an index addresses it by. */\nexport interface CallGraphLocation {\n root_key?: string;\n checkout_path?: string;\n snapshot_id?: string;\n source_id?: string;\n path?: string;\n identity_key?: string;\n line?: number;\n column?: number;\n}\n\nexport interface CallGraphNode {\n id: string;\n identifier: CallGraphIdentifier;\n kind: string;\n label: string;\n /** A `CallGraphGroup` id. */\n group?: string;\n /** 0 for a root, negative for its callers and positive for its callees. */\n depth: number;\n /** Incoming edges: a total on the side the walk asked about, else the edges drawn. */\n in: number;\n /** Outgoing edges: a total on the side the walk asked about, else the edges drawn. */\n out: number;\n /** A target the source could not place; drawn as a leaf. */\n unresolved?: boolean;\n location?: CallGraphLocation;\n tone?: string;\n icon?: string;\n properties?: Record<string, string>;\n}\n\n/** A call, a call one of several targets is chosen for at run time, or a read or write of data. */\nexport type CallGraphEdgeType = \"call\" | \"dispatch\" | \"read\" | \"write\";\n\n
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../../src/data/call-graph/types.ts"],"sourcesContent":["// The call graph as uir's `graph.Graph` serialises it (github.com/flanksource/uir/graph, model.go). The\n// field names are its JSON tags, so a host hands a response straight in. Nothing here is specific to a\n// language: what a node kind means and how it is drawn comes from a CallGraphVocabulary.\n\n/** Which side of the root a graph walks. */\nexport type CallGraphDirection = \"callees\" | \"callers\" | \"both\";\n\n/** A call site behind an edge. `guards` are the conditions that must hold to reach it, outermost first. */\nexport interface CallGraphSite {\n path?: string;\n line?: number;\n column?: number;\n /** The call as written. */\n text?: string;\n guards?: string[];\n}\n\n/** uir.Identifier: where a node sits in a module, package, type and method. */\nexport interface CallGraphIdentifier {\n id?: string;\n module?: string;\n package?: string;\n type?: string;\n method?: string;\n field?: string;\n signature?: string;\n node_type?: string;\n}\n\n/** Where a node is declared, in the terms an index addresses it by. */\nexport interface CallGraphLocation {\n root_key?: string;\n checkout_path?: string;\n snapshot_id?: string;\n source_id?: string;\n path?: string;\n identity_key?: string;\n line?: number;\n column?: number;\n}\n\nexport interface CallGraphNode {\n id: string;\n identifier: CallGraphIdentifier;\n kind: string;\n label: string;\n /** A `CallGraphGroup` id. */\n group?: string;\n /** 0 for a root, negative for its callers and positive for its callees. */\n depth: number;\n /** Incoming edges: a total on the side the walk asked about, else the edges drawn. */\n in: number;\n /** Outgoing edges: a total on the side the walk asked about, else the edges drawn. */\n out: number;\n /** A target the source could not place; drawn as a leaf. */\n unresolved?: boolean;\n location?: CallGraphLocation;\n tone?: string;\n icon?: string;\n properties?: Record<string, string>;\n}\n\n/** A call, a call one of several targets is chosen for at run time, or a read or write of data. */\nexport type CallGraphEdgeType = \"call\" | \"dispatch\" | \"read\" | \"write\";\n\n/**\n * What `fetchGraph` asks the graph to follow: `call` covers dispatch too.\n * `variable` follows the variables a body reads and writes, on top of the\n * others, for a host that offers it (`variableAccess`).\n */\nexport type CallGraphAccess = \"call\" | \"read\" | \"write\" | \"variable\";\n\n/** The access types a graph follows by default; at least one of them stays on. */\nexport const CALL_GRAPH_ACCESS: readonly CallGraphAccess[] = [\"call\", \"read\", \"write\"];\n\nexport interface CallGraphEdge {\n /** `from|to|type`. */\n id: string;\n from: string;\n to: string;\n type: CallGraphEdgeType;\n /** The construct behind the edge, such as `copybook`, `attached`, `sql` or `copyto`. */\n kind?: string;\n sites: CallGraphSite[];\n /**\n * Facts about the edge, such as the plans that select a dispatch target, or `columns`/`fields`: the\n * members a read or write of a collapsed table or entity touches, comma separated.\n */\n properties?: Record<string, string>;\n}\n\nexport interface CallGraphGroup {\n id: string;\n label: string;\n parent?: string;\n}\n\n/** What the graph leaves out. */\nexport interface CallGraphOmitted {\n node_limit?: boolean;\n beyond_depth?: number;\n unresolved?: number;\n unreadable_source?: string[];\n /** Distinct nodes the exclusions left out, per group. */\n excluded?: Record<string, number>;\n}\n\nexport interface CallGraph {\n roots: string[];\n nodes: CallGraphNode[];\n edges: CallGraphEdge[];\n groups?: CallGraphGroup[];\n omitted: CallGraphOmitted;\n}\n\n/** What `fetchGraph` is asked for. `exclude` undefined takes the host's defaults; `[]` excludes nothing. */\nexport interface CallGraphFetchParams {\n root: string;\n direction: CallGraphDirection;\n depth: number;\n exclude: string[] | undefined;\n /** The edge types to follow, never empty. Filtered by the host, so the `+N` counts agree. */\n access: CallGraphAccess[];\n /** Columns and fields as nodes of their own, rather than collapsed into their table or entity. */\n columns: boolean;\n /** `load` draws the graph around `root`; `expand` loads one more hop around a drawn node, to merge in. */\n purpose: \"load\" | \"expand\";\n signal: AbortSignal;\n}\n\n/** A group the graph reached, drawn or excluded; `nodes` counts both. */\nexport interface CallGraphGroupFact {\n name: string;\n /** Shown instead of `name`. */\n label?: string;\n /** Outside the indexed scope: \"Hide all external\" covers it. */\n external?: boolean;\n nodes: number;\n excluded: boolean;\n}\n\nexport interface CallGraphSelection {\n kind: \"node\" | \"edge\";\n id: string;\n}\n\n/** The guards fetched for a selected edge whose response came without them. */\nexport type SiteGuardsState = { status: \"loading\" } | { status: \"loaded\"; sites: CallGraphSite[] } | { status: \"failed\"; error: string };\n\n/** The words an edge's type is drawn with: its pill's accessible name, its tooltip and its legend entry. */\nexport type CallGraphEdgeLabels = Record<CallGraphEdgeType, string>;\n"],"names":[],"mappings":"AAyEO,MAAM,oBAAgD,CAAC,QAAQ,QAAQ,OAAO;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
function mergeAccess(held, next) {
|
|
4
|
+
if (held === void 0 || held === next) return next;
|
|
5
|
+
return "readwrite";
|
|
6
|
+
}
|
|
7
|
+
exports.mergeAccess = mergeAccess;
|
|
8
|
+
//# sourceMappingURL=data-access.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-access.cjs","sources":["../../src/data/data-access.ts"],"sourcesContent":["/** How a name is accessed: only read, only written, or both. */\nexport type DataAccess = \"read\" | \"write\" | \"readwrite\";\n\n/** The access of a name `held` was known for, once `next` is seen too: the same, or both when they differ. */\nexport function mergeAccess(held: DataAccess | undefined, next: DataAccess): DataAccess {\n if (held === undefined || held === next) return next;\n return \"readwrite\";\n}\n"],"names":[],"mappings":";;AAIO,SAAS,YAAY,MAA8B,MAA8B;AACtF,MAAI,SAAS,UAAa,SAAS,KAAM,QAAO;AAChD,SAAO;AACT;;"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** How a name is accessed: only read, only written, or both. */
|
|
2
|
+
export type DataAccess = "read" | "write" | "readwrite";
|
|
3
|
+
/** The access of a name `held` was known for, once `next` is seen too: the same, or both when they differ. */
|
|
4
|
+
export declare function mergeAccess(held: DataAccess | undefined, next: DataAccess): DataAccess;
|
|
5
|
+
//# sourceMappingURL=data-access.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-access.d.ts","sourceRoot":"","sources":["../../src/data/data-access.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,WAAW,CAAC;AAExD,8GAA8G;AAC9G,wBAAgB,WAAW,CAAC,IAAI,EAAE,UAAU,GAAG,SAAS,EAAE,IAAI,EAAE,UAAU,GAAG,UAAU,CAGtF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-access.js","sources":["../../src/data/data-access.ts"],"sourcesContent":["/** How a name is accessed: only read, only written, or both. */\nexport type DataAccess = \"read\" | \"write\" | \"readwrite\";\n\n/** The access of a name `held` was known for, once `next` is seen too: the same, or both when they differ. */\nexport function mergeAccess(held: DataAccess | undefined, next: DataAccess): DataAccess {\n if (held === undefined || held === next) return next;\n return \"readwrite\";\n}\n"],"names":[],"mappings":"AAIO,SAAS,YAAY,MAA8B,MAA8B;AACtF,MAAI,SAAS,UAAa,SAAS,KAAM,QAAO;AAChD,SAAO;AACT;"}
|
|
@@ -106,7 +106,9 @@ function GitDiffPanel({
|
|
|
106
106
|
error,
|
|
107
107
|
emptyLabel = "No text diff available",
|
|
108
108
|
className,
|
|
109
|
-
maxHeightClassName = "max-h-[520px]"
|
|
109
|
+
maxHeightClassName = "max-h-[520px]",
|
|
110
|
+
onLineAction,
|
|
111
|
+
lineWidgets
|
|
110
112
|
}) {
|
|
111
113
|
if (loading) {
|
|
112
114
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: utils.cn("border-t border-border bg-muted/40 px-3 py-3 text-xs text-muted-foreground", className), children: "Loading diff..." });
|
|
@@ -129,7 +131,9 @@ function GitDiffPanel({
|
|
|
129
131
|
bare: true,
|
|
130
132
|
unified: payload.diff,
|
|
131
133
|
className: utils.cn("overflow-auto px-1 py-2", maxHeightClassName),
|
|
132
|
-
...language ? { language } : {}
|
|
134
|
+
...language ? { language } : {},
|
|
135
|
+
...onLineAction ? { onLineAction } : {},
|
|
136
|
+
...lineWidgets ? { lineWidgets } : {}
|
|
133
137
|
}
|
|
134
138
|
)
|
|
135
139
|
] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GitChangeList.cjs","sources":["../../../src/data/git/GitChangeList.tsx"],"sourcesContent":["import { useMemo, useState, type KeyboardEvent, type ReactNode } from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport {\n UiChevronDown,\n UiChevronRight,\n UiClock,\n UiCode2,\n UiDiff,\n UiFile,\n UiFileCode,\n UiFilePlus,\n UiGitCommit,\n UiLinkExternal,\n UiRemove,\n} from \"../../icons\";\nimport type { IconComponent } from \"../../icons/types\";\nimport { CodeDiff } from \"../CodeDiff\";\nimport { languageFromPath } from \"../code-highlight\";\nimport { dateKey, formatFallbackTime, formatGitCommitDateHeader } from \"./git-dates\";\n\nexport type GitDiffPayload = {\n diff: string;\n truncated?: boolean;\n binary?: boolean;\n path?: string;\n commit?: string;\n};\n\nexport type GitDiffLoader<T> = (item: T) => Promise<GitDiffPayload>;\n\nexport type GitCommitItem = {\n id?: string;\n sha: string;\n shortSha?: string;\n title: string;\n body?: string;\n authorName?: string;\n authorLogin?: string;\n authorAvatarUrl?: string;\n committedAt?: string;\n additions?: number;\n deletions?: number;\n changedFiles?: number;\n href?: string;\n};\n\nexport type GitFileChangeStatus =\n | \"added\"\n | \"modified\"\n | \"deleted\"\n | \"renamed\"\n | \"copied\"\n | string;\n\nexport type GitFileChangeItem = {\n id?: string;\n path: string;\n previousPath?: string;\n status?: GitFileChangeStatus;\n additions?: number;\n deletions?: number;\n href?: string;\n binary?: boolean;\n};\n\ntype DiffState = {\n loading: boolean;\n payload: GitDiffPayload | null;\n error: string;\n};\n\nexport type GitDiffPanelProps = {\n loading?: boolean;\n payload?: GitDiffPayload | null;\n error?: string;\n emptyLabel?: string;\n className?: string;\n maxHeightClassName?: string;\n};\n\nexport type GitCommitListProps = {\n commits: GitCommitItem[];\n loadDiff?: GitDiffLoader<GitCommitItem>;\n renderTime?: (iso: string) => ReactNode;\n groupByDate?: boolean;\n emptyLabel?: string;\n className?: string;\n diffMaxHeightClassName?: string;\n};\n\nexport type GitFileListProps = {\n files: GitFileChangeItem[];\n loadDiff?: GitDiffLoader<GitFileChangeItem>;\n emptyLabel?: string;\n className?: string;\n diffMaxHeightClassName?: string;\n};\n\ntype CommitGroup = {\n key: string;\n label: string;\n commits: GitCommitItem[];\n};\n\nconst DIFF_INITIAL_STATE: DiffState = {\n loading: false,\n payload: null,\n error: \"\",\n};\n\nfunction messageFromError(error: unknown): string {\n if (error instanceof Error) return error.message;\n if (typeof error === \"string\") return error;\n return \"Failed to load diff\";\n}\n\nfunction isActivationKey(event: KeyboardEvent<HTMLDivElement>): boolean {\n return event.key === \"Enter\" || event.key === \" \";\n}\n\nfunction groupCommits(commits: GitCommitItem[], enabled: boolean): CommitGroup[] {\n if (!enabled) return [{ key: \"all\", label: \"\", commits }];\n const groups: CommitGroup[] = [];\n const indexByKey = new Map<string, number>();\n for (const commit of commits) {\n const key = dateKey(commit.committedAt);\n const existing = indexByKey.get(key);\n if (existing != null) {\n groups[existing]?.commits.push(commit);\n continue;\n }\n indexByKey.set(key, groups.length);\n groups.push({\n key,\n label: formatGitCommitDateHeader(commit.committedAt),\n commits: [commit],\n });\n }\n return groups;\n}\n\nfunction shortSha(commit: GitCommitItem): string {\n return commit.shortSha || commit.sha.slice(0, 7);\n}\n\nfunction displayAuthor(commit: GitCommitItem): string {\n return commit.authorLogin || commit.authorName || \"\";\n}\n\nfunction statText(additions?: number, deletions?: number): ReactNode {\n const adds = additions ?? 0;\n const dels = deletions ?? 0;\n if (adds === 0 && dels === 0) return null;\n return (\n <>\n <span aria-hidden>·</span>\n {adds > 0 && <span className=\"text-emerald-600 dark:text-emerald-400\">+{adds}</span>}\n {dels > 0 && <span className=\"text-rose-600 dark:text-rose-400\">-{dels}</span>}\n </>\n );\n}\n\nfunction useLazyDiff<T>(item: T, loader: GitDiffLoader<T> | undefined): [boolean, DiffState, () => void] {\n const [expanded, setExpanded] = useState(false);\n const [state, setState] = useState<DiffState>(DIFF_INITIAL_STATE);\n\n function toggle() {\n setExpanded(open => !open);\n if (!expanded && loader && !state.payload && !state.loading && !state.error) {\n setState({ loading: true, payload: null, error: \"\" });\n loader(item)\n .then(payload => setState({ loading: false, payload, error: \"\" }))\n .catch(error => setState({ loading: false, payload: null, error: messageFromError(error) }));\n }\n }\n\n return [expanded, state, toggle];\n}\n\nfunction Chevron({ expanded }: { expanded: boolean }) {\n const Icon = expanded ? UiChevronDown : UiChevronRight;\n return <Icon className=\"h-3.5 w-3.5 text-muted-foreground\" />;\n}\n\nfunction AvatarImage({ src, alt }: { src: string; alt: string }) {\n return (\n <img\n src={src}\n alt={alt}\n className=\"h-4 w-4 rounded-full border border-border object-cover\"\n loading=\"lazy\"\n />\n );\n}\n\nexport function GitDiffPanel({\n loading,\n payload,\n error,\n emptyLabel = \"No text diff available\",\n className,\n maxHeightClassName = \"max-h-[520px]\",\n}: GitDiffPanelProps) {\n if (loading) {\n return (\n <div className={cn(\"border-t border-border bg-muted/40 px-3 py-3 text-xs text-muted-foreground\", className)}>\n Loading diff...\n </div>\n );\n }\n\n if (error) {\n return (\n <div className={cn(\"border-t border-border bg-rose-50 px-3 py-3 text-xs text-rose-700 dark:bg-rose-950/30 dark:text-rose-300\", className)}>\n {error}\n </div>\n );\n }\n\n if (payload?.binary) {\n return (\n <div className={cn(\"border-t border-border bg-muted/40 px-3 py-3 text-xs text-muted-foreground\", className)}>\n Binary file not shown.\n </div>\n );\n }\n\n if (!payload?.diff) {\n return (\n <div className={cn(\"border-t border-border bg-muted/40 px-3 py-3 text-xs text-muted-foreground\", className)}>\n {emptyLabel}\n </div>\n );\n }\n\n const language = languageFromPath(payload.path);\n return (\n <div className={cn(\"border-t border-border\", className)}>\n {payload.truncated && (\n <div className=\"border-b border-border bg-amber-100/70 px-3 py-1.5 text-xs text-amber-800 [[data-theme=dark]_&]:bg-amber-950/40 [[data-theme=dark]_&]:text-amber-200\">\n Diff truncated.\n </div>\n )}\n <CodeDiff\n bare\n unified={payload.diff}\n className={cn(\"overflow-auto px-1 py-2\", maxHeightClassName)}\n {...(language ? { language } : {})}\n />\n </div>\n );\n}\n\nfunction CommitRow({\n commit,\n loadDiff,\n renderTime,\n diffMaxHeightClassName,\n}: {\n commit: GitCommitItem;\n loadDiff?: GitDiffLoader<GitCommitItem>;\n renderTime?: (iso: string) => ReactNode;\n diffMaxHeightClassName?: string;\n}) {\n const [expanded, diffState, toggle] = useLazyDiff(commit, loadDiff);\n const author = displayAuthor(commit);\n const canExpand = Boolean(loadDiff || commit.body);\n\n function onKeyDown(event: KeyboardEvent<HTMLDivElement>) {\n if (!canExpand || !isActivationKey(event)) return;\n event.preventDefault();\n toggle();\n }\n\n return (\n <div>\n <div\n role={canExpand ? \"button\" : undefined}\n tabIndex={canExpand ? 0 : undefined}\n className={cn(\n \"flex min-h-14 items-start gap-2 px-3 py-2 text-xs transition-colors\",\n canExpand && \"cursor-pointer hover:bg-muted/70\",\n )}\n onClick={canExpand ? toggle : undefined}\n onKeyDown={canExpand ? onKeyDown : undefined}\n >\n <span className=\"mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground\">\n <UiGitCommit className=\"h-3.5 w-3.5\" />\n </span>\n <div className=\"min-w-0 flex-1\">\n <div className=\"truncate font-medium text-foreground\" title={commit.title}>\n {commit.title}\n </div>\n <div className=\"mt-1 flex flex-wrap items-center gap-1.5 text-muted-foreground\">\n {commit.authorAvatarUrl && (\n <AvatarImage src={commit.authorAvatarUrl} alt={author || \"Commit author\"} />\n )}\n {author && <span>{author}</span>}\n {commit.committedAt && (\n <>\n <span aria-hidden>·</span>\n <span className=\"inline-flex items-center gap-1\">\n <UiClock className=\"h-3 w-3\" />\n {renderTime ? renderTime(commit.committedAt) : formatFallbackTime(commit.committedAt)}\n </span>\n </>\n )}\n {statText(commit.additions, commit.deletions)}\n {(commit.changedFiles ?? 0) > 0 && (\n <>\n <span aria-hidden>·</span>\n <span>{commit.changedFiles} files</span>\n </>\n )}\n </div>\n </div>\n {commit.href ? (\n <a\n href={commit.href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"mt-0.5 inline-flex shrink-0 items-center gap-1 font-mono text-cyan-600 hover:underline\"\n onClick={event => event.stopPropagation()}\n >\n {shortSha(commit)}\n <UiLinkExternal className=\"h-3 w-3\" />\n </a>\n ) : (\n <span className=\"mt-0.5 shrink-0 font-mono text-cyan-600\">{shortSha(commit)}</span>\n )}\n {canExpand && (\n <span className=\"mt-1 shrink-0\">\n <Chevron expanded={expanded} />\n </span>\n )}\n </div>\n {expanded && (\n <div className=\"border-t border-border bg-secondary/50\">\n {commit.body && (\n <pre className=\"mx-3 my-2 whitespace-pre-wrap rounded bg-muted px-3 py-2 font-mono text-[11px] leading-5 text-muted-foreground\">\n {commit.body}\n </pre>\n )}\n {loadDiff && (\n <GitDiffPanel\n loading={diffState.loading}\n payload={diffState.payload}\n error={diffState.error}\n {...(diffMaxHeightClassName ? { maxHeightClassName: diffMaxHeightClassName } : {})}\n />\n )}\n </div>\n )}\n </div>\n );\n}\n\nexport function GitCommitList({\n commits,\n loadDiff,\n renderTime,\n groupByDate = true,\n emptyLabel = \"No commits found\",\n className,\n diffMaxHeightClassName,\n}: GitCommitListProps) {\n const groups = useMemo(() => groupCommits(commits, groupByDate), [commits, groupByDate]);\n\n if (commits.length === 0) {\n return <div className={cn(\"py-4 text-xs text-muted-foreground\", className)}>{emptyLabel}</div>;\n }\n\n return (\n <div className={cn(\"overflow-hidden rounded-md border border-border\", className)}>\n {groups.map(group => (\n <section key={group.key} aria-label={group.label || \"Commits\"}>\n {group.label && (\n <div className=\"border-b border-border bg-muted/60 px-3 py-2 text-xs font-semibold text-foreground\">\n {group.label}\n </div>\n )}\n <div className=\"divide-y divide-border\">\n {group.commits.map(commit => (\n <CommitRow\n key={commit.id || commit.sha}\n commit={commit}\n {...(loadDiff ? { loadDiff } : {})}\n {...(renderTime ? { renderTime } : {})}\n {...(diffMaxHeightClassName ? { diffMaxHeightClassName } : {})}\n />\n ))}\n </div>\n </section>\n ))}\n </div>\n );\n}\n\ntype StatusView = {\n label: string;\n icon: IconComponent;\n iconClassName: string;\n};\n\nfunction normalizedStatus(status?: string): string {\n return (status || \"modified\").toLowerCase();\n}\n\nfunction statusView(status?: string): StatusView {\n switch (normalizedStatus(status)) {\n case \"added\":\n return { label: \"Added\", icon: UiFilePlus, iconClassName: \"text-emerald-600 dark:text-emerald-400\" };\n case \"deleted\":\n return { label: \"Deleted\", icon: UiRemove, iconClassName: \"text-rose-600 dark:text-rose-400\" };\n case \"renamed\":\n return { label: \"Renamed\", icon: UiFileCode, iconClassName: \"text-sky-600 dark:text-sky-400\" };\n case \"copied\":\n return { label: \"Copied\", icon: UiCode2, iconClassName: \"text-sky-600 dark:text-sky-400\" };\n default:\n return { label: \"Modified\", icon: UiFile, iconClassName: \"text-amber-600 dark:text-amber-400\" };\n }\n}\n\nfunction splitPath(path: string): { directory: string; basename: string } {\n const index = path.lastIndexOf(\"/\");\n if (index < 0) return { directory: \"\", basename: path };\n return { directory: `${path.slice(0, index)}/`, basename: path.slice(index + 1) };\n}\n\nfunction DiffBars({ additions = 0, deletions = 0 }: { additions?: number; deletions?: number }) {\n const total = additions + deletions;\n const maxBars = 5;\n const addBars = total > 0 ? Math.round((additions / total) * maxBars) : 0;\n const delBars = total > 0 ? maxBars - addBars : 0;\n return (\n <span className=\"inline-flex gap-px\" aria-hidden>\n {Array.from({ length: addBars }).map((_, index) => (\n <span key={`a${index}`} className=\"inline-block h-2 w-1.5 rounded-sm bg-emerald-500\" />\n ))}\n {Array.from({ length: delBars }).map((_, index) => (\n <span key={`d${index}`} className=\"inline-block h-2 w-1.5 rounded-sm bg-rose-500\" />\n ))}\n {total === 0 && <span className=\"inline-block h-2 w-1.5 rounded-sm bg-muted-foreground/30\" />}\n </span>\n );\n}\n\nfunction FileRow({\n file,\n loadDiff,\n diffMaxHeightClassName,\n}: {\n file: GitFileChangeItem;\n loadDiff?: GitDiffLoader<GitFileChangeItem>;\n diffMaxHeightClassName?: string;\n}) {\n const [expanded, diffState, toggle] = useLazyDiff(file, loadDiff);\n const status = statusView(file.status);\n const StatusIcon = status.icon;\n const path = splitPath(file.path);\n const canExpand = Boolean(loadDiff);\n\n function onKeyDown(event: KeyboardEvent<HTMLDivElement>) {\n if (!canExpand || !isActivationKey(event)) return;\n event.preventDefault();\n toggle();\n }\n\n return (\n <div>\n <div\n role={canExpand ? \"button\" : undefined}\n tabIndex={canExpand ? 0 : undefined}\n className={cn(\n \"flex min-h-11 items-center gap-2 px-3 py-2 text-xs transition-colors\",\n canExpand && \"cursor-pointer hover:bg-muted/70\",\n )}\n onClick={canExpand ? toggle : undefined}\n onKeyDown={canExpand ? onKeyDown : undefined}\n >\n <StatusIcon className={cn(\"h-4 w-4 shrink-0\", status.iconClassName)} />\n <div className=\"min-w-0 flex-1\">\n <div className=\"truncate font-mono text-foreground\" title={file.path}>\n {path.directory && <span className=\"text-muted-foreground\">{path.directory}</span>}\n <span>{path.basename}</span>\n </div>\n {file.previousPath && (\n <div className=\"mt-0.5 truncate font-mono text-[11px] text-muted-foreground\">\n from {file.previousPath}\n </div>\n )}\n </div>\n <span className=\"shrink-0 text-[11px] text-muted-foreground\">{status.label}</span>\n <span className=\"shrink-0 tabular-nums text-emerald-600 dark:text-emerald-400\">\n +{file.additions ?? 0}\n </span>\n <span className=\"shrink-0 tabular-nums text-rose-600 dark:text-rose-400\">\n -{file.deletions ?? 0}\n </span>\n <DiffBars\n {...(file.additions !== undefined ? { additions: file.additions } : {})}\n {...(file.deletions !== undefined ? { deletions: file.deletions } : {})}\n />\n {file.href && (\n <a\n href={file.href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"shrink-0 text-muted-foreground hover:text-foreground\"\n onClick={event => event.stopPropagation()}\n aria-label={`Open ${file.path}`}\n >\n <UiLinkExternal className=\"h-3.5 w-3.5\" />\n </a>\n )}\n {canExpand && (\n <span className=\"shrink-0\">\n <Chevron expanded={expanded} />\n </span>\n )}\n </div>\n {expanded && (\n <GitDiffPanel\n loading={diffState.loading}\n payload={diffState.payload}\n error={diffState.error}\n {...(diffMaxHeightClassName ? { maxHeightClassName: diffMaxHeightClassName } : {})}\n />\n )}\n </div>\n );\n}\n\nexport function GitFileList({\n files,\n loadDiff,\n emptyLabel = \"No changed files found\",\n className,\n diffMaxHeightClassName,\n}: GitFileListProps) {\n if (files.length === 0) {\n return <div className={cn(\"py-4 text-xs text-muted-foreground\", className)}>{emptyLabel}</div>;\n }\n\n return (\n <div className={cn(\"overflow-hidden rounded-md border border-border\", className)}>\n <div className=\"divide-y divide-border\">\n {files.map(file => (\n <FileRow\n key={file.id || file.path}\n file={file}\n {...(loadDiff ? { loadDiff } : {})}\n {...(diffMaxHeightClassName ? { diffMaxHeightClassName } : {})}\n />\n ))}\n </div>\n </div>\n );\n}\n\nexport function GitChangedFilesSummary({\n files,\n additions,\n deletions,\n className,\n}: {\n files: number;\n additions: number;\n deletions: number;\n className?: string;\n}) {\n return (\n <div className={cn(\"flex items-center gap-2 text-xs text-muted-foreground\", className)}>\n <span className=\"inline-flex items-center gap-1 font-medium\">\n <UiDiff className=\"h-3.5 w-3.5\" />\n {files} file{files === 1 ? \"\" : \"s\"} changed\n </span>\n <span aria-hidden>·</span>\n <span className=\"text-emerald-600 dark:text-emerald-400\">+{additions}</span>\n <span className=\"text-rose-600 dark:text-rose-400\">-{deletions}</span>\n </div>\n );\n}\n"],"names":["dateKey","formatGitCommitDateHeader","jsxs","Fragment","jsx","useState","UiChevronDown","UiChevronRight","cn","languageFromPath","CodeDiff","UiGitCommit","UiClock","formatFallbackTime","UiLinkExternal","useMemo","UiFilePlus","UiRemove","UiFileCode","UiCode2","UiFile","UiDiff"],"mappings":";;;;;;;;;;;;;;;;;;;AAwGA,MAAM,qBAAgC;AAAA,EACpC,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AACT;AAEA,SAAS,iBAAiB,OAAwB;AAChD,MAAI,iBAAiB,MAAO,QAAO,MAAM;AACzC,MAAI,OAAO,UAAU,SAAU,QAAO;AACtC,SAAO;AACT;AAEA,SAAS,gBAAgB,OAA+C;AACtE,SAAO,MAAM,QAAQ,WAAW,MAAM,QAAQ;AAChD;AAEA,SAAS,aAAa,SAA0B,SAAiC;;AAC/E,MAAI,CAAC,QAAS,QAAO,CAAC,EAAE,KAAK,OAAO,OAAO,IAAI,SAAS;AACxD,QAAM,SAAwB,CAAA;AAC9B,QAAM,iCAAiB,IAAA;AACvB,aAAW,UAAU,SAAS;AAC5B,UAAM,MAAMA,SAAAA,QAAQ,OAAO,W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E,2BAAAA,IAACiB,OAAAA,QAAA,EAAO,WAAU,cAAA,CAAc;AAAA,MAC/B;AAAA,MAAM;AAAA,MAAM,UAAU,IAAI,KAAK;AAAA,MAAI;AAAA,IAAA,GACtC;AAAA,IACAjB,2BAAAA,IAAC,QAAA,EAAK,eAAW,MAAC,UAAA,KAAC;AAAA,IACnBF,2BAAAA,KAAC,QAAA,EAAK,WAAU,0CAAyC,UAAA;AAAA,MAAA;AAAA,MAAE;AAAA,IAAA,GAAU;AAAA,IACrEA,2BAAAA,KAAC,QAAA,EAAK,WAAU,oCAAmC,UAAA;AAAA,MAAA;AAAA,MAAE;AAAA,IAAA,EAAA,CAAU;AAAA,EAAA,GACjE;AAEJ;;;;;"}
|
|
1
|
+
{"version":3,"file":"GitChangeList.cjs","sources":["../../../src/data/git/GitChangeList.tsx"],"sourcesContent":["import { useMemo, useState, type KeyboardEvent, type ReactNode } from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport {\n UiChevronDown,\n UiChevronRight,\n UiClock,\n UiCode2,\n UiDiff,\n UiFile,\n UiFileCode,\n UiFilePlus,\n UiGitCommit,\n UiLinkExternal,\n UiRemove,\n} from \"../../icons\";\nimport type { IconComponent } from \"../../icons/types\";\nimport { CodeDiff, type DiffLineTarget, type DiffLineWidget } from \"../CodeDiff\";\nimport { languageFromPath } from \"../code-highlight\";\nimport { dateKey, formatFallbackTime, formatGitCommitDateHeader } from \"./git-dates\";\n\nexport type GitDiffPayload = {\n diff: string;\n truncated?: boolean;\n binary?: boolean;\n path?: string;\n commit?: string;\n};\n\nexport type GitDiffLoader<T> = (item: T) => Promise<GitDiffPayload>;\n\nexport type GitCommitItem = {\n id?: string;\n sha: string;\n shortSha?: string;\n title: string;\n body?: string;\n authorName?: string;\n authorLogin?: string;\n authorAvatarUrl?: string;\n committedAt?: string;\n additions?: number;\n deletions?: number;\n changedFiles?: number;\n href?: string;\n};\n\nexport type GitFileChangeStatus =\n | \"added\"\n | \"modified\"\n | \"deleted\"\n | \"renamed\"\n | \"copied\"\n | string;\n\nexport type GitFileChangeItem = {\n id?: string;\n path: string;\n previousPath?: string;\n status?: GitFileChangeStatus;\n additions?: number;\n deletions?: number;\n href?: string;\n binary?: boolean;\n};\n\ntype DiffState = {\n loading: boolean;\n payload: GitDiffPayload | null;\n error: string;\n};\n\nexport type GitDiffPanelProps = {\n loading?: boolean;\n payload?: GitDiffPayload | null;\n error?: string;\n emptyLabel?: string;\n className?: string;\n maxHeightClassName?: string;\n /** Forwarded to `CodeDiff`: shows a gutter \"+\" button per numbered line. */\n onLineAction?: (target: DiffLineTarget) => void;\n /** Forwarded to `CodeDiff`: rows rendered under the matching diff line. */\n lineWidgets?: DiffLineWidget[];\n};\n\nexport type GitCommitListProps = {\n commits: GitCommitItem[];\n loadDiff?: GitDiffLoader<GitCommitItem>;\n renderTime?: (iso: string) => ReactNode;\n groupByDate?: boolean;\n emptyLabel?: string;\n className?: string;\n diffMaxHeightClassName?: string;\n};\n\nexport type GitFileListProps = {\n files: GitFileChangeItem[];\n loadDiff?: GitDiffLoader<GitFileChangeItem>;\n emptyLabel?: string;\n className?: string;\n diffMaxHeightClassName?: string;\n};\n\ntype CommitGroup = {\n key: string;\n label: string;\n commits: GitCommitItem[];\n};\n\nconst DIFF_INITIAL_STATE: DiffState = {\n loading: false,\n payload: null,\n error: \"\",\n};\n\nfunction messageFromError(error: unknown): string {\n if (error instanceof Error) return error.message;\n if (typeof error === \"string\") return error;\n return \"Failed to load diff\";\n}\n\nfunction isActivationKey(event: KeyboardEvent<HTMLDivElement>): boolean {\n return event.key === \"Enter\" || event.key === \" \";\n}\n\nfunction groupCommits(commits: GitCommitItem[], enabled: boolean): CommitGroup[] {\n if (!enabled) return [{ key: \"all\", label: \"\", commits }];\n const groups: CommitGroup[] = [];\n const indexByKey = new Map<string, number>();\n for (const commit of commits) {\n const key = dateKey(commit.committedAt);\n const existing = indexByKey.get(key);\n if (existing != null) {\n groups[existing]?.commits.push(commit);\n continue;\n }\n indexByKey.set(key, groups.length);\n groups.push({\n key,\n label: formatGitCommitDateHeader(commit.committedAt),\n commits: [commit],\n });\n }\n return groups;\n}\n\nfunction shortSha(commit: GitCommitItem): string {\n return commit.shortSha || commit.sha.slice(0, 7);\n}\n\nfunction displayAuthor(commit: GitCommitItem): string {\n return commit.authorLogin || commit.authorName || \"\";\n}\n\nfunction statText(additions?: number, deletions?: number): ReactNode {\n const adds = additions ?? 0;\n const dels = deletions ?? 0;\n if (adds === 0 && dels === 0) return null;\n return (\n <>\n <span aria-hidden>·</span>\n {adds > 0 && <span className=\"text-emerald-600 dark:text-emerald-400\">+{adds}</span>}\n {dels > 0 && <span className=\"text-rose-600 dark:text-rose-400\">-{dels}</span>}\n </>\n );\n}\n\nfunction useLazyDiff<T>(item: T, loader: GitDiffLoader<T> | undefined): [boolean, DiffState, () => void] {\n const [expanded, setExpanded] = useState(false);\n const [state, setState] = useState<DiffState>(DIFF_INITIAL_STATE);\n\n function toggle() {\n setExpanded(open => !open);\n if (!expanded && loader && !state.payload && !state.loading && !state.error) {\n setState({ loading: true, payload: null, error: \"\" });\n loader(item)\n .then(payload => setState({ loading: false, payload, error: \"\" }))\n .catch(error => setState({ loading: false, payload: null, error: messageFromError(error) }));\n }\n }\n\n return [expanded, state, toggle];\n}\n\nfunction Chevron({ expanded }: { expanded: boolean }) {\n const Icon = expanded ? UiChevronDown : UiChevronRight;\n return <Icon className=\"h-3.5 w-3.5 text-muted-foreground\" />;\n}\n\nfunction AvatarImage({ src, alt }: { src: string; alt: string }) {\n return (\n <img\n src={src}\n alt={alt}\n className=\"h-4 w-4 rounded-full border border-border object-cover\"\n loading=\"lazy\"\n />\n );\n}\n\nexport function GitDiffPanel({\n loading,\n payload,\n error,\n emptyLabel = \"No text diff available\",\n className,\n maxHeightClassName = \"max-h-[520px]\",\n onLineAction,\n lineWidgets,\n}: GitDiffPanelProps) {\n if (loading) {\n return (\n <div className={cn(\"border-t border-border bg-muted/40 px-3 py-3 text-xs text-muted-foreground\", className)}>\n Loading diff...\n </div>\n );\n }\n\n if (error) {\n return (\n <div className={cn(\"border-t border-border bg-rose-50 px-3 py-3 text-xs text-rose-700 dark:bg-rose-950/30 dark:text-rose-300\", className)}>\n {error}\n </div>\n );\n }\n\n if (payload?.binary) {\n return (\n <div className={cn(\"border-t border-border bg-muted/40 px-3 py-3 text-xs text-muted-foreground\", className)}>\n Binary file not shown.\n </div>\n );\n }\n\n if (!payload?.diff) {\n return (\n <div className={cn(\"border-t border-border bg-muted/40 px-3 py-3 text-xs text-muted-foreground\", className)}>\n {emptyLabel}\n </div>\n );\n }\n\n const language = languageFromPath(payload.path);\n return (\n <div className={cn(\"border-t border-border\", className)}>\n {payload.truncated && (\n <div className=\"border-b border-border bg-amber-100/70 px-3 py-1.5 text-xs text-amber-800 [[data-theme=dark]_&]:bg-amber-950/40 [[data-theme=dark]_&]:text-amber-200\">\n Diff truncated.\n </div>\n )}\n <CodeDiff\n bare\n unified={payload.diff}\n className={cn(\"overflow-auto px-1 py-2\", maxHeightClassName)}\n {...(language ? { language } : {})}\n {...(onLineAction ? { onLineAction } : {})}\n {...(lineWidgets ? { lineWidgets } : {})}\n />\n </div>\n );\n}\n\nfunction CommitRow({\n commit,\n loadDiff,\n renderTime,\n diffMaxHeightClassName,\n}: {\n commit: GitCommitItem;\n loadDiff?: GitDiffLoader<GitCommitItem>;\n renderTime?: (iso: string) => ReactNode;\n diffMaxHeightClassName?: string;\n}) {\n const [expanded, diffState, toggle] = useLazyDiff(commit, loadDiff);\n const author = displayAuthor(commit);\n const canExpand = Boolean(loadDiff || commit.body);\n\n function onKeyDown(event: KeyboardEvent<HTMLDivElement>) {\n if (!canExpand || !isActivationKey(event)) return;\n event.preventDefault();\n toggle();\n }\n\n return (\n <div>\n <div\n role={canExpand ? \"button\" : undefined}\n tabIndex={canExpand ? 0 : undefined}\n className={cn(\n \"flex min-h-14 items-start gap-2 px-3 py-2 text-xs transition-colors\",\n canExpand && \"cursor-pointer hover:bg-muted/70\",\n )}\n onClick={canExpand ? toggle : undefined}\n onKeyDown={canExpand ? onKeyDown : undefined}\n >\n <span className=\"mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground\">\n <UiGitCommit className=\"h-3.5 w-3.5\" />\n </span>\n <div className=\"min-w-0 flex-1\">\n <div className=\"truncate font-medium text-foreground\" title={commit.title}>\n {commit.title}\n </div>\n <div className=\"mt-1 flex flex-wrap items-center gap-1.5 text-muted-foreground\">\n {commit.authorAvatarUrl && (\n <AvatarImage src={commit.authorAvatarUrl} alt={author || \"Commit author\"} />\n )}\n {author && <span>{author}</span>}\n {commit.committedAt && (\n <>\n <span aria-hidden>·</span>\n <span className=\"inline-flex items-center gap-1\">\n <UiClock className=\"h-3 w-3\" />\n {renderTime ? renderTime(commit.committedAt) : formatFallbackTime(commit.committedAt)}\n </span>\n </>\n )}\n {statText(commit.additions, commit.deletions)}\n {(commit.changedFiles ?? 0) > 0 && (\n <>\n <span aria-hidden>·</span>\n <span>{commit.changedFiles} files</span>\n </>\n )}\n </div>\n </div>\n {commit.href ? (\n <a\n href={commit.href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"mt-0.5 inline-flex shrink-0 items-center gap-1 font-mono text-cyan-600 hover:underline\"\n onClick={event => event.stopPropagation()}\n >\n {shortSha(commit)}\n <UiLinkExternal className=\"h-3 w-3\" />\n </a>\n ) : (\n <span className=\"mt-0.5 shrink-0 font-mono text-cyan-600\">{shortSha(commit)}</span>\n )}\n {canExpand && (\n <span className=\"mt-1 shrink-0\">\n <Chevron expanded={expanded} />\n </span>\n )}\n </div>\n {expanded && (\n <div className=\"border-t border-border bg-secondary/50\">\n {commit.body && (\n <pre className=\"mx-3 my-2 whitespace-pre-wrap rounded bg-muted px-3 py-2 font-mono text-[11px] leading-5 text-muted-foreground\">\n {commit.body}\n </pre>\n )}\n {loadDiff && (\n <GitDiffPanel\n loading={diffState.loading}\n payload={diffState.payload}\n error={diffState.error}\n {...(diffMaxHeightClassName ? { maxHeightClassName: diffMaxHeightClassName } : {})}\n />\n )}\n </div>\n )}\n </div>\n );\n}\n\nexport function GitCommitList({\n commits,\n loadDiff,\n renderTime,\n groupByDate = true,\n emptyLabel = \"No commits found\",\n className,\n diffMaxHeightClassName,\n}: GitCommitListProps) {\n const groups = useMemo(() => groupCommits(commits, groupByDate), [commits, groupByDate]);\n\n if (commits.length === 0) {\n return <div className={cn(\"py-4 text-xs text-muted-foreground\", className)}>{emptyLabel}</div>;\n }\n\n return (\n <div className={cn(\"overflow-hidden rounded-md border border-border\", className)}>\n {groups.map(group => (\n <section key={group.key} aria-label={group.label || \"Commits\"}>\n {group.label && (\n <div className=\"border-b border-border bg-muted/60 px-3 py-2 text-xs font-semibold text-foreground\">\n {group.label}\n </div>\n )}\n <div className=\"divide-y divide-border\">\n {group.commits.map(commit => (\n <CommitRow\n key={commit.id || commit.sha}\n commit={commit}\n {...(loadDiff ? { loadDiff } : {})}\n {...(renderTime ? { renderTime } : {})}\n {...(diffMaxHeightClassName ? { diffMaxHeightClassName } : {})}\n />\n ))}\n </div>\n </section>\n ))}\n </div>\n );\n}\n\ntype StatusView = {\n label: string;\n icon: IconComponent;\n iconClassName: string;\n};\n\nfunction normalizedStatus(status?: string): string {\n return (status || \"modified\").toLowerCase();\n}\n\nfunction statusView(status?: string): StatusView {\n switch (normalizedStatus(status)) {\n case \"added\":\n return { label: \"Added\", icon: UiFilePlus, iconClassName: \"text-emerald-600 dark:text-emerald-400\" };\n case \"deleted\":\n return { label: \"Deleted\", icon: UiRemove, iconClassName: \"text-rose-600 dark:text-rose-400\" };\n case \"renamed\":\n return { label: \"Renamed\", icon: UiFileCode, iconClassName: \"text-sky-600 dark:text-sky-400\" };\n case \"copied\":\n return { label: \"Copied\", icon: UiCode2, iconClassName: \"text-sky-600 dark:text-sky-400\" };\n default:\n return { label: \"Modified\", icon: UiFile, iconClassName: \"text-amber-600 dark:text-amber-400\" };\n }\n}\n\nfunction splitPath(path: string): { directory: string; basename: string } {\n const index = path.lastIndexOf(\"/\");\n if (index < 0) return { directory: \"\", basename: path };\n return { directory: `${path.slice(0, index)}/`, basename: path.slice(index + 1) };\n}\n\nfunction DiffBars({ additions = 0, deletions = 0 }: { additions?: number; deletions?: number }) {\n const total = additions + deletions;\n const maxBars = 5;\n const addBars = total > 0 ? Math.round((additions / total) * maxBars) : 0;\n const delBars = total > 0 ? maxBars - addBars : 0;\n return (\n <span className=\"inline-flex gap-px\" aria-hidden>\n {Array.from({ length: addBars }).map((_, index) => (\n <span key={`a${index}`} className=\"inline-block h-2 w-1.5 rounded-sm bg-emerald-500\" />\n ))}\n {Array.from({ length: delBars }).map((_, index) => (\n <span key={`d${index}`} className=\"inline-block h-2 w-1.5 rounded-sm bg-rose-500\" />\n ))}\n {total === 0 && <span className=\"inline-block h-2 w-1.5 rounded-sm bg-muted-foreground/30\" />}\n </span>\n );\n}\n\nfunction FileRow({\n file,\n loadDiff,\n diffMaxHeightClassName,\n}: {\n file: GitFileChangeItem;\n loadDiff?: GitDiffLoader<GitFileChangeItem>;\n diffMaxHeightClassName?: string;\n}) {\n const [expanded, diffState, toggle] = useLazyDiff(file, loadDiff);\n const status = statusView(file.status);\n const StatusIcon = status.icon;\n const path = splitPath(file.path);\n const canExpand = Boolean(loadDiff);\n\n function onKeyDown(event: KeyboardEvent<HTMLDivElement>) {\n if (!canExpand || !isActivationKey(event)) return;\n event.preventDefault();\n toggle();\n }\n\n return (\n <div>\n <div\n role={canExpand ? \"button\" : undefined}\n tabIndex={canExpand ? 0 : undefined}\n className={cn(\n \"flex min-h-11 items-center gap-2 px-3 py-2 text-xs transition-colors\",\n canExpand && \"cursor-pointer hover:bg-muted/70\",\n )}\n onClick={canExpand ? toggle : undefined}\n onKeyDown={canExpand ? onKeyDown : undefined}\n >\n <StatusIcon className={cn(\"h-4 w-4 shrink-0\", status.iconClassName)} />\n <div className=\"min-w-0 flex-1\">\n <div className=\"truncate font-mono text-foreground\" title={file.path}>\n {path.directory && <span className=\"text-muted-foreground\">{path.directory}</span>}\n <span>{path.basename}</span>\n </div>\n {file.previousPath && (\n <div className=\"mt-0.5 truncate font-mono text-[11px] text-muted-foreground\">\n from {file.previousPath}\n </div>\n )}\n </div>\n <span className=\"shrink-0 text-[11px] text-muted-foreground\">{status.label}</span>\n <span className=\"shrink-0 tabular-nums text-emerald-600 dark:text-emerald-400\">\n +{file.additions ?? 0}\n </span>\n <span className=\"shrink-0 tabular-nums text-rose-600 dark:text-rose-400\">\n -{file.deletions ?? 0}\n </span>\n <DiffBars\n {...(file.additions !== undefined ? { additions: file.additions } : {})}\n {...(file.deletions !== undefined ? { deletions: file.deletions } : {})}\n />\n {file.href && (\n <a\n href={file.href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"shrink-0 text-muted-foreground hover:text-foreground\"\n onClick={event => event.stopPropagation()}\n aria-label={`Open ${file.path}`}\n >\n <UiLinkExternal className=\"h-3.5 w-3.5\" />\n </a>\n )}\n {canExpand && (\n <span className=\"shrink-0\">\n <Chevron expanded={expanded} />\n </span>\n )}\n </div>\n {expanded && (\n <GitDiffPanel\n loading={diffState.loading}\n payload={diffState.payload}\n error={diffState.error}\n {...(diffMaxHeightClassName ? { maxHeightClassName: diffMaxHeightClassName } : {})}\n />\n )}\n </div>\n );\n}\n\nexport function GitFileList({\n files,\n loadDiff,\n emptyLabel = \"No changed files found\",\n className,\n diffMaxHeightClassName,\n}: GitFileListProps) {\n if (files.length === 0) {\n return <div className={cn(\"py-4 text-xs text-muted-foreground\", className)}>{emptyLabel}</div>;\n }\n\n return (\n <div className={cn(\"overflow-hidden rounded-md border border-border\", className)}>\n <div className=\"divide-y divide-border\">\n {files.map(file => (\n <FileRow\n key={file.id || file.path}\n file={file}\n {...(loadDiff ? { loadDiff } : {})}\n {...(diffMaxHeightClassName ? { diffMaxHeightClassName } : {})}\n />\n ))}\n </div>\n </div>\n );\n}\n\nexport function GitChangedFilesSummary({\n files,\n additions,\n deletions,\n className,\n}: {\n files: number;\n additions: number;\n deletions: number;\n className?: string;\n}) {\n return (\n <div className={cn(\"flex items-center gap-2 text-xs text-muted-foreground\", className)}>\n <span className=\"inline-flex items-center gap-1 font-medium\">\n <UiDiff className=\"h-3.5 w-3.5\" />\n {files} file{files === 1 ? \"\" : \"s\"} changed\n </span>\n <span aria-hidden>·</span>\n <span className=\"text-emerald-600 dark:text-emerald-400\">+{additions}</span>\n <span className=\"text-rose-600 dark:text-rose-400\">-{deletions}</span>\n </div>\n );\n}\n"],"names":["dateKey","formatGitCommitDateHeader","jsxs","Fragment","jsx","useState","UiChevronDown","UiChevronRight","cn","languageFromPath","CodeDiff","UiGitCommit","UiClock","formatFallbackTime","UiLinkExternal","useMemo","UiFilePlus","UiRemove","UiFileCode","UiCode2","UiFile","UiDiff"],"mappings":";;;;;;;;;;;;;;;;;;;AA4GA,MAAM,qBAAgC;AAAA,EACpC,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AACT;AAEA,SAAS,iBAAiB,OAAwB;AAChD,MAAI,iBAAiB,MAAO,QAAO,MAAM;AACzC,MAAI,OAAO,UAAU,SAAU,QAAO;AACtC,SAAO;AACT;AAEA,SAAS,gBAAgB,OAA+C;AACtE,SAAO,MAAM,QAAQ,WAAW,MAAM,QAAQ;AAChD;AAEA,SAAS,aAAa,SAA0B,SAAiC;;AAC/E,MAAI,CAAC,QAAS,QAAO,CAAC,EAAE,KAAK,OAAO,OAAO,IAAI,SAAS;AACxD,QAAM,SAAwB,CAAA;AAC9B,QAAM,iCAAiB,IAAA;AACvB,aAAW,UAAU,SAAS;AAC5B,UAAM,MAAMA,SAAAA,QAAQ,OAAO,WAAW;AACtC,UAAM,WAAW,WAAW,IAAI,GAAG;AACnC,QAAI,YAAY,MAAM;AACpB,mBAAO,QAAQ,MAAf,mBAAkB,QAAQ,KAAK;AAC/B;AAAA,IACF;AACA,eAAW,IAAI,KAAK,OAAO,MAAM;AACjC,WAAO,KAAK;AAAA,MACV;AAAA,MACA,OAAOC,SAAAA,0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IAAI,KAAK;AAAA,MAAI;AAAA,IAAA,GACtC;AAAA,IACAjB,2BAAAA,IAAC,QAAA,EAAK,eAAW,MAAC,UAAA,KAAC;AAAA,IACnBF,2BAAAA,KAAC,QAAA,EAAK,WAAU,0CAAyC,UAAA;AAAA,MAAA;AAAA,MAAE;AAAA,IAAA,GAAU;AAAA,IACrEA,2BAAAA,KAAC,QAAA,EAAK,WAAU,oCAAmC,UAAA;AAAA,MAAA;AAAA,MAAE;AAAA,IAAA,EAAA,CAAU;AAAA,EAAA,GACjE;AAEJ;;;;;"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { DiffLineTarget, DiffLineWidget } from '../CodeDiff.js';
|
|
2
3
|
export type GitDiffPayload = {
|
|
3
4
|
diff: string;
|
|
4
5
|
truncated?: boolean;
|
|
@@ -40,6 +41,10 @@ export type GitDiffPanelProps = {
|
|
|
40
41
|
emptyLabel?: string;
|
|
41
42
|
className?: string;
|
|
42
43
|
maxHeightClassName?: string;
|
|
44
|
+
/** Forwarded to `CodeDiff`: shows a gutter "+" button per numbered line. */
|
|
45
|
+
onLineAction?: (target: DiffLineTarget) => void;
|
|
46
|
+
/** Forwarded to `CodeDiff`: rows rendered under the matching diff line. */
|
|
47
|
+
lineWidgets?: DiffLineWidget[];
|
|
43
48
|
};
|
|
44
49
|
export type GitCommitListProps = {
|
|
45
50
|
commits: GitCommitItem[];
|
|
@@ -57,7 +62,7 @@ export type GitFileListProps = {
|
|
|
57
62
|
className?: string;
|
|
58
63
|
diffMaxHeightClassName?: string;
|
|
59
64
|
};
|
|
60
|
-
export declare function GitDiffPanel({ loading, payload, error, emptyLabel, className, maxHeightClassName, }: GitDiffPanelProps): import("react").JSX.Element;
|
|
65
|
+
export declare function GitDiffPanel({ loading, payload, error, emptyLabel, className, maxHeightClassName, onLineAction, lineWidgets, }: GitDiffPanelProps): import("react").JSX.Element;
|
|
61
66
|
export declare function GitCommitList({ commits, loadDiff, renderTime, groupByDate, emptyLabel, className, diffMaxHeightClassName, }: GitCommitListProps): import("react").JSX.Element;
|
|
62
67
|
export declare function GitFileList({ files, loadDiff, emptyLabel, className, diffMaxHeightClassName, }: GitFileListProps): import("react").JSX.Element;
|
|
63
68
|
export declare function GitChangedFilesSummary({ files, additions, deletions, className, }: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GitChangeList.d.ts","sourceRoot":"","sources":["../../../src/data/git/GitChangeList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAyC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"GitChangeList.d.ts","sourceRoot":"","sources":["../../../src/data/git/GitChangeList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAyC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAgB9E,OAAO,EAAY,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAIjF,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC;AAEpE,MAAM,MAAM,aAAa,GAAG;IAC1B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,W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W,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,iBAAiB,EAAE,CAAC;IAC3B,QAAQ,CAAC,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;IAC5C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC,CAAC;AAmGF,wBAAgB,YAAY,CAAC,EAC3B,OAAO,EACP,OAAO,EACP,KAAK,EACL,UAAqC,EACrC,SAAS,EACT,kBAAoC,EACpC,YAAY,EACZ,WAAW,GACZ,EAAE,iBAAiB,+BAmDnB;AA0GD,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,QAAQ,EACR,UAAU,EACV,WAAkB,EAClB,UAA+B,EAC/B,SAAS,EACT,sBAAsB,GACvB,EAAE,kBAAkB,+BA+BpB;AAyID,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,QAAQ,EACR,UAAqC,EACrC,SAAS,EACT,sBAAsB,GACvB,EAAE,gBAAgB,+BAmBlB;AAED,wBAAgB,sBAAsB,CAAC,EACrC,KAAK,EACL,SAAS,EACT,SAAS,EACT,SAAS,GACV,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,+BAYA"}
|
|
@@ -104,7 +104,9 @@ function GitDiffPanel({
|
|
|
104
104
|
error,
|
|
105
105
|
emptyLabel = "No text diff available",
|
|
106
106
|
className,
|
|
107
|
-
maxHeightClassName = "max-h-[520px]"
|
|
107
|
+
maxHeightClassName = "max-h-[520px]",
|
|
108
|
+
onLineAction,
|
|
109
|
+
lineWidgets
|
|
108
110
|
}) {
|
|
109
111
|
if (loading) {
|
|
110
112
|
return /* @__PURE__ */ jsx("div", { className: cn("border-t border-border bg-muted/40 px-3 py-3 text-xs text-muted-foreground", className), children: "Loading diff..." });
|
|
@@ -127,7 +129,9 @@ function GitDiffPanel({
|
|
|
127
129
|
bare: true,
|
|
128
130
|
unified: payload.diff,
|
|
129
131
|
className: cn("overflow-auto px-1 py-2", maxHeightClassName),
|
|
130
|
-
...language ? { language } : {}
|
|
132
|
+
...language ? { language } : {},
|
|
133
|
+
...onLineAction ? { onLineAction } : {},
|
|
134
|
+
...lineWidgets ? { lineWidgets } : {}
|
|
131
135
|
}
|
|
132
136
|
)
|
|
133
137
|
] });
|