@motionscript/core 0.1.0-alpha.9 → 0.1.1-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1064) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/assets/asset-index.d.ts +1 -8
  3. package/dist/assets/asset-index.d.ts.map +1 -1
  4. package/dist/assets/asset-index.js +1 -8
  5. package/dist/assets/asset-index.js.map +1 -1
  6. package/dist/assets/catalog.d.ts +10 -72
  7. package/dist/assets/catalog.d.ts.map +1 -1
  8. package/dist/assets/catalog.js +3 -29
  9. package/dist/assets/catalog.js.map +1 -1
  10. package/dist/assets/errors.d.ts +8 -20
  11. package/dist/assets/errors.d.ts.map +1 -1
  12. package/dist/assets/errors.js +8 -20
  13. package/dist/assets/errors.js.map +1 -1
  14. package/dist/assets/index.d.ts.map +1 -1
  15. package/dist/assets/index.js.map +1 -1
  16. package/dist/assets/manager.d.ts +9 -51
  17. package/dist/assets/manager.d.ts.map +1 -1
  18. package/dist/assets/manager.js +13 -78
  19. package/dist/assets/manager.js.map +1 -1
  20. package/dist/assets/record.d.ts +2 -18
  21. package/dist/assets/record.d.ts.map +1 -1
  22. package/dist/assets/record.js.map +1 -1
  23. package/dist/assets/scope.d.ts +3 -18
  24. package/dist/assets/scope.d.ts.map +1 -1
  25. package/dist/assets/scope.js +2 -11
  26. package/dist/assets/scope.js.map +1 -1
  27. package/dist/attributes/audio/effects/chain.d.ts +2 -12
  28. package/dist/attributes/audio/effects/chain.d.ts.map +1 -1
  29. package/dist/attributes/audio/effects/chain.js +1 -7
  30. package/dist/attributes/audio/effects/chain.js.map +1 -1
  31. package/dist/attributes/audio/effects/registry.d.ts +3 -18
  32. package/dist/attributes/audio/effects/registry.d.ts.map +1 -1
  33. package/dist/attributes/audio/effects/registry.js +4 -23
  34. package/dist/attributes/audio/effects/registry.js.map +1 -1
  35. package/dist/attributes/audio/ramp.d.ts +5 -38
  36. package/dist/attributes/audio/ramp.d.ts.map +1 -1
  37. package/dist/attributes/audio/ramp.js +3 -28
  38. package/dist/attributes/audio/ramp.js.map +1 -1
  39. package/dist/attributes/audio/request.d.ts +10 -80
  40. package/dist/attributes/audio/request.d.ts.map +1 -1
  41. package/dist/attributes/audio/request.js +1 -4
  42. package/dist/attributes/audio/request.js.map +1 -1
  43. package/dist/attributes/audio/schedule.d.ts +2 -12
  44. package/dist/attributes/audio/schedule.d.ts.map +1 -1
  45. package/dist/attributes/audio/schedule.js +2 -11
  46. package/dist/attributes/audio/schedule.js.map +1 -1
  47. package/dist/attributes/audio/sound.d.ts +2 -26
  48. package/dist/attributes/audio/sound.d.ts.map +1 -1
  49. package/dist/attributes/audio/sound.js +1 -9
  50. package/dist/attributes/audio/sound.js.map +1 -1
  51. package/dist/attributes/audio/transition.d.ts +1 -8
  52. package/dist/attributes/audio/transition.d.ts.map +1 -1
  53. package/dist/attributes/audio/transition.js.map +1 -1
  54. package/dist/attributes/layout/alignment.d.ts +6 -38
  55. package/dist/attributes/layout/alignment.d.ts.map +1 -1
  56. package/dist/attributes/layout/alignment.js.map +1 -1
  57. package/dist/attributes/layout/insets.d.ts +2 -27
  58. package/dist/attributes/layout/insets.d.ts.map +1 -1
  59. package/dist/attributes/layout/insets.js.map +1 -1
  60. package/dist/attributes/layout/matrix2d.d.ts +29 -114
  61. package/dist/attributes/layout/matrix2d.d.ts.map +1 -1
  62. package/dist/attributes/layout/matrix2d.js +26 -110
  63. package/dist/attributes/layout/matrix2d.js.map +1 -1
  64. package/dist/attributes/layout/size.d.ts +3 -25
  65. package/dist/attributes/layout/size.d.ts.map +1 -1
  66. package/dist/attributes/layout/size.js +2 -18
  67. package/dist/attributes/layout/size.js.map +1 -1
  68. package/dist/attributes/layout/space3d.d.ts +16 -79
  69. package/dist/attributes/layout/space3d.d.ts.map +1 -1
  70. package/dist/attributes/layout/space3d.js +17 -81
  71. package/dist/attributes/layout/space3d.js.map +1 -1
  72. package/dist/attributes/layout/transform3d.d.ts +2 -23
  73. package/dist/attributes/layout/transform3d.d.ts.map +1 -1
  74. package/dist/attributes/layout/transform3d.js +1 -7
  75. package/dist/attributes/layout/transform3d.js.map +1 -1
  76. package/dist/attributes/layout/world-transform.d.ts +2 -16
  77. package/dist/attributes/layout/world-transform.d.ts.map +1 -1
  78. package/dist/attributes/layout/world-transform.js.map +1 -1
  79. package/dist/attributes/properties/decorator.d.ts +13 -73
  80. package/dist/attributes/properties/decorator.d.ts.map +1 -1
  81. package/dist/attributes/properties/decorator.js +9 -40
  82. package/dist/attributes/properties/decorator.js.map +1 -1
  83. package/dist/attributes/properties/typed.d.ts +6 -45
  84. package/dist/attributes/properties/typed.d.ts.map +1 -1
  85. package/dist/attributes/properties/typed.js +6 -37
  86. package/dist/attributes/properties/typed.js.map +1 -1
  87. package/dist/attributes/render3d/orbit.d.ts +11 -83
  88. package/dist/attributes/render3d/orbit.d.ts.map +1 -1
  89. package/dist/attributes/render3d/orbit.js +10 -73
  90. package/dist/attributes/render3d/orbit.js.map +1 -1
  91. package/dist/attributes/shape/corners/corner-radius.d.ts +1 -6
  92. package/dist/attributes/shape/corners/corner-radius.d.ts.map +1 -1
  93. package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
  94. package/dist/attributes/shape/corners/corner-style.d.ts +4 -25
  95. package/dist/attributes/shape/corners/corner-style.d.ts.map +1 -1
  96. package/dist/attributes/shape/corners/corner-style.js +2 -12
  97. package/dist/attributes/shape/corners/corner-style.js.map +1 -1
  98. package/dist/attributes/shape/corners/corners.d.ts +2 -21
  99. package/dist/attributes/shape/corners/corners.d.ts.map +1 -1
  100. package/dist/attributes/shape/corners/corners.js +2 -12
  101. package/dist/attributes/shape/corners/corners.js.map +1 -1
  102. package/dist/attributes/shape/effects/backdrop.d.ts +2 -18
  103. package/dist/attributes/shape/effects/backdrop.d.ts.map +1 -1
  104. package/dist/attributes/shape/effects/backdrop.js +3 -26
  105. package/dist/attributes/shape/effects/backdrop.js.map +1 -1
  106. package/dist/attributes/shape/effects/chain.d.ts +36 -328
  107. package/dist/attributes/shape/effects/chain.d.ts.map +1 -1
  108. package/dist/attributes/shape/effects/chain.js +24 -242
  109. package/dist/attributes/shape/effects/chain.js.map +1 -1
  110. package/dist/attributes/shape/effects/effect-data.d.ts +19 -127
  111. package/dist/attributes/shape/effects/effect-data.d.ts.map +1 -1
  112. package/dist/attributes/shape/effects/effect-data.js +6 -33
  113. package/dist/attributes/shape/effects/effect-data.js.map +1 -1
  114. package/dist/attributes/shape/effects/implementations/ascii.d.ts +6 -26
  115. package/dist/attributes/shape/effects/implementations/ascii.d.ts.map +1 -1
  116. package/dist/attributes/shape/effects/implementations/ascii.js +0 -3
  117. package/dist/attributes/shape/effects/implementations/ascii.js.map +1 -1
  118. package/dist/attributes/shape/effects/implementations/bit-crush.d.ts +2 -21
  119. package/dist/attributes/shape/effects/implementations/bit-crush.d.ts.map +1 -1
  120. package/dist/attributes/shape/effects/implementations/bit-crush.js +0 -1
  121. package/dist/attributes/shape/effects/implementations/bit-crush.js.map +1 -1
  122. package/dist/attributes/shape/effects/implementations/block-displace.d.ts +1 -14
  123. package/dist/attributes/shape/effects/implementations/block-displace.d.ts.map +1 -1
  124. package/dist/attributes/shape/effects/implementations/block-displace.js +0 -1
  125. package/dist/attributes/shape/effects/implementations/block-displace.js.map +1 -1
  126. package/dist/attributes/shape/effects/implementations/bloom.d.ts +0 -1
  127. package/dist/attributes/shape/effects/implementations/bloom.d.ts.map +1 -1
  128. package/dist/attributes/shape/effects/implementations/bloom.js +0 -1
  129. package/dist/attributes/shape/effects/implementations/bloom.js.map +1 -1
  130. package/dist/attributes/shape/effects/implementations/blur.d.ts +0 -1
  131. package/dist/attributes/shape/effects/implementations/blur.d.ts.map +1 -1
  132. package/dist/attributes/shape/effects/implementations/blur.js +0 -1
  133. package/dist/attributes/shape/effects/implementations/blur.js.map +1 -1
  134. package/dist/attributes/shape/effects/implementations/bulge.d.ts +0 -1
  135. package/dist/attributes/shape/effects/implementations/bulge.d.ts.map +1 -1
  136. package/dist/attributes/shape/effects/implementations/bulge.js +0 -1
  137. package/dist/attributes/shape/effects/implementations/bulge.js.map +1 -1
  138. package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts +0 -1
  139. package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts.map +1 -1
  140. package/dist/attributes/shape/effects/implementations/chromatic-aberration.js +0 -1
  141. package/dist/attributes/shape/effects/implementations/chromatic-aberration.js.map +1 -1
  142. package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts +1 -12
  143. package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts.map +1 -1
  144. package/dist/attributes/shape/effects/implementations/color-adjustment.js +0 -1
  145. package/dist/attributes/shape/effects/implementations/color-adjustment.js.map +1 -1
  146. package/dist/attributes/shape/effects/implementations/curves.d.ts +1 -11
  147. package/dist/attributes/shape/effects/implementations/curves.d.ts.map +1 -1
  148. package/dist/attributes/shape/effects/implementations/curves.js +1 -6
  149. package/dist/attributes/shape/effects/implementations/curves.js.map +1 -1
  150. package/dist/attributes/shape/effects/implementations/directional-blur.d.ts +0 -1
  151. package/dist/attributes/shape/effects/implementations/directional-blur.d.ts.map +1 -1
  152. package/dist/attributes/shape/effects/implementations/directional-blur.js +0 -1
  153. package/dist/attributes/shape/effects/implementations/directional-blur.js.map +1 -1
  154. package/dist/attributes/shape/effects/implementations/dither.d.ts +4 -35
  155. package/dist/attributes/shape/effects/implementations/dither.d.ts.map +1 -1
  156. package/dist/attributes/shape/effects/implementations/dither.js +1 -7
  157. package/dist/attributes/shape/effects/implementations/dither.js.map +1 -1
  158. package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts +1 -22
  159. package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts.map +1 -1
  160. package/dist/attributes/shape/effects/implementations/drop-shadow.js +0 -1
  161. package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
  162. package/dist/attributes/shape/effects/implementations/duotone.d.ts +1 -9
  163. package/dist/attributes/shape/effects/implementations/duotone.d.ts.map +1 -1
  164. package/dist/attributes/shape/effects/implementations/duotone.js +0 -1
  165. package/dist/attributes/shape/effects/implementations/duotone.js.map +1 -1
  166. package/dist/attributes/shape/effects/implementations/edges.d.ts +2 -15
  167. package/dist/attributes/shape/effects/implementations/edges.d.ts.map +1 -1
  168. package/dist/attributes/shape/effects/implementations/edges.js +0 -1
  169. package/dist/attributes/shape/effects/implementations/edges.js.map +1 -1
  170. package/dist/attributes/shape/effects/implementations/glass.d.ts +1 -14
  171. package/dist/attributes/shape/effects/implementations/glass.d.ts.map +1 -1
  172. package/dist/attributes/shape/effects/implementations/glass.js +0 -1
  173. package/dist/attributes/shape/effects/implementations/glass.js.map +1 -1
  174. package/dist/attributes/shape/effects/implementations/glow.d.ts +7 -47
  175. package/dist/attributes/shape/effects/implementations/glow.d.ts.map +1 -1
  176. package/dist/attributes/shape/effects/implementations/glow.js +1 -9
  177. package/dist/attributes/shape/effects/implementations/glow.js.map +1 -1
  178. package/dist/attributes/shape/effects/implementations/grain.d.ts +1 -14
  179. package/dist/attributes/shape/effects/implementations/grain.d.ts.map +1 -1
  180. package/dist/attributes/shape/effects/implementations/grain.js +0 -1
  181. package/dist/attributes/shape/effects/implementations/grain.js.map +1 -1
  182. package/dist/attributes/shape/effects/implementations/grayscale.d.ts +0 -1
  183. package/dist/attributes/shape/effects/implementations/grayscale.d.ts.map +1 -1
  184. package/dist/attributes/shape/effects/implementations/grayscale.js +0 -1
  185. package/dist/attributes/shape/effects/implementations/grayscale.js.map +1 -1
  186. package/dist/attributes/shape/effects/implementations/halftone.d.ts +5 -29
  187. package/dist/attributes/shape/effects/implementations/halftone.d.ts.map +1 -1
  188. package/dist/attributes/shape/effects/implementations/halftone.js +0 -1
  189. package/dist/attributes/shape/effects/implementations/halftone.js.map +1 -1
  190. package/dist/attributes/shape/effects/implementations/invert.d.ts +3 -12
  191. package/dist/attributes/shape/effects/implementations/invert.d.ts.map +1 -1
  192. package/dist/attributes/shape/effects/implementations/invert.js +0 -1
  193. package/dist/attributes/shape/effects/implementations/invert.js.map +1 -1
  194. package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts +2 -19
  195. package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts.map +1 -1
  196. package/dist/attributes/shape/effects/implementations/kaleidoscope.js +1 -5
  197. package/dist/attributes/shape/effects/implementations/kaleidoscope.js.map +1 -1
  198. package/dist/attributes/shape/effects/implementations/lut.d.ts +11 -36
  199. package/dist/attributes/shape/effects/implementations/lut.d.ts.map +1 -1
  200. package/dist/attributes/shape/effects/implementations/lut.js +2 -8
  201. package/dist/attributes/shape/effects/implementations/lut.js.map +1 -1
  202. package/dist/attributes/shape/effects/implementations/magnify.d.ts +0 -1
  203. package/dist/attributes/shape/effects/implementations/magnify.d.ts.map +1 -1
  204. package/dist/attributes/shape/effects/implementations/magnify.js +0 -1
  205. package/dist/attributes/shape/effects/implementations/magnify.js.map +1 -1
  206. package/dist/attributes/shape/effects/implementations/motion-blur.d.ts +3 -17
  207. package/dist/attributes/shape/effects/implementations/motion-blur.d.ts.map +1 -1
  208. package/dist/attributes/shape/effects/implementations/motion-blur.js +2 -11
  209. package/dist/attributes/shape/effects/implementations/motion-blur.js.map +1 -1
  210. package/dist/attributes/shape/effects/implementations/oil-paint.d.ts +1 -12
  211. package/dist/attributes/shape/effects/implementations/oil-paint.d.ts.map +1 -1
  212. package/dist/attributes/shape/effects/implementations/oil-paint.js +0 -1
  213. package/dist/attributes/shape/effects/implementations/oil-paint.js.map +1 -1
  214. package/dist/attributes/shape/effects/implementations/outline.d.ts +2 -14
  215. package/dist/attributes/shape/effects/implementations/outline.d.ts.map +1 -1
  216. package/dist/attributes/shape/effects/implementations/outline.js +0 -1
  217. package/dist/attributes/shape/effects/implementations/outline.js.map +1 -1
  218. package/dist/attributes/shape/effects/implementations/pixelate.d.ts +1 -15
  219. package/dist/attributes/shape/effects/implementations/pixelate.d.ts.map +1 -1
  220. package/dist/attributes/shape/effects/implementations/pixelate.js +0 -1
  221. package/dist/attributes/shape/effects/implementations/pixelate.js.map +1 -1
  222. package/dist/attributes/shape/effects/implementations/posterize.d.ts +1 -10
  223. package/dist/attributes/shape/effects/implementations/posterize.d.ts.map +1 -1
  224. package/dist/attributes/shape/effects/implementations/posterize.js +0 -1
  225. package/dist/attributes/shape/effects/implementations/posterize.js.map +1 -1
  226. package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts +3 -26
  227. package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts.map +1 -1
  228. package/dist/attributes/shape/effects/implementations/progressive-blur.js +1 -2
  229. package/dist/attributes/shape/effects/implementations/progressive-blur.js.map +1 -1
  230. package/dist/attributes/shape/effects/implementations/radial-blur.d.ts +2 -16
  231. package/dist/attributes/shape/effects/implementations/radial-blur.d.ts.map +1 -1
  232. package/dist/attributes/shape/effects/implementations/radial-blur.js +0 -1
  233. package/dist/attributes/shape/effects/implementations/radial-blur.js.map +1 -1
  234. package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts +1 -13
  235. package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts.map +1 -1
  236. package/dist/attributes/shape/effects/implementations/rgb-shift.js +0 -1
  237. package/dist/attributes/shape/effects/implementations/rgb-shift.js.map +1 -1
  238. package/dist/attributes/shape/effects/implementations/scanlines.d.ts +1 -8
  239. package/dist/attributes/shape/effects/implementations/scanlines.d.ts.map +1 -1
  240. package/dist/attributes/shape/effects/implementations/scanlines.js +0 -1
  241. package/dist/attributes/shape/effects/implementations/scanlines.js.map +1 -1
  242. package/dist/attributes/shape/effects/implementations/scatter.d.ts +0 -1
  243. package/dist/attributes/shape/effects/implementations/scatter.d.ts.map +1 -1
  244. package/dist/attributes/shape/effects/implementations/scatter.js +0 -1
  245. package/dist/attributes/shape/effects/implementations/scatter.js.map +1 -1
  246. package/dist/attributes/shape/effects/implementations/shader.d.ts +10 -53
  247. package/dist/attributes/shape/effects/implementations/shader.d.ts.map +1 -1
  248. package/dist/attributes/shape/effects/implementations/shader.js +2 -9
  249. package/dist/attributes/shape/effects/implementations/shader.js.map +1 -1
  250. package/dist/attributes/shape/effects/implementations/sharpen.d.ts +1 -12
  251. package/dist/attributes/shape/effects/implementations/sharpen.d.ts.map +1 -1
  252. package/dist/attributes/shape/effects/implementations/sharpen.js +0 -1
  253. package/dist/attributes/shape/effects/implementations/sharpen.js.map +1 -1
  254. package/dist/attributes/shape/effects/implementations/streak.d.ts +1 -8
  255. package/dist/attributes/shape/effects/implementations/streak.d.ts.map +1 -1
  256. package/dist/attributes/shape/effects/implementations/streak.js +0 -1
  257. package/dist/attributes/shape/effects/implementations/streak.js.map +1 -1
  258. package/dist/attributes/shape/effects/implementations/threshold.d.ts +1 -9
  259. package/dist/attributes/shape/effects/implementations/threshold.d.ts.map +1 -1
  260. package/dist/attributes/shape/effects/implementations/threshold.js +0 -1
  261. package/dist/attributes/shape/effects/implementations/threshold.js.map +1 -1
  262. package/dist/attributes/shape/effects/implementations/twirl.d.ts +1 -13
  263. package/dist/attributes/shape/effects/implementations/twirl.d.ts.map +1 -1
  264. package/dist/attributes/shape/effects/implementations/twirl.js +0 -1
  265. package/dist/attributes/shape/effects/implementations/twirl.js.map +1 -1
  266. package/dist/attributes/shape/effects/implementations/vignette.d.ts +1 -9
  267. package/dist/attributes/shape/effects/implementations/vignette.d.ts.map +1 -1
  268. package/dist/attributes/shape/effects/implementations/vignette.js +0 -1
  269. package/dist/attributes/shape/effects/implementations/vignette.js.map +1 -1
  270. package/dist/attributes/shape/effects/implementations/vintage.d.ts +0 -1
  271. package/dist/attributes/shape/effects/implementations/vintage.d.ts.map +1 -1
  272. package/dist/attributes/shape/effects/implementations/vintage.js +0 -1
  273. package/dist/attributes/shape/effects/implementations/vintage.js.map +1 -1
  274. package/dist/attributes/shape/effects/implementations/wave.d.ts +3 -24
  275. package/dist/attributes/shape/effects/implementations/wave.d.ts.map +1 -1
  276. package/dist/attributes/shape/effects/implementations/wave.js +1 -5
  277. package/dist/attributes/shape/effects/implementations/wave.js.map +1 -1
  278. package/dist/attributes/shape/effects/registry.d.ts +6 -41
  279. package/dist/attributes/shape/effects/registry.d.ts.map +1 -1
  280. package/dist/attributes/shape/effects/registry.js +7 -45
  281. package/dist/attributes/shape/effects/registry.js.map +1 -1
  282. package/dist/attributes/shape/effects/spec.d.ts +6 -30
  283. package/dist/attributes/shape/effects/spec.d.ts.map +1 -1
  284. package/dist/attributes/shape/effects/spec.js +3 -9
  285. package/dist/attributes/shape/effects/spec.js.map +1 -1
  286. package/dist/attributes/shape/fill/blend.d.ts +1 -17
  287. package/dist/attributes/shape/fill/blend.d.ts.map +1 -1
  288. package/dist/attributes/shape/fill/blend.js +2 -15
  289. package/dist/attributes/shape/fill/blend.js.map +1 -1
  290. package/dist/attributes/shape/fill/chain.d.ts +17 -125
  291. package/dist/attributes/shape/fill/chain.d.ts.map +1 -1
  292. package/dist/attributes/shape/fill/chain.js +22 -109
  293. package/dist/attributes/shape/fill/chain.js.map +1 -1
  294. package/dist/attributes/shape/fill/coerce.d.ts +10 -35
  295. package/dist/attributes/shape/fill/coerce.d.ts.map +1 -1
  296. package/dist/attributes/shape/fill/coerce.js +12 -47
  297. package/dist/attributes/shape/fill/coerce.js.map +1 -1
  298. package/dist/attributes/shape/fill/color/parser.d.ts +10 -44
  299. package/dist/attributes/shape/fill/color/parser.d.ts.map +1 -1
  300. package/dist/attributes/shape/fill/color/parser.js +35 -96
  301. package/dist/attributes/shape/fill/color/parser.js.map +1 -1
  302. package/dist/attributes/shape/fill/gradient-stops.d.ts +1 -8
  303. package/dist/attributes/shape/fill/gradient-stops.d.ts.map +1 -1
  304. package/dist/attributes/shape/fill/gradient-stops.js +2 -13
  305. package/dist/attributes/shape/fill/gradient-stops.js.map +1 -1
  306. package/dist/attributes/shape/fill/implementations/canvas3d.d.ts +2 -24
  307. package/dist/attributes/shape/fill/implementations/canvas3d.d.ts.map +1 -1
  308. package/dist/attributes/shape/fill/implementations/canvas3d.js +2 -9
  309. package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
  310. package/dist/attributes/shape/fill/implementations/dot-grid.d.ts +1 -14
  311. package/dist/attributes/shape/fill/implementations/dot-grid.d.ts.map +1 -1
  312. package/dist/attributes/shape/fill/implementations/dot-grid.js.map +1 -1
  313. package/dist/attributes/shape/fill/implementations/fractal-noise.d.ts +5 -28
  314. package/dist/attributes/shape/fill/implementations/fractal-noise.d.ts.map +1 -1
  315. package/dist/attributes/shape/fill/implementations/fractal-noise.js +0 -1
  316. package/dist/attributes/shape/fill/implementations/fractal-noise.js.map +1 -1
  317. package/dist/attributes/shape/fill/implementations/grid.d.ts +8 -21
  318. package/dist/attributes/shape/fill/implementations/grid.d.ts.map +1 -1
  319. package/dist/attributes/shape/fill/implementations/grid.js +2 -8
  320. package/dist/attributes/shape/fill/implementations/grid.js.map +1 -1
  321. package/dist/attributes/shape/fill/implementations/image.d.ts +13 -79
  322. package/dist/attributes/shape/fill/implementations/image.d.ts.map +1 -1
  323. package/dist/attributes/shape/fill/implementations/image.js +6 -23
  324. package/dist/attributes/shape/fill/implementations/image.js.map +1 -1
  325. package/dist/attributes/shape/fill/implementations/noise.d.ts +2 -15
  326. package/dist/attributes/shape/fill/implementations/noise.d.ts.map +1 -1
  327. package/dist/attributes/shape/fill/implementations/noise.js.map +1 -1
  328. package/dist/attributes/shape/fill/implementations/shader.d.ts +11 -45
  329. package/dist/attributes/shape/fill/implementations/shader.d.ts.map +1 -1
  330. package/dist/attributes/shape/fill/implementations/shader.js +5 -17
  331. package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
  332. package/dist/attributes/shape/fill/implementations/video.d.ts +12 -64
  333. package/dist/attributes/shape/fill/implementations/video.d.ts.map +1 -1
  334. package/dist/attributes/shape/fill/implementations/video.js +12 -50
  335. package/dist/attributes/shape/fill/implementations/video.js.map +1 -1
  336. package/dist/attributes/shape/fill/lerp.d.ts +2 -13
  337. package/dist/attributes/shape/fill/lerp.d.ts.map +1 -1
  338. package/dist/attributes/shape/fill/lerp.js +2 -9
  339. package/dist/attributes/shape/fill/lerp.js.map +1 -1
  340. package/dist/attributes/shape/fill/media-preset.d.ts +8 -49
  341. package/dist/attributes/shape/fill/media-preset.d.ts.map +1 -1
  342. package/dist/attributes/shape/fill/media-preset.js +8 -35
  343. package/dist/attributes/shape/fill/media-preset.js.map +1 -1
  344. package/dist/attributes/shape/fill/registry.d.ts +2 -26
  345. package/dist/attributes/shape/fill/registry.d.ts.map +1 -1
  346. package/dist/attributes/shape/fill/registry.js +5 -40
  347. package/dist/attributes/shape/fill/registry.js.map +1 -1
  348. package/dist/attributes/shape/fill/union.d.ts +6 -30
  349. package/dist/attributes/shape/fill/union.d.ts.map +1 -1
  350. package/dist/attributes/shape/fill/union.js +1 -9
  351. package/dist/attributes/shape/fill/union.js.map +1 -1
  352. package/dist/attributes/shape/filters/chain.d.ts +15 -168
  353. package/dist/attributes/shape/filters/chain.d.ts.map +1 -1
  354. package/dist/attributes/shape/filters/chain.js +8 -132
  355. package/dist/attributes/shape/filters/chain.js.map +1 -1
  356. package/dist/attributes/shape/filters/implementations/color-matrix.d.ts +1 -7
  357. package/dist/attributes/shape/filters/implementations/color-matrix.d.ts.map +1 -1
  358. package/dist/attributes/shape/filters/implementations/color-matrix.js.map +1 -1
  359. package/dist/attributes/shape/filters/implementations/curves.d.ts +1 -7
  360. package/dist/attributes/shape/filters/implementations/curves.d.ts.map +1 -1
  361. package/dist/attributes/shape/filters/implementations/curves.js.map +1 -1
  362. package/dist/attributes/shape/filters/implementations/echo.d.ts +1 -11
  363. package/dist/attributes/shape/filters/implementations/echo.d.ts.map +1 -1
  364. package/dist/attributes/shape/filters/implementations/echo.js.map +1 -1
  365. package/dist/attributes/shape/filters/index.d.ts +1 -6
  366. package/dist/attributes/shape/filters/index.d.ts.map +1 -1
  367. package/dist/attributes/shape/filters/index.js +0 -2
  368. package/dist/attributes/shape/filters/index.js.map +1 -1
  369. package/dist/attributes/shape/filters/registry.d.ts +5 -35
  370. package/dist/attributes/shape/filters/registry.d.ts.map +1 -1
  371. package/dist/attributes/shape/filters/registry.js +7 -50
  372. package/dist/attributes/shape/filters/registry.js.map +1 -1
  373. package/dist/attributes/shape/filters/union.d.ts +10 -51
  374. package/dist/attributes/shape/filters/union.d.ts.map +1 -1
  375. package/dist/attributes/shape/filters/union.js.map +1 -1
  376. package/dist/attributes/shape/path/anchors.d.ts +18 -106
  377. package/dist/attributes/shape/path/anchors.d.ts.map +1 -1
  378. package/dist/attributes/shape/path/anchors.js +15 -124
  379. package/dist/attributes/shape/path/anchors.js.map +1 -1
  380. package/dist/attributes/shape/path/bezier.d.ts +6 -54
  381. package/dist/attributes/shape/path/bezier.d.ts.map +1 -1
  382. package/dist/attributes/shape/path/bezier.js +10 -98
  383. package/dist/attributes/shape/path/bezier.js.map +1 -1
  384. package/dist/attributes/shape/path/index.d.ts +1 -11
  385. package/dist/attributes/shape/path/index.d.ts.map +1 -1
  386. package/dist/attributes/shape/path/index.js +1 -11
  387. package/dist/attributes/shape/path/index.js.map +1 -1
  388. package/dist/attributes/shape/path/measure.d.ts +5 -41
  389. package/dist/attributes/shape/path/measure.d.ts.map +1 -1
  390. package/dist/attributes/shape/path/measure.js +8 -57
  391. package/dist/attributes/shape/path/measure.js.map +1 -1
  392. package/dist/attributes/shape/path/morph.d.ts +4 -41
  393. package/dist/attributes/shape/path/morph.d.ts.map +1 -1
  394. package/dist/attributes/shape/path/morph.js +17 -117
  395. package/dist/attributes/shape/path/morph.js.map +1 -1
  396. package/dist/attributes/shape/path/ops.d.ts +5 -19
  397. package/dist/attributes/shape/path/ops.d.ts.map +1 -1
  398. package/dist/attributes/shape/path/ops.js.map +1 -1
  399. package/dist/attributes/shape/path/types.d.ts +10 -67
  400. package/dist/attributes/shape/path/types.d.ts.map +1 -1
  401. package/dist/attributes/shape/path/types.js +0 -1
  402. package/dist/attributes/shape/path/types.js.map +1 -1
  403. package/dist/attributes/shape/path/walk.d.ts +9 -63
  404. package/dist/attributes/shape/path/walk.d.ts.map +1 -1
  405. package/dist/attributes/shape/path/walk.js +21 -100
  406. package/dist/attributes/shape/path/walk.js.map +1 -1
  407. package/dist/attributes/shape/shaders/language.d.ts +2 -14
  408. package/dist/attributes/shape/shaders/language.d.ts.map +1 -1
  409. package/dist/attributes/shape/shaders/language.js +1 -8
  410. package/dist/attributes/shape/shaders/language.js.map +1 -1
  411. package/dist/attributes/shape/shaders/pack.d.ts +13 -78
  412. package/dist/attributes/shape/shaders/pack.d.ts.map +1 -1
  413. package/dist/attributes/shape/shaders/pack.js +1 -10
  414. package/dist/attributes/shape/shaders/pack.js.map +1 -1
  415. package/dist/attributes/shape/shaders/resolve.d.ts +1 -11
  416. package/dist/attributes/shape/shaders/resolve.d.ts.map +1 -1
  417. package/dist/attributes/shape/shaders/resolve.js +3 -28
  418. package/dist/attributes/shape/shaders/resolve.js.map +1 -1
  419. package/dist/attributes/shape/shaders/uniforms.d.ts +3 -24
  420. package/dist/attributes/shape/shaders/uniforms.d.ts.map +1 -1
  421. package/dist/attributes/shape/shaders/uniforms.js +0 -0
  422. package/dist/attributes/shape/shaders/uniforms.js.map +1 -1
  423. package/dist/attributes/shape/shadow/shadow.d.ts +3 -20
  424. package/dist/attributes/shape/shadow/shadow.d.ts.map +1 -1
  425. package/dist/attributes/shape/shadow/shadow.js +0 -3
  426. package/dist/attributes/shape/shadow/shadow.js.map +1 -1
  427. package/dist/attributes/shape/stroke/stroke.d.ts +9 -58
  428. package/dist/attributes/shape/stroke/stroke.d.ts.map +1 -1
  429. package/dist/attributes/shape/stroke/stroke.js +0 -6
  430. package/dist/attributes/shape/stroke/stroke.js.map +1 -1
  431. package/dist/attributes/shared/operators.d.ts +1 -8
  432. package/dist/attributes/shared/operators.d.ts.map +1 -1
  433. package/dist/attributes/shared/operators.js.map +1 -1
  434. package/dist/attributes/text/index.d.ts +1 -11
  435. package/dist/attributes/text/index.d.ts.map +1 -1
  436. package/dist/attributes/text/index.js +1 -11
  437. package/dist/attributes/text/index.js.map +1 -1
  438. package/dist/attributes/text/ops.d.ts +4 -30
  439. package/dist/attributes/text/ops.d.ts.map +1 -1
  440. package/dist/attributes/text/ops.js +7 -23
  441. package/dist/attributes/text/ops.js.map +1 -1
  442. package/dist/attributes/text/types.d.ts +5 -28
  443. package/dist/attributes/text/types.d.ts.map +1 -1
  444. package/dist/attributes/text/types.js.map +1 -1
  445. package/dist/browser/chunks/chunk-3ZIUZZC7.js +13 -0
  446. package/dist/browser/chunks/chunk-3ZIUZZC7.js.map +7 -0
  447. package/dist/browser/chunks/chunk-5TDMGUXQ.js +3 -0
  448. package/dist/browser/chunks/chunk-5TDMGUXQ.js.map +7 -0
  449. package/dist/browser/chunks/chunk-7YOYMMXK.js +6 -0
  450. package/dist/browser/chunks/chunk-7YOYMMXK.js.map +7 -0
  451. package/dist/browser/chunks/{chunk-4BDLFEOC.js → chunk-GEJEQQER.js} +1 -1
  452. package/dist/browser/chunks/chunk-GEJEQQER.js.map +7 -0
  453. package/dist/browser/component.js +1 -1
  454. package/dist/browser/experimental.js +1 -1
  455. package/dist/browser/index.js +1 -1
  456. package/dist/browser/index.js.map +4 -4
  457. package/dist/browser/manifest.json +1 -1
  458. package/dist/browser/sdk.js +1 -1
  459. package/dist/component.d.ts +3 -10
  460. package/dist/component.d.ts.map +1 -1
  461. package/dist/component.js +3 -10
  462. package/dist/component.js.map +1 -1
  463. package/dist/components/builtins/geometry/geometry.d.ts +15 -62
  464. package/dist/components/builtins/geometry/geometry.d.ts.map +1 -1
  465. package/dist/components/builtins/geometry/geometry.js.map +1 -1
  466. package/dist/components/builtins/geometry/shape-outline.d.ts +12 -61
  467. package/dist/components/builtins/geometry/shape-outline.d.ts.map +1 -1
  468. package/dist/components/builtins/geometry/shape-outline.js +29 -168
  469. package/dist/components/builtins/geometry/shape-outline.js.map +1 -1
  470. package/dist/components/builtins/layout/layout.d.ts +1 -14
  471. package/dist/components/builtins/layout/layout.d.ts.map +1 -1
  472. package/dist/components/builtins/layout/layout.js.map +1 -1
  473. package/dist/components/builtins/media/media.d.ts +11 -51
  474. package/dist/components/builtins/media/media.d.ts.map +1 -1
  475. package/dist/components/builtins/media/media.js +3 -7
  476. package/dist/components/builtins/media/media.js.map +1 -1
  477. package/dist/components/builtins/text/number-format.d.ts +14 -47
  478. package/dist/components/builtins/text/number-format.d.ts.map +1 -1
  479. package/dist/components/builtins/text/number-format.js +19 -69
  480. package/dist/components/builtins/text/number-format.js.map +1 -1
  481. package/dist/components/builtins/text/number-pattern.d.ts +3 -37
  482. package/dist/components/builtins/text/number-pattern.d.ts.map +1 -1
  483. package/dist/components/builtins/text/number-pattern.js +6 -48
  484. package/dist/components/builtins/text/number-pattern.js.map +1 -1
  485. package/dist/components/builtins/text/text-defaults.d.ts +7 -25
  486. package/dist/components/builtins/text/text-defaults.d.ts.map +1 -1
  487. package/dist/components/builtins/text/text-defaults.js +7 -25
  488. package/dist/components/builtins/text/text-defaults.js.map +1 -1
  489. package/dist/components/builtins/text/text-layout.d.ts +2 -11
  490. package/dist/components/builtins/text/text-layout.d.ts.map +1 -1
  491. package/dist/components/builtins/text/text-layout.js +7 -22
  492. package/dist/components/builtins/text/text-layout.js.map +1 -1
  493. package/dist/components/builtins/text/text.d.ts +8 -46
  494. package/dist/components/builtins/text/text.d.ts.map +1 -1
  495. package/dist/components/builtins/text/text.js.map +1 -1
  496. package/dist/components/builtins/three/canvas3d.d.ts +6 -51
  497. package/dist/components/builtins/three/canvas3d.d.ts.map +1 -1
  498. package/dist/components/builtins/three/canvas3d.js.map +1 -1
  499. package/dist/components/builtins/three/grid-geometry3d.d.ts +3 -39
  500. package/dist/components/builtins/three/grid-geometry3d.d.ts.map +1 -1
  501. package/dist/components/builtins/three/grid-geometry3d.js +8 -46
  502. package/dist/components/builtins/three/grid-geometry3d.js.map +1 -1
  503. package/dist/components/builtins/three/three.d.ts +22 -117
  504. package/dist/components/builtins/three/three.d.ts.map +1 -1
  505. package/dist/components/builtins/three/three.js +5 -17
  506. package/dist/components/builtins/three/three.js.map +1 -1
  507. package/dist/components/factory/api.d.ts.map +1 -1
  508. package/dist/components/factory/api.js.map +1 -1
  509. package/dist/components/factory/views.d.ts.map +1 -1
  510. package/dist/components/factory/views.js +41 -3
  511. package/dist/components/factory/views.js.map +1 -1
  512. package/dist/components/trees/2d/group-bounds.d.ts +12 -41
  513. package/dist/components/trees/2d/group-bounds.d.ts.map +1 -1
  514. package/dist/components/trees/2d/group-bounds.js +3 -22
  515. package/dist/components/trees/2d/group-bounds.js.map +1 -1
  516. package/dist/components/trees/2d/node-lifecycle.d.ts +8 -36
  517. package/dist/components/trees/2d/node-lifecycle.d.ts.map +1 -1
  518. package/dist/components/trees/2d/node-lifecycle.js +35 -127
  519. package/dist/components/trees/2d/node-lifecycle.js.map +1 -1
  520. package/dist/components/trees/2d/node-motion.d.ts +4 -36
  521. package/dist/components/trees/2d/node-motion.d.ts.map +1 -1
  522. package/dist/components/trees/2d/node-motion.js +3 -31
  523. package/dist/components/trees/2d/node-motion.js.map +1 -1
  524. package/dist/components/trees/2d/node-render.d.ts +3 -20
  525. package/dist/components/trees/2d/node-render.d.ts.map +1 -1
  526. package/dist/components/trees/2d/node-render.js +4 -23
  527. package/dist/components/trees/2d/node-render.js.map +1 -1
  528. package/dist/components/trees/2d/node-space.d.ts +4 -23
  529. package/dist/components/trees/2d/node-space.d.ts.map +1 -1
  530. package/dist/components/trees/2d/node-space.js +3 -17
  531. package/dist/components/trees/2d/node-space.js.map +1 -1
  532. package/dist/components/trees/2d/node-transform.d.ts +4 -33
  533. package/dist/components/trees/2d/node-transform.d.ts.map +1 -1
  534. package/dist/components/trees/2d/node-transform.js +4 -33
  535. package/dist/components/trees/2d/node-transform.js.map +1 -1
  536. package/dist/components/trees/2d/node2d.d.ts +112 -622
  537. package/dist/components/trees/2d/node2d.d.ts.map +1 -1
  538. package/dist/components/trees/2d/node2d.js +131 -605
  539. package/dist/components/trees/2d/node2d.js.map +1 -1
  540. package/dist/components/trees/audio/node-audio.d.ts +17 -65
  541. package/dist/components/trees/audio/node-audio.d.ts.map +1 -1
  542. package/dist/components/trees/audio/node-audio.js +18 -68
  543. package/dist/components/trees/audio/node-audio.js.map +1 -1
  544. package/dist/components/trees/node/node-editor-state.d.ts +5 -45
  545. package/dist/components/trees/node/node-editor-state.d.ts.map +1 -1
  546. package/dist/components/trees/node/node-editor-state.js +1 -13
  547. package/dist/components/trees/node/node-editor-state.js.map +1 -1
  548. package/dist/components/trees/node/node-reactive.d.ts +6 -54
  549. package/dist/components/trees/node/node-reactive.d.ts.map +1 -1
  550. package/dist/components/trees/node/node-reactive.js +13 -39
  551. package/dist/components/trees/node/node-reactive.js.map +1 -1
  552. package/dist/components/trees/node/node-time.d.ts +2 -15
  553. package/dist/components/trees/node/node-time.d.ts.map +1 -1
  554. package/dist/components/trees/node/node-time.js.map +1 -1
  555. package/dist/components/trees/node/node-walk.d.ts +7 -32
  556. package/dist/components/trees/node/node-walk.d.ts.map +1 -1
  557. package/dist/components/trees/node/node-walk.js +7 -32
  558. package/dist/components/trees/node/node-walk.js.map +1 -1
  559. package/dist/components/trees/node/node.d.ts +43 -248
  560. package/dist/components/trees/node/node.d.ts.map +1 -1
  561. package/dist/components/trees/node/node.js +51 -229
  562. package/dist/components/trees/node/node.js.map +1 -1
  563. package/dist/components/trees/root/canvas2d-node.d.ts +7 -60
  564. package/dist/components/trees/root/canvas2d-node.d.ts.map +1 -1
  565. package/dist/components/trees/root/canvas2d-node.js +7 -47
  566. package/dist/components/trees/root/canvas2d-node.js.map +1 -1
  567. package/dist/components/trees/three/node3d.d.ts +24 -112
  568. package/dist/components/trees/three/node3d.d.ts.map +1 -1
  569. package/dist/components/trees/three/node3d.js +22 -104
  570. package/dist/components/trees/three/node3d.js.map +1 -1
  571. package/dist/document/audio.d.ts +9 -21
  572. package/dist/document/audio.d.ts.map +1 -1
  573. package/dist/document/audio.js +13 -28
  574. package/dist/document/audio.js.map +1 -1
  575. package/dist/document/builtins.d.ts +3 -9
  576. package/dist/document/builtins.d.ts.map +1 -1
  577. package/dist/document/builtins.js +43 -89
  578. package/dist/document/builtins.js.map +1 -1
  579. package/dist/document/command-traits.d.ts +15 -30
  580. package/dist/document/command-traits.d.ts.map +1 -1
  581. package/dist/document/command-traits.js +31 -31
  582. package/dist/document/command-traits.js.map +1 -1
  583. package/dist/document/deny-globals.d.ts +9 -43
  584. package/dist/document/deny-globals.d.ts.map +1 -1
  585. package/dist/document/deny-globals.js +18 -58
  586. package/dist/document/deny-globals.js.map +1 -1
  587. package/dist/document/diff.d.ts +6 -16
  588. package/dist/document/diff.d.ts.map +1 -1
  589. package/dist/document/diff.js +5 -11
  590. package/dist/document/diff.js.map +1 -1
  591. package/dist/document/doc-index.d.ts +5 -13
  592. package/dist/document/doc-index.d.ts.map +1 -1
  593. package/dist/document/doc-index.js +0 -2
  594. package/dist/document/doc-index.js.map +1 -1
  595. package/dist/document/expression/compile.d.ts +2 -2
  596. package/dist/document/expression/compile.d.ts.map +1 -1
  597. package/dist/document/expression/compile.js +8 -18
  598. package/dist/document/expression/compile.js.map +1 -1
  599. package/dist/document/expression/index.d.ts +11 -41
  600. package/dist/document/expression/index.d.ts.map +1 -1
  601. package/dist/document/expression/index.js +11 -41
  602. package/dist/document/expression/index.js.map +1 -1
  603. package/dist/document/expression/ops.d.ts +3 -12
  604. package/dist/document/expression/ops.d.ts.map +1 -1
  605. package/dist/document/expression/ops.js +4 -20
  606. package/dist/document/expression/ops.js.map +1 -1
  607. package/dist/document/expression/parse.d.ts +4 -14
  608. package/dist/document/expression/parse.d.ts.map +1 -1
  609. package/dist/document/expression/parse.js +34 -55
  610. package/dist/document/expression/parse.js.map +1 -1
  611. package/dist/document/expression/refs.d.ts +2 -8
  612. package/dist/document/expression/refs.d.ts.map +1 -1
  613. package/dist/document/expression/refs.js +2 -6
  614. package/dist/document/expression/refs.js.map +1 -1
  615. package/dist/document/expression/types.d.ts +18 -63
  616. package/dist/document/expression/types.d.ts.map +1 -1
  617. package/dist/document/expression/types.js +4 -15
  618. package/dist/document/expression/types.js.map +1 -1
  619. package/dist/document/expression/walk.d.ts +6 -20
  620. package/dist/document/expression/walk.d.ts.map +1 -1
  621. package/dist/document/expression/walk.js +18 -44
  622. package/dist/document/expression/walk.js.map +1 -1
  623. package/dist/document/index.js +2 -3
  624. package/dist/document/index.js.map +1 -1
  625. package/dist/document/migrate.d.ts +7 -22
  626. package/dist/document/migrate.d.ts.map +1 -1
  627. package/dist/document/migrate.js +44 -15
  628. package/dist/document/migrate.js.map +1 -1
  629. package/dist/document/missing-node.d.ts +4 -11
  630. package/dist/document/missing-node.d.ts.map +1 -1
  631. package/dist/document/missing-node.js +2 -5
  632. package/dist/document/missing-node.js.map +1 -1
  633. package/dist/document/node-decorator.d.ts +12 -53
  634. package/dist/document/node-decorator.d.ts.map +1 -1
  635. package/dist/document/node-decorator.js +16 -57
  636. package/dist/document/node-decorator.js.map +1 -1
  637. package/dist/document/node-descriptor.d.ts +25 -62
  638. package/dist/document/node-descriptor.d.ts.map +1 -1
  639. package/dist/document/node-descriptor.js.map +1 -1
  640. package/dist/document/placement.d.ts +18 -41
  641. package/dist/document/placement.d.ts.map +1 -1
  642. package/dist/document/placement.js +4 -11
  643. package/dist/document/placement.js.map +1 -1
  644. package/dist/document/project.d.ts +19 -52
  645. package/dist/document/project.d.ts.map +1 -1
  646. package/dist/document/project.js +2 -6
  647. package/dist/document/project.js.map +1 -1
  648. package/dist/document/prop-evolution.d.ts +10 -20
  649. package/dist/document/prop-evolution.d.ts.map +1 -1
  650. package/dist/document/prop-evolution.js +3 -7
  651. package/dist/document/prop-evolution.js.map +1 -1
  652. package/dist/document/registry.d.ts +80 -318
  653. package/dist/document/registry.d.ts.map +1 -1
  654. package/dist/document/registry.js +43 -147
  655. package/dist/document/registry.js.map +1 -1
  656. package/dist/document/settled-index.d.ts +12 -18
  657. package/dist/document/settled-index.d.ts.map +1 -1
  658. package/dist/document/settled-index.js +29 -31
  659. package/dist/document/settled-index.js.map +1 -1
  660. package/dist/document/timeline-patch.d.ts +6 -15
  661. package/dist/document/timeline-patch.d.ts.map +1 -1
  662. package/dist/document/timeline-patch.js +12 -21
  663. package/dist/document/timeline-patch.js.map +1 -1
  664. package/dist/document/timeline.d.ts +56 -263
  665. package/dist/document/timeline.d.ts.map +1 -1
  666. package/dist/document/timeline.js +97 -281
  667. package/dist/document/timeline.js.map +1 -1
  668. package/dist/document/types.d.ts +90 -264
  669. package/dist/document/types.d.ts.map +1 -1
  670. package/dist/document/types.js +13 -30
  671. package/dist/document/types.js.map +1 -1
  672. package/dist/document/validate.d.ts +10 -40
  673. package/dist/document/validate.d.ts.map +1 -1
  674. package/dist/document/validate.js +72 -137
  675. package/dist/document/validate.js.map +1 -1
  676. package/dist/document/vocabulary.d.ts +4 -7
  677. package/dist/document/vocabulary.d.ts.map +1 -1
  678. package/dist/document/vocabulary.js +0 -1
  679. package/dist/document/vocabulary.js.map +1 -1
  680. package/dist/index.d.ts +0 -1
  681. package/dist/index.d.ts.map +1 -1
  682. package/dist/index.js +0 -1
  683. package/dist/index.js.map +1 -1
  684. package/dist/layout/bounds.d.ts +1 -11
  685. package/dist/layout/bounds.d.ts.map +1 -1
  686. package/dist/layout/bounds.js.map +1 -1
  687. package/dist/layout/flex.d.ts +6 -20
  688. package/dist/layout/flex.d.ts.map +1 -1
  689. package/dist/layout/flex.js +7 -28
  690. package/dist/layout/flex.js.map +1 -1
  691. package/dist/layout/ops.d.ts +2 -11
  692. package/dist/layout/ops.d.ts.map +1 -1
  693. package/dist/layout/ops.js +2 -22
  694. package/dist/layout/ops.js.map +1 -1
  695. package/dist/layout/types.d.ts +11 -55
  696. package/dist/layout/types.d.ts.map +1 -1
  697. package/dist/layout/types.js.map +1 -1
  698. package/dist/platform/audio-sink.d.ts +7 -43
  699. package/dist/platform/audio-sink.d.ts.map +1 -1
  700. package/dist/platform/audio-sink.js +4 -29
  701. package/dist/platform/audio-sink.js.map +1 -1
  702. package/dist/platform/exporter.d.ts +5 -31
  703. package/dist/platform/exporter.d.ts.map +1 -1
  704. package/dist/platform/exporter.js.map +1 -1
  705. package/dist/platform/stepped-clock.d.ts +1 -16
  706. package/dist/platform/stepped-clock.d.ts.map +1 -1
  707. package/dist/platform/stepped-clock.js +1 -16
  708. package/dist/platform/stepped-clock.js.map +1 -1
  709. package/dist/platform/storage-adapter.d.ts +8 -68
  710. package/dist/platform/storage-adapter.d.ts.map +1 -1
  711. package/dist/platform/storage-adapter.js +8 -60
  712. package/dist/platform/storage-adapter.js.map +1 -1
  713. package/dist/platform/ticker.d.ts +11 -45
  714. package/dist/platform/ticker.d.ts.map +1 -1
  715. package/dist/platform/ticker.js +10 -37
  716. package/dist/platform/ticker.js.map +1 -1
  717. package/dist/project/config.d.ts +4 -14
  718. package/dist/project/config.d.ts.map +1 -1
  719. package/dist/project/config.js.map +1 -1
  720. package/dist/project/tree.d.ts +6 -35
  721. package/dist/project/tree.d.ts.map +1 -1
  722. package/dist/project/tree.js +1 -8
  723. package/dist/project/tree.js.map +1 -1
  724. package/dist/props/host.d.ts +7 -13
  725. package/dist/props/host.d.ts.map +1 -1
  726. package/dist/props/host.js +3 -1
  727. package/dist/props/host.js.map +1 -1
  728. package/dist/props/layout.d.ts +18 -0
  729. package/dist/props/layout.d.ts.map +1 -0
  730. package/dist/props/layout.js +73 -0
  731. package/dist/props/layout.js.map +1 -0
  732. package/dist/props/observer.d.ts +1 -7
  733. package/dist/props/observer.d.ts.map +1 -1
  734. package/dist/props/observer.js.map +1 -1
  735. package/dist/props/slot.d.ts +6 -19
  736. package/dist/props/slot.d.ts.map +1 -1
  737. package/dist/props/slot.js +5 -14
  738. package/dist/props/slot.js.map +1 -1
  739. package/dist/render/canvas-render-context2d.d.ts +8 -68
  740. package/dist/render/canvas-render-context2d.d.ts.map +1 -1
  741. package/dist/render/canvas-render-context2d.js +8 -69
  742. package/dist/render/canvas-render-context2d.js.map +1 -1
  743. package/dist/render/clip-contains.d.ts +2 -16
  744. package/dist/render/clip-contains.d.ts.map +1 -1
  745. package/dist/render/clip-contains.js +21 -82
  746. package/dist/render/clip-contains.js.map +1 -1
  747. package/dist/render/clip.d.ts +7 -25
  748. package/dist/render/clip.d.ts.map +1 -1
  749. package/dist/render/clip.js +5 -17
  750. package/dist/render/clip.js.map +1 -1
  751. package/dist/render/descriptors/ellipse.d.ts.map +1 -1
  752. package/dist/render/descriptors/ellipse.js +0 -1
  753. package/dist/render/descriptors/ellipse.js.map +1 -1
  754. package/dist/render/descriptors/line.d.ts.map +1 -1
  755. package/dist/render/descriptors/line.js +0 -1
  756. package/dist/render/descriptors/line.js.map +1 -1
  757. package/dist/render/descriptors/path-builder.d.ts +4 -32
  758. package/dist/render/descriptors/path-builder.d.ts.map +1 -1
  759. package/dist/render/descriptors/path-builder.js +3 -25
  760. package/dist/render/descriptors/path-builder.js.map +1 -1
  761. package/dist/render/descriptors/path.d.ts +1 -11
  762. package/dist/render/descriptors/path.d.ts.map +1 -1
  763. package/dist/render/descriptors/path.js +0 -1
  764. package/dist/render/descriptors/path.js.map +1 -1
  765. package/dist/render/descriptors/polygon.d.ts.map +1 -1
  766. package/dist/render/descriptors/polygon.js +0 -1
  767. package/dist/render/descriptors/polygon.js.map +1 -1
  768. package/dist/render/descriptors/polygram.d.ts.map +1 -1
  769. package/dist/render/descriptors/polygram.js +0 -1
  770. package/dist/render/descriptors/polygram.js.map +1 -1
  771. package/dist/render/descriptors/rect.d.ts.map +1 -1
  772. package/dist/render/descriptors/rect.js +0 -1
  773. package/dist/render/descriptors/rect.js.map +1 -1
  774. package/dist/render/descriptors/richtext.d.ts.map +1 -1
  775. package/dist/render/descriptors/richtext.js +0 -1
  776. package/dist/render/descriptors/richtext.js.map +1 -1
  777. package/dist/render/descriptors/shape.d.ts +17 -77
  778. package/dist/render/descriptors/shape.d.ts.map +1 -1
  779. package/dist/render/descriptors/shape.js +13 -47
  780. package/dist/render/descriptors/shape.js.map +1 -1
  781. package/dist/render/descriptors/text.d.ts +15 -94
  782. package/dist/render/descriptors/text.d.ts.map +1 -1
  783. package/dist/render/descriptors/text.js +8 -50
  784. package/dist/render/descriptors/text.js.map +1 -1
  785. package/dist/render/descriptors/transform.d.ts +5 -16
  786. package/dist/render/descriptors/transform.d.ts.map +1 -1
  787. package/dist/render/descriptors/transform.js +1 -17
  788. package/dist/render/descriptors/transform.js.map +1 -1
  789. package/dist/render/graphics2d.d.ts +24 -116
  790. package/dist/render/graphics2d.d.ts.map +1 -1
  791. package/dist/render/graphics2d.js +23 -108
  792. package/dist/render/graphics2d.js.map +1 -1
  793. package/dist/render/measure-context.d.ts +5 -29
  794. package/dist/render/measure-context.d.ts.map +1 -1
  795. package/dist/render/measure-context.js.map +1 -1
  796. package/dist/render/null-render-context.d.ts +2 -20
  797. package/dist/render/null-render-context.d.ts.map +1 -1
  798. package/dist/render/null-render-context.js +2 -20
  799. package/dist/render/null-render-context.js.map +1 -1
  800. package/dist/render/render-context2d.d.ts +52 -208
  801. package/dist/render/render-context2d.d.ts.map +1 -1
  802. package/dist/render/render-context2d.js.map +1 -1
  803. package/dist/render/surface.d.ts +2 -19
  804. package/dist/render/surface.d.ts.map +1 -1
  805. package/dist/render/surface.js.map +1 -1
  806. package/dist/render/text-defaults.d.ts +1 -17
  807. package/dist/render/text-defaults.d.ts.map +1 -1
  808. package/dist/render/text-defaults.js +6 -40
  809. package/dist/render/text-defaults.js.map +1 -1
  810. package/dist/render/text-layout.d.ts +12 -55
  811. package/dist/render/text-layout.d.ts.map +1 -1
  812. package/dist/render/text-layout.js +2 -16
  813. package/dist/render/text-layout.js.map +1 -1
  814. package/dist/render3d/bounds3d.d.ts +10 -32
  815. package/dist/render3d/bounds3d.d.ts.map +1 -1
  816. package/dist/render3d/bounds3d.js +2 -12
  817. package/dist/render3d/bounds3d.js.map +1 -1
  818. package/dist/render3d/builders.d.ts +8 -35
  819. package/dist/render3d/builders.d.ts.map +1 -1
  820. package/dist/render3d/builders.js +8 -35
  821. package/dist/render3d/builders.js.map +1 -1
  822. package/dist/render3d/camera.d.ts +10 -57
  823. package/dist/render3d/camera.d.ts.map +1 -1
  824. package/dist/render3d/camera.js +4 -26
  825. package/dist/render3d/camera.js.map +1 -1
  826. package/dist/render3d/fill3d.d.ts +7 -45
  827. package/dist/render3d/fill3d.d.ts.map +1 -1
  828. package/dist/render3d/fill3d.js +15 -85
  829. package/dist/render3d/fill3d.js.map +1 -1
  830. package/dist/render3d/geometry.d.ts +18 -106
  831. package/dist/render3d/geometry.d.ts.map +1 -1
  832. package/dist/render3d/geometry.js +2 -20
  833. package/dist/render3d/geometry.js.map +1 -1
  834. package/dist/render3d/graphics3d.d.ts +29 -133
  835. package/dist/render3d/graphics3d.d.ts.map +1 -1
  836. package/dist/render3d/graphics3d.js +23 -110
  837. package/dist/render3d/graphics3d.js.map +1 -1
  838. package/dist/render3d/index.d.ts +1 -16
  839. package/dist/render3d/index.d.ts.map +1 -1
  840. package/dist/render3d/index.js +1 -16
  841. package/dist/render3d/index.js.map +1 -1
  842. package/dist/render3d/inert.d.ts.map +1 -1
  843. package/dist/render3d/inert.js +1 -14
  844. package/dist/render3d/inert.js.map +1 -1
  845. package/dist/render3d/light.d.ts +3 -26
  846. package/dist/render3d/light.d.ts.map +1 -1
  847. package/dist/render3d/light.js.map +1 -1
  848. package/dist/render3d/material.d.ts +13 -87
  849. package/dist/render3d/material.d.ts.map +1 -1
  850. package/dist/render3d/material.js +2 -16
  851. package/dist/render3d/material.js.map +1 -1
  852. package/dist/render3d/matrix4.d.ts +14 -68
  853. package/dist/render3d/matrix4.d.ts.map +1 -1
  854. package/dist/render3d/matrix4.js +11 -60
  855. package/dist/render3d/matrix4.js.map +1 -1
  856. package/dist/render3d/render-context3d.d.ts +13 -51
  857. package/dist/render3d/render-context3d.d.ts.map +1 -1
  858. package/dist/render3d/render-context3d.js +9 -21
  859. package/dist/render3d/render-context3d.js.map +1 -1
  860. package/dist/render3d/resources.d.ts +9 -53
  861. package/dist/render3d/resources.d.ts.map +1 -1
  862. package/dist/render3d/resources.js +8 -48
  863. package/dist/render3d/resources.js.map +1 -1
  864. package/dist/render3d/rounded-box.d.ts +7 -21
  865. package/dist/render3d/rounded-box.d.ts.map +1 -1
  866. package/dist/render3d/rounded-box.js +7 -46
  867. package/dist/render3d/rounded-box.js.map +1 -1
  868. package/dist/render3d/scene-settings.d.ts +20 -78
  869. package/dist/render3d/scene-settings.d.ts.map +1 -1
  870. package/dist/render3d/scene-settings.js.map +1 -1
  871. package/dist/render3d/scene3d.d.ts +11 -53
  872. package/dist/render3d/scene3d.d.ts.map +1 -1
  873. package/dist/render3d/scene3d.js +12 -59
  874. package/dist/render3d/scene3d.js.map +1 -1
  875. package/dist/render3d/segments.d.ts +2 -25
  876. package/dist/render3d/segments.d.ts.map +1 -1
  877. package/dist/render3d/segments.js +1 -11
  878. package/dist/render3d/segments.js.map +1 -1
  879. package/dist/render3d/texture.d.ts +25 -112
  880. package/dist/render3d/texture.d.ts.map +1 -1
  881. package/dist/render3d/texture.js +3 -27
  882. package/dist/render3d/texture.js.map +1 -1
  883. package/dist/render3d/tracking.d.ts +2 -19
  884. package/dist/render3d/tracking.d.ts.map +1 -1
  885. package/dist/render3d/tracking.js +2 -19
  886. package/dist/render3d/tracking.js.map +1 -1
  887. package/dist/render3d/transform.d.ts +14 -60
  888. package/dist/render3d/transform.d.ts.map +1 -1
  889. package/dist/render3d/transform.js +0 -2
  890. package/dist/render3d/transform.js.map +1 -1
  891. package/dist/render3d/vector3.d.ts +6 -48
  892. package/dist/render3d/vector3.d.ts.map +1 -1
  893. package/dist/render3d/vector3.js +4 -38
  894. package/dist/render3d/vector3.js.map +1 -1
  895. package/dist/render3d/walk.d.ts +3 -27
  896. package/dist/render3d/walk.d.ts.map +1 -1
  897. package/dist/render3d/walk.js +5 -33
  898. package/dist/render3d/walk.js.map +1 -1
  899. package/dist/runtime/asset-refine.d.ts +34 -20
  900. package/dist/runtime/asset-refine.d.ts.map +1 -1
  901. package/dist/runtime/asset-refine.js +127 -31
  902. package/dist/runtime/asset-refine.js.map +1 -1
  903. package/dist/runtime/asset-timeline.d.ts +14 -53
  904. package/dist/runtime/asset-timeline.d.ts.map +1 -1
  905. package/dist/runtime/asset-timeline.js +6 -27
  906. package/dist/runtime/asset-timeline.js.map +1 -1
  907. package/dist/runtime/asset-update.d.ts +7 -26
  908. package/dist/runtime/asset-update.d.ts.map +1 -1
  909. package/dist/runtime/asset-update.js +6 -18
  910. package/dist/runtime/asset-update.js.map +1 -1
  911. package/dist/runtime/audio-index.d.ts +0 -2
  912. package/dist/runtime/audio-index.d.ts.map +1 -1
  913. package/dist/runtime/audio-index.js +0 -2
  914. package/dist/runtime/audio-index.js.map +1 -1
  915. package/dist/runtime/builtin-context.d.ts +3 -9
  916. package/dist/runtime/builtin-context.d.ts.map +1 -1
  917. package/dist/runtime/builtin-context.js +3 -9
  918. package/dist/runtime/builtin-context.js.map +1 -1
  919. package/dist/runtime/clip-instance.d.ts +12 -39
  920. package/dist/runtime/clip-instance.d.ts.map +1 -1
  921. package/dist/runtime/clip-instance.js +21 -45
  922. package/dist/runtime/clip-instance.js.map +1 -1
  923. package/dist/runtime/clip-store.d.ts +26 -68
  924. package/dist/runtime/clip-store.d.ts.map +1 -1
  925. package/dist/runtime/clip-store.js +47 -81
  926. package/dist/runtime/clip-store.js.map +1 -1
  927. package/dist/runtime/engine.d.ts +31 -85
  928. package/dist/runtime/engine.d.ts.map +1 -1
  929. package/dist/runtime/engine.js +16 -49
  930. package/dist/runtime/engine.js.map +1 -1
  931. package/dist/runtime/frame-time.d.ts +4 -15
  932. package/dist/runtime/frame-time.d.ts.map +1 -1
  933. package/dist/runtime/frame-time.js +5 -12
  934. package/dist/runtime/frame-time.js.map +1 -1
  935. package/dist/runtime/index.d.ts +0 -1
  936. package/dist/runtime/index.d.ts.map +1 -1
  937. package/dist/runtime/index.js +0 -1
  938. package/dist/runtime/index.js.map +1 -1
  939. package/dist/runtime/node-picking.d.ts +59 -139
  940. package/dist/runtime/node-picking.d.ts.map +1 -1
  941. package/dist/runtime/node-picking.js +87 -157
  942. package/dist/runtime/node-picking.js.map +1 -1
  943. package/dist/runtime/node-picking3d.d.ts +39 -96
  944. package/dist/runtime/node-picking3d.d.ts.map +1 -1
  945. package/dist/runtime/node-picking3d.js +98 -141
  946. package/dist/runtime/node-picking3d.js.map +1 -1
  947. package/dist/runtime/placement.d.ts +8 -17
  948. package/dist/runtime/placement.d.ts.map +1 -1
  949. package/dist/runtime/placement.js +7 -16
  950. package/dist/runtime/placement.js.map +1 -1
  951. package/dist/runtime/playback-controller.d.ts +78 -207
  952. package/dist/runtime/playback-controller.d.ts.map +1 -1
  953. package/dist/runtime/playback-controller.js +111 -226
  954. package/dist/runtime/playback-controller.js.map +1 -1
  955. package/dist/runtime/playback.d.ts +6 -14
  956. package/dist/runtime/playback.d.ts.map +1 -1
  957. package/dist/runtime/playback.js +6 -14
  958. package/dist/runtime/playback.js.map +1 -1
  959. package/dist/runtime/project-assets.d.ts +6 -14
  960. package/dist/runtime/project-assets.d.ts.map +1 -1
  961. package/dist/runtime/project-assets.js +7 -16
  962. package/dist/runtime/project-assets.js.map +1 -1
  963. package/dist/runtime/session.d.ts +22 -45
  964. package/dist/runtime/session.d.ts.map +1 -1
  965. package/dist/runtime/session.js +26 -46
  966. package/dist/runtime/session.js.map +1 -1
  967. package/dist/runtime/settle.d.ts +4 -10
  968. package/dist/runtime/settle.d.ts.map +1 -1
  969. package/dist/runtime/settle.js +4 -10
  970. package/dist/runtime/settle.js.map +1 -1
  971. package/dist/runtime/state-evaluator.d.ts +15 -37
  972. package/dist/runtime/state-evaluator.d.ts.map +1 -1
  973. package/dist/runtime/state-evaluator.js +27 -44
  974. package/dist/runtime/state-evaluator.js.map +1 -1
  975. package/dist/runtime/text-geometry.d.ts +18 -47
  976. package/dist/runtime/text-geometry.d.ts.map +1 -1
  977. package/dist/runtime/text-geometry.js +13 -27
  978. package/dist/runtime/text-geometry.js.map +1 -1
  979. package/dist/sdk/index.d.ts +1 -7
  980. package/dist/sdk/index.d.ts.map +1 -1
  981. package/dist/sdk/index.js +30 -138
  982. package/dist/sdk/index.js.map +1 -1
  983. package/dist/tween/command-decorator.d.ts +6 -26
  984. package/dist/tween/command-decorator.d.ts.map +1 -1
  985. package/dist/tween/command-decorator.js +1 -6
  986. package/dist/tween/command-decorator.js.map +1 -1
  987. package/dist/tween/command.d.ts +6 -53
  988. package/dist/tween/command.d.ts.map +1 -1
  989. package/dist/tween/command.js +5 -40
  990. package/dist/tween/command.js.map +1 -1
  991. package/dist/tween/ease/curve.d.ts +2 -17
  992. package/dist/tween/ease/curve.d.ts.map +1 -1
  993. package/dist/tween/ease/curve.js +1 -6
  994. package/dist/tween/ease/curve.js.map +1 -1
  995. package/dist/tween/ease/describe.d.ts +0 -11
  996. package/dist/tween/ease/describe.d.ts.map +1 -1
  997. package/dist/tween/ease/describe.js +0 -23
  998. package/dist/tween/ease/describe.js.map +1 -1
  999. package/dist/tween/ease/spec.d.ts +2 -18
  1000. package/dist/tween/ease/spec.d.ts.map +1 -1
  1001. package/dist/tween/ease/spec.js.map +1 -1
  1002. package/dist/tween/inert.d.ts +1 -14
  1003. package/dist/tween/inert.d.ts.map +1 -1
  1004. package/dist/tween/inert.js +1 -14
  1005. package/dist/tween/inert.js.map +1 -1
  1006. package/dist/tween/lerp.d.ts +2 -26
  1007. package/dist/tween/lerp.d.ts.map +1 -1
  1008. package/dist/tween/lerp.js +2 -26
  1009. package/dist/tween/lerp.js.map +1 -1
  1010. package/dist/tween/loop.d.ts +9 -50
  1011. package/dist/tween/loop.d.ts.map +1 -1
  1012. package/dist/tween/loop.js +6 -31
  1013. package/dist/tween/loop.js.map +1 -1
  1014. package/dist/tween/prepare.d.ts +2 -30
  1015. package/dist/tween/prepare.d.ts.map +1 -1
  1016. package/dist/tween/prepare.js +2 -30
  1017. package/dist/tween/prepare.js.map +1 -1
  1018. package/dist/tween/stepper.d.ts +4 -25
  1019. package/dist/tween/stepper.d.ts.map +1 -1
  1020. package/dist/tween/stepper.js.map +1 -1
  1021. package/dist/tween/to-command.d.ts +1 -8
  1022. package/dist/tween/to-command.d.ts.map +1 -1
  1023. package/dist/tween/to-command.js +2 -25
  1024. package/dist/tween/to-command.js.map +1 -1
  1025. package/dist/util/context.d.ts +4 -29
  1026. package/dist/util/context.d.ts.map +1 -1
  1027. package/dist/util/context.js +3 -15
  1028. package/dist/util/context.js.map +1 -1
  1029. package/dist/util/csv.d.ts +4 -29
  1030. package/dist/util/csv.d.ts.map +1 -1
  1031. package/dist/util/csv.js +3 -22
  1032. package/dist/util/csv.js.map +1 -1
  1033. package/dist/util/metrics.d.ts +2 -26
  1034. package/dist/util/metrics.d.ts.map +1 -1
  1035. package/dist/util/metrics.js +2 -26
  1036. package/dist/util/metrics.js.map +1 -1
  1037. package/dist/util/random.d.ts +20 -87
  1038. package/dist/util/random.d.ts.map +1 -1
  1039. package/dist/util/random.js +20 -87
  1040. package/dist/util/random.js.map +1 -1
  1041. package/dist/util/reference.d.ts +6 -35
  1042. package/dist/util/reference.d.ts.map +1 -1
  1043. package/dist/util/reference.js +1 -4
  1044. package/dist/util/reference.js.map +1 -1
  1045. package/dist/util/scheduler.d.ts +6 -27
  1046. package/dist/util/scheduler.d.ts.map +1 -1
  1047. package/dist/util/scheduler.js +8 -35
  1048. package/dist/util/scheduler.js.map +1 -1
  1049. package/package.json +1 -1
  1050. package/dist/browser/chunks/chunk-4BDLFEOC.js.map +0 -7
  1051. package/dist/browser/chunks/chunk-7DB6BI27.js +0 -6
  1052. package/dist/browser/chunks/chunk-7DB6BI27.js.map +0 -7
  1053. package/dist/browser/chunks/chunk-IX53IFBD.js +0 -13
  1054. package/dist/browser/chunks/chunk-IX53IFBD.js.map +0 -7
  1055. package/dist/browser/chunks/chunk-Q55UPA3E.js +0 -3
  1056. package/dist/browser/chunks/chunk-Q55UPA3E.js.map +0 -7
  1057. package/dist/renamed-scene-names.d.ts +0 -17
  1058. package/dist/renamed-scene-names.d.ts.map +0 -1
  1059. package/dist/renamed-scene-names.js +0 -9
  1060. package/dist/renamed-scene-names.js.map +0 -1
  1061. package/dist/runtime/precompisition.d.ts +0 -24
  1062. package/dist/runtime/precompisition.d.ts.map +0 -1
  1063. package/dist/runtime/precompisition.js +0 -7
  1064. package/dist/runtime/precompisition.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"shadow.js","sourceRoot":"","sources":["../../../../src/attributes/shape/shadow/shadow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAG3C,OAAO,EAAW,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAiDnE,gFAAgF;AAEhF,MAAM,UAAU,aAAa,CAAC,IAAgB,EAAE,QAAyB;IACrE,OAAO;QACH,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,QAAQ,EAAE,IAAI,IAAI,CAAC;QACtC,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,QAAQ,EAAE,MAAM;QACvC,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;QACzG,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,QAAQ,EAAE,KAAK,IAAI,KAAK;QAC7C,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,QAAQ,EAAE,MAAM,IAAI,CAAC;KAC/C,CAAC;AACN,CAAC;AAED,gFAAgF;AAEhF,SAAS,UAAU,CAAC,IAAoB,EAAE,EAAkB,EAAE,CAAS;IACnE,OAAO;QACH,IAAI,EAAE,IAAI,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;QAC3C,MAAM,EAAE,WAAW,CAAC,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAA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AAC,EAAE,EAAE,CAAC;YAC3B,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;YACjB,IAAI,CAAC,CAAC,EAAE,CAAC;gBAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBAAC,SAAS;YAAC,CAAC;YACtC,IAAI,CAAC,EAAE,EAAE,CAAC;gBAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBAAC,SAAS;YAAC,CAAC;YACtC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;QACtC,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ,CAAC","sourcesContent":["import { fillOps } from '../fill/registry';\nimport { FillResolved } from '../fill/union';\nimport { Fill } from '../fill/chain';\nimport { Vector2, lerpVector2 } from '@/attributes/layout/vector2';\nimport type { AttributeOps } from '@/attributes/shared/operators';\n\n// ── Prop (loose) ─────────────────────────────────────────────────────────────\n\nexport interface ShadowProp {\n blur?: number;\n /** Offset of the shadow from the shape, in px. Defaults to `{ x: 0, y: 0 }`. */\n offset?: Vector2;\n /** Any loose fill: a CSS color string, fill prop object, resolved fill, or {@link FillChain}/array of layers. */\n fill?: Fill;\n /** When true, the shadow is cast inward (inset) instead of as a drop shadow. Defaults to false. */\n inner?: boolean;\n /**\n * Grows (positive) or shrinks (negative) the shadow's silhouette before it\n * is offset and blurred, like CSS `box-shadow` spread. Only honoured for\n * ellipses and rectangles, whose geometry can be resized cleanly; ignored\n * for other shapes. Defaults to 0.\n */\n spread?: number;\n}\n/**\n * Fully resolved shadow — all fields normalised with defaults applied.\n * Compatible with the lerp registry (IFill is used for fill to avoid\n * breaking the existing lerp/registry pipeline).\n */\nexport interface ShadowResolved {\n blur: number;\n /** Offset of the shadow from the shape, in px. */\n offset?: Vector2;\n /** Resolved fill layers, painted bottom-to-top like a node's `fill`. */\n fill: FillResolved[];\n /** When true, the shadow is cast inward (inset) instead of as a drop shadow. */\n inner: boolean;\n /** Silhouette grow (positive) / shrink (negative) before blur, in px. Only ellipses and rects honour it. */\n spread: number;\n}\n\n/**\n * Accepted shapes for a node's `shadow` prop: a single loose {@link ShadowProp},\n * an array of them (stacked), or an already-resolved {@link ShadowResolved}/array\n * — resolved values pass through `resolveShadow` idempotently, so a node's\n * read-back `shadow` can be assigned straight back.\n */\nexport type Shadow =\n | ShadowProp\n | ShadowResolved\n | (ShadowProp | ShadowResolved)[];\n\n// ── Resolve ──────────────────────────────────────────────────────────────────\n\nexport function resolveShadow(prop: ShadowProp, previous?: ShadowResolved): ShadowResolved {\n return {\n blur: prop.blur ?? previous?.blur ?? 0,\n offset: prop.offset ?? previous?.offset,\n fill: prop.fill != null ? fillOps.resolve(prop.fill) : (previous?.fill ?? fillOps.resolve('transparent')),\n inner: prop.inner ?? previous?.inner ?? false,\n spread: prop.spread ?? previous?.spread ?? 0,\n };\n}\n\n// ── Lerp ─────────────────────────────────────────────────────────────────────\n\nfunction lerpShadow(from: ShadowResolved, to: ShadowResolved, t: number): ShadowResolved {\n return {\n blur: from.blur + (to.blur - from.blur) * t,\n offset: lerpVector2(from.offset ?? { x: 0, y: 0 }, to.offset ?? { x: 0, y: 0 }, t),\n fill: fillOps.lerp(from.fill, to.fill, t),\n // inner/outer is a discrete kind — keep the start's until the tween completes.\n inner: t < 1 ? from.inner : to.inner,\n spread: from.spread + (to.spread - from.spread) * t,\n };\n}\n\n/** The shadow-layer attribute's op set — the `shadow` prop's resolve/lerp pair. */\nexport const shadowOps: AttributeOps<Shadow, ShadowResolved[]> = {\n resolve: (prop, previous) => {\n if (prop == null) return [];\n const arr = Array.isArray(prop) ? prop : [prop];\n return arr.map((p, i) => resolveShadow(p as ShadowProp, previous?.[i]));\n },\n lerp: (from, to, t) => {\n if (from === to) return from;\n const len = Math.max(from.length, to.length);\n const result: ShadowResolved[] = [];\n for (let i = 0; i < len; i++) {\n const f = from[i];\n const tf = to[i];\n if (!f) { result.push(tf); continue; }\n if (!tf) { result.push(f); continue; }\n result.push(lerpShadow(f, tf, t));\n }\n return result;\n },\n};\n"]}
