@grandgular/rive-angular 0.1.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.
|
@@ -0,0 +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/element-observer.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":["/**\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 * Error thrown when Rive animation fails to load\n */\nexport class RiveLoadError extends Error {\n constructor(\n message: string,\n public readonly originalError?: Error,\n ) {\n super(message);\n this.name = 'RiveLoadError';\n }\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 */\nexport class ElementObserver {\n private observer: IntersectionObserver;\n private elementsMap: Map<Element, (entry: IntersectionObserverEntry) => void> = new Map();\n\n constructor() {\n this.observer = new MyIntersectionObserver(\n this.onObserved,\n ) as IntersectionObserver;\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// Singleton instance\nlet observerInstance: ElementObserver | null = null;\n\n/**\n * Get the singleton ElementObserver instance\n */\nexport function getElementObserver(): ElementObserver {\n if (!observerInstance) {\n observerInstance = new ElementObserver();\n }\n return observerInstance;\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 { getElementObserver } 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\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 // 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 created and ready.\n * Provides direct access to the Rive instance for advanced use cases.\n */\n public readonly riveReady = output<Rive>();\n\n // Signals for reactive state\n public readonly isPlaying = signal<boolean>(false);\n public readonly isPaused = signal<boolean>(false);\n public readonly isLoaded = signal<boolean>(false);\n /**\n * Public signal providing access to the Rive instance.\n * Use this to access advanced Rive SDK features.\n */\n public readonly riveInstance = signal<Rive | null>(null);\n\n // Private state\n #rive: Rive | null = null;\n private resizeObserver: ResizeObserver | null = null;\n private isInitialized = false;\n private isPausedByIntersectionObserver = false;\n private retestIntersectionTimeoutId: ReturnType<typeof setTimeout> | null =\n null;\n\n constructor() {\n // Effect to reload animation when src, buffer, or riveFile changes\n effect(() => {\n const src = this.src();\n const buffer = this.buffer();\n const riveFile = this.riveFile();\n untracked(() => {\n if (\n (src || buffer || riveFile) &&\n isPlatformBrowser(this.#platformId) &&\n this.isInitialized\n )\n this.loadAnimation();\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 const dpr = window.devicePixelRatio || 1;\n\n this.resizeObserver = new ResizeObserver((entries) => {\n for (const entry of entries) {\n const { width, height } = entry.contentRect;\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 this.resizeObserver.observe(canvas);\n }\n\n /**\n * Disconnect ResizeObserver\n */\n private disconnectResizeObserver(): void {\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 const observer = getElementObserver();\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 observer.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 const observer = getElementObserver();\n observer.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) return;\n\n // Build layout configuration\n const layoutParams: LayoutParameters = {\n fit: this.fit(),\n alignment: this.alignment(),\n };\n\n // Create Rive instance configuration\n // Using Record to allow dynamic property assignment\n const config: Record<string, unknown> = {\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 src, buffer, or riveFile (priority: riveFile > src > buffer)\n if (riveFile) {\n config['riveFile'] = riveFile;\n } else if (src) {\n config['src'] = src;\n } else if (buffer) {\n config['buffer'] = buffer;\n }\n\n // Add artboard if specified\n const artboard = this.artboard();\n if (artboard) config['artboard'] = artboard;\n\n // Add animations if specified\n const animations = this.animations();\n if (animations) config['animations'] = animations;\n\n // Add state machines if specified\n const stateMachines = this.stateMachines();\n if (stateMachines) config['stateMachines'] = stateMachines;\n\n // Safe type assertion - config contains all required properties\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this.#rive = new Rive(config as any);\n\n // Update public signal and emit riveReady event\n this.#ngZone.run(() => {\n this.riveInstance.set(this.#rive);\n this.riveReady.emit(this.#rive!);\n });\n } catch (error) {\n console.error('Failed to initialize Rive instance:', error);\n this.#ngZone.run(() =>\n this.loadError.emit(\n new RiveLoadError('Failed to load Rive animation', error as Error),\n ),\n );\n }\n });\n }\n\n // Event handlers (run inside Angular zone for change detection)\n private onLoad(): void {\n this.#ngZone.run(() => {\n this.isLoaded.set(true);\n this.loaded.emit();\n });\n }\n\n private onLoadError(originalError?: unknown): void {\n this.#ngZone.run(() => {\n const error = new RiveLoadError(\n 'Failed to load Rive animation',\n originalError instanceof Error ? originalError : undefined,\n );\n console.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 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 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 console.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 } from '@angular/core';\nimport { RiveFile, EventType } from '@rive-app/canvas';\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}\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 bufferIdCounter = 0;\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 // Return cached entry if exists\n const cached = this.cache.get(cacheKey);\n if (cached) {\n cached.refCount++;\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 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);\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\n */\n public clearCache(): void {\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, generate unique ID to avoid collisions\n // Store the ID on the buffer object itself\n const bufferWithId = params.buffer as ArrayBuffer & { __riveBufferId?: number };\n if (!bufferWithId.__riveBufferId) {\n bufferWithId.__riveBufferId = ++this.bufferIdCounter;\n }\n return `buffer:${bufferWithId.__riveBufferId}`;\n }\n return 'unknown';\n }\n\n /**\n * Load RiveFile and update state signal\n */\n private loadRiveFile(\n params: RiveFileParams,\n stateSignal: ReturnType<typeof signal<RiveFileState>>,\n cacheKey: string,\n ): Promise<void> {\n return new Promise<void>((resolve) => {\n try {\n const file = new RiveFile(params);\n file.init();\n\n file.on(EventType.Load, () => {\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 // Remove from pending loads\n this.pendingLoads.delete(cacheKey);\n resolve();\n });\n\n file.on(EventType.LoadError, () => {\n stateSignal.set({\n riveFile: null,\n status: 'failed',\n });\n\n // Remove from pending loads\n this.pendingLoads.delete(cacheKey);\n\n // Resolve (not reject) — error state is communicated via the signal.\n // Rejecting would cause an unhandled promise rejection since no\n // consumer awaits or catches this promise.\n resolve();\n });\n } catch (error) {\n console.error('Failed to load RiveFile:', error);\n stateSignal.set({\n riveFile: null,\n status: 'failed',\n });\n\n // Remove from pending loads\n this.pendingLoads.delete(cacheKey);\n\n // Resolve (not reject) — error state is communicated via the signal.\n resolve();\n }\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} from './lib/models';\nexport type { RiveEvent } from './lib/models';\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":";;;;;;AAAA;;AAEG;AAIH;;AAEG;AACG,MAAO,aAAc,SAAQ,KAAK,CAAA;AAGpB,IAAA,aAAA;IAFlB,WAAA,CACE,OAAe,EACC,aAAqB,EAAA;QAErC,KAAK,CAAC,OAAO,CAAC;QAFE,IAAA,CAAA,aAAa,GAAb,aAAa;AAG7B,QAAA,IAAI,CAAC,IAAI,GAAG,eAAe;IAC7B;AACD;;ACjBD;;AAEG;AACH,MAAM,wBAAwB,CAAA;IACnB,IAAI,GAA8B,IAAI;IACtC,UAAU,GAAW,EAAE;IACvB,UAAU,GAA0B,EAAE;IAE/C,OAAO,GAAA;;IAEP;IACA,SAAS,GAAA;;IAET;IACA,UAAU,GAAA;;IAEV;IACA,WAAW,GAAA;AACT,QAAA,OAAO,EAAE;IACX;AACD;AAED,MAAM,sBAAsB,GAC1B,CAAC,OAAO,UAAU,KAAK,WAAW,IAAI,UAAU,CAAC,oBAAoB;AACrE,IAAA,wBAAwB;AAE1B;;;;AAIG;MACU,eAAe,CAAA;AAClB,IAAA,QAAQ;AACR,IAAA,WAAW,GAA6D,IAAI,GAAG,EAAE;AAEzF,IAAA,WAAA,GAAA;QACE,IAAI,CAAC,QAAQ,GAAG,IAAI,sBAAsB,CACxC,IAAI,CAAC,UAAU,CACQ;IAC3B;AAEQ,IAAA,UAAU,GAAG,CAAC,OAAoC,KAAU;AAClE,QAAA,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,KAAI;AACxB,YAAA,MAAM,eAAe,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,MAAiB,CAAC;YACrE,IAAI,eAAe,EAAE;gB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ACnB,iBAAA;;;ACvED;;AAEG;AAEH;;ACJA;;AAEG;;;;"}
|
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@grandgular/rive-angular",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Modern Angular wrapper for Rive animations with reactive state management, built with signals and zoneless architecture",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"angular",
|
|
7
|
+
"rive",
|
|
8
|
+
"animation",
|
|
9
|
+
"canvas",
|
|
10
|
+
"graphics",
|
|
11
|
+
"state-machine",
|
|
12
|
+
"standalone",
|
|
13
|
+
"signals",
|
|
14
|
+
"typescript",
|
|
15
|
+
"ng",
|
|
16
|
+
"interactive",
|
|
17
|
+
"reactive"
|
|
18
|
+
],
|
|
19
|
+
"author": "Andrei Shpileuski",
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "https://github.com/andreishpileuski/rive.git",
|
|
24
|
+
"directory": "libs/rive-angular"
|
|
25
|
+
},
|
|
26
|
+
"homepage": "https://github.com/andreishpileuski/rive/tree/main/libs/rive-angular#readme",
|
|
27
|
+
"bugs": {
|
|
28
|
+
"url": "https://github.com/andreishpileuski/rive/issues"
|
|
29
|
+
},
|
|
30
|
+
"engines": {
|
|
31
|
+
"node": ">=20.0.0",
|
|
32
|
+
"npm": ">=10.0.0"
|
|
33
|
+
},
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"@angular/common": ">=18.0.0 <22.0.0",
|
|
36
|
+
"@angular/core": ">=18.0.0 <22.0.0",
|
|
37
|
+
"@rive-app/canvas": "^2.35.0"
|
|
38
|
+
},
|
|
39
|
+
"publishConfig": {
|
|
40
|
+
"access": "public"
|
|
41
|
+
},
|
|
42
|
+
"sideEffects": false,
|
|
43
|
+
"module": "fesm2022/grandgular-rive-angular.mjs",
|
|
44
|
+
"typings": "types/grandgular-rive-angular.d.ts",
|
|
45
|
+
"exports": {
|
|
46
|
+
"./package.json": {
|
|
47
|
+
"default": "./package.json"
|
|
48
|
+
},
|
|
49
|
+
".": {
|
|
50
|
+
"types": "./types/grandgular-rive-angular.d.ts",
|
|
51
|
+
"default": "./fesm2022/grandgular-rive-angular.mjs"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"dependencies": {
|
|
55
|
+
"tslib": "^2.3.0"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { AfterViewInit, Signal } from '@angular/core';
|
|
3
|
+
import { RiveFile, Fit, Alignment, Event, Rive } from '@rive-app/canvas';
|
|
4
|
+
export { Alignment, EventType, Fit, Layout, LayoutParameters, Rive, Event as RiveEvent, RiveFile, RiveFileParameters, RiveParameters, StateMachineInput } from '@rive-app/canvas';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Standalone Angular component for Rive animations
|
|
8
|
+
*
|
|
9
|
+
* Features:
|
|
10
|
+
* - Signal-based inputs for reactive updates
|
|
11
|
+
* - Automatic canvas sizing via ResizeObserver with DPR support
|
|
12
|
+
* - OnPush change detection strategy
|
|
13
|
+
* - SSR compatible
|
|
14
|
+
* - Zoneless architecture ready
|
|
15
|
+
* - Automatic resource cleanup
|
|
16
|
+
* - Runs outside Angular zone for optimal performance
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```html
|
|
20
|
+
* <rive-canvas
|
|
21
|
+
* src="assets/animations/rive/animation.riv"
|
|
22
|
+
* [stateMachines]="'StateMachine'"
|
|
23
|
+
* [autoplay]="true"
|
|
24
|
+
* [fit]="Fit.Cover"
|
|
25
|
+
* [alignment]="Alignment.Center"
|
|
26
|
+
* (loaded)="onLoad()"
|
|
27
|
+
* />
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
declare class RiveCanvasComponent implements AfterViewInit {
|
|
31
|
+
#private;
|
|
32
|
+
private readonly canvas;
|
|
33
|
+
readonly src: _angular_core.InputSignal<string | undefined>;
|
|
34
|
+
readonly buffer: _angular_core.InputSignal<ArrayBuffer | undefined>;
|
|
35
|
+
/**
|
|
36
|
+
* Preloaded RiveFile instance (from RiveFileService).
|
|
37
|
+
* If provided, this takes precedence over src/buffer.
|
|
38
|
+
*/
|
|
39
|
+
readonly riveFile: _angular_core.InputSignal<RiveFile | undefined>;
|
|
40
|
+
readonly artboard: _angular_core.InputSignal<string | undefined>;
|
|
41
|
+
readonly animations: _angular_core.InputSignal<string | string[] | undefined>;
|
|
42
|
+
readonly stateMachines: _angular_core.InputSignal<string | string[] | undefined>;
|
|
43
|
+
readonly autoplay: _angular_core.InputSignal<boolean>;
|
|
44
|
+
readonly fit: _angular_core.InputSignal<Fit>;
|
|
45
|
+
readonly alignment: _angular_core.InputSignal<Alignment>;
|
|
46
|
+
readonly useOffscreenRenderer: _angular_core.InputSignal<boolean>;
|
|
47
|
+
/**
|
|
48
|
+
* Enable IntersectionObserver to automatically stop rendering when canvas is not visible.
|
|
49
|
+
* This optimizes performance by pausing animations that are off-screen.
|
|
50
|
+
*/
|
|
51
|
+
readonly shouldUseIntersectionObserver: _angular_core.InputSignal<boolean>;
|
|
52
|
+
/**
|
|
53
|
+
* Disable Rive event listeners on the canvas (pointer events, touch events).
|
|
54
|
+
* Useful for decorative animations without interactivity.
|
|
55
|
+
*/
|
|
56
|
+
readonly shouldDisableRiveListeners: _angular_core.InputSignal<boolean>;
|
|
57
|
+
/**
|
|
58
|
+
* Allow Rive to automatically handle Rive Events (e.g., OpenUrlEvent opens URLs).
|
|
59
|
+
* Default is false for security - events must be handled manually via riveEvent output.
|
|
60
|
+
*/
|
|
61
|
+
readonly automaticallyHandleEvents: _angular_core.InputSignal<boolean>;
|
|
62
|
+
readonly loaded: _angular_core.OutputEmitterRef<void>;
|
|
63
|
+
readonly loadError: _angular_core.OutputEmitterRef<Error>;
|
|
64
|
+
/**
|
|
65
|
+
* Emitted when state machine state changes.
|
|
66
|
+
* Contains information about the state change event.
|
|
67
|
+
*/
|
|
68
|
+
readonly stateChange: _angular_core.OutputEmitterRef<Event>;
|
|
69
|
+
/**
|
|
70
|
+
* Emitted for Rive Events (custom events defined in the .riv file).
|
|
71
|
+
* Use this to handle custom events like OpenUrlEvent, etc.
|
|
72
|
+
*/
|
|
73
|
+
readonly riveEvent: _angular_core.OutputEmitterRef<Event>;
|
|
74
|
+
/**
|
|
75
|
+
* Emitted when Rive instance is created and ready.
|
|
76
|
+
* Provides direct access to the Rive instance for advanced use cases.
|
|
77
|
+
*/
|
|
78
|
+
readonly riveReady: _angular_core.OutputEmitterRef<Rive>;
|
|
79
|
+
readonly isPlaying: _angular_core.WritableSignal<boolean>;
|
|
80
|
+
readonly isPaused: _angular_core.WritableSignal<boolean>;
|
|
81
|
+
readonly isLoaded: _angular_core.WritableSignal<boolean>;
|
|
82
|
+
/**
|
|
83
|
+
* Public signal providing access to the Rive instance.
|
|
84
|
+
* Use this to access advanced Rive SDK features.
|
|
85
|
+
*/
|
|
86
|
+
readonly riveInstance: _angular_core.WritableSignal<Rive | null>;
|
|
87
|
+
private resizeObserver;
|
|
88
|
+
private isInitialized;
|
|
89
|
+
private isPausedByIntersectionObserver;
|
|
90
|
+
private retestIntersectionTimeoutId;
|
|
91
|
+
constructor();
|
|
92
|
+
ngAfterViewInit(): void;
|
|
93
|
+
/**
|
|
94
|
+
* Setup ResizeObserver for automatic canvas sizing with DPR support
|
|
95
|
+
*/
|
|
96
|
+
private setupResizeObserver;
|
|
97
|
+
/**
|
|
98
|
+
* Disconnect ResizeObserver
|
|
99
|
+
*/
|
|
100
|
+
private disconnectResizeObserver;
|
|
101
|
+
/**
|
|
102
|
+
* Setup IntersectionObserver to stop rendering when canvas is not visible
|
|
103
|
+
*/
|
|
104
|
+
private setupIntersectionObserver;
|
|
105
|
+
/**
|
|
106
|
+
* Retest intersection - workaround for Chrome bug
|
|
107
|
+
*/
|
|
108
|
+
private retestIntersection;
|
|
109
|
+
/**
|
|
110
|
+
* Disconnect IntersectionObserver
|
|
111
|
+
*/
|
|
112
|
+
private disconnectIntersectionObserver;
|
|
113
|
+
/**
|
|
114
|
+
* Load animation from src or buffer
|
|
115
|
+
*/
|
|
116
|
+
private loadAnimation;
|
|
117
|
+
private onLoad;
|
|
118
|
+
private onLoadError;
|
|
119
|
+
private onPlay;
|
|
120
|
+
private onPause;
|
|
121
|
+
private onStop;
|
|
122
|
+
private onStateChange;
|
|
123
|
+
private onRiveEvent;
|
|
124
|
+
/**
|
|
125
|
+
* Play animation(s)
|
|
126
|
+
*/
|
|
127
|
+
playAnimation(animations?: string | string[]): void;
|
|
128
|
+
/**
|
|
129
|
+
* Pause animation(s)
|
|
130
|
+
*/
|
|
131
|
+
pauseAnimation(animations?: string | string[]): void;
|
|
132
|
+
/**
|
|
133
|
+
* Stop animation(s)
|
|
134
|
+
*/
|
|
135
|
+
stopAnimation(animations?: string | string[]): void;
|
|
136
|
+
/**
|
|
137
|
+
* Reset the animation to the beginning
|
|
138
|
+
*/
|
|
139
|
+
reset(): void;
|
|
140
|
+
/**
|
|
141
|
+
* Set a state machine input value
|
|
142
|
+
*/
|
|
143
|
+
setInput(stateMachineName: string, inputName: string, value: number | boolean): void;
|
|
144
|
+
/**
|
|
145
|
+
* Fire a state machine trigger
|
|
146
|
+
*/
|
|
147
|
+
fireTrigger(stateMachineName: string, triggerName: string): void;
|
|
148
|
+
/**
|
|
149
|
+
* Clean up Rive instance only
|
|
150
|
+
*/
|
|
151
|
+
private cleanupRive;
|
|
152
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RiveCanvasComponent, never>;
|
|
153
|
+
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; }; }, { "loaded": "loaded"; "loadError": "loadError"; "stateChange": "stateChange"; "riveEvent": "riveEvent"; "riveReady": "riveReady"; }, never, never, true, never>;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Status of RiveFile loading
|
|
158
|
+
*/
|
|
159
|
+
type FileStatus = 'idle' | 'loading' | 'success' | 'failed';
|
|
160
|
+
/**
|
|
161
|
+
* State of a loaded RiveFile
|
|
162
|
+
*/
|
|
163
|
+
interface RiveFileState {
|
|
164
|
+
riveFile: RiveFile | null;
|
|
165
|
+
status: FileStatus;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Parameters for loading a RiveFile
|
|
169
|
+
*/
|
|
170
|
+
interface RiveFileParams {
|
|
171
|
+
src?: string;
|
|
172
|
+
buffer?: ArrayBuffer;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Service for preloading and caching Rive files.
|
|
176
|
+
*
|
|
177
|
+
* This service allows you to:
|
|
178
|
+
* - Preload .riv files before they're needed
|
|
179
|
+
* - Share the same file across multiple components
|
|
180
|
+
* - Cache files to avoid redundant network requests
|
|
181
|
+
* - Deduplicate concurrent loads of the same file
|
|
182
|
+
*
|
|
183
|
+
* @example
|
|
184
|
+
* ```typescript
|
|
185
|
+
* export class MyComponent {
|
|
186
|
+
* private riveFileService = inject(RiveFileService);
|
|
187
|
+
* private destroyRef = inject(DestroyRef);
|
|
188
|
+
*
|
|
189
|
+
* fileState = this.riveFileService.loadFile({
|
|
190
|
+
* src: 'assets/animation.riv'
|
|
191
|
+
* });
|
|
192
|
+
*
|
|
193
|
+
* constructor() {
|
|
194
|
+
* // Auto-release on component destroy
|
|
195
|
+
* this.destroyRef.onDestroy(() => {
|
|
196
|
+
* this.riveFileService.releaseFile({ src: 'assets/animation.riv' });
|
|
197
|
+
* });
|
|
198
|
+
* }
|
|
199
|
+
* }
|
|
200
|
+
* ```
|
|
201
|
+
*/
|
|
202
|
+
declare class RiveFileService {
|
|
203
|
+
private cache;
|
|
204
|
+
private pendingLoads;
|
|
205
|
+
private bufferIdCounter;
|
|
206
|
+
/**
|
|
207
|
+
* Load a RiveFile from URL or ArrayBuffer.
|
|
208
|
+
* Returns a signal with the file state and loading status.
|
|
209
|
+
* Files are cached by src URL to avoid redundant loads.
|
|
210
|
+
* Concurrent loads of the same file are deduplicated.
|
|
211
|
+
*
|
|
212
|
+
* @param params - Parameters containing src URL or buffer
|
|
213
|
+
* @returns Signal with RiveFileState
|
|
214
|
+
*/
|
|
215
|
+
loadFile(params: RiveFileParams): Signal<RiveFileState>;
|
|
216
|
+
/**
|
|
217
|
+
* Release a cached file. Decrements reference count and cleans up if no longer used.
|
|
218
|
+
*
|
|
219
|
+
* @param params - Parameters used to load the file
|
|
220
|
+
*/
|
|
221
|
+
releaseFile(params: RiveFileParams): void;
|
|
222
|
+
/**
|
|
223
|
+
* Clear all cached files
|
|
224
|
+
*/
|
|
225
|
+
clearCache(): void;
|
|
226
|
+
/**
|
|
227
|
+
* Get cache key from params
|
|
228
|
+
*/
|
|
229
|
+
private getCacheKey;
|
|
230
|
+
/**
|
|
231
|
+
* Load RiveFile and update state signal
|
|
232
|
+
*/
|
|
233
|
+
private loadRiveFile;
|
|
234
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RiveFileService, never>;
|
|
235
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<RiveFileService>;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Re-export Rive SDK types for consumer convenience
|
|
240
|
+
*/
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Error thrown when Rive animation fails to load
|
|
244
|
+
*/
|
|
245
|
+
declare class RiveLoadError extends Error {
|
|
246
|
+
readonly originalError?: Error | undefined;
|
|
247
|
+
constructor(message: string, originalError?: Error | undefined);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
export { RiveCanvasComponent, RiveFileService, RiveLoadError };
|
|
251
|
+
export type { FileStatus, RiveFileParams, RiveFileState };
|