@pixerate/editor 0.249.0 → 0.251.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/index.cjs +40 -41
- package/dist/agent/index.js +9 -10
- package/dist/animation/index.cjs +6 -7
- package/dist/animation/index.js +5 -6
- package/dist/animation-editor/index.cjs +124 -123
- package/dist/animation-editor/index.js +15 -14
- package/dist/brushes/index.cjs +1406 -0
- package/dist/brushes/index.d.cts +12 -0
- package/dist/brushes/index.d.ts +12 -0
- package/dist/brushes/index.js +1406 -0
- package/dist/brushes/migrate.d.cts +17 -0
- package/dist/brushes/migrate.d.ts +17 -0
- package/dist/brushes/normalize.d.cts +15 -0
- package/dist/brushes/normalize.d.ts +15 -0
- package/dist/brushes/presets.d.cts +12 -0
- package/dist/brushes/presets.d.ts +12 -0
- package/dist/brushes/resolve.d.cts +56 -0
- package/dist/brushes/resolve.d.ts +56 -0
- package/dist/brushes/schema.d.cts +29 -0
- package/dist/brushes/schema.d.ts +29 -0
- package/dist/brushes/types.d.cts +323 -0
- package/dist/brushes/types.d.ts +323 -0
- package/dist/{brushstrokeRender-T3JZST44.js → brushstrokeRender-5PYSKZIJ.js} +9 -8
- package/dist/{brushstrokeRender-GCKK7V2I.cjs → brushstrokeRender-7FLLSQEC.cjs} +15 -14
- package/dist/canvas/index.cjs +120 -65
- package/dist/canvas/index.d.cts +1 -0
- package/dist/canvas/index.d.ts +1 -0
- package/dist/canvas/index.js +88 -33
- package/dist/canvas/stickers.d.cts +35 -0
- package/dist/canvas/stickers.d.ts +35 -0
- package/dist/chart/index.cjs +159 -160
- package/dist/chart/index.js +9 -10
- package/dist/{chunk-RXZL4NG5.js → chunk-226QDRO3.js} +1 -1
- package/dist/{chunk-DOIU7VJG.js → chunk-2ZJ4DT3M.js} +1 -1
- package/dist/{chunk-XZNU4DUX.cjs → chunk-3NS5C7FB.cjs} +76 -76
- package/dist/{chunk-UTI5IITZ.cjs → chunk-4ZC5QJE2.cjs} +3 -3
- package/dist/{chunk-L3JFOTBQ.js → chunk-5E2Q7ZHI.js} +1 -1
- package/dist/{chunk-6BIDVPED.js → chunk-5JNA6LLY.js} +1 -1
- package/dist/{chunk-RD7RX52G.cjs → chunk-5UEFBM2M.cjs} +207 -18
- package/dist/{chunk-WA44NKPF.js → chunk-62Z5WLRA.js} +1 -1
- package/dist/{chunk-BVRRIW7F.js → chunk-6GRUVGKU.js} +3 -3
- package/dist/{chunk-QARCM66V.js → chunk-6ZZKRH7R.js} +3 -3
- package/dist/{chunk-BP6KSGVD.js → chunk-7272D3K2.js} +4 -6
- package/dist/{chunk-O75V4ZS3.js → chunk-7P6VF3FG.js} +2 -2
- package/dist/{chunk-AU6MWQKZ.js → chunk-ABL7IWFZ.js} +1 -1
- package/dist/{chunk-5RH3VXAK.js → chunk-APX63ILU.js} +4 -100
- package/dist/{chunk-W7L4HUT2.cjs → chunk-CJ6TBL2N.cjs} +16 -16
- package/dist/{chunk-7PT4RJL5.cjs → chunk-EUIDTZNQ.cjs} +111 -113
- package/dist/{chunk-CXXXAZ7H.js → chunk-F6R67I3A.js} +1 -1
- package/dist/{chunk-I7NJPHWV.cjs → chunk-FQPUF2W2.cjs} +35 -606
- package/dist/{chunk-D5KGAO4Z.js → chunk-GCVFEPJG.js} +2 -573
- package/dist/{chunk-LEQKZGQI.js → chunk-GOBOCZZI.js} +1 -1
- package/dist/{chunk-PZP2SZIZ.js → chunk-GYMMNCFT.js} +3 -3
- package/dist/{chunk-NUTMINJZ.cjs → chunk-H7ET2ISK.cjs} +52 -52
- package/dist/chunk-HS6QDWDF.cjs +1029 -0
- package/dist/{chunk-T7KQEMAE.cjs → chunk-HUAISCUX.cjs} +18 -18
- package/dist/{chunk-YGQVCQTG.js → chunk-ILP77UD6.js} +1 -1
- package/dist/{chunk-GHCSC2WP.cjs → chunk-ISIO63Q5.cjs} +21 -15
- package/dist/{chunk-S6OT6CTS.cjs → chunk-IWEVV63O.cjs} +31 -33
- package/dist/{chunk-OFH6Q67U.js → chunk-JA57JIT5.js} +9 -3
- package/dist/{chunk-LP2MCSBE.cjs → chunk-JFHBXNR2.cjs} +88 -88
- package/dist/{chunk-IOFVM3L3.cjs → chunk-JPEHXIB5.cjs} +10 -10
- package/dist/chunk-JSDND7DF.cjs +173 -0
- package/dist/{chunk-36ZTV7WO.js → chunk-L6Y7TSQ4.js} +1 -1
- package/dist/{chunk-KYX7NZ5V.cjs → chunk-LFMKWGFL.cjs} +1 -1
- package/dist/{chunk-V6DT2CDH.js → chunk-M2TPMYJE.js} +1 -1
- package/dist/{chunk-LJZRHVZV.cjs → chunk-M5GLQQWG.cjs} +2 -2
- package/dist/{chunk-JEGJP4OW.js → chunk-MHLU6GRJ.js} +196 -7
- package/dist/{chunk-KMPM5JM5.js → chunk-MONXNVZK.js} +4 -6
- package/dist/chunk-MTKY6K3Q.js +1029 -0
- package/dist/{chunk-MOW3JMNG.cjs → chunk-N76AMOKE.cjs} +42 -42
- package/dist/{chunk-75K3W4D6.cjs → chunk-NKGB64CW.cjs} +16 -16
- package/dist/{chunk-SGPIVHJB.js → chunk-P3K2JCJA.js} +3 -3
- package/dist/chunk-PXDIAYB6.cjs +594 -0
- package/dist/{chunk-UBRJOIR5.js → chunk-QC3OXRE4.js} +9 -9
- package/dist/{chunk-QOBCBGGI.cjs → chunk-QKXO6JPP.cjs} +14 -14
- package/dist/{chunk-WLJZZHUZ.cjs → chunk-QLSGTCYT.cjs} +23 -23
- package/dist/{chunk-7YW7T5TJ.js → chunk-RHPSE2YR.js} +2 -2
- package/dist/{chunk-44BMJJVA.cjs → chunk-RUONPPMC.cjs} +8 -8
- package/dist/{chunk-LJRCU3BJ.cjs → chunk-SABJMH6M.cjs} +150 -15
- package/dist/{chunk-XWOLPNBW.cjs → chunk-SOSBOS5T.cjs} +22 -22
- package/dist/chunk-SZTI6EER.js +13 -0
- package/dist/{chunk-PPFJHTW5.cjs → chunk-TFF2GTGN.cjs} +22 -24
- package/dist/{chunk-2SMMZDMG.cjs → chunk-TLOGFIIV.cjs} +37 -37
- package/dist/chunk-TXFWZ5ZJ.js +594 -0
- package/dist/chunk-U67EN7GG.cjs +13 -0
- package/dist/{chunk-GXAK6Q5J.js → chunk-UFEDHACQ.js} +2 -2
- package/dist/{chunk-GA4EU4P3.cjs → chunk-UXETV2NC.cjs} +4 -4
- package/dist/{chunk-N4DFDI73.js → chunk-WKMUBATU.js} +1 -1
- package/dist/{chunk-3R5P3DVY.cjs → chunk-WRZ6C4TU.cjs} +6 -6
- package/dist/{chunk-EJLRBS5Q.js → chunk-WZOGDKCQ.js} +137 -2
- package/dist/{chunk-6ADHGQ73.js → chunk-YBAPT7NL.js} +2 -4
- package/dist/{chunk-K5DS2JTA.cjs → chunk-Z3BRH4JK.cjs} +6 -6
- package/dist/{chunk-XNZFVYC2.cjs → chunk-ZBCT5MEA.cjs} +7 -7
- package/dist/color/index.cjs +4 -6
- package/dist/color/index.js +7 -9
- package/dist/effects/helpers.d.cts +6 -0
- package/dist/effects/helpers.d.ts +6 -0
- package/dist/effects/index.cjs +62 -60
- package/dist/effects/index.js +5 -3
- package/dist/effects/tools.d.cts +6 -0
- package/dist/effects/tools.d.ts +6 -0
- package/dist/export/index.cjs +7 -8
- package/dist/export/index.js +6 -7
- package/dist/extensions/index.cjs +10 -11
- package/dist/extensions/index.js +9 -10
- package/dist/gradient/index.cjs +33 -34
- package/dist/gradient/index.js +4 -5
- package/dist/image-editor/effects.d.cts +1 -1
- package/dist/image-editor/effects.d.ts +1 -1
- package/dist/image-editor/index.cjs +887 -863
- package/dist/image-editor/index.d.cts +1 -0
- package/dist/image-editor/index.d.ts +1 -0
- package/dist/image-editor/index.js +69 -45
- package/dist/image-editor/stickers.d.cts +9 -0
- package/dist/image-editor/stickers.d.ts +9 -0
- package/dist/index.cjs +16 -17
- package/dist/index.js +10 -11
- package/dist/paint/index.cjs +6 -4
- package/dist/paint/index.js +21 -19
- package/dist/paint-editor/brushes.d.cts +1 -2
- package/dist/paint-editor/brushes.d.ts +1 -2
- package/dist/paint-editor/index.cjs +2199 -699
- package/dist/paint-editor/index.js +1577 -77
- package/dist/paint-editor/mark-settings.d.cts +104 -0
- package/dist/paint-editor/mark-settings.d.ts +104 -0
- package/dist/paint-editor/procedural.d.cts +2 -75
- package/dist/paint-editor/procedural.d.ts +2 -75
- package/dist/paint-editor/stickers.d.cts +1 -22
- package/dist/paint-editor/stickers.d.ts +1 -22
- package/dist/raster/index.cjs +2 -2
- package/dist/raster/index.js +9 -9
- package/dist/stickers/index.cjs +22 -16
- package/dist/stickers/index.d.cts +1 -1
- package/dist/stickers/index.d.ts +1 -1
- package/dist/stickers/index.js +14 -8
- package/dist/stickers/tools.d.cts +57 -1
- package/dist/stickers/tools.d.ts +57 -1
- package/dist/tokens/index.cjs +3 -4
- package/dist/tokens/index.js +2 -3
- package/dist/typography/index.cjs +7 -8
- package/dist/typography/index.js +2 -3
- package/dist/vector/index.cjs +1011 -977
- package/dist/vector/index.d.cts +1 -0
- package/dist/vector/index.d.ts +1 -0
- package/dist/vector/index.js +47 -13
- package/dist/vector/stickers.d.cts +11 -0
- package/dist/vector/stickers.d.ts +11 -0
- package/dist/video-editor/index.cjs +349 -350
- package/dist/video-editor/index.js +9 -10
- package/package.json +11 -1
- package/skills/pixerate-image-editor/SKILL.md +1 -1
- package/skills/pixerate-stickers/SKILL.md +13 -1
- package/dist/chunk-7AHBW2CQ.cjs +0 -200
- package/dist/chunk-F67XMVDI.js +0 -200
- package/dist/chunk-H4AOUUBE.cjs +0 -2635
- package/dist/chunk-J7T5QZ45.js +0 -2635
- package/dist/chunk-ZEYMKDYS.cjs +0 -269
|
@@ -6,15 +6,15 @@ var _chunkA6QWKBJPcjs = require('./chunk-A6QWKBJP.cjs');
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunk5UEFBM2Mcjs = require('./chunk-5UEFBM2M.cjs');
|
|
10
10
|
|
|
11
11
|
// src/animation/color.ts
|
|
12
12
|
function rgbToOklab2(r, g, b, alpha = 1) {
|
|
13
|
-
const lab =
|
|
13
|
+
const lab = _chunk5UEFBM2Mcjs.rgbToOklab.call(void 0, { r, g, b, a: alpha });
|
|
14
14
|
return { l: lab.l, a: lab.a, b: lab.b, alpha: lab.alpha };
|
|
15
15
|
}
|
|
16
16
|
function oklabToRgb2(color) {
|
|
17
|
-
const c =
|
|
17
|
+
const c = _chunk5UEFBM2Mcjs.oklabToRgb.call(void 0, { l: color.l, a: color.a, b: color.b, alpha: color.alpha });
|
|
18
18
|
const clamp01 = (v) => Math.min(1, Math.max(0, v));
|
|
19
19
|
return {
|
|
20
20
|
r: clamp01(c.r),
|
|
@@ -74,7 +74,7 @@ function profileAlongPolyline(points, values, count = 32) {
|
|
|
74
74
|
var round3 = (v) => Math.round(v * 1e3) / 1e3;
|
|
75
75
|
var loading = null;
|
|
76
76
|
function loadCanvasBrushstrokeRenderer() {
|
|
77
|
-
loading ??= import("./brushstrokeRender-
|
|
77
|
+
loading ??= import("./brushstrokeRender-5PYSKZIJ.js").catch((error) => {
|
|
78
78
|
loading = null;
|
|
79
79
|
throw error;
|
|
80
80
|
});
|
|
@@ -5,7 +5,184 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkIPJ3TEYRcjs = require('./chunk-IPJ3TEYR.cjs');
|
|
9
|
+
|
|
10
|
+
// src/color/convert.ts
|
|
11
|
+
function srgbToLinear(v) {
|
|
12
|
+
const sign = Math.sign(v);
|
|
13
|
+
const abs = Math.abs(v);
|
|
14
|
+
return sign * (abs <= 0.04045 ? abs / 12.92 : ((abs + 0.055) / 1.055) ** 2.4);
|
|
15
|
+
}
|
|
16
|
+
function linearToSrgb(v) {
|
|
17
|
+
const sign = Math.sign(v);
|
|
18
|
+
const abs = Math.abs(v);
|
|
19
|
+
return sign * (abs <= 31308e-7 ? 12.92 * abs : 1.055 * abs ** (1 / 2.4) - 0.055);
|
|
20
|
+
}
|
|
21
|
+
function rgbToHsl(rgba) {
|
|
22
|
+
const { r, g, b, a } = rgba;
|
|
23
|
+
const max = Math.max(r, g, b);
|
|
24
|
+
const min = Math.min(r, g, b);
|
|
25
|
+
const d = max - min;
|
|
26
|
+
const l = (max + min) / 2;
|
|
27
|
+
let h = 0;
|
|
28
|
+
if (d > 0) {
|
|
29
|
+
if (max === r) h = 60 * ((g - b) / d % 6);
|
|
30
|
+
else if (max === g) h = 60 * ((b - r) / d + 2);
|
|
31
|
+
else h = 60 * ((r - g) / d + 4);
|
|
32
|
+
}
|
|
33
|
+
if (h < 0) h += 360;
|
|
34
|
+
const s = d === 0 ? 0 : d / (1 - Math.abs(2 * l - 1));
|
|
35
|
+
return { h, s, l, alpha: a };
|
|
36
|
+
}
|
|
37
|
+
function hslToRgb(hsla) {
|
|
38
|
+
const { h, s, l, alpha } = hsla;
|
|
39
|
+
const hh = (h % 360 + 360) % 360 / 60;
|
|
40
|
+
const c = (1 - Math.abs(2 * l - 1)) * s;
|
|
41
|
+
const x = c * (1 - Math.abs(hh % 2 - 1));
|
|
42
|
+
const m = l - c / 2;
|
|
43
|
+
let r = 0;
|
|
44
|
+
let g = 0;
|
|
45
|
+
let b = 0;
|
|
46
|
+
if (hh < 1) {
|
|
47
|
+
r = c;
|
|
48
|
+
g = x;
|
|
49
|
+
b = 0;
|
|
50
|
+
} else if (hh < 2) {
|
|
51
|
+
r = x;
|
|
52
|
+
g = c;
|
|
53
|
+
b = 0;
|
|
54
|
+
} else if (hh < 3) {
|
|
55
|
+
r = 0;
|
|
56
|
+
g = c;
|
|
57
|
+
b = x;
|
|
58
|
+
} else if (hh < 4) {
|
|
59
|
+
r = 0;
|
|
60
|
+
g = x;
|
|
61
|
+
b = c;
|
|
62
|
+
} else if (hh < 5) {
|
|
63
|
+
r = x;
|
|
64
|
+
g = 0;
|
|
65
|
+
b = c;
|
|
66
|
+
} else {
|
|
67
|
+
r = c;
|
|
68
|
+
g = 0;
|
|
69
|
+
b = x;
|
|
70
|
+
}
|
|
71
|
+
return { r: r + m, g: g + m, b: b + m, a: alpha };
|
|
72
|
+
}
|
|
73
|
+
function rgbToHsv(rgba) {
|
|
74
|
+
const { r, g, b, a } = rgba;
|
|
75
|
+
const max = Math.max(r, g, b);
|
|
76
|
+
const min = Math.min(r, g, b);
|
|
77
|
+
const d = max - min;
|
|
78
|
+
let h = 0;
|
|
79
|
+
if (d > 0) {
|
|
80
|
+
if (max === r) h = 60 * ((g - b) / d % 6);
|
|
81
|
+
else if (max === g) h = 60 * ((b - r) / d + 2);
|
|
82
|
+
else h = 60 * ((r - g) / d + 4);
|
|
83
|
+
}
|
|
84
|
+
if (h < 0) h += 360;
|
|
85
|
+
const s = max === 0 ? 0 : d / max;
|
|
86
|
+
return { h, s, v: max, alpha: a };
|
|
87
|
+
}
|
|
88
|
+
function hsvToRgb(hsva) {
|
|
89
|
+
const { h, s, v, alpha } = hsva;
|
|
90
|
+
const hh = (h % 360 + 360) % 360 / 60;
|
|
91
|
+
const c = v * s;
|
|
92
|
+
const x = c * (1 - Math.abs(hh % 2 - 1));
|
|
93
|
+
const m = v - c;
|
|
94
|
+
let r = 0;
|
|
95
|
+
let g = 0;
|
|
96
|
+
let b = 0;
|
|
97
|
+
if (hh < 1) {
|
|
98
|
+
r = c;
|
|
99
|
+
g = x;
|
|
100
|
+
b = 0;
|
|
101
|
+
} else if (hh < 2) {
|
|
102
|
+
r = x;
|
|
103
|
+
g = c;
|
|
104
|
+
b = 0;
|
|
105
|
+
} else if (hh < 3) {
|
|
106
|
+
r = 0;
|
|
107
|
+
g = c;
|
|
108
|
+
b = x;
|
|
109
|
+
} else if (hh < 4) {
|
|
110
|
+
r = 0;
|
|
111
|
+
g = x;
|
|
112
|
+
b = c;
|
|
113
|
+
} else if (hh < 5) {
|
|
114
|
+
r = x;
|
|
115
|
+
g = 0;
|
|
116
|
+
b = c;
|
|
117
|
+
} else {
|
|
118
|
+
r = c;
|
|
119
|
+
g = 0;
|
|
120
|
+
b = x;
|
|
121
|
+
}
|
|
122
|
+
return { r: r + m, g: g + m, b: b + m, a: alpha };
|
|
123
|
+
}
|
|
124
|
+
function rgbToOklab(rgba) {
|
|
125
|
+
const lr = srgbToLinear(rgba.r);
|
|
126
|
+
const lg = srgbToLinear(rgba.g);
|
|
127
|
+
const lb = srgbToLinear(rgba.b);
|
|
128
|
+
const l = Math.cbrt(0.4122214708 * lr + 0.5363325363 * lg + 0.0514459929 * lb);
|
|
129
|
+
const m = Math.cbrt(0.2119034982 * lr + 0.6806995451 * lg + 0.1073969566 * lb);
|
|
130
|
+
const s = Math.cbrt(0.0883024619 * lr + 0.2817188376 * lg + 0.6299787005 * lb);
|
|
131
|
+
return {
|
|
132
|
+
l: 0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s,
|
|
133
|
+
a: 1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s,
|
|
134
|
+
b: 0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s,
|
|
135
|
+
alpha: rgba.a
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
function oklabToRgb(lab) {
|
|
139
|
+
const l_ = lab.l + 0.3963377774 * lab.a + 0.2158037573 * lab.b;
|
|
140
|
+
const m_ = lab.l - 0.1055613458 * lab.a - 0.0638541728 * lab.b;
|
|
141
|
+
const s_ = lab.l - 0.0894841775 * lab.a - 1.291485548 * lab.b;
|
|
142
|
+
const l = l_ ** 3;
|
|
143
|
+
const m = m_ ** 3;
|
|
144
|
+
const s = s_ ** 3;
|
|
145
|
+
return {
|
|
146
|
+
r: linearToSrgb(4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s),
|
|
147
|
+
g: linearToSrgb(-1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s),
|
|
148
|
+
b: linearToSrgb(-0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s),
|
|
149
|
+
a: lab.alpha
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
function oklabToOklch(lab) {
|
|
153
|
+
const c = Math.hypot(lab.a, lab.b);
|
|
154
|
+
let h = 0;
|
|
155
|
+
if (c >= 1e-6) {
|
|
156
|
+
h = Math.atan2(lab.b, lab.a) * 180 / Math.PI;
|
|
157
|
+
if (h < 0) h += 360;
|
|
158
|
+
if (h >= 360) h -= 360;
|
|
159
|
+
}
|
|
160
|
+
return { l: lab.l, c, h, alpha: lab.alpha };
|
|
161
|
+
}
|
|
162
|
+
function oklchToOklab(lch) {
|
|
163
|
+
const rad = lch.h * Math.PI / 180;
|
|
164
|
+
return {
|
|
165
|
+
l: lch.l,
|
|
166
|
+
a: lch.c * Math.cos(rad),
|
|
167
|
+
b: lch.c * Math.sin(rad),
|
|
168
|
+
alpha: lch.alpha
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
var D65_XYZ = _chunkIPJ3TEYRcjs.xyToXyz.call(void 0, _chunkIPJ3TEYRcjs.D65_XY);
|
|
172
|
+
var SRGB_TO_XYZ = _chunkIPJ3TEYRcjs.rgbToXyzMatrix.call(void 0, [0.64, 0.33], [0.3, 0.6], [0.15, 0.06], D65_XYZ);
|
|
173
|
+
var P3_TO_XYZ = _chunkIPJ3TEYRcjs.rgbToXyzMatrix.call(void 0, [0.68, 0.32], [0.265, 0.69], [0.15, 0.06], D65_XYZ);
|
|
174
|
+
var XYZ_TO_SRGB = _chunkIPJ3TEYRcjs.invert.call(void 0, SRGB_TO_XYZ);
|
|
175
|
+
var XYZ_TO_P3 = _chunkIPJ3TEYRcjs.invert.call(void 0, P3_TO_XYZ);
|
|
176
|
+
var P3_TO_SRGB_MAT = _chunkIPJ3TEYRcjs.mul.call(void 0, XYZ_TO_SRGB, P3_TO_XYZ);
|
|
177
|
+
var SRGB_TO_P3_MAT = _chunkIPJ3TEYRcjs.mul.call(void 0, XYZ_TO_P3, SRGB_TO_XYZ);
|
|
178
|
+
function linearSrgbToDisplayP3(rgb) {
|
|
179
|
+
const out = _chunkIPJ3TEYRcjs.apply.call(void 0, SRGB_TO_P3_MAT, [rgb.r, rgb.g, rgb.b]);
|
|
180
|
+
return { r: out[0], g: out[1], b: out[2], a: rgb.a };
|
|
181
|
+
}
|
|
182
|
+
function displayP3ToLinearSrgb(rgb) {
|
|
183
|
+
const out = _chunkIPJ3TEYRcjs.apply.call(void 0, P3_TO_SRGB_MAT, [rgb.r, rgb.g, rgb.b]);
|
|
184
|
+
return { r: out[0], g: out[1], b: out[2], a: rgb.a };
|
|
185
|
+
}
|
|
9
186
|
|
|
10
187
|
// src/color/named.ts
|
|
11
188
|
var NAMED_COLORS = {
|
|
@@ -253,7 +430,7 @@ function parseColor(input) {
|
|
|
253
430
|
const s = parsePercentOrNumber(parts[1], 100);
|
|
254
431
|
const l = parsePercentOrNumber(parts[2], 100);
|
|
255
432
|
if (h === null || s === null || l === null) return null;
|
|
256
|
-
return
|
|
433
|
+
return hslToRgb({ h, s, l, alpha: alphaVal });
|
|
257
434
|
}
|
|
258
435
|
const oklabMatch = OKLAB_RE.exec(text);
|
|
259
436
|
if (oklabMatch) {
|
|
@@ -269,7 +446,7 @@ function parseColor(input) {
|
|
|
269
446
|
const a = parsePercentOrNumber(parts[1], 1);
|
|
270
447
|
const b = parsePercentOrNumber(parts[2], 1);
|
|
271
448
|
if (l === null || a === null || b === null) return null;
|
|
272
|
-
return
|
|
449
|
+
return oklabToRgb({ l, a, b, alpha: alphaVal });
|
|
273
450
|
}
|
|
274
451
|
const oklchMatch = OKLCH_RE.exec(text);
|
|
275
452
|
if (oklchMatch) {
|
|
@@ -285,7 +462,7 @@ function parseColor(input) {
|
|
|
285
462
|
const c = parsePercentOrNumber(parts[1], 1);
|
|
286
463
|
const h = parseAngle(parts[2]);
|
|
287
464
|
if (l === null || c === null || h === null) return null;
|
|
288
|
-
return
|
|
465
|
+
return oklabToRgb(oklchToOklab({ l, c, h, alpha: alphaVal }));
|
|
289
466
|
}
|
|
290
467
|
const colorMatch = COLOR_FN_RE.exec(text);
|
|
291
468
|
if (colorMatch) {
|
|
@@ -308,21 +485,21 @@ function parseColor(input) {
|
|
|
308
485
|
}
|
|
309
486
|
if (space === "srgb-linear") {
|
|
310
487
|
return {
|
|
311
|
-
r:
|
|
312
|
-
g:
|
|
313
|
-
b:
|
|
488
|
+
r: linearToSrgb(c1),
|
|
489
|
+
g: linearToSrgb(c2),
|
|
490
|
+
b: linearToSrgb(c3),
|
|
314
491
|
a: alphaVal
|
|
315
492
|
};
|
|
316
493
|
}
|
|
317
494
|
if (space === "display-p3") {
|
|
318
|
-
const linP3R =
|
|
319
|
-
const linP3G =
|
|
320
|
-
const linP3B =
|
|
321
|
-
const linSrgb =
|
|
495
|
+
const linP3R = srgbToLinear(c1);
|
|
496
|
+
const linP3G = srgbToLinear(c2);
|
|
497
|
+
const linP3B = srgbToLinear(c3);
|
|
498
|
+
const linSrgb = displayP3ToLinearSrgb({ r: linP3R, g: linP3G, b: linP3B, a: alphaVal });
|
|
322
499
|
return {
|
|
323
|
-
r:
|
|
324
|
-
g:
|
|
325
|
-
b:
|
|
500
|
+
r: linearToSrgb(linSrgb.r),
|
|
501
|
+
g: linearToSrgb(linSrgb.g),
|
|
502
|
+
b: linearToSrgb(linSrgb.b),
|
|
326
503
|
a: alphaVal
|
|
327
504
|
};
|
|
328
505
|
}
|
|
@@ -388,9 +565,9 @@ function composite(fg, bg) {
|
|
|
388
565
|
};
|
|
389
566
|
}
|
|
390
567
|
function relativeLuminance(c) {
|
|
391
|
-
const r =
|
|
392
|
-
const g =
|
|
393
|
-
const b =
|
|
568
|
+
const r = srgbToLinear(c.r);
|
|
569
|
+
const g = srgbToLinear(c.g);
|
|
570
|
+
const b = srgbToLinear(c.b);
|
|
394
571
|
return 0.2126 * r + 0.7152 * g + 0.0722 * b;
|
|
395
572
|
}
|
|
396
573
|
function contrastRatio(foreground, background) {
|
|
@@ -440,4 +617,16 @@ function readableTextColor(background, candidates = [BLACK, WHITE]) {
|
|
|
440
617
|
|
|
441
618
|
|
|
442
619
|
|
|
443
|
-
|
|
620
|
+
|
|
621
|
+
|
|
622
|
+
|
|
623
|
+
|
|
624
|
+
|
|
625
|
+
|
|
626
|
+
|
|
627
|
+
|
|
628
|
+
|
|
629
|
+
|
|
630
|
+
|
|
631
|
+
|
|
632
|
+
exports.srgbToLinear = srgbToLinear; exports.linearToSrgb = linearToSrgb; exports.rgbToHsl = rgbToHsl; exports.hslToRgb = hslToRgb; exports.rgbToHsv = rgbToHsv; exports.hsvToRgb = hsvToRgb; exports.rgbToOklab = rgbToOklab; exports.oklabToRgb = oklabToRgb; exports.oklabToOklch = oklabToOklch; exports.oklchToOklab = oklchToOklab; exports.linearSrgbToDisplayP3 = linearSrgbToDisplayP3; exports.displayP3ToLinearSrgb = displayP3ToLinearSrgb; exports.NAMED_COLORS = NAMED_COLORS; exports.parseColor = parseColor; exports.isColor = isColor; exports.relativeLuminance = relativeLuminance; exports.contrastRatio = contrastRatio; exports.contrastLevel = contrastLevel; exports.readableTextColor = readableTextColor;
|
|
@@ -5,14 +5,14 @@ import {
|
|
|
5
5
|
chartToMermaid,
|
|
6
6
|
describeChart,
|
|
7
7
|
layoutSparkline
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-RHPSE2YR.js";
|
|
9
9
|
import {
|
|
10
10
|
layoutChart
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-WKMUBATU.js";
|
|
12
12
|
import {
|
|
13
13
|
DEFAULT_CHART_THEME,
|
|
14
14
|
normalizeChartSpec
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-6ZZKRH7R.js";
|
|
16
16
|
import {
|
|
17
17
|
plainTextToSlice
|
|
18
18
|
} from "./chunk-2INPJDNY.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
simulateColorVision
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7272D3K2.js";
|
|
4
4
|
import {
|
|
5
5
|
deltaEOK
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-YBAPT7NL.js";
|
|
7
7
|
import {
|
|
8
8
|
rgbToOklab
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-MHLU6GRJ.js";
|
|
10
10
|
|
|
11
11
|
// src/chart/color.ts
|
|
12
12
|
var NAMED = {
|
|
@@ -6,25 +6,23 @@ import {
|
|
|
6
6
|
normalizeColor,
|
|
7
7
|
suggestAccessibleForeground,
|
|
8
8
|
toSrgbGamut
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-YBAPT7NL.js";
|
|
10
10
|
import {
|
|
11
11
|
contrastLevel,
|
|
12
12
|
contrastRatio,
|
|
13
|
-
parseColor,
|
|
14
|
-
relativeLuminance
|
|
15
|
-
} from "./chunk-JEGJP4OW.js";
|
|
16
|
-
import {
|
|
17
13
|
hslToRgb,
|
|
18
14
|
hsvToRgb,
|
|
19
15
|
linearToSrgb,
|
|
20
16
|
oklabToOklch,
|
|
21
17
|
oklabToRgb,
|
|
22
18
|
oklchToOklab,
|
|
19
|
+
parseColor,
|
|
20
|
+
relativeLuminance,
|
|
23
21
|
rgbToHsl,
|
|
24
22
|
rgbToHsv,
|
|
25
23
|
rgbToOklab,
|
|
26
24
|
srgbToLinear
|
|
27
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-MHLU6GRJ.js";
|
|
28
26
|
|
|
29
27
|
// src/color/vision.ts
|
|
30
28
|
var CVD = {
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
unionBounds,
|
|
19
19
|
vectorGradientPoints,
|
|
20
20
|
widthProfileAt
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-GYMMNCFT.js";
|
|
22
22
|
import {
|
|
23
23
|
segmentLength,
|
|
24
24
|
segmentParamAtLength,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
} from "./chunk-5UJHB3BW.js";
|
|
30
30
|
import {
|
|
31
31
|
mixColorsOklab
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-M2TPMYJE.js";
|
|
33
33
|
|
|
34
34
|
// src/vector/blend.ts
|
|
35
35
|
var lerpN = (a, b, t) => a + (b - a) * t;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
StickerError
|
|
3
|
+
} from "./chunk-SZTI6EER.js";
|
|
1
4
|
import {
|
|
2
5
|
hash2
|
|
3
6
|
} from "./chunk-4D6KP5BV.js";
|
|
@@ -58,16 +61,6 @@ function stampCoverage(kind, u, v, t) {
|
|
|
58
61
|
}
|
|
59
62
|
}
|
|
60
63
|
|
|
61
|
-
// src/stickers/errors.ts
|
|
62
|
-
var StickerError = class extends Error {
|
|
63
|
-
constructor(code, message) {
|
|
64
|
-
super(message);
|
|
65
|
-
this.code = code;
|
|
66
|
-
this.name = "StickerError";
|
|
67
|
-
}
|
|
68
|
-
code;
|
|
69
|
-
};
|
|
70
|
-
|
|
71
64
|
// src/stickers/helpers.ts
|
|
72
65
|
var DEFAULT_STICKER_PAGE = 24;
|
|
73
66
|
var MAX_STICKER_PAGE = 100;
|
|
@@ -162,94 +155,9 @@ var StickersSlot = class {
|
|
|
162
155
|
}
|
|
163
156
|
};
|
|
164
157
|
|
|
165
|
-
// src/stickers/tools.ts
|
|
166
|
-
var READ = { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false };
|
|
167
|
-
function stickerForAgent(provider, s) {
|
|
168
|
-
const { id, thumbnail: _thumbnail, ...rest } = s;
|
|
169
|
-
return { ref: stickerRefOf(provider, id), ...rest };
|
|
170
|
-
}
|
|
171
|
-
async function knownRefs(provider, cap = 500) {
|
|
172
|
-
const refs = [];
|
|
173
|
-
let after;
|
|
174
|
-
while (refs.length < cap) {
|
|
175
|
-
const page = await provider.list({ limit: MAX_STICKER_PAGE, ...after ? { after } : {} });
|
|
176
|
-
refs.push(...page.items.map((s) => stickerRefOf(provider, s.id)));
|
|
177
|
-
if (!page.next || !page.items.length) break;
|
|
178
|
-
after = page.next;
|
|
179
|
-
}
|
|
180
|
-
return refs;
|
|
181
|
-
}
|
|
182
|
-
async function describeStickerRef(provider, ref) {
|
|
183
|
-
parseStickerRef(ref);
|
|
184
|
-
const id = stickerIdFor(provider, ref);
|
|
185
|
-
const found = id === null ? void 0 : await provider.describe(id);
|
|
186
|
-
if (found) return found;
|
|
187
|
-
const near = closestStickerRefs(ref, await knownRefs(provider));
|
|
188
|
-
const owner = parseStickerRef(ref).provider;
|
|
189
|
-
const where = id === null && !provider.namespaced ? ` The sticker library is "${provider.id}", not "${owner}".` : "";
|
|
190
|
-
throw new StickerError("unknown_sticker", `No sticker "${ref}".${where} Closest: ${near.join(", ") || "none"}; find_stickers lists them.`);
|
|
191
|
-
}
|
|
192
|
-
function createStickerTools(options) {
|
|
193
|
-
const find = {
|
|
194
|
-
name: "find_stickers",
|
|
195
|
-
title: "Find stickers",
|
|
196
|
-
description: "Searches the sticker library (the editor's own stamps unless the host plugged in its own): words in the name, tags, category or description, filtered by category, tags and commercial licence, a small page at a time. Returns each sticker's ref (provider:id, for the tools that spray or place stickers), name, category, tags, natural width and height, formats, whether it is tintable (recoloured to the paint colour) and its licence, plus total and next (pass as after for the next page) and the categories. Changes nothing.",
|
|
197
|
-
inputSchema: {
|
|
198
|
-
type: "object",
|
|
199
|
-
properties: {
|
|
200
|
-
query: { type: "string", maxLength: 200, description: "Words to match (default: list everything)." },
|
|
201
|
-
category: { type: "string", description: "Only this category (the result lists them)." },
|
|
202
|
-
tags: { type: "array", maxItems: 10, items: { type: "string", description: "A tag." }, description: "Only stickers with every one of these tags." },
|
|
203
|
-
commercial: { type: "boolean", description: "true: only stickers whose licence allows commercial use." },
|
|
204
|
-
limit: { type: "integer", minimum: 1, maximum: MAX_STICKER_PAGE, description: "Page size (default 24)." },
|
|
205
|
-
after: { type: "string", description: "next from the previous page." }
|
|
206
|
-
},
|
|
207
|
-
additionalProperties: false
|
|
208
|
-
},
|
|
209
|
-
annotations: { title: "Find stickers", ...READ },
|
|
210
|
-
handler: async ({ query, category, tags, commercial, limit, after }) => {
|
|
211
|
-
const p = options.provider();
|
|
212
|
-
const categories = await p.categories?.() ?? null;
|
|
213
|
-
if (category !== void 0 && categories && !categories.some((c) => c.id === category)) {
|
|
214
|
-
throw new StickerError("invalid_argument", `No category "${category}" in "${p.name}"; categories: ${categories.map((c) => c.id).join(", ")}.`);
|
|
215
|
-
}
|
|
216
|
-
const o = { ...category !== void 0 ? { category } : {}, ...tags ? { tags } : {}, ...commercial ? { licence: { commercial: true } } : {}, ...limit !== void 0 ? { limit } : {}, ...after !== void 0 ? { after } : {} };
|
|
217
|
-
const q = typeof query === "string" ? query.trim() : "";
|
|
218
|
-
if (q && !p.capabilities.supportsSearch) throw new StickerError("invalid_argument", `"${p.name}" can't search; leave query out and filter by category instead.`);
|
|
219
|
-
const page = q ? await p.search(q, o) : await p.list(o);
|
|
220
|
-
return { provider: p.id, items: page.items.map((s) => stickerForAgent(p, s)), total: page.total, ...page.next ? { next: page.next } : {}, ...categories ? { categories } : {} };
|
|
221
|
-
}
|
|
222
|
-
};
|
|
223
|
-
const describe = {
|
|
224
|
-
name: "describe_sticker",
|
|
225
|
-
title: "Describe a sticker",
|
|
226
|
-
description: "Everything about one sticker by ref (from find_stickers): name, category, tags, natural size, formats, tintable, licence (with any attribution it asks for), dominant colours, variants and its outline as SVG path data (silhouette). An unknown ref is refused with the closest refs. Changes nothing.",
|
|
227
|
-
inputSchema: { type: "object", properties: { ref: { type: "string", description: "Sticker ref provider:id from find_stickers (e.g. editor:star)." } }, required: ["ref"], additionalProperties: false },
|
|
228
|
-
annotations: { title: "Describe a sticker", ...READ },
|
|
229
|
-
handler: async ({ ref }) => {
|
|
230
|
-
const p = options.provider();
|
|
231
|
-
const d = await describeStickerRef(p, ref);
|
|
232
|
-
const { thumbnail: _thumbnail, id, ...rest } = d;
|
|
233
|
-
return { ref: stickerRefOf(p, id), ...rest };
|
|
234
|
-
}
|
|
235
|
-
};
|
|
236
|
-
return [find, describe];
|
|
237
|
-
}
|
|
238
|
-
function createStickerToolProvider(options) {
|
|
239
|
-
return {
|
|
240
|
-
id: options.id ?? "stickers",
|
|
241
|
-
namespace: options.namespace,
|
|
242
|
-
title: "Stickers",
|
|
243
|
-
description: "Find and describe stickers from the sticker library, by ref (provider:id), for the editors that spray or place them.",
|
|
244
|
-
skill: "pixerate-stickers",
|
|
245
|
-
tools: createStickerTools(options)
|
|
246
|
-
};
|
|
247
|
-
}
|
|
248
|
-
|
|
249
158
|
export {
|
|
250
159
|
STAMP_KINDS,
|
|
251
160
|
stampCoverage,
|
|
252
|
-
StickerError,
|
|
253
161
|
DEFAULT_STICKER_PAGE,
|
|
254
162
|
MAX_STICKER_PAGE,
|
|
255
163
|
EDITOR_STICKERS_ID,
|
|
@@ -261,9 +169,5 @@ export {
|
|
|
261
169
|
stickerRefOf,
|
|
262
170
|
stickerIdFor,
|
|
263
171
|
closestStickerRefs,
|
|
264
|
-
StickersSlot
|
|
265
|
-
stickerForAgent,
|
|
266
|
-
describeStickerRef,
|
|
267
|
-
createStickerTools,
|
|
268
|
-
createStickerToolProvider
|
|
172
|
+
StickersSlot
|
|
269
173
|
};
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunk3NS5C7FBcjs = require('./chunk-3NS5C7FB.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkN76AMOKEcjs = require('./chunk-N76AMOKE.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkWRZ6C4TUcjs = require('./chunk-WRZ6C4TU.cjs');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
var _chunkG43MNQ4Ccjs = require('./chunk-G43MNQ4C.cjs');
|
|
@@ -1457,7 +1457,7 @@ var ChartNodeView = (_class = class {
|
|
|
1457
1457
|
this.dom.contentEditable = "false";
|
|
1458
1458
|
this.syncAttributes();
|
|
1459
1459
|
this.key = specKey(this.node.attrs.spec);
|
|
1460
|
-
this.controller = new (0,
|
|
1460
|
+
this.controller = new (0, _chunk3NS5C7FBcjs.ChartController)({ spec: this.node.attrs.spec });
|
|
1461
1461
|
this.unsubscribe = this.controller.subscribe((state) => {
|
|
1462
1462
|
if (!state.gesture) this.writeBack();
|
|
1463
1463
|
});
|
|
@@ -1690,7 +1690,7 @@ function readSpec(value) {
|
|
|
1690
1690
|
}
|
|
1691
1691
|
}
|
|
1692
1692
|
if (!input || typeof input !== "object" || Array.isArray(input)) return null;
|
|
1693
|
-
return
|
|
1693
|
+
return _chunkWRZ6C4TUcjs.normalizeChartSpec.call(void 0, input).spec;
|
|
1694
1694
|
}
|
|
1695
1695
|
var readSize = (value) => {
|
|
1696
1696
|
const n = value === null ? NaN : Number(value);
|
|
@@ -1716,10 +1716,10 @@ function staticChartSvg(node, options) {
|
|
|
1716
1716
|
const spec = node.attrs.spec;
|
|
1717
1717
|
const width = _nullishCoalesce(node.attrs.width, () => ( options.defaultWidth));
|
|
1718
1718
|
const height = _nullishCoalesce(node.attrs.height, () => ( options.defaultHeight));
|
|
1719
|
-
const scene =
|
|
1720
|
-
return
|
|
1719
|
+
const scene = _chunkN76AMOKEcjs.layoutChart.call(void 0, spec, { width, height, theme: options.theme, selection: null });
|
|
1720
|
+
return _chunk3NS5C7FBcjs.chartSceneToDomSpec.call(void 0, scene, {
|
|
1721
1721
|
ariaLabel: spec.title || "Chart",
|
|
1722
|
-
description:
|
|
1722
|
+
description: _chunk3NS5C7FBcjs.describeChart.call(void 0, spec),
|
|
1723
1723
|
attrs: { style: "max-width: 100%; height: auto; display: block" }
|
|
1724
1724
|
});
|
|
1725
1725
|
}
|
|
@@ -1735,7 +1735,7 @@ var Chart = _core.Node.create({
|
|
|
1735
1735
|
return {
|
|
1736
1736
|
HTMLAttributes: {},
|
|
1737
1737
|
nodeView: null,
|
|
1738
|
-
theme:
|
|
1738
|
+
theme: _chunkWRZ6C4TUcjs.DEFAULT_CHART_THEME,
|
|
1739
1739
|
defaultWidth: 640,
|
|
1740
1740
|
defaultHeight: 320,
|
|
1741
1741
|
generateId: () => generateStructureId("chart")
|
|
@@ -1749,7 +1749,7 @@ var Chart = _core.Node.create({
|
|
|
1749
1749
|
renderHTML: (attributes) => attributes.id ? { "data-chart-id": attributes.id } : {}
|
|
1750
1750
|
},
|
|
1751
1751
|
spec: {
|
|
1752
|
-
default:
|
|
1752
|
+
default: _chunkWRZ6C4TUcjs.normalizeChartSpec.call(void 0, {}).spec,
|
|
1753
1753
|
// null (no `data-chart`) keeps what the parse rule found, e.g. a mermaid block's spec.
|
|
1754
1754
|
parseHTML: (element) => readSpec(element.getAttribute("data-chart")),
|
|
1755
1755
|
renderHTML: (attributes) => ({
|
|
@@ -1787,7 +1787,7 @@ var Chart = _core.Node.create({
|
|
|
1787
1787
|
const code = element.querySelector("code");
|
|
1788
1788
|
const language = _nullishCoalesce(_nullishCoalesce(_optionalChain([code, 'optionalAccess', _47 => _47.getAttribute, 'call', _48 => _48("class")]), () => ( element.getAttribute("data-language"))), () => ( ""));
|
|
1789
1789
|
if (!/(?:^|\s)language-mermaid(?:\s|$)/.test(language) && language !== "mermaid") return false;
|
|
1790
|
-
const result =
|
|
1790
|
+
const result = _chunk3NS5C7FBcjs.chartFromMermaid.call(void 0, _nullishCoalesce((_nullishCoalesce(code, () => ( element))).textContent, () => ( "")));
|
|
1791
1791
|
return result.family ? { spec: result.spec } : false;
|
|
1792
1792
|
}
|
|
1793
1793
|
}
|
|
@@ -1811,7 +1811,7 @@ var Chart = _core.Node.create({
|
|
|
1811
1811
|
return {
|
|
1812
1812
|
markdown: {
|
|
1813
1813
|
serialize(state, node) {
|
|
1814
|
-
const text =
|
|
1814
|
+
const text = _chunk3NS5C7FBcjs.chartToMermaid.call(void 0, node.attrs.spec);
|
|
1815
1815
|
const fence = "`".repeat(Math.max(3, longestBacktickRun(text) + 1));
|
|
1816
1816
|
state.write(`${fence}mermaid
|
|
1817
1817
|
`);
|
|
@@ -1833,7 +1833,7 @@ var Chart = _core.Node.create({
|
|
|
1833
1833
|
type: this.name,
|
|
1834
1834
|
attrs: {
|
|
1835
1835
|
id: _nullishCoalesce(options.id, () => ( this.options.generateId())),
|
|
1836
|
-
spec:
|
|
1836
|
+
spec: _chunkWRZ6C4TUcjs.normalizeChartSpec.call(void 0, _nullishCoalesce(options.spec, () => ( {}))).spec,
|
|
1837
1837
|
width: _nullishCoalesce(options.width, () => ( null)),
|
|
1838
1838
|
height: _nullishCoalesce(options.height, () => ( this.options.defaultHeight))
|
|
1839
1839
|
}
|
|
@@ -1844,7 +1844,7 @@ var Chart = _core.Node.create({
|
|
|
1844
1844
|
if (dispatch) {
|
|
1845
1845
|
tr.setNodeMarkup(chart.pos, void 0, {
|
|
1846
1846
|
...chart.node.attrs,
|
|
1847
|
-
...changes.spec !== void 0 ? { spec:
|
|
1847
|
+
...changes.spec !== void 0 ? { spec: _chunkWRZ6C4TUcjs.normalizeChartSpec.call(void 0, changes.spec).spec } : {},
|
|
1848
1848
|
...changes.width !== void 0 ? { width: changes.width } : {},
|
|
1849
1849
|
...changes.height !== void 0 ? { height: changes.height } : {}
|
|
1850
1850
|
});
|
|
@@ -1951,14 +1951,14 @@ var Sparkline = _core.Node.create({
|
|
|
1951
1951
|
return [{ tag: 'span[data-type="sparkline"]', priority: 60 }];
|
|
1952
1952
|
},
|
|
1953
1953
|
renderHTML({ node, HTMLAttributes }) {
|
|
1954
|
-
const scene =
|
|
1954
|
+
const scene = _chunk3NS5C7FBcjs.layoutSparkline.call(void 0, node.attrs.values, {
|
|
1955
1955
|
kind: node.attrs.kind,
|
|
1956
1956
|
width: node.attrs.width,
|
|
1957
1957
|
height: node.attrs.height,
|
|
1958
1958
|
color: _nullishCoalesce(node.attrs.color, () => ( this.options.color)),
|
|
1959
1959
|
negativeColor: this.options.negativeColor
|
|
1960
1960
|
});
|
|
1961
|
-
const svg =
|
|
1961
|
+
const svg = _chunk3NS5C7FBcjs.chartSceneToDomSpec.call(void 0, scene, {
|
|
1962
1962
|
ariaLabel: sparklineLabel(node),
|
|
1963
1963
|
attrs: { style: "display: inline-block; vertical-align: middle" }
|
|
1964
1964
|
});
|