@pixerate/editor 0.99.0 → 0.101.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/THIRD_PARTY_NOTICES.md +4 -0
- package/dist/animation-editor/index.cjs +39 -39
- package/dist/animation-editor/index.d.cts +1 -1
- package/dist/animation-editor/index.d.ts +1 -1
- package/dist/animation-editor/index.js +1 -1
- package/dist/{chunk-YGZNGDIT.js → chunk-63EFQCT5.js} +807 -73
- package/dist/chunk-63EFQCT5.js.map +1 -0
- package/dist/{chunk-JF5PXN7W.cjs → chunk-KANRAHTL.cjs} +838 -104
- package/dist/chunk-KANRAHTL.cjs.map +1 -0
- package/dist/image-editor/index.cjs +321 -165
- package/dist/image-editor/index.cjs.map +1 -1
- package/dist/image-editor/index.d.cts +70 -11
- package/dist/image-editor/index.d.ts +70 -11
- package/dist/image-editor/index.js +165 -9
- package/dist/image-editor/index.js.map +1 -1
- package/dist/{svg-C9r284x8.d.cts → svg-Bj1MQFh6.d.cts} +395 -2
- package/dist/{svg-MVKBqwD4.d.ts → svg-vme0PLNo.d.ts} +395 -2
- package/dist/vector/index.cjs +1352 -584
- package/dist/vector/index.cjs.map +1 -1
- package/dist/vector/index.d.cts +302 -197
- package/dist/vector/index.d.ts +302 -197
- package/dist/vector/index.js +854 -86
- package/dist/vector/index.js.map +1 -1
- package/package.json +1 -1
- package/skills/pixerate-vector/SKILL.md +52 -2
- package/skills/pixerate-vector/references/commands.md +21 -0
- package/dist/chunk-JF5PXN7W.cjs.map +0 -1
- package/dist/chunk-YGZNGDIT.js.map +0 -1
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -41,6 +41,7 @@ reproduced at the end of this file. Paths are relative to each source repository
|
|
|
41
41
|
- `crates/tools/src/snap.rs` (`pass_dimensions`: a resized or created object's side matches another object's width or height in its own frame, nearest within the zone, when nothing else snapped on that axis) → `VectorSnapTargets.snapScale` / `matchSize` in `packages/core/src/vector/snap.ts`
|
|
42
42
|
- `crates/color/src/cms/mod.rs` (`simulate_cvd`: Machado–Oliveira–Fernandes 2009 colour-vision matrices in linear RGB) → `simulateChartVision` and `checkChartColors` in `packages/core/src/chart/color.ts`
|
|
43
43
|
- `crates/mcp/src/tools.rs` (`key`: keys through the real keyboard path) → `press_chart_key` in `packages/core/src/chart/tools.ts`
|
|
44
|
+
- `crates/render/src/fx.rs` (`draw_item_fx`, `inner_edge`, `split`, `outset`: drop shadow and outer glow as the blurred, grown silhouette under the object; inner shadow and inner glow as the offset inverse of the shape, blurred and clipped to it, over the object; feather as the object kept where its silhouette, inset by half the width and blurred by a quarter of it, is; spread / choke as growth instead of blur) → `vectorFilterSvg` in `packages/core/src/vector/filters.ts`; drawn as one SVG `<filter>` per node instead of offscreen layers, with a separate `spread` length instead of a percentage of the size, and satin, bevel and the directional / gradient feathers were not ported; test cases re-expressed → `packages/core/tests/vector-appearance.test.ts`
|
|
44
45
|
|
|
45
46
|
## effectcraft
|
|
46
47
|
|
|
@@ -85,6 +86,7 @@ reproduced at the end of this file. Paths are relative to each source repository
|
|
|
85
86
|
- `crates/pathops/src/width.rs` (`variable_outline`: one-sided widths offset along each side's normal, the outer side joined with the style's join and the inner side through the centre) → `packages/core/src/vector/varstroke.ts`
|
|
86
87
|
- `crates/render/src/boolean.rs` (`fold_cached` and `PathCache`: a boolean group's operands folded bottom to top, every prefix cached under a rolling hash of the operands it covers so the fold restarts from the longest cached prefix, least recently used half dropped when full, a step counter) and `crates/engine/src/booleans.rs` (per-operand operations falling back to the group's, a lone group setting the operation and clearing its operands', operands setting their own, anything else wrapped in a new group; results hit except while the group or a layer in it is selected, when operands are hit and outlined — `result_outline`, `outlined_operands`) → `foldVectorBooleanOperands`, `vectorEnteredGroups` and the live boolean shapes in `packages/core/src/vector/appearance.ts`, `booleanOp(op, { live })` and `hitPath` in `packages/core/src/vector/controller.ts`; the result is painted in the bottom operand's style instead of the group's own fills; test cases from `crates/render/src/boolean_cache_tests.rs` re-expressed → `packages/core/tests/vector-effects.test.ts`
|
|
87
88
|
- `crates/color/src/lib.rs` (`GradientKind` angular and diamond; `Gradient`'s three handles — start, end and the secondary axis' end — in the node's unit box) and `crates/render/src/paint.rs` (angular as a sweep from the main axis towards the third handle, diamond as the sum of the distances along both axes, laid out in the handles' frame) → the `start` / `end` / `width` frame, `conic` and `diamond` styles and `vectorGradientParam` in `packages/core/src/vector/gradient.ts`; conic and diamond gradients are drawn as SVG patterns of linear-gradient wedges and quadrants instead of a sweep shader and a baked image; test cases from `crates/render/src/paint_behaviour_tests.rs` re-expressed → `packages/core/tests/vector-gradient.test.ts`
|
|
89
|
+
- `crates/color/src/lib.rs` (`Paint { kind, opacity, visible, blend }` kept as a list per node, drawn bottom to top) and `crates/doc/src/props.rs` (`EffectKind` with `Shadow { color, offset, radius, spread }` defaults, `Effect::reach` as 1.5 × the blur radius plus spread and offset, the effect type names) → `VectorPaintLayer` / `VectorStyle.fills` in `packages/core/src/vector/types.ts`, `packages/core/src/vector/paintLayers.ts` and `VECTOR_FILTER_DEFAULTS` / `vectorFilterReach` in `packages/core/src/vector/filters.ts`; background blur, noise, texture and glass were not ported (they need the backdrop or a raster pass)
|
|
88
90
|
|
|
89
91
|
## filmcraft
|
|
90
92
|
|
|
@@ -104,6 +106,7 @@ reproduced at the end of this file. Paths are relative to each source repository
|
|
|
104
106
|
- `crates/ui-egui/src/panels/timeline.rs` (`ruler_steps`: the first step on a ladder that keeps labels apart) → `chartDateLabels` in `packages/core/src/chart/date.ts`, with calendar units
|
|
105
107
|
- `crates/scopes/src/summary.rs` (numeric summaries for agents that check visuals without looking) → `summarizeChart` in `packages/core/src/chart/summary.ts`
|
|
106
108
|
- `crates/golden` (committed reference renders with a regenerate mode) → `packages/core/tests/chart-golden.test.ts`
|
|
109
|
+
- `crates/render/src/blend.rs` (the 27 Premiere blend modes and their W3C compositing formulas) and `crates/render/src/graphic_clip.rs` (two strokes per shape, outer ones under the fill) were compared, not ported: `VECTOR_BLEND_MODES` in `packages/core/src/vector/types.ts` is the SVG / CSS `mix-blend-mode` subset of the image editor's modes, under the image editor's names
|
|
107
110
|
|
|
108
111
|
## gridcraft
|
|
109
112
|
|
|
@@ -245,6 +248,7 @@ GridCraft. Apache POI is © The Apache Software Foundation, licensed under the A
|
|
|
245
248
|
- `crates/mcp/src/tools.rs` (`command_batch`: `$N.path` result references, atomic batches with a label; `render_preview`) → `run_commands` in `packages/core/src/commands/agentTools.ts` and `render_chart` in `packages/core/src/chart/tools.ts`
|
|
246
249
|
- `crates/testkit/src/strategies.rs` and `invariants.rs` (random command sequences with junk values, invariants, undo-all / redo-all) → `packages/core/tests/chart-property.test.ts`
|
|
247
250
|
- `crates/svg/src/export.rs` (`<title>` and `<desc>` in exported SVG) → `chartSceneToSvg` in `packages/core/src/chart/svg.ts`
|
|
251
|
+
- `crates/doc/src/appearance.rs` (`FillLayer` / `StrokeLayer`: each stroke with its own width, alignment, caps, joins, dashes, arrowheads and profile, and each layer with its own opacity, blend mode and visibility) → `VectorStrokeLayer` in `packages/core/src/vector/types.ts` and `vectorPaintLayerNodes` / `hitTestVectorPaintLayer` in `packages/core/src/vector/paintLayers.ts`; the stack keeps fills under strokes (figcraft's order) instead of vectorcraft's interleaved `AppearanceItem` list, and path effects stay per node; test cases re-expressed → `packages/core/tests/vector-appearance.test.ts`
|
|
248
252
|
|
|
249
253
|
## wordcraft
|
|
250
254
|
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkKANRAHTLcjs = require('../chunk-KANRAHTL.cjs');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
@@ -558,7 +558,7 @@ function smoothMotionTimes(points, start, duration, pacing = "even") {
|
|
|
558
558
|
function motionTextLayout(nodes, id) {
|
|
559
559
|
const group = _optionalChain([nodes, 'access', _5 => _5.get, 'call', _6 => _6(id), 'optionalAccess', _7 => _7.node]);
|
|
560
560
|
if (!group || group.type !== "group") return null;
|
|
561
|
-
const letters =
|
|
561
|
+
const letters = _chunkKANRAHTLcjs.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);
|
|
562
562
|
if (!letters.length) return null;
|
|
563
563
|
const lines = [];
|
|
564
564
|
for (const l of [...letters].sort((a, c) => a.b.y + a.b.height / 2 - (c.b.y + c.b.height / 2))) {
|
|
@@ -643,11 +643,11 @@ function indexMotionNodes(nodes) {
|
|
|
643
643
|
const out = /* @__PURE__ */ new Map();
|
|
644
644
|
const walk = (list, parentWorld, ancestors) => {
|
|
645
645
|
for (const node of list) {
|
|
646
|
-
const local =
|
|
647
|
-
const bounds =
|
|
646
|
+
const local = _chunkKANRAHTLcjs.vectorNodeBounds.call(void 0, node);
|
|
647
|
+
const bounds = _chunkKANRAHTLcjs.vectorNodeBounds.call(void 0, node, parentWorld);
|
|
648
648
|
const center = local ? { x: local.x + local.width / 2, y: local.y + local.height / 2 } : { x: 0, y: 0 };
|
|
649
649
|
if (!out.has(node.id)) out.set(node.id, { node, ancestors, parentWorld, center, bounds, box: local });
|
|
650
|
-
if (node.type === "group") walk(node.children, _chunkDWGZUSEScjs.multiplyMatrices.call(void 0,
|
|
650
|
+
if (node.type === "group") walk(node.children, _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, _chunkKANRAHTLcjs.nodeMatrix.call(void 0, node), parentWorld), [...ancestors, node.id]);
|
|
651
651
|
}
|
|
652
652
|
};
|
|
653
653
|
walk(nodes, _chunkDWGZUSEScjs.IDENTITY_MATRIX, []);
|
|
@@ -657,7 +657,7 @@ function indexMotionNodes(nodes) {
|
|
|
657
657
|
var solid = (paint) => typeof paint === "string" && paint !== "none" ? paint : void 0;
|
|
658
658
|
function firstPaint(node, key) {
|
|
659
659
|
if (node.type === "path") return solid(node[key]);
|
|
660
|
-
for (const p of
|
|
660
|
+
for (const p of _chunkKANRAHTLcjs.collectPathNodes.call(void 0, node)) {
|
|
661
661
|
const s = solid(p[key]);
|
|
662
662
|
if (s) return s;
|
|
663
663
|
}
|
|
@@ -665,7 +665,7 @@ function firstPaint(node, key) {
|
|
|
665
665
|
}
|
|
666
666
|
function strokeReach(node) {
|
|
667
667
|
let reach = 0;
|
|
668
|
-
for (const p of node.type === "path" ? [node] :
|
|
668
|
+
for (const p of node.type === "path" ? [node] : _chunkKANRAHTLcjs.collectPathNodes.call(void 0, node)) {
|
|
669
669
|
if (p.stroke == null || p.stroke === "none") continue;
|
|
670
670
|
const width = _nullishCoalesce(p.strokeWidth, () => ( 1));
|
|
671
671
|
reach = Math.max(reach, p.strokeAlign === "outside" ? width : p.strokeAlign === "inside" ? 0 : width / 2);
|
|
@@ -735,7 +735,7 @@ function motionRestValue(entry, property, artwork) {
|
|
|
735
735
|
case "stroke":
|
|
736
736
|
return _nullishCoalesce((node && firstPaint(node, property)), () => ( "transparent"));
|
|
737
737
|
case "strokeWidth": {
|
|
738
|
-
const path = _optionalChain([node, 'optionalAccess', _13 => _13.type]) === "path" ? node : node ?
|
|
738
|
+
const path = _optionalChain([node, 'optionalAccess', _13 => _13.type]) === "path" ? node : node ? _chunkKANRAHTLcjs.collectPathNodes.call(void 0, node)[0] : void 0;
|
|
739
739
|
return _nullishCoalesce(_optionalChain([path, 'optionalAccess', _14 => _14.strokeWidth]), () => ( 1));
|
|
740
740
|
}
|
|
741
741
|
case "shape":
|
|
@@ -848,10 +848,10 @@ function resolveMotionCamera(camera, scene) {
|
|
|
848
848
|
}
|
|
849
849
|
function motionPathLength(node, parentWorld = _chunkDWGZUSEScjs.IDENTITY_MATRIX) {
|
|
850
850
|
let longest = 0;
|
|
851
|
-
const paths = node.type === "path" ? [node] :
|
|
851
|
+
const paths = node.type === "path" ? [node] : _chunkKANRAHTLcjs.collectPathNodes.call(void 0, node);
|
|
852
852
|
for (const p of paths) {
|
|
853
853
|
try {
|
|
854
|
-
longest = Math.max(longest, _chunkXGD3FSNCcjs.bezierPathLength.call(void 0,
|
|
854
|
+
longest = Math.max(longest, _chunkXGD3FSNCcjs.bezierPathLength.call(void 0, _chunkKANRAHTLcjs.vectorPathWorldBezier.call(void 0, p, parentWorld, { effects: false })));
|
|
855
855
|
} catch (e2) {
|
|
856
856
|
}
|
|
857
857
|
}
|
|
@@ -1104,12 +1104,12 @@ function compileMotionScene(scene) {
|
|
|
1104
1104
|
const order2 = _nullishCoalesce(o.order, () => ( "together"));
|
|
1105
1105
|
const pace = _nullishCoalesce(o.pace, () => ( "time"));
|
|
1106
1106
|
if (order2 === "together" && pace === "time") return null;
|
|
1107
|
-
const paths = entry.node.type === "path" ? [entry.node] :
|
|
1107
|
+
const paths = entry.node.type === "path" ? [entry.node] : _chunkKANRAHTLcjs.collectPathNodes.call(void 0, entry.node);
|
|
1108
1108
|
let list = paths.map((p) => {
|
|
1109
1109
|
const at = nodes.get(p.id);
|
|
1110
1110
|
let first = { x: 0, y: 0 };
|
|
1111
1111
|
try {
|
|
1112
|
-
const m =
|
|
1112
|
+
const m = _chunkKANRAHTLcjs.vectorPathWorldBezier.call(void 0, p, _nullishCoalesce(_optionalChain([at, 'optionalAccess', _41 => _41.parentWorld]), () => ( _chunkDWGZUSEScjs.IDENTITY_MATRIX)), { effects: false })[0];
|
|
1113
1113
|
if (m && m.type === "M") first = { x: m.x, y: m.y };
|
|
1114
1114
|
} catch (e3) {
|
|
1115
1115
|
}
|
|
@@ -1373,12 +1373,12 @@ function morphBetween(a, b) {
|
|
|
1373
1373
|
let inner = morphCache.get(a);
|
|
1374
1374
|
if (!inner) morphCache.set(a, inner = /* @__PURE__ */ new WeakMap());
|
|
1375
1375
|
let morph = inner.get(b);
|
|
1376
|
-
if (!morph) inner.set(b, morph =
|
|
1376
|
+
if (!morph) inner.set(b, morph = _chunkKANRAHTLcjs.createVectorMorph.call(void 0, a, b, { id: a.id }));
|
|
1377
1377
|
return morph;
|
|
1378
1378
|
}
|
|
1379
1379
|
function shapeIn(entry, shape) {
|
|
1380
1380
|
if (shape === entry) return entry.node;
|
|
1381
|
-
const m = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, _chunkDWGZUSEScjs.multiplyMatrices.call(void 0,
|
|
1381
|
+
const m = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, _chunkKANRAHTLcjs.nodeMatrix.call(void 0, shape.node), shape.parentWorld), _chunkDWGZUSEScjs.invertMatrix.call(void 0, entry.parentWorld));
|
|
1382
1382
|
return { ...shape.node, ..._chunkDWGZUSEScjs.isIdentityMatrix.call(void 0, m) ? { transform: void 0 } : { transform: m } };
|
|
1383
1383
|
}
|
|
1384
1384
|
function shapeAt(entry, timeline, nodes, time) {
|
|
@@ -1399,7 +1399,7 @@ function shapeAt(entry, timeline, nodes, time) {
|
|
|
1399
1399
|
function motionFollowRoute(entry, path) {
|
|
1400
1400
|
if (!path || path.node.type !== "path") return null;
|
|
1401
1401
|
try {
|
|
1402
|
-
return _chunkXGD3FSNCcjs.transformBezierPath.call(void 0,
|
|
1402
|
+
return _chunkXGD3FSNCcjs.transformBezierPath.call(void 0, _chunkKANRAHTLcjs.vectorPathWorldBezier.call(void 0, path.node, path.parentWorld, { effects: false }), _chunkDWGZUSEScjs.invertMatrix.call(void 0, entry.parentWorld));
|
|
1403
1403
|
} catch (e4) {
|
|
1404
1404
|
return null;
|
|
1405
1405
|
}
|
|
@@ -1502,7 +1502,7 @@ function motionFrameAt(scene, time, options = {}) {
|
|
|
1502
1502
|
const start = Math.min(1, Math.max(0, typeof drawStart === "number" ? drawStart : 0));
|
|
1503
1503
|
const end = Math.min(1, Math.max(0, typeof drawEnd === "number" ? drawEnd : 1));
|
|
1504
1504
|
if (start > 0 || end < 1) {
|
|
1505
|
-
const trim =
|
|
1505
|
+
const trim = _chunkKANRAHTLcjs.createVectorEffect.call(void 0, "trim", MOTION_DRAW_EFFECT_ID, { start: tidy(start * 100), end: tidy(end * 100) });
|
|
1506
1506
|
p = { ...p, effects: [trim, ...(_nullishCoalesce(p.effects, () => ( []))).filter((e) => e.id !== MOTION_DRAW_EFFECT_ID)] };
|
|
1507
1507
|
}
|
|
1508
1508
|
}
|
|
@@ -1517,7 +1517,7 @@ function motionFrameAt(scene, time, options = {}) {
|
|
|
1517
1517
|
}
|
|
1518
1518
|
const offset = options.offsets === false ? null : motionNodeOffset(entry, timeline, time, nodes);
|
|
1519
1519
|
if (offset && !_chunkDWGZUSEScjs.isIdentityMatrix.call(void 0, offset.matrix)) {
|
|
1520
|
-
const m = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0,
|
|
1520
|
+
const m = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, _chunkKANRAHTLcjs.nodeMatrix.call(void 0, out), offset.matrix).map(tidy);
|
|
1521
1521
|
out = { ...out, transform: m };
|
|
1522
1522
|
}
|
|
1523
1523
|
return out;
|
|
@@ -1537,7 +1537,7 @@ function motionFrameToSvg(scene, time, options = {}) {
|
|
|
1537
1537
|
const wrap = { ...options.wrap };
|
|
1538
1538
|
for (const [id, clips] of Object.entries(frame.clips))
|
|
1539
1539
|
wrap[id] = [..._nullishCoalesce(wrap[id], () => ( [])), ...clips.map((clip, i) => ({ clip: { id: `${prefix}reveal-${id}-${i}`, shape: clip.shape, attrs: motionClipAttrs(clip) } }))];
|
|
1540
|
-
return withViewBox(
|
|
1540
|
+
return withViewBox(_chunkKANRAHTLcjs.vectorDocumentToSvg.call(void 0, frame.document, { ...options, wrap }), frame.camera);
|
|
1541
1541
|
}
|
|
1542
1542
|
function withViewBox(svg, box) {
|
|
1543
1543
|
const f = (n) => String(Math.round(n * 1e3) / 1e3);
|
|
@@ -1720,8 +1720,8 @@ function visibleAt(timeline, id, time, node) {
|
|
|
1720
1720
|
if (Array.isArray(rect) && (rect[2] <= 1e-4 || rect[3] <= 1e-4)) return false;
|
|
1721
1721
|
const circle = clip("clipCircle");
|
|
1722
1722
|
if (Array.isArray(circle) && circle[2] <= 1e-4) return false;
|
|
1723
|
-
const hasFill = node.type === "path" ? !!node.fill && node.fill !== "none" :
|
|
1724
|
-
const drawn = num2("drawEnd", 1) > 0.01 && (node.type === "path" ||
|
|
1723
|
+
const hasFill = node.type === "path" ? !!node.fill && node.fill !== "none" : _chunkKANRAHTLcjs.collectPathNodes.call(void 0, node).some((p) => p.fill && p.fill !== "none");
|
|
1724
|
+
const drawn = num2("drawEnd", 1) > 0.01 && (node.type === "path" || _chunkKANRAHTLcjs.collectPathNodes.call(void 0, node).length === 0 || _chunkKANRAHTLcjs.collectPathNodes.call(void 0, node).some((p) => {
|
|
1725
1725
|
const v = trackValue(timeline.tracks.get(motionTrackKey(p.id, "drawEnd")), time);
|
|
1726
1726
|
return typeof v !== "number" || v > 0.01;
|
|
1727
1727
|
}));
|
|
@@ -1807,7 +1807,7 @@ function checkMotionScene(scene) {
|
|
|
1807
1807
|
}
|
|
1808
1808
|
for (const id of targets) {
|
|
1809
1809
|
const node = nodes.get(id).node;
|
|
1810
|
-
const paths = node.type === "path" ? [node] :
|
|
1810
|
+
const paths = node.type === "path" ? [node] : _chunkKANRAHTLcjs.collectPathNodes.call(void 0, node);
|
|
1811
1811
|
if (paths.some((p) => p[key] !== void 0 && p[key] !== null && typeof p[key] !== "string"))
|
|
1812
1812
|
issues.push(_chunkWAJQKWQUcjs.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] }));
|
|
1813
1813
|
}
|
|
@@ -1820,7 +1820,7 @@ function checkMotionScene(scene) {
|
|
|
1820
1820
|
else
|
|
1821
1821
|
for (const id of targets) {
|
|
1822
1822
|
const node = nodes.get(id).node;
|
|
1823
|
-
const paths = node.type === "path" ? [node] :
|
|
1823
|
+
const paths = node.type === "path" ? [node] : _chunkKANRAHTLcjs.collectPathNodes.call(void 0, node);
|
|
1824
1824
|
if (paths.some((p) => typeof p[key] !== "string"))
|
|
1825
1825
|
issues.push(_chunkWAJQKWQUcjs.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] }));
|
|
1826
1826
|
}
|
|
@@ -2404,7 +2404,7 @@ function toFlairSvgMotion(scene, options = {}) {
|
|
|
2404
2404
|
raw: (t) => transformAt(t, true)
|
|
2405
2405
|
});
|
|
2406
2406
|
}
|
|
2407
|
-
const paths = node.type === "path" ? [node] :
|
|
2407
|
+
const paths = node.type === "path" ? [node] : _chunkKANRAHTLcjs.collectPathNodes.call(void 0, node);
|
|
2408
2408
|
for (const path of paths) {
|
|
2409
2409
|
if (pathsSeen.has(path.id)) continue;
|
|
2410
2410
|
pathsSeen.add(path.id);
|
|
@@ -2426,7 +2426,7 @@ function toFlairSvgMotion(scene, options = {}) {
|
|
|
2426
2426
|
if (shapeSegments.length) {
|
|
2427
2427
|
if (node.type !== "path") notes.push(`"${id}" is a group: its morph or effect animation is not exported (Flair tweens one path's "d").`);
|
|
2428
2428
|
else {
|
|
2429
|
-
const inverse = _chunkDWGZUSEScjs.invertMatrix.call(void 0,
|
|
2429
|
+
const inverse = _chunkDWGZUSEScjs.invertMatrix.call(void 0, _chunkKANRAHTLcjs.nodeMatrix.call(void 0, node));
|
|
2430
2430
|
channels.push({
|
|
2431
2431
|
id,
|
|
2432
2432
|
kind: "attr",
|
|
@@ -2435,9 +2435,9 @@ function toFlairSvgMotion(scene, options = {}) {
|
|
|
2435
2435
|
exact: () => false,
|
|
2436
2436
|
value: (t) => {
|
|
2437
2437
|
const frame = motionFrameAt(scene, t, { draw: false, offsets: false });
|
|
2438
|
-
const now =
|
|
2438
|
+
const now = _chunkKANRAHTLcjs.expandVectorAppearance.call(void 0, _optionalChain([indexMotionNodes, 'call', _108 => _108(frame.document.nodes), 'access', _109 => _109.get, 'call', _110 => _110(id), 'optionalAccess', _111 => _111.node]));
|
|
2439
2439
|
if (!now || now.type !== "path") return "";
|
|
2440
|
-
const bezier = _chunkXGD3FSNCcjs.transformBezierPath.call(void 0,
|
|
2440
|
+
const bezier = _chunkXGD3FSNCcjs.transformBezierPath.call(void 0, _chunkKANRAHTLcjs.vectorPathWorldBezier.call(void 0, now, _chunkDWGZUSEScjs.IDENTITY_MATRIX, { effects: false }), inverse);
|
|
2441
2441
|
return _chunkXGD3FSNCcjs.bezierPathToSvg.call(void 0, bezier, { precision: Math.min(precision, 2) });
|
|
2442
2442
|
}
|
|
2443
2443
|
});
|
|
@@ -2544,7 +2544,7 @@ function toFlairSvgMotion(scene, options = {}) {
|
|
|
2544
2544
|
}
|
|
2545
2545
|
if (scene.motionBlur) notes.push("Motion blur is drawn on the stage only; Flair plays the scene sharp.");
|
|
2546
2546
|
if (trigger && (_nullishCoalesce(scene.loop, () => ( "none"))) !== "none") notes.push(`The scene plays on ${trigger}, so its loop does not apply in Flair.`);
|
|
2547
|
-
let svg =
|
|
2547
|
+
let svg = _chunkKANRAHTLcjs.vectorDocumentToSvg.call(void 0, { ...scene.artwork, nodes: _chunkKANRAHTLcjs.expandVectorAppearances.call(void 0, scene.artwork.nodes) }, { pretty: false, precision, wrap });
|
|
2548
2548
|
if (routes.length) svg = svg.replace(/^(<svg[^>]*>)/, `$1<defs>${routes.join("")}</defs>`);
|
|
2549
2549
|
let motion = { svg, animate };
|
|
2550
2550
|
if (_optionalChain([scene, 'access', _114 => _114.controls, 'optionalAccess', _115 => _115.length])) {
|
|
@@ -2628,8 +2628,8 @@ function easingOf(ease, fallback) {
|
|
|
2628
2628
|
return fallback;
|
|
2629
2629
|
}
|
|
2630
2630
|
function poseOf(value, entry) {
|
|
2631
|
-
const t =
|
|
2632
|
-
const o = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, _nullishCoalesce(_chunkDWGZUSEScjs.invertMatrix.call(void 0,
|
|
2631
|
+
const t = _chunkKANRAHTLcjs.parseSvgTransform.call(void 0, String(value));
|
|
2632
|
+
const o = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, _nullishCoalesce(_chunkDWGZUSEScjs.invertMatrix.call(void 0, _chunkKANRAHTLcjs.nodeMatrix.call(void 0, entry.node)), () => ( [1, 0, 0, 1, 0, 0])), t);
|
|
2633
2633
|
const sx = Math.hypot(o[0], o[1]);
|
|
2634
2634
|
if (!(sx > 1e-9)) return null;
|
|
2635
2635
|
const sy = (o[0] * o[3] - o[1] * o[2]) / sx;
|
|
@@ -2720,7 +2720,7 @@ function fromFlairSvgMotion(input, options = {}) {
|
|
|
2720
2720
|
const notes = [];
|
|
2721
2721
|
if (!input || typeof input.svg !== "string") throw new Error('Give a Flair SvgMotion: { svg: "<svg \u2026>", animate: [ \u2026 ] }.');
|
|
2722
2722
|
const { motion, controls } = resolvePlaceholders(input, notes);
|
|
2723
|
-
const artwork =
|
|
2723
|
+
const artwork = _chunkKANRAHTLcjs.parseVectorSvg.call(void 0, motion.svg);
|
|
2724
2724
|
const nodes = indexMotionNodes(artwork.nodes);
|
|
2725
2725
|
const byStep = /* @__PURE__ */ new Map();
|
|
2726
2726
|
for (const anim of _nullishCoalesce(motion.animate, () => ( []))) {
|
|
@@ -2967,9 +2967,9 @@ function toLottie(scene, options = {}) {
|
|
|
2967
2967
|
const items = [];
|
|
2968
2968
|
const shapeSegments = [...timeline.tracks.entries()].filter(([k]) => k.startsWith(`${path.id}\0`) && (k.endsWith("\0shape") || k.includes("\0effect:"))).flatMap(([, v]) => v);
|
|
2969
2969
|
const geometryAt = (t) => {
|
|
2970
|
-
if (!shapeSegments.length) return
|
|
2970
|
+
if (!shapeSegments.length) return _chunkKANRAHTLcjs.vectorPathWorldBezier.call(void 0, path);
|
|
2971
2971
|
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]);
|
|
2972
|
-
return now && now.type === "path" ?
|
|
2972
|
+
return now && now.type === "path" ? _chunkKANRAHTLcjs.vectorPathWorldBezier.call(void 0, _chunkKANRAHTLcjs.expandVectorAppearances.call(void 0, [now])[0]) : _chunkKANRAHTLcjs.vectorPathWorldBezier.call(void 0, path);
|
|
2973
2973
|
};
|
|
2974
2974
|
const rest = lottieContours(_chunkXGD3FSNCcjs.toBezierPath.call(void 0, geometryAt(0)), round2);
|
|
2975
2975
|
rest.forEach((contour, n) => {
|
|
@@ -3043,7 +3043,7 @@ function toLottie(scene, options = {}) {
|
|
|
3043
3043
|
if (node.type === "path") inner = [...pathShapes(node)];
|
|
3044
3044
|
else {
|
|
3045
3045
|
inner = shown(node.children).reverse().map(nodeGroup);
|
|
3046
|
-
const m =
|
|
3046
|
+
const m = _chunkKANRAHTLcjs.nodeMatrix.call(void 0, node);
|
|
3047
3047
|
if (m !== _chunkDWGZUSEScjs.IDENTITY_MATRIX) {
|
|
3048
3048
|
const parts = staticParts(m);
|
|
3049
3049
|
if (!parts) notes.push(`"${node.id}": its transform skews, which is not exported; it is drawn without the skew.`);
|
|
@@ -3057,7 +3057,7 @@ function toLottie(scene, options = {}) {
|
|
|
3057
3057
|
const body = { ty: "gr", nm: `${node.id} (own)`, it: [...inner, innerTr] };
|
|
3058
3058
|
return { ty: "gr", nm: _nullishCoalesce(node.name, () => ( node.id)), it: [body, poseTransform(entry)] };
|
|
3059
3059
|
};
|
|
3060
|
-
const artwork = { ...scene.artwork, nodes:
|
|
3060
|
+
const artwork = { ...scene.artwork, nodes: _chunkKANRAHTLcjs.expandVectorAppearances.call(void 0, scene.artwork.nodes) };
|
|
3061
3061
|
const content = shown(artwork.nodes).reverse().map(nodeGroup);
|
|
3062
3062
|
if (artwork.background && rgba(artwork.background))
|
|
3063
3063
|
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()] });
|
|
@@ -3156,11 +3156,11 @@ function preset(prst, w, h) {
|
|
|
3156
3156
|
const poly = (pts) => [{ closed: true, anchors: pts.map(([x, y]) => ({ x, y })) }];
|
|
3157
3157
|
switch (prst) {
|
|
3158
3158
|
case "rect":
|
|
3159
|
-
return [
|
|
3159
|
+
return [_chunkKANRAHTLcjs.rectSubpath.call(void 0, { x: 0, y: 0, width: w, height: h })];
|
|
3160
3160
|
case "roundRect":
|
|
3161
|
-
return [
|
|
3161
|
+
return [_chunkKANRAHTLcjs.rectSubpath.call(void 0, { x: 0, y: 0, width: w, height: h }, Math.min(w, h) * 0.16667)];
|
|
3162
3162
|
case "ellipse":
|
|
3163
|
-
return [
|
|
3163
|
+
return [_chunkKANRAHTLcjs.ellipseSubpath.call(void 0, { x: 0, y: 0, width: w, height: h })];
|
|
3164
3164
|
case "triangle":
|
|
3165
3165
|
return poly([[w / 2, 0], [w, h], [0, h]]);
|
|
3166
3166
|
case "rtTriangle":
|
|
@@ -3268,7 +3268,7 @@ function shapes(ctx, tree, map) {
|
|
|
3268
3268
|
let subpaths = cust ? custom(cust, w, h) : prst ? preset(prst, w, h) : null;
|
|
3269
3269
|
if (!subpaths) {
|
|
3270
3270
|
if (prst) ctx.notes.push(`"${name}" is a ${prst}, drawn as its bounding rectangle.`);
|
|
3271
|
-
subpaths = [
|
|
3271
|
+
subpaths = [_chunkKANRAHTLcjs.rectSubpath.call(void 0, { x: 0, y: 0, width: w, height: h })];
|
|
3272
3272
|
}
|
|
3273
3273
|
const style = kid(el, "style");
|
|
3274
3274
|
const fill = kid(spPr, "noFill") ? null : _nullishCoalesce(colour(ctx, kid(spPr, "solidFill")), () => ( (el.localName === "cxnSp" ? null : colour(ctx, kid(style, "fillRef")))));
|
|
@@ -4253,7 +4253,7 @@ function createAnimationEditorToolProvider(controller, options = {}) {
|
|
|
4253
4253
|
handler: ({ svg }) => {
|
|
4254
4254
|
let artwork;
|
|
4255
4255
|
try {
|
|
4256
|
-
artwork =
|
|
4256
|
+
artwork = _chunkKANRAHTLcjs.parseVectorSvg.call(void 0, svg);
|
|
4257
4257
|
} catch (error) {
|
|
4258
4258
|
throw new Error(`The SVG could not be read: ${error.message}. Nothing was changed.`);
|
|
4259
4259
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { b as AnimationEasing } from '../easing-lM0Xo9Ni.cjs';
|
|
2
2
|
import { b as AnimationLoopMode, c as AnimationPlayer, C as Clock } from '../player-DrcP2xqj.cjs';
|
|
3
|
-
import { V as VectorDocument, a as VectorNode, b as VectorBounds, c as VectorSvgExportOptions } from '../svg-
|
|
3
|
+
import { V as VectorDocument, a as VectorNode, b as VectorBounds, c as VectorSvgExportOptions } from '../svg-Bj1MQFh6.cjs';
|
|
4
4
|
import { a as MotionBehavior } from '../behavior-Ymbld6jL.cjs';
|
|
5
5
|
import { A as AffineMatrix, B as BezierPath } from '../bezier-BfwIbVTl.cjs';
|
|
6
6
|
import { Z as ZipReadOptions } from '../zip-4nG0YAH7.cjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { b as AnimationEasing } from '../easing-lM0Xo9Ni.js';
|
|
2
2
|
import { b as AnimationLoopMode, c as AnimationPlayer, C as Clock } from '../player-DV4Jujdq.js';
|
|
3
|
-
import { V as VectorDocument, a as VectorNode, b as VectorBounds, c as VectorSvgExportOptions } from '../svg-
|
|
3
|
+
import { V as VectorDocument, a as VectorNode, b as VectorBounds, c as VectorSvgExportOptions } from '../svg-vme0PLNo.js';
|
|
4
4
|
import { a as MotionBehavior } from '../behavior-Ymbld6jL.js';
|
|
5
5
|
import { A as AffineMatrix, B as BezierPath } from '../bezier-DYBvLgUH.js';
|
|
6
6
|
import { Z as ZipReadOptions } from '../zip-4nG0YAH7.js';
|