pixi-effects 0.48.1 → 0.49.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/CHANGELOG.md +15 -0
- package/README.md +51 -7
- package/ai/chat-template.html +8 -4
- package/ai/tools/check.mjs +6 -6
- package/dist/3d.cjs +963 -0
- package/dist/3d.cjs.map +1 -0
- package/dist/3d.d.cts +303 -0
- package/dist/3d.d.ts +303 -0
- package/dist/3d.js +956 -0
- package/dist/3d.js.map +1 -0
- package/dist/Canvas-BfZkAFJm.d.cts +12 -0
- package/dist/Canvas-BfZkAFJm.d.ts +12 -0
- package/dist/Composition-464AWDV6.cjs +16 -0
- package/dist/{Composition-ZZEOEETS.cjs.map → Composition-464AWDV6.cjs.map} +1 -1
- package/dist/Composition-5U63LMPX.js +7 -0
- package/dist/{Composition-BOLWGT2R.js.map → Composition-5U63LMPX.js.map} +1 -1
- package/dist/Controller.d.cts +2 -2
- package/dist/Controller.d.ts +2 -2
- package/dist/{Movie--qSYKgAQ.d.ts → Movie-6EWOz6Yw.d.ts} +21 -5
- package/dist/{Movie-svZQF-9Z.d.cts → Movie-BxB7bauG.d.cts} +21 -5
- package/dist/{Spans-MWYFG7RI.cjs → Spans-DUR2W5EH.cjs} +11 -11
- package/dist/{Spans-MWYFG7RI.cjs.map → Spans-DUR2W5EH.cjs.map} +1 -1
- package/dist/{Spans-PGXRMD6J.js → Spans-W5VJRMGC.js} +6 -6
- package/dist/{Spans-PGXRMD6J.js.map → Spans-W5VJRMGC.js.map} +1 -1
- package/dist/{blendModes-V5XHC7U4.cjs → blendModes-NC76DNVX.cjs} +5 -5
- package/dist/{blendModes-V5XHC7U4.cjs.map → blendModes-NC76DNVX.cjs.map} +1 -1
- package/dist/{blendModes-535EMYGK.js → blendModes-ZOBLPSR3.js} +4 -4
- package/dist/{blendModes-535EMYGK.js.map → blendModes-ZOBLPSR3.js.map} +1 -1
- package/dist/{chunk-V3VBHSK6.cjs → chunk-33USHRV5.cjs} +94 -104
- package/dist/chunk-33USHRV5.cjs.map +1 -0
- package/dist/{chunk-WYR2AU4W.cjs → chunk-5YNME6AH.cjs} +5 -5
- package/dist/{chunk-WYR2AU4W.cjs.map → chunk-5YNME6AH.cjs.map} +1 -1
- package/dist/{chunk-NGJXVJB7.cjs → chunk-ABWRISRK.cjs} +3 -2
- package/dist/chunk-ABWRISRK.cjs.map +1 -0
- package/dist/{chunk-M2LFQY2E.cjs → chunk-BSFWVTSR.cjs} +93 -93
- package/dist/chunk-BSFWVTSR.cjs.map +1 -0
- package/dist/{chunk-L3MEZZAV.js → chunk-DOGY3EAW.js} +25 -17
- package/dist/chunk-DOGY3EAW.js.map +1 -0
- package/dist/{chunk-L3XC464G.cjs → chunk-GUDLIAIG.cjs} +89 -66
- package/dist/chunk-GUDLIAIG.cjs.map +1 -0
- package/dist/{chunk-BFRWSV3R.js → chunk-H363KMJR.js} +3 -3
- package/dist/chunk-H363KMJR.js.map +1 -0
- package/dist/{chunk-JBDBICS2.js → chunk-MXACRKAN.js} +4 -4
- package/dist/{chunk-JBDBICS2.js.map → chunk-MXACRKAN.js.map} +1 -1
- package/dist/{chunk-IY5YTIK3.js → chunk-PBMDZT2T.js} +47 -24
- package/dist/chunk-PBMDZT2T.js.map +1 -0
- package/dist/{chunk-AJWUCFGM.js → chunk-USUUAYTE.js} +6 -6
- package/dist/chunk-USUUAYTE.js.map +1 -0
- package/dist/index.cjs +35 -35
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +5 -5
- package/dist/loader.css +1 -1
- package/dist/{music-P4JRT73P.js → music-ATX22VAT.js} +3 -3
- package/dist/{music-P4JRT73P.js.map → music-ATX22VAT.js.map} +1 -1
- package/dist/{music-XQEPBIDT.cjs → music-OFVM3PYH.cjs} +3 -3
- package/dist/{music-XQEPBIDT.cjs.map → music-OFVM3PYH.cjs.map} +1 -1
- package/dist/present.cjs +5 -5
- package/dist/present.d.cts +2 -2
- package/dist/present.d.ts +2 -2
- package/dist/present.js +5 -5
- package/dist/three.cjs +7 -8
- package/dist/three.cjs.map +1 -1
- package/dist/three.d.cts +2 -12
- package/dist/three.d.ts +2 -12
- package/dist/three.js +2 -3
- package/dist/three.js.map +1 -1
- package/dist/{types-CTSrPvY3.d.cts → types-kt7DQKfO.d.cts} +1 -1
- package/dist/{types-CTSrPvY3.d.ts → types-kt7DQKfO.d.ts} +1 -1
- package/docs/api.md +41 -1
- package/docs/dsl.md +81 -1
- package/llms-full.txt +218 -5
- package/package.json +19 -3
- package/skills/pixi-effects/SKILL.md +3 -2
- package/skills/pixi-effects/reference/cheatsheet.md +2 -0
- package/skills/pixi-effects/reference/pitfalls.md +14 -0
- package/skills/pixi-effects/reference/recipes.md +77 -1
- package/skills/pixi-effects/template.html +13 -8
- package/dist/Composition-BOLWGT2R.js +0 -7
- package/dist/Composition-ZZEOEETS.cjs +0 -16
- package/dist/chunk-AJWUCFGM.js.map +0 -1
- package/dist/chunk-BFRWSV3R.js.map +0 -1
- 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-M2LFQY2E.cjs.map +0 -1
- package/dist/chunk-NGJXVJB7.cjs.map +0 -1
- package/dist/chunk-V3VBHSK6.cjs.map +0 -1
|
@@ -1,28 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkABWRISRK_cjs = require('./chunk-ABWRISRK.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
|
|
@@ -2997,7 +2976,7 @@ var TextSequence = class extends Sequence {
|
|
|
2997
2976
|
if (this.spec.resolution !== void 0) {
|
|
2998
2977
|
const r = this.spec.resolution;
|
|
2999
2978
|
if (typeof r === "number" && r >= 1 && r <= 8) text.resolution = r;
|
|
3000
|
-
else console.warn(`pixi-effects: ${
|
|
2979
|
+
else console.warn(`pixi-effects: ${chunkABWRISRK_cjs.describeLayer(this.spec)}: resolution must be a number from 1 to 8 (the text is drawn at that many times the pixels), got ${JSON.stringify(r)}: ignored`);
|
|
3001
2980
|
}
|
|
3002
2981
|
this.target = text;
|
|
3003
2982
|
this.intrinsicWidth = text.width;
|
|
@@ -3013,7 +2992,7 @@ var TextSequence = class extends Sequence {
|
|
|
3013
2992
|
{ skipKeys: STYLE_OPAQUE_KEYS }
|
|
3014
2993
|
);
|
|
3015
2994
|
const unset = Object.keys(resolved).filter((k) => resolved[k] === void 0);
|
|
3016
|
-
if (unset.length) console.warn(`pixi-effects: ${
|
|
2995
|
+
if (unset.length) console.warn(`pixi-effects: ${chunkABWRISRK_cjs.describeLayer(this.spec)}: ${unset.map((k) => `style.${k}`).join(", ")} ${unset.length > 1 ? "are" : "is"} undefined (a variable that was never set?), so ${unset.length > 1 ? "they are" : "it is"} ignored and the default is used: omit the key instead`);
|
|
3017
2996
|
const outline = resolved.stroke;
|
|
3018
2997
|
if (outline && typeof outline === "object" && !("join" in outline) && !("lineJoin" in outline)) resolved.stroke = { ...outline, join: "round" };
|
|
3019
2998
|
for (const k of Object.keys(resolved)) {
|
|
@@ -3025,7 +3004,7 @@ var TextSequence = class extends Sequence {
|
|
|
3025
3004
|
}
|
|
3026
3005
|
const startFill = initialProps.fill;
|
|
3027
3006
|
if (typeof startFill === "string" || typeof startFill === "number") text.style.fill = startFill;
|
|
3028
|
-
validateGradientKeyframes(this.spec,
|
|
3007
|
+
validateGradientKeyframes(this.spec, chunkABWRISRK_cjs.describeLayer(this.spec), void 0, "text");
|
|
3029
3008
|
const gradientSpec = this.spec.fillGradient ?? initialProps.fillGradient;
|
|
3030
3009
|
if (gradientSpec) {
|
|
3031
3010
|
this._grad = { grad: gradStateFrom(gradientSpec) };
|
|
@@ -3061,7 +3040,7 @@ var TextSequence = class extends Sequence {
|
|
|
3061
3040
|
bindTextKeyframes(timeline, keyframes, this.duration, origin, () => this._template, (t) => {
|
|
3062
3041
|
this._template = t;
|
|
3063
3042
|
refresh();
|
|
3064
|
-
},
|
|
3043
|
+
}, chunkABWRISRK_cjs.describeLayer(this.spec));
|
|
3065
3044
|
}
|
|
3066
3045
|
};
|
|
3067
3046
|
function runSuperWithStrippedSpec(inst, strippedSpec, timeline, offset) {
|
|
@@ -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;
|
|
@@ -3511,7 +3490,7 @@ var CameraSequence = class extends Sequence {
|
|
|
3511
3490
|
carrier.fogColor = "#000000";
|
|
3512
3491
|
carrier.fogAmount = 1;
|
|
3513
3492
|
this.target = carrier;
|
|
3514
|
-
const keys =
|
|
3493
|
+
const keys = chunkABWRISRK_cjs.collectPropKeys(this.spec);
|
|
3515
3494
|
this.autoZ = !keys.has("z");
|
|
3516
3495
|
this.dof = keys.has("focus") || keys.has("aperture");
|
|
3517
3496
|
this.fog = keys.has("fogNear") || keys.has("fogFar") || keys.has("fogColor") || keys.has("fogAmount");
|
|
@@ -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++;
|
|
@@ -3832,7 +3811,7 @@ function resolveSpansStyle(style, scope, who, warn = defaultWarn) {
|
|
|
3832
3811
|
var TEXT_ONLY = ["type", "spans", "text", "style", "format", "colorSpace", "fillGradient", "initial", "keyframes", "resolution"];
|
|
3833
3812
|
var NOT_FOR_A_GROUP = ["fill", "text", "value", "fillGradient"];
|
|
3834
3813
|
function expandSpans(spec, warn = defaultWarn, scope) {
|
|
3835
|
-
const who =
|
|
3814
|
+
const who = chunkABWRISRK_cjs.describeLayer(spec);
|
|
3836
3815
|
const s = spec;
|
|
3837
3816
|
if (s.text !== void 0) warn(`pixi-effects: ${who}: "text" is ignored when the layer has spans: write the text as spans`);
|
|
3838
3817
|
const style = resolveSpansStyle(s.style ?? {}, scope, who, warn);
|
|
@@ -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
|
-
if (mode !== void 0 && mode !== "nearest" && mode !== "linear") console.warn(`pixi-effects: ${
|
|
3873
|
+
if (mode !== void 0 && mode !== "nearest" && mode !== "linear") console.warn(`pixi-effects: ${chunkABWRISRK_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;
|
|
@@ -4000,12 +3979,12 @@ var AudioSequence = class extends Sequence {
|
|
|
4000
3979
|
const playable = this._remap && this._remap.timeKfs.length > 0 ? Infinity : (data.duration ?? Infinity) / constant;
|
|
4001
3980
|
if (!spec.loop && Number.isFinite(playable) && this.duration > playable + 0.05) {
|
|
4002
3981
|
console.warn(
|
|
4003
|
-
`pixi-effects: ${
|
|
3982
|
+
`pixi-effects: ${chunkABWRISRK_cjs.describeLayer(spec)}: audio asset "${spec.asset}" plays for ${playable.toFixed(1)}s (${data.duration.toFixed(1)}s at speed ${constant}) but the layer lasts ${this.duration.toFixed(1)}s, so it goes silent after ${playable.toFixed(1)}s. Add loop: true, or shorten the layer's duration.`
|
|
4004
3983
|
);
|
|
4005
3984
|
}
|
|
4006
3985
|
}
|
|
4007
3986
|
async _buildSfx(spec) {
|
|
4008
|
-
const who =
|
|
3987
|
+
const who = chunkABWRISRK_cjs.describeLayer(spec);
|
|
4009
3988
|
const raw = spec;
|
|
4010
3989
|
if (raw.asset !== void 0) console.warn(`pixi-effects: ${who}: has both asset and sfx \u2014 the sfx plays; remove one`);
|
|
4011
3990
|
if (raw.loop) console.warn(`pixi-effects: ${who}: loop has no effect on an sfx \u2014 to repeat it, add one audio layer per hit (a JS loop)`);
|
|
@@ -4024,11 +4003,11 @@ var AudioSequence = class extends Sequence {
|
|
|
4024
4003
|
});
|
|
4025
4004
|
}
|
|
4026
4005
|
async _buildMusic(spec) {
|
|
4027
|
-
const who =
|
|
4006
|
+
const who = chunkABWRISRK_cjs.describeLayer(spec);
|
|
4028
4007
|
const raw = spec;
|
|
4029
4008
|
if (raw.asset !== void 0) console.warn(`pixi-effects: ${who}: has both asset and music \u2014 the music plays; remove one`);
|
|
4030
4009
|
if (raw.sfx !== void 0) console.warn(`pixi-effects: ${who}: has both sfx and music \u2014 the music plays; remove one`);
|
|
4031
|
-
const { resolveMusic, renderMusic, renderMusicAsync, musicLength, musicKey, summarizeMusic } = await import('./music-
|
|
4010
|
+
const { resolveMusic, renderMusic, renderMusicAsync, musicLength, musicKey, summarizeMusic } = await import('./music-OFVM3PYH.cjs');
|
|
4032
4011
|
const music = resolveMusic(spec.music, who);
|
|
4033
4012
|
if (!music) return;
|
|
4034
4013
|
const natural = musicLength(music);
|
|
@@ -4059,7 +4038,7 @@ var AudioSequence = class extends Sequence {
|
|
|
4059
4038
|
out.push({
|
|
4060
4039
|
...sourceMap ? { sourceMap } : {},
|
|
4061
4040
|
...this._audioBuffer ? { buffer: this._audioBuffer } : { synth: this._synth },
|
|
4062
|
-
layer:
|
|
4041
|
+
layer: chunkABWRISRK_cjs.describeLayer(this.spec),
|
|
4063
4042
|
source: this._source,
|
|
4064
4043
|
...this._music ? { music: this._music } : {},
|
|
4065
4044
|
loop: !this._synth && !!this.spec.loop,
|
|
@@ -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;
|
|
@@ -4601,7 +4580,7 @@ var VideoSequence = class extends Sequence {
|
|
|
4601
4580
|
out.push({
|
|
4602
4581
|
...sourceMap ? { sourceMap } : {},
|
|
4603
4582
|
buffer: this._audioBuffer,
|
|
4604
|
-
layer:
|
|
4583
|
+
layer: chunkABWRISRK_cjs.describeLayer(this.spec),
|
|
4605
4584
|
source: `video "${this.spec.asset}"`,
|
|
4606
4585
|
loop: !!this.spec.loop,
|
|
4607
4586
|
start: baseTime + this.at,
|
|
@@ -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) {
|
|
@@ -4911,20 +4890,20 @@ var ShapeSequence = class extends Sequence {
|
|
|
4911
4890
|
for (const k of geomKeys) this._liveKeys.add(k);
|
|
4912
4891
|
seedGeometry(this._state, this.spec, scope);
|
|
4913
4892
|
seedStyle(this._state, this.spec.initial ?? {}, scope);
|
|
4914
|
-
seedStrokeStyle(this._state, this.spec, this.spec.initial ?? {},
|
|
4893
|
+
seedStrokeStyle(this._state, this.spec, this.spec.initial ?? {}, chunkABWRISRK_cjs.describeLayer(this.spec));
|
|
4915
4894
|
if (this.spec.shape === "arc") {
|
|
4916
4895
|
this._state.startAngle ??= 0;
|
|
4917
4896
|
this._state.endAngle ??= 360;
|
|
4918
4897
|
const top = this.spec, ini = this.spec.initial ?? {};
|
|
4919
4898
|
if ("trimStart" in top || "trimEnd" in top || "trimStart" in ini || "trimEnd" in ini) {
|
|
4920
|
-
console.warn(`pixi-effects: ${
|
|
4899
|
+
console.warn(`pixi-effects: ${chunkABWRISRK_cjs.describeLayer(this.spec)}: trimStart / trimEnd do not apply to an arc: animate its endAngle (and startAngle) instead`);
|
|
4921
4900
|
}
|
|
4922
4901
|
} else {
|
|
4923
4902
|
this._state.trimStart ??= 0;
|
|
4924
4903
|
this._state.trimEnd ??= 1;
|
|
4925
4904
|
}
|
|
4926
4905
|
const gradientSpec = this.spec.fillGradient ?? this.spec.initial?.fillGradient;
|
|
4927
|
-
validateGradientKeyframes(this.spec,
|
|
4906
|
+
validateGradientKeyframes(this.spec, chunkABWRISRK_cjs.describeLayer(this.spec));
|
|
4928
4907
|
if (gradientSpec) {
|
|
4929
4908
|
if (hasGradientKeys(this.spec.keyframes)) {
|
|
4930
4909
|
this._grad = { grad: gradStateFrom(gradientSpec) };
|
|
@@ -4968,9 +4947,9 @@ var ShapeSequence = class extends Sequence {
|
|
|
4968
4947
|
}
|
|
4969
4948
|
/** The prepared morph between `d` and `morphTo`, or null (and a warning when the spec asked for one that cannot work). */
|
|
4970
4949
|
_setupMorph() {
|
|
4971
|
-
const who =
|
|
4950
|
+
const who = chunkABWRISRK_cjs.describeLayer(this.spec);
|
|
4972
4951
|
const top = this.spec;
|
|
4973
|
-
const wanted = this.spec.shape === "path" && (this._state.morph !== void 0 ||
|
|
4952
|
+
const wanted = this.spec.shape === "path" && (this._state.morph !== void 0 || chunkABWRISRK_cjs.collectPropKeys(this.spec).has("morph"));
|
|
4974
4953
|
if (this.spec.shape !== "path") {
|
|
4975
4954
|
if ("morphTo" in top) console.warn(`pixi-effects: ${who}: morphTo only works on a path shape (shape: 'path'); ignored`);
|
|
4976
4955
|
return null;
|
|
@@ -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 = {
|
|
@@ -5606,7 +5585,7 @@ var ShaderSequence = class extends Sequence {
|
|
|
5606
5585
|
}
|
|
5607
5586
|
async build() {
|
|
5608
5587
|
const spec = this.shaderSpec;
|
|
5609
|
-
const who =
|
|
5588
|
+
const who = chunkABWRISRK_cjs.describeLayer(spec);
|
|
5610
5589
|
for (const m of shaderProblems(spec)) console.warn(`pixi-effects: ${who}: ${m}`);
|
|
5611
5590
|
if (this.duration === void 0) this.duration = this.parent?.duration ?? this.root.duration;
|
|
5612
5591
|
const scope = buildScope(this, this.parent, this.root);
|
|
@@ -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;
|
|
@@ -5650,7 +5629,7 @@ var ShaderSequence = class extends Sequence {
|
|
|
5650
5629
|
const warn = (why) => {
|
|
5651
5630
|
if (this.warnedPaths.has(path)) return;
|
|
5652
5631
|
this.warnedPaths.add(path);
|
|
5653
|
-
console.warn(`pixi-effects: ${
|
|
5632
|
+
console.warn(`pixi-effects: ${chunkABWRISRK_cjs.describeLayer(this.spec)}: keyframe path uniforms.${path} ${why}; skipped`);
|
|
5654
5633
|
};
|
|
5655
5634
|
if (slot === void 0) {
|
|
5656
5635
|
const guess = chunkDOLTCXCL_cjs.suggestName(name, Object.keys(this.carrier));
|
|
@@ -5685,7 +5664,7 @@ var ShaderSequence = class extends Sequence {
|
|
|
5685
5664
|
this.failed = true;
|
|
5686
5665
|
if (!this.warnedNoGl) {
|
|
5687
5666
|
this.warnedNoGl = true;
|
|
5688
|
-
console.warn(`pixi-effects: ${
|
|
5667
|
+
console.warn(`pixi-effects: ${chunkABWRISRK_cjs.describeLayer(this.spec)}: this browser has no WebGL2, so the shader cannot run; the layer is drawn as a checkerboard`);
|
|
5689
5668
|
}
|
|
5690
5669
|
}
|
|
5691
5670
|
compile() {
|
|
@@ -5716,7 +5695,7 @@ var ShaderSequence = class extends Sequence {
|
|
|
5716
5695
|
gl.deleteProgram(p);
|
|
5717
5696
|
this.failed = true;
|
|
5718
5697
|
this.prog = null;
|
|
5719
|
-
console.warn(`pixi-effects: ${
|
|
5698
|
+
console.warn(`pixi-effects: ${chunkABWRISRK_cjs.describeLayer(this.spec)}: the fragment shader did not compile (the line numbers are the lines of your code):
|
|
5720
5699
|
${glslErrors(log).join("\n")}
|
|
5721
5700
|
The layer is drawn as a checkerboard until it is fixed.`);
|
|
5722
5701
|
return;
|
|
@@ -5795,10 +5774,14 @@ function resolveDim(v, scope) {
|
|
|
5795
5774
|
if (typeof v === "number") return v;
|
|
5796
5775
|
return evaluateExpr(v, scope);
|
|
5797
5776
|
}
|
|
5777
|
+
|
|
5778
|
+
// src/core/purity.ts
|
|
5779
|
+
var NOT_PURE = /\bMath\s*\.\s*random\s*\(|\bDate\s*\.\s*now\s*\(|\bperformance\s*\.\s*now\s*\(|\bnew\s+Date\s*\(/;
|
|
5780
|
+
|
|
5781
|
+
// src/sequences/Canvas.ts
|
|
5798
5782
|
var MAX_SIZE = 8192;
|
|
5799
5783
|
var MIN_RESOLUTION = 0.25;
|
|
5800
5784
|
var MAX_RESOLUTION = 4;
|
|
5801
|
-
var NOT_PURE = /\bMath\s*\.\s*random\s*\(|\bDate\s*\.\s*now\s*\(|\bperformance\s*\.\s*now\s*\(|\bnew\s+Date\s*\(/;
|
|
5802
5785
|
function seeded(seed) {
|
|
5803
5786
|
let a = seed >>> 0;
|
|
5804
5787
|
return () => {
|
|
@@ -5843,7 +5826,7 @@ var CanvasSequence = class extends Sequence {
|
|
|
5843
5826
|
}
|
|
5844
5827
|
async build() {
|
|
5845
5828
|
const spec = this.canvasSpec;
|
|
5846
|
-
const who =
|
|
5829
|
+
const who = chunkABWRISRK_cjs.describeLayer(spec);
|
|
5847
5830
|
if (this.duration === void 0) this.duration = this.parent?.duration ?? this.root.duration;
|
|
5848
5831
|
const scope = buildScope(this, this.parent, this.root);
|
|
5849
5832
|
this.layerW = this.size("width", spec.width, scope, this.parent?.width ?? this.root.width, who);
|
|
@@ -5891,7 +5874,7 @@ var CanvasSequence = class extends Sequence {
|
|
|
5891
5874
|
this.canvas = document.createElement("canvas");
|
|
5892
5875
|
this.canvas.width = this.w;
|
|
5893
5876
|
this.canvas.height = this.h;
|
|
5894
|
-
const sprite = new
|
|
5877
|
+
const sprite = new pixi_js.Sprite({ texture: pixi_js.Texture.from(this.canvas), label: spec.name });
|
|
5895
5878
|
if (!this.smoothing) sprite.texture.source.scaleMode = "nearest";
|
|
5896
5879
|
sprite.width = this.layerW;
|
|
5897
5880
|
sprite.height = this.layerH;
|
|
@@ -5928,7 +5911,7 @@ var CanvasSequence = class extends Sequence {
|
|
|
5928
5911
|
say(why) {
|
|
5929
5912
|
if (this.warnedDraw) return;
|
|
5930
5913
|
this.warnedDraw = true;
|
|
5931
|
-
console.warn(`pixi-effects: ${
|
|
5914
|
+
console.warn(`pixi-effects: ${chunkABWRISRK_cjs.describeLayer(this.spec)}: ${why}`);
|
|
5932
5915
|
}
|
|
5933
5916
|
info(local) {
|
|
5934
5917
|
const duration = this.duration ?? 0;
|
|
@@ -5955,7 +5938,7 @@ var CanvasSequence = class extends Sequence {
|
|
|
5955
5938
|
if (!this.warnedPaths.has(path)) {
|
|
5956
5939
|
this.warnedPaths.add(path);
|
|
5957
5940
|
const guess = chunkDOLTCXCL_cjs.suggestName(path.split(".")[0], Object.keys(this.carrier));
|
|
5958
|
-
console.warn(`pixi-effects: ${
|
|
5941
|
+
console.warn(`pixi-effects: ${chunkABWRISRK_cjs.describeLayer(this.spec)}: keyframe path params.${path} names no param "${path}"${guess ? `; did you mean "${guess}"?` : ""} (declare it in params with a starting value); skipped`);
|
|
5959
5942
|
}
|
|
5960
5943
|
return null;
|
|
5961
5944
|
}
|
|
@@ -6093,13 +6076,13 @@ var CanvasSequence = class extends Sequence {
|
|
|
6093
6076
|
var _CompositionSequence = null;
|
|
6094
6077
|
async function getCompositionSequence() {
|
|
6095
6078
|
if (!_CompositionSequence) {
|
|
6096
|
-
_CompositionSequence = (await import('./Composition-
|
|
6079
|
+
_CompositionSequence = (await import('./Composition-464AWDV6.cjs')).CompositionSequence;
|
|
6097
6080
|
}
|
|
6098
6081
|
return _CompositionSequence;
|
|
6099
6082
|
}
|
|
6100
6083
|
var _SpansSequence = null;
|
|
6101
6084
|
async function getSpansSequence() {
|
|
6102
|
-
if (!_SpansSequence) _SpansSequence = (await import('./Spans-
|
|
6085
|
+
if (!_SpansSequence) _SpansSequence = (await import('./Spans-DUR2W5EH.cjs')).SpansSequence;
|
|
6103
6086
|
return _SpansSequence;
|
|
6104
6087
|
}
|
|
6105
6088
|
var staticTypes = {
|
|
@@ -6118,6 +6101,10 @@ var registry2 = {};
|
|
|
6118
6101
|
function registerSequenceType(type, ctor) {
|
|
6119
6102
|
registry2[type] = ctor;
|
|
6120
6103
|
}
|
|
6104
|
+
var OPTIONAL_ENTRIES = {
|
|
6105
|
+
scene3d: { from: "pixi-effects/3d", call: "register3D" },
|
|
6106
|
+
three: { from: "pixi-effects/three", call: "registerThree" }
|
|
6107
|
+
};
|
|
6121
6108
|
async function buildSequenceTree(specs, parent, root, out = []) {
|
|
6122
6109
|
for (let spec of specs) {
|
|
6123
6110
|
let Cls = staticTypes[spec.type] ?? registry2[spec.type];
|
|
@@ -6129,7 +6116,9 @@ async function buildSequenceTree(specs, parent, root, out = []) {
|
|
|
6129
6116
|
Cls = await getCompositionSequence();
|
|
6130
6117
|
}
|
|
6131
6118
|
if (!Cls) {
|
|
6132
|
-
|
|
6119
|
+
const type = spec.type;
|
|
6120
|
+
const entry = OPTIONAL_ENTRIES[type];
|
|
6121
|
+
console.warn(`pixi-effects: unknown sequence type "${type}"${entry ? `: import { ${entry.call} } from '${entry.from}' and call ${entry.call}() before movie.init` : ""}`);
|
|
6133
6122
|
await root.onLayerBuilt?.();
|
|
6134
6123
|
continue;
|
|
6135
6124
|
}
|
|
@@ -6158,6 +6147,7 @@ exports.MAX_CASTERS = MAX_CASTERS;
|
|
|
6158
6147
|
exports.MAX_LIGHTS = MAX_LIGHTS;
|
|
6159
6148
|
exports.MIN_BLUR = MIN_BLUR;
|
|
6160
6149
|
exports.NEAR = NEAR;
|
|
6150
|
+
exports.NOT_PURE = NOT_PURE;
|
|
6161
6151
|
exports.NullSequence = NullSequence;
|
|
6162
6152
|
exports.SHADOW_TAPS = SHADOW_TAPS;
|
|
6163
6153
|
exports.Sequence = Sequence;
|
|
@@ -6199,5 +6189,5 @@ exports.spansMeta = spansMeta;
|
|
|
6199
6189
|
exports.springDuration = springDuration;
|
|
6200
6190
|
exports.timeRemapOf = timeRemapOf;
|
|
6201
6191
|
exports.trimPolylines = trimPolylines;
|
|
6202
|
-
//# sourceMappingURL=chunk-
|
|
6203
|
-
//# sourceMappingURL=chunk-
|
|
6192
|
+
//# sourceMappingURL=chunk-33USHRV5.cjs.map
|
|
6193
|
+
//# sourceMappingURL=chunk-33USHRV5.cjs.map
|