manim-web 0.11.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/audio/Voiceover.d.ts +95 -0
  2. package/dist/audio/Voiceover.d.ts.map +1 -0
  3. package/dist/audio/VoiceoverScene.d.ts +28 -0
  4. package/dist/audio/VoiceoverScene.d.ts.map +1 -0
  5. package/dist/audio/bookmarks.d.ts +40 -0
  6. package/dist/audio/bookmarks.d.ts.map +1 -0
  7. package/dist/audio/speechSynthesizer.d.ts +95 -0
  8. package/dist/audio/speechSynthesizer.d.ts.map +1 -0
  9. package/dist/core/Mobject.d.ts +31 -0
  10. package/dist/core/Mobject.d.ts.map +1 -1
  11. package/dist/core/Scene.d.ts +9 -0
  12. package/dist/core/Scene.d.ts.map +1 -1
  13. package/dist/index.d.ts +8 -1
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +3 -3
  16. package/dist/integrations/react.js +17 -17
  17. package/dist/integrations/vue.js +16 -16
  18. package/dist/interaction/MovablePoint.d.ts +127 -0
  19. package/dist/interaction/MovablePoint.d.ts.map +1 -0
  20. package/dist/interaction/Slider.d.ts +125 -0
  21. package/dist/interaction/Slider.d.ts.map +1 -0
  22. package/dist/interaction/index.d.ts +2 -0
  23. package/dist/interaction/index.d.ts.map +1 -1
  24. package/dist/manim-web.browser.js +4226 -3491
  25. package/dist/mobjects/svg/SVGMobject.d.ts +29 -0
  26. package/dist/mobjects/svg/SVGMobject.d.ts.map +1 -1
  27. package/dist/mobjects/svg/index.d.ts +3 -1
  28. package/dist/mobjects/svg/index.d.ts.map +1 -1
  29. package/dist/mobjects/svg/svgFill.d.ts +42 -0
  30. package/dist/mobjects/svg/svgFill.d.ts.map +1 -0
  31. package/dist/mobjects/svg/svgGradients.d.ts +68 -0
  32. package/dist/mobjects/svg/svgGradients.d.ts.map +1 -0
  33. package/dist/mobjects/svg/svgImage.d.ts +9 -0
  34. package/dist/mobjects/svg/svgImage.d.ts.map +1 -0
  35. package/dist/mobjects/svg/svgLoader.d.ts +35 -0
  36. package/dist/mobjects/svg/svgLoader.d.ts.map +1 -0
  37. package/dist/mobjects/svg/svgText.d.ts +15 -0
  38. package/dist/mobjects/svg/svgText.d.ts.map +1 -0
  39. package/dist/rendering/blendModes.d.ts +38 -0
  40. package/dist/rendering/blendModes.d.ts.map +1 -0
  41. package/dist/{src-C817VR8M.js → src-BQF5-SG7.js} +6267 -5532
  42. package/dist/utils/ThemeManager.d.ts +79 -0
  43. package/dist/utils/ThemeManager.d.ts.map +1 -0
  44. package/package.json +1 -1
@@ -1,5 +1,6 @@
1
1
  import { VMobject } from '../../core/VMobject';
2
2
  import { VGroup } from '../../core/VGroup';
3
+ import { SvgFetcher } from './svgLoader';
3
4
  /**
4
5
  * SVGMobject options
5
6
  */
@@ -21,6 +22,14 @@ export interface SVGMobjectOptions {
21
22
  /** Center position */
22
23
  center?: [number, number, number];
23
24
  }
25
+ /**
26
+ * Options for {@link SVGMobject.fromUrl}. Same as {@link SVGMobjectOptions}
27
+ * (minus `svgString`, which is fetched) plus an injectable fetcher.
28
+ */
29
+ export type SVGMobjectFromUrlOptions = Omit<SVGMobjectOptions, 'svgString'> & {
30
+ /** Fetch implementation. Defaults to `globalThis.fetch`. */
31
+ fetcher?: SvgFetcher;
32
+ };
24
33
  /**
25
34
  * VMobjectFromSVGPath options
26
35
  */
