@sophistry/core 0.0.0-stage → 0.0.1

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 (396) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +27 -2
  3. package/dist/anim/animation.d.ts +208 -0
  4. package/dist/anim/animation.d.ts.map +1 -0
  5. package/dist/anim/draw.d.ts +109 -0
  6. package/dist/anim/draw.d.ts.map +1 -0
  7. package/dist/anim/emphasis.d.ts +94 -0
  8. package/dist/anim/emphasis.d.ts.map +1 -0
  9. package/dist/anim/fade.d.ts +83 -0
  10. package/dist/anim/fade.d.ts.map +1 -0
  11. package/dist/anim/growing.d.ts +93 -0
  12. package/dist/anim/growing.d.ts.map +1 -0
  13. package/dist/anim/index.d.ts +33 -0
  14. package/dist/anim/index.d.ts.map +1 -0
  15. package/dist/anim/indication.d.ts +158 -0
  16. package/dist/anim/indication.d.ts.map +1 -0
  17. package/dist/anim/move.d.ts +124 -0
  18. package/dist/anim/move.d.ts.map +1 -0
  19. package/dist/anim/movement.d.ts +115 -0
  20. package/dist/anim/movement.d.ts.map +1 -0
  21. package/dist/anim/points.d.ts +25 -0
  22. package/dist/anim/points.d.ts.map +1 -0
  23. package/dist/anim/sequence.d.ts +136 -0
  24. package/dist/anim/sequence.d.ts.map +1 -0
  25. package/dist/anim/slots.d.ts +304 -0
  26. package/dist/anim/slots.d.ts.map +1 -0
  27. package/dist/anim/speed.d.ts +44 -0
  28. package/dist/anim/speed.d.ts.map +1 -0
  29. package/dist/anim/spring.d.ts +147 -0
  30. package/dist/anim/spring.d.ts.map +1 -0
  31. package/dist/anim/timeline.d.ts +210 -0
  32. package/dist/anim/timeline.d.ts.map +1 -0
  33. package/dist/anim/transform.d.ts +93 -0
  34. package/dist/anim/transform.d.ts.map +1 -0
  35. package/dist/anim/tween.d.ts +93 -0
  36. package/dist/anim/tween.d.ts.map +1 -0
  37. package/dist/anim/types.d.ts +114 -0
  38. package/dist/anim/types.d.ts.map +1 -0
  39. package/dist/color/convert.d.ts +147 -0
  40. package/dist/color/convert.d.ts.map +1 -0
  41. package/dist/color/index.d.ts +14 -0
  42. package/dist/color/index.d.ts.map +1 -0
  43. package/dist/color/named.d.ts +128 -0
  44. package/dist/color/named.d.ts.map +1 -0
  45. package/dist/color/ops.d.ts +96 -0
  46. package/dist/color/ops.d.ts.map +1 -0
  47. package/dist/color/parse.d.ts +83 -0
  48. package/dist/color/parse.d.ts.map +1 -0
  49. package/dist/color/random.d.ts +47 -0
  50. package/dist/color/random.d.ts.map +1 -0
  51. package/dist/color/types.d.ts +39 -0
  52. package/dist/color/types.d.ts.map +1 -0
  53. package/dist/color-CV6uMtjS.js +44 -0
  54. package/dist/colormap-BExuU8VP.js +463 -0
  55. package/dist/coords/axes.d.ts +173 -0
  56. package/dist/coords/axes.d.ts.map +1 -0
  57. package/dist/coords/axis-composition.d.ts +120 -0
  58. package/dist/coords/axis-composition.d.ts.map +1 -0
  59. package/dist/coords/axis-labels.d.ts +127 -0
  60. package/dist/coords/axis-labels.d.ts.map +1 -0
  61. package/dist/coords/complex-plane.d.ts +95 -0
  62. package/dist/coords/complex-plane.d.ts.map +1 -0
  63. package/dist/coords/coords.d.ts +337 -0
  64. package/dist/coords/coords.d.ts.map +1 -0
  65. package/dist/coords/function-graph.d.ts +291 -0
  66. package/dist/coords/function-graph.d.ts.map +1 -0
  67. package/dist/coords/graph-annotations.d.ts +356 -0
  68. package/dist/coords/graph-annotations.d.ts.map +1 -0
  69. package/dist/coords/grid-lines.d.ts +127 -0
  70. package/dist/coords/grid-lines.d.ts.map +1 -0
  71. package/dist/coords/implicit-function.d.ts +51 -0
  72. package/dist/coords/implicit-function.d.ts.map +1 -0
  73. package/dist/coords/index.d.ts +29 -0
  74. package/dist/coords/index.d.ts.map +1 -0
  75. package/dist/coords/linear-transform.d.ts +205 -0
  76. package/dist/coords/linear-transform.d.ts.map +1 -0
  77. package/dist/coords/number-line.d.ts +212 -0
  78. package/dist/coords/number-line.d.ts.map +1 -0
  79. package/dist/coords/number-plane.d.ts +112 -0
  80. package/dist/coords/number-plane.d.ts.map +1 -0
  81. package/dist/coords/polar-plane.d.ts +173 -0
  82. package/dist/coords/polar-plane.d.ts.map +1 -0
  83. package/dist/coords/tangent.d.ts +74 -0
  84. package/dist/coords/tangent.d.ts.map +1 -0
  85. package/dist/coords/vector-field.d.ts +319 -0
  86. package/dist/coords/vector-field.d.ts.map +1 -0
  87. package/dist/entries/color.d.ts +31 -0
  88. package/dist/entries/color.d.ts.map +1 -0
  89. package/dist/entries/color.js +3 -0
  90. package/dist/entries/definitions.d.ts +73 -0
  91. package/dist/entries/definitions.d.ts.map +1 -0
  92. package/dist/entries/definitions.js +14 -0
  93. package/dist/entries/geometry.d.ts +60 -0
  94. package/dist/entries/geometry.d.ts.map +1 -0
  95. package/dist/entries/geometry.js +393 -0
  96. package/dist/entries/internal.d.ts +56 -0
  97. package/dist/entries/internal.d.ts.map +1 -0
  98. package/dist/entries/internal.js +190 -0
  99. package/dist/entries/themes.d.ts +38 -0
  100. package/dist/entries/themes.d.ts.map +1 -0
  101. package/dist/entries/themes.js +4 -0
  102. package/dist/export/frames.d.ts +171 -0
  103. package/dist/export/frames.d.ts.map +1 -0
  104. package/dist/export/index.d.ts +6 -0
  105. package/dist/export/index.d.ts.map +1 -0
  106. package/dist/geometry/arc.d.ts +300 -0
  107. package/dist/geometry/arc.d.ts.map +1 -0
  108. package/dist/geometry/band.d.ts +137 -0
  109. package/dist/geometry/band.d.ts.map +1 -0
  110. package/dist/geometry/bounds.d.ts +107 -0
  111. package/dist/geometry/bounds.d.ts.map +1 -0
  112. package/dist/geometry/brace.d.ts +62 -0
  113. package/dist/geometry/brace.d.ts.map +1 -0
  114. package/dist/geometry/complex.d.ts +22 -0
  115. package/dist/geometry/complex.d.ts.map +1 -0
  116. package/dist/geometry/curves.d.ts +127 -0
  117. package/dist/geometry/curves.d.ts.map +1 -0
  118. package/dist/geometry/delaunay.d.ts +18 -0
  119. package/dist/geometry/delaunay.d.ts.map +1 -0
  120. package/dist/geometry/field.d.ts +94 -0
  121. package/dist/geometry/field.d.ts.map +1 -0
  122. package/dist/geometry/graph-layout.d.ts +322 -0
  123. package/dist/geometry/graph-layout.d.ts.map +1 -0
  124. package/dist/geometry/implicit.d.ts +74 -0
  125. package/dist/geometry/implicit.d.ts.map +1 -0
  126. package/dist/geometry/index.d.ts +42 -0
  127. package/dist/geometry/index.d.ts.map +1 -0
  128. package/dist/geometry/lerp.d.ts +175 -0
  129. package/dist/geometry/lerp.d.ts.map +1 -0
  130. package/dist/geometry/morph.d.ts +170 -0
  131. package/dist/geometry/morph.d.ts.map +1 -0
  132. package/dist/geometry/num.d.ts +177 -0
  133. package/dist/geometry/num.d.ts.map +1 -0
  134. package/dist/geometry/path/arclength.d.ts +165 -0
  135. package/dist/geometry/path/arclength.d.ts.map +1 -0
  136. package/dist/geometry/path/cubic.d.ts +113 -0
  137. package/dist/geometry/path/cubic.d.ts.map +1 -0
  138. package/dist/geometry/path/outline-reveal.d.ts +49 -0
  139. package/dist/geometry/path/outline-reveal.d.ts.map +1 -0
  140. package/dist/geometry/path/svg-path.d.ts +89 -0
  141. package/dist/geometry/path/svg-path.d.ts.map +1 -0
  142. package/dist/geometry/path/types.d.ts +80 -0
  143. package/dist/geometry/path/types.d.ts.map +1 -0
  144. package/dist/geometry/resolver.d.ts +46 -0
  145. package/dist/geometry/resolver.d.ts.map +1 -0
  146. package/dist/geometry/scale/range-transition.d.ts +115 -0
  147. package/dist/geometry/scale/range-transition.d.ts.map +1 -0
  148. package/dist/geometry/scale/scales.d.ts +280 -0
  149. package/dist/geometry/scale/scales.d.ts.map +1 -0
  150. package/dist/geometry/scale/tick-format.d.ts +150 -0
  151. package/dist/geometry/scale/tick-format.d.ts.map +1 -0
  152. package/dist/geometry/scale/ticks.d.ts +151 -0
  153. package/dist/geometry/scale/ticks.d.ts.map +1 -0
  154. package/dist/geometry/shape-match.d.ts +158 -0
  155. package/dist/geometry/shape-match.d.ts.map +1 -0
  156. package/dist/geometry/shapes.d.ts +164 -0
  157. package/dist/geometry/shapes.d.ts.map +1 -0
  158. package/dist/geometry/stitch.d.ts +41 -0
  159. package/dist/geometry/stitch.d.ts.map +1 -0
  160. package/dist/geometry/time.d.ts +176 -0
  161. package/dist/geometry/time.d.ts.map +1 -0
  162. package/dist/geometry/tips.d.ts +57 -0
  163. package/dist/geometry/tips.d.ts.map +1 -0
  164. package/dist/geometry/transform.d.ts +246 -0
  165. package/dist/geometry/transform.d.ts.map +1 -0
  166. package/dist/geometry/view-matrix.d.ts +60 -0
  167. package/dist/geometry/view-matrix.d.ts.map +1 -0
  168. package/dist/geometry/write-phase.d.ts +51 -0
  169. package/dist/geometry/write-phase.d.ts.map +1 -0
  170. package/dist/geometry3d/camera.d.ts +145 -0
  171. package/dist/geometry3d/camera.d.ts.map +1 -0
  172. package/dist/geometry3d/index.d.ts +5 -0
  173. package/dist/geometry3d/index.d.ts.map +1 -0
  174. package/dist/geometry3d/mat.d.ts +73 -0
  175. package/dist/geometry3d/mat.d.ts.map +1 -0
  176. package/dist/implicit-DtDJLCJr.js +886 -0
  177. package/dist/index.d.ts +42 -0
  178. package/dist/index.d.ts.map +1 -0
  179. package/dist/index.js +8 -0
  180. package/dist/interact/constrain.d.ts +271 -0
  181. package/dist/interact/constrain.d.ts.map +1 -0
  182. package/dist/interact/drag.d.ts +160 -0
  183. package/dist/interact/drag.d.ts.map +1 -0
  184. package/dist/interact/drop.d.ts +72 -0
  185. package/dist/interact/drop.d.ts.map +1 -0
  186. package/dist/interact/hit.d.ts +199 -0
  187. package/dist/interact/hit.d.ts.map +1 -0
  188. package/dist/interact/index.d.ts +18 -0
  189. package/dist/interact/index.d.ts.map +1 -0
  190. package/dist/interact/item-order.d.ts +36 -0
  191. package/dist/interact/item-order.d.ts.map +1 -0
  192. package/dist/interact/param.d.ts +97 -0
  193. package/dist/interact/param.d.ts.map +1 -0
  194. package/dist/interact/pick-items.d.ts +34 -0
  195. package/dist/interact/pick-items.d.ts.map +1 -0
  196. package/dist/interact/pointer.d.ts +72 -0
  197. package/dist/interact/pointer.d.ts.map +1 -0
  198. package/dist/interact/registry.d.ts +64 -0
  199. package/dist/interact/registry.d.ts.map +1 -0
  200. package/dist/interact/slop.d.ts +10 -0
  201. package/dist/interact/slop.d.ts.map +1 -0
  202. package/dist/interact/types.d.ts +419 -0
  203. package/dist/interact/types.d.ts.map +1 -0
  204. package/dist/labels/decimal-number.d.ts +327 -0
  205. package/dist/labels/decimal-number.d.ts.map +1 -0
  206. package/dist/labels/digits.d.ts +157 -0
  207. package/dist/labels/digits.d.ts.map +1 -0
  208. package/dist/labels/index.d.ts +11 -0
  209. package/dist/labels/index.d.ts.map +1 -0
  210. package/dist/labels/paragraph.d.ts +314 -0
  211. package/dist/labels/paragraph.d.ts.map +1 -0
  212. package/dist/labels/text-layout.d.ts +75 -0
  213. package/dist/labels/text-layout.d.ts.map +1 -0
  214. package/dist/network/index.d.ts +6 -0
  215. package/dist/network/index.d.ts.map +1 -0
  216. package/dist/network/network-graph.d.ts +315 -0
  217. package/dist/network/network-graph.d.ts.map +1 -0
  218. package/dist/reactive/index.d.ts +3 -0
  219. package/dist/reactive/index.d.ts.map +1 -0
  220. package/dist/reactive/track.d.ts +119 -0
  221. package/dist/reactive/track.d.ts.map +1 -0
  222. package/dist/render/a11y.d.ts +153 -0
  223. package/dist/render/a11y.d.ts.map +1 -0
  224. package/dist/render/camera-gesture.d.ts +56 -0
  225. package/dist/render/camera-gesture.d.ts.map +1 -0
  226. package/dist/render/camera.d.ts +148 -0
  227. package/dist/render/camera.d.ts.map +1 -0
  228. package/dist/render/canvas-renderer.d.ts +244 -0
  229. package/dist/render/canvas-renderer.d.ts.map +1 -0
  230. package/dist/render/index.d.ts +16 -0
  231. package/dist/render/index.d.ts.map +1 -0
  232. package/dist/render/layer-cache.d.ts +68 -0
  233. package/dist/render/layer-cache.d.ts.map +1 -0
  234. package/dist/render/paint-items.d.ts +70 -0
  235. package/dist/render/paint-items.d.ts.map +1 -0
  236. package/dist/render/paint.d.ts +114 -0
  237. package/dist/render/paint.d.ts.map +1 -0
  238. package/dist/render/pointer-core.d.ts +60 -0
  239. package/dist/render/pointer-core.d.ts.map +1 -0
  240. package/dist/render/pointer-drop.d.ts +24 -0
  241. package/dist/render/pointer-drop.d.ts.map +1 -0
  242. package/dist/render/pointer-gestures.d.ts +51 -0
  243. package/dist/render/pointer-gestures.d.ts.map +1 -0
  244. package/dist/render/pointer-presence.d.ts +36 -0
  245. package/dist/render/pointer-presence.d.ts.map +1 -0
  246. package/dist/render/pointer-wheel.d.ts +28 -0
  247. package/dist/render/pointer-wheel.d.ts.map +1 -0
  248. package/dist/render/pointer.d.ts +259 -0
  249. package/dist/render/pointer.d.ts.map +1 -0
  250. package/dist/resolver-qY_MwSeI.js +21 -0
  251. package/dist/scene/cameras.d.ts +284 -0
  252. package/dist/scene/cameras.d.ts.map +1 -0
  253. package/dist/scene/composite.d.ts +210 -0
  254. package/dist/scene/composite.d.ts.map +1 -0
  255. package/dist/scene/container.d.ts +62 -0
  256. package/dist/scene/container.d.ts.map +1 -0
  257. package/dist/scene/context.d.ts +109 -0
  258. package/dist/scene/context.d.ts.map +1 -0
  259. package/dist/scene/fonts.d.ts +87 -0
  260. package/dist/scene/fonts.d.ts.map +1 -0
  261. package/dist/scene/graph.d.ts +175 -0
  262. package/dist/scene/graph.d.ts.map +1 -0
  263. package/dist/scene/group.d.ts +116 -0
  264. package/dist/scene/group.d.ts.map +1 -0
  265. package/dist/scene/index.d.ts +33 -0
  266. package/dist/scene/index.d.ts.map +1 -0
  267. package/dist/scene/instance-bank.d.ts +349 -0
  268. package/dist/scene/instance-bank.d.ts.map +1 -0
  269. package/dist/scene/instance-marks.d.ts +165 -0
  270. package/dist/scene/instance-marks.d.ts.map +1 -0
  271. package/dist/scene/instance-node.d.ts +205 -0
  272. package/dist/scene/instance-node.d.ts.map +1 -0
  273. package/dist/scene/instances.d.ts +245 -0
  274. package/dist/scene/instances.d.ts.map +1 -0
  275. package/dist/scene/interaction-group-context.d.ts +47 -0
  276. package/dist/scene/interaction-group-context.d.ts.map +1 -0
  277. package/dist/scene/interaction-group.d.ts +73 -0
  278. package/dist/scene/interaction-group.d.ts.map +1 -0
  279. package/dist/scene/interaction-props.d.ts +30 -0
  280. package/dist/scene/interaction-props.d.ts.map +1 -0
  281. package/dist/scene/interaction.d.ts +62 -0
  282. package/dist/scene/interaction.d.ts.map +1 -0
  283. package/dist/scene/marks.d.ts +271 -0
  284. package/dist/scene/marks.d.ts.map +1 -0
  285. package/dist/scene/node.d.ts +245 -0
  286. package/dist/scene/node.d.ts.map +1 -0
  287. package/dist/scene/pan-zoom.d.ts +187 -0
  288. package/dist/scene/pan-zoom.d.ts.map +1 -0
  289. package/dist/scene/path-batch.d.ts +210 -0
  290. package/dist/scene/path-batch.d.ts.map +1 -0
  291. package/dist/scene/primitive.d.ts +128 -0
  292. package/dist/scene/primitive.d.ts.map +1 -0
  293. package/dist/scene/scene.d.ts +416 -0
  294. package/dist/scene/scene.d.ts.map +1 -0
  295. package/dist/scene/shape.d.ts +377 -0
  296. package/dist/scene/shape.d.ts.map +1 -0
  297. package/dist/scene/text.d.ts +231 -0
  298. package/dist/scene/text.d.ts.map +1 -0
  299. package/dist/scene/types.d.ts +346 -0
  300. package/dist/scene/types.d.ts.map +1 -0
  301. package/dist/scene-B92FTpdT.js +8795 -0
  302. package/dist/shape-match-ByhMD-8z.js +2255 -0
  303. package/dist/shapes/angle.d.ts +136 -0
  304. package/dist/shapes/angle.d.ts.map +1 -0
  305. package/dist/shapes/animated-boundary.d.ts +79 -0
  306. package/dist/shapes/animated-boundary.d.ts.map +1 -0
  307. package/dist/shapes/arc.d.ts +170 -0
  308. package/dist/shapes/arc.d.ts.map +1 -0
  309. package/dist/shapes/bezier.d.ts +73 -0
  310. package/dist/shapes/bezier.d.ts.map +1 -0
  311. package/dist/shapes/brace.d.ts +103 -0
  312. package/dist/shapes/brace.d.ts.map +1 -0
  313. package/dist/shapes/circle.d.ts +70 -0
  314. package/dist/shapes/circle.d.ts.map +1 -0
  315. package/dist/shapes/dot.d.ts +208 -0
  316. package/dist/shapes/dot.d.ts.map +1 -0
  317. package/dist/shapes/forward.d.ts +55 -0
  318. package/dist/shapes/forward.d.ts.map +1 -0
  319. package/dist/shapes/index.d.ts +34 -0
  320. package/dist/shapes/index.d.ts.map +1 -0
  321. package/dist/shapes/line.d.ts +277 -0
  322. package/dist/shapes/line.d.ts.map +1 -0
  323. package/dist/shapes/matchers.d.ts +175 -0
  324. package/dist/shapes/matchers.d.ts.map +1 -0
  325. package/dist/shapes/path.d.ts +93 -0
  326. package/dist/shapes/path.d.ts.map +1 -0
  327. package/dist/shapes/polygon.d.ts +46 -0
  328. package/dist/shapes/polygon.d.ts.map +1 -0
  329. package/dist/shapes/polygram.d.ts +119 -0
  330. package/dist/shapes/polygram.d.ts.map +1 -0
  331. package/dist/shapes/rect.d.ts +67 -0
  332. package/dist/shapes/rect.d.ts.map +1 -0
  333. package/dist/shapes/traced-path.d.ts +77 -0
  334. package/dist/shapes/traced-path.d.ts.map +1 -0
  335. package/dist/shapes/transform-matching-shapes.d.ts +66 -0
  336. package/dist/shapes/transform-matching-shapes.d.ts.map +1 -0
  337. package/dist/spec/bake.d.ts +486 -0
  338. package/dist/spec/bake.d.ts.map +1 -0
  339. package/dist/spec/clip.d.ts +88 -0
  340. package/dist/spec/clip.d.ts.map +1 -0
  341. package/dist/spec/colorRampProp.d.ts +24 -0
  342. package/dist/spec/colorRampProp.d.ts.map +1 -0
  343. package/dist/spec/compile.d.ts +29 -0
  344. package/dist/spec/compile.d.ts.map +1 -0
  345. package/dist/spec/gradient.d.ts +210 -0
  346. package/dist/spec/gradient.d.ts.map +1 -0
  347. package/dist/spec/index.d.ts +15 -0
  348. package/dist/spec/index.d.ts.map +1 -0
  349. package/dist/spec/layout.d.ts +288 -0
  350. package/dist/spec/layout.d.ts.map +1 -0
  351. package/dist/spec/metrics.d.ts +105 -0
  352. package/dist/spec/metrics.d.ts.map +1 -0
  353. package/dist/spec/types.d.ts +507 -0
  354. package/dist/spec/types.d.ts.map +1 -0
  355. package/dist/src-Dfi1aXsz.js +6551 -0
  356. package/dist/theme-DEP9bZB3.js +347 -0
  357. package/dist/themes/catppuccin.d.ts +59 -0
  358. package/dist/themes/catppuccin.d.ts.map +1 -0
  359. package/dist/themes/colormap.d.ts +80 -0
  360. package/dist/themes/colormap.d.ts.map +1 -0
  361. package/dist/themes/css.d.ts +51 -0
  362. package/dist/themes/css.d.ts.map +1 -0
  363. package/dist/themes/index.d.ts +18 -0
  364. package/dist/themes/index.d.ts.map +1 -0
  365. package/dist/themes/mode.d.ts +168 -0
  366. package/dist/themes/mode.d.ts.map +1 -0
  367. package/dist/themes/palette.d.ts +93 -0
  368. package/dist/themes/palette.d.ts.map +1 -0
  369. package/dist/themes/ramp.d.ts +51 -0
  370. package/dist/themes/ramp.d.ts.map +1 -0
  371. package/dist/themes/theme.d.ts +43 -0
  372. package/dist/themes/theme.d.ts.map +1 -0
  373. package/dist/themes/types.d.ts +191 -0
  374. package/dist/themes/types.d.ts.map +1 -0
  375. package/dist/themes-CBBPL7u9.js +24 -0
  376. package/dist/tween/clock.d.ts +146 -0
  377. package/dist/tween/clock.d.ts.map +1 -0
  378. package/dist/tween/easing.d.ts +161 -0
  379. package/dist/tween/easing.d.ts.map +1 -0
  380. package/dist/tween/frame-loop.d.ts +168 -0
  381. package/dist/tween/frame-loop.d.ts.map +1 -0
  382. package/dist/tween/index.d.ts +20 -0
  383. package/dist/tween/index.d.ts.map +1 -0
  384. package/dist/tween/interpolate.d.ts +14 -0
  385. package/dist/tween/interpolate.d.ts.map +1 -0
  386. package/dist/tween/interpolators.d.ts +145 -0
  387. package/dist/tween/interpolators.d.ts.map +1 -0
  388. package/dist/tween/reduced-motion.d.ts +50 -0
  389. package/dist/tween/reduced-motion.d.ts.map +1 -0
  390. package/dist/tween/spring.d.ts +276 -0
  391. package/dist/tween/spring.d.ts.map +1 -0
  392. package/dist/tween/target.d.ts +93 -0
  393. package/dist/tween/target.d.ts.map +1 -0
  394. package/dist/tween/track.d.ts +39 -0
  395. package/dist/tween/track.d.ts.map +1 -0
  396. package/package.json +87 -3
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Benjamin Lucier
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,28 @@
1
- # Temporary Holding Version
1
+ # @sophistry/core
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Framework-free animation and visualization engine: a retained scene graph, tracks, seekable animations, geometry, themes and a Canvas2D renderer. Pair it with a binding ([`@sophistry/solidjs`](../solidjs) or [`@sophistry/react`](../react)).
4
+
5
+ Part of [sophistry](https://sophistry.dev), controllable Manim for the web. Pre-1.0: minor releases may break.
6
+
7
+ ## Install
8
+
9
+ ```sh
10
+ pnpm add @sophistry/core
11
+ ```
12
+
13
+ ## Example
14
+
15
+ ```ts
16
+ import { circle, createScene, draw, track } from "@sophistry/core";
17
+
18
+ const scene = createScene({ host: document.getElementById("stage") as HTMLElement });
19
+ const drawn = track(0);
20
+ scene.root.add(circle.create({ radius: 2, progress: drawn }));
21
+ void scene.play(draw(drawn, { duration: 1.5 }));
22
+ ```
23
+
24
+ Subpaths: `/geometry`, `/color`, `/themes` (pure helpers) and the unstable `/internal`.
25
+
26
+ ## Links
27
+
28
+ [Documentation](https://sophistry.dev) · [API](https://sophistry.dev/reference/api/) · [Source](https://github.com/BenjaminLucier/sophistry/tree/main/packages/core) · MIT
@@ -0,0 +1,208 @@
1
+ /**
2
+ * The animation model: an `Animation` is data plus a sampler with a known
3
+ * duration, not a running process. A runner (`timeline.ts`) samples the whole
4
+ * script at one absolute time per clock step, which keeps composition exact and
5
+ * makes fast-forward and scrubbing work. No canvas, no clock here.
6
+ */
7
+ import type { Easing } from "../tween/easing";
8
+ /**
9
+ * Floating-point slack, in seconds, when comparing absolute times. Child
10
+ * offsets are sums of floats (`0.1 + 0.2`), so a child that "should" be exactly
11
+ * finished can land a few ulps short; without slack its last frame would be
12
+ * left at 0.99999999 of the way.
13
+ */
14
+ export declare const EPSILON = 1e-9;
15
+ /**
16
+ * A lazy, seekable animation with a known length. Nothing runs when you build
17
+ * one; a runner ({@link timeline}, {@link play}) samples it. Implement the
18
+ * members only for a custom leaf (see {@link animation}).
19
+ *
20
+ * `seek(t)` writes the state for local time `t` and must not depend on what
21
+ * time was seen before. Composites restore children that are now ahead of the
22
+ * seek time to their start ({@link Animation.restore}), and write later
23
+ * children over earlier ones. {@link Animation.begin} runs the first time a
24
+ * child is entered, seeing the world as of its own start time, so relative
25
+ * animations capture what the previous step left; restoring does not re-arm.
26
+ * `repeat` and `forever` re-enter each cycle.
27
+ *
28
+ * @see {@link https://sophistry.dev/guides/timelines/#what-seeking-does}
29
+ * @see {@link https://sophistry.dev/guides/extending/#custom-animations}
30
+ * @category Animation composition & timelines
31
+ */
32
+ export interface Animation {
33
+ /**
34
+ * Length in seconds of timeline time, including any leading `delay`.
35
+ * `Infinity` is allowed (`forever`); a runner then never finishes on its own.
36
+ */
37
+ readonly duration: number;
38
+ /**
39
+ * The local time a reduced-motion run jumps to instead of playing: the
40
+ * state the animation comes to rest in. Defaults to {@link
41
+ * Animation.duration} when that is finite and to `0` when it is infinite
42
+ * (an endless loop holds its starting state). {@link compose} derives it
43
+ * from its children, so `sequence(fadeIn(a), forever(spin(b)))` rests at
44
+ * the end of the fade with the spin held at its start.
45
+ */
46
+ readonly restAt?: number;
47
+ /**
48
+ * Called when the animation is armed: the first time it is entered, and
49
+ * again for each fresh run (a new `repeat` cycle, a `timeline` replay).
50
+ * Capture start values here, with `peek()`.
51
+ * It is **not** called again when the animation is merely re-entered after
52
+ * a {@link Animation.restore}; the earlier capture stays valid.
53
+ */
54
+ begin?(): void;
55
+ /**
56
+ * Writes the state for local time `t` (clamped to `[0, duration]` by the
57
+ * composites and by {@link animation}).
58
+ */
59
+ seek(t: number): void;
60
+ /**
61
+ * Optional: writes the start state (what `seek(0)` would write for a leaf
62
+ * with no leading hold) **and keeps whatever {@link Animation.begin}
63
+ * captured**. Composites call it instead of `seek(0)` when a scrub rewinds
64
+ * to before the animation's start, and then skip `begin()` on re-entry. It
65
+ * matters for zero-length leaves (whose `seek` can only report the final
66
+ * value) and for `from`-style leaves (whose start state would otherwise be
67
+ * mistaken for the rest value). Does nothing if the animation was never
68
+ * entered. When omitted, composites fall back to `seek(0)` and re-arm the
69
+ * animation with `begin()` on re-entry (the pre-`restore` behaviour).
70
+ */
71
+ restore?(): void;
72
+ /**
73
+ * Optional cleanup when the run is aborted while this animation is active
74
+ * (entered but not finished). The grow presets use it to snap back to rest.
75
+ * Presets that simply stop where they stand leave it undefined.
76
+ */
77
+ abort?(): void;
78
+ }
79
+ /** The time a reduced-motion run of `animation` jumps to; see {@link Animation.restAt}. */
80
+ export declare function restTime(animation: Animation): number;
81
+ /**
82
+ * Normalises a requested seek time into `[0, duration]`, always finite.
83
+ *
84
+ * `NaN` and `-Infinity` mean the start (`0`); a finite or `+Infinity` time is
85
+ * clamped to `duration`. `+Infinity` on an *endless* animation has no end to
86
+ * land on, so it lands on `rest` (the reduced-motion rest state, finite by
87
+ * construction). Every `seek` path goes through this so a non-finite time can
88
+ * never reach arithmetic like `Infinity - Infinity`.
89
+ */
90
+ export declare function sampleTime(t: number, duration: number, rest?: number): number;
91
+ /**
92
+ * Builds a custom leaf {@link Animation}.
93
+ *
94
+ * `seek` always receives a time clamped to `[0, duration]`, and `duration` is
95
+ * sanitised (negative or NaN becomes 0; `Infinity` is allowed). Use it for
96
+ * anything the track-driving builders ({@link driveTrack}, {@link driveProgress})
97
+ * do not cover.
98
+ *
99
+ * @param spec - The members of {@link Animation}.
100
+ * @returns The animation.
101
+ * @category Animation composition & timelines
102
+ */
103
+ export declare function animation(spec: Animation): Animation;
104
+ /** Timing common to every eased leaf. */
105
+ export interface LeafTiming {
106
+ /**
107
+ * Seconds of eased motion; 0 lands immediately.
108
+ * @default 1
109
+ */
110
+ duration?: number;
111
+ /**
112
+ * Seconds of leading hold inside the animation's own duration.
113
+ * @default 0
114
+ */
115
+ delay?: number;
116
+ /**
117
+ * Easing curve name or function.
118
+ * @default `"smooth"`
119
+ */
120
+ easing?: Easing;
121
+ }
122
+ /** What an eased leaf does at each sampled progress. */
123
+ export interface LeafHooks {
124
+ /** Capture start values (via `peek`). */
125
+ begin?: () => void;
126
+ /**
127
+ * Write state for eased progress `eased` (raw progress `raw`, uneased,
128
+ * 0..1).
129
+ */
130
+ apply: (eased: number, raw: number) => void;
131
+ /** Cleanup when aborted while active. Only called if the leaf has begun. */
132
+ abort?: () => void;
133
+ /**
134
+ * Write the start state (progress 0) for the whole leading `delay` too,
135
+ * instead of staying silent until the delay ends. The grow presets use it
136
+ * so a delayed grow is hidden during its delay. Without it a delaying leaf
137
+ * does not touch the track until the delay is over (so it cannot clobber a
138
+ * concurrent animation of the same track), except to restore the start
139
+ * when it is rewound.
140
+ */
141
+ holdStart?: boolean;
142
+ }
143
+ /**
144
+ * The shared eased leaf: `[delay][duration of eased progress]`.
145
+ *
146
+ * Handles delay, zero-length animations (a zero-length `seek` reports only the
147
+ * final value; {@link Animation.restore} writes the start), easing, and lazy
148
+ * `begin` so a leaf can be seeked directly in a test without a composite
149
+ * around it.
150
+ */
151
+ export declare function easedLeaf(timing: LeafTiming, hooks: LeafHooks): Animation;
152
+ /** A child placed at an offset inside a composite. */
153
+ export interface Placed {
154
+ animation: Animation;
155
+ /** Seconds after the composite's start at which the child begins. */
156
+ start: number;
157
+ }
158
+ /**
159
+ * Builds a composite from children placed at known offsets. `sequence`,
160
+ * `parallel` and `lagged` are all this with different offsets.
161
+ *
162
+ * Duration is `max(start + child.duration)`. See {@link Animation} for the
163
+ * seek semantics it implements.
164
+ *
165
+ * A steady-state seek costs O(active children + log n), not O(n): children
166
+ * are indexed by start and by end time, the active ones are kept in a list,
167
+ * and only a seek that moves *backwards* visits the children it crosses.
168
+ * The bookkeeping rests on two invariants that hold after every seek to
169
+ * `last`: a child that has been entered started at or before `last`, and a
170
+ * finished (DONE) child ended at or before `last`. So a forward seek can only
171
+ * enter children starting in `(last, now]`, and a backward one can only
172
+ * rewind children starting in `(now, last]` or reopen ones ending there.
173
+ */
174
+ export declare function compose(children: Placed[]): Animation;
175
+ /**
176
+ * Where each cycle of a `repeat`/`forever` takes its start values from.
177
+ *
178
+ * - `"continue"`: from wherever the previous cycle left the tracks (the
179
+ * default). Relative animations accumulate.
180
+ * - `"fixed"`: from one capture taken when the repeat is first entered; every
181
+ * cycle restarts from it. Scrubbing is exact in both directions.
182
+ *
183
+ * @category Animation composition & timelines
184
+ */
185
+ export type CycleStart = "continue" | "fixed";
186
+ /**
187
+ * Plays `inner` `times` times; the engine behind `repeat` and `forever`.
188
+ *
189
+ * Each cycle re-enters `inner`, so it captures its start values afresh from
190
+ * wherever the previous cycle left the tracks (a `forever` of
191
+ * `sequence(valueTo(a, 2), valueTo(a, 0))` loops without a jump, and a
192
+ * repeated relative move accumulates). A seek that jumps over cycles finishes
193
+ * each skipped cycle in turn so those captures are right (at most
194
+ * {@link MAX_REPLAYED_CYCLES} are replayed; older ones are skipped).
195
+ *
196
+ * Scrubbing *backwards* across a cycle boundary re-samples the earlier cycle
197
+ * with the start values captured for the most recent cycle, because the
198
+ * earlier capture is gone: exact for absolute animations, an offset for
199
+ * relative ones that accumulate.
200
+ *
201
+ * With `start: "fixed"` the animation is entered once and every cycle replays
202
+ * from that one capture (each new cycle first restores the start state, it
203
+ * does not recapture). Relative animations then repeat the same move instead
204
+ * of accumulating, and because no cycle depends on a previous one, a seek
205
+ * anywhere, in either direction, is exact.
206
+ */
207
+ export declare function cycles(inner: Animation, times: number, start?: CycleStart): Animation;
208
+ //# sourceMappingURL=animation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"animation.d.ts","sourceRoot":"","sources":["../../src/anim/animation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAG9C;;;;;GAKG;AACH,eAAO,MAAM,OAAO,OAAO,CAAC;AAE5B;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,SAAS;IACzB;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B;;;;;;;OAOG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB;;;;;;OAMG;IACH,KAAK,CAAC,IAAI,IAAI,CAAC;IACf;;;OAGG;IACH,IAAI,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,IAAI,IAAI,CAAC;IACjB;;;;OAIG;IACH,KAAK,CAAC,IAAI,IAAI,CAAC;CACf;AAED,2FAA2F;AAC3F,wBAAgB,QAAQ,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CAKrD;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,SAAI,GAAG,MAAM,CAMxE;AASD;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,CAUpD;AAED,yCAAyC;AACzC,MAAM,WAAW,UAAU;IAC1B;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wDAAwD;AACxD,MAAM,WAAW,SAAS;IACzB,yCAAyC;IACzC,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IACnB;;;OAGG;IACH,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,4EAA4E;IAC5E,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IACnB;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,GAAG,SAAS,CA0CzE;AAOD,sDAAsD;AACtD,MAAM,WAAW,MAAM;IACtB,SAAS,EAAE,SAAS,CAAC;IACrB,qEAAqE;IACrE,KAAK,EAAE,MAAM,CAAC;CACd;AAsCD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,SAAS,CAwNrD;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,OAAO,CAAC;AAK9C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,MAAM,CACrB,KAAK,EAAE,SAAS,EAChB,KAAK,EAAE,MAAM,EACb,KAAK,GAAE,UAAuB,GAC5B,SAAS,CA6EX"}
@@ -0,0 +1,109 @@
1
+ /**
2
+ * Creation animations — `draw` (Manim `Create`), `erase` (`Uncreate`), `write`, `drawBorderThenFill`.
3
+ *
4
+ * All of them drive a shape's `progress` track from 0 to 1; the renderer turns
5
+ * that into an arc-length reveal. A shape's polylines share one budget, spent in
6
+ * order, so a multi-part shape draws part by part rather than all at once.
7
+ */
8
+ import type { Animatable } from "../tween";
9
+ import type { Animation, AnimOptions } from "./types";
10
+ /** @category Animation presets */
11
+ export interface DrawOptions extends AnimOptions {
12
+ /** Progress (0..1) to reset the track to before drawing; defaults to the track's current value. */
13
+ from?: number;
14
+ }
15
+ /**
16
+ * Draws a shape on by tweening its `progress` track to 1, tip-first.
17
+ *
18
+ * Bind the track to a shape's `progress` prop; the renderer reveals the
19
+ * outline by arc length. Easing defaults to `"linear"` so the pen moves at a
20
+ * constant speed. Start the track at 0 (or pass `from`) for a full draw-on.
21
+ *
22
+ * @param progress - The shape's progress track, 0..1.
23
+ * @param options - Timing options plus `from`.
24
+ * @returns An {@link Animation}.
25
+ * @see {@link erase}
26
+ * @see {@link write}
27
+ *
28
+ * @category Animation presets
29
+ */
30
+ export declare function draw(progress: Animatable<number>, options?: DrawOptions): Animation;
31
+ /**
32
+ * Erases a shape by tweening its `progress` track to 0.
33
+ *
34
+ * @param progress - The shape's progress track, 0..1.
35
+ * @param options - Timing options; `easing` defaults to `"linear"`.
36
+ * @returns An {@link Animation}.
37
+ *
38
+ * @category Animation presets
39
+ */
40
+ export declare function erase(progress: Animatable<number>, options?: AnimOptions): Animation;
41
+ /**
42
+ * Options for {@link write}: {@link DrawOptions} plus the stagger between tracks.
43
+ *
44
+ * @category Animation presets
45
+ */
46
+ export interface WriteOptions extends DrawOptions {
47
+ /**
48
+ * Seconds between consecutive starts. Ignored when `lagRatio` is given.
49
+ * @default 0.12
50
+ */
51
+ lag?: number;
52
+ /** Manim's `lag_ratio`: start each when the previous is this fraction through. Takes precedence over `lag`. */
53
+ lagRatio?: number;
54
+ }
55
+ /**
56
+ * `Write`: a staggered {@link draw} across several tracks, the way Manim
57
+ * draws one glyph after another.
58
+ *
59
+ * Pass one progress track per stroke or label, in drawing order. Each starts
60
+ * `lag` seconds after the previous one and runs for the full `duration`.
61
+ *
62
+ * @param progresses - One progress track (0..1) per element.
63
+ * @param options - Timing options plus the stagger: `lag`, seconds between starts (default 0.12), or `lagRatio` (see {@link lagged}). If both are given, `lagRatio` wins and `lag` is ignored.
64
+ * @returns An {@link Animation}.
65
+ * @category Animation presets
66
+ */
67
+ export declare function write(progresses: Animatable<number>[], options?: WriteOptions): Animation;
68
+ /** @category Animation presets */
69
+ export interface UnwriteOptions extends AnimOptions {
70
+ /**
71
+ * Seconds between consecutive starts. Ignored when `lagRatio` is given.
72
+ * @default 0.12
73
+ */
74
+ lag?: number;
75
+ /** Manim's `lag_ratio`: start each when the previous is this fraction through; takes precedence over `lag`. */
76
+ lagRatio?: number;
77
+ /**
78
+ * Erase from the end backwards, as Manim's `Unwrite` does. Writing runs left
79
+ * to right, so unwriting the same way looks like the text is being eaten
80
+ * from the front; going backwards reads as undoing it. Defaults to true.
81
+ */
82
+ reverse?: boolean;
83
+ }
84
+ /**
85
+ * `Unwrite` — `write` in reverse: a staggered `erase` across several tracks.
86
+ *
87
+ * The stagger runs from the last track to the first by default, so the stroke
88
+ * that was drawn last is the first to go.
89
+ *
90
+ * @category Animation presets
91
+ */
92
+ export declare function unwrite(progresses: Animatable<number>[], options?: UnwriteOptions): Animation;
93
+ /**
94
+ * `DrawBorderThenFill`: traces the outline, then fades the fill in.
95
+ *
96
+ * The total `duration` (default 1.5 seconds) is split 65% on the outline and
97
+ * 35% on the fill. Bind the tracks to a shape's `progress` and `fillOpacity`.
98
+ *
99
+ * @param progress - Outline progress track, 0..1.
100
+ * @param fillOpacity - Fill opacity track, 0..1.
101
+ * @param options - Timing options plus `fillTo`, the final fill opacity (default 1).
102
+ * @returns An {@link Animation}.
103
+ *
104
+ * @category Animation presets
105
+ */
106
+ export declare function drawBorderThenFill(progress: Animatable<number>, fillOpacity: Animatable<number>, options?: AnimOptions & {
107
+ fillTo?: number;
108
+ }): Animation;
109
+ //# sourceMappingURL=draw.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draw.d.ts","sourceRoot":"","sources":["../../src/anim/draw.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAQtD,kCAAkC;AAClC,MAAM,WAAW,WAAY,SAAQ,WAAW;IAC/C,mGAAmG;IACnG,IAAI,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,IAAI,CACnB,QAAQ,EAAE,UAAU,CAAC,MAAM,CAAC,EAC5B,OAAO,GAAE,WAAgB,GACvB,SAAS,CAEX;AAED;;;;;;;;GAQG;AACH,wBAAgB,KAAK,CACpB,QAAQ,EAAE,UAAU,CAAC,MAAM,CAAC,EAC5B,OAAO,GAAE,WAAgB,GACvB,SAAS,CAEX;AAED;;;;GAIG;AACH,MAAM,WAAW,YAAa,SAAQ,WAAW;IAChD;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,+GAA+G;IAC/G,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,KAAK,CACpB,UAAU,EAAE,UAAU,CAAC,MAAM,CAAC,EAAE,EAChC,OAAO,GAAE,YAAiB,GACxB,SAAS,CAMX;AAED,kCAAkC;AAClC,MAAM,WAAW,cAAe,SAAQ,WAAW;IAClD;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,+GAA+G;IAC/G,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;GAOG;AACH,wBAAgB,OAAO,CACtB,UAAU,EAAE,UAAU,CAAC,MAAM,CAAC,EAAE,EAChC,OAAO,GAAE,cAAmB,GAC1B,SAAS,CAOX;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CACjC,QAAQ,EAAE,UAAU,CAAC,MAAM,CAAC,EAC5B,WAAW,EAAE,UAAU,CAAC,MAAM,CAAC,EAC/B,OAAO,GAAE,WAAW,GAAG;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAO,GAC7C,SAAS,CAWX"}
@@ -0,0 +1,94 @@
1
+ /**
2
+ * Emphasis presets — `Indicate`, `Flash`, `Wiggle`, `Circumscribe`.
3
+ *
4
+ * These are the ones that are pure easing-curve tricks: each returns the track
5
+ * to exactly where it started, so they can be fired at any time without
6
+ * disturbing the scene's resting state.
7
+ */
8
+ import type { Animatable } from "../tween";
9
+ import type { Animation, AnimOptions } from "./types";
10
+ /** @category Animation presets */
11
+ export interface IndicateOptions extends AnimOptions {
12
+ /**
13
+ * Peak scale multiplier relative to the resting scale.
14
+ * @default 1.2
15
+ */
16
+ factor?: number;
17
+ /** Colour track to flash to `highlight` and back; omit for a scale-only swell. */
18
+ color?: Animatable<string>;
19
+ /** CSS colour to flash to. Defaults to the theme's `palette.highlight`. */
20
+ highlight?: string;
21
+ }
22
+ /**
23
+ * `Indicate`: a quick swell and return, optionally with a colour flash.
24
+ *
25
+ * Scales up to `factor` times the resting scale and back, so the track ends
26
+ * where it began and the animation can be fired at any time. Duration defaults
27
+ * to 0.8 seconds.
28
+ *
29
+ * @param scale - Scale track to swell.
30
+ * @param options - Timing options plus {@link IndicateOptions} fields.
31
+ * @returns An {@link Animation}.
32
+ * @category Animation presets
33
+ */
34
+ export declare function indicate(scale: Animatable<number>, options?: IndicateOptions): Animation;
35
+ /**
36
+ * `Flash`: a ring that expands outward while fading to transparent.
37
+ *
38
+ * Drive a circle whose radius and opacity are these two tracks. Opacity goes
39
+ * from 1 to 0; it is not restored afterwards.
40
+ *
41
+ * @param radius - Radius track in scene units.
42
+ * @param opacity - Opacity track, 0..1.
43
+ * @param options - Timing options (duration 0.6 s, easing `"out"` by
44
+ * default) plus `from` (start radius, default the track's value) and `to`
45
+ * (end radius, default 2.2 times the start).
46
+ * @returns An {@link Animation}.
47
+ *
48
+ * @category Animation presets
49
+ */
50
+ export declare function flash(radius: Animatable<number>, opacity: Animatable<number>, options?: AnimOptions & {
51
+ to?: number;
52
+ from?: number;
53
+ }): Animation;
54
+ /**
55
+ * `Wiggle`: a damped rotational shake that settles back to rest.
56
+ *
57
+ * @param rotation - Rotation track, radians.
58
+ * @param options - Timing options (duration 0.7 s, linear) plus `amplitude`,
59
+ * the peak swing in radians (default 0.12), and `cycles`, the number of
60
+ * oscillations (default 3).
61
+ * @returns An {@link Animation}.
62
+ *
63
+ * @category Animation presets
64
+ */
65
+ export declare function wiggle(rotation: Animatable<number>, options?: AnimOptions & {
66
+ amplitude?: number;
67
+ cycles?: number;
68
+ }): Animation;
69
+ /**
70
+ * A slow breathing pulse; useful as ambient emphasis under {@link forever}.
71
+ *
72
+ * @param scale - Scale track; returns to its starting value.
73
+ * @param options - Timing options (duration 1.6 s) plus `factor`, the peak
74
+ * multiplier (default 1.06).
75
+ * @returns An {@link Animation}.
76
+ * @category Animation presets
77
+ */
78
+ export declare function pulse(scale: Animatable<number>, options?: AnimOptions & {
79
+ factor?: number;
80
+ }): Animation;
81
+ /**
82
+ * `Circumscribe`: draws a highlight shape around something, then erases it.
83
+ *
84
+ * Point it at the progress track of a rectangle or circle you keep hidden. The
85
+ * duration (default 1.2 seconds) is split evenly between drawing and erasing.
86
+ *
87
+ * @param progress - Progress track (0..1) of the highlight shape.
88
+ * @param options - Timing options; `easing` defaults to `"inOut"`.
89
+ * @returns An {@link Animation}.
90
+ *
91
+ * @category Animation presets
92
+ */
93
+ export declare function circumscribe(progress: Animatable<number>, options?: AnimOptions): Animation;
94
+ //# sourceMappingURL=emphasis.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emphasis.d.ts","sourceRoot":"","sources":["../../src/anim/emphasis.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAG3C,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAGtD,kCAAkC;AAClC,MAAM,WAAW,eAAgB,SAAQ,WAAW;IACnD;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kFAAkF;IAClF,KAAK,CAAC,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;IAC3B,2EAA2E;IAC3E,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,QAAQ,CACvB,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC,EACzB,OAAO,GAAE,eAAoB,GAC3B,SAAS,CA+BX;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,KAAK,CACpB,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,EAC1B,OAAO,EAAE,UAAU,CAAC,MAAM,CAAC,EAC3B,OAAO,GAAE,WAAW,GAAG;IAAE,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAO,GACxD,SAAS,CAmBX;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,MAAM,CACrB,QAAQ,EAAE,UAAU,CAAC,MAAM,CAAC,EAC5B,OAAO,GAAE,WAAW,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAO,GACjE,SAAS,CAqBX;AAED;;;;;;;;GAQG;AACH,wBAAgB,KAAK,CACpB,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC,EACzB,OAAO,GAAE,WAAW,GAAG;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAO,GAC7C,SAAS,CAWX;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAC3B,QAAQ,EAAE,UAAU,CAAC,MAAM,CAAC,EAC5B,OAAO,GAAE,WAAgB,GACvB,SAAS,CAaX"}
@@ -0,0 +1,83 @@
1
+ /**
2
+ * Fades. The whole category is one opacity tween, plus optional drift so
3
+ * `FadeIn(shift=UP)` has an equivalent.
4
+ */
5
+ import type { Point } from "../geometry";
6
+ import type { Animatable } from "../tween";
7
+ import type { Animation, AnimOptions } from "./types";
8
+ /** @category Animation presets */
9
+ export interface FadeOptions extends AnimOptions {
10
+ /**
11
+ * Opacity (0..1) that `fadeIn` ends on.
12
+ * @default 1
13
+ */
14
+ to?: number;
15
+ }
16
+ /**
17
+ * Tweens an opacity track up to 1 (or `options.to`), easing out.
18
+ *
19
+ * It does not set the track to 0 first: the fade starts from the track's
20
+ * current value, so initialise the track to 0 for a fade from invisible.
21
+ *
22
+ * @param opacity - Opacity track, 0..1; pass `opacity()` to a shape's `opacity` prop.
23
+ * @param options - Timing options; `easing` defaults to `"out"`.
24
+ * @returns An {@link Animation}.
25
+ * @see {@link fadeOut}
26
+ * @see {@link fadeInFrom}
27
+ *
28
+ * @category Animation presets
29
+ */
30
+ export declare function fadeIn(opacity: Animatable<number>, options?: FadeOptions): Animation;
31
+ /**
32
+ * Tweens an opacity track down to 0, easing in.
33
+ *
34
+ * @param opacity - Opacity track, 0..1.
35
+ * @param options - Timing options; `easing` defaults to `"in"`.
36
+ * @returns An {@link Animation}.
37
+ * @see {@link fadeIn}
38
+ *
39
+ * @category Animation presets
40
+ */
41
+ export declare function fadeOut(opacity: Animatable<number>, options?: AnimOptions): Animation;
42
+ /**
43
+ * Tweens an opacity track to an arbitrary value.
44
+ *
45
+ * Identical to {@link valueTo}; it exists so "fade to half" reads naturally
46
+ * beside `fadeIn`/`fadeOut`. Easing defaults to `"smooth"`.
47
+ *
48
+ * @param opacity - Opacity track, 0..1.
49
+ * @param value - Target opacity.
50
+ * @param options - Timing options.
51
+ * @returns An {@link Animation}.
52
+ * @category Animation presets
53
+ */
54
+ export declare function fadeTo(opacity: Animatable<number>, value: number, options?: AnimOptions): Animation;
55
+ /**
56
+ * `FadeIn(shift=...)`: fades in while sliding from an offset back to rest.
57
+ *
58
+ * When entered, the position is displaced by `offset` (and held there through
59
+ * any `delay`) and then tweened back to where it was, so the track ends where
60
+ * it started and composes with layout.
61
+ *
62
+ * @param opacity - Opacity track, 0..1.
63
+ * @param position - Position track in scene units.
64
+ * @param offset - Displacement in scene units to start from (e.g. `{ x: 0, y: -1 }`).
65
+ * @param options - Timing options; `easing` defaults to `"out"`.
66
+ * @returns An {@link Animation}.
67
+ *
68
+ * @category Animation presets
69
+ */
70
+ export declare function fadeInFrom(opacity: Animatable<number>, position: Animatable<Point>, offset: Point, options?: FadeOptions): Animation;
71
+ /**
72
+ * `FadeOut(shift=...)`: fades out while drifting away by `offset`.
73
+ *
74
+ * @param opacity - Opacity track, 0..1.
75
+ * @param position - Position track in scene units; ends at its start plus `offset`.
76
+ * @param offset - Displacement in scene units.
77
+ * @param options - Timing options; `easing` defaults to `"in"`.
78
+ * @returns An {@link Animation}.
79
+ *
80
+ * @category Animation presets
81
+ */
82
+ export declare function fadeOutTo(opacity: Animatable<number>, position: Animatable<Point>, offset: Point, options?: AnimOptions): Animation;
83
+ //# sourceMappingURL=fade.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fade.d.ts","sourceRoot":"","sources":["../../src/anim/fade.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAI3C,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAGtD,kCAAkC;AAClC,MAAM,WAAW,WAAY,SAAQ,WAAW;IAC/C;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;CACZ;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,MAAM,CACrB,OAAO,EAAE,UAAU,CAAC,MAAM,CAAC,EAC3B,OAAO,GAAE,WAAgB,GACvB,SAAS,CAEX;AAED;;;;;;;;;GASG;AACH,wBAAgB,OAAO,CACtB,OAAO,EAAE,UAAU,CAAC,MAAM,CAAC,EAC3B,OAAO,GAAE,WAAgB,GACvB,SAAS,CAEX;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,MAAM,CACrB,OAAO,EAAE,UAAU,CAAC,MAAM,CAAC,EAC3B,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,WAAgB,GACvB,SAAS,CAEX;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,UAAU,CACzB,OAAO,EAAE,UAAU,CAAC,MAAM,CAAC,EAC3B,QAAQ,EAAE,UAAU,CAAC,KAAK,CAAC,EAC3B,MAAM,EAAE,KAAK,EACb,OAAO,GAAE,WAAgB,GACvB,SAAS,CAUX;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,SAAS,CACxB,OAAO,EAAE,UAAU,CAAC,MAAM,CAAC,EAC3B,QAAQ,EAAE,UAAU,CAAC,KAAK,CAAC,EAC3B,MAAM,EAAE,KAAK,EACb,OAAO,GAAE,WAAgB,GACvB,SAAS,CAaX"}
@@ -0,0 +1,93 @@
1
+ /**
2
+ * Growing presets (Manim's `growing`): bring a shape in by scale rather than by
3
+ * arc length. The rest value is captured on entry (`peek`), the start state is
4
+ * held through `delay`, and an aborted grow snaps back to rest so a cancelled
5
+ * script never leaves a shape half-size or invisible.
6
+ */
7
+ import type { Bounds, Point } from "../geometry";
8
+ import type { Animatable } from "../tween";
9
+ import type { Animation, AnimOptions } from "./types";
10
+ /**
11
+ * `GrowFromCenter` — the shape swells from nothing about its own centre.
12
+ *
13
+ * Drives a scale track from 0 to wherever it was resting. The component's
14
+ * `origin` decides what "centre" means; left unset that is the shape's own
15
+ * bounding-box centre, which is exactly Manim's behaviour.
16
+ *
17
+ * This is also Manim's `GrowArrow`: set `origin={tail}` on an `arrow()` and the
18
+ * scale track pivots on the tail. It inflates a small complete arrow, head and
19
+ * all, where `draw()` draws a full-size one progressively.
20
+ *
21
+ * @param scale - Scale track; its value when the animation is entered is the resting scale.
22
+ * @param options - Timing options; duration 1 s and easing `"out"` by default.
23
+ * @returns An {@link Animation}.
24
+ * @category Animation presets
25
+ */
26
+ export declare function growFromCenter(scale: Animatable<number>, options?: AnimOptions): Animation;
27
+ /**
28
+ * `ShrinkToCenter`: the inverse of {@link growFromCenter}; the scale collapses
29
+ * to 0.
30
+ *
31
+ * @param scale - Scale track.
32
+ * @param options - Timing options; duration 1 s and easing `"in"` by default.
33
+ * @returns An {@link Animation}.
34
+ *
35
+ * @category Animation presets
36
+ */
37
+ export declare function shrinkToCenter(scale: Animatable<number>, options?: AnimOptions): Animation;
38
+ /**
39
+ * `GrowFromPoint` — the shape grows while travelling from `from` to its resting
40
+ * position, so it reads as having been thrown from somewhere.
41
+ *
42
+ * Built the same way as `fadeInFrom`: displace first, then tween both tracks
43
+ * back together. Because both resting values are captured on entry, this
44
+ * composes with layout — the shape lands wherever it would have been anyway.
45
+ *
46
+ * @param scale - Scale track.
47
+ * @param position - Position track in scene units.
48
+ * @param from - Scene-space point the shape starts at.
49
+ * @param options - Timing options; duration 1 s and easing `"out"` by default.
50
+ * @returns An {@link Animation}.
51
+ *
52
+ * @category Animation presets
53
+ */
54
+ export declare function growFromPoint(scale: Animatable<number>, position: Animatable<Point>, from: Point, options?: AnimOptions): Animation;
55
+ /**
56
+ * Manim's `GrowFromEdge`: the shape unfolds from one edge or corner of its own
57
+ * box, which stays pinned. Any direction works (`{ x: 0.5, y: 1 }` is a point
58
+ * along the top edge). Pass the shape's resting box, `handle()?.localBounds()`.
59
+ *
60
+ * @param scale - Scale track.
61
+ * @param position - Position track.
62
+ * @param bounds - The shape's resting box, in the shape's local coordinates.
63
+ * @param direction - Anchor on the box, e.g. `{ x: -1, y: 0 }` for the left edge.
64
+ * @param options - Timing options; duration 1 s and easing `"out"` by default.
65
+ * @returns An {@link Animation}.
66
+ *
67
+ * @category Animation presets
68
+ */
69
+ export declare function growFromEdge(scale: Animatable<number>, position: Animatable<Point>, bounds: Bounds, direction: Point, options?: AnimOptions): Animation;
70
+ /** @category Animation presets */
71
+ export interface SpinInOptions extends AnimOptions {
72
+ /**
73
+ * Turn to arrive through, in radians. Defaults to Manim's quarter turn.
74
+ * @default Math.PI / 2
75
+ */
76
+ turn?: number;
77
+ }
78
+ /**
79
+ * `SpinInFromNothing` — grows while rotating into place.
80
+ *
81
+ * The rotation *ends* at rest, so the shape settles at whatever angle the scene
82
+ * had it; only the approach spins. Both tracks are driven together, so easing
83
+ * applies to the pair and the spin can't outrun the growth.
84
+ *
85
+ * @param scale - Scale track.
86
+ * @param rotation - Rotation track, radians.
87
+ * @param options - Timing options plus `turn`; duration 1 s and easing `"out"` by default.
88
+ * @returns An {@link Animation}.
89
+ *
90
+ * @category Animation presets
91
+ */
92
+ export declare function spinInFromNothing(scale: Animatable<number>, rotation: Animatable<number>, options?: SpinInOptions): Animation;
93
+ //# sourceMappingURL=growing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"growing.d.ts","sourceRoot":"","sources":["../../src/anim/growing.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAG3C,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAqCtD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,cAAc,CAC7B,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC,EACzB,OAAO,GAAE,WAAgB,GACvB,SAAS,CAUX;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC7B,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC,EACzB,OAAO,GAAE,WAAgB,GACvB,SAAS,CAQX;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,aAAa,CAC5B,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC,EACzB,QAAQ,EAAE,UAAU,CAAC,KAAK,CAAC,EAC3B,IAAI,EAAE,KAAK,EACX,OAAO,GAAE,WAAgB,GACvB,SAAS,CAEX;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAC3B,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC,EACzB,QAAQ,EAAE,UAAU,CAAC,KAAK,CAAC,EAC3B,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,KAAK,EAChB,OAAO,GAAE,WAAgB,GACvB,SAAS,CAeX;AAwCD,kCAAkC;AAClC,MAAM,WAAW,aAAc,SAAQ,WAAW;IACjD;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAChC,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC,EACzB,QAAQ,EAAE,UAAU,CAAC,MAAM,CAAC,EAC5B,OAAO,GAAE,aAAkB,GACzB,SAAS,CAiBX"}