@ttsc/graph 0.30.4 → 0.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +122 -30
- package/lib/CapturedProcessOutput.d.ts +47 -0
- package/lib/CapturedProcessOutput.js +3 -0
- package/lib/CapturedProcessOutput.js.map +1 -0
- package/lib/ILauncherOption.d.ts +22 -0
- package/lib/ILauncherOption.js +3 -0
- package/lib/ILauncherOption.js.map +1 -0
- package/lib/IProjectOptions.d.ts +18 -0
- package/lib/IProjectOptions.js +3 -0
- package/lib/IProjectOptions.js.map +1 -0
- package/lib/ParsedLauncherOptions.d.ts +13 -0
- package/lib/ParsedLauncherOptions.js +3 -0
- package/lib/ParsedLauncherOptions.js.map +1 -0
- package/lib/TtscGraphApplication.d.ts +38 -1
- package/lib/TtscGraphApplication.js +26 -1
- package/lib/TtscGraphApplication.js.map +1 -1
- package/lib/TtscGraphLauncherArguments.d.ts +115 -0
- package/lib/TtscGraphLauncherArguments.js +181 -0
- package/lib/TtscGraphLauncherArguments.js.map +1 -0
- package/lib/TtscGraphViewSnapshot.d.ts +35 -0
- package/lib/TtscGraphViewSnapshot.js +48 -0
- package/lib/TtscGraphViewSnapshot.js.map +1 -0
- package/lib/index.d.ts +9 -24
- package/lib/index.js +6 -128
- package/lib/index.js.map +1 -1
- package/lib/internal/GraphProcessTrace.d.ts +1 -0
- package/lib/internal/GraphProcessTrace.js +235 -0
- package/lib/internal/GraphProcessTrace.js.map +1 -0
- package/lib/launcherArgs.d.ts +75 -16
- package/lib/launcherArgs.js +77 -8
- package/lib/launcherArgs.js.map +1 -1
- package/lib/model/IArtifactDirectory.d.ts +26 -0
- package/lib/model/IArtifactDirectory.js +3 -0
- package/lib/model/IArtifactDirectory.js.map +1 -0
- package/lib/model/IArtifactInputs.d.ts +19 -0
- package/lib/model/IArtifactInputs.js +3 -0
- package/lib/model/IArtifactInputs.js.map +1 -0
- package/lib/model/IPublishedArtifacts.d.ts +76 -0
- package/lib/model/IPublishedArtifacts.js +3 -0
- package/lib/model/IPublishedArtifacts.js.map +1 -0
- package/lib/model/IPublishedArtifactsResident.d.ts +19 -0
- package/lib/model/IPublishedArtifactsResident.js +3 -0
- package/lib/model/IPublishedArtifactsResident.js.map +1 -0
- package/lib/model/ITtscLintDaemonTarget.d.ts +20 -0
- package/lib/model/ITtscLintDaemonTarget.js +3 -0
- package/lib/model/ITtscLintDaemonTarget.js.map +1 -0
- package/lib/model/TtscGraphLinePeer.d.ts +146 -0
- package/lib/model/TtscGraphLinePeer.js +213 -0
- package/lib/model/TtscGraphLinePeer.js.map +1 -0
- package/lib/model/TtscGraphMemory.d.ts +156 -16
- package/lib/model/TtscGraphMemory.js +228 -222
- package/lib/model/TtscGraphMemory.js.map +1 -1
- package/lib/model/TtscGraphNativeArguments.d.ts +40 -0
- package/lib/model/TtscGraphNativeArguments.js +64 -0
- package/lib/model/TtscGraphNativeArguments.js.map +1 -0
- package/lib/model/TtscGraphNodeId.d.ts +55 -3
- package/lib/model/TtscGraphNodeId.js +40 -2
- package/lib/model/TtscGraphNodeId.js.map +1 -1
- package/lib/model/TtscGraphProjection.d.ts +156 -0
- package/lib/model/TtscGraphProjection.js +390 -0
- package/lib/model/TtscGraphProjection.js.map +1 -0
- package/lib/model/TtscGraphProtocol.d.ts +28 -0
- package/lib/model/TtscGraphProtocol.js +928 -0
- package/lib/model/TtscGraphProtocol.js.map +1 -0
- package/lib/model/TtscGraphReadonly.d.ts +15 -0
- package/lib/model/TtscGraphReadonly.js +3 -0
- package/lib/model/TtscGraphReadonly.js.map +1 -0
- package/lib/model/TtscGraphRequestOptions.d.ts +16 -0
- package/lib/model/TtscGraphRequestOptions.js +3 -0
- package/lib/model/TtscGraphRequestOptions.js.map +1 -0
- package/lib/model/TtscGraphSession.d.ts +82 -36
- package/lib/model/TtscGraphSession.js +164 -1238
- package/lib/model/TtscGraphSession.js.map +1 -1
- package/lib/model/TtscGraphSessionOptions.d.ts +20 -0
- package/lib/model/TtscGraphSessionOptions.js +3 -0
- package/lib/model/TtscGraphSessionOptions.js.map +1 -0
- package/lib/model/TtscGraphSessionState.d.ts +187 -0
- package/lib/model/TtscGraphSessionState.js +417 -0
- package/lib/model/TtscGraphSessionState.js.map +1 -0
- package/lib/model/TtscGraphShardStore.d.ts +64 -3
- package/lib/model/TtscGraphShardStore.js +85 -15
- package/lib/model/TtscGraphShardStore.js.map +1 -1
- package/lib/model/TtscGraphSourceReader.d.ts +31 -8
- package/lib/model/TtscGraphSourceReader.js +37 -13
- package/lib/model/TtscGraphSourceReader.js.map +1 -1
- package/lib/model/TtscLintDaemon.d.ts +35 -17
- package/lib/model/TtscLintDaemon.js +39 -117
- package/lib/model/TtscLintDaemon.js.map +1 -1
- package/lib/model/TtscLintDaemonState.d.ts +69 -0
- package/lib/model/TtscLintDaemonState.js +166 -0
- package/lib/model/TtscLintDaemonState.js.map +1 -0
- package/lib/model/copyGraphRecords.d.ts +14 -0
- package/lib/model/copyGraphRecords.js +19 -0
- package/lib/model/copyGraphRecords.js.map +1 -0
- package/lib/model/copyGraphSnapshot.d.ts +17 -0
- package/lib/model/copyGraphSnapshot.js +33 -0
- package/lib/model/copyGraphSnapshot.js.map +1 -0
- package/lib/model/loadGraph.d.ts +19 -10
- package/lib/model/loadGraph.js +21 -12
- package/lib/model/loadGraph.js.map +1 -1
- package/lib/model/publishedArtifacts.d.ts +78 -97
- package/lib/model/publishedArtifacts.js +271 -85
- package/lib/model/publishedArtifacts.js.map +1 -1
- package/lib/nativeExecutable.d.ts +19 -8
- package/lib/nativeExecutable.js +75 -15
- package/lib/nativeExecutable.js.map +1 -1
- package/lib/reduce.d.ts +19 -45
- package/lib/reduce.js +19 -3
- package/lib/reduce.js.map +1 -1
- package/lib/resolveGraphBinary.d.ts +9 -0
- package/lib/resolveGraphBinary.js +11 -3
- package/lib/resolveGraphBinary.js.map +1 -1
- package/lib/runGraph.d.ts +21 -0
- package/lib/runGraph.js +83 -0
- package/lib/runGraph.js.map +1 -0
- package/lib/server/IResolvedGraphHandle.d.ts +22 -0
- package/lib/server/IResolvedGraphHandle.js +3 -0
- package/lib/server/IResolvedGraphHandle.js.map +1 -0
- package/lib/server/createServer.d.ts +14 -10
- package/lib/server/createServer.js +42 -39
- package/lib/server/createServer.js.map +1 -1
- package/lib/server/exportSurface.d.ts +23 -1
- package/lib/server/exportSurface.js +23 -1
- package/lib/server/exportSurface.js.map +1 -1
- package/lib/server/formatGraphFailure.d.ts +20 -0
- package/lib/server/formatGraphFailure.js +35 -0
- package/lib/server/formatGraphFailure.js.map +1 -0
- package/lib/server/pathPolicy.d.ts +70 -5
- package/lib/server/pathPolicy.js +66 -4
- package/lib/server/pathPolicy.js.map +1 -1
- package/lib/server/resolveHandle.d.ts +10 -5
- package/lib/server/resolveHandle.js +39 -7
- package/lib/server/resolveHandle.js.map +1 -1
- package/lib/server/resultAudit.d.ts +17 -14
- package/lib/server/resultAudit.js +56 -27
- package/lib/server/resultAudit.js.map +1 -1
- package/lib/server/resultNext.d.ts +26 -1
- package/lib/server/resultNext.js +14 -0
- package/lib/server/resultNext.js.map +1 -1
- package/lib/server/runDetails.d.ts +72 -15
- package/lib/server/runDetails.js +104 -69
- package/lib/server/runDetails.js.map +1 -1
- package/lib/server/runEntrypoints.d.ts +9 -0
- package/lib/server/runEntrypoints.js +9 -0
- package/lib/server/runEntrypoints.js.map +1 -1
- package/lib/server/runLookup.d.ts +13 -3
- package/lib/server/runLookup.js +19 -6
- package/lib/server/runLookup.js.map +1 -1
- package/lib/server/runOverview.d.ts +13 -4
- package/lib/server/runOverview.js +13 -4
- package/lib/server/runOverview.js.map +1 -1
- package/lib/server/runTour.d.ts +9 -0
- package/lib/server/runTour.js +33 -65
- package/lib/server/runTour.js.map +1 -1
- package/lib/server/runTrace.d.ts +25 -1
- package/lib/server/runTrace.js +133 -88
- package/lib/server/runTrace.js.map +1 -1
- package/lib/server/startServer.d.ts +16 -0
- package/lib/server/startServer.js +24 -1
- package/lib/server/startServer.js.map +1 -1
- package/lib/structures/ITtscGraphApplication.d.ts +95 -41
- package/lib/structures/ITtscGraphDecorator.d.ts +18 -0
- package/lib/structures/ITtscGraphDetails.d.ts +81 -6
- package/lib/structures/ITtscGraphDocTag.d.ts +17 -8
- package/lib/structures/ITtscGraphDump.d.ts +106 -8
- package/lib/structures/ITtscGraphEdge.d.ts +14 -2
- package/lib/structures/ITtscGraphEntrypoints.d.ts +81 -6
- package/lib/structures/ITtscGraphEscape.d.ts +24 -2
- package/lib/structures/ITtscGraphEvidence.d.ts +9 -0
- package/lib/structures/ITtscGraphLookup.d.ts +42 -9
- package/lib/structures/ITtscGraphNext.d.ts +12 -1
- package/lib/structures/ITtscGraphNode.d.ts +38 -11
- package/lib/structures/ITtscGraphOverview.d.ts +81 -6
- package/lib/structures/ITtscGraphSnapshot.d.ts +97 -2
- package/lib/structures/ITtscGraphSpan.d.ts +9 -0
- package/lib/structures/ITtscGraphTour.d.ts +83 -9
- package/lib/structures/ITtscGraphTrace.d.ts +99 -14
- package/lib/structures/RawDump.d.ts +22 -0
- package/lib/structures/RawDump.js +3 -0
- package/lib/structures/RawDump.js.map +1 -0
- package/lib/structures/RawEdge.d.ts +20 -0
- package/lib/structures/RawEdge.js +3 -0
- package/lib/structures/RawEdge.js.map +1 -0
- package/lib/structures/RawNode.d.ts +26 -0
- package/lib/structures/RawNode.js +3 -0
- package/lib/structures/RawNode.js.map +1 -0
- package/lib/structures/TtscGraphArtifactNodeKind.d.ts +9 -0
- package/lib/structures/TtscGraphArtifactNodeKind.js +9 -0
- package/lib/structures/TtscGraphArtifactNodeKind.js.map +1 -1
- package/lib/structures/TtscGraphDumpEdgeKind.d.ts +15 -1
- package/lib/structures/TtscGraphDumpNodeKind.d.ts +9 -0
- package/lib/structures/TtscGraphEdgeKind.d.ts +13 -4
- package/lib/structures/TtscGraphNodeKind.d.ts +9 -0
- package/lib/structures/TtscGraphNodeModifier.d.ts +9 -0
- package/lib/structures/ViewerLink.d.ts +20 -0
- package/lib/structures/ViewerLink.js +3 -0
- package/lib/structures/ViewerLink.js.map +1 -0
- package/lib/structures/ViewerNode.d.ts +24 -0
- package/lib/structures/ViewerNode.js +3 -0
- package/lib/structures/ViewerNode.js.map +1 -0
- package/lib/structures/ViewerPayload.d.ts +42 -0
- package/lib/structures/ViewerPayload.js +3 -0
- package/lib/structures/ViewerPayload.js.map +1 -0
- package/lib/view.d.ts +9 -0
- package/lib/view.js +203 -91
- package/lib/view.js.map +1 -1
- package/lib/viewer/viewer.js +1 -1
- package/package.json +8 -6
- package/src/CapturedProcessOutput.ts +50 -0
- package/src/ILauncherOption.ts +24 -0
- package/src/IProjectOptions.ts +19 -0
- package/src/ParsedLauncherOptions.ts +13 -0
- package/src/TtscGraphApplication.ts +38 -1
- package/src/TtscGraphLauncherArguments.ts +207 -0
- package/src/TtscGraphViewSnapshot.ts +46 -0
- package/src/index.ts +9 -160
- package/src/internal/GraphProcessTrace.ts +242 -0
- package/src/launcherArgs.ts +89 -23
- package/src/model/IArtifactDirectory.ts +27 -0
- package/src/model/IArtifactInputs.ts +21 -0
- package/src/model/IPublishedArtifacts.ts +81 -0
- package/src/model/IPublishedArtifactsResident.ts +24 -0
- package/src/model/ITtscLintDaemonTarget.ts +22 -0
- package/src/model/TtscGraphLinePeer.ts +318 -0
- package/src/model/TtscGraphMemory.ts +284 -246
- package/src/model/TtscGraphNativeArguments.ts +67 -0
- package/src/model/TtscGraphNodeId.ts +57 -3
- package/src/model/TtscGraphProjection.ts +473 -0
- package/src/model/TtscGraphProtocol.ts +90 -0
- package/src/model/TtscGraphReadonly.ts +17 -0
- package/src/model/TtscGraphRequestOptions.ts +16 -0
- package/src/model/TtscGraphSession.ts +196 -475
- package/src/model/TtscGraphSessionOptions.ts +22 -0
- package/src/model/TtscGraphSessionState.ts +558 -0
- package/src/model/TtscGraphShardStore.ts +99 -23
- package/src/model/TtscGraphSourceReader.ts +37 -15
- package/src/model/TtscLintDaemon.ts +55 -136
- package/src/model/TtscLintDaemonState.ts +174 -0
- package/src/model/copyGraphRecords.ts +17 -0
- package/src/model/copyGraphSnapshot.ts +30 -0
- package/src/model/loadGraph.ts +23 -12
- package/src/model/publishedArtifacts.ts +361 -182
- package/src/nativeExecutable.ts +93 -26
- package/src/reduce.ts +24 -51
- package/src/resolveGraphBinary.ts +13 -3
- package/src/runGraph.ts +90 -0
- package/src/server/IResolvedGraphHandle.ts +24 -0
- package/src/server/createServer.ts +16 -22
- package/src/server/exportSurface.ts +23 -1
- package/src/server/formatGraphFailure.ts +32 -0
- package/src/server/pathPolicy.ts +70 -5
- package/src/server/resolveHandle.ts +45 -14
- package/src/server/resultAudit.ts +58 -27
- package/src/server/resultNext.ts +26 -1
- package/src/server/runDetails.ts +138 -73
- package/src/server/runEntrypoints.ts +13 -1
- package/src/server/runLookup.ts +23 -7
- package/src/server/runOverview.ts +17 -5
- package/src/server/runTour.ts +44 -82
- package/src/server/runTrace.ts +175 -102
- package/src/server/startServer.ts +29 -1
- package/src/structures/ITtscGraphApplication.ts +95 -41
- package/src/structures/ITtscGraphDecorator.ts +18 -0
- package/src/structures/ITtscGraphDetails.ts +81 -6
- package/src/structures/ITtscGraphDocTag.ts +17 -8
- package/src/structures/ITtscGraphDump.ts +106 -8
- package/src/structures/ITtscGraphEdge.ts +14 -2
- package/src/structures/ITtscGraphEntrypoints.ts +81 -6
- package/src/structures/ITtscGraphEscape.ts +24 -2
- package/src/structures/ITtscGraphEvidence.ts +9 -0
- package/src/structures/ITtscGraphLookup.ts +42 -9
- package/src/structures/ITtscGraphNext.ts +12 -1
- package/src/structures/ITtscGraphNode.ts +38 -11
- package/src/structures/ITtscGraphOverview.ts +88 -6
- package/src/structures/ITtscGraphSnapshot.ts +117 -2
- package/src/structures/ITtscGraphSpan.ts +9 -0
- package/src/structures/ITtscGraphTour.ts +83 -9
- package/src/structures/ITtscGraphTrace.ts +100 -14
- package/src/structures/RawDump.ts +25 -0
- package/src/structures/RawEdge.ts +22 -0
- package/src/structures/RawNode.ts +31 -0
- package/src/structures/TtscGraphArtifactNodeKind.ts +9 -0
- package/src/structures/TtscGraphDumpEdgeKind.ts +15 -1
- package/src/structures/TtscGraphDumpNodeKind.ts +9 -0
- package/src/structures/TtscGraphEdgeKind.ts +13 -4
- package/src/structures/TtscGraphNodeKind.ts +9 -0
- package/src/structures/TtscGraphNodeModifier.ts +9 -0
- package/src/structures/ViewerLink.ts +22 -0
- package/src/structures/ViewerNode.ts +28 -0
- package/src/structures/ViewerPayload.ts +52 -0
- package/src/view.ts +208 -110
- package/src/viewer/legend.ts +119 -27
package/src/viewer/legend.ts
CHANGED
|
@@ -7,20 +7,97 @@
|
|
|
7
7
|
// new family shipped into the graph with no entry beside it until someone opened
|
|
8
8
|
// both files.
|
|
9
9
|
|
|
10
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* Structural DOM capabilities needed to construct the viewer legend.
|
|
12
|
+
*
|
|
13
|
+
* @evidence contracts/common.md#principled-implementation Text-compatible append/prepend and style/class fields match the browser element operations used by legend construction.
|
|
14
|
+
* @evidence contracts/common.md#clear-and-simple-design The boundary exposes only required DOM capabilities, keeping legend construction independent of renderer startup.
|
|
15
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Browser elements are supplied structurally without patching DOM globals or adding test-dependent rendering logic.
|
|
16
|
+
* @evidence contracts/common.md#meaningful-documentation Native members identify class/style mutation and node insertion semantics rather than framing production behavior as a test utility.
|
|
17
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources signature only: the implementer owns any handle or retained state.
|
|
18
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms signature only: the implementer owns the algorithm and its cost.
|
|
19
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work signature only: the implementer decides what work is shared.
|
|
20
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation signature only: the implementer owns any path or process work.
|
|
21
|
+
*/
|
|
11
22
|
export interface LegendElement {
|
|
23
|
+
/** CSS class assignment for generated swatches and their containers. */
|
|
12
24
|
className: string;
|
|
25
|
+
|
|
26
|
+
/** Background color property used by a legend swatch. */
|
|
13
27
|
style: { background: string };
|
|
28
|
+
|
|
14
29
|
// `unknown[]`, because the real `Document` types these as `(Node | string)[]`
|
|
15
30
|
// and a narrower parameter is not assignable to it. `src/viewer` is excluded
|
|
16
31
|
// from the declaration build, so nothing would have reported that.
|
|
32
|
+
/**
|
|
33
|
+
* Append DOM nodes or strings in argument order after current children.
|
|
34
|
+
*
|
|
35
|
+
* @evidence contracts/common.md#principled-implementation The structural signature admits browser node/string arguments without inventing a different insertion protocol.
|
|
36
|
+
* @evidence contracts/common.md#clear-and-simple-design One required insertion capability supplies swatch content without a larger element wrapper.
|
|
37
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Implementations use the host's normal append operation rather than monkey-patching document behavior.
|
|
38
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose states insertion order and accepted browser content categories.
|
|
39
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources signature only: the implementer owns any handle or retained state.
|
|
40
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms signature only: the implementer owns the algorithm and its cost.
|
|
41
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work signature only: the implementer decides what work is shared.
|
|
42
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation signature only: the implementer owns any path or process work.
|
|
43
|
+
*/
|
|
17
44
|
append(...nodes: unknown[]): void;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Insert DOM nodes or strings before current children, preserving argument
|
|
48
|
+
* order.
|
|
49
|
+
*
|
|
50
|
+
* @evidence contracts/common.md#principled-implementation Prepending generated legend entries retains the existing footer note after those entries.
|
|
51
|
+
* @evidence contracts/common.md#clear-and-simple-design The host owns child insertion; legend construction does not rebuild the footer.
|
|
52
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Existing markup is preserved instead of replaced with fixture-specific HTML.
|
|
53
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose explains ordering relative to existing children.
|
|
54
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources signature only: the implementer owns any handle or retained state.
|
|
55
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms signature only: the implementer owns the algorithm and its cost.
|
|
56
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work signature only: the implementer decides what work is shared.
|
|
57
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation signature only: the implementer owns any path or process work.
|
|
58
|
+
*/
|
|
18
59
|
prepend(...nodes: unknown[]): void;
|
|
19
60
|
}
|
|
20
61
|
|
|
21
|
-
/**
|
|
62
|
+
/**
|
|
63
|
+
* Document lookup and creation capabilities used by legend construction.
|
|
64
|
+
*
|
|
65
|
+
* @evidence contracts/common.md#principled-implementation Nullable id lookup and element creation represent the browser document operations the legend needs.
|
|
66
|
+
* @evidence contracts/common.md#clear-and-simple-design Two capabilities avoid coupling the legend to the full browser document or 3D scene.
|
|
67
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The host is injected through the supported structural boundary without mutating document globals.
|
|
68
|
+
* @evidence contracts/common.md#meaningful-documentation Native method comments explain lookup absence and returned element ownership.
|
|
69
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources signature only: the implementer owns any handle or retained state.
|
|
70
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms signature only: the implementer owns the algorithm and its cost.
|
|
71
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work signature only: the implementer decides what work is shared.
|
|
72
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation signature only: the implementer owns any path or process work.
|
|
73
|
+
*/
|
|
22
74
|
export interface LegendDocument {
|
|
75
|
+
/**
|
|
76
|
+
* Find an existing element by id, returning null when it is absent.
|
|
77
|
+
*
|
|
78
|
+
* @evidence contracts/common.md#principled-implementation Nullable lookup preserves the distinction between a missing footer and an empty existing footer.
|
|
79
|
+
* @evidence contracts/common.md#clear-and-simple-design One host lookup avoids global document access inside the renderer-independent legend.
|
|
80
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Missing markup is not fabricated by replacing document APIs.
|
|
81
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose specifies id lookup and null absence.
|
|
82
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources signature only: the implementer owns any handle or retained state.
|
|
83
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms signature only: the implementer owns the algorithm and its cost.
|
|
84
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work signature only: the implementer decides what work is shared.
|
|
85
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation signature only: the implementer owns any path or process work.
|
|
86
|
+
*/
|
|
23
87
|
getElementById(id: string): LegendElement | null;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Create an unattached element for the supplied browser tag name.
|
|
91
|
+
*
|
|
92
|
+
* @evidence contracts/common.md#principled-implementation The host creates ordinary elements subsequently attached through its native insertion capabilities.
|
|
93
|
+
* @evidence contracts/common.md#clear-and-simple-design Creation is separate from placement so one host can serve all generated swatches.
|
|
94
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The contract does not substitute serialized fixture markup for actual element construction.
|
|
95
|
+
* @evidence contracts/common.md#meaningful-documentation Native prose states the tag input and unattached ownership boundary.
|
|
96
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources signature only: the implementer owns any handle or retained state.
|
|
97
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms signature only: the implementer owns the algorithm and its cost.
|
|
98
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work signature only: the implementer decides what work is shared.
|
|
99
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation signature only: the implementer owns any path or process work.
|
|
100
|
+
*/
|
|
24
101
|
createElement(tag: string): LegendElement;
|
|
25
102
|
}
|
|
26
103
|
|
|
@@ -31,24 +108,27 @@ export interface LegendDocument {
|
|
|
31
108
|
* missing, and because the fallback below was the same string as `variable`, a
|
|
32
109
|
* module was not merely unnamed — it was drawn as a variable.
|
|
33
110
|
*/
|
|
34
|
-
export const NODE_COLORS: Record<string, string> =
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
111
|
+
export const NODE_COLORS: Record<string, string> = Object.assign(
|
|
112
|
+
Object.create(null),
|
|
113
|
+
{
|
|
114
|
+
// The artifacts. They are one hue family on purpose: a reader tells a document
|
|
115
|
+
// from a declaration at a glance, and tells the artifacts apart within it.
|
|
116
|
+
markdown_document: "#e8b4b8",
|
|
117
|
+
markdown_section: "#d99ba0",
|
|
118
|
+
prisma_model: "#b8a3e8",
|
|
119
|
+
prisma_column: "#a08fd0",
|
|
120
|
+
prisma_relation: "#8a76c0",
|
|
121
|
+
swagger_operation: "#e8d9a0",
|
|
122
|
+
module: "#d0d7de",
|
|
123
|
+
class: "#36e2ee",
|
|
124
|
+
interface: "#6ea8ff",
|
|
125
|
+
function: "#3fb950",
|
|
126
|
+
method: "#2bb673",
|
|
127
|
+
type: "#f5b042",
|
|
128
|
+
enum: "#c792ea",
|
|
129
|
+
variable: "#8b97a8",
|
|
130
|
+
},
|
|
131
|
+
);
|
|
52
132
|
|
|
53
133
|
/**
|
|
54
134
|
* Edge colour per display family.
|
|
@@ -58,13 +138,16 @@ export const NODE_COLORS: Record<string, string> = {
|
|
|
58
138
|
* rather than a use, and it is opaque so it stays apart from the translucent
|
|
59
139
|
* fallback.
|
|
60
140
|
*/
|
|
61
|
-
export const LINK_COLORS: Record<string, string> =
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
141
|
+
export const LINK_COLORS: Record<string, string> = Object.assign(
|
|
142
|
+
Object.create(null),
|
|
143
|
+
{
|
|
144
|
+
"value-call": "#3fb950",
|
|
145
|
+
"type-ref": "#f5b042",
|
|
146
|
+
"doc-ref": "#c07de0",
|
|
147
|
+
heritage: "#6ea8ff",
|
|
148
|
+
exports: "#7d8590",
|
|
149
|
+
},
|
|
150
|
+
);
|
|
68
151
|
|
|
69
152
|
/**
|
|
70
153
|
* What an unrecognized node kind is drawn in.
|
|
@@ -88,6 +171,15 @@ const rendered = new WeakSet<LegendElement>();
|
|
|
88
171
|
* markup keeps — the order the hand-written markup had. The website viewer has
|
|
89
172
|
* always derived its legend this way
|
|
90
173
|
* (`website/src/components/graph/TtscWebsiteGraphViewer3D.tsx`).
|
|
174
|
+
*
|
|
175
|
+
* @evidence contracts/common.md#principled-implementation The shared link-color map supplies every generated family name and swatch, and a WeakSet prevents duplicate insertion into the same footer.
|
|
176
|
+
* @evidence contracts/common.md#clear-and-simple-design This DOM-only module is separate from fetch/3D startup; element construction and insertion stay with the injected document boundary.
|
|
177
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Legend names and colors derive from the rendering vocabulary rather than repeated fixture-specific markup.
|
|
178
|
+
* @evidence contracts/common.md#meaningful-documentation Native paragraphs explain map ownership and insertion before the static note, with typed host capabilities documented separately.
|
|
179
|
+
* @evidenceExclude contracts/performance.md#bound-retention-and-release-resources the WeakSet holds the footer element weakly and the function opens no handle.
|
|
180
|
+
* @evidenceExclude contracts/performance.md#efficient-algorithms one map over the five link colors.
|
|
181
|
+
* @evidenceExclude contracts/performance.md#reuse-equivalent-work a WeakSet guard skips a legend that is already rendered, which is the only work it shares.
|
|
182
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation builds DOM nodes through the supplied document; no file, path or process.
|
|
91
183
|
*/
|
|
92
184
|
export function renderLegend(host: LegendDocument): void {
|
|
93
185
|
const legend = host.getElementById("legend");
|