@@ -49,7 +58,27 @@ export declare class VMobjectFromSVGPath extends VMobject {
49
58
  */
50
59
  export declare class SVGMobject extends VGroup {
51
60
  private _svgString;
61
+ private _loadError;
52
62
  constructor(options?: SVGMobjectOptions);
63
+ /**
64
+ * Fetch an SVG from a URL and parse it through the standard string path.
65
+ *
66
+ * The fetcher is injected (default `globalThis.fetch`) so tests can mock it.
67
+ * A fetch or parse failure does not throw: it returns an empty SVGMobject
68
+ * whose {@link getLoadError} reports the error.
69
+ *
70
+ * @param url - The SVG resource URL.
71
+ * @param options - Standard SVGMobject options plus an optional `fetcher`.
72
+ * @returns A promise resolving to the parsed (or empty, on error) SVGMobject.
73
+ */
74
+ static fromUrl(url: string, options?: SVGMobjectFromUrlOptions): Promise<SVGMobject>;
75
+ /**
76
+ * The error captured while loading or parsing, or null when none occurred.
77
+ *
78
+ * Set by {@link fromUrl} on a fetch failure and by the parser when the input
79
+ * has no `<svg>` root.
80
+ */
81
+ getLoadError(): Error | null;
53
82
  private _parseSVG;
54
83
  /**
55
84
  * Get all subpaths as individual VMobjects.
@@ -1 +1 @@
1
- {"version":3,"file":"SVGMobject.d.ts","sourceRoot":"","sources":["../../../src/mobjects/svg/SVGMobject.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAQ3C;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,yBAAyB;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4BAA4B;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gCAAgC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qCAAqC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sBAAsB;IACtB,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,2BAA2B;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,mBAAmB;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB;IACjB,SAAS,CAAC,EA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 @@
6
6
  * of the manimweb rendering pipeline.
7
7
  */
8
8
  export { Brace, BraceBetweenPoints, ArcBrace, BraceLabel, BraceText, type BraceOptions, type BraceBetweenPointsOptions, type ArcBraceOptions, type BraceLabelOptions, } from './Brace';
9
- export { SVGMobject, svgMobject, VMobjectFromSVGPath, type SVGMobjectOptions, type VMobjectFromSVGPathOptions, } from './SVGMobject';
9
+ export { SVGMobject, svgMobject, VMobjectFromSVGPath, type SVGMobjectOptions, type VMobjectFromSVGPathOptions, type SVGMobjectFromUrlOptions, } from './SVGMobject';
10
+ export { GradientVMobject, type GradientVMobjectOptions, type SvgGradient, type SvgGradientStop, type SvgGradientType, } from './svgGradients';
11
+ export { type SvgFetcher, type SvgFetchResponse } from './svgLoader';
10
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/mobjects/svg/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EACL,KAAK,EACL,kBAAkB,EAClB,QAAQ,EACR,UAAU,EACV,SAAS,EACT,KAAK,YAAY,EACjB,KAAK,yBAAyB,EAC9B,KAAK,eAAe,EACpB,KAAK,iBAAiB,GACvB,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,UAAU,EACV,UAAU,EACV,mBAAmB,EACnB,KAAK,iBAAiB,EACtB,KAAK,0BAA0B,GAChC,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/mobjects/svg/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EACL,KAAK,EACL,kBAAkB,EAClB,QAAQ,EACR,UAAU,EACV,SAAS,EACT,KAAK,YAAY,EACjB,KAAK,yBAAyB,EAC9B,KAAK,eAAe,EACpB,KAAK,iBAAiB,GACvB,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,UAAU,EACV,UAAU,EACV,mBAAmB,EACnB,KAAK,iBAAiB,EACtB,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,GAC9B,MAAM,cAAc,CAAC;AAItB,OAAO,EACL,gBAAgB,EAChB,KAAK,uBAAuB,EAC5B,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,eAAe,GACrB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,42 @@
1
+ import { VMobject } from '../../core/VMobject';
2
+ import { SvgGradient } from './svgGradients';
3
+ /**
4
+ * Create a flat-styled VMobject from Bezier control points.
5
+ *
6
+ * @param points3D - Bezier control points in 3D.
7
+ * @param color - Stroke color.
8
+ * @param strokeWidth - Stroke width.
9
+ * @param fillColor - Optional fill color.
10
+ * @param fillOpacity - Fill opacity (default 0).
11
+ */
12
+ export declare function createStyledVMobject(points3D: [number, number, number][], color: string, strokeWidth: number, fillColor?: string, fillOpacity?: number): VMobject;
13
+ /** Options describing how to style one SVG shape's fill. */
14
+ export interface FilledVMobjectOptions {
15
+ /** Bezier control points in 3D. */
16
+ points3D: [number, number, number][];
17
+ /** Resolved stroke color. */
18
+ strokeColor: string;
19
+ /** Resolved stroke width. */
20
+ strokeWidth: number;
21
+ /** The raw `fill` attribute from the element (may be null). */
22
+ rawFill: string | null;
23
+ /**
24
+ * Fallback fill used when the element has no `fill` attribute. `<path>` falls
25
+ * back to the SVGMobject default fill; other shapes pass undefined to match
26
+ * their original behavior.
27
+ */
28
+ fallbackFill?: string;
29
+ /** Default fill opacity for a filled shape. */
30
+ defaultFillOpacity?: number;
31
+ /** Gradient definitions for resolving `url(#id)` fills. */
32
+ defs: Map<string, SvgGradient>;
33
+ }
34
+ /**
35
+ * Build a VMobject for a fill-bearing SVG shape, applying a gradient fill when
36
+ * the `fill` is a resolvable `url(#id)` reference and a flat fill otherwise.
37
+ *
38
+ * The flat-fill branch reproduces the original per-shape logic exactly, so
39
+ * non-gradient shapes are unaffected.
40
+ */
41
+ export declare function makeFilledVMobject(options: FilledVMobjectOptions): VMobject;
42
+ //# sourceMappingURL=svgFill.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"svgFill.d.ts","sourceRoot":"","sources":["../../../src/mobjects/svg/svgFill.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAyC,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAEzF;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,EACpC,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,EACnB,SAAS,CAAC,EAAE,MAAM,EAClB,WAAW,CAAC,EAAE,MAAM,GACnB,QAAQ,CAUV;AAED,4DAA4D;AAC5D,MAAM,WAAW,qBAAqB;IACpC,mCAAmC;IACnC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;IACrC,6BAA6B;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,6BAA6B;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,+DAA+D;IAC/D,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+CAA+C;IAC/C,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,2DAA2D;IAC3D,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;CAChC;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,qBAAqB,GAAG,QAAQ,CAqB3E"}
@@ -0,0 +1,68 @@
1
+ import { VMobject } from '../../core/VMobject';
2
+ /** Gradient geometry kind parsed from an SVG definition. */
3
+ export type SvgGradientType = 'linear' | 'radial';
4
+ /** One color stop of an SVG gradient. */
5
+ export interface SvgGradientStop {
6
+ /** Position along the gradient, clamped to [0, 1]. */
7
+ offset: number;
8
+ /** Stop color as a CSS color string (default black). */
9
+ color: string;
10
+ /** Stop opacity in [0, 1] (default 1). */
11
+ opacity: number;
12
+ }
13
+ /** Parsed SVG gradient definition. */
14
+ export interface SvgGradient {
15
+ /** The gradient `id` used by `url(#id)` references. */
16
+ id: string;
17
+ /** Gradient kind. Radial is approximated as a linear stop sequence. */
18
+ type: SvgGradientType;
19
+ /** Ordered color stops. */
20
+ stops: SvgGradientStop[];
21
+ }
22
+ /**
23
+ * Collect every `<linearGradient>`/`<radialGradient>` definition in an SVG,
24
+ * keyed by its `id`. Gradients without an `id` or without stops are skipped.
25
+ *
26
+ * @param svg - The parsed `<svg>` root element.
27
+ * @returns A map from gradient id to its parsed definition.
28
+ */
29
+ export declare function parseGradientDefs(svg: Element): Map<string, SvgGradient>;
30
+ /**
31
+ * Resolve a `fill="url(#id)"` reference to its gradient definition.
32
+ *
33
+ * @param fillAttr - The raw fill attribute value.
34
+ * @param defs - Gradient definitions from {@link parseGradientDefs}.
35
+ * @returns The matching gradient, or undefined when the fill is not a gradient
36
+ * reference or the id is unknown.
37
+ */
38
+ export declare function resolveGradientFill(fillAttr: string | null | undefined, defs: Map<string, SvgGradient>): SvgGradient | undefined;
39
+ /** Options for {@link GradientVMobject}. */
40
+ export interface GradientVMobjectOptions {
41
+ /** The resolved gradient applied as this object's fill. */
42
+ gradient: SvgGradient;
43
+ /** Bezier control points in 3D. */
44
+ points3D: [number, number, number][];
45
+ /** Stroke color (default WHITE). */
46
+ strokeColor?: string;
47
+ /** Stroke width (default DEFAULT_STROKE_WIDTH). */
48
+ strokeWidth?: number;
49
+ /** Fill opacity (default 0.5). */
50
+ fillOpacity?: number;
51
+ }
52
+ /**
53
+ * A VMobject whose fill comes from an SVG gradient.
54
+ *
55
+ * The flat `fillColor` is the first (offset-0) stop, so it renders correctly in
56
+ * the single-fill pipeline. {@link gradientColors} holds the full resampled
57
+ * palette (via {@link colorGradient}) for consumers that render or animate the
58
+ * gradient, and {@link gradient} keeps the original parsed stops.
59
+ */
60
+ export declare class GradientVMobject extends VMobject {
61
+ /** The parsed gradient definition applied as fill. */
62
+ readonly gradient: SvgGradient;
63
+ /** Evenly spaced palette of the gradient stops (via {@link colorGradient}). */
64
+ readonly gradientColors: string[];
65
+ constructor(options: GradientVMobjectOptions);
66
+ copy(): GradientVMobject;
67
+ }
68
+ //# sourceMappingURL=svgGradients.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"svgGradients.d.ts","sourceRoot":"","sources":["../../../src/mobjects/svg/svgGradients.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAK/C,4DAA4D;AAC5D,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAElD,yCAAyC;AACzC,MAAM,WAAW,eAAe;IAC9B,sDAAsD;IACtD,MAAM,EAAE,MAAM,CAAC;IACf,wDAAwD;IACxD,KAAK,EAAE,MAAM,CAAC;IACd,0CAA0C;IAC1C,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,sCAAsC;AACtC,MAAM,WAAW,WAAW;IAC1B,uDAAuD;IACvD,EAAE,EAAE,MAAM,CAAC;IACX,uEAAuE;IACvE,IAAI,EAAE,eAAe,CAAC;IACtB,2BAA2B;IAC3B,KAAK,EAAE,eAAe,EAAE,CAAC;CAC1B;AAqDD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAcxE;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACnC,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,GAC7B,WAAW,GAAG,SAAS,CAKzB;AAgBD,4CAA4C;AAC5C,MAAM,WAAW,uBAAuB;IACtC,2DAA2D;IAC3D,QAAQ,EAAE,WAAW,CAAC;IACtB,mCAAmC;IACnC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;IACrC,oCAAoC;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mDAAmD;IACnD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kCAAkC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;GAOG;AACH,qBAAa,gBAAiB,SAAQ,QAAQ;IAC5C,sDAAsD;IACtD,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC;IAC/B,+EAA+E;IAC/E,QAAQ,CAAC,cAAc,EAAE,MAAM,EAAE,CAAC;gBAEtB,OAAO,EAAE,uBAAuB;IAcnC,IAAI,IAAI,gBAAgB;CAWlC"}
@@ -0,0 +1,9 @@
1
+ import { ImageMobject } from '../image';
2
+ /**
3
+ * Build one {@link ImageMobject} per `<image>` element that has an href.
4
+ *
5
+ * @param svg - The parsed `<svg>` root element.
6
+ * @returns Image mobjects, in document order. Elements without an href are skipped.
7
+ */
8
+ export declare function buildSvgImageMobjects(svg: Element): ImageMobject[];
9
+ //# sourceMappingURL=svgImage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"svgImage.d.ts","sourceRoot":"","sources":["../../../src/mobjects/svg/svgImage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAcxC;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,OAAO,GAAG,YAAY,EAAE,CAwBlE"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * URL loading for SVGMobject (best-manim enhancement).
3
+ *
4
+ * `SVGMobject.fromUrl` fetches SVG text and parses it through the existing
5
+ * string path. The fetcher is injected (default `globalThis.fetch`) so tests
6
+ * can supply a mock and never touch the network.
7
+ */
8
+ /** Minimal response shape `fromUrl` needs — satisfied by the DOM `Response`. */
9
+ export interface SvgFetchResponse {
10
+ /** Whether the HTTP status is in the 2xx range. */
11
+ ok: boolean;
12
+ /** HTTP status code. */
13
+ status: number;
14
+ /** Resolve to the response body as text. */
15
+ text(): Promise<string>;
16
+ }
17
+ /** A function that fetches a URL, compatible with `globalThis.fetch`. */
18
+ export type SvgFetcher = (url: string) => Promise<SvgFetchResponse>;
19
+ /**
20
+ * Default fetcher: delegates to `globalThis.fetch`.
21
+ *
22
+ * Rejects with a clear error when no global fetch exists, so the caller can
23
+ * record it via `getLoadError()` instead of throwing a cryptic ReferenceError.
24
+ */
25
+ export declare const defaultSvgFetcher: SvgFetcher;
26
+ /**
27
+ * Fetch SVG text from a URL using the injected fetcher.
28
+ *
29
+ * @param url - The SVG resource URL.
30
+ * @param fetcher - The fetch implementation (defaults to {@link defaultSvgFetcher}).
31
+ * @returns The response body as text.
32
+ * @throws When the fetch rejects or the response status is not ok.
33
+ */
34
+ export declare function fetchSvgText(url: string, fetcher?: SvgFetcher): Promise<string>;
35
+ //# sourceMappingURL=svgLoader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"svgLoader.d.ts","sourceRoot":"","sources":["../../../src/mobjects/svg/svgLoader.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,gFAAgF;AAChF,MAAM,WAAW,gBAAgB;IAC/B,mDAAmD;IACnD,EAAE,EAAE,OAAO,CAAC;IACZ,wBAAwB;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CACzB;AAED,yEAAyE;AACzE,MAAM,MAAM,UAAU,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAEpE;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,UAO/B,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAChC,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,UAA8B,GACtC,OAAO,CAAC,MAAM,CAAC,CAMjB"}
@@ -0,0 +1,15 @@
1
+ import { Text } from '../text/Text';
2
+ /** Default styling for `<text>` elements that omit their own. */
3
+ export interface SvgTextDefaults {
4
+ /** Fill color used when the element has no usable `fill`. */
5
+ color: string;
6
+ }
7
+ /**
8
+ * Build one {@link Text} mobject per `<text>` element in the SVG.
9
+ *
10
+ * @param svg - The parsed `<svg>` root element.
11
+ * @param defaults - Fallback styling (currently the default fill color).
12
+ * @returns Text mobjects, in document order. Empty `<text>` nodes are skipped.
13
+ */
14
+ export declare function buildSvgTextMobjects(svg: Element, defaults: SvgTextDefaults): Text[];
15
+ //# sourceMappingURL=svgText.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"svgText.d.ts","sourceRoot":"","sources":["../../../src/mobjects/svg/svgText.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,iEAAiE;AACjE,MAAM,WAAW,eAAe;IAC9B,6DAA6D;IAC7D,KAAK,EAAE,MAAM,CAAC;CACf;AASD;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,eAAe,GAAG,IAAI,EAAE,CA2BpF"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Per-mobject blend modes.
3
+ *
4
+ * Maps a small, Manim-friendly set of named blend modes to Three.js material
5
+ * blending state. The default is `'normal'`, which equals three.js's own
6
+ * default (`NormalBlending`), so a mobject that never sets a blend mode renders
7
+ * exactly as before.
8
+ *
9
+ * `'screen'` has no built-in three.js constant, so it uses `CustomBlending`
10
+ * with the standard screen equation `src + dst*(1 - src)`.
11
+ */
12
+ import * as THREE from 'three';
13
+ /**
14
+ * Named blend mode for a mobject's rendered material(s).
15
+ *
16
+ * - `normal`: default alpha blending (three.js `NormalBlending`).
17
+ * - `additive`: add source to destination (`AdditiveBlending`); good for glow.
18
+ * - `multiply`: multiply source and destination (`MultiplyBlending`).
19
+ * - `subtractive`: subtract source from destination (`SubtractiveBlending`).
20
+ * - `screen`: screen blend via `CustomBlending` (`src + dst*(1 - src)`).
21
+ */
22
+ export type BlendMode = 'normal' | 'additive' | 'multiply' | 'subtractive' | 'screen';
23
+ /** Every supported blend mode name, in a stable order. */
24
+ export declare const BLEND_MODES: readonly BlendMode[];
25
+ /** Map a blend mode to the three.js `Blending` constant it primarily uses. */
26
+ export declare function blendModeToThree(mode: BlendMode): THREE.Blending;
27
+ /**
28
+ * Apply a blend mode to a single three.js material in place.
29
+ *
30
+ * The material version only bumps (`needsUpdate`) when the blending constant
31
+ * actually changes, so re-applying the same mode is cheap and idempotent. For
32
+ * `'screen'` the custom blend equation and factors are set explicitly.
33
+ *
34
+ * @param material - The material to configure.
35
+ * @param mode - The blend mode to apply.
36
+ */
37
+ export declare function applyBlendMode(material: THREE.Material, mode: BlendMode): void;
38
+ //# sourceMappingURL=blendModes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blendModes.d.ts","sourceRoot":"","sources":["../../src/rendering/blendModes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B;;;;;;;;GAQG;AACH,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,GAAG,aAAa,GAAG,QAAQ,CAAC;AAEtF,0DAA0D;AAC1D,eAAO,MAAM,WAAW,EAAE,SAAS,SAAS,EAM3C,CAAC;AAEF,8EAA8E;AAC9E,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,SAAS,GAAG,KAAK,CAAC,QAAQ,CAchE;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,SAAS,GAAG,IAAI,CAe9E"}