@hypertools/sdk 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.
Files changed (107) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +443 -0
  3. package/dist/capture/CaptureManager.d.ts +55 -0
  4. package/dist/capture/CaptureManager.d.ts.map +1 -0
  5. package/dist/capture/index.d.ts +27 -0
  6. package/dist/capture/index.d.ts.map +1 -0
  7. package/dist/capture/index.js +11 -0
  8. package/dist/capture/index.js.map +10 -0
  9. package/dist/capture/types.d.ts +76 -0
  10. package/dist/capture/types.d.ts.map +1 -0
  11. package/dist/codegen/index.d.ts +6 -0
  12. package/dist/codegen/index.d.ts.map +1 -0
  13. package/dist/codegen/index.js +800 -0
  14. package/dist/codegen/index.js.map +13 -0
  15. package/dist/controls/HypertoolControls.d.ts +84 -0
  16. package/dist/controls/HypertoolControls.d.ts.map +1 -0
  17. package/dist/controls/index.d.ts +11 -0
  18. package/dist/controls/index.d.ts.map +1 -0
  19. package/dist/controls/index.js +28 -0
  20. package/dist/controls/index.js.map +12 -0
  21. package/dist/controls/simple-api.d.ts +43 -0
  22. package/dist/controls/simple-api.d.ts.map +1 -0
  23. package/dist/controls/theme.d.ts +80 -0
  24. package/dist/controls/theme.d.ts.map +1 -0
  25. package/dist/controls/types.d.ts +178 -0
  26. package/dist/controls/types.d.ts.map +1 -0
  27. package/dist/core/EventEmitter.d.ts +76 -0
  28. package/dist/core/EventEmitter.d.ts.map +1 -0
  29. package/dist/core/Experience.d.ts +128 -0
  30. package/dist/core/Experience.d.ts.map +1 -0
  31. package/dist/core/ObjectRegistry.d.ts +76 -0
  32. package/dist/core/ObjectRegistry.d.ts.map +1 -0
  33. package/dist/core/ParamStore.d.ts +66 -0
  34. package/dist/core/ParamStore.d.ts.map +1 -0
  35. package/dist/core/index.d.ts +12 -0
  36. package/dist/core/index.d.ts.map +1 -0
  37. package/dist/core/index.js +3 -0
  38. package/dist/core/index.js.map +13 -0
  39. package/dist/export/bundler.d.ts +55 -0
  40. package/dist/export/bundler.d.ts.map +1 -0
  41. package/dist/export/generators/index.d.ts +6 -0
  42. package/dist/export/generators/index.d.ts.map +1 -0
  43. package/dist/export/generators/webComponent.d.ts +29 -0
  44. package/dist/export/generators/webComponent.d.ts.map +1 -0
  45. package/dist/export/index.d.ts +19 -0
  46. package/dist/export/index.d.ts.map +1 -0
  47. package/dist/export/index.js +800 -0
  48. package/dist/export/index.js.map +13 -0
  49. package/dist/export/runtime.d.ts +46 -0
  50. package/dist/export/runtime.d.ts.map +1 -0
  51. package/dist/frame/cssBridge.d.ts +34 -0
  52. package/dist/frame/cssBridge.d.ts.map +1 -0
  53. package/dist/frame/index.d.ts +9 -0
  54. package/dist/frame/index.d.ts.map +1 -0
  55. package/dist/frame/index.js +3 -0
  56. package/dist/frame/index.js.map +24 -0
  57. package/dist/frame/runtime.d.ts +39 -0
  58. package/dist/frame/runtime.d.ts.map +1 -0
  59. package/dist/frame/types.d.ts +119 -0
  60. package/dist/frame/types.d.ts.map +1 -0
  61. package/dist/frame/utils/dom.d.ts +11 -0
  62. package/dist/frame/utils/dom.d.ts.map +1 -0
  63. package/dist/frame/wrapper-app/WrapperApp.d.ts +16 -0
  64. package/dist/frame/wrapper-app/WrapperApp.d.ts.map +1 -0
  65. package/dist/frame/wrapper-app/components/CanvasSizeWidget.d.ts +17 -0
  66. package/dist/frame/wrapper-app/components/CanvasSizeWidget.d.ts.map +1 -0
  67. package/dist/frame/wrapper-app/components/ControlsPanel.d.ts +11 -0
  68. package/dist/frame/wrapper-app/components/ControlsPanel.d.ts.map +1 -0
  69. package/dist/frame/wrapper-app/components/ExportWidget.d.ts +16 -0
  70. package/dist/frame/wrapper-app/components/ExportWidget.d.ts.map +1 -0
  71. package/dist/frame/wrapper-app/components/ResizeHandles.d.ts +19 -0
  72. package/dist/frame/wrapper-app/components/ResizeHandles.d.ts.map +1 -0
  73. package/dist/frame/wrapper-app/components/SandboxContainer.d.ts +16 -0
  74. package/dist/frame/wrapper-app/components/SandboxContainer.d.ts.map +1 -0
  75. package/dist/frame/wrapper-app/components/index.d.ts +5 -0
  76. package/dist/frame/wrapper-app/components/index.d.ts.map +1 -0
  77. package/dist/frame/wrapper-app/context/CanvasContext.d.ts +37 -0
  78. package/dist/frame/wrapper-app/context/CanvasContext.d.ts.map +1 -0
  79. package/dist/frame/wrapper-app/context/index.d.ts +2 -0
  80. package/dist/frame/wrapper-app/context/index.d.ts.map +1 -0
  81. package/dist/frame/wrapper-app/index.d.ts +9 -0
  82. package/dist/frame/wrapper-app/index.d.ts.map +1 -0
  83. package/dist/frame/wrapper-app/types.d.ts +38 -0
  84. package/dist/frame/wrapper-app/types.d.ts.map +1 -0
  85. package/dist/index.d.ts +30 -0
  86. package/dist/index.d.ts.map +1 -0
  87. package/dist/index.js +189 -0
  88. package/dist/index.js.map +35 -0
  89. package/dist/react/ExperienceView.d.ts +53 -0
  90. package/dist/react/ExperienceView.d.ts.map +1 -0
  91. package/dist/react/index.d.ts +8 -0
  92. package/dist/react/index.d.ts.map +1 -0
  93. package/dist/react/index.js +3 -0
  94. package/dist/react/index.js.map +15 -0
  95. package/dist/react/useExperience.d.ts +55 -0
  96. package/dist/react/useExperience.d.ts.map +1 -0
  97. package/dist/recording/ImageCapture.d.ts +46 -0
  98. package/dist/recording/ImageCapture.d.ts.map +1 -0
  99. package/dist/recording/Timeline.d.ts +105 -0
  100. package/dist/recording/Timeline.d.ts.map +1 -0
  101. package/dist/recording/VideoRecorder.d.ts +64 -0
  102. package/dist/recording/VideoRecorder.d.ts.map +1 -0
  103. package/dist/recording/index.d.ts +10 -0
  104. package/dist/recording/index.d.ts.map +1 -0
  105. package/dist/recording/index.js +3 -0
  106. package/dist/recording/index.js.map +12 -0
  107. package/package.json +141 -0
