@pixerate/editor 0.107.0 → 0.108.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-63EFQCT5.js → chunk-HUQ7EHVI.js} +1140 -371
- package/dist/chunk-HUQ7EHVI.js.map +1 -0
- package/dist/{chunk-KANRAHTL.cjs → chunk-UTEVPQTS.cjs} +1353 -584
- package/dist/chunk-UTEVPQTS.cjs.map +1 -0
- package/dist/paint-editor/index.cjs +196 -11
- package/dist/paint-editor/index.cjs.map +1 -1
- package/dist/paint-editor/index.d.cts +96 -2
- package/dist/paint-editor/index.d.ts +96 -2
- package/dist/paint-editor/index.js +190 -5
- package/dist/paint-editor/index.js.map +1 -1
- package/dist/{svg-Bj1MQFh6.d.cts → svg-ClVIG4T7.d.cts} +26 -2
- package/dist/{svg-vme0PLNo.d.ts → svg-SseJTIrA.d.ts} +26 -2
- package/dist/vector/index.cjs +977 -948
- package/dist/vector/index.cjs.map +1 -1
- package/dist/vector/index.d.cts +266 -7
- package/dist/vector/index.d.ts +266 -7
- package/dist/vector/index.js +427 -398
- package/dist/vector/index.js.map +1 -1
- package/package.json +1 -1
- package/skills/pixerate-image-editor/SKILL.md +50 -7
- package/skills/pixerate-vector/SKILL.md +35 -5
- package/dist/chunk-63EFQCT5.js.map +0 -1
- package/dist/chunk-KANRAHTL.cjs.map +0 -1
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -42,6 +42,7 @@ reproduced at the end of this file. Paths are relative to each source repository
|
|
|
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
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`
|
|
45
|
+
- `crates/render/src/fx.rs` (an item's body drawn inside a clip layer of a shape, `push_clip_layer` … `pop_layer`, with its effects outside the clip) → `vectorMaskRenderData` in `packages/core/src/vector/mask.ts` and the masked groups of `packages/core/src/vector/render.ts` / `svg.ts`; drawn as an SVG `<clipPath>` / `<mask>` on an inner group, the group's filter on the outer one; test cases re-expressed → `packages/core/tests/vector-mask.test.ts`
|
|
45
46
|
|
|
46
47
|
## effectcraft
|
|
47
48
|
|
|
@@ -87,6 +88,7 @@ reproduced at the end of this file. Paths are relative to each source repository
|
|
|
87
88
|
- `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`
|
|
88
89
|
- `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
90
|
- `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)
|
|
91
|
+
- `crates/doc/src/node.rs` (`is_mask` and `MaskType`: alpha, vector (outline) and luminance masks) and `crates/doc/src/geometry.rs` (`masked_out` / `covers`: a point is clipped away when the mask below it does not cover it, a hidden mask clips nothing, a group mask covers where any visible layer in it does) → `VectorMask` / `VectorGroupNode.mask` in `packages/core/src/vector/types.ts` and `vectorMaskContains` / `isVectorMaskActive` in `packages/core/src/vector/mask.ts`; the mask is a group's first child instead of a flag that masks the siblings above it, and an opacity mask is hit wherever it paints; test cases re-expressed → `packages/core/tests/vector-mask.test.ts`
|
|
90
92
|
|
|
91
93
|
## filmcraft
|
|
92
94
|
|
|
@@ -162,6 +164,7 @@ GridCraft. Apache POI is © The Apache Software Foundation, licensed under the A
|
|
|
162
164
|
- `crates/edit/src/text_regions.rs` (`group_layout`: runs joined on a baseline across small gaps, rows grouped into blocks by pitch and alignment, line-end hyphens removed when joining rows) → `packages/core/src/import/pdf-layout.ts`
|
|
163
165
|
- Test cases from `crates/export/src/lib.rs` (`grid_text_becomes_a_real_table_in_every_format`, `a_staircase_of_blocks_is_not_a_huge_table`, `two_column_body_text_is_not_mistaken_for_a_table`, `word_does_not_invent_borders_for_aligned_invoice_fields`), re-expressed → `packages/core/tests/pdf-layout.test.ts`
|
|
164
166
|
- `crates/geom/src/perspective.rs` (`Homography::from_points` with the eight-unknown system and the check that the four points really map, `Homography::apply`, `solve8` Gaussian elimination with partial pivoting, `order_quad`) → `homographyFromPoints`, `applyHomography`, `solve8` and `orderQuad` in `packages/core/src/geom/homography.ts` (re-exported as `vectorHomography`, `applyVectorHomography` and `orderVectorQuad` by `packages/core/src/vector/perspective.ts`), used by the vector editor's Free Distort and the image editor's Free Transform; test cases re-expressed → `packages/core/tests/vector-distort.test.ts`
|
|
167
|
+
- `crates/redact/src/interp.rs` (`clip_out`: everything but a region kept by an even-odd clip of a large rectangle around the content with the region cut out) → the inverted clipping masks of `vectorMaskRenderData` in `packages/core/src/vector/mask.ts`; the cut-out is the boolean union of the mask's outlines, so overlapping and nonzero shapes invert correctly; test cases re-expressed → `packages/core/tests/vector-mask.test.ts`
|
|
165
168
|
|
|
166
169
|
## photocraft
|
|
167
170
|
|
|
@@ -201,6 +204,7 @@ GridCraft. Apache POI is © The Apache Software Foundation, licensed under the A
|
|
|
201
204
|
- `crates/io/src/effects_map.rs` (`parse_lfx2` / `write_lfx2`: the per-kind descriptor keys, the single and `…Multi` instance keys, `present` / `enab`, blend ids as four-character codes or long string ids, contours with corner points, `parse_lrfx` for legacy effects), `crates/io/src/blocks.rs` (`color_from_desc` / `color_to_desc`, `gradient_style`, the `Grdn` colour and transparency stops, `pattern_ref`, `pattern_placement`), `crates/io/src/psd_import.rs` / `psd_export.rs` (`lmfx` over `lfx2` / `lfxs`, the block kept and written back while the effects are unchanged, odd-length blocks padded) and `crates/psd/src/patterns.rs` (`Patt` / `Pat2` / `Pat3` blocks: patterns, virtual memory array lists, written channels, padded channel rectangles) → `packages/core/src/image-editor/psd/effects.ts` and `patterns.ts`; gradient midpoints become extra stops and smoothness is drawn linearly (photocraft bakes Photoshop's interpolation), and patterns are written as 8-bit RGB; test cases re-expressed → `packages/core/tests/image-psd-effects.test.ts`
|
|
202
205
|
- `crates/doc/src/lib.rs` (`SmartObject`: contents shared by an identity that ordinary duplicates keep and New Smart Object via Copy renews, the embedded or linked `SmartSource`, the placement transform with a warp applied first in source pixels and a projective override, the ordered `smart_filters` with blend, opacity and visibility, the stack-wide `filters_enabled` switch and the one `filter_mask`, the rendered `cache`) → `SmartContents`, `SmartPlacement`, `SmartFilterStack` and `SmartObjectLayer` in `packages/core/src/image-editor/layers/model.ts` and the operations in `layers/smart.ts`; the placement is our Free Transform geometry (corners plus a Bézier mesh), the smart filters are our `develop` / `blur` layer filters, and rendering, caching and Edit Contents as a nested document are our own; test cases re-expressed → `packages/core/tests/image-smart-objects.test.ts`
|
|
203
206
|
- `crates/io/src/smart_map.rs` (the `soLD` descriptor keys `Idnt`, `placed`, `Trnf`, `nonAffineTransform`, `Sz `, `warp`, `filterFX`; `sold_bytes` with a template descriptor and a fresh one, `plld_bytes`, `warp_desc` for single-patch custom warps, `filter_from_item` / `item_for_filter` with neutral blending for unmodelled filters, `filter_fx`, `filter_mask_item`), `crates/io/src/blocks.rs` (`placed_frame`: a custom warp's control-point box as the quad's frame, `corners_affine` / `corners_perspective`, `parse_plld`, `warp_of`), `crates/io/src/linked.rs` (`liFD` items, `encode_linked_file`) and `crates/psd/src/filter_effects.rs` (`FEid` / `FXid` items, planes and masks) → `packages/core/src/image-editor/psd/smart.ts` and the smart-object parts of `psd/import.ts` and `psd/export.ts`; Box Blur is the one filter we draw (Camera Raw and the rest are kept, not drawn), warps are refitted onto the contents' rectangle, linked (`liFE`) contents come in as the stored pixels, and filter masks are written without the unfiltered cache; test cases re-expressed → `packages/core/tests/image-psd-smart.test.ts`
|
|
207
|
+
- `crates/doc/src/vector.rs` (shape layers: subpaths folded in order with their path operation, the first always combining, components filled with the path's fill rule; `ShapeStroke` width / alignment / caps / joins / Photoshop's miter limit 100 / dashes in multiples of the width; `LiveShape` rectangle with four corner radii, ellipse, polygon and star, and line as a filled bar) → `packages/core/src/image-editor/layers/model.ts` and `layers/shape.ts`; components hold several subpaths instead of photocraft's per-subpath `Join` operation, paths reuse the vector editor's anchors, shape factories and curve booleans, live shapes keep an affine transform, line arrowheads are our own, and shapes render through our own coverage rasterizer; test cases re-expressed → `packages/core/tests/image-shape-layers.test.ts`
|
|
204
208
|
|
|
205
209
|
## soundcraft
|
|
206
210
|
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkUTEVPQTScjs = require('../chunk-UTEVPQTS.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 = _chunkUTEVPQTScjs.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 = _chunkUTEVPQTScjs.vectorNodeBounds.call(void 0, node);
|
|
647
|
+
const bounds = _chunkUTEVPQTScjs.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, _chunkUTEVPQTScjs.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 _chunkUTEVPQTScjs.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] : _chunkUTEVPQTScjs.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 ? _chunkUTEVPQTScjs.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] : _chunkUTEVPQTScjs.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, _chunkUTEVPQTScjs.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] : _chunkUTEVPQTScjs.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 = _chunkUTEVPQTScjs.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 = _chunkUTEVPQTScjs.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, _chunkUTEVPQTScjs.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, _chunkUTEVPQTScjs.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 = _chunkUTEVPQTScjs.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, _chunkUTEVPQTScjs.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(_chunkUTEVPQTScjs.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" : _chunkUTEVPQTScjs.collectPathNodes.call(void 0, node).some((p) => p.fill && p.fill !== "none");
|
|
1724
|
+
const drawn = num2("drawEnd", 1) > 0.01 && (node.type === "path" || _chunkUTEVPQTScjs.collectPathNodes.call(void 0, node).length === 0 || _chunkUTEVPQTScjs.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] : _chunkUTEVPQTScjs.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] : _chunkUTEVPQTScjs.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] : _chunkUTEVPQTScjs.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, _chunkUTEVPQTScjs.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 = _chunkUTEVPQTScjs.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, _chunkUTEVPQTScjs.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 = _chunkUTEVPQTScjs.vectorDocumentToSvg.call(void 0, { ...scene.artwork, nodes: _chunkUTEVPQTScjs.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 = _chunkUTEVPQTScjs.parseSvgTransform.call(void 0, String(value));
|
|
2632
|
+
const o = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, _nullishCoalesce(_chunkDWGZUSEScjs.invertMatrix.call(void 0, _chunkUTEVPQTScjs.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 = _chunkUTEVPQTScjs.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 _chunkUTEVPQTScjs.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" ? _chunkUTEVPQTScjs.vectorPathWorldBezier.call(void 0, _chunkUTEVPQTScjs.expandVectorAppearances.call(void 0, [now])[0]) : _chunkUTEVPQTScjs.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 = _chunkUTEVPQTScjs.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: _chunkUTEVPQTScjs.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 [_chunkUTEVPQTScjs.rectSubpath.call(void 0, { x: 0, y: 0, width: w, height: h })];
|
|
3160
3160
|
case "roundRect":
|
|
3161
|
-
return [
|
|
3161
|
+
return [_chunkUTEVPQTScjs.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 [_chunkUTEVPQTScjs.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 = [_chunkUTEVPQTScjs.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 = _chunkUTEVPQTScjs.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-ClVIG4T7.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-SseJTIrA.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';
|