@motionscript/math 0.0.0-stage → 0.1.0-alpha.4

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 (322) hide show
  1. package/CHANGELOG.md +92 -0
  2. package/LICENSE +201 -0
  3. package/NOTICE +48 -0
  4. package/README.md +385 -3
  5. package/dist/annotate/angle-mark.d.ts +46 -0
  6. package/dist/annotate/angle-mark.d.ts.map +1 -0
  7. package/dist/annotate/angle-mark.js +132 -0
  8. package/dist/annotate/angle-mark.js.map +1 -0
  9. package/dist/annotate/curly-brace.d.ts +46 -0
  10. package/dist/annotate/curly-brace.d.ts.map +1 -0
  11. package/dist/annotate/curly-brace.js +114 -0
  12. package/dist/annotate/curly-brace.js.map +1 -0
  13. package/dist/annotate/emphasis-mark.d.ts +20 -0
  14. package/dist/annotate/emphasis-mark.d.ts.map +1 -0
  15. package/dist/annotate/emphasis-mark.js +81 -0
  16. package/dist/annotate/emphasis-mark.js.map +1 -0
  17. package/dist/browser/THIRD_PARTY_LICENSES.txt +420 -0
  18. package/dist/browser/chunks/chunk-3GJB6AVO.js +2 -0
  19. package/dist/browser/chunks/chunk-3GJB6AVO.js.map +7 -0
  20. package/dist/browser/chunks/chunk-D5WHCVBC.js +2 -0
  21. package/dist/browser/chunks/chunk-D5WHCVBC.js.map +7 -0
  22. package/dist/browser/chunks/chunk-WL4KEX7Y.js +2 -0
  23. package/dist/browser/chunks/chunk-WL4KEX7Y.js.map +7 -0
  24. package/dist/browser/chunks/mathjax-DNP3YRES.js +61 -0
  25. package/dist/browser/chunks/mathjax-DNP3YRES.js.map +7 -0
  26. package/dist/browser/index.js +2 -0
  27. package/dist/browser/index.js.map +7 -0
  28. package/dist/browser/kit.js +2 -0
  29. package/dist/browser/kit.js.map +7 -0
  30. package/dist/browser/manifest.json +30 -0
  31. package/dist/browser/tex.js +2 -0
  32. package/dist/browser/tex.js.map +7 -0
  33. package/dist/engine.d.ts +64 -0
  34. package/dist/engine.d.ts.map +1 -0
  35. package/dist/engine.js +42 -0
  36. package/dist/engine.js.map +1 -0
  37. package/dist/index.d.ts +30 -0
  38. package/dist/index.d.ts.map +1 -0
  39. package/dist/index.js +30 -0
  40. package/dist/index.js.map +1 -0
  41. package/dist/kit/brace.d.ts +8 -0
  42. package/dist/kit/brace.d.ts.map +1 -0
  43. package/dist/kit/brace.js +36 -0
  44. package/dist/kit/brace.js.map +1 -0
  45. package/dist/kit/cache.d.ts +30 -0
  46. package/dist/kit/cache.d.ts.map +1 -0
  47. package/dist/kit/cache.js +53 -0
  48. package/dist/kit/cache.js.map +1 -0
  49. package/dist/kit/contour.d.ts +8 -0
  50. package/dist/kit/contour.d.ts.map +1 -0
  51. package/dist/kit/contour.js +93 -0
  52. package/dist/kit/contour.js.map +1 -0
  53. package/dist/kit/coords.d.ts +69 -0
  54. package/dist/kit/coords.d.ts.map +1 -0
  55. package/dist/kit/coords.js +224 -0
  56. package/dist/kit/coords.js.map +1 -0
  57. package/dist/kit/curve.d.ts +17 -0
  58. package/dist/kit/curve.d.ts.map +1 -0
  59. package/dist/kit/curve.js +22 -0
  60. package/dist/kit/curve.js.map +1 -0
  61. package/dist/kit/equation.d.ts +61 -0
  62. package/dist/kit/equation.d.ts.map +1 -0
  63. package/dist/kit/equation.js +168 -0
  64. package/dist/kit/equation.js.map +1 -0
  65. package/dist/kit/equation3d.d.ts +50 -0
  66. package/dist/kit/equation3d.d.ts.map +1 -0
  67. package/dist/kit/equation3d.js +103 -0
  68. package/dist/kit/equation3d.js.map +1 -0
  69. package/dist/kit/expression.d.ts +35 -0
  70. package/dist/kit/expression.d.ts.map +1 -0
  71. package/dist/kit/expression.js +124 -0
  72. package/dist/kit/expression.js.map +1 -0
  73. package/dist/kit/field-mark.d.ts +58 -0
  74. package/dist/kit/field-mark.d.ts.map +1 -0
  75. package/dist/kit/field-mark.js +129 -0
  76. package/dist/kit/field-mark.js.map +1 -0
  77. package/dist/kit/field.d.ts +14 -0
  78. package/dist/kit/field.d.ts.map +1 -0
  79. package/dist/kit/field.js +46 -0
  80. package/dist/kit/field.js.map +1 -0
  81. package/dist/kit/follow.d.ts +71 -0
  82. package/dist/kit/follow.d.ts.map +1 -0
  83. package/dist/kit/follow.js +159 -0
  84. package/dist/kit/follow.js.map +1 -0
  85. package/dist/kit/furniture.d.ts +30 -0
  86. package/dist/kit/furniture.d.ts.map +1 -0
  87. package/dist/kit/furniture.js +87 -0
  88. package/dist/kit/furniture.js.map +1 -0
  89. package/dist/kit/geometry.d.ts +13 -0
  90. package/dist/kit/geometry.d.ts.map +1 -0
  91. package/dist/kit/geometry.js +54 -0
  92. package/dist/kit/geometry.js.map +1 -0
  93. package/dist/kit/mark.d.ts +47 -0
  94. package/dist/kit/mark.d.ts.map +1 -0
  95. package/dist/kit/mark.js +103 -0
  96. package/dist/kit/mark.js.map +1 -0
  97. package/dist/kit/part-fills.d.ts +23 -0
  98. package/dist/kit/part-fills.d.ts.map +1 -0
  99. package/dist/kit/part-fills.js +46 -0
  100. package/dist/kit/part-fills.js.map +1 -0
  101. package/dist/kit/place.d.ts +18 -0
  102. package/dist/kit/place.d.ts.map +1 -0
  103. package/dist/kit/place.js +68 -0
  104. package/dist/kit/place.js.map +1 -0
  105. package/dist/kit/placement.d.ts +8 -0
  106. package/dist/kit/placement.d.ts.map +1 -0
  107. package/dist/kit/placement.js +8 -0
  108. package/dist/kit/placement.js.map +1 -0
  109. package/dist/kit/sampler.d.ts +17 -0
  110. package/dist/kit/sampler.d.ts.map +1 -0
  111. package/dist/kit/sampler.js +250 -0
  112. package/dist/kit/sampler.js.map +1 -0
  113. package/dist/kit/scale.d.ts +12 -0
  114. package/dist/kit/scale.d.ts.map +1 -0
  115. package/dist/kit/scale.js +37 -0
  116. package/dist/kit/scale.js.map +1 -0
  117. package/dist/kit/source.d.ts +22 -0
  118. package/dist/kit/source.d.ts.map +1 -0
  119. package/dist/kit/source.js +45 -0
  120. package/dist/kit/source.js.map +1 -0
  121. package/dist/kit/system.d.ts +33 -0
  122. package/dist/kit/system.d.ts.map +1 -0
  123. package/dist/kit/system.js +67 -0
  124. package/dist/kit/system.js.map +1 -0
  125. package/dist/kit/ticks.d.ts +19 -0
  126. package/dist/kit/ticks.d.ts.map +1 -0
  127. package/dist/kit/ticks.js +78 -0
  128. package/dist/kit/ticks.js.map +1 -0
  129. package/dist/kit/withdrawn.d.ts +9 -0
  130. package/dist/kit/withdrawn.d.ts.map +1 -0
  131. package/dist/kit/withdrawn.js +9 -0
  132. package/dist/kit/withdrawn.js.map +1 -0
  133. package/dist/marks/curve-area.d.ts +32 -0
  134. package/dist/marks/curve-area.d.ts.map +1 -0
  135. package/dist/marks/curve-area.js +82 -0
  136. package/dist/marks/curve-area.js.map +1 -0
  137. package/dist/marks/drop-lines.d.ts +22 -0
  138. package/dist/marks/drop-lines.d.ts.map +1 -0
  139. package/dist/marks/drop-lines.js +58 -0
  140. package/dist/marks/drop-lines.js.map +1 -0
  141. package/dist/marks/plot-point.d.ts +35 -0
  142. package/dist/marks/plot-point.d.ts.map +1 -0
  143. package/dist/marks/plot-point.js +97 -0
  144. package/dist/marks/plot-point.js.map +1 -0
  145. package/dist/marks/riemann-sum.d.ts +37 -0
  146. package/dist/marks/riemann-sum.d.ts.map +1 -0
  147. package/dist/marks/riemann-sum.js +91 -0
  148. package/dist/marks/riemann-sum.js.map +1 -0
  149. package/dist/marks/tangent-line.d.ts +27 -0
  150. package/dist/marks/tangent-line.d.ts.map +1 -0
  151. package/dist/marks/tangent-line.js +103 -0
  152. package/dist/marks/tangent-line.js.map +1 -0
  153. package/dist/marks/vector-arrow.d.ts +32 -0
  154. package/dist/marks/vector-arrow.d.ts.map +1 -0
  155. package/dist/marks/vector-arrow.js +87 -0
  156. package/dist/marks/vector-arrow.js.map +1 -0
  157. package/dist/nodes.d.ts +35 -0
  158. package/dist/nodes.d.ts.map +1 -0
  159. package/dist/nodes.js +63 -0
  160. package/dist/nodes.js.map +1 -0
  161. package/dist/plots/function-plot.d.ts +67 -0
  162. package/dist/plots/function-plot.d.ts.map +1 -0
  163. package/dist/plots/function-plot.js +215 -0
  164. package/dist/plots/function-plot.js.map +1 -0
  165. package/dist/plots/points-plot.d.ts +28 -0
  166. package/dist/plots/points-plot.d.ts.map +1 -0
  167. package/dist/plots/points-plot.js +99 -0
  168. package/dist/plots/points-plot.js.map +1 -0
  169. package/dist/plots/stream-lines.d.ts +35 -0
  170. package/dist/plots/stream-lines.d.ts.map +1 -0
  171. package/dist/plots/stream-lines.js +141 -0
  172. package/dist/plots/stream-lines.js.map +1 -0
  173. package/dist/plots/traced-path.d.ts +31 -0
  174. package/dist/plots/traced-path.d.ts.map +1 -0
  175. package/dist/plots/traced-path.js +56 -0
  176. package/dist/plots/traced-path.js.map +1 -0
  177. package/dist/plots/vector-field.d.ts +23 -0
  178. package/dist/plots/vector-field.d.ts.map +1 -0
  179. package/dist/plots/vector-field.js +91 -0
  180. package/dist/plots/vector-field.js.map +1 -0
  181. package/dist/structures/graph-layout.d.ts +11 -0
  182. package/dist/structures/graph-layout.d.ts.map +1 -0
  183. package/dist/structures/graph-layout.js +135 -0
  184. package/dist/structures/graph-layout.js.map +1 -0
  185. package/dist/structures/network-graph.d.ts +83 -0
  186. package/dist/structures/network-graph.d.ts.map +1 -0
  187. package/dist/structures/network-graph.js +289 -0
  188. package/dist/structures/network-graph.js.map +1 -0
  189. package/dist/structures/sample-space.d.ts +62 -0
  190. package/dist/structures/sample-space.d.ts.map +1 -0
  191. package/dist/structures/sample-space.js +199 -0
  192. package/dist/structures/sample-space.js.map +1 -0
  193. package/dist/systems/axes2d.d.ts +75 -0
  194. package/dist/systems/axes2d.d.ts.map +1 -0
  195. package/dist/systems/axes2d.js +193 -0
  196. package/dist/systems/axes2d.js.map +1 -0
  197. package/dist/systems/number-line.d.ts +49 -0
  198. package/dist/systems/number-line.d.ts.map +1 -0
  199. package/dist/systems/number-line.js +127 -0
  200. package/dist/systems/number-line.js.map +1 -0
  201. package/dist/systems/number-plane.d.ts +59 -0
  202. package/dist/systems/number-plane.d.ts.map +1 -0
  203. package/dist/systems/number-plane.js +193 -0
  204. package/dist/systems/number-plane.js.map +1 -0
  205. package/dist/systems/polar-plane.d.ts +48 -0
  206. package/dist/systems/polar-plane.d.ts.map +1 -0
  207. package/dist/systems/polar-plane.js +165 -0
  208. package/dist/systems/polar-plane.js.map +1 -0
  209. package/dist/tex/geometry.d.ts +85 -0
  210. package/dist/tex/geometry.d.ts.map +1 -0
  211. package/dist/tex/geometry.js +632 -0
  212. package/dist/tex/geometry.js.map +1 -0
  213. package/dist/tex/index.d.ts +11 -0
  214. package/dist/tex/index.d.ts.map +1 -0
  215. package/dist/tex/index.js +9 -0
  216. package/dist/tex/index.js.map +1 -0
  217. package/dist/tex/mathjax.d.ts +33 -0
  218. package/dist/tex/mathjax.d.ts.map +1 -0
  219. package/dist/tex/mathjax.js +74 -0
  220. package/dist/tex/mathjax.js.map +1 -0
  221. package/dist/tex/matrix.d.ts +31 -0
  222. package/dist/tex/matrix.d.ts.map +1 -0
  223. package/dist/tex/matrix.js +73 -0
  224. package/dist/tex/matrix.js.map +1 -0
  225. package/dist/tex/node.d.ts +215 -0
  226. package/dist/tex/node.d.ts.map +1 -0
  227. package/dist/tex/node.js +595 -0
  228. package/dist/tex/node.js.map +1 -0
  229. package/dist/tex/tween.d.ts +50 -0
  230. package/dist/tex/tween.d.ts.map +1 -0
  231. package/dist/tex/tween.js +253 -0
  232. package/dist/tex/tween.js.map +1 -0
  233. package/dist/three/axes3d.d.ts +87 -0
  234. package/dist/three/axes3d.d.ts.map +1 -0
  235. package/dist/three/axes3d.js +228 -0
  236. package/dist/three/axes3d.js.map +1 -0
  237. package/dist/three/curve-plot3d.d.ts +60 -0
  238. package/dist/three/curve-plot3d.d.ts.map +1 -0
  239. package/dist/three/curve-plot3d.js +143 -0
  240. package/dist/three/curve-plot3d.js.map +1 -0
  241. package/dist/three/label3d.d.ts +11 -0
  242. package/dist/three/label3d.d.ts.map +1 -0
  243. package/dist/three/label3d.js +40 -0
  244. package/dist/three/label3d.js.map +1 -0
  245. package/dist/three/plot-point3d.d.ts +26 -0
  246. package/dist/three/plot-point3d.d.ts.map +1 -0
  247. package/dist/three/plot-point3d.js +60 -0
  248. package/dist/three/plot-point3d.js.map +1 -0
  249. package/dist/three/space.d.ts +28 -0
  250. package/dist/three/space.d.ts.map +1 -0
  251. package/dist/three/space.js +47 -0
  252. package/dist/three/space.js.map +1 -0
  253. package/dist/three/surface-plot3d.d.ts +80 -0
  254. package/dist/three/surface-plot3d.d.ts.map +1 -0
  255. package/dist/three/surface-plot3d.js +290 -0
  256. package/dist/three/surface-plot3d.js.map +1 -0
  257. package/dist/three/vector-arrow3d.d.ts +25 -0
  258. package/dist/three/vector-arrow3d.d.ts.map +1 -0
  259. package/dist/three/vector-arrow3d.js +72 -0
  260. package/dist/three/vector-arrow3d.js.map +1 -0
  261. package/package.json +79 -3
  262. package/registry.json +251 -0
  263. package/src/annotate/angle-mark.ts +147 -0
  264. package/src/annotate/curly-brace.ts +126 -0
  265. package/src/annotate/emphasis-mark.ts +89 -0
  266. package/src/engine.ts +72 -0
  267. package/src/index.ts +29 -0
  268. package/src/kit/brace.ts +37 -0
  269. package/src/kit/cache.ts +61 -0
  270. package/src/kit/contour.ts +94 -0
  271. package/src/kit/coords.ts +278 -0
  272. package/src/kit/curve.ts +29 -0
  273. package/src/kit/equation.ts +181 -0
  274. package/src/kit/equation3d.ts +137 -0
  275. package/src/kit/expression.ts +159 -0
  276. package/src/kit/field-mark.ts +155 -0
  277. package/src/kit/field.ts +50 -0
  278. package/src/kit/follow.ts +203 -0
  279. package/src/kit/furniture.ts +108 -0
  280. package/src/kit/geometry.ts +49 -0
  281. package/src/kit/mark.ts +131 -0
  282. package/src/kit/part-fills.ts +61 -0
  283. package/src/kit/place.ts +101 -0
  284. package/src/kit/placement.ts +8 -0
  285. package/src/kit/sampler.ts +281 -0
  286. package/src/kit/scale.ts +39 -0
  287. package/src/kit/source.ts +57 -0
  288. package/src/kit/system.ts +99 -0
  289. package/src/kit/ticks.ts +85 -0
  290. package/src/kit/withdrawn.ts +8 -0
  291. package/src/marks/curve-area.ts +89 -0
  292. package/src/marks/drop-lines.ts +63 -0
  293. package/src/marks/plot-point.ts +107 -0
  294. package/src/marks/riemann-sum.ts +98 -0
  295. package/src/marks/tangent-line.ts +103 -0
  296. package/src/marks/vector-arrow.ts +98 -0
  297. package/src/nodes.ts +63 -0
  298. package/src/plots/function-plot.ts +236 -0
  299. package/src/plots/points-plot.ts +107 -0
  300. package/src/plots/stream-lines.ts +151 -0
  301. package/src/plots/traced-path.ts +52 -0
  302. package/src/plots/vector-field.ts +88 -0
  303. package/src/structures/graph-layout.ts +145 -0
  304. package/src/structures/network-graph.ts +308 -0
  305. package/src/structures/sample-space.ts +209 -0
  306. package/src/systems/axes2d.ts +217 -0
  307. package/src/systems/number-line.ts +131 -0
  308. package/src/systems/number-plane.ts +203 -0
  309. package/src/systems/polar-plane.ts +176 -0
  310. package/src/tex/geometry.ts +703 -0
  311. package/src/tex/index.ts +14 -0
  312. package/src/tex/mathjax.ts +82 -0
  313. package/src/tex/matrix.ts +75 -0
  314. package/src/tex/node.ts +641 -0
  315. package/src/tex/tween.ts +308 -0
  316. package/src/three/axes3d.ts +240 -0
  317. package/src/three/curve-plot3d.ts +147 -0
  318. package/src/three/label3d.ts +50 -0
  319. package/src/three/plot-point3d.ts +66 -0
  320. package/src/three/space.ts +67 -0
  321. package/src/three/surface-plot3d.ts +323 -0
  322. package/src/three/vector-arrow3d.ts +77 -0