1
+ {"version":3,"file":"shadow.js","sourceRoot":"","sources":["../../../../src/attributes/shape/shadow/shadow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAG3C,OAAO,EAAW,WAAW,EAAE,MAAM,6BAA6B,CAAC;AA+BnE,MAAM,UAAU,aAAa,CAAC,IAAgB,EAAE,QAAyB;IACrE,OAAO;QACH,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,QAAQ,EAAE,IAAI,IAAI,CAAC;QACtC,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,QAAQ,EAAE,MAAM;QACvC,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;QACzG,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,QAAQ,EAAE,KAAK,IAAI,KAAK;QAC7C,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,QAAQ,EAAE,MAAM,IAAI,CAAC;KAC/C,CAAC;AACN,CAAC;AAED,SAAS,UAAU,CAAC,IAAoB,EAAE,EAAkB,EAAE,CAAS;IACnE,OAAO;QACH,IAAI,EAAE,IAAI,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;QAC3C,MAAM,EAAE,WAAW,CAAC,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,MAAM,IAAI,EAAE,CAAC,EAAE,C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CAAC,CAAC,CAAC,CAAC;YAClB,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;YACjB,IAAI,CAAC,CAAC,EAAE,CAAC;gBAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBAAC,SAAS;YAAC,CAAC;YACtC,IAAI,CAAC,EAAE,EAAE,CAAC;gBAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBAAC,SAAS;YAAC,CAAC;YACtC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;QACtC,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ,CAAC","sourcesContent":["import { fillOps } from '../fill/registry';\nimport { FillResolved } from '../fill/union';\nimport { Fill } from '../fill/chain';\nimport { Vector2, lerpVector2 } from '@/attributes/layout/vector2';\nimport type { AttributeOps } from '@/attributes/shared/operators';\n\nexport interface ShadowProp {\n blur?: number;\n /** Offset of the shadow from the shape, in px. Defaults to `{ x: 0, y: 0 }`. */\n offset?: Vector2;\n /** Any loose fill: a CSS color string, fill prop object, resolved fill, or {@link FillChain}/array of layers. */\n fill?: Fill;\n /** When true, the shadow is cast inward (inset) instead of as a drop shadow. Defaults to false. */\n inner?: boolean;\n /** Grows (positive) or shrinks (negative) the silhouette before offset and blur, like CSS `box-shadow` spread. Only honoured for ellipses and rectangles, whose geometry resizes cleanly. Defaults to 0. */\n spread?: number;\n}\n/** Fully resolved shadow: all fields normalised, defaults applied. */\nexport interface ShadowResolved {\n blur: number;\n offset?: Vector2;\n fill: FillResolved[];\n /** When true, the shadow is cast inward (inset) instead of as a drop shadow. */\n inner: boolean;\n /** Silhouette grow (positive) / shrink (negative) before blur, in px. Only ellipses and rects honour it. */\n spread: number;\n}\n\n/** Accepted shapes for a node's `shadow`: a loose {@link ShadowProp}, an array of them (stacked), or already-resolved values, which pass through `resolveShadow` idempotently so a read-back `shadow` can be assigned straight back. */\nexport type Shadow =\n | ShadowProp\n | ShadowResolved\n | (ShadowProp | ShadowResolved)[];\n\nexport function resolveShadow(prop: ShadowProp, previous?: ShadowResolved): ShadowResolved {\n return {\n blur: prop.blur ?? previous?.blur ?? 0,\n offset: prop.offset ?? previous?.offset,\n fill: prop.fill != null ? fillOps.resolve(prop.fill) : (previous?.fill ?? fillOps.resolve('transparent')),\n inner: prop.inner ?? previous?.inner ?? false,\n spread: prop.spread ?? previous?.spread ?? 0,\n };\n}\n\nfunction lerpShadow(from: ShadowResolved, to: ShadowResolved, t: number): ShadowResolved {\n return {\n blur: from.blur + (to.blur - from.blur) * t,\n offset: lerpVector2(from.offset ?? { x: 0, y: 0 }, to.offset ?? { x: 0, y: 0 }, t),\n fill: fillOps.lerp(from.fill, to.fill, t),\n // inner/outer is a discrete kind — keep the start's until the tween completes.\n inner: t < 1 ? from.inner : to.inner,\n spread: from.spread + (to.spread - from.spread) * t,\n };\n}\n\nexport const shadowOps: AttributeOps<Shadow, ShadowResolved[]> = {\n resolve: (prop, previous) => {\n if (prop == null) return [];\n const arr = Array.isArray(prop) ? prop : [prop];\n return arr.map((p, i) => resolveShadow(p as ShadowProp, previous?.[i]));\n },\n lerp: (from, to, t) => {\n if (from === to) return from;\n const len = Math.max(from.length, to.length);\n const result: ShadowResolved[] = [];\n for (let i = 0; i < len; i++) {\n const f = from[i];\n const tf = to[i];\n if (!f) { result.push(tf); continue; }\n if (!tf) { result.push(f); continue; }\n result.push(lerpShadow(f, tf, t));\n }\n return result;\n },\n};\n"]}
@@ -1,91 +1,50 @@
1
1
  import { FillResolved } from '../fill/union.js';
2
2
  import { Fill } from '../fill/chain.js';
3
3
  import type { AttributeOps } from '../../../attributes/shared/operators.js';
4
- /**
5
- * Where the stroke sits relative to the shape's edge. Resolves to a number in
6
- * the range `[-1, 1]`: -1 = fully inside the outline, 0 = centered (straddles the edge,
7
- * half in/half out), +1 = fully outside. Named values map to the endpoints;
8
- * intermediate numbers bias the stroke partway, like Figma's stroke alignment.
9
- */
4
+ /** Where the stroke sits relative to the shape's edge, in `[-1, 1]`: -1 fully inside, 0 centred (straddling), +1 fully outside; named values map to the endpoints, intermediate numbers bias partway (like Figma's stroke alignment). */
10
5
  export type StrokeAlign = number | 'inside' | 'center' | 'outside';
11
6
  /** Resolve a loose `align` prop to a clamped number in [-1, 1]. */
12
7
  export declare function resolveStrokeAlign(align: StrokeAlign | undefined, fallback: number): number;
13
- /** How the ends of an open stroke are shaped. */
14
8
  export type StrokeCap = 'butt' | 'round' | 'square';
15
- /**
16
- * A shape one end of an open contour wears in place of a cap, sized by
17
- * `capScale`. `arrow` is an open chevron; `triangle` and `stealth` are filled
18
- * heads with their tip on the path's end; `dot`, `box`, `diamond` and `bar` sit
19
- * centred on it.
20
- */
9
+ /** A shape one end of an open contour wears in place of a cap, sized by `capScale`: `arrow` is an open chevron, `triangle`/`stealth` filled heads with their tip on the path's end, `dot`/`box`/`diamond`/`bar` centred on it. */
21
10
  export type StrokeMarker = 'arrow' | 'triangle' | 'stealth' | 'dot' | 'box' | 'diamond' | 'bar';
22
11
  /** What one end of an open contour wears: a cap, or a marker. */
23
12
  export type StrokeEnd = StrokeCap | StrokeMarker;
24
13
  /** A marker's length as a multiple of the stroke's weight, where none is given. */
25
14
  export declare const DEFAULT_CAP_SCALE = 4;
26
15
  export declare function isStrokeMarker(end: StrokeEnd | undefined): end is StrokeMarker;
27
- /** How two stroke segments are joined at a corner. */
28
16
  export type StrokeJoin = 'miter' | 'round' | 'bevel';
29
- /** Normalise a loose `cap` prop, falling back when omitted/unknown. */
30
17
  export declare function resolveStrokeCap(cap: StrokeCap | undefined, fallback: StrokeCap): StrokeCap;
31
- /** Normalise a loose `startCap`/`endCap` prop, falling back when omitted/unknown. */
32
18
  export declare function resolveStrokeEnd(end: StrokeEnd | undefined, fallback: StrokeCap): StrokeEnd;
33
- /** Normalise a loose `join` prop, falling back when omitted/unknown. */
34
19
  export declare function resolveStrokeJoin(join: StrokeJoin | undefined, fallback: StrokeJoin): StrokeJoin;
35
20
  export interface StrokeProp {
36
- /** Stroke width in pixels. Defaults to 1. */
37
21
  weight?: number;
38
22
  /** Any loose fill: a CSS color string, fill prop object, resolved fill, or {@link FillChain}/array of layers. */
39
23
  fill?: Fill;
40
24
  /** Dash pattern. A single number `n` becomes `[n, n]`. */
41
25
  dash?: number | number[];
42
26
  dashOffset?: number;
43
- /**
44
- * Where the stroke sits relative to the edge: a number in [-1, 1] or one of
45
- * `'inside'` (-1), `'center'` (0), `'outside'` (1). Defaults to `'inside'`,
46
- * so the stroke stays within the shape's measured bounds (like a CSS border)
47
- * rather than leaking half its width outside.
48
- */
27
+ /** `'inside'` (-1), `'center'` (0), `'outside'` (1) or a number in [-1, 1]. Defaults to `'inside'`, so the stroke stays within the shape's measured bounds (like a CSS border). */
49
28
  align?: StrokeAlign;
50
- /**
51
- * How the ends of each dash, and of an open stroke, are shaped: `'butt'`
52
- * (flush, the default), `'round'`, or `'square'`. `startCap`/`endCap`
53
- * override it at the path's own two ends.
54
- */
29
+ /** How the ends of each dash and of an open stroke are shaped (default `'butt'`); `startCap`/`endCap` override it at the path's two ends. */
55
30
  cap?: StrokeCap;
56
31
  /** The cap or marker at the start of each open contour, in place of `cap`. */
57
32
  startCap?: StrokeEnd;
58
33
  /** The cap or marker at the end of each open contour, in place of `cap`. */
59
34
  endCap?: StrokeEnd;
60
- /**
61
- * A marker's length as a multiple of `weight` (default `4`), so a head keeps
62
- * its proportion as the stroke thickens. A marker never outgrows its
63
- * contour: on a short one it shrinks to fit.
64
- */
35
+ /** A marker's length as a multiple of `weight` (default `4`) so a head keeps its proportion as the stroke thickens; on a short contour it shrinks to fit. */
65
36
  capScale?: number;
66
- /**
67
- * How two segments meet at a corner: `'miter'` (sharp, the default),
68
- * `'round'`, or `'bevel'` (flattened).
69
- */
37
+ /** How two segments meet at a corner (default `'miter'`). */
70
38
  join?: StrokeJoin;
71
- /**
72
- * Maximum ratio of miter length to stroke width before a `'miter'` join is
73
- * truncated to a bevel. Only affects `join: 'miter'`. Defaults to 4.
74
- */
39
+ /** Maximum miter length to stroke width ratio before a `'miter'` join truncates to a bevel (default 4). */
75
40
  miterLimit?: number;
76
41
  }
77
- /**
78
- * Fully resolved stroke — all fields normalised with defaults applied.
79
- * Compatible with the lerp registry (IFill is used for fill to avoid
80
- * breaking the existing lerp/registry pipeline).
81
- */
42
+ /** Fully resolved stroke: all fields normalised, defaults applied. */
82
43
  export interface StrokeResolved {
83
44
  weight: number;
84
- /** Resolved fill layers, painted bottom-to-top like a node's `fill`. */
85
45
  fill: FillResolved[];
86
46
  dash?: number[];
87
47
  dashOffset: number;
88
- /** Stroke placement in [-1, 1]: -1 inside, 0 center, +1 outside. */
89
48
  align: number;
90
49
  /** End-cap shape for dash ends, and for open strokes' ends unless overridden. */
91
50
  cap: StrokeCap;
@@ -93,19 +52,11 @@ export interface StrokeResolved {
93
52
  startCap?: StrokeEnd;
94
53
  endCap?: StrokeEnd;
95
54
  capScale: number;
96
- /** Corner join shape. */
97
55
  join: StrokeJoin;
98
- /** Miter limit (only used when `join` is `'miter'`). */
99
56
  miterLimit: number;
100
57
  }
101
- /**
102
- * Accepted shapes for a node's `stroke` prop: a single loose {@link StrokeProp},
103
- * an array of them (stacked bottom-to-top), or an already-resolved
104
- * {@link StrokeResolved}/array — resolved values pass through `resolveStroke`
105
- * idempotently, so a node's read-back `stroke` can be assigned straight back.
106
- */
58
+ /** Accepted shapes for a node's `stroke`: a loose {@link StrokeProp}, an array of them (stacked bottom-to-top), or already-resolved values, which pass through `resolveStroke` idempotently so a read-back `stroke` can be assigned straight back. */
107
59
  export type Stroke = StrokeProp | StrokeResolved | (StrokeProp | StrokeResolved)[];
108
60
  export declare function resolveStroke(prop: StrokeProp, previous?: StrokeResolved): StrokeResolved;
109
- /** The stroke-layer attribute's op set — the `stroke` prop's resolve/lerp pair. */
110
61
  export declare const strokeOps: AttributeOps<Stroke, StrokeResolved[]>;
111
62
  //# sourceMappingURL=stroke.d.ts.map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U,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,sPAAsP;AACtP,MAAM,MAAM,MAAM,GACZ,UAAU,GACV,cAAc,GACd,CAAC,UAAU,GAAG,cAAc,CAAC,EAAE,CAAC;AAEtC,wBAAgB,aAAa,CAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAE,cAAc,GAAG,cAAc,CAsBzF;AAmCD,eAAO,MAAM,SAAS,EAAE,YAAY,CAAC,MAAM,EAAE,cAAc,EAAE,CAmB5D,CAAC"}
@@ -26,7 +26,6 @@ export function isStrokeMarker(end) {
26
26
  }
27
27
  return false;
28
28
  }
29
- /** Normalise a loose `cap` prop, falling back when omitted/unknown. */
30
29
  export function resolveStrokeCap(cap, fallback) {
31
30
  if (cap == null)
32
31
  return fallback;
@@ -37,11 +36,9 @@ export function resolveStrokeCap(cap, fallback) {
37
36
  }
38
37
  return fallback;
39
38
  }
40
- /** Normalise a loose `startCap`/`endCap` prop, falling back when omitted/unknown. */
41
39
  export function resolveStrokeEnd(end, fallback) {
42
40
  return isStrokeMarker(end) ? end : resolveStrokeCap(end, fallback);
43
41
  }
44
- /** Normalise a loose `join` prop, falling back when omitted/unknown. */
45
42
  export function resolveStrokeJoin(join, fallback) {
46
43
  if (join == null)
47
44
  return fallback;
@@ -52,7 +49,6 @@ export function resolveStrokeJoin(join, fallback) {
52
49
  }
53
50
  return fallback;
54
51
  }
55
- // ── Resolve ──────────────────────────────────────────────────────────────────
56
52
  export function resolveStroke(prop, previous) {
57
53
  let dash;
58
54
  if (prop.dash != null) {
@@ -77,7 +73,6 @@ export function resolveStroke(prop, previous) {
77
73
  miterLimit: prop.miterLimit ?? previous?.miterLimit ?? 4,
78
74
  };
79
75
  }
80
- // ── Lerp ─────────────────────────────────────────────────────────────────────
81
76
  function lerpDashArray(from, to, t) {
82
77
  const fArray = from || [];
83
78
  const tArray = to || [];
@@ -109,7 +104,6 @@ function lerpStroke(from, to, t) {
109
104
  miterLimit: from.miterLimit + (to.miterLimit - from.miterLimit) * t,
110
105
  };
111
106
  }
112
- /** The stroke-layer attribute's op set — the `stroke` prop's resolve/lerp pair. */
113
107
  export const strokeOps = {
114
108
  resolve: (prop, previous) => {
115
109
  if (prop == null)
@@ -1 +1 @@
1
- {"version":3,"file":"stroke.js","sourceRoot":"","sources":["../../../../src/attributes/shape/stroke/stroke.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAe3D,mEAAmE;AACnE,MAAM,UAAU,kBAAkB,CAAC,KAA8B,EAAE,QAAgB;IAC/E,IAAI,KAAK,IAAI,IAAI;QAAE,OAAO,QAAQ,CAAC;IACnC,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;IACvE,QAAQ,KAAK,EAAE,CAAC;QACZ,KAAK,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;QACzB,KAAK,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC;QACxB,KAAK,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC;IAC7B,CAAC;IACD,OAAO,QAAQ,CAAC;AACpB,CAAC;AAkBD,mFAAmF;AACnF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAEnC,MAAM,UAAU,cAAc,CAAC,GAA0B;IACrD,QAAQ,GAAG,EAAE,CAAC;QACV,KAAK,OAAO,CAAC;QACb,KAAK,UAAU,CAAC;QAChB,KAAK,SAAS,CAAC;QACf,KAAK,KAAK,CAAC;QACX,KAAK,KAAK,CAAC;QACX,KAAK,SAAS,CAAC;QACf,KAAK,KAAK,CAAC,CAAC,OAAO,IAAI,CAAC;IAC5B,CAAC;IACD,OAAO,KAAK,CAAC;AACjB,CAAC;AAKD,uEAAuE;AACvE,MAAM,UAAU,gBAAgB,CAAC,GAA0B,EA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AAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,aAAa,CAAC,CAAe,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5E,CAAC;IACD,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE;QAClB,IAAI,IAAI,KAAK,EAAE;YAAE,OAAO,IAAI,CAAC;QAC7B,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC;QAC7C,MAAM,MAAM,GAAqB,EAAE,CAAC;QACpC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;YAC3B,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;YACjB,IAAI,CAAC,CAAC,EAAE,CAAC;gBAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBAAC,SAAS;YAAC,CAAC;YACtC,IAAI,CAAC,EAAE,EAAE,CAAC;gBAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBAAC,SAAS;YAAC,CAAC;YACtC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;QACtC,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ,CAAC","sourcesContent":["import { fillOps } from '@/attributes/shape/fill/registry';\nimport { FillResolved } from '../fill/union';\nimport { Fill } from '../fill/chain';\nimport type { AttributeOps } from '@/attributes/shared/operators';\n\n// ── Align ──────────────────────────────────────────────────────────────────\n\n/**\n * Where the stroke sits relative to the shape's edge. Resolves to a number in\n * the range `[-1, 1]`: -1 = fully inside the outline, 0 = centered (straddles the edge,\n * half in/half out), +1 = fully outside. Named values map to the endpoints;\n * intermediate numbers bias the stroke partway, like Figma's stroke alignment.\n */\nexport type StrokeAlign = number | 'inside' | 'center' | 'outside';\n\n/** Resolve a loose `align` prop to a clamped number in [-1, 1]. */\nexport function resolveStrokeAlign(align: StrokeAlign | undefined, fallback: number): number {\n if (align == null) return fallback;\n if (typeof align === 'number') return Math.max(-1, Math.min(1, align));\n switch (align) {\n case 'inside': return -1;\n case 'center': return 0;\n case 'outside': return 1;\n }\n return fallback;\n}\n\n// ── Cap & Join ───────────────────────────────────────────────────────────────\n\n/** How the ends of an open stroke are shaped. */\nexport type StrokeCap = 'butt' | 'round' | 'square';\n\n/**\n * A shape one end of an open contour wears in place of a cap, sized by\n * `capScale`. `arrow` is an open chevron; `triangle` and `stealth` are filled\n * heads with their tip on the path's end; `dot`, `box`, `diamond` and `bar` sit\n * centred on it.\n */\nexport type StrokeMarker = 'arrow' | 'triangle' | 'stealth' | 'dot' | 'box' | 'diamond' | 'bar';\n\n/** What one end of an open contour wears: a cap, or a marker. */\nexport type StrokeEnd = StrokeCap | StrokeMarker;\n\n/** A marker's length as a multiple of the stroke's weight, where none is given. */\nexport const DEFAULT_CAP_SCALE = 4;\n\nexport function isStrokeMarker(end: StrokeEnd | undefined): end is StrokeMarker {\n switch (end) {\n case 'arrow':\n case 'triangle':\n case 'stealth':\n case 'dot':\n case 'box':\n case 'diamond':\n case 'bar': return true;\n }\n return false;\n}\n\n/** How two stroke segments are joined at a corner. */\nexport type StrokeJoin = 'miter' | 'round' | 'bevel';\n\n/** Normalise a loose `cap` prop, falling back when omitted/unknown. */\nexport function resolveStrokeCap(cap: StrokeCap | undefined, fallback: StrokeCap): StrokeCap {\n if (cap == null) return fallback;\n switch (cap) {\n case 'butt':\n case 'round':\n case 'square': return cap;\n }\n return fallback;\n}\n\n/** Normalise a loose `startCap`/`endCap` prop, falling back when omitted/unknown. */\nexport function resolveStrokeEnd(end: StrokeEnd | undefined, fallback: StrokeCap): StrokeEnd {\n return isStrokeMarker(end) ? end : resolveStrokeCap(end, fallback);\n}\n\n/** Normalise a loose `join` prop, falling back when omitted/unknown. */\nexport function resolveStrokeJoin(join: StrokeJoin | undefined, fallback: StrokeJoin): StrokeJoin {\n if (join == null) return fallback;\n switch (join) {\n case 'miter':\n case 'round':\n case 'bevel': return join;\n }\n return fallback;\n}\n\n// ── Prop (loose) ─────────────────────────────────────────────────────────────\n\nexport interface StrokeProp {\n /** Stroke width in pixels. Defaults to 1. */\n weight?: number;\n /** Any loose fill: a CSS color string, fill prop object, resolved fill, or {@link FillChain}/array of layers. */\n fill?: Fill;\n /** Dash pattern. A single number `n` becomes `[n, n]`. */\n dash?: number | number[];\n dashOffset?: number;\n /**\n * Where the stroke sits relative to the edge: a number in [-1, 1] or one of\n * `'inside'` (-1), `'center'` (0), `'outside'` (1). Defaults to `'inside'`,\n * so the stroke stays within the shape's measured bounds (like a CSS border)\n * rather than leaking half its width outside.\n */\n align?: StrokeAlign;\n /**\n * How the ends of each dash, and of an open stroke, are shaped: `'butt'`\n * (flush, the default), `'round'`, or `'square'`. `startCap`/`endCap`\n * override it at the path's own two ends.\n */\n cap?: StrokeCap;\n /** The cap or marker at the start of each open contour, in place of `cap`. */\n startCap?: StrokeEnd;\n /** The cap or marker at the end of each open contour, in place of `cap`. */\n endCap?: StrokeEnd;\n /**\n * A marker's length as a multiple of `weight` (default `4`), so a head keeps\n * its proportion as the stroke thickens. A marker never outgrows its\n * contour: on a short one it shrinks to fit.\n */\n capScale?: number;\n /**\n * How two segments meet at a corner: `'miter'` (sharp, the default),\n * `'round'`, or `'bevel'` (flattened).\n */\n join?: StrokeJoin;\n /**\n * Maximum ratio of miter length to stroke width before a `'miter'` join is\n * truncated to a bevel. Only affects `join: 'miter'`. Defaults to 4.\n */\n miterLimit?: number;\n}\n\n/**\n * Fully resolved stroke — all fields normalised with defaults applied.\n * Compatible with the lerp registry (IFill is used for fill to avoid\n * breaking the existing lerp/registry pipeline).\n */\nexport interface StrokeResolved {\n weight: number;\n /** Resolved fill layers, painted bottom-to-top like a node's `fill`. */\n fill: FillResolved[];\n dash?: number[];\n dashOffset: number;\n /** Stroke placement in [-1, 1]: -1 inside, 0 center, +1 outside. */\n align: number;\n /** End-cap shape for dash ends, and for open strokes' ends unless overridden. */\n cap: StrokeCap;\n /** Absent means the end follows `cap`. */\n startCap?: StrokeEnd;\n endCap?: StrokeEnd;\n capScale: number;\n /** Corner join shape. */\n join: StrokeJoin;\n /** Miter limit (only used when `join` is `'miter'`). */\n miterLimit: number;\n}\n\n/**\n * Accepted shapes for a node's `stroke` prop: a single loose {@link StrokeProp},\n * an array of them (stacked bottom-to-top), or an already-resolved\n * {@link StrokeResolved}/array — resolved values pass through `resolveStroke`\n * idempotently, so a node's read-back `stroke` can be assigned straight back.\n */\nexport type Stroke =\n | StrokeProp\n | StrokeResolved\n | (StrokeProp | StrokeResolved)[];\n\n// ── Resolve ──────────────────────────────────────────────────────────────────\n\nexport function resolveStroke(prop: StrokeProp, previous?: StrokeResolved): StrokeResolved {\n let dash: number[] | undefined;\n if (prop.dash != null) {\n const raw = Array.isArray(prop.dash) ? prop.dash : [prop.dash];\n dash = raw.length === 1 ? [raw[0], raw[0]] : raw;\n } else {\n dash = previous?.dash;\n }\n const cap = resolveStrokeCap(prop.cap, previous?.cap ?? 'butt');\n return {\n weight: prop.weight ?? previous?.weight ?? 1,\n fill: prop.fill != null ? fillOps.resolve(prop.fill) : (previous?.fill ?? fillOps.resolve('transparent')),\n dash,\n dashOffset: prop.dashOffset ?? previous?.dashOffset ?? 0,\n align: resolveStrokeAlign(prop.align, previous?.align ?? -1),\n cap,\n startCap: prop.startCap != null ? resolveStrokeEnd(prop.startCap, cap) : previous?.startCap,\n endCap: prop.endCap != null ? resolveStrokeEnd(prop.endCap, cap) : previous?.endCap,\n capScale: Math.max(0, prop.capScale ?? previous?.capScale ?? DEFAULT_CAP_SCALE),\n join: resolveStrokeJoin(prop.join, previous?.join ?? 'miter'),\n miterLimit: prop.miterLimit ?? previous?.miterLimit ?? 4,\n };\n}\n\n// ── Lerp ─────────────────────────────────────────────────────────────────────\n\nfunction lerpDashArray(from: number[] | undefined, to: number[] | undefined, t: number): number[] | undefined {\n const fArray = from || [];\n const tArray = to || [];\n if (fArray.length === 0 && tArray.length === 0) return from;\n\n const len = Math.max(fArray.length, tArray.length);\n const result: number[] = new Array(len);\n for (let i = 0; i < len; i++) {\n // Pad shorter arrays with 0 to ensure smooth transitions.\n const fVal = fArray[i] ?? 0;\n const tVal = tArray[i] ?? 0;\n result[i] = fVal + (tVal - fVal) * t;\n }\n return result;\n}\n\nfunction lerpStroke(from: StrokeResolved, to: StrokeResolved, t: number): StrokeResolved {\n return {\n weight: from.weight + (to.weight - from.weight) * t,\n fill: fillOps.lerp(from.fill, to.fill, t),\n dash: lerpDashArray(from.dash, to.dash, t) as number[],\n dashOffset: from.dashOffset + (to.dashOffset - from.dashOffset) * t,\n align: from.align + (to.align - from.align) * t,\n // cap/join are discrete enums — snap at the midpoint.\n cap: t < 0.5 ? from.cap : to.cap,\n startCap: t < 0.5 ? from.startCap : to.startCap,\n endCap: t < 0.5 ? from.endCap : to.endCap,\n capScale: from.capScale + (to.capScale - from.capScale) * t,\n join: t < 0.5 ? from.join : to.join,\n miterLimit: from.miterLimit + (to.miterLimit - from.miterLimit) * t,\n };\n}\n\n/** The stroke-layer attribute's op set — the `stroke` prop's resolve/lerp pair. */\nexport const strokeOps: AttributeOps<Stroke, StrokeResolved[]> = {\n resolve: (prop, previous) => {\n if (prop == null) return [];\n const arr = Array.isArray(prop) ? prop : [prop];\n return arr.map((p, i) => resolveStroke(p as StrokeProp, previous?.[i]));\n },\n lerp: (from, to, t) => {\n if (from === to) return from;\n const len = Math.max(from.length, to.length);\n const result: StrokeResolved[] = [];\n for (let i = 0; i < len; i++) {\n const f = from[i];\n const tf = to[i];\n if (!f) { result.push(tf); continue; }\n if (!tf) { result.push(f); continue; }\n result.push(lerpStroke(f, tf, t));\n }\n return result;\n },\n};\n"]}
1
+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,CAAC;QAC7B,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC;QAC7C,MAAM,MAAM,GAAqB,EAAE,CAAC;QACpC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;YAC3B,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;YACjB,IAAI,CAAC,CAAC,EAAE,CAAC;gBAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBAAC,SAAS;YAAC,CAAC;YACtC,IAAI,CAAC,EAAE,EAAE,CAAC;gBAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBAAC,SAAS;YAAC,CAAC;YACtC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;QACtC,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ,CAAC","sourcesContent":["import { fillOps } from '@/attributes/shape/fill/registry';\nimport { FillResolved } from '../fill/union';\nimport { Fill } from '../fill/chain';\nimport type { AttributeOps } from '@/attributes/shared/operators';\n\n/** Where the stroke sits relative to the shape's edge, in `[-1, 1]`: -1 fully inside, 0 centred (straddling), +1 fully outside; named values map to the endpoints, intermediate numbers bias partway (like Figma's stroke alignment). */\nexport type StrokeAlign = number | 'inside' | 'center' | 'outside';\n\n/** Resolve a loose `align` prop to a clamped number in [-1, 1]. */\nexport function resolveStrokeAlign(align: StrokeAlign | undefined, fallback: number): number {\n if (align == null) return fallback;\n if (typeof align === 'number') return Math.max(-1, Math.min(1, align));\n switch (align) {\n case 'inside': return -1;\n case 'center': return 0;\n case 'outside': return 1;\n }\n return fallback;\n}\n\nexport type StrokeCap = 'butt' | 'round' | 'square';\n\n/** A shape one end of an open contour wears in place of a cap, sized by `capScale`: `arrow` is an open chevron, `triangle`/`stealth` filled heads with their tip on the path's end, `dot`/`box`/`diamond`/`bar` centred on it. */\nexport type StrokeMarker = 'arrow' | 'triangle' | 'stealth' | 'dot' | 'box' | 'diamond' | 'bar';\n\n/** What one end of an open contour wears: a cap, or a marker. */\nexport type StrokeEnd = StrokeCap | StrokeMarker;\n\n/** A marker's length as a multiple of the stroke's weight, where none is given. */\nexport const DEFAULT_CAP_SCALE = 4;\n\nexport function isStrokeMarker(end: StrokeEnd | undefined): end is StrokeMarker {\n switch (end) {\n case 'arrow':\n case 'triangle':\n case 'stealth':\n case 'dot':\n case 'box':\n case 'diamond':\n case 'bar': return true;\n }\n return false;\n}\n\nexport type StrokeJoin = 'miter' | 'round' | 'bevel';\n\nexport function resolveStrokeCap(cap: StrokeCap | undefined, fallback: StrokeCap): StrokeCap {\n if (cap == null) return fallback;\n switch (cap) {\n case 'butt':\n case 'round':\n case 'square': return cap;\n }\n return fallback;\n}\n\nexport function resolveStrokeEnd(end: StrokeEnd | undefined, fallback: StrokeCap): StrokeEnd {\n return isStrokeMarker(end) ? end : resolveStrokeCap(end, fallback);\n}\n\nexport function resolveStrokeJoin(join: StrokeJoin | undefined, fallback: StrokeJoin): StrokeJoin {\n if (join == null) return fallback;\n switch (join) {\n case 'miter':\n case 'round':\n case 'bevel': return join;\n }\n return fallback;\n}\n\nexport interface StrokeProp {\n weight?: number;\n /** Any loose fill: a CSS color string, fill prop object, resolved fill, or {@link FillChain}/array of layers. */\n fill?: Fill;\n /** Dash pattern. A single number `n` becomes `[n, n]`. */\n dash?: number | number[];\n dashOffset?: number;\n /** `'inside'` (-1), `'center'` (0), `'outside'` (1) or a number in [-1, 1]. Defaults to `'inside'`, so the stroke stays within the shape's measured bounds (like a CSS border). */\n align?: StrokeAlign;\n /** How the ends of each dash and of an open stroke are shaped (default `'butt'`); `startCap`/`endCap` override it at the path's two ends. */\n cap?: StrokeCap;\n /** The cap or marker at the start of each open contour, in place of `cap`. */\n startCap?: StrokeEnd;\n /** The cap or marker at the end of each open contour, in place of `cap`. */\n endCap?: StrokeEnd;\n /** A marker's length as a multiple of `weight` (default `4`) so a head keeps its proportion as the stroke thickens; on a short contour it shrinks to fit. */\n capScale?: number;\n /** How two segments meet at a corner (default `'miter'`). */\n join?: StrokeJoin;\n /** Maximum miter length to stroke width ratio before a `'miter'` join truncates to a bevel (default 4). */\n miterLimit?: number;\n}\n\n/** Fully resolved stroke: all fields normalised, defaults applied. */\nexport interface StrokeResolved {\n weight: number;\n fill: FillResolved[];\n dash?: number[];\n dashOffset: number;\n align: number;\n /** End-cap shape for dash ends, and for open strokes' ends unless overridden. */\n cap: StrokeCap;\n /** Absent means the end follows `cap`. */\n startCap?: StrokeEnd;\n endCap?: StrokeEnd;\n capScale: number;\n join: StrokeJoin;\n miterLimit: number;\n}\n\n/** Accepted shapes for a node's `stroke`: a loose {@link StrokeProp}, an array of them (stacked bottom-to-top), or already-resolved values, which pass through `resolveStroke` idempotently so a read-back `stroke` can be assigned straight back. */\nexport type Stroke =\n | StrokeProp\n | StrokeResolved\n | (StrokeProp | StrokeResolved)[];\n\nexport function resolveStroke(prop: StrokeProp, previous?: StrokeResolved): StrokeResolved {\n let dash: number[] | undefined;\n if (prop.dash != null) {\n const raw = Array.isArray(prop.dash) ? prop.dash : [prop.dash];\n dash = raw.length === 1 ? [raw[0], raw[0]] : raw;\n } else {\n dash = previous?.dash;\n }\n const cap = resolveStrokeCap(prop.cap, previous?.cap ?? 'butt');\n return {\n weight: prop.weight ?? previous?.weight ?? 1,\n fill: prop.fill != null ? fillOps.resolve(prop.fill) : (previous?.fill ?? fillOps.resolve('transparent')),\n dash,\n dashOffset: prop.dashOffset ?? previous?.dashOffset ?? 0,\n align: resolveStrokeAlign(prop.align, previous?.align ?? -1),\n cap,\n startCap: prop.startCap != null ? resolveStrokeEnd(prop.startCap, cap) : previous?.startCap,\n endCap: prop.endCap != null ? resolveStrokeEnd(prop.endCap, cap) : previous?.endCap,\n capScale: Math.max(0, prop.capScale ?? previous?.capScale ?? DEFAULT_CAP_SCALE),\n join: resolveStrokeJoin(prop.join, previous?.join ?? 'miter'),\n miterLimit: prop.miterLimit ?? previous?.miterLimit ?? 4,\n };\n}\n\nfunction lerpDashArray(from: number[] | undefined, to: number[] | undefined, t: number): number[] | undefined {\n const fArray = from || [];\n const tArray = to || [];\n if (fArray.length === 0 && tArray.length === 0) return from;\n\n const len = Math.max(fArray.length, tArray.length);\n const result: number[] = new Array(len);\n for (let i = 0; i < len; i++) {\n // Pad shorter arrays with 0 to ensure smooth transitions.\n const fVal = fArray[i] ?? 0;\n const tVal = tArray[i] ?? 0;\n result[i] = fVal + (tVal - fVal) * t;\n }\n return result;\n}\n\nfunction lerpStroke(from: StrokeResolved, to: StrokeResolved, t: number): StrokeResolved {\n return {\n weight: from.weight + (to.weight - from.weight) * t,\n fill: fillOps.lerp(from.fill, to.fill, t),\n dash: lerpDashArray(from.dash, to.dash, t) as number[],\n dashOffset: from.dashOffset + (to.dashOffset - from.dashOffset) * t,\n align: from.align + (to.align - from.align) * t,\n // cap/join are discrete enums — snap at the midpoint.\n cap: t < 0.5 ? from.cap : to.cap,\n startCap: t < 0.5 ? from.startCap : to.startCap,\n endCap: t < 0.5 ? from.endCap : to.endCap,\n capScale: from.capScale + (to.capScale - from.capScale) * t,\n join: t < 0.5 ? from.join : to.join,\n miterLimit: from.miterLimit + (to.miterLimit - from.miterLimit) * t,\n };\n}\n\nexport const strokeOps: AttributeOps<Stroke, StrokeResolved[]> = {\n resolve: (prop, previous) => {\n if (prop == null) return [];\n const arr = Array.isArray(prop) ? prop : [prop];\n return arr.map((p, i) => resolveStroke(p as StrokeProp, previous?.[i]));\n },\n lerp: (from, to, t) => {\n if (from === to) return from;\n const len = Math.max(from.length, to.length);\n const result: StrokeResolved[] = [];\n for (let i = 0; i < len; i++) {\n const f = from[i];\n const tf = to[i];\n if (!f) { result.push(tf); continue; }\n if (!tf) { result.push(f); continue; }\n result.push(lerpStroke(f, tf, t));\n }\n return result;\n },\n};\n"]}
@@ -1,13 +1,6 @@
1
1
  import type { LerpFunction } from "../../tween/lerp.js";
2
2
  import type { RectCornerRadius, CornerRadiusResolved } from "../../attributes/shape/corners/corner-radius.js";
3
- /**
4
- * The mapper + lerp pair behind every tweenable attribute: `resolve` turns loose
5
- * author input (a CSS string, a shorthand object, a previously-resolved value)
6
- * into the strict `TResolved` a renderer reads, and `lerp` interpolates between
7
- * two resolved values. This is the same pair `property`'s `mapper`/`tween`
8
- * options take — see `attributes/properties/typed.ts`, which builds each
9
- * `xProperty()` directly from one of these.
10
- */
3
+ /** The mapper + lerp pair behind every tweenable attribute: `resolve` turns loose author input (a CSS string, a shorthand object, a resolved value) into the strict `TResolved` a renderer reads, and `lerp` interpolates two resolved values. It is the pair `property`'s `mapper`/`tween` options take (see `attributes/properties/typed.ts`). */
11
4
  export interface AttributeOps<TInput, TResolved> {
12
5
  resolve(value: TInput, previous?: TResolved): TResolved;
13
6
  lerp: LerpFunction<TResolved>;
@@ -1 +1 @@
1
- {"version":3,"file":"operators.d.ts","sourceRoot":"","sources":["../../../src/attributes/shared/operators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAEvG;;;;;;;GAOG;AACH,MAAM,WAAW,YAAY,CAAC,MAAM,EAAE,SAAS;IAC3C,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IACxD,IAAI,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;CACjC;AAED,6FAA6F;AAC7F,MAAM,WAAW,eAAe,CAAC,MAAM,EAAE,CAAC;IACtC,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;IACvC,SAAS,CAAC,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC;CAChC;AAED,8DAA8D;AAC9D,MAAM,WAAW,YAAY,CAAC,SAAS;IACnC,MAAM,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC;CACrC;AAED,wFAAwF;AACxF,MAAM,MAAM,eAAe,GAAG,YAAY,CAAC,gBAAgB,EAAE,oBAAoB,CAAC,GAC5E,eAAe,CAAC,gBAAgB,EAAE,oBAAoB,CAAC,GACvD,YAAY,CAAC,oBAAoB,CAAC,CAAC"}
1
+ {"version":3,"file":"operators.d.ts","sourceRoot":"","sources":["../../../src/attributes/shared/operators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAEvG,oVAAoV;AACpV,MAAM,WAAW,YAAY,CAAC,MAAM,EAAE,SAAS;IAC3C,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IACxD,IAAI,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;CACjC;AAED,6FAA6F;AAC7F,MAAM,WAAW,eAAe,CAAC,MAAM,EAAE,CAAC;IACtC,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;IACvC,SAAS,CAAC,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC;CAChC;AAED,8DAA8D;AAC9D,MAAM,WAAW,YAAY,CAAC,SAAS;IACnC,MAAM,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC;CACrC;AAED,wFAAwF;AACxF,MAAM,MAAM,eAAe,GAAG,YAAY,CAAC,gBAAgB,EAAE,oBAAoB,CAAC,GAC5E,eAAe,CAAC,gBAAgB,EAAE,oBAAoB,CAAC,GACvD,YAAY,CAAC,oBAAoB,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"operators.js","sourceRoot":"","sources":["../../../src/attributes/shared/operators.ts"],"names":[],"mappings":"","sourcesContent":["import type { LerpFunction } from \"@/tween/lerp\";\nimport type { RectCornerRadius, CornerRadiusResolved } from \"@/attributes/shape/corners/corner-radius\";\n\n/**\n * The mapper + lerp pair behind every tweenable attribute: `resolve` turns loose\n * author input (a CSS string, a shorthand object, a previously-resolved value)\n * into the strict `TResolved` a renderer reads, and `lerp` interpolates between\n * two resolved values. This is the same pair `property`'s `mapper`/`tween`\n * options take — see `attributes/properties/typed.ts`, which builds each\n * `xProperty()` directly from one of these.\n */\nexport interface AttributeOps<TInput, TResolved> {\n resolve(value: TInput, previous?: TResolved): TResolved;\n lerp: LerpFunction<TResolved>;\n}\n\n/** An attribute whose resolved value can collapse to one value shared by every component. */\nexport interface HasUniformCheck<TInput, T> {\n isUniformInput(value: TInput): boolean;\n isUniform(value: T): boolean;\n}\n\n/** An attribute whose resolved value can be entirely zero. */\nexport interface HasZeroCheck<TResolved> {\n isZero(value: TResolved): boolean;\n}\n\n/** The corner-radius attribute's full op set — see `shape/corners/corner-radius.ts`. */\nexport type CornerRadiusOps = AttributeOps<RectCornerRadius, CornerRadiusResolved>\n & HasUniformCheck<RectCornerRadius, CornerRadiusResolved>\n & HasZeroCheck<CornerRadiusResolved>;\n"]}
1
+ {"version":3,"file":"operators.js","sourceRoot":"","sources":["../../../src/attributes/shared/operators.ts"],"names":[],"mappings":"","sourcesContent":["import type { LerpFunction } from \"@/tween/lerp\";\nimport type { RectCornerRadius, CornerRadiusResolved } from \"@/attributes/shape/corners/corner-radius\";\n\n/** The mapper + lerp pair behind every tweenable attribute: `resolve` turns loose author input (a CSS string, a shorthand object, a resolved value) into the strict `TResolved` a renderer reads, and `lerp` interpolates two resolved values. It is the pair `property`'s `mapper`/`tween` options take (see `attributes/properties/typed.ts`). */\nexport interface AttributeOps<TInput, TResolved> {\n resolve(value: TInput, previous?: TResolved): TResolved;\n lerp: LerpFunction<TResolved>;\n}\n\n/** An attribute whose resolved value can collapse to one value shared by every component. */\nexport interface HasUniformCheck<TInput, T> {\n isUniformInput(value: TInput): boolean;\n isUniform(value: T): boolean;\n}\n\n/** An attribute whose resolved value can be entirely zero. */\nexport interface HasZeroCheck<TResolved> {\n isZero(value: TResolved): boolean;\n}\n\n/** The corner-radius attribute's full op set — see `shape/corners/corner-radius.ts`. */\nexport type CornerRadiusOps = AttributeOps<RectCornerRadius, CornerRadiusResolved>\n & HasUniformCheck<RectCornerRadius, CornerRadiusResolved>\n & HasZeroCheck<CornerRadiusResolved>;\n"]}
@@ -1,14 +1,4 @@
1
- /**
2
- * The text attribute.
3
- *
4
- * One value — {@link textOps} — carries every operation on text and its style:
5
- * the string's typing lerp, the typography-preset lookup, the style merge both
6
- * text-default channels are built on, a whole style's resolve/lerp pair, and span
7
- * flattening. The free functions this used to export (`lerpText`,
8
- * `resolveTextStyleLeaf`, `lerpTextStyle`, `textStyleProps`,
9
- * `themeDefaultTextStyle`, `variantTextStyle`) are those methods now, and
10
- * `lerpPadding` was a second copy of `insetsOps.lerp`.
11
- */
1
+ /** The text attribute: one value, {@link textOps}, carries every operation on text and its style (typing lerp, typography-preset lookup, the style merge both text-default channels build on, a style's resolve/lerp pair, span flattening). */
12
2
  export { textOps, TEXT_STYLE_KEYS, TEXT_SHAPING_KEYS, EMPTY_TEXT_STYLE } from "./ops.js";
13
3
  export type * from "./types.js";
14
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/attributes/text/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AACtF,mBAAmB,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/attributes/text/index.ts"],"names":[],"mappings":"AAAA,gPAAgP;AAChP,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AACtF,mBAAmB,SAAS,CAAC"}
@@ -1,13 +1,3 @@
1
- /**
2
- * The text attribute.
3
- *
4
- * One value — {@link textOps} — carries every operation on text and its style:
5
- * the string's typing lerp, the typography-preset lookup, the style merge both
6
- * text-default channels are built on, a whole style's resolve/lerp pair, and span
7
- * flattening. The free functions this used to export (`lerpText`,
8
- * `resolveTextStyleLeaf`, `lerpTextStyle`, `textStyleProps`,
9
- * `themeDefaultTextStyle`, `variantTextStyle`) are those methods now, and
10
- * `lerpPadding` was a second copy of `insetsOps.lerp`.
11
- */
1
+ /** The text attribute: one value, {@link textOps}, carries every operation on text and its style (typing lerp, typography-preset lookup, the style merge both text-default channels build on, a style's resolve/lerp pair, span flattening). */
12
2
  export { textOps, TEXT_STYLE_KEYS, TEXT_SHAPING_KEYS, EMPTY_TEXT_STYLE } from "./ops.js";
13
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/attributes/text/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC","sourcesContent":["/**\n * The text attribute.\n *\n * One value — {@link textOps} — carries every operation on text and its style:\n * the string's typing lerp, the typography-preset lookup, the style merge both\n * text-default channels are built on, a whole style's resolve/lerp pair, and span\n * flattening. The free functions this used to export (`lerpText`,\n * `resolveTextStyleLeaf`, `lerpTextStyle`, `textStyleProps`,\n * `themeDefaultTextStyle`, `variantTextStyle`) are those methods now, and\n * `lerpPadding` was a second copy of `insetsOps.lerp`.\n */\nexport { textOps, TEXT_STYLE_KEYS, TEXT_SHAPING_KEYS, EMPTY_TEXT_STYLE } from \"./ops\";\nexport type * from \"./types\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/attributes/text/index.ts"],"names":[],"mappings":"AAAA,gPAAgP;AAChP,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC","sourcesContent":["/** The text attribute: one value, {@link textOps}, carries every operation on text and its style (typing lerp, typography-preset lookup, the style merge both text-default channels build on, a style's resolve/lerp pair, span flattening). */\nexport { textOps, TEXT_STYLE_KEYS, TEXT_SHAPING_KEYS, EMPTY_TEXT_STYLE } from \"./ops\";\nexport type * from \"./types\";\n"]}
@@ -1,29 +1,11 @@
1
- /**
2
- * Every text operation, on one object.
3
- *
4
- * `textOps` was already the text attribute's `resolve`/`lerp` pair; it now also
5
- * carries what a `TextStyle` needs — the preset lookup, the merge every
6
- * text-default channel is built on, a whole style's resolve/lerp pair — and span
7
- * flattening, the shape `pathOps` has.
8
- *
9
- * The two cascades built on these are deliberately not here. A node's
10
- * (`applyTextDefaults`) lives beside `DefaultTextStyle` and a drawn op's
11
- * (`applyGraphicsTextDefaults`) beside `draw()`: each belongs to its channel, not
12
- * to the style.
13
- */
1
+ /** Every text operation on one object: `textOps` carries the attribute's `resolve`/`lerp` plus what a `TextStyle` needs (preset lookup, merge, a style's resolve/lerp pair) and span flattening. The two defaults cascades (`applyTextDefaults` beside `DefaultTextStyle`, `applyGraphicsTextDefaults` beside `draw()`) belong to their channels, not here. */
14
2
  import type { AttributeOps } from "../../attributes/shared/operators.js";
15
3
  import type { ResolvedTextSpan, TextCase, TextSpan, TextStyle } from "./types.js";
16
- /** Every key a {@link TextStyle} can set. */
17
4
  export declare const TEXT_STYLE_KEYS: readonly ["fontFamily", "fontSize", "fontWeight", "fontStyle", "letterSpacing", "lineHeight", "textAlign", "fill", "stroke", "shadow"];
18
- /**
19
- * The keys a drawn `text`/`richText` op can inherit. `fill`/`stroke`/`shadow` are
20
- * absent because in a `Graphics2D` they are group-scoped ops, not per-shape
21
- * slots: defaulting one would change which shapes the group's paint covers.
22
- */
5
+ /** Keys a drawn `text`/`richText` op can inherit; `fill`/`stroke`/`shadow` are absent because in a `Graphics2D` they are group-scoped ops, and defaulting one would change which shapes the group's paint covers. */
23
6
  export declare const TEXT_SHAPING_KEYS: readonly ["fontFamily", "fontSize", "fontWeight", "fontStyle", "letterSpacing", "lineHeight", "textAlign"];
24
7
  /** A style that sets nothing. Frozen and shared, so the empty case allocates nothing. */
25
8
  export declare const EMPTY_TEXT_STYLE: TextStyle;
26
- /** The text attribute's operations beyond `resolve`/`lerp`. */
27
9
  export interface TextOps {
28
10
  /** A `theme.typography` preset (case-insensitive), or {@link EMPTY_TEXT_STYLE} when none is registered. */
29
11
  preset(name: string): TextStyle;
@@ -31,11 +13,7 @@ export interface TextOps {
31
13
  mergeStyle(base: TextStyle, over: TextStyle | undefined): TextStyle;
32
14
  /** `style ?? previous` per field, paints resolved. Idempotent, like every mapper. */
33
15
  resolveStyle(style: TextStyle | undefined, previous: TextStyle): TextStyle;
34
- /**
35
- * Interpolate two font sizes. `'autofit'` is a mode, not a magnitude, so it
36
- * steps at the midpoint; two numbers interpolate. The rule {@link lerpStyle}
37
- * applies to its `fontSize`, for a node's own `fontSize` property to share.
38
- */
16
+ /** Interpolates two font sizes; `'autofit'` is a mode, not a magnitude, so it steps at the midpoint. */
39
17
  lerpFontSize(a: number | "autofit" | undefined, b: number | "autofit" | undefined, t: number): number | "autofit" | undefined;
40
18
  /** Interpolate two resolved styles; categorical and one-sided fields step at the midpoint. */
41
19
  lerpStyle(from: TextStyle, to: TextStyle, t: number): TextStyle;
@@ -43,11 +21,7 @@ export interface TextOps {
43
21
  styleProps(style: TextStyle): Record<string, unknown>;
44
22
  /** A span tree flattened against `base`: its text-bearing spans, in document order. */
45
23
  flatten(spans: readonly TextSpan[], base: Omit<ResolvedTextSpan, "text">): ResolvedTextSpan[];
46
- /**
47
- * `text` recased, **at its own length**: a character whose case mapping
48
- * would add characters (`ß` → `SS`) keeps its own form, because run offsets,
49
- * selections and caret slots all index the string as typed.
50
- */
24
+ /** `text` recased **at its own length**: a character whose mapping would add characters (`ß` → `SS`) keeps its own form, since run offsets, selections and caret slots index the string as typed. */
51
25
  applyCase(text: string, textCase: TextCase): string;
52
26
  }
53
27
  export declare const textOps: AttributeOps<string, string> & TextOps;
@@ -1 +1 @@
1
- {"version":3,"file":"ops.d.ts","sourceRoot":"","sources":["../../../src/attributes/text/ops.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAOlE,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAkB,QAAQ,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAE/F,6CAA6C;AAC7C,eAAO,MAAM,eAAe,wIAGqB,CAAC;AAElD;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,4GAGgB,CAAC;AAE/C,yFAAyF;AACzF,eAAO,MAAM,gBAAgB,EAAE,SAA6B,CAAC;AAG7D,+DAA+D;AAC/D,MAAM,WAAW,OAAO;IAEpB,2GAA2G;IAC3G,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,8FAA8F;IAC9F,UAAU,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;IACpE,qFAAqF;IACrF,YAAY,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,EAAE,QAAQ,EAAE,SAAS,GAAG,SAAS,CAAC;IAC3E;;;;OAIG;IACH,YAAY,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;IAC9H,8FAA8F;IAC9F,SAAS,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChE,sGAAsG;IACtG,UAAU,CAAC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SAAS,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;IAC9H,8FAA8F;IAC9F,SAAS,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChE,sGAAsG;IACtG,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEtD,uFAAuF;IACvF,OAAO,CAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,GAAG,gBAAgB,EAAE,CAAC;IAE9F,qMAAqM;IACrM,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAAC;CACvD;AAGD,eAAO,MAAM,OAAO,EAAE,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAepD,CAAC"}
@@ -3,16 +3,11 @@ import { getTypographyPreset } from "../../attributes/shape/fill/color/parser.js
3
3
  import { strokeOps } from "../../attributes/shape/stroke/stroke.js";
4
4
  import { shadowOps } from "../../attributes/shape/shadow/shadow.js";
5
5
  import { lerpNumber } from "../../tween/lerp.js";
6
- /** Every key a {@link TextStyle} can set. */
7
6
  export const TEXT_STYLE_KEYS = [
8
7
  'fontFamily', 'fontSize', 'fontWeight', 'fontStyle',
9
8
  'letterSpacing', 'lineHeight', 'textAlign', 'fill', 'stroke', 'shadow',
10
9
  ];
11
- /**
12
- * The keys a drawn `text`/`richText` op can inherit. `fill`/`stroke`/`shadow` are
13
- * absent because in a `Graphics2D` they are group-scoped ops, not per-shape
14
- * slots: defaulting one would change which shapes the group's paint covers.
15
- */
10
+ /** Keys a drawn `text`/`richText` op can inherit; `fill`/`stroke`/`shadow` are absent because in a `Graphics2D` they are group-scoped ops, and defaulting one would change which shapes the group's paint covers. */
16
11
  export const TEXT_SHAPING_KEYS = [
17
12
  'fontFamily', 'fontSize', 'fontWeight', 'fontStyle',
18
13
  'letterSpacing', 'lineHeight', 'textAlign',
@@ -32,10 +27,7 @@ export const textOps = {
32
27
  flatten,
33
28
  applyCase,
34
29
  };
35
- /**
36
- * Types and untypes: the common prefix and suffix hold still while `from`'s
37
- * differing middle shrinks away and `to`'s grows in.
38
- */
30
+ /** Types and untypes: the common prefix and suffix hold still while `from`'s differing middle shrinks away and `to`'s grows in. */
39
31
  function lerp(from, to, t) {
40
32
  if (t <= 0)
41
33
  return from;
@@ -109,19 +101,11 @@ function lerpStyle(from, to, t) {
109
101
  shadow: shadowOps.lerp(from.shadow, to.shadow, t),
110
102
  };
111
103
  }
112
- // Spread onto a node, an `undefined` key is stored as a value rather than read as
113
- // unset, so unset keys are dropped. The base is a fresh object per call because
114
- // `mergeStyle` returns it as-is when `style` sets nothing, and a frozen
115
- // `EMPTY_TEXT_STYLE` would then be handed out as props.
116
- //
117
- // `fontFamily` is dropped along with the rest rather than backfilled from
118
- // `hostTextFamily()`. Writing it here turned the *component's* own theme into an
119
- // author-set prop, and `applyTextDefaults` skips every key the props already
120
- // carry — so a chart axis reached the renderer holding the host family, or `""`
121
- // when no host had declared one, and the document's `<DefaultTextStyle>` and
122
- // `theme.typography.default` never got a look in. Leaving it unset puts a
123
- // component's text on the same cascade as an author's, with the host family
124
- // where it belongs: last, in `requireFontFamily`.
104
+ // An `undefined` key spread onto a node is stored as a value, so unset keys are dropped. The base is a fresh object per
105
+ // call because `mergeStyle` returns it as-is when `style` sets nothing, and the frozen `EMPTY_TEXT_STYLE` would be handed
106
+ // out as props. `fontFamily` is deliberately not backfilled from `hostTextFamily()`: that would make the component's own
107
+ // theme an author-set prop, and `applyTextDefaults` skips keys the props already carry, so `<DefaultTextStyle>` and
108
+ // `theme.typography.default` would never be consulted. Unset, the host family stays last, in `requireFontFamily`.
125
109
  function styleProps(style) {
126
110
  return mergeStyle({}, style);
127
111
  }
@@ -1 +1 @@
1
- {"version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C,CAAC;QACvF,MAAM,MAAM,GAAG,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACxF,GAAG,IAAI,MAAM,CAAC,MAAM,KAAK,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;QACjD,IAAI,GAAG,EAAE,CAAC;IACd,CAAC;IACD,OAAO,GAAG,CAAC;AACf,CAAC;AAED,0CAA0C;AAC1C,SAAS,YAAY,CACjB,CAAiC,EACjC,CAAiC,EACjC,CAAS;IAET,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,KAAK,QAAQ;QAAE,OAAO,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC/E,OAAO,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3B,CAAC;AAED,iGAAiG;AACjG,SAAS,kBAAkB,CAAC,CAAqB,EAAE,CAAqB,EAAE,CAAS;IAC/E,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,IAAI;QAAE,OAAO,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACnD,OAAO,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAC/B,CAAC","sourcesContent":["/**\n * Every text operation, on one object.\n *\n * `textOps` was already the text attribute's `resolve`/`lerp` pair; it now also\n * carries what a `TextStyle` needs — the preset lookup, the merge every\n * text-default channel is built on, a whole style's resolve/lerp pair — and span\n * flattening, the shape `pathOps` has.\n *\n * The two cascades built on these are deliberately not here. A node's\n * (`applyTextDefaults`) lives beside `DefaultTextStyle` and a drawn op's\n * (`applyGraphicsTextDefaults`) beside `draw()`: each belongs to its channel, not\n * to the style.\n */\nimport type { AttributeOps } from \"@/attributes/shared/operators\";\nimport { fillOps } from \"@/attributes/shape/fill/registry\";\nimport type { FillResolved } from \"@/attributes/shape/fill/union\";\nimport { getTypographyPreset } from \"@/attributes/shape/fill/color/parser\";\nimport { strokeOps, type StrokeResolved } from \"@/attributes/shape/stroke/stroke\";\nimport { shadowOps, type ShadowResolved } from \"@/attributes/shape/shadow/shadow\";\nimport { lerpNumber } from \"@/tween/lerp\";\nimport type { ResolvedTextSpan, TextCase, TextShapingKey, TextSpan, TextStyle } from \"./types\";\n\n/** Every key a {@link TextStyle} can set. */\nexport const TEXT_STYLE_KEYS = [\n 'fontFamily', 'fontSize', 'fontWeight', 'fontStyle',\n 'letterSpacing', 'lineHeight', 'textAlign', 'fill', 'stroke', 'shadow',\n] as const satisfies readonly (keyof TextStyle)[];\n\n/**\n * The keys a drawn `text`/`richText` op can inherit. `fill`/`stroke`/`shadow` are\n * absent because in a `Graphics2D` they are group-scoped ops, not per-shape\n * slots: defaulting one would change which shapes the group's paint covers.\n */\nexport const TEXT_SHAPING_KEYS = [\n 'fontFamily', 'fontSize', 'fontWeight', 'fontStyle',\n 'letterSpacing', 'lineHeight', 'textAlign',\n] as const satisfies readonly TextShapingKey[];\n\n/** A style that sets nothing. Frozen and shared, so the empty case allocates nothing. */\nexport const EMPTY_TEXT_STYLE: TextStyle = Object.freeze({});\n\n\n/** The text attribute's operations beyond `resolve`/`lerp`. */\nexport interface TextOps {\n // ── Styles ─────────────────────────────────────────────────────────────\n /** A `theme.typography` preset (case-insensitive), or {@link EMPTY_TEXT_STYLE} when none is registered. */\n preset(name: string): TextStyle;\n /** The keys `over` sets, laid onto `base`. Returns `base` itself when `over` sets nothing. */\n mergeStyle(base: TextStyle, over: TextStyle | undefined): TextStyle;\n /** `style ?? previous` per field, paints resolved. Idempotent, like every mapper. */\n resolveStyle(style: TextStyle | undefined, previous: TextStyle): TextStyle;\n /**\n * Interpolate two font sizes. `'autofit'` is a mode, not a magnitude, so it\n * steps at the midpoint; two numbers interpolate. The rule {@link lerpStyle}\n * applies to its `fontSize`, for a node's own `fontSize` property to share.\n */\n lerpFontSize(a: number | \"autofit\" | undefined, b: number | \"autofit\" | undefined, t: number): number | \"autofit\" | undefined;\n /** Interpolate two resolved styles; categorical and one-sided fields step at the midpoint. */\n lerpStyle(from: TextStyle, to: TextStyle, t: number): TextStyle;\n /** A style as `Text` constructor props: unset keys dropped, the family falling back to the host's. */\n styleProps(style: TextStyle): Record<string, unknown>;\n\n // ── Spans ──────────────────────────────────────────────────────────────\n /** A span tree flattened against `base`: its text-bearing spans, in document order. */\n flatten(spans: readonly TextSpan[], base: Omit<ResolvedTextSpan, \"text\">): ResolvedTextSpan[];\n\n // ── Case ───────────────────────────────────────────────────────────────\n /**\n * `text` recased, **at its own length**: a character whose case mapping\n * would add characters (`ß` → `SS`) keeps its own form, because run offsets,\n * selections and caret slots all index the string as typed.\n */\n applyCase(text: string, textCase: TextCase): string;\n}\n\n\nexport const textOps: AttributeOps<string, string> & TextOps = {\n // A string needs no normalization.\n resolve: (value) => value,\n lerp,\n\n preset,\n mergeStyle,\n resolveStyle,\n lerpStyle,\n lerpFontSize,\n styleProps,\n\n flatten,\n\n applyCase,\n};\n\n\n/**\n * Types and untypes: the common prefix and suffix hold still while `from`'s\n * differing middle shrinks away and `to`'s grows in.\n */\nfunction lerp(from: string, to: string, t: number): string {\n if (t <= 0) return from;\n if (t >= 1) return to;\n\n let pre = 0;\n const maxPre = Math.min(from.length, to.length);\n while (pre < maxPre && from.charCodeAt(pre) === to.charCodeAt(pre)) pre++;\n\n let suf = 0;\n const maxSuf = Math.min(from.length - pre, to.length - pre);\n while (\n suf < maxSuf &&\n from.charCodeAt(from.length - 1 - suf) === to.charCodeAt(to.length - 1 - suf)\n ) suf++;\n\n const removeLen = from.length - pre - suf;\n const addLen = to.length - pre - suf;\n const totalLen = removeLen + addLen;\n if (totalLen === 0) return to;\n\n const prefix = from.substring(0, pre);\n const suffix = from.substring(from.length - suf);\n const split = removeLen / totalLen;\n\n if (t < split) {\n const localT = split === 0 ? 1 : t / split;\n const midLen = Math.round(removeLen * (1 - localT));\n return prefix + from.substring(pre, pre + midLen) + suffix;\n }\n const localT = split === 1 ? 1 : (t - split) / (1 - split);\n const midLen = Math.round(addLen * localT);\n return prefix + to.substring(pre, pre + midLen) + suffix;\n}\n\n// Read per call rather than cached, so a `setTheme` between frames needs no invalidation.\nfunction preset(name: string): TextStyle {\n return (getTypographyPreset(name) as TextStyle | undefined) ?? EMPTY_TEXT_STYLE;\n}\n\nfunction mergeStyle(base: TextStyle, over: TextStyle | undefined): TextStyle {\n let out: Record<string, unknown> | null = null;\n for (const key of TEXT_STYLE_KEYS) {\n const value = over?.[key];\n if (value !== undefined) (out ??= { ...base })[key] = value;\n }\n return (out as TextStyle | null) ?? base;\n}\n\nfunction resolveStyle(style: TextStyle | undefined, previous: TextStyle): TextStyle {\n const s = style ?? {};\n return {\n fontFamily: s.fontFamily ?? previous.fontFamily,\n fontSize: s.fontSize ?? previous.fontSize,\n fontWeight: s.fontWeight ?? previous.fontWeight,\n fontStyle: s.fontStyle ?? previous.fontStyle,\n letterSpacing: s.letterSpacing ?? previous.letterSpacing,\n lineHeight: s.lineHeight ?? previous.lineHeight,\n textAlign: s.textAlign ?? previous.textAlign,\n fill: fillOps.resolve(s.fill ?? previous.fill ?? []),\n stroke: strokeOps.resolve(s.stroke ?? previous.stroke ?? []),\n shadow: shadowOps.resolve(s.shadow ?? previous.shadow ?? []),\n };\n}\n\nfunction lerpStyle(from: TextStyle, to: TextStyle, t: number): TextStyle {\n return {\n fontFamily: t < 0.5 ? from.fontFamily : to.fontFamily,\n fontSize: lerpFontSize(from.fontSize, to.fontSize, t),\n fontWeight: lerpOptionalNumber(from.fontWeight, to.fontWeight, t),\n fontStyle: t < 0.5 ? from.fontStyle : to.fontStyle,\n letterSpacing: lerpOptionalNumber(from.letterSpacing, to.letterSpacing, t),\n lineHeight: lerpOptionalNumber(from.lineHeight, to.lineHeight, t),\n textAlign: t < 0.5 ? from.textAlign : to.textAlign,\n fill: fillOps.lerp(from.fill as FillResolved[], to.fill as FillResolved[], t),\n stroke: strokeOps.lerp(from.stroke as StrokeResolved[], to.stroke as StrokeResolved[], t),\n shadow: shadowOps.lerp(from.shadow as ShadowResolved[], to.shadow as ShadowResolved[], t),\n };\n}\n\n// Spread onto a node, an `undefined` key is stored as a value rather than read as\n// unset, so unset keys are dropped. The base is a fresh object per call because\n// `mergeStyle` returns it as-is when `style` sets nothing, and a frozen\n// `EMPTY_TEXT_STYLE` would then be handed out as props.\n//\n// `fontFamily` is dropped along with the rest rather than backfilled from\n// `hostTextFamily()`. Writing it here turned the *component's* own theme into an\n// author-set prop, and `applyTextDefaults` skips every key the props already\n// carry — so a chart axis reached the renderer holding the host family, or `\"\"`\n// when no host had declared one, and the document's `<DefaultTextStyle>` and\n// `theme.typography.default` never got a look in. Leaving it unset puts a\n// component's text on the same cascade as an author's, with the host family\n// where it belongs: last, in `requireFontFamily`.\nfunction styleProps(style: TextStyle): Record<string, unknown> {\n return mergeStyle({}, style) as Record<string, unknown>;\n}\n\nfunction flatten(spans: readonly TextSpan[], base: Omit<ResolvedTextSpan, \"text\">): ResolvedTextSpan[] {\n const out: ResolvedTextSpan[] = [];\n const walk = (span: TextSpan, inherited: Omit<ResolvedTextSpan, \"text\">): void => {\n const merged = {\n fontFamily: span.fontFamily ?? inherited.fontFamily,\n fontSize: span.fontSize ?? inherited.fontSize,\n fontWeight: span.fontWeight ?? inherited.fontWeight,\n fontStyle: span.fontStyle ?? inherited.fontStyle,\n letterSpacing: span.letterSpacing ?? inherited.letterSpacing,\n fill: span.fill != null ? fillOps.resolve(span.fill) : inherited.fill,\n stroke: span.stroke != null ? strokeOps.resolve(span.stroke) : inherited.stroke,\n };\n if (span.text) out.push({ text: span.text, ...merged });\n for (const child of span.children ?? []) walk(child, merged);\n };\n for (const span of spans) walk(span, base);\n return out;\n}\n\n// A letter, digit or apostrophe continues a word, so `don't` and `3rd` keep\n// their second halves as typed while `well-known` becomes `Well-Known`.\nconst WORD_CHAR = /[\\p{L}\\p{N}'\\u2019]/u;\n\nfunction applyCase(text: string, textCase: TextCase): string {\n if (textCase !== 'upper' && textCase !== 'lower' && textCase !== 'title') return text;\n let out = \"\";\n let prev = \"\";\n for (const ch of text) {\n const recase = textCase === 'upper' || (textCase === 'title' && !WORD_CHAR.test(prev));\n const mapped = textCase === 'lower' ? ch.toLowerCase() : recase ? ch.toUpperCase() : ch;\n out += mapped.length === ch.length ? mapped : ch;\n prev = ch;\n }\n return out;\n}\n\n// `\"autofit\"` is a mode, not a magnitude.\nfunction lerpFontSize(\n a: number | \"autofit\" | undefined,\n b: number | \"autofit\" | undefined,\n t: number,\n): number | \"autofit\" | undefined {\n if (typeof a === \"number\" && typeof b === \"number\") return lerpNumber(a, b, t);\n return t < 0.5 ? a : b;\n}\n\n// Defaulting the missing side to 0 would animate a weight down to nothing on its way to \"unset\".\nfunction lerpOptionalNumber(a: number | undefined, b: number | undefined, t: number): number | undefined {\n if (a == null || b == null) return t < 0.5 ? a : b;\n return lerpNumber(a, b, t);\n}\n"]}
1
+ {"version":3,"file":"ops.js","sourceRoot":"","sources":["../../../src/attributes/text/ops.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAE3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAuB,MAAM,kCAAkC,CAAC;AAClF,OAAO,EAAE,SAAS,EAAuB,MAAM,kCAAkC,CAAC;AAClF,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,MAAM,CAAC,MAAM,eAAe,GAAG;IAC3B,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW;IACnD,eAAe,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ;CACzB,CAA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C,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3B,CAAC;AAED,iGAAiG;AACjG,SAAS,kBAAkB,CAAC,CAAqB,EAAE,CAAqB,EAAE,CAAS;IAC/E,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,IAAI;QAAE,OAAO,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACnD,OAAO,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAC/B,CAAC","sourcesContent":["/** Every text operation on one object: `textOps` carries the attribute's `resolve`/`lerp` plus what a `TextStyle` needs (preset lookup, merge, a style's resolve/lerp pair) and span flattening. The two defaults cascades (`applyTextDefaults` beside `DefaultTextStyle`, `applyGraphicsTextDefaults` beside `draw()`) belong to their channels, not here. */\nimport type { AttributeOps } from \"@/attributes/shared/operators\";\nimport { fillOps } from \"@/attributes/shape/fill/registry\";\nimport type { FillResolved } from \"@/attributes/shape/fill/union\";\nimport { getTypographyPreset } from \"@/attributes/shape/fill/color/parser\";\nimport { strokeOps, type StrokeResolved } from \"@/attributes/shape/stroke/stroke\";\nimport { shadowOps, type ShadowResolved } from \"@/attributes/shape/shadow/shadow\";\nimport { lerpNumber } from \"@/tween/lerp\";\nimport type { ResolvedTextSpan, TextCase, TextShapingKey, TextSpan, TextStyle } from \"./types\";\n\nexport const TEXT_STYLE_KEYS = [\n 'fontFamily', 'fontSize', 'fontWeight', 'fontStyle',\n 'letterSpacing', 'lineHeight', 'textAlign', 'fill', 'stroke', 'shadow',\n] as const satisfies readonly (keyof TextStyle)[];\n\n/** Keys a drawn `text`/`richText` op can inherit; `fill`/`stroke`/`shadow` are absent because in a `Graphics2D` they are group-scoped ops, and defaulting one would change which shapes the group's paint covers. */\nexport const TEXT_SHAPING_KEYS = [\n 'fontFamily', 'fontSize', 'fontWeight', 'fontStyle',\n 'letterSpacing', 'lineHeight', 'textAlign',\n] as const satisfies readonly TextShapingKey[];\n\n/** A style that sets nothing. Frozen and shared, so the empty case allocates nothing. */\nexport const EMPTY_TEXT_STYLE: TextStyle = Object.freeze({});\n\n\nexport interface TextOps {\n /** A `theme.typography` preset (case-insensitive), or {@link EMPTY_TEXT_STYLE} when none is registered. */\n preset(name: string): TextStyle;\n /** The keys `over` sets, laid onto `base`. Returns `base` itself when `over` sets nothing. */\n mergeStyle(base: TextStyle, over: TextStyle | undefined): TextStyle;\n /** `style ?? previous` per field, paints resolved. Idempotent, like every mapper. */\n resolveStyle(style: TextStyle | undefined, previous: TextStyle): TextStyle;\n /** Interpolates two font sizes; `'autofit'` is a mode, not a magnitude, so it steps at the midpoint. */\n lerpFontSize(a: number | \"autofit\" | undefined, b: number | \"autofit\" | undefined, t: number): number | \"autofit\" | undefined;\n /** Interpolate two resolved styles; categorical and one-sided fields step at the midpoint. */\n lerpStyle(from: TextStyle, to: TextStyle, t: number): TextStyle;\n /** A style as `Text` constructor props: unset keys dropped, the family falling back to the host's. */\n styleProps(style: TextStyle): Record<string, unknown>;\n\n /** A span tree flattened against `base`: its text-bearing spans, in document order. */\n flatten(spans: readonly TextSpan[], base: Omit<ResolvedTextSpan, \"text\">): ResolvedTextSpan[];\n\n /** `text` recased **at its own length**: a character whose mapping would add characters (`ß` → `SS`) keeps its own form, since run offsets, selections and caret slots index the string as typed. */\n applyCase(text: string, textCase: TextCase): string;\n}\n\n\nexport const textOps: AttributeOps<string, string> & TextOps = {\n // A string needs no normalization.\n resolve: (value) => value,\n lerp,\n\n preset,\n mergeStyle,\n resolveStyle,\n lerpStyle,\n lerpFontSize,\n styleProps,\n\n flatten,\n\n applyCase,\n};\n\n\n/** Types and untypes: the common prefix and suffix hold still while `from`'s differing middle shrinks away and `to`'s grows in. */\nfunction lerp(from: string, to: string, t: number): string {\n if (t <= 0) return from;\n if (t >= 1) return to;\n\n let pre = 0;\n const maxPre = Math.min(from.length, to.length);\n while (pre < maxPre && from.charCodeAt(pre) === to.charCodeAt(pre)) pre++;\n\n let suf = 0;\n const maxSuf = Math.min(from.length - pre, to.length - pre);\n while (\n suf < maxSuf &&\n from.charCodeAt(from.length - 1 - suf) === to.charCodeAt(to.length - 1 - suf)\n ) suf++;\n\n const removeLen = from.length - pre - suf;\n const addLen = to.length - pre - suf;\n const totalLen = removeLen + addLen;\n if (totalLen === 0) return to;\n\n const prefix = from.substring(0, pre);\n const suffix = from.substring(from.length - suf);\n const split = removeLen / totalLen;\n\n if (t < split) {\n const localT = split === 0 ? 1 : t / split;\n const midLen = Math.round(removeLen * (1 - localT));\n return prefix + from.substring(pre, pre + midLen) + suffix;\n }\n const localT = split === 1 ? 1 : (t - split) / (1 - split);\n const midLen = Math.round(addLen * localT);\n return prefix + to.substring(pre, pre + midLen) + suffix;\n}\n\n// Read per call rather than cached, so a `setTheme` between frames needs no invalidation.\nfunction preset(name: string): TextStyle {\n return (getTypographyPreset(name) as TextStyle | undefined) ?? EMPTY_TEXT_STYLE;\n}\n\nfunction mergeStyle(base: TextStyle, over: TextStyle | undefined): TextStyle {\n let out: Record<string, unknown> | null = null;\n for (const key of TEXT_STYLE_KEYS) {\n const value = over?.[key];\n if (value !== undefined) (out ??= { ...base })[key] = value;\n }\n return (out as TextStyle | null) ?? base;\n}\n\nfunction resolveStyle(style: TextStyle | undefined, previous: TextStyle): TextStyle {\n const s = style ?? {};\n return {\n fontFamily: s.fontFamily ?? previous.fontFamily,\n fontSize: s.fontSize ?? previous.fontSize,\n fontWeight: s.fontWeight ?? previous.fontWeight,\n fontStyle: s.fontStyle ?? previous.fontStyle,\n letterSpacing: s.letterSpacing ?? previous.letterSpacing,\n lineHeight: s.lineHeight ?? previous.lineHeight,\n textAlign: s.textAlign ?? previous.textAlign,\n fill: fillOps.resolve(s.fill ?? previous.fill ?? []),\n stroke: strokeOps.resolve(s.stroke ?? previous.stroke ?? []),\n shadow: shadowOps.resolve(s.shadow ?? previous.shadow ?? []),\n };\n}\n\nfunction lerpStyle(from: TextStyle, to: TextStyle, t: number): TextStyle {\n return {\n fontFamily: t < 0.5 ? from.fontFamily : to.fontFamily,\n fontSize: lerpFontSize(from.fontSize, to.fontSize, t),\n fontWeight: lerpOptionalNumber(from.fontWeight, to.fontWeight, t),\n fontStyle: t < 0.5 ? from.fontStyle : to.fontStyle,\n letterSpacing: lerpOptionalNumber(from.letterSpacing, to.letterSpacing, t),\n lineHeight: lerpOptionalNumber(from.lineHeight, to.lineHeight, t),\n textAlign: t < 0.5 ? from.textAlign : to.textAlign,\n fill: fillOps.lerp(from.fill as FillResolved[], to.fill as FillResolved[], t),\n stroke: strokeOps.lerp(from.stroke as StrokeResolved[], to.stroke as StrokeResolved[], t),\n shadow: shadowOps.lerp(from.shadow as ShadowResolved[], to.shadow as ShadowResolved[], t),\n };\n}\n\n// An `undefined` key spread onto a node is stored as a value, so unset keys are dropped. The base is a fresh object per\n// call because `mergeStyle` returns it as-is when `style` sets nothing, and the frozen `EMPTY_TEXT_STYLE` would be handed\n// out as props. `fontFamily` is deliberately not backfilled from `hostTextFamily()`: that would make the component's own\n// theme an author-set prop, and `applyTextDefaults` skips keys the props already carry, so `<DefaultTextStyle>` and\n// `theme.typography.default` would never be consulted. Unset, the host family stays last, in `requireFontFamily`.\nfunction styleProps(style: TextStyle): Record<string, unknown> {\n return mergeStyle({}, style) as Record<string, unknown>;\n}\n\nfunction flatten(spans: readonly TextSpan[], base: Omit<ResolvedTextSpan, \"text\">): ResolvedTextSpan[] {\n const out: ResolvedTextSpan[] = [];\n const walk = (span: TextSpan, inherited: Omit<ResolvedTextSpan, \"text\">): void => {\n const merged = {\n fontFamily: span.fontFamily ?? inherited.fontFamily,\n fontSize: span.fontSize ?? inherited.fontSize,\n fontWeight: span.fontWeight ?? inherited.fontWeight,\n fontStyle: span.fontStyle ?? inherited.fontStyle,\n letterSpacing: span.letterSpacing ?? inherited.letterSpacing,\n fill: span.fill != null ? fillOps.resolve(span.fill) : inherited.fill,\n stroke: span.stroke != null ? strokeOps.resolve(span.stroke) : inherited.stroke,\n };\n if (span.text) out.push({ text: span.text, ...merged });\n for (const child of span.children ?? []) walk(child, merged);\n };\n for (const span of spans) walk(span, base);\n return out;\n}\n\n// A letter, digit or apostrophe continues a word, so `don't` and `3rd` keep\n// their second halves as typed while `well-known` becomes `Well-Known`.\nconst WORD_CHAR = /[\\p{L}\\p{N}'\\u2019]/u;\n\nfunction applyCase(text: string, textCase: TextCase): string {\n if (textCase !== 'upper' && textCase !== 'lower' && textCase !== 'title') return text;\n let out = \"\";\n let prev = \"\";\n for (const ch of text) {\n const recase = textCase === 'upper' || (textCase === 'title' && !WORD_CHAR.test(prev));\n const mapped = textCase === 'lower' ? ch.toLowerCase() : recase ? ch.toUpperCase() : ch;\n out += mapped.length === ch.length ? mapped : ch;\n prev = ch;\n }\n return out;\n}\n\n// `\"autofit\"` is a mode, not a magnitude.\nfunction lerpFontSize(\n a: number | \"autofit\" | undefined,\n b: number | \"autofit\" | undefined,\n t: number,\n): number | \"autofit\" | undefined {\n if (typeof a === \"number\" && typeof b === \"number\") return lerpNumber(a, b, t);\n return t < 0.5 ? a : b;\n}\n\n// Defaulting the missing side to 0 would animate a weight down to nothing on its way to \"unset\".\nfunction lerpOptionalNumber(a: number | undefined, b: number | undefined, t: number): number | undefined {\n if (a == null || b == null) return t < 0.5 ? a : b;\n return lerpNumber(a, b, t);\n}\n"]}