@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.
Files changed (59) 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 +72 -30
  4. package/dist/hint-designer/gve-hint-designer.d.ts +11 -1
  5. package/dist/index.cjs.min.js +7 -7
  6. package/dist/index.cjs.min.js.map +1 -1
  7. package/dist/index.d.ts +1 -0
  8. package/dist/index.js +173 -81
  9. package/dist/index.js.map +1 -1
  10. package/dist/models.d.ts +21 -50
  11. package/dist/rendering/feature-resolver.d.ts +10 -10
  12. package/dist/rendering/hint-renderer.d.ts +9 -12
  13. package/dist/rendering/svg-utils.d.ts +38 -1
  14. package/dist/rendering/text-layout.d.ts +29 -4
  15. package/dist/rendering/text-renderer.d.ts +25 -14
  16. package/dist/settings/hint-models.d.ts +0 -5
  17. package/dist/settings/settings.d.ts +0 -4
  18. package/dist/ui/details-area.d.ts +31 -0
  19. package/dist/ui/hilites.d.ts +3 -9
  20. package/dist/ui/operation-summary-service.d.ts +4 -7
  21. package/dist/ui/toolbar.d.ts +10 -0
  22. package/dist/utils/feature-utils.d.ts +7 -3
  23. package/package.json +82 -73
  24. package/dist/rendering/spreading-engine.d.ts +0 -98
  25. package/dist/src/adapter/adapter-models.d.ts +0 -171
  26. package/dist/src/adapter/data-feature-adapter.d.ts +0 -30
  27. package/dist/src/adapter/feature-adapter.d.ts +0 -34
  28. package/dist/src/adapter/index.d.ts +0 -6
  29. package/dist/src/adapter/matcher.d.ts +0 -38
  30. package/dist/src/adapter/parser.d.ts +0 -58
  31. package/dist/src/adapter/tokenizer.d.ts +0 -55
  32. package/dist/src/animation/animation-engine.d.ts +0 -105
  33. package/dist/src/animation/animation-factory.d.ts +0 -49
  34. package/dist/src/core/color-palette.d.ts +0 -39
  35. package/dist/src/core/gve-snapshot-rendition.d.ts +0 -359
  36. package/dist/src/core/logger.d.ts +0 -37
  37. package/dist/src/hint-designer/gve-hint-designer.d.ts +0 -356
  38. package/dist/src/hint-designer/hint-designer-models.d.ts +0 -32
  39. package/dist/src/index.d.ts +0 -17
  40. package/dist/src/models.d.ts +0 -171
  41. package/dist/src/rendering/bounds-cache.d.ts +0 -62
  42. package/dist/src/rendering/feature-resolver.d.ts +0 -98
  43. package/dist/src/rendering/hint-renderer.d.ts +0 -103
  44. package/dist/src/rendering/svg-utils.d.ts +0 -133
  45. package/dist/src/rendering/text-layout.d.ts +0 -100
  46. package/dist/src/rendering/text-renderer.d.ts +0 -81
  47. package/dist/src/settings/hint-models.d.ts +0 -61
  48. package/dist/src/settings/settings.d.ts +0 -118
  49. package/dist/src/ui/details-area.d.ts +0 -112
  50. package/dist/src/ui/hilites.d.ts +0 -63
  51. package/dist/src/ui/operation-summary-service.d.ts +0 -73
  52. package/dist/src/ui/toolbar.d.ts +0 -141
  53. package/dist/src/ui/version-text-area.d.ts +0 -131
  54. package/dist/src/ui/versions-list-area.d.ts +0 -88
  55. package/dist/src/utils/color-palette.d.ts +0 -36
  56. package/dist/src/utils/feature-utils.d.ts +0 -80
  57. package/dist/src/utils/node-utils.d.ts +0 -47
  58. package/dist/src/utils/text-utils.d.ts +0 -35
  59. /package/dist/{src/layout → layout}/golden-layout-styles.d.ts +0 -0
