manim-web 0.3.21 → 0.3.22
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 +20 -0
- package/dist/{AmsConfiguration-BMyoprhk.js → AmsConfiguration-OUoC_kJ0.js} +5 -5
- package/dist/{AmsConfiguration-BdxxYRby.js → AmsConfiguration-tdje_HlF.js} +5 -5
- package/dist/{ConfigMacrosConfiguration-B8X_JSVI.js → ConfigMacrosConfiguration-4OaQYvlr.js} +3 -3
- package/dist/{ConfigMacrosConfiguration-DUxp6DUV.js → ConfigMacrosConfiguration-DM3-S5M8.js} +3 -3
- package/dist/{Entities-B1o7gN0J.js → Entities-Dw6381dl.js} +2 -2
- package/dist/{Entities-C82lnCux.js → Entities-bJKKDYjE.js} +2 -2
- package/dist/{HtmlNode-BLmQ2r7U.js → HtmlNode-1mFtYQ9G.js} +2 -2
- package/dist/{HtmlNode-DXGeKrcW.js → HtmlNode-CQqo5we-.js} +2 -2
- package/dist/{InputJax-DL9oUQY4.js → InputJax-D5R2pqUk.js} +2 -2
- package/dist/{InputJax-DnDWM3Y0.js → InputJax-jNvwWU5P.js} +2 -2
- package/dist/{NewcommandConfiguration-BPjclFig.js → NewcommandConfiguration-BN_OlLcO.js} +2 -2
- package/dist/{NewcommandConfiguration-bJ6P1rBY.js → NewcommandConfiguration-DZ3mSCpD.js} +2 -2
- package/dist/{NewcommandMethods-C_E3iLoK.js → NewcommandMethods-D5bueYYE.js} +2 -2
- package/dist/{NewcommandMethods-Cb7yFm5P.js → NewcommandMethods-DTf_dan5.js} +2 -2
- package/dist/{ParseMethods-BMPfzfQC.js → ParseMethods-Deqa7kJ6.js} +7 -7
- package/dist/{ParseMethods-D3_HeS1K.js → ParseMethods-Dt5bYDSZ.js} +7 -7
- package/dist/{Styles-Dky5jZUe.js → Styles-BILrGVps.js} +1 -1
- package/dist/{Styles-J-6R3Vr8.js → Styles-DQSruwWe.js} +1 -1
- package/dist/animation/Animation.d.ts.map +1 -1
- package/dist/animation/MasterTimeline.d.ts +88 -1
- package/dist/animation/MasterTimeline.d.ts.map +1 -1
- package/dist/animation/movement/Rotate.d.ts +2 -7
- package/dist/animation/movement/Rotate.d.ts.map +1 -1
- package/dist/animation/transform/PointMorphStrategy.d.ts.map +1 -1
- package/dist/core/AnimateProxy.d.ts +3 -5
- package/dist/core/AnimateProxy.d.ts.map +1 -1
- package/dist/core/Camera.d.ts +37 -0
- package/dist/core/Camera.d.ts.map +1 -1
- package/dist/core/CameraExtensions.d.ts +33 -1
- package/dist/core/CameraExtensions.d.ts.map +1 -1
- package/dist/core/Group.d.ts +3 -11
- package/dist/core/Group.d.ts.map +1 -1
- package/dist/core/Mobject.d.ts +33 -7
- package/dist/core/Mobject.d.ts.map +1 -1
- package/dist/core/MobjectPositioning.d.ts +2 -5
- package/dist/core/MobjectPositioning.d.ts.map +1 -1
- package/dist/core/MobjectTypes.d.ts +21 -4
- package/dist/core/MobjectTypes.d.ts.map +1 -1
- package/dist/core/Renderer.d.ts +3 -0
- package/dist/core/Renderer.d.ts.map +1 -1
- package/dist/core/Scene.d.ts +50 -0
- package/dist/core/Scene.d.ts.map +1 -1
- package/dist/core/ThreeDScene.d.ts +3 -1
- package/dist/core/ThreeDScene.d.ts.map +1 -1
- package/dist/core/VGroup.d.ts +11 -19
- package/dist/core/VGroup.d.ts.map +1 -1
- package/dist/core/VMobject.d.ts +14 -1
- package/dist/core/VMobject.d.ts.map +1 -1
- package/dist/core/VMobjectGeometry.d.ts +20 -10
- package/dist/core/VMobjectGeometry.d.ts.map +1 -1
- package/dist/core/VMobjectRendering.d.ts +5 -0
- package/dist/core/VMobjectRendering.d.ts.map +1 -1
- package/dist/core/VMobjectTransformAlignment.d.ts +9 -0
- package/dist/core/VMobjectTransformAlignment.d.ts.map +1 -1
- package/dist/{html-DU38zqaN.js → html-Bza5WY1y.js} +6 -6
- package/dist/{html-DjkQuIHJ.js → html-bhzMuE8p.js} +6 -6
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -4
- package/dist/integrations/react.js +16 -18
- package/dist/integrations/vue.js +15 -17
- package/dist/interaction/OrbitControls.d.ts +1 -1
- package/dist/interaction/OrbitControls.d.ts.map +1 -1
- package/dist/{lengths-CP7zmbxJ.js → lengths-D2zTYMUu.js} +2 -2
- package/dist/{liteAdaptor-BLgze3o2.js → liteAdaptor-BkxB5CGC.js} +3 -3
- package/dist/{liteAdaptor-zXv-jsO1.js → liteAdaptor-LMKuWwg1.js} +3 -3
- package/dist/manim-web.browser.js +8668 -7171
- package/dist/{mathjax-7LgaTjtj.js → mathjax-CPQWkQEv.js} +2 -2
- package/dist/{mathjax-CoSFlQ0H.js → mathjax-b-GTdZgw.js} +2 -2
- package/dist/{mo-CNYDGAsg.js → mo-D4wFHS6V.js} +2 -2
- package/dist/{mo-C5uLT3Z9.js → mo-hAX79Dzl.js} +2 -2
- package/dist/mobjects/geometry/AngleShapes.d.ts +0 -4
- package/dist/mobjects/geometry/AngleShapes.d.ts.map +1 -1
- package/dist/mobjects/geometry/CubicBezier.d.ts.map +1 -1
- package/dist/mobjects/geometry/PolygonExtensions.d.ts.map +1 -1
- package/dist/mobjects/graphing/ComplexPlane.d.ts +41 -1
- package/dist/mobjects/graphing/ComplexPlane.d.ts.map +1 -1
- package/dist/mobjects/graphing/Vector.d.ts.map +1 -1
- package/dist/mobjects/point/Mobject1D.d.ts.map +1 -1
- package/dist/mobjects/point/Mobject2D.d.ts.map +1 -1
- package/dist/mobjects/point/PMobject.d.ts +8 -2
- package/dist/mobjects/point/PMobject.d.ts.map +1 -1
- package/dist/mobjects/point/PointMobject.d.ts.map +1 -1
- package/dist/mobjects/text/Code.d.ts.map +1 -1
- package/dist/mobjects/text/MathTex.d.ts +9 -0
- package/dist/mobjects/text/MathTex.d.ts.map +1 -1
- package/dist/mobjects/text/MathTexImage.d.ts.map +1 -1
- package/dist/mobjects/text/Text.d.ts.map +1 -1
- package/dist/mobjects/text/TextGlyphGroup.d.ts.map +1 -1
- package/dist/mobjects/three-d/Line3D.d.ts +10 -56
- package/dist/mobjects/three-d/Line3D.d.ts.map +1 -1
- package/dist/player/Player.d.ts +36 -29
- package/dist/player/Player.d.ts.map +1 -1
- package/dist/player/PlayerUI.d.ts.map +1 -1
- package/dist/player/RecordingScene.d.ts +37 -0
- package/dist/player/RecordingScene.d.ts.map +1 -0
- package/dist/{src-CW4pfZdP.js → src-BlTk3Bta.js} +8798 -7302
- package/dist/{svg-CYweEoZ1.js → svg-DNS5Hwhk.js} +268 -253
- package/dist/{svg-swSF_J59.js → svg-DVUoAdmC.js} +268 -253
- package/dist/test-setup/vitest-setup.d.ts +20 -0
- package/dist/test-setup/vitest-setup.d.ts.map +1 -0
- package/dist/{tex-C4_queV-.js → tex-BQCLd0dF.js} +19 -15
- package/dist/{tex-CA5MLeEe.js → tex-Cd_bTYKG.js} +19 -15
- package/dist/utils/axis.d.ts +4 -0
- package/dist/utils/axis.d.ts.map +1 -0
- package/dist/utils/logger.d.ts +37 -0
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/math.d.ts +4 -0
- package/dist/utils/math.d.ts.map +1 -1
- package/dist/utils/vectors.d.ts +54 -1
- package/dist/utils/vectors.d.ts.map +1 -1
- package/package.json +8 -6
- package/dist/Factory-D-whCqrb.js +0 -107
- package/dist/GifExporter-BrxY_q7e.js +0 -338
- package/dist/GifExporter-S2pbxMc5.js +0 -338
- package/dist/Options-XPptO-6X.js +0 -63
- package/dist/VideoExporter-6ikT3u9H.js +0 -102
- package/dist/VideoExporter-D_RxVahH.js +0 -102
- package/dist/lengths-D4tR1gYA.js +0 -54
- package/dist/rolldown-runtime-DnwLefa7.js +0 -23
- /package/dist/{Factory-BKM7FEO-.js → Factory-Ba6Nqb3M.js} +0 -0
- /package/dist/{Options-DRlTi0G8.js → Options-DMK2wYar.js} +0 -0
package/dist/Options-XPptO-6X.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
//#region node_modules/@mathjax/src/mjs/util/Options.js
|
|
2
|
-
var e = {}.constructor;
|
|
3
|
-
function t(t) {
|
|
4
|
-
return typeof t == "object" && !!t && (t.constructor === e || t.constructor === r);
|
|
5
|
-
}
|
|
6
|
-
var n = {
|
|
7
|
-
invalidOption: "warn",
|
|
8
|
-
optionError: (e, t) => {
|
|
9
|
-
if (n.invalidOption === "fatal") throw Error(e);
|
|
10
|
-
console.warn("MathJax: " + e);
|
|
11
|
-
}
|
|
12
|
-
}, r = class {};
|
|
13
|
-
function i(e) {
|
|
14
|
-
return Object.assign(Object.create(r.prototype), e);
|
|
15
|
-
}
|
|
16
|
-
function a(e) {
|
|
17
|
-
return Array.isArray(e) ? e : [e];
|
|
18
|
-
}
|
|
19
|
-
function o(e) {
|
|
20
|
-
return e ? Object.keys(e).concat(Object.getOwnPropertySymbols(e)) : [];
|
|
21
|
-
}
|
|
22
|
-
function s(e) {
|
|
23
|
-
let n = {};
|
|
24
|
-
for (let r of o(e)) {
|
|
25
|
-
let i = Object.getOwnPropertyDescriptor(e, r), a = i.value;
|
|
26
|
-
Array.isArray(a) ? i.value = c([], a, !1) : t(a) && (i.value = s(a)), i.enumerable && (n[r] = i);
|
|
27
|
-
}
|
|
28
|
-
return Object.defineProperties(e.constructor === r ? i({}) : {}, n);
|
|
29
|
-
}
|
|
30
|
-
function c(e, i, a = !0) {
|
|
31
|
-
for (let l of o(i)) {
|
|
32
|
-
if (a && e[l] === void 0 && e.constructor !== r) {
|
|
33
|
-
typeof l == "symbol" && (l = l.toString()), n.optionError(`Invalid option "${l}" (no default value).`, l);
|
|
34
|
-
continue;
|
|
35
|
-
}
|
|
36
|
-
let u = i[l], d = e[l];
|
|
37
|
-
if (t(u) && d !== null && (typeof d == "object" || typeof d == "function")) {
|
|
38
|
-
let t = o(u);
|
|
39
|
-
Array.isArray(d) && (t.length === 1 && (t[0] === "[+]" || t[0] === "[-]") && Array.isArray(u[t[0]]) || t.length === 2 && t.sort().join(",") === "[+],[-]" && Array.isArray(u["[+]"]) && Array.isArray(u["[-]"])) ? (u["[-]"] && (d = e[l] = d.filter((e) => u["[-]"].indexOf(e) < 0)), u["[+]"] && (e[l] = [...d, ...u["[+]"]])) : c(d, u, a);
|
|
40
|
-
} else Array.isArray(u) ? (e[l] = [], c(e[l], u, !1)) : t(u) ? e[l] = s(u) : e[l] = u;
|
|
41
|
-
}
|
|
42
|
-
return e;
|
|
43
|
-
}
|
|
44
|
-
function l(e, ...t) {
|
|
45
|
-
return t.forEach((t) => c(e, t, !1)), e;
|
|
46
|
-
}
|
|
47
|
-
function u(e, ...t) {
|
|
48
|
-
return t.forEach((t) => c(e, t, !0)), e;
|
|
49
|
-
}
|
|
50
|
-
function d(e, ...t) {
|
|
51
|
-
let n = [];
|
|
52
|
-
for (let r of t) {
|
|
53
|
-
let t = {}, i = {};
|
|
54
|
-
for (let n of Object.keys(e || {})) (r[n] === void 0 ? i : t)[n] = e[n];
|
|
55
|
-
n.push(t), e = i;
|
|
56
|
-
}
|
|
57
|
-
return n.unshift(e), n;
|
|
58
|
-
}
|
|
59
|
-
function f(e, t, n = null) {
|
|
60
|
-
return Object.hasOwn(t, e) ? t[e] : n;
|
|
61
|
-
}
|
|
62
|
-
//#endregion
|
|
63
|
-
export { d as a, a as i, i as n, u as o, f as r, l as t };
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { n as e } from "./rolldown-runtime-DnwLefa7.js";
|
|
2
|
-
//#region src/export/VideoExporter.ts
|
|
3
|
-
var t = /* @__PURE__ */ e({
|
|
4
|
-
VideoExporter: () => n,
|
|
5
|
-
createVideoExporter: () => r
|
|
6
|
-
}), n = class e {
|
|
7
|
-
_scene;
|
|
8
|
-
_options;
|
|
9
|
-
_mediaRecorder = null;
|
|
10
|
-
_recordedChunks = [];
|
|
11
|
-
_isRecording = !1;
|
|
12
|
-
constructor(e, t) {
|
|
13
|
-
this._scene = e, this._options = {
|
|
14
|
-
fps: t?.fps ?? 60,
|
|
15
|
-
quality: t?.quality ?? .9,
|
|
16
|
-
format: t?.format ?? "webm",
|
|
17
|
-
width: t?.width ?? e.getWidth(),
|
|
18
|
-
height: t?.height ?? e.getHeight(),
|
|
19
|
-
duration: t?.duration ?? 0,
|
|
20
|
-
onProgress: t?.onProgress ?? (() => {}),
|
|
21
|
-
includeAudio: t?.includeAudio ?? !0,
|
|
22
|
-
audioManager: t?.audioManager ?? null
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
_getAudioManager() {
|
|
26
|
-
if (this._options.audioManager) return this._options.audioManager;
|
|
27
|
-
try {
|
|
28
|
-
let e = this._scene.audioManager;
|
|
29
|
-
return e.tracks.length > 0 ? e : null;
|
|
30
|
-
} catch (e) {
|
|
31
|
-
return console.warn("AudioManager unavailable; exporting without audio:", e), null;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
async startRecording() {
|
|
35
|
-
if (this._isRecording) throw Error("Already recording");
|
|
36
|
-
let e = this._scene.getCanvas().captureStream(this._options.fps), t = this._options.includeAudio ? this._getAudioManager() : null, n;
|
|
37
|
-
if (t && t.tracks.length > 0) {
|
|
38
|
-
let r = t.createStreamDestination().stream.getAudioTracks();
|
|
39
|
-
n = new MediaStream([...e.getVideoTracks(), ...r]);
|
|
40
|
-
} else n = e;
|
|
41
|
-
let r;
|
|
42
|
-
if (this._options.format === "webm" ? r = "video/webm;codecs=vp9" : this._options.format === "mov" ? MediaRecorder.isTypeSupported("video/quicktime") ? r = "video/quicktime" : (console.warn("MOV format not supported by this browser, falling back to WebM"), r = "video/webm;codecs=vp9") : r = "video/mp4", !MediaRecorder.isTypeSupported(r)) throw Error(`Format ${r} is not supported by this browser`);
|
|
43
|
-
this._recordedChunks = [], this._mediaRecorder = new MediaRecorder(n, {
|
|
44
|
-
mimeType: r,
|
|
45
|
-
videoBitsPerSecond: Math.floor(this._options.quality * 1e7)
|
|
46
|
-
}), this._mediaRecorder.ondataavailable = (e) => {
|
|
47
|
-
e.data.size > 0 && this._recordedChunks.push(e.data);
|
|
48
|
-
}, this._mediaRecorder.start(), this._isRecording = !0;
|
|
49
|
-
}
|
|
50
|
-
async stopRecording() {
|
|
51
|
-
return new Promise((e, t) => {
|
|
52
|
-
if (!this._mediaRecorder || !this._isRecording) {
|
|
53
|
-
t(/* @__PURE__ */ Error("Not recording"));
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
this._mediaRecorder.onstop = () => {
|
|
57
|
-
let t;
|
|
58
|
-
t = this._options.format === "webm" ? "video/webm" : this._options.format === "mov" ? "video/quicktime" : "video/mp4";
|
|
59
|
-
let n = new Blob(this._recordedChunks, { type: t });
|
|
60
|
-
this._isRecording = !1, e(n);
|
|
61
|
-
}, this._mediaRecorder.stop();
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
async exportTimeline(e) {
|
|
65
|
-
let t = e ?? this._options.duration ?? this._scene.getTimelineDuration() ?? 5, n = Math.ceil(t * this._options.fps), r = 1 / this._options.fps, i = this._options.includeAudio ? this._getAudioManager() : null;
|
|
66
|
-
i && i.tracks.length > 0 && i.seek(0), await this.startRecording(), i && i.tracks.length > 0 && i.play();
|
|
67
|
-
for (let e = 0; e < n; e++) {
|
|
68
|
-
let t = e * r;
|
|
69
|
-
this._scene.seek(t), await new Promise((e) => requestAnimationFrame(e)), this._options.onProgress(e / n);
|
|
70
|
-
}
|
|
71
|
-
return i && i.isPlaying && i.stop(), this.stopRecording();
|
|
72
|
-
}
|
|
73
|
-
async exportAudio(e) {
|
|
74
|
-
let t = this._getAudioManager();
|
|
75
|
-
if (!t || t.tracks.length === 0) return null;
|
|
76
|
-
let n = e ?? this._options.duration ?? this._scene.getTimelineDuration() ?? 5;
|
|
77
|
-
return t.exportWAV(n);
|
|
78
|
-
}
|
|
79
|
-
static download(e, t = "animation.webm") {
|
|
80
|
-
let n = URL.createObjectURL(e), r = document.createElement("a");
|
|
81
|
-
r.href = n, r.download = t, document.body.appendChild(r), r.click(), document.body.removeChild(r), URL.revokeObjectURL(n);
|
|
82
|
-
}
|
|
83
|
-
async exportAndDownload(t, n) {
|
|
84
|
-
let r = await this.exportTimeline(n), i = {
|
|
85
|
-
webm: ".webm",
|
|
86
|
-
mp4: ".mp4",
|
|
87
|
-
mov: ".mov"
|
|
88
|
-
}[this._options.format] ?? ".webm";
|
|
89
|
-
e.download(r, t ?? `animation${i}`);
|
|
90
|
-
}
|
|
91
|
-
isRecording() {
|
|
92
|
-
return this._isRecording;
|
|
93
|
-
}
|
|
94
|
-
getOptions() {
|
|
95
|
-
return { ...this._options };
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
function r(e, t) {
|
|
99
|
-
return new n(e, t);
|
|
100
|
-
}
|
|
101
|
-
//#endregion
|
|
102
|
-
export { t as n, r, n as t };
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { n as e } from "./rolldown-runtime-DnwLefa7.js";
|
|
2
|
-
//#region src/export/VideoExporter.ts
|
|
3
|
-
var t = /* @__PURE__ */ e({
|
|
4
|
-
VideoExporter: () => n,
|
|
5
|
-
createVideoExporter: () => r
|
|
6
|
-
}), n = class e {
|
|
7
|
-
_scene;
|
|
8
|
-
_options;
|
|
9
|
-
_mediaRecorder = null;
|
|
10
|
-
_recordedChunks = [];
|
|
11
|
-
_isRecording = !1;
|
|
12
|
-
constructor(e, t) {
|
|
13
|
-
this._scene = e, this._options = {
|
|
14
|
-
fps: t?.fps ?? 60,
|
|
15
|
-
quality: t?.quality ?? .9,
|
|
16
|
-
format: t?.format ?? "webm",
|
|
17
|
-
width: t?.width ?? e.getWidth(),
|
|
18
|
-
height: t?.height ?? e.getHeight(),
|
|
19
|
-
duration: t?.duration ?? 0,
|
|
20
|
-
onProgress: t?.onProgress ?? (() => {}),
|
|
21
|
-
includeAudio: t?.includeAudio ?? !0,
|
|
22
|
-
audioManager: t?.audioManager ?? null
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
_getAudioManager() {
|
|
26
|
-
if (this._options.audioManager) return this._options.audioManager;
|
|
27
|
-
try {
|
|
28
|
-
let e = this._scene.audioManager;
|
|
29
|
-
return e.tracks.length > 0 ? e : null;
|
|
30
|
-
} catch (e) {
|
|
31
|
-
return console.warn("AudioManager unavailable; exporting without audio:", e), null;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
async startRecording() {
|
|
35
|
-
if (this._isRecording) throw Error("Already recording");
|
|
36
|
-
let e = this._scene.getCanvas().captureStream(this._options.fps), t = this._options.includeAudio ? this._getAudioManager() : null, n;
|
|
37
|
-
if (t && t.tracks.length > 0) {
|
|
38
|
-
let r = t.createStreamDestination().stream.getAudioTracks();
|
|
39
|
-
n = new MediaStream([...e.getVideoTracks(), ...r]);
|
|
40
|
-
} else n = e;
|
|
41
|
-
let r;
|
|
42
|
-
if (this._options.format === "webm" ? r = "video/webm;codecs=vp9" : this._options.format === "mov" ? MediaRecorder.isTypeSupported("video/quicktime") ? r = "video/quicktime" : (console.warn("MOV format not supported by this browser, falling back to WebM"), r = "video/webm;codecs=vp9") : r = "video/mp4", !MediaRecorder.isTypeSupported(r)) throw Error(`Format ${r} is not supported by this browser`);
|
|
43
|
-
this._recordedChunks = [], this._mediaRecorder = new MediaRecorder(n, {
|
|
44
|
-
mimeType: r,
|
|
45
|
-
videoBitsPerSecond: Math.floor(this._options.quality * 1e7)
|
|
46
|
-
}), this._mediaRecorder.ondataavailable = (e) => {
|
|
47
|
-
e.data.size > 0 && this._recordedChunks.push(e.data);
|
|
48
|
-
}, this._mediaRecorder.start(), this._isRecording = !0;
|
|
49
|
-
}
|
|
50
|
-
async stopRecording() {
|
|
51
|
-
return new Promise((e, t) => {
|
|
52
|
-
if (!this._mediaRecorder || !this._isRecording) {
|
|
53
|
-
t(/* @__PURE__ */ Error("Not recording"));
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
this._mediaRecorder.onstop = () => {
|
|
57
|
-
let t;
|
|
58
|
-
t = this._options.format === "webm" ? "video/webm" : this._options.format === "mov" ? "video/quicktime" : "video/mp4";
|
|
59
|
-
let n = new Blob(this._recordedChunks, { type: t });
|
|
60
|
-
this._isRecording = !1, e(n);
|
|
61
|
-
}, this._mediaRecorder.stop();
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
async exportTimeline(e) {
|
|
65
|
-
let t = e ?? this._options.duration ?? this._scene.getTimelineDuration() ?? 5, n = Math.ceil(t * this._options.fps), r = 1 / this._options.fps, i = this._options.includeAudio ? this._getAudioManager() : null;
|
|
66
|
-
i && i.tracks.length > 0 && i.seek(0), await this.startRecording(), i && i.tracks.length > 0 && i.play();
|
|
67
|
-
for (let e = 0; e < n; e++) {
|
|
68
|
-
let t = e * r;
|
|
69
|
-
this._scene.seek(t), await new Promise((e) => requestAnimationFrame(e)), this._options.onProgress(e / n);
|
|
70
|
-
}
|
|
71
|
-
return i && i.isPlaying && i.stop(), this.stopRecording();
|
|
72
|
-
}
|
|
73
|
-
async exportAudio(e) {
|
|
74
|
-
let t = this._getAudioManager();
|
|
75
|
-
if (!t || t.tracks.length === 0) return null;
|
|
76
|
-
let n = e ?? this._options.duration ?? this._scene.getTimelineDuration() ?? 5;
|
|
77
|
-
return t.exportWAV(n);
|
|
78
|
-
}
|
|
79
|
-
static download(e, t = "animation.webm") {
|
|
80
|
-
let n = URL.createObjectURL(e), r = document.createElement("a");
|
|
81
|
-
r.href = n, r.download = t, document.body.appendChild(r), r.click(), document.body.removeChild(r), URL.revokeObjectURL(n);
|
|
82
|
-
}
|
|
83
|
-
async exportAndDownload(t, n) {
|
|
84
|
-
let r = await this.exportTimeline(n), i = {
|
|
85
|
-
webm: ".webm",
|
|
86
|
-
mp4: ".mp4",
|
|
87
|
-
mov: ".mov"
|
|
88
|
-
}[this._options.format] ?? ".webm";
|
|
89
|
-
e.download(r, t ?? `animation${i}`);
|
|
90
|
-
}
|
|
91
|
-
isRecording() {
|
|
92
|
-
return this._isRecording;
|
|
93
|
-
}
|
|
94
|
-
getOptions() {
|
|
95
|
-
return { ...this._options };
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
function r(e, t) {
|
|
99
|
-
return new n(e, t);
|
|
100
|
-
}
|
|
101
|
-
//#endregion
|
|
102
|
-
export { t as n, r, n as t };
|
package/dist/lengths-D4tR1gYA.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
//#region node_modules/@mathjax/src/mjs/util/lengths.js
|
|
2
|
-
var e = 1e6, t = {
|
|
3
|
-
px: 1,
|
|
4
|
-
in: 96,
|
|
5
|
-
cm: 96 / 2.54,
|
|
6
|
-
mm: 96 / 25.4
|
|
7
|
-
}, n = {
|
|
8
|
-
em: 1,
|
|
9
|
-
ex: .431,
|
|
10
|
-
pt: 1 / 10,
|
|
11
|
-
pc: 12 / 10,
|
|
12
|
-
mu: 1 / 18
|
|
13
|
-
}, r = {
|
|
14
|
-
veryverythinmathspace: 1 / 18,
|
|
15
|
-
verythinmathspace: 2 / 18,
|
|
16
|
-
thinmathspace: 3 / 18,
|
|
17
|
-
mediummathspace: 4 / 18,
|
|
18
|
-
thickmathspace: 5 / 18,
|
|
19
|
-
verythickmathspace: 6 / 18,
|
|
20
|
-
veryverythickmathspace: 7 / 18,
|
|
21
|
-
negativeveryverythinmathspace: -1 / 18,
|
|
22
|
-
negativeverythinmathspace: -2 / 18,
|
|
23
|
-
negativethinmathspace: -3 / 18,
|
|
24
|
-
negativemediummathspace: -4 / 18,
|
|
25
|
-
negativethickmathspace: -5 / 18,
|
|
26
|
-
negativeverythickmathspace: -6 / 18,
|
|
27
|
-
negativeveryverythickmathspace: -7 / 18,
|
|
28
|
-
thin: .04,
|
|
29
|
-
medium: .06,
|
|
30
|
-
thick: .1,
|
|
31
|
-
normal: 1,
|
|
32
|
-
big: 2,
|
|
33
|
-
small: 1 / Math.sqrt(2),
|
|
34
|
-
infinity: e
|
|
35
|
-
};
|
|
36
|
-
function i(e, i = 0, a = 1, o = 16) {
|
|
37
|
-
if (typeof e != "string" && (e = String(e)), e === "" || e == null) return i;
|
|
38
|
-
if (r[e]) return r[e];
|
|
39
|
-
let s = e.match(/^\s*([-+]?(?:\.\d+|\d+(?:\.\d*)?))?(pt|em|ex|mu|px|pc|in|mm|cm|%)?/);
|
|
40
|
-
if (!s || s[0] === "") return i;
|
|
41
|
-
let c = parseFloat(s[1] || "1"), l = s[2];
|
|
42
|
-
return Object.hasOwn(t, l) ? c * t[l] / o / a : Object.hasOwn(n, l) ? c * n[l] : l === "%" ? c / 100 * i : c * i;
|
|
43
|
-
}
|
|
44
|
-
function a(e) {
|
|
45
|
-
return (100 * e).toFixed(1).replace(/\.?0+$/, "") + "%";
|
|
46
|
-
}
|
|
47
|
-
function o(e) {
|
|
48
|
-
return Math.abs(e) < .001 ? "0" : e.toFixed(3).replace(/\.?0+$/, "") + "em";
|
|
49
|
-
}
|
|
50
|
-
function s(t, n = -e, r = 16) {
|
|
51
|
-
return t *= r, n && t < n && (t = n), Math.abs(t) < .1 ? "0" : t.toFixed(1).replace(/\.0$/, "") + "px";
|
|
52
|
-
}
|
|
53
|
-
//#endregion
|
|
54
|
-
export { a, i, r as n, s as o, o as r, e as t };
|
|
@@ -1,23 +0,0 @@
|
|
|
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 };
|
|
File without changes
|
|
File without changes
|