@luma.gl/engine 10.0.0-alpha.3 → 10.0.0-alpha.5

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 (673) hide show
  1. package/README.md +9 -0
  2. package/dist/animation/animation-clip.cjs +36 -0
  3. package/dist/animation/animation-interpolation.cjs +115 -0
  4. package/dist/animation/animation-mixer.cjs +302 -0
  5. package/dist/animation/animation-track.cjs +55 -0
  6. package/dist/animation/animator.cjs +75 -0
  7. package/dist/animation/deform-positions.cjs +69 -0
  8. package/dist/animation/deform-positions.d.ts +13 -0
  9. package/dist/animation/deform-positions.d.ts.map +1 -0
  10. package/dist/animation/deform-positions.js +49 -0
  11. package/dist/animation/deform-positions.js.map +1 -0
  12. package/dist/animation/key-frames.cjs +81 -0
  13. package/dist/animation/morph-targets.cjs +162 -0
  14. package/dist/animation/node-animation-binding.cjs +67 -0
  15. package/dist/animation/node-animation-binding.d.ts +9 -0
  16. package/dist/animation/node-animation-binding.d.ts.map +1 -0
  17. package/dist/animation/node-animation-binding.js +45 -0
  18. package/dist/animation/node-animation-binding.js.map +1 -0
  19. package/dist/animation/property-animation-binding.cjs +159 -0
  20. package/dist/animation/property-animation-binding.d.ts +29 -0
  21. package/dist/animation/property-animation-binding.d.ts.map +1 -0
  22. package/dist/animation/property-animation-binding.js +138 -0
  23. package/dist/animation/property-animation-binding.js.map +1 -0
  24. package/dist/animation/scenegraph-animator.cjs +122 -0
  25. package/dist/animation/scenegraph-animator.d.ts +37 -0
  26. package/dist/animation/scenegraph-animator.d.ts.map +1 -0
  27. package/dist/animation/scenegraph-animator.js +99 -0
  28. package/dist/animation/scenegraph-animator.js.map +1 -0
  29. package/dist/animation/skin.cjs +49 -0
  30. package/dist/animation/texture-transform.cjs +41 -0
  31. package/dist/animation/texture-transform.d.ts +8 -0
  32. package/dist/animation/texture-transform.d.ts.map +1 -0
  33. package/dist/animation/texture-transform.js +17 -0
  34. package/dist/animation/texture-transform.js.map +1 -0
  35. package/dist/animation/timeline.cjs +129 -0
  36. package/dist/animation-loop/animation-loop-template.cjs +33 -0
  37. package/dist/animation-loop/animation-loop.cjs +498 -0
  38. package/dist/animation-loop/animation-loop.d.ts +2 -1
  39. package/dist/animation-loop/animation-loop.d.ts.map +1 -1
  40. package/dist/animation-loop/animation-loop.js +9 -3
  41. package/dist/animation-loop/animation-loop.js.map +1 -1
  42. package/dist/animation-loop/animation-props.cjs +15 -0
  43. package/dist/animation-loop/make-animation-loop.cjs +104 -0
  44. package/dist/animation-loop/request-animation-frame.cjs +43 -0
  45. package/dist/application-utils/load-file.cjs +77 -0
  46. package/dist/application-utils/random.cjs +38 -0
  47. package/dist/audio/audio-controller.cjs +429 -0
  48. package/dist/audio/audio-controller.d.ts +146 -0
  49. package/dist/audio/audio-controller.d.ts.map +1 -0
  50. package/dist/audio/audio-controller.js +445 -0
  51. package/dist/audio/audio-controller.js.map +1 -0
  52. package/dist/audio/audio-environment.cjs +157 -0
  53. package/dist/audio/audio-environment.d.ts +49 -0
  54. package/dist/audio/audio-environment.d.ts.map +1 -0
  55. package/dist/audio/audio-environment.js +148 -0
  56. package/dist/audio/audio-environment.js.map +1 -0
  57. package/dist/audio/audio-graph.cjs +182 -0
  58. package/dist/audio/audio-graph.d.ts +58 -0
  59. package/dist/audio/audio-graph.d.ts.map +1 -0
  60. package/dist/audio/audio-graph.js +181 -0
  61. package/dist/audio/audio-graph.js.map +1 -0
  62. package/dist/compute/buffer-transform.cjs +146 -0
  63. package/dist/compute/buffer-transform.d.ts +15 -5
  64. package/dist/compute/buffer-transform.d.ts.map +1 -1
  65. package/dist/compute/buffer-transform.js +56 -12
  66. package/dist/compute/buffer-transform.js.map +1 -1
  67. package/dist/compute/computation.cjs +331 -0
  68. package/dist/compute/computation.d.ts +2 -4
  69. package/dist/compute/computation.d.ts.map +1 -1
  70. package/dist/compute/computation.js +3 -14
  71. package/dist/compute/computation.js.map +1 -1
  72. package/dist/compute/swap.cjs +132 -0
  73. package/dist/compute/texture-transform.cjs +142 -0
  74. package/dist/compute/texture-transform.d.ts +11 -7
  75. package/dist/compute/texture-transform.d.ts.map +1 -1
  76. package/dist/compute/texture-transform.js +16 -6
  77. package/dist/compute/texture-transform.js.map +1 -1
  78. package/dist/controls/orbit-controls.cjs +283 -0
  79. package/dist/controls/orbit-controls.d.ts +2 -0
  80. package/dist/controls/orbit-controls.d.ts.map +1 -1
  81. package/dist/controls/orbit-controls.js +2 -1
  82. package/dist/controls/orbit-controls.js.map +1 -1
  83. package/dist/debug/copy-texture-to-image.cjs +84 -0
  84. package/dist/debug/debug-framebuffer.cjs +113 -0
  85. package/dist/debug/debug-shader-layout.cjs +45 -0
  86. package/dist/debug/pixel-data-utils.cjs +54 -0
  87. package/dist/dist.dev.js +11517 -6015
  88. package/dist/dist.min.js +39 -35
  89. package/dist/dynamic-buffer/dynamic-buffer.cjs +39 -0
  90. package/dist/dynamic-buffer/dynamic-buffer.d.ts +1 -170
  91. package/dist/dynamic-buffer/dynamic-buffer.d.ts.map +1 -1
  92. package/dist/dynamic-buffer/dynamic-buffer.js +2 -312
  93. package/dist/dynamic-buffer/dynamic-buffer.js.map +1 -1
  94. package/dist/dynamic-texture/dynamic-texture.cjs +27 -0
  95. package/dist/dynamic-texture/dynamic-texture.d.ts +1 -114
  96. package/dist/dynamic-texture/dynamic-texture.d.ts.map +1 -1
  97. package/dist/dynamic-texture/dynamic-texture.js +2 -584
  98. package/dist/dynamic-texture/dynamic-texture.js.map +1 -1
  99. package/dist/dynamic-texture/texture-binding-source.cjs +31 -0
  100. package/dist/dynamic-texture/texture-binding-source.d.ts +1 -54
  101. package/dist/dynamic-texture/texture-binding-source.d.ts.map +1 -1
  102. package/dist/dynamic-texture/texture-binding-source.js +2 -51
  103. package/dist/dynamic-texture/texture-binding-source.js.map +1 -1
  104. package/dist/dynamic-texture/texture-data.cjs +53 -0
  105. package/dist/dynamic-texture/texture-data.d.ts +1 -145
  106. package/dist/dynamic-texture/texture-data.d.ts.map +1 -1
  107. package/dist/dynamic-texture/texture-data.js +2 -209
  108. package/dist/dynamic-texture/texture-data.js.map +1 -1
  109. package/dist/dynamic-texture/video-texture.cjs +269 -0
  110. package/dist/dynamic-texture/video-texture.d.ts +1 -1
  111. package/dist/dynamic-texture/video-texture.d.ts.map +1 -1
  112. package/dist/experimental/controls/comparison-splitter.cjs +231 -0
  113. package/dist/experimental/controls/comparison-splitter.d.ts +54 -0
  114. package/dist/experimental/controls/comparison-splitter.d.ts.map +1 -0
  115. package/dist/experimental/controls/comparison-splitter.js +215 -0
  116. package/dist/experimental/controls/comparison-splitter.js.map +1 -0
  117. package/dist/experimental/controls/flat-controller.cjs +301 -0
  118. package/dist/experimental/controls/flat-controller.d.ts +80 -0
  119. package/dist/experimental/controls/flat-controller.d.ts.map +1 -0
  120. package/dist/experimental/controls/flat-controller.js +295 -0
  121. package/dist/experimental/controls/flat-controller.js.map +1 -0
  122. package/dist/experimental/controls/index.cjs +35 -0
  123. package/dist/experimental/controls/index.cjs.map +6 -0
  124. package/dist/experimental/controls/index.d.ts +7 -0
  125. package/dist/experimental/controls/index.d.ts.map +1 -0
  126. package/dist/experimental/controls/index.js +7 -0
  127. package/dist/experimental/controls/index.js.map +1 -0
  128. package/dist/experimental/controls/orbit-controls.cjs +27 -0
  129. package/dist/experimental/controls/orbit-controls.d.ts +3 -0
  130. package/dist/experimental/controls/orbit-controls.d.ts.map +1 -0
  131. package/dist/experimental/controls/orbit-controls.js +5 -0
  132. package/dist/experimental/controls/orbit-controls.js.map +1 -0
  133. package/dist/experimental/materials/emissive-material.cjs +126 -0
  134. package/dist/experimental/materials/emissive-material.d.ts +38 -0
  135. package/dist/experimental/materials/emissive-material.d.ts.map +1 -0
  136. package/dist/experimental/materials/emissive-material.js +100 -0
  137. package/dist/experimental/materials/emissive-material.js.map +1 -0
  138. package/dist/experimental/materials/glass-material.cjs +570 -0
  139. package/dist/experimental/materials/glass-material.d.ts +107 -0
  140. package/dist/experimental/materials/glass-material.d.ts.map +1 -0
  141. package/dist/experimental/materials/glass-material.js +544 -0
  142. package/dist/experimental/materials/glass-material.js.map +1 -0
  143. package/dist/experimental/materials/glass-transmission.cjs +954 -0
  144. package/dist/experimental/materials/glass-transmission.d.ts +193 -0
  145. package/dist/experimental/materials/glass-transmission.d.ts.map +1 -0
  146. package/dist/experimental/materials/glass-transmission.js +928 -0
  147. package/dist/experimental/materials/glass-transmission.js.map +1 -0
  148. package/dist/experimental/materials/index.cjs +61 -0
  149. package/dist/experimental/materials/index.cjs.map +6 -0
  150. package/dist/experimental/materials/index.d.ts +14 -0
  151. package/dist/experimental/materials/index.d.ts.map +1 -0
  152. package/dist/experimental/materials/index.js +11 -0
  153. package/dist/experimental/materials/index.js.map +1 -0
  154. package/dist/experimental/materials/optical-caustics.cjs +201 -0
  155. package/dist/experimental/materials/optical-caustics.d.ts +69 -0
  156. package/dist/experimental/materials/optical-caustics.d.ts.map +1 -0
  157. package/dist/experimental/materials/optical-caustics.js +180 -0
  158. package/dist/experimental/materials/optical-caustics.js.map +1 -0
  159. package/dist/experimental/materials/optical-lighting.cjs +169 -0
  160. package/dist/experimental/materials/optical-lighting.d.ts +7 -0
  161. package/dist/experimental/materials/optical-lighting.d.ts.map +1 -0
  162. package/dist/experimental/materials/optical-lighting.js +144 -0
  163. package/dist/experimental/materials/optical-lighting.js.map +1 -0
  164. package/dist/experimental/materials/optical-point-lights.cjs +258 -0
  165. package/dist/experimental/materials/optical-point-lights.d.ts +68 -0
  166. package/dist/experimental/materials/optical-point-lights.d.ts.map +1 -0
  167. package/dist/experimental/materials/optical-point-lights.js +237 -0
  168. package/dist/experimental/materials/optical-point-lights.js.map +1 -0
  169. package/dist/experimental/materials/reflective-material.cjs +216 -0
  170. package/dist/experimental/materials/reflective-material.d.ts +46 -0
  171. package/dist/experimental/materials/reflective-material.d.ts.map +1 -0
  172. package/dist/experimental/materials/reflective-material.js +190 -0
  173. package/dist/experimental/materials/reflective-material.js.map +1 -0
  174. package/dist/experimental/textures/html-texture.cjs +221 -0
  175. package/dist/experimental/textures/html-texture.d.ts +85 -0
  176. package/dist/experimental/textures/html-texture.d.ts.map +1 -0
  177. package/dist/experimental/textures/html-texture.js +206 -0
  178. package/dist/experimental/textures/html-texture.js.map +1 -0
  179. package/dist/experimental/textures/index.cjs +33 -0
  180. package/dist/experimental/textures/index.cjs.map +6 -0
  181. package/dist/experimental/textures/index.d.ts +5 -0
  182. package/dist/experimental/textures/index.d.ts.map +1 -0
  183. package/dist/experimental/textures/index.js +7 -0
  184. package/dist/experimental/textures/index.js.map +1 -0
  185. package/dist/experimental/textures/packed-pixels.cjs +248 -0
  186. package/dist/experimental/textures/packed-pixels.d.ts +17 -0
  187. package/dist/experimental/textures/packed-pixels.d.ts.map +1 -0
  188. package/dist/experimental/textures/packed-pixels.js +237 -0
  189. package/dist/experimental/textures/packed-pixels.js.map +1 -0
  190. package/dist/experimental/textures/rgba-decoder.cjs +60 -0
  191. package/dist/experimental/textures/rgba-decoder.d.ts +29 -0
  192. package/dist/experimental/textures/rgba-decoder.d.ts.map +1 -0
  193. package/dist/experimental/textures/rgba-decoder.js +43 -0
  194. package/dist/experimental/textures/rgba-decoder.js.map +1 -0
  195. package/dist/experimental/webxr/index.cjs +38 -0
  196. package/dist/experimental/webxr/index.cjs.map +6 -0
  197. package/dist/experimental/webxr/index.d.ts +9 -0
  198. package/dist/experimental/webxr/index.d.ts.map +1 -0
  199. package/dist/experimental/webxr/index.js +8 -0
  200. package/dist/experimental/webxr/index.js.map +1 -0
  201. package/dist/experimental/webxr/webxr-animation-frame-provider.cjs +38 -0
  202. package/dist/experimental/webxr/webxr-animation-frame-provider.d.ts +9 -0
  203. package/dist/experimental/webxr/webxr-animation-frame-provider.d.ts.map +1 -0
  204. package/dist/experimental/webxr/webxr-animation-frame-provider.js +17 -0
  205. package/dist/experimental/webxr/webxr-animation-frame-provider.js.map +1 -0
  206. package/dist/experimental/webxr/webxr-camera-texture.cjs +157 -0
  207. package/dist/experimental/webxr/webxr-camera-texture.d.ts +48 -0
  208. package/dist/experimental/webxr/webxr-camera-texture.d.ts.map +1 -0
  209. package/dist/experimental/webxr/webxr-camera-texture.js +144 -0
  210. package/dist/experimental/webxr/webxr-camera-texture.js.map +1 -0
  211. package/dist/experimental/webxr/webxr-input.cjs +93 -0
  212. package/dist/experimental/webxr/webxr-input.d.ts +24 -0
  213. package/dist/experimental/webxr/webxr-input.d.ts.map +1 -0
  214. package/dist/experimental/webxr/webxr-input.js +70 -0
  215. package/dist/experimental/webxr/webxr-input.js.map +1 -0
  216. package/dist/experimental/webxr/webxr-manager.cjs +356 -0
  217. package/dist/experimental/webxr/webxr-manager.d.ts +91 -0
  218. package/dist/experimental/webxr/webxr-manager.d.ts.map +1 -0
  219. package/dist/experimental/webxr/webxr-manager.js +354 -0
  220. package/dist/experimental/webxr/webxr-manager.js.map +1 -0
  221. package/dist/experimental/webxr/webxr-types.cjs +15 -0
  222. package/dist/experimental/webxr/webxr-types.d.ts +152 -0
  223. package/dist/experimental/webxr/webxr-types.d.ts.map +1 -0
  224. package/dist/experimental/webxr/webxr-types.js +5 -0
  225. package/dist/experimental/webxr/webxr-types.js.map +1 -0
  226. package/dist/geometry/edge-geometry.cjs +171 -0
  227. package/dist/geometry/edge-geometry.d.ts +3 -2
  228. package/dist/geometry/edge-geometry.d.ts.map +1 -1
  229. package/dist/geometry/edge-geometry.js.map +1 -1
  230. package/dist/geometry/geometry-primitives.cjs +189 -0
  231. package/dist/geometry/geometry-primitives.d.ts +60 -0
  232. package/dist/geometry/geometry-primitives.d.ts.map +1 -0
  233. package/dist/geometry/geometry-primitives.js +161 -0
  234. package/dist/geometry/geometry-primitives.js.map +1 -0
  235. package/dist/geometry/geometry-table.cjs +15 -0
  236. package/dist/geometry/geometry-utils.cjs +147 -0
  237. package/dist/geometry/geometry-utils.d.ts +7 -15
  238. package/dist/geometry/geometry-utils.d.ts.map +1 -1
  239. package/dist/geometry/geometry-utils.js +9 -55
  240. package/dist/geometry/geometry-utils.js.map +1 -1
  241. package/dist/geometry/geometry.cjs +90 -0
  242. package/dist/geometry/geometry.d.ts +9 -69
  243. package/dist/geometry/geometry.d.ts.map +1 -1
  244. package/dist/geometry/geometry.js +27 -93
  245. package/dist/geometry/geometry.js.map +1 -1
  246. package/dist/geometry/gpu-geometry.cjs +130 -0
  247. package/dist/geometry/gpu-geometry.d.ts +4 -2
  248. package/dist/geometry/gpu-geometry.d.ts.map +1 -1
  249. package/dist/geometry/gpu-geometry.js +3 -3
  250. package/dist/geometry/gpu-geometry.js.map +1 -1
  251. package/dist/geometry/gpu-vector-geometry-adapter.cjs +88 -0
  252. package/dist/geometry/gpu-vector-geometry-adapter.d.ts +5 -0
  253. package/dist/geometry/gpu-vector-geometry-adapter.d.ts.map +1 -0
  254. package/dist/geometry/gpu-vector-geometry-adapter.js +73 -0
  255. package/dist/geometry/gpu-vector-geometry-adapter.js.map +1 -0
  256. package/dist/geometry/gpu-vector-geometry.cjs +40 -0
  257. package/dist/geometry/gpu-vector-geometry.d.ts +21 -0
  258. package/dist/geometry/gpu-vector-geometry.d.ts.map +1 -0
  259. package/dist/geometry/gpu-vector-geometry.js +19 -0
  260. package/dist/geometry/gpu-vector-geometry.js.map +1 -0
  261. package/dist/geometry/mesh-simplification.cjs +385 -0
  262. package/dist/geometry/ring-geometry.cjs +104 -0
  263. package/dist/geometry/ring-geometry.d.ts +17 -0
  264. package/dist/geometry/ring-geometry.d.ts.map +1 -0
  265. package/dist/geometry/ring-geometry.js +94 -0
  266. package/dist/geometry/ring-geometry.js.map +1 -0
  267. package/dist/geometry/stroke-geometry.cjs +171 -0
  268. package/dist/graph/models/index.cjs +66 -0
  269. package/dist/graph/models/index.cjs.map +6 -0
  270. package/dist/graph/models/index.d.ts +7 -0
  271. package/dist/graph/models/index.d.ts.map +1 -0
  272. package/dist/graph/models/index.js +10 -0
  273. package/dist/graph/models/index.js.map +1 -0
  274. package/dist/graph/models/path/path-attribute-model.cjs +421 -0
  275. package/dist/graph/models/path/path-attribute-model.d.ts +142 -0
  276. package/dist/graph/models/path/path-attribute-model.d.ts.map +1 -0
  277. package/dist/graph/models/path/path-attribute-model.js +409 -0
  278. package/dist/graph/models/path/path-attribute-model.js.map +1 -0
  279. package/dist/graph/models/path/path-storage-model.cjs +711 -0
  280. package/dist/graph/models/path/path-storage-model.d.ts +174 -0
  281. package/dist/graph/models/path/path-storage-model.d.ts.map +1 -0
  282. package/dist/graph/models/path/path-storage-model.js +720 -0
  283. package/dist/graph/models/path/path-storage-model.js.map +1 -0
  284. package/dist/graph/models/path/path-trips-storage-model.cjs +271 -0
  285. package/dist/graph/models/path/path-trips-storage-model.d.ts +58 -0
  286. package/dist/graph/models/path/path-trips-storage-model.d.ts.map +1 -0
  287. package/dist/graph/models/path/path-trips-storage-model.js +248 -0
  288. package/dist/graph/models/path/path-trips-storage-model.js.map +1 -0
  289. package/dist/graph/models/polygon/polygon-attribute-model.cjs +117 -0
  290. package/dist/graph/models/polygon/polygon-attribute-model.d.ts +53 -0
  291. package/dist/graph/models/polygon/polygon-attribute-model.d.ts.map +1 -0
  292. package/dist/graph/models/polygon/polygon-attribute-model.js +101 -0
  293. package/dist/graph/models/polygon/polygon-attribute-model.js.map +1 -0
  294. package/dist/graph/models/polygon/polygon-shaders.cjs +283 -0
  295. package/dist/graph/models/polygon/polygon-shaders.d.ts +77 -0
  296. package/dist/graph/models/polygon/polygon-shaders.d.ts.map +1 -0
  297. package/dist/graph/models/polygon/polygon-shaders.js +242 -0
  298. package/dist/graph/models/polygon/polygon-shaders.js.map +1 -0
  299. package/dist/graph/models/polygon/polygon-storage-model.cjs +111 -0
  300. package/dist/graph/models/polygon/polygon-storage-model.d.ts +53 -0
  301. package/dist/graph/models/polygon/polygon-storage-model.d.ts.map +1 -0
  302. package/dist/graph/models/polygon/polygon-storage-model.js +92 -0
  303. package/dist/graph/models/polygon/polygon-storage-model.js.map +1 -0
  304. package/dist/graph/physics/index.cjs +50 -0
  305. package/dist/graph/physics/index.cjs.map +6 -0
  306. package/dist/graph/physics/index.d.ts +12 -0
  307. package/dist/graph/physics/index.d.ts.map +1 -0
  308. package/dist/graph/physics/index.js +12 -0
  309. package/dist/graph/physics/index.js.map +1 -0
  310. package/dist/graph/physics/physics-scenegraph.cjs +92 -0
  311. package/dist/graph/physics/physics-scenegraph.d.ts +35 -0
  312. package/dist/graph/physics/physics-scenegraph.d.ts.map +1 -0
  313. package/dist/graph/physics/physics-scenegraph.js +80 -0
  314. package/dist/graph/physics/physics-scenegraph.js.map +1 -0
  315. package/dist/graph/physics/scenegraph-behaviors.cjs +164 -0
  316. package/dist/graph/physics/scenegraph-behaviors.d.ts +37 -0
  317. package/dist/graph/physics/scenegraph-behaviors.d.ts.map +1 -0
  318. package/dist/graph/physics/scenegraph-behaviors.js +145 -0
  319. package/dist/graph/physics/scenegraph-behaviors.js.map +1 -0
  320. package/dist/graph/physics/scenegraph-instance.cjs +246 -0
  321. package/dist/graph/physics/scenegraph-instance.d.ts +59 -0
  322. package/dist/graph/physics/scenegraph-instance.d.ts.map +1 -0
  323. package/dist/graph/physics/scenegraph-instance.js +241 -0
  324. package/dist/graph/physics/scenegraph-instance.js.map +1 -0
  325. package/dist/graph/physics/scenegraph-joints.cjs +51 -0
  326. package/dist/graph/physics/scenegraph-joints.d.ts +5 -0
  327. package/dist/graph/physics/scenegraph-joints.d.ts.map +1 -0
  328. package/dist/graph/physics/scenegraph-joints.js +31 -0
  329. package/dist/graph/physics/scenegraph-joints.js.map +1 -0
  330. package/dist/graph/physics/scenegraph-motion.cjs +177 -0
  331. package/dist/graph/physics/scenegraph-motion.d.ts +37 -0
  332. package/dist/graph/physics/scenegraph-motion.d.ts.map +1 -0
  333. package/dist/graph/physics/scenegraph-motion.js +168 -0
  334. package/dist/graph/physics/scenegraph-motion.js.map +1 -0
  335. package/dist/graph/physics/scenegraph-properties.cjs +170 -0
  336. package/dist/graph/physics/scenegraph-properties.d.ts +37 -0
  337. package/dist/graph/physics/scenegraph-properties.d.ts.map +1 -0
  338. package/dist/graph/physics/scenegraph-properties.js +186 -0
  339. package/dist/graph/physics/scenegraph-properties.js.map +1 -0
  340. package/dist/graph/physics/scenegraph-publication.cjs +112 -0
  341. package/dist/graph/physics/scenegraph-publication.d.ts +23 -0
  342. package/dist/graph/physics/scenegraph-publication.d.ts.map +1 -0
  343. package/dist/graph/physics/scenegraph-publication.js +99 -0
  344. package/dist/graph/physics/scenegraph-publication.js.map +1 -0
  345. package/dist/graph/physics/scenegraph-session.cjs +256 -0
  346. package/dist/graph/physics/scenegraph-session.d.ts +68 -0
  347. package/dist/graph/physics/scenegraph-session.d.ts.map +1 -0
  348. package/dist/graph/physics/scenegraph-session.js +249 -0
  349. package/dist/graph/physics/scenegraph-session.js.map +1 -0
  350. package/dist/graph/tables/gpu-table-geometry.cjs +84 -0
  351. package/dist/graph/tables/gpu-table-geometry.d.ts +32 -0
  352. package/dist/graph/tables/gpu-table-geometry.d.ts.map +1 -0
  353. package/dist/graph/tables/gpu-table-geometry.js +67 -0
  354. package/dist/graph/tables/gpu-table-geometry.js.map +1 -0
  355. package/dist/graph/tables/gpu-table-model.cjs +459 -0
  356. package/dist/graph/tables/gpu-table-model.d.ts +67 -0
  357. package/dist/graph/tables/gpu-table-model.d.ts.map +1 -0
  358. package/dist/graph/tables/gpu-table-model.js +457 -0
  359. package/dist/graph/tables/gpu-table-model.js.map +1 -0
  360. package/dist/graph/tables/gpu-table-transform.cjs +341 -0
  361. package/dist/graph/tables/gpu-table-transform.d.ts +61 -0
  362. package/dist/graph/tables/gpu-table-transform.d.ts.map +1 -0
  363. package/dist/graph/tables/gpu-table-transform.js +333 -0
  364. package/dist/graph/tables/gpu-table-transform.js.map +1 -0
  365. package/dist/graph/tables/index.cjs +33 -0
  366. package/dist/graph/tables/index.cjs.map +6 -0
  367. package/dist/graph/tables/index.d.ts +4 -0
  368. package/dist/graph/tables/index.d.ts.map +1 -0
  369. package/dist/graph/tables/index.js +7 -0
  370. package/dist/graph/tables/index.js.map +1 -0
  371. package/dist/index.cjs +303 -10629
  372. package/dist/index.cjs.map +3 -3
  373. package/dist/index.d.ts +46 -19
  374. package/dist/index.d.ts.map +1 -1
  375. package/dist/index.js +33 -10
  376. package/dist/index.js.map +1 -1
  377. package/dist/interactivity/interactivity.cjs +570 -0
  378. package/dist/interactivity/interactivity.d.ts +107 -0
  379. package/dist/interactivity/interactivity.d.ts.map +1 -0
  380. package/dist/interactivity/interactivity.js +575 -0
  381. package/dist/interactivity/interactivity.js.map +1 -0
  382. package/dist/interactivity/physics.cjs +15 -0
  383. package/dist/interactivity/physics.d.ts +12 -0
  384. package/dist/interactivity/physics.d.ts.map +1 -0
  385. package/dist/interactivity/physics.js +5 -0
  386. package/dist/interactivity/physics.js.map +1 -0
  387. package/dist/material/material-factory.cjs +99 -0
  388. package/dist/material/material-factory.d.ts +1 -1
  389. package/dist/material/material-factory.d.ts.map +1 -1
  390. package/dist/material/material.cjs +239 -0
  391. package/dist/material/material.d.ts +2 -2
  392. package/dist/material/material.d.ts.map +1 -1
  393. package/dist/material/material.js +2 -2
  394. package/dist/material/material.js.map +1 -1
  395. package/dist/model/gpu-vector-bindings.cjs +226 -0
  396. package/dist/model/gpu-vector-bindings.d.ts +36 -0
  397. package/dist/model/gpu-vector-bindings.d.ts.map +1 -0
  398. package/dist/model/gpu-vector-bindings.js +217 -0
  399. package/dist/model/gpu-vector-bindings.js.map +1 -0
  400. package/dist/model/gpu-vector-draw-batches.cjs +82 -0
  401. package/dist/model/gpu-vector-draw-batches.d.ts +5 -0
  402. package/dist/model/gpu-vector-draw-batches.d.ts.map +1 -0
  403. package/dist/model/gpu-vector-draw-batches.js +73 -0
  404. package/dist/model/gpu-vector-draw-batches.js.map +1 -0
  405. package/dist/model/gpu-vector-model-batches.cjs +94 -0
  406. package/dist/model/gpu-vector-model-batches.d.ts +41 -0
  407. package/dist/model/gpu-vector-model-batches.d.ts.map +1 -0
  408. package/dist/model/gpu-vector-model-batches.js +77 -0
  409. package/dist/model/gpu-vector-model-batches.js.map +1 -0
  410. package/dist/model/gpu-vector-model.cjs +1264 -0
  411. package/dist/model/gpu-vector-model.d.ts +352 -0
  412. package/dist/model/gpu-vector-model.d.ts.map +1 -0
  413. package/dist/model/gpu-vector-model.js +1375 -0
  414. package/dist/model/gpu-vector-model.js.map +1 -0
  415. package/dist/model/model.cjs +134 -0
  416. package/dist/model/model.d.ts +22 -306
  417. package/dist/model/model.d.ts.map +1 -1
  418. package/dist/model/model.js +68 -1092
  419. package/dist/model/model.js.map +1 -1
  420. package/dist/model/split-uniforms-and-bindings.cjs +44 -0
  421. package/dist/model/split-uniforms-and-bindings.d.ts +1 -1
  422. package/dist/model/split-uniforms-and-bindings.d.ts.map +1 -1
  423. package/dist/model/split-uniforms-and-bindings.js +5 -2
  424. package/dist/model/split-uniforms-and-bindings.js.map +1 -1
  425. package/dist/models/billboard-texture-model.cjs +167 -0
  426. package/dist/models/billboard-texture-model.d.ts +1 -1
  427. package/dist/models/billboard-texture-model.d.ts.map +1 -1
  428. package/dist/models/billboard-texture-model.js +1 -1
  429. package/dist/models/billboard-texture-model.js.map +1 -1
  430. package/dist/models/billboard-texture-module.cjs +61 -0
  431. package/dist/models/clip-space.cjs +103 -0
  432. package/dist/models/clip-space.d.ts +4 -1
  433. package/dist/models/clip-space.d.ts.map +1 -1
  434. package/dist/models/clip-space.js +16 -13
  435. package/dist/models/clip-space.js.map +1 -1
  436. package/dist/models/directional-light-model.cjs +45 -0
  437. package/dist/models/directional-light-model.js +1 -1
  438. package/dist/models/directional-light-model.js.map +1 -1
  439. package/dist/models/light-model-utils.cjs +426 -0
  440. package/dist/models/point-light-model.cjs +44 -0
  441. package/dist/models/point-light-model.js +1 -1
  442. package/dist/models/point-light-model.js.map +1 -1
  443. package/dist/models/spot-light-model.cjs +45 -0
  444. package/dist/models/spot-light-model.js +1 -1
  445. package/dist/models/spot-light-model.js.map +1 -1
  446. package/dist/modules/picking/color-picking.cjs +209 -0
  447. package/dist/modules/picking/color-picking.d.ts +1 -1
  448. package/dist/modules/picking/index-color-picking.cjs +230 -0
  449. package/dist/modules/picking/index-color-picking.d.ts +1 -1
  450. package/dist/modules/picking/index-picking.cjs +201 -0
  451. package/dist/modules/picking/index-picking.d.ts +1 -1
  452. package/dist/modules/picking/legacy-color-picking.cjs +28 -0
  453. package/dist/modules/picking/legacy-color-picking.d.ts +1 -1
  454. package/dist/modules/picking/legacy-picking-manager.cjs +92 -0
  455. package/dist/modules/picking/picking-manager.cjs +360 -0
  456. package/dist/modules/picking/picking-uniforms.cjs +140 -0
  457. package/dist/modules/picking/picking-uniforms.d.ts +1 -1
  458. package/dist/modules/picking/picking-uniforms.d.ts.map +1 -1
  459. package/dist/modules/picking/picking.cjs +43 -0
  460. package/dist/modules/picking/picking.d.ts +1 -1
  461. package/dist/passes/get-fragment-shader.cjs +119 -0
  462. package/dist/passes/shader-pass-renderer.cjs +722 -0
  463. package/dist/passes/shader-pass-renderer.d.ts +2 -2
  464. package/dist/passes/shader-pass-renderer.d.ts.map +1 -1
  465. package/dist/passes/shader-pass-renderer.js +1 -1
  466. package/dist/passes/shader-pass-renderer.js.map +1 -1
  467. package/dist/passes/texture-transform-module.cjs +78 -0
  468. package/dist/scenegraph/controllers/area-light-controller.cjs +143 -0
  469. package/dist/scenegraph/controllers/area-light-controller.d.ts +31 -0
  470. package/dist/scenegraph/controllers/area-light-controller.d.ts.map +1 -0
  471. package/dist/scenegraph/controllers/area-light-controller.js +130 -0
  472. package/dist/scenegraph/controllers/area-light-controller.js.map +1 -0
  473. package/dist/scenegraph/controllers/billboard-controller.cjs +156 -0
  474. package/dist/scenegraph/controllers/billboard-controller.d.ts +45 -0
  475. package/dist/scenegraph/controllers/billboard-controller.d.ts.map +1 -0
  476. package/dist/scenegraph/controllers/billboard-controller.js +156 -0
  477. package/dist/scenegraph/controllers/billboard-controller.js.map +1 -0
  478. package/dist/scenegraph/controllers/joint-controller.cjs +71 -0
  479. package/dist/scenegraph/controllers/joint-controller.d.ts +30 -0
  480. package/dist/scenegraph/controllers/joint-controller.d.ts.map +1 -0
  481. package/dist/scenegraph/controllers/joint-controller.js +53 -0
  482. package/dist/scenegraph/controllers/joint-controller.js.map +1 -0
  483. package/dist/scenegraph/controllers/material-variants.cjs +61 -0
  484. package/dist/scenegraph/controllers/material-variants.d.ts +42 -0
  485. package/dist/scenegraph/controllers/material-variants.d.ts.map +1 -0
  486. package/dist/scenegraph/controllers/material-variants.js +40 -0
  487. package/dist/scenegraph/controllers/material-variants.js.map +1 -0
  488. package/dist/scenegraph/controllers/morph-controller.cjs +61 -0
  489. package/dist/scenegraph/controllers/morph-controller.d.ts +19 -0
  490. package/dist/scenegraph/controllers/morph-controller.d.ts.map +1 -0
  491. package/dist/scenegraph/controllers/morph-controller.js +41 -0
  492. package/dist/scenegraph/controllers/morph-controller.js.map +1 -0
  493. package/dist/scenegraph/controllers/skin-controller.cjs +111 -0
  494. package/dist/scenegraph/controllers/skin-controller.d.ts +36 -0
  495. package/dist/scenegraph/controllers/skin-controller.d.ts.map +1 -0
  496. package/dist/scenegraph/controllers/skin-controller.js +90 -0
  497. package/dist/scenegraph/controllers/skin-controller.js.map +1 -0
  498. package/dist/scenegraph/group-node.cjs +129 -0
  499. package/dist/scenegraph/model-node.cjs +68 -0
  500. package/dist/scenegraph/physics-transforms.cjs +95 -0
  501. package/dist/scenegraph/physics-transforms.d.ts +13 -0
  502. package/dist/scenegraph/physics-transforms.d.ts.map +1 -0
  503. package/dist/scenegraph/physics-transforms.js +72 -0
  504. package/dist/scenegraph/physics-transforms.js.map +1 -0
  505. package/dist/scenegraph/published-transforms.cjs +37 -0
  506. package/dist/scenegraph/published-transforms.d.ts +17 -0
  507. package/dist/scenegraph/published-transforms.d.ts.map +1 -0
  508. package/dist/scenegraph/published-transforms.js +16 -0
  509. package/dist/scenegraph/published-transforms.js.map +1 -0
  510. package/dist/scenegraph/scenegraph-bounds.cjs +51 -0
  511. package/dist/scenegraph/scenegraph-node.cjs +182 -0
  512. package/dist/shader-inputs.cjs +231 -0
  513. package/dist/shader-inputs.d.ts +1 -1
  514. package/dist/shader-inputs.d.ts.map +1 -1
  515. package/dist/utils/buffer-layout-helper.cjs +52 -0
  516. package/dist/utils/buffer-layout-order.cjs +37 -0
  517. package/dist/utils/deep-equal.cjs +65 -0
  518. package/dist/utils/get-platform-info.cjs +21 -0
  519. package/dist/utils/get-platform-info.d.ts +2 -0
  520. package/dist/utils/get-platform-info.d.ts.map +1 -0
  521. package/dist/utils/get-platform-info.js +5 -0
  522. package/dist/utils/get-platform-info.js.map +1 -0
  523. package/dist/utils/gpu-vector-batch-structure.cjs +45 -0
  524. package/dist/utils/gpu-vector-batch-structure.d.ts +12 -0
  525. package/dist/utils/gpu-vector-batch-structure.d.ts.map +1 -0
  526. package/dist/utils/gpu-vector-batch-structure.js +27 -0
  527. package/dist/utils/gpu-vector-batch-structure.js.map +1 -0
  528. package/dist/utils/shader-module-utils.cjs +148 -0
  529. package/dist/utils/uid.cjs +32 -0
  530. package/package.json +47 -8
  531. package/src/animation/deform-positions.ts +62 -0
  532. package/src/animation/node-animation-binding.ts +54 -0
  533. package/src/animation/property-animation-binding.ts +212 -0
  534. package/src/animation/scenegraph-animator.ts +117 -0
  535. package/src/animation/texture-transform.ts +59 -0
  536. package/src/animation-loop/animation-loop.ts +10 -3
  537. package/src/audio/audio-controller.ts +583 -0
  538. package/src/audio/audio-environment.ts +202 -0
  539. package/src/audio/audio-graph.ts +253 -0
  540. package/src/compute/buffer-transform.ts +71 -16
  541. package/src/compute/computation.ts +4 -19
  542. package/src/compute/texture-transform.ts +25 -12
  543. package/src/controls/orbit-controls.ts +4 -1
  544. package/src/dynamic-buffer/dynamic-buffer.ts +15 -449
  545. package/src/dynamic-texture/dynamic-texture.ts +5 -760
  546. package/src/dynamic-texture/texture-binding-source.ts +8 -90
  547. package/src/dynamic-texture/texture-data.ts +31 -340
  548. package/src/dynamic-texture/video-texture.ts +1 -1
  549. package/src/experimental/controls/comparison-splitter.ts +269 -0
  550. package/src/experimental/controls/flat-controller.ts +403 -0
  551. package/src/experimental/controls/index.ts +16 -0
  552. package/src/experimental/controls/orbit-controls.ts +6 -0
  553. package/src/experimental/materials/emissive-material.ts +120 -0
  554. package/src/experimental/materials/glass-material.ts +607 -0
  555. package/src/experimental/materials/glass-transmission.ts +1023 -0
  556. package/src/experimental/materials/index.ts +49 -0
  557. package/src/experimental/materials/optical-caustics.ts +234 -0
  558. package/src/experimental/materials/optical-lighting.ts +148 -0
  559. package/src/experimental/materials/optical-point-lights.ts +288 -0
  560. package/src/experimental/materials/reflective-material.ts +214 -0
  561. package/src/experimental/textures/html-texture.ts +285 -0
  562. package/src/experimental/textures/index.ts +8 -0
  563. package/src/experimental/textures/packed-pixels.ts +351 -0
  564. package/src/experimental/textures/rgba-decoder.ts +79 -0
  565. package/src/experimental/webxr/index.ts +21 -0
  566. package/src/experimental/webxr/webxr-animation-frame-provider.ts +22 -0
  567. package/src/experimental/webxr/webxr-camera-texture.ts +195 -0
  568. package/src/experimental/webxr/webxr-input.ts +117 -0
  569. package/src/experimental/webxr/webxr-manager.ts +524 -0
  570. package/src/experimental/webxr/webxr-types.ts +192 -0
  571. package/src/geometry/edge-geometry.ts +7 -3
  572. package/src/geometry/geometry-primitives.ts +226 -0
  573. package/src/geometry/geometry-utils.ts +16 -71
  574. package/src/geometry/geometry.ts +36 -163
  575. package/src/geometry/gpu-geometry.ts +9 -4
  576. package/src/geometry/gpu-vector-geometry-adapter.ts +78 -0
  577. package/src/geometry/gpu-vector-geometry.ts +33 -0
  578. package/src/geometry/ring-geometry.ts +117 -0
  579. package/src/graph/models/index.ts +45 -0
  580. package/src/graph/models/path/path-attribute-model.ts +563 -0
  581. package/src/graph/models/path/path-storage-model.ts +996 -0
  582. package/src/graph/models/path/path-trips-storage-model.ts +286 -0
  583. package/src/graph/models/polygon/polygon-attribute-model.ts +165 -0
  584. package/src/graph/models/polygon/polygon-shaders.ts +279 -0
  585. package/src/graph/models/polygon/polygon-storage-model.ts +146 -0
  586. package/src/graph/physics/index.ts +24 -0
  587. package/src/graph/physics/physics-scenegraph.ts +112 -0
  588. package/src/graph/physics/scenegraph-behaviors.ts +169 -0
  589. package/src/graph/physics/scenegraph-instance.ts +296 -0
  590. package/src/graph/physics/scenegraph-joints.ts +37 -0
  591. package/src/graph/physics/scenegraph-motion.ts +175 -0
  592. package/src/graph/physics/scenegraph-properties.ts +241 -0
  593. package/src/graph/physics/scenegraph-publication.ts +116 -0
  594. package/src/graph/physics/scenegraph-session.ts +317 -0
  595. package/src/graph/tables/gpu-table-geometry.ts +88 -0
  596. package/src/graph/tables/gpu-table-model.ts +661 -0
  597. package/src/graph/tables/gpu-table-transform.ts +497 -0
  598. package/src/graph/tables/index.ts +18 -0
  599. package/src/index.ts +144 -27
  600. package/src/interactivity/interactivity.ts +670 -0
  601. package/src/interactivity/physics.ts +19 -0
  602. package/src/material/material-factory.ts +1 -1
  603. package/src/material/material.ts +2 -2
  604. package/src/model/gpu-vector-bindings.ts +276 -0
  605. package/src/model/gpu-vector-draw-batches.ts +116 -0
  606. package/src/model/gpu-vector-model-batches.ts +142 -0
  607. package/src/model/gpu-vector-model.ts +1819 -0
  608. package/src/model/model.ts +91 -1444
  609. package/src/model/split-uniforms-and-bindings.ts +6 -3
  610. package/src/models/billboard-texture-model.ts +1 -1
  611. package/src/models/clip-space.ts +21 -14
  612. package/src/models/directional-light-model.ts +1 -1
  613. package/src/models/point-light-model.ts +1 -1
  614. package/src/models/spot-light-model.ts +1 -1
  615. package/src/modules/picking/legacy-picking-manager.ts +1 -1
  616. package/src/modules/picking/picking-uniforms.ts +1 -1
  617. package/src/passes/shader-pass-renderer.ts +2 -2
  618. package/src/scenegraph/controllers/area-light-controller.ts +152 -0
  619. package/src/scenegraph/controllers/billboard-controller.ts +204 -0
  620. package/src/scenegraph/controllers/joint-controller.ts +81 -0
  621. package/src/scenegraph/controllers/material-variants.ts +70 -0
  622. package/src/scenegraph/controllers/morph-controller.ts +61 -0
  623. package/src/scenegraph/controllers/skin-controller.ts +125 -0
  624. package/src/scenegraph/physics-transforms.ts +82 -0
  625. package/src/scenegraph/published-transforms.ts +18 -0
  626. package/src/shader-inputs.ts +1 -1
  627. package/src/utils/get-platform-info.ts +5 -0
  628. package/src/utils/gpu-vector-batch-structure.ts +36 -0
  629. package/dist/compute/kernel.d.ts +0 -54
  630. package/dist/compute/kernel.d.ts.map +0 -1
  631. package/dist/compute/kernel.js +0 -103
  632. package/dist/compute/kernel.js.map +0 -1
  633. package/dist/compute/render-kernel.d.ts +0 -65
  634. package/dist/compute/render-kernel.d.ts.map +0 -1
  635. package/dist/compute/render-kernel.js +0 -129
  636. package/dist/compute/render-kernel.js.map +0 -1
  637. package/dist/geometries/cone-geometry.d.ts +0 -12
  638. package/dist/geometries/cone-geometry.d.ts.map +0 -1
  639. package/dist/geometries/cone-geometry.js +0 -19
  640. package/dist/geometries/cone-geometry.js.map +0 -1
  641. package/dist/geometries/cube-geometry.d.ts +0 -14
  642. package/dist/geometries/cube-geometry.d.ts.map +0 -1
  643. package/dist/geometries/cube-geometry.js +0 -222
  644. package/dist/geometries/cube-geometry.js.map +0 -1
  645. package/dist/geometries/cylinder-geometry.d.ts +0 -11
  646. package/dist/geometries/cylinder-geometry.d.ts.map +0 -1
  647. package/dist/geometries/cylinder-geometry.js +0 -17
  648. package/dist/geometries/cylinder-geometry.js.map +0 -1
  649. package/dist/geometries/ico-sphere-geometry.d.ts +0 -11
  650. package/dist/geometries/ico-sphere-geometry.d.ts.map +0 -1
  651. package/dist/geometries/ico-sphere-geometry.js +0 -158
  652. package/dist/geometries/ico-sphere-geometry.js.map +0 -1
  653. package/dist/geometries/plane-geometry.d.ts +0 -20
  654. package/dist/geometries/plane-geometry.d.ts.map +0 -1
  655. package/dist/geometries/plane-geometry.js +0 -106
  656. package/dist/geometries/plane-geometry.js.map +0 -1
  657. package/dist/geometries/sphere-geometry.d.ts +0 -12
  658. package/dist/geometries/sphere-geometry.d.ts.map +0 -1
  659. package/dist/geometries/sphere-geometry.js +0 -88
  660. package/dist/geometries/sphere-geometry.js.map +0 -1
  661. package/dist/geometries/truncated-cone-geometry.d.ts +0 -23
  662. package/dist/geometries/truncated-cone-geometry.d.ts.map +0 -1
  663. package/dist/geometries/truncated-cone-geometry.js +0 -112
  664. package/dist/geometries/truncated-cone-geometry.js.map +0 -1
  665. package/src/compute/kernel.ts +0 -146
  666. package/src/compute/render-kernel.ts +0 -192
  667. package/src/geometries/cone-geometry.ts +0 -31
  668. package/src/geometries/cube-geometry.ts +0 -258
  669. package/src/geometries/cylinder-geometry.ts +0 -28
  670. package/src/geometries/ico-sphere-geometry.ts +0 -193
  671. package/src/geometries/plane-geometry.ts +0 -142
  672. package/src/geometries/sphere-geometry.ts +0 -113
  673. package/src/geometries/truncated-cone-geometry.ts +0 -145
