@myrmidon/gve-snapshot-rendition 0.0.2 → 0.0.3
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/README.md +18 -0
- package/dist/hint-designer/gve-hint-designer.d.ts +31 -0
- package/dist/index.cjs.min.js +5 -5
- package/dist/index.cjs.min.js.map +1 -1
- package/dist/index.js +450 -124
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -16,6 +16,11 @@ Operations also inject metadata, in form of features (essentially name=value pai
|
|
|
16
16
|
|
|
17
17
|
Both hints and animations are part of the settings for the component. The component is found under [src/core/gve-snapshot-rendition.ts](src/core/gve-snapshot-rendition.ts), and most of its logic is properly encapsulated in its own set of classes, following a systematic separation of concerns to ensure flexibility, extendibility, and easy maintenance.
|
|
18
18
|
|
|
19
|
+
## Usage Guide
|
|
20
|
+
|
|
21
|
+
- [Angular integration](docs/dev/angular-integration.md)
|
|
22
|
+
- [vanilla integration](docs/dev/vanilla-integration.md)
|
|
23
|
+
|
|
19
24
|
## Documentation
|
|
20
25
|
|
|
21
26
|
Conceptual documentation and sample data:
|
|
@@ -133,3 +138,16 @@ npm unpublish @myrmidon/gve-snapshot-rendition --force
|
|
|
133
138
|
```
|
|
134
139
|
|
|
135
140
|
>⚠️ Unpublishing can break projects that depend on your package. Only do this for critical security issues or accidental publications.
|
|
141
|
+
|
|
142
|
+
Package structure:
|
|
143
|
+
|
|
144
|
+
```txt
|
|
145
|
+
@myrmidon/gve-snapshot-rendition/
|
|
146
|
+
├── dist/
|
|
147
|
+
│ ├── index.js # ES Module bundle
|
|
148
|
+
│ ├── index.d.ts # TypeScript declarations
|
|
149
|
+
│ ├── index.cjs.min.js # CommonJS bundle (minified)
|
|
150
|
+
│ └── ...
|
|
151
|
+
├── README.md
|
|
152
|
+
└── LICENSE
|
|
153
|
+
```
|
|
@@ -41,6 +41,8 @@ export declare class GveHintDesigner extends HTMLElement {
|
|
|
41
41
|
private _pauseButton?;
|
|
42
42
|
private _restartButton?;
|
|
43
43
|
private _progressBar?;
|
|
44
|
+
private _variablesValidationMsg?;
|
|
45
|
+
private _variablesPanelHeader?;
|
|
44
46
|
private _currentTimeline?;
|
|
45
47
|
private _isPlaying;
|
|
46
48
|
private _progressUpdateInterval?;
|
|
@@ -168,6 +170,11 @@ export declare class GveHintDesigner extends HTMLElement {
|
|
|
168
170
|
* Clear the hint form.
|
|
169
171
|
*/
|
|
170
172
|
private clearHintForm;
|
|
173
|
+
/**
|
|
174
|
+
* Validate SVG code for well-formedness and structure.
|
|
175
|
+
* Returns an error message if validation fails, or null if valid.
|
|
176
|
+
*/
|
|
177
|
+
private validateSvgCode;
|
|
171
178
|
/**
|
|
172
179
|
* Add a new hint.
|
|
173
180
|
*/
|
|
@@ -192,6 +199,19 @@ export declare class GveHintDesigner extends HTMLElement {
|
|
|
192
199
|
* Resolve variables in SVG code.
|
|
193
200
|
*/
|
|
194
201
|
private resolveVariables;
|
|
202
|
+
/**
|
|
203
|
+
* Extract variable names from SVG code (variables in {{...}} placeholders).
|
|
204
|
+
*/
|
|
205
|
+
private extractVariablesFromSvg;
|
|
206
|
+
/**
|
|
207
|
+
* Validate SVG variables and update validation message.
|
|
208
|
+
* Shows a warning if any variables used in SVG are not defined in hint variables.
|
|
209
|
+
*/
|
|
210
|
+
private validateSvgVariables;
|
|
211
|
+
/**
|
|
212
|
+
* Update warning icon in variables panel header.
|
|
213
|
+
*/
|
|
214
|
+
private updateVariablesHeaderWarning;
|
|
195
215
|
/**
|
|
196
216
|
* Play animation.
|
|
197
217
|
*/
|
|
@@ -280,6 +300,17 @@ export declare class GveHintDesigner extends HTMLElement {
|
|
|
280
300
|
* Delete all variables.
|
|
281
301
|
*/
|
|
282
302
|
private deleteAllVariables;
|
|
303
|
+
/**
|
|
304
|
+
* Extract all variable names from all hints in data.
|
|
305
|
+
* Returns a sorted array of unique variable names.
|
|
306
|
+
*/
|
|
307
|
+
private extractAllVariablesFromHints;
|
|
308
|
+
/**
|
|
309
|
+
* Populate hint variables from all hints.
|
|
310
|
+
* Extracts all variables from all hints' SVG code and merges them into hintVariables.
|
|
311
|
+
* Only adds variables that don't already exist.
|
|
312
|
+
*/
|
|
313
|
+
private populateVariablesFromHints;
|
|
283
314
|
/**
|
|
284
315
|
* Refresh the variables table.
|
|
285
316
|
*/
|