@pixerate/editor 0.107.0 → 0.108.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD_PARTY_NOTICES.md +4 -0
- package/dist/animation-editor/index.cjs +39 -39
- package/dist/animation-editor/index.d.cts +1 -1
- package/dist/animation-editor/index.d.ts +1 -1
- package/dist/animation-editor/index.js +1 -1
- package/dist/{chunk-63EFQCT5.js → chunk-HUQ7EHVI.js} +1140 -371
- package/dist/chunk-HUQ7EHVI.js.map +1 -0
- package/dist/{chunk-KANRAHTL.cjs → chunk-UTEVPQTS.cjs} +1353 -584
- package/dist/chunk-UTEVPQTS.cjs.map +1 -0
- package/dist/paint-editor/index.cjs +196 -11
- package/dist/paint-editor/index.cjs.map +1 -1
- package/dist/paint-editor/index.d.cts +96 -2
- package/dist/paint-editor/index.d.ts +96 -2
- package/dist/paint-editor/index.js +190 -5
- package/dist/paint-editor/index.js.map +1 -1
- package/dist/{svg-Bj1MQFh6.d.cts → svg-ClVIG4T7.d.cts} +26 -2
- package/dist/{svg-vme0PLNo.d.ts → svg-SseJTIrA.d.ts} +26 -2
- package/dist/vector/index.cjs +977 -948
- package/dist/vector/index.cjs.map +1 -1
- package/dist/vector/index.d.cts +266 -7
- package/dist/vector/index.d.ts +266 -7
- package/dist/vector/index.js +427 -398
- package/dist/vector/index.js.map +1 -1
- package/package.json +1 -1
- package/skills/pixerate-image-editor/SKILL.md +50 -7
- package/skills/pixerate-vector/SKILL.md +35 -5
- package/dist/chunk-63EFQCT5.js.map +0 -1
- package/dist/chunk-KANRAHTL.cjs.map +0 -1
package/dist/vector/index.cjs
CHANGED
|
@@ -284,13 +284,33 @@ var _chunkMUUXNRU4cjs = require('../chunk-MUUXNRU4.cjs');
|
|
|
284
284
|
|
|
285
285
|
|
|
286
286
|
|
|
287
|
-
var _chunkKANRAHTLcjs = require('../chunk-KANRAHTL.cjs');
|
|
288
287
|
|
|
289
288
|
|
|
290
289
|
|
|
291
290
|
|
|
292
291
|
|
|
293
292
|
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
var _chunkUTEVPQTScjs = require('../chunk-UTEVPQTS.cjs');
|
|
294
314
|
|
|
295
315
|
|
|
296
316
|
|
|
@@ -367,9 +387,9 @@ var fmt = (n) => Math.round(n * 100) / 100;
|
|
|
367
387
|
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] });
|
|
368
388
|
function vectorGradientTargetPath(doc, selection, target, layer = null) {
|
|
369
389
|
for (const id of selection) {
|
|
370
|
-
const node =
|
|
390
|
+
const node = _chunkUTEVPQTScjs.findVectorNode.call(void 0, doc.nodes, id);
|
|
371
391
|
if (!node) continue;
|
|
372
|
-
const path =
|
|
392
|
+
const path = _chunkUTEVPQTScjs.collectPathNodes.call(void 0, node).find((p) => _chunkUTEVPQTScjs.isVectorGradient.call(void 0, _chunkUTEVPQTScjs.vectorTargetPaint.call(void 0, p, target, layer)));
|
|
373
393
|
if (path) return path;
|
|
374
394
|
}
|
|
375
395
|
return null;
|
|
@@ -377,24 +397,24 @@ function vectorGradientTargetPath(doc, selection, target, layer = null) {
|
|
|
377
397
|
function getVectorGradientAnnotator(doc, selection, viewport, target, layer = null) {
|
|
378
398
|
const path = vectorGradientTargetPath(doc, selection, target, layer);
|
|
379
399
|
if (!path) return null;
|
|
380
|
-
const gradient =
|
|
381
|
-
const world = _nullishCoalesce(
|
|
400
|
+
const gradient = _chunkUTEVPQTScjs.vectorTargetPaint.call(void 0, path, target, layer);
|
|
401
|
+
const world = _nullishCoalesce(_chunkUTEVPQTScjs.vectorWorldMatrix.call(void 0, doc.nodes, path.id), () => ( _chunkDWGZUSEScjs.IDENTITY_MATRIX));
|
|
382
402
|
const screen = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, world, [viewport.zoom, 0, 0, viewport.zoom, viewport.x, viewport.y]);
|
|
383
|
-
const bounds =
|
|
384
|
-
const h =
|
|
403
|
+
const bounds = _chunkUTEVPQTScjs.vectorPathLocalBounds.call(void 0, path);
|
|
404
|
+
const h = _chunkUTEVPQTScjs.vectorGradientHandles.call(void 0, gradient, bounds, screen);
|
|
385
405
|
const v = { x: h.end.x - h.start.x, y: h.end.y - h.start.y };
|
|
386
406
|
const len = Math.hypot(v.x, v.y);
|
|
387
407
|
const normal = len > 1e-9 ? { x: -v.y / len, y: v.x / len } : { x: 0, y: 1 };
|
|
388
408
|
const at = (t, gap) => ({ x: h.start.x + v.x * t + normal.x * gap, y: h.start.y + v.y * t + normal.y * gap });
|
|
389
|
-
const sorted =
|
|
409
|
+
const sorted = _chunkUTEVPQTScjs.sortedVectorGradientStops.call(void 0, gradient);
|
|
390
410
|
const stops = sorted.map((s, index) => ({ ...s, index, ...at(s.offset, VECTOR_GRADIENT_STOP_GAP) }));
|
|
391
411
|
const midpoints = sorted.slice(0, -1).flatMap((s, index) => {
|
|
392
|
-
const pos =
|
|
412
|
+
const pos = _chunkUTEVPQTScjs.vectorGradientMidpointPosition.call(void 0, sorted, index);
|
|
393
413
|
return pos === null || sorted[index + 1].offset - s.offset < 1e-6 ? [] : [{ index, midpoint: _nullishCoalesce(s.midpoint, () => ( 0.5)), ...at(pos, -VECTOR_GRADIENT_MIDPOINT_GAP) }];
|
|
394
414
|
});
|
|
395
415
|
let extent = null;
|
|
396
|
-
if (
|
|
397
|
-
const frame = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0,
|
|
416
|
+
if (_chunkUTEVPQTScjs.isCentredVectorGradient.call(void 0, gradient.type)) {
|
|
417
|
+
const frame = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, _chunkUTEVPQTScjs.vectorGradientMatrix.call(void 0, gradient, bounds), screen);
|
|
398
418
|
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) }));
|
|
399
419
|
extent = `M${pts.map((p) => apply(frame, p)).map((p) => `${fmt(p.x)} ${fmt(p.y)}`).join("L")}Z`;
|
|
400
420
|
}
|
|
@@ -408,14 +428,14 @@ function vectorGradientBarPosition(a, p) {
|
|
|
408
428
|
return { offset: (d.x * v.x + d.y * v.y) / l2, across: d.x * a.normal.x + d.y * a.normal.y };
|
|
409
429
|
}
|
|
410
430
|
function hitVectorGradientAnnotator(a, p) {
|
|
411
|
-
const
|
|
412
|
-
for (let i = a.stops.length - 1; i >= 0; i--) if (
|
|
413
|
-
for (const m of a.midpoints) if (
|
|
414
|
-
const centred =
|
|
415
|
-
if (
|
|
416
|
-
if (a.focal &&
|
|
417
|
-
if (
|
|
418
|
-
if (
|
|
431
|
+
const near = (q, r) => !!q && Math.hypot(q.x - p.x, q.y - p.y) <= r;
|
|
432
|
+
for (let i = a.stops.length - 1; i >= 0; i--) if (near(a.stops[i], STOP_HIT)) return { kind: "stop", index: a.stops[i].index };
|
|
433
|
+
for (const m of a.midpoints) if (near(m, MIDPOINT_HIT)) return { kind: "midpoint", index: m.index };
|
|
434
|
+
const centred = _chunkUTEVPQTScjs.isCentredVectorGradient.call(void 0, a.gradient.type);
|
|
435
|
+
if (near(a.end, HANDLE_HIT)) return { kind: "handle", handle: centred ? "radius" : "end" };
|
|
436
|
+
if (a.focal && near(a.focal, HANDLE_HIT) && !near(a.start, 1)) return { kind: "handle", handle: "focal" };
|
|
437
|
+
if (near(a.start, HANDLE_HIT)) return { kind: "handle", handle: "start" };
|
|
438
|
+
if (near(a.aspect, HANDLE_HIT)) return { kind: "handle", handle: "aspect" };
|
|
419
439
|
const { offset, across } = vectorGradientBarPosition(a, p);
|
|
420
440
|
if (offset >= 0 && offset <= 1 && across >= -BAR_HIT && across <= VECTOR_GRADIENT_STOP_GAP + STOP_HIT) return { kind: "bar", offset };
|
|
421
441
|
return null;
|
|
@@ -447,8 +467,8 @@ function paintColors(p) {
|
|
|
447
467
|
return [];
|
|
448
468
|
}
|
|
449
469
|
function vectorBlendColorDistance(a, b) {
|
|
450
|
-
const pa =
|
|
451
|
-
const pb =
|
|
470
|
+
const pa = _chunkUTEVPQTScjs.collectPathNodes.call(void 0, a)[0];
|
|
471
|
+
const pb = _chunkUTEVPQTScjs.collectPathNodes.call(void 0, b)[0];
|
|
452
472
|
if (!pa || !pb) return 0;
|
|
453
473
|
let d = 0;
|
|
454
474
|
for (const key of ["fill", "stroke"]) {
|
|
@@ -466,7 +486,7 @@ function vectorBlendColorDistance(a, b) {
|
|
|
466
486
|
return d;
|
|
467
487
|
}
|
|
468
488
|
var centreOf = (n) => {
|
|
469
|
-
const b =
|
|
489
|
+
const b = _chunkUTEVPQTScjs.vectorNodeBounds.call(void 0, n);
|
|
470
490
|
return b ? [b.x + b.width / 2, b.y + b.height / 2] : [0, 0];
|
|
471
491
|
};
|
|
472
492
|
function vectorBlendStepCount(a, b, options, length) {
|
|
@@ -478,8 +498,8 @@ function vectorBlendStepCount(a, b, options, length) {
|
|
|
478
498
|
if (o.spacing === "smoothColor") {
|
|
479
499
|
const cd = vectorBlendColorDistance(a, b);
|
|
480
500
|
if (cd > 1 / 255) return Math.min(VECTOR_BLEND_MAX_SMOOTH_STEPS, Math.max(1, Math.ceil(cd * 255 / 2)));
|
|
481
|
-
const ba =
|
|
482
|
-
const bb =
|
|
501
|
+
const ba = _chunkUTEVPQTScjs.vectorNodeBounds.call(void 0, a);
|
|
502
|
+
const bb = _chunkUTEVPQTScjs.vectorNodeBounds.call(void 0, b);
|
|
483
503
|
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;
|
|
484
504
|
return Math.min(VECTOR_BLEND_MAX_SMOOTH_STEPS, Math.max(1, Math.ceil(dist3 / 2)));
|
|
485
505
|
}
|
|
@@ -494,9 +514,9 @@ function vectorBlendRail(sp) {
|
|
|
494
514
|
pts.push(p);
|
|
495
515
|
angles.push(Math.atan2(tangent[1], tangent[0]));
|
|
496
516
|
};
|
|
497
|
-
const count =
|
|
517
|
+
const count = _chunkUTEVPQTScjs.subpathSegmentCount.call(void 0, sp);
|
|
498
518
|
for (let i = 0; i < count; i++) {
|
|
499
|
-
const seg =
|
|
519
|
+
const seg = _chunkUTEVPQTScjs.subpathSegment.call(void 0, sp, i);
|
|
500
520
|
const samples = seg.length === 2 ? 1 : 32;
|
|
501
521
|
if (i === 0) push(seg[0], _chunkXGD3FSNCcjs.segmentTangent.call(void 0, seg, 0));
|
|
502
522
|
for (let k = 1; k <= samples; k++) push(_chunkXGD3FSNCcjs.segmentPoint.call(void 0, seg, k / samples), _chunkXGD3FSNCcjs.segmentTangent.call(void 0, seg, k / samples));
|
|
@@ -554,7 +574,7 @@ function morphFor(a, b, blend) {
|
|
|
554
574
|
let byKey = inner.get(b);
|
|
555
575
|
if (!byKey) inner.set(b, byKey = /* @__PURE__ */ new Map());
|
|
556
576
|
let morph = byKey.get(key);
|
|
557
|
-
if (!morph) byKey.set(key, morph =
|
|
577
|
+
if (!morph) byKey.set(key, morph = _chunkUTEVPQTScjs.createVectorMorph.call(void 0, a, b, { linear: blend.linear, starts }));
|
|
558
578
|
return morph;
|
|
559
579
|
}
|
|
560
580
|
var wrapAngle = (a) => Math.atan2(Math.sin(a), Math.cos(a));
|
|
@@ -596,7 +616,7 @@ function generateVectorBlendChildren(group) {
|
|
|
596
616
|
m = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, m, _chunkDWGZUSEScjs.rotateMatrix.call(void 0, turn * 180 / Math.PI, origin));
|
|
597
617
|
}
|
|
598
618
|
}
|
|
599
|
-
if (m !== _chunkDWGZUSEScjs.IDENTITY_MATRIX) step =
|
|
619
|
+
if (m !== _chunkDWGZUSEScjs.IDENTITY_MATRIX) step = _chunkUTEVPQTScjs.transformVectorNode.call(void 0, step, m);
|
|
600
620
|
}
|
|
601
621
|
out.push(asStep(step, `${group.id}~${++counter}`));
|
|
602
622
|
}
|
|
@@ -643,13 +663,13 @@ function expandVectorBlend(group, newId) {
|
|
|
643
663
|
return { ...rest, children: group.children.map((c) => c.blendStep ? plain(c, newId) : c) };
|
|
644
664
|
}
|
|
645
665
|
function releaseVectorBlend(group, newId) {
|
|
646
|
-
const m =
|
|
666
|
+
const m = _chunkUTEVPQTScjs.nodeMatrix.call(void 0, group);
|
|
647
667
|
const opacity = group.opacity;
|
|
648
|
-
const keys = vectorBlendKeys(group).map((c) => group.transform ?
|
|
668
|
+
const keys = vectorBlendKeys(group).map((c) => group.transform ? _chunkUTEVPQTScjs.transformVectorNode.call(void 0, c, m) : c).map((c) => opacity !== void 0 && opacity < 1 ? { ...c, opacity: (_nullishCoalesce(c.opacity, () => ( 1))) * opacity } : c);
|
|
649
669
|
const spine = _optionalChain([group, 'access', _13 => _13.blend, 'optionalAccess', _14 => _14.spine]);
|
|
650
670
|
if (!spine || spine.anchors.length < 2) return keys;
|
|
651
671
|
const path = { id: newId(), type: "path", name: "Spine", fill: null, stroke: null, subpaths: [{ closed: spine.closed, anchors: spine.anchors.map((a) => ({ ...a })) }] };
|
|
652
|
-
return [...keys, group.transform ?
|
|
672
|
+
return [...keys, group.transform ? _chunkUTEVPQTScjs.transformVectorNode.call(void 0, path, m) : path];
|
|
653
673
|
}
|
|
654
674
|
|
|
655
675
|
// src/vector/distort.ts
|
|
@@ -709,13 +729,13 @@ function mapEffects(node, f) {
|
|
|
709
729
|
return node.effects.map((e) => {
|
|
710
730
|
if (e.type !== "envelope") return e;
|
|
711
731
|
if (e.params.style === "mesh") return e.params.mesh ? { ...e, params: { ...e.params, mesh: _chunkDWGZUSEScjs.mapWarpMeshPoints.call(void 0, e.params.mesh, f) } } : e;
|
|
712
|
-
const bounds =
|
|
713
|
-
if (!bounds || !
|
|
714
|
-
return { ...e, params: { ...e.params, style: "mesh", mesh: _chunkDWGZUSEScjs.mapWarpMeshPoints.call(void 0,
|
|
732
|
+
const bounds = _chunkUTEVPQTScjs.vectorEffectInputBounds.call(void 0, node, e.id);
|
|
733
|
+
if (!bounds || !_chunkUTEVPQTScjs.vectorEnvelopeMap.call(void 0, e.params, bounds)) return e;
|
|
734
|
+
return { ...e, params: { ...e.params, style: "mesh", mesh: _chunkDWGZUSEScjs.mapWarpMeshPoints.call(void 0, _chunkUTEVPQTScjs.vectorEnvelopeMesh.call(void 0, e.params, bounds), f) } };
|
|
715
735
|
});
|
|
716
736
|
}
|
|
717
737
|
function distortVectorNode(node, parentToDoc, f, tolerance = VECTOR_DISTORT_TOLERANCE) {
|
|
718
|
-
const toDoc = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0,
|
|
738
|
+
const toDoc = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, _chunkUTEVPQTScjs.nodeMatrix.call(void 0, node), parentToDoc);
|
|
719
739
|
const inv = _chunkDWGZUSEScjs.invertMatrix.call(void 0, toDoc);
|
|
720
740
|
const local = (p) => _chunkDWGZUSEScjs.applyMatrix.call(void 0, inv, f(_chunkDWGZUSEScjs.applyMatrix.call(void 0, toDoc, p)));
|
|
721
741
|
const effects = mapEffects(node, local);
|
|
@@ -727,16 +747,16 @@ function distortVectorNode(node, parentToDoc, f, tolerance = VECTOR_DISTORT_TOLE
|
|
|
727
747
|
...group,
|
|
728
748
|
children,
|
|
729
749
|
...effects ? { effects } : {},
|
|
730
|
-
...spine ? { blend: { ...group.blend, spine:
|
|
750
|
+
...spine ? { blend: { ...group.blend, spine: _chunkUTEVPQTScjs.mapVectorSubpaths.call(void 0, [spine], local, tolerance)[0] } } : {}
|
|
731
751
|
};
|
|
732
752
|
}
|
|
733
753
|
const path = node;
|
|
734
754
|
return {
|
|
735
755
|
...path,
|
|
736
756
|
...effects ? { effects } : {},
|
|
737
|
-
...path.fill !== void 0 ? { fill:
|
|
738
|
-
...path.stroke !== void 0 ? { stroke:
|
|
739
|
-
subpaths:
|
|
757
|
+
...path.fill !== void 0 ? { fill: _chunkUTEVPQTScjs.mapVectorPaint.call(void 0, path.fill, local) } : {},
|
|
758
|
+
...path.stroke !== void 0 ? { stroke: _chunkUTEVPQTScjs.mapVectorPaint.call(void 0, path.stroke, local) } : {},
|
|
759
|
+
subpaths: _chunkUTEVPQTScjs.mapVectorSubpaths.call(void 0, path.subpaths, local, tolerance)
|
|
740
760
|
};
|
|
741
761
|
}
|
|
742
762
|
|
|
@@ -797,8 +817,8 @@ var LABELS = {
|
|
|
797
817
|
};
|
|
798
818
|
var fmtLength = (n) => String(Math.round(n * 100) / 100);
|
|
799
819
|
function nodeFrame(node, parent, aabb) {
|
|
800
|
-
const angle = _chunkDWGZUSEScjs.matrixRotation.call(void 0, _chunkDWGZUSEScjs.multiplyMatrices.call(void 0,
|
|
801
|
-
const b = angle ?
|
|
820
|
+
const angle = _chunkDWGZUSEScjs.matrixRotation.call(void 0, _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, _chunkUTEVPQTScjs.nodeMatrix.call(void 0, node), parent));
|
|
821
|
+
const b = angle ? _chunkUTEVPQTScjs.vectorNodeBounds.call(void 0, node, _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, parent, _chunkDWGZUSEScjs.rotateMatrix.call(void 0, -angle))) : aabb !== void 0 ? aabb : _chunkUTEVPQTScjs.vectorNodeBounds.call(void 0, node, parent);
|
|
802
822
|
if (!b) return null;
|
|
803
823
|
const c = { x: b.x + b.width / 2, y: b.y + b.height / 2 };
|
|
804
824
|
return { width: b.width, height: b.height, centre: angle ? _chunkDWGZUSEScjs.applyMatrix.call(void 0, _chunkDWGZUSEScjs.rotateMatrix.call(void 0, angle), c) : c };
|
|
@@ -873,7 +893,7 @@ var VectorSnapTargets = (_class = class _VectorSnapTargets {
|
|
|
873
893
|
let segmentBudget = segments ? BUDGET : 0;
|
|
874
894
|
const visit = (list, parent) => {
|
|
875
895
|
for (const n of list) {
|
|
876
|
-
const m = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0,
|
|
896
|
+
const m = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, _chunkUTEVPQTScjs.nodeMatrix.call(void 0, n), parent);
|
|
877
897
|
if (n.type === "group") visit(n.children, m);
|
|
878
898
|
else if (ids.has(n.id) && n.visible !== false) {
|
|
879
899
|
n.subpaths.forEach((sp, s) => {
|
|
@@ -897,10 +917,10 @@ var VectorSnapTargets = (_class = class _VectorSnapTargets {
|
|
|
897
917
|
/** The segments of `sp` (mapped by `m`) that stay put while the anchors `moving` accepts move. */
|
|
898
918
|
pushSegments(sp, m, moving, budget) {
|
|
899
919
|
const n = sp.anchors.length;
|
|
900
|
-
const count =
|
|
920
|
+
const count = _chunkUTEVPQTScjs.subpathSegmentCount.call(void 0, sp);
|
|
901
921
|
for (let i = 0; i < count && budget > 0; i++) {
|
|
902
922
|
if (moving(i) || moving((i + 1) % n)) continue;
|
|
903
|
-
const seg =
|
|
923
|
+
const seg = _chunkUTEVPQTScjs.subpathSegment.call(void 0, sp, i).map((q) => toPoint(_chunkDWGZUSEScjs.applyMatrix.call(void 0, m, toVec(q))));
|
|
904
924
|
let minX = Infinity;
|
|
905
925
|
let minY = Infinity;
|
|
906
926
|
let maxX = -Infinity;
|
|
@@ -955,8 +975,12 @@ var VectorSnapTargets = (_class = class _VectorSnapTargets {
|
|
|
955
975
|
const visit = (list, parent) => {
|
|
956
976
|
for (const stored of list) {
|
|
957
977
|
if (exclude.has(stored.id) || stored.visible === false) continue;
|
|
958
|
-
|
|
959
|
-
|
|
978
|
+
if (_chunkUTEVPQTScjs.isVectorMaskActive.call(void 0, stored) && !contains(stored, exclude)) {
|
|
979
|
+
visit(_chunkUTEVPQTScjs.vectorAppearanceNodes.call(void 0, stored), _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, _chunkUTEVPQTScjs.nodeMatrix.call(void 0, stored), parent));
|
|
980
|
+
continue;
|
|
981
|
+
}
|
|
982
|
+
const n = contains(stored, exclude) ? stored : _chunkUTEVPQTScjs.expandVectorAppearance.call(void 0, stored);
|
|
983
|
+
const m = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, _chunkUTEVPQTScjs.nodeMatrix.call(void 0, n), parent);
|
|
960
984
|
if (n.type === "group") {
|
|
961
985
|
visit(n.children, m);
|
|
962
986
|
continue;
|
|
@@ -971,7 +995,7 @@ var VectorSnapTargets = (_class = class _VectorSnapTargets {
|
|
|
971
995
|
}
|
|
972
996
|
if (gather !== "bounds") segments = self.pushSegments(sp, m, () => false, segments);
|
|
973
997
|
}
|
|
974
|
-
const b =
|
|
998
|
+
const b = _chunkUTEVPQTScjs.vectorNodeBounds.call(void 0, n, parent);
|
|
975
999
|
const f = nodeFrame(n, parent, b);
|
|
976
1000
|
if (b) self.pushRect(b, "edge", _nullishCoalesce(_optionalChain([f, 'optionalAccess', _24 => _24.centre]), () => ( null)));
|
|
977
1001
|
}
|
|
@@ -981,10 +1005,10 @@ var VectorSnapTargets = (_class = class _VectorSnapTargets {
|
|
|
981
1005
|
for (const n of list) {
|
|
982
1006
|
if (exclude.has(n.id) || n.visible === false || self.boxes.length >= BUDGET) continue;
|
|
983
1007
|
if (n.type === "group" && contains(n, exclude)) {
|
|
984
|
-
objects(n.children, _chunkDWGZUSEScjs.multiplyMatrices.call(void 0,
|
|
1008
|
+
objects(n.children, _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, _chunkUTEVPQTScjs.nodeMatrix.call(void 0, n), parent));
|
|
985
1009
|
continue;
|
|
986
1010
|
}
|
|
987
|
-
const b =
|
|
1011
|
+
const b = _chunkUTEVPQTScjs.vectorNodeBounds.call(void 0, n, parent);
|
|
988
1012
|
if (b) self.boxes.push(b);
|
|
989
1013
|
const f = nodeFrame(n, parent, b);
|
|
990
1014
|
if (f) self.sizes.push(f.width, f.height);
|
|
@@ -1025,14 +1049,14 @@ var VectorSnapTargets = (_class = class _VectorSnapTargets {
|
|
|
1025
1049
|
}
|
|
1026
1050
|
const point = this.nearestPoint(p, tol);
|
|
1027
1051
|
if (point) return at(point.p, point.kind);
|
|
1028
|
-
const
|
|
1029
|
-
const crossing = this.crossing(
|
|
1052
|
+
const near = this.segmentsNear(p, tol);
|
|
1053
|
+
const crossing = this.crossing(near, p, tol);
|
|
1030
1054
|
if (crossing) return at(crossing, "intersect");
|
|
1031
1055
|
if (leave && leave.curves !== false) {
|
|
1032
|
-
const foot = this.curvePoint(
|
|
1056
|
+
const foot = this.curvePoint(near, leave.at, p, tol);
|
|
1033
1057
|
if (foot) return at(foot.point, foot.kind, [line("construction", leave.at, foot.point)]);
|
|
1034
1058
|
}
|
|
1035
|
-
const on = this.onSegment(
|
|
1059
|
+
const on = this.onSegment(near);
|
|
1036
1060
|
if (on) return at(on, "path");
|
|
1037
1061
|
if (_optionalChain([leave, 'optionalAccess', _26 => _26.angles, 'optionalAccess', _27 => _27.length])) {
|
|
1038
1062
|
const c = construction(leave, p, tol);
|
|
@@ -1115,12 +1139,12 @@ var VectorSnapTargets = (_class = class _VectorSnapTargets {
|
|
|
1115
1139
|
}
|
|
1116
1140
|
return out.sort((a, b) => a.distance - b.distance);
|
|
1117
1141
|
}
|
|
1118
|
-
onSegment(
|
|
1119
|
-
return
|
|
1142
|
+
onSegment(near) {
|
|
1143
|
+
return near.length ? toVec(_chunkXGD3FSNCcjs.segmentPoint.call(void 0, near[0].seg, near[0].t)) : null;
|
|
1120
1144
|
}
|
|
1121
1145
|
/** Where two of the target segments near `p` cross, the crossing nearest `p` within `tol`. */
|
|
1122
|
-
crossing(
|
|
1123
|
-
const list =
|
|
1146
|
+
crossing(near, p, tol) {
|
|
1147
|
+
const list = near.slice(0, CROSSING_PAIRS);
|
|
1124
1148
|
let best = null;
|
|
1125
1149
|
let bestD = Infinity;
|
|
1126
1150
|
for (let i = 0; i < list.length; i++) {
|
|
@@ -1142,9 +1166,9 @@ var VectorSnapTargets = (_class = class _VectorSnapTargets {
|
|
|
1142
1166
|
* (within `tol` of it): roots of `(B(t) − base) · B′(t)` and `(B(t) − base) × B′(t)`
|
|
1143
1167
|
* bracketed by sign changes of samples and narrowed by bisection.
|
|
1144
1168
|
*/
|
|
1145
|
-
curvePoint(
|
|
1169
|
+
curvePoint(near, base, p, tol) {
|
|
1146
1170
|
let best = null;
|
|
1147
|
-
for (const { seg } of
|
|
1171
|
+
for (const { seg } of near) {
|
|
1148
1172
|
for (const kind of ["perpendicular", "tangent"]) {
|
|
1149
1173
|
if (kind === "tangent" && seg.length === 2) continue;
|
|
1150
1174
|
for (const q of solveOnSegment(seg, base, kind === "perpendicular" ? dotCondition : crossCondition)) {
|
|
@@ -1499,12 +1523,12 @@ var unit = (x, y) => {
|
|
|
1499
1523
|
return l > 1e-12 && Number.isFinite(l) ? [x / l, y / l] : null;
|
|
1500
1524
|
};
|
|
1501
1525
|
function cubicOf(sp, i) {
|
|
1502
|
-
const s =
|
|
1526
|
+
const s = _chunkUTEVPQTScjs.subpathSegment.call(void 0, sp, i);
|
|
1503
1527
|
if (s.length === 4) return s;
|
|
1504
1528
|
const [a, b] = s;
|
|
1505
1529
|
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];
|
|
1506
1530
|
}
|
|
1507
|
-
var isLine = (sp, i) =>
|
|
1531
|
+
var isLine = (sp, i) => _chunkUTEVPQTScjs.subpathSegment.call(void 0, sp, i).length === 2;
|
|
1508
1532
|
function startTangent(c) {
|
|
1509
1533
|
for (let k = 1; k < 4; k++) {
|
|
1510
1534
|
const u = unit(c[k][0] - c[0][0], c[k][1] - c[0][1]);
|
|
@@ -1524,10 +1548,10 @@ function sample(c, n, out, withStart) {
|
|
|
1524
1548
|
}
|
|
1525
1549
|
var onAnchor = (a, h) => !h || Math.abs(h.x - a.x) < EPS && Math.abs(h.y - a.y) < EPS;
|
|
1526
1550
|
function tidy(a, keepType = true) {
|
|
1527
|
-
const next =
|
|
1551
|
+
const next = _chunkUTEVPQTScjs.cloneAnchor.call(void 0, a);
|
|
1528
1552
|
if (onAnchor(next, next.in)) delete next.in;
|
|
1529
1553
|
if (onAnchor(next, next.out)) delete next.out;
|
|
1530
|
-
const shown =
|
|
1554
|
+
const shown = _chunkUTEVPQTScjs.inferAnchorType.call(void 0, next);
|
|
1531
1555
|
const type = keepType && a.type ? a.type === "symmetric" && shown !== "symmetric" ? shown === "corner" ? "corner" : "smooth" : a.type === "smooth" && shown === "corner" ? "corner" : a.type : shown;
|
|
1532
1556
|
if (type === "corner") delete next.type;
|
|
1533
1557
|
else next.type = type;
|
|
@@ -1571,7 +1595,7 @@ function fitAcross(pts, N, t0, t1) {
|
|
|
1571
1595
|
return goldenMin(fit, 0, 1);
|
|
1572
1596
|
}
|
|
1573
1597
|
function removeAnchorKeepingShape(sp, index) {
|
|
1574
|
-
const anchors = sp.anchors.map(
|
|
1598
|
+
const anchors = sp.anchors.map(_chunkUTEVPQTScjs.cloneAnchor);
|
|
1575
1599
|
const n = anchors.length;
|
|
1576
1600
|
if (index < 0 || index >= n) return { anchors, closed: sp.closed };
|
|
1577
1601
|
if ((sp.closed || index > 0 && index < n - 1) && n >= 3) {
|
|
@@ -1605,12 +1629,12 @@ function removeAnchorKeepingShape(sp, index) {
|
|
|
1605
1629
|
}
|
|
1606
1630
|
function removeAnchorsKeepingShape(sp, indices) {
|
|
1607
1631
|
const order = [...new Set(indices)].filter((i) => i >= 0 && i < sp.anchors.length).sort((a, b) => b - a);
|
|
1608
|
-
return order.reduce((acc, i) => removeAnchorKeepingShape(acc, i), { anchors: sp.anchors.map(
|
|
1632
|
+
return order.reduce((acc, i) => removeAnchorKeepingShape(acc, i), { anchors: sp.anchors.map(_chunkUTEVPQTScjs.cloneAnchor), closed: sp.closed });
|
|
1609
1633
|
}
|
|
1610
1634
|
function bendSegment(sp, segment, t, p) {
|
|
1611
|
-
const anchors = sp.anchors.map(
|
|
1635
|
+
const anchors = sp.anchors.map(_chunkUTEVPQTScjs.cloneAnchor);
|
|
1612
1636
|
const n = anchors.length;
|
|
1613
|
-
if (segment < 0 || segment >=
|
|
1637
|
+
if (segment < 0 || segment >= _chunkUTEVPQTScjs.subpathSegmentCount.call(void 0, sp) || !Number.isFinite(t) || !Number.isFinite(p.x) || !Number.isFinite(p.y)) return { anchors, closed: sp.closed };
|
|
1614
1638
|
const tc = Math.min(0.95, Math.max(0.05, t));
|
|
1615
1639
|
const ia = segment;
|
|
1616
1640
|
const ib = (segment + 1) % n;
|
|
@@ -1621,16 +1645,16 @@ function bendSegment(sp, segment, t, p) {
|
|
|
1621
1645
|
const oy = (p.y - (a.y + (b.y - a.y) * tc)) / k;
|
|
1622
1646
|
const c1 = { x: a.x + (b.x - a.x) / 3 + ox, y: a.y + (b.y - a.y) / 3 + oy };
|
|
1623
1647
|
const c2 = { x: b.x + (a.x - b.x) / 3 + ox, y: b.y + (a.y - b.y) / 3 + oy };
|
|
1624
|
-
anchors[ia] =
|
|
1625
|
-
anchors[ib] =
|
|
1648
|
+
anchors[ia] = _chunkUTEVPQTScjs.moveAnchorHandle.call(void 0, a, "out", c1);
|
|
1649
|
+
anchors[ib] = _chunkUTEVPQTScjs.moveAnchorHandle.call(void 0, b, "in", c2);
|
|
1626
1650
|
return { anchors, closed: sp.closed };
|
|
1627
1651
|
}
|
|
1628
1652
|
function subpathPointAt(sp, segment, t) {
|
|
1629
|
-
const [x, y] = _chunkXGD3FSNCcjs.segmentPoint.call(void 0,
|
|
1653
|
+
const [x, y] = _chunkXGD3FSNCcjs.segmentPoint.call(void 0, _chunkUTEVPQTScjs.subpathSegment.call(void 0, sp, segment), t);
|
|
1630
1654
|
return { x, y };
|
|
1631
1655
|
}
|
|
1632
1656
|
function curvatureMoveAnchor(sp, index, q) {
|
|
1633
|
-
const anchors = sp.anchors.map(
|
|
1657
|
+
const anchors = sp.anchors.map(_chunkUTEVPQTScjs.cloneAnchor);
|
|
1634
1658
|
const a = sp.anchors[index];
|
|
1635
1659
|
if (!a) return { anchors, closed: sp.closed };
|
|
1636
1660
|
const own = [
|
|
@@ -1675,7 +1699,7 @@ function curvatureMoveAnchor(sp, index, q) {
|
|
|
1675
1699
|
function cutSubpathAt(sp, at) {
|
|
1676
1700
|
const n = sp.anchors.length;
|
|
1677
1701
|
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);
|
|
1678
|
-
if (!cuts.length || n < 2) return [{ anchors: sp.anchors.map(
|
|
1702
|
+
if (!cuts.length || n < 2) return [{ anchors: sp.anchors.map(_chunkUTEVPQTScjs.cloneAnchor), closed: sp.closed }];
|
|
1679
1703
|
const first = cuts[0];
|
|
1680
1704
|
const run = sp.closed ? Array.from({ length: n + 1 }, (_, i) => sp.anchors[(first + i) % n]) : sp.anchors;
|
|
1681
1705
|
const cutSet = new Set(sp.closed ? [...cuts.map((c) => (c - first + n) % n), n] : cuts);
|
|
@@ -1683,7 +1707,7 @@ function cutSubpathAt(sp, at) {
|
|
|
1683
1707
|
let cur = [];
|
|
1684
1708
|
run.forEach((a, i) => {
|
|
1685
1709
|
if (!cutSet.has(i)) {
|
|
1686
|
-
cur.push(
|
|
1710
|
+
cur.push(_chunkUTEVPQTScjs.cloneAnchor.call(void 0, a));
|
|
1687
1711
|
return;
|
|
1688
1712
|
}
|
|
1689
1713
|
if (cur.length) {
|
|
@@ -1698,10 +1722,10 @@ function cutSubpathAt(sp, at) {
|
|
|
1698
1722
|
}
|
|
1699
1723
|
function splitSubpathAt(sp, segment, t, endTolerance = 1e-6) {
|
|
1700
1724
|
const n = sp.anchors.length;
|
|
1701
|
-
if (segment < 0 || segment >=
|
|
1725
|
+
if (segment < 0 || segment >= _chunkUTEVPQTScjs.subpathSegmentCount.call(void 0, sp)) return [{ anchors: sp.anchors.map(_chunkUTEVPQTScjs.cloneAnchor), closed: sp.closed }];
|
|
1702
1726
|
if (t <= endTolerance) return cutSubpathAt(sp, [segment]);
|
|
1703
1727
|
if (t >= 1 - endTolerance) return cutSubpathAt(sp, [(segment + 1) % n]);
|
|
1704
|
-
const { subpath, index } =
|
|
1728
|
+
const { subpath, index } = _chunkUTEVPQTScjs.insertAnchor.call(void 0, sp, segment, t);
|
|
1705
1729
|
return cutSubpathAt(subpath, [index]);
|
|
1706
1730
|
}
|
|
1707
1731
|
var endOf = (sp, last) => sp.anchors[last ? sp.anchors.length - 1 : 0];
|
|
@@ -1723,7 +1747,7 @@ function joinSubpaths(subpaths, tolerance) {
|
|
|
1723
1747
|
const closed = [];
|
|
1724
1748
|
let open = [];
|
|
1725
1749
|
for (const sp of subpaths) {
|
|
1726
|
-
const copy = { anchors: sp.anchors.map(
|
|
1750
|
+
const copy = { anchors: sp.anchors.map(_chunkUTEVPQTScjs.cloneAnchor), closed: sp.closed };
|
|
1727
1751
|
if (sp.closed || sp.anchors.length < 2) {
|
|
1728
1752
|
if (sp.anchors.length) closed.push(copy);
|
|
1729
1753
|
} else open.push(copy);
|
|
@@ -1778,7 +1802,7 @@ function smoothSubpath(sp, amount = 1, only) {
|
|
|
1778
1802
|
const t = Math.min(1, Math.max(0, amount));
|
|
1779
1803
|
const orig = sp.anchors;
|
|
1780
1804
|
const n = orig.length;
|
|
1781
|
-
const anchors = orig.map(
|
|
1805
|
+
const anchors = orig.map(_chunkUTEVPQTScjs.cloneAnchor);
|
|
1782
1806
|
if (n < 3 || t === 0) return { anchors, closed: sp.closed };
|
|
1783
1807
|
for (let i = 0; i < n; i++) {
|
|
1784
1808
|
if (!sp.closed && (i === 0 || i === n - 1)) continue;
|
|
@@ -1807,8 +1831,8 @@ function smoothSubpath(sp, amount = 1, only) {
|
|
|
1807
1831
|
}
|
|
1808
1832
|
function segsOf(sp) {
|
|
1809
1833
|
const out = [];
|
|
1810
|
-
for (let i = 0; i <
|
|
1811
|
-
const s =
|
|
1834
|
+
for (let i = 0; i < _chunkUTEVPQTScjs.subpathSegmentCount.call(void 0, sp); i++) {
|
|
1835
|
+
const s = _chunkUTEVPQTScjs.subpathSegment.call(void 0, sp, i);
|
|
1812
1836
|
out.push(s.length === 2 ? { c: s, line: true } : { c: s, line: false });
|
|
1813
1837
|
}
|
|
1814
1838
|
return out;
|
|
@@ -1865,7 +1889,7 @@ function removeRedundantPoints(sp, tolerance) {
|
|
|
1865
1889
|
const tol = Math.max(tolerance, 1e-9);
|
|
1866
1890
|
const types = new Map(sp.anchors.filter((a) => a.type).map((a) => [`${a.x},${a.y}`, a.type]));
|
|
1867
1891
|
const segs = segsOf(sp).filter((s) => !isZeroSeg(s));
|
|
1868
|
-
if (!segs.length) return { anchors: sp.anchors.map(
|
|
1892
|
+
if (!segs.length) return { anchors: sp.anchors.map(_chunkUTEVPQTScjs.cloneAnchor), closed: sp.closed };
|
|
1869
1893
|
const minSegs = sp.closed ? 2 : 1;
|
|
1870
1894
|
let changed = true;
|
|
1871
1895
|
while (changed && segs.length > minSegs) {
|
|
@@ -1883,347 +1907,7 @@ function removeRedundantPoints(sp, tolerance) {
|
|
|
1883
1907
|
break;
|
|
1884
1908
|
}
|
|
1885
1909
|
}
|
|
1886
|
-
return _nullishCoalesce(segsToSubpath(segs, sp.closed, types), () => ( { anchors: sp.anchors.map(
|
|
1887
|
-
}
|
|
1888
|
-
|
|
1889
|
-
// src/vector/pathCut.ts
|
|
1890
|
-
var loopArea = (l) => _chunkXGD3FSNCcjs.contourSignedArea.call(void 0, l.segs);
|
|
1891
|
-
function loopSample(l) {
|
|
1892
|
-
const k = l.chord.findIndex((c) => !c);
|
|
1893
|
-
return _chunkXGD3FSNCcjs.segmentPoint.call(void 0, l.segs[k >= 0 ? k : 0], 0.5);
|
|
1894
|
-
}
|
|
1895
|
-
var contains2 = (l, p) => _chunkXGD3FSNCcjs.windingNumber.call(void 0, [l.segs], p) !== 0;
|
|
1896
|
-
function groupFaces(loops) {
|
|
1897
|
-
const usable2 = loops.filter((l) => l.segs.length && Math.abs(loopArea(l)) > 1e-12);
|
|
1898
|
-
if (!usable2.length) return [];
|
|
1899
|
-
const largest = usable2.reduce((a, b) => Math.abs(loopArea(b)) > Math.abs(loopArea(a)) ? b : a);
|
|
1900
|
-
const sign = Math.sign(loopArea(largest));
|
|
1901
|
-
const outers = usable2.filter((l) => Math.sign(loopArea(l)) === sign).sort((a, b) => Math.abs(loopArea(a)) - Math.abs(loopArea(b)));
|
|
1902
|
-
const faces = new Map(outers.map((o) => [o, { loops: [o] }]));
|
|
1903
|
-
for (const hole of usable2.filter((l) => Math.sign(loopArea(l)) !== sign)) {
|
|
1904
|
-
const p = loopSample(hole);
|
|
1905
|
-
const parent = outers.find((o) => Math.abs(loopArea(o)) > Math.abs(loopArea(hole)) && contains2(o, p));
|
|
1906
|
-
if (parent) faces.get(parent).loops.push(hole);
|
|
1907
|
-
}
|
|
1908
|
-
return outers.reverse().map((o) => faces.get(o));
|
|
1909
|
-
}
|
|
1910
|
-
function faceToPath(face) {
|
|
1911
|
-
return _chunkXGD3FSNCcjs.contoursToPath.call(void 0, face.loops.map((l) => ({ segments: l.segs, closed: true })));
|
|
1912
|
-
}
|
|
1913
|
-
function facesOf(path, fillRule) {
|
|
1914
|
-
const normalized = _chunkXGD3FSNCcjs.normalizeBezierPath.call(void 0, path, fillRule);
|
|
1915
|
-
const loops = _chunkXGD3FSNCcjs.pathToContours.call(void 0, normalized).map((c) => {
|
|
1916
|
-
const segs = _chunkXGD3FSNCcjs.closeContour.call(void 0, c, true).map((s) => s.slice());
|
|
1917
|
-
return { segs, chord: segs.map(() => false) };
|
|
1918
|
-
});
|
|
1919
|
-
return groupFaces(loops);
|
|
1920
|
-
}
|
|
1921
|
-
function splitIntoFaces(path, fillRule = "nonzero") {
|
|
1922
|
-
return facesOf(path, fillRule).map(faceToPath);
|
|
1923
|
-
}
|
|
1924
|
-
function rootsInUnit(a, b, c, d, scale) {
|
|
1925
|
-
const f = (t) => ((a * t + b) * t + c) * t + d;
|
|
1926
|
-
const tol = 1e-12 * Math.max(1, scale);
|
|
1927
|
-
const cuts = [0];
|
|
1928
|
-
const qa = 3 * a;
|
|
1929
|
-
const qb = 2 * b;
|
|
1930
|
-
if (Math.abs(qa) > 1e-18) {
|
|
1931
|
-
const disc = qb * qb - 4 * qa * c;
|
|
1932
|
-
if (disc >= 0) {
|
|
1933
|
-
const r = Math.sqrt(disc);
|
|
1934
|
-
for (const t of [(-qb - r) / (2 * qa), (-qb + r) / (2 * qa)].sort((x, y) => x - y)) if (t > 0 && t < 1) cuts.push(t);
|
|
1935
|
-
}
|
|
1936
|
-
} else if (Math.abs(qb) > 1e-18) {
|
|
1937
|
-
const t = -c / qb;
|
|
1938
|
-
if (t > 0 && t < 1) cuts.push(t);
|
|
1939
|
-
}
|
|
1940
|
-
cuts.push(1);
|
|
1941
|
-
const roots = [];
|
|
1942
|
-
const push = (t) => {
|
|
1943
|
-
if (!roots.some((r) => Math.abs(r - t) < 1e-9)) roots.push(t);
|
|
1944
|
-
};
|
|
1945
|
-
for (let i = 0; i < cuts.length - 1; i++) {
|
|
1946
|
-
let lo = cuts[i];
|
|
1947
|
-
let hi = cuts[i + 1];
|
|
1948
|
-
let flo = f(lo);
|
|
1949
|
-
const fhi = f(hi);
|
|
1950
|
-
if (Math.abs(flo) <= tol) push(lo);
|
|
1951
|
-
if (Math.abs(fhi) <= tol) push(hi);
|
|
1952
|
-
if (flo * fhi >= 0) continue;
|
|
1953
|
-
for (let k = 0; k < 80; k++) {
|
|
1954
|
-
const m = (lo + hi) / 2;
|
|
1955
|
-
const fm = f(m);
|
|
1956
|
-
if (fm === 0) {
|
|
1957
|
-
lo = hi = m;
|
|
1958
|
-
break;
|
|
1959
|
-
}
|
|
1960
|
-
if (fm * flo < 0) hi = m;
|
|
1961
|
-
else {
|
|
1962
|
-
lo = m;
|
|
1963
|
-
flo = fm;
|
|
1964
|
-
}
|
|
1965
|
-
}
|
|
1966
|
-
push((lo + hi) / 2);
|
|
1967
|
-
}
|
|
1968
|
-
return roots.sort((x, y) => x - y);
|
|
1969
|
-
}
|
|
1970
|
-
function lineHits(p, q, seg) {
|
|
1971
|
-
const dx = q[0] - p[0];
|
|
1972
|
-
const dy = q[1] - p[1];
|
|
1973
|
-
const len2 = dx * dx + dy * dy;
|
|
1974
|
-
if (len2 < 1e-24) return [];
|
|
1975
|
-
const h = (pt) => (pt[0] - p[0]) * -dy + (pt[1] - p[1]) * dx;
|
|
1976
|
-
let coeffs;
|
|
1977
|
-
if (seg.length === 2) coeffs = [0, 0, h(seg[1]) - h(seg[0]), h(seg[0])];
|
|
1978
|
-
else {
|
|
1979
|
-
const [h0, h1, h2, h3] = seg.map(h);
|
|
1980
|
-
coeffs = [-h0 + 3 * h1 - 3 * h2 + h3, 3 * h0 - 6 * h1 + 3 * h2, -3 * h0 + 3 * h1, h0];
|
|
1981
|
-
}
|
|
1982
|
-
if (coeffs.every((c) => Math.abs(c) < 1e-12 * Math.max(1, len2))) return [];
|
|
1983
|
-
const scale = Math.sqrt(len2) * Math.max(1, ...seg.map((pt) => Math.abs(pt[0]) + Math.abs(pt[1])));
|
|
1984
|
-
const out = [];
|
|
1985
|
-
for (const t of rootsInUnit(...coeffs, scale)) {
|
|
1986
|
-
const point = _chunkXGD3FSNCcjs.segmentPoint.call(void 0, seg, t);
|
|
1987
|
-
const s = ((point[0] - p[0]) * dx + (point[1] - p[1]) * dy) / len2;
|
|
1988
|
-
if (s >= -1e-9 && s <= 1 + 1e-9) out.push({ s: Math.min(1, Math.max(0, s)), t, point });
|
|
1989
|
-
}
|
|
1990
|
-
return out;
|
|
1991
|
-
}
|
|
1992
|
-
var near = (a, b, eps) => Math.abs(a[0] - b[0]) <= eps && Math.abs(a[1] - b[1]) <= eps;
|
|
1993
|
-
var degenerate = (seg, eps) => seg.every((p) => near(p, seg[0], eps));
|
|
1994
|
-
function arc(l, a, b, eps) {
|
|
1995
|
-
const n = l.segs.length;
|
|
1996
|
-
const segs = [];
|
|
1997
|
-
const chord = [];
|
|
1998
|
-
const push = (k, t0, t1) => {
|
|
1999
|
-
const piece = t0 <= 0 && t1 >= 1 ? l.segs[k].slice() : _chunkXGD3FSNCcjs.subSegment.call(void 0, l.segs[k], t0, t1);
|
|
2000
|
-
if (!degenerate(piece, eps)) {
|
|
2001
|
-
segs.push(piece);
|
|
2002
|
-
chord.push(l.chord[k]);
|
|
2003
|
-
}
|
|
2004
|
-
};
|
|
2005
|
-
if (a.seg === b.seg && b.t >= a.t + 1e-12) {
|
|
2006
|
-
push(a.seg, a.t, b.t);
|
|
2007
|
-
return { segs, chord };
|
|
2008
|
-
}
|
|
2009
|
-
push(a.seg, a.t, 1);
|
|
2010
|
-
for (let k = (a.seg + 1) % n; k !== b.seg; k = (k + 1) % n) push(k, 0, 1);
|
|
2011
|
-
push(b.seg, 0, b.t);
|
|
2012
|
-
return { segs, chord };
|
|
2013
|
-
}
|
|
2014
|
-
function polySegs(points, eps) {
|
|
2015
|
-
const out = [];
|
|
2016
|
-
for (let i = 1; i < points.length; i++) if (!near(points[i - 1], points[i], eps)) out.push([points[i - 1], points[i]]);
|
|
2017
|
-
return out;
|
|
2018
|
-
}
|
|
2019
|
-
function knifePath(path, fillRule, knife) {
|
|
2020
|
-
const pts = knife.filter((p) => Number.isFinite(p[0]) && Number.isFinite(p[1]));
|
|
2021
|
-
if (pts.length < 2) return null;
|
|
2022
|
-
let faces = facesOf(path, fillRule);
|
|
2023
|
-
if (!faces.length) return null;
|
|
2024
|
-
const b = _chunkXGD3FSNCcjs.bezierPathBounds.call(void 0, path);
|
|
2025
|
-
const size = b ? Math.max(b.maxX - b.minX, b.maxY - b.minY, 1) : 1;
|
|
2026
|
-
const eps = size * 1e-9;
|
|
2027
|
-
let cursor = -Infinity;
|
|
2028
|
-
let cuts = 0;
|
|
2029
|
-
for (let guard = 0; guard < 512; guard++) {
|
|
2030
|
-
let best = null;
|
|
2031
|
-
faces.forEach((face2, fi2) => {
|
|
2032
|
-
const hits = [];
|
|
2033
|
-
for (let m = 0; m < pts.length - 1; m++) {
|
|
2034
|
-
if (m + 1 < cursor - 1e-9) continue;
|
|
2035
|
-
const kb = { minX: Math.min(pts[m][0], pts[m + 1][0]), maxX: Math.max(pts[m][0], pts[m + 1][0]), minY: Math.min(pts[m][1], pts[m + 1][1]), maxY: Math.max(pts[m][1], pts[m + 1][1]) };
|
|
2036
|
-
face2.loops.forEach(
|
|
2037
|
-
(l, li) => l.segs.forEach((seg, si) => {
|
|
2038
|
-
const sb = _chunkXGD3FSNCcjs.segmentBounds.call(void 0, seg);
|
|
2039
|
-
if (sb.maxX < kb.minX - eps || sb.minX > kb.maxX + eps || sb.maxY < kb.minY - eps || sb.minY > kb.maxY + eps) return;
|
|
2040
|
-
for (const h of lineHits(pts[m], pts[m + 1], seg)) {
|
|
2041
|
-
const s = m + h.s;
|
|
2042
|
-
if (s >= cursor - 1e-9) hits.push({ s, loop: li, seg: si, t: h.t, point: h.point });
|
|
2043
|
-
}
|
|
2044
|
-
})
|
|
2045
|
-
);
|
|
2046
|
-
}
|
|
2047
|
-
hits.sort((x, y) => x.s - y.s);
|
|
2048
|
-
const unique = hits.filter((h, i) => i === 0 || h.s - hits[i - 1].s > 1e-9 || !near(h.point, hits[i - 1].point, eps * 10));
|
|
2049
|
-
const inside = (s) => {
|
|
2050
|
-
const m = Math.min(pts.length - 2, Math.floor(s));
|
|
2051
|
-
const u = s - m;
|
|
2052
|
-
const q = [pts[m][0] + (pts[m + 1][0] - pts[m][0]) * u, pts[m][1] + (pts[m + 1][1] - pts[m][1]) * u];
|
|
2053
|
-
return _chunkXGD3FSNCcjs.windingNumber.call(void 0, face2.loops.map((l) => l.segs), q) !== 0;
|
|
2054
|
-
};
|
|
2055
|
-
for (let i = 0; i < unique.length - 1; i++) {
|
|
2056
|
-
const from2 = unique[i];
|
|
2057
|
-
const to2 = unique[i + 1];
|
|
2058
|
-
if (near(from2.point, to2.point, eps * 10) || !inside((from2.s + to2.s) / 2)) continue;
|
|
2059
|
-
if (!best || from2.s < best.from.s) best = { face: fi2, from: from2, to: to2 };
|
|
2060
|
-
break;
|
|
2061
|
-
}
|
|
2062
|
-
});
|
|
2063
|
-
if (!best) break;
|
|
2064
|
-
const { face: fi, from, to } = best;
|
|
2065
|
-
const face = faces[fi];
|
|
2066
|
-
const corners2 = [from.point];
|
|
2067
|
-
for (let m = Math.floor(from.s) + 1; m <= to.s - 1e-12 && m < pts.length; m++) if (m > from.s) corners2.push(pts[m]);
|
|
2068
|
-
corners2.push(to.point);
|
|
2069
|
-
const forward = polySegs(corners2, eps);
|
|
2070
|
-
const back = polySegs(corners2.slice().reverse(), eps);
|
|
2071
|
-
const la = face.loops[from.loop];
|
|
2072
|
-
const loops = face.loops.filter((_, i) => i !== from.loop && i !== to.loop);
|
|
2073
|
-
if (from.loop === to.loop) {
|
|
2074
|
-
const ab = arc(la, from, to, eps);
|
|
2075
|
-
const ba = arc(la, to, from, eps);
|
|
2076
|
-
loops.push(
|
|
2077
|
-
{ segs: [...ab.segs, ...back], chord: [...ab.chord, ...back.map(() => true)] },
|
|
2078
|
-
{ segs: [...ba.segs, ...forward], chord: [...ba.chord, ...forward.map(() => true)] }
|
|
2079
|
-
);
|
|
2080
|
-
} else {
|
|
2081
|
-
const lb = face.loops[to.loop];
|
|
2082
|
-
const roundA = arc(la, from, from, eps);
|
|
2083
|
-
const roundB = arc(lb, to, to, eps);
|
|
2084
|
-
loops.push({
|
|
2085
|
-
segs: [...roundA.segs, ...forward, ...roundB.segs, ...back],
|
|
2086
|
-
chord: [...roundA.chord, ...forward.map(() => true), ...roundB.chord, ...back.map(() => true)]
|
|
2087
|
-
});
|
|
2088
|
-
}
|
|
2089
|
-
faces = [...faces.slice(0, fi), ...groupFaces(loops), ...faces.slice(fi + 1)];
|
|
2090
|
-
cursor = to.s;
|
|
2091
|
-
cuts++;
|
|
2092
|
-
}
|
|
2093
|
-
return cuts ? faces.map(faceToPath) : null;
|
|
2094
|
-
}
|
|
2095
|
-
function eraserRegion(points, width) {
|
|
2096
|
-
const pts = points.filter((p) => Number.isFinite(p[0]) && Number.isFinite(p[1]));
|
|
2097
|
-
const r = width / 2;
|
|
2098
|
-
if (!pts.length || !(r > 0)) return [];
|
|
2099
|
-
const moved = pts.some((p) => !near(p, pts[0], 1e-9));
|
|
2100
|
-
if (!moved) {
|
|
2101
|
-
const [cx, cy] = pts[0];
|
|
2102
|
-
const k = r * 0.5522847498307936;
|
|
2103
|
-
return [
|
|
2104
|
-
{ type: "M", x: cx, y: cy - r },
|
|
2105
|
-
{ type: "C", x1: cx + k, y1: cy - r, x2: cx + r, y2: cy - k, x: cx + r, y: cy },
|
|
2106
|
-
{ type: "C", x1: cx + r, y1: cy + k, x2: cx + k, y2: cy + r, x: cx, y: cy + r },
|
|
2107
|
-
{ type: "C", x1: cx - k, y1: cy + r, x2: cx - r, y2: cy + k, x: cx - r, y: cy },
|
|
2108
|
-
{ type: "C", x1: cx - r, y1: cy - k, x2: cx - k, y2: cy - r, x: cx, y: cy - r },
|
|
2109
|
-
{ type: "Z" }
|
|
2110
|
-
];
|
|
2111
|
-
}
|
|
2112
|
-
const line2 = [{ type: "M", x: pts[0][0], y: pts[0][1] }, ...pts.slice(1).map((p) => ({ type: "L", x: p[0], y: p[1] }))];
|
|
2113
|
-
return _chunkXGD3FSNCcjs.outlineStroke.call(void 0, line2, { width, cap: "round", join: "round" });
|
|
2114
|
-
}
|
|
2115
|
-
function eraseFromFill(path, fillRule, region) {
|
|
2116
|
-
const overlap = _chunkXGD3FSNCcjs.pathBoolean.call(void 0, "intersection", [{ path, fillRule }, { path: region }]).path;
|
|
2117
|
-
if (!_chunkXGD3FSNCcjs.pathToContours.call(void 0, overlap).some((c) => Math.abs(_chunkXGD3FSNCcjs.contourSignedArea.call(void 0, _chunkXGD3FSNCcjs.closeContour.call(void 0, c, true))) > 1e-9)) return null;
|
|
2118
|
-
const rest = _chunkXGD3FSNCcjs.pathBoolean.call(void 0, "difference", [{ path, fillRule }, { path: region }]).path;
|
|
2119
|
-
return splitIntoFaces(rest);
|
|
2120
|
-
}
|
|
2121
|
-
function eraseFromOutline(sp, region) {
|
|
2122
|
-
const regionSegs = _chunkXGD3FSNCcjs.pathToContours.call(void 0, region).flatMap((c) => _chunkXGD3FSNCcjs.closeContour.call(void 0, c, true));
|
|
2123
|
-
if (!regionSegs.length) return null;
|
|
2124
|
-
const rb = _chunkXGD3FSNCcjs.bezierPathBounds.call(void 0, region);
|
|
2125
|
-
const count = _chunkKANRAHTLcjs.subpathSegmentCount.call(void 0, sp);
|
|
2126
|
-
if (!rb || count === 0) return null;
|
|
2127
|
-
const removed = (p) => _chunkXGD3FSNCcjs.pointInBezierPath.call(void 0, region, p, "nonzero");
|
|
2128
|
-
const runs = [];
|
|
2129
|
-
let cur = [];
|
|
2130
|
-
let any = false;
|
|
2131
|
-
for (let i = 0; i < count; i++) {
|
|
2132
|
-
const seg = _chunkKANRAHTLcjs.subpathSegment.call(void 0, sp, i);
|
|
2133
|
-
const sb = _chunkXGD3FSNCcjs.segmentBounds.call(void 0, seg);
|
|
2134
|
-
const ts = [0, 1];
|
|
2135
|
-
if (!(sb.maxX < rb.minX || sb.minX > rb.maxX || sb.maxY < rb.minY || sb.minY > rb.maxY)) {
|
|
2136
|
-
for (const r of regionSegs) {
|
|
2137
|
-
const b = _chunkXGD3FSNCcjs.segmentBounds.call(void 0, r);
|
|
2138
|
-
if (b.maxX < sb.minX || b.minX > sb.maxX || b.maxY < sb.minY || b.minY > sb.maxY) continue;
|
|
2139
|
-
for (const hit of _chunkXGD3FSNCcjs.segmentIntersections.call(void 0, seg, r)) if (hit.ta > 1e-9 && hit.ta < 1 - 1e-9) ts.push(hit.ta);
|
|
2140
|
-
}
|
|
2141
|
-
}
|
|
2142
|
-
ts.sort((a, b) => a - b);
|
|
2143
|
-
for (let k = 0; k < ts.length - 1; k++) {
|
|
2144
|
-
const t0 = ts[k];
|
|
2145
|
-
const t1 = ts[k + 1];
|
|
2146
|
-
if (t1 - t0 < 1e-9) continue;
|
|
2147
|
-
if (removed(_chunkXGD3FSNCcjs.segmentPoint.call(void 0, seg, (t0 + t1) / 2))) {
|
|
2148
|
-
any = true;
|
|
2149
|
-
if (cur.length) runs.push(cur);
|
|
2150
|
-
cur = [];
|
|
2151
|
-
} else cur.push({ seg: i, t0, t1 });
|
|
2152
|
-
}
|
|
2153
|
-
}
|
|
2154
|
-
if (cur.length) runs.push(cur);
|
|
2155
|
-
if (!any) return null;
|
|
2156
|
-
if (sp.closed && runs.length >= 2) {
|
|
2157
|
-
const first = runs[0][0];
|
|
2158
|
-
const lastRun = runs[runs.length - 1];
|
|
2159
|
-
const last = lastRun[lastRun.length - 1];
|
|
2160
|
-
if (first.seg === 0 && first.t0 === 0 && last.seg === count - 1 && last.t1 === 1) lastRun.push(...runs.shift());
|
|
2161
|
-
}
|
|
2162
|
-
const out = [];
|
|
2163
|
-
for (const run of runs) {
|
|
2164
|
-
const anchors = [];
|
|
2165
|
-
for (const { seg, t0, t1 } of run) {
|
|
2166
|
-
const c = _chunkXGD3FSNCcjs.subSegment.call(void 0, _chunkKANRAHTLcjs.subpathSegment.call(void 0, sp, seg), t0, t1);
|
|
2167
|
-
const line2 = c.length === 2;
|
|
2168
|
-
const start = c[0];
|
|
2169
|
-
const end = c[c.length - 1];
|
|
2170
|
-
if (!anchors.length) anchors.push({ x: start[0], y: start[1] });
|
|
2171
|
-
if (!line2) anchors[anchors.length - 1].out = { x: c[1][0], y: c[1][1] };
|
|
2172
|
-
const next = { x: end[0], y: end[1] };
|
|
2173
|
-
if (!line2) next.in = { x: c[2][0], y: c[2][1] };
|
|
2174
|
-
anchors.push(next);
|
|
2175
|
-
}
|
|
2176
|
-
if (anchors.length < 2) continue;
|
|
2177
|
-
for (const a of anchors) {
|
|
2178
|
-
const type = _chunkKANRAHTLcjs.inferAnchorType.call(void 0, a);
|
|
2179
|
-
if (type !== "corner") a.type = type;
|
|
2180
|
-
}
|
|
2181
|
-
out.push({ anchors, closed: false });
|
|
2182
|
-
}
|
|
2183
|
-
return out;
|
|
2184
|
-
}
|
|
2185
|
-
function polylineBounds(points, pad = 0) {
|
|
2186
|
-
if (!points.length) return null;
|
|
2187
|
-
let minX = Infinity;
|
|
2188
|
-
let minY = Infinity;
|
|
2189
|
-
let maxX = -Infinity;
|
|
2190
|
-
let maxY = -Infinity;
|
|
2191
|
-
for (const [x, y] of points) {
|
|
2192
|
-
minX = Math.min(minX, x);
|
|
2193
|
-
minY = Math.min(minY, y);
|
|
2194
|
-
maxX = Math.max(maxX, x);
|
|
2195
|
-
maxY = Math.max(maxY, y);
|
|
2196
|
-
}
|
|
2197
|
-
return { x: minX - pad, y: minY - pad, width: maxX - minX + 2 * pad, height: maxY - minY + 2 * pad };
|
|
2198
|
-
}
|
|
2199
|
-
function simplifyPolyline(points, tolerance) {
|
|
2200
|
-
const n = points.length;
|
|
2201
|
-
if (n < 3) return points.slice();
|
|
2202
|
-
const keep = new Array(n).fill(false);
|
|
2203
|
-
keep[0] = keep[n - 1] = true;
|
|
2204
|
-
const stack = [[0, n - 1]];
|
|
2205
|
-
while (stack.length) {
|
|
2206
|
-
const [a, b] = stack.pop();
|
|
2207
|
-
const [ax, ay] = points[a];
|
|
2208
|
-
const dx = points[b][0] - ax;
|
|
2209
|
-
const dy = points[b][1] - ay;
|
|
2210
|
-
const len = Math.hypot(dx, dy);
|
|
2211
|
-
let far = -1;
|
|
2212
|
-
let farD = 0;
|
|
2213
|
-
for (let i = a + 1; i < b; i++) {
|
|
2214
|
-
const [px, py] = points[i];
|
|
2215
|
-
const d = len < 1e-12 ? Math.hypot(px - ax, py - ay) : Math.abs((px - ax) * dy - (py - ay) * dx) / len;
|
|
2216
|
-
if (d > farD) {
|
|
2217
|
-
farD = d;
|
|
2218
|
-
far = i;
|
|
2219
|
-
}
|
|
2220
|
-
}
|
|
2221
|
-
if (far >= 0 && farD > tolerance) {
|
|
2222
|
-
keep[far] = true;
|
|
2223
|
-
stack.push([a, far], [far, b]);
|
|
2224
|
-
}
|
|
2225
|
-
}
|
|
2226
|
-
return points.filter((_, i) => keep[i]);
|
|
1910
|
+
return _nullishCoalesce(segsToSubpath(segs, sp.closed, types), () => ( { anchors: sp.anchors.map(_chunkUTEVPQTScjs.cloneAnchor), closed: sp.closed }));
|
|
2227
1911
|
}
|
|
2228
1912
|
|
|
2229
1913
|
// src/vector/ink.ts
|
|
@@ -2457,10 +2141,10 @@ function vectorPathEntries(doc, roots, options = {}) {
|
|
|
2457
2141
|
const out = [];
|
|
2458
2142
|
const visit = (stored, parent, inside) => {
|
|
2459
2143
|
if (stored.visible === false || stored.locked && !options.locked) return;
|
|
2460
|
-
const node = options.expand === false ? stored :
|
|
2144
|
+
const node = options.expand === false ? stored : _chunkUTEVPQTScjs.expandVectorAppearance.call(void 0, _chunkUTEVPQTScjs.vectorMaskedGeometry.call(void 0, stored));
|
|
2461
2145
|
const picked = inside || roots === null || roots.includes(node.id);
|
|
2462
2146
|
if (node.type === "group") {
|
|
2463
|
-
const m = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0,
|
|
2147
|
+
const m = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, _chunkUTEVPQTScjs.nodeMatrix.call(void 0, node), parent);
|
|
2464
2148
|
for (const c of node.children) visit(c, m, picked);
|
|
2465
2149
|
} else if (picked) out.push({ node, parent });
|
|
2466
2150
|
};
|
|
@@ -2469,10 +2153,10 @@ function vectorPathEntries(doc, roots, options = {}) {
|
|
|
2469
2153
|
}
|
|
2470
2154
|
var usable = (sp) => sp.anchors.length > 1;
|
|
2471
2155
|
function worldOf(entry, subpaths) {
|
|
2472
|
-
return
|
|
2156
|
+
return _chunkUTEVPQTScjs.vectorPathWorldBezier.call(void 0, { ...entry.node, subpaths }, entry.parent);
|
|
2473
2157
|
}
|
|
2474
2158
|
function subpathEnclosesArea(sp) {
|
|
2475
|
-
const contour = _chunkXGD3FSNCcjs.pathToContours.call(void 0,
|
|
2159
|
+
const contour = _chunkXGD3FSNCcjs.pathToContours.call(void 0, _chunkUTEVPQTScjs.subpathsToBezier.call(void 0, [{ ...sp, closed: true }]))[0];
|
|
2476
2160
|
if (!contour) return false;
|
|
2477
2161
|
const segs = _chunkXGD3FSNCcjs.closeContour.call(void 0, contour, true);
|
|
2478
2162
|
const b = _chunkXGD3FSNCcjs.bezierPathBounds.call(void 0, _chunkXGD3FSNCcjs.contoursToPath.call(void 0, [{ segments: segs, closed: true }]));
|
|
@@ -2487,11 +2171,11 @@ function vectorPathfinderShape(entry, op) {
|
|
|
2487
2171
|
const subpaths = node.subpaths.filter(usable);
|
|
2488
2172
|
const closed = subpaths.map((s) => ({ ...s, closed: true }));
|
|
2489
2173
|
const fillRule = _nullishCoalesce(node.fillRule, () => ( "nonzero"));
|
|
2490
|
-
if (
|
|
2174
|
+
if (_chunkUTEVPQTScjs.hasPaint.call(void 0, node.fill)) return { path: worldOf(entry, closed), fillRule, key: `fill:${paintKey(node.fill)}`, paint: "fill" };
|
|
2491
2175
|
const open = subpaths.length > 0 && subpaths.every((s) => !s.closed);
|
|
2492
2176
|
if (op === "divide" && open) return { path: worldOf(entry, subpaths), line: true, paint: "line" };
|
|
2493
|
-
if (
|
|
2494
|
-
const path =
|
|
2177
|
+
if (_chunkUTEVPQTScjs.hasPaint.call(void 0, node.stroke) && (_nullishCoalesce(node.strokeWidth, () => ( 1))) > 0) {
|
|
2178
|
+
const path = _chunkUTEVPQTScjs.vectorStrokeOutline.call(void 0, { ...node, subpaths }, entry.parent);
|
|
2495
2179
|
return { path, fillRule: "nonzero", key: `fill:${paintKey(node.stroke)}`, paint: "stroke" };
|
|
2496
2180
|
}
|
|
2497
2181
|
return { path: worldOf(entry, closed), fillRule, key: "none", paint: "outline" };
|
|
@@ -2515,7 +2199,7 @@ function vectorResultStyle(node, paint, edge = false) {
|
|
|
2515
2199
|
const base = { ...rest, fillRule: "nonzero" };
|
|
2516
2200
|
if (edge) {
|
|
2517
2201
|
for (const k of STROKE_KEYS) delete base[k];
|
|
2518
|
-
const stroke = paint === "stroke" || !
|
|
2202
|
+
const stroke = paint === "stroke" || !_chunkUTEVPQTScjs.hasPaint.call(void 0, node.fill) ? node.stroke : node.fill;
|
|
2519
2203
|
return { ...base, fill: null, stroke: _nullishCoalesce(stroke, () => ( "#000000")), strokeWidth: _nullishCoalesce(node.strokeWidth, () => ( 1)) };
|
|
2520
2204
|
}
|
|
2521
2205
|
if (paint === "stroke") {
|
|
@@ -2527,7 +2211,7 @@ function vectorResultStyle(node, paint, edge = false) {
|
|
|
2527
2211
|
function vectorShapeBuilderMap(entries) {
|
|
2528
2212
|
const lines = [];
|
|
2529
2213
|
const inputs = entries.map((entry) => {
|
|
2530
|
-
const filled =
|
|
2214
|
+
const filled = _chunkUTEVPQTScjs.hasPaint.call(void 0, entry.node.fill);
|
|
2531
2215
|
const subpaths = entry.node.subpaths.filter(usable).map((sp) => !sp.closed && filled && subpathEnclosesArea(sp) ? { ...sp, closed: true } : sp);
|
|
2532
2216
|
lines.push(!subpaths.some((s) => s.closed));
|
|
2533
2217
|
return { path: worldOf(entry, subpaths), fillRule: _nullishCoalesce(entry.node.fillRule, () => ( "nonzero")) };
|
|
@@ -2632,7 +2316,7 @@ function planShapeBuilder(m, touched, erase) {
|
|
|
2632
2316
|
const kept = faces.flatMap((_, f) => sourcesOf[f].includes(i) && !picked.has(f) ? [f] : []);
|
|
2633
2317
|
rest = kept.length ? m.map.merge(kept) : [];
|
|
2634
2318
|
} else rest = worldOf(entry, entry.node.subpaths.filter(usable));
|
|
2635
|
-
const fillCloses =
|
|
2319
|
+
const fillCloses = _chunkUTEVPQTScjs.hasPaint.call(void 0, entry.node.fill);
|
|
2636
2320
|
let cut = false;
|
|
2637
2321
|
for (const piece of cuts) {
|
|
2638
2322
|
const r = rest.length ? _chunkJEYDXRWQcjs.cutOutPiece.call(void 0, rest, piece, fillCloses, m.tolerance) : null;
|
|
@@ -2723,18 +2407,18 @@ function getEditablePathIds(state) {
|
|
|
2723
2407
|
if (state.tool === "direct") {
|
|
2724
2408
|
if (state.editingId) ids.add(state.editingId);
|
|
2725
2409
|
for (const id of state.selection) {
|
|
2726
|
-
const node =
|
|
2410
|
+
const node = _chunkUTEVPQTScjs.findVectorNode.call(void 0, state.document.nodes, id);
|
|
2727
2411
|
if (node && !node.locked) {
|
|
2728
|
-
for (const p of
|
|
2412
|
+
for (const p of _chunkUTEVPQTScjs.collectPathNodes.call(void 0, node)) if (!p.locked) ids.add(p.id);
|
|
2729
2413
|
}
|
|
2730
2414
|
}
|
|
2731
2415
|
}
|
|
2732
|
-
return [...ids].filter((id) => _optionalChain([
|
|
2416
|
+
return [...ids].filter((id) => _optionalChain([_chunkUTEVPQTScjs.findVectorNode.call(void 0, state.document.nodes, id), 'optionalAccess', _38 => _38.type]) === "path");
|
|
2733
2417
|
}
|
|
2734
2418
|
function getVisibleAnchors(state) {
|
|
2735
2419
|
const out = [];
|
|
2736
2420
|
for (const id of getEditablePathIds(state)) {
|
|
2737
|
-
const node =
|
|
2421
|
+
const node = _chunkUTEVPQTScjs.findVectorNode.call(void 0, state.document.nodes, id);
|
|
2738
2422
|
node.subpaths.forEach((sp, s) => sp.anchors.forEach((_, i) => out.push({ nodeId: id, subpath: s, index: i })));
|
|
2739
2423
|
}
|
|
2740
2424
|
return out;
|
|
@@ -2752,7 +2436,7 @@ function getVisibleHandles(state) {
|
|
|
2752
2436
|
out.push({ nodeId: node.id, subpath: s, index: i, handle });
|
|
2753
2437
|
};
|
|
2754
2438
|
if (state.tool === "pen" && state.pen) {
|
|
2755
|
-
const node =
|
|
2439
|
+
const node = _chunkUTEVPQTScjs.findVectorNode.call(void 0, state.document.nodes, state.pen.nodeId);
|
|
2756
2440
|
const sp = _optionalChain([node, 'optionalAccess', _41 => _41.type]) === "path" ? node.subpaths[state.pen.subpath] : void 0;
|
|
2757
2441
|
if (_optionalChain([node, 'optionalAccess', _42 => _42.type]) === "path" && sp) {
|
|
2758
2442
|
const last = sp.anchors.length - 1;
|
|
@@ -2765,7 +2449,7 @@ function getVisibleHandles(state) {
|
|
|
2765
2449
|
const editable = new Set(getEditablePathIds(state));
|
|
2766
2450
|
for (const ref of state.selectedAnchors) {
|
|
2767
2451
|
if (!editable.has(ref.nodeId)) continue;
|
|
2768
|
-
const node =
|
|
2452
|
+
const node = _chunkUTEVPQTScjs.findVectorNode.call(void 0, state.document.nodes, ref.nodeId);
|
|
2769
2453
|
const sp = node.subpaths[ref.subpath];
|
|
2770
2454
|
if (!sp) continue;
|
|
2771
2455
|
const n = sp.anchors.length;
|
|
@@ -2784,26 +2468,26 @@ function getVectorCornerWidgets(state) {
|
|
|
2784
2468
|
const zoom = state.viewport.zoom;
|
|
2785
2469
|
const out = [];
|
|
2786
2470
|
for (const id of getEditablePathIds(state)) {
|
|
2787
|
-
const node =
|
|
2471
|
+
const node = _chunkUTEVPQTScjs.findVectorNode.call(void 0, state.document.nodes, id);
|
|
2788
2472
|
const picked = state.selectedAnchors.filter((r) => r.nodeId === id);
|
|
2789
|
-
const m = _nullishCoalesce(
|
|
2790
|
-
for (const c of
|
|
2473
|
+
const m = _nullishCoalesce(_chunkUTEVPQTScjs.vectorWorldMatrix.call(void 0, state.document.nodes, id), () => ( _chunkDWGZUSEScjs.IDENTITY_MATRIX));
|
|
2474
|
+
for (const c of _chunkUTEVPQTScjs.vectorCorners.call(void 0, node.subpaths)) {
|
|
2791
2475
|
if (picked.length && !picked.some((r) => r.subpath === c.subpath && r.index === c.index)) continue;
|
|
2792
2476
|
const side = Math.min(c.lu, c.lv);
|
|
2793
2477
|
if (side * zoom < 3 * VECTOR_CORNER_WIDGET_INSET) continue;
|
|
2794
2478
|
const a = node.subpaths[c.subpath].anchors[c.index];
|
|
2795
2479
|
const radius = _nullishCoalesce(_optionalChain([a, 'access', _43 => _43.corner, 'optionalAccess', _44 => _44.radius]), () => ( 0));
|
|
2796
|
-
const drawn =
|
|
2480
|
+
const drawn = _chunkUTEVPQTScjs.fitCornerRadius.call(void 0, c, radius);
|
|
2797
2481
|
const k = Math.min(Math.max(drawn / c.sin, VECTOR_CORNER_WIDGET_INSET / (zoom * Math.sqrt(1 + c.cos))), side / 2);
|
|
2798
|
-
const p = _chunkDWGZUSEScjs.applyMatrix.call(void 0, m,
|
|
2482
|
+
const p = _chunkDWGZUSEScjs.applyMatrix.call(void 0, m, _chunkUTEVPQTScjs.cornerBisectorPoint.call(void 0, c, k));
|
|
2799
2483
|
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 });
|
|
2800
2484
|
}
|
|
2801
2485
|
}
|
|
2802
2486
|
return out;
|
|
2803
2487
|
}
|
|
2804
2488
|
function vectorStrokeWidthGeometry(node) {
|
|
2805
|
-
if (!
|
|
2806
|
-
const parts =
|
|
2489
|
+
if (!_chunkUTEVPQTScjs.hasPaint.call(void 0, node.stroke) || !((_nullishCoalesce(node.strokeWidth, () => ( 1))) > 0)) return null;
|
|
2490
|
+
const parts = _chunkUTEVPQTScjs.vectorStrokeParts.call(void 0, _chunkUTEVPQTScjs.subpathsToBezier.call(void 0, node.subpaths), node);
|
|
2807
2491
|
return parts.line.length ? { line: parts.line, unit: parts.drawWidth / 2 } : null;
|
|
2808
2492
|
}
|
|
2809
2493
|
function shiftWidthPoints(profile, indices, dt) {
|
|
@@ -2816,24 +2500,24 @@ function getVectorWidthHandles(state) {
|
|
|
2816
2500
|
if (state.tool !== "width") return [];
|
|
2817
2501
|
const ids = /* @__PURE__ */ new Set();
|
|
2818
2502
|
for (const id of state.selection) {
|
|
2819
|
-
const n =
|
|
2820
|
-
if (n) for (const p of
|
|
2503
|
+
const n = _chunkUTEVPQTScjs.findVectorNode.call(void 0, state.document.nodes, id);
|
|
2504
|
+
if (n) for (const p of _chunkUTEVPQTScjs.collectPathNodes.call(void 0, n)) ids.add(p.id);
|
|
2821
2505
|
}
|
|
2822
2506
|
if (_optionalChain([state, 'access', _47 => _47.hover, 'optionalAccess', _48 => _48.nodeId])) ids.add(state.hover.nodeId);
|
|
2823
2507
|
if (_optionalChain([state, 'access', _49 => _49.interaction, 'optionalAccess', _50 => _50.type]) === "width") ids.add(state.interaction.ref.nodeId);
|
|
2824
2508
|
for (const r of state.selectedWidthPoints) ids.add(r.nodeId);
|
|
2825
2509
|
const out = [];
|
|
2826
2510
|
for (const id of ids) {
|
|
2827
|
-
const node =
|
|
2511
|
+
const node = _chunkUTEVPQTScjs.findVectorNode.call(void 0, state.document.nodes, id);
|
|
2828
2512
|
if (_optionalChain([node, 'optionalAccess', _51 => _51.type]) !== "path" || node.visible === false || !_optionalChain([node, 'access', _52 => _52.strokeWidthProfile, 'optionalAccess', _53 => _53.length])) continue;
|
|
2829
2513
|
const g = vectorStrokeWidthGeometry(node);
|
|
2830
2514
|
if (!g) continue;
|
|
2831
|
-
const profile =
|
|
2832
|
-
const m = _nullishCoalesce(
|
|
2515
|
+
const profile = _chunkUTEVPQTScjs.sanitizeWidthProfile.call(void 0, node.strokeWidthProfile);
|
|
2516
|
+
const m = _nullishCoalesce(_chunkUTEVPQTScjs.vectorWorldMatrix.call(void 0, state.document.nodes, id), () => ( _chunkDWGZUSEScjs.IDENTITY_MATRIX));
|
|
2833
2517
|
const contours = node.subpaths.length;
|
|
2834
2518
|
for (let sp = 0; sp < contours; sp++) {
|
|
2835
2519
|
profile.forEach((w, index) => {
|
|
2836
|
-
const at =
|
|
2520
|
+
const at = _chunkUTEVPQTScjs.strokePositionPoint.call(void 0, g.line, sp, w.t);
|
|
2837
2521
|
if (!at) return;
|
|
2838
2522
|
const n = { x: at.tangent[1], y: -at.tangent[0] };
|
|
2839
2523
|
const c = { x: at.point[0], y: at.point[1] };
|
|
@@ -2857,24 +2541,24 @@ function getVectorWidthHandles(state) {
|
|
|
2857
2541
|
return out;
|
|
2858
2542
|
}
|
|
2859
2543
|
function getAnchor(doc, ref) {
|
|
2860
|
-
const node =
|
|
2544
|
+
const node = _chunkUTEVPQTScjs.findVectorNode.call(void 0, doc.nodes, ref.nodeId);
|
|
2861
2545
|
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;
|
|
2862
2546
|
}
|
|
2863
2547
|
function getAnchorWorld(doc, ref) {
|
|
2864
2548
|
const a = getAnchor(doc, ref);
|
|
2865
2549
|
if (!a) return void 0;
|
|
2866
|
-
const m = _nullishCoalesce(
|
|
2550
|
+
const m = _nullishCoalesce(_chunkUTEVPQTScjs.vectorWorldMatrix.call(void 0, doc.nodes, ref.nodeId), () => ( _chunkDWGZUSEScjs.IDENTITY_MATRIX));
|
|
2867
2551
|
const p = _chunkDWGZUSEScjs.applyMatrix.call(void 0, m, a);
|
|
2868
2552
|
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 } : {} };
|
|
2869
2553
|
}
|
|
2870
2554
|
function getVectorSelectionFrame(doc, ids) {
|
|
2871
|
-
const nodes = ids.map((id) => ({ node:
|
|
2555
|
+
const nodes = ids.map((id) => ({ node: _chunkUTEVPQTScjs.findVectorNode.call(void 0, doc.nodes, id), parent: _nullishCoalesce(_chunkUTEVPQTScjs.vectorParentMatrix.call(void 0, doc.nodes, id), () => ( _chunkDWGZUSEScjs.IDENTITY_MATRIX)) })).filter((n) => n.node);
|
|
2872
2556
|
if (!nodes.length) return null;
|
|
2873
|
-
const angles = nodes.map((n) => _chunkDWGZUSEScjs.matrixRotation.call(void 0, _chunkDWGZUSEScjs.multiplyMatrices.call(void 0,
|
|
2557
|
+
const angles = nodes.map((n) => _chunkDWGZUSEScjs.matrixRotation.call(void 0, _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, _chunkUTEVPQTScjs.nodeMatrix.call(void 0, n.node), n.parent)));
|
|
2874
2558
|
const same = angles.every((a) => Math.abs(normalizeAngle(a - angles[0])) < 1e-6);
|
|
2875
2559
|
const angle = same ? angles[0] : 0;
|
|
2876
2560
|
const unrotate = _chunkDWGZUSEScjs.rotateMatrix.call(void 0, -angle);
|
|
2877
|
-
const b =
|
|
2561
|
+
const b = _chunkUTEVPQTScjs.unionBounds.call(void 0, nodes.map((n) => _chunkUTEVPQTScjs.vectorNodeBounds.call(void 0, n.node, _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, n.parent, unrotate))));
|
|
2878
2562
|
return b ? { ...b, angle } : null;
|
|
2879
2563
|
}
|
|
2880
2564
|
var normalizeAngle = (a) => ((a + 180) % 360 + 360) % 360 - 180;
|
|
@@ -2909,10 +2593,10 @@ function getVectorSelectionBoxGeometry(frame, viewport) {
|
|
|
2909
2593
|
}
|
|
2910
2594
|
function getVectorEnvelopeTarget(doc, selection) {
|
|
2911
2595
|
if (selection.length !== 1) return null;
|
|
2912
|
-
const node =
|
|
2913
|
-
if (!node || !
|
|
2914
|
-
const frame =
|
|
2915
|
-
return frame ? { node, frame, world: _nullishCoalesce(
|
|
2596
|
+
const node = _chunkUTEVPQTScjs.findVectorNode.call(void 0, doc.nodes, selection[0]);
|
|
2597
|
+
if (!node || !_chunkUTEVPQTScjs.vectorNodeEnvelope.call(void 0, node)) return null;
|
|
2598
|
+
const frame = _chunkUTEVPQTScjs.vectorEnvelopeFrame.call(void 0, node);
|
|
2599
|
+
return frame ? { node, frame, world: _nullishCoalesce(_chunkUTEVPQTScjs.vectorWorldMatrix.call(void 0, doc.nodes, node.id), () => ( _chunkDWGZUSEScjs.IDENTITY_MATRIX)) } : null;
|
|
2916
2600
|
}
|
|
2917
2601
|
var RESIZE_CURSOR_ORDER = ["ew-resize", "nwse-resize", "ns-resize", "nesw-resize"];
|
|
2918
2602
|
var HANDLE_ANGLES = { e: 0, se: 45, s: 90, sw: 135, w: 180, nw: 225, n: 270, ne: 315 };
|
|
@@ -3023,7 +2707,7 @@ var VECTOR_PATHFINDER_LABELS = {
|
|
|
3023
2707
|
function normalizeVectorTree(nodes, prefer) {
|
|
3024
2708
|
let changed = false;
|
|
3025
2709
|
const out = nodes.map((n) => {
|
|
3026
|
-
let next = n.type === "path" ?
|
|
2710
|
+
let next = n.type === "path" ? _chunkUTEVPQTScjs.normalizeVectorPaintStacks.call(void 0, n, prefer) : n;
|
|
3027
2711
|
if (next.type === "group") {
|
|
3028
2712
|
const children = normalizeVectorTree(next.children, prefer);
|
|
3029
2713
|
if (children !== next.children) next = { ...next, children };
|
|
@@ -3034,7 +2718,7 @@ function normalizeVectorTree(nodes, prefer) {
|
|
|
3034
2718
|
return changed ? out : nodes;
|
|
3035
2719
|
}
|
|
3036
2720
|
function loadedDocument(doc) {
|
|
3037
|
-
const copy =
|
|
2721
|
+
const copy = _chunkUTEVPQTScjs.cloneVectorDocument.call(void 0, doc);
|
|
3038
2722
|
const nodes = normalizeVectorTree(copy.nodes, "stack");
|
|
3039
2723
|
return nodes === copy.nodes ? copy : { ...copy, nodes };
|
|
3040
2724
|
}
|
|
@@ -3185,7 +2869,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
3185
2869
|
return this.doc;
|
|
3186
2870
|
}
|
|
3187
2871
|
getNode(id) {
|
|
3188
|
-
return
|
|
2872
|
+
return _chunkUTEVPQTScjs.findVectorNode.call(void 0, this.doc.nodes, id);
|
|
3189
2873
|
}
|
|
3190
2874
|
computeState() {
|
|
3191
2875
|
const h = this.history.getState();
|
|
@@ -3244,10 +2928,10 @@ var VectorEditorController = (_class3 = class {
|
|
|
3244
2928
|
});
|
|
3245
2929
|
}
|
|
3246
2930
|
boundsOf(ids) {
|
|
3247
|
-
return
|
|
2931
|
+
return _chunkUTEVPQTScjs.unionBounds.call(void 0,
|
|
3248
2932
|
ids.map((id) => {
|
|
3249
2933
|
const n = this.getNode(id);
|
|
3250
|
-
return n ?
|
|
2934
|
+
return n ? _chunkUTEVPQTScjs.vectorNodeBounds.call(void 0, n, _nullishCoalesce(_chunkUTEVPQTScjs.vectorParentMatrix.call(void 0, this.doc.nodes, id), () => ( _chunkDWGZUSEScjs.IDENTITY_MATRIX))) : null;
|
|
3251
2935
|
})
|
|
3252
2936
|
);
|
|
3253
2937
|
}
|
|
@@ -3256,7 +2940,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
3256
2940
|
}
|
|
3257
2941
|
/** Local → document matrix of a node in `doc` (default: the current document). */
|
|
3258
2942
|
worldOf(id, doc = this.doc) {
|
|
3259
|
-
return _nullishCoalesce(
|
|
2943
|
+
return _nullishCoalesce(_chunkUTEVPQTScjs.vectorWorldMatrix.call(void 0, doc.nodes, id), () => ( _chunkDWGZUSEScjs.IDENTITY_MATRIX));
|
|
3260
2944
|
}
|
|
3261
2945
|
/** A document point in node `id`'s own space. */
|
|
3262
2946
|
toLocal(id, p, doc = this.doc) {
|
|
@@ -3373,9 +3057,9 @@ var VectorEditorController = (_class3 = class {
|
|
|
3373
3057
|
this.setDoc(mapTree(this.doc.nodes, (n) => n.id === id ? next : n));
|
|
3374
3058
|
}
|
|
3375
3059
|
freshIds(node) {
|
|
3376
|
-
const copy =
|
|
3060
|
+
const copy = _chunkUTEVPQTScjs.cloneVectorNode.call(void 0, node);
|
|
3377
3061
|
const used = /* @__PURE__ */ new Set();
|
|
3378
|
-
|
|
3062
|
+
_chunkUTEVPQTScjs.walkVectorNodes.call(void 0, this.doc.nodes, (n) => used.add(n.id));
|
|
3379
3063
|
const next = () => {
|
|
3380
3064
|
let id = this.createId();
|
|
3381
3065
|
while (used.has(id)) id = this.createId();
|
|
@@ -3571,7 +3255,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
3571
3255
|
/** Replaces the document with parsed SVG markup (one undo step). */
|
|
3572
3256
|
loadSvg(svg, options = {}) {
|
|
3573
3257
|
try {
|
|
3574
|
-
const doc =
|
|
3258
|
+
const doc = _chunkUTEVPQTScjs.parseVectorSvg.call(void 0, svg, { createId: () => this.createId() });
|
|
3575
3259
|
this.setDocument(doc, { history: options.history, label: "Import SVG" });
|
|
3576
3260
|
return { ok: true };
|
|
3577
3261
|
} catch (error) {
|
|
@@ -3581,7 +3265,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
3581
3265
|
/** Adds the nodes of SVG markup on top of the document, selected. */
|
|
3582
3266
|
importSvg(svg) {
|
|
3583
3267
|
try {
|
|
3584
|
-
const parsed =
|
|
3268
|
+
const parsed = _chunkUTEVPQTScjs.parseVectorSvg.call(void 0, svg);
|
|
3585
3269
|
const nodes = parsed.nodes.map((n) => this.freshIds(n));
|
|
3586
3270
|
if (!nodes.length) return { ok: false, message: "The SVG has no shapes the editor can read." };
|
|
3587
3271
|
this.change("Import SVG", () => {
|
|
@@ -3595,21 +3279,21 @@ var VectorEditorController = (_class3 = class {
|
|
|
3595
3279
|
}
|
|
3596
3280
|
}
|
|
3597
3281
|
toSvg(options) {
|
|
3598
|
-
return
|
|
3282
|
+
return _chunkUTEVPQTScjs.vectorDocumentToSvg.call(void 0, this.doc, options);
|
|
3599
3283
|
}
|
|
3600
3284
|
toJSON() {
|
|
3601
|
-
return
|
|
3285
|
+
return _chunkUTEVPQTScjs.cloneVectorDocument.call(void 0, this.doc);
|
|
3602
3286
|
}
|
|
3603
3287
|
/** Adds a node (ids are kept unless taken). Returns its id. */
|
|
3604
3288
|
addNode(node, options = {}) {
|
|
3605
3289
|
const taken = (() => {
|
|
3606
3290
|
let clash = false;
|
|
3607
|
-
|
|
3291
|
+
_chunkUTEVPQTScjs.walkVectorNodes.call(void 0, [node], (n) => {
|
|
3608
3292
|
if (this.getNode(n.id)) clash = true;
|
|
3609
3293
|
});
|
|
3610
3294
|
return clash;
|
|
3611
3295
|
})();
|
|
3612
|
-
const next = taken ? this.freshIds(node) :
|
|
3296
|
+
const next = taken ? this.freshIds(node) : _chunkUTEVPQTScjs.cloneVectorNode.call(void 0, node);
|
|
3613
3297
|
this.change(_nullishCoalesce(options.label, () => ( `Add ${next.type === "group" ? "Group" : _nullishCoalesce(next.name, () => ( "Path"))}`)), () => {
|
|
3614
3298
|
const insert = (list) => {
|
|
3615
3299
|
const copy = list.slice();
|
|
@@ -3633,24 +3317,24 @@ var VectorEditorController = (_class3 = class {
|
|
|
3633
3317
|
let subpath;
|
|
3634
3318
|
switch (input.kind) {
|
|
3635
3319
|
case "rect":
|
|
3636
|
-
subpath =
|
|
3320
|
+
subpath = _chunkUTEVPQTScjs.rectSubpath.call(void 0, b);
|
|
3637
3321
|
break;
|
|
3638
3322
|
case "ellipse":
|
|
3639
|
-
subpath =
|
|
3323
|
+
subpath = _chunkUTEVPQTScjs.ellipseSubpath.call(void 0, b);
|
|
3640
3324
|
break;
|
|
3641
3325
|
case "polygon":
|
|
3642
|
-
subpath =
|
|
3326
|
+
subpath = _chunkUTEVPQTScjs.polygonSubpath.call(void 0, b, _nullishCoalesce(input.sides, () => ( d.polygonSides)));
|
|
3643
3327
|
break;
|
|
3644
3328
|
case "star":
|
|
3645
|
-
subpath =
|
|
3329
|
+
subpath = _chunkUTEVPQTScjs.starSubpath.call(void 0, b, _nullishCoalesce(input.points, () => ( d.starPoints)), _nullishCoalesce(input.innerRatio, () => ( d.starInnerRatio)));
|
|
3646
3330
|
break;
|
|
3647
3331
|
case "line":
|
|
3648
|
-
subpath =
|
|
3332
|
+
subpath = _chunkUTEVPQTScjs.lineSubpath.call(void 0, { x: b.x, y: b.y }, { x: b.x + b.width, y: b.y + b.height });
|
|
3649
3333
|
break;
|
|
3650
3334
|
}
|
|
3651
3335
|
const radius = _nullishCoalesce(input.cornerRadius, () => ( d.cornerRadius));
|
|
3652
3336
|
const kind = _nullishCoalesce(input.cornerKind, () => ( d.cornerKind));
|
|
3653
|
-
if ((input.kind === "rect" || input.kind === "polygon" || input.kind === "star") && radius > 0) subpath =
|
|
3337
|
+
if ((input.kind === "rect" || input.kind === "polygon" || input.kind === "star") && radius > 0) subpath = _chunkUTEVPQTScjs.setSubpathCorners.call(void 0, subpath, radius, kind);
|
|
3654
3338
|
const names = { rect: "Rectangle", ellipse: "Ellipse", polygon: "Polygon", star: "Star", line: "Line" };
|
|
3655
3339
|
const style = this.styleFor(input.kind === "line");
|
|
3656
3340
|
const own = {};
|
|
@@ -3666,7 +3350,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
3666
3350
|
}
|
|
3667
3351
|
/** Adds a path from SVG path data. Returns its id. */
|
|
3668
3352
|
addPath(d, style = {}, options = {}) {
|
|
3669
|
-
const subpaths =
|
|
3353
|
+
const subpaths = _chunkUTEVPQTScjs.bezierToSubpaths.call(void 0, d);
|
|
3670
3354
|
const { name, ...own } = style;
|
|
3671
3355
|
const node = withStyle({ id: this.newId(), type: "path", name: _nullishCoalesce(name, () => ( "Path")), ...this.styleFor(false), subpaths }, own);
|
|
3672
3356
|
return this.addNode(node, { label: "Add Path", ...options });
|
|
@@ -3682,8 +3366,8 @@ var VectorEditorController = (_class3 = class {
|
|
|
3682
3366
|
for (const key of ["startArrow", "endArrow", "arrowAlign", "startArrowScale", "endArrowScale"]) if (d[key]) out[key] = d[key];
|
|
3683
3367
|
if (_optionalChain([d, 'access', _113 => _113.strokeWidthProfile, 'optionalAccess', _114 => _114.length])) out.strokeWidthProfile = d.strokeWidthProfile.map((p) => ({ ...p }));
|
|
3684
3368
|
let styled = out;
|
|
3685
|
-
if (Array.isArray(d.fills)) styled =
|
|
3686
|
-
if (Array.isArray(d.strokes)) styled =
|
|
3369
|
+
if (Array.isArray(d.fills)) styled = _chunkUTEVPQTScjs.withVectorFills.call(void 0, styled, open ? [] : d.fills);
|
|
3370
|
+
if (Array.isArray(d.strokes)) styled = _chunkUTEVPQTScjs.withVectorStrokes.call(void 0, styled, d.strokes);
|
|
3687
3371
|
return styled;
|
|
3688
3372
|
}
|
|
3689
3373
|
/** Merges `patch` into a node (paths take style and geometry; groups name / visibility / opacity). */
|
|
@@ -3700,7 +3384,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
3700
3384
|
for (const id of ids) {
|
|
3701
3385
|
const node = this.getNode(id);
|
|
3702
3386
|
if (!node) return { ok: false, message: `There is no node "${id}".` };
|
|
3703
|
-
for (const p of
|
|
3387
|
+
for (const p of _chunkUTEVPQTScjs.collectPathNodes.call(void 0, node)) targets.add(p.id);
|
|
3704
3388
|
}
|
|
3705
3389
|
if (!targets.size) return { ok: false, message: "Nothing is selected." };
|
|
3706
3390
|
this.change(_nullishCoalesce(options.label, () => ( "Change Style")), () => {
|
|
@@ -3717,13 +3401,13 @@ var VectorEditorController = (_class3 = class {
|
|
|
3717
3401
|
let points;
|
|
3718
3402
|
if (profile === null) points = [];
|
|
3719
3403
|
else if (typeof profile === "string") {
|
|
3720
|
-
const preset =
|
|
3404
|
+
const preset = _chunkUTEVPQTScjs.widthProfilePreset.call(void 0, profile);
|
|
3721
3405
|
if (!preset) return { ok: false, message: `There is no width profile "${profile}".` };
|
|
3722
3406
|
points = preset;
|
|
3723
|
-
} else if (Array.isArray(profile)) points =
|
|
3407
|
+
} else if (Array.isArray(profile)) points = _chunkUTEVPQTScjs.sanitizeWidthProfile.call(void 0, profile);
|
|
3724
3408
|
else {
|
|
3725
3409
|
const p = profile;
|
|
3726
|
-
points = p.taper || p.wave ?
|
|
3410
|
+
points = p.taper || p.wave ? _chunkUTEVPQTScjs.generateWidthProfile.call(void 0, p) : [];
|
|
3727
3411
|
}
|
|
3728
3412
|
this.widthPoints = [];
|
|
3729
3413
|
this.widthEdit = null;
|
|
@@ -3754,7 +3438,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
3754
3438
|
for (const id of ids) {
|
|
3755
3439
|
const node = this.getNode(id);
|
|
3756
3440
|
if (node && !node.locked) {
|
|
3757
|
-
for (const p of
|
|
3441
|
+
for (const p of _chunkUTEVPQTScjs.collectPathNodes.call(void 0, node)) if (!p.locked) out.set(p.id, p);
|
|
3758
3442
|
}
|
|
3759
3443
|
}
|
|
3760
3444
|
return [...out.values()];
|
|
@@ -3772,12 +3456,12 @@ var VectorEditorController = (_class3 = class {
|
|
|
3772
3456
|
const next = /* @__PURE__ */ new Map();
|
|
3773
3457
|
let first = null;
|
|
3774
3458
|
for (const path of paths) {
|
|
3775
|
-
const paint =
|
|
3776
|
-
const base =
|
|
3777
|
-
const g =
|
|
3459
|
+
const paint = _chunkUTEVPQTScjs.vectorTargetPaint.call(void 0, path, target, layer);
|
|
3460
|
+
const base = _chunkUTEVPQTScjs.isVectorGradient.call(void 0, paint) ? paint : _chunkUTEVPQTScjs.defaultVectorGradient.call(void 0, _nullishCoalesce(patch.type, () => ( "linear")), paint);
|
|
3461
|
+
const g = _chunkUTEVPQTScjs.applyVectorGradientPatch.call(void 0, base, patch);
|
|
3778
3462
|
if (!g) return { ok: false, message: "That is not a valid gradient: it needs at least one stop with an offset and a colour." };
|
|
3779
3463
|
first ??= g;
|
|
3780
|
-
next.set(path.id,
|
|
3464
|
+
next.set(path.id, _chunkUTEVPQTScjs.withVectorTargetPaint.call(void 0, path, target, layer, g));
|
|
3781
3465
|
}
|
|
3782
3466
|
this.change(_nullishCoalesce(options.label, () => ( "Gradient")), () => this.setDoc(mapTree(this.doc.nodes, (n) => _nullishCoalesce(next.get(n.id), () => ( n)))), options.merge);
|
|
3783
3467
|
const stops = _nullishCoalesce(_optionalChain([first, 'optionalAccess', _115 => _115.stops, 'access', _116 => _116.length]), () => ( 0));
|
|
@@ -3787,14 +3471,14 @@ var VectorEditorController = (_class3 = class {
|
|
|
3787
3471
|
/** Applies `fn` to every target gradient of the selection (paths whose paint is not a gradient are skipped). */
|
|
3788
3472
|
editGradients(label, fn, merge) {
|
|
3789
3473
|
const { target, layer } = this.gradientEdit;
|
|
3790
|
-
const paths = this.gradientPaths().filter((p) =>
|
|
3474
|
+
const paths = this.gradientPaths().filter((p) => _chunkUTEVPQTScjs.isVectorGradient.call(void 0, _chunkUTEVPQTScjs.vectorTargetPaint.call(void 0, p, target, layer)));
|
|
3791
3475
|
if (!paths.length) return { ok: false, message: "The selection has no gradient." };
|
|
3792
3476
|
const next = /* @__PURE__ */ new Map();
|
|
3793
3477
|
for (const path of paths) {
|
|
3794
|
-
const g =
|
|
3795
|
-
const stops = fn(
|
|
3478
|
+
const g = _chunkUTEVPQTScjs.vectorTargetPaint.call(void 0, path, target, layer);
|
|
3479
|
+
const stops = fn(_chunkUTEVPQTScjs.sortedVectorGradientStops.call(void 0, g));
|
|
3796
3480
|
if (!stops) return { ok: false, message: "A gradient keeps at least two stops." };
|
|
3797
|
-
next.set(path.id,
|
|
3481
|
+
next.set(path.id, _chunkUTEVPQTScjs.withVectorTargetPaint.call(void 0, path, target, layer, { ...g, stops }));
|
|
3798
3482
|
}
|
|
3799
3483
|
this.change(label, () => this.setDoc(mapTree(this.doc.nodes, (n) => _nullishCoalesce(next.get(n.id), () => ( n)))), merge);
|
|
3800
3484
|
return { ok: true };
|
|
@@ -3822,7 +3506,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
3822
3506
|
}
|
|
3823
3507
|
return out;
|
|
3824
3508
|
});
|
|
3825
|
-
if (patch.offset !== void 0 && Number.isFinite(patch.offset)) ({ stops: next, index: moved } =
|
|
3509
|
+
if (patch.offset !== void 0 && Number.isFinite(patch.offset)) ({ stops: next, index: moved } = _chunkUTEVPQTScjs.moveVectorGradientStop.call(void 0, next, index, patch.offset));
|
|
3826
3510
|
return next;
|
|
3827
3511
|
},
|
|
3828
3512
|
options.merge
|
|
@@ -3835,8 +3519,8 @@ var VectorEditorController = (_class3 = class {
|
|
|
3835
3519
|
let index = 0;
|
|
3836
3520
|
const { target, layer } = this.gradientEdit;
|
|
3837
3521
|
const result = this.editGradients("Add Gradient Stop", (stops) => {
|
|
3838
|
-
const path = this.gradientPaths().find((p) =>
|
|
3839
|
-
const r =
|
|
3522
|
+
const path = this.gradientPaths().find((p) => _chunkUTEVPQTScjs.isVectorGradient.call(void 0, _chunkUTEVPQTScjs.vectorTargetPaint.call(void 0, p, target, layer)));
|
|
3523
|
+
const r = _chunkUTEVPQTScjs.insertVectorGradientStop.call(void 0, { ..._chunkUTEVPQTScjs.vectorTargetPaint.call(void 0, path, target, layer), stops }, offset);
|
|
3840
3524
|
index = r.index;
|
|
3841
3525
|
return r.stops;
|
|
3842
3526
|
});
|
|
@@ -3845,7 +3529,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
3845
3529
|
}
|
|
3846
3530
|
/** Removes stop `index` of the selection's gradients (never below two stops). */
|
|
3847
3531
|
removeGradientStop(index) {
|
|
3848
|
-
const result = this.editGradients("Delete Gradient Stop", (stops) =>
|
|
3532
|
+
const result = this.editGradients("Delete Gradient Stop", (stops) => _chunkUTEVPQTScjs.removeVectorGradientStop.call(void 0, stops, index));
|
|
3849
3533
|
if (result.ok) this.selectGradientStop(null);
|
|
3850
3534
|
return result;
|
|
3851
3535
|
}
|
|
@@ -3856,7 +3540,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
3856
3540
|
/** `doc` with path `id`'s `target` paint replaced. */
|
|
3857
3541
|
withGradient(doc, id, target, g) {
|
|
3858
3542
|
const layer = this.gradientEdit.layer;
|
|
3859
|
-
return { ...doc, nodes: mapTree(doc.nodes, (n) => n.id === id && n.type === "path" ?
|
|
3543
|
+
return { ...doc, nodes: mapTree(doc.nodes, (n) => n.id === id && n.type === "path" ? _chunkUTEVPQTScjs.withVectorTargetPaint.call(void 0, n, target, layer, g) : n) };
|
|
3860
3544
|
}
|
|
3861
3545
|
downGradient(screen, p, input) {
|
|
3862
3546
|
const before = this.snapshot();
|
|
@@ -3899,48 +3583,48 @@ var VectorEditorController = (_class3 = class {
|
|
|
3899
3583
|
const end = constrained(drag.startDoc, p);
|
|
3900
3584
|
let doc = base;
|
|
3901
3585
|
for (const id2 of drag.targets) {
|
|
3902
|
-
const node2 =
|
|
3586
|
+
const node2 = _chunkUTEVPQTScjs.findVectorNode.call(void 0, base.nodes, id2);
|
|
3903
3587
|
if (!node2) continue;
|
|
3904
|
-
const paint =
|
|
3905
|
-
const g2 =
|
|
3906
|
-
doc = this.withGradient(doc, id2, target,
|
|
3588
|
+
const paint = _chunkUTEVPQTScjs.vectorTargetPaint.call(void 0, node2, target, this.gradientEdit.layer);
|
|
3589
|
+
const g2 = _chunkUTEVPQTScjs.isVectorGradient.call(void 0, paint) ? paint : _chunkUTEVPQTScjs.defaultVectorGradient.call(void 0, "linear", paint);
|
|
3590
|
+
doc = this.withGradient(doc, id2, target, _chunkUTEVPQTScjs.setVectorGradientVector.call(void 0, g2, _chunkUTEVPQTScjs.vectorPathLocalBounds.call(void 0, node2), this.toLocal(id2, drag.startDoc, base), this.toLocal(id2, end, base)));
|
|
3907
3591
|
}
|
|
3908
3592
|
this.doc = doc;
|
|
3909
3593
|
this.notify(true);
|
|
3910
3594
|
return;
|
|
3911
3595
|
}
|
|
3912
3596
|
const id = drag.nodeId;
|
|
3913
|
-
const node =
|
|
3914
|
-
const g =
|
|
3915
|
-
const bounds =
|
|
3597
|
+
const node = _chunkUTEVPQTScjs.findVectorNode.call(void 0, base.nodes, id);
|
|
3598
|
+
const g = _chunkUTEVPQTScjs.vectorTargetPaint.call(void 0, node, target, this.gradientEdit.layer);
|
|
3599
|
+
const bounds = _chunkUTEVPQTScjs.vectorPathLocalBounds.call(void 0, node);
|
|
3916
3600
|
const local = (q) => this.toLocal(id, q, base);
|
|
3917
3601
|
const part = drag.part;
|
|
3918
3602
|
let next = g;
|
|
3919
3603
|
if (part.kind === "handle") {
|
|
3920
3604
|
let to = p;
|
|
3921
3605
|
if (part.handle === "end" || part.handle === "radius") to = constrained(this.screenToDocument(drag.annotator.start), p);
|
|
3922
|
-
next =
|
|
3606
|
+
next = _chunkUTEVPQTScjs.moveVectorGradientHandle.call(void 0, g, bounds, part.handle, local(to), local(drag.startDoc));
|
|
3923
3607
|
} else if (part.kind === "bar") {
|
|
3924
|
-
next =
|
|
3608
|
+
next = _chunkUTEVPQTScjs.moveVectorGradientHandle.call(void 0, g, bounds, "start", local(p), local(drag.startDoc));
|
|
3925
3609
|
} else {
|
|
3926
3610
|
const a = drag.annotator;
|
|
3927
3611
|
const pos = vectorGradientBarPosition(a, screen);
|
|
3928
|
-
const stops =
|
|
3612
|
+
const stops = _chunkUTEVPQTScjs.sortedVectorGradientStops.call(void 0, g);
|
|
3929
3613
|
if (part.kind === "stop") {
|
|
3930
3614
|
const off = Math.abs(pos.across - VECTOR_GRADIENT_STOP_GAP) > VECTOR_GRADIENT_OFF_BAR;
|
|
3931
|
-
const removed = off ?
|
|
3615
|
+
const removed = off ? _chunkUTEVPQTScjs.removeVectorGradientStop.call(void 0, stops, part.index) : null;
|
|
3932
3616
|
if (removed) {
|
|
3933
3617
|
next = { ...g, stops: removed };
|
|
3934
3618
|
drag.stop = null;
|
|
3935
3619
|
} else {
|
|
3936
|
-
const r =
|
|
3620
|
+
const r = _chunkUTEVPQTScjs.moveVectorGradientStop.call(void 0, stops, part.index, Math.min(1, Math.max(0, pos.offset)));
|
|
3937
3621
|
next = { ...g, stops: r.stops };
|
|
3938
3622
|
drag.stop = r.index;
|
|
3939
3623
|
}
|
|
3940
3624
|
this.interaction = { type: "gradient", part: "stop", ...removed ? { removing: true } : {} };
|
|
3941
3625
|
this.gradientEdit = { ...this.gradientEdit, stop: drag.stop };
|
|
3942
3626
|
} else {
|
|
3943
|
-
const m =
|
|
3627
|
+
const m = _chunkUTEVPQTScjs.vectorGradientMidpointFromPosition.call(void 0, stops, part.index, pos.offset);
|
|
3944
3628
|
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 }) };
|
|
3945
3629
|
}
|
|
3946
3630
|
}
|
|
@@ -3979,7 +3663,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
3979
3663
|
this.change(count > 1 ? "Delete Width Points" : "Delete Width Point", () => {
|
|
3980
3664
|
for (const [id, indices] of byNode) {
|
|
3981
3665
|
const node = this.getNode(id);
|
|
3982
|
-
const rest =
|
|
3666
|
+
const rest = _chunkUTEVPQTScjs.removeWidthPoints.call(void 0, _chunkUTEVPQTScjs.sanitizeWidthProfile.call(void 0, node.strokeWidthProfile), indices);
|
|
3983
3667
|
this.replaceNode(id, withStyle(node, { strokeWidthProfile: rest.length ? rest : null }));
|
|
3984
3668
|
}
|
|
3985
3669
|
});
|
|
@@ -4015,25 +3699,25 @@ var VectorEditorController = (_class3 = class {
|
|
|
4015
3699
|
const left = num(values.left);
|
|
4016
3700
|
const right = num(values.right);
|
|
4017
3701
|
const scale = (w) => w === void 0 ? void 0 : Math.max(0, w) / g.unit;
|
|
4018
|
-
const profile =
|
|
3702
|
+
const profile = _chunkUTEVPQTScjs.sanitizeWidthProfile.call(void 0, node.strokeWidthProfile);
|
|
4019
3703
|
let points;
|
|
4020
3704
|
let index;
|
|
4021
3705
|
const existing = _nullishCoalesce(target.index, () => ( null));
|
|
4022
3706
|
if (existing === null) {
|
|
4023
3707
|
if (t === void 0) return { ok: false, message: "A new width point needs a position t." };
|
|
4024
|
-
if (profile.length >=
|
|
4025
|
-
({ points, index } =
|
|
3708
|
+
if (profile.length >= _chunkUTEVPQTScjs.VECTOR_WIDTH_PROFILE_MAX_POINTS) return { ok: false, message: "The profile has too many width points." };
|
|
3709
|
+
({ points, index } = _chunkUTEVPQTScjs.insertWidthPoint.call(void 0, profile.length ? profile : null, t, { left: scale(left), right: scale(right) }, { step: true }));
|
|
4026
3710
|
} else {
|
|
4027
3711
|
const p = profile[existing];
|
|
4028
3712
|
if (!p) return { ok: false, message: "There is no such width point." };
|
|
4029
3713
|
const sides2 = { left: _nullishCoalesce(scale(left), () => ( p.left)), right: _nullishCoalesce(scale(right), () => ( p.right)) };
|
|
4030
3714
|
const tt = t === void 0 ? p.t : Math.min(Math.max(t, 0), 1);
|
|
4031
|
-
if (Math.abs(tt - p.t) <=
|
|
4032
|
-
points =
|
|
3715
|
+
if (Math.abs(tt - p.t) <= _chunkUTEVPQTScjs.VECTOR_WIDTH_SAME_T) {
|
|
3716
|
+
points = _chunkUTEVPQTScjs.setWidthPoint.call(void 0, profile, existing, sides2);
|
|
4033
3717
|
index = existing;
|
|
4034
3718
|
} else {
|
|
4035
|
-
const rest =
|
|
4036
|
-
if (rest.length) ({ points, index } =
|
|
3719
|
+
const rest = _chunkUTEVPQTScjs.removeWidthPoints.call(void 0, profile, [existing]);
|
|
3720
|
+
if (rest.length) ({ points, index } = _chunkUTEVPQTScjs.insertWidthPoint.call(void 0, rest, tt, sides2, { step: true }));
|
|
4037
3721
|
else {
|
|
4038
3722
|
points = [{ t: tt, ...sides2 }];
|
|
4039
3723
|
index = 0;
|
|
@@ -4081,13 +3765,13 @@ var VectorEditorController = (_class3 = class {
|
|
|
4081
3765
|
if (_optionalChain([node, 'optionalAccess', _134 => _134.type]) !== "path") return null;
|
|
4082
3766
|
const g = vectorStrokeWidthGeometry(node);
|
|
4083
3767
|
if (!g) return null;
|
|
4084
|
-
const profile =
|
|
3768
|
+
const profile = _chunkUTEVPQTScjs.sanitizeWidthProfile.call(void 0, node.strokeWidthProfile);
|
|
4085
3769
|
const p = index === null ? null : profile[index];
|
|
4086
3770
|
if (index !== null && !p) return null;
|
|
4087
3771
|
const tt = p ? p.t : Math.min(Math.max(_nullishCoalesce(t, () => ( 0)), 0), 1);
|
|
4088
|
-
const sides2 = _nullishCoalesce(p, () => (
|
|
3772
|
+
const sides2 = _nullishCoalesce(p, () => ( _chunkUTEVPQTScjs.widthProfileAt.call(void 0, profile.length ? profile : null, tt)));
|
|
4089
3773
|
const sp = Math.min(Math.max(0, subpath), Math.max(0, node.subpaths.length - 1));
|
|
4090
|
-
const at =
|
|
3774
|
+
const at = _chunkUTEVPQTScjs.strokePositionPoint.call(void 0, g.line, sp, tt);
|
|
4091
3775
|
const round = (v) => Math.round(v * 1e6) / 1e6;
|
|
4092
3776
|
const q = at ? _chunkDWGZUSEScjs.applyMatrix.call(void 0, this.worldOf(nodeId), { x: at.point[0], y: at.point[1] }) : { x: 0, y: 0 };
|
|
4093
3777
|
const point = { x: round(q.x), y: round(q.y) };
|
|
@@ -4103,7 +3787,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
4103
3787
|
const refs = this.cornerTargets(options);
|
|
4104
3788
|
if (!refs.length) return { ok: false, message: "Nothing is selected." };
|
|
4105
3789
|
this.change(radius > 0 ? "Corner Radius" : "Sharpen Corners", () => {
|
|
4106
|
-
this.doc = this.updateAnchors(this.doc, refs, (a) =>
|
|
3790
|
+
this.doc = this.updateAnchors(this.doc, refs, (a) => _chunkUTEVPQTScjs.setAnchorCorner.call(void 0, a, radius, options.kind));
|
|
4107
3791
|
});
|
|
4108
3792
|
return { ok: true };
|
|
4109
3793
|
}
|
|
@@ -4112,7 +3796,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
4112
3796
|
const refs = this.cornerTargets(options);
|
|
4113
3797
|
if (!refs.length) return { ok: false, message: "Nothing is selected." };
|
|
4114
3798
|
this.change("Corner Kind", () => {
|
|
4115
|
-
this.doc = this.updateAnchors(this.doc, refs, (a) =>
|
|
3799
|
+
this.doc = this.updateAnchors(this.doc, refs, (a) => _chunkUTEVPQTScjs.setAnchorCorner.call(void 0, a, _nullishCoalesce(_optionalChain([a, 'access', _135 => _135.corner, 'optionalAccess', _136 => _136.radius]), () => ( 0)), kind));
|
|
4116
3800
|
});
|
|
4117
3801
|
return { ok: true };
|
|
4118
3802
|
}
|
|
@@ -4124,7 +3808,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
4124
3808
|
for (const id of _nullishCoalesce(options.ids, () => ( this.selection))) {
|
|
4125
3809
|
const node = this.getNode(id);
|
|
4126
3810
|
if (!node) continue;
|
|
4127
|
-
for (const p of
|
|
3811
|
+
for (const p of _chunkUTEVPQTScjs.collectPathNodes.call(void 0, node)) {
|
|
4128
3812
|
if (p.locked) continue;
|
|
4129
3813
|
p.subpaths.forEach((sp, s) => sp.anchors.forEach((_, i) => out.push({ nodeId: p.id, subpath: s, index: i })));
|
|
4130
3814
|
}
|
|
@@ -4138,25 +3822,25 @@ var VectorEditorController = (_class3 = class {
|
|
|
4138
3822
|
*/
|
|
4139
3823
|
outlineStroke(options = {}) {
|
|
4140
3824
|
const roots = _nullishCoalesce(options.ids, () => ( this.selectedRoots()));
|
|
4141
|
-
const strokesOf = (p) =>
|
|
3825
|
+
const strokesOf = (p) => _chunkUTEVPQTScjs.vectorPaintLayerNodes.call(void 0, p).filter((l) => l.kind === "stroke" && l.drawn && (_nullishCoalesce(l.node.strokeWidth, () => ( 1))) > 0);
|
|
4142
3826
|
const paths = [];
|
|
4143
3827
|
for (const id of roots) {
|
|
4144
3828
|
const node = this.getNode(id);
|
|
4145
3829
|
if (node) {
|
|
4146
|
-
for (const p of
|
|
3830
|
+
for (const p of _chunkUTEVPQTScjs.collectPathNodes.call(void 0, node)) if (!p.locked && strokesOf(p).length) paths.push(p);
|
|
4147
3831
|
}
|
|
4148
3832
|
}
|
|
4149
3833
|
if (!paths.length) return [];
|
|
4150
3834
|
const created = [];
|
|
4151
3835
|
const replace = /* @__PURE__ */ new Map();
|
|
4152
3836
|
for (const p of paths) {
|
|
4153
|
-
const { effects, ...rest } =
|
|
4154
|
-
const unstroked =
|
|
4155
|
-
for (const key of
|
|
4156
|
-
const list =
|
|
3837
|
+
const { effects, ...rest } = _chunkUTEVPQTScjs.cloneVectorNode.call(void 0, p);
|
|
3838
|
+
const unstroked = _chunkUTEVPQTScjs.withVectorStrokes.call(void 0, rest, []);
|
|
3839
|
+
for (const key of _chunkUTEVPQTScjs.VECTOR_STROKE_SETTING_KEYS) delete unstroked[key];
|
|
3840
|
+
const list = _chunkUTEVPQTScjs.vectorFills.call(void 0, p).length ? [{ ...unstroked, ...effects ? { effects } : {} }] : [];
|
|
4157
3841
|
const layers = strokesOf(p);
|
|
4158
3842
|
for (const l of layers) {
|
|
4159
|
-
const outline =
|
|
3843
|
+
const outline = _chunkUTEVPQTScjs.bezierToSubpaths.call(void 0, _chunkUTEVPQTScjs.vectorStrokeOutlinePath.call(void 0, _chunkUTEVPQTScjs.vectorAppearanceOutline.call(void 0, p), l.node));
|
|
4160
3844
|
if (!outline.length) continue;
|
|
4161
3845
|
const id = this.newId();
|
|
4162
3846
|
const { strokes: _s, fills: _f, ...plain2 } = unstroked;
|
|
@@ -4164,7 +3848,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
4164
3848
|
const fill = { paint: l.layer.paint };
|
|
4165
3849
|
if (l.layer.opacity !== void 0) fill.opacity = l.layer.opacity;
|
|
4166
3850
|
if (l.layer.blendMode) fill.blendMode = l.layer.blendMode;
|
|
4167
|
-
list.push(
|
|
3851
|
+
list.push(_chunkUTEVPQTScjs.withVectorFills.call(void 0, { ...plain2, id, name, subpaths: outline, stroke: null, fillRule: "nonzero" }, [fill]));
|
|
4168
3852
|
created.push(id);
|
|
4169
3853
|
}
|
|
4170
3854
|
replace.set(p.id, list);
|
|
@@ -4191,7 +3875,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
4191
3875
|
for (const id of list) {
|
|
4192
3876
|
const node = this.getNode(id);
|
|
4193
3877
|
if (!node) return `There is no node "${id}".`;
|
|
4194
|
-
for (const p of
|
|
3878
|
+
for (const p of _chunkUTEVPQTScjs.collectPathNodes.call(void 0, node)) if (!p.blendStep) out.set(p.id, p);
|
|
4195
3879
|
}
|
|
4196
3880
|
if (!out.size) return "The selection has no paths (fills and strokes belong to paths).";
|
|
4197
3881
|
return [...out.values()];
|
|
@@ -4202,10 +3886,10 @@ var VectorEditorController = (_class3 = class {
|
|
|
4202
3886
|
if (typeof targets === "string") return { ok: false, message: targets };
|
|
4203
3887
|
const next = /* @__PURE__ */ new Map();
|
|
4204
3888
|
for (const path of targets) {
|
|
4205
|
-
const stack = kind === "fill" ?
|
|
3889
|
+
const stack = kind === "fill" ? _chunkUTEVPQTScjs.vectorFills.call(void 0, path) : _chunkUTEVPQTScjs.vectorStrokes.call(void 0, path);
|
|
4206
3890
|
const result = fn(stack.map((l) => ({ ...l })), path);
|
|
4207
3891
|
if (typeof result === "string") return { ok: false, message: result };
|
|
4208
|
-
next.set(path.id, kind === "fill" ?
|
|
3892
|
+
next.set(path.id, kind === "fill" ? _chunkUTEVPQTScjs.withVectorFills.call(void 0, path, result) : _chunkUTEVPQTScjs.withVectorStrokes.call(void 0, path, result));
|
|
4209
3893
|
}
|
|
4210
3894
|
this.change(label, () => this.setDoc(mapTree(this.doc.nodes, (n) => _nullishCoalesce(next.get(n.id), () => ( n)))), merge);
|
|
4211
3895
|
return { ok: true };
|
|
@@ -4221,7 +3905,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
4221
3905
|
const paint = patch.paint;
|
|
4222
3906
|
if (paint === null || typeof paint === "string" && paint.trim()) set.paint = paint === null ? null : paint.trim();
|
|
4223
3907
|
else {
|
|
4224
|
-
const g =
|
|
3908
|
+
const g = _chunkUTEVPQTScjs.sanitizeVectorGradient.call(void 0, paint);
|
|
4225
3909
|
if (!g) return "paint must be a CSS colour, a gradient { type, stops: [{ offset, color }] } or null.";
|
|
4226
3910
|
set.paint = g;
|
|
4227
3911
|
}
|
|
@@ -4233,7 +3917,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
4233
3917
|
else unset.push("opacity");
|
|
4234
3918
|
}
|
|
4235
3919
|
if (patch.blendMode !== void 0) {
|
|
4236
|
-
if (!
|
|
3920
|
+
if (!_chunkUTEVPQTScjs.isVectorBlendMode.call(void 0, patch.blendMode)) return `Unknown blend mode "${String(patch.blendMode)}". Use one of: ${_chunkUTEVPQTScjs.VECTOR_BLEND_MODES.join(", ")}.`;
|
|
4237
3921
|
if (patch.blendMode !== "normal") set.blendMode = patch.blendMode;
|
|
4238
3922
|
else unset.push("blendMode");
|
|
4239
3923
|
}
|
|
@@ -4243,8 +3927,8 @@ var VectorEditorController = (_class3 = class {
|
|
|
4243
3927
|
else set.visible = false;
|
|
4244
3928
|
}
|
|
4245
3929
|
if (kind === "stroke") {
|
|
4246
|
-
const settings =
|
|
4247
|
-
for (const key of
|
|
3930
|
+
const settings = _chunkUTEVPQTScjs.sanitizeVectorStrokeSettings.call(void 0, patch);
|
|
3931
|
+
for (const key of _chunkUTEVPQTScjs.VECTOR_STROKE_SETTING_KEYS) {
|
|
4248
3932
|
if (!(key in patch) || patch[key] === void 0) continue;
|
|
4249
3933
|
if (patch[key] === null || key === "strokeDasharray" && Array.isArray(patch[key]) && !patch[key].length) unset.push(key);
|
|
4250
3934
|
else if (settings[key] === void 0) return `Invalid ${key}: ${JSON.stringify(patch[key])}.`;
|
|
@@ -4262,7 +3946,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
4262
3946
|
const patch = this.layerPatch(kind, layer);
|
|
4263
3947
|
if (typeof patch === "string") return { ok: false, message: patch };
|
|
4264
3948
|
return this.editStacks(kind, options.ids, kind === "fill" ? "Add Fill" : "Add Stroke", (stack, path) => {
|
|
4265
|
-
const base = kind === "fill" ? { paint: "#808080" } :
|
|
3949
|
+
const base = kind === "fill" ? { paint: "#808080" } : _chunkUTEVPQTScjs.newVectorStrokeLayer.call(void 0, path, {});
|
|
4266
3950
|
const added = { ...base, ...patch.set };
|
|
4267
3951
|
for (const key of patch.unset) delete added[key];
|
|
4268
3952
|
const at = options.index === void 0 ? stack.length : Math.min(stack.length, Math.max(0, Math.round(options.index)));
|
|
@@ -4313,12 +3997,12 @@ var VectorEditorController = (_class3 = class {
|
|
|
4313
3997
|
}
|
|
4314
3998
|
/** Replaces the whole fill or stroke stack of the selected (or given) paths (malformed layers are dropped). */
|
|
4315
3999
|
setPaintLayers(kind, layers, options = {}) {
|
|
4316
|
-
const clean = kind === "fill" ?
|
|
4000
|
+
const clean = kind === "fill" ? _chunkUTEVPQTScjs.sanitizeVectorFills.call(void 0, layers) : _chunkUTEVPQTScjs.sanitizeVectorStrokes.call(void 0, layers);
|
|
4317
4001
|
return this.editStacks(kind, options.ids, kind === "fill" ? "Set Fills" : "Set Strokes", () => clean);
|
|
4318
4002
|
}
|
|
4319
4003
|
/** Sets the blend mode of the selected (or given) nodes (paths or groups); `normal` removes it. */
|
|
4320
4004
|
setBlendMode(mode, options = {}) {
|
|
4321
|
-
if (!
|
|
4005
|
+
if (!_chunkUTEVPQTScjs.isVectorBlendMode.call(void 0, mode)) return { ok: false, message: `Unknown blend mode "${String(mode)}". Use one of: ${_chunkUTEVPQTScjs.VECTOR_BLEND_MODES.join(", ")}.` };
|
|
4322
4006
|
const ids = _nullishCoalesce(options.ids, () => ( this.selectedRoots()));
|
|
4323
4007
|
if (!ids.length) return { ok: false, message: "Nothing is selected." };
|
|
4324
4008
|
for (const id of ids) if (!this.getNode(id)) return { ok: false, message: `There is no node "${id}".` };
|
|
@@ -4341,7 +4025,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
4341
4025
|
* ids (one per node, in order), empty for an unknown type or nothing selected.
|
|
4342
4026
|
*/
|
|
4343
4027
|
addFilter(type, options = {}) {
|
|
4344
|
-
if (!
|
|
4028
|
+
if (!_chunkUTEVPQTScjs.isVectorFilterType.call(void 0, type)) return [];
|
|
4345
4029
|
const targets = this.effectTargets(options.ids);
|
|
4346
4030
|
if (!targets.length) return [];
|
|
4347
4031
|
const created = [];
|
|
@@ -4350,12 +4034,12 @@ var VectorEditorController = (_class3 = class {
|
|
|
4350
4034
|
const list = _nullishCoalesce(node.filters, () => ( []));
|
|
4351
4035
|
let k = list.length + 1;
|
|
4352
4036
|
while (list.some((f) => f.id === `filter${k}`)) k++;
|
|
4353
|
-
const filter =
|
|
4037
|
+
const filter = _chunkUTEVPQTScjs.createVectorFilter.call(void 0, type, `filter${k}`, options.params);
|
|
4354
4038
|
const at = options.index === void 0 ? list.length : Math.min(list.length, Math.max(0, Math.round(options.index)));
|
|
4355
4039
|
next.set(node.id, { ...node, filters: [...list.slice(0, at), filter, ...list.slice(at)] });
|
|
4356
4040
|
created.push(filter.id);
|
|
4357
4041
|
}
|
|
4358
|
-
this.change(`Add ${
|
|
4042
|
+
this.change(`Add ${_chunkUTEVPQTScjs.VECTOR_FILTER_LABELS[type]}`, () => this.setDoc(mapTree(this.doc.nodes, (n) => _nullishCoalesce(next.get(n.id), () => ( n)))));
|
|
4359
4043
|
return created;
|
|
4360
4044
|
}
|
|
4361
4045
|
editFilters(nodeId, label, fn, merge) {
|
|
@@ -4375,12 +4059,12 @@ var VectorEditorController = (_class3 = class {
|
|
|
4375
4059
|
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
4060
|
return this.editFilters(
|
|
4377
4061
|
nodeId,
|
|
4378
|
-
`Edit ${current ?
|
|
4062
|
+
`Edit ${current ? _chunkUTEVPQTScjs.VECTOR_FILTER_LABELS[current.type] : "Filter"}`,
|
|
4379
4063
|
(list) => {
|
|
4380
4064
|
const i = list.findIndex((f2) => f2.id === filterId);
|
|
4381
4065
|
if (i < 0) return `Node "${nodeId}" has no filter "${filterId}".`;
|
|
4382
4066
|
const f = list[i];
|
|
4383
|
-
const params = patch.params ?
|
|
4067
|
+
const params = patch.params ? _chunkUTEVPQTScjs.normalizeVectorFilterParams.call(void 0, f.type, patch.params, f.params) : f.params;
|
|
4384
4068
|
const next = { ...f, params, ...patch.enabled !== void 0 ? { enabled: patch.enabled } : {} };
|
|
4385
4069
|
if (next.enabled !== false) delete next.enabled;
|
|
4386
4070
|
return list.map((x, j) => j === i ? next : x);
|
|
@@ -4417,7 +4101,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
4417
4101
|
*/
|
|
4418
4102
|
addEffect(type, options = {}) {
|
|
4419
4103
|
const targets = this.effectTargets(options.ids);
|
|
4420
|
-
if (!targets.length || !
|
|
4104
|
+
if (!targets.length || !_chunkUTEVPQTScjs.createVectorEffect.call(void 0, type, "")) return [];
|
|
4421
4105
|
const created = [];
|
|
4422
4106
|
const next = /* @__PURE__ */ new Map();
|
|
4423
4107
|
for (const node of targets) {
|
|
@@ -4426,15 +4110,15 @@ var VectorEditorController = (_class3 = class {
|
|
|
4426
4110
|
while (list.some((e) => e.id === `fx${k}`)) k++;
|
|
4427
4111
|
const params = { ..._nullishCoalesce(options.params, () => ( {})) };
|
|
4428
4112
|
if (type === "repeater" && params.position === void 0) {
|
|
4429
|
-
const b = _chunkXGD3FSNCcjs.bezierPathBounds.call(void 0,
|
|
4113
|
+
const b = _chunkXGD3FSNCcjs.bezierPathBounds.call(void 0, _chunkUTEVPQTScjs.vectorAppearanceOutline.call(void 0, node));
|
|
4430
4114
|
if (b && b.maxX - b.minX > 0) params.position = { x: Math.round((b.maxX - b.minX) * 1.25 * 100) / 100, y: 0 };
|
|
4431
4115
|
}
|
|
4432
|
-
const effect =
|
|
4116
|
+
const effect = _chunkUTEVPQTScjs.createVectorEffect.call(void 0, type, `fx${k}`, params);
|
|
4433
4117
|
const at = options.index === void 0 ? list.length : Math.min(list.length, Math.max(0, Math.round(options.index)));
|
|
4434
4118
|
next.set(node.id, { ...node, effects: [...list.slice(0, at), effect, ...list.slice(at)] });
|
|
4435
4119
|
created.push(effect.id);
|
|
4436
4120
|
}
|
|
4437
|
-
this.change(`Add ${
|
|
4121
|
+
this.change(`Add ${_chunkUTEVPQTScjs.VECTOR_EFFECT_LABELS[type]}`, () => this.setDoc(mapTree(this.doc.nodes, (n) => _nullishCoalesce(next.get(n.id), () => ( n)))));
|
|
4438
4122
|
return created;
|
|
4439
4123
|
}
|
|
4440
4124
|
editEffects(nodeId, label, fn, merge) {
|
|
@@ -4454,7 +4138,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
4454
4138
|
const merge = options.merge === true ? `effect:${nodeId}:${effectId}` : options.merge || void 0;
|
|
4455
4139
|
const node = this.getNode(nodeId);
|
|
4456
4140
|
const current = _optionalChain([node, 'optionalAccess', _142 => _142.effects, 'optionalAccess', _143 => _143.find, 'call', _144 => _144((e) => e.id === effectId)]);
|
|
4457
|
-
const label = current ? _nullishCoalesce(
|
|
4141
|
+
const label = current ? _nullishCoalesce(_chunkUTEVPQTScjs.VECTOR_EFFECT_LABELS[current.type], () => ( "Effect")) : "Effect";
|
|
4458
4142
|
return this.editEffects(
|
|
4459
4143
|
nodeId,
|
|
4460
4144
|
`Edit ${label}`,
|
|
@@ -4463,7 +4147,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
4463
4147
|
if (i < 0) return `Node "${nodeId}" has no effect "${effectId}".`;
|
|
4464
4148
|
const e = list[i];
|
|
4465
4149
|
const raw = patch.params && e.type === "envelope" && node ? this.envelopeParams(node, e, patch.params) : patch.params;
|
|
4466
|
-
const params = raw ?
|
|
4150
|
+
const params = raw ? _chunkUTEVPQTScjs.normalizeVectorEffectParams.call(void 0, e.type, raw, e.params) : e.params;
|
|
4467
4151
|
const next = { ...e, params, ...patch.enabled !== void 0 ? { enabled: patch.enabled } : {} };
|
|
4468
4152
|
if (next.enabled !== false) delete next.enabled;
|
|
4469
4153
|
return list.map((x, j) => j === i ? next : x);
|
|
@@ -4494,16 +4178,16 @@ var VectorEditorController = (_class3 = class {
|
|
|
4494
4178
|
* nodes (empty when none was live).
|
|
4495
4179
|
*/
|
|
4496
4180
|
expandAppearance(options = {}) {
|
|
4497
|
-
const roots = (_nullishCoalesce(options.ids, () => ( this.selectedRoots()))).map((id) => this.getNode(id)).filter((n) => !!n &&
|
|
4181
|
+
const roots = (_nullishCoalesce(options.ids, () => ( this.selectedRoots()))).map((id) => this.getNode(id)).filter((n) => !!n && _chunkUTEVPQTScjs.hasVectorAppearance.call(void 0, n));
|
|
4498
4182
|
if (!roots.length) return [];
|
|
4499
4183
|
const fresh = (n) => {
|
|
4500
4184
|
const id = n.id.includes("~fx") ? this.newId() : n.id;
|
|
4501
4185
|
return n.type === "group" ? { ...n, id, children: n.children.map(fresh) } : { ...n, id };
|
|
4502
4186
|
};
|
|
4503
4187
|
const bake = (n) => {
|
|
4504
|
-
if (!
|
|
4505
|
-
if (!
|
|
4506
|
-
let e =
|
|
4188
|
+
if (!_chunkUTEVPQTScjs.hasVectorAppearance.call(void 0, n)) return n;
|
|
4189
|
+
if (!_chunkUTEVPQTScjs.hasOwnVectorAppearance.call(void 0, n)) return { ...n, children: n.children.map(bake) };
|
|
4190
|
+
let e = _chunkUTEVPQTScjs.expandVectorAppearance.call(void 0, n);
|
|
4507
4191
|
if (e.type === "group" && e.children.length === 1 && e.children[0].type === "path") {
|
|
4508
4192
|
const { id: _id, opacity, name, ...child } = e.children[0];
|
|
4509
4193
|
const k = (_nullishCoalesce(e.opacity, () => ( 1))) * (_nullishCoalesce(opacity, () => ( 1)));
|
|
@@ -4538,7 +4222,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
4538
4222
|
const drop = new Set(ids.filter((id) => this.getNode(id)));
|
|
4539
4223
|
if (!drop.size) return { ok: false, message: "Nothing to delete." };
|
|
4540
4224
|
this.change(_nullishCoalesce(options.label, () => ( "Delete")), () => {
|
|
4541
|
-
this.setDoc(mapTree(this.doc.nodes, (n) => drop.has(n.id) ? null : n));
|
|
4225
|
+
this.setDoc(mapTree(this.doc.nodes, (n) => drop.has(n.id) ? null : _chunkUTEVPQTScjs.isVectorMaskGroup.call(void 0, n) && drop.has(n.children[0].id) ? { ...n, mask: null } : n));
|
|
4542
4226
|
this.selection = this.selection.filter((id) => !drop.has(id) && this.getNode(id));
|
|
4543
4227
|
this.anchors = this.anchors.filter((r) => getAnchor(this.doc, r));
|
|
4544
4228
|
if (this.editingId && !this.getNode(this.editingId)) this.editingId = null;
|
|
@@ -4586,11 +4270,11 @@ var VectorEditorController = (_class3 = class {
|
|
|
4586
4270
|
selectedRoots() {
|
|
4587
4271
|
return this.selection.filter((id) => {
|
|
4588
4272
|
let covered = false;
|
|
4589
|
-
const loc =
|
|
4273
|
+
const loc = _chunkUTEVPQTScjs.locateVectorNode.call(void 0, this.doc.nodes, id);
|
|
4590
4274
|
let parent = _nullishCoalesce(_optionalChain([loc, 'optionalAccess', _145 => _145.parent]), () => ( null));
|
|
4591
4275
|
while (parent) {
|
|
4592
4276
|
if (this.selection.includes(parent.id)) covered = true;
|
|
4593
|
-
parent = _nullishCoalesce(_optionalChain([
|
|
4277
|
+
parent = _nullishCoalesce(_optionalChain([_chunkUTEVPQTScjs.locateVectorNode.call(void 0, this.doc.nodes, parent.id), 'optionalAccess', _146 => _146.parent]), () => ( null));
|
|
4594
4278
|
}
|
|
4595
4279
|
return !covered;
|
|
4596
4280
|
});
|
|
@@ -4616,7 +4300,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
4616
4300
|
let next = n;
|
|
4617
4301
|
if (ids.has(n.id) && !n.locked) next = distortVectorNode(n, parent, f, tolerance);
|
|
4618
4302
|
else if (n.type === "group") {
|
|
4619
|
-
const children = visit(n.children, _chunkDWGZUSEScjs.multiplyMatrices.call(void 0,
|
|
4303
|
+
const children = visit(n.children, _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, _chunkUTEVPQTScjs.nodeMatrix.call(void 0, n), parent));
|
|
4620
4304
|
if (children !== n.children) next = { ...n, children };
|
|
4621
4305
|
}
|
|
4622
4306
|
if (next !== n) changed = true;
|
|
@@ -4708,7 +4392,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
4708
4392
|
/** Envelope parameters for `node` after `patch`: a preset switched to a mesh becomes the mesh it stood for. */
|
|
4709
4393
|
envelopeParams(node, current, patch) {
|
|
4710
4394
|
if (patch.style !== "mesh" || patch.mesh !== void 0 || !current || current.params.style === "mesh") return patch;
|
|
4711
|
-
const frame =
|
|
4395
|
+
const frame = _chunkUTEVPQTScjs.vectorEnvelopeFrame.call(void 0, node, current.id);
|
|
4712
4396
|
if (!frame) return patch;
|
|
4713
4397
|
const rows = typeof patch.rows === "number" ? patch.rows : current.params.rows;
|
|
4714
4398
|
const columns = typeof patch.columns === "number" ? patch.columns : current.params.columns;
|
|
@@ -4732,14 +4416,14 @@ var VectorEditorController = (_class3 = class {
|
|
|
4732
4416
|
const list = _nullishCoalesce(node.effects, () => ( []));
|
|
4733
4417
|
const current = _nullishCoalesce(list.find((e) => e.type === "envelope"), () => ( null));
|
|
4734
4418
|
if (current) {
|
|
4735
|
-
const p =
|
|
4419
|
+
const p = _chunkUTEVPQTScjs.normalizeVectorEffectParams.call(void 0, "envelope", this.envelopeParams(node, current, raw), current.params);
|
|
4736
4420
|
const { enabled: _e, ...rest } = current;
|
|
4737
4421
|
next.set(node.id, { ...node, effects: list.map((e) => e === current ? { ...rest, params: p } : e) });
|
|
4738
4422
|
out.push({ nodeId: node.id, effectId: current.id });
|
|
4739
4423
|
} else {
|
|
4740
4424
|
let k = list.length + 1;
|
|
4741
4425
|
while (list.some((e) => e.id === `fx${k}`)) k++;
|
|
4742
|
-
const effect =
|
|
4426
|
+
const effect = _chunkUTEVPQTScjs.createVectorEffect.call(void 0, "envelope", `fx${k}`, raw);
|
|
4743
4427
|
next.set(node.id, { ...node, effects: [...list, effect] });
|
|
4744
4428
|
out.push({ nodeId: node.id, effectId: effect.id });
|
|
4745
4429
|
}
|
|
@@ -4759,7 +4443,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
4759
4443
|
const ids = _nullishCoalesce(options.ids, () => ( this.selectedRoots()));
|
|
4760
4444
|
if (ids.length < 2) return { ok: false, message: "Select the objects and, on top of them, the shape to use as the envelope." };
|
|
4761
4445
|
const order = /* @__PURE__ */ new Map();
|
|
4762
|
-
|
|
4446
|
+
_chunkUTEVPQTScjs.walkVectorNodes.call(void 0, this.doc.nodes, (n) => order.set(n.id, order.size));
|
|
4763
4447
|
const sorted = ids.filter((id) => order.has(id)).sort((a, b) => order.get(a) - order.get(b));
|
|
4764
4448
|
const topId = sorted[sorted.length - 1];
|
|
4765
4449
|
const top = this.getNode(topId);
|
|
@@ -4767,11 +4451,11 @@ var VectorEditorController = (_class3 = class {
|
|
|
4767
4451
|
if (!top || !outline) return { ok: false, message: "The top object must be a path with a closed outline." };
|
|
4768
4452
|
const contents = sorted.slice(0, -1).map((id) => this.getNode(id));
|
|
4769
4453
|
if (contents.some((n) => n.locked)) return { ok: false, message: "Locked objects cannot be enveloped." };
|
|
4770
|
-
const parents = contents.map((n) => _nullishCoalesce(_optionalChain([
|
|
4454
|
+
const parents = contents.map((n) => _nullishCoalesce(_optionalChain([_chunkUTEVPQTScjs.locateVectorNode.call(void 0, this.doc.nodes, n.id), 'optionalAccess', _153 => _153.parent, 'optionalAccess', _154 => _154.id]), () => ( null)));
|
|
4771
4455
|
if (parents.some((p) => p !== parents[0])) return { ok: false, message: "The objects to envelope must be in the same group." };
|
|
4772
4456
|
const target = contents.length === 1 ? contents[0] : { id: this.newId(), type: "group", name: "Envelope", children: contents.map((n) => n) };
|
|
4773
4457
|
const parentToDoc = parents[0] ? this.worldOf(parents[0]) : _chunkDWGZUSEScjs.IDENTITY_MATRIX;
|
|
4774
|
-
const targetToDoc = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0,
|
|
4458
|
+
const targetToDoc = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, _chunkUTEVPQTScjs.nodeMatrix.call(void 0, target), parentToDoc);
|
|
4775
4459
|
const toLocal = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, this.worldOf(topId), _chunkDWGZUSEScjs.invertMatrix.call(void 0, targetToDoc));
|
|
4776
4460
|
const local = {
|
|
4777
4461
|
closed: true,
|
|
@@ -4781,12 +4465,12 @@ var VectorEditorController = (_class3 = class {
|
|
|
4781
4465
|
...a.out ? { out: _chunkDWGZUSEScjs.applyMatrix.call(void 0, toLocal, a.out) } : {}
|
|
4782
4466
|
}))
|
|
4783
4467
|
};
|
|
4784
|
-
const mesh =
|
|
4468
|
+
const mesh = _chunkUTEVPQTScjs.vectorMeshFromOutline.call(void 0, local, _nullishCoalesce(options.columns, () => ( 4)), _nullishCoalesce(options.rows, () => ( 4)));
|
|
4785
4469
|
if (!mesh) return { ok: false, message: "The top object\u2019s outline is too small to use as an envelope." };
|
|
4786
4470
|
const list = _nullishCoalesce(target.effects, () => ( []));
|
|
4787
4471
|
let k = list.length + 1;
|
|
4788
4472
|
while (list.some((e) => e.id === `fx${k}`)) k++;
|
|
4789
|
-
const effect =
|
|
4473
|
+
const effect = _chunkUTEVPQTScjs.createVectorEffect.call(void 0, "envelope", `fx${k}`, { style: "mesh", mesh });
|
|
4790
4474
|
const enveloped = { ...target, effects: [...list, effect] };
|
|
4791
4475
|
this.change("Make Envelope with Top Object", () => {
|
|
4792
4476
|
let nodes = spliceTree(this.doc.nodes, topId, []);
|
|
@@ -4814,7 +4498,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
4814
4498
|
const replace = /* @__PURE__ */ new Map();
|
|
4815
4499
|
for (const node of targets) {
|
|
4816
4500
|
const effect = node.effects.find((e) => e.type === "envelope");
|
|
4817
|
-
const frame =
|
|
4501
|
+
const frame = _chunkUTEVPQTScjs.vectorEnvelopeFrame.call(void 0, node, effect.id);
|
|
4818
4502
|
const rest = node.effects.filter((e) => e !== effect);
|
|
4819
4503
|
const { effects: _e, ...plain2 } = node;
|
|
4820
4504
|
const kept = rest.length ? { ...plain2, effects: rest } : plain2;
|
|
@@ -4829,7 +4513,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
4829
4513
|
type: "path",
|
|
4830
4514
|
name: "Envelope",
|
|
4831
4515
|
...node.transform ? { transform: node.transform } : {},
|
|
4832
|
-
subpaths: [
|
|
4516
|
+
subpaths: [_chunkUTEVPQTScjs.vectorMeshOutline.call(void 0, frame.mesh)],
|
|
4833
4517
|
fill: null,
|
|
4834
4518
|
stroke: "#808080",
|
|
4835
4519
|
strokeWidth: 1
|
|
@@ -4893,7 +4577,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
4893
4577
|
this.notify();
|
|
4894
4578
|
return;
|
|
4895
4579
|
}
|
|
4896
|
-
const node =
|
|
4580
|
+
const node = _chunkUTEVPQTScjs.hitTestVectorNodes.call(void 0, this.doc.nodes, p, this.tolerance(), { entered: this.enteredGroups() });
|
|
4897
4581
|
if (node) this.selection = input.shift ? this.selection.includes(node.id) ? this.selection.filter((id) => id !== node.id) : [...this.selection, node.id] : [node.id];
|
|
4898
4582
|
else if (!input.shift) this.selection = [];
|
|
4899
4583
|
this.anchors = [];
|
|
@@ -4932,9 +4616,9 @@ var VectorEditorController = (_class3 = class {
|
|
|
4932
4616
|
let next = n;
|
|
4933
4617
|
if (ids.has(n.id) && !n.locked) {
|
|
4934
4618
|
const local = isRoot(parent) ? m : _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, parent, m), _chunkDWGZUSEScjs.invertMatrix.call(void 0, parent));
|
|
4935
|
-
next =
|
|
4619
|
+
next = _chunkUTEVPQTScjs.transformVectorNode.call(void 0, n, local);
|
|
4936
4620
|
} else if (n.type === "group") {
|
|
4937
|
-
const children = visit(n.children, _chunkDWGZUSEScjs.multiplyMatrices.call(void 0,
|
|
4621
|
+
const children = visit(n.children, _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, _chunkUTEVPQTScjs.nodeMatrix.call(void 0, n), parent));
|
|
4938
4622
|
if (children !== n.children) next = { ...n, children };
|
|
4939
4623
|
}
|
|
4940
4624
|
if (next !== n) changed = true;
|
|
@@ -5070,7 +4754,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
5070
4754
|
const n = node.type === "group" ? { ...node, children: insert(node.children) } : node;
|
|
5071
4755
|
out.push(n);
|
|
5072
4756
|
if (set.has(node.id)) {
|
|
5073
|
-
const copy =
|
|
4757
|
+
const copy = _chunkUTEVPQTScjs.transformVectorNode.call(void 0, this.freshIds(node), m);
|
|
5074
4758
|
created.push(copy.id);
|
|
5075
4759
|
out.push(copy);
|
|
5076
4760
|
}
|
|
@@ -5083,7 +4767,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
5083
4767
|
group(options = {}) {
|
|
5084
4768
|
const ids = _nullishCoalesce(options.ids, () => ( this.selectedRoots()));
|
|
5085
4769
|
if (!ids.length) return null;
|
|
5086
|
-
const locs = ids.map((id2) =>
|
|
4770
|
+
const locs = ids.map((id2) => _chunkUTEVPQTScjs.locateVectorNode.call(void 0, this.doc.nodes, id2));
|
|
5087
4771
|
if (locs.some((l) => !l)) return null;
|
|
5088
4772
|
const parent = _nullishCoalesce(_optionalChain([locs, 'access', _158 => _158[0], 'access', _159 => _159.parent, 'optionalAccess', _160 => _160.id]), () => ( null));
|
|
5089
4773
|
if (locs.some((l) => (_nullishCoalesce(_optionalChain([l, 'access', _161 => _161.parent, 'optionalAccess', _162 => _162.id]), () => ( null))) !== parent)) return null;
|
|
@@ -5120,9 +4804,9 @@ var VectorEditorController = (_class3 = class {
|
|
|
5120
4804
|
if (set.has(n.id) && n.type === "group") {
|
|
5121
4805
|
changed = true;
|
|
5122
4806
|
const opacity = n.opacity;
|
|
5123
|
-
const m =
|
|
4807
|
+
const m = _chunkUTEVPQTScjs.nodeMatrix.call(void 0, n);
|
|
5124
4808
|
out.push(
|
|
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 ?
|
|
4809
|
+
...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 ? _chunkUTEVPQTScjs.transformVectorNode.call(void 0, c, m) : c).map((c) => opacity !== void 0 && opacity < 1 ? { ...c, opacity: (_nullishCoalesce(c.opacity, () => ( 1))) * opacity } : c)
|
|
5126
4810
|
);
|
|
5127
4811
|
} else if (n.type === "group") {
|
|
5128
4812
|
const children = flatten(n.children);
|
|
@@ -5174,16 +4858,16 @@ var VectorEditorController = (_class3 = class {
|
|
|
5174
4858
|
const result = _chunkXGD3FSNCcjs.pathBoolean.call(void 0,
|
|
5175
4859
|
BOOLEAN_OPS[op],
|
|
5176
4860
|
entries.map((e) => ({
|
|
5177
|
-
path:
|
|
4861
|
+
path: _chunkUTEVPQTScjs.vectorPathWorldBezier.call(void 0, { ...e.node, subpaths: e.node.subpaths.filter((s) => s.anchors.length > 1).map((s) => ({ ...s, closed: true })) }, e.parent),
|
|
5178
4862
|
fillRule: _nullishCoalesce(e.node.fillRule, () => ( "nonzero"))
|
|
5179
4863
|
}))
|
|
5180
4864
|
);
|
|
5181
4865
|
const base = entries[0].node;
|
|
5182
4866
|
const anchorRoot = _nullishCoalesce(roots.find((r) => this.holds(r, base.id)), () => ( base.id));
|
|
5183
|
-
const subpaths =
|
|
4867
|
+
const subpaths = _chunkUTEVPQTScjs.bezierToSubpaths.call(void 0, this.intoParentSpace(anchorRoot, result.path));
|
|
5184
4868
|
if (result.error || !subpaths.length) return null;
|
|
5185
4869
|
const id = this.newId();
|
|
5186
|
-
const { transform: _t, effects: _e, booleanOperation: _b, ...baseRest } =
|
|
4870
|
+
const { transform: _t, effects: _e, booleanOperation: _b, ...baseRest } = _chunkUTEVPQTScjs.cloneVectorNode.call(void 0, base);
|
|
5187
4871
|
const node = { ...baseRest, id, name: BOOLEAN_LABELS[op], subpaths };
|
|
5188
4872
|
const drop = /* @__PURE__ */ new Set([...entries.map((e) => e.node.id), ...roots]);
|
|
5189
4873
|
this.change(BOOLEAN_LABELS[op], () => {
|
|
@@ -5197,20 +4881,20 @@ var VectorEditorController = (_class3 = class {
|
|
|
5197
4881
|
/** Whether stored node `rootId` holds `id` as drawn (`id` may be an expanded path inside it). */
|
|
5198
4882
|
holds(rootId, id) {
|
|
5199
4883
|
const n = this.getNode(rootId);
|
|
5200
|
-
return !!n && (!!
|
|
4884
|
+
return !!n && (!!_chunkUTEVPQTScjs.findVectorNode.call(void 0, [n], id) || !!_chunkUTEVPQTScjs.findVectorNode.call(void 0, [_chunkUTEVPQTScjs.expandVectorAppearance.call(void 0, n)], id) || !!_chunkUTEVPQTScjs.findVectorNode.call(void 0, [_chunkUTEVPQTScjs.vectorMaskedGeometry.call(void 0, n)], id));
|
|
5201
4885
|
}
|
|
5202
4886
|
liveBooleanOp(op, roots) {
|
|
5203
4887
|
const nodes = roots.map((id2) => this.getNode(id2));
|
|
5204
4888
|
if (!nodes.length || nodes.some((n) => !n)) return null;
|
|
5205
4889
|
const label = `Live ${BOOLEAN_LABELS[op]}`;
|
|
5206
4890
|
const lone = nodes.length === 1 ? nodes[0] : null;
|
|
5207
|
-
if (
|
|
4891
|
+
if (_chunkUTEVPQTScjs.isVectorLiveBoolean.call(void 0, lone)) {
|
|
5208
4892
|
const children = lone.children.map((c) => c.booleanOperation ? (({ booleanOperation: _b, ...rest }) => rest)(c) : c);
|
|
5209
4893
|
this.change(label, () => this.replaceNode(lone.id, { ...lone, liveBoolean: op, children }));
|
|
5210
4894
|
return lone.id;
|
|
5211
4895
|
}
|
|
5212
|
-
const parents = roots.map((id2) => _nullishCoalesce(_optionalChain([
|
|
5213
|
-
if (parents.every((g) =>
|
|
4896
|
+
const parents = roots.map((id2) => _nullishCoalesce(_optionalChain([_chunkUTEVPQTScjs.locateVectorNode.call(void 0, this.doc.nodes, id2), 'optionalAccess', _164 => _164.parent]), () => ( null)));
|
|
4897
|
+
if (parents.every((g) => _chunkUTEVPQTScjs.isVectorLiveBoolean.call(void 0, g))) {
|
|
5214
4898
|
const set = new Set(roots);
|
|
5215
4899
|
this.change(
|
|
5216
4900
|
label,
|
|
@@ -5261,8 +4945,8 @@ var VectorEditorController = (_class3 = class {
|
|
|
5261
4945
|
const paths = entries.map((e) => e.node);
|
|
5262
4946
|
const id = this.newId();
|
|
5263
4947
|
const first = _nullishCoalesce(roots.find((r) => this.holds(r, paths[0].id)), () => ( paths[0].id));
|
|
5264
|
-
const subpaths = entries.flatMap((e) =>
|
|
5265
|
-
const { transform: _t, effects: _e, booleanOperation: _b, ...baseRest } =
|
|
4948
|
+
const subpaths = entries.flatMap((e) => _chunkUTEVPQTScjs.bezierToSubpaths.call(void 0, this.intoParentSpace(first, _chunkUTEVPQTScjs.vectorPathWorldBezier.call(void 0, e.node, e.parent))));
|
|
4949
|
+
const { transform: _t, effects: _e, booleanOperation: _b, ...baseRest } = _chunkUTEVPQTScjs.cloneVectorNode.call(void 0, paths[0]);
|
|
5266
4950
|
const node = { ...baseRest, id, name: "Compound Path", subpaths };
|
|
5267
4951
|
const drop = /* @__PURE__ */ new Set([...paths.map((p) => p.id), ...roots]);
|
|
5268
4952
|
this.change("Combine", () => {
|
|
@@ -5274,7 +4958,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
5274
4958
|
}
|
|
5275
4959
|
/** A document-space path mapped into the parent space of node `id`. */
|
|
5276
4960
|
intoParentSpace(id, path) {
|
|
5277
|
-
const parent = _nullishCoalesce(
|
|
4961
|
+
const parent = _nullishCoalesce(_chunkUTEVPQTScjs.vectorParentMatrix.call(void 0, this.doc.nodes, id), () => ( _chunkDWGZUSEScjs.IDENTITY_MATRIX));
|
|
5278
4962
|
return isRoot(parent) ? path : _chunkXGD3FSNCcjs.transformBezierPath.call(void 0, path, _chunkDWGZUSEScjs.invertMatrix.call(void 0, parent));
|
|
5279
4963
|
}
|
|
5280
4964
|
/** Splits selected compound paths into one path per subpath. */
|
|
@@ -5320,7 +5004,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
5320
5004
|
const topRoot = _nullishCoalesce([...roots].reverse().find((r) => this.holds(r, last)), () => ( last));
|
|
5321
5005
|
const nodes = [];
|
|
5322
5006
|
for (const piece of result.pieces) {
|
|
5323
|
-
const subpaths =
|
|
5007
|
+
const subpaths = _chunkUTEVPQTScjs.bezierToSubpaths.call(void 0, this.intoParentSpace(topRoot, piece.path)).map((sp) => piece.open ? { ...sp, closed: false } : sp);
|
|
5324
5008
|
if (!subpaths.length) continue;
|
|
5325
5009
|
const source = entries[piece.source].node;
|
|
5326
5010
|
const style = vectorResultStyle(source, shapes[piece.source].paint, op === "outline");
|
|
@@ -5347,7 +5031,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
5347
5031
|
const out = /* @__PURE__ */ new Map();
|
|
5348
5032
|
for (const id of _nullishCoalesce(ids, () => ( this.selection))) {
|
|
5349
5033
|
const node = this.getNode(id);
|
|
5350
|
-
const group = isVectorBlendGroup(node) ? node : _optionalChain([
|
|
5034
|
+
const group = isVectorBlendGroup(node) ? node : _optionalChain([_chunkUTEVPQTScjs.locateVectorNode.call(void 0, this.doc.nodes, id), 'optionalAccess', _169 => _169.parent]);
|
|
5351
5035
|
if (isVectorBlendGroup(group)) out.set(group.id, group);
|
|
5352
5036
|
}
|
|
5353
5037
|
return [...out.values()];
|
|
@@ -5364,7 +5048,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
5364
5048
|
return !!n && !n.blendStep && !n.locked;
|
|
5365
5049
|
});
|
|
5366
5050
|
if (ids.length < 2) return null;
|
|
5367
|
-
const locs = ids.map((id2) =>
|
|
5051
|
+
const locs = ids.map((id2) => _chunkUTEVPQTScjs.locateVectorNode.call(void 0, this.doc.nodes, id2));
|
|
5368
5052
|
const parent = _nullishCoalesce(_optionalChain([locs, 'access', _170 => _170[0], 'access', _171 => _171.parent, 'optionalAccess', _172 => _172.id]), () => ( null));
|
|
5369
5053
|
if (locs.some((l) => (_nullishCoalesce(_optionalChain([l, 'access', _173 => _173.parent, 'optionalAccess', _174 => _174.id]), () => ( null))) !== parent)) return null;
|
|
5370
5054
|
const order = input.keepOrder ? ids : ids.slice().sort((a, b) => locs[ids.indexOf(a)].index - locs[ids.indexOf(b)].index);
|
|
@@ -5394,6 +5078,153 @@ var VectorEditorController = (_class3 = class {
|
|
|
5394
5078
|
});
|
|
5395
5079
|
return id;
|
|
5396
5080
|
}
|
|
5081
|
+
// -------------------------------------------------------------------------
|
|
5082
|
+
// Masks
|
|
5083
|
+
// -------------------------------------------------------------------------
|
|
5084
|
+
/**
|
|
5085
|
+
* Make Clipping Mask (`clip`) / Make Opacity Mask (`alpha`, `luminance`): groups the selected (or
|
|
5086
|
+
* given) objects into a mask group whose mask is the topmost of them (or `maskId`), moved to the
|
|
5087
|
+
* bottom of the group. They must be two or more, unlocked, with one parent. One undo step.
|
|
5088
|
+
* Returns the group's id, or why it could not.
|
|
5089
|
+
*/
|
|
5090
|
+
makeMask(type, options = {}) {
|
|
5091
|
+
if (!_chunkUTEVPQTScjs.isVectorMaskType.call(void 0, type)) return { ok: false, message: `Unknown mask type "${type}": use clip, alpha or luminance.` };
|
|
5092
|
+
const ids = [...new Set(_nullishCoalesce(options.ids, () => ( this.selectedRoots())))];
|
|
5093
|
+
if (ids.length < 2) return { ok: false, message: "Select at least two objects: the topmost becomes the mask, the ones below show through it." };
|
|
5094
|
+
for (const id2 of ids) {
|
|
5095
|
+
const n = this.getNode(id2);
|
|
5096
|
+
if (!n) return { ok: false, message: `There is no node "${id2}".` };
|
|
5097
|
+
if (n.locked) return { ok: false, message: `"${id2}" is locked; unlock it first.` };
|
|
5098
|
+
if (n.blendStep) return { ok: false, message: `"${id2}" is a blend step; select its blend instead.` };
|
|
5099
|
+
}
|
|
5100
|
+
const locs = ids.map((id2) => _chunkUTEVPQTScjs.locateVectorNode.call(void 0, this.doc.nodes, id2));
|
|
5101
|
+
const parent = _nullishCoalesce(_optionalChain([locs, 'access', _175 => _175[0], 'access', _176 => _176.parent, 'optionalAccess', _177 => _177.id]), () => ( null));
|
|
5102
|
+
if (locs.some((l) => (_nullishCoalesce(_optionalChain([l, 'access', _178 => _178.parent, 'optionalAccess', _179 => _179.id]), () => ( null))) !== parent)) return { ok: false, message: "The objects must share a parent (group them, or pick objects at one level)." };
|
|
5103
|
+
const order = ids.slice().sort((a, b) => locs[ids.indexOf(a)].index - locs[ids.indexOf(b)].index);
|
|
5104
|
+
const maskId = _nullishCoalesce(options.maskId, () => ( order[order.length - 1]));
|
|
5105
|
+
if (!order.includes(maskId)) return { ok: false, message: `The mask "${maskId}" must be one of the objects (${order.map((id2) => `"${id2}"`).join(", ")}).` };
|
|
5106
|
+
const id = this.newId();
|
|
5107
|
+
const mask = options.invert ? { type, invert: true } : { type };
|
|
5108
|
+
this.change(type === "clip" ? "Make Clipping Mask" : "Make Opacity Mask", () => {
|
|
5109
|
+
const set = new Set(order);
|
|
5110
|
+
const regroup = (list) => {
|
|
5111
|
+
const members = order.map((m) => list.find((n) => n.id === m));
|
|
5112
|
+
const top = Math.max(...members.map((m) => list.indexOf(m)));
|
|
5113
|
+
const children = [members.find((m) => m.id === maskId), ...members.filter((m) => m.id !== maskId)];
|
|
5114
|
+
const out = [];
|
|
5115
|
+
list.forEach((n, i) => {
|
|
5116
|
+
if (i === top) out.push({ id, type: "group", name: _nullishCoalesce(options.name, () => ( (type === "clip" ? "Clip Group" : "Opacity Mask"))), mask, children });
|
|
5117
|
+
if (!set.has(n.id)) out.push(n);
|
|
5118
|
+
});
|
|
5119
|
+
return out;
|
|
5120
|
+
};
|
|
5121
|
+
if (parent === null) this.setDoc(regroup(this.doc.nodes));
|
|
5122
|
+
else this.setDoc(mapTree(this.doc.nodes, (n) => n.id === parent && n.type === "group" ? { ...n, children: regroup(n.children) } : n));
|
|
5123
|
+
this.selection = [id];
|
|
5124
|
+
this.anchors = [];
|
|
5125
|
+
this.editingId = null;
|
|
5126
|
+
});
|
|
5127
|
+
return { ok: true, id };
|
|
5128
|
+
}
|
|
5129
|
+
/** Mask groups among `ids` (default: the selection), or holding one of them directly. */
|
|
5130
|
+
maskTargets(ids) {
|
|
5131
|
+
const out = /* @__PURE__ */ new Map();
|
|
5132
|
+
for (const id of _nullishCoalesce(ids, () => ( this.selection))) {
|
|
5133
|
+
const n = this.getNode(id);
|
|
5134
|
+
if (_chunkUTEVPQTScjs.isVectorMaskGroup.call(void 0, n)) out.set(n.id, n);
|
|
5135
|
+
else {
|
|
5136
|
+
const parent = _optionalChain([_chunkUTEVPQTScjs.locateVectorNode.call(void 0, this.doc.nodes, id), 'optionalAccess', _180 => _180.parent]);
|
|
5137
|
+
if (_chunkUTEVPQTScjs.isVectorMaskGroup.call(void 0, parent)) out.set(parent.id, parent);
|
|
5138
|
+
}
|
|
5139
|
+
}
|
|
5140
|
+
return [...out.values()];
|
|
5141
|
+
}
|
|
5142
|
+
/**
|
|
5143
|
+
* Release: the selected (or given) mask groups stop masking. The mask goes back on top of the
|
|
5144
|
+
* contents, drawn as itself again. A group with appearance of its own (filters, a blend mode,
|
|
5145
|
+
* path effects) stays a plain group; otherwise it is replaced by its children. One undo step.
|
|
5146
|
+
* Returns the released nodes' ids (the mask last).
|
|
5147
|
+
*/
|
|
5148
|
+
releaseMask(options = {}) {
|
|
5149
|
+
const groups = this.maskTargets(options.ids);
|
|
5150
|
+
if (!groups.length) return [];
|
|
5151
|
+
const released = [];
|
|
5152
|
+
this.change("Release Mask", () => {
|
|
5153
|
+
for (const g of groups) {
|
|
5154
|
+
const [mask, ...contents] = g.children;
|
|
5155
|
+
const children = [...contents, mask];
|
|
5156
|
+
released.push(...children.map((c) => c.id));
|
|
5157
|
+
const { mask: _m, ...rest } = g;
|
|
5158
|
+
const keep = !!(_optionalChain([g, 'access', _181 => _181.filters, 'optionalAccess', _182 => _182.length]) || g.blendMode && g.blendMode !== "normal" || _optionalChain([g, 'access', _183 => _183.effects, 'optionalAccess', _184 => _184.length]));
|
|
5159
|
+
if (keep) {
|
|
5160
|
+
this.replaceNode(g.id, { ...rest, children });
|
|
5161
|
+
continue;
|
|
5162
|
+
}
|
|
5163
|
+
const m = _chunkUTEVPQTScjs.nodeMatrix.call(void 0, g);
|
|
5164
|
+
const opacity = g.opacity;
|
|
5165
|
+
const flat = children.map((c) => g.transform ? _chunkUTEVPQTScjs.transformVectorNode.call(void 0, c, m) : c).map((c) => opacity !== void 0 && opacity < 1 ? { ...c, opacity: (_nullishCoalesce(c.opacity, () => ( 1))) * opacity } : c);
|
|
5166
|
+
this.setDoc(spliceTree(this.doc.nodes, g.id, flat));
|
|
5167
|
+
}
|
|
5168
|
+
this.selection = released;
|
|
5169
|
+
this.anchors = [];
|
|
5170
|
+
this.editingId = null;
|
|
5171
|
+
});
|
|
5172
|
+
return released;
|
|
5173
|
+
}
|
|
5174
|
+
/**
|
|
5175
|
+
* Changes the type or inversion of the selected (or given) mask groups, or turns their masks off
|
|
5176
|
+
* (`enabled: false` hides the mask, so the contents draw whole) and on. One undo step.
|
|
5177
|
+
*/
|
|
5178
|
+
setMaskOptions(patch, options = {}) {
|
|
5179
|
+
if (patch.type !== void 0 && !_chunkUTEVPQTScjs.isVectorMaskType.call(void 0, patch.type)) return { ok: false, message: `Unknown mask type "${patch.type}": use clip, alpha or luminance.` };
|
|
5180
|
+
if (patch.invert !== void 0 && typeof patch.invert !== "boolean") return { ok: false, message: "invert must be true or false." };
|
|
5181
|
+
if (patch.enabled !== void 0 && typeof patch.enabled !== "boolean") return { ok: false, message: "enabled must be true or false." };
|
|
5182
|
+
const groups = this.maskTargets(options.ids);
|
|
5183
|
+
if (!groups.length) return { ok: false, message: "Select a mask group (made with Make Clipping Mask or Make Opacity Mask)." };
|
|
5184
|
+
const set = new Set(groups.map((g) => g.id));
|
|
5185
|
+
this.change("Mask Options", () => {
|
|
5186
|
+
this.setDoc(
|
|
5187
|
+
mapTree(this.doc.nodes, (n) => {
|
|
5188
|
+
if (!set.has(n.id) || !_chunkUTEVPQTScjs.isVectorMaskGroup.call(void 0, n)) return n;
|
|
5189
|
+
const type = _nullishCoalesce(patch.type, () => ( n.mask.type));
|
|
5190
|
+
const invert = _nullishCoalesce(patch.invert, () => ( !!n.mask.invert));
|
|
5191
|
+
const [source, ...rest] = n.children;
|
|
5192
|
+
const shown = patch.enabled === void 0 || patch.enabled === (source.visible !== false) ? source : patch.enabled ? (({ visible: _v, ...r }) => r)(source) : { ...source, visible: false };
|
|
5193
|
+
return { ...n, mask: invert ? { type, invert } : { type }, ...shown !== source ? { children: [shown, ...rest] } : {} };
|
|
5194
|
+
})
|
|
5195
|
+
);
|
|
5196
|
+
});
|
|
5197
|
+
return { ok: true };
|
|
5198
|
+
}
|
|
5199
|
+
/**
|
|
5200
|
+
* Edit Mask: selects the mask of the selected (or given) mask group, or of the group holding the
|
|
5201
|
+
* selection. A path mask opens in the direct tool for anchor editing (`editPath: false` keeps the
|
|
5202
|
+
* tool). Returns the mask's id, or null.
|
|
5203
|
+
*/
|
|
5204
|
+
editMask(options = {}) {
|
|
5205
|
+
const group = this.maskTargets(options.id ? [options.id] : void 0)[0];
|
|
5206
|
+
if (!group) return null;
|
|
5207
|
+
const mask = group.children[0];
|
|
5208
|
+
this.selection = [mask.id];
|
|
5209
|
+
this.anchors = [];
|
|
5210
|
+
this.editingId = null;
|
|
5211
|
+
if (mask.type === "path" && options.editPath !== false && !mask.locked) {
|
|
5212
|
+
this.tool = "direct";
|
|
5213
|
+
this.editingId = mask.id;
|
|
5214
|
+
}
|
|
5215
|
+
this.notify();
|
|
5216
|
+
return mask.id;
|
|
5217
|
+
}
|
|
5218
|
+
/** Edit Contents: selects what the selected (or given) mask group masks. Returns their ids. */
|
|
5219
|
+
editMaskContents(options = {}) {
|
|
5220
|
+
const group = this.maskTargets(options.id ? [options.id] : void 0)[0];
|
|
5221
|
+
if (!group) return [];
|
|
5222
|
+
this.selection = group.children.slice(1).map((c) => c.id);
|
|
5223
|
+
this.anchors = [];
|
|
5224
|
+
this.editingId = null;
|
|
5225
|
+
this.notify();
|
|
5226
|
+
return [...this.selection];
|
|
5227
|
+
}
|
|
5397
5228
|
/** Sets the options new blends get (spacing, steps, distance, orientation, morph). */
|
|
5398
5229
|
setBlendDefaults(patch) {
|
|
5399
5230
|
this.blendDefaults = { ...this.blendDefaults, ...blendOptionsOf(patch) };
|
|
@@ -5408,13 +5239,13 @@ var VectorEditorController = (_class3 = class {
|
|
|
5408
5239
|
const node = this.getNode(nodeId);
|
|
5409
5240
|
if (!isVectorBlendGroup(group)) return { ok: false, message: `"${blendId}" is not a blend.` };
|
|
5410
5241
|
if (!node || node.blendStep || node.locked || node.id === blendId) return { ok: false, message: `"${nodeId}" cannot be a key.` };
|
|
5411
|
-
const parentOf = (id) => _nullishCoalesce(_optionalChain([
|
|
5242
|
+
const parentOf = (id) => _nullishCoalesce(_optionalChain([_chunkUTEVPQTScjs.locateVectorNode.call(void 0, this.doc.nodes, id), 'optionalAccess', _185 => _185.parent, 'optionalAccess', _186 => _186.id]), () => ( null));
|
|
5412
5243
|
if (parentOf(blendId) !== parentOf(nodeId)) return { ok: false, message: "The new key must sit beside the blend (same parent)." };
|
|
5413
5244
|
const start = options.start;
|
|
5414
5245
|
this.change("Blend", () => {
|
|
5415
5246
|
const blend = start !== null && start !== void 0 ? { ...group.blend, starts: { ...group.blend.starts, [nodeId]: start } } : group.blend;
|
|
5416
|
-
const m = _chunkDWGZUSEScjs.invertMatrix.call(void 0,
|
|
5417
|
-
const key = group.transform ?
|
|
5247
|
+
const m = _chunkDWGZUSEScjs.invertMatrix.call(void 0, _chunkUTEVPQTScjs.nodeMatrix.call(void 0, group));
|
|
5248
|
+
const key = group.transform ? _chunkUTEVPQTScjs.transformVectorNode.call(void 0, node, m) : node;
|
|
5418
5249
|
const without = mapTree(this.doc.nodes, (n) => n.id === nodeId ? null : n);
|
|
5419
5250
|
this.setDoc(spliceTree(without, blendId, [{ ...group, blend, children: [...group.children, key] }]));
|
|
5420
5251
|
this.selection = [blendId];
|
|
@@ -5440,7 +5271,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
5440
5271
|
if (!groups.length) return [];
|
|
5441
5272
|
const set = new Set(groups.map((g) => g.id));
|
|
5442
5273
|
const used = /* @__PURE__ */ new Set();
|
|
5443
|
-
|
|
5274
|
+
_chunkUTEVPQTScjs.walkVectorNodes.call(void 0, this.doc.nodes, (n) => used.add(n.id));
|
|
5444
5275
|
const fresh = () => {
|
|
5445
5276
|
let id = this.createId();
|
|
5446
5277
|
while (used.has(id)) id = this.createId();
|
|
@@ -5478,14 +5309,14 @@ var VectorEditorController = (_class3 = class {
|
|
|
5478
5309
|
replaceBlendSpine(options = {}) {
|
|
5479
5310
|
const roots = _nullishCoalesce(options.ids, () => ( this.selectedRoots()));
|
|
5480
5311
|
const groups = this.blendTargets(roots);
|
|
5481
|
-
const paths = roots.map((id) => this.getNode(id)).filter((n) => _optionalChain([n, 'optionalAccess',
|
|
5312
|
+
const paths = roots.map((id) => this.getNode(id)).filter((n) => _optionalChain([n, 'optionalAccess', _187 => _187.type]) === "path" && !n.blendStep && !isVectorBlendGroup(_optionalChain([_chunkUTEVPQTScjs.locateVectorNode.call(void 0, this.doc.nodes, n.id), 'optionalAccess', _188 => _188.parent])));
|
|
5482
5313
|
if (groups.length !== 1 || paths.length !== 1) return { ok: false, message: "Select one blend and one path to be its spine." };
|
|
5483
5314
|
const group = groups[0];
|
|
5484
5315
|
const path = paths[0];
|
|
5485
5316
|
const first = path.subpaths.find((sp) => sp.anchors.length >= 2);
|
|
5486
5317
|
if (!first) return { ok: false, message: "The spine needs a path with at least two points." };
|
|
5487
5318
|
const m = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, this.worldOf(path.id), _chunkDWGZUSEScjs.invertMatrix.call(void 0, this.worldOf(group.id)));
|
|
5488
|
-
const spine =
|
|
5319
|
+
const spine = _chunkUTEVPQTScjs.transformVectorNode.call(void 0, { id: "", type: "path", subpaths: [first] }, m).subpaths[0];
|
|
5489
5320
|
this.change("Replace Spine", () => {
|
|
5490
5321
|
const withSpine = { ...group, blend: { ...group.blend, spine } };
|
|
5491
5322
|
const targets = vectorBlendKeyTargets(withSpine);
|
|
@@ -5493,11 +5324,11 @@ var VectorEditorController = (_class3 = class {
|
|
|
5493
5324
|
const children = withSpine.children.map((c) => {
|
|
5494
5325
|
if (c.blendStep) return c;
|
|
5495
5326
|
const target = targets[k++];
|
|
5496
|
-
const b =
|
|
5327
|
+
const b = _chunkUTEVPQTScjs.vectorNodeBounds.call(void 0, c);
|
|
5497
5328
|
if (!target || !b) return c;
|
|
5498
5329
|
const dx = target[0] - (b.x + b.width / 2);
|
|
5499
5330
|
const dy = target[1] - (b.y + b.height / 2);
|
|
5500
|
-
return Math.hypot(dx, dy) > 1e-9 ?
|
|
5331
|
+
return Math.hypot(dx, dy) > 1e-9 ? _chunkUTEVPQTScjs.transformVectorNode.call(void 0, c, _chunkDWGZUSEScjs.translateMatrix.call(void 0, dx, dy)) : c;
|
|
5501
5332
|
});
|
|
5502
5333
|
this.setDoc(mapTree(this.doc.nodes, (n) => n.id === path.id ? null : n.id === group.id ? { ...withSpine, children } : n));
|
|
5503
5334
|
this.selection = [group.id];
|
|
@@ -5509,7 +5340,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
5509
5340
|
shapeBuilderMap(ids) {
|
|
5510
5341
|
const roots = _nullishCoalesce(ids, () => ( this.selectedRoots()));
|
|
5511
5342
|
const key = roots.join("\0");
|
|
5512
|
-
if (_optionalChain([this, 'access',
|
|
5343
|
+
if (_optionalChain([this, 'access', _189 => _189.builderCache, 'optionalAccess', _190 => _190.doc]) === this.doc && this.builderCache.key === key) return this.builderCache.map;
|
|
5513
5344
|
const entries = roots.length ? vectorPathEntries(this.doc, roots, { expand: false }) : [];
|
|
5514
5345
|
const map = entries.length ? vectorShapeBuilderMap(entries) : null;
|
|
5515
5346
|
this.builderCache = { doc: this.doc, key, map };
|
|
@@ -5565,15 +5396,15 @@ var VectorEditorController = (_class3 = class {
|
|
|
5565
5396
|
let nodes = this.doc.nodes;
|
|
5566
5397
|
m.entries.forEach((entry, i) => {
|
|
5567
5398
|
const node = entry.node;
|
|
5568
|
-
const toLocal = (path) => _chunkXGD3FSNCcjs.transformBezierPath.call(void 0, path, _chunkDWGZUSEScjs.invertMatrix.call(void 0, _chunkDWGZUSEScjs.multiplyMatrices.call(void 0,
|
|
5399
|
+
const toLocal = (path) => _chunkXGD3FSNCcjs.transformBezierPath.call(void 0, path, _chunkDWGZUSEScjs.invertMatrix.call(void 0, _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, _chunkUTEVPQTScjs.nodeMatrix.call(void 0, node), entry.parent)));
|
|
5569
5400
|
const list = [];
|
|
5570
5401
|
const r = plan.replace.get(i);
|
|
5571
5402
|
if (r === void 0) list.push(node);
|
|
5572
|
-
else if (_optionalChain([r, 'optionalAccess',
|
|
5573
|
-
else if (_optionalChain([r, 'optionalAccess',
|
|
5574
|
-
else if (_optionalChain([r, 'optionalAccess',
|
|
5403
|
+
else if (_optionalChain([r, 'optionalAccess', _191 => _191.kind]) === "fill") list.push({ ...node, fillRule: "nonzero", subpaths: _chunkUTEVPQTScjs.bezierToSubpaths.call(void 0, toLocal(r.path)) });
|
|
5404
|
+
else if (_optionalChain([r, 'optionalAccess', _192 => _192.kind]) === "outline") list.push({ ...node, subpaths: _chunkUTEVPQTScjs.bezierToSubpaths.call(void 0, toLocal(r.path)) });
|
|
5405
|
+
else if (_optionalChain([r, 'optionalAccess', _193 => _193.kind]) === "pieces") {
|
|
5575
5406
|
r.paths.forEach(
|
|
5576
|
-
(path, k) => list.push({ ...node, id: k === 0 ? node.id : this.newId(), subpaths:
|
|
5407
|
+
(path, k) => list.push({ ...node, id: k === 0 ? node.id : this.newId(), subpaths: _chunkUTEVPQTScjs.bezierToSubpaths.call(void 0, toLocal(path)).map((sp) => ({ ...sp, closed: false })) })
|
|
5577
5408
|
);
|
|
5578
5409
|
}
|
|
5579
5410
|
if (plan.merged && plan.merged.style === i) {
|
|
@@ -5584,9 +5415,9 @@ var VectorEditorController = (_class3 = class {
|
|
|
5584
5415
|
id: mergedId,
|
|
5585
5416
|
name: "Shape",
|
|
5586
5417
|
...node.transform ? { transform: node.transform } : {},
|
|
5587
|
-
subpaths:
|
|
5418
|
+
subpaths: _chunkUTEVPQTScjs.bezierToSubpaths.call(void 0, toLocal(plan.merged.path))
|
|
5588
5419
|
};
|
|
5589
|
-
if (plan.merged.currentFill || !
|
|
5420
|
+
if (plan.merged.currentFill || !_chunkUTEVPQTScjs.hasPaint.call(void 0, merged.fill)) merged.fill = _chunkUTEVPQTScjs.hasPaint.call(void 0, this.defaults.fill) ? this.defaults.fill : "#808080";
|
|
5590
5421
|
list.push(merged);
|
|
5591
5422
|
}
|
|
5592
5423
|
if (r === void 0 && list.length === 1) return;
|
|
@@ -5605,7 +5436,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
5605
5436
|
}
|
|
5606
5437
|
/** The paint bucket's map of the visible outlines, cached per document and gap. */
|
|
5607
5438
|
fillMap(gap) {
|
|
5608
|
-
if (_optionalChain([this, 'access',
|
|
5439
|
+
if (_optionalChain([this, 'access', _194 => _194.fillCache, 'optionalAccess', _195 => _195.doc]) === this.doc && this.fillCache.gap === gap) return this.fillCache.map;
|
|
5609
5440
|
const map = vectorFillMap(this.doc, gap);
|
|
5610
5441
|
this.fillCache = { doc: this.doc, gap, map };
|
|
5611
5442
|
return map;
|
|
@@ -5619,18 +5450,18 @@ var VectorEditorController = (_class3 = class {
|
|
|
5619
5450
|
*/
|
|
5620
5451
|
fillRegion(point, options = {}) {
|
|
5621
5452
|
if (!Number.isFinite(point.x) || !Number.isFinite(point.y)) return null;
|
|
5622
|
-
const region = _optionalChain([this, 'access',
|
|
5623
|
-
if (!_optionalChain([region, 'optionalAccess',
|
|
5453
|
+
const region = _optionalChain([this, 'access', _196 => _196.fillMap, 'call', _197 => _197(_nullishCoalesce(options.gap, () => ( this.editing.fillGap))), 'optionalAccess', _198 => _198.regionAt, 'call', _199 => _199([point.x, point.y])]);
|
|
5454
|
+
if (!_optionalChain([region, 'optionalAccess', _200 => _200.length])) return null;
|
|
5624
5455
|
let below = null;
|
|
5625
5456
|
const roots = new Set(this.selectedRoots());
|
|
5626
|
-
|
|
5457
|
+
_chunkUTEVPQTScjs.walkVectorNodes.call(void 0, this.doc.nodes, (n) => {
|
|
5627
5458
|
if (!below && roots.has(n.id)) below = n.id;
|
|
5628
5459
|
});
|
|
5629
|
-
const subpaths =
|
|
5460
|
+
const subpaths = _chunkUTEVPQTScjs.bezierToSubpaths.call(void 0, below ? this.intoParentSpace(below, region) : region);
|
|
5630
5461
|
if (!subpaths.length) return null;
|
|
5631
5462
|
const id = this.newId();
|
|
5632
5463
|
const node = { id, type: "path", name: "Fill", ...this.styleFor(false), stroke: null, fillRule: "nonzero", subpaths };
|
|
5633
|
-
if (!
|
|
5464
|
+
if (!_chunkUTEVPQTScjs.hasPaint.call(void 0, node.fill)) node.fill = "#808080";
|
|
5634
5465
|
const target = below;
|
|
5635
5466
|
this.change("Fill Region", () => {
|
|
5636
5467
|
if (target) {
|
|
@@ -5646,7 +5477,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
5646
5477
|
/** Updates the Shape Builder / paint bucket highlight for the pointer at `p`; true when it changed. */
|
|
5647
5478
|
hoverBuilder(p, alt) {
|
|
5648
5479
|
if (this.tool === "paintBucket") {
|
|
5649
|
-
const region = _nullishCoalesce(_optionalChain([this, 'access',
|
|
5480
|
+
const region = _nullishCoalesce(_optionalChain([this, 'access', _201 => _201.fillMap, 'call', _202 => _202(this.editing.fillGap), 'optionalAccess', _203 => _203.regionAt, 'call', _204 => _204([p.x, p.y])]), () => ( null));
|
|
5650
5481
|
const key2 = region ? _chunkXGD3FSNCcjs.bezierPathToSvg.call(void 0, region, { precision: 2 }) : null;
|
|
5651
5482
|
if (key2 === this.builderHoverKey) return false;
|
|
5652
5483
|
this.builderHoverKey = key2;
|
|
@@ -5735,7 +5566,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
5735
5566
|
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 }));
|
|
5736
5567
|
return this.updateAnchors(doc, refs, (a, ref) => {
|
|
5737
5568
|
const d = local.get(ref.nodeId);
|
|
5738
|
-
return
|
|
5569
|
+
return _chunkUTEVPQTScjs.translateAnchor.call(void 0, a, d.x, d.y);
|
|
5739
5570
|
});
|
|
5740
5571
|
}
|
|
5741
5572
|
/**
|
|
@@ -5753,8 +5584,8 @@ var VectorEditorController = (_class3 = class {
|
|
|
5753
5584
|
}
|
|
5754
5585
|
/** `doc` with anchor `ref` moved to document point `to` by a Curvature-tool move. */
|
|
5755
5586
|
curvatureMoved(doc, ref, to) {
|
|
5756
|
-
const node =
|
|
5757
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
5587
|
+
const node = _chunkUTEVPQTScjs.findVectorNode.call(void 0, doc.nodes, ref.nodeId);
|
|
5588
|
+
if (_optionalChain([node, 'optionalAccess', _205 => _205.type]) !== "path" || node.locked || !node.subpaths[ref.subpath]) return doc;
|
|
5758
5589
|
const q = this.toLocal(ref.nodeId, to, doc);
|
|
5759
5590
|
const subpaths = node.subpaths.map((sp, i) => i === ref.subpath ? curvatureMoveAnchor(sp, ref.index, q) : sp);
|
|
5760
5591
|
const nodes = mapTree(doc.nodes, (n) => n.id === ref.nodeId ? { ...node, subpaths } : n);
|
|
@@ -5762,8 +5593,8 @@ var VectorEditorController = (_class3 = class {
|
|
|
5762
5593
|
}
|
|
5763
5594
|
/** `doc` with segment `ref` bent through document point `p` at parameter `t`. */
|
|
5764
5595
|
bent(doc, ref, t, p) {
|
|
5765
|
-
const node =
|
|
5766
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
5596
|
+
const node = _chunkUTEVPQTScjs.findVectorNode.call(void 0, doc.nodes, ref.nodeId);
|
|
5597
|
+
if (_optionalChain([node, 'optionalAccess', _206 => _206.type]) !== "path" || node.locked || !node.subpaths[ref.subpath]) return doc;
|
|
5767
5598
|
const q = this.toLocal(ref.nodeId, p, doc);
|
|
5768
5599
|
const subpaths = node.subpaths.map((sp, i) => i === ref.subpath ? bendSegment(sp, ref.segment, t, q) : sp);
|
|
5769
5600
|
return { ...doc, nodes: mapTree(doc.nodes, (n) => n.id === ref.nodeId ? { ...node, subpaths } : n) };
|
|
@@ -5774,7 +5605,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
5774
5605
|
*/
|
|
5775
5606
|
bendSegment(ref, to, t = 0.5) {
|
|
5776
5607
|
const node = this.getNode(ref.nodeId);
|
|
5777
|
-
const sp = _optionalChain([node, 'optionalAccess',
|
|
5608
|
+
const sp = _optionalChain([node, 'optionalAccess', _207 => _207.type]) === "path" ? node.subpaths[ref.subpath] : void 0;
|
|
5778
5609
|
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." };
|
|
5779
5610
|
if (node.locked) return { ok: false, message: "The path is locked." };
|
|
5780
5611
|
this.change("Bend Segment", () => {
|
|
@@ -5787,7 +5618,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
5787
5618
|
if (!getAnchor(this.doc, ref)) return { ok: false, message: "There is no such anchor." };
|
|
5788
5619
|
const local = this.toLocal(ref.nodeId, to);
|
|
5789
5620
|
this.change("Move Handle", () => {
|
|
5790
|
-
this.doc = this.updateAnchors(this.doc, [ref], (a) =>
|
|
5621
|
+
this.doc = this.updateAnchors(this.doc, [ref], (a) => _chunkUTEVPQTScjs.moveAnchorHandle.call(void 0, a, ref.handle, local, options.breakHandles));
|
|
5791
5622
|
});
|
|
5792
5623
|
return { ok: true };
|
|
5793
5624
|
}
|
|
@@ -5799,7 +5630,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
5799
5630
|
if (n.type !== "path") return n;
|
|
5800
5631
|
const mine = refs.filter((r) => r.nodeId === n.id);
|
|
5801
5632
|
if (!mine.length) return n;
|
|
5802
|
-
const subpaths = n.subpaths.map((sp, s) => mine.filter((r) => r.subpath === s).reduce((acc, r) =>
|
|
5633
|
+
const subpaths = n.subpaths.map((sp, s) => mine.filter((r) => r.subpath === s).reduce((acc, r) => _chunkUTEVPQTScjs.convertAnchor.call(void 0, acc, r.index, type), sp));
|
|
5803
5634
|
return { ...n, subpaths };
|
|
5804
5635
|
});
|
|
5805
5636
|
this.setDoc(nodes);
|
|
@@ -5809,10 +5640,10 @@ var VectorEditorController = (_class3 = class {
|
|
|
5809
5640
|
/** Adds an anchor on the nearest segment of `nodeId` to document point `point` (shape unchanged). */
|
|
5810
5641
|
insertAnchorAt(nodeId, point) {
|
|
5811
5642
|
const node = this.getNode(nodeId);
|
|
5812
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
5813
|
-
const hit =
|
|
5643
|
+
if (_optionalChain([node, 'optionalAccess', _208 => _208.type]) !== "path") return null;
|
|
5644
|
+
const hit = _chunkUTEVPQTScjs.nearestSegment.call(void 0, node, this.toLocal(nodeId, point));
|
|
5814
5645
|
if (!hit) return null;
|
|
5815
|
-
const { subpath, index } =
|
|
5646
|
+
const { subpath, index } = _chunkUTEVPQTScjs.insertAnchor.call(void 0, node.subpaths[hit.subpath], hit.segment, hit.t);
|
|
5816
5647
|
const ref = { nodeId, subpath: hit.subpath, index };
|
|
5817
5648
|
this.change("Add Point", () => {
|
|
5818
5649
|
this.replaceNode(nodeId, { ...node, subpaths: node.subpaths.map((sp, i) => i === hit.subpath ? subpath : sp) });
|
|
@@ -5837,7 +5668,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
5837
5668
|
const subpaths = n.subpaths.map((sp, s) => {
|
|
5838
5669
|
const indices = mine.filter((r) => r.subpath === s).map((r) => r.index);
|
|
5839
5670
|
if (!indices.length) return sp;
|
|
5840
|
-
return keepShape ? removeAnchorsKeepingShape(sp, indices) :
|
|
5671
|
+
return keepShape ? removeAnchorsKeepingShape(sp, indices) : _chunkUTEVPQTScjs.removeAnchors.call(void 0, sp, indices);
|
|
5841
5672
|
}).filter((sp) => sp.anchors.length > 1);
|
|
5842
5673
|
return subpaths.length ? { ...n, subpaths } : null;
|
|
5843
5674
|
});
|
|
@@ -5853,7 +5684,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
5853
5684
|
setClosed(closed, nodeId) {
|
|
5854
5685
|
const targets = nodeId ? (() => {
|
|
5855
5686
|
const n = this.getNode(nodeId);
|
|
5856
|
-
return _optionalChain([n, 'optionalAccess',
|
|
5687
|
+
return _optionalChain([n, 'optionalAccess', _209 => _209.type]) === "path" ? n.subpaths.map((_, s) => ({ nodeId, subpath: s })) : [];
|
|
5857
5688
|
})() : this.anchors.map((r) => ({ nodeId: r.nodeId, subpath: r.subpath }));
|
|
5858
5689
|
if (!targets.length) return { ok: false, message: "Select a path or points." };
|
|
5859
5690
|
this.change(closed ? "Close Path" : "Open Path", () => {
|
|
@@ -5868,13 +5699,13 @@ var VectorEditorController = (_class3 = class {
|
|
|
5868
5699
|
}
|
|
5869
5700
|
/** Reverses the direction of every subpath of the selected paths. */
|
|
5870
5701
|
reversePaths(ids = this.selection) {
|
|
5871
|
-
const set = new Set(ids.flatMap((id) => this.getNode(id) ?
|
|
5702
|
+
const set = new Set(ids.flatMap((id) => this.getNode(id) ? _chunkUTEVPQTScjs.collectPathNodes.call(void 0, this.getNode(id)) : []).map((p) => p.id));
|
|
5872
5703
|
if (!set.size) return { ok: false, message: "Select a path." };
|
|
5873
5704
|
this.change("Reverse Path", () => {
|
|
5874
5705
|
this.setDoc(
|
|
5875
5706
|
mapTree(
|
|
5876
5707
|
this.doc.nodes,
|
|
5877
|
-
(n) => n.type === "path" && set.has(n.id) ? { ...n, subpaths: n.subpaths.map(
|
|
5708
|
+
(n) => n.type === "path" && set.has(n.id) ? { ...n, subpaths: n.subpaths.map(_chunkUTEVPQTScjs.reverseSubpath), ..._optionalChain([n, 'access', _210 => _210.strokeWidthProfile, 'optionalAccess', _211 => _211.length]) ? { strokeWidthProfile: _chunkUTEVPQTScjs.reverseWidthProfile.call(void 0, n.strokeWidthProfile) } : {} } : n
|
|
5878
5709
|
)
|
|
5879
5710
|
);
|
|
5880
5711
|
this.anchors = [];
|
|
@@ -5891,11 +5722,11 @@ var VectorEditorController = (_class3 = class {
|
|
|
5891
5722
|
for (const id of roots) {
|
|
5892
5723
|
const node = this.getNode(id);
|
|
5893
5724
|
if (node && !node.locked) {
|
|
5894
|
-
for (const p of
|
|
5725
|
+
for (const p of _chunkUTEVPQTScjs.collectPathNodes.call(void 0, node)) if (!p.locked) out.set(p.id, p);
|
|
5895
5726
|
}
|
|
5896
5727
|
}
|
|
5897
5728
|
const order = [];
|
|
5898
|
-
|
|
5729
|
+
_chunkUTEVPQTScjs.walkVectorNodes.call(void 0, this.doc.nodes, (n) => {
|
|
5899
5730
|
if (out.has(n.id)) order.push(n.id);
|
|
5900
5731
|
});
|
|
5901
5732
|
return order.map((id) => out.get(id));
|
|
@@ -6012,17 +5843,17 @@ var VectorEditorController = (_class3 = class {
|
|
|
6012
5843
|
*/
|
|
6013
5844
|
cutPathAt(nodeId, point) {
|
|
6014
5845
|
const node = this.getNode(nodeId);
|
|
6015
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
5846
|
+
if (_optionalChain([node, 'optionalAccess', _212 => _212.type]) !== "path" || node.locked) return null;
|
|
6016
5847
|
const local = this.toLocal(nodeId, point);
|
|
6017
|
-
const hit =
|
|
5848
|
+
const hit = _chunkUTEVPQTScjs.nearestSegment.call(void 0, node, local);
|
|
6018
5849
|
if (!hit) return null;
|
|
6019
5850
|
const sp = node.subpaths[hit.subpath];
|
|
6020
5851
|
const n = sp.anchors.length;
|
|
6021
|
-
const
|
|
6022
|
-
if (!sp.closed && n > 1 && (
|
|
5852
|
+
const near = [hit.segment, (hit.segment + 1) % n].find((i) => Math.hypot(sp.anchors[i].x - hit.point.x, sp.anchors[i].y - hit.point.y) <= this.tolerance());
|
|
5853
|
+
if (!sp.closed && n > 1 && (near === 0 || near === n - 1) && !(hit.t > 1e-6 && hit.t < 1 - 1e-6)) return null;
|
|
6023
5854
|
let ids = null;
|
|
6024
5855
|
this.change("Cut Path", () => {
|
|
6025
|
-
ids = this.applyCuts(node, (s, i) => i !== hit.subpath ? null :
|
|
5856
|
+
ids = this.applyCuts(node, (s, i) => i !== hit.subpath ? null : near !== void 0 ? cutSubpathAt(s, [near]) : splitSubpathAt(s, hit.segment, hit.t));
|
|
6026
5857
|
if (ids) {
|
|
6027
5858
|
this.selection = ids;
|
|
6028
5859
|
this.anchors = [];
|
|
@@ -6058,18 +5889,18 @@ var VectorEditorController = (_class3 = class {
|
|
|
6058
5889
|
/** Visible, unlocked paths a stroke over `points` can reach: in `ids`, the selection, or (with neither) any whose bounds it crosses. */
|
|
6059
5890
|
strokeTargets(points, ids, pad) {
|
|
6060
5891
|
const blocked = /* @__PURE__ */ new Set();
|
|
6061
|
-
|
|
5892
|
+
_chunkUTEVPQTScjs.walkVectorNodes.call(void 0, this.doc.nodes, (n, parent) => {
|
|
6062
5893
|
if (n.visible === false || n.locked || parent && blocked.has(parent.id)) blocked.add(n.id);
|
|
6063
5894
|
});
|
|
6064
5895
|
const visible = (p) => !blocked.has(p.id);
|
|
6065
|
-
if (_optionalChain([ids, 'optionalAccess',
|
|
6066
|
-
const box = polylineBounds(points.map(toPoint2), pad);
|
|
5896
|
+
if (_optionalChain([ids, 'optionalAccess', _213 => _213.length]) || this.selection.length) return this.pathTargets(_nullishCoalesce(ids, () => ( this.selection))).filter(visible);
|
|
5897
|
+
const box = _chunkUTEVPQTScjs.polylineBounds.call(void 0, points.map(toPoint2), pad);
|
|
6067
5898
|
if (!box) return [];
|
|
6068
5899
|
const out = [];
|
|
6069
|
-
|
|
5900
|
+
_chunkUTEVPQTScjs.walkVectorNodes.call(void 0, this.doc.nodes, (n) => {
|
|
6070
5901
|
if (n.type !== "path" || !visible(n)) return;
|
|
6071
|
-
const b =
|
|
6072
|
-
if (b &&
|
|
5902
|
+
const b = _chunkUTEVPQTScjs.vectorNodeBounds.call(void 0, n, _nullishCoalesce(_chunkUTEVPQTScjs.vectorParentMatrix.call(void 0, this.doc.nodes, n.id), () => ( _chunkDWGZUSEScjs.IDENTITY_MATRIX)));
|
|
5903
|
+
if (b && _chunkUTEVPQTScjs.boundsIntersect.call(void 0, b, box)) out.push(n);
|
|
6073
5904
|
});
|
|
6074
5905
|
return out;
|
|
6075
5906
|
}
|
|
@@ -6085,14 +5916,14 @@ var VectorEditorController = (_class3 = class {
|
|
|
6085
5916
|
* when nothing was cut).
|
|
6086
5917
|
*/
|
|
6087
5918
|
knife(points, options = {}) {
|
|
6088
|
-
const pts = simplifyPolyline(points.map(toPoint2), 0.25 / this.viewport.zoom).map(([x, y]) => ({ x, y }));
|
|
5919
|
+
const pts = _chunkUTEVPQTScjs.simplifyPolyline.call(void 0, points.map(toPoint2), 0.25 / this.viewport.zoom).map(([x, y]) => ({ x, y }));
|
|
6089
5920
|
if (pts.length < 2) return [];
|
|
6090
5921
|
const plan = [];
|
|
6091
5922
|
for (const node of this.strokeTargets(pts, options.ids, 0)) {
|
|
6092
5923
|
const closed = node.subpaths.filter((sp) => sp.anchors.length > 1);
|
|
6093
5924
|
if (!closed.length || closed.some((sp) => !sp.closed)) continue;
|
|
6094
|
-
const result = knifePath(
|
|
6095
|
-
if (result) plan.push({ node, pieces: result.map((path) =>
|
|
5925
|
+
const result = _chunkUTEVPQTScjs.knifePath.call(void 0, _chunkUTEVPQTScjs.subpathsToBezier.call(void 0, closed), _nullishCoalesce(node.fillRule, () => ( "nonzero")), this.localPoints(node.id, pts));
|
|
5926
|
+
if (result) plan.push({ node, pieces: result.map((path) => _chunkUTEVPQTScjs.bezierToSubpaths.call(void 0, path)) });
|
|
6096
5927
|
}
|
|
6097
5928
|
if (!plan.length) return [];
|
|
6098
5929
|
const created = [];
|
|
@@ -6114,8 +5945,8 @@ var VectorEditorController = (_class3 = class {
|
|
|
6114
5945
|
erase(points, options = {}) {
|
|
6115
5946
|
const width = _nullishCoalesce(options.size, () => ( this.editing.eraserSize));
|
|
6116
5947
|
if (!(width > 0) || !points.length) return [];
|
|
6117
|
-
const pts = simplifyPolyline(points.map(toPoint2), Math.min(width * 0.05, 0.25 / this.viewport.zoom));
|
|
6118
|
-
const region = eraserRegion(pts, width);
|
|
5948
|
+
const pts = _chunkUTEVPQTScjs.simplifyPolyline.call(void 0, points.map(toPoint2), Math.min(width * 0.05, 0.25 / this.viewport.zoom));
|
|
5949
|
+
const region = _chunkUTEVPQTScjs.eraserRegion.call(void 0, pts, width);
|
|
6119
5950
|
if (!region.length) return [];
|
|
6120
5951
|
const plan = [];
|
|
6121
5952
|
const rb = _chunkXGD3FSNCcjs.bezierPathBounds.call(void 0, region);
|
|
@@ -6124,12 +5955,12 @@ var VectorEditorController = (_class3 = class {
|
|
|
6124
5955
|
const local = _chunkXGD3FSNCcjs.transformBezierPath.call(void 0, region, _chunkDWGZUSEScjs.invertMatrix.call(void 0, this.worldOf(node.id)));
|
|
6125
5956
|
const live = node.subpaths.filter((sp) => sp.anchors.length > 1);
|
|
6126
5957
|
if (!live.length) continue;
|
|
6127
|
-
if (
|
|
6128
|
-
const faces = eraseFromFill(
|
|
6129
|
-
if (faces) plan.push({ node, pieces: faces.map((f) =>
|
|
5958
|
+
if (_chunkUTEVPQTScjs.hasPaint.call(void 0, node.fill) && live.every((sp) => sp.closed)) {
|
|
5959
|
+
const faces = _chunkUTEVPQTScjs.eraseFromFill.call(void 0, _chunkUTEVPQTScjs.subpathsToBezier.call(void 0, live), _nullishCoalesce(node.fillRule, () => ( "nonzero")), local);
|
|
5960
|
+
if (faces) plan.push({ node, pieces: faces.map((f) => _chunkUTEVPQTScjs.bezierToSubpaths.call(void 0, f)) });
|
|
6130
5961
|
continue;
|
|
6131
5962
|
}
|
|
6132
|
-
const results = live.map((sp) => eraseFromOutline(sp, local));
|
|
5963
|
+
const results = live.map((sp) => _chunkUTEVPQTScjs.eraseFromOutline.call(void 0, sp, local));
|
|
6133
5964
|
if (results.every((r) => !r)) continue;
|
|
6134
5965
|
const subpaths = live.flatMap((sp, i) => _nullishCoalesce(results[i], () => ( [sp])));
|
|
6135
5966
|
plan.push({ node, pieces: live.length === 1 ? subpaths.map((sp) => [sp]) : [subpaths] });
|
|
@@ -6148,7 +5979,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
6148
5979
|
finishPath() {
|
|
6149
5980
|
if (!this.pen) return;
|
|
6150
5981
|
const node = this.getNode(this.pen.nodeId);
|
|
6151
|
-
const sp = _optionalChain([node, 'optionalAccess',
|
|
5982
|
+
const sp = _optionalChain([node, 'optionalAccess', _214 => _214.subpaths, 'access', _215 => _215[this.pen.subpath]]);
|
|
6152
5983
|
const pen = this.pen;
|
|
6153
5984
|
this.pen = null;
|
|
6154
5985
|
this.pointer = null;
|
|
@@ -6171,7 +6002,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
6171
6002
|
// -------------------------------------------------------------------------
|
|
6172
6003
|
/** Copies the selection. Returns JSON text for the system clipboard (or null). */
|
|
6173
6004
|
copy() {
|
|
6174
|
-
const nodes = this.selectedRoots().map((id) => this.getNode(id)).filter((n) => !!n).map((n) =>
|
|
6005
|
+
const nodes = this.selectedRoots().map((id) => this.getNode(id)).filter((n) => !!n).map((n) => _chunkUTEVPQTScjs.cloneVectorNode.call(void 0, n));
|
|
6175
6006
|
if (!nodes.length) return null;
|
|
6176
6007
|
this.clipboard = nodes;
|
|
6177
6008
|
return JSON.stringify({ type: VECTOR_CLIPBOARD_TYPE, nodes });
|
|
@@ -6192,27 +6023,27 @@ var VectorEditorController = (_class3 = class {
|
|
|
6192
6023
|
if (trimmed.startsWith("{")) {
|
|
6193
6024
|
try {
|
|
6194
6025
|
const data = JSON.parse(trimmed);
|
|
6195
|
-
if (_optionalChain([data, 'optionalAccess',
|
|
6026
|
+
if (_optionalChain([data, 'optionalAccess', _216 => _216.type]) === VECTOR_CLIPBOARD_TYPE && Array.isArray(data.nodes)) nodes = data.nodes;
|
|
6196
6027
|
} catch (e3) {
|
|
6197
6028
|
nodes = null;
|
|
6198
6029
|
}
|
|
6199
6030
|
} else if (/<svg[\s>]/i.test(trimmed)) {
|
|
6200
6031
|
try {
|
|
6201
|
-
nodes =
|
|
6032
|
+
nodes = _chunkUTEVPQTScjs.parseVectorSvg.call(void 0, trimmed).nodes;
|
|
6202
6033
|
} catch (e4) {
|
|
6203
6034
|
nodes = null;
|
|
6204
6035
|
}
|
|
6205
6036
|
}
|
|
6206
6037
|
} else nodes = this.clipboard;
|
|
6207
|
-
if (!_optionalChain([nodes, 'optionalAccess',
|
|
6038
|
+
if (!_optionalChain([nodes, 'optionalAccess', _217 => _217.length])) return [];
|
|
6208
6039
|
const offset = _nullishCoalesce(options.offset, () => ( (text && !text.trim().startsWith("{") ? { x: 0, y: 0 } : { x: 10, y: 10 })));
|
|
6209
|
-
const copies = nodes.map((n) =>
|
|
6040
|
+
const copies = nodes.map((n) => _chunkUTEVPQTScjs.transformVectorNode.call(void 0, this.freshIds(n), _chunkDWGZUSEScjs.translateMatrix.call(void 0, offset.x, offset.y)));
|
|
6210
6041
|
this.change("Paste", () => {
|
|
6211
6042
|
this.setDoc([...this.doc.nodes, ...copies]);
|
|
6212
6043
|
this.selection = copies.map((n) => n.id);
|
|
6213
6044
|
this.anchors = [];
|
|
6214
6045
|
});
|
|
6215
|
-
if (!text) this.clipboard = copies.map((n) =>
|
|
6046
|
+
if (!text) this.clipboard = copies.map((n) => _chunkUTEVPQTScjs.cloneVectorNode.call(void 0, n));
|
|
6216
6047
|
return copies.map((n) => n.id);
|
|
6217
6048
|
}
|
|
6218
6049
|
// -------------------------------------------------------------------------
|
|
@@ -6255,7 +6086,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
6255
6086
|
hitHandle(screen) {
|
|
6256
6087
|
for (const ref of getVisibleHandles(this.view()).reverse()) {
|
|
6257
6088
|
const a = getAnchorWorld(this.doc, ref);
|
|
6258
|
-
const h = _optionalChain([a, 'optionalAccess',
|
|
6089
|
+
const h = _optionalChain([a, 'optionalAccess', _218 => _218[ref.handle]]);
|
|
6259
6090
|
if (!h) continue;
|
|
6260
6091
|
const s = this.documentToScreen(h);
|
|
6261
6092
|
if (Math.hypot(s.x - screen.x, s.y - screen.y) <= this.hitRadius) return ref;
|
|
@@ -6296,7 +6127,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
6296
6127
|
/** Deepest unlocked visible path under `p`. */
|
|
6297
6128
|
/** Live groups being edited (selected, or holding the selection or the edited path): their children are hit as stored. */
|
|
6298
6129
|
enteredGroups() {
|
|
6299
|
-
return
|
|
6130
|
+
return _chunkUTEVPQTScjs.vectorEnteredGroups.call(void 0, this.doc.nodes, this.editingId ? [...this.selection, this.editingId] : this.selection);
|
|
6300
6131
|
}
|
|
6301
6132
|
hitPath(p) {
|
|
6302
6133
|
const tol = this.tolerance();
|
|
@@ -6306,10 +6137,10 @@ var VectorEditorController = (_class3 = class {
|
|
|
6306
6137
|
const n = list[i];
|
|
6307
6138
|
if (n.visible === false || n.locked) continue;
|
|
6308
6139
|
if (n.type === "group") {
|
|
6309
|
-
if (
|
|
6310
|
-
const found = search(n.children, _chunkDWGZUSEScjs.multiplyMatrices.call(void 0,
|
|
6140
|
+
if ((_chunkUTEVPQTScjs.hasOwnVectorAppearance.call(void 0, n) || _chunkUTEVPQTScjs.isVectorMaskActive.call(void 0, n)) && !entered.has(n.id) && !_chunkUTEVPQTScjs.hitTestVectorNode.call(void 0, n, p, tol, parent, { entered })) continue;
|
|
6141
|
+
const found = search(n.children, _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, _chunkUTEVPQTScjs.nodeMatrix.call(void 0, n), parent));
|
|
6311
6142
|
if (found) return found;
|
|
6312
|
-
} else if (
|
|
6143
|
+
} else if (_chunkUTEVPQTScjs.hitTestVectorNode.call(void 0, n, p, tol, parent, { entered })) return n;
|
|
6313
6144
|
}
|
|
6314
6145
|
return null;
|
|
6315
6146
|
};
|
|
@@ -6318,7 +6149,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
6318
6149
|
/** Endpoints of open subpaths of unlocked visible paths (pen tool resumes from them). */
|
|
6319
6150
|
openEndpoints() {
|
|
6320
6151
|
const out = [];
|
|
6321
|
-
|
|
6152
|
+
_chunkUTEVPQTScjs.walkVectorNodes.call(void 0, this.doc.nodes, (n) => {
|
|
6322
6153
|
if (n.type !== "path" || n.locked || n.visible === false) return;
|
|
6323
6154
|
n.subpaths.forEach((sp, s) => {
|
|
6324
6155
|
if (sp.closed || sp.anchors.length < 1) return;
|
|
@@ -6334,7 +6165,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
6334
6165
|
case "select": {
|
|
6335
6166
|
const handle = this.hitTransformHandle(screen);
|
|
6336
6167
|
if (handle) return { nodeId: null, transformHandle: handle };
|
|
6337
|
-
const node =
|
|
6168
|
+
const node = _chunkUTEVPQTScjs.hitTestVectorNodes.call(void 0, this.doc.nodes, p, this.tolerance(), { entered: this.enteredGroups() });
|
|
6338
6169
|
return node ? { nodeId: node.id } : null;
|
|
6339
6170
|
}
|
|
6340
6171
|
case "direct": {
|
|
@@ -6346,7 +6177,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
6346
6177
|
if (widget) return { nodeId: widget.ref.nodeId, corner: widget.ref };
|
|
6347
6178
|
for (const id of getEditablePathIds(this.view())) {
|
|
6348
6179
|
const node = this.getNode(id);
|
|
6349
|
-
const seg =
|
|
6180
|
+
const seg = _chunkUTEVPQTScjs.nearestSegment.call(void 0, node, this.toLocal(id, p));
|
|
6350
6181
|
if (seg && seg.distance <= this.tolerance()) {
|
|
6351
6182
|
const point = _chunkDWGZUSEScjs.applyMatrix.call(void 0, this.worldOf(id), seg.point);
|
|
6352
6183
|
return { nodeId: id, segment: { nodeId: id, subpath: seg.subpath, segment: seg.segment, t: seg.t, point } };
|
|
@@ -6385,7 +6216,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
6385
6216
|
case "envelope": {
|
|
6386
6217
|
const hit = this.hitEnvelope(screen, p);
|
|
6387
6218
|
if (hit) return { nodeId: hit.target.node.id, envelope: { nodeId: hit.target.node.id, index: hit.index } };
|
|
6388
|
-
const node =
|
|
6219
|
+
const node = _chunkUTEVPQTScjs.hitTestVectorNodes.call(void 0, this.doc.nodes, p, this.tolerance(), { entered: this.enteredGroups() });
|
|
6389
6220
|
return node ? { nodeId: node.id } : null;
|
|
6390
6221
|
}
|
|
6391
6222
|
default:
|
|
@@ -6400,7 +6231,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
6400
6231
|
const shown = this.hitWidthHandleIn(screen, this.widthView());
|
|
6401
6232
|
if (shown) return shown;
|
|
6402
6233
|
const spot = this.strokeSpotAt(this.screenToDocument(screen));
|
|
6403
|
-
return spot && spot.nodeId !== _optionalChain([this, 'access',
|
|
6234
|
+
return spot && spot.nodeId !== _optionalChain([this, 'access', _219 => _219.hover, 'optionalAccess', _220 => _220.nodeId]) ? this.hitWidthHandleIn(screen, { ...this.widthView(), hover: { nodeId: spot.nodeId } }) : null;
|
|
6404
6235
|
}
|
|
6405
6236
|
hitWidthHandleIn(screen, view) {
|
|
6406
6237
|
let best = null;
|
|
@@ -6421,31 +6252,31 @@ var VectorEditorController = (_class3 = class {
|
|
|
6421
6252
|
strokeSpotAt(p) {
|
|
6422
6253
|
let best = null;
|
|
6423
6254
|
const tol = this.tolerance();
|
|
6424
|
-
|
|
6255
|
+
_chunkUTEVPQTScjs.walkVectorNodes.call(void 0, this.doc.nodes, (n) => {
|
|
6425
6256
|
if (n.type !== "path" || n.visible === false || n.locked) return;
|
|
6426
6257
|
if (hiddenOrLocked(this.doc.nodes, n.id)) return;
|
|
6427
6258
|
const g = vectorStrokeWidthGeometry(n);
|
|
6428
6259
|
if (!g) return;
|
|
6429
6260
|
const m = this.worldOf(n.id);
|
|
6430
6261
|
const local = _chunkDWGZUSEScjs.applyMatrix.call(void 0, _chunkDWGZUSEScjs.invertMatrix.call(void 0, m), p);
|
|
6431
|
-
const
|
|
6432
|
-
if (!
|
|
6433
|
-
const profile =
|
|
6434
|
-
const w =
|
|
6435
|
-
const reach = Math.max(
|
|
6436
|
-
if (
|
|
6437
|
-
if (best &&
|
|
6438
|
-
const nx =
|
|
6439
|
-
const ny = -
|
|
6440
|
-
const [cx, cy] =
|
|
6262
|
+
const near = _chunkUTEVPQTScjs.nearestStrokePosition.call(void 0, g.line, [local.x, local.y]);
|
|
6263
|
+
if (!near) return;
|
|
6264
|
+
const profile = _chunkUTEVPQTScjs.strokeWidthProfileOf.call(void 0, n);
|
|
6265
|
+
const w = _chunkUTEVPQTScjs.widthProfileAt.call(void 0, profile, near.t);
|
|
6266
|
+
const reach = Math.max(near.side === "left" ? w.left : w.right, 0) * g.unit + tol;
|
|
6267
|
+
if (near.distance > reach || near.distance > _chunkUTEVPQTScjs.widthProfileMaxScale.call(void 0, profile) * g.unit + tol) return;
|
|
6268
|
+
if (best && near.distance >= best.distance) return;
|
|
6269
|
+
const nx = near.tangent[1];
|
|
6270
|
+
const ny = -near.tangent[0];
|
|
6271
|
+
const [cx, cy] = near.point;
|
|
6441
6272
|
best = {
|
|
6442
6273
|
nodeId: n.id,
|
|
6443
|
-
subpath:
|
|
6444
|
-
t:
|
|
6274
|
+
subpath: near.contour,
|
|
6275
|
+
t: near.t,
|
|
6445
6276
|
point: _chunkDWGZUSEScjs.applyMatrix.call(void 0, m, { x: cx, y: cy }),
|
|
6446
6277
|
left: _chunkDWGZUSEScjs.applyMatrix.call(void 0, m, { x: cx + nx * w.left * g.unit, y: cy + ny * w.left * g.unit }),
|
|
6447
6278
|
right: _chunkDWGZUSEScjs.applyMatrix.call(void 0, m, { x: cx - nx * w.right * g.unit, y: cy - ny * w.right * g.unit }),
|
|
6448
|
-
distance:
|
|
6279
|
+
distance: near.distance
|
|
6449
6280
|
};
|
|
6450
6281
|
});
|
|
6451
6282
|
if (!best) return null;
|
|
@@ -6455,9 +6286,9 @@ var VectorEditorController = (_class3 = class {
|
|
|
6455
6286
|
downWidth(screen, p, input) {
|
|
6456
6287
|
const hit = this.hitWidthHandle(screen);
|
|
6457
6288
|
const spot = hit ? null : this.strokeSpotAt(p);
|
|
6458
|
-
const nodeId = _nullishCoalesce(_optionalChain([hit, 'optionalAccess',
|
|
6289
|
+
const nodeId = _nullishCoalesce(_optionalChain([hit, 'optionalAccess', _221 => _221.ref, 'access', _222 => _222.nodeId]), () => ( _optionalChain([spot, 'optionalAccess', _223 => _223.nodeId])));
|
|
6459
6290
|
const node = nodeId ? this.getNode(nodeId) : void 0;
|
|
6460
|
-
const g = _optionalChain([node, 'optionalAccess',
|
|
6291
|
+
const g = _optionalChain([node, 'optionalAccess', _224 => _224.type]) === "path" ? vectorStrokeWidthGeometry(node) : null;
|
|
6461
6292
|
if (this.widthEdit) this.widthEdit = null;
|
|
6462
6293
|
if (!node || node.type !== "path" || !g) {
|
|
6463
6294
|
if (!input.shift) this.widthPoints = [];
|
|
@@ -6475,11 +6306,11 @@ var VectorEditorController = (_class3 = class {
|
|
|
6475
6306
|
let t;
|
|
6476
6307
|
let subpath;
|
|
6477
6308
|
if (hit) {
|
|
6478
|
-
profile =
|
|
6309
|
+
profile = _chunkUTEVPQTScjs.sanitizeWidthProfile.call(void 0, node.strokeWidthProfile);
|
|
6479
6310
|
ref = { nodeId: node.id, index: hit.ref.index, subpath: hit.ref.subpath };
|
|
6480
|
-
t = _nullishCoalesce(_optionalChain([profile, 'access',
|
|
6311
|
+
t = _nullishCoalesce(_optionalChain([profile, 'access', _225 => _225[ref.index], 'optionalAccess', _226 => _226.t]), () => ( 0));
|
|
6481
6312
|
subpath = hit.ref.subpath;
|
|
6482
|
-
if (hit.ref.part === "center") mode = input.alt && profile.length <
|
|
6313
|
+
if (hit.ref.part === "center") mode = input.alt && profile.length < _chunkUTEVPQTScjs.VECTOR_WIDTH_PROFILE_MAX_POINTS ? "copy" : "move";
|
|
6483
6314
|
else if (input.alt) side = hit.ref.part;
|
|
6484
6315
|
const same = this.widthPoints.length > 0 && this.widthPoints[0].nodeId === node.id;
|
|
6485
6316
|
const selected = same && this.widthPoints.some((r) => r.index === ref.index);
|
|
@@ -6494,16 +6325,16 @@ var VectorEditorController = (_class3 = class {
|
|
|
6494
6325
|
} else if (mode === "copy" || !selected) this.widthPoints = [ref];
|
|
6495
6326
|
if (mode !== "copy") group = this.widthPoints.filter((r) => r.index !== ref.index).map((r) => r.index);
|
|
6496
6327
|
} else {
|
|
6497
|
-
const
|
|
6498
|
-
const inserted =
|
|
6328
|
+
const near = _chunkUTEVPQTScjs.nearestStrokePosition.call(void 0, g.line, [local.x, local.y]);
|
|
6329
|
+
const inserted = _chunkUTEVPQTScjs.insertWidthPoint.call(void 0, _chunkUTEVPQTScjs.strokeWidthProfileOf.call(void 0, node), near.t);
|
|
6499
6330
|
profile = inserted.points;
|
|
6500
|
-
subpath =
|
|
6501
|
-
t =
|
|
6331
|
+
subpath = near.contour;
|
|
6332
|
+
t = near.t;
|
|
6502
6333
|
ref = { nodeId: node.id, index: inserted.index, subpath };
|
|
6503
|
-
if (input.alt) side =
|
|
6334
|
+
if (input.alt) side = near.side;
|
|
6504
6335
|
this.widthPoints = [ref];
|
|
6505
6336
|
}
|
|
6506
|
-
const at =
|
|
6337
|
+
const at = _chunkUTEVPQTScjs.strokePositionPoint.call(void 0, g.line, subpath, t);
|
|
6507
6338
|
if (!at) return;
|
|
6508
6339
|
const base = { ...this.doc, nodes: mapTree(this.doc.nodes, (n) => n.id === node.id ? { ...n, strokeWidthProfile: profile } : n) };
|
|
6509
6340
|
this.doc = base;
|
|
@@ -6537,14 +6368,14 @@ var VectorEditorController = (_class3 = class {
|
|
|
6537
6368
|
*/
|
|
6538
6369
|
snapWidthT(drag, node, line2, t, skip) {
|
|
6539
6370
|
const m = this.worldOf(node.id, drag.base);
|
|
6540
|
-
const at =
|
|
6371
|
+
const at = _chunkUTEVPQTScjs.strokePositionPoint.call(void 0, line2, drag.ref.subpath, t);
|
|
6541
6372
|
if (!at) return t;
|
|
6542
6373
|
const here = this.documentToScreen(_chunkDWGZUSEScjs.applyMatrix.call(void 0, m, { x: at.point[0], y: at.point[1] }));
|
|
6543
6374
|
let best = t;
|
|
6544
6375
|
let bestD = this.hitRadius;
|
|
6545
6376
|
drag.profile.forEach((w, i) => {
|
|
6546
6377
|
if (i === skip || drag.group.includes(i)) return;
|
|
6547
|
-
const q =
|
|
6378
|
+
const q = _chunkUTEVPQTScjs.strokePositionPoint.call(void 0, line2, drag.ref.subpath, w.t);
|
|
6548
6379
|
if (!q) return;
|
|
6549
6380
|
const s = this.documentToScreen(_chunkDWGZUSEScjs.applyMatrix.call(void 0, m, { x: q.point[0], y: q.point[1] }));
|
|
6550
6381
|
const d = Math.hypot(s.x - here.x, s.y - here.y);
|
|
@@ -6563,12 +6394,12 @@ var VectorEditorController = (_class3 = class {
|
|
|
6563
6394
|
for (let i = list.length - 1; i >= 0; i--) {
|
|
6564
6395
|
const n = list[i];
|
|
6565
6396
|
if (n.visible === false || n.locked) continue;
|
|
6566
|
-
const m = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0,
|
|
6397
|
+
const m = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, _chunkUTEVPQTScjs.nodeMatrix.call(void 0, n), parent);
|
|
6567
6398
|
if (n.type === "group") {
|
|
6568
6399
|
visit(n.children, m);
|
|
6569
6400
|
continue;
|
|
6570
6401
|
}
|
|
6571
|
-
const hit =
|
|
6402
|
+
const hit = _chunkUTEVPQTScjs.nearestSegment.call(void 0, n, _chunkDWGZUSEScjs.applyMatrix.call(void 0, _chunkDWGZUSEScjs.invertMatrix.call(void 0, m), p));
|
|
6572
6403
|
if (hit && hit.distance <= tol && (!best || hit.distance < best.distance - 1e-9)) {
|
|
6573
6404
|
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 };
|
|
6574
6405
|
}
|
|
@@ -6631,12 +6462,12 @@ var VectorEditorController = (_class3 = class {
|
|
|
6631
6462
|
}
|
|
6632
6463
|
/** The shape under the pointer for the Blend tool, and the anchor of its first subpath under it. */
|
|
6633
6464
|
blendHit(screen, p) {
|
|
6634
|
-
const node =
|
|
6465
|
+
const node = _chunkUTEVPQTScjs.hitTestVectorNodes.call(void 0, this.doc.nodes, p, this.tolerance());
|
|
6635
6466
|
if (!node) return null;
|
|
6636
6467
|
let anchor = null;
|
|
6637
6468
|
if (node.type === "path" && node.subpaths[0]) {
|
|
6638
6469
|
const refs = node.subpaths[0].anchors.map((_, index) => ({ nodeId: node.id, subpath: 0, index }));
|
|
6639
|
-
anchor = _nullishCoalesce(_optionalChain([this, 'access',
|
|
6470
|
+
anchor = _nullishCoalesce(_optionalChain([this, 'access', _227 => _227.hitAnchor, 'call', _228 => _228(screen, refs), 'optionalAccess', _229 => _229.index]), () => ( null));
|
|
6640
6471
|
}
|
|
6641
6472
|
return { nodeId: node.id, anchor };
|
|
6642
6473
|
}
|
|
@@ -6680,7 +6511,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
6680
6511
|
this.notify();
|
|
6681
6512
|
return;
|
|
6682
6513
|
}
|
|
6683
|
-
const node =
|
|
6514
|
+
const node = _chunkUTEVPQTScjs.hitTestVectorNodes.call(void 0, this.doc.nodes, p, this.tolerance(), { entered: this.enteredGroups() });
|
|
6684
6515
|
if (node) {
|
|
6685
6516
|
const selected = this.selection.includes(node.id);
|
|
6686
6517
|
if (input.shift) {
|
|
@@ -6748,12 +6579,12 @@ var VectorEditorController = (_class3 = class {
|
|
|
6748
6579
|
}
|
|
6749
6580
|
for (const id of getEditablePathIds(this.view())) {
|
|
6750
6581
|
const node = this.getNode(id);
|
|
6751
|
-
const seg =
|
|
6582
|
+
const seg = _chunkUTEVPQTScjs.nearestSegment.call(void 0, node, this.toLocal(id, p));
|
|
6752
6583
|
if (!seg || seg.distance > this.tolerance()) continue;
|
|
6753
6584
|
const sp = node.subpaths[seg.subpath];
|
|
6754
6585
|
if (input.alt) {
|
|
6755
6586
|
const before = this.snapshot();
|
|
6756
|
-
const { subpath, index } =
|
|
6587
|
+
const { subpath, index } = _chunkUTEVPQTScjs.insertAnchor.call(void 0, sp, seg.segment, seg.t);
|
|
6757
6588
|
this.replaceNode(id, { ...node, subpaths: node.subpaths.map((s, i) => i === seg.subpath ? subpath : s) });
|
|
6758
6589
|
const ref = { nodeId: id, subpath: seg.subpath, index };
|
|
6759
6590
|
this.anchors = [ref];
|
|
@@ -6789,7 +6620,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
6789
6620
|
}
|
|
6790
6621
|
downPen(screen, p, input) {
|
|
6791
6622
|
const before = this.snapshot();
|
|
6792
|
-
const sp = this.pen ? _optionalChain([this, 'access',
|
|
6623
|
+
const sp = this.pen ? _optionalChain([this, 'access', _230 => _230.getNode, 'call', _231 => _231(this.pen.nodeId), 'optionalAccess', _232 => _232.subpaths, 'access', _233 => _233[this.pen.subpath]]) : void 0;
|
|
6793
6624
|
if (this.pen && sp) {
|
|
6794
6625
|
const pen = this.pen;
|
|
6795
6626
|
const first = { nodeId: pen.nodeId, subpath: pen.subpath, index: 0 };
|
|
@@ -6820,7 +6651,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
6820
6651
|
let node2 = this.getNode(endpoint.nodeId);
|
|
6821
6652
|
let index = endpoint.index;
|
|
6822
6653
|
if (index === 0 && node2.subpaths[endpoint.subpath].anchors.length > 1) {
|
|
6823
|
-
node2 = { ...node2, subpaths: node2.subpaths.map((s, i) => i === endpoint.subpath ?
|
|
6654
|
+
node2 = { ...node2, subpaths: node2.subpaths.map((s, i) => i === endpoint.subpath ? _chunkUTEVPQTScjs.reverseSubpath.call(void 0, s) : s) };
|
|
6824
6655
|
this.replaceNode(node2.id, node2);
|
|
6825
6656
|
index = node2.subpaths[endpoint.subpath].anchors.length - 1;
|
|
6826
6657
|
}
|
|
@@ -6956,7 +6787,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
6956
6787
|
return;
|
|
6957
6788
|
}
|
|
6958
6789
|
case "marquee": {
|
|
6959
|
-
const bounds =
|
|
6790
|
+
const bounds = _chunkUTEVPQTScjs.boundsFromPoints.call(void 0, drag.start, p);
|
|
6960
6791
|
this.interaction = { type: "marquee", bounds };
|
|
6961
6792
|
if (drag.anchorsMode) {
|
|
6962
6793
|
const inside = getVisibleAnchors(this.view()).filter((r) => {
|
|
@@ -6966,8 +6797,8 @@ var VectorEditorController = (_class3 = class {
|
|
|
6966
6797
|
this.anchors = [...drag.baseAnchors, ...inside.filter((r) => !drag.baseAnchors.some((b) => sameRef(b, r)))];
|
|
6967
6798
|
} else {
|
|
6968
6799
|
const hits = this.doc.nodes.filter((n) => !n.locked && n.visible !== false).filter((n) => {
|
|
6969
|
-
const b =
|
|
6970
|
-
return b &&
|
|
6800
|
+
const b = _chunkUTEVPQTScjs.vectorNodeBounds.call(void 0, n);
|
|
6801
|
+
return b && _chunkUTEVPQTScjs.boundsIntersect.call(void 0, b, bounds);
|
|
6971
6802
|
}).map((n) => n.id);
|
|
6972
6803
|
this.selection = [.../* @__PURE__ */ new Set([...drag.base, ...hits])];
|
|
6973
6804
|
}
|
|
@@ -6999,7 +6830,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
6999
6830
|
const leave = anchor ? { at: { x: anchor.x, y: anchor.y }, constrain: input.shift ? "angle" : null } : null;
|
|
7000
6831
|
const pt = this.snapDrawn(p, leave, input, () => drag.targets ??= VectorSnapTargets.forHandle(drag.base, drag.ref.nodeId));
|
|
7001
6832
|
const local = this.toLocal(drag.ref.nodeId, pt, drag.base);
|
|
7002
|
-
this.doc = this.updateAnchors(drag.base, [drag.ref], (a) =>
|
|
6833
|
+
this.doc = this.updateAnchors(drag.base, [drag.ref], (a) => _chunkUTEVPQTScjs.moveAnchorHandle.call(void 0, a, drag.ref.handle, local, input.alt));
|
|
7003
6834
|
this.interaction = { type: "handle", ref: drag.ref };
|
|
7004
6835
|
this.notify(true);
|
|
7005
6836
|
return;
|
|
@@ -7010,8 +6841,8 @@ var VectorEditorController = (_class3 = class {
|
|
|
7010
6841
|
const c = drag.widget.corner;
|
|
7011
6842
|
const inv = _chunkDWGZUSEScjs.invertMatrix.call(void 0, this.worldOf(drag.widget.ref.nodeId, drag.base));
|
|
7012
6843
|
const d = _chunkDWGZUSEScjs.applyMatrixLinear.call(void 0, inv, { x: p.x - drag.start.x, y: p.y - drag.start.y });
|
|
7013
|
-
const radius = Math.max(0, Math.min(c.maxRadius, drag.widget.drawnRadius +
|
|
7014
|
-
this.doc = this.updateAnchors(drag.base, drag.refs, (a) =>
|
|
6844
|
+
const radius = Math.max(0, Math.min(c.maxRadius, drag.widget.drawnRadius + _chunkUTEVPQTScjs.cornerRadiusChange.call(void 0, c, d)));
|
|
6845
|
+
this.doc = this.updateAnchors(drag.base, drag.refs, (a) => _chunkUTEVPQTScjs.setAnchorCorner.call(void 0, a, radius));
|
|
7015
6846
|
this.interaction = { type: "corner", ref: drag.widget.ref, radius };
|
|
7016
6847
|
this.notify(true);
|
|
7017
6848
|
return;
|
|
@@ -7048,15 +6879,15 @@ var VectorEditorController = (_class3 = class {
|
|
|
7048
6879
|
const side = drag.closing ? "in" : "out";
|
|
7049
6880
|
const pos = this.toLocal(drag.ref.nodeId, drag.closing ? { x: 2 * anchor.x - pt.x, y: 2 * anchor.y - pt.y } : pt, drag.base);
|
|
7050
6881
|
this.doc = this.updateAnchors(drag.base, [drag.ref], (a) => {
|
|
7051
|
-
if (drag.outOnly || drag.altBreaks && input.alt) return
|
|
7052
|
-
return
|
|
6882
|
+
if (drag.outOnly || drag.altBreaks && input.alt) return _chunkUTEVPQTScjs.moveAnchorHandle.call(void 0, a, side, pos, true);
|
|
6883
|
+
return _chunkUTEVPQTScjs.moveAnchorHandle.call(void 0, { ...a, type: "symmetric" }, side, pos);
|
|
7053
6884
|
});
|
|
7054
6885
|
this.notify(true);
|
|
7055
6886
|
return;
|
|
7056
6887
|
}
|
|
7057
6888
|
case "shape": {
|
|
7058
6889
|
const node = this.getNode(drag.nodeId);
|
|
7059
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
6890
|
+
if (_optionalChain([node, 'optionalAccess', _234 => _234.type]) !== "path") return;
|
|
7060
6891
|
const leave = { at: drag.start, constrain: input.shift ? drag.tool === "line" ? "angle" : "square" : null, curves: false };
|
|
7061
6892
|
let end = this.snapDrawn(p, leave, input, () => drag.targets ??= this.drawingTargets(null));
|
|
7062
6893
|
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);
|
|
@@ -7077,7 +6908,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
7077
6908
|
if (input.alt) start = { x: start.x - w, y: start.y - h };
|
|
7078
6909
|
const x2 = drag.start.x + w;
|
|
7079
6910
|
const y2 = drag.start.y + h;
|
|
7080
|
-
bounds =
|
|
6911
|
+
bounds = _chunkUTEVPQTScjs.boundsFromPoints.call(void 0, start, { x: x2, y: y2 });
|
|
7081
6912
|
}
|
|
7082
6913
|
const shaped = this.createShapeNode({ kind: drag.tool, ...bounds });
|
|
7083
6914
|
this.replaceNode(drag.nodeId, { ...node, subpaths: shaped.subpaths });
|
|
@@ -7088,32 +6919,32 @@ var VectorEditorController = (_class3 = class {
|
|
|
7088
6919
|
case "width": {
|
|
7089
6920
|
if (!drag.moved && Math.hypot(p.x - drag.start.x, p.y - drag.start.y) * this.viewport.zoom < 2) return;
|
|
7090
6921
|
drag.moved = true;
|
|
7091
|
-
const node =
|
|
6922
|
+
const node = _chunkUTEVPQTScjs.findVectorNode.call(void 0, drag.base.nodes, drag.ref.nodeId);
|
|
7092
6923
|
const local = this.toLocal(node.id, p, drag.base);
|
|
7093
6924
|
const src = drag.profile[drag.source];
|
|
7094
6925
|
let profile;
|
|
7095
6926
|
let index = drag.source;
|
|
7096
6927
|
if (drag.mode !== "width") {
|
|
7097
6928
|
const g = vectorStrokeWidthGeometry(node);
|
|
7098
|
-
const
|
|
7099
|
-
if (!g || !
|
|
7100
|
-
const t = drag.group.length ?
|
|
6929
|
+
const near = g ? _chunkUTEVPQTScjs.nearestStrokePosition.call(void 0, g.line, [local.x, local.y], drag.ref.subpath) : null;
|
|
6930
|
+
if (!g || !near) return;
|
|
6931
|
+
const t = drag.group.length ? near.t : this.snapWidthT(drag, node, g.line, near.t, drag.source);
|
|
7101
6932
|
if (drag.mode === "copy") {
|
|
7102
|
-
({ points: profile, index } =
|
|
6933
|
+
({ points: profile, index } = _chunkUTEVPQTScjs.insertWidthPoint.call(void 0, drag.profile, t, { left: src.left, right: src.right }, { step: true }));
|
|
7103
6934
|
} else if (drag.group.length) {
|
|
7104
6935
|
const shifted = shiftWidthPoints(drag.profile, [drag.source, ...drag.group], t - src.t);
|
|
7105
6936
|
profile = shifted.points;
|
|
7106
6937
|
drag.renumber = shifted.renumber;
|
|
7107
6938
|
index = _nullishCoalesce(shifted.renumber.get(drag.source), () => ( drag.source));
|
|
7108
|
-
} else profile =
|
|
6939
|
+
} else profile = _chunkUTEVPQTScjs.setWidthPoint.call(void 0, drag.profile, drag.source, { t });
|
|
7109
6940
|
} else {
|
|
7110
6941
|
const off = ((local.x - drag.origin.x) * drag.normal.x + (local.y - drag.origin.y) * drag.normal.y) / drag.unit;
|
|
7111
6942
|
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) };
|
|
7112
|
-
profile =
|
|
6943
|
+
profile = _chunkUTEVPQTScjs.setWidthPoint.call(void 0, drag.profile, drag.source, patch);
|
|
7113
6944
|
if (drag.group.length) {
|
|
7114
6945
|
const dl = profile[drag.source].left - src.left;
|
|
7115
6946
|
const dr = profile[drag.source].right - src.right;
|
|
7116
|
-
for (const i of drag.group) profile =
|
|
6947
|
+
for (const i of drag.group) profile = _chunkUTEVPQTScjs.setWidthPoint.call(void 0, profile, i, { left: Math.max(0, drag.profile[i].left + dl), right: Math.max(0, drag.profile[i].right + dr) });
|
|
7117
6948
|
}
|
|
7118
6949
|
}
|
|
7119
6950
|
this.doc = { ...drag.base, nodes: mapTree(drag.base.nodes, (n) => n.id === node.id ? { ...n, strokeWidthProfile: profile } : n) };
|
|
@@ -7130,14 +6961,14 @@ var VectorEditorController = (_class3 = class {
|
|
|
7130
6961
|
for (const q of drag.lazy.push([p.x, p.y])) {
|
|
7131
6962
|
if (Math.hypot(q[0] - last[0], q[1] - last[1]) * this.viewport.zoom < 1.5) continue;
|
|
7132
6963
|
drag.points.push(q);
|
|
7133
|
-
_optionalChain([drag, 'access',
|
|
6964
|
+
_optionalChain([drag, 'access', _235 => _235.pressures, 'optionalAccess', _236 => _236.push, 'call', _237 => _237(drag.pressure)]);
|
|
7134
6965
|
moved = true;
|
|
7135
6966
|
}
|
|
7136
6967
|
const string = drag.lazy.string();
|
|
7137
6968
|
const node = this.getNode(drag.nodeId);
|
|
7138
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
6969
|
+
if (_optionalChain([node, 'optionalAccess', _238 => _238.type]) !== "path") return;
|
|
7139
6970
|
if (!moved) {
|
|
7140
|
-
if (string && _optionalChain([this, 'access',
|
|
6971
|
+
if (string && _optionalChain([this, 'access', _239 => _239.interaction, 'optionalAccess', _240 => _240.type]) === "draw") {
|
|
7141
6972
|
this.interaction = { ...this.interaction, string: [{ x: string[0][0], y: string[0][1] }, { x: string[1][0], y: string[1][1] }] };
|
|
7142
6973
|
this.notify();
|
|
7143
6974
|
}
|
|
@@ -7173,8 +7004,8 @@ var VectorEditorController = (_class3 = class {
|
|
|
7173
7004
|
}
|
|
7174
7005
|
this.setGuides(res);
|
|
7175
7006
|
return {
|
|
7176
|
-
dx: _optionalChain([res, 'optionalAccess',
|
|
7177
|
-
dy: _optionalChain([res, 'optionalAccess',
|
|
7007
|
+
dx: _optionalChain([res, 'optionalAccess', _241 => _241.x]) ? dx + res.dx : axes.x ? this.gridValue(origin.x + dx) - origin.x : dx,
|
|
7008
|
+
dy: _optionalChain([res, 'optionalAccess', _242 => _242.y]) ? dy + res.dy : axes.y ? this.gridValue(origin.y + dy) - origin.y : dy
|
|
7178
7009
|
};
|
|
7179
7010
|
}
|
|
7180
7011
|
/** The anchor a point drag snaps by, where it started: the grabbed one, else the moving one nearest the press. */
|
|
@@ -7258,8 +7089,8 @@ var VectorEditorController = (_class3 = class {
|
|
|
7258
7089
|
case "corner": {
|
|
7259
7090
|
if (drag.moved) return this.commit("Corner Radius", drag.before);
|
|
7260
7091
|
if (drag.alt) {
|
|
7261
|
-
const kind =
|
|
7262
|
-
this.doc = this.updateAnchors(drag.base, drag.refs, (a) =>
|
|
7092
|
+
const kind = _chunkUTEVPQTScjs.nextVectorCornerKind.call(void 0, drag.widget.kind);
|
|
7093
|
+
this.doc = this.updateAnchors(drag.base, drag.refs, (a) => _chunkUTEVPQTScjs.setAnchorCorner.call(void 0, a, _nullishCoalesce(_optionalChain([a, 'access', _243 => _243.corner, 'optionalAccess', _244 => _244.radius]), () => ( 0)), kind));
|
|
7263
7094
|
return this.commit("Corner Kind", drag.before);
|
|
7264
7095
|
}
|
|
7265
7096
|
const ref = drag.widget.ref;
|
|
@@ -7274,7 +7105,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
7274
7105
|
const several = drag.group.length > 0;
|
|
7275
7106
|
if (drag.mode === "copy") this.widthPoints = [drag.ref];
|
|
7276
7107
|
else if (drag.mode === "move" && several) {
|
|
7277
|
-
this.widthPoints = [drag.source, ...drag.group].map((i) => ({ ...drag.ref, index: _nullishCoalesce(_optionalChain([drag, 'access',
|
|
7108
|
+
this.widthPoints = [drag.source, ...drag.group].map((i) => ({ ...drag.ref, index: _nullishCoalesce(_optionalChain([drag, 'access', _245 => _245.renumber, 'optionalAccess', _246 => _246.get, 'call', _247 => _247(i)]), () => ( i)) }));
|
|
7278
7109
|
} else if (!several) this.widthPoints = [drag.ref];
|
|
7279
7110
|
const label = drag.mode === "copy" ? "Copy Width Point" : drag.mode === "move" ? several ? "Move Width Points" : "Move Width Point" : several ? "Width Points" : "Width Point";
|
|
7280
7111
|
return this.commit(label, drag.before);
|
|
@@ -7304,7 +7135,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
7304
7135
|
return this.commit(drag.label, drag.before);
|
|
7305
7136
|
case "shape": {
|
|
7306
7137
|
const node = this.getNode(drag.nodeId);
|
|
7307
|
-
const b = node ?
|
|
7138
|
+
const b = node ? _chunkUTEVPQTScjs.vectorNodeBounds.call(void 0, node) : null;
|
|
7308
7139
|
const min = 2 / this.viewport.zoom;
|
|
7309
7140
|
if (!b || b.width < min && b.height < min) {
|
|
7310
7141
|
this.doc = drag.before.doc;
|
|
@@ -7318,14 +7149,14 @@ var VectorEditorController = (_class3 = class {
|
|
|
7318
7149
|
}
|
|
7319
7150
|
case "pencil": {
|
|
7320
7151
|
const node = this.getNode(drag.nodeId);
|
|
7321
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
7152
|
+
if (_optionalChain([node, 'optionalAccess', _248 => _248.type]) !== "path" || drag.points.length < 2) {
|
|
7322
7153
|
this.doc = drag.before.doc;
|
|
7323
7154
|
this.notify(true);
|
|
7324
7155
|
return;
|
|
7325
7156
|
}
|
|
7326
7157
|
for (const q of drag.lazy.finish()) {
|
|
7327
7158
|
drag.points.push(q);
|
|
7328
|
-
_optionalChain([drag, 'access',
|
|
7159
|
+
_optionalChain([drag, 'access', _249 => _249.pressures, 'optionalAccess', _250 => _250.push, 'call', _251 => _251(drag.pressure)]);
|
|
7329
7160
|
}
|
|
7330
7161
|
const shape = this.editing.recognizeShapes ? recognizeInkShape(drag.points, { minSize: 6 / this.viewport.zoom }) : null;
|
|
7331
7162
|
if (shape) {
|
|
@@ -7340,7 +7171,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
7340
7171
|
anchors[anchors.length - 1].out = { x: c.p1[0], y: c.p1[1] };
|
|
7341
7172
|
anchors.push({ x: c.p3[0], y: c.p3[1], in: { x: c.p2[0], y: c.p2[1] } });
|
|
7342
7173
|
}
|
|
7343
|
-
const subpaths = anchors.length > 1 ?
|
|
7174
|
+
const subpaths = anchors.length > 1 ? _chunkUTEVPQTScjs.bezierToSubpaths.call(void 0, _chunkUTEVPQTScjs.subpathsToBezier.call(void 0, [{ anchors, closed: false }])) : node.subpaths;
|
|
7344
7175
|
const profile = drag.pressures ? pencilPressureProfile(drag.points, drag.pressures) : [];
|
|
7345
7176
|
this.replaceNode(drag.nodeId, { ...node, subpaths, ...profile.length ? { strokeWidthProfile: profile } : {} });
|
|
7346
7177
|
this.selection = [drag.nodeId];
|
|
@@ -7400,10 +7231,10 @@ var VectorEditorController = (_class3 = class {
|
|
|
7400
7231
|
this.convertAnchors(a.in || a.out ? "corner" : "smooth", [anchor]);
|
|
7401
7232
|
return;
|
|
7402
7233
|
}
|
|
7403
|
-
const id = _nullishCoalesce(_optionalChain([this, 'access',
|
|
7234
|
+
const id = _nullishCoalesce(_optionalChain([this, 'access', _252 => _252.hover, 'optionalAccess', _253 => _253.segment, 'optionalAccess', _254 => _254.nodeId]), () => ( this.editingId));
|
|
7404
7235
|
if (id) {
|
|
7405
7236
|
const node = this.getNode(id);
|
|
7406
|
-
const seg = node ?
|
|
7237
|
+
const seg = node ? _chunkUTEVPQTScjs.nearestSegment.call(void 0, node, this.toLocal(id, p)) : null;
|
|
7407
7238
|
if (seg && seg.distance <= this.tolerance()) this.insertAnchorAt(id, p);
|
|
7408
7239
|
}
|
|
7409
7240
|
return;
|
|
@@ -7456,6 +7287,10 @@ var VectorEditorController = (_class3 = class {
|
|
|
7456
7287
|
return true;
|
|
7457
7288
|
case "j":
|
|
7458
7289
|
return input.alt ? this.averageAnchors("both").ok : this.joinPaths().ok;
|
|
7290
|
+
// Make Clipping Mask; with Alt, Release (Option-7 types ¶ on a Mac).
|
|
7291
|
+
case "7":
|
|
7292
|
+
case "\xB6":
|
|
7293
|
+
return input.alt || key === "\xB6" ? this.releaseMask().length > 0 : this.makeMask("clip").ok;
|
|
7459
7294
|
case "]":
|
|
7460
7295
|
this.arrange(input.alt ? "front" : "forward");
|
|
7461
7296
|
return true;
|
|
@@ -7497,7 +7332,7 @@ var VectorEditorController = (_class3 = class {
|
|
|
7497
7332
|
this.finishPath();
|
|
7498
7333
|
return true;
|
|
7499
7334
|
}
|
|
7500
|
-
if (this.tool === "select" && this.selection.length === 1 && _optionalChain([this, 'access',
|
|
7335
|
+
if (this.tool === "select" && this.selection.length === 1 && _optionalChain([this, 'access', _255 => _255.getNode, 'call', _256 => _256(this.selection[0]), 'optionalAccess', _257 => _257.type]) === "path") {
|
|
7501
7336
|
this.tool = "direct";
|
|
7502
7337
|
this.editingId = this.selection[0];
|
|
7503
7338
|
this.notify();
|
|
@@ -7552,11 +7387,11 @@ function inkShapeLabel(shape) {
|
|
|
7552
7387
|
function inkShapeSubpath(shape) {
|
|
7553
7388
|
switch (shape.kind) {
|
|
7554
7389
|
case "line":
|
|
7555
|
-
return
|
|
7390
|
+
return _chunkUTEVPQTScjs.lineSubpath.call(void 0, { x: shape.a[0], y: shape.a[1] }, { x: shape.b[0], y: shape.b[1] });
|
|
7556
7391
|
case "rect":
|
|
7557
|
-
return
|
|
7392
|
+
return _chunkUTEVPQTScjs.rectSubpath.call(void 0, shape);
|
|
7558
7393
|
case "ellipse":
|
|
7559
|
-
return
|
|
7394
|
+
return _chunkUTEVPQTScjs.ellipseSubpath.call(void 0, shape);
|
|
7560
7395
|
case "polygon":
|
|
7561
7396
|
return { anchors: shape.points.map(([x, y]) => ({ x, y })), closed: true };
|
|
7562
7397
|
}
|
|
@@ -7593,17 +7428,17 @@ function withStyle(node, style) {
|
|
|
7593
7428
|
const { fills, strokes, ...shorthand } = style;
|
|
7594
7429
|
let next = { ...node, ...shorthand };
|
|
7595
7430
|
if ("strokeWidthProfile" in style) {
|
|
7596
|
-
const p = style.strokeWidthProfile ?
|
|
7431
|
+
const p = style.strokeWidthProfile ? _chunkUTEVPQTScjs.sanitizeWidthProfile.call(void 0, style.strokeWidthProfile) : [];
|
|
7597
7432
|
if (p.length) next.strokeWidthProfile = p;
|
|
7598
7433
|
else delete next.strokeWidthProfile;
|
|
7599
7434
|
}
|
|
7600
|
-
next =
|
|
7601
|
-
if (fills !== void 0) next =
|
|
7602
|
-
if (strokes !== void 0) next =
|
|
7435
|
+
next = _chunkUTEVPQTScjs.normalizeVectorPaintStacks.call(void 0, next, "shorthand");
|
|
7436
|
+
if (fills !== void 0) next = _chunkUTEVPQTScjs.withVectorFills.call(void 0, next, _chunkUTEVPQTScjs.sanitizeVectorFills.call(void 0, _nullishCoalesce(fills, () => ( []))));
|
|
7437
|
+
if (strokes !== void 0) next = _chunkUTEVPQTScjs.withVectorStrokes.call(void 0, next, _chunkUTEVPQTScjs.sanitizeVectorStrokes.call(void 0, _nullishCoalesce(strokes, () => ( []))));
|
|
7603
7438
|
return next;
|
|
7604
7439
|
}
|
|
7605
7440
|
function hiddenOrLocked(nodes, id) {
|
|
7606
|
-
const loc =
|
|
7441
|
+
const loc = _chunkUTEVPQTScjs.locateVectorNode.call(void 0, nodes, id);
|
|
7607
7442
|
if (!loc) return false;
|
|
7608
7443
|
const n = loc.list[loc.index];
|
|
7609
7444
|
if (n.locked || n.visible === false) return true;
|
|
@@ -7616,7 +7451,7 @@ function pencilPressureProfile(points, pressures) {
|
|
|
7616
7451
|
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]));
|
|
7617
7452
|
const total = s[n - 1];
|
|
7618
7453
|
if (!(total > 0)) return [];
|
|
7619
|
-
return
|
|
7454
|
+
return _chunkUTEVPQTScjs.pressureWidthProfile.call(void 0, s.map((d, i) => ({ t: d / total, pressure: pressures[i] })));
|
|
7620
7455
|
}
|
|
7621
7456
|
|
|
7622
7457
|
// src/vector/render.ts
|
|
@@ -7625,9 +7460,9 @@ var fmtMatrix = (m) => `matrix(${m.map((n) => Math.round(n * 1e6) / 1e6).join("
|
|
|
7625
7460
|
var VECTOR_BUILDER_HATCH_GAP = 6;
|
|
7626
7461
|
function nodeFinish(node, filters, idPrefix) {
|
|
7627
7462
|
const out = {};
|
|
7628
|
-
const blend =
|
|
7463
|
+
const blend = _chunkUTEVPQTScjs.vectorBlendModeCss.call(void 0, node.blendMode);
|
|
7629
7464
|
if (blend) out.blendMode = blend;
|
|
7630
|
-
const filter =
|
|
7465
|
+
const filter = _chunkUTEVPQTScjs.vectorNodeFilterSvg.call(void 0, node, `${idPrefix}filter-${node.id}`);
|
|
7631
7466
|
if (filter) {
|
|
7632
7467
|
filters.push(filter);
|
|
7633
7468
|
out.filter = `url(#${filter.id})`;
|
|
@@ -7639,21 +7474,21 @@ function lineStyle(node) {
|
|
|
7639
7474
|
strokeWidth: _nullishCoalesce(node.strokeWidth, () => ( 1)),
|
|
7640
7475
|
...node.strokeLinecap ? { strokeLinecap: node.strokeLinecap } : {},
|
|
7641
7476
|
...node.strokeLinejoin ? { strokeLinejoin: node.strokeLinejoin } : {},
|
|
7642
|
-
..._optionalChain([node, 'access',
|
|
7477
|
+
..._optionalChain([node, 'access', _258 => _258.strokeDasharray, 'optionalAccess', _259 => _259.length]) ? { strokeDasharray: node.strokeDasharray.join(" ") } : {}
|
|
7643
7478
|
};
|
|
7644
7479
|
}
|
|
7645
7480
|
function renderLayers(node, defs, idPrefix) {
|
|
7646
7481
|
const out = [];
|
|
7647
|
-
for (const l of
|
|
7482
|
+
for (const l of _chunkUTEVPQTScjs.vectorPaintLayerNodes.call(void 0, node)) {
|
|
7648
7483
|
if (!l.drawn) continue;
|
|
7649
7484
|
const role = l.kind;
|
|
7650
|
-
const paint =
|
|
7485
|
+
const paint = _chunkUTEVPQTScjs.vectorPaintToSvg.call(void 0, l.layer.paint, `${idPrefix}${role}-${node.id}-${l.index}`, { node: l.node, ...role === "stroke" ? { role } : {} });
|
|
7651
7486
|
defs.push(...paint.defs);
|
|
7652
|
-
const blend =
|
|
7487
|
+
const blend = _chunkUTEVPQTScjs.vectorBlendModeCss.call(void 0, l.layer.blendMode);
|
|
7653
7488
|
const base = { kind: role, index: l.index, opacity: _nullishCoalesce(l.layer.opacity, () => ( 1)), ...blend ? { blendMode: blend } : {} };
|
|
7654
7489
|
if (role === "fill") out.push({ ...base, fill: paint.value, stroke: "none", strokeWidth: 0 });
|
|
7655
7490
|
else {
|
|
7656
|
-
const strokeParts =
|
|
7491
|
+
const strokeParts = _chunkUTEVPQTScjs.vectorStrokeSvgParts.call(void 0, l.node, `${idPrefix}clip-${node.id}-${l.index}`);
|
|
7657
7492
|
out.push({ ...base, fill: "none", stroke: paint.value, ...lineStyle(l.node), ...strokeParts ? { strokeParts } : {} });
|
|
7658
7493
|
}
|
|
7659
7494
|
}
|
|
@@ -7661,15 +7496,19 @@ function renderLayers(node, defs, idPrefix) {
|
|
|
7661
7496
|
}
|
|
7662
7497
|
function renderNode(stored, defs, filters, idPrefix) {
|
|
7663
7498
|
if (stored.visible === false) return null;
|
|
7664
|
-
const node =
|
|
7499
|
+
const node = _chunkUTEVPQTScjs.expandVectorAppearance.call(void 0, stored);
|
|
7665
7500
|
if (node.type === "group") {
|
|
7666
|
-
const
|
|
7501
|
+
const finish2 = nodeFinish(node, filters, idPrefix);
|
|
7502
|
+
const masked = _chunkUTEVPQTScjs.isVectorMaskGroup.call(void 0, node) ? renderMask(node, defs, filters, idPrefix) : null;
|
|
7503
|
+
const list = _chunkUTEVPQTScjs.isVectorMaskGroup.call(void 0, node) ? node.children.slice(1) : node.children;
|
|
7504
|
+
const children = list.map((c) => renderNode(c, defs, filters, idPrefix)).filter((c) => !!c);
|
|
7667
7505
|
return {
|
|
7668
7506
|
kind: "group",
|
|
7669
7507
|
id: node.id,
|
|
7670
7508
|
...node.transform ? { transform: fmtMatrix(node.transform) } : {},
|
|
7671
7509
|
opacity: _nullishCoalesce(node.opacity, () => ( 1)),
|
|
7672
|
-
...
|
|
7510
|
+
...finish2,
|
|
7511
|
+
...masked ? { mask: masked } : {},
|
|
7673
7512
|
children
|
|
7674
7513
|
};
|
|
7675
7514
|
}
|
|
@@ -7678,31 +7517,31 @@ function renderNode(stored, defs, filters, idPrefix) {
|
|
|
7678
7517
|
kind: "path",
|
|
7679
7518
|
id: node.id,
|
|
7680
7519
|
...node.transform ? { transform: fmtMatrix(node.transform) } : {},
|
|
7681
|
-
d:
|
|
7520
|
+
d: _chunkUTEVPQTScjs.vectorPathData.call(void 0, node),
|
|
7682
7521
|
fillRule: _nullishCoalesce(node.fillRule, () => ( "nonzero")),
|
|
7683
7522
|
opacity: _nullishCoalesce(node.opacity, () => ( 1)),
|
|
7684
7523
|
...finish
|
|
7685
7524
|
};
|
|
7686
|
-
if (
|
|
7525
|
+
if (_chunkUTEVPQTScjs.needsVectorPaintLayers.call(void 0, node)) {
|
|
7687
7526
|
const layers = renderLayers(node, defs, idPrefix);
|
|
7688
7527
|
const fill2 = layers.filter((l) => l.kind === "fill").at(-1);
|
|
7689
7528
|
const stroke2 = layers.filter((l) => l.kind === "stroke").at(-1);
|
|
7690
7529
|
return {
|
|
7691
7530
|
...common,
|
|
7692
|
-
fill: _nullishCoalesce(_optionalChain([fill2, 'optionalAccess',
|
|
7693
|
-
stroke: _nullishCoalesce(_optionalChain([stroke2, 'optionalAccess',
|
|
7694
|
-
strokeWidth: _nullishCoalesce(_nullishCoalesce(_optionalChain([stroke2, 'optionalAccess',
|
|
7695
|
-
..._optionalChain([stroke2, 'optionalAccess',
|
|
7696
|
-
..._optionalChain([stroke2, 'optionalAccess',
|
|
7697
|
-
..._optionalChain([stroke2, 'optionalAccess',
|
|
7698
|
-
..._optionalChain([stroke2, 'optionalAccess',
|
|
7531
|
+
fill: _nullishCoalesce(_optionalChain([fill2, 'optionalAccess', _260 => _260.fill]), () => ( "none")),
|
|
7532
|
+
stroke: _nullishCoalesce(_optionalChain([stroke2, 'optionalAccess', _261 => _261.stroke]), () => ( "none")),
|
|
7533
|
+
strokeWidth: _nullishCoalesce(_nullishCoalesce(_optionalChain([stroke2, 'optionalAccess', _262 => _262.strokeWidth]), () => ( node.strokeWidth)), () => ( 1)),
|
|
7534
|
+
..._optionalChain([stroke2, 'optionalAccess', _263 => _263.strokeLinecap]) ? { strokeLinecap: stroke2.strokeLinecap } : {},
|
|
7535
|
+
..._optionalChain([stroke2, 'optionalAccess', _264 => _264.strokeLinejoin]) ? { strokeLinejoin: stroke2.strokeLinejoin } : {},
|
|
7536
|
+
..._optionalChain([stroke2, 'optionalAccess', _265 => _265.strokeDasharray]) ? { strokeDasharray: stroke2.strokeDasharray } : {},
|
|
7537
|
+
..._optionalChain([stroke2, 'optionalAccess', _266 => _266.strokeParts]) ? { strokeParts: stroke2.strokeParts } : {},
|
|
7699
7538
|
layers
|
|
7700
7539
|
};
|
|
7701
7540
|
}
|
|
7702
|
-
const fill =
|
|
7703
|
-
const stroke =
|
|
7541
|
+
const fill = _chunkUTEVPQTScjs.vectorPaintToSvg.call(void 0, node.fill, `${idPrefix}fill-${node.id}`, { node });
|
|
7542
|
+
const stroke = _chunkUTEVPQTScjs.vectorPaintToSvg.call(void 0, node.stroke, `${idPrefix}stroke-${node.id}`, { node, role: "stroke" });
|
|
7704
7543
|
defs.push(...fill.defs, ...stroke.defs);
|
|
7705
|
-
const strokeParts = stroke.value !== "none" ?
|
|
7544
|
+
const strokeParts = stroke.value !== "none" ? _chunkUTEVPQTScjs.vectorStrokeSvgParts.call(void 0, node, `${idPrefix}clip-${node.id}`) : void 0;
|
|
7706
7545
|
return {
|
|
7707
7546
|
...common,
|
|
7708
7547
|
...strokeParts ? { strokeParts } : {},
|
|
@@ -7711,6 +7550,16 @@ function renderNode(stored, defs, filters, idPrefix) {
|
|
|
7711
7550
|
...lineStyle(node)
|
|
7712
7551
|
};
|
|
7713
7552
|
}
|
|
7553
|
+
function renderMask(group, defs, filters, idPrefix) {
|
|
7554
|
+
if (!_chunkUTEVPQTScjs.isVectorMaskActive.call(void 0, group)) return null;
|
|
7555
|
+
const data = _chunkUTEVPQTScjs.vectorMaskRenderData.call(void 0, group, `${idPrefix}mask-${group.id}`, `${idPrefix}mask-filter-${group.id}`);
|
|
7556
|
+
if (!data) return null;
|
|
7557
|
+
const { invertFilter, ...mask } = data;
|
|
7558
|
+
if (invertFilter) filters.push(invertFilter);
|
|
7559
|
+
if (mask.type === "clip") return mask;
|
|
7560
|
+
const source = renderNode(group.children[0], defs, filters, idPrefix);
|
|
7561
|
+
return { ...mask, nodes: source ? [source] : [] };
|
|
7562
|
+
}
|
|
7714
7563
|
function getVectorSceneRenderData(state, options = {}) {
|
|
7715
7564
|
const defs = [];
|
|
7716
7565
|
const filters = [];
|
|
@@ -7731,17 +7580,17 @@ var toScreen = (state, p) => ({ x: p.x * state.viewport.zoom + state.viewport.x,
|
|
|
7731
7580
|
function screenOutline(state, node, entered) {
|
|
7732
7581
|
const v = state.viewport;
|
|
7733
7582
|
const view = [v.zoom, 0, 0, v.zoom, v.x, v.y];
|
|
7734
|
-
const parent = _nullishCoalesce(
|
|
7583
|
+
const parent = _nullishCoalesce(_chunkUTEVPQTScjs.vectorParentMatrix.call(void 0, state.document.nodes, node.id), () => ( _chunkDWGZUSEScjs.IDENTITY_MATRIX));
|
|
7735
7584
|
return outlinePaths(node, parent, entered).map((path) => _chunkXGD3FSNCcjs.bezierPathToSvg.call(void 0, _chunkXGD3FSNCcjs.transformBezierPath.call(void 0, path, view), { precision: 2 })).join(" ");
|
|
7736
7585
|
}
|
|
7737
7586
|
function outlinePaths(node, parent, entered) {
|
|
7738
|
-
if (node.type === "path") return [
|
|
7739
|
-
const m = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0,
|
|
7740
|
-
if (
|
|
7587
|
+
if (node.type === "path") return [_chunkUTEVPQTScjs.vectorPathWorldBezier.call(void 0, node, parent, { effects: false })];
|
|
7588
|
+
const m = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, _chunkUTEVPQTScjs.nodeMatrix.call(void 0, node), parent);
|
|
7589
|
+
if ((_chunkUTEVPQTScjs.hasOwnVectorAppearance.call(void 0, node) || _chunkUTEVPQTScjs.isVectorMaskActive.call(void 0, node)) && !entered.has(node.id)) return [_chunkXGD3FSNCcjs.transformBezierPath.call(void 0, _chunkUTEVPQTScjs.vectorAppearanceOutline.call(void 0, node), m)];
|
|
7741
7590
|
return node.children.filter((c) => c.visible !== false).flatMap((c) => outlinePaths(c, m, entered));
|
|
7742
7591
|
}
|
|
7743
7592
|
function getVectorEnteredGroups(state) {
|
|
7744
|
-
return
|
|
7593
|
+
return _chunkUTEVPQTScjs.vectorEnteredGroups.call(void 0, state.document.nodes, state.editingId ? [...state.selection, state.editingId] : state.selection);
|
|
7745
7594
|
}
|
|
7746
7595
|
function collect(node) {
|
|
7747
7596
|
if (node.type === "path") return [node];
|
|
@@ -7755,16 +7604,16 @@ function getVectorOverlayRenderData(state) {
|
|
|
7755
7604
|
const seen = /* @__PURE__ */ new Set();
|
|
7756
7605
|
const outline = (id, selected2) => {
|
|
7757
7606
|
if (seen.has(id)) return;
|
|
7758
|
-
const node =
|
|
7607
|
+
const node = _chunkUTEVPQTScjs.findVectorNode.call(void 0, doc.nodes, id);
|
|
7759
7608
|
if (!node || node.visible === false) return;
|
|
7760
7609
|
seen.add(id);
|
|
7761
7610
|
outlines.push({ id, d: screenOutline(state, node, entered), selected: selected2 });
|
|
7762
7611
|
};
|
|
7763
7612
|
for (const id of state.selection) outline(id, true);
|
|
7764
7613
|
if (state.editingId) outline(state.editingId, true);
|
|
7765
|
-
if (_optionalChain([state, 'access',
|
|
7614
|
+
if (_optionalChain([state, 'access', _267 => _267.hover, 'optionalAccess', _268 => _268.nodeId]) && !state.interaction) outline(state.hover.nodeId, false);
|
|
7766
7615
|
let selectionBox = null;
|
|
7767
|
-
if (state.tool === "select" && state.selectionFrame && _optionalChain([state, 'access',
|
|
7616
|
+
if (state.tool === "select" && state.selectionFrame && _optionalChain([state, 'access', _269 => _269.interaction, 'optionalAccess', _270 => _270.type]) !== "marquee" && _optionalChain([state, 'access', _271 => _271.interaction, 'optionalAccess', _272 => _272.type]) !== "distort") {
|
|
7768
7617
|
const g = getVectorSelectionBoxGeometry(state.selectionFrame, state.viewport);
|
|
7769
7618
|
selectionBox = { ...g.box, angle: g.angle, transform: g.transform, corners: g.corners, handles: g.handles, freeDistort: state.freeDistort };
|
|
7770
7619
|
}
|
|
@@ -7774,9 +7623,9 @@ function getVectorOverlayRenderData(state) {
|
|
|
7774
7623
|
const a = getAnchorWorld(doc, ref);
|
|
7775
7624
|
const s = toScreen(state, a);
|
|
7776
7625
|
const closes = !!state.pen && state.pen.nodeId === ref.nodeId && state.pen.subpath === ref.subpath && ref.index === 0;
|
|
7777
|
-
return { ref, x: s.x, y: s.y, type: _nullishCoalesce(a.type, () => (
|
|
7626
|
+
return { ref, x: s.x, y: s.y, type: _nullishCoalesce(a.type, () => ( _chunkUTEVPQTScjs.inferAnchorType.call(void 0, a))), selected: selected(ref), hovered: sameAnchor(_optionalChain([state, 'access', _273 => _273.hover, 'optionalAccess', _274 => _274.anchor]), ref), closes };
|
|
7778
7627
|
});
|
|
7779
|
-
if (state.tool === "pen" && !state.pen && _optionalChain([state, 'access',
|
|
7628
|
+
if (state.tool === "pen" && !state.pen && _optionalChain([state, 'access', _275 => _275.hover, 'optionalAccess', _276 => _276.anchor])) {
|
|
7780
7629
|
const a = getAnchorWorld(doc, state.hover.anchor);
|
|
7781
7630
|
if (a) {
|
|
7782
7631
|
const s = toScreen(state, a);
|
|
@@ -7785,23 +7634,23 @@ function getVectorOverlayRenderData(state) {
|
|
|
7785
7634
|
}
|
|
7786
7635
|
const handles = getVisibleHandles(state).flatMap((ref) => {
|
|
7787
7636
|
const a = getAnchorWorld(doc, ref);
|
|
7788
|
-
const h = _optionalChain([a, 'optionalAccess',
|
|
7637
|
+
const h = _optionalChain([a, 'optionalAccess', _277 => _277[ref.handle]]);
|
|
7789
7638
|
if (!a || !h) return [];
|
|
7790
7639
|
const s = toScreen(state, h);
|
|
7791
7640
|
const sa = toScreen(state, a);
|
|
7792
|
-
const hovered = !!_optionalChain([state, 'access',
|
|
7641
|
+
const hovered = !!_optionalChain([state, 'access', _278 => _278.hover, 'optionalAccess', _279 => _279.handle]) && sameAnchor(state.hover.handle, ref) && state.hover.handle.handle === ref.handle;
|
|
7793
7642
|
return [{ ref, x: s.x, y: s.y, anchorX: sa.x, anchorY: sa.y, hovered }];
|
|
7794
7643
|
});
|
|
7795
7644
|
let marquee = null;
|
|
7796
|
-
if (_optionalChain([state, 'access',
|
|
7645
|
+
if (_optionalChain([state, 'access', _280 => _280.interaction, 'optionalAccess', _281 => _281.type]) === "marquee") {
|
|
7797
7646
|
const b = state.interaction.bounds;
|
|
7798
7647
|
const tl = toScreen(state, b);
|
|
7799
7648
|
marquee = { x: tl.x, y: tl.y, width: b.width * z, height: b.height * z };
|
|
7800
7649
|
}
|
|
7801
7650
|
let penPreview = null;
|
|
7802
7651
|
if (state.tool === "pen" && state.pen && state.pointer && !state.interaction) {
|
|
7803
|
-
const node =
|
|
7804
|
-
const sp = _optionalChain([node, 'optionalAccess',
|
|
7652
|
+
const node = _chunkUTEVPQTScjs.findVectorNode.call(void 0, doc.nodes, state.pen.nodeId);
|
|
7653
|
+
const sp = _optionalChain([node, 'optionalAccess', _282 => _282.type]) === "path" ? node.subpaths[state.pen.subpath] : void 0;
|
|
7805
7654
|
const last = sp ? getAnchorWorld(doc, { nodeId: state.pen.nodeId, subpath: state.pen.subpath, index: sp.anchors.length - 1 }) : void 0;
|
|
7806
7655
|
if (last) {
|
|
7807
7656
|
const a = toScreen(state, last);
|
|
@@ -7814,10 +7663,10 @@ function getVectorOverlayRenderData(state) {
|
|
|
7814
7663
|
const artboard = { x: origin.x, y: origin.y, width: doc.width * z, height: doc.height * z };
|
|
7815
7664
|
let status = null;
|
|
7816
7665
|
const it = state.interaction;
|
|
7817
|
-
if (_optionalChain([it, 'optionalAccess',
|
|
7818
|
-
else if (_optionalChain([it, 'optionalAccess',
|
|
7819
|
-
else if (_optionalChain([it, 'optionalAccess',
|
|
7820
|
-
const b = it.type === "draw" ?
|
|
7666
|
+
if (_optionalChain([it, 'optionalAccess', _283 => _283.type]) === "rotate") status = `${Math.round(it.angle)}\xB0`;
|
|
7667
|
+
else if (_optionalChain([it, 'optionalAccess', _284 => _284.type]) === "move" || _optionalChain([it, 'optionalAccess', _285 => _285.type]) === "anchors") status = `\u0394 ${fmt2(it.dx)}, ${fmt2(it.dy)}`;
|
|
7668
|
+
else if (_optionalChain([it, 'optionalAccess', _286 => _286.type]) === "scale" || _optionalChain([it, 'optionalAccess', _287 => _287.type]) === "draw") {
|
|
7669
|
+
const b = it.type === "draw" ? _chunkUTEVPQTScjs.findVectorNode.call(void 0, doc.nodes, it.nodeId) ? _chunkUTEVPQTScjs.vectorNodeBounds.call(void 0, _chunkUTEVPQTScjs.findVectorNode.call(void 0, doc.nodes, it.nodeId)) : null : state.selectionFrame;
|
|
7821
7670
|
if (b) status = `W ${fmt2(b.width)} \xD7 H ${fmt2(b.height)}`;
|
|
7822
7671
|
}
|
|
7823
7672
|
const guides = { lines: [], labels: [] };
|
|
@@ -7833,24 +7682,24 @@ function getVectorOverlayRenderData(state) {
|
|
|
7833
7682
|
}
|
|
7834
7683
|
}
|
|
7835
7684
|
let toolStroke = null;
|
|
7836
|
-
if (_optionalChain([it, 'optionalAccess',
|
|
7685
|
+
if (_optionalChain([it, 'optionalAccess', _288 => _288.type]) === "stroke") {
|
|
7837
7686
|
const pts = it.points.map((q) => toScreen(state, q));
|
|
7838
7687
|
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)}` : "");
|
|
7839
7688
|
toolStroke = { tool: it.tool, d, width: fmt2(it.width * z) };
|
|
7840
7689
|
}
|
|
7841
7690
|
let pencilString = null;
|
|
7842
|
-
if (_optionalChain([it, 'optionalAccess',
|
|
7691
|
+
if (_optionalChain([it, 'optionalAccess', _289 => _289.type]) === "draw" && it.string) {
|
|
7843
7692
|
const a = toScreen(state, it.string[0]);
|
|
7844
7693
|
const b = toScreen(state, it.string[1]);
|
|
7845
7694
|
pencilString = { x1: fmt2(a.x), y1: fmt2(a.y), x2: fmt2(b.x), y2: fmt2(b.y) };
|
|
7846
7695
|
}
|
|
7847
|
-
const dragged = _optionalChain([it, 'optionalAccess',
|
|
7696
|
+
const dragged = _optionalChain([it, 'optionalAccess', _290 => _290.type]) === "corner" ? it.ref : null;
|
|
7848
7697
|
const cornerWidgets = getVectorCornerWidgets(state).map((w) => {
|
|
7849
7698
|
const s = toScreen(state, w);
|
|
7850
|
-
return { ref: w.ref, x: fmt2(s.x), y: fmt2(s.y), radius: w.radius, kind: w.kind, hovered: sameAnchor(_optionalChain([state, 'access',
|
|
7699
|
+
return { ref: w.ref, x: fmt2(s.x), y: fmt2(s.y), radius: w.radius, kind: w.kind, hovered: sameAnchor(_optionalChain([state, 'access', _291 => _291.hover, 'optionalAccess', _292 => _292.corner]), w.ref), active: !!dragged };
|
|
7851
7700
|
});
|
|
7852
|
-
if (_optionalChain([it, 'optionalAccess',
|
|
7853
|
-
const cutPoint = state.tool === "scissors" && _optionalChain([state, 'access',
|
|
7701
|
+
if (_optionalChain([it, 'optionalAccess', _293 => _293.type]) === "corner") status = `R ${fmt2(it.radius)}`;
|
|
7702
|
+
const cutPoint = state.tool === "scissors" && _optionalChain([state, 'access', _294 => _294.hover, 'optionalAccess', _295 => _295.segment]) && !it ? (({ x, y }) => ({ x: fmt2(x), y: fmt2(y) }))(toScreen(state, state.hover.segment.point)) : null;
|
|
7854
7703
|
const sc = (p) => {
|
|
7855
7704
|
const q = toScreen(state, p);
|
|
7856
7705
|
return { x: fmt2(q.x), y: fmt2(q.y) };
|
|
@@ -7858,13 +7707,13 @@ function getVectorOverlayRenderData(state) {
|
|
|
7858
7707
|
const sameWidth = (a, b) => !!a && a.nodeId === b.nodeId && a.index === b.index;
|
|
7859
7708
|
const widthPoints = getVectorWidthHandles(state).map((h) => {
|
|
7860
7709
|
const c = sc(h);
|
|
7861
|
-
const hw = _optionalChain([state, 'access',
|
|
7710
|
+
const hw = _optionalChain([state, 'access', _296 => _296.hover, 'optionalAccess', _297 => _297.widthPoint]);
|
|
7862
7711
|
const hovered = hw && sameWidth(hw, h.ref) && hw.subpath === h.ref.subpath ? hw.part : null;
|
|
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',
|
|
7712
|
+
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', _298 => _298.type]) === "width" && sameWidth(it.ref, h.ref) };
|
|
7864
7713
|
});
|
|
7865
|
-
const spot = state.tool === "width" && !it ? _optionalChain([state, 'access',
|
|
7714
|
+
const spot = state.tool === "width" && !it ? _optionalChain([state, 'access', _299 => _299.hover, 'optionalAccess', _300 => _300.strokeSpot]) : null;
|
|
7866
7715
|
const widthSpot = spot ? { ...sc(spot.point), left: sc(spot.left), right: sc(spot.right) } : null;
|
|
7867
|
-
if (_optionalChain([it, 'optionalAccess',
|
|
7716
|
+
if (_optionalChain([it, 'optionalAccess', _301 => _301.type]) === "width") status = it.mode === "move" ? "Move width point" : it.mode === "copy" ? "Copy width point" : `W ${fmt2(it.width)}`;
|
|
7868
7717
|
let builder = null;
|
|
7869
7718
|
if (state.builder) {
|
|
7870
7719
|
const v = state.viewport;
|
|
@@ -7880,7 +7729,7 @@ function getVectorOverlayRenderData(state) {
|
|
|
7880
7729
|
lines: state.builder.lines.map((l) => svg(_chunkXGD3FSNCcjs.transformBezierPath.call(void 0, l, view))),
|
|
7881
7730
|
trail
|
|
7882
7731
|
};
|
|
7883
|
-
if (state.builder.mode !== "fill" && _optionalChain([it, 'optionalAccess',
|
|
7732
|
+
if (state.builder.mode !== "fill" && _optionalChain([it, 'optionalAccess', _302 => _302.type]) === "builder") {
|
|
7884
7733
|
const n = state.builder.faces.length;
|
|
7885
7734
|
status = state.builder.mode === "erase" ? `Delete ${n} ${n === 1 ? "face" : "faces"}` : `Merge ${n} ${n === 1 ? "face" : "faces"}`;
|
|
7886
7735
|
}
|
|
@@ -7891,17 +7740,45 @@ function getVectorOverlayRenderData(state) {
|
|
|
7891
7740
|
if (state.tool === "gradient") {
|
|
7892
7741
|
gradient = gradientOverlay(state);
|
|
7893
7742
|
if (!gradient && !it) status = "Drag across a shape to set a gradient";
|
|
7894
|
-
else if (_optionalChain([it, 'optionalAccess',
|
|
7743
|
+
else if (_optionalChain([it, 'optionalAccess', _303 => _303.type]) === "gradient" && it.removing) status = "Release to delete the stop";
|
|
7895
7744
|
}
|
|
7896
7745
|
let distort = null;
|
|
7897
|
-
if (_optionalChain([it, 'optionalAccess',
|
|
7746
|
+
if (_optionalChain([it, 'optionalAccess', _304 => _304.type]) === "distort") {
|
|
7898
7747
|
const corners2 = it.corners.map(sc);
|
|
7899
7748
|
distort = { mode: it.mode, corners: corners2, d: corners2.map((c, i) => `${i ? "L" : "M"}${c.x} ${c.y}`).join("") + "Z" };
|
|
7900
7749
|
status = it.mode === "skew" ? "Skew" : it.mode === "perspective" ? "Perspective" : "Distort";
|
|
7901
7750
|
}
|
|
7902
7751
|
const envelope = state.tool === "envelope" ? envelopeOverlay(state) : null;
|
|
7903
7752
|
if (state.tool === "envelope" && !envelope && !it) status = "Select an object with an envelope to edit its mesh";
|
|
7904
|
-
return { outlines, selectionBox, distort, anchors, handles, marquee, penPreview, artboard, guides, status, toolStroke, pencilString, cutPoint, cornerWidgets, widthPoints, widthSpot, builder, blend, gradient, envelope };
|
|
7753
|
+
return { outlines, selectionBox, distort, anchors, handles, marquee, penPreview, artboard, guides, status, toolStroke, pencilString, cutPoint, cornerWidgets, widthPoints, widthSpot, builder, blend, gradient, envelope, masks: maskOverlay(state) };
|
|
7754
|
+
}
|
|
7755
|
+
function maskOverlay(state) {
|
|
7756
|
+
const ids = state.editingId ? [...state.selection, state.editingId] : state.selection;
|
|
7757
|
+
if (!ids.length) return [];
|
|
7758
|
+
const want = new Set(ids);
|
|
7759
|
+
const v = state.viewport;
|
|
7760
|
+
const view = [v.zoom, 0, 0, v.zoom, v.x, v.y];
|
|
7761
|
+
const out = [];
|
|
7762
|
+
const visit = (list, parent) => {
|
|
7763
|
+
let any = false;
|
|
7764
|
+
for (const n of list) {
|
|
7765
|
+
if (n.type !== "group") {
|
|
7766
|
+
if (want.has(n.id)) any = true;
|
|
7767
|
+
continue;
|
|
7768
|
+
}
|
|
7769
|
+
const m = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, _chunkUTEVPQTScjs.nodeMatrix.call(void 0, n), parent);
|
|
7770
|
+
const inside = visit(n.children, m);
|
|
7771
|
+
const hit = want.has(n.id) || inside;
|
|
7772
|
+
if (hit) any = true;
|
|
7773
|
+
if (!hit || !_chunkUTEVPQTScjs.isVectorMaskGroup.call(void 0, n)) continue;
|
|
7774
|
+
const summary = _chunkUTEVPQTScjs.vectorMaskSummary.call(void 0, n);
|
|
7775
|
+
const d = outlinePaths(n.children[0], m, /* @__PURE__ */ new Set()).map((path) => _chunkXGD3FSNCcjs.bezierPathToSvg.call(void 0, _chunkXGD3FSNCcjs.transformBezierPath.call(void 0, path, view), { precision: 2 })).join(" ");
|
|
7776
|
+
out.push({ id: n.id, maskId: summary.maskId, d, type: summary.type, invert: summary.invert, enabled: summary.enabled, editing: want.has(summary.maskId) });
|
|
7777
|
+
}
|
|
7778
|
+
return any;
|
|
7779
|
+
};
|
|
7780
|
+
visit(state.document.nodes, _chunkDWGZUSEScjs.IDENTITY_MATRIX);
|
|
7781
|
+
return out;
|
|
7905
7782
|
}
|
|
7906
7783
|
function envelopeOverlay(state) {
|
|
7907
7784
|
const target = getVectorEnvelopeTarget(state.document, state.selection);
|
|
@@ -7914,9 +7791,9 @@ function envelopeOverlay(state) {
|
|
|
7914
7791
|
const [a, b, cc, d] = c.map(sc);
|
|
7915
7792
|
return `M${a.x} ${a.y}C${b.x} ${b.y} ${cc.x} ${cc.y} ${d.x} ${d.y}`;
|
|
7916
7793
|
}).join("");
|
|
7917
|
-
const hover = _optionalChain([state, 'access',
|
|
7794
|
+
const hover = _optionalChain([state, 'access', _305 => _305.hover, 'optionalAccess', _306 => _306.envelope, 'optionalAccess', _307 => _307.nodeId]) === target.node.id ? state.hover.envelope.index : void 0;
|
|
7918
7795
|
const it = state.interaction;
|
|
7919
|
-
const active = _optionalChain([it, 'optionalAccess',
|
|
7796
|
+
const active = _optionalChain([it, 'optionalAccess', _308 => _308.type]) === "envelope" && it.nodeId === target.node.id ? it.index : void 0;
|
|
7920
7797
|
const pts = _chunkDWGZUSEScjs.warpMeshEditPoints.call(void 0, mesh);
|
|
7921
7798
|
return {
|
|
7922
7799
|
nodeId: target.node.id,
|
|
@@ -7933,30 +7810,30 @@ var VECTOR_ENVELOPE_STYLE_OPTIONS = [
|
|
|
7933
7810
|
{ value: "mesh", label: "Mesh" }
|
|
7934
7811
|
];
|
|
7935
7812
|
function getVectorEnvelopePanel(state) {
|
|
7936
|
-
const nodes = state.selection.map((id) =>
|
|
7813
|
+
const nodes = state.selection.map((id) => _chunkUTEVPQTScjs.findVectorNode.call(void 0, state.document.nodes, id)).filter((n) => !!n && !n.blendStep);
|
|
7937
7814
|
if (!nodes.length) return null;
|
|
7938
7815
|
const one = nodes.length === 1 ? nodes[0] : null;
|
|
7939
|
-
const first = _optionalChain([one, 'optionalAccess',
|
|
7816
|
+
const first = _optionalChain([one, 'optionalAccess', _309 => _309.effects, 'optionalAccess', _310 => _310.find, 'call', _311 => _311((e) => e.type === "envelope")]);
|
|
7940
7817
|
const order = /* @__PURE__ */ new Map();
|
|
7941
|
-
|
|
7818
|
+
_chunkUTEVPQTScjs.walkVectorNodes.call(void 0, state.document.nodes, (n) => order.set(n.id, order.size));
|
|
7942
7819
|
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;
|
|
7943
7820
|
return {
|
|
7944
|
-
nodeId: _nullishCoalesce(_optionalChain([one, 'optionalAccess',
|
|
7821
|
+
nodeId: _nullishCoalesce(_optionalChain([one, 'optionalAccess', _312 => _312.id]), () => ( null)),
|
|
7945
7822
|
count: nodes.length,
|
|
7946
|
-
envelope: _optionalChain([first, 'optionalAccess',
|
|
7823
|
+
envelope: _optionalChain([first, 'optionalAccess', _313 => _313.type]) === "envelope" ? { effectId: first.id, enabled: first.enabled !== false, params: first.params } : null,
|
|
7947
7824
|
canMake: nodes.some((n) => !n.locked),
|
|
7948
|
-
canMakeWithTopObject: _optionalChain([top, 'optionalAccess',
|
|
7949
|
-
canRelease: nodes.some((n) => !n.locked && !!_optionalChain([n, 'access',
|
|
7825
|
+
canMakeWithTopObject: _optionalChain([top, 'optionalAccess', _314 => _314.type]) === "path" && top.subpaths.some((sp) => sp.closed && sp.anchors.length > 1),
|
|
7826
|
+
canRelease: nodes.some((n) => !n.locked && !!_optionalChain([n, 'access', _315 => _315.effects, 'optionalAccess', _316 => _316.some, 'call', _317 => _317((e) => e.type === "envelope")]))
|
|
7950
7827
|
};
|
|
7951
7828
|
}
|
|
7952
7829
|
function gradientOverlay(state) {
|
|
7953
7830
|
const a = getVectorGradientAnnotator(state.document, state.selection, state.viewport, state.gradientEdit.target, _nullishCoalesce(state.gradientEdit.layer, () => ( null)));
|
|
7954
7831
|
if (!a) return null;
|
|
7955
|
-
const hover = state.interaction ? null : _optionalChain([state, 'access',
|
|
7956
|
-
const handleHovered = (h) => _optionalChain([hover, 'optionalAccess',
|
|
7832
|
+
const hover = state.interaction ? null : _optionalChain([state, 'access', _318 => _318.hover, 'optionalAccess', _319 => _319.gradient]);
|
|
7833
|
+
const handleHovered = (h) => _optionalChain([hover, 'optionalAccess', _320 => _320.kind]) === "handle" && hover.handle === h;
|
|
7957
7834
|
const pt = (p) => ({ x: fmt2(p.x), y: fmt2(p.y) });
|
|
7958
|
-
const centred =
|
|
7959
|
-
const removing = _optionalChain([state, 'access',
|
|
7835
|
+
const centred = _chunkUTEVPQTScjs.isCentredVectorGradient.call(void 0, a.gradient.type);
|
|
7836
|
+
const removing = _optionalChain([state, 'access', _321 => _321.interaction, 'optionalAccess', _322 => _322.type]) === "gradient" && !!state.interaction.removing;
|
|
7960
7837
|
return {
|
|
7961
7838
|
nodeId: a.nodeId,
|
|
7962
7839
|
type: a.gradient.type,
|
|
@@ -7972,9 +7849,9 @@ function gradientOverlay(state) {
|
|
|
7972
7849
|
color: s.color,
|
|
7973
7850
|
opacity: _nullishCoalesce(s.opacity, () => ( 1)),
|
|
7974
7851
|
selected: state.gradientEdit.stop === s.index,
|
|
7975
|
-
hovered: _optionalChain([hover, 'optionalAccess',
|
|
7852
|
+
hovered: _optionalChain([hover, 'optionalAccess', _323 => _323.kind]) === "stop" && hover.index === s.index
|
|
7976
7853
|
})),
|
|
7977
|
-
midpoints: a.midpoints.map((m) => ({ index: m.index, ...pt(m), hovered: _optionalChain([hover, 'optionalAccess',
|
|
7854
|
+
midpoints: a.midpoints.map((m) => ({ index: m.index, ...pt(m), hovered: _optionalChain([hover, 'optionalAccess', _324 => _324.kind]) === "midpoint" && hover.index === m.index })),
|
|
7978
7855
|
extent: a.extent,
|
|
7979
7856
|
removing
|
|
7980
7857
|
};
|
|
@@ -7982,8 +7859,8 @@ function gradientOverlay(state) {
|
|
|
7982
7859
|
function selectedBlends(state) {
|
|
7983
7860
|
const out = /* @__PURE__ */ new Map();
|
|
7984
7861
|
for (const id of state.selection) {
|
|
7985
|
-
const node =
|
|
7986
|
-
const group = isVectorBlendGroup(node) ? node : _optionalChain([
|
|
7862
|
+
const node = _chunkUTEVPQTScjs.findVectorNode.call(void 0, state.document.nodes, id);
|
|
7863
|
+
const group = isVectorBlendGroup(node) ? node : _optionalChain([_chunkUTEVPQTScjs.locateVectorNode.call(void 0, state.document.nodes, id), 'optionalAccess', _325 => _325.parent]);
|
|
7987
7864
|
if (isVectorBlendGroup(group)) out.set(group.id, group);
|
|
7988
7865
|
}
|
|
7989
7866
|
return [...out.values()];
|
|
@@ -7999,8 +7876,8 @@ function blendOverlay(state) {
|
|
|
7999
7876
|
const spines = selectedBlends(state).flatMap((g) => {
|
|
8000
7877
|
const s = vectorBlendSpine(g);
|
|
8001
7878
|
if (!s) return [];
|
|
8002
|
-
const m = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, _nullishCoalesce(
|
|
8003
|
-
const d = _chunkXGD3FSNCcjs.bezierPathToSvg.call(void 0, _chunkXGD3FSNCcjs.transformBezierPath.call(void 0,
|
|
7879
|
+
const m = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, _nullishCoalesce(_chunkUTEVPQTScjs.vectorWorldMatrix.call(void 0, doc.nodes, g.id), () => ( _chunkDWGZUSEScjs.IDENTITY_MATRIX)), view);
|
|
7880
|
+
const d = _chunkXGD3FSNCcjs.bezierPathToSvg.call(void 0, _chunkXGD3FSNCcjs.transformBezierPath.call(void 0, _chunkUTEVPQTScjs.subpathsToBezier.call(void 0, [s.spine], { corners: false }), m), { precision: 2 });
|
|
8004
7881
|
const keys = s.stops.map((stop) => {
|
|
8005
7882
|
const p = vectorBlendRailAt(s.rail, stop).point;
|
|
8006
7883
|
return sc({ x: p[0], y: p[1] }, m);
|
|
@@ -8010,16 +7887,16 @@ function blendOverlay(state) {
|
|
|
8010
7887
|
let start = null;
|
|
8011
7888
|
const anchors = [];
|
|
8012
7889
|
if (state.tool === "blend") {
|
|
8013
|
-
const from = state.blendStart ?
|
|
7890
|
+
const from = state.blendStart ? _chunkUTEVPQTScjs.findVectorNode.call(void 0, doc.nodes, state.blendStart.nodeId) : void 0;
|
|
8014
7891
|
if (from && state.blendStart) {
|
|
8015
7892
|
const a = state.blendStart.anchor === null ? void 0 : getAnchorWorld(doc, { nodeId: from.id, subpath: 0, index: state.blendStart.anchor });
|
|
8016
7893
|
start = { d: screenOutline(state, from, /* @__PURE__ */ new Set()), anchor: a ? sc(a, view) : null };
|
|
8017
7894
|
}
|
|
8018
|
-
const hovered = _optionalChain([state, 'access',
|
|
8019
|
-
if (_optionalChain([hovered, 'optionalAccess',
|
|
7895
|
+
const hovered = _optionalChain([state, 'access', _326 => _326.hover, 'optionalAccess', _327 => _327.nodeId]) ? _chunkUTEVPQTScjs.findVectorNode.call(void 0, doc.nodes, state.hover.nodeId) : void 0;
|
|
7896
|
+
if (_optionalChain([hovered, 'optionalAccess', _328 => _328.type]) === "path" && hovered.subpaths[0]) {
|
|
8020
7897
|
hovered.subpaths[0].anchors.forEach((_, index) => {
|
|
8021
7898
|
const a = getAnchorWorld(doc, { nodeId: hovered.id, subpath: 0, index });
|
|
8022
|
-
if (a) anchors.push({ ...sc(a, view), hovered: _optionalChain([state, 'access',
|
|
7899
|
+
if (a) anchors.push({ ...sc(a, view), hovered: _optionalChain([state, 'access', _329 => _329.hover, 'optionalAccess', _330 => _330.anchor, 'optionalAccess', _331 => _331.index]) === index });
|
|
8023
7900
|
});
|
|
8024
7901
|
}
|
|
8025
7902
|
}
|
|
@@ -8029,18 +7906,18 @@ function getVectorBlendControls(state) {
|
|
|
8029
7906
|
const blends = selectedBlends(state);
|
|
8030
7907
|
const doc = state.document;
|
|
8031
7908
|
const roots = state.selection.filter((id) => {
|
|
8032
|
-
const node =
|
|
8033
|
-
return !!node && !node.blendStep && !node.locked && !state.selection.includes(_nullishCoalesce(_optionalChain([
|
|
7909
|
+
const node = _chunkUTEVPQTScjs.findVectorNode.call(void 0, doc.nodes, id);
|
|
7910
|
+
return !!node && !node.blendStep && !node.locked && !state.selection.includes(_nullishCoalesce(_optionalChain([_chunkUTEVPQTScjs.locateVectorNode.call(void 0, doc.nodes, id), 'optionalAccess', _332 => _332.parent, 'optionalAccess', _333 => _333.id]), () => ( "")));
|
|
8034
7911
|
});
|
|
8035
|
-
const parents = new Set(roots.map((id) => _nullishCoalesce(_optionalChain([
|
|
8036
|
-
const paths = roots.filter((id) => _optionalChain([
|
|
7912
|
+
const parents = new Set(roots.map((id) => _nullishCoalesce(_optionalChain([_chunkUTEVPQTScjs.locateVectorNode.call(void 0, doc.nodes, id), 'optionalAccess', _334 => _334.parent, 'optionalAccess', _335 => _335.id]), () => ( null))));
|
|
7913
|
+
const paths = roots.filter((id) => _optionalChain([_chunkUTEVPQTScjs.findVectorNode.call(void 0, doc.nodes, id), 'optionalAccess', _336 => _336.type]) === "path" && !isVectorBlendGroup(_optionalChain([_chunkUTEVPQTScjs.locateVectorNode.call(void 0, doc.nodes, id), 'optionalAccess', _337 => _337.parent])));
|
|
8037
7914
|
const first = blends[0];
|
|
8038
7915
|
return {
|
|
8039
7916
|
ids: blends.map((g) => g.id),
|
|
8040
7917
|
options: resolveVectorBlendOptions(first ? first.blend : state.blendDefaults),
|
|
8041
7918
|
canBlend: roots.length >= 2 && parents.size === 1,
|
|
8042
7919
|
canReplaceSpine: blends.length === 1 && paths.length === 1,
|
|
8043
|
-
hasSpine: !!_optionalChain([first, 'optionalAccess',
|
|
7920
|
+
hasSpine: !!_optionalChain([first, 'optionalAccess', _338 => _338.blend, 'optionalAccess', _339 => _339.spine])
|
|
8044
7921
|
};
|
|
8045
7922
|
}
|
|
8046
7923
|
function applyVectorBlendOptions(controller, patch) {
|
|
@@ -8069,7 +7946,10 @@ var VECTOR_OVERLAY_THEME = {
|
|
|
8069
7946
|
builderErase: "#ef4444",
|
|
8070
7947
|
builderEraseFill: "rgba(239, 68, 68, 0.22)",
|
|
8071
7948
|
/** Opacity of the hatch lines over Shape Builder faces (drawn in the face's outline colour). */
|
|
8072
|
-
builderHatchOpacity: 0.6
|
|
7949
|
+
builderHatchOpacity: 0.6,
|
|
7950
|
+
/** Mask indicators: the outline of a selected mask group's mask (dashed; solid while the mask is selected). */
|
|
7951
|
+
mask: "#8b5cf6",
|
|
7952
|
+
maskDash: "5 3"
|
|
8073
7953
|
};
|
|
8074
7954
|
function vectorDiamondPath(x, y, r = VECTOR_OVERLAY_THEME.widthPointSize) {
|
|
8075
7955
|
return `M${fmt2(x)} ${fmt2(y - r)}L${fmt2(x + r)} ${fmt2(y)}L${fmt2(x)} ${fmt2(y + r)}L${fmt2(x - r)} ${fmt2(y)}Z`;
|
|
@@ -8093,20 +7973,20 @@ function isVectorTextTarget(target) {
|
|
|
8093
7973
|
if (!el || typeof el !== "object") return false;
|
|
8094
7974
|
const tag = (_nullishCoalesce(el.tagName, () => ( ""))).toUpperCase();
|
|
8095
7975
|
if (tag === "INPUT" || tag === "TEXTAREA" || tag === "SELECT") return true;
|
|
8096
|
-
return !!el.isContentEditable || _optionalChain([el, 'access',
|
|
7976
|
+
return !!el.isContentEditable || _optionalChain([el, 'access', _340 => _340.getAttribute, 'optionalCall', _341 => _341("contenteditable")]) === "true";
|
|
8097
7977
|
}
|
|
8098
7978
|
function getVectorSelectionStyle(state) {
|
|
8099
7979
|
const paths = [];
|
|
8100
7980
|
for (const id of state.selection) {
|
|
8101
|
-
const node =
|
|
7981
|
+
const node = _chunkUTEVPQTScjs.findVectorNode.call(void 0, state.document.nodes, id);
|
|
8102
7982
|
if (node) paths.push(...collect(node));
|
|
8103
7983
|
}
|
|
8104
|
-
const anchorMode = state.tool === "direct" && !!_optionalChain([state, 'access',
|
|
7984
|
+
const anchorMode = state.tool === "direct" && !!_optionalChain([state, 'access', _342 => _342.selectedAnchors, 'optionalAccess', _343 => _343.length]);
|
|
8105
7985
|
if (anchorMode) {
|
|
8106
7986
|
for (const r of state.selectedAnchors) {
|
|
8107
7987
|
if (paths.some((p) => p.id === r.nodeId)) continue;
|
|
8108
|
-
const node =
|
|
8109
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
7988
|
+
const node = _chunkUTEVPQTScjs.findVectorNode.call(void 0, state.document.nodes, r.nodeId);
|
|
7989
|
+
if (_optionalChain([node, 'optionalAccess', _344 => _344.type]) === "path") paths.push(node);
|
|
8110
7990
|
}
|
|
8111
7991
|
}
|
|
8112
7992
|
if (!paths.length) return null;
|
|
@@ -8114,10 +7994,10 @@ function getVectorSelectionStyle(state) {
|
|
|
8114
7994
|
const same = (get) => paths.every((p) => JSON.stringify(_nullishCoalesce(get(p), () => ( null))) === JSON.stringify(_nullishCoalesce(get(first), () => ( null))));
|
|
8115
7995
|
const corners2 = [];
|
|
8116
7996
|
for (const p of paths) {
|
|
8117
|
-
for (const c of
|
|
7997
|
+
for (const c of _chunkUTEVPQTScjs.vectorCorners.call(void 0, p.subpaths)) {
|
|
8118
7998
|
if (anchorMode && !state.selectedAnchors.some((r) => r.nodeId === p.id && r.subpath === c.subpath && r.index === c.index)) continue;
|
|
8119
7999
|
const corner = p.subpaths[c.subpath].anchors[c.index].corner;
|
|
8120
|
-
corners2.push({ radius: _nullishCoalesce(_optionalChain([corner, 'optionalAccess',
|
|
8000
|
+
corners2.push({ radius: _nullishCoalesce(_optionalChain([corner, 'optionalAccess', _345 => _345.radius]), () => ( 0)), kind: _nullishCoalesce(_optionalChain([corner, 'optionalAccess', _346 => _346.kind]), () => ( "round")) });
|
|
8121
8001
|
}
|
|
8122
8002
|
}
|
|
8123
8003
|
const c0 = _nullishCoalesce(corners2[0], () => ( { radius: 0, kind: "round" }));
|
|
@@ -8133,7 +8013,7 @@ function getVectorSelectionStyle(state) {
|
|
|
8133
8013
|
startArrowScale: _nullishCoalesce(first.startArrowScale, () => ( 1)),
|
|
8134
8014
|
endArrowScale: _nullishCoalesce(first.endArrowScale, () => ( 1)),
|
|
8135
8015
|
strokeWidthProfile: profileOf(first),
|
|
8136
|
-
widthProfile:
|
|
8016
|
+
widthProfile: _chunkUTEVPQTScjs.widthProfilePresetId.call(void 0, profileOf(first)),
|
|
8137
8017
|
cornerRadius: c0.radius,
|
|
8138
8018
|
cornerKind: c0.kind,
|
|
8139
8019
|
corners: corners2.length,
|
|
@@ -8157,8 +8037,8 @@ function getVectorSelectionStyle(state) {
|
|
|
8157
8037
|
};
|
|
8158
8038
|
}
|
|
8159
8039
|
function profileOf(p) {
|
|
8160
|
-
const points =
|
|
8161
|
-
return points.length &&
|
|
8040
|
+
const points = _chunkUTEVPQTScjs.sanitizeWidthProfile.call(void 0, p.strokeWidthProfile);
|
|
8041
|
+
return points.length && _chunkUTEVPQTScjs.widthProfilePresetId.call(void 0, points) !== "uniform" ? points : null;
|
|
8162
8042
|
}
|
|
8163
8043
|
var VECTOR_STROKE_ALIGN_LABELS = { center: "Center", inside: "Inside", outside: "Outside" };
|
|
8164
8044
|
var VECTOR_CORNER_KIND_LABELS = { round: "Round", inverted: "Inverted", chamfer: "Chamfer" };
|
|
@@ -8184,20 +8064,20 @@ var VECTOR_STROKE_GRADIENT_MODE_LABELS = { within: "Within stroke", along: "Alon
|
|
|
8184
8064
|
function getVectorGradientEditor(state) {
|
|
8185
8065
|
const paths = [];
|
|
8186
8066
|
for (const id of state.selection) {
|
|
8187
|
-
const node =
|
|
8067
|
+
const node = _chunkUTEVPQTScjs.findVectorNode.call(void 0, state.document.nodes, id);
|
|
8188
8068
|
if (node) paths.push(...collect(node));
|
|
8189
8069
|
}
|
|
8190
8070
|
if (!paths.length) return null;
|
|
8191
8071
|
const { target, layer } = state.gradientEdit;
|
|
8192
|
-
const paint =
|
|
8193
|
-
const gradient =
|
|
8194
|
-
const sorted = gradient ?
|
|
8072
|
+
const paint = _chunkUTEVPQTScjs.vectorTargetPaint.call(void 0, paths[0], target, _nullishCoalesce(layer, () => ( null)));
|
|
8073
|
+
const gradient = _chunkUTEVPQTScjs.isVectorGradient.call(void 0, paint) ? paint : null;
|
|
8074
|
+
const sorted = gradient ? _chunkUTEVPQTScjs.sortedVectorGradientStops.call(void 0, gradient) : [];
|
|
8195
8075
|
const stopIndex = state.gradientEdit.stop;
|
|
8196
8076
|
const stops = sorted.map((s, index) => ({ ...s, index, selected: index === stopIndex }));
|
|
8197
8077
|
const sel = stopIndex !== null && sorted[stopIndex] ? { ...sorted[stopIndex], index: stopIndex, last: stopIndex === sorted.length - 1 } : null;
|
|
8198
|
-
const preview = gradient ? `linear-gradient(to right, ${
|
|
8199
|
-
const c =
|
|
8200
|
-
const a = (_nullishCoalesce(_optionalChain([c, 'optionalAccess',
|
|
8078
|
+
const preview = gradient ? `linear-gradient(to right, ${_chunkUTEVPQTScjs.expandVectorGradientStops.call(void 0, gradient).map((s) => {
|
|
8079
|
+
const c = _chunkUTEVPQTScjs.parseVectorColor.call(void 0, s.color);
|
|
8080
|
+
const a = (_nullishCoalesce(_optionalChain([c, 'optionalAccess', _347 => _347[3]]), () => ( 1))) * (_nullishCoalesce(s.opacity, () => ( 1)));
|
|
8201
8081
|
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;
|
|
8202
8082
|
return `${color} ${Math.round(s.offset * 1e4) / 100}%`;
|
|
8203
8083
|
}).join(", ")})` : null;
|
|
@@ -8209,12 +8089,12 @@ function getVectorGradientEditor(state) {
|
|
|
8209
8089
|
stops,
|
|
8210
8090
|
selected: sel,
|
|
8211
8091
|
preview,
|
|
8212
|
-
type: _nullishCoalesce(_optionalChain([gradient, 'optionalAccess',
|
|
8213
|
-
spread: _nullishCoalesce(_optionalChain([gradient, 'optionalAccess',
|
|
8214
|
-
interpolation: _nullishCoalesce(_optionalChain([gradient, 'optionalAccess',
|
|
8215
|
-
smoothness: _nullishCoalesce(_optionalChain([gradient, 'optionalAccess',
|
|
8216
|
-
strokeMode: _nullishCoalesce(_optionalChain([gradient, 'optionalAccess',
|
|
8217
|
-
mixed: paths.some((p) => JSON.stringify(_nullishCoalesce(
|
|
8092
|
+
type: _nullishCoalesce(_optionalChain([gradient, 'optionalAccess', _348 => _348.type]), () => ( null)),
|
|
8093
|
+
spread: _nullishCoalesce(_optionalChain([gradient, 'optionalAccess', _349 => _349.spread]), () => ( "pad")),
|
|
8094
|
+
interpolation: _nullishCoalesce(_optionalChain([gradient, 'optionalAccess', _350 => _350.interpolation]), () => ( "srgb")),
|
|
8095
|
+
smoothness: _nullishCoalesce(_optionalChain([gradient, 'optionalAccess', _351 => _351.smoothness]), () => ( 0)),
|
|
8096
|
+
strokeMode: _nullishCoalesce(_optionalChain([gradient, 'optionalAccess', _352 => _352.strokeMode]), () => ( "within")),
|
|
8097
|
+
mixed: paths.some((p) => JSON.stringify(_nullishCoalesce(_chunkUTEVPQTScjs.vectorTargetPaint.call(void 0, p, target, _nullishCoalesce(layer, () => ( null))), () => ( null))) !== JSON.stringify(_nullishCoalesce(paint, () => ( null))))
|
|
8218
8098
|
};
|
|
8219
8099
|
}
|
|
8220
8100
|
var VECTOR_PATH_ACTIONS = [
|
|
@@ -8238,32 +8118,32 @@ var VECTOR_EDIT_TOGGLES = [
|
|
|
8238
8118
|
{ key: "curvatureMoves", label: "Curv", title: "Curvature point moves (Alt flips while dragging)" },
|
|
8239
8119
|
{ key: "recognizeShapes", label: "Shapes", title: "Turn pencil scribbles into shapes" }
|
|
8240
8120
|
];
|
|
8241
|
-
var VECTOR_EFFECT_MENU =
|
|
8121
|
+
var VECTOR_EFFECT_MENU = _chunkUTEVPQTScjs.VECTOR_EFFECT_TYPES.map((type) => ({ type, label: _chunkUTEVPQTScjs.VECTOR_EFFECT_LABELS[type] }));
|
|
8242
8122
|
function getVectorEffectsPanel(state) {
|
|
8243
|
-
const nodes = state.selection.map((id) =>
|
|
8123
|
+
const nodes = state.selection.map((id) => _chunkUTEVPQTScjs.findVectorNode.call(void 0, state.document.nodes, id)).filter((n) => !!n && !n.blendStep);
|
|
8244
8124
|
if (!nodes.length) return null;
|
|
8245
8125
|
const one = nodes.length === 1 ? nodes[0] : null;
|
|
8246
8126
|
return {
|
|
8247
|
-
nodeId: _nullishCoalesce(_optionalChain([one, 'optionalAccess',
|
|
8127
|
+
nodeId: _nullishCoalesce(_optionalChain([one, 'optionalAccess', _353 => _353.id]), () => ( null)),
|
|
8248
8128
|
count: nodes.length,
|
|
8249
|
-
effects: (_nullishCoalesce(_optionalChain([one, 'optionalAccess',
|
|
8129
|
+
effects: (_nullishCoalesce(_optionalChain([one, 'optionalAccess', _354 => _354.effects]), () => ( []))).map((e) => ({
|
|
8250
8130
|
id: e.id,
|
|
8251
8131
|
type: e.type,
|
|
8252
|
-
label: _nullishCoalesce(
|
|
8132
|
+
label: _nullishCoalesce(_chunkUTEVPQTScjs.VECTOR_EFFECT_LABELS[e.type], () => ( e.type)),
|
|
8253
8133
|
enabled: e.enabled !== false,
|
|
8254
8134
|
params: e.params,
|
|
8255
8135
|
// The Envelope panel (`getVectorEnvelopePanel`) edits an envelope's warp and mesh.
|
|
8256
|
-
specs: e.type === "envelope" ? [] : _nullishCoalesce(
|
|
8136
|
+
specs: e.type === "envelope" ? [] : _nullishCoalesce(_chunkUTEVPQTScjs.VECTOR_EFFECT_PARAM_SPECS[e.type], () => ( []))
|
|
8257
8137
|
})),
|
|
8258
|
-
expandable: nodes.some(
|
|
8138
|
+
expandable: nodes.some(_chunkUTEVPQTScjs.hasVectorAppearance)
|
|
8259
8139
|
};
|
|
8260
8140
|
}
|
|
8261
8141
|
function vectorPaintSwatch(paint) {
|
|
8262
8142
|
if (typeof paint === "string") return paint;
|
|
8263
|
-
if (
|
|
8264
|
-
return `linear-gradient(to right, ${
|
|
8265
|
-
const c =
|
|
8266
|
-
const a = (_nullishCoalesce(_optionalChain([c, 'optionalAccess',
|
|
8143
|
+
if (_chunkUTEVPQTScjs.isVectorGradient.call(void 0, paint)) {
|
|
8144
|
+
return `linear-gradient(to right, ${_chunkUTEVPQTScjs.expandVectorGradientStops.call(void 0, paint).map((s) => {
|
|
8145
|
+
const c = _chunkUTEVPQTScjs.parseVectorColor.call(void 0, s.color);
|
|
8146
|
+
const a = (_nullishCoalesce(_optionalChain([c, 'optionalAccess', _355 => _355[3]]), () => ( 1))) * (_nullishCoalesce(s.opacity, () => ( 1)));
|
|
8267
8147
|
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
8148
|
return `${color} ${Math.round(s.offset * 1e4) / 100}%`;
|
|
8269
8149
|
}).join(", ")})`;
|
|
@@ -8271,7 +8151,7 @@ function vectorPaintSwatch(paint) {
|
|
|
8271
8151
|
return "transparent";
|
|
8272
8152
|
}
|
|
8273
8153
|
function getVectorAppearancePanel(state) {
|
|
8274
|
-
const nodes = state.selection.map((id) =>
|
|
8154
|
+
const nodes = state.selection.map((id) => _chunkUTEVPQTScjs.findVectorNode.call(void 0, state.document.nodes, id)).filter((n) => !!n && !n.blendStep);
|
|
8275
8155
|
if (!nodes.length) return null;
|
|
8276
8156
|
const paths = [];
|
|
8277
8157
|
for (const n of nodes) for (const p of collect(n)) if (!p.blendStep && !paths.some((q) => q.id === p.id)) paths.push(p);
|
|
@@ -8283,7 +8163,7 @@ function getVectorAppearancePanel(state) {
|
|
|
8283
8163
|
paint: l.paint,
|
|
8284
8164
|
color: vectorPaintToHex(l.paint),
|
|
8285
8165
|
swatch: vectorPaintSwatch(l.paint),
|
|
8286
|
-
gradient:
|
|
8166
|
+
gradient: _chunkUTEVPQTScjs.isVectorGradient.call(void 0, l.paint),
|
|
8287
8167
|
opacity: _nullishCoalesce(l.opacity, () => ( 1)),
|
|
8288
8168
|
blendMode: _nullishCoalesce(l.blendMode, () => ( "normal")),
|
|
8289
8169
|
visible: l.visible !== false,
|
|
@@ -8291,8 +8171,8 @@ function getVectorAppearancePanel(state) {
|
|
|
8291
8171
|
...(_nullishCoalesce(l.kind, () => ( "paint"))) !== "paint" ? { unknownKind: String(l.kind) } : {},
|
|
8292
8172
|
editing: edit.target === kind && (edit.layer === null ? index === count - 1 : edit.layer === index)
|
|
8293
8173
|
});
|
|
8294
|
-
const fills = first ?
|
|
8295
|
-
const strokes = first ?
|
|
8174
|
+
const fills = first ? _chunkUTEVPQTScjs.vectorFills.call(void 0, first) : [];
|
|
8175
|
+
const strokes = first ? _chunkUTEVPQTScjs.vectorStrokes.call(void 0, first) : [];
|
|
8296
8176
|
const same = (get) => paths.every((p) => JSON.stringify(get(p)) === JSON.stringify(get(first)));
|
|
8297
8177
|
const one = nodes.length === 1 ? nodes[0] : null;
|
|
8298
8178
|
return {
|
|
@@ -8302,22 +8182,48 @@ function getVectorAppearancePanel(state) {
|
|
|
8302
8182
|
strokes: strokes.map((l, i) => layer("stroke", l, i, strokes.length)),
|
|
8303
8183
|
blendMode: _nullishCoalesce(nodes[0].blendMode, () => ( "normal")),
|
|
8304
8184
|
mixed: {
|
|
8305
|
-
fills: !!first && !same(
|
|
8306
|
-
strokes: !!first && !same(
|
|
8185
|
+
fills: !!first && !same(_chunkUTEVPQTScjs.vectorFills),
|
|
8186
|
+
strokes: !!first && !same(_chunkUTEVPQTScjs.vectorStrokes),
|
|
8307
8187
|
blendMode: nodes.some((n) => (_nullishCoalesce(n.blendMode, () => ( "normal"))) !== (_nullishCoalesce(nodes[0].blendMode, () => ( "normal"))))
|
|
8308
8188
|
},
|
|
8309
|
-
filterNodeId: _nullishCoalesce(_optionalChain([one, 'optionalAccess',
|
|
8310
|
-
filters: (_nullishCoalesce(_optionalChain([one, 'optionalAccess',
|
|
8189
|
+
filterNodeId: _nullishCoalesce(_optionalChain([one, 'optionalAccess', _356 => _356.id]), () => ( null)),
|
|
8190
|
+
filters: (_nullishCoalesce(_optionalChain([one, 'optionalAccess', _357 => _357.filters]), () => ( []))).map((f) => ({
|
|
8311
8191
|
id: f.id,
|
|
8312
8192
|
type: f.type,
|
|
8313
|
-
label: _nullishCoalesce(
|
|
8193
|
+
label: _nullishCoalesce(_chunkUTEVPQTScjs.VECTOR_FILTER_LABELS[f.type], () => ( f.type)),
|
|
8314
8194
|
enabled: f.enabled !== false,
|
|
8315
8195
|
params: f.params,
|
|
8316
|
-
specs: _nullishCoalesce(
|
|
8196
|
+
specs: _nullishCoalesce(_chunkUTEVPQTScjs.VECTOR_FILTER_PARAM_SPECS[f.type], () => ( []))
|
|
8317
8197
|
}))
|
|
8318
8198
|
};
|
|
8319
8199
|
}
|
|
8320
|
-
var VECTOR_BLEND_MODE_MENU =
|
|
8200
|
+
var VECTOR_BLEND_MODE_MENU = _chunkUTEVPQTScjs.VECTOR_BLEND_MODES.map((mode) => ({ mode, label: _chunkUTEVPQTScjs.VECTOR_BLEND_MODE_LABELS[mode] }));
|
|
8201
|
+
var VECTOR_MASK_TYPE_LABELS = { clip: "Clip", alpha: "Alpha", luminance: "Luminance" };
|
|
8202
|
+
var VECTOR_MASK_TYPE_OPTIONS = [
|
|
8203
|
+
{ value: "clip", label: "Clip", title: "Clipping mask: the contents show inside the mask's outline" },
|
|
8204
|
+
{ value: "luminance", label: "Luminance", title: "Opacity mask by brightness: white shows, black hides" },
|
|
8205
|
+
{ value: "alpha", label: "Alpha", title: "Opacity mask by opacity: opaque shows, transparent hides" }
|
|
8206
|
+
];
|
|
8207
|
+
function getVectorMaskPanel(state) {
|
|
8208
|
+
const doc = state.document;
|
|
8209
|
+
if (!state.selection.length) return null;
|
|
8210
|
+
const locs = state.selection.map((id) => _chunkUTEVPQTScjs.locateVectorNode.call(void 0, doc.nodes, id));
|
|
8211
|
+
let makeHint = null;
|
|
8212
|
+
if (state.selection.length < 2) makeHint = "Select two or more objects: the topmost becomes the mask.";
|
|
8213
|
+
else if (locs.some((l) => !l)) makeHint = "Select objects in the document.";
|
|
8214
|
+
else if (locs.some((l) => l.list[l.index].locked || l.list[l.index].blendStep)) makeHint = "Unlock the selected objects first.";
|
|
8215
|
+
else if (locs.some((l) => (_nullishCoalesce(_optionalChain([l, 'access', _358 => _358.parent, 'optionalAccess', _359 => _359.id]), () => ( null))) !== (_nullishCoalesce(_optionalChain([locs, 'access', _360 => _360[0], 'access', _361 => _361.parent, 'optionalAccess', _362 => _362.id]), () => ( null))))) makeHint = "Select objects at one level (sharing a parent).";
|
|
8216
|
+
let group = null;
|
|
8217
|
+
const first = locs[0];
|
|
8218
|
+
const node = first ? first.list[first.index] : null;
|
|
8219
|
+
const owner = _chunkUTEVPQTScjs.isVectorMaskGroup.call(void 0, node) ? node : _chunkUTEVPQTScjs.isVectorMaskGroup.call(void 0, _optionalChain([first, 'optionalAccess', _363 => _363.parent])) ? first.parent : null;
|
|
8220
|
+
if (owner && state.selection.every((id) => id === owner.id || owner.children.some((c) => c.id === id))) {
|
|
8221
|
+
const summary = _chunkUTEVPQTScjs.vectorMaskSummary.call(void 0, owner);
|
|
8222
|
+
const editing = state.selection.includes(owner.id) ? "group" : state.selection.includes(summary.maskId) ? "mask" : "contents";
|
|
8223
|
+
group = { ...summary, id: owner.id, ...owner.name ? { name: owner.name } : {}, editing };
|
|
8224
|
+
}
|
|
8225
|
+
return { canMake: makeHint === null, makeHint, group };
|
|
8226
|
+
}
|
|
8321
8227
|
|
|
8322
8228
|
// src/vector/commands.ts
|
|
8323
8229
|
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).";
|
|
@@ -8361,13 +8267,13 @@ var BLEND_PROPS = {
|
|
|
8361
8267
|
linear: { type: "boolean", description: "Move anchors in straight lines instead of the rotation-aware morph." }
|
|
8362
8268
|
};
|
|
8363
8269
|
var checkBlendOptions = (params) => {
|
|
8364
|
-
if (_optionalChain([params, 'optionalAccess',
|
|
8365
|
-
if (_optionalChain([params, 'optionalAccess',
|
|
8366
|
-
if (_optionalChain([params, 'optionalAccess',
|
|
8270
|
+
if (_optionalChain([params, 'optionalAccess', _364 => _364.spacing]) !== void 0 && !_chunkUTEVPQTScjs.VECTOR_BLEND_SPACINGS.includes(params.spacing)) fail(`Unknown blend spacing "${params.spacing}".`);
|
|
8271
|
+
if (_optionalChain([params, 'optionalAccess', _365 => _365.steps]) !== void 0 && !(Number.isFinite(params.steps) && params.steps >= 1)) fail("steps must be at least 1.");
|
|
8272
|
+
if (_optionalChain([params, 'optionalAccess', _366 => _366.distance]) !== void 0 && !(Number.isFinite(params.distance) && params.distance > 0)) fail("distance must be positive.");
|
|
8367
8273
|
};
|
|
8368
8274
|
var POINT = { type: "object", properties: { x: { type: "number" }, y: { type: "number" } }, required: ["x", "y"] };
|
|
8369
8275
|
var GRADIENT_PROPS = {
|
|
8370
|
-
type: { type: "string", enum:
|
|
8276
|
+
type: { type: "string", enum: _chunkUTEVPQTScjs.VECTOR_GRADIENT_TYPES, description: "linear, radial, conic (an angle sweep), reflected (linear mirrored about the start) or diamond." },
|
|
8371
8277
|
stops: {
|
|
8372
8278
|
type: "array",
|
|
8373
8279
|
minItems: 1,
|
|
@@ -8392,10 +8298,10 @@ var GRADIENT_PROPS = {
|
|
|
8392
8298
|
focal: { ...POINT, description: "Radial focal point (where t = 0), in `units`." },
|
|
8393
8299
|
focalRadius: { type: "number", minimum: 0, maximum: 0.99, description: "Radial focal circle radius as a fraction of the radius (SVG fr)." },
|
|
8394
8300
|
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." },
|
|
8395
|
-
spread: { type: "string", enum:
|
|
8396
|
-
interpolation: { type: "string", enum:
|
|
8301
|
+
spread: { type: "string", enum: _chunkUTEVPQTScjs.VECTOR_GRADIENT_SPREADS, description: "What paints past the ends: pad (default), reflect or repeat." },
|
|
8302
|
+
interpolation: { type: "string", enum: _chunkUTEVPQTScjs.VECTOR_GRADIENT_INTERPOLATIONS, description: "Colour mixing space: srgb (default), linear (light) or oklab." },
|
|
8397
8303
|
smoothness: { type: "number", minimum: 0, maximum: 1, description: "Bends the ramp along a smooth spline through the stops (0 = straight)." },
|
|
8398
|
-
strokeMode: { type: "string", enum:
|
|
8304
|
+
strokeMode: { type: "string", enum: _chunkUTEVPQTScjs.VECTOR_STROKE_GRADIENT_MODES, description: "On strokes: within (default, like a fill), along the path or across it." }
|
|
8399
8305
|
};
|
|
8400
8306
|
var PAINT = {
|
|
8401
8307
|
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).',
|
|
@@ -8403,7 +8309,7 @@ var PAINT = {
|
|
|
8403
8309
|
};
|
|
8404
8310
|
var BLEND_MODE = {
|
|
8405
8311
|
type: "string",
|
|
8406
|
-
enum:
|
|
8312
|
+
enum: _chunkUTEVPQTScjs.VECTOR_BLEND_MODES,
|
|
8407
8313
|
description: "How it mixes with what is under it (CSS mix-blend-mode names; linear-dodge draws as plus-lighter). Default normal."
|
|
8408
8314
|
};
|
|
8409
8315
|
var FILL_LAYER_PROPS = {
|
|
@@ -8418,8 +8324,8 @@ var STROKE_SETTING_PROPS = {
|
|
|
8418
8324
|
strokeLinejoin: { type: "string", enum: ["miter", "round", "bevel"], description: "Line join (default miter)." },
|
|
8419
8325
|
strokeDasharray: { type: ["array", "null"], items: { type: "number", minimum: 0 }, description: "Dash and gap lengths in document units; null or [] for a solid line." },
|
|
8420
8326
|
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: [...
|
|
8422
|
-
endArrow: { type: ["string", "null"], enum: [...
|
|
8327
|
+
startArrow: { type: ["string", "null"], enum: [..._chunkUTEVPQTScjs.VECTOR_ARROWHEADS, null], description: "Head at the start of an open path, or null for none." },
|
|
8328
|
+
endArrow: { type: ["string", "null"], enum: [..._chunkUTEVPQTScjs.VECTOR_ARROWHEADS, null], description: "Head at the end of an open path, or null for none." },
|
|
8423
8329
|
arrowAlign: { type: "string", enum: ["extend", "tip"], description: "`extend`: the tip sits past the end point; `tip`: on it, the stroke shortened under the head." },
|
|
8424
8330
|
startArrowScale: { type: "number", exclusiveMinimum: 0, description: "Start head size as a multiple of the stroke width (default 1)." },
|
|
8425
8331
|
endArrowScale: { type: "number", exclusiveMinimum: 0, description: "End head size as a multiple of the stroke width (default 1)." },
|
|
@@ -8436,7 +8342,7 @@ var STYLE_PROPS = {
|
|
|
8436
8342
|
fillRule: { type: "string", enum: ["nonzero", "evenodd"], description: "Which areas count as inside (default nonzero)." }
|
|
8437
8343
|
};
|
|
8438
8344
|
var checkPaint = (paint, where) => {
|
|
8439
|
-
if (paint && typeof paint === "object") return _nullishCoalesce(
|
|
8345
|
+
if (paint && typeof paint === "object") return _nullishCoalesce(_chunkUTEVPQTScjs.sanitizeVectorGradient.call(void 0, paint), () => ( fail(`${where} is not a valid gradient: give a type and at least one stop { offset, color }.`)));
|
|
8440
8346
|
return paint;
|
|
8441
8347
|
};
|
|
8442
8348
|
var pickStyle = (params) => {
|
|
@@ -8450,7 +8356,7 @@ var pickStyle = (params) => {
|
|
|
8450
8356
|
if (!l || typeof l !== "object") fail(`${key}[${i}] must be a layer object { paint, \u2026 }.`);
|
|
8451
8357
|
const layer = l;
|
|
8452
8358
|
checkPaint(layer.paint, `${key}[${i}].paint`);
|
|
8453
|
-
if (layer.blendMode !== void 0 && !
|
|
8359
|
+
if (layer.blendMode !== void 0 && !_chunkUTEVPQTScjs.isVectorBlendMode.call(void 0, layer.blendMode)) fail(`${key}[${i}].blendMode "${String(layer.blendMode)}" is not one of: ${_chunkUTEVPQTScjs.VECTOR_BLEND_MODES.join(", ")}.`);
|
|
8454
8360
|
});
|
|
8455
8361
|
}
|
|
8456
8362
|
return out;
|
|
@@ -8464,17 +8370,17 @@ function createVectorCommands(controller, options = {}) {
|
|
|
8464
8370
|
const base = { group, ...options.scope ? { scope: options.scope } : {} };
|
|
8465
8371
|
const hasSelection = () => controller.getState().selection.length ? true : "Nothing is selected.";
|
|
8466
8372
|
const ids = (params) => {
|
|
8467
|
-
const list2 = _nullishCoalesce(_optionalChain([params, 'optionalAccess',
|
|
8373
|
+
const list2 = _nullishCoalesce(_optionalChain([params, 'optionalAccess', _367 => _367.ids]), () => ( controller.getState().selection));
|
|
8468
8374
|
for (const id of list2) if (!controller.getNode(id)) fail(`There is no node "${id}".`);
|
|
8469
8375
|
if (!list2.length) fail("Nothing is selected; pass ids.");
|
|
8470
8376
|
return list2;
|
|
8471
8377
|
};
|
|
8472
|
-
const enabledFor = (_, params) => _optionalChain([params, 'optionalAccess',
|
|
8378
|
+
const enabledFor = (_, params) => _optionalChain([params, 'optionalAccess', _368 => _368.ids, 'optionalAccess', _369 => _369.length]) ? true : hasSelection();
|
|
8473
8379
|
const anchorsOf = (refs) => {
|
|
8474
8380
|
if (!refs) return [...controller.getState().selectedAnchors];
|
|
8475
8381
|
for (const r of refs) {
|
|
8476
8382
|
const node = controller.getNode(r.nodeId);
|
|
8477
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
8383
|
+
if (_optionalChain([node, 'optionalAccess', _370 => _370.type]) !== "path" || !_optionalChain([node, 'access', _371 => _371.subpaths, 'access', _372 => _372[r.subpath], 'optionalAccess', _373 => _373.anchors, 'access', _374 => _374[r.index]])) fail(`There is no anchor ${r.index} on subpath ${r.subpath} of "${r.nodeId}".`);
|
|
8478
8384
|
}
|
|
8479
8385
|
return refs;
|
|
8480
8386
|
};
|
|
@@ -8483,28 +8389,29 @@ function createVectorCommands(controller, options = {}) {
|
|
|
8483
8389
|
const out = [];
|
|
8484
8390
|
const visit = (nodes, depth) => {
|
|
8485
8391
|
for (const n of nodes) {
|
|
8486
|
-
const parent = _nullishCoalesce(
|
|
8487
|
-
const b =
|
|
8392
|
+
const parent = _nullishCoalesce(_chunkUTEVPQTScjs.vectorParentMatrix.call(void 0, state.document.nodes, n.id), () => ( _chunkDWGZUSEScjs.IDENTITY_MATRIX));
|
|
8393
|
+
const b = _chunkUTEVPQTScjs.vectorNodeBounds.call(void 0, n, parent);
|
|
8488
8394
|
out.push({
|
|
8489
8395
|
id: n.id,
|
|
8490
8396
|
type: n.type,
|
|
8491
8397
|
...n.name ? { name: n.name } : {},
|
|
8492
8398
|
depth,
|
|
8493
|
-
rotation: Math.round(
|
|
8399
|
+
rotation: Math.round(_chunkUTEVPQTScjs.vectorNodeRotation.call(void 0, n, parent) * 100) / 100,
|
|
8494
8400
|
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 },
|
|
8495
8401
|
visible: n.visible !== false,
|
|
8496
8402
|
locked: !!n.locked,
|
|
8497
8403
|
selected: state.selection.includes(n.id),
|
|
8498
|
-
...n.type === "path" ? { fill: _nullishCoalesce(n.fill, () => ( null)), stroke: _nullishCoalesce(n.stroke, () => ( null)), strokeWidth: _nullishCoalesce(n.strokeWidth, () => ( 1)), d:
|
|
8404
|
+
...n.type === "path" ? { fill: _nullishCoalesce(n.fill, () => ( null)), stroke: _nullishCoalesce(n.stroke, () => ( null)), strokeWidth: _nullishCoalesce(n.strokeWidth, () => ( 1)), d: _chunkUTEVPQTScjs.vectorPathData.call(void 0, n, 2) } : { children: n.children.length },
|
|
8499
8405
|
...n.type === "group" && n.blend ? { blend: { ...resolveVectorBlendOptions(n.blend), spine: !!n.blend.spine, keys: vectorBlendKeys(n).map((k) => k.id) } } : {},
|
|
8500
8406
|
...n.blendStep ? { blendStep: true } : {},
|
|
8501
|
-
..._optionalChain([n, 'access',
|
|
8407
|
+
..._optionalChain([n, 'access', _375 => _375.effects, 'optionalAccess', _376 => _376.length]) ? { effects: n.effects } : {},
|
|
8502
8408
|
...n.type === "group" && n.liveBoolean ? { liveBoolean: n.liveBoolean } : {},
|
|
8503
8409
|
...n.booleanOperation ? { booleanOperation: n.booleanOperation } : {},
|
|
8504
8410
|
...n.type === "path" && Array.isArray(n.fills) ? { fills: n.fills } : {},
|
|
8505
8411
|
...n.type === "path" && Array.isArray(n.strokes) ? { strokes: n.strokes } : {},
|
|
8506
8412
|
...n.blendMode && n.blendMode !== "normal" ? { blendMode: n.blendMode } : {},
|
|
8507
|
-
..._optionalChain([n, 'access',
|
|
8413
|
+
..._optionalChain([n, 'access', _377 => _377.filters, 'optionalAccess', _378 => _378.length]) ? { filters: n.filters } : {},
|
|
8414
|
+
..._chunkUTEVPQTScjs.isVectorMaskGroup.call(void 0, n) ? { mask: _chunkUTEVPQTScjs.vectorMaskSummary.call(void 0, n) } : {}
|
|
8508
8415
|
});
|
|
8509
8416
|
if (n.type === "group") visit(n.children, depth + 1);
|
|
8510
8417
|
}
|
|
@@ -8517,7 +8424,7 @@ function createVectorCommands(controller, options = {}) {
|
|
|
8517
8424
|
return {
|
|
8518
8425
|
id: n.id,
|
|
8519
8426
|
type: n.type,
|
|
8520
|
-
...n.type === "path" ? { fills:
|
|
8427
|
+
...n.type === "path" ? { fills: _chunkUTEVPQTScjs.vectorFills.call(void 0, n), strokes: _chunkUTEVPQTScjs.vectorStrokes.call(void 0, n), fillRule: _nullishCoalesce(n.fillRule, () => ( "nonzero")) } : {},
|
|
8521
8428
|
blendMode: _nullishCoalesce(n.blendMode, () => ( "normal")),
|
|
8522
8429
|
opacity: _nullishCoalesce(n.opacity, () => ( 1)),
|
|
8523
8430
|
filters: _nullishCoalesce(n.filters, () => ( []))
|
|
@@ -8529,10 +8436,10 @@ function createVectorCommands(controller, options = {}) {
|
|
|
8529
8436
|
return n;
|
|
8530
8437
|
};
|
|
8531
8438
|
const layerIndex = (id, kind, index, key = "index") => {
|
|
8532
|
-
const stack = kind === "fill" ?
|
|
8439
|
+
const stack = kind === "fill" ? _chunkUTEVPQTScjs.vectorFills.call(void 0, pathOf(id)) : _chunkUTEVPQTScjs.vectorStrokes.call(void 0, pathOf(id));
|
|
8533
8440
|
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
8441
|
};
|
|
8535
|
-
const stackResult = (id, kind) => kind === "fill" ? { id, fills:
|
|
8442
|
+
const stackResult = (id, kind) => kind === "fill" ? { id, fills: _chunkUTEVPQTScjs.vectorFills.call(void 0, pathOf(id)) } : { id, strokes: _chunkUTEVPQTScjs.vectorStrokes.call(void 0, pathOf(id)) };
|
|
8536
8443
|
const layerPatchOf = (params, keys) => {
|
|
8537
8444
|
const out = {};
|
|
8538
8445
|
for (const key of keys) if (params[key] !== void 0) out[key] = key === "paint" ? checkPaint(params[key], "paint") : params[key];
|
|
@@ -8574,7 +8481,7 @@ function createVectorCommands(controller, options = {}) {
|
|
|
8574
8481
|
enabled: enabledFor,
|
|
8575
8482
|
run: (_ctx, params) => {
|
|
8576
8483
|
const targets = ids(params);
|
|
8577
|
-
check(controller.addPaintLayer(kind, layerPatchOf(_nullishCoalesce(params, () => ( {})), keys), { ids: targets, index: _optionalChain([params, 'optionalAccess',
|
|
8484
|
+
check(controller.addPaintLayer(kind, layerPatchOf(_nullishCoalesce(params, () => ( {})), keys), { ids: targets, index: _optionalChain([params, 'optionalAccess', _379 => _379.index]) }));
|
|
8578
8485
|
return { nodes: pathsUnder(targets).map((id) => stackResult(id, kind)) };
|
|
8579
8486
|
}
|
|
8580
8487
|
},
|
|
@@ -8644,14 +8551,113 @@ function createVectorCommands(controller, options = {}) {
|
|
|
8644
8551
|
additionalProperties: false
|
|
8645
8552
|
};
|
|
8646
8553
|
const checkFilterParams = (type, params) => {
|
|
8647
|
-
const allowed =
|
|
8554
|
+
const allowed = _chunkUTEVPQTScjs.vectorFilterParamKeys.call(void 0, type);
|
|
8648
8555
|
for (const key of Object.keys(_nullishCoalesce(params, () => ( {})))) if (!allowed.includes(key)) fail(`${type} has no parameter "${key}"; it takes ${allowed.join(", ")}.`);
|
|
8649
8556
|
};
|
|
8650
|
-
const filtersResult = (id) => ({ id, filters: _nullishCoalesce(_optionalChain([controller, 'access',
|
|
8557
|
+
const filtersResult = (id) => ({ id, filters: _nullishCoalesce(_optionalChain([controller, 'access', _380 => _380.getNode, 'call', _381 => _381(id), 'optionalAccess', _382 => _382.filters]), () => ( [])) });
|
|
8651
8558
|
const filterOf = (nodeId, filterId) => {
|
|
8652
8559
|
const node = _nullishCoalesce(controller.getNode(nodeId), () => ( fail(`There is no node "${nodeId}".`)));
|
|
8653
|
-
return _nullishCoalesce(_optionalChain([node, 'access',
|
|
8560
|
+
return _nullishCoalesce(_optionalChain([node, 'access', _383 => _383.filters, 'optionalAccess', _384 => _384.find, 'call', _385 => _385((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
8561
|
};
|
|
8562
|
+
const maskResult = (id) => ({ id, mask: _nullishCoalesce(_chunkUTEVPQTScjs.vectorMaskSummary.call(void 0, controller.getNode(id)), () => ( fail(`"${id}" is not a mask group.`))) });
|
|
8563
|
+
const maskInputs = (params) => {
|
|
8564
|
+
const list2 = [...new Set(ids(params))];
|
|
8565
|
+
if (list2.length < 2) fail(`Masking needs at least two objects (the mask and what it masks); got ${list2.length}. Pass ids, or select more.`);
|
|
8566
|
+
for (const id of list2) if (controller.getNode(id).locked) fail(`"${id}" is locked; ask the user to unlock it, or leave it out of ids.`);
|
|
8567
|
+
if (_optionalChain([params, 'optionalAccess', _386 => _386.maskId]) !== void 0 && !list2.includes(params.maskId)) fail(`maskId "${params.maskId}" must be one of ids (${list2.map((id) => `"${id}"`).join(", ")}).`);
|
|
8568
|
+
return list2;
|
|
8569
|
+
};
|
|
8570
|
+
const maskTargets = (params) => {
|
|
8571
|
+
const list2 = ids(params);
|
|
8572
|
+
const groups = list2.map((id) => controller.getNode(id)).filter((n) => _chunkUTEVPQTScjs.isVectorMaskGroup.call(void 0, n));
|
|
8573
|
+
if (!groups.length) fail(`None of ${list2.map((id) => `"${id}"`).join(", ")} is a mask group. Mask groups have a \`mask\` in vector.list; make one with vector.makeClippingMask or vector.makeOpacityMask.`);
|
|
8574
|
+
return groups.map((g) => g.id);
|
|
8575
|
+
};
|
|
8576
|
+
const MASK_INPUT = {
|
|
8577
|
+
ids: { ...IDS, description: "The objects to mask with, two or more sharing a parent (default: the selection). The topmost becomes the mask unless maskId says otherwise." },
|
|
8578
|
+
maskId: { type: "string", description: "Which of ids is the mask (default: the topmost)." },
|
|
8579
|
+
invert: { type: "boolean", description: "Show the contents only where the mask hides them (default false)." }
|
|
8580
|
+
};
|
|
8581
|
+
const maskCommands = () => [
|
|
8582
|
+
{
|
|
8583
|
+
...base,
|
|
8584
|
+
id: `${prefix}makeClippingMask`,
|
|
8585
|
+
label: "Make Clipping Mask",
|
|
8586
|
+
keywords: ["mask", "clip", "clipping", "clip path", "crop", "inside"],
|
|
8587
|
+
shortcut: "Mod+7",
|
|
8588
|
+
description: "Groups objects into a clipping mask group: the mask (the topmost object, or maskId) moves to the bottom of the new group and the others show only inside its outline (its paint is not drawn; every path in it counts, by its fill rule). Hit-testing, bounds, snapping and booleans use the clipped result. One undo step. Returns { id, mask: { type, invert, maskId, contents, enabled } }.",
|
|
8589
|
+
params: { type: "object", properties: MASK_INPUT, additionalProperties: false },
|
|
8590
|
+
undoable: true,
|
|
8591
|
+
enabled: enabledFor,
|
|
8592
|
+
run: (_ctx, params) => {
|
|
8593
|
+
const list2 = maskInputs(params);
|
|
8594
|
+
const r = controller.makeMask("clip", { ids: list2, ..._optionalChain([params, 'optionalAccess', _387 => _387.maskId]) ? { maskId: params.maskId } : {}, invert: _optionalChain([params, 'optionalAccess', _388 => _388.invert]) });
|
|
8595
|
+
if (!r.ok) fail(r.message);
|
|
8596
|
+
return maskResult(r.id);
|
|
8597
|
+
}
|
|
8598
|
+
},
|
|
8599
|
+
{
|
|
8600
|
+
...base,
|
|
8601
|
+
id: `${prefix}makeOpacityMask`,
|
|
8602
|
+
label: "Make Opacity Mask",
|
|
8603
|
+
keywords: ["mask", "opacity mask", "alpha", "luminance", "fade", "gradient mask", "soft mask"],
|
|
8604
|
+
description: "Groups objects into an opacity mask group: the mask (the topmost object, or maskId) moves to the bottom of the new group and hides the others where it is dark (luminance: white shows, black hides) or transparent (alpha). A gradient mask fades the contents. One undo step. Returns { id, mask: { type, invert, maskId, contents, enabled } }.",
|
|
8605
|
+
params: {
|
|
8606
|
+
type: "object",
|
|
8607
|
+
properties: { ...MASK_INPUT, type: { type: "string", enum: ["luminance", "alpha"], description: "luminance (by brightness, the default) or alpha (by opacity)." } },
|
|
8608
|
+
additionalProperties: false
|
|
8609
|
+
},
|
|
8610
|
+
undoable: true,
|
|
8611
|
+
enabled: enabledFor,
|
|
8612
|
+
run: (_ctx, params) => {
|
|
8613
|
+
const list2 = maskInputs(params);
|
|
8614
|
+
const r = controller.makeMask(_nullishCoalesce(_optionalChain([params, 'optionalAccess', _389 => _389.type]), () => ( "luminance")), { ids: list2, ..._optionalChain([params, 'optionalAccess', _390 => _390.maskId]) ? { maskId: params.maskId } : {}, invert: _optionalChain([params, 'optionalAccess', _391 => _391.invert]) });
|
|
8615
|
+
if (!r.ok) fail(r.message);
|
|
8616
|
+
return maskResult(r.id);
|
|
8617
|
+
}
|
|
8618
|
+
},
|
|
8619
|
+
{
|
|
8620
|
+
...base,
|
|
8621
|
+
id: `${prefix}setMaskOptions`,
|
|
8622
|
+
label: "Mask Options\u2026",
|
|
8623
|
+
keywords: ["mask", "clip", "invert", "alpha", "luminance", "opacity mask"],
|
|
8624
|
+
description: "Changes how mask groups mask: `type` clip (by outline), alpha or luminance, `invert`, and `enabled` (false hides the mask so the contents draw whole; true shows it again). Pass at least one. One undo step. Returns { groups: [{ id, mask }] }.",
|
|
8625
|
+
params: {
|
|
8626
|
+
type: "object",
|
|
8627
|
+
properties: {
|
|
8628
|
+
ids: { ...IDS, description: "Mask group ids (default: the selection)." },
|
|
8629
|
+
type: { type: "string", enum: ["clip", "alpha", "luminance"], description: "clip (the mask's outline), alpha (its opacity) or luminance (its brightness)." },
|
|
8630
|
+
invert: { type: "boolean", description: "true: show the contents where the mask hides them." },
|
|
8631
|
+
enabled: { type: "boolean", description: "false: turn the mask off (it is hidden and the contents draw whole); true: on again." }
|
|
8632
|
+
},
|
|
8633
|
+
additionalProperties: false
|
|
8634
|
+
},
|
|
8635
|
+
undoable: true,
|
|
8636
|
+
enabled: enabledFor,
|
|
8637
|
+
run: (_ctx, params) => {
|
|
8638
|
+
if (_optionalChain([params, 'optionalAccess', _392 => _392.type]) === void 0 && _optionalChain([params, 'optionalAccess', _393 => _393.invert]) === void 0 && _optionalChain([params, 'optionalAccess', _394 => _394.enabled]) === void 0) fail("Pass at least one of type, invert, enabled.");
|
|
8639
|
+
const groups = maskTargets(params);
|
|
8640
|
+
const patch = { ..._optionalChain([params, 'optionalAccess', _395 => _395.type]) ? { type: params.type } : {}, ..._optionalChain([params, 'optionalAccess', _396 => _396.invert]) !== void 0 ? { invert: params.invert } : {}, ..._optionalChain([params, 'optionalAccess', _397 => _397.enabled]) !== void 0 ? { enabled: params.enabled } : {} };
|
|
8641
|
+
check(controller.setMaskOptions(patch, { ids: groups }));
|
|
8642
|
+
return { groups: groups.map(maskResult) };
|
|
8643
|
+
}
|
|
8644
|
+
},
|
|
8645
|
+
{
|
|
8646
|
+
...base,
|
|
8647
|
+
id: `${prefix}releaseMask`,
|
|
8648
|
+
label: "Release Mask",
|
|
8649
|
+
keywords: ["mask", "clip", "release", "unmask", "remove mask"],
|
|
8650
|
+
shortcut: "Mod+Alt+7",
|
|
8651
|
+
description: "Releases mask groups: the mask goes back on top of the contents and draws as itself again; the group is replaced by its children unless it has filters, a blend mode or path effects (then it stays a plain group). One undo step. Returns { ids } of the released objects (the mask last).",
|
|
8652
|
+
params: { type: "object", properties: { ids: { ...IDS, description: "Mask group ids (default: the selection)." } }, additionalProperties: false },
|
|
8653
|
+
undoable: true,
|
|
8654
|
+
enabled: enabledFor,
|
|
8655
|
+
run: (_ctx, params) => {
|
|
8656
|
+
const groups = maskTargets(params);
|
|
8657
|
+
return { ids: controller.releaseMask({ ids: groups }) };
|
|
8658
|
+
}
|
|
8659
|
+
}
|
|
8660
|
+
];
|
|
8655
8661
|
const appearanceCommands = () => [
|
|
8656
8662
|
{
|
|
8657
8663
|
...base,
|
|
@@ -8682,7 +8688,7 @@ function createVectorCommands(controller, options = {}) {
|
|
|
8682
8688
|
run: (_ctx, params) => {
|
|
8683
8689
|
const targets = ids(params);
|
|
8684
8690
|
check(controller.setBlendMode(params.blendMode, { ids: targets }));
|
|
8685
|
-
return { nodes: targets.map((id) => ({ id, blendMode: _nullishCoalesce(_optionalChain([controller, 'access',
|
|
8691
|
+
return { nodes: targets.map((id) => ({ id, blendMode: _nullishCoalesce(_optionalChain([controller, 'access', _398 => _398.getNode, 'call', _399 => _399(id), 'optionalAccess', _400 => _400.blendMode]), () => ( "normal")) })) };
|
|
8686
8692
|
}
|
|
8687
8693
|
},
|
|
8688
8694
|
{
|
|
@@ -8694,7 +8700,7 @@ function createVectorCommands(controller, options = {}) {
|
|
|
8694
8700
|
params: {
|
|
8695
8701
|
type: "object",
|
|
8696
8702
|
properties: {
|
|
8697
|
-
type: { type: "string", enum:
|
|
8703
|
+
type: { type: "string", enum: _chunkUTEVPQTScjs.VECTOR_FILTER_TYPES, description: "The filter type." },
|
|
8698
8704
|
params: FILTER_PARAMS,
|
|
8699
8705
|
index: { type: "integer", minimum: 0, description: "Position in the stack (default: last)." },
|
|
8700
8706
|
ids: IDS
|
|
@@ -8705,7 +8711,7 @@ function createVectorCommands(controller, options = {}) {
|
|
|
8705
8711
|
undoable: true,
|
|
8706
8712
|
enabled: enabledFor,
|
|
8707
8713
|
run: (_ctx, params) => {
|
|
8708
|
-
if (!
|
|
8714
|
+
if (!_chunkUTEVPQTScjs.VECTOR_FILTER_TYPES.includes(params.type)) fail(`Unknown filter type "${params.type}"; use one of ${_chunkUTEVPQTScjs.VECTOR_FILTER_TYPES.join(", ")}.`);
|
|
8709
8715
|
checkFilterParams(params.type, params.params);
|
|
8710
8716
|
const targets = ids(params);
|
|
8711
8717
|
const created = controller.addFilter(params.type, { ids: targets, params: params.params, index: params.index });
|
|
@@ -8821,7 +8827,7 @@ function createVectorCommands(controller, options = {}) {
|
|
|
8821
8827
|
width: { type: "number", description: "For a line: the x offset of its end." },
|
|
8822
8828
|
height: { type: "number", description: "For a line: the y offset of its end." },
|
|
8823
8829
|
cornerRadius: { type: "number", minimum: 0, description: "Live corner radius of a rect, polygon or star." },
|
|
8824
|
-
cornerKind: { type: "string", enum:
|
|
8830
|
+
cornerKind: { type: "string", enum: _chunkUTEVPQTScjs.VECTOR_CORNER_KINDS },
|
|
8825
8831
|
sides: { type: "integer", minimum: 3 },
|
|
8826
8832
|
points: { type: "integer", minimum: 3 },
|
|
8827
8833
|
innerRatio: { type: "number", minimum: 0, maximum: 1 },
|
|
@@ -8844,7 +8850,7 @@ function createVectorCommands(controller, options = {}) {
|
|
|
8844
8850
|
run: (_ctx, params) => {
|
|
8845
8851
|
const id = controller.addPath(params.d, { ...pickStyle(params), ...params.name ? { name: params.name } : {} });
|
|
8846
8852
|
const node = controller.getNode(id);
|
|
8847
|
-
if (_optionalChain([node, 'optionalAccess',
|
|
8853
|
+
if (_optionalChain([node, 'optionalAccess', _401 => _401.type]) === "path" && !node.subpaths.length) {
|
|
8848
8854
|
controller.undo();
|
|
8849
8855
|
fail("The path data has no points.");
|
|
8850
8856
|
}
|
|
@@ -8878,29 +8884,30 @@ function createVectorCommands(controller, options = {}) {
|
|
|
8878
8884
|
undoable: true,
|
|
8879
8885
|
run: (_ctx, params) => {
|
|
8880
8886
|
const { ids: _i, target, ...patch } = _nullishCoalesce(params, () => ( {}));
|
|
8881
|
-
if (patch.type !== void 0 && !
|
|
8887
|
+
if (patch.type !== void 0 && !_chunkUTEVPQTScjs.VECTOR_GRADIENT_TYPES.includes(patch.type)) fail(`Unknown gradient type "${patch.type}".`);
|
|
8882
8888
|
if (patch.stops !== void 0 && !(Array.isArray(patch.stops) && patch.stops.length)) fail("stops needs at least one { offset, color }.");
|
|
8883
8889
|
check(controller.setGradient(patch, { ids: ids(params), target: _nullishCoalesce(target, () => ( "fill")) }));
|
|
8884
8890
|
const id = ids(params)[0];
|
|
8885
8891
|
const node = id ? controller.getNode(id) : void 0;
|
|
8886
|
-
const path = _optionalChain([node, 'optionalAccess',
|
|
8892
|
+
const path = _optionalChain([node, 'optionalAccess', _402 => _402.type]) === "path" ? node : void 0;
|
|
8887
8893
|
return { ok: true, ...path ? { gradient: path[_nullishCoalesce(target, () => ( "fill"))] } : {} };
|
|
8888
8894
|
}
|
|
8889
8895
|
},
|
|
8890
8896
|
...appearanceCommands(),
|
|
8897
|
+
...maskCommands(),
|
|
8891
8898
|
{
|
|
8892
8899
|
...base,
|
|
8893
8900
|
id: `${prefix}setCorners`,
|
|
8894
8901
|
label: "Corner Radius\u2026",
|
|
8895
8902
|
keywords: ["round", "rounded", "corners", "radius", "fillet", "chamfer", "live corners"],
|
|
8896
8903
|
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.",
|
|
8897
|
-
params: { type: "object", properties: { radius: { type: "number", minimum: 0 }, kind: { type: "string", enum:
|
|
8904
|
+
params: { type: "object", properties: { radius: { type: "number", minimum: 0 }, kind: { type: "string", enum: _chunkUTEVPQTScjs.VECTOR_CORNER_KINDS }, ids: IDS, anchors: ANCHORS } },
|
|
8898
8905
|
undoable: true,
|
|
8899
8906
|
run: (_ctx, params) => {
|
|
8900
|
-
const refs = _optionalChain([params, 'optionalAccess',
|
|
8901
|
-
const target = { refs, ids: _optionalChain([params, 'optionalAccess',
|
|
8902
|
-
if (_optionalChain([params, 'optionalAccess',
|
|
8903
|
-
else if (_optionalChain([params, 'optionalAccess',
|
|
8907
|
+
const refs = _optionalChain([params, 'optionalAccess', _403 => _403.anchors]) ? anchorsOf(params.anchors) : void 0;
|
|
8908
|
+
const target = { refs, ids: _optionalChain([params, 'optionalAccess', _404 => _404.ids]) ? ids(params) : void 0 };
|
|
8909
|
+
if (_optionalChain([params, 'optionalAccess', _405 => _405.radius]) !== void 0) check(controller.setCornerRadius(params.radius, { ...target, kind: params.kind }));
|
|
8910
|
+
else if (_optionalChain([params, 'optionalAccess', _406 => _406.kind])) check(controller.setCornerKind(params.kind, target));
|
|
8904
8911
|
else fail("Pass `radius` and / or `kind`.");
|
|
8905
8912
|
return { ok: true };
|
|
8906
8913
|
}
|
|
@@ -8915,7 +8922,7 @@ function createVectorCommands(controller, options = {}) {
|
|
|
8915
8922
|
type: "object",
|
|
8916
8923
|
properties: {
|
|
8917
8924
|
ids: IDS,
|
|
8918
|
-
preset: { type: "string", enum:
|
|
8925
|
+
preset: { type: "string", enum: _chunkUTEVPQTScjs.VECTOR_WIDTH_PRESET_IDS },
|
|
8919
8926
|
points: WIDTH_POINTS,
|
|
8920
8927
|
taper: {
|
|
8921
8928
|
type: "object",
|
|
@@ -8935,12 +8942,12 @@ function createVectorCommands(controller, options = {}) {
|
|
|
8935
8942
|
undoable: true,
|
|
8936
8943
|
run: (_ctx, params) => {
|
|
8937
8944
|
const target = { ids: ids(params) };
|
|
8938
|
-
if (_optionalChain([params, 'optionalAccess',
|
|
8939
|
-
else if (_optionalChain([params, 'optionalAccess',
|
|
8940
|
-
else if (_optionalChain([params, 'optionalAccess',
|
|
8945
|
+
if (_optionalChain([params, 'optionalAccess', _407 => _407.preset])) check(controller.setWidthProfile(params.preset, target));
|
|
8946
|
+
else if (_optionalChain([params, 'optionalAccess', _408 => _408.points]) !== void 0) check(controller.setWidthProfile(_nullishCoalesce(params.points, () => ( null)), target));
|
|
8947
|
+
else if (_optionalChain([params, 'optionalAccess', _409 => _409.taper]) || _optionalChain([params, 'optionalAccess', _410 => _410.wave])) check(controller.setWidthProfile({ taper: params.taper, wave: params.wave }, target));
|
|
8941
8948
|
else fail("Pass `preset`, `points`, `taper` or `wave`.");
|
|
8942
8949
|
const node = controller.getNode(target.ids[0]);
|
|
8943
|
-
return { ok: true, points: _optionalChain([node, 'optionalAccess',
|
|
8950
|
+
return { ok: true, points: _optionalChain([node, 'optionalAccess', _411 => _411.type]) === "path" ? _nullishCoalesce(node.strokeWidthProfile, () => ( [])) : [] };
|
|
8944
8951
|
}
|
|
8945
8952
|
},
|
|
8946
8953
|
{
|
|
@@ -8962,10 +8969,10 @@ function createVectorCommands(controller, options = {}) {
|
|
|
8962
8969
|
},
|
|
8963
8970
|
undoable: true,
|
|
8964
8971
|
run: (_ctx, params) => {
|
|
8965
|
-
if (!_optionalChain([params, 'optionalAccess',
|
|
8972
|
+
if (!_optionalChain([params, 'optionalAccess', _412 => _412.id])) fail("Pass the path `id`.");
|
|
8966
8973
|
check(controller.setWidthPoint({ nodeId: params.id, index: _nullishCoalesce(params.index, () => ( null)) }, { t: params.t, left: params.left, right: params.right }));
|
|
8967
8974
|
const node = controller.getNode(params.id);
|
|
8968
|
-
return { ok: true, points: _optionalChain([node, 'optionalAccess',
|
|
8975
|
+
return { ok: true, points: _optionalChain([node, 'optionalAccess', _413 => _413.type]) === "path" ? _nullishCoalesce(node.strokeWidthProfile, () => ( [])) : [] };
|
|
8969
8976
|
}
|
|
8970
8977
|
},
|
|
8971
8978
|
{
|
|
@@ -8978,7 +8985,7 @@ function createVectorCommands(controller, options = {}) {
|
|
|
8978
8985
|
enabled: enabledFor,
|
|
8979
8986
|
undoable: true,
|
|
8980
8987
|
run: (_ctx, params) => {
|
|
8981
|
-
const created = controller.outlineStroke({ ids: _optionalChain([params, 'optionalAccess',
|
|
8988
|
+
const created = controller.outlineStroke({ ids: _optionalChain([params, 'optionalAccess', _414 => _414.ids]) ? ids(params) : void 0 });
|
|
8982
8989
|
if (!created.length) fail("No selected path has a stroke.");
|
|
8983
8990
|
return { ids: created };
|
|
8984
8991
|
}
|
|
@@ -9063,7 +9070,7 @@ function createVectorCommands(controller, options = {}) {
|
|
|
9063
9070
|
if (params.release) return { released: target, shapes: controller.releaseEnvelope({ ids: target }) };
|
|
9064
9071
|
if (params.expand) return { expanded: controller.expandAppearance({ ids: target }) };
|
|
9065
9072
|
if (params.topObject) {
|
|
9066
|
-
const r = controller.makeEnvelopeWithTopObject({ ids: target, rows: _optionalChain([params, 'access',
|
|
9073
|
+
const r = controller.makeEnvelopeWithTopObject({ ids: target, rows: _optionalChain([params, 'access', _415 => _415.mesh, 'optionalAccess', _416 => _416.rows]), columns: _optionalChain([params, 'access', _417 => _417.mesh, 'optionalAccess', _418 => _418.columns]) });
|
|
9067
9074
|
check(r);
|
|
9068
9075
|
return { nodeId: r.nodeId };
|
|
9069
9076
|
}
|
|
@@ -9165,7 +9172,7 @@ function createVectorCommands(controller, options = {}) {
|
|
|
9165
9172
|
params: {
|
|
9166
9173
|
type: "object",
|
|
9167
9174
|
properties: {
|
|
9168
|
-
type: { type: "string", enum:
|
|
9175
|
+
type: { type: "string", enum: _chunkUTEVPQTScjs.VECTOR_EFFECT_TYPES },
|
|
9169
9176
|
params: { type: "object", description: EFFECT_PARAMS_DESCRIPTION },
|
|
9170
9177
|
index: { type: "integer", minimum: 0, description: "Position in the stack (default: last)." },
|
|
9171
9178
|
ids: IDS
|
|
@@ -9175,7 +9182,7 @@ function createVectorCommands(controller, options = {}) {
|
|
|
9175
9182
|
undoable: true,
|
|
9176
9183
|
enabled: enabledFor,
|
|
9177
9184
|
run: (_ctx, params) => {
|
|
9178
|
-
if (!
|
|
9185
|
+
if (!_chunkUTEVPQTScjs.VECTOR_EFFECT_TYPES.includes(params.type)) fail(`Unknown effect type "${params.type}".`);
|
|
9179
9186
|
const targets = ids(params);
|
|
9180
9187
|
const created = controller.addEffect(params.type, { ids: targets, params: params.params, index: params.index });
|
|
9181
9188
|
if (!created.length) fail("Nothing to add the effect to.");
|
|
@@ -9203,7 +9210,7 @@ function createVectorCommands(controller, options = {}) {
|
|
|
9203
9210
|
run: (_ctx, params) => {
|
|
9204
9211
|
if (params.params !== void 0 || params.enabled !== void 0) check(controller.updateEffect(params.nodeId, params.effectId, { params: params.params, enabled: params.enabled }));
|
|
9205
9212
|
if (params.index !== void 0) check(controller.moveEffect(params.nodeId, params.effectId, params.index));
|
|
9206
|
-
return { effects: _nullishCoalesce(_optionalChain([controller, 'access',
|
|
9213
|
+
return { effects: _nullishCoalesce(_optionalChain([controller, 'access', _419 => _419.getNode, 'call', _420 => _420(params.nodeId), 'optionalAccess', _421 => _421.effects]), () => ( [])) };
|
|
9207
9214
|
}
|
|
9208
9215
|
},
|
|
9209
9216
|
{
|
|
@@ -9267,7 +9274,7 @@ function createVectorCommands(controller, options = {}) {
|
|
|
9267
9274
|
undoable: true,
|
|
9268
9275
|
run: (_ctx, params) => {
|
|
9269
9276
|
checkBlendOptions(params);
|
|
9270
|
-
const r = controller.setBlendOptions(_nullishCoalesce(params, () => ( {})), { ids: _optionalChain([params, 'optionalAccess',
|
|
9277
|
+
const r = controller.setBlendOptions(_nullishCoalesce(params, () => ( {})), { ids: _optionalChain([params, 'optionalAccess', _422 => _422.ids]) });
|
|
9271
9278
|
if (!r.ok) fail(r.message);
|
|
9272
9279
|
return { ok: true };
|
|
9273
9280
|
}
|
|
@@ -9281,7 +9288,7 @@ function createVectorCommands(controller, options = {}) {
|
|
|
9281
9288
|
params: { type: "object", properties: { ids: IDS } },
|
|
9282
9289
|
undoable: true,
|
|
9283
9290
|
run: (_ctx, params) => {
|
|
9284
|
-
const groups = controller.expandBlend({ ids: _optionalChain([params, 'optionalAccess',
|
|
9291
|
+
const groups = controller.expandBlend({ ids: _optionalChain([params, 'optionalAccess', _423 => _423.ids]) });
|
|
9285
9292
|
if (!groups.length) fail("Select a blend to expand.");
|
|
9286
9293
|
return { ids: groups };
|
|
9287
9294
|
}
|
|
@@ -9295,7 +9302,7 @@ function createVectorCommands(controller, options = {}) {
|
|
|
9295
9302
|
params: { type: "object", properties: { ids: IDS } },
|
|
9296
9303
|
undoable: true,
|
|
9297
9304
|
run: (_ctx, params) => {
|
|
9298
|
-
const released = controller.releaseBlend({ ids: _optionalChain([params, 'optionalAccess',
|
|
9305
|
+
const released = controller.releaseBlend({ ids: _optionalChain([params, 'optionalAccess', _424 => _424.ids]) });
|
|
9299
9306
|
if (!released.length) fail("Select a blend to release.");
|
|
9300
9307
|
return { ids: released };
|
|
9301
9308
|
}
|
|
@@ -9309,7 +9316,7 @@ function createVectorCommands(controller, options = {}) {
|
|
|
9309
9316
|
params: { type: "object", properties: { ids: IDS } },
|
|
9310
9317
|
undoable: true,
|
|
9311
9318
|
run: (_ctx, params) => {
|
|
9312
|
-
const r = controller.replaceBlendSpine({ ids: _optionalChain([params, 'optionalAccess',
|
|
9319
|
+
const r = controller.replaceBlendSpine({ ids: _optionalChain([params, 'optionalAccess', _425 => _425.ids]) });
|
|
9313
9320
|
if (!r.ok) fail(r.message);
|
|
9314
9321
|
return { ok: true };
|
|
9315
9322
|
}
|
|
@@ -9320,10 +9327,10 @@ function createVectorCommands(controller, options = {}) {
|
|
|
9320
9327
|
label: "Pathfinder\u2026",
|
|
9321
9328
|
keywords: ["divide", "trim", "merge", "crop", "outline", "minus back", "split", "faces"],
|
|
9322
9329
|
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.",
|
|
9323
|
-
params: { type: "object", properties: { operation: { type: "string", enum: [...
|
|
9330
|
+
params: { type: "object", properties: { operation: { type: "string", enum: [..._chunkUTEVPQTScjs.VECTOR_PATHFINDER_OPERATIONS] }, ids: IDS }, required: ["operation"] },
|
|
9324
9331
|
undoable: true,
|
|
9325
9332
|
run: (_ctx, params) => {
|
|
9326
|
-
if (!
|
|
9333
|
+
if (!_chunkUTEVPQTScjs.VECTOR_PATHFINDER_OPERATIONS.includes(params.operation)) fail(`Unknown Pathfinder operation "${params.operation}".`);
|
|
9327
9334
|
const created = controller.pathfinder(params.operation, { ids: ids(params) });
|
|
9328
9335
|
if (!created.length) fail("Nothing came out: select paths that overlap (two or more, except for divide and outline).");
|
|
9329
9336
|
return { ids: created, selection: [...controller.getState().selection] };
|
|
@@ -9423,7 +9430,7 @@ function createVectorCommands(controller, options = {}) {
|
|
|
9423
9430
|
enabled: enabledFor,
|
|
9424
9431
|
undoable: true,
|
|
9425
9432
|
run: (_ctx, params) => {
|
|
9426
|
-
const id = controller.group({ ids: ids(params), name: _optionalChain([params, 'optionalAccess',
|
|
9433
|
+
const id = controller.group({ ids: ids(params), name: _optionalChain([params, 'optionalAccess', _426 => _426.name]) });
|
|
9427
9434
|
if (!id) fail("Only nodes that share a parent can be grouped.");
|
|
9428
9435
|
return { id };
|
|
9429
9436
|
}
|
|
@@ -9451,7 +9458,7 @@ function createVectorCommands(controller, options = {}) {
|
|
|
9451
9458
|
params: { type: "object", properties: { anchors: ANCHORS, keepShape: { type: "boolean" } } },
|
|
9452
9459
|
undoable: true,
|
|
9453
9460
|
run: (_ctx, params) => {
|
|
9454
|
-
check(controller.deleteAnchors(anchorsOf(_optionalChain([params, 'optionalAccess',
|
|
9461
|
+
check(controller.deleteAnchors(anchorsOf(_optionalChain([params, 'optionalAccess', _427 => _427.anchors])), { keepShape: _optionalChain([params, 'optionalAccess', _428 => _428.keepShape]) }));
|
|
9455
9462
|
return { ok: true };
|
|
9456
9463
|
}
|
|
9457
9464
|
},
|
|
@@ -9506,7 +9513,7 @@ function createVectorCommands(controller, options = {}) {
|
|
|
9506
9513
|
params: { type: "object", properties: { ids: IDS, tolerance: { type: "number", minimum: 0 } } },
|
|
9507
9514
|
undoable: true,
|
|
9508
9515
|
run: (_ctx, params) => {
|
|
9509
|
-
check(controller.joinPaths({ ids: _optionalChain([params, 'optionalAccess',
|
|
9516
|
+
check(controller.joinPaths({ ids: _optionalChain([params, 'optionalAccess', _429 => _429.ids]) ? ids(params) : void 0, tolerance: _optionalChain([params, 'optionalAccess', _430 => _430.tolerance]) }));
|
|
9510
9517
|
return { selection: controller.getState().selection };
|
|
9511
9518
|
}
|
|
9512
9519
|
},
|
|
@@ -9520,7 +9527,7 @@ function createVectorCommands(controller, options = {}) {
|
|
|
9520
9527
|
params: { type: "object", properties: { axis: { type: "string", enum: ["horizontal", "vertical", "both"] }, anchors: ANCHORS } },
|
|
9521
9528
|
undoable: true,
|
|
9522
9529
|
run: (_ctx, params) => {
|
|
9523
|
-
check(controller.averageAnchors(_nullishCoalesce(_optionalChain([params, 'optionalAccess',
|
|
9530
|
+
check(controller.averageAnchors(_nullishCoalesce(_optionalChain([params, 'optionalAccess', _431 => _431.axis]), () => ( "both")), anchorsOf(_optionalChain([params, 'optionalAccess', _432 => _432.anchors]))));
|
|
9524
9531
|
return { ok: true };
|
|
9525
9532
|
}
|
|
9526
9533
|
},
|
|
@@ -9534,7 +9541,7 @@ function createVectorCommands(controller, options = {}) {
|
|
|
9534
9541
|
enabled: enabledFor,
|
|
9535
9542
|
undoable: true,
|
|
9536
9543
|
run: (_ctx, params) => {
|
|
9537
|
-
check(controller.removeRedundantPoints({ ids: _optionalChain([params, 'optionalAccess',
|
|
9544
|
+
check(controller.removeRedundantPoints({ ids: _optionalChain([params, 'optionalAccess', _433 => _433.ids]) ? ids(params) : void 0, tolerance: _optionalChain([params, 'optionalAccess', _434 => _434.tolerance]) }));
|
|
9538
9545
|
return { ok: true };
|
|
9539
9546
|
}
|
|
9540
9547
|
},
|
|
@@ -9547,7 +9554,7 @@ function createVectorCommands(controller, options = {}) {
|
|
|
9547
9554
|
params: { type: "object", properties: { ids: IDS, amount: { type: "number", minimum: 0, maximum: 1 }, anchors: ANCHORS } },
|
|
9548
9555
|
undoable: true,
|
|
9549
9556
|
run: (_ctx, params) => {
|
|
9550
|
-
check(controller.smoothPaths({ ids: _optionalChain([params, 'optionalAccess',
|
|
9557
|
+
check(controller.smoothPaths({ ids: _optionalChain([params, 'optionalAccess', _435 => _435.ids]) ? ids(params) : void 0, amount: _optionalChain([params, 'optionalAccess', _436 => _436.amount]), refs: _optionalChain([params, 'optionalAccess', _437 => _437.anchors]) }));
|
|
9551
9558
|
return { ok: true };
|
|
9552
9559
|
}
|
|
9553
9560
|
},
|
|
@@ -9560,14 +9567,14 @@ function createVectorCommands(controller, options = {}) {
|
|
|
9560
9567
|
params: { type: "object", properties: { nodeId: { type: "string" }, x: { type: "number" }, y: { type: "number" }, anchors: ANCHORS } },
|
|
9561
9568
|
undoable: true,
|
|
9562
9569
|
run: (_ctx, params) => {
|
|
9563
|
-
if (_optionalChain([params, 'optionalAccess',
|
|
9570
|
+
if (_optionalChain([params, 'optionalAccess', _438 => _438.nodeId]) !== void 0) {
|
|
9564
9571
|
if (!controller.getNode(params.nodeId)) fail(`There is no node "${params.nodeId}".`);
|
|
9565
9572
|
if (params.x === void 0 || params.y === void 0) fail("Pass x and y with nodeId.");
|
|
9566
9573
|
const created = controller.cutPathAt(params.nodeId, { x: params.x, y: params.y });
|
|
9567
9574
|
if (!created) fail("Nothing to cut there (the end of an open path, or a locked path).");
|
|
9568
9575
|
return { ids: created };
|
|
9569
9576
|
}
|
|
9570
|
-
check(controller.cutAtAnchors(anchorsOf(_optionalChain([params, 'optionalAccess',
|
|
9577
|
+
check(controller.cutAtAnchors(anchorsOf(_optionalChain([params, 'optionalAccess', _439 => _439.anchors]))));
|
|
9571
9578
|
return { ids: controller.getState().selection };
|
|
9572
9579
|
}
|
|
9573
9580
|
},
|
|
@@ -9618,7 +9625,7 @@ function createVectorCommands(controller, options = {}) {
|
|
|
9618
9625
|
},
|
|
9619
9626
|
run: (_ctx, params) => {
|
|
9620
9627
|
const patch = {};
|
|
9621
|
-
for (const key of ["keepShapeOnDelete", "curvatureMoves", "pencilSmoothing", "recognizeShapes", "eraserSize", "pencilPressure"]) if (_optionalChain([params, 'optionalAccess',
|
|
9628
|
+
for (const key of ["keepShapeOnDelete", "curvatureMoves", "pencilSmoothing", "recognizeShapes", "eraserSize", "pencilPressure"]) if (_optionalChain([params, 'optionalAccess', _440 => _440[key]]) !== void 0) patch[key] = params[key];
|
|
9622
9629
|
controller.setEditing(patch);
|
|
9623
9630
|
return { editing: controller.getState().editing };
|
|
9624
9631
|
}
|
|
@@ -9629,7 +9636,7 @@ function createVectorCommands(controller, options = {}) {
|
|
|
9629
9636
|
label: "Choose Tool\u2026",
|
|
9630
9637
|
keywords: ["pen", "pencil", "select", "rectangle", "ellipse"],
|
|
9631
9638
|
description: "Switches the canvas tool.",
|
|
9632
|
-
params: { type: "object", properties: { tool: { type: "string", enum: [...
|
|
9639
|
+
params: { type: "object", properties: { tool: { type: "string", enum: [..._chunkUTEVPQTScjs.VECTOR_TOOLS] } }, required: ["tool"] },
|
|
9633
9640
|
run: (_ctx, params) => {
|
|
9634
9641
|
controller.setTool(params.tool);
|
|
9635
9642
|
return { tool: params.tool };
|
|
@@ -9643,7 +9650,7 @@ function createVectorCommands(controller, options = {}) {
|
|
|
9643
9650
|
keywords: ["download", "save", "markup"],
|
|
9644
9651
|
description: "Returns the document as SVG markup.",
|
|
9645
9652
|
params: { type: "object", properties: { precision: { type: "integer", minimum: 0, maximum: 8 } } },
|
|
9646
|
-
run: (_ctx, params) => ({ svg: controller.toSvg({ precision: _optionalChain([params, 'optionalAccess',
|
|
9653
|
+
run: (_ctx, params) => ({ svg: controller.toSvg({ precision: _optionalChain([params, 'optionalAccess', _441 => _441.precision]) }) })
|
|
9647
9654
|
},
|
|
9648
9655
|
{
|
|
9649
9656
|
...base,
|
|
@@ -10097,5 +10104,27 @@ function createVectorCommands(controller, options = {}) {
|
|
|
10097
10104
|
|
|
10098
10105
|
|
|
10099
10106
|
|
|
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;
|
|
10107
|
+
|
|
10108
|
+
|
|
10109
|
+
|
|
10110
|
+
|
|
10111
|
+
|
|
10112
|
+
|
|
10113
|
+
|
|
10114
|
+
|
|
10115
|
+
|
|
10116
|
+
|
|
10117
|
+
|
|
10118
|
+
|
|
10119
|
+
|
|
10120
|
+
|
|
10121
|
+
|
|
10122
|
+
|
|
10123
|
+
|
|
10124
|
+
|
|
10125
|
+
|
|
10126
|
+
|
|
10127
|
+
|
|
10128
|
+
|
|
10129
|
+
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 = _chunkUTEVPQTScjs.KAPPA; exports.LazyMouse = LazyMouse; exports.VECTOR_ARROWHEADS = _chunkUTEVPQTScjs.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 = _chunkUTEVPQTScjs.VECTOR_BLEND_MODES; exports.VECTOR_BLEND_MODE_LABELS = _chunkUTEVPQTScjs.VECTOR_BLEND_MODE_LABELS; exports.VECTOR_BLEND_MODE_MENU = VECTOR_BLEND_MODE_MENU; exports.VECTOR_BLEND_SPACINGS = _chunkUTEVPQTScjs.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 = _chunkUTEVPQTScjs.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 = _chunkUTEVPQTScjs.VECTOR_EFFECT_DEFAULTS; exports.VECTOR_EFFECT_LABELS = _chunkUTEVPQTScjs.VECTOR_EFFECT_LABELS; exports.VECTOR_EFFECT_MENU = VECTOR_EFFECT_MENU; exports.VECTOR_EFFECT_PARAM_SPECS = _chunkUTEVPQTScjs.VECTOR_EFFECT_PARAM_SPECS; exports.VECTOR_EFFECT_TYPES = _chunkUTEVPQTScjs.VECTOR_EFFECT_TYPES; exports.VECTOR_ENVELOPE_STYLE_OPTIONS = VECTOR_ENVELOPE_STYLE_OPTIONS; exports.VECTOR_FILL_GAP = VECTOR_FILL_GAP; exports.VECTOR_FILTER_DEFAULTS = _chunkUTEVPQTScjs.VECTOR_FILTER_DEFAULTS; exports.VECTOR_FILTER_LABELS = _chunkUTEVPQTScjs.VECTOR_FILTER_LABELS; exports.VECTOR_FILTER_MENU = _chunkUTEVPQTScjs.VECTOR_FILTER_MENU; exports.VECTOR_FILTER_PARAM_SPECS = _chunkUTEVPQTScjs.VECTOR_FILTER_PARAM_SPECS; exports.VECTOR_FILTER_TYPES = _chunkUTEVPQTScjs.VECTOR_FILTER_TYPES; exports.VECTOR_GRADIENT_INTERPOLATIONS = _chunkUTEVPQTScjs.VECTOR_GRADIENT_INTERPOLATIONS; exports.VECTOR_GRADIENT_INTERPOLATION_LABELS = VECTOR_GRADIENT_INTERPOLATION_LABELS; exports.VECTOR_GRADIENT_MAX_PERIODS = _chunkUTEVPQTScjs.VECTOR_GRADIENT_MAX_PERIODS; exports.VECTOR_GRADIENT_MIDPOINT_GAP = VECTOR_GRADIENT_MIDPOINT_GAP; exports.VECTOR_GRADIENT_MIN_STOPS = _chunkUTEVPQTScjs.VECTOR_GRADIENT_MIN_STOPS; exports.VECTOR_GRADIENT_OFF_BAR = VECTOR_GRADIENT_OFF_BAR; exports.VECTOR_GRADIENT_SPREADS = _chunkUTEVPQTScjs.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 = _chunkUTEVPQTScjs.VECTOR_GRADIENT_TYPES; exports.VECTOR_GRADIENT_TYPE_LABELS = VECTOR_GRADIENT_TYPE_LABELS; exports.VECTOR_INK_MAX_CORNERS = VECTOR_INK_MAX_CORNERS; exports.VECTOR_MASK_TYPES = _chunkUTEVPQTScjs.VECTOR_MASK_TYPES; exports.VECTOR_MASK_TYPE_LABELS = VECTOR_MASK_TYPE_LABELS; exports.VECTOR_MASK_TYPE_OPTIONS = VECTOR_MASK_TYPE_OPTIONS; exports.VECTOR_MERGE_MODES = _chunkUTEVPQTScjs.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 = _chunkUTEVPQTScjs.VECTOR_PATHFINDER_OPERATIONS; exports.VECTOR_PATH_ACTIONS = VECTOR_PATH_ACTIONS; exports.VECTOR_PENCIL_STRING_PX = VECTOR_PENCIL_STRING_PX; exports.VECTOR_PRESSURE_NOMINAL = _chunkUTEVPQTScjs.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 = _chunkUTEVPQTScjs.VECTOR_STROKE_GRADIENT_MODES; exports.VECTOR_STROKE_GRADIENT_MODE_LABELS = VECTOR_STROKE_GRADIENT_MODE_LABELS; exports.VECTOR_STROKE_SETTING_KEYS = _chunkUTEVPQTScjs.VECTOR_STROKE_SETTING_KEYS; exports.VECTOR_STYLE_KEYS = VECTOR_STYLE_KEYS; exports.VECTOR_TOOLS = _chunkUTEVPQTScjs.VECTOR_TOOLS; exports.VECTOR_TOOL_GLYPHS = VECTOR_TOOL_GLYPHS; exports.VECTOR_TOOL_SHORTCUTS = VECTOR_TOOL_SHORTCUTS; exports.VECTOR_TRANSFORM_HANDLES = _chunkUTEVPQTScjs.VECTOR_TRANSFORM_HANDLES; exports.VECTOR_WARP_STYLES = _chunkDWGZUSEScjs.WARP_STYLES; exports.VECTOR_WARP_STYLE_LABELS = _chunkDWGZUSEScjs.WARP_STYLE_LABELS; exports.VECTOR_WIDTH_PRESETS = _chunkUTEVPQTScjs.VECTOR_WIDTH_PRESETS; exports.VECTOR_WIDTH_PRESET_IDS = _chunkUTEVPQTScjs.VECTOR_WIDTH_PRESET_IDS; exports.VECTOR_WIDTH_PROFILE_MAX_POINTS = _chunkUTEVPQTScjs.VECTOR_WIDTH_PROFILE_MAX_POINTS; exports.VECTOR_WIDTH_PROFILE_MAX_SCALE = _chunkUTEVPQTScjs.VECTOR_WIDTH_PROFILE_MAX_SCALE; exports.VECTOR_WIDTH_SAME_T = _chunkUTEVPQTScjs.VECTOR_WIDTH_SAME_T; exports.VectorEditorController = VectorEditorController; exports.VectorSnapTargets = VectorSnapTargets; exports.activeVectorEffects = _chunkUTEVPQTScjs.activeVectorEffects; exports.activeVectorFilters = _chunkUTEVPQTScjs.activeVectorFilters; exports.addBuilderHit = addBuilderHit; exports.applyMatrix = _chunkDWGZUSEScjs.applyMatrix; exports.applyMatrixLinear = _chunkDWGZUSEScjs.applyMatrixLinear; exports.applyVectorBlendOptions = applyVectorBlendOptions; exports.applyVectorCornersAttribute = _chunkUTEVPQTScjs.applyVectorCornersAttribute; exports.applyVectorEffects = _chunkUTEVPQTScjs.applyVectorEffects; exports.applyVectorGradientPatch = _chunkUTEVPQTScjs.applyVectorGradientPatch; exports.applyVectorGradientSpread = _chunkUTEVPQTScjs.applyVectorGradientSpread; exports.applyVectorHomography = _chunkMUUXNRU4cjs.applyHomography; exports.arrowheadInset = _chunkUTEVPQTScjs.arrowheadInset; exports.arrowheadPath = _chunkUTEVPQTScjs.arrowheadPath; exports.arrowheadWeight = _chunkUTEVPQTScjs.arrowheadWeight; exports.bendSegment = bendSegment; exports.bezierToSubpaths = _chunkUTEVPQTScjs.bezierToSubpaths; exports.boundsFromPoints = _chunkUTEVPQTScjs.boundsFromPoints; exports.boundsIntersect = _chunkUTEVPQTScjs.boundsIntersect; exports.clearVectorLiveBooleanCache = _chunkUTEVPQTScjs.clearVectorLiveBooleanCache; exports.cloneAnchor = _chunkUTEVPQTScjs.cloneAnchor; exports.cloneSubpath = _chunkUTEVPQTScjs.cloneSubpath; exports.cloneVectorDocument = _chunkUTEVPQTScjs.cloneVectorDocument; exports.cloneVectorNode = _chunkUTEVPQTScjs.cloneVectorNode; exports.collectPathNodes = _chunkUTEVPQTScjs.collectPathNodes; exports.constrainToLeave = constrainToLeave; exports.convertAnchor = _chunkUTEVPQTScjs.convertAnchor; exports.convertVectorGradient = _chunkUTEVPQTScjs.convertVectorGradient; exports.cornerBisectorPoint = _chunkUTEVPQTScjs.cornerBisectorPoint; exports.cornerRadiusChange = _chunkUTEVPQTScjs.cornerRadiusChange; exports.cornerSetback = _chunkUTEVPQTScjs.cornerSetback; exports.correspondMorphContours = _chunkUTEVPQTScjs.correspondMorphContours; exports.createVectorCommands = createVectorCommands; exports.createVectorEffect = _chunkUTEVPQTScjs.createVectorEffect; exports.createVectorFilter = _chunkUTEVPQTScjs.createVectorFilter; exports.createVectorMorph = _chunkUTEVPQTScjs.createVectorMorph; exports.curvatureMoveAnchor = curvatureMoveAnchor; exports.cutSubpathAt = cutSubpathAt; exports.dashIntervals = _chunkUTEVPQTScjs.dashIntervals; exports.decomposeRigid = _chunkDWGZUSEScjs.decomposeRigid; exports.defaultVectorGradient = _chunkUTEVPQTScjs.defaultVectorGradient; exports.distortVectorNode = distortVectorNode; exports.dragVectorMeshPoint = _chunkDWGZUSEScjs.dragWarpMeshPoint; exports.effectPathLength = _chunkUTEVPQTScjs.effectPathLength; exports.effectPathVertexCount = _chunkUTEVPQTScjs.effectPathVertexCount; exports.effectiveStrokeAlign = _chunkUTEVPQTScjs.effectiveStrokeAlign; exports.ellipseSubpath = _chunkUTEVPQTScjs.ellipseSubpath; exports.eraseFromFill = _chunkUTEVPQTScjs.eraseFromFill; exports.eraseFromOutline = _chunkUTEVPQTScjs.eraseFromOutline; exports.eraserRegion = _chunkUTEVPQTScjs.eraserRegion; exports.evalVectorMesh = _chunkDWGZUSEScjs.evalWarpMesh; exports.evaluateVectorPathKeyframes = _chunkUTEVPQTScjs.evaluateVectorPathKeyframes; exports.expandVectorAppearance = _chunkUTEVPQTScjs.expandVectorAppearance; exports.expandVectorAppearances = _chunkUTEVPQTScjs.expandVectorAppearances; exports.expandVectorBlend = expandVectorBlend; exports.expandVectorCorners = _chunkUTEVPQTScjs.expandVectorCorners; exports.expandVectorCornersOf = _chunkUTEVPQTScjs.expandVectorCornersOf; exports.expandVectorGradientSpread = _chunkUTEVPQTScjs.expandVectorGradientSpread; exports.expandVectorGradientStops = _chunkUTEVPQTScjs.expandVectorGradientStops; exports.explicitVectorGradient = _chunkUTEVPQTScjs.explicitVectorGradient; exports.findVectorNode = _chunkUTEVPQTScjs.findVectorNode; exports.fitCornerRadius = _chunkUTEVPQTScjs.fitCornerRadius; exports.fitVectorMesh = _chunkDWGZUSEScjs.fitWarpMesh; exports.foldVectorBooleanOperands = _chunkUTEVPQTScjs.foldVectorBooleanOperands; exports.generateVectorBlendChildren = generateVectorBlendChildren; exports.generateWidthProfile = _chunkUTEVPQTScjs.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.getVectorMaskPanel = getVectorMaskPanel; 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 = _chunkUTEVPQTScjs.gradientMidpointRemap; exports.hasExplicitGradientGeometry = _chunkUTEVPQTScjs.hasExplicitGradientGeometry; exports.hasOwnVectorAppearance = _chunkUTEVPQTScjs.hasOwnVectorAppearance; exports.hasPaint = _chunkUTEVPQTScjs.hasPaint; exports.hasStrokeExtras = _chunkUTEVPQTScjs.hasStrokeExtras; exports.hasVectorAppearance = _chunkUTEVPQTScjs.hasVectorAppearance; exports.hasVectorCorners = _chunkUTEVPQTScjs.hasVectorCorners; exports.hasVectorPaintStacks = _chunkUTEVPQTScjs.hasVectorPaintStacks; exports.hitTestVectorNode = _chunkUTEVPQTScjs.hitTestVectorNode; exports.hitTestVectorNodes = _chunkUTEVPQTScjs.hitTestVectorNodes; exports.hitTestVectorPaintLayer = _chunkUTEVPQTScjs.hitTestVectorPaintLayer; exports.hitTestVectorPaintStack = _chunkUTEVPQTScjs.hitTestVectorPaintStack; exports.hitTestVectorStroke = _chunkUTEVPQTScjs.hitTestVectorStroke; exports.hitVectorGradientAnnotator = hitVectorGradientAnnotator; exports.inferAnchorType = _chunkUTEVPQTScjs.inferAnchorType; exports.insertAnchor = _chunkUTEVPQTScjs.insertAnchor; exports.insertVectorGradientStop = _chunkUTEVPQTScjs.insertVectorGradientStop; exports.insertWidthPoint = _chunkUTEVPQTScjs.insertWidthPoint; exports.interpolateMorphContours = _chunkUTEVPQTScjs.interpolateMorphContours; exports.interpolateRigidMatrix = _chunkUTEVPQTScjs.interpolateRigidMatrix; exports.interpolateVectorColor = _chunkUTEVPQTScjs.interpolateVectorColor; exports.interpolateVectorPaint = _chunkUTEVPQTScjs.interpolateVectorPaint; exports.interpolateVectorPaths = _chunkUTEVPQTScjs.interpolateVectorPaths; exports.interpolateVectorStyle = _chunkUTEVPQTScjs.interpolateVectorStyle; exports.interpolateWidthProfiles = _chunkUTEVPQTScjs.interpolateWidthProfiles; exports.invertMatrix = _chunkDWGZUSEScjs.invertMatrix; exports.isCentredVectorGradient = _chunkUTEVPQTScjs.isCentredVectorGradient; exports.isClosedBezierShape = _chunkUTEVPQTScjs.isClosedBezierShape; exports.isDrawnVectorPaintLayer = _chunkUTEVPQTScjs.isDrawnVectorPaintLayer; exports.isIdentityMatrix = _chunkDWGZUSEScjs.isIdentityMatrix; exports.isPlainVectorPaintLayer = _chunkUTEVPQTScjs.isPlainVectorPaintLayer; exports.isUniformWidthProfile = _chunkUTEVPQTScjs.isUniformWidthProfile; exports.isValidVectorMesh = _chunkDWGZUSEScjs.isValidWarpMesh; exports.isVectorBlendGroup = isVectorBlendGroup; exports.isVectorBlendMode = _chunkUTEVPQTScjs.isVectorBlendMode; exports.isVectorFilterType = _chunkUTEVPQTScjs.isVectorFilterType; exports.isVectorGradient = _chunkUTEVPQTScjs.isVectorGradient; exports.isVectorLiveBoolean = _chunkUTEVPQTScjs.isVectorLiveBoolean; exports.isVectorMaskActive = _chunkUTEVPQTScjs.isVectorMaskActive; exports.isVectorMaskGroup = _chunkUTEVPQTScjs.isVectorMaskGroup; exports.isVectorMaskType = _chunkUTEVPQTScjs.isVectorMaskType; exports.isVectorTextTarget = isVectorTextTarget; exports.joinSubpaths = joinSubpaths; exports.knifePath = _chunkUTEVPQTScjs.knifePath; exports.lineSubpath = _chunkUTEVPQTScjs.lineSubpath; exports.locateVectorNode = _chunkUTEVPQTScjs.locateVectorNode; exports.mapBezierPath = _chunkUTEVPQTScjs.mapBezierPath; exports.mapVectorGradient = _chunkUTEVPQTScjs.mapVectorGradient; exports.mapVectorMeshPoints = _chunkDWGZUSEScjs.mapWarpMeshPoints; exports.mapVectorPaint = _chunkUTEVPQTScjs.mapVectorPaint; exports.mapVectorPoints = _chunkUTEVPQTScjs.mapVectorPoints; exports.mapVectorSubpaths = _chunkUTEVPQTScjs.mapVectorSubpaths; exports.matrixRotation = _chunkDWGZUSEScjs.matrixRotation; exports.mergePaths = _chunkUTEVPQTScjs.mergePaths; exports.mirrorWidthProfile = _chunkUTEVPQTScjs.mirrorWidthProfile; exports.morphContourToSubpath = _chunkUTEVPQTScjs.morphContourToSubpath; exports.morphPathsCross = _chunkUTEVPQTScjs.morphPathsCross; exports.moveAnchorHandle = _chunkUTEVPQTScjs.moveAnchorHandle; exports.moveVectorGradientHandle = _chunkUTEVPQTScjs.moveVectorGradientHandle; exports.moveVectorGradientStop = _chunkUTEVPQTScjs.moveVectorGradientStop; exports.multiplyMatrices = _chunkDWGZUSEScjs.multiplyMatrices; exports.nearestSegment = _chunkUTEVPQTScjs.nearestSegment; exports.nearestStrokePosition = _chunkUTEVPQTScjs.nearestStrokePosition; exports.needsVectorPaintLayers = _chunkUTEVPQTScjs.needsVectorPaintLayers; exports.newVectorStrokeLayer = _chunkUTEVPQTScjs.newVectorStrokeLayer; exports.nextVectorCornerKind = _chunkUTEVPQTScjs.nextVectorCornerKind; exports.nodeMatrix = _chunkUTEVPQTScjs.nodeMatrix; exports.normalizeVectorEffectParams = _chunkUTEVPQTScjs.normalizeVectorEffectParams; exports.normalizeVectorFilterParams = _chunkUTEVPQTScjs.normalizeVectorFilterParams; exports.normalizeVectorPaintStacks = _chunkUTEVPQTScjs.normalizeVectorPaintStacks; exports.offsetPaths = _chunkUTEVPQTScjs.offsetPaths; exports.orderVectorQuad = _chunkMUUXNRU4cjs.orderQuad; exports.parseSvgTransform = _chunkUTEVPQTScjs.parseSvgTransform; exports.parseVectorColor = _chunkUTEVPQTScjs.parseVectorColor; exports.parseVectorSvg = _chunkUTEVPQTScjs.parseVectorSvg; exports.pathsCenter = _chunkUTEVPQTScjs.pathsCenter; exports.patternAttrs = _chunkUTEVPQTScjs.patternAttrs; exports.periodicVectorGradientStops = _chunkUTEVPQTScjs.periodicVectorGradientStops; exports.pinVectorGradient = _chunkUTEVPQTScjs.pinVectorGradient; exports.planShapeBuilder = planShapeBuilder; exports.polygonSubpath = _chunkUTEVPQTScjs.polygonSubpath; exports.polylineBounds = _chunkUTEVPQTScjs.polylineBounds; exports.pressureWidthProfile = _chunkUTEVPQTScjs.pressureWidthProfile; exports.puckerBloatPaths = _chunkUTEVPQTScjs.puckerBloatPaths; exports.pullVectorMesh = _chunkDWGZUSEScjs.pullWarpMesh; exports.recognizeInkShape = recognizeInkShape; exports.rectSubpath = _chunkUTEVPQTScjs.rectSubpath; exports.refineMorphContour = _chunkUTEVPQTScjs.refineMorphContour; exports.refreshVectorBlends = refreshVectorBlends; exports.releaseVectorBlend = releaseVectorBlend; exports.removeAnchorKeepingShape = removeAnchorKeepingShape; exports.removeAnchors = _chunkUTEVPQTScjs.removeAnchors; exports.removeAnchorsKeepingShape = removeAnchorsKeepingShape; exports.removeRedundantPoints = removeRedundantPoints; exports.removeVectorGradientStop = _chunkUTEVPQTScjs.removeVectorGradientStop; exports.removeVectorMeshSplitU = _chunkDWGZUSEScjs.removeWarpMeshSplitU; exports.removeVectorMeshSplitV = _chunkDWGZUSEScjs.removeWarpMeshSplitV; exports.removeWidthPoints = _chunkUTEVPQTScjs.removeWidthPoints; exports.repeatPaths = _chunkUTEVPQTScjs.repeatPaths; exports.resampleGradientStops = _chunkUTEVPQTScjs.resampleGradientStops; exports.resizeVectorMesh = _chunkDWGZUSEScjs.resizeWarpMesh; exports.resolveVectorBlendOptions = resolveVectorBlendOptions; exports.reverseMorphContour = _chunkUTEVPQTScjs.reverseMorphContour; exports.reverseSubpath = _chunkUTEVPQTScjs.reverseSubpath; exports.reverseVectorGradient = _chunkUTEVPQTScjs.reverseVectorGradient; exports.reverseWidthProfile = _chunkUTEVPQTScjs.reverseWidthProfile; exports.rotateMatrix = _chunkDWGZUSEScjs.rotateMatrix; exports.roundCornerPaths = _chunkUTEVPQTScjs.roundCornerPaths; exports.roundSubpaths = _chunkUTEVPQTScjs.roundSubpaths; exports.samplePlainStops = _chunkUTEVPQTScjs.samplePlainStops; exports.samplePolyline = samplePolyline; exports.sampleVectorGradient = _chunkUTEVPQTScjs.sampleVectorGradient; exports.sampleVectorGradientAt = _chunkUTEVPQTScjs.sampleVectorGradientAt; exports.sampleVectorPaintDefAt = _chunkUTEVPQTScjs.sampleVectorPaintDefAt; exports.sanitizeVectorEffects = _chunkUTEVPQTScjs.sanitizeVectorEffects; exports.sanitizeVectorFills = _chunkUTEVPQTScjs.sanitizeVectorFills; exports.sanitizeVectorFilters = _chunkUTEVPQTScjs.sanitizeVectorFilters; exports.sanitizeVectorGradient = _chunkUTEVPQTScjs.sanitizeVectorGradient; exports.sanitizeVectorMask = _chunkUTEVPQTScjs.sanitizeVectorMask; exports.sanitizeVectorStrokeSettings = _chunkUTEVPQTScjs.sanitizeVectorStrokeSettings; exports.sanitizeVectorStrokes = _chunkUTEVPQTScjs.sanitizeVectorStrokes; exports.sanitizeWidthProfile = _chunkUTEVPQTScjs.sanitizeWidthProfile; exports.scaleFor = scaleFor; exports.scaleMatrix = _chunkDWGZUSEScjs.scaleMatrix; exports.setAnchorCorner = _chunkUTEVPQTScjs.setAnchorCorner; exports.setSubpathCorners = _chunkUTEVPQTScjs.setSubpathCorners; exports.setVectorGradientVector = _chunkUTEVPQTScjs.setVectorGradientVector; exports.setWidthPoint = _chunkUTEVPQTScjs.setWidthPoint; exports.simplifyPolyline = _chunkUTEVPQTScjs.simplifyPolyline; exports.smoothSubpath = smoothSubpath; exports.solve8 = _chunkMUUXNRU4cjs.solve8; exports.sortedVectorGradientStops = _chunkUTEVPQTScjs.sortedVectorGradientStops; exports.spanVectorGradientStops = _chunkUTEVPQTScjs.spanVectorGradientStops; exports.splitIntoFaces = _chunkUTEVPQTScjs.splitIntoFaces; exports.splitSubpathAt = splitSubpathAt; exports.splitVectorMeshU = _chunkDWGZUSEScjs.splitWarpMeshU; exports.splitVectorMeshV = _chunkDWGZUSEScjs.splitWarpMeshV; exports.starSubpath = _chunkUTEVPQTScjs.starSubpath; exports.strokePositionPoint = _chunkUTEVPQTScjs.strokePositionPoint; exports.strokeWidthProfileOf = _chunkUTEVPQTScjs.strokeWidthProfileOf; exports.subpathEnclosesArea = subpathEnclosesArea; exports.subpathPointAt = subpathPointAt; exports.subpathSegment = _chunkUTEVPQTScjs.subpathSegment; exports.subpathSegmentCount = _chunkUTEVPQTScjs.subpathSegmentCount; exports.subpathToMorphContour = _chunkUTEVPQTScjs.subpathToMorphContour; exports.subpathsToBezier = _chunkUTEVPQTScjs.subpathsToBezier; exports.taperWaveFactor = _chunkUTEVPQTScjs.taperWaveFactor; exports.toVectorKeyInput = toVectorKeyInput; exports.toVectorModifiers = toVectorModifiers; exports.toVectorPointerInput = toVectorPointerInput; exports.transformVectorEffects = _chunkUTEVPQTScjs.transformVectorEffects; exports.transformVectorGradient = _chunkUTEVPQTScjs.transformVectorGradient; exports.transformVectorNode = _chunkUTEVPQTScjs.transformVectorNode; exports.transformVectorPaint = _chunkUTEVPQTScjs.transformVectorPaint; exports.translateAnchor = _chunkUTEVPQTScjs.translateAnchor; exports.translateMatrix = _chunkDWGZUSEScjs.translateMatrix; exports.trimIntervals = _chunkUTEVPQTScjs.trimIntervals; exports.trimPaths = _chunkUTEVPQTScjs.trimPaths; exports.trimPathsIndividually = _chunkUTEVPQTScjs.trimPathsIndividually; exports.turnMorphContour = _chunkUTEVPQTScjs.turnMorphContour; exports.twistPaths = _chunkUTEVPQTScjs.twistPaths; exports.unionBounds = _chunkUTEVPQTScjs.unionBounds; exports.variableStrokeOutline = _chunkUTEVPQTScjs.variableStrokeOutline; exports.variableStrokeRings = _chunkUTEVPQTScjs.variableStrokeRings; exports.vectorAppearanceNodes = _chunkUTEVPQTScjs.vectorAppearanceNodes; exports.vectorAppearanceOutline = _chunkUTEVPQTScjs.vectorAppearanceOutline; exports.vectorAppearanceShapes = _chunkUTEVPQTScjs.vectorAppearanceShapes; exports.vectorBlendColorDistance = vectorBlendColorDistance; exports.vectorBlendKeyTargets = vectorBlendKeyTargets; exports.vectorBlendKeys = vectorBlendKeys; exports.vectorBlendModeCss = _chunkUTEVPQTScjs.vectorBlendModeCss; exports.vectorBlendModeFromCss = _chunkUTEVPQTScjs.vectorBlendModeFromCss; exports.vectorBlendRail = vectorBlendRail; exports.vectorBlendRailAt = vectorBlendRailAt; exports.vectorBlendSpine = vectorBlendSpine; exports.vectorBlendStepCount = vectorBlendStepCount; exports.vectorBoxCorners = vectorBoxCorners; exports.vectorBoxMatrix = _chunkUTEVPQTScjs.vectorBoxMatrix; exports.vectorBuilderErasedEdges = vectorBuilderErasedEdges; exports.vectorChildAppearanceShapes = _chunkUTEVPQTScjs.vectorChildAppearanceShapes; exports.vectorCornerAt = _chunkUTEVPQTScjs.vectorCornerAt; exports.vectorCorners = _chunkUTEVPQTScjs.vectorCorners; exports.vectorCornersAttribute = _chunkUTEVPQTScjs.vectorCornersAttribute; exports.vectorDiamondPath = vectorDiamondPath; exports.vectorDistortQuad = vectorDistortQuad; exports.vectorDocumentToSvg = _chunkUTEVPQTScjs.vectorDocumentToSvg; exports.vectorEffectInputBounds = _chunkUTEVPQTScjs.vectorEffectInputBounds; exports.vectorEffectInputPaths = _chunkUTEVPQTScjs.vectorEffectInputPaths; exports.vectorEnteredGroups = _chunkUTEVPQTScjs.vectorEnteredGroups; exports.vectorEnvelopeFrame = _chunkUTEVPQTScjs.vectorEnvelopeFrame; exports.vectorEnvelopeMap = _chunkUTEVPQTScjs.vectorEnvelopeMap; exports.vectorEnvelopeMesh = _chunkUTEVPQTScjs.vectorEnvelopeMesh; exports.vectorFillMap = vectorFillMap; exports.vectorFills = _chunkUTEVPQTScjs.vectorFills; exports.vectorFilterMarkup = _chunkUTEVPQTScjs.vectorFilterMarkup; exports.vectorFilterParamKeys = _chunkUTEVPQTScjs.vectorFilterParamKeys; exports.vectorFilterReach = _chunkUTEVPQTScjs.vectorFilterReach; exports.vectorFilterSvg = _chunkUTEVPQTScjs.vectorFilterSvg; exports.vectorGradientArea = _chunkUTEVPQTScjs.vectorGradientArea; exports.vectorGradientAspect = _chunkUTEVPQTScjs.vectorGradientAspect; exports.vectorGradientBarPosition = vectorGradientBarPosition; exports.vectorGradientFocalParam = _chunkUTEVPQTScjs.vectorGradientFocalParam; exports.vectorGradientHandles = _chunkUTEVPQTScjs.vectorGradientHandles; exports.vectorGradientMatrix = _chunkUTEVPQTScjs.vectorGradientMatrix; exports.vectorGradientMidpointFromPosition = _chunkUTEVPQTScjs.vectorGradientMidpointFromPosition; exports.vectorGradientMidpointPosition = _chunkUTEVPQTScjs.vectorGradientMidpointPosition; exports.vectorGradientNeedsExpansion = _chunkUTEVPQTScjs.vectorGradientNeedsExpansion; exports.vectorGradientParam = _chunkUTEVPQTScjs.vectorGradientParam; exports.vectorGradientPoints = _chunkUTEVPQTScjs.vectorGradientPoints; exports.vectorGradientRamp = _chunkUTEVPQTScjs.vectorGradientRamp; exports.vectorGradientSvgDefs = _chunkUTEVPQTScjs.vectorGradientSvgDefs; exports.vectorGradientTAt = _chunkUTEVPQTScjs.vectorGradientTAt; exports.vectorGradientTargetPath = vectorGradientTargetPath; exports.vectorGradientUnitsMatrix = _chunkUTEVPQTScjs.vectorGradientUnitsMatrix; exports.vectorHomography = _chunkMUUXNRU4cjs.homographyFromPoints; exports.vectorHomographyKeepsQuad = _chunkMUUXNRU4cjs.homographyKeepsQuad; exports.vectorIdentityMesh = _chunkDWGZUSEScjs.identityWarpMesh; exports.vectorInkShapeName = vectorInkShapeName; exports.vectorLiveBooleanSteps = _chunkUTEVPQTScjs.vectorLiveBooleanSteps; exports.vectorMaskContains = _chunkUTEVPQTScjs.vectorMaskContains; exports.vectorMaskContentBounds = _chunkUTEVPQTScjs.vectorMaskContentBounds; exports.vectorMaskContents = _chunkUTEVPQTScjs.vectorMaskContents; exports.vectorMaskOwner = _chunkUTEVPQTScjs.vectorMaskOwner; exports.vectorMaskRegion = _chunkUTEVPQTScjs.vectorMaskRegion; exports.vectorMaskRegionPath = _chunkUTEVPQTScjs.vectorMaskRegionPath; exports.vectorMaskRegionShapes = _chunkUTEVPQTScjs.vectorMaskRegionShapes; exports.vectorMaskRenderData = _chunkUTEVPQTScjs.vectorMaskRenderData; exports.vectorMaskSource = _chunkUTEVPQTScjs.vectorMaskSource; exports.vectorMaskSummary = _chunkUTEVPQTScjs.vectorMaskSummary; exports.vectorMaskedGeometry = _chunkUTEVPQTScjs.vectorMaskedGeometry; exports.vectorMaskedLocalBounds = _chunkUTEVPQTScjs.vectorMaskedLocalBounds; exports.vectorMaskedShapes = _chunkUTEVPQTScjs.vectorMaskedShapes; exports.vectorMeshColumns = _chunkDWGZUSEScjs.warpMeshColumns; exports.vectorMeshControlBounds = _chunkDWGZUSEScjs.warpMeshControlBounds; exports.vectorMeshEditPoints = _chunkDWGZUSEScjs.warpMeshEditPoints; exports.vectorMeshFromOutline = _chunkUTEVPQTScjs.vectorMeshFromOutline; exports.vectorMeshGridCurves = _chunkDWGZUSEScjs.warpMeshGridCurves; exports.vectorMeshOutline = _chunkUTEVPQTScjs.vectorMeshOutline; exports.vectorMeshParamAt = _chunkDWGZUSEScjs.warpMeshParamAt; exports.vectorMeshRows = _chunkDWGZUSEScjs.warpMeshRows; exports.vectorNodeBounds = _chunkUTEVPQTScjs.vectorNodeBounds; exports.vectorNodeEnvelope = _chunkUTEVPQTScjs.vectorNodeEnvelope; exports.vectorNodeFilterSvg = _chunkUTEVPQTScjs.vectorNodeFilterSvg; exports.vectorNodeLocalPaintBounds = _chunkUTEVPQTScjs.vectorNodeLocalPaintBounds; exports.vectorNodeRotation = _chunkUTEVPQTScjs.vectorNodeRotation; exports.vectorNodeToBezier = _chunkUTEVPQTScjs.vectorNodeToBezier; exports.vectorOperandOperation = _chunkUTEVPQTScjs.vectorOperandOperation; exports.vectorPaintLayerNodes = _chunkUTEVPQTScjs.vectorPaintLayerNodes; exports.vectorPaintSwatch = vectorPaintSwatch; exports.vectorPaintToHex = vectorPaintToHex; exports.vectorPaintToSvg = _chunkUTEVPQTScjs.vectorPaintToSvg; exports.vectorParentMatrix = _chunkUTEVPQTScjs.vectorParentMatrix; exports.vectorPathData = _chunkUTEVPQTScjs.vectorPathData; exports.vectorPathEntries = vectorPathEntries; exports.vectorPathLocalBounds = _chunkUTEVPQTScjs.vectorPathLocalBounds; exports.vectorPathWorldBezier = _chunkUTEVPQTScjs.vectorPathWorldBezier; exports.vectorPathfinderShape = vectorPathfinderShape; exports.vectorRepeaterCopies = _chunkUTEVPQTScjs.vectorRepeaterCopies; exports.vectorResizeCursor = vectorResizeCursor; exports.vectorResultStyle = vectorResultStyle; exports.vectorShapeBuilderHit = vectorShapeBuilderHit; exports.vectorShapeBuilderMap = vectorShapeBuilderMap; exports.vectorShearForSide = vectorShearForSide; exports.vectorSkewMatrix = vectorSkewMatrix; exports.vectorStacksHaveGradient = _chunkUTEVPQTScjs.vectorStacksHaveGradient; exports.vectorStrokeGradientDefs = _chunkUTEVPQTScjs.vectorStrokeGradientDefs; exports.vectorStrokeLineArea = _chunkUTEVPQTScjs.vectorStrokeLineArea; exports.vectorStrokeOutline = _chunkUTEVPQTScjs.vectorStrokeOutline; exports.vectorStrokeOutlinePath = _chunkUTEVPQTScjs.vectorStrokeOutlinePath; exports.vectorStrokeParts = _chunkUTEVPQTScjs.vectorStrokeParts; exports.vectorStrokeReach = _chunkUTEVPQTScjs.vectorStrokeReach; exports.vectorStrokeSettings = _chunkUTEVPQTScjs.vectorStrokeSettings; exports.vectorStrokeStackReach = _chunkUTEVPQTScjs.vectorStrokeStackReach; exports.vectorStrokeSvgParts = _chunkUTEVPQTScjs.vectorStrokeSvgParts; exports.vectorStrokeWidthGeometry = vectorStrokeWidthGeometry; exports.vectorStrokes = _chunkUTEVPQTScjs.vectorStrokes; exports.vectorTargetPaint = _chunkUTEVPQTScjs.vectorTargetPaint; exports.vectorToolLabel = vectorToolLabel; exports.vectorWarpPresetGrid = _chunkDWGZUSEScjs.warpPresetGrid; exports.vectorWarpPresetMesh = _chunkDWGZUSEScjs.warpPresetMesh; exports.vectorWorldMatrix = _chunkUTEVPQTScjs.vectorWorldMatrix; exports.walkVectorNodes = _chunkUTEVPQTScjs.walkVectorNodes; exports.widthProfileAt = _chunkUTEVPQTScjs.widthProfileAt; exports.widthProfileFromAttribute = _chunkUTEVPQTScjs.widthProfileFromAttribute; exports.widthProfileMaxScale = _chunkUTEVPQTScjs.widthProfileMaxScale; exports.widthProfilePreset = _chunkUTEVPQTScjs.widthProfilePreset; exports.widthProfilePresetId = _chunkUTEVPQTScjs.widthProfilePresetId; exports.widthProfileToAttribute = _chunkUTEVPQTScjs.widthProfileToAttribute; exports.wigglePaths = _chunkUTEVPQTScjs.wigglePaths; exports.withVectorFills = _chunkUTEVPQTScjs.withVectorFills; exports.withVectorStrokes = _chunkUTEVPQTScjs.withVectorStrokes; exports.withVectorTargetPaint = _chunkUTEVPQTScjs.withVectorTargetPaint; exports.zigzagPaths = _chunkUTEVPQTScjs.zigzagPaths;
|
|
10101
10130
|
//# sourceMappingURL=index.cjs.map
|