@myrmidon/gve-snapshot-rendition 0.0.1

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.
Files changed (42) hide show
  1. package/LICENSE +4 -0
  2. package/README.md +135 -0
  3. package/dist/adapter/adapter-models.d.ts +171 -0
  4. package/dist/adapter/data-feature-adapter.d.ts +31 -0
  5. package/dist/adapter/feature-adapter.d.ts +34 -0
  6. package/dist/adapter/index.d.ts +6 -0
  7. package/dist/adapter/matcher.d.ts +38 -0
  8. package/dist/adapter/parser.d.ts +58 -0
  9. package/dist/adapter/tokenizer.d.ts +55 -0
  10. package/dist/animation/animation-engine.d.ts +118 -0
  11. package/dist/animation/animation-factory.d.ts +49 -0
  12. package/dist/core/color-palette.d.ts +39 -0
  13. package/dist/core/gve-snapshot-rendition.d.ts +318 -0
  14. package/dist/core/logger.d.ts +37 -0
  15. package/dist/hint-designer/gve-hint-designer.d.ts +298 -0
  16. package/dist/hint-designer/hint-designer-models.d.ts +32 -0
  17. package/dist/index.cjs.min.js +348 -0
  18. package/dist/index.cjs.min.js.map +1 -0
  19. package/dist/index.d.ts +16 -0
  20. package/dist/index.js +83396 -0
  21. package/dist/index.js.map +1 -0
  22. package/dist/models.d.ts +200 -0
  23. package/dist/rendering/bounds-cache.d.ts +62 -0
  24. package/dist/rendering/feature-resolver.d.ts +98 -0
  25. package/dist/rendering/hint-renderer.d.ts +109 -0
  26. package/dist/rendering/spreading-engine.d.ts +98 -0
  27. package/dist/rendering/svg-utils.d.ts +112 -0
  28. package/dist/rendering/text-layout.d.ts +75 -0
  29. package/dist/rendering/text-renderer.d.ts +73 -0
  30. package/dist/settings/hint-models.d.ts +66 -0
  31. package/dist/settings/settings.d.ts +122 -0
  32. package/dist/ui/details-area.d.ts +81 -0
  33. package/dist/ui/hilites.d.ts +69 -0
  34. package/dist/ui/operation-summary-service.d.ts +76 -0
  35. package/dist/ui/toolbar.d.ts +131 -0
  36. package/dist/ui/version-text-area.d.ts +131 -0
  37. package/dist/ui/versions-list-area.d.ts +88 -0
  38. package/dist/utils/color-palette.d.ts +36 -0
  39. package/dist/utils/feature-utils.d.ts +76 -0
  40. package/dist/utils/node-utils.d.ts +47 -0
  41. package/dist/utils/text-utils.d.ts +35 -0
  42. package/package.json +79 -0
