@grandgular/rive-angular 0.2.0 → 0.3.0
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
CHANGED
|
@@ -142,6 +142,55 @@ export class InteractiveComponent {
|
|
|
142
142
|
}
|
|
143
143
|
```
|
|
144
144
|
|
|
145
|
+
### Text Runs
|
|
146
|
+
|
|
147
|
+
Rive text runs allow you to update text content at runtime. The library provides two approaches:
|
|
148
|
+
|
|
149
|
+
#### Declarative (Controlled Keys)
|
|
150
|
+
|
|
151
|
+
Use the `textRuns` input for reactive, template-driven text updates:
|
|
152
|
+
|
|
153
|
+
```html
|
|
154
|
+
<rive-canvas
|
|
155
|
+
src="assets/hello.riv"
|
|
156
|
+
[textRuns]="{ greeting: userName(), subtitle: 'Welcome' }"
|
|
157
|
+
/>
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Keys present in `textRuns` are **controlled** — the input is the source of truth and will override any imperative changes.
|
|
161
|
+
|
|
162
|
+
#### Imperative (Uncontrolled Keys)
|
|
163
|
+
|
|
164
|
+
Use methods for reading values or managing keys not in `textRuns`:
|
|
165
|
+
|
|
166
|
+
```typescript
|
|
167
|
+
riveRef = viewChild.required(RiveCanvasComponent);
|
|
168
|
+
|
|
169
|
+
// Read current value
|
|
170
|
+
const greeting = this.riveRef().getTextRunValue('greeting');
|
|
171
|
+
|
|
172
|
+
// Set uncontrolled key
|
|
173
|
+
this.riveRef().setTextRunValue('dynamicText', 'New value');
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
#### Nested Text Runs
|
|
177
|
+
|
|
178
|
+
For text runs inside nested components, use the `AtPath` variants:
|
|
179
|
+
|
|
180
|
+
```typescript
|
|
181
|
+
this.riveRef().setTextRunValueAtPath(
|
|
182
|
+
'button_text',
|
|
183
|
+
'Click Me',
|
|
184
|
+
'NestedArtboard/ButtonComponent'
|
|
185
|
+
);
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
#### Controlled vs Uncontrolled
|
|
189
|
+
|
|
190
|
+
- **Controlled**: Keys in `textRuns` input — managed by Angular, input is source of truth
|
|
191
|
+
- **Uncontrolled**: Keys not in `textRuns` — managed imperatively via methods
|
|
192
|
+
- **Warning**: Calling `setTextRunValue()` on a controlled key logs a warning and the change will be overwritten on next input update
|
|
193
|
+
|
|
145
194
|
### Preloading files with RiveFileService
|
|
146
195
|
|
|
147
196
|
For better performance, you can preload and cache .riv files:
|
|
@@ -252,6 +301,7 @@ In this case, `onError` receives a `RiveValidationError` with code `RIVE_201`, a
|
|
|
252
301
|
| `RIVE_202` | Validation | Animation not found |
|
|
253
302
|
| `RIVE_203` | Validation | State machine not found |
|
|
254
303
|
| `RIVE_204` | Validation | Input/Trigger not found in State Machine |
|
|
304
|
+
| `RIVE_205` | Validation | Text run not found |
|
|
255
305
|
| `RIVE_301` | Config | No animation source provided |
|
|
256
306
|
| `RIVE_302` | Config | Invalid canvas element |
|
|
257
307
|
|
|
@@ -277,6 +327,7 @@ In this case, `onError` receives a `RiveValidationError` with code `RIVE_201`, a
|
|
|
277
327
|
| `shouldDisableRiveListeners` | `boolean` | `false` | Disable Rive event listeners |
|
|
278
328
|
| `automaticallyHandleEvents` | `boolean` | `false` | Auto-handle Rive events (e.g., OpenUrlEvent) |
|
|
279
329
|
| `debugMode` | `boolean` | `undefined` | Enable verbose logging for this instance |
|
|
330
|
+
| `textRuns` | `Record<string, string>` | - | Declarative text run values. Keys present are controlled by input. |
|
|
280
331
|
|
|
281
332
|
#### Outputs
|
|
282
333
|
|
|
@@ -311,6 +362,10 @@ All signals are **readonly** and cannot be mutated externally. Use the public me
|
|
|
311
362
|
| `reset()` | Reset animation to beginning |
|
|
312
363
|
| `setInput(stateMachine: string, input: string, value: number \| boolean)` | Set state machine input value |
|
|
313
364
|
| `fireTrigger(stateMachine: string, trigger: string)` | Fire state machine trigger |
|
|
365
|
+
| `getTextRunValue(name: string): string \| undefined` | Get text run value |
|
|
366
|
+
| `setTextRunValue(name: string, value: string)` | Set text run value (warns if key is controlled) |
|
|
367
|
+
| `getTextRunValueAtPath(name: string, path: string): string \| undefined` | Get nested text run value |
|
|
368
|
+
| `setTextRunValueAtPath(name: string, value: string, path: string)` | Set nested text run |
|
|
314
369
|
|
|
315
370
|
### RiveFileService
|
|
316
371
|
|
|
@@ -73,6 +73,7 @@ var RiveErrorCode;
|
|
|
73
73
|
RiveErrorCode["AnimationNotFound"] = "RIVE_202";
|
|
74
74
|
RiveErrorCode["StateMachineNotFound"] = "RIVE_203";
|
|
75
75
|
RiveErrorCode["InputNotFound"] = "RIVE_204";
|
|
76
|
+
RiveErrorCode["TextRunNotFound"] = "RIVE_205";
|
|
76
77
|
// Configuration Errors
|
|
77
78
|
RiveErrorCode["NoSource"] = "RIVE_301";
|
|
78
79
|
RiveErrorCode["InvalidCanvas"] = "RIVE_302";
|
|
@@ -89,6 +90,7 @@ const ERROR_MESSAGES = {
|
|
|
89
90
|
[RiveErrorCode.AnimationNotFound]: 'Animation "{name}" not found',
|
|
90
91
|
[RiveErrorCode.StateMachineNotFound]: 'State machine "{name}" not found',
|
|
91
92
|
[RiveErrorCode.InputNotFound]: 'Input "{name}" not found in "{stateMachine}"',
|
|
93
|
+
[RiveErrorCode.TextRunNotFound]: 'Text run "{name}" not found',
|
|
92
94
|
[RiveErrorCode.NoSource]: 'No animation source provided',
|
|
93
95
|
[RiveErrorCode.InvalidCanvas]: 'Invalid canvas element',
|
|
94
96
|
};
|
|
@@ -466,6 +468,13 @@ class RiveCanvasComponent {
|
|
|
466
468
|
* - false/undefined: use global level
|
|
467
469
|
*/
|
|
468
470
|
debugMode = input(...(ngDevMode ? [undefined, { debugName: "debugMode" }] : []));
|
|
471
|
+
/**
|
|
472
|
+
* Record of text run names to values for declarative text setting.
|
|
473
|
+
* Keys present in this input are CONTROLLED — the input is the source of truth.
|
|
474
|
+
* Keys absent from this input are UNCONTROLLED — managed imperatively.
|
|
475
|
+
* Values are applied reactively when input changes.
|
|
476
|
+
*/
|
|
477
|
+
textRuns = input(...(ngDevMode ? [undefined, { debugName: "textRuns" }] : []));
|
|
469
478
|
// Outputs (Events)
|
|
470
479
|
loaded = output();
|
|
471
480
|
loadError = output();
|
|
@@ -542,6 +551,16 @@ class RiveCanvasComponent {
|
|
|
542
551
|
}
|
|
543
552
|
});
|
|
544
553
|
});
|
|
554
|
+
// Effect to apply text runs when input changes or animation loads
|
|
555
|
+
effect(() => {
|
|
556
|
+
const runs = this.textRuns();
|
|
557
|
+
const isLoaded = this.#isLoaded();
|
|
558
|
+
untracked(() => {
|
|
559
|
+
if (runs && isLoaded && this.#rive) {
|
|
560
|
+
this.applyTextRuns(runs);
|
|
561
|
+
}
|
|
562
|
+
});
|
|
563
|
+
});
|
|
545
564
|
// Auto cleanup on destroy
|
|
546
565
|
this.#destroyRef.onDestroy(() => {
|
|
547
566
|
this.cleanupRive();
|
|
@@ -933,6 +952,104 @@ class RiveCanvasComponent {
|
|
|
933
952
|
}
|
|
934
953
|
});
|
|
935
954
|
}
|
|
955
|
+
/**
|
|
956
|
+
* Get the current value of a text run.
|
|
957
|
+
* Returns undefined if the text run doesn't exist or Rive instance is not loaded.
|
|
958
|
+
*/
|
|
959
|
+
getTextRunValue(textRunName) {
|
|
960
|
+
if (!this.#rive)
|
|
961
|
+
return undefined;
|
|
962
|
+
try {
|
|
963
|
+
return this.#ngZone.runOutsideAngular(() => {
|
|
964
|
+
return this.#rive.getTextRunValue(textRunName);
|
|
965
|
+
});
|
|
966
|
+
}
|
|
967
|
+
catch (error) {
|
|
968
|
+
this.logger.warn(`Failed to get text run "${textRunName}":`, error);
|
|
969
|
+
return undefined;
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
/**
|
|
973
|
+
* Set a text run value.
|
|
974
|
+
* Warning: If the text run is controlled by textRuns input, this change will be overwritten
|
|
975
|
+
* on the next input update.
|
|
976
|
+
*/
|
|
977
|
+
setTextRunValue(textRunName, textRunValue) {
|
|
978
|
+
if (!this.#rive)
|
|
979
|
+
return;
|
|
980
|
+
// Check if this key is controlled by textRuns input
|
|
981
|
+
const controlledRuns = this.textRuns();
|
|
982
|
+
if (controlledRuns && textRunName in controlledRuns) {
|
|
983
|
+
this.logger.warn(`Text run "${textRunName}" is controlled by textRuns input. This change will be overwritten on next input update.`);
|
|
984
|
+
}
|
|
985
|
+
this.#ngZone.runOutsideAngular(() => {
|
|
986
|
+
try {
|
|
987
|
+
this.#rive.setTextRunValue(textRunName, textRunValue);
|
|
988
|
+
this.logger.debug(`Text run "${textRunName}" set to "${textRunValue}"`);
|
|
989
|
+
}
|
|
990
|
+
catch (error) {
|
|
991
|
+
this.logger.warn(`Failed to set text run "${textRunName}":`, error);
|
|
992
|
+
this.#ngZone.run(() => this.loadError.emit(new RiveValidationError(formatErrorMessage(RiveErrorCode.TextRunNotFound, {
|
|
993
|
+
name: textRunName,
|
|
994
|
+
}), RiveErrorCode.TextRunNotFound)));
|
|
995
|
+
}
|
|
996
|
+
});
|
|
997
|
+
}
|
|
998
|
+
/**
|
|
999
|
+
* Get the current value of a text run at a specific path (for nested artboards/components).
|
|
1000
|
+
* Returns undefined if the text run doesn't exist or Rive instance is not loaded.
|
|
1001
|
+
*/
|
|
1002
|
+
getTextRunValueAtPath(textRunName, path) {
|
|
1003
|
+
if (!this.#rive)
|
|
1004
|
+
return undefined;
|
|
1005
|
+
try {
|
|
1006
|
+
return this.#ngZone.runOutsideAngular(() => {
|
|
1007
|
+
return this.#rive.getTextRunValueAtPath(textRunName, path);
|
|
1008
|
+
});
|
|
1009
|
+
}
|
|
1010
|
+
catch (error) {
|
|
1011
|
+
this.logger.warn(`Failed to get text run "${textRunName}" at path "${path}":`, error);
|
|
1012
|
+
return undefined;
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
/**
|
|
1016
|
+
* Set a text run value at a specific path (for nested artboards/components).
|
|
1017
|
+
* Note: AtPath text runs are always uncontrolled (not managed by textRuns input).
|
|
1018
|
+
*/
|
|
1019
|
+
setTextRunValueAtPath(textRunName, textRunValue, path) {
|
|
1020
|
+
if (!this.#rive)
|
|
1021
|
+
return;
|
|
1022
|
+
this.#ngZone.runOutsideAngular(() => {
|
|
1023
|
+
try {
|
|
1024
|
+
this.#rive.setTextRunValueAtPath(textRunName, textRunValue, path);
|
|
1025
|
+
this.logger.debug(`Text run "${textRunName}" at path "${path}" set to "${textRunValue}"`);
|
|
1026
|
+
}
|
|
1027
|
+
catch (error) {
|
|
1028
|
+
this.logger.warn(`Failed to set text run "${textRunName}" at path "${path}":`, error);
|
|
1029
|
+
this.#ngZone.run(() => this.loadError.emit(new RiveValidationError(formatErrorMessage(RiveErrorCode.TextRunNotFound, {
|
|
1030
|
+
name: textRunName,
|
|
1031
|
+
}), RiveErrorCode.TextRunNotFound)));
|
|
1032
|
+
}
|
|
1033
|
+
});
|
|
1034
|
+
}
|
|
1035
|
+
/**
|
|
1036
|
+
* Apply all text runs from input (controlled keys).
|
|
1037
|
+
* Called on every input change or load.
|
|
1038
|
+
*/
|
|
1039
|
+
applyTextRuns(runs) {
|
|
1040
|
+
this.#ngZone.runOutsideAngular(() => {
|
|
1041
|
+
for (const [name, value] of Object.entries(runs)) {
|
|
1042
|
+
try {
|
|
1043
|
+
this.#rive.setTextRunValue(name, value);
|
|
1044
|
+
this.logger.debug(`Text run "${name}" set to "${value}"`);
|
|
1045
|
+
}
|
|
1046
|
+
catch (error) {
|
|
1047
|
+
this.logger.warn(`Failed to set text run "${name}":`, error);
|
|
1048
|
+
this.#ngZone.run(() => this.loadError.emit(new RiveValidationError(formatErrorMessage(RiveErrorCode.TextRunNotFound, { name }), RiveErrorCode.TextRunNotFound)));
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
});
|
|
1052
|
+
}
|
|
936
1053
|
/**
|
|
937
1054
|
* Clean up Rive instance only
|
|
938
1055
|
*/
|
|
@@ -953,7 +1070,7 @@ class RiveCanvasComponent {
|
|
|
953
1070
|
this.#isPaused.set(false);
|
|
954
1071
|
}
|
|
955
1072
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: RiveCanvasComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
956
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.1.4", type: RiveCanvasComponent, isStandalone: true, selector: "rive-canvas", inputs: { src: { classPropertyName: "src", publicName: "src", isSignal: true, isRequired: false, transformFunction: null }, buffer: { classPropertyName: "buffer", publicName: "buffer", isSignal: true, isRequired: false, transformFunction: null }, riveFile: { classPropertyName: "riveFile", publicName: "riveFile", isSignal: true, isRequired: false, transformFunction: null }, artboard: { classPropertyName: "artboard", publicName: "artboard", isSignal: true, isRequired: false, transformFunction: null }, animations: { classPropertyName: "animations", publicName: "animations", isSignal: true, isRequired: false, transformFunction: null }, stateMachines: { classPropertyName: "stateMachines", publicName: "stateMachines", isSignal: true, isRequired: false, transformFunction: null }, autoplay: { classPropertyName: "autoplay", publicName: "autoplay", isSignal: true, isRequired: false, transformFunction: null }, fit: { classPropertyName: "fit", publicName: "fit", isSignal: true, isRequired: false, transformFunction: null }, alignment: { classPropertyName: "alignment", publicName: "alignment", isSignal: true, isRequired: false, transformFunction: null }, useOffscreenRenderer: { classPropertyName: "useOffscreenRenderer", publicName: "useOffscreenRenderer", isSignal: true, isRequired: false, transformFunction: null }, shouldUseIntersectionObserver: { classPropertyName: "shouldUseIntersectionObserver", publicName: "shouldUseIntersectionObserver", isSignal: true, isRequired: false, transformFunction: null }, shouldDisableRiveListeners: { classPropertyName: "shouldDisableRiveListeners", publicName: "shouldDisableRiveListeners", isSignal: true, isRequired: false, transformFunction: null }, automaticallyHandleEvents: { classPropertyName: "automaticallyHandleEvents", publicName: "automaticallyHandleEvents", isSignal: true, isRequired: false, transformFunction: null }, debugMode: { classPropertyName: "debugMode", publicName: "debugMode", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { loaded: "loaded", loadError: "loadError", stateChange: "stateChange", riveEvent: "riveEvent", riveReady: "riveReady" }, viewQueries: [{ propertyName: "canvas", first: true, predicate: ["canvas"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
1073
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.1.4", type: RiveCanvasComponent, isStandalone: true, selector: "rive-canvas", inputs: { src: { classPropertyName: "src", publicName: "src", isSignal: true, isRequired: false, transformFunction: null }, buffer: { classPropertyName: "buffer", publicName: "buffer", isSignal: true, isRequired: false, transformFunction: null }, riveFile: { classPropertyName: "riveFile", publicName: "riveFile", isSignal: true, isRequired: false, transformFunction: null }, artboard: { classPropertyName: "artboard", publicName: "artboard", isSignal: true, isRequired: false, transformFunction: null }, animations: { classPropertyName: "animations", publicName: "animations", isSignal: true, isRequired: false, transformFunction: null }, stateMachines: { classPropertyName: "stateMachines", publicName: "stateMachines", isSignal: true, isRequired: false, transformFunction: null }, autoplay: { classPropertyName: "autoplay", publicName: "autoplay", isSignal: true, isRequired: false, transformFunction: null }, fit: { classPropertyName: "fit", publicName: "fit", isSignal: true, isRequired: false, transformFunction: null }, alignment: { classPropertyName: "alignment", publicName: "alignment", isSignal: true, isRequired: false, transformFunction: null }, useOffscreenRenderer: { classPropertyName: "useOffscreenRenderer", publicName: "useOffscreenRenderer", isSignal: true, isRequired: false, transformFunction: null }, shouldUseIntersectionObserver: { classPropertyName: "shouldUseIntersectionObserver", publicName: "shouldUseIntersectionObserver", isSignal: true, isRequired: false, transformFunction: null }, shouldDisableRiveListeners: { classPropertyName: "shouldDisableRiveListeners", publicName: "shouldDisableRiveListeners", isSignal: true, isRequired: false, transformFunction: null }, automaticallyHandleEvents: { classPropertyName: "automaticallyHandleEvents", publicName: "automaticallyHandleEvents", isSignal: true, isRequired: false, transformFunction: null }, debugMode: { classPropertyName: "debugMode", publicName: "debugMode", isSignal: true, isRequired: false, transformFunction: null }, textRuns: { classPropertyName: "textRuns", publicName: "textRuns", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { loaded: "loaded", loadError: "loadError", stateChange: "stateChange", riveEvent: "riveEvent", riveReady: "riveReady" }, viewQueries: [{ propertyName: "canvas", first: true, predicate: ["canvas"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
957
1074
|
<canvas #canvas [style.width.%]="100" [style.height.%]="100"></canvas>
|
|
958
1075
|
`, isInline: true, styles: [":host{display:block;width:100%;height:100%}canvas{display:block}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
959
1076
|
}
|
|
@@ -962,7 +1079,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.4", ngImpor
|
|
|
962
1079
|
args: [{ selector: 'rive-canvas', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
963
1080
|
<canvas #canvas [style.width.%]="100" [style.height.%]="100"></canvas>
|
|
964
1081
|
`, styles: [":host{display:block;width:100%;height:100%}canvas{display:block}\n"] }]
|
|
965
|
-
}], ctorParameters: () => [], propDecorators: { canvas: [{ type: i0.ViewChild, args: ['canvas', { isSignal: true }] }], src: [{ type: i0.Input, args: [{ isSignal: true, alias: "src", required: false }] }], buffer: [{ type: i0.Input, args: [{ isSignal: true, alias: "buffer", required: false }] }], riveFile: [{ type: i0.Input, args: [{ isSignal: true, alias: "riveFile", required: false }] }], artboard: [{ type: i0.Input, args: [{ isSignal: true, alias: "artboard", required: false }] }], animations: [{ type: i0.Input, args: [{ isSignal: true, alias: "animations", required: false }] }], stateMachines: [{ type: i0.Input, args: [{ isSignal: true, alias: "stateMachines", required: false }] }], autoplay: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoplay", required: false }] }], fit: [{ type: i0.Input, args: [{ isSignal: true, alias: "fit", required: false }] }], alignment: [{ type: i0.Input, args: [{ isSignal: true, alias: "alignment", required: false }] }], useOffscreenRenderer: [{ type: i0.Input, args: [{ isSignal: true, alias: "useOffscreenRenderer", required: false }] }], shouldUseIntersectionObserver: [{ type: i0.Input, args: [{ isSignal: true, alias: "shouldUseIntersectionObserver", required: false }] }], shouldDisableRiveListeners: [{ type: i0.Input, args: [{ isSignal: true, alias: "shouldDisableRiveListeners", required: false }] }], automaticallyHandleEvents: [{ type: i0.Input, args: [{ isSignal: true, alias: "automaticallyHandleEvents", required: false }] }], debugMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "debugMode", required: false }] }], loaded: [{ type: i0.Output, args: ["loaded"] }], loadError: [{ type: i0.Output, args: ["loadError"] }], stateChange: [{ type: i0.Output, args: ["stateChange"] }], riveEvent: [{ type: i0.Output, args: ["riveEvent"] }], riveReady: [{ type: i0.Output, args: ["riveReady"] }] } });
|
|
1082
|
+
}], ctorParameters: () => [], propDecorators: { canvas: [{ type: i0.ViewChild, args: ['canvas', { isSignal: true }] }], src: [{ type: i0.Input, args: [{ isSignal: true, alias: "src", required: false }] }], buffer: [{ type: i0.Input, args: [{ isSignal: true, alias: "buffer", required: false }] }], riveFile: [{ type: i0.Input, args: [{ isSignal: true, alias: "riveFile", required: false }] }], artboard: [{ type: i0.Input, args: [{ isSignal: true, alias: "artboard", required: false }] }], animations: [{ type: i0.Input, args: [{ isSignal: true, alias: "animations", required: false }] }], stateMachines: [{ type: i0.Input, args: [{ isSignal: true, alias: "stateMachines", required: false }] }], autoplay: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoplay", required: false }] }], fit: [{ type: i0.Input, args: [{ isSignal: true, alias: "fit", required: false }] }], alignment: [{ type: i0.Input, args: [{ isSignal: true, alias: "alignment", required: false }] }], useOffscreenRenderer: [{ type: i0.Input, args: [{ isSignal: true, alias: "useOffscreenRenderer", required: false }] }], shouldUseIntersectionObserver: [{ type: i0.Input, args: [{ isSignal: true, alias: "shouldUseIntersectionObserver", required: false }] }], shouldDisableRiveListeners: [{ type: i0.Input, args: [{ isSignal: true, alias: "shouldDisableRiveListeners", required: false }] }], automaticallyHandleEvents: [{ type: i0.Input, args: [{ isSignal: true, alias: "automaticallyHandleEvents", required: false }] }], debugMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "debugMode", required: false }] }], textRuns: [{ type: i0.Input, args: [{ isSignal: true, alias: "textRuns", required: false }] }], loaded: [{ type: i0.Output, args: ["loaded"] }], loadError: [{ type: i0.Output, args: ["loadError"] }], stateChange: [{ type: i0.Output, args: ["stateChange"] }], riveEvent: [{ type: i0.Output, args: ["riveEvent"] }], riveReady: [{ type: i0.Output, args: ["riveReady"] }] } });
|
|
966
1083
|
|
|
967
1084
|
/**
|
|
968
1085
|
* Service for preloading and caching Rive files.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grandgular-rive-angular.mjs","sources":["../../../../libs/rive-angular/src/lib/models/rive.model.ts","../../../../libs/rive-angular/src/lib/utils/error-codes.ts","../../../../libs/rive-angular/src/lib/utils/element-observer.ts","../../../../libs/rive-angular/src/lib/utils/debug-config.ts","../../../../libs/rive-angular/src/lib/utils/logger.ts","../../../../libs/rive-angular/src/lib/utils/validator.ts","../../../../libs/rive-angular/src/lib/components/rive-canvas.component.ts","../../../../libs/rive-angular/src/lib/services/rive-file.service.ts","../../../../libs/rive-angular/src/index.ts","../../../../libs/rive-angular/src/grandgular-rive-angular.ts"],"sourcesContent":["import { RiveErrorCode } from '../utils';\n\n/**\n * Re-export Rive SDK types for consumer convenience\n */\nexport { Fit, Alignment, EventType } from '@rive-app/canvas';\nexport type { Event as RiveEvent } from '@rive-app/canvas';\n\n/**\n * Options for constructing a RiveLoadError with detailed context.\n */\nexport interface RiveErrorOptions {\n message: string;\n code?: RiveErrorCode;\n suggestion?: string;\n docsUrl?: string;\n cause?: unknown;\n}\n\n/**\n * Error thrown when Rive animation fails to load.\n * Supports legacy constructor for backward compatibility.\n */\nexport class RiveLoadError extends Error {\n public readonly code?: RiveErrorCode;\n public readonly suggestion?: string;\n public readonly docsUrl?: string;\n public readonly originalError?: Error;\n\n constructor(\n messageOrOptions: string | RiveErrorOptions,\n originalError?: unknown,\n ) {\n if (typeof messageOrOptions === 'string') {\n // Legacy constructor: new RiveLoadError(message, originalError)\n super(messageOrOptions);\n this.originalError =\n originalError instanceof Error ? originalError : undefined;\n } else {\n // New constructor: new RiveLoadError(options)\n super(messageOrOptions.message);\n this.code = messageOrOptions.code;\n this.suggestion = messageOrOptions.suggestion;\n this.docsUrl = messageOrOptions.docsUrl;\n this.originalError =\n messageOrOptions.cause instanceof Error\n ? messageOrOptions.cause\n : undefined;\n }\n this.name = 'RiveLoadError';\n }\n}\n\n/**\n * Error thrown when validation fails (e.g. missing artboard/animation/input).\n * These errors are typically non-fatal but indicate a configuration mismatch.\n */\nexport class RiveValidationError extends Error {\n constructor(\n message: string,\n public readonly code: RiveErrorCode,\n public readonly availableOptions?: string[],\n public readonly suggestion?: string,\n ) {\n super(message);\n this.name = 'RiveValidationError';\n }\n}\n","/**\n * Error codes used throughout the Rive Angular library.\n *\n * Ranges:\n * - RIVE_1xx: Load errors (file not found, network, bad format)\n * - RIVE_2xx: Validation errors (artboard, animation, state machine mismatch)\n * - RIVE_3xx: Configuration/Usage errors (missing source, bad canvas)\n */\nexport enum RiveErrorCode {\n // Load Errors\n FileNotFound = 'RIVE_101',\n InvalidFormat = 'RIVE_102',\n NetworkError = 'RIVE_103',\n\n // Validation Errors\n ArtboardNotFound = 'RIVE_201',\n AnimationNotFound = 'RIVE_202',\n StateMachineNotFound = 'RIVE_203',\n InputNotFound = 'RIVE_204',\n\n // Configuration Errors\n NoSource = 'RIVE_301',\n InvalidCanvas = 'RIVE_302',\n}\n\n/**\n * Template messages for each error code.\n * Used by formatErrorMessage to generate user-friendly descriptions.\n */\nexport const ERROR_MESSAGES: Record<RiveErrorCode, string> = {\n [RiveErrorCode.FileNotFound]: 'File not found: {url}',\n [RiveErrorCode.InvalidFormat]: 'Invalid .riv file format',\n [RiveErrorCode.NetworkError]: 'Network error while loading file',\n [RiveErrorCode.ArtboardNotFound]: 'Artboard \"{name}\" not found',\n [RiveErrorCode.AnimationNotFound]: 'Animation \"{name}\" not found',\n [RiveErrorCode.StateMachineNotFound]: 'State machine \"{name}\" not found',\n [RiveErrorCode.InputNotFound]: 'Input \"{name}\" not found in \"{stateMachine}\"',\n [RiveErrorCode.NoSource]: 'No animation source provided',\n [RiveErrorCode.InvalidCanvas]: 'Invalid canvas element',\n};\n\n/**\n * Formats an error message by replacing placeholders with actual values.\n *\n * @param code - The error code\n * @param params - Record of values to replace in the template (e.g. { name: 'MyAnim' })\n * @returns The formatted error string\n */\nexport function formatErrorMessage(\n code: RiveErrorCode,\n params: Record<string, string> = {},\n): string {\n let message = ERROR_MESSAGES[code] || 'Unknown Rive error';\n\n for (const [key, value] of Object.entries(params)) {\n message = message.replace(`{${key}}`, value);\n }\n\n return message;\n}\n","import { Injectable, inject, PLATFORM_ID } from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\n\n/**\n * Fake IntersectionObserver for environments where it's not available (e.g., SSR)\n */\nclass FakeIntersectionObserver implements IntersectionObserver {\n readonly root: Element | Document | null = null;\n readonly rootMargin: string = '';\n readonly thresholds: ReadonlyArray<number> = [];\n\n observe(): void {\n // Intentionally empty for SSR compatibility\n }\n unobserve(): void {\n // Intentionally empty for SSR compatibility\n }\n disconnect(): void {\n // Intentionally empty for SSR compatibility\n }\n takeRecords(): IntersectionObserverEntry[] {\n return [];\n }\n}\n\nconst MyIntersectionObserver =\n (typeof globalThis !== 'undefined' && globalThis.IntersectionObserver) ||\n FakeIntersectionObserver;\n\n/**\n * Singleton IntersectionObserver wrapper for observing multiple elements\n * with individual callbacks. This avoids creating multiple IntersectionObserver\n * instances which is more efficient.\n * \n * Provided as an Angular service for better testability and DI integration.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class ElementObserver {\n private observer: IntersectionObserver;\n private elementsMap: Map<Element, (entry: IntersectionObserverEntry) => void> = new Map();\n private readonly platformId = inject(PLATFORM_ID);\n\n constructor() {\n // Only create real observer in browser environment\n if (isPlatformBrowser(this.platformId)) {\n this.observer = new MyIntersectionObserver(\n this.onObserved,\n ) as IntersectionObserver;\n } else {\n this.observer = new FakeIntersectionObserver();\n }\n }\n\n private onObserved = (entries: IntersectionObserverEntry[]): void => {\n entries.forEach((entry) => {\n const elementCallback = this.elementsMap.get(entry.target as Element);\n if (elementCallback) {\n elementCallback(entry);\n }\n });\n };\n\n public registerCallback(element: Element, callback: (entry: IntersectionObserverEntry) => void): void {\n this.observer.observe(element);\n this.elementsMap.set(element, callback);\n }\n\n public removeCallback(element: Element): void {\n this.observer.unobserve(element);\n this.elementsMap.delete(element);\n }\n}\n\n// Legacy function for backward compatibility\n// New code should inject ElementObserver directly\nlet legacyObserverInstance: ElementObserver | null = null;\n\n/**\n * @deprecated Use dependency injection instead: `inject(ElementObserver)`\n * Get the singleton ElementObserver instance\n */\nexport function getElementObserver(): ElementObserver {\n if (!legacyObserverInstance) {\n legacyObserverInstance = new ElementObserver();\n }\n return legacyObserverInstance;\n}\n","import { InjectionToken, Provider } from '@angular/core';\n\n/**\n * Log levels for Rive debugging.\n * - 'none': No output\n * - 'error': Only errors (default)\n * - 'warn': Errors and warnings\n * - 'info': High-level info (loaded, played)\n * - 'debug': Detailed logs (internal state, events)\n */\nexport type LogLevel = 'none' | 'error' | 'warn' | 'info' | 'debug';\n\n/**\n * Configuration for Rive debug mode.\n */\nexport interface RiveDebugConfig {\n logLevel: LogLevel;\n}\n\n/**\n * Injection token for global Rive debug configuration.\n * Can be provided via provideRiveDebug().\n */\nexport const RIVE_DEBUG_CONFIG = new InjectionToken<RiveDebugConfig>('RIVE_DEBUG_CONFIG');\n\n/**\n * Provides global configuration for Rive debugging.\n * Use this in your app.config.ts or module providers.\n *\n * @example\n * providers: [\n * provideRiveDebug({ logLevel: 'debug' })\n * ]\n */\nexport function provideRiveDebug(config: RiveDebugConfig): Provider {\n return {\n provide: RIVE_DEBUG_CONFIG,\n useValue: config,\n };\n}\n","import { LogLevel, RiveDebugConfig } from './debug-config';\n\n/**\n * Internal logger for Rive Angular library.\n * Handles log levels and formatting.\n * Not exported publicly.\n */\nexport class RiveLogger {\n private level: LogLevel;\n\n constructor(globalConfig?: RiveDebugConfig | null, localDebug?: boolean) {\n this.level = this.resolveLogLevel(globalConfig, localDebug);\n }\n\n /**\n * Resolve effective log level based on precedence rules:\n * 1. Local debug=true -> 'debug'\n * 2. Local debug=false/undefined -> Use global config\n * 3. No config -> 'error' (default)\n */\n private resolveLogLevel(\n globalConfig?: RiveDebugConfig | null,\n localDebug?: boolean,\n ): LogLevel {\n if (localDebug === true) {\n return 'debug';\n }\n if (globalConfig?.logLevel) {\n return globalConfig.logLevel;\n }\n return 'error';\n }\n\n /**\n * Update log level dynamically (e.g. when input changes)\n */\n public update(\n globalConfig?: RiveDebugConfig | null,\n localDebug?: boolean,\n ): void {\n this.level = this.resolveLogLevel(globalConfig, localDebug);\n }\n\n public debug(message: string, ...args: unknown[]): void {\n if (this.shouldLog('debug')) {\n console.debug(`[Rive] ${message}`, ...args);\n }\n }\n\n public info(message: string, ...args: unknown[]): void {\n if (this.shouldLog('info')) {\n console.info(`[Rive] ${message}`, ...args);\n }\n }\n\n public warn(message: string, ...args: unknown[]): void {\n if (this.shouldLog('warn')) {\n console.warn(`[Rive] ${message}`, ...args);\n }\n }\n\n public error(message: string, ...args: unknown[]): void {\n if (this.shouldLog('error')) {\n console.error(`[Rive] ${message}`, ...args);\n }\n }\n\n private shouldLog(level: LogLevel): boolean {\n const levels: LogLevel[] = ['none', 'error', 'warn', 'info', 'debug'];\n const currentIdx = levels.indexOf(this.level);\n const targetIdx = levels.indexOf(level);\n return currentIdx >= targetIdx;\n }\n}\n","import { Rive } from '@rive-app/canvas';\nimport { RiveValidationError } from '../models/rive.model';\nimport { RiveErrorCode, formatErrorMessage } from './error-codes';\nimport { RiveLogger } from './logger';\n\n/**\n * Validates requested artboard name against available artboards.\n * Returns error if not found.\n */\nexport function validateArtboard(\n rive: Rive,\n requestedName?: string,\n): RiveValidationError | null {\n if (!requestedName) return null;\n\n try {\n // Safe check: ensure artboardNames exist on runtime\n // Note: These properties exist at runtime but may not be in type definitions\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const available = (rive as any).artboardNames;\n if (!available || !available.includes(requestedName)) {\n return new RiveValidationError(\n formatErrorMessage(RiveErrorCode.ArtboardNotFound, {\n name: requestedName,\n }),\n RiveErrorCode.ArtboardNotFound,\n available || [],\n available && available.length > 0\n ? `Available artboards: ${available.join(', ')}`\n : 'No artboards found in file',\n );\n }\n } catch {\n // Graceful fallback if runtime metadata is not accessible\n // Return null silently to avoid breaking validation flow\n }\n return null;\n}\n\n/**\n * Validates requested animation names against available animations.\n * Returns first error found.\n */\nexport function validateAnimations(\n rive: Rive,\n requestedNames?: string | string[],\n): RiveValidationError | null {\n if (!requestedNames) return null;\n\n const names = Array.isArray(requestedNames)\n ? requestedNames\n : [requestedNames];\n\n try {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const available = (rive as any).animationNames;\n for (const name of names) {\n if (!available || !available.includes(name)) {\n return new RiveValidationError(\n formatErrorMessage(RiveErrorCode.AnimationNotFound, { name }),\n RiveErrorCode.AnimationNotFound,\n available || [],\n available && available.length > 0\n ? `Available animations: ${available.join(', ')}`\n : 'No animations found in file',\n );\n }\n }\n } catch {\n // Graceful fallback if runtime metadata is not accessible\n // Return null silently to avoid breaking validation flow\n }\n return null;\n}\n\n/**\n * Validates requested state machine names against available state machines.\n * Returns first error found.\n */\nexport function validateStateMachines(\n rive: Rive,\n requestedNames?: string | string[],\n): RiveValidationError | null {\n if (!requestedNames) return null;\n\n const names = Array.isArray(requestedNames)\n ? requestedNames\n : [requestedNames];\n\n try {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const available = (rive as any).stateMachineNames;\n for (const name of names) {\n if (!available || !available.includes(name)) {\n return new RiveValidationError(\n formatErrorMessage(RiveErrorCode.StateMachineNotFound, { name }),\n RiveErrorCode.StateMachineNotFound,\n available || [],\n available && available.length > 0\n ? `Available state machines: ${available.join(', ')}`\n : 'No state machines found in file',\n );\n }\n }\n } catch {\n // Graceful fallback if runtime metadata is not accessible\n // Return null silently to avoid breaking validation flow\n }\n return null;\n}\n\n/**\n * Validates if an input exists within a specific state machine.\n */\nexport function validateInput(\n rive: Rive,\n stateMachineName: string,\n inputName: string,\n): RiveValidationError | null {\n try {\n const inputs = rive.stateMachineInputs(stateMachineName);\n if (!inputs) return null; // Should not happen if SM exists\n\n const found = inputs.find((i) => i.name === inputName);\n if (!found) {\n const available = inputs.map((i) => i.name);\n return new RiveValidationError(\n formatErrorMessage(RiveErrorCode.InputNotFound, {\n name: inputName,\n stateMachine: stateMachineName,\n }),\n RiveErrorCode.InputNotFound,\n available,\n available.length > 0\n ? `Available inputs in \"${stateMachineName}\": ${available.join(', ')}`\n : `No inputs found in state machine \"${stateMachineName}\"`,\n );\n }\n } catch {\n // Graceful fallback if runtime metadata is not accessible\n // Return null silently to avoid breaking validation flow\n }\n return null;\n}\n\n/**\n * Runs full configuration validation.\n * Logs warnings and returns array of errors.\n */\nexport function validateConfiguration(\n rive: Rive,\n config: {\n artboard?: string;\n animations?: string | string[];\n stateMachines?: string | string[];\n },\n logger: RiveLogger,\n): RiveValidationError[] {\n const errors: RiveValidationError[] = [];\n\n const artboardError = validateArtboard(rive, config.artboard);\n if (artboardError) errors.push(artboardError);\n\n const animError = validateAnimations(rive, config.animations);\n if (animError) errors.push(animError);\n\n const smError = validateStateMachines(rive, config.stateMachines);\n if (smError) errors.push(smError);\n\n if (errors.length > 0) {\n logger.warn(`Validation failed with ${errors.length} errors:`);\n errors.forEach((err) => {\n logger.warn(`- ${err.message}`);\n if (err.suggestion) logger.warn(` Suggestion: ${err.suggestion}`);\n });\n }\n\n return errors;\n}\n","import {\n Component,\n ChangeDetectionStrategy,\n ElementRef,\n input,\n output,\n signal,\n effect,\n inject,\n DestroyRef,\n PLATFORM_ID,\n AfterViewInit,\n NgZone,\n viewChild,\n untracked,\n} from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n Rive,\n RiveFile,\n Layout,\n Fit,\n Alignment,\n StateMachineInput,\n type LayoutParameters,\n Event as RiveEvent,\n} from '@rive-app/canvas';\nimport { RiveLoadError } from '../models';\nimport {\n ElementObserver,\n RiveLogger,\n RIVE_DEBUG_CONFIG,\n validateConfiguration,\n validateInput,\n RiveErrorCode,\n} from '../utils';\n\n/**\n * Standalone Angular component for Rive animations\n *\n * Features:\n * - Signal-based inputs for reactive updates\n * - Automatic canvas sizing via ResizeObserver with DPR support\n * - OnPush change detection strategy\n * - SSR compatible\n * - Zoneless architecture ready\n * - Automatic resource cleanup\n * - Runs outside Angular zone for optimal performance\n *\n * @example\n * ```html\n * <rive-canvas\n * src=\"assets/animations/rive/animation.riv\"\n * [stateMachines]=\"'StateMachine'\"\n * [autoplay]=\"true\"\n * [fit]=\"Fit.Cover\"\n * [alignment]=\"Alignment.Center\"\n * (loaded)=\"onLoad()\"\n * />\n * ```\n */\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'rive-canvas',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <canvas #canvas [style.width.%]=\"100\" [style.height.%]=\"100\"></canvas>\n `,\n styles: [\n `\n :host {\n display: block;\n width: 100%;\n height: 100%;\n }\n\n canvas {\n display: block;\n }\n `,\n ],\n})\nexport class RiveCanvasComponent implements AfterViewInit {\n private readonly canvas =\n viewChild.required<ElementRef<HTMLCanvasElement>>('canvas');\n\n readonly #destroyRef = inject(DestroyRef);\n readonly #platformId = inject(PLATFORM_ID);\n readonly #ngZone = inject(NgZone);\n readonly #globalDebugConfig = inject(RIVE_DEBUG_CONFIG, { optional: true });\n readonly #elementObserver = inject(ElementObserver);\n\n public readonly src = input<string>();\n public readonly buffer = input<ArrayBuffer>();\n /**\n * Preloaded RiveFile instance (from RiveFileService).\n * If provided, this takes precedence over src/buffer.\n */\n public readonly riveFile = input<RiveFile>();\n public readonly artboard = input<string>();\n public readonly animations = input<string | string[]>();\n public readonly stateMachines = input<string | string[]>();\n public readonly autoplay = input<boolean>(true);\n public readonly fit = input<Fit>(Fit.Contain);\n public readonly alignment = input<Alignment>(Alignment.Center);\n public readonly useOffscreenRenderer = input<boolean>(false);\n /**\n * Enable IntersectionObserver to automatically stop rendering when canvas is not visible.\n * This optimizes performance by pausing animations that are off-screen.\n */\n public readonly shouldUseIntersectionObserver = input<boolean>(true);\n /**\n * Disable Rive event listeners on the canvas (pointer events, touch events).\n * Useful for decorative animations without interactivity.\n */\n public readonly shouldDisableRiveListeners = input<boolean>(false);\n /**\n * Allow Rive to automatically handle Rive Events (e.g., OpenUrlEvent opens URLs).\n * Default is false for security - events must be handled manually via riveEvent output.\n */\n public readonly automaticallyHandleEvents = input<boolean>(false);\n\n /**\n * Enable debug mode for this specific instance.\n * Overrides global configuration if set.\n * - true: 'debug' level\n * - false/undefined: use global level\n */\n public readonly debugMode = input<boolean>();\n\n // Outputs (Events)\n public readonly loaded = output<void>();\n public readonly loadError = output<Error>();\n /**\n * Emitted when state machine state changes.\n * Contains information about the state change event.\n */\n public readonly stateChange = output<RiveEvent>();\n /**\n * Emitted for Rive Events (custom events defined in the .riv file).\n * Use this to handle custom events like OpenUrlEvent, etc.\n */\n public readonly riveEvent = output<RiveEvent>();\n /**\n * Emitted when Rive instance is fully loaded and ready.\n * Provides direct access to the Rive instance for advanced use cases.\n * Note: This fires AFTER the animation is loaded, not just instantiated.\n */\n public readonly riveReady = output<Rive>();\n\n // Private writable signals\n readonly #isPlaying = signal<boolean>(false);\n readonly #isPaused = signal<boolean>(false);\n readonly #isLoaded = signal<boolean>(false);\n readonly #riveInstance = signal<Rive | null>(null);\n\n // Public readonly signals\n public readonly isPlaying = this.#isPlaying.asReadonly();\n public readonly isPaused = this.#isPaused.asReadonly();\n public readonly isLoaded = this.#isLoaded.asReadonly();\n /**\n * Public signal providing access to the Rive instance.\n * Use this to access advanced Rive SDK features.\n */\n public readonly riveInstance = this.#riveInstance.asReadonly();\n\n // Private state\n #rive: Rive | null = null;\n private readonly logger: RiveLogger;\n private resizeObserver: ResizeObserver | null = null;\n private isInitialized = false;\n private isPausedByIntersectionObserver = false;\n private retestIntersectionTimeoutId: ReturnType<typeof setTimeout> | null =\n null;\n private resizeRafId: number | null = null;\n private lastWidth = 0;\n private lastHeight = 0;\n\n constructor() {\n this.logger = new RiveLogger(this.#globalDebugConfig, this.debugMode());\n\n // Effect to update logger level when debugMode changes\n effect(() => {\n this.logger.update(this.#globalDebugConfig, this.debugMode());\n });\n\n // Effect to reload animation when src, buffer, riveFile, or configuration changes\n effect(() => {\n const src = this.src();\n const buffer = this.buffer();\n const riveFile = this.riveFile();\n // Track configuration changes to trigger reload\n this.artboard();\n this.animations();\n this.stateMachines();\n untracked(() => {\n if (\n (src || buffer || riveFile) &&\n isPlatformBrowser(this.#platformId) &&\n this.isInitialized\n )\n this.loadAnimation();\n });\n });\n\n // Effect to update layout when fit or alignment changes\n effect(() => {\n const fit = this.fit();\n const alignment = this.alignment();\n untracked(() => {\n if (this.#rive && isPlatformBrowser(this.#platformId)) {\n const layoutParams: LayoutParameters = { fit, alignment };\n this.#rive.layout = new Layout(layoutParams);\n }\n });\n });\n\n // Auto cleanup on destroy\n this.#destroyRef.onDestroy(() => {\n this.cleanupRive();\n this.disconnectResizeObserver();\n this.disconnectIntersectionObserver();\n });\n }\n\n public ngAfterViewInit(): void {\n if (isPlatformBrowser(this.#platformId)) {\n this.isInitialized = true;\n this.setupResizeObserver();\n this.setupIntersectionObserver();\n this.loadAnimation();\n }\n }\n\n /**\n * Setup ResizeObserver for automatic canvas sizing with DPR support\n */\n private setupResizeObserver(): void {\n const canvas = this.canvas().nativeElement;\n\n this.resizeObserver = new ResizeObserver((entries) => {\n // Cancel any pending resize frame\n if (this.resizeRafId) {\n cancelAnimationFrame(this.resizeRafId);\n }\n\n for (const entry of entries) {\n const { width, height } = entry.contentRect;\n\n // Skip if dimensions haven't changed (prevents unnecessary updates)\n if (width === this.lastWidth && height === this.lastHeight) {\n continue;\n }\n\n this.lastWidth = width;\n this.lastHeight = height;\n\n // Defer resize to next animation frame to prevent excessive updates in Safari\n this.resizeRafId = requestAnimationFrame(() => {\n // Read current DPR to support monitor changes and zoom\n const dpr = window.devicePixelRatio || 1;\n \n // Set canvas size with device pixel ratio for sharp rendering\n canvas.width = width * dpr;\n canvas.height = height * dpr;\n\n // Resize Rive instance if it exists\n if (this.#rive) this.#rive.resizeDrawingSurfaceToCanvas();\n });\n }\n });\n\n this.resizeObserver.observe(canvas);\n }\n\n /**\n * Disconnect ResizeObserver\n */\n private disconnectResizeObserver(): void {\n if (this.resizeRafId) {\n cancelAnimationFrame(this.resizeRafId);\n this.resizeRafId = null;\n }\n if (this.resizeObserver) {\n this.resizeObserver.disconnect();\n this.resizeObserver = null;\n }\n }\n\n /**\n * Setup IntersectionObserver to stop rendering when canvas is not visible\n */\n private setupIntersectionObserver(): void {\n if (!this.shouldUseIntersectionObserver()) return;\n\n const canvas = this.canvas().nativeElement;\n\n const onIntersectionChange = (entry: IntersectionObserverEntry): void => {\n if (entry.isIntersecting) {\n // Canvas is visible - start rendering\n if (this.#rive) {\n this.#rive.startRendering();\n }\n this.isPausedByIntersectionObserver = false;\n } else {\n // Canvas is not visible - stop rendering\n if (this.#rive) {\n this.#rive.stopRendering();\n }\n this.isPausedByIntersectionObserver = true;\n\n // Workaround for Chrome bug with insertBefore\n // Retest after 10ms if boundingClientRect.width is 0\n if (this.retestIntersectionTimeoutId) {\n clearTimeout(this.retestIntersectionTimeoutId);\n }\n\n if (entry.boundingClientRect.width === 0) {\n this.retestIntersectionTimeoutId = setTimeout(() => {\n this.retestIntersection();\n }, 10);\n }\n }\n };\n\n this.#elementObserver.registerCallback(canvas, onIntersectionChange);\n }\n\n /**\n * Retest intersection - workaround for Chrome bug\n */\n private retestIntersection(): void {\n if (!this.isPausedByIntersectionObserver) return;\n\n const canvas = this.canvas().nativeElement;\n const rect = canvas.getBoundingClientRect();\n\n const isIntersecting =\n rect.width > 0 &&\n rect.height > 0 &&\n rect.top <\n (window.innerHeight || document.documentElement.clientHeight) &&\n rect.bottom > 0 &&\n rect.left < (window.innerWidth || document.documentElement.clientWidth) &&\n rect.right > 0;\n\n if (isIntersecting && this.#rive) {\n this.#rive.startRendering();\n this.isPausedByIntersectionObserver = false;\n }\n }\n\n /**\n * Disconnect IntersectionObserver\n */\n private disconnectIntersectionObserver(): void {\n if (this.retestIntersectionTimeoutId) {\n clearTimeout(this.retestIntersectionTimeoutId);\n this.retestIntersectionTimeoutId = null;\n }\n\n if (this.shouldUseIntersectionObserver()) {\n const canvas = this.canvas().nativeElement;\n this.#elementObserver.removeCallback(canvas);\n }\n }\n\n /**\n * Load animation from src or buffer\n */\n private loadAnimation(): void {\n // Run outside Angular zone for better performance\n this.#ngZone.runOutsideAngular(() => {\n try {\n // Clean up existing Rive instance only\n this.cleanupRive();\n\n const canvas = this.canvas().nativeElement;\n const src = this.src();\n const buffer = this.buffer();\n const riveFile = this.riveFile();\n\n if (!src && !buffer && !riveFile) {\n this.logger.warn(\n 'No animation source provided (src, buffer, or riveFile)',\n );\n this.#ngZone.run(() =>\n this.loadError.emit(\n new RiveLoadError({\n message: 'No animation source provided',\n code: RiveErrorCode.NoSource,\n }),\n ),\n );\n return;\n }\n\n this.logger.info(`Loading animation`, {\n src: src || (buffer ? 'buffer' : 'riveFile'),\n canvasWidth: canvas.width,\n canvasHeight: canvas.height,\n dpr: window.devicePixelRatio,\n });\n\n // Build layout configuration\n const layoutParams: LayoutParameters = {\n fit: this.fit(),\n alignment: this.alignment(),\n };\n\n // Build typed Rive configuration\n const baseConfig = {\n canvas,\n autoplay: this.autoplay(),\n layout: new Layout(layoutParams),\n useOffscreenRenderer: this.useOffscreenRenderer(),\n shouldDisableRiveListeners: this.shouldDisableRiveListeners(),\n automaticallyHandleEvents: this.automaticallyHandleEvents(),\n onLoad: () => this.onLoad(),\n onLoadError: (error?: unknown) => this.onLoadError(error),\n onPlay: () => this.onPlay(),\n onPause: () => this.onPause(),\n onStop: () => this.onStop(),\n onStateChange: (event: RiveEvent) => this.onStateChange(event),\n onRiveEvent: (event: RiveEvent) => this.onRiveEvent(event),\n };\n\n // Add source (priority: riveFile > src > buffer)\n const sourceConfig = riveFile\n ? { riveFile }\n : src\n ? { src }\n : buffer\n ? { buffer }\n : {};\n\n // Add optional configuration\n const optionalConfig = {\n ...(this.artboard() ? { artboard: this.artboard() } : {}),\n ...(this.animations() ? { animations: this.animations() } : {}),\n ...(this.stateMachines()\n ? { stateMachines: this.stateMachines() }\n : {}),\n };\n\n // Combine all configurations\n const config = { ...baseConfig, ...sourceConfig, ...optionalConfig };\n\n this.#rive = new Rive(config);\n\n // Update public signal (riveReady will be emitted in onLoad)\n this.#ngZone.run(() => {\n this.#riveInstance.set(this.#rive);\n });\n } catch (error) {\n this.logger.error('Failed to initialize Rive instance:', error);\n this.#ngZone.run(() =>\n this.loadError.emit(\n new RiveLoadError({\n message: 'Failed to initialize Rive instance',\n code: RiveErrorCode.InvalidFormat,\n cause: error instanceof Error ? error : undefined,\n }),\n ),\n );\n }\n });\n }\n\n // Event handlers (run inside Angular zone for change detection)\n private onLoad(): void {\n // Validate loaded configuration\n if (this.#rive) {\n const validationErrors = validateConfiguration(\n this.#rive,\n {\n artboard: this.artboard(),\n animations: this.animations(),\n stateMachines: this.stateMachines(),\n },\n this.logger,\n );\n\n // Emit validation errors via loadError output\n if (validationErrors.length > 0) {\n this.#ngZone.run(() => {\n validationErrors.forEach((err) => this.loadError.emit(err));\n });\n }\n\n // Log available assets in debug mode\n // Note: These properties exist at runtime but may not be in type definitions\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const riveWithMetadata = this.#rive as any;\n this.logger.debug('Animation loaded successfully. Available assets:', {\n artboards: riveWithMetadata.artboardNames,\n animations: riveWithMetadata.animationNames,\n stateMachines: riveWithMetadata.stateMachineNames,\n });\n }\n\n this.#ngZone.run(() => {\n this.#isLoaded.set(true);\n this.loaded.emit();\n // Emit riveReady after animation is fully loaded\n if (this.#rive) {\n this.riveReady.emit(this.#rive);\n }\n });\n }\n\n private onLoadError(originalError?: unknown): void {\n this.#ngZone.run(() => {\n // Determine probable cause and code\n let code = RiveErrorCode.NetworkError;\n let message = 'Failed to load Rive animation';\n\n if (originalError instanceof Error) {\n if (originalError.message.includes('404')) {\n code = RiveErrorCode.FileNotFound;\n message = `File not found: ${this.src()}`;\n } else if (originalError.message.includes('format')) {\n code = RiveErrorCode.InvalidFormat;\n message = 'Invalid .riv file format';\n }\n }\n\n const error = new RiveLoadError({\n message,\n code,\n cause: originalError instanceof Error ? originalError : undefined,\n });\n\n this.logger.error('Rive load error:', error);\n this.loadError.emit(error);\n });\n }\n\n private onPlay(): void {\n this.#ngZone.run(() => {\n this.#isPlaying.set(true);\n this.#isPaused.set(false);\n });\n }\n\n private onPause(): void {\n this.#ngZone.run(() => {\n this.#isPlaying.set(false);\n this.#isPaused.set(true);\n });\n }\n\n private onStop(): void {\n this.#ngZone.run(() => {\n this.#isPlaying.set(false);\n this.#isPaused.set(false);\n });\n }\n\n private onStateChange(event: RiveEvent): void {\n this.#ngZone.run(() => this.stateChange.emit(event));\n }\n\n private onRiveEvent(event: RiveEvent): void {\n this.#ngZone.run(() => this.riveEvent.emit(event));\n }\n\n // Public API methods\n\n /**\n * Play animation(s)\n */\n public playAnimation(animations?: string | string[]): void {\n if (!this.#rive) return;\n\n this.#ngZone.runOutsideAngular(() => {\n if (animations) {\n this.#rive!.play(animations);\n } else {\n this.#rive!.play();\n }\n });\n }\n\n /**\n * Pause animation(s)\n */\n public pauseAnimation(animations?: string | string[]): void {\n if (!this.#rive) return;\n\n this.#ngZone.runOutsideAngular(() => {\n if (animations) {\n this.#rive!.pause(animations);\n } else {\n this.#rive!.pause();\n }\n });\n }\n\n /**\n * Stop animation(s)\n */\n public stopAnimation(animations?: string | string[]): void {\n if (!this.#rive) return;\n\n this.#ngZone.runOutsideAngular(() => {\n if (animations) {\n this.#rive!.stop(animations);\n } else {\n this.#rive!.stop();\n }\n });\n }\n\n /**\n * Reset the animation to the beginning\n */\n public reset(): void {\n if (!this.#rive) return;\n\n this.#ngZone.runOutsideAngular(() => {\n this.#rive!.reset();\n });\n }\n\n /**\n * Set a state machine input value\n */\n public setInput(\n stateMachineName: string,\n inputName: string,\n value: number | boolean,\n ): void {\n if (!this.#rive) return;\n\n this.#ngZone.runOutsideAngular(() => {\n // Validate input existence first\n const error = validateInput(this.#rive!, stateMachineName, inputName);\n if (error) {\n this.logger.warn(error.message);\n this.#ngZone.run(() => this.loadError.emit(error));\n return;\n }\n\n const inputs = this.#rive!.stateMachineInputs(stateMachineName);\n const input = inputs.find((i: StateMachineInput) => i.name === inputName);\n\n if (input && 'value' in input) {\n input.value = value;\n }\n });\n }\n\n /**\n * Fire a state machine trigger\n */\n public fireTrigger(stateMachineName: string, triggerName: string): void {\n if (!this.#rive) return;\n\n this.#ngZone.runOutsideAngular(() => {\n // Validate trigger (input) existence first\n const error = validateInput(this.#rive!, stateMachineName, triggerName);\n if (error) {\n this.logger.warn(error.message);\n this.#ngZone.run(() => this.loadError.emit(error));\n return;\n }\n\n const inputs = this.#rive!.stateMachineInputs(stateMachineName);\n const input = inputs.find(\n (i: StateMachineInput) => i.name === triggerName,\n );\n\n if (input && 'fire' in input && typeof input.fire === 'function') {\n input.fire();\n }\n });\n }\n\n /**\n * Clean up Rive instance only\n */\n private cleanupRive(): void {\n if (this.#rive) {\n try {\n this.#rive.cleanup();\n } catch (error) {\n this.logger.warn('Error during Rive cleanup:', error);\n }\n this.#rive = null;\n }\n\n // Reset signals\n this.#riveInstance.set(null);\n this.#isLoaded.set(false);\n this.#isPlaying.set(false);\n this.#isPaused.set(false);\n }\n}\n","import { Injectable, signal, Signal, inject } from '@angular/core';\nimport { RiveFile, EventType } from '@rive-app/canvas';\nimport { RIVE_DEBUG_CONFIG } from '../utils';\nimport { RiveLogger } from '../utils';\n\n/**\n * Status of RiveFile loading\n */\nexport type FileStatus = 'idle' | 'loading' | 'success' | 'failed';\n\n/**\n * State of a loaded RiveFile\n */\nexport interface RiveFileState {\n riveFile: RiveFile | null;\n status: FileStatus;\n}\n\n/**\n * Parameters for loading a RiveFile\n */\nexport interface RiveFileParams {\n src?: string;\n buffer?: ArrayBuffer;\n debug?: boolean;\n}\n\n/**\n * Cache entry for a loaded RiveFile\n */\ninterface CacheEntry {\n file: RiveFile;\n state: Signal<RiveFileState>;\n refCount: number;\n}\n\n/**\n * Pending load entry to prevent duplicate loads\n */\ninterface PendingLoad {\n stateSignal: ReturnType<typeof signal<RiveFileState>>;\n promise: Promise<void>;\n}\n\n/**\n * Service for preloading and caching Rive files.\n *\n * This service allows you to:\n * - Preload .riv files before they're needed\n * - Share the same file across multiple components\n * - Cache files to avoid redundant network requests\n * - Deduplicate concurrent loads of the same file\n *\n * @example\n * ```typescript\n * export class MyComponent {\n * private riveFileService = inject(RiveFileService);\n * private destroyRef = inject(DestroyRef);\n *\n * fileState = this.riveFileService.loadFile({\n * src: 'assets/animation.riv'\n * });\n *\n * constructor() {\n * // Auto-release on component destroy\n * this.destroyRef.onDestroy(() => {\n * this.riveFileService.releaseFile({ src: 'assets/animation.riv' });\n * });\n * }\n * }\n * ```\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class RiveFileService {\n private cache = new Map<string, CacheEntry>();\n private pendingLoads = new Map<string, PendingLoad>();\n private bufferIdMap = new WeakMap<ArrayBuffer, number>();\n private bufferIdCounter = 0;\n\n // Optional debug configuration\n private readonly globalDebugConfig = inject(RIVE_DEBUG_CONFIG, {\n optional: true,\n });\n\n /**\n * Load a RiveFile from URL or ArrayBuffer.\n * Returns a signal with the file state and loading status.\n * Files are cached by src URL to avoid redundant loads.\n * Concurrent loads of the same file are deduplicated.\n *\n * @param params - Parameters containing src URL or buffer\n * @returns Signal with RiveFileState\n */\n public loadFile(params: RiveFileParams): Signal<RiveFileState> {\n const cacheKey = this.getCacheKey(params);\n\n // Initialize logger for this request\n const logger = new RiveLogger(this.globalDebugConfig, params.debug);\n logger.debug(`RiveFileService: Request to load file`, { cacheKey });\n\n // Return cached entry if exists\n const cached = this.cache.get(cacheKey);\n if (cached) {\n cached.refCount++;\n logger.debug(`RiveFileService: Cache hit for ${cacheKey}`);\n return cached.state;\n }\n\n // Return pending load if already in progress\n const pending = this.pendingLoads.get(cacheKey);\n if (pending) {\n logger.debug(`RiveFileService: Reuse pending load for ${cacheKey}`);\n return pending.stateSignal.asReadonly();\n }\n\n // Create new loading state\n const stateSignal = signal<RiveFileState>({\n riveFile: null,\n status: 'loading',\n });\n\n // Start loading and track as pending\n const promise = this.loadRiveFile(params, stateSignal, cacheKey, logger);\n this.pendingLoads.set(cacheKey, { stateSignal, promise });\n\n return stateSignal.asReadonly();\n }\n\n /**\n * Release a cached file. Decrements reference count and cleans up if no longer used.\n *\n * @param params - Parameters used to load the file\n */\n public releaseFile(params: RiveFileParams): void {\n const cacheKey = this.getCacheKey(params);\n const cached = this.cache.get(cacheKey);\n\n if (cached) {\n cached.refCount--;\n if (cached.refCount <= 0) {\n try {\n cached.file.cleanup();\n } catch (error) {\n console.warn('Error cleaning up RiveFile:', error);\n }\n this.cache.delete(cacheKey);\n }\n }\n }\n\n /**\n * Clear all cached files and abort pending loads\n */\n public clearCache(): void {\n // Clear pending loads first to prevent them from populating the cache\n this.pendingLoads.forEach((pending) => {\n pending.stateSignal.set({\n riveFile: null,\n status: 'failed',\n });\n });\n this.pendingLoads.clear();\n\n // Clean up cached files\n this.cache.forEach((entry) => {\n try {\n entry.file.cleanup();\n } catch (error) {\n console.warn('Error cleaning up RiveFile:', error);\n }\n });\n this.cache.clear();\n }\n\n /**\n * Get cache key from params\n */\n private getCacheKey(params: RiveFileParams): string {\n if (params.src) {\n return `src:${params.src}`;\n }\n if (params.buffer) {\n // For buffers, use WeakMap to track unique IDs without mutating the buffer\n let bufferId = this.bufferIdMap.get(params.buffer);\n if (bufferId === undefined) {\n bufferId = ++this.bufferIdCounter;\n this.bufferIdMap.set(params.buffer, bufferId);\n }\n return `buffer:${bufferId}`;\n }\n return 'unknown';\n }\n\n /**\n * Load RiveFile and update state signal.\n * Addresses race condition by setting up listeners BEFORE init.\n */\n private async loadRiveFile(\n params: RiveFileParams,\n stateSignal: ReturnType<typeof signal<RiveFileState>>,\n cacheKey: string,\n logger: RiveLogger,\n ): Promise<void> {\n // Guard to ensure pending load is cleaned up exactly once\n let pendingCleanupDone = false;\n const finalizePendingLoadOnce = () => {\n if (!pendingCleanupDone) {\n this.pendingLoads.delete(cacheKey);\n pendingCleanupDone = true;\n }\n };\n\n try {\n // Extract debug parameter - it's not part of RiveFile SDK API\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { debug, ...sdkParams } = params;\n const file = new RiveFile(sdkParams);\n\n // Listeners must be attached BEFORE calling init() to avoid race conditions\n // where init() completes or fails synchronously/immediately.\n file.on(EventType.Load, () => {\n logger.debug(`RiveFileService: File loaded successfully`, { cacheKey });\n\n // Request an instance to increment reference count\n // This prevents the file from being destroyed while in use\n file.getInstance();\n\n stateSignal.set({\n riveFile: file,\n status: 'success',\n });\n\n // Cache the successfully loaded file\n this.cache.set(cacheKey, {\n file,\n state: stateSignal.asReadonly(),\n refCount: 1,\n });\n\n finalizePendingLoadOnce();\n });\n\n file.on(EventType.LoadError, () => {\n logger.warn(`RiveFileService: Failed to load file`, { cacheKey });\n\n stateSignal.set({\n riveFile: null,\n status: 'failed',\n });\n\n finalizePendingLoadOnce();\n });\n\n logger.debug(`RiveFileService: Initializing file`, { cacheKey });\n\n // Await init() to catch initialization errors (e.g. WASM issues)\n await file.init();\n } catch (error) {\n logger.error('RiveFileService: Unexpected error loading file', error);\n\n stateSignal.set({\n riveFile: null,\n status: 'failed',\n });\n\n finalizePendingLoadOnce();\n }\n }\n}\n","/*\n * Public API Surface of @Grandgular/rive-angular\n */\n\n// Component\nexport { RiveCanvasComponent } from './lib/components';\n\n// Services\nexport {\n RiveFileService,\n type RiveFileState,\n type RiveFileParams,\n type FileStatus,\n} from './lib/services';\n\n// Re-exported Rive SDK types and error classes\nexport {\n Fit,\n Alignment,\n RiveLoadError,\n EventType,\n RiveValidationError,\n RiveErrorCode,\n type RiveErrorOptions,\n type RiveEvent\n} from './lib/models';\n\n// Debug Configuration\nexport {\n provideRiveDebug,\n type RiveDebugConfig,\n type LogLevel\n} from './lib/utils/debug-config';\n\n// Re-export commonly used types from @rive-app/canvas for convenience\nexport {\n Rive,\n RiveFile,\n Layout,\n StateMachineInput,\n type LayoutParameters,\n type RiveParameters,\n type RiveFileParameters,\n} from '@rive-app/canvas';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAEA;;AAEG;AAeH;;;AAGG;AACG,MAAO,aAAc,SAAQ,KAAK,CAAA;AACtB,IAAA,IAAI;AACJ,IAAA,UAAU;AACV,IAAA,OAAO;AACP,IAAA,aAAa;IAE7B,WAAA,CACE,gBAA2C,EAC3C,aAAuB,EAAA;AAEvB,QAAA,IAAI,OAAO,gBAAgB,KAAK,QAAQ,EAAE;;YAExC,KAAK,CAAC,gBAAgB,CAAC;AACvB,YAAA,IAAI,CAAC,aAAa;gBAChB,aAAa,YAAY,KAAK,GAAG,aAAa,GAAG,SAAS;QAC9D;aAAO;;AAEL,YAAA,KAAK,CAAC,gBAAgB,CAAC,OAAO,CAAC;AAC/B,YAAA,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC,IAAI;AACjC,YAAA,IAAI,CAAC,UAAU,GAAG,gBAAgB,CAAC,UAAU;AAC7C,YAAA,IAAI,CAAC,OAAO,GAAG,gBAAgB,CAAC,OAAO;AACvC,YAAA,IAAI,CAAC,aAAa;gBAChB,gBAAgB,CAAC,KAAK,YAAY;sBAC9B,gBAAgB,CAAC;sBACjB,SAAS;QACjB;AACA,QAAA,IAAI,CAAC,IAAI,GAAG,eAAe;IAC7B;AACD;AAED;;;AAGG;AACG,MAAO,mBAAoB,SAAQ,KAAK,CAAA;AAG1B,IAAA,IAAA;AACA,IAAA,gBAAA;AACA,IAAA,UAAA;AAJlB,IAAA,WAAA,CACE,OAAe,EACC,IAAmB,EACnB,gBAA2B,EAC3B,UA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A,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,cAFd,MAAM,EAAA,CAAA;;2FAEP,eAAe,EAAA,UAAA,EAAA,CAAA;kBAH3B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;AC1ED;;AAEG;AAEH;;ACJA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"grandgular-rive-angular.mjs","sources":["../../../../libs/rive-angular/src/lib/models/rive.model.ts","../../../../libs/rive-angular/src/lib/utils/error-codes.ts","../../../../libs/rive-angular/src/lib/utils/element-observer.ts","../../../../libs/rive-angular/src/lib/utils/debug-config.ts","../../../../libs/rive-angular/src/lib/utils/logger.ts","../../../../libs/rive-angular/src/lib/utils/validator.ts","../../../../libs/rive-angular/src/lib/components/rive-canvas.component.ts","../../../../libs/rive-angular/src/lib/services/rive-file.service.ts","../../../../libs/rive-angular/src/index.ts","../../../../libs/rive-angular/src/grandgular-rive-angular.ts"],"sourcesContent":["import { RiveErrorCode } from '../utils';\n\n/**\n * Re-export Rive SDK types for consumer convenience\n */\nexport { Fit, Alignment, EventType } from '@rive-app/canvas';\nexport type { Event as RiveEvent } from '@rive-app/canvas';\n\n/**\n * Options for constructing a RiveLoadError with detailed context.\n */\nexport interface RiveErrorOptions {\n message: string;\n code?: RiveErrorCode;\n suggestion?: string;\n docsUrl?: string;\n cause?: unknown;\n}\n\n/**\n * Error thrown when Rive animation fails to load.\n * Supports legacy constructor for backward compatibility.\n */\nexport class RiveLoadError extends Error {\n public readonly code?: RiveErrorCode;\n public readonly suggestion?: string;\n public readonly docsUrl?: string;\n public readonly originalError?: Error;\n\n constructor(\n messageOrOptions: string | RiveErrorOptions,\n originalError?: unknown,\n ) {\n if (typeof messageOrOptions === 'string') {\n // Legacy constructor: new RiveLoadError(message, originalError)\n super(messageOrOptions);\n this.originalError =\n originalError instanceof Error ? originalError : undefined;\n } else {\n // New constructor: new RiveLoadError(options)\n super(messageOrOptions.message);\n this.code = messageOrOptions.code;\n this.suggestion = messageOrOptions.suggestion;\n this.docsUrl = messageOrOptions.docsUrl;\n this.originalError =\n messageOrOptions.cause instanceof Error\n ? messageOrOptions.cause\n : undefined;\n }\n this.name = 'RiveLoadError';\n }\n}\n\n/**\n * Error thrown when validation fails (e.g. missing artboard/animation/input).\n * These errors are typically non-fatal but indicate a configuration mismatch.\n */\nexport class RiveValidationError extends Error {\n constructor(\n message: string,\n public readonly code: RiveErrorCode,\n public readonly availableOptions?: string[],\n public readonly suggestion?: string,\n ) {\n super(message);\n this.name = 'RiveValidationError';\n }\n}\n","/**\n * Error codes used throughout the Rive Angular library.\n *\n * Ranges:\n * - RIVE_1xx: Load errors (file not found, network, bad format)\n * - RIVE_2xx: Validation errors (artboard, animation, state machine mismatch)\n * - RIVE_3xx: Configuration/Usage errors (missing source, bad canvas)\n */\nexport enum RiveErrorCode {\n // Load Errors\n FileNotFound = 'RIVE_101',\n InvalidFormat = 'RIVE_102',\n NetworkError = 'RIVE_103',\n\n // Validation Errors\n ArtboardNotFound = 'RIVE_201',\n AnimationNotFound = 'RIVE_202',\n StateMachineNotFound = 'RIVE_203',\n InputNotFound = 'RIVE_204',\n TextRunNotFound = 'RIVE_205',\n\n // Configuration Errors\n NoSource = 'RIVE_301',\n InvalidCanvas = 'RIVE_302',\n}\n\n/**\n * Template messages for each error code.\n * Used by formatErrorMessage to generate user-friendly descriptions.\n */\nexport const ERROR_MESSAGES: Record<RiveErrorCode, string> = {\n [RiveErrorCode.FileNotFound]: 'File not found: {url}',\n [RiveErrorCode.InvalidFormat]: 'Invalid .riv file format',\n [RiveErrorCode.NetworkError]: 'Network error while loading file',\n [RiveErrorCode.ArtboardNotFound]: 'Artboard \"{name}\" not found',\n [RiveErrorCode.AnimationNotFound]: 'Animation \"{name}\" not found',\n [RiveErrorCode.StateMachineNotFound]: 'State machine \"{name}\" not found',\n [RiveErrorCode.InputNotFound]: 'Input \"{name}\" not found in \"{stateMachine}\"',\n [RiveErrorCode.TextRunNotFound]: 'Text run \"{name}\" not found',\n [RiveErrorCode.NoSource]: 'No animation source provided',\n [RiveErrorCode.InvalidCanvas]: 'Invalid canvas element',\n};\n\n/**\n * Formats an error message by replacing placeholders with actual values.\n *\n * @param code - The error code\n * @param params - Record of values to replace in the template (e.g. { name: 'MyAnim' })\n * @returns The formatted error string\n */\nexport function formatErrorMessage(\n code: RiveErrorCode,\n params: Record<string, string> = {},\n): string {\n let message = ERROR_MESSAGES[code] || 'Unknown Rive error';\n\n for (const [key, value] of Object.entries(params)) {\n message = message.replace(`{${key}}`, value);\n }\n\n return message;\n}\n","import { Injectable, inject, PLATFORM_ID } from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\n\n/**\n * Fake IntersectionObserver for environments where it's not available (e.g., SSR)\n */\nclass FakeIntersectionObserver implements IntersectionObserver {\n readonly root: Element | Document | null = null;\n readonly rootMargin: string = '';\n readonly thresholds: ReadonlyArray<number> = [];\n\n observe(): void {\n // Intentionally empty for SSR compatibility\n }\n unobserve(): void {\n // Intentionally empty for SSR compatibility\n }\n disconnect(): void {\n // Intentionally empty for SSR compatibility\n }\n takeRecords(): IntersectionObserverEntry[] {\n return [];\n }\n}\n\nconst MyIntersectionObserver =\n (typeof globalThis !== 'undefined' && globalThis.IntersectionObserver) ||\n FakeIntersectionObserver;\n\n/**\n * Singleton IntersectionObserver wrapper for observing multiple elements\n * with individual callbacks. This avoids creating multiple IntersectionObserver\n * instances which is more efficient.\n * \n * Provided as an Angular service for better testability and DI integration.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class ElementObserver {\n private observer: IntersectionObserver;\n private elementsMap: Map<Element, (entry: IntersectionObserverEntry) => void> = new Map();\n private readonly platformId = inject(PLATFORM_ID);\n\n constructor() {\n // Only create real observer in browser environment\n if (isPlatformBrowser(this.platformId)) {\n this.observer = new MyIntersectionObserver(\n this.onObserved,\n ) as IntersectionObserver;\n } else {\n this.observer = new FakeIntersectionObserver();\n }\n }\n\n private onObserved = (entries: IntersectionObserverEntry[]): void => {\n entries.forEach((entry) => {\n const elementCallback = this.elementsMap.get(entry.target as Element);\n if (elementCallback) {\n elementCallback(entry);\n }\n });\n };\n\n public registerCallback(element: Element, callback: (entry: IntersectionObserverEntry) => void): void {\n this.observer.observe(element);\n this.elementsMap.set(element, callback);\n }\n\n public removeCallback(element: Element): void {\n this.observer.unobserve(element);\n this.elementsMap.delete(element);\n }\n}\n\n// Legacy function for backward compatibility\n// New code should inject ElementObserver directly\nlet legacyObserverInstance: ElementObserver | null = null;\n\n/**\n * @deprecated Use dependency injection instead: `inject(ElementObserver)`\n * Get the singleton ElementObserver instance\n */\nexport function getElementObserver(): ElementObserver {\n if (!legacyObserverInstance) {\n legacyObserverInstance = new ElementObserver();\n }\n return legacyObserverInstance;\n}\n","import { InjectionToken, Provider } from '@angular/core';\n\n/**\n * Log levels for Rive debugging.\n * - 'none': No output\n * - 'error': Only errors (default)\n * - 'warn': Errors and warnings\n * - 'info': High-level info (loaded, played)\n * - 'debug': Detailed logs (internal state, events)\n */\nexport type LogLevel = 'none' | 'error' | 'warn' | 'info' | 'debug';\n\n/**\n * Configuration for Rive debug mode.\n */\nexport interface RiveDebugConfig {\n logLevel: LogLevel;\n}\n\n/**\n * Injection token for global Rive debug configuration.\n * Can be provided via provideRiveDebug().\n */\nexport const RIVE_DEBUG_CONFIG = new InjectionToken<RiveDebugConfig>('RIVE_DEBUG_CONFIG');\n\n/**\n * Provides global configuration for Rive debugging.\n * Use this in your app.config.ts or module providers.\n *\n * @example\n * providers: [\n * provideRiveDebug({ logLevel: 'debug' })\n * ]\n */\nexport function provideRiveDebug(config: RiveDebugConfig): Provider {\n return {\n provide: RIVE_DEBUG_CONFIG,\n useValue: config,\n };\n}\n","import { LogLevel, RiveDebugConfig } from './debug-config';\n\n/**\n * Internal logger for Rive Angular library.\n * Handles log levels and formatting.\n * Not exported publicly.\n */\nexport class RiveLogger {\n private level: LogLevel;\n\n constructor(globalConfig?: RiveDebugConfig | null, localDebug?: boolean) {\n this.level = this.resolveLogLevel(globalConfig, localDebug);\n }\n\n /**\n * Resolve effective log level based on precedence rules:\n * 1. Local debug=true -> 'debug'\n * 2. Local debug=false/undefined -> Use global config\n * 3. No config -> 'error' (default)\n */\n private resolveLogLevel(\n globalConfig?: RiveDebugConfig | null,\n localDebug?: boolean,\n ): LogLevel {\n if (localDebug === true) {\n return 'debug';\n }\n if (globalConfig?.logLevel) {\n return globalConfig.logLevel;\n }\n return 'error';\n }\n\n /**\n * Update log level dynamically (e.g. when input changes)\n */\n public update(\n globalConfig?: RiveDebugConfig | null,\n localDebug?: boolean,\n ): void {\n this.level = this.resolveLogLevel(globalConfig, localDebug);\n }\n\n public debug(message: string, ...args: unknown[]): void {\n if (this.shouldLog('debug')) {\n console.debug(`[Rive] ${message}`, ...args);\n }\n }\n\n public info(message: string, ...args: unknown[]): void {\n if (this.shouldLog('info')) {\n console.info(`[Rive] ${message}`, ...args);\n }\n }\n\n public warn(message: string, ...args: unknown[]): void {\n if (this.shouldLog('warn')) {\n console.warn(`[Rive] ${message}`, ...args);\n }\n }\n\n public error(message: string, ...args: unknown[]): void {\n if (this.shouldLog('error')) {\n console.error(`[Rive] ${message}`, ...args);\n }\n }\n\n private shouldLog(level: LogLevel): boolean {\n const levels: LogLevel[] = ['none', 'error', 'warn', 'info', 'debug'];\n const currentIdx = levels.indexOf(this.level);\n const targetIdx = levels.indexOf(level);\n return currentIdx >= targetIdx;\n }\n}\n","import { Rive } from '@rive-app/canvas';\nimport { RiveValidationError } from '../models/rive.model';\nimport { RiveErrorCode, formatErrorMessage } from './error-codes';\nimport { RiveLogger } from './logger';\n\n/**\n * Validates requested artboard name against available artboards.\n * Returns error if not found.\n */\nexport function validateArtboard(\n rive: Rive,\n requestedName?: string,\n): RiveValidationError | null {\n if (!requestedName) return null;\n\n try {\n // Safe check: ensure artboardNames exist on runtime\n // Note: These properties exist at runtime but may not be in type definitions\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const available = (rive as any).artboardNames;\n if (!available || !available.includes(requestedName)) {\n return new RiveValidationError(\n formatErrorMessage(RiveErrorCode.ArtboardNotFound, {\n name: requestedName,\n }),\n RiveErrorCode.ArtboardNotFound,\n available || [],\n available && available.length > 0\n ? `Available artboards: ${available.join(', ')}`\n : 'No artboards found in file',\n );\n }\n } catch {\n // Graceful fallback if runtime metadata is not accessible\n // Return null silently to avoid breaking validation flow\n }\n return null;\n}\n\n/**\n * Validates requested animation names against available animations.\n * Returns first error found.\n */\nexport function validateAnimations(\n rive: Rive,\n requestedNames?: string | string[],\n): RiveValidationError | null {\n if (!requestedNames) return null;\n\n const names = Array.isArray(requestedNames)\n ? requestedNames\n : [requestedNames];\n\n try {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const available = (rive as any).animationNames;\n for (const name of names) {\n if (!available || !available.includes(name)) {\n return new RiveValidationError(\n formatErrorMessage(RiveErrorCode.AnimationNotFound, { name }),\n RiveErrorCode.AnimationNotFound,\n available || [],\n available && available.length > 0\n ? `Available animations: ${available.join(', ')}`\n : 'No animations found in file',\n );\n }\n }\n } catch {\n // Graceful fallback if runtime metadata is not accessible\n // Return null silently to avoid breaking validation flow\n }\n return null;\n}\n\n/**\n * Validates requested state machine names against available state machines.\n * Returns first error found.\n */\nexport function validateStateMachines(\n rive: Rive,\n requestedNames?: string | string[],\n): RiveValidationError | null {\n if (!requestedNames) return null;\n\n const names = Array.isArray(requestedNames)\n ? requestedNames\n : [requestedNames];\n\n try {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const available = (rive as any).stateMachineNames;\n for (const name of names) {\n if (!available || !available.includes(name)) {\n return new RiveValidationError(\n formatErrorMessage(RiveErrorCode.StateMachineNotFound, { name }),\n RiveErrorCode.StateMachineNotFound,\n available || [],\n available && available.length > 0\n ? `Available state machines: ${available.join(', ')}`\n : 'No state machines found in file',\n );\n }\n }\n } catch {\n // Graceful fallback if runtime metadata is not accessible\n // Return null silently to avoid breaking validation flow\n }\n return null;\n}\n\n/**\n * Validates if an input exists within a specific state machine.\n */\nexport function validateInput(\n rive: Rive,\n stateMachineName: string,\n inputName: string,\n): RiveValidationError | null {\n try {\n const inputs = rive.stateMachineInputs(stateMachineName);\n if (!inputs) return null; // Should not happen if SM exists\n\n const found = inputs.find((i) => i.name === inputName);\n if (!found) {\n const available = inputs.map((i) => i.name);\n return new RiveValidationError(\n formatErrorMessage(RiveErrorCode.InputNotFound, {\n name: inputName,\n stateMachine: stateMachineName,\n }),\n RiveErrorCode.InputNotFound,\n available,\n available.length > 0\n ? `Available inputs in \"${stateMachineName}\": ${available.join(', ')}`\n : `No inputs found in state machine \"${stateMachineName}\"`,\n );\n }\n } catch {\n // Graceful fallback if runtime metadata is not accessible\n // Return null silently to avoid breaking validation flow\n }\n return null;\n}\n\n/**\n * Runs full configuration validation.\n * Logs warnings and returns array of errors.\n */\nexport function validateConfiguration(\n rive: Rive,\n config: {\n artboard?: string;\n animations?: string | string[];\n stateMachines?: string | string[];\n },\n logger: RiveLogger,\n): RiveValidationError[] {\n const errors: RiveValidationError[] = [];\n\n const artboardError = validateArtboard(rive, config.artboard);\n if (artboardError) errors.push(artboardError);\n\n const animError = validateAnimations(rive, config.animations);\n if (animError) errors.push(animError);\n\n const smError = validateStateMachines(rive, config.stateMachines);\n if (smError) errors.push(smError);\n\n if (errors.length > 0) {\n logger.warn(`Validation failed with ${errors.length} errors:`);\n errors.forEach((err) => {\n logger.warn(`- ${err.message}`);\n if (err.suggestion) logger.warn(` Suggestion: ${err.suggestion}`);\n });\n }\n\n return errors;\n}\n","import {\n Component,\n ChangeDetectionStrategy,\n ElementRef,\n input,\n output,\n signal,\n effect,\n inject,\n DestroyRef,\n PLATFORM_ID,\n AfterViewInit,\n NgZone,\n viewChild,\n untracked,\n} from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n Rive,\n RiveFile,\n Layout,\n Fit,\n Alignment,\n StateMachineInput,\n type LayoutParameters,\n Event as RiveEvent,\n} from '@rive-app/canvas';\nimport { RiveLoadError } from '../models';\nimport {\n ElementObserver,\n RiveLogger,\n RIVE_DEBUG_CONFIG,\n validateConfiguration,\n validateInput,\n RiveErrorCode,\n formatErrorMessage,\n} from '../utils';\nimport { RiveValidationError } from '../models';\n\n/**\n * Standalone Angular component for Rive animations\n *\n * Features:\n * - Signal-based inputs for reactive updates\n * - Automatic canvas sizing via ResizeObserver with DPR support\n * - OnPush change detection strategy\n * - SSR compatible\n * - Zoneless architecture ready\n * - Automatic resource cleanup\n * - Runs outside Angular zone for optimal performance\n *\n * @example\n * ```html\n * <rive-canvas\n * src=\"assets/animations/rive/animation.riv\"\n * [stateMachines]=\"'StateMachine'\"\n * [autoplay]=\"true\"\n * [fit]=\"Fit.Cover\"\n * [alignment]=\"Alignment.Center\"\n * (loaded)=\"onLoad()\"\n * />\n * ```\n */\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'rive-canvas',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <canvas #canvas [style.width.%]=\"100\" [style.height.%]=\"100\"></canvas>\n `,\n styles: [\n `\n :host {\n display: block;\n width: 100%;\n height: 100%;\n }\n\n canvas {\n display: block;\n }\n `,\n ],\n})\nexport class RiveCanvasComponent implements AfterViewInit {\n private readonly canvas =\n viewChild.required<ElementRef<HTMLCanvasElement>>('canvas');\n\n readonly #destroyRef = inject(DestroyRef);\n readonly #platformId = inject(PLATFORM_ID);\n readonly #ngZone = inject(NgZone);\n readonly #globalDebugConfig = inject(RIVE_DEBUG_CONFIG, { optional: true });\n readonly #elementObserver = inject(ElementObserver);\n\n public readonly src = input<string>();\n public readonly buffer = input<ArrayBuffer>();\n /**\n * Preloaded RiveFile instance (from RiveFileService).\n * If provided, this takes precedence over src/buffer.\n */\n public readonly riveFile = input<RiveFile>();\n public readonly artboard = input<string>();\n public readonly animations = input<string | string[]>();\n public readonly stateMachines = input<string | string[]>();\n public readonly autoplay = input<boolean>(true);\n public readonly fit = input<Fit>(Fit.Contain);\n public readonly alignment = input<Alignment>(Alignment.Center);\n public readonly useOffscreenRenderer = input<boolean>(false);\n /**\n * Enable IntersectionObserver to automatically stop rendering when canvas is not visible.\n * This optimizes performance by pausing animations that are off-screen.\n */\n public readonly shouldUseIntersectionObserver = input<boolean>(true);\n /**\n * Disable Rive event listeners on the canvas (pointer events, touch events).\n * Useful for decorative animations without interactivity.\n */\n public readonly shouldDisableRiveListeners = input<boolean>(false);\n /**\n * Allow Rive to automatically handle Rive Events (e.g., OpenUrlEvent opens URLs).\n * Default is false for security - events must be handled manually via riveEvent output.\n */\n public readonly automaticallyHandleEvents = input<boolean>(false);\n\n /**\n * Enable debug mode for this specific instance.\n * Overrides global configuration if set.\n * - true: 'debug' level\n * - false/undefined: use global level\n */\n public readonly debugMode = input<boolean>();\n\n /**\n * Record of text run names to values for declarative text setting.\n * Keys present in this input are CONTROLLED — the input is the source of truth.\n * Keys absent from this input are UNCONTROLLED — managed imperatively.\n * Values are applied reactively when input changes.\n */\n public readonly textRuns = input<Record<string, string>>();\n\n // Outputs (Events)\n public readonly loaded = output<void>();\n public readonly loadError = output<Error>();\n /**\n * Emitted when state machine state changes.\n * Contains information about the state change event.\n */\n public readonly stateChange = output<RiveEvent>();\n /**\n * Emitted for Rive Events (custom events defined in the .riv file).\n * Use this to handle custom events like OpenUrlEvent, etc.\n */\n public readonly riveEvent = output<RiveEvent>();\n /**\n * Emitted when Rive instance is fully loaded and ready.\n * Provides direct access to the Rive instance for advanced use cases.\n * Note: This fires AFTER the animation is loaded, not just instantiated.\n */\n public readonly riveReady = output<Rive>();\n\n // Private writable signals\n readonly #isPlaying = signal<boolean>(false);\n readonly #isPaused = signal<boolean>(false);\n readonly #isLoaded = signal<boolean>(false);\n readonly #riveInstance = signal<Rive | null>(null);\n\n // Public readonly signals\n public readonly isPlaying = this.#isPlaying.asReadonly();\n public readonly isPaused = this.#isPaused.asReadonly();\n public readonly isLoaded = this.#isLoaded.asReadonly();\n /**\n * Public signal providing access to the Rive instance.\n * Use this to access advanced Rive SDK features.\n */\n public readonly riveInstance = this.#riveInstance.asReadonly();\n\n // Private state\n #rive: Rive | null = null;\n private readonly logger: RiveLogger;\n private resizeObserver: ResizeObserver | null = null;\n private isInitialized = false;\n private isPausedByIntersectionObserver = false;\n private retestIntersectionTimeoutId: ReturnType<typeof setTimeout> | null =\n null;\n private resizeRafId: number | null = null;\n private lastWidth = 0;\n private lastHeight = 0;\n\n constructor() {\n this.logger = new RiveLogger(this.#globalDebugConfig, this.debugMode());\n\n // Effect to update logger level when debugMode changes\n effect(() => {\n this.logger.update(this.#globalDebugConfig, this.debugMode());\n });\n\n // Effect to reload animation when src, buffer, riveFile, or configuration changes\n effect(() => {\n const src = this.src();\n const buffer = this.buffer();\n const riveFile = this.riveFile();\n // Track configuration changes to trigger reload\n this.artboard();\n this.animations();\n this.stateMachines();\n untracked(() => {\n if (\n (src || buffer || riveFile) &&\n isPlatformBrowser(this.#platformId) &&\n this.isInitialized\n )\n this.loadAnimation();\n });\n });\n\n // Effect to update layout when fit or alignment changes\n effect(() => {\n const fit = this.fit();\n const alignment = this.alignment();\n untracked(() => {\n if (this.#rive && isPlatformBrowser(this.#platformId)) {\n const layoutParams: LayoutParameters = { fit, alignment };\n this.#rive.layout = new Layout(layoutParams);\n }\n });\n });\n\n // Effect to apply text runs when input changes or animation loads\n effect(() => {\n const runs = this.textRuns();\n const isLoaded = this.#isLoaded();\n untracked(() => {\n if (runs && isLoaded && this.#rive) {\n this.applyTextRuns(runs);\n }\n });\n });\n\n // Auto cleanup on destroy\n this.#destroyRef.onDestroy(() => {\n this.cleanupRive();\n this.disconnectResizeObserver();\n this.disconnectIntersectionObserver();\n });\n }\n\n public ngAfterViewInit(): void {\n if (isPlatformBrowser(this.#platformId)) {\n this.isInitialized = true;\n this.setupResizeObserver();\n this.setupIntersectionObserver();\n this.loadAnimation();\n }\n }\n\n /**\n * Setup ResizeObserver for automatic canvas sizing with DPR support\n */\n private setupResizeObserver(): void {\n const canvas = this.canvas().nativeElement;\n\n this.resizeObserver = new ResizeObserver((entries) => {\n // Cancel any pending resize frame\n if (this.resizeRafId) {\n cancelAnimationFrame(this.resizeRafId);\n }\n\n for (const entry of entries) {\n const { width, height } = entry.contentRect;\n\n // Skip if dimensions haven't changed (prevents unnecessary updates)\n if (width === this.lastWidth && height === this.lastHeight) {\n continue;\n }\n\n this.lastWidth = width;\n this.lastHeight = height;\n\n // Defer resize to next animation frame to prevent excessive updates in Safari\n this.resizeRafId = requestAnimationFrame(() => {\n // Read current DPR to support monitor changes and zoom\n const dpr = window.devicePixelRatio || 1;\n\n // Set canvas size with device pixel ratio for sharp rendering\n canvas.width = width * dpr;\n canvas.height = height * dpr;\n\n // Resize Rive instance if it exists\n if (this.#rive) this.#rive.resizeDrawingSurfaceToCanvas();\n });\n }\n });\n\n this.resizeObserver.observe(canvas);\n }\n\n /**\n * Disconnect ResizeObserver\n */\n private disconnectResizeObserver(): void {\n if (this.resizeRafId) {\n cancelAnimationFrame(this.resizeRafId);\n this.resizeRafId = null;\n }\n if (this.resizeObserver) {\n this.resizeObserver.disconnect();\n this.resizeObserver = null;\n }\n }\n\n /**\n * Setup IntersectionObserver to stop rendering when canvas is not visible\n */\n private setupIntersectionObserver(): void {\n if (!this.shouldUseIntersectionObserver()) return;\n\n const canvas = this.canvas().nativeElement;\n\n const onIntersectionChange = (entry: IntersectionObserverEntry): void => {\n if (entry.isIntersecting) {\n // Canvas is visible - start rendering\n if (this.#rive) {\n this.#rive.startRendering();\n }\n this.isPausedByIntersectionObserver = false;\n } else {\n // Canvas is not visible - stop rendering\n if (this.#rive) {\n this.#rive.stopRendering();\n }\n this.isPausedByIntersectionObserver = true;\n\n // Workaround for Chrome bug with insertBefore\n // Retest after 10ms if boundingClientRect.width is 0\n if (this.retestIntersectionTimeoutId) {\n clearTimeout(this.retestIntersectionTimeoutId);\n }\n\n if (entry.boundingClientRect.width === 0) {\n this.retestIntersectionTimeoutId = setTimeout(() => {\n this.retestIntersection();\n }, 10);\n }\n }\n };\n\n this.#elementObserver.registerCallback(canvas, onIntersectionChange);\n }\n\n /**\n * Retest intersection - workaround for Chrome bug\n */\n private retestIntersection(): void {\n if (!this.isPausedByIntersectionObserver) return;\n\n const canvas = this.canvas().nativeElement;\n const rect = canvas.getBoundingClientRect();\n\n const isIntersecting =\n rect.width > 0 &&\n rect.height > 0 &&\n rect.top <\n (window.innerHeight || document.documentElement.clientHeight) &&\n rect.bottom > 0 &&\n rect.left < (window.innerWidth || document.documentElement.clientWidth) &&\n rect.right > 0;\n\n if (isIntersecting && this.#rive) {\n this.#rive.startRendering();\n this.isPausedByIntersectionObserver = false;\n }\n }\n\n /**\n * Disconnect IntersectionObserver\n */\n private disconnectIntersectionObserver(): void {\n if (this.retestIntersectionTimeoutId) {\n clearTimeout(this.retestIntersectionTimeoutId);\n this.retestIntersectionTimeoutId = null;\n }\n\n if (this.shouldUseIntersectionObserver()) {\n const canvas = this.canvas().nativeElement;\n this.#elementObserver.removeCallback(canvas);\n }\n }\n\n /**\n * Load animation from src or buffer\n */\n private loadAnimation(): void {\n // Run outside Angular zone for better performance\n this.#ngZone.runOutsideAngular(() => {\n try {\n // Clean up existing Rive instance only\n this.cleanupRive();\n\n const canvas = this.canvas().nativeElement;\n const src = this.src();\n const buffer = this.buffer();\n const riveFile = this.riveFile();\n\n if (!src && !buffer && !riveFile) {\n this.logger.warn(\n 'No animation source provided (src, buffer, or riveFile)',\n );\n this.#ngZone.run(() =>\n this.loadError.emit(\n new RiveLoadError({\n message: 'No animation source provided',\n code: RiveErrorCode.NoSource,\n }),\n ),\n );\n return;\n }\n\n this.logger.info(`Loading animation`, {\n src: src || (buffer ? 'buffer' : 'riveFile'),\n canvasWidth: canvas.width,\n canvasHeight: canvas.height,\n dpr: window.devicePixelRatio,\n });\n\n // Build layout configuration\n const layoutParams: LayoutParameters = {\n fit: this.fit(),\n alignment: this.alignment(),\n };\n\n // Build typed Rive configuration\n const baseConfig = {\n canvas,\n autoplay: this.autoplay(),\n layout: new Layout(layoutParams),\n useOffscreenRenderer: this.useOffscreenRenderer(),\n shouldDisableRiveListeners: this.shouldDisableRiveListeners(),\n automaticallyHandleEvents: this.automaticallyHandleEvents(),\n onLoad: () => this.onLoad(),\n onLoadError: (error?: unknown) => this.onLoadError(error),\n onPlay: () => this.onPlay(),\n onPause: () => this.onPause(),\n onStop: () => this.onStop(),\n onStateChange: (event: RiveEvent) => this.onStateChange(event),\n onRiveEvent: (event: RiveEvent) => this.onRiveEvent(event),\n };\n\n // Add source (priority: riveFile > src > buffer)\n const sourceConfig = riveFile\n ? { riveFile }\n : src\n ? { src }\n : buffer\n ? { buffer }\n : {};\n\n // Add optional configuration\n const optionalConfig = {\n ...(this.artboard() ? { artboard: this.artboard() } : {}),\n ...(this.animations() ? { animations: this.animations() } : {}),\n ...(this.stateMachines()\n ? { stateMachines: this.stateMachines() }\n : {}),\n };\n\n // Combine all configurations\n const config = { ...baseConfig, ...sourceConfig, ...optionalConfig };\n\n this.#rive = new Rive(config);\n\n // Update public signal (riveReady will be emitted in onLoad)\n this.#ngZone.run(() => {\n this.#riveInstance.set(this.#rive);\n });\n } catch (error) {\n this.logger.error('Failed to initialize Rive instance:', error);\n this.#ngZone.run(() =>\n this.loadError.emit(\n new RiveLoadError({\n message: 'Failed to initialize Rive instance',\n code: RiveErrorCode.InvalidFormat,\n cause: error instanceof Error ? error : undefined,\n }),\n ),\n );\n }\n });\n }\n\n // Event handlers (run inside Angular zone for change detection)\n private onLoad(): void {\n // Validate loaded configuration\n if (this.#rive) {\n const validationErrors = validateConfiguration(\n this.#rive,\n {\n artboard: this.artboard(),\n animations: this.animations(),\n stateMachines: this.stateMachines(),\n },\n this.logger,\n );\n\n // Emit validation errors via loadError output\n if (validationErrors.length > 0) {\n this.#ngZone.run(() => {\n validationErrors.forEach((err) => this.loadError.emit(err));\n });\n }\n\n // Log available assets in debug mode\n // Note: These properties exist at runtime but may not be in type definitions\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const riveWithMetadata = this.#rive as any;\n this.logger.debug('Animation loaded successfully. Available assets:', {\n artboards: riveWithMetadata.artboardNames,\n animations: riveWithMetadata.animationNames,\n stateMachines: riveWithMetadata.stateMachineNames,\n });\n }\n\n this.#ngZone.run(() => {\n this.#isLoaded.set(true);\n this.loaded.emit();\n // Emit riveReady after animation is fully loaded\n if (this.#rive) {\n this.riveReady.emit(this.#rive);\n }\n });\n }\n\n private onLoadError(originalError?: unknown): void {\n this.#ngZone.run(() => {\n // Determine probable cause and code\n let code = RiveErrorCode.NetworkError;\n let message = 'Failed to load Rive animation';\n\n if (originalError instanceof Error) {\n if (originalError.message.includes('404')) {\n code = RiveErrorCode.FileNotFound;\n message = `File not found: ${this.src()}`;\n } else if (originalError.message.includes('format')) {\n code = RiveErrorCode.InvalidFormat;\n message = 'Invalid .riv file format';\n }\n }\n\n const error = new RiveLoadError({\n message,\n code,\n cause: originalError instanceof Error ? originalError : undefined,\n });\n\n this.logger.error('Rive load error:', error);\n this.loadError.emit(error);\n });\n }\n\n private onPlay(): void {\n this.#ngZone.run(() => {\n this.#isPlaying.set(true);\n this.#isPaused.set(false);\n });\n }\n\n private onPause(): void {\n this.#ngZone.run(() => {\n this.#isPlaying.set(false);\n this.#isPaused.set(true);\n });\n }\n\n private onStop(): void {\n this.#ngZone.run(() => {\n this.#isPlaying.set(false);\n this.#isPaused.set(false);\n });\n }\n\n private onStateChange(event: RiveEvent): void {\n this.#ngZone.run(() => this.stateChange.emit(event));\n }\n\n private onRiveEvent(event: RiveEvent): void {\n this.#ngZone.run(() => this.riveEvent.emit(event));\n }\n\n // Public API methods\n\n /**\n * Play animation(s)\n */\n public playAnimation(animations?: string | string[]): void {\n if (!this.#rive) return;\n\n this.#ngZone.runOutsideAngular(() => {\n if (animations) {\n this.#rive!.play(animations);\n } else {\n this.#rive!.play();\n }\n });\n }\n\n /**\n * Pause animation(s)\n */\n public pauseAnimation(animations?: string | string[]): void {\n if (!this.#rive) return;\n\n this.#ngZone.runOutsideAngular(() => {\n if (animations) {\n this.#rive!.pause(animations);\n } else {\n this.#rive!.pause();\n }\n });\n }\n\n /**\n * Stop animation(s)\n */\n public stopAnimation(animations?: string | string[]): void {\n if (!this.#rive) return;\n\n this.#ngZone.runOutsideAngular(() => {\n if (animations) {\n this.#rive!.stop(animations);\n } else {\n this.#rive!.stop();\n }\n });\n }\n\n /**\n * Reset the animation to the beginning\n */\n public reset(): void {\n if (!this.#rive) return;\n\n this.#ngZone.runOutsideAngular(() => {\n this.#rive!.reset();\n });\n }\n\n /**\n * Set a state machine input value\n */\n public setInput(\n stateMachineName: string,\n inputName: string,\n value: number | boolean,\n ): void {\n if (!this.#rive) return;\n\n this.#ngZone.runOutsideAngular(() => {\n // Validate input existence first\n const error = validateInput(this.#rive!, stateMachineName, inputName);\n if (error) {\n this.logger.warn(error.message);\n this.#ngZone.run(() => this.loadError.emit(error));\n return;\n }\n\n const inputs = this.#rive!.stateMachineInputs(stateMachineName);\n const input = inputs.find((i: StateMachineInput) => i.name === inputName);\n\n if (input && 'value' in input) {\n input.value = value;\n }\n });\n }\n\n /**\n * Fire a state machine trigger\n */\n public fireTrigger(stateMachineName: string, triggerName: string): void {\n if (!this.#rive) return;\n\n this.#ngZone.runOutsideAngular(() => {\n // Validate trigger (input) existence first\n const error = validateInput(this.#rive!, stateMachineName, triggerName);\n if (error) {\n this.logger.warn(error.message);\n this.#ngZone.run(() => this.loadError.emit(error));\n return;\n }\n\n const inputs = this.#rive!.stateMachineInputs(stateMachineName);\n const input = inputs.find(\n (i: StateMachineInput) => i.name === triggerName,\n );\n\n if (input && 'fire' in input && typeof input.fire === 'function') {\n input.fire();\n }\n });\n }\n\n /**\n * Get the current value of a text run.\n * Returns undefined if the text run doesn't exist or Rive instance is not loaded.\n */\n public getTextRunValue(textRunName: string): string | undefined {\n if (!this.#rive) return undefined;\n\n try {\n return this.#ngZone.runOutsideAngular(() => {\n return this.#rive!.getTextRunValue(textRunName);\n });\n } catch (error) {\n this.logger.warn(`Failed to get text run \"${textRunName}\":`, error);\n return undefined;\n }\n }\n\n /**\n * Set a text run value.\n * Warning: If the text run is controlled by textRuns input, this change will be overwritten\n * on the next input update.\n */\n public setTextRunValue(textRunName: string, textRunValue: string): void {\n if (!this.#rive) return;\n\n // Check if this key is controlled by textRuns input\n const controlledRuns = this.textRuns();\n if (controlledRuns && textRunName in controlledRuns) {\n this.logger.warn(\n `Text run \"${textRunName}\" is controlled by textRuns input. This change will be overwritten on next input update.`,\n );\n }\n\n this.#ngZone.runOutsideAngular(() => {\n try {\n this.#rive!.setTextRunValue(textRunName, textRunValue);\n this.logger.debug(`Text run \"${textRunName}\" set to \"${textRunValue}\"`);\n } catch (error) {\n this.logger.warn(`Failed to set text run \"${textRunName}\":`, error);\n this.#ngZone.run(() =>\n this.loadError.emit(\n new RiveValidationError(\n formatErrorMessage(RiveErrorCode.TextRunNotFound, {\n name: textRunName,\n }),\n RiveErrorCode.TextRunNotFound,\n ),\n ),\n );\n }\n });\n }\n\n /**\n * Get the current value of a text run at a specific path (for nested artboards/components).\n * Returns undefined if the text run doesn't exist or Rive instance is not loaded.\n */\n public getTextRunValueAtPath(\n textRunName: string,\n path: string,\n ): string | undefined {\n if (!this.#rive) return undefined;\n\n try {\n return this.#ngZone.runOutsideAngular(() => {\n return this.#rive!.getTextRunValueAtPath(textRunName, path);\n });\n } catch (error) {\n this.logger.warn(\n `Failed to get text run \"${textRunName}\" at path \"${path}\":`,\n error,\n );\n return undefined;\n }\n }\n\n /**\n * Set a text run value at a specific path (for nested artboards/components).\n * Note: AtPath text runs are always uncontrolled (not managed by textRuns input).\n */\n public setTextRunValueAtPath(\n textRunName: string,\n textRunValue: string,\n path: string,\n ): void {\n if (!this.#rive) return;\n\n this.#ngZone.runOutsideAngular(() => {\n try {\n this.#rive!.setTextRunValueAtPath(textRunName, textRunValue, path);\n this.logger.debug(\n `Text run \"${textRunName}\" at path \"${path}\" set to \"${textRunValue}\"`,\n );\n } catch (error) {\n this.logger.warn(\n `Failed to set text run \"${textRunName}\" at path \"${path}\":`,\n error,\n );\n this.#ngZone.run(() =>\n this.loadError.emit(\n new RiveValidationError(\n formatErrorMessage(RiveErrorCode.TextRunNotFound, {\n name: textRunName,\n }),\n RiveErrorCode.TextRunNotFound,\n ),\n ),\n );\n }\n });\n }\n\n /**\n * Apply all text runs from input (controlled keys).\n * Called on every input change or load.\n */\n private applyTextRuns(runs: Record<string, string>): void {\n this.#ngZone.runOutsideAngular(() => {\n for (const [name, value] of Object.entries(runs)) {\n try {\n this.#rive!.setTextRunValue(name, value);\n this.logger.debug(`Text run \"${name}\" set to \"${value}\"`);\n } catch (error) {\n this.logger.warn(`Failed to set text run \"${name}\":`, error);\n this.#ngZone.run(() =>\n this.loadError.emit(\n new RiveValidationError(\n formatErrorMessage(RiveErrorCode.TextRunNotFound, { name }),\n RiveErrorCode.TextRunNotFound,\n ),\n ),\n );\n }\n }\n });\n }\n\n /**\n * Clean up Rive instance only\n */\n private cleanupRive(): void {\n if (this.#rive) {\n try {\n this.#rive.cleanup();\n } catch (error) {\n this.logger.warn('Error during Rive cleanup:', error);\n }\n this.#rive = null;\n }\n\n // Reset signals\n this.#riveInstance.set(null);\n this.#isLoaded.set(false);\n this.#isPlaying.set(false);\n this.#isPaused.set(false);\n }\n}\n","import { Injectable, signal, Signal, inject } from '@angular/core';\nimport { RiveFile, EventType } from '@rive-app/canvas';\nimport { RIVE_DEBUG_CONFIG } from '../utils';\nimport { RiveLogger } from '../utils';\n\n/**\n * Status of RiveFile loading\n */\nexport type FileStatus = 'idle' | 'loading' | 'success' | 'failed';\n\n/**\n * State of a loaded RiveFile\n */\nexport interface RiveFileState {\n riveFile: RiveFile | null;\n status: FileStatus;\n}\n\n/**\n * Parameters for loading a RiveFile\n */\nexport interface RiveFileParams {\n src?: string;\n buffer?: ArrayBuffer;\n debug?: boolean;\n}\n\n/**\n * Cache entry for a loaded RiveFile\n */\ninterface CacheEntry {\n file: RiveFile;\n state: Signal<RiveFileState>;\n refCount: number;\n}\n\n/**\n * Pending load entry to prevent duplicate loads\n */\ninterface PendingLoad {\n stateSignal: ReturnType<typeof signal<RiveFileState>>;\n promise: Promise<void>;\n}\n\n/**\n * Service for preloading and caching Rive files.\n *\n * This service allows you to:\n * - Preload .riv files before they're needed\n * - Share the same file across multiple components\n * - Cache files to avoid redundant network requests\n * - Deduplicate concurrent loads of the same file\n *\n * @example\n * ```typescript\n * export class MyComponent {\n * private riveFileService = inject(RiveFileService);\n * private destroyRef = inject(DestroyRef);\n *\n * fileState = this.riveFileService.loadFile({\n * src: 'assets/animation.riv'\n * });\n *\n * constructor() {\n * // Auto-release on component destroy\n * this.destroyRef.onDestroy(() => {\n * this.riveFileService.releaseFile({ src: 'assets/animation.riv' });\n * });\n * }\n * }\n * ```\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class RiveFileService {\n private cache = new Map<string, CacheEntry>();\n private pendingLoads = new Map<string, PendingLoad>();\n private bufferIdMap = new WeakMap<ArrayBuffer, number>();\n private bufferIdCounter = 0;\n\n // Optional debug configuration\n private readonly globalDebugConfig = inject(RIVE_DEBUG_CONFIG, {\n optional: true,\n });\n\n /**\n * Load a RiveFile from URL or ArrayBuffer.\n * Returns a signal with the file state and loading status.\n * Files are cached by src URL to avoid redundant loads.\n * Concurrent loads of the same file are deduplicated.\n *\n * @param params - Parameters containing src URL or buffer\n * @returns Signal with RiveFileState\n */\n public loadFile(params: RiveFileParams): Signal<RiveFileState> {\n const cacheKey = this.getCacheKey(params);\n\n // Initialize logger for this request\n const logger = new RiveLogger(this.globalDebugConfig, params.debug);\n logger.debug(`RiveFileService: Request to load file`, { cacheKey });\n\n // Return cached entry if exists\n const cached = this.cache.get(cacheKey);\n if (cached) {\n cached.refCount++;\n logger.debug(`RiveFileService: Cache hit for ${cacheKey}`);\n return cached.state;\n }\n\n // Return pending load if already in progress\n const pending = this.pendingLoads.get(cacheKey);\n if (pending) {\n logger.debug(`RiveFileService: Reuse pending load for ${cacheKey}`);\n return pending.stateSignal.asReadonly();\n }\n\n // Create new loading state\n const stateSignal = signal<RiveFileState>({\n riveFile: null,\n status: 'loading',\n });\n\n // Start loading and track as pending\n const promise = this.loadRiveFile(params, stateSignal, cacheKey, logger);\n this.pendingLoads.set(cacheKey, { stateSignal, promise });\n\n return stateSignal.asReadonly();\n }\n\n /**\n * Release a cached file. Decrements reference count and cleans up if no longer used.\n *\n * @param params - Parameters used to load the file\n */\n public releaseFile(params: RiveFileParams): void {\n const cacheKey = this.getCacheKey(params);\n const cached = this.cache.get(cacheKey);\n\n if (cached) {\n cached.refCount--;\n if (cached.refCount <= 0) {\n try {\n cached.file.cleanup();\n } catch (error) {\n console.warn('Error cleaning up RiveFile:', error);\n }\n this.cache.delete(cacheKey);\n }\n }\n }\n\n /**\n * Clear all cached files and abort pending loads\n */\n public clearCache(): void {\n // Clear pending loads first to prevent them from populating the cache\n this.pendingLoads.forEach((pending) => {\n pending.stateSignal.set({\n riveFile: null,\n status: 'failed',\n });\n });\n this.pendingLoads.clear();\n\n // Clean up cached files\n this.cache.forEach((entry) => {\n try {\n entry.file.cleanup();\n } catch (error) {\n console.warn('Error cleaning up RiveFile:', error);\n }\n });\n this.cache.clear();\n }\n\n /**\n * Get cache key from params\n */\n private getCacheKey(params: RiveFileParams): string {\n if (params.src) {\n return `src:${params.src}`;\n }\n if (params.buffer) {\n // For buffers, use WeakMap to track unique IDs without mutating the buffer\n let bufferId = this.bufferIdMap.get(params.buffer);\n if (bufferId === undefined) {\n bufferId = ++this.bufferIdCounter;\n this.bufferIdMap.set(params.buffer, bufferId);\n }\n return `buffer:${bufferId}`;\n }\n return 'unknown';\n }\n\n /**\n * Load RiveFile and update state signal.\n * Addresses race condition by setting up listeners BEFORE init.\n */\n private async loadRiveFile(\n params: RiveFileParams,\n stateSignal: ReturnType<typeof signal<RiveFileState>>,\n cacheKey: string,\n logger: RiveLogger,\n ): Promise<void> {\n // Guard to ensure pending load is cleaned up exactly once\n let pendingCleanupDone = false;\n const finalizePendingLoadOnce = () => {\n if (!pendingCleanupDone) {\n this.pendingLoads.delete(cacheKey);\n pendingCleanupDone = true;\n }\n };\n\n try {\n // Extract debug parameter - it's not part of RiveFile SDK API\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { debug, ...sdkParams } = params;\n const file = new RiveFile(sdkParams);\n\n // Listeners must be attached BEFORE calling init() to avoid race conditions\n // where init() completes or fails synchronously/immediately.\n file.on(EventType.Load, () => {\n logger.debug(`RiveFileService: File loaded successfully`, { cacheKey });\n\n // Request an instance to increment reference count\n // This prevents the file from being destroyed while in use\n file.getInstance();\n\n stateSignal.set({\n riveFile: file,\n status: 'success',\n });\n\n // Cache the successfully loaded file\n this.cache.set(cacheKey, {\n file,\n state: stateSignal.asReadonly(),\n refCount: 1,\n });\n\n finalizePendingLoadOnce();\n });\n\n file.on(EventType.LoadError, () => {\n logger.warn(`RiveFileService: Failed to load file`, { cacheKey });\n\n stateSignal.set({\n riveFile: null,\n status: 'failed',\n });\n\n finalizePendingLoadOnce();\n });\n\n logger.debug(`RiveFileService: Initializing file`, { cacheKey });\n\n // Await init() to catch initialization errors (e.g. WASM issues)\n await file.init();\n } catch (error) {\n logger.error('RiveFileService: Unexpected error loading file', error);\n\n stateSignal.set({\n riveFile: null,\n status: 'failed',\n });\n\n finalizePendingLoadOnce();\n }\n }\n}\n","/*\n * Public API Surface of @Grandgular/rive-angular\n */\n\n// Component\nexport { RiveCanvasComponent } from './lib/components';\n\n// Services\nexport {\n RiveFileService,\n type RiveFileState,\n type RiveFileParams,\n type FileStatus,\n} from './lib/services';\n\n// Re-exported Rive SDK types and error classes\nexport {\n Fit,\n Alignment,\n RiveLoadError,\n EventType,\n RiveValidationError,\n RiveErrorCode,\n type RiveErrorOptions,\n type RiveEvent\n} from './lib/models';\n\n// Debug Configuration\nexport {\n provideRiveDebug,\n type RiveDebugConfig,\n type LogLevel\n} from './lib/utils/debug-config';\n\n// Re-export commonly used types from @rive-app/canvas for convenience\nexport {\n Rive,\n RiveFile,\n Layout,\n StateMachineInput,\n type LayoutParameters,\n type RiveParameters,\n type RiveFileParameters,\n} from '@rive-app/canvas';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAEA;;AAEG;AAeH;;;AAGG;AACG,MAAO,aAAc,SAAQ,KAAK,CAAA;AACtB,IAAA,IAAI;AACJ,IAAA,UAAU;AACV,IAAA,OAAO;AACP,IAAA,aAAa;IAE7B,WAAA,CACE,gBAA2C,EAC3C,aAAuB,EAAA;AAEvB,QAAA,IAAI,OAAO,gBAAgB,KAAK,QAAQ,EAAE;;YAExC,KAAK,CAAC,gBAAgB,CAAC;AACvB,YAAA,IAAI,CAAC,aAAa;gBAChB,aAAa,YAAY,KAAK,GAAG,aAAa,GAAG,SAAS;QAC9D;aAAO;;AAEL,YAAA,KAAK,CAAC,gBAAgB,CAAC,OAAO,CAAC;AAC/B,YAAA,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC,IAAI;AACjC,YAAA,IAAI,CAAC,UAAU,GAAG,gBAAgB,CAAC,UAAU;AAC7C,YAAA,IAAI,CAAC,OAAO,GAAG,gBAAgB,CAAC,OAAO;AACvC,YAAA,IAAI,CAAC,aAAa;gBAChB,gBAAgB,CAAC,KAAK,YAAY;sBAC9B,gBAAgB,CAAC;sBACjB,SAAS;QACjB;AACA,QAAA,IAAI,CAAC,IAAI,GAAG,eAAe;IAC7B;AACD;AAED;;;AAGG;AACG,MAAO,mBAAoB,SAAQ,KAAK,CAAA;AAG1B,IAAA,IAAA;AACA,IAAA,gBAAA;AACA,IAAA,UAAA;AAJlB,IAAA,WAAA,CACE,OAAe,EACC,IAAmB,EACnB,gBAA2B,EAC3B,UAAmB,EAAA;QAEnC,KAAK,CAAC,OAAO,CAAC;QAJE,IAAA,CAAA,IAAI,GAAJ,IAAI;QACJ,IAAA,CAAA,gBAAgB,GAAhB,gBAAgB;QAChB,IAAA,CAAA,UAAU,GAAV,UAAU;AAG1B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AAEF,gBAAA,uBAAuB,EAAE;AAC3B,YAAA,CAAC,CAAC;YAEF,MAAM,CAAC,KAAK,CAAC,CAAA,kCAAA,CAAoC,EAAE,EAAE,QAAQ,EAAE,CAAC;;AAGhE,YAAA,MAAM,IAAI,CAAC,IAAI,EAAE;QACnB;QAAE,OAAO,KAAK,EAAE;AACd,YAAA,MAAM,CAAC,KAAK,CAAC,gDAAgD,EAAE,KAAK,CAAC;YAErE,WAAW,CAAC,GAAG,CAAC;AACd,gBAAA,QAAQ,EAAE,IAAI;AACd,gBAAA,MAAM,EAAE,QAAQ;AACjB,aAAA,CAAC;AAEF,YAAA,uBAAuB,EAAE;QAC3B;IACF;uGAlMW,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAf,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,cAFd,MAAM,EAAA,CAAA;;2FAEP,eAAe,EAAA,UAAA,EAAA,CAAA;kBAH3B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;AC1ED;;AAEG;AAEH;;ACJA;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -66,6 +66,13 @@ declare class RiveCanvasComponent implements AfterViewInit {
|
|
|
66
66
|
* - false/undefined: use global level
|
|
67
67
|
*/
|
|
68
68
|
readonly debugMode: _angular_core.InputSignal<boolean | undefined>;
|
|
69
|
+
/**
|
|
70
|
+
* Record of text run names to values for declarative text setting.
|
|
71
|
+
* Keys present in this input are CONTROLLED — the input is the source of truth.
|
|
72
|
+
* Keys absent from this input are UNCONTROLLED — managed imperatively.
|
|
73
|
+
* Values are applied reactively when input changes.
|
|
74
|
+
*/
|
|
75
|
+
readonly textRuns: _angular_core.InputSignal<Record<string, string> | undefined>;
|
|
69
76
|
readonly loaded: _angular_core.OutputEmitterRef<void>;
|
|
70
77
|
readonly loadError: _angular_core.OutputEmitterRef<Error>;
|
|
71
78
|
/**
|
|
@@ -157,12 +164,38 @@ declare class RiveCanvasComponent implements AfterViewInit {
|
|
|
157
164
|
* Fire a state machine trigger
|
|
158
165
|
*/
|
|
159
166
|
fireTrigger(stateMachineName: string, triggerName: string): void;
|
|
167
|
+
/**
|
|
168
|
+
* Get the current value of a text run.
|
|
169
|
+
* Returns undefined if the text run doesn't exist or Rive instance is not loaded.
|
|
170
|
+
*/
|
|
171
|
+
getTextRunValue(textRunName: string): string | undefined;
|
|
172
|
+
/**
|
|
173
|
+
* Set a text run value.
|
|
174
|
+
* Warning: If the text run is controlled by textRuns input, this change will be overwritten
|
|
175
|
+
* on the next input update.
|
|
176
|
+
*/
|
|
177
|
+
setTextRunValue(textRunName: string, textRunValue: string): void;
|
|
178
|
+
/**
|
|
179
|
+
* Get the current value of a text run at a specific path (for nested artboards/components).
|
|
180
|
+
* Returns undefined if the text run doesn't exist or Rive instance is not loaded.
|
|
181
|
+
*/
|
|
182
|
+
getTextRunValueAtPath(textRunName: string, path: string): string | undefined;
|
|
183
|
+
/**
|
|
184
|
+
* Set a text run value at a specific path (for nested artboards/components).
|
|
185
|
+
* Note: AtPath text runs are always uncontrolled (not managed by textRuns input).
|
|
186
|
+
*/
|
|
187
|
+
setTextRunValueAtPath(textRunName: string, textRunValue: string, path: string): void;
|
|
188
|
+
/**
|
|
189
|
+
* Apply all text runs from input (controlled keys).
|
|
190
|
+
* Called on every input change or load.
|
|
191
|
+
*/
|
|
192
|
+
private applyTextRuns;
|
|
160
193
|
/**
|
|
161
194
|
* Clean up Rive instance only
|
|
162
195
|
*/
|
|
163
196
|
private cleanupRive;
|
|
164
197
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RiveCanvasComponent, never>;
|
|
165
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<RiveCanvasComponent, "rive-canvas", never, { "src": { "alias": "src"; "required": false; "isSignal": true; }; "buffer": { "alias": "buffer"; "required": false; "isSignal": true; }; "riveFile": { "alias": "riveFile"; "required": false; "isSignal": true; }; "artboard": { "alias": "artboard"; "required": false; "isSignal": true; }; "animations": { "alias": "animations"; "required": false; "isSignal": true; }; "stateMachines": { "alias": "stateMachines"; "required": false; "isSignal": true; }; "autoplay": { "alias": "autoplay"; "required": false; "isSignal": true; }; "fit": { "alias": "fit"; "required": false; "isSignal": true; }; "alignment": { "alias": "alignment"; "required": false; "isSignal": true; }; "useOffscreenRenderer": { "alias": "useOffscreenRenderer"; "required": false; "isSignal": true; }; "shouldUseIntersectionObserver": { "alias": "shouldUseIntersectionObserver"; "required": false; "isSignal": true; }; "shouldDisableRiveListeners": { "alias": "shouldDisableRiveListeners"; "required": false; "isSignal": true; }; "automaticallyHandleEvents": { "alias": "automaticallyHandleEvents"; "required": false; "isSignal": true; }; "debugMode": { "alias": "debugMode"; "required": false; "isSignal": true; }; }, { "loaded": "loaded"; "loadError": "loadError"; "stateChange": "stateChange"; "riveEvent": "riveEvent"; "riveReady": "riveReady"; }, never, never, true, never>;
|
|
198
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<RiveCanvasComponent, "rive-canvas", never, { "src": { "alias": "src"; "required": false; "isSignal": true; }; "buffer": { "alias": "buffer"; "required": false; "isSignal": true; }; "riveFile": { "alias": "riveFile"; "required": false; "isSignal": true; }; "artboard": { "alias": "artboard"; "required": false; "isSignal": true; }; "animations": { "alias": "animations"; "required": false; "isSignal": true; }; "stateMachines": { "alias": "stateMachines"; "required": false; "isSignal": true; }; "autoplay": { "alias": "autoplay"; "required": false; "isSignal": true; }; "fit": { "alias": "fit"; "required": false; "isSignal": true; }; "alignment": { "alias": "alignment"; "required": false; "isSignal": true; }; "useOffscreenRenderer": { "alias": "useOffscreenRenderer"; "required": false; "isSignal": true; }; "shouldUseIntersectionObserver": { "alias": "shouldUseIntersectionObserver"; "required": false; "isSignal": true; }; "shouldDisableRiveListeners": { "alias": "shouldDisableRiveListeners"; "required": false; "isSignal": true; }; "automaticallyHandleEvents": { "alias": "automaticallyHandleEvents"; "required": false; "isSignal": true; }; "debugMode": { "alias": "debugMode"; "required": false; "isSignal": true; }; "textRuns": { "alias": "textRuns"; "required": false; "isSignal": true; }; }, { "loaded": "loaded"; "loadError": "loadError"; "stateChange": "stateChange"; "riveEvent": "riveEvent"; "riveReady": "riveReady"; }, never, never, true, never>;
|
|
166
199
|
}
|
|
167
200
|
|
|
168
201
|
/**
|
|
@@ -267,6 +300,7 @@ declare enum RiveErrorCode {
|
|
|
267
300
|
AnimationNotFound = "RIVE_202",
|
|
268
301
|
StateMachineNotFound = "RIVE_203",
|
|
269
302
|
InputNotFound = "RIVE_204",
|
|
303
|
+
TextRunNotFound = "RIVE_205",
|
|
270
304
|
NoSource = "RIVE_301",
|
|
271
305
|
InvalidCanvas = "RIVE_302"
|
|
272
306
|
}
|