pixi-effects 0.48.1 → 0.48.2
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 +7 -0
- package/README.md +5 -5
- package/ai/chat-template.html +3 -3
- package/dist/Composition-5FKV2IBP.js +7 -0
- package/dist/{Composition-BOLWGT2R.js.map → Composition-5FKV2IBP.js.map} +1 -1
- package/dist/Composition-TJ5D7Z63.cjs +16 -0
- package/dist/{Composition-ZZEOEETS.cjs.map → Composition-TJ5D7Z63.cjs.map} +1 -1
- package/dist/{Spans-MWYFG7RI.cjs → Spans-5ENZ3XGS.cjs} +9 -9
- package/dist/{Spans-MWYFG7RI.cjs.map → Spans-5ENZ3XGS.cjs.map} +1 -1
- package/dist/{Spans-PGXRMD6J.js → Spans-6A3VLHRH.js} +4 -4
- package/dist/{Spans-PGXRMD6J.js.map → Spans-6A3VLHRH.js.map} +1 -1
- package/dist/{chunk-L3XC464G.cjs → chunk-45ALIMAF.cjs} +76 -56
- package/dist/chunk-45ALIMAF.cjs.map +1 -0
- package/dist/{chunk-AJWUCFGM.js → chunk-6D4W2KZQ.js} +3 -3
- package/dist/{chunk-AJWUCFGM.js.map → chunk-6D4W2KZQ.js.map} +1 -1
- package/dist/{chunk-M2LFQY2E.cjs → chunk-CCPJD76D.cjs} +63 -63
- package/dist/{chunk-M2LFQY2E.cjs.map → chunk-CCPJD76D.cjs.map} +1 -1
- package/dist/{chunk-L3MEZZAV.js → chunk-IVKI6CPH.js} +10 -12
- package/dist/chunk-IVKI6CPH.js.map +1 -0
- package/dist/{chunk-IY5YTIK3.js → chunk-RCKLUCB7.js} +36 -16
- package/dist/chunk-RCKLUCB7.js.map +1 -0
- package/dist/{chunk-V3VBHSK6.cjs → chunk-Z3DM4ETD.cjs} +55 -76
- package/dist/chunk-Z3DM4ETD.cjs.map +1 -0
- package/dist/index.cjs +33 -33
- package/dist/index.js +3 -3
- package/dist/loader.css +1 -1
- package/dist/present.cjs +3 -3
- package/dist/present.js +3 -3
- package/dist/three.cjs +5 -5
- package/dist/three.js +1 -1
- package/llms-full.txt +1 -1
- package/package.json +1 -1
- package/skills/pixi-effects/SKILL.md +1 -1
- package/skills/pixi-effects/template.html +6 -6
- package/dist/Composition-BOLWGT2R.js +0 -7
- package/dist/Composition-ZZEOEETS.cjs +0 -16
- package/dist/chunk-IY5YTIK3.js.map +0 -1
- package/dist/chunk-L3MEZZAV.js.map +0 -1
- package/dist/chunk-L3XC464G.cjs.map +0 -1
- package/dist/chunk-V3VBHSK6.cjs.map +0 -1
|
@@ -2,27 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var chunkNGJXVJB7_cjs = require('./chunk-NGJXVJB7.cjs');
|
|
4
4
|
var chunkDOLTCXCL_cjs = require('./chunk-DOLTCXCL.cjs');
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
function _interopNamespace(e) {
|
|
8
|
-
if (e && e.__esModule) return e;
|
|
9
|
-
var n = Object.create(null);
|
|
10
|
-
if (e) {
|
|
11
|
-
Object.keys(e).forEach(function (k) {
|
|
12
|
-
if (k !== 'default') {
|
|
13
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
get: function () { return e[k]; }
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
n.default = e;
|
|
22
|
-
return Object.freeze(n);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
var PIXI__namespace = /*#__PURE__*/_interopNamespace(PIXI);
|
|
5
|
+
var pixi_js = require('pixi.js');
|
|
26
6
|
|
|
27
7
|
// src/core/spring.ts
|
|
28
8
|
var SETTLE_TOL = 5e-3;
|
|
@@ -948,7 +928,7 @@ function colorNumber(v) {
|
|
|
948
928
|
}
|
|
949
929
|
function viaPixi(s) {
|
|
950
930
|
try {
|
|
951
|
-
const [r, g, b, a] = new
|
|
931
|
+
const [r, g, b, a] = new pixi_js.Color(s).toArray();
|
|
952
932
|
return [Math.round(r * 255), Math.round(g * 255), Math.round(b * 255), a];
|
|
953
933
|
} catch {
|
|
954
934
|
return null;
|
|
@@ -1690,10 +1670,10 @@ fn mainFragment(@location(0) uv : vec2<f32>) -> @location(0) vec4<f32> {
|
|
|
1690
1670
|
`;
|
|
1691
1671
|
function toRgb01(input) {
|
|
1692
1672
|
if (Array.isArray(input)) return [input[0], input[1], input[2]];
|
|
1693
|
-
const c = new
|
|
1673
|
+
const c = new pixi_js.Color(input);
|
|
1694
1674
|
return [c.red, c.green, c.blue];
|
|
1695
1675
|
}
|
|
1696
|
-
var ChromaKeyFilter = class extends
|
|
1676
|
+
var ChromaKeyFilter = class extends pixi_js.Filter {
|
|
1697
1677
|
constructor(options = {}) {
|
|
1698
1678
|
const {
|
|
1699
1679
|
keyColor = "#00ff00",
|
|
@@ -1701,12 +1681,12 @@ var ChromaKeyFilter = class extends PIXI.Filter {
|
|
|
1701
1681
|
smoothing = 0.1,
|
|
1702
1682
|
spill = 0.2
|
|
1703
1683
|
} = options;
|
|
1704
|
-
const glProgram =
|
|
1705
|
-
vertex:
|
|
1684
|
+
const glProgram = pixi_js.GlProgram.from({
|
|
1685
|
+
vertex: pixi_js.defaultFilterVert,
|
|
1706
1686
|
fragment: GL_FRAGMENT,
|
|
1707
1687
|
name: "chroma-key-filter"
|
|
1708
1688
|
});
|
|
1709
|
-
const gpuProgram =
|
|
1689
|
+
const gpuProgram = pixi_js.GpuProgram.from({
|
|
1710
1690
|
vertex: { source: WGSL_SOURCE, entryPoint: "mainVertex" },
|
|
1711
1691
|
fragment: { source: WGSL_SOURCE, entryPoint: "mainFragment" }
|
|
1712
1692
|
});
|
|
@@ -1714,7 +1694,7 @@ var ChromaKeyFilter = class extends PIXI.Filter {
|
|
|
1714
1694
|
glProgram,
|
|
1715
1695
|
gpuProgram,
|
|
1716
1696
|
resources: {
|
|
1717
|
-
chromaUniforms: new
|
|
1697
|
+
chromaUniforms: new pixi_js.UniformGroup({
|
|
1718
1698
|
uKeyColor: { value: toRgb01(keyColor), type: "vec3<f32>" },
|
|
1719
1699
|
uThreshold: { value: threshold, type: "f32" },
|
|
1720
1700
|
uSmoothing: { value: smoothing, type: "f32" },
|
|
@@ -1898,17 +1878,17 @@ fn mainFragment(@location(0) uv : vec2<f32>) -> @location(0) vec4<f32> {
|
|
|
1898
1878
|
return vec4<f32>(rgb * raw.a, raw.a);
|
|
1899
1879
|
}`;
|
|
1900
1880
|
var GRAIN_KEYS = ["amount", "size", "seed", "fps", "color", "loop"];
|
|
1901
|
-
var GrainFilter = class extends
|
|
1881
|
+
var GrainFilter = class extends pixi_js.Filter {
|
|
1902
1882
|
_fps;
|
|
1903
1883
|
_loop = 0;
|
|
1904
1884
|
constructor(options = {}) {
|
|
1905
1885
|
chunkDOLTCXCL_cjs.warnUnknownOptions("grain filter", options, GRAIN_KEYS);
|
|
1906
1886
|
const { amount = 0.08, size = 1.5, seed = 0, fps = 24, color = 0, loop } = options;
|
|
1907
1887
|
super({
|
|
1908
|
-
glProgram:
|
|
1909
|
-
gpuProgram:
|
|
1888
|
+
glProgram: pixi_js.GlProgram.from({ vertex: GL_VERTEX, fragment: GL_FRAGMENT2, name: "grain-filter" }),
|
|
1889
|
+
gpuProgram: pixi_js.GpuProgram.from({ vertex: { source: WGSL_SOURCE2, entryPoint: "mainVertex" }, fragment: { source: WGSL_SOURCE2, entryPoint: "mainFragment" } }),
|
|
1910
1890
|
resources: {
|
|
1911
|
-
grainUniforms: new
|
|
1891
|
+
grainUniforms: new pixi_js.UniformGroup({
|
|
1912
1892
|
uAmount: { value: amount, type: "f32" },
|
|
1913
1893
|
uSize: { value: Math.max(size, 0.25), type: "f32" },
|
|
1914
1894
|
uSeed: { value: Math.floor(seed), type: "f32" },
|
|
@@ -2121,7 +2101,7 @@ fn mainFragment(@location(0) uv : vec2<f32>) -> @location(0) vec4<f32> {
|
|
|
2121
2101
|
let suv = clamp(uv + off * gfu.uInputSize.zw, gfu.uInputClamp.xy, gfu.uInputClamp.zw);
|
|
2122
2102
|
return textureSampleLevel(uTexture, uSampler, suv, 0.0);
|
|
2123
2103
|
}`;
|
|
2124
|
-
var WarpFilter = class extends
|
|
2104
|
+
var WarpFilter = class extends pixi_js.Filter {
|
|
2125
2105
|
constructor(options = {}) {
|
|
2126
2106
|
chunkDOLTCXCL_cjs.warnUnknownOptions("warp filter", options, OPTION_KEYS);
|
|
2127
2107
|
let { kind = "wave", strength = 6, scale = 80, speed = 0.5, angle = 0, seed = 0 } = options;
|
|
@@ -2143,10 +2123,10 @@ var WarpFilter = class extends PIXI.Filter {
|
|
|
2143
2123
|
scale = 1;
|
|
2144
2124
|
}
|
|
2145
2125
|
super({
|
|
2146
|
-
glProgram:
|
|
2147
|
-
gpuProgram:
|
|
2126
|
+
glProgram: pixi_js.GlProgram.from({ vertex: GL_VERTEX2, fragment: GL_FRAGMENT3, name: "warp-filter" }),
|
|
2127
|
+
gpuProgram: pixi_js.GpuProgram.from({ vertex: { source: WGSL_SOURCE3, entryPoint: "mainVertex" }, fragment: { source: WGSL_SOURCE3, entryPoint: "mainFragment" } }),
|
|
2148
2128
|
resources: {
|
|
2149
|
-
warpUniforms: new
|
|
2129
|
+
warpUniforms: new pixi_js.UniformGroup({
|
|
2150
2130
|
uStrength: { value: strength, type: "f32" },
|
|
2151
2131
|
uScale: { value: scale, type: "f32" },
|
|
2152
2132
|
uSpeed: { value: speed, type: "f32" },
|
|
@@ -2206,7 +2186,7 @@ var WarpFilter = class extends PIXI.Filter {
|
|
|
2206
2186
|
};
|
|
2207
2187
|
|
|
2208
2188
|
// src/filters/named.ts
|
|
2209
|
-
var CORE = { blur:
|
|
2189
|
+
var CORE = { blur: () => pixi_js.BlurFilter, noise: () => pixi_js.NoiseFilter, alpha: () => pixi_js.AlphaFilter };
|
|
2210
2190
|
var CORE_TYPES = ["blur", "noise", "alpha", "colorMatrix", "grain", "warp"];
|
|
2211
2191
|
var LIBRARY_TYPES = [
|
|
2212
2192
|
"adjustment",
|
|
@@ -2305,7 +2285,7 @@ async function ensureFilterLibrary(spec, load = () => import('pixi-filters')) {
|
|
|
2305
2285
|
var SINGLE_VALUE = { pixelate: "size", emboss: "strength" };
|
|
2306
2286
|
var MATRIX_PRESETS = ["sepia", "grayscale", "negative", "polaroid", "technicolor", "vintage", "kodachrome", "browni"];
|
|
2307
2287
|
function colorMatrix(params) {
|
|
2308
|
-
const f = new
|
|
2288
|
+
const f = new pixi_js.ColorMatrixFilter();
|
|
2309
2289
|
const preset = params.preset;
|
|
2310
2290
|
if (preset !== void 0) {
|
|
2311
2291
|
if (!MATRIX_PRESETS.includes(preset)) {
|
|
@@ -2335,9 +2315,8 @@ function lintBulgeCenter(params) {
|
|
|
2335
2315
|
function fixRadialBlurGpu(f) {
|
|
2336
2316
|
const holder = f;
|
|
2337
2317
|
const gp = holder.gpuProgram;
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
holder.gpuProgram = GpuProgram5.from({ name: gp.name, vertex: gp.vertex, fragment: { ...gp.fragment, source: gp.fragment.source.replace(/uKernelSize(\s*):\s*f32/, "uKernelSize$1: i32") } });
|
|
2318
|
+
if (!gp || !/uKernelSize\s*:\s*f32/.test(gp.fragment.source)) return f;
|
|
2319
|
+
holder.gpuProgram = pixi_js.GpuProgram.from({ name: gp.name, vertex: gp.vertex, fragment: { ...gp.fragment, source: gp.fragment.source.replace(/uKernelSize(\s*):\s*f32/, "uKernelSize$1: i32") } });
|
|
2341
2320
|
return f;
|
|
2342
2321
|
}
|
|
2343
2322
|
function createNamedFilter(type, params) {
|
|
@@ -2346,7 +2325,7 @@ function createNamedFilter(type, params) {
|
|
|
2346
2325
|
if (lower(type) === "grain") return new GrainFilter(params);
|
|
2347
2326
|
if (lower(type) === "warp") return new WarpFilter(params);
|
|
2348
2327
|
const core = Object.entries(CORE).find(([k]) => lower(k) === lower(type));
|
|
2349
|
-
if (core) return new
|
|
2328
|
+
if (core) return new (core[1]())(params);
|
|
2350
2329
|
if (!isLibraryType(type)) throw unknownType(type);
|
|
2351
2330
|
const Ctor = library?.get(lower(type));
|
|
2352
2331
|
if (!Ctor) throw MISSING(`"${type}"`, library ? "not found in the loaded package" : "not loaded yet");
|
|
@@ -2441,7 +2420,7 @@ var Sequence = class {
|
|
|
2441
2420
|
}
|
|
2442
2421
|
const fa = this.spec.filterArea;
|
|
2443
2422
|
if (fa && this.target) {
|
|
2444
|
-
this.target.filterArea = new
|
|
2423
|
+
this.target.filterArea = new pixi_js.Rectangle(fa.x, fa.y, fa.width, fa.height);
|
|
2445
2424
|
}
|
|
2446
2425
|
}
|
|
2447
2426
|
scope() {
|
|
@@ -2506,7 +2485,7 @@ var Sequence = class {
|
|
|
2506
2485
|
};
|
|
2507
2486
|
var NullSequence = class extends Sequence {
|
|
2508
2487
|
async build() {
|
|
2509
|
-
this.target = new
|
|
2488
|
+
this.target = new pixi_js.Container();
|
|
2510
2489
|
this.buildFilters();
|
|
2511
2490
|
}
|
|
2512
2491
|
};
|
|
@@ -2788,7 +2767,7 @@ var GradientPainter = class {
|
|
|
2788
2767
|
this.size = size;
|
|
2789
2768
|
this.canvas.width = size;
|
|
2790
2769
|
this.canvas.height = size;
|
|
2791
|
-
this.tex =
|
|
2770
|
+
this.tex = pixi_js.Texture.from(this.canvas);
|
|
2792
2771
|
globalThis.__gradientPainters = (globalThis.__gradientPainters ?? 0) + 1;
|
|
2793
2772
|
}
|
|
2794
2773
|
size;
|
|
@@ -2797,7 +2776,7 @@ var GradientPainter = class {
|
|
|
2797
2776
|
/** Paint `g` and return what `Graphics.fill(...)` takes. */
|
|
2798
2777
|
paint(g) {
|
|
2799
2778
|
const ctx = this.canvas.getContext("2d"), s = this.size;
|
|
2800
|
-
if (!ctx) return new
|
|
2779
|
+
if (!ctx) return new pixi_js.FillGradient(gradientOptions({ angle: g.angle, stops: g.stops.map((x) => [x.offset, x.color]) }));
|
|
2801
2780
|
ctx.clearRect(0, 0, s, s);
|
|
2802
2781
|
if (g.type === "radial") {
|
|
2803
2782
|
paintRadial(ctx, s, { stops: g.stops.map((x) => [x.offset, x.color]), center: g.center, innerRadius: g.innerRadius, radius: g.radius });
|
|
@@ -2957,7 +2936,7 @@ var TextSequence = class extends Sequence {
|
|
|
2957
2936
|
_fillGradient = null;
|
|
2958
2937
|
_applyGradient() {
|
|
2959
2938
|
const g = this._grad.grad;
|
|
2960
|
-
const next = new
|
|
2939
|
+
const next = new pixi_js.FillGradient(gradientOptions({ angle: g.angle, stops: g.stops.map((s) => [s.offset, s.color]) }));
|
|
2961
2940
|
this.target.style.fill = next;
|
|
2962
2941
|
this._fillGradient?.destroy();
|
|
2963
2942
|
this._fillGradient = next;
|
|
@@ -2988,7 +2967,7 @@ var TextSequence = class extends Sequence {
|
|
|
2988
2967
|
const baseStyle = { ...TEXT_STYLE_DEFAULTS };
|
|
2989
2968
|
const initialProps = this.spec.initial ?? {};
|
|
2990
2969
|
this._template = String(initialProps.text ?? this.spec.text ?? "");
|
|
2991
|
-
const text = new
|
|
2970
|
+
const text = new pixi_js.Text({
|
|
2992
2971
|
text: this._template,
|
|
2993
2972
|
style: baseStyle,
|
|
2994
2973
|
label: this.spec.name
|
|
@@ -3494,7 +3473,7 @@ var CameraSequence = class extends Sequence {
|
|
|
3494
3473
|
this.duration = this.parent?.duration ?? this.root.duration;
|
|
3495
3474
|
}
|
|
3496
3475
|
const home = homeCamera(compW, this.compH);
|
|
3497
|
-
const carrier = new
|
|
3476
|
+
const carrier = new pixi_js.Container();
|
|
3498
3477
|
carrier.x = home.x;
|
|
3499
3478
|
carrier.y = home.y;
|
|
3500
3479
|
carrier.z = home.z;
|
|
@@ -3566,7 +3545,7 @@ var CameraSequence = class extends Sequence {
|
|
|
3566
3545
|
fogState() {
|
|
3567
3546
|
if (!this.fog) return null;
|
|
3568
3547
|
const c = this.target;
|
|
3569
|
-
const fc = this.fogC ??= new
|
|
3548
|
+
const fc = this.fogC ??= new pixi_js.Color();
|
|
3570
3549
|
try {
|
|
3571
3550
|
fc.setValue(c.fogColor);
|
|
3572
3551
|
} catch {
|
|
@@ -3678,12 +3657,12 @@ function lightLevel(frame, cam, lights) {
|
|
|
3678
3657
|
return 0.2126 * m[0] + 0.7152 * m[1] + 0.0722 * m[2];
|
|
3679
3658
|
}
|
|
3680
3659
|
var LightSequence = class extends Sequence {
|
|
3681
|
-
color = new
|
|
3660
|
+
color = new pixi_js.Color();
|
|
3682
3661
|
async build() {
|
|
3683
3662
|
const w = this.parent?.width ?? this.root.width;
|
|
3684
3663
|
const h = this.parent?.height ?? this.root.height;
|
|
3685
3664
|
if (this.duration === void 0) this.duration = this.parent?.duration ?? this.root.duration;
|
|
3686
|
-
const c = new
|
|
3665
|
+
const c = new pixi_js.Container();
|
|
3687
3666
|
c.x = w * 0.3;
|
|
3688
3667
|
c.y = h * 0.2;
|
|
3689
3668
|
c.z = homeDistance(h, 40) * 0.6;
|
|
@@ -3740,7 +3719,7 @@ var defaultWarn = (m) => console.warn(m);
|
|
|
3740
3719
|
var SPAN_STYLE_KEYS = ["fill", "fontWeight", "fontStyle", "fontVariant", "letterSpacing", "dropShadow"];
|
|
3741
3720
|
var LINE_KEYS = ["fontSize", "fontFamily", "lineHeight", "wordWrap", "wordWrapWidth", "align", "leading", "textBaseline", "whiteSpace", "stroke", "padding"];
|
|
3742
3721
|
var spansMeta = /* @__PURE__ */ new WeakMap();
|
|
3743
|
-
var widthOf = (text, style) =>
|
|
3722
|
+
var widthOf = (text, style) => pixi_js.CanvasTextMetrics.measureText(text, style).width;
|
|
3744
3723
|
function normalize(spans, who, warn) {
|
|
3745
3724
|
if (!Array.isArray(spans) || spans.length === 0) {
|
|
3746
3725
|
warn(`pixi-effects: ${who}: spans is empty: write an array of strings and { text, fill \u2026 } objects (nothing is drawn)`);
|
|
@@ -3775,15 +3754,15 @@ function normalize(spans, who, warn) {
|
|
|
3775
3754
|
}
|
|
3776
3755
|
function layoutSpans(spans, style, align2, who, warn = defaultWarn) {
|
|
3777
3756
|
const clean = normalize(spans, who, warn);
|
|
3778
|
-
const base = new
|
|
3779
|
-
const m =
|
|
3757
|
+
const base = new pixi_js.TextStyle(style);
|
|
3758
|
+
const m = pixi_js.CanvasTextMetrics.measureText("M", base);
|
|
3780
3759
|
const lineHeight = m.lineHeight ?? m.height;
|
|
3781
3760
|
const sentinel = (ts) => widthOf("|", ts);
|
|
3782
3761
|
const measure = (text, ts) => widthOf(text + "|", ts) - sentinel(ts);
|
|
3783
3762
|
const pieces = [];
|
|
3784
3763
|
let line = 0, chars = 0, x = 0;
|
|
3785
3764
|
clean.forEach((sp, spanIdx) => {
|
|
3786
|
-
const ts = Object.keys(sp.overrides).length ? new
|
|
3765
|
+
const ts = Object.keys(sp.overrides).length ? new pixi_js.TextStyle({ ...style, ...sp.overrides }) : base;
|
|
3787
3766
|
sp.text.split("\n").forEach((part, k) => {
|
|
3788
3767
|
if (k > 0) {
|
|
3789
3768
|
line++;
|
|
@@ -3887,13 +3866,13 @@ function expandSpans(spec, warn = defaultWarn, scope) {
|
|
|
3887
3866
|
var ORIGINAL_SCALE_MODE = /* @__PURE__ */ new WeakMap();
|
|
3888
3867
|
var ImageSequence = class extends Sequence {
|
|
3889
3868
|
async build() {
|
|
3890
|
-
const texture = await
|
|
3869
|
+
const texture = await pixi_js.Assets.get(this.spec.asset);
|
|
3891
3870
|
const source = texture.source;
|
|
3892
3871
|
if (source && !ORIGINAL_SCALE_MODE.has(source)) ORIGINAL_SCALE_MODE.set(source, source.scaleMode);
|
|
3893
3872
|
const mode = this.spec.scaleMode;
|
|
3894
3873
|
if (mode !== void 0 && mode !== "nearest" && mode !== "linear") console.warn(`pixi-effects: ${chunkNGJXVJB7_cjs.describeLayer(this.spec)}: scaleMode "${String(mode)}" is not "nearest" or "linear": ignored`);
|
|
3895
3874
|
if (source) source.scaleMode = mode === "nearest" || mode === "linear" ? mode : ORIGINAL_SCALE_MODE.get(source);
|
|
3896
|
-
const sprite = new
|
|
3875
|
+
const sprite = new pixi_js.Sprite({ texture, label: this.spec.name });
|
|
3897
3876
|
sprite.cullable = true;
|
|
3898
3877
|
this.target = sprite;
|
|
3899
3878
|
this.intrinsicWidth = texture.width;
|
|
@@ -3989,7 +3968,7 @@ var AudioSequence = class extends Sequence {
|
|
|
3989
3968
|
if (this.spec.sfx !== void 0) return this._buildSfx(this.spec);
|
|
3990
3969
|
const spec = this.spec;
|
|
3991
3970
|
this._source = `asset "${spec.asset}"`;
|
|
3992
|
-
const data = await
|
|
3971
|
+
const data = await pixi_js.Assets.get(spec.asset);
|
|
3993
3972
|
this._audioBuffer = data.audioBuffer;
|
|
3994
3973
|
this._remap = remapOf(spec, "time", data.duration ?? null);
|
|
3995
3974
|
const constant = this._remap && this._remap.timeKfs.length === 0 ? Math.abs(this._remap.speed ?? 1) : 1;
|
|
@@ -4526,7 +4505,7 @@ var VideoSequence = class extends Sequence {
|
|
|
4526
4505
|
/** Movie asks this layer to draw the frame its own timeline is at, not the one for a time it computed. */
|
|
4527
4506
|
selfTimed = true;
|
|
4528
4507
|
async build() {
|
|
4529
|
-
const data = await
|
|
4508
|
+
const data = await pixi_js.Assets.get(this.spec.asset);
|
|
4530
4509
|
this._sourceDuration = data.duration;
|
|
4531
4510
|
this._remap = remapOf(this.spec, "currentTime", this._sourceDuration);
|
|
4532
4511
|
this._audioBuffer = this.spec.audio !== false ? data.audioBuffer : null;
|
|
@@ -4540,8 +4519,8 @@ var VideoSequence = class extends Sequence {
|
|
|
4540
4519
|
this._canvas = canvas;
|
|
4541
4520
|
this._ctx = canvas.getContext("2d", { alpha: true });
|
|
4542
4521
|
if (probeFrame && this._ctx) this._ctx.drawImage(probeFrame, 0, 0);
|
|
4543
|
-
const texture =
|
|
4544
|
-
const sprite = new
|
|
4522
|
+
const texture = pixi_js.Texture.from(canvas);
|
|
4523
|
+
const sprite = new pixi_js.Sprite({ texture, label: this.spec.name });
|
|
4545
4524
|
sprite.cullable = true;
|
|
4546
4525
|
this.target = sprite;
|
|
4547
4526
|
this.intrinsicWidth = w;
|
|
@@ -4648,15 +4627,15 @@ function makeGradientFill(g) {
|
|
|
4648
4627
|
const ctx = canvas.getContext("2d");
|
|
4649
4628
|
if (ctx) {
|
|
4650
4629
|
paintRadial(ctx, RADIAL_SIZE, g);
|
|
4651
|
-
return { texture:
|
|
4630
|
+
return { texture: pixi_js.Texture.from(canvas), textureSpace: "local" };
|
|
4652
4631
|
}
|
|
4653
4632
|
}
|
|
4654
|
-
return new
|
|
4633
|
+
return new pixi_js.FillGradient(gradientOptions(g));
|
|
4655
4634
|
}
|
|
4656
4635
|
var CURVE_STEPS = 24;
|
|
4657
4636
|
var ELLIPSE_STEPS = 128;
|
|
4658
4637
|
function flattenSvgPath(d) {
|
|
4659
|
-
const prims = new
|
|
4638
|
+
const prims = new pixi_js.GraphicsPath(d).shapePath.shapePrimitives;
|
|
4660
4639
|
const out = [];
|
|
4661
4640
|
for (const { shape } of prims) {
|
|
4662
4641
|
const poly = shape;
|
|
@@ -4900,7 +4879,7 @@ var ShapeSequence = class extends Sequence {
|
|
|
4900
4879
|
};
|
|
4901
4880
|
_liveKeys = new Set(STYLE_KEYS);
|
|
4902
4881
|
async build() {
|
|
4903
|
-
const graphics = new
|
|
4882
|
+
const graphics = new pixi_js.Graphics({ label: this.spec.name });
|
|
4904
4883
|
graphics.cullable = true;
|
|
4905
4884
|
this.target = graphics;
|
|
4906
4885
|
if (this.duration === void 0) {
|
|
@@ -5014,13 +4993,13 @@ var ShapeSequence = class extends Sequence {
|
|
|
5014
4993
|
applyFill(g, s);
|
|
5015
4994
|
for (const hole of holes) {
|
|
5016
4995
|
g.beginPath();
|
|
5017
|
-
g.path(new
|
|
4996
|
+
g.path(new pixi_js.GraphicsPath(hole));
|
|
5018
4997
|
g.cut();
|
|
5019
4998
|
}
|
|
5020
4999
|
if (s.strokeColor !== void 0 && s.strokeWidth > 0) {
|
|
5021
5000
|
g.beginPath();
|
|
5022
|
-
g.path(new
|
|
5023
|
-
for (const hole of holes) g.path(new
|
|
5001
|
+
g.path(new pixi_js.GraphicsPath(main));
|
|
5002
|
+
for (const hole of holes) g.path(new pixi_js.GraphicsPath(hole));
|
|
5024
5003
|
applyStroke(g, s);
|
|
5025
5004
|
}
|
|
5026
5005
|
}
|
|
@@ -5264,7 +5243,7 @@ function makePolygonDraw(spec, scope) {
|
|
|
5264
5243
|
function makePathDraw(spec) {
|
|
5265
5244
|
const d = spec.fillRule === "evenodd" ? splitEvenOdd(spec.d).main : spec.d;
|
|
5266
5245
|
return (g) => {
|
|
5267
|
-
g.path(new
|
|
5246
|
+
g.path(new pixi_js.GraphicsPath(d));
|
|
5268
5247
|
};
|
|
5269
5248
|
}
|
|
5270
5249
|
var STATE_DRAWERS = {
|
|
@@ -5628,7 +5607,7 @@ var ShaderSequence = class extends Sequence {
|
|
|
5628
5607
|
this.c2d = document.createElement("canvas");
|
|
5629
5608
|
this.c2d.width = this.w;
|
|
5630
5609
|
this.c2d.height = this.h;
|
|
5631
|
-
const sprite = new
|
|
5610
|
+
const sprite = new pixi_js.Sprite({ texture: pixi_js.Texture.from(this.c2d), label: spec.name });
|
|
5632
5611
|
sprite.width = width;
|
|
5633
5612
|
sprite.height = height;
|
|
5634
5613
|
this.target = sprite;
|
|
@@ -5891,7 +5870,7 @@ var CanvasSequence = class extends Sequence {
|
|
|
5891
5870
|
this.canvas = document.createElement("canvas");
|
|
5892
5871
|
this.canvas.width = this.w;
|
|
5893
5872
|
this.canvas.height = this.h;
|
|
5894
|
-
const sprite = new
|
|
5873
|
+
const sprite = new pixi_js.Sprite({ texture: pixi_js.Texture.from(this.canvas), label: spec.name });
|
|
5895
5874
|
if (!this.smoothing) sprite.texture.source.scaleMode = "nearest";
|
|
5896
5875
|
sprite.width = this.layerW;
|
|
5897
5876
|
sprite.height = this.layerH;
|
|
@@ -6093,13 +6072,13 @@ var CanvasSequence = class extends Sequence {
|
|
|
6093
6072
|
var _CompositionSequence = null;
|
|
6094
6073
|
async function getCompositionSequence() {
|
|
6095
6074
|
if (!_CompositionSequence) {
|
|
6096
|
-
_CompositionSequence = (await import('./Composition-
|
|
6075
|
+
_CompositionSequence = (await import('./Composition-TJ5D7Z63.cjs')).CompositionSequence;
|
|
6097
6076
|
}
|
|
6098
6077
|
return _CompositionSequence;
|
|
6099
6078
|
}
|
|
6100
6079
|
var _SpansSequence = null;
|
|
6101
6080
|
async function getSpansSequence() {
|
|
6102
|
-
if (!_SpansSequence) _SpansSequence = (await import('./Spans-
|
|
6081
|
+
if (!_SpansSequence) _SpansSequence = (await import('./Spans-5ENZ3XGS.cjs')).SpansSequence;
|
|
6103
6082
|
return _SpansSequence;
|
|
6104
6083
|
}
|
|
6105
6084
|
var staticTypes = {
|
|
@@ -6199,5 +6178,5 @@ exports.spansMeta = spansMeta;
|
|
|
6199
6178
|
exports.springDuration = springDuration;
|
|
6200
6179
|
exports.timeRemapOf = timeRemapOf;
|
|
6201
6180
|
exports.trimPolylines = trimPolylines;
|
|
6202
|
-
//# sourceMappingURL=chunk-
|
|
6203
|
-
//# sourceMappingURL=chunk-
|
|
6181
|
+
//# sourceMappingURL=chunk-Z3DM4ETD.cjs.map
|
|
6182
|
+
//# sourceMappingURL=chunk-Z3DM4ETD.cjs.map
|