@motionscript/math 0.1.0-alpha.5 → 0.1.0-alpha.6
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.
- package/CHANGELOG.md +22 -0
- package/README.md +39 -33
- package/dist/annotate/angle-mark.d.ts +52 -27
- package/dist/annotate/angle-mark.d.ts.map +1 -1
- package/dist/annotate/angle-mark.js +80 -115
- package/dist/annotate/angle-mark.js.map +1 -1
- package/dist/annotate/curly-brace.d.ts +59 -25
- package/dist/annotate/curly-brace.d.ts.map +1 -1
- package/dist/annotate/curly-brace.js +85 -100
- package/dist/annotate/curly-brace.js.map +1 -1
- package/dist/annotate/emphasis-mark.d.ts +43 -9
- package/dist/annotate/emphasis-mark.d.ts.map +1 -1
- package/dist/annotate/emphasis-mark.js +33 -34
- package/dist/annotate/emphasis-mark.js.map +1 -1
- package/dist/browser/chunks/chunk-ABYBW64J.js +2 -0
- package/dist/browser/chunks/chunk-ABYBW64J.js.map +7 -0
- package/dist/browser/chunks/chunk-K77KLQX4.js +2 -0
- package/dist/browser/chunks/chunk-K77KLQX4.js.map +7 -0
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +3 -3
- package/dist/browser/kit.js +1 -1
- package/dist/browser/manifest.json +1 -1
- package/dist/browser/tex.js +1 -1
- package/dist/browser/tex.js.map +2 -2
- package/dist/engine.d.ts +26 -19
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +17 -14
- package/dist/engine.js.map +1 -1
- package/dist/kit/component.d.ts +51 -0
- package/dist/kit/component.d.ts.map +1 -0
- package/dist/kit/component.js +30 -0
- package/dist/kit/component.js.map +1 -0
- package/dist/kit/curve.d.ts +22 -11
- package/dist/kit/curve.d.ts.map +1 -1
- package/dist/kit/curve.js +25 -18
- package/dist/kit/curve.js.map +1 -1
- package/dist/kit/field-mark.d.ts +58 -35
- package/dist/kit/field-mark.d.ts.map +1 -1
- package/dist/kit/field-mark.js +100 -120
- package/dist/kit/field-mark.js.map +1 -1
- package/dist/kit/follow.d.ts +67 -29
- package/dist/kit/follow.d.ts.map +1 -1
- package/dist/kit/follow.js +114 -110
- package/dist/kit/follow.js.map +1 -1
- package/dist/kit/furniture.d.ts +3 -1
- package/dist/kit/furniture.d.ts.map +1 -1
- package/dist/kit/furniture.js +5 -0
- package/dist/kit/furniture.js.map +1 -1
- package/dist/kit/graph.d.ts +46 -0
- package/dist/kit/graph.d.ts.map +1 -0
- package/dist/kit/graph.js +90 -0
- package/dist/kit/graph.js.map +1 -0
- package/dist/kit/mark.d.ts +64 -39
- package/dist/kit/mark.d.ts.map +1 -1
- package/dist/kit/mark.js +80 -96
- package/dist/kit/mark.js.map +1 -1
- package/dist/kit/place.d.ts +10 -8
- package/dist/kit/place.d.ts.map +1 -1
- package/dist/kit/place.js +28 -30
- package/dist/kit/place.js.map +1 -1
- package/dist/kit/system.d.ts +27 -29
- package/dist/kit/system.d.ts.map +1 -1
- package/dist/kit/system.js +62 -58
- package/dist/kit/system.js.map +1 -1
- package/dist/kit/withdrawn.d.ts +3 -3
- package/dist/kit/withdrawn.js +3 -3
- package/dist/kit/withdrawn.js.map +1 -1
- package/dist/marks/curve-area.d.ts +24 -18
- package/dist/marks/curve-area.d.ts.map +1 -1
- package/dist/marks/curve-area.js +50 -73
- package/dist/marks/curve-area.js.map +1 -1
- package/dist/marks/drop-lines.d.ts +28 -10
- package/dist/marks/drop-lines.d.ts.map +1 -1
- package/dist/marks/drop-lines.js +37 -52
- package/dist/marks/drop-lines.js.map +1 -1
- package/dist/marks/plot-point.d.ts +37 -20
- package/dist/marks/plot-point.d.ts.map +1 -1
- package/dist/marks/plot-point.js +65 -91
- package/dist/marks/plot-point.js.map +1 -1
- package/dist/marks/riemann-sum.d.ts +30 -26
- package/dist/marks/riemann-sum.d.ts.map +1 -1
- package/dist/marks/riemann-sum.js +57 -85
- package/dist/marks/riemann-sum.js.map +1 -1
- package/dist/marks/tangent-line.d.ts +38 -14
- package/dist/marks/tangent-line.d.ts.map +1 -1
- package/dist/marks/tangent-line.js +73 -87
- package/dist/marks/tangent-line.js.map +1 -1
- package/dist/marks/vector-arrow.d.ts +30 -20
- package/dist/marks/vector-arrow.d.ts.map +1 -1
- package/dist/marks/vector-arrow.js +58 -78
- package/dist/marks/vector-arrow.js.map +1 -1
- package/dist/nodes.d.ts +13 -5
- package/dist/nodes.d.ts.map +1 -1
- package/dist/nodes.js +0 -6
- package/dist/nodes.js.map +1 -1
- package/dist/plots/function-plot.d.ts +107 -43
- package/dist/plots/function-plot.d.ts.map +1 -1
- package/dist/plots/function-plot.js +146 -177
- package/dist/plots/function-plot.js.map +1 -1
- package/dist/plots/points-plot.d.ts +34 -19
- package/dist/plots/points-plot.d.ts.map +1 -1
- package/dist/plots/points-plot.js +31 -58
- package/dist/plots/points-plot.js.map +1 -1
- package/dist/plots/stream-lines.d.ts +38 -19
- package/dist/plots/stream-lines.d.ts.map +1 -1
- package/dist/plots/stream-lines.js +60 -79
- package/dist/plots/stream-lines.js.map +1 -1
- package/dist/plots/traced-path.d.ts +34 -15
- package/dist/plots/traced-path.d.ts.map +1 -1
- package/dist/plots/traced-path.js +33 -48
- package/dist/plots/traced-path.js.map +1 -1
- package/dist/plots/vector-field.d.ts +31 -11
- package/dist/plots/vector-field.d.ts.map +1 -1
- package/dist/plots/vector-field.js +50 -64
- package/dist/plots/vector-field.js.map +1 -1
- package/dist/structures/network-graph.d.ts +99 -49
- package/dist/structures/network-graph.d.ts.map +1 -1
- package/dist/structures/network-graph.js +168 -217
- package/dist/structures/network-graph.js.map +1 -1
- package/dist/structures/sample-space.d.ts +69 -38
- package/dist/structures/sample-space.d.ts.map +1 -1
- package/dist/structures/sample-space.js +132 -170
- package/dist/structures/sample-space.js.map +1 -1
- package/dist/systems/axes2d.d.ts +126 -37
- package/dist/systems/axes2d.d.ts.map +1 -1
- package/dist/systems/axes2d.js +147 -183
- package/dist/systems/axes2d.js.map +1 -1
- package/dist/systems/number-line.d.ts +51 -28
- package/dist/systems/number-line.d.ts.map +1 -1
- package/dist/systems/number-line.js +82 -118
- package/dist/systems/number-line.js.map +1 -1
- package/dist/systems/number-plane.d.ts +92 -31
- package/dist/systems/number-plane.d.ts.map +1 -1
- package/dist/systems/number-plane.js +142 -149
- package/dist/systems/number-plane.js.map +1 -1
- package/dist/systems/polar-plane.d.ts +47 -26
- package/dist/systems/polar-plane.d.ts.map +1 -1
- package/dist/systems/polar-plane.js +107 -133
- package/dist/systems/polar-plane.js.map +1 -1
- package/dist/tex/index.d.ts.map +1 -1
- package/dist/tex/index.js +1 -0
- package/dist/tex/index.js.map +1 -1
- package/dist/tex/matrix.d.ts +56 -18
- package/dist/tex/matrix.d.ts.map +1 -1
- package/dist/tex/matrix.js +33 -50
- package/dist/tex/matrix.js.map +1 -1
- package/dist/tex/node.d.ts +55 -201
- package/dist/tex/node.d.ts.map +1 -1
- package/dist/tex/node.js +23 -593
- package/dist/tex/node.js.map +1 -1
- package/dist/tex/typeset.d.ts +133 -0
- package/dist/tex/typeset.d.ts.map +1 -0
- package/dist/tex/typeset.js +403 -0
- package/dist/tex/typeset.js.map +1 -0
- package/dist/three/axes3d.d.ts +140 -54
- package/dist/three/axes3d.d.ts.map +1 -1
- package/dist/three/axes3d.js +159 -204
- package/dist/three/axes3d.js.map +1 -1
- package/dist/three/curve-plot3d.d.ts +70 -42
- package/dist/three/curve-plot3d.d.ts.map +1 -1
- package/dist/three/curve-plot3d.js +97 -132
- package/dist/three/curve-plot3d.js.map +1 -1
- package/dist/three/entries.d.ts +17 -0
- package/dist/three/entries.d.ts.map +1 -0
- package/dist/three/entries.js +15 -0
- package/dist/three/entries.js.map +1 -0
- package/dist/three/plot-point3d.d.ts +57 -12
- package/dist/three/plot-point3d.d.ts.map +1 -1
- package/dist/three/plot-point3d.js +27 -53
- package/dist/three/plot-point3d.js.map +1 -1
- package/dist/three/space.d.ts +17 -2
- package/dist/three/space.d.ts.map +1 -1
- package/dist/three/space.js +19 -8
- package/dist/three/space.js.map +1 -1
- package/dist/three/surface-plot3d.d.ts +131 -49
- package/dist/three/surface-plot3d.d.ts.map +1 -1
- package/dist/three/surface-plot3d.js +227 -261
- package/dist/three/surface-plot3d.js.map +1 -1
- package/dist/three/vector-arrow3d.d.ts +58 -16
- package/dist/three/vector-arrow3d.d.ts.map +1 -1
- package/dist/three/vector-arrow3d.js +48 -67
- package/dist/three/vector-arrow3d.js.map +1 -1
- package/package.json +4 -4
- package/src/annotate/angle-mark.ts +95 -105
- package/src/annotate/curly-brace.ts +107 -85
- package/src/annotate/emphasis-mark.ts +55 -26
- package/src/engine.ts +35 -21
- package/src/kit/component.ts +57 -0
- package/src/kit/curve.ts +38 -20
- package/src/kit/field-mark.ts +124 -108
- package/src/kit/follow.ts +146 -120
- package/src/kit/furniture.ts +6 -1
- package/src/kit/graph.ts +116 -0
- package/src/kit/mark.ts +135 -114
- package/src/kit/place.ts +32 -56
- package/src/kit/system.ts +77 -71
- package/src/kit/withdrawn.ts +3 -3
- package/src/marks/curve-area.ts +65 -65
- package/src/marks/drop-lines.ts +50 -42
- package/src/marks/plot-point.ts +77 -82
- package/src/marks/riemann-sum.ts +73 -72
- package/src/marks/tangent-line.ts +87 -71
- package/src/marks/vector-arrow.ts +73 -73
- package/src/nodes.ts +41 -5
- package/src/plots/function-plot.ts +155 -171
- package/src/plots/points-plot.ts +46 -50
- package/src/plots/stream-lines.ts +75 -66
- package/src/plots/traced-path.ts +51 -33
- package/src/plots/vector-field.ts +68 -49
- package/src/structures/network-graph.ts +168 -185
- package/src/structures/sample-space.ts +149 -148
- package/src/systems/axes2d.ts +165 -156
- package/src/systems/number-line.ts +91 -92
- package/src/systems/number-plane.ts +149 -120
- package/src/systems/polar-plane.ts +117 -116
- package/src/tex/index.ts +2 -1
- package/src/tex/matrix.ts +62 -40
- package/src/tex/node.ts +54 -621
- package/src/tex/typeset.ts +461 -0
- package/src/three/axes3d.ts +182 -161
- package/src/three/curve-plot3d.ts +107 -110
- package/src/three/entries.ts +42 -0
- package/src/three/plot-point3d.ts +42 -45
- package/src/three/space.ts +34 -9
- package/src/three/surface-plot3d.ts +312 -323
- package/src/three/vector-arrow3d.ts +65 -54
- package/dist/browser/chunks/chunk-3GJB6AVO.js +0 -2
- package/dist/browser/chunks/chunk-3GJB6AVO.js.map +0 -7
- package/dist/browser/chunks/chunk-D5WHCVBC.js +0 -2
- package/dist/browser/chunks/chunk-D5WHCVBC.js.map +0 -7
- package/dist/browser/chunks/chunk-WL4KEX7Y.js +0 -2
- package/dist/browser/chunks/chunk-WL4KEX7Y.js.map +0 -7
- package/src/kit/placement.ts +0 -8
package/dist/tex/node.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.js","sourceRoot":"","sources":["../../src/tex/node.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACc,UAAU,EAAkB,OAAO,EAAE,IAAI,EAAE,UAAU,EAAc,OAAO,EAAE,SAAS,EAChE,YAAY,EAAkB,QAAQ,EAAE,cAAc,EAC5E,YAAY,EAAE,OAAO,EAAE,QAAQ,GAElD,MAAM,mBAAmB,CAAC;AAC3B,gFAAgF;AAChF,0EAA0E;AAC1E,qDAAqD;AACrD,OAAO,EACH,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,WAAW,EAAE,cAAc,GAE1F,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,iBAAiB,EAA+C,MAAM,SAAS,CAAC;AACzF,OAAO,EACH,aAAa,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,GACxD,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAUhD,+DAA+D;AAC/D,MAAM,aAAa,GAAG,GAAG,CAAC;AAC1B,wEAAwE;AACxE,MAAM,YAAY,GAAG,CAAC,GAAG,EAAE,CAAC;AA2CrB,IAAM,KAAK,GAAX,MAAM,KAAM,SAAQ,SAAqB;IAc5C;;;;OAIG;IACc,KAAK,CAAqB;IAEnC,eAAe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phics2D, EasingFunction, command, node, lerpNumber, NodeConfig, pathOps, ShapeNode, ShapeProps,\r\n InsetsProps, Size2D, SizeConstraints, toPathString, InsetsResolved, property, insetsProperty, FillResolved, ShadowResolved,\r\n StrokeResolved, driveCommand, fillOps, withdraw, type AssetScope, type BoxBounds, type Command, type CommandArgs, type Fill,\r\n type TweenStepper,\r\n} from \"@motionscript/sdk\";\r\n// From each module, never the `../engine` barrel: it re-exports this file, so a\r\n// load that enters through the barrel runs this class's decorators before\r\n// `OUTLINE_TRIM` exists and the kit fails to import.\r\nimport {\r\n blankLatex, buildLatexPath, findLatexParts, LatexNotLoaded, loadMathJax, MATHJAX_LOADER,\r\n type LatexPart, type LatexToken,\r\n} from \"./geometry\";\r\nimport { defaultLatexMorph, type AnimatedToken, type LatexMorphStrategy } from \"./tween\";\r\nimport {\r\n lerpPartFills, partPaint, readPartFills, withPartFill, type PartFill, type PartFillResolved,\r\n} from \"../kit/part-fills\";\r\nimport { OUTLINE_TRIM } from \"../kit/withdrawn\";\r\n\r\nexport interface LatexProps extends ShapeProps {\r\n latex: string;\r\n fontSize: number;\r\n padding: InsetsProps;\r\n partFills: PartFill[];\r\n written: number;\r\n}\r\n\r\n/** How much of one glyph's writing overlaps the next one's. */\r\nconst WRITE_OVERLAP = 0.6;\r\n/** The outline a glyph is written with, as a share of the type size. */\r\nconst WRITE_STROKE = 1 / 32;\r\n\r\n/**\r\n * Construction-time-only options: pluggable engine behavior, set once when\r\n * the node is created. Deliberately *not* part of {@link LatexProps} — every\r\n * `@property` field accepts either a value or a zero-arg reactive binding\r\n * (`value | (() => value)`, see `PropInputs`), and the node's own reactive\r\n * write path (`_writeProp`) treats any function value as the latter. A\r\n * strategy *is* a function, so it can't be told apart from a binding that\r\n * computes one — it has to stay outside the reactive prop system entirely.\r\n */\r\nexport interface LatexStrategies {\r\n /** How the node morphs between two formulas. Defaults to `defaultLatexMorph`. */\r\n morph?: LatexMorphStrategy;\r\n}\r\n\r\n@node({\r\n key: \"latex\",\r\n parentKey: \"shape\",\r\n forkable: true,\r\n layout: {\r\n children: \"freeform\",\r\n defaultWidthMode: \"hug\",\r\n defaultHeightMode: \"hug\",\r\n acceptsChildren: true,\r\n },\r\n seed: {\r\n fill: [\r\n {\r\n type: \"solid\",\r\n color: [\r\n 0.412,\r\n 0.565,\r\n 0.867,\r\n 1,\r\n ],\r\n opacity: 1,\r\n enabled: true,\r\n },\r\n ],\r\n },\r\n})\r\n@withdraw(...OUTLINE_TRIM)\r\nexport class Latex extends ShapeNode<LatexProps> {\r\n @property({ default: \"\" }) declare readonly latex: string;\r\n @property({ default: 16 }) declare readonly fontSize: number;\r\n @insetsProperty() declare readonly padding: InsetsResolved;\r\n\r\n /** Paints for parts of the formula, named by their source. Later entries win where two name a glyph. */\r\n @property({ default: [], mapper: readPartFills, tween: lerpPartFills, kind: \"vector\" }) declare partFills: PartFill[];\r\n\r\n /**\r\n * How much of the formula is written, 0 to 1: its glyphs are drawn one after\r\n * another, each outlined and then filled.\r\n */\r\n @property({ default: 1, min: 0, max: 1, step: 0.01 }) declare written: number;\r\n\r\n /**\r\n * How this node morphs between two formulas. Construction-time-only (see\r\n * {@link LatexStrategies}) — resolved once here rather than left as\r\n * `?? defaultLatexMorph` at every call site.\r\n */\r\n private readonly morph: LatexMorphStrategy;\r\n\r\n private _intrinsicWidth: number = 0;\r\n private _intrinsicHeight: number = 0;\r\n\r\n /**\r\n * Shared center frame for all current tokens, [minX, minY, maxX, maxY] in\r\n * token space. Passed to every per-token path so glyphs keep their relative\r\n * layout instead of each centering on its own bbox.\r\n */\r\n private _bounds: [number, number, number, number] = [0, 0, 0, 0];\r\n\r\n /** Current tokens to render. Each has its own opacity for tween transitions. */\r\n private _tokens: AnimatedToken[] = [];\r\n\r\n /** The parts of the formula `_tokens` was built from; empty while a morph holds the tokens. */\r\n private _parts: LatexPart[] = [];\r\n\r\n /** While a morph holds the tokens: each end's colours by token, and how far between them it is. */\r\n private _morphFills: { from: TokenFills; to: TokenFills; t: number } | null = null;\r\n\r\n /**\r\n * How far through a morph the playhead is, in `(0, 1)` while one is\r\n * driving frames and `0` otherwise: the node's own signal, not a prop an\r\n * author states.\r\n *\r\n * A prop rather than a field because it is the one thing the timeline\r\n * restores. The morph writes the tokens, the box and the intrinsic size\r\n * straight onto the node, so nothing else says whether what is on screen is\r\n * a morph frame; and a seek from inside a morph to a time before it\r\n * evaluates no command at all. Restored to `0` with every other prop, this\r\n * is how the node learns the playhead has left the morph.\r\n */\r\n @property({ default: 0, animatable: false }) declare morphProgress: number;\r\n\r\n /** Suppresses retokenization while a custom to() is driving frames. */\r\n private _animating: boolean = false;\r\n\r\n /** The `fontSize|latex` the live tokens were built from. See {@link _ensureTokens}. */\r\n private _tokenizedFrom: string | null = null;\r\n\r\n constructor(props?: NodeConfig<Latex, LatexProps> & LatexStrategies) {\r\n super(props);\r\n this.morph = props?.morph ?? defaultLatexMorph;\r\n this.applyProp(\"width\", props?.width ?? \"hug\");\r\n this.applyProp(\"height\", props?.height ?? \"hug\");\r\n\r\n this._ensureTokens();\r\n }\r\n\r\n /**\r\n * Rebuild the token list when the formula or size has moved since it last\r\n * was built.\r\n *\r\n * Pulled from every reader rather than pushed from a prop write, because\r\n * `latex` can be a binding — and a binding has no write to hang a\r\n * subscription on. The key is what the current tokens were built from;\r\n * `_animating` hands ownership to the morph command for its open interval.\r\n */\r\n private _ensureTokens(): void {\r\n if (this._animating) {\r\n if (this.morphProgress > 0 && this.morphProgress < 1) return;\r\n // The playhead left the morph without it committing either end (a seek\r\n // back to before it evaluates no command), so what is held is a stale\r\n // morph frame. Hand the tokens back to the props.\r\n this._animating = false;\r\n this._morphFills = null;\r\n this._tokenizedFrom = null;\r\n }\r\n const key = `${this.fontSize}|${this._source()}`;\r\n if (key === this._tokenizedFrom) return;\r\n // Recorded once the tokens are built, so a formula that cannot be\r\n // typeset fails on every read instead of the first and then reads as\r\n // blank. Before MathJax is here the node is blank, and is asked again.\r\n try {\r\n this._updateTokens();\r\n } catch (error) {\r\n if (!(error instanceof LatexNotLoaded)) throw error;\r\n this._clearTokens();\r\n return;\r\n }\r\n this._tokenizedFrom = key;\r\n }\r\n\r\n /** MathJax, before this node is laid out: a scene with no formula in it never loads it. */\r\n override declareAssets(assets: AssetScope): void {\r\n super.declareAssets(assets);\r\n assets.loader(MATHJAX_LOADER, loadMathJax, { gate: \"layout\" });\r\n }\r\n\r\n /** @internal The formula typeset once `next` is laid over the node's own props: `latex` here, a subclass's own props there. */\r\n _source(next: Partial<LatexProps> = {}): string {\r\n return next.latex ?? this.latex;\r\n }\r\n\r\n /** @internal The props that state the formula, as `next` leaves them: what a morph commits at its end. */\r\n _sourceProps(next: Partial<LatexProps> = {}): Partial<LatexProps> {\r\n return { latex: this._source(next) };\r\n }\r\n\r\n /** @internal Whether `next` re-sets the glyphs, and so is a morph rather than an ordinary tween. */\r\n _resets(next: Partial<LatexProps>): boolean {\r\n return next.latex !== undefined || next.fontSize !== undefined;\r\n }\r\n\r\n private _updateTokens() {\r\n const source = this._source();\r\n if (source) {\r\n const result = buildLatexPath(source, this.fontSize);\r\n this._intrinsicWidth = result.width;\r\n this._intrinsicHeight = result.height;\r\n this._bounds = result.bounds;\r\n this._parts = result.parts;\r\n this._tokens = result.tokens.map(t => ({\r\n token: t.token,\r\n path: t.path,\r\n term: t.term,\r\n opacity: 1,\r\n x: 0,\r\n y: 0,\r\n }));\r\n } else {\r\n this._clearTokens();\r\n }\r\n }\r\n\r\n private _clearTokens(): void {\r\n this._tokens = [];\r\n this._parts = [];\r\n this._intrinsicWidth = 0;\r\n this._intrinsicHeight = 0;\r\n this._bounds = [0, 0, 0, 0];\r\n }\r\n\r\n override measure(constraints: SizeConstraints): Partial<Size2D> {\r\n this._ensureTokens();\r\n const pad = this.padding;\r\n const wm = this.width;\r\n const hm = this.height;\r\n\r\n const resolvedW = typeof wm === \"number\"\r\n ? wm\r\n : wm === \"hug\"\r\n ? this._intrinsicWidth + pad.left + pad.right\r\n : constraints.maxWidth ?? 0;\r\n\r\n const resolvedH = typeof hm === \"number\"\r\n ? hm\r\n : hm === \"hug\"\r\n ? this._intrinsicHeight + pad.top + pad.bottom\r\n : constraints.maxHeight ?? 0;\r\n\r\n return { width: resolvedW, height: resolvedH };\r\n }\r\n\r\n /**\r\n * A LaTeX morph — one {@link Command}, like every other `to()`.\r\n *\r\n * Sequence two of them with `sequence(...)` rather than chaining: the chain\r\n * builder this used to return existed only so `latexRef().to(a, 1).to(b, 1)`\r\n * would read as two steps, and it could not compose with anything that was\r\n * not another Latex morph.\r\n */\r\n override to<D extends Partial<LatexProps> = Partial<LatexProps>>(args: CommandArgs<D> & { duration: number }): Command<LatexProps> {\r\n const data: Partial<LatexProps> = args.data ?? {};\r\n // Only a new formula or size re-sets the glyphs; anything else is an ordinary tween.\r\n if (!this._resets(data)) return super.to(args) as Command<LatexProps>;\r\n return this._buildMorph(data, args.duration, args.easing);\r\n }\r\n\r\n /**\r\n * Morph this formula into another — a document-facing name for {@link to},\r\n * which already routes through {@link _buildMorph}.\r\n */\r\n @command({ args: [{ key: \"latex\", kind: \"text\", multiline: true }] })\r\n morphTo(args: CommandArgs<{ latex: string }> & { duration: number }): Command<LatexProps> {\r\n return this.to({ data: { latex: args.data?.latex } as Partial<LatexProps>, duration: args.duration, easing: args.easing });\r\n }\r\n\r\n /** Write the formula on, or off: its glyphs one after another, each outlined and then filled. */\r\n @command({ args: [\"written\"] })\r\n writeTo(args: CommandArgs<{ written: number }> & { duration: number }): Command<LatexProps> {\r\n const written = args.data?.written;\r\n return super.to({ data: written === undefined ? {} : { written }, duration: args.duration, easing: args.easing });\r\n }\r\n\r\n /** Paint one part of the formula, leaving the rest as it is. */\r\n @command({\r\n args: [\r\n { key: \"part\", kind: \"text\", default: \"\" },\r\n { key: \"fill\", kind: \"fills\", default: \"#facc15\" },\r\n { key: \"occurrence\", kind: \"number\", min: 0, step: 1, default: 0 },\r\n ],\r\n })\r\n partFillTo(args: CommandArgs<{ part: string; fill: Fill; occurrence?: number }> & { duration: number }): Command<LatexProps> {\r\n const { part, fill, occurrence = 0 } = args.data ?? {};\r\n if (!part || fill == null) return super.to({ data: {}, duration: args.duration, easing: args.easing });\r\n const partFills = withPartFill(this.partFills as unknown as PartFillResolved[], { part, fill, occurrence });\r\n return super.to({ data: { partFills }, duration: args.duration, easing: args.easing });\r\n }\r\n\r\n /**\r\n * The box around one part of the formula, centred on the node's own centre\r\n * and y-up, or `null` when the formula does not write `part`. `occurrence`\r\n * counts from 1.\r\n */\r\n partBounds(part: string, occurrence = 1): BoxBounds | null {\r\n this._ensureTokens();\r\n const span = findLatexParts(this._parts, part)[Math.max(1, Math.round(occurrence)) - 1];\r\n if (!span) return null;\r\n const box = pathOps.bounds(this._tokens.slice(span[0], span[1]).flatMap((token) => token.path));\r\n if (!box) return null;\r\n const [minX, minY, maxX, maxY] = this._bounds;\r\n const cx = (minX + maxX) / 2;\r\n const cy = (minY + maxY) / 2;\r\n return {\r\n x: (box.minX + box.maxX) / 2 - cx,\r\n y: cy - (box.minY + box.maxY) / 2,\r\n width: box.maxX - box.minX,\r\n height: box.maxY - box.minY,\r\n };\r\n }\r\n\r\n /**\r\n * Build a single LaTeX morph as a {@link Command}: every ordinary\r\n * `ShapeProps` field (via the inherited `_prepareStep`), plus the\r\n * intrinsic size, shared center frame and per-glyph token list — state a\r\n * plain `set()` can't reach — driven together by one eased `t`, matching\r\n * the concurrent `parallel` the generator version ran.\r\n *\r\n * The \"from\" snapshot (`fromTokens`, `fromLatex`, …) is captured\r\n * **lazily, on the command's first evaluation**, not when this is called.\r\n * That is what lets two morphs be sequenced: `commandSequence` settles each\r\n * prior step before evaluating the next, so a second morph's \"from\" reads\r\n * the first one's end state rather than whatever the node held before either\r\n * of them ran.\r\n *\r\n * `_animating` suppresses {@link _ensureTokens} for the open interval, and\r\n * both ends commit: `t === 1`\r\n * lands on the target formula, `t === 0` restores the source one — the same\r\n * \"membership for the open interval, commit at either end\" shape\r\n * `packages/components/code`'s `runTransition` uses, so seeking into either\r\n * side of the morph (not just running it forward) shows the right thing.\r\n *\r\n * `@internal` — the entry point for authors is {@link to}.\r\n */\r\n _buildMorph(to: Partial<LatexProps>, duration: number, easing?: EasingFunction): Command<LatexProps> {\r\n // Not in a tree: no box, no timeline. The command keeps its length and\r\n // writes nothing, as every command built through `Node` does.\r\n if (!this.mounted) return driveCommand(duration, () => { }) as Command<LatexProps>;\r\n let setupDone = false;\r\n let fromAnimTokens: AnimatedToken[] = [];\r\n let fromLatex = \"\";\r\n let fromProps: Partial<LatexProps> = {};\r\n let fromFontSize = 0;\r\n let fromWidth = 0;\r\n let fromHeight = 0;\r\n let fromBounds: [number, number, number, number] = [0, 0, 0, 0];\r\n let fromParts: LatexPart[] = [];\r\n let fromFills: TokenFills = [];\r\n let toFills: TokenFills = [];\r\n let toFontSize = 0;\r\n let toLatex = \"\";\r\n let toResult: ReturnType<typeof buildLatexPath>;\r\n let propStep: TweenStepper;\r\n let latexFrame: (t: number) => AnimatedToken[];\r\n\r\n const setup = (): void => {\r\n setupDone = true;\r\n this._ensureTokens();\r\n const fromTokens: LatexToken[] = this._tokens.map(t => ({ token: t.token, path: t.path, term: t.term }));\r\n fromAnimTokens = this._tokens.map(t => ({ ...t }));\r\n fromLatex = this._source();\r\n fromProps = this._sourceProps();\r\n fromFontSize = this.fontSize;\r\n fromWidth = this._intrinsicWidth;\r\n fromHeight = this._intrinsicHeight;\r\n fromBounds = this._bounds;\r\n fromParts = this._parts;\r\n\r\n toFontSize = to.fontSize !== undefined ? to.fontSize : this.fontSize;\r\n toLatex = this._source(to);\r\n try {\r\n toResult = buildLatexPath(toLatex, toFontSize);\r\n } catch (error) {\r\n if (!(error instanceof LatexNotLoaded)) throw error;\r\n toResult = blankLatex();\r\n }\r\n\r\n propStep = this._prepareStep(to, duration);\r\n latexFrame = this.morph(fromTokens, toResult.tokens);\r\n const partFills = this.partFills as unknown as PartFillResolved[];\r\n fromFills = fillsByToken(partFills, fromParts, fromTokens.length);\r\n toFills = fillsByToken(partFills, toResult.parts, toResult.tokens.length);\r\n };\r\n\r\n return driveCommand(duration, (t) => {\r\n if (!setupDone) setup();\r\n const toBounds = toResult.bounds;\r\n\r\n this._animating = true;\r\n this.morphProgress = t;\r\n propStep.seek(t * duration);\r\n this.set({ fontSize: lerpNumber(fromFontSize, toFontSize, t) });\r\n // Track the measured size so a hugging box grows/shrinks smoothly\r\n // across the morph rather than jumping when the end commits.\r\n this._intrinsicWidth = lerpNumber(fromWidth, toResult.width, t);\r\n this._intrinsicHeight = lerpNumber(fromHeight, toResult.height, t);\r\n // Interpolate the shared center frame in lockstep so glyphs stay\r\n // centered within the resizing box.\r\n this._bounds = [\r\n lerpNumber(fromBounds[0], toBounds[0], t),\r\n lerpNumber(fromBounds[1], toBounds[1], t),\r\n lerpNumber(fromBounds[2], toBounds[2], t),\r\n lerpNumber(fromBounds[3], toBounds[3], t),\r\n ];\r\n this._tokens = latexFrame(t);\r\n this._parts = [];\r\n this._morphFills = { from: fromFills, to: toFills, t };\r\n\r\n if (t >= 1) {\r\n this.set({ ...this._sourceProps(to), fontSize: toFontSize });\r\n this._parts = toResult.parts;\r\n this._tokens = toResult.tokens.map(tok => ({ token: tok.token, path: tok.path, term: tok.term, opacity: 1, x: 0, y: 0 }));\r\n this._intrinsicWidth = toResult.width;\r\n this._intrinsicHeight = toResult.height;\r\n this._bounds = toResult.bounds;\r\n this._animating = false;\r\n this._morphFills = null;\r\n this.morphProgress = 0;\r\n this._tokenizedFrom = `${toFontSize}|${toLatex}`;\r\n } else if (t <= 0) {\r\n this.set({ ...fromProps, fontSize: fromFontSize });\r\n this._parts = fromParts;\r\n this._tokens = fromAnimTokens;\r\n this._intrinsicWidth = fromWidth;\r\n this._intrinsicHeight = fromHeight;\r\n this._bounds = fromBounds;\r\n this._animating = false;\r\n this._morphFills = null;\r\n this.morphProgress = 0;\r\n this._tokenizedFrom = `${fromFontSize}|${fromLatex}`;\r\n }\r\n }, easing) as Command<LatexProps>;\r\n }\r\n\r\n /**\r\n * The shadow op comes **first**, as it does on every other painted node.\r\n *\r\n * The renderer does not draw a shadow when it sees one: `.shadow()` stores\r\n * it pending and the *next* fill or stroke op casts it (`_shadow` →\r\n * `storePendingShadows`, `_fill`/`_stroke` → `takePendingShadows`). Appended\r\n * last, it was stored by every token and then thrown away by the reset at\r\n * the end of the draw — a shadow set on a LaTeX node simply never appeared,\r\n * with no error to say why. Same failure {@link PaintedNode.renderStroke}\r\n * documents for a fill-less stroked shape, and the same one-op fix.\r\n *\r\n * Order also carries the fill-less case for free: an empty fill returns\r\n * before it takes the pending shadow, so the stroke below casts it from the\r\n * glyph outlines instead — which is what `castsShadowFromStroke` arranges on\r\n * a plain shape.\r\n */\r\n protected renderSelf(ctx: RenderContext2D): void {\r\n const fills = this.fill as FillResolved[];\r\n const shadows = this.shadow as ShadowResolved[];\r\n const partOf = this._tokenFills();\r\n const writing = this._writing();\r\n this.eachToken(ctx, (graphics, opacity, index, token) => {\r\n const fill = partPaint(fills, partOf(index, token));\r\n const pen = writing?.(index);\r\n if (!pen) {\r\n return graphics\r\n .shadow(scaleShadowOpacity(shadows, opacity))\r\n .fill(scaleFillopacity(fill, opacity))\r\n .stroke(this.stroke);\r\n }\r\n if (pen.filled <= 0) return null;\r\n return graphics\r\n .shadow(scaleShadowOpacity(shadows, opacity * pen.filled))\r\n .fill(scaleFillopacity(fill, opacity * pen.filled))\r\n .stroke(this.stroke);\r\n });\r\n if (!writing) return;\r\n // The pen's line: each glyph's outline, in its own colour, ahead of its fill.\r\n const own = this.stroke as StrokeResolved[];\r\n this.eachToken(ctx, (graphics, opacity, index, token) => {\r\n const pen = writing(index);\r\n if (!pen || pen.filled >= 1 || pen.outlined <= 0) return null;\r\n const fill = scaleFillopacity(partPaint(fills, partOf(index, token)), opacity * (1 - pen.filled));\r\n return graphics.stroke(own.length > 0 ? own : penStroke(this.fontSize * WRITE_STROKE, fill));\r\n }, (index) => writing(index)?.outlined ?? 1);\r\n }\r\n\r\n /** Each token's part fill: by its place in the formula at rest, by both ends' mid-morph. */\r\n private _tokenFills(): (index: number, token: AnimatedToken) => PartFillResolved | undefined {\r\n const morph = this._morphFills;\r\n if (morph) {\r\n return (_index, token) => {\r\n const a = token.from === undefined ? undefined : morph.from[token.from];\r\n const b = token.to === undefined ? undefined : morph.to[token.to];\r\n if (a && b) return { ...b, fill: fillOps.lerp(a.fill, b.fill, morph.t), mix: lerpNumber(a.mix, b.mix, morph.t) };\r\n if (a) return token.to === undefined ? a : { ...a, mix: a.mix * (1 - morph.t) };\r\n if (b) return token.from === undefined ? b : { ...b, mix: b.mix * morph.t };\r\n return undefined;\r\n };\r\n }\r\n const partFills = this.partFills as unknown as PartFillResolved[];\r\n if (partFills.length === 0) return () => undefined;\r\n const byToken = fillsByToken(partFills, this._parts, this._tokens.length);\r\n return (index) => byToken[index];\r\n }\r\n\r\n /**\r\n * How far each glyph is written at the node's `written`: its outline first,\r\n * then its fill, each glyph starting before the one ahead of it is done.\r\n * `null` once the whole formula is.\r\n */\r\n private _writing(): ((index: number) => { outlined: number; filled: number }) | null {\r\n const written = this.written;\r\n if (written >= 1) return null;\r\n const count = this._tokens.length;\r\n const lead = 1 - WRITE_OVERLAP;\r\n const span = 1 / (1 + Math.max(0, count - 1) * lead);\r\n return (index) => {\r\n const p = Math.min(1, Math.max(0, (written - index * span * lead) / span));\r\n return { outlined: Math.min(1, p * 2), filled: Math.max(0, p * 2 - 1) };\r\n };\r\n }\r\n\r\n /**\r\n * The overlay, painted *through* the glyphs.\r\n *\r\n * `ShapeNode`'s inherited overlay pass fills whatever {@link\r\n * ShapeNode.shapeGraphics} describes, and this node describes nothing there:\r\n * a formula has no single fillable silhouette — its silhouette *is* the list\r\n * of token paths, which is why `renderSelf` is overridden rather than a\r\n * `shapeGraphics` supplied. So the generic pass drew nothing and an overlay\r\n * set on a LaTeX node simply never appeared, with no error to say why.\r\n *\r\n * Painted the same way the fill is: one `Graphics2D` per token, all sharing the\r\n * centre frame, each scaled by its token's animated opacity — so a morph\r\n * carries the overlay along with the glyph it is laid over instead of leaving\r\n * a wash hanging over glyphs that have faded out.\r\n *\r\n * The stroke is *not* re-drawn here. `renderSelf` already strokes each token\r\n * (there is no silhouette for the deferred {@link ShapeNode.renderStroke} to\r\n * outline), so it is painted under the overlay rather than over it — the one\r\n * place this node's draw order differs from a plain shape's, and the price of\r\n * a stroke that follows glyphs rather than a box.\r\n */\r\n protected override renderOverlay(ctx: RenderContext2D): void {\r\n const overlay = this.overlay as FillResolved[];\r\n if (overlay.length === 0) return;\r\n const writing = this._writing();\r\n this.eachToken(ctx, (graphics, opacity, index) => {\r\n const filled = writing?.(index).filled ?? 1;\r\n return filled <= 0 ? null : graphics.fill(scaleFillopacity(overlay, opacity * filled));\r\n });\r\n }\r\n\r\n /**\r\n * Draws every visible token's path once, handing each one to `paint` to have\r\n * its paint ops appended.\r\n *\r\n * A fresh `Graphics2D` per token per pass, because `.fill()`/`.stroke()` push\r\n * onto one op list and return `this` — a silhouette shared between the fill\r\n * pass and the overlay pass would accumulate both.\r\n */\r\n private eachToken(\r\n ctx: RenderContext2D,\r\n paint: (graphics: Graphics2D, opacity: number, index: number, token: AnimatedToken) => Graphics2D | null,\r\n drawn: (index: number) => number = () => 1,\r\n ): void {\r\n // The one funnel every paint pass goes through, so the tokens a frame\r\n // draws cannot be older than the formula it holds.\r\n this._ensureTokens();\r\n this._tokens.forEach((token, index) => {\r\n if (token.opacity <= 0) return;\r\n\r\n // Translate the path by token's interpolated position offset\r\n const pathStr = token.x !== 0 || token.y !== 0\r\n ? toPathString(offsetPath(token.path, token.x, token.y))\r\n : toPathString(token.path);\r\n\r\n const painted = paint(new Graphics2D()\r\n .path({\r\n data: pathStr,\r\n start: this.start,\r\n end: this.end * drawn(index),\r\n // All tokens share one center frame so they keep their relative\r\n // layout — without this each glyph centers on its own bbox and\r\n // they all stack on the origin.\r\n centerBounds: this._bounds,\r\n }), token.opacity, index, token);\r\n if (painted) ctx.draw(painted);\r\n });\r\n }\r\n\r\n}\r\n\r\nfunction penStroke(weight: number, fill: FillResolved[]): StrokeResolved[] {\r\n return [{ weight, fill, dashOffset: 0, align: 0, cap: \"round\", capScale: 4, join: \"round\", miterLimit: 4 }];\r\n}\r\n\r\n/** One part fill per token, or none: the last entry that names it. */\r\ntype TokenFills = (PartFillResolved | undefined)[];\r\n\r\nfunction fillsByToken(partFills: readonly PartFillResolved[], parts: readonly LatexPart[], count: number): TokenFills {\r\n const out: TokenFills = new Array(count);\r\n for (const entry of partFills) {\r\n if (entry.part.trim() === \"\") continue;\r\n const spans = findLatexParts(parts, entry.part);\r\n for (const [from, to] of entry.occurrence > 0 ? spans.slice(entry.occurrence - 1, entry.occurrence) : spans) {\r\n for (let i = from; i < to && i < count; i++) out[i] = entry;\r\n }\r\n }\r\n return out;\r\n}\r\n\r\nfunction scaleFillopacity(fills: FillResolved[], opacity: number): FillResolved[] {\r\n if (opacity >= 1) return fills;\r\n return fills.map(f => ({ ...f, opacity: (f.opacity ?? 1) * opacity }));\r\n}\r\n\r\n/**\r\n * A morphing token fades, and its shadow has to fade with it — the paints are\r\n * scaled the same way the fill's are, so a half-faded glyph casts a half-strength\r\n * shadow rather than sitting over a shadow at full weight.\r\n */\r\nfunction scaleShadowOpacity(shadows: ShadowResolved[], opacity: number): ShadowResolved[] {\r\n if (opacity >= 1) return shadows;\r\n return shadows.map(s => ({ ...s, fill: scaleFillopacity(s.fill, opacity) }));\r\n}\r\n\r\nfunction offsetPath(\r\n path: LatexToken[\"path\"],\r\n dx: number,\r\n dy: number,\r\n): LatexToken[\"path\"] {\r\n return path.map(cmd => {\r\n const c = cmd as any;\r\n const shifted: any = { ...c };\r\n if (\"x\" in c) shifted.x = c.x + dx;\r\n if (\"y\" in c) shifted.y = c.y + dy;\r\n if (\"x1\" in c) { shifted.x1 = c.x1 + dx; shifted.y1 = c.y1 + dy; }\r\n if (\"x2\" in c) { shifted.x2 = c.x2 + dx; shifted.y2 = c.y2 + dy; }\r\n return shifted;\r\n });\r\n}\r\n"]}
|
|
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GAAG,EAAE,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC;CAC1F,CAAC,EAAE,CAAC,CAAuC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC","sourcesContent":["import {\r\n component2d,\r\n Types,\r\n type EntryOptions,\r\n type InsetsProps,\r\n type NodeOf,\r\n type ShapeProps,\r\n // Named so the emitted declaration reaches these through the sdk, not core.\r\n type Alignment as _Alignment,\r\n type Fill as _Fill,\r\n type FillResolved as _FillResolved,\r\n type FlowMode as _FlowMode,\r\n type FlowResolved as _FlowResolved,\r\n type GapSize as _GapSize,\r\n type Node2D as _Node2D,\r\n type Node2DProps as _Node2DProps,\r\n type Shadow as _Shadow,\r\n type ShadowResolved as _ShadowResolved,\r\n type Stroke as _Stroke,\r\n type StrokeResolved as _StrokeResolved,\r\n type Vector2 as _Vector2,\r\n} from \"@motionscript/sdk\";\r\n// From each module, never the `../engine` barrel: it re-exports this file, so a\r\n// load that enters through the barrel would build this component before the\r\n// modules it spreads exist.\r\nimport type { PartFill } from \"../kit/part-fills\";\r\nimport {\r\n drawFormula, formula, formulaFrame, layoutFormula, lerpMorph, loadFormula, measureFormula, TYPESET, TYPESET_COMMANDS,\r\n type Morphing,\r\n} from \"./typeset\";\r\nimport type { LatexMorphStrategy } from \"./tween\";\r\n\r\nexport interface LatexProps extends ShapeProps {\r\n latex: string;\r\n fontSize: number;\r\n padding: InsetsProps;\r\n partFills: PartFill[];\r\n written: number;\r\n}\r\n\r\n/**\r\n * How a formula morphs, for a node built on the `Typeset` helpers: they take it\r\n * as an argument (`formulaFrame(source, fontSize, partFills, morph)`).\r\n */\r\nexport interface LatexStrategies {\r\n /** How the node morphs between two formulas. Defaults to `defaultLatexMorph`. */\r\n morph?: LatexMorphStrategy;\r\n}\r\n\r\nconst state = {\r\n ...TYPESET,\r\n /** The formula. Mid-tween it holds both ends, and the glyphs morph from the one into the other. */\r\n latex: Types.custom<string, Morphing<string>, EntryOptions & { readonly kind: \"text\"; readonly multiline: true }>(\"\", {\r\n kind: \"text\", multiline: true, lerp: lerpMorph,\r\n }),\r\n};\r\n\r\n/** A LaTeX formula drawn as glyph paths, morphing token by token between formulas. */\r\nexport const Latex = formula(component2d({\r\n key: \"latex\",\r\n state,\r\n defaults: { width: \"hug\", height: \"hug\" },\r\n load: (loader) => loadFormula(loader),\r\n commands: {\r\n ...TYPESET_COMMANDS,\r\n /** Morph this formula into another, its glyphs travelling to their places in it. */\r\n morphTo: { args: [\"latex\"] },\r\n },\r\n measure: (_measurer, s) => measureFormula(formulaFrame(s.latex, s.fontSize, s.partFills), s),\r\n layout: (box, s, children) => layoutFormula(box, s, children),\r\n render: (ctx, s) => drawFormula(ctx, s, formulaFrame(s.latex, s.fontSize, s.partFills)),\r\n}), (s: { readonly latex: Morphing<string> }) => s.latex);\r\n\r\nexport type Latex = NodeOf<typeof Latex>;\r\n"]}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { Flow, type BoxBounds, type ChildView, type Fill, type FillResolved, type InsetsResolved, type Loader, type Placement2D, type RenderContext, type ShadowResolved, type Size2D, type StrokeResolved, type Values, type Alignment as _Alignment, type FlowMode as _FlowMode, type FlowResolved as _FlowResolved, type GapSize as _GapSize, type Shadow as _Shadow, type Stroke as _Stroke, type Vector2 as _Vector2 } from "@motionscript/sdk";
|
|
2
|
+
import { type LatexPart } from "./geometry.js";
|
|
3
|
+
import { type AnimatedToken, type LatexMorphStrategy } from "./tween.js";
|
|
4
|
+
import { type PartFill, type PartFillResolved } from "../kit/part-fills.js";
|
|
5
|
+
/**
|
|
6
|
+
* A formula typeset to glyph paths: what `latex` and `latexMatrix` share. A
|
|
7
|
+
* node says where its formula comes from (`formula`); this lays it out, draws
|
|
8
|
+
* it, writes it on, paints its parts, and morphs it into another.
|
|
9
|
+
*
|
|
10
|
+
* A morph is held by the entries the formula is written from: mid-tween each
|
|
11
|
+
* holds both ends ({@link Morph}), so a seek to any time draws the morph there
|
|
12
|
+
* from the node's own state, and a plain `to({ latex })` morphs as `morphTo` does.
|
|
13
|
+
*/
|
|
14
|
+
/** A value on its way to another: what an entry the formula is written from holds mid-tween. */
|
|
15
|
+
export declare class Morph<T> {
|
|
16
|
+
readonly from: T;
|
|
17
|
+
readonly to: T;
|
|
18
|
+
readonly t: number;
|
|
19
|
+
constructor(from: T, to: T, t: number);
|
|
20
|
+
}
|
|
21
|
+
export type Morphing<T> = T | Morph<T>;
|
|
22
|
+
/** The end a value rests at, or is nearer to mid-tween: where a tween that starts from it starts. */
|
|
23
|
+
export declare function settled<T>(value: Morphing<T>): T;
|
|
24
|
+
export declare function lerpMorph<T>(from: Morphing<T>, to: Morphing<T>, t: number): Morphing<T>;
|
|
25
|
+
/** `parts` combined into one value at each end, when any of them is on its way: a matrix's source from its entries and brackets. */
|
|
26
|
+
export declare function morphOf<T>(parts: readonly Morphing<unknown>[], combine: (ends: readonly unknown[]) => T): Morphing<T>;
|
|
27
|
+
/** What every formula has: the glyphs' paint, the flow its children are laid out in, its size, its part fills and how much of it is written. */
|
|
28
|
+
export declare const TYPESET: {
|
|
29
|
+
fontSize: number;
|
|
30
|
+
/** Paints for parts of the formula, named by their source. Later entries win where two name a glyph. */
|
|
31
|
+
partFills: import("@motionscript/sdk").Type<PartFill[], PartFillResolved[], false>;
|
|
32
|
+
/**
|
|
33
|
+
* How much of the formula is written, 0 to 1: its glyphs are drawn one after
|
|
34
|
+
* another, each outlined and then filled.
|
|
35
|
+
*/
|
|
36
|
+
written: import("@motionscript/sdk").Type<number, number, false>;
|
|
37
|
+
/** Reported for a host that read it; the morph is held by the formula's own entries. */
|
|
38
|
+
morphProgress: import("@motionscript/sdk").Type<number, number, false>;
|
|
39
|
+
flow: import("@motionscript/sdk").Type<_FlowMode, _FlowResolved, false>;
|
|
40
|
+
gap: import("@motionscript/sdk").Type<_GapSize, _GapSize, false>;
|
|
41
|
+
wrap: boolean;
|
|
42
|
+
crossGap: import("@motionscript/sdk").Type<number | undefined, number | undefined, false>;
|
|
43
|
+
columns: import("@motionscript/sdk").Type<number, number, false>;
|
|
44
|
+
align: import("@motionscript/sdk").Attribute<_Alignment, _Vector2>;
|
|
45
|
+
fill: import("@motionscript/sdk").Attribute<Fill, FillResolved[]>;
|
|
46
|
+
stroke: import("@motionscript/sdk").Attribute<_Stroke, StrokeResolved[]>;
|
|
47
|
+
shadow: import("@motionscript/sdk").Attribute<_Shadow, ShadowResolved[]>;
|
|
48
|
+
overlay: import("@motionscript/sdk").Attribute<Fill, FillResolved[]>;
|
|
49
|
+
};
|
|
50
|
+
export declare const TYPESET_COMMANDS: {
|
|
51
|
+
writeTo: {
|
|
52
|
+
readonly args: readonly ["written"];
|
|
53
|
+
readonly run?: undefined;
|
|
54
|
+
};
|
|
55
|
+
partFillTo: {
|
|
56
|
+
readonly args: {
|
|
57
|
+
readonly part: import("@motionscript/sdk").Type<string, string, false>;
|
|
58
|
+
readonly fill: import("@motionscript/sdk").Type<Fill, Fill, false>;
|
|
59
|
+
readonly occurrence: import("@motionscript/sdk").Type<number, number, false>;
|
|
60
|
+
};
|
|
61
|
+
run(timeline: any, state: any, children: any): import("@motionscript/sdk").Piece;
|
|
62
|
+
};
|
|
63
|
+
overlayTo: {
|
|
64
|
+
readonly args: readonly ["overlay"];
|
|
65
|
+
readonly run?: undefined;
|
|
66
|
+
};
|
|
67
|
+
fillTo: {
|
|
68
|
+
readonly args: readonly ["fill"];
|
|
69
|
+
readonly run?: undefined;
|
|
70
|
+
};
|
|
71
|
+
strokeTo: {
|
|
72
|
+
readonly args: readonly ["stroke"];
|
|
73
|
+
readonly run?: undefined;
|
|
74
|
+
};
|
|
75
|
+
shadowTo: {
|
|
76
|
+
readonly args: readonly ["shadow"];
|
|
77
|
+
readonly run?: undefined;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
type TypesetValues = Values<typeof TYPESET>;
|
|
81
|
+
/** What is drawn of a formula now: its glyphs, its parts, its centre frame and size, and mid-morph each end's part fills. */
|
|
82
|
+
export interface FormulaFrame {
|
|
83
|
+
readonly tokens: readonly AnimatedToken[];
|
|
84
|
+
readonly parts: readonly LatexPart[];
|
|
85
|
+
readonly bounds: [number, number, number, number];
|
|
86
|
+
readonly width: number;
|
|
87
|
+
readonly height: number;
|
|
88
|
+
readonly morph: {
|
|
89
|
+
readonly from: TokenFills;
|
|
90
|
+
readonly to: TokenFills;
|
|
91
|
+
readonly t: number;
|
|
92
|
+
} | null;
|
|
93
|
+
}
|
|
94
|
+
/** One part fill per token, or none: the last entry that names it. */
|
|
95
|
+
type TokenFills = (PartFillResolved | undefined)[];
|
|
96
|
+
/** The formula drawn now, from where it comes from: at rest, or `t` of the way through a morph. */
|
|
97
|
+
export declare function formulaFrame(source: Morphing<string>, fontSize: number, partFills: readonly PartFillResolved[], morph?: LatexMorphStrategy): FormulaFrame;
|
|
98
|
+
/** Its formula's size and its padding, hugging; the factory applies a set or filling size. */
|
|
99
|
+
export declare function measureFormula(frame: FormulaFrame, s: {
|
|
100
|
+
readonly padding: InsetsResolved;
|
|
101
|
+
}): Size2D;
|
|
102
|
+
/** Its children, laid out in its box clear of its stroke, as a shape lays out its own. */
|
|
103
|
+
export declare function layoutFormula(box: BoxBounds, s: Flow.FlowState & {
|
|
104
|
+
readonly stroke: StrokeResolved[];
|
|
105
|
+
}, children: readonly ChildView<any>[]): readonly Placement2D[];
|
|
106
|
+
/** MathJax, before this node is laid out: a scene with no formula in it never loads it. */
|
|
107
|
+
export declare function loadFormula(loader: Loader): void;
|
|
108
|
+
/**
|
|
109
|
+
* The glyphs, in a node's paint order: each one's shadow, fill and stroke
|
|
110
|
+
* (the shadow op first, so the paint after it casts it), the pen's line while
|
|
111
|
+
* it is being written, then the children, then the overlay through the glyphs.
|
|
112
|
+
*/
|
|
113
|
+
export declare function drawFormula(ctx: RenderContext, s: TypesetValues, frame: FormulaFrame): void;
|
|
114
|
+
/**
|
|
115
|
+
* The box around one part of the formula, centred on the node's own centre and
|
|
116
|
+
* y-up, or `null` when the formula does not write `part` (or is mid-morph).
|
|
117
|
+
* `occurrence` counts from 1.
|
|
118
|
+
*/
|
|
119
|
+
export declare function partBoundsIn(frame: FormulaFrame, part: string, occurrence?: number): BoxBounds | null;
|
|
120
|
+
/** Where a node's formula comes from, by the class its component generated. */
|
|
121
|
+
type SourceOf = (values: never) => Morphing<string>;
|
|
122
|
+
/** Declare `component` a formula written from `source`: a mark can then point at its parts. */
|
|
123
|
+
export declare function formula<C extends {
|
|
124
|
+
readonly node: object;
|
|
125
|
+
}>(component: C, source: SourceOf): C;
|
|
126
|
+
/** Whether `node` draws a formula, and so has parts a mark can point at. */
|
|
127
|
+
export declare function isFormula(node: object): boolean;
|
|
128
|
+
/** The formula `node` draws now, or `null` when it is no formula. */
|
|
129
|
+
export declare function formulaOf(node: object): FormulaFrame | null;
|
|
130
|
+
/** The box around a part of the formula `node` draws (see {@link partBoundsIn}); `undefined` when it is no formula. */
|
|
131
|
+
export declare function latexPartBounds(node: object, part: string, occurrence?: number): BoxBounds | null | undefined;
|
|
132
|
+
export type { TypesetValues };
|
|
133
|
+
//# sourceMappingURL=typeset.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typeset.d.ts","sourceRoot":"","sources":["../../src/tex/typeset.ts"],"names":[],"mappings":"AAAA,OAAO,EAGH,IAAI,EAOJ,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,IAAI,EACT,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,MAAM,EACX,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,MAAM,EACX,KAAK,cAAc,EACnB,KAAK,MAAM,EAEX,KAAK,SAAS,IAAI,UAAU,EAC5B,KAAK,QAAQ,IAAI,SAAS,EAC1B,KAAK,YAAY,IAAI,aAAa,EAClC,KAAK,OAAO,IAAI,QAAQ,EACxB,KAAK,MAAM,IAAI,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