@@ -0,0 +1,215 @@
1
+ import { RenderContext2D, EasingFunction, NodeConfig, ShapeNode, ShapeProps, InsetsProps, Size2D, SizeConstraints, InsetsResolved, type AssetScope, type BoxBounds, type Command, type CommandArgs, type Fill } from "@motionscript/sdk";
2
+ import { type LatexMorphStrategy } from "./tween.js";
3
+ import { type PartFill } from "../kit/part-fills.js";
4
+ export interface LatexProps extends ShapeProps {
5
+ latex: string;
6
+ fontSize: number;
7
+ padding: InsetsProps;
8
+ partFills: PartFill[];
9
+ written: number;
10
+ }
11
+ /**
12
+ * Construction-time-only options: pluggable engine behavior, set once when
13
+ * the node is created. Deliberately *not* part of {@link LatexProps} — every
14
+ * `@property` field accepts either a value or a zero-arg reactive binding
15
+ * (`value | (() => value)`, see `PropInputs`), and the node's own reactive
16
+ * write path (`_writeProp`) treats any function value as the latter. A
17
+ * strategy *is* a function, so it can't be told apart from a binding that
18
+ * computes one — it has to stay outside the reactive prop system entirely.
19
+ */
20
+ export interface LatexStrategies {
21
+ /** How the node morphs between two formulas. Defaults to `defaultLatexMorph`. */
22
+ morph?: LatexMorphStrategy;
23
+ }
24
+ export declare class Latex extends ShapeNode<LatexProps> {
25
+ readonly latex: string;
26
+ readonly fontSize: number;
27
+ readonly padding: InsetsResolved;
28
+ /** Paints for parts of the formula, named by their source. Later entries win where two name a glyph. */
29
+ partFills: PartFill[];
30
+ /**
31
+ * How much of the formula is written, 0 to 1: its glyphs are drawn one after
32
+ * another, each outlined and then filled.
33
+ */
34
+ written: number;
35
+ /**
36
+ * How this node morphs between two formulas. Construction-time-only (see
37
+ * {@link LatexStrategies}) — resolved once here rather than left as
38
+ * `?? defaultLatexMorph` at every call site.
39
+ */
40
+ private readonly morph;
41
+ private _intrinsicWidth;
42
+ private _intrinsicHeight;
43
+ /**
44
+ * Shared center frame for all current tokens, [minX, minY, maxX, maxY] in
45
+ * token space. Passed to every per-token path so glyphs keep their relative
46
+ * layout instead of each centering on its own bbox.
47
+ */
48
+ private _bounds;
49
+ /** Current tokens to render. Each has its own opacity for tween transitions. */
50
+ private _tokens;
51
+ /** The parts of the formula `_tokens` was built from; empty while a morph holds the tokens. */
52
+ private _parts;
53
+ /** While a morph holds the tokens: each end's colours by token, and how far between them it is. */
54
+ private _morphFills;
55
+ /**
56
+ * How far through a morph the playhead is, in `(0, 1)` while one is
57
+ * driving frames and `0` otherwise: the node's own signal, not a prop an
58
+ * author states.
59
+ *
60
+ * A prop rather than a field because it is the one thing the timeline
61
+ * restores. The morph writes the tokens, the box and the intrinsic size
62
+ * straight onto the node, so nothing else says whether what is on screen is
63
+ * a morph frame; and a seek from inside a morph to a time before it
64
+ * evaluates no command at all. Restored to `0` with every other prop, this
65
+ * is how the node learns the playhead has left the morph.
66
+ */
67
+ morphProgress: number;
68
+ /** Suppresses retokenization while a custom to() is driving frames. */
69
+ private _animating;
70
+ /** The `fontSize|latex` the live tokens were built from. See {@link _ensureTokens}. */
71
+ private _tokenizedFrom;
72
+ constructor(props?: NodeConfig<Latex, LatexProps> & LatexStrategies);
73
+ /**
74
+ * Rebuild the token list when the formula or size has moved since it last
75
+ * was built.
76
+ *
77
+ * Pulled from every reader rather than pushed from a prop write, because
78
+ * `latex` can be a binding — and a binding has no write to hang a
79
+ * subscription on. The key is what the current tokens were built from;
80
+ * `_animating` hands ownership to the morph command for its open interval.
81
+ */
82
+ private _ensureTokens;
83
+ /** MathJax, before this node is laid out: a scene with no formula in it never loads it. */
84
+ declareAssets(assets: AssetScope): void;
85
+ /** @internal The formula typeset once `next` is laid over the node's own props: `latex` here, a subclass's own props there. */
86
+ _source(next?: Partial<LatexProps>): string;
87
+ /** @internal The props that state the formula, as `next` leaves them: what a morph commits at its end. */
88
+ _sourceProps(next?: Partial<LatexProps>): Partial<LatexProps>;
89
+ /** @internal Whether `next` re-sets the glyphs, and so is a morph rather than an ordinary tween. */
90
+ _resets(next: Partial<LatexProps>): boolean;
91
+ private _updateTokens;
92
+ private _clearTokens;
93
+ measure(constraints: SizeConstraints): Partial<Size2D>;
94
+ /**
95
+ * A LaTeX morph — one {@link Command}, like every other `to()`.
96
+ *
97
+ * Sequence two of them with `sequence(...)` rather than chaining: the chain
98
+ * builder this used to return existed only so `latexRef().to(a, 1).to(b, 1)`
99
+ * would read as two steps, and it could not compose with anything that was
100
+ * not another Latex morph.
101
+ */
102
+ to<D extends Partial<LatexProps> = Partial<LatexProps>>(args: CommandArgs<D> & {
103
+ duration: number;
104
+ }): Command<LatexProps>;
105
+ /**
106
+ * Morph this formula into another — a document-facing name for {@link to},
107
+ * which already routes through {@link _buildMorph}.
108
+ */
109
+ morphTo(args: CommandArgs<{
110
+ latex: string;
111
+ }> & {
112
+ duration: number;
113
+ }): Command<LatexProps>;
114
+ /** Write the formula on, or off: its glyphs one after another, each outlined and then filled. */
115
+ writeTo(args: CommandArgs<{
116
+ written: number;
117
+ }> & {
118
+ duration: number;
119
+ }): Command<LatexProps>;
120
+ /** Paint one part of the formula, leaving the rest as it is. */
121
+ partFillTo(args: CommandArgs<{
122
+ part: string;
123
+ fill: Fill;
124
+ occurrence?: number;
125
+ }> & {
126
+ duration: number;
127
+ }): Command<LatexProps>;
128
+ /**
129
+ * The box around one part of the formula, centred on the node's own centre
130
+ * and y-up, or `null` when the formula does not write `part`. `occurrence`
131
+ * counts from 1.
132
+ */
133
+ partBounds(part: string, occurrence?: number): BoxBounds | null;
134
+ /**
135
+ * Build a single LaTeX morph as a {@link Command}: every ordinary
136
+ * `ShapeProps` field (via the inherited `_prepareStep`), plus the
137
+ * intrinsic size, shared center frame and per-glyph token list — state a
138
+ * plain `set()` can't reach — driven together by one eased `t`, matching
139
+ * the concurrent `parallel` the generator version ran.
140
+ *
141
+ * The "from" snapshot (`fromTokens`, `fromLatex`, …) is captured
142
+ * **lazily, on the command's first evaluation**, not when this is called.
143
+ * That is what lets two morphs be sequenced: `commandSequence` settles each
144
+ * prior step before evaluating the next, so a second morph's "from" reads
145
+ * the first one's end state rather than whatever the node held before either
146
+ * of them ran.
147
+ *
148
+ * `_animating` suppresses {@link _ensureTokens} for the open interval, and
149
+ * both ends commit: `t === 1`
150
+ * lands on the target formula, `t === 0` restores the source one — the same
151
+ * "membership for the open interval, commit at either end" shape
152
+ * `packages/components/code`'s `runTransition` uses, so seeking into either
153
+ * side of the morph (not just running it forward) shows the right thing.
154
+ *
155
+ * `@internal` — the entry point for authors is {@link to}.
156
+ */
157
+ _buildMorph(to: Partial<LatexProps>, duration: number, easing?: EasingFunction): Command<LatexProps>;
158
+ /**
159
+ * The shadow op comes **first**, as it does on every other painted node.
160
+ *
161
+ * The renderer does not draw a shadow when it sees one: `.shadow()` stores
162
+ * it pending and the *next* fill or stroke op casts it (`_shadow` →
163
+ * `storePendingShadows`, `_fill`/`_stroke` → `takePendingShadows`). Appended
164
+ * last, it was stored by every token and then thrown away by the reset at
165
+ * the end of the draw — a shadow set on a LaTeX node simply never appeared,
166
+ * with no error to say why. Same failure {@link PaintedNode.renderStroke}
167
+ * documents for a fill-less stroked shape, and the same one-op fix.
168
+ *
169
+ * Order also carries the fill-less case for free: an empty fill returns
170
+ * before it takes the pending shadow, so the stroke below casts it from the
171
+ * glyph outlines instead — which is what `castsShadowFromStroke` arranges on
172
+ * a plain shape.
173
+ */
174
+ protected renderSelf(ctx: RenderContext2D): void;
175
+ /** Each token's part fill: by its place in the formula at rest, by both ends' mid-morph. */
176
+ private _tokenFills;
177
+ /**
178
+ * How far each glyph is written at the node's `written`: its outline first,
179
+ * then its fill, each glyph starting before the one ahead of it is done.
180
+ * `null` once the whole formula is.
181
+ */
182
+ private _writing;
183
+ /**
184
+ * The overlay, painted *through* the glyphs.
185
+ *
186
+ * `ShapeNode`'s inherited overlay pass fills whatever {@link
187
+ * ShapeNode.shapeGraphics} describes, and this node describes nothing there:
188
+ * a formula has no single fillable silhouette — its silhouette *is* the list
189
+ * of token paths, which is why `renderSelf` is overridden rather than a
190
+ * `shapeGraphics` supplied. So the generic pass drew nothing and an overlay
191
+ * set on a LaTeX node simply never appeared, with no error to say why.
192
+ *
193
+ * Painted the same way the fill is: one `Graphics2D` per token, all sharing the
194
+ * centre frame, each scaled by its token's animated opacity — so a morph
195
+ * carries the overlay along with the glyph it is laid over instead of leaving
196
+ * a wash hanging over glyphs that have faded out.
197
+ *
198
+ * The stroke is *not* re-drawn here. `renderSelf` already strokes each token
199
+ * (there is no silhouette for the deferred {@link ShapeNode.renderStroke} to
200
+ * outline), so it is painted under the overlay rather than over it — the one
201
+ * place this node's draw order differs from a plain shape's, and the price of
202
+ * a stroke that follows glyphs rather than a box.
203
+ */
204
+ protected renderOverlay(ctx: RenderContext2D): void;
205
+ /**
206
+ * Draws every visible token's path once, handing each one to `paint` to have
207
+ * its paint ops appended.
208
+ *
209
+ * A fresh `Graphics2D` per token per pass, because `.fill()`/`.stroke()` push
210
+ * onto one op list and return `this` — a silhouette shared between the fill
211
+ * pass and the overlay pass would accumulate both.
212
+ */
213
+ private eachToken;
214
+ }
215
+ //# sourceMappingURL=node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/tex/node.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,eAAe,EAAc,cAAc,EAA6B,UAAU,EAAW,SAAS,EAAE,UAAU,EAClH,WAAW,EAAE,MAAM,EAAE,eAAe,EAAgB,cAAc,EACjB,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,KAAK,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,IAAI,EAE9H,MAAM,mBAAmB,CAAC;AAQ3B,OAAO,EAAyC,KAAK,kBAAkB,EAAE,MAAM,SAAS,CAAC;AACzF,OAAO,EACoD,KAAK,QAAQ,EACvE,MAAM,mBAAmB,CAAC;AAG3B,MAAM,WAAW,UAAW,SAAQ,UAAU;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,WAAW,CAAC;IACrB,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;CACnB;AAOD;;;;;;;;GAQG;AACH,MAAM,WAAW,eAAe;IAC5B,iFAAiF;IACjF,KAAK,CAAC,EAAE,kBAAkB,CAAC;CAC9B;AAED,qBA2Ba,KAAM,SAAQ,SAAS,CAAC,UAAU,CAAC;IAC5C,SAA4C,KAAK,EAAE,MAAM,CAAC;IAC1D,SAA4C,QAAQ,EAAE,MAAM,CAAC;IAC7D,SAAmC,OAAO,EAAE,cAAc,CAAC;IAE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