@pixerate/editor 0.100.0 → 0.101.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD_PARTY_NOTICES.md +4 -0
- package/dist/animation-editor/index.cjs +39 -39
- package/dist/animation-editor/index.d.cts +1 -1
- package/dist/animation-editor/index.d.ts +1 -1
- package/dist/animation-editor/index.js +1 -1
- package/dist/{chunk-YGZNGDIT.js → chunk-63EFQCT5.js} +807 -73
- package/dist/chunk-63EFQCT5.js.map +1 -0
- package/dist/{chunk-JF5PXN7W.cjs → chunk-KANRAHTL.cjs} +838 -104
- package/dist/chunk-KANRAHTL.cjs.map +1 -0
- package/dist/{svg-C9r284x8.d.cts → svg-Bj1MQFh6.d.cts} +395 -2
- package/dist/{svg-MVKBqwD4.d.ts → svg-vme0PLNo.d.ts} +395 -2
- package/dist/vector/index.cjs +1352 -584
- package/dist/vector/index.cjs.map +1 -1
- package/dist/vector/index.d.cts +302 -197
- package/dist/vector/index.d.ts +302 -197
- package/dist/vector/index.js +854 -86
- package/dist/vector/index.js.map +1 -1
- package/package.json +1 -1
- package/skills/pixerate-vector/SKILL.md +52 -2
- package/skills/pixerate-vector/references/commands.md +21 -0
- package/dist/chunk-JF5PXN7W.cjs.map +0 -1
- package/dist/chunk-YGZNGDIT.js.map +0 -1
package/dist/vector/index.cjs
CHANGED
|
@@ -241,7 +241,50 @@ var _chunkMUUXNRU4cjs = require('../chunk-MUUXNRU4.cjs');
|
|
|
241
241
|
|
|
242
242
|
|
|
243
243
|
|
|
244
|
-
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
var _chunkKANRAHTLcjs = require('../chunk-KANRAHTL.cjs');
|
|
245
288
|
|
|
246
289
|
|
|
247
290
|
|
|
@@ -322,36 +365,36 @@ var HANDLE_HIT = 6;
|
|
|
322
365
|
var BAR_HIT = 5;
|
|
323
366
|
var fmt = (n) => Math.round(n * 100) / 100;
|
|
324
367
|
var apply = (m, p) => ({ x: m[0] * p.x + m[2] * p.y + m[4], y: m[1] * p.x + m[3] * p.y + m[5] });
|
|
325
|
-
function vectorGradientTargetPath(doc, selection, target) {
|
|
368
|
+
function vectorGradientTargetPath(doc, selection, target, layer = null) {
|
|
326
369
|
for (const id of selection) {
|
|
327
|
-
const node =
|
|
370
|
+
const node = _chunkKANRAHTLcjs.findVectorNode.call(void 0, doc.nodes, id);
|
|
328
371
|
if (!node) continue;
|
|
329
|
-
const path =
|
|
372
|
+
const path = _chunkKANRAHTLcjs.collectPathNodes.call(void 0, node).find((p) => _chunkKANRAHTLcjs.isVectorGradient.call(void 0, _chunkKANRAHTLcjs.vectorTargetPaint.call(void 0, p, target, layer)));
|
|
330
373
|
if (path) return path;
|
|
331
374
|
}
|
|
332
375
|
return null;
|
|
333
376
|
}
|
|
334
|
-
function getVectorGradientAnnotator(doc, selection, viewport, target) {
|
|
335
|
-
const path = vectorGradientTargetPath(doc, selection, target);
|
|
377
|
+
function getVectorGradientAnnotator(doc, selection, viewport, target, layer = null) {
|
|
378
|
+
const path = vectorGradientTargetPath(doc, selection, target, layer);
|
|
336
379
|
if (!path) return null;
|
|
337
|
-
const gradient = path
|
|
338
|
-
const world = _nullishCoalesce(
|
|
380
|
+
const gradient = _chunkKANRAHTLcjs.vectorTargetPaint.call(void 0, path, target, layer);
|
|
381
|
+
const world = _nullishCoalesce(_chunkKANRAHTLcjs.vectorWorldMatrix.call(void 0, doc.nodes, path.id), () => ( _chunkDWGZUSEScjs.IDENTITY_MATRIX));
|
|
339
382
|
const screen = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, world, [viewport.zoom, 0, 0, viewport.zoom, viewport.x, viewport.y]);
|
|
340
|
-
const bounds =
|
|
341
|
-
const h =
|
|
383
|
+
const bounds = _chunkKANRAHTLcjs.vectorPathLocalBounds.call(void 0, path);
|
|
384
|
+
const h = _chunkKANRAHTLcjs.vectorGradientHandles.call(void 0, gradient, bounds, screen);
|
|
342
385
|
const v = { x: h.end.x - h.start.x, y: h.end.y - h.start.y };
|
|
343
386
|
const len = Math.hypot(v.x, v.y);
|
|
344
387
|
const normal = len > 1e-9 ? { x: -v.y / len, y: v.x / len } : { x: 0, y: 1 };
|
|
345
388
|
const at = (t, gap) => ({ x: h.start.x + v.x * t + normal.x * gap, y: h.start.y + v.y * t + normal.y * gap });
|
|
346
|
-
const sorted =
|
|
389
|
+
const sorted = _chunkKANRAHTLcjs.sortedVectorGradientStops.call(void 0, gradient);
|
|
347
390
|
const stops = sorted.map((s, index) => ({ ...s, index, ...at(s.offset, VECTOR_GRADIENT_STOP_GAP) }));
|
|
348
391
|
const midpoints = sorted.slice(0, -1).flatMap((s, index) => {
|
|
349
|
-
const pos =
|
|
392
|
+
const pos = _chunkKANRAHTLcjs.vectorGradientMidpointPosition.call(void 0, sorted, index);
|
|
350
393
|
return pos === null || sorted[index + 1].offset - s.offset < 1e-6 ? [] : [{ index, midpoint: _nullishCoalesce(s.midpoint, () => ( 0.5)), ...at(pos, -VECTOR_GRADIENT_MIDPOINT_GAP) }];
|
|
351
394
|
});
|
|
352
395
|
let extent = null;
|
|
353
|
-
if (
|
|
354
|
-
const frame = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0,
|
|
396
|
+
if (_chunkKANRAHTLcjs.isCentredVectorGradient.call(void 0, gradient.type)) {
|
|
397
|
+
const frame = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, _chunkKANRAHTLcjs.vectorGradientMatrix.call(void 0, gradient, bounds), screen);
|
|
355
398
|
const pts = gradient.type === "diamond" ? [{ x: 1, y: 0 }, { x: 0, y: 1 }, { x: -1, y: 0 }, { x: 0, y: -1 }] : Array.from({ length: 48 }, (_, k) => ({ x: Math.cos(k * Math.PI / 24), y: Math.sin(k * Math.PI / 24) }));
|
|
356
399
|
extent = `M${pts.map((p) => apply(frame, p)).map((p) => `${fmt(p.x)} ${fmt(p.y)}`).join("L")}Z`;
|
|
357
400
|
}
|
|
@@ -368,7 +411,7 @@ function hitVectorGradientAnnotator(a, p) {
|
|
|
368
411
|
const near2 = (q, r) => !!q && Math.hypot(q.x - p.x, q.y - p.y) <= r;
|
|
369
412
|
for (let i = a.stops.length - 1; i >= 0; i--) if (near2(a.stops[i], STOP_HIT)) return { kind: "stop", index: a.stops[i].index };
|
|
370
413
|
for (const m of a.midpoints) if (near2(m, MIDPOINT_HIT)) return { kind: "midpoint", index: m.index };
|
|
371
|
-
const centred =
|
|
414
|
+
const centred = _chunkKANRAHTLcjs.isCentredVectorGradient.call(void 0, a.gradient.type);
|
|
372
415
|
if (near2(a.end, HANDLE_HIT)) return { kind: "handle", handle: centred ? "radius" : "end" };
|
|
373
416
|
if (a.focal && near2(a.focal, HANDLE_HIT) && !near2(a.start, 1)) return { kind: "handle", handle: "focal" };
|
|
374
417
|
if (near2(a.start, HANDLE_HIT)) return { kind: "handle", handle: "start" };
|
|
@@ -404,8 +447,8 @@ function paintColors(p) {
|
|
|
404
447
|
return [];
|
|
405
448
|
}
|
|
406
449
|
function vectorBlendColorDistance(a, b) {
|
|
407
|
-
const pa =
|
|
408
|
-
const pb =
|
|
450
|
+
const pa = _chunkKANRAHTLcjs.collectPathNodes.call(void 0, a)[0];
|
|
451
|
+
const pb = _chunkKANRAHTLcjs.collectPathNodes.call(void 0, b)[0];
|
|
409
452
|
if (!pa || !pb) return 0;
|
|
410
453
|
let d = 0;
|
|
411
454
|
for (const key of ["fill", "stroke"]) {
|
|
@@ -423,7 +466,7 @@ function vectorBlendColorDistance(a, b) {
|
|
|
423
466
|
return d;
|
|
424
467
|
}
|
|
425
468
|
var centreOf = (n) => {
|
|
426
|
-
const b =
|
|
469
|
+
const b = _chunkKANRAHTLcjs.vectorNodeBounds.call(void 0, n);
|
|
427
470
|
return b ? [b.x + b.width / 2, b.y + b.height / 2] : [0, 0];
|
|
428
471
|
};
|
|
429
472
|
function vectorBlendStepCount(a, b, options, length) {
|
|
@@ -435,8 +478,8 @@ function vectorBlendStepCount(a, b, options, length) {
|
|
|
435
478
|
if (o.spacing === "smoothColor") {
|
|
436
479
|
const cd = vectorBlendColorDistance(a, b);
|
|
437
480
|
if (cd > 1 / 255) return Math.min(VECTOR_BLEND_MAX_SMOOTH_STEPS, Math.max(1, Math.ceil(cd * 255 / 2)));
|
|
438
|
-
const ba =
|
|
439
|
-
const bb =
|
|
481
|
+
const ba = _chunkKANRAHTLcjs.vectorNodeBounds.call(void 0, a);
|
|
482
|
+
const bb = _chunkKANRAHTLcjs.vectorNodeBounds.call(void 0, b);
|
|
440
483
|
const dist3 = ba && bb ? Math.max(Math.abs(ba.x - bb.x), Math.abs(ba.y - bb.y), Math.abs(ba.x + ba.width - bb.x - bb.width), Math.abs(ba.y + ba.height - bb.y - bb.height)) : length;
|
|
441
484
|
return Math.min(VECTOR_BLEND_MAX_SMOOTH_STEPS, Math.max(1, Math.ceil(dist3 / 2)));
|
|
442
485
|
}
|
|
@@ -451,9 +494,9 @@ function vectorBlendRail(sp) {
|
|
|
451
494
|
pts.push(p);
|
|
452
495
|
angles.push(Math.atan2(tangent[1], tangent[0]));
|
|
453
496
|
};
|
|
454
|
-
const count =
|
|
497
|
+
const count = _chunkKANRAHTLcjs.subpathSegmentCount.call(void 0, sp);
|
|
455
498
|
for (let i = 0; i < count; i++) {
|
|
456
|
-
const seg =
|
|
499
|
+
const seg = _chunkKANRAHTLcjs.subpathSegment.call(void 0, sp, i);
|
|
457
500
|
const samples = seg.length === 2 ? 1 : 32;
|
|
458
501
|
if (i === 0) push(seg[0], _chunkXGD3FSNCcjs.segmentTangent.call(void 0, seg, 0));
|
|
459
502
|
for (let k = 1; k <= samples; k++) push(_chunkXGD3FSNCcjs.segmentPoint.call(void 0, seg, k / samples), _chunkXGD3FSNCcjs.segmentTangent.call(void 0, seg, k / samples));
|
|
@@ -511,7 +554,7 @@ function morphFor(a, b, blend) {
|
|
|
511
554
|
let byKey = inner.get(b);
|
|
512
555
|
if (!byKey) inner.set(b, byKey = /* @__PURE__ */ new Map());
|
|
513
556
|
let morph = byKey.get(key);
|
|
514
|
-
if (!morph) byKey.set(key, morph =
|
|
557
|
+
if (!morph) byKey.set(key, morph = _chunkKANRAHTLcjs.createVectorMorph.call(void 0, a, b, { linear: blend.linear, starts }));
|
|
515
558
|
return morph;
|
|
516
559
|
}
|
|
517
560
|
var wrapAngle = (a) => Math.atan2(Math.sin(a), Math.cos(a));
|
|
@@ -553,7 +596,7 @@ function generateVectorBlendChildren(group) {
|
|
|
553
596
|
m = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, m, _chunkDWGZUSEScjs.rotateMatrix.call(void 0, turn * 180 / Math.PI, origin));
|
|
554
597
|
}
|
|
555
598
|
}
|
|
556
|
-
if (m !== _chunkDWGZUSEScjs.IDENTITY_MATRIX) step =
|
|
599
|
+
if (m !== _chunkDWGZUSEScjs.IDENTITY_MATRIX) step = _chunkKANRAHTLcjs.transformVectorNode.call(void 0, step, m);
|
|
557
600
|
}
|
|
558
601
|
out.push(asStep(step, `${group.id}~${++counter}`));
|
|
559
602
|
}
|
|
@@ -600,13 +643,13 @@ function expandVectorBlend(group, newId) {
|
|
|
600
643
|
return { ...rest, children: group.children.map((c) => c.blendStep ? plain(c, newId) : c) };
|
|
601
644
|
}
|
|
602
645
|
function releaseVectorBlend(group, newId) {
|
|
603
|
-
const m =
|
|
646
|
+
const m = _chunkKANRAHTLcjs.nodeMatrix.call(void 0, group);
|
|
604
647
|
const opacity = group.opacity;
|
|
605
|
-
const keys = vectorBlendKeys(group).map((c) => group.transform ?
|
|
648
|
+
const keys = vectorBlendKeys(group).map((c) => group.transform ? _chunkKANRAHTLcjs.transformVectorNode.call(void 0, c, m) : c).map((c) => opacity !== void 0 && opacity < 1 ? { ...c, opacity: (_nullishCoalesce(c.opacity, () => ( 1))) * opacity } : c);
|
|
606
649
|
const spine = _optionalChain([group, 'access', _13 => _13.blend, 'optionalAccess', _14 => _14.spine]);
|
|
607
650
|
if (!spine || spine.anchors.length < 2) return keys;
|
|
608
651
|
const path = { id: newId(), type: "path", name: "Spine", fill: null, stroke: null, subpaths: [{ closed: spine.closed, anchors: spine.anchors.map((a) => ({ ...a })) }] };
|
|
609
|
-
return [...keys, group.transform ?
|
|
652
|
+
return [...keys, group.transform ? _chunkKANRAHTLcjs.transformVectorNode.call(void 0, path, m) : path];
|
|
610
653
|
}
|
|
611
654
|
|
|
612
655
|
// src/vector/distort.ts
|
|
@@ -666,13 +709,13 @@ function mapEffects(node, f) {
|
|
|
666
709
|
return node.effects.map((e) => {
|
|
667
710
|
if (e.type !== "envelope") return e;
|
|
668
711
|
if (e.params.style === "mesh") return e.params.mesh ? { ...e, params: { ...e.params, mesh: _chunkDWGZUSEScjs.mapWarpMeshPoints.call(void 0, e.params.mesh, f) } } : e;
|
|
669
|
-
const bounds =
|
|
670
|
-
if (!bounds || !
|
|
671
|
-
return { ...e, params: { ...e.params, style: "mesh", mesh: _chunkDWGZUSEScjs.mapWarpMeshPoints.call(void 0,
|
|
712
|
+
const bounds = _chunkKANRAHTLcjs.vectorEffectInputBounds.call(void 0, node, e.id);
|
|
713
|
+
if (!bounds || !_chunkKANRAHTLcjs.vectorEnvelopeMap.call(void 0, e.params, bounds)) return e;
|
|
714
|
+
return { ...e, params: { ...e.params, style: "mesh", mesh: _chunkDWGZUSEScjs.mapWarpMeshPoints.call(void 0, _chunkKANRAHTLcjs.vectorEnvelopeMesh.call(void 0, e.params, bounds), f) } };
|
|
672
715
|
});
|
|
673
716
|
}
|
|
674
717
|
function distortVectorNode(node, parentToDoc, f, tolerance = VECTOR_DISTORT_TOLERANCE) {
|
|
675
|
-
const toDoc = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0,
|
|
718
|
+
const toDoc = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, _chunkKANRAHTLcjs.nodeMatrix.call(void 0, node), parentToDoc);
|
|
676
719
|
const inv = _chunkDWGZUSEScjs.invertMatrix.call(void 0, toDoc);
|
|
677
720
|
const local = (p) => _chunkDWGZUSEScjs.applyMatrix.call(void 0, inv, f(_chunkDWGZUSEScjs.applyMatrix.call(void 0, toDoc, p)));
|
|
678
721
|
const effects = mapEffects(node, local);
|
|
@@ -684,16 +727,16 @@ function distortVectorNode(node, parentToDoc, f, tolerance = VECTOR_DISTORT_TOLE
|
|
|
684
727
|
...group,
|
|
685
728
|
children,
|
|
686
729
|
...effects ? { effects } : {},
|
|
687
|
-
...spine ? { blend: { ...group.blend, spine:
|
|
730
|
+
...spine ? { blend: { ...group.blend, spine: _chunkKANRAHTLcjs.mapVectorSubpaths.call(void 0, [spine], local, tolerance)[0] } } : {}
|
|
688
731
|
};
|
|
689
732
|
}
|
|
690
733
|
const path = node;
|
|
691
734
|
return {
|
|
692
735
|
...path,
|
|
693
736
|
...effects ? { effects } : {},
|
|
694
|
-
...path.fill !== void 0 ? { fill:
|
|
695
|
-
...path.stroke !== void 0 ? { stroke:
|
|
696
|
-
subpaths:
|
|
737
|
+
...path.fill !== void 0 ? { fill: _chunkKANRAHTLcjs.mapVectorPaint.call(void 0, path.fill, local) } : {},
|
|
738
|
+
...path.stroke !== void 0 ? { stroke: _chunkKANRAHTLcjs.mapVectorPaint.call(void 0, path.stroke, local) } : {},
|
|
739
|
+
subpaths: _chunkKANRAHTLcjs.mapVectorSubpaths.call(void 0, path.subpaths, local, tolerance)
|
|
697
740
|
};
|
|
698
741
|
}
|
|
699
742
|
|
|
@@ -754,8 +797,8 @@ var LABELS = {
|
|
|
754
797
|
};
|
|
755
798
|
var fmtLength = (n) => String(Math.round(n * 100) / 100);
|
|
756
799
|
function nodeFrame(node, parent, aabb) {
|
|
757
|
-
const angle = _chunkDWGZUSEScjs.matrixRotation.call(void 0, _chunkDWGZUSEScjs.multiplyMatrices.call(void 0,
|
|
758
|
-
const b = angle ?
|
|
800
|
+
const angle = _chunkDWGZUSEScjs.matrixRotation.call(void 0, _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, _chunkKANRAHTLcjs.nodeMatrix.call(void 0, node), parent));
|
|
801
|
+
const b = angle ? _chunkKANRAHTLcjs.vectorNodeBounds.call(void 0, node, _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, parent, _chunkDWGZUSEScjs.rotateMatrix.call(void 0, -angle))) : aabb !== void 0 ? aabb : _chunkKANRAHTLcjs.vectorNodeBounds.call(void 0, node, parent);
|
|
759
802
|
if (!b) return null;
|
|
760
803
|
const c = { x: b.x + b.width / 2, y: b.y + b.height / 2 };
|
|
761
804
|
return { width: b.width, height: b.height, centre: angle ? _chunkDWGZUSEScjs.applyMatrix.call(void 0, _chunkDWGZUSEScjs.rotateMatrix.call(void 0, angle), c) : c };
|
|
@@ -830,7 +873,7 @@ var VectorSnapTargets = (_class = class _VectorSnapTargets {
|
|
|
830
873
|
let segmentBudget = segments ? BUDGET : 0;
|
|
831
874
|
const visit = (list, parent) => {
|
|
832
875
|
for (const n of list) {
|
|
833
|
-
const m = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0,
|
|
876
|
+
const m = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, _chunkKANRAHTLcjs.nodeMatrix.call(void 0, n), parent);
|
|
834
877
|
if (n.type === "group") visit(n.children, m);
|
|
835
878
|
else if (ids.has(n.id) && n.visible !== false) {
|
|
836
879
|
n.subpaths.forEach((sp, s) => {
|
|
@@ -854,10 +897,10 @@ var VectorSnapTargets = (_class = class _VectorSnapTargets {
|
|
|
854
897
|
/** The segments of `sp` (mapped by `m`) that stay put while the anchors `moving` accepts move. */
|
|
855
898
|
pushSegments(sp, m, moving, budget) {
|
|
856
899
|
const n = sp.anchors.length;
|
|
857
|
-
const count =
|
|
900
|
+
const count = _chunkKANRAHTLcjs.subpathSegmentCount.call(void 0, sp);
|
|
858
901
|
for (let i = 0; i < count && budget > 0; i++) {
|
|
859
902
|
if (moving(i) || moving((i + 1) % n)) continue;
|
|
860
|
-
const seg =
|
|
903
|
+
const seg = _chunkKANRAHTLcjs.subpathSegment.call(void 0, sp, i).map((q) => toPoint(_chunkDWGZUSEScjs.applyMatrix.call(void 0, m, toVec(q))));
|
|
861
904
|
let minX = Infinity;
|
|
862
905
|
let minY = Infinity;
|
|
863
906
|
let maxX = -Infinity;
|
|
@@ -912,8 +955,8 @@ var VectorSnapTargets = (_class = class _VectorSnapTargets {
|
|
|
912
955
|
const visit = (list, parent) => {
|
|
913
956
|
for (const stored of list) {
|
|
914
957
|
if (exclude.has(stored.id) || stored.visible === false) continue;
|
|
915
|
-
const n = contains(stored, exclude) ? stored :
|
|
916
|
-
const m = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0,
|
|
958
|
+
const n = contains(stored, exclude) ? stored : _chunkKANRAHTLcjs.expandVectorAppearance.call(void 0, stored);
|
|
959
|
+
const m = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, _chunkKANRAHTLcjs.nodeMatrix.call(void 0, n), parent);
|
|
917
960
|
if (n.type === "group") {
|
|
918
961
|
visit(n.children, m);
|
|
919
962
|
continue;
|
|
@@ -928,7 +971,7 @@ var VectorSnapTargets = (_class = class _VectorSnapTargets {
|
|
|
928
971
|
}
|
|
929
972
|
if (gather !== "bounds") segments = self.pushSegments(sp, m, () => false, segments);
|
|
930
973
|
}
|
|
931
|
-
const b =
|
|
974
|
+
const b = _chunkKANRAHTLcjs.vectorNodeBounds.call(void 0, n, parent);
|
|
932
975
|
const f = nodeFrame(n, parent, b);
|
|
933
976
|
if (b) self.pushRect(b, "edge", _nullishCoalesce(_optionalChain([f, 'optionalAccess', _24 => _24.centre]), () => ( null)));
|
|
934
977
|
}
|
|
@@ -938,10 +981,10 @@ var VectorSnapTargets = (_class = class _VectorSnapTargets {
|
|
|
938
981
|
for (const n of list) {
|
|
939
982
|
if (exclude.has(n.id) || n.visible === false || self.boxes.length >= BUDGET) continue;
|
|
940
983
|
if (n.type === "group" && contains(n, exclude)) {
|
|
941
|
-
objects(n.children, _chunkDWGZUSEScjs.multiplyMatrices.call(void 0,
|
|
984
|
+
objects(n.children, _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, _chunkKANRAHTLcjs.nodeMatrix.call(void 0, n), parent));
|
|
942
985
|
continue;
|
|
943
986
|
}
|
|
944
|
-
const b =
|
|
987
|
+
const b = _chunkKANRAHTLcjs.vectorNodeBounds.call(void 0, n, parent);
|
|
945
988
|
if (b) self.boxes.push(b);
|
|
946
989
|
const f = nodeFrame(n, parent, b);
|
|
947
990
|
if (f) self.sizes.push(f.width, f.height);
|
|
@@ -1456,12 +1499,12 @@ var unit = (x, y) => {
|
|
|
1456
1499
|
return l > 1e-12 && Number.isFinite(l) ? [x / l, y / l] : null;
|
|
1457
1500
|
};
|
|
1458
1501
|
function cubicOf(sp, i) {
|
|
1459
|
-
const s =
|
|
1502
|
+
const s = _chunkKANRAHTLcjs.subpathSegment.call(void 0, sp, i);
|
|
1460
1503
|
if (s.length === 4) return s;
|
|
1461
1504
|
const [a, b] = s;
|
|
1462
1505
|
return [a, [a[0] + (b[0] - a[0]) / 3, a[1] + (b[1] - a[1]) / 3], [a[0] + 2 * (b[0] - a[0]) / 3, a[1] + 2 * (b[1] - a[1]) / 3], b];
|
|
1463
1506
|
}
|
|
1464
|
-
var isLine = (sp, i) =>
|
|
1507
|
+
var isLine = (sp, i) => _chunkKANRAHTLcjs.subpathSegment.call(void 0, sp, i).length === 2;
|
|
1465
1508
|
function startTangent(c) {
|
|
1466
1509
|
for (let k = 1; k < 4; k++) {
|
|
1467
1510
|
const u = unit(c[k][0] - c[0][0], c[k][1] - c[0][1]);
|
|
@@ -1481,10 +1524,10 @@ function sample(c, n, out, withStart) {
|
|
|
1481
1524
|
}
|
|
1482
1525
|
var onAnchor = (a, h) => !h || Math.abs(h.x - a.x) < EPS && Math.abs(h.y - a.y) < EPS;
|
|
1483
1526
|
function tidy(a, keepType = true) {
|
|
1484
|
-
const next =
|
|
1527
|
+
const next = _chunkKANRAHTLcjs.cloneAnchor.call(void 0, a);
|
|
1485
1528
|
if (onAnchor(next, next.in)) delete next.in;
|
|
1486
1529
|
if (onAnchor(next, next.out)) delete next.out;
|
|
1487
|
-
const shown =
|
|
1530
|
+
const shown = _chunkKANRAHTLcjs.inferAnchorType.call(void 0, next);
|
|
1488
1531
|
const type = keepType && a.type ? a.type === "symmetric" && shown !== "symmetric" ? shown === "corner" ? "corner" : "smooth" : a.type === "smooth" && shown === "corner" ? "corner" : a.type : shown;
|
|
1489
1532
|
if (type === "corner") delete next.type;
|
|
1490
1533
|
else next.type = type;
|
|
@@ -1528,7 +1571,7 @@ function fitAcross(pts, N, t0, t1) {
|
|
|
1528
1571
|
return goldenMin(fit, 0, 1);
|
|
1529
1572
|
}
|
|
1530
1573
|
function removeAnchorKeepingShape(sp, index) {
|
|
1531
|
-
const anchors = sp.anchors.map(
|
|
1574
|
+
const anchors = sp.anchors.map(_chunkKANRAHTLcjs.cloneAnchor);
|
|
1532
1575
|
const n = anchors.length;
|
|
1533
1576
|
if (index < 0 || index >= n) return { anchors, closed: sp.closed };
|
|
1534
1577
|
if ((sp.closed || index > 0 && index < n - 1) && n >= 3) {
|
|
@@ -1562,12 +1605,12 @@ function removeAnchorKeepingShape(sp, index) {
|
|
|
1562
1605
|
}
|
|
1563
1606
|
function removeAnchorsKeepingShape(sp, indices) {
|
|
1564
1607
|
const order = [...new Set(indices)].filter((i) => i >= 0 && i < sp.anchors.length).sort((a, b) => b - a);
|
|
1565
|
-
return order.reduce((acc, i) => removeAnchorKeepingShape(acc, i), { anchors: sp.anchors.map(
|
|
1608
|
+
return order.reduce((acc, i) => removeAnchorKeepingShape(acc, i), { anchors: sp.anchors.map(_chunkKANRAHTLcjs.cloneAnchor), closed: sp.closed });
|
|
1566
1609
|
}
|
|
1567
1610
|
function bendSegment(sp, segment, t, p) {
|
|
1568
|
-
const anchors = sp.anchors.map(
|
|
1611
|
+
const anchors = sp.anchors.map(_chunkKANRAHTLcjs.cloneAnchor);
|
|
1569
1612
|
const n = anchors.length;
|
|
1570
|
-
if (segment < 0 || segment >=
|
|
1613
|
+
if (segment < 0 || segment >= _chunkKANRAHTLcjs.subpathSegmentCount.call(void 0, sp) || !Number.isFinite(t) || !Number.isFinite(p.x) || !Number.isFinite(p.y)) return { anchors, closed: sp.closed };
|
|
1571
1614
|
const tc = Math.min(0.95, Math.max(0.05, t));
|
|
1572
1615
|
const ia = segment;
|
|
1573
1616
|
const ib = (segment + 1) % n;
|
|
@@ -1578,16 +1621,16 @@ function bendSegment(sp, segment, t, p) {
|
|
|
1578
1621
|
const oy = (p.y - (a.y + (b.y - a.y) * tc)) / k;
|
|
1579
1622
|
const c1 = { x: a.x + (b.x - a.x) / 3 + ox, y: a.y + (b.y - a.y) / 3 + oy };
|
|
1580
1623
|
const c2 = { x: b.x + (a.x - b.x) / 3 + ox, y: b.y + (a.y - b.y) / 3 + oy };
|
|
1581
|
-
anchors[ia] =
|
|
1582
|
-
anchors[ib] =
|
|
1624
|
+
anchors[ia] = _chunkKANRAHTLcjs.moveAnchorHandle.call(void 0, a, "out", c1);
|
|
1625
|
+
anchors[ib] = _chunkKANRAHTLcjs.moveAnchorHandle.call(void 0, b, "in", c2);
|
|
1583
1626
|
return { anchors, closed: sp.closed };
|
|
1584
1627
|
}
|
|
1585
1628
|
function subpathPointAt(sp, segment, t) {
|
|
1586
|
-
const [x, y] = _chunkXGD3FSNCcjs.segmentPoint.call(void 0,
|
|
1629
|
+
const [x, y] = _chunkXGD3FSNCcjs.segmentPoint.call(void 0, _chunkKANRAHTLcjs.subpathSegment.call(void 0, sp, segment), t);
|
|
1587
1630
|
return { x, y };
|
|
1588
1631
|
}
|
|
1589
1632
|
function curvatureMoveAnchor(sp, index, q) {
|
|
1590
|
-
const anchors = sp.anchors.map(
|
|
1633
|
+
const anchors = sp.anchors.map(_chunkKANRAHTLcjs.cloneAnchor);
|
|
1591
1634
|
const a = sp.anchors[index];
|
|
1592
1635
|
if (!a) return { anchors, closed: sp.closed };
|
|
1593
1636
|
const own = [
|
|
@@ -1632,7 +1675,7 @@ function curvatureMoveAnchor(sp, index, q) {
|
|
|
1632
1675
|
function cutSubpathAt(sp, at) {
|
|
1633
1676
|
const n = sp.anchors.length;
|
|
1634
1677
|
const cuts = [...new Set(at)].filter((i) => Number.isInteger(i) && i >= 0 && i < n && (sp.closed || i > 0 && i < n - 1)).sort((a, b) => a - b);
|
|
1635
|
-
if (!cuts.length || n < 2) return [{ anchors: sp.anchors.map(
|
|
1678
|
+
if (!cuts.length || n < 2) return [{ anchors: sp.anchors.map(_chunkKANRAHTLcjs.cloneAnchor), closed: sp.closed }];
|
|
1636
1679
|
const first = cuts[0];
|
|
1637
1680
|
const run = sp.closed ? Array.from({ length: n + 1 }, (_, i) => sp.anchors[(first + i) % n]) : sp.anchors;
|
|
1638
1681
|
const cutSet = new Set(sp.closed ? [...cuts.map((c) => (c - first + n) % n), n] : cuts);
|
|
@@ -1640,7 +1683,7 @@ function cutSubpathAt(sp, at) {
|
|
|
1640
1683
|
let cur = [];
|
|
1641
1684
|
run.forEach((a, i) => {
|
|
1642
1685
|
if (!cutSet.has(i)) {
|
|
1643
|
-
cur.push(
|
|
1686
|
+
cur.push(_chunkKANRAHTLcjs.cloneAnchor.call(void 0, a));
|
|
1644
1687
|
return;
|
|
1645
1688
|
}
|
|
1646
1689
|
if (cur.length) {
|
|
@@ -1655,10 +1698,10 @@ function cutSubpathAt(sp, at) {
|
|
|
1655
1698
|
}
|
|
1656
1699
|
function splitSubpathAt(sp, segment, t, endTolerance = 1e-6) {
|
|
1657
1700
|
const n = sp.anchors.length;
|
|
1658
|
-
if (segment < 0 || segment >=
|
|
1701
|
+
if (segment < 0 || segment >= _chunkKANRAHTLcjs.subpathSegmentCount.call(void 0, sp)) return [{ anchors: sp.anchors.map(_chunkKANRAHTLcjs.cloneAnchor), closed: sp.closed }];
|
|
1659
1702
|
if (t <= endTolerance) return cutSubpathAt(sp, [segment]);
|
|
1660
1703
|
if (t >= 1 - endTolerance) return cutSubpathAt(sp, [(segment + 1) % n]);
|
|
1661
|
-
const { subpath, index } =
|
|
1704
|
+
const { subpath, index } = _chunkKANRAHTLcjs.insertAnchor.call(void 0, sp, segment, t);
|
|
1662
1705
|
return cutSubpathAt(subpath, [index]);
|
|
1663
1706
|
}
|
|
1664
1707
|
var endOf = (sp, last) => sp.anchors[last ? sp.anchors.length - 1 : 0];
|
|
@@ -1680,7 +1723,7 @@ function joinSubpaths(subpaths, tolerance) {
|
|
|
1680
1723
|
const closed = [];
|
|
1681
1724
|
let open = [];
|
|
1682
1725
|
for (const sp of subpaths) {
|
|
1683
|
-
const copy = { anchors: sp.anchors.map(
|
|
1726
|
+
const copy = { anchors: sp.anchors.map(_chunkKANRAHTLcjs.cloneAnchor), closed: sp.closed };
|
|
1684
1727
|
if (sp.closed || sp.anchors.length < 2) {
|
|
1685
1728
|
if (sp.anchors.length) closed.push(copy);
|
|
1686
1729
|
} else open.push(copy);
|
|
@@ -1735,7 +1778,7 @@ function smoothSubpath(sp, amount = 1, only) {
|
|
|
1735
1778
|
const t = Math.min(1, Math.max(0, amount));
|
|
1736
1779
|
const orig = sp.anchors;
|
|
1737
1780
|
const n = orig.length;
|
|
1738
|
-
const anchors = orig.map(
|
|
1781
|
+
const anchors = orig.map(_chunkKANRAHTLcjs.cloneAnchor);
|
|
1739
1782
|
if (n < 3 || t === 0) return { anchors, closed: sp.closed };
|
|
1740
1783
|
for (let i = 0; i < n; i++) {
|
|
1741
1784
|
if (!sp.closed && (i === 0 || i === n - 1)) continue;
|
|
@@ -1764,8 +1807,8 @@ function smoothSubpath(sp, amount = 1, only) {
|
|
|
1764
1807
|
}
|
|
1765
1808
|
function segsOf(sp) {
|
|
1766
1809
|
const out = [];
|
|
1767
|
-
for (let i = 0; i <
|
|
1768
|
-
const s =
|
|
1810
|
+
for (let i = 0; i < _chunkKANRAHTLcjs.subpathSegmentCount.call(void 0, sp); i++) {
|
|
1811
|
+
const s = _chunkKANRAHTLcjs.subpathSegment.call(void 0, sp, i);
|
|
1769
1812
|
out.push(s.length === 2 ? { c: s, line: true } : { c: s, line: false });
|
|
1770
1813
|
}
|
|
1771
1814
|
return out;
|
|
@@ -1822,7 +1865,7 @@ function removeRedundantPoints(sp, tolerance) {
|
|
|
1822
1865
|
const tol = Math.max(tolerance, 1e-9);
|
|
1823
1866
|
const types = new Map(sp.anchors.filter((a) => a.type).map((a) => [`${a.x},${a.y}`, a.type]));
|
|
1824
1867
|
const segs = segsOf(sp).filter((s) => !isZeroSeg(s));
|
|
1825
|
-
if (!segs.length) return { anchors: sp.anchors.map(
|
|
1868
|
+
if (!segs.length) return { anchors: sp.anchors.map(_chunkKANRAHTLcjs.cloneAnchor), closed: sp.closed };
|
|
1826
1869
|
const minSegs = sp.closed ? 2 : 1;
|
|
1827
1870
|
let changed = true;
|
|
1828
1871
|
while (changed && segs.length > minSegs) {
|
|
@@ -1840,7 +1883,7 @@ function removeRedundantPoints(sp, tolerance) {
|
|
|
1840
1883
|
break;
|
|
1841
1884
|
}
|
|
1842
1885
|
}
|
|
1843
|
-
return _nullishCoalesce(segsToSubpath(segs, sp.closed, types), () => ( { anchors: sp.anchors.map(
|
|
1886
|
+
return _nullishCoalesce(segsToSubpath(segs, sp.closed, types), () => ( { anchors: sp.anchors.map(_chunkKANRAHTLcjs.cloneAnchor), closed: sp.closed }));
|
|
1844
1887
|
}
|
|
1845
1888
|
|
|
1846
1889
|
// src/vector/pathCut.ts
|
|
@@ -2079,14 +2122,14 @@ function eraseFromOutline(sp, region) {
|
|
|
2079
2122
|
const regionSegs = _chunkXGD3FSNCcjs.pathToContours.call(void 0, region).flatMap((c) => _chunkXGD3FSNCcjs.closeContour.call(void 0, c, true));
|
|
2080
2123
|
if (!regionSegs.length) return null;
|
|
2081
2124
|
const rb = _chunkXGD3FSNCcjs.bezierPathBounds.call(void 0, region);
|
|
2082
|
-
const count =
|
|
2125
|
+
const count = _chunkKANRAHTLcjs.subpathSegmentCount.call(void 0, sp);
|
|
2083
2126
|
if (!rb || count === 0) return null;
|
|
2084
2127
|
const removed = (p) => _chunkXGD3FSNCcjs.pointInBezierPath.call(void 0, region, p, "nonzero");
|
|
2085
2128
|
const runs = [];
|
|
2086
2129
|
let cur = [];
|
|
2087
2130
|
let any = false;
|
|
2088
2131
|
for (let i = 0; i < count; i++) {
|
|
2089
|
-
const seg =
|
|
2132
|
+
const seg = _chunkKANRAHTLcjs.subpathSegment.call(void 0, sp, i);
|
|
2090
2133
|
const sb = _chunkXGD3FSNCcjs.segmentBounds.call(void 0, seg);
|
|
2091
2134
|
const ts = [0, 1];
|
|
2092
2135
|
if (!(sb.maxX < rb.minX || sb.minX > rb.maxX || sb.maxY < rb.minY || sb.minY > rb.maxY)) {
|
|
@@ -2120,7 +2163,7 @@ function eraseFromOutline(sp, region) {
|
|
|
2120
2163
|
for (const run of runs) {
|
|
2121
2164
|
const anchors = [];
|
|
2122
2165
|
for (const { seg, t0, t1 } of run) {
|
|
2123
|
-
const c = _chunkXGD3FSNCcjs.subSegment.call(void 0,
|
|
2166
|
+
const c = _chunkXGD3FSNCcjs.subSegment.call(void 0, _chunkKANRAHTLcjs.subpathSegment.call(void 0, sp, seg), t0, t1);
|
|
2124
2167
|
const line2 = c.length === 2;
|
|
2125
2168
|
const start = c[0];
|
|
2126
2169
|
const end = c[c.length - 1];
|
|
@@ -2132,7 +2175,7 @@ function eraseFromOutline(sp, region) {
|
|
|
2132
2175
|
}
|
|
2133
2176
|
if (anchors.length < 2) continue;
|
|
2134
2177
|
for (const a of anchors) {
|
|
2135
|
-
const type =
|
|
2178
|
+
const type = _chunkKANRAHTLcjs.inferAnchorType.call(void 0, a);
|
|
2136
2179
|
if (type !== "corner") a.type = type;
|
|
2137
2180
|
}
|
|
2138
2181
|
out.push({ anchors, closed: false });
|
|
@@ -2414,10 +2457,10 @@ function vectorPathEntries(doc, roots, options = {}) {
|
|
|
2414
2457
|
const out = [];
|
|
2415
2458
|
const visit = (stored, parent, inside) => {
|
|
2416
2459
|
if (stored.visible === false || stored.locked && !options.locked) return;
|
|
2417
|
-
const node = options.expand === false ? stored :
|
|
2460
|
+
const node = options.expand === false ? stored : _chunkKANRAHTLcjs.expandVectorAppearance.call(void 0, stored);
|
|
2418
2461
|
const picked = inside || roots === null || roots.includes(node.id);
|
|
2419
2462
|
if (node.type === "group") {
|
|
2420
|
-
const m = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0,
|
|
2463
|
+
const m = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, _chunkKANRAHTLcjs.nodeMatrix.call(void 0, node), parent);
|
|
2421
2464
|
for (const c of node.children) visit(c, m, picked);
|
|
2422
2465
|
} else if (picked) out.push({ node, parent });
|
|
2423
2466
|
};
|
|
@@ -2426,10 +2469,10 @@ function vectorPathEntries(doc, roots, options = {}) {
|
|
|
2426
2469
|
}
|
|
2427
2470
|
var usable = (sp) => sp.anchors.length > 1;
|
|
2428
2471
|
function worldOf(entry, subpaths) {
|
|
2429
|
-
return
|
|
2472
|
+
return _chunkKANRAHTLcjs.vectorPathWorldBezier.call(void 0, { ...entry.node, subpaths }, entry.parent);
|
|
2430
2473
|
}
|
|
2431
2474
|
function subpathEnclosesArea(sp) {
|
|
2432
|
-
const contour = _chunkXGD3FSNCcjs.pathToContours.call(void 0,
|
|
2475
|
+
const contour = _chunkXGD3FSNCcjs.pathToContours.call(void 0, _chunkKANRAHTLcjs.subpathsToBezier.call(void 0, [{ ...sp, closed: true }]))[0];
|
|
2433
2476
|
if (!contour) return false;
|
|
2434
2477
|
const segs = _chunkXGD3FSNCcjs.closeContour.call(void 0, contour, true);
|
|
2435
2478
|
const b = _chunkXGD3FSNCcjs.bezierPathBounds.call(void 0, _chunkXGD3FSNCcjs.contoursToPath.call(void 0, [{ segments: segs, closed: true }]));
|
|
@@ -2444,11 +2487,11 @@ function vectorPathfinderShape(entry, op) {
|
|
|
2444
2487
|
const subpaths = node.subpaths.filter(usable);
|
|
2445
2488
|
const closed = subpaths.map((s) => ({ ...s, closed: true }));
|
|
2446
2489
|
const fillRule = _nullishCoalesce(node.fillRule, () => ( "nonzero"));
|
|
2447
|
-
if (
|
|
2490
|
+
if (_chunkKANRAHTLcjs.hasPaint.call(void 0, node.fill)) return { path: worldOf(entry, closed), fillRule, key: `fill:${paintKey(node.fill)}`, paint: "fill" };
|
|
2448
2491
|
const open = subpaths.length > 0 && subpaths.every((s) => !s.closed);
|
|
2449
2492
|
if (op === "divide" && open) return { path: worldOf(entry, subpaths), line: true, paint: "line" };
|
|
2450
|
-
if (
|
|
2451
|
-
const path =
|
|
2493
|
+
if (_chunkKANRAHTLcjs.hasPaint.call(void 0, node.stroke) && (_nullishCoalesce(node.strokeWidth, () => ( 1))) > 0) {
|
|
2494
|
+
const path = _chunkKANRAHTLcjs.vectorStrokeOutline.call(void 0, { ...node, subpaths }, entry.parent);
|
|
2452
2495
|
return { path, fillRule: "nonzero", key: `fill:${paintKey(node.stroke)}`, paint: "stroke" };
|
|
2453
2496
|
}
|
|
2454
2497
|
return { path: worldOf(entry, closed), fillRule, key: "none", paint: "outline" };
|
|
@@ -2472,7 +2515,7 @@ function vectorResultStyle(node, paint, edge = false) {
|
|
|
2472
2515
|
const base = { ...rest, fillRule: "nonzero" };
|
|
2473
2516
|
if (edge) {
|
|
2474
2517
|
for (const k of STROKE_KEYS) delete base[k];
|
|
2475
|
-
const stroke = paint === "stroke" || !
|
|
2518
|
+
const stroke = paint === "stroke" || !_chunkKANRAHTLcjs.hasPaint.call(void 0, node.fill) ? node.stroke : node.fill;
|
|
2476
2519
|
return { ...base, fill: null, stroke: _nullishCoalesce(stroke, () => ( "#000000")), strokeWidth: _nullishCoalesce(node.strokeWidth, () => ( 1)) };
|
|
2477
2520
|
}
|
|
2478
2521
|
if (paint === "stroke") {
|
|
@@ -2484,7 +2527,7 @@ function vectorResultStyle(node, paint, edge = false) {
|
|
|
2484
2527
|
function vectorShapeBuilderMap(entries) {
|
|
2485
2528
|
const lines = [];
|
|
2486
2529
|
const inputs = entries.map((entry) => {
|
|
2487
|
-
const filled =
|
|
2530
|
+
const filled = _chunkKANRAHTLcjs.hasPaint.call(void 0, entry.node.fill);
|
|
2488
2531
|
const subpaths = entry.node.subpaths.filter(usable).map((sp) => !sp.closed && filled && subpathEnclosesArea(sp) ? { ...sp, closed: true } : sp);
|
|
2489
2532
|
lines.push(!subpaths.some((s) => s.closed));
|
|
2490
2533
|
return { path: worldOf(entry, subpaths), fillRule: _nullishCoalesce(entry.node.fillRule, () => ( "nonzero")) };
|
|
@@ -2589,7 +2632,7 @@ function planShapeBuilder(m, touched, erase) {
|
|
|
2589
2632
|
const kept = faces.flatMap((_, f) => sourcesOf[f].includes(i) && !picked.has(f) ? [f] : []);
|
|
2590
2633
|
rest = kept.length ? m.map.merge(kept) : [];
|
|
2591
2634
|
} else rest = worldOf(entry, entry.node.subpaths.filter(usable));
|
|
2592
|
-
const fillCloses =
|
|
2635
|
+
const fillCloses = _chunkKANRAHTLcjs.hasPaint.call(void 0, entry.node.fill);
|
|
2593
2636
|
let cut = false;
|
|
2594
2637
|
for (const piece of cuts) {
|
|
2595
2638
|
const r = rest.length ? _chunkJEYDXRWQcjs.cutOutPiece.call(void 0, rest, piece, fillCloses, m.tolerance) : null;
|
|
@@ -2655,7 +2698,9 @@ var VECTOR_STYLE_KEYS = [
|
|
|
2655
2698
|
"arrowAlign",
|
|
2656
2699
|
"startArrowScale",
|
|
2657
2700
|
"endArrowScale",
|
|
2658
|
-
"strokeWidthProfile"
|
|
2701
|
+
"strokeWidthProfile",
|
|
2702
|
+
"fills",
|
|
2703
|
+
"strokes"
|
|
2659
2704
|
];
|
|
2660
2705
|
var VECTOR_CLIPBOARD_TYPE = "pixerate/vector";
|
|
2661
2706
|
var DEFAULT_DEFAULTS = {
|
|
@@ -2678,18 +2723,18 @@ function getEditablePathIds(state) {
|
|
|
2678
2723
|
if (state.tool === "direct") {
|
|
2679
2724
|
if (state.editingId) ids.add(state.editingId);
|
|
2680
2725
|
for (const id of state.selection) {
|
|
2681
|
-
const node =
|
|
2726
|
+
const node = _chunkKANRAHTLcjs.findVectorNode.call(void 0, state.document.nodes, id);
|
|
2682
2727
|
if (node && !node.locked) {
|
|
2683
|
-
for (const p of
|
|
2728
|
+
for (const p of _chunkKANRAHTLcjs.collectPathNodes.call(void 0, node)) if (!p.locked) ids.add(p.id);
|
|
2684
2729
|
}
|
|
2685
2730
|
}
|
|
2686
2731
|
}
|
|
2687
|
-
return [...ids].filter((id) => _optionalChain([
|
|
2732
|
+
return [...ids].filter((id) => _optionalChain([_chunkKANRAHTLcjs.findVectorNode.call(void 0, state.document.nodes, id), 'optionalAccess', _38 => _38.type]) === "path");
|
|
2688
2733
|
}
|
|
2689
2734
|
function getVisibleAnchors(state) {
|
|
2690
2735
|
const out = [];
|
|
2691
2736
|
for (const id of getEditablePathIds(state)) {
|
|
2692
|
-
const node =
|
|
2737
|
+
const node = _chunkKANRAHTLcjs.findVectorNode.call(void 0, state.document.nodes, id);
|
|
2693
2738
|
node.subpaths.forEach((sp, s) => sp.anchors.forEach((_, i) => out.push({ nodeId: id, subpath: s, index: i })));
|
|
2694
2739
|
}
|
|
2695
2740
|
return out;
|
|
@@ -2707,7 +2752,7 @@ function getVisibleHandles(state) {
|
|
|
2707
2752
|
out.push({ nodeId: node.id, subpath: s, index: i, handle });
|
|
2708
2753
|
};
|
|
2709
2754
|
if (state.tool === "pen" && state.pen) {
|
|
2710
|
-
const node =
|
|
2755
|
+
const node = _chunkKANRAHTLcjs.findVectorNode.call(void 0, state.document.nodes, state.pen.nodeId);
|
|
2711
2756
|
const sp = _optionalChain([node, 'optionalAccess', _41 => _41.type]) === "path" ? node.subpaths[state.pen.subpath] : void 0;
|
|
2712
2757
|
if (_optionalChain([node, 'optionalAccess', _42 => _42.type]) === "path" && sp) {
|
|
2713
2758
|
const last = sp.anchors.length - 1;
|
|
@@ -2720,7 +2765,7 @@ function getVisibleHandles(state) {
|
|
|
2720
2765
|
const editable = new Set(getEditablePathIds(state));
|
|
2721
2766
|
for (const ref of state.selectedAnchors) {
|
|
2722
2767
|
if (!editable.has(ref.nodeId)) continue;
|
|
2723
|
-
const node =
|
|
2768
|
+
const node = _chunkKANRAHTLcjs.findVectorNode.call(void 0, state.document.nodes, ref.nodeId);
|
|
2724
2769
|
const sp = node.subpaths[ref.subpath];
|
|
2725
2770
|
if (!sp) continue;
|
|
2726
2771
|
const n = sp.anchors.length;
|
|
@@ -2739,26 +2784,26 @@ function getVectorCornerWidgets(state) {
|
|
|
2739
2784
|
const zoom = state.viewport.zoom;
|
|
2740
2785
|
const out = [];
|
|
2741
2786
|
for (const id of getEditablePathIds(state)) {
|
|
2742
|
-
const node =
|
|
2787
|
+
const node = _chunkKANRAHTLcjs.findVectorNode.call(void 0, state.document.nodes, id);
|
|
2743
2788
|
const picked = state.selectedAnchors.filter((r) => r.nodeId === id);
|
|
2744
|
-
const m = _nullishCoalesce(
|
|
2745
|
-
for (const c of
|
|
2789
|
+
const m = _nullishCoalesce(_chunkKANRAHTLcjs.vectorWorldMatrix.call(void 0, state.document.nodes, id), () => ( _chunkDWGZUSEScjs.IDENTITY_MATRIX));
|
|
2790
|
+
for (const c of _chunkKANRAHTLcjs.vectorCorners.call(void 0, node.subpaths)) {
|
|
2746
2791
|
if (picked.length && !picked.some((r) => r.subpath === c.subpath && r.index === c.index)) continue;
|
|
2747
2792
|
const side = Math.min(c.lu, c.lv);
|
|
2748
2793
|
if (side * zoom < 3 * VECTOR_CORNER_WIDGET_INSET) continue;
|
|
2749
2794
|
const a = node.subpaths[c.subpath].anchors[c.index];
|
|
2750
2795
|
const radius = _nullishCoalesce(_optionalChain([a, 'access', _43 => _43.corner, 'optionalAccess', _44 => _44.radius]), () => ( 0));
|
|
2751
|
-
const drawn =
|
|
2796
|
+
const drawn = _chunkKANRAHTLcjs.fitCornerRadius.call(void 0, c, radius);
|
|
2752
2797
|
const k = Math.min(Math.max(drawn / c.sin, VECTOR_CORNER_WIDGET_INSET / (zoom * Math.sqrt(1 + c.cos))), side / 2);
|
|
2753
|
-
const p = _chunkDWGZUSEScjs.applyMatrix.call(void 0, m,
|
|
2798
|
+
const p = _chunkDWGZUSEScjs.applyMatrix.call(void 0, m, _chunkKANRAHTLcjs.cornerBisectorPoint.call(void 0, c, k));
|
|
2754
2799
|
out.push({ ref: { nodeId: id, subpath: c.subpath, index: c.index }, x: p.x, y: p.y, radius, drawnRadius: drawn, kind: _nullishCoalesce(_optionalChain([a, 'access', _45 => _45.corner, 'optionalAccess', _46 => _46.kind]), () => ( "round")), corner: c });
|
|
2755
2800
|
}
|
|
2756
2801
|
}
|
|
2757
2802
|
return out;
|
|
2758
2803
|
}
|
|
2759
2804
|
function vectorStrokeWidthGeometry(node) {
|
|
2760
|
-
if (!
|
|
2761
|
-
const parts =
|
|
2805
|
+
if (!_chunkKANRAHTLcjs.hasPaint.call(void 0, node.stroke) || !((_nullishCoalesce(node.strokeWidth, () => ( 1))) > 0)) return null;
|
|
2806
|
+
const parts = _chunkKANRAHTLcjs.vectorStrokeParts.call(void 0, _chunkKANRAHTLcjs.subpathsToBezier.call(void 0, node.subpaths), node);
|
|
2762
2807
|
return parts.line.length ? { line: parts.line, unit: parts.drawWidth / 2 } : null;
|
|
2763
2808
|
}
|
|
2764
2809
|
function shiftWidthPoints(profile, indices, dt) {
|
|
@@ -2771,24 +2816,24 @@ function getVectorWidthHandles(state) {
|
|
|
2771
2816
|
if (state.tool !== "width") return [];
|
|
2772
2817
|
const ids = /* @__PURE__ */ new Set();
|
|
2773
2818
|
for (const id of state.selection) {
|
|
2774
|
-
const n =
|
|
2775
|
-
if (n) for (const p of
|
|
2819
|
+
const n = _chunkKANRAHTLcjs.findVectorNode.call(void 0, state.document.nodes, id);
|
|
2820
|
+
if (n) for (const p of _chunkKANRAHTLcjs.collectPathNodes.call(void 0, n)) ids.add(p.id);
|
|
2776
2821
|
}
|
|
2777
2822
|
if (_optionalChain([state, 'access', _47 => _47.hover, 'optionalAccess', _48 => _48.nodeId])) ids.add(state.hover.nodeId);
|
|
2778
2823
|
if (_optionalChain([state, 'access', _49 => _49.interaction, 'optionalAccess', _50 => _50.type]) === "width") ids.add(state.interaction.ref.nodeId);
|
|
2779
2824
|
for (const r of state.selectedWidthPoints) ids.add(r.nodeId);
|
|
2780
2825
|
const out = [];
|
|
2781
2826
|
for (const id of ids) {
|
|
2782
|
-
const node =
|
|
2827
|
+
const node = _chunkKANRAHTLcjs.findVectorNode.call(void 0, state.document.nodes, id);
|
|
2783
2828
|
if (_optionalChain([node, 'optionalAccess', _51 => _51.type]) !== "path" || node.visible === false || !_optionalChain([node, 'access', _52 => _52.strokeWidthProfile, 'optionalAccess', _53 => _53.length])) continue;
|
|
2784
2829
|
const g = vectorStrokeWidthGeometry(node);
|
|
2785
2830
|
if (!g) continue;
|
|
2786
|
-
const profile =
|
|
2787
|
-
const m = _nullishCoalesce(
|
|
2831
|
+
const profile = _chunkKANRAHTLcjs.sanitizeWidthProfile.call(void 0, node.strokeWidthProfile);
|
|
2832
|
+
const m = _nullishCoalesce(_chunkKANRAHTLcjs.vectorWorldMatrix.call(void 0, state.document.nodes, id), () => ( _chunkDWGZUSEScjs.IDENTITY_MATRIX));
|
|
2788
2833
|
const contours = node.subpaths.length;
|
|
2789
2834
|
for (let sp = 0; sp < contours; sp++) {
|
|
2790
2835
|
profile.forEach((w, index) => {
|
|
2791
|
-
const at =
|
|
2836
|
+
const at = _chunkKANRAHTLcjs.strokePositionPoint.call(void 0, g.line, sp, w.t);
|
|
2792
2837
|
if (!at) return;
|
|
2793
2838
|
const n = { x: at.tangent[1], y: -at.tangent[0] };
|
|
2794
2839
|
const c = { x: at.point[0], y: at.point[1] };
|
|
@@ -2812,24 +2857,24 @@ function getVectorWidthHandles(state) {
|
|
|
2812
2857
|
return out;
|
|
2813
2858
|
}
|
|
2814
2859
|
function getAnchor(doc, ref) {
|
|
2815
|
-
const node =
|
|
2860
|
+
const node = _chunkKANRAHTLcjs.findVectorNode.call(void 0, doc.nodes, ref.nodeId);
|
|
2816
2861
|
return _optionalChain([node, 'optionalAccess', _54 => _54.type]) === "path" ? _optionalChain([node, 'access', _55 => _55.subpaths, 'access', _56 => _56[ref.subpath], 'optionalAccess', _57 => _57.anchors, 'access', _58 => _58[ref.index]]) : void 0;
|
|
2817
2862
|
}
|
|
2818
2863
|
function getAnchorWorld(doc, ref) {
|
|
2819
2864
|
const a = getAnchor(doc, ref);
|
|
2820
2865
|
if (!a) return void 0;
|
|
2821
|
-
const m = _nullishCoalesce(
|
|
2866
|
+
const m = _nullishCoalesce(_chunkKANRAHTLcjs.vectorWorldMatrix.call(void 0, doc.nodes, ref.nodeId), () => ( _chunkDWGZUSEScjs.IDENTITY_MATRIX));
|
|
2822
2867
|
const p = _chunkDWGZUSEScjs.applyMatrix.call(void 0, m, a);
|
|
2823
2868
|
return { x: p.x, y: p.y, ...a.in ? { in: _chunkDWGZUSEScjs.applyMatrix.call(void 0, m, a.in) } : {}, ...a.out ? { out: _chunkDWGZUSEScjs.applyMatrix.call(void 0, m, a.out) } : {}, ...a.type ? { type: a.type } : {} };
|
|
2824
2869
|
}
|
|
2825
2870
|
function getVectorSelectionFrame(doc, ids) {
|
|
2826
|
-
const nodes = ids.map((id) => ({ node:
|
|
2871
|
+
const nodes = ids.map((id) => ({ node: _chunkKANRAHTLcjs.findVectorNode.call(void 0, doc.nodes, id), parent: _nullishCoalesce(_chunkKANRAHTLcjs.vectorParentMatrix.call(void 0, doc.nodes, id), () => ( _chunkDWGZUSEScjs.IDENTITY_MATRIX)) })).filter((n) => n.node);
|
|
2827
2872
|
if (!nodes.length) return null;
|
|
2828
|
-
const angles = nodes.map((n) => _chunkDWGZUSEScjs.matrixRotation.call(void 0, _chunkDWGZUSEScjs.multiplyMatrices.call(void 0,
|
|
2873
|
+
const angles = nodes.map((n) => _chunkDWGZUSEScjs.matrixRotation.call(void 0, _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, _chunkKANRAHTLcjs.nodeMatrix.call(void 0, n.node), n.parent)));
|
|
2829
2874
|
const same = angles.every((a) => Math.abs(normalizeAngle(a - angles[0])) < 1e-6);
|
|
2830
2875
|
const angle = same ? angles[0] : 0;
|
|
2831
2876
|
const unrotate = _chunkDWGZUSEScjs.rotateMatrix.call(void 0, -angle);
|
|
2832
|
-
const b =
|
|
2877
|
+
const b = _chunkKANRAHTLcjs.unionBounds.call(void 0, nodes.map((n) => _chunkKANRAHTLcjs.vectorNodeBounds.call(void 0, n.node, _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, n.parent, unrotate))));
|
|
2833
2878
|
return b ? { ...b, angle } : null;
|
|
2834
2879
|
}
|
|
2835
2880
|
var normalizeAngle = (a) => ((a + 180) % 360 + 360) % 360 - 180;
|
|
@@ -2864,10 +2909,10 @@ function getVectorSelectionBoxGeometry(frame, viewport) {
|
|
|
2864
2909
|
}
|
|
2865
2910
|
function getVectorEnvelopeTarget(doc, selection) {
|
|
2866
2911
|
if (selection.length !== 1) return null;
|
|
2867
|
-
const node =
|
|
2868
|
-
if (!node || !
|
|
2869
|
-
const frame =
|
|
2870
|
-
return frame ? { node, frame, world: _nullishCoalesce(
|
|
2912
|
+
const node = _chunkKANRAHTLcjs.findVectorNode.call(void 0, doc.nodes, selection[0]);
|
|
2913
|
+
if (!node || !_chunkKANRAHTLcjs.vectorNodeEnvelope.call(void 0, node)) return null;
|
|
2914
|
+
const frame = _chunkKANRAHTLcjs.vectorEnvelopeFrame.call(void 0, node);
|
|
2915
|
+
return frame ? { node, frame, world: _nullishCoalesce(_chunkKANRAHTLcjs.vectorWorldMatrix.call(void 0, doc.nodes, node.id), () => ( _chunkDWGZUSEScjs.IDENTITY_MATRIX)) } : null;
|
|
2871
2916
|
}
|
|
2872
2917
|
var RESIZE_CURSOR_ORDER = ["ew-resize", "nwse-resize", "ns-resize", "nesw-resize"];
|
|
2873
2918
|
var HANDLE_ANGLES = { e: 0, se: 45, s: 90, sw: 135, w: 180, nw: 225, n: 270, ne: 315 };
|
|
@@ -2975,6 +3020,24 @@ var VECTOR_PATHFINDER_LABELS = {
|
|
|
2975
3020
|
outline: "Outline",
|
|
2976
3021
|
minusBack: "Minus Back"
|
|
2977
3022
|
};
|
|
3023
|
+
function normalizeVectorTree(nodes, prefer) {
|
|
3024
|
+
let changed = false;
|
|
3025
|
+
const out = nodes.map((n) => {
|
|
3026
|
+
let next = n.type === "path" ? _chunkKANRAHTLcjs.normalizeVectorPaintStacks.call(void 0, n, prefer) : n;
|
|
3027
|
+
if (next.type === "group") {
|
|
3028
|
+
const children = normalizeVectorTree(next.children, prefer);
|
|
3029
|
+
if (children !== next.children) next = { ...next, children };
|
|
3030
|
+
}
|
|
3031
|
+
if (next !== n) changed = true;
|
|
3032
|
+
return next;
|
|
3033
|
+
});
|
|
3034
|
+
return changed ? out : nodes;
|
|
3035
|
+
}
|
|
3036
|
+
function loadedDocument(doc) {
|
|
3037
|
+
const copy = _chunkKANRAHTLcjs.cloneVectorDocument.call(void 0, doc);
|
|
3038
|
+
const nodes = normalizeVectorTree(copy.nodes, "stack");
|
|
3039
|
+
return nodes === copy.nodes ? copy : { ...copy, nodes };
|
|
3040
|
+
}
|
|
2978
3041
|
function mapTree(nodes, fn) {
|
|
2979
3042
|
let changed = false;
|
|
2980
3043
|
const out = [];
|
|
@@ -3054,7 +3117,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
3054
3117
|
__init27() {this.blendStart = null}
|
|
3055
3118
|
/** Options new blends get (the toolbars edit them along with the selected blend's). */
|
|
3056
3119
|
__init28() {this.blendDefaults = {}}
|
|
3057
|
-
__init29() {this.gradientEdit = { target: "fill", stop: null }}
|
|
3120
|
+
__init29() {this.gradientEdit = { target: "fill", stop: null, layer: null }}
|
|
3058
3121
|
__init30() {this.freeDistort = false}
|
|
3059
3122
|
/** What the highlight shows, to skip notifying when the pointer stays over the same face. */
|
|
3060
3123
|
__init31() {this.builderHoverKey = null}
|
|
@@ -3069,7 +3132,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
3069
3132
|
|
|
3070
3133
|
constructor(options = {}) {;_class3.prototype.__init9.call(this);_class3.prototype.__init10.call(this);_class3.prototype.__init11.call(this);_class3.prototype.__init12.call(this);_class3.prototype.__init13.call(this);_class3.prototype.__init14.call(this);_class3.prototype.__init15.call(this);_class3.prototype.__init16.call(this);_class3.prototype.__init17.call(this);_class3.prototype.__init18.call(this);_class3.prototype.__init19.call(this);_class3.prototype.__init20.call(this);_class3.prototype.__init21.call(this);_class3.prototype.__init22.call(this);_class3.prototype.__init23.call(this);_class3.prototype.__init24.call(this);_class3.prototype.__init25.call(this);_class3.prototype.__init26.call(this);_class3.prototype.__init27.call(this);_class3.prototype.__init28.call(this);_class3.prototype.__init29.call(this);_class3.prototype.__init30.call(this);_class3.prototype.__init31.call(this);_class3.prototype.__init32.call(this);_class3.prototype.__init33.call(this);_class3.prototype.__init34.call(this);_class3.prototype.__init35.call(this);_class3.prototype.__init36.call(this);_class3.prototype.__init37.call(this);_class3.prototype.__init38.call(this);
|
|
3071
3134
|
this.history = _nullishCoalesce(options.history, () => ( new (0, _chunkQKLRAA4Tcjs.HistoryManager)()));
|
|
3072
|
-
this.doc = options.document ?
|
|
3135
|
+
this.doc = options.document ? loadedDocument(options.document) : { width: 800, height: 600, nodes: [] };
|
|
3073
3136
|
this.doc = this.refreshed(this.doc);
|
|
3074
3137
|
this.tool = _nullishCoalesce(options.tool, () => ( "select"));
|
|
3075
3138
|
this.defaults = { ...DEFAULT_DEFAULTS, ..._nullishCoalesce(options.defaults, () => ( {})) };
|
|
@@ -3122,7 +3185,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
3122
3185
|
return this.doc;
|
|
3123
3186
|
}
|
|
3124
3187
|
getNode(id) {
|
|
3125
|
-
return
|
|
3188
|
+
return _chunkKANRAHTLcjs.findVectorNode.call(void 0, this.doc.nodes, id);
|
|
3126
3189
|
}
|
|
3127
3190
|
computeState() {
|
|
3128
3191
|
const h = this.history.getState();
|
|
@@ -3161,7 +3224,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
3161
3224
|
}
|
|
3162
3225
|
/** `doc` with its blends' steps brought up to date (the same object when they already are). */
|
|
3163
3226
|
refreshed(doc) {
|
|
3164
|
-
const nodes = refreshVectorBlends(doc.nodes);
|
|
3227
|
+
const nodes = refreshVectorBlends(normalizeVectorTree(doc.nodes, "shorthand"));
|
|
3165
3228
|
return nodes === doc.nodes ? doc : { ...doc, nodes };
|
|
3166
3229
|
}
|
|
3167
3230
|
notify(docChanged = false) {
|
|
@@ -3181,10 +3244,10 @@ var VectorEditorController = (_class3 = class {
|
|
|
3181
3244
|
});
|
|
3182
3245
|
}
|
|
3183
3246
|
boundsOf(ids) {
|
|
3184
|
-
return
|
|
3247
|
+
return _chunkKANRAHTLcjs.unionBounds.call(void 0,
|
|
3185
3248
|
ids.map((id) => {
|
|
3186
3249
|
const n = this.getNode(id);
|
|
3187
|
-
return n ?
|
|
3250
|
+
return n ? _chunkKANRAHTLcjs.vectorNodeBounds.call(void 0, n, _nullishCoalesce(_chunkKANRAHTLcjs.vectorParentMatrix.call(void 0, this.doc.nodes, id), () => ( _chunkDWGZUSEScjs.IDENTITY_MATRIX))) : null;
|
|
3188
3251
|
})
|
|
3189
3252
|
);
|
|
3190
3253
|
}
|
|
@@ -3193,7 +3256,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
3193
3256
|
}
|
|
3194
3257
|
/** Local → document matrix of a node in `doc` (default: the current document). */
|
|
3195
3258
|
worldOf(id, doc = this.doc) {
|
|
3196
|
-
return _nullishCoalesce(
|
|
3259
|
+
return _nullishCoalesce(_chunkKANRAHTLcjs.vectorWorldMatrix.call(void 0, doc.nodes, id), () => ( _chunkDWGZUSEScjs.IDENTITY_MATRIX));
|
|
3197
3260
|
}
|
|
3198
3261
|
/** A document point in node `id`'s own space. */
|
|
3199
3262
|
toLocal(id, p, doc = this.doc) {
|
|
@@ -3310,9 +3373,9 @@ var VectorEditorController = (_class3 = class {
|
|
|
3310
3373
|
this.setDoc(mapTree(this.doc.nodes, (n) => n.id === id ? next : n));
|
|
3311
3374
|
}
|
|
3312
3375
|
freshIds(node) {
|
|
3313
|
-
const copy =
|
|
3376
|
+
const copy = _chunkKANRAHTLcjs.cloneVectorNode.call(void 0, node);
|
|
3314
3377
|
const used = /* @__PURE__ */ new Set();
|
|
3315
|
-
|
|
3378
|
+
_chunkKANRAHTLcjs.walkVectorNodes.call(void 0, this.doc.nodes, (n) => used.add(n.id));
|
|
3316
3379
|
const next = () => {
|
|
3317
3380
|
let id = this.createId();
|
|
3318
3381
|
while (used.has(id)) id = this.createId();
|
|
@@ -3480,7 +3543,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
3480
3543
|
/** Replaces the document. Undoable unless `{ history: false }` (then history is cleared). */
|
|
3481
3544
|
setDocument(doc, options = {}) {
|
|
3482
3545
|
this.cancelDrag();
|
|
3483
|
-
const next =
|
|
3546
|
+
const next = loadedDocument(doc);
|
|
3484
3547
|
if (options.history === false) {
|
|
3485
3548
|
this.doc = next;
|
|
3486
3549
|
this.selection = [];
|
|
@@ -3508,7 +3571,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
3508
3571
|
/** Replaces the document with parsed SVG markup (one undo step). */
|
|
3509
3572
|
loadSvg(svg, options = {}) {
|
|
3510
3573
|
try {
|
|
3511
|
-
const doc =
|
|
3574
|
+
const doc = _chunkKANRAHTLcjs.parseVectorSvg.call(void 0, svg, { createId: () => this.createId() });
|
|
3512
3575
|
this.setDocument(doc, { history: options.history, label: "Import SVG" });
|
|
3513
3576
|
return { ok: true };
|
|
3514
3577
|
} catch (error) {
|
|
@@ -3518,7 +3581,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
3518
3581
|
/** Adds the nodes of SVG markup on top of the document, selected. */
|
|
3519
3582
|
importSvg(svg) {
|
|
3520
3583
|
try {
|
|
3521
|
-
const parsed =
|
|
3584
|
+
const parsed = _chunkKANRAHTLcjs.parseVectorSvg.call(void 0, svg);
|
|
3522
3585
|
const nodes = parsed.nodes.map((n) => this.freshIds(n));
|
|
3523
3586
|
if (!nodes.length) return { ok: false, message: "The SVG has no shapes the editor can read." };
|
|
3524
3587
|
this.change("Import SVG", () => {
|
|
@@ -3532,21 +3595,21 @@ var VectorEditorController = (_class3 = class {
|
|
|
3532
3595
|
}
|
|
3533
3596
|
}
|
|
3534
3597
|
toSvg(options) {
|
|
3535
|
-
return
|
|
3598
|
+
return _chunkKANRAHTLcjs.vectorDocumentToSvg.call(void 0, this.doc, options);
|
|
3536
3599
|
}
|
|
3537
3600
|
toJSON() {
|
|
3538
|
-
return
|
|
3601
|
+
return _chunkKANRAHTLcjs.cloneVectorDocument.call(void 0, this.doc);
|
|
3539
3602
|
}
|
|
3540
3603
|
/** Adds a node (ids are kept unless taken). Returns its id. */
|
|
3541
3604
|
addNode(node, options = {}) {
|
|
3542
3605
|
const taken = (() => {
|
|
3543
3606
|
let clash = false;
|
|
3544
|
-
|
|
3607
|
+
_chunkKANRAHTLcjs.walkVectorNodes.call(void 0, [node], (n) => {
|
|
3545
3608
|
if (this.getNode(n.id)) clash = true;
|
|
3546
3609
|
});
|
|
3547
3610
|
return clash;
|
|
3548
3611
|
})();
|
|
3549
|
-
const next = taken ? this.freshIds(node) :
|
|
3612
|
+
const next = taken ? this.freshIds(node) : _chunkKANRAHTLcjs.cloneVectorNode.call(void 0, node);
|
|
3550
3613
|
this.change(_nullishCoalesce(options.label, () => ( `Add ${next.type === "group" ? "Group" : _nullishCoalesce(next.name, () => ( "Path"))}`)), () => {
|
|
3551
3614
|
const insert = (list) => {
|
|
3552
3615
|
const copy = list.slice();
|
|
@@ -3570,31 +3633,31 @@ var VectorEditorController = (_class3 = class {
|
|
|
3570
3633
|
let subpath;
|
|
3571
3634
|
switch (input.kind) {
|
|
3572
3635
|
case "rect":
|
|
3573
|
-
subpath =
|
|
3636
|
+
subpath = _chunkKANRAHTLcjs.rectSubpath.call(void 0, b);
|
|
3574
3637
|
break;
|
|
3575
3638
|
case "ellipse":
|
|
3576
|
-
subpath =
|
|
3639
|
+
subpath = _chunkKANRAHTLcjs.ellipseSubpath.call(void 0, b);
|
|
3577
3640
|
break;
|
|
3578
3641
|
case "polygon":
|
|
3579
|
-
subpath =
|
|
3642
|
+
subpath = _chunkKANRAHTLcjs.polygonSubpath.call(void 0, b, _nullishCoalesce(input.sides, () => ( d.polygonSides)));
|
|
3580
3643
|
break;
|
|
3581
3644
|
case "star":
|
|
3582
|
-
subpath =
|
|
3645
|
+
subpath = _chunkKANRAHTLcjs.starSubpath.call(void 0, b, _nullishCoalesce(input.points, () => ( d.starPoints)), _nullishCoalesce(input.innerRatio, () => ( d.starInnerRatio)));
|
|
3583
3646
|
break;
|
|
3584
3647
|
case "line":
|
|
3585
|
-
subpath =
|
|
3648
|
+
subpath = _chunkKANRAHTLcjs.lineSubpath.call(void 0, { x: b.x, y: b.y }, { x: b.x + b.width, y: b.y + b.height });
|
|
3586
3649
|
break;
|
|
3587
3650
|
}
|
|
3588
3651
|
const radius = _nullishCoalesce(input.cornerRadius, () => ( d.cornerRadius));
|
|
3589
3652
|
const kind = _nullishCoalesce(input.cornerKind, () => ( d.cornerKind));
|
|
3590
|
-
if ((input.kind === "rect" || input.kind === "polygon" || input.kind === "star") && radius > 0) subpath =
|
|
3653
|
+
if ((input.kind === "rect" || input.kind === "polygon" || input.kind === "star") && radius > 0) subpath = _chunkKANRAHTLcjs.setSubpathCorners.call(void 0, subpath, radius, kind);
|
|
3591
3654
|
const names = { rect: "Rectangle", ellipse: "Ellipse", polygon: "Polygon", star: "Star", line: "Line" };
|
|
3592
3655
|
const style = this.styleFor(input.kind === "line");
|
|
3593
3656
|
const own = {};
|
|
3594
3657
|
for (const key of VECTOR_STYLE_KEYS) {
|
|
3595
3658
|
if (input[key] !== void 0) own[key] = input[key];
|
|
3596
3659
|
}
|
|
3597
|
-
return { id: this.newId(), type: "path", name: _nullishCoalesce(input.name, () => ( names[input.kind])), ...style,
|
|
3660
|
+
return withStyle({ id: this.newId(), type: "path", name: _nullishCoalesce(input.name, () => ( names[input.kind])), ...style, subpaths: [subpath] }, own);
|
|
3598
3661
|
}
|
|
3599
3662
|
/** Adds a shape drawn with the current defaults. Returns its id. */
|
|
3600
3663
|
addShape(input, options = {}) {
|
|
@@ -3603,8 +3666,9 @@ var VectorEditorController = (_class3 = class {
|
|
|
3603
3666
|
}
|
|
3604
3667
|
/** Adds a path from SVG path data. Returns its id. */
|
|
3605
3668
|
addPath(d, style = {}, options = {}) {
|
|
3606
|
-
const subpaths =
|
|
3607
|
-
const
|
|
3669
|
+
const subpaths = _chunkKANRAHTLcjs.bezierToSubpaths.call(void 0, d);
|
|
3670
|
+
const { name, ...own } = style;
|
|
3671
|
+
const node = withStyle({ id: this.newId(), type: "path", name: _nullishCoalesce(name, () => ( "Path")), ...this.styleFor(false), subpaths }, own);
|
|
3608
3672
|
return this.addNode(node, { label: "Add Path", ...options });
|
|
3609
3673
|
}
|
|
3610
3674
|
styleFor(open) {
|
|
@@ -3617,7 +3681,10 @@ var VectorEditorController = (_class3 = class {
|
|
|
3617
3681
|
if (d.strokeAlign && d.strokeAlign !== "center") out.strokeAlign = d.strokeAlign;
|
|
3618
3682
|
for (const key of ["startArrow", "endArrow", "arrowAlign", "startArrowScale", "endArrowScale"]) if (d[key]) out[key] = d[key];
|
|
3619
3683
|
if (_optionalChain([d, 'access', _113 => _113.strokeWidthProfile, 'optionalAccess', _114 => _114.length])) out.strokeWidthProfile = d.strokeWidthProfile.map((p) => ({ ...p }));
|
|
3620
|
-
|
|
3684
|
+
let styled = out;
|
|
3685
|
+
if (Array.isArray(d.fills)) styled = _chunkKANRAHTLcjs.withVectorFills.call(void 0, styled, open ? [] : d.fills);
|
|
3686
|
+
if (Array.isArray(d.strokes)) styled = _chunkKANRAHTLcjs.withVectorStrokes.call(void 0, styled, d.strokes);
|
|
3687
|
+
return styled;
|
|
3621
3688
|
}
|
|
3622
3689
|
/** Merges `patch` into a node (paths take style and geometry; groups name / visibility / opacity). */
|
|
3623
3690
|
updateNode(id, patch, options = {}) {
|
|
@@ -3633,7 +3700,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
3633
3700
|
for (const id of ids) {
|
|
3634
3701
|
const node = this.getNode(id);
|
|
3635
3702
|
if (!node) return { ok: false, message: `There is no node "${id}".` };
|
|
3636
|
-
for (const p of
|
|
3703
|
+
for (const p of _chunkKANRAHTLcjs.collectPathNodes.call(void 0, node)) targets.add(p.id);
|
|
3637
3704
|
}
|
|
3638
3705
|
if (!targets.size) return { ok: false, message: "Nothing is selected." };
|
|
3639
3706
|
this.change(_nullishCoalesce(options.label, () => ( "Change Style")), () => {
|
|
@@ -3650,13 +3717,13 @@ var VectorEditorController = (_class3 = class {
|
|
|
3650
3717
|
let points;
|
|
3651
3718
|
if (profile === null) points = [];
|
|
3652
3719
|
else if (typeof profile === "string") {
|
|
3653
|
-
const preset =
|
|
3720
|
+
const preset = _chunkKANRAHTLcjs.widthProfilePreset.call(void 0, profile);
|
|
3654
3721
|
if (!preset) return { ok: false, message: `There is no width profile "${profile}".` };
|
|
3655
3722
|
points = preset;
|
|
3656
|
-
} else if (Array.isArray(profile)) points =
|
|
3723
|
+
} else if (Array.isArray(profile)) points = _chunkKANRAHTLcjs.sanitizeWidthProfile.call(void 0, profile);
|
|
3657
3724
|
else {
|
|
3658
3725
|
const p = profile;
|
|
3659
|
-
points = p.taper || p.wave ?
|
|
3726
|
+
points = p.taper || p.wave ? _chunkKANRAHTLcjs.generateWidthProfile.call(void 0, p) : [];
|
|
3660
3727
|
}
|
|
3661
3728
|
this.widthPoints = [];
|
|
3662
3729
|
this.widthEdit = null;
|
|
@@ -3666,9 +3733,9 @@ var VectorEditorController = (_class3 = class {
|
|
|
3666
3733
|
// Gradients
|
|
3667
3734
|
// -------------------------------------------------------------------------
|
|
3668
3735
|
/** Which paint (fill or stroke) the gradient tool and editor work on. */
|
|
3669
|
-
setGradientTarget(target) {
|
|
3670
|
-
if (target === this.gradientEdit.target) return;
|
|
3671
|
-
this.gradientEdit = { target, stop: null };
|
|
3736
|
+
setGradientTarget(target, layer = null) {
|
|
3737
|
+
if (target === this.gradientEdit.target && layer === this.gradientEdit.layer) return;
|
|
3738
|
+
this.gradientEdit = { target, stop: null, layer };
|
|
3672
3739
|
this.notify();
|
|
3673
3740
|
}
|
|
3674
3741
|
/** Selects a stop of the gradient being edited (index into its sorted stops), or none. */
|
|
@@ -3679,7 +3746,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
3679
3746
|
}
|
|
3680
3747
|
/** The gradient tool's annotator for the selection (screen pixels), or null when its paint is not a gradient. */
|
|
3681
3748
|
getGradientAnnotator() {
|
|
3682
|
-
return getVectorGradientAnnotator(this.doc, this.selection, this.viewport, this.gradientEdit.target);
|
|
3749
|
+
return getVectorGradientAnnotator(this.doc, this.selection, this.viewport, this.gradientEdit.target, this.gradientEdit.layer);
|
|
3683
3750
|
}
|
|
3684
3751
|
/** Unlocked paths of `ids` (default: the selection). */
|
|
3685
3752
|
gradientPaths(ids = this.selection) {
|
|
@@ -3687,7 +3754,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
3687
3754
|
for (const id of ids) {
|
|
3688
3755
|
const node = this.getNode(id);
|
|
3689
3756
|
if (node && !node.locked) {
|
|
3690
|
-
for (const p of
|
|
3757
|
+
for (const p of _chunkKANRAHTLcjs.collectPathNodes.call(void 0, node)) if (!p.locked) out.set(p.id, p);
|
|
3691
3758
|
}
|
|
3692
3759
|
}
|
|
3693
3760
|
return [...out.values()];
|
|
@@ -3699,32 +3766,35 @@ var VectorEditorController = (_class3 = class {
|
|
|
3699
3766
|
*/
|
|
3700
3767
|
setGradient(patch, options = {}) {
|
|
3701
3768
|
const target = _nullishCoalesce(options.target, () => ( this.gradientEdit.target));
|
|
3769
|
+
const layer = options.layer !== void 0 ? options.layer : options.target === void 0 ? this.gradientEdit.layer : null;
|
|
3702
3770
|
const paths = this.gradientPaths(_nullishCoalesce(options.ids, () => ( this.selection)));
|
|
3703
3771
|
if (!paths.length) return { ok: false, message: "Nothing is selected." };
|
|
3704
3772
|
const next = /* @__PURE__ */ new Map();
|
|
3773
|
+
let first = null;
|
|
3705
3774
|
for (const path of paths) {
|
|
3706
|
-
const paint = path
|
|
3707
|
-
const base =
|
|
3708
|
-
const g =
|
|
3775
|
+
const paint = _chunkKANRAHTLcjs.vectorTargetPaint.call(void 0, path, target, layer);
|
|
3776
|
+
const base = _chunkKANRAHTLcjs.isVectorGradient.call(void 0, paint) ? paint : _chunkKANRAHTLcjs.defaultVectorGradient.call(void 0, _nullishCoalesce(patch.type, () => ( "linear")), paint);
|
|
3777
|
+
const g = _chunkKANRAHTLcjs.applyVectorGradientPatch.call(void 0, base, patch);
|
|
3709
3778
|
if (!g) return { ok: false, message: "That is not a valid gradient: it needs at least one stop with an offset and a colour." };
|
|
3710
|
-
|
|
3779
|
+
first ??= g;
|
|
3780
|
+
next.set(path.id, _chunkKANRAHTLcjs.withVectorTargetPaint.call(void 0, path, target, layer, g));
|
|
3711
3781
|
}
|
|
3712
3782
|
this.change(_nullishCoalesce(options.label, () => ( "Gradient")), () => this.setDoc(mapTree(this.doc.nodes, (n) => _nullishCoalesce(next.get(n.id), () => ( n)))), options.merge);
|
|
3713
|
-
const stops = _nullishCoalesce(_optionalChain([
|
|
3783
|
+
const stops = _nullishCoalesce(_optionalChain([first, 'optionalAccess', _115 => _115.stops, 'access', _116 => _116.length]), () => ( 0));
|
|
3714
3784
|
if (this.gradientEdit.stop !== null && this.gradientEdit.stop >= stops) this.gradientEdit = { ...this.gradientEdit, stop: null };
|
|
3715
3785
|
return { ok: true };
|
|
3716
3786
|
}
|
|
3717
3787
|
/** Applies `fn` to every target gradient of the selection (paths whose paint is not a gradient are skipped). */
|
|
3718
3788
|
editGradients(label, fn, merge) {
|
|
3719
|
-
const target = this.gradientEdit
|
|
3720
|
-
const paths = this.gradientPaths().filter((p) =>
|
|
3789
|
+
const { target, layer } = this.gradientEdit;
|
|
3790
|
+
const paths = this.gradientPaths().filter((p) => _chunkKANRAHTLcjs.isVectorGradient.call(void 0, _chunkKANRAHTLcjs.vectorTargetPaint.call(void 0, p, target, layer)));
|
|
3721
3791
|
if (!paths.length) return { ok: false, message: "The selection has no gradient." };
|
|
3722
3792
|
const next = /* @__PURE__ */ new Map();
|
|
3723
3793
|
for (const path of paths) {
|
|
3724
|
-
const g = path
|
|
3725
|
-
const stops = fn(
|
|
3794
|
+
const g = _chunkKANRAHTLcjs.vectorTargetPaint.call(void 0, path, target, layer);
|
|
3795
|
+
const stops = fn(_chunkKANRAHTLcjs.sortedVectorGradientStops.call(void 0, g));
|
|
3726
3796
|
if (!stops) return { ok: false, message: "A gradient keeps at least two stops." };
|
|
3727
|
-
next.set(path.id,
|
|
3797
|
+
next.set(path.id, _chunkKANRAHTLcjs.withVectorTargetPaint.call(void 0, path, target, layer, { ...g, stops }));
|
|
3728
3798
|
}
|
|
3729
3799
|
this.change(label, () => this.setDoc(mapTree(this.doc.nodes, (n) => _nullishCoalesce(next.get(n.id), () => ( n)))), merge);
|
|
3730
3800
|
return { ok: true };
|
|
@@ -3752,7 +3822,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
3752
3822
|
}
|
|
3753
3823
|
return out;
|
|
3754
3824
|
});
|
|
3755
|
-
if (patch.offset !== void 0 && Number.isFinite(patch.offset)) ({ stops: next, index: moved } =
|
|
3825
|
+
if (patch.offset !== void 0 && Number.isFinite(patch.offset)) ({ stops: next, index: moved } = _chunkKANRAHTLcjs.moveVectorGradientStop.call(void 0, next, index, patch.offset));
|
|
3756
3826
|
return next;
|
|
3757
3827
|
},
|
|
3758
3828
|
options.merge
|
|
@@ -3763,10 +3833,10 @@ var VectorEditorController = (_class3 = class {
|
|
|
3763
3833
|
/** Adds a stop at `offset` (painting what the gradient paints there) to the selection's gradients and selects it. */
|
|
3764
3834
|
addGradientStop(offset) {
|
|
3765
3835
|
let index = 0;
|
|
3766
|
-
const target = this.gradientEdit
|
|
3836
|
+
const { target, layer } = this.gradientEdit;
|
|
3767
3837
|
const result = this.editGradients("Add Gradient Stop", (stops) => {
|
|
3768
|
-
const path = this.gradientPaths().find((p) =>
|
|
3769
|
-
const r =
|
|
3838
|
+
const path = this.gradientPaths().find((p) => _chunkKANRAHTLcjs.isVectorGradient.call(void 0, _chunkKANRAHTLcjs.vectorTargetPaint.call(void 0, p, target, layer)));
|
|
3839
|
+
const r = _chunkKANRAHTLcjs.insertVectorGradientStop.call(void 0, { ..._chunkKANRAHTLcjs.vectorTargetPaint.call(void 0, path, target, layer), stops }, offset);
|
|
3770
3840
|
index = r.index;
|
|
3771
3841
|
return r.stops;
|
|
3772
3842
|
});
|
|
@@ -3775,7 +3845,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
3775
3845
|
}
|
|
3776
3846
|
/** Removes stop `index` of the selection's gradients (never below two stops). */
|
|
3777
3847
|
removeGradientStop(index) {
|
|
3778
|
-
const result = this.editGradients("Delete Gradient Stop", (stops) =>
|
|
3848
|
+
const result = this.editGradients("Delete Gradient Stop", (stops) => _chunkKANRAHTLcjs.removeVectorGradientStop.call(void 0, stops, index));
|
|
3779
3849
|
if (result.ok) this.selectGradientStop(null);
|
|
3780
3850
|
return result;
|
|
3781
3851
|
}
|
|
@@ -3785,7 +3855,8 @@ var VectorEditorController = (_class3 = class {
|
|
|
3785
3855
|
}
|
|
3786
3856
|
/** `doc` with path `id`'s `target` paint replaced. */
|
|
3787
3857
|
withGradient(doc, id, target, g) {
|
|
3788
|
-
|
|
3858
|
+
const layer = this.gradientEdit.layer;
|
|
3859
|
+
return { ...doc, nodes: mapTree(doc.nodes, (n) => n.id === id && n.type === "path" ? _chunkKANRAHTLcjs.withVectorTargetPaint.call(void 0, n, target, layer, g) : n) };
|
|
3789
3860
|
}
|
|
3790
3861
|
downGradient(screen, p, input) {
|
|
3791
3862
|
const before = this.snapshot();
|
|
@@ -3828,48 +3899,48 @@ var VectorEditorController = (_class3 = class {
|
|
|
3828
3899
|
const end = constrained(drag.startDoc, p);
|
|
3829
3900
|
let doc = base;
|
|
3830
3901
|
for (const id2 of drag.targets) {
|
|
3831
|
-
const node2 =
|
|
3902
|
+
const node2 = _chunkKANRAHTLcjs.findVectorNode.call(void 0, base.nodes, id2);
|
|
3832
3903
|
if (!node2) continue;
|
|
3833
|
-
const paint = node2
|
|
3834
|
-
const g2 =
|
|
3835
|
-
doc = this.withGradient(doc, id2, target,
|
|
3904
|
+
const paint = _chunkKANRAHTLcjs.vectorTargetPaint.call(void 0, node2, target, this.gradientEdit.layer);
|
|
3905
|
+
const g2 = _chunkKANRAHTLcjs.isVectorGradient.call(void 0, paint) ? paint : _chunkKANRAHTLcjs.defaultVectorGradient.call(void 0, "linear", paint);
|
|
3906
|
+
doc = this.withGradient(doc, id2, target, _chunkKANRAHTLcjs.setVectorGradientVector.call(void 0, g2, _chunkKANRAHTLcjs.vectorPathLocalBounds.call(void 0, node2), this.toLocal(id2, drag.startDoc, base), this.toLocal(id2, end, base)));
|
|
3836
3907
|
}
|
|
3837
3908
|
this.doc = doc;
|
|
3838
3909
|
this.notify(true);
|
|
3839
3910
|
return;
|
|
3840
3911
|
}
|
|
3841
3912
|
const id = drag.nodeId;
|
|
3842
|
-
const node =
|
|
3843
|
-
const g = node
|
|
3844
|
-
const bounds =
|
|
3913
|
+
const node = _chunkKANRAHTLcjs.findVectorNode.call(void 0, base.nodes, id);
|
|
3914
|
+
const g = _chunkKANRAHTLcjs.vectorTargetPaint.call(void 0, node, target, this.gradientEdit.layer);
|
|
3915
|
+
const bounds = _chunkKANRAHTLcjs.vectorPathLocalBounds.call(void 0, node);
|
|
3845
3916
|
const local = (q) => this.toLocal(id, q, base);
|
|
3846
3917
|
const part = drag.part;
|
|
3847
3918
|
let next = g;
|
|
3848
3919
|
if (part.kind === "handle") {
|
|
3849
3920
|
let to = p;
|
|
3850
3921
|
if (part.handle === "end" || part.handle === "radius") to = constrained(this.screenToDocument(drag.annotator.start), p);
|
|
3851
|
-
next =
|
|
3922
|
+
next = _chunkKANRAHTLcjs.moveVectorGradientHandle.call(void 0, g, bounds, part.handle, local(to), local(drag.startDoc));
|
|
3852
3923
|
} else if (part.kind === "bar") {
|
|
3853
|
-
next =
|
|
3924
|
+
next = _chunkKANRAHTLcjs.moveVectorGradientHandle.call(void 0, g, bounds, "start", local(p), local(drag.startDoc));
|
|
3854
3925
|
} else {
|
|
3855
3926
|
const a = drag.annotator;
|
|
3856
3927
|
const pos = vectorGradientBarPosition(a, screen);
|
|
3857
|
-
const stops =
|
|
3928
|
+
const stops = _chunkKANRAHTLcjs.sortedVectorGradientStops.call(void 0, g);
|
|
3858
3929
|
if (part.kind === "stop") {
|
|
3859
3930
|
const off = Math.abs(pos.across - VECTOR_GRADIENT_STOP_GAP) > VECTOR_GRADIENT_OFF_BAR;
|
|
3860
|
-
const removed = off ?
|
|
3931
|
+
const removed = off ? _chunkKANRAHTLcjs.removeVectorGradientStop.call(void 0, stops, part.index) : null;
|
|
3861
3932
|
if (removed) {
|
|
3862
3933
|
next = { ...g, stops: removed };
|
|
3863
3934
|
drag.stop = null;
|
|
3864
3935
|
} else {
|
|
3865
|
-
const r =
|
|
3936
|
+
const r = _chunkKANRAHTLcjs.moveVectorGradientStop.call(void 0, stops, part.index, Math.min(1, Math.max(0, pos.offset)));
|
|
3866
3937
|
next = { ...g, stops: r.stops };
|
|
3867
3938
|
drag.stop = r.index;
|
|
3868
3939
|
}
|
|
3869
3940
|
this.interaction = { type: "gradient", part: "stop", ...removed ? { removing: true } : {} };
|
|
3870
3941
|
this.gradientEdit = { ...this.gradientEdit, stop: drag.stop };
|
|
3871
3942
|
} else {
|
|
3872
|
-
const m =
|
|
3943
|
+
const m = _chunkKANRAHTLcjs.vectorGradientMidpointFromPosition.call(void 0, stops, part.index, pos.offset);
|
|
3873
3944
|
if (m !== null) next = { ...g, stops: stops.map((s, i) => i !== part.index ? s : Math.abs(m - 0.5) < 1e-3 ? (({ midpoint: _m, ...rest }) => rest)(s) : { ...s, midpoint: m }) };
|
|
3874
3945
|
}
|
|
3875
3946
|
}
|
|
@@ -3879,7 +3950,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
3879
3950
|
upGradient(drag) {
|
|
3880
3951
|
const part = drag.part;
|
|
3881
3952
|
if (!drag.moved) {
|
|
3882
|
-
if (_optionalChain([part, 'optionalAccess',
|
|
3953
|
+
if (_optionalChain([part, 'optionalAccess', _117 => _117.kind]) === "bar") {
|
|
3883
3954
|
this.addGradientStop(part.offset);
|
|
3884
3955
|
return;
|
|
3885
3956
|
}
|
|
@@ -3898,7 +3969,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
3898
3969
|
const byNode = /* @__PURE__ */ new Map();
|
|
3899
3970
|
for (const r of refs) {
|
|
3900
3971
|
const node = this.getNode(r.nodeId);
|
|
3901
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
3972
|
+
if (_optionalChain([node, 'optionalAccess', _118 => _118.type]) !== "path" || !_optionalChain([node, 'access', _119 => _119.strokeWidthProfile, 'optionalAccess', _120 => _120[r.index]])) continue;
|
|
3902
3973
|
byNode.set(r.nodeId, [..._nullishCoalesce(byNode.get(r.nodeId), () => ( [])), r.index]);
|
|
3903
3974
|
}
|
|
3904
3975
|
if (!byNode.size) return { ok: false, message: "There is no such width point." };
|
|
@@ -3908,7 +3979,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
3908
3979
|
this.change(count > 1 ? "Delete Width Points" : "Delete Width Point", () => {
|
|
3909
3980
|
for (const [id, indices] of byNode) {
|
|
3910
3981
|
const node = this.getNode(id);
|
|
3911
|
-
const rest =
|
|
3982
|
+
const rest = _chunkKANRAHTLcjs.removeWidthPoints.call(void 0, _chunkKANRAHTLcjs.sanitizeWidthProfile.call(void 0, node.strokeWidthProfile), indices);
|
|
3912
3983
|
this.replaceNode(id, withStyle(node, { strokeWidthProfile: rest.length ? rest : null }));
|
|
3913
3984
|
}
|
|
3914
3985
|
});
|
|
@@ -3916,12 +3987,12 @@ var VectorEditorController = (_class3 = class {
|
|
|
3916
3987
|
}
|
|
3917
3988
|
/** Selects width points (width tool); points on other paths than the first are dropped. */
|
|
3918
3989
|
selectWidthPoints(refs) {
|
|
3919
|
-
const first = _optionalChain([refs, 'access',
|
|
3990
|
+
const first = _optionalChain([refs, 'access', _121 => _121[0], 'optionalAccess', _122 => _122.nodeId]);
|
|
3920
3991
|
const next = [];
|
|
3921
3992
|
for (const r of refs) {
|
|
3922
3993
|
if (r.nodeId !== first || next.some((q) => q.index === r.index)) continue;
|
|
3923
3994
|
const n = this.getNode(r.nodeId);
|
|
3924
|
-
if (_optionalChain([n, 'optionalAccess',
|
|
3995
|
+
if (_optionalChain([n, 'optionalAccess', _123 => _123.type]) === "path" && _optionalChain([n, 'access', _124 => _124.strokeWidthProfile, 'optionalAccess', _125 => _125[r.index]])) next.push({ nodeId: r.nodeId, index: r.index, subpath: _nullishCoalesce(r.subpath, () => ( 0)) });
|
|
3925
3996
|
}
|
|
3926
3997
|
this.widthPoints = next;
|
|
3927
3998
|
this.notify();
|
|
@@ -3936,7 +4007,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
3936
4007
|
*/
|
|
3937
4008
|
setWidthPoint(target, values) {
|
|
3938
4009
|
const node = this.getNode(target.nodeId);
|
|
3939
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
4010
|
+
if (_optionalChain([node, 'optionalAccess', _126 => _126.type]) !== "path") return { ok: false, message: "There is no such path." };
|
|
3940
4011
|
const g = vectorStrokeWidthGeometry(node);
|
|
3941
4012
|
if (!g || !(g.unit > 0)) return { ok: false, message: "The path has no visible stroke." };
|
|
3942
4013
|
const num = (v) => typeof v === "number" && Number.isFinite(v) ? v : void 0;
|
|
@@ -3944,36 +4015,36 @@ var VectorEditorController = (_class3 = class {
|
|
|
3944
4015
|
const left = num(values.left);
|
|
3945
4016
|
const right = num(values.right);
|
|
3946
4017
|
const scale = (w) => w === void 0 ? void 0 : Math.max(0, w) / g.unit;
|
|
3947
|
-
const profile =
|
|
4018
|
+
const profile = _chunkKANRAHTLcjs.sanitizeWidthProfile.call(void 0, node.strokeWidthProfile);
|
|
3948
4019
|
let points;
|
|
3949
4020
|
let index;
|
|
3950
4021
|
const existing = _nullishCoalesce(target.index, () => ( null));
|
|
3951
4022
|
if (existing === null) {
|
|
3952
4023
|
if (t === void 0) return { ok: false, message: "A new width point needs a position t." };
|
|
3953
|
-
if (profile.length >=
|
|
3954
|
-
({ points, index } =
|
|
4024
|
+
if (profile.length >= _chunkKANRAHTLcjs.VECTOR_WIDTH_PROFILE_MAX_POINTS) return { ok: false, message: "The profile has too many width points." };
|
|
4025
|
+
({ points, index } = _chunkKANRAHTLcjs.insertWidthPoint.call(void 0, profile.length ? profile : null, t, { left: scale(left), right: scale(right) }, { step: true }));
|
|
3955
4026
|
} else {
|
|
3956
4027
|
const p = profile[existing];
|
|
3957
4028
|
if (!p) return { ok: false, message: "There is no such width point." };
|
|
3958
4029
|
const sides2 = { left: _nullishCoalesce(scale(left), () => ( p.left)), right: _nullishCoalesce(scale(right), () => ( p.right)) };
|
|
3959
4030
|
const tt = t === void 0 ? p.t : Math.min(Math.max(t, 0), 1);
|
|
3960
|
-
if (Math.abs(tt - p.t) <=
|
|
3961
|
-
points =
|
|
4031
|
+
if (Math.abs(tt - p.t) <= _chunkKANRAHTLcjs.VECTOR_WIDTH_SAME_T) {
|
|
4032
|
+
points = _chunkKANRAHTLcjs.setWidthPoint.call(void 0, profile, existing, sides2);
|
|
3962
4033
|
index = existing;
|
|
3963
4034
|
} else {
|
|
3964
|
-
const rest =
|
|
3965
|
-
if (rest.length) ({ points, index } =
|
|
4035
|
+
const rest = _chunkKANRAHTLcjs.removeWidthPoints.call(void 0, profile, [existing]);
|
|
4036
|
+
if (rest.length) ({ points, index } = _chunkKANRAHTLcjs.insertWidthPoint.call(void 0, rest, tt, sides2, { step: true }));
|
|
3966
4037
|
else {
|
|
3967
4038
|
points = [{ t: tt, ...sides2 }];
|
|
3968
4039
|
index = 0;
|
|
3969
4040
|
}
|
|
3970
4041
|
}
|
|
3971
4042
|
}
|
|
3972
|
-
const subpath = _optionalChain([this, 'access',
|
|
4043
|
+
const subpath = _optionalChain([this, 'access', _127 => _127.widthEdit, 'optionalAccess', _128 => _128.nodeId]) === node.id ? this.widthEdit.subpath : _nullishCoalesce(_optionalChain([this, 'access', _129 => _129.widthPoints, 'access', _130 => _130.find, 'call', _131 => _131((r) => r.nodeId === node.id), 'optionalAccess', _132 => _132.subpath]), () => ( 0));
|
|
3973
4044
|
const edit = this.widthEdit;
|
|
3974
4045
|
this.change("Width Point", () => this.replaceNode(node.id, withStyle(node, { strokeWidthProfile: points })));
|
|
3975
4046
|
this.widthPoints = [{ nodeId: node.id, index, subpath }];
|
|
3976
|
-
if (_optionalChain([edit, 'optionalAccess',
|
|
4047
|
+
if (_optionalChain([edit, 'optionalAccess', _133 => _133.nodeId]) === node.id && (edit.index === existing || existing === null)) this.widthEdit = this.widthEditFor(node.id, subpath, index, null);
|
|
3977
4048
|
this.notify();
|
|
3978
4049
|
return { ok: true };
|
|
3979
4050
|
}
|
|
@@ -4007,16 +4078,16 @@ var VectorEditorController = (_class3 = class {
|
|
|
4007
4078
|
/** The editor's view of point `index` (or of the stroke at `t` when index is null) of `nodeId`. */
|
|
4008
4079
|
widthEditFor(nodeId, subpath, index, t) {
|
|
4009
4080
|
const node = this.getNode(nodeId);
|
|
4010
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
4081
|
+
if (_optionalChain([node, 'optionalAccess', _134 => _134.type]) !== "path") return null;
|
|
4011
4082
|
const g = vectorStrokeWidthGeometry(node);
|
|
4012
4083
|
if (!g) return null;
|
|
4013
|
-
const profile =
|
|
4084
|
+
const profile = _chunkKANRAHTLcjs.sanitizeWidthProfile.call(void 0, node.strokeWidthProfile);
|
|
4014
4085
|
const p = index === null ? null : profile[index];
|
|
4015
4086
|
if (index !== null && !p) return null;
|
|
4016
4087
|
const tt = p ? p.t : Math.min(Math.max(_nullishCoalesce(t, () => ( 0)), 0), 1);
|
|
4017
|
-
const sides2 = _nullishCoalesce(p, () => (
|
|
4088
|
+
const sides2 = _nullishCoalesce(p, () => ( _chunkKANRAHTLcjs.widthProfileAt.call(void 0, profile.length ? profile : null, tt)));
|
|
4018
4089
|
const sp = Math.min(Math.max(0, subpath), Math.max(0, node.subpaths.length - 1));
|
|
4019
|
-
const at =
|
|
4090
|
+
const at = _chunkKANRAHTLcjs.strokePositionPoint.call(void 0, g.line, sp, tt);
|
|
4020
4091
|
const round = (v) => Math.round(v * 1e6) / 1e6;
|
|
4021
4092
|
const q = at ? _chunkDWGZUSEScjs.applyMatrix.call(void 0, this.worldOf(nodeId), { x: at.point[0], y: at.point[1] }) : { x: 0, y: 0 };
|
|
4022
4093
|
const point = { x: round(q.x), y: round(q.y) };
|
|
@@ -4032,7 +4103,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
4032
4103
|
const refs = this.cornerTargets(options);
|
|
4033
4104
|
if (!refs.length) return { ok: false, message: "Nothing is selected." };
|
|
4034
4105
|
this.change(radius > 0 ? "Corner Radius" : "Sharpen Corners", () => {
|
|
4035
|
-
this.doc = this.updateAnchors(this.doc, refs, (a) =>
|
|
4106
|
+
this.doc = this.updateAnchors(this.doc, refs, (a) => _chunkKANRAHTLcjs.setAnchorCorner.call(void 0, a, radius, options.kind));
|
|
4036
4107
|
});
|
|
4037
4108
|
return { ok: true };
|
|
4038
4109
|
}
|
|
@@ -4041,7 +4112,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
4041
4112
|
const refs = this.cornerTargets(options);
|
|
4042
4113
|
if (!refs.length) return { ok: false, message: "Nothing is selected." };
|
|
4043
4114
|
this.change("Corner Kind", () => {
|
|
4044
|
-
this.doc = this.updateAnchors(this.doc, refs, (a) =>
|
|
4115
|
+
this.doc = this.updateAnchors(this.doc, refs, (a) => _chunkKANRAHTLcjs.setAnchorCorner.call(void 0, a, _nullishCoalesce(_optionalChain([a, 'access', _135 => _135.corner, 'optionalAccess', _136 => _136.radius]), () => ( 0)), kind));
|
|
4045
4116
|
});
|
|
4046
4117
|
return { ok: true };
|
|
4047
4118
|
}
|
|
@@ -4053,7 +4124,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
4053
4124
|
for (const id of _nullishCoalesce(options.ids, () => ( this.selection))) {
|
|
4054
4125
|
const node = this.getNode(id);
|
|
4055
4126
|
if (!node) continue;
|
|
4056
|
-
for (const p of
|
|
4127
|
+
for (const p of _chunkKANRAHTLcjs.collectPathNodes.call(void 0, node)) {
|
|
4057
4128
|
if (p.locked) continue;
|
|
4058
4129
|
p.subpaths.forEach((sp, s) => sp.anchors.forEach((_, i) => out.push({ nodeId: p.id, subpath: s, index: i })));
|
|
4059
4130
|
}
|
|
@@ -4067,39 +4138,35 @@ var VectorEditorController = (_class3 = class {
|
|
|
4067
4138
|
*/
|
|
4068
4139
|
outlineStroke(options = {}) {
|
|
4069
4140
|
const roots = _nullishCoalesce(options.ids, () => ( this.selectedRoots()));
|
|
4141
|
+
const strokesOf = (p) => _chunkKANRAHTLcjs.vectorPaintLayerNodes.call(void 0, p).filter((l) => l.kind === "stroke" && l.drawn && (_nullishCoalesce(l.node.strokeWidth, () => ( 1))) > 0);
|
|
4070
4142
|
const paths = [];
|
|
4071
4143
|
for (const id of roots) {
|
|
4072
4144
|
const node = this.getNode(id);
|
|
4073
4145
|
if (node) {
|
|
4074
|
-
for (const p of
|
|
4146
|
+
for (const p of _chunkKANRAHTLcjs.collectPathNodes.call(void 0, node)) if (!p.locked && strokesOf(p).length) paths.push(p);
|
|
4075
4147
|
}
|
|
4076
4148
|
}
|
|
4077
4149
|
if (!paths.length) return [];
|
|
4078
4150
|
const created = [];
|
|
4079
4151
|
const replace = /* @__PURE__ */ new Map();
|
|
4080
4152
|
for (const p of paths) {
|
|
4081
|
-
const
|
|
4082
|
-
|
|
4083
|
-
const
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
} = _chunkJF5PXN7Wcjs.cloneVectorNode.call(void 0, p);
|
|
4099
|
-
const id = this.newId();
|
|
4100
|
-
const strokeNode = { ...rest, id, name: `${_nullishCoalesce(p.name, () => ( "Path"))} Stroke`, subpaths: outline, fill: _nullishCoalesce(stroke, () => ( null)), stroke: null, fillRule: "nonzero" };
|
|
4101
|
-
const list = _chunkJF5PXN7Wcjs.hasPaint.call(void 0, p.fill) ? [{ ...rest, ...effects ? { effects } : {}, stroke: null }, strokeNode] : [strokeNode];
|
|
4102
|
-
created.push(id);
|
|
4153
|
+
const { effects, ...rest } = _chunkKANRAHTLcjs.cloneVectorNode.call(void 0, p);
|
|
4154
|
+
const unstroked = _chunkKANRAHTLcjs.withVectorStrokes.call(void 0, rest, []);
|
|
4155
|
+
for (const key of _chunkKANRAHTLcjs.VECTOR_STROKE_SETTING_KEYS) delete unstroked[key];
|
|
4156
|
+
const list = _chunkKANRAHTLcjs.vectorFills.call(void 0, p).length ? [{ ...unstroked, ...effects ? { effects } : {} }] : [];
|
|
4157
|
+
const layers = strokesOf(p);
|
|
4158
|
+
for (const l of layers) {
|
|
4159
|
+
const outline = _chunkKANRAHTLcjs.bezierToSubpaths.call(void 0, _chunkKANRAHTLcjs.vectorStrokeOutlinePath.call(void 0, _chunkKANRAHTLcjs.vectorAppearanceOutline.call(void 0, p), l.node));
|
|
4160
|
+
if (!outline.length) continue;
|
|
4161
|
+
const id = this.newId();
|
|
4162
|
+
const { strokes: _s, fills: _f, ...plain2 } = unstroked;
|
|
4163
|
+
const name = layers.length > 1 ? `${_nullishCoalesce(p.name, () => ( "Path"))} Stroke ${l.index + 1}` : `${_nullishCoalesce(p.name, () => ( "Path"))} Stroke`;
|
|
4164
|
+
const fill = { paint: l.layer.paint };
|
|
4165
|
+
if (l.layer.opacity !== void 0) fill.opacity = l.layer.opacity;
|
|
4166
|
+
if (l.layer.blendMode) fill.blendMode = l.layer.blendMode;
|
|
4167
|
+
list.push(_chunkKANRAHTLcjs.withVectorFills.call(void 0, { ...plain2, id, name, subpaths: outline, stroke: null, fillRule: "nonzero" }, [fill]));
|
|
4168
|
+
created.push(id);
|
|
4169
|
+
}
|
|
4103
4170
|
replace.set(p.id, list);
|
|
4104
4171
|
}
|
|
4105
4172
|
if (!created.length) return [];
|
|
@@ -4114,6 +4181,229 @@ var VectorEditorController = (_class3 = class {
|
|
|
4114
4181
|
return created;
|
|
4115
4182
|
}
|
|
4116
4183
|
// -------------------------------------------------------------------------
|
|
4184
|
+
// Fill and stroke stacks, blend modes, filters
|
|
4185
|
+
// -------------------------------------------------------------------------
|
|
4186
|
+
/** Paths of the selected (or given) nodes whose stacks can be edited (groups give every path inside; blend steps are left out). */
|
|
4187
|
+
stackTargets(ids) {
|
|
4188
|
+
const list = _nullishCoalesce(ids, () => ( this.selection));
|
|
4189
|
+
if (!list.length) return "Nothing is selected.";
|
|
4190
|
+
const out = /* @__PURE__ */ new Map();
|
|
4191
|
+
for (const id of list) {
|
|
4192
|
+
const node = this.getNode(id);
|
|
4193
|
+
if (!node) return `There is no node "${id}".`;
|
|
4194
|
+
for (const p of _chunkKANRAHTLcjs.collectPathNodes.call(void 0, node)) if (!p.blendStep) out.set(p.id, p);
|
|
4195
|
+
}
|
|
4196
|
+
if (!out.size) return "The selection has no paths (fills and strokes belong to paths).";
|
|
4197
|
+
return [...out.values()];
|
|
4198
|
+
}
|
|
4199
|
+
/** Applies `fn` to the `kind` stack of every target path as one undo step (an error string from any path cancels it). */
|
|
4200
|
+
editStacks(kind, ids, label, fn, merge) {
|
|
4201
|
+
const targets = this.stackTargets(ids);
|
|
4202
|
+
if (typeof targets === "string") return { ok: false, message: targets };
|
|
4203
|
+
const next = /* @__PURE__ */ new Map();
|
|
4204
|
+
for (const path of targets) {
|
|
4205
|
+
const stack = kind === "fill" ? _chunkKANRAHTLcjs.vectorFills.call(void 0, path) : _chunkKANRAHTLcjs.vectorStrokes.call(void 0, path);
|
|
4206
|
+
const result = fn(stack.map((l) => ({ ...l })), path);
|
|
4207
|
+
if (typeof result === "string") return { ok: false, message: result };
|
|
4208
|
+
next.set(path.id, kind === "fill" ? _chunkKANRAHTLcjs.withVectorFills.call(void 0, path, result) : _chunkKANRAHTLcjs.withVectorStrokes.call(void 0, path, result));
|
|
4209
|
+
}
|
|
4210
|
+
this.change(label, () => this.setDoc(mapTree(this.doc.nodes, (n) => _nullishCoalesce(next.get(n.id), () => ( n)))), merge);
|
|
4211
|
+
return { ok: true };
|
|
4212
|
+
}
|
|
4213
|
+
/**
|
|
4214
|
+
* Reads a layer patch from untrusted input: paint, opacity, blend mode, visibility and (strokes)
|
|
4215
|
+
* the stroke settings, where `null` removes a setting. Returns an error string for invalid values.
|
|
4216
|
+
*/
|
|
4217
|
+
layerPatch(kind, patch) {
|
|
4218
|
+
const set = {};
|
|
4219
|
+
const unset = [];
|
|
4220
|
+
if ("paint" in patch) {
|
|
4221
|
+
const paint = patch.paint;
|
|
4222
|
+
if (paint === null || typeof paint === "string" && paint.trim()) set.paint = paint === null ? null : paint.trim();
|
|
4223
|
+
else {
|
|
4224
|
+
const g = _chunkKANRAHTLcjs.sanitizeVectorGradient.call(void 0, paint);
|
|
4225
|
+
if (!g) return "paint must be a CSS colour, a gradient { type, stops: [{ offset, color }] } or null.";
|
|
4226
|
+
set.paint = g;
|
|
4227
|
+
}
|
|
4228
|
+
}
|
|
4229
|
+
if (patch.opacity !== void 0) {
|
|
4230
|
+
if (typeof patch.opacity !== "number" || !Number.isFinite(patch.opacity)) return "opacity must be a number from 0 to 1.";
|
|
4231
|
+
const o = Math.min(1, Math.max(0, patch.opacity));
|
|
4232
|
+
if (o < 1) set.opacity = o;
|
|
4233
|
+
else unset.push("opacity");
|
|
4234
|
+
}
|
|
4235
|
+
if (patch.blendMode !== void 0) {
|
|
4236
|
+
if (!_chunkKANRAHTLcjs.isVectorBlendMode.call(void 0, patch.blendMode)) return `Unknown blend mode "${String(patch.blendMode)}". Use one of: ${_chunkKANRAHTLcjs.VECTOR_BLEND_MODES.join(", ")}.`;
|
|
4237
|
+
if (patch.blendMode !== "normal") set.blendMode = patch.blendMode;
|
|
4238
|
+
else unset.push("blendMode");
|
|
4239
|
+
}
|
|
4240
|
+
if (patch.visible !== void 0) {
|
|
4241
|
+
if (typeof patch.visible !== "boolean") return "visible must be true or false.";
|
|
4242
|
+
if (patch.visible) unset.push("visible");
|
|
4243
|
+
else set.visible = false;
|
|
4244
|
+
}
|
|
4245
|
+
if (kind === "stroke") {
|
|
4246
|
+
const settings = _chunkKANRAHTLcjs.sanitizeVectorStrokeSettings.call(void 0, patch);
|
|
4247
|
+
for (const key of _chunkKANRAHTLcjs.VECTOR_STROKE_SETTING_KEYS) {
|
|
4248
|
+
if (!(key in patch) || patch[key] === void 0) continue;
|
|
4249
|
+
if (patch[key] === null || key === "strokeDasharray" && Array.isArray(patch[key]) && !patch[key].length) unset.push(key);
|
|
4250
|
+
else if (settings[key] === void 0) return `Invalid ${key}: ${JSON.stringify(patch[key])}.`;
|
|
4251
|
+
else set[key] = settings[key];
|
|
4252
|
+
}
|
|
4253
|
+
}
|
|
4254
|
+
return { set, unset };
|
|
4255
|
+
}
|
|
4256
|
+
/**
|
|
4257
|
+
* Adds a fill or stroke layer to the selected (or given) paths (groups: every path inside), at
|
|
4258
|
+
* the top of the stack or at `index` (0 is the bottom). A new stroke takes the settings of the
|
|
4259
|
+
* stack's top stroke unless `layer` gives them. One undo step.
|
|
4260
|
+
*/
|
|
4261
|
+
addPaintLayer(kind, layer = {}, options = {}) {
|
|
4262
|
+
const patch = this.layerPatch(kind, layer);
|
|
4263
|
+
if (typeof patch === "string") return { ok: false, message: patch };
|
|
4264
|
+
return this.editStacks(kind, options.ids, kind === "fill" ? "Add Fill" : "Add Stroke", (stack, path) => {
|
|
4265
|
+
const base = kind === "fill" ? { paint: "#808080" } : _chunkKANRAHTLcjs.newVectorStrokeLayer.call(void 0, path, {});
|
|
4266
|
+
const added = { ...base, ...patch.set };
|
|
4267
|
+
for (const key of patch.unset) delete added[key];
|
|
4268
|
+
const at = options.index === void 0 ? stack.length : Math.min(stack.length, Math.max(0, Math.round(options.index)));
|
|
4269
|
+
return [...stack.slice(0, at), added, ...stack.slice(at)];
|
|
4270
|
+
});
|
|
4271
|
+
}
|
|
4272
|
+
/**
|
|
4273
|
+
* Changes layer `index` (0 is the bottom) of the fill or stroke stack of the selected (or given)
|
|
4274
|
+
* paths: paint, opacity, blend mode, visibility and, for strokes, any stroke setting (`null`
|
|
4275
|
+
* removes it). Fails, changing nothing, when a path has no layer `index`. With `merge` (true, or
|
|
4276
|
+
* a key), consecutive edits of the layer fold into one undo step (a slider drag).
|
|
4277
|
+
*/
|
|
4278
|
+
updatePaintLayer(kind, index, patch, options = {}) {
|
|
4279
|
+
const parsed = this.layerPatch(kind, patch);
|
|
4280
|
+
if (typeof parsed === "string") return { ok: false, message: parsed };
|
|
4281
|
+
const merge = options.merge === true ? `paint-layer:${kind}:${index}` : options.merge || void 0;
|
|
4282
|
+
return this.editStacks(
|
|
4283
|
+
kind,
|
|
4284
|
+
options.ids,
|
|
4285
|
+
kind === "fill" ? "Edit Fill" : "Edit Stroke",
|
|
4286
|
+
(stack, path) => {
|
|
4287
|
+
if (!stack[index]) return `Path "${path.id}" has no ${kind} ${index} (it has ${stack.length}; 0 is the bottom).`;
|
|
4288
|
+
const layer = { ...stack[index], ...parsed.set };
|
|
4289
|
+
for (const key of parsed.unset) delete layer[key];
|
|
4290
|
+
return stack.map((l, i) => i === index ? layer : l);
|
|
4291
|
+
},
|
|
4292
|
+
merge
|
|
4293
|
+
);
|
|
4294
|
+
}
|
|
4295
|
+
/** Removes layer `index` of the fill or stroke stack of the selected (or given) paths. */
|
|
4296
|
+
removePaintLayer(kind, index, options = {}) {
|
|
4297
|
+
return this.editStacks(
|
|
4298
|
+
kind,
|
|
4299
|
+
options.ids,
|
|
4300
|
+
kind === "fill" ? "Remove Fill" : "Remove Stroke",
|
|
4301
|
+
(stack, path) => stack[index] ? stack.filter((_, i) => i !== index) : `Path "${path.id}" has no ${kind} ${index} (it has ${stack.length}; 0 is the bottom).`
|
|
4302
|
+
);
|
|
4303
|
+
}
|
|
4304
|
+
/** Moves layer `from` of the fill or stroke stack to position `to` (0 is the bottom) on the selected (or given) paths. */
|
|
4305
|
+
movePaintLayer(kind, from, to, options = {}) {
|
|
4306
|
+
return this.editStacks(kind, options.ids, kind === "fill" ? "Reorder Fills" : "Reorder Strokes", (stack, path) => {
|
|
4307
|
+
if (!stack[from]) return `Path "${path.id}" has no ${kind} ${from} (it has ${stack.length}; 0 is the bottom).`;
|
|
4308
|
+
const out = stack.slice();
|
|
4309
|
+
const [layer] = out.splice(from, 1);
|
|
4310
|
+
out.splice(Math.min(out.length, Math.max(0, Math.round(to))), 0, layer);
|
|
4311
|
+
return out;
|
|
4312
|
+
});
|
|
4313
|
+
}
|
|
4314
|
+
/** Replaces the whole fill or stroke stack of the selected (or given) paths (malformed layers are dropped). */
|
|
4315
|
+
setPaintLayers(kind, layers, options = {}) {
|
|
4316
|
+
const clean = kind === "fill" ? _chunkKANRAHTLcjs.sanitizeVectorFills.call(void 0, layers) : _chunkKANRAHTLcjs.sanitizeVectorStrokes.call(void 0, layers);
|
|
4317
|
+
return this.editStacks(kind, options.ids, kind === "fill" ? "Set Fills" : "Set Strokes", () => clean);
|
|
4318
|
+
}
|
|
4319
|
+
/** Sets the blend mode of the selected (or given) nodes (paths or groups); `normal` removes it. */
|
|
4320
|
+
setBlendMode(mode, options = {}) {
|
|
4321
|
+
if (!_chunkKANRAHTLcjs.isVectorBlendMode.call(void 0, mode)) return { ok: false, message: `Unknown blend mode "${String(mode)}". Use one of: ${_chunkKANRAHTLcjs.VECTOR_BLEND_MODES.join(", ")}.` };
|
|
4322
|
+
const ids = _nullishCoalesce(options.ids, () => ( this.selectedRoots()));
|
|
4323
|
+
if (!ids.length) return { ok: false, message: "Nothing is selected." };
|
|
4324
|
+
for (const id of ids) if (!this.getNode(id)) return { ok: false, message: `There is no node "${id}".` };
|
|
4325
|
+
const set = new Set(ids);
|
|
4326
|
+
this.change(
|
|
4327
|
+
"Blend Mode",
|
|
4328
|
+
() => this.setDoc(
|
|
4329
|
+
mapTree(this.doc.nodes, (n) => {
|
|
4330
|
+
if (!set.has(n.id) || (_nullishCoalesce(n.blendMode, () => ( "normal"))) === mode) return n;
|
|
4331
|
+
const { blendMode: _b, ...rest } = n;
|
|
4332
|
+
return mode === "normal" ? rest : { ...rest, blendMode: mode };
|
|
4333
|
+
})
|
|
4334
|
+
)
|
|
4335
|
+
);
|
|
4336
|
+
return { ok: true };
|
|
4337
|
+
}
|
|
4338
|
+
/**
|
|
4339
|
+
* Adds a filter of `type` to the selected (or given) nodes, at the end of each stack (or at
|
|
4340
|
+
* `index`), with default parameters merged with `params`. One undo step; returns the new filter
|
|
4341
|
+
* ids (one per node, in order), empty for an unknown type or nothing selected.
|
|
4342
|
+
*/
|
|
4343
|
+
addFilter(type, options = {}) {
|
|
4344
|
+
if (!_chunkKANRAHTLcjs.isVectorFilterType.call(void 0, type)) return [];
|
|
4345
|
+
const targets = this.effectTargets(options.ids);
|
|
4346
|
+
if (!targets.length) return [];
|
|
4347
|
+
const created = [];
|
|
4348
|
+
const next = /* @__PURE__ */ new Map();
|
|
4349
|
+
for (const node of targets) {
|
|
4350
|
+
const list = _nullishCoalesce(node.filters, () => ( []));
|
|
4351
|
+
let k = list.length + 1;
|
|
4352
|
+
while (list.some((f) => f.id === `filter${k}`)) k++;
|
|
4353
|
+
const filter = _chunkKANRAHTLcjs.createVectorFilter.call(void 0, type, `filter${k}`, options.params);
|
|
4354
|
+
const at = options.index === void 0 ? list.length : Math.min(list.length, Math.max(0, Math.round(options.index)));
|
|
4355
|
+
next.set(node.id, { ...node, filters: [...list.slice(0, at), filter, ...list.slice(at)] });
|
|
4356
|
+
created.push(filter.id);
|
|
4357
|
+
}
|
|
4358
|
+
this.change(`Add ${_chunkKANRAHTLcjs.VECTOR_FILTER_LABELS[type]}`, () => this.setDoc(mapTree(this.doc.nodes, (n) => _nullishCoalesce(next.get(n.id), () => ( n)))));
|
|
4359
|
+
return created;
|
|
4360
|
+
}
|
|
4361
|
+
editFilters(nodeId, label, fn, merge) {
|
|
4362
|
+
const node = this.getNode(nodeId);
|
|
4363
|
+
if (!node) return { ok: false, message: `There is no node "${nodeId}".` };
|
|
4364
|
+
const result = fn(_nullishCoalesce(node.filters, () => ( [])));
|
|
4365
|
+
if (typeof result === "string") return { ok: false, message: result };
|
|
4366
|
+
this.change(label, () => this.replaceNode(nodeId, result.length ? { ...node, filters: result } : (({ filters: _f, ...rest }) => rest)(node)), merge);
|
|
4367
|
+
return { ok: true };
|
|
4368
|
+
}
|
|
4369
|
+
/**
|
|
4370
|
+
* Turns a filter on or off and changes its parameters (invalid values are ignored). With
|
|
4371
|
+
* `merge`, consecutive updates of the same filter fold into one undo step.
|
|
4372
|
+
*/
|
|
4373
|
+
updateFilter(nodeId, filterId, patch, options = {}) {
|
|
4374
|
+
const merge = options.merge === true ? `filter:${nodeId}:${filterId}` : options.merge || void 0;
|
|
4375
|
+
const current = _optionalChain([this, 'access', _137 => _137.getNode, 'call', _138 => _138(nodeId), 'optionalAccess', _139 => _139.filters, 'optionalAccess', _140 => _140.find, 'call', _141 => _141((f) => f.id === filterId)]);
|
|
4376
|
+
return this.editFilters(
|
|
4377
|
+
nodeId,
|
|
4378
|
+
`Edit ${current ? _chunkKANRAHTLcjs.VECTOR_FILTER_LABELS[current.type] : "Filter"}`,
|
|
4379
|
+
(list) => {
|
|
4380
|
+
const i = list.findIndex((f2) => f2.id === filterId);
|
|
4381
|
+
if (i < 0) return `Node "${nodeId}" has no filter "${filterId}".`;
|
|
4382
|
+
const f = list[i];
|
|
4383
|
+
const params = patch.params ? _chunkKANRAHTLcjs.normalizeVectorFilterParams.call(void 0, f.type, patch.params, f.params) : f.params;
|
|
4384
|
+
const next = { ...f, params, ...patch.enabled !== void 0 ? { enabled: patch.enabled } : {} };
|
|
4385
|
+
if (next.enabled !== false) delete next.enabled;
|
|
4386
|
+
return list.map((x, j) => j === i ? next : x);
|
|
4387
|
+
},
|
|
4388
|
+
merge
|
|
4389
|
+
);
|
|
4390
|
+
}
|
|
4391
|
+
/** Removes a filter from a node's stack. */
|
|
4392
|
+
removeFilter(nodeId, filterId) {
|
|
4393
|
+
return this.editFilters(nodeId, "Remove Filter", (list) => list.some((f) => f.id === filterId) ? list.filter((f) => f.id !== filterId) : `Node "${nodeId}" has no filter "${filterId}".`);
|
|
4394
|
+
}
|
|
4395
|
+
/** Moves a filter to position `index` of its node's stack. */
|
|
4396
|
+
moveFilter(nodeId, filterId, index) {
|
|
4397
|
+
return this.editFilters(nodeId, "Reorder Filters", (list) => {
|
|
4398
|
+
const i = list.findIndex((f2) => f2.id === filterId);
|
|
4399
|
+
if (i < 0) return `Node "${nodeId}" has no filter "${filterId}".`;
|
|
4400
|
+
const out = list.slice();
|
|
4401
|
+
const [f] = out.splice(i, 1);
|
|
4402
|
+
out.splice(Math.min(out.length, Math.max(0, Math.round(index))), 0, f);
|
|
4403
|
+
return out;
|
|
4404
|
+
});
|
|
4405
|
+
}
|
|
4406
|
+
// -------------------------------------------------------------------------
|
|
4117
4407
|
// Path effects
|
|
4118
4408
|
// -------------------------------------------------------------------------
|
|
4119
4409
|
/** Selected (or given) nodes that can carry effects: the roots of the selection. */
|
|
@@ -4127,7 +4417,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
4127
4417
|
*/
|
|
4128
4418
|
addEffect(type, options = {}) {
|
|
4129
4419
|
const targets = this.effectTargets(options.ids);
|
|
4130
|
-
if (!targets.length || !
|
|
4420
|
+
if (!targets.length || !_chunkKANRAHTLcjs.createVectorEffect.call(void 0, type, "")) return [];
|
|
4131
4421
|
const created = [];
|
|
4132
4422
|
const next = /* @__PURE__ */ new Map();
|
|
4133
4423
|
for (const node of targets) {
|
|
@@ -4136,15 +4426,15 @@ var VectorEditorController = (_class3 = class {
|
|
|
4136
4426
|
while (list.some((e) => e.id === `fx${k}`)) k++;
|
|
4137
4427
|
const params = { ..._nullishCoalesce(options.params, () => ( {})) };
|
|
4138
4428
|
if (type === "repeater" && params.position === void 0) {
|
|
4139
|
-
const b = _chunkXGD3FSNCcjs.bezierPathBounds.call(void 0,
|
|
4429
|
+
const b = _chunkXGD3FSNCcjs.bezierPathBounds.call(void 0, _chunkKANRAHTLcjs.vectorAppearanceOutline.call(void 0, node));
|
|
4140
4430
|
if (b && b.maxX - b.minX > 0) params.position = { x: Math.round((b.maxX - b.minX) * 1.25 * 100) / 100, y: 0 };
|
|
4141
4431
|
}
|
|
4142
|
-
const effect =
|
|
4432
|
+
const effect = _chunkKANRAHTLcjs.createVectorEffect.call(void 0, type, `fx${k}`, params);
|
|
4143
4433
|
const at = options.index === void 0 ? list.length : Math.min(list.length, Math.max(0, Math.round(options.index)));
|
|
4144
4434
|
next.set(node.id, { ...node, effects: [...list.slice(0, at), effect, ...list.slice(at)] });
|
|
4145
4435
|
created.push(effect.id);
|
|
4146
4436
|
}
|
|
4147
|
-
this.change(`Add ${
|
|
4437
|
+
this.change(`Add ${_chunkKANRAHTLcjs.VECTOR_EFFECT_LABELS[type]}`, () => this.setDoc(mapTree(this.doc.nodes, (n) => _nullishCoalesce(next.get(n.id), () => ( n)))));
|
|
4148
4438
|
return created;
|
|
4149
4439
|
}
|
|
4150
4440
|
editEffects(nodeId, label, fn, merge) {
|
|
@@ -4163,8 +4453,8 @@ var VectorEditorController = (_class3 = class {
|
|
|
4163
4453
|
updateEffect(nodeId, effectId, patch, options = {}) {
|
|
4164
4454
|
const merge = options.merge === true ? `effect:${nodeId}:${effectId}` : options.merge || void 0;
|
|
4165
4455
|
const node = this.getNode(nodeId);
|
|
4166
|
-
const current = _optionalChain([node, 'optionalAccess',
|
|
4167
|
-
const label = current ? _nullishCoalesce(
|
|
4456
|
+
const current = _optionalChain([node, 'optionalAccess', _142 => _142.effects, 'optionalAccess', _143 => _143.find, 'call', _144 => _144((e) => e.id === effectId)]);
|
|
4457
|
+
const label = current ? _nullishCoalesce(_chunkKANRAHTLcjs.VECTOR_EFFECT_LABELS[current.type], () => ( "Effect")) : "Effect";
|
|
4168
4458
|
return this.editEffects(
|
|
4169
4459
|
nodeId,
|
|
4170
4460
|
`Edit ${label}`,
|
|
@@ -4173,7 +4463,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
4173
4463
|
if (i < 0) return `Node "${nodeId}" has no effect "${effectId}".`;
|
|
4174
4464
|
const e = list[i];
|
|
4175
4465
|
const raw = patch.params && e.type === "envelope" && node ? this.envelopeParams(node, e, patch.params) : patch.params;
|
|
4176
|
-
const params = raw ?
|
|
4466
|
+
const params = raw ? _chunkKANRAHTLcjs.normalizeVectorEffectParams.call(void 0, e.type, raw, e.params) : e.params;
|
|
4177
4467
|
const next = { ...e, params, ...patch.enabled !== void 0 ? { enabled: patch.enabled } : {} };
|
|
4178
4468
|
if (next.enabled !== false) delete next.enabled;
|
|
4179
4469
|
return list.map((x, j) => j === i ? next : x);
|
|
@@ -4204,16 +4494,16 @@ var VectorEditorController = (_class3 = class {
|
|
|
4204
4494
|
* nodes (empty when none was live).
|
|
4205
4495
|
*/
|
|
4206
4496
|
expandAppearance(options = {}) {
|
|
4207
|
-
const roots = (_nullishCoalesce(options.ids, () => ( this.selectedRoots()))).map((id) => this.getNode(id)).filter((n) => !!n &&
|
|
4497
|
+
const roots = (_nullishCoalesce(options.ids, () => ( this.selectedRoots()))).map((id) => this.getNode(id)).filter((n) => !!n && _chunkKANRAHTLcjs.hasVectorAppearance.call(void 0, n));
|
|
4208
4498
|
if (!roots.length) return [];
|
|
4209
4499
|
const fresh = (n) => {
|
|
4210
4500
|
const id = n.id.includes("~fx") ? this.newId() : n.id;
|
|
4211
4501
|
return n.type === "group" ? { ...n, id, children: n.children.map(fresh) } : { ...n, id };
|
|
4212
4502
|
};
|
|
4213
4503
|
const bake = (n) => {
|
|
4214
|
-
if (!
|
|
4215
|
-
if (!
|
|
4216
|
-
let e =
|
|
4504
|
+
if (!_chunkKANRAHTLcjs.hasVectorAppearance.call(void 0, n)) return n;
|
|
4505
|
+
if (!_chunkKANRAHTLcjs.hasOwnVectorAppearance.call(void 0, n)) return { ...n, children: n.children.map(bake) };
|
|
4506
|
+
let e = _chunkKANRAHTLcjs.expandVectorAppearance.call(void 0, n);
|
|
4217
4507
|
if (e.type === "group" && e.children.length === 1 && e.children[0].type === "path") {
|
|
4218
4508
|
const { id: _id, opacity, name, ...child } = e.children[0];
|
|
4219
4509
|
const k = (_nullishCoalesce(e.opacity, () => ( 1))) * (_nullishCoalesce(opacity, () => ( 1)));
|
|
@@ -4296,11 +4586,11 @@ var VectorEditorController = (_class3 = class {
|
|
|
4296
4586
|
selectedRoots() {
|
|
4297
4587
|
return this.selection.filter((id) => {
|
|
4298
4588
|
let covered = false;
|
|
4299
|
-
const loc =
|
|
4300
|
-
let parent = _nullishCoalesce(_optionalChain([loc, 'optionalAccess',
|
|
4589
|
+
const loc = _chunkKANRAHTLcjs.locateVectorNode.call(void 0, this.doc.nodes, id);
|
|
4590
|
+
let parent = _nullishCoalesce(_optionalChain([loc, 'optionalAccess', _145 => _145.parent]), () => ( null));
|
|
4301
4591
|
while (parent) {
|
|
4302
4592
|
if (this.selection.includes(parent.id)) covered = true;
|
|
4303
|
-
parent = _nullishCoalesce(_optionalChain([
|
|
4593
|
+
parent = _nullishCoalesce(_optionalChain([_chunkKANRAHTLcjs.locateVectorNode.call(void 0, this.doc.nodes, parent.id), 'optionalAccess', _146 => _146.parent]), () => ( null));
|
|
4304
4594
|
}
|
|
4305
4595
|
return !covered;
|
|
4306
4596
|
});
|
|
@@ -4326,7 +4616,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
4326
4616
|
let next = n;
|
|
4327
4617
|
if (ids.has(n.id) && !n.locked) next = distortVectorNode(n, parent, f, tolerance);
|
|
4328
4618
|
else if (n.type === "group") {
|
|
4329
|
-
const children = visit(n.children, _chunkDWGZUSEScjs.multiplyMatrices.call(void 0,
|
|
4619
|
+
const children = visit(n.children, _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, _chunkKANRAHTLcjs.nodeMatrix.call(void 0, n), parent));
|
|
4330
4620
|
if (children !== n.children) next = { ...n, children };
|
|
4331
4621
|
}
|
|
4332
4622
|
if (next !== n) changed = true;
|
|
@@ -4418,7 +4708,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
4418
4708
|
/** Envelope parameters for `node` after `patch`: a preset switched to a mesh becomes the mesh it stood for. */
|
|
4419
4709
|
envelopeParams(node, current, patch) {
|
|
4420
4710
|
if (patch.style !== "mesh" || patch.mesh !== void 0 || !current || current.params.style === "mesh") return patch;
|
|
4421
|
-
const frame =
|
|
4711
|
+
const frame = _chunkKANRAHTLcjs.vectorEnvelopeFrame.call(void 0, node, current.id);
|
|
4422
4712
|
if (!frame) return patch;
|
|
4423
4713
|
const rows = typeof patch.rows === "number" ? patch.rows : current.params.rows;
|
|
4424
4714
|
const columns = typeof patch.columns === "number" ? patch.columns : current.params.columns;
|
|
@@ -4442,19 +4732,19 @@ var VectorEditorController = (_class3 = class {
|
|
|
4442
4732
|
const list = _nullishCoalesce(node.effects, () => ( []));
|
|
4443
4733
|
const current = _nullishCoalesce(list.find((e) => e.type === "envelope"), () => ( null));
|
|
4444
4734
|
if (current) {
|
|
4445
|
-
const p =
|
|
4735
|
+
const p = _chunkKANRAHTLcjs.normalizeVectorEffectParams.call(void 0, "envelope", this.envelopeParams(node, current, raw), current.params);
|
|
4446
4736
|
const { enabled: _e, ...rest } = current;
|
|
4447
4737
|
next.set(node.id, { ...node, effects: list.map((e) => e === current ? { ...rest, params: p } : e) });
|
|
4448
4738
|
out.push({ nodeId: node.id, effectId: current.id });
|
|
4449
4739
|
} else {
|
|
4450
4740
|
let k = list.length + 1;
|
|
4451
4741
|
while (list.some((e) => e.id === `fx${k}`)) k++;
|
|
4452
|
-
const effect =
|
|
4742
|
+
const effect = _chunkKANRAHTLcjs.createVectorEffect.call(void 0, "envelope", `fx${k}`, raw);
|
|
4453
4743
|
next.set(node.id, { ...node, effects: [...list, effect] });
|
|
4454
4744
|
out.push({ nodeId: node.id, effectId: effect.id });
|
|
4455
4745
|
}
|
|
4456
4746
|
}
|
|
4457
|
-
const made = out.some((o) => !_optionalChain([targets, 'access',
|
|
4747
|
+
const made = out.some((o) => !_optionalChain([targets, 'access', _147 => _147.find, 'call', _148 => _148((n) => n.id === o.nodeId), 'optionalAccess', _149 => _149.effects, 'optionalAccess', _150 => _150.some, 'call', _151 => _151((e) => e.id === o.effectId)]));
|
|
4458
4748
|
const merge = options.merge ? `envelope:${out.map((o) => o.nodeId).join(",")}` : void 0;
|
|
4459
4749
|
this.change(made ? params.style === "mesh" ? "Make Envelope with Mesh" : "Make Envelope with Warp" : "Edit Envelope", () => this.setDoc(mapTree(this.doc.nodes, (n) => _nullishCoalesce(next.get(n.id), () => ( n)))), merge);
|
|
4460
4750
|
return out;
|
|
@@ -4469,19 +4759,19 @@ var VectorEditorController = (_class3 = class {
|
|
|
4469
4759
|
const ids = _nullishCoalesce(options.ids, () => ( this.selectedRoots()));
|
|
4470
4760
|
if (ids.length < 2) return { ok: false, message: "Select the objects and, on top of them, the shape to use as the envelope." };
|
|
4471
4761
|
const order = /* @__PURE__ */ new Map();
|
|
4472
|
-
|
|
4762
|
+
_chunkKANRAHTLcjs.walkVectorNodes.call(void 0, this.doc.nodes, (n) => order.set(n.id, order.size));
|
|
4473
4763
|
const sorted = ids.filter((id) => order.has(id)).sort((a, b) => order.get(a) - order.get(b));
|
|
4474
4764
|
const topId = sorted[sorted.length - 1];
|
|
4475
4765
|
const top = this.getNode(topId);
|
|
4476
|
-
const outline = _optionalChain([top, 'optionalAccess',
|
|
4766
|
+
const outline = _optionalChain([top, 'optionalAccess', _152 => _152.type]) === "path" ? top.subpaths.find((sp) => sp.closed && sp.anchors.length > 1) : void 0;
|
|
4477
4767
|
if (!top || !outline) return { ok: false, message: "The top object must be a path with a closed outline." };
|
|
4478
4768
|
const contents = sorted.slice(0, -1).map((id) => this.getNode(id));
|
|
4479
4769
|
if (contents.some((n) => n.locked)) return { ok: false, message: "Locked objects cannot be enveloped." };
|
|
4480
|
-
const parents = contents.map((n) => _nullishCoalesce(_optionalChain([
|
|
4770
|
+
const parents = contents.map((n) => _nullishCoalesce(_optionalChain([_chunkKANRAHTLcjs.locateVectorNode.call(void 0, this.doc.nodes, n.id), 'optionalAccess', _153 => _153.parent, 'optionalAccess', _154 => _154.id]), () => ( null)));
|
|
4481
4771
|
if (parents.some((p) => p !== parents[0])) return { ok: false, message: "The objects to envelope must be in the same group." };
|
|
4482
4772
|
const target = contents.length === 1 ? contents[0] : { id: this.newId(), type: "group", name: "Envelope", children: contents.map((n) => n) };
|
|
4483
4773
|
const parentToDoc = parents[0] ? this.worldOf(parents[0]) : _chunkDWGZUSEScjs.IDENTITY_MATRIX;
|
|
4484
|
-
const targetToDoc = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0,
|
|
4774
|
+
const targetToDoc = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, _chunkKANRAHTLcjs.nodeMatrix.call(void 0, target), parentToDoc);
|
|
4485
4775
|
const toLocal = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, this.worldOf(topId), _chunkDWGZUSEScjs.invertMatrix.call(void 0, targetToDoc));
|
|
4486
4776
|
const local = {
|
|
4487
4777
|
closed: true,
|
|
@@ -4491,12 +4781,12 @@ var VectorEditorController = (_class3 = class {
|
|
|
4491
4781
|
...a.out ? { out: _chunkDWGZUSEScjs.applyMatrix.call(void 0, toLocal, a.out) } : {}
|
|
4492
4782
|
}))
|
|
4493
4783
|
};
|
|
4494
|
-
const mesh =
|
|
4784
|
+
const mesh = _chunkKANRAHTLcjs.vectorMeshFromOutline.call(void 0, local, _nullishCoalesce(options.columns, () => ( 4)), _nullishCoalesce(options.rows, () => ( 4)));
|
|
4495
4785
|
if (!mesh) return { ok: false, message: "The top object\u2019s outline is too small to use as an envelope." };
|
|
4496
4786
|
const list = _nullishCoalesce(target.effects, () => ( []));
|
|
4497
4787
|
let k = list.length + 1;
|
|
4498
4788
|
while (list.some((e) => e.id === `fx${k}`)) k++;
|
|
4499
|
-
const effect =
|
|
4789
|
+
const effect = _chunkKANRAHTLcjs.createVectorEffect.call(void 0, "envelope", `fx${k}`, { style: "mesh", mesh });
|
|
4500
4790
|
const enveloped = { ...target, effects: [...list, effect] };
|
|
4501
4791
|
this.change("Make Envelope with Top Object", () => {
|
|
4502
4792
|
let nodes = spliceTree(this.doc.nodes, topId, []);
|
|
@@ -4518,13 +4808,13 @@ var VectorEditorController = (_class3 = class {
|
|
|
4518
4808
|
* comes back as a path above each of them. One undo step; returns the new paths' ids.
|
|
4519
4809
|
*/
|
|
4520
4810
|
releaseEnvelope(options = {}) {
|
|
4521
|
-
const targets = this.envelopeTargets(options.ids).filter((n) => _optionalChain([n, 'access',
|
|
4811
|
+
const targets = this.envelopeTargets(options.ids).filter((n) => _optionalChain([n, 'access', _155 => _155.effects, 'optionalAccess', _156 => _156.some, 'call', _157 => _157((e) => e.type === "envelope")]));
|
|
4522
4812
|
if (!targets.length) return [];
|
|
4523
4813
|
const created = [];
|
|
4524
4814
|
const replace = /* @__PURE__ */ new Map();
|
|
4525
4815
|
for (const node of targets) {
|
|
4526
4816
|
const effect = node.effects.find((e) => e.type === "envelope");
|
|
4527
|
-
const frame =
|
|
4817
|
+
const frame = _chunkKANRAHTLcjs.vectorEnvelopeFrame.call(void 0, node, effect.id);
|
|
4528
4818
|
const rest = node.effects.filter((e) => e !== effect);
|
|
4529
4819
|
const { effects: _e, ...plain2 } = node;
|
|
4530
4820
|
const kept = rest.length ? { ...plain2, effects: rest } : plain2;
|
|
@@ -4539,7 +4829,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
4539
4829
|
type: "path",
|
|
4540
4830
|
name: "Envelope",
|
|
4541
4831
|
...node.transform ? { transform: node.transform } : {},
|
|
4542
|
-
subpaths: [
|
|
4832
|
+
subpaths: [_chunkKANRAHTLcjs.vectorMeshOutline.call(void 0, frame.mesh)],
|
|
4543
4833
|
fill: null,
|
|
4544
4834
|
stroke: "#808080",
|
|
4545
4835
|
strokeWidth: 1
|
|
@@ -4603,7 +4893,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
4603
4893
|
this.notify();
|
|
4604
4894
|
return;
|
|
4605
4895
|
}
|
|
4606
|
-
const node =
|
|
4896
|
+
const node = _chunkKANRAHTLcjs.hitTestVectorNodes.call(void 0, this.doc.nodes, p, this.tolerance(), { entered: this.enteredGroups() });
|
|
4607
4897
|
if (node) this.selection = input.shift ? this.selection.includes(node.id) ? this.selection.filter((id) => id !== node.id) : [...this.selection, node.id] : [node.id];
|
|
4608
4898
|
else if (!input.shift) this.selection = [];
|
|
4609
4899
|
this.anchors = [];
|
|
@@ -4642,9 +4932,9 @@ var VectorEditorController = (_class3 = class {
|
|
|
4642
4932
|
let next = n;
|
|
4643
4933
|
if (ids.has(n.id) && !n.locked) {
|
|
4644
4934
|
const local = isRoot(parent) ? m : _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, parent, m), _chunkDWGZUSEScjs.invertMatrix.call(void 0, parent));
|
|
4645
|
-
next =
|
|
4935
|
+
next = _chunkKANRAHTLcjs.transformVectorNode.call(void 0, n, local);
|
|
4646
4936
|
} else if (n.type === "group") {
|
|
4647
|
-
const children = visit(n.children, _chunkDWGZUSEScjs.multiplyMatrices.call(void 0,
|
|
4937
|
+
const children = visit(n.children, _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, _chunkKANRAHTLcjs.nodeMatrix.call(void 0, n), parent));
|
|
4648
4938
|
if (children !== n.children) next = { ...n, children };
|
|
4649
4939
|
}
|
|
4650
4940
|
if (next !== n) changed = true;
|
|
@@ -4780,7 +5070,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
4780
5070
|
const n = node.type === "group" ? { ...node, children: insert(node.children) } : node;
|
|
4781
5071
|
out.push(n);
|
|
4782
5072
|
if (set.has(node.id)) {
|
|
4783
|
-
const copy =
|
|
5073
|
+
const copy = _chunkKANRAHTLcjs.transformVectorNode.call(void 0, this.freshIds(node), m);
|
|
4784
5074
|
created.push(copy.id);
|
|
4785
5075
|
out.push(copy);
|
|
4786
5076
|
}
|
|
@@ -4793,10 +5083,10 @@ var VectorEditorController = (_class3 = class {
|
|
|
4793
5083
|
group(options = {}) {
|
|
4794
5084
|
const ids = _nullishCoalesce(options.ids, () => ( this.selectedRoots()));
|
|
4795
5085
|
if (!ids.length) return null;
|
|
4796
|
-
const locs = ids.map((id2) =>
|
|
5086
|
+
const locs = ids.map((id2) => _chunkKANRAHTLcjs.locateVectorNode.call(void 0, this.doc.nodes, id2));
|
|
4797
5087
|
if (locs.some((l) => !l)) return null;
|
|
4798
|
-
const parent = _nullishCoalesce(_optionalChain([locs, 'access',
|
|
4799
|
-
if (locs.some((l) => (_nullishCoalesce(_optionalChain([l, 'access',
|
|
5088
|
+
const parent = _nullishCoalesce(_optionalChain([locs, 'access', _158 => _158[0], 'access', _159 => _159.parent, 'optionalAccess', _160 => _160.id]), () => ( null));
|
|
5089
|
+
if (locs.some((l) => (_nullishCoalesce(_optionalChain([l, 'access', _161 => _161.parent, 'optionalAccess', _162 => _162.id]), () => ( null))) !== parent)) return null;
|
|
4800
5090
|
const id = this.newId();
|
|
4801
5091
|
this.change("Group", () => {
|
|
4802
5092
|
const set = new Set(ids);
|
|
@@ -4819,7 +5109,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
4819
5109
|
}
|
|
4820
5110
|
/** Replaces selected groups with their children. */
|
|
4821
5111
|
ungroup(options = {}) {
|
|
4822
|
-
const groups = (_nullishCoalesce(options.ids, () => ( this.selection))).map((id) => this.getNode(id)).filter((n) => _optionalChain([n, 'optionalAccess',
|
|
5112
|
+
const groups = (_nullishCoalesce(options.ids, () => ( this.selection))).map((id) => this.getNode(id)).filter((n) => _optionalChain([n, 'optionalAccess', _163 => _163.type]) === "group");
|
|
4823
5113
|
if (!groups.length) return { ok: false, message: "Select a group to ungroup." };
|
|
4824
5114
|
const set = new Set(groups.map((g) => g.id));
|
|
4825
5115
|
this.change("Ungroup", () => {
|
|
@@ -4830,9 +5120,9 @@ var VectorEditorController = (_class3 = class {
|
|
|
4830
5120
|
if (set.has(n.id) && n.type === "group") {
|
|
4831
5121
|
changed = true;
|
|
4832
5122
|
const opacity = n.opacity;
|
|
4833
|
-
const m =
|
|
5123
|
+
const m = _chunkKANRAHTLcjs.nodeMatrix.call(void 0, n);
|
|
4834
5124
|
out.push(
|
|
4835
|
-
...n.children.map((c) => c.blendStep ? (({ blendStep: _s, locked: _l, ...rest }) => rest)(c) : c).map((c) => c.booleanOperation ? (({ booleanOperation: _b, ...rest }) => rest)(c) : c).map((c) => n.transform ?
|
|
5125
|
+
...n.children.map((c) => c.blendStep ? (({ blendStep: _s, locked: _l, ...rest }) => rest)(c) : c).map((c) => c.booleanOperation ? (({ booleanOperation: _b, ...rest }) => rest)(c) : c).map((c) => n.transform ? _chunkKANRAHTLcjs.transformVectorNode.call(void 0, c, m) : c).map((c) => opacity !== void 0 && opacity < 1 ? { ...c, opacity: (_nullishCoalesce(c.opacity, () => ( 1))) * opacity } : c)
|
|
4836
5126
|
);
|
|
4837
5127
|
} else if (n.type === "group") {
|
|
4838
5128
|
const children = flatten(n.children);
|
|
@@ -4884,16 +5174,16 @@ var VectorEditorController = (_class3 = class {
|
|
|
4884
5174
|
const result = _chunkXGD3FSNCcjs.pathBoolean.call(void 0,
|
|
4885
5175
|
BOOLEAN_OPS[op],
|
|
4886
5176
|
entries.map((e) => ({
|
|
4887
|
-
path:
|
|
5177
|
+
path: _chunkKANRAHTLcjs.vectorPathWorldBezier.call(void 0, { ...e.node, subpaths: e.node.subpaths.filter((s) => s.anchors.length > 1).map((s) => ({ ...s, closed: true })) }, e.parent),
|
|
4888
5178
|
fillRule: _nullishCoalesce(e.node.fillRule, () => ( "nonzero"))
|
|
4889
5179
|
}))
|
|
4890
5180
|
);
|
|
4891
5181
|
const base = entries[0].node;
|
|
4892
5182
|
const anchorRoot = _nullishCoalesce(roots.find((r) => this.holds(r, base.id)), () => ( base.id));
|
|
4893
|
-
const subpaths =
|
|
5183
|
+
const subpaths = _chunkKANRAHTLcjs.bezierToSubpaths.call(void 0, this.intoParentSpace(anchorRoot, result.path));
|
|
4894
5184
|
if (result.error || !subpaths.length) return null;
|
|
4895
5185
|
const id = this.newId();
|
|
4896
|
-
const { transform: _t, effects: _e, booleanOperation: _b, ...baseRest } =
|
|
5186
|
+
const { transform: _t, effects: _e, booleanOperation: _b, ...baseRest } = _chunkKANRAHTLcjs.cloneVectorNode.call(void 0, base);
|
|
4897
5187
|
const node = { ...baseRest, id, name: BOOLEAN_LABELS[op], subpaths };
|
|
4898
5188
|
const drop = /* @__PURE__ */ new Set([...entries.map((e) => e.node.id), ...roots]);
|
|
4899
5189
|
this.change(BOOLEAN_LABELS[op], () => {
|
|
@@ -4907,20 +5197,20 @@ var VectorEditorController = (_class3 = class {
|
|
|
4907
5197
|
/** Whether stored node `rootId` holds `id` as drawn (`id` may be an expanded path inside it). */
|
|
4908
5198
|
holds(rootId, id) {
|
|
4909
5199
|
const n = this.getNode(rootId);
|
|
4910
|
-
return !!n && (!!
|
|
5200
|
+
return !!n && (!!_chunkKANRAHTLcjs.findVectorNode.call(void 0, [n], id) || !!_chunkKANRAHTLcjs.findVectorNode.call(void 0, [_chunkKANRAHTLcjs.expandVectorAppearance.call(void 0, n)], id));
|
|
4911
5201
|
}
|
|
4912
5202
|
liveBooleanOp(op, roots) {
|
|
4913
5203
|
const nodes = roots.map((id2) => this.getNode(id2));
|
|
4914
5204
|
if (!nodes.length || nodes.some((n) => !n)) return null;
|
|
4915
5205
|
const label = `Live ${BOOLEAN_LABELS[op]}`;
|
|
4916
5206
|
const lone = nodes.length === 1 ? nodes[0] : null;
|
|
4917
|
-
if (
|
|
5207
|
+
if (_chunkKANRAHTLcjs.isVectorLiveBoolean.call(void 0, lone)) {
|
|
4918
5208
|
const children = lone.children.map((c) => c.booleanOperation ? (({ booleanOperation: _b, ...rest }) => rest)(c) : c);
|
|
4919
5209
|
this.change(label, () => this.replaceNode(lone.id, { ...lone, liveBoolean: op, children }));
|
|
4920
5210
|
return lone.id;
|
|
4921
5211
|
}
|
|
4922
|
-
const parents = roots.map((id2) => _nullishCoalesce(_optionalChain([
|
|
4923
|
-
if (parents.every((g) =>
|
|
5212
|
+
const parents = roots.map((id2) => _nullishCoalesce(_optionalChain([_chunkKANRAHTLcjs.locateVectorNode.call(void 0, this.doc.nodes, id2), 'optionalAccess', _164 => _164.parent]), () => ( null)));
|
|
5213
|
+
if (parents.every((g) => _chunkKANRAHTLcjs.isVectorLiveBoolean.call(void 0, g))) {
|
|
4924
5214
|
const set = new Set(roots);
|
|
4925
5215
|
this.change(
|
|
4926
5216
|
label,
|
|
@@ -4940,8 +5230,8 @@ var VectorEditorController = (_class3 = class {
|
|
|
4940
5230
|
return parents[0].id;
|
|
4941
5231
|
}
|
|
4942
5232
|
if (nodes.length < 2) return null;
|
|
4943
|
-
const parent = _nullishCoalesce(_optionalChain([parents, 'access',
|
|
4944
|
-
if (parents.some((g) => (_nullishCoalesce(_optionalChain([g, 'optionalAccess',
|
|
5233
|
+
const parent = _nullishCoalesce(_optionalChain([parents, 'access', _165 => _165[0], 'optionalAccess', _166 => _166.id]), () => ( null));
|
|
5234
|
+
if (parents.some((g) => (_nullishCoalesce(_optionalChain([g, 'optionalAccess', _167 => _167.id]), () => ( null))) !== parent)) return null;
|
|
4945
5235
|
const id = this.newId();
|
|
4946
5236
|
this.change(label, () => {
|
|
4947
5237
|
const set = new Set(roots);
|
|
@@ -4971,8 +5261,8 @@ var VectorEditorController = (_class3 = class {
|
|
|
4971
5261
|
const paths = entries.map((e) => e.node);
|
|
4972
5262
|
const id = this.newId();
|
|
4973
5263
|
const first = _nullishCoalesce(roots.find((r) => this.holds(r, paths[0].id)), () => ( paths[0].id));
|
|
4974
|
-
const subpaths = entries.flatMap((e) =>
|
|
4975
|
-
const { transform: _t, effects: _e, booleanOperation: _b, ...baseRest } =
|
|
5264
|
+
const subpaths = entries.flatMap((e) => _chunkKANRAHTLcjs.bezierToSubpaths.call(void 0, this.intoParentSpace(first, _chunkKANRAHTLcjs.vectorPathWorldBezier.call(void 0, e.node, e.parent))));
|
|
5265
|
+
const { transform: _t, effects: _e, booleanOperation: _b, ...baseRest } = _chunkKANRAHTLcjs.cloneVectorNode.call(void 0, paths[0]);
|
|
4976
5266
|
const node = { ...baseRest, id, name: "Compound Path", subpaths };
|
|
4977
5267
|
const drop = /* @__PURE__ */ new Set([...paths.map((p) => p.id), ...roots]);
|
|
4978
5268
|
this.change("Combine", () => {
|
|
@@ -4984,12 +5274,12 @@ var VectorEditorController = (_class3 = class {
|
|
|
4984
5274
|
}
|
|
4985
5275
|
/** A document-space path mapped into the parent space of node `id`. */
|
|
4986
5276
|
intoParentSpace(id, path) {
|
|
4987
|
-
const parent = _nullishCoalesce(
|
|
5277
|
+
const parent = _nullishCoalesce(_chunkKANRAHTLcjs.vectorParentMatrix.call(void 0, this.doc.nodes, id), () => ( _chunkDWGZUSEScjs.IDENTITY_MATRIX));
|
|
4988
5278
|
return isRoot(parent) ? path : _chunkXGD3FSNCcjs.transformBezierPath.call(void 0, path, _chunkDWGZUSEScjs.invertMatrix.call(void 0, parent));
|
|
4989
5279
|
}
|
|
4990
5280
|
/** Splits selected compound paths into one path per subpath. */
|
|
4991
5281
|
breakApart(options = {}) {
|
|
4992
|
-
const paths = (_nullishCoalesce(options.ids, () => ( this.selection))).map((id) => this.getNode(id)).filter((n) => _optionalChain([n, 'optionalAccess',
|
|
5282
|
+
const paths = (_nullishCoalesce(options.ids, () => ( this.selection))).map((id) => this.getNode(id)).filter((n) => _optionalChain([n, 'optionalAccess', _168 => _168.type]) === "path" && n.subpaths.length > 1);
|
|
4993
5283
|
if (!paths.length) return { ok: false, message: "Select a compound path to break apart." };
|
|
4994
5284
|
const created = [];
|
|
4995
5285
|
const set = new Set(paths.map((p) => p.id));
|
|
@@ -5030,7 +5320,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
5030
5320
|
const topRoot = _nullishCoalesce([...roots].reverse().find((r) => this.holds(r, last)), () => ( last));
|
|
5031
5321
|
const nodes = [];
|
|
5032
5322
|
for (const piece of result.pieces) {
|
|
5033
|
-
const subpaths =
|
|
5323
|
+
const subpaths = _chunkKANRAHTLcjs.bezierToSubpaths.call(void 0, this.intoParentSpace(topRoot, piece.path)).map((sp) => piece.open ? { ...sp, closed: false } : sp);
|
|
5034
5324
|
if (!subpaths.length) continue;
|
|
5035
5325
|
const source = entries[piece.source].node;
|
|
5036
5326
|
const style = vectorResultStyle(source, shapes[piece.source].paint, op === "outline");
|
|
@@ -5057,7 +5347,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
5057
5347
|
const out = /* @__PURE__ */ new Map();
|
|
5058
5348
|
for (const id of _nullishCoalesce(ids, () => ( this.selection))) {
|
|
5059
5349
|
const node = this.getNode(id);
|
|
5060
|
-
const group = isVectorBlendGroup(node) ? node : _optionalChain([
|
|
5350
|
+
const group = isVectorBlendGroup(node) ? node : _optionalChain([_chunkKANRAHTLcjs.locateVectorNode.call(void 0, this.doc.nodes, id), 'optionalAccess', _169 => _169.parent]);
|
|
5061
5351
|
if (isVectorBlendGroup(group)) out.set(group.id, group);
|
|
5062
5352
|
}
|
|
5063
5353
|
return [...out.values()];
|
|
@@ -5074,9 +5364,9 @@ var VectorEditorController = (_class3 = class {
|
|
|
5074
5364
|
return !!n && !n.blendStep && !n.locked;
|
|
5075
5365
|
});
|
|
5076
5366
|
if (ids.length < 2) return null;
|
|
5077
|
-
const locs = ids.map((id2) =>
|
|
5078
|
-
const parent = _nullishCoalesce(_optionalChain([locs, 'access',
|
|
5079
|
-
if (locs.some((l) => (_nullishCoalesce(_optionalChain([l, 'access',
|
|
5367
|
+
const locs = ids.map((id2) => _chunkKANRAHTLcjs.locateVectorNode.call(void 0, this.doc.nodes, id2));
|
|
5368
|
+
const parent = _nullishCoalesce(_optionalChain([locs, 'access', _170 => _170[0], 'access', _171 => _171.parent, 'optionalAccess', _172 => _172.id]), () => ( null));
|
|
5369
|
+
if (locs.some((l) => (_nullishCoalesce(_optionalChain([l, 'access', _173 => _173.parent, 'optionalAccess', _174 => _174.id]), () => ( null))) !== parent)) return null;
|
|
5080
5370
|
const order = input.keepOrder ? ids : ids.slice().sort((a, b) => locs[ids.indexOf(a)].index - locs[ids.indexOf(b)].index);
|
|
5081
5371
|
const blend = blendOptionsOf({ ...this.blendDefaults, ...input });
|
|
5082
5372
|
if (input.starts) {
|
|
@@ -5118,13 +5408,13 @@ var VectorEditorController = (_class3 = class {
|
|
|
5118
5408
|
const node = this.getNode(nodeId);
|
|
5119
5409
|
if (!isVectorBlendGroup(group)) return { ok: false, message: `"${blendId}" is not a blend.` };
|
|
5120
5410
|
if (!node || node.blendStep || node.locked || node.id === blendId) return { ok: false, message: `"${nodeId}" cannot be a key.` };
|
|
5121
|
-
const parentOf = (id) => _nullishCoalesce(_optionalChain([
|
|
5411
|
+
const parentOf = (id) => _nullishCoalesce(_optionalChain([_chunkKANRAHTLcjs.locateVectorNode.call(void 0, this.doc.nodes, id), 'optionalAccess', _175 => _175.parent, 'optionalAccess', _176 => _176.id]), () => ( null));
|
|
5122
5412
|
if (parentOf(blendId) !== parentOf(nodeId)) return { ok: false, message: "The new key must sit beside the blend (same parent)." };
|
|
5123
5413
|
const start = options.start;
|
|
5124
5414
|
this.change("Blend", () => {
|
|
5125
5415
|
const blend = start !== null && start !== void 0 ? { ...group.blend, starts: { ...group.blend.starts, [nodeId]: start } } : group.blend;
|
|
5126
|
-
const m = _chunkDWGZUSEScjs.invertMatrix.call(void 0,
|
|
5127
|
-
const key = group.transform ?
|
|
5416
|
+
const m = _chunkDWGZUSEScjs.invertMatrix.call(void 0, _chunkKANRAHTLcjs.nodeMatrix.call(void 0, group));
|
|
5417
|
+
const key = group.transform ? _chunkKANRAHTLcjs.transformVectorNode.call(void 0, node, m) : node;
|
|
5128
5418
|
const without = mapTree(this.doc.nodes, (n) => n.id === nodeId ? null : n);
|
|
5129
5419
|
this.setDoc(spliceTree(without, blendId, [{ ...group, blend, children: [...group.children, key] }]));
|
|
5130
5420
|
this.selection = [blendId];
|
|
@@ -5150,7 +5440,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
5150
5440
|
if (!groups.length) return [];
|
|
5151
5441
|
const set = new Set(groups.map((g) => g.id));
|
|
5152
5442
|
const used = /* @__PURE__ */ new Set();
|
|
5153
|
-
|
|
5443
|
+
_chunkKANRAHTLcjs.walkVectorNodes.call(void 0, this.doc.nodes, (n) => used.add(n.id));
|
|
5154
5444
|
const fresh = () => {
|
|
5155
5445
|
let id = this.createId();
|
|
5156
5446
|
while (used.has(id)) id = this.createId();
|
|
@@ -5188,14 +5478,14 @@ var VectorEditorController = (_class3 = class {
|
|
|
5188
5478
|
replaceBlendSpine(options = {}) {
|
|
5189
5479
|
const roots = _nullishCoalesce(options.ids, () => ( this.selectedRoots()));
|
|
5190
5480
|
const groups = this.blendTargets(roots);
|
|
5191
|
-
const paths = roots.map((id) => this.getNode(id)).filter((n) => _optionalChain([n, 'optionalAccess',
|
|
5481
|
+
const paths = roots.map((id) => this.getNode(id)).filter((n) => _optionalChain([n, 'optionalAccess', _177 => _177.type]) === "path" && !n.blendStep && !isVectorBlendGroup(_optionalChain([_chunkKANRAHTLcjs.locateVectorNode.call(void 0, this.doc.nodes, n.id), 'optionalAccess', _178 => _178.parent])));
|
|
5192
5482
|
if (groups.length !== 1 || paths.length !== 1) return { ok: false, message: "Select one blend and one path to be its spine." };
|
|
5193
5483
|
const group = groups[0];
|
|
5194
5484
|
const path = paths[0];
|
|
5195
5485
|
const first = path.subpaths.find((sp) => sp.anchors.length >= 2);
|
|
5196
5486
|
if (!first) return { ok: false, message: "The spine needs a path with at least two points." };
|
|
5197
5487
|
const m = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, this.worldOf(path.id), _chunkDWGZUSEScjs.invertMatrix.call(void 0, this.worldOf(group.id)));
|
|
5198
|
-
const spine =
|
|
5488
|
+
const spine = _chunkKANRAHTLcjs.transformVectorNode.call(void 0, { id: "", type: "path", subpaths: [first] }, m).subpaths[0];
|
|
5199
5489
|
this.change("Replace Spine", () => {
|
|
5200
5490
|
const withSpine = { ...group, blend: { ...group.blend, spine } };
|
|
5201
5491
|
const targets = vectorBlendKeyTargets(withSpine);
|
|
@@ -5203,11 +5493,11 @@ var VectorEditorController = (_class3 = class {
|
|
|
5203
5493
|
const children = withSpine.children.map((c) => {
|
|
5204
5494
|
if (c.blendStep) return c;
|
|
5205
5495
|
const target = targets[k++];
|
|
5206
|
-
const b =
|
|
5496
|
+
const b = _chunkKANRAHTLcjs.vectorNodeBounds.call(void 0, c);
|
|
5207
5497
|
if (!target || !b) return c;
|
|
5208
5498
|
const dx = target[0] - (b.x + b.width / 2);
|
|
5209
5499
|
const dy = target[1] - (b.y + b.height / 2);
|
|
5210
|
-
return Math.hypot(dx, dy) > 1e-9 ?
|
|
5500
|
+
return Math.hypot(dx, dy) > 1e-9 ? _chunkKANRAHTLcjs.transformVectorNode.call(void 0, c, _chunkDWGZUSEScjs.translateMatrix.call(void 0, dx, dy)) : c;
|
|
5211
5501
|
});
|
|
5212
5502
|
this.setDoc(mapTree(this.doc.nodes, (n) => n.id === path.id ? null : n.id === group.id ? { ...withSpine, children } : n));
|
|
5213
5503
|
this.selection = [group.id];
|
|
@@ -5219,7 +5509,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
5219
5509
|
shapeBuilderMap(ids) {
|
|
5220
5510
|
const roots = _nullishCoalesce(ids, () => ( this.selectedRoots()));
|
|
5221
5511
|
const key = roots.join("\0");
|
|
5222
|
-
if (_optionalChain([this, 'access',
|
|
5512
|
+
if (_optionalChain([this, 'access', _179 => _179.builderCache, 'optionalAccess', _180 => _180.doc]) === this.doc && this.builderCache.key === key) return this.builderCache.map;
|
|
5223
5513
|
const entries = roots.length ? vectorPathEntries(this.doc, roots, { expand: false }) : [];
|
|
5224
5514
|
const map = entries.length ? vectorShapeBuilderMap(entries) : null;
|
|
5225
5515
|
this.builderCache = { doc: this.doc, key, map };
|
|
@@ -5275,15 +5565,15 @@ var VectorEditorController = (_class3 = class {
|
|
|
5275
5565
|
let nodes = this.doc.nodes;
|
|
5276
5566
|
m.entries.forEach((entry, i) => {
|
|
5277
5567
|
const node = entry.node;
|
|
5278
|
-
const toLocal = (path) => _chunkXGD3FSNCcjs.transformBezierPath.call(void 0, path, _chunkDWGZUSEScjs.invertMatrix.call(void 0, _chunkDWGZUSEScjs.multiplyMatrices.call(void 0,
|
|
5568
|
+
const toLocal = (path) => _chunkXGD3FSNCcjs.transformBezierPath.call(void 0, path, _chunkDWGZUSEScjs.invertMatrix.call(void 0, _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, _chunkKANRAHTLcjs.nodeMatrix.call(void 0, node), entry.parent)));
|
|
5279
5569
|
const list = [];
|
|
5280
5570
|
const r = plan.replace.get(i);
|
|
5281
5571
|
if (r === void 0) list.push(node);
|
|
5282
|
-
else if (_optionalChain([r, 'optionalAccess',
|
|
5283
|
-
else if (_optionalChain([r, 'optionalAccess',
|
|
5284
|
-
else if (_optionalChain([r, 'optionalAccess',
|
|
5572
|
+
else if (_optionalChain([r, 'optionalAccess', _181 => _181.kind]) === "fill") list.push({ ...node, fillRule: "nonzero", subpaths: _chunkKANRAHTLcjs.bezierToSubpaths.call(void 0, toLocal(r.path)) });
|
|
5573
|
+
else if (_optionalChain([r, 'optionalAccess', _182 => _182.kind]) === "outline") list.push({ ...node, subpaths: _chunkKANRAHTLcjs.bezierToSubpaths.call(void 0, toLocal(r.path)) });
|
|
5574
|
+
else if (_optionalChain([r, 'optionalAccess', _183 => _183.kind]) === "pieces") {
|
|
5285
5575
|
r.paths.forEach(
|
|
5286
|
-
(path, k) => list.push({ ...node, id: k === 0 ? node.id : this.newId(), subpaths:
|
|
5576
|
+
(path, k) => list.push({ ...node, id: k === 0 ? node.id : this.newId(), subpaths: _chunkKANRAHTLcjs.bezierToSubpaths.call(void 0, toLocal(path)).map((sp) => ({ ...sp, closed: false })) })
|
|
5287
5577
|
);
|
|
5288
5578
|
}
|
|
5289
5579
|
if (plan.merged && plan.merged.style === i) {
|
|
@@ -5294,9 +5584,9 @@ var VectorEditorController = (_class3 = class {
|
|
|
5294
5584
|
id: mergedId,
|
|
5295
5585
|
name: "Shape",
|
|
5296
5586
|
...node.transform ? { transform: node.transform } : {},
|
|
5297
|
-
subpaths:
|
|
5587
|
+
subpaths: _chunkKANRAHTLcjs.bezierToSubpaths.call(void 0, toLocal(plan.merged.path))
|
|
5298
5588
|
};
|
|
5299
|
-
if (plan.merged.currentFill || !
|
|
5589
|
+
if (plan.merged.currentFill || !_chunkKANRAHTLcjs.hasPaint.call(void 0, merged.fill)) merged.fill = _chunkKANRAHTLcjs.hasPaint.call(void 0, this.defaults.fill) ? this.defaults.fill : "#808080";
|
|
5300
5590
|
list.push(merged);
|
|
5301
5591
|
}
|
|
5302
5592
|
if (r === void 0 && list.length === 1) return;
|
|
@@ -5315,7 +5605,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
5315
5605
|
}
|
|
5316
5606
|
/** The paint bucket's map of the visible outlines, cached per document and gap. */
|
|
5317
5607
|
fillMap(gap) {
|
|
5318
|
-
if (_optionalChain([this, 'access',
|
|
5608
|
+
if (_optionalChain([this, 'access', _184 => _184.fillCache, 'optionalAccess', _185 => _185.doc]) === this.doc && this.fillCache.gap === gap) return this.fillCache.map;
|
|
5319
5609
|
const map = vectorFillMap(this.doc, gap);
|
|
5320
5610
|
this.fillCache = { doc: this.doc, gap, map };
|
|
5321
5611
|
return map;
|
|
@@ -5329,18 +5619,18 @@ var VectorEditorController = (_class3 = class {
|
|
|
5329
5619
|
*/
|
|
5330
5620
|
fillRegion(point, options = {}) {
|
|
5331
5621
|
if (!Number.isFinite(point.x) || !Number.isFinite(point.y)) return null;
|
|
5332
|
-
const region = _optionalChain([this, 'access',
|
|
5333
|
-
if (!_optionalChain([region, 'optionalAccess',
|
|
5622
|
+
const region = _optionalChain([this, 'access', _186 => _186.fillMap, 'call', _187 => _187(_nullishCoalesce(options.gap, () => ( this.editing.fillGap))), 'optionalAccess', _188 => _188.regionAt, 'call', _189 => _189([point.x, point.y])]);
|
|
5623
|
+
if (!_optionalChain([region, 'optionalAccess', _190 => _190.length])) return null;
|
|
5334
5624
|
let below = null;
|
|
5335
5625
|
const roots = new Set(this.selectedRoots());
|
|
5336
|
-
|
|
5626
|
+
_chunkKANRAHTLcjs.walkVectorNodes.call(void 0, this.doc.nodes, (n) => {
|
|
5337
5627
|
if (!below && roots.has(n.id)) below = n.id;
|
|
5338
5628
|
});
|
|
5339
|
-
const subpaths =
|
|
5629
|
+
const subpaths = _chunkKANRAHTLcjs.bezierToSubpaths.call(void 0, below ? this.intoParentSpace(below, region) : region);
|
|
5340
5630
|
if (!subpaths.length) return null;
|
|
5341
5631
|
const id = this.newId();
|
|
5342
5632
|
const node = { id, type: "path", name: "Fill", ...this.styleFor(false), stroke: null, fillRule: "nonzero", subpaths };
|
|
5343
|
-
if (!
|
|
5633
|
+
if (!_chunkKANRAHTLcjs.hasPaint.call(void 0, node.fill)) node.fill = "#808080";
|
|
5344
5634
|
const target = below;
|
|
5345
5635
|
this.change("Fill Region", () => {
|
|
5346
5636
|
if (target) {
|
|
@@ -5356,7 +5646,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
5356
5646
|
/** Updates the Shape Builder / paint bucket highlight for the pointer at `p`; true when it changed. */
|
|
5357
5647
|
hoverBuilder(p, alt) {
|
|
5358
5648
|
if (this.tool === "paintBucket") {
|
|
5359
|
-
const region = _nullishCoalesce(_optionalChain([this, 'access',
|
|
5649
|
+
const region = _nullishCoalesce(_optionalChain([this, 'access', _191 => _191.fillMap, 'call', _192 => _192(this.editing.fillGap), 'optionalAccess', _193 => _193.regionAt, 'call', _194 => _194([p.x, p.y])]), () => ( null));
|
|
5360
5650
|
const key2 = region ? _chunkXGD3FSNCcjs.bezierPathToSvg.call(void 0, region, { precision: 2 }) : null;
|
|
5361
5651
|
if (key2 === this.builderHoverKey) return false;
|
|
5362
5652
|
this.builderHoverKey = key2;
|
|
@@ -5445,7 +5735,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
5445
5735
|
for (const r of refs) if (!local.has(r.nodeId)) local.set(r.nodeId, _chunkDWGZUSEScjs.applyMatrixLinear.call(void 0, _chunkDWGZUSEScjs.invertMatrix.call(void 0, this.worldOf(r.nodeId, doc)), { x: dx, y: dy }));
|
|
5446
5736
|
return this.updateAnchors(doc, refs, (a, ref) => {
|
|
5447
5737
|
const d = local.get(ref.nodeId);
|
|
5448
|
-
return
|
|
5738
|
+
return _chunkKANRAHTLcjs.translateAnchor.call(void 0, a, d.x, d.y);
|
|
5449
5739
|
});
|
|
5450
5740
|
}
|
|
5451
5741
|
/**
|
|
@@ -5463,8 +5753,8 @@ var VectorEditorController = (_class3 = class {
|
|
|
5463
5753
|
}
|
|
5464
5754
|
/** `doc` with anchor `ref` moved to document point `to` by a Curvature-tool move. */
|
|
5465
5755
|
curvatureMoved(doc, ref, to) {
|
|
5466
|
-
const node =
|
|
5467
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
5756
|
+
const node = _chunkKANRAHTLcjs.findVectorNode.call(void 0, doc.nodes, ref.nodeId);
|
|
5757
|
+
if (_optionalChain([node, 'optionalAccess', _195 => _195.type]) !== "path" || node.locked || !node.subpaths[ref.subpath]) return doc;
|
|
5468
5758
|
const q = this.toLocal(ref.nodeId, to, doc);
|
|
5469
5759
|
const subpaths = node.subpaths.map((sp, i) => i === ref.subpath ? curvatureMoveAnchor(sp, ref.index, q) : sp);
|
|
5470
5760
|
const nodes = mapTree(doc.nodes, (n) => n.id === ref.nodeId ? { ...node, subpaths } : n);
|
|
@@ -5472,8 +5762,8 @@ var VectorEditorController = (_class3 = class {
|
|
|
5472
5762
|
}
|
|
5473
5763
|
/** `doc` with segment `ref` bent through document point `p` at parameter `t`. */
|
|
5474
5764
|
bent(doc, ref, t, p) {
|
|
5475
|
-
const node =
|
|
5476
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
5765
|
+
const node = _chunkKANRAHTLcjs.findVectorNode.call(void 0, doc.nodes, ref.nodeId);
|
|
5766
|
+
if (_optionalChain([node, 'optionalAccess', _196 => _196.type]) !== "path" || node.locked || !node.subpaths[ref.subpath]) return doc;
|
|
5477
5767
|
const q = this.toLocal(ref.nodeId, p, doc);
|
|
5478
5768
|
const subpaths = node.subpaths.map((sp, i) => i === ref.subpath ? bendSegment(sp, ref.segment, t, q) : sp);
|
|
5479
5769
|
return { ...doc, nodes: mapTree(doc.nodes, (n) => n.id === ref.nodeId ? { ...node, subpaths } : n) };
|
|
@@ -5484,7 +5774,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
5484
5774
|
*/
|
|
5485
5775
|
bendSegment(ref, to, t = 0.5) {
|
|
5486
5776
|
const node = this.getNode(ref.nodeId);
|
|
5487
|
-
const sp = _optionalChain([node, 'optionalAccess',
|
|
5777
|
+
const sp = _optionalChain([node, 'optionalAccess', _197 => _197.type]) === "path" ? node.subpaths[ref.subpath] : void 0;
|
|
5488
5778
|
if (!sp || ref.segment < 0 || ref.segment >= (sp.closed ? sp.anchors.length : sp.anchors.length - 1) || sp.anchors.length < 2) return { ok: false, message: "There is no such segment." };
|
|
5489
5779
|
if (node.locked) return { ok: false, message: "The path is locked." };
|
|
5490
5780
|
this.change("Bend Segment", () => {
|
|
@@ -5497,7 +5787,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
5497
5787
|
if (!getAnchor(this.doc, ref)) return { ok: false, message: "There is no such anchor." };
|
|
5498
5788
|
const local = this.toLocal(ref.nodeId, to);
|
|
5499
5789
|
this.change("Move Handle", () => {
|
|
5500
|
-
this.doc = this.updateAnchors(this.doc, [ref], (a) =>
|
|
5790
|
+
this.doc = this.updateAnchors(this.doc, [ref], (a) => _chunkKANRAHTLcjs.moveAnchorHandle.call(void 0, a, ref.handle, local, options.breakHandles));
|
|
5501
5791
|
});
|
|
5502
5792
|
return { ok: true };
|
|
5503
5793
|
}
|
|
@@ -5509,7 +5799,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
5509
5799
|
if (n.type !== "path") return n;
|
|
5510
5800
|
const mine = refs.filter((r) => r.nodeId === n.id);
|
|
5511
5801
|
if (!mine.length) return n;
|
|
5512
|
-
const subpaths = n.subpaths.map((sp, s) => mine.filter((r) => r.subpath === s).reduce((acc, r) =>
|
|
5802
|
+
const subpaths = n.subpaths.map((sp, s) => mine.filter((r) => r.subpath === s).reduce((acc, r) => _chunkKANRAHTLcjs.convertAnchor.call(void 0, acc, r.index, type), sp));
|
|
5513
5803
|
return { ...n, subpaths };
|
|
5514
5804
|
});
|
|
5515
5805
|
this.setDoc(nodes);
|
|
@@ -5519,10 +5809,10 @@ var VectorEditorController = (_class3 = class {
|
|
|
5519
5809
|
/** Adds an anchor on the nearest segment of `nodeId` to document point `point` (shape unchanged). */
|
|
5520
5810
|
insertAnchorAt(nodeId, point) {
|
|
5521
5811
|
const node = this.getNode(nodeId);
|
|
5522
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
5523
|
-
const hit =
|
|
5812
|
+
if (_optionalChain([node, 'optionalAccess', _198 => _198.type]) !== "path") return null;
|
|
5813
|
+
const hit = _chunkKANRAHTLcjs.nearestSegment.call(void 0, node, this.toLocal(nodeId, point));
|
|
5524
5814
|
if (!hit) return null;
|
|
5525
|
-
const { subpath, index } =
|
|
5815
|
+
const { subpath, index } = _chunkKANRAHTLcjs.insertAnchor.call(void 0, node.subpaths[hit.subpath], hit.segment, hit.t);
|
|
5526
5816
|
const ref = { nodeId, subpath: hit.subpath, index };
|
|
5527
5817
|
this.change("Add Point", () => {
|
|
5528
5818
|
this.replaceNode(nodeId, { ...node, subpaths: node.subpaths.map((sp, i) => i === hit.subpath ? subpath : sp) });
|
|
@@ -5547,7 +5837,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
5547
5837
|
const subpaths = n.subpaths.map((sp, s) => {
|
|
5548
5838
|
const indices = mine.filter((r) => r.subpath === s).map((r) => r.index);
|
|
5549
5839
|
if (!indices.length) return sp;
|
|
5550
|
-
return keepShape ? removeAnchorsKeepingShape(sp, indices) :
|
|
5840
|
+
return keepShape ? removeAnchorsKeepingShape(sp, indices) : _chunkKANRAHTLcjs.removeAnchors.call(void 0, sp, indices);
|
|
5551
5841
|
}).filter((sp) => sp.anchors.length > 1);
|
|
5552
5842
|
return subpaths.length ? { ...n, subpaths } : null;
|
|
5553
5843
|
});
|
|
@@ -5563,7 +5853,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
5563
5853
|
setClosed(closed, nodeId) {
|
|
5564
5854
|
const targets = nodeId ? (() => {
|
|
5565
5855
|
const n = this.getNode(nodeId);
|
|
5566
|
-
return _optionalChain([n, 'optionalAccess',
|
|
5856
|
+
return _optionalChain([n, 'optionalAccess', _199 => _199.type]) === "path" ? n.subpaths.map((_, s) => ({ nodeId, subpath: s })) : [];
|
|
5567
5857
|
})() : this.anchors.map((r) => ({ nodeId: r.nodeId, subpath: r.subpath }));
|
|
5568
5858
|
if (!targets.length) return { ok: false, message: "Select a path or points." };
|
|
5569
5859
|
this.change(closed ? "Close Path" : "Open Path", () => {
|
|
@@ -5578,13 +5868,13 @@ var VectorEditorController = (_class3 = class {
|
|
|
5578
5868
|
}
|
|
5579
5869
|
/** Reverses the direction of every subpath of the selected paths. */
|
|
5580
5870
|
reversePaths(ids = this.selection) {
|
|
5581
|
-
const set = new Set(ids.flatMap((id) => this.getNode(id) ?
|
|
5871
|
+
const set = new Set(ids.flatMap((id) => this.getNode(id) ? _chunkKANRAHTLcjs.collectPathNodes.call(void 0, this.getNode(id)) : []).map((p) => p.id));
|
|
5582
5872
|
if (!set.size) return { ok: false, message: "Select a path." };
|
|
5583
5873
|
this.change("Reverse Path", () => {
|
|
5584
5874
|
this.setDoc(
|
|
5585
5875
|
mapTree(
|
|
5586
5876
|
this.doc.nodes,
|
|
5587
|
-
(n) => n.type === "path" && set.has(n.id) ? { ...n, subpaths: n.subpaths.map(
|
|
5877
|
+
(n) => n.type === "path" && set.has(n.id) ? { ...n, subpaths: n.subpaths.map(_chunkKANRAHTLcjs.reverseSubpath), ..._optionalChain([n, 'access', _200 => _200.strokeWidthProfile, 'optionalAccess', _201 => _201.length]) ? { strokeWidthProfile: _chunkKANRAHTLcjs.reverseWidthProfile.call(void 0, n.strokeWidthProfile) } : {} } : n
|
|
5588
5878
|
)
|
|
5589
5879
|
);
|
|
5590
5880
|
this.anchors = [];
|
|
@@ -5601,11 +5891,11 @@ var VectorEditorController = (_class3 = class {
|
|
|
5601
5891
|
for (const id of roots) {
|
|
5602
5892
|
const node = this.getNode(id);
|
|
5603
5893
|
if (node && !node.locked) {
|
|
5604
|
-
for (const p of
|
|
5894
|
+
for (const p of _chunkKANRAHTLcjs.collectPathNodes.call(void 0, node)) if (!p.locked) out.set(p.id, p);
|
|
5605
5895
|
}
|
|
5606
5896
|
}
|
|
5607
5897
|
const order = [];
|
|
5608
|
-
|
|
5898
|
+
_chunkKANRAHTLcjs.walkVectorNodes.call(void 0, this.doc.nodes, (n) => {
|
|
5609
5899
|
if (out.has(n.id)) order.push(n.id);
|
|
5610
5900
|
});
|
|
5611
5901
|
return order.map((id) => out.get(id));
|
|
@@ -5722,9 +6012,9 @@ var VectorEditorController = (_class3 = class {
|
|
|
5722
6012
|
*/
|
|
5723
6013
|
cutPathAt(nodeId, point) {
|
|
5724
6014
|
const node = this.getNode(nodeId);
|
|
5725
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
6015
|
+
if (_optionalChain([node, 'optionalAccess', _202 => _202.type]) !== "path" || node.locked) return null;
|
|
5726
6016
|
const local = this.toLocal(nodeId, point);
|
|
5727
|
-
const hit =
|
|
6017
|
+
const hit = _chunkKANRAHTLcjs.nearestSegment.call(void 0, node, local);
|
|
5728
6018
|
if (!hit) return null;
|
|
5729
6019
|
const sp = node.subpaths[hit.subpath];
|
|
5730
6020
|
const n = sp.anchors.length;
|
|
@@ -5768,18 +6058,18 @@ var VectorEditorController = (_class3 = class {
|
|
|
5768
6058
|
/** Visible, unlocked paths a stroke over `points` can reach: in `ids`, the selection, or (with neither) any whose bounds it crosses. */
|
|
5769
6059
|
strokeTargets(points, ids, pad) {
|
|
5770
6060
|
const blocked = /* @__PURE__ */ new Set();
|
|
5771
|
-
|
|
6061
|
+
_chunkKANRAHTLcjs.walkVectorNodes.call(void 0, this.doc.nodes, (n, parent) => {
|
|
5772
6062
|
if (n.visible === false || n.locked || parent && blocked.has(parent.id)) blocked.add(n.id);
|
|
5773
6063
|
});
|
|
5774
6064
|
const visible = (p) => !blocked.has(p.id);
|
|
5775
|
-
if (_optionalChain([ids, 'optionalAccess',
|
|
6065
|
+
if (_optionalChain([ids, 'optionalAccess', _203 => _203.length]) || this.selection.length) return this.pathTargets(_nullishCoalesce(ids, () => ( this.selection))).filter(visible);
|
|
5776
6066
|
const box = polylineBounds(points.map(toPoint2), pad);
|
|
5777
6067
|
if (!box) return [];
|
|
5778
6068
|
const out = [];
|
|
5779
|
-
|
|
6069
|
+
_chunkKANRAHTLcjs.walkVectorNodes.call(void 0, this.doc.nodes, (n) => {
|
|
5780
6070
|
if (n.type !== "path" || !visible(n)) return;
|
|
5781
|
-
const b =
|
|
5782
|
-
if (b &&
|
|
6071
|
+
const b = _chunkKANRAHTLcjs.vectorNodeBounds.call(void 0, n, _nullishCoalesce(_chunkKANRAHTLcjs.vectorParentMatrix.call(void 0, this.doc.nodes, n.id), () => ( _chunkDWGZUSEScjs.IDENTITY_MATRIX)));
|
|
6072
|
+
if (b && _chunkKANRAHTLcjs.boundsIntersect.call(void 0, b, box)) out.push(n);
|
|
5783
6073
|
});
|
|
5784
6074
|
return out;
|
|
5785
6075
|
}
|
|
@@ -5801,8 +6091,8 @@ var VectorEditorController = (_class3 = class {
|
|
|
5801
6091
|
for (const node of this.strokeTargets(pts, options.ids, 0)) {
|
|
5802
6092
|
const closed = node.subpaths.filter((sp) => sp.anchors.length > 1);
|
|
5803
6093
|
if (!closed.length || closed.some((sp) => !sp.closed)) continue;
|
|
5804
|
-
const result = knifePath(
|
|
5805
|
-
if (result) plan.push({ node, pieces: result.map((path) =>
|
|
6094
|
+
const result = knifePath(_chunkKANRAHTLcjs.subpathsToBezier.call(void 0, closed), _nullishCoalesce(node.fillRule, () => ( "nonzero")), this.localPoints(node.id, pts));
|
|
6095
|
+
if (result) plan.push({ node, pieces: result.map((path) => _chunkKANRAHTLcjs.bezierToSubpaths.call(void 0, path)) });
|
|
5806
6096
|
}
|
|
5807
6097
|
if (!plan.length) return [];
|
|
5808
6098
|
const created = [];
|
|
@@ -5834,9 +6124,9 @@ var VectorEditorController = (_class3 = class {
|
|
|
5834
6124
|
const local = _chunkXGD3FSNCcjs.transformBezierPath.call(void 0, region, _chunkDWGZUSEScjs.invertMatrix.call(void 0, this.worldOf(node.id)));
|
|
5835
6125
|
const live = node.subpaths.filter((sp) => sp.anchors.length > 1);
|
|
5836
6126
|
if (!live.length) continue;
|
|
5837
|
-
if (
|
|
5838
|
-
const faces = eraseFromFill(
|
|
5839
|
-
if (faces) plan.push({ node, pieces: faces.map((f) =>
|
|
6127
|
+
if (_chunkKANRAHTLcjs.hasPaint.call(void 0, node.fill) && live.every((sp) => sp.closed)) {
|
|
6128
|
+
const faces = eraseFromFill(_chunkKANRAHTLcjs.subpathsToBezier.call(void 0, live), _nullishCoalesce(node.fillRule, () => ( "nonzero")), local);
|
|
6129
|
+
if (faces) plan.push({ node, pieces: faces.map((f) => _chunkKANRAHTLcjs.bezierToSubpaths.call(void 0, f)) });
|
|
5840
6130
|
continue;
|
|
5841
6131
|
}
|
|
5842
6132
|
const results = live.map((sp) => eraseFromOutline(sp, local));
|
|
@@ -5858,7 +6148,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
5858
6148
|
finishPath() {
|
|
5859
6149
|
if (!this.pen) return;
|
|
5860
6150
|
const node = this.getNode(this.pen.nodeId);
|
|
5861
|
-
const sp = _optionalChain([node, 'optionalAccess',
|
|
6151
|
+
const sp = _optionalChain([node, 'optionalAccess', _204 => _204.subpaths, 'access', _205 => _205[this.pen.subpath]]);
|
|
5862
6152
|
const pen = this.pen;
|
|
5863
6153
|
this.pen = null;
|
|
5864
6154
|
this.pointer = null;
|
|
@@ -5881,7 +6171,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
5881
6171
|
// -------------------------------------------------------------------------
|
|
5882
6172
|
/** Copies the selection. Returns JSON text for the system clipboard (or null). */
|
|
5883
6173
|
copy() {
|
|
5884
|
-
const nodes = this.selectedRoots().map((id) => this.getNode(id)).filter((n) => !!n).map((n) =>
|
|
6174
|
+
const nodes = this.selectedRoots().map((id) => this.getNode(id)).filter((n) => !!n).map((n) => _chunkKANRAHTLcjs.cloneVectorNode.call(void 0, n));
|
|
5885
6175
|
if (!nodes.length) return null;
|
|
5886
6176
|
this.clipboard = nodes;
|
|
5887
6177
|
return JSON.stringify({ type: VECTOR_CLIPBOARD_TYPE, nodes });
|
|
@@ -5902,27 +6192,27 @@ var VectorEditorController = (_class3 = class {
|
|
|
5902
6192
|
if (trimmed.startsWith("{")) {
|
|
5903
6193
|
try {
|
|
5904
6194
|
const data = JSON.parse(trimmed);
|
|
5905
|
-
if (_optionalChain([data, 'optionalAccess',
|
|
6195
|
+
if (_optionalChain([data, 'optionalAccess', _206 => _206.type]) === VECTOR_CLIPBOARD_TYPE && Array.isArray(data.nodes)) nodes = data.nodes;
|
|
5906
6196
|
} catch (e3) {
|
|
5907
6197
|
nodes = null;
|
|
5908
6198
|
}
|
|
5909
6199
|
} else if (/<svg[\s>]/i.test(trimmed)) {
|
|
5910
6200
|
try {
|
|
5911
|
-
nodes =
|
|
6201
|
+
nodes = _chunkKANRAHTLcjs.parseVectorSvg.call(void 0, trimmed).nodes;
|
|
5912
6202
|
} catch (e4) {
|
|
5913
6203
|
nodes = null;
|
|
5914
6204
|
}
|
|
5915
6205
|
}
|
|
5916
6206
|
} else nodes = this.clipboard;
|
|
5917
|
-
if (!_optionalChain([nodes, 'optionalAccess',
|
|
6207
|
+
if (!_optionalChain([nodes, 'optionalAccess', _207 => _207.length])) return [];
|
|
5918
6208
|
const offset = _nullishCoalesce(options.offset, () => ( (text && !text.trim().startsWith("{") ? { x: 0, y: 0 } : { x: 10, y: 10 })));
|
|
5919
|
-
const copies = nodes.map((n) =>
|
|
6209
|
+
const copies = nodes.map((n) => _chunkKANRAHTLcjs.transformVectorNode.call(void 0, this.freshIds(n), _chunkDWGZUSEScjs.translateMatrix.call(void 0, offset.x, offset.y)));
|
|
5920
6210
|
this.change("Paste", () => {
|
|
5921
6211
|
this.setDoc([...this.doc.nodes, ...copies]);
|
|
5922
6212
|
this.selection = copies.map((n) => n.id);
|
|
5923
6213
|
this.anchors = [];
|
|
5924
6214
|
});
|
|
5925
|
-
if (!text) this.clipboard = copies.map((n) =>
|
|
6215
|
+
if (!text) this.clipboard = copies.map((n) => _chunkKANRAHTLcjs.cloneVectorNode.call(void 0, n));
|
|
5926
6216
|
return copies.map((n) => n.id);
|
|
5927
6217
|
}
|
|
5928
6218
|
// -------------------------------------------------------------------------
|
|
@@ -5965,7 +6255,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
5965
6255
|
hitHandle(screen) {
|
|
5966
6256
|
for (const ref of getVisibleHandles(this.view()).reverse()) {
|
|
5967
6257
|
const a = getAnchorWorld(this.doc, ref);
|
|
5968
|
-
const h = _optionalChain([a, 'optionalAccess',
|
|
6258
|
+
const h = _optionalChain([a, 'optionalAccess', _208 => _208[ref.handle]]);
|
|
5969
6259
|
if (!h) continue;
|
|
5970
6260
|
const s = this.documentToScreen(h);
|
|
5971
6261
|
if (Math.hypot(s.x - screen.x, s.y - screen.y) <= this.hitRadius) return ref;
|
|
@@ -6006,7 +6296,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
6006
6296
|
/** Deepest unlocked visible path under `p`. */
|
|
6007
6297
|
/** Live groups being edited (selected, or holding the selection or the edited path): their children are hit as stored. */
|
|
6008
6298
|
enteredGroups() {
|
|
6009
|
-
return
|
|
6299
|
+
return _chunkKANRAHTLcjs.vectorEnteredGroups.call(void 0, this.doc.nodes, this.editingId ? [...this.selection, this.editingId] : this.selection);
|
|
6010
6300
|
}
|
|
6011
6301
|
hitPath(p) {
|
|
6012
6302
|
const tol = this.tolerance();
|
|
@@ -6016,10 +6306,10 @@ var VectorEditorController = (_class3 = class {
|
|
|
6016
6306
|
const n = list[i];
|
|
6017
6307
|
if (n.visible === false || n.locked) continue;
|
|
6018
6308
|
if (n.type === "group") {
|
|
6019
|
-
if (
|
|
6020
|
-
const found = search(n.children, _chunkDWGZUSEScjs.multiplyMatrices.call(void 0,
|
|
6309
|
+
if (_chunkKANRAHTLcjs.hasOwnVectorAppearance.call(void 0, n) && !entered.has(n.id) && !_chunkKANRAHTLcjs.hitTestVectorNode.call(void 0, n, p, tol, parent, { entered })) continue;
|
|
6310
|
+
const found = search(n.children, _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, _chunkKANRAHTLcjs.nodeMatrix.call(void 0, n), parent));
|
|
6021
6311
|
if (found) return found;
|
|
6022
|
-
} else if (
|
|
6312
|
+
} else if (_chunkKANRAHTLcjs.hitTestVectorNode.call(void 0, n, p, tol, parent, { entered })) return n;
|
|
6023
6313
|
}
|
|
6024
6314
|
return null;
|
|
6025
6315
|
};
|
|
@@ -6028,7 +6318,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
6028
6318
|
/** Endpoints of open subpaths of unlocked visible paths (pen tool resumes from them). */
|
|
6029
6319
|
openEndpoints() {
|
|
6030
6320
|
const out = [];
|
|
6031
|
-
|
|
6321
|
+
_chunkKANRAHTLcjs.walkVectorNodes.call(void 0, this.doc.nodes, (n) => {
|
|
6032
6322
|
if (n.type !== "path" || n.locked || n.visible === false) return;
|
|
6033
6323
|
n.subpaths.forEach((sp, s) => {
|
|
6034
6324
|
if (sp.closed || sp.anchors.length < 1) return;
|
|
@@ -6044,7 +6334,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
6044
6334
|
case "select": {
|
|
6045
6335
|
const handle = this.hitTransformHandle(screen);
|
|
6046
6336
|
if (handle) return { nodeId: null, transformHandle: handle };
|
|
6047
|
-
const node =
|
|
6337
|
+
const node = _chunkKANRAHTLcjs.hitTestVectorNodes.call(void 0, this.doc.nodes, p, this.tolerance(), { entered: this.enteredGroups() });
|
|
6048
6338
|
return node ? { nodeId: node.id } : null;
|
|
6049
6339
|
}
|
|
6050
6340
|
case "direct": {
|
|
@@ -6056,7 +6346,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
6056
6346
|
if (widget) return { nodeId: widget.ref.nodeId, corner: widget.ref };
|
|
6057
6347
|
for (const id of getEditablePathIds(this.view())) {
|
|
6058
6348
|
const node = this.getNode(id);
|
|
6059
|
-
const seg =
|
|
6349
|
+
const seg = _chunkKANRAHTLcjs.nearestSegment.call(void 0, node, this.toLocal(id, p));
|
|
6060
6350
|
if (seg && seg.distance <= this.tolerance()) {
|
|
6061
6351
|
const point = _chunkDWGZUSEScjs.applyMatrix.call(void 0, this.worldOf(id), seg.point);
|
|
6062
6352
|
return { nodeId: id, segment: { nodeId: id, subpath: seg.subpath, segment: seg.segment, t: seg.t, point } };
|
|
@@ -6095,7 +6385,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
6095
6385
|
case "envelope": {
|
|
6096
6386
|
const hit = this.hitEnvelope(screen, p);
|
|
6097
6387
|
if (hit) return { nodeId: hit.target.node.id, envelope: { nodeId: hit.target.node.id, index: hit.index } };
|
|
6098
|
-
const node =
|
|
6388
|
+
const node = _chunkKANRAHTLcjs.hitTestVectorNodes.call(void 0, this.doc.nodes, p, this.tolerance(), { entered: this.enteredGroups() });
|
|
6099
6389
|
return node ? { nodeId: node.id } : null;
|
|
6100
6390
|
}
|
|
6101
6391
|
default:
|
|
@@ -6110,7 +6400,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
6110
6400
|
const shown = this.hitWidthHandleIn(screen, this.widthView());
|
|
6111
6401
|
if (shown) return shown;
|
|
6112
6402
|
const spot = this.strokeSpotAt(this.screenToDocument(screen));
|
|
6113
|
-
return spot && spot.nodeId !== _optionalChain([this, 'access',
|
|
6403
|
+
return spot && spot.nodeId !== _optionalChain([this, 'access', _209 => _209.hover, 'optionalAccess', _210 => _210.nodeId]) ? this.hitWidthHandleIn(screen, { ...this.widthView(), hover: { nodeId: spot.nodeId } }) : null;
|
|
6114
6404
|
}
|
|
6115
6405
|
hitWidthHandleIn(screen, view) {
|
|
6116
6406
|
let best = null;
|
|
@@ -6131,19 +6421,19 @@ var VectorEditorController = (_class3 = class {
|
|
|
6131
6421
|
strokeSpotAt(p) {
|
|
6132
6422
|
let best = null;
|
|
6133
6423
|
const tol = this.tolerance();
|
|
6134
|
-
|
|
6424
|
+
_chunkKANRAHTLcjs.walkVectorNodes.call(void 0, this.doc.nodes, (n) => {
|
|
6135
6425
|
if (n.type !== "path" || n.visible === false || n.locked) return;
|
|
6136
6426
|
if (hiddenOrLocked(this.doc.nodes, n.id)) return;
|
|
6137
6427
|
const g = vectorStrokeWidthGeometry(n);
|
|
6138
6428
|
if (!g) return;
|
|
6139
6429
|
const m = this.worldOf(n.id);
|
|
6140
6430
|
const local = _chunkDWGZUSEScjs.applyMatrix.call(void 0, _chunkDWGZUSEScjs.invertMatrix.call(void 0, m), p);
|
|
6141
|
-
const near2 =
|
|
6431
|
+
const near2 = _chunkKANRAHTLcjs.nearestStrokePosition.call(void 0, g.line, [local.x, local.y]);
|
|
6142
6432
|
if (!near2) return;
|
|
6143
|
-
const profile =
|
|
6144
|
-
const w =
|
|
6433
|
+
const profile = _chunkKANRAHTLcjs.strokeWidthProfileOf.call(void 0, n);
|
|
6434
|
+
const w = _chunkKANRAHTLcjs.widthProfileAt.call(void 0, profile, near2.t);
|
|
6145
6435
|
const reach = Math.max(near2.side === "left" ? w.left : w.right, 0) * g.unit + tol;
|
|
6146
|
-
if (near2.distance > reach || near2.distance >
|
|
6436
|
+
if (near2.distance > reach || near2.distance > _chunkKANRAHTLcjs.widthProfileMaxScale.call(void 0, profile) * g.unit + tol) return;
|
|
6147
6437
|
if (best && near2.distance >= best.distance) return;
|
|
6148
6438
|
const nx = near2.tangent[1];
|
|
6149
6439
|
const ny = -near2.tangent[0];
|
|
@@ -6165,9 +6455,9 @@ var VectorEditorController = (_class3 = class {
|
|
|
6165
6455
|
downWidth(screen, p, input) {
|
|
6166
6456
|
const hit = this.hitWidthHandle(screen);
|
|
6167
6457
|
const spot = hit ? null : this.strokeSpotAt(p);
|
|
6168
|
-
const nodeId = _nullishCoalesce(_optionalChain([hit, 'optionalAccess',
|
|
6458
|
+
const nodeId = _nullishCoalesce(_optionalChain([hit, 'optionalAccess', _211 => _211.ref, 'access', _212 => _212.nodeId]), () => ( _optionalChain([spot, 'optionalAccess', _213 => _213.nodeId])));
|
|
6169
6459
|
const node = nodeId ? this.getNode(nodeId) : void 0;
|
|
6170
|
-
const g = _optionalChain([node, 'optionalAccess',
|
|
6460
|
+
const g = _optionalChain([node, 'optionalAccess', _214 => _214.type]) === "path" ? vectorStrokeWidthGeometry(node) : null;
|
|
6171
6461
|
if (this.widthEdit) this.widthEdit = null;
|
|
6172
6462
|
if (!node || node.type !== "path" || !g) {
|
|
6173
6463
|
if (!input.shift) this.widthPoints = [];
|
|
@@ -6185,11 +6475,11 @@ var VectorEditorController = (_class3 = class {
|
|
|
6185
6475
|
let t;
|
|
6186
6476
|
let subpath;
|
|
6187
6477
|
if (hit) {
|
|
6188
|
-
profile =
|
|
6478
|
+
profile = _chunkKANRAHTLcjs.sanitizeWidthProfile.call(void 0, node.strokeWidthProfile);
|
|
6189
6479
|
ref = { nodeId: node.id, index: hit.ref.index, subpath: hit.ref.subpath };
|
|
6190
|
-
t = _nullishCoalesce(_optionalChain([profile, 'access',
|
|
6480
|
+
t = _nullishCoalesce(_optionalChain([profile, 'access', _215 => _215[ref.index], 'optionalAccess', _216 => _216.t]), () => ( 0));
|
|
6191
6481
|
subpath = hit.ref.subpath;
|
|
6192
|
-
if (hit.ref.part === "center") mode = input.alt && profile.length <
|
|
6482
|
+
if (hit.ref.part === "center") mode = input.alt && profile.length < _chunkKANRAHTLcjs.VECTOR_WIDTH_PROFILE_MAX_POINTS ? "copy" : "move";
|
|
6193
6483
|
else if (input.alt) side = hit.ref.part;
|
|
6194
6484
|
const same = this.widthPoints.length > 0 && this.widthPoints[0].nodeId === node.id;
|
|
6195
6485
|
const selected = same && this.widthPoints.some((r) => r.index === ref.index);
|
|
@@ -6204,8 +6494,8 @@ var VectorEditorController = (_class3 = class {
|
|
|
6204
6494
|
} else if (mode === "copy" || !selected) this.widthPoints = [ref];
|
|
6205
6495
|
if (mode !== "copy") group = this.widthPoints.filter((r) => r.index !== ref.index).map((r) => r.index);
|
|
6206
6496
|
} else {
|
|
6207
|
-
const near2 =
|
|
6208
|
-
const inserted =
|
|
6497
|
+
const near2 = _chunkKANRAHTLcjs.nearestStrokePosition.call(void 0, g.line, [local.x, local.y]);
|
|
6498
|
+
const inserted = _chunkKANRAHTLcjs.insertWidthPoint.call(void 0, _chunkKANRAHTLcjs.strokeWidthProfileOf.call(void 0, node), near2.t);
|
|
6209
6499
|
profile = inserted.points;
|
|
6210
6500
|
subpath = near2.contour;
|
|
6211
6501
|
t = near2.t;
|
|
@@ -6213,7 +6503,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
6213
6503
|
if (input.alt) side = near2.side;
|
|
6214
6504
|
this.widthPoints = [ref];
|
|
6215
6505
|
}
|
|
6216
|
-
const at =
|
|
6506
|
+
const at = _chunkKANRAHTLcjs.strokePositionPoint.call(void 0, g.line, subpath, t);
|
|
6217
6507
|
if (!at) return;
|
|
6218
6508
|
const base = { ...this.doc, nodes: mapTree(this.doc.nodes, (n) => n.id === node.id ? { ...n, strokeWidthProfile: profile } : n) };
|
|
6219
6509
|
this.doc = base;
|
|
@@ -6247,14 +6537,14 @@ var VectorEditorController = (_class3 = class {
|
|
|
6247
6537
|
*/
|
|
6248
6538
|
snapWidthT(drag, node, line2, t, skip) {
|
|
6249
6539
|
const m = this.worldOf(node.id, drag.base);
|
|
6250
|
-
const at =
|
|
6540
|
+
const at = _chunkKANRAHTLcjs.strokePositionPoint.call(void 0, line2, drag.ref.subpath, t);
|
|
6251
6541
|
if (!at) return t;
|
|
6252
6542
|
const here = this.documentToScreen(_chunkDWGZUSEScjs.applyMatrix.call(void 0, m, { x: at.point[0], y: at.point[1] }));
|
|
6253
6543
|
let best = t;
|
|
6254
6544
|
let bestD = this.hitRadius;
|
|
6255
6545
|
drag.profile.forEach((w, i) => {
|
|
6256
6546
|
if (i === skip || drag.group.includes(i)) return;
|
|
6257
|
-
const q =
|
|
6547
|
+
const q = _chunkKANRAHTLcjs.strokePositionPoint.call(void 0, line2, drag.ref.subpath, w.t);
|
|
6258
6548
|
if (!q) return;
|
|
6259
6549
|
const s = this.documentToScreen(_chunkDWGZUSEScjs.applyMatrix.call(void 0, m, { x: q.point[0], y: q.point[1] }));
|
|
6260
6550
|
const d = Math.hypot(s.x - here.x, s.y - here.y);
|
|
@@ -6273,12 +6563,12 @@ var VectorEditorController = (_class3 = class {
|
|
|
6273
6563
|
for (let i = list.length - 1; i >= 0; i--) {
|
|
6274
6564
|
const n = list[i];
|
|
6275
6565
|
if (n.visible === false || n.locked) continue;
|
|
6276
|
-
const m = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0,
|
|
6566
|
+
const m = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, _chunkKANRAHTLcjs.nodeMatrix.call(void 0, n), parent);
|
|
6277
6567
|
if (n.type === "group") {
|
|
6278
6568
|
visit(n.children, m);
|
|
6279
6569
|
continue;
|
|
6280
6570
|
}
|
|
6281
|
-
const hit =
|
|
6571
|
+
const hit = _chunkKANRAHTLcjs.nearestSegment.call(void 0, n, _chunkDWGZUSEScjs.applyMatrix.call(void 0, _chunkDWGZUSEScjs.invertMatrix.call(void 0, m), p));
|
|
6282
6572
|
if (hit && hit.distance <= tol && (!best || hit.distance < best.distance - 1e-9)) {
|
|
6283
6573
|
best = { nodeId: n.id, subpath: hit.subpath, segment: hit.segment, t: hit.t, point: _chunkDWGZUSEScjs.applyMatrix.call(void 0, m, hit.point), distance: hit.distance };
|
|
6284
6574
|
}
|
|
@@ -6341,12 +6631,12 @@ var VectorEditorController = (_class3 = class {
|
|
|
6341
6631
|
}
|
|
6342
6632
|
/** The shape under the pointer for the Blend tool, and the anchor of its first subpath under it. */
|
|
6343
6633
|
blendHit(screen, p) {
|
|
6344
|
-
const node =
|
|
6634
|
+
const node = _chunkKANRAHTLcjs.hitTestVectorNodes.call(void 0, this.doc.nodes, p, this.tolerance());
|
|
6345
6635
|
if (!node) return null;
|
|
6346
6636
|
let anchor = null;
|
|
6347
6637
|
if (node.type === "path" && node.subpaths[0]) {
|
|
6348
6638
|
const refs = node.subpaths[0].anchors.map((_, index) => ({ nodeId: node.id, subpath: 0, index }));
|
|
6349
|
-
anchor = _nullishCoalesce(_optionalChain([this, 'access',
|
|
6639
|
+
anchor = _nullishCoalesce(_optionalChain([this, 'access', _217 => _217.hitAnchor, 'call', _218 => _218(screen, refs), 'optionalAccess', _219 => _219.index]), () => ( null));
|
|
6350
6640
|
}
|
|
6351
6641
|
return { nodeId: node.id, anchor };
|
|
6352
6642
|
}
|
|
@@ -6390,7 +6680,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
6390
6680
|
this.notify();
|
|
6391
6681
|
return;
|
|
6392
6682
|
}
|
|
6393
|
-
const node =
|
|
6683
|
+
const node = _chunkKANRAHTLcjs.hitTestVectorNodes.call(void 0, this.doc.nodes, p, this.tolerance(), { entered: this.enteredGroups() });
|
|
6394
6684
|
if (node) {
|
|
6395
6685
|
const selected = this.selection.includes(node.id);
|
|
6396
6686
|
if (input.shift) {
|
|
@@ -6458,12 +6748,12 @@ var VectorEditorController = (_class3 = class {
|
|
|
6458
6748
|
}
|
|
6459
6749
|
for (const id of getEditablePathIds(this.view())) {
|
|
6460
6750
|
const node = this.getNode(id);
|
|
6461
|
-
const seg =
|
|
6751
|
+
const seg = _chunkKANRAHTLcjs.nearestSegment.call(void 0, node, this.toLocal(id, p));
|
|
6462
6752
|
if (!seg || seg.distance > this.tolerance()) continue;
|
|
6463
6753
|
const sp = node.subpaths[seg.subpath];
|
|
6464
6754
|
if (input.alt) {
|
|
6465
6755
|
const before = this.snapshot();
|
|
6466
|
-
const { subpath, index } =
|
|
6756
|
+
const { subpath, index } = _chunkKANRAHTLcjs.insertAnchor.call(void 0, sp, seg.segment, seg.t);
|
|
6467
6757
|
this.replaceNode(id, { ...node, subpaths: node.subpaths.map((s, i) => i === seg.subpath ? subpath : s) });
|
|
6468
6758
|
const ref = { nodeId: id, subpath: seg.subpath, index };
|
|
6469
6759
|
this.anchors = [ref];
|
|
@@ -6499,7 +6789,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
6499
6789
|
}
|
|
6500
6790
|
downPen(screen, p, input) {
|
|
6501
6791
|
const before = this.snapshot();
|
|
6502
|
-
const sp = this.pen ? _optionalChain([this, 'access',
|
|
6792
|
+
const sp = this.pen ? _optionalChain([this, 'access', _220 => _220.getNode, 'call', _221 => _221(this.pen.nodeId), 'optionalAccess', _222 => _222.subpaths, 'access', _223 => _223[this.pen.subpath]]) : void 0;
|
|
6503
6793
|
if (this.pen && sp) {
|
|
6504
6794
|
const pen = this.pen;
|
|
6505
6795
|
const first = { nodeId: pen.nodeId, subpath: pen.subpath, index: 0 };
|
|
@@ -6530,7 +6820,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
6530
6820
|
let node2 = this.getNode(endpoint.nodeId);
|
|
6531
6821
|
let index = endpoint.index;
|
|
6532
6822
|
if (index === 0 && node2.subpaths[endpoint.subpath].anchors.length > 1) {
|
|
6533
|
-
node2 = { ...node2, subpaths: node2.subpaths.map((s, i) => i === endpoint.subpath ?
|
|
6823
|
+
node2 = { ...node2, subpaths: node2.subpaths.map((s, i) => i === endpoint.subpath ? _chunkKANRAHTLcjs.reverseSubpath.call(void 0, s) : s) };
|
|
6534
6824
|
this.replaceNode(node2.id, node2);
|
|
6535
6825
|
index = node2.subpaths[endpoint.subpath].anchors.length - 1;
|
|
6536
6826
|
}
|
|
@@ -6666,7 +6956,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
6666
6956
|
return;
|
|
6667
6957
|
}
|
|
6668
6958
|
case "marquee": {
|
|
6669
|
-
const bounds =
|
|
6959
|
+
const bounds = _chunkKANRAHTLcjs.boundsFromPoints.call(void 0, drag.start, p);
|
|
6670
6960
|
this.interaction = { type: "marquee", bounds };
|
|
6671
6961
|
if (drag.anchorsMode) {
|
|
6672
6962
|
const inside = getVisibleAnchors(this.view()).filter((r) => {
|
|
@@ -6676,8 +6966,8 @@ var VectorEditorController = (_class3 = class {
|
|
|
6676
6966
|
this.anchors = [...drag.baseAnchors, ...inside.filter((r) => !drag.baseAnchors.some((b) => sameRef(b, r)))];
|
|
6677
6967
|
} else {
|
|
6678
6968
|
const hits = this.doc.nodes.filter((n) => !n.locked && n.visible !== false).filter((n) => {
|
|
6679
|
-
const b =
|
|
6680
|
-
return b &&
|
|
6969
|
+
const b = _chunkKANRAHTLcjs.vectorNodeBounds.call(void 0, n);
|
|
6970
|
+
return b && _chunkKANRAHTLcjs.boundsIntersect.call(void 0, b, bounds);
|
|
6681
6971
|
}).map((n) => n.id);
|
|
6682
6972
|
this.selection = [.../* @__PURE__ */ new Set([...drag.base, ...hits])];
|
|
6683
6973
|
}
|
|
@@ -6709,7 +6999,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
6709
6999
|
const leave = anchor ? { at: { x: anchor.x, y: anchor.y }, constrain: input.shift ? "angle" : null } : null;
|
|
6710
7000
|
const pt = this.snapDrawn(p, leave, input, () => drag.targets ??= VectorSnapTargets.forHandle(drag.base, drag.ref.nodeId));
|
|
6711
7001
|
const local = this.toLocal(drag.ref.nodeId, pt, drag.base);
|
|
6712
|
-
this.doc = this.updateAnchors(drag.base, [drag.ref], (a) =>
|
|
7002
|
+
this.doc = this.updateAnchors(drag.base, [drag.ref], (a) => _chunkKANRAHTLcjs.moveAnchorHandle.call(void 0, a, drag.ref.handle, local, input.alt));
|
|
6713
7003
|
this.interaction = { type: "handle", ref: drag.ref };
|
|
6714
7004
|
this.notify(true);
|
|
6715
7005
|
return;
|
|
@@ -6720,8 +7010,8 @@ var VectorEditorController = (_class3 = class {
|
|
|
6720
7010
|
const c = drag.widget.corner;
|
|
6721
7011
|
const inv = _chunkDWGZUSEScjs.invertMatrix.call(void 0, this.worldOf(drag.widget.ref.nodeId, drag.base));
|
|
6722
7012
|
const d = _chunkDWGZUSEScjs.applyMatrixLinear.call(void 0, inv, { x: p.x - drag.start.x, y: p.y - drag.start.y });
|
|
6723
|
-
const radius = Math.max(0, Math.min(c.maxRadius, drag.widget.drawnRadius +
|
|
6724
|
-
this.doc = this.updateAnchors(drag.base, drag.refs, (a) =>
|
|
7013
|
+
const radius = Math.max(0, Math.min(c.maxRadius, drag.widget.drawnRadius + _chunkKANRAHTLcjs.cornerRadiusChange.call(void 0, c, d)));
|
|
7014
|
+
this.doc = this.updateAnchors(drag.base, drag.refs, (a) => _chunkKANRAHTLcjs.setAnchorCorner.call(void 0, a, radius));
|
|
6725
7015
|
this.interaction = { type: "corner", ref: drag.widget.ref, radius };
|
|
6726
7016
|
this.notify(true);
|
|
6727
7017
|
return;
|
|
@@ -6758,15 +7048,15 @@ var VectorEditorController = (_class3 = class {
|
|
|
6758
7048
|
const side = drag.closing ? "in" : "out";
|
|
6759
7049
|
const pos = this.toLocal(drag.ref.nodeId, drag.closing ? { x: 2 * anchor.x - pt.x, y: 2 * anchor.y - pt.y } : pt, drag.base);
|
|
6760
7050
|
this.doc = this.updateAnchors(drag.base, [drag.ref], (a) => {
|
|
6761
|
-
if (drag.outOnly || drag.altBreaks && input.alt) return
|
|
6762
|
-
return
|
|
7051
|
+
if (drag.outOnly || drag.altBreaks && input.alt) return _chunkKANRAHTLcjs.moveAnchorHandle.call(void 0, a, side, pos, true);
|
|
7052
|
+
return _chunkKANRAHTLcjs.moveAnchorHandle.call(void 0, { ...a, type: "symmetric" }, side, pos);
|
|
6763
7053
|
});
|
|
6764
7054
|
this.notify(true);
|
|
6765
7055
|
return;
|
|
6766
7056
|
}
|
|
6767
7057
|
case "shape": {
|
|
6768
7058
|
const node = this.getNode(drag.nodeId);
|
|
6769
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
7059
|
+
if (_optionalChain([node, 'optionalAccess', _224 => _224.type]) !== "path") return;
|
|
6770
7060
|
const leave = { at: drag.start, constrain: input.shift ? drag.tool === "line" ? "angle" : "square" : null, curves: false };
|
|
6771
7061
|
let end = this.snapDrawn(p, leave, input, () => drag.targets ??= this.drawingTargets(null));
|
|
6772
7062
|
if (!this.snappedToObject && drag.tool !== "line" && !input.shift && !input.mod && this.snap.objects && drag.targets) end = this.matchShapeSize(drag.targets, drag.start, end, input.alt);
|
|
@@ -6787,7 +7077,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
6787
7077
|
if (input.alt) start = { x: start.x - w, y: start.y - h };
|
|
6788
7078
|
const x2 = drag.start.x + w;
|
|
6789
7079
|
const y2 = drag.start.y + h;
|
|
6790
|
-
bounds =
|
|
7080
|
+
bounds = _chunkKANRAHTLcjs.boundsFromPoints.call(void 0, start, { x: x2, y: y2 });
|
|
6791
7081
|
}
|
|
6792
7082
|
const shaped = this.createShapeNode({ kind: drag.tool, ...bounds });
|
|
6793
7083
|
this.replaceNode(drag.nodeId, { ...node, subpaths: shaped.subpaths });
|
|
@@ -6798,32 +7088,32 @@ var VectorEditorController = (_class3 = class {
|
|
|
6798
7088
|
case "width": {
|
|
6799
7089
|
if (!drag.moved && Math.hypot(p.x - drag.start.x, p.y - drag.start.y) * this.viewport.zoom < 2) return;
|
|
6800
7090
|
drag.moved = true;
|
|
6801
|
-
const node =
|
|
7091
|
+
const node = _chunkKANRAHTLcjs.findVectorNode.call(void 0, drag.base.nodes, drag.ref.nodeId);
|
|
6802
7092
|
const local = this.toLocal(node.id, p, drag.base);
|
|
6803
7093
|
const src = drag.profile[drag.source];
|
|
6804
7094
|
let profile;
|
|
6805
7095
|
let index = drag.source;
|
|
6806
7096
|
if (drag.mode !== "width") {
|
|
6807
7097
|
const g = vectorStrokeWidthGeometry(node);
|
|
6808
|
-
const near2 = g ?
|
|
7098
|
+
const near2 = g ? _chunkKANRAHTLcjs.nearestStrokePosition.call(void 0, g.line, [local.x, local.y], drag.ref.subpath) : null;
|
|
6809
7099
|
if (!g || !near2) return;
|
|
6810
7100
|
const t = drag.group.length ? near2.t : this.snapWidthT(drag, node, g.line, near2.t, drag.source);
|
|
6811
7101
|
if (drag.mode === "copy") {
|
|
6812
|
-
({ points: profile, index } =
|
|
7102
|
+
({ points: profile, index } = _chunkKANRAHTLcjs.insertWidthPoint.call(void 0, drag.profile, t, { left: src.left, right: src.right }, { step: true }));
|
|
6813
7103
|
} else if (drag.group.length) {
|
|
6814
7104
|
const shifted = shiftWidthPoints(drag.profile, [drag.source, ...drag.group], t - src.t);
|
|
6815
7105
|
profile = shifted.points;
|
|
6816
7106
|
drag.renumber = shifted.renumber;
|
|
6817
7107
|
index = _nullishCoalesce(shifted.renumber.get(drag.source), () => ( drag.source));
|
|
6818
|
-
} else profile =
|
|
7108
|
+
} else profile = _chunkKANRAHTLcjs.setWidthPoint.call(void 0, drag.profile, drag.source, { t });
|
|
6819
7109
|
} else {
|
|
6820
7110
|
const off = ((local.x - drag.origin.x) * drag.normal.x + (local.y - drag.origin.y) * drag.normal.y) / drag.unit;
|
|
6821
7111
|
const patch = drag.side === "both" ? { left: Math.abs(off), right: Math.abs(off) } : drag.side === "left" ? { left: Math.max(0, off) } : { right: Math.max(0, -off) };
|
|
6822
|
-
profile =
|
|
7112
|
+
profile = _chunkKANRAHTLcjs.setWidthPoint.call(void 0, drag.profile, drag.source, patch);
|
|
6823
7113
|
if (drag.group.length) {
|
|
6824
7114
|
const dl = profile[drag.source].left - src.left;
|
|
6825
7115
|
const dr = profile[drag.source].right - src.right;
|
|
6826
|
-
for (const i of drag.group) profile =
|
|
7116
|
+
for (const i of drag.group) profile = _chunkKANRAHTLcjs.setWidthPoint.call(void 0, profile, i, { left: Math.max(0, drag.profile[i].left + dl), right: Math.max(0, drag.profile[i].right + dr) });
|
|
6827
7117
|
}
|
|
6828
7118
|
}
|
|
6829
7119
|
this.doc = { ...drag.base, nodes: mapTree(drag.base.nodes, (n) => n.id === node.id ? { ...n, strokeWidthProfile: profile } : n) };
|
|
@@ -6840,14 +7130,14 @@ var VectorEditorController = (_class3 = class {
|
|
|
6840
7130
|
for (const q of drag.lazy.push([p.x, p.y])) {
|
|
6841
7131
|
if (Math.hypot(q[0] - last[0], q[1] - last[1]) * this.viewport.zoom < 1.5) continue;
|
|
6842
7132
|
drag.points.push(q);
|
|
6843
|
-
_optionalChain([drag, 'access',
|
|
7133
|
+
_optionalChain([drag, 'access', _225 => _225.pressures, 'optionalAccess', _226 => _226.push, 'call', _227 => _227(drag.pressure)]);
|
|
6844
7134
|
moved = true;
|
|
6845
7135
|
}
|
|
6846
7136
|
const string = drag.lazy.string();
|
|
6847
7137
|
const node = this.getNode(drag.nodeId);
|
|
6848
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
7138
|
+
if (_optionalChain([node, 'optionalAccess', _228 => _228.type]) !== "path") return;
|
|
6849
7139
|
if (!moved) {
|
|
6850
|
-
if (string && _optionalChain([this, 'access',
|
|
7140
|
+
if (string && _optionalChain([this, 'access', _229 => _229.interaction, 'optionalAccess', _230 => _230.type]) === "draw") {
|
|
6851
7141
|
this.interaction = { ...this.interaction, string: [{ x: string[0][0], y: string[0][1] }, { x: string[1][0], y: string[1][1] }] };
|
|
6852
7142
|
this.notify();
|
|
6853
7143
|
}
|
|
@@ -6883,8 +7173,8 @@ var VectorEditorController = (_class3 = class {
|
|
|
6883
7173
|
}
|
|
6884
7174
|
this.setGuides(res);
|
|
6885
7175
|
return {
|
|
6886
|
-
dx: _optionalChain([res, 'optionalAccess',
|
|
6887
|
-
dy: _optionalChain([res, 'optionalAccess',
|
|
7176
|
+
dx: _optionalChain([res, 'optionalAccess', _231 => _231.x]) ? dx + res.dx : axes.x ? this.gridValue(origin.x + dx) - origin.x : dx,
|
|
7177
|
+
dy: _optionalChain([res, 'optionalAccess', _232 => _232.y]) ? dy + res.dy : axes.y ? this.gridValue(origin.y + dy) - origin.y : dy
|
|
6888
7178
|
};
|
|
6889
7179
|
}
|
|
6890
7180
|
/** The anchor a point drag snaps by, where it started: the grabbed one, else the moving one nearest the press. */
|
|
@@ -6968,8 +7258,8 @@ var VectorEditorController = (_class3 = class {
|
|
|
6968
7258
|
case "corner": {
|
|
6969
7259
|
if (drag.moved) return this.commit("Corner Radius", drag.before);
|
|
6970
7260
|
if (drag.alt) {
|
|
6971
|
-
const kind =
|
|
6972
|
-
this.doc = this.updateAnchors(drag.base, drag.refs, (a) =>
|
|
7261
|
+
const kind = _chunkKANRAHTLcjs.nextVectorCornerKind.call(void 0, drag.widget.kind);
|
|
7262
|
+
this.doc = this.updateAnchors(drag.base, drag.refs, (a) => _chunkKANRAHTLcjs.setAnchorCorner.call(void 0, a, _nullishCoalesce(_optionalChain([a, 'access', _233 => _233.corner, 'optionalAccess', _234 => _234.radius]), () => ( 0)), kind));
|
|
6973
7263
|
return this.commit("Corner Kind", drag.before);
|
|
6974
7264
|
}
|
|
6975
7265
|
const ref = drag.widget.ref;
|
|
@@ -6984,7 +7274,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
6984
7274
|
const several = drag.group.length > 0;
|
|
6985
7275
|
if (drag.mode === "copy") this.widthPoints = [drag.ref];
|
|
6986
7276
|
else if (drag.mode === "move" && several) {
|
|
6987
|
-
this.widthPoints = [drag.source, ...drag.group].map((i) => ({ ...drag.ref, index: _nullishCoalesce(_optionalChain([drag, 'access',
|
|
7277
|
+
this.widthPoints = [drag.source, ...drag.group].map((i) => ({ ...drag.ref, index: _nullishCoalesce(_optionalChain([drag, 'access', _235 => _235.renumber, 'optionalAccess', _236 => _236.get, 'call', _237 => _237(i)]), () => ( i)) }));
|
|
6988
7278
|
} else if (!several) this.widthPoints = [drag.ref];
|
|
6989
7279
|
const label = drag.mode === "copy" ? "Copy Width Point" : drag.mode === "move" ? several ? "Move Width Points" : "Move Width Point" : several ? "Width Points" : "Width Point";
|
|
6990
7280
|
return this.commit(label, drag.before);
|
|
@@ -7014,7 +7304,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
7014
7304
|
return this.commit(drag.label, drag.before);
|
|
7015
7305
|
case "shape": {
|
|
7016
7306
|
const node = this.getNode(drag.nodeId);
|
|
7017
|
-
const b = node ?
|
|
7307
|
+
const b = node ? _chunkKANRAHTLcjs.vectorNodeBounds.call(void 0, node) : null;
|
|
7018
7308
|
const min = 2 / this.viewport.zoom;
|
|
7019
7309
|
if (!b || b.width < min && b.height < min) {
|
|
7020
7310
|
this.doc = drag.before.doc;
|
|
@@ -7028,14 +7318,14 @@ var VectorEditorController = (_class3 = class {
|
|
|
7028
7318
|
}
|
|
7029
7319
|
case "pencil": {
|
|
7030
7320
|
const node = this.getNode(drag.nodeId);
|
|
7031
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
7321
|
+
if (_optionalChain([node, 'optionalAccess', _238 => _238.type]) !== "path" || drag.points.length < 2) {
|
|
7032
7322
|
this.doc = drag.before.doc;
|
|
7033
7323
|
this.notify(true);
|
|
7034
7324
|
return;
|
|
7035
7325
|
}
|
|
7036
7326
|
for (const q of drag.lazy.finish()) {
|
|
7037
7327
|
drag.points.push(q);
|
|
7038
|
-
_optionalChain([drag, 'access',
|
|
7328
|
+
_optionalChain([drag, 'access', _239 => _239.pressures, 'optionalAccess', _240 => _240.push, 'call', _241 => _241(drag.pressure)]);
|
|
7039
7329
|
}
|
|
7040
7330
|
const shape = this.editing.recognizeShapes ? recognizeInkShape(drag.points, { minSize: 6 / this.viewport.zoom }) : null;
|
|
7041
7331
|
if (shape) {
|
|
@@ -7050,7 +7340,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
7050
7340
|
anchors[anchors.length - 1].out = { x: c.p1[0], y: c.p1[1] };
|
|
7051
7341
|
anchors.push({ x: c.p3[0], y: c.p3[1], in: { x: c.p2[0], y: c.p2[1] } });
|
|
7052
7342
|
}
|
|
7053
|
-
const subpaths = anchors.length > 1 ?
|
|
7343
|
+
const subpaths = anchors.length > 1 ? _chunkKANRAHTLcjs.bezierToSubpaths.call(void 0, _chunkKANRAHTLcjs.subpathsToBezier.call(void 0, [{ anchors, closed: false }])) : node.subpaths;
|
|
7054
7344
|
const profile = drag.pressures ? pencilPressureProfile(drag.points, drag.pressures) : [];
|
|
7055
7345
|
this.replaceNode(drag.nodeId, { ...node, subpaths, ...profile.length ? { strokeWidthProfile: profile } : {} });
|
|
7056
7346
|
this.selection = [drag.nodeId];
|
|
@@ -7110,10 +7400,10 @@ var VectorEditorController = (_class3 = class {
|
|
|
7110
7400
|
this.convertAnchors(a.in || a.out ? "corner" : "smooth", [anchor]);
|
|
7111
7401
|
return;
|
|
7112
7402
|
}
|
|
7113
|
-
const id = _nullishCoalesce(_optionalChain([this, 'access',
|
|
7403
|
+
const id = _nullishCoalesce(_optionalChain([this, 'access', _242 => _242.hover, 'optionalAccess', _243 => _243.segment, 'optionalAccess', _244 => _244.nodeId]), () => ( this.editingId));
|
|
7114
7404
|
if (id) {
|
|
7115
7405
|
const node = this.getNode(id);
|
|
7116
|
-
const seg = node ?
|
|
7406
|
+
const seg = node ? _chunkKANRAHTLcjs.nearestSegment.call(void 0, node, this.toLocal(id, p)) : null;
|
|
7117
7407
|
if (seg && seg.distance <= this.tolerance()) this.insertAnchorAt(id, p);
|
|
7118
7408
|
}
|
|
7119
7409
|
return;
|
|
@@ -7207,7 +7497,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
7207
7497
|
this.finishPath();
|
|
7208
7498
|
return true;
|
|
7209
7499
|
}
|
|
7210
|
-
if (this.tool === "select" && this.selection.length === 1 && _optionalChain([this, 'access',
|
|
7500
|
+
if (this.tool === "select" && this.selection.length === 1 && _optionalChain([this, 'access', _245 => _245.getNode, 'call', _246 => _246(this.selection[0]), 'optionalAccess', _247 => _247.type]) === "path") {
|
|
7211
7501
|
this.tool = "direct";
|
|
7212
7502
|
this.editingId = this.selection[0];
|
|
7213
7503
|
this.notify();
|
|
@@ -7262,11 +7552,11 @@ function inkShapeLabel(shape) {
|
|
|
7262
7552
|
function inkShapeSubpath(shape) {
|
|
7263
7553
|
switch (shape.kind) {
|
|
7264
7554
|
case "line":
|
|
7265
|
-
return
|
|
7555
|
+
return _chunkKANRAHTLcjs.lineSubpath.call(void 0, { x: shape.a[0], y: shape.a[1] }, { x: shape.b[0], y: shape.b[1] });
|
|
7266
7556
|
case "rect":
|
|
7267
|
-
return
|
|
7557
|
+
return _chunkKANRAHTLcjs.rectSubpath.call(void 0, shape);
|
|
7268
7558
|
case "ellipse":
|
|
7269
|
-
return
|
|
7559
|
+
return _chunkKANRAHTLcjs.ellipseSubpath.call(void 0, shape);
|
|
7270
7560
|
case "polygon":
|
|
7271
7561
|
return { anchors: shape.points.map(([x, y]) => ({ x, y })), closed: true };
|
|
7272
7562
|
}
|
|
@@ -7300,16 +7590,20 @@ function scaleFor(handle, b, p, mods = {}) {
|
|
|
7300
7590
|
return { sx, sy, origin };
|
|
7301
7591
|
}
|
|
7302
7592
|
function withStyle(node, style) {
|
|
7303
|
-
const
|
|
7593
|
+
const { fills, strokes, ...shorthand } = style;
|
|
7594
|
+
let next = { ...node, ...shorthand };
|
|
7304
7595
|
if ("strokeWidthProfile" in style) {
|
|
7305
|
-
const p = style.strokeWidthProfile ?
|
|
7596
|
+
const p = style.strokeWidthProfile ? _chunkKANRAHTLcjs.sanitizeWidthProfile.call(void 0, style.strokeWidthProfile) : [];
|
|
7306
7597
|
if (p.length) next.strokeWidthProfile = p;
|
|
7307
7598
|
else delete next.strokeWidthProfile;
|
|
7308
7599
|
}
|
|
7600
|
+
next = _chunkKANRAHTLcjs.normalizeVectorPaintStacks.call(void 0, next, "shorthand");
|
|
7601
|
+
if (fills !== void 0) next = _chunkKANRAHTLcjs.withVectorFills.call(void 0, next, _chunkKANRAHTLcjs.sanitizeVectorFills.call(void 0, _nullishCoalesce(fills, () => ( []))));
|
|
7602
|
+
if (strokes !== void 0) next = _chunkKANRAHTLcjs.withVectorStrokes.call(void 0, next, _chunkKANRAHTLcjs.sanitizeVectorStrokes.call(void 0, _nullishCoalesce(strokes, () => ( []))));
|
|
7309
7603
|
return next;
|
|
7310
7604
|
}
|
|
7311
7605
|
function hiddenOrLocked(nodes, id) {
|
|
7312
|
-
const loc =
|
|
7606
|
+
const loc = _chunkKANRAHTLcjs.locateVectorNode.call(void 0, nodes, id);
|
|
7313
7607
|
if (!loc) return false;
|
|
7314
7608
|
const n = loc.list[loc.index];
|
|
7315
7609
|
if (n.locked || n.visible === false) return true;
|
|
@@ -7322,44 +7616,106 @@ function pencilPressureProfile(points, pressures) {
|
|
|
7322
7616
|
for (let i = 1; i < n; i++) s.push(s[i - 1] + Math.hypot(points[i][0] - points[i - 1][0], points[i][1] - points[i - 1][1]));
|
|
7323
7617
|
const total = s[n - 1];
|
|
7324
7618
|
if (!(total > 0)) return [];
|
|
7325
|
-
return
|
|
7619
|
+
return _chunkKANRAHTLcjs.pressureWidthProfile.call(void 0, s.map((d, i) => ({ t: d / total, pressure: pressures[i] })));
|
|
7326
7620
|
}
|
|
7327
7621
|
|
|
7328
7622
|
// src/vector/render.ts
|
|
7329
7623
|
var fmt2 = (n) => Math.round(n * 100) / 100;
|
|
7330
7624
|
var fmtMatrix = (m) => `matrix(${m.map((n) => Math.round(n * 1e6) / 1e6).join(" ")})`;
|
|
7331
7625
|
var VECTOR_BUILDER_HATCH_GAP = 6;
|
|
7332
|
-
function
|
|
7626
|
+
function nodeFinish(node, filters, idPrefix) {
|
|
7627
|
+
const out = {};
|
|
7628
|
+
const blend = _chunkKANRAHTLcjs.vectorBlendModeCss.call(void 0, node.blendMode);
|
|
7629
|
+
if (blend) out.blendMode = blend;
|
|
7630
|
+
const filter = _chunkKANRAHTLcjs.vectorNodeFilterSvg.call(void 0, node, `${idPrefix}filter-${node.id}`);
|
|
7631
|
+
if (filter) {
|
|
7632
|
+
filters.push(filter);
|
|
7633
|
+
out.filter = `url(#${filter.id})`;
|
|
7634
|
+
}
|
|
7635
|
+
return out;
|
|
7636
|
+
}
|
|
7637
|
+
function lineStyle(node) {
|
|
7638
|
+
return {
|
|
7639
|
+
strokeWidth: _nullishCoalesce(node.strokeWidth, () => ( 1)),
|
|
7640
|
+
...node.strokeLinecap ? { strokeLinecap: node.strokeLinecap } : {},
|
|
7641
|
+
...node.strokeLinejoin ? { strokeLinejoin: node.strokeLinejoin } : {},
|
|
7642
|
+
..._optionalChain([node, 'access', _248 => _248.strokeDasharray, 'optionalAccess', _249 => _249.length]) ? { strokeDasharray: node.strokeDasharray.join(" ") } : {}
|
|
7643
|
+
};
|
|
7644
|
+
}
|
|
7645
|
+
function renderLayers(node, defs, idPrefix) {
|
|
7646
|
+
const out = [];
|
|
7647
|
+
for (const l of _chunkKANRAHTLcjs.vectorPaintLayerNodes.call(void 0, node)) {
|
|
7648
|
+
if (!l.drawn) continue;
|
|
7649
|
+
const role = l.kind;
|
|
7650
|
+
const paint = _chunkKANRAHTLcjs.vectorPaintToSvg.call(void 0, l.layer.paint, `${idPrefix}${role}-${node.id}-${l.index}`, { node: l.node, ...role === "stroke" ? { role } : {} });
|
|
7651
|
+
defs.push(...paint.defs);
|
|
7652
|
+
const blend = _chunkKANRAHTLcjs.vectorBlendModeCss.call(void 0, l.layer.blendMode);
|
|
7653
|
+
const base = { kind: role, index: l.index, opacity: _nullishCoalesce(l.layer.opacity, () => ( 1)), ...blend ? { blendMode: blend } : {} };
|
|
7654
|
+
if (role === "fill") out.push({ ...base, fill: paint.value, stroke: "none", strokeWidth: 0 });
|
|
7655
|
+
else {
|
|
7656
|
+
const strokeParts = _chunkKANRAHTLcjs.vectorStrokeSvgParts.call(void 0, l.node, `${idPrefix}clip-${node.id}-${l.index}`);
|
|
7657
|
+
out.push({ ...base, fill: "none", stroke: paint.value, ...lineStyle(l.node), ...strokeParts ? { strokeParts } : {} });
|
|
7658
|
+
}
|
|
7659
|
+
}
|
|
7660
|
+
return out;
|
|
7661
|
+
}
|
|
7662
|
+
function renderNode(stored, defs, filters, idPrefix) {
|
|
7333
7663
|
if (stored.visible === false) return null;
|
|
7334
|
-
const node =
|
|
7664
|
+
const node = _chunkKANRAHTLcjs.expandVectorAppearance.call(void 0, stored);
|
|
7335
7665
|
if (node.type === "group") {
|
|
7336
|
-
const children = node.children.map((c) => renderNode(c, defs, idPrefix)).filter((c) => !!c);
|
|
7337
|
-
return {
|
|
7666
|
+
const children = node.children.map((c) => renderNode(c, defs, filters, idPrefix)).filter((c) => !!c);
|
|
7667
|
+
return {
|
|
7668
|
+
kind: "group",
|
|
7669
|
+
id: node.id,
|
|
7670
|
+
...node.transform ? { transform: fmtMatrix(node.transform) } : {},
|
|
7671
|
+
opacity: _nullishCoalesce(node.opacity, () => ( 1)),
|
|
7672
|
+
...nodeFinish(node, filters, idPrefix),
|
|
7673
|
+
children
|
|
7674
|
+
};
|
|
7338
7675
|
}
|
|
7339
|
-
const
|
|
7340
|
-
const
|
|
7341
|
-
defs.push(...fill.defs, ...stroke.defs);
|
|
7342
|
-
const strokeParts = stroke.value !== "none" ? _chunkJF5PXN7Wcjs.vectorStrokeSvgParts.call(void 0, node, `${idPrefix}clip-${node.id}`) : void 0;
|
|
7343
|
-
return {
|
|
7676
|
+
const finish = nodeFinish(node, filters, idPrefix);
|
|
7677
|
+
const common = {
|
|
7344
7678
|
kind: "path",
|
|
7345
7679
|
id: node.id,
|
|
7346
7680
|
...node.transform ? { transform: fmtMatrix(node.transform) } : {},
|
|
7681
|
+
d: _chunkKANRAHTLcjs.vectorPathData.call(void 0, node),
|
|
7682
|
+
fillRule: _nullishCoalesce(node.fillRule, () => ( "nonzero")),
|
|
7683
|
+
opacity: _nullishCoalesce(node.opacity, () => ( 1)),
|
|
7684
|
+
...finish
|
|
7685
|
+
};
|
|
7686
|
+
if (_chunkKANRAHTLcjs.needsVectorPaintLayers.call(void 0, node)) {
|
|
7687
|
+
const layers = renderLayers(node, defs, idPrefix);
|
|
7688
|
+
const fill2 = layers.filter((l) => l.kind === "fill").at(-1);
|
|
7689
|
+
const stroke2 = layers.filter((l) => l.kind === "stroke").at(-1);
|
|
7690
|
+
return {
|
|
7691
|
+
...common,
|
|
7692
|
+
fill: _nullishCoalesce(_optionalChain([fill2, 'optionalAccess', _250 => _250.fill]), () => ( "none")),
|
|
7693
|
+
stroke: _nullishCoalesce(_optionalChain([stroke2, 'optionalAccess', _251 => _251.stroke]), () => ( "none")),
|
|
7694
|
+
strokeWidth: _nullishCoalesce(_nullishCoalesce(_optionalChain([stroke2, 'optionalAccess', _252 => _252.strokeWidth]), () => ( node.strokeWidth)), () => ( 1)),
|
|
7695
|
+
..._optionalChain([stroke2, 'optionalAccess', _253 => _253.strokeLinecap]) ? { strokeLinecap: stroke2.strokeLinecap } : {},
|
|
7696
|
+
..._optionalChain([stroke2, 'optionalAccess', _254 => _254.strokeLinejoin]) ? { strokeLinejoin: stroke2.strokeLinejoin } : {},
|
|
7697
|
+
..._optionalChain([stroke2, 'optionalAccess', _255 => _255.strokeDasharray]) ? { strokeDasharray: stroke2.strokeDasharray } : {},
|
|
7698
|
+
..._optionalChain([stroke2, 'optionalAccess', _256 => _256.strokeParts]) ? { strokeParts: stroke2.strokeParts } : {},
|
|
7699
|
+
layers
|
|
7700
|
+
};
|
|
7701
|
+
}
|
|
7702
|
+
const fill = _chunkKANRAHTLcjs.vectorPaintToSvg.call(void 0, node.fill, `${idPrefix}fill-${node.id}`, { node });
|
|
7703
|
+
const stroke = _chunkKANRAHTLcjs.vectorPaintToSvg.call(void 0, node.stroke, `${idPrefix}stroke-${node.id}`, { node, role: "stroke" });
|
|
7704
|
+
defs.push(...fill.defs, ...stroke.defs);
|
|
7705
|
+
const strokeParts = stroke.value !== "none" ? _chunkKANRAHTLcjs.vectorStrokeSvgParts.call(void 0, node, `${idPrefix}clip-${node.id}`) : void 0;
|
|
7706
|
+
return {
|
|
7707
|
+
...common,
|
|
7347
7708
|
...strokeParts ? { strokeParts } : {},
|
|
7348
|
-
d: _chunkJF5PXN7Wcjs.vectorPathData.call(void 0, node),
|
|
7349
7709
|
fill: fill.value,
|
|
7350
7710
|
stroke: stroke.value,
|
|
7351
|
-
|
|
7352
|
-
...node.strokeLinecap ? { strokeLinecap: node.strokeLinecap } : {},
|
|
7353
|
-
...node.strokeLinejoin ? { strokeLinejoin: node.strokeLinejoin } : {},
|
|
7354
|
-
..._optionalChain([node, 'access', _249 => _249.strokeDasharray, 'optionalAccess', _250 => _250.length]) ? { strokeDasharray: node.strokeDasharray.join(" ") } : {},
|
|
7355
|
-
fillRule: _nullishCoalesce(node.fillRule, () => ( "nonzero")),
|
|
7356
|
-
opacity: _nullishCoalesce(node.opacity, () => ( 1))
|
|
7711
|
+
...lineStyle(node)
|
|
7357
7712
|
};
|
|
7358
7713
|
}
|
|
7359
7714
|
function getVectorSceneRenderData(state, options = {}) {
|
|
7360
7715
|
const defs = [];
|
|
7716
|
+
const filters = [];
|
|
7361
7717
|
const prefix = _nullishCoalesce(options.idPrefix, () => ( "ve-"));
|
|
7362
|
-
const nodes = state.document.nodes.map((n) => renderNode(n, defs, prefix)).filter((n) => !!n);
|
|
7718
|
+
const nodes = state.document.nodes.map((n) => renderNode(n, defs, filters, prefix)).filter((n) => !!n);
|
|
7363
7719
|
const v = state.viewport;
|
|
7364
7720
|
return {
|
|
7365
7721
|
transform: `translate(${fmt2(v.x)} ${fmt2(v.y)}) scale(${v.zoom})`,
|
|
@@ -7367,6 +7723,7 @@ function getVectorSceneRenderData(state, options = {}) {
|
|
|
7367
7723
|
height: state.document.height,
|
|
7368
7724
|
...state.document.background ? { background: state.document.background } : {},
|
|
7369
7725
|
defs,
|
|
7726
|
+
filters,
|
|
7370
7727
|
nodes
|
|
7371
7728
|
};
|
|
7372
7729
|
}
|
|
@@ -7374,17 +7731,17 @@ var toScreen = (state, p) => ({ x: p.x * state.viewport.zoom + state.viewport.x,
|
|
|
7374
7731
|
function screenOutline(state, node, entered) {
|
|
7375
7732
|
const v = state.viewport;
|
|
7376
7733
|
const view = [v.zoom, 0, 0, v.zoom, v.x, v.y];
|
|
7377
|
-
const parent = _nullishCoalesce(
|
|
7734
|
+
const parent = _nullishCoalesce(_chunkKANRAHTLcjs.vectorParentMatrix.call(void 0, state.document.nodes, node.id), () => ( _chunkDWGZUSEScjs.IDENTITY_MATRIX));
|
|
7378
7735
|
return outlinePaths(node, parent, entered).map((path) => _chunkXGD3FSNCcjs.bezierPathToSvg.call(void 0, _chunkXGD3FSNCcjs.transformBezierPath.call(void 0, path, view), { precision: 2 })).join(" ");
|
|
7379
7736
|
}
|
|
7380
7737
|
function outlinePaths(node, parent, entered) {
|
|
7381
|
-
if (node.type === "path") return [
|
|
7382
|
-
const m = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0,
|
|
7383
|
-
if (
|
|
7738
|
+
if (node.type === "path") return [_chunkKANRAHTLcjs.vectorPathWorldBezier.call(void 0, node, parent, { effects: false })];
|
|
7739
|
+
const m = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, _chunkKANRAHTLcjs.nodeMatrix.call(void 0, node), parent);
|
|
7740
|
+
if (_chunkKANRAHTLcjs.hasOwnVectorAppearance.call(void 0, node) && !entered.has(node.id)) return [_chunkXGD3FSNCcjs.transformBezierPath.call(void 0, _chunkKANRAHTLcjs.vectorAppearanceOutline.call(void 0, node), m)];
|
|
7384
7741
|
return node.children.filter((c) => c.visible !== false).flatMap((c) => outlinePaths(c, m, entered));
|
|
7385
7742
|
}
|
|
7386
7743
|
function getVectorEnteredGroups(state) {
|
|
7387
|
-
return
|
|
7744
|
+
return _chunkKANRAHTLcjs.vectorEnteredGroups.call(void 0, state.document.nodes, state.editingId ? [...state.selection, state.editingId] : state.selection);
|
|
7388
7745
|
}
|
|
7389
7746
|
function collect(node) {
|
|
7390
7747
|
if (node.type === "path") return [node];
|
|
@@ -7398,16 +7755,16 @@ function getVectorOverlayRenderData(state) {
|
|
|
7398
7755
|
const seen = /* @__PURE__ */ new Set();
|
|
7399
7756
|
const outline = (id, selected2) => {
|
|
7400
7757
|
if (seen.has(id)) return;
|
|
7401
|
-
const node =
|
|
7758
|
+
const node = _chunkKANRAHTLcjs.findVectorNode.call(void 0, doc.nodes, id);
|
|
7402
7759
|
if (!node || node.visible === false) return;
|
|
7403
7760
|
seen.add(id);
|
|
7404
7761
|
outlines.push({ id, d: screenOutline(state, node, entered), selected: selected2 });
|
|
7405
7762
|
};
|
|
7406
7763
|
for (const id of state.selection) outline(id, true);
|
|
7407
7764
|
if (state.editingId) outline(state.editingId, true);
|
|
7408
|
-
if (_optionalChain([state, 'access',
|
|
7765
|
+
if (_optionalChain([state, 'access', _257 => _257.hover, 'optionalAccess', _258 => _258.nodeId]) && !state.interaction) outline(state.hover.nodeId, false);
|
|
7409
7766
|
let selectionBox = null;
|
|
7410
|
-
if (state.tool === "select" && state.selectionFrame && _optionalChain([state, 'access',
|
|
7767
|
+
if (state.tool === "select" && state.selectionFrame && _optionalChain([state, 'access', _259 => _259.interaction, 'optionalAccess', _260 => _260.type]) !== "marquee" && _optionalChain([state, 'access', _261 => _261.interaction, 'optionalAccess', _262 => _262.type]) !== "distort") {
|
|
7411
7768
|
const g = getVectorSelectionBoxGeometry(state.selectionFrame, state.viewport);
|
|
7412
7769
|
selectionBox = { ...g.box, angle: g.angle, transform: g.transform, corners: g.corners, handles: g.handles, freeDistort: state.freeDistort };
|
|
7413
7770
|
}
|
|
@@ -7417,9 +7774,9 @@ function getVectorOverlayRenderData(state) {
|
|
|
7417
7774
|
const a = getAnchorWorld(doc, ref);
|
|
7418
7775
|
const s = toScreen(state, a);
|
|
7419
7776
|
const closes = !!state.pen && state.pen.nodeId === ref.nodeId && state.pen.subpath === ref.subpath && ref.index === 0;
|
|
7420
|
-
return { ref, x: s.x, y: s.y, type: _nullishCoalesce(a.type, () => (
|
|
7777
|
+
return { ref, x: s.x, y: s.y, type: _nullishCoalesce(a.type, () => ( _chunkKANRAHTLcjs.inferAnchorType.call(void 0, a))), selected: selected(ref), hovered: sameAnchor(_optionalChain([state, 'access', _263 => _263.hover, 'optionalAccess', _264 => _264.anchor]), ref), closes };
|
|
7421
7778
|
});
|
|
7422
|
-
if (state.tool === "pen" && !state.pen && _optionalChain([state, 'access',
|
|
7779
|
+
if (state.tool === "pen" && !state.pen && _optionalChain([state, 'access', _265 => _265.hover, 'optionalAccess', _266 => _266.anchor])) {
|
|
7423
7780
|
const a = getAnchorWorld(doc, state.hover.anchor);
|
|
7424
7781
|
if (a) {
|
|
7425
7782
|
const s = toScreen(state, a);
|
|
@@ -7428,23 +7785,23 @@ function getVectorOverlayRenderData(state) {
|
|
|
7428
7785
|
}
|
|
7429
7786
|
const handles = getVisibleHandles(state).flatMap((ref) => {
|
|
7430
7787
|
const a = getAnchorWorld(doc, ref);
|
|
7431
|
-
const h = _optionalChain([a, 'optionalAccess',
|
|
7788
|
+
const h = _optionalChain([a, 'optionalAccess', _267 => _267[ref.handle]]);
|
|
7432
7789
|
if (!a || !h) return [];
|
|
7433
7790
|
const s = toScreen(state, h);
|
|
7434
7791
|
const sa = toScreen(state, a);
|
|
7435
|
-
const hovered = !!_optionalChain([state, 'access',
|
|
7792
|
+
const hovered = !!_optionalChain([state, 'access', _268 => _268.hover, 'optionalAccess', _269 => _269.handle]) && sameAnchor(state.hover.handle, ref) && state.hover.handle.handle === ref.handle;
|
|
7436
7793
|
return [{ ref, x: s.x, y: s.y, anchorX: sa.x, anchorY: sa.y, hovered }];
|
|
7437
7794
|
});
|
|
7438
7795
|
let marquee = null;
|
|
7439
|
-
if (_optionalChain([state, 'access',
|
|
7796
|
+
if (_optionalChain([state, 'access', _270 => _270.interaction, 'optionalAccess', _271 => _271.type]) === "marquee") {
|
|
7440
7797
|
const b = state.interaction.bounds;
|
|
7441
7798
|
const tl = toScreen(state, b);
|
|
7442
7799
|
marquee = { x: tl.x, y: tl.y, width: b.width * z, height: b.height * z };
|
|
7443
7800
|
}
|
|
7444
7801
|
let penPreview = null;
|
|
7445
7802
|
if (state.tool === "pen" && state.pen && state.pointer && !state.interaction) {
|
|
7446
|
-
const node =
|
|
7447
|
-
const sp = _optionalChain([node, 'optionalAccess',
|
|
7803
|
+
const node = _chunkKANRAHTLcjs.findVectorNode.call(void 0, doc.nodes, state.pen.nodeId);
|
|
7804
|
+
const sp = _optionalChain([node, 'optionalAccess', _272 => _272.type]) === "path" ? node.subpaths[state.pen.subpath] : void 0;
|
|
7448
7805
|
const last = sp ? getAnchorWorld(doc, { nodeId: state.pen.nodeId, subpath: state.pen.subpath, index: sp.anchors.length - 1 }) : void 0;
|
|
7449
7806
|
if (last) {
|
|
7450
7807
|
const a = toScreen(state, last);
|
|
@@ -7457,10 +7814,10 @@ function getVectorOverlayRenderData(state) {
|
|
|
7457
7814
|
const artboard = { x: origin.x, y: origin.y, width: doc.width * z, height: doc.height * z };
|
|
7458
7815
|
let status = null;
|
|
7459
7816
|
const it = state.interaction;
|
|
7460
|
-
if (_optionalChain([it, 'optionalAccess',
|
|
7461
|
-
else if (_optionalChain([it, 'optionalAccess',
|
|
7462
|
-
else if (_optionalChain([it, 'optionalAccess',
|
|
7463
|
-
const b = it.type === "draw" ?
|
|
7817
|
+
if (_optionalChain([it, 'optionalAccess', _273 => _273.type]) === "rotate") status = `${Math.round(it.angle)}\xB0`;
|
|
7818
|
+
else if (_optionalChain([it, 'optionalAccess', _274 => _274.type]) === "move" || _optionalChain([it, 'optionalAccess', _275 => _275.type]) === "anchors") status = `\u0394 ${fmt2(it.dx)}, ${fmt2(it.dy)}`;
|
|
7819
|
+
else if (_optionalChain([it, 'optionalAccess', _276 => _276.type]) === "scale" || _optionalChain([it, 'optionalAccess', _277 => _277.type]) === "draw") {
|
|
7820
|
+
const b = it.type === "draw" ? _chunkKANRAHTLcjs.findVectorNode.call(void 0, doc.nodes, it.nodeId) ? _chunkKANRAHTLcjs.vectorNodeBounds.call(void 0, _chunkKANRAHTLcjs.findVectorNode.call(void 0, doc.nodes, it.nodeId)) : null : state.selectionFrame;
|
|
7464
7821
|
if (b) status = `W ${fmt2(b.width)} \xD7 H ${fmt2(b.height)}`;
|
|
7465
7822
|
}
|
|
7466
7823
|
const guides = { lines: [], labels: [] };
|
|
@@ -7476,24 +7833,24 @@ function getVectorOverlayRenderData(state) {
|
|
|
7476
7833
|
}
|
|
7477
7834
|
}
|
|
7478
7835
|
let toolStroke = null;
|
|
7479
|
-
if (_optionalChain([it, 'optionalAccess',
|
|
7836
|
+
if (_optionalChain([it, 'optionalAccess', _278 => _278.type]) === "stroke") {
|
|
7480
7837
|
const pts = it.points.map((q) => toScreen(state, q));
|
|
7481
7838
|
const d = pts.map((q, i) => `${i ? "L" : "M"}${fmt2(q.x)} ${fmt2(q.y)}`).join("") + (pts.length === 1 ? `L${fmt2(pts[0].x)} ${fmt2(pts[0].y)}` : "");
|
|
7482
7839
|
toolStroke = { tool: it.tool, d, width: fmt2(it.width * z) };
|
|
7483
7840
|
}
|
|
7484
7841
|
let pencilString = null;
|
|
7485
|
-
if (_optionalChain([it, 'optionalAccess',
|
|
7842
|
+
if (_optionalChain([it, 'optionalAccess', _279 => _279.type]) === "draw" && it.string) {
|
|
7486
7843
|
const a = toScreen(state, it.string[0]);
|
|
7487
7844
|
const b = toScreen(state, it.string[1]);
|
|
7488
7845
|
pencilString = { x1: fmt2(a.x), y1: fmt2(a.y), x2: fmt2(b.x), y2: fmt2(b.y) };
|
|
7489
7846
|
}
|
|
7490
|
-
const dragged = _optionalChain([it, 'optionalAccess',
|
|
7847
|
+
const dragged = _optionalChain([it, 'optionalAccess', _280 => _280.type]) === "corner" ? it.ref : null;
|
|
7491
7848
|
const cornerWidgets = getVectorCornerWidgets(state).map((w) => {
|
|
7492
7849
|
const s = toScreen(state, w);
|
|
7493
|
-
return { ref: w.ref, x: fmt2(s.x), y: fmt2(s.y), radius: w.radius, kind: w.kind, hovered: sameAnchor(_optionalChain([state, 'access',
|
|
7850
|
+
return { ref: w.ref, x: fmt2(s.x), y: fmt2(s.y), radius: w.radius, kind: w.kind, hovered: sameAnchor(_optionalChain([state, 'access', _281 => _281.hover, 'optionalAccess', _282 => _282.corner]), w.ref), active: !!dragged };
|
|
7494
7851
|
});
|
|
7495
|
-
if (_optionalChain([it, 'optionalAccess',
|
|
7496
|
-
const cutPoint = state.tool === "scissors" && _optionalChain([state, 'access',
|
|
7852
|
+
if (_optionalChain([it, 'optionalAccess', _283 => _283.type]) === "corner") status = `R ${fmt2(it.radius)}`;
|
|
7853
|
+
const cutPoint = state.tool === "scissors" && _optionalChain([state, 'access', _284 => _284.hover, 'optionalAccess', _285 => _285.segment]) && !it ? (({ x, y }) => ({ x: fmt2(x), y: fmt2(y) }))(toScreen(state, state.hover.segment.point)) : null;
|
|
7497
7854
|
const sc = (p) => {
|
|
7498
7855
|
const q = toScreen(state, p);
|
|
7499
7856
|
return { x: fmt2(q.x), y: fmt2(q.y) };
|
|
@@ -7501,13 +7858,13 @@ function getVectorOverlayRenderData(state) {
|
|
|
7501
7858
|
const sameWidth = (a, b) => !!a && a.nodeId === b.nodeId && a.index === b.index;
|
|
7502
7859
|
const widthPoints = getVectorWidthHandles(state).map((h) => {
|
|
7503
7860
|
const c = sc(h);
|
|
7504
|
-
const hw = _optionalChain([state, 'access',
|
|
7861
|
+
const hw = _optionalChain([state, 'access', _286 => _286.hover, 'optionalAccess', _287 => _287.widthPoint]);
|
|
7505
7862
|
const hovered = hw && sameWidth(hw, h.ref) && hw.subpath === h.ref.subpath ? hw.part : null;
|
|
7506
|
-
return { ref: h.ref, x: c.x, y: c.y, left: sc(h.left), right: sc(h.right), selected: h.selected, hovered, active: _optionalChain([it, 'optionalAccess',
|
|
7863
|
+
return { ref: h.ref, x: c.x, y: c.y, left: sc(h.left), right: sc(h.right), selected: h.selected, hovered, active: _optionalChain([it, 'optionalAccess', _288 => _288.type]) === "width" && sameWidth(it.ref, h.ref) };
|
|
7507
7864
|
});
|
|
7508
|
-
const spot = state.tool === "width" && !it ? _optionalChain([state, 'access',
|
|
7865
|
+
const spot = state.tool === "width" && !it ? _optionalChain([state, 'access', _289 => _289.hover, 'optionalAccess', _290 => _290.strokeSpot]) : null;
|
|
7509
7866
|
const widthSpot = spot ? { ...sc(spot.point), left: sc(spot.left), right: sc(spot.right) } : null;
|
|
7510
|
-
if (_optionalChain([it, 'optionalAccess',
|
|
7867
|
+
if (_optionalChain([it, 'optionalAccess', _291 => _291.type]) === "width") status = it.mode === "move" ? "Move width point" : it.mode === "copy" ? "Copy width point" : `W ${fmt2(it.width)}`;
|
|
7511
7868
|
let builder = null;
|
|
7512
7869
|
if (state.builder) {
|
|
7513
7870
|
const v = state.viewport;
|
|
@@ -7523,7 +7880,7 @@ function getVectorOverlayRenderData(state) {
|
|
|
7523
7880
|
lines: state.builder.lines.map((l) => svg(_chunkXGD3FSNCcjs.transformBezierPath.call(void 0, l, view))),
|
|
7524
7881
|
trail
|
|
7525
7882
|
};
|
|
7526
|
-
if (state.builder.mode !== "fill" && _optionalChain([it, 'optionalAccess',
|
|
7883
|
+
if (state.builder.mode !== "fill" && _optionalChain([it, 'optionalAccess', _292 => _292.type]) === "builder") {
|
|
7527
7884
|
const n = state.builder.faces.length;
|
|
7528
7885
|
status = state.builder.mode === "erase" ? `Delete ${n} ${n === 1 ? "face" : "faces"}` : `Merge ${n} ${n === 1 ? "face" : "faces"}`;
|
|
7529
7886
|
}
|
|
@@ -7534,10 +7891,10 @@ function getVectorOverlayRenderData(state) {
|
|
|
7534
7891
|
if (state.tool === "gradient") {
|
|
7535
7892
|
gradient = gradientOverlay(state);
|
|
7536
7893
|
if (!gradient && !it) status = "Drag across a shape to set a gradient";
|
|
7537
|
-
else if (_optionalChain([it, 'optionalAccess',
|
|
7894
|
+
else if (_optionalChain([it, 'optionalAccess', _293 => _293.type]) === "gradient" && it.removing) status = "Release to delete the stop";
|
|
7538
7895
|
}
|
|
7539
7896
|
let distort = null;
|
|
7540
|
-
if (_optionalChain([it, 'optionalAccess',
|
|
7897
|
+
if (_optionalChain([it, 'optionalAccess', _294 => _294.type]) === "distort") {
|
|
7541
7898
|
const corners2 = it.corners.map(sc);
|
|
7542
7899
|
distort = { mode: it.mode, corners: corners2, d: corners2.map((c, i) => `${i ? "L" : "M"}${c.x} ${c.y}`).join("") + "Z" };
|
|
7543
7900
|
status = it.mode === "skew" ? "Skew" : it.mode === "perspective" ? "Perspective" : "Distort";
|
|
@@ -7557,9 +7914,9 @@ function envelopeOverlay(state) {
|
|
|
7557
7914
|
const [a, b, cc, d] = c.map(sc);
|
|
7558
7915
|
return `M${a.x} ${a.y}C${b.x} ${b.y} ${cc.x} ${cc.y} ${d.x} ${d.y}`;
|
|
7559
7916
|
}).join("");
|
|
7560
|
-
const hover = _optionalChain([state, 'access',
|
|
7917
|
+
const hover = _optionalChain([state, 'access', _295 => _295.hover, 'optionalAccess', _296 => _296.envelope, 'optionalAccess', _297 => _297.nodeId]) === target.node.id ? state.hover.envelope.index : void 0;
|
|
7561
7918
|
const it = state.interaction;
|
|
7562
|
-
const active = _optionalChain([it, 'optionalAccess',
|
|
7919
|
+
const active = _optionalChain([it, 'optionalAccess', _298 => _298.type]) === "envelope" && it.nodeId === target.node.id ? it.index : void 0;
|
|
7563
7920
|
const pts = _chunkDWGZUSEScjs.warpMeshEditPoints.call(void 0, mesh);
|
|
7564
7921
|
return {
|
|
7565
7922
|
nodeId: target.node.id,
|
|
@@ -7576,30 +7933,30 @@ var VECTOR_ENVELOPE_STYLE_OPTIONS = [
|
|
|
7576
7933
|
{ value: "mesh", label: "Mesh" }
|
|
7577
7934
|
];
|
|
7578
7935
|
function getVectorEnvelopePanel(state) {
|
|
7579
|
-
const nodes = state.selection.map((id) =>
|
|
7936
|
+
const nodes = state.selection.map((id) => _chunkKANRAHTLcjs.findVectorNode.call(void 0, state.document.nodes, id)).filter((n) => !!n && !n.blendStep);
|
|
7580
7937
|
if (!nodes.length) return null;
|
|
7581
7938
|
const one = nodes.length === 1 ? nodes[0] : null;
|
|
7582
|
-
const first = _optionalChain([one, 'optionalAccess',
|
|
7939
|
+
const first = _optionalChain([one, 'optionalAccess', _299 => _299.effects, 'optionalAccess', _300 => _300.find, 'call', _301 => _301((e) => e.type === "envelope")]);
|
|
7583
7940
|
const order = /* @__PURE__ */ new Map();
|
|
7584
|
-
|
|
7941
|
+
_chunkKANRAHTLcjs.walkVectorNodes.call(void 0, state.document.nodes, (n) => order.set(n.id, order.size));
|
|
7585
7942
|
const top = nodes.length > 1 ? nodes.slice().sort((a, b) => (_nullishCoalesce(order.get(a.id), () => ( 0))) - (_nullishCoalesce(order.get(b.id), () => ( 0))))[nodes.length - 1] : null;
|
|
7586
7943
|
return {
|
|
7587
|
-
nodeId: _nullishCoalesce(_optionalChain([one, 'optionalAccess',
|
|
7944
|
+
nodeId: _nullishCoalesce(_optionalChain([one, 'optionalAccess', _302 => _302.id]), () => ( null)),
|
|
7588
7945
|
count: nodes.length,
|
|
7589
|
-
envelope: _optionalChain([first, 'optionalAccess',
|
|
7946
|
+
envelope: _optionalChain([first, 'optionalAccess', _303 => _303.type]) === "envelope" ? { effectId: first.id, enabled: first.enabled !== false, params: first.params } : null,
|
|
7590
7947
|
canMake: nodes.some((n) => !n.locked),
|
|
7591
|
-
canMakeWithTopObject: _optionalChain([top, 'optionalAccess',
|
|
7592
|
-
canRelease: nodes.some((n) => !n.locked && !!_optionalChain([n, 'access',
|
|
7948
|
+
canMakeWithTopObject: _optionalChain([top, 'optionalAccess', _304 => _304.type]) === "path" && top.subpaths.some((sp) => sp.closed && sp.anchors.length > 1),
|
|
7949
|
+
canRelease: nodes.some((n) => !n.locked && !!_optionalChain([n, 'access', _305 => _305.effects, 'optionalAccess', _306 => _306.some, 'call', _307 => _307((e) => e.type === "envelope")]))
|
|
7593
7950
|
};
|
|
7594
7951
|
}
|
|
7595
7952
|
function gradientOverlay(state) {
|
|
7596
|
-
const a = getVectorGradientAnnotator(state.document, state.selection, state.viewport, state.gradientEdit.target);
|
|
7953
|
+
const a = getVectorGradientAnnotator(state.document, state.selection, state.viewport, state.gradientEdit.target, _nullishCoalesce(state.gradientEdit.layer, () => ( null)));
|
|
7597
7954
|
if (!a) return null;
|
|
7598
|
-
const hover = state.interaction ? null : _optionalChain([state, 'access',
|
|
7599
|
-
const handleHovered = (h) => _optionalChain([hover, 'optionalAccess',
|
|
7955
|
+
const hover = state.interaction ? null : _optionalChain([state, 'access', _308 => _308.hover, 'optionalAccess', _309 => _309.gradient]);
|
|
7956
|
+
const handleHovered = (h) => _optionalChain([hover, 'optionalAccess', _310 => _310.kind]) === "handle" && hover.handle === h;
|
|
7600
7957
|
const pt = (p) => ({ x: fmt2(p.x), y: fmt2(p.y) });
|
|
7601
|
-
const centred =
|
|
7602
|
-
const removing = _optionalChain([state, 'access',
|
|
7958
|
+
const centred = _chunkKANRAHTLcjs.isCentredVectorGradient.call(void 0, a.gradient.type);
|
|
7959
|
+
const removing = _optionalChain([state, 'access', _311 => _311.interaction, 'optionalAccess', _312 => _312.type]) === "gradient" && !!state.interaction.removing;
|
|
7603
7960
|
return {
|
|
7604
7961
|
nodeId: a.nodeId,
|
|
7605
7962
|
type: a.gradient.type,
|
|
@@ -7615,9 +7972,9 @@ function gradientOverlay(state) {
|
|
|
7615
7972
|
color: s.color,
|
|
7616
7973
|
opacity: _nullishCoalesce(s.opacity, () => ( 1)),
|
|
7617
7974
|
selected: state.gradientEdit.stop === s.index,
|
|
7618
|
-
hovered: _optionalChain([hover, 'optionalAccess',
|
|
7975
|
+
hovered: _optionalChain([hover, 'optionalAccess', _313 => _313.kind]) === "stop" && hover.index === s.index
|
|
7619
7976
|
})),
|
|
7620
|
-
midpoints: a.midpoints.map((m) => ({ index: m.index, ...pt(m), hovered: _optionalChain([hover, 'optionalAccess',
|
|
7977
|
+
midpoints: a.midpoints.map((m) => ({ index: m.index, ...pt(m), hovered: _optionalChain([hover, 'optionalAccess', _314 => _314.kind]) === "midpoint" && hover.index === m.index })),
|
|
7621
7978
|
extent: a.extent,
|
|
7622
7979
|
removing
|
|
7623
7980
|
};
|
|
@@ -7625,8 +7982,8 @@ function gradientOverlay(state) {
|
|
|
7625
7982
|
function selectedBlends(state) {
|
|
7626
7983
|
const out = /* @__PURE__ */ new Map();
|
|
7627
7984
|
for (const id of state.selection) {
|
|
7628
|
-
const node =
|
|
7629
|
-
const group = isVectorBlendGroup(node) ? node : _optionalChain([
|
|
7985
|
+
const node = _chunkKANRAHTLcjs.findVectorNode.call(void 0, state.document.nodes, id);
|
|
7986
|
+
const group = isVectorBlendGroup(node) ? node : _optionalChain([_chunkKANRAHTLcjs.locateVectorNode.call(void 0, state.document.nodes, id), 'optionalAccess', _315 => _315.parent]);
|
|
7630
7987
|
if (isVectorBlendGroup(group)) out.set(group.id, group);
|
|
7631
7988
|
}
|
|
7632
7989
|
return [...out.values()];
|
|
@@ -7642,8 +7999,8 @@ function blendOverlay(state) {
|
|
|
7642
7999
|
const spines = selectedBlends(state).flatMap((g) => {
|
|
7643
8000
|
const s = vectorBlendSpine(g);
|
|
7644
8001
|
if (!s) return [];
|
|
7645
|
-
const m = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, _nullishCoalesce(
|
|
7646
|
-
const d = _chunkXGD3FSNCcjs.bezierPathToSvg.call(void 0, _chunkXGD3FSNCcjs.transformBezierPath.call(void 0,
|
|
8002
|
+
const m = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, _nullishCoalesce(_chunkKANRAHTLcjs.vectorWorldMatrix.call(void 0, doc.nodes, g.id), () => ( _chunkDWGZUSEScjs.IDENTITY_MATRIX)), view);
|
|
8003
|
+
const d = _chunkXGD3FSNCcjs.bezierPathToSvg.call(void 0, _chunkXGD3FSNCcjs.transformBezierPath.call(void 0, _chunkKANRAHTLcjs.subpathsToBezier.call(void 0, [s.spine], { corners: false }), m), { precision: 2 });
|
|
7647
8004
|
const keys = s.stops.map((stop) => {
|
|
7648
8005
|
const p = vectorBlendRailAt(s.rail, stop).point;
|
|
7649
8006
|
return sc({ x: p[0], y: p[1] }, m);
|
|
@@ -7653,16 +8010,16 @@ function blendOverlay(state) {
|
|
|
7653
8010
|
let start = null;
|
|
7654
8011
|
const anchors = [];
|
|
7655
8012
|
if (state.tool === "blend") {
|
|
7656
|
-
const from = state.blendStart ?
|
|
8013
|
+
const from = state.blendStart ? _chunkKANRAHTLcjs.findVectorNode.call(void 0, doc.nodes, state.blendStart.nodeId) : void 0;
|
|
7657
8014
|
if (from && state.blendStart) {
|
|
7658
8015
|
const a = state.blendStart.anchor === null ? void 0 : getAnchorWorld(doc, { nodeId: from.id, subpath: 0, index: state.blendStart.anchor });
|
|
7659
8016
|
start = { d: screenOutline(state, from, /* @__PURE__ */ new Set()), anchor: a ? sc(a, view) : null };
|
|
7660
8017
|
}
|
|
7661
|
-
const hovered = _optionalChain([state, 'access',
|
|
7662
|
-
if (_optionalChain([hovered, 'optionalAccess',
|
|
8018
|
+
const hovered = _optionalChain([state, 'access', _316 => _316.hover, 'optionalAccess', _317 => _317.nodeId]) ? _chunkKANRAHTLcjs.findVectorNode.call(void 0, doc.nodes, state.hover.nodeId) : void 0;
|
|
8019
|
+
if (_optionalChain([hovered, 'optionalAccess', _318 => _318.type]) === "path" && hovered.subpaths[0]) {
|
|
7663
8020
|
hovered.subpaths[0].anchors.forEach((_, index) => {
|
|
7664
8021
|
const a = getAnchorWorld(doc, { nodeId: hovered.id, subpath: 0, index });
|
|
7665
|
-
if (a) anchors.push({ ...sc(a, view), hovered: _optionalChain([state, 'access',
|
|
8022
|
+
if (a) anchors.push({ ...sc(a, view), hovered: _optionalChain([state, 'access', _319 => _319.hover, 'optionalAccess', _320 => _320.anchor, 'optionalAccess', _321 => _321.index]) === index });
|
|
7666
8023
|
});
|
|
7667
8024
|
}
|
|
7668
8025
|
}
|
|
@@ -7672,18 +8029,18 @@ function getVectorBlendControls(state) {
|
|
|
7672
8029
|
const blends = selectedBlends(state);
|
|
7673
8030
|
const doc = state.document;
|
|
7674
8031
|
const roots = state.selection.filter((id) => {
|
|
7675
|
-
const node =
|
|
7676
|
-
return !!node && !node.blendStep && !node.locked && !state.selection.includes(_nullishCoalesce(_optionalChain([
|
|
8032
|
+
const node = _chunkKANRAHTLcjs.findVectorNode.call(void 0, doc.nodes, id);
|
|
8033
|
+
return !!node && !node.blendStep && !node.locked && !state.selection.includes(_nullishCoalesce(_optionalChain([_chunkKANRAHTLcjs.locateVectorNode.call(void 0, doc.nodes, id), 'optionalAccess', _322 => _322.parent, 'optionalAccess', _323 => _323.id]), () => ( "")));
|
|
7677
8034
|
});
|
|
7678
|
-
const parents = new Set(roots.map((id) => _nullishCoalesce(_optionalChain([
|
|
7679
|
-
const paths = roots.filter((id) => _optionalChain([
|
|
8035
|
+
const parents = new Set(roots.map((id) => _nullishCoalesce(_optionalChain([_chunkKANRAHTLcjs.locateVectorNode.call(void 0, doc.nodes, id), 'optionalAccess', _324 => _324.parent, 'optionalAccess', _325 => _325.id]), () => ( null))));
|
|
8036
|
+
const paths = roots.filter((id) => _optionalChain([_chunkKANRAHTLcjs.findVectorNode.call(void 0, doc.nodes, id), 'optionalAccess', _326 => _326.type]) === "path" && !isVectorBlendGroup(_optionalChain([_chunkKANRAHTLcjs.locateVectorNode.call(void 0, doc.nodes, id), 'optionalAccess', _327 => _327.parent])));
|
|
7680
8037
|
const first = blends[0];
|
|
7681
8038
|
return {
|
|
7682
8039
|
ids: blends.map((g) => g.id),
|
|
7683
8040
|
options: resolveVectorBlendOptions(first ? first.blend : state.blendDefaults),
|
|
7684
8041
|
canBlend: roots.length >= 2 && parents.size === 1,
|
|
7685
8042
|
canReplaceSpine: blends.length === 1 && paths.length === 1,
|
|
7686
|
-
hasSpine: !!_optionalChain([first, 'optionalAccess',
|
|
8043
|
+
hasSpine: !!_optionalChain([first, 'optionalAccess', _328 => _328.blend, 'optionalAccess', _329 => _329.spine])
|
|
7687
8044
|
};
|
|
7688
8045
|
}
|
|
7689
8046
|
function applyVectorBlendOptions(controller, patch) {
|
|
@@ -7736,20 +8093,20 @@ function isVectorTextTarget(target) {
|
|
|
7736
8093
|
if (!el || typeof el !== "object") return false;
|
|
7737
8094
|
const tag = (_nullishCoalesce(el.tagName, () => ( ""))).toUpperCase();
|
|
7738
8095
|
if (tag === "INPUT" || tag === "TEXTAREA" || tag === "SELECT") return true;
|
|
7739
|
-
return !!el.isContentEditable || _optionalChain([el, 'access',
|
|
8096
|
+
return !!el.isContentEditable || _optionalChain([el, 'access', _330 => _330.getAttribute, 'optionalCall', _331 => _331("contenteditable")]) === "true";
|
|
7740
8097
|
}
|
|
7741
8098
|
function getVectorSelectionStyle(state) {
|
|
7742
8099
|
const paths = [];
|
|
7743
8100
|
for (const id of state.selection) {
|
|
7744
|
-
const node =
|
|
8101
|
+
const node = _chunkKANRAHTLcjs.findVectorNode.call(void 0, state.document.nodes, id);
|
|
7745
8102
|
if (node) paths.push(...collect(node));
|
|
7746
8103
|
}
|
|
7747
|
-
const anchorMode = state.tool === "direct" && !!_optionalChain([state, 'access',
|
|
8104
|
+
const anchorMode = state.tool === "direct" && !!_optionalChain([state, 'access', _332 => _332.selectedAnchors, 'optionalAccess', _333 => _333.length]);
|
|
7748
8105
|
if (anchorMode) {
|
|
7749
8106
|
for (const r of state.selectedAnchors) {
|
|
7750
8107
|
if (paths.some((p) => p.id === r.nodeId)) continue;
|
|
7751
|
-
const node =
|
|
7752
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
8108
|
+
const node = _chunkKANRAHTLcjs.findVectorNode.call(void 0, state.document.nodes, r.nodeId);
|
|
8109
|
+
if (_optionalChain([node, 'optionalAccess', _334 => _334.type]) === "path") paths.push(node);
|
|
7753
8110
|
}
|
|
7754
8111
|
}
|
|
7755
8112
|
if (!paths.length) return null;
|
|
@@ -7757,10 +8114,10 @@ function getVectorSelectionStyle(state) {
|
|
|
7757
8114
|
const same = (get) => paths.every((p) => JSON.stringify(_nullishCoalesce(get(p), () => ( null))) === JSON.stringify(_nullishCoalesce(get(first), () => ( null))));
|
|
7758
8115
|
const corners2 = [];
|
|
7759
8116
|
for (const p of paths) {
|
|
7760
|
-
for (const c of
|
|
8117
|
+
for (const c of _chunkKANRAHTLcjs.vectorCorners.call(void 0, p.subpaths)) {
|
|
7761
8118
|
if (anchorMode && !state.selectedAnchors.some((r) => r.nodeId === p.id && r.subpath === c.subpath && r.index === c.index)) continue;
|
|
7762
8119
|
const corner = p.subpaths[c.subpath].anchors[c.index].corner;
|
|
7763
|
-
corners2.push({ radius: _nullishCoalesce(_optionalChain([corner, 'optionalAccess',
|
|
8120
|
+
corners2.push({ radius: _nullishCoalesce(_optionalChain([corner, 'optionalAccess', _335 => _335.radius]), () => ( 0)), kind: _nullishCoalesce(_optionalChain([corner, 'optionalAccess', _336 => _336.kind]), () => ( "round")) });
|
|
7764
8121
|
}
|
|
7765
8122
|
}
|
|
7766
8123
|
const c0 = _nullishCoalesce(corners2[0], () => ( { radius: 0, kind: "round" }));
|
|
@@ -7776,7 +8133,7 @@ function getVectorSelectionStyle(state) {
|
|
|
7776
8133
|
startArrowScale: _nullishCoalesce(first.startArrowScale, () => ( 1)),
|
|
7777
8134
|
endArrowScale: _nullishCoalesce(first.endArrowScale, () => ( 1)),
|
|
7778
8135
|
strokeWidthProfile: profileOf(first),
|
|
7779
|
-
widthProfile:
|
|
8136
|
+
widthProfile: _chunkKANRAHTLcjs.widthProfilePresetId.call(void 0, profileOf(first)),
|
|
7780
8137
|
cornerRadius: c0.radius,
|
|
7781
8138
|
cornerKind: c0.kind,
|
|
7782
8139
|
corners: corners2.length,
|
|
@@ -7800,8 +8157,8 @@ function getVectorSelectionStyle(state) {
|
|
|
7800
8157
|
};
|
|
7801
8158
|
}
|
|
7802
8159
|
function profileOf(p) {
|
|
7803
|
-
const points =
|
|
7804
|
-
return points.length &&
|
|
8160
|
+
const points = _chunkKANRAHTLcjs.sanitizeWidthProfile.call(void 0, p.strokeWidthProfile);
|
|
8161
|
+
return points.length && _chunkKANRAHTLcjs.widthProfilePresetId.call(void 0, points) !== "uniform" ? points : null;
|
|
7805
8162
|
}
|
|
7806
8163
|
var VECTOR_STROKE_ALIGN_LABELS = { center: "Center", inside: "Inside", outside: "Outside" };
|
|
7807
8164
|
var VECTOR_CORNER_KIND_LABELS = { round: "Round", inverted: "Inverted", chamfer: "Chamfer" };
|
|
@@ -7827,36 +8184,37 @@ var VECTOR_STROKE_GRADIENT_MODE_LABELS = { within: "Within stroke", along: "Alon
|
|
|
7827
8184
|
function getVectorGradientEditor(state) {
|
|
7828
8185
|
const paths = [];
|
|
7829
8186
|
for (const id of state.selection) {
|
|
7830
|
-
const node =
|
|
8187
|
+
const node = _chunkKANRAHTLcjs.findVectorNode.call(void 0, state.document.nodes, id);
|
|
7831
8188
|
if (node) paths.push(...collect(node));
|
|
7832
8189
|
}
|
|
7833
8190
|
if (!paths.length) return null;
|
|
7834
|
-
const target = state.gradientEdit
|
|
7835
|
-
const paint = paths[0]
|
|
7836
|
-
const gradient =
|
|
7837
|
-
const sorted = gradient ?
|
|
8191
|
+
const { target, layer } = state.gradientEdit;
|
|
8192
|
+
const paint = _chunkKANRAHTLcjs.vectorTargetPaint.call(void 0, paths[0], target, _nullishCoalesce(layer, () => ( null)));
|
|
8193
|
+
const gradient = _chunkKANRAHTLcjs.isVectorGradient.call(void 0, paint) ? paint : null;
|
|
8194
|
+
const sorted = gradient ? _chunkKANRAHTLcjs.sortedVectorGradientStops.call(void 0, gradient) : [];
|
|
7838
8195
|
const stopIndex = state.gradientEdit.stop;
|
|
7839
8196
|
const stops = sorted.map((s, index) => ({ ...s, index, selected: index === stopIndex }));
|
|
7840
8197
|
const sel = stopIndex !== null && sorted[stopIndex] ? { ...sorted[stopIndex], index: stopIndex, last: stopIndex === sorted.length - 1 } : null;
|
|
7841
|
-
const preview = gradient ? `linear-gradient(to right, ${
|
|
7842
|
-
const c =
|
|
7843
|
-
const a = (_nullishCoalesce(_optionalChain([c, 'optionalAccess',
|
|
8198
|
+
const preview = gradient ? `linear-gradient(to right, ${_chunkKANRAHTLcjs.expandVectorGradientStops.call(void 0, gradient).map((s) => {
|
|
8199
|
+
const c = _chunkKANRAHTLcjs.parseVectorColor.call(void 0, s.color);
|
|
8200
|
+
const a = (_nullishCoalesce(_optionalChain([c, 'optionalAccess', _337 => _337[3]]), () => ( 1))) * (_nullishCoalesce(s.opacity, () => ( 1)));
|
|
7844
8201
|
const color = c ? `rgba(${Math.round(c[0] * 255)}, ${Math.round(c[1] * 255)}, ${Math.round(c[2] * 255)}, ${Math.round(a * 1e3) / 1e3})` : s.color;
|
|
7845
8202
|
return `${color} ${Math.round(s.offset * 1e4) / 100}%`;
|
|
7846
8203
|
}).join(", ")})` : null;
|
|
7847
8204
|
return {
|
|
7848
8205
|
target,
|
|
8206
|
+
layer: _nullishCoalesce(layer, () => ( null)),
|
|
7849
8207
|
gradient,
|
|
7850
8208
|
color: vectorPaintToHex(paint),
|
|
7851
8209
|
stops,
|
|
7852
8210
|
selected: sel,
|
|
7853
8211
|
preview,
|
|
7854
|
-
type: _nullishCoalesce(_optionalChain([gradient, 'optionalAccess',
|
|
7855
|
-
spread: _nullishCoalesce(_optionalChain([gradient, 'optionalAccess',
|
|
7856
|
-
interpolation: _nullishCoalesce(_optionalChain([gradient, 'optionalAccess',
|
|
7857
|
-
smoothness: _nullishCoalesce(_optionalChain([gradient, 'optionalAccess',
|
|
7858
|
-
strokeMode: _nullishCoalesce(_optionalChain([gradient, 'optionalAccess',
|
|
7859
|
-
mixed: paths.some((p) => JSON.stringify(_nullishCoalesce(p
|
|
8212
|
+
type: _nullishCoalesce(_optionalChain([gradient, 'optionalAccess', _338 => _338.type]), () => ( null)),
|
|
8213
|
+
spread: _nullishCoalesce(_optionalChain([gradient, 'optionalAccess', _339 => _339.spread]), () => ( "pad")),
|
|
8214
|
+
interpolation: _nullishCoalesce(_optionalChain([gradient, 'optionalAccess', _340 => _340.interpolation]), () => ( "srgb")),
|
|
8215
|
+
smoothness: _nullishCoalesce(_optionalChain([gradient, 'optionalAccess', _341 => _341.smoothness]), () => ( 0)),
|
|
8216
|
+
strokeMode: _nullishCoalesce(_optionalChain([gradient, 'optionalAccess', _342 => _342.strokeMode]), () => ( "within")),
|
|
8217
|
+
mixed: paths.some((p) => JSON.stringify(_nullishCoalesce(_chunkKANRAHTLcjs.vectorTargetPaint.call(void 0, p, target, _nullishCoalesce(layer, () => ( null))), () => ( null))) !== JSON.stringify(_nullishCoalesce(paint, () => ( null))))
|
|
7860
8218
|
};
|
|
7861
8219
|
}
|
|
7862
8220
|
var VECTOR_PATH_ACTIONS = [
|
|
@@ -7880,26 +8238,86 @@ var VECTOR_EDIT_TOGGLES = [
|
|
|
7880
8238
|
{ key: "curvatureMoves", label: "Curv", title: "Curvature point moves (Alt flips while dragging)" },
|
|
7881
8239
|
{ key: "recognizeShapes", label: "Shapes", title: "Turn pencil scribbles into shapes" }
|
|
7882
8240
|
];
|
|
7883
|
-
var VECTOR_EFFECT_MENU =
|
|
8241
|
+
var VECTOR_EFFECT_MENU = _chunkKANRAHTLcjs.VECTOR_EFFECT_TYPES.map((type) => ({ type, label: _chunkKANRAHTLcjs.VECTOR_EFFECT_LABELS[type] }));
|
|
7884
8242
|
function getVectorEffectsPanel(state) {
|
|
7885
|
-
const nodes = state.selection.map((id) =>
|
|
8243
|
+
const nodes = state.selection.map((id) => _chunkKANRAHTLcjs.findVectorNode.call(void 0, state.document.nodes, id)).filter((n) => !!n && !n.blendStep);
|
|
7886
8244
|
if (!nodes.length) return null;
|
|
7887
8245
|
const one = nodes.length === 1 ? nodes[0] : null;
|
|
7888
8246
|
return {
|
|
7889
|
-
nodeId: _nullishCoalesce(_optionalChain([one, 'optionalAccess',
|
|
8247
|
+
nodeId: _nullishCoalesce(_optionalChain([one, 'optionalAccess', _343 => _343.id]), () => ( null)),
|
|
7890
8248
|
count: nodes.length,
|
|
7891
|
-
effects: (_nullishCoalesce(_optionalChain([one, 'optionalAccess',
|
|
8249
|
+
effects: (_nullishCoalesce(_optionalChain([one, 'optionalAccess', _344 => _344.effects]), () => ( []))).map((e) => ({
|
|
7892
8250
|
id: e.id,
|
|
7893
8251
|
type: e.type,
|
|
7894
|
-
label: _nullishCoalesce(
|
|
8252
|
+
label: _nullishCoalesce(_chunkKANRAHTLcjs.VECTOR_EFFECT_LABELS[e.type], () => ( e.type)),
|
|
7895
8253
|
enabled: e.enabled !== false,
|
|
7896
8254
|
params: e.params,
|
|
7897
8255
|
// The Envelope panel (`getVectorEnvelopePanel`) edits an envelope's warp and mesh.
|
|
7898
|
-
specs: e.type === "envelope" ? [] : _nullishCoalesce(
|
|
8256
|
+
specs: e.type === "envelope" ? [] : _nullishCoalesce(_chunkKANRAHTLcjs.VECTOR_EFFECT_PARAM_SPECS[e.type], () => ( []))
|
|
7899
8257
|
})),
|
|
7900
|
-
expandable: nodes.some(
|
|
8258
|
+
expandable: nodes.some(_chunkKANRAHTLcjs.hasVectorAppearance)
|
|
8259
|
+
};
|
|
8260
|
+
}
|
|
8261
|
+
function vectorPaintSwatch(paint) {
|
|
8262
|
+
if (typeof paint === "string") return paint;
|
|
8263
|
+
if (_chunkKANRAHTLcjs.isVectorGradient.call(void 0, paint)) {
|
|
8264
|
+
return `linear-gradient(to right, ${_chunkKANRAHTLcjs.expandVectorGradientStops.call(void 0, paint).map((s) => {
|
|
8265
|
+
const c = _chunkKANRAHTLcjs.parseVectorColor.call(void 0, s.color);
|
|
8266
|
+
const a = (_nullishCoalesce(_optionalChain([c, 'optionalAccess', _345 => _345[3]]), () => ( 1))) * (_nullishCoalesce(s.opacity, () => ( 1)));
|
|
8267
|
+
const color = c ? `rgba(${Math.round(c[0] * 255)}, ${Math.round(c[1] * 255)}, ${Math.round(c[2] * 255)}, ${Math.round(a * 1e3) / 1e3})` : s.color;
|
|
8268
|
+
return `${color} ${Math.round(s.offset * 1e4) / 100}%`;
|
|
8269
|
+
}).join(", ")})`;
|
|
8270
|
+
}
|
|
8271
|
+
return "transparent";
|
|
8272
|
+
}
|
|
8273
|
+
function getVectorAppearancePanel(state) {
|
|
8274
|
+
const nodes = state.selection.map((id) => _chunkKANRAHTLcjs.findVectorNode.call(void 0, state.document.nodes, id)).filter((n) => !!n && !n.blendStep);
|
|
8275
|
+
if (!nodes.length) return null;
|
|
8276
|
+
const paths = [];
|
|
8277
|
+
for (const n of nodes) for (const p of collect(n)) if (!p.blendStep && !paths.some((q) => q.id === p.id)) paths.push(p);
|
|
8278
|
+
const first = paths[0];
|
|
8279
|
+
const edit = state.gradientEdit;
|
|
8280
|
+
const layer = (kind, l, index, count) => ({
|
|
8281
|
+
kind,
|
|
8282
|
+
index,
|
|
8283
|
+
paint: l.paint,
|
|
8284
|
+
color: vectorPaintToHex(l.paint),
|
|
8285
|
+
swatch: vectorPaintSwatch(l.paint),
|
|
8286
|
+
gradient: _chunkKANRAHTLcjs.isVectorGradient.call(void 0, l.paint),
|
|
8287
|
+
opacity: _nullishCoalesce(l.opacity, () => ( 1)),
|
|
8288
|
+
blendMode: _nullishCoalesce(l.blendMode, () => ( "normal")),
|
|
8289
|
+
visible: l.visible !== false,
|
|
8290
|
+
...kind === "stroke" ? { strokeWidth: _nullishCoalesce(l.strokeWidth, () => ( 1)), strokeAlign: _nullishCoalesce(l.strokeAlign, () => ( "center")) } : {},
|
|
8291
|
+
...(_nullishCoalesce(l.kind, () => ( "paint"))) !== "paint" ? { unknownKind: String(l.kind) } : {},
|
|
8292
|
+
editing: edit.target === kind && (edit.layer === null ? index === count - 1 : edit.layer === index)
|
|
8293
|
+
});
|
|
8294
|
+
const fills = first ? _chunkKANRAHTLcjs.vectorFills.call(void 0, first) : [];
|
|
8295
|
+
const strokes = first ? _chunkKANRAHTLcjs.vectorStrokes.call(void 0, first) : [];
|
|
8296
|
+
const same = (get) => paths.every((p) => JSON.stringify(get(p)) === JSON.stringify(get(first)));
|
|
8297
|
+
const one = nodes.length === 1 ? nodes[0] : null;
|
|
8298
|
+
return {
|
|
8299
|
+
nodeIds: nodes.map((n) => n.id),
|
|
8300
|
+
pathIds: paths.map((p) => p.id),
|
|
8301
|
+
fills: fills.map((l, i) => layer("fill", l, i, fills.length)),
|
|
8302
|
+
strokes: strokes.map((l, i) => layer("stroke", l, i, strokes.length)),
|
|
8303
|
+
blendMode: _nullishCoalesce(nodes[0].blendMode, () => ( "normal")),
|
|
8304
|
+
mixed: {
|
|
8305
|
+
fills: !!first && !same(_chunkKANRAHTLcjs.vectorFills),
|
|
8306
|
+
strokes: !!first && !same(_chunkKANRAHTLcjs.vectorStrokes),
|
|
8307
|
+
blendMode: nodes.some((n) => (_nullishCoalesce(n.blendMode, () => ( "normal"))) !== (_nullishCoalesce(nodes[0].blendMode, () => ( "normal"))))
|
|
8308
|
+
},
|
|
8309
|
+
filterNodeId: _nullishCoalesce(_optionalChain([one, 'optionalAccess', _346 => _346.id]), () => ( null)),
|
|
8310
|
+
filters: (_nullishCoalesce(_optionalChain([one, 'optionalAccess', _347 => _347.filters]), () => ( []))).map((f) => ({
|
|
8311
|
+
id: f.id,
|
|
8312
|
+
type: f.type,
|
|
8313
|
+
label: _nullishCoalesce(_chunkKANRAHTLcjs.VECTOR_FILTER_LABELS[f.type], () => ( f.type)),
|
|
8314
|
+
enabled: f.enabled !== false,
|
|
8315
|
+
params: f.params,
|
|
8316
|
+
specs: _nullishCoalesce(_chunkKANRAHTLcjs.VECTOR_FILTER_PARAM_SPECS[f.type], () => ( []))
|
|
8317
|
+
}))
|
|
7901
8318
|
};
|
|
7902
8319
|
}
|
|
8320
|
+
var VECTOR_BLEND_MODE_MENU = _chunkKANRAHTLcjs.VECTOR_BLEND_MODES.map((mode) => ({ mode, label: _chunkKANRAHTLcjs.VECTOR_BLEND_MODE_LABELS[mode] }));
|
|
7903
8321
|
|
|
7904
8322
|
// src/vector/commands.ts
|
|
7905
8323
|
var EFFECT_PARAMS_DESCRIPTION = "Effect parameters (missing ones keep their value or default). trim: start, end (percent), offset (degrees), mode simultaneous|individual. roundCorners: radius. puckerBloat: amount (\u2212100\u2026100). twist: angle, center {x, y} (offset from the middle). zigzag: size, ridges, smooth. wiggle: size, detail, smooth, speed, correlation, phase, seed, time (seconds). offset: amount, join miter|round|bevel, miterLimit, copies, copyOffset. merge: mode merge|add|subtract|intersect|exclude. repeater: copies (fractions fade the last), offset, position {x, y}, anchor {x, y} (offset from the middle), rotation, scale {x, y} (percent), startOpacity, endOpacity (percent), composite below|above. envelope: style (a warp preset: arc|arcLower|arcUpper|arch|bulge|shellLower|shellUpper|flag|wave|fish|rise|fisheye|inflate|squeeze|twist, or mesh), bend, horizontal, vertical (percent, \u2212100\u2026100), orientation horizontal|vertical, rows, columns, mesh { us, vs, points } (node space; prefer vector.envelope).";
|
|
@@ -7943,13 +8361,13 @@ var BLEND_PROPS = {
|
|
|
7943
8361
|
linear: { type: "boolean", description: "Move anchors in straight lines instead of the rotation-aware morph." }
|
|
7944
8362
|
};
|
|
7945
8363
|
var checkBlendOptions = (params) => {
|
|
7946
|
-
if (_optionalChain([params, 'optionalAccess',
|
|
7947
|
-
if (_optionalChain([params, 'optionalAccess',
|
|
7948
|
-
if (_optionalChain([params, 'optionalAccess',
|
|
8364
|
+
if (_optionalChain([params, 'optionalAccess', _348 => _348.spacing]) !== void 0 && !_chunkKANRAHTLcjs.VECTOR_BLEND_SPACINGS.includes(params.spacing)) fail(`Unknown blend spacing "${params.spacing}".`);
|
|
8365
|
+
if (_optionalChain([params, 'optionalAccess', _349 => _349.steps]) !== void 0 && !(Number.isFinite(params.steps) && params.steps >= 1)) fail("steps must be at least 1.");
|
|
8366
|
+
if (_optionalChain([params, 'optionalAccess', _350 => _350.distance]) !== void 0 && !(Number.isFinite(params.distance) && params.distance > 0)) fail("distance must be positive.");
|
|
7949
8367
|
};
|
|
7950
8368
|
var POINT = { type: "object", properties: { x: { type: "number" }, y: { type: "number" } }, required: ["x", "y"] };
|
|
7951
8369
|
var GRADIENT_PROPS = {
|
|
7952
|
-
type: { type: "string", enum:
|
|
8370
|
+
type: { type: "string", enum: _chunkKANRAHTLcjs.VECTOR_GRADIENT_TYPES, description: "linear, radial, conic (an angle sweep), reflected (linear mirrored about the start) or diamond." },
|
|
7953
8371
|
stops: {
|
|
7954
8372
|
type: "array",
|
|
7955
8373
|
minItems: 1,
|
|
@@ -7974,37 +8392,66 @@ var GRADIENT_PROPS = {
|
|
|
7974
8392
|
focal: { ...POINT, description: "Radial focal point (where t = 0), in `units`." },
|
|
7975
8393
|
focalRadius: { type: "number", minimum: 0, maximum: 0.99, description: "Radial focal circle radius as a fraction of the radius (SVG fr)." },
|
|
7976
8394
|
units: { type: "string", enum: ["objectBoundingBox", "userSpaceOnUse"], description: "Space of start / end / width / focal: fractions of the shape box (default) or the node's own coordinates." },
|
|
7977
|
-
spread: { type: "string", enum:
|
|
7978
|
-
interpolation: { type: "string", enum:
|
|
8395
|
+
spread: { type: "string", enum: _chunkKANRAHTLcjs.VECTOR_GRADIENT_SPREADS, description: "What paints past the ends: pad (default), reflect or repeat." },
|
|
8396
|
+
interpolation: { type: "string", enum: _chunkKANRAHTLcjs.VECTOR_GRADIENT_INTERPOLATIONS, description: "Colour mixing space: srgb (default), linear (light) or oklab." },
|
|
7979
8397
|
smoothness: { type: "number", minimum: 0, maximum: 1, description: "Bends the ramp along a smooth spline through the stops (0 = straight)." },
|
|
7980
|
-
strokeMode: { type: "string", enum:
|
|
8398
|
+
strokeMode: { type: "string", enum: _chunkKANRAHTLcjs.VECTOR_STROKE_GRADIENT_MODES, description: "On strokes: within (default, like a fill), along the path or across it." }
|
|
7981
8399
|
};
|
|
7982
8400
|
var PAINT = {
|
|
7983
8401
|
description: 'A CSS colour, `null` for none, or a gradient object: `{ type: "linear" | "radial" | "conic" | "reflected" | "diamond", stops: [{ offset, color, opacity?, midpoint? }] }` plus the shorthand `angle` / `cx, cy, r` or explicit `start`, `end`, `width`, `focal`, `focalRadius`, `units`, and `spread`, `interpolation`, `smoothness`, `strokeMode` (see vector.setGradient).',
|
|
7984
8402
|
anyOf: [{ type: "string" }, { type: "null" }, { type: "object", properties: GRADIENT_PROPS, required: ["type", "stops"] }]
|
|
7985
8403
|
};
|
|
7986
|
-
var
|
|
7987
|
-
|
|
7988
|
-
|
|
7989
|
-
|
|
7990
|
-
|
|
7991
|
-
|
|
7992
|
-
|
|
7993
|
-
|
|
7994
|
-
|
|
7995
|
-
|
|
7996
|
-
|
|
8404
|
+
var BLEND_MODE = {
|
|
8405
|
+
type: "string",
|
|
8406
|
+
enum: _chunkKANRAHTLcjs.VECTOR_BLEND_MODES,
|
|
8407
|
+
description: "How it mixes with what is under it (CSS mix-blend-mode names; linear-dodge draws as plus-lighter). Default normal."
|
|
8408
|
+
};
|
|
8409
|
+
var FILL_LAYER_PROPS = {
|
|
8410
|
+
paint: PAINT,
|
|
8411
|
+
opacity: { type: "number", minimum: 0, maximum: 1, description: "Layer opacity 0 to 1 (default 1), multiplying the paint's own alpha." },
|
|
8412
|
+
blendMode: BLEND_MODE,
|
|
8413
|
+
visible: { type: "boolean", description: "false hides the layer (kept, not drawn or hit). Default true." }
|
|
8414
|
+
};
|
|
8415
|
+
var STROKE_SETTING_PROPS = {
|
|
8416
|
+
strokeWidth: { type: "number", minimum: 0, description: "Stroke width in document units (default 1)." },
|
|
8417
|
+
strokeLinecap: { type: "string", enum: ["butt", "round", "square"], description: "Line cap (default butt)." },
|
|
8418
|
+
strokeLinejoin: { type: "string", enum: ["miter", "round", "bevel"], description: "Line join (default miter)." },
|
|
8419
|
+
strokeDasharray: { type: ["array", "null"], items: { type: "number", minimum: 0 }, description: "Dash and gap lengths in document units; null or [] for a solid line." },
|
|
8420
|
+
strokeAlign: { type: "string", enum: ["center", "inside", "outside"], description: "Where the stroke sits on the outline (closed shapes only; open paths stroke centred). Default center." },
|
|
8421
|
+
startArrow: { type: ["string", "null"], enum: [..._chunkKANRAHTLcjs.VECTOR_ARROWHEADS, null], description: "Head at the start of an open path, or null for none." },
|
|
8422
|
+
endArrow: { type: ["string", "null"], enum: [..._chunkKANRAHTLcjs.VECTOR_ARROWHEADS, null], description: "Head at the end of an open path, or null for none." },
|
|
7997
8423
|
arrowAlign: { type: "string", enum: ["extend", "tip"], description: "`extend`: the tip sits past the end point; `tip`: on it, the stroke shortened under the head." },
|
|
7998
8424
|
startArrowScale: { type: "number", exclusiveMinimum: 0, description: "Start head size as a multiple of the stroke width (default 1)." },
|
|
7999
8425
|
endArrowScale: { type: "number", exclusiveMinimum: 0, description: "End head size as a multiple of the stroke width (default 1)." },
|
|
8000
8426
|
strokeWidthProfile: WIDTH_POINTS
|
|
8001
8427
|
};
|
|
8428
|
+
var FILL_LAYER = { type: "object", properties: FILL_LAYER_PROPS, required: ["paint"], additionalProperties: false };
|
|
8429
|
+
var STROKE_LAYER = { type: "object", properties: { ...FILL_LAYER_PROPS, ...STROKE_SETTING_PROPS }, required: ["paint"], additionalProperties: false };
|
|
8430
|
+
var STYLE_PROPS = {
|
|
8431
|
+
fills: { type: "array", items: FILL_LAYER, description: "Replace the fill stack, bottom to top (fills draw under strokes). `fill` alone edits the top fill." },
|
|
8432
|
+
strokes: { type: "array", items: STROKE_LAYER, description: "Replace the stroke stack, bottom to top, each stroke with its own settings. `stroke` and the stroke settings alone edit the top stroke." },
|
|
8433
|
+
fill: PAINT,
|
|
8434
|
+
stroke: PAINT,
|
|
8435
|
+
...STROKE_SETTING_PROPS,
|
|
8436
|
+
fillRule: { type: "string", enum: ["nonzero", "evenodd"], description: "Which areas count as inside (default nonzero)." }
|
|
8437
|
+
};
|
|
8438
|
+
var checkPaint = (paint, where) => {
|
|
8439
|
+
if (paint && typeof paint === "object") return _nullishCoalesce(_chunkKANRAHTLcjs.sanitizeVectorGradient.call(void 0, paint), () => ( fail(`${where} is not a valid gradient: give a type and at least one stop { offset, color }.`)));
|
|
8440
|
+
return paint;
|
|
8441
|
+
};
|
|
8002
8442
|
var pickStyle = (params) => {
|
|
8003
8443
|
const out = {};
|
|
8004
8444
|
for (const key of Object.keys(STYLE_PROPS)) if (params[key] !== void 0) out[key] = params[key];
|
|
8005
|
-
for (const key of ["fill", "stroke"])
|
|
8006
|
-
|
|
8007
|
-
|
|
8445
|
+
for (const key of ["fill", "stroke"]) if (out[key] !== void 0) out[key] = checkPaint(out[key], key);
|
|
8446
|
+
for (const key of ["fills", "strokes"]) {
|
|
8447
|
+
const stack = out[key];
|
|
8448
|
+
if (!Array.isArray(stack)) continue;
|
|
8449
|
+
stack.forEach((l, i) => {
|
|
8450
|
+
if (!l || typeof l !== "object") fail(`${key}[${i}] must be a layer object { paint, \u2026 }.`);
|
|
8451
|
+
const layer = l;
|
|
8452
|
+
checkPaint(layer.paint, `${key}[${i}].paint`);
|
|
8453
|
+
if (layer.blendMode !== void 0 && !_chunkKANRAHTLcjs.isVectorBlendMode.call(void 0, layer.blendMode)) fail(`${key}[${i}].blendMode "${String(layer.blendMode)}" is not one of: ${_chunkKANRAHTLcjs.VECTOR_BLEND_MODES.join(", ")}.`);
|
|
8454
|
+
});
|
|
8008
8455
|
}
|
|
8009
8456
|
return out;
|
|
8010
8457
|
};
|
|
@@ -8017,17 +8464,17 @@ function createVectorCommands(controller, options = {}) {
|
|
|
8017
8464
|
const base = { group, ...options.scope ? { scope: options.scope } : {} };
|
|
8018
8465
|
const hasSelection = () => controller.getState().selection.length ? true : "Nothing is selected.";
|
|
8019
8466
|
const ids = (params) => {
|
|
8020
|
-
const list2 = _nullishCoalesce(_optionalChain([params, 'optionalAccess',
|
|
8467
|
+
const list2 = _nullishCoalesce(_optionalChain([params, 'optionalAccess', _351 => _351.ids]), () => ( controller.getState().selection));
|
|
8021
8468
|
for (const id of list2) if (!controller.getNode(id)) fail(`There is no node "${id}".`);
|
|
8022
8469
|
if (!list2.length) fail("Nothing is selected; pass ids.");
|
|
8023
8470
|
return list2;
|
|
8024
8471
|
};
|
|
8025
|
-
const enabledFor = (_, params) => _optionalChain([params, 'optionalAccess',
|
|
8472
|
+
const enabledFor = (_, params) => _optionalChain([params, 'optionalAccess', _352 => _352.ids, 'optionalAccess', _353 => _353.length]) ? true : hasSelection();
|
|
8026
8473
|
const anchorsOf = (refs) => {
|
|
8027
8474
|
if (!refs) return [...controller.getState().selectedAnchors];
|
|
8028
8475
|
for (const r of refs) {
|
|
8029
8476
|
const node = controller.getNode(r.nodeId);
|
|
8030
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
8477
|
+
if (_optionalChain([node, 'optionalAccess', _354 => _354.type]) !== "path" || !_optionalChain([node, 'access', _355 => _355.subpaths, 'access', _356 => _356[r.subpath], 'optionalAccess', _357 => _357.anchors, 'access', _358 => _358[r.index]])) fail(`There is no anchor ${r.index} on subpath ${r.subpath} of "${r.nodeId}".`);
|
|
8031
8478
|
}
|
|
8032
8479
|
return refs;
|
|
8033
8480
|
};
|
|
@@ -8036,24 +8483,28 @@ function createVectorCommands(controller, options = {}) {
|
|
|
8036
8483
|
const out = [];
|
|
8037
8484
|
const visit = (nodes, depth) => {
|
|
8038
8485
|
for (const n of nodes) {
|
|
8039
|
-
const parent = _nullishCoalesce(
|
|
8040
|
-
const b =
|
|
8486
|
+
const parent = _nullishCoalesce(_chunkKANRAHTLcjs.vectorParentMatrix.call(void 0, state.document.nodes, n.id), () => ( _chunkDWGZUSEScjs.IDENTITY_MATRIX));
|
|
8487
|
+
const b = _chunkKANRAHTLcjs.vectorNodeBounds.call(void 0, n, parent);
|
|
8041
8488
|
out.push({
|
|
8042
8489
|
id: n.id,
|
|
8043
8490
|
type: n.type,
|
|
8044
8491
|
...n.name ? { name: n.name } : {},
|
|
8045
8492
|
depth,
|
|
8046
|
-
rotation: Math.round(
|
|
8493
|
+
rotation: Math.round(_chunkKANRAHTLcjs.vectorNodeRotation.call(void 0, n, parent) * 100) / 100,
|
|
8047
8494
|
bounds: b && { x: Math.round(b.x * 100) / 100, y: Math.round(b.y * 100) / 100, width: Math.round(b.width * 100) / 100, height: Math.round(b.height * 100) / 100 },
|
|
8048
8495
|
visible: n.visible !== false,
|
|
8049
8496
|
locked: !!n.locked,
|
|
8050
8497
|
selected: state.selection.includes(n.id),
|
|
8051
|
-
...n.type === "path" ? { fill: _nullishCoalesce(n.fill, () => ( null)), stroke: _nullishCoalesce(n.stroke, () => ( null)), strokeWidth: _nullishCoalesce(n.strokeWidth, () => ( 1)), d:
|
|
8498
|
+
...n.type === "path" ? { fill: _nullishCoalesce(n.fill, () => ( null)), stroke: _nullishCoalesce(n.stroke, () => ( null)), strokeWidth: _nullishCoalesce(n.strokeWidth, () => ( 1)), d: _chunkKANRAHTLcjs.vectorPathData.call(void 0, n, 2) } : { children: n.children.length },
|
|
8052
8499
|
...n.type === "group" && n.blend ? { blend: { ...resolveVectorBlendOptions(n.blend), spine: !!n.blend.spine, keys: vectorBlendKeys(n).map((k) => k.id) } } : {},
|
|
8053
8500
|
...n.blendStep ? { blendStep: true } : {},
|
|
8054
|
-
..._optionalChain([n, 'access',
|
|
8501
|
+
..._optionalChain([n, 'access', _359 => _359.effects, 'optionalAccess', _360 => _360.length]) ? { effects: n.effects } : {},
|
|
8055
8502
|
...n.type === "group" && n.liveBoolean ? { liveBoolean: n.liveBoolean } : {},
|
|
8056
|
-
...n.booleanOperation ? { booleanOperation: n.booleanOperation } : {}
|
|
8503
|
+
...n.booleanOperation ? { booleanOperation: n.booleanOperation } : {},
|
|
8504
|
+
...n.type === "path" && Array.isArray(n.fills) ? { fills: n.fills } : {},
|
|
8505
|
+
...n.type === "path" && Array.isArray(n.strokes) ? { strokes: n.strokes } : {},
|
|
8506
|
+
...n.blendMode && n.blendMode !== "normal" ? { blendMode: n.blendMode } : {},
|
|
8507
|
+
..._optionalChain([n, 'access', _361 => _361.filters, 'optionalAccess', _362 => _362.length]) ? { filters: n.filters } : {}
|
|
8057
8508
|
});
|
|
8058
8509
|
if (n.type === "group") visit(n.children, depth + 1);
|
|
8059
8510
|
}
|
|
@@ -8061,6 +8512,276 @@ function createVectorCommands(controller, options = {}) {
|
|
|
8061
8512
|
visit(state.document.nodes, 0);
|
|
8062
8513
|
return { width: state.document.width, height: state.document.height, nodes: out, selection: state.selection, tool: state.tool };
|
|
8063
8514
|
};
|
|
8515
|
+
const appearanceOf = (id) => {
|
|
8516
|
+
const n = _nullishCoalesce(controller.getNode(id), () => ( fail(`There is no node "${id}".`)));
|
|
8517
|
+
return {
|
|
8518
|
+
id: n.id,
|
|
8519
|
+
type: n.type,
|
|
8520
|
+
...n.type === "path" ? { fills: _chunkKANRAHTLcjs.vectorFills.call(void 0, n), strokes: _chunkKANRAHTLcjs.vectorStrokes.call(void 0, n), fillRule: _nullishCoalesce(n.fillRule, () => ( "nonzero")) } : {},
|
|
8521
|
+
blendMode: _nullishCoalesce(n.blendMode, () => ( "normal")),
|
|
8522
|
+
opacity: _nullishCoalesce(n.opacity, () => ( 1)),
|
|
8523
|
+
filters: _nullishCoalesce(n.filters, () => ( []))
|
|
8524
|
+
};
|
|
8525
|
+
};
|
|
8526
|
+
const pathOf = (id) => {
|
|
8527
|
+
const n = _nullishCoalesce(controller.getNode(id), () => ( fail(`There is no node "${id}". Call vector.list for ids.`)));
|
|
8528
|
+
if (n.type !== "path") fail(`"${id}" is a group; fills and strokes belong to paths (pass a path id, or use ids on vector.addFill / vector.addStroke for every path inside).`);
|
|
8529
|
+
return n;
|
|
8530
|
+
};
|
|
8531
|
+
const layerIndex = (id, kind, index, key = "index") => {
|
|
8532
|
+
const stack = kind === "fill" ? _chunkKANRAHTLcjs.vectorFills.call(void 0, pathOf(id)) : _chunkKANRAHTLcjs.vectorStrokes.call(void 0, pathOf(id));
|
|
8533
|
+
if (!Number.isInteger(index) || !stack[index]) fail(`${key} ${index} is out of range: "${id}" has ${stack.length} ${kind}${stack.length === 1 ? "" : "s"} (0 is the bottom). Read them with vector.getAppearance.`);
|
|
8534
|
+
};
|
|
8535
|
+
const stackResult = (id, kind) => kind === "fill" ? { id, fills: _chunkKANRAHTLcjs.vectorFills.call(void 0, pathOf(id)) } : { id, strokes: _chunkKANRAHTLcjs.vectorStrokes.call(void 0, pathOf(id)) };
|
|
8536
|
+
const layerPatchOf = (params, keys) => {
|
|
8537
|
+
const out = {};
|
|
8538
|
+
for (const key of keys) if (params[key] !== void 0) out[key] = key === "paint" ? checkPaint(params[key], "paint") : params[key];
|
|
8539
|
+
return out;
|
|
8540
|
+
};
|
|
8541
|
+
const pathsUnder = (list2) => {
|
|
8542
|
+
const out = [];
|
|
8543
|
+
const walk = (n) => n.type === "path" ? out.push(n.id) : n.children.forEach(walk);
|
|
8544
|
+
for (const id of list2) walk(controller.getNode(id));
|
|
8545
|
+
return out;
|
|
8546
|
+
};
|
|
8547
|
+
const FILL_KEYS = Object.keys(FILL_LAYER_PROPS);
|
|
8548
|
+
const STROKE_KEYS2 = [...FILL_KEYS, ...Object.keys(STROKE_SETTING_PROPS)];
|
|
8549
|
+
const layerCommands = (kind) => {
|
|
8550
|
+
const Kind = kind === "fill" ? "Fill" : "Stroke";
|
|
8551
|
+
const props = kind === "fill" ? FILL_LAYER_PROPS : { ...FILL_LAYER_PROPS, ...STROKE_SETTING_PROPS };
|
|
8552
|
+
const keys = kind === "fill" ? FILL_KEYS : STROKE_KEYS2;
|
|
8553
|
+
const NODE = { type: "string", description: "Id of the path (from vector.list)." };
|
|
8554
|
+
const INDEX = { type: "integer", minimum: 0, description: `Position of the ${kind} in the path's ${kind} stack, 0 at the bottom (from vector.getAppearance).` };
|
|
8555
|
+
const listKey = `${kind}s`;
|
|
8556
|
+
return [
|
|
8557
|
+
{
|
|
8558
|
+
...base,
|
|
8559
|
+
id: `${prefix}add${Kind}`,
|
|
8560
|
+
label: `Add ${Kind}`,
|
|
8561
|
+
keywords: ["appearance", "layer", kind, "stack", "multiple", "paint"],
|
|
8562
|
+
description: kind === "fill" ? "Adds a fill layer to paths (groups: every path inside), on top of the fill stack or at `index`. Fills draw bottom to top, all under the strokes. Returns each path's new fill stack." : "Adds a stroke layer to paths (groups: every path inside), on top of the stroke stack or at `index`, with its own width, alignment, dashes, caps, joins, arrowheads and profile (unset settings come from the stack's current top stroke). Strokes draw bottom to top, over every fill. Returns each path's new stroke stack.",
|
|
8563
|
+
params: {
|
|
8564
|
+
type: "object",
|
|
8565
|
+
properties: {
|
|
8566
|
+
ids: { ...IDS, description: "Paths or groups to add it to (default: the selection; groups give every path inside)." },
|
|
8567
|
+
...props,
|
|
8568
|
+
paint: { ...PAINT, description: `${PAINT.description} Default ${kind === "fill" ? "#808080" : "#000000"}.` },
|
|
8569
|
+
index: { type: "integer", minimum: 0, description: `Where in the stack to put it, 0 at the bottom (default: on top).` }
|
|
8570
|
+
},
|
|
8571
|
+
additionalProperties: false
|
|
8572
|
+
},
|
|
8573
|
+
undoable: true,
|
|
8574
|
+
enabled: enabledFor,
|
|
8575
|
+
run: (_ctx, params) => {
|
|
8576
|
+
const targets = ids(params);
|
|
8577
|
+
check(controller.addPaintLayer(kind, layerPatchOf(_nullishCoalesce(params, () => ( {})), keys), { ids: targets, index: _optionalChain([params, 'optionalAccess', _363 => _363.index]) }));
|
|
8578
|
+
return { nodes: pathsUnder(targets).map((id) => stackResult(id, kind)) };
|
|
8579
|
+
}
|
|
8580
|
+
},
|
|
8581
|
+
{
|
|
8582
|
+
...base,
|
|
8583
|
+
id: `${prefix}update${Kind}`,
|
|
8584
|
+
label: `Edit ${Kind}`,
|
|
8585
|
+
keywords: ["appearance", "layer", kind, "opacity", "blend", "hide", "show"],
|
|
8586
|
+
description: `Changes ${kind} \`index\` of path \`nodeId\`: ${kind === "fill" ? "paint, opacity, blend mode, visibility" : "paint, opacity, blend mode, visibility and any stroke setting (null removes an arrowhead, dashes or a profile)"}. Missing fields keep their value. Returns the path's ${kind} stack.`,
|
|
8587
|
+
params: { type: "object", properties: { nodeId: NODE, index: INDEX, ...props }, required: ["nodeId", "index"], additionalProperties: false },
|
|
8588
|
+
undoable: true,
|
|
8589
|
+
run: (_ctx, params) => {
|
|
8590
|
+
layerIndex(params.nodeId, kind, params.index);
|
|
8591
|
+
const patch = layerPatchOf(params, keys);
|
|
8592
|
+
if (!Object.keys(patch).length) fail(`Pass at least one of: ${keys.join(", ")}.`);
|
|
8593
|
+
check(controller.updatePaintLayer(kind, params.index, patch, { ids: [params.nodeId] }));
|
|
8594
|
+
return stackResult(params.nodeId, kind);
|
|
8595
|
+
}
|
|
8596
|
+
},
|
|
8597
|
+
{
|
|
8598
|
+
...base,
|
|
8599
|
+
id: `${prefix}remove${Kind}`,
|
|
8600
|
+
label: `Remove ${Kind}`,
|
|
8601
|
+
keywords: ["appearance", "layer", kind, "delete"],
|
|
8602
|
+
description: `Removes ${kind} \`index\` from path \`nodeId\`. Returns the path's remaining ${kind} stack.`,
|
|
8603
|
+
params: { type: "object", properties: { nodeId: NODE, index: INDEX }, required: ["nodeId", "index"], additionalProperties: false },
|
|
8604
|
+
undoable: true,
|
|
8605
|
+
run: (_ctx, params) => {
|
|
8606
|
+
layerIndex(params.nodeId, kind, params.index);
|
|
8607
|
+
check(controller.removePaintLayer(kind, params.index, { ids: [params.nodeId] }));
|
|
8608
|
+
return stackResult(params.nodeId, kind);
|
|
8609
|
+
}
|
|
8610
|
+
},
|
|
8611
|
+
{
|
|
8612
|
+
...base,
|
|
8613
|
+
id: `${prefix}move${Kind}`,
|
|
8614
|
+
label: `Reorder ${Kind}s`,
|
|
8615
|
+
keywords: ["appearance", "layer", kind, "order", "reorder", "stack"],
|
|
8616
|
+
description: `Moves ${kind} \`index\` of path \`nodeId\` to position \`to\` in its ${kind} stack (0 is the bottom). Returns the reordered ${listKey}.`,
|
|
8617
|
+
params: {
|
|
8618
|
+
type: "object",
|
|
8619
|
+
properties: { nodeId: NODE, index: INDEX, to: { type: "integer", minimum: 0, description: `New position, 0 at the bottom (clamped to the stack).` } },
|
|
8620
|
+
required: ["nodeId", "index", "to"],
|
|
8621
|
+
additionalProperties: false
|
|
8622
|
+
},
|
|
8623
|
+
undoable: true,
|
|
8624
|
+
run: (_ctx, params) => {
|
|
8625
|
+
layerIndex(params.nodeId, kind, params.index);
|
|
8626
|
+
check(controller.movePaintLayer(kind, params.index, params.to, { ids: [params.nodeId] }));
|
|
8627
|
+
return stackResult(params.nodeId, kind);
|
|
8628
|
+
}
|
|
8629
|
+
}
|
|
8630
|
+
];
|
|
8631
|
+
};
|
|
8632
|
+
const FILTER_PARAMS = {
|
|
8633
|
+
type: "object",
|
|
8634
|
+
description: "Filter parameters (missing ones keep their value or default; lengths in document units). dropShadow / innerShadow: color (CSS), opacity (0 to 1), offsetX, offsetY, blur (radius; reaches about 1.5 times it), spread (inner: choke). outerGlow / innerGlow: color, opacity, blur, spread. layerBlur: radius. feather: radius (edge fade width).",
|
|
8635
|
+
properties: {
|
|
8636
|
+
color: { type: "string", description: "Shadow or glow colour (CSS)." },
|
|
8637
|
+
opacity: { type: "number", minimum: 0, maximum: 1, description: "Shadow or glow opacity, 0 to 1." },
|
|
8638
|
+
offsetX: { type: "number", description: "Shadow offset to the right, document units." },
|
|
8639
|
+
offsetY: { type: "number", description: "Shadow offset downwards, document units." },
|
|
8640
|
+
blur: { type: "number", minimum: 0, description: "Shadow or glow blur radius, document units." },
|
|
8641
|
+
spread: { type: "number", minimum: 0, description: "Grows the silhouette before blurring (inner shadow and glow: chokes inwards)." },
|
|
8642
|
+
radius: { type: "number", minimum: 0, description: "Layer blur radius, or feather width, document units." }
|
|
8643
|
+
},
|
|
8644
|
+
additionalProperties: false
|
|
8645
|
+
};
|
|
8646
|
+
const checkFilterParams = (type, params) => {
|
|
8647
|
+
const allowed = _chunkKANRAHTLcjs.vectorFilterParamKeys.call(void 0, type);
|
|
8648
|
+
for (const key of Object.keys(_nullishCoalesce(params, () => ( {})))) if (!allowed.includes(key)) fail(`${type} has no parameter "${key}"; it takes ${allowed.join(", ")}.`);
|
|
8649
|
+
};
|
|
8650
|
+
const filtersResult = (id) => ({ id, filters: _nullishCoalesce(_optionalChain([controller, 'access', _364 => _364.getNode, 'call', _365 => _365(id), 'optionalAccess', _366 => _366.filters]), () => ( [])) });
|
|
8651
|
+
const filterOf = (nodeId, filterId) => {
|
|
8652
|
+
const node = _nullishCoalesce(controller.getNode(nodeId), () => ( fail(`There is no node "${nodeId}".`)));
|
|
8653
|
+
return _nullishCoalesce(_optionalChain([node, 'access', _367 => _367.filters, 'optionalAccess', _368 => _368.find, 'call', _369 => _369((f) => f.id === filterId)]), () => ( fail(`Node "${nodeId}" has no filter "${filterId}"; it has ${(_nullishCoalesce(node.filters, () => ( []))).map((f) => `"${f.id}" (${f.type})`).join(", ") || "none"}.`)));
|
|
8654
|
+
};
|
|
8655
|
+
const appearanceCommands = () => [
|
|
8656
|
+
{
|
|
8657
|
+
...base,
|
|
8658
|
+
id: `${prefix}getAppearance`,
|
|
8659
|
+
label: "Get Appearance",
|
|
8660
|
+
readOnly: true,
|
|
8661
|
+
keywords: ["appearance", "fills", "strokes", "blend mode", "filters", "shadow"],
|
|
8662
|
+
description: "Reads a node's appearance: for paths the fill and stroke stacks (bottom to top, each with paint, opacity, blendMode, visible and, for strokes, their settings) and fill rule; for any node its blend mode, opacity and filters (with ids). Use the indexes and ids with the fill, stroke and filter commands.",
|
|
8663
|
+
params: { type: "object", properties: { id: { type: "string", description: "Node id (from vector.list)." } }, required: ["id"], additionalProperties: false },
|
|
8664
|
+
run: (_ctx, params) => appearanceOf(params.id)
|
|
8665
|
+
},
|
|
8666
|
+
...layerCommands("fill"),
|
|
8667
|
+
...layerCommands("stroke"),
|
|
8668
|
+
{
|
|
8669
|
+
...base,
|
|
8670
|
+
id: `${prefix}setBlendMode`,
|
|
8671
|
+
label: "Blend Mode\u2026",
|
|
8672
|
+
keywords: ["blend", "multiply", "screen", "overlay", "mix-blend-mode", "composite"],
|
|
8673
|
+
description: "Sets how whole nodes (paths or groups, with everything they draw) mix with what is under them. `normal` removes it. Returns each node's blend mode.",
|
|
8674
|
+
params: {
|
|
8675
|
+
type: "object",
|
|
8676
|
+
properties: { ids: IDS, blendMode: { ...BLEND_MODE, description: "The blend mode (CSS mix-blend-mode names; linear-dodge draws as plus-lighter)." } },
|
|
8677
|
+
required: ["blendMode"],
|
|
8678
|
+
additionalProperties: false
|
|
8679
|
+
},
|
|
8680
|
+
undoable: true,
|
|
8681
|
+
enabled: enabledFor,
|
|
8682
|
+
run: (_ctx, params) => {
|
|
8683
|
+
const targets = ids(params);
|
|
8684
|
+
check(controller.setBlendMode(params.blendMode, { ids: targets }));
|
|
8685
|
+
return { nodes: targets.map((id) => ({ id, blendMode: _nullishCoalesce(_optionalChain([controller, 'access', _370 => _370.getNode, 'call', _371 => _371(id), 'optionalAccess', _372 => _372.blendMode]), () => ( "normal")) })) };
|
|
8686
|
+
}
|
|
8687
|
+
},
|
|
8688
|
+
{
|
|
8689
|
+
...base,
|
|
8690
|
+
id: `${prefix}addFilter`,
|
|
8691
|
+
label: "Add Filter\u2026",
|
|
8692
|
+
keywords: ["filter", "drop shadow", "inner shadow", "glow", "blur", "feather", "effect", "appearance"],
|
|
8693
|
+
description: "Adds a visual filter `type` (dropShadow, innerShadow, outerGlow, innerGlow, layerBlur, feather) to nodes (paths or groups), at the end of each filter stack or at `index`. Filters never change geometry (bounds and hit-testing ignore them) and export as SVG filters. Returns each node's new filter id and its filter stack.",
|
|
8694
|
+
params: {
|
|
8695
|
+
type: "object",
|
|
8696
|
+
properties: {
|
|
8697
|
+
type: { type: "string", enum: _chunkKANRAHTLcjs.VECTOR_FILTER_TYPES, description: "The filter type." },
|
|
8698
|
+
params: FILTER_PARAMS,
|
|
8699
|
+
index: { type: "integer", minimum: 0, description: "Position in the stack (default: last)." },
|
|
8700
|
+
ids: IDS
|
|
8701
|
+
},
|
|
8702
|
+
required: ["type"],
|
|
8703
|
+
additionalProperties: false
|
|
8704
|
+
},
|
|
8705
|
+
undoable: true,
|
|
8706
|
+
enabled: enabledFor,
|
|
8707
|
+
run: (_ctx, params) => {
|
|
8708
|
+
if (!_chunkKANRAHTLcjs.VECTOR_FILTER_TYPES.includes(params.type)) fail(`Unknown filter type "${params.type}"; use one of ${_chunkKANRAHTLcjs.VECTOR_FILTER_TYPES.join(", ")}.`);
|
|
8709
|
+
checkFilterParams(params.type, params.params);
|
|
8710
|
+
const targets = ids(params);
|
|
8711
|
+
const created = controller.addFilter(params.type, { ids: targets, params: params.params, index: params.index });
|
|
8712
|
+
if (!created.length) fail("Nothing to add the filter to (blend steps take no filters).");
|
|
8713
|
+
return { nodes: targets.map((id, i) => ({ filterId: created[i], ...filtersResult(id) })) };
|
|
8714
|
+
}
|
|
8715
|
+
},
|
|
8716
|
+
{
|
|
8717
|
+
...base,
|
|
8718
|
+
id: `${prefix}updateFilter`,
|
|
8719
|
+
label: "Edit Filter\u2026",
|
|
8720
|
+
keywords: ["filter", "shadow", "glow", "blur", "feather", "enable", "disable"],
|
|
8721
|
+
description: "Changes filter `filterId` of node `nodeId`: its `params` (merged; only the keys its type takes) and whether it is `enabled`. Returns the node's filter stack.",
|
|
8722
|
+
params: {
|
|
8723
|
+
type: "object",
|
|
8724
|
+
properties: {
|
|
8725
|
+
nodeId: { type: "string", description: "Node id." },
|
|
8726
|
+
filterId: { type: "string", description: "Filter id (from vector.addFilter or vector.getAppearance)." },
|
|
8727
|
+
params: FILTER_PARAMS,
|
|
8728
|
+
enabled: { type: "boolean", description: "false turns the filter off (kept in the stack)." }
|
|
8729
|
+
},
|
|
8730
|
+
required: ["nodeId", "filterId"],
|
|
8731
|
+
additionalProperties: false
|
|
8732
|
+
},
|
|
8733
|
+
undoable: true,
|
|
8734
|
+
run: (_ctx, params) => {
|
|
8735
|
+
const filter = filterOf(params.nodeId, params.filterId);
|
|
8736
|
+
checkFilterParams(filter.type, params.params);
|
|
8737
|
+
if (params.params === void 0 && params.enabled === void 0) fail("Pass params or enabled.");
|
|
8738
|
+
check(controller.updateFilter(params.nodeId, params.filterId, { params: params.params, enabled: params.enabled }));
|
|
8739
|
+
return filtersResult(params.nodeId);
|
|
8740
|
+
}
|
|
8741
|
+
},
|
|
8742
|
+
{
|
|
8743
|
+
...base,
|
|
8744
|
+
id: `${prefix}removeFilter`,
|
|
8745
|
+
label: "Remove Filter",
|
|
8746
|
+
keywords: ["filter", "delete", "shadow", "blur"],
|
|
8747
|
+
description: "Removes filter `filterId` from node `nodeId`. Returns the node's remaining filters.",
|
|
8748
|
+
params: {
|
|
8749
|
+
type: "object",
|
|
8750
|
+
properties: { nodeId: { type: "string", description: "Node id." }, filterId: { type: "string", description: "Filter id." } },
|
|
8751
|
+
required: ["nodeId", "filterId"],
|
|
8752
|
+
additionalProperties: false
|
|
8753
|
+
},
|
|
8754
|
+
undoable: true,
|
|
8755
|
+
run: (_ctx, params) => {
|
|
8756
|
+
filterOf(params.nodeId, params.filterId);
|
|
8757
|
+
check(controller.removeFilter(params.nodeId, params.filterId));
|
|
8758
|
+
return filtersResult(params.nodeId);
|
|
8759
|
+
}
|
|
8760
|
+
},
|
|
8761
|
+
{
|
|
8762
|
+
...base,
|
|
8763
|
+
id: `${prefix}moveFilter`,
|
|
8764
|
+
label: "Reorder Filters",
|
|
8765
|
+
keywords: ["filter", "order", "reorder"],
|
|
8766
|
+
description: "Moves filter `filterId` of node `nodeId` to position `index` of its stack. Order matters within a kind: later drop shadows draw over earlier ones, later inner effects over earlier ones. Returns the reordered filters.",
|
|
8767
|
+
params: {
|
|
8768
|
+
type: "object",
|
|
8769
|
+
properties: {
|
|
8770
|
+
nodeId: { type: "string", description: "Node id." },
|
|
8771
|
+
filterId: { type: "string", description: "Filter id." },
|
|
8772
|
+
index: { type: "integer", minimum: 0, description: "New position, 0 first (clamped to the stack)." }
|
|
8773
|
+
},
|
|
8774
|
+
required: ["nodeId", "filterId", "index"],
|
|
8775
|
+
additionalProperties: false
|
|
8776
|
+
},
|
|
8777
|
+
undoable: true,
|
|
8778
|
+
run: (_ctx, params) => {
|
|
8779
|
+
filterOf(params.nodeId, params.filterId);
|
|
8780
|
+
check(controller.moveFilter(params.nodeId, params.filterId, params.index));
|
|
8781
|
+
return filtersResult(params.nodeId);
|
|
8782
|
+
}
|
|
8783
|
+
}
|
|
8784
|
+
];
|
|
8064
8785
|
return [
|
|
8065
8786
|
{
|
|
8066
8787
|
...base,
|
|
@@ -8100,7 +8821,7 @@ function createVectorCommands(controller, options = {}) {
|
|
|
8100
8821
|
width: { type: "number", description: "For a line: the x offset of its end." },
|
|
8101
8822
|
height: { type: "number", description: "For a line: the y offset of its end." },
|
|
8102
8823
|
cornerRadius: { type: "number", minimum: 0, description: "Live corner radius of a rect, polygon or star." },
|
|
8103
|
-
cornerKind: { type: "string", enum:
|
|
8824
|
+
cornerKind: { type: "string", enum: _chunkKANRAHTLcjs.VECTOR_CORNER_KINDS },
|
|
8104
8825
|
sides: { type: "integer", minimum: 3 },
|
|
8105
8826
|
points: { type: "integer", minimum: 3 },
|
|
8106
8827
|
innerRatio: { type: "number", minimum: 0, maximum: 1 },
|
|
@@ -8123,7 +8844,7 @@ function createVectorCommands(controller, options = {}) {
|
|
|
8123
8844
|
run: (_ctx, params) => {
|
|
8124
8845
|
const id = controller.addPath(params.d, { ...pickStyle(params), ...params.name ? { name: params.name } : {} });
|
|
8125
8846
|
const node = controller.getNode(id);
|
|
8126
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
8847
|
+
if (_optionalChain([node, 'optionalAccess', _373 => _373.type]) === "path" && !node.subpaths.length) {
|
|
8127
8848
|
controller.undo();
|
|
8128
8849
|
fail("The path data has no points.");
|
|
8129
8850
|
}
|
|
@@ -8157,28 +8878,29 @@ function createVectorCommands(controller, options = {}) {
|
|
|
8157
8878
|
undoable: true,
|
|
8158
8879
|
run: (_ctx, params) => {
|
|
8159
8880
|
const { ids: _i, target, ...patch } = _nullishCoalesce(params, () => ( {}));
|
|
8160
|
-
if (patch.type !== void 0 && !
|
|
8881
|
+
if (patch.type !== void 0 && !_chunkKANRAHTLcjs.VECTOR_GRADIENT_TYPES.includes(patch.type)) fail(`Unknown gradient type "${patch.type}".`);
|
|
8161
8882
|
if (patch.stops !== void 0 && !(Array.isArray(patch.stops) && patch.stops.length)) fail("stops needs at least one { offset, color }.");
|
|
8162
8883
|
check(controller.setGradient(patch, { ids: ids(params), target: _nullishCoalesce(target, () => ( "fill")) }));
|
|
8163
8884
|
const id = ids(params)[0];
|
|
8164
8885
|
const node = id ? controller.getNode(id) : void 0;
|
|
8165
|
-
const path = _optionalChain([node, 'optionalAccess',
|
|
8886
|
+
const path = _optionalChain([node, 'optionalAccess', _374 => _374.type]) === "path" ? node : void 0;
|
|
8166
8887
|
return { ok: true, ...path ? { gradient: path[_nullishCoalesce(target, () => ( "fill"))] } : {} };
|
|
8167
8888
|
}
|
|
8168
8889
|
},
|
|
8890
|
+
...appearanceCommands(),
|
|
8169
8891
|
{
|
|
8170
8892
|
...base,
|
|
8171
8893
|
id: `${prefix}setCorners`,
|
|
8172
8894
|
label: "Corner Radius\u2026",
|
|
8173
8895
|
keywords: ["round", "rounded", "corners", "radius", "fillet", "chamfer", "live corners"],
|
|
8174
8896
|
description: "Sets the live corner radius (and optionally `kind`: round, inverted or chamfer) of `anchors`, else the selected points (direct tool), else every corner of `ids` / the selection. Radius 0 makes corners sharp; radii shrink to fit short sides. The anchors stay editable.",
|
|
8175
|
-
params: { type: "object", properties: { radius: { type: "number", minimum: 0 }, kind: { type: "string", enum:
|
|
8897
|
+
params: { type: "object", properties: { radius: { type: "number", minimum: 0 }, kind: { type: "string", enum: _chunkKANRAHTLcjs.VECTOR_CORNER_KINDS }, ids: IDS, anchors: ANCHORS } },
|
|
8176
8898
|
undoable: true,
|
|
8177
8899
|
run: (_ctx, params) => {
|
|
8178
|
-
const refs = _optionalChain([params, 'optionalAccess',
|
|
8179
|
-
const target = { refs, ids: _optionalChain([params, 'optionalAccess',
|
|
8180
|
-
if (_optionalChain([params, 'optionalAccess',
|
|
8181
|
-
else if (_optionalChain([params, 'optionalAccess',
|
|
8900
|
+
const refs = _optionalChain([params, 'optionalAccess', _375 => _375.anchors]) ? anchorsOf(params.anchors) : void 0;
|
|
8901
|
+
const target = { refs, ids: _optionalChain([params, 'optionalAccess', _376 => _376.ids]) ? ids(params) : void 0 };
|
|
8902
|
+
if (_optionalChain([params, 'optionalAccess', _377 => _377.radius]) !== void 0) check(controller.setCornerRadius(params.radius, { ...target, kind: params.kind }));
|
|
8903
|
+
else if (_optionalChain([params, 'optionalAccess', _378 => _378.kind])) check(controller.setCornerKind(params.kind, target));
|
|
8182
8904
|
else fail("Pass `radius` and / or `kind`.");
|
|
8183
8905
|
return { ok: true };
|
|
8184
8906
|
}
|
|
@@ -8193,7 +8915,7 @@ function createVectorCommands(controller, options = {}) {
|
|
|
8193
8915
|
type: "object",
|
|
8194
8916
|
properties: {
|
|
8195
8917
|
ids: IDS,
|
|
8196
|
-
preset: { type: "string", enum:
|
|
8918
|
+
preset: { type: "string", enum: _chunkKANRAHTLcjs.VECTOR_WIDTH_PRESET_IDS },
|
|
8197
8919
|
points: WIDTH_POINTS,
|
|
8198
8920
|
taper: {
|
|
8199
8921
|
type: "object",
|
|
@@ -8213,12 +8935,12 @@ function createVectorCommands(controller, options = {}) {
|
|
|
8213
8935
|
undoable: true,
|
|
8214
8936
|
run: (_ctx, params) => {
|
|
8215
8937
|
const target = { ids: ids(params) };
|
|
8216
|
-
if (_optionalChain([params, 'optionalAccess',
|
|
8217
|
-
else if (_optionalChain([params, 'optionalAccess',
|
|
8218
|
-
else if (_optionalChain([params, 'optionalAccess',
|
|
8938
|
+
if (_optionalChain([params, 'optionalAccess', _379 => _379.preset])) check(controller.setWidthProfile(params.preset, target));
|
|
8939
|
+
else if (_optionalChain([params, 'optionalAccess', _380 => _380.points]) !== void 0) check(controller.setWidthProfile(_nullishCoalesce(params.points, () => ( null)), target));
|
|
8940
|
+
else if (_optionalChain([params, 'optionalAccess', _381 => _381.taper]) || _optionalChain([params, 'optionalAccess', _382 => _382.wave])) check(controller.setWidthProfile({ taper: params.taper, wave: params.wave }, target));
|
|
8219
8941
|
else fail("Pass `preset`, `points`, `taper` or `wave`.");
|
|
8220
8942
|
const node = controller.getNode(target.ids[0]);
|
|
8221
|
-
return { ok: true, points: _optionalChain([node, 'optionalAccess',
|
|
8943
|
+
return { ok: true, points: _optionalChain([node, 'optionalAccess', _383 => _383.type]) === "path" ? _nullishCoalesce(node.strokeWidthProfile, () => ( [])) : [] };
|
|
8222
8944
|
}
|
|
8223
8945
|
},
|
|
8224
8946
|
{
|
|
@@ -8240,10 +8962,10 @@ function createVectorCommands(controller, options = {}) {
|
|
|
8240
8962
|
},
|
|
8241
8963
|
undoable: true,
|
|
8242
8964
|
run: (_ctx, params) => {
|
|
8243
|
-
if (!_optionalChain([params, 'optionalAccess',
|
|
8965
|
+
if (!_optionalChain([params, 'optionalAccess', _384 => _384.id])) fail("Pass the path `id`.");
|
|
8244
8966
|
check(controller.setWidthPoint({ nodeId: params.id, index: _nullishCoalesce(params.index, () => ( null)) }, { t: params.t, left: params.left, right: params.right }));
|
|
8245
8967
|
const node = controller.getNode(params.id);
|
|
8246
|
-
return { ok: true, points: _optionalChain([node, 'optionalAccess',
|
|
8968
|
+
return { ok: true, points: _optionalChain([node, 'optionalAccess', _385 => _385.type]) === "path" ? _nullishCoalesce(node.strokeWidthProfile, () => ( [])) : [] };
|
|
8247
8969
|
}
|
|
8248
8970
|
},
|
|
8249
8971
|
{
|
|
@@ -8256,7 +8978,7 @@ function createVectorCommands(controller, options = {}) {
|
|
|
8256
8978
|
enabled: enabledFor,
|
|
8257
8979
|
undoable: true,
|
|
8258
8980
|
run: (_ctx, params) => {
|
|
8259
|
-
const created = controller.outlineStroke({ ids: _optionalChain([params, 'optionalAccess',
|
|
8981
|
+
const created = controller.outlineStroke({ ids: _optionalChain([params, 'optionalAccess', _386 => _386.ids]) ? ids(params) : void 0 });
|
|
8260
8982
|
if (!created.length) fail("No selected path has a stroke.");
|
|
8261
8983
|
return { ids: created };
|
|
8262
8984
|
}
|
|
@@ -8341,7 +9063,7 @@ function createVectorCommands(controller, options = {}) {
|
|
|
8341
9063
|
if (params.release) return { released: target, shapes: controller.releaseEnvelope({ ids: target }) };
|
|
8342
9064
|
if (params.expand) return { expanded: controller.expandAppearance({ ids: target }) };
|
|
8343
9065
|
if (params.topObject) {
|
|
8344
|
-
const r = controller.makeEnvelopeWithTopObject({ ids: target, rows: _optionalChain([params, 'access',
|
|
9066
|
+
const r = controller.makeEnvelopeWithTopObject({ ids: target, rows: _optionalChain([params, 'access', _387 => _387.mesh, 'optionalAccess', _388 => _388.rows]), columns: _optionalChain([params, 'access', _389 => _389.mesh, 'optionalAccess', _390 => _390.columns]) });
|
|
8345
9067
|
check(r);
|
|
8346
9068
|
return { nodeId: r.nodeId };
|
|
8347
9069
|
}
|
|
@@ -8443,7 +9165,7 @@ function createVectorCommands(controller, options = {}) {
|
|
|
8443
9165
|
params: {
|
|
8444
9166
|
type: "object",
|
|
8445
9167
|
properties: {
|
|
8446
|
-
type: { type: "string", enum:
|
|
9168
|
+
type: { type: "string", enum: _chunkKANRAHTLcjs.VECTOR_EFFECT_TYPES },
|
|
8447
9169
|
params: { type: "object", description: EFFECT_PARAMS_DESCRIPTION },
|
|
8448
9170
|
index: { type: "integer", minimum: 0, description: "Position in the stack (default: last)." },
|
|
8449
9171
|
ids: IDS
|
|
@@ -8453,7 +9175,7 @@ function createVectorCommands(controller, options = {}) {
|
|
|
8453
9175
|
undoable: true,
|
|
8454
9176
|
enabled: enabledFor,
|
|
8455
9177
|
run: (_ctx, params) => {
|
|
8456
|
-
if (!
|
|
9178
|
+
if (!_chunkKANRAHTLcjs.VECTOR_EFFECT_TYPES.includes(params.type)) fail(`Unknown effect type "${params.type}".`);
|
|
8457
9179
|
const targets = ids(params);
|
|
8458
9180
|
const created = controller.addEffect(params.type, { ids: targets, params: params.params, index: params.index });
|
|
8459
9181
|
if (!created.length) fail("Nothing to add the effect to.");
|
|
@@ -8481,7 +9203,7 @@ function createVectorCommands(controller, options = {}) {
|
|
|
8481
9203
|
run: (_ctx, params) => {
|
|
8482
9204
|
if (params.params !== void 0 || params.enabled !== void 0) check(controller.updateEffect(params.nodeId, params.effectId, { params: params.params, enabled: params.enabled }));
|
|
8483
9205
|
if (params.index !== void 0) check(controller.moveEffect(params.nodeId, params.effectId, params.index));
|
|
8484
|
-
return { effects: _nullishCoalesce(_optionalChain([controller, 'access',
|
|
9206
|
+
return { effects: _nullishCoalesce(_optionalChain([controller, 'access', _391 => _391.getNode, 'call', _392 => _392(params.nodeId), 'optionalAccess', _393 => _393.effects]), () => ( [])) };
|
|
8485
9207
|
}
|
|
8486
9208
|
},
|
|
8487
9209
|
{
|
|
@@ -8545,7 +9267,7 @@ function createVectorCommands(controller, options = {}) {
|
|
|
8545
9267
|
undoable: true,
|
|
8546
9268
|
run: (_ctx, params) => {
|
|
8547
9269
|
checkBlendOptions(params);
|
|
8548
|
-
const r = controller.setBlendOptions(_nullishCoalesce(params, () => ( {})), { ids: _optionalChain([params, 'optionalAccess',
|
|
9270
|
+
const r = controller.setBlendOptions(_nullishCoalesce(params, () => ( {})), { ids: _optionalChain([params, 'optionalAccess', _394 => _394.ids]) });
|
|
8549
9271
|
if (!r.ok) fail(r.message);
|
|
8550
9272
|
return { ok: true };
|
|
8551
9273
|
}
|
|
@@ -8559,7 +9281,7 @@ function createVectorCommands(controller, options = {}) {
|
|
|
8559
9281
|
params: { type: "object", properties: { ids: IDS } },
|
|
8560
9282
|
undoable: true,
|
|
8561
9283
|
run: (_ctx, params) => {
|
|
8562
|
-
const groups = controller.expandBlend({ ids: _optionalChain([params, 'optionalAccess',
|
|
9284
|
+
const groups = controller.expandBlend({ ids: _optionalChain([params, 'optionalAccess', _395 => _395.ids]) });
|
|
8563
9285
|
if (!groups.length) fail("Select a blend to expand.");
|
|
8564
9286
|
return { ids: groups };
|
|
8565
9287
|
}
|
|
@@ -8573,7 +9295,7 @@ function createVectorCommands(controller, options = {}) {
|
|
|
8573
9295
|
params: { type: "object", properties: { ids: IDS } },
|
|
8574
9296
|
undoable: true,
|
|
8575
9297
|
run: (_ctx, params) => {
|
|
8576
|
-
const released = controller.releaseBlend({ ids: _optionalChain([params, 'optionalAccess',
|
|
9298
|
+
const released = controller.releaseBlend({ ids: _optionalChain([params, 'optionalAccess', _396 => _396.ids]) });
|
|
8577
9299
|
if (!released.length) fail("Select a blend to release.");
|
|
8578
9300
|
return { ids: released };
|
|
8579
9301
|
}
|
|
@@ -8587,7 +9309,7 @@ function createVectorCommands(controller, options = {}) {
|
|
|
8587
9309
|
params: { type: "object", properties: { ids: IDS } },
|
|
8588
9310
|
undoable: true,
|
|
8589
9311
|
run: (_ctx, params) => {
|
|
8590
|
-
const r = controller.replaceBlendSpine({ ids: _optionalChain([params, 'optionalAccess',
|
|
9312
|
+
const r = controller.replaceBlendSpine({ ids: _optionalChain([params, 'optionalAccess', _397 => _397.ids]) });
|
|
8591
9313
|
if (!r.ok) fail(r.message);
|
|
8592
9314
|
return { ok: true };
|
|
8593
9315
|
}
|
|
@@ -8598,10 +9320,10 @@ function createVectorCommands(controller, options = {}) {
|
|
|
8598
9320
|
label: "Pathfinder\u2026",
|
|
8599
9321
|
keywords: ["divide", "trim", "merge", "crop", "outline", "minus back", "split", "faces"],
|
|
8600
9322
|
description: "Pathfinder over the given paths (bottom to top): divide (every face its own shape, painted like the top-most shape over it; open unfilled paths cut), trim (hidden parts removed), merge (trim, then touching parts of one fill joined), crop (the top shape crops the others), outline (outlines cut into open strokes where they meet) or minusBack (the top shape minus everything below). Results replace the paths, grouped when there are several.",
|
|
8601
|
-
params: { type: "object", properties: { operation: { type: "string", enum: [...
|
|
9323
|
+
params: { type: "object", properties: { operation: { type: "string", enum: [..._chunkKANRAHTLcjs.VECTOR_PATHFINDER_OPERATIONS] }, ids: IDS }, required: ["operation"] },
|
|
8602
9324
|
undoable: true,
|
|
8603
9325
|
run: (_ctx, params) => {
|
|
8604
|
-
if (!
|
|
9326
|
+
if (!_chunkKANRAHTLcjs.VECTOR_PATHFINDER_OPERATIONS.includes(params.operation)) fail(`Unknown Pathfinder operation "${params.operation}".`);
|
|
8605
9327
|
const created = controller.pathfinder(params.operation, { ids: ids(params) });
|
|
8606
9328
|
if (!created.length) fail("Nothing came out: select paths that overlap (two or more, except for divide and outline).");
|
|
8607
9329
|
return { ids: created, selection: [...controller.getState().selection] };
|
|
@@ -8701,7 +9423,7 @@ function createVectorCommands(controller, options = {}) {
|
|
|
8701
9423
|
enabled: enabledFor,
|
|
8702
9424
|
undoable: true,
|
|
8703
9425
|
run: (_ctx, params) => {
|
|
8704
|
-
const id = controller.group({ ids: ids(params), name: _optionalChain([params, 'optionalAccess',
|
|
9426
|
+
const id = controller.group({ ids: ids(params), name: _optionalChain([params, 'optionalAccess', _398 => _398.name]) });
|
|
8705
9427
|
if (!id) fail("Only nodes that share a parent can be grouped.");
|
|
8706
9428
|
return { id };
|
|
8707
9429
|
}
|
|
@@ -8729,7 +9451,7 @@ function createVectorCommands(controller, options = {}) {
|
|
|
8729
9451
|
params: { type: "object", properties: { anchors: ANCHORS, keepShape: { type: "boolean" } } },
|
|
8730
9452
|
undoable: true,
|
|
8731
9453
|
run: (_ctx, params) => {
|
|
8732
|
-
check(controller.deleteAnchors(anchorsOf(_optionalChain([params, 'optionalAccess',
|
|
9454
|
+
check(controller.deleteAnchors(anchorsOf(_optionalChain([params, 'optionalAccess', _399 => _399.anchors])), { keepShape: _optionalChain([params, 'optionalAccess', _400 => _400.keepShape]) }));
|
|
8733
9455
|
return { ok: true };
|
|
8734
9456
|
}
|
|
8735
9457
|
},
|
|
@@ -8784,7 +9506,7 @@ function createVectorCommands(controller, options = {}) {
|
|
|
8784
9506
|
params: { type: "object", properties: { ids: IDS, tolerance: { type: "number", minimum: 0 } } },
|
|
8785
9507
|
undoable: true,
|
|
8786
9508
|
run: (_ctx, params) => {
|
|
8787
|
-
check(controller.joinPaths({ ids: _optionalChain([params, 'optionalAccess',
|
|
9509
|
+
check(controller.joinPaths({ ids: _optionalChain([params, 'optionalAccess', _401 => _401.ids]) ? ids(params) : void 0, tolerance: _optionalChain([params, 'optionalAccess', _402 => _402.tolerance]) }));
|
|
8788
9510
|
return { selection: controller.getState().selection };
|
|
8789
9511
|
}
|
|
8790
9512
|
},
|
|
@@ -8798,7 +9520,7 @@ function createVectorCommands(controller, options = {}) {
|
|
|
8798
9520
|
params: { type: "object", properties: { axis: { type: "string", enum: ["horizontal", "vertical", "both"] }, anchors: ANCHORS } },
|
|
8799
9521
|
undoable: true,
|
|
8800
9522
|
run: (_ctx, params) => {
|
|
8801
|
-
check(controller.averageAnchors(_nullishCoalesce(_optionalChain([params, 'optionalAccess',
|
|
9523
|
+
check(controller.averageAnchors(_nullishCoalesce(_optionalChain([params, 'optionalAccess', _403 => _403.axis]), () => ( "both")), anchorsOf(_optionalChain([params, 'optionalAccess', _404 => _404.anchors]))));
|
|
8802
9524
|
return { ok: true };
|
|
8803
9525
|
}
|
|
8804
9526
|
},
|
|
@@ -8812,7 +9534,7 @@ function createVectorCommands(controller, options = {}) {
|
|
|
8812
9534
|
enabled: enabledFor,
|
|
8813
9535
|
undoable: true,
|
|
8814
9536
|
run: (_ctx, params) => {
|
|
8815
|
-
check(controller.removeRedundantPoints({ ids: _optionalChain([params, 'optionalAccess',
|
|
9537
|
+
check(controller.removeRedundantPoints({ ids: _optionalChain([params, 'optionalAccess', _405 => _405.ids]) ? ids(params) : void 0, tolerance: _optionalChain([params, 'optionalAccess', _406 => _406.tolerance]) }));
|
|
8816
9538
|
return { ok: true };
|
|
8817
9539
|
}
|
|
8818
9540
|
},
|
|
@@ -8825,7 +9547,7 @@ function createVectorCommands(controller, options = {}) {
|
|
|
8825
9547
|
params: { type: "object", properties: { ids: IDS, amount: { type: "number", minimum: 0, maximum: 1 }, anchors: ANCHORS } },
|
|
8826
9548
|
undoable: true,
|
|
8827
9549
|
run: (_ctx, params) => {
|
|
8828
|
-
check(controller.smoothPaths({ ids: _optionalChain([params, 'optionalAccess',
|
|
9550
|
+
check(controller.smoothPaths({ ids: _optionalChain([params, 'optionalAccess', _407 => _407.ids]) ? ids(params) : void 0, amount: _optionalChain([params, 'optionalAccess', _408 => _408.amount]), refs: _optionalChain([params, 'optionalAccess', _409 => _409.anchors]) }));
|
|
8829
9551
|
return { ok: true };
|
|
8830
9552
|
}
|
|
8831
9553
|
},
|
|
@@ -8838,14 +9560,14 @@ function createVectorCommands(controller, options = {}) {
|
|
|
8838
9560
|
params: { type: "object", properties: { nodeId: { type: "string" }, x: { type: "number" }, y: { type: "number" }, anchors: ANCHORS } },
|
|
8839
9561
|
undoable: true,
|
|
8840
9562
|
run: (_ctx, params) => {
|
|
8841
|
-
if (_optionalChain([params, 'optionalAccess',
|
|
9563
|
+
if (_optionalChain([params, 'optionalAccess', _410 => _410.nodeId]) !== void 0) {
|
|
8842
9564
|
if (!controller.getNode(params.nodeId)) fail(`There is no node "${params.nodeId}".`);
|
|
8843
9565
|
if (params.x === void 0 || params.y === void 0) fail("Pass x and y with nodeId.");
|
|
8844
9566
|
const created = controller.cutPathAt(params.nodeId, { x: params.x, y: params.y });
|
|
8845
9567
|
if (!created) fail("Nothing to cut there (the end of an open path, or a locked path).");
|
|
8846
9568
|
return { ids: created };
|
|
8847
9569
|
}
|
|
8848
|
-
check(controller.cutAtAnchors(anchorsOf(_optionalChain([params, 'optionalAccess',
|
|
9570
|
+
check(controller.cutAtAnchors(anchorsOf(_optionalChain([params, 'optionalAccess', _411 => _411.anchors]))));
|
|
8849
9571
|
return { ids: controller.getState().selection };
|
|
8850
9572
|
}
|
|
8851
9573
|
},
|
|
@@ -8896,7 +9618,7 @@ function createVectorCommands(controller, options = {}) {
|
|
|
8896
9618
|
},
|
|
8897
9619
|
run: (_ctx, params) => {
|
|
8898
9620
|
const patch = {};
|
|
8899
|
-
for (const key of ["keepShapeOnDelete", "curvatureMoves", "pencilSmoothing", "recognizeShapes", "eraserSize", "pencilPressure"]) if (_optionalChain([params, 'optionalAccess',
|
|
9621
|
+
for (const key of ["keepShapeOnDelete", "curvatureMoves", "pencilSmoothing", "recognizeShapes", "eraserSize", "pencilPressure"]) if (_optionalChain([params, 'optionalAccess', _412 => _412[key]]) !== void 0) patch[key] = params[key];
|
|
8900
9622
|
controller.setEditing(patch);
|
|
8901
9623
|
return { editing: controller.getState().editing };
|
|
8902
9624
|
}
|
|
@@ -8907,7 +9629,7 @@ function createVectorCommands(controller, options = {}) {
|
|
|
8907
9629
|
label: "Choose Tool\u2026",
|
|
8908
9630
|
keywords: ["pen", "pencil", "select", "rectangle", "ellipse"],
|
|
8909
9631
|
description: "Switches the canvas tool.",
|
|
8910
|
-
params: { type: "object", properties: { tool: { type: "string", enum: [...
|
|
9632
|
+
params: { type: "object", properties: { tool: { type: "string", enum: [..._chunkKANRAHTLcjs.VECTOR_TOOLS] } }, required: ["tool"] },
|
|
8911
9633
|
run: (_ctx, params) => {
|
|
8912
9634
|
controller.setTool(params.tool);
|
|
8913
9635
|
return { tool: params.tool };
|
|
@@ -8921,7 +9643,7 @@ function createVectorCommands(controller, options = {}) {
|
|
|
8921
9643
|
keywords: ["download", "save", "markup"],
|
|
8922
9644
|
description: "Returns the document as SVG markup.",
|
|
8923
9645
|
params: { type: "object", properties: { precision: { type: "integer", minimum: 0, maximum: 8 } } },
|
|
8924
|
-
run: (_ctx, params) => ({ svg: controller.toSvg({ precision: _optionalChain([params, 'optionalAccess',
|
|
9646
|
+
run: (_ctx, params) => ({ svg: controller.toSvg({ precision: _optionalChain([params, 'optionalAccess', _413 => _413.precision]) }) })
|
|
8925
9647
|
},
|
|
8926
9648
|
{
|
|
8927
9649
|
...base,
|
|
@@ -9329,5 +10051,51 @@ function createVectorCommands(controller, options = {}) {
|
|
|
9329
10051
|
|
|
9330
10052
|
|
|
9331
10053
|
|
|
9332
|
-
exports.DEFAULT_VECTOR_BLEND_DISTANCE = DEFAULT_VECTOR_BLEND_DISTANCE; exports.DEFAULT_VECTOR_BLEND_STEPS = DEFAULT_VECTOR_BLEND_STEPS; exports.DEFAULT_VECTOR_PATH_EDIT = DEFAULT_VECTOR_PATH_EDIT; exports.DEFAULT_VECTOR_SNAP = DEFAULT_VECTOR_SNAP; exports.IDENTITY_MATRIX = _chunkDWGZUSEScjs.IDENTITY_MATRIX; exports.KAPPA = _chunkJF5PXN7Wcjs.KAPPA; exports.LazyMouse = LazyMouse; exports.VECTOR_ARROWHEADS = _chunkJF5PXN7Wcjs.VECTOR_ARROWHEADS; exports.VECTOR_ARROWHEAD_LABELS = VECTOR_ARROWHEAD_LABELS; exports.VECTOR_BLEND_MAX_SMOOTH_STEPS = VECTOR_BLEND_MAX_SMOOTH_STEPS; exports.VECTOR_BLEND_MAX_STEPS = VECTOR_BLEND_MAX_STEPS; exports.VECTOR_BLEND_SPACINGS = _chunkJF5PXN7Wcjs.VECTOR_BLEND_SPACINGS; exports.VECTOR_BLEND_SPACING_LABELS = VECTOR_BLEND_SPACING_LABELS; exports.VECTOR_BUILDER_HATCH_GAP = VECTOR_BUILDER_HATCH_GAP; exports.VECTOR_CLIPBOARD_TYPE = VECTOR_CLIPBOARD_TYPE; exports.VECTOR_CONSTRUCTION_ANGLES = VECTOR_CONSTRUCTION_ANGLES; exports.VECTOR_CORNER_KINDS = _chunkJF5PXN7Wcjs.VECTOR_CORNER_KINDS; exports.VECTOR_CORNER_KIND_LABELS = VECTOR_CORNER_KIND_LABELS; exports.VECTOR_CORNER_WIDGET_INSET = VECTOR_CORNER_WIDGET_INSET; exports.VECTOR_DISTORT_TOLERANCE = VECTOR_DISTORT_TOLERANCE; exports.VECTOR_EDIT_TOGGLES = VECTOR_EDIT_TOGGLES; exports.VECTOR_EFFECT_DEFAULTS = _chunkJF5PXN7Wcjs.VECTOR_EFFECT_DEFAULTS; exports.VECTOR_EFFECT_LABELS = _chunkJF5PXN7Wcjs.VECTOR_EFFECT_LABELS; exports.VECTOR_EFFECT_MENU = VECTOR_EFFECT_MENU; exports.VECTOR_EFFECT_PARAM_SPECS = _chunkJF5PXN7Wcjs.VECTOR_EFFECT_PARAM_SPECS; exports.VECTOR_EFFECT_TYPES = _chunkJF5PXN7Wcjs.VECTOR_EFFECT_TYPES; exports.VECTOR_ENVELOPE_STYLE_OPTIONS = VECTOR_ENVELOPE_STYLE_OPTIONS; exports.VECTOR_FILL_GAP = VECTOR_FILL_GAP; exports.VECTOR_GRADIENT_INTERPOLATIONS = _chunkJF5PXN7Wcjs.VECTOR_GRADIENT_INTERPOLATIONS; exports.VECTOR_GRADIENT_INTERPOLATION_LABELS = VECTOR_GRADIENT_INTERPOLATION_LABELS; exports.VECTOR_GRADIENT_MAX_PERIODS = _chunkJF5PXN7Wcjs.VECTOR_GRADIENT_MAX_PERIODS; exports.VECTOR_GRADIENT_MIDPOINT_GAP = VECTOR_GRADIENT_MIDPOINT_GAP; exports.VECTOR_GRADIENT_MIN_STOPS = _chunkJF5PXN7Wcjs.VECTOR_GRADIENT_MIN_STOPS; exports.VECTOR_GRADIENT_OFF_BAR = VECTOR_GRADIENT_OFF_BAR; exports.VECTOR_GRADIENT_SPREADS = _chunkJF5PXN7Wcjs.VECTOR_GRADIENT_SPREADS; exports.VECTOR_GRADIENT_SPREAD_LABELS = VECTOR_GRADIENT_SPREAD_LABELS; exports.VECTOR_GRADIENT_STOP_GAP = VECTOR_GRADIENT_STOP_GAP; exports.VECTOR_GRADIENT_TYPES = _chunkJF5PXN7Wcjs.VECTOR_GRADIENT_TYPES; exports.VECTOR_GRADIENT_TYPE_LABELS = VECTOR_GRADIENT_TYPE_LABELS; exports.VECTOR_INK_MAX_CORNERS = VECTOR_INK_MAX_CORNERS; exports.VECTOR_MERGE_MODES = _chunkJF5PXN7Wcjs.VECTOR_MERGE_MODES; exports.VECTOR_OVERLAY_THEME = VECTOR_OVERLAY_THEME; exports.VECTOR_PATHFINDER_ACTIONS = VECTOR_PATHFINDER_ACTIONS; exports.VECTOR_PATHFINDER_LABELS = VECTOR_PATHFINDER_LABELS; exports.VECTOR_PATHFINDER_OPERATIONS = _chunkJF5PXN7Wcjs.VECTOR_PATHFINDER_OPERATIONS; exports.VECTOR_PATH_ACTIONS = VECTOR_PATH_ACTIONS; exports.VECTOR_PENCIL_STRING_PX = VECTOR_PENCIL_STRING_PX; exports.VECTOR_PRESSURE_NOMINAL = _chunkJF5PXN7Wcjs.VECTOR_PRESSURE_NOMINAL; exports.VECTOR_ROTATE_HANDLE_OFFSET = VECTOR_ROTATE_HANDLE_OFFSET; exports.VECTOR_STROKE_ALIGN_LABELS = VECTOR_STROKE_ALIGN_LABELS; exports.VECTOR_STROKE_GRADIENT_MODES = _chunkJF5PXN7Wcjs.VECTOR_STROKE_GRADIENT_MODES; exports.VECTOR_STROKE_GRADIENT_MODE_LABELS = VECTOR_STROKE_GRADIENT_MODE_LABELS; exports.VECTOR_STYLE_KEYS = VECTOR_STYLE_KEYS; exports.VECTOR_TOOLS = _chunkJF5PXN7Wcjs.VECTOR_TOOLS; exports.VECTOR_TOOL_GLYPHS = VECTOR_TOOL_GLYPHS; exports.VECTOR_TOOL_SHORTCUTS = VECTOR_TOOL_SHORTCUTS; exports.VECTOR_TRANSFORM_HANDLES = _chunkJF5PXN7Wcjs.VECTOR_TRANSFORM_HANDLES; exports.VECTOR_WARP_STYLES = _chunkDWGZUSEScjs.WARP_STYLES; exports.VECTOR_WARP_STYLE_LABELS = _chunkDWGZUSEScjs.WARP_STYLE_LABELS; exports.VECTOR_WIDTH_PRESETS = _chunkJF5PXN7Wcjs.VECTOR_WIDTH_PRESETS; exports.VECTOR_WIDTH_PRESET_IDS = _chunkJF5PXN7Wcjs.VECTOR_WIDTH_PRESET_IDS; exports.VECTOR_WIDTH_PROFILE_MAX_POINTS = _chunkJF5PXN7Wcjs.VECTOR_WIDTH_PROFILE_MAX_POINTS; exports.VECTOR_WIDTH_PROFILE_MAX_SCALE = _chunkJF5PXN7Wcjs.VECTOR_WIDTH_PROFILE_MAX_SCALE; exports.VECTOR_WIDTH_SAME_T = _chunkJF5PXN7Wcjs.VECTOR_WIDTH_SAME_T; exports.VectorEditorController = VectorEditorController; exports.VectorSnapTargets = VectorSnapTargets; exports.activeVectorEffects = _chunkJF5PXN7Wcjs.activeVectorEffects; exports.addBuilderHit = addBuilderHit; exports.applyMatrix = _chunkDWGZUSEScjs.applyMatrix; exports.applyMatrixLinear = _chunkDWGZUSEScjs.applyMatrixLinear; exports.applyVectorBlendOptions = applyVectorBlendOptions; exports.applyVectorCornersAttribute = _chunkJF5PXN7Wcjs.applyVectorCornersAttribute; exports.applyVectorEffects = _chunkJF5PXN7Wcjs.applyVectorEffects; exports.applyVectorGradientPatch = _chunkJF5PXN7Wcjs.applyVectorGradientPatch; exports.applyVectorGradientSpread = _chunkJF5PXN7Wcjs.applyVectorGradientSpread; exports.applyVectorHomography = _chunkMUUXNRU4cjs.applyHomography; exports.arrowheadInset = _chunkJF5PXN7Wcjs.arrowheadInset; exports.arrowheadPath = _chunkJF5PXN7Wcjs.arrowheadPath; exports.arrowheadWeight = _chunkJF5PXN7Wcjs.arrowheadWeight; exports.bendSegment = bendSegment; exports.bezierToSubpaths = _chunkJF5PXN7Wcjs.bezierToSubpaths; exports.boundsFromPoints = _chunkJF5PXN7Wcjs.boundsFromPoints; exports.boundsIntersect = _chunkJF5PXN7Wcjs.boundsIntersect; exports.clearVectorLiveBooleanCache = _chunkJF5PXN7Wcjs.clearVectorLiveBooleanCache; exports.cloneAnchor = _chunkJF5PXN7Wcjs.cloneAnchor; exports.cloneSubpath = _chunkJF5PXN7Wcjs.cloneSubpath; exports.cloneVectorDocument = _chunkJF5PXN7Wcjs.cloneVectorDocument; exports.cloneVectorNode = _chunkJF5PXN7Wcjs.cloneVectorNode; exports.collectPathNodes = _chunkJF5PXN7Wcjs.collectPathNodes; exports.constrainToLeave = constrainToLeave; exports.convertAnchor = _chunkJF5PXN7Wcjs.convertAnchor; exports.convertVectorGradient = _chunkJF5PXN7Wcjs.convertVectorGradient; exports.cornerBisectorPoint = _chunkJF5PXN7Wcjs.cornerBisectorPoint; exports.cornerRadiusChange = _chunkJF5PXN7Wcjs.cornerRadiusChange; exports.cornerSetback = _chunkJF5PXN7Wcjs.cornerSetback; exports.correspondMorphContours = _chunkJF5PXN7Wcjs.correspondMorphContours; exports.createVectorCommands = createVectorCommands; exports.createVectorEffect = _chunkJF5PXN7Wcjs.createVectorEffect; exports.createVectorMorph = _chunkJF5PXN7Wcjs.createVectorMorph; exports.curvatureMoveAnchor = curvatureMoveAnchor; exports.cutSubpathAt = cutSubpathAt; exports.dashIntervals = _chunkJF5PXN7Wcjs.dashIntervals; exports.decomposeRigid = _chunkDWGZUSEScjs.decomposeRigid; exports.defaultVectorGradient = _chunkJF5PXN7Wcjs.defaultVectorGradient; exports.distortVectorNode = distortVectorNode; exports.dragVectorMeshPoint = _chunkDWGZUSEScjs.dragWarpMeshPoint; exports.effectPathLength = _chunkJF5PXN7Wcjs.effectPathLength; exports.effectPathVertexCount = _chunkJF5PXN7Wcjs.effectPathVertexCount; exports.effectiveStrokeAlign = _chunkJF5PXN7Wcjs.effectiveStrokeAlign; exports.ellipseSubpath = _chunkJF5PXN7Wcjs.ellipseSubpath; exports.eraseFromFill = eraseFromFill; exports.eraseFromOutline = eraseFromOutline; exports.eraserRegion = eraserRegion; exports.evalVectorMesh = _chunkDWGZUSEScjs.evalWarpMesh; exports.evaluateVectorPathKeyframes = _chunkJF5PXN7Wcjs.evaluateVectorPathKeyframes; exports.expandVectorAppearance = _chunkJF5PXN7Wcjs.expandVectorAppearance; exports.expandVectorAppearances = _chunkJF5PXN7Wcjs.expandVectorAppearances; exports.expandVectorBlend = expandVectorBlend; exports.expandVectorCorners = _chunkJF5PXN7Wcjs.expandVectorCorners; exports.expandVectorCornersOf = _chunkJF5PXN7Wcjs.expandVectorCornersOf; exports.expandVectorGradientSpread = _chunkJF5PXN7Wcjs.expandVectorGradientSpread; exports.expandVectorGradientStops = _chunkJF5PXN7Wcjs.expandVectorGradientStops; exports.explicitVectorGradient = _chunkJF5PXN7Wcjs.explicitVectorGradient; exports.findVectorNode = _chunkJF5PXN7Wcjs.findVectorNode; exports.fitCornerRadius = _chunkJF5PXN7Wcjs.fitCornerRadius; exports.fitVectorMesh = _chunkDWGZUSEScjs.fitWarpMesh; exports.foldVectorBooleanOperands = _chunkJF5PXN7Wcjs.foldVectorBooleanOperands; exports.generateVectorBlendChildren = generateVectorBlendChildren; exports.generateWidthProfile = _chunkJF5PXN7Wcjs.generateWidthProfile; exports.getAnchor = getAnchor; exports.getAnchorWorld = getAnchorWorld; exports.getEditablePathIds = getEditablePathIds; exports.getTransformHandlePositions = getTransformHandlePositions; exports.getVectorBlendControls = getVectorBlendControls; exports.getVectorCornerWidgets = getVectorCornerWidgets; exports.getVectorEffectsPanel = getVectorEffectsPanel; exports.getVectorEnteredGroups = getVectorEnteredGroups; exports.getVectorEnvelopePanel = getVectorEnvelopePanel; exports.getVectorEnvelopeTarget = getVectorEnvelopeTarget; exports.getVectorGradientAnnotator = getVectorGradientAnnotator; exports.getVectorGradientEditor = getVectorGradientEditor; exports.getVectorOverlayRenderData = getVectorOverlayRenderData; exports.getVectorSceneRenderData = getVectorSceneRenderData; exports.getVectorSelectionBoxGeometry = getVectorSelectionBoxGeometry; exports.getVectorSelectionFrame = getVectorSelectionFrame; exports.getVectorSelectionStyle = getVectorSelectionStyle; exports.getVectorWidthHandles = getVectorWidthHandles; exports.getVisibleAnchors = getVisibleAnchors; exports.getVisibleHandles = getVisibleHandles; exports.gradientMidpointRemap = _chunkJF5PXN7Wcjs.gradientMidpointRemap; exports.hasExplicitGradientGeometry = _chunkJF5PXN7Wcjs.hasExplicitGradientGeometry; exports.hasOwnVectorAppearance = _chunkJF5PXN7Wcjs.hasOwnVectorAppearance; exports.hasPaint = _chunkJF5PXN7Wcjs.hasPaint; exports.hasStrokeExtras = _chunkJF5PXN7Wcjs.hasStrokeExtras; exports.hasVectorAppearance = _chunkJF5PXN7Wcjs.hasVectorAppearance; exports.hasVectorCorners = _chunkJF5PXN7Wcjs.hasVectorCorners; exports.hitTestVectorNode = _chunkJF5PXN7Wcjs.hitTestVectorNode; exports.hitTestVectorNodes = _chunkJF5PXN7Wcjs.hitTestVectorNodes; exports.hitTestVectorStroke = _chunkJF5PXN7Wcjs.hitTestVectorStroke; exports.hitVectorGradientAnnotator = hitVectorGradientAnnotator; exports.inferAnchorType = _chunkJF5PXN7Wcjs.inferAnchorType; exports.insertAnchor = _chunkJF5PXN7Wcjs.insertAnchor; exports.insertVectorGradientStop = _chunkJF5PXN7Wcjs.insertVectorGradientStop; exports.insertWidthPoint = _chunkJF5PXN7Wcjs.insertWidthPoint; exports.interpolateMorphContours = _chunkJF5PXN7Wcjs.interpolateMorphContours; exports.interpolateRigidMatrix = _chunkJF5PXN7Wcjs.interpolateRigidMatrix; exports.interpolateVectorColor = _chunkJF5PXN7Wcjs.interpolateVectorColor; exports.interpolateVectorPaint = _chunkJF5PXN7Wcjs.interpolateVectorPaint; exports.interpolateVectorPaths = _chunkJF5PXN7Wcjs.interpolateVectorPaths; exports.interpolateVectorStyle = _chunkJF5PXN7Wcjs.interpolateVectorStyle; exports.interpolateWidthProfiles = _chunkJF5PXN7Wcjs.interpolateWidthProfiles; exports.invertMatrix = _chunkDWGZUSEScjs.invertMatrix; exports.isCentredVectorGradient = _chunkJF5PXN7Wcjs.isCentredVectorGradient; exports.isClosedBezierShape = _chunkJF5PXN7Wcjs.isClosedBezierShape; exports.isIdentityMatrix = _chunkDWGZUSEScjs.isIdentityMatrix; exports.isUniformWidthProfile = _chunkJF5PXN7Wcjs.isUniformWidthProfile; exports.isValidVectorMesh = _chunkDWGZUSEScjs.isValidWarpMesh; exports.isVectorBlendGroup = isVectorBlendGroup; exports.isVectorGradient = _chunkJF5PXN7Wcjs.isVectorGradient; exports.isVectorLiveBoolean = _chunkJF5PXN7Wcjs.isVectorLiveBoolean; exports.isVectorTextTarget = isVectorTextTarget; exports.joinSubpaths = joinSubpaths; exports.knifePath = knifePath; exports.lineSubpath = _chunkJF5PXN7Wcjs.lineSubpath; exports.locateVectorNode = _chunkJF5PXN7Wcjs.locateVectorNode; exports.mapBezierPath = _chunkJF5PXN7Wcjs.mapBezierPath; exports.mapVectorGradient = _chunkJF5PXN7Wcjs.mapVectorGradient; exports.mapVectorMeshPoints = _chunkDWGZUSEScjs.mapWarpMeshPoints; exports.mapVectorPaint = _chunkJF5PXN7Wcjs.mapVectorPaint; exports.mapVectorPoints = _chunkJF5PXN7Wcjs.mapVectorPoints; exports.mapVectorSubpaths = _chunkJF5PXN7Wcjs.mapVectorSubpaths; exports.matrixRotation = _chunkDWGZUSEScjs.matrixRotation; exports.mergePaths = _chunkJF5PXN7Wcjs.mergePaths; exports.mirrorWidthProfile = _chunkJF5PXN7Wcjs.mirrorWidthProfile; exports.morphContourToSubpath = _chunkJF5PXN7Wcjs.morphContourToSubpath; exports.morphPathsCross = _chunkJF5PXN7Wcjs.morphPathsCross; exports.moveAnchorHandle = _chunkJF5PXN7Wcjs.moveAnchorHandle; exports.moveVectorGradientHandle = _chunkJF5PXN7Wcjs.moveVectorGradientHandle; exports.moveVectorGradientStop = _chunkJF5PXN7Wcjs.moveVectorGradientStop; exports.multiplyMatrices = _chunkDWGZUSEScjs.multiplyMatrices; exports.nearestSegment = _chunkJF5PXN7Wcjs.nearestSegment; exports.nearestStrokePosition = _chunkJF5PXN7Wcjs.nearestStrokePosition; exports.nextVectorCornerKind = _chunkJF5PXN7Wcjs.nextVectorCornerKind; exports.nodeMatrix = _chunkJF5PXN7Wcjs.nodeMatrix; exports.normalizeVectorEffectParams = _chunkJF5PXN7Wcjs.normalizeVectorEffectParams; exports.offsetPaths = _chunkJF5PXN7Wcjs.offsetPaths; exports.orderVectorQuad = _chunkMUUXNRU4cjs.orderQuad; exports.parseSvgTransform = _chunkJF5PXN7Wcjs.parseSvgTransform; exports.parseVectorColor = _chunkJF5PXN7Wcjs.parseVectorColor; exports.parseVectorSvg = _chunkJF5PXN7Wcjs.parseVectorSvg; exports.pathsCenter = _chunkJF5PXN7Wcjs.pathsCenter; exports.patternAttrs = _chunkJF5PXN7Wcjs.patternAttrs; exports.periodicVectorGradientStops = _chunkJF5PXN7Wcjs.periodicVectorGradientStops; exports.pinVectorGradient = _chunkJF5PXN7Wcjs.pinVectorGradient; exports.planShapeBuilder = planShapeBuilder; exports.polygonSubpath = _chunkJF5PXN7Wcjs.polygonSubpath; exports.polylineBounds = polylineBounds; exports.pressureWidthProfile = _chunkJF5PXN7Wcjs.pressureWidthProfile; exports.puckerBloatPaths = _chunkJF5PXN7Wcjs.puckerBloatPaths; exports.pullVectorMesh = _chunkDWGZUSEScjs.pullWarpMesh; exports.recognizeInkShape = recognizeInkShape; exports.rectSubpath = _chunkJF5PXN7Wcjs.rectSubpath; exports.refineMorphContour = _chunkJF5PXN7Wcjs.refineMorphContour; exports.refreshVectorBlends = refreshVectorBlends; exports.releaseVectorBlend = releaseVectorBlend; exports.removeAnchorKeepingShape = removeAnchorKeepingShape; exports.removeAnchors = _chunkJF5PXN7Wcjs.removeAnchors; exports.removeAnchorsKeepingShape = removeAnchorsKeepingShape; exports.removeRedundantPoints = removeRedundantPoints; exports.removeVectorGradientStop = _chunkJF5PXN7Wcjs.removeVectorGradientStop; exports.removeVectorMeshSplitU = _chunkDWGZUSEScjs.removeWarpMeshSplitU; exports.removeVectorMeshSplitV = _chunkDWGZUSEScjs.removeWarpMeshSplitV; exports.removeWidthPoints = _chunkJF5PXN7Wcjs.removeWidthPoints; exports.repeatPaths = _chunkJF5PXN7Wcjs.repeatPaths; exports.resampleGradientStops = _chunkJF5PXN7Wcjs.resampleGradientStops; exports.resizeVectorMesh = _chunkDWGZUSEScjs.resizeWarpMesh; exports.resolveVectorBlendOptions = resolveVectorBlendOptions; exports.reverseMorphContour = _chunkJF5PXN7Wcjs.reverseMorphContour; exports.reverseSubpath = _chunkJF5PXN7Wcjs.reverseSubpath; exports.reverseVectorGradient = _chunkJF5PXN7Wcjs.reverseVectorGradient; exports.reverseWidthProfile = _chunkJF5PXN7Wcjs.reverseWidthProfile; exports.rotateMatrix = _chunkDWGZUSEScjs.rotateMatrix; exports.roundCornerPaths = _chunkJF5PXN7Wcjs.roundCornerPaths; exports.roundSubpaths = _chunkJF5PXN7Wcjs.roundSubpaths; exports.samplePlainStops = _chunkJF5PXN7Wcjs.samplePlainStops; exports.samplePolyline = samplePolyline; exports.sampleVectorGradient = _chunkJF5PXN7Wcjs.sampleVectorGradient; exports.sampleVectorGradientAt = _chunkJF5PXN7Wcjs.sampleVectorGradientAt; exports.sampleVectorPaintDefAt = _chunkJF5PXN7Wcjs.sampleVectorPaintDefAt; exports.sanitizeVectorEffects = _chunkJF5PXN7Wcjs.sanitizeVectorEffects; exports.sanitizeVectorGradient = _chunkJF5PXN7Wcjs.sanitizeVectorGradient; exports.sanitizeWidthProfile = _chunkJF5PXN7Wcjs.sanitizeWidthProfile; exports.scaleFor = scaleFor; exports.scaleMatrix = _chunkDWGZUSEScjs.scaleMatrix; exports.setAnchorCorner = _chunkJF5PXN7Wcjs.setAnchorCorner; exports.setSubpathCorners = _chunkJF5PXN7Wcjs.setSubpathCorners; exports.setVectorGradientVector = _chunkJF5PXN7Wcjs.setVectorGradientVector; exports.setWidthPoint = _chunkJF5PXN7Wcjs.setWidthPoint; exports.simplifyPolyline = simplifyPolyline; exports.smoothSubpath = smoothSubpath; exports.solve8 = _chunkMUUXNRU4cjs.solve8; exports.sortedVectorGradientStops = _chunkJF5PXN7Wcjs.sortedVectorGradientStops; exports.spanVectorGradientStops = _chunkJF5PXN7Wcjs.spanVectorGradientStops; exports.splitIntoFaces = splitIntoFaces; exports.splitSubpathAt = splitSubpathAt; exports.splitVectorMeshU = _chunkDWGZUSEScjs.splitWarpMeshU; exports.splitVectorMeshV = _chunkDWGZUSEScjs.splitWarpMeshV; exports.starSubpath = _chunkJF5PXN7Wcjs.starSubpath; exports.strokePositionPoint = _chunkJF5PXN7Wcjs.strokePositionPoint; exports.strokeWidthProfileOf = _chunkJF5PXN7Wcjs.strokeWidthProfileOf; exports.subpathEnclosesArea = subpathEnclosesArea; exports.subpathPointAt = subpathPointAt; exports.subpathSegment = _chunkJF5PXN7Wcjs.subpathSegment; exports.subpathSegmentCount = _chunkJF5PXN7Wcjs.subpathSegmentCount; exports.subpathToMorphContour = _chunkJF5PXN7Wcjs.subpathToMorphContour; exports.subpathsToBezier = _chunkJF5PXN7Wcjs.subpathsToBezier; exports.taperWaveFactor = _chunkJF5PXN7Wcjs.taperWaveFactor; exports.toVectorKeyInput = toVectorKeyInput; exports.toVectorModifiers = toVectorModifiers; exports.toVectorPointerInput = toVectorPointerInput; exports.transformVectorEffects = _chunkJF5PXN7Wcjs.transformVectorEffects; exports.transformVectorGradient = _chunkJF5PXN7Wcjs.transformVectorGradient; exports.transformVectorNode = _chunkJF5PXN7Wcjs.transformVectorNode; exports.transformVectorPaint = _chunkJF5PXN7Wcjs.transformVectorPaint; exports.translateAnchor = _chunkJF5PXN7Wcjs.translateAnchor; exports.translateMatrix = _chunkDWGZUSEScjs.translateMatrix; exports.trimIntervals = _chunkJF5PXN7Wcjs.trimIntervals; exports.trimPaths = _chunkJF5PXN7Wcjs.trimPaths; exports.trimPathsIndividually = _chunkJF5PXN7Wcjs.trimPathsIndividually; exports.turnMorphContour = _chunkJF5PXN7Wcjs.turnMorphContour; exports.twistPaths = _chunkJF5PXN7Wcjs.twistPaths; exports.unionBounds = _chunkJF5PXN7Wcjs.unionBounds; exports.variableStrokeOutline = _chunkJF5PXN7Wcjs.variableStrokeOutline; exports.variableStrokeRings = _chunkJF5PXN7Wcjs.variableStrokeRings; exports.vectorAppearanceNodes = _chunkJF5PXN7Wcjs.vectorAppearanceNodes; exports.vectorAppearanceOutline = _chunkJF5PXN7Wcjs.vectorAppearanceOutline; exports.vectorAppearanceShapes = _chunkJF5PXN7Wcjs.vectorAppearanceShapes; exports.vectorBlendColorDistance = vectorBlendColorDistance; exports.vectorBlendKeyTargets = vectorBlendKeyTargets; exports.vectorBlendKeys = vectorBlendKeys; exports.vectorBlendRail = vectorBlendRail; exports.vectorBlendRailAt = vectorBlendRailAt; exports.vectorBlendSpine = vectorBlendSpine; exports.vectorBlendStepCount = vectorBlendStepCount; exports.vectorBoxCorners = vectorBoxCorners; exports.vectorBoxMatrix = _chunkJF5PXN7Wcjs.vectorBoxMatrix; exports.vectorBuilderErasedEdges = vectorBuilderErasedEdges; exports.vectorCornerAt = _chunkJF5PXN7Wcjs.vectorCornerAt; exports.vectorCorners = _chunkJF5PXN7Wcjs.vectorCorners; exports.vectorCornersAttribute = _chunkJF5PXN7Wcjs.vectorCornersAttribute; exports.vectorDiamondPath = vectorDiamondPath; exports.vectorDistortQuad = vectorDistortQuad; exports.vectorDocumentToSvg = _chunkJF5PXN7Wcjs.vectorDocumentToSvg; exports.vectorEffectInputBounds = _chunkJF5PXN7Wcjs.vectorEffectInputBounds; exports.vectorEffectInputPaths = _chunkJF5PXN7Wcjs.vectorEffectInputPaths; exports.vectorEnteredGroups = _chunkJF5PXN7Wcjs.vectorEnteredGroups; exports.vectorEnvelopeFrame = _chunkJF5PXN7Wcjs.vectorEnvelopeFrame; exports.vectorEnvelopeMap = _chunkJF5PXN7Wcjs.vectorEnvelopeMap; exports.vectorEnvelopeMesh = _chunkJF5PXN7Wcjs.vectorEnvelopeMesh; exports.vectorFillMap = vectorFillMap; exports.vectorGradientArea = _chunkJF5PXN7Wcjs.vectorGradientArea; exports.vectorGradientAspect = _chunkJF5PXN7Wcjs.vectorGradientAspect; exports.vectorGradientBarPosition = vectorGradientBarPosition; exports.vectorGradientFocalParam = _chunkJF5PXN7Wcjs.vectorGradientFocalParam; exports.vectorGradientHandles = _chunkJF5PXN7Wcjs.vectorGradientHandles; exports.vectorGradientMatrix = _chunkJF5PXN7Wcjs.vectorGradientMatrix; exports.vectorGradientMidpointFromPosition = _chunkJF5PXN7Wcjs.vectorGradientMidpointFromPosition; exports.vectorGradientMidpointPosition = _chunkJF5PXN7Wcjs.vectorGradientMidpointPosition; exports.vectorGradientNeedsExpansion = _chunkJF5PXN7Wcjs.vectorGradientNeedsExpansion; exports.vectorGradientParam = _chunkJF5PXN7Wcjs.vectorGradientParam; exports.vectorGradientPoints = _chunkJF5PXN7Wcjs.vectorGradientPoints; exports.vectorGradientRamp = _chunkJF5PXN7Wcjs.vectorGradientRamp; exports.vectorGradientSvgDefs = _chunkJF5PXN7Wcjs.vectorGradientSvgDefs; exports.vectorGradientTAt = _chunkJF5PXN7Wcjs.vectorGradientTAt; exports.vectorGradientTargetPath = vectorGradientTargetPath; exports.vectorGradientUnitsMatrix = _chunkJF5PXN7Wcjs.vectorGradientUnitsMatrix; exports.vectorHomography = _chunkMUUXNRU4cjs.homographyFromPoints; exports.vectorHomographyKeepsQuad = _chunkMUUXNRU4cjs.homographyKeepsQuad; exports.vectorIdentityMesh = _chunkDWGZUSEScjs.identityWarpMesh; exports.vectorInkShapeName = vectorInkShapeName; exports.vectorLiveBooleanSteps = _chunkJF5PXN7Wcjs.vectorLiveBooleanSteps; exports.vectorMeshColumns = _chunkDWGZUSEScjs.warpMeshColumns; exports.vectorMeshControlBounds = _chunkDWGZUSEScjs.warpMeshControlBounds; exports.vectorMeshEditPoints = _chunkDWGZUSEScjs.warpMeshEditPoints; exports.vectorMeshFromOutline = _chunkJF5PXN7Wcjs.vectorMeshFromOutline; exports.vectorMeshGridCurves = _chunkDWGZUSEScjs.warpMeshGridCurves; exports.vectorMeshOutline = _chunkJF5PXN7Wcjs.vectorMeshOutline; exports.vectorMeshParamAt = _chunkDWGZUSEScjs.warpMeshParamAt; exports.vectorMeshRows = _chunkDWGZUSEScjs.warpMeshRows; exports.vectorNodeBounds = _chunkJF5PXN7Wcjs.vectorNodeBounds; exports.vectorNodeEnvelope = _chunkJF5PXN7Wcjs.vectorNodeEnvelope; exports.vectorNodeRotation = _chunkJF5PXN7Wcjs.vectorNodeRotation; exports.vectorNodeToBezier = _chunkJF5PXN7Wcjs.vectorNodeToBezier; exports.vectorOperandOperation = _chunkJF5PXN7Wcjs.vectorOperandOperation; exports.vectorPaintToHex = vectorPaintToHex; exports.vectorPaintToSvg = _chunkJF5PXN7Wcjs.vectorPaintToSvg; exports.vectorParentMatrix = _chunkJF5PXN7Wcjs.vectorParentMatrix; exports.vectorPathData = _chunkJF5PXN7Wcjs.vectorPathData; exports.vectorPathEntries = vectorPathEntries; exports.vectorPathLocalBounds = _chunkJF5PXN7Wcjs.vectorPathLocalBounds; exports.vectorPathWorldBezier = _chunkJF5PXN7Wcjs.vectorPathWorldBezier; exports.vectorPathfinderShape = vectorPathfinderShape; exports.vectorRepeaterCopies = _chunkJF5PXN7Wcjs.vectorRepeaterCopies; exports.vectorResizeCursor = vectorResizeCursor; exports.vectorResultStyle = vectorResultStyle; exports.vectorShapeBuilderHit = vectorShapeBuilderHit; exports.vectorShapeBuilderMap = vectorShapeBuilderMap; exports.vectorShearForSide = vectorShearForSide; exports.vectorSkewMatrix = vectorSkewMatrix; exports.vectorStrokeGradientDefs = _chunkJF5PXN7Wcjs.vectorStrokeGradientDefs; exports.vectorStrokeLineArea = _chunkJF5PXN7Wcjs.vectorStrokeLineArea; exports.vectorStrokeOutline = _chunkJF5PXN7Wcjs.vectorStrokeOutline; exports.vectorStrokeOutlinePath = _chunkJF5PXN7Wcjs.vectorStrokeOutlinePath; exports.vectorStrokeParts = _chunkJF5PXN7Wcjs.vectorStrokeParts; exports.vectorStrokeReach = _chunkJF5PXN7Wcjs.vectorStrokeReach; exports.vectorStrokeSvgParts = _chunkJF5PXN7Wcjs.vectorStrokeSvgParts; exports.vectorStrokeWidthGeometry = vectorStrokeWidthGeometry; exports.vectorToolLabel = vectorToolLabel; exports.vectorWarpPresetGrid = _chunkDWGZUSEScjs.warpPresetGrid; exports.vectorWarpPresetMesh = _chunkDWGZUSEScjs.warpPresetMesh; exports.vectorWorldMatrix = _chunkJF5PXN7Wcjs.vectorWorldMatrix; exports.walkVectorNodes = _chunkJF5PXN7Wcjs.walkVectorNodes; exports.widthProfileAt = _chunkJF5PXN7Wcjs.widthProfileAt; exports.widthProfileFromAttribute = _chunkJF5PXN7Wcjs.widthProfileFromAttribute; exports.widthProfileMaxScale = _chunkJF5PXN7Wcjs.widthProfileMaxScale; exports.widthProfilePreset = _chunkJF5PXN7Wcjs.widthProfilePreset; exports.widthProfilePresetId = _chunkJF5PXN7Wcjs.widthProfilePresetId; exports.widthProfileToAttribute = _chunkJF5PXN7Wcjs.widthProfileToAttribute; exports.wigglePaths = _chunkJF5PXN7Wcjs.wigglePaths; exports.zigzagPaths = _chunkJF5PXN7Wcjs.zigzagPaths;
|
|
10054
|
+
|
|
10055
|
+
|
|
10056
|
+
|
|
10057
|
+
|
|
10058
|
+
|
|
10059
|
+
|
|
10060
|
+
|
|
10061
|
+
|
|
10062
|
+
|
|
10063
|
+
|
|
10064
|
+
|
|
10065
|
+
|
|
10066
|
+
|
|
10067
|
+
|
|
10068
|
+
|
|
10069
|
+
|
|
10070
|
+
|
|
10071
|
+
|
|
10072
|
+
|
|
10073
|
+
|
|
10074
|
+
|
|
10075
|
+
|
|
10076
|
+
|
|
10077
|
+
|
|
10078
|
+
|
|
10079
|
+
|
|
10080
|
+
|
|
10081
|
+
|
|
10082
|
+
|
|
10083
|
+
|
|
10084
|
+
|
|
10085
|
+
|
|
10086
|
+
|
|
10087
|
+
|
|
10088
|
+
|
|
10089
|
+
|
|
10090
|
+
|
|
10091
|
+
|
|
10092
|
+
|
|
10093
|
+
|
|
10094
|
+
|
|
10095
|
+
|
|
10096
|
+
|
|
10097
|
+
|
|
10098
|
+
|
|
10099
|
+
|
|
10100
|
+
exports.DEFAULT_VECTOR_BLEND_DISTANCE = DEFAULT_VECTOR_BLEND_DISTANCE; exports.DEFAULT_VECTOR_BLEND_STEPS = DEFAULT_VECTOR_BLEND_STEPS; exports.DEFAULT_VECTOR_PATH_EDIT = DEFAULT_VECTOR_PATH_EDIT; exports.DEFAULT_VECTOR_SNAP = DEFAULT_VECTOR_SNAP; exports.IDENTITY_MATRIX = _chunkDWGZUSEScjs.IDENTITY_MATRIX; exports.KAPPA = _chunkKANRAHTLcjs.KAPPA; exports.LazyMouse = LazyMouse; exports.VECTOR_ARROWHEADS = _chunkKANRAHTLcjs.VECTOR_ARROWHEADS; exports.VECTOR_ARROWHEAD_LABELS = VECTOR_ARROWHEAD_LABELS; exports.VECTOR_BLEND_MAX_SMOOTH_STEPS = VECTOR_BLEND_MAX_SMOOTH_STEPS; exports.VECTOR_BLEND_MAX_STEPS = VECTOR_BLEND_MAX_STEPS; exports.VECTOR_BLEND_MODES = _chunkKANRAHTLcjs.VECTOR_BLEND_MODES; exports.VECTOR_BLEND_MODE_LABELS = _chunkKANRAHTLcjs.VECTOR_BLEND_MODE_LABELS; exports.VECTOR_BLEND_MODE_MENU = VECTOR_BLEND_MODE_MENU; exports.VECTOR_BLEND_SPACINGS = _chunkKANRAHTLcjs.VECTOR_BLEND_SPACINGS; exports.VECTOR_BLEND_SPACING_LABELS = VECTOR_BLEND_SPACING_LABELS; exports.VECTOR_BUILDER_HATCH_GAP = VECTOR_BUILDER_HATCH_GAP; exports.VECTOR_CLIPBOARD_TYPE = VECTOR_CLIPBOARD_TYPE; exports.VECTOR_CONSTRUCTION_ANGLES = VECTOR_CONSTRUCTION_ANGLES; exports.VECTOR_CORNER_KINDS = _chunkKANRAHTLcjs.VECTOR_CORNER_KINDS; exports.VECTOR_CORNER_KIND_LABELS = VECTOR_CORNER_KIND_LABELS; exports.VECTOR_CORNER_WIDGET_INSET = VECTOR_CORNER_WIDGET_INSET; exports.VECTOR_DISTORT_TOLERANCE = VECTOR_DISTORT_TOLERANCE; exports.VECTOR_EDIT_TOGGLES = VECTOR_EDIT_TOGGLES; exports.VECTOR_EFFECT_DEFAULTS = _chunkKANRAHTLcjs.VECTOR_EFFECT_DEFAULTS; exports.VECTOR_EFFECT_LABELS = _chunkKANRAHTLcjs.VECTOR_EFFECT_LABELS; exports.VECTOR_EFFECT_MENU = VECTOR_EFFECT_MENU; exports.VECTOR_EFFECT_PARAM_SPECS = _chunkKANRAHTLcjs.VECTOR_EFFECT_PARAM_SPECS; exports.VECTOR_EFFECT_TYPES = _chunkKANRAHTLcjs.VECTOR_EFFECT_TYPES; exports.VECTOR_ENVELOPE_STYLE_OPTIONS = VECTOR_ENVELOPE_STYLE_OPTIONS; exports.VECTOR_FILL_GAP = VECTOR_FILL_GAP; exports.VECTOR_FILTER_DEFAULTS = _chunkKANRAHTLcjs.VECTOR_FILTER_DEFAULTS; exports.VECTOR_FILTER_LABELS = _chunkKANRAHTLcjs.VECTOR_FILTER_LABELS; exports.VECTOR_FILTER_MENU = _chunkKANRAHTLcjs.VECTOR_FILTER_MENU; exports.VECTOR_FILTER_PARAM_SPECS = _chunkKANRAHTLcjs.VECTOR_FILTER_PARAM_SPECS; exports.VECTOR_FILTER_TYPES = _chunkKANRAHTLcjs.VECTOR_FILTER_TYPES; exports.VECTOR_GRADIENT_INTERPOLATIONS = _chunkKANRAHTLcjs.VECTOR_GRADIENT_INTERPOLATIONS; exports.VECTOR_GRADIENT_INTERPOLATION_LABELS = VECTOR_GRADIENT_INTERPOLATION_LABELS; exports.VECTOR_GRADIENT_MAX_PERIODS = _chunkKANRAHTLcjs.VECTOR_GRADIENT_MAX_PERIODS; exports.VECTOR_GRADIENT_MIDPOINT_GAP = VECTOR_GRADIENT_MIDPOINT_GAP; exports.VECTOR_GRADIENT_MIN_STOPS = _chunkKANRAHTLcjs.VECTOR_GRADIENT_MIN_STOPS; exports.VECTOR_GRADIENT_OFF_BAR = VECTOR_GRADIENT_OFF_BAR; exports.VECTOR_GRADIENT_SPREADS = _chunkKANRAHTLcjs.VECTOR_GRADIENT_SPREADS; exports.VECTOR_GRADIENT_SPREAD_LABELS = VECTOR_GRADIENT_SPREAD_LABELS; exports.VECTOR_GRADIENT_STOP_GAP = VECTOR_GRADIENT_STOP_GAP; exports.VECTOR_GRADIENT_TYPES = _chunkKANRAHTLcjs.VECTOR_GRADIENT_TYPES; exports.VECTOR_GRADIENT_TYPE_LABELS = VECTOR_GRADIENT_TYPE_LABELS; exports.VECTOR_INK_MAX_CORNERS = VECTOR_INK_MAX_CORNERS; exports.VECTOR_MERGE_MODES = _chunkKANRAHTLcjs.VECTOR_MERGE_MODES; exports.VECTOR_OVERLAY_THEME = VECTOR_OVERLAY_THEME; exports.VECTOR_PATHFINDER_ACTIONS = VECTOR_PATHFINDER_ACTIONS; exports.VECTOR_PATHFINDER_LABELS = VECTOR_PATHFINDER_LABELS; exports.VECTOR_PATHFINDER_OPERATIONS = _chunkKANRAHTLcjs.VECTOR_PATHFINDER_OPERATIONS; exports.VECTOR_PATH_ACTIONS = VECTOR_PATH_ACTIONS; exports.VECTOR_PENCIL_STRING_PX = VECTOR_PENCIL_STRING_PX; exports.VECTOR_PRESSURE_NOMINAL = _chunkKANRAHTLcjs.VECTOR_PRESSURE_NOMINAL; exports.VECTOR_ROTATE_HANDLE_OFFSET = VECTOR_ROTATE_HANDLE_OFFSET; exports.VECTOR_STROKE_ALIGN_LABELS = VECTOR_STROKE_ALIGN_LABELS; exports.VECTOR_STROKE_GRADIENT_MODES = _chunkKANRAHTLcjs.VECTOR_STROKE_GRADIENT_MODES; exports.VECTOR_STROKE_GRADIENT_MODE_LABELS = VECTOR_STROKE_GRADIENT_MODE_LABELS; exports.VECTOR_STROKE_SETTING_KEYS = _chunkKANRAHTLcjs.VECTOR_STROKE_SETTING_KEYS; exports.VECTOR_STYLE_KEYS = VECTOR_STYLE_KEYS; exports.VECTOR_TOOLS = _chunkKANRAHTLcjs.VECTOR_TOOLS; exports.VECTOR_TOOL_GLYPHS = VECTOR_TOOL_GLYPHS; exports.VECTOR_TOOL_SHORTCUTS = VECTOR_TOOL_SHORTCUTS; exports.VECTOR_TRANSFORM_HANDLES = _chunkKANRAHTLcjs.VECTOR_TRANSFORM_HANDLES; exports.VECTOR_WARP_STYLES = _chunkDWGZUSEScjs.WARP_STYLES; exports.VECTOR_WARP_STYLE_LABELS = _chunkDWGZUSEScjs.WARP_STYLE_LABELS; exports.VECTOR_WIDTH_PRESETS = _chunkKANRAHTLcjs.VECTOR_WIDTH_PRESETS; exports.VECTOR_WIDTH_PRESET_IDS = _chunkKANRAHTLcjs.VECTOR_WIDTH_PRESET_IDS; exports.VECTOR_WIDTH_PROFILE_MAX_POINTS = _chunkKANRAHTLcjs.VECTOR_WIDTH_PROFILE_MAX_POINTS; exports.VECTOR_WIDTH_PROFILE_MAX_SCALE = _chunkKANRAHTLcjs.VECTOR_WIDTH_PROFILE_MAX_SCALE; exports.VECTOR_WIDTH_SAME_T = _chunkKANRAHTLcjs.VECTOR_WIDTH_SAME_T; exports.VectorEditorController = VectorEditorController; exports.VectorSnapTargets = VectorSnapTargets; exports.activeVectorEffects = _chunkKANRAHTLcjs.activeVectorEffects; exports.activeVectorFilters = _chunkKANRAHTLcjs.activeVectorFilters; exports.addBuilderHit = addBuilderHit; exports.applyMatrix = _chunkDWGZUSEScjs.applyMatrix; exports.applyMatrixLinear = _chunkDWGZUSEScjs.applyMatrixLinear; exports.applyVectorBlendOptions = applyVectorBlendOptions; exports.applyVectorCornersAttribute = _chunkKANRAHTLcjs.applyVectorCornersAttribute; exports.applyVectorEffects = _chunkKANRAHTLcjs.applyVectorEffects; exports.applyVectorGradientPatch = _chunkKANRAHTLcjs.applyVectorGradientPatch; exports.applyVectorGradientSpread = _chunkKANRAHTLcjs.applyVectorGradientSpread; exports.applyVectorHomography = _chunkMUUXNRU4cjs.applyHomography; exports.arrowheadInset = _chunkKANRAHTLcjs.arrowheadInset; exports.arrowheadPath = _chunkKANRAHTLcjs.arrowheadPath; exports.arrowheadWeight = _chunkKANRAHTLcjs.arrowheadWeight; exports.bendSegment = bendSegment; exports.bezierToSubpaths = _chunkKANRAHTLcjs.bezierToSubpaths; exports.boundsFromPoints = _chunkKANRAHTLcjs.boundsFromPoints; exports.boundsIntersect = _chunkKANRAHTLcjs.boundsIntersect; exports.clearVectorLiveBooleanCache = _chunkKANRAHTLcjs.clearVectorLiveBooleanCache; exports.cloneAnchor = _chunkKANRAHTLcjs.cloneAnchor; exports.cloneSubpath = _chunkKANRAHTLcjs.cloneSubpath; exports.cloneVectorDocument = _chunkKANRAHTLcjs.cloneVectorDocument; exports.cloneVectorNode = _chunkKANRAHTLcjs.cloneVectorNode; exports.collectPathNodes = _chunkKANRAHTLcjs.collectPathNodes; exports.constrainToLeave = constrainToLeave; exports.convertAnchor = _chunkKANRAHTLcjs.convertAnchor; exports.convertVectorGradient = _chunkKANRAHTLcjs.convertVectorGradient; exports.cornerBisectorPoint = _chunkKANRAHTLcjs.cornerBisectorPoint; exports.cornerRadiusChange = _chunkKANRAHTLcjs.cornerRadiusChange; exports.cornerSetback = _chunkKANRAHTLcjs.cornerSetback; exports.correspondMorphContours = _chunkKANRAHTLcjs.correspondMorphContours; exports.createVectorCommands = createVectorCommands; exports.createVectorEffect = _chunkKANRAHTLcjs.createVectorEffect; exports.createVectorFilter = _chunkKANRAHTLcjs.createVectorFilter; exports.createVectorMorph = _chunkKANRAHTLcjs.createVectorMorph; exports.curvatureMoveAnchor = curvatureMoveAnchor; exports.cutSubpathAt = cutSubpathAt; exports.dashIntervals = _chunkKANRAHTLcjs.dashIntervals; exports.decomposeRigid = _chunkDWGZUSEScjs.decomposeRigid; exports.defaultVectorGradient = _chunkKANRAHTLcjs.defaultVectorGradient; exports.distortVectorNode = distortVectorNode; exports.dragVectorMeshPoint = _chunkDWGZUSEScjs.dragWarpMeshPoint; exports.effectPathLength = _chunkKANRAHTLcjs.effectPathLength; exports.effectPathVertexCount = _chunkKANRAHTLcjs.effectPathVertexCount; exports.effectiveStrokeAlign = _chunkKANRAHTLcjs.effectiveStrokeAlign; exports.ellipseSubpath = _chunkKANRAHTLcjs.ellipseSubpath; exports.eraseFromFill = eraseFromFill; exports.eraseFromOutline = eraseFromOutline; exports.eraserRegion = eraserRegion; exports.evalVectorMesh = _chunkDWGZUSEScjs.evalWarpMesh; exports.evaluateVectorPathKeyframes = _chunkKANRAHTLcjs.evaluateVectorPathKeyframes; exports.expandVectorAppearance = _chunkKANRAHTLcjs.expandVectorAppearance; exports.expandVectorAppearances = _chunkKANRAHTLcjs.expandVectorAppearances; exports.expandVectorBlend = expandVectorBlend; exports.expandVectorCorners = _chunkKANRAHTLcjs.expandVectorCorners; exports.expandVectorCornersOf = _chunkKANRAHTLcjs.expandVectorCornersOf; exports.expandVectorGradientSpread = _chunkKANRAHTLcjs.expandVectorGradientSpread; exports.expandVectorGradientStops = _chunkKANRAHTLcjs.expandVectorGradientStops; exports.explicitVectorGradient = _chunkKANRAHTLcjs.explicitVectorGradient; exports.findVectorNode = _chunkKANRAHTLcjs.findVectorNode; exports.fitCornerRadius = _chunkKANRAHTLcjs.fitCornerRadius; exports.fitVectorMesh = _chunkDWGZUSEScjs.fitWarpMesh; exports.foldVectorBooleanOperands = _chunkKANRAHTLcjs.foldVectorBooleanOperands; exports.generateVectorBlendChildren = generateVectorBlendChildren; exports.generateWidthProfile = _chunkKANRAHTLcjs.generateWidthProfile; exports.getAnchor = getAnchor; exports.getAnchorWorld = getAnchorWorld; exports.getEditablePathIds = getEditablePathIds; exports.getTransformHandlePositions = getTransformHandlePositions; exports.getVectorAppearancePanel = getVectorAppearancePanel; exports.getVectorBlendControls = getVectorBlendControls; exports.getVectorCornerWidgets = getVectorCornerWidgets; exports.getVectorEffectsPanel = getVectorEffectsPanel; exports.getVectorEnteredGroups = getVectorEnteredGroups; exports.getVectorEnvelopePanel = getVectorEnvelopePanel; exports.getVectorEnvelopeTarget = getVectorEnvelopeTarget; exports.getVectorGradientAnnotator = getVectorGradientAnnotator; exports.getVectorGradientEditor = getVectorGradientEditor; exports.getVectorOverlayRenderData = getVectorOverlayRenderData; exports.getVectorSceneRenderData = getVectorSceneRenderData; exports.getVectorSelectionBoxGeometry = getVectorSelectionBoxGeometry; exports.getVectorSelectionFrame = getVectorSelectionFrame; exports.getVectorSelectionStyle = getVectorSelectionStyle; exports.getVectorWidthHandles = getVectorWidthHandles; exports.getVisibleAnchors = getVisibleAnchors; exports.getVisibleHandles = getVisibleHandles; exports.gradientMidpointRemap = _chunkKANRAHTLcjs.gradientMidpointRemap; exports.hasExplicitGradientGeometry = _chunkKANRAHTLcjs.hasExplicitGradientGeometry; exports.hasOwnVectorAppearance = _chunkKANRAHTLcjs.hasOwnVectorAppearance; exports.hasPaint = _chunkKANRAHTLcjs.hasPaint; exports.hasStrokeExtras = _chunkKANRAHTLcjs.hasStrokeExtras; exports.hasVectorAppearance = _chunkKANRAHTLcjs.hasVectorAppearance; exports.hasVectorCorners = _chunkKANRAHTLcjs.hasVectorCorners; exports.hasVectorPaintStacks = _chunkKANRAHTLcjs.hasVectorPaintStacks; exports.hitTestVectorNode = _chunkKANRAHTLcjs.hitTestVectorNode; exports.hitTestVectorNodes = _chunkKANRAHTLcjs.hitTestVectorNodes; exports.hitTestVectorPaintLayer = _chunkKANRAHTLcjs.hitTestVectorPaintLayer; exports.hitTestVectorPaintStack = _chunkKANRAHTLcjs.hitTestVectorPaintStack; exports.hitTestVectorStroke = _chunkKANRAHTLcjs.hitTestVectorStroke; exports.hitVectorGradientAnnotator = hitVectorGradientAnnotator; exports.inferAnchorType = _chunkKANRAHTLcjs.inferAnchorType; exports.insertAnchor = _chunkKANRAHTLcjs.insertAnchor; exports.insertVectorGradientStop = _chunkKANRAHTLcjs.insertVectorGradientStop; exports.insertWidthPoint = _chunkKANRAHTLcjs.insertWidthPoint; exports.interpolateMorphContours = _chunkKANRAHTLcjs.interpolateMorphContours; exports.interpolateRigidMatrix = _chunkKANRAHTLcjs.interpolateRigidMatrix; exports.interpolateVectorColor = _chunkKANRAHTLcjs.interpolateVectorColor; exports.interpolateVectorPaint = _chunkKANRAHTLcjs.interpolateVectorPaint; exports.interpolateVectorPaths = _chunkKANRAHTLcjs.interpolateVectorPaths; exports.interpolateVectorStyle = _chunkKANRAHTLcjs.interpolateVectorStyle; exports.interpolateWidthProfiles = _chunkKANRAHTLcjs.interpolateWidthProfiles; exports.invertMatrix = _chunkDWGZUSEScjs.invertMatrix; exports.isCentredVectorGradient = _chunkKANRAHTLcjs.isCentredVectorGradient; exports.isClosedBezierShape = _chunkKANRAHTLcjs.isClosedBezierShape; exports.isDrawnVectorPaintLayer = _chunkKANRAHTLcjs.isDrawnVectorPaintLayer; exports.isIdentityMatrix = _chunkDWGZUSEScjs.isIdentityMatrix; exports.isPlainVectorPaintLayer = _chunkKANRAHTLcjs.isPlainVectorPaintLayer; exports.isUniformWidthProfile = _chunkKANRAHTLcjs.isUniformWidthProfile; exports.isValidVectorMesh = _chunkDWGZUSEScjs.isValidWarpMesh; exports.isVectorBlendGroup = isVectorBlendGroup; exports.isVectorBlendMode = _chunkKANRAHTLcjs.isVectorBlendMode; exports.isVectorFilterType = _chunkKANRAHTLcjs.isVectorFilterType; exports.isVectorGradient = _chunkKANRAHTLcjs.isVectorGradient; exports.isVectorLiveBoolean = _chunkKANRAHTLcjs.isVectorLiveBoolean; exports.isVectorTextTarget = isVectorTextTarget; exports.joinSubpaths = joinSubpaths; exports.knifePath = knifePath; exports.lineSubpath = _chunkKANRAHTLcjs.lineSubpath; exports.locateVectorNode = _chunkKANRAHTLcjs.locateVectorNode; exports.mapBezierPath = _chunkKANRAHTLcjs.mapBezierPath; exports.mapVectorGradient = _chunkKANRAHTLcjs.mapVectorGradient; exports.mapVectorMeshPoints = _chunkDWGZUSEScjs.mapWarpMeshPoints; exports.mapVectorPaint = _chunkKANRAHTLcjs.mapVectorPaint; exports.mapVectorPoints = _chunkKANRAHTLcjs.mapVectorPoints; exports.mapVectorSubpaths = _chunkKANRAHTLcjs.mapVectorSubpaths; exports.matrixRotation = _chunkDWGZUSEScjs.matrixRotation; exports.mergePaths = _chunkKANRAHTLcjs.mergePaths; exports.mirrorWidthProfile = _chunkKANRAHTLcjs.mirrorWidthProfile; exports.morphContourToSubpath = _chunkKANRAHTLcjs.morphContourToSubpath; exports.morphPathsCross = _chunkKANRAHTLcjs.morphPathsCross; exports.moveAnchorHandle = _chunkKANRAHTLcjs.moveAnchorHandle; exports.moveVectorGradientHandle = _chunkKANRAHTLcjs.moveVectorGradientHandle; exports.moveVectorGradientStop = _chunkKANRAHTLcjs.moveVectorGradientStop; exports.multiplyMatrices = _chunkDWGZUSEScjs.multiplyMatrices; exports.nearestSegment = _chunkKANRAHTLcjs.nearestSegment; exports.nearestStrokePosition = _chunkKANRAHTLcjs.nearestStrokePosition; exports.needsVectorPaintLayers = _chunkKANRAHTLcjs.needsVectorPaintLayers; exports.newVectorStrokeLayer = _chunkKANRAHTLcjs.newVectorStrokeLayer; exports.nextVectorCornerKind = _chunkKANRAHTLcjs.nextVectorCornerKind; exports.nodeMatrix = _chunkKANRAHTLcjs.nodeMatrix; exports.normalizeVectorEffectParams = _chunkKANRAHTLcjs.normalizeVectorEffectParams; exports.normalizeVectorFilterParams = _chunkKANRAHTLcjs.normalizeVectorFilterParams; exports.normalizeVectorPaintStacks = _chunkKANRAHTLcjs.normalizeVectorPaintStacks; exports.offsetPaths = _chunkKANRAHTLcjs.offsetPaths; exports.orderVectorQuad = _chunkMUUXNRU4cjs.orderQuad; exports.parseSvgTransform = _chunkKANRAHTLcjs.parseSvgTransform; exports.parseVectorColor = _chunkKANRAHTLcjs.parseVectorColor; exports.parseVectorSvg = _chunkKANRAHTLcjs.parseVectorSvg; exports.pathsCenter = _chunkKANRAHTLcjs.pathsCenter; exports.patternAttrs = _chunkKANRAHTLcjs.patternAttrs; exports.periodicVectorGradientStops = _chunkKANRAHTLcjs.periodicVectorGradientStops; exports.pinVectorGradient = _chunkKANRAHTLcjs.pinVectorGradient; exports.planShapeBuilder = planShapeBuilder; exports.polygonSubpath = _chunkKANRAHTLcjs.polygonSubpath; exports.polylineBounds = polylineBounds; exports.pressureWidthProfile = _chunkKANRAHTLcjs.pressureWidthProfile; exports.puckerBloatPaths = _chunkKANRAHTLcjs.puckerBloatPaths; exports.pullVectorMesh = _chunkDWGZUSEScjs.pullWarpMesh; exports.recognizeInkShape = recognizeInkShape; exports.rectSubpath = _chunkKANRAHTLcjs.rectSubpath; exports.refineMorphContour = _chunkKANRAHTLcjs.refineMorphContour; exports.refreshVectorBlends = refreshVectorBlends; exports.releaseVectorBlend = releaseVectorBlend; exports.removeAnchorKeepingShape = removeAnchorKeepingShape; exports.removeAnchors = _chunkKANRAHTLcjs.removeAnchors; exports.removeAnchorsKeepingShape = removeAnchorsKeepingShape; exports.removeRedundantPoints = removeRedundantPoints; exports.removeVectorGradientStop = _chunkKANRAHTLcjs.removeVectorGradientStop; exports.removeVectorMeshSplitU = _chunkDWGZUSEScjs.removeWarpMeshSplitU; exports.removeVectorMeshSplitV = _chunkDWGZUSEScjs.removeWarpMeshSplitV; exports.removeWidthPoints = _chunkKANRAHTLcjs.removeWidthPoints; exports.repeatPaths = _chunkKANRAHTLcjs.repeatPaths; exports.resampleGradientStops = _chunkKANRAHTLcjs.resampleGradientStops; exports.resizeVectorMesh = _chunkDWGZUSEScjs.resizeWarpMesh; exports.resolveVectorBlendOptions = resolveVectorBlendOptions; exports.reverseMorphContour = _chunkKANRAHTLcjs.reverseMorphContour; exports.reverseSubpath = _chunkKANRAHTLcjs.reverseSubpath; exports.reverseVectorGradient = _chunkKANRAHTLcjs.reverseVectorGradient; exports.reverseWidthProfile = _chunkKANRAHTLcjs.reverseWidthProfile; exports.rotateMatrix = _chunkDWGZUSEScjs.rotateMatrix; exports.roundCornerPaths = _chunkKANRAHTLcjs.roundCornerPaths; exports.roundSubpaths = _chunkKANRAHTLcjs.roundSubpaths; exports.samplePlainStops = _chunkKANRAHTLcjs.samplePlainStops; exports.samplePolyline = samplePolyline; exports.sampleVectorGradient = _chunkKANRAHTLcjs.sampleVectorGradient; exports.sampleVectorGradientAt = _chunkKANRAHTLcjs.sampleVectorGradientAt; exports.sampleVectorPaintDefAt = _chunkKANRAHTLcjs.sampleVectorPaintDefAt; exports.sanitizeVectorEffects = _chunkKANRAHTLcjs.sanitizeVectorEffects; exports.sanitizeVectorFills = _chunkKANRAHTLcjs.sanitizeVectorFills; exports.sanitizeVectorFilters = _chunkKANRAHTLcjs.sanitizeVectorFilters; exports.sanitizeVectorGradient = _chunkKANRAHTLcjs.sanitizeVectorGradient; exports.sanitizeVectorStrokeSettings = _chunkKANRAHTLcjs.sanitizeVectorStrokeSettings; exports.sanitizeVectorStrokes = _chunkKANRAHTLcjs.sanitizeVectorStrokes; exports.sanitizeWidthProfile = _chunkKANRAHTLcjs.sanitizeWidthProfile; exports.scaleFor = scaleFor; exports.scaleMatrix = _chunkDWGZUSEScjs.scaleMatrix; exports.setAnchorCorner = _chunkKANRAHTLcjs.setAnchorCorner; exports.setSubpathCorners = _chunkKANRAHTLcjs.setSubpathCorners; exports.setVectorGradientVector = _chunkKANRAHTLcjs.setVectorGradientVector; exports.setWidthPoint = _chunkKANRAHTLcjs.setWidthPoint; exports.simplifyPolyline = simplifyPolyline; exports.smoothSubpath = smoothSubpath; exports.solve8 = _chunkMUUXNRU4cjs.solve8; exports.sortedVectorGradientStops = _chunkKANRAHTLcjs.sortedVectorGradientStops; exports.spanVectorGradientStops = _chunkKANRAHTLcjs.spanVectorGradientStops; exports.splitIntoFaces = splitIntoFaces; exports.splitSubpathAt = splitSubpathAt; exports.splitVectorMeshU = _chunkDWGZUSEScjs.splitWarpMeshU; exports.splitVectorMeshV = _chunkDWGZUSEScjs.splitWarpMeshV; exports.starSubpath = _chunkKANRAHTLcjs.starSubpath; exports.strokePositionPoint = _chunkKANRAHTLcjs.strokePositionPoint; exports.strokeWidthProfileOf = _chunkKANRAHTLcjs.strokeWidthProfileOf; exports.subpathEnclosesArea = subpathEnclosesArea; exports.subpathPointAt = subpathPointAt; exports.subpathSegment = _chunkKANRAHTLcjs.subpathSegment; exports.subpathSegmentCount = _chunkKANRAHTLcjs.subpathSegmentCount; exports.subpathToMorphContour = _chunkKANRAHTLcjs.subpathToMorphContour; exports.subpathsToBezier = _chunkKANRAHTLcjs.subpathsToBezier; exports.taperWaveFactor = _chunkKANRAHTLcjs.taperWaveFactor; exports.toVectorKeyInput = toVectorKeyInput; exports.toVectorModifiers = toVectorModifiers; exports.toVectorPointerInput = toVectorPointerInput; exports.transformVectorEffects = _chunkKANRAHTLcjs.transformVectorEffects; exports.transformVectorGradient = _chunkKANRAHTLcjs.transformVectorGradient; exports.transformVectorNode = _chunkKANRAHTLcjs.transformVectorNode; exports.transformVectorPaint = _chunkKANRAHTLcjs.transformVectorPaint; exports.translateAnchor = _chunkKANRAHTLcjs.translateAnchor; exports.translateMatrix = _chunkDWGZUSEScjs.translateMatrix; exports.trimIntervals = _chunkKANRAHTLcjs.trimIntervals; exports.trimPaths = _chunkKANRAHTLcjs.trimPaths; exports.trimPathsIndividually = _chunkKANRAHTLcjs.trimPathsIndividually; exports.turnMorphContour = _chunkKANRAHTLcjs.turnMorphContour; exports.twistPaths = _chunkKANRAHTLcjs.twistPaths; exports.unionBounds = _chunkKANRAHTLcjs.unionBounds; exports.variableStrokeOutline = _chunkKANRAHTLcjs.variableStrokeOutline; exports.variableStrokeRings = _chunkKANRAHTLcjs.variableStrokeRings; exports.vectorAppearanceNodes = _chunkKANRAHTLcjs.vectorAppearanceNodes; exports.vectorAppearanceOutline = _chunkKANRAHTLcjs.vectorAppearanceOutline; exports.vectorAppearanceShapes = _chunkKANRAHTLcjs.vectorAppearanceShapes; exports.vectorBlendColorDistance = vectorBlendColorDistance; exports.vectorBlendKeyTargets = vectorBlendKeyTargets; exports.vectorBlendKeys = vectorBlendKeys; exports.vectorBlendModeCss = _chunkKANRAHTLcjs.vectorBlendModeCss; exports.vectorBlendModeFromCss = _chunkKANRAHTLcjs.vectorBlendModeFromCss; exports.vectorBlendRail = vectorBlendRail; exports.vectorBlendRailAt = vectorBlendRailAt; exports.vectorBlendSpine = vectorBlendSpine; exports.vectorBlendStepCount = vectorBlendStepCount; exports.vectorBoxCorners = vectorBoxCorners; exports.vectorBoxMatrix = _chunkKANRAHTLcjs.vectorBoxMatrix; exports.vectorBuilderErasedEdges = vectorBuilderErasedEdges; exports.vectorCornerAt = _chunkKANRAHTLcjs.vectorCornerAt; exports.vectorCorners = _chunkKANRAHTLcjs.vectorCorners; exports.vectorCornersAttribute = _chunkKANRAHTLcjs.vectorCornersAttribute; exports.vectorDiamondPath = vectorDiamondPath; exports.vectorDistortQuad = vectorDistortQuad; exports.vectorDocumentToSvg = _chunkKANRAHTLcjs.vectorDocumentToSvg; exports.vectorEffectInputBounds = _chunkKANRAHTLcjs.vectorEffectInputBounds; exports.vectorEffectInputPaths = _chunkKANRAHTLcjs.vectorEffectInputPaths; exports.vectorEnteredGroups = _chunkKANRAHTLcjs.vectorEnteredGroups; exports.vectorEnvelopeFrame = _chunkKANRAHTLcjs.vectorEnvelopeFrame; exports.vectorEnvelopeMap = _chunkKANRAHTLcjs.vectorEnvelopeMap; exports.vectorEnvelopeMesh = _chunkKANRAHTLcjs.vectorEnvelopeMesh; exports.vectorFillMap = vectorFillMap; exports.vectorFills = _chunkKANRAHTLcjs.vectorFills; exports.vectorFilterMarkup = _chunkKANRAHTLcjs.vectorFilterMarkup; exports.vectorFilterParamKeys = _chunkKANRAHTLcjs.vectorFilterParamKeys; exports.vectorFilterReach = _chunkKANRAHTLcjs.vectorFilterReach; exports.vectorFilterSvg = _chunkKANRAHTLcjs.vectorFilterSvg; exports.vectorGradientArea = _chunkKANRAHTLcjs.vectorGradientArea; exports.vectorGradientAspect = _chunkKANRAHTLcjs.vectorGradientAspect; exports.vectorGradientBarPosition = vectorGradientBarPosition; exports.vectorGradientFocalParam = _chunkKANRAHTLcjs.vectorGradientFocalParam; exports.vectorGradientHandles = _chunkKANRAHTLcjs.vectorGradientHandles; exports.vectorGradientMatrix = _chunkKANRAHTLcjs.vectorGradientMatrix; exports.vectorGradientMidpointFromPosition = _chunkKANRAHTLcjs.vectorGradientMidpointFromPosition; exports.vectorGradientMidpointPosition = _chunkKANRAHTLcjs.vectorGradientMidpointPosition; exports.vectorGradientNeedsExpansion = _chunkKANRAHTLcjs.vectorGradientNeedsExpansion; exports.vectorGradientParam = _chunkKANRAHTLcjs.vectorGradientParam; exports.vectorGradientPoints = _chunkKANRAHTLcjs.vectorGradientPoints; exports.vectorGradientRamp = _chunkKANRAHTLcjs.vectorGradientRamp; exports.vectorGradientSvgDefs = _chunkKANRAHTLcjs.vectorGradientSvgDefs; exports.vectorGradientTAt = _chunkKANRAHTLcjs.vectorGradientTAt; exports.vectorGradientTargetPath = vectorGradientTargetPath; exports.vectorGradientUnitsMatrix = _chunkKANRAHTLcjs.vectorGradientUnitsMatrix; exports.vectorHomography = _chunkMUUXNRU4cjs.homographyFromPoints; exports.vectorHomographyKeepsQuad = _chunkMUUXNRU4cjs.homographyKeepsQuad; exports.vectorIdentityMesh = _chunkDWGZUSEScjs.identityWarpMesh; exports.vectorInkShapeName = vectorInkShapeName; exports.vectorLiveBooleanSteps = _chunkKANRAHTLcjs.vectorLiveBooleanSteps; exports.vectorMeshColumns = _chunkDWGZUSEScjs.warpMeshColumns; exports.vectorMeshControlBounds = _chunkDWGZUSEScjs.warpMeshControlBounds; exports.vectorMeshEditPoints = _chunkDWGZUSEScjs.warpMeshEditPoints; exports.vectorMeshFromOutline = _chunkKANRAHTLcjs.vectorMeshFromOutline; exports.vectorMeshGridCurves = _chunkDWGZUSEScjs.warpMeshGridCurves; exports.vectorMeshOutline = _chunkKANRAHTLcjs.vectorMeshOutline; exports.vectorMeshParamAt = _chunkDWGZUSEScjs.warpMeshParamAt; exports.vectorMeshRows = _chunkDWGZUSEScjs.warpMeshRows; exports.vectorNodeBounds = _chunkKANRAHTLcjs.vectorNodeBounds; exports.vectorNodeEnvelope = _chunkKANRAHTLcjs.vectorNodeEnvelope; exports.vectorNodeFilterSvg = _chunkKANRAHTLcjs.vectorNodeFilterSvg; exports.vectorNodeLocalPaintBounds = _chunkKANRAHTLcjs.vectorNodeLocalPaintBounds; exports.vectorNodeRotation = _chunkKANRAHTLcjs.vectorNodeRotation; exports.vectorNodeToBezier = _chunkKANRAHTLcjs.vectorNodeToBezier; exports.vectorOperandOperation = _chunkKANRAHTLcjs.vectorOperandOperation; exports.vectorPaintLayerNodes = _chunkKANRAHTLcjs.vectorPaintLayerNodes; exports.vectorPaintSwatch = vectorPaintSwatch; exports.vectorPaintToHex = vectorPaintToHex; exports.vectorPaintToSvg = _chunkKANRAHTLcjs.vectorPaintToSvg; exports.vectorParentMatrix = _chunkKANRAHTLcjs.vectorParentMatrix; exports.vectorPathData = _chunkKANRAHTLcjs.vectorPathData; exports.vectorPathEntries = vectorPathEntries; exports.vectorPathLocalBounds = _chunkKANRAHTLcjs.vectorPathLocalBounds; exports.vectorPathWorldBezier = _chunkKANRAHTLcjs.vectorPathWorldBezier; exports.vectorPathfinderShape = vectorPathfinderShape; exports.vectorRepeaterCopies = _chunkKANRAHTLcjs.vectorRepeaterCopies; exports.vectorResizeCursor = vectorResizeCursor; exports.vectorResultStyle = vectorResultStyle; exports.vectorShapeBuilderHit = vectorShapeBuilderHit; exports.vectorShapeBuilderMap = vectorShapeBuilderMap; exports.vectorShearForSide = vectorShearForSide; exports.vectorSkewMatrix = vectorSkewMatrix; exports.vectorStacksHaveGradient = _chunkKANRAHTLcjs.vectorStacksHaveGradient; exports.vectorStrokeGradientDefs = _chunkKANRAHTLcjs.vectorStrokeGradientDefs; exports.vectorStrokeLineArea = _chunkKANRAHTLcjs.vectorStrokeLineArea; exports.vectorStrokeOutline = _chunkKANRAHTLcjs.vectorStrokeOutline; exports.vectorStrokeOutlinePath = _chunkKANRAHTLcjs.vectorStrokeOutlinePath; exports.vectorStrokeParts = _chunkKANRAHTLcjs.vectorStrokeParts; exports.vectorStrokeReach = _chunkKANRAHTLcjs.vectorStrokeReach; exports.vectorStrokeSettings = _chunkKANRAHTLcjs.vectorStrokeSettings; exports.vectorStrokeStackReach = _chunkKANRAHTLcjs.vectorStrokeStackReach; exports.vectorStrokeSvgParts = _chunkKANRAHTLcjs.vectorStrokeSvgParts; exports.vectorStrokeWidthGeometry = vectorStrokeWidthGeometry; exports.vectorStrokes = _chunkKANRAHTLcjs.vectorStrokes; exports.vectorTargetPaint = _chunkKANRAHTLcjs.vectorTargetPaint; exports.vectorToolLabel = vectorToolLabel; exports.vectorWarpPresetGrid = _chunkDWGZUSEScjs.warpPresetGrid; exports.vectorWarpPresetMesh = _chunkDWGZUSEScjs.warpPresetMesh; exports.vectorWorldMatrix = _chunkKANRAHTLcjs.vectorWorldMatrix; exports.walkVectorNodes = _chunkKANRAHTLcjs.walkVectorNodes; exports.widthProfileAt = _chunkKANRAHTLcjs.widthProfileAt; exports.widthProfileFromAttribute = _chunkKANRAHTLcjs.widthProfileFromAttribute; exports.widthProfileMaxScale = _chunkKANRAHTLcjs.widthProfileMaxScale; exports.widthProfilePreset = _chunkKANRAHTLcjs.widthProfilePreset; exports.widthProfilePresetId = _chunkKANRAHTLcjs.widthProfilePresetId; exports.widthProfileToAttribute = _chunkKANRAHTLcjs.widthProfileToAttribute; exports.wigglePaths = _chunkKANRAHTLcjs.wigglePaths; exports.withVectorFills = _chunkKANRAHTLcjs.withVectorFills; exports.withVectorStrokes = _chunkKANRAHTLcjs.withVectorStrokes; exports.withVectorTargetPaint = _chunkKANRAHTLcjs.withVectorTargetPaint; exports.zigzagPaths = _chunkKANRAHTLcjs.zigzagPaths;
|
|
9333
10101
|
//# sourceMappingURL=index.cjs.map
|