@@ -0,0 +1,12 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/recording/VideoRecorder.ts", "../../src/recording/ImageCapture.ts", "../../src/recording/Timeline.ts"],
4
+ "sourcesContent": [
5
+ "/**\n * Video recording using MediaRecorder API\n */\n\nexport interface RecordingOptions {\n /** Output format (default: 'webm') */\n format?: 'webm' | 'mp4';\n\n /** Video quality (0-1, default: 0.9) */\n quality?: number;\n\n /** Frame rate (default: 60) */\n frameRate?: number;\n\n /** Maximum recording duration in seconds */\n maxDuration?: number;\n\n /** Video bitrate in bits per second */\n videoBitsPerSecond?: number;\n\n /** Audio bitrate (if audio track present) */\n audioBitsPerSecond?: number;\n}\n\nexport interface RecorderHandle {\n /** Whether currently recording */\n readonly isRecording: boolean;\n\n /** Current recording duration in seconds */\n readonly duration: number;\n\n /** Progress (0-1) if maxDuration set */\n readonly progress: number;\n\n /** Stop recording and get the blob */\n stop(): Promise<Blob>;\n\n /** Pause recording */\n pause(): void;\n\n /** Resume recording */\n resume(): void;\n\n /** Cancel recording without getting result */\n cancel(): void;\n}\n\nexport class VideoRecorder {\n private _canvas: HTMLCanvasElement | null = null;\n private _recorder: MediaRecorder | null = null;\n private _chunks: Blob[] = [];\n private _startTime = 0;\n private _isRecording = false;\n private _isPaused = false;\n private _maxDurationTimer?: ReturnType<typeof setTimeout>;\n\n constructor(canvas: HTMLCanvasElement) {\n this._canvas = canvas;\n }\n\n /**\n * Check if MediaRecorder is supported\n */\n static isSupported(): boolean {\n return typeof MediaRecorder !== 'undefined' &&\n typeof HTMLCanvasElement.prototype.captureStream === 'function';\n }\n\n /**\n * Get supported MIME types\n */\n static getSupportedMimeTypes(): string[] {\n const types = [\n 'video/webm;codecs=vp9',\n 'video/webm;codecs=vp8',\n 'video/webm',\n 'video/mp4;codecs=h264',\n 'video/mp4',\n ];\n return types.filter((type) => MediaRecorder.isTypeSupported(type));\n }\n\n /**\n * Start recording\n */\n start(options: RecordingOptions = {}): RecorderHandle {\n if (!this._canvas) {\n throw new Error('No canvas provided');\n }\n\n if (this._isRecording) {\n throw new Error('Already recording');\n }\n\n const frameRate = options.frameRate ?? 60;\n const stream = this._canvas.captureStream(frameRate);\n\n // Determine MIME type\n let mimeType: string;\n if (options.format === 'mp4') {\n mimeType = MediaRecorder.isTypeSupported('video/mp4;codecs=h264')\n ? 'video/mp4;codecs=h264'\n : 'video/mp4';\n } else {\n mimeType = MediaRecorder.isTypeSupported('video/webm;codecs=vp9')\n ? 'video/webm;codecs=vp9'\n : 'video/webm';\n }\n\n // Create recorder\n this._recorder = new MediaRecorder(stream, {\n mimeType,\n videoBitsPerSecond: options.videoBitsPerSecond ?? 5_000_000,\n audioBitsPerSecond: options.audioBitsPerSecond,\n });\n\n this._chunks = [];\n this._startTime = Date.now();\n this._isRecording = true;\n this._isPaused = false;\n\n // Collect data\n this._recorder.ondataavailable = (event) => {\n if (event.data.size > 0) {\n this._chunks.push(event.data);\n }\n };\n\n // Start recording (collect data every 100ms for smoother progress)\n this._recorder.start(100);\n\n // Auto-stop at max duration\n if (options.maxDuration) {\n this._maxDurationTimer = setTimeout(() => {\n if (this._isRecording) {\n this._recorder?.stop();\n }\n }, options.maxDuration * 1000);\n }\n\n // Return handle\n const self = this;\n return {\n get isRecording() {\n return self._isRecording;\n },\n get duration() {\n if (!self._isRecording) return 0;\n return (Date.now() - self._startTime) / 1000;\n },\n get progress() {\n if (!options.maxDuration) return 0;\n return Math.min(1, this.duration / options.maxDuration);\n },\n stop: () => self._stop(),\n pause: () => self._pause(),\n resume: () => self._resume(),\n cancel: () => self._cancel(),\n };\n }\n\n private _stop(): Promise<Blob> {\n return new Promise((resolve, reject) => {\n if (!this._recorder) {\n reject(new Error('No active recording'));\n return;\n }\n\n if (this._maxDurationTimer) {\n clearTimeout(this._maxDurationTimer);\n }\n\n this._recorder.onstop = () => {\n this._isRecording = false;\n this._isPaused = false;\n\n const mimeType = this._recorder?.mimeType ?? 'video/webm';\n const blob = new Blob(this._chunks, { type: mimeType });\n\n this._recorder = null;\n this._chunks = [];\n\n resolve(blob);\n };\n\n this._recorder.onerror = (event) => {\n this._isRecording = false;\n reject(new Error('Recording failed'));\n };\n\n this._recorder.stop();\n });\n }\n\n private _pause(): void {\n if (this._recorder && this._isRecording && !this._isPaused) {\n this._recorder.pause();\n this._isPaused = true;\n }\n }\n\n private _resume(): void {\n if (this._recorder && this._isRecording && this._isPaused) {\n this._recorder.resume();\n this._isPaused = false;\n }\n }\n\n private _cancel(): void {\n if (this._maxDurationTimer) {\n clearTimeout(this._maxDurationTimer);\n }\n\n if (this._recorder && this._isRecording) {\n this._recorder.onstop = null;\n this._recorder.stop();\n }\n\n this._isRecording = false;\n this._isPaused = false;\n this._recorder = null;\n this._chunks = [];\n }\n\n /**\n * Dispose the recorder\n */\n dispose(): void {\n this._cancel();\n this._canvas = null;\n }\n}\n",
6
+ "/**\n * Image capture utilities for canvas\n */\n\nexport interface CaptureOptions {\n /** Image format (default: 'png') */\n format?: 'png' | 'jpeg' | 'webp';\n\n /** Quality for jpeg/webp (0-1, default: 0.92) */\n quality?: number;\n\n /** Optional filename for download */\n filename?: string;\n\n /** Scale factor (default: 1) */\n scale?: number;\n}\n\nexport interface CaptureResult {\n blob: Blob;\n url: string;\n width: number;\n height: number;\n format: string;\n}\n\nexport class ImageCapture {\n private _canvas: HTMLCanvasElement | null = null;\n\n constructor(canvas: HTMLCanvasElement) {\n this._canvas = canvas;\n }\n\n /**\n * Capture current canvas state as blob\n */\n async capture(options: CaptureOptions = {}): Promise<CaptureResult | null> {\n if (!this._canvas) {\n console.warn('[ImageCapture] No canvas provided');\n return null;\n }\n\n const format = options.format ?? 'png';\n const quality = options.quality ?? 0.92;\n const scale = options.scale ?? 1;\n\n let canvas = this._canvas;\n\n // Handle scaling\n if (scale !== 1) {\n canvas = this._createScaledCanvas(scale);\n }\n\n const mimeType = `image/${format}`;\n\n return new Promise((resolve) => {\n canvas.toBlob(\n (blob) => {\n if (!blob) {\n resolve(null);\n return;\n }\n\n const url = URL.createObjectURL(blob);\n resolve({\n blob,\n url,\n width: canvas.width,\n height: canvas.height,\n format,\n });\n },\n mimeType,\n format === 'png' ? undefined : quality\n );\n });\n }\n\n /**\n * Capture and download immediately\n */\n async download(options: CaptureOptions = {}): Promise<void> {\n const result = await this.capture(options);\n if (!result) {\n console.warn('[ImageCapture] Capture failed');\n return;\n }\n\n const filename = options.filename ?? `capture-${Date.now()}.${options.format ?? 'png'}`;\n\n const link = document.createElement('a');\n link.href = result.url;\n link.download = filename;\n link.click();\n\n // Cleanup URL after download starts\n setTimeout(() => URL.revokeObjectURL(result.url), 1000);\n }\n\n /**\n * Capture as data URL\n */\n toDataURL(options: CaptureOptions = {}): string {\n if (!this._canvas) {\n throw new Error('No canvas provided');\n }\n\n const format = options.format ?? 'png';\n const quality = options.quality ?? 0.92;\n const mimeType = `image/${format}`;\n\n return this._canvas.toDataURL(mimeType, format === 'png' ? undefined : quality);\n }\n\n /**\n * Copy to clipboard (if supported)\n */\n async copyToClipboard(options: CaptureOptions = {}): Promise<boolean> {\n if (!navigator.clipboard?.write) {\n console.warn('[ImageCapture] Clipboard API not supported');\n return false;\n }\n\n const result = await this.capture({ ...options, format: 'png' });\n if (!result) {\n return false;\n }\n\n try {\n await navigator.clipboard.write([\n new ClipboardItem({ 'image/png': result.blob }),\n ]);\n URL.revokeObjectURL(result.url);\n return true;\n } catch (error) {\n console.error('[ImageCapture] Clipboard write failed:', error);\n URL.revokeObjectURL(result.url);\n return false;\n }\n }\n\n private _createScaledCanvas(scale: number): HTMLCanvasElement {\n if (!this._canvas) {\n throw new Error('No canvas provided');\n }\n\n const scaled = document.createElement('canvas');\n scaled.width = Math.floor(this._canvas.width * scale);\n scaled.height = Math.floor(this._canvas.height * scale);\n\n const ctx = scaled.getContext('2d');\n if (ctx) {\n ctx.scale(scale, scale);\n ctx.drawImage(this._canvas, 0, 0);\n }\n\n return scaled;\n }\n\n /**\n * Dispose the capture instance\n */\n dispose(): void {\n this._canvas = null;\n }\n}\n",
7
+ "/**\n * Keyframe-based timeline animation system\n */\n\nexport type EasingFunction =\n | 'linear'\n | 'ease-in'\n | 'ease-out'\n | 'ease-in-out'\n | 'ease-in-quad'\n | 'ease-out-quad'\n | 'ease-in-cubic'\n | 'ease-out-cubic'\n | ((t: number) => number);\n\nexport interface TimelineKeyframe {\n time: number;\n params: Record<string, unknown>;\n easing?: EasingFunction;\n}\n\nexport interface TimelineOptions {\n /** Loop the timeline (default: false) */\n loop?: boolean;\n\n /** Auto-start (default: false) */\n autoplay?: boolean;\n\n /** Playback speed multiplier (default: 1) */\n speed?: number;\n}\n\nexport interface TimelineState {\n currentTime: number;\n duration: number;\n isPlaying: boolean;\n isPaused: boolean;\n progress: number;\n}\n\ntype ParamSetter = (params: Record<string, unknown>) => void;\n\n// Built-in easing functions\nconst EASING_FUNCTIONS: Record<string, (t: number) => number> = {\n linear: (t) => t,\n 'ease-in': (t) => t * t,\n 'ease-out': (t) => t * (2 - t),\n 'ease-in-out': (t) => (t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t),\n 'ease-in-quad': (t) => t * t,\n 'ease-out-quad': (t) => t * (2 - t),\n 'ease-in-cubic': (t) => t * t * t,\n 'ease-out-cubic': (t) => --t * t * t + 1,\n};\n\nexport class Timeline {\n private _keyframes: TimelineKeyframe[] = [];\n private _duration = 0;\n private _currentTime = 0;\n private _isPlaying = false;\n private _isPaused = false;\n private _options: Required<TimelineOptions>;\n private _animationFrame?: number;\n private _lastTickTime = 0;\n private _paramSetter: ParamSetter;\n private _onComplete?: () => void;\n private _onUpdate?: (state: TimelineState) => void;\n\n constructor(paramSetter: ParamSetter, options: TimelineOptions = {}) {\n this._paramSetter = paramSetter;\n this._options = {\n loop: options.loop ?? false,\n autoplay: options.autoplay ?? false,\n speed: options.speed ?? 1,\n };\n\n if (this._options.autoplay) {\n this.play();\n }\n }\n\n // ===== Keyframe Management =====\n\n /**\n * Add a keyframe at specified time\n */\n addKeyframe(\n time: number,\n params: Record<string, unknown>,\n easing?: EasingFunction\n ): this {\n this._keyframes.push({ time, params, easing });\n this._keyframes.sort((a, b) => a.time - b.time);\n this._recalculateDuration();\n return this;\n }\n\n /**\n * Remove keyframe at specified time\n */\n removeKeyframe(time: number): this {\n this._keyframes = this._keyframes.filter((kf) => kf.time !== time);\n this._recalculateDuration();\n return this;\n }\n\n /**\n * Remove all keyframes\n */\n clearKeyframes(): this {\n this._keyframes = [];\n this._duration = 0;\n return this;\n }\n\n /**\n * Get all keyframes\n */\n getKeyframes(): TimelineKeyframe[] {\n return [...this._keyframes];\n }\n\n // ===== Playback Control =====\n\n /**\n * Start playing timeline\n */\n play(): this {\n if (this._isPlaying && !this._isPaused) return this;\n\n this._isPlaying = true;\n this._isPaused = false;\n this._lastTickTime = performance.now();\n this._tick();\n return this;\n }\n\n /**\n * Pause timeline\n */\n pause(): this {\n this._isPaused = true;\n if (this._animationFrame) {\n cancelAnimationFrame(this._animationFrame);\n this._animationFrame = undefined;\n }\n return this;\n }\n\n /**\n * Stop and reset to start\n */\n stop(): this {\n this._isPlaying = false;\n this._isPaused = false;\n this._currentTime = 0;\n if (this._animationFrame) {\n cancelAnimationFrame(this._animationFrame);\n this._animationFrame = undefined;\n }\n this._applyParamsAtTime(0);\n return this;\n }\n\n /**\n * Seek to specific time\n */\n seek(time: number): this {\n this._currentTime = Math.max(0, Math.min(time, this._duration));\n this._applyParamsAtTime(this._currentTime);\n return this;\n }\n\n /**\n * Seek to progress (0-1)\n */\n seekProgress(progress: number): this {\n return this.seek(progress * this._duration);\n }\n\n /**\n * Set playback speed\n */\n setSpeed(speed: number): this {\n this._options.speed = speed;\n return this;\n }\n\n // ===== State =====\n\n get duration(): number {\n return this._duration;\n }\n\n get currentTime(): number {\n return this._currentTime;\n }\n\n get isPlaying(): boolean {\n return this._isPlaying && !this._isPaused;\n }\n\n get isPaused(): boolean {\n return this._isPaused;\n }\n\n get progress(): number {\n return this._duration > 0 ? this._currentTime / this._duration : 0;\n }\n\n getState(): TimelineState {\n return {\n currentTime: this._currentTime,\n duration: this._duration,\n isPlaying: this._isPlaying && !this._isPaused,\n isPaused: this._isPaused,\n progress: this.progress,\n };\n }\n\n // ===== Events =====\n\n /**\n * Called when timeline completes (or loops)\n */\n onComplete(callback: () => void): this {\n this._onComplete = callback;\n return this;\n }\n\n /**\n * Called on each update\n */\n onUpdate(callback: (state: TimelineState) => void): this {\n this._onUpdate = callback;\n return this;\n }\n\n // ===== Internal =====\n\n private _tick(): void {\n if (!this._isPlaying || this._isPaused) return;\n\n const now = performance.now();\n const delta = (now - this._lastTickTime) * this._options.speed;\n this._lastTickTime = now;\n\n this._currentTime += delta / 1000; // Convert to seconds\n\n // Check for completion\n if (this._currentTime >= this._duration) {\n if (this._options.loop) {\n this._currentTime = this._currentTime % this._duration;\n } else {\n this._currentTime = this._duration;\n this._isPlaying = false;\n this._applyParamsAtTime(this._currentTime);\n this._onComplete?.();\n this._onUpdate?.(this.getState());\n return;\n }\n }\n\n this._applyParamsAtTime(this._currentTime);\n this._onUpdate?.(this.getState());\n\n this._animationFrame = requestAnimationFrame(() => this._tick());\n }\n\n private _applyParamsAtTime(time: number): void {\n if (this._keyframes.length === 0) return;\n\n // Find surrounding keyframes\n let prevKf: TimelineKeyframe | null = null;\n let nextKf: TimelineKeyframe | null = null;\n\n for (let i = 0; i < this._keyframes.length; i++) {\n if (this._keyframes[i].time <= time) {\n prevKf = this._keyframes[i];\n }\n if (this._keyframes[i].time >= time && !nextKf) {\n nextKf = this._keyframes[i];\n }\n }\n\n // If before first keyframe, use first\n if (!prevKf && nextKf) {\n this._paramSetter(nextKf.params);\n return;\n }\n\n // If after last keyframe, use last\n if (prevKf && !nextKf) {\n this._paramSetter(prevKf.params);\n return;\n }\n\n // If same keyframe, just apply\n if (prevKf && nextKf && prevKf.time === nextKf.time) {\n this._paramSetter(prevKf.params);\n return;\n }\n\n // Interpolate between keyframes\n if (prevKf && nextKf) {\n const duration = nextKf.time - prevKf.time;\n const elapsed = time - prevKf.time;\n const rawProgress = duration > 0 ? elapsed / duration : 1;\n\n // Apply easing\n const easing = nextKf.easing ?? 'linear';\n const easingFn =\n typeof easing === 'function'\n ? easing\n : EASING_FUNCTIONS[easing] ?? EASING_FUNCTIONS.linear;\n const progress = easingFn(rawProgress);\n\n // Interpolate params\n const interpolated: Record<string, unknown> = {};\n\n // Get all param keys from both keyframes\n const allKeys = new Set([\n ...Object.keys(prevKf.params),\n ...Object.keys(nextKf.params),\n ]);\n\n for (const key of allKeys) {\n const prevVal = prevKf.params[key];\n const nextVal = nextKf.params[key];\n\n if (prevVal === undefined) {\n interpolated[key] = nextVal;\n } else if (nextVal === undefined) {\n interpolated[key] = prevVal;\n } else {\n interpolated[key] = this._interpolateValue(prevVal, nextVal, progress);\n }\n }\n\n this._paramSetter(interpolated);\n }\n }\n\n private _interpolateValue(from: unknown, to: unknown, t: number): unknown {\n // Number interpolation\n if (typeof from === 'number' && typeof to === 'number') {\n return from + (to - from) * t;\n }\n\n // Color interpolation (hex)\n if (\n typeof from === 'string' &&\n typeof to === 'string' &&\n from.startsWith('#') &&\n to.startsWith('#')\n ) {\n return this._interpolateColor(from, to, t);\n }\n\n // Boolean - snap at 0.5\n if (typeof from === 'boolean' && typeof to === 'boolean') {\n return t < 0.5 ? from : to;\n }\n\n // String - snap at 0.5\n if (typeof from === 'string' && typeof to === 'string') {\n return t < 0.5 ? from : to;\n }\n\n // Default: snap at 0.5\n return t < 0.5 ? from : to;\n }\n\n private _interpolateColor(from: string, to: string, t: number): string {\n const fromRgb = this._hexToRgb(from);\n const toRgb = this._hexToRgb(to);\n\n if (!fromRgb || !toRgb) return from;\n\n const r = Math.round(fromRgb.r + (toRgb.r - fromRgb.r) * t);\n const g = Math.round(fromRgb.g + (toRgb.g - fromRgb.g) * t);\n const b = Math.round(fromRgb.b + (toRgb.b - fromRgb.b) * t);\n\n return `#${r.toString(16).padStart(2, '0')}${g.toString(16).padStart(2, '0')}${b.toString(16).padStart(2, '0')}`;\n }\n\n private _hexToRgb(hex: string): { r: number; g: number; b: number } | null {\n const result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n return result\n ? {\n r: parseInt(result[1], 16),\n g: parseInt(result[2], 16),\n b: parseInt(result[3], 16),\n }\n : null;\n }\n\n private _recalculateDuration(): void {\n this._duration =\n this._keyframes.length > 0\n ? Math.max(...this._keyframes.map((kf) => kf.time))\n : 0;\n }\n\n /**\n * Dispose the timeline\n */\n dispose(): void {\n this.stop();\n this._keyframes = [];\n this._onComplete = undefined;\n this._onUpdate = undefined;\n }\n}\n"
8
+ ],
9
+ "mappings": "AA+CO,MAAM,CAAc,CACjB,QAAoC,KACpC,UAAkC,KAClC,QAAkB,CAAC,EACnB,WAAa,EACb,aAAe,GACf,UAAY,GACZ,kBAER,WAAW,CAAC,EAA2B,CACrC,KAAK,QAAU,QAMV,YAAW,EAAY,CAC5B,OAAO,OAAO,cAAkB,KAC9B,OAAO,kBAAkB,UAAU,gBAAkB,iBAMlD,sBAAqB,EAAa,CAQvC,MAPc,CACZ,wBACA,wBACA,aACA,wBACA,WACF,EACa,OAAO,CAAC,IAAS,cAAc,gBAAgB,CAAI,CAAC,EAMnE,KAAK,CAAC,EAA4B,CAAC,EAAmB,CACpD,GAAI,CAAC,KAAK,QACR,MAAU,MAAM,oBAAoB,EAGtC,GAAI,KAAK,aACP,MAAU,MAAM,mBAAmB,EAGrC,IAAM,EAAY,EAAQ,WAAa,GACjC,EAAS,KAAK,QAAQ,cAAc,CAAS,EAG/C,EACJ,GAAI,EAAQ,SAAW,MACrB,EAAW,cAAc,gBAAgB,uBAAuB,EAC5D,wBACA,YAEJ,OAAW,cAAc,gBAAgB,uBAAuB,EAC5D,wBACA,aA0BN,GAtBA,KAAK,UAAY,IAAI,cAAc,EAAQ,CACzC,WACA,mBAAoB,EAAQ,oBAAsB,QAClD,mBAAoB,EAAQ,kBAC9B,CAAC,EAED,KAAK,QAAU,CAAC,EAChB,KAAK,WAAa,KAAK,IAAI,EAC3B,KAAK,aAAe,GACpB,KAAK,UAAY,GAGjB,KAAK,UAAU,gBAAkB,CAAC,IAAU,CAC1C,GAAI,EAAM,KAAK,KAAO,EACpB,KAAK,QAAQ,KAA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AAyD,CACzE,IAAM,EAAS,4CAA4C,KAAK,CAAG,EACnE,OAAO,EACH,CACE,EAAG,SAAS,EAAO,GAAI,EAAE,EACzB,EAAG,SAAS,EAAO,GAAI,EAAE,EACzB,EAAG,SAAS,EAAO,GAAI,EAAE,CAC3B,EACA,KAGE,oBAAoB,EAAS,CACnC,KAAK,UACH,KAAK,WAAW,OAAS,EACrB,KAAK,IAAI,GAAG,KAAK,WAAW,IAAI,CAAC,IAAO,EAAG,IAAI,CAAC,EAChD,EAMR,OAAO,EAAS,CACd,KAAK,KAAK,EACV,KAAK,WAAa,CAAC,EACnB,KAAK,YAAc,OACnB,KAAK,UAAY,OAErB",
10
+ "debugId": "937A1AEA73EE788364756E2164756E21",
11
+ "names": []
12
+ }
package/package.json ADDED
@@ -0,0 +1,141 @@
1
+ {
2
+ "name": "@hypertools/sdk",
3
+ "version": "0.1.0",
4
+ "description": "Vanilla-first SDK for embedding interactive creative coding experiences. Supports p5.js, Three.js, WebGL, and more.",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "license": "MIT",
10
+ "author": "HyperTool Team",
11
+ "homepage": "https://github.com/hypertool/sdk#readme",
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git+https://github.com/hypertool/sdk.git",
15
+ "directory": "packages/sdk"
16
+ },
17
+ "bugs": {
18
+ "url": "https://github.com/hypertool/sdk/issues"
19
+ },
20
+ "keywords": [
21
+ "hypertool",
22
+ "creative-coding",
23
+ "p5js",
24
+ "threejs",
25
+ "webgl",
26
+ "canvas",
27
+ "generative-art",
28
+ "interactive",
29
+ "visualization",
30
+ "sandbox",
31
+ "embed",
32
+ "recording",
33
+ "video-capture",
34
+ "image-capture"
35
+ ],
36
+ "files": [
37
+ "dist/index.js",
38
+ "dist/index.d.ts",
39
+ "dist/index.js.map",
40
+ "dist/index.d.ts.map",
41
+ "dist/core",
42
+ "dist/controls",
43
+ "dist/recording",
44
+ "dist/react",
45
+ "dist/capture",
46
+ "dist/export",
47
+ "dist/codegen",
48
+ "dist/frame",
49
+ "README.md",
50
+ "LICENSE"
51
+ ],
52
+ "sideEffects": false,
53
+ "exports": {
54
+ ".": {
55
+ "types": "./dist/index.d.ts",
56
+ "import": "./dist/index.js"
57
+ },
58
+ "./controls": {
59
+ "types": "./dist/controls/index.d.ts",
60
+ "import": "./dist/controls/index.js"
61
+ },
62
+ "./recording": {
63
+ "types": "./dist/recording/index.d.ts",
64
+ "import": "./dist/recording/index.js"
65
+ },
66
+ "./react": {
67
+ "types": "./dist/react/index.d.ts",
68
+ "import": "./dist/react/index.js"
69
+ },
70
+ "./capture": {
71
+ "types": "./dist/capture/index.d.ts",
72
+ "import": "./dist/capture/index.js"
73
+ },
74
+ "./export": {
75
+ "types": "./dist/export/index.d.ts",
76
+ "import": "./dist/export/index.js"
77
+ },
78
+ "./codegen": {
79
+ "types": "./dist/codegen/index.d.ts",
80
+ "import": "./dist/codegen/index.js"
81
+ },
82
+ "./frame": {
83
+ "types": "./dist/frame/index.d.ts",
84
+ "import": "./dist/frame/index.js"
85
+ }
86
+ },
87
+ "scripts": {
88
+ "build": "bun run build:bundles && bun run build:types",
89
+ "build:bundles": "bun run build.config.ts",
90
+ "build:types": "tsc --project tsconfig.json --emitDeclarationOnly",
91
+ "dev": "bun run build-dev.config.ts",
92
+ "clean": "rm -rf dist",
93
+ "prepublishOnly": "bun run clean && bun run build",
94
+ "release": "bun run build && npm publish --access public",
95
+ "release:dry": "bun run build && npm publish --access public --dry-run",
96
+ "version:patch": "npm version patch",
97
+ "version:minor": "npm version minor",
98
+ "version:major": "npm version major"
99
+ },
100
+ "engines": {
101
+ "node": ">=18.0.0"
102
+ },
103
+ "peerDependencies": {
104
+ "react": "^18.3.1 || ^19.0.0",
105
+ "react-dom": "^18.3.1 || ^19.0.0",
106
+ "p5": "^1.9.0",
107
+ "three": "^0.160.0",
108
+ "tweakpane": "^4.0.5"
109
+ },
110
+ "peerDependenciesMeta": {
111
+ "react": {
112
+ "optional": true
113
+ },
114
+ "react-dom": {
115
+ "optional": true
116
+ },
117
+ "p5": {
118
+ "optional": true
119
+ },
120
+ "three": {
121
+ "optional": true
122
+ },
123
+ "tweakpane": {
124
+ "optional": true
125
+ }
126
+ },
127
+ "devDependencies": {
128
+ "@types/p5": "^1.6.3",
129
+ "@types/react": "^18.3.1",
130
+ "@types/react-dom": "^18.3.1",
131
+ "@types/three": "^0.160.0",
132
+ "@types/bun": "^1.3.0",
133
+ "esbuild": "^0.27.2",
134
+ "p5": "^1.9.0",
135
+ "three": "^0.160.0",
136
+ "tweakpane": "^4.0.5",
137
+ "react": "^18.3.1",
138
+ "react-dom": "^18.3.1",
139
+ "typescript": "^5.6.2"
140
+ }
141
+ }