manim-web 0.12.0 → 0.14.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.
- package/README.md +35 -19
- package/dist/animation/transform/MovementTransforms.d.ts.map +1 -1
- package/dist/animation/transform/TransformMatchingCode.d.ts +108 -0
- package/dist/animation/transform/TransformMatchingCode.d.ts.map +1 -0
- package/dist/animation/transform/index.d.ts +1 -0
- package/dist/animation/transform/index.d.ts.map +1 -1
- package/dist/export/chooseExporter.d.ts +19 -0
- package/dist/export/chooseExporter.d.ts.map +1 -0
- package/dist/export/index.d.ts +1 -0
- package/dist/export/index.d.ts.map +1 -1
- package/dist/index.d.ts +8 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/integrations/react.js +17 -17
- package/dist/integrations/vue.js +16 -16
- package/dist/interaction/DynamicMatrix.d.ts +164 -0
- package/dist/interaction/DynamicMatrix.d.ts.map +1 -0
- package/dist/interaction/index.d.ts +1 -0
- package/dist/interaction/index.d.ts.map +1 -1
- package/dist/lib-Bh3UXyYs.js +302 -0
- package/dist/manim-web.browser.js +7080 -5939
- package/dist/mobjects/image/AnimatedImageMobject.d.ts +141 -0
- package/dist/mobjects/image/AnimatedImageMobject.d.ts.map +1 -0
- package/dist/mobjects/image/gifDecoder.d.ts +46 -0
- package/dist/mobjects/image/gifDecoder.d.ts.map +1 -0
- package/dist/mobjects/text/Code.d.ts +23 -1
- package/dist/mobjects/text/Code.d.ts.map +1 -1
- package/dist/mobjects/text/CodeTokenLayout.d.ts +44 -0
- package/dist/mobjects/text/CodeTokenLayout.d.ts.map +1 -0
- package/dist/mobjects/text/index.d.ts +1 -0
- package/dist/mobjects/text/index.d.ts.map +1 -1
- package/dist/mobjects/three-d/Line3D.d.ts.map +1 -1
- package/dist/player/ExportSettingsUI.d.ts +82 -0
- package/dist/player/ExportSettingsUI.d.ts.map +1 -0
- package/dist/player/Player.d.ts +50 -2
- package/dist/player/Player.d.ts.map +1 -1
- package/dist/player/PlayerUI.d.ts +15 -1
- package/dist/player/PlayerUI.d.ts.map +1 -1
- package/dist/player/SlideInteractionRenderer.d.ts +32 -0
- package/dist/player/SlideInteractionRenderer.d.ts.map +1 -0
- package/dist/player/index.d.ts +1 -0
- package/dist/player/index.d.ts.map +1 -1
- package/dist/rate-functions/customEase.d.ts +39 -0
- package/dist/rate-functions/customEase.d.ts.map +1 -0
- package/dist/rate-functions/index.d.ts +4 -0
- package/dist/rate-functions/index.d.ts.map +1 -1
- package/dist/rate-functions/spring.d.ts +38 -0
- package/dist/rate-functions/spring.d.ts.map +1 -0
- package/dist/rolldown-runtime-CWhphoD1.js +23 -0
- package/dist/serialization/defaults.d.ts +13 -0
- package/dist/serialization/defaults.d.ts.map +1 -0
- package/dist/serialization/index.d.ts +15 -0
- package/dist/serialization/index.d.ts.map +1 -0
- package/dist/serialization/props.d.ts +16 -0
- package/dist/serialization/props.d.ts.map +1 -0
- package/dist/serialization/registry.d.ts +17 -0
- package/dist/serialization/registry.d.ts.map +1 -0
- package/dist/serialization/serialize.d.ts +24 -0
- package/dist/serialization/serialize.d.ts.map +1 -0
- package/dist/serialization/types.d.ts +70 -0
- package/dist/serialization/types.d.ts.map +1 -0
- package/dist/{src-BQF5-SG7.js → src-BLA8Tb0K.js} +7256 -6115
- package/package.json +8 -1
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { RateFunction } from './index';
|
|
2
|
+
/**
|
|
3
|
+
* Create a CSS cubic-bezier easing.
|
|
4
|
+
*
|
|
5
|
+
* Control points are P0 = (0, 0), P1 = (x1, y1), P2 = (x2, y2), P3 = (1, 1).
|
|
6
|
+
* x1 and x2 are clamped to [0, 1] so the x axis stays monotonic, as CSS
|
|
7
|
+
* requires. y1 and y2 are free, so the curve may overshoot.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* const ease = cubicBezier(0.25, 0.1, 0.25, 1);
|
|
11
|
+
* ease(0); // 0
|
|
12
|
+
* ease(1); // 1
|
|
13
|
+
*/
|
|
14
|
+
export declare const cubicBezier: (x1: number, y1: number, x2: number, y2: number) => RateFunction;
|
|
15
|
+
/** CSS `ease`: slow start, fast middle, slow end. */
|
|
16
|
+
export declare const ease: RateFunction;
|
|
17
|
+
/** CSS `ease-in`: slow start. */
|
|
18
|
+
export declare const easeInBezier: RateFunction;
|
|
19
|
+
/** CSS `ease-out`: slow end. */
|
|
20
|
+
export declare const easeOutBezier: RateFunction;
|
|
21
|
+
/** CSS `ease-in-out`: slow start and end. */
|
|
22
|
+
export declare const easeInOutBezier: RateFunction;
|
|
23
|
+
/** Where a step jumps: at the start or the end of each interval. */
|
|
24
|
+
export type StepPosition = 'start' | 'end';
|
|
25
|
+
/**
|
|
26
|
+
* Create a CSS steps() timing function with n steps.
|
|
27
|
+
*
|
|
28
|
+
* - 'end' (default) holds then jumps at the end of each interval.
|
|
29
|
+
* - 'start' jumps at the start of each interval.
|
|
30
|
+
*
|
|
31
|
+
* Both start at 0 at t = 0 and reach 1 at t = 1.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* const quantized = steps(4);
|
|
35
|
+
* quantized(0); // 0
|
|
36
|
+
* quantized(1); // 1
|
|
37
|
+
*/
|
|
38
|
+
export declare const steps: (n: number, position?: StepPosition) => RateFunction;
|
|
39
|
+
//# sourceMappingURL=customEase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customEase.d.ts","sourceRoot":"","sources":["../../src/rate-functions/customEase.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AA+D5C;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,WAAW,GAAI,IAAI,MAAM,EAAE,IAAI,MAAM,EAAE,IAAI,MAAM,EAAE,IAAI,MAAM,KAAG,YAa5E,CAAC;AAIF,qDAAqD;AACrD,eAAO,MAAM,IAAI,EAAE,YAA8C,CAAC;AAElE,iCAAiC;AACjC,eAAO,MAAM,YAAY,EAAE,YAAyC,CAAC;AAErE,gCAAgC;AAChC,eAAO,MAAM,aAAa,EAAE,YAAyC,CAAC;AAEtE,6CAA6C;AAC7C,eAAO,MAAM,eAAe,EAAE,YAA4C,CAAC;AAI3E,oEAAoE;AACpE,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,KAAK,CAAC;AAE3C;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,KAAK,GAAI,GAAG,MAAM,EAAE,WAAU,YAAoB,KAAG,YAOjE,CAAC"}
|
|
@@ -221,4 +221,8 @@ export declare const easeInOutBounce: RateFunction;
|
|
|
221
221
|
export { easeIn as easeInCubic };
|
|
222
222
|
export { easeOut as easeOutCubic };
|
|
223
223
|
export { easeInOut as easeInOutCubic };
|
|
224
|
+
export { spring } from './spring';
|
|
225
|
+
export type { SpringOptions } from './spring';
|
|
226
|
+
export { cubicBezier, ease, easeInBezier, easeOutBezier, easeInOutBezier, steps, } from './customEase';
|
|
227
|
+
export type { StepPosition } from './customEase';
|
|
224
228
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rate-functions/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;AAEjD;;GAEG;AACH,eAAO,MAAM,MAAM,EAAE,YAAuC,CAAC;AAE7D;;;;GAIG;AACH,eAAO,MAAM,MAAM,EAAE,YAKpB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,YAEvB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,MAAM,EAAE,YAEpB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,YAErB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,YAExB,CAAC;AAEF;;GAEG;AACH,eAAO,M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AAc,EAAE,CAAC;AAIvC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EACL,WAAW,EACX,IAAI,EACJ,YAAY,EACZ,aAAa,EACb,eAAe,EACf,KAAK,GACN,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { RateFunction } from './index';
|
|
2
|
+
/**
|
|
3
|
+
* Options for the spring rate function.
|
|
4
|
+
*
|
|
5
|
+
* Use either the physical model (stiffness, damping, mass) or the simpler
|
|
6
|
+
* bounce model. If bounce is set, it wins over stiffness and damping.
|
|
7
|
+
*/
|
|
8
|
+
export interface SpringOptions {
|
|
9
|
+
/** Spring constant. Higher is tighter. Default 100. */
|
|
10
|
+
stiffness?: number;
|
|
11
|
+
/** Damping (friction) coefficient. Higher settles faster. Default 10. */
|
|
12
|
+
damping?: number;
|
|
13
|
+
/** Mass on the spring. Higher is slower. Default 1. */
|
|
14
|
+
mass?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Bounce in [0, 1). 0 gives no overshoot. Values near 1 give large
|
|
17
|
+
* overshoot. If set, this replaces stiffness and damping.
|
|
18
|
+
*/
|
|
19
|
+
bounce?: number;
|
|
20
|
+
/**
|
|
21
|
+
* Settle threshold used to map physical time into [0, 1].
|
|
22
|
+
* The spring reaches this distance from 1 at t = 1. Default 0.005.
|
|
23
|
+
*/
|
|
24
|
+
restThreshold?: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Create a damped spring rate function.
|
|
28
|
+
*
|
|
29
|
+
* The returned function maps t in [0, 1] to a value that starts at 0 and
|
|
30
|
+
* settles at 1. With an underdamped spring the value overshoots 1 first.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* const bouncy = spring({ bounce: 0.6 });
|
|
34
|
+
* bouncy(0); // 0
|
|
35
|
+
* bouncy(1); // 1
|
|
36
|
+
*/
|
|
37
|
+
export declare const spring: (options?: SpringOptions) => RateFunction;
|
|
38
|
+
//# sourceMappingURL=spring.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spring.d.ts","sourceRoot":"","sources":["../../src/rate-functions/spring.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yEAAyE;IACzE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AA6ED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,MAAM,GAAI,UAAS,aAAkB,KAAG,YAapD,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), s = (e, n) => {
|
|
3
|
+
let r = {};
|
|
4
|
+
for (var i in e) t(r, i, {
|
|
5
|
+
get: e[i],
|
|
6
|
+
enumerable: !0
|
|
7
|
+
});
|
|
8
|
+
return n || t(r, Symbol.toStringTag, { value: "Module" }), r;
|
|
9
|
+
}, c = (e, i, o, s) => {
|
|
10
|
+
if (i && typeof i == "object" || typeof i == "function") for (var c = r(i), l = 0, u = c.length, d; l < u; l++) d = c[l], !a.call(e, d) && d !== o && t(e, d, {
|
|
11
|
+
get: ((e) => i[e]).bind(null, d),
|
|
12
|
+
enumerable: !(s = n(i, d)) || s.enumerable
|
|
13
|
+
});
|
|
14
|
+
return e;
|
|
15
|
+
}, l = (n, r, a) => (a = n == null ? {} : e(i(n)), c(r || !n || !n.__esModule ? t(a, "default", {
|
|
16
|
+
value: n,
|
|
17
|
+
enumerable: !0
|
|
18
|
+
}) : a, n)), u = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : e)(function(e) {
|
|
19
|
+
if (typeof require < "u") return require.apply(this, arguments);
|
|
20
|
+
throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
|
|
21
|
+
});
|
|
22
|
+
//#endregion
|
|
23
|
+
export { l as i, s as n, u as r, o as t };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default serializers for the common mobjects.
|
|
3
|
+
*
|
|
4
|
+
* Each serializer captures only the type-specific, constructor-relevant
|
|
5
|
+
* (unscaled) props. The framework (`serialize.ts`) captures transform, style,
|
|
6
|
+
* and children generically, so these never repeat them. Reading an unscaled
|
|
7
|
+
* base value (e.g. `_radius`, not `getRadius()`) keeps scale in the transform
|
|
8
|
+
* only, which is what makes serialize→deserialize→serialize stable.
|
|
9
|
+
*
|
|
10
|
+
* Registering runs once as an import side effect from the folder entry point.
|
|
11
|
+
*/
|
|
12
|
+
export declare function registerDefaultSerializers(): void;
|
|
13
|
+
//# sourceMappingURL=defaults.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/serialization/defaults.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAsDH,wBAAgB,0BAA0B,IAAI,IAAI,CAuHjD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scene serialization (best-manim).
|
|
3
|
+
*
|
|
4
|
+
* Serialize a scene or a single mobject to a plain, JSON-safe document, store
|
|
5
|
+
* or deep-link it, and reload it in another session. The format is open: new
|
|
6
|
+
* mobject types register their own serializer, so the schema grows without a
|
|
7
|
+
* central union to edit.
|
|
8
|
+
*
|
|
9
|
+
* Importing this module registers the default serializers (common geometry,
|
|
10
|
+
* groups, and text) as a side effect.
|
|
11
|
+
*/
|
|
12
|
+
export { serializeScene, deserializeScene, serializeMobject, deserializeMobject, } from './serialize';
|
|
13
|
+
export { registerSerializableMobject, unregisterSerializableMobject, getSerializer, getSerializableTypes, } from './registry';
|
|
14
|
+
export type { SerializedScene, SerializedMobject, SerializedTransform, SerializedStyle, MobjectSerializer, SceneLike, ContainerLike, Vec3, } from './types';
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/serialization/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,2BAA2B,EAC3B,6BAA6B,EAC7B,aAAa,EACb,oBAAoB,GACrB,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,SAAS,EACT,aAAa,EACb,IAAI,GACL,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Vec3 } from './types';
|
|
2
|
+
/** Read a number, or `fallback` when the value is not a finite number. */
|
|
3
|
+
export declare function readNumber(value: unknown, fallback: number): number;
|
|
4
|
+
/** Read a string, or `fallback` when the value is not a string. */
|
|
5
|
+
export declare function readString(value: unknown, fallback: string): string;
|
|
6
|
+
/** Read a boolean, or `fallback` when the value is not a boolean. */
|
|
7
|
+
export declare function readBoolean(value: unknown, fallback: boolean): boolean;
|
|
8
|
+
/** Read an optional string: a string, or `undefined`. */
|
|
9
|
+
export declare function readOptionalString(value: unknown): string | undefined;
|
|
10
|
+
/** Read a `[x, y, z]` triple, or `fallback` when the value is not one. */
|
|
11
|
+
export declare function readVec3(value: unknown, fallback: Vec3): Vec3;
|
|
12
|
+
/** Read an array of `[x, y, z]` triples, dropping any malformed entries. */
|
|
13
|
+
export declare function readVec3Array(value: unknown): Vec3[];
|
|
14
|
+
/** True when `value` is a non-null, non-array object (a props/record bag). */
|
|
15
|
+
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
16
|
+
//# sourceMappingURL=props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/serialization/props.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAEpC,0EAA0E;AAC1E,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEnE;AAED,mEAAmE;AACnE,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEnE;AAED,qEAAqE;AACrE,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAEtE;AAED,yDAAyD;AACzD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAErE;AAWD,0EAA0E;AAC1E,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,GAAG,IAAI,CAE7D;AAED,4EAA4E;AAC5E,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,EAAE,CAOpD;AAED,8EAA8E;AAC9E,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEzE"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Mobject } from '../core/Mobject';
|
|
2
|
+
import { MobjectSerializer } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Register a serializer for a mobject type.
|
|
5
|
+
*
|
|
6
|
+
* @param name - The type name, which must match the mobject's class name
|
|
7
|
+
* (`mobject.constructor.name`) so instances can be looked up at capture time.
|
|
8
|
+
* @param serializer - The serialize/deserialize pair for this type.
|
|
9
|
+
*/
|
|
10
|
+
export declare function registerSerializableMobject<T extends Mobject>(name: string, serializer: MobjectSerializer<T>): void;
|
|
11
|
+
/** Remove a registration. Mainly for tests and hot-swapping. */
|
|
12
|
+
export declare function unregisterSerializableMobject(name: string): void;
|
|
13
|
+
/** Look up a serializer by type name, or `undefined` when none is registered. */
|
|
14
|
+
export declare function getSerializer(name: string): MobjectSerializer | undefined;
|
|
15
|
+
/** The names of every registered type, sorted for stable output. */
|
|
16
|
+
export declare function getSerializableTypes(): string[];
|
|
17
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/serialization/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAIjD;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,CAAC,SAAS,OAAO,EAC3D,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAC/B,IAAI,CAIN;AAED,gEAAgE;AAChE,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAEhE;AAED,iFAAiF;AACjF,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS,CAEzE;AAED,oEAAoE;AACpE,wBAAgB,oBAAoB,IAAI,MAAM,EAAE,CAE/C"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Mobject } from '../core/Mobject';
|
|
2
|
+
import { ContainerLike, SceneLike, SerializedMobject, SerializedScene } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Capture a single mobject (and its submobject tree) as a JSON-safe object.
|
|
5
|
+
*
|
|
6
|
+
* An unregistered type is captured with `unknown: true` and empty `props`, so
|
|
7
|
+
* the document still records its position in the tree for debugging, while a
|
|
8
|
+
* restore skips it.
|
|
9
|
+
*/
|
|
10
|
+
export declare function serializeMobject(mob: Mobject): SerializedMobject;
|
|
11
|
+
/**
|
|
12
|
+
* Reconstruct a single mobject from a serialized node, or `null` when the type
|
|
13
|
+
* is unknown (unregistered or marked `unknown`). Known children are attached;
|
|
14
|
+
* unknown children are dropped.
|
|
15
|
+
*/
|
|
16
|
+
export declare function deserializeMobject(json: unknown): Mobject | null;
|
|
17
|
+
/** Capture a whole scene (its top-level mobjects) as a JSON document. */
|
|
18
|
+
export declare function serializeScene(scene: SceneLike): SerializedScene;
|
|
19
|
+
/**
|
|
20
|
+
* Reconstruct the mobjects of a document and add each one to `container`.
|
|
21
|
+
* Returns the created top-level mobjects. A malformed document yields `[]`.
|
|
22
|
+
*/
|
|
23
|
+
export declare function deserializeScene(json: unknown, container: ContainerLike): Mobject[];
|
|
24
|
+
//# sourceMappingURL=serialize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialize.d.ts","sourceRoot":"","sources":["../../src/serialization/serialize.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,iBAAiB,EACtB,KAAK,eAAe,EAGrB,MAAM,SAAS,CAAC;AAmDjB;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,iBAAiB,CAYhE;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,GAAG,IAAI,CAqBhE;AAED,yEAAyE;AACzE,wBAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,GAAG,eAAe,CAIhE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,GAAG,OAAO,EAAE,CAWnF"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Mobject } from '../core/Mobject';
|
|
2
|
+
/** A plain, JSON-safe triple. */
|
|
3
|
+
export type Vec3 = [number, number, number];
|
|
4
|
+
/** Position, rotation (Euler XYZ, radians), and scale of a mobject. */
|
|
5
|
+
export interface SerializedTransform {
|
|
6
|
+
position: Vec3;
|
|
7
|
+
rotation: Vec3;
|
|
8
|
+
scale: Vec3;
|
|
9
|
+
}
|
|
10
|
+
/** Stroke and fill of a mobject. Only defined fields are written. */
|
|
11
|
+
export interface SerializedStyle {
|
|
12
|
+
strokeColor?: string;
|
|
13
|
+
fillColor?: string;
|
|
14
|
+
strokeOpacity?: number;
|
|
15
|
+
fillOpacity?: number;
|
|
16
|
+
strokeWidth?: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* One serialized mobject.
|
|
20
|
+
*
|
|
21
|
+
* `props` is `Record<string, unknown>` on purpose: each registered type owns
|
|
22
|
+
* the shape of its own props and narrows them on restore, so the schema stays
|
|
23
|
+
* open for new types without a central union to edit.
|
|
24
|
+
*/
|
|
25
|
+
export interface SerializedMobject {
|
|
26
|
+
/** Registered type name (its class name), e.g. `Circle`. */
|
|
27
|
+
type: string;
|
|
28
|
+
/** Constructor-relevant, unscaled properties for this type. */
|
|
29
|
+
props: Record<string, unknown>;
|
|
30
|
+
/** Position/rotation/scale, applied after construction. */
|
|
31
|
+
transform: SerializedTransform;
|
|
32
|
+
/** Stroke/fill, applied after construction. */
|
|
33
|
+
style: SerializedStyle;
|
|
34
|
+
/** Submobject tree. */
|
|
35
|
+
children: SerializedMobject[];
|
|
36
|
+
/**
|
|
37
|
+
* Present and `true` when the type had no registered serializer at capture
|
|
38
|
+
* time. Such a node is skipped (not reconstructed) on restore.
|
|
39
|
+
*/
|
|
40
|
+
unknown?: boolean;
|
|
41
|
+
}
|
|
42
|
+
/** Current document version. Bump when the schema changes incompatibly. */
|
|
43
|
+
export declare const SCENE_FORMAT = "manim-web-scene";
|
|
44
|
+
export declare const SCENE_VERSION = 1;
|
|
45
|
+
/** A full serialized scene document. */
|
|
46
|
+
export interface SerializedScene {
|
|
47
|
+
format: typeof SCENE_FORMAT;
|
|
48
|
+
version: number;
|
|
49
|
+
mobjects: SerializedMobject[];
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* A pair of functions that convert between a concrete mobject and its `props`.
|
|
53
|
+
*
|
|
54
|
+
* `serialize` returns only the type-specific, constructor-relevant props. The
|
|
55
|
+
* transform, style, and children are captured generically by the framework, so
|
|
56
|
+
* a serializer never repeats them.
|
|
57
|
+
*/
|
|
58
|
+
export interface MobjectSerializer<T extends Mobject = Mobject> {
|
|
59
|
+
serialize: (mobject: T) => Record<string, unknown>;
|
|
60
|
+
deserialize: (props: Record<string, unknown>) => T;
|
|
61
|
+
}
|
|
62
|
+
/** Anything the framework can read top-level mobjects from (e.g. a Scene). */
|
|
63
|
+
export interface SceneLike {
|
|
64
|
+
mobjects: Iterable<Mobject>;
|
|
65
|
+
}
|
|
66
|
+
/** Anything the framework can add reconstructed mobjects to (e.g. a Scene). */
|
|
67
|
+
export interface ContainerLike {
|
|
68
|
+
add: (...mobjects: Mobject[]) => unknown;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{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