@@ -0,0 +1,269 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var video_texture_exports = {};
19
+ __export(video_texture_exports, {
20
+ VideoTexture: () => VideoTexture
21
+ });
22
+ module.exports = __toCommonJS(video_texture_exports);
23
+ var import_core = require("@luma.gl/core");
24
+ var import_uid = require("../utils/uid.cjs");
25
+ class VideoTexture {
26
+ /** Device used to create copied and native external texture bindings. */
27
+ device;
28
+ /** Stable resource identifier used in loading and debug messages. */
29
+ id;
30
+ /** Whether this video binding source has been destroyed. */
31
+ destroyed = false;
32
+ /** Monotonic binding generation advanced when concrete draw bindings may need recreation. */
33
+ generation = 0;
34
+ _source;
35
+ _colorSpace;
36
+ _sampler;
37
+ _isReady = false;
38
+ _updateTimestamp;
39
+ _sourceVersion = 0;
40
+ _sourceFrameToken = null;
41
+ _texture = null;
42
+ _textureFrameToken = void 0;
43
+ _externalTexture = null;
44
+ /** Current caller-owned live video source. */
45
+ get source() {
46
+ return this._source;
47
+ }
48
+ /** Whether the current source exposes dimensions and a current frame. */
49
+ get isReady() {
50
+ this._observeSource();
51
+ return this._isReady;
52
+ }
53
+ /** Device timestamp of the most recent source content or binding identity update. */
54
+ get updateTimestamp() {
55
+ this._observeSource();
56
+ return this._updateTimestamp;
57
+ }
58
+ /** Resource label used by debug output. */
59
+ get [Symbol.toStringTag]() {
60
+ return "VideoTexture";
61
+ }
62
+ /** Formats the current source dimensions and readiness for debug output. */
63
+ toString() {
64
+ const size = getVideoTextureSourceSize(this._source);
65
+ return `VideoTexture:"${this.id}":${size.width}x${size.height}px:(${this._isReady ? "ready" : "loading..."})`;
66
+ }
67
+ /**
68
+ * Creates a live video binding source.
69
+ * @param device Device that resolves copied or native external bindings.
70
+ * @param props Live video source and copied texture options.
71
+ */
72
+ constructor(device, props) {
73
+ (0, import_core.assert)(isHTMLVideoElementSource(props == null ? void 0 : props.source) || isVideoFrameSource(props == null ? void 0 : props.source));
74
+ this.device = device;
75
+ this.id = props.id || (0, import_uid.uid)("video-texture");
76
+ this._source = props.source;
77
+ this._colorSpace = props.colorSpace ?? "srgb";
78
+ this._sampler = props.sampler ?? {};
79
+ this._updateTimestamp = this.device.incrementTimestamp();
80
+ this.setSource(props.source);
81
+ }
82
+ /**
83
+ * Replaces the caller-owned video source and invalidates resolved bindings.
84
+ * @param source Next caller-owned video source to follow.
85
+ */
86
+ setSource(source) {
87
+ (0, import_core.assert)(isHTMLVideoElementSource(source) || isVideoFrameSource(source));
88
+ this._destroyExternalTexture();
89
+ this._source = source;
90
+ this._sourceVersion++;
91
+ this._sourceFrameToken = null;
92
+ this._textureFrameToken = void 0;
93
+ this._observeSource();
94
+ this._touchGeneration();
95
+ }
96
+ /**
97
+ * Resolves one reflected shader texture slot for the current video frame.
98
+ * @param bindingLayout Reflected `texture` or `external-texture` shader slot.
99
+ * @returns A copied texture, native external texture, or `null` while unavailable.
100
+ */
101
+ resolveTextureBinding(bindingLayout) {
102
+ this._observeSource();
103
+ if (!this._isReady || this.destroyed) {
104
+ return null;
105
+ }
106
+ if (bindingLayout.type === "external-texture" && this.device.type === "webgpu") {
107
+ return this._createNativeExternalTexture();
108
+ }
109
+ return this._resolveCopiedTexture();
110
+ }
111
+ /**
112
+ * Replaces the default sampler used by copied and native external bindings.
113
+ * @param sampler Sampler instance or sampler properties to use for future resolutions.
114
+ */
115
+ setSampler(sampler) {
116
+ var _a, _b, _c;
117
+ this._sampler = sampler;
118
+ (_a = this._texture) == null ? void 0 : _a.setSampler(sampler);
119
+ (_c = (_b = this._externalTexture) == null ? void 0 : _b.setSampler) == null ? void 0 : _c.call(_b, sampler);
120
+ this._touchGeneration();
121
+ }
122
+ /** Releases owned copied/external bindings without closing the caller-owned source. */
123
+ destroy() {
124
+ var _a;
125
+ if (this.destroyed) {
126
+ return;
127
+ }
128
+ this._destroyExternalTexture();
129
+ (_a = this._texture) == null ? void 0 : _a.destroy();
130
+ this._texture = null;
131
+ this._textureFrameToken = void 0;
132
+ this._isReady = false;
133
+ this.destroyed = true;
134
+ this._touchGeneration();
135
+ }
136
+ /**
137
+ * Resolves and uploads the copied texture variant for the current source frame.
138
+ * @returns Copied texture containing the current observed frame.
139
+ */
140
+ _resolveCopiedTexture() {
141
+ const texture = this._getOrCreateCopiedTexture();
142
+ if (!Object.is(this._textureFrameToken, this._sourceFrameToken)) {
143
+ texture.copyExternalImage({
144
+ image: this._source,
145
+ colorSpace: this._colorSpace
146
+ });
147
+ this._textureFrameToken = this._sourceFrameToken;
148
+ }
149
+ return texture;
150
+ }
151
+ /**
152
+ * Returns an existing size-compatible copied texture or creates one lazily.
153
+ * @returns Copied texture allocated for the current source dimensions.
154
+ */
155
+ _getOrCreateCopiedTexture() {
156
+ const size = this._getResolvedSize();
157
+ const currentTexture = this._texture;
158
+ if (currentTexture && currentTexture.width === size.width && currentTexture.height === size.height) {
159
+ return currentTexture;
160
+ }
161
+ currentTexture == null ? void 0 : currentTexture.destroy();
162
+ const texture = this.device.createTexture({
163
+ id: `${this.id}-texture`,
164
+ width: size.width,
165
+ height: size.height,
166
+ format: "rgba8unorm",
167
+ usage: import_core.Texture.SAMPLE | import_core.Texture.COPY_DST,
168
+ mipLevels: 1,
169
+ sampler: this._sampler
170
+ });
171
+ this._texture = texture;
172
+ this._textureFrameToken = void 0;
173
+ this._touchGeneration();
174
+ return texture;
175
+ }
176
+ /**
177
+ * Acquires one native WebGPU external texture binding.
178
+ * @returns Fresh acquired external texture.
179
+ */
180
+ _createNativeExternalTexture() {
181
+ this._destroyExternalTexture();
182
+ this._externalTexture = this.device.createExternalTexture({
183
+ id: `${this.id}-external`,
184
+ source: this._source,
185
+ colorSpace: this._colorSpace,
186
+ sampler: this._sampler
187
+ });
188
+ this.generation++;
189
+ return this._externalTexture;
190
+ }
191
+ /** Releases the current acquired external texture wrapper. */
192
+ _destroyExternalTexture() {
193
+ var _a;
194
+ (_a = this._externalTexture) == null ? void 0 : _a.destroy();
195
+ this._externalTexture = null;
196
+ }
197
+ /**
198
+ * Resolves current copied texture dimensions.
199
+ * @returns Positive dimensions for the current source frame.
200
+ */
201
+ _getResolvedSize() {
202
+ const size = getVideoTextureSourceSize(this._source);
203
+ (0, import_core.assert)(size.width > 0 && size.height > 0);
204
+ return size;
205
+ }
206
+ /** Observes current source readiness and frame identity before binding resolution. */
207
+ _observeSource() {
208
+ if (this.destroyed) {
209
+ return;
210
+ }
211
+ const isReady = isVideoTextureSourceReady(this._source);
212
+ if (isReady !== this._isReady) {
213
+ this._isReady = isReady;
214
+ this._touch();
215
+ }
216
+ if (!isReady) {
217
+ return;
218
+ }
219
+ const frameToken = getVideoTextureSourceFrameToken(this._source, this._sourceVersion);
220
+ if (!Object.is(frameToken, this._sourceFrameToken)) {
221
+ this._sourceFrameToken = frameToken;
222
+ this._touch();
223
+ }
224
+ }
225
+ /** Advances the device timestamp after source content or readiness changes. */
226
+ _touch() {
227
+ this._updateTimestamp = this.device.incrementTimestamp();
228
+ }
229
+ /** Advances binding generation and timestamp after binding identity can change. */
230
+ _touchGeneration() {
231
+ this.generation++;
232
+ this._touch();
233
+ }
234
+ }
235
+ function isHTMLVideoElementSource(source) {
236
+ if (!source || typeof source !== "object") {
237
+ return false;
238
+ }
239
+ return typeof HTMLVideoElement !== "undefined" && source instanceof HTMLVideoElement || "videoWidth" in source && "videoHeight" in source && "readyState" in source && "currentTime" in source;
240
+ }
241
+ function isVideoFrameSource(source) {
242
+ if (!source || typeof source !== "object") {
243
+ return false;
244
+ }
245
+ return typeof VideoFrame !== "undefined" && source instanceof VideoFrame || "displayWidth" in source && "displayHeight" in source && "timestamp" in source && !("videoWidth" in source);
246
+ }
247
+ function isVideoTextureSourceReady(source) {
248
+ const size = getVideoTextureSourceSize(source);
249
+ if (size.width <= 0 || size.height <= 0) {
250
+ return false;
251
+ }
252
+ return isHTMLVideoElementSource(source) ? source.readyState >= 2 : true;
253
+ }
254
+ function getVideoTextureSourceSize(source) {
255
+ if (isHTMLVideoElementSource(source)) {
256
+ return { width: source.videoWidth, height: source.videoHeight };
257
+ }
258
+ return { width: source.displayWidth, height: source.displayHeight };
259
+ }
260
+ function getVideoTextureSourceFrameToken(source, sourceVersion) {
261
+ if (isHTMLVideoElementSource(source)) {
262
+ return `${sourceVersion}:${source.currentTime}:${source.videoWidth}x${source.videoHeight}`;
263
+ }
264
+ return `${sourceVersion}:${source.timestamp}:${source.displayWidth}x${source.displayHeight}`;
265
+ }
266
+ // Annotate the CommonJS export names for ESM import in node:
267
+ 0 && (module.exports = {
268
+ VideoTexture
269
+ });
@@ -1,6 +1,6 @@
1
1
  import type { Device, ExternalTexture, ResourceProps, Sampler, SamplerProps } from '@luma.gl/core';
