@nova-lab/core 1.0.0-dev.19 → 1.1.1-dev.229

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 (501) hide show
  1. package/README.md +1035 -10
  2. package/THIRD_PARTY_NOTICES.md +26 -0
  3. package/dist/2d/accessibility.d.ts +2 -0
  4. package/dist/2d/accessibility.js +171 -0
  5. package/dist/2d/commands.d.ts +2 -0
  6. package/dist/2d/commands.js +80 -0
  7. package/dist/2d/effects.d.ts +10 -0
  8. package/dist/2d/effects.js +566 -0
  9. package/dist/2d/ktx2.d.ts +5 -0
  10. package/dist/2d/ktx2.js +542 -0
  11. package/dist/2d/lighting.d.ts +3 -0
  12. package/dist/2d/lighting.js +495 -0
  13. package/dist/2d/lottie.d.ts +3 -0
  14. package/dist/2d/lottie.js +254 -0
  15. package/dist/2d/meshes.d.ts +4 -0
  16. package/dist/2d/meshes.js +451 -0
  17. package/dist/2d/primitives.d.ts +3 -0
  18. package/dist/2d/primitives.js +85 -0
  19. package/dist/2d/render-textures.d.ts +3 -0
  20. package/dist/2d/render-textures.js +539 -0
  21. package/dist/2d/svg/documents.d.ts +5 -0
  22. package/dist/2d/svg/documents.js +7 -0
  23. package/dist/2d/svg/renderer.d.ts +3 -0
  24. package/dist/2d/svg/renderer.js +222 -0
  25. package/dist/2d/svg.d.ts +3 -0
  26. package/dist/2d/svg.js +4 -0
  27. package/dist/2d/tools.d.ts +2 -0
  28. package/dist/2d/tools.js +100 -0
  29. package/dist/2d/video.d.ts +5 -0
  30. package/dist/2d/video.js +90 -0
  31. package/dist/2d.d.ts +2 -0
  32. package/dist/2d.js +220 -0
  33. package/dist/3d/animation.d.ts +8 -0
  34. package/dist/3d/animation.js +1396 -0
  35. package/dist/3d/area-lights.d.ts +2 -0
  36. package/dist/3d/area-lights.js +19 -0
  37. package/dist/3d/audio.d.ts +4 -0
  38. package/dist/3d/audio.js +500 -0
  39. package/dist/3d/character.d.ts +2 -0
  40. package/dist/3d/character.js +136 -0
  41. package/dist/3d/collision.d.ts +3 -0
  42. package/dist/3d/collision.js +387 -0
  43. package/dist/3d/commands.d.ts +2 -0
  44. package/dist/3d/commands.js +108 -0
  45. package/dist/3d/controls.d.ts +8 -0
  46. package/dist/3d/controls.js +1041 -0
  47. package/dist/3d/documents.d.ts +5 -0
  48. package/dist/3d/documents.js +227 -0
  49. package/dist/3d/effects.d.ts +5 -0
  50. package/dist/3d/effects.js +1986 -0
  51. package/dist/3d/export.d.ts +4 -0
  52. package/dist/3d/export.js +347 -0
  53. package/dist/3d/fbx.d.ts +2 -0
  54. package/dist/3d/fbx.js +784 -0
  55. package/dist/3d/gltf.d.ts +2 -0
  56. package/dist/3d/gltf.js +5 -0
  57. package/dist/3d/helpers.d.ts +5 -0
  58. package/dist/3d/helpers.js +191 -0
  59. package/dist/3d/ik.d.ts +9 -0
  60. package/dist/3d/ik.js +777 -0
  61. package/dist/3d/loaders.d.ts +17 -0
  62. package/dist/3d/loaders.js +1406 -0
  63. package/dist/3d/nodes.d.ts +8 -0
  64. package/dist/3d/nodes.js +49 -0
  65. package/dist/3d/particles.d.ts +5 -0
  66. package/dist/3d/particles.js +1574 -0
  67. package/dist/3d/physics/backend.d.ts +7 -0
  68. package/dist/3d/physics/backend.js +1 -0
  69. package/dist/3d/physics/rapier.d.ts +3 -0
  70. package/dist/3d/physics/rapier.js +765 -0
  71. package/dist/3d/physics.d.ts +5 -0
  72. package/dist/3d/physics.js +3346 -0
  73. package/dist/3d/splats.d.ts +7 -0
  74. package/dist/3d/splats.js +862 -0
  75. package/dist/3d/text.d.ts +5 -0
  76. package/dist/3d/text.js +1043 -0
  77. package/dist/3d/tiles.d.ts +24 -0
  78. package/dist/3d/tiles.js +1705 -0
  79. package/dist/3d/tools.d.ts +12 -0
  80. package/dist/3d/tools.js +338 -0
  81. package/dist/3d/usdz.d.ts +2 -0
  82. package/dist/3d/usdz.js +634 -0
  83. package/dist/3d/xr.d.ts +2 -0
  84. package/dist/3d/xr.js +202 -0
  85. package/dist/3d-B4jWF8Qb.js +5591 -0
  86. package/dist/3d.d.ts +40 -0
  87. package/dist/3d.js +44 -0
  88. package/dist/Capsule-BFVpZfvc.js +44 -0
  89. package/dist/Clip-CAN7t03k.js +204 -0
  90. package/dist/Color-vuv9UnoY.js +34 -0
  91. package/dist/DeformedMesh-CPi0P_vc.js +280 -0
  92. package/dist/Document-DCVEZSvM.js +415 -0
  93. package/dist/Errors-B2ekO9bZ.js +30 -0
  94. package/dist/Features-BsjmePtc.js +557 -0
  95. package/dist/GLTFResourceIO-CYJyCUTt.js +124 -0
  96. package/dist/GPUParticleState-CQlNpoDa.js +545 -0
  97. package/dist/Geometry-DytO490z.js +227 -0
  98. package/dist/Inflate-DWw0V-Up.js +42 -0
  99. package/dist/InstancedMesh-DPrgrw5z.js +527 -0
  100. package/dist/Limits-Bw5XQdFr.js +20 -0
  101. package/dist/LineHelper-Ad0z9uDi.js +131 -0
  102. package/dist/LoaderIO-BwrM84OM.js +114 -0
  103. package/dist/Material-BpfLPmK9.js +777 -0
  104. package/dist/Mesh-BaRxAAJq.js +209 -0
  105. package/dist/Node-QfgAE2_v.js +877 -0
  106. package/dist/NovaAssetRegistry-p2QlCwvT.js +1168 -0
  107. package/dist/NovaNode-CBZ-Ol-W.js +2016 -0
  108. package/dist/NovaRenderCommandWriter-CWQRa42y.js +1949 -0
  109. package/dist/NovaTextSelectionService-CipuujCT.js +18526 -0
  110. package/dist/NovaWebGLProgram-BO250QNF.js +97 -0
  111. package/dist/Options-CajE7LLJ.js +15 -0
  112. package/dist/PolygonMesh-D4PnnfIo.js +657 -0
  113. package/dist/Ready-BzyhRtjD.js +21 -0
  114. package/dist/Scene-CDfNgf9I.js +911 -0
  115. package/dist/Shader-b6_HDndT.js +48 -0
  116. package/dist/SplatShader-wJ6GJ3vo.js +130 -0
  117. package/dist/Texture-dTKMlTpK.js +267 -0
  118. package/dist/TextureLoader-CfDzdy2m.js +411 -0
  119. package/dist/Textures-CGL4Kf-8.js +651 -0
  120. package/dist/ToneMapping-D9IWvN0u.js +46 -0
  121. package/dist/WebGPURenderer-DjD0IxVC.js +4921 -0
  122. package/dist/ZipReader-C-MSEsSr.js +84 -0
  123. package/dist/core.js +218 -24024
  124. package/dist/domain/types/base.types.d.ts +18 -9
  125. package/dist/domain/types/component.types.d.ts +5 -5
  126. package/dist/domain/types/cursor.types.d.ts +1 -1
  127. package/dist/domain/types/diagnostics.types.d.ts +2 -0
  128. package/dist/domain/types/export.types.d.ts +2 -2
  129. package/dist/domain/types/hit-test.types.d.ts +1 -1
  130. package/dist/domain/types/motion.types.d.ts +2 -2
  131. package/dist/domain/types/renderer.types.d.ts +88 -4
  132. package/dist/domain/types/rendering/index.d.ts +29 -4
  133. package/dist/domain/types/sound.types.d.ts +1 -1
  134. package/dist/domain/types/theme.types.d.ts +1 -1
  135. package/dist/domain/utils/bounds.d.ts +1 -1
  136. package/dist/domain/utils/nova-text.d.ts +9 -0
  137. package/dist/domain/utils/schemaBounds.d.ts +2 -2
  138. package/dist/export-svg-document-ChaNXMaG.js +668 -0
  139. package/dist/features/3d/Errors.d.ts +57 -0
  140. package/dist/features/3d/Nova3DApp.d.ts +429 -0
  141. package/dist/features/3d/animation/Animator.d.ts +260 -0
  142. package/dist/features/3d/animation/Clip.d.ts +74 -0
  143. package/dist/features/3d/animation/Graph.d.ts +158 -0
  144. package/dist/features/3d/animation/Mask.d.ts +40 -0
  145. package/dist/features/3d/audio/Audio.d.ts +114 -0
  146. package/dist/features/3d/audio/Sound.d.ts +133 -0
  147. package/dist/features/3d/character/CharacterController.d.ts +61 -0
  148. package/dist/features/3d/collision/Capsule.d.ts +25 -0
  149. package/dist/features/3d/collision/Octree.d.ts +94 -0
  150. package/dist/features/3d/controls/CameraMotionControls.d.ts +154 -0
  151. package/dist/features/3d/controls/CameraOrientation.d.ts +47 -0
  152. package/dist/features/3d/controls/OrbitControls.d.ts +73 -0
  153. package/dist/features/3d/controls/PointerGesture.d.ts +25 -0
  154. package/dist/features/3d/controls/PointerLock.d.ts +36 -0
  155. package/dist/features/3d/controls/Snapping.d.ts +32 -0
  156. package/dist/features/3d/controls/TransformGizmo.d.ts +79 -0
  157. package/dist/features/3d/deformation/DeformationGPU.d.ts +52 -0
  158. package/dist/features/3d/deformation/DeformationShader.d.ts +2 -0
  159. package/dist/features/3d/deformation/DeformedMesh.d.ts +36 -0
  160. package/dist/features/3d/deformation/GeometryDeformation.d.ts +25 -0
  161. package/dist/features/3d/documents/Document.d.ts +59 -0
  162. package/dist/features/3d/documents/DocumentCommands.d.ts +45 -0
  163. package/dist/features/3d/documents/DocumentSchema.d.ts +18 -0
  164. package/dist/features/3d/documents/DocumentTransform.d.ts +4 -0
  165. package/dist/features/3d/documents/DocumentTypes.d.ts +182 -0
  166. package/dist/features/3d/documents/DocumentValidation.d.ts +18 -0
  167. package/dist/features/3d/documents/Projection.d.ts +65 -0
  168. package/dist/features/3d/effects/CubeLUT.d.ts +24 -0
  169. package/dist/features/3d/effects/Effects.d.ts +32 -0
  170. package/dist/features/3d/effects/EffectsGPU.d.ts +80 -0
  171. package/dist/features/3d/effects/EffectsPlan.d.ts +268 -0
  172. package/dist/features/3d/effects/EffectsShaders.d.ts +35 -0
  173. package/dist/features/3d/export/GLTFExporter.d.ts +49 -0
  174. package/dist/features/3d/export/ThreeMFExporter.d.ts +19 -0
  175. package/dist/features/3d/export/ZipWriter.d.ts +9 -0
  176. package/dist/features/3d/fbx/FBXLoader.d.ts +26 -0
  177. package/dist/features/3d/fbx/FBXParser.d.ts +35 -0
  178. package/dist/features/3d/fbx/FBXScene.d.ts +20 -0
  179. package/dist/features/3d/gltf/GLTFLoader.d.ts +16 -0
  180. package/dist/features/3d/gltf/GLTFTypes.d.ts +64 -0
  181. package/dist/features/3d/gltf/services/GLTFBinary.d.ts +21 -0
  182. package/dist/features/3d/gltf/services/GLTFGeometry.d.ts +14 -0
  183. package/dist/features/3d/gltf/services/GLTFResourceIO.d.ts +64 -0
  184. package/dist/features/3d/helpers/LineHelper.d.ts +51 -0
  185. package/dist/features/3d/helpers/StaticHelpers.d.ts +47 -0
  186. package/dist/features/3d/helpers/TrackedHelpers.d.ts +84 -0
  187. package/dist/features/3d/ik/ChainIK.d.ts +44 -0
  188. package/dist/features/3d/ik/IKChain.d.ts +92 -0
  189. package/dist/features/3d/ik/IKMath.d.ts +49 -0
  190. package/dist/features/3d/ik/IKSolver.d.ts +97 -0
  191. package/dist/features/3d/ik/LookAtIK.d.ts +58 -0
  192. package/dist/features/3d/ik/TwoBoneIK.d.ts +57 -0
  193. package/dist/features/3d/import/ImportAnimation.d.ts +20 -0
  194. package/dist/features/3d/import/ImportMath.d.ts +42 -0
  195. package/dist/features/3d/import/ImportedModel.d.ts +135 -0
  196. package/dist/features/3d/import/Inflate.d.ts +5 -0
  197. package/dist/features/3d/import/ModelAsset.d.ts +149 -0
  198. package/dist/features/3d/import/PolygonMesh.d.ts +54 -0
  199. package/dist/features/3d/lights/AreaLightTables.d.ts +8 -0
  200. package/dist/features/3d/lights/AreaLights.d.ts +11 -0
  201. package/dist/features/3d/loaders/EXRCompression.d.ts +13 -0
  202. package/dist/features/3d/loaders/EXRLoader.d.ts +39 -0
  203. package/dist/features/3d/loaders/HDRLoader.d.ts +26 -0
  204. package/dist/features/3d/loaders/Limits.d.ts +70 -0
  205. package/dist/features/3d/loaders/LoaderBuffers.d.ts +42 -0
  206. package/dist/features/3d/loaders/LoaderIO.d.ts +81 -0
  207. package/dist/features/3d/loaders/LoaderModel.d.ts +80 -0
  208. package/dist/features/3d/loaders/LoaderText.d.ts +27 -0
  209. package/dist/features/3d/loaders/MTLLoader.d.ts +105 -0
  210. package/dist/features/3d/loaders/OBJLoader.d.ts +70 -0
  211. package/dist/features/3d/loaders/PLYLoader.d.ts +47 -0
  212. package/dist/features/3d/loaders/STLLoader.d.ts +27 -0
  213. package/dist/features/3d/model/Camera.d.ts +33 -0
  214. package/dist/features/3d/model/Environment.d.ts +31 -0
  215. package/dist/features/3d/model/Geometry.d.ts +59 -0
  216. package/dist/features/3d/model/InstancedMesh.d.ts +134 -0
  217. package/dist/features/3d/model/LOD.d.ts +31 -0
  218. package/dist/features/3d/model/Light.d.ts +200 -0
  219. package/dist/features/3d/model/Material.d.ts +308 -0
  220. package/dist/features/3d/model/MaterialExtensions.d.ts +200 -0
  221. package/dist/features/3d/model/Mesh.d.ts +92 -0
  222. package/dist/features/3d/model/Node.d.ts +87 -0
  223. package/dist/features/3d/model/ReflectionProbe.d.ts +45 -0
  224. package/dist/features/3d/model/RenderTarget.d.ts +41 -0
  225. package/dist/features/3d/model/Scene.d.ts +173 -0
  226. package/dist/features/3d/model/Texture.d.ts +143 -0
  227. package/dist/features/3d/nodes/Nodes.d.ts +8 -0
  228. package/dist/features/3d/nodes/ShaderNode.d.ts +240 -0
  229. package/dist/features/3d/particles/GPUParticleSchedule.d.ts +67 -0
  230. package/dist/features/3d/particles/GPUParticleShaders.d.ts +19 -0
  231. package/dist/features/3d/particles/GPUParticleState.d.ts +106 -0
  232. package/dist/features/3d/particles/GPUParticleSystem.d.ts +192 -0
  233. package/dist/features/3d/particles/ParticleCurves.d.ts +34 -0
  234. package/dist/features/3d/particles/ParticleOptions.d.ts +78 -0
  235. package/dist/features/3d/particles/ParticleSystem.d.ts +368 -0
  236. package/dist/features/3d/physics/PhysicsBackend.d.ts +352 -0
  237. package/dist/features/3d/physics/PhysicsDebug.d.ts +24 -0
  238. package/dist/features/3d/physics/PhysicsWorld.d.ts +352 -0
  239. package/dist/features/3d/physics/basic/BasicCollision.d.ts +75 -0
  240. package/dist/features/3d/physics/basic/BasicPhysics.d.ts +24 -0
  241. package/dist/features/3d/physics/basic/BasicShapes.d.ts +103 -0
  242. package/dist/features/3d/physics/rapier/ContactBuffer.d.ts +32 -0
  243. package/dist/features/3d/physics/rapier/RapierBackend.d.ts +17 -0
  244. package/dist/features/3d/physics/rapier/RapierShapes.d.ts +4 -0
  245. package/dist/features/3d/physics/rapier/RapierWorld.d.ts +198 -0
  246. package/dist/features/3d/physics/rapier/Validation.d.ts +8 -0
  247. package/dist/features/3d/services/Background.d.ts +22 -0
  248. package/dist/features/3d/services/BasicShader.d.ts +55 -0
  249. package/dist/features/3d/services/ClusteredLights.d.ts +69 -0
  250. package/dist/features/3d/services/DrawOrder.d.ts +37 -0
  251. package/dist/features/3d/services/EffectsProcessor.d.ts +38 -0
  252. package/dist/features/3d/services/EnvironmentBRDF.d.ts +35 -0
  253. package/dist/features/3d/services/EnvironmentMaps.d.ts +55 -0
  254. package/dist/features/3d/services/FogShader.d.ts +6 -0
  255. package/dist/features/3d/services/Frustum.d.ts +7 -0
  256. package/dist/features/3d/services/GLState.d.ts +86 -0
  257. package/dist/features/3d/services/GPUPicker.d.ts +31 -0
  258. package/dist/features/3d/services/InstanceShader.d.ts +3 -0
  259. package/dist/features/3d/services/LineProgram.d.ts +32 -0
  260. package/dist/features/3d/services/PBRProgram.d.ts +115 -0
  261. package/dist/features/3d/services/Renderer.d.ts +50 -0
  262. package/dist/features/3d/services/Shader.d.ts +22 -0
  263. package/dist/features/3d/services/ShaderProgram.d.ts +38 -0
  264. package/dist/features/3d/services/ShadowMaps.d.ts +97 -0
  265. package/dist/features/3d/services/SpatialIndex.d.ts +16 -0
  266. package/dist/features/3d/services/TextureLoader.d.ts +40 -0
  267. package/dist/features/3d/services/TextureMipmaps.d.ts +42 -0
  268. package/dist/features/3d/services/ToneMapping.d.ts +12 -0
  269. package/dist/features/3d/services/WebGLRenderer.d.ts +261 -0
  270. package/dist/features/3d/splats/SplatData.d.ts +136 -0
  271. package/dist/features/3d/splats/SplatLoaders.d.ts +64 -0
  272. package/dist/features/3d/splats/SplatShader.d.ts +14 -0
  273. package/dist/features/3d/splats/SplatSort.d.ts +69 -0
  274. package/dist/features/3d/splats/Splats.d.ts +116 -0
  275. package/dist/features/3d/text/FontAtlas.d.ts +246 -0
  276. package/dist/features/3d/text/SDF.d.ts +28 -0
  277. package/dist/features/3d/text/Text.d.ts +179 -0
  278. package/dist/features/3d/text/TextLayout.d.ts +73 -0
  279. package/dist/features/3d/text/TextShader.d.ts +12 -0
  280. package/dist/features/3d/tiles/BoundingVolume.d.ts +43 -0
  281. package/dist/features/3d/tiles/Geodesy.d.ts +106 -0
  282. package/dist/features/3d/tiles/GlobeControls.d.ts +147 -0
  283. package/dist/features/3d/tiles/TileContent.d.ts +35 -0
  284. package/dist/features/3d/tiles/TileFormats.d.ts +77 -0
  285. package/dist/features/3d/tiles/Tiles3D.d.ts +236 -0
  286. package/dist/features/3d/tiles/Tileset.d.ts +81 -0
  287. package/dist/features/3d/tools/BatchedMesh.d.ts +74 -0
  288. package/dist/features/3d/tools/CanvasSurface.d.ts +81 -0
  289. package/dist/features/3d/tools/Color.d.ts +11 -0
  290. package/dist/features/3d/tools/MergeGeometries.d.ts +22 -0
  291. package/dist/features/3d/tools/Options.d.ts +15 -0
  292. package/dist/features/3d/tools/Polyhedra.d.ts +30 -0
  293. package/dist/features/3d/tools/PrimitiveBuffers.d.ts +42 -0
  294. package/dist/features/3d/tools/Primitives.d.ts +164 -0
  295. package/dist/features/3d/tools/Ready.d.ts +12 -0
  296. package/dist/features/3d/tools/SpatialMath.d.ts +57 -0
  297. package/dist/features/3d/tools/SphericalHarmonics.d.ts +9 -0
  298. package/dist/features/3d/tools/math/mat3.d.ts +7 -0
  299. package/dist/features/3d/tools/math/mat4.d.ts +19 -0
  300. package/dist/features/3d/tools/math/quat.d.ts +6 -0
  301. package/dist/features/3d/tools/math/vec3.d.ts +16 -0
  302. package/dist/features/3d/tools/math/vec4.d.ts +5 -0
  303. package/dist/features/3d/types.d.ts +359 -0
  304. package/dist/features/3d/usdz/USDAParser.d.ts +50 -0
  305. package/dist/features/3d/usdz/USDScene.d.ts +20 -0
  306. package/dist/features/3d/usdz/USDZLoader.d.ts +27 -0
  307. package/dist/features/3d/usdz/ZipReader.d.ts +16 -0
  308. package/dist/features/3d/webgpu/Backend.d.ts +40 -0
  309. package/dist/features/3d/webgpu/BasicShader.d.ts +10 -0
  310. package/dist/features/3d/webgpu/Constants.d.ts +32 -0
  311. package/dist/features/3d/webgpu/Deformation.d.ts +71 -0
  312. package/dist/features/3d/webgpu/Environment.d.ts +66 -0
  313. package/dist/features/3d/webgpu/Features.d.ts +68 -0
  314. package/dist/features/3d/webgpu/Layouts.d.ts +27 -0
  315. package/dist/features/3d/webgpu/Lines.d.ts +40 -0
  316. package/dist/features/3d/webgpu/LitExtras.d.ts +46 -0
  317. package/dist/features/3d/webgpu/LitFeatures.d.ts +41 -0
  318. package/dist/features/3d/webgpu/LitScene.d.ts +60 -0
  319. package/dist/features/3d/webgpu/LitShader.d.ts +68 -0
  320. package/dist/features/3d/webgpu/Particles.d.ts +114 -0
  321. package/dist/features/3d/webgpu/Picking.d.ts +59 -0
  322. package/dist/features/3d/webgpu/PipelineKey.d.ts +33 -0
  323. package/dist/features/3d/webgpu/Points.d.ts +41 -0
  324. package/dist/features/3d/webgpu/Probes.d.ts +45 -0
  325. package/dist/features/3d/webgpu/ShaderChunks.d.ts +18 -0
  326. package/dist/features/3d/webgpu/ShaderMaterial.d.ts +57 -0
  327. package/dist/features/3d/webgpu/ShaderMaterialSource.d.ts +5 -0
  328. package/dist/features/3d/webgpu/Shadows.d.ts +49 -0
  329. package/dist/features/3d/webgpu/Splats.d.ts +47 -0
  330. package/dist/features/3d/webgpu/Textures.d.ts +52 -0
  331. package/dist/features/3d/webgpu/Transmission.d.ts +30 -0
  332. package/dist/features/3d/webgpu/UniformLayout.d.ts +30 -0
  333. package/dist/features/3d/webgpu/UtilityShaders.d.ts +38 -0
  334. package/dist/features/3d/webgpu/WebGPURenderer.d.ts +327 -0
  335. package/dist/features/3d/webgpu/effects/EffectsShaders.d.ts +74 -0
  336. package/dist/features/3d/webgpu/effects/WebGPUEffects.d.ts +140 -0
  337. package/dist/features/3d/xr/XR.d.ts +100 -0
  338. package/dist/gltf-By-n0qEg.js +960 -0
  339. package/dist/index.d.ts +86 -81
  340. package/dist/model/document-actions/document-commands.d.ts +18 -0
  341. package/dist/model/documents/svg/create-svg-document-renderer.d.ts +32 -0
  342. package/dist/model/documents/svg/export-svg-document.d.ts +5 -0
  343. package/dist/model/documents/svg/import-svg-document.d.ts +6 -0
  344. package/dist/model/documents/svg/svg-document.types.d.ts +111 -0
  345. package/dist/model/documents/svg/svg-values.d.ts +16 -0
  346. package/dist/model/documents/svg/svg-xml.d.ts +18 -0
  347. package/dist/model/input/NovaInputProxy_Adapter.d.ts +2 -1
  348. package/dist/model/input/NovaInputValidationController.d.ts +1 -1
  349. package/dist/model/input/NovaTextInputController.d.ts +1 -1
  350. package/dist/model/input/NovaTextLayoutEngine.d.ts +2 -6
  351. package/dist/model/input/index.d.ts +7 -7
  352. package/dist/model/input/nova-input.types.d.ts +1 -1
  353. package/dist/model/lighting/LightingRenderer2D.d.ts +58 -0
  354. package/dist/model/lighting/NovaLighting2D.d.ts +56 -0
  355. package/dist/model/lighting/lighting-shaders.d.ts +3 -0
  356. package/dist/model/lighting/lighting-state.d.ts +27 -0
  357. package/dist/model/lighting/lighting.types.d.ts +107 -0
  358. package/dist/model/lottie/LottieNode.d.ts +4 -0
  359. package/dist/model/lottie/lottie.types.d.ts +83 -0
  360. package/dist/model/lottie/prepare-lottie.d.ts +3 -0
  361. package/dist/model/lottie/sample-position.d.ts +9 -0
  362. package/dist/model/motion/NovaMotionEngine.d.ts +3 -3
  363. package/dist/model/motion/nova-motion-easing.d.ts +1 -1
  364. package/dist/model/motion/nova-motion-interpolation.d.ts +1 -1
  365. package/dist/model/motion/nova-motion-presets.d.ts +2 -2
  366. package/dist/model/motion/nova-motion-timeline.d.ts +1 -1
  367. package/dist/model/platform/NovaCanvas.d.ts +7 -6
  368. package/dist/model/primitives/NovaPrimitiveUnsupportedError.d.ts +13 -0
  369. package/dist/model/primitives/definePrimitive.d.ts +5 -0
  370. package/dist/model/primitives/primitive.types.d.ts +28 -0
  371. package/dist/model/render/backends/canvas2d/NovaCanvas2DTargetManager.d.ts +3 -3
  372. package/dist/model/render/backends/canvas2d/NovaRenderer2D.d.ts +61 -15
  373. package/dist/model/render/backends/canvas2d/nova-canvas-blend.d.ts +5 -0
  374. package/dist/model/render/backends/nova-render-backend-factory.d.ts +6 -6
  375. package/dist/model/render/backends/nova-render-backend.d.ts +8 -2
  376. package/dist/model/render/backends/webgl/NovaRendererWebGL.d.ts +32 -11
  377. package/dist/model/render/backends/webgl/NovaStreamCacheIdleLedger.d.ts +12 -1
  378. package/dist/model/render/backends/webgl/NovaWebGLBatcher.d.ts +1 -1
  379. package/dist/model/render/backends/webgl/NovaWebGLCircleImagePass.d.ts +23 -0
  380. package/dist/model/render/backends/webgl/NovaWebGLCompositionPass.d.ts +9 -0
  381. package/dist/model/render/backends/webgl/NovaWebGLDevice.d.ts +3 -1
  382. package/dist/model/render/backends/webgl/NovaWebGLDiagnostics.d.ts +1 -1
  383. package/dist/model/render/backends/webgl/NovaWebGLFrameRenderer.d.ts +162 -53
  384. package/dist/model/render/backends/webgl/NovaWebGLPathClipPass.d.ts +13 -0
  385. package/dist/model/render/backends/webgl/NovaWebGLPathUnion.d.ts +23 -0
  386. package/dist/model/render/compiler/NovaRenderBuilder.d.ts +24 -10
  387. package/dist/model/render/compiler/NovaRenderCommandWriter.d.ts +10 -5
  388. package/dist/model/render/compiler/NovaRenderCompiler.d.ts +7 -6
  389. package/dist/model/render/compiler/NovaRenderFrameBuilder.d.ts +4 -3
  390. package/dist/model/render/effects/blur.d.ts +8 -0
  391. package/dist/model/render/effects/color-matrix.d.ts +8 -0
  392. package/dist/model/render/effects/drop-shadow.d.ts +18 -0
  393. package/dist/model/render/effects/nova-effect-registry.d.ts +66 -0
  394. package/dist/model/render/effects/nova-gaussian-kernel.d.ts +7 -0
  395. package/dist/model/render/effects/nova-gaussian-textures.d.ts +11 -0
  396. package/dist/model/render/effects/shader-effect.d.ts +64 -0
  397. package/dist/model/render/geometry/nova-alpha-mask.d.ts +5 -0
  398. package/dist/model/render/geometry/nova-composition.d.ts +9 -0
  399. package/dist/model/render/geometry/nova-node-clip.d.ts +17 -0
  400. package/dist/model/render/geometry/nova-path-geometry.d.ts +24 -0
  401. package/dist/model/render/geometry/nova-path-tessellation.d.ts +7 -0
  402. package/dist/model/render/geometry/nova-polygon-triangulation.d.ts +1 -1
  403. package/dist/model/render/graph/NovaRectBatchBuffer.d.ts +58 -0
  404. package/dist/model/render/graph/NovaRenderGraph.d.ts +40 -6
  405. package/dist/model/render/graph/NovaRenderHitIndex.d.ts +1 -1
  406. package/dist/model/render/graph/nova-auto-rect.d.ts +1 -1
  407. package/dist/model/render/graph/nova-linear-rect-repack.d.ts +4 -4
  408. package/dist/model/render/graph/nova-linear-rect-transition.d.ts +2 -2
  409. package/dist/model/render/graph/nova-render-culling.d.ts +2 -2
  410. package/dist/model/render/graph/nova-render-dirty-items.d.ts +1 -1
  411. package/dist/model/render/graph/nova-render-group.d.ts +1 -1
  412. package/dist/model/render/graph/nova-render-item.d.ts +2 -2
  413. package/dist/model/render/graph/nova-render-layer.d.ts +1 -1
  414. package/dist/model/render/graph/nova-render-payload-snapshot.d.ts +3 -1
  415. package/dist/model/render/graph/nova-render-program.d.ts +5 -3
  416. package/dist/model/render/graph/nova-render-sequence.d.ts +1 -1
  417. package/dist/model/render/graph/nova-render-stream.d.ts +2 -2
  418. package/dist/model/render/ktx2/BasisSession.d.ts +45 -0
  419. package/dist/model/render/ktx2/KTX2Container.d.ts +26 -0
  420. package/dist/model/render/ktx2/KTX2Loader.d.ts +55 -0
  421. package/dist/model/render/meshes/MeshNode.d.ts +13 -0
  422. package/dist/model/render/meshes/NovaMeshWebGLDevice.d.ts +27 -0
  423. package/dist/model/render/meshes/geometry.d.ts +7 -0
  424. package/dist/model/render/meshes/mesh.d.ts +3 -0
  425. package/dist/model/render/meshes/mesh.types.d.ts +116 -0
  426. package/dist/model/render/meshes/nova-mesh-registry.d.ts +55 -0
  427. package/dist/model/render/orchestration/NovaRenderOrchestrator.d.ts +25 -3
  428. package/dist/model/render/policy/nova-render-policy.d.ts +1 -1
  429. package/dist/model/render/resources/NovaGlyphAtlasManager.d.ts +2 -2
  430. package/dist/model/render/resources/NovaTextAtlasManager.d.ts +3 -3
  431. package/dist/model/render/resources/NovaTextLayoutEngine.d.ts +1 -1
  432. package/dist/model/render/resources/nova-bitmap-upload.d.ts +10 -0
  433. package/dist/model/render/schema/NovaRenderContext.d.ts +6 -4
  434. package/dist/model/render/schema/nova-style-compiler.d.ts +5 -2
  435. package/dist/model/render/targets/NovaNodeRenderTextureSource.d.ts +29 -0
  436. package/dist/model/render/targets/NovaRenderTargetManager.d.ts +1 -1
  437. package/dist/model/render/targets/NovaRenderTexture.d.ts +57 -0
  438. package/dist/model/render/targets/nova-render-target-refs.d.ts +5 -0
  439. package/dist/model/render/targets/nova-render-target-resource.d.ts +1 -1
  440. package/dist/model/render/targets/nova-render-texture-runtime.d.ts +71 -0
  441. package/dist/model/render/textures/nova-compressed-image.d.ts +20 -0
  442. package/dist/model/render/utils/nova-icon-rendering.d.ts +3 -1
  443. package/dist/model/render/utils/nova-image-geometry.d.ts +11 -0
  444. package/dist/model/render/utils/nova-markdown-layout.d.ts +19 -0
  445. package/dist/model/render/utils/nova-text-paint.d.ts +26 -0
  446. package/dist/model/render/utils/nova-wrapped-text-layout.d.ts +19 -0
  447. package/dist/model/runtime/app/Nova.d.ts +35 -35
  448. package/dist/model/runtime/app/NovaApp.d.ts +58 -30
  449. package/dist/model/runtime/app/NovaRaphRuntime.d.ts +2 -2
  450. package/dist/model/runtime/app/createNovaRaphRuntime.d.ts +3 -3
  451. package/dist/model/runtime/assets/NovaAssetRegistry.d.ts +89 -2
  452. package/dist/model/runtime/assets/NovaVideoTexture.d.ts +38 -0
  453. package/dist/model/runtime/assets/nova-render-texture-image-identity.d.ts +4 -0
  454. package/dist/model/runtime/commands/NovaCommandBus.d.ts +1 -1
  455. package/dist/model/runtime/components/NovaComponentNode.d.ts +6 -6
  456. package/dist/model/runtime/components/NovaComponentRegistry.d.ts +1 -1
  457. package/dist/model/runtime/components/NovaSchemaRegistry.d.ts +7 -6
  458. package/dist/model/runtime/components/nova-component-metadata.d.ts +1 -1
  459. package/dist/model/runtime/components/nova-component.decorator.d.ts +2 -2
  460. package/dist/model/runtime/components/nova-defined-component.d.ts +3 -3
  461. package/dist/model/runtime/context/nova-context.d.ts +1 -1
  462. package/dist/model/runtime/cursor/NovaCursorManager.d.ts +3 -3
  463. package/dist/model/runtime/diagnostics/NovaDiagnostics_Module.d.ts +3 -3
  464. package/dist/model/runtime/interaction/NovaEvents.d.ts +16 -6
  465. package/dist/model/runtime/interaction/NovaHitIndex.d.ts +1 -1
  466. package/dist/model/runtime/interaction/NovaSpatialIndex.d.ts +2 -2
  467. package/dist/model/runtime/scene/NovaScene.d.ts +3 -3
  468. package/dist/model/runtime/scene/nova-scene-components.d.ts +6 -6
  469. package/dist/model/runtime/state/nova-store-decorators.d.ts +1 -1
  470. package/dist/model/runtime/state/nova-store-runtime.d.ts +1 -1
  471. package/dist/model/runtime/state/nova-store-tracking.d.ts +7 -3
  472. package/dist/model/runtime/sync/NovaSyncScope.d.ts +11 -2
  473. package/dist/model/runtime/sync/nova-sync-context.d.ts +2 -2
  474. package/dist/model/runtime/sync/nova-sync-ports.d.ts +2 -2
  475. package/dist/model/runtime/sync/nova-sync.types.d.ts +15 -3
  476. package/dist/model/runtime/template/NovaTemplateRuntime.d.ts +6 -6
  477. package/dist/model/runtime/tree/NovaContainer.d.ts +4 -4
  478. package/dist/model/runtime/tree/NovaNode.d.ts +58 -18
  479. package/dist/model/runtime/tree/NovaRaphNode.d.ts +8 -2
  480. package/dist/model/runtime/tree/NovaSurface.d.ts +32 -10
  481. package/dist/model/runtime/tree/nova-node-capture-invalidation.d.ts +11 -0
  482. package/dist/model/semantic/NovaSemanticService.d.ts +1 -1
  483. package/dist/model/semantic/browser/createAccessibilityBridge.d.ts +29 -0
  484. package/dist/model/sound/NovaSoundEngine.d.ts +3 -2
  485. package/dist/model/text-selection/NovaTextSelectionService.d.ts +2 -2
  486. package/dist/model/text-selection/index.d.ts +2 -2
  487. package/dist/model/text-selection/nova-text-selection.types.d.ts +1 -1
  488. package/dist/model/theme/NovaGlobalThemeRegistry.d.ts +2 -2
  489. package/dist/model/theme/NovaThemeService.d.ts +5 -3
  490. package/dist/model/theme/createTokenTheme.d.ts +15 -0
  491. package/dist/model/tools/transform-tools.d.ts +43 -0
  492. package/dist/nodes--Ds4IS2h.js +621 -0
  493. package/dist/nova-color-parser-BCN_rFRN.js +250 -0
  494. package/dist/nova-compressed-image-CE2Ya9Xa.js +46 -0
  495. package/dist/nova-mesh-registry-B7Xz5mhU.js +24 -0
  496. package/dist/nova-render-texture-image-identity-DQ09XFKs.js +15 -0
  497. package/dist/nova-text-paint-CcntsRjI.js +48 -0
  498. package/dist/tokens.d.ts +2 -0
  499. package/dist/tokens.js +50 -0
  500. package/dist/vec4-BTNv1fUp.js +20 -0
  501. package/package.json +229 -4
