@myrmidon/gve-snapshot-rendition 2.0.5 → 2.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapter/data-feature-adapter.d.ts +2 -3
- package/dist/animation/animation-engine.d.ts +0 -13
- package/dist/core/gve-snapshot-rendition.d.ts +72 -30
- package/dist/hint-designer/gve-hint-designer.d.ts +11 -1
- package/dist/index.cjs.min.js +7 -7
- package/dist/index.cjs.min.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +173 -81
- package/dist/index.js.map +1 -1
- package/dist/models.d.ts +21 -50
- package/dist/rendering/feature-resolver.d.ts +10 -10
- package/dist/rendering/hint-renderer.d.ts +9 -12
- package/dist/rendering/svg-utils.d.ts +38 -1
- package/dist/rendering/text-layout.d.ts +29 -4
- package/dist/rendering/text-renderer.d.ts +25 -14
- package/dist/settings/hint-models.d.ts +0 -5
- package/dist/settings/settings.d.ts +0 -4
- package/dist/ui/details-area.d.ts +31 -0
- package/dist/ui/hilites.d.ts +3 -9
- package/dist/ui/operation-summary-service.d.ts +4 -7
- package/dist/ui/toolbar.d.ts +10 -0
- package/dist/utils/feature-utils.d.ts +7 -3
- package/package.json +82 -73
- package/dist/rendering/spreading-engine.d.ts +0 -98
- package/dist/src/adapter/adapter-models.d.ts +0 -171
- package/dist/src/adapter/data-feature-adapter.d.ts +0 -30
- package/dist/src/adapter/feature-adapter.d.ts +0 -34
- package/dist/src/adapter/index.d.ts +0 -6
- package/dist/src/adapter/matcher.d.ts +0 -38
- package/dist/src/adapter/parser.d.ts +0 -58
- package/dist/src/adapter/tokenizer.d.ts +0 -55
- package/dist/src/animation/animation-engine.d.ts +0 -105
- package/dist/src/animation/animation-factory.d.ts +0 -49
- package/dist/src/core/color-palette.d.ts +0 -39
- package/dist/src/core/gve-snapshot-rendition.d.ts +0 -359
- package/dist/src/core/logger.d.ts +0 -37
- package/dist/src/hint-designer/gve-hint-designer.d.ts +0 -356
- package/dist/src/hint-designer/hint-designer-models.d.ts +0 -32
- package/dist/src/index.d.ts +0 -17
- package/dist/src/models.d.ts +0 -171
- package/dist/src/rendering/bounds-cache.d.ts +0 -62
- package/dist/src/rendering/feature-resolver.d.ts +0 -98
- package/dist/src/rendering/hint-renderer.d.ts +0 -103
- package/dist/src/rendering/svg-utils.d.ts +0 -133
- package/dist/src/rendering/text-layout.d.ts +0 -100
- package/dist/src/rendering/text-renderer.d.ts +0 -81
- package/dist/src/settings/hint-models.d.ts +0 -61
- package/dist/src/settings/settings.d.ts +0 -118
- package/dist/src/ui/details-area.d.ts +0 -112
- package/dist/src/ui/hilites.d.ts +0 -63
- package/dist/src/ui/operation-summary-service.d.ts +0 -73
- package/dist/src/ui/toolbar.d.ts +0 -141
- package/dist/src/ui/version-text-area.d.ts +0 -131
- package/dist/src/ui/versions-list-area.d.ts +0 -88
- package/dist/src/utils/color-palette.d.ts +0 -36
- package/dist/src/utils/feature-utils.d.ts +0 -80
- package/dist/src/utils/node-utils.d.ts +0 -47
- package/dist/src/utils/text-utils.d.ts +0 -35
- /package/dist/{src/layout → layout}/golden-layout-styles.d.ts +0 -0
package/dist/models.d.ts
CHANGED
|
@@ -91,78 +91,49 @@ export interface CharNode {
|
|
|
91
91
|
label: string;
|
|
92
92
|
data: string;
|
|
93
93
|
sourceTag?: string;
|
|
94
|
-
|
|
94
|
+
/** Features keyed by version tag (e.g. "v1" → feature list). */
|
|
95
|
+
features?: Record<string, Feature[]>;
|
|
95
96
|
}
|
|
96
97
|
/**
|
|
97
98
|
* Execution step of a char-based chain operation.
|
|
98
99
|
*/
|
|
99
100
|
export interface ChainOperationContextStep {
|
|
100
|
-
/**
|
|
101
|
-
* The operation that was executed.
|
|
102
|
-
*/
|
|
101
|
+
/** The operation that was executed. */
|
|
103
102
|
operation: CharChainOperation;
|
|
104
|
-
/**
|
|
105
|
-
* The input version tag.
|
|
106
|
-
*/
|
|
103
|
+
/** The input version tag. */
|
|
107
104
|
inputTag: string;
|
|
108
|
-
/**
|
|
109
|
-
* The output version tag.
|
|
110
|
-
*/
|
|
105
|
+
/** The output version tag. */
|
|
111
106
|
outputTag: string;
|
|
112
|
-
/**
|
|
113
|
-
* The string synthetically representing the resulting text
|
|
114
|
-
* version.
|
|
115
|
-
*/
|
|
107
|
+
/** The string synthetically representing the resulting text version. */
|
|
116
108
|
result?: string;
|
|
117
|
-
/**
|
|
118
|
-
* The features emitted up to the executed operation.
|
|
119
|
-
* These are the features of the text as a whole, and
|
|
120
|
-
* those belonging to specific nodes, each keyed under
|
|
121
|
-
* a string built with `v` + output version tag + `_`
|
|
122
|
-
* + node ID (e.g. `v1_2` for node with ID 2 at version 1).
|
|
123
|
-
*/
|
|
124
|
-
featureSet: {
|
|
125
|
-
features: OperationFeature[];
|
|
126
|
-
nodeFeatures: Record<string, OperationFeature[]>;
|
|
127
|
-
};
|
|
128
|
-
/**
|
|
129
|
-
* The reference node IDs of the operation which was
|
|
130
|
-
* executed.
|
|
131
|
-
*/
|
|
109
|
+
/** The reference node IDs of the operation which was executed. */
|
|
132
110
|
refNodeIds: number[];
|
|
133
111
|
}
|
|
134
112
|
/**
|
|
135
113
|
* Result of execution of a char-based chain.
|
|
136
114
|
*/
|
|
137
115
|
export interface CharChainResult {
|
|
138
|
-
/**
|
|
139
|
-
* The base text, as an array of character nodes or string.
|
|
140
|
-
* This is not returned by the API, but can be supplied
|
|
141
|
-
* by the caller.
|
|
142
|
-
*/
|
|
143
|
-
text?: CharNode[] | string;
|
|
144
|
-
/**
|
|
145
|
-
* The execution steps of the chain.
|
|
146
|
-
*/
|
|
116
|
+
/** The execution steps of the chain. */
|
|
147
117
|
steps: ChainOperationContextStep[];
|
|
118
|
+
/** The chain dump, which is the text representation of the chain. */
|
|
119
|
+
chainDump: string | null;
|
|
120
|
+
/** The list of all unique tags in the chain, including v0. */
|
|
121
|
+
chainTags: string[];
|
|
148
122
|
/**
|
|
149
|
-
*
|
|
123
|
+
* All character nodes in the chain (base text and added nodes).
|
|
124
|
+
* Node features are keyed by version tag.
|
|
150
125
|
*/
|
|
151
|
-
|
|
126
|
+
nodes: CharNode[];
|
|
152
127
|
/**
|
|
153
|
-
*
|
|
128
|
+
* IDs of nodes forming each version's text, keyed by version tag.
|
|
129
|
+
* Includes v0 (base text).
|
|
154
130
|
*/
|
|
155
|
-
|
|
131
|
+
versionNodeIds: Record<string, number[]>;
|
|
156
132
|
/**
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
* by the set of links of each version tag; so each of the
|
|
160
|
-
* sets contains only the nodes used at that step to build
|
|
161
|
-
* the text version, with their features up to that stage.
|
|
133
|
+
* Global features accumulated up to each version, keyed by version tag.
|
|
134
|
+
* Includes v0 (empty list).
|
|
162
135
|
*/
|
|
163
|
-
|
|
164
|
-
[key: string]: CharNode[];
|
|
165
|
-
};
|
|
136
|
+
globalFeatures: Record<string, OperationFeature[]>;
|
|
166
137
|
}
|
|
167
138
|
/**
|
|
168
139
|
* The input and output tags of a char-based chain operation.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Feature,
|
|
1
|
+
import { Feature, CharNode } from "../models";
|
|
2
2
|
import { GveRenditionSettings } from "../settings/settings";
|
|
3
3
|
import { Logger } from "../core/logger";
|
|
4
4
|
/**
|
|
@@ -11,7 +11,6 @@ export interface HintOverrides {
|
|
|
11
11
|
scaleX?: string;
|
|
12
12
|
scaleY?: string;
|
|
13
13
|
rotation?: string;
|
|
14
|
-
solid?: boolean;
|
|
15
14
|
displacedSpan?: {
|
|
16
15
|
nodeId: number;
|
|
17
16
|
count: number;
|
|
@@ -36,13 +35,13 @@ export interface RenditionConfig {
|
|
|
36
35
|
textPosition?: string;
|
|
37
36
|
textOffsetX: number | string;
|
|
38
37
|
textOffsetY: number | string;
|
|
39
|
-
textSolid?: boolean;
|
|
40
38
|
textDisplacedSpan?: {
|
|
41
39
|
nodeId: number;
|
|
42
40
|
count: number;
|
|
43
41
|
};
|
|
42
|
+
textValue?: string;
|
|
44
43
|
hints?: string[];
|
|
45
|
-
hintOverrides?: Map<string, HintOverrides>;
|
|
44
|
+
hintOverrides?: Map<string | number, HintOverrides>;
|
|
46
45
|
hintVars?: Map<string, string>;
|
|
47
46
|
}
|
|
48
47
|
/**
|
|
@@ -63,20 +62,19 @@ export declare class FeatureResolver {
|
|
|
63
62
|
* @returns Resolved rendition configuration
|
|
64
63
|
*/
|
|
65
64
|
resolve(baseSettings: GveRenditionSettings, features: Feature[] | undefined, nodeFeatureContext?: {
|
|
66
|
-
|
|
65
|
+
refNodes: CharNode[];
|
|
67
66
|
outputTag: string;
|
|
68
|
-
refNodeIds: number[];
|
|
69
67
|
}): RenditionConfig;
|
|
70
68
|
/**
|
|
71
69
|
* Extract character offsets from init features.
|
|
72
70
|
* This is used for base text layout adjustments.
|
|
73
71
|
*
|
|
74
72
|
* @param features - Features from the first annotate operation (init features)
|
|
75
|
-
* @returns Map of node IDs to their offsets
|
|
73
|
+
* @returns Map of node IDs to their offsets (values may be numbers or "Ntw"/"Nth" strings)
|
|
76
74
|
*/
|
|
77
75
|
extractCharOffsets(features: Feature[] | undefined): Map<number, {
|
|
78
|
-
x?: number;
|
|
79
|
-
y?: number;
|
|
76
|
+
x?: number | string;
|
|
77
|
+
y?: number | string;
|
|
80
78
|
}>;
|
|
81
79
|
/**
|
|
82
80
|
* Check if features contain a specific rendition feature.
|
|
@@ -88,7 +86,9 @@ export declare class FeatureResolver {
|
|
|
88
86
|
getRenditionFeatureValue(features: Feature[] | undefined, featureName: string): string | undefined;
|
|
89
87
|
/**
|
|
90
88
|
* Parse r_h-* hint override features.
|
|
91
|
-
* Format: "value" applies to all hints, or "@
|
|
89
|
+
* Format: "value" applies to all hints, or "@target1 target2:value" applies to specific hints.
|
|
90
|
+
* Targets can be hint ID strings or 1-based ordinal integers (e.g., "@1 beta:e" targets
|
|
91
|
+
* the first hint by position and all hints with key "beta"). Numbers and keys can be mixed.
|
|
92
92
|
*
|
|
93
93
|
* @param featureName - The feature name (e.g., "r_h-position")
|
|
94
94
|
* @param value - The feature value
|
|
@@ -4,7 +4,6 @@ import { OperationHint } from "../settings/hint-models";
|
|
|
4
4
|
import { Logger } from "../core/logger";
|
|
5
5
|
import { AnimationEngine } from "../animation/animation-engine";
|
|
6
6
|
import { BoundsCache } from "./bounds-cache";
|
|
7
|
-
import { SpreadingEngine } from "./spreading-engine";
|
|
8
7
|
import { HintOverrides } from "./feature-resolver";
|
|
9
8
|
/**
|
|
10
9
|
* Hint renderer handles rendering of operation hints.
|
|
@@ -15,8 +14,7 @@ export declare class HintRenderer {
|
|
|
15
14
|
private _logger;
|
|
16
15
|
private _animationEngine;
|
|
17
16
|
private _boundsCache;
|
|
18
|
-
|
|
19
|
-
constructor(settings: GveRenditionSettings, logger: Logger, animationEngine: AnimationEngine, boundsCache: BoundsCache, spreadingEngine: SpreadingEngine);
|
|
17
|
+
constructor(settings: GveRenditionSettings, logger: Logger, animationEngine: AnimationEngine, boundsCache: BoundsCache);
|
|
20
18
|
/**
|
|
21
19
|
* Render a hint for an operation.
|
|
22
20
|
*
|
|
@@ -35,10 +33,13 @@ export declare class HintRenderer {
|
|
|
35
33
|
* @param viewportHeight - Height of the visible viewport (for prolog)
|
|
36
34
|
* @returns Promise that resolves when rendering completes
|
|
37
35
|
*/
|
|
38
|
-
renderHint(hintId: string, hint: OperationHint, referenceNodes: CharNode[], rootSvg: SVGElement, variables: Map<string, string>, operationId: string, hintOrdinal: number, allBaseNodes: CharNode[], versionTag: string, hintOverrides?: Map<string, HintOverrides>, panZoomInstance?: any, viewportWidth?: number, viewportHeight?: number): Promise<void>;
|
|
36
|
+
renderHint(hintId: string, hint: OperationHint, referenceNodes: CharNode[], rootSvg: SVGElement, variables: Map<string, string>, operationId: string, hintOrdinal: number, allBaseNodes: CharNode[], versionTag: string, hintOverrides?: Map<string | number, HintOverrides>, panZoomInstance?: any, viewportWidth?: number, viewportHeight?: number): Promise<void>;
|
|
39
37
|
/**
|
|
40
38
|
* Calculate Reference Bounding Rectangles (RBRs) from reference nodes.
|
|
41
39
|
* Nodes on different lines create separate RBRs.
|
|
40
|
+
*
|
|
41
|
+
* @param rootSvg - Root SVG element, used to read each character's laid-out
|
|
42
|
+
* baseline `y` attribute for line-break detection (see below).
|
|
42
43
|
*/
|
|
43
44
|
private calculateRBRs;
|
|
44
45
|
/**
|
|
@@ -86,18 +87,14 @@ export declare class HintRenderer {
|
|
|
86
87
|
* This is the point on the EBR that should align with the RBR alignment point.
|
|
87
88
|
*/
|
|
88
89
|
private calculateEBRAlignmentPoint;
|
|
89
|
-
/**
|
|
90
|
-
* Handle spreading for solid hints.
|
|
91
|
-
* @param versionTag - Version tag for tracking spreading history
|
|
92
|
-
*/
|
|
93
|
-
private handleSpreading;
|
|
94
90
|
/**
|
|
95
91
|
* Apply r_h-* overrides to hint properties.
|
|
96
|
-
*
|
|
92
|
+
* Priority (lowest to highest): wildcard ("*") < key-based < ordinal-based.
|
|
97
93
|
*
|
|
98
94
|
* @param hint - Original hint design
|
|
99
|
-
* @param hintId - ID of the hint being rendered
|
|
100
|
-
* @param
|
|
95
|
+
* @param hintId - ID (key) of the hint being rendered
|
|
96
|
+
* @param hintOrdinal - 1-based ordinal position of this hint within the operation
|
|
97
|
+
* @param hintOverrides - Map of overrides from r_h-* features (keyed by ID string or ordinal number)
|
|
101
98
|
* @param allBaseNodes - All base nodes for displaced span resolution
|
|
102
99
|
* @returns Modified hint with overrides applied
|
|
103
100
|
*/
|
|
@@ -100,8 +100,45 @@ export declare function getRectCenter(rect: DOMRect | {
|
|
|
100
100
|
/**
|
|
101
101
|
* Get computed text width for a given text and style.
|
|
102
102
|
* Creates a temporary SVG element to measure.
|
|
103
|
+
*
|
|
104
|
+
* IMPORTANT: The measurementRoot parameter is critical for correct measurements
|
|
105
|
+
* when the component runs inside Angular or other frameworks that apply global
|
|
106
|
+
* CSS styles (like font-family) to document.body. Without it, measurements
|
|
107
|
+
* happen in document.body where inherited styles may affect font metrics,
|
|
108
|
+
* but actual rendering happens inside Shadow DOM where styles are isolated.
|
|
109
|
+
* This mismatch causes text positions and hint placements to be incorrect.
|
|
110
|
+
*
|
|
111
|
+
* When measurementRoot is provided (typically the component's root SVG element),
|
|
112
|
+
* measurements happen in the same CSS context as the actual rendering,
|
|
113
|
+
* ensuring consistent font metrics.
|
|
114
|
+
*
|
|
115
|
+
* @param text - The text to measure
|
|
116
|
+
* @param fontFamily - Font family to use
|
|
117
|
+
* @param fontSize - Font size in pixels
|
|
118
|
+
* @param bold - Whether text is bold
|
|
119
|
+
* @param italic - Whether text is italic
|
|
120
|
+
* @param measurementRoot - Optional SVG element to use as measurement context.
|
|
121
|
+
* If provided, a temporary text element is appended here
|
|
122
|
+
* for measurement (same CSS context as rendering).
|
|
123
|
+
* If not provided, falls back to document.body (legacy behavior).
|
|
124
|
+
*/
|
|
125
|
+
export declare function getTextWidth(text: string, fontFamily: string, fontSize: number, bold?: boolean, italic?: boolean, measurementRoot?: SVGElement): number;
|
|
126
|
+
/**
|
|
127
|
+
* Reference character used to compute the "average character width/height"
|
|
128
|
+
* that the "tw"/"th" offset units resolve against (see getAverageCharWidth).
|
|
129
|
+
* This is the same reference character used to size the space character.
|
|
130
|
+
*/
|
|
131
|
+
export declare const REFERENCE_CHAR = "m";
|
|
132
|
+
/**
|
|
133
|
+
* Get the average character width for the given font settings, using
|
|
134
|
+
* REFERENCE_CHAR ("m") as the reference glyph. This is the basis for the
|
|
135
|
+
* "tw" (text width) unit used by r_char-offsets, r_t-offset-x/y, and
|
|
136
|
+
* r_h-offset-x/y — NOT the bounding box of a whole reference text span.
|
|
137
|
+
*
|
|
138
|
+
* @param measurementRoot - Optional SVG element to use as measurement context
|
|
139
|
+
* (see getTextWidth for why this matters).
|
|
103
140
|
*/
|
|
104
|
-
export declare function
|
|
141
|
+
export declare function getAverageCharWidth(fontFamily: string, fontSize: number, bold?: boolean, italic?: boolean, measurementRoot?: SVGElement): number;
|
|
105
142
|
/**
|
|
106
143
|
* Move an element to the back (lowest z-index in SVG).
|
|
107
144
|
*/
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CharNode } from "../models";
|
|
2
2
|
import { GveRenditionSettings } from "../settings/settings";
|
|
3
3
|
import { Logger } from "../core/logger";
|
|
4
|
+
import { RenditionConfig } from "./feature-resolver";
|
|
4
5
|
/**
|
|
5
6
|
* Position information for a character node.
|
|
6
7
|
*/
|
|
@@ -19,7 +20,29 @@ export declare class TextLayout {
|
|
|
19
20
|
private _settings;
|
|
20
21
|
private _logger;
|
|
21
22
|
private _spaceWidth;
|
|
23
|
+
/**
|
|
24
|
+
* The SVG element used as the measurement context for text width calculations.
|
|
25
|
+
* This ensures measurements happen in the same CSS context as actual rendering,
|
|
26
|
+
* which is critical when the component runs inside frameworks like Angular
|
|
27
|
+
* that may apply global CSS styles affecting font metrics.
|
|
28
|
+
*
|
|
29
|
+
* When this is undefined, measurements fall back to document.body (legacy behavior)
|
|
30
|
+
* which can cause position mismatches if global styles differ from Shadow DOM styles.
|
|
31
|
+
*/
|
|
32
|
+
private _measurementRoot?;
|
|
22
33
|
constructor(settings: GveRenditionSettings, logger: Logger);
|
|
34
|
+
/**
|
|
35
|
+
* Set the measurement root for text width calculations.
|
|
36
|
+
* This should be called with the root SVG element after it's created,
|
|
37
|
+
* before any layout calculations are performed.
|
|
38
|
+
*
|
|
39
|
+
* IMPORTANT: This ensures text measurements happen in the same CSS context
|
|
40
|
+
* as actual rendering (inside Shadow DOM), avoiding position mismatches
|
|
41
|
+
* caused by different font metrics in document.body vs Shadow DOM.
|
|
42
|
+
*
|
|
43
|
+
* @param root - The SVG element to use as measurement context
|
|
44
|
+
*/
|
|
45
|
+
setMeasurementRoot(root: SVGElement): void;
|
|
23
46
|
/**
|
|
24
47
|
* Calculate the width of a space character based on reference character.
|
|
25
48
|
*/
|
|
@@ -28,13 +51,15 @@ export declare class TextLayout {
|
|
|
28
51
|
* Calculate positions for all base text nodes.
|
|
29
52
|
*
|
|
30
53
|
* @param nodes - The character nodes to position
|
|
31
|
-
* @param charOffsets - Map of node IDs to their offset overrides (from r_char-offsets feature)
|
|
54
|
+
* @param charOffsets - Map of node IDs to their offset overrides (from r_char-offsets feature).
|
|
55
|
+
* Offset values may be plain numbers (px) or strings with units "tw"/"th"
|
|
56
|
+
* (average character width / height of the current font).
|
|
32
57
|
* @returns Array of character positions
|
|
33
58
|
*/
|
|
34
59
|
calculateBaseTextPositions(nodes: CharNode[], charOffsets?: Map<number, {
|
|
35
|
-
x?: number;
|
|
36
|
-
y?: number;
|
|
37
|
-
}>): CharPosition[];
|
|
60
|
+
x?: number | string;
|
|
61
|
+
y?: number | string;
|
|
62
|
+
}>, nodeConfigs?: Map<number, RenditionConfig>): CharPosition[];
|
|
38
63
|
/**
|
|
39
64
|
* Calculate position for a single additional text node.
|
|
40
65
|
* Additional text positioning is driven by rendition features.
|
|
@@ -3,7 +3,6 @@ import { GveRenditionSettings } from "../settings/settings";
|
|
|
3
3
|
import { Logger } from "../core/logger";
|
|
4
4
|
import { AnimationEngine } from "../animation/animation-engine";
|
|
5
5
|
import { BoundsCache } from "./bounds-cache";
|
|
6
|
-
import { SpreadingEngine } from "./spreading-engine";
|
|
7
6
|
import { RenditionConfig } from "./feature-resolver";
|
|
8
7
|
/**
|
|
9
8
|
* Text renderer handles rendering of base text and additional text.
|
|
@@ -13,10 +12,15 @@ export declare class TextRenderer {
|
|
|
13
12
|
private _logger;
|
|
14
13
|
private _animationEngine;
|
|
15
14
|
private _boundsCache;
|
|
16
|
-
private _spreadingEngine;
|
|
17
15
|
private _textLayout;
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Reference to the root SVG element for text width measurements.
|
|
18
|
+
* This ensures measurements happen in the same CSS context as rendering,
|
|
19
|
+
* which is critical when running inside Angular or other frameworks
|
|
20
|
+
* that apply global CSS styles to document.body.
|
|
21
|
+
*/
|
|
22
|
+
private _measurementRoot?;
|
|
23
|
+
constructor(settings: GveRenditionSettings, logger: Logger, animationEngine: AnimationEngine, boundsCache: BoundsCache);
|
|
20
24
|
/**
|
|
21
25
|
* Render base text (v0).
|
|
22
26
|
*
|
|
@@ -26,9 +30,9 @@ export declare class TextRenderer {
|
|
|
26
30
|
* @returns Promise that resolves when rendering completes
|
|
27
31
|
*/
|
|
28
32
|
renderBaseText(nodes: CharNode[], rootSvg: SVGElement, charOffsets?: Map<number, {
|
|
29
|
-
x?: number;
|
|
30
|
-
y?: number;
|
|
31
|
-
}>): Promise<void>;
|
|
33
|
+
x?: number | string;
|
|
34
|
+
y?: number | string;
|
|
35
|
+
}>, nodeConfigs?: Map<number, RenditionConfig>): Promise<void>;
|
|
32
36
|
/**
|
|
33
37
|
* Render a single character node.
|
|
34
38
|
*/
|
|
@@ -51,21 +55,28 @@ export declare class TextRenderer {
|
|
|
51
55
|
/**
|
|
52
56
|
* Calculate positions for additional text characters.
|
|
53
57
|
* Additional text flows left to right from the base position.
|
|
58
|
+
* When config is provided its font metrics are used for character width
|
|
59
|
+
* measurement, matching what applyTextStyle will actually render.
|
|
54
60
|
*/
|
|
55
61
|
private calculateAdditionalTextPositions;
|
|
56
62
|
/**
|
|
57
|
-
* Calculate
|
|
58
|
-
*
|
|
63
|
+
* Calculate the RBR anchor point for a given position type.
|
|
64
|
+
* This is the point on the RBR where the corresponding EBR point will land.
|
|
59
65
|
*/
|
|
60
|
-
private
|
|
66
|
+
private calculateRBRAlignmentPoint;
|
|
61
67
|
/**
|
|
62
|
-
* Calculate
|
|
68
|
+
* Calculate the EBR anchor point for a given position type.
|
|
69
|
+
* This is the point on the EBR that should coincide with the RBR anchor point.
|
|
63
70
|
*/
|
|
64
|
-
private
|
|
71
|
+
private calculateEBRAlignmentPoint;
|
|
65
72
|
/**
|
|
66
|
-
* Calculate
|
|
73
|
+
* Calculate RBRs from reference nodes.
|
|
74
|
+
* Nodes on different lines create separate RBRs.
|
|
75
|
+
*
|
|
76
|
+
* @param rootSvg - Root SVG element, used to read each character's laid-out
|
|
77
|
+
* baseline `y` attribute for line-break detection (see below).
|
|
67
78
|
*/
|
|
68
|
-
private
|
|
79
|
+
private calculateRBRs;
|
|
69
80
|
/**
|
|
70
81
|
* Update settings.
|
|
71
82
|
*/
|
|
@@ -46,11 +46,6 @@ export interface OperationHint {
|
|
|
46
46
|
* Rotation is applied with reference to the origin of the reference bounding rectangle.
|
|
47
47
|
*/
|
|
48
48
|
rotation: number;
|
|
49
|
-
/**
|
|
50
|
-
* Whether this hint is "solid" and requires spreading.
|
|
51
|
-
* Default: false (most hints are overlays that don't need spreading)
|
|
52
|
-
*/
|
|
53
|
-
solid?: boolean;
|
|
54
49
|
/**
|
|
55
50
|
* JS code for animating the hint's entrance via GSAP.
|
|
56
51
|
* If it starts with "#", it references an animation from settings.animations.
|
|
@@ -78,8 +78,6 @@ export interface GveRenditionSettings {
|
|
|
78
78
|
animations: Record<string, string>;
|
|
79
79
|
/** ID of animation to use for each character (from animations catalog) */
|
|
80
80
|
charAnimationId?: string;
|
|
81
|
-
/** Duration in milliseconds for spreading animation (0=no animation) */
|
|
82
|
-
spreadTime: number;
|
|
83
81
|
/** Duration in milliseconds for element fade-out animation
|
|
84
82
|
* (backward navigation only): 0=no animation */
|
|
85
83
|
backwardFadeOutTime: number;
|
|
@@ -88,8 +86,6 @@ export interface GveRenditionSettings {
|
|
|
88
86
|
prologDuration: number;
|
|
89
87
|
/** Dictionary of hints, keyed by hint ID */
|
|
90
88
|
hints: Record<string, OperationHint>;
|
|
91
|
-
/** Margin around each rendered hint in pixels */
|
|
92
|
-
hintMargin: number;
|
|
93
89
|
/** Design-time width used when creating hints */
|
|
94
90
|
hintDesignWidth: number;
|
|
95
91
|
/** Design-time height used when creating hints */
|
|
@@ -11,6 +11,7 @@ export declare class DetailsArea {
|
|
|
11
11
|
private hoveredElementsSection;
|
|
12
12
|
private hiddenFeaturesCheckbox;
|
|
13
13
|
private collapseBtn;
|
|
14
|
+
private resizeHandle;
|
|
14
15
|
private _settings;
|
|
15
16
|
private _logger;
|
|
16
17
|
private _summaryService;
|
|
@@ -18,6 +19,11 @@ export declare class DetailsArea {
|
|
|
18
19
|
private _showHiddenFeatures;
|
|
19
20
|
private _data;
|
|
20
21
|
private _currentVersionTag;
|
|
22
|
+
private _isResizing;
|
|
23
|
+
private _initialHeight;
|
|
24
|
+
private _initialMouseY;
|
|
25
|
+
private _isPinned;
|
|
26
|
+
private _pinnedElements;
|
|
21
27
|
constructor(settings: GveRenditionSettings, logger: Logger);
|
|
22
28
|
create(): HTMLElement;
|
|
23
29
|
/**
|
|
@@ -28,6 +34,18 @@ export declare class DetailsArea {
|
|
|
28
34
|
* Attach event listeners.
|
|
29
35
|
*/
|
|
30
36
|
private attachEventListeners;
|
|
37
|
+
/**
|
|
38
|
+
* Start resizing the details area.
|
|
39
|
+
*/
|
|
40
|
+
private startResize;
|
|
41
|
+
/**
|
|
42
|
+
* Handle resize drag.
|
|
43
|
+
*/
|
|
44
|
+
private handleResize;
|
|
45
|
+
/**
|
|
46
|
+
* Stop resizing the details area.
|
|
47
|
+
*/
|
|
48
|
+
private stopResize;
|
|
31
49
|
/**
|
|
32
50
|
* Toggle collapse/expand state.
|
|
33
51
|
*/
|
|
@@ -53,7 +71,20 @@ export declare class DetailsArea {
|
|
|
53
71
|
updateHoveredElements(hoveredElements: Array<{
|
|
54
72
|
element: SVGTextElement;
|
|
55
73
|
node: CharNode;
|
|
74
|
+
versionTag: string;
|
|
56
75
|
}>): void;
|
|
76
|
+
/**
|
|
77
|
+
* Render hovered elements with pin button.
|
|
78
|
+
*/
|
|
79
|
+
private renderHoveredElements;
|
|
80
|
+
/**
|
|
81
|
+
* Toggle pin state.
|
|
82
|
+
*/
|
|
83
|
+
private togglePin;
|
|
84
|
+
/**
|
|
85
|
+
* Pin a specific element (triggered by click).
|
|
86
|
+
*/
|
|
87
|
+
pinElement(element: SVGTextElement, node: CharNode, versionTag: string): void;
|
|
57
88
|
/**
|
|
58
89
|
* Filter features based on hidden features setting.
|
|
59
90
|
*/
|
package/dist/ui/hilites.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Logger } from "../core/logger";
|
|
2
|
-
import { CharChainResult } from "../models";
|
|
3
2
|
/**
|
|
4
3
|
* Hilites manager - handles creating and animating hilite rectangles.
|
|
5
4
|
*/
|
|
@@ -21,20 +20,15 @@ export declare class Hilites {
|
|
|
21
20
|
updateSettings(hilitePadding: number, hiliteFadeTime: number): void;
|
|
22
21
|
/**
|
|
23
22
|
* Show hilites for a specific version.
|
|
24
|
-
* @param
|
|
25
|
-
* @param versionTag - Version tag
|
|
23
|
+
* @param nodeIds - IDs of nodes to hilite (from versionNodeIds[versionTag])
|
|
24
|
+
* @param versionTag - Version tag label (for logging)
|
|
26
25
|
* @param color - Hilite color
|
|
27
26
|
*/
|
|
28
|
-
showHilites(
|
|
27
|
+
showHilites(nodeIds: number[], versionTag: string, color: string): Promise<void>;
|
|
29
28
|
/**
|
|
30
29
|
* Clear all hilites.
|
|
31
30
|
*/
|
|
32
31
|
clearHilites(): Promise<void>;
|
|
33
|
-
/**
|
|
34
|
-
* Get node IDs for a specific version.
|
|
35
|
-
* For v0, if not found in taggedNodes, falls back to extracting from base text.
|
|
36
|
-
*/
|
|
37
|
-
private getVersionNodeIds;
|
|
38
32
|
/**
|
|
39
33
|
* Create a hilite rectangle for a text element.
|
|
40
34
|
*
|
|
@@ -32,17 +32,14 @@ export declare class OperationSummaryService {
|
|
|
32
32
|
*/
|
|
33
33
|
getNodeText(nodeId: number, versionTag: string): string;
|
|
34
34
|
/**
|
|
35
|
-
* Get a node by ID
|
|
36
|
-
*
|
|
37
|
-
* Searches backwards from the specified version to v0. Since v0 is normalized
|
|
38
|
-
* and added to taggedNodes by the component during data processing, no special
|
|
39
|
-
* handling is needed.
|
|
35
|
+
* Get a node by ID from the flat nodes array.
|
|
36
|
+
* All nodes (including deleted ones) are always present.
|
|
40
37
|
*
|
|
41
38
|
* @param nodeId - Node ID
|
|
42
|
-
* @param versionTag -
|
|
39
|
+
* @param versionTag - Unused in new model; kept for API compatibility
|
|
43
40
|
* @returns The node, or null
|
|
44
41
|
*/
|
|
45
|
-
getNode(nodeId: number, versionTag
|
|
42
|
+
getNode(nodeId: number, versionTag?: string): CharNode | null;
|
|
46
43
|
/**
|
|
47
44
|
* Get text from a span of nodes.
|
|
48
45
|
* @param nodeIds - Array of node IDs
|
package/dist/ui/toolbar.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export declare class Toolbar {
|
|
|
13
13
|
private lastBtn;
|
|
14
14
|
private versionLabel;
|
|
15
15
|
private groupBadge;
|
|
16
|
+
private logDisplay;
|
|
16
17
|
private slideshowStartBtn;
|
|
17
18
|
private slideshowStopBtn;
|
|
18
19
|
private slideshowReverseBtn;
|
|
@@ -21,6 +22,7 @@ export declare class Toolbar {
|
|
|
21
22
|
private zoomOutBtn;
|
|
22
23
|
private fitBtn;
|
|
23
24
|
private downloadBtn;
|
|
25
|
+
private resetLayoutBtn;
|
|
24
26
|
private _data;
|
|
25
27
|
private _currentVersionIndex;
|
|
26
28
|
private _customButtons;
|
|
@@ -56,6 +58,10 @@ export declare class Toolbar {
|
|
|
56
58
|
* Update version label with current version information.
|
|
57
59
|
*/
|
|
58
60
|
private updateVersionLabel;
|
|
61
|
+
/**
|
|
62
|
+
* Update the log display with the current operation's log feature.
|
|
63
|
+
*/
|
|
64
|
+
private updateLogDisplay;
|
|
59
65
|
/**
|
|
60
66
|
* Get version information for current step.
|
|
61
67
|
*/
|
|
@@ -96,6 +102,10 @@ export declare class Toolbar {
|
|
|
96
102
|
* Dispatch display event for parent component to handle.
|
|
97
103
|
*/
|
|
98
104
|
private dispatchDisplayEvent;
|
|
105
|
+
/**
|
|
106
|
+
* Dispatch layout event for parent component to handle.
|
|
107
|
+
*/
|
|
108
|
+
private dispatchLayoutEvent;
|
|
99
109
|
/**
|
|
100
110
|
* Update data reference (for staged version detection).
|
|
101
111
|
*/
|
|
@@ -43,12 +43,16 @@ export declare function filterRenditionFeatures(features: Feature[] | undefined,
|
|
|
43
43
|
* Parse char-offsets feature value.
|
|
44
44
|
* Format: "ID:y=...,x=... ID:y=...,x=..." (multiple patterns separated by space)
|
|
45
45
|
* Each pattern: ID:y=value,x=value (y and x are optional, can be in any order)
|
|
46
|
+
* Values can be plain pixels (e.g. "10") or use font-relative units:
|
|
47
|
+
* tw = average character width of the base text font
|
|
48
|
+
* th = average character height of the base text font (≈ font size)
|
|
49
|
+
* e.g. "0.5th" = half the average character height, "2tw" = twice the average width.
|
|
46
50
|
*
|
|
47
|
-
* @returns Map of node ID to {x?: number, y?: number}
|
|
51
|
+
* @returns Map of node ID to {x?: number|string, y?: number|string}
|
|
48
52
|
*/
|
|
49
53
|
export declare function parseCharOffsets(value: string): Map<number, {
|
|
50
|
-
x?: number;
|
|
51
|
-
y?: number;
|
|
54
|
+
x?: number | string;
|
|
55
|
+
y?: number | string;
|
|
52
56
|
}>;
|
|
53
57
|
/**
|
|
54
58
|
* Parse displaced span reference.
|