@@ -1,356 +0,0 @@
1
- import { HintDesignerData, HintDesignerSettings, StringPair } from "./hint-designer-models";
2
- /**
3
- * GVE Hint Designer Web Component.
4
- * A minimalist editing environment to design hints and test their animations.
5
- */
6
- export declare class GveHintDesigner extends HTMLElement {
7
- private _data;
8
- private _settings;
9
- private _hintId?;
10
- private _hintVariables;
11
- private _logger;
12
- private _shadow;
13
- private _svgDisplay?;
14
- private _messagePanel?;
15
- private _zoomLevel;
16
- private _panX;
17
- private _panY;
18
- private _isPanning;
19
- private _lastPanX;
20
- private _lastPanY;
21
- private _svgTextarea?;
22
- private _jsTextarea?;
23
- private _svgHighlightContainer?;
24
- private _jsHighlightContainer?;
25
- private _hintsDropdown?;
26
- private _svgWordWrapEnabled;
27
- private _jsWordWrapEnabled;
28
- private _animationsDropdown?;
29
- private _embeddedJsCheckbox?;
30
- private _newAnimationCheckbox?;
31
- private _positionSelect?;
32
- private _offsetXInput?;
33
- private _offsetYInput?;
34
- private _scaleXInput?;
35
- private _scaleYInput?;
36
- private _rotationInput?;
37
- private _displacedRefSpanInput?;
38
- private _variablesTable?;
39
- private _playButton?;
40
- private _pauseButton?;
41
- private _restartButton?;
42
- private _progressBar?;
43
- private _variablesValidationMsg?;
44
- private _variablesPanelHeader?;
45
- private _currentTimeline?;
46
- private _isPlaying;
47
- private _progressUpdateInterval?;
48
- constructor();
49
- /**
50
- * Called when component is added to the DOM.
51
- */
52
- connectedCallback(): void;
53
- /**
54
- * Called when component is removed from the DOM.
55
- */
56
- disconnectedCallback(): void;
57
- /**
58
- * Data property (bindable).
59
- */
60
- get data(): HintDesignerData;
61
- set data(value: HintDesignerData);
62
- /**
63
- * Settings property (bindable).
64
- */
65
- get settings(): HintDesignerSettings;
66
- set settings(value: HintDesignerSettings);
67
- /**
68
- * Hint ID property (bindable).
69
- */
70
- get hintId(): string | undefined;
71
- set hintId(value: string | undefined);
72
- /**
73
- * Hint variables property (bindable).
74
- */
75
- get hintVariables(): StringPair[];
76
- set hintVariables(value: StringPair[]);
77
- /**
78
- * Render the component UI.
79
- */
80
- private render;
81
- /**
82
- * Create the toolbar.
83
- */
84
- private createToolbar;
85
- /**
86
- * Create the SVG display panel.
87
- */
88
- private createSvgDisplay;
89
- /**
90
- * Add grid and rulers to the SVG display as background.
91
- */
92
- private addGridAndRulers;
93
- /**
94
- * Create the timeline player.
95
- */
96
- private createTimelinePlayer;
97
- /**
98
- * Create the message panel.
99
- */
100
- private createMessagePanel;
101
- /**
102
- * Create the hint properties editor.
103
- */
104
- private createHintPropertiesEditor;
105
- /**
106
- * Create the hint variables list.
107
- */
108
- private createHintVariablesList;
109
- /**
110
- * Create a button element with a Feather icon.
111
- */
112
- private createButton;
113
- /**
114
- * Create an input element.
115
- */
116
- private createInput;
117
- /**
118
- * Create a form row with label and control.
119
- */
120
- private createFormRow;
121
- /**
122
- * Create position select dropdown.
123
- */
124
- private createPositionSelect;
125
- /**
126
- * Make a splitter resizable between two panels.
127
- * @param panelAbove The panel above the splitter
128
- * @param _panelBelow The panel below the splitter (unused but kept for API clarity)
129
- * @param splitter The splitter element between them
130
- */
131
- private makeResizable;
132
- /**
133
- * Initialize event listeners.
134
- */
135
- private initializeEventListeners;
136
- /**
137
- * Initialize panning with mouse drag.
138
- */
139
- private initializePanning;
140
- /**
141
- * Initialize zooming with mouse wheel.
142
- */
143
- private initializeWheelZoom;
144
- /**
145
- * Add click listener to a button by ID.
146
- */
147
- private addClickListener;
148
- /**
149
- * Cleanup resources.
150
- */
151
- private cleanup;
152
- /**
153
- * Refresh the entire UI.
154
- */
155
- private refreshUI;
156
- /**
157
- * Refresh the hints dropdown.
158
- */
159
- private refreshHintsDropdown;
160
- /**
161
- * Refresh the animations dropdown.
162
- */
163
- private refreshAnimationsDropdown;
164
- /**
165
- * Load a hint for editing.
166
- */
167
- private loadHint;
168
- /**
169
- * Clear the hint form.
170
- */
171
- private clearHintForm;
172
- /**
173
- * Validate SVG code for well-formedness and structure.
174
- * Returns an error message if validation fails, or null if valid.
175
- */
176
- private validateSvgCode;
177
- /**
178
- * Add a new hint.
179
- */
180
- private addHint;
181
- /**
182
- * Save the current hint.
183
- */
184
- private saveHint;
185
- /**
186
- * Delete the current hint.
187
- */
188
- private deleteHint;
189
- /**
190
- * Parse offset value (number or string with suffix).
191
- */
192
- private parseOffset;
193
- /**
194
- * Refresh the SVG display.
195
- */
196
- private refreshSvgDisplay;
197
- /**
198
- * Resolve variables in SVG code.
199
- */
200
- private resolveVariables;
201
- /**
202
- * Extract variable names from SVG code (variables in {{...}} placeholders).
203
- */
204
- private extractVariablesFromSvg;
205
- /**
206
- * Validate SVG variables and update validation message.
207
- * Shows a warning if any variables used in SVG are not defined in hint variables.
208
- */
209
- private validateSvgVariables;
210
- /**
211
- * Update warning icon in variables panel header.
212
- */
213
- private updateVariablesHeaderWarning;
214
- /**
215
- * Play animation.
216
- */
217
- private playAnimation;
218
- /**
219
- * Create the GSAP timeline for the current hint.
220
- */
221
- private createTimeline;
222
- /**
223
- * Pause animation.
224
- */
225
- private pauseAnimation;
226
- /**
227
- * Restart animation.
228
- */
229
- private restartAnimation;
230
- /**
231
- * Seek animation (timeline scrubbing).
232
- */
233
- private seekAnimation;
234
- /**
235
- * Start updating progress bar.
236
- */
237
- private startProgressUpdate;
238
- /**
239
- * Stop updating progress bar.
240
- */
241
- private stopProgressUpdate;
242
- /**
243
- * Zoom in.
244
- */
245
- private zoomIn;
246
- /**
247
- * Zoom out.
248
- */
249
- private zoomOut;
250
- /**
251
- * Reset zoom.
252
- */
253
- private resetZoom;
254
- /**
255
- * Update SVG transform based on zoom and pan.
256
- */
257
- private updateSvgTransform;
258
- /**
259
- * Size to fit the SVG content.
260
- */
261
- private sizeToFit;
262
- /**
263
- * Toggle word wrap for SVG textarea.
264
- */
265
- private toggleSvgWordWrap;
266
- /**
267
- * Toggle word wrap for JS textarea.
268
- */
269
- private toggleJsWordWrap;
270
- /**
271
- * Save data to file.
272
- */
273
- private saveData;
274
- /**
275
- * Load data from file.
276
- */
277
- private loadData;
278
- /**
279
- * Clear all data.
280
- */
281
- private clearData;
282
- /**
283
- * Export the current hint as an InkScape-compatible SVG file.
284
- */
285
- private exportToInkscape;
286
- /**
287
- * Load animation code from catalog.
288
- */
289
- private loadAnimationCode;
290
- /**
291
- * Add a new variable.
292
- */
293
- private addVariable;
294
- /**
295
- * Delete a variable.
296
- */
297
- private deleteVariable;
298
- /**
299
- * Edit a variable.
300
- */
301
- private editVariable;
302
- /**
303
- * Delete all variables.
304
- */
305
- private deleteAllVariables;
306
- /**
307
- * Extract all variable names from all hints in data.
308
- * Returns a sorted array of unique variable names.
309
- */
310
- private extractAllVariablesFromHints;
311
- /**
312
- * Populate hint variables from all hints.
313
- * Extracts all variables from all hints' SVG code and merges them into hintVariables.
314
- * Only adds variables that don't already exist.
315
- */
316
- private populateVariablesFromHints;
317
- /**
318
- * Refresh the variables table.
319
- */
320
- private refreshVariablesTable;
321
- /**
322
- * Update the highlighted state of all Hint Properties form rows.
323
- * Rows whose value differs from the default get the form-row--modified class.
324
- */
325
- private updateFormFieldHighlights;
326
- private isOffsetModified;
327
- private setFormRowModified;
328
- /**
329
- * Show a message in the message panel.
330
- */
331
- private showMessage;
332
- /**
333
- * Apply syntax highlighting to SVG textarea.
334
- */
335
- private highlightSvg;
336
- /**
337
- * Apply syntax highlighting to JS textarea.
338
- */
339
- private highlightJs;
340
- /**
341
- * Sync scroll position for SVG textarea and highlight container.
342
- */
343
- private syncSvgScroll;
344
- /**
345
- * Sync scroll position for JS textarea and highlight container.
346
- */
347
- private syncJsScroll;
348
- /**
349
- * Fire a custom event.
350
- */
351
- private fireEvent;
352
- /**
353
- * Get component styles.
354
- */
355
- private getStyles;
356
- }
@@ -1,32 +0,0 @@
1
- import { OperationHint } from "../settings/hint-models";
2
- /**
3
- * String name-value pair used for hint variables.
4
- */
5
- export interface StringPair {
6
- name: string;
7
- value: string;
8
- }
9
- /**
10
- * Data model for the hint designer component.
11
- */
12
- export interface HintDesignerData {
13
- /** Dictionary of hints, keyed by hint ID */
14
- hints: Record<string, OperationHint>;
15
- /** Catalog of animation JS code fragments, keyed by ID */
16
- animations: Record<string, string>;
17
- }
18
- /**
19
- * Settings for the hint designer component.
20
- */
21
- export interface HintDesignerSettings {
22
- /** Width of the hint's SVG design area in the editor */
23
- hintDesignWidth: number;
24
- /** Height of the hint's SVG design area in the editor */
25
- hintDesignHeight: number;
26
- /** Debug mode for verbose logging */
27
- debug: boolean;
28
- }
29
- /**
30
- * Default settings for the hint designer component.
31
- */
32
- export declare const DEFAULT_HINT_DESIGNER_SETTINGS: HintDesignerSettings;
@@ -1,17 +0,0 @@
1
- /**
2
- * GVE Snapshot Rendition Component
3
- *
4
- * A web component for rendering interactive text transformations
5
- * based on the GVE snapshot model.
6
- */
7
- export { GveSnapshotRendition } from "./core/gve-snapshot-rendition";
8
- export { GveHintDesigner } from "./hint-designer/gve-hint-designer";
9
- export type { RelativePosition } from "./core/gve-snapshot-rendition";
10
- export type { GveRenditionSettings, CustomButtonSettings, } from "./settings/settings";
11
- export type { OperationHint } from "./settings/hint-models";
12
- export { DEFAULT_SETTINGS } from "./settings/settings";
13
- export type { HintDesignerData, HintDesignerSettings, StringPair, } from "./hint-designer/hint-designer-models";
14
- export { DEFAULT_HINT_DESIGNER_SETTINGS } from "./hint-designer/hint-designer-models";
15
- export { OperationSummaryService } from "./ui/operation-summary-service";
16
- export type { Feature, OperationFeature, OperationSource, OperationDiplomatics, OperationMetadata, CharChainOperation, CharNode, ChainOperationContextStep, CharChainResult, ChainOperationTags, CharChainNode, CharChainLink, CharChain, } from "./models";
17
- export { FeatureSetPolicy, OperationType } from "./models";
@@ -1,171 +0,0 @@
1
- /**
2
- * Generic name=value feature.
3
- */
4
- export interface Feature {
5
- name: string;
6
- value: string;
7
- setPolicy: FeatureSetPolicy;
8
- }
9
- /**
10
- * Operation feature set policy.
11
- */
12
- export declare enum FeatureSetPolicy {
13
- multiple = 0,
14
- single = 1,
15
- singleFirst = 2
16
- }
17
- /**
18
- * Operation feature.
19
- */
20
- export interface OperationFeature extends Feature {
21
- isNegated?: boolean;
22
- isGlobal?: boolean;
23
- isShortLived?: boolean;
24
- }
25
- /**
26
- * Source about a text variant. This is typically used when
27
- * variants come from different witnesses.
28
- */
29
- export interface OperationSource {
30
- id: string;
31
- type: string;
32
- rank?: number;
33
- note?: string;
34
- }
35
- /**
36
- * Diplomatic data for a text variant.
37
- */
38
- export interface OperationDiplomatics {
39
- g: string;
40
- isNewTextHidden?: boolean;
41
- features?: Feature[];
42
- elementFeatures?: Record<string, Feature[]>;
43
- }
44
- /**
45
- * Generic metadata about a text variant generation operation.
46
- */
47
- export interface OperationMetadata {
48
- type: OperationType;
49
- id: string;
50
- rank?: number;
51
- groupId?: string;
52
- features?: OperationFeature[];
53
- sources?: OperationSource[];
54
- diplomatics?: OperationDiplomatics;
55
- }
56
- /**
57
- * Type of a text operation.
58
- */
59
- export declare enum OperationType {
60
- replace = 0,
61
- delete = 1,
62
- addBefore = 2,
63
- addAfter = 3,
64
- moveBefore = 4,
65
- moveAfter = 5,
66
- swap = 6,
67
- annotate = 7
68
- }
69
- /**
70
- * Metadata of a char-based chain operation.
71
- */
72
- export interface CharChainOperation extends OperationMetadata {
73
- at: number;
74
- atAsIndex?: boolean;
75
- to?: number;
76
- toAsIndex?: boolean;
77
- inputTag?: string;
78
- outputTag?: string;
79
- run: number;
80
- toRun?: number;
81
- value?: string;
82
- noTraceFeatures?: boolean;
83
- dsl?: string;
84
- }
85
- /**
86
- * A single character node in an operation execution result.
87
- */
88
- export interface CharNode {
89
- id: number;
90
- index: number;
91
- label: string;
92
- data: string;
93
- sourceTag?: string;
94
- /** Features keyed by version tag (e.g. "v1" → feature list). */
95
- features?: Record<string, Feature[]>;
96
- }
97
- /**
98
- * Execution step of a char-based chain operation.
99
- */
100
- export interface ChainOperationContextStep {
101
- /** The operation that was executed. */
102
- operation: CharChainOperation;
103
- /** The input version tag. */
104
- inputTag: string;
105
- /** The output version tag. */
106
- outputTag: string;
107
- /** The string synthetically representing the resulting text version. */
108
- result?: string;
109
- /** The reference node IDs of the operation which was executed. */
110
- refNodeIds: number[];
111
- }
112
- /**
113
- * Result of execution of a char-based chain.
114
- */
115
- export interface CharChainResult {
116
- /** The execution steps of the chain. */
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[];
122
- /**
123
- * All character nodes in the chain (base text and added nodes).
124
- * Node features are keyed by version tag.
125
- */
126
- nodes: CharNode[];
127
- /**
128
- * IDs of nodes forming each version's text, keyed by version tag.
129
- * Includes v0 (base text).
130
- */
131
- versionNodeIds: Record<string, number[]>;
132
- /**
133
- * Global features accumulated up to each version, keyed by version tag.
134
- * Includes v0 (empty list).
135
- */
136
- globalFeatures: Record<string, OperationFeature[]>;
137
- }
138
- /**
139
- * The input and output tags of a char-based chain operation.
140
- */
141
- export interface ChainOperationTags {
142
- inputTag: string;
143
- outputTag: string;
144
- }
145
- /**
146
- * The node of a character-based chain, used for diagnostic
147
- * or demonstration purposes.
148
- */
149
- export interface CharChainNode {
150
- id: number;
151
- label: string;
152
- data: string;
153
- sourceTag?: string;
154
- }
155
- /**
156
- * The link of a character-based chain, used for diagnostic
157
- * or demonstration purposes.
158
- */
159
- export interface CharChainLink {
160
- tag: string;
161
- sourceId: number;
162
- targetId: number;
163
- }
164
- /**
165
- * The character-based chain, as resulting from running operations
166
- * on a base text, used for diagnostic or demonstration purposes.
167
- */
168
- export interface CharChain {
169
- nodes: CharChainNode[];
170
- links: CharChainLink[];
171
- }
@@ -1,62 +0,0 @@
1
- import { Logger } from "../core/logger";
2
- /**
3
- * Bounding rectangle with position and dimensions.
4
- */
5
- export interface BoundingRect {
6
- x: number;
7
- y: number;
8
- width: number;
9
- height: number;
10
- right: number;
11
- bottom: number;
12
- }
13
- /**
14
- * Cache for storing bounding rectangles of SVG elements.
15
- * This avoids expensive getBBox() calls and improves spreading performance.
16
- */
17
- export declare class BoundsCache {
18
- private _cache;
19
- private _logger;
20
- constructor(logger: Logger);
21
- /**
22
- * Add or update a bounding rectangle for an element.
23
- */
24
- set(elementId: string, bounds: DOMRect | SVGRect): void;
25
- /**
26
- * Get the bounding rectangle for an element.
27
- */
28
- get(elementId: string): BoundingRect | undefined;
29
- /**
30
- * Check if an element's bounds are cached.
31
- */
32
- has(elementId: string): boolean;
33
- /**
34
- * Remove bounds for an element.
35
- */
36
- delete(elementId: string): void;
37
- /**
38
- * Clear all cached bounds.
39
- */
40
- clear(): void;
41
- /**
42
- * Get all cached element IDs.
43
- */
44
- getAllIds(): string[];
45
- /**
46
- * Get all cached bounds.
47
- */
48
- getAllBounds(): BoundingRect[];
49
- /**
50
- * Update bounds for an element by ID from the DOM.
51
- * Returns true if successful, false if element not found.
52
- */
53
- updateFromElement(element: SVGElement): boolean;
54
- /**
55
- * Get the bounding rectangle that encloses multiple elements.
56
- */
57
- getUnionBounds(elementIds: string[]): BoundingRect | undefined;
58
- /**
59
- * Get the number of cached items.
60
- */
61
- size(): number;
62
- }