@pixerate/editor 0.140.3 → 0.141.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/dist/agent/canvasPlayback.d.cts +15 -0
- package/dist/agent/canvasPlayback.d.ts +15 -0
- package/dist/agent/index.cjs +144 -23
- package/dist/agent/index.d.cts +1 -0
- package/dist/agent/index.d.ts +1 -0
- package/dist/agent/index.js +125 -4
- package/dist/agent/providers.d.cts +8 -0
- package/dist/agent/providers.d.ts +8 -0
- package/dist/agent/types.d.cts +3 -0
- package/dist/agent/types.d.ts +3 -0
- package/dist/animation/index.cjs +2 -2
- package/dist/animation/index.js +1 -1
- package/dist/animation/presence.d.cts +1 -75
- package/dist/animation/presence.d.ts +1 -75
- package/dist/animation-editor/index.cjs +55 -55
- package/dist/animation-editor/index.js +2 -2
- package/dist/bridge/cli.cjs +3 -3
- package/dist/bridge/cli.js +2 -2
- package/dist/bridge/index.cjs +3 -3
- package/dist/bridge/index.js +2 -2
- package/dist/canvas/index.cjs +336 -646
- package/dist/canvas/index.d.cts +1 -0
- package/dist/canvas/index.d.ts +1 -0
- package/dist/canvas/index.js +44 -354
- package/dist/canvas/playback.d.cts +14 -0
- package/dist/canvas/playback.d.ts +14 -0
- package/dist/chart/index.cjs +7 -7
- package/dist/chart/index.js +1 -1
- package/dist/chunk-6SFREX6H.cjs +406 -0
- package/dist/{chunk-XGOU44RJ.js → chunk-77SG47WT.js} +80 -9
- package/dist/{chunk-2SHFIVC3.js → chunk-DAS7M4RY.js} +1 -1
- package/dist/chunk-DW4CV5H4.js +591 -0
- package/dist/{chunk-UMS6YFA6.js → chunk-EAQ4BGNS.js} +1 -1
- package/dist/{chunk-AGCD3EHB.cjs → chunk-ENIZYNEF.cjs} +7 -7
- package/dist/{chunk-VSR5A22L.cjs → chunk-H6FX45CP.cjs} +35 -35
- package/dist/{chunk-RCUX6CT2.cjs → chunk-HRI3ZMDM.cjs} +110 -39
- package/dist/chunk-MFFE55CS.js +406 -0
- package/dist/{chunk-BSGPXPTW.js → chunk-PEEP2YR7.js} +1 -1
- package/dist/{chunk-RB62U6MS.js → chunk-RFBFTLVN.js} +27 -5
- package/dist/chunk-UBRYHNRU.cjs +591 -0
- package/dist/{chunk-GEY73RUW.cjs → chunk-UJGAA6AK.cjs} +1 -1
- package/dist/{chunk-6UZCFD7Y.js → chunk-VM6JYWXQ.js} +1 -1
- package/dist/{chunk-O3ZU6QIZ.cjs → chunk-XNZWATSB.cjs} +81 -81
- package/dist/{chunk-HDK3T2QS.cjs → chunk-Y4BWZB6J.cjs} +29 -7
- package/dist/commands/index.cjs +37 -1
- package/dist/commands/index.js +36 -0
- package/dist/commands/registry.d.cts +11 -0
- package/dist/commands/registry.d.ts +11 -0
- package/dist/diagram/index.cjs +7 -7
- package/dist/diagram/index.js +1 -1
- package/dist/image-editor/index.cjs +720 -628
- package/dist/image-editor/index.d.cts +1 -0
- package/dist/image-editor/index.d.ts +1 -0
- package/dist/image-editor/index.js +109 -17
- package/dist/image-editor/playback.d.cts +22 -0
- package/dist/image-editor/playback.d.ts +22 -0
- package/dist/paint-editor/index.cjs +13 -13
- package/dist/paint-editor/index.js +3 -3
- package/dist/tools/index.cjs +33 -3
- package/dist/tools/index.d.cts +2 -0
- package/dist/tools/index.d.ts +2 -0
- package/dist/tools/index.js +32 -2
- package/dist/tools/playback.d.cts +205 -0
- package/dist/tools/playback.d.ts +205 -0
- package/dist/tools/presence.d.cts +82 -0
- package/dist/tools/presence.d.ts +82 -0
- package/dist/tools/registry.d.cts +45 -6
- package/dist/tools/registry.d.ts +45 -6
- package/dist/tools/view.d.cts +2 -4
- package/dist/tools/view.d.ts +2 -4
- package/dist/vector/index.cjs +1159 -1042
- package/dist/vector/index.d.cts +1 -0
- package/dist/vector/index.d.ts +1 -0
- package/dist/vector/index.js +142 -25
- package/dist/vector/playback.d.cts +13 -0
- package/dist/vector/playback.d.ts +13 -0
- package/package.json +1 -1
- package/skills/pixerate-agent-tools/SKILL.md +13 -0
- package/skills/pixerate-canvas/SKILL.md +3 -0
- package/skills/pixerate-image-editor/SKILL.md +2 -2
- package/skills/pixerate-vector/SKILL.md +5 -0
- package/dist/chunk-BTZS3KZY.js +0 -221
- package/dist/chunk-MRD3NXKR.cjs +0 -221
- /package/dist/{chunk-K73HMKQP.js → chunk-PLKIYNJZ.js} +0 -0
- /package/dist/{chunk-LACYURUW.cjs → chunk-TNCWKC5M.cjs} +0 -0
package/dist/animation/index.cjs
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkUJGAA6AKcjs = require('../chunk-UJGAA6AK.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
@@ -98,4 +98,4 @@ require('../chunk-A6QWKBJP.cjs');
|
|
|
98
98
|
|
|
99
99
|
|
|
100
100
|
|
|
101
|
-
exports.ANIMATION_EASING_LABELS = _chunkDWJJI6RTcjs.ANIMATION_EASING_LABELS; exports.ANIMATION_EASING_PRESETS = _chunkDWJJI6RTcjs.ANIMATION_EASING_PRESETS; exports.ANIMATION_TIME_EPSILON = _chunkSVR5FR7Bcjs.ANIMATION_TIME_EPSILON; exports.AnimationPlayer = _chunkSVR5FR7Bcjs.AnimationPlayer; exports.CUBIC_BEZIER_PRESETS = _chunkDWJJI6RTcjs.CUBIC_BEZIER_PRESETS; exports.MOTION_BEHAVIORS = _chunk7B5GTJXBcjs.MOTION_BEHAVIORS; exports.ManualClock = _chunkSVR5FR7Bcjs.ManualClock; exports.PRESENCE_COLORS =
|
|
101
|
+
exports.ANIMATION_EASING_LABELS = _chunkDWJJI6RTcjs.ANIMATION_EASING_LABELS; exports.ANIMATION_EASING_PRESETS = _chunkDWJJI6RTcjs.ANIMATION_EASING_PRESETS; exports.ANIMATION_TIME_EPSILON = _chunkSVR5FR7Bcjs.ANIMATION_TIME_EPSILON; exports.AnimationPlayer = _chunkSVR5FR7Bcjs.AnimationPlayer; exports.CUBIC_BEZIER_PRESETS = _chunkDWJJI6RTcjs.CUBIC_BEZIER_PRESETS; exports.MOTION_BEHAVIORS = _chunk7B5GTJXBcjs.MOTION_BEHAVIORS; exports.ManualClock = _chunkSVR5FR7Bcjs.ManualClock; exports.PRESENCE_COLORS = _chunkUJGAA6AKcjs.PRESENCE_COLORS; exports.PerformanceQueue = _chunkUJGAA6AKcjs.PerformanceQueue; exports.PresenceStore = _chunkUJGAA6AKcjs.PresenceStore; exports.SPRING_PRESETS = _chunkDWJJI6RTcjs.SPRING_PRESETS; exports.behaviorProgress = _chunk7B5GTJXBcjs.behaviorProgress; exports.createAnimationPlayer = _chunkSVR5FR7Bcjs.createAnimationPlayer; exports.createInstantPresenceClock = _chunkUJGAA6AKcjs.createInstantPresenceClock; exports.cubicBezierAt = _chunkDWJJI6RTcjs.cubicBezierAt; exports.easingFromInfluence = _chunkDWJJI6RTcjs.easingFromInfluence; exports.easingLabel = _chunkDWJJI6RTcjs.easingLabel; exports.easingToCss = _chunkDWJJI6RTcjs.easingToCss; exports.elasticAt = _chunkDWJJI6RTcjs.elasticAt; exports.evaluateEasing = _chunkDWJJI6RTcjs.evaluateEasing; exports.evaluateTrack = _chunkSVR5FR7Bcjs.evaluateTrack; exports.formatOklab = _chunk5FXOR7F2cjs.formatOklab; exports.fractalWiggle = _chunk7B5GTJXBcjs.fractalWiggle; exports.interpolateAnimationValue = _chunkSVR5FR7Bcjs.interpolateAnimationValue; exports.isAnimationEasing = _chunkDWJJI6RTcjs.isAnimationEasing; exports.isAnimationKeyframe = _chunkSVR5FR7Bcjs.isAnimationKeyframe; exports.isMotionBehavior = _chunk7B5GTJXBcjs.isMotionBehavior; exports.mixColorsOklab = _chunk5FXOR7F2cjs.mixColorsOklab; exports.motionSeedFromId = _chunk7B5GTJXBcjs.motionSeedFromId; exports.normalizeKeyframes = _chunkSVR5FR7Bcjs.normalizeKeyframes; exports.oklabToRgb = _chunk5FXOR7F2cjs.oklabToRgb; exports.pageHidden = _chunkSVR5FR7Bcjs.pageHidden; exports.parseCssEasing = _chunkDWJJI6RTcjs.parseCssEasing; exports.parseOklab = _chunk5FXOR7F2cjs.parseOklab; exports.quinticFade = _chunk7B5GTJXBcjs.quinticFade; exports.realClock = _chunkSVR5FR7Bcjs.realClock; exports.realPresenceClock = _chunkUJGAA6AKcjs.realPresenceClock; exports.resolveEasing = _chunkDWJJI6RTcjs.resolveEasing; exports.reverseCubicBezier = _chunkDWJJI6RTcjs.reverseCubicBezier; exports.rgbToOklab = _chunk5FXOR7F2cjs.rgbToOklab; exports.springAt = _chunkDWJJI6RTcjs.springAt; exports.springSettleMs = _chunkDWJJI6RTcjs.springSettleMs; exports.tweenPresenceCursor = _chunkUJGAA6AKcjs.tweenPresenceCursor; exports.wrapAnimationTime = _chunkSVR5FR7Bcjs.wrapAnimationTime;
|
package/dist/animation/index.js
CHANGED
|
@@ -1,75 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
id: string;
|
|
3
|
-
name: string;
|
|
4
|
-
color: string;
|
|
5
|
-
/** Cursor position in the surface's own coordinates (scene / canvas). */
|
|
6
|
-
x: number;
|
|
7
|
-
y: number;
|
|
8
|
-
/** The button is down (dragging). */
|
|
9
|
-
pressed: boolean;
|
|
10
|
-
/** A short note shown next to the cursor (what the agent is doing). */
|
|
11
|
-
message?: string;
|
|
12
|
-
}
|
|
13
|
-
export interface PresenceState {
|
|
14
|
-
actors: readonly PresenceActor[];
|
|
15
|
-
}
|
|
16
|
-
export declare const PRESENCE_COLORS: readonly string[];
|
|
17
|
-
/** Cursor positions and notes of agents acting on a surface, for an overlay. */
|
|
18
|
-
export declare class PresenceStore {
|
|
19
|
-
private state;
|
|
20
|
-
private readonly listeners;
|
|
21
|
-
getState: () => PresenceState;
|
|
22
|
-
subscribe: (listener: (state: PresenceState) => void) => (() => void);
|
|
23
|
-
/** The actor with `id`, if it is on the surface. */
|
|
24
|
-
get(id: string): PresenceActor | undefined;
|
|
25
|
-
/** Adds or changes an actor. */
|
|
26
|
-
set(actor: Pick<PresenceActor, 'id'> & Partial<PresenceActor>): void;
|
|
27
|
-
remove(id: string): void;
|
|
28
|
-
}
|
|
29
|
-
/** Time for performances: real timers, or an instant clock for tests and recordings. */
|
|
30
|
-
export interface PresenceClock {
|
|
31
|
-
now(): number;
|
|
32
|
-
wait(ms: number): Promise<void>;
|
|
33
|
-
}
|
|
34
|
-
export declare const realPresenceClock: PresenceClock;
|
|
35
|
-
/** A clock whose waits finish at once while its time still advances (repeatable performances). */
|
|
36
|
-
export declare function createInstantPresenceClock(start?: number): PresenceClock & {
|
|
37
|
-
elapsed(): number;
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* Glides an actor's cursor from `from` to `to` over `ms` (ease-out cubic, ~60 frames a second),
|
|
41
|
-
* calling `each` with the eased progress after every frame (e.g. to drag a value along).
|
|
42
|
-
*/
|
|
43
|
-
export declare function tweenPresenceCursor(presence: PresenceStore, clock: PresenceClock, id: string, from: {
|
|
44
|
-
x: number;
|
|
45
|
-
y: number;
|
|
46
|
-
}, to: {
|
|
47
|
-
x: number;
|
|
48
|
-
y: number;
|
|
49
|
-
}, ms: number, each?: (t: number) => void): Promise<void>;
|
|
50
|
-
export interface PresenceActorInfo {
|
|
51
|
-
id: string;
|
|
52
|
-
name?: string;
|
|
53
|
-
color?: string;
|
|
54
|
-
}
|
|
55
|
-
export interface PerformanceQueueOptions {
|
|
56
|
-
clock: PresenceClock;
|
|
57
|
-
/** Hide each actor's cursor this long after its last call (ms, default 1500; 0 keeps it). */
|
|
58
|
-
linger?: number;
|
|
59
|
-
/** Called around each call so everything it changes is one undo step. */
|
|
60
|
-
beginGesture?: (key: string) => void;
|
|
61
|
-
endGesture?: () => void;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Runs performances one after another per actor (different actors run side by side). Each
|
|
65
|
-
* call shows the actor's cursor, wraps the call in one gesture (one undo step), clears the
|
|
66
|
-
* note when it ends, and hides the cursor after `linger` unless another call followed.
|
|
67
|
-
*/
|
|
68
|
-
export declare class PerformanceQueue {
|
|
69
|
-
readonly presence: PresenceStore;
|
|
70
|
-
private readonly options;
|
|
71
|
-
private readonly queues;
|
|
72
|
-
private calls;
|
|
73
|
-
constructor(presence: PresenceStore, options: PerformanceQueueOptions);
|
|
74
|
-
run<T>(actor: PresenceActorInfo, perform: () => Promise<T>): Promise<T>;
|
|
75
|
-
}
|
|
1
|
+
export * from '../tools/presence.cjs';
|
|
@@ -1,75 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
id: string;
|
|
3
|
-
name: string;
|
|
4
|
-
color: string;
|
|
5
|
-
/** Cursor position in the surface's own coordinates (scene / canvas). */
|
|
6
|
-
x: number;
|
|
7
|
-
y: number;
|
|
8
|
-
/** The button is down (dragging). */
|
|
9
|
-
pressed: boolean;
|
|
10
|
-
/** A short note shown next to the cursor (what the agent is doing). */
|
|
11
|
-
message?: string;
|
|
12
|
-
}
|
|
13
|
-
export interface PresenceState {
|
|
14
|
-
actors: readonly PresenceActor[];
|
|
15
|
-
}
|
|
16
|
-
export declare const PRESENCE_COLORS: readonly string[];
|
|
17
|
-
/** Cursor positions and notes of agents acting on a surface, for an overlay. */
|
|
18
|
-
export declare class PresenceStore {
|
|
19
|
-
private state;
|
|
20
|
-
private readonly listeners;
|
|
21
|
-
getState: () => PresenceState;
|
|
22
|
-
subscribe: (listener: (state: PresenceState) => void) => (() => void);
|
|
23
|
-
/** The actor with `id`, if it is on the surface. */
|
|
24
|
-
get(id: string): PresenceActor | undefined;
|
|
25
|
-
/** Adds or changes an actor. */
|
|
26
|
-
set(actor: Pick<PresenceActor, 'id'> & Partial<PresenceActor>): void;
|
|
27
|
-
remove(id: string): void;
|
|
28
|
-
}
|
|
29
|
-
/** Time for performances: real timers, or an instant clock for tests and recordings. */
|
|
30
|
-
export interface PresenceClock {
|
|
31
|
-
now(): number;
|
|
32
|
-
wait(ms: number): Promise<void>;
|
|
33
|
-
}
|
|
34
|
-
export declare const realPresenceClock: PresenceClock;
|
|
35
|
-
/** A clock whose waits finish at once while its time still advances (repeatable performances). */
|
|
36
|
-
export declare function createInstantPresenceClock(start?: number): PresenceClock & {
|
|
37
|
-
elapsed(): number;
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* Glides an actor's cursor from `from` to `to` over `ms` (ease-out cubic, ~60 frames a second),
|
|
41
|
-
* calling `each` with the eased progress after every frame (e.g. to drag a value along).
|
|
42
|
-
*/
|
|
43
|
-
export declare function tweenPresenceCursor(presence: PresenceStore, clock: PresenceClock, id: string, from: {
|
|
44
|
-
x: number;
|
|
45
|
-
y: number;
|
|
46
|
-
}, to: {
|
|
47
|
-
x: number;
|
|
48
|
-
y: number;
|
|
49
|
-
}, ms: number, each?: (t: number) => void): Promise<void>;
|
|
50
|
-
export interface PresenceActorInfo {
|
|
51
|
-
id: string;
|
|
52
|
-
name?: string;
|
|
53
|
-
color?: string;
|
|
54
|
-
}
|
|
55
|
-
export interface PerformanceQueueOptions {
|
|
56
|
-
clock: PresenceClock;
|
|
57
|
-
/** Hide each actor's cursor this long after its last call (ms, default 1500; 0 keeps it). */
|
|
58
|
-
linger?: number;
|
|
59
|
-
/** Called around each call so everything it changes is one undo step. */
|
|
60
|
-
beginGesture?: (key: string) => void;
|
|
61
|
-
endGesture?: () => void;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Runs performances one after another per actor (different actors run side by side). Each
|
|
65
|
-
* call shows the actor's cursor, wraps the call in one gesture (one undo step), clears the
|
|
66
|
-
* note when it ends, and hides the cursor after `linger` unless another call followed.
|
|
67
|
-
*/
|
|
68
|
-
export declare class PerformanceQueue {
|
|
69
|
-
readonly presence: PresenceStore;
|
|
70
|
-
private readonly options;
|
|
71
|
-
private readonly queues;
|
|
72
|
-
private calls;
|
|
73
|
-
constructor(presence: PresenceStore, options: PerformanceQueueOptions);
|
|
74
|
-
run<T>(actor: PresenceActorInfo, perform: () => Promise<T>): Promise<T>;
|
|
75
|
-
}
|
|
1
|
+
export * from '../tools/presence.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class;
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkH6FX45CPcjs = require('../chunk-H6FX45CP.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -31,7 +31,7 @@ var _chunkEBDZWIOPcjs = require('../chunk-EBDZWIOP.cjs');
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
var
|
|
34
|
+
var _chunkHRI3ZMDMcjs = require('../chunk-HRI3ZMDM.cjs');
|
|
35
35
|
require('../chunk-BXMIBMVG.cjs');
|
|
36
36
|
require('../chunk-CVFAAZXE.cjs');
|
|
37
37
|
|
|
@@ -582,7 +582,7 @@ function smoothMotionTimes(points, start, duration, pacing = "even") {
|
|
|
582
582
|
function motionTextLayout(nodes, id) {
|
|
583
583
|
const group = _optionalChain([nodes, 'access', _5 => _5.get, 'call', _6 => _6(id), 'optionalAccess', _7 => _7.node]);
|
|
584
584
|
if (!group || group.type !== "group") return null;
|
|
585
|
-
const letters =
|
|
585
|
+
const letters = _chunkHRI3ZMDMcjs.collectPathNodes.call(void 0, group).map((p) => ({ id: p.id, b: _optionalChain([nodes, 'access', _8 => _8.get, 'call', _9 => _9(p.id), 'optionalAccess', _10 => _10.bounds]) })).filter((l) => !!l.b && l.b.width + l.b.height > 0);
|
|
586
586
|
if (!letters.length) return null;
|
|
587
587
|
const lines = [];
|
|
588
588
|
for (const l of [...letters].sort((a, c) => a.b.y + a.b.height / 2 - (c.b.y + c.b.height / 2))) {
|
|
@@ -667,21 +667,21 @@ function indexMotionNodes(nodes) {
|
|
|
667
667
|
const out = /* @__PURE__ */ new Map();
|
|
668
668
|
const walk = (list, parentWorld, ancestors) => {
|
|
669
669
|
for (const node of list) {
|
|
670
|
-
const local =
|
|
671
|
-
const bounds =
|
|
670
|
+
const local = _chunkHRI3ZMDMcjs.vectorNodeBounds.call(void 0, node);
|
|
671
|
+
const bounds = _chunkHRI3ZMDMcjs.vectorNodeBounds.call(void 0, node, parentWorld);
|
|
672
672
|
const center = local ? { x: local.x + local.width / 2, y: local.y + local.height / 2 } : { x: 0, y: 0 };
|
|
673
673
|
if (!out.has(node.id)) out.set(node.id, { node, ancestors, parentWorld, center, bounds, box: local });
|
|
674
|
-
if (node.type === "group") walk(node.children,
|
|
674
|
+
if (node.type === "group") walk(node.children, _chunkHRI3ZMDMcjs.multiplyMatrices.call(void 0, _chunkHRI3ZMDMcjs.nodeMatrix.call(void 0, node), parentWorld), [...ancestors, node.id]);
|
|
675
675
|
}
|
|
676
676
|
};
|
|
677
|
-
walk(nodes,
|
|
677
|
+
walk(nodes, _chunkHRI3ZMDMcjs.IDENTITY_MATRIX, []);
|
|
678
678
|
indexCache.set(nodes, out);
|
|
679
679
|
return out;
|
|
680
680
|
}
|
|
681
681
|
var solid = (paint) => typeof paint === "string" && paint !== "none" ? paint : void 0;
|
|
682
682
|
function firstPaint(node, key) {
|
|
683
683
|
if (node.type === "path") return solid(node[key]);
|
|
684
|
-
for (const p of
|
|
684
|
+
for (const p of _chunkHRI3ZMDMcjs.collectPathNodes.call(void 0, node)) {
|
|
685
685
|
const s = solid(p[key]);
|
|
686
686
|
if (s) return s;
|
|
687
687
|
}
|
|
@@ -689,7 +689,7 @@ function firstPaint(node, key) {
|
|
|
689
689
|
}
|
|
690
690
|
function strokeReach(node) {
|
|
691
691
|
let reach = 0;
|
|
692
|
-
for (const p of node.type === "path" ? [node] :
|
|
692
|
+
for (const p of node.type === "path" ? [node] : _chunkHRI3ZMDMcjs.collectPathNodes.call(void 0, node)) {
|
|
693
693
|
if (p.stroke == null || p.stroke === "none") continue;
|
|
694
694
|
const width = _nullishCoalesce(p.strokeWidth, () => ( 1));
|
|
695
695
|
reach = Math.max(reach, p.strokeAlign === "outside" ? width : p.strokeAlign === "inside" ? 0 : width / 2);
|
|
@@ -759,7 +759,7 @@ function motionRestValue(entry, property, artwork) {
|
|
|
759
759
|
case "stroke":
|
|
760
760
|
return _nullishCoalesce((node && firstPaint(node, property)), () => ( "transparent"));
|
|
761
761
|
case "strokeWidth": {
|
|
762
|
-
const path = _optionalChain([node, 'optionalAccess', _13 => _13.type]) === "path" ? node : node ?
|
|
762
|
+
const path = _optionalChain([node, 'optionalAccess', _13 => _13.type]) === "path" ? node : node ? _chunkHRI3ZMDMcjs.collectPathNodes.call(void 0, node)[0] : void 0;
|
|
763
763
|
return _nullishCoalesce(_optionalChain([path, 'optionalAccess', _14 => _14.strokeWidth]), () => ( 1));
|
|
764
764
|
}
|
|
765
765
|
case "shape":
|
|
@@ -870,12 +870,12 @@ function resolveMotionCamera(camera, scene) {
|
|
|
870
870
|
const r = camera;
|
|
871
871
|
return { x: r.x, y: r.y, width: r.width, height: r.height };
|
|
872
872
|
}
|
|
873
|
-
function motionPathLength(node, parentWorld =
|
|
873
|
+
function motionPathLength(node, parentWorld = _chunkHRI3ZMDMcjs.IDENTITY_MATRIX) {
|
|
874
874
|
let longest = 0;
|
|
875
|
-
const paths = node.type === "path" ? [node] :
|
|
875
|
+
const paths = node.type === "path" ? [node] : _chunkHRI3ZMDMcjs.collectPathNodes.call(void 0, node);
|
|
876
876
|
for (const p of paths) {
|
|
877
877
|
try {
|
|
878
|
-
longest = Math.max(longest, _chunkGF2RBSDMcjs.bezierPathLength.call(void 0,
|
|
878
|
+
longest = Math.max(longest, _chunkGF2RBSDMcjs.bezierPathLength.call(void 0, _chunkHRI3ZMDMcjs.vectorPathWorldBezier.call(void 0, p, parentWorld, { effects: false })));
|
|
879
879
|
} catch (e2) {
|
|
880
880
|
}
|
|
881
881
|
}
|
|
@@ -1128,12 +1128,12 @@ function compileMotionScene(scene) {
|
|
|
1128
1128
|
const order2 = _nullishCoalesce(o.order, () => ( "together"));
|
|
1129
1129
|
const pace = _nullishCoalesce(o.pace, () => ( "time"));
|
|
1130
1130
|
if (order2 === "together" && pace === "time") return null;
|
|
1131
|
-
const paths = entry.node.type === "path" ? [entry.node] :
|
|
1131
|
+
const paths = entry.node.type === "path" ? [entry.node] : _chunkHRI3ZMDMcjs.collectPathNodes.call(void 0, entry.node);
|
|
1132
1132
|
let list = paths.map((p) => {
|
|
1133
1133
|
const at = nodes.get(p.id);
|
|
1134
1134
|
let first = { x: 0, y: 0 };
|
|
1135
1135
|
try {
|
|
1136
|
-
const m =
|
|
1136
|
+
const m = _chunkHRI3ZMDMcjs.vectorPathWorldBezier.call(void 0, p, _nullishCoalesce(_optionalChain([at, 'optionalAccess', _41 => _41.parentWorld]), () => ( _chunkHRI3ZMDMcjs.IDENTITY_MATRIX)), { effects: false })[0];
|
|
1137
1137
|
if (m && m.type === "M") first = { x: m.x, y: m.y };
|
|
1138
1138
|
} catch (e3) {
|
|
1139
1139
|
}
|
|
@@ -1245,17 +1245,17 @@ function compileMotionScene(scene) {
|
|
|
1245
1245
|
let dx = _nullishCoalesce(_optionalChain([command3, 'access', _44 => _44.by, 'optionalAccess', _45 => _45.x]), () => ( 0));
|
|
1246
1246
|
let dy = _nullishCoalesce(_optionalChain([command3, 'access', _46 => _46.by, 'optionalAccess', _47 => _47.y]), () => ( 0));
|
|
1247
1247
|
if (command3.to) {
|
|
1248
|
-
const inv =
|
|
1249
|
-
const target =
|
|
1248
|
+
const inv = _chunkHRI3ZMDMcjs.invertMatrix.call(void 0, entry.parentWorld);
|
|
1249
|
+
const target = _chunkHRI3ZMDMcjs.applyMatrix.call(void 0, inv, command3.to);
|
|
1250
1250
|
dx = target.x - (entry.center.x + num2("x"));
|
|
1251
1251
|
dy = target.y - (entry.center.y + num2("y"));
|
|
1252
1252
|
}
|
|
1253
1253
|
if (_optionalChain([command3, 'access', _48 => _48.via, 'optionalAccess', _49 => _49.length])) {
|
|
1254
|
-
const inv =
|
|
1254
|
+
const inv = _chunkHRI3ZMDMcjs.invertMatrix.call(void 0, entry.parentWorld);
|
|
1255
1255
|
const x0 = num2("x");
|
|
1256
1256
|
const y0 = num2("y");
|
|
1257
1257
|
const add = command3.blend === "add";
|
|
1258
|
-
const offsets = [{ x: 0, y: 0 }, ...command3.via.map((p) =>
|
|
1258
|
+
const offsets = [{ x: 0, y: 0 }, ...command3.via.map((p) => _chunkHRI3ZMDMcjs.applyMatrix.call(void 0, inv, p)).map((p) => ({ x: p.x - entry.center.x - x0, y: p.y - entry.center.y - y0 })), { x: dx, y: dy }];
|
|
1259
1259
|
const times = smoothMotionTimes(offsets, start, end - start, _nullishCoalesce(command3.pacing, () => ( "even")));
|
|
1260
1260
|
for (const axis of ["x", "y"]) {
|
|
1261
1261
|
const base = add ? 0 : axis === "x" ? x0 : y0;
|
|
@@ -1398,13 +1398,13 @@ function morphBetween(a, b) {
|
|
|
1398
1398
|
let inner = morphCache.get(a);
|
|
1399
1399
|
if (!inner) morphCache.set(a, inner = /* @__PURE__ */ new WeakMap());
|
|
1400
1400
|
let morph = inner.get(b);
|
|
1401
|
-
if (!morph) inner.set(b, morph =
|
|
1401
|
+
if (!morph) inner.set(b, morph = _chunkH6FX45CPcjs.createVectorMorph.call(void 0, a, b, { id: a.id }));
|
|
1402
1402
|
return morph;
|
|
1403
1403
|
}
|
|
1404
1404
|
function shapeIn(entry, shape) {
|
|
1405
1405
|
if (shape === entry) return entry.node;
|
|
1406
|
-
const m =
|
|
1407
|
-
return { ...shape.node, ...
|
|
1406
|
+
const m = _chunkHRI3ZMDMcjs.multiplyMatrices.call(void 0, _chunkHRI3ZMDMcjs.multiplyMatrices.call(void 0, _chunkHRI3ZMDMcjs.nodeMatrix.call(void 0, shape.node), shape.parentWorld), _chunkHRI3ZMDMcjs.invertMatrix.call(void 0, entry.parentWorld));
|
|
1407
|
+
return { ...shape.node, ..._chunkHRI3ZMDMcjs.isIdentityMatrix.call(void 0, m) ? { transform: void 0 } : { transform: m } };
|
|
1408
1408
|
}
|
|
1409
1409
|
function shapeAt(entry, timeline, nodes, time) {
|
|
1410
1410
|
const track = timeline.tracks.get(motionTrackKey(entry.node.id, "shape"));
|
|
@@ -1424,7 +1424,7 @@ function shapeAt(entry, timeline, nodes, time) {
|
|
|
1424
1424
|
function motionFollowRoute(entry, path) {
|
|
1425
1425
|
if (!path || path.node.type !== "path") return null;
|
|
1426
1426
|
try {
|
|
1427
|
-
return _chunkGF2RBSDMcjs.transformBezierPath.call(void 0,
|
|
1427
|
+
return _chunkGF2RBSDMcjs.transformBezierPath.call(void 0, _chunkHRI3ZMDMcjs.vectorPathWorldBezier.call(void 0, path.node, path.parentWorld, { effects: false }), _chunkHRI3ZMDMcjs.invertMatrix.call(void 0, entry.parentWorld));
|
|
1428
1428
|
} catch (e4) {
|
|
1429
1429
|
return null;
|
|
1430
1430
|
}
|
|
@@ -1458,9 +1458,9 @@ function motionNodeOffset(entry, timeline, time, nodes = indexMotionNodes([entry
|
|
|
1458
1458
|
const scaleX = read("scaleX", 1);
|
|
1459
1459
|
const scaleY = read("scaleY", 1);
|
|
1460
1460
|
const c = entry.center;
|
|
1461
|
-
let matrix =
|
|
1461
|
+
let matrix = _chunkHRI3ZMDMcjs.multiplyMatrices.call(void 0, _chunkHRI3ZMDMcjs.multiplyMatrices.call(void 0, _chunkHRI3ZMDMcjs.scaleMatrix.call(void 0, scaleX, scaleY, c), _chunkHRI3ZMDMcjs.rotateMatrix.call(void 0, rotation, c)), _chunkHRI3ZMDMcjs.translateMatrix.call(void 0, dx, dy));
|
|
1462
1462
|
const along = follow ? followAt(entry, timeline, nodes, time) : null;
|
|
1463
|
-
if (along) matrix =
|
|
1463
|
+
if (along) matrix = _chunkHRI3ZMDMcjs.multiplyMatrices.call(void 0, matrix, _chunkHRI3ZMDMcjs.multiplyMatrices.call(void 0, _chunkHRI3ZMDMcjs.multiplyMatrices.call(void 0, _chunkHRI3ZMDMcjs.translateMatrix.call(void 0, -c.x, -c.y), _chunkHRI3ZMDMcjs.rotateMatrix.call(void 0, along.angle)), _chunkHRI3ZMDMcjs.translateMatrix.call(void 0, along.x, along.y)));
|
|
1464
1464
|
return { matrix, dx, dy, rotation, scaleX, scaleY, follow: along };
|
|
1465
1465
|
}
|
|
1466
1466
|
function motionNodeClips(id, timeline, time) {
|
|
@@ -1527,7 +1527,7 @@ function motionFrameAt(scene, time, options = {}) {
|
|
|
1527
1527
|
const start = Math.min(1, Math.max(0, typeof drawStart === "number" ? drawStart : 0));
|
|
1528
1528
|
const end = Math.min(1, Math.max(0, typeof drawEnd === "number" ? drawEnd : 1));
|
|
1529
1529
|
if (start > 0 || end < 1) {
|
|
1530
|
-
const trim =
|
|
1530
|
+
const trim = _chunkHRI3ZMDMcjs.createVectorEffect.call(void 0, "trim", MOTION_DRAW_EFFECT_ID, { start: tidy(start * 100), end: tidy(end * 100) });
|
|
1531
1531
|
p = { ...p, effects: [trim, ...(_nullishCoalesce(p.effects, () => ( []))).filter((e) => e.id !== MOTION_DRAW_EFFECT_ID)] };
|
|
1532
1532
|
}
|
|
1533
1533
|
}
|
|
@@ -1541,8 +1541,8 @@ function motionFrameAt(scene, time, options = {}) {
|
|
|
1541
1541
|
if (o >= 1) delete out.opacity;
|
|
1542
1542
|
}
|
|
1543
1543
|
const offset = options.offsets === false ? null : motionNodeOffset(entry, timeline, time, nodes);
|
|
1544
|
-
if (offset && !
|
|
1545
|
-
const m =
|
|
1544
|
+
if (offset && !_chunkHRI3ZMDMcjs.isIdentityMatrix.call(void 0, offset.matrix)) {
|
|
1545
|
+
const m = _chunkHRI3ZMDMcjs.multiplyMatrices.call(void 0, _chunkHRI3ZMDMcjs.nodeMatrix.call(void 0, out), offset.matrix).map(tidy);
|
|
1546
1546
|
out = { ...out, transform: m };
|
|
1547
1547
|
}
|
|
1548
1548
|
return out;
|
|
@@ -1562,7 +1562,7 @@ function motionFrameToSvg(scene, time, options = {}) {
|
|
|
1562
1562
|
const wrap = { ...options.wrap };
|
|
1563
1563
|
for (const [id, clips] of Object.entries(frame.clips))
|
|
1564
1564
|
wrap[id] = [..._nullishCoalesce(wrap[id], () => ( [])), ...clips.map((clip, i) => ({ clip: { id: `${prefix}reveal-${id}-${i}`, shape: clip.shape, attrs: motionClipAttrs(clip) } }))];
|
|
1565
|
-
return withViewBox(
|
|
1565
|
+
return withViewBox(_chunkHRI3ZMDMcjs.vectorDocumentToSvg.call(void 0, frame.document, { ...options, wrap }), frame.camera);
|
|
1566
1566
|
}
|
|
1567
1567
|
function withViewBox(svg, box) {
|
|
1568
1568
|
const f = (n) => String(Math.round(n * 1e3) / 1e3);
|
|
@@ -1745,8 +1745,8 @@ function visibleAt(timeline, id, time, node) {
|
|
|
1745
1745
|
if (Array.isArray(rect) && (rect[2] <= 1e-4 || rect[3] <= 1e-4)) return false;
|
|
1746
1746
|
const circle = clip("clipCircle");
|
|
1747
1747
|
if (Array.isArray(circle) && circle[2] <= 1e-4) return false;
|
|
1748
|
-
const hasFill = node.type === "path" ? !!node.fill && node.fill !== "none" :
|
|
1749
|
-
const drawn = num2("drawEnd", 1) > 0.01 && (node.type === "path" ||
|
|
1748
|
+
const hasFill = node.type === "path" ? !!node.fill && node.fill !== "none" : _chunkHRI3ZMDMcjs.collectPathNodes.call(void 0, node).some((p) => p.fill && p.fill !== "none");
|
|
1749
|
+
const drawn = num2("drawEnd", 1) > 0.01 && (node.type === "path" || _chunkHRI3ZMDMcjs.collectPathNodes.call(void 0, node).length === 0 || _chunkHRI3ZMDMcjs.collectPathNodes.call(void 0, node).some((p) => {
|
|
1750
1750
|
const v = trackValue(timeline.tracks.get(motionTrackKey(p.id, "drawEnd")), time);
|
|
1751
1751
|
return typeof v !== "number" || v > 0.01;
|
|
1752
1752
|
}));
|
|
@@ -1832,7 +1832,7 @@ function checkMotionScene(scene) {
|
|
|
1832
1832
|
}
|
|
1833
1833
|
for (const id of targets) {
|
|
1834
1834
|
const node = nodes.get(id).node;
|
|
1835
|
-
const paths = node.type === "path" ? [node] :
|
|
1835
|
+
const paths = node.type === "path" ? [node] : _chunkHRI3ZMDMcjs.collectPathNodes.call(void 0, node);
|
|
1836
1836
|
if (paths.some((p) => p[key] !== void 0 && p[key] !== null && typeof p[key] !== "string"))
|
|
1837
1837
|
issues.push(_chunkEBDZWIOPcjs.motionIssue.call(void 0, "paint-not-color", `"${id}" has a gradient ${key}; it switches to ${color} at the end instead of blending.`, { ...where, ids: [id] }));
|
|
1838
1838
|
}
|
|
@@ -1845,7 +1845,7 @@ function checkMotionScene(scene) {
|
|
|
1845
1845
|
else
|
|
1846
1846
|
for (const id of targets) {
|
|
1847
1847
|
const node = nodes.get(id).node;
|
|
1848
|
-
const paths = node.type === "path" ? [node] :
|
|
1848
|
+
const paths = node.type === "path" ? [node] : _chunkHRI3ZMDMcjs.collectPathNodes.call(void 0, node);
|
|
1849
1849
|
if (paths.some((p) => typeof p[key] !== "string"))
|
|
1850
1850
|
issues.push(_chunkEBDZWIOPcjs.motionIssue.call(void 0, "paint-not-color", `"${id}" has a gradient or no ${key}, so a colour pulse cannot tint it; give it a solid ${key} or pulse the ${key === "fill" ? "stroke" : "fill"}.`, { ...where, ids: [id] }));
|
|
1851
1851
|
}
|
|
@@ -2429,7 +2429,7 @@ function toFlairSvgMotion(scene, options = {}) {
|
|
|
2429
2429
|
raw: (t) => transformAt(t, true)
|
|
2430
2430
|
});
|
|
2431
2431
|
}
|
|
2432
|
-
const paths = node.type === "path" ? [node] :
|
|
2432
|
+
const paths = node.type === "path" ? [node] : _chunkHRI3ZMDMcjs.collectPathNodes.call(void 0, node);
|
|
2433
2433
|
for (const path of paths) {
|
|
2434
2434
|
if (pathsSeen.has(path.id)) continue;
|
|
2435
2435
|
pathsSeen.add(path.id);
|
|
@@ -2451,7 +2451,7 @@ function toFlairSvgMotion(scene, options = {}) {
|
|
|
2451
2451
|
if (shapeSegments.length) {
|
|
2452
2452
|
if (node.type !== "path") notes.push(`"${id}" is a group: its morph or effect animation is not exported (Flair tweens one path's "d").`);
|
|
2453
2453
|
else {
|
|
2454
|
-
const inverse =
|
|
2454
|
+
const inverse = _chunkHRI3ZMDMcjs.invertMatrix.call(void 0, _chunkHRI3ZMDMcjs.nodeMatrix.call(void 0, node));
|
|
2455
2455
|
channels.push({
|
|
2456
2456
|
id,
|
|
2457
2457
|
kind: "attr",
|
|
@@ -2460,9 +2460,9 @@ function toFlairSvgMotion(scene, options = {}) {
|
|
|
2460
2460
|
exact: () => false,
|
|
2461
2461
|
value: (t) => {
|
|
2462
2462
|
const frame = motionFrameAt(scene, t, { draw: false, offsets: false });
|
|
2463
|
-
const now =
|
|
2463
|
+
const now = _chunkHRI3ZMDMcjs.expandVectorAppearance.call(void 0, _optionalChain([indexMotionNodes, 'call', _108 => _108(frame.document.nodes), 'access', _109 => _109.get, 'call', _110 => _110(id), 'optionalAccess', _111 => _111.node]));
|
|
2464
2464
|
if (!now || now.type !== "path") return "";
|
|
2465
|
-
const bezier = _chunkGF2RBSDMcjs.transformBezierPath.call(void 0,
|
|
2465
|
+
const bezier = _chunkGF2RBSDMcjs.transformBezierPath.call(void 0, _chunkHRI3ZMDMcjs.vectorPathWorldBezier.call(void 0, now, _chunkHRI3ZMDMcjs.IDENTITY_MATRIX, { effects: false }), inverse);
|
|
2466
2466
|
return _chunkGF2RBSDMcjs.bezierPathToSvg.call(void 0, bezier, { precision: Math.min(precision, 2) });
|
|
2467
2467
|
}
|
|
2468
2468
|
});
|
|
@@ -2569,7 +2569,7 @@ function toFlairSvgMotion(scene, options = {}) {
|
|
|
2569
2569
|
}
|
|
2570
2570
|
if (scene.motionBlur) notes.push("Motion blur is drawn on the stage only; Flair plays the scene sharp.");
|
|
2571
2571
|
if (trigger && (_nullishCoalesce(scene.loop, () => ( "none"))) !== "none") notes.push(`The scene plays on ${trigger}, so its loop does not apply in Flair.`);
|
|
2572
|
-
let svg =
|
|
2572
|
+
let svg = _chunkHRI3ZMDMcjs.vectorDocumentToSvg.call(void 0, { ...scene.artwork, nodes: _chunkHRI3ZMDMcjs.expandVectorAppearances.call(void 0, scene.artwork.nodes) }, { pretty: false, precision, wrap });
|
|
2573
2573
|
if (routes.length) svg = svg.replace(/^(<svg[^>]*>)/, `$1<defs>${routes.join("")}</defs>`);
|
|
2574
2574
|
let motion = { svg, animate };
|
|
2575
2575
|
if (_optionalChain([scene, 'access', _114 => _114.controls, 'optionalAccess', _115 => _115.length])) {
|
|
@@ -2653,14 +2653,14 @@ function easingOf(ease, fallback) {
|
|
|
2653
2653
|
return fallback;
|
|
2654
2654
|
}
|
|
2655
2655
|
function poseOf(value, entry) {
|
|
2656
|
-
const t =
|
|
2657
|
-
const o =
|
|
2656
|
+
const t = _chunkHRI3ZMDMcjs.parseSvgTransform.call(void 0, String(value));
|
|
2657
|
+
const o = _chunkHRI3ZMDMcjs.multiplyMatrices.call(void 0, _nullishCoalesce(_chunkHRI3ZMDMcjs.invertMatrix.call(void 0, _chunkHRI3ZMDMcjs.nodeMatrix.call(void 0, entry.node)), () => ( [1, 0, 0, 1, 0, 0])), t);
|
|
2658
2658
|
const sx = Math.hypot(o[0], o[1]);
|
|
2659
2659
|
if (!(sx > 1e-9)) return null;
|
|
2660
2660
|
const sy = (o[0] * o[3] - o[1] * o[2]) / sx;
|
|
2661
2661
|
if (Math.abs(o[2] + o[1] / sx * sy) > 1e-6 || Math.abs(o[3] - o[0] / sx * sy) > 1e-6) return null;
|
|
2662
2662
|
const c = entry.center;
|
|
2663
|
-
const moved =
|
|
2663
|
+
const moved = _chunkHRI3ZMDMcjs.applyMatrix.call(void 0, o, c);
|
|
2664
2664
|
return { dx: moved.x - c.x, dy: moved.y - c.y, rotation: Math.atan2(o[1], o[0]) * 180 / Math.PI, sx, sy };
|
|
2665
2665
|
}
|
|
2666
2666
|
var near = (a, b, eps = 1e-6) => Math.abs(a - b) < eps;
|
|
@@ -2745,7 +2745,7 @@ function fromFlairSvgMotion(input, options = {}) {
|
|
|
2745
2745
|
const notes = [];
|
|
2746
2746
|
if (!input || typeof input.svg !== "string") throw new Error('Give a Flair SvgMotion: { svg: "<svg \u2026>", animate: [ \u2026 ] }.');
|
|
2747
2747
|
const { motion, controls } = resolvePlaceholders(input, notes);
|
|
2748
|
-
const artwork =
|
|
2748
|
+
const artwork = _chunkHRI3ZMDMcjs.parseVectorSvg.call(void 0, motion.svg);
|
|
2749
2749
|
const nodes = indexMotionNodes(artwork.nodes);
|
|
2750
2750
|
const byStep = /* @__PURE__ */ new Map();
|
|
2751
2751
|
for (const anim of _nullishCoalesce(motion.animate, () => ( []))) {
|
|
@@ -2992,9 +2992,9 @@ function toLottie(scene, options = {}) {
|
|
|
2992
2992
|
const items = [];
|
|
2993
2993
|
const shapeSegments = [...timeline.tracks.entries()].filter(([k]) => k.startsWith(`${path.id}\0`) && (k.endsWith("\0shape") || k.includes("\0effect:"))).flatMap(([, v]) => v);
|
|
2994
2994
|
const geometryAt = (t) => {
|
|
2995
|
-
if (!shapeSegments.length) return
|
|
2995
|
+
if (!shapeSegments.length) return _chunkHRI3ZMDMcjs.vectorPathWorldBezier.call(void 0, path);
|
|
2996
2996
|
const now = _optionalChain([indexMotionNodes, 'call', _124 => _124(motionFrameAt(scene, t, { draw: false, offsets: false }).document.nodes), 'access', _125 => _125.get, 'call', _126 => _126(path.id), 'optionalAccess', _127 => _127.node]);
|
|
2997
|
-
return now && now.type === "path" ?
|
|
2997
|
+
return now && now.type === "path" ? _chunkHRI3ZMDMcjs.vectorPathWorldBezier.call(void 0, _chunkHRI3ZMDMcjs.expandVectorAppearances.call(void 0, [now])[0]) : _chunkHRI3ZMDMcjs.vectorPathWorldBezier.call(void 0, path);
|
|
2998
2998
|
};
|
|
2999
2999
|
const rest = lottieContours(_chunkGF2RBSDMcjs.toBezierPath.call(void 0, geometryAt(0)), round2);
|
|
3000
3000
|
rest.forEach((contour, n) => {
|
|
@@ -3067,13 +3067,13 @@ function toLottie(scene, options = {}) {
|
|
|
3067
3067
|
const innerTr = STATIC_TR();
|
|
3068
3068
|
if (node.type === "path") inner = [...pathShapes(node)];
|
|
3069
3069
|
else if (node.type === "text" || node.type === "instance") {
|
|
3070
|
-
const drawn =
|
|
3070
|
+
const drawn = _chunkHRI3ZMDMcjs.expandVectorAppearance.call(void 0, node);
|
|
3071
3071
|
inner = drawn.type === "path" ? [...pathShapes(drawn)] : drawn.children.filter((c) => c.type === "path").reverse().flatMap((c) => [...pathShapes(c)]);
|
|
3072
|
-
notes.push(`"${node.id}": text is exported as its outlines${
|
|
3072
|
+
notes.push(`"${node.id}": text is exported as its outlines${_chunkHRI3ZMDMcjs.vectorTextHasOutlines.call(void 0, ) ? "" : " (glyph boxes: set an outline text shaper for real glyphs)"}.`);
|
|
3073
3073
|
} else {
|
|
3074
3074
|
inner = shown(node.children).reverse().map(nodeGroup);
|
|
3075
|
-
const m =
|
|
3076
|
-
if (m !==
|
|
3075
|
+
const m = _chunkHRI3ZMDMcjs.nodeMatrix.call(void 0, node);
|
|
3076
|
+
if (m !== _chunkHRI3ZMDMcjs.IDENTITY_MATRIX) {
|
|
3077
3077
|
const parts = staticParts(m);
|
|
3078
3078
|
if (!parts) notes.push(`"${node.id}": its transform skews, which is not exported; it is drawn without the skew.`);
|
|
3079
3079
|
else {
|
|
@@ -3086,7 +3086,7 @@ function toLottie(scene, options = {}) {
|
|
|
3086
3086
|
const body = { ty: "gr", nm: `${node.id} (own)`, it: [...inner, innerTr] };
|
|
3087
3087
|
return { ty: "gr", nm: _nullishCoalesce(node.name, () => ( node.id)), it: [body, poseTransform(entry)] };
|
|
3088
3088
|
};
|
|
3089
|
-
const artwork = { ...scene.artwork, nodes:
|
|
3089
|
+
const artwork = { ...scene.artwork, nodes: _chunkHRI3ZMDMcjs.expandVectorAppearances.call(void 0, scene.artwork.nodes) };
|
|
3090
3090
|
const content = shown(artwork.nodes).reverse().map(nodeGroup);
|
|
3091
3091
|
if (artwork.background && rgba(artwork.background))
|
|
3092
3092
|
content.push({ ty: "gr", nm: "Background", it: [{ ty: "rc", nm: "Background", p: { a: 0, k: [artwork.width / 2, artwork.height / 2] }, s: { a: 0, k: [artwork.width, artwork.height] }, r: { a: 0, k: 0 } }, { ty: "fl", c: { a: 0, k: rgba(artwork.background).map(round2) }, o: { a: 0, k: 100 }, r: 1 }, STATIC_TR()] });
|
|
@@ -3185,11 +3185,11 @@ function preset(prst, w, h) {
|
|
|
3185
3185
|
const poly = (pts) => [{ closed: true, anchors: pts.map(([x, y]) => ({ x, y })) }];
|
|
3186
3186
|
switch (prst) {
|
|
3187
3187
|
case "rect":
|
|
3188
|
-
return [
|
|
3188
|
+
return [_chunkHRI3ZMDMcjs.rectSubpath.call(void 0, { x: 0, y: 0, width: w, height: h })];
|
|
3189
3189
|
case "roundRect":
|
|
3190
|
-
return [
|
|
3190
|
+
return [_chunkHRI3ZMDMcjs.rectSubpath.call(void 0, { x: 0, y: 0, width: w, height: h }, Math.min(w, h) * 0.16667)];
|
|
3191
3191
|
case "ellipse":
|
|
3192
|
-
return [
|
|
3192
|
+
return [_chunkHRI3ZMDMcjs.ellipseSubpath.call(void 0, { x: 0, y: 0, width: w, height: h })];
|
|
3193
3193
|
case "triangle":
|
|
3194
3194
|
return poly([[w / 2, 0], [w, h], [0, h]]);
|
|
3195
3195
|
case "rtTriangle":
|
|
@@ -3297,7 +3297,7 @@ function shapes(ctx, tree, map) {
|
|
|
3297
3297
|
let subpaths = cust ? custom(cust, w, h) : prst ? preset(prst, w, h) : null;
|
|
3298
3298
|
if (!subpaths) {
|
|
3299
3299
|
if (prst) ctx.notes.push(`"${name}" is a ${prst}, drawn as its bounding rectangle.`);
|
|
3300
|
-
subpaths = [
|
|
3300
|
+
subpaths = [_chunkHRI3ZMDMcjs.rectSubpath.call(void 0, { x: 0, y: 0, width: w, height: h })];
|
|
3301
3301
|
}
|
|
3302
3302
|
const style = kid(el, "style");
|
|
3303
3303
|
const fill = kid(spPr, "noFill") ? null : _nullishCoalesce(colour(ctx, kid(spPr, "solidFill")), () => ( (el.localName === "cxnSp" ? null : colour(ctx, kid(style, "fillRef")))));
|
|
@@ -3535,7 +3535,7 @@ function nextMotionEffectInstance(scene) {
|
|
|
3535
3535
|
walk(scene.artwork.nodes);
|
|
3536
3536
|
for (let i = 1; ; i++) if (!used.has(`fx${i}`)) return `fx${i}`;
|
|
3537
3537
|
}
|
|
3538
|
-
var motionArtworkSvg = (artwork) =>
|
|
3538
|
+
var motionArtworkSvg = (artwork) => _chunkHRI3ZMDMcjs.vectorDocumentToSvg.call(void 0, artwork);
|
|
3539
3539
|
var tag = (commands, source) => commands.map((c) => c.type === "wait" ? c : { ...c, source });
|
|
3540
3540
|
function motionCommandsFromEffect(artwork, motion, source) {
|
|
3541
3541
|
const imported = fromFlairSvgMotion({ svg: motionArtworkSvg(artwork), animate: [..._nullishCoalesce(motion.animate, () => ( []))] });
|
|
@@ -4643,7 +4643,7 @@ function createAnimationEditorToolProvider(controller, options = {}) {
|
|
|
4643
4643
|
handler: ({ svg }) => {
|
|
4644
4644
|
let artwork;
|
|
4645
4645
|
try {
|
|
4646
|
-
artwork =
|
|
4646
|
+
artwork = _chunkHRI3ZMDMcjs.parseVectorSvg.call(void 0, svg);
|
|
4647
4647
|
} catch (error) {
|
|
4648
4648
|
throw new Error(`The SVG could not be read: ${error.message}. Nothing was changed.`);
|
|
4649
4649
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createVectorMorph
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-DAS7M4RY.js";
|
|
4
4
|
import {
|
|
5
5
|
MOTION_ISSUE_CODES,
|
|
6
6
|
motionIssue,
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
vectorNodeBounds,
|
|
32
32
|
vectorPathWorldBezier,
|
|
33
33
|
vectorTextHasOutlines
|
|
34
|
-
} from "../chunk-
|
|
34
|
+
} from "../chunk-77SG47WT.js";
|
|
35
35
|
import "../chunk-ORDXMBD4.js";
|
|
36
36
|
import "../chunk-M6DNZNVY.js";
|
|
37
37
|
import {
|
package/dist/bridge/cli.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict"; function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../chunk-
|
|
4
|
+
var _chunkENIZYNEFcjs = require('../chunk-ENIZYNEF.cjs');
|
|
5
|
+
require('../chunk-Y4BWZB6J.cjs');
|
|
6
6
|
require('../chunk-2BSBFBOA.cjs');
|
|
7
7
|
require('../chunk-WOFXZ3XU.cjs');
|
|
8
8
|
|
|
@@ -23,7 +23,7 @@ args.forEach((arg, i) => {
|
|
|
23
23
|
if (arg === "--origin" && args[i + 1]) origins.push(args[i + 1]);
|
|
24
24
|
});
|
|
25
25
|
var port = value("--port");
|
|
26
|
-
void
|
|
26
|
+
void _chunkENIZYNEFcjs.createToolBridge.call(void 0, {
|
|
27
27
|
name: _nullishCoalesce(value("--name"), () => ( "pixerate")),
|
|
28
28
|
port: port !== void 0 ? Number(port) : void 0,
|
|
29
29
|
token: _nullishCoalesce(value("--token"), () => ( process.env.PIXERATE_BRIDGE_TOKEN)),
|
package/dist/bridge/cli.js
CHANGED
package/dist/bridge/index.cjs
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkENIZYNEFcjs = require('../chunk-ENIZYNEF.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkY4BWZB6Jcjs = require('../chunk-Y4BWZB6J.cjs');
|
|
11
11
|
require('../chunk-2BSBFBOA.cjs');
|
|
12
12
|
require('../chunk-WOFXZ3XU.cjs');
|
|
13
13
|
|
|
@@ -17,4 +17,4 @@ require('../chunk-WOFXZ3XU.cjs');
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
exports.TOOL_BRIDGE_DEFAULT_PORT =
|
|
20
|
+
exports.TOOL_BRIDGE_DEFAULT_PORT = _chunkY4BWZB6Jcjs.TOOL_BRIDGE_DEFAULT_PORT; exports.TOOL_BRIDGE_PROTOCOL = _chunkY4BWZB6Jcjs.TOOL_BRIDGE_PROTOCOL; exports.createToolBridge = _chunkENIZYNEFcjs.createToolBridge; exports.defaultSkillsDir = _chunkENIZYNEFcjs.defaultSkillsDir; exports.isLocalOrigin = _chunkENIZYNEFcjs.isLocalOrigin; exports.loadSkillFiles = _chunkENIZYNEFcjs.loadSkillFiles;
|