2
2
  import { Texture } from '@luma.gl/core';
3
- import type { TextureBindingLayout, TextureBindingSource } from "./texture-binding-source.js";
3
+ import type { TextureBindingLayout, TextureBindingSource } from '@luma.gl/core/dynamic';
4
4
  /** Properties for a live video binding source. */
5
5
  export type VideoTextureProps = Pick<ResourceProps, 'id'> & {
6
6
  /** Caller-owned live video source followed by this binding source. */
@@ -1 +1 @@
1
- {"version":3,"file":"video-texture.d.ts","sourceRoot":"","sources":["../../src/dynamic-texture/video-texture.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,MAAM,EAAE,eAAe,EAAE,aAAa,EAAE,OAAO,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AACjG,OAAO,EAAC,OAAO,EAAS,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,EAAC,oBAAoB,EAAE,oBAAoB,EAAC,oCAAiC;AAEzF,kDAAkD;AAClD,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,GAAG;IAC1D,sEAAsE;IACtE,MAAM,EAAE,gBAAgB,GAAG,UAAU,CAAC;IACtC,+DAA+D;IAC/D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mEAAmE;IACnE,OAAO,CAAC,EAAE,OAAO,GAAG,YAAY,CAAC;CAClC,CAAC;AAEF;;;;;GAKG;AACH,qBAAa,YAAa,YAAW,oBAAoB;IACvD,yEAAyE;IACzE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,qEAAqE;IACrE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAEpB,4DAA4D;IAC5D,SAAS,UAAS;IAClB,6FAA6F;IAC7F,UAAU,SAAK;IAEf,OAAO,CAAC,OAAO,CAAgC;IAC/C,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,QAAQ,CAAyB;IACzC,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,gBAAgB,CAAS;IACjC,OAAO,CAAC,cAAc,CAAK;IAC3B,OAAO,CAAC,iBAAiB,CAAiB;IAC1C,OAAO,CAAC,QAAQ,CAAwB;IACxC,OAAO,CAAC,kBAAkB,CAAsB;IAChD,OAAO,CAAC,gBAAgB,CAAgC;IAExD,8CAA8C;IAC9C,IAAI,MAAM,IAAI,gBAAgB,GAAG,UAAU,CAE1C;IAED,yEAAyE;IACzE,IAAI,OAAO,IAAI,OAAO,CAGrB;IAED,qFAAqF;IACrF,IAAI,eAAe,IAAI,MAAM,CAG5B;IAED,2CAA2C;IAC3C,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,WAEvB;IAED,4EAA4E;IAC5E,QAAQ,IAAI,MAAM;IAKlB;;;;OAIG;gBACS,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,iBAAiB;IAcpD;;;OAGG;IACH,SAAS,CAAC,MAAM,EAAE,gBAAgB,GAAG,UAAU,GAAG,IAAI;IAatD;;;;OAIG;IACH,qBAAqB,CAAC,aAAa,EAAE,oBAAoB,GAAG,OAAO,GAAG,eAAe,GAAG,IAAI;IAa5F;;;OAGG;IACH,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,YAAY,GAAG,IAAI;IAOjD,uFAAuF;IACvF,OAAO,IAAI,IAAI;IAaf;;;OAGG;IACH,OAAO,CAAC,qBAAqB;IAc7B;;;OAGG;IACH,OAAO,CAAC,yBAAyB;IA4BjC;;;OAGG;IACH,OAAO,CAAC,4BAA4B;IAcpC,8DAA8D;IAC9D,OAAO,CAAC,uBAAuB;IAK/B;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IAOxB,sFAAsF;IACtF,OAAO,CAAC,cAAc;IAsBtB,+EAA+E;IAC/E,OAAO,CAAC,MAAM;IAId,mFAAmF;IACnF,OAAO,CAAC,gBAAgB;CAIzB"}
1
+ {"version":3,"file":"video-texture.d.ts","sourceRoot":"","sources":["../../src/dynamic-texture/video-texture.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,MAAM,EAAE,eAAe,EAAE,aAAa,EAAE,OAAO,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AACjG,OAAO,EAAC,OAAO,EAAS,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,EAAC,oBAAoB,EAAE,oBAAoB,EAAC,MAAM,uBAAuB,CAAC;AAEtF,kDAAkD;AAClD,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,GAAG;IAC1D,sEAAsE;IACtE,MAAM,EAAE,gBAAgB,GAAG,UAAU,CAAC;IACtC,+DAA+D;IAC/D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mEAAmE;IACnE,OAAO,CAAC,EAAE,OAAO,GAAG,YAAY,CAAC;CAClC,CAAC;AAEF;;;;;GAKG;AACH,qBAAa,YAAa,YAAW,oBAAoB;IACvD,yEAAyE;IACzE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,qEAAqE;IACrE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAEpB,4DAA4D;IAC5D,SAAS,UAAS;IAClB,6FAA6F;IAC7F,UAAU,SAAK;IAEf,OAAO,CAAC,OAAO,CAAgC;IAC/C,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,QAAQ,CAAyB;IACzC,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,gBAAgB,CAAS;IACjC,OAAO,CAAC,cAAc,CAAK;IAC3B,OAAO,CAAC,iBAAiB,CAAiB;IAC1C,OAAO,CAAC,QAAQ,CAAwB;IACxC,OAAO,CAAC,kBAAkB,CAAsB;IAChD,OAAO,CAAC,gBAAgB,CAAgC;IAExD,8CAA8C;IAC9C,IAAI,MAAM,IAAI,gBAAgB,GAAG,UAAU,CAE1C;IAED,yEAAyE;IACzE,IAAI,OAAO,IAAI,OAAO,CAGrB;IAED,qFAAqF;IACrF,IAAI,eAAe,IAAI,MAAM,CAG5B;IAED,2CAA2C;IAC3C,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,WAEvB;IAED,4EAA4E;IAC5E,QAAQ,IAAI,MAAM;IAKlB;;;;OAIG;gBACS,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,iBAAiB;IAcpD;;;OAGG;IACH,SAAS,CAAC,MAAM,EAAE,gBAAgB,GAAG,UAAU,GAAG,IAAI;IAatD;;;;OAIG;IACH,qBAAqB,CAAC,aAAa,EAAE,oBAAoB,GAAG,OAAO,GAAG,eAAe,GAAG,IAAI;IAa5F;;;OAGG;IACH,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,YAAY,GAAG,IAAI;IAOjD,uFAAuF;IACvF,OAAO,IAAI,IAAI;IAaf;;;OAGG;IACH,OAAO,CAAC,qBAAqB;IAc7B;;;OAGG;IACH,OAAO,CAAC,yBAAyB;IA4BjC;;;OAGG;IACH,OAAO,CAAC,4BAA4B;IAcpC,8DAA8D;IAC9D,OAAO,CAAC,uBAAuB;IAK/B;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IAOxB,sFAAsF;IACtF,OAAO,CAAC,cAAc;IAsBtB,+EAA+E;IAC/E,OAAO,CAAC,MAAM;IAId,mFAAmF;IACnF,OAAO,CAAC,gBAAgB;CAIzB"}
@@ -0,0 +1,231 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var comparison_splitter_exports = {};
19
+ __export(comparison_splitter_exports, {
20
+ ComparisonSplitter: () => ComparisonSplitter
21
+ });
22
+ module.exports = __toCommonJS(comparison_splitter_exports);
23
+ const DEFAULT_ACCENT_COLOR = "#33ebff";
24
+ const DEFAULT_HANDLE_COLOR = "rgb(8 47 73 / 92%)";
25
+ class ComparisonSplitter {
26
+ /** Focusable DOM separator. Its children and inline styles are owned by this instance. */
27
+ element;
28
+ canvas;
29
+ container;
30
+ onChange;
31
+ onCommit;
32
+ dividerLine;
33
+ accentColor;
34
+ value;
35
+ visible = true;
36
+ activePointerId = null;
37
+ destroyed = false;
38
+ constructor({ canvas, id, value, onChange, onCommit, label = "Before and after comparison", accentColor = DEFAULT_ACCENT_COLOR, handleColor = DEFAULT_HANDLE_COLOR, container }) {
39
+ this.canvas = canvas;
40
+ this.container = container;
41
+ this.value = clampSplit(value);
42
+ this.onChange = onChange;
43
+ this.onCommit = onCommit;
44
+ this.accentColor = accentColor;
45
+ const ownerDocument = canvas.ownerDocument || document;
46
+ this.element = ownerDocument.createElement("div");
47
+ if (id) {
48
+ this.element.id = id;
49
+ }
50
+ this.element.tabIndex = 0;
51
+ this.element.dataset["lumaComparisonSplitter"] = "true";
52
+ this.element.setAttribute("role", "separator");
53
+ this.element.setAttribute("aria-label", label);
54
+ this.element.setAttribute("aria-orientation", "vertical");
55
+ this.element.setAttribute("aria-valuemin", "0");
56
+ this.element.setAttribute("aria-valuemax", "1");
57
+ Object.assign(this.element.style, {
58
+ position: container ? "absolute" : "fixed",
59
+ width: "32px",
60
+ transform: "translateX(-50%)",
61
+ cursor: "col-resize",
62
+ touchAction: "none",
63
+ userSelect: "none",
64
+ outlineOffset: "4px",
65
+ zIndex: "10"
66
+ });
67
+ this.dividerLine = ownerDocument.createElement("span");
68
+ this.dividerLine.setAttribute("aria-hidden", "true");
69
+ Object.assign(this.dividerLine.style, {
70
+ position: "absolute",
71
+ top: "0",
72
+ bottom: "0",
73
+ left: "50%",
74
+ width: "2px",
75
+ transform: "translateX(-50%)",
76
+ backgroundColor: accentColor,
77
+ boxShadow: `0 0 8px ${accentColor}`,
78
+ pointerEvents: "none"
79
+ });
80
+ const handle = ownerDocument.createElement("span");
81
+ handle.setAttribute("aria-hidden", "true");
82
+ handle.textContent = "\u2194";
83
+ Object.assign(handle.style, {
84
+ position: "absolute",
85
+ top: "50%",
86
+ left: "50%",
87
+ width: "20px",
88
+ height: "44px",
89
+ transform: "translate(-50%, -50%)",
90
+ border: `1px solid ${accentColor}`,
91
+ borderRadius: "8px",
92
+ backgroundColor: handleColor,
93
+ color: accentColor,
94
+ boxShadow: "0 2px 12px rgb(0 0 0 / 45%)",
95
+ font: "16px / 42px system-ui, sans-serif",
96
+ textAlign: "center",
97
+ pointerEvents: "none"
98
+ });
99
+ this.element.append(this.dividerLine, handle);
100
+ this.element.addEventListener("pointerdown", this.handlePointerDown);
101
+ this.element.addEventListener("pointermove", this.handlePointerMove);
102
+ this.element.addEventListener("pointerup", this.handlePointerUp);
103
+ this.element.addEventListener("pointercancel", this.handlePointerCancel);
104
+ this.element.addEventListener("keydown", this.handleKeyDown);
105
+ (container || ownerDocument.body).append(this.element);
106
+ this.updateValue(this.value, false);
107
+ }
108
+ /** Releases pointer capture, removes interaction handlers, and detaches this divider. */
109
+ destroy() {
110
+ if (this.destroyed) {
111
+ return;
112
+ }
113
+ this.destroyed = true;
114
+ if (this.activePointerId !== null && this.element.hasPointerCapture(this.activePointerId)) {
115
+ this.element.releasePointerCapture(this.activePointerId);
116
+ }
117
+ this.activePointerId = null;
118
+ this.element.removeEventListener("pointerdown", this.handlePointerDown);
119
+ this.element.removeEventListener("pointermove", this.handlePointerMove);
120
+ this.element.removeEventListener("pointerup", this.handlePointerUp);
121
+ this.element.removeEventListener("pointercancel", this.handlePointerCancel);
122
+ this.element.removeEventListener("keydown", this.handleKeyDown);
123
+ this.element.remove();
124
+ }
125
+ /** Updates the normalized divider position without firing interaction callbacks. */
126
+ setValue(value) {
127
+ this.updateValue(value, false);
128
+ }
129
+ /** Hides or shows the divider while preserving its normalized position. */
130
+ setVisible(visible) {
131
+ this.visible = visible;
132
+ this.updateLayout();
133
+ }
134
+ /** Repositions the divider after the canvas or optional host moves, scrolls, or resizes. */
135
+ updateLayout() {
136
+ var _a;
137
+ const canvasBounds = this.canvas.getBoundingClientRect();
138
+ const rendered = this.visible && canvasBounds.width > 0 && canvasBounds.height > 0;
139
+ this.element.hidden = !rendered;
140
+ if (!rendered) {
141
+ return;
142
+ }
143
+ const containerBounds = (_a = this.container) == null ? void 0 : _a.getBoundingClientRect();
144
+ const horizontalOffset = containerBounds ? containerBounds.left + this.container.clientLeft - this.container.scrollLeft : 0;
145
+ const verticalOffset = containerBounds ? containerBounds.top + this.container.clientTop - this.container.scrollTop : 0;
146
+ this.element.style.left = `${canvasBounds.left - horizontalOffset + canvasBounds.width * this.value}px`;
147
+ this.element.style.top = `${canvasBounds.top - verticalOffset}px`;
148
+ this.element.style.height = `${canvasBounds.height}px`;
149
+ }
150
+ updateValue(value, notify) {
151
+ this.value = clampSplit(value);
152
+ this.element.setAttribute("aria-valuenow", this.value.toFixed(2));
153
+ this.element.setAttribute("aria-valuetext", `${Math.round(this.value * 100)}% before`);
154
+ this.updateLayout();
155
+ if (notify) {
156
+ this.onChange(this.value);
157
+ }
158
+ }
159
+ updateFromPointer(clientX) {
160
+ const canvasBounds = this.canvas.getBoundingClientRect();
161
+ if (canvasBounds.width > 0) {
162
+ this.updateValue((clientX - canvasBounds.left) / canvasBounds.width, true);
163
+ }
164
+ }
165
+ finishPointerInteraction(event, updatePosition) {
166
+ var _a;
167
+ if (event.pointerId !== this.activePointerId) {
168
+ return;
169
+ }
170
+ if (updatePosition) {
171
+ this.updateFromPointer(event.clientX);
172
+ }
173
+ this.activePointerId = null;
174
+ delete this.element.dataset["dragging"];
175
+ this.dividerLine.style.width = "2px";
176
+ this.dividerLine.style.backgroundColor = this.accentColor;
177
+ if (this.element.hasPointerCapture(event.pointerId)) {
178
+ this.element.releasePointerCapture(event.pointerId);
179
+ }
180
+ (_a = this.onCommit) == null ? void 0 : _a.call(this, this.value);
181
+ }
182
+ handlePointerDown = (event) => {
183
+ if (event.button !== 0 || this.activePointerId !== null) {
184
+ return;
185
+ }
186
+ event.preventDefault();
187
+ this.activePointerId = event.pointerId;
188
+ this.element.dataset["dragging"] = "true";
189
+ this.dividerLine.style.width = "3px";
190
+ this.dividerLine.style.backgroundColor = "#fff";
191
+ this.element.setPointerCapture(event.pointerId);
192
+ this.updateFromPointer(event.clientX);
193
+ };
194
+ handlePointerMove = (event) => {
195
+ if (event.pointerId === this.activePointerId) {
196
+ this.updateFromPointer(event.clientX);
197
+ }
198
+ };
199
+ handlePointerUp = (event) => {
200
+ this.finishPointerInteraction(event, true);
201
+ };
202
+ handlePointerCancel = (event) => {
203
+ this.finishPointerInteraction(event, false);
204
+ };
205
+ handleKeyDown = (event) => {
206
+ var _a;
207
+ const step = event.shiftKey ? 0.05 : 0.01;
208
+ let nextValue = this.value;
209
+ if (event.key === "ArrowLeft" || event.key === "ArrowDown") {
210
+ nextValue -= step;
211
+ } else if (event.key === "ArrowRight" || event.key === "ArrowUp") {
212
+ nextValue += step;
213
+ } else if (event.key === "Home") {
214
+ nextValue = 0;
215
+ } else if (event.key === "End") {
216
+ nextValue = 1;
217
+ } else {
218
+ return;
219
+ }
220
+ event.preventDefault();
221
+ this.updateValue(nextValue, true);
222
+ (_a = this.onCommit) == null ? void 0 : _a.call(this, this.value);
223
+ };
224
+ }
225
+ function clampSplit(value) {
226
+ return Math.min(1, Math.max(0, value));
227
+ }
228
+ // Annotate the CommonJS export names for ESM import in node:
229
+ 0 && (module.exports = {
230
+ ComparisonSplitter
231
+ });
@@ -0,0 +1,54 @@
1
+ /** Configuration for an accessible, independently styled canvas comparison divider. */
2
+ export type ComparisonSplitterProps = {
3
+ /** Canvas whose client rectangle determines the divider's visible bounds. */
4
+ canvas: HTMLCanvasElement;
5
+ /** Optional stable identifier for application styling, automation, or accessibility. */
6
+ id?: string;
7
+ /** Initial horizontal divider position, expressed between zero and one. */
8
+ value: number;
9
+ /** Called immediately while a pointer or keyboard interaction moves the divider. */
10
+ onChange: (value: number) => void;
11
+ /** Called once when a pointer interaction ends or a keyboard move is applied. */
12
+ onCommit?: (value: number) => void;
13
+ /** Accessible description announced for the focusable separator. */
14
+ label?: string;
15
+ /** CSS color applied independently to this divider's line, handle, and glow. */
16
+ accentColor?: string;
17
+ /** CSS background color applied independently to this divider's handle. */
18
+ handleColor?: string;
19
+ /** Optional positioned host; defaults to a fixed overlay in the canvas document body. */
20
+ container?: HTMLElement;
21
+ };
22
+ /** Accessible, self-contained DOM divider for comparing two views of one canvas. */
23
+ export declare class ComparisonSplitter {
24
+ /** Focusable DOM separator. Its children and inline styles are owned by this instance. */
25
+ readonly element: HTMLDivElement;
26
+ private readonly canvas;
27
+ private readonly container;
28
+ private readonly onChange;
29
+ private readonly onCommit;
30
+ private readonly dividerLine;
31
+ private readonly accentColor;
32
+ private value;
33
+ private visible;
34
+ private activePointerId;
35
+ private destroyed;
36
+ constructor({ canvas, id, value, onChange, onCommit, label, accentColor, handleColor, container }: ComparisonSplitterProps);
37
+ /** Releases pointer capture, removes interaction handlers, and detaches this divider. */
38
+ destroy(): void;
39
+ /** Updates the normalized divider position without firing interaction callbacks. */
40
+ setValue(value: number): void;
41
+ /** Hides or shows the divider while preserving its normalized position. */
42
+ setVisible(visible: boolean): void;
43
+ /** Repositions the divider after the canvas or optional host moves, scrolls, or resizes. */
44
+ updateLayout(): void;
45
+ private updateValue;
46
+ private updateFromPointer;
47
+ private finishPointerInteraction;
48
+ private readonly handlePointerDown;
49
+ private readonly handlePointerMove;
50
+ private readonly handlePointerUp;
51
+ private readonly handlePointerCancel;
52
+ private readonly handleKeyDown;
53
+ }
54
+ //# sourceMappingURL=comparison-splitter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comparison-splitter.d.ts","sourceRoot":"","sources":["../../../src/experimental/controls/comparison-splitter.ts"],"names":[],"mappings":"AAIA,uFAAuF;AACvF,MAAM,MAAM,uBAAuB,GAAG;IACpC,6EAA6E;IAC7E,MAAM,EAAE,iBAAiB,CAAC;IAC1B,wFAAwF;IACxF,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,2EAA2E;IAC3E,KAAK,EAAE,MAAM,CAAC;IACd,oFAAoF;IACpF,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,iFAAiF;IACjF,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,oEAAoE;IACpE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gFAAgF;IAChF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2EAA2E;IAC3E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yFAAyF;IACzF,SAAS,CAAC,EAAE,WAAW,CAAC;CACzB,CAAC;AAKF,oFAAoF;AACpF,qBAAa,kBAAkB;IAC7B,0FAA0F;IAC1F,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IAEjC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoB;IAC3C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA0B;IACpD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA0B;IACnD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAwC;IACjE,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAkB;IAC9C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,OAAO,CAAQ;IACvB,OAAO,CAAC,eAAe,CAAuB;IAC9C,OAAO,CAAC,SAAS,CAAS;gBAEd,EACV,MAAM,EACN,EAAE,EACF,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,KAAqC,EACrC,WAAkC,EAClC,WAAkC,EAClC,SAAS,EACV,EAAE,uBAAuB;IA2E1B,yFAAyF;IACzF,OAAO,IAAI,IAAI;IAkBf,oFAAoF;IACpF,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAI7B,2EAA2E;IAC3E,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAKlC,4FAA4F;IAC5F,YAAY,IAAI,IAAI;IAqBpB,OAAO,CAAC,WAAW;IAUnB,OAAO,CAAC,iBAAiB;IAOzB,OAAO,CAAC,wBAAwB;IAkBhC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAYhC;IAEF,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAIhC;IAEF,OAAO,CAAC,QAAQ,CAAC,eAAe,CAE9B;IAEF,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAElC;IAEF,OAAO,CAAC,QAAQ,CAAC,aAAa,CAkB5B;CACH"}