@pixerate/editor 0.267.0 → 0.268.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/animation-editor/index.cjs +62 -62
- package/dist/animation-editor/index.js +6 -6
- package/dist/brushes/index.cjs +198 -72
- package/dist/brushes/index.d.cts +4 -3
- package/dist/brushes/index.d.ts +4 -3
- package/dist/brushes/index.js +136 -10
- package/dist/brushes/library.d.cts +27 -1
- package/dist/brushes/library.d.ts +27 -1
- package/dist/brushes/profiles.d.cts +4 -0
- package/dist/brushes/profiles.d.ts +4 -0
- package/dist/brushes/schema.d.cts +4 -0
- package/dist/brushes/schema.d.ts +4 -0
- package/dist/brushes/sources.d.cts +114 -0
- package/dist/brushes/sources.d.ts +114 -0
- package/dist/brushes/types.d.cts +37 -5
- package/dist/brushes/types.d.ts +37 -5
- package/dist/brushes/ui.d.cts +40 -4
- package/dist/brushes/ui.d.ts +40 -4
- package/dist/{brushstrokeRender-NLFPEBGI.js → brushstrokeRender-A727TTNQ.js} +6 -6
- package/dist/{brushstrokeRender-L7JYRR2R.cjs → brushstrokeRender-WR2N5HHY.cjs} +22 -22
- package/dist/canvas/index.cjs +13 -13
- package/dist/canvas/index.js +1 -1
- package/dist/{chunk-J2TNIZ55.cjs → chunk-2WOGXEDX.cjs} +1 -1
- package/dist/{chunk-JGWVZPT6.js → chunk-3XDSNIGF.js} +72 -5
- package/dist/{chunk-EXB2EGBE.cjs → chunk-62MFUHSI.cjs} +16 -16
- package/dist/{chunk-FGJHJIMN.js → chunk-74ODPZLX.js} +10 -10
- package/dist/{chunk-GCVFEPJG.js → chunk-ACTHSQOI.js} +182 -0
- package/dist/{chunk-LHPEG5AU.cjs → chunk-B3G7BKUV.cjs} +90 -90
- package/dist/{chunk-EF7LZAXQ.js → chunk-BAZMCFVL.js} +1 -1
- package/dist/{chunk-HIO6E7LC.cjs → chunk-BPJSI4NT.cjs} +2 -2
- package/dist/{chunk-XVOP3CGQ.cjs → chunk-EU2ZZA6L.cjs} +393 -62
- package/dist/{chunk-YIC6MAJ2.js → chunk-HFY5LG5J.js} +1 -1
- package/dist/{chunk-7UKFXXWL.js → chunk-HVO6XCI4.js} +1 -1
- package/dist/{chunk-OKHKA43L.cjs → chunk-JBB3GDBB.cjs} +330 -216
- package/dist/{chunk-AGNUD5BI.js → chunk-KZI3YWKW.js} +351 -20
- package/dist/{chunk-EYSHTYLG.js → chunk-LETF75CA.js} +1 -1
- package/dist/{chunk-FQPUF2W2.cjs → chunk-NIBFKXMD.cjs} +217 -35
- package/dist/{chunk-G7NHE2VD.cjs → chunk-NPWWSCWT.cjs} +35 -35
- package/dist/{chunk-OSEXT7JL.js → chunk-QNY7BDFP.js} +1 -1
- package/dist/{chunk-PXDIAYB6.cjs → chunk-STLTOISW.cjs} +34 -214
- package/dist/{chunk-4IDUYB45.js → chunk-UVTO3D4E.js} +130 -16
- package/dist/{chunk-TXFWZ5ZJ.js → chunk-W6JDUXP3.js} +4 -184
- package/dist/{chunk-LA5Y4ETA.cjs → chunk-YOVXQHA3.cjs} +23 -23
- package/dist/{chunk-DT4YQUGT.cjs → chunk-YXP6X3SY.cjs} +101 -34
- package/dist/image-editor/index.cjs +851 -851
- package/dist/image-editor/index.js +23 -23
- package/dist/paint/index.cjs +5 -5
- package/dist/paint/index.js +11 -11
- package/dist/paint-editor/brush-library-tools.d.cts +12 -2
- package/dist/paint-editor/brush-library-tools.d.ts +12 -2
- package/dist/paint-editor/brush-model.d.cts +29 -1
- package/dist/paint-editor/brush-model.d.ts +29 -1
- package/dist/paint-editor/brush-source-art.d.cts +32 -0
- package/dist/paint-editor/brush-source-art.d.ts +32 -0
- package/dist/paint-editor/controller.d.cts +6 -1
- package/dist/paint-editor/controller.d.ts +6 -1
- package/dist/paint-editor/dab-stroke.d.cts +2 -0
- package/dist/paint-editor/dab-stroke.d.ts +2 -0
- package/dist/paint-editor/engine.d.cts +11 -2
- package/dist/paint-editor/engine.d.ts +11 -2
- package/dist/paint-editor/index.cjs +576 -481
- package/dist/paint-editor/index.d.cts +3 -1
- package/dist/paint-editor/index.d.ts +3 -1
- package/dist/paint-editor/index.js +127 -32
- package/dist/paint-editor/stamp-tip.d.cts +8 -5
- package/dist/paint-editor/stamp-tip.d.ts +8 -5
- package/dist/paint-editor/thumbnails.d.cts +6 -0
- package/dist/paint-editor/thumbnails.d.ts +6 -0
- package/dist/paint-editor/tip-grain.d.cts +34 -0
- package/dist/paint-editor/tip-grain.d.ts +34 -0
- package/dist/raster/index.cjs +2 -2
- package/dist/raster/index.js +9 -9
- package/dist/vector/index.cjs +1002 -1002
- package/dist/vector/index.js +7 -7
- package/package.json +1 -1
- package/skills/pixerate-brushes/SKILL.md +35 -8
- package/skills/pixerate-brushes-design/SKILL.md +8 -1
- package/skills/pixerate-paint-editor/SKILL.md +6 -0
- package/skills/pixerate-paint-editor/references/brush-facets.md +3 -1
- package/skills/pixerate-paint-sketch-to-finish/SKILL.md +1 -0
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
|
|
11
|
+
var _chunkEU2ZZA6Lcjs = require('./chunk-EU2ZZA6L.cjs');
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
|
|
@@ -78,10 +79,10 @@ var _chunkJ5VQYK7Tcjs = require('./chunk-J5VQYK7T.cjs');
|
|
|
78
79
|
|
|
79
80
|
|
|
80
81
|
|
|
82
|
+
var _chunkSTLTOISWcjs = require('./chunk-STLTOISW.cjs');
|
|
81
83
|
|
|
82
84
|
|
|
83
85
|
|
|
84
|
-
var _chunkPXDIAYB6cjs = require('./chunk-PXDIAYB6.cjs');
|
|
85
86
|
|
|
86
87
|
|
|
87
88
|
|
|
@@ -100,7 +101,7 @@ var _chunkPXDIAYB6cjs = require('./chunk-PXDIAYB6.cjs');
|
|
|
100
101
|
|
|
101
102
|
|
|
102
103
|
|
|
103
|
-
var
|
|
104
|
+
var _chunkNIBFKXMDcjs = require('./chunk-NIBFKXMD.cjs');
|
|
104
105
|
|
|
105
106
|
|
|
106
107
|
|
|
@@ -2726,7 +2727,18 @@ function effectDabField(img, rect, cov, centre, mixed, field, steps = 0, dab = n
|
|
|
2726
2727
|
|
|
2727
2728
|
// src/paint-editor/stamp-tip.ts
|
|
2728
2729
|
var samplers = /* @__PURE__ */ new WeakMap();
|
|
2729
|
-
function stampSampler(ref, art) {
|
|
2730
|
+
function stampSampler(ref, art, hardness = 1) {
|
|
2731
|
+
const sampler = baseSampler(ref, art);
|
|
2732
|
+
if (!sampler || hardness >= 1 || !_chunkEU2ZZA6Lcjs.isBrushSourceRef.call(void 0, ref)) return sampler;
|
|
2733
|
+
const h = Math.max(0, hardness);
|
|
2734
|
+
return (u, v2, seed) => {
|
|
2735
|
+
const r = Math.hypot(u, v2) / Math.SQRT2;
|
|
2736
|
+
if (r <= h) return sampler(u, v2, seed);
|
|
2737
|
+
const t = Math.min(1, (r - h) / (1 - h));
|
|
2738
|
+
return sampler(u, v2, seed) * (1 - t * t * (3 - 2 * t));
|
|
2739
|
+
};
|
|
2740
|
+
}
|
|
2741
|
+
function baseSampler(ref, art) {
|
|
2730
2742
|
let kind = null;
|
|
2731
2743
|
try {
|
|
2732
2744
|
kind = _chunkRDFHWAHLcjs.editorStampOf.call(void 0, ref.includes(":") ? ref : `editor:${ref}`);
|
|
@@ -2771,6 +2783,8 @@ function rasterizeStampDab(d, sample, seed, rect, out) {
|
|
|
2771
2783
|
const sn = Math.sin(d.angle);
|
|
2772
2784
|
const cs = Math.cos(d.angle);
|
|
2773
2785
|
const ss = r < 6 ? 3 : 1;
|
|
2786
|
+
const fu = d.flip && d.flip & 1 ? -1 : 1;
|
|
2787
|
+
const fv = d.flip && d.flip & 2 ? -1 : 1;
|
|
2774
2788
|
for (let yy = 0; yy < h; yy++) {
|
|
2775
2789
|
for (let xx = 0; xx < w; xx++) {
|
|
2776
2790
|
let sum = 0;
|
|
@@ -2778,8 +2792,8 @@ function rasterizeStampDab(d, sample, seed, rect, out) {
|
|
|
2778
2792
|
for (let sx = 0; sx < ss; sx++) {
|
|
2779
2793
|
const dx = rect.x + xx + (sx + 0.5) / ss - d.x;
|
|
2780
2794
|
const dy = rect.y + yy + (sy + 0.5) / ss - d.y;
|
|
2781
|
-
const u = (dx * cs - dy * sn) / r;
|
|
2782
|
-
const v2 = (dx * sn + dy * cs) / (r * ro);
|
|
2795
|
+
const u = (dx * cs - dy * sn) / r * fu;
|
|
2796
|
+
const v2 = (dx * sn + dy * cs) / (r * ro) * fv;
|
|
2783
2797
|
if (u > -1.05 && u < 1.05 && v2 > -1.05 && v2 < 1.05) sum += sample(u, v2, seed);
|
|
2784
2798
|
}
|
|
2785
2799
|
}
|
|
@@ -2790,7 +2804,7 @@ function rasterizeStampDab(d, sample, seed, rect, out) {
|
|
|
2790
2804
|
}
|
|
2791
2805
|
function brushStickerRefs(brush) {
|
|
2792
2806
|
const refs = brush.engine === "sticker" ? [...brush.sticker.stamps] : brush.engine === "particle" ? [...brush.particle.dotTextures] : brush.engine === "dab" && brush.stamp ? [brush.stamp] : [];
|
|
2793
|
-
return [...new Set(refs.filter((r) => r.includes(":") && !r.startsWith("editor:")))];
|
|
2807
|
+
return [...new Set(refs.filter((r) => r.includes(":") && !r.startsWith("editor:") && !_chunkEU2ZZA6Lcjs.isBrushSourceRef.call(void 0, r)))];
|
|
2794
2808
|
}
|
|
2795
2809
|
function sprayDroplets(d, spray, seed) {
|
|
2796
2810
|
const count = 1 + Math.round(spray.density * 31);
|
|
@@ -2872,7 +2886,7 @@ function normalizePaper(raw = {}, base) {
|
|
|
2872
2886
|
preset: typeof r.preset === "string" && r.preset ? r.preset : b.preset,
|
|
2873
2887
|
name: typeof r.name === "string" && r.name.trim() ? r.name.trim() : b.name,
|
|
2874
2888
|
family: PAPER_FAMILIES.includes(r.family) ? r.family : b.family,
|
|
2875
|
-
pattern:
|
|
2889
|
+
pattern: _chunkNIBFKXMDcjs.GRAIN_PATTERNS.includes(r.pattern) ? r.pattern : b.pattern,
|
|
2876
2890
|
seed: typeof r.seed === "number" && Number.isFinite(r.seed) ? Math.round(Math.abs(r.seed)) % 2147483647 : b.seed,
|
|
2877
2891
|
color: typeof r.color === "string" && HEX.test(r.color) ? r.color.toLowerCase() : b.color,
|
|
2878
2892
|
scale: clampNum(r.scale, 0.25, 8, b.scale),
|
|
@@ -2894,7 +2908,7 @@ function hexToRgb8(hex) {
|
|
|
2894
2908
|
const n = parseInt(hex.slice(1, 7), 16);
|
|
2895
2909
|
return [n >> 16 & 255, n >> 8 & 255, n & 255];
|
|
2896
2910
|
}
|
|
2897
|
-
function renderPaper(paper, rect, grain = new (0,
|
|
2911
|
+
function renderPaper(paper, rect, grain = new (0, _chunkNIBFKXMDcjs.PaperGrain)(paper), light) {
|
|
2898
2912
|
const [r, g, b] = hexToRgb8(paper.color);
|
|
2899
2913
|
const out = new Uint8ClampedArray(rect.width * rect.height * 4);
|
|
2900
2914
|
const shade = grain.flat ? 0 : paper.shading * 0.16;
|
|
@@ -2936,6 +2950,86 @@ function renderPaper(paper, rect, grain = new (0, _chunkPXDIAYB6cjs.PaperGrain)(
|
|
|
2936
2950
|
return out;
|
|
2937
2951
|
}
|
|
2938
2952
|
|
|
2953
|
+
// src/paint-editor/tip-grain.ts
|
|
2954
|
+
var ImageGrain = class {
|
|
2955
|
+
constructor(w, h, alpha, contrast, invert2, scale3) {
|
|
2956
|
+
this.w = w;
|
|
2957
|
+
this.h = h;
|
|
2958
|
+
this.scale = scale3;
|
|
2959
|
+
this.heights = new Float32Array(w * h);
|
|
2960
|
+
for (let i = 0; i < w * h; i++) {
|
|
2961
|
+
const v2 = Math.min(1, Math.max(0, (alpha[i * 4 + 3] / 255 - 0.5) * contrast + 0.5));
|
|
2962
|
+
this.heights[i] = invert2 ? 1 - v2 : v2;
|
|
2963
|
+
}
|
|
2964
|
+
}
|
|
2965
|
+
|
|
2966
|
+
|
|
2967
|
+
|
|
2968
|
+
|
|
2969
|
+
at(x, y) {
|
|
2970
|
+
const { w, h } = this;
|
|
2971
|
+
const u = x / this.scale - 0.5;
|
|
2972
|
+
const v2 = y / this.scale - 0.5;
|
|
2973
|
+
const x0 = Math.floor(u);
|
|
2974
|
+
const y0 = Math.floor(v2);
|
|
2975
|
+
const fx = u - x0;
|
|
2976
|
+
const fy = v2 - y0;
|
|
2977
|
+
const xa = (x0 % w + w) % w;
|
|
2978
|
+
const ya = (y0 % h + h) % h;
|
|
2979
|
+
const xb = (xa + 1) % w;
|
|
2980
|
+
const yb = (ya + 1) % h;
|
|
2981
|
+
const hs = this.heights;
|
|
2982
|
+
return (hs[ya * w + xa] * (1 - fx) + hs[ya * w + xb] * fx) * (1 - fy) + (hs[yb * w + xa] * (1 - fx) + hs[yb * w + xb] * fx) * fy;
|
|
2983
|
+
}
|
|
2984
|
+
};
|
|
2985
|
+
var TipGrain = class _TipGrain {
|
|
2986
|
+
constructor(field, settings) {
|
|
2987
|
+
this.field = field;
|
|
2988
|
+
this.settings = settings;
|
|
2989
|
+
}
|
|
2990
|
+
|
|
2991
|
+
|
|
2992
|
+
/**
|
|
2993
|
+
* The grain for `settings`, or `null` when there is none to apply: no depth, or an image source
|
|
2994
|
+
* whose art is not loaded (the dabs then paint without it).
|
|
2995
|
+
*/
|
|
2996
|
+
static create(settings, art) {
|
|
2997
|
+
if (!settings || settings.depth <= 0) return null;
|
|
2998
|
+
if (_chunkNIBFKXMDcjs.GRAIN_PATTERNS.includes(settings.source)) {
|
|
2999
|
+
if (settings.source === "smooth") return null;
|
|
3000
|
+
const tuning2 = { contrast: settings.contrast, invert: settings.invert };
|
|
3001
|
+
const paper = new (0, _chunkNIBFKXMDcjs.PaperGrain)({ pattern: settings.source, seed: 0, scale: settings.scale, tiling: "repeat", dry: tuning2, wet: tuning2 });
|
|
3002
|
+
return new _TipGrain(paper, settings);
|
|
3003
|
+
}
|
|
3004
|
+
const a = _optionalChain([art, 'optionalCall', _58 => _58(settings.source)]);
|
|
3005
|
+
if (!a || !(a.width > 0 && a.height > 0)) return null;
|
|
3006
|
+
return new _TipGrain(new ImageGrain(a.width, a.height, a.data, settings.contrast, settings.invert, settings.scale), settings);
|
|
3007
|
+
}
|
|
3008
|
+
/** Multiplies the dab's coverage `vals` (over `rect`) by the grain. */
|
|
3009
|
+
apply(vals, rect, d) {
|
|
3010
|
+
const depth = this.settings.depth;
|
|
3011
|
+
const moving = this.settings.mode === "moving";
|
|
3012
|
+
const cs = Math.cos(d.angle);
|
|
3013
|
+
const sn = Math.sin(d.angle);
|
|
3014
|
+
for (let yy = 0, k = 0; yy < rect.height; yy++) {
|
|
3015
|
+
const py = rect.y + yy + 0.5;
|
|
3016
|
+
for (let xx = 0; xx < rect.width; xx++, k++) {
|
|
3017
|
+
if (!(vals[k] > 0)) continue;
|
|
3018
|
+
const px = rect.x + xx + 0.5;
|
|
3019
|
+
let gx = px;
|
|
3020
|
+
let gy = py;
|
|
3021
|
+
if (moving) {
|
|
3022
|
+
const dx = px - d.x;
|
|
3023
|
+
const dy = py - d.y;
|
|
3024
|
+
gx = dx * cs - dy * sn + d.travel;
|
|
3025
|
+
gy = dx * sn + dy * cs;
|
|
3026
|
+
}
|
|
3027
|
+
vals[k] *= 1 - depth * (1 - this.field.at(gx, gy));
|
|
3028
|
+
}
|
|
3029
|
+
}
|
|
3030
|
+
}
|
|
3031
|
+
};
|
|
3032
|
+
|
|
2939
3033
|
// src/paint-editor/engine.ts
|
|
2940
3034
|
function penOrientation(p) {
|
|
2941
3035
|
if (typeof p.altitude === "number" && Number.isFinite(p.altitude)) {
|
|
@@ -3075,7 +3169,13 @@ var PenDabWalker = (_class2 = class {
|
|
|
3075
3169
|
x += Math.sin(this.dir) * off;
|
|
3076
3170
|
y += Math.cos(this.dir) * off;
|
|
3077
3171
|
}
|
|
3172
|
+
let flip = 0;
|
|
3173
|
+
if (dyn.flip && dyn.flip !== "none") {
|
|
3174
|
+
if (dyn.flip !== "y" && _chunk3K6HWEXZcjs.rand01.call(void 0, seed, i, 5 /* FlipX */) < 0.5) flip |= 1;
|
|
3175
|
+
if (dyn.flip !== "x" && _chunk3K6HWEXZcjs.rand01.call(void 0, seed, i, 6 /* FlipY */) < 0.5) flip |= 2;
|
|
3176
|
+
}
|
|
3078
3177
|
return {
|
|
3178
|
+
...flip ? { flip } : {},
|
|
3079
3179
|
x,
|
|
3080
3180
|
y,
|
|
3081
3181
|
radius: Math.max(0.5, diameter / 2),
|
|
@@ -3106,7 +3206,7 @@ var PenDabWalker = (_class2 = class {
|
|
|
3106
3206
|
const len2 = Math.hypot(dx, dy);
|
|
3107
3207
|
if (len2 > 1e-9) this.dir = Math.atan2(-dy, dx);
|
|
3108
3208
|
if (this.pendingFirst) {
|
|
3109
|
-
|
|
3209
|
+
this.lay(this.pendingFirst, out);
|
|
3110
3210
|
this.pendingFirst = null;
|
|
3111
3211
|
}
|
|
3112
3212
|
if (len2 > 1e-9) {
|
|
@@ -3124,7 +3224,7 @@ var PenDabWalker = (_class2 = class {
|
|
|
3124
3224
|
travel: a.travel + this.nextAt,
|
|
3125
3225
|
time: a.time !== null && s.time !== null ? lerp4(a.time, s.time) : s.time
|
|
3126
3226
|
};
|
|
3127
|
-
|
|
3227
|
+
this.lay(q, out);
|
|
3128
3228
|
this.nextAt += this.stepLen(q);
|
|
3129
3229
|
}
|
|
3130
3230
|
this.nextAt -= len2;
|
|
@@ -3133,10 +3233,15 @@ var PenDabWalker = (_class2 = class {
|
|
|
3133
3233
|
}
|
|
3134
3234
|
finish(out) {
|
|
3135
3235
|
if (this.pendingFirst) {
|
|
3136
|
-
|
|
3236
|
+
this.lay(this.pendingFirst, out);
|
|
3137
3237
|
this.pendingFirst = null;
|
|
3138
3238
|
}
|
|
3139
3239
|
}
|
|
3240
|
+
/** The dabs of one spacing step: `dynamics.count` of them, each with its own index and so its own jitter. */
|
|
3241
|
+
lay(s, out) {
|
|
3242
|
+
const n = _nullishCoalesce(this.brush.dynamics.count, () => ( 1));
|
|
3243
|
+
for (let k = 0; k < n; k++) out.push(this.dab(s));
|
|
3244
|
+
}
|
|
3140
3245
|
}, _class2);
|
|
3141
3246
|
function lerpAngle(a, b, t) {
|
|
3142
3247
|
let d = b - a;
|
|
@@ -3154,15 +3259,16 @@ var DryStroke = (_class3 = class {
|
|
|
3154
3259
|
constructor(brush, options) {;_class3.prototype.__init12.call(this);_class3.prototype.__init13.call(this);_class3.prototype.__init14.call(this);_class3.prototype.__init15.call(this);_class3.prototype.__init16.call(this);_class3.prototype.__init17.call(this);
|
|
3155
3260
|
this.brush = brush;
|
|
3156
3261
|
this.options = options;
|
|
3157
|
-
this.stamp = brush.stamp ? stampSampler(brush.stamp, options.stampArt) : null;
|
|
3262
|
+
this.stamp = brush.stamp ? stampSampler(brush.stamp, options.stampArt, brush.tip.hardness) : null;
|
|
3263
|
+
this.tipGrain = TipGrain.create(brush.tipGrain, options.stampArt);
|
|
3158
3264
|
this.smoother = new PenSmoother(brush.tip.smoothing, brush.pressureSmoothing);
|
|
3159
|
-
this.copies = _optionalChain([options, 'access',
|
|
3265
|
+
this.copies = _optionalChain([options, 'access', _59 => _59.copies, 'optionalAccess', _60 => _60.length]) ? options.copies : [IDENTITY_COPY];
|
|
3160
3266
|
this.walkers = this.copies.map((c, i) => new PenDabWalker(brush, (_nullishCoalesce(options.seed, () => ( 0))) + i * 7919 | 0, c.linear));
|
|
3161
3267
|
this.depth = options.grain && !options.grain.flat ? Math.min(1, Math.max(0, options.paperDepth * brush.grain)) : 0;
|
|
3162
3268
|
}
|
|
3163
3269
|
|
|
3164
3270
|
|
|
3165
|
-
__init12() {this.coverage = new (0,
|
|
3271
|
+
__init12() {this.coverage = new (0, _chunkNIBFKXMDcjs.CoverageMap)()}
|
|
3166
3272
|
__init13() {this.dabCount = 0}
|
|
3167
3273
|
|
|
3168
3274
|
|
|
@@ -3174,6 +3280,8 @@ var DryStroke = (_class3 = class {
|
|
|
3174
3280
|
__init17() {this.lastFed = null}
|
|
3175
3281
|
/** The stamp tip's shape, or `null` for the round computed tip. */
|
|
3176
3282
|
|
|
3283
|
+
/** The tip's own grain, or `null`. */
|
|
3284
|
+
|
|
3177
3285
|
/** Feeds raw pen samples; returns the document rectangles the new dabs touched. */
|
|
3178
3286
|
push(points) {
|
|
3179
3287
|
const dabs = [];
|
|
@@ -3207,21 +3315,22 @@ var DryStroke = (_class3 = class {
|
|
|
3207
3315
|
}
|
|
3208
3316
|
return rects;
|
|
3209
3317
|
}
|
|
3210
|
-
/** Lays one mark (a dab, or a spray droplet of dab `d`): the round tip or the stamp, the paper grain, effect paint. */
|
|
3318
|
+
/** Lays one mark (a dab, or a spray droplet of dab `d`): the round tip or the stamp, the tip grain, the paper grain, effect paint. */
|
|
3211
3319
|
mark(m, d, rects) {
|
|
3212
3320
|
const hardness = this.brush.tip.hardness;
|
|
3213
3321
|
const grain = this.options.grain;
|
|
3214
|
-
const rect = this.stamp ? stampDabRect(m) :
|
|
3322
|
+
const rect = this.stamp ? stampDabRect(m) : _chunkNIBFKXMDcjs.dabRect.call(void 0, m, hardness);
|
|
3215
3323
|
const n = rect.width * rect.height;
|
|
3216
3324
|
if (this.buf.length < n) this.buf = new Float32Array(n);
|
|
3217
3325
|
const vals = this.buf.subarray(0, n);
|
|
3218
3326
|
if (this.stamp) rasterizeStampDab(m, this.stamp, d.index, rect, vals);
|
|
3219
|
-
else
|
|
3327
|
+
else _chunkNIBFKXMDcjs.rasterizeDab.call(void 0, m, hardness, rect, vals);
|
|
3328
|
+
_optionalChain([this, 'access', _61 => _61.tipGrain, 'optionalAccess', _62 => _62.apply, 'call', _63 => _63(vals, rect, { x: m.x, y: m.y, angle: m.angle, travel: d.travel })]);
|
|
3220
3329
|
if (this.depth > 0 && grain) {
|
|
3221
3330
|
for (let yy = 0, k = 0; yy < rect.height; yy++) {
|
|
3222
3331
|
const y = rect.y + yy + 0.5;
|
|
3223
3332
|
for (let xx = 0; xx < rect.width; xx++, k++) {
|
|
3224
|
-
if (vals[k] > 0) vals[k] *=
|
|
3333
|
+
if (vals[k] > 0) vals[k] *= _chunkNIBFKXMDcjs.grainCatch.call(void 0, grain.at(rect.x + xx + 0.5, y), this.depth, d.pressure);
|
|
3225
3334
|
}
|
|
3226
3335
|
}
|
|
3227
3336
|
}
|
|
@@ -3294,25 +3403,26 @@ var PaintDabStroke = (_class4 = class {
|
|
|
3294
3403
|
constructor(brush, options) {;_class4.prototype.__init18.call(this);_class4.prototype.__init19.call(this);_class4.prototype.__init20.call(this);_class4.prototype.__init21.call(this);_class4.prototype.__init22.call(this);_class4.prototype.__init23.call(this);_class4.prototype.__init24.call(this);_class4.prototype.__init25.call(this);_class4.prototype.__init26.call(this);_class4.prototype.__init27.call(this);
|
|
3295
3404
|
this.brush = brush;
|
|
3296
3405
|
this.options = options;
|
|
3297
|
-
this.stamp = brush.engine === "dab" && brush.stamp ? stampSampler(brush.stamp, options.stampArt) : null;
|
|
3406
|
+
this.stamp = brush.engine === "dab" && brush.stamp ? stampSampler(brush.stamp, options.stampArt, brush.tip.hardness) : null;
|
|
3407
|
+
this.tipGrain = TipGrain.create(brush.tipGrain, options.stampArt);
|
|
3298
3408
|
this.smoother = new PenSmoother(brush.tip.smoothing, brush.pressureSmoothing);
|
|
3299
|
-
this.copies = _optionalChain([options, 'access',
|
|
3409
|
+
this.copies = _optionalChain([options, 'access', _64 => _64.copies, 'optionalAccess', _65 => _65.length]) ? options.copies : [IDENTITY_COPY];
|
|
3300
3410
|
const exchanging = brush.engine === "mixer" || brush.engine === "dab";
|
|
3301
|
-
const rates = brush.engine === "mixer" ?
|
|
3411
|
+
const rates = brush.engine === "mixer" ? _chunkNIBFKXMDcjs.mixerRates.call(void 0, brush.mixer) : _chunkNIBFKXMDcjs.exchangeRates.call(void 0, brush.behavior.pickup, brush.behavior.mix, 1, brush.behavior.mixing);
|
|
3302
3412
|
this.mixing = brush.engine === "mixer" ? brush.mixer.mixing : brush.behavior.mixing;
|
|
3303
3413
|
this.states = this.copies.map((c, i) => ({
|
|
3304
3414
|
walker: new PenDabWalker(brush, (_nullishCoalesce(options.seed, () => ( 0))) + i * 7919 | 0, c.linear),
|
|
3305
|
-
exchange: exchanging ? new (0,
|
|
3306
|
-
smudge: brush.engine === "smudge" ? new (0,
|
|
3415
|
+
exchange: exchanging ? new (0, _chunkNIBFKXMDcjs.PaintExchange)(rates, options.load) : null,
|
|
3416
|
+
smudge: brush.engine === "smudge" ? new (0, _chunkNIBFKXMDcjs.SmudgeTip)(brush.smudge, brush.tip.size * (1 + brush.dynamics.tiltSize * 1.5)) : null
|
|
3307
3417
|
}));
|
|
3308
|
-
this.medium = new (0,
|
|
3418
|
+
this.medium = new (0, _chunkNIBFKXMDcjs.TileMedium)(options.target, brush.engine === "dab" ? { blend: brush.tip.blend } : {});
|
|
3309
3419
|
this.depth = options.grain && !options.grain.flat ? Math.min(1, Math.max(0, options.paperDepth * brush.grain)) : 0;
|
|
3310
|
-
this.coverage = brush.engine === "dab" ? new (0,
|
|
3311
|
-
this.sampler = exchanging && options.paint ? new (0,
|
|
3312
|
-
const table = _optionalChain([this, 'access',
|
|
3420
|
+
this.coverage = brush.engine === "dab" ? new (0, _chunkNIBFKXMDcjs.CoverageMap)() : null;
|
|
3421
|
+
this.sampler = exchanging && options.paint ? new (0, _chunkNIBFKXMDcjs.PaintGradientSampler)(options.paint, _nullishCoalesce(options.seed, () => ( 0))) : null;
|
|
3422
|
+
const table = _optionalChain([this, 'access', _66 => _66.sampler, 'optionalAccess', _67 => _67.acrossTip]) ? this.sampler.tipTable(GRADIENT_STEPS) : null;
|
|
3313
3423
|
this.gradient = table ? table.map((e) => e.rgb) : null;
|
|
3314
3424
|
this.gradientAlpha = table && table.some((e) => e.alpha < 1) ? table.map((e) => e.alpha) : null;
|
|
3315
|
-
this.scratch = brush.engine === "blender" ?
|
|
3425
|
+
this.scratch = brush.engine === "blender" ? _chunkNIBFKXMDcjs.createBlenderScratch.call(void 0, ) : null;
|
|
3316
3426
|
}
|
|
3317
3427
|
|
|
3318
3428
|
|
|
@@ -3340,9 +3450,11 @@ var PaintDabStroke = (_class4 = class {
|
|
|
3340
3450
|
__init27() {this.lastFed = null}
|
|
3341
3451
|
/** The stamp tip's shape (dab brushes), or `null` for the round computed tip. */
|
|
3342
3452
|
|
|
3453
|
+
/** The tip's own grain, or `null`. */
|
|
3454
|
+
|
|
3343
3455
|
/** What copy 0's brush carries after the dabs so far (mixer and wet-capable dab brushes). */
|
|
3344
3456
|
get load() {
|
|
3345
|
-
return _nullishCoalesce(_optionalChain([this, 'access',
|
|
3457
|
+
return _nullishCoalesce(_optionalChain([this, 'access', _68 => _68.states, 'access', _69 => _69[0], 'access', _70 => _70.exchange, 'optionalAccess', _71 => _71.load]), () => ( null));
|
|
3346
3458
|
}
|
|
3347
3459
|
push(points) {
|
|
3348
3460
|
const rects = [];
|
|
@@ -3374,7 +3486,7 @@ var PaintDabStroke = (_class4 = class {
|
|
|
3374
3486
|
paintDabs(copy, dabs, rects) {
|
|
3375
3487
|
const spray = this.brush.engine === "dab" ? this.brush.spray : null;
|
|
3376
3488
|
for (const d of spray ? dabs.flatMap((dab) => sprayDroplets(dab, spray, (_nullishCoalesce(this.options.seed, () => ( 0))) + copy * 7919)) : dabs) {
|
|
3377
|
-
const rect = this.stamp ? stampDabRect(d) :
|
|
3489
|
+
const rect = this.stamp ? stampDabRect(d) : _chunkNIBFKXMDcjs.dabRect.call(void 0, d, this.brush.tip.hardness);
|
|
3378
3490
|
if (rect.width <= 0 || rect.height <= 0) continue;
|
|
3379
3491
|
this.dab(copy, d, rect);
|
|
3380
3492
|
rects.push(rect);
|
|
@@ -3391,13 +3503,14 @@ var PaintDabStroke = (_class4 = class {
|
|
|
3391
3503
|
const tip = this.tip.subarray(0, n);
|
|
3392
3504
|
tip.fill(0);
|
|
3393
3505
|
if (this.stamp) rasterizeStampDab({ ...d, alpha: 1 }, this.stamp, d.index, rect, tip);
|
|
3394
|
-
else
|
|
3506
|
+
else _chunkNIBFKXMDcjs.rasterizeDab.call(void 0, { ...d, alpha: 1 }, this.brush.tip.hardness, rect, tip);
|
|
3507
|
+
_optionalChain([this, 'access', _72 => _72.tipGrain, 'optionalAccess', _73 => _73.apply, 'call', _74 => _74(tip, rect, d)]);
|
|
3395
3508
|
if (!(this.depth > 0 && this.options.grain)) return { tip, cov: tip };
|
|
3396
3509
|
const cov = this.cov.subarray(0, n);
|
|
3397
3510
|
const grain = this.options.grain;
|
|
3398
3511
|
for (let yy = 0, k = 0; yy < rect.height; yy++) {
|
|
3399
3512
|
const y = rect.y + yy + 0.5;
|
|
3400
|
-
for (let xx = 0; xx < rect.width; xx++, k++) cov[k] = tip[k] > 0 ? tip[k] *
|
|
3513
|
+
for (let xx = 0; xx < rect.width; xx++, k++) cov[k] = tip[k] > 0 ? tip[k] * _chunkNIBFKXMDcjs.grainCatch.call(void 0, grain.at(rect.x + xx + 0.5, y), this.depth, d.pressure) : 0;
|
|
3401
3514
|
}
|
|
3402
3515
|
return { tip, cov };
|
|
3403
3516
|
}
|
|
@@ -3406,7 +3519,7 @@ var PaintDabStroke = (_class4 = class {
|
|
|
3406
3519
|
const { tip, cov } = this.rasterize(d, rect);
|
|
3407
3520
|
const st = this.states[copy];
|
|
3408
3521
|
if (brush.engine === "blender") {
|
|
3409
|
-
|
|
3522
|
+
_chunkNIBFKXMDcjs.blenderDab.call(void 0, this.medium, rect, cov, d.opacity * d.alpha * brush.tip.opacity, d.radius, brush.blender, this.scratch);
|
|
3410
3523
|
return;
|
|
3411
3524
|
}
|
|
3412
3525
|
if (brush.engine === "smudge") {
|
|
@@ -3533,7 +3646,7 @@ function union(a, b) {
|
|
|
3533
3646
|
return { x, y, width: Math.max(a.x + a.width, b.x + b.width) - x, height: Math.max(a.y + a.height, b.y + b.height) - y };
|
|
3534
3647
|
}
|
|
3535
3648
|
function wetPaperInput(paper) {
|
|
3536
|
-
const grain = new (0,
|
|
3649
|
+
const grain = new (0, _chunkNIBFKXMDcjs.PaperGrain)(paper, "wet");
|
|
3537
3650
|
const flat = grain.flat;
|
|
3538
3651
|
return {
|
|
3539
3652
|
absorption: paper.absorption,
|
|
@@ -3560,16 +3673,16 @@ var WetStrokeDriver = (_class5 = class {
|
|
|
3560
3673
|
light: 0
|
|
3561
3674
|
});
|
|
3562
3675
|
this.lightBase = wet.tool === "paint" ? STROKE_LIGHT * brush.light.amount * (1 - 0.6 * thin) * perDab : 0;
|
|
3563
|
-
const rates =
|
|
3676
|
+
const rates = _chunkNIBFKXMDcjs.exchangeRates.call(void 0, brush.behavior.pickup, brush.behavior.mix, wet.load, brush.behavior.mixing);
|
|
3564
3677
|
this.states = copies.map((c, i) => ({
|
|
3565
3678
|
walker: new PenDabWalker(brush, init.seed + i * 7919 | 0, c.linear),
|
|
3566
|
-
exchange: wet.tool === "paint" ? new (0,
|
|
3679
|
+
exchange: wet.tool === "paint" ? new (0, _chunkNIBFKXMDcjs.PaintExchange)(rates, init.load) : null,
|
|
3567
3680
|
last: null
|
|
3568
3681
|
}));
|
|
3569
3682
|
this.copies = copies;
|
|
3570
3683
|
this.depth = init.grain && !init.grain.flat ? Math.min(1, Math.max(0, init.paperDepth * brush.grain)) : 0;
|
|
3571
3684
|
const g = _nullishCoalesce(init.paint, () => ( null));
|
|
3572
|
-
this.sampler = g ? new (0,
|
|
3685
|
+
this.sampler = g ? new (0, _chunkNIBFKXMDcjs.PaintGradientSampler)(g.map.by === "across-tip" ? { ...g, map: { by: "distance", length: 300, repeat: "mirror" } } : g, init.seed) : null;
|
|
3573
3686
|
}
|
|
3574
3687
|
|
|
3575
3688
|
__init28() {this.dabCount = 0}
|
|
@@ -3595,7 +3708,7 @@ var WetStrokeDriver = (_class5 = class {
|
|
|
3595
3708
|
|
|
3596
3709
|
/** What copy 0's brush carries after the dabs so far. */
|
|
3597
3710
|
get load() {
|
|
3598
|
-
return _nullishCoalesce(_optionalChain([this, 'access',
|
|
3711
|
+
return _nullishCoalesce(_optionalChain([this, 'access', _75 => _75.states, 'access', _76 => _76[0], 'access', _77 => _77.exchange, 'optionalAccess', _78 => _78.load]), () => ( null));
|
|
3599
3712
|
}
|
|
3600
3713
|
/** Whether every point (and the end) has been applied. */
|
|
3601
3714
|
get done() {
|
|
@@ -3643,7 +3756,7 @@ var WetStrokeDriver = (_class5 = class {
|
|
|
3643
3756
|
}
|
|
3644
3757
|
applyDabs(copy, dabs, rects) {
|
|
3645
3758
|
for (const d of dabs) {
|
|
3646
|
-
const rect =
|
|
3759
|
+
const rect = _chunkNIBFKXMDcjs.dabRect.call(void 0, d, this.init.brush.tip.hardness);
|
|
3647
3760
|
if (rect.width <= 0 || rect.height <= 0) continue;
|
|
3648
3761
|
this.dab(copy, d, rect);
|
|
3649
3762
|
rects.push(rect);
|
|
@@ -3660,7 +3773,7 @@ var WetStrokeDriver = (_class5 = class {
|
|
|
3660
3773
|
const tip = this.tip.subarray(0, n);
|
|
3661
3774
|
const cov = this.cov.subarray(0, n);
|
|
3662
3775
|
tip.fill(0);
|
|
3663
|
-
|
|
3776
|
+
_chunkNIBFKXMDcjs.rasterizeDab.call(void 0, { ...d, alpha: 1 }, this.init.brush.tip.hardness, rect, tip);
|
|
3664
3777
|
const grain = this.depth > 0 ? this.init.grain : null;
|
|
3665
3778
|
const mask = this.init.mask;
|
|
3666
3779
|
for (let yy = 0, k = 0; yy < rect.height; yy++) {
|
|
@@ -3671,7 +3784,7 @@ var WetStrokeDriver = (_class5 = class {
|
|
|
3671
3784
|
tip[k] *= mx >= 0 && my >= 0 && mx < mask.width && my < mask.height ? mask.data[my * mask.width + mx] / 255 : 0;
|
|
3672
3785
|
}
|
|
3673
3786
|
let v2 = tip[k];
|
|
3674
|
-
if (v2 > 0 && grain) v2 *=
|
|
3787
|
+
if (v2 > 0 && grain) v2 *= _chunkNIBFKXMDcjs.grainCatch.call(void 0, grain.at(rect.x + xx + 0.5, rect.y + yy + 0.5), this.depth, d.pressure);
|
|
3675
3788
|
tip[k] = Math.round(tip[k] * COVERAGE_STEPS) / COVERAGE_STEPS;
|
|
3676
3789
|
cov[k] = Math.round(v2 * COVERAGE_STEPS) / COVERAGE_STEPS;
|
|
3677
3790
|
}
|
|
@@ -3814,8 +3927,8 @@ var PaintWetLayers = (_class6 = class {
|
|
|
3814
3927
|
if (mode === this.gpuMode) return this.engineInfo();
|
|
3815
3928
|
this.gpuMode = mode;
|
|
3816
3929
|
if (mode === "off") {
|
|
3817
|
-
_optionalChain([this, 'access',
|
|
3818
|
-
_optionalChain([this, 'access',
|
|
3930
|
+
_optionalChain([this, 'access', _79 => _79.world, 'optionalAccess', _80 => _80.attachGpu, 'call', _81 => _81(null)]);
|
|
3931
|
+
_optionalChain([this, 'access', _82 => _82.gpu, 'optionalAccess', _83 => _83.destroy, 'call', _84 => _84()]);
|
|
3819
3932
|
this.gpu = null;
|
|
3820
3933
|
this.gpuSupport = null;
|
|
3821
3934
|
} else if (this.world) this.startGpu();
|
|
@@ -3823,13 +3936,13 @@ var PaintWetLayers = (_class6 = class {
|
|
|
3823
3936
|
}
|
|
3824
3937
|
engineInfo() {
|
|
3825
3938
|
const w = this.world;
|
|
3826
|
-
const base = { mode: this.gpuMode, adapter: _nullishCoalesce(_optionalChain([this, 'access',
|
|
3939
|
+
const base = { mode: this.gpuMode, adapter: _nullishCoalesce(_optionalChain([this, 'access', _85 => _85.gpuSupport, 'optionalAccess', _86 => _86.adapter]), () => ( null)), maxTiles: _nullishCoalesce(_optionalChain([this, 'access', _87 => _87.gpuSupport, 'optionalAccess', _88 => _88.maxSlots]), () => ( 0)), minTiles: this.gpuMinTiles, activeTiles: _nullishCoalesce(_optionalChain([w, 'optionalAccess', _89 => _89.activeTiles, 'call', _90 => _90()]), () => ( 0)), cpu: this.backend() };
|
|
3827
3940
|
if (this.gpuMode === "off") return { ...base, state: "off", reason: "Forced to the CPU." };
|
|
3828
3941
|
if (this.gpuStarting) return { ...base, state: "starting", reason: null };
|
|
3829
|
-
if (_optionalChain([w, 'optionalAccess',
|
|
3942
|
+
if (_optionalChain([w, 'optionalAccess', _91 => _91.gpuError])) return { ...base, state: "failed", reason: w.gpuError };
|
|
3830
3943
|
if (this.gpuSupport && !this.gpuSupport.supported) return { ...base, state: "unavailable", reason: this.gpuSupport.reason };
|
|
3831
3944
|
if (!this.gpu) return { ...base, state: "not-started", reason: "Starts with the first wet stroke." };
|
|
3832
|
-
if (_optionalChain([w, 'optionalAccess',
|
|
3945
|
+
if (_optionalChain([w, 'optionalAccess', _92 => _92.gpuActive])) return { ...base, state: "active", reason: null };
|
|
3833
3946
|
return { ...base, state: "standby", reason: `The GPU takes over at ${this.gpuMinTiles} wet tiles (256 px).` };
|
|
3834
3947
|
}
|
|
3835
3948
|
/** The world (made on first use, at the canvas size). */
|
|
@@ -3868,13 +3981,13 @@ var PaintWetLayers = (_class6 = class {
|
|
|
3868
3981
|
if (!this.canExtend(left2, top)) throw new Error("Wet paint only moves by whole 256 px tiles, between strokes.");
|
|
3869
3982
|
for (const [id, s] of this.settings) if (s.flow.center) this.settings.set(id, { ...s, flow: { ...s.flow, center: { x: s.flow.center.x + left2, y: s.flow.center.y + top } } });
|
|
3870
3983
|
const old = this.world;
|
|
3871
|
-
const snap = _optionalChain([old, 'optionalAccess',
|
|
3984
|
+
const snap = _optionalChain([old, 'optionalAccess', _93 => _93.laneIds, 'call', _94 => _94(), 'access', _95 => _95.length]) ? old.snapshot() : null;
|
|
3872
3985
|
this.dropWorld();
|
|
3873
3986
|
this.lastTick = null;
|
|
3874
3987
|
this.stepsOwed = 0;
|
|
3875
3988
|
if (!old || !snap) return;
|
|
3876
3989
|
const moved = _chunkJ5VQYK7Tcjs.moveWetSnapshot.call(void 0, snap, old, { width, height }, left2, top, (l) => {
|
|
3877
|
-
const flow = _optionalChain([this, 'access',
|
|
3990
|
+
const flow = _optionalChain([this, 'access', _96 => _96.settings, 'access', _97 => _97.get, 'call', _98 => _98(l.id), 'optionalAccess', _99 => _99.flow]);
|
|
3878
3991
|
return {
|
|
3879
3992
|
base: _chunk474IQG74cjs.translateSurface.call(void 0, l.base, left2, top),
|
|
3880
3993
|
...l.light ? { light: _chunk474IQG74cjs.translateSurface.call(void 0, l.light, left2, top) } : {},
|
|
@@ -3893,11 +4006,11 @@ var PaintWetLayers = (_class6 = class {
|
|
|
3893
4006
|
}
|
|
3894
4007
|
/** Layers holding a wet layer (wet or drying). */
|
|
3895
4008
|
wetLayerIds() {
|
|
3896
|
-
return _nullishCoalesce(_optionalChain([this, 'access',
|
|
4009
|
+
return _nullishCoalesce(_optionalChain([this, 'access', _100 => _100.world, 'optionalAccess', _101 => _101.laneIds, 'call', _102 => _102()]), () => ( []));
|
|
3897
4010
|
}
|
|
3898
4011
|
/** Whether a batch is running (edits wait). */
|
|
3899
4012
|
get busy() {
|
|
3900
|
-
return Boolean(_optionalChain([this, 'access',
|
|
4013
|
+
return Boolean(_optionalChain([this, 'access', _103 => _103.world, 'optionalAccess', _104 => _104.busy]));
|
|
3901
4014
|
}
|
|
3902
4015
|
/** Resolves when no batch is running. */
|
|
3903
4016
|
async idle() {
|
|
@@ -3926,13 +4039,13 @@ var PaintWetLayers = (_class6 = class {
|
|
|
3926
4039
|
setParams(layerId, update) {
|
|
3927
4040
|
const s = this.settingsOf(layerId);
|
|
3928
4041
|
s.params = _chunkJ5VQYK7Tcjs.normalizeWetParams.call(void 0, update, s.params);
|
|
3929
|
-
if (_optionalChain([this, 'access',
|
|
4042
|
+
if (_optionalChain([this, 'access', _105 => _105.world, 'optionalAccess', _106 => _106.hasLane, 'call', _107 => _107(layerId)])) this.world.setParams(layerId, s.params);
|
|
3930
4043
|
return { ...s.params };
|
|
3931
4044
|
}
|
|
3932
4045
|
setFlow(layerId, update) {
|
|
3933
4046
|
const s = this.settingsOf(layerId);
|
|
3934
4047
|
s.flow = _chunkJ5VQYK7Tcjs.normalizeFlow.call(void 0, update, s.flow);
|
|
3935
|
-
if (_optionalChain([this, 'access',
|
|
4048
|
+
if (_optionalChain([this, 'access', _108 => _108.world, 'optionalAccess', _109 => _109.hasLane, 'call', _110 => _110(layerId)])) {
|
|
3936
4049
|
const { width, height } = this.host.canvas();
|
|
3937
4050
|
this.world.setFlow(layerId, _chunkJ5VQYK7Tcjs.flowField.call(void 0, s.flow, width, height), s.flow.strength);
|
|
3938
4051
|
}
|
|
@@ -3940,29 +4053,29 @@ var PaintWetLayers = (_class6 = class {
|
|
|
3940
4053
|
}
|
|
3941
4054
|
setTilt(update) {
|
|
3942
4055
|
this.tilt = _chunkJ5VQYK7Tcjs.normalizeTilt.call(void 0, update, this.tilt);
|
|
3943
|
-
_optionalChain([this, 'access',
|
|
4056
|
+
_optionalChain([this, 'access', _111 => _111.world, 'optionalAccess', _112 => _112.setTilt, 'call', _113 => _113(this.tilt)]);
|
|
3944
4057
|
return { ...this.tilt };
|
|
3945
4058
|
}
|
|
3946
4059
|
/** The paper changed. */
|
|
3947
4060
|
paperChanged() {
|
|
3948
|
-
_optionalChain([this, 'access',
|
|
4061
|
+
_optionalChain([this, 'access', _114 => _114.world, 'optionalAccess', _115 => _115.setPaper, 'call', _116 => _116(wetPaperInput(this.host.paper()))]);
|
|
3949
4062
|
}
|
|
3950
4063
|
/** A layer as tools describe it. */
|
|
3951
4064
|
info(layerId) {
|
|
3952
4065
|
const s = this.settingsOf(layerId);
|
|
3953
|
-
const st = _optionalChain([this, 'access',
|
|
4066
|
+
const st = _optionalChain([this, 'access', _117 => _117.world, 'optionalAccess', _118 => _118.hasLane, 'call', _119 => _119(layerId)]) ? this.world.stats(layerId) : null;
|
|
3954
4067
|
return {
|
|
3955
4068
|
layerId,
|
|
3956
4069
|
wet: Boolean(st && st.wetCells > 0),
|
|
3957
|
-
wetCells: _nullishCoalesce(_optionalChain([st, 'optionalAccess',
|
|
3958
|
-
wetBounds: _nullishCoalesce(_optionalChain([st, 'optionalAccess',
|
|
3959
|
-
activeTiles: _nullishCoalesce(_optionalChain([st, 'optionalAccess',
|
|
4070
|
+
wetCells: _nullishCoalesce(_optionalChain([st, 'optionalAccess', _120 => _120.wetCells]), () => ( 0)),
|
|
4071
|
+
wetBounds: _nullishCoalesce(_optionalChain([st, 'optionalAccess', _121 => _121.wetBounds]), () => ( null)),
|
|
4072
|
+
activeTiles: _nullishCoalesce(_optionalChain([st, 'optionalAccess', _122 => _122.activeTiles]), () => ( 0)),
|
|
3960
4073
|
params: { ...s.params },
|
|
3961
4074
|
flow: { ...s.flow }
|
|
3962
4075
|
};
|
|
3963
4076
|
}
|
|
3964
4077
|
backend() {
|
|
3965
|
-
return _nullishCoalesce(_optionalChain([this, 'access',
|
|
4078
|
+
return _nullishCoalesce(_optionalChain([this, 'access', _123 => _123.world, 'optionalAccess', _124 => _124.backend, 'call', _125 => _125()]), () => ( null));
|
|
3966
4079
|
}
|
|
3967
4080
|
/** Shows the current wet pixels (at most `maxTiles` reshaded per layer). */
|
|
3968
4081
|
syncDisplays(maxTiles = Infinity) {
|
|
@@ -4011,7 +4124,7 @@ var PaintWetLayers = (_class6 = class {
|
|
|
4011
4124
|
const w = this.world;
|
|
4012
4125
|
if (!w) return;
|
|
4013
4126
|
for (const id of w.laneIds()) {
|
|
4014
|
-
if (w.isActive(id) || _optionalChain([this, 'access',
|
|
4127
|
+
if (w.isActive(id) || _optionalChain([this, 'access', _126 => _126.driver, 'optionalAccess', _127 => _127.init, 'access', _128 => _128.laneId]) === id) continue;
|
|
4015
4128
|
const base = w.getBase(id);
|
|
4016
4129
|
const light = w.isLit(id) ? w.getLight(id) : null;
|
|
4017
4130
|
w.removeLane(id);
|
|
@@ -4093,7 +4206,7 @@ var PaintWetLayers = (_class6 = class {
|
|
|
4093
4206
|
if (!d || !this.world) return;
|
|
4094
4207
|
const rects = d.flush();
|
|
4095
4208
|
if (rects.length) this.syncDisplays(DISPLAY_TILES_PER_TICK);
|
|
4096
|
-
if (d.done) _optionalChain([this, 'access',
|
|
4209
|
+
if (d.done) _optionalChain([this, 'access', _129 => _129.onDriverDone, 'optionalCall', _130 => _130(d)]);
|
|
4097
4210
|
}
|
|
4098
4211
|
/** Called when a live stroke that ended mid-batch has finished applying. */
|
|
4099
4212
|
__init56() {this.onDriverDone = null}
|
|
@@ -4137,13 +4250,13 @@ var PaintWetLayers = (_class6 = class {
|
|
|
4137
4250
|
/** The layer's light paint with all its wet paint dried (`null` without a wet layer or light), without changing anything. */
|
|
4138
4251
|
bakedLight(layerId) {
|
|
4139
4252
|
const w = this.world;
|
|
4140
|
-
if (!_optionalChain([w, 'optionalAccess',
|
|
4253
|
+
if (!_optionalChain([w, 'optionalAccess', _131 => _131.hasLane, 'call', _132 => _132(layerId)]) || !w.isLit(layerId)) return null;
|
|
4141
4254
|
return w.bakedLight(layerId);
|
|
4142
4255
|
}
|
|
4143
4256
|
/** The layer's pixels with all its wet paint dried (deterministic), without changing anything. */
|
|
4144
4257
|
bakedSurface(layerId) {
|
|
4145
4258
|
const w = this.world;
|
|
4146
|
-
if (!_optionalChain([w, 'optionalAccess',
|
|
4259
|
+
if (!_optionalChain([w, 'optionalAccess', _133 => _133.hasLane, 'call', _134 => _134(layerId)])) return null;
|
|
4147
4260
|
return w.bakedSurface(layerId);
|
|
4148
4261
|
}
|
|
4149
4262
|
/** A snapshot of the world for undo (`null` when there is none). */
|
|
@@ -4164,13 +4277,13 @@ var PaintWetLayers = (_class6 = class {
|
|
|
4164
4277
|
this.syncDisplays();
|
|
4165
4278
|
}
|
|
4166
4279
|
dropWorld() {
|
|
4167
|
-
_optionalChain([this, 'access',
|
|
4280
|
+
_optionalChain([this, 'access', _135 => _135.world, 'optionalAccess', _136 => _136.destroy, 'call', _137 => _137()]);
|
|
4168
4281
|
this.world = null;
|
|
4169
4282
|
this.driver = null;
|
|
4170
4283
|
}
|
|
4171
4284
|
/** Forgets everything wet (a new canvas, a resize, opening a document). */
|
|
4172
4285
|
reset() {
|
|
4173
|
-
_optionalChain([this, 'access',
|
|
4286
|
+
_optionalChain([this, 'access', _138 => _138.world, 'optionalAccess', _139 => _139.destroy, 'call', _140 => _140()]);
|
|
4174
4287
|
this.world = null;
|
|
4175
4288
|
this.driver = null;
|
|
4176
4289
|
this.settings.clear();
|
|
@@ -4200,9 +4313,9 @@ var PaintWetLayers = (_class6 = class {
|
|
|
4200
4313
|
return out;
|
|
4201
4314
|
}
|
|
4202
4315
|
destroy() {
|
|
4203
|
-
_optionalChain([this, 'access',
|
|
4316
|
+
_optionalChain([this, 'access', _141 => _141.world, 'optionalAccess', _142 => _142.destroy, 'call', _143 => _143()]);
|
|
4204
4317
|
this.world = null;
|
|
4205
|
-
_optionalChain([this, 'access',
|
|
4318
|
+
_optionalChain([this, 'access', _144 => _144.gpu, 'optionalAccess', _145 => _145.destroy, 'call', _146 => _146()]);
|
|
4206
4319
|
this.gpu = null;
|
|
4207
4320
|
}
|
|
4208
4321
|
}, _class6);
|
|
@@ -4220,7 +4333,7 @@ function vectorMediaEngine(brush) {
|
|
|
4220
4333
|
var usesVectorBackdrop = (engine) => engine === "mixer" || engine === "smudge" || engine === "blender";
|
|
4221
4334
|
var finite2 = (v2) => typeof v2 === "number" && Number.isFinite(v2);
|
|
4222
4335
|
function place(input, brush, options, pad = 0) {
|
|
4223
|
-
const samples =
|
|
4336
|
+
const samples = _chunkSTLTOISWcjs.brushstrokeSamples.call(void 0, input);
|
|
4224
4337
|
if (!samples.length) return null;
|
|
4225
4338
|
for (const s of samples) if (!finite2(s.x) || !finite2(s.y)) throw new Error("Brushstroke samples need finite x and y.");
|
|
4226
4339
|
let scale3 = finite2(options.scale) && options.scale > 0 ? Math.min(_chunkYQGCPL5Xcjs.BRUSHSTROKE_MAX_SCALE, Math.max(_chunkYQGCPL5Xcjs.BRUSHSTROKE_MIN_SCALE, options.scale)) : 1;
|
|
@@ -4244,8 +4357,8 @@ function place(input, brush, options, pad = 0) {
|
|
|
4244
4357
|
const [r, g, b, a] = options.color;
|
|
4245
4358
|
const hex = "#" + [r, g, b].map((v2) => Math.round(Math.min(255, Math.max(0, v2))).toString(16).padStart(2, "0")).join("");
|
|
4246
4359
|
const source = _nullishCoalesce(options.paint, () => ( null));
|
|
4247
|
-
const paint = _optionalChain([source, 'optionalAccess',
|
|
4248
|
-
const color2 = _optionalChain([source, 'optionalAccess',
|
|
4360
|
+
const paint = _optionalChain([source, 'optionalAccess', _147 => _147.type]) === "gradient" ? _chunkNIBFKXMDcjs.resolvePaintGradient.call(void 0, _chunkNIBFKXMDcjs.scalePaintGradient.call(void 0, source, scale3), { paint: hex, secondary: "#ffffff" }) : null;
|
|
4361
|
+
const color2 = _optionalChain([source, 'optionalAccess', _148 => _148.type]) === "color" ? hexRgb(source.color) : [r / 255, g / 255, b / 255];
|
|
4249
4362
|
return { points, brush: sized, rect, scale: scale3, color: color2, alpha: Math.min(1, Math.max(0, a / 255)), paint };
|
|
4250
4363
|
}
|
|
4251
4364
|
function hexRgb(hex) {
|
|
@@ -4355,7 +4468,7 @@ var WetBrushstrokeJob = (_class7 = class {
|
|
|
4355
4468
|
return this.final;
|
|
4356
4469
|
}
|
|
4357
4470
|
destroy() {
|
|
4358
|
-
_optionalChain([this, 'access',
|
|
4471
|
+
_optionalChain([this, 'access', _149 => _149.world, 'optionalAccess', _150 => _150.destroy, 'call', _151 => _151()]);
|
|
4359
4472
|
}
|
|
4360
4473
|
bake() {
|
|
4361
4474
|
if (!this.world || !this.placed) return EMPTY;
|
|
@@ -4380,8 +4493,8 @@ function renderBackdropBrushstroke(input, brush, options) {
|
|
|
4380
4493
|
const area = { x: 0, y: 0, width: rect.width, height: rect.height };
|
|
4381
4494
|
const before = options.backdrop ? options.backdrop(rect, placed.scale) : new Uint8ClampedArray(rect.width * rect.height * 4);
|
|
4382
4495
|
if (before.length !== rect.width * rect.height * 4) throw new Error(`The backdrop must be ${rect.width}\xD7${rect.height} RGBA pixels.`);
|
|
4383
|
-
const cached = _optionalChain([options, 'access',
|
|
4384
|
-
const hit = _optionalChain([cached, 'optionalAccess',
|
|
4496
|
+
const cached = _optionalChain([options, 'access', _152 => _152.cache, 'optionalCall', _153 => _153(before)]);
|
|
4497
|
+
const hit = _optionalChain([cached, 'optionalAccess', _154 => _154.get, 'call', _155 => _155()]);
|
|
4385
4498
|
if (hit) return hit;
|
|
4386
4499
|
const base = _chunk474IQG74cjs.writeRegion.call(void 0, _chunk474IQG74cjs.emptySurface.call(void 0, 4), area, before);
|
|
4387
4500
|
const live = /* @__PURE__ */ new Map();
|
|
@@ -4389,7 +4502,7 @@ function renderBackdropBrushstroke(input, brush, options) {
|
|
|
4389
4502
|
offset: { x: 0, y: 0 },
|
|
4390
4503
|
lockTransparency: false,
|
|
4391
4504
|
selection: null,
|
|
4392
|
-
readTile: (tx, ty) => _nullishCoalesce(_nullishCoalesce(live.get(_chunk474IQG74cjs.tileKey.call(void 0, tx, ty)), () => ( _optionalChain([base, 'access',
|
|
4505
|
+
readTile: (tx, ty) => _nullishCoalesce(_nullishCoalesce(live.get(_chunk474IQG74cjs.tileKey.call(void 0, tx, ty)), () => ( _optionalChain([base, 'access', _156 => _156.tiles, 'access', _157 => _157.get, 'call', _158 => _158(_chunk474IQG74cjs.tileKey.call(void 0, tx, ty)), 'optionalAccess', _159 => _159.data]))), () => ( null)),
|
|
4393
4506
|
writeTile: (tx, ty) => {
|
|
4394
4507
|
const key = _chunk474IQG74cjs.tileKey.call(void 0, tx, ty);
|
|
4395
4508
|
let t = live.get(key);
|
|
@@ -4398,7 +4511,7 @@ function renderBackdropBrushstroke(input, brush, options) {
|
|
|
4398
4511
|
}
|
|
4399
4512
|
};
|
|
4400
4513
|
const color2 = placed.color;
|
|
4401
|
-
const load = placed.brush.engine === "mixer" && placed.brush.loadsColor ?
|
|
4514
|
+
const load = placed.brush.engine === "mixer" && placed.brush.loadsColor ? _chunkNIBFKXMDcjs.loadMixer.call(void 0, _chunkNIBFKXMDcjs.EMPTY_MIXER_LOAD, color2) : _chunkNIBFKXMDcjs.EMPTY_MIXER_LOAD;
|
|
4402
4515
|
const stroke = new PaintDabStroke(placed.brush, { target, color: color2, secondary: [1, 1, 1], load, grain: null, paperDepth: 0, seed: _nullishCoalesce(options.seed, () => ( 0)), paint: placed.paint });
|
|
4403
4516
|
stroke.push(placed.points);
|
|
4404
4517
|
stroke.finish();
|
|
@@ -4407,29 +4520,29 @@ function renderBackdropBrushstroke(input, brush, options) {
|
|
|
4407
4520
|
for (const [key, data] of live) tiles.set(key, { data, uniform: null });
|
|
4408
4521
|
_chunk474IQG74cjs.readRegion.call(void 0, new (0, _chunk474IQG74cjs.TiledSurface)(4, tiles), area, after);
|
|
4409
4522
|
const result = cropped(after, placed, stroke.dabCount, (i) => after[i] !== before[i] || after[i + 1] !== before[i + 1] || after[i + 2] !== before[i + 2] || after[i + 3] !== before[i + 3]);
|
|
4410
|
-
_optionalChain([cached, 'optionalAccess',
|
|
4523
|
+
_optionalChain([cached, 'optionalAccess', _160 => _160.set, 'call', _161 => _161(result)]);
|
|
4411
4524
|
return result;
|
|
4412
4525
|
}
|
|
4413
4526
|
|
|
4414
4527
|
// src/vector/brushstroke.ts
|
|
4415
4528
|
var VECTOR_BRUSHSTROKE_SCALE = 2;
|
|
4416
|
-
var PRESETS =
|
|
4529
|
+
var PRESETS = _chunkEU2ZZA6Lcjs.listPresets.call(void 0, _chunkEU2ZZA6Lcjs.VECTOR_PROFILE).map((spec) => _chunkEU2ZZA6Lcjs.BUILTIN_BRUSHES.find((b) => b.id === spec.id));
|
|
4417
4530
|
function admitted(spec) {
|
|
4418
4531
|
try {
|
|
4419
|
-
const brush =
|
|
4420
|
-
return
|
|
4532
|
+
const brush = _chunkEU2ZZA6Lcjs.normalizeBrushSpec.call(void 0, spec);
|
|
4533
|
+
return _chunkEU2ZZA6Lcjs.checkBrush.call(void 0, brush, _chunkEU2ZZA6Lcjs.VECTOR_PROFILE).ok && isVectorBrushstrokeEngine(_chunkEU2ZZA6Lcjs.resolveBrush.call(void 0, brush)) ? brush : null;
|
|
4421
4534
|
} catch (e6) {
|
|
4422
4535
|
return null;
|
|
4423
4536
|
}
|
|
4424
4537
|
}
|
|
4425
4538
|
function isVectorBrushstrokeEngine(brush) {
|
|
4426
|
-
return brush.engine === "dab" &&
|
|
4539
|
+
return brush.engine === "dab" && _chunkSTLTOISWcjs.isBrushstrokeBrush.call(void 0, brush) || vectorMediaEngine(brush) !== null;
|
|
4427
4540
|
}
|
|
4428
4541
|
function vectorBrushstrokeBrushes(user = []) {
|
|
4429
4542
|
const out = [...PRESETS];
|
|
4430
4543
|
for (const raw of user) {
|
|
4431
4544
|
const brush = admitted(raw);
|
|
4432
|
-
if (brush && !out.some((b) => b.id === brush.id)) out.push(
|
|
4545
|
+
if (brush && !out.some((b) => b.id === brush.id)) out.push(_chunkEU2ZZA6Lcjs.resolveBrush.call(void 0, brush));
|
|
4433
4546
|
}
|
|
4434
4547
|
return out;
|
|
4435
4548
|
}
|
|
@@ -4439,7 +4552,7 @@ function vectorBrushstrokeBrush(id) {
|
|
|
4439
4552
|
function vectorBrushstrokeBrushOf(brush) {
|
|
4440
4553
|
if (brush.spec) {
|
|
4441
4554
|
const saved = admitted(brush.spec);
|
|
4442
|
-
return saved && saved.id === brush.brushId ?
|
|
4555
|
+
return saved && saved.id === brush.brushId ? _chunkEU2ZZA6Lcjs.resolveBrush.call(void 0, saved) : null;
|
|
4443
4556
|
}
|
|
4444
4557
|
return vectorBrushstrokeBrush(brush.brushId);
|
|
4445
4558
|
}
|
|
@@ -4447,15 +4560,15 @@ function vectorBrushstrokeBrushError(id, user = []) {
|
|
|
4447
4560
|
if (vectorBrushstrokeBrush(id)) return null;
|
|
4448
4561
|
const saved = user.find((b) => b.id === id);
|
|
4449
4562
|
const ids = vectorBrushstrokeBrushes(user).map((b) => b.id);
|
|
4450
|
-
const reasons = (b) =>
|
|
4563
|
+
const reasons = (b) => _chunkEU2ZZA6Lcjs.checkBrush.call(void 0, b, _chunkEU2ZZA6Lcjs.VECTOR_PROFILE).issues.filter((i) => i.severity === "error").map((i) => `${i.reason} ${i.fix}`).join(" ") || "its engine does not paint brushstrokes.";
|
|
4451
4564
|
if (saved) return admitted(saved) ? null : `Brush "${id}" (${saved.name}) can't paint a brushstroke: ${reasons(saved)} Use one of: ${ids.join(", ")}.`;
|
|
4452
|
-
const preset2 =
|
|
4565
|
+
const preset2 = _chunkEU2ZZA6Lcjs.BRUSH_PRESETS.find((b) => b.id === id);
|
|
4453
4566
|
if (preset2) return `Brush "${id}" (${preset2.name}) can't paint a brushstroke: ${reasons(preset2)} Use one of: ${ids.join(", ")}.`;
|
|
4454
|
-
return `Unknown brush "${id}". ${
|
|
4567
|
+
return `Unknown brush "${id}". ${_chunkEU2ZZA6Lcjs.closest.call(void 0, id, ids)}Use one of: ${ids.join(", ")} (vector.listBrushes lists them).`;
|
|
4455
4568
|
}
|
|
4456
4569
|
function vectorBrushstrokeDefaultColour(id, user = [], scheme = "light") {
|
|
4457
|
-
const brush = _nullishCoalesce(
|
|
4458
|
-
return brush ? _chunkJBZRVLXVcjs.brushColourHex.call(void 0, _optionalChain([brush, 'access',
|
|
4570
|
+
const brush = _nullishCoalesce(_chunkEU2ZZA6Lcjs.BRUSH_PRESETS.find((b) => b.id === id), () => ( user.find((b) => b.id === id)));
|
|
4571
|
+
return brush ? _chunkJBZRVLXVcjs.brushColourHex.call(void 0, _optionalChain([brush, 'access', _162 => _162.colour, 'optionalAccess', _163 => _163.default]), scheme) : null;
|
|
4459
4572
|
}
|
|
4460
4573
|
function sanitizeVectorBrushstroke(value, user = []) {
|
|
4461
4574
|
if (!value || typeof value !== "object") return null;
|
|
@@ -4487,7 +4600,7 @@ var TIMED_MAPPINGS = ["velocity", "time"];
|
|
|
4487
4600
|
function vectorBrushstrokePaintError(paint) {
|
|
4488
4601
|
let source;
|
|
4489
4602
|
try {
|
|
4490
|
-
source =
|
|
4603
|
+
source = _chunkNIBFKXMDcjs.parsePaintSource.call(void 0, paint, "paint");
|
|
4491
4604
|
} catch (e) {
|
|
4492
4605
|
return e.message;
|
|
4493
4606
|
}
|
|
@@ -4496,7 +4609,7 @@ function vectorBrushstrokePaintError(paint) {
|
|
|
4496
4609
|
}
|
|
4497
4610
|
function readVectorBrushstrokePaint(value) {
|
|
4498
4611
|
if (value === void 0 || value === null || vectorBrushstrokePaintError(value)) return null;
|
|
4499
|
-
return
|
|
4612
|
+
return _chunkNIBFKXMDcjs.readPaintSource.call(void 0, value);
|
|
4500
4613
|
}
|
|
4501
4614
|
var VECTOR_BRUSHSTROKE_MAX_SEED = 2147483647;
|
|
4502
4615
|
var finite3 = (v2) => typeof v2 === "number" && Number.isFinite(v2);
|
|
@@ -4505,7 +4618,7 @@ function sanitizeVectorBrushstrokePaper(value) {
|
|
|
4505
4618
|
if (!value || typeof value !== "object") return null;
|
|
4506
4619
|
const r = value;
|
|
4507
4620
|
const out = {};
|
|
4508
|
-
if (typeof r.pattern === "string" &&
|
|
4621
|
+
if (typeof r.pattern === "string" && _chunkNIBFKXMDcjs.GRAIN_PATTERNS.includes(r.pattern)) out.pattern = r.pattern;
|
|
4509
4622
|
const seed = sanitizeSeed(r.seed);
|
|
4510
4623
|
if (seed !== void 0) out.seed = seed;
|
|
4511
4624
|
if (finite3(r.scale) && r.scale > 0) out.scale = Math.min(8, Math.max(0.25, r.scale));
|
|
@@ -4520,7 +4633,7 @@ function vectorBrushstrokeCharacterError(brush) {
|
|
|
4520
4633
|
const r = paper;
|
|
4521
4634
|
const extra = Object.keys(r).filter((k) => !["pattern", "seed", "scale", "depth"].includes(k));
|
|
4522
4635
|
if (extra.length) return `paper has unknown field ${extra.map((k) => `"${k}"`).join(", ")}: use pattern, seed, scale, depth.`;
|
|
4523
|
-
if (r.pattern !== void 0 && !
|
|
4636
|
+
if (r.pattern !== void 0 && !_chunkNIBFKXMDcjs.GRAIN_PATTERNS.includes(r.pattern)) return `Unknown paper pattern "${String(r.pattern)}": use one of ${_chunkNIBFKXMDcjs.GRAIN_PATTERNS.join(", ")}.`;
|
|
4524
4637
|
if (r.seed !== void 0 && !(Number.isInteger(r.seed) && r.seed >= 0 && r.seed <= VECTOR_BRUSHSTROKE_MAX_SEED)) return `paper.seed must be an integer from 0 to ${VECTOR_BRUSHSTROKE_MAX_SEED}.`;
|
|
4525
4638
|
if (r.scale !== void 0 && !(finite3(r.scale) && r.scale >= 0.25 && r.scale <= 8)) return "paper.scale must be from 0.25 to 8 (1 is the pattern's natural size).";
|
|
4526
4639
|
if (r.depth !== void 0 && !(finite3(r.depth) && r.depth >= 0 && r.depth <= 1)) return "paper.depth must be from 0 to 1.";
|
|
@@ -4579,7 +4692,7 @@ function strokePaintOf(node, layer, brush, length2) {
|
|
|
4579
4692
|
const color2 = [c[0] * 255, c[1] * 255, c[2] * 255, c[3] * 255].map(Math.round);
|
|
4580
4693
|
if (layer.brush.paint) return { color: color2, paint: layer.brush.paint, within: null };
|
|
4581
4694
|
const g = layer.paint;
|
|
4582
|
-
if (isVectorGradient(g) && _optionalChain([g, 'access',
|
|
4695
|
+
if (isVectorGradient(g) && _optionalChain([g, 'access', _164 => _164.stops, 'optionalAccess', _165 => _165.length])) {
|
|
4583
4696
|
const mode = _nullishCoalesce(g.strokeMode, () => ( "within"));
|
|
4584
4697
|
if (mode === "along") return { color: [color2[0], color2[1], color2[2], 255], paint: gradientPaint(g, { by: "distance", length: Math.max(1, length2), repeat: REPEAT[_nullishCoalesce(g.spread, () => ( "pad"))], unit: "px" }), within: null };
|
|
4585
4698
|
if (mode === "across") return { color: [color2[0], color2[1], color2[2], 255], paint: gradientPaint(g, { by: "across-tip" }), within: null };
|
|
@@ -4719,7 +4832,7 @@ function wetImage(input, brush, options, settle, pending) {
|
|
|
4719
4832
|
pending.push(key);
|
|
4720
4833
|
return _nullishCoalesce(wetInstant.get(key), () => ( job.image()));
|
|
4721
4834
|
}
|
|
4722
|
-
var cache = new (0,
|
|
4835
|
+
var cache = new (0, _chunkSTLTOISWcjs.BrushstrokeCache)(256);
|
|
4723
4836
|
var backdropResults = new Lru(64);
|
|
4724
4837
|
var urls = /* @__PURE__ */ new WeakMap();
|
|
4725
4838
|
var layerCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -4734,7 +4847,7 @@ function vectorBrushstrokeImages(node, layer, context = {}) {
|
|
|
4734
4847
|
const source = usesVectorBackdrop(engine) && backdropSource ? backdropSource(document2, node, Math.max(0, index), settle) : null;
|
|
4735
4848
|
const deps = source ? [...source.deps, wetGeneration] : null;
|
|
4736
4849
|
let byLayer = layerCache.get(node);
|
|
4737
|
-
const hit = _optionalChain([byLayer, 'optionalAccess',
|
|
4850
|
+
const hit = _optionalChain([byLayer, 'optionalAccess', _166 => _166.get, 'call', _167 => _167(layer)]);
|
|
4738
4851
|
const stale = hit && (hit.pending.length && hit.pending.some((k) => wetSettled.has(k)) || settle === "now" && !hit.settled);
|
|
4739
4852
|
if (hit && sameDeps(hit.deps, deps) && !stale) return hit.images;
|
|
4740
4853
|
const brush = layer.brush.size ? { ...preset2, tip: { ...preset2.tip, size: layer.brush.size } } : preset2;
|
|
@@ -4759,7 +4872,7 @@ function vectorBrushstrokeImages(node, layer, context = {}) {
|
|
|
4759
4872
|
const key = mediaKey(input, brush, options);
|
|
4760
4873
|
stroke = renderBackdropBrushstroke(input, brush, {
|
|
4761
4874
|
...options,
|
|
4762
|
-
backdrop: _nullishCoalesce(_optionalChain([source, 'optionalAccess',
|
|
4875
|
+
backdrop: _nullishCoalesce(_optionalChain([source, 'optionalAccess', _168 => _168.backdrop]), () => ( null)),
|
|
4763
4876
|
cache: (bytes) => {
|
|
4764
4877
|
const k = `${key}:${hashBytes(bytes).toString(16)}`;
|
|
4765
4878
|
return { get: () => backdropResults.get(k), set: (img) => backdropResults.set(k, img) };
|
|
@@ -4772,7 +4885,7 @@ function vectorBrushstrokeImages(node, layer, context = {}) {
|
|
|
4772
4885
|
if (sp2.within) stroke = recoloured(stroke, sp2.within);
|
|
4773
4886
|
if (!stroke.bounds) continue;
|
|
4774
4887
|
let href = urls.get(stroke);
|
|
4775
|
-
if (!href) urls.set(stroke, href =
|
|
4888
|
+
if (!href) urls.set(stroke, href = _chunkSTLTOISWcjs.brushstrokeDataUrl.call(void 0, stroke));
|
|
4776
4889
|
out.push({ href, ...stroke.bounds });
|
|
4777
4890
|
}
|
|
4778
4891
|
}
|
|
@@ -4863,7 +4976,7 @@ function withVectorFills(node, fills) {
|
|
|
4863
4976
|
const next = { ...node };
|
|
4864
4977
|
if (fills.length === 0 || fills.length === 1 && isPlainVectorPaintLayer(fills[0])) {
|
|
4865
4978
|
delete next.fills;
|
|
4866
|
-
next.fill = _nullishCoalesce(_optionalChain([fills, 'access',
|
|
4979
|
+
next.fill = _nullishCoalesce(_optionalChain([fills, 'access', _169 => _169[0], 'optionalAccess', _170 => _170.paint]), () => ( null));
|
|
4867
4980
|
return next;
|
|
4868
4981
|
}
|
|
4869
4982
|
next.fills = fills.map((l) => ({ ...l }));
|
|
@@ -4888,8 +5001,8 @@ function withVectorStrokes(node, strokes) {
|
|
|
4888
5001
|
var json = (v2) => JSON.stringify(_nullishCoalesce(v2, () => ( null)));
|
|
4889
5002
|
function strokeShorthandDiff(node, top) {
|
|
4890
5003
|
const out = [];
|
|
4891
|
-
if (json(node.stroke) !== json(_optionalChain([top, 'optionalAccess',
|
|
4892
|
-
for (const key of VECTOR_STROKE_SETTING_KEYS) if (json(node[key]) !== json(_optionalChain([top, 'optionalAccess',
|
|
5004
|
+
if (json(node.stroke) !== json(_optionalChain([top, 'optionalAccess', _171 => _171.paint]))) out.push("stroke");
|
|
5005
|
+
for (const key of VECTOR_STROKE_SETTING_KEYS) if (json(node[key]) !== json(_optionalChain([top, 'optionalAccess', _172 => _172[key]]))) out.push(key);
|
|
4893
5006
|
return out;
|
|
4894
5007
|
}
|
|
4895
5008
|
var checked = /* @__PURE__ */ new WeakSet();
|
|
@@ -4906,7 +5019,7 @@ function normalizeVectorPaintStacks(node, prefer = "shorthand") {
|
|
|
4906
5019
|
if (Array.isArray(node.fills)) {
|
|
4907
5020
|
let fills = node.fills;
|
|
4908
5021
|
const top = fills[fills.length - 1];
|
|
4909
|
-
if (prefer === "shorthand" && json(node.fill) !== json(_optionalChain([top, 'optionalAccess',
|
|
5022
|
+
if (prefer === "shorthand" && json(node.fill) !== json(_optionalChain([top, 'optionalAccess', _173 => _173.paint]))) {
|
|
4910
5023
|
if (!draws(node.fill)) fills = [];
|
|
4911
5024
|
else fills = top ? [...fills.slice(0, -1), { ...top, paint: node.fill }] : [{ paint: node.fill }];
|
|
4912
5025
|
}
|
|
@@ -5122,8 +5235,8 @@ var Measured = class {
|
|
|
5122
5235
|
append(sa, sb, out) {
|
|
5123
5236
|
for (const piece of _chunkGF2RBSDMcjs.trimSegments.call(void 0, this.segs, sa, sb, this.lens)) {
|
|
5124
5237
|
if (degenerate(piece)) continue;
|
|
5125
|
-
const last = _optionalChain([out, 'access',
|
|
5126
|
-
const end = _optionalChain([last, 'optionalAccess',
|
|
5238
|
+
const last = _optionalChain([out, 'access', _174 => _174[out.length - 1], 'optionalAccess', _175 => _175.segs]);
|
|
5239
|
+
const end = _optionalChain([last, 'optionalAccess', _176 => _176[last.length - 1], 'optionalAccess', _177 => _177.at, 'call', _178 => _178(-1)]);
|
|
5127
5240
|
if (!end || Math.hypot(end[0] - piece[0][0], end[1] - piece[0][1]) > 1e-6) out.push({ segs: [piece], closed: false });
|
|
5128
5241
|
else last.push(piece);
|
|
5129
5242
|
}
|
|
@@ -5435,9 +5548,9 @@ function vectorRepeaterCopies(r, pivot) {
|
|
|
5435
5548
|
for (let i = 0; i < n; i++) {
|
|
5436
5549
|
const k = i + offset;
|
|
5437
5550
|
let m = translateMatrix(-pivot.x, -pivot.y);
|
|
5438
|
-
m = multiplyMatrices(m, scaleMatrix(Math.pow((_nullishCoalesce(_optionalChain([r, 'access',
|
|
5551
|
+
m = multiplyMatrices(m, scaleMatrix(Math.pow((_nullishCoalesce(_optionalChain([r, 'access', _179 => _179.scale, 'optionalAccess', _180 => _180.x]), () => ( 100))) / 100, k), Math.pow((_nullishCoalesce(_optionalChain([r, 'access', _181 => _181.scale, 'optionalAccess', _182 => _182.y]), () => ( 100))) / 100, k)));
|
|
5439
5552
|
m = multiplyMatrices(m, rotateMatrix((_nullishCoalesce(r.rotation, () => ( 0))) * k));
|
|
5440
|
-
m = multiplyMatrices(m, translateMatrix(pivot.x + (_nullishCoalesce(_optionalChain([r, 'access',
|
|
5553
|
+
m = multiplyMatrices(m, translateMatrix(pivot.x + (_nullishCoalesce(_optionalChain([r, 'access', _183 => _183.position, 'optionalAccess', _184 => _184.x]), () => ( 0))) * k, pivot.y + (_nullishCoalesce(_optionalChain([r, 'access', _185 => _185.position, 'optionalAccess', _186 => _186.y]), () => ( 0))) * k));
|
|
5441
5554
|
const t = n > 1 ? i / (n - 1) : 0;
|
|
5442
5555
|
const partial = i + 1 === n && fract > 0 ? fract : 1;
|
|
5443
5556
|
out.push({ index: i, matrix: m, opacity: Math.min(1, Math.max(0, (so + (eo - so) * t) * partial)) });
|
|
@@ -5601,7 +5714,7 @@ function mapBezierPath(path, f, tolerance = 0.1, options = {}) {
|
|
|
5601
5714
|
|
|
5602
5715
|
// src/vector/frames.ts
|
|
5603
5716
|
function isVectorFrame(node) {
|
|
5604
|
-
return _optionalChain([node, 'optionalAccess',
|
|
5717
|
+
return _optionalChain([node, 'optionalAccess', _187 => _187.type]) === "group" && !!node.frame && !node.blend && !node.liveBoolean && !node.mask;
|
|
5605
5718
|
}
|
|
5606
5719
|
function vectorFrameRectPath(frame) {
|
|
5607
5720
|
const { x, y, width: w, height: h } = frame;
|
|
@@ -5646,8 +5759,8 @@ function placeSpan(rule, a0, a1, f0, f1, g0, g1) {
|
|
|
5646
5759
|
}
|
|
5647
5760
|
}
|
|
5648
5761
|
function vectorFrameChildMatrix(resizing, box, from, to) {
|
|
5649
|
-
const [x0, x1] = placeSpan(_nullishCoalesce(H[_nullishCoalesce(_optionalChain([resizing, 'optionalAccess',
|
|
5650
|
-
const [y0, y1] = placeSpan(_nullishCoalesce(V[_nullishCoalesce(_optionalChain([resizing, 'optionalAccess',
|
|
5762
|
+
const [x0, x1] = placeSpan(_nullishCoalesce(H[_nullishCoalesce(_optionalChain([resizing, 'optionalAccess', _188 => _188.horizontal]), () => ( "left"))], () => ( "start")), box.x, box.x + box.width, from.x, from.x + from.width, to.x, to.x + to.width);
|
|
5763
|
+
const [y0, y1] = placeSpan(_nullishCoalesce(V[_nullishCoalesce(_optionalChain([resizing, 'optionalAccess', _189 => _189.vertical]), () => ( "top"))], () => ( "start")), box.y, box.y + box.height, from.y, from.y + from.height, to.y, to.y + to.height);
|
|
5651
5764
|
const sx = box.width > 1e-9 ? (x1 - x0) / box.width : 1;
|
|
5652
5765
|
const sy = box.height > 1e-9 ? (y1 - y0) / box.height : 1;
|
|
5653
5766
|
return [sx, 0, 0, sy, x0 - sx * box.x, y0 - sy * box.y];
|
|
@@ -5703,7 +5816,7 @@ function vectorFrameDocument(doc, id, find) {
|
|
|
5703
5816
|
height,
|
|
5704
5817
|
...doc.background ? { background: doc.background } : {},
|
|
5705
5818
|
nodes: [placed],
|
|
5706
|
-
..._optionalChain([doc, 'access',
|
|
5819
|
+
..._optionalChain([doc, 'access', _190 => _190.symbols, 'optionalAccess', _191 => _191.length]) ? { symbols: doc.symbols } : {}
|
|
5707
5820
|
};
|
|
5708
5821
|
}
|
|
5709
5822
|
function getVectorFramePanel(state) {
|
|
@@ -5723,7 +5836,7 @@ function getVectorFramePanel(state) {
|
|
|
5723
5836
|
const one = (values) => values.every((v2) => v2 === values[0]) ? values[0] : "mixed";
|
|
5724
5837
|
return {
|
|
5725
5838
|
frame: f ? { id: f.id, name: _nullishCoalesce(f.name, () => ( "Frame")), artboard: parents.get(f.id) === null, frame: f.frame } : null,
|
|
5726
|
-
resizing: children.length ? { ids: children.map((c) => c.id), horizontal: one(children.map((c) => _nullishCoalesce(_optionalChain([c, 'access',
|
|
5839
|
+
resizing: children.length ? { ids: children.map((c) => c.id), horizontal: one(children.map((c) => _nullishCoalesce(_optionalChain([c, 'access', _192 => _192.resizing, 'optionalAccess', _193 => _193.horizontal]), () => ( "left")))), vertical: one(children.map((c) => _nullishCoalesce(_optionalChain([c, 'access', _194 => _194.resizing, 'optionalAccess', _195 => _195.vertical]), () => ( "top")))) } : null
|
|
5727
5840
|
};
|
|
5728
5841
|
}
|
|
5729
5842
|
|
|
@@ -6109,7 +6222,7 @@ function normalizeVectorFilterParams(type, params, base) {
|
|
|
6109
6222
|
if (!isVectorFilterType(type)) return null;
|
|
6110
6223
|
const out = { ...VECTOR_FILTER_DEFAULTS[type], ..._nullishCoalesce(base, () => ( {})) };
|
|
6111
6224
|
for (const spec of VECTOR_FILTER_PARAM_SPECS[type]) {
|
|
6112
|
-
const v2 = _optionalChain([params, 'optionalAccess',
|
|
6225
|
+
const v2 = _optionalChain([params, 'optionalAccess', _196 => _196[spec.key]]);
|
|
6113
6226
|
if (v2 === void 0) continue;
|
|
6114
6227
|
if (spec.kind === "number" && typeof v2 === "number" && Number.isFinite(v2)) out[spec.key] = Math.min(_nullishCoalesce(spec.max, () => ( Infinity)), Math.max(_nullishCoalesce(spec.min, () => ( -Infinity)), v2));
|
|
6115
6228
|
else if (spec.kind === "color" && typeof v2 === "string" && v2.trim()) out[spec.key] = v2.trim();
|
|
@@ -6241,7 +6354,7 @@ function vectorFilterSvg(filters, id, bounds) {
|
|
|
6241
6354
|
primitives.push(fe("feGaussianBlur", { in: body, stdDeviation: round(f.params.radius / 2), result: name("body") }));
|
|
6242
6355
|
body = name("body");
|
|
6243
6356
|
}
|
|
6244
|
-
const lastResult = _optionalChain([primitives, 'access',
|
|
6357
|
+
const lastResult = _optionalChain([primitives, 'access', _197 => _197[primitives.length - 1], 'optionalAccess', _198 => _198.attrs, 'access', _199 => _199.result]);
|
|
6245
6358
|
if (lastResult !== body) primitives.push(fe("feMerge", {}, [fe("feMergeNode", { in: body })]));
|
|
6246
6359
|
const pad = vectorFilterReach(active) + 2;
|
|
6247
6360
|
return {
|
|
@@ -6256,7 +6369,7 @@ function vectorFilterSvg(filters, id, bounds) {
|
|
|
6256
6369
|
var escapeAttr = (value) => value.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
|
6257
6370
|
function primitiveMarkup(p) {
|
|
6258
6371
|
const attrs = Object.entries(p.attrs).map(([k, v2]) => ` ${k}="${escapeAttr(String(v2))}"`).join("");
|
|
6259
|
-
return _optionalChain([p, 'access',
|
|
6372
|
+
return _optionalChain([p, 'access', _200 => _200.children, 'optionalAccess', _201 => _201.length]) ? `<${p.tag}${attrs}>${p.children.map(primitiveMarkup).join("")}</${p.tag}>` : `<${p.tag}${attrs}/>`;
|
|
6260
6373
|
}
|
|
6261
6374
|
function vectorFilterMarkup(filter, extra = "") {
|
|
6262
6375
|
return `<filter id="${escapeAttr(filter.id)}" filterUnits="userSpaceOnUse" x="${filter.x}" y="${filter.y}" width="${filter.width}" height="${filter.height}" color-interpolation-filters="sRGB"${extra}>${filter.primitives.map(primitiveMarkup).join("")}</filter>`;
|
|
@@ -6274,7 +6387,7 @@ function sanitizeVectorMask(value) {
|
|
|
6274
6387
|
return r.invert === true ? { type: r.type, invert: true } : { type: r.type };
|
|
6275
6388
|
}
|
|
6276
6389
|
function isVectorMaskGroup(node) {
|
|
6277
|
-
return _optionalChain([node, 'optionalAccess',
|
|
6390
|
+
return _optionalChain([node, 'optionalAccess', _202 => _202.type]) === "group" && !!node.mask && isVectorMaskType(node.mask.type) && !node.blend && !node.liveBoolean && node.children.length > 0;
|
|
6278
6391
|
}
|
|
6279
6392
|
function isVectorMaskActive(node) {
|
|
6280
6393
|
return isVectorMaskGroup(node) && node.children[0].visible !== false;
|
|
@@ -6309,7 +6422,7 @@ function vectorMaskRegionShapes(node, type, parent = IDENTITY_MATRIX, self = tru
|
|
|
6309
6422
|
if (!self && node.visible === false) return [];
|
|
6310
6423
|
if (isVectorFrame(node)) node = vectorFrameDrawn(node);
|
|
6311
6424
|
const m = multiplyMatrices(nodeMatrix(node), parent);
|
|
6312
|
-
if (isVectorMaskActive(node) || node.type === "group" && _optionalChain([node, 'access',
|
|
6425
|
+
if (isVectorMaskActive(node) || node.type === "group" && _optionalChain([node, 'access', _203 => _203.effects, 'optionalAccess', _204 => _204.length])) {
|
|
6313
6426
|
return vectorAppearanceShapes(node).flatMap((s) => regionOfPath(s.path, s.source, type, m));
|
|
6314
6427
|
}
|
|
6315
6428
|
const drawn = expandVectorAppearance(node);
|
|
@@ -6514,7 +6627,7 @@ function fitRuns(runs, length2, fallback) {
|
|
|
6514
6627
|
}
|
|
6515
6628
|
if (left2 > 0) {
|
|
6516
6629
|
if (out.length) out[out.length - 1] = { ...out[out.length - 1], length: out[out.length - 1].length + left2 };
|
|
6517
|
-
else out.push({ length: left2, style: _nullishCoalesce(_optionalChain([runs, 'access',
|
|
6630
|
+
else out.push({ length: left2, style: _nullishCoalesce(_optionalChain([runs, 'access', _205 => _205[runs.length - 1], 'optionalAccess', _206 => _206.style]), () => ( fallback)) });
|
|
6518
6631
|
}
|
|
6519
6632
|
return compact(out);
|
|
6520
6633
|
}
|
|
@@ -6524,7 +6637,7 @@ function styleAt(runs, index, fallback) {
|
|
|
6524
6637
|
if (index < at2 + r.length) return r.style;
|
|
6525
6638
|
at2 += r.length;
|
|
6526
6639
|
}
|
|
6527
|
-
return _nullishCoalesce(_optionalChain([runs, 'access',
|
|
6640
|
+
return _nullishCoalesce(_optionalChain([runs, 'access', _207 => _207[runs.length - 1], 'optionalAccess', _208 => _208.style]), () => ( fallback));
|
|
6528
6641
|
}
|
|
6529
6642
|
function restyleRange(runs, start, end, patch) {
|
|
6530
6643
|
const out = [];
|
|
@@ -6580,7 +6693,7 @@ function paragraphRanges(text) {
|
|
|
6580
6693
|
return out;
|
|
6581
6694
|
}
|
|
6582
6695
|
function fitParagraphRuns(runs, text) {
|
|
6583
|
-
const fallback = _nullishCoalesce(_optionalChain([runs, 'access',
|
|
6696
|
+
const fallback = _nullishCoalesce(_optionalChain([runs, 'access', _209 => _209[0], 'optionalAccess', _210 => _210.style]), () => ( {}));
|
|
6584
6697
|
const out = compact(paragraphRanges(text).map((p) => ({ length: p.end - p.start, style: styleAt(runs, p.start, fallback) })));
|
|
6585
6698
|
return out.length ? out : [{ length: 0, style: fallback }];
|
|
6586
6699
|
}
|
|
@@ -6630,7 +6743,7 @@ function textLineRect(l) {
|
|
|
6630
6743
|
var layoutCache = /* @__PURE__ */ new WeakMap();
|
|
6631
6744
|
function layoutText(layer, shaper) {
|
|
6632
6745
|
let byShaper = layoutCache.get(layer);
|
|
6633
|
-
const hit = _optionalChain([byShaper, 'optionalAccess',
|
|
6746
|
+
const hit = _optionalChain([byShaper, 'optionalAccess', _211 => _211.get, 'call', _212 => _212(shaper.id)]);
|
|
6634
6747
|
if (hit) return hit;
|
|
6635
6748
|
const out = computeLayout(layer, shaper);
|
|
6636
6749
|
if (!byShaper) {
|
|
@@ -6694,7 +6807,7 @@ function computeLayout(layer, shaper) {
|
|
|
6694
6807
|
const code = seg.charCodeAt(k);
|
|
6695
6808
|
if (isLow(code) && index > 0 && isHigh(text.charCodeAt(index - 1))) {
|
|
6696
6809
|
const prev = chars[chars.length - 1];
|
|
6697
|
-
if (_optionalChain([prev, 'optionalAccess',
|
|
6810
|
+
if (_optionalChain([prev, 'optionalAccess', _213 => _213.up])) {
|
|
6698
6811
|
chars.push({ index, ch: seg[k], advance: 0, style, up: prev.up, low: true });
|
|
6699
6812
|
} else chars.push({ index, ch: seg[k], advance, style, low: true });
|
|
6700
6813
|
continue;
|
|
@@ -7022,7 +7135,7 @@ function createCanvasTextShaper(options = {}) {
|
|
|
7022
7135
|
return null;
|
|
7023
7136
|
})));
|
|
7024
7137
|
const canvas = make(1, 1);
|
|
7025
|
-
const ctx = _optionalChain([canvas, 'optionalAccess',
|
|
7138
|
+
const ctx = _optionalChain([canvas, 'optionalAccess', _214 => _214.getContext, 'call', _215 => _215("2d")]);
|
|
7026
7139
|
if (!ctx || typeof ctx.measureText !== "function") return null;
|
|
7027
7140
|
const fallback = _nullishCoalesce(options.fallbackFamily, () => ( "sans-serif"));
|
|
7028
7141
|
const available = /* @__PURE__ */ new Map();
|
|
@@ -7095,10 +7208,10 @@ function createOutlineTextShaper(fonts, options = {}) {
|
|
|
7095
7208
|
const entries = fonts.map((f) => {
|
|
7096
7209
|
const e = "face" in f ? f : { face: f };
|
|
7097
7210
|
const names = e.face.names;
|
|
7098
|
-
const family = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(e.family, () => ( _optionalChain([names, 'optionalAccess',
|
|
7099
|
-
const weight = _nullishCoalesce(_nullishCoalesce(e.weight, () => ( _optionalChain([e, 'access',
|
|
7100
|
-
const italic = _nullishCoalesce(e.italic, () => ( Boolean((_nullishCoalesce(_optionalChain([e, 'access',
|
|
7101
|
-
const postScript = _nullishCoalesce(_optionalChain([names, 'optionalAccess',
|
|
7211
|
+
const family = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(e.family, () => ( _optionalChain([names, 'optionalAccess', _216 => _216.fontFamily, 'optionalAccess', _217 => _217.en]))), () => ( Object.values(_nullishCoalesce(_optionalChain([names, 'optionalAccess', _218 => _218.fontFamily]), () => ( {})))[0])), () => ( "Font"));
|
|
7212
|
+
const weight = _nullishCoalesce(_nullishCoalesce(e.weight, () => ( _optionalChain([e, 'access', _219 => _219.face, 'access', _220 => _220.tables, 'optionalAccess', _221 => _221.os2, 'optionalAccess', _222 => _222.usWeightClass]))), () => ( 400));
|
|
7213
|
+
const italic = _nullishCoalesce(e.italic, () => ( Boolean((_nullishCoalesce(_optionalChain([e, 'access', _223 => _223.face, 'access', _224 => _224.tables, 'optionalAccess', _225 => _225.os2, 'optionalAccess', _226 => _226.fsSelection]), () => ( 0))) & 1)));
|
|
7214
|
+
const postScript = _nullishCoalesce(_optionalChain([names, 'optionalAccess', _227 => _227.postScriptName, 'optionalAccess', _228 => _228.en]), () => ( Object.values(_nullishCoalesce(_optionalChain([names, 'optionalAccess', _229 => _229.postScriptName]), () => ( {})))[0]));
|
|
7102
7215
|
return { face: e.face, family, key: family.toLowerCase(), weight, italic, postScript };
|
|
7103
7216
|
});
|
|
7104
7217
|
const fallbackKey = (_nullishCoalesce(options.fallback, () => ( entries[0].family))).toLowerCase();
|
|
@@ -7145,12 +7258,12 @@ function createOutlineTextShaper(fonts, options = {}) {
|
|
|
7145
7258
|
return out;
|
|
7146
7259
|
},
|
|
7147
7260
|
outline(text, font, x, y, opts) {
|
|
7148
|
-
return toPath(pick(font).entry.face.getPath(text, x, y, font.size, _optionalChain([opts, 'optionalAccess',
|
|
7261
|
+
return toPath(pick(font).entry.face.getPath(text, x, y, font.size, _optionalChain([opts, 'optionalAccess', _230 => _230.vertical]) ? { kerning: true, vertical: true } : { kerning: true }).commands);
|
|
7149
7262
|
},
|
|
7150
7263
|
vertical(char, font) {
|
|
7151
7264
|
const { face } = pick(font).entry;
|
|
7152
7265
|
const k = font.size / face.unitsPerEm;
|
|
7153
|
-
const v2 = _optionalChain([face, 'access',
|
|
7266
|
+
const v2 = _optionalChain([face, 'access', _231 => _231.getVerticalMetrics, 'optionalCall', _232 => _232(char)]);
|
|
7154
7267
|
if (v2) return { advance: v2.advance * k, originY: v2.originY * k, alternate: v2.alternate };
|
|
7155
7268
|
return { advance: (face.ascender - face.descender) * k, originY: face.ascender * k, alternate: false };
|
|
7156
7269
|
},
|
|
@@ -7211,7 +7324,7 @@ function vectorTextHasOutlines() {
|
|
|
7211
7324
|
return typeof getVectorTextShaper().outline === "function";
|
|
7212
7325
|
}
|
|
7213
7326
|
function vectorTextFamilies() {
|
|
7214
|
-
return _nullishCoalesce(_optionalChain([getVectorTextShaper, 'call',
|
|
7327
|
+
return _nullishCoalesce(_optionalChain([getVectorTextShaper, 'call', _233 => _233(), 'access', _234 => _234.families, 'optionalCall', _235 => _235()]), () => ( ["sans-serif", "serif", "monospace"]));
|
|
7215
7328
|
}
|
|
7216
7329
|
var DEFAULT_VECTOR_FONT = { fontFamily: "sans-serif", fontWeight: 400, fontSize: 24 };
|
|
7217
7330
|
var VECTOR_CHARACTER_STYLE_KEYS = ["fontFamily", "fontWeight", "italic", "fontSize", "tracking", "leading", "baselineShift", "underline", "strikethrough", "upright"];
|
|
@@ -7387,7 +7500,7 @@ function computeLayout2(node, shaper) {
|
|
|
7387
7500
|
const fragments = [];
|
|
7388
7501
|
const lines = [];
|
|
7389
7502
|
let overflow = false;
|
|
7390
|
-
const fillOf = (f) => _optionalChain([runs, 'access',
|
|
7503
|
+
const fillOf = (f) => _optionalChain([runs, 'access', _236 => _236.find, 'call', _237 => _237((r) => f.start >= r.start && f.start < r.end), 'optionalAccess', _238 => _238.fill]);
|
|
7391
7504
|
const styleOf = (f) => {
|
|
7392
7505
|
const { color: _c, opacity: _o, postScriptName: _p, ...style } = f.style;
|
|
7393
7506
|
return style;
|
|
@@ -7426,11 +7539,11 @@ function computeLayout2(node, shaper) {
|
|
|
7426
7539
|
} else {
|
|
7427
7540
|
const line = text.lines[0];
|
|
7428
7541
|
const measure = measureVectorPath(subpathPath(frame.path), !!frame.flip);
|
|
7429
|
-
const align = _nullishCoalesce(_optionalChain([node, 'access',
|
|
7542
|
+
const align = _nullishCoalesce(_optionalChain([node, 'access', _239 => _239.paragraph, 'optionalAccess', _240 => _240.align]), () => ( "left"));
|
|
7430
7543
|
const start = Math.max(0, _nullishCoalesce(frame.start, () => ( 0)));
|
|
7431
7544
|
const end = Math.max(0, _nullishCoalesce(frame.end, () => ( 0)));
|
|
7432
7545
|
const upright = frame.orientation === "upright";
|
|
7433
|
-
const baselineOffset = pathBaselineOffset(_nullishCoalesce(frame.baseline, () => ( "baseline")), _nullishCoalesce(_optionalChain([line, 'optionalAccess',
|
|
7546
|
+
const baselineOffset = pathBaselineOffset(_nullishCoalesce(frame.baseline, () => ( "baseline")), _nullishCoalesce(_optionalChain([line, 'optionalAccess', _241 => _241.ascent]), () => ( 0)), _nullishCoalesce(_optionalChain([line, 'optionalAccess', _242 => _242.descent]), () => ( 0)));
|
|
7434
7547
|
if (line) {
|
|
7435
7548
|
const chars = line.chars.filter((c) => {
|
|
7436
7549
|
const lo = block.text.charCodeAt(c.index);
|
|
@@ -7439,7 +7552,7 @@ function computeLayout2(node, shaper) {
|
|
|
7439
7552
|
const advanceOf = (c) => {
|
|
7440
7553
|
const pair = charAt(block.text, c.index).length === 2;
|
|
7441
7554
|
const low = pair ? line.chars.find((d) => d.index === c.index + 1) : void 0;
|
|
7442
|
-
return c.advance + (_nullishCoalesce(_optionalChain([low, 'optionalAccess',
|
|
7555
|
+
return c.advance + (_nullishCoalesce(_optionalChain([low, 'optionalAccess', _243 => _243.advance]), () => ( 0)));
|
|
7443
7556
|
};
|
|
7444
7557
|
const pivots = chars.map((c) => c.x + advanceOf(c) / 2);
|
|
7445
7558
|
const positions = vectorPathTextPositions(pivots, [line.x, line.x + line.width], align, measure.length, start, end);
|
|
@@ -7494,7 +7607,7 @@ function computeLayout2(node, shaper) {
|
|
|
7494
7607
|
if (x0 < Infinity) bounds = { x: x0, y: y0, width: x1 - x0, height: y1 - y0 };
|
|
7495
7608
|
else if (frame.kind === "point") {
|
|
7496
7609
|
const l = text.lines[0];
|
|
7497
|
-
bounds = { x: frame.x, y: frame.y - (_nullishCoalesce(_optionalChain([l, 'optionalAccess',
|
|
7610
|
+
bounds = { x: frame.x, y: frame.y - (_nullishCoalesce(_optionalChain([l, 'optionalAccess', _244 => _244.ascent]), () => ( 0))), width: 0, height: (_nullishCoalesce(_optionalChain([l, 'optionalAccess', _245 => _245.ascent]), () => ( 0))) + (_nullishCoalesce(_optionalChain([l, 'optionalAccess', _246 => _246.descent]), () => ( 0))) };
|
|
7498
7611
|
}
|
|
7499
7612
|
}
|
|
7500
7613
|
return { shaper: shaper.id, glyphs, fragments, lines, origin, text, bounds, overflow, missingFonts: text.missingFonts };
|
|
@@ -7615,7 +7728,7 @@ function vectorTextCaret(node, index) {
|
|
|
7615
7728
|
const t = { x: Math.cos(r), y: Math.sin(r) };
|
|
7616
7729
|
const n2 = { x: -t.y, y: t.x };
|
|
7617
7730
|
const o = { x: g2.x + t.x * u, y: g2.y + t.y * u };
|
|
7618
|
-
return { top: { x: o.x - n2.x * g2.ascent, y: o.y - n2.y * g2.ascent }, bottom: { x: o.x + n2.x * g2.descent, y: o.y + n2.y * g2.descent }, line: _nullishCoalesce(_optionalChain([layout, 'access',
|
|
7731
|
+
return { top: { x: o.x - n2.x * g2.ascent, y: o.y - n2.y * g2.ascent }, bottom: { x: o.x + n2.x * g2.descent, y: o.y + n2.y * g2.descent }, line: _nullishCoalesce(_optionalChain([layout, 'access', _247 => _247.fragments, 'access', _248 => _248[g2.fragment], 'optionalAccess', _249 => _249.line]), () => ( 0)) };
|
|
7619
7732
|
};
|
|
7620
7733
|
if (node.frame.kind !== "path") {
|
|
7621
7734
|
const c = caretAt(layout.text, index);
|
|
@@ -7755,7 +7868,7 @@ function sanitizeVectorTextFrame(value, path = "frame") {
|
|
|
7755
7868
|
return { kind: "area", x: num2(f.x, `${path}.x`, -1e7, 1e7), y: num2(f.y, `${path}.y`, -1e7, 1e7), width: num2(f.width, `${path}.width`, 0, 1e7), height: num2(f.height, `${path}.height`, 0, 1e7) };
|
|
7756
7869
|
if (f.kind === "path") {
|
|
7757
7870
|
const sp = f.path;
|
|
7758
|
-
if (!sp || !Array.isArray(sp.anchors) || sp.anchors.length < 2 || !sp.anchors.every((a) => isNum(_optionalChain([a, 'optionalAccess',
|
|
7871
|
+
if (!sp || !Array.isArray(sp.anchors) || sp.anchors.length < 2 || !sp.anchors.every((a) => isNum(_optionalChain([a, 'optionalAccess', _250 => _250.x])) && isNum(_optionalChain([a, 'optionalAccess', _251 => _251.y])))) fail(`${path}.path must be a subpath with at least two anchors.`);
|
|
7759
7872
|
const out = { kind: "path", path: { closed: !!sp.closed, anchors: sp.anchors.map((a) => ({ ...a })) } };
|
|
7760
7873
|
if (f.start !== void 0 && f.start !== 0) out.start = num2(f.start, `${path}.start`, 0, 1e7);
|
|
7761
7874
|
if (f.end !== void 0 && f.end !== 0) out.end = num2(f.end, `${path}.end`, 0, 1e7);
|
|
@@ -7773,7 +7886,7 @@ function sanitizeVectorTextFrame(value, path = "frame") {
|
|
|
7773
7886
|
return fail(`${path}.kind must be point, area or path, got ${JSON.stringify(f.kind)}.`);
|
|
7774
7887
|
}
|
|
7775
7888
|
function normalizeVectorTextRuns(text, runs) {
|
|
7776
|
-
if (!_optionalChain([runs, 'optionalAccess',
|
|
7889
|
+
if (!_optionalChain([runs, 'optionalAccess', _252 => _252.length])) return null;
|
|
7777
7890
|
const cleaned = fitVectorTextRuns(
|
|
7778
7891
|
runs.map((r) => ({ length: r.length, style: stripUndefined(r.style) })),
|
|
7779
7892
|
text.length
|
|
@@ -7813,7 +7926,7 @@ function replaceVectorText(node, start, end, insert) {
|
|
|
7813
7926
|
const clean2 = insert.replace(/\r\n?/g, "\n");
|
|
7814
7927
|
const text = node.text.slice(0, start) + clean2 + node.text.slice(end);
|
|
7815
7928
|
let runs = null;
|
|
7816
|
-
if (_optionalChain([node, 'access',
|
|
7929
|
+
if (_optionalChain([node, 'access', _253 => _253.runs, 'optionalAccess', _254 => _254.length])) {
|
|
7817
7930
|
const fitted = fitVectorTextRuns(node.runs, node.text.length);
|
|
7818
7931
|
const style = styleAt(fitted, start > 0 ? start - 1 : start, {});
|
|
7819
7932
|
runs = normalizeVectorTextRuns(text, spliceRuns(fitted, start, end, clean2.length, style));
|
|
@@ -7829,7 +7942,7 @@ function styleVectorText(node, start, end, patch) {
|
|
|
7829
7942
|
if (whole) {
|
|
7830
7943
|
let next2 = { ...node, font: patchVectorCharacterStyle(node.font, fields, "style") };
|
|
7831
7944
|
const keys = Object.keys(fields).filter((k) => fields[k] !== void 0);
|
|
7832
|
-
if (_optionalChain([next2, 'access',
|
|
7945
|
+
if (_optionalChain([next2, 'access', _255 => _255.runs, 'optionalAccess', _256 => _256.length]) && (keys.length || fill !== void 0)) {
|
|
7833
7946
|
const runs2 = normalizeVectorTextRuns(
|
|
7834
7947
|
next2.text,
|
|
7835
7948
|
next2.runs.map((r) => {
|
|
@@ -7874,7 +7987,7 @@ function bakeVectorTextGeometry(node, m) {
|
|
|
7874
7987
|
...s.baselineShift !== void 0 ? { baselineShift: s.baselineShift * k } : {}
|
|
7875
7988
|
});
|
|
7876
7989
|
const font = scaleStyle(node.font);
|
|
7877
|
-
const runs = _optionalChain([node, 'access',
|
|
7990
|
+
const runs = _optionalChain([node, 'access', _257 => _257.runs, 'optionalAccess', _258 => _258.map, 'call', _259 => _259((r) => ({ length: r.length, style: scaleStyle(r.style) }))]);
|
|
7878
7991
|
const p = node.paragraph;
|
|
7879
7992
|
const paragraph = p ? {
|
|
7880
7993
|
...p,
|
|
@@ -8163,7 +8276,7 @@ function vectorInstanceGroup(node, bake) {
|
|
|
8163
8276
|
const m = _nullishCoalesce(node.transform, () => ( [1, 0, 0, 1, 0, 0]));
|
|
8164
8277
|
const { rigid, residual } = decomposeRigid(m);
|
|
8165
8278
|
const k = Math.sqrt(Math.abs(residual[0] * residual[3] - residual[1] * residual[2]));
|
|
8166
|
-
const hidden = new Set(_nullishCoalesce(_optionalChain([node, 'access',
|
|
8279
|
+
const hidden = new Set(_nullishCoalesce(_optionalChain([node, 'access', _260 => _260.overrides, 'optionalAccess', _261 => _261.hidden]), () => ( [])));
|
|
8167
8280
|
const keep = (list) => list.filter((n) => !hidden.has(n.id)).map((n) => n.type === "group" ? { ...n, children: keep(n.children) } : n);
|
|
8168
8281
|
let children = prefixVectorIds(keep(_nullishCoalesce(node.art, () => ( []))), node.id);
|
|
8169
8282
|
if (!isIdentityMatrix(residual)) children = children.map((c) => bake(c, residual));
|
|
@@ -8176,8 +8289,8 @@ function vectorInstanceGroup(node, bake) {
|
|
|
8176
8289
|
if (node.locked) group.locked = true;
|
|
8177
8290
|
if (node.opacity !== void 0) group.opacity = node.opacity;
|
|
8178
8291
|
if (node.blendMode) group.blendMode = node.blendMode;
|
|
8179
|
-
if (_optionalChain([node, 'access',
|
|
8180
|
-
if (_optionalChain([node, 'access',
|
|
8292
|
+
if (_optionalChain([node, 'access', _262 => _262.filters, 'optionalAccess', _263 => _263.length])) group.filters = node.filters;
|
|
8293
|
+
if (_optionalChain([node, 'access', _264 => _264.effects, 'optionalAccess', _265 => _265.length])) group.effects = node.effects;
|
|
8181
8294
|
if (node.booleanOperation) group.booleanOperation = node.booleanOperation;
|
|
8182
8295
|
if (node.blendStep) group.blendStep = true;
|
|
8183
8296
|
return group;
|
|
@@ -8430,8 +8543,8 @@ function vectorLensDrawn(node) {
|
|
|
8430
8543
|
if (wire) {
|
|
8431
8544
|
contents.push(shapePath(shape, id, changed, { fill: null, fills: void 0, stroke: wire, strokes: void 0, strokeWidth: 1, strokeAlign: void 0, strokeDasharray: void 0, strokeWidthProfile: void 0, opacity: Math.min(1, Math.max(0, lens.amount / 100)) }));
|
|
8432
8545
|
} else if (recolour) {
|
|
8433
|
-
const fills = _optionalChain([shape, 'access',
|
|
8434
|
-
const strokes = _optionalChain([shape, 'access',
|
|
8546
|
+
const fills = _optionalChain([shape, 'access', _266 => _266.source, 'access', _267 => _267.fills, 'optionalAccess', _268 => _268.map, 'call', _269 => _269((l) => ({ ...l, paint: _nullishCoalesce(mapVectorPaintColors(l.paint, recolour), () => ( null)) }))]);
|
|
8547
|
+
const strokes = _optionalChain([shape, 'access', _270 => _270.source, 'access', _271 => _271.strokes, 'optionalAccess', _272 => _272.map, 'call', _273 => _273((l) => ({ ...l, paint: _nullishCoalesce(mapVectorPaintColors(l.paint, recolour), () => ( null)) }))]);
|
|
8435
8548
|
contents.push(shapePath(shape, id, changed, { fill: _nullishCoalesce(mapVectorPaintColors(shape.source.fill, recolour), () => ( null)), stroke: _nullishCoalesce(mapVectorPaintColors(shape.source.stroke, recolour), () => ( null)), ...fills ? { fills } : {}, ...strokes ? { strokes } : {} }));
|
|
8436
8549
|
} else contents.push(shapePath(shape, id, changed));
|
|
8437
8550
|
}
|
|
@@ -8444,7 +8557,7 @@ function vectorLensDrawn(node) {
|
|
|
8444
8557
|
const { lens: _l, lensView: _v, transform: _t, opacity: _o, effects: _e, blendMode: _bm, filters: _f, ...style } = node;
|
|
8445
8558
|
const fillOpacity = lens.type === "transparency" ? 1 - Math.min(100, Math.max(0, lens.amount)) / 100 : 0;
|
|
8446
8559
|
children.push({ ...style, id: `${node.id}~lens-fill`, stroke: null, strokes: void 0, opacity: fillOpacity });
|
|
8447
|
-
const stroked = (_nullishCoalesce(_optionalChain([node, 'access',
|
|
8560
|
+
const stroked = (_nullishCoalesce(_optionalChain([node, 'access', _274 => _274.strokes, 'optionalAccess', _275 => _275.length]), () => ( 0))) > 0 || node.stroke != null && node.stroke !== "none";
|
|
8448
8561
|
if (stroked) children.push({ ...style, id: `${node.id}~lens-stroke`, fill: null, fills: void 0 });
|
|
8449
8562
|
const out = {
|
|
8450
8563
|
id: node.id,
|
|
@@ -8453,7 +8566,7 @@ function vectorLensDrawn(node) {
|
|
|
8453
8566
|
...node.transform ? { transform: node.transform } : {},
|
|
8454
8567
|
...node.opacity !== void 0 ? { opacity: node.opacity } : {},
|
|
8455
8568
|
...node.blendMode ? { blendMode: node.blendMode } : {},
|
|
8456
|
-
..._optionalChain([node, 'access',
|
|
8569
|
+
..._optionalChain([node, 'access', _276 => _276.filters, 'optionalAccess', _277 => _277.length]) ? { filters: node.filters } : {},
|
|
8457
8570
|
children
|
|
8458
8571
|
};
|
|
8459
8572
|
drawnCache2.set(node, out);
|
|
@@ -9454,7 +9567,7 @@ function normalizeVectorEffectParams(type, params, base) {
|
|
|
9454
9567
|
if (!defaults) return null;
|
|
9455
9568
|
const out = { ...defaults, ..._nullishCoalesce(base, () => ( {})) };
|
|
9456
9569
|
for (const spec of VECTOR_EFFECT_PARAM_SPECS[type]) {
|
|
9457
|
-
const v2 = _optionalChain([params, 'optionalAccess',
|
|
9570
|
+
const v2 = _optionalChain([params, 'optionalAccess', _278 => _278[spec.key]]);
|
|
9458
9571
|
if (v2 === void 0) continue;
|
|
9459
9572
|
if (spec.kind === "number" && typeof v2 === "number" && Number.isFinite(v2)) out[spec.key] = Math.min(_nullishCoalesce(spec.max, () => ( Infinity)), Math.max(_nullishCoalesce(spec.min, () => ( -Infinity)), v2));
|
|
9460
9573
|
else if (spec.kind === "boolean" && typeof v2 === "boolean") out[spec.key] = v2;
|
|
@@ -9466,7 +9579,7 @@ function normalizeVectorEffectParams(type, params, base) {
|
|
|
9466
9579
|
const o = out;
|
|
9467
9580
|
o.rows = Math.round(o.rows);
|
|
9468
9581
|
o.columns = Math.round(o.columns);
|
|
9469
|
-
const given = _optionalChain([params, 'optionalAccess',
|
|
9582
|
+
const given = _optionalChain([params, 'optionalAccess', _279 => _279.mesh]);
|
|
9470
9583
|
let mesh = given !== void 0 ? isValidWarpMesh(given) ? cloneMesh(given) : null : o.mesh;
|
|
9471
9584
|
if (o.style !== "mesh") mesh = null;
|
|
9472
9585
|
if (mesh && given !== void 0) {
|
|
@@ -9483,10 +9596,10 @@ function createVectorEffect(type, id, params) {
|
|
|
9483
9596
|
}
|
|
9484
9597
|
var isEnabled = (e) => e.enabled !== false && !!VECTOR_EFFECT_DEFAULTS[e.type];
|
|
9485
9598
|
function activeVectorEffects(node) {
|
|
9486
|
-
return _nullishCoalesce(_optionalChain([node, 'access',
|
|
9599
|
+
return _nullishCoalesce(_optionalChain([node, 'access', _280 => _280.effects, 'optionalAccess', _281 => _281.filter, 'call', _282 => _282(isEnabled)]), () => ( []));
|
|
9487
9600
|
}
|
|
9488
9601
|
function hasOwnVectorAppearance(node) {
|
|
9489
|
-
return node.type === "text" || node.type === "instance" || node.type === "group" && !!node.liveBoolean || isVectorFrame(node) || isVectorSymmetryGroup(node) || isVectorLens(node) || !!_optionalChain([node, 'access',
|
|
9602
|
+
return node.type === "text" || node.type === "instance" || node.type === "group" && !!node.liveBoolean || isVectorFrame(node) || isVectorSymmetryGroup(node) || isVectorLens(node) || !!_optionalChain([node, 'access', _283 => _283.effects, 'optionalAccess', _284 => _284.some, 'call', _285 => _285(isEnabled)]);
|
|
9490
9603
|
}
|
|
9491
9604
|
var liveCache = /* @__PURE__ */ new WeakMap();
|
|
9492
9605
|
function hasVectorAppearance(node) {
|
|
@@ -9498,7 +9611,7 @@ function hasVectorAppearance(node) {
|
|
|
9498
9611
|
return v2;
|
|
9499
9612
|
}
|
|
9500
9613
|
function isVectorLiveBoolean(node) {
|
|
9501
|
-
return _optionalChain([node, 'optionalAccess',
|
|
9614
|
+
return _optionalChain([node, 'optionalAccess', _286 => _286.type]) === "group" && !!node.liveBoolean;
|
|
9502
9615
|
}
|
|
9503
9616
|
function vectorOperandOperation(group, child) {
|
|
9504
9617
|
return _nullishCoalesce(_nullishCoalesce(child.booleanOperation, () => ( group.liveBoolean)), () => ( "union"));
|
|
@@ -9615,7 +9728,7 @@ var compareOrder = (a, b) => {
|
|
|
9615
9728
|
for (let i = 0; i < n; i++) if (a[i] !== b[i]) return a[i] - b[i];
|
|
9616
9729
|
return a.length - b.length;
|
|
9617
9730
|
};
|
|
9618
|
-
var add3 = (a, b) => ({ x: a.x + (_nullishCoalesce(_optionalChain([b, 'optionalAccess',
|
|
9731
|
+
var add3 = (a, b) => ({ x: a.x + (_nullishCoalesce(_optionalChain([b, 'optionalAccess', _287 => _287.x]), () => ( 0))), y: a.y + (_nullishCoalesce(_optionalChain([b, 'optionalAccess', _288 => _288.y]), () => ( 0))) });
|
|
9619
9732
|
var mapPaths = (shapes, fn) => {
|
|
9620
9733
|
const out = fn(shapes.map((s) => s.path));
|
|
9621
9734
|
return shapes.map((s, i) => ({ ...s, path: _nullishCoalesce(out[i], () => ( [])) }));
|
|
@@ -9643,7 +9756,7 @@ function contourShapes(shapes, c) {
|
|
|
9643
9756
|
const power = 2 ** (Math.min(100, Math.max(-100, c.acceleration)) / 50);
|
|
9644
9757
|
for (let k = 1; k <= n; k++) {
|
|
9645
9758
|
const [path] = offsetPaths([s.path], (outside ? 1 : -1) * step * k, c.join, c.miterLimit, 1, 0);
|
|
9646
|
-
if (!_optionalChain([path, 'optionalAccess',
|
|
9759
|
+
if (!_optionalChain([path, 'optionalAccess', _289 => _289.length])) break;
|
|
9647
9760
|
const t = (k / n) ** power;
|
|
9648
9761
|
const source = { ...s.source, fill: _nullishCoalesce(blendPaint(s.source.fill, c.fillColor, t), () => ( null)), stroke: _nullishCoalesce(blendPaint(s.source.stroke, c.strokeColor, t), () => ( null)), fills: void 0, strokes: void 0 };
|
|
9649
9762
|
out.push({ source, path, opacity: s.opacity, order: [outside ? n - k : k, ...s.order] });
|
|
@@ -9718,8 +9831,8 @@ function bevelShapes(shapes, b) {
|
|
|
9718
9831
|
out.push({ source, path: f.path, opacity: s.opacity, order: [...s.order, 1, k] });
|
|
9719
9832
|
});
|
|
9720
9833
|
const [middle] = offsetPaths([s.path], -b.width, "miter", 4, 1, 0);
|
|
9721
|
-
if (_optionalChain([middle, 'optionalAccess',
|
|
9722
|
-
const hasStroke = _optionalChain([s, 'access',
|
|
9834
|
+
if (_optionalChain([middle, 'optionalAccess', _290 => _290.length])) out.push({ ...s, source: fillOnly, path: middle, order: [...s.order, 2] });
|
|
9835
|
+
const hasStroke = _optionalChain([s, 'access', _291 => _291.source, 'access', _292 => _292.strokes, 'optionalAccess', _293 => _293.length]) || s.source.stroke != null && s.source.stroke !== "none";
|
|
9723
9836
|
if (hasStroke) out.push({ ...s, source: { ...s.source, fill: null, fills: void 0 }, order: [...s.order, 3] });
|
|
9724
9837
|
}
|
|
9725
9838
|
return out;
|
|
@@ -9852,10 +9965,10 @@ function vectorEffectInputBounds(node, effectId) {
|
|
|
9852
9965
|
return paths ? pathsBounds(paths) : null;
|
|
9853
9966
|
}
|
|
9854
9967
|
function vectorNodeEnvelope(node) {
|
|
9855
|
-
return _nullishCoalesce(_optionalChain([node, 'optionalAccess',
|
|
9968
|
+
return _nullishCoalesce(_optionalChain([node, 'optionalAccess', _294 => _294.effects, 'optionalAccess', _295 => _295.find, 'call', _296 => _296((e) => e.type === "envelope" && e.enabled !== false)]), () => ( null));
|
|
9856
9969
|
}
|
|
9857
9970
|
function vectorEnvelopeFrame(node, effectId) {
|
|
9858
|
-
const e = effectId ? _optionalChain([node, 'access',
|
|
9971
|
+
const e = effectId ? _optionalChain([node, 'access', _297 => _297.effects, 'optionalAccess', _298 => _298.find, 'call', _299 => _299((x) => x.id === effectId)]) : vectorNodeEnvelope(node);
|
|
9859
9972
|
if (!e || e.type !== "envelope") return null;
|
|
9860
9973
|
const bounds = vectorEffectInputBounds(node, e.id);
|
|
9861
9974
|
if (!bounds || !(bounds.width > 0 && bounds.height > 0)) return null;
|
|
@@ -9916,7 +10029,7 @@ function placement(node) {
|
|
|
9916
10029
|
...node.blendStep ? { blendStep: true } : {},
|
|
9917
10030
|
...node.booleanOperation ? { booleanOperation: node.booleanOperation } : {},
|
|
9918
10031
|
...node.blendMode ? { blendMode: node.blendMode } : {},
|
|
9919
|
-
..._optionalChain([node, 'access',
|
|
10032
|
+
..._optionalChain([node, 'access', _300 => _300.filters, 'optionalAccess', _301 => _301.length]) ? { filters: node.filters } : {}
|
|
9920
10033
|
};
|
|
9921
10034
|
}
|
|
9922
10035
|
function vectorAppearanceNodes(node) {
|
|
@@ -10048,7 +10161,7 @@ function vectorMasterPages(doc) {
|
|
|
10048
10161
|
function fillTokens(node, page, pages) {
|
|
10049
10162
|
const map = (s) => s.replace(/\{page\}/g, String(page)).replace(/\{pages\}/g, String(pages));
|
|
10050
10163
|
if (!/\{pages?\}/.test(node.text)) return node;
|
|
10051
|
-
if (!_optionalChain([node, 'access',
|
|
10164
|
+
if (!_optionalChain([node, 'access', _302 => _302.runs, 'optionalAccess', _303 => _303.length])) return { ...node, text: map(node.text) };
|
|
10052
10165
|
let at2 = 0;
|
|
10053
10166
|
let text = "";
|
|
10054
10167
|
const runs = [];
|
|
@@ -10071,7 +10184,7 @@ function vectorMasterArt(master, page, number, count) {
|
|
|
10071
10184
|
const f = page.frame;
|
|
10072
10185
|
const key = `${page.id}|${f.x}|${f.y}|${f.width}|${f.height}|${number}|${count}`;
|
|
10073
10186
|
let byKey = artCache.get(master);
|
|
10074
|
-
const hit = _optionalChain([byKey, 'optionalAccess',
|
|
10187
|
+
const hit = _optionalChain([byKey, 'optionalAccess', _304 => _304.get, 'call', _305 => _305(key)]);
|
|
10075
10188
|
if (hit) return hit;
|
|
10076
10189
|
const art = master.children.filter((c) => c.visible !== false).map((c) => {
|
|
10077
10190
|
const box = vectorNodeBounds(c);
|
|
@@ -10116,7 +10229,7 @@ function stripVectorMasterArt(doc) {
|
|
|
10116
10229
|
// src/vector/connectors.ts
|
|
10117
10230
|
var SIDES = ["top", "right", "bottom", "left", "center"];
|
|
10118
10231
|
function isVectorConnector(node) {
|
|
10119
|
-
return _optionalChain([node, 'optionalAccess',
|
|
10232
|
+
return _optionalChain([node, 'optionalAccess', _306 => _306.type]) === "path" && !!node.connector;
|
|
10120
10233
|
}
|
|
10121
10234
|
function vectorConnectionSites(nodes, id) {
|
|
10122
10235
|
const node = findVectorNode(nodes, id);
|
|
@@ -10173,7 +10286,7 @@ function facingSite(sites, toward) {
|
|
|
10173
10286
|
}
|
|
10174
10287
|
function storedEnds(node, world) {
|
|
10175
10288
|
const sp = node.subpaths[0];
|
|
10176
|
-
if (!_optionalChain([sp, 'optionalAccess',
|
|
10289
|
+
if (!_optionalChain([sp, 'optionalAccess', _307 => _307.anchors, 'access', _308 => _308.length])) return null;
|
|
10177
10290
|
const a = sp.anchors[0];
|
|
10178
10291
|
const b = sp.anchors[sp.anchors.length - 1];
|
|
10179
10292
|
return [applyMatrix(world, a), applyMatrix(world, b)];
|
|
@@ -10280,8 +10393,8 @@ function routeVectorConnector(nodes, id) {
|
|
|
10280
10393
|
}));
|
|
10281
10394
|
return {
|
|
10282
10395
|
subpaths: [{ closed: false, anchors: local }],
|
|
10283
|
-
startSide: _nullishCoalesce(_optionalChain([s, 'optionalAccess',
|
|
10284
|
-
endSide: _nullishCoalesce(_optionalChain([e, 'optionalAccess',
|
|
10396
|
+
startSide: _nullishCoalesce(_optionalChain([s, 'optionalAccess', _309 => _309.side]), () => ( null)),
|
|
10397
|
+
endSide: _nullishCoalesce(_optionalChain([e, 'optionalAccess', _310 => _310.side]), () => ( null)),
|
|
10285
10398
|
dropped: { start: !!startGlue && !s, end: !!endGlue && !e }
|
|
10286
10399
|
};
|
|
10287
10400
|
}
|
|
@@ -10293,7 +10406,7 @@ function sameSubpaths(a, b) {
|
|
|
10293
10406
|
const o = b[i];
|
|
10294
10407
|
return sp.closed === o.closed && sp.anchors.length === o.anchors.length && sp.anchors.every((p, k) => {
|
|
10295
10408
|
const q = o.anchors[k];
|
|
10296
|
-
return samePoint(p, q) && samePoint(p.in, q.in) && samePoint(p.out, q.out) && (_nullishCoalesce(_optionalChain([p, 'access',
|
|
10409
|
+
return samePoint(p, q) && samePoint(p.in, q.in) && samePoint(p.out, q.out) && (_nullishCoalesce(_optionalChain([p, 'access', _311 => _311.corner, 'optionalAccess', _312 => _312.radius]), () => ( 0))) === (_nullishCoalesce(_optionalChain([q, 'access', _313 => _313.corner, 'optionalAccess', _314 => _314.radius]), () => ( 0)));
|
|
10297
10410
|
});
|
|
10298
10411
|
});
|
|
10299
10412
|
}
|
|
@@ -10572,7 +10685,7 @@ function applyVectorCornersAttribute(subpaths, value) {
|
|
|
10572
10685
|
for (const item of value.trim().split(/\s+/)) {
|
|
10573
10686
|
const m = /^(\d+)\.(\d+):([\d.eE+-]+)(?::([a-z]+))?$/.exec(item);
|
|
10574
10687
|
if (!m) continue;
|
|
10575
|
-
const a = _optionalChain([subpaths, 'access',
|
|
10688
|
+
const a = _optionalChain([subpaths, 'access', _315 => _315[+m[1]], 'optionalAccess', _316 => _316.anchors, 'access', _317 => _317[+m[2]]]);
|
|
10576
10689
|
const radius = parseFloat(m[3]);
|
|
10577
10690
|
if (!a || !(radius > 0)) continue;
|
|
10578
10691
|
const kind = VECTOR_CORNER_KINDS.includes(m[4]) ? m[4] : void 0;
|
|
@@ -10597,7 +10710,7 @@ function vectorPaintToSvg(paint, gradientId, options = {}) {
|
|
|
10597
10710
|
const area2 = bounds2 ? { x: bounds2.x - reach2, y: bounds2.y - reach2, width: bounds2.width + 2 * reach2, height: bounds2.height + 2 * reach2 } : null;
|
|
10598
10711
|
const key2 = `${gradientId}|${_nullishCoalesce(options.role, () => ( "fill"))}|${_nullishCoalesce(options.precision, () => ( 3))}|${area2 ? [area2.x, area2.y, area2.width, area2.height].join(",") : ""}`;
|
|
10599
10712
|
let byKey2 = paintCache.get(paint);
|
|
10600
|
-
const hit = _optionalChain([byKey2, 'optionalAccess',
|
|
10713
|
+
const hit = _optionalChain([byKey2, 'optionalAccess', _318 => _318.get, 'call', _319 => _319(key2)]);
|
|
10601
10714
|
if (hit) return { value: `url(#${gradientId})`, defs: hit };
|
|
10602
10715
|
const defs2 = vectorShadedSvgDefs(paint, gradientId, { bounds: bounds2, area: area2, precision: _nullishCoalesce(options.precision, () => ( 3)) });
|
|
10603
10716
|
if (!byKey2) paintCache.set(paint, byKey2 = /* @__PURE__ */ new Map());
|
|
@@ -10609,7 +10722,7 @@ function vectorPaintToSvg(paint, gradientId, options = {}) {
|
|
|
10609
10722
|
const precision = _nullishCoalesce(options.precision, () => ( 3));
|
|
10610
10723
|
const key = `${gradientId}|${role}|${precision}`;
|
|
10611
10724
|
const owner = _nullishCoalesce(options.node, () => ( paint));
|
|
10612
|
-
const cached = _optionalChain([paintCache, 'access',
|
|
10725
|
+
const cached = _optionalChain([paintCache, 'access', _320 => _320.get, 'call', _321 => _321(owner), 'optionalAccess', _322 => _322.get, 'call', _323 => _323(key)]);
|
|
10613
10726
|
if (cached && (!options.node || (role === "fill" ? options.node.fill : options.node.stroke) === paint)) return { value: `url(#${gradientId})`, defs: cached };
|
|
10614
10727
|
const node = options.node;
|
|
10615
10728
|
const bounds = node ? vectorPathLocalBounds(node) : null;
|
|
@@ -10663,7 +10776,7 @@ function vectorNodeLocalPaintBounds(node) {
|
|
|
10663
10776
|
}
|
|
10664
10777
|
var filterCache = /* @__PURE__ */ new WeakMap();
|
|
10665
10778
|
function vectorNodeFilterSvg(node, id) {
|
|
10666
|
-
if (!_optionalChain([node, 'access',
|
|
10779
|
+
if (!_optionalChain([node, 'access', _324 => _324.filters, 'optionalAccess', _325 => _325.length])) return null;
|
|
10667
10780
|
const hit = filterCache.get(node);
|
|
10668
10781
|
if (hit && hit.id === id) return hit.filter;
|
|
10669
10782
|
const active = activeVectorFilters(node);
|
|
@@ -10749,7 +10862,7 @@ function vectorDocumentToSvg(doc, options = {}) {
|
|
|
10749
10862
|
if (node.type === "path" && node.lens) out2 += ` data-vector-lens="${escapeAttr2(JSON.stringify(node.lens))}"`;
|
|
10750
10863
|
const blend = vectorBlendModeCss(node.blendMode);
|
|
10751
10864
|
if (blend) out2 += ` style="mix-blend-mode:${blend}"`;
|
|
10752
|
-
if (_optionalChain([node, 'access',
|
|
10865
|
+
if (_optionalChain([node, 'access', _326 => _326.filters, 'optionalAccess', _327 => _327.length])) {
|
|
10753
10866
|
const filter = vectorNodeFilterSvg(node, `${prefix}filter-${node.id}`);
|
|
10754
10867
|
const data = ` data-vector-filters="${escapeAttr2(JSON.stringify(node.filters))}"`;
|
|
10755
10868
|
if (filter) {
|
|
@@ -10796,7 +10909,7 @@ function vectorDocumentToSvg(doc, options = {}) {
|
|
|
10796
10909
|
let out2 = ` stroke="${escapeAttr2(strokeValue)}" stroke-width="${num3(width)}"`;
|
|
10797
10910
|
if (node.strokeLinecap && node.strokeLinecap !== "butt") out2 += ` stroke-linecap="${node.strokeLinecap}"`;
|
|
10798
10911
|
if (node.strokeLinejoin && node.strokeLinejoin !== "miter") out2 += ` stroke-linejoin="${node.strokeLinejoin}"`;
|
|
10799
|
-
if (_optionalChain([node, 'access',
|
|
10912
|
+
if (_optionalChain([node, 'access', _328 => _328.strokeDasharray, 'optionalAccess', _329 => _329.length])) out2 += ` stroke-dasharray="${node.strokeDasharray.map(num3).join(" ")}"`;
|
|
10800
10913
|
return out2;
|
|
10801
10914
|
};
|
|
10802
10915
|
const liveCorners = (node) => {
|
|
@@ -10845,7 +10958,7 @@ function vectorDocumentToSvg(doc, options = {}) {
|
|
|
10845
10958
|
};
|
|
10846
10959
|
const emit2 = (node, depth) => {
|
|
10847
10960
|
if (node.visible === false && !options.includeHidden) return;
|
|
10848
|
-
const wrappers = _nullishCoalesce(_optionalChain([options, 'access',
|
|
10961
|
+
const wrappers = _nullishCoalesce(_optionalChain([options, 'access', _330 => _330.wrap, 'optionalAccess', _331 => _331[node.id]]), () => ( []));
|
|
10849
10962
|
wrappers.forEach((w2, i) => {
|
|
10850
10963
|
let attrs = w2.id !== void 0 ? ` id="${escapeAttr2(w2.id)}"` : "";
|
|
10851
10964
|
if (w2.transform) attrs += ` transform="${escapeAttr2(w2.transform)}"`;
|
|
@@ -10866,7 +10979,7 @@ function vectorDocumentToSvg(doc, options = {}) {
|
|
|
10866
10979
|
};
|
|
10867
10980
|
const emitMaskGroup = (node, depth) => {
|
|
10868
10981
|
const [source, ...contents] = node.children;
|
|
10869
|
-
const body = _optionalChain([node, 'access',
|
|
10982
|
+
const body = _optionalChain([node, 'access', _332 => _332.effects, 'optionalAccess', _333 => _333.length]) && contents.length ? [{ id: `${node.id}~content`, type: "group", effects: node.effects, children: contents }] : contents;
|
|
10870
10983
|
const settings = { type: node.mask.type, ...node.mask.invert ? { invert: true } : {} };
|
|
10871
10984
|
lines.push(`${indent(depth)}<g${common(node)} data-vector-mask="${escapeAttr2(JSON.stringify(settings))}">`);
|
|
10872
10985
|
const mask = vectorMaskRenderData(node, `${prefix}mask-${node.id}`, `${prefix}mask-filter-${node.id}`, precision);
|
|
@@ -10883,7 +10996,7 @@ function vectorDocumentToSvg(doc, options = {}) {
|
|
|
10883
10996
|
lines.push(`${indent(depth + 1)}<g data-vector-part="mask-source" display="none">`);
|
|
10884
10997
|
emitNode(source, depth + 2);
|
|
10885
10998
|
lines.push(`${indent(depth + 1)}</g>`);
|
|
10886
|
-
if (_optionalChain([mask, 'optionalAccess',
|
|
10999
|
+
if (_optionalChain([mask, 'optionalAccess', _334 => _334.clip])) {
|
|
10887
11000
|
defs.push(`<clipPath id="${escapeAttr2(mask.id)}">${mask.clip.map((c) => `<path d="${c.d}" clip-rule="${c.clipRule}"/>`).join("")}</clipPath>`);
|
|
10888
11001
|
ref = ` clip-path="url(#${escapeAttr2(mask.id)})"`;
|
|
10889
11002
|
}
|
|
@@ -10895,7 +11008,7 @@ function vectorDocumentToSvg(doc, options = {}) {
|
|
|
10895
11008
|
};
|
|
10896
11009
|
const emitTextElement = (node, depth, attrs) => {
|
|
10897
11010
|
const geometry = vectorTextGeometryNode(node);
|
|
10898
|
-
const fields = { text: node.text, font: node.font, ..._optionalChain([node, 'access',
|
|
11011
|
+
const fields = { text: node.text, font: node.font, ..._optionalChain([node, 'access', _335 => _335.runs, 'optionalAccess', _336 => _336.length]) ? { runs: node.runs } : {}, ...node.paragraph ? { paragraph: node.paragraph } : {}, frame: node.frame, ...node.orientation ? { orientation: node.orientation } : {}, ..._optionalChain([node, 'access', _337 => _337.effects, 'optionalAccess', _338 => _338.length]) ? { effects: node.effects } : {} };
|
|
10899
11012
|
let data = ` data-vector-text="${escapeAttr2(JSON.stringify(fields))}"`;
|
|
10900
11013
|
if (hasVectorPaintStacks(node)) data += ` data-vector-fills="${escapeAttr2(JSON.stringify(vectorFills(node)))}" data-vector-strokes="${escapeAttr2(JSON.stringify(vectorStrokes(node)))}"`;
|
|
10901
11014
|
else {
|
|
@@ -10937,12 +11050,12 @@ function vectorDocumentToSvg(doc, options = {}) {
|
|
|
10937
11050
|
};
|
|
10938
11051
|
const emitText = (node, depth) => {
|
|
10939
11052
|
const outlines = vectorTextPaths(node).outlines;
|
|
10940
|
-
const effects = !!_optionalChain([node, 'access',
|
|
11053
|
+
const effects = !!_optionalChain([node, 'access', _339 => _339.effects, 'optionalAccess', _340 => _340.some, 'call', _341 => _341((e) => e.enabled !== false)]);
|
|
10941
11054
|
if (!outlines || !effects && options.text !== "outlines") {
|
|
10942
11055
|
emitTextElement(node, depth, common(node));
|
|
10943
11056
|
return;
|
|
10944
11057
|
}
|
|
10945
|
-
lines.push(`${indent(depth)}<g${common(node)} data-vector-live="${escapeAttr2(JSON.stringify({ kind: "text", ..._optionalChain([node, 'access',
|
|
11058
|
+
lines.push(`${indent(depth)}<g${common(node)} data-vector-live="${escapeAttr2(JSON.stringify({ kind: "text", ..._optionalChain([node, 'access', _342 => _342.effects, 'optionalAccess', _343 => _343.length]) ? { effects: node.effects } : {} }))}">`);
|
|
10946
11059
|
lines.push(`${indent(depth + 1)}<g data-vector-part="appearance">`);
|
|
10947
11060
|
for (const shape of vectorAppearanceNodes(node)) emit2(shape, depth + 2);
|
|
10948
11061
|
lines.push(`${indent(depth + 1)}</g>`);
|
|
@@ -10956,7 +11069,7 @@ function vectorDocumentToSvg(doc, options = {}) {
|
|
|
10956
11069
|
const symbolRef = (symbolId) => {
|
|
10957
11070
|
const hit = symbolIds.get(symbolId);
|
|
10958
11071
|
if (hit) return hit;
|
|
10959
|
-
const sym2 = _optionalChain([doc, 'access',
|
|
11072
|
+
const sym2 = _optionalChain([doc, 'access', _344 => _344.symbols, 'optionalAccess', _345 => _345.find, 'call', _346 => _346((x) => x.id === symbolId)]);
|
|
10960
11073
|
if (!sym2) return null;
|
|
10961
11074
|
const id = `${prefix}symbol-${symbolId}`;
|
|
10962
11075
|
symbolIds.set(symbolId, id);
|
|
@@ -10966,20 +11079,20 @@ function vectorDocumentToSvg(doc, options = {}) {
|
|
|
10966
11079
|
};
|
|
10967
11080
|
const emitInstance = (node, depth) => {
|
|
10968
11081
|
const data = { symbolId: node.symbolId, ...node.scaleStrokes === false ? { scaleStrokes: false } : {}, ...node.overrides ? { overrides: node.overrides } : {} };
|
|
10969
|
-
const exact2 = !node.overrides && node.scaleStrokes !== false && !_optionalChain([node, 'access',
|
|
11082
|
+
const exact2 = !node.overrides && node.scaleStrokes !== false && !_optionalChain([node, 'access', _347 => _347.effects, 'optionalAccess', _348 => _348.length]) && !_optionalChain([node, 'access', _349 => _349.filters, 'optionalAccess', _350 => _350.length]);
|
|
10970
11083
|
const ref = symbolRef(node.symbolId);
|
|
10971
11084
|
if (exact2 && ref) {
|
|
10972
11085
|
lines.push(`${indent(depth)}<use${common(node)} href="#${escapeAttr2(ref)}" data-vector-instance="${escapeAttr2(JSON.stringify(data))}"/>`);
|
|
10973
11086
|
return;
|
|
10974
11087
|
}
|
|
10975
|
-
const full = { ...data, ...node.transform ? { transform: node.transform } : {}, ..._optionalChain([node, 'access',
|
|
11088
|
+
const full = { ...data, ...node.transform ? { transform: node.transform } : {}, ..._optionalChain([node, 'access', _351 => _351.effects, 'optionalAccess', _352 => _352.length]) ? { effects: node.effects } : {} };
|
|
10976
11089
|
lines.push(`${indent(depth)}<g data-vector-instance="${escapeAttr2(JSON.stringify(full))}">`);
|
|
10977
11090
|
emitNode(vectorInstanceDrawn(node), depth + 1);
|
|
10978
11091
|
lines.push(`${indent(depth)}</g>`);
|
|
10979
11092
|
};
|
|
10980
11093
|
const emitFrame = (node, depth) => {
|
|
10981
11094
|
const f = node.frame;
|
|
10982
|
-
const data = { ...f, ..._optionalChain([node, 'access',
|
|
11095
|
+
const data = { ...f, ..._optionalChain([node, 'access', _353 => _353.effects, 'optionalAccess', _354 => _354.length]) ? { effects: node.effects } : {} };
|
|
10983
11096
|
lines.push(`${indent(depth)}<g${common(node)} data-vector-frame="${escapeAttr2(JSON.stringify(data))}">`);
|
|
10984
11097
|
const rect = vectorFrameRectPath(f);
|
|
10985
11098
|
if (f.fill !== void 0 && f.fill !== null && f.fill !== "none") {
|
|
@@ -10994,7 +11107,7 @@ function vectorDocumentToSvg(doc, options = {}) {
|
|
|
10994
11107
|
ref = ` clip-path="url(#${escapeAttr2(id)})"`;
|
|
10995
11108
|
}
|
|
10996
11109
|
lines.push(`${indent(depth + 1)}<g data-vector-part="frame-contents"${ref}>`);
|
|
10997
|
-
if (_optionalChain([node, 'access',
|
|
11110
|
+
if (_optionalChain([node, 'access', _355 => _355.masterArt, 'optionalAccess', _356 => _356.length])) {
|
|
10998
11111
|
lines.push(`${indent(depth + 2)}<g data-vector-part="frame-master">`);
|
|
10999
11112
|
for (const child of node.masterArt) emit2(child, depth + 3);
|
|
11000
11113
|
lines.push(`${indent(depth + 2)}</g>`);
|
|
@@ -11023,7 +11136,7 @@ function vectorDocumentToSvg(doc, options = {}) {
|
|
|
11023
11136
|
if (hasOwnVectorAppearance(node)) {
|
|
11024
11137
|
const live2 = {
|
|
11025
11138
|
kind: node.type,
|
|
11026
|
-
..._optionalChain([node, 'access',
|
|
11139
|
+
..._optionalChain([node, 'access', _357 => _357.effects, 'optionalAccess', _358 => _358.length]) ? { effects: node.effects } : {},
|
|
11027
11140
|
...node.type === "group" && node.liveBoolean ? { liveBoolean: node.liveBoolean } : {},
|
|
11028
11141
|
...node.type === "group" && node.symmetry ? { symmetry: node.symmetry } : {}
|
|
11029
11142
|
};
|
|
@@ -11074,7 +11187,7 @@ function vectorDocumentToSvg(doc, options = {}) {
|
|
|
11074
11187
|
data += ` data-vector-width-profile="${widthProfileToAttribute(profile)}"`;
|
|
11075
11188
|
if (node.strokeLinecap && node.strokeLinecap !== "butt") data += ` data-vector-stroke-linecap="${node.strokeLinecap}"`;
|
|
11076
11189
|
if (node.strokeLinejoin && node.strokeLinejoin !== "miter") data += ` data-vector-stroke-linejoin="${node.strokeLinejoin}"`;
|
|
11077
|
-
if (_optionalChain([node, 'access',
|
|
11190
|
+
if (_optionalChain([node, 'access', _359 => _359.strokeDasharray, 'optionalAccess', _360 => _360.length])) data += ` data-vector-stroke-dasharray="${node.strokeDasharray.map(num3).join(" ")}"`;
|
|
11078
11191
|
}
|
|
11079
11192
|
lines.push(`${indent(depth)}<g${common(node)}${data}>`);
|
|
11080
11193
|
lines.push(`${indent(depth + 1)}<path data-vector-part="fill" d="${d}"${fillAttrs}${live}/>`);
|
|
@@ -11255,7 +11368,7 @@ function readStyle(el, parent, cssRules) {
|
|
|
11255
11368
|
const { mixBlendMode: _m, filter: _f, ...inherited } = parent;
|
|
11256
11369
|
const out = { ...inherited };
|
|
11257
11370
|
for (const [attr, key] of Object.entries(STYLE_KEYS)) if (el.attrs[attr] !== void 0) out[key] = el.attrs[attr].trim();
|
|
11258
|
-
if (_optionalChain([cssRules, 'optionalAccess',
|
|
11371
|
+
if (_optionalChain([cssRules, 'optionalAccess', _361 => _361.length])) {
|
|
11259
11372
|
for (const rule of cssRules) {
|
|
11260
11373
|
if (matchesSelector(el, rule.selector)) {
|
|
11261
11374
|
for (const [prop, val] of Object.entries(rule.properties)) {
|
|
@@ -11311,7 +11424,7 @@ function attrOrStyle(el, name) {
|
|
|
11311
11424
|
return el.attrs[name];
|
|
11312
11425
|
}
|
|
11313
11426
|
function urlId(value) {
|
|
11314
|
-
return _nullishCoalesce(_optionalChain([/^url\(\s*['"]?#([^'")\s]+)['"]?\s*\)/, 'access',
|
|
11427
|
+
return _nullishCoalesce(_optionalChain([/^url\(\s*['"]?#([^'")\s]+)['"]?\s*\)/, 'access', _362 => _362.exec, 'call', _363 => _363((_nullishCoalesce(value, () => ( ""))).trim()), 'optionalAccess', _364 => _364[1]]), () => ( null));
|
|
11315
11428
|
}
|
|
11316
11429
|
function clipRulesAsFillRules(el) {
|
|
11317
11430
|
const attrs = { ...el.attrs };
|
|
@@ -11376,9 +11489,9 @@ function resolveGradient(id, raw) {
|
|
|
11376
11489
|
for (let el = first; el && !chain.includes(el) && chain.length < 32; ) {
|
|
11377
11490
|
chain.push(el);
|
|
11378
11491
|
const href = _nullishCoalesce(el.attrs.href, () => ( el.attrs["xlink:href"]));
|
|
11379
|
-
el = _optionalChain([href, 'optionalAccess',
|
|
11492
|
+
el = _optionalChain([href, 'optionalAccess', _365 => _365.startsWith, 'call', _366 => _366("#")]) ? raw.get(href.slice(1)) : void 0;
|
|
11380
11493
|
}
|
|
11381
|
-
const attr = (name) => _optionalChain([chain, 'access',
|
|
11494
|
+
const attr = (name) => _optionalChain([chain, 'access', _367 => _367.find, 'call', _368 => _368((el) => el.attrs[name] !== void 0), 'optionalAccess', _369 => _369.attrs, 'access', _370 => _370[name]]);
|
|
11382
11495
|
const stops = _nullishCoalesce(chain.map(readStops).find((s) => s.length), () => ( []));
|
|
11383
11496
|
if (!stops.length) return null;
|
|
11384
11497
|
const user = attr("gradientUnits") === "userSpaceOnUse";
|
|
@@ -11550,7 +11663,7 @@ function parseVectorSvg(svg, options = {}) {
|
|
|
11550
11663
|
const stackedPath = (g, _style, m, meta) => {
|
|
11551
11664
|
const fillEl = g.children.find((c) => c.name === "path" && c.attrs["data-vector-part"] === "fill");
|
|
11552
11665
|
const subpaths = fillEl ? shapeOf(fillEl) : null;
|
|
11553
|
-
if (!_optionalChain([subpaths, 'optionalAccess',
|
|
11666
|
+
if (!_optionalChain([subpaths, 'optionalAccess', _371 => _371.length])) return null;
|
|
11554
11667
|
const parse = (v2) => {
|
|
11555
11668
|
try {
|
|
11556
11669
|
return v2 ? JSON.parse(v2) : [];
|
|
@@ -11569,7 +11682,7 @@ function parseVectorSvg(svg, options = {}) {
|
|
|
11569
11682
|
const key = (n) => JSON.stringify([n.subpaths, _nullishCoalesce(n.transform, () => ( null)), _nullishCoalesce(n.opacity, () => ( 1)), n.visible !== false, _nullishCoalesce(n.filters, () => ( null)), _nullishCoalesce(n.blendMode, () => ( "normal")), _nullishCoalesce(n.fillRule, () => ( "nonzero")), _nullishCoalesce(n.booleanOperation, () => ( null))]);
|
|
11570
11683
|
for (const n of nodes2) {
|
|
11571
11684
|
const prev = out[out.length - 1];
|
|
11572
|
-
if (_optionalChain([prev, 'optionalAccess',
|
|
11685
|
+
if (_optionalChain([prev, 'optionalAccess', _372 => _372.type]) === "path" && n.type === "path" && key(prev) === key(n)) {
|
|
11573
11686
|
const fills = vectorFills(n);
|
|
11574
11687
|
const strokesBefore = vectorStrokes(prev);
|
|
11575
11688
|
if (!(fills.length && strokesBefore.length)) {
|
|
@@ -11587,7 +11700,7 @@ function parseVectorSvg(svg, options = {}) {
|
|
|
11587
11700
|
const part = (name) => g.children.find((c) => c.name === "path" && c.attrs["data-vector-part"] === name);
|
|
11588
11701
|
const fillEl = part("fill");
|
|
11589
11702
|
const subpaths = fillEl ? shapeOf(fillEl) : null;
|
|
11590
|
-
if (!fillEl || !_optionalChain([subpaths, 'optionalAccess',
|
|
11703
|
+
if (!fillEl || !_optionalChain([subpaths, 'optionalAccess', _373 => _373.length])) return null;
|
|
11591
11704
|
const a = g.attrs;
|
|
11592
11705
|
const fs = readStyle(fillEl, style, styleRules);
|
|
11593
11706
|
const strokeEl = part("stroke");
|
|
@@ -11624,7 +11737,7 @@ function parseVectorSvg(svg, options = {}) {
|
|
|
11624
11737
|
...profile.length ? { strokeWidthProfile: profile } : {},
|
|
11625
11738
|
...keptCap ? { strokeLinecap: keptCap } : {},
|
|
11626
11739
|
...keptJoin ? { strokeLinejoin: keptJoin } : {},
|
|
11627
|
-
..._optionalChain([keptDash, 'optionalAccess',
|
|
11740
|
+
..._optionalChain([keptDash, 'optionalAccess', _374 => _374.length]) ? { strokeDasharray: keptDash } : {}
|
|
11628
11741
|
};
|
|
11629
11742
|
return placed(node, m);
|
|
11630
11743
|
};
|
|
@@ -11689,8 +11802,8 @@ function parseVectorSvg(svg, options = {}) {
|
|
|
11689
11802
|
} else {
|
|
11690
11803
|
const fill = json2(g.attrs["data-vector-fill"]);
|
|
11691
11804
|
const stroke = json2(g.attrs["data-vector-stroke"]);
|
|
11692
|
-
node.fill = fill == null ? null : _nullishCoalesce(_optionalChain([sanitizeVectorFills, 'call',
|
|
11693
|
-
node.stroke = stroke == null ? null : _nullishCoalesce(_optionalChain([sanitizeVectorFills, 'call',
|
|
11805
|
+
node.fill = fill == null ? null : _nullishCoalesce(_optionalChain([sanitizeVectorFills, 'call', _375 => _375([{ paint: fill }]), 'access', _376 => _376[0], 'optionalAccess', _377 => _377.paint]), () => ( null));
|
|
11806
|
+
node.stroke = stroke == null ? null : _nullishCoalesce(_optionalChain([sanitizeVectorFills, 'call', _378 => _378([{ paint: stroke }]), 'access', _379 => _379[0], 'optionalAccess', _380 => _380.paint]), () => ( null));
|
|
11694
11807
|
const settings = json2(g.attrs["data-vector-stroke-settings"]);
|
|
11695
11808
|
if (settings && typeof settings === "object") {
|
|
11696
11809
|
const strokes = sanitizeVectorStrokes([{ paint: _nullishCoalesce(node.stroke, () => ( "#000")), ...settings }]);
|
|
@@ -11726,8 +11839,8 @@ function parseVectorSvg(svg, options = {}) {
|
|
|
11726
11839
|
const anchor = attrOrStyle(el, "text-anchor");
|
|
11727
11840
|
const first0 = (v2) => _nullishCoalesce(numberList(v2)[0], () => ( 0));
|
|
11728
11841
|
const tspan = el.children.find((c) => c.name === "tspan");
|
|
11729
|
-
const x = el.attrs.x !== void 0 ? first0(el.attrs.x) : first0(_optionalChain([tspan, 'optionalAccess',
|
|
11730
|
-
const y = el.attrs.y !== void 0 ? first0(el.attrs.y) : first0(_optionalChain([tspan, 'optionalAccess',
|
|
11842
|
+
const x = el.attrs.x !== void 0 ? first0(el.attrs.x) : first0(_optionalChain([tspan, 'optionalAccess', _381 => _381.attrs, 'access', _382 => _382.x]));
|
|
11843
|
+
const y = el.attrs.y !== void 0 ? first0(el.attrs.y) : first0(_optionalChain([tspan, 'optionalAccess', _383 => _383.attrs, 'access', _384 => _384.y]));
|
|
11731
11844
|
const fillValue = _nullishCoalesce(attrOrStyle(el, "fill"), () => ( style.fill));
|
|
11732
11845
|
let node = {
|
|
11733
11846
|
id: idFor(el),
|
|
@@ -11758,12 +11871,12 @@ function parseVectorSvg(svg, options = {}) {
|
|
|
11758
11871
|
if (symbolOfElement.has(el)) return symbolOfElement.get(el);
|
|
11759
11872
|
symbolOfElement.set(el, null);
|
|
11760
11873
|
const own = json2(el.attrs["data-vector-symbol"]);
|
|
11761
|
-
let id = typeof _optionalChain([own, 'optionalAccess',
|
|
11874
|
+
let id = typeof _optionalChain([own, 'optionalAccess', _385 => _385.id]) === "string" && own.id ? own.id : _nullishCoalesce(el.attrs.id, () => ( createId()));
|
|
11762
11875
|
while (usedSymbolIds.has(id)) id = `${id}-${usedSymbolIds.size}`;
|
|
11763
11876
|
usedSymbolIds.add(id);
|
|
11764
11877
|
const style = readStyle(el, rootStyle, styleRules);
|
|
11765
11878
|
const nodes2 = el.name === "symbol" ? visit2(el, style, IDENTITY_MATRIX) : visitOne({ ...el, attrs: { ...el.attrs, transform: "" } }, rootStyle, parseSvgTransform(el.attrs.transform));
|
|
11766
|
-
symbols.push({ id, name: typeof _optionalChain([own, 'optionalAccess',
|
|
11879
|
+
symbols.push({ id, name: typeof _optionalChain([own, 'optionalAccess', _386 => _386.name]) === "string" && own.name ? own.name : _nullishCoalesce(el.attrs.id, () => ( "Symbol")), nodes: nodes2 });
|
|
11767
11880
|
symbolOfElement.set(el, id);
|
|
11768
11881
|
return id;
|
|
11769
11882
|
};
|
|
@@ -11775,13 +11888,13 @@ function parseVectorSvg(svg, options = {}) {
|
|
|
11775
11888
|
if (!symbolId) return null;
|
|
11776
11889
|
const own = json2(el.attrs["data-vector-instance"]);
|
|
11777
11890
|
const place3 = multiplyMatrices(translateMatrix(length(el.attrs.x), length(el.attrs.y)), m);
|
|
11778
|
-
const node = { id: idFor(el), type: "instance", ...meta, symbolId, ..._optionalChain([own, 'optionalAccess',
|
|
11891
|
+
const node = { id: idFor(el), type: "instance", ...meta, symbolId, ..._optionalChain([own, 'optionalAccess', _387 => _387.scaleStrokes]) === false ? { scaleStrokes: false } : {}, ..._optionalChain([own, 'optionalAccess', _388 => _388.overrides]) ? { overrides: own.overrides } : {} };
|
|
11779
11892
|
return isIdentityMatrix(place3) ? node : { ...node, transform: place3 };
|
|
11780
11893
|
};
|
|
11781
11894
|
const ownInstance = (g, m, meta) => {
|
|
11782
11895
|
const raw = json2(g.attrs["data-vector-instance"]);
|
|
11783
11896
|
if (!raw || typeof raw.symbolId !== "string") return null;
|
|
11784
|
-
const sym2 = [...byId.values()].find((e) => e.name === "symbol" && _optionalChain([json2, 'call',
|
|
11897
|
+
const sym2 = [...byId.values()].find((e) => e.name === "symbol" && _optionalChain([json2, 'call', _389 => _389(e.attrs["data-vector-symbol"]), 'optionalAccess', _390 => _390.id]) === raw.symbolId);
|
|
11785
11898
|
const symbolId = sym2 ? symbolFor(sym2) : raw.symbolId;
|
|
11786
11899
|
if (!symbolId) return null;
|
|
11787
11900
|
const t = Array.isArray(raw.transform) && raw.transform.length === 6 && raw.transform.every(Number.isFinite) ? raw.transform : IDENTITY_MATRIX;
|
|
@@ -11789,7 +11902,7 @@ function parseVectorSvg(svg, options = {}) {
|
|
|
11789
11902
|
const drawn = g.children.find((c) => c.name === "g");
|
|
11790
11903
|
const effects = sanitizeVectorEffects(raw.effects);
|
|
11791
11904
|
const node = {
|
|
11792
|
-
id: _nullishCoalesce(_optionalChain([drawn, 'optionalAccess',
|
|
11905
|
+
id: _nullishCoalesce(_optionalChain([drawn, 'optionalAccess', _391 => _391.attrs, 'access', _392 => _392.id]), () => ( idFor(g))),
|
|
11793
11906
|
type: "instance",
|
|
11794
11907
|
...meta,
|
|
11795
11908
|
symbolId,
|
|
@@ -11846,12 +11959,12 @@ function parseVectorSvg(svg, options = {}) {
|
|
|
11846
11959
|
const masked = (el, nodes2, m) => {
|
|
11847
11960
|
let out = nodes2;
|
|
11848
11961
|
const clipEl = rawMasks.get(_nullishCoalesce(urlId(attrOrStyle(el, "clip-path")), () => ( "")));
|
|
11849
|
-
if (_optionalChain([clipEl, 'optionalAccess',
|
|
11962
|
+
if (_optionalChain([clipEl, 'optionalAccess', _393 => _393.name]) === "clipPath") {
|
|
11850
11963
|
const source = maskNode(clipEl, m, out, clipEl.attrs.clipPathUnits);
|
|
11851
11964
|
if (source) out = [{ id: idFor({ name: "g", attrs: {}, children: [] }), type: "group", name: "Clip Group", mask: { type: "clip" }, children: [source, ...out] }];
|
|
11852
11965
|
}
|
|
11853
11966
|
const maskEl = rawMasks.get(_nullishCoalesce(urlId(attrOrStyle(el, "mask")), () => ( "")));
|
|
11854
|
-
if (_optionalChain([maskEl, 'optionalAccess',
|
|
11967
|
+
if (_optionalChain([maskEl, 'optionalAccess', _394 => _394.name]) === "mask") {
|
|
11855
11968
|
const source = maskNode(maskEl, m, out, maskEl.attrs.maskContentUnits);
|
|
11856
11969
|
const type = attrOrStyle(maskEl, "mask-type") === "alpha" ? "alpha" : "luminance";
|
|
11857
11970
|
if (source) out = [{ id: idFor({ name: "g", attrs: {}, children: [] }), type: "group", name: "Opacity Mask", mask: { type }, children: [source, ...out] }];
|
|
@@ -11873,19 +11986,19 @@ function parseVectorSvg(svg, options = {}) {
|
|
|
11873
11986
|
let sourceEl = part("mask-source");
|
|
11874
11987
|
if (!sourceEl) {
|
|
11875
11988
|
const el = rawMasks.get(_nullishCoalesce(urlId(maskedEl.attrs.mask), () => ( "")));
|
|
11876
|
-
const invert2 = _optionalChain([el, 'optionalAccess',
|
|
11989
|
+
const invert2 = _optionalChain([el, 'optionalAccess', _395 => _395.children, 'access', _396 => _396.find, 'call', _397 => _397((c) => c.name === "g" && c.attrs["data-vector-part"] === "mask-invert")]);
|
|
11877
11990
|
sourceEl = _nullishCoalesce(invert2, () => ( el));
|
|
11878
11991
|
}
|
|
11879
11992
|
const source = sourceEl ? visit2(sourceEl, style, m)[0] : void 0;
|
|
11880
11993
|
let contents = visit2(maskedEl, style, m);
|
|
11881
11994
|
let effects;
|
|
11882
11995
|
const wrapper = contents.length === 1 && contents[0].type === "group" && contents[0].id === `${id}~content` ? contents[0] : null;
|
|
11883
|
-
if (_optionalChain([wrapper, 'optionalAccess',
|
|
11996
|
+
if (_optionalChain([wrapper, 'optionalAccess', _398 => _398.type]) === "group") {
|
|
11884
11997
|
effects = _nullishCoalesce(wrapper.effects, () => ( void 0));
|
|
11885
11998
|
contents = wrapper.children;
|
|
11886
11999
|
}
|
|
11887
12000
|
if (!source) return contents.length ? { id, type: "group", ...meta, children: contents } : null;
|
|
11888
|
-
return { id, type: "group", ...meta, mask, ..._optionalChain([effects, 'optionalAccess',
|
|
12001
|
+
return { id, type: "group", ...meta, mask, ..._optionalChain([effects, 'optionalAccess', _399 => _399.length]) ? { effects } : {}, children: [source, ...contents] };
|
|
11889
12002
|
};
|
|
11890
12003
|
const frameGroup = (g, style, m, meta) => {
|
|
11891
12004
|
const raw = parseJson(g.attrs["data-vector-frame"]);
|
|
@@ -11897,7 +12010,7 @@ function parseVectorSvg(svg, options = {}) {
|
|
|
11897
12010
|
const { rigid, residual } = decomposeRigid(m);
|
|
11898
12011
|
const r = _chunkGF2RBSDMcjs.bezierPathBounds.call(void 0, _chunkGF2RBSDMcjs.transformBezierPath.call(void 0, subpathsToBezier(vectorFrameRectPath(frame)), residual));
|
|
11899
12012
|
const back = invertMatrix(rigid);
|
|
11900
|
-
const effects = sanitizeVectorEffects(_optionalChain([raw, 'optionalAccess',
|
|
12013
|
+
const effects = sanitizeVectorEffects(_optionalChain([raw, 'optionalAccess', _400 => _400.effects]));
|
|
11901
12014
|
return {
|
|
11902
12015
|
id,
|
|
11903
12016
|
type: "group",
|
|
@@ -12369,13 +12482,13 @@ function hitTestVectorNode(node, p, tolerance = 0, parent = IDENTITY_MATRIX, opt
|
|
|
12369
12482
|
}
|
|
12370
12483
|
if (isVectorMaskGroup(node)) {
|
|
12371
12484
|
const m = multiplyMatrices(nodeMatrix(node), parent);
|
|
12372
|
-
const entered = !!_optionalChain([options, 'access',
|
|
12485
|
+
const entered = !!_optionalChain([options, 'access', _401 => _401.entered, 'optionalAccess', _402 => _402.has, 'call', _403 => _403(node.id)]);
|
|
12373
12486
|
if (!entered && isVectorMaskActive(node) && !vectorMaskContains(node, applyMatrix(invertMatrix(m), p), tolerance)) return false;
|
|
12374
12487
|
const shown = !entered && hasOwnVectorAppearance(node) ? expandVectorAppearance(node).children : node.children;
|
|
12375
12488
|
for (let i = shown.length - 1; i >= 1; i--) if (hitTestVectorNode(shown[i], p, tolerance, m, options)) return true;
|
|
12376
12489
|
return entered && hitTestVectorMaskSource(node, p, tolerance, m, options);
|
|
12377
12490
|
}
|
|
12378
|
-
if (!(node.type === "group" && (!hasOwnVectorAppearance(node) || _optionalChain([options, 'access',
|
|
12491
|
+
if (!(node.type === "group" && (!hasOwnVectorAppearance(node) || _optionalChain([options, 'access', _404 => _404.entered, 'optionalAccess', _405 => _405.has, 'call', _406 => _406(node.id)])))) node = expandVectorAppearance(node);
|
|
12379
12492
|
if (node.type === "group") {
|
|
12380
12493
|
const m = multiplyMatrices(nodeMatrix(node), parent);
|
|
12381
12494
|
return node.children.some((c) => hitTestVectorNode(c, p, tolerance, m, options));
|
|
@@ -12387,7 +12500,7 @@ function hitTestVectorNode(node, p, tolerance = 0, parent = IDENTITY_MATRIX, opt
|
|
|
12387
12500
|
function hitTestVectorMaskSource(group, p, tolerance, m, options) {
|
|
12388
12501
|
const source = group.children[0];
|
|
12389
12502
|
if (source.visible === false) return false;
|
|
12390
|
-
if (_optionalChain([group, 'access',
|
|
12503
|
+
if (_optionalChain([group, 'access', _407 => _407.mask, 'optionalAccess', _408 => _408.type]) !== "clip") return hitTestVectorNode(source, p, tolerance, m, options);
|
|
12391
12504
|
const paths = collectPathNodes(source).filter((n) => n.visible !== false);
|
|
12392
12505
|
const pt2 = [p.x, p.y];
|
|
12393
12506
|
return paths.some((n) => {
|
|
@@ -12436,24 +12549,24 @@ function mapAnchor(a, m) {
|
|
|
12436
12549
|
}
|
|
12437
12550
|
function bakeIntoGeometry(node, m) {
|
|
12438
12551
|
if (isIdentityMatrix(m)) return node;
|
|
12439
|
-
if (_optionalChain([node, 'access',
|
|
12552
|
+
if (_optionalChain([node, 'access', _409 => _409.effects, 'optionalAccess', _410 => _410.length])) node = { ...node, effects: transformVectorEffects(node.effects, m, node) };
|
|
12440
12553
|
if (isVectorFrame(node)) return bakeFrame(node, m);
|
|
12441
12554
|
if (node.type === "group") {
|
|
12442
12555
|
const group = node;
|
|
12443
12556
|
const children = group.children.map((c) => transformVectorNode(c, m));
|
|
12444
12557
|
const sym2 = group.symmetry ? { symmetry: transformVectorSymmetry(group.symmetry, m) } : {};
|
|
12445
|
-
const spine = _optionalChain([group, 'access',
|
|
12558
|
+
const spine = _optionalChain([group, 'access', _411 => _411.blend, 'optionalAccess', _412 => _412.spine]);
|
|
12446
12559
|
if (!spine) return { ...group, ...sym2, children };
|
|
12447
12560
|
const moved = { closed: spine.closed, anchors: spine.anchors.map((a) => mapAnchor(a, m)) };
|
|
12448
12561
|
return { ...group, children, blend: { ...group.blend, spine: moved } };
|
|
12449
12562
|
}
|
|
12450
12563
|
const path = node.type === "text" ? bakeVectorTextGeometry(node, m) : node;
|
|
12451
12564
|
const flips = m[0] * m[3] - m[1] * m[2] < 0;
|
|
12452
|
-
const mirrored = flips && _optionalChain([path, 'access',
|
|
12565
|
+
const mirrored = flips && _optionalChain([path, 'access', _413 => _413.strokeWidthProfile, 'optionalAccess', _414 => _414.length]);
|
|
12453
12566
|
const layer = (l) => ({
|
|
12454
12567
|
...l,
|
|
12455
12568
|
...isVectorGradient(l.paint) || isVectorShadedPaint(l.paint) ? { paint: transformVectorPaint(l.paint, m) } : {},
|
|
12456
|
-
...flips && _optionalChain([l, 'access',
|
|
12569
|
+
...flips && _optionalChain([l, 'access', _415 => _415.strokeWidthProfile, 'optionalAccess', _416 => _416.length]) ? { strokeWidthProfile: mirrorWidthProfile(l.strokeWidthProfile) } : {}
|
|
12457
12570
|
});
|
|
12458
12571
|
return {
|
|
12459
12572
|
...path,
|
|
@@ -12688,7 +12801,7 @@ function roundSubpaths(subpaths, precision = 3) {
|
|
|
12688
12801
|
|
|
12689
12802
|
// src/vector/symmetry.ts
|
|
12690
12803
|
function isVectorSymmetryGroup(node) {
|
|
12691
|
-
return _optionalChain([node, 'optionalAccess',
|
|
12804
|
+
return _optionalChain([node, 'optionalAccess', _417 => _417.type]) === "group" && !!node.symmetry && !node.blend && !node.liveBoolean && !node.mask && !node.frame;
|
|
12692
12805
|
}
|
|
12693
12806
|
var rad = (deg) => deg * Math.PI / 180;
|
|
12694
12807
|
var exact = (v2) => Math.abs(v2) < 1e-12 ? 0 : v2;
|
|
@@ -13330,4 +13443,5 @@ function transformVectorSymmetry(s, m) {
|
|
|
13330
13443
|
|
|
13331
13444
|
|
|
13332
13445
|
|
|
13333
|
-
exports.isVectorMeshGradient = isVectorMeshGradient; exports.isVectorFreeformGradient = isVectorFreeformGradient; exports.isVectorShadedPaint = isVectorShadedPaint; exports.vectorRgbaToCss = vectorRgbaToCss; exports.VECTOR_MESH_MAX = VECTOR_MESH_MAX; exports.createVectorMeshGradient = createVectorMeshGradient; exports.vectorMeshPointAt = vectorMeshPointAt; exports.vectorMeshColorAt = vectorMeshColorAt; exports.vectorMeshLines = vectorMeshLines; exports.vectorFreeformSpreadScale = vectorFreeformSpreadScale; exports.vectorFreeformLineSegments = vectorFreeformLineSegments; exports.vectorFreeformField = vectorFreeformField; exports.sampleVectorFreeform = sampleVectorFreeform; exports.autoVectorFreeformGradient = autoVectorFreeformGradient; exports.vectorShadedSvgDefs = vectorShadedSvgDefs; exports.mapVectorShadedPaint = mapVectorShadedPaint; exports.transformVectorShadedPaint = transformVectorShadedPaint; exports.sanitizeVectorShadedPaint = sanitizeVectorShadedPaint; exports.removeVectorFreeformPoint = removeVectorFreeformPoint; exports.nearestVectorShadingPoint = nearestVectorShadingPoint; exports.VECTOR_CORNER_KINDS = VECTOR_CORNER_KINDS; exports.VECTOR_GRADIENT_TYPES = VECTOR_GRADIENT_TYPES; exports.VECTOR_GRADIENT_SPREADS = VECTOR_GRADIENT_SPREADS; exports.VECTOR_GRADIENT_INTERPOLATIONS = VECTOR_GRADIENT_INTERPOLATIONS; exports.VECTOR_STROKE_GRADIENT_MODES = VECTOR_STROKE_GRADIENT_MODES; exports.VECTOR_ARROWHEADS = VECTOR_ARROWHEADS; exports.VECTOR_BLEND_MODES = VECTOR_BLEND_MODES; exports.VECTOR_HORIZONTAL_RESIZING = VECTOR_HORIZONTAL_RESIZING; exports.VECTOR_VERTICAL_RESIZING = VECTOR_VERTICAL_RESIZING; exports.VECTOR_LENS_TYPES = VECTOR_LENS_TYPES; exports.VECTOR_CONNECTOR_SIDES = VECTOR_CONNECTOR_SIDES; exports.VECTOR_CONNECTOR_ROUTES = VECTOR_CONNECTOR_ROUTES; exports.VECTOR_BLEND_SPACINGS = VECTOR_BLEND_SPACINGS; exports.VECTOR_MASK_TYPES = VECTOR_MASK_TYPES; exports.VECTOR_SYMMETRY_MODES = VECTOR_SYMMETRY_MODES; exports.VECTOR_TEXT_ALIGNS = VECTOR_TEXT_ALIGNS; exports.VECTOR_PATH_TEXT_BASELINES = VECTOR_PATH_TEXT_BASELINES; exports.VECTOR_PERSPECTIVE_PLANES = VECTOR_PERSPECTIVE_PLANES; exports.VECTOR_CONSTRAINT_KINDS = VECTOR_CONSTRAINT_KINDS; exports.VECTOR_TOOLS = VECTOR_TOOLS; exports.VECTOR_TRANSFORM_HANDLES = VECTOR_TRANSFORM_HANDLES; exports.VECTOR_PATHFINDER_OPERATIONS = VECTOR_PATHFINDER_OPERATIONS; exports.VECTOR_EFFECT_TYPES = VECTOR_EFFECT_TYPES; exports.VECTOR_MERGE_MODES = VECTOR_MERGE_MODES; exports.VECTOR_FILTER_TYPES = VECTOR_FILTER_TYPES; exports.isVectorGradient = isVectorGradient; exports.parseVectorColor = parseVectorColor; exports.VECTOR_GRADIENT_MIN_STOPS = VECTOR_GRADIENT_MIN_STOPS; exports.gradientMidpointRemap = gradientMidpointRemap; exports.sortedVectorGradientStops = sortedVectorGradientStops; exports.vectorGradientNeedsExpansion = vectorGradientNeedsExpansion; exports.vectorGradientRamp = vectorGradientRamp; exports.sampleVectorGradient = sampleVectorGradient; exports.expandVectorGradientStops = expandVectorGradientStops; exports.samplePlainStops = samplePlainStops; exports.reverseVectorGradient = reverseVectorGradient; exports.insertVectorGradientStop = insertVectorGradientStop; exports.moveVectorGradientStop = moveVectorGradientStop; exports.removeVectorGradientStop = removeVectorGradientStop; exports.vectorGradientMidpointPosition = vectorGradientMidpointPosition; exports.vectorGradientMidpointFromPosition = vectorGradientMidpointFromPosition; exports.spanVectorGradientStops = spanVectorGradientStops; exports.hasExplicitGradientGeometry = hasExplicitGradientGeometry; exports.vectorGradientPoints = vectorGradientPoints; exports.vectorBoxMatrix = vectorBoxMatrix; exports.vectorGradientUnitsMatrix = vectorGradientUnitsMatrix; exports.vectorGradientMatrix = vectorGradientMatrix; exports.vectorGradientFocalParam = vectorGradientFocalParam; exports.vectorGradientParam = vectorGradientParam; exports.applyVectorGradientSpread = applyVectorGradientSpread; exports.vectorGradientTAt = vectorGradientTAt; exports.sampleVectorGradientAt = sampleVectorGradientAt; exports.vectorGradientAspect = vectorGradientAspect; exports.explicitVectorGradient = explicitVectorGradient; exports.pinVectorGradient = pinVectorGradient; exports.transformVectorGradient = transformVectorGradient; exports.mapVectorGradient = mapVectorGradient; exports.mapVectorPaint = mapVectorPaint; exports.transformVectorPaint = transformVectorPaint; exports.isCentredVectorGradient = isCentredVectorGradient; exports.vectorGradientHandles = vectorGradientHandles; exports.moveVectorGradientHandle = moveVectorGradientHandle; exports.setVectorGradientVector = setVectorGradientVector; exports.VECTOR_GRADIENT_MAX_PERIODS = VECTOR_GRADIENT_MAX_PERIODS; exports.periodicVectorGradientStops = periodicVectorGradientStops; exports.expandVectorGradientSpread = expandVectorGradientSpread; exports.vectorGradientArea = vectorGradientArea; exports.patternAttrs = patternAttrs; exports.vectorGradientSvgDefs = vectorGradientSvgDefs; exports.sampleVectorPaintDefAt = sampleVectorPaintDefAt; exports.sanitizeVectorGradient = sanitizeVectorGradient; exports.convertVectorGradient = convertVectorGradient; exports.defaultVectorGradient = defaultVectorGradient; exports.applyVectorGradientPatch = applyVectorGradientPatch; exports.IDENTITY_MATRIX = IDENTITY_MATRIX; exports.multiplyMatrices = multiplyMatrices; exports.translateMatrix = translateMatrix; exports.scaleMatrix = scaleMatrix; exports.rotateMatrix = rotateMatrix; exports.matrixAbout = matrixAbout; exports.skewMatrix = skewMatrix; exports.applyMatrix = applyMatrix; exports.isIdentityMatrix = isIdentityMatrix; exports.invertMatrix = invertMatrix; exports.applyMatrixLinear = applyMatrixLinear; exports.matrixRotation = matrixRotation; exports.decomposeRigid = decomposeRigid; exports.isVectorSymmetryGroup = isVectorSymmetryGroup; exports.vectorSymmetryMatrices = vectorSymmetryMatrices; exports.vectorSymmetryDrawn = vectorSymmetryDrawn; exports.vectorSymmetryAxes = vectorSymmetryAxes; exports.sanitizeVectorSymmetry = sanitizeVectorSymmetry; exports.VECTOR_SYMMETRY_MODE_LABELS = VECTOR_SYMMETRY_MODE_LABELS; exports.transformVectorSymmetry = transformVectorSymmetry; exports.vectorCornerAt = vectorCornerAt; exports.vectorCorners = vectorCorners; exports.cornerSetback = cornerSetback; exports.fitCornerRadius = fitCornerRadius; exports.cornerBisectorPoint = cornerBisectorPoint; exports.cornerRadiusChange = cornerRadiusChange; exports.hasVectorCorners = hasVectorCorners; exports.expandVectorCornersOf = expandVectorCornersOf; exports.expandVectorCorners = expandVectorCorners; exports.setAnchorCorner = setAnchorCorner; exports.nextVectorCornerKind = nextVectorCornerKind; exports.setSubpathCorners = setSubpathCorners; exports.VECTOR_WIDTH_PROFILE_MAX_POINTS = VECTOR_WIDTH_PROFILE_MAX_POINTS; exports.VECTOR_WIDTH_PROFILE_MAX_SCALE = VECTOR_WIDTH_PROFILE_MAX_SCALE; exports.VECTOR_WIDTH_SAME_T = VECTOR_WIDTH_SAME_T; exports.VECTOR_WIDTH_PRESETS = VECTOR_WIDTH_PRESETS; exports.VECTOR_WIDTH_PRESET_IDS = VECTOR_WIDTH_PRESET_IDS; exports.sanitizeWidthProfile = sanitizeWidthProfile; exports.isUniformWidthProfile = isUniformWidthProfile; exports.widthProfileAt = widthProfileAt; exports.widthProfileMaxScale = widthProfileMaxScale; exports.widthProfilePreset = widthProfilePreset; exports.widthProfilePresetId = widthProfilePresetId; exports.reverseWidthProfile = reverseWidthProfile; exports.mirrorWidthProfile = mirrorWidthProfile; exports.insertWidthPoint = insertWidthPoint; exports.setWidthPoint = setWidthPoint; exports.removeWidthPoints = removeWidthPoints; exports.taperWaveFactor = taperWaveFactor; exports.generateWidthProfile = generateWidthProfile; exports.VECTOR_PRESSURE_NOMINAL = VECTOR_PRESSURE_NOMINAL; exports.pressureWidthProfile = pressureWidthProfile; exports.dashIntervals = dashIntervals; exports.variableStrokeRings = variableStrokeRings; exports.variableStrokeOutline = variableStrokeOutline; exports.nearestStrokePosition = nearestStrokePosition; exports.strokePositionPoint = strokePositionPoint; exports.isClosedBezierShape = isClosedBezierShape; exports.effectiveStrokeAlign = effectiveStrokeAlign; exports.strokeWidthProfileOf = strokeWidthProfileOf; exports.hasStrokeExtras = hasStrokeExtras; exports.vectorStrokeLineArea = vectorStrokeLineArea; exports.arrowheadWeight = arrowheadWeight; exports.arrowheadInset = arrowheadInset; exports.arrowheadPath = arrowheadPath; exports.vectorStrokeParts = vectorStrokeParts; exports.vectorStrokeOutlinePath = vectorStrokeOutlinePath; exports.hitTestVectorStroke = hitTestVectorStroke; exports.vectorStrokeReach = vectorStrokeReach; exports.vectorPaintSolid = vectorPaintSolid; exports.shadeVectorColor = shadeVectorColor; exports.vectorPathRings = vectorPathRings; exports.vectorExtrudeFaces = vectorExtrudeFaces; exports.EFFECT_STRIP_HEIGHT = EFFECT_STRIP_HEIGHT; exports.EFFECT_MAP_REPEATS = EFFECT_MAP_REPEATS; exports.effectPaintSize = effectPaintSize; exports.readEffectStrokeMap = readEffectStrokeMap; exports.effectPaintKey = effectPaintKey; exports.isPaintEffectPaint = isPaintEffectPaint; exports.readPaintEffectPaint = readPaintEffectPaint; exports.sampleEffectField = sampleEffectField; exports.sampleEffectAt = sampleEffectAt; exports.effectDabField = effectDabField; exports.stampSampler = stampSampler; exports.brushStickerRefs = brushStickerRefs; exports.PAPER_FAMILIES = PAPER_FAMILIES; exports.PAPER_LIBRARY = PAPER_LIBRARY; exports.DEFAULT_PAPER = DEFAULT_PAPER; exports.paperPreset = paperPreset; exports.clonePaper = clonePaper; exports.normalizePaper = normalizePaper; exports.hexToRgb8 = hexToRgb8; exports.renderPaper = renderPaper; exports.penOrientation = penOrientation; exports.tiltToOrientation = tiltToOrientation; exports.PenSmoother = PenSmoother; exports.IDENTITY_COPY = IDENTITY_COPY; exports.PenDabWalker = PenDabWalker; exports.DryStroke = DryStroke; exports.mixerTip = mixerTip; exports.toStrokePoint = toStrokePoint; exports.multiColorPalette = multiColorPalette; exports.multiColorGradient = multiColorGradient; exports.multiColorForDab = multiColorForDab; exports.PaintDabStroke = PaintDabStroke; exports.wetPaperInput = wetPaperInput; exports.WetStrokeDriver = WetStrokeDriver; exports.WET_MEDIUM_PARAMS = WET_MEDIUM_PARAMS; exports.WET_GPU_MODES = WET_GPU_MODES; exports.GPU_LEAD = GPU_LEAD; exports.PaintWetLayers = PaintWetLayers; exports.wetPigmentOf = wetPigmentOf; exports.VECTOR_WET_STEPS = VECTOR_WET_STEPS; exports.vectorMediaEngine = vectorMediaEngine; exports.usesVectorBackdrop = usesVectorBackdrop; exports.WetBrushstrokeJob = WetBrushstrokeJob; exports.renderWetBrushstroke = renderWetBrushstroke; exports.vectorBackdropRect = vectorBackdropRect; exports.renderBackdropBrushstroke = renderBackdropBrushstroke; exports.VECTOR_BRUSHSTROKE_SCALE = VECTOR_BRUSHSTROKE_SCALE; exports.isVectorBrushstrokeEngine = isVectorBrushstrokeEngine; exports.vectorBrushstrokeBrushes = vectorBrushstrokeBrushes; exports.vectorBrushstrokeBrush = vectorBrushstrokeBrush; exports.vectorBrushstrokeBrushOf = vectorBrushstrokeBrushOf; exports.vectorBrushstrokeBrushError = vectorBrushstrokeBrushError; exports.vectorBrushstrokeDefaultColour = vectorBrushstrokeDefaultColour; exports.sanitizeVectorBrushstroke = sanitizeVectorBrushstroke; exports.vectorBrushstrokePaintError = vectorBrushstrokePaintError; exports.readVectorBrushstrokePaint = readVectorBrushstrokePaint; exports.VECTOR_BRUSHSTROKE_MAX_SEED = VECTOR_BRUSHSTROKE_MAX_SEED; exports.sanitizeVectorBrushstrokePaper = sanitizeVectorBrushstrokePaper; exports.vectorBrushstrokeCharacterError = vectorBrushstrokeCharacterError; exports.randomVectorBrushstrokeSeed = randomVectorBrushstrokeSeed; exports.isVectorBrushstrokeLayer = isVectorBrushstrokeLayer; exports.vectorBrushstrokeReach = vectorBrushstrokeReach; exports.setVectorBackdropSource = setVectorBackdropSource; exports.onVectorBrushstrokesSettled = onVectorBrushstrokesSettled; exports.vectorBrushstrokesSettling = vectorBrushstrokesSettling; exports.settleVectorBrushstrokes = settleVectorBrushstrokes; exports.vectorBrushstrokeImages = vectorBrushstrokeImages; exports.VECTOR_STROKE_SETTING_KEYS = VECTOR_STROKE_SETTING_KEYS; exports.VECTOR_BLEND_MODE_LABELS = VECTOR_BLEND_MODE_LABELS; exports.isVectorBlendMode = isVectorBlendMode; exports.vectorBlendModeCss = vectorBlendModeCss; exports.vectorBlendModeFromCss = vectorBlendModeFromCss; exports.isPlainVectorPaintLayer = isPlainVectorPaintLayer; exports.isDrawnVectorPaintLayer = isDrawnVectorPaintLayer; exports.vectorFills = vectorFills; exports.vectorStrokeSettings = vectorStrokeSettings; exports.vectorStrokes = vectorStrokes; exports.hasVectorPaintStacks = hasVectorPaintStacks; exports.withVectorFills = withVectorFills; exports.withVectorStrokes = withVectorStrokes; exports.normalizeVectorPaintStacks = normalizeVectorPaintStacks; exports.sanitizeVectorFills = sanitizeVectorFills; exports.sanitizeVectorStrokeSettings = sanitizeVectorStrokeSettings; exports.sanitizeVectorStrokes = sanitizeVectorStrokes; exports.vectorPaintLayerNodes = vectorPaintLayerNodes; exports.needsVectorPaintLayers = needsVectorPaintLayers; exports.vectorStrokeStackReach = vectorStrokeStackReach; exports.hitTestVectorPaintLayer = hitTestVectorPaintLayer; exports.hitTestVectorPaintStack = hitTestVectorPaintStack; exports.vectorStacksHaveGradient = vectorStacksHaveGradient; exports.newVectorStrokeLayer = newVectorStrokeLayer; exports.vectorTargetPaint = vectorTargetPaint; exports.withVectorTargetPaint = withVectorTargetPaint; exports.effectPathLength = effectPathLength; exports.effectPathVertexCount = effectPathVertexCount; exports.trimIntervals = trimIntervals; exports.trimPaths = trimPaths; exports.trimPathsIndividually = trimPathsIndividually; exports.puckerBloatPaths = puckerBloatPaths; exports.roundCornerPaths = roundCornerPaths; exports.offsetPaths = offsetPaths; exports.sweepPath = sweepPath; exports.twistPaths = twistPaths; exports.zigzagPaths = zigzagPaths; exports.wigglePaths = wigglePaths; exports.mergePaths = mergePaths; exports.vectorRepeaterCopies = vectorRepeaterCopies; exports.repeatPaths = repeatPaths; exports.pathsCenter = pathsCenter; exports.mapVectorPoints = mapVectorPoints; exports.mapVectorSubpaths = mapVectorSubpaths; exports.mapBezierPath = mapBezierPath; exports.isVectorFrame = isVectorFrame; exports.vectorFrameRectPath = vectorFrameRectPath; exports.vectorFrameDrawn = vectorFrameDrawn; exports.vectorFrameContains = vectorFrameContains; exports.vectorFrameChildMatrix = vectorFrameChildMatrix; exports.sanitizeVectorFrame = sanitizeVectorFrame; exports.sanitizeVectorResizing = sanitizeVectorResizing; exports.VECTOR_HORIZONTAL_RESIZING_LABELS = VECTOR_HORIZONTAL_RESIZING_LABELS; exports.VECTOR_VERTICAL_RESIZING_LABELS = VECTOR_VERTICAL_RESIZING_LABELS; exports.vectorBoundsInside = vectorBoundsInside; exports.vectorArtboards = vectorArtboards; exports.vectorFrameDocument = vectorFrameDocument; exports.getVectorFramePanel = getVectorFramePanel; exports.splitIntoFaces = splitIntoFaces; exports.knifePath = knifePath; exports.eraserRegion = eraserRegion; exports.eraseFromFill = eraseFromFill; exports.eraseFromOutline = eraseFromOutline; exports.polylineBounds = polylineBounds; exports.simplifyPolyline = simplifyPolyline; exports.VECTOR_FILTER_DEFAULTS = VECTOR_FILTER_DEFAULTS; exports.VECTOR_FILTER_LABELS = VECTOR_FILTER_LABELS; exports.VECTOR_FILTER_PARAM_SPECS = VECTOR_FILTER_PARAM_SPECS; exports.isVectorFilterType = isVectorFilterType; exports.normalizeVectorFilterParams = normalizeVectorFilterParams; exports.vectorFilterParamKeys = vectorFilterParamKeys; exports.createVectorFilter = createVectorFilter; exports.sanitizeVectorFilters = sanitizeVectorFilters; exports.activeVectorFilters = activeVectorFilters; exports.vectorFilterReach = vectorFilterReach; exports.vectorFilterSvg = vectorFilterSvg; exports.vectorFilterMarkup = vectorFilterMarkup; exports.VECTOR_FILTER_MENU = VECTOR_FILTER_MENU; exports.isVectorMaskType = isVectorMaskType; exports.sanitizeVectorMask = sanitizeVectorMask; exports.isVectorMaskGroup = isVectorMaskGroup; exports.isVectorMaskActive = isVectorMaskActive; exports.vectorMaskSource = vectorMaskSource; exports.vectorMaskContents = vectorMaskContents; exports.vectorMaskOwner = vectorMaskOwner; exports.vectorMaskSummary = vectorMaskSummary; exports.vectorMaskRegionShapes = vectorMaskRegionShapes; exports.vectorMaskRegion = vectorMaskRegion; exports.vectorMaskRegionPath = vectorMaskRegionPath; exports.vectorMaskContains = vectorMaskContains; exports.vectorMaskedShapes = vectorMaskedShapes; exports.vectorMaskedGeometry = vectorMaskedGeometry; exports.vectorMaskedLocalBounds = vectorMaskedLocalBounds; exports.vectorMaskContentBounds = vectorMaskContentBounds; exports.vectorMaskRenderData = vectorMaskRenderData; exports.DEFAULT_TEXT_STYLE = DEFAULT_TEXT_STYLE; exports.DEFAULT_AUTO_LEADING = DEFAULT_AUTO_LEADING; exports.fitRuns = fitRuns; exports.styleAt = styleAt; exports.restyleRange = restyleRange; exports.spliceRuns = spliceRuns; exports.paragraphRanges = paragraphRanges; exports.fitParagraphRuns = fitParagraphRuns; exports.fontOf = fontOf; exports.transformTextRect = transformTextRect; exports.lineToTextSpace = lineToTextSpace; exports.layoutText = layoutText; exports.textIndexAt = textIndexAt; exports.caretAt = caretAt; exports.textSelectionQuads = textSelectionQuads; exports.textArrowStep = textArrowStep; exports.textLineMove = textLineMove; exports.textDecorations = textDecorations; exports.textRectPath = textRectPath; exports.textFragmentOutline = textFragmentOutline; exports.drawTextFragment = drawTextFragment; exports.cssFontFamily = cssFontFamily; exports.cssFont = cssFont; exports.createCanvasTextShaper = createCanvasTextShaper; exports.createOutlineTextShaper = createOutlineTextShaper; exports.createMetricTextShaper = createMetricTextShaper; exports.setVectorTextShaper = setVectorTextShaper; exports.getVectorTextShaper = getVectorTextShaper; exports.vectorTextShaperGeneration = vectorTextShaperGeneration; exports.vectorTextHasOutlines = vectorTextHasOutlines; exports.vectorTextFamilies = vectorTextFamilies; exports.DEFAULT_VECTOR_FONT = DEFAULT_VECTOR_FONT; exports.VECTOR_CHARACTER_STYLE_KEYS = VECTOR_CHARACTER_STYLE_KEYS; exports.VECTOR_PARAGRAPH_STYLE_KEYS = VECTOR_PARAGRAPH_STYLE_KEYS; exports.VectorTextError = VectorTextError; exports.fitVectorTextRuns = fitVectorTextRuns; exports.vectorTextRuns = vectorTextRuns; exports.vectorTextStyleAt = vectorTextStyleAt; exports.measureVectorPath = measureVectorPath; exports.vectorPathAt = vectorPathAt; exports.vectorPathTextPositions = vectorPathTextPositions; exports.layoutVectorText = layoutVectorText; exports.glyphBox = glyphBox; exports.vectorTextPaths = vectorTextPaths; exports.vectorTextPaintSource = vectorTextPaintSource; exports.vectorTextCaret = vectorTextCaret; exports.vectorTextIndexAt = vectorTextIndexAt; exports.vectorTextSelectionQuads = vectorTextSelectionQuads; exports.patchVectorCharacterStyle = patchVectorCharacterStyle; exports.patchVectorParagraphStyle = patchVectorParagraphStyle; exports.sanitizeVectorTextFrame = sanitizeVectorTextFrame; exports.normalizeVectorTextRuns = normalizeVectorTextRuns; exports.vectorTextOrientation = vectorTextOrientation; exports.sanitizeVectorTextFields = sanitizeVectorTextFields; exports.vectorTextRange = vectorTextRange; exports.replaceVectorText = replaceVectorText; exports.styleVectorText = styleVectorText; exports.bakeVectorTextGeometry = bakeVectorTextGeometry; exports.vectorTextName = vectorTextName; exports.pathTextFrameFromBezier = pathTextFrameFromBezier; exports.vectorTextBoxOutline = vectorTextBoxOutline; exports.vectorTextSpans = vectorTextSpans; exports.vectorTextGeometryNode = vectorTextGeometryNode; exports.vectorTextSpanSvg = vectorTextSpanSvg; exports.VECTOR_SYMBOL_MAX_DEPTH = VECTOR_SYMBOL_MAX_DEPTH; exports.vectorSymbolsUsedIn = vectorSymbolsUsedIn; exports.vectorSymbolUses = vectorSymbolUses; exports.resolveVectorSymbols = resolveVectorSymbols; exports.stripVectorSymbolArt = stripVectorSymbolArt; exports.scaleVectorStrokeWidths = scaleVectorStrokeWidths; exports.tintVectorNode = tintVectorNode; exports.prefixVectorIds = prefixVectorIds; exports.vectorInstanceGroup = vectorInstanceGroup; exports.composeVectorMatrices = composeVectorMatrices; exports.vectorBevelFaces = vectorBevelFaces; exports.isVectorLens = isVectorLens; exports.VECTOR_LENS_LABELS = VECTOR_LENS_LABELS; exports.VECTOR_LENS_SPECS = VECTOR_LENS_SPECS; exports.sanitizeVectorLens = sanitizeVectorLens; exports.vectorLensColorMap = vectorLensColorMap; exports.mapVectorPaintColors = mapVectorPaintColors; exports.vectorLensDrawn = vectorLensDrawn; exports.resolveVectorLenses = resolveVectorLenses; exports.stripVectorLensViews = stripVectorLensViews; exports.WARP_STYLES = WARP_STYLES; exports.WARP_STYLE_LABELS = WARP_STYLE_LABELS; exports.warpPresetGrid = warpPresetGrid; exports.warpPresetMesh = warpPresetMesh; exports.warpMeshColumns = warpMeshColumns; exports.warpMeshRows = warpMeshRows; exports.isValidWarpMesh = isValidWarpMesh; exports.fitWarpMesh = fitWarpMesh; exports.identityWarpMesh = identityWarpMesh; exports.evalWarpMesh = evalWarpMesh; exports.splitWarpMeshU = splitWarpMeshU; exports.splitWarpMeshV = splitWarpMeshV; exports.removeWarpMeshSplitU = removeWarpMeshSplitU; exports.removeWarpMeshSplitV = removeWarpMeshSplitV; exports.mapWarpMeshPoints = mapWarpMeshPoints; exports.resizeWarpMesh = resizeWarpMesh; exports.warpMeshControlBounds = warpMeshControlBounds; exports.warpMeshParamAt = warpMeshParamAt; exports.dragWarpMeshPoint = dragWarpMeshPoint; exports.pullWarpMesh = pullWarpMesh; exports.warpMeshEditPoints = warpMeshEditPoints; exports.warpMeshGridCurves = warpMeshGridCurves; exports.vectorMeshFromOutline = vectorMeshFromOutline; exports.vectorMeshOutline = vectorMeshOutline; exports.VECTOR_EFFECT_DEFAULTS = VECTOR_EFFECT_DEFAULTS; exports.VECTOR_EFFECT_LABELS = VECTOR_EFFECT_LABELS; exports.VECTOR_EFFECT_PARAM_SPECS = VECTOR_EFFECT_PARAM_SPECS; exports.vectorEnvelopeMesh = vectorEnvelopeMesh; exports.vectorEnvelopeMap = vectorEnvelopeMap; exports.normalizeVectorEffectParams = normalizeVectorEffectParams; exports.createVectorEffect = createVectorEffect; exports.activeVectorEffects = activeVectorEffects; exports.hasOwnVectorAppearance = hasOwnVectorAppearance; exports.hasVectorAppearance = hasVectorAppearance; exports.isVectorLiveBoolean = isVectorLiveBoolean; exports.vectorOperandOperation = vectorOperandOperation; exports.vectorLiveBooleanSteps = vectorLiveBooleanSteps; exports.clearVectorLiveBooleanCache = clearVectorLiveBooleanCache; exports.foldVectorBooleanOperands = foldVectorBooleanOperands; exports.applyVectorEffects = applyVectorEffects; exports.vectorInstanceDrawn = vectorInstanceDrawn; exports.vectorChildAppearanceShapes = vectorChildAppearanceShapes; exports.vectorEffectInputPaths = vectorEffectInputPaths; exports.vectorEffectInputBounds = vectorEffectInputBounds; exports.vectorNodeEnvelope = vectorNodeEnvelope; exports.vectorEnvelopeFrame = vectorEnvelopeFrame; exports.vectorAppearanceShapes = vectorAppearanceShapes; exports.vectorAppearanceOutline = vectorAppearanceOutline; exports.vectorAppearanceNodes = vectorAppearanceNodes; exports.expandVectorAppearance = expandVectorAppearance; exports.expandVectorAppearances = expandVectorAppearances; exports.sanitizeVectorEffects = sanitizeVectorEffects; exports.transformVectorEffects = transformVectorEffects; exports.vectorEnteredGroups = vectorEnteredGroups; exports.isVectorMasterPage = isVectorMasterPage; exports.vectorPages = vectorPages; exports.vectorMasterPages = vectorMasterPages; exports.vectorMasterArt = vectorMasterArt; exports.resolveVectorMasterPages = resolveVectorMasterPages; exports.stripVectorMasterArt = stripVectorMasterArt; exports.isVectorConnector = isVectorConnector; exports.vectorConnectionSites = vectorConnectionSites; exports.nearestVectorConnectionSite = nearestVectorConnectionSite; exports.vectorConnectorWorldAnchors = vectorConnectorWorldAnchors; exports.routeVectorConnector = routeVectorConnector; exports.rerouteVectorConnectors = rerouteVectorConnectors; exports.sanitizeVectorConnector = sanitizeVectorConnector; exports.VECTOR_CONNECTOR_ROUTE_LABELS = VECTOR_CONNECTOR_ROUTE_LABELS; exports.VECTOR_CONNECTOR_SIDE_LABELS = VECTOR_CONNECTOR_SIDE_LABELS; exports.getVectorConnectorPanel = getVectorConnectorPanel; exports.vectorConnectorTargetAt = vectorConnectorTargetAt; exports.vectorStrokeGradientDefs = vectorStrokeGradientDefs; exports.vectorCornersAttribute = vectorCornersAttribute; exports.applyVectorCornersAttribute = applyVectorCornersAttribute; exports.vectorPathLocalBounds = vectorPathLocalBounds; exports.vectorPaintToSvg = vectorPaintToSvg; exports.vectorStrokeSvgParts = vectorStrokeSvgParts; exports.vectorNodeLocalPaintBounds = vectorNodeLocalPaintBounds; exports.vectorNodeFilterSvg = vectorNodeFilterSvg; exports.widthProfileToAttribute = widthProfileToAttribute; exports.widthProfileFromAttribute = widthProfileFromAttribute; exports.vectorDocumentToSvg = vectorDocumentToSvg; exports.parseSvgTransform = parseSvgTransform; exports.parseVectorSvg = parseVectorSvg; exports.VECTOR_SPATIAL_MIN = VECTOR_SPATIAL_MIN; exports.VectorRTree = VectorRTree; exports.vectorNodePaintBox = vectorNodePaintBox; exports.vectorSpatialIndex = vectorSpatialIndex; exports.vectorNodesNear = vectorNodesNear; exports.cloneAnchor = cloneAnchor; exports.cloneSubpath = cloneSubpath; exports.cloneVectorNode = cloneVectorNode; exports.cloneVectorDocument = cloneVectorDocument; exports.hasPaint = hasPaint; exports.subpathSegmentCount = subpathSegmentCount; exports.subpathSegment = subpathSegment; exports.subpathsToBezier = subpathsToBezier; exports.vectorNodeToBezier = vectorNodeToBezier; exports.vectorPathData = vectorPathData; exports.inferAnchorType = inferAnchorType; exports.bezierToSubpaths = bezierToSubpaths; exports.walkVectorNodes = walkVectorNodes; exports.findVectorNode = findVectorNode; exports.locateVectorNode = locateVectorNode; exports.collectPaintedNodes = collectPaintedNodes; exports.collectPathNodes = collectPathNodes; exports.nodeMatrix = nodeMatrix; exports.vectorPathWorldBezier = vectorPathWorldBezier; exports.vectorNodeBounds = vectorNodeBounds; exports.unionBounds = unionBounds; exports.boundsIntersect = boundsIntersect; exports.boundsFromPoints = boundsFromPoints; exports.hitTestVectorNode = hitTestVectorNode; exports.vectorStrokeOutline = vectorStrokeOutline; exports.hitTestVectorNodes = hitTestVectorNodes; exports.nearestSegment = nearestSegment; exports.transformVectorNode = transformVectorNode; exports.vectorNodeRotation = vectorNodeRotation; exports.vectorWorldMatrix = vectorWorldMatrix; exports.vectorParentMatrix = vectorParentMatrix; exports.translateAnchor = translateAnchor; exports.moveAnchorHandle = moveAnchorHandle; exports.convertAnchor = convertAnchor; exports.insertAnchor = insertAnchor; exports.removeAnchors = removeAnchors; exports.reverseSubpath = reverseSubpath; exports.KAPPA = KAPPA2; exports.rectSubpath = rectSubpath; exports.ellipseSubpath = ellipseSubpath; exports.polygonSubpath = polygonSubpath; exports.starSubpath = starSubpath; exports.lineSubpath = lineSubpath; exports.roundSubpaths = roundSubpaths;
|
|
13446
|
+
|
|
13447
|
+
exports.isVectorMeshGradient = isVectorMeshGradient; exports.isVectorFreeformGradient = isVectorFreeformGradient; exports.isVectorShadedPaint = isVectorShadedPaint; exports.vectorRgbaToCss = vectorRgbaToCss; exports.VECTOR_MESH_MAX = VECTOR_MESH_MAX; exports.createVectorMeshGradient = createVectorMeshGradient; exports.vectorMeshPointAt = vectorMeshPointAt; exports.vectorMeshColorAt = vectorMeshColorAt; exports.vectorMeshLines = vectorMeshLines; exports.vectorFreeformSpreadScale = vectorFreeformSpreadScale; exports.vectorFreeformLineSegments = vectorFreeformLineSegments; exports.vectorFreeformField = vectorFreeformField; exports.sampleVectorFreeform = sampleVectorFreeform; exports.autoVectorFreeformGradient = autoVectorFreeformGradient; exports.vectorShadedSvgDefs = vectorShadedSvgDefs; exports.mapVectorShadedPaint = mapVectorShadedPaint; exports.transformVectorShadedPaint = transformVectorShadedPaint; exports.sanitizeVectorShadedPaint = sanitizeVectorShadedPaint; exports.removeVectorFreeformPoint = removeVectorFreeformPoint; exports.nearestVectorShadingPoint = nearestVectorShadingPoint; exports.VECTOR_CORNER_KINDS = VECTOR_CORNER_KINDS; exports.VECTOR_GRADIENT_TYPES = VECTOR_GRADIENT_TYPES; exports.VECTOR_GRADIENT_SPREADS = VECTOR_GRADIENT_SPREADS; exports.VECTOR_GRADIENT_INTERPOLATIONS = VECTOR_GRADIENT_INTERPOLATIONS; exports.VECTOR_STROKE_GRADIENT_MODES = VECTOR_STROKE_GRADIENT_MODES; exports.VECTOR_ARROWHEADS = VECTOR_ARROWHEADS; exports.VECTOR_BLEND_MODES = VECTOR_BLEND_MODES; exports.VECTOR_HORIZONTAL_RESIZING = VECTOR_HORIZONTAL_RESIZING; exports.VECTOR_VERTICAL_RESIZING = VECTOR_VERTICAL_RESIZING; exports.VECTOR_LENS_TYPES = VECTOR_LENS_TYPES; exports.VECTOR_CONNECTOR_SIDES = VECTOR_CONNECTOR_SIDES; exports.VECTOR_CONNECTOR_ROUTES = VECTOR_CONNECTOR_ROUTES; exports.VECTOR_BLEND_SPACINGS = VECTOR_BLEND_SPACINGS; exports.VECTOR_MASK_TYPES = VECTOR_MASK_TYPES; exports.VECTOR_SYMMETRY_MODES = VECTOR_SYMMETRY_MODES; exports.VECTOR_TEXT_ALIGNS = VECTOR_TEXT_ALIGNS; exports.VECTOR_PATH_TEXT_BASELINES = VECTOR_PATH_TEXT_BASELINES; exports.VECTOR_PERSPECTIVE_PLANES = VECTOR_PERSPECTIVE_PLANES; exports.VECTOR_CONSTRAINT_KINDS = VECTOR_CONSTRAINT_KINDS; exports.VECTOR_TOOLS = VECTOR_TOOLS; exports.VECTOR_TRANSFORM_HANDLES = VECTOR_TRANSFORM_HANDLES; exports.VECTOR_PATHFINDER_OPERATIONS = VECTOR_PATHFINDER_OPERATIONS; exports.VECTOR_EFFECT_TYPES = VECTOR_EFFECT_TYPES; exports.VECTOR_MERGE_MODES = VECTOR_MERGE_MODES; exports.VECTOR_FILTER_TYPES = VECTOR_FILTER_TYPES; exports.isVectorGradient = isVectorGradient; exports.parseVectorColor = parseVectorColor; exports.VECTOR_GRADIENT_MIN_STOPS = VECTOR_GRADIENT_MIN_STOPS; exports.gradientMidpointRemap = gradientMidpointRemap; exports.sortedVectorGradientStops = sortedVectorGradientStops; exports.vectorGradientNeedsExpansion = vectorGradientNeedsExpansion; exports.vectorGradientRamp = vectorGradientRamp; exports.sampleVectorGradient = sampleVectorGradient; exports.expandVectorGradientStops = expandVectorGradientStops; exports.samplePlainStops = samplePlainStops; exports.reverseVectorGradient = reverseVectorGradient; exports.insertVectorGradientStop = insertVectorGradientStop; exports.moveVectorGradientStop = moveVectorGradientStop; exports.removeVectorGradientStop = removeVectorGradientStop; exports.vectorGradientMidpointPosition = vectorGradientMidpointPosition; exports.vectorGradientMidpointFromPosition = vectorGradientMidpointFromPosition; exports.spanVectorGradientStops = spanVectorGradientStops; exports.hasExplicitGradientGeometry = hasExplicitGradientGeometry; exports.vectorGradientPoints = vectorGradientPoints; exports.vectorBoxMatrix = vectorBoxMatrix; exports.vectorGradientUnitsMatrix = vectorGradientUnitsMatrix; exports.vectorGradientMatrix = vectorGradientMatrix; exports.vectorGradientFocalParam = vectorGradientFocalParam; exports.vectorGradientParam = vectorGradientParam; exports.applyVectorGradientSpread = applyVectorGradientSpread; exports.vectorGradientTAt = vectorGradientTAt; exports.sampleVectorGradientAt = sampleVectorGradientAt; exports.vectorGradientAspect = vectorGradientAspect; exports.explicitVectorGradient = explicitVectorGradient; exports.pinVectorGradient = pinVectorGradient; exports.transformVectorGradient = transformVectorGradient; exports.mapVectorGradient = mapVectorGradient; exports.mapVectorPaint = mapVectorPaint; exports.transformVectorPaint = transformVectorPaint; exports.isCentredVectorGradient = isCentredVectorGradient; exports.vectorGradientHandles = vectorGradientHandles; exports.moveVectorGradientHandle = moveVectorGradientHandle; exports.setVectorGradientVector = setVectorGradientVector; exports.VECTOR_GRADIENT_MAX_PERIODS = VECTOR_GRADIENT_MAX_PERIODS; exports.periodicVectorGradientStops = periodicVectorGradientStops; exports.expandVectorGradientSpread = expandVectorGradientSpread; exports.vectorGradientArea = vectorGradientArea; exports.patternAttrs = patternAttrs; exports.vectorGradientSvgDefs = vectorGradientSvgDefs; exports.sampleVectorPaintDefAt = sampleVectorPaintDefAt; exports.sanitizeVectorGradient = sanitizeVectorGradient; exports.convertVectorGradient = convertVectorGradient; exports.defaultVectorGradient = defaultVectorGradient; exports.applyVectorGradientPatch = applyVectorGradientPatch; exports.IDENTITY_MATRIX = IDENTITY_MATRIX; exports.multiplyMatrices = multiplyMatrices; exports.translateMatrix = translateMatrix; exports.scaleMatrix = scaleMatrix; exports.rotateMatrix = rotateMatrix; exports.matrixAbout = matrixAbout; exports.skewMatrix = skewMatrix; exports.applyMatrix = applyMatrix; exports.isIdentityMatrix = isIdentityMatrix; exports.invertMatrix = invertMatrix; exports.applyMatrixLinear = applyMatrixLinear; exports.matrixRotation = matrixRotation; exports.decomposeRigid = decomposeRigid; exports.isVectorSymmetryGroup = isVectorSymmetryGroup; exports.vectorSymmetryMatrices = vectorSymmetryMatrices; exports.vectorSymmetryDrawn = vectorSymmetryDrawn; exports.vectorSymmetryAxes = vectorSymmetryAxes; exports.sanitizeVectorSymmetry = sanitizeVectorSymmetry; exports.VECTOR_SYMMETRY_MODE_LABELS = VECTOR_SYMMETRY_MODE_LABELS; exports.transformVectorSymmetry = transformVectorSymmetry; exports.vectorCornerAt = vectorCornerAt; exports.vectorCorners = vectorCorners; exports.cornerSetback = cornerSetback; exports.fitCornerRadius = fitCornerRadius; exports.cornerBisectorPoint = cornerBisectorPoint; exports.cornerRadiusChange = cornerRadiusChange; exports.hasVectorCorners = hasVectorCorners; exports.expandVectorCornersOf = expandVectorCornersOf; exports.expandVectorCorners = expandVectorCorners; exports.setAnchorCorner = setAnchorCorner; exports.nextVectorCornerKind = nextVectorCornerKind; exports.setSubpathCorners = setSubpathCorners; exports.VECTOR_WIDTH_PROFILE_MAX_POINTS = VECTOR_WIDTH_PROFILE_MAX_POINTS; exports.VECTOR_WIDTH_PROFILE_MAX_SCALE = VECTOR_WIDTH_PROFILE_MAX_SCALE; exports.VECTOR_WIDTH_SAME_T = VECTOR_WIDTH_SAME_T; exports.VECTOR_WIDTH_PRESETS = VECTOR_WIDTH_PRESETS; exports.VECTOR_WIDTH_PRESET_IDS = VECTOR_WIDTH_PRESET_IDS; exports.sanitizeWidthProfile = sanitizeWidthProfile; exports.isUniformWidthProfile = isUniformWidthProfile; exports.widthProfileAt = widthProfileAt; exports.widthProfileMaxScale = widthProfileMaxScale; exports.widthProfilePreset = widthProfilePreset; exports.widthProfilePresetId = widthProfilePresetId; exports.reverseWidthProfile = reverseWidthProfile; exports.mirrorWidthProfile = mirrorWidthProfile; exports.insertWidthPoint = insertWidthPoint; exports.setWidthPoint = setWidthPoint; exports.removeWidthPoints = removeWidthPoints; exports.taperWaveFactor = taperWaveFactor; exports.generateWidthProfile = generateWidthProfile; exports.VECTOR_PRESSURE_NOMINAL = VECTOR_PRESSURE_NOMINAL; exports.pressureWidthProfile = pressureWidthProfile; exports.dashIntervals = dashIntervals; exports.variableStrokeRings = variableStrokeRings; exports.variableStrokeOutline = variableStrokeOutline; exports.nearestStrokePosition = nearestStrokePosition; exports.strokePositionPoint = strokePositionPoint; exports.isClosedBezierShape = isClosedBezierShape; exports.effectiveStrokeAlign = effectiveStrokeAlign; exports.strokeWidthProfileOf = strokeWidthProfileOf; exports.hasStrokeExtras = hasStrokeExtras; exports.vectorStrokeLineArea = vectorStrokeLineArea; exports.arrowheadWeight = arrowheadWeight; exports.arrowheadInset = arrowheadInset; exports.arrowheadPath = arrowheadPath; exports.vectorStrokeParts = vectorStrokeParts; exports.vectorStrokeOutlinePath = vectorStrokeOutlinePath; exports.hitTestVectorStroke = hitTestVectorStroke; exports.vectorStrokeReach = vectorStrokeReach; exports.vectorPaintSolid = vectorPaintSolid; exports.shadeVectorColor = shadeVectorColor; exports.vectorPathRings = vectorPathRings; exports.vectorExtrudeFaces = vectorExtrudeFaces; exports.EFFECT_STRIP_HEIGHT = EFFECT_STRIP_HEIGHT; exports.EFFECT_MAP_REPEATS = EFFECT_MAP_REPEATS; exports.effectPaintSize = effectPaintSize; exports.readEffectStrokeMap = readEffectStrokeMap; exports.effectPaintKey = effectPaintKey; exports.isPaintEffectPaint = isPaintEffectPaint; exports.readPaintEffectPaint = readPaintEffectPaint; exports.sampleEffectField = sampleEffectField; exports.sampleEffectAt = sampleEffectAt; exports.effectDabField = effectDabField; exports.stampSampler = stampSampler; exports.brushStickerRefs = brushStickerRefs; exports.PAPER_FAMILIES = PAPER_FAMILIES; exports.PAPER_LIBRARY = PAPER_LIBRARY; exports.DEFAULT_PAPER = DEFAULT_PAPER; exports.paperPreset = paperPreset; exports.clonePaper = clonePaper; exports.normalizePaper = normalizePaper; exports.hexToRgb8 = hexToRgb8; exports.renderPaper = renderPaper; exports.TipGrain = TipGrain; exports.penOrientation = penOrientation; exports.tiltToOrientation = tiltToOrientation; exports.PenSmoother = PenSmoother; exports.IDENTITY_COPY = IDENTITY_COPY; exports.PenDabWalker = PenDabWalker; exports.DryStroke = DryStroke; exports.mixerTip = mixerTip; exports.toStrokePoint = toStrokePoint; exports.multiColorPalette = multiColorPalette; exports.multiColorGradient = multiColorGradient; exports.multiColorForDab = multiColorForDab; exports.PaintDabStroke = PaintDabStroke; exports.wetPaperInput = wetPaperInput; exports.WetStrokeDriver = WetStrokeDriver; exports.WET_MEDIUM_PARAMS = WET_MEDIUM_PARAMS; exports.WET_GPU_MODES = WET_GPU_MODES; exports.GPU_LEAD = GPU_LEAD; exports.PaintWetLayers = PaintWetLayers; exports.wetPigmentOf = wetPigmentOf; exports.VECTOR_WET_STEPS = VECTOR_WET_STEPS; exports.vectorMediaEngine = vectorMediaEngine; exports.usesVectorBackdrop = usesVectorBackdrop; exports.WetBrushstrokeJob = WetBrushstrokeJob; exports.renderWetBrushstroke = renderWetBrushstroke; exports.vectorBackdropRect = vectorBackdropRect; exports.renderBackdropBrushstroke = renderBackdropBrushstroke; exports.VECTOR_BRUSHSTROKE_SCALE = VECTOR_BRUSHSTROKE_SCALE; exports.isVectorBrushstrokeEngine = isVectorBrushstrokeEngine; exports.vectorBrushstrokeBrushes = vectorBrushstrokeBrushes; exports.vectorBrushstrokeBrush = vectorBrushstrokeBrush; exports.vectorBrushstrokeBrushOf = vectorBrushstrokeBrushOf; exports.vectorBrushstrokeBrushError = vectorBrushstrokeBrushError; exports.vectorBrushstrokeDefaultColour = vectorBrushstrokeDefaultColour; exports.sanitizeVectorBrushstroke = sanitizeVectorBrushstroke; exports.vectorBrushstrokePaintError = vectorBrushstrokePaintError; exports.readVectorBrushstrokePaint = readVectorBrushstrokePaint; exports.VECTOR_BRUSHSTROKE_MAX_SEED = VECTOR_BRUSHSTROKE_MAX_SEED; exports.sanitizeVectorBrushstrokePaper = sanitizeVectorBrushstrokePaper; exports.vectorBrushstrokeCharacterError = vectorBrushstrokeCharacterError; exports.randomVectorBrushstrokeSeed = randomVectorBrushstrokeSeed; exports.isVectorBrushstrokeLayer = isVectorBrushstrokeLayer; exports.vectorBrushstrokeReach = vectorBrushstrokeReach; exports.setVectorBackdropSource = setVectorBackdropSource; exports.onVectorBrushstrokesSettled = onVectorBrushstrokesSettled; exports.vectorBrushstrokesSettling = vectorBrushstrokesSettling; exports.settleVectorBrushstrokes = settleVectorBrushstrokes; exports.vectorBrushstrokeImages = vectorBrushstrokeImages; exports.VECTOR_STROKE_SETTING_KEYS = VECTOR_STROKE_SETTING_KEYS; exports.VECTOR_BLEND_MODE_LABELS = VECTOR_BLEND_MODE_LABELS; exports.isVectorBlendMode = isVectorBlendMode; exports.vectorBlendModeCss = vectorBlendModeCss; exports.vectorBlendModeFromCss = vectorBlendModeFromCss; exports.isPlainVectorPaintLayer = isPlainVectorPaintLayer; exports.isDrawnVectorPaintLayer = isDrawnVectorPaintLayer; exports.vectorFills = vectorFills; exports.vectorStrokeSettings = vectorStrokeSettings; exports.vectorStrokes = vectorStrokes; exports.hasVectorPaintStacks = hasVectorPaintStacks; exports.withVectorFills = withVectorFills; exports.withVectorStrokes = withVectorStrokes; exports.normalizeVectorPaintStacks = normalizeVectorPaintStacks; exports.sanitizeVectorFills = sanitizeVectorFills; exports.sanitizeVectorStrokeSettings = sanitizeVectorStrokeSettings; exports.sanitizeVectorStrokes = sanitizeVectorStrokes; exports.vectorPaintLayerNodes = vectorPaintLayerNodes; exports.needsVectorPaintLayers = needsVectorPaintLayers; exports.vectorStrokeStackReach = vectorStrokeStackReach; exports.hitTestVectorPaintLayer = hitTestVectorPaintLayer; exports.hitTestVectorPaintStack = hitTestVectorPaintStack; exports.vectorStacksHaveGradient = vectorStacksHaveGradient; exports.newVectorStrokeLayer = newVectorStrokeLayer; exports.vectorTargetPaint = vectorTargetPaint; exports.withVectorTargetPaint = withVectorTargetPaint; exports.effectPathLength = effectPathLength; exports.effectPathVertexCount = effectPathVertexCount; exports.trimIntervals = trimIntervals; exports.trimPaths = trimPaths; exports.trimPathsIndividually = trimPathsIndividually; exports.puckerBloatPaths = puckerBloatPaths; exports.roundCornerPaths = roundCornerPaths; exports.offsetPaths = offsetPaths; exports.sweepPath = sweepPath; exports.twistPaths = twistPaths; exports.zigzagPaths = zigzagPaths; exports.wigglePaths = wigglePaths; exports.mergePaths = mergePaths; exports.vectorRepeaterCopies = vectorRepeaterCopies; exports.repeatPaths = repeatPaths; exports.pathsCenter = pathsCenter; exports.mapVectorPoints = mapVectorPoints; exports.mapVectorSubpaths = mapVectorSubpaths; exports.mapBezierPath = mapBezierPath; exports.isVectorFrame = isVectorFrame; exports.vectorFrameRectPath = vectorFrameRectPath; exports.vectorFrameDrawn = vectorFrameDrawn; exports.vectorFrameContains = vectorFrameContains; exports.vectorFrameChildMatrix = vectorFrameChildMatrix; exports.sanitizeVectorFrame = sanitizeVectorFrame; exports.sanitizeVectorResizing = sanitizeVectorResizing; exports.VECTOR_HORIZONTAL_RESIZING_LABELS = VECTOR_HORIZONTAL_RESIZING_LABELS; exports.VECTOR_VERTICAL_RESIZING_LABELS = VECTOR_VERTICAL_RESIZING_LABELS; exports.vectorBoundsInside = vectorBoundsInside; exports.vectorArtboards = vectorArtboards; exports.vectorFrameDocument = vectorFrameDocument; exports.getVectorFramePanel = getVectorFramePanel; exports.splitIntoFaces = splitIntoFaces; exports.knifePath = knifePath; exports.eraserRegion = eraserRegion; exports.eraseFromFill = eraseFromFill; exports.eraseFromOutline = eraseFromOutline; exports.polylineBounds = polylineBounds; exports.simplifyPolyline = simplifyPolyline; exports.VECTOR_FILTER_DEFAULTS = VECTOR_FILTER_DEFAULTS; exports.VECTOR_FILTER_LABELS = VECTOR_FILTER_LABELS; exports.VECTOR_FILTER_PARAM_SPECS = VECTOR_FILTER_PARAM_SPECS; exports.isVectorFilterType = isVectorFilterType; exports.normalizeVectorFilterParams = normalizeVectorFilterParams; exports.vectorFilterParamKeys = vectorFilterParamKeys; exports.createVectorFilter = createVectorFilter; exports.sanitizeVectorFilters = sanitizeVectorFilters; exports.activeVectorFilters = activeVectorFilters; exports.vectorFilterReach = vectorFilterReach; exports.vectorFilterSvg = vectorFilterSvg; exports.vectorFilterMarkup = vectorFilterMarkup; exports.VECTOR_FILTER_MENU = VECTOR_FILTER_MENU; exports.isVectorMaskType = isVectorMaskType; exports.sanitizeVectorMask = sanitizeVectorMask; exports.isVectorMaskGroup = isVectorMaskGroup; exports.isVectorMaskActive = isVectorMaskActive; exports.vectorMaskSource = vectorMaskSource; exports.vectorMaskContents = vectorMaskContents; exports.vectorMaskOwner = vectorMaskOwner; exports.vectorMaskSummary = vectorMaskSummary; exports.vectorMaskRegionShapes = vectorMaskRegionShapes; exports.vectorMaskRegion = vectorMaskRegion; exports.vectorMaskRegionPath = vectorMaskRegionPath; exports.vectorMaskContains = vectorMaskContains; exports.vectorMaskedShapes = vectorMaskedShapes; exports.vectorMaskedGeometry = vectorMaskedGeometry; exports.vectorMaskedLocalBounds = vectorMaskedLocalBounds; exports.vectorMaskContentBounds = vectorMaskContentBounds; exports.vectorMaskRenderData = vectorMaskRenderData; exports.DEFAULT_TEXT_STYLE = DEFAULT_TEXT_STYLE; exports.DEFAULT_AUTO_LEADING = DEFAULT_AUTO_LEADING; exports.fitRuns = fitRuns; exports.styleAt = styleAt; exports.restyleRange = restyleRange; exports.spliceRuns = spliceRuns; exports.paragraphRanges = paragraphRanges; exports.fitParagraphRuns = fitParagraphRuns; exports.fontOf = fontOf; exports.transformTextRect = transformTextRect; exports.lineToTextSpace = lineToTextSpace; exports.layoutText = layoutText; exports.textIndexAt = textIndexAt; exports.caretAt = caretAt; exports.textSelectionQuads = textSelectionQuads; exports.textArrowStep = textArrowStep; exports.textLineMove = textLineMove; exports.textDecorations = textDecorations; exports.textRectPath = textRectPath; exports.textFragmentOutline = textFragmentOutline; exports.drawTextFragment = drawTextFragment; exports.cssFontFamily = cssFontFamily; exports.cssFont = cssFont; exports.createCanvasTextShaper = createCanvasTextShaper; exports.createOutlineTextShaper = createOutlineTextShaper; exports.createMetricTextShaper = createMetricTextShaper; exports.setVectorTextShaper = setVectorTextShaper; exports.getVectorTextShaper = getVectorTextShaper; exports.vectorTextShaperGeneration = vectorTextShaperGeneration; exports.vectorTextHasOutlines = vectorTextHasOutlines; exports.vectorTextFamilies = vectorTextFamilies; exports.DEFAULT_VECTOR_FONT = DEFAULT_VECTOR_FONT; exports.VECTOR_CHARACTER_STYLE_KEYS = VECTOR_CHARACTER_STYLE_KEYS; exports.VECTOR_PARAGRAPH_STYLE_KEYS = VECTOR_PARAGRAPH_STYLE_KEYS; exports.VectorTextError = VectorTextError; exports.fitVectorTextRuns = fitVectorTextRuns; exports.vectorTextRuns = vectorTextRuns; exports.vectorTextStyleAt = vectorTextStyleAt; exports.measureVectorPath = measureVectorPath; exports.vectorPathAt = vectorPathAt; exports.vectorPathTextPositions = vectorPathTextPositions; exports.layoutVectorText = layoutVectorText; exports.glyphBox = glyphBox; exports.vectorTextPaths = vectorTextPaths; exports.vectorTextPaintSource = vectorTextPaintSource; exports.vectorTextCaret = vectorTextCaret; exports.vectorTextIndexAt = vectorTextIndexAt; exports.vectorTextSelectionQuads = vectorTextSelectionQuads; exports.patchVectorCharacterStyle = patchVectorCharacterStyle; exports.patchVectorParagraphStyle = patchVectorParagraphStyle; exports.sanitizeVectorTextFrame = sanitizeVectorTextFrame; exports.normalizeVectorTextRuns = normalizeVectorTextRuns; exports.vectorTextOrientation = vectorTextOrientation; exports.sanitizeVectorTextFields = sanitizeVectorTextFields; exports.vectorTextRange = vectorTextRange; exports.replaceVectorText = replaceVectorText; exports.styleVectorText = styleVectorText; exports.bakeVectorTextGeometry = bakeVectorTextGeometry; exports.vectorTextName = vectorTextName; exports.pathTextFrameFromBezier = pathTextFrameFromBezier; exports.vectorTextBoxOutline = vectorTextBoxOutline; exports.vectorTextSpans = vectorTextSpans; exports.vectorTextGeometryNode = vectorTextGeometryNode; exports.vectorTextSpanSvg = vectorTextSpanSvg; exports.VECTOR_SYMBOL_MAX_DEPTH = VECTOR_SYMBOL_MAX_DEPTH; exports.vectorSymbolsUsedIn = vectorSymbolsUsedIn; exports.vectorSymbolUses = vectorSymbolUses; exports.resolveVectorSymbols = resolveVectorSymbols; exports.stripVectorSymbolArt = stripVectorSymbolArt; exports.scaleVectorStrokeWidths = scaleVectorStrokeWidths; exports.tintVectorNode = tintVectorNode; exports.prefixVectorIds = prefixVectorIds; exports.vectorInstanceGroup = vectorInstanceGroup; exports.composeVectorMatrices = composeVectorMatrices; exports.vectorBevelFaces = vectorBevelFaces; exports.isVectorLens = isVectorLens; exports.VECTOR_LENS_LABELS = VECTOR_LENS_LABELS; exports.VECTOR_LENS_SPECS = VECTOR_LENS_SPECS; exports.sanitizeVectorLens = sanitizeVectorLens; exports.vectorLensColorMap = vectorLensColorMap; exports.mapVectorPaintColors = mapVectorPaintColors; exports.vectorLensDrawn = vectorLensDrawn; exports.resolveVectorLenses = resolveVectorLenses; exports.stripVectorLensViews = stripVectorLensViews; exports.WARP_STYLES = WARP_STYLES; exports.WARP_STYLE_LABELS = WARP_STYLE_LABELS; exports.warpPresetGrid = warpPresetGrid; exports.warpPresetMesh = warpPresetMesh; exports.warpMeshColumns = warpMeshColumns; exports.warpMeshRows = warpMeshRows; exports.isValidWarpMesh = isValidWarpMesh; exports.fitWarpMesh = fitWarpMesh; exports.identityWarpMesh = identityWarpMesh; exports.evalWarpMesh = evalWarpMesh; exports.splitWarpMeshU = splitWarpMeshU; exports.splitWarpMeshV = splitWarpMeshV; exports.removeWarpMeshSplitU = removeWarpMeshSplitU; exports.removeWarpMeshSplitV = removeWarpMeshSplitV; exports.mapWarpMeshPoints = mapWarpMeshPoints; exports.resizeWarpMesh = resizeWarpMesh; exports.warpMeshControlBounds = warpMeshControlBounds; exports.warpMeshParamAt = warpMeshParamAt; exports.dragWarpMeshPoint = dragWarpMeshPoint; exports.pullWarpMesh = pullWarpMesh; exports.warpMeshEditPoints = warpMeshEditPoints; exports.warpMeshGridCurves = warpMeshGridCurves; exports.vectorMeshFromOutline = vectorMeshFromOutline; exports.vectorMeshOutline = vectorMeshOutline; exports.VECTOR_EFFECT_DEFAULTS = VECTOR_EFFECT_DEFAULTS; exports.VECTOR_EFFECT_LABELS = VECTOR_EFFECT_LABELS; exports.VECTOR_EFFECT_PARAM_SPECS = VECTOR_EFFECT_PARAM_SPECS; exports.vectorEnvelopeMesh = vectorEnvelopeMesh; exports.vectorEnvelopeMap = vectorEnvelopeMap; exports.normalizeVectorEffectParams = normalizeVectorEffectParams; exports.createVectorEffect = createVectorEffect; exports.activeVectorEffects = activeVectorEffects; exports.hasOwnVectorAppearance = hasOwnVectorAppearance; exports.hasVectorAppearance = hasVectorAppearance; exports.isVectorLiveBoolean = isVectorLiveBoolean; exports.vectorOperandOperation = vectorOperandOperation; exports.vectorLiveBooleanSteps = vectorLiveBooleanSteps; exports.clearVectorLiveBooleanCache = clearVectorLiveBooleanCache; exports.foldVectorBooleanOperands = foldVectorBooleanOperands; exports.applyVectorEffects = applyVectorEffects; exports.vectorInstanceDrawn = vectorInstanceDrawn; exports.vectorChildAppearanceShapes = vectorChildAppearanceShapes; exports.vectorEffectInputPaths = vectorEffectInputPaths; exports.vectorEffectInputBounds = vectorEffectInputBounds; exports.vectorNodeEnvelope = vectorNodeEnvelope; exports.vectorEnvelopeFrame = vectorEnvelopeFrame; exports.vectorAppearanceShapes = vectorAppearanceShapes; exports.vectorAppearanceOutline = vectorAppearanceOutline; exports.vectorAppearanceNodes = vectorAppearanceNodes; exports.expandVectorAppearance = expandVectorAppearance; exports.expandVectorAppearances = expandVectorAppearances; exports.sanitizeVectorEffects = sanitizeVectorEffects; exports.transformVectorEffects = transformVectorEffects; exports.vectorEnteredGroups = vectorEnteredGroups; exports.isVectorMasterPage = isVectorMasterPage; exports.vectorPages = vectorPages; exports.vectorMasterPages = vectorMasterPages; exports.vectorMasterArt = vectorMasterArt; exports.resolveVectorMasterPages = resolveVectorMasterPages; exports.stripVectorMasterArt = stripVectorMasterArt; exports.isVectorConnector = isVectorConnector; exports.vectorConnectionSites = vectorConnectionSites; exports.nearestVectorConnectionSite = nearestVectorConnectionSite; exports.vectorConnectorWorldAnchors = vectorConnectorWorldAnchors; exports.routeVectorConnector = routeVectorConnector; exports.rerouteVectorConnectors = rerouteVectorConnectors; exports.sanitizeVectorConnector = sanitizeVectorConnector; exports.VECTOR_CONNECTOR_ROUTE_LABELS = VECTOR_CONNECTOR_ROUTE_LABELS; exports.VECTOR_CONNECTOR_SIDE_LABELS = VECTOR_CONNECTOR_SIDE_LABELS; exports.getVectorConnectorPanel = getVectorConnectorPanel; exports.vectorConnectorTargetAt = vectorConnectorTargetAt; exports.vectorStrokeGradientDefs = vectorStrokeGradientDefs; exports.vectorCornersAttribute = vectorCornersAttribute; exports.applyVectorCornersAttribute = applyVectorCornersAttribute; exports.vectorPathLocalBounds = vectorPathLocalBounds; exports.vectorPaintToSvg = vectorPaintToSvg; exports.vectorStrokeSvgParts = vectorStrokeSvgParts; exports.vectorNodeLocalPaintBounds = vectorNodeLocalPaintBounds; exports.vectorNodeFilterSvg = vectorNodeFilterSvg; exports.widthProfileToAttribute = widthProfileToAttribute; exports.widthProfileFromAttribute = widthProfileFromAttribute; exports.vectorDocumentToSvg = vectorDocumentToSvg; exports.parseSvgTransform = parseSvgTransform; exports.parseVectorSvg = parseVectorSvg; exports.VECTOR_SPATIAL_MIN = VECTOR_SPATIAL_MIN; exports.VectorRTree = VectorRTree; exports.vectorNodePaintBox = vectorNodePaintBox; exports.vectorSpatialIndex = vectorSpatialIndex; exports.vectorNodesNear = vectorNodesNear; exports.cloneAnchor = cloneAnchor; exports.cloneSubpath = cloneSubpath; exports.cloneVectorNode = cloneVectorNode; exports.cloneVectorDocument = cloneVectorDocument; exports.hasPaint = hasPaint; exports.subpathSegmentCount = subpathSegmentCount; exports.subpathSegment = subpathSegment; exports.subpathsToBezier = subpathsToBezier; exports.vectorNodeToBezier = vectorNodeToBezier; exports.vectorPathData = vectorPathData; exports.inferAnchorType = inferAnchorType; exports.bezierToSubpaths = bezierToSubpaths; exports.walkVectorNodes = walkVectorNodes; exports.findVectorNode = findVectorNode; exports.locateVectorNode = locateVectorNode; exports.collectPaintedNodes = collectPaintedNodes; exports.collectPathNodes = collectPathNodes; exports.nodeMatrix = nodeMatrix; exports.vectorPathWorldBezier = vectorPathWorldBezier; exports.vectorNodeBounds = vectorNodeBounds; exports.unionBounds = unionBounds; exports.boundsIntersect = boundsIntersect; exports.boundsFromPoints = boundsFromPoints; exports.hitTestVectorNode = hitTestVectorNode; exports.vectorStrokeOutline = vectorStrokeOutline; exports.hitTestVectorNodes = hitTestVectorNodes; exports.nearestSegment = nearestSegment; exports.transformVectorNode = transformVectorNode; exports.vectorNodeRotation = vectorNodeRotation; exports.vectorWorldMatrix = vectorWorldMatrix; exports.vectorParentMatrix = vectorParentMatrix; exports.translateAnchor = translateAnchor; exports.moveAnchorHandle = moveAnchorHandle; exports.convertAnchor = convertAnchor; exports.insertAnchor = insertAnchor; exports.removeAnchors = removeAnchors; exports.reverseSubpath = reverseSubpath; exports.KAPPA = KAPPA2; exports.rectSubpath = rectSubpath; exports.ellipseSubpath = ellipseSubpath; exports.polygonSubpath = polygonSubpath; exports.starSubpath = starSubpath; exports.lineSubpath = lineSubpath; exports.roundSubpaths = roundSubpaths;
|