pixi-effects 0.46.0 → 0.47.1
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 +5 -5
- package/ai/chat-template.html +3 -3
- package/ai/tools/check.mjs +2 -2
- package/ai/tools/lookup.mjs +6 -1
- package/ai/tools/pixi-effects.mjs +1 -0
- package/ai/tools/render.mjs +25 -2
- package/dist/Composition-AZEATHJB.cjs +16 -0
- package/dist/{Composition-PME3P5LP.cjs.map → Composition-AZEATHJB.cjs.map} +1 -1
- package/dist/Composition-ME3L3EFT.js +7 -0
- package/dist/{Composition-NSY7A32Y.js.map → Composition-ME3L3EFT.js.map} +1 -1
- package/dist/{Spans-2TZCNREQ.cjs → Spans-LTKEUHDN.cjs} +11 -11
- package/dist/{Spans-2TZCNREQ.cjs.map → Spans-LTKEUHDN.cjs.map} +1 -1
- package/dist/{Spans-TESJPQKX.js → Spans-YV7K4X5I.js} +6 -6
- package/dist/{Spans-TESJPQKX.js.map → Spans-YV7K4X5I.js.map} +1 -1
- package/dist/{blendModes-FMYO6SQN.js → blendModes-56NHK2MP.js} +4 -4
- package/dist/{blendModes-FMYO6SQN.js.map → blendModes-56NHK2MP.js.map} +1 -1
- package/dist/{blendModes-FD3THLNC.cjs → blendModes-ONOPMMAB.cjs} +5 -5
- package/dist/{blendModes-FD3THLNC.cjs.map → blendModes-ONOPMMAB.cjs.map} +1 -1
- package/dist/{chunk-LALEBV63.cjs → chunk-4NOTVQ3I.cjs} +29 -29
- package/dist/{chunk-LALEBV63.cjs.map → chunk-4NOTVQ3I.cjs.map} +1 -1
- package/dist/{chunk-JN7JHNZR.cjs → chunk-53DXJEO7.cjs} +5 -5
- package/dist/{chunk-JN7JHNZR.cjs.map → chunk-53DXJEO7.cjs.map} +1 -1
- package/dist/{chunk-DM2OLQOJ.js → chunk-6MHJKCXO.js} +5 -5
- package/dist/{chunk-DM2OLQOJ.js.map → chunk-6MHJKCXO.js.map} +1 -1
- package/dist/{chunk-K24FF4BT.js → chunk-7IDEWQPH.js} +19 -5
- package/dist/chunk-7IDEWQPH.js.map +1 -0
- package/dist/{chunk-DKCMJILW.cjs → chunk-BFERTUXK.cjs} +92 -92
- package/dist/{chunk-DKCMJILW.cjs.map → chunk-BFERTUXK.cjs.map} +1 -1
- package/dist/{chunk-3SAS3ZE5.cjs → chunk-NEMWRJQS.cjs} +11 -2
- package/dist/chunk-NEMWRJQS.cjs.map +1 -0
- package/dist/{chunk-32MMNDDN.js → chunk-NVKHUAHU.js} +11 -2
- package/dist/chunk-NVKHUAHU.js.map +1 -0
- package/dist/{chunk-2E74SP63.js → chunk-OVTTCX2E.js} +105 -25
- package/dist/chunk-OVTTCX2E.js.map +1 -0
- package/dist/{chunk-FPV3NPYC.js → chunk-QMVK55LC.js} +5 -5
- package/dist/{chunk-FPV3NPYC.js.map → chunk-QMVK55LC.js.map} +1 -1
- package/dist/{chunk-O66JGPVV.cjs → chunk-SMHTOWXG.cjs} +19 -5
- package/dist/chunk-SMHTOWXG.cjs.map +1 -0
- package/dist/{chunk-VNP7QCJE.js → chunk-UTDELFOU.js} +4 -4
- package/dist/{chunk-VNP7QCJE.js.map → chunk-UTDELFOU.js.map} +1 -1
- package/dist/{chunk-7M63Y6MO.cjs → chunk-YXIEPTFG.cjs} +150 -70
- package/dist/chunk-YXIEPTFG.cjs.map +1 -0
- package/dist/index.cjs +37 -37
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +6 -6
- package/dist/loader.css +1 -1
- package/dist/present.cjs +6 -6
- package/dist/present.js +6 -6
- package/dist/sound.cjs +2 -2
- package/dist/sound.js +1 -1
- package/dist/three.cjs +6 -6
- package/dist/three.js +2 -2
- package/docs/api.md +1 -1
- package/docs/dsl.md +2 -2
- package/llms-full.txt +8 -7
- package/package.json +1 -1
- package/skills/pixi-effects/SKILL.md +2 -1
- package/skills/pixi-effects/reference/cheatsheet.md +2 -2
- package/skills/pixi-effects/reference/recipes.md +1 -1
- package/skills/pixi-effects/template.html +6 -6
- package/dist/Composition-NSY7A32Y.js +0 -7
- package/dist/Composition-PME3P5LP.cjs +0 -16
- package/dist/chunk-2E74SP63.js.map +0 -1
- package/dist/chunk-32MMNDDN.js.map +0 -1
- package/dist/chunk-3SAS3ZE5.cjs.map +0 -1
- package/dist/chunk-7M63Y6MO.cjs.map +0 -1
- package/dist/chunk-K24FF4BT.js.map +0 -1
- package/dist/chunk-O66JGPVV.cjs.map +0 -1
|
@@ -275,6 +275,7 @@ function lintRemap(spec, warn) {
|
|
|
275
275
|
var REMOVED_KEYS = {
|
|
276
276
|
maskInverted: "a hole instead of a crop is `mask: { layer: <the mask layer>, invert: true }`"
|
|
277
277
|
};
|
|
278
|
+
var SFX_KNOBS = /* @__PURE__ */ new Set(["pitch", "brightness", "seed"]);
|
|
278
279
|
var TRANSFORM_KEYS = /* @__PURE__ */ new Set([
|
|
279
280
|
"x",
|
|
280
281
|
"y",
|
|
@@ -313,6 +314,14 @@ function lintKeys(spec, warn = defaultWarn) {
|
|
|
313
314
|
warn(`pixi-effects: ${who}: "${key}" is not a ${kindName(spec)} key: ${REMOVED_KEYS[key]}`);
|
|
314
315
|
continue;
|
|
315
316
|
}
|
|
317
|
+
if (spec.type === "audio" && SFX_KNOBS.has(key) && spec.sfx !== void 0) {
|
|
318
|
+
const sfx = spec.sfx;
|
|
319
|
+
const preset = typeof sfx === "string" ? sfx : sfx?.preset;
|
|
320
|
+
const v = spec[key];
|
|
321
|
+
const shown = typeof v === "number" || typeof v === "string" && v.length <= 24 ? JSON.stringify(v) : "\u2026";
|
|
322
|
+
warn(`pixi-effects: ${who}: "${key}" is a knob of the sound effect, so it is ignored beside \`sfx\`: write it inside \u2014 sfx: { ${preset ? `preset: '${preset}', ` : ""}${key}: ${shown} }${key === "pitch" ? " (pitch is in semitones, \xB124: 12 is an octave up)" : key === "brightness" ? " (brightness is \u22121 dark \u2026 1 bright)" : ""}`);
|
|
323
|
+
continue;
|
|
324
|
+
}
|
|
316
325
|
if (TRANSFORM_KEYS.has(key) || PROP_KEYS.has(key) && kindsWithKey(key).length === 0) {
|
|
317
326
|
const v = spec[key];
|
|
318
327
|
const shown = typeof v === "number" || typeof v === "string" && v.length <= 24 ? JSON.stringify(v) : "\u2026";
|
|
@@ -354,5 +363,5 @@ exports.lintKeys = lintKeys;
|
|
|
354
363
|
exports.lintText = lintText;
|
|
355
364
|
exports.lintTiming = lintTiming;
|
|
356
365
|
exports.summarizeWarnings = summarizeWarnings;
|
|
357
|
-
//# sourceMappingURL=chunk-
|
|
358
|
-
//# sourceMappingURL=chunk-
|
|
366
|
+
//# sourceMappingURL=chunk-NEMWRJQS.cjs.map
|
|
367
|
+
//# sourceMappingURL=chunk-NEMWRJQS.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/space/specKeys.ts","../src/core/layerKeys.ts","../src/core/lint.ts"],"names":["suggestName"],"mappings":";;;;;AAGO,SAAS,gBAAgB,IAAA,EAGhB;AACd,EAAA,MAAM,GAAA,uBAAU,GAAA,EAAY;AAC5B,EAAA,KAAA,MAAW,CAAA,IAAK,MAAA,CAAO,IAAA,CAAK,IAAA,CAAK,OAAA,IAAW,EAAE,CAAA,EAAG,GAAA,CAAI,GAAA,CAAI,CAAC,CAAA;AAC1D,EAAA,KAAA,MAAW,EAAA,IAAM,IAAA,CAAK,SAAA,IAAa,EAAC,EAAG;AACrC,IAAA,KAAA,MAAW,GAAA,IAAO,CAAC,EAAA,CAAG,GAAA,EAAK,GAAG,EAAA,EAAI,EAAA,CAAG,IAAI,CAAA,EAAG;AAC1C,MAAA,KAAA,MAAW,CAAA,IAAK,OAAO,IAAA,CAAK,GAAA,IAAO,EAAE,CAAA,EAAG,GAAA,CAAI,GAAA,CAAI,CAAC,CAAA;AAAA,IACnD;AAAA,EACF;AACA,EAAA,OAAO,GAAA;AACT;;;ACAA,IAAM,SAAS,CAAC,MAAA,EAAQ,MAA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,CAAA;AAAA,IAC7M;AAAA,EACF;AACA,EAAA,IAAI,IAAA,CAAK,SAAS,MAAA,IAAU,IAAA,CAAK,SAAS,OAAO,IAAA,CAAK,UAAU,QAAA,EAAU;AACxE,IAAA,KAAA,MAAW,GAAA,IAAO,MAAA,CAAO,IAAA,CAAK,IAAA,CAAK,KAAK,CAAA,EAAG;AACzC,MAAA,IAAI,UAAA,CAAW,SAAS,GAAG,CAAA,IAAM,KAAK,KAAA,CAAkC,GAAG,MAAM,MAAA,EAAW;AAC5F,MAAA,MAAM,KAAA,GAAQA,6BAAA,CAAY,GAAA,EAAK,UAAU,CAAA;AACzC,MAAA,IAAA,CAAK,CAAA,cAAA,EAAiB,GAAG,CAAA,QAAA,EAAW,GAAG,2BAA2B,KAAA,GAAQ,CAAA,sBAAA,EAAoB,KAAK,CAAA,EAAA,CAAA,GAAO,EAAE,CAAA,wBAAA,EAA2B,UAAA,CAAW,IAAA,CAAK,IAAI,CAAC,CAAA,CAAE,CAAA;AAAA,IAChK;AAAA,EACF;AACF","file":"chunk-NEMWRJQS.cjs","sourcesContent":["import type { Keyframe } from '../types';\n\n/** Every prop key a spec touches in `initial` and in keyframe `set` / `to` / `from`. */\nexport function collectPropKeys(spec: {\n initial?: Record<string, unknown>;\n keyframes?: Keyframe[];\n}): Set<string> {\n const out = new Set<string>();\n for (const k of Object.keys(spec.initial ?? {})) out.add(k);\n for (const kf of spec.keyframes ?? []) {\n for (const bag of [kf.set, kf.to, kf.from]) {\n for (const k of Object.keys(bag ?? {})) out.add(k);\n }\n }\n return out;\n}\n","import type {\n SequenceCommon, VideoSequenceSpec, ImageSequenceSpec, TextSequenceSpec, AudioAssetSpec, AudioSfxSpec, AudioMusicSpec,\n CompositionSequenceSpec, CameraSequenceSpec, LightSequenceSpec, ShaderSequenceSpec, CanvasSequenceSpec, NullSequenceSpec, SequenceSpec,\n RectShapeSpec, CircleShapeSpec, EllipseShapeSpec, ArcShapeSpec, LineShapeSpec, PolygonShapeSpec, PathShapeSpec,\n} from '../types';\n\n/**\n * The keys a layer of each kind may have, for `lintKeys`. They are tables of names, so each one is checked against its type twice, by\n * the compiler: `satisfies` rejects a name the type does not have, and `Covers` fails the build when the type has a key the table lacks\n * (add a key to a spec type and `tsc` tells you to add it here, so the warning never calls a real key unknown).\n */\ntype KeysOfUnion<T> = T extends unknown ? keyof T : never;\ntype Covers<T, K extends readonly string[]> = [Exclude<KeysOfUnion<T>, K[number]>] extends [never] ? true : { missing: Exclude<KeysOfUnion<T>, K[number]> };\ntype Assert<T extends true> = T;\n\nconst COMMON = ['type', 'name', 'parent', 'at', 'duration', 'initial', 'keyframes', 'filters', 'filterArea', 'mask', 'blendMode', 'threeD', 'hideBehindCamera', 'lit', 'castsShadows'] as const satisfies readonly KeysOfUnion<SequenceCommon | { type: string }>[];\n\nconst VIDEO = [...COMMON, 'asset', 'loop', 'audio', 'volume', 'speed'] as const satisfies readonly KeysOfUnion<VideoSequenceSpec>[];\nconst IMAGE = [...COMMON, 'asset', 'colorSpace', 'scaleMode'] as const satisfies readonly KeysOfUnion<ImageSequenceSpec>[];\nconst TEXT = [...COMMON, 'text', 'spans', 'format', 'resolution', 'style', 'colorSpace', 'fillGradient'] as const satisfies readonly KeysOfUnion<TextSequenceSpec>[];\nconst AUDIO = [...COMMON, 'volume', 'asset', 'loop', 'sfx', 'music', 'speed'] as const satisfies readonly KeysOfUnion<AudioAssetSpec | AudioSfxSpec | AudioMusicSpec>[];\nconst COMPOSITION = [...COMMON, 'width', 'height', 'sequences', 'transitions', 'speed'] as const satisfies readonly KeysOfUnion<CompositionSequenceSpec>[];\nconst CAMERA = [...COMMON] as const satisfies readonly KeysOfUnion<CameraSequenceSpec>[];\nconst LIGHT = [...COMMON, 'kind', 'falloff'] as const satisfies readonly KeysOfUnion<LightSequenceSpec>[];\nconst SHADER = [...COMMON, 'fragment', 'uniforms', 'width', 'height', 'resolution', 'transparent'] as const satisfies readonly KeysOfUnion<ShaderSequenceSpec>[];\nconst CANVAS = [...COMMON, 'draw', 'setup', 'width', 'height', 'resolution', 'params', 'seed', 'smoothing'] as const satisfies readonly KeysOfUnion<CanvasSequenceSpec>[];\nconst NULL = [...COMMON] as const satisfies readonly KeysOfUnion<NullSequenceSpec>[];\n\nconst SHAPE = [...COMMON, 'shape', 'fillGradient', 'colorSpace', 'strokeCap', 'strokeJoin'] as const;\nconst TRIM = ['trimStart', 'trimEnd', 'trimEach'] as const;\nconst RECT = [...SHAPE, ...TRIM, 'width', 'height', 'cornerRadius', 'anchorX', 'anchorY'] as const satisfies readonly KeysOfUnion<RectShapeSpec>[];\nconst CIRCLE = [...SHAPE, ...TRIM, 'radius', 'anchorX', 'anchorY'] as const satisfies readonly KeysOfUnion<CircleShapeSpec>[];\nconst ELLIPSE = [...SHAPE, ...TRIM, 'radiusX', 'radiusY', 'anchorX', 'anchorY'] as const satisfies readonly KeysOfUnion<EllipseShapeSpec>[];\nconst ARC = [...SHAPE, 'radius', 'innerRadius', 'startAngle', 'endAngle'] as const satisfies readonly KeysOfUnion<ArcShapeSpec>[];\nconst LINE = [...SHAPE, ...TRIM, 'from', 'to'] as const satisfies readonly KeysOfUnion<LineShapeSpec>[];\nconst POLYGON = [...SHAPE, ...TRIM, 'points', 'open'] as const satisfies readonly KeysOfUnion<PolygonShapeSpec>[];\nconst PATH = [...SHAPE, ...TRIM, 'd', 'fillRule', 'morphTo', 'morph', 'morphPoints'] as const satisfies readonly KeysOfUnion<PathShapeSpec>[];\n\n/** The compiler checks every table covers its type (this type is never used: it exists to fail the build). */\nexport type __Covered = [\n Assert<Covers<VideoSequenceSpec, typeof VIDEO>>, Assert<Covers<ImageSequenceSpec, typeof IMAGE>>, Assert<Covers<TextSequenceSpec, typeof TEXT>>,\n Assert<Covers<AudioAssetSpec | AudioSfxSpec | AudioMusicSpec, typeof AUDIO>>, Assert<Covers<CompositionSequenceSpec, typeof COMPOSITION>>,\n Assert<Covers<CameraSequenceSpec, typeof CAMERA>>, Assert<Covers<LightSequenceSpec, typeof LIGHT>>, Assert<Covers<ShaderSequenceSpec, typeof SHADER>>, Assert<Covers<CanvasSequenceSpec, typeof CANVAS>>, Assert<Covers<NullSequenceSpec, typeof NULL>>,\n Assert<Covers<RectShapeSpec, typeof RECT>>, Assert<Covers<CircleShapeSpec, typeof CIRCLE>>, Assert<Covers<EllipseShapeSpec, typeof ELLIPSE>>,\n Assert<Covers<ArcShapeSpec, typeof ARC>>, Assert<Covers<LineShapeSpec, typeof LINE>>, Assert<Covers<PolygonShapeSpec, typeof POLYGON>>,\n Assert<Covers<PathShapeSpec, typeof PATH>>,\n];\n\nconst SHAPES: Record<string, readonly string[]> = { rect: RECT, circle: CIRCLE, ellipse: ELLIPSE, arc: ARC, line: LINE, polygon: POLYGON, path: PATH };\nconst BY_TYPE: Record<string, readonly string[]> = { video: VIDEO, image: IMAGE, text: TEXT, audio: AUDIO, composition: COMPOSITION, camera: CAMERA, light: LIGHT, shader: SHADER, canvas: CANVAS, null: NULL };\n\n/** The keys that shape what is drawn: a layer that is never drawn (audio, a camera, a light) accepts them in its type but they do nothing there. */\nconst PICTURE_KEYS = ['filters', 'filterArea', 'mask', 'blendMode', 'threeD', 'hideBehindCamera', 'lit', 'castsShadows'] as const;\nconst NOT_DRAWN: Record<string, string> = {\n audio: 'an audio layer: it is not drawn (it plays)',\n camera: 'a camera layer: it is not drawn, it frames the picture (its place and lens go in `initial` / `keyframes`: x y z lookAtX … fov)',\n light: 'a light layer: it is not drawn, it lights `threeD` layers (its numbers go in `initial` / `keyframes`: intensity color …)',\n};\n\n/** For a layer that is never drawn: the picture keys it carries, each with what the layer is (the keys do nothing there). A light keeps `castsShadows`, its own switch. */\nexport function pictureKeysIgnored(spec: { type: string } & Record<string, unknown>): Array<{ key: string; why: string }> {\n const why = NOT_DRAWN[spec.type];\n if (!why) return [];\n return PICTURE_KEYS.filter(k => spec[k] !== undefined && !(spec.type === 'light' && k === 'castsShadows')).map(key => ({ key, why }));\n}\n\n/** What a layer may be called, for the message: `text layer`, `rect shape`. */\nexport function kindName(spec: { type: string; shape?: string }): string {\n return spec.type === 'shape' && spec.shape ? `${spec.shape} shape` : `${spec.type} layer`;\n}\n\n/** The keys a layer may have, or null for a kind this library does not know (a `three` layer: registered elsewhere, so not checked). */\nexport function layerKeys(spec: { type: string; shape?: string }): readonly string[] | null {\n if (spec.type === 'shape') return (spec.shape && SHAPES[spec.shape]) || null;\n return BY_TYPE[spec.type] ?? null;\n}\n\n/** Which kinds have `key` (for \"it belongs to a circle shape\"). */\nexport function kindsWithKey(key: string): string[] {\n const out: string[] = [];\n for (const [shape, keys] of Object.entries(SHAPES)) if (keys.includes(key)) out.push(`${shape} shape`);\n for (const [type, keys] of Object.entries(BY_TYPE)) if (keys.includes(key)) out.push(`${type} layer`);\n return out;\n}\n\n/** Names a keyframe or `initial` may animate. Dotted paths (`filters.g.amount`, `three.box.x`) belong to their routers and are not looked up here. */\nexport const PROP_KEYS: ReadonlySet<string> = new Set([\n // transform and look\n 'x', 'y', 'z', 'alpha', 'rotation', 'rotationX', 'rotationY', 'width', 'height', 'visible', 'autoAlpha',\n 'scale', 'scaleX', 'scaleY', 'anchor', 'anchorX', 'anchorY', 'pivot', 'pivotX', 'pivotY', 'skew', 'skewX', 'skewY',\n 'position', 'positionX', 'positionY', 'tilePosition', 'tilePositionX', 'tilePositionY', 'tileScale', 'tileScaleX', 'tileScaleY', 'tint',\n // shapes\n 'fillColor', 'fillAlpha', 'strokeColor', 'strokeAlpha', 'strokeWidth', 'cornerRadius', 'radius', 'radiusX', 'radiusY',\n 'innerRadius', 'startAngle', 'endAngle', 'trimStart', 'trimEnd', 'trimEach', 'morph', 'fillGradient', 'strokeCap', 'strokeJoin',\n // text, audio, video\n 'fill', 'value', 'visibleChars', 'text', 'volume', 'time',\n // camera\n 'lookAtX', 'lookAtY', 'lookAtZ', 'fov', 'focus', 'aperture', 'offsetX', 'offsetY', 'offsetZ', 'lookOffsetX', 'lookOffsetY', 'lookOffsetZ',\n // light + fog\n 'intensity', 'color', 'coneAngle', 'coneFeather', 'falloffDistance', 'shadowDarkness', 'shadowDiffusion', 'fogNear', 'fogFar', 'fogColor', 'fogAmount',\n]);\n\n/** The text `style` keys (PixiJS TextStyle) that this library passes on. */\nexport const STYLE_KEYS: readonly string[] = [\n 'fontSize', 'fontFamily', 'fontWeight', 'fontStyle', 'fontVariant', 'fill', 'stroke', 'dropShadow', 'letterSpacing', 'lineHeight', 'leading',\n 'align', 'wordWrap', 'wordWrapWidth', 'breakWords', 'whiteSpace', 'padding', 'textBaseline', 'trim', 'lineJoin', 'miterLimit', 'filters', 'tagStyles',\n];\n\nexport type { SequenceSpec };\n","import type { SequenceSpec } from '../types';\nimport { collectPropKeys } from '../space/specKeys';\nimport { suggestName } from './options';\nimport { layerKeys, kindName, kindsWithKey, pictureKeysIgnored, PROP_KEYS, STYLE_KEYS } from './layerKeys';\n\ntype Warn = (message: string, kind?: 'late-keyframe') => void;\nconst defaultWarn: Warn = m => console.warn(m);\n\n/** \"layer \"name\"\" or \"unnamed text layer\" — how warnings refer to a sequence. */\nexport function describeLayer(spec: { name?: string; type: string }): string {\n return spec.name ? `layer \"${spec.name}\"` : `unnamed ${spec.type} layer`;\n}\n\n/**\n * Timing mistakes that otherwise fail silently: a layer that starts after its\n * composition has ended, or a keyframe that starts after its own layer has\n * ended (the usual cause: writing keyframe `at` in composition time instead of\n * time since the start of the layer).\n */\nexport function lintTiming(spec: SequenceSpec, parentDuration: number, warn: Warn = defaultWarn): void {\n const who = describeLayer(spec);\n const at = spec.at ?? 0;\n if (at >= parentDuration) {\n warn(`pixi-effects: ${who} starts at ${at}s, after its composition ends (${parentDuration}s), so it is never visible`);\n }\n // An sfx or a piece of music without a duration is as long as its sound, which only the audio layer knows (it checks its own keyframes).\n if (spec.type === 'audio' && ((spec as { sfx?: unknown }).sfx !== undefined || (spec as { music?: unknown }).music !== undefined) && spec.duration === undefined) return;\n if (at >= parentDuration) return; // never visible: said above, and its keyframes say nothing more\n const lives = spec.duration ?? Math.max(0, parentDuration - at); // without a duration a layer lives until its composition ends\n const ms = (x: number) => Math.round(x * 1000) / 1000;\n (spec.keyframes ?? []).forEach((kf, i) => {\n const kat = kf.at ?? 0;\n if (kat >= lives) {\n warn(\n `pixi-effects: ${who}: keyframes[${i}] starts at ${kat}s, after the layer ends (duration ${ms(lives)}s), so it never plays. ` +\n `Keyframe \\`at\\` is measured from the start of this layer, not from the start of the composition.`,\n 'late-keyframe',\n );\n return;\n }\n // Starts in time but is cut off by the layer's end: a FADE (to alpha 0 or 1, or from 0 / 1) that never finishes (a trial: a fade-out that stopped half way, a 1.2 s fade-in on a 0.6 s layer).\n // Not a drift, a fall, a zoom or a decaying glow (to 0.22) that is still going when its layer ends: those are common and on purpose. A `set` is instant, a repeating tween\n // (a blink) and a spring ('auto') are meant to run over, and a cut of under 0.2 s (a few frames: the last keyframe of a generated loop) is nothing.\n const length = kf.duration;\n // a fade ends (almost) opaque or (almost) clear: `to` alpha, or, when only `from` names alpha, the value it fades from (a fade-in `from: { alpha: 0 }` ends where it was)\n const toAlpha = (kf.to as Record<string, unknown> | undefined)?.alpha;\n const fromAlpha = (kf.from as Record<string, unknown> | undefined)?.alpha;\n const nearEnd = (v: unknown) => typeof v === 'number' && (v <= 0.1 || v >= 0.9);\n const fade = toAlpha !== undefined ? nearEnd(toAlpha) : nearEnd(fromAlpha);\n if (fade && typeof length === 'number' && length > 0 && !kf.repeat) {\n const start = kat < 0 ? lives + kat : kat; // a negative `at` counts back from the end of the layer\n const cut = (start + length - lives) / length;\n if (start >= 0 && cut > 0.25 && cut * length >= 0.2) {\n warn(\n `pixi-effects: ${who}: keyframes[${i}] runs from ${ms(start)}s to ${ms(start + length)}s but the layer ends at ${ms(lives)}s, so the last ${Math.round(cut * 100)}% of it never plays ` +\n `(a fade stops half way). Keyframe \\`at\\` is measured from the start of this layer: start it earlier, make it shorter, or make the layer longer.`,\n 'late-keyframe',\n );\n }\n }\n });\n}\n\n/**\n * A loop that builds a hundred layers makes the same mistake a hundred times. Print the first few in full and\n * say how many more there are: the rest are the same loop.\n */\nexport function summarizeWarnings(messages: string[], shown = 3): string[] {\n if (messages.length <= shown) return messages;\n 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.`];\n}\n\n/** A text layer that animates `value` but has nowhere to print it. */\nexport function lintText(spec: SequenceSpec, warn: Warn = defaultWarn): void {\n if (spec.type !== 'text') return;\n // Every string the layer ever shows: its `text` and any `set: { text }` swap.\n const strings = [spec.text ?? '', ...(spec.keyframes ?? []).map(kf => String((kf.set as Record<string, unknown> | undefined)?.text ?? ''))];\n const hasPlaceholder = strings.some(t => t.includes('{value}'));\n if (hasPlaceholder && !collectPropKeys(spec).has('value')) {\n warn(`pixi-effects: ${describeLayer(spec)}: the text has a {value} placeholder but nothing sets or animates \\`value\\`, so it prints 0. Set initial: { value: … } or animate it; {value} is reserved for counters (there is no way to print a literal \"{value}\").`);\n }\n if (collectPropKeys(spec).has('value') && !hasPlaceholder) {\n 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').`);\n }\n}\n\nconst REMAPPABLE = new Set(['video', 'audio', 'composition']);\n/** Top-level names that mean a time remap and have their own message. */\nconst REMAP_NAMES = new Set(['time', 'timeRemap', 'reverse']);\nconst TIME_BAGS = ['set', 'to', 'from'] as const;\n\n/** The mistakes a time remap can make (`speed` / `time`), said once when the layer is built. Called from `lintKeys`. */\nfunction lintRemap(spec: SequenceSpec, warn: Warn): void {\n const s = spec as unknown as Record<string, any>;\n const who = describeLayer(spec);\n const kfs: Array<Record<string, any>> = s.keyframes ?? [];\n const bags: Array<Record<string, any> | undefined> = [s.initial, ...kfs.flatMap(kf => TIME_BAGS.map(b => kf[b]))];\n const timeInInitial = !!s.initial && s.initial.time !== undefined;\n const timeInKeyframes = kfs.some(kf => TIME_BAGS.some(b => kf[b] && kf[b].time !== undefined));\n const timed = timeInInitial || timeInKeyframes;\n if (bags.some(bag => bag && bag.speed !== undefined)) {\n 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' }])`);\n }\n if (!REMAPPABLE.has(spec.type)) {\n 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)`);\n return; // a top-level speed here is the key warning's business (\"not a ... key\")\n }\n if (s.reverse !== undefined) warn(`pixi-effects: ${who}: \"reverse\" is not a key: write speed: -1 to play backward`);\n if (s.timeRemap !== undefined) warn(`pixi-effects: ${who}: \"timeRemap\" is not a key: animate time in keyframes (from / to / set), or write speed`);\n if (s.time !== undefined) warn(`pixi-effects: ${who}: \"time\" belongs in initial or keyframes (initial: { time: 2 }), not on the layer`);\n if (spec.type === 'audio' && (s.sfx !== undefined || s.music !== undefined) && (s.speed !== undefined || timed)) {\n 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`);\n return;\n }\n if (s.speed !== undefined && (typeof s.speed !== 'number' || !Number.isFinite(s.speed) || s.speed === 0)) {\n 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`);\n }\n if (s.speed !== undefined && timeInKeyframes) {\n warn(`pixi-effects: ${who}: speed and keyframed time are both set; time wins and speed is ignored. Use one of them`);\n }\n if (timeInInitial && typeof s.initial.time !== 'number') {\n warn(`pixi-effects: ${who}: initial.time must be a number of seconds, got ${JSON.stringify(s.initial.time)}`);\n }\n kfs.forEach((kf, i) => {\n for (const b of TIME_BAGS) {\n const v = kf[b]?.time;\n if (v !== undefined && typeof v !== 'number' && typeof v !== 'string') warn(`pixi-effects: ${who}: keyframes[${i}].${b}.time must be a number of seconds, got ${JSON.stringify(v)}`);\n }\n });\n}\n\n/**\n * Keys that do not exist, which the library used to ignore without a word (a typo in a layer key, a mistyped property in a keyframe, a\n * style key Pixi does not know). Said once each, with what was probably meant. A warning, never an error. Not checked here: dotted\n * paths (`filters.g.amount`, `three.box.x`: their routers say what is wrong), the names `fillGradient` says itself (`gradientAngle`),\n * and a kind of layer registered elsewhere (`three`).\n */\n/** Keys the library used to have: the sentence says what to write now. */\nconst REMOVED_KEYS: Record<string, string> = {\n maskInverted: 'a hole instead of a crop is `mask: { layer: <the mask layer>, invert: true }`',\n};\n\n/** The knobs of a sound effect: they are keys of `sfx: { … }`, not of the layer. */\nconst SFX_KNOBS = new Set(['pitch', 'brightness', 'seed']);\n\n/** Where a layer is and how it is turned: always `initial` or a keyframe, even for a kind of layer that has such a name as a key of another meaning (`anchorX` on a shape). */\nconst TRANSFORM_KEYS = new Set(['x', 'y', 'z', 'alpha', 'rotation', 'rotationX', 'rotationY', 'scale', 'scaleX', 'scaleY', 'anchor', 'anchorX', 'anchorY',\n 'pivot', 'pivotX', 'pivotY', 'skew', 'skewX', 'skewY', 'position', 'positionX', 'positionY', 'tint', 'visible', 'autoAlpha']);\n\nexport function lintKeys(spec: SequenceSpec, warn: Warn = defaultWarn): void {\n const who = describeLayer(spec);\n const valid = layerKeys(spec as { type: string; shape?: string });\n if (valid) {\n for (const key of Object.keys(spec)) {\n if (valid.includes(key) || (spec as unknown as Record<string, unknown>)[key] === undefined) continue; // a spread that sets a key only when it applies leaves `undefined`\n if (REMAPPABLE.has(spec.type) && REMAP_NAMES.has(key)) continue; // lintRemap has its own message for these\n if (REMOVED_KEYS[key]) { warn(`pixi-effects: ${who}: \"${key}\" is not a ${kindName(spec as { type: string; shape?: string })} key: ${REMOVED_KEYS[key]}`); continue; }\n // `pitch`, `brightness`, `seed` are knobs of the sound effect, they go inside `sfx` (a trial: three agents wrote them beside `sfx:`)\n if (spec.type === 'audio' && SFX_KNOBS.has(key) && (spec as { sfx?: unknown }).sfx !== undefined) {\n const sfx = (spec as { sfx?: unknown }).sfx;\n const preset = typeof sfx === 'string' ? sfx : (sfx as { preset?: string } | null)?.preset;\n const v = (spec as unknown as Record<string, unknown>)[key];\n const shown = typeof v === 'number' || (typeof v === 'string' && v.length <= 24) ? JSON.stringify(v) : '…';\n warn(`pixi-effects: ${who}: \"${key}\" is a knob of the sound effect, so it is ignored beside \\`sfx\\`: write it inside — sfx: { ${preset ? `preset: '${preset}', ` : ''}${key}: ${shown} }${key === 'pitch' ? ' (pitch is in semitones, ±24: 12 is an octave up)' : key === 'brightness' ? ' (brightness is −1 dark … 1 bright)' : ''}`);\n continue;\n }\n // `z`, `x`, `alpha`, `rotationX` … are properties of the picture: they go in `initial` (or a keyframe), not on the layer. Say that, not a guess at another key.\n if (TRANSFORM_KEYS.has(key) || (PROP_KEYS.has(key) && kindsWithKey(key).length === 0)) { // (a key some other kind of layer owns, `radius` on a rect, keeps its \"it belongs to\" sentence below)\n const v = (spec as unknown as Record<string, unknown>)[key];\n const shown = typeof v === 'number' || (typeof v === 'string' && v.length <= 24) ? JSON.stringify(v) : '…';\n warn(`pixi-effects: ${who}: \"${key}\" is a property, not a ${kindName(spec as { type: string; shape?: string })} key, so it is ignored: write it in initial (initial: { ${key}: ${shown} }) or in a keyframe`);\n continue;\n }\n const guess = suggestName(key, valid.filter(k => k !== 'type'));\n const owners = kindsWithKey(key);\n const belongs = owners.length ? ` (it belongs to ${owners.slice(0, 3).join(', ')})` : '';\n const hint = guess ? ` — did you mean \"${guess}\"?${belongs}` : belongs;\n warn(`pixi-effects: ${who}: \"${key}\" is not a ${kindName(spec as { type: string; shape?: string })} key${hint}. Valid keys: ${valid.join(', ')}`);\n }\n }\n for (const { key, why } of pictureKeysIgnored(spec as unknown as { type: string } & Record<string, unknown>)) warn(`pixi-effects: ${who}: \"${key}\" does nothing on ${why}`);\n lintRemap(spec, warn);\n const said = new Set<string>();\n const bags: Array<Record<string, unknown> | undefined> = [spec.initial, ...(spec.keyframes ?? []).flatMap(kf => [kf.set, kf.to, kf.from])] as Array<Record<string, unknown> | undefined>;\n for (const bag of bags) {\n for (const key of Object.keys(bag ?? {})) {\n if (bag![key] === undefined) continue;\n if (PROP_KEYS.has(key) || key.includes('.') || /^gradient/i.test(key) || said.has(key) || key === 'speed') continue; // (speed: lintRemap says what to write)\n said.add(key);\n const guess = suggestName(key, [...PROP_KEYS]);\n warn(`pixi-effects: ${who}: \"${key}\" is not an animatable property${guess ? ` — did you mean \"${guess}\"?` : ''} (in initial, set, to or from). See the cheatsheet for the properties of this kind of layer`);\n }\n }\n if (spec.type === 'text' && spec.style && typeof spec.style === 'object') {\n for (const key of Object.keys(spec.style)) {\n if (STYLE_KEYS.includes(key) || (spec.style as Record<string, unknown>)[key] === undefined) continue;\n const guess = suggestName(key, STYLE_KEYS);\n warn(`pixi-effects: ${who}: style.${key} is not a text style key${guess ? ` — did you mean \"${guess}\"?` : ''} (it is ignored). Keys: ${STYLE_KEYS.join(', ')}`);\n }\n }\n}\n"]}
|
|
@@ -273,6 +273,7 @@ function lintRemap(spec, warn) {
|
|
|
273
273
|
var REMOVED_KEYS = {
|
|
274
274
|
maskInverted: "a hole instead of a crop is `mask: { layer: <the mask layer>, invert: true }`"
|
|
275
275
|
};
|
|
276
|
+
var SFX_KNOBS = /* @__PURE__ */ new Set(["pitch", "brightness", "seed"]);
|
|
276
277
|
var TRANSFORM_KEYS = /* @__PURE__ */ new Set([
|
|
277
278
|
"x",
|
|
278
279
|
"y",
|
|
@@ -311,6 +312,14 @@ function lintKeys(spec, warn = defaultWarn) {
|
|
|
311
312
|
warn(`pixi-effects: ${who}: "${key}" is not a ${kindName(spec)} key: ${REMOVED_KEYS[key]}`);
|
|
312
313
|
continue;
|
|
313
314
|
}
|
|
315
|
+
if (spec.type === "audio" && SFX_KNOBS.has(key) && spec.sfx !== void 0) {
|
|
316
|
+
const sfx = spec.sfx;
|
|
317
|
+
const preset = typeof sfx === "string" ? sfx : sfx?.preset;
|
|
318
|
+
const v = spec[key];
|
|
319
|
+
const shown = typeof v === "number" || typeof v === "string" && v.length <= 24 ? JSON.stringify(v) : "\u2026";
|
|
320
|
+
warn(`pixi-effects: ${who}: "${key}" is a knob of the sound effect, so it is ignored beside \`sfx\`: write it inside \u2014 sfx: { ${preset ? `preset: '${preset}', ` : ""}${key}: ${shown} }${key === "pitch" ? " (pitch is in semitones, \xB124: 12 is an octave up)" : key === "brightness" ? " (brightness is \u22121 dark \u2026 1 bright)" : ""}`);
|
|
321
|
+
continue;
|
|
322
|
+
}
|
|
314
323
|
if (TRANSFORM_KEYS.has(key) || PROP_KEYS.has(key) && kindsWithKey(key).length === 0) {
|
|
315
324
|
const v = spec[key];
|
|
316
325
|
const shown = typeof v === "number" || typeof v === "string" && v.length <= 24 ? JSON.stringify(v) : "\u2026";
|
|
@@ -347,5 +356,5 @@ function lintKeys(spec, warn = defaultWarn) {
|
|
|
347
356
|
}
|
|
348
357
|
|
|
349
358
|
export { collectPropKeys, describeLayer, lintKeys, lintText, lintTiming, summarizeWarnings };
|
|
350
|
-
//# sourceMappingURL=chunk-
|
|
351
|
-
//# sourceMappingURL=chunk-
|
|
359
|
+
//# sourceMappingURL=chunk-NVKHUAHU.js.map
|
|
360
|
+
//# sourceMappingURL=chunk-NVKHUAHU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/space/specKeys.ts","../src/core/layerKeys.ts","../src/core/lint.ts"],"names":[],"mappings":";;;AAGO,SAAS,gBAAgB,IAAA,EAGhB;AACd,EAAA,MAAM,GAAA,uBAAU,GAAA,EAAY;AAC5B,EAAA,KAAA,MAAW,CAAA,IAAK,MAAA,CAAO,IAAA,CAAK,IAAA,CAAK,OAAA,IAAW,EAAE,CAAA,EAAG,GAAA,CAAI,GAAA,CAAI,CAAC,CAAA;AAC1D,EAAA,KAAA,MAAW,EAAA,IAAM,IAAA,CAAK,SAAA,IAAa,EAAC,EAAG;AACrC,IAAA,KAAA,MAAW,GAAA,IAAO,CAAC,EAAA,CAA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IAAI,GAAG,CAAA;AACZ,MAAA,MAAM,QAAQ,WAAA,CAAY,GAAA,EAAK,CAAC,GAAG,SAAS,CAAC,CAAA;AAC7C,MAAA,IAAA,CAAK,CAAA,cAAA,EAAiB,GAAG,CAAA,GAAA,EAAM,GAAG,CAAA,+BAAA,EAAkC,QAAQ,CAAA,sBAAA,EAAoB,KAAK,CAAA,EAAA,CAAA,GAAO,EAAE,CAAA,2FAAA,CAA6F,CAAA;AAAA,IAC7M;AAAA,EACF;AACA,EAAA,IAAI,IAAA,CAAK,SAAS,MAAA,IAAU,IAAA,CAAK,SAAS,OAAO,IAAA,CAAK,UAAU,QAAA,EAAU;AACxE,IAAA,KAAA,MAAW,GAAA,IAAO,MAAA,CAAO,IAAA,CAAK,IAAA,CAAK,KAAK,CAAA,EAAG;AACzC,MAAA,IAAI,UAAA,CAAW,SAAS,GAAG,CAAA,IAAM,KAAK,KAAA,CAAkC,GAAG,MAAM,MAAA,EAAW;AAC5F,MAAA,MAAM,KAAA,GAAQ,WAAA,CAAY,GAAA,EAAK,UAAU,CAAA;AACzC,MAAA,IAAA,CAAK,CAAA,cAAA,EAAiB,GAAG,CAAA,QAAA,EAAW,GAAG,2BAA2B,KAAA,GAAQ,CAAA,sBAAA,EAAoB,KAAK,CAAA,EAAA,CAAA,GAAO,EAAE,CAAA,wBAAA,EAA2B,UAAA,CAAW,IAAA,CAAK,IAAI,CAAC,CAAA,CAAE,CAAA;AAAA,IAChK;AAAA,EACF;AACF","file":"chunk-NVKHUAHU.js","sourcesContent":["import type { Keyframe } from '../types';\n\n/** Every prop key a spec touches in `initial` and in keyframe `set` / `to` / `from`. */\nexport function collectPropKeys(spec: {\n initial?: Record<string, unknown>;\n keyframes?: Keyframe[];\n}): Set<string> {\n const out = new Set<string>();\n for (const k of Object.keys(spec.initial ?? {})) out.add(k);\n for (const kf of spec.keyframes ?? []) {\n for (const bag of [kf.set, kf.to, kf.from]) {\n for (const k of Object.keys(bag ?? {})) out.add(k);\n }\n }\n return out;\n}\n","import type {\n SequenceCommon, VideoSequenceSpec, ImageSequenceSpec, TextSequenceSpec, AudioAssetSpec, AudioSfxSpec, AudioMusicSpec,\n CompositionSequenceSpec, CameraSequenceSpec, LightSequenceSpec, ShaderSequenceSpec, CanvasSequenceSpec, NullSequenceSpec, SequenceSpec,\n RectShapeSpec, CircleShapeSpec, EllipseShapeSpec, ArcShapeSpec, LineShapeSpec, PolygonShapeSpec, PathShapeSpec,\n} from '../types';\n\n/**\n * The keys a layer of each kind may have, for `lintKeys`. They are tables of names, so each one is checked against its type twice, by\n * the compiler: `satisfies` rejects a name the type does not have, and `Covers` fails the build when the type has a key the table lacks\n * (add a key to a spec type and `tsc` tells you to add it here, so the warning never calls a real key unknown).\n */\ntype KeysOfUnion<T> = T extends unknown ? keyof T : never;\ntype Covers<T, K extends readonly string[]> = [Exclude<KeysOfUnion<T>, K[number]>] extends [never] ? true : { missing: Exclude<KeysOfUnion<T>, K[number]> };\ntype Assert<T extends true> = T;\n\nconst COMMON = ['type', 'name', 'parent', 'at', 'duration', 'initial', 'keyframes', 'filters', 'filterArea', 'mask', 'blendMode', 'threeD', 'hideBehindCamera', 'lit', 'castsShadows'] as const satisfies readonly KeysOfUnion<SequenceCommon | { type: string }>[];\n\nconst VIDEO = [...COMMON, 'asset', 'loop', 'audio', 'volume', 'speed'] as const satisfies readonly KeysOfUnion<VideoSequenceSpec>[];\nconst IMAGE = [...COMMON, 'asset', 'colorSpace', 'scaleMode'] as const satisfies readonly KeysOfUnion<ImageSequenceSpec>[];\nconst TEXT = [...COMMON, 'text', 'spans', 'format', 'resolution', 'style', 'colorSpace', 'fillGradient'] as const satisfies readonly KeysOfUnion<TextSequenceSpec>[];\nconst AUDIO = [...COMMON, 'volume', 'asset', 'loop', 'sfx', 'music', 'speed'] as const satisfies readonly KeysOfUnion<AudioAssetSpec | AudioSfxSpec | AudioMusicSpec>[];\nconst COMPOSITION = [...COMMON, 'width', 'height', 'sequences', 'transitions', 'speed'] as const satisfies readonly KeysOfUnion<CompositionSequenceSpec>[];\nconst CAMERA = [...COMMON] as const satisfies readonly KeysOfUnion<CameraSequenceSpec>[];\nconst LIGHT = [...COMMON, 'kind', 'falloff'] as const satisfies readonly KeysOfUnion<LightSequenceSpec>[];\nconst SHADER = [...COMMON, 'fragment', 'uniforms', 'width', 'height', 'resolution', 'transparent'] as const satisfies readonly KeysOfUnion<ShaderSequenceSpec>[];\nconst CANVAS = [...COMMON, 'draw', 'setup', 'width', 'height', 'resolution', 'params', 'seed', 'smoothing'] as const satisfies readonly KeysOfUnion<CanvasSequenceSpec>[];\nconst NULL = [...COMMON] as const satisfies readonly KeysOfUnion<NullSequenceSpec>[];\n\nconst SHAPE = [...COMMON, 'shape', 'fillGradient', 'colorSpace', 'strokeCap', 'strokeJoin'] as const;\nconst TRIM = ['trimStart', 'trimEnd', 'trimEach'] as const;\nconst RECT = [...SHAPE, ...TRIM, 'width', 'height', 'cornerRadius', 'anchorX', 'anchorY'] as const satisfies readonly KeysOfUnion<RectShapeSpec>[];\nconst CIRCLE = [...SHAPE, ...TRIM, 'radius', 'anchorX', 'anchorY'] as const satisfies readonly KeysOfUnion<CircleShapeSpec>[];\nconst ELLIPSE = [...SHAPE, ...TRIM, 'radiusX', 'radiusY', 'anchorX', 'anchorY'] as const satisfies readonly KeysOfUnion<EllipseShapeSpec>[];\nconst ARC = [...SHAPE, 'radius', 'innerRadius', 'startAngle', 'endAngle'] as const satisfies readonly KeysOfUnion<ArcShapeSpec>[];\nconst LINE = [...SHAPE, ...TRIM, 'from', 'to'] as const satisfies readonly KeysOfUnion<LineShapeSpec>[];\nconst POLYGON = [...SHAPE, ...TRIM, 'points', 'open'] as const satisfies readonly KeysOfUnion<PolygonShapeSpec>[];\nconst PATH = [...SHAPE, ...TRIM, 'd', 'fillRule', 'morphTo', 'morph', 'morphPoints'] as const satisfies readonly KeysOfUnion<PathShapeSpec>[];\n\n/** The compiler checks every table covers its type (this type is never used: it exists to fail the build). */\nexport type __Covered = [\n Assert<Covers<VideoSequenceSpec, typeof VIDEO>>, Assert<Covers<ImageSequenceSpec, typeof IMAGE>>, Assert<Covers<TextSequenceSpec, typeof TEXT>>,\n Assert<Covers<AudioAssetSpec | AudioSfxSpec | AudioMusicSpec, typeof AUDIO>>, Assert<Covers<CompositionSequenceSpec, typeof COMPOSITION>>,\n Assert<Covers<CameraSequenceSpec, typeof CAMERA>>, Assert<Covers<LightSequenceSpec, typeof LIGHT>>, Assert<Covers<ShaderSequenceSpec, typeof SHADER>>, Assert<Covers<CanvasSequenceSpec, typeof CANVAS>>, Assert<Covers<NullSequenceSpec, typeof NULL>>,\n Assert<Covers<RectShapeSpec, typeof RECT>>, Assert<Covers<CircleShapeSpec, typeof CIRCLE>>, Assert<Covers<EllipseShapeSpec, typeof ELLIPSE>>,\n Assert<Covers<ArcShapeSpec, typeof ARC>>, Assert<Covers<LineShapeSpec, typeof LINE>>, Assert<Covers<PolygonShapeSpec, typeof POLYGON>>,\n Assert<Covers<PathShapeSpec, typeof PATH>>,\n];\n\nconst SHAPES: Record<string, readonly string[]> = { rect: RECT, circle: CIRCLE, ellipse: ELLIPSE, arc: ARC, line: LINE, polygon: POLYGON, path: PATH };\nconst BY_TYPE: Record<string, readonly string[]> = { video: VIDEO, image: IMAGE, text: TEXT, audio: AUDIO, composition: COMPOSITION, camera: CAMERA, light: LIGHT, shader: SHADER, canvas: CANVAS, null: NULL };\n\n/** The keys that shape what is drawn: a layer that is never drawn (audio, a camera, a light) accepts them in its type but they do nothing there. */\nconst PICTURE_KEYS = ['filters', 'filterArea', 'mask', 'blendMode', 'threeD', 'hideBehindCamera', 'lit', 'castsShadows'] as const;\nconst NOT_DRAWN: Record<string, string> = {\n audio: 'an audio layer: it is not drawn (it plays)',\n camera: 'a camera layer: it is not drawn, it frames the picture (its place and lens go in `initial` / `keyframes`: x y z lookAtX … fov)',\n light: 'a light layer: it is not drawn, it lights `threeD` layers (its numbers go in `initial` / `keyframes`: intensity color …)',\n};\n\n/** For a layer that is never drawn: the picture keys it carries, each with what the layer is (the keys do nothing there). A light keeps `castsShadows`, its own switch. */\nexport function pictureKeysIgnored(spec: { type: string } & Record<string, unknown>): Array<{ key: string; why: string }> {\n const why = NOT_DRAWN[spec.type];\n if (!why) return [];\n return PICTURE_KEYS.filter(k => spec[k] !== undefined && !(spec.type === 'light' && k === 'castsShadows')).map(key => ({ key, why }));\n}\n\n/** What a layer may be called, for the message: `text layer`, `rect shape`. */\nexport function kindName(spec: { type: string; shape?: string }): string {\n return spec.type === 'shape' && spec.shape ? `${spec.shape} shape` : `${spec.type} layer`;\n}\n\n/** The keys a layer may have, or null for a kind this library does not know (a `three` layer: registered elsewhere, so not checked). */\nexport function layerKeys(spec: { type: string; shape?: string }): readonly string[] | null {\n if (spec.type === 'shape') return (spec.shape && SHAPES[spec.shape]) || null;\n return BY_TYPE[spec.type] ?? null;\n}\n\n/** Which kinds have `key` (for \"it belongs to a circle shape\"). */\nexport function kindsWithKey(key: string): string[] {\n const out: string[] = [];\n for (const [shape, keys] of Object.entries(SHAPES)) if (keys.includes(key)) out.push(`${shape} shape`);\n for (const [type, keys] of Object.entries(BY_TYPE)) if (keys.includes(key)) out.push(`${type} layer`);\n return out;\n}\n\n/** Names a keyframe or `initial` may animate. Dotted paths (`filters.g.amount`, `three.box.x`) belong to their routers and are not looked up here. */\nexport const PROP_KEYS: ReadonlySet<string> = new Set([\n // transform and look\n 'x', 'y', 'z', 'alpha', 'rotation', 'rotationX', 'rotationY', 'width', 'height', 'visible', 'autoAlpha',\n 'scale', 'scaleX', 'scaleY', 'anchor', 'anchorX', 'anchorY', 'pivot', 'pivotX', 'pivotY', 'skew', 'skewX', 'skewY',\n 'position', 'positionX', 'positionY', 'tilePosition', 'tilePositionX', 'tilePositionY', 'tileScale', 'tileScaleX', 'tileScaleY', 'tint',\n // shapes\n 'fillColor', 'fillAlpha', 'strokeColor', 'strokeAlpha', 'strokeWidth', 'cornerRadius', 'radius', 'radiusX', 'radiusY',\n 'innerRadius', 'startAngle', 'endAngle', 'trimStart', 'trimEnd', 'trimEach', 'morph', 'fillGradient', 'strokeCap', 'strokeJoin',\n // text, audio, video\n 'fill', 'value', 'visibleChars', 'text', 'volume', 'time',\n // camera\n 'lookAtX', 'lookAtY', 'lookAtZ', 'fov', 'focus', 'aperture', 'offsetX', 'offsetY', 'offsetZ', 'lookOffsetX', 'lookOffsetY', 'lookOffsetZ',\n // light + fog\n 'intensity', 'color', 'coneAngle', 'coneFeather', 'falloffDistance', 'shadowDarkness', 'shadowDiffusion', 'fogNear', 'fogFar', 'fogColor', 'fogAmount',\n]);\n\n/** The text `style` keys (PixiJS TextStyle) that this library passes on. */\nexport const STYLE_KEYS: readonly string[] = [\n 'fontSize', 'fontFamily', 'fontWeight', 'fontStyle', 'fontVariant', 'fill', 'stroke', 'dropShadow', 'letterSpacing', 'lineHeight', 'leading',\n 'align', 'wordWrap', 'wordWrapWidth', 'breakWords', 'whiteSpace', 'padding', 'textBaseline', 'trim', 'lineJoin', 'miterLimit', 'filters', 'tagStyles',\n];\n\nexport type { SequenceSpec };\n","import type { SequenceSpec } from '../types';\nimport { collectPropKeys } from '../space/specKeys';\nimport { suggestName } from './options';\nimport { layerKeys, kindName, kindsWithKey, pictureKeysIgnored, PROP_KEYS, STYLE_KEYS } from './layerKeys';\n\ntype Warn = (message: string, kind?: 'late-keyframe') => void;\nconst defaultWarn: Warn = m => console.warn(m);\n\n/** \"layer \"name\"\" or \"unnamed text layer\" — how warnings refer to a sequence. */\nexport function describeLayer(spec: { name?: string; type: string }): string {\n return spec.name ? `layer \"${spec.name}\"` : `unnamed ${spec.type} layer`;\n}\n\n/**\n * Timing mistakes that otherwise fail silently: a layer that starts after its\n * composition has ended, or a keyframe that starts after its own layer has\n * ended (the usual cause: writing keyframe `at` in composition time instead of\n * time since the start of the layer).\n */\nexport function lintTiming(spec: SequenceSpec, parentDuration: number, warn: Warn = defaultWarn): void {\n const who = describeLayer(spec);\n const at = spec.at ?? 0;\n if (at >= parentDuration) {\n warn(`pixi-effects: ${who} starts at ${at}s, after its composition ends (${parentDuration}s), so it is never visible`);\n }\n // An sfx or a piece of music without a duration is as long as its sound, which only the audio layer knows (it checks its own keyframes).\n if (spec.type === 'audio' && ((spec as { sfx?: unknown }).sfx !== undefined || (spec as { music?: unknown }).music !== undefined) && spec.duration === undefined) return;\n if (at >= parentDuration) return; // never visible: said above, and its keyframes say nothing more\n const lives = spec.duration ?? Math.max(0, parentDuration - at); // without a duration a layer lives until its composition ends\n const ms = (x: number) => Math.round(x * 1000) / 1000;\n (spec.keyframes ?? []).forEach((kf, i) => {\n const kat = kf.at ?? 0;\n if (kat >= lives) {\n warn(\n `pixi-effects: ${who}: keyframes[${i}] starts at ${kat}s, after the layer ends (duration ${ms(lives)}s), so it never plays. ` +\n `Keyframe \\`at\\` is measured from the start of this layer, not from the start of the composition.`,\n 'late-keyframe',\n );\n return;\n }\n // Starts in time but is cut off by the layer's end: a FADE (to alpha 0 or 1, or from 0 / 1) that never finishes (a trial: a fade-out that stopped half way, a 1.2 s fade-in on a 0.6 s layer).\n // Not a drift, a fall, a zoom or a decaying glow (to 0.22) that is still going when its layer ends: those are common and on purpose. A `set` is instant, a repeating tween\n // (a blink) and a spring ('auto') are meant to run over, and a cut of under 0.2 s (a few frames: the last keyframe of a generated loop) is nothing.\n const length = kf.duration;\n // a fade ends (almost) opaque or (almost) clear: `to` alpha, or, when only `from` names alpha, the value it fades from (a fade-in `from: { alpha: 0 }` ends where it was)\n const toAlpha = (kf.to as Record<string, unknown> | undefined)?.alpha;\n const fromAlpha = (kf.from as Record<string, unknown> | undefined)?.alpha;\n const nearEnd = (v: unknown) => typeof v === 'number' && (v <= 0.1 || v >= 0.9);\n const fade = toAlpha !== undefined ? nearEnd(toAlpha) : nearEnd(fromAlpha);\n if (fade && typeof length === 'number' && length > 0 && !kf.repeat) {\n const start = kat < 0 ? lives + kat : kat; // a negative `at` counts back from the end of the layer\n const cut = (start + length - lives) / length;\n if (start >= 0 && cut > 0.25 && cut * length >= 0.2) {\n warn(\n `pixi-effects: ${who}: keyframes[${i}] runs from ${ms(start)}s to ${ms(start + length)}s but the layer ends at ${ms(lives)}s, so the last ${Math.round(cut * 100)}% of it never plays ` +\n `(a fade stops half way). Keyframe \\`at\\` is measured from the start of this layer: start it earlier, make it shorter, or make the layer longer.`,\n 'late-keyframe',\n );\n }\n }\n });\n}\n\n/**\n * A loop that builds a hundred layers makes the same mistake a hundred times. Print the first few in full and\n * say how many more there are: the rest are the same loop.\n */\nexport function summarizeWarnings(messages: string[], shown = 3): string[] {\n if (messages.length <= shown) return messages;\n 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.`];\n}\n\n/** A text layer that animates `value` but has nowhere to print it. */\nexport function lintText(spec: SequenceSpec, warn: Warn = defaultWarn): void {\n if (spec.type !== 'text') return;\n // Every string the layer ever shows: its `text` and any `set: { text }` swap.\n const strings = [spec.text ?? '', ...(spec.keyframes ?? []).map(kf => String((kf.set as Record<string, unknown> | undefined)?.text ?? ''))];\n const hasPlaceholder = strings.some(t => t.includes('{value}'));\n if (hasPlaceholder && !collectPropKeys(spec).has('value')) {\n warn(`pixi-effects: ${describeLayer(spec)}: the text has a {value} placeholder but nothing sets or animates \\`value\\`, so it prints 0. Set initial: { value: … } or animate it; {value} is reserved for counters (there is no way to print a literal \"{value}\").`);\n }\n if (collectPropKeys(spec).has('value') && !hasPlaceholder) {\n 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').`);\n }\n}\n\nconst REMAPPABLE = new Set(['video', 'audio', 'composition']);\n/** Top-level names that mean a time remap and have their own message. */\nconst REMAP_NAMES = new Set(['time', 'timeRemap', 'reverse']);\nconst TIME_BAGS = ['set', 'to', 'from'] as const;\n\n/** The mistakes a time remap can make (`speed` / `time`), said once when the layer is built. Called from `lintKeys`. */\nfunction lintRemap(spec: SequenceSpec, warn: Warn): void {\n const s = spec as unknown as Record<string, any>;\n const who = describeLayer(spec);\n const kfs: Array<Record<string, any>> = s.keyframes ?? [];\n const bags: Array<Record<string, any> | undefined> = [s.initial, ...kfs.flatMap(kf => TIME_BAGS.map(b => kf[b]))];\n const timeInInitial = !!s.initial && s.initial.time !== undefined;\n const timeInKeyframes = kfs.some(kf => TIME_BAGS.some(b => kf[b] && kf[b].time !== undefined));\n const timed = timeInInitial || timeInKeyframes;\n if (bags.some(bag => bag && bag.speed !== undefined)) {\n 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' }])`);\n }\n if (!REMAPPABLE.has(spec.type)) {\n 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)`);\n return; // a top-level speed here is the key warning's business (\"not a ... key\")\n }\n if (s.reverse !== undefined) warn(`pixi-effects: ${who}: \"reverse\" is not a key: write speed: -1 to play backward`);\n if (s.timeRemap !== undefined) warn(`pixi-effects: ${who}: \"timeRemap\" is not a key: animate time in keyframes (from / to / set), or write speed`);\n if (s.time !== undefined) warn(`pixi-effects: ${who}: \"time\" belongs in initial or keyframes (initial: { time: 2 }), not on the layer`);\n if (spec.type === 'audio' && (s.sfx !== undefined || s.music !== undefined) && (s.speed !== undefined || timed)) {\n 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`);\n return;\n }\n if (s.speed !== undefined && (typeof s.speed !== 'number' || !Number.isFinite(s.speed) || s.speed === 0)) {\n 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`);\n }\n if (s.speed !== undefined && timeInKeyframes) {\n warn(`pixi-effects: ${who}: speed and keyframed time are both set; time wins and speed is ignored. Use one of them`);\n }\n if (timeInInitial && typeof s.initial.time !== 'number') {\n warn(`pixi-effects: ${who}: initial.time must be a number of seconds, got ${JSON.stringify(s.initial.time)}`);\n }\n kfs.forEach((kf, i) => {\n for (const b of TIME_BAGS) {\n const v = kf[b]?.time;\n if (v !== undefined && typeof v !== 'number' && typeof v !== 'string') warn(`pixi-effects: ${who}: keyframes[${i}].${b}.time must be a number of seconds, got ${JSON.stringify(v)}`);\n }\n });\n}\n\n/**\n * Keys that do not exist, which the library used to ignore without a word (a typo in a layer key, a mistyped property in a keyframe, a\n * style key Pixi does not know). Said once each, with what was probably meant. A warning, never an error. Not checked here: dotted\n * paths (`filters.g.amount`, `three.box.x`: their routers say what is wrong), the names `fillGradient` says itself (`gradientAngle`),\n * and a kind of layer registered elsewhere (`three`).\n */\n/** Keys the library used to have: the sentence says what to write now. */\nconst REMOVED_KEYS: Record<string, string> = {\n maskInverted: 'a hole instead of a crop is `mask: { layer: <the mask layer>, invert: true }`',\n};\n\n/** The knobs of a sound effect: they are keys of `sfx: { … }`, not of the layer. */\nconst SFX_KNOBS = new Set(['pitch', 'brightness', 'seed']);\n\n/** Where a layer is and how it is turned: always `initial` or a keyframe, even for a kind of layer that has such a name as a key of another meaning (`anchorX` on a shape). */\nconst TRANSFORM_KEYS = new Set(['x', 'y', 'z', 'alpha', 'rotation', 'rotationX', 'rotationY', 'scale', 'scaleX', 'scaleY', 'anchor', 'anchorX', 'anchorY',\n 'pivot', 'pivotX', 'pivotY', 'skew', 'skewX', 'skewY', 'position', 'positionX', 'positionY', 'tint', 'visible', 'autoAlpha']);\n\nexport function lintKeys(spec: SequenceSpec, warn: Warn = defaultWarn): void {\n const who = describeLayer(spec);\n const valid = layerKeys(spec as { type: string; shape?: string });\n if (valid) {\n for (const key of Object.keys(spec)) {\n if (valid.includes(key) || (spec as unknown as Record<string, unknown>)[key] === undefined) continue; // a spread that sets a key only when it applies leaves `undefined`\n if (REMAPPABLE.has(spec.type) && REMAP_NAMES.has(key)) continue; // lintRemap has its own message for these\n if (REMOVED_KEYS[key]) { warn(`pixi-effects: ${who}: \"${key}\" is not a ${kindName(spec as { type: string; shape?: string })} key: ${REMOVED_KEYS[key]}`); continue; }\n // `pitch`, `brightness`, `seed` are knobs of the sound effect, they go inside `sfx` (a trial: three agents wrote them beside `sfx:`)\n if (spec.type === 'audio' && SFX_KNOBS.has(key) && (spec as { sfx?: unknown }).sfx !== undefined) {\n const sfx = (spec as { sfx?: unknown }).sfx;\n const preset = typeof sfx === 'string' ? sfx : (sfx as { preset?: string } | null)?.preset;\n const v = (spec as unknown as Record<string, unknown>)[key];\n const shown = typeof v === 'number' || (typeof v === 'string' && v.length <= 24) ? JSON.stringify(v) : '…';\n warn(`pixi-effects: ${who}: \"${key}\" is a knob of the sound effect, so it is ignored beside \\`sfx\\`: write it inside — sfx: { ${preset ? `preset: '${preset}', ` : ''}${key}: ${shown} }${key === 'pitch' ? ' (pitch is in semitones, ±24: 12 is an octave up)' : key === 'brightness' ? ' (brightness is −1 dark … 1 bright)' : ''}`);\n continue;\n }\n // `z`, `x`, `alpha`, `rotationX` … are properties of the picture: they go in `initial` (or a keyframe), not on the layer. Say that, not a guess at another key.\n if (TRANSFORM_KEYS.has(key) || (PROP_KEYS.has(key) && kindsWithKey(key).length === 0)) { // (a key some other kind of layer owns, `radius` on a rect, keeps its \"it belongs to\" sentence below)\n const v = (spec as unknown as Record<string, unknown>)[key];\n const shown = typeof v === 'number' || (typeof v === 'string' && v.length <= 24) ? JSON.stringify(v) : '…';\n warn(`pixi-effects: ${who}: \"${key}\" is a property, not a ${kindName(spec as { type: string; shape?: string })} key, so it is ignored: write it in initial (initial: { ${key}: ${shown} }) or in a keyframe`);\n continue;\n }\n const guess = suggestName(key, valid.filter(k => k !== 'type'));\n const owners = kindsWithKey(key);\n const belongs = owners.length ? ` (it belongs to ${owners.slice(0, 3).join(', ')})` : '';\n const hint = guess ? ` — did you mean \"${guess}\"?${belongs}` : belongs;\n warn(`pixi-effects: ${who}: \"${key}\" is not a ${kindName(spec as { type: string; shape?: string })} key${hint}. Valid keys: ${valid.join(', ')}`);\n }\n }\n for (const { key, why } of pictureKeysIgnored(spec as unknown as { type: string } & Record<string, unknown>)) warn(`pixi-effects: ${who}: \"${key}\" does nothing on ${why}`);\n lintRemap(spec, warn);\n const said = new Set<string>();\n const bags: Array<Record<string, unknown> | undefined> = [spec.initial, ...(spec.keyframes ?? []).flatMap(kf => [kf.set, kf.to, kf.from])] as Array<Record<string, unknown> | undefined>;\n for (const bag of bags) {\n for (const key of Object.keys(bag ?? {})) {\n if (bag![key] === undefined) continue;\n if (PROP_KEYS.has(key) || key.includes('.') || /^gradient/i.test(key) || said.has(key) || key === 'speed') continue; // (speed: lintRemap says what to write)\n said.add(key);\n const guess = suggestName(key, [...PROP_KEYS]);\n warn(`pixi-effects: ${who}: \"${key}\" is not an animatable property${guess ? ` — did you mean \"${guess}\"?` : ''} (in initial, set, to or from). See the cheatsheet for the properties of this kind of layer`);\n }\n }\n if (spec.type === 'text' && spec.style && typeof spec.style === 'object') {\n for (const key of Object.keys(spec.style)) {\n if (STYLE_KEYS.includes(key) || (spec.style as Record<string, unknown>)[key] === undefined) continue;\n const guess = suggestName(key, STYLE_KEYS);\n warn(`pixi-effects: ${who}: style.${key} is not a text style key${guess ? ` — did you mean \"${guess}\"?` : ''} (it is ignored). Keys: ${STYLE_KEYS.join(', ')}`);\n }\n }\n}\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { CompositionSequence, maskSourceOf } from './chunk-
|
|
2
|
-
import { EXPRESSION_NAMES, createTimeline, lengthen, ensureFilterLibrary, checkEase, parseEase, homeDistance, DEFAULT_FOV, random, noise, flattenSvgPath, trimPolylines, rand, DEG, timeRemapOf, contentLength, resolveAt, parseSpring, springDuration, spansMeta } from './chunk-
|
|
3
|
-
import { analyzeAudio, fft, resampleThrough, measureLoudness, playSpan } from './chunk-
|
|
4
|
-
import { usesAdvancedBlend, enableAdvancedBlend } from './chunk-
|
|
5
|
-
import { describeLayer } from './chunk-
|
|
1
|
+
import { CompositionSequence, maskSourceOf } from './chunk-QMVK55LC.js';
|
|
2
|
+
import { EXPRESSION_NAMES, createTimeline, lengthen, ensureFilterLibrary, checkEase, parseEase, homeDistance, DEFAULT_FOV, random, noise, flattenSvgPath, trimPolylines, rand, DEG, timeRemapOf, contentLength, resolveAt, parseSpring, springDuration, spansMeta } from './chunk-6MHJKCXO.js';
|
|
3
|
+
import { analyzeAudio, fft, resampleThrough, measureLoudness, playSpan } from './chunk-7IDEWQPH.js';
|
|
4
|
+
import { usesAdvancedBlend, enableAdvancedBlend } from './chunk-UTDELFOU.js';
|
|
5
|
+
import { describeLayer } from './chunk-NVKHUAHU.js';
|
|
6
6
|
import { warnUnknownOptions, suggestName } from './chunk-BXOCEZ4U.js';
|
|
7
7
|
import { extensions, CullerPlugin, Application, Container, Rectangle, Culler, CanvasTextMetrics, TextStyle, Assets, ExtensionType, Filter, Texture, UniformGroup, GpuProgram, GlProgram, defaultFilterVert, Text, CanvasTextGenerator, CanvasPool } from 'pixi.js';
|
|
8
8
|
import { Output, BufferTarget, CanvasSource, AudioBufferSource, Input, ALL_FORMATS, BlobSource, WavOutputFormat, Conversion, VideoSampleSink, OggOutputFormat, QUALITY_VERY_HIGH, QUALITY_HIGH, QUALITY_MEDIUM, QUALITY_LOW, QUALITY_VERY_LOW, MkvOutputFormat, WebMOutputFormat, MovOutputFormat, Mp4OutputFormat, canEncodeVideo, getFirstEncodableAudioCodec } from 'mediabunny';
|
|
@@ -141,18 +141,86 @@ async function mixdown(audios, totalDuration, sampleRate = 44100, pace) {
|
|
|
141
141
|
}
|
|
142
142
|
var KNEE = 0.9;
|
|
143
143
|
var LOUDNESS_CEILING_DB = -1;
|
|
144
|
+
var MAX_LIMIT_DB = 10;
|
|
145
|
+
function limitInto(source, out, gain, ceil, sampleRate) {
|
|
146
|
+
const n = source[0]?.length ?? 0;
|
|
147
|
+
const req = new Float32Array(n);
|
|
148
|
+
for (let i = 0; i < n; i++) {
|
|
149
|
+
let p = 0;
|
|
150
|
+
for (const c of source) {
|
|
151
|
+
const a = Math.abs(c[i]) * gain;
|
|
152
|
+
if (a > p) p = a;
|
|
153
|
+
}
|
|
154
|
+
req[i] = p > ceil ? ceil / p : 1;
|
|
155
|
+
}
|
|
156
|
+
const L = Math.max(1, Math.round(3e-3 * sampleRate));
|
|
157
|
+
const mn = new Float32Array(n), dq = new Int32Array(n);
|
|
158
|
+
let head = 0, tail = 0;
|
|
159
|
+
for (let i = n - 1; i >= 0; i--) {
|
|
160
|
+
while (tail > head && req[dq[tail - 1]] >= req[i]) tail--;
|
|
161
|
+
dq[tail++] = i;
|
|
162
|
+
while (dq[head] > i + L) head++;
|
|
163
|
+
mn[i] = req[dq[head]];
|
|
164
|
+
}
|
|
165
|
+
const release = 1 - Math.exp(-1 / (0.08 * sampleRate));
|
|
166
|
+
let run = 0, prev = 1, lowest = 1, lowestAt = 0;
|
|
167
|
+
const gains = new Float32Array(n);
|
|
168
|
+
for (let i = 0; i < n; i++) {
|
|
169
|
+
run += mn[i];
|
|
170
|
+
if (i > L) run -= mn[i - L - 1];
|
|
171
|
+
const avg = run / Math.min(i + 1, L + 1);
|
|
172
|
+
const g = Math.min(avg, prev + (1 - prev) * release);
|
|
173
|
+
gains[i] = g;
|
|
174
|
+
prev = g;
|
|
175
|
+
if (g < lowest) {
|
|
176
|
+
lowest = g;
|
|
177
|
+
lowestAt = i;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
for (let ch = 0; ch < source.length; ch++) {
|
|
181
|
+
const s = source[ch], o = out[ch];
|
|
182
|
+
for (let i = 0; i < n; i++) {
|
|
183
|
+
const v = s[i] * gain * gains[i];
|
|
184
|
+
o[i] = v > ceil ? ceil : v < -ceil ? -ceil : v;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
return { reductionDb: lowest < 1 ? -20 * Math.log10(lowest) : 0, at: lowestAt / sampleRate };
|
|
188
|
+
}
|
|
144
189
|
function normalizeMix(buffer, target) {
|
|
145
190
|
const chans = [];
|
|
146
191
|
for (let ch = 0; ch < buffer.numberOfChannels; ch++) chans.push(buffer.getChannelData(ch));
|
|
147
|
-
const
|
|
192
|
+
const sr = buffer.sampleRate;
|
|
193
|
+
const m = measureLoudness(chans, sr, { truePeak: false });
|
|
148
194
|
if (m.integratedLufs === null) return { target, gainDb: 0, reachedLufs: null, limited: false };
|
|
195
|
+
const original = chans.map((c) => Float32Array.from(c));
|
|
149
196
|
let gainDb = target - m.integratedLufs;
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
197
|
+
let ceilDb = LOUDNESS_CEILING_DB;
|
|
198
|
+
let applied = { reductionDb: 0, at: 0 }, measured = m;
|
|
199
|
+
for (let round2 = 0; round2 < 8; round2++) {
|
|
200
|
+
const cap = MAX_LIMIT_DB + ceilDb - m.samplePeakDb;
|
|
201
|
+
if (gainDb > cap) gainDb = cap;
|
|
202
|
+
applied = limitInto(original, chans, 10 ** (gainDb / 20), 10 ** (ceilDb / 20), sr);
|
|
203
|
+
measured = measureLoudness(chans, sr);
|
|
204
|
+
const overTp = measured.truePeakDb - LOUDNESS_CEILING_DB;
|
|
205
|
+
if (overTp > 0.02) {
|
|
206
|
+
ceilDb -= overTp + 0.02;
|
|
207
|
+
continue;
|
|
208
|
+
}
|
|
209
|
+
const deficit = target - measured.integratedLufs;
|
|
210
|
+
if (Math.abs(deficit) <= 0.15) break;
|
|
211
|
+
const next = Math.min(gainDb + deficit, cap);
|
|
212
|
+
if (Math.abs(next - gainDb) < 0.05) break;
|
|
213
|
+
gainDb = next;
|
|
214
|
+
}
|
|
215
|
+
const limited = measured.integratedLufs < target - 0.15;
|
|
216
|
+
const reduction = Math.round(applied.reductionDb * 10) / 10;
|
|
217
|
+
return {
|
|
218
|
+
target,
|
|
219
|
+
gainDb: Math.round(gainDb * 10) / 10,
|
|
220
|
+
reachedLufs: measured.integratedLufs,
|
|
221
|
+
limited,
|
|
222
|
+
...reduction >= 0.1 ? { limiterDb: reduction, limiterAt: Math.round(applied.at * 100) / 100 } : {}
|
|
223
|
+
};
|
|
156
224
|
}
|
|
157
225
|
function limitMix(buffer, audios) {
|
|
158
226
|
let peak = 0;
|
|
@@ -4446,20 +4514,25 @@ function animateText(text, style, options) {
|
|
|
4446
4514
|
const pieces = splitText(text, style, { by, x, y, align, ...vertical ? { vertical } : {} });
|
|
4447
4515
|
if (pieces.length === 0) return [];
|
|
4448
4516
|
const lineHeight = measureText("M", style).height;
|
|
4449
|
-
const
|
|
4450
|
-
const
|
|
4517
|
+
const given = (v) => v === false || v === "none" ? void 0 : v;
|
|
4518
|
+
const inSpec = options.in === void 0 ? "rise" : given(options.in), outSpec = given(options.out);
|
|
4519
|
+
const inTween = inSpec === void 0 ? null : resolveTween(inSpec, "in");
|
|
4520
|
+
const outTween = outSpec === void 0 ? null : resolveTween(outSpec, "out");
|
|
4451
4521
|
const delays = stagger(pieces.length, options.stagger ?? { each: 0.04 });
|
|
4452
4522
|
const wave = Math.max(...delays);
|
|
4453
|
-
const
|
|
4523
|
+
const outDelays = outTween?.stagger ? stagger(pieces.length, outTween.stagger) : delays;
|
|
4524
|
+
const outWave = Math.max(...outDelays);
|
|
4525
|
+
const lead = Math.max(...delays.map((d, i) => d - outDelays[i]));
|
|
4526
|
+
const need = (inTween?.duration ?? 0) + (outTween ? outTween.duration + outWave + lead : wave);
|
|
4454
4527
|
if (duration < need - 1e-9) {
|
|
4455
4528
|
throw new Error(`animateText(): duration ${duration} is too short for this wave: the entrance${outTween ? ", the exit" : ""} and the stagger need at least ${+need.toFixed(3)} s`);
|
|
4456
4529
|
}
|
|
4457
4530
|
const end = at + duration;
|
|
4458
4531
|
if (outTween?.at !== void 0) {
|
|
4459
4532
|
if (outTween.at < at - 1e-9) console.warn(`pixi-effects: animateText(): out.at ${outTween.at} is before the layer starts (at ${at}): the exit starts with the piece; use out.at \u2265 ${at}`);
|
|
4460
|
-
const latest = end - outTween.duration -
|
|
4461
|
-
if (outTween.at > latest + 1e-9) console.warn(`pixi-effects: animateText(): out.at ${outTween.at} leaves after the layer ends (the exit and the wave take ${+(outTween.duration +
|
|
4462
|
-
if (inTween && outTween.at - at < inTween.duration - 1e-9) console.warn(`pixi-effects: animateText(): out.at ${outTween.at} is before the entrance has finished (it takes ${inTween.duration} s from at ${at}): use out.at \u2265 ${+(at + inTween.duration).toFixed(3)}`);
|
|
4533
|
+
const latest = end - outTween.duration - outWave;
|
|
4534
|
+
if (outTween.at > latest + 1e-9) console.warn(`pixi-effects: animateText(): out.at ${outTween.at} leaves after the layer ends (the exit and the wave take ${+(outTween.duration + outWave).toFixed(3)} s and the layer ends at ${+end.toFixed(3)} s): use out.at \u2264 ${+latest.toFixed(3)}, or a longer duration`);
|
|
4535
|
+
if (inTween && outTween.at - at < inTween.duration + lead - 1e-9) console.warn(`pixi-effects: animateText(): out.at ${outTween.at} is before the entrance has finished (it takes ${inTween.duration} s from at ${at}): use out.at \u2265 ${+(at + inTween.duration + lead).toFixed(3)}`);
|
|
4463
4536
|
}
|
|
4464
4537
|
return pieces.map((p, i) => {
|
|
4465
4538
|
const cx = p.cx ?? p.x + p.width / 2, cy = p.cy ?? p.y + lineHeight / 2;
|
|
@@ -4479,8 +4552,8 @@ function animateText(text, style, options) {
|
|
|
4479
4552
|
}
|
|
4480
4553
|
let idleEnd = len;
|
|
4481
4554
|
if (outTween) {
|
|
4482
|
-
const begin = outTween.at !== void 0 ? void 0 : outTween.duration + (
|
|
4483
|
-
const local = outTween.at !== void 0 ? Math.max(0, outTween.at -
|
|
4555
|
+
const begin = outTween.at !== void 0 ? void 0 : outTween.duration + (outWave - outDelays[i]);
|
|
4556
|
+
const local = outTween.at !== void 0 ? Math.max(0, outTween.at + outDelays[i] - start) : -begin;
|
|
4484
4557
|
idleEnd = outTween.at !== void 0 ? local : len - begin;
|
|
4485
4558
|
keyframes.push({
|
|
4486
4559
|
at: local,
|
|
@@ -4516,6 +4589,10 @@ function resolveTween(spec, which) {
|
|
|
4516
4589
|
if (typeof spec === "object" && spec) {
|
|
4517
4590
|
for (const key of Object.keys(spec)) {
|
|
4518
4591
|
if (TWEEN_KEYS.includes(key)) continue;
|
|
4592
|
+
if (key === "stagger") {
|
|
4593
|
+
if (which === "in") console.warn("pixi-effects: animateText(): in.stagger is ignored: the entrance wave is the options' `stagger` (only `out` can have a wave of its own: out: { stagger: 0 } leaves all at once)");
|
|
4594
|
+
continue;
|
|
4595
|
+
}
|
|
4519
4596
|
if (which === "out" && key === "at") {
|
|
4520
4597
|
if (typeof spec.at !== "number" || !Number.isFinite(spec.at)) console.warn(`pixi-effects: animateText(): out.at must be a number of seconds (the composition second the exit starts at), got ${JSON.stringify(spec.at)}; ignored`);
|
|
4521
4598
|
continue;
|
|
@@ -4527,7 +4604,7 @@ function resolveTween(spec, which) {
|
|
|
4527
4604
|
}
|
|
4528
4605
|
if (t.preset !== void 0 && !(t.preset in PRESETS)) {
|
|
4529
4606
|
const guess = suggestName(String(t.preset), PRESET_NAMES);
|
|
4530
|
-
throw new Error(`animateText(): ${which} "${t.preset}" is not a preset${guess ? `; did you mean "${guess}"?` : ""} (presets: ${PRESET_NAMES.map((n) => `"${n}"`).join(", ")})`);
|
|
4607
|
+
throw new Error(`animateText(): ${which} "${t.preset}" is not a preset${guess ? `; did you mean "${guess}"?` : ""} (presets: ${PRESET_NAMES.map((n) => `"${n}"`).join(", ")}; for no ${which === "out" ? "exit: omit `out` or write out: false (the pieces stay until the layer ends)" : "entrance: in: false"})`);
|
|
4531
4608
|
}
|
|
4532
4609
|
const base = t.preset ? PRESETS[t.preset] : void 0;
|
|
4533
4610
|
const from = { ...base?.from ?? {}, ...t.from ?? {} };
|
|
@@ -4536,11 +4613,14 @@ function resolveTween(spec, which) {
|
|
|
4536
4613
|
for (const k of Object.keys(from)) {
|
|
4537
4614
|
if (!known.has(k) && to[k] === void 0) throw new Error(`animateText(): ${which}.from has "${k}", which has no resting value; give ${which}.to: { ${k}: \u2026 }`);
|
|
4538
4615
|
}
|
|
4539
|
-
if (Object.keys(from).length === 0)
|
|
4616
|
+
if (Object.keys(from).length === 0) {
|
|
4617
|
+
throw new Error(`animateText(): ${which} needs a preset or a from${which === "out" && Object.keys(to).length ? ` \u2014 ${which} takes \`from\`: the state the piece leaves to (out: { from: { y: 18, alpha: 0 } }); \`to\` is only the resting value of a property that has none` : ""}`);
|
|
4618
|
+
}
|
|
4540
4619
|
let ease = t.ease ?? base?.ease ?? "power2.out";
|
|
4541
4620
|
if (which === "out" && t.ease === void 0) ease = ease.replace(".out", ".in");
|
|
4542
4621
|
const at = which === "out" && typeof t.at === "number" && Number.isFinite(t.at) ? t.at : void 0;
|
|
4543
|
-
|
|
4622
|
+
const wave = which === "out" && t.stagger !== void 0 ? t.stagger === 0 ? { each: 0 } : t.stagger : void 0;
|
|
4623
|
+
return { from, to: { ...to }, duration: t.duration ?? base?.duration ?? 0.5, ease, ...at !== void 0 ? { at } : {}, ...wave ? { stagger: wave } : {} };
|
|
4544
4624
|
}
|
|
4545
4625
|
|
|
4546
4626
|
// src/presets/react.ts
|
|
@@ -4848,5 +4928,5 @@ function withFade(spec, opts) {
|
|
|
4848
4928
|
}
|
|
4849
4929
|
|
|
4850
4930
|
export { Movie, animateText, audioEnvelope, bpmEnvelope, cameraPath, computeEnvelope, dismissLoader, failLoader, followPath, kenBurns, measureText, musicBuffer, musicEnvelope, musicEvents, orbit, parseEase2 as parseEase, particles, react, resolveLoader, samplePath, splitText, stagger, wiggle, withFade };
|
|
4851
|
-
//# sourceMappingURL=chunk-
|
|
4852
|
-
//# sourceMappingURL=chunk-
|
|
4931
|
+
//# sourceMappingURL=chunk-OVTTCX2E.js.map
|
|
4932
|
+
//# sourceMappingURL=chunk-OVTTCX2E.js.map
|