@aicut/core 0.5.0 → 0.6.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 +66 -0
- package/dist/chunk-H6AY6NW4.js +123 -0
- package/dist/chunk-H6AY6NW4.js.map +1 -0
- package/dist/chunk-WTCK3XQ6.js +93 -0
- package/dist/chunk-WTCK3XQ6.js.map +1 -0
- package/dist/{i18n-B-DFWgKe.d.cts → i18n-B24k4XVG.d.cts} +34 -1
- package/dist/{i18n-B-DFWgKe.d.ts → i18n-B24k4XVG.d.ts} +34 -1
- package/dist/index.cjs +1917 -96
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +348 -25
- package/dist/index.d.ts +348 -25
- package/dist/index.js +1779 -86
- package/dist/index.js.map +1 -1
- package/dist/lighting/index.cjs +24 -6
- package/dist/lighting/index.cjs.map +1 -1
- package/dist/lighting/index.d.cts +2 -2
- package/dist/lighting/index.d.ts +2 -2
- package/dist/lighting/index.js +1 -1
- package/dist/playback/webcodecs/index.cjs +113 -6
- package/dist/playback/webcodecs/index.cjs.map +1 -1
- package/dist/playback/webcodecs/index.d.cts +18 -2
- package/dist/playback/webcodecs/index.d.ts +18 -2
- package/dist/playback/webcodecs/index.js +46 -6
- package/dist/playback/webcodecs/index.js.map +1 -1
- package/dist/{types-DvKlxylu.d.cts → types-BbZjOQLz.d.ts} +34 -1
- package/dist/{types-rwZx6FxE.d.ts → types-CjvRUPtZ.d.cts} +34 -1
- package/dist/types-CmS-UIEr.d.cts +137 -0
- package/dist/types-CmS-UIEr.d.ts +137 -0
- package/package.json +1 -1
- package/styles/theme.css +351 -0
- package/dist/chunk-CCDON7CU.js +0 -87
- package/dist/chunk-CCDON7CU.js.map +0 -1
- package/dist/types-CHplD9V5.d.cts +0 -70
- package/dist/types-CHplD9V5.d.ts +0 -70
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as Ms, P as Project } from '../../types-
|
|
2
|
-
import { P as PlaybackEngine, a as PlaybackEngineOptions, b as PlaybackEngineFactory } from '../../types-
|
|
1
|
+
import { M as Ms, P as Project } from '../../types-CmS-UIEr.cjs';
|
|
2
|
+
import { P as PlaybackEngine, a as PlaybackEngineOptions, b as PlaybackEngineFactory } from '../../types-CjvRUPtZ.cjs';
|
|
3
3
|
|
|
4
4
|
interface WebCodecsEngineOptions extends PlaybackEngineOptions {
|
|
5
5
|
/**
|
|
@@ -40,6 +40,10 @@ declare class WebCodecsEngine implements PlaybackEngine {
|
|
|
40
40
|
private lastFrameTs;
|
|
41
41
|
private decodedFramesTotal;
|
|
42
42
|
private destroyed;
|
|
43
|
+
/** Output frame rect (fixed bounds, no transform) in CSS pixels. */
|
|
44
|
+
private lastOutputRect;
|
|
45
|
+
/** Post-transform content rect in CSS pixels. */
|
|
46
|
+
private lastFrameRect;
|
|
43
47
|
onTimeUpdate?: (ms: Ms) => void;
|
|
44
48
|
onEnded?: () => void;
|
|
45
49
|
onError?: (err: Error) => void;
|
|
@@ -53,6 +57,18 @@ declare class WebCodecsEngine implements PlaybackEngine {
|
|
|
53
57
|
getTime(): Ms;
|
|
54
58
|
seek(timeMs: Ms): void;
|
|
55
59
|
destroy(): void;
|
|
60
|
+
getOutputFrameRect(): {
|
|
61
|
+
x: number;
|
|
62
|
+
y: number;
|
|
63
|
+
w: number;
|
|
64
|
+
h: number;
|
|
65
|
+
} | null;
|
|
66
|
+
getFrameRect(): {
|
|
67
|
+
x: number;
|
|
68
|
+
y: number;
|
|
69
|
+
w: number;
|
|
70
|
+
h: number;
|
|
71
|
+
} | null;
|
|
56
72
|
private syncSources;
|
|
57
73
|
private teardownSource;
|
|
58
74
|
private onTrackReady;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as Ms, P as Project } from '../../types-
|
|
2
|
-
import { P as PlaybackEngine, a as PlaybackEngineOptions, b as PlaybackEngineFactory } from '../../types-
|
|
1
|
+
import { M as Ms, P as Project } from '../../types-CmS-UIEr.js';
|
|
2
|
+
import { P as PlaybackEngine, a as PlaybackEngineOptions, b as PlaybackEngineFactory } from '../../types-BbZjOQLz.js';
|
|
3
3
|
|
|
4
4
|
interface WebCodecsEngineOptions extends PlaybackEngineOptions {
|
|
5
5
|
/**
|
|
@@ -40,6 +40,10 @@ declare class WebCodecsEngine implements PlaybackEngine {
|
|
|
40
40
|
private lastFrameTs;
|
|
41
41
|
private decodedFramesTotal;
|
|
42
42
|
private destroyed;
|
|
43
|
+
/** Output frame rect (fixed bounds, no transform) in CSS pixels. */
|
|
44
|
+
private lastOutputRect;
|
|
45
|
+
/** Post-transform content rect in CSS pixels. */
|
|
46
|
+
private lastFrameRect;
|
|
43
47
|
onTimeUpdate?: (ms: Ms) => void;
|
|
44
48
|
onEnded?: () => void;
|
|
45
49
|
onError?: (err: Error) => void;
|
|
@@ -53,6 +57,18 @@ declare class WebCodecsEngine implements PlaybackEngine {
|
|
|
53
57
|
getTime(): Ms;
|
|
54
58
|
seek(timeMs: Ms): void;
|
|
55
59
|
destroy(): void;
|
|
60
|
+
getOutputFrameRect(): {
|
|
61
|
+
x: number;
|
|
62
|
+
y: number;
|
|
63
|
+
w: number;
|
|
64
|
+
h: number;
|
|
65
|
+
} | null;
|
|
66
|
+
getFrameRect(): {
|
|
67
|
+
x: number;
|
|
68
|
+
y: number;
|
|
69
|
+
w: number;
|
|
70
|
+
h: number;
|
|
71
|
+
} | null;
|
|
56
72
|
private syncSources;
|
|
57
73
|
private teardownSource;
|
|
58
74
|
private onTrackReady;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { getEffectiveTransform } from '../../chunk-WTCK3XQ6.js';
|
|
2
|
+
|
|
1
3
|
// ../../node_modules/.pnpm/mp4box@2.4.1/node_modules/mp4box/dist/rolldown-runtime-w6R9maHv.mjs
|
|
2
4
|
var __defProp = Object.defineProperty;
|
|
3
5
|
var __exportAll = (all, no_symbols) => {
|
|
@@ -10118,6 +10120,10 @@ var WebCodecsEngine = class {
|
|
|
10118
10120
|
lastFrameTs = 0;
|
|
10119
10121
|
decodedFramesTotal = 0;
|
|
10120
10122
|
destroyed = false;
|
|
10123
|
+
/** Output frame rect (fixed bounds, no transform) in CSS pixels. */
|
|
10124
|
+
lastOutputRect = null;
|
|
10125
|
+
/** Post-transform content rect in CSS pixels. */
|
|
10126
|
+
lastFrameRect = null;
|
|
10121
10127
|
onTimeUpdate;
|
|
10122
10128
|
onEnded;
|
|
10123
10129
|
onError;
|
|
@@ -10236,6 +10242,12 @@ var WebCodecsEngine = class {
|
|
|
10236
10242
|
this.sources.clear();
|
|
10237
10243
|
this.mount.remove();
|
|
10238
10244
|
}
|
|
10245
|
+
getOutputFrameRect() {
|
|
10246
|
+
return this.lastOutputRect;
|
|
10247
|
+
}
|
|
10248
|
+
getFrameRect() {
|
|
10249
|
+
return this.lastFrameRect;
|
|
10250
|
+
}
|
|
10239
10251
|
// --- internals -------------------------------------------------------
|
|
10240
10252
|
syncSources() {
|
|
10241
10253
|
const wantedVideoIds = new Set(
|
|
@@ -10537,12 +10549,40 @@ var WebCodecsEngine = class {
|
|
|
10537
10549
|
if (chosenFrame) {
|
|
10538
10550
|
const vw = chosenFrame.displayWidth || chosenFrame.codedWidth;
|
|
10539
10551
|
const vh = chosenFrame.displayHeight || chosenFrame.codedHeight;
|
|
10540
|
-
const
|
|
10541
|
-
const dw = vw *
|
|
10542
|
-
const dh = vh *
|
|
10543
|
-
const
|
|
10544
|
-
const
|
|
10545
|
-
|
|
10552
|
+
const baseScale = Math.min(cw / vw, ch / vh);
|
|
10553
|
+
const dw = vw * baseScale;
|
|
10554
|
+
const dh = vh * baseScale;
|
|
10555
|
+
const dpr = window.devicePixelRatio || 1;
|
|
10556
|
+
const t = getEffectiveTransform(clip, localMs);
|
|
10557
|
+
const outX = (cw - dw) / 2;
|
|
10558
|
+
const outY = (ch - dh) / 2;
|
|
10559
|
+
this.ctx.save();
|
|
10560
|
+
this.ctx.beginPath();
|
|
10561
|
+
this.ctx.rect(outX, outY, dw, dh);
|
|
10562
|
+
this.ctx.clip();
|
|
10563
|
+
this.ctx.translate(cw / 2 + t.panX * dpr, ch / 2 + t.panY * dpr);
|
|
10564
|
+
this.ctx.scale(t.scale, t.scale);
|
|
10565
|
+
this.ctx.drawImage(chosenFrame, -dw / 2, -dh / 2, dw, dh);
|
|
10566
|
+
this.ctx.restore();
|
|
10567
|
+
this.lastOutputRect = {
|
|
10568
|
+
x: outX / dpr,
|
|
10569
|
+
y: outY / dpr,
|
|
10570
|
+
w: dw / dpr,
|
|
10571
|
+
h: dh / dpr
|
|
10572
|
+
};
|
|
10573
|
+
const cssCx = cw / (2 * dpr) + t.panX;
|
|
10574
|
+
const cssCy = ch / (2 * dpr) + t.panY;
|
|
10575
|
+
const cssW = dw * t.scale / dpr;
|
|
10576
|
+
const cssH = dh * t.scale / dpr;
|
|
10577
|
+
this.lastFrameRect = {
|
|
10578
|
+
x: cssCx - cssW / 2,
|
|
10579
|
+
y: cssCy - cssH / 2,
|
|
10580
|
+
w: cssW,
|
|
10581
|
+
h: cssH
|
|
10582
|
+
};
|
|
10583
|
+
} else {
|
|
10584
|
+
this.lastFrameRect = null;
|
|
10585
|
+
this.lastOutputRect = null;
|
|
10546
10586
|
}
|
|
10547
10587
|
this.feedDecoder(src);
|
|
10548
10588
|
}
|