@pixerate/editor 0.248.0 → 0.249.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/README.md +1 -0
- package/dist/animation-editor/index.cjs +64 -61
- package/dist/animation-editor/index.js +8 -5
- package/dist/{brushstrokeRender-DTDPFBLC.cjs → brushstrokeRender-GCKK7V2I.cjs} +14 -11
- package/dist/{brushstrokeRender-QLCXROJK.js → brushstrokeRender-T3JZST44.js} +7 -4
- package/dist/canvas/index.cjs +8 -8
- package/dist/canvas/index.js +1 -1
- package/dist/{chunk-IBDU6EGZ.cjs → chunk-2SMMZDMG.cjs} +35 -35
- package/dist/{chunk-SC2RZ5EF.js → chunk-2VJAVXLI.js} +2 -2
- package/dist/{chunk-OLNIPTB3.cjs → chunk-2VX55NFM.cjs} +1 -320
- package/dist/chunk-3K6HWEXZ.cjs +92 -0
- package/dist/{chunk-UOOK7HTX.js → chunk-3PPJRMIG.js} +1 -1
- package/dist/chunk-4D6KP5BV.js +92 -0
- package/dist/chunk-5RH3VXAK.js +269 -0
- package/dist/{chunk-NZ3O3A5C.js → chunk-6BIDVPED.js} +1 -1
- package/dist/{chunk-2ONK3ERD.cjs → chunk-75K3W4D6.cjs} +20 -20
- package/dist/{chunk-7T7JWTVE.cjs → chunk-BOHDJJ2O.cjs} +8 -8
- package/dist/{chunk-2PBZBRP5.js → chunk-D5KGAO4Z.js} +10 -92
- package/dist/{chunk-5GLYUSNT.js → chunk-DOIU7VJG.js} +1 -1
- package/dist/{chunk-HB4ICNNA.cjs → chunk-DPYAO5U6.cjs} +42 -42
- package/dist/chunk-EJLRBS5Q.js +301 -0
- package/dist/{chunk-6G6ZDDDB.cjs → chunk-H4AOUUBE.cjs} +301 -149
- package/dist/{chunk-PQ3H2AAN.cjs → chunk-I7NJPHWV.cjs} +122 -204
- package/dist/{chunk-L6REDLNB.cjs → chunk-IOFVM3L3.cjs} +7 -7
- package/dist/{chunk-42TWUPNJ.js → chunk-IRSTHLQQ.js} +1 -320
- package/dist/{chunk-VNBUDVD4.js → chunk-J7T5QZ45.js} +226 -74
- package/dist/{chunk-VMROIWLL.cjs → chunk-KBYB7OWB.cjs} +3 -3
- package/dist/{chunk-TPWB4Y6L.cjs → chunk-KYX7NZ5V.cjs} +1 -1
- package/dist/chunk-LJRCU3BJ.cjs +301 -0
- package/dist/{chunk-WVS5KQDH.cjs → chunk-LP2MCSBE.cjs} +246 -244
- package/dist/{chunk-XNRBMYNB.js → chunk-O75V4ZS3.js} +1 -1
- package/dist/chunk-OTTT5N3K.js +322 -0
- package/dist/{chunk-Q2HA52V4.js → chunk-PZP2SZIZ.js} +2 -2
- package/dist/{chunk-ZFSLEOSQ.js → chunk-UBRJOIR5.js} +11 -9
- package/dist/chunk-W5M3J7PV.cjs +322 -0
- package/dist/{chunk-4P6H35HU.js → chunk-WA44NKPF.js} +2 -2
- package/dist/{chunk-XWTRATIM.cjs → chunk-WLJZZHUZ.cjs} +23 -23
- package/dist/{chunk-P3NIPIKS.js → chunk-WQCNC4DK.js} +1 -1
- package/dist/chunk-ZEYMKDYS.cjs +269 -0
- package/dist/image-editor/index.cjs +1055 -1050
- package/dist/image-editor/index.js +28 -23
- package/dist/paint/index.cjs +8 -5
- package/dist/paint/index.js +13 -10
- package/dist/paint-editor/controller.d.cts +37 -1
- package/dist/paint-editor/controller.d.ts +37 -1
- package/dist/paint-editor/index.cjs +745 -602
- package/dist/paint-editor/index.d.cts +3 -0
- package/dist/paint-editor/index.d.ts +3 -0
- package/dist/paint-editor/index.js +184 -41
- package/dist/paint-editor/sticker-art.d.cts +55 -0
- package/dist/paint-editor/sticker-art.d.ts +55 -0
- package/dist/paint-editor/stickers.d.cts +30 -17
- package/dist/paint-editor/stickers.d.ts +30 -17
- package/dist/paint-editor/stroke.d.cts +4 -0
- package/dist/paint-editor/stroke.d.ts +4 -0
- package/dist/paint-editor/ui.d.cts +10 -2
- package/dist/paint-editor/ui.d.ts +10 -2
- package/dist/raster/index.cjs +6 -4
- package/dist/raster/index.js +12 -10
- package/dist/stickers/browser.d.cts +48 -0
- package/dist/stickers/browser.d.ts +48 -0
- package/dist/stickers/combine.d.cts +10 -0
- package/dist/stickers/combine.d.ts +10 -0
- package/dist/stickers/conformance.d.cts +18 -0
- package/dist/stickers/conformance.d.ts +18 -0
- package/dist/stickers/editor.d.cts +14 -0
- package/dist/stickers/editor.d.ts +14 -0
- package/dist/stickers/errors.d.cts +6 -0
- package/dist/stickers/errors.d.ts +6 -0
- package/dist/stickers/fake.d.cts +16 -0
- package/dist/stickers/fake.d.ts +16 -0
- package/dist/stickers/helpers.d.cts +51 -0
- package/dist/stickers/helpers.d.ts +51 -0
- package/dist/stickers/index.cjs +331 -0
- package/dist/stickers/index.d.cts +16 -0
- package/dist/stickers/index.d.ts +16 -0
- package/dist/stickers/index.js +331 -0
- package/dist/stickers/stamps.d.cts +13 -0
- package/dist/stickers/stamps.d.ts +13 -0
- package/dist/stickers/tools.d.cts +25 -0
- package/dist/stickers/tools.d.ts +25 -0
- package/dist/stickers/types.d.cts +123 -0
- package/dist/stickers/types.d.ts +123 -0
- package/dist/vector/index.cjs +978 -975
- package/dist/vector/index.js +9 -6
- package/package.json +11 -1
- package/skills/README.md +1 -0
- package/skills/pixerate-paint-editor/SKILL.md +8 -5
- package/skills/pixerate-stickers/SKILL.md +45 -0
package/README.md
CHANGED
|
@@ -491,6 +491,7 @@ Each module is also available as a subpath import:
|
|
|
491
491
|
| `@pixerate/editor/parameters` | Schema-driven parameters editor for effects, shaders, generators and component props: `ParameterSchema` (number, int, boolean, choice, color, vector, image and text fields; groups; `showIf`), `ParametersController` (validation, undo with merged slider gestures, reset, randomize, presets, keyframe hooks), `createParameterCommands` for agents and `parameterSchemaFromShaderControls` (no third-party imports) |
|
|
492
492
|
| `@pixerate/editor/color` | Shared colour module: parsing (hex, rgb, hsl, oklab, oklch, color(srgb/p3)), conversions, OKLCH gamut mapping, WCAG 2 contrast, Machado colour-vision deficiency simulation, harmonies, dual light/dark colours and CSS export, the headless colour picker model, recent colours, and agent tools (no third-party imports) |
|
|
493
493
|
| `@pixerate/editor/gradient` | Gradient data model, CSS gradient serialization/deserialization, `GradientController` with undo, stop & midpoint editing, and gradient agent tools (opt-in: `/color` never imports it) (no third-party imports) |
|
|
494
|
+
| `@pixerate/editor/stickers` | The sticker provider contract: `StickerProvider` (list, search, describe and load stickers by id; licences, tintable art, SVG and PNG), `editorStickers()` (the editor's own stamps, the default library), `createFakeStickerProvider`, `combineStickerProviders` (refs `provider:id`), `checkStickerProvider`, `StickersSlot`, `StickerBrowser` (the pickers' state) and the `find_stickers` / `describe_sticker` agent tools (no third-party imports) |
|
|
494
495
|
|
|
495
496
|
The root entry (`@pixerate/editor`) re-exports everything except animation, canvas, agent, commands, persistence, generation, tokens, parameters, vector, chart, color, gradient and image editor, including TipTap. Import from the narrowest subpath you need: `grammar`, `history`, `animation`, `spreadsheet`, `commands`, `persistence`, `color`, `gradient` and `image-editor` have no third-party imports, so a spreadsheet-only app bundles no TipTap, markdown or dagre code. The package is marked `sideEffects: false`, so unused root exports are also tree-shaken.
|
|
496
497
|
|
|
@@ -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; var _class2;
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk2SMMZDMGcjs = require('../chunk-2SMMZDMG.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -39,8 +39,9 @@ var _chunkK5DS2JTAcjs = require('../chunk-K5DS2JTA.cjs');
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
var
|
|
43
|
-
require('../chunk-
|
|
42
|
+
var _chunkIOFVM3L3cjs = require('../chunk-IOFVM3L3.cjs');
|
|
43
|
+
require('../chunk-H4AOUUBE.cjs');
|
|
44
|
+
require('../chunk-ZEYMKDYS.cjs');
|
|
44
45
|
require('../chunk-CVFAAZXE.cjs');
|
|
45
46
|
|
|
46
47
|
|
|
@@ -71,9 +72,11 @@ var _chunkPY4GWSE2cjs = require('../chunk-PY4GWSE2.cjs');
|
|
|
71
72
|
|
|
72
73
|
var _chunkGHCSC2WPcjs = require('../chunk-GHCSC2WP.cjs');
|
|
73
74
|
require('../chunk-WOFXZ3XU.cjs');
|
|
74
|
-
require('../chunk-
|
|
75
|
+
require('../chunk-I7NJPHWV.cjs');
|
|
76
|
+
require('../chunk-3K6HWEXZ.cjs');
|
|
75
77
|
require('../chunk-YQGCPL5X.cjs');
|
|
76
|
-
require('../chunk-
|
|
78
|
+
require('../chunk-2VX55NFM.cjs');
|
|
79
|
+
require('../chunk-W5M3J7PV.cjs');
|
|
77
80
|
require('../chunk-474IQG74.cjs');
|
|
78
81
|
require('../chunk-XFM3OCHU.cjs');
|
|
79
82
|
require('../chunk-NIBFDFYW.cjs');
|
|
@@ -698,7 +701,7 @@ function smoothMotionTimes(points, start, duration, pacing = "even") {
|
|
|
698
701
|
function motionTextLayout(nodes, id) {
|
|
699
702
|
const group = _optionalChain([nodes, 'access', _5 => _5.get, 'call', _6 => _6(id), 'optionalAccess', _7 => _7.node]);
|
|
700
703
|
if (!group || group.type !== "group") return null;
|
|
701
|
-
const letters =
|
|
704
|
+
const letters = _chunkIOFVM3L3cjs.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);
|
|
702
705
|
if (!letters.length) return null;
|
|
703
706
|
const lines = [];
|
|
704
707
|
for (const l of [...letters].sort((a, c) => a.b.y + a.b.height / 2 - (c.b.y + c.b.height / 2))) {
|
|
@@ -783,21 +786,21 @@ function indexMotionNodes(nodes) {
|
|
|
783
786
|
const out = /* @__PURE__ */ new Map();
|
|
784
787
|
const walk = (list, parentWorld, ancestors) => {
|
|
785
788
|
for (const node of list) {
|
|
786
|
-
const local =
|
|
787
|
-
const bounds =
|
|
789
|
+
const local = _chunkIOFVM3L3cjs.vectorNodeBounds.call(void 0, node);
|
|
790
|
+
const bounds = _chunkIOFVM3L3cjs.vectorNodeBounds.call(void 0, node, parentWorld);
|
|
788
791
|
const center = local ? { x: local.x + local.width / 2, y: local.y + local.height / 2 } : { x: 0, y: 0 };
|
|
789
792
|
if (!out.has(node.id)) out.set(node.id, { node, ancestors, parentWorld, center, bounds, box: local });
|
|
790
|
-
if (node.type === "group") walk(node.children,
|
|
793
|
+
if (node.type === "group") walk(node.children, _chunkIOFVM3L3cjs.multiplyMatrices.call(void 0, _chunkIOFVM3L3cjs.nodeMatrix.call(void 0, node), parentWorld), [...ancestors, node.id]);
|
|
791
794
|
}
|
|
792
795
|
};
|
|
793
|
-
walk(nodes,
|
|
796
|
+
walk(nodes, _chunkIOFVM3L3cjs.IDENTITY_MATRIX, []);
|
|
794
797
|
indexCache.set(nodes, out);
|
|
795
798
|
return out;
|
|
796
799
|
}
|
|
797
800
|
var solid = (paint) => typeof paint === "string" && paint !== "none" ? paint : void 0;
|
|
798
801
|
function firstPaint(node, key) {
|
|
799
802
|
if (node.type === "path") return solid(node[key]);
|
|
800
|
-
for (const p of
|
|
803
|
+
for (const p of _chunkIOFVM3L3cjs.collectPathNodes.call(void 0, node)) {
|
|
801
804
|
const s = solid(p[key]);
|
|
802
805
|
if (s) return s;
|
|
803
806
|
}
|
|
@@ -805,7 +808,7 @@ function firstPaint(node, key) {
|
|
|
805
808
|
}
|
|
806
809
|
function strokeReach(node) {
|
|
807
810
|
let reach = 0;
|
|
808
|
-
for (const p of node.type === "path" ? [node] :
|
|
811
|
+
for (const p of node.type === "path" ? [node] : _chunkIOFVM3L3cjs.collectPathNodes.call(void 0, node)) {
|
|
809
812
|
if (p.stroke == null || p.stroke === "none") continue;
|
|
810
813
|
const width = _nullishCoalesce(p.strokeWidth, () => ( 1));
|
|
811
814
|
reach = Math.max(reach, p.strokeAlign === "outside" ? width : p.strokeAlign === "inside" ? 0 : width / 2);
|
|
@@ -875,7 +878,7 @@ function motionRestValue(entry, property, artwork) {
|
|
|
875
878
|
case "stroke":
|
|
876
879
|
return _nullishCoalesce((node && firstPaint(node, property)), () => ( "transparent"));
|
|
877
880
|
case "strokeWidth": {
|
|
878
|
-
const path = _optionalChain([node, 'optionalAccess', _13 => _13.type]) === "path" ? node : node ?
|
|
881
|
+
const path = _optionalChain([node, 'optionalAccess', _13 => _13.type]) === "path" ? node : node ? _chunkIOFVM3L3cjs.collectPathNodes.call(void 0, node)[0] : void 0;
|
|
879
882
|
return _nullishCoalesce(_optionalChain([path, 'optionalAccess', _14 => _14.strokeWidth]), () => ( 1));
|
|
880
883
|
}
|
|
881
884
|
case "shape":
|
|
@@ -986,12 +989,12 @@ function resolveMotionCamera(camera, scene) {
|
|
|
986
989
|
const r = camera;
|
|
987
990
|
return { x: r.x, y: r.y, width: r.width, height: r.height };
|
|
988
991
|
}
|
|
989
|
-
function motionPathLength(node, parentWorld =
|
|
992
|
+
function motionPathLength(node, parentWorld = _chunkIOFVM3L3cjs.IDENTITY_MATRIX) {
|
|
990
993
|
let longest = 0;
|
|
991
|
-
const paths = node.type === "path" ? [node] :
|
|
994
|
+
const paths = node.type === "path" ? [node] : _chunkIOFVM3L3cjs.collectPathNodes.call(void 0, node);
|
|
992
995
|
for (const p of paths) {
|
|
993
996
|
try {
|
|
994
|
-
longest = Math.max(longest, _chunkGF2RBSDMcjs.bezierPathLength.call(void 0,
|
|
997
|
+
longest = Math.max(longest, _chunkGF2RBSDMcjs.bezierPathLength.call(void 0, _chunkIOFVM3L3cjs.vectorPathWorldBezier.call(void 0, p, parentWorld, { effects: false })));
|
|
995
998
|
} catch (e2) {
|
|
996
999
|
}
|
|
997
1000
|
}
|
|
@@ -1267,12 +1270,12 @@ function compileMotionScene(scene) {
|
|
|
1267
1270
|
const order2 = _nullishCoalesce(o.order, () => ( "together"));
|
|
1268
1271
|
const pace = _nullishCoalesce(o.pace, () => ( "time"));
|
|
1269
1272
|
if (order2 === "together" && pace === "time") return null;
|
|
1270
|
-
const paths = entry.node.type === "path" ? [entry.node] :
|
|
1273
|
+
const paths = entry.node.type === "path" ? [entry.node] : _chunkIOFVM3L3cjs.collectPathNodes.call(void 0, entry.node);
|
|
1271
1274
|
let list = paths.map((p) => {
|
|
1272
1275
|
const at = nodes.get(p.id);
|
|
1273
1276
|
let first = { x: 0, y: 0 };
|
|
1274
1277
|
try {
|
|
1275
|
-
const m =
|
|
1278
|
+
const m = _chunkIOFVM3L3cjs.vectorPathWorldBezier.call(void 0, p, _nullishCoalesce(_optionalChain([at, 'optionalAccess', _42 => _42.parentWorld]), () => ( _chunkIOFVM3L3cjs.IDENTITY_MATRIX)), { effects: false })[0];
|
|
1276
1279
|
if (m && m.type === "M") first = { x: m.x, y: m.y };
|
|
1277
1280
|
} catch (e3) {
|
|
1278
1281
|
}
|
|
@@ -1384,17 +1387,17 @@ function compileMotionScene(scene) {
|
|
|
1384
1387
|
let dx = _nullishCoalesce(_optionalChain([command3, 'access', _45 => _45.by, 'optionalAccess', _46 => _46.x]), () => ( 0));
|
|
1385
1388
|
let dy = _nullishCoalesce(_optionalChain([command3, 'access', _47 => _47.by, 'optionalAccess', _48 => _48.y]), () => ( 0));
|
|
1386
1389
|
if (command3.to) {
|
|
1387
|
-
const inv =
|
|
1388
|
-
const target =
|
|
1390
|
+
const inv = _chunkIOFVM3L3cjs.invertMatrix.call(void 0, entry.parentWorld);
|
|
1391
|
+
const target = _chunkIOFVM3L3cjs.applyMatrix.call(void 0, inv, command3.to);
|
|
1389
1392
|
dx = target.x - (entry.center.x + num2("x"));
|
|
1390
1393
|
dy = target.y - (entry.center.y + num2("y"));
|
|
1391
1394
|
}
|
|
1392
1395
|
if (_optionalChain([command3, 'access', _49 => _49.via, 'optionalAccess', _50 => _50.length])) {
|
|
1393
|
-
const inv =
|
|
1396
|
+
const inv = _chunkIOFVM3L3cjs.invertMatrix.call(void 0, entry.parentWorld);
|
|
1394
1397
|
const x0 = num2("x");
|
|
1395
1398
|
const y0 = num2("y");
|
|
1396
1399
|
const add = command3.blend === "add";
|
|
1397
|
-
const offsets = [{ x: 0, y: 0 }, ...command3.via.map((p) =>
|
|
1400
|
+
const offsets = [{ x: 0, y: 0 }, ...command3.via.map((p) => _chunkIOFVM3L3cjs.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 }];
|
|
1398
1401
|
const times = _optionalChain([command3, 'access', _51 => _51.times, 'optionalAccess', _52 => _52.length]) === command3.via.length ? [start, ...command3.times.map((f) => start + f * (end - start)), end] : smoothMotionTimes(offsets, start, end - start, _nullishCoalesce(command3.pacing, () => ( "even")));
|
|
1399
1402
|
for (const axis of ["x", "y"]) {
|
|
1400
1403
|
const base = add ? 0 : axis === "x" ? x0 : y0;
|
|
@@ -2017,13 +2020,13 @@ function morphBetween(a, b) {
|
|
|
2017
2020
|
let inner = morphCache.get(a);
|
|
2018
2021
|
if (!inner) morphCache.set(a, inner = /* @__PURE__ */ new WeakMap());
|
|
2019
2022
|
let morph = inner.get(b);
|
|
2020
|
-
if (!morph) inner.set(b, morph =
|
|
2023
|
+
if (!morph) inner.set(b, morph = _chunk2SMMZDMGcjs.createVectorMorph.call(void 0, a, b, { id: a.id }));
|
|
2021
2024
|
return morph;
|
|
2022
2025
|
}
|
|
2023
2026
|
function shapeIn(entry, shape) {
|
|
2024
2027
|
if (shape === entry) return entry.node;
|
|
2025
|
-
const m =
|
|
2026
|
-
return { ...shape.node, ...
|
|
2028
|
+
const m = _chunkIOFVM3L3cjs.multiplyMatrices.call(void 0, _chunkIOFVM3L3cjs.multiplyMatrices.call(void 0, _chunkIOFVM3L3cjs.nodeMatrix.call(void 0, shape.node), shape.parentWorld), _chunkIOFVM3L3cjs.invertMatrix.call(void 0, entry.parentWorld));
|
|
2029
|
+
return { ...shape.node, ..._chunkIOFVM3L3cjs.isIdentityMatrix.call(void 0, m) ? { transform: void 0 } : { transform: m } };
|
|
2027
2030
|
}
|
|
2028
2031
|
function shapeAt(entry, timeline, nodes, time) {
|
|
2029
2032
|
const track = timeline.tracks.get(motionTrackKey(entry.node.id, "shape"));
|
|
@@ -2043,7 +2046,7 @@ function shapeAt(entry, timeline, nodes, time) {
|
|
|
2043
2046
|
function motionFollowRoute(entry, path) {
|
|
2044
2047
|
if (!path || path.node.type !== "path") return null;
|
|
2045
2048
|
try {
|
|
2046
|
-
return _chunkGF2RBSDMcjs.transformBezierPath.call(void 0,
|
|
2049
|
+
return _chunkGF2RBSDMcjs.transformBezierPath.call(void 0, _chunkIOFVM3L3cjs.vectorPathWorldBezier.call(void 0, path.node, path.parentWorld, { effects: false }), _chunkIOFVM3L3cjs.invertMatrix.call(void 0, entry.parentWorld));
|
|
2047
2050
|
} catch (e6) {
|
|
2048
2051
|
return null;
|
|
2049
2052
|
}
|
|
@@ -2077,9 +2080,9 @@ function motionNodeOffset(entry, timeline, time, nodes = indexMotionNodes([entry
|
|
|
2077
2080
|
const scaleX = read("scaleX", 1);
|
|
2078
2081
|
const scaleY = read("scaleY", 1);
|
|
2079
2082
|
const c = entry.center;
|
|
2080
|
-
let matrix =
|
|
2083
|
+
let matrix = _chunkIOFVM3L3cjs.multiplyMatrices.call(void 0, _chunkIOFVM3L3cjs.multiplyMatrices.call(void 0, _chunkIOFVM3L3cjs.scaleMatrix.call(void 0, scaleX, scaleY, c), _chunkIOFVM3L3cjs.rotateMatrix.call(void 0, rotation, c)), _chunkIOFVM3L3cjs.translateMatrix.call(void 0, dx, dy));
|
|
2081
2084
|
const along = follow ? followAt(entry, timeline, nodes, time) : null;
|
|
2082
|
-
if (along) matrix =
|
|
2085
|
+
if (along) matrix = _chunkIOFVM3L3cjs.multiplyMatrices.call(void 0, matrix, _chunkIOFVM3L3cjs.multiplyMatrices.call(void 0, _chunkIOFVM3L3cjs.multiplyMatrices.call(void 0, _chunkIOFVM3L3cjs.translateMatrix.call(void 0, -c.x, -c.y), _chunkIOFVM3L3cjs.rotateMatrix.call(void 0, along.angle)), _chunkIOFVM3L3cjs.translateMatrix.call(void 0, along.x, along.y)));
|
|
2083
2086
|
return { matrix, dx, dy, rotation, scaleX, scaleY, follow: along };
|
|
2084
2087
|
}
|
|
2085
2088
|
function motionNodeClips(id, timeline, time) {
|
|
@@ -2146,7 +2149,7 @@ function motionFrameAt(scene, time, options = {}) {
|
|
|
2146
2149
|
const start = Math.min(1, Math.max(0, typeof drawStart === "number" ? drawStart : 0));
|
|
2147
2150
|
const end = Math.min(1, Math.max(0, typeof drawEnd === "number" ? drawEnd : 1));
|
|
2148
2151
|
if (start > 0 || end < 1) {
|
|
2149
|
-
const trim =
|
|
2152
|
+
const trim = _chunkIOFVM3L3cjs.createVectorEffect.call(void 0, "trim", MOTION_DRAW_EFFECT_ID, { start: tidy(start * 100), end: tidy(end * 100) });
|
|
2150
2153
|
p = { ...p, effects: [trim, ...(_nullishCoalesce(p.effects, () => ( []))).filter((e) => e.id !== MOTION_DRAW_EFFECT_ID)] };
|
|
2151
2154
|
}
|
|
2152
2155
|
}
|
|
@@ -2160,8 +2163,8 @@ function motionFrameAt(scene, time, options = {}) {
|
|
|
2160
2163
|
if (o >= 1) delete out.opacity;
|
|
2161
2164
|
}
|
|
2162
2165
|
const offset = options.offsets === false ? null : motionNodeOffset(entry, timeline, time, nodes);
|
|
2163
|
-
if (offset && !
|
|
2164
|
-
const m =
|
|
2166
|
+
if (offset && !_chunkIOFVM3L3cjs.isIdentityMatrix.call(void 0, offset.matrix)) {
|
|
2167
|
+
const m = _chunkIOFVM3L3cjs.multiplyMatrices.call(void 0, _chunkIOFVM3L3cjs.nodeMatrix.call(void 0, out), offset.matrix).map(tidy);
|
|
2165
2168
|
out = { ...out, transform: m };
|
|
2166
2169
|
}
|
|
2167
2170
|
return out;
|
|
@@ -2182,8 +2185,8 @@ function motionFrameToSvg(scene, time, options = {}) {
|
|
|
2182
2185
|
const wrap = { ...options.wrap };
|
|
2183
2186
|
for (const [id, clips] of Object.entries(frame.clips))
|
|
2184
2187
|
wrap[id] = [..._nullishCoalesce(wrap[id], () => ( [])), ...clips.map((clip, i) => ({ clip: { id: `${prefix}reveal-${id}-${i}`, shape: clip.shape, attrs: motionClipAttrs(clip) } }))];
|
|
2185
|
-
if (!motionSceneHasLayers(scene)) return withCameraViewEffects(withViewBox(
|
|
2186
|
-
const art =
|
|
2188
|
+
if (!motionSceneHasLayers(scene)) return withCameraViewEffects(withViewBox(_chunkIOFVM3L3cjs.vectorDocumentToSvg.call(void 0, frame.document, { ...options, wrap }), frame.camera), frame.view, frame.camera, prefix);
|
|
2189
|
+
const art = _chunkIOFVM3L3cjs.vectorDocumentToSvg.call(void 0, frame.document, { ...options, wrap, background: false });
|
|
2187
2190
|
let svg = withViewBox(withMotionShotLayers(art, scene, time, frame.camera, options.layers, options.background !== false), frame.camera);
|
|
2188
2191
|
const transition = options.transitions === false ? null : motionTransitionAt(scene, time);
|
|
2189
2192
|
if (transition) {
|
|
@@ -2374,8 +2377,8 @@ function visibleAt(timeline, id, time, node) {
|
|
|
2374
2377
|
if (Array.isArray(rect) && (rect[2] <= 1e-4 || rect[3] <= 1e-4)) return false;
|
|
2375
2378
|
const circle = clip("clipCircle");
|
|
2376
2379
|
if (Array.isArray(circle) && circle[2] <= 1e-4) return false;
|
|
2377
|
-
const hasFill = node.type === "path" ? !!node.fill && node.fill !== "none" :
|
|
2378
|
-
const drawn = num2("drawEnd", 1) > 0.01 && (node.type === "path" ||
|
|
2380
|
+
const hasFill = node.type === "path" ? !!node.fill && node.fill !== "none" : _chunkIOFVM3L3cjs.collectPathNodes.call(void 0, node).some((p) => p.fill && p.fill !== "none");
|
|
2381
|
+
const drawn = num2("drawEnd", 1) > 0.01 && (node.type === "path" || _chunkIOFVM3L3cjs.collectPathNodes.call(void 0, node).length === 0 || _chunkIOFVM3L3cjs.collectPathNodes.call(void 0, node).some((p) => {
|
|
2379
2382
|
const v = trackValue(timeline.tracks.get(motionTrackKey(p.id, "drawEnd")), time);
|
|
2380
2383
|
return typeof v !== "number" || v > 0.01;
|
|
2381
2384
|
}));
|
|
@@ -2462,7 +2465,7 @@ function checkMotionScene(scene) {
|
|
|
2462
2465
|
}
|
|
2463
2466
|
for (const id of targets) {
|
|
2464
2467
|
const node = nodes.get(id).node;
|
|
2465
|
-
const paths = node.type === "path" ? [node] :
|
|
2468
|
+
const paths = node.type === "path" ? [node] : _chunkIOFVM3L3cjs.collectPathNodes.call(void 0, node);
|
|
2466
2469
|
if (paths.some((p) => p[key] !== void 0 && p[key] !== null && typeof p[key] !== "string"))
|
|
2467
2470
|
issues.push(_chunkDGWOGQJ5cjs.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] }));
|
|
2468
2471
|
}
|
|
@@ -2475,7 +2478,7 @@ function checkMotionScene(scene) {
|
|
|
2475
2478
|
else
|
|
2476
2479
|
for (const id of targets) {
|
|
2477
2480
|
const node = nodes.get(id).node;
|
|
2478
|
-
const paths = node.type === "path" ? [node] :
|
|
2481
|
+
const paths = node.type === "path" ? [node] : _chunkIOFVM3L3cjs.collectPathNodes.call(void 0, node);
|
|
2479
2482
|
if (paths.some((p) => typeof p[key] !== "string"))
|
|
2480
2483
|
issues.push(_chunkDGWOGQJ5cjs.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] }));
|
|
2481
2484
|
}
|
|
@@ -2920,7 +2923,7 @@ function motionNodePose(scene, id, time) {
|
|
|
2920
2923
|
if (!entry) throw new Error(`There is no element ${_chunkDGWOGQJ5cjs.namedWithSuggestion.call(void 0, id, [...indexMotionNodes(scene.artwork.nodes).keys()])} in the artwork.`);
|
|
2921
2924
|
const timeline = compileMotionScene(scene);
|
|
2922
2925
|
const drawn = indexMotionNodes(motionFrameAt(scene, time).document.nodes).get(id);
|
|
2923
|
-
const centre =
|
|
2926
|
+
const centre = _chunkIOFVM3L3cjs.applyMatrix.call(void 0, entry.parentWorld, { x: entry.center.x + motionPropertyValue(timeline, id, "x", time), y: entry.center.y + motionPropertyValue(timeline, id, "y", time) });
|
|
2924
2927
|
const paint = (property) => _nullishCoalesce(trackValue(timeline.tracks.get(motionTrackKey(id, property)), time), () => ( motionRestValue(entry, property, scene.artwork)));
|
|
2925
2928
|
const fill = paint("fill");
|
|
2926
2929
|
const stroke = paint("stroke");
|
|
@@ -3267,7 +3270,7 @@ function toFlairSvgMotion(scene, options = {}) {
|
|
|
3267
3270
|
raw: (t) => transformAt(t, true)
|
|
3268
3271
|
});
|
|
3269
3272
|
}
|
|
3270
|
-
const paths = node.type === "path" ? [node] :
|
|
3273
|
+
const paths = node.type === "path" ? [node] : _chunkIOFVM3L3cjs.collectPathNodes.call(void 0, node);
|
|
3271
3274
|
for (const path of paths) {
|
|
3272
3275
|
if (pathsSeen.has(path.id)) continue;
|
|
3273
3276
|
pathsSeen.add(path.id);
|
|
@@ -3289,7 +3292,7 @@ function toFlairSvgMotion(scene, options = {}) {
|
|
|
3289
3292
|
if (shapeSegments.length) {
|
|
3290
3293
|
if (node.type !== "path") notes.push(`"${id}" is a group: its morph or effect animation is not exported (Flair tweens one path's "d").`);
|
|
3291
3294
|
else {
|
|
3292
|
-
const inverse =
|
|
3295
|
+
const inverse = _chunkIOFVM3L3cjs.invertMatrix.call(void 0, _chunkIOFVM3L3cjs.nodeMatrix.call(void 0, node));
|
|
3293
3296
|
channels.push({
|
|
3294
3297
|
id,
|
|
3295
3298
|
kind: "attr",
|
|
@@ -3298,9 +3301,9 @@ function toFlairSvgMotion(scene, options = {}) {
|
|
|
3298
3301
|
exact: () => false,
|
|
3299
3302
|
value: (t) => {
|
|
3300
3303
|
const frame = motionFrameAt(scene, t, { draw: false, offsets: false });
|
|
3301
|
-
const now =
|
|
3304
|
+
const now = _chunkIOFVM3L3cjs.expandVectorAppearance.call(void 0, _optionalChain([indexMotionNodes, 'call', _151 => _151(frame.document.nodes), 'access', _152 => _152.get, 'call', _153 => _153(id), 'optionalAccess', _154 => _154.node]));
|
|
3302
3305
|
if (!now || now.type !== "path") return "";
|
|
3303
|
-
const bezier = _chunkGF2RBSDMcjs.transformBezierPath.call(void 0,
|
|
3306
|
+
const bezier = _chunkGF2RBSDMcjs.transformBezierPath.call(void 0, _chunkIOFVM3L3cjs.vectorPathWorldBezier.call(void 0, now, _chunkIOFVM3L3cjs.IDENTITY_MATRIX, { effects: false }), inverse);
|
|
3304
3307
|
return _chunkGF2RBSDMcjs.bezierPathToSvg.call(void 0, bezier, { precision: Math.min(precision, 2) });
|
|
3305
3308
|
}
|
|
3306
3309
|
});
|
|
@@ -3440,7 +3443,7 @@ function toFlairSvgMotion(scene, options = {}) {
|
|
|
3440
3443
|
}
|
|
3441
3444
|
if (scene.motionBlur) notes.push("Motion blur is drawn on the stage only; Flair plays the scene sharp.");
|
|
3442
3445
|
if (trigger && (_nullishCoalesce(scene.loop, () => ( "none"))) !== "none") notes.push(`The scene plays on ${trigger}, so its loop does not apply in Flair.`);
|
|
3443
|
-
let svg =
|
|
3446
|
+
let svg = _chunkIOFVM3L3cjs.vectorDocumentToSvg.call(void 0, { ...scene.artwork, nodes: _chunkIOFVM3L3cjs.expandVectorAppearances.call(void 0, scene.artwork.nodes) }, { pretty: false, precision, wrap });
|
|
3444
3447
|
if (routes.length) svg = svg.replace(/^(<svg[^>]*>)/, `$1<defs>${routes.join("")}</defs>`);
|
|
3445
3448
|
let motion = { svg, animate };
|
|
3446
3449
|
if (_optionalChain([scene, 'access', _160 => _160.controls, 'optionalAccess', _161 => _161.length])) {
|
|
@@ -3538,14 +3541,14 @@ function easingOf(ease, fallback) {
|
|
|
3538
3541
|
return fallback;
|
|
3539
3542
|
}
|
|
3540
3543
|
function poseOf(value, entry) {
|
|
3541
|
-
const t =
|
|
3542
|
-
const o =
|
|
3544
|
+
const t = _chunkIOFVM3L3cjs.parseSvgTransform.call(void 0, String(value));
|
|
3545
|
+
const o = _chunkIOFVM3L3cjs.multiplyMatrices.call(void 0, _nullishCoalesce(_chunkIOFVM3L3cjs.invertMatrix.call(void 0, _chunkIOFVM3L3cjs.nodeMatrix.call(void 0, entry.node)), () => ( [1, 0, 0, 1, 0, 0])), t);
|
|
3543
3546
|
const sx = Math.hypot(o[0], o[1]);
|
|
3544
3547
|
if (!(sx > 1e-9)) return null;
|
|
3545
3548
|
const sy = (o[0] * o[3] - o[1] * o[2]) / sx;
|
|
3546
3549
|
if (Math.abs(o[2] + o[1] / sx * sy) > 1e-6 || Math.abs(o[3] - o[0] / sx * sy) > 1e-6) return null;
|
|
3547
3550
|
const c = entry.center;
|
|
3548
|
-
const moved =
|
|
3551
|
+
const moved = _chunkIOFVM3L3cjs.applyMatrix.call(void 0, o, c);
|
|
3549
3552
|
return { dx: moved.x - c.x, dy: moved.y - c.y, rotation: Math.atan2(o[1], o[0]) * 180 / Math.PI, sx, sy };
|
|
3550
3553
|
}
|
|
3551
3554
|
var near = (a, b, eps = 1e-6) => Math.abs(a - b) < eps;
|
|
@@ -3630,7 +3633,7 @@ function fromFlairSvgMotion(input, options = {}) {
|
|
|
3630
3633
|
const notes = [];
|
|
3631
3634
|
if (!input || typeof input.svg !== "string") throw new Error('Give a Flair SvgMotion: { svg: "<svg \u2026>", animate: [ \u2026 ] }.');
|
|
3632
3635
|
const { motion, controls } = resolvePlaceholders(input, notes);
|
|
3633
|
-
const artwork =
|
|
3636
|
+
const artwork = _chunkIOFVM3L3cjs.parseVectorSvg.call(void 0, motion.svg);
|
|
3634
3637
|
const nodes = indexMotionNodes(artwork.nodes);
|
|
3635
3638
|
const byStep = /* @__PURE__ */ new Map();
|
|
3636
3639
|
for (const anim of _nullishCoalesce(motion.animate, () => ( []))) {
|
|
@@ -3877,9 +3880,9 @@ function toLottie(scene, options = {}) {
|
|
|
3877
3880
|
const items = [];
|
|
3878
3881
|
const shapeSegments = [...timeline.tracks.entries()].filter(([k]) => k.startsWith(`${path.id}\0`) && (k.endsWith("\0shape") || k.includes("\0effect:"))).flatMap(([, v]) => v);
|
|
3879
3882
|
const geometryAt = (t) => {
|
|
3880
|
-
if (!shapeSegments.length) return
|
|
3883
|
+
if (!shapeSegments.length) return _chunkIOFVM3L3cjs.vectorPathWorldBezier.call(void 0, path);
|
|
3881
3884
|
const now = _optionalChain([indexMotionNodes, 'call', _170 => _170(motionFrameAt(scene, t, { draw: false, offsets: false }).document.nodes), 'access', _171 => _171.get, 'call', _172 => _172(path.id), 'optionalAccess', _173 => _173.node]);
|
|
3882
|
-
return now && now.type === "path" ?
|
|
3885
|
+
return now && now.type === "path" ? _chunkIOFVM3L3cjs.vectorPathWorldBezier.call(void 0, _chunkIOFVM3L3cjs.expandVectorAppearances.call(void 0, [now])[0]) : _chunkIOFVM3L3cjs.vectorPathWorldBezier.call(void 0, path);
|
|
3883
3886
|
};
|
|
3884
3887
|
const rest = lottieContours(_chunkGF2RBSDMcjs.toBezierPath.call(void 0, geometryAt(0)), round4);
|
|
3885
3888
|
rest.forEach((contour, n2) => {
|
|
@@ -3952,13 +3955,13 @@ function toLottie(scene, options = {}) {
|
|
|
3952
3955
|
const innerTr = STATIC_TR();
|
|
3953
3956
|
if (node.type === "path") inner = [...pathShapes(node)];
|
|
3954
3957
|
else if (node.type === "text" || node.type === "instance") {
|
|
3955
|
-
const drawn =
|
|
3958
|
+
const drawn = _chunkIOFVM3L3cjs.expandVectorAppearance.call(void 0, node);
|
|
3956
3959
|
inner = drawn.type === "path" ? [...pathShapes(drawn)] : drawn.children.filter((c) => c.type === "path").reverse().flatMap((c) => [...pathShapes(c)]);
|
|
3957
|
-
notes.push(`"${node.id}": text is exported as its outlines${
|
|
3960
|
+
notes.push(`"${node.id}": text is exported as its outlines${_chunkIOFVM3L3cjs.vectorTextHasOutlines.call(void 0, ) ? "" : " (glyph boxes: set an outline text shaper for real glyphs)"}.`);
|
|
3958
3961
|
} else {
|
|
3959
3962
|
inner = shown(node.children).reverse().map(nodeGroup);
|
|
3960
|
-
const m =
|
|
3961
|
-
if (m !==
|
|
3963
|
+
const m = _chunkIOFVM3L3cjs.nodeMatrix.call(void 0, node);
|
|
3964
|
+
if (m !== _chunkIOFVM3L3cjs.IDENTITY_MATRIX) {
|
|
3962
3965
|
const parts = staticParts(m);
|
|
3963
3966
|
if (!parts) notes.push(`"${node.id}": its transform skews, which is not exported; it is drawn without the skew.`);
|
|
3964
3967
|
else {
|
|
@@ -3971,7 +3974,7 @@ function toLottie(scene, options = {}) {
|
|
|
3971
3974
|
const body = { ty: "gr", nm: `${node.id} (own)`, it: [...inner, innerTr] };
|
|
3972
3975
|
return { ty: "gr", nm: _nullishCoalesce(node.name, () => ( node.id)), it: [body, poseTransform(entry)] };
|
|
3973
3976
|
};
|
|
3974
|
-
const artwork = { ...scene.artwork, nodes:
|
|
3977
|
+
const artwork = { ...scene.artwork, nodes: _chunkIOFVM3L3cjs.expandVectorAppearances.call(void 0, scene.artwork.nodes) };
|
|
3975
3978
|
const content = shown(artwork.nodes).reverse().map(nodeGroup);
|
|
3976
3979
|
if (artwork.background && rgba(artwork.background))
|
|
3977
3980
|
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(round4) }, o: { a: 0, k: 100 }, r: 1 }, STATIC_TR()] });
|
|
@@ -4070,11 +4073,11 @@ function preset(prst, w, h) {
|
|
|
4070
4073
|
const poly = (pts) => [{ closed: true, anchors: pts.map(([x, y]) => ({ x, y })) }];
|
|
4071
4074
|
switch (prst) {
|
|
4072
4075
|
case "rect":
|
|
4073
|
-
return [
|
|
4076
|
+
return [_chunkIOFVM3L3cjs.rectSubpath.call(void 0, { x: 0, y: 0, width: w, height: h })];
|
|
4074
4077
|
case "roundRect":
|
|
4075
|
-
return [
|
|
4078
|
+
return [_chunkIOFVM3L3cjs.rectSubpath.call(void 0, { x: 0, y: 0, width: w, height: h }, Math.min(w, h) * 0.16667)];
|
|
4076
4079
|
case "ellipse":
|
|
4077
|
-
return [
|
|
4080
|
+
return [_chunkIOFVM3L3cjs.ellipseSubpath.call(void 0, { x: 0, y: 0, width: w, height: h })];
|
|
4078
4081
|
case "triangle":
|
|
4079
4082
|
return poly([[w / 2, 0], [w, h], [0, h]]);
|
|
4080
4083
|
case "rtTriangle":
|
|
@@ -4182,7 +4185,7 @@ function shapes(ctx, tree, map) {
|
|
|
4182
4185
|
let subpaths = cust ? custom(cust, w, h) : prst ? preset(prst, w, h) : null;
|
|
4183
4186
|
if (!subpaths) {
|
|
4184
4187
|
if (prst) ctx.notes.push(`"${name}" is a ${prst}, drawn as its bounding rectangle.`);
|
|
4185
|
-
subpaths = [
|
|
4188
|
+
subpaths = [_chunkIOFVM3L3cjs.rectSubpath.call(void 0, { x: 0, y: 0, width: w, height: h })];
|
|
4186
4189
|
}
|
|
4187
4190
|
const style = kid(el, "style");
|
|
4188
4191
|
const fill = kid(spPr, "noFill") ? null : _nullishCoalesce(colour(ctx, kid(spPr, "solidFill")), () => ( (el.localName === "cxnSp" ? null : colour(ctx, kid(style, "fillRef")))));
|
|
@@ -4571,7 +4574,7 @@ function nextMotionEffectInstance(scene) {
|
|
|
4571
4574
|
walk(scene.artwork.nodes);
|
|
4572
4575
|
for (let i = 1; ; i++) if (!used.has(`fx${i}`)) return `fx${i}`;
|
|
4573
4576
|
}
|
|
4574
|
-
var motionArtworkSvg = (artwork) =>
|
|
4577
|
+
var motionArtworkSvg = (artwork) => _chunkIOFVM3L3cjs.vectorDocumentToSvg.call(void 0, artwork);
|
|
4575
4578
|
var tag = (commands, source) => commands.map((c) => c.type === "wait" ? c : { ...c, source });
|
|
4576
4579
|
function motionCommandsFromEffect(artwork, motion, source) {
|
|
4577
4580
|
const imported = fromFlairSvgMotion({ svg: motionArtworkSvg(artwork), animate: [..._nullishCoalesce(motion.animate, () => ( []))] });
|
|
@@ -4915,7 +4918,7 @@ var AnimationEditorController = (_class2 = class {
|
|
|
4915
4918
|
const entry = indexMotionNodes(this.scene.artwork.nodes).get(options.path.node);
|
|
4916
4919
|
if (!entry) throw new Error(`There is no node "${options.path.node}"; find_animation_elements lists the artwork's nodes.`);
|
|
4917
4920
|
if (entry.node.type !== "path") throw new Error(`Node "${options.path.node}" is a ${entry.node.type}, not a path; pass a path node (find_animation_elements shows each node's type).`);
|
|
4918
|
-
value = _chunkGF2RBSDMcjs.bezierPathToSvg.call(void 0,
|
|
4921
|
+
value = _chunkGF2RBSDMcjs.bezierPathToSvg.call(void 0, _chunkIOFVM3L3cjs.vectorPathWorldBezier.call(void 0, entry.node, entry.parentWorld, { effects: false }));
|
|
4919
4922
|
place ??= "viewBox";
|
|
4920
4923
|
} else {
|
|
4921
4924
|
const provider = this.effects.require();
|
|
@@ -6176,7 +6179,7 @@ function createAnimationEditorToolProvider(controller, options = {}) {
|
|
|
6176
6179
|
handler: ({ svg }) => {
|
|
6177
6180
|
let artwork;
|
|
6178
6181
|
try {
|
|
6179
|
-
artwork =
|
|
6182
|
+
artwork = _chunkIOFVM3L3cjs.parseVectorSvg.call(void 0, svg);
|
|
6180
6183
|
} catch (error) {
|
|
6181
6184
|
throw new Error(`The SVG could not be read: ${error.message}. Nothing was changed.`);
|
|
6182
6185
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createVectorMorph
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-O75V4ZS3.js";
|
|
4
4
|
import {
|
|
5
5
|
MOTION_ISSUE_CODES,
|
|
6
6
|
motionIssue,
|
|
@@ -39,8 +39,9 @@ import {
|
|
|
39
39
|
vectorNodeBounds,
|
|
40
40
|
vectorPathWorldBezier,
|
|
41
41
|
vectorTextHasOutlines
|
|
42
|
-
} from "../chunk-
|
|
43
|
-
import "../chunk-
|
|
42
|
+
} from "../chunk-PZP2SZIZ.js";
|
|
43
|
+
import "../chunk-J7T5QZ45.js";
|
|
44
|
+
import "../chunk-5RH3VXAK.js";
|
|
44
45
|
import "../chunk-M6DNZNVY.js";
|
|
45
46
|
import {
|
|
46
47
|
bezierPathLength,
|
|
@@ -71,9 +72,11 @@ import {
|
|
|
71
72
|
resolveEffectValues
|
|
72
73
|
} from "../chunk-OFH6Q67U.js";
|
|
73
74
|
import "../chunk-V2ZCJRDM.js";
|
|
74
|
-
import "../chunk-
|
|
75
|
+
import "../chunk-D5KGAO4Z.js";
|
|
76
|
+
import "../chunk-4D6KP5BV.js";
|
|
75
77
|
import "../chunk-ODBT55Q7.js";
|
|
76
|
-
import "../chunk-
|
|
78
|
+
import "../chunk-IRSTHLQQ.js";
|
|
79
|
+
import "../chunk-OTTT5N3K.js";
|
|
77
80
|
import "../chunk-HVVR5PZW.js";
|
|
78
81
|
import "../chunk-QGHEDC7B.js";
|
|
79
82
|
import "../chunk-SIFAIGB3.js";
|
|
@@ -1,12 +1,13 @@
|
|
|
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; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkKYX7NZ5Vcjs = require('./chunk-KYX7NZ5V.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkA2IS7EHEcjs = require('./chunk-A2IS7EHE.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkH4AOUUBEcjs = require('./chunk-H4AOUUBE.cjs');
|
|
10
|
+
require('./chunk-ZEYMKDYS.cjs');
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
|
|
@@ -17,26 +18,28 @@ var _chunkNM3G4VQTcjs = require('./chunk-NM3G4VQT.cjs');
|
|
|
17
18
|
|
|
18
19
|
|
|
19
20
|
|
|
20
|
-
var
|
|
21
|
+
var _chunkI7NJPHWVcjs = require('./chunk-I7NJPHWV.cjs');
|
|
22
|
+
require('./chunk-3K6HWEXZ.cjs');
|
|
21
23
|
require('./chunk-YQGCPL5X.cjs');
|
|
22
|
-
require('./chunk-
|
|
24
|
+
require('./chunk-2VX55NFM.cjs');
|
|
25
|
+
require('./chunk-W5M3J7PV.cjs');
|
|
23
26
|
require('./chunk-474IQG74.cjs');
|
|
24
27
|
require('./chunk-XFM3OCHU.cjs');
|
|
25
28
|
require('./chunk-7AHBW2CQ.cjs');
|
|
26
29
|
require('./chunk-IPJ3TEYR.cjs');
|
|
27
30
|
|
|
28
31
|
// src/canvas/brushstrokeRender.ts
|
|
29
|
-
var DRY =
|
|
32
|
+
var DRY = _chunkH4AOUUBEcjs.BUILTIN_BRUSHES.filter((b) => _chunkI7NJPHWVcjs.isBrushstrokeBrush.call(void 0, b) && b.light.amount === 0);
|
|
30
33
|
function listCanvasBrushes() {
|
|
31
34
|
return DRY.map((b) => ({ id: b.id, name: b.name, category: b.category, size: b.tip.size }));
|
|
32
35
|
}
|
|
33
36
|
function resolveCanvasBrush(brush, width) {
|
|
34
37
|
const given = width !== void 0 && Number.isFinite(width) ? Math.max(1, width) : void 0;
|
|
35
38
|
if (typeof brush === "string") {
|
|
36
|
-
const preset =
|
|
39
|
+
const preset = _chunkH4AOUUBEcjs.BUILTIN_BRUSHES.find((b) => b.id === brush);
|
|
37
40
|
const ids = DRY.map((b) => b.id).join(", ");
|
|
38
41
|
if (!preset) throw new Error(`Unknown brush '${brush}'. Use one of the dry paint presets (${ids}) or tip settings ({ hardness, spacing, flow, \u2026 }).`);
|
|
39
|
-
if (!
|
|
42
|
+
if (!_chunkI7NJPHWVcjs.isBrushstrokeBrush.call(void 0, preset)) {
|
|
40
43
|
throw new Error(`Brush '${brush}' (${preset.name}) is not a dry brush: brushed canvas strokes use dry media only (wet paint needs an area to flow in; mixer, blender, smudge and eraser brushes need paint under them). Use one of: ${ids}.`);
|
|
41
44
|
}
|
|
42
45
|
return given === void 0 ? preset : { ...preset, tip: { ...preset.tip, size: given } };
|
|
@@ -47,7 +50,7 @@ function resolveCanvasBrush(brush, width) {
|
|
|
47
50
|
return { size: _nullishCoalesce(given, () => ( 3)), ...brush };
|
|
48
51
|
}
|
|
49
52
|
function resolveCanvasPaint(paint) {
|
|
50
|
-
const source =
|
|
53
|
+
const source = _chunkI7NJPHWVcjs.parsePaintSource.call(void 0, paint, "paint");
|
|
51
54
|
if (source.type === "gradient" && (source.map.by === "velocity" || source.map.by === "time")) {
|
|
52
55
|
throw new Error(`paint.map.by "${source.map.by}" needs timed samples, which canvas strokes do not record; use distance, pressure, tilt, direction, across-tip or random.`);
|
|
53
56
|
}
|
|
@@ -68,14 +71,14 @@ function strokeColor(shape) {
|
|
|
68
71
|
const n = parseInt(parsed.hex.slice(1), 16);
|
|
69
72
|
return [n >> 16 & 255, n >> 8 & 255, n & 255, Math.round(parsed.alpha * 255)];
|
|
70
73
|
}
|
|
71
|
-
var cache = new (0,
|
|
74
|
+
var cache = new (0, _chunkI7NJPHWVcjs.BrushstrokeCache)(128);
|
|
72
75
|
var urls = /* @__PURE__ */ new WeakMap();
|
|
73
76
|
function renderShapeBrushstrokeNow(shape, scale, place = {}) {
|
|
74
77
|
const seed = shape.brush.seed;
|
|
75
78
|
const textured = typeof seed === "number" && Number.isFinite(seed);
|
|
76
79
|
const size = _nullishCoalesce(shape.brush.size, () => ( (textured ? void 0 : _nullishCoalesce(shape.strokeWidth, () => ( 3)))));
|
|
77
80
|
const brush = resolveCanvasBrush(shape.brush.brush, size);
|
|
78
|
-
const points =
|
|
81
|
+
const points = _chunkKYX7NZ5Vcjs.pathDataToPolyline.call(void 0, shape.d);
|
|
79
82
|
if (!points.length) return null;
|
|
80
83
|
const { pressure, tiltX, tiltY } = shape.brush;
|
|
81
84
|
const input = {
|
|
@@ -98,7 +101,7 @@ function renderShapeBrushstrokeNow(shape, scale, place = {}) {
|
|
|
98
101
|
if (!stroke.bounds) return null;
|
|
99
102
|
let href = urls.get(stroke);
|
|
100
103
|
if (href === void 0) {
|
|
101
|
-
href =
|
|
104
|
+
href = _chunkI7NJPHWVcjs.brushstrokeDataUrl.call(void 0, stroke);
|
|
102
105
|
urls.set(stroke, href);
|
|
103
106
|
}
|
|
104
107
|
return { href, ...stroke.bounds, scale: stroke.scale };
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pathDataToPolyline
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-6BIDVPED.js";
|
|
4
4
|
import {
|
|
5
5
|
parseCssColor
|
|
6
6
|
} from "./chunk-3CI7FRMK.js";
|
|
7
7
|
import {
|
|
8
8
|
BUILTIN_BRUSHES
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-J7T5QZ45.js";
|
|
10
|
+
import "./chunk-5RH3VXAK.js";
|
|
10
11
|
import {
|
|
11
12
|
formatNumber,
|
|
12
13
|
getShapeSvg,
|
|
@@ -17,9 +18,11 @@ import {
|
|
|
17
18
|
brushstrokeDataUrl,
|
|
18
19
|
isBrushstrokeBrush,
|
|
19
20
|
parsePaintSource
|
|
20
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-D5KGAO4Z.js";
|
|
22
|
+
import "./chunk-4D6KP5BV.js";
|
|
21
23
|
import "./chunk-ODBT55Q7.js";
|
|
22
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-IRSTHLQQ.js";
|
|
25
|
+
import "./chunk-OTTT5N3K.js";
|
|
23
26
|
import "./chunk-HVVR5PZW.js";
|
|
24
27
|
import "./chunk-QGHEDC7B.js";
|
|
25
28
|
import "./chunk-F67XMVDI.js";
|