pixi-effects 0.21.0 → 0.22.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 +21 -0
- package/README.md +6 -6
- package/ai/SKILL.md +1 -1
- package/ai/chat-template.html +3 -3
- package/ai/reference/cheatsheet.md +2 -2
- package/ai/reference/pitfalls.md +6 -2
- package/ai/reference/recipes.md +30 -0
- package/ai/template.html +5 -5
- package/ai/tools/check.mjs +14 -3
- package/dist/{Base-wYJQ2g5Q.d.cts → Base-BzlPgd-D.d.cts} +1 -1
- package/dist/{Base-CzfLGoDr.d.ts → Base-gu-5X0Cv.d.ts} +1 -1
- package/dist/Composition-BK5SH6J7.cjs +16 -0
- package/dist/{Composition-2UFPSNVN.cjs.map → Composition-BK5SH6J7.cjs.map} +1 -1
- package/dist/Composition-Q5TVG3HM.js +7 -0
- package/dist/{Composition-BVI236ZR.js.map → Composition-Q5TVG3HM.js.map} +1 -1
- package/dist/Controller.cjs +2 -2
- package/dist/Controller.d.cts +2 -2
- package/dist/Controller.d.ts +2 -2
- package/dist/Controller.js +1 -1
- package/dist/{Movie-CgYwa5QG.d.ts → Movie--_TJvdJa.d.ts} +1 -1
- package/dist/{Movie-mtX9AkQ-.d.cts → Movie-DMxOoTdW.d.cts} +1 -1
- package/dist/Presenter.cjs +2 -2
- package/dist/Presenter.d.cts +2 -2
- package/dist/Presenter.d.ts +2 -2
- package/dist/Presenter.js +1 -1
- package/dist/blendModes-5E4G2ZZQ.cjs +94 -0
- package/dist/blendModes-5E4G2ZZQ.cjs.map +1 -0
- package/dist/blendModes-HCP5XTNP.js +90 -0
- package/dist/blendModes-HCP5XTNP.js.map +1 -0
- package/dist/chunk-BPTW7L25.cjs +275 -0
- package/dist/chunk-BPTW7L25.cjs.map +1 -0
- package/dist/{chunk-DDIXIWXK.js → chunk-DC4JPY6A.js} +29 -276
- package/dist/chunk-DC4JPY6A.js.map +1 -0
- package/dist/chunk-E7RONUZ7.js +268 -0
- package/dist/chunk-E7RONUZ7.js.map +1 -0
- package/dist/{chunk-BPW42X7C.cjs → chunk-IFZOI3JQ.cjs} +47 -300
- package/dist/chunk-IFZOI3JQ.cjs.map +1 -0
- package/dist/chunk-K4JVI5HK.cjs +143 -0
- package/dist/chunk-K4JVI5HK.cjs.map +1 -0
- package/dist/{chunk-6JJC37ZD.cjs → chunk-MHOO2CVU.cjs} +124 -74
- package/dist/chunk-MHOO2CVU.cjs.map +1 -0
- package/dist/{chunk-MNM56B3X.js → chunk-NHICCDTC.js} +13 -3
- package/dist/chunk-NHICCDTC.js.map +1 -0
- package/dist/{chunk-NGYGFGDS.js → chunk-UQDEDYVM.js} +82 -32
- package/dist/chunk-UQDEDYVM.js.map +1 -0
- package/dist/{chunk-WTRKDIKH.cjs → chunk-UZTKEYFP.cjs} +13 -3
- package/dist/chunk-UZTKEYFP.cjs.map +1 -0
- package/dist/chunk-YEPDQ7I3.js +132 -0
- package/dist/chunk-YEPDQ7I3.js.map +1 -0
- package/dist/index.cjs +70 -67
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +9 -6
- package/dist/index.js.map +1 -1
- package/dist/loader.css +1 -1
- package/dist/{music-CFEC7HKL.js → music-FUN7N225.js} +3 -3
- package/dist/{music-CFEC7HKL.js.map → music-FUN7N225.js.map} +1 -1
- package/dist/{music-UAN7DXK4.cjs → music-GEAH2XCT.cjs} +7 -7
- package/dist/{music-UAN7DXK4.cjs.map → music-GEAH2XCT.cjs.map} +1 -1
- package/dist/{sfx-EX4PUBMV.cjs → sfx-2DYTYNYW.cjs} +8 -8
- package/dist/{sfx-EX4PUBMV.cjs.map → sfx-2DYTYNYW.cjs.map} +1 -1
- package/dist/{sfx-U3GM2MED.js → sfx-3IDAJ3UZ.js} +3 -3
- package/dist/{sfx-U3GM2MED.js.map → sfx-3IDAJ3UZ.js.map} +1 -1
- package/dist/three.cjs +7 -6
- package/dist/three.cjs.map +1 -1
- package/dist/three.d.cts +2 -2
- package/dist/three.d.ts +2 -2
- package/dist/three.js +3 -2
- package/dist/three.js.map +1 -1
- package/dist/{types-YmUaViL1.d.ts → types-DBbZVKGS.d.cts} +7 -4
- package/dist/{types-YmUaViL1.d.cts → types-DBbZVKGS.d.ts} +7 -4
- package/docs/dsl.md +43 -2
- package/llms-full.txt +82 -7
- package/package.json +1 -1
- package/dist/Composition-2UFPSNVN.cjs +0 -14
- package/dist/Composition-BVI236ZR.js +0 -5
- package/dist/chunk-6JJC37ZD.cjs.map +0 -1
- package/dist/chunk-BPW42X7C.cjs.map +0 -1
- package/dist/chunk-DDIXIWXK.js.map +0 -1
- package/dist/chunk-MNM56B3X.js.map +0 -1
- package/dist/chunk-NGYGFGDS.js.map +0 -1
- package/dist/chunk-WTRKDIKH.cjs.map +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { collectPropKeys, describeLayer } from './chunk-E7RONUZ7.js';
|
|
2
|
+
import { suggestName, warnUnknownOptions } from './chunk-NHICCDTC.js';
|
|
2
3
|
import * as PIXI from 'pixi.js';
|
|
3
4
|
import { Rectangle, Container, GraphicsPath, Graphics, Assets, Texture, Sprite, FillGradient, Text, Filter, GlProgram, defaultFilterVert, GpuProgram, UniformGroup, Color } from 'pixi.js';
|
|
4
5
|
import { gsap } from 'gsap';
|
|
@@ -1408,269 +1409,6 @@ var NullSequence = class extends Sequence {
|
|
|
1408
1409
|
this.buildFilters();
|
|
1409
1410
|
}
|
|
1410
1411
|
};
|
|
1411
|
-
|
|
1412
|
-
// src/space/specKeys.ts
|
|
1413
|
-
function collectPropKeys(spec) {
|
|
1414
|
-
const out = /* @__PURE__ */ new Set();
|
|
1415
|
-
for (const k of Object.keys(spec.initial ?? {})) out.add(k);
|
|
1416
|
-
for (const kf of spec.keyframes ?? []) {
|
|
1417
|
-
for (const bag of [kf.set, kf.to, kf.from]) {
|
|
1418
|
-
for (const k of Object.keys(bag ?? {})) out.add(k);
|
|
1419
|
-
}
|
|
1420
|
-
}
|
|
1421
|
-
return out;
|
|
1422
|
-
}
|
|
1423
|
-
|
|
1424
|
-
// src/core/layerKeys.ts
|
|
1425
|
-
var COMMON = ["type", "name", "parent", "at", "duration", "initial", "keyframes", "filters", "filterArea", "mask", "maskInverted", "blendMode", "threeD", "hideBehindCamera"];
|
|
1426
|
-
var VIDEO = [...COMMON, "asset", "loop", "audio", "volume", "speed"];
|
|
1427
|
-
var IMAGE = [...COMMON, "asset", "colorSpace"];
|
|
1428
|
-
var TEXT = [...COMMON, "text", "format", "style", "colorSpace", "fillGradient"];
|
|
1429
|
-
var AUDIO = [...COMMON, "volume", "asset", "loop", "sfx", "music", "speed"];
|
|
1430
|
-
var COMPOSITION = [...COMMON, "width", "height", "sequences", "transitions", "speed"];
|
|
1431
|
-
var CAMERA = [...COMMON];
|
|
1432
|
-
var NULL = [...COMMON];
|
|
1433
|
-
var SHAPE = [...COMMON, "shape", "fillGradient", "colorSpace", "strokeCap", "strokeJoin"];
|
|
1434
|
-
var TRIM = ["trimStart", "trimEnd", "trimEach"];
|
|
1435
|
-
var RECT = [...SHAPE, ...TRIM, "width", "height", "cornerRadius", "anchorX", "anchorY"];
|
|
1436
|
-
var CIRCLE = [...SHAPE, ...TRIM, "radius", "anchorX", "anchorY"];
|
|
1437
|
-
var ELLIPSE = [...SHAPE, ...TRIM, "radiusX", "radiusY", "anchorX", "anchorY"];
|
|
1438
|
-
var ARC = [...SHAPE, "radius", "innerRadius", "startAngle", "endAngle"];
|
|
1439
|
-
var LINE = [...SHAPE, ...TRIM, "from", "to"];
|
|
1440
|
-
var POLYGON = [...SHAPE, ...TRIM, "points", "open"];
|
|
1441
|
-
var PATH = [...SHAPE, ...TRIM, "d", "morphTo", "morph", "morphPoints"];
|
|
1442
|
-
var SHAPES = { rect: RECT, circle: CIRCLE, ellipse: ELLIPSE, arc: ARC, line: LINE, polygon: POLYGON, path: PATH };
|
|
1443
|
-
var BY_TYPE = { video: VIDEO, image: IMAGE, text: TEXT, audio: AUDIO, composition: COMPOSITION, camera: CAMERA, null: NULL };
|
|
1444
|
-
function kindName(spec) {
|
|
1445
|
-
return spec.type === "shape" && spec.shape ? `${spec.shape} shape` : `${spec.type} layer`;
|
|
1446
|
-
}
|
|
1447
|
-
function layerKeys(spec) {
|
|
1448
|
-
if (spec.type === "shape") return spec.shape && SHAPES[spec.shape] || null;
|
|
1449
|
-
return BY_TYPE[spec.type] ?? null;
|
|
1450
|
-
}
|
|
1451
|
-
function kindsWithKey(key) {
|
|
1452
|
-
const out = [];
|
|
1453
|
-
for (const [shape, keys] of Object.entries(SHAPES)) if (keys.includes(key)) out.push(`${shape} shape`);
|
|
1454
|
-
for (const [type, keys] of Object.entries(BY_TYPE)) if (keys.includes(key)) out.push(`${type} layer`);
|
|
1455
|
-
return out;
|
|
1456
|
-
}
|
|
1457
|
-
var PROP_KEYS = /* @__PURE__ */ new Set([
|
|
1458
|
-
// transform and look (GSAP + PixiPlugin names)
|
|
1459
|
-
"x",
|
|
1460
|
-
"y",
|
|
1461
|
-
"z",
|
|
1462
|
-
"alpha",
|
|
1463
|
-
"rotation",
|
|
1464
|
-
"rotationX",
|
|
1465
|
-
"rotationY",
|
|
1466
|
-
"width",
|
|
1467
|
-
"height",
|
|
1468
|
-
"visible",
|
|
1469
|
-
"autoAlpha",
|
|
1470
|
-
"scale",
|
|
1471
|
-
"scaleX",
|
|
1472
|
-
"scaleY",
|
|
1473
|
-
"anchor",
|
|
1474
|
-
"anchorX",
|
|
1475
|
-
"anchorY",
|
|
1476
|
-
"pivot",
|
|
1477
|
-
"pivotX",
|
|
1478
|
-
"pivotY",
|
|
1479
|
-
"skew",
|
|
1480
|
-
"skewX",
|
|
1481
|
-
"skewY",
|
|
1482
|
-
"position",
|
|
1483
|
-
"positionX",
|
|
1484
|
-
"positionY",
|
|
1485
|
-
"tint",
|
|
1486
|
-
"colorize",
|
|
1487
|
-
"colorizeAmount",
|
|
1488
|
-
"blur",
|
|
1489
|
-
"blurX",
|
|
1490
|
-
"blurY",
|
|
1491
|
-
"blurPadding",
|
|
1492
|
-
// shapes
|
|
1493
|
-
"fillColor",
|
|
1494
|
-
"fillAlpha",
|
|
1495
|
-
"strokeColor",
|
|
1496
|
-
"strokeAlpha",
|
|
1497
|
-
"strokeWidth",
|
|
1498
|
-
"lineColor",
|
|
1499
|
-
"lineAlpha",
|
|
1500
|
-
"cornerRadius",
|
|
1501
|
-
"radius",
|
|
1502
|
-
"radiusX",
|
|
1503
|
-
"radiusY",
|
|
1504
|
-
"innerRadius",
|
|
1505
|
-
"startAngle",
|
|
1506
|
-
"endAngle",
|
|
1507
|
-
"trimStart",
|
|
1508
|
-
"trimEnd",
|
|
1509
|
-
"trimEach",
|
|
1510
|
-
"morph",
|
|
1511
|
-
"fillGradient",
|
|
1512
|
-
"strokeCap",
|
|
1513
|
-
"strokeJoin",
|
|
1514
|
-
// text, audio, video
|
|
1515
|
-
"fill",
|
|
1516
|
-
"value",
|
|
1517
|
-
"visibleChars",
|
|
1518
|
-
"text",
|
|
1519
|
-
"volume",
|
|
1520
|
-
"time",
|
|
1521
|
-
// camera
|
|
1522
|
-
"lookAtX",
|
|
1523
|
-
"lookAtY",
|
|
1524
|
-
"lookAtZ",
|
|
1525
|
-
"fov",
|
|
1526
|
-
"focus",
|
|
1527
|
-
"aperture",
|
|
1528
|
-
"offsetX",
|
|
1529
|
-
"offsetY",
|
|
1530
|
-
"offsetZ",
|
|
1531
|
-
"lookOffsetX",
|
|
1532
|
-
"lookOffsetY",
|
|
1533
|
-
"lookOffsetZ"
|
|
1534
|
-
]);
|
|
1535
|
-
var STYLE_KEYS = [
|
|
1536
|
-
"fontSize",
|
|
1537
|
-
"fontFamily",
|
|
1538
|
-
"fontWeight",
|
|
1539
|
-
"fontStyle",
|
|
1540
|
-
"fontVariant",
|
|
1541
|
-
"fill",
|
|
1542
|
-
"stroke",
|
|
1543
|
-
"dropShadow",
|
|
1544
|
-
"letterSpacing",
|
|
1545
|
-
"lineHeight",
|
|
1546
|
-
"leading",
|
|
1547
|
-
"align",
|
|
1548
|
-
"wordWrap",
|
|
1549
|
-
"wordWrapWidth",
|
|
1550
|
-
"breakWords",
|
|
1551
|
-
"whiteSpace",
|
|
1552
|
-
"padding",
|
|
1553
|
-
"textBaseline",
|
|
1554
|
-
"trim",
|
|
1555
|
-
"lineJoin",
|
|
1556
|
-
"miterLimit",
|
|
1557
|
-
"filters",
|
|
1558
|
-
"tagStyles"
|
|
1559
|
-
];
|
|
1560
|
-
|
|
1561
|
-
// src/core/lint.ts
|
|
1562
|
-
var defaultWarn = (m) => console.warn(m);
|
|
1563
|
-
function describeLayer(spec) {
|
|
1564
|
-
return spec.name ? `layer "${spec.name}"` : `unnamed ${spec.type} layer`;
|
|
1565
|
-
}
|
|
1566
|
-
function lintTiming(spec, parentDuration, warn = defaultWarn) {
|
|
1567
|
-
const who = describeLayer(spec);
|
|
1568
|
-
const at = spec.at ?? 0;
|
|
1569
|
-
if (at >= parentDuration) {
|
|
1570
|
-
warn(`pixi-effects: ${who} starts at ${at}s, after its composition ends (${parentDuration}s), so it is never visible`);
|
|
1571
|
-
}
|
|
1572
|
-
if (spec.type === "audio" && (spec.sfx !== void 0 || spec.music !== void 0) && spec.duration === void 0) return;
|
|
1573
|
-
const duration = spec.duration ?? parentDuration;
|
|
1574
|
-
(spec.keyframes ?? []).forEach((kf, i) => {
|
|
1575
|
-
const kat = kf.at ?? 0;
|
|
1576
|
-
if (kat >= duration) {
|
|
1577
|
-
warn(
|
|
1578
|
-
`pixi-effects: ${who}: keyframes[${i}] starts at ${kat}s, after the layer ends (duration ${duration}s), so it never plays. Keyframe \`at\` is measured from the start of this layer, not from the start of the composition.`,
|
|
1579
|
-
"late-keyframe"
|
|
1580
|
-
);
|
|
1581
|
-
}
|
|
1582
|
-
});
|
|
1583
|
-
}
|
|
1584
|
-
function summarizeWarnings(messages, shown = 3) {
|
|
1585
|
-
if (messages.length <= shown) return messages;
|
|
1586
|
-
return [...messages.slice(0, shown), `pixi-effects: ${messages.length - shown} more layers with the same problem (the same loop or helper is probably building them): fix the ones above and these go away.`];
|
|
1587
|
-
}
|
|
1588
|
-
function lintText(spec, warn = defaultWarn) {
|
|
1589
|
-
if (spec.type !== "text") return;
|
|
1590
|
-
const strings = [spec.text ?? "", ...(spec.keyframes ?? []).map((kf) => String(kf.set?.text ?? ""))];
|
|
1591
|
-
const hasPlaceholder = strings.some((t) => t.includes("{value}"));
|
|
1592
|
-
if (hasPlaceholder && !collectPropKeys(spec).has("value")) {
|
|
1593
|
-
warn(`pixi-effects: ${describeLayer(spec)}: the text has a {value} placeholder but nothing sets or animates \`value\`, so it prints 0. Set initial: { value: \u2026 } or animate it; {value} is reserved for counters (there is no way to print a literal "{value}").`);
|
|
1594
|
-
}
|
|
1595
|
-
if (collectPropKeys(spec).has("value") && !hasPlaceholder) {
|
|
1596
|
-
warn(`pixi-effects: ${describeLayer(spec)}: \`value\` is set or animated but the text has no {value} placeholder, so nothing shows it. Use text: '{value}' (or e.g. '{value} users').`);
|
|
1597
|
-
}
|
|
1598
|
-
}
|
|
1599
|
-
var REMAPPABLE = /* @__PURE__ */ new Set(["video", "audio", "composition"]);
|
|
1600
|
-
var REMAP_NAMES = /* @__PURE__ */ new Set(["time", "timeRemap", "reverse"]);
|
|
1601
|
-
var TIME_BAGS = ["set", "to", "from"];
|
|
1602
|
-
function lintRemap(spec, warn) {
|
|
1603
|
-
const s = spec;
|
|
1604
|
-
const who = describeLayer(spec);
|
|
1605
|
-
const kfs = s.keyframes ?? [];
|
|
1606
|
-
const bags = [s.initial, ...kfs.flatMap((kf) => TIME_BAGS.map((b) => kf[b]))];
|
|
1607
|
-
const timeInInitial = !!s.initial && s.initial.time !== void 0;
|
|
1608
|
-
const timeInKeyframes = kfs.some((kf) => TIME_BAGS.some((b) => kf[b] && kf[b].time !== void 0));
|
|
1609
|
-
const timed = timeInInitial || timeInKeyframes;
|
|
1610
|
-
if (bags.some((bag) => bag && bag.speed !== void 0)) {
|
|
1611
|
-
warn(`pixi-effects: ${who}: speed is a fixed setting, not an animatable property: write it on the layer (speed: 2); to change the speed over time, animate time (keyframes: [{ at: 0, from: { time: 0 }, to: { time: 4 }, duration: 2, ease: 'power2.in' }])`);
|
|
1612
|
-
}
|
|
1613
|
-
if (!REMAPPABLE.has(spec.type)) {
|
|
1614
|
-
if (timed) warn(`pixi-effects: ${who}: "time" only works on video, audio and composition layers; put this layer in a composition and remap that (it is ignored here)`);
|
|
1615
|
-
return;
|
|
1616
|
-
}
|
|
1617
|
-
if (s.reverse !== void 0) warn(`pixi-effects: ${who}: "reverse" is not a key: write speed: -1 to play backward`);
|
|
1618
|
-
if (s.timeRemap !== void 0) warn(`pixi-effects: ${who}: "timeRemap" is not a key: animate time in keyframes (from / to / set), or write speed`);
|
|
1619
|
-
if (s.time !== void 0) warn(`pixi-effects: ${who}: "time" belongs in initial or keyframes (initial: { time: 2 }), not on the layer`);
|
|
1620
|
-
if (spec.type === "audio" && (s.sfx !== void 0 || s.music !== void 0) && (s.speed !== void 0 || timed)) {
|
|
1621
|
-
warn(`pixi-effects: ${who}: speed and time do not apply to a synthesised sound (sfx, music); change an sfx's pitch with pitch (semitones), or put it in a composition and remap that`);
|
|
1622
|
-
return;
|
|
1623
|
-
}
|
|
1624
|
-
if (s.speed !== void 0 && (typeof s.speed !== "number" || !Number.isFinite(s.speed) || s.speed === 0)) {
|
|
1625
|
-
warn(`pixi-effects: ${who}: speed ${JSON.stringify(s.speed)} cannot be used: write a number other than 0 (negative plays backward); to hold a moment, key time to the same value twice`);
|
|
1626
|
-
}
|
|
1627
|
-
if (s.speed !== void 0 && timeInKeyframes) {
|
|
1628
|
-
warn(`pixi-effects: ${who}: speed and keyframed time are both set; time wins and speed is ignored. Use one of them`);
|
|
1629
|
-
}
|
|
1630
|
-
if (timeInInitial && typeof s.initial.time !== "number") {
|
|
1631
|
-
warn(`pixi-effects: ${who}: initial.time must be a number of seconds, got ${JSON.stringify(s.initial.time)}`);
|
|
1632
|
-
}
|
|
1633
|
-
kfs.forEach((kf, i) => {
|
|
1634
|
-
for (const b of TIME_BAGS) {
|
|
1635
|
-
const v = kf[b]?.time;
|
|
1636
|
-
if (v !== void 0 && typeof v !== "number" && typeof v !== "string") warn(`pixi-effects: ${who}: keyframes[${i}].${b}.time must be a number of seconds, got ${JSON.stringify(v)}`);
|
|
1637
|
-
}
|
|
1638
|
-
});
|
|
1639
|
-
}
|
|
1640
|
-
function lintKeys(spec, warn = defaultWarn) {
|
|
1641
|
-
const who = describeLayer(spec);
|
|
1642
|
-
const valid = layerKeys(spec);
|
|
1643
|
-
if (valid) {
|
|
1644
|
-
for (const key of Object.keys(spec)) {
|
|
1645
|
-
if (valid.includes(key) || spec[key] === void 0) continue;
|
|
1646
|
-
if (REMAPPABLE.has(spec.type) && REMAP_NAMES.has(key)) continue;
|
|
1647
|
-
const guess = suggestName(key, valid.filter((k) => k !== "type"));
|
|
1648
|
-
const owners = kindsWithKey(key);
|
|
1649
|
-
const belongs = owners.length ? ` (it belongs to ${owners.slice(0, 3).join(", ")})` : "";
|
|
1650
|
-
const hint = guess ? ` \u2014 did you mean "${guess}"?${belongs}` : belongs;
|
|
1651
|
-
warn(`pixi-effects: ${who}: "${key}" is not a ${kindName(spec)} key${hint}. Valid keys: ${valid.join(", ")}`);
|
|
1652
|
-
}
|
|
1653
|
-
}
|
|
1654
|
-
lintRemap(spec, warn);
|
|
1655
|
-
const said = /* @__PURE__ */ new Set();
|
|
1656
|
-
const bags = [spec.initial, ...(spec.keyframes ?? []).flatMap((kf) => [kf.set, kf.to, kf.from])];
|
|
1657
|
-
for (const bag of bags) {
|
|
1658
|
-
for (const key of Object.keys(bag ?? {})) {
|
|
1659
|
-
if (bag[key] === void 0) continue;
|
|
1660
|
-
if (PROP_KEYS.has(key) || key.includes(".") || /^gradient/i.test(key) || said.has(key) || key === "speed") continue;
|
|
1661
|
-
said.add(key);
|
|
1662
|
-
const guess = suggestName(key, [...PROP_KEYS]);
|
|
1663
|
-
warn(`pixi-effects: ${who}: "${key}" is not an animatable property${guess ? ` \u2014 did you mean "${guess}"?` : ""} (in initial, set, to or from). See the cheatsheet for the properties of this kind of layer`);
|
|
1664
|
-
}
|
|
1665
|
-
}
|
|
1666
|
-
if (spec.type === "text" && spec.style && typeof spec.style === "object") {
|
|
1667
|
-
for (const key of Object.keys(spec.style)) {
|
|
1668
|
-
if (STYLE_KEYS.includes(key) || spec.style[key] === void 0) continue;
|
|
1669
|
-
const guess = suggestName(key, STYLE_KEYS);
|
|
1670
|
-
warn(`pixi-effects: ${who}: style.${key} is not a text style key${guess ? ` \u2014 did you mean "${guess}"?` : ""} (it is ignored). Keys: ${STYLE_KEYS.join(", ")}`);
|
|
1671
|
-
}
|
|
1672
|
-
}
|
|
1673
|
-
}
|
|
1674
1412
|
var BAGS = ["set", "to", "from"];
|
|
1675
1413
|
function timeRemapOf(spec, prop = "time") {
|
|
1676
1414
|
const hasInitial = !!spec.initial && "time" in spec.initial;
|
|
@@ -1947,10 +1685,14 @@ function focusProblems(camera, siblings) {
|
|
|
1947
1685
|
for (const name of focusNames(camera, known)) {
|
|
1948
1686
|
if (said.has(name)) continue;
|
|
1949
1687
|
said.add(name);
|
|
1950
|
-
const
|
|
1688
|
+
const same = siblings.filter((s) => s.name === name);
|
|
1689
|
+
const hit = same.find((s) => s.threeD) ?? same[0];
|
|
1951
1690
|
if (!hit) out.push({ kind: "missing", name, hint: suggestName(name, threeD) });
|
|
1952
1691
|
else if (!hit.threeD) out.push({ kind: "not-threeD", name });
|
|
1953
|
-
else
|
|
1692
|
+
else {
|
|
1693
|
+
if (same.length > 1) out.push({ kind: "duplicate", name, count: same.length });
|
|
1694
|
+
if (movesZ(hit)) out.push({ kind: "moving", name });
|
|
1695
|
+
}
|
|
1954
1696
|
}
|
|
1955
1697
|
return out;
|
|
1956
1698
|
}
|
|
@@ -1960,6 +1702,7 @@ var CameraSequence = class extends Sequence {
|
|
|
1960
1702
|
compH = 0;
|
|
1961
1703
|
warnedFov = false;
|
|
1962
1704
|
warnedLookAt = false;
|
|
1705
|
+
warnedAperture = false;
|
|
1963
1706
|
/** True when the camera writes `focus` or `aperture` anywhere: depth of field is on. */
|
|
1964
1707
|
dof = false;
|
|
1965
1708
|
zOfName = null;
|
|
@@ -1988,6 +1731,16 @@ var CameraSequence = class extends Sequence {
|
|
|
1988
1731
|
this.autoZ = !keys.has("z");
|
|
1989
1732
|
this.dof = keys.has("focus") || keys.has("aperture");
|
|
1990
1733
|
}
|
|
1734
|
+
/** The aperture to use now: off unless depth of field is on and the value is a number of 0 or more (said once if it is not). */
|
|
1735
|
+
apertureNow(a) {
|
|
1736
|
+
if (!this.dof) return 0;
|
|
1737
|
+
if (!(a >= 0) && !this.warnedAperture) {
|
|
1738
|
+
this.warnedAperture = true;
|
|
1739
|
+
const who = this.spec.name ? ` "${this.spec.name}"` : "";
|
|
1740
|
+
console.warn(`pixi-effects: camera${who}: aperture ${a} is not a number of 0 or more; depth of field is off (it is the lens diameter in px: 30 is the default, 0 turns it off)`);
|
|
1741
|
+
}
|
|
1742
|
+
return a > 0 ? a : 0;
|
|
1743
|
+
}
|
|
1991
1744
|
/** Called by the composition once its children exist: how a layer name in `focus` becomes the z of that layer. */
|
|
1992
1745
|
resolveFocusNames(zOf, names = /* @__PURE__ */ new Set()) {
|
|
1993
1746
|
this.zOfName = zOf;
|
|
@@ -2021,7 +1774,7 @@ var CameraSequence = class extends Sequence {
|
|
|
2021
1774
|
lookAtZ: c.lookAtZ + c.lookOffsetZ,
|
|
2022
1775
|
fov,
|
|
2023
1776
|
focus: Number.isFinite(c.focus) ? c.focus : 0,
|
|
2024
|
-
aperture: this.
|
|
1777
|
+
aperture: this.apertureNow(c.aperture)
|
|
2025
1778
|
};
|
|
2026
1779
|
}
|
|
2027
1780
|
/** Lifespan on the global timeline (valid after bindTimeline). */
|
|
@@ -2788,7 +2541,7 @@ var AudioSequence = class extends Sequence {
|
|
|
2788
2541
|
const raw = spec;
|
|
2789
2542
|
if (raw.asset !== void 0) console.warn(`pixi-effects: ${who}: has both asset and sfx \u2014 the sfx plays; remove one`);
|
|
2790
2543
|
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)`);
|
|
2791
|
-
const { resolveSfx, renderSfx, sfxKey } = await import('./sfx-
|
|
2544
|
+
const { resolveSfx, renderSfx, sfxKey } = await import('./sfx-3IDAJ3UZ.js');
|
|
2792
2545
|
const sfx = resolveSfx(spec.sfx, spec.duration, who);
|
|
2793
2546
|
if (!sfx) return;
|
|
2794
2547
|
this.duration = sfx.length;
|
|
@@ -2807,7 +2560,7 @@ var AudioSequence = class extends Sequence {
|
|
|
2807
2560
|
const raw = spec;
|
|
2808
2561
|
if (raw.asset !== void 0) console.warn(`pixi-effects: ${who}: has both asset and music \u2014 the music plays; remove one`);
|
|
2809
2562
|
if (raw.sfx !== void 0) console.warn(`pixi-effects: ${who}: has both sfx and music \u2014 the music plays; remove one`);
|
|
2810
|
-
const { resolveMusic, renderMusic, musicLength, musicKey } = await import('./music-
|
|
2563
|
+
const { resolveMusic, renderMusic, musicLength, musicKey } = await import('./music-FUN7N225.js');
|
|
2811
2564
|
const music = resolveMusic(spec.music, who);
|
|
2812
2565
|
if (!music) return;
|
|
2813
2566
|
const natural = musicLength(music);
|
|
@@ -3286,7 +3039,7 @@ function morphAt(pairs, t) {
|
|
|
3286
3039
|
}
|
|
3287
3040
|
|
|
3288
3041
|
// src/sequences/Shape.ts
|
|
3289
|
-
var
|
|
3042
|
+
var STYLE_KEYS = ["fillColor", "fillAlpha", "strokeColor", "strokeAlpha", "strokeWidth"];
|
|
3290
3043
|
var COLOR_KEYS = /* @__PURE__ */ new Set(["fillColor", "strokeColor"]);
|
|
3291
3044
|
var TRIM_KEYS = ["trimStart", "trimEnd"];
|
|
3292
3045
|
var GEOMETRY_KEYS_BY_SHAPE = {
|
|
@@ -3312,7 +3065,7 @@ var ShapeSequence = class extends Sequence {
|
|
|
3312
3065
|
// by `Container.onRender`.
|
|
3313
3066
|
_drawGeometry = () => {
|
|
3314
3067
|
};
|
|
3315
|
-
_liveKeys = new Set(
|
|
3068
|
+
_liveKeys = new Set(STYLE_KEYS);
|
|
3316
3069
|
async build() {
|
|
3317
3070
|
const graphics = new Graphics({ label: this.spec.name });
|
|
3318
3071
|
graphics.cullable = true;
|
|
@@ -3506,7 +3259,7 @@ function seedStrokeStyle(state, spec, initial, who) {
|
|
|
3506
3259
|
}
|
|
3507
3260
|
}
|
|
3508
3261
|
function seedStyle(state, initial, scope) {
|
|
3509
|
-
for (const k of
|
|
3262
|
+
for (const k of STYLE_KEYS) {
|
|
3510
3263
|
const v = initial[k];
|
|
3511
3264
|
if (v === void 0) continue;
|
|
3512
3265
|
state[k] = COLOR_KEYS.has(k) ? v : numOrZero(v, scope);
|
|
@@ -3801,7 +3554,7 @@ function numOrZero(v, scope) {
|
|
|
3801
3554
|
var _CompositionSequence = null;
|
|
3802
3555
|
async function getCompositionSequence() {
|
|
3803
3556
|
if (!_CompositionSequence) {
|
|
3804
|
-
_CompositionSequence = (await import('./Composition-
|
|
3557
|
+
_CompositionSequence = (await import('./Composition-Q5TVG3HM.js')).CompositionSequence;
|
|
3805
3558
|
}
|
|
3806
3559
|
return _CompositionSequence;
|
|
3807
3560
|
}
|
|
@@ -3839,6 +3592,6 @@ async function buildSequenceTree(specs, parent, root) {
|
|
|
3839
3592
|
return out;
|
|
3840
3593
|
}
|
|
3841
3594
|
|
|
3842
|
-
export { CameraSequence, DEFAULT_FOV, DEG, MANY_BLURRED, MAX_BLUR, MIN_BLUR, NEAR, NullSequence, Sequence, bindClock, blurRadius, buildScope, buildSequenceTree, cameraBasis, checkEase, clockTable,
|
|
3843
|
-
//# sourceMappingURL=chunk-
|
|
3844
|
-
//# sourceMappingURL=chunk-
|
|
3595
|
+
export { CameraSequence, DEFAULT_FOV, DEG, MANY_BLURRED, MAX_BLUR, MIN_BLUR, NEAR, NullSequence, Sequence, bindClock, blurRadius, buildScope, buildSequenceTree, cameraBasis, checkEase, clockTable, contentLength, ensureFilterLibrary, evaluateExpr, flattenSvgPath, focusProblems, homeCamera, homeDistance, layerInitialZ, noise, projectLayer, projectPoint, rand, random, registerSequenceType, remapOf, resolveAt, timeRemapOf };
|
|
3596
|
+
//# sourceMappingURL=chunk-DC4JPY6A.js.map
|
|
3597
|
+
//# sourceMappingURL=chunk-DC4JPY6A.js.map
|