@pixerate/editor 0.161.0 → 0.162.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 +36 -35
- package/dist/agent/index.js +7 -6
- package/dist/animation/index.cjs +5 -4
- package/dist/animation/index.js +4 -3
- package/dist/animation-editor/index.cjs +62 -61
- package/dist/animation-editor/index.js +6 -5
- package/dist/canvas/index.cjs +33 -32
- package/dist/canvas/index.js +6 -5
- package/dist/chart/index.cjs +88 -87
- package/dist/chart/index.js +7 -6
- package/dist/{chunk-QMI5HZWA.cjs → chunk-236TKNUR.cjs} +3 -3
- package/dist/{chunk-6UPGM3JB.js → chunk-2TKHLX6H.js} +1 -1
- package/dist/{chunk-3YDQLQH2.cjs → chunk-32MMQYCQ.cjs} +81 -81
- package/dist/{chunk-MHEXLG3M.cjs → chunk-3GJH2MGH.cjs} +37 -37
- package/dist/{chunk-AKDWAWSY.cjs → chunk-3IHNXRUV.cjs} +45 -45
- package/dist/{chunk-TVO6W2Q6.cjs → chunk-4NGVHHJB.cjs} +17 -17
- package/dist/chunk-4VU4CP7R.js +769 -0
- package/dist/{chunk-DBIVICAO.js → chunk-7CKPUUN4.js} +1 -1
- package/dist/{chunk-57JLBGJ5.cjs → chunk-7YBDRJXT.cjs} +8 -8
- package/dist/{chunk-KY3FYKP3.js → chunk-BQWGN5WH.js} +1 -1
- package/dist/{chunk-LEUZ4FRC.cjs → chunk-CIPIESX4.cjs} +3 -3
- package/dist/chunk-CJE5MOIS.js +347 -0
- package/dist/{chunk-5QBRAIVK.js → chunk-CX6JLDFC.js} +3 -3
- package/dist/{chunk-R3QY7PPL.js → chunk-DTSTNRPH.js} +1 -1
- package/dist/{chunk-6LUYFHHN.cjs → chunk-EQ46F75O.cjs} +51 -51
- package/dist/{chunk-UKCJ43YL.cjs → chunk-ES3UEVUT.cjs} +130 -898
- package/dist/{chunk-UM3RPYC5.js → chunk-EVPZ5IKN.js} +1 -1
- package/dist/{chunk-XNQ5EFB4.cjs → chunk-EY22AY6R.cjs} +16 -16
- package/dist/chunk-FKUKJ3XA.cjs +347 -0
- package/dist/{chunk-YABNLNY7.js → chunk-GLMP22FT.js} +3 -3
- package/dist/{chunk-SUF6WRXR.cjs → chunk-GTELFJRE.cjs} +2 -2
- package/dist/{chunk-72BGL3I2.js → chunk-GWV4T5NZ.js} +1 -1
- package/dist/{chunk-AY65VQSU.js → chunk-H3OEM3Q2.js} +1 -1
- package/dist/{chunk-4YWAEV4W.cjs → chunk-HDGBM7EA.cjs} +26 -26
- package/dist/{chunk-H5XX4KHB.js → chunk-HLOKB7WW.js} +5 -3
- package/dist/{chunk-WNAAWLZ5.js → chunk-KGTF55R3.js} +2 -2
- package/dist/{chunk-WPPJH6X4.cjs → chunk-LL3H5XUH.cjs} +6 -4
- package/dist/{chunk-4T44CJ5K.cjs → chunk-NA4UVVJ4.cjs} +15 -15
- package/dist/{chunk-Q6PA362P.js → chunk-NO5QQDHZ.js} +2 -2
- package/dist/{chunk-AA34BA7G.js → chunk-QYZGBVNC.js} +30 -798
- package/dist/chunk-S6X2QRVU.cjs +769 -0
- package/dist/{chunk-SSCL7QQ4.js → chunk-XDCFJEU7.js} +2 -2
- package/dist/color/index.cjs +6 -2
- package/dist/color/index.d.cts +1 -0
- package/dist/color/index.d.ts +1 -0
- package/dist/color/index.js +28 -24
- package/dist/color/suggest.d.cts +12 -0
- package/dist/color/suggest.d.ts +12 -0
- package/dist/effects/index.cjs +37 -13
- package/dist/effects/index.js +29 -5
- package/dist/effects/ui.d.cts +20 -3
- package/dist/effects/ui.d.ts +20 -3
- package/dist/export/index.cjs +6 -5
- package/dist/export/index.js +5 -4
- package/dist/extensions/index.cjs +9 -8
- package/dist/extensions/index.js +8 -7
- package/dist/gradient/index.cjs +28 -26
- package/dist/gradient/index.js +7 -5
- package/dist/image-editor/index.cjs +638 -637
- package/dist/image-editor/index.js +5 -4
- package/dist/index.cjs +15 -14
- package/dist/index.js +9 -8
- package/dist/paint-editor/index.cjs +15 -14
- package/dist/paint-editor/index.js +5 -4
- package/dist/typography/accessibility.d.cts +44 -0
- package/dist/typography/accessibility.d.ts +44 -0
- package/dist/typography/catalog.d.cts +98 -0
- package/dist/typography/catalog.d.ts +98 -0
- package/dist/typography/index.cjs +1099 -0
- package/dist/typography/index.d.cts +16 -0
- package/dist/typography/index.d.ts +16 -0
- package/dist/typography/index.js +1099 -0
- package/dist/typography/metrics.d.cts +31 -0
- package/dist/typography/metrics.d.ts +31 -0
- package/dist/typography/picker.d.cts +132 -0
- package/dist/typography/picker.d.ts +132 -0
- package/dist/typography/registry.d.cts +66 -0
- package/dist/typography/registry.d.ts +66 -0
- package/dist/typography/scale.d.cts +62 -0
- package/dist/typography/scale.d.ts +62 -0
- package/dist/typography/segment.d.cts +26 -0
- package/dist/typography/segment.d.ts +26 -0
- package/dist/typography/stack.d.cts +26 -0
- package/dist/typography/stack.d.ts +26 -0
- package/dist/typography/tools.d.cts +34 -0
- package/dist/typography/tools.d.ts +34 -0
- package/dist/typography/types.d.cts +96 -0
- package/dist/typography/types.d.ts +96 -0
- package/dist/typography/weight.d.cts +13 -0
- package/dist/typography/weight.d.ts +13 -0
- package/dist/vector/index.cjs +950 -949
- package/dist/vector/index.js +5 -4
- package/dist/video-editor/index.cjs +5 -4
- package/dist/video-editor/index.js +4 -3
- package/package.json +11 -1
- package/skills/README.md +1 -0
- package/skills/pixerate-typography/SKILL.md +91 -0
package/dist/extensions/index.js
CHANGED
|
@@ -95,7 +95,7 @@ import {
|
|
|
95
95
|
updateImageSrc,
|
|
96
96
|
validateFindPattern,
|
|
97
97
|
writeRichClipboard
|
|
98
|
-
} from "../chunk-
|
|
98
|
+
} from "../chunk-GLMP22FT.js";
|
|
99
99
|
import {
|
|
100
100
|
DEFAULT_STYLES,
|
|
101
101
|
NORMAL_STYLE_ID,
|
|
@@ -104,7 +104,7 @@ import {
|
|
|
104
104
|
isValidStyleId,
|
|
105
105
|
safeCSSValue
|
|
106
106
|
} from "../chunk-CXXKJBQZ.js";
|
|
107
|
-
import "../chunk-
|
|
107
|
+
import "../chunk-7CKPUUN4.js";
|
|
108
108
|
import "../chunk-V5OOP74P.js";
|
|
109
109
|
import {
|
|
110
110
|
ALLOW_NESTED_TABLES_META,
|
|
@@ -171,10 +171,10 @@ import {
|
|
|
171
171
|
tableNestingPluginKey,
|
|
172
172
|
typeAgentText,
|
|
173
173
|
unnestTables
|
|
174
|
-
} from "../chunk-
|
|
175
|
-
import "../chunk-
|
|
176
|
-
import "../chunk-
|
|
177
|
-
import "../chunk-
|
|
174
|
+
} from "../chunk-CX6JLDFC.js";
|
|
175
|
+
import "../chunk-XDCFJEU7.js";
|
|
176
|
+
import "../chunk-DTSTNRPH.js";
|
|
177
|
+
import "../chunk-HLOKB7WW.js";
|
|
178
178
|
import "../chunk-ZLZKGHSZ.js";
|
|
179
179
|
import "../chunk-2INPJDNY.js";
|
|
180
180
|
import "../chunk-RTRQ7XFI.js";
|
|
@@ -214,7 +214,8 @@ import "../chunk-CIQIM2IP.js";
|
|
|
214
214
|
import "../chunk-VDGBHYC7.js";
|
|
215
215
|
import "../chunk-HF5QZS7Z.js";
|
|
216
216
|
import "../chunk-RNSANXPT.js";
|
|
217
|
-
import "../chunk-
|
|
217
|
+
import "../chunk-QYZGBVNC.js";
|
|
218
|
+
import "../chunk-4VU4CP7R.js";
|
|
218
219
|
import "../chunk-6ONMQ6WF.js";
|
|
219
220
|
export {
|
|
220
221
|
ALLOW_NESTED_TABLES_META,
|
package/dist/gradient/index.cjs
CHANGED
|
@@ -7,11 +7,13 @@ var _chunkFJ2MSI43cjs = require('../chunk-FJ2MSI43.cjs');
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
+
var _chunkES3UEVUTcjs = require('../chunk-ES3UEVUT.cjs');
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
|
|
16
|
+
var _chunkS6X2QRVUcjs = require('../chunk-S6X2QRVU.cjs');
|
|
15
17
|
require('../chunk-IPJ3TEYR.cjs');
|
|
16
18
|
|
|
17
19
|
// src/gradient/model.ts
|
|
@@ -67,9 +69,9 @@ function normalizeGradient(input) {
|
|
|
67
69
|
const rawStop = s;
|
|
68
70
|
let normColor = null;
|
|
69
71
|
if (typeof rawStop.color === "string" || rawStop.color && typeof rawStop.color === "object") {
|
|
70
|
-
const dual =
|
|
72
|
+
const dual = _chunkES3UEVUTcjs.normalizeDualColor.call(void 0, rawStop.color);
|
|
71
73
|
if (dual) {
|
|
72
|
-
normColor =
|
|
74
|
+
normColor = _chunkES3UEVUTcjs.formatDualColor.call(void 0, dual);
|
|
73
75
|
}
|
|
74
76
|
}
|
|
75
77
|
if (!normColor) {
|
|
@@ -139,7 +141,7 @@ function createGradient(colorsOrOptions, options) {
|
|
|
139
141
|
const stops = resolvedColors.map((color, i) => ({
|
|
140
142
|
id: `s${i + 1}`,
|
|
141
143
|
offset: i / (resolvedColors.length - 1),
|
|
142
|
-
color:
|
|
144
|
+
color: _chunkES3UEVUTcjs.formatDualColor.call(void 0, _nullishCoalesce(_chunkES3UEVUTcjs.normalizeDualColor.call(void 0, color), () => ( { light: "#000000", dark: "#000000" })))
|
|
143
145
|
}));
|
|
144
146
|
const res2 = normalizeGradient({
|
|
145
147
|
...options,
|
|
@@ -191,7 +193,7 @@ function isDualColorValue(val) {
|
|
|
191
193
|
if (typeof val === "string") {
|
|
192
194
|
return val.trim().toLowerCase().startsWith("light-dark(");
|
|
193
195
|
}
|
|
194
|
-
if (
|
|
196
|
+
if (_chunkES3UEVUTcjs.isDualColor.call(void 0, val)) {
|
|
195
197
|
return val.light !== val.dark;
|
|
196
198
|
}
|
|
197
199
|
return false;
|
|
@@ -205,7 +207,7 @@ function resolveGradient(g, scheme) {
|
|
|
205
207
|
center: g.center ? { ...g.center } : void 0,
|
|
206
208
|
stops: g.stops.map((s) => ({
|
|
207
209
|
...s,
|
|
208
|
-
color: _nullishCoalesce(
|
|
210
|
+
color: _nullishCoalesce(_chunkES3UEVUTcjs.resolveColor.call(void 0, s.color, scheme), () => ( s.color))
|
|
209
211
|
}))
|
|
210
212
|
};
|
|
211
213
|
}
|
|
@@ -233,7 +235,7 @@ function sampleGradient(g, t, scheme = "light") {
|
|
|
233
235
|
if (s0.midpoint !== void 0) {
|
|
234
236
|
u = gradientMidpointRemap(u, s0.midpoint);
|
|
235
237
|
}
|
|
236
|
-
const mixed =
|
|
238
|
+
const mixed = _chunkES3UEVUTcjs.mixColors.call(void 0, s0.color, s1.color, u, { space: _nullishCoalesce(g.interpolation, () => ( "oklab")) });
|
|
237
239
|
return _nullishCoalesce(mixed, () => ( s0.color));
|
|
238
240
|
}
|
|
239
241
|
function insertGradientStop(g, offset, color) {
|
|
@@ -572,12 +574,12 @@ ${stopsXml.join("\n")}
|
|
|
572
574
|
</linearGradient>`;
|
|
573
575
|
}
|
|
574
576
|
function checkGradient(g, options = {}) {
|
|
575
|
-
const dual = isDualGradient(g) ||
|
|
577
|
+
const dual = isDualGradient(g) || _chunkES3UEVUTcjs.isDualColor.call(void 0, options.surface) || _chunkES3UEVUTcjs.isDualColor.call(void 0, options.text);
|
|
576
578
|
if (dual) {
|
|
577
579
|
const lightG = resolveGradient(g, "light");
|
|
578
580
|
const darkG = resolveGradient(g, "dark");
|
|
579
|
-
const lightText = options.text ? _nullishCoalesce(
|
|
580
|
-
const darkText = options.text ? _nullishCoalesce(
|
|
581
|
+
const lightText = options.text ? _nullishCoalesce(_chunkES3UEVUTcjs.resolveColor.call(void 0, options.text, "light"), () => ( void 0)) : void 0;
|
|
582
|
+
const darkText = options.text ? _nullishCoalesce(_chunkES3UEVUTcjs.resolveColor.call(void 0, options.text, "dark"), () => ( void 0)) : void 0;
|
|
581
583
|
const checkScheme = (grad, txt, schemeName) => {
|
|
582
584
|
const issues2 = [];
|
|
583
585
|
for (let i = 0; i < grad.stops.length - 1; i++) {
|
|
@@ -585,10 +587,10 @@ function checkGradient(g, options = {}) {
|
|
|
585
587
|
if (gap < 5e-3) {
|
|
586
588
|
issues2.push(`[${schemeName}] Stops "${grad.stops[i].id}" and "${grad.stops[i + 1].id}" are too close (gap < 0.005).`);
|
|
587
589
|
}
|
|
588
|
-
const c1 =
|
|
589
|
-
const c2 =
|
|
590
|
+
const c1 = _chunkS6X2QRVUcjs.parseColor.call(void 0, grad.stops[i].color);
|
|
591
|
+
const c2 = _chunkS6X2QRVUcjs.parseColor.call(void 0, grad.stops[i + 1].color);
|
|
590
592
|
if (c1 && c2 && gap < 0.05) {
|
|
591
|
-
const dE =
|
|
593
|
+
const dE = _chunkS6X2QRVUcjs.deltaEOK.call(void 0, c1, c2);
|
|
592
594
|
if (dE > 0.5) {
|
|
593
595
|
issues2.push(
|
|
594
596
|
`[${schemeName}] Banding risk between stops "${grad.stops[i].id}" and "${grad.stops[i + 1].id}" (\u0394EOK = ${dE.toFixed(2)} across gap ${gap.toFixed(3)}).`
|
|
@@ -597,20 +599,20 @@ function checkGradient(g, options = {}) {
|
|
|
597
599
|
}
|
|
598
600
|
}
|
|
599
601
|
for (const s of grad.stops) {
|
|
600
|
-
const c =
|
|
601
|
-
if (c && !
|
|
602
|
+
const c = _chunkS6X2QRVUcjs.parseColor.call(void 0, s.color);
|
|
603
|
+
if (c && !_chunkS6X2QRVUcjs.inSrgbGamut.call(void 0, c)) {
|
|
602
604
|
issues2.push(`[${schemeName}] Stop "${s.id}" colour ${s.color} is outside standard sRGB gamut.`);
|
|
603
605
|
}
|
|
604
606
|
}
|
|
605
607
|
let lowest;
|
|
606
608
|
if (txt) {
|
|
607
|
-
const parsedTxt =
|
|
609
|
+
const parsedTxt = _chunkS6X2QRVUcjs.parseColor.call(void 0, txt);
|
|
608
610
|
if (parsedTxt) {
|
|
609
611
|
let minRatio = Infinity;
|
|
610
612
|
for (let step = 0; step <= 32; step++) {
|
|
611
|
-
const sample =
|
|
613
|
+
const sample = _chunkS6X2QRVUcjs.parseColor.call(void 0, sampleGradient(grad, step / 32, schemeName));
|
|
612
614
|
if (sample) {
|
|
613
|
-
const r =
|
|
615
|
+
const r = _chunkS6X2QRVUcjs.contrastRatio.call(void 0, parsedTxt, sample);
|
|
614
616
|
if (r < minRatio) minRatio = r;
|
|
615
617
|
}
|
|
616
618
|
}
|
|
@@ -632,10 +634,10 @@ function checkGradient(g, options = {}) {
|
|
|
632
634
|
if (gap < 5e-3) {
|
|
633
635
|
issues.push(`Stops "${g.stops[i].id}" and "${g.stops[i + 1].id}" are too close (gap < 0.005).`);
|
|
634
636
|
}
|
|
635
|
-
const c1 =
|
|
636
|
-
const c2 =
|
|
637
|
+
const c1 = _chunkS6X2QRVUcjs.parseColor.call(void 0, g.stops[i].color);
|
|
638
|
+
const c2 = _chunkS6X2QRVUcjs.parseColor.call(void 0, g.stops[i + 1].color);
|
|
637
639
|
if (c1 && c2 && gap < 0.05) {
|
|
638
|
-
const dE =
|
|
640
|
+
const dE = _chunkS6X2QRVUcjs.deltaEOK.call(void 0, c1, c2);
|
|
639
641
|
if (dE > 0.5) {
|
|
640
642
|
issues.push(
|
|
641
643
|
`Banding risk between stops "${g.stops[i].id}" and "${g.stops[i + 1].id}" (\u0394EOK = ${dE.toFixed(2)} across gap ${gap.toFixed(3)}).`
|
|
@@ -644,20 +646,20 @@ function checkGradient(g, options = {}) {
|
|
|
644
646
|
}
|
|
645
647
|
}
|
|
646
648
|
for (const s of g.stops) {
|
|
647
|
-
const c =
|
|
648
|
-
if (c && !
|
|
649
|
+
const c = _chunkS6X2QRVUcjs.parseColor.call(void 0, s.color);
|
|
650
|
+
if (c && !_chunkS6X2QRVUcjs.inSrgbGamut.call(void 0, c)) {
|
|
649
651
|
issues.push(`Stop "${s.id}" colour ${s.color} is outside standard sRGB gamut.`);
|
|
650
652
|
}
|
|
651
653
|
}
|
|
652
654
|
let lowestTextContrast;
|
|
653
655
|
if (options.text) {
|
|
654
|
-
const parsedTxt =
|
|
656
|
+
const parsedTxt = _chunkS6X2QRVUcjs.parseColor.call(void 0, options.text);
|
|
655
657
|
if (parsedTxt) {
|
|
656
658
|
let minRatio = Infinity;
|
|
657
659
|
for (let step = 0; step <= 32; step++) {
|
|
658
|
-
const sample =
|
|
660
|
+
const sample = _chunkS6X2QRVUcjs.parseColor.call(void 0, sampleGradient(g, step / 32, "light"));
|
|
659
661
|
if (sample) {
|
|
660
|
-
const r =
|
|
662
|
+
const r = _chunkS6X2QRVUcjs.contrastRatio.call(void 0, parsedTxt, sample);
|
|
661
663
|
if (r < minRatio) minRatio = r;
|
|
662
664
|
}
|
|
663
665
|
}
|
package/dist/gradient/index.js
CHANGED
|
@@ -2,16 +2,18 @@ import {
|
|
|
2
2
|
HistoryManager
|
|
3
3
|
} from "../chunk-RNSANXPT.js";
|
|
4
4
|
import {
|
|
5
|
-
contrastRatio,
|
|
6
|
-
deltaEOK,
|
|
7
5
|
formatDualColor,
|
|
8
|
-
inSrgbGamut,
|
|
9
6
|
isDualColor,
|
|
10
7
|
mixColors,
|
|
11
8
|
normalizeDualColor,
|
|
12
|
-
parseColor,
|
|
13
9
|
resolveColor
|
|
14
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-QYZGBVNC.js";
|
|
11
|
+
import {
|
|
12
|
+
contrastRatio,
|
|
13
|
+
deltaEOK,
|
|
14
|
+
inSrgbGamut,
|
|
15
|
+
parseColor
|
|
16
|
+
} from "../chunk-4VU4CP7R.js";
|
|
15
17
|
import "../chunk-6ONMQ6WF.js";
|
|
16
18
|
|
|
17
19
|
// src/gradient/model.ts
|