@@ -0,0 +1,75 @@
1
+ import { CharNode } from "../models";
2
+ import { GveRenditionSettings } from "../settings/settings";
3
+ import { Logger } from "../core/logger";
4
+ /**
5
+ * Position information for a character node.
6
+ */
7
+ export interface CharPosition {
8
+ x: number;
9
+ y: number;
10
+ nodeId: number;
11
+ lineNumber: number;
12
+ }
13
+ /**
14
+ * Text layout calculator.
15
+ * Handles positioning of base text characters, respecting line breaks,
16
+ * spaces, and character offsets.
17
+ */
18
+ export declare class TextLayout {
19
+ private _settings;
20
+ private _logger;
21
+ private _spaceWidth;
22
+ constructor(settings: GveRenditionSettings, logger: Logger);
23
+ /**
24
+ * Calculate the width of a space character based on reference character.
25
+ */
26
+ private calculateSpaceWidth;
27
+ /**
28
+ * Calculate positions for all base text nodes.
29
+ *
30
+ * @param nodes - The character nodes to position
31
+ * @param charOffsets - Map of node IDs to their offset overrides (from r_char-offsets feature)
32
+ * @returns Array of character positions
33
+ */
34
+ calculateBaseTextPositions(nodes: CharNode[], charOffsets?: Map<number, {
35
+ x?: number;
36
+ y?: number;
37
+ }>): CharPosition[];
38
+ /**
39
+ * Calculate position for a single additional text node.
40
+ * Additional text positioning is driven by rendition features.
41
+ *
42
+ * @param referencePosition - The position to use as reference (e.g., from RBR)
43
+ * @param position - Position type (n, ne, e, se, s, sw, w, nw, o)
44
+ * @param offsetX - X offset (can be number or string like "0.5th")
45
+ * @param offsetY - Y offset (can be number or string like "0.5tw")
46
+ * @param refBounds - Reference bounding rectangle dimensions
47
+ * @returns Calculated position
48
+ */
49
+ calculateAdditionalTextPosition(referencePosition: {
50
+ x: number;
51
+ y: number;
52
+ }, position: string, offsetX: number, offsetY: number, refBounds: {
53
+ width: number;
54
+ height: number;
55
+ }): {
56
+ x: number;
57
+ y: number;
58
+ };
59
+ /**
60
+ * Get the line number for a given node ID from positions.
61
+ */
62
+ getLineNumber(positions: CharPosition[], nodeId: number): number;
63
+ /**
64
+ * Get all positions for a specific line.
65
+ */
66
+ getLinePositions(positions: CharPosition[], lineNumber: number): CharPosition[];
67
+ /**
68
+ * Update settings and recalculate space width.
69
+ */
70
+ updateSettings(settings: GveRenditionSettings): void;
71
+ /**
72
+ * Get the computed space width.
73
+ */
74
+ getSpaceWidth(): number;
75
+ }
@@ -0,0 +1,73 @@
1
+ import { CharNode } from "../models";
2
+ import { GveRenditionSettings } from "../settings/settings";
3
+ import { Logger } from "../core/logger";
4
+ import { AnimationEngine } from "../animation/animation-engine";
5
+ import { BoundsCache } from "./bounds-cache";
6
+ import { SpreadingEngine } from "./spreading-engine";
7
+ import { RenditionConfig } from "./feature-resolver";
8
+ /**
9
+ * Text renderer handles rendering of base text and additional text.
10
+ */
11
+ export declare class TextRenderer {
12
+ private _settings;
13
+ private _logger;
14
+ private _animationEngine;
15
+ private _boundsCache;
16
+ private _spreadingEngine;
17
+ private _textLayout;
18
+ private _featureResolver;
19
+ constructor(settings: GveRenditionSettings, logger: Logger, animationEngine: AnimationEngine, boundsCache: BoundsCache, spreadingEngine: SpreadingEngine);
20
+ /**
21
+ * Render base text (v0).
22
+ *
23
+ * @param nodes - Character nodes to render
24
+ * @param rootSvg - Root SVG element
25
+ * @param charOffsets - Optional character offset overrides
26
+ * @returns Promise that resolves when rendering completes
27
+ */
28
+ renderBaseText(nodes: CharNode[], rootSvg: SVGElement, charOffsets?: Map<number, {
29
+ x?: number;
30
+ y?: number;
31
+ }>): Promise<void>;
32
+ /**
33
+ * Render a single character node.
34
+ */
35
+ private renderCharacter;
36
+ /**
37
+ * Render additional text added by operations.
38
+ *
39
+ * @param nodes - Nodes to render
40
+ * @param rootSvg - Root SVG element
41
+ * @param config - Rendition configuration
42
+ * @param versionTag - Version tag for class
43
+ * @param referenceNodes - Reference nodes for RBR calculation
44
+ * @param allBaseNodes - All base text nodes (for displaced span)
45
+ * @param panZoomInstance - The svg-pan-zoom instance (for prolog)
46
+ * @param viewportWidth - Width of the visible viewport (for prolog)
47
+ * @param viewportHeight - Height of the visible viewport (for prolog)
48
+ * @returns Promise that resolves when rendering completes
49
+ */
50
+ renderAdditionalText(nodes: CharNode[], rootSvg: SVGElement, config: RenditionConfig, versionTag: string, referenceNodes: CharNode[], allBaseNodes: CharNode[], panZoomInstance?: any, viewportWidth?: number, viewportHeight?: number): Promise<void>;
51
+ /**
52
+ * Calculate positions for additional text characters.
53
+ * Additional text flows left to right from the base position.
54
+ */
55
+ private calculateAdditionalTextPositions;
56
+ /**
57
+ * Calculate RBRs from reference nodes.
58
+ * Nodes on different lines create separate RBRs.
59
+ */
60
+ private calculateRBRs;
61
+ /**
62
+ * Calculate target position on the RBR based on position type.
63
+ */
64
+ private calculateTargetPosition;
65
+ /**
66
+ * Calculate bounding rectangle for a set of positioned characters.
67
+ */
68
+ private calculateTextBounds;
69
+ /**
70
+ * Update settings.
71
+ */
72
+ updateSettings(settings: GveRenditionSettings): void;
73
+ }
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Models for operation hints.
3
+ */
4
+ import { RelativePosition } from "../core/gve-snapshot-rendition";
5
+ /**
6
+ * An editing operation's hint.
7
+ * Hints represent the visual counterpart of an operation.
8
+ */
9
+ export interface OperationHint {
10
+ /**
11
+ * SVG code for hint's visuals.
12
+ * Always has a root `g` element.
13
+ * May contain placeholders in {{name}} format.
14
+ */
15
+ svg: string;
16
+ /**
17
+ * Relative position for the hint with respect to the reference bounding rectangle.
18
+ */
19
+ position: RelativePosition;
20
+ /**
21
+ * X offset from the computed position.
22
+ * Can be:
23
+ * - A number (pixels)
24
+ * - A string with suffix: "0.5th" (half text height), "0.5tw" (half text width)
25
+ */
26
+ offsetX: number | string;
27
+ /**
28
+ * Y offset from the computed position.
29
+ * Can be:
30
+ * - A number (pixels)
31
+ * - A string with suffix: "0.5th" (half text height), "0.5tw" (half text width)
32
+ */
33
+ offsetY: number | string;
34
+ /**
35
+ * Horizontal scale: 1 = match bounds width, 1.1 = 110% of bounds width.
36
+ * Default: 1
37
+ */
38
+ scaleX: number;
39
+ /**
40
+ * Vertical scale: 1 = match bounds height, 1.1 = 110% of bounds height.
41
+ * Default: 1
42
+ */
43
+ scaleY: number;
44
+ /**
45
+ * Rotation in degrees. 0 = no rotation.
46
+ * Rotation is applied with reference to the origin of the reference bounding rectangle.
47
+ */
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
+ /**
55
+ * JS code for animating the hint's entrance via GSAP.
56
+ * If it starts with "#", it references an animation from settings.animations.
57
+ * The code receives parameters: (gsap, hintEl, rootEl)
58
+ */
59
+ animation?: string;
60
+ /**
61
+ * A span of base text with format IDxN where ID=node ID and N=count of chars,
62
+ * to be used as the RBR instead of the default RBR.
63
+ * Used for displaced hints.
64
+ */
65
+ displacedRefSpan?: string;
66
+ }
@@ -0,0 +1,122 @@
1
+ import { OperationHint } from "./hint-models";
2
+ /**
3
+ * Settings for a custom button added to the toolbar.
4
+ */
5
+ export interface CustomButtonSettings {
6
+ /** Unique ID for the custom button */
7
+ id: string;
8
+ /** Icon to use for the button (can be emoji, Unicode symbol, or HTML) */
9
+ icon: string;
10
+ /** Text label for the button */
11
+ label: string;
12
+ /** Tooltip shown on hover */
13
+ tooltip: string;
14
+ /** Callback invoked when button is pressed */
15
+ callback: (id: string, svg: SVGElement) => void;
16
+ }
17
+ /**
18
+ * Settings for the GVE Snapshot Rendition component.
19
+ */
20
+ export interface GveRenditionSettings {
21
+ /** Default font size in pixels */
22
+ fontSize: number;
23
+ /** Default font family */
24
+ fontFamily: string;
25
+ /** Default foreground color */
26
+ foreColor: string;
27
+ /** Default background color */
28
+ backColor: string;
29
+ /** Default italic state */
30
+ italic: boolean;
31
+ /** Default bold state */
32
+ bold: boolean;
33
+ /** Default underline thickness in pixels (undefined = no underline) */
34
+ underline?: number;
35
+ /** Default overline thickness in pixels (undefined = no overline) */
36
+ overline?: number;
37
+ /** Default strikethrough thickness in pixels (undefined = no strike) */
38
+ strike?: number;
39
+ /** Fraction of reference character width to use for space width (default: 0.33) */
40
+ spaceWidthFraction: number;
41
+ /** Spacing between each character in pixels */
42
+ charSpacing: number;
43
+ /** Line height multiplier (1.5 = 150% of font size) */
44
+ lineHeight: number;
45
+ /** Additional spacing between lines in pixels */
46
+ lineSpacing: number;
47
+ /** Top margin of the text rendition area in pixels */
48
+ marginTop: number;
49
+ /** Left margin of the text rendition area in pixels */
50
+ marginLeft: number;
51
+ /** Right margin of the text rendition area in pixels */
52
+ marginRight: number;
53
+ /** Bottom margin of the text rendition area in pixels */
54
+ marginBottom: number;
55
+ /** Initial zoom factor */
56
+ initialZoom: number;
57
+ /** Minimum zoom factor */
58
+ minZoom: number;
59
+ /** Maximum zoom factor */
60
+ maxZoom: number;
61
+ /** Zoom step for zoom in/out */
62
+ zoomStep: number;
63
+ /** Milliseconds between each frame in slideshow mode */
64
+ slideshowInterval: number;
65
+ /** Whether to loop the slideshow when it ends */
66
+ slideshowLoop: boolean;
67
+ /** Milliseconds delay between slideshow restarts (when looping) */
68
+ slideshowDelay: number;
69
+ /** Automatically continue forward through operations with the same groupId */
70
+ autoForwardOnGroup: boolean;
71
+ /** Enable detailed logging for diagnostic purposes */
72
+ debug?: boolean;
73
+ /** Array of custom buttons to add to the toolbar */
74
+ customButtons?: CustomButtonSettings[];
75
+ /** Array of button IDs (including custom buttons) to disable */
76
+ disabledButtonIds?: string[];
77
+ /** Catalog of animation JS code fragments, keyed by ID */
78
+ animations: Record<string, string>;
79
+ /** ID of animation to use for each character (from animations catalog) */
80
+ charAnimationId?: string;
81
+ /** Duration in milliseconds for spreading animation (0=no animation) */
82
+ spreadTime: number;
83
+ /** Duration in milliseconds for element fade-out animation
84
+ * (backward navigation only): 0=no animation */
85
+ backwardFadeOutTime: number;
86
+ /** Duration in milliseconds for prolog panning animation when added
87
+ * elements would be outside viewport (0=no animation) */
88
+ prologDuration: number;
89
+ /** Dictionary of hints, keyed by hint ID */
90
+ hints: Record<string, OperationHint>;
91
+ /** Margin around each rendered hint in pixels */
92
+ hintMargin: number;
93
+ /** Design-time width used when creating hints */
94
+ hintDesignWidth: number;
95
+ /** Design-time height used when creating hints */
96
+ hintDesignHeight: number;
97
+ /** Show the handle element from SVG hint (for diagnostic purposes) */
98
+ showHintHandles: boolean;
99
+ /** Padding to increase hilite rectangle size in pixels */
100
+ hilitePadding: number;
101
+ /** Duration in milliseconds for hilite fade in/out animation */
102
+ hiliteFadeTime: number;
103
+ /** Font family for the version text pane */
104
+ textPaneFontFamily: string;
105
+ /** Font size for the version text pane in pixels */
106
+ textPaneFontSize: number;
107
+ /** Function to generate operation summary HTML from data, version tag,
108
+ * and summary service */
109
+ opSummaryFn?: (data: any, versionTag: string, summaryService: any) => string;
110
+ /** Reference glyph width in pixels for scaling hovered text elements */
111
+ refGlyphWidth: number;
112
+ /** Reference glyph height in pixels for scaling hovered text elements */
113
+ refGlyphHeight: number;
114
+ /** Array of feature names to hide when "hidden features" option is not checked */
115
+ hiddenFeatures?: string[];
116
+ /** Optional map of version tag to color (e.g., {v0: '#FFE4E1', v1: '#E1FFE4'}) */
117
+ versionColors?: Record<string, string>;
118
+ }
119
+ /**
120
+ * Default settings for the component.
121
+ */
122
+ export declare const DEFAULT_SETTINGS: GveRenditionSettings;
@@ -0,0 +1,81 @@
1
+ import { GveRenditionSettings } from "../settings/settings";
2
+ import { Logger } from "../core/logger";
3
+ import { CharChainResult, CharNode } from "../models";
4
+ /**
5
+ * Details area component - displays operation metadata and hovered element details.
6
+ */
7
+ export declare class DetailsArea {
8
+ private container;
9
+ private operationSection;
10
+ private versionFeaturesSection;
11
+ private hoveredElementsSection;
12
+ private hiddenFeaturesCheckbox;
13
+ private collapseBtn;
14
+ private _settings;
15
+ private _logger;
16
+ private _summaryService;
17
+ private _isCollapsed;
18
+ private _showHiddenFeatures;
19
+ private _data;
20
+ private _currentVersionTag;
21
+ constructor(settings: GveRenditionSettings, logger: Logger);
22
+ create(): HTMLElement;
23
+ /**
24
+ * Replace feather icon placeholders with actual SVG icons.
25
+ */
26
+ private replaceFeatherIcons;
27
+ /**
28
+ * Attach event listeners.
29
+ */
30
+ private attachEventListeners;
31
+ /**
32
+ * Toggle collapse/expand state.
33
+ */
34
+ private toggleCollapse;
35
+ /**
36
+ * Update the details area with version information.
37
+ * @param data - The CharChainResult data
38
+ * @param versionTag - The version tag (e.g., "v0", "v1")
39
+ */
40
+ updateVersion(data: CharChainResult | null, versionTag: string): void;
41
+ /**
42
+ * Update the operation section with operation summary and features.
43
+ */
44
+ private updateOperationSection;
45
+ /**
46
+ * Update the version features section with global features.
47
+ */
48
+ private updateVersionFeaturesSection;
49
+ /**
50
+ * Update the hovered elements section.
51
+ * @param hoveredElements - Array of hovered text SVG elements with their node data
52
+ */
53
+ updateHoveredElements(hoveredElements: Array<{
54
+ element: SVGTextElement;
55
+ node: CharNode;
56
+ }>): void;
57
+ /**
58
+ * Filter features based on hidden features setting.
59
+ */
60
+ private filterFeatures;
61
+ /**
62
+ * Render a list of features as HTML.
63
+ */
64
+ private renderFeatureList;
65
+ /**
66
+ * Get version index from version tag.
67
+ */
68
+ private getVersionIndex;
69
+ /**
70
+ * Escape HTML special characters.
71
+ */
72
+ private escapeHtml;
73
+ /**
74
+ * Clear all sections.
75
+ */
76
+ clear(): void;
77
+ /**
78
+ * Update settings.
79
+ */
80
+ updateSettings(settings: GveRenditionSettings): void;
81
+ }
@@ -0,0 +1,69 @@
1
+ import { Logger } from "../core/logger";
2
+ import { CharChainResult } from "../models";
3
+ /**
4
+ * Hilites manager - handles creating and animating hilite rectangles.
5
+ */
6
+ export declare class Hilites {
7
+ private _logger;
8
+ private _rootSvg;
9
+ private _hilitesGroup;
10
+ private _activeHilites;
11
+ private _hilitePadding;
12
+ private _hiliteFadeTime;
13
+ constructor(logger: Logger, hilitePadding: number, hiliteFadeTime: number);
14
+ /**
15
+ * Set root SVG element reference.
16
+ */
17
+ setRootSvg(rootSvg: SVGSVGElement): void;
18
+ /**
19
+ * Update settings.
20
+ */
21
+ updateSettings(hilitePadding: number, hiliteFadeTime: number): void;
22
+ /**
23
+ * Show hilites for a specific version.
24
+ * @param data - The CharChainResult data
25
+ * @param versionTag - Version tag to hilite
26
+ * @param color - Hilite color
27
+ */
28
+ showHilites(data: CharChainResult, versionTag: string, color: string): Promise<void>;
29
+ /**
30
+ * Clear all hilites.
31
+ */
32
+ 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
+ /**
39
+ * Create a hilite rectangle for a text element.
40
+ *
41
+ * IMPORTANT: Since hilites are now placed in the same container (viewport group)
42
+ * as the text elements, they share the same coordinate space and transforms.
43
+ * This means getBBox() gives us the correct relative coordinates, and the
44
+ * hilites will automatically pan/zoom with the text when PROLOG is triggered.
45
+ */
46
+ private createHiliteRect;
47
+ /**
48
+ * Animate hilites in using GSAP.
49
+ */
50
+ private animateHilitesIn;
51
+ /**
52
+ * Animate hilites out using GSAP.
53
+ */
54
+ private animateHilitesOut;
55
+ /**
56
+ * Check if hilites are currently active.
57
+ */
58
+ hasActiveHilites(): boolean;
59
+ /**
60
+ * Get the SVG container where hilites should be added.
61
+ * When svg-pan-zoom is active, this returns the viewport group.
62
+ * Otherwise, returns the root SVG.
63
+ *
64
+ * CRITICAL: svg-pan-zoom wraps all content in a <g> viewport element.
65
+ * Hilites MUST be added to this group, not the root SVG, so they
66
+ * transform with the content when PROLOG panning occurs.
67
+ */
68
+ private getSvgContainer;
69
+ }
@@ -0,0 +1,76 @@
1
+ import { CharChainResult, CharNode, ChainOperationContextStep, OperationType } from "../models";
2
+ import { Logger } from "../core/logger";
3
+ /**
4
+ * Service for building operation summaries.
5
+ * Provides helper functions to extract and format operation data.
6
+ */
7
+ export declare class OperationSummaryService {
8
+ private _logger;
9
+ private _data;
10
+ constructor(logger: Logger);
11
+ /**
12
+ * Update the data reference.
13
+ */
14
+ setData(data: CharChainResult | null): void;
15
+ /**
16
+ * Get operation by version tag.
17
+ * @param versionTag - Version tag (e.g., "v1", "v2")
18
+ * @returns The step containing the operation, or null
19
+ */
20
+ getStepByVersionTag(versionTag: string): ChainOperationContextStep | null;
21
+ /**
22
+ * Get operation by ID.
23
+ * @param operationId - Operation ID
24
+ * @returns The step containing the operation, or null
25
+ */
26
+ getStepByOperationId(operationId: string): ChainOperationContextStep | null;
27
+ /**
28
+ * Get text from a node ID by searching in version tagged nodes.
29
+ * @param nodeId - Node ID
30
+ * @param versionTag - Version tag to search in (searches backwards if not found)
31
+ * @returns The node's text, or empty string
32
+ */
33
+ getNodeText(nodeId: number, versionTag: string): string;
34
+ /**
35
+ * Get a node by ID, searching in version tagged nodes.
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.
40
+ *
41
+ * @param nodeId - Node ID
42
+ * @param versionTag - Version tag to search in (searches backwards if not found)
43
+ * @returns The node, or null
44
+ */
45
+ getNode(nodeId: number, versionTag: string): CharNode | null;
46
+ /**
47
+ * Get text from a span of nodes.
48
+ * @param nodeIds - Array of node IDs
49
+ * @param versionTag - Version tag
50
+ * @returns Concatenated text
51
+ */
52
+ getSpanText(nodeIds: number[], versionTag: string): string;
53
+ /**
54
+ * Get context text around a node or span, including the affected text.
55
+ * Extends context to word boundaries (space or LF) after collecting minimum characters.
56
+ * @param nodeIds - Node IDs of the target span (used when atAsIndex is false)
57
+ * @param versionTag - Version tag
58
+ * @param atValue - The 'at' value from the operation (node ID or index depending on atAsIndex)
59
+ * @param atAsIndex - Whether 'at' is an index (true) or node ID (false)
60
+ * @param contextSize - Minimum number of characters before/after (default: 20)
61
+ * @returns Context text including the affected span
62
+ */
63
+ getContext(nodeIds: number[], versionTag: string, atValue?: number, atAsIndex?: boolean, contextSize?: number): string;
64
+ /**
65
+ * Get the operation type as a readable string.
66
+ */
67
+ getOperationTypeName(type: OperationType): string;
68
+ /**
69
+ * Get version index from version tag.
70
+ */
71
+ private getVersionIndex;
72
+ /**
73
+ * Escape HTML special characters.
74
+ */
75
+ escapeHtml(text: string): string;
76
+ }
@@ -0,0 +1,131 @@
1
+ import { CharChainResult } from "../models";
2
+ import { CustomButtonSettings } from "../settings/settings";
3
+ /**
4
+ * Comprehensive toolbar component for version navigation, slideshow, zoom, and custom actions.
5
+ */
6
+ export declare class Toolbar {
7
+ private container;
8
+ private firstBtn;
9
+ private prevBtn;
10
+ private prevStagedBtn;
11
+ private nextStagedBtn;
12
+ private nextBtn;
13
+ private lastBtn;
14
+ private versionLabel;
15
+ private groupBadge;
16
+ private slideshowStartBtn;
17
+ private slideshowStopBtn;
18
+ private slideshowReverseBtn;
19
+ private autoForwardBtn;
20
+ private zoomInBtn;
21
+ private zoomOutBtn;
22
+ private fitBtn;
23
+ private downloadBtn;
24
+ private _data;
25
+ private _currentVersionIndex;
26
+ private _customButtons;
27
+ private _disabledButtonIds;
28
+ private _slideshowReverse;
29
+ private _autoForwardEnabled;
30
+ /**
31
+ * Get slideshow reverse state.
32
+ */
33
+ getSlideshowReverse(): boolean;
34
+ constructor(container: HTMLElement);
35
+ /**
36
+ * Render toolbar UI elements.
37
+ */
38
+ private render;
39
+ /**
40
+ * Replace feather icon placeholders with actual SVG icons.
41
+ */
42
+ private replaceFeatherIcons;
43
+ /**
44
+ * Attach event listeners to buttons.
45
+ */
46
+ private attachEventListeners;
47
+ /**
48
+ * Render custom buttons from settings.
49
+ */
50
+ private renderCustomButtons;
51
+ /**
52
+ * Update button states and version label.
53
+ */
54
+ private updateButtons;
55
+ /**
56
+ * Update version label with current version information.
57
+ */
58
+ private updateVersionLabel;
59
+ /**
60
+ * Get version information for current step.
61
+ */
62
+ private getVersionInfo;
63
+ /**
64
+ * Check if there is a previous staged version.
65
+ */
66
+ private hasPrevStagedVersion;
67
+ /**
68
+ * Check if there is a next staged version.
69
+ */
70
+ private hasNextStagedVersion;
71
+ /**
72
+ * Update slideshow reverse button appearance.
73
+ */
74
+ private updateSlideshowReverseButton;
75
+ /**
76
+ * Update auto-forward button visual state.
77
+ */
78
+ private updateAutoForwardButton;
79
+ /**
80
+ * Apply disabled state to buttons from settings.
81
+ */
82
+ private applyDisabledButtons;
83
+ /**
84
+ * Dispatch navigation event for parent component to handle.
85
+ */
86
+ private dispatchNavigationEvent;
87
+ /**
88
+ * Dispatch slideshow event for parent component to handle.
89
+ */
90
+ private dispatchSlideshowEvent;
91
+ /**
92
+ * Dispatch auto-forward event for parent component to handle.
93
+ */
94
+ private dispatchAutoForwardEvent;
95
+ /**
96
+ * Dispatch display event for parent component to handle.
97
+ */
98
+ private dispatchDisplayEvent;
99
+ /**
100
+ * Update data reference (for staged version detection).
101
+ */
102
+ updateData(data: CharChainResult | null): void;
103
+ /**
104
+ * Set current version index (for external updates).
105
+ */
106
+ setCurrentIndex(index: number): void;
107
+ /**
108
+ * Get current version index.
109
+ */
110
+ getCurrentIndex(): number;
111
+ /**
112
+ * Set custom buttons from settings.
113
+ */
114
+ setCustomButtons(customButtons: CustomButtonSettings[]): void;
115
+ /**
116
+ * Set disabled button IDs from settings.
117
+ */
118
+ setDisabledButtons(disabledButtonIds: string[]): void;
119
+ /**
120
+ * Set slideshow active state (show/hide start/stop buttons).
121
+ */
122
+ setSlideshowActive(active: boolean): void;
123
+ /**
124
+ * Disable all navigation buttons (e.g., during slideshow).
125
+ */
126
+ setNavigationDisabled(disabled: boolean): void;
127
+ /**
128
+ * Set auto-forward enabled state and update button appearance.
129
+ */
130
+ setAutoForwardEnabled(enabled: boolean): void;
131
+ }