@myrmidon/gve-snapshot-rendition 2.0.9 → 2.0.11

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.
@@ -31,9 +31,12 @@ export declare class HintRenderer {
31
31
  * @param panZoomInstance - The svg-pan-zoom instance (for prolog)
32
32
  * @param viewportWidth - Width of the visible viewport (for prolog)
33
33
  * @param viewportHeight - Height of the visible viewport (for prolog)
34
+ * @param instant - When true (compressed time mode), skip the entrance
35
+ * animation and any prolog panning animation, applying final state
36
+ * immediately instead.
34
37
  * @returns Promise that resolves when rendering completes
35
38
  */
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
+ 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, instant?: boolean): Promise<void>;
37
40
  /**
38
41
  * Calculate Reference Bounding Rectangles (RBRs) from reference nodes.
39
42
  * Nodes on different lines create separate RBRs.
@@ -38,7 +38,8 @@ export declare function applyTextStyle(element: SVGTextElement, style: {
38
38
  underline?: number;
39
39
  overline?: number;
40
40
  strike?: number;
41
- rotate?: number;
41
+ textLineStyle?: string;
42
+ textLineColor?: string;
42
43
  }): void;
43
44
  /**
44
45
  * Apply line decoration to text (for custom thickness support).
@@ -85,6 +86,22 @@ export declare function applyTransform(element: SVGElement, transform: {
85
86
  originX?: number;
86
87
  originY?: number;
87
88
  }): void;
89
+ /**
90
+ * Compute the axis-aligned bounding box of a rectangle rotated around a
91
+ * point, using SVG rotation direction (positive = clockwise, y-axis down).
92
+ *
93
+ * Used to cache correct bounds for per-character rotated text: getBBox()
94
+ * returns LOCAL coordinates which ignore the rotate(deg, x, y) transform
95
+ * applied to the element, while getTransformedBBox() would also bake in
96
+ * ancestor transforms (e.g. the pan/zoom viewport), which must stay out
97
+ * of the bounds cache.
98
+ */
99
+ export declare function rotateRectAroundPoint(rect: {
100
+ x: number;
101
+ y: number;
102
+ width: number;
103
+ height: number;
104
+ }, degrees: number, cx: number, cy: number): DOMRect;
88
105
  /**
89
106
  * Calculate the center point of a bounding rectangle.
90
107
  */
@@ -49,9 +49,12 @@ export declare class TextRenderer {
49
49
  * @param panZoomInstance - The svg-pan-zoom instance (for prolog)
50
50
  * @param viewportWidth - Width of the visible viewport (for prolog)
51
51
  * @param viewportHeight - Height of the visible viewport (for prolog)
52
+ * @param instant - When true (compressed time mode), skip the per-character
53
+ * entrance animation and any prolog panning animation, applying final
54
+ * state immediately instead.
52
55
  * @returns Promise that resolves when rendering completes
53
56
  */
54
- renderAdditionalText(nodes: CharNode[], rootSvg: SVGElement, config: RenditionConfig, versionTag: string, referenceNodes: CharNode[], allBaseNodes: CharNode[], panZoomInstance?: any, viewportWidth?: number, viewportHeight?: number): Promise<void>;
57
+ renderAdditionalText(nodes: CharNode[], rootSvg: SVGElement, config: RenditionConfig, versionTag: string, referenceNodes: CharNode[], allBaseNodes: CharNode[], panZoomInstance?: any, viewportWidth?: number, viewportHeight?: number, instant?: boolean): Promise<void>;
55
58
  /**
56
59
  * Calculate positions for additional text characters.
57
60
  * Additional text flows left to right from the base position.
@@ -36,6 +36,10 @@ export interface GveRenditionSettings {
36
36
  overline?: number;
37
37
  /** Default strikethrough thickness in pixels (undefined = no strike) */
38
38
  strike?: number;
39
+ /** Default decoration line style: solid, dotted, dashed, wavy (undefined = solid) */
40
+ textLineStyle?: string;
41
+ /** Default decoration line color (undefined = same as text color) */
42
+ textLineColor?: string;
39
43
  /** Fraction of reference character width to use for space width (default: 0.33) */
40
44
  spaceWidthFraction: number;
41
45
  /** Spacing between each character in pixels */
@@ -18,6 +18,7 @@ export declare class Toolbar {
18
18
  private slideshowStopBtn;
19
19
  private slideshowReverseBtn;
20
20
  private autoForwardBtn;
21
+ private compressedTimeBtn;
21
22
  private zoomInBtn;
22
23
  private zoomOutBtn;
23
24
  private fitBtn;
@@ -29,6 +30,7 @@ export declare class Toolbar {
29
30
  private _disabledButtonIds;
30
31
  private _slideshowReverse;
31
32
  private _autoForwardEnabled;
33
+ private _compressedTimeModeEnabled;
32
34
  /**
33
35
  * Get slideshow reverse state.
34
36
  */
@@ -82,6 +84,10 @@ export declare class Toolbar {
82
84
  * Update auto-forward button visual state.
83
85
  */
84
86
  private updateAutoForwardButton;
87
+ /**
88
+ * Update compressed time mode button visual state.
89
+ */
90
+ private updateCompressedTimeButton;
85
91
  /**
86
92
  * Apply disabled state to buttons from settings.
87
93
  */
@@ -98,6 +104,10 @@ export declare class Toolbar {
98
104
  * Dispatch auto-forward event for parent component to handle.
99
105
  */
100
106
  private dispatchAutoForwardEvent;
107
+ /**
108
+ * Dispatch compressed time event for parent component to handle.
109
+ */
110
+ private dispatchCompressedTimeEvent;
101
111
  /**
102
112
  * Dispatch display event for parent component to handle.
103
113
  */
@@ -138,4 +148,8 @@ export declare class Toolbar {
138
148
  * Set auto-forward enabled state and update button appearance.
139
149
  */
140
150
  setAutoForwardEnabled(enabled: boolean): void;
151
+ /**
152
+ * Set compressed time mode enabled state and update button appearance.
153
+ */
154
+ setCompressedTimeModeEnabled(enabled: boolean): void;
141
155
  }
@@ -18,7 +18,11 @@ export declare function escapeHtml(text: string): string;
18
18
  export declare function parseOffset(value: number | string, textHeight: number, textWidth: number): number;
19
19
  /**
20
20
  * Replace placeholders in SVG content.
21
- * Placeholders are in the format {{featureName}}.
21
+ * Placeholders are in the format {{featureName}}, or a fallback chain
22
+ * {{name ?? other ?? ...}}: names are tried left to right and the first one
23
+ * having a variable wins. There is no limit to the number of fallbacks.
24
+ * For instance {{r_fore-color ?? r_color}} resolves to the value of
25
+ * r_fore-color when defined, otherwise to the value of r_color.
22
26
  *
23
27
  * @param svgContent - The SVG content with placeholders
24
28
  * @param variables - Map of variable names to values
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myrmidon/gve-snapshot-rendition",
3
- "version": "2.0.9",
3
+ "version": "2.0.11",
4
4
  "homepage": "https://github.com/vedph/gve-snapshot-rendition",
5
5
  "repository": {
6
6
  "type": "git",