@myrmidon/gve-snapshot-rendition 2.0.4 → 2.0.6

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 (56) hide show
  1. package/dist/adapter/data-feature-adapter.d.ts +2 -3
  2. package/dist/animation/animation-engine.d.ts +0 -13
  3. package/dist/core/gve-snapshot-rendition.d.ts +49 -44
  4. package/dist/hint-designer/gve-hint-designer.d.ts +11 -1
  5. package/dist/index.cjs.min.js +1 -1
  6. package/dist/index.cjs.min.js.map +1 -1
  7. package/dist/index.js +483 -470
  8. package/dist/index.js.map +1 -1
  9. package/dist/models.d.ts +21 -50
  10. package/dist/rendering/feature-resolver.d.ts +6 -7
  11. package/dist/rendering/hint-renderer.d.ts +6 -12
  12. package/dist/rendering/text-layout.d.ts +2 -1
  13. package/dist/rendering/text-renderer.d.ts +13 -12
  14. package/dist/settings/hint-models.d.ts +0 -5
  15. package/dist/settings/settings.d.ts +0 -4
  16. package/dist/ui/details-area.d.ts +2 -1
  17. package/dist/ui/hilites.d.ts +3 -9
  18. package/dist/ui/operation-summary-service.d.ts +4 -7
  19. package/package.json +82 -73
  20. package/dist/rendering/spreading-engine.d.ts +0 -98
  21. package/dist/src/adapter/adapter-models.d.ts +0 -171
  22. package/dist/src/adapter/data-feature-adapter.d.ts +0 -30
  23. package/dist/src/adapter/feature-adapter.d.ts +0 -34
  24. package/dist/src/adapter/index.d.ts +0 -6
  25. package/dist/src/adapter/matcher.d.ts +0 -38
  26. package/dist/src/adapter/parser.d.ts +0 -58
  27. package/dist/src/adapter/tokenizer.d.ts +0 -55
  28. package/dist/src/animation/animation-engine.d.ts +0 -105
  29. package/dist/src/animation/animation-factory.d.ts +0 -49
  30. package/dist/src/core/color-palette.d.ts +0 -39
  31. package/dist/src/core/gve-snapshot-rendition.d.ts +0 -359
  32. package/dist/src/core/logger.d.ts +0 -37
  33. package/dist/src/hint-designer/gve-hint-designer.d.ts +0 -356
  34. package/dist/src/hint-designer/hint-designer-models.d.ts +0 -32
  35. package/dist/src/index.d.ts +0 -17
  36. package/dist/src/models.d.ts +0 -171
  37. package/dist/src/rendering/bounds-cache.d.ts +0 -62
  38. package/dist/src/rendering/feature-resolver.d.ts +0 -98
  39. package/dist/src/rendering/hint-renderer.d.ts +0 -103
  40. package/dist/src/rendering/spreading-engine.d.ts +0 -98
  41. package/dist/src/rendering/svg-utils.d.ts +0 -133
  42. package/dist/src/rendering/text-layout.d.ts +0 -100
  43. package/dist/src/rendering/text-renderer.d.ts +0 -81
  44. package/dist/src/settings/hint-models.d.ts +0 -61
  45. package/dist/src/settings/settings.d.ts +0 -118
  46. package/dist/src/ui/details-area.d.ts +0 -112
  47. package/dist/src/ui/hilites.d.ts +0 -63
  48. package/dist/src/ui/operation-summary-service.d.ts +0 -73
  49. package/dist/src/ui/toolbar.d.ts +0 -141
  50. package/dist/src/ui/version-text-area.d.ts +0 -131
  51. package/dist/src/ui/versions-list-area.d.ts +0 -88
  52. package/dist/src/utils/color-palette.d.ts +0 -36
  53. package/dist/src/utils/feature-utils.d.ts +0 -80
  54. package/dist/src/utils/node-utils.d.ts +0 -47
  55. package/dist/src/utils/text-utils.d.ts +0 -35
  56. /package/dist/{src/layout → layout}/golden-layout-styles.d.ts +0 -0
