@pixerate/editor 0.254.1 → 0.256.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/index.cjs +2 -2
- package/dist/agent/index.js +1 -1
- package/dist/animation-editor/index.cjs +59 -59
- package/dist/animation-editor/index.js +3 -3
- package/dist/brushes/index.cjs +31 -29
- package/dist/brushes/index.d.cts +1 -1
- package/dist/brushes/index.d.ts +1 -1
- package/dist/brushes/index.js +27 -25
- package/dist/brushes/library.d.cts +17 -0
- package/dist/brushes/library.d.ts +17 -0
- package/dist/{brushstrokeRender-5PYSKZIJ.js → brushstrokeRender-HCOQUSWW.js} +53 -18
- package/dist/{brushstrokeRender-7FLLSQEC.cjs → brushstrokeRender-ZZOXI5O5.cjs} +55 -20
- package/dist/canvas/brushTypes.d.cts +22 -3
- package/dist/canvas/brushTypes.d.ts +22 -3
- package/dist/canvas/brushstroke.d.cts +34 -12
- package/dist/canvas/brushstroke.d.ts +34 -12
- package/dist/canvas/brushstrokeRender.d.cts +14 -8
- package/dist/canvas/brushstrokeRender.d.ts +14 -8
- package/dist/canvas/drawController.d.cts +11 -3
- package/dist/canvas/drawController.d.ts +11 -3
- package/dist/canvas/freehand.d.cts +6 -1
- package/dist/canvas/freehand.d.ts +6 -1
- package/dist/canvas/index.cjs +114 -102
- package/dist/canvas/index.js +16 -4
- package/dist/{chunk-XVIK73LS.js → chunk-5P4JEOIV.js} +4 -4
- package/dist/{chunk-JPEHXIB5.cjs → chunk-5YWWQ36H.cjs} +66 -21
- package/dist/{chunk-CHAWTXBE.cjs → chunk-6WCQ35GI.cjs} +4 -4
- package/dist/{chunk-GYMMNCFT.js → chunk-AF23QK5F.js} +56 -11
- package/dist/{chunk-JFHBXNR2.cjs → chunk-B7V34GIH.cjs} +86 -86
- package/dist/{chunk-QC3OXRE4.js → chunk-DMTEQ6SH.js} +1 -1
- package/dist/{chunk-TLOGFIIV.cjs → chunk-GCTUOTCW.cjs} +35 -35
- package/dist/{chunk-34KLWUH4.cjs → chunk-HIMGBZAM.cjs} +1133 -597
- package/dist/{chunk-7P6VF3FG.js → chunk-HYWRU5VX.js} +1 -1
- package/dist/{chunk-QPHNVZHO.js → chunk-JVRLGV3C.js} +1118 -582
- package/dist/{chunk-LFMKWGFL.cjs → chunk-LRNUZKWV.cjs} +22 -8
- package/dist/chunk-PGPFWC35.cjs +517 -0
- package/dist/{chunk-QLSGTCYT.cjs → chunk-TBAVCLEQ.cjs} +23 -23
- package/dist/{chunk-2ZJ4DT3M.js → chunk-VUKUTT2W.js} +1 -1
- package/dist/{chunk-5JNA6LLY.js → chunk-WYGSR3IJ.js} +22 -8
- package/dist/chunk-YHUMGBZD.js +517 -0
- package/dist/commands/builtins.d.cts +1 -1
- package/dist/commands/builtins.d.ts +1 -1
- package/dist/commands/index.cjs +2 -2
- package/dist/commands/index.js +1 -1
- package/dist/image-editor/brush-presets.d.cts +32 -0
- package/dist/image-editor/brush-presets.d.ts +32 -0
- package/dist/image-editor/controller.d.cts +15 -0
- package/dist/image-editor/controller.d.ts +15 -0
- package/dist/image-editor/index.cjs +848 -775
- package/dist/image-editor/index.d.cts +1 -0
- package/dist/image-editor/index.d.ts +1 -0
- package/dist/image-editor/index.js +81 -8
- package/dist/image-editor/types.d.cts +7 -0
- package/dist/image-editor/types.d.ts +7 -0
- package/dist/paint-editor/collaboration-tools.d.cts +19 -0
- package/dist/paint-editor/collaboration-tools.d.ts +19 -0
- package/dist/paint-editor/collaboration.d.cts +180 -0
- package/dist/paint-editor/collaboration.d.ts +180 -0
- package/dist/paint-editor/controller.d.cts +54 -0
- package/dist/paint-editor/controller.d.ts +54 -0
- package/dist/paint-editor/index.cjs +816 -283
- package/dist/paint-editor/index.d.cts +2 -0
- package/dist/paint-editor/index.d.ts +2 -0
- package/dist/paint-editor/index.js +567 -34
- package/dist/vector/brushstroke.d.cts +21 -5
- package/dist/vector/brushstroke.d.ts +21 -5
- package/dist/vector/controller.d.cts +14 -1
- package/dist/vector/controller.d.ts +14 -1
- package/dist/vector/index.cjs +1220 -1199
- package/dist/vector/index.js +34 -13
- package/dist/vector/types.d.cts +7 -0
- package/dist/vector/types.d.ts +7 -0
- package/package.json +1 -1
- package/skills/pixerate-brushes/SKILL.md +9 -3
- package/skills/pixerate-canvas/SKILL.md +10 -5
- package/skills/pixerate-image-editor/SKILL.md +2 -1
- package/skills/pixerate-paint-editor/SKILL.md +31 -46
- package/skills/pixerate-paint-editor/references/painting-alongside.md +19 -0
- package/skills/pixerate-vector/SKILL.md +1 -1
- package/dist/chunk-HS6QDWDF.cjs +0 -1029
- package/dist/chunk-MTKY6K3Q.js +0 -1029
package/dist/agent/index.cjs
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
var _chunkSOSBOS5Tcjs = require('../chunk-SOSBOS5T.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunk6WCQ35GIcjs = require('../chunk-6WCQ35GI.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
@@ -2118,7 +2118,7 @@ function createCanvasComponentToolProvider(controller, options = { id: "canvas-c
|
|
|
2118
2118
|
({ id }) => check(controller.restoreMainComponent(id))
|
|
2119
2119
|
)
|
|
2120
2120
|
];
|
|
2121
|
-
if (
|
|
2121
|
+
if (_chunk6WCQ35GIcjs.hasVariantCommands.call(void 0, controller)) {
|
|
2122
2122
|
const SET = { type: "string", description: "Component set, or one of its variants (default: the selection\u2019s set)." };
|
|
2123
2123
|
const VARIANT = { type: "string", description: "Variant id (default: the first selected variant)." };
|
|
2124
2124
|
const VALUES = { type: "object", additionalProperties: { type: "string" }, description: 'Variant property \u2192 value, e.g. { "Size": "Medium" }.' };
|
package/dist/agent/index.js
CHANGED
|
@@ -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 _chunkGCTUOTCWcjs = require('../chunk-GCTUOTCW.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -39,8 +39,8 @@ var _chunk557BDWKOcjs = require('../chunk-557BDWKO.cjs');
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
var
|
|
43
|
-
require('../chunk-
|
|
42
|
+
var _chunk5YWWQ36Hcjs = require('../chunk-5YWWQ36H.cjs');
|
|
43
|
+
require('../chunk-HIMGBZAM.cjs');
|
|
44
44
|
require('../chunk-JSDND7DF.cjs');
|
|
45
45
|
require('../chunk-CVFAAZXE.cjs');
|
|
46
46
|
|
|
@@ -702,7 +702,7 @@ function smoothMotionTimes(points, start, duration, pacing = "even") {
|
|
|
702
702
|
function motionTextLayout(nodes, id) {
|
|
703
703
|
const group = _optionalChain([nodes, 'access', _5 => _5.get, 'call', _6 => _6(id), 'optionalAccess', _7 => _7.node]);
|
|
704
704
|
if (!group || group.type !== "group") return null;
|
|
705
|
-
const letters =
|
|
705
|
+
const letters = _chunk5YWWQ36Hcjs.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);
|
|
706
706
|
if (!letters.length) return null;
|
|
707
707
|
const lines = [];
|
|
708
708
|
for (const l of [...letters].sort((a, c) => a.b.y + a.b.height / 2 - (c.b.y + c.b.height / 2))) {
|
|
@@ -787,21 +787,21 @@ function indexMotionNodes(nodes) {
|
|
|
787
787
|
const out = /* @__PURE__ */ new Map();
|
|
788
788
|
const walk = (list, parentWorld, ancestors) => {
|
|
789
789
|
for (const node of list) {
|
|
790
|
-
const local =
|
|
791
|
-
const bounds =
|
|
790
|
+
const local = _chunk5YWWQ36Hcjs.vectorNodeBounds.call(void 0, node);
|
|
791
|
+
const bounds = _chunk5YWWQ36Hcjs.vectorNodeBounds.call(void 0, node, parentWorld);
|
|
792
792
|
const center = local ? { x: local.x + local.width / 2, y: local.y + local.height / 2 } : { x: 0, y: 0 };
|
|
793
793
|
if (!out.has(node.id)) out.set(node.id, { node, ancestors, parentWorld, center, bounds, box: local });
|
|
794
|
-
if (node.type === "group") walk(node.children,
|
|
794
|
+
if (node.type === "group") walk(node.children, _chunk5YWWQ36Hcjs.multiplyMatrices.call(void 0, _chunk5YWWQ36Hcjs.nodeMatrix.call(void 0, node), parentWorld), [...ancestors, node.id]);
|
|
795
795
|
}
|
|
796
796
|
};
|
|
797
|
-
walk(nodes,
|
|
797
|
+
walk(nodes, _chunk5YWWQ36Hcjs.IDENTITY_MATRIX, []);
|
|
798
798
|
indexCache.set(nodes, out);
|
|
799
799
|
return out;
|
|
800
800
|
}
|
|
801
801
|
var solid = (paint) => typeof paint === "string" && paint !== "none" ? paint : void 0;
|
|
802
802
|
function firstPaint(node, key) {
|
|
803
803
|
if (node.type === "path") return solid(node[key]);
|
|
804
|
-
for (const p of
|
|
804
|
+
for (const p of _chunk5YWWQ36Hcjs.collectPathNodes.call(void 0, node)) {
|
|
805
805
|
const s = solid(p[key]);
|
|
806
806
|
if (s) return s;
|
|
807
807
|
}
|
|
@@ -809,7 +809,7 @@ function firstPaint(node, key) {
|
|
|
809
809
|
}
|
|
810
810
|
function strokeReach(node) {
|
|
811
811
|
let reach = 0;
|
|
812
|
-
for (const p of node.type === "path" ? [node] :
|
|
812
|
+
for (const p of node.type === "path" ? [node] : _chunk5YWWQ36Hcjs.collectPathNodes.call(void 0, node)) {
|
|
813
813
|
if (p.stroke == null || p.stroke === "none") continue;
|
|
814
814
|
const width = _nullishCoalesce(p.strokeWidth, () => ( 1));
|
|
815
815
|
reach = Math.max(reach, p.strokeAlign === "outside" ? width : p.strokeAlign === "inside" ? 0 : width / 2);
|
|
@@ -879,7 +879,7 @@ function motionRestValue(entry, property, artwork) {
|
|
|
879
879
|
case "stroke":
|
|
880
880
|
return _nullishCoalesce((node && firstPaint(node, property)), () => ( "transparent"));
|
|
881
881
|
case "strokeWidth": {
|
|
882
|
-
const path = _optionalChain([node, 'optionalAccess', _13 => _13.type]) === "path" ? node : node ?
|
|
882
|
+
const path = _optionalChain([node, 'optionalAccess', _13 => _13.type]) === "path" ? node : node ? _chunk5YWWQ36Hcjs.collectPathNodes.call(void 0, node)[0] : void 0;
|
|
883
883
|
return _nullishCoalesce(_optionalChain([path, 'optionalAccess', _14 => _14.strokeWidth]), () => ( 1));
|
|
884
884
|
}
|
|
885
885
|
case "shape":
|
|
@@ -990,12 +990,12 @@ function resolveMotionCamera(camera, scene) {
|
|
|
990
990
|
const r = camera;
|
|
991
991
|
return { x: r.x, y: r.y, width: r.width, height: r.height };
|
|
992
992
|
}
|
|
993
|
-
function motionPathLength(node, parentWorld =
|
|
993
|
+
function motionPathLength(node, parentWorld = _chunk5YWWQ36Hcjs.IDENTITY_MATRIX) {
|
|
994
994
|
let longest = 0;
|
|
995
|
-
const paths = node.type === "path" ? [node] :
|
|
995
|
+
const paths = node.type === "path" ? [node] : _chunk5YWWQ36Hcjs.collectPathNodes.call(void 0, node);
|
|
996
996
|
for (const p of paths) {
|
|
997
997
|
try {
|
|
998
|
-
longest = Math.max(longest, _chunkGF2RBSDMcjs.bezierPathLength.call(void 0,
|
|
998
|
+
longest = Math.max(longest, _chunkGF2RBSDMcjs.bezierPathLength.call(void 0, _chunk5YWWQ36Hcjs.vectorPathWorldBezier.call(void 0, p, parentWorld, { effects: false })));
|
|
999
999
|
} catch (e2) {
|
|
1000
1000
|
}
|
|
1001
1001
|
}
|
|
@@ -1271,12 +1271,12 @@ function compileMotionScene(scene) {
|
|
|
1271
1271
|
const order2 = _nullishCoalesce(o.order, () => ( "together"));
|
|
1272
1272
|
const pace = _nullishCoalesce(o.pace, () => ( "time"));
|
|
1273
1273
|
if (order2 === "together" && pace === "time") return null;
|
|
1274
|
-
const paths = entry.node.type === "path" ? [entry.node] :
|
|
1274
|
+
const paths = entry.node.type === "path" ? [entry.node] : _chunk5YWWQ36Hcjs.collectPathNodes.call(void 0, entry.node);
|
|
1275
1275
|
let list = paths.map((p) => {
|
|
1276
1276
|
const at = nodes.get(p.id);
|
|
1277
1277
|
let first = { x: 0, y: 0 };
|
|
1278
1278
|
try {
|
|
1279
|
-
const m =
|
|
1279
|
+
const m = _chunk5YWWQ36Hcjs.vectorPathWorldBezier.call(void 0, p, _nullishCoalesce(_optionalChain([at, 'optionalAccess', _42 => _42.parentWorld]), () => ( _chunk5YWWQ36Hcjs.IDENTITY_MATRIX)), { effects: false })[0];
|
|
1280
1280
|
if (m && m.type === "M") first = { x: m.x, y: m.y };
|
|
1281
1281
|
} catch (e3) {
|
|
1282
1282
|
}
|
|
@@ -1388,17 +1388,17 @@ function compileMotionScene(scene) {
|
|
|
1388
1388
|
let dx = _nullishCoalesce(_optionalChain([command3, 'access', _45 => _45.by, 'optionalAccess', _46 => _46.x]), () => ( 0));
|
|
1389
1389
|
let dy = _nullishCoalesce(_optionalChain([command3, 'access', _47 => _47.by, 'optionalAccess', _48 => _48.y]), () => ( 0));
|
|
1390
1390
|
if (command3.to) {
|
|
1391
|
-
const inv =
|
|
1392
|
-
const target =
|
|
1391
|
+
const inv = _chunk5YWWQ36Hcjs.invertMatrix.call(void 0, entry.parentWorld);
|
|
1392
|
+
const target = _chunk5YWWQ36Hcjs.applyMatrix.call(void 0, inv, command3.to);
|
|
1393
1393
|
dx = target.x - (entry.center.x + num2("x"));
|
|
1394
1394
|
dy = target.y - (entry.center.y + num2("y"));
|
|
1395
1395
|
}
|
|
1396
1396
|
if (_optionalChain([command3, 'access', _49 => _49.via, 'optionalAccess', _50 => _50.length])) {
|
|
1397
|
-
const inv =
|
|
1397
|
+
const inv = _chunk5YWWQ36Hcjs.invertMatrix.call(void 0, entry.parentWorld);
|
|
1398
1398
|
const x0 = num2("x");
|
|
1399
1399
|
const y0 = num2("y");
|
|
1400
1400
|
const add = command3.blend === "add";
|
|
1401
|
-
const offsets = [{ x: 0, y: 0 }, ...command3.via.map((p) =>
|
|
1401
|
+
const offsets = [{ x: 0, y: 0 }, ...command3.via.map((p) => _chunk5YWWQ36Hcjs.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 }];
|
|
1402
1402
|
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")));
|
|
1403
1403
|
for (const axis of ["x", "y"]) {
|
|
1404
1404
|
const base = add ? 0 : axis === "x" ? x0 : y0;
|
|
@@ -2021,13 +2021,13 @@ function morphBetween(a, b) {
|
|
|
2021
2021
|
let inner = morphCache.get(a);
|
|
2022
2022
|
if (!inner) morphCache.set(a, inner = /* @__PURE__ */ new WeakMap());
|
|
2023
2023
|
let morph = inner.get(b);
|
|
2024
|
-
if (!morph) inner.set(b, morph =
|
|
2024
|
+
if (!morph) inner.set(b, morph = _chunkGCTUOTCWcjs.createVectorMorph.call(void 0, a, b, { id: a.id }));
|
|
2025
2025
|
return morph;
|
|
2026
2026
|
}
|
|
2027
2027
|
function shapeIn(entry, shape) {
|
|
2028
2028
|
if (shape === entry) return entry.node;
|
|
2029
|
-
const m =
|
|
2030
|
-
return { ...shape.node, ...
|
|
2029
|
+
const m = _chunk5YWWQ36Hcjs.multiplyMatrices.call(void 0, _chunk5YWWQ36Hcjs.multiplyMatrices.call(void 0, _chunk5YWWQ36Hcjs.nodeMatrix.call(void 0, shape.node), shape.parentWorld), _chunk5YWWQ36Hcjs.invertMatrix.call(void 0, entry.parentWorld));
|
|
2030
|
+
return { ...shape.node, ..._chunk5YWWQ36Hcjs.isIdentityMatrix.call(void 0, m) ? { transform: void 0 } : { transform: m } };
|
|
2031
2031
|
}
|
|
2032
2032
|
function shapeAt(entry, timeline, nodes, time) {
|
|
2033
2033
|
const track = timeline.tracks.get(motionTrackKey(entry.node.id, "shape"));
|
|
@@ -2047,7 +2047,7 @@ function shapeAt(entry, timeline, nodes, time) {
|
|
|
2047
2047
|
function motionFollowRoute(entry, path) {
|
|
2048
2048
|
if (!path || path.node.type !== "path") return null;
|
|
2049
2049
|
try {
|
|
2050
|
-
return _chunkGF2RBSDMcjs.transformBezierPath.call(void 0,
|
|
2050
|
+
return _chunkGF2RBSDMcjs.transformBezierPath.call(void 0, _chunk5YWWQ36Hcjs.vectorPathWorldBezier.call(void 0, path.node, path.parentWorld, { effects: false }), _chunk5YWWQ36Hcjs.invertMatrix.call(void 0, entry.parentWorld));
|
|
2051
2051
|
} catch (e6) {
|
|
2052
2052
|
return null;
|
|
2053
2053
|
}
|
|
@@ -2081,9 +2081,9 @@ function motionNodeOffset(entry, timeline, time, nodes = indexMotionNodes([entry
|
|
|
2081
2081
|
const scaleX = read("scaleX", 1);
|
|
2082
2082
|
const scaleY = read("scaleY", 1);
|
|
2083
2083
|
const c = entry.center;
|
|
2084
|
-
let matrix =
|
|
2084
|
+
let matrix = _chunk5YWWQ36Hcjs.multiplyMatrices.call(void 0, _chunk5YWWQ36Hcjs.multiplyMatrices.call(void 0, _chunk5YWWQ36Hcjs.scaleMatrix.call(void 0, scaleX, scaleY, c), _chunk5YWWQ36Hcjs.rotateMatrix.call(void 0, rotation, c)), _chunk5YWWQ36Hcjs.translateMatrix.call(void 0, dx, dy));
|
|
2085
2085
|
const along = follow ? followAt(entry, timeline, nodes, time) : null;
|
|
2086
|
-
if (along) matrix =
|
|
2086
|
+
if (along) matrix = _chunk5YWWQ36Hcjs.multiplyMatrices.call(void 0, matrix, _chunk5YWWQ36Hcjs.multiplyMatrices.call(void 0, _chunk5YWWQ36Hcjs.multiplyMatrices.call(void 0, _chunk5YWWQ36Hcjs.translateMatrix.call(void 0, -c.x, -c.y), _chunk5YWWQ36Hcjs.rotateMatrix.call(void 0, along.angle)), _chunk5YWWQ36Hcjs.translateMatrix.call(void 0, along.x, along.y)));
|
|
2087
2087
|
return { matrix, dx, dy, rotation, scaleX, scaleY, follow: along };
|
|
2088
2088
|
}
|
|
2089
2089
|
function motionNodeClips(id, timeline, time) {
|
|
@@ -2150,7 +2150,7 @@ function motionFrameAt(scene, time, options = {}) {
|
|
|
2150
2150
|
const start = Math.min(1, Math.max(0, typeof drawStart === "number" ? drawStart : 0));
|
|
2151
2151
|
const end = Math.min(1, Math.max(0, typeof drawEnd === "number" ? drawEnd : 1));
|
|
2152
2152
|
if (start > 0 || end < 1) {
|
|
2153
|
-
const trim =
|
|
2153
|
+
const trim = _chunk5YWWQ36Hcjs.createVectorEffect.call(void 0, "trim", MOTION_DRAW_EFFECT_ID, { start: tidy(start * 100), end: tidy(end * 100) });
|
|
2154
2154
|
p = { ...p, effects: [trim, ...(_nullishCoalesce(p.effects, () => ( []))).filter((e) => e.id !== MOTION_DRAW_EFFECT_ID)] };
|
|
2155
2155
|
}
|
|
2156
2156
|
}
|
|
@@ -2164,8 +2164,8 @@ function motionFrameAt(scene, time, options = {}) {
|
|
|
2164
2164
|
if (o >= 1) delete out.opacity;
|
|
2165
2165
|
}
|
|
2166
2166
|
const offset = options.offsets === false ? null : motionNodeOffset(entry, timeline, time, nodes);
|
|
2167
|
-
if (offset && !
|
|
2168
|
-
const m =
|
|
2167
|
+
if (offset && !_chunk5YWWQ36Hcjs.isIdentityMatrix.call(void 0, offset.matrix)) {
|
|
2168
|
+
const m = _chunk5YWWQ36Hcjs.multiplyMatrices.call(void 0, _chunk5YWWQ36Hcjs.nodeMatrix.call(void 0, out), offset.matrix).map(tidy);
|
|
2169
2169
|
out = { ...out, transform: m };
|
|
2170
2170
|
}
|
|
2171
2171
|
return out;
|
|
@@ -2186,8 +2186,8 @@ function motionFrameToSvg(scene, time, options = {}) {
|
|
|
2186
2186
|
const wrap = { ...options.wrap };
|
|
2187
2187
|
for (const [id, clips] of Object.entries(frame.clips))
|
|
2188
2188
|
wrap[id] = [..._nullishCoalesce(wrap[id], () => ( [])), ...clips.map((clip, i) => ({ clip: { id: `${prefix}reveal-${id}-${i}`, shape: clip.shape, attrs: motionClipAttrs(clip) } }))];
|
|
2189
|
-
if (!motionSceneHasLayers(scene)) return withCameraViewEffects(withViewBox(
|
|
2190
|
-
const art =
|
|
2189
|
+
if (!motionSceneHasLayers(scene)) return withCameraViewEffects(withViewBox(_chunk5YWWQ36Hcjs.vectorDocumentToSvg.call(void 0, frame.document, { ...options, wrap }), frame.camera), frame.view, frame.camera, prefix);
|
|
2190
|
+
const art = _chunk5YWWQ36Hcjs.vectorDocumentToSvg.call(void 0, frame.document, { ...options, wrap, background: false });
|
|
2191
2191
|
let svg = withViewBox(withMotionShotLayers(art, scene, time, frame.camera, options.layers, options.background !== false), frame.camera);
|
|
2192
2192
|
const transition = options.transitions === false ? null : motionTransitionAt(scene, time);
|
|
2193
2193
|
if (transition) {
|
|
@@ -2378,8 +2378,8 @@ function visibleAt(timeline, id, time, node) {
|
|
|
2378
2378
|
if (Array.isArray(rect) && (rect[2] <= 1e-4 || rect[3] <= 1e-4)) return false;
|
|
2379
2379
|
const circle = clip("clipCircle");
|
|
2380
2380
|
if (Array.isArray(circle) && circle[2] <= 1e-4) return false;
|
|
2381
|
-
const hasFill = node.type === "path" ? !!node.fill && node.fill !== "none" :
|
|
2382
|
-
const drawn = num2("drawEnd", 1) > 0.01 && (node.type === "path" ||
|
|
2381
|
+
const hasFill = node.type === "path" ? !!node.fill && node.fill !== "none" : _chunk5YWWQ36Hcjs.collectPathNodes.call(void 0, node).some((p) => p.fill && p.fill !== "none");
|
|
2382
|
+
const drawn = num2("drawEnd", 1) > 0.01 && (node.type === "path" || _chunk5YWWQ36Hcjs.collectPathNodes.call(void 0, node).length === 0 || _chunk5YWWQ36Hcjs.collectPathNodes.call(void 0, node).some((p) => {
|
|
2383
2383
|
const v = trackValue(timeline.tracks.get(motionTrackKey(p.id, "drawEnd")), time);
|
|
2384
2384
|
return typeof v !== "number" || v > 0.01;
|
|
2385
2385
|
}));
|
|
@@ -2466,7 +2466,7 @@ function checkMotionScene(scene) {
|
|
|
2466
2466
|
}
|
|
2467
2467
|
for (const id of targets) {
|
|
2468
2468
|
const node = nodes.get(id).node;
|
|
2469
|
-
const paths = node.type === "path" ? [node] :
|
|
2469
|
+
const paths = node.type === "path" ? [node] : _chunk5YWWQ36Hcjs.collectPathNodes.call(void 0, node);
|
|
2470
2470
|
if (paths.some((p) => p[key] !== void 0 && p[key] !== null && typeof p[key] !== "string"))
|
|
2471
2471
|
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] }));
|
|
2472
2472
|
}
|
|
@@ -2479,7 +2479,7 @@ function checkMotionScene(scene) {
|
|
|
2479
2479
|
else
|
|
2480
2480
|
for (const id of targets) {
|
|
2481
2481
|
const node = nodes.get(id).node;
|
|
2482
|
-
const paths = node.type === "path" ? [node] :
|
|
2482
|
+
const paths = node.type === "path" ? [node] : _chunk5YWWQ36Hcjs.collectPathNodes.call(void 0, node);
|
|
2483
2483
|
if (paths.some((p) => typeof p[key] !== "string"))
|
|
2484
2484
|
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] }));
|
|
2485
2485
|
}
|
|
@@ -2924,7 +2924,7 @@ function motionNodePose(scene, id, time) {
|
|
|
2924
2924
|
if (!entry) throw new Error(`There is no element ${_chunkDGWOGQJ5cjs.namedWithSuggestion.call(void 0, id, [...indexMotionNodes(scene.artwork.nodes).keys()])} in the artwork.`);
|
|
2925
2925
|
const timeline = compileMotionScene(scene);
|
|
2926
2926
|
const drawn = indexMotionNodes(motionFrameAt(scene, time).document.nodes).get(id);
|
|
2927
|
-
const centre =
|
|
2927
|
+
const centre = _chunk5YWWQ36Hcjs.applyMatrix.call(void 0, entry.parentWorld, { x: entry.center.x + motionPropertyValue(timeline, id, "x", time), y: entry.center.y + motionPropertyValue(timeline, id, "y", time) });
|
|
2928
2928
|
const paint = (property) => _nullishCoalesce(trackValue(timeline.tracks.get(motionTrackKey(id, property)), time), () => ( motionRestValue(entry, property, scene.artwork)));
|
|
2929
2929
|
const fill = paint("fill");
|
|
2930
2930
|
const stroke = paint("stroke");
|
|
@@ -3271,7 +3271,7 @@ function toFlairSvgMotion(scene, options = {}) {
|
|
|
3271
3271
|
raw: (t) => transformAt(t, true)
|
|
3272
3272
|
});
|
|
3273
3273
|
}
|
|
3274
|
-
const paths = node.type === "path" ? [node] :
|
|
3274
|
+
const paths = node.type === "path" ? [node] : _chunk5YWWQ36Hcjs.collectPathNodes.call(void 0, node);
|
|
3275
3275
|
for (const path of paths) {
|
|
3276
3276
|
if (pathsSeen.has(path.id)) continue;
|
|
3277
3277
|
pathsSeen.add(path.id);
|
|
@@ -3293,7 +3293,7 @@ function toFlairSvgMotion(scene, options = {}) {
|
|
|
3293
3293
|
if (shapeSegments.length) {
|
|
3294
3294
|
if (node.type !== "path") notes.push(`"${id}" is a group: its morph or effect animation is not exported (Flair tweens one path's "d").`);
|
|
3295
3295
|
else {
|
|
3296
|
-
const inverse =
|
|
3296
|
+
const inverse = _chunk5YWWQ36Hcjs.invertMatrix.call(void 0, _chunk5YWWQ36Hcjs.nodeMatrix.call(void 0, node));
|
|
3297
3297
|
channels.push({
|
|
3298
3298
|
id,
|
|
3299
3299
|
kind: "attr",
|
|
@@ -3302,9 +3302,9 @@ function toFlairSvgMotion(scene, options = {}) {
|
|
|
3302
3302
|
exact: () => false,
|
|
3303
3303
|
value: (t) => {
|
|
3304
3304
|
const frame = motionFrameAt(scene, t, { draw: false, offsets: false });
|
|
3305
|
-
const now =
|
|
3305
|
+
const now = _chunk5YWWQ36Hcjs.expandVectorAppearance.call(void 0, _optionalChain([indexMotionNodes, 'call', _151 => _151(frame.document.nodes), 'access', _152 => _152.get, 'call', _153 => _153(id), 'optionalAccess', _154 => _154.node]));
|
|
3306
3306
|
if (!now || now.type !== "path") return "";
|
|
3307
|
-
const bezier = _chunkGF2RBSDMcjs.transformBezierPath.call(void 0,
|
|
3307
|
+
const bezier = _chunkGF2RBSDMcjs.transformBezierPath.call(void 0, _chunk5YWWQ36Hcjs.vectorPathWorldBezier.call(void 0, now, _chunk5YWWQ36Hcjs.IDENTITY_MATRIX, { effects: false }), inverse);
|
|
3308
3308
|
return _chunkGF2RBSDMcjs.bezierPathToSvg.call(void 0, bezier, { precision: Math.min(precision, 2) });
|
|
3309
3309
|
}
|
|
3310
3310
|
});
|
|
@@ -3444,7 +3444,7 @@ function toFlairSvgMotion(scene, options = {}) {
|
|
|
3444
3444
|
}
|
|
3445
3445
|
if (scene.motionBlur) notes.push("Motion blur is drawn on the stage only; Flair plays the scene sharp.");
|
|
3446
3446
|
if (trigger && (_nullishCoalesce(scene.loop, () => ( "none"))) !== "none") notes.push(`The scene plays on ${trigger}, so its loop does not apply in Flair.`);
|
|
3447
|
-
let svg =
|
|
3447
|
+
let svg = _chunk5YWWQ36Hcjs.vectorDocumentToSvg.call(void 0, { ...scene.artwork, nodes: _chunk5YWWQ36Hcjs.expandVectorAppearances.call(void 0, scene.artwork.nodes) }, { pretty: false, precision, wrap });
|
|
3448
3448
|
if (routes.length) svg = svg.replace(/^(<svg[^>]*>)/, `$1<defs>${routes.join("")}</defs>`);
|
|
3449
3449
|
let motion = { svg, animate };
|
|
3450
3450
|
if (_optionalChain([scene, 'access', _160 => _160.controls, 'optionalAccess', _161 => _161.length])) {
|
|
@@ -3542,14 +3542,14 @@ function easingOf(ease, fallback) {
|
|
|
3542
3542
|
return fallback;
|
|
3543
3543
|
}
|
|
3544
3544
|
function poseOf(value, entry) {
|
|
3545
|
-
const t =
|
|
3546
|
-
const o =
|
|
3545
|
+
const t = _chunk5YWWQ36Hcjs.parseSvgTransform.call(void 0, String(value));
|
|
3546
|
+
const o = _chunk5YWWQ36Hcjs.multiplyMatrices.call(void 0, _nullishCoalesce(_chunk5YWWQ36Hcjs.invertMatrix.call(void 0, _chunk5YWWQ36Hcjs.nodeMatrix.call(void 0, entry.node)), () => ( [1, 0, 0, 1, 0, 0])), t);
|
|
3547
3547
|
const sx = Math.hypot(o[0], o[1]);
|
|
3548
3548
|
if (!(sx > 1e-9)) return null;
|
|
3549
3549
|
const sy = (o[0] * o[3] - o[1] * o[2]) / sx;
|
|
3550
3550
|
if (Math.abs(o[2] + o[1] / sx * sy) > 1e-6 || Math.abs(o[3] - o[0] / sx * sy) > 1e-6) return null;
|
|
3551
3551
|
const c = entry.center;
|
|
3552
|
-
const moved =
|
|
3552
|
+
const moved = _chunk5YWWQ36Hcjs.applyMatrix.call(void 0, o, c);
|
|
3553
3553
|
return { dx: moved.x - c.x, dy: moved.y - c.y, rotation: Math.atan2(o[1], o[0]) * 180 / Math.PI, sx, sy };
|
|
3554
3554
|
}
|
|
3555
3555
|
var near = (a, b, eps = 1e-6) => Math.abs(a - b) < eps;
|
|
@@ -3634,7 +3634,7 @@ function fromFlairSvgMotion(input, options = {}) {
|
|
|
3634
3634
|
const notes = [];
|
|
3635
3635
|
if (!input || typeof input.svg !== "string") throw new Error('Give a Flair SvgMotion: { svg: "<svg \u2026>", animate: [ \u2026 ] }.');
|
|
3636
3636
|
const { motion, controls } = resolvePlaceholders(input, notes);
|
|
3637
|
-
const artwork =
|
|
3637
|
+
const artwork = _chunk5YWWQ36Hcjs.parseVectorSvg.call(void 0, motion.svg);
|
|
3638
3638
|
const nodes = indexMotionNodes(artwork.nodes);
|
|
3639
3639
|
const byStep = /* @__PURE__ */ new Map();
|
|
3640
3640
|
for (const anim of _nullishCoalesce(motion.animate, () => ( []))) {
|
|
@@ -3881,9 +3881,9 @@ function toLottie(scene, options = {}) {
|
|
|
3881
3881
|
const items = [];
|
|
3882
3882
|
const shapeSegments = [...timeline.tracks.entries()].filter(([k]) => k.startsWith(`${path.id}\0`) && (k.endsWith("\0shape") || k.includes("\0effect:"))).flatMap(([, v]) => v);
|
|
3883
3883
|
const geometryAt = (t) => {
|
|
3884
|
-
if (!shapeSegments.length) return
|
|
3884
|
+
if (!shapeSegments.length) return _chunk5YWWQ36Hcjs.vectorPathWorldBezier.call(void 0, path);
|
|
3885
3885
|
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]);
|
|
3886
|
-
return now && now.type === "path" ?
|
|
3886
|
+
return now && now.type === "path" ? _chunk5YWWQ36Hcjs.vectorPathWorldBezier.call(void 0, _chunk5YWWQ36Hcjs.expandVectorAppearances.call(void 0, [now])[0]) : _chunk5YWWQ36Hcjs.vectorPathWorldBezier.call(void 0, path);
|
|
3887
3887
|
};
|
|
3888
3888
|
const rest = lottieContours(_chunkGF2RBSDMcjs.toBezierPath.call(void 0, geometryAt(0)), round4);
|
|
3889
3889
|
rest.forEach((contour, n2) => {
|
|
@@ -3956,13 +3956,13 @@ function toLottie(scene, options = {}) {
|
|
|
3956
3956
|
const innerTr = STATIC_TR();
|
|
3957
3957
|
if (node.type === "path") inner = [...pathShapes(node)];
|
|
3958
3958
|
else if (node.type === "text" || node.type === "instance") {
|
|
3959
|
-
const drawn =
|
|
3959
|
+
const drawn = _chunk5YWWQ36Hcjs.expandVectorAppearance.call(void 0, node);
|
|
3960
3960
|
inner = drawn.type === "path" ? [...pathShapes(drawn)] : drawn.children.filter((c) => c.type === "path").reverse().flatMap((c) => [...pathShapes(c)]);
|
|
3961
|
-
notes.push(`"${node.id}": text is exported as its outlines${
|
|
3961
|
+
notes.push(`"${node.id}": text is exported as its outlines${_chunk5YWWQ36Hcjs.vectorTextHasOutlines.call(void 0, ) ? "" : " (glyph boxes: set an outline text shaper for real glyphs)"}.`);
|
|
3962
3962
|
} else {
|
|
3963
3963
|
inner = shown(node.children).reverse().map(nodeGroup);
|
|
3964
|
-
const m =
|
|
3965
|
-
if (m !==
|
|
3964
|
+
const m = _chunk5YWWQ36Hcjs.nodeMatrix.call(void 0, node);
|
|
3965
|
+
if (m !== _chunk5YWWQ36Hcjs.IDENTITY_MATRIX) {
|
|
3966
3966
|
const parts = staticParts(m);
|
|
3967
3967
|
if (!parts) notes.push(`"${node.id}": its transform skews, which is not exported; it is drawn without the skew.`);
|
|
3968
3968
|
else {
|
|
@@ -3975,7 +3975,7 @@ function toLottie(scene, options = {}) {
|
|
|
3975
3975
|
const body = { ty: "gr", nm: `${node.id} (own)`, it: [...inner, innerTr] };
|
|
3976
3976
|
return { ty: "gr", nm: _nullishCoalesce(node.name, () => ( node.id)), it: [body, poseTransform(entry)] };
|
|
3977
3977
|
};
|
|
3978
|
-
const artwork = { ...scene.artwork, nodes:
|
|
3978
|
+
const artwork = { ...scene.artwork, nodes: _chunk5YWWQ36Hcjs.expandVectorAppearances.call(void 0, scene.artwork.nodes) };
|
|
3979
3979
|
const content = shown(artwork.nodes).reverse().map(nodeGroup);
|
|
3980
3980
|
if (artwork.background && rgba(artwork.background))
|
|
3981
3981
|
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()] });
|
|
@@ -4074,11 +4074,11 @@ function preset(prst, w, h) {
|
|
|
4074
4074
|
const poly = (pts) => [{ closed: true, anchors: pts.map(([x, y]) => ({ x, y })) }];
|
|
4075
4075
|
switch (prst) {
|
|
4076
4076
|
case "rect":
|
|
4077
|
-
return [
|
|
4077
|
+
return [_chunk5YWWQ36Hcjs.rectSubpath.call(void 0, { x: 0, y: 0, width: w, height: h })];
|
|
4078
4078
|
case "roundRect":
|
|
4079
|
-
return [
|
|
4079
|
+
return [_chunk5YWWQ36Hcjs.rectSubpath.call(void 0, { x: 0, y: 0, width: w, height: h }, Math.min(w, h) * 0.16667)];
|
|
4080
4080
|
case "ellipse":
|
|
4081
|
-
return [
|
|
4081
|
+
return [_chunk5YWWQ36Hcjs.ellipseSubpath.call(void 0, { x: 0, y: 0, width: w, height: h })];
|
|
4082
4082
|
case "triangle":
|
|
4083
4083
|
return poly([[w / 2, 0], [w, h], [0, h]]);
|
|
4084
4084
|
case "rtTriangle":
|
|
@@ -4186,7 +4186,7 @@ function shapes(ctx, tree, map) {
|
|
|
4186
4186
|
let subpaths = cust ? custom(cust, w, h) : prst ? preset(prst, w, h) : null;
|
|
4187
4187
|
if (!subpaths) {
|
|
4188
4188
|
if (prst) ctx.notes.push(`"${name}" is a ${prst}, drawn as its bounding rectangle.`);
|
|
4189
|
-
subpaths = [
|
|
4189
|
+
subpaths = [_chunk5YWWQ36Hcjs.rectSubpath.call(void 0, { x: 0, y: 0, width: w, height: h })];
|
|
4190
4190
|
}
|
|
4191
4191
|
const style = kid(el, "style");
|
|
4192
4192
|
const fill = kid(spPr, "noFill") ? null : _nullishCoalesce(colour(ctx, kid(spPr, "solidFill")), () => ( (el.localName === "cxnSp" ? null : colour(ctx, kid(style, "fillRef")))));
|
|
@@ -4575,7 +4575,7 @@ function nextMotionEffectInstance(scene) {
|
|
|
4575
4575
|
walk(scene.artwork.nodes);
|
|
4576
4576
|
for (let i = 1; ; i++) if (!used.has(`fx${i}`)) return `fx${i}`;
|
|
4577
4577
|
}
|
|
4578
|
-
var motionArtworkSvg = (artwork) =>
|
|
4578
|
+
var motionArtworkSvg = (artwork) => _chunk5YWWQ36Hcjs.vectorDocumentToSvg.call(void 0, artwork);
|
|
4579
4579
|
var tag = (commands, source) => commands.map((c) => c.type === "wait" ? c : { ...c, source });
|
|
4580
4580
|
function motionCommandsFromEffect(artwork, motion, source) {
|
|
4581
4581
|
const imported = fromFlairSvgMotion({ svg: motionArtworkSvg(artwork), animate: [..._nullishCoalesce(motion.animate, () => ( []))] });
|
|
@@ -4919,7 +4919,7 @@ var AnimationEditorController = (_class2 = class {
|
|
|
4919
4919
|
const entry = indexMotionNodes(this.scene.artwork.nodes).get(options.path.node);
|
|
4920
4920
|
if (!entry) throw new Error(`There is no node "${options.path.node}"; find_animation_elements lists the artwork's nodes.`);
|
|
4921
4921
|
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).`);
|
|
4922
|
-
value = _chunkGF2RBSDMcjs.bezierPathToSvg.call(void 0,
|
|
4922
|
+
value = _chunkGF2RBSDMcjs.bezierPathToSvg.call(void 0, _chunk5YWWQ36Hcjs.vectorPathWorldBezier.call(void 0, entry.node, entry.parentWorld, { effects: false }));
|
|
4923
4923
|
place ??= "viewBox";
|
|
4924
4924
|
} else {
|
|
4925
4925
|
const provider = this.effects.require();
|
|
@@ -6180,7 +6180,7 @@ function createAnimationEditorToolProvider(controller, options = {}) {
|
|
|
6180
6180
|
handler: ({ svg }) => {
|
|
6181
6181
|
let artwork;
|
|
6182
6182
|
try {
|
|
6183
|
-
artwork =
|
|
6183
|
+
artwork = _chunk5YWWQ36Hcjs.parseVectorSvg.call(void 0, svg);
|
|
6184
6184
|
} catch (error) {
|
|
6185
6185
|
throw new Error(`The SVG could not be read: ${error.message}. Nothing was changed.`);
|
|
6186
6186
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createVectorMorph
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-HYWRU5VX.js";
|
|
4
4
|
import {
|
|
5
5
|
MOTION_ISSUE_CODES,
|
|
6
6
|
motionIssue,
|
|
@@ -39,8 +39,8 @@ import {
|
|
|
39
39
|
vectorNodeBounds,
|
|
40
40
|
vectorPathWorldBezier,
|
|
41
41
|
vectorTextHasOutlines
|
|
42
|
-
} from "../chunk-
|
|
43
|
-
import "../chunk-
|
|
42
|
+
} from "../chunk-AF23QK5F.js";
|
|
43
|
+
import "../chunk-JVRLGV3C.js";
|
|
44
44
|
import "../chunk-APX63ILU.js";
|
|
45
45
|
import "../chunk-M6DNZNVY.js";
|
|
46
46
|
import {
|
package/dist/brushes/index.cjs
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
+
var _chunkPGPFWC35cjs = require('../chunk-PGPFWC35.cjs');
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
|
|
@@ -41,7 +42,6 @@
|
|
|
41
42
|
|
|
42
43
|
|
|
43
44
|
|
|
44
|
-
var _chunk34KLWUH4cjs = require('../chunk-34KLWUH4.cjs');
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
|
|
@@ -53,7 +53,8 @@ var _chunk34KLWUH4cjs = require('../chunk-34KLWUH4.cjs');
|
|
|
53
53
|
|
|
54
54
|
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
|
|
57
|
+
var _chunkHIMGBZAMcjs = require('../chunk-HIMGBZAM.cjs');
|
|
57
58
|
|
|
58
59
|
|
|
59
60
|
var _chunkJSDND7DFcjs = require('../chunk-JSDND7DF.cjs');
|
|
@@ -97,20 +98,20 @@ var ARIA = {
|
|
|
97
98
|
"light.pressure": "Light follows pressure"
|
|
98
99
|
};
|
|
99
100
|
var aria = (path, label) => _nullishCoalesce(ARIA[path], () => ( `Brush ${label.toLowerCase()}`));
|
|
100
|
-
function brushEditorSections(brush, profile =
|
|
101
|
-
const resolved =
|
|
102
|
-
const engine =
|
|
103
|
-
const fieldOf = (facet) =>
|
|
104
|
-
const facetOf = (enginePath) => _optionalChain([(_nullishCoalesce(
|
|
101
|
+
function brushEditorSections(brush, profile = _chunkHIMGBZAMcjs.PAINT_PROFILE) {
|
|
102
|
+
const resolved = _chunkHIMGBZAMcjs.resolveBrush.call(void 0, brush);
|
|
103
|
+
const engine = _chunkHIMGBZAMcjs.resolveEngine.call(void 0, brush);
|
|
104
|
+
const fieldOf = (facet) => _chunkHIMGBZAMcjs.BRUSH_FIELDS.find((f) => f.facet === facet && f.engines.includes(engine));
|
|
105
|
+
const facetOf = (enginePath) => _optionalChain([(_nullishCoalesce(_chunkHIMGBZAMcjs.BRUSH_FIELDS.find((f) => f.engine === enginePath && f.engines.includes(engine)), () => ( _chunkHIMGBZAMcjs.BRUSH_FIELDS.find((f) => f.engine === enginePath)))), 'optionalAccess', _ => _.facet]);
|
|
105
106
|
const value = (path) => {
|
|
106
|
-
const own =
|
|
107
|
+
const own = _chunkHIMGBZAMcjs.getPath.call(void 0, brush, path);
|
|
107
108
|
if (own !== void 0) return own;
|
|
108
109
|
const field = fieldOf(path);
|
|
109
110
|
if (!field) return void 0;
|
|
110
|
-
const v =
|
|
111
|
+
const v = _chunkHIMGBZAMcjs.getPath.call(void 0, resolved, field.engine);
|
|
111
112
|
return field.map ? field.map.toFacet(v) : v;
|
|
112
113
|
};
|
|
113
|
-
const warned = new Map(
|
|
114
|
+
const warned = new Map(_chunkHIMGBZAMcjs.checkBrush.call(void 0, brush, profile).issues.filter((i) => i.severity === "warning").map((i) => [i.facet, i.reason]));
|
|
114
115
|
const noteFor = (path) => _optionalChain([[...warned], 'access', _2 => _2.find, 'call', _3 => _3(([facet]) => path === facet || path.startsWith(`${facet}.`)), 'optionalAccess', _4 => _4[1]]);
|
|
115
116
|
const withNote = (c) => {
|
|
116
117
|
const note = noteFor(c.path);
|
|
@@ -134,18 +135,18 @@ function brushEditorSections(brush, profile = _chunk34KLWUH4cjs.PAINT_PROFILE) {
|
|
|
134
135
|
const marks = _nullishCoalesce(_optionalChain([brush, 'access', _7 => _7.marks, 'optionalAccess', _8 => _8.kind]), () => ( "continuous"));
|
|
135
136
|
add("medium", "Medium", [
|
|
136
137
|
profile.kinds.length > 1 && choice("kind", "Kind", options(profile.kinds, { mark: "Lays a material", tool: "Works on paint" })),
|
|
137
|
-
!isTool && choice("medium", "Medium", [{ value: "", label: "Any" }, ...options(
|
|
138
|
+
!isTool && choice("medium", "Medium", [{ value: "", label: "Any" }, ...options(_chunkHIMGBZAMcjs.BRUSH_MEDIA, MEDIUM_LABELS)], ""),
|
|
138
139
|
!isTool && withNote({ kind: "text", path: "variety", label: "Variety", ariaLabel: "Brush variety", value: _nullishCoalesce(brush.variety, () => ( "")), placeholder: "pencil, oil, highlighter\u2026" }),
|
|
139
140
|
isTool && profile.tools.length > 0 && choice("tool", "Tool", options(profile.tools, TOOL_LABELS))
|
|
140
141
|
]);
|
|
141
|
-
const engineControls =
|
|
142
|
-
const tipSliders =
|
|
142
|
+
const engineControls = _chunkPGPFWC35cjs.brushEngineControls.call(void 0, resolved);
|
|
143
|
+
const tipSliders = _chunkPGPFWC35cjs.BRUSH_SLIDERS.filter((c) => c.path.startsWith("tip.") && c.path !== "tip.smoothing");
|
|
143
144
|
add("shape", "Shape", [
|
|
144
145
|
choice("tip.shape", "Tip", options(profile.tipShapes.filter((s) => !isTool || s !== "stamp"), SHAPE_LABELS)),
|
|
145
146
|
...tipSliders.map((c) => slider(c)),
|
|
146
147
|
engine === "dab" && choice("tip.blend", "Blend", _chunk2VX55NFMcjs.BLEND_MODES.map((m) => ({ value: m.id, label: m.label })), "normal"),
|
|
147
148
|
...shape === "bristle" && engineControls ? engineControls.sliders.filter((c) => c.path.startsWith("bristle.")).map((c) => slider(c)) : [],
|
|
148
|
-
shape === "stamp" && withNote({ kind: "stamps", path: "tip.stamps", label: "Stamps", ariaLabel: "Brush stamps", value: [..._nullishCoalesce(value("tip.stamps"), () => ( []))], max: marks === "particles" ?
|
|
149
|
+
shape === "stamp" && withNote({ kind: "stamps", path: "tip.stamps", label: "Stamps", ariaLabel: "Brush stamps", value: [..._nullishCoalesce(value("tip.stamps"), () => ( []))], max: marks === "particles" ? _chunkHIMGBZAMcjs.MAX_DOT_TEXTURES : _chunkHIMGBZAMcjs.MAX_STICKER_STAMPS, options: STAMP_OPTIONS })
|
|
149
150
|
]);
|
|
150
151
|
if (!isTool && profile.marks.length > 1) {
|
|
151
152
|
const particles = marks === "particles" && engineControls ? engineControls.sliders.filter((c) => c.path.startsWith("particle.") && c.path !== "particle.waveSpeed") : [];
|
|
@@ -153,21 +154,21 @@ function brushEditorSections(brush, profile = _chunk34KLWUH4cjs.PAINT_PROFILE) {
|
|
|
153
154
|
const render = value("marks.render");
|
|
154
155
|
add("marks", "Marks", [
|
|
155
156
|
choice("marks.kind", "Laid as", options(profile.marks, MARKS_LABELS), "continuous"),
|
|
156
|
-
marks === "particles" && choice("marks.physics", "Particles", options(
|
|
157
|
-
marks === "particles" && choice("marks.render", "Drawn as", options(
|
|
158
|
-
marks === "particles" && render === "ribbon" && choice("marks.ribbonPairs", "Ribbon joins", options(
|
|
159
|
-
marks === "particles" && shape === "stamp" && choice("marks.stampOrder", "Texture order", options(
|
|
160
|
-
marks === "particles" && shape === "stamp" && choice("marks.stampRotation", "Texture turn", options(
|
|
157
|
+
marks === "particles" && choice("marks.physics", "Particles", options(_chunkHIMGBZAMcjs.PARTICLE_KINDS, PHYSICS_LABELS)),
|
|
158
|
+
marks === "particles" && choice("marks.render", "Drawn as", options(_chunkHIMGBZAMcjs.PARTICLE_RENDERS, RENDER_LABELS)),
|
|
159
|
+
marks === "particles" && render === "ribbon" && choice("marks.ribbonPairs", "Ribbon joins", options(_chunkHIMGBZAMcjs.RIBBON_PAIRS, { adjacent: "Neighbours", "first-last": "Outermost" })),
|
|
160
|
+
marks === "particles" && shape === "stamp" && choice("marks.stampOrder", "Texture order", options(_chunkHIMGBZAMcjs.DOT_TEXTURE_ORDERS, { sequence: "In turn", random: "Random" })),
|
|
161
|
+
marks === "particles" && shape === "stamp" && choice("marks.stampRotation", "Texture turn", options(_chunkHIMGBZAMcjs.DOT_ROTATIONS, { follow: "Follow motion", random: "Random", fixed: "Tip angle" })),
|
|
161
162
|
...particles.map((c) => slider(c)),
|
|
162
163
|
...objects.map((c) => slider(c))
|
|
163
164
|
]);
|
|
164
165
|
}
|
|
165
|
-
const feel =
|
|
166
|
+
const feel = _chunkPGPFWC35cjs.BRUSH_SLIDERS.filter((c) => ["tip.smoothing", "pressureSmoothing", "dynamics.minSize", "dynamics.tiltSize", "dynamics.velocitySize"].includes(c.path)).filter((c) => !(c.path === "dynamics.tiltSize" && profile.tilt === "none") && !(c.path === "dynamics.velocitySize" && profile.velocity === "none"));
|
|
166
167
|
add("feel", "Feel", [
|
|
167
168
|
...feel.map((c) => slider(c)),
|
|
168
169
|
toggle("dynamics.pressureSize", "Pressure \u2192 size"),
|
|
169
170
|
toggle("dynamics.pressureOpacity", "Pressure \u2192 opacity"),
|
|
170
|
-
choice("dynamics.rotation", "Rotation", options(
|
|
171
|
+
choice("dynamics.rotation", "Rotation", options(_chunkHIMGBZAMcjs.BRUSH_ROTATIONS, ROTATION_LABELS))
|
|
171
172
|
]);
|
|
172
173
|
const surfaces = profile.surfaces;
|
|
173
174
|
const engineSliders = (_nullishCoalesce(_optionalChain([engineControls, 'optionalAccess', _9 => _9.sliders]), () => ( []))).filter((c) => !/^(bristle|particle|sticker)\./.test(c.path) && c.path !== "light.amount" && c.path !== "impasto.rim" && c.path !== "impasto.clarity");
|
|
@@ -175,8 +176,8 @@ function brushEditorSections(brush, profile = _chunk34KLWUH4cjs.PAINT_PROFILE) {
|
|
|
175
176
|
add("behaviour", _nullishCoalesce(_optionalChain([engineControls, 'optionalAccess', _12 => _12.title]), () => ( "Behaviour")), [
|
|
176
177
|
!isTool && surfaces.length > 1 && choice("behaviour.surface", "Surface", options(surfaces, SURFACE_LABELS), "dry"),
|
|
177
178
|
profile.grain !== "none" && slider({ path: "grain", label: "Grain", min: 0, max: 1, step: 0.01 }, "behaviour.grain"),
|
|
178
|
-
engine === "wet" && !isTool && choice("behaviour.wet.medium", "Medium", options(
|
|
179
|
-
engine === "impasto" && choice("behaviour.thick.applicator", "Tool", options(
|
|
179
|
+
engine === "wet" && !isTool && choice("behaviour.wet.medium", "Medium", options(_chunkHIMGBZAMcjs.WET_MEDIA, WET_MEDIUM_LABELS), "watercolor"),
|
|
180
|
+
engine === "impasto" && choice("behaviour.thick.applicator", "Tool", options(_chunkHIMGBZAMcjs.IMPASTO_TOOLS, APPLICATOR_LABELS), "brush"),
|
|
180
181
|
...engineSliders.map((c) => exchangeOk(facetOf(c.path)) ? slider(c) : null),
|
|
181
182
|
_optionalChain([engineControls, 'optionalAccess', _13 => _13.mixingPath]) && fieldOf("behaviour.mixing") && choice("behaviour.mixing", "Mixing", options(["pigment", "rgb"], { pigment: "Pigment", rgb: "RGB" })),
|
|
182
183
|
_optionalChain([engineControls, 'optionalAccess', _14 => _14.dirty]) && profile.exchange !== "none" && fieldOf("behaviour.exchange.dirty") && toggle("behaviour.exchange.dirty", "Dirty brush"),
|
|
@@ -196,7 +197,7 @@ function brushEditorSections(brush, profile = _chunk34KLWUH4cjs.PAINT_PROFILE) {
|
|
|
196
197
|
const own = _optionalChain([brush, 'access', _19 => _19.colour, 'optionalAccess', _20 => _20.default]);
|
|
197
198
|
add("colour", "Colour", [
|
|
198
199
|
withNote({ kind: "colour", path: "colour.default", label: "Default colour", ariaLabel: "Brush default colour", value: typeof own === "string" && /^#[0-9a-f]{6}/i.test(own) ? own.slice(0, 7).toLowerCase() : null }),
|
|
199
|
-
withNote({ kind: "palette", path: "colour.palette", label: "Palette", ariaLabel: "Brush palette", value: (_nullishCoalesce(_optionalChain([brush, 'access', _21 => _21.colour, 'optionalAccess', _22 => _22.palette]), () => ( []))).filter((c) => typeof c === "string"), max:
|
|
200
|
+
withNote({ kind: "palette", path: "colour.palette", label: "Palette", ariaLabel: "Brush palette", value: (_nullishCoalesce(_optionalChain([brush, 'access', _21 => _21.colour, 'optionalAccess', _22 => _22.palette]), () => ( []))).filter((c) => typeof c === "string"), max: _chunkHIMGBZAMcjs.MAX_BRUSH_PALETTE }),
|
|
200
201
|
toggle("colour.own", "Always its own colour")
|
|
201
202
|
]);
|
|
202
203
|
}
|
|
@@ -224,13 +225,13 @@ function setBrushEditorValue(brush, path, value) {
|
|
|
224
225
|
if (value !== "bristle") delete next.tip.bristle;
|
|
225
226
|
} else if (value === void 0 || value === "") {
|
|
226
227
|
const keys = path.split(".");
|
|
227
|
-
const parent =
|
|
228
|
+
const parent = _chunkHIMGBZAMcjs.getPath.call(void 0, next, keys.slice(0, -1).join("."));
|
|
228
229
|
if (keys.length === 1) delete next[keys[0]];
|
|
229
230
|
else if (parent) delete parent[keys[keys.length - 1]];
|
|
230
|
-
} else
|
|
231
|
+
} else _chunkHIMGBZAMcjs.setPath.call(void 0, next, path, value);
|
|
231
232
|
const problems = [];
|
|
232
233
|
try {
|
|
233
|
-
return { brush:
|
|
234
|
+
return { brush: _chunkHIMGBZAMcjs.normalizeBrushSpec.call(void 0, JSON.parse(JSON.stringify(next)), problems), problems };
|
|
234
235
|
} catch (e) {
|
|
235
236
|
return { brush, problems: [e.message] };
|
|
236
237
|
}
|
|
@@ -246,7 +247,7 @@ function brushLibraryGroups(entries, filter = {}) {
|
|
|
246
247
|
const text = words([b.id, b.name, _nullishCoalesce(b.variety, () => ( "")), _nullishCoalesce(b.medium, () => ( "")), _nullishCoalesce(b.tool, () => ( "")), ..._nullishCoalesce(b.tags, () => ( []))].join(" "));
|
|
247
248
|
if (!wanted.every((w) => text.some((t) => t.startsWith(w)))) continue;
|
|
248
249
|
}
|
|
249
|
-
if (filter.profile && !
|
|
250
|
+
if (filter.profile && !_chunkHIMGBZAMcjs.checkBrush.call(void 0, b, filter.profile).ok) continue;
|
|
250
251
|
const id = b.kind === "tool" ? "tools" : _nullishCoalesce(b.medium, () => ( "other"));
|
|
251
252
|
let g = groups.get(id);
|
|
252
253
|
if (!g) groups.set(id, g = { id, title: id === "tools" ? "Tools" : id === "other" ? "Other" : MEDIUM_LABELS[id], varieties: [] });
|
|
@@ -299,4 +300,5 @@ function brushLibraryGroups(entries, filter = {}) {
|
|
|
299
300
|
|
|
300
301
|
|
|
301
302
|
|
|
302
|
-
|
|
303
|
+
|
|
304
|
+
exports.BRUSH_FACET_SCHEMAS = _chunkHIMGBZAMcjs.BRUSH_FACET_SCHEMAS; exports.BRUSH_HOST_PROFILES = _chunkHIMGBZAMcjs.BRUSH_HOST_PROFILES; exports.BRUSH_JSON_SCHEMA = _chunkHIMGBZAMcjs.BRUSH_JSON_SCHEMA; exports.BRUSH_KINDS = _chunkHIMGBZAMcjs.BRUSH_KINDS; exports.BRUSH_MARKS_KINDS = _chunkHIMGBZAMcjs.BRUSH_MARKS_KINDS; exports.BRUSH_MEDIA = _chunkHIMGBZAMcjs.BRUSH_MEDIA; exports.BRUSH_PATCH_PROPERTIES = _chunkPGPFWC35cjs.BRUSH_PATCH_PROPERTIES; exports.BRUSH_PRESETS = _chunkHIMGBZAMcjs.BRUSH_PRESETS; exports.BRUSH_SURFACES = _chunkHIMGBZAMcjs.BRUSH_SURFACES; exports.BRUSH_TIP_SHAPES = _chunkHIMGBZAMcjs.BRUSH_TIP_SHAPES; exports.BRUSH_TOOLS = _chunkHIMGBZAMcjs.BRUSH_TOOLS; exports.BRUSH_UNSET_PROPERTY = _chunkPGPFWC35cjs.BRUSH_UNSET_PROPERTY; exports.BRUSH_WORD = _chunkHIMGBZAMcjs.BRUSH_WORD; exports.BrushLibraryError = _chunkHIMGBZAMcjs.BrushLibraryError; exports.CANVAS_PROFILE = _chunkHIMGBZAMcjs.CANVAS_PROFILE; exports.IMAGE_PROFILE = _chunkHIMGBZAMcjs.IMAGE_PROFILE; exports.MAX_BRUSH_PALETTE = _chunkHIMGBZAMcjs.MAX_BRUSH_PALETTE; exports.PAINT_PROFILE = _chunkHIMGBZAMcjs.PAINT_PROFILE; exports.UNSETTABLE_BRUSH_FACETS = _chunkPGPFWC35cjs.UNSETTABLE_BRUSH_FACETS; exports.VECTOR_PROFILE = _chunkHIMGBZAMcjs.VECTOR_PROFILE; exports.WET_BRUSH_TOOLS = _chunkHIMGBZAMcjs.WET_BRUSH_TOOLS; exports.brushColourKind = _chunkHIMGBZAMcjs.brushColourKind; exports.brushEditorSections = brushEditorSections; exports.brushLibraryGroups = brushLibraryGroups; exports.changedBrushPaths = _chunkPGPFWC35cjs.changedBrushPaths; exports.checkBrush = _chunkHIMGBZAMcjs.checkBrush; exports.createBrushLibrary = _chunkHIMGBZAMcjs.createBrushLibrary; exports.createBrushLibraryToolProvider = _chunkPGPFWC35cjs.createBrushLibraryToolProvider; exports.createBrushLibraryTools = _chunkPGPFWC35cjs.createBrushLibraryTools; exports.degrade = _chunkHIMGBZAMcjs.degrade; exports.listPresets = _chunkHIMGBZAMcjs.listPresets; exports.mergeBrushPatch = _chunkPGPFWC35cjs.mergeBrushPatch; exports.migrateBrushV1 = _chunkHIMGBZAMcjs.migrateBrushV1; exports.normalizeBrushSpec = _chunkHIMGBZAMcjs.normalizeBrushSpec; exports.parseBrushLibrary = _chunkHIMGBZAMcjs.parseBrushLibrary2; exports.resolveBrush = _chunkHIMGBZAMcjs.resolveBrush; exports.resolveCategory = _chunkHIMGBZAMcjs.resolveCategory; exports.resolveEngine = _chunkHIMGBZAMcjs.resolveEngine; exports.resolveWetMedium = _chunkHIMGBZAMcjs.resolveWetMedium; exports.setBrushEditorValue = setBrushEditorValue; exports.snapshotBrushLibrary = _chunkHIMGBZAMcjs.snapshotBrushLibrary;
|