@@ -0,0 +1,250 @@
1
+ function T() {
2
+ return { x: 0, y: 0, width: 0, height: 0 };
3
+ }
4
+ function O(t, e) {
5
+ const n = t.x, o = t.y, i = t.x + t.width, h = t.y + t.height, s = e[0] * n + e[3] * o + e[6], r = e[1] * n + e[4] * o + e[7], c = e[0] * i + e[3] * o + e[6], f = e[1] * i + e[4] * o + e[7], m = e[0] * n + e[3] * h + e[6], y = e[1] * n + e[4] * h + e[7], d = e[0] * i + e[3] * h + e[6], w = e[1] * i + e[4] * h + e[7], x = Math.min(s, c, m, d), M = Math.min(r, f, y, w), C = Math.max(s, c, m, d), k = Math.max(r, f, y, w);
6
+ return {
7
+ x,
8
+ y: M,
9
+ width: C - x,
10
+ height: k - M
11
+ };
12
+ }
13
+ function S(t, e) {
14
+ if (t.width <= 0 && t.height <= 0)
15
+ return { ...e };
16
+ if (e.width <= 0 && e.height <= 0)
17
+ return { ...t };
18
+ const n = Math.min(t.x, e.x), o = Math.min(t.y, e.y), i = Math.max(t.x + t.width, e.x + e.width), h = Math.max(t.y + t.height, e.y + e.height);
19
+ return {
20
+ x: n,
21
+ y: o,
22
+ width: i - n,
23
+ height: h - o
24
+ };
25
+ }
26
+ function Y(t, e, n, o, i) {
27
+ return t.x = e, t.y = n, t.width = o, t.height = i, t;
28
+ }
29
+ function _(t, e) {
30
+ return t.x = e.x, t.y = e.y, t.width = e.width, t.height = e.height, t;
31
+ }
32
+ function $(t, e) {
33
+ return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
34
+ }
35
+ function H(t, e) {
36
+ return t.width <= 0 || t.height <= 0 || e.width <= 0 || e.height <= 0 ? !1 : t.x < e.x + e.width && t.x + t.width > e.x && t.y < e.y + e.height && t.y + t.height > e.y;
37
+ }
38
+ function X(t, e, n) {
39
+ return e >= t.x && n >= t.y && e <= t.x + t.width && n <= t.y + t.height;
40
+ }
41
+ function q(t) {
42
+ if (!t.image || typeof t.image != "string" && typeof t.image != "object")
43
+ throw new TypeError("[Nova] Alpha mask requires a drawable image or asset ref");
44
+ if (![t.x, t.y, t.width, t.height].every(Number.isFinite) || t.width < 0 || t.height < 0)
45
+ throw new RangeError("[Nova] Alpha mask bounds must be finite and nonnegative");
46
+ return Object.freeze({ image: t.image, x: t.x, y: t.y, width: t.width, height: t.height });
47
+ }
48
+ function F(t, e = 0) {
49
+ if (!t.mask)
50
+ return t;
51
+ const n = O(t.mask, t.mask.transform), o = { x: n.x - e, y: n.y - e, width: n.width + e * 2, height: n.height + e * 2 }, i = Math.max(o.x, t.bounds.x), h = Math.max(o.y, t.bounds.y), s = Math.min(o.x + o.width, t.bounds.x + t.bounds.width), r = Math.min(o.y + o.height, t.bounds.y + t.bounds.height);
52
+ return { ...t, bounds: { x: i, y: h, width: Math.max(0, s - i), height: Math.max(0, r - h) } };
53
+ }
54
+ function D(t) {
55
+ if (!t)
56
+ return !1;
57
+ const e = t;
58
+ return Number(e.displayWidth ?? e.naturalWidth ?? e.videoWidth ?? e.width) > 0 && Number(e.displayHeight ?? e.naturalHeight ?? e.videoHeight ?? e.height) > 0;
59
+ }
60
+ const I = Object.freeze(["normal", "multiply", "screen", "overlay", "darken", "lighten", "difference", "exclusion", "color-dodge", "color-burn", "hard-light", "soft-light", "hue", "saturation", "color", "luminosity"]);
61
+ function L(t) {
62
+ const e = t.opacity ?? 1, n = t.blendMode ?? "normal";
63
+ if (!Number.isFinite(e) || e < 0 || e > 1 || !I.includes(n))
64
+ throw new RangeError("[Nova] Invalid group opacity or unsupported blend mode");
65
+ const o = t.bounds;
66
+ if (o !== void 0 && (![o.x, o.y, o.width, o.height].every(Number.isFinite) || o.width < 0 || o.height < 0))
67
+ throw new RangeError("[Nova] Composition bounds must be a finite nonnegative rectangle");
68
+ const i = o === void 0 ? void 0 : Object.freeze({ x: o.x, y: o.y, width: o.width, height: o.height });
69
+ return Object.freeze({ opacity: e, blendMode: n, bounds: i });
70
+ }
71
+ function V(t) {
72
+ return [`nova:composition:${t}:color`, `nova:composition:${t}:backdrop`, `nova:composition:${t}:mask`, `nova:composition:${t}:color:effect:0`, `nova:composition:${t}:color:effect:1`];
73
+ }
74
+ function B(t, e, n) {
75
+ const o = Math.floor(Math.max(t.x, e.x) * n) / n, i = Math.floor(Math.max(t.y, e.y) * n) / n, h = Math.ceil(Math.min(t.x + t.width, e.x + e.width) * n) / n, s = Math.ceil(Math.min(t.y + t.height, e.y + e.height) * n) / n;
76
+ if (![o, i, h, s, n].every(Number.isFinite) || n <= 0)
77
+ throw new RangeError("[Nova] Composition bounds and DPR must remain finite");
78
+ return { x: o, y: i, width: Math.max(0, h - o), height: Math.max(0, s - i) };
79
+ }
80
+ const v = /* @__PURE__ */ new WeakMap();
81
+ function G(t) {
82
+ const e = v.get(t);
83
+ if (e)
84
+ return e;
85
+ const n = [], o = [], i = /* @__PURE__ */ new Map();
86
+ let h, s;
87
+ for (const r of t) {
88
+ if ((r.type === "clip" || r.type === "clipPath") && n.push(r), r.type === "beginComposition" && o.push({ clip: h?.type === "clipPath" ? h : void 0, pass: r.composition }), r.type === "endComposition")
89
+ s = o.pop();
90
+ else if (r.type === "clearClip") {
91
+ const c = n.pop();
92
+ c && s?.clip === c && s.pass && !s.pass.effects?.length && (i.set(c.id, s.pass), s = void 0);
93
+ } else
94
+ s = void 0;
95
+ h = r;
96
+ }
97
+ return v.set(t, i), i;
98
+ }
99
+ function U(t, e) {
100
+ let n;
101
+ try {
102
+ for (const o of new Set(t)) {
103
+ const i = a(o).subscribe;
104
+ i && (n ??= []).push(i(o, e));
105
+ }
106
+ } catch (o) {
107
+ throw n?.forEach((i) => i()), o;
108
+ }
109
+ return n ? () => n.splice(0).forEach((o) => o()) : void 0;
110
+ }
111
+ const E = Object.freeze([]), j = Object.freeze([]);
112
+ function J(t) {
113
+ return a(t).images?.(t) ?? j;
114
+ }
115
+ const b = /* @__PURE__ */ new WeakMap();
116
+ function K(t, e) {
117
+ const n = Object.freeze(t);
118
+ return b.set(n, e), n;
119
+ }
120
+ function a(t) {
121
+ const e = b.get(t);
122
+ if (!e)
123
+ throw new TypeError("[Nova] Unsupported effect; use @nova-lab/core/2d/effects factories");
124
+ return e;
125
+ }
126
+ function Q(t) {
127
+ if (t === null || t.length === 0)
128
+ return E;
129
+ const e = [...t];
130
+ for (const n of e)
131
+ a(n);
132
+ return Object.freeze(e);
133
+ }
134
+ function Z(t) {
135
+ return a(t).passes?.(t) ?? 1;
136
+ }
137
+ function P(t, e) {
138
+ let n = 0;
139
+ for (const o of t ?? E)
140
+ n += a(o).outset?.(o, e) ?? 0;
141
+ return n;
142
+ }
143
+ function p(t, e) {
144
+ return { x: t.x - e, y: t.y - e, width: t.width + e * 2, height: t.height + e * 2 };
145
+ }
146
+ function tt(t, e, n) {
147
+ if (t.bounds.width <= 0 || t.bounds.height <= 0 || t.mask?.width === 0 || t.mask?.height === 0)
148
+ return { ...t.bounds, width: 0, height: 0 };
149
+ const o = P(t.effects, n), i = o ? { ...t, bounds: p(t.bounds, o) } : t;
150
+ return B(F(i, o).bounds, o ? p(e, o) : e, n);
151
+ }
152
+ function et(t, e, n, o, i = t) {
153
+ const h = a(e);
154
+ if (h.stageBounds)
155
+ return h.stageBounds(t, i, e, n, o);
156
+ const s = a(e).stageOutset?.(e, n, o);
157
+ return s ? { x: t.x - s.x, y: t.y - s.y, width: t.width + s.x * 2, height: t.height + s.y * 2 } : { ...t };
158
+ }
159
+ function nt(t, e, n) {
160
+ const o = Math.max(Math.floor(t.x * n), Math.round(e.x * n)), i = Math.max(Math.floor(t.y * n), Math.round(e.y * n)), h = Math.min(Math.ceil((t.x + t.width) * n), Math.round((e.x + e.width) * n)), s = Math.min(Math.ceil((t.y + t.height) * n), Math.round((e.y + e.height) * n));
161
+ return { x: o - Math.round(e.x * n), y: i - Math.round(e.y * n), width: Math.max(0, h - o), height: Math.max(0, s - i) };
162
+ }
163
+ const N = {
164
+ black: 255,
165
+ white: 4294967295,
166
+ red: 4278190335,
167
+ green: 8388863,
168
+ blue: 65535,
169
+ transparent: 0
170
+ };
171
+ function ot(t, e = 0) {
172
+ const n = W(t, e);
173
+ return {
174
+ r: (n >>> 24 & 255) / 255,
175
+ g: (n >>> 16 & 255) / 255,
176
+ b: (n >>> 8 & 255) / 255,
177
+ a: (n & 255) / 255,
178
+ packed: n
179
+ };
180
+ }
181
+ function W(t, e = 0) {
182
+ if (!t)
183
+ return e >>> 0;
184
+ const n = t.trim().toLowerCase();
185
+ return n in N ? N[n] >>> 0 : n.startsWith("#") ? z(n, e) : n.startsWith("rgb(") || n.startsWith("rgba(") ? A(n, e) : e >>> 0;
186
+ }
187
+ function z(t, e) {
188
+ const n = t.slice(1);
189
+ if (n.length === 3 || n.length === 4) {
190
+ const o = Number.parseInt(n[0] + n[0], 16), i = Number.parseInt(n[1] + n[1], 16), h = Number.parseInt(n[2] + n[2], 16), s = n.length === 4 ? Number.parseInt(n[3] + n[3], 16) : 255;
191
+ return l(o, i, h, s);
192
+ }
193
+ if (n.length === 6 || n.length === 8) {
194
+ const o = Number.parseInt(n.slice(0, 2), 16), i = Number.parseInt(n.slice(2, 4), 16), h = Number.parseInt(n.slice(4, 6), 16), s = n.length === 8 ? Number.parseInt(n.slice(6, 8), 16) : 255;
195
+ return [o, i, h, s].some(Number.isNaN) ? e >>> 0 : l(o, i, h, s);
196
+ }
197
+ return e >>> 0;
198
+ }
199
+ function A(t, e) {
200
+ const n = t.indexOf("("), o = t.lastIndexOf(")");
201
+ if (n < 0 || o < n)
202
+ return e >>> 0;
203
+ const i = t.slice(n + 1, o).split(",").map((f) => f.trim());
204
+ if (i.length < 3)
205
+ return e >>> 0;
206
+ const h = g(i[0]), s = g(i[1]), r = g(i[2]), c = i[3] === void 0 ? 255 : R(i[3]);
207
+ return [h, s, r, c].some(Number.isNaN) ? e >>> 0 : l(h, s, r, c);
208
+ }
209
+ function g(t) {
210
+ return t.endsWith("%") ? u(Number.parseFloat(t) / 100 * 255) : u(Number.parseFloat(t));
211
+ }
212
+ function R(t) {
213
+ return t.endsWith("%") ? u(Number.parseFloat(t) / 100 * 255) : u(Number.parseFloat(t) * 255);
214
+ }
215
+ function u(t) {
216
+ return Math.max(0, Math.min(255, Math.round(t)));
217
+ }
218
+ function l(t, e, n, o) {
219
+ return ((t & 255) << 24 | (e & 255) << 16 | (n & 255) << 8 | o & 255) >>> 0;
220
+ }
221
+ export {
222
+ G as A,
223
+ E,
224
+ $ as a,
225
+ X as b,
226
+ H as c,
227
+ _ as d,
228
+ T as e,
229
+ W as f,
230
+ U as g,
231
+ Q as h,
232
+ q as i,
233
+ L as j,
234
+ D as k,
235
+ P as l,
236
+ V as m,
237
+ J as n,
238
+ a as o,
239
+ ot as p,
240
+ F as q,
241
+ K as r,
242
+ Y as s,
243
+ O as t,
244
+ S as u,
245
+ tt as v,
246
+ nt as w,
247
+ I as x,
248
+ Z as y,
249
+ et as z
250
+ };
@@ -0,0 +1,46 @@
1
+ let i;
2
+ function f(t, e) {
3
+ if (i ??= /* @__PURE__ */ new WeakMap(), i.has(t))
4
+ throw new Error("[Nova] Compressed image source already has an owner");
5
+ const n = 1 + Math.floor(Math.log2(Math.max(e.width, e.height)));
6
+ if (!["bc3", "etc2-rgba"].includes(e.format) || !e.premultiplied || !Number.isSafeInteger(e.width) || !Number.isSafeInteger(e.height) || e.width < 1 || e.height < 1 || !["srgb", "linear"].includes(e.transfer) || e.width > 8192 || e.height > 8192 || e.levels.length !== 1 && e.levels.length !== n)
7
+ throw new Error("[Nova] Invalid compressed image payload");
8
+ let s = 0;
9
+ const a = e.levels.map((r, o) => {
10
+ const c = Math.max(1, e.width >> o), m = Math.max(1, e.height >> o), h = Math.ceil(c / 4) * Math.ceil(m / 4) * 16;
11
+ if (r.width !== c || r.height !== m || !(r.data instanceof Uint8Array) || r.data.byteLength !== h || e.format === "bc3" && (c * 2 ** o % 4 || m * 2 ** o % 4))
12
+ throw new Error("[Nova] Invalid compressed image mip blocks");
13
+ return s += h, Object.freeze({ width: c, height: m, data: r.data.slice() });
14
+ });
15
+ if (s !== e.bytes)
16
+ throw new Error("[Nova] Invalid compressed image block byte count");
17
+ return i.set(t, Object.freeze({ ...e, levels: Object.freeze(a) })), () => {
18
+ i?.delete(t);
19
+ };
20
+ }
21
+ function E(t) {
22
+ return i?.get(t);
23
+ }
24
+ function u(t, e, n) {
25
+ if (t.isContextLost() || e > t.getParameter(t.MAX_TEXTURE_SIZE) || n > t.getParameter(t.MAX_TEXTURE_SIZE))
26
+ return;
27
+ const s = t.getExtension("WEBGL_compressed_texture_s3tc"), a = t.getExtension("WEBGL_compressed_texture_etc"), r = t.getParameter(t.COMPRESSED_TEXTURE_FORMATS);
28
+ if (r) {
29
+ if (s && e % 4 === 0 && n % 4 === 0 && Array.from(r).includes(33779))
30
+ return "bc3";
31
+ if (a && Array.from(r).includes(37496))
32
+ return "etc2-rgba";
33
+ }
34
+ }
35
+ function _(t, e) {
36
+ if (t.isContextLost() || e.width > t.getParameter(t.MAX_TEXTURE_SIZE) || e.height > t.getParameter(t.MAX_TEXTURE_SIZE))
37
+ return !1;
38
+ const n = t.getExtension(e.format === "bc3" ? "WEBGL_compressed_texture_s3tc" : "WEBGL_compressed_texture_etc"), s = t.getParameter(t.COMPRESSED_TEXTURE_FORMATS);
39
+ return !!n && !!s && Array.from(s).includes(e.format === "bc3" ? 33779 : 37496);
40
+ }
41
+ export {
42
+ E as a,
43
+ f as b,
44
+ _ as c,
45
+ u as n
46
+ };
@@ -0,0 +1,24 @@
1
+ const s = /* @__PURE__ */ new WeakMap();
2
+ function c(r, e) {
3
+ s.set(r, e);
4
+ }
5
+ function n(r) {
6
+ const e = s.get(r);
7
+ if (!e)
8
+ throw new TypeError("[Nova] Unknown or copied mesh batch");
9
+ return e;
10
+ }
11
+ function a(r, e) {
12
+ const o = [...new Set(r)].map(n);
13
+ for (const t of o)
14
+ t.listeners.add(e);
15
+ return () => {
16
+ for (const t of o)
17
+ t.listeners.delete(e);
18
+ };
19
+ }
20
+ export {
21
+ n as g,
22
+ c as r,
23
+ a as s
24
+ };
@@ -0,0 +1,15 @@
1
+ let n;
2
+ function a(e) {
3
+ return n?.has(e) ?? !1;
4
+ }
5
+ function t(e) {
6
+ return n?.get(e);
7
+ }
8
+ function s(e, r) {
9
+ (n ??= /* @__PURE__ */ new WeakMap()).set(e, r);
10
+ }
11
+ export {
12
+ a as i,
13
+ t as n,
14
+ s as r
15
+ };
@@ -0,0 +1,48 @@
1
+ function y(i) {
2
+ return i.styles?.fillOpacity !== void 0 || i.styles?.stroke !== void 0;
3
+ }
4
+ function w(i) {
5
+ if (!y(i))
6
+ return;
7
+ if (i.parser === "markdown" || i.styles?.wrap !== void 0 && i.styles.wrap !== "none")
8
+ throw new TypeError("[Nova] Text paint requires a plain string without wrapping");
9
+ f(i.styles?.opacity ?? 1);
10
+ const s = i.styles?.color || "#000", a = f(i.styles?.fillOpacity ?? 1), t = i.styles?.stroke;
11
+ let e, o = 0;
12
+ if (t) {
13
+ if (t.widthUnits !== void 0 && t.widthUnits !== "world")
14
+ throw new TypeError("[Nova] Text stroke supports only world width units");
15
+ const n = t.width ?? 1, r = t.miterLimit ?? 10, d = t.dashOffset ?? 0, u = t.lineCap ?? "butt", l = t.lineJoin ?? "miter";
16
+ if (typeof t.color != "string" || !t.color || !Number.isFinite(n) || n < 0 || !Number.isFinite(r) || r <= 0 || !Number.isFinite(d) || !["butt", "round", "square"].includes(u) || !["miter", "round", "bevel"].includes(l))
17
+ throw new TypeError("[Nova] Invalid text stroke");
18
+ const p = [...t.dashPattern ?? []];
19
+ if (p.some((c) => !Number.isFinite(c) || c < 0))
20
+ throw new TypeError("[Nova] Invalid text stroke dash");
21
+ const h = f(t.opacity ?? 1);
22
+ if (e = { color: t.color, opacity: h, width: n, lineCap: u, lineJoin: l, miterLimit: r, dashPattern: p, dashOffset: d }, n > 0 && h > 0 && (o = n * Math.max(1, l === "miter" ? r : 1), !Number.isFinite(o)))
23
+ throw new RangeError("[Nova] Text stroke bounds are not finite");
24
+ }
25
+ return { fill: s, fillOpacity: a, stroke: e, outset: o, key: JSON.stringify([s, a, e ? [e.color, e.opacity, e.width, e.lineCap, e.lineJoin, e.miterLimit, e.dashPattern, e.dashOffset] : null]) };
26
+ }
27
+ function m(i, s, a, t, e, o = 1) {
28
+ e.fillOpacity > 0 && (i.fillStyle = e.fill, i.globalAlpha = o * e.fillOpacity, i.fillText(s, a, t));
29
+ const n = e.stroke;
30
+ n && n.width > 0 && n.opacity > 0 && (i.strokeStyle = n.color, i.globalAlpha = o * n.opacity, i.lineWidth = n.width, i.lineCap = n.lineCap, i.lineJoin = n.lineJoin, i.miterLimit = n.miterLimit, i.setLineDash([...n.dashPattern]), i.lineDashOffset = n.dashOffset, i.strokeText(s, a, t));
31
+ }
32
+ function v(i, s, a, t) {
33
+ const e = s - i.actualBoundingBoxLeft - t, o = a - i.actualBoundingBoxAscent - t, n = i.actualBoundingBoxLeft + i.actualBoundingBoxRight + t * 2, r = i.actualBoundingBoxAscent + i.actualBoundingBoxDescent + t * 2;
34
+ if (![e, o, n, r].every(Number.isFinite) || n < 0 || r < 0)
35
+ throw new TypeError("[Nova] Text paint requires finite native ink metrics");
36
+ return { x: e, y: o, width: n, height: r };
37
+ }
38
+ function f(i) {
39
+ if (!Number.isFinite(i) || i < 0 || i > 1)
40
+ throw new TypeError("[Nova] Text paint opacity must be between zero and one");
41
+ return i;
42
+ }
43
+ export {
44
+ y as h,
45
+ v as n,
46
+ m as p,
47
+ w as r
48
+ };
@@ -0,0 +1,2 @@
1
+ export { createTokenTheme } from './model/theme/createTokenTheme.js';
2
+ export type { NovaTokenTheme, NovaTokenThemeOptions } from './model/theme/createTokenTheme.js';
package/dist/tokens.js ADDED
@@ -0,0 +1,50 @@
1
+ import { format as v, color as w } from "@typedworks/color";
2
+ import { resolveTokenSet as p } from "@typedworks/token";
3
+ import { getCatalog as u } from "@typedworks/token/foundation";
4
+ function E(t, l) {
5
+ const a = l.catalog, m = u(a.tokens), i = /* @__PURE__ */ new Map();
6
+ for (const e of m.entries)
7
+ e.kind === "color" && i.set(e.token, `--nova-token:${JSON.stringify(e.path)}`);
8
+ const d = /* @__PURE__ */ new Map();
9
+ function h(e) {
10
+ if (e.definition !== a || e.tokens !== a.tokens)
11
+ throw new TypeError("[Nova tokens] Set belongs to another catalog.");
12
+ const o = d.get(e.id);
13
+ if (o !== void 0) {
14
+ if (o !== e)
15
+ throw new Error(`[Nova tokens] Set id "${e.id}" is already registered with another definition.`);
16
+ t.theme.use(e.id);
17
+ return;
18
+ }
19
+ if (t.theme.has(e.id))
20
+ throw new Error(`[Nova tokens] Theme id "${e.id}" is already registered.`);
21
+ const r = p(e), f = {};
22
+ for (const [g, k] of i) {
23
+ let s = r;
24
+ for (const n of g.path)
25
+ s = s[n];
26
+ const c = s;
27
+ f[k] = v(w(
28
+ c.colorSpace,
29
+ c.components.map((n) => n === "none" ? null : n),
30
+ c.alpha ?? 1
31
+ ), "hex", { alpha: "always" });
32
+ }
33
+ t.theme.register({ id: e.id, tokens: f }, { activate: !0 }), d.set(e.id, e);
34
+ }
35
+ return h(l.set), {
36
+ use: h,
37
+ color(e) {
38
+ const o = i.get(e);
39
+ if (o === void 0)
40
+ throw new TypeError("[Nova tokens] Expected a color handle from this catalog.");
41
+ const r = t.theme.token(o);
42
+ if (typeof r != "string")
43
+ throw new TypeError("[Nova tokens] Active Nova theme has no prepared value for this handle.");
44
+ return r;
45
+ }
46
+ };
47
+ }
48
+ export {
49
+ E as createTokenTheme
50
+ };
@@ -0,0 +1,20 @@
1
+ /*! gl-matrix 3.4.4 (functions copied into Nova) | MIT License
2
+ Copyright (c) 2015-2021, Brandon Jones, Colin MacKenzie IV.
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
5
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
6
+ function o() {
7
+ return new Float32Array(4);
8
+ }
9
+ function f(r, t, n, s, c) {
10
+ return r[0] = t, r[1] = n, r[2] = s, r[3] = c, r;
11
+ }
12
+ function i(r, t, n) {
13
+ const s = t[0], c = t[1], e = t[2], a = t[3];
14
+ return r[0] = n[0] * s + n[4] * c + n[8] * e + n[12] * a, r[1] = n[1] * s + n[5] * c + n[9] * e + n[13] * a, r[2] = n[2] * s + n[6] * c + n[10] * e + n[14] * a, r[3] = n[3] * s + n[7] * c + n[11] * e + n[15] * a, r;
15
+ }
16
+ export {
17
+ o as c,
18
+ f as s,
19
+ i as t
20
+ };