@@ -1,359 +0,0 @@
1
- import { CharChainResult } from "../models";
2
- import { GveRenditionSettings } from "../settings/settings";
3
- /**
4
- * Relative position for elements (hints and additional text) with respect to the RBR.
5
- * Specifies how the EBR (Element Bounding Rectangle) aligns with the RBR (Reference Bounding Rectangle).
6
- */
7
- export type RelativePosition = "n" | "ne" | "e" | "se" | "s" | "sw" | "w" | "nw" | "inw" | "ine" | "isw" | "ise" | "o";
8
- /**
9
- * GVE Snapshot Rendition Web Component.
10
- * Renders interactive text transformations from snapshot model data.
11
- */
12
- export declare class GveSnapshotRendition extends HTMLElement {
13
- private _settings;
14
- private _data?;
15
- private _versionTag?;
16
- private _logger;
17
- private _animationEngine?;
18
- private _boundsCache;
19
- private _textRenderer?;
20
- private _hintRenderer?;
21
- private _featureResolver;
22
- private _shadow;
23
- private _rootSvg?;
24
- private _container?;
25
- private _toolbar?;
26
- private _versionTextArea?;
27
- private _detailsArea?;
28
- private _versionsListArea?;
29
- private _hilites?;
30
- private _panZoomInstance?;
31
- private _keyboardHandler?;
32
- private _goldenLayout?;
33
- private _versionsListEl?;
34
- private _svgContainerEl?;
35
- private _versionTextEl?;
36
- private _detailsEl?;
37
- /**
38
- * Get the library version.
39
- * This value is injected at build time via @rollup/plugin-replace
40
- * from package.json. It allows consumers to verify which version
41
- * of the web component is loaded.
42
- */
43
- static get version(): string;
44
- private _baseNodes;
45
- private _nodeMap;
46
- private _slideshowTimerId;
47
- private _currentVersion;
48
- private _currentVersionIndex;
49
- private _autoForwardEnabled;
50
- private _autoForwardTimerId;
51
- private _renderScheduled;
52
- constructor();
53
- /**
54
- * Observed attributes for the web component.
55
- */
56
- static get observedAttributes(): string[];
57
- /**
58
- * Called when component is added to the DOM.
59
- */
60
- connectedCallback(): void;
61
- /**
62
- * Called when component is removed from the DOM.
63
- */
64
- disconnectedCallback(): void;
65
- /**
66
- * Called when observed attributes change.
67
- */
68
- attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
69
- /**
70
- * Settings property (bindable).
71
- */
72
- get settings(): GveRenditionSettings;
73
- set settings(value: GveRenditionSettings);
74
- /**
75
- * Data property (bindable).
76
- */
77
- get data(): CharChainResult | undefined;
78
- set data(value: CharChainResult | undefined);
79
- /**
80
- * Version tag property (bindable).
81
- */
82
- get versionTag(): string | undefined;
83
- set versionTag(value: string | undefined);
84
- /**
85
- * Initialize GSAP when available.
86
- */
87
- private initializeGsap;
88
- /**
89
- * Process data to prepare for rendering.
90
- */
91
- private processData;
92
- /**
93
- * Render the component UI.
94
- */
95
- private render;
96
- /**
97
- * Wire up the drag-to-resize handle at the bottom of the component.
98
- * Dragging it adjusts the host element's inline height, which overrides
99
- * the --gve-height CSS variable while keeping GL's ResizeObserver in sync.
100
- */
101
- private setupBottomResizeHandle;
102
- /**
103
- * Initialize Golden Layout with the four resizable panels.
104
- * The SVG rendition panel has no header and acts as the fixed background.
105
- */
106
- private initializeGoldenLayout;
107
- /**
108
- * Default layout: mirrors the original Split.js arrangement.
109
- * Column:
110
- * Row (60 %): VersionsList (15 %) | TextRendition (85 %, no header)
111
- * Row (40 %): VersionText (60 %) | Details (40 %)
112
- */
113
- private getDefaultLayout;
114
- /**
115
- * Reset layout to default panel sizes by reloading the default config.
116
- */
117
- resetLayout(): void;
118
- /**
119
- * Coalesce concurrent render requests into a single call.
120
- * Multiple same-turn invocations (e.g. settings setter + data setter both
121
- * firing in the same Angular expression) collapse into one microtask render,
122
- * always running after all synchronous assignments have completed so the
123
- * latest data is used.
124
- */
125
- private scheduleRenderContent;
126
- /**
127
- * Render content (base text only - starts at v0).
128
- * Use goToVersionIndex() to navigate to specific versions.
129
- */
130
- private renderContent;
131
- /**
132
- * Initialize pan/zoom functionality on the SVG element.
133
- * Enables mouse wheel zoom, click-and-drag pan, with configurable limits.
134
- */
135
- private initializePanZoom;
136
- /**
137
- * Process a single operation step.
138
- */
139
- private processOperation;
140
- /**
141
- * Internal operation processing (called with pan/zoom disabled).
142
- */
143
- private processOperationInternal;
144
- /**
145
- * Get reference nodes for an operation from the flat node map.
146
- * All nodes (including deleted ones) are always present in the map.
147
- *
148
- * @param nodeIds - Array of node IDs from step.refNodeIds
149
- * @param inputTag - Kept for API compatibility; unused in new model
150
- * @returns Array of CharNode objects matching the IDs
151
- */
152
- private getReferenceNodes;
153
- /**
154
- * Get nodes added by a specific operation.
155
- * Nodes added by an operation carry an `opid` feature in their per-version
156
- * features for the output tag.
157
- *
158
- * @param operationId - The operation ID to match
159
- * @param outputTag - The output version tag (e.g., "v3") where the nodes were added
160
- * @returns Array of nodes added by this operation
161
- */
162
- private getAddedNodes;
163
- /**
164
- * Render hints for an operation.
165
- */
166
- private renderHints;
167
- /**
168
- * Navigate to a specific version index (0 = base text, 1+ = after operations).
169
- * Uses accumulation model: forward adds elements, backward removes them.
170
- */
171
- private goToVersionIndex;
172
- /**
173
- * Update the version text area with the current version's text.
174
- * @param versionIndex - The version index (0 = base text)
175
- */
176
- private updateVersionText;
177
- /**
178
- * Update the details area with the current version's information.
179
- * @param versionIndex - The version index (0 = base text)
180
- */
181
- private updateDetailsArea;
182
- /**
183
- * Set up hover listeners on all text elements to update details area.
184
- */
185
- private setupTextElementHoverListeners;
186
- /**
187
- * Get the node from the node map by its SVG element ID.
188
- * Returns the node and the version tag at which to read its features.
189
- */
190
- private getNodeForElement;
191
- /**
192
- * Handle hover over a text element.
193
- */
194
- private handleTextElementHover;
195
- /**
196
- * Handle leaving a text element.
197
- */
198
- private handleTextElementLeave;
199
- /**
200
- * Handle click on a text element (for pinning).
201
- */
202
- private handleTextElementClick;
203
- /**
204
- * Navigate forward by processing operations one by one.
205
- * Each operation adds hints and/or text that persist for all future versions.
206
- */
207
- private navigateForward;
208
- /**
209
- * Navigate backward by removing elements added in later versions.
210
- * Reverses operations from current down to target.
211
- */
212
- private navigateBackward;
213
- /**
214
- * Remove all elements belonging to a specific version.
215
- * Optionally fades them out before removal based on settings.
216
- */
217
- private removeVersionElements;
218
- /**
219
- * Extract char offsets from first operation if it's an annotate.
220
- */
221
- private extractCharOffsets;
222
- /**
223
- * Extract per-node rendition configs from the first operation if it's an annotate.
224
- * This allows init features like r_font-size, r_fore-color, etc. to override
225
- * the component-wide settings for specific base text nodes.
226
- */
227
- private extractInitNodeConfigs;
228
- /**
229
- * Zoom in by configured step amount.
230
- */
231
- zoomIn(): void;
232
- /**
233
- * Zoom out by configured step amount.
234
- */
235
- zoomOut(): void;
236
- /**
237
- * Reset zoom to 100% and center pan.
238
- */
239
- resetZoom(): void;
240
- /**
241
- * Set zoom to specific level (1.0 = 100%).
242
- */
243
- setZoom(zoomLevel: number): void;
244
- /**
245
- * Get current zoom level.
246
- */
247
- getZoom(): number;
248
- /**
249
- * Update toolbar with current zoom level.
250
- */
251
- private updateToolbarZoom;
252
- /**
253
- * Handle toolbar navigation actions.
254
- */
255
- private handleToolbarNavigation;
256
- /**
257
- * Returns true when the given version tag is a staged version.
258
- * Checks globalFeatures (from new API) for a "version" feature.
259
- */
260
- private isStagedVersion;
261
- /**
262
- * Navigate to previous staged version.
263
- */
264
- private goToPrevStagedVersion;
265
- /**
266
- * Navigate to next staged version.
267
- */
268
- private goToNextStagedVersion;
269
- /**
270
- * Handle toolbar slideshow actions.
271
- */
272
- private handleToolbarSlideshow;
273
- /**
274
- * Handle toolbar display actions.
275
- */
276
- private handleToolbarDisplay;
277
- /**
278
- * Fit SVG to view (center and zoom to fit all content).
279
- */
280
- private fitToView;
281
- /**
282
- * Download SVG as a file.
283
- */
284
- private downloadSVG;
285
- /**
286
- * Start slideshow mode.
287
- */
288
- private startSlideshow;
289
- /**
290
- * Stop slideshow mode.
291
- */
292
- private stopSlideshow;
293
- /**
294
- * Advance slideshow by one frame.
295
- */
296
- private slideshowAdvance;
297
- /**
298
- * Check if the current version belongs to a group and trigger auto-forward if needed.
299
- * Auto-forward continues to the next version after a delay, as long as operations
300
- * share the same groupId.
301
- *
302
- * @param versionIndex - The current version index (just navigated to)
303
- */
304
- private checkAndTriggerAutoForward;
305
- /**
306
- * Stop any pending auto-forward timer.
307
- */
308
- private stopAutoForward;
309
- /**
310
- * Toggle auto-forward on group feature.
311
- * @param enabled - Whether to enable auto-forward
312
- */
313
- setAutoForwardEnabled(enabled: boolean): void;
314
- /**
315
- * Get current auto-forward enabled state.
316
- */
317
- getAutoForwardEnabled(): boolean;
318
- /**
319
- * Setup keyboard shortcuts for navigation and zoom.
320
- * Shortcuts:
321
- * - ArrowLeft/ArrowRight: Previous/Next version
322
- * - Home/End: First/Last version
323
- * - 0-9: Jump to version 0-9
324
- * - +/-: Zoom in/out
325
- */
326
- private setupKeyboardShortcuts;
327
- /**
328
- * Get the SVG element where content should be appended.
329
- * When pan/zoom is active, returns the transformed viewport group.
330
- * When pan/zoom is inactive, returns the root SVG.
331
- *
332
- * CRITICAL: svg-pan-zoom wraps content in a <g> element. New elements
333
- * must be added to this group, not the root SVG, or they won't transform.
334
- */
335
- private getSvgContainer;
336
- /**
337
- * Temporarily disable pan/zoom for rendering operations.
338
- * CRITICAL: Disables user input but preserves viewport transform.
339
- */
340
- private disablePanZoom;
341
- /**
342
- * Re-enable pan/zoom after rendering operations complete.
343
- */
344
- private enablePanZoom;
345
- /**
346
- * Navigate to a specific version by tag.
347
- * @param versionTag - Version tag (e.g., "v0", "v1")
348
- */
349
- private navigateToVersion;
350
- /**
351
- * Toggle hilites for a specific version.
352
- * @param versionTag - Version tag to hilite, or null to clear hilites
353
- */
354
- private toggleHilites;
355
- /**
356
- * Get component styles (includes inlined GL CSS for Shadow DOM compatibility).
357
- */
358
- private getStyles;
359
- }
@@ -1,37 +0,0 @@
1
- /**
2
- * Logger utility for diagnostic output.
3
- * Logging is controlled by the debug setting in component settings.
4
- */
5
- export declare class Logger {
6
- private _enabled;
7
- private _prefix;
8
- constructor(prefix?: string, enabled?: boolean);
9
- /**
10
- * Enable or disable logging.
11
- */
12
- setEnabled(enabled: boolean): void;
13
- /**
14
- * Log an informational message.
15
- */
16
- info(message: string, ...args: any[]): void;
17
- /**
18
- * Log a warning message.
19
- */
20
- warn(message: string, ...args: any[]): void;
21
- /**
22
- * Log an error message (always logged, regardless of debug setting).
23
- */
24
- error(message: string, ...args: any[]): void;
25
- /**
26
- * Log a debug message with detailed context.
27
- */
28
- debug(category: string, message: string, data?: any): void;
29
- /**
30
- * Time a block of code execution.
31
- */
32
- time(label: string): void;
33
- /**
34
- * End timing a block of code.
35
- */
36
- timeEnd(label: string): void;
37
- }