@pixerate/editor 0.146.0 → 0.147.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/README.md +3 -1
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/dist/agent/index.cjs +36 -34
- package/dist/agent/index.js +7 -5
- package/dist/animation/index.cjs +5 -3
- package/dist/animation/index.js +4 -2
- package/dist/animation-editor/index.cjs +62 -60
- package/dist/animation-editor/index.js +6 -4
- package/dist/canvas/index.cjs +36 -34
- package/dist/canvas/index.js +19 -17
- package/dist/chart/index.cjs +88 -86
- package/dist/chart/index.js +7 -5
- package/dist/{chunk-WBJ6BG4R.js → chunk-2AQL4JHM.js} +6 -6
- package/dist/{chunk-HLMF3E53.cjs → chunk-2WDZI6QD.cjs} +15 -15
- package/dist/{chunk-ZNHB5RG6.js → chunk-37RLSNQ3.js} +2 -2
- package/dist/{chunk-5WOY52O6.cjs → chunk-4YQKRHMI.cjs} +8 -8
- package/dist/chunk-6ONMQ6WF.js +113 -0
- package/dist/{chunk-L434J57V.cjs → chunk-6QTON3VW.cjs} +16 -16
- package/dist/chunk-AA34BA7G.js +1913 -0
- package/dist/{chunk-QX25HWFL.js → chunk-AY65VQSU.js} +1 -1
- package/dist/{chunk-ONZJD2OD.cjs → chunk-BROJYMWU.cjs} +57 -153
- package/dist/{chunk-YM75DN54.js → chunk-DSZCDNTM.js} +1 -1
- package/dist/{chunk-PUR6BZFA.cjs → chunk-DVLMW3GB.cjs} +53 -53
- package/dist/{chunk-ALUWD3FG.js → chunk-EIUTJPEL.js} +1 -1
- package/dist/{chunk-X65C4DWV.js → chunk-EQ4SF4X4.js} +1 -1
- package/dist/{chunk-77SG47WT.js → chunk-FLOGD3QB.js} +1 -1
- package/dist/{chunk-AJSW5GMP.js → chunk-HVQVHUTV.js} +19 -115
- package/dist/{chunk-UR37VCIR.cjs → chunk-I4AHLP7F.cjs} +16 -35
- package/dist/chunk-IPJ3TEYR.cjs +113 -0
- package/dist/chunk-KY3FYKP3.js +52 -0
- package/dist/chunk-LEUZ4FRC.cjs +52 -0
- package/dist/{chunk-H6FX45CP.cjs → chunk-LIXLD433.cjs} +37 -37
- package/dist/{chunk-6GAYGQDC.js → chunk-O5ML2I6O.js} +3 -3
- package/dist/{chunk-KI2VBONS.js → chunk-OET45HIR.js} +2 -2
- package/dist/{chunk-XNZWATSB.cjs → chunk-QCEQIRJQ.cjs} +85 -85
- package/dist/{chunk-HRI3ZMDM.cjs → chunk-RHXW4TA5.cjs} +3 -3
- package/dist/{chunk-UUTTJK77.cjs → chunk-SUF6WRXR.cjs} +2 -2
- package/dist/{chunk-RN767PO6.js → chunk-SUVZJ2CP.js} +15 -34
- package/dist/{chunk-FLUTRPLY.cjs → chunk-TLMRGLQQ.cjs} +16 -16
- package/dist/{chunk-DAS7M4RY.js → chunk-UILRJQFD.js} +2 -2
- package/dist/chunk-UKCJ43YL.cjs +1913 -0
- package/dist/{chunk-XQ33O5BC.cjs → chunk-X35BV5YT.cjs} +44 -44
- package/dist/{chunk-6HMEHNWW.cjs → chunk-XTU6QO2W.cjs} +26 -26
- package/dist/{chunk-VM6JYWXQ.js → chunk-ZQUANEK4.js} +2 -2
- package/dist/cms/index.cjs +5 -3
- package/dist/cms/index.js +18 -16
- package/dist/color/contrast.d.cts +14 -0
- package/dist/color/contrast.d.ts +14 -0
- package/dist/color/convert.d.cts +30 -0
- package/dist/color/convert.d.ts +30 -0
- package/dist/color/dual.d.cts +98 -0
- package/dist/color/dual.d.ts +98 -0
- package/dist/color/format.d.cts +12 -0
- package/dist/color/format.d.ts +12 -0
- package/dist/color/gamut.d.cts +12 -0
- package/dist/color/gamut.d.ts +12 -0
- package/dist/color/harmony.d.cts +22 -0
- package/dist/color/harmony.d.ts +22 -0
- package/dist/color/index.cjs +115 -0
- package/dist/color/index.d.cts +18 -0
- package/dist/color/index.d.ts +18 -0
- package/dist/color/index.js +115 -0
- package/dist/color/mix.d.cts +11 -0
- package/dist/color/mix.d.ts +11 -0
- package/dist/color/named.d.cts +5 -0
- package/dist/color/named.d.ts +5 -0
- package/dist/color/parse.d.cts +11 -0
- package/dist/color/parse.d.ts +11 -0
- package/dist/color/picker.d.cts +52 -0
- package/dist/color/picker.d.ts +52 -0
- package/dist/color/recent.d.cts +8 -0
- package/dist/color/recent.d.ts +8 -0
- package/dist/color/tools.d.cts +15 -0
- package/dist/color/tools.d.ts +15 -0
- package/dist/color/types.d.cts +41 -0
- package/dist/color/types.d.ts +41 -0
- package/dist/color/vision.d.cts +36 -0
- package/dist/color/vision.d.ts +36 -0
- package/dist/export/index.cjs +6 -4
- package/dist/export/index.js +5 -3
- package/dist/extensions/index.cjs +10 -8
- package/dist/extensions/index.js +9 -7
- package/dist/gradient/controller.d.cts +109 -0
- package/dist/gradient/controller.d.ts +109 -0
- package/dist/gradient/editor.d.cts +38 -0
- package/dist/gradient/editor.d.ts +38 -0
- package/dist/gradient/index.cjs +1549 -0
- package/dist/gradient/index.d.cts +5 -0
- package/dist/gradient/index.d.ts +5 -0
- package/dist/gradient/index.js +1549 -0
- package/dist/gradient/model.d.cts +94 -0
- package/dist/gradient/model.d.ts +94 -0
- package/dist/gradient/tools.d.cts +11 -0
- package/dist/gradient/tools.d.ts +11 -0
- package/dist/gradient/types.d.cts +44 -0
- package/dist/gradient/types.d.ts +44 -0
- package/dist/image-editor/index.cjs +649 -647
- package/dist/image-editor/index.js +6 -4
- package/dist/index.cjs +19 -17
- package/dist/index.js +16 -14
- package/dist/paint-editor/color.d.cts +3 -13
- package/dist/paint-editor/color.d.ts +3 -13
- package/dist/paint-editor/index.cjs +23 -68
- package/dist/paint-editor/index.js +15 -60
- package/dist/vector/index.cjs +950 -948
- package/dist/vector/index.js +5 -3
- package/dist/video-editor/index.cjs +5 -3
- package/dist/video-editor/index.js +4 -2
- package/package.json +21 -1
- package/skills/README.md +1 -0
- package/skills/pixerate-color/SKILL.md +69 -0
- package/dist/chunk-45VRG4RB.js +0 -65
- package/dist/chunk-5FXOR7F2.cjs +0 -65
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
import {
|
|
2
|
+
deltaEOK,
|
|
3
|
+
rgbToOklab,
|
|
4
|
+
simulateColorVision
|
|
5
|
+
} from "./chunk-AA34BA7G.js";
|
|
6
|
+
|
|
1
7
|
// src/chart/color.ts
|
|
2
8
|
var NAMED = {
|
|
3
9
|
black: "#000000",
|
|
@@ -53,7 +59,6 @@ function cyclePaletteColor(palette, index) {
|
|
|
53
59
|
return shadeChartColor(base, CHART_PALETTE_SHADES[round]);
|
|
54
60
|
}
|
|
55
61
|
var toLinear = (c) => c <= 0.04045 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);
|
|
56
|
-
var fromLinear = (c) => c <= 31308e-7 ? c * 12.92 : 1.055 * Math.pow(c, 1 / 2.4) - 0.055;
|
|
57
62
|
function chartLuminance(rgb) {
|
|
58
63
|
const [r, g, b] = rgb.map(toLinear);
|
|
59
64
|
return 0.2126 * r + 0.7152 * g + 0.0722 * b;
|
|
@@ -74,43 +79,19 @@ function chartTextOn(fill, fallback, dark = "#0f172a", light = "#ffffff") {
|
|
|
74
79
|
return darkRatio >= lightRatio ? dark : light;
|
|
75
80
|
}
|
|
76
81
|
function chartRgbToOklab(rgb) {
|
|
77
|
-
const [
|
|
78
|
-
|
|
79
|
-
const m = Math.cbrt(0.2119034982 * r + 0.6806995451 * g + 0.1073969566 * b);
|
|
80
|
-
const s = Math.cbrt(0.0883024619 * r + 0.2817188376 * g + 0.6299787005 * b);
|
|
81
|
-
return [
|
|
82
|
-
0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s,
|
|
83
|
-
1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s,
|
|
84
|
-
0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s
|
|
85
|
-
];
|
|
82
|
+
const lab = rgbToOklab({ r: rgb[0], g: rgb[1], b: rgb[2], a: 1 });
|
|
83
|
+
return [lab.l, lab.a, lab.b];
|
|
86
84
|
}
|
|
87
85
|
function chartColorDistance(a, b) {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
protanopia: [
|
|
94
|
-
[0.152286, 1.052583, -0.204868],
|
|
95
|
-
[0.114503, 0.786281, 0.099216],
|
|
96
|
-
[-3882e-6, -0.048116, 1.051998]
|
|
97
|
-
],
|
|
98
|
-
deuteranopia: [
|
|
99
|
-
[0.367322, 0.860646, -0.227968],
|
|
100
|
-
[0.280085, 0.672501, 0.047413],
|
|
101
|
-
[-0.01182, 0.04294, 0.968881]
|
|
102
|
-
],
|
|
103
|
-
tritanopia: [
|
|
104
|
-
[1.255528, -0.076749, -0.178779],
|
|
105
|
-
[-0.078411, 0.930809, 0.147602],
|
|
106
|
-
[4733e-6, 0.691367, 0.3039]
|
|
107
|
-
]
|
|
108
|
-
};
|
|
86
|
+
return deltaEOK(
|
|
87
|
+
{ r: a[0], g: a[1], b: a[2], a: 1 },
|
|
88
|
+
{ r: b[0], g: b[1], b: b[2], a: 1 }
|
|
89
|
+
);
|
|
90
|
+
}
|
|
109
91
|
function simulateChartVision(rgb, vision) {
|
|
110
92
|
if (vision === "normal") return rgb;
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
return m.map((row) => fromLinear(Math.max(0, Math.min(1, row[0] * lin[0] + row[1] * lin[1] + row[2] * lin[2]))));
|
|
93
|
+
const c = simulateColorVision({ r: rgb[0], g: rgb[1], b: rgb[2], a: 1 }, vision);
|
|
94
|
+
return [c.r, c.g, c.b];
|
|
114
95
|
}
|
|
115
96
|
function checkChartColors(colors, options = {}) {
|
|
116
97
|
const surface = options.surface ?? "#ffffff";
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkI4AHLP7Fcjs = require('./chunk-I4AHLP7F.cjs');
|
|
17
17
|
|
|
18
18
|
// src/chart/schemas.ts
|
|
19
19
|
var VALUE = { type: ["number", "string", "null"], description: 'A number, numeric text ("1,200", "12%", "$40", "(3)") or null for a gap.' };
|
|
@@ -25,7 +25,7 @@ var FORMAT = {
|
|
|
25
25
|
type: "object",
|
|
26
26
|
description: "How numbers are written on this axis or series.",
|
|
27
27
|
properties: {
|
|
28
|
-
style: { type: "string", enum: [...
|
|
28
|
+
style: { type: "string", enum: [..._chunkI4AHLP7Fcjs.CHART_NUMBER_STYLES], description: "number (default), percent (0.25 \u2192 25%), currency or compact (1.2K)." },
|
|
29
29
|
decimals: { type: "integer", minimum: 0, maximum: 10, description: "Fixed decimals (default: what the ticks need)." },
|
|
30
30
|
currency: { type: "string", description: 'ISO currency code for style "currency", e.g. "EUR" (default USD).' },
|
|
31
31
|
prefix: { type: "string", description: "Text before every number." },
|
|
@@ -45,10 +45,10 @@ var AXIS = (what) => ({
|
|
|
45
45
|
step: { type: ["number", "null"], exclusiveMinimum: 0, description: "Fixed distance between ticks, or null for automatic." },
|
|
46
46
|
gridlines: { type: "boolean", description: "Grid lines at each tick." },
|
|
47
47
|
format: FORMAT,
|
|
48
|
-
kind: { type: ["string", "null"], enum: [...
|
|
48
|
+
kind: { type: ["string", "null"], enum: [..._chunkI4AHLP7Fcjs.CHART_AXIS_KINDS, null], description: 'Category axis only: "date" reads categories as dates and labels them by calendar steps.' },
|
|
49
49
|
scale: {
|
|
50
50
|
type: ["string", "null"],
|
|
51
|
-
enum: [...
|
|
51
|
+
enum: [..._chunkI4AHLP7Fcjs.CHART_AXIS_SCALES, null],
|
|
52
52
|
description: 'Value axes and the numeric x axis of scatter / bubble charts: "log" spaces ticks by powers of logBase (values of 0 or less are skipped; min and max must be above 0; not with percent stacking). "linear" or null is the default. Ignored on a category axis.'
|
|
53
53
|
},
|
|
54
54
|
logBase: { type: ["number", "null"], minimum: 2, maximum: 1e3, description: "Base of a log axis, 2 to 1000 (default 10; null resets)." },
|
|
@@ -57,7 +57,7 @@ var AXIS = (what) => ({
|
|
|
57
57
|
additionalProperties: false
|
|
58
58
|
});
|
|
59
59
|
var TRENDLINE_PROPS = {
|
|
60
|
-
type: { type: "string", enum: [...
|
|
60
|
+
type: { type: "string", enum: [..._chunkI4AHLP7Fcjs.CHART_TRENDLINE_TYPES], description: "Fit: linear, exponential, logarithmic, power, polynomial or moving-average." },
|
|
61
61
|
order: { type: "integer", minimum: 2, maximum: 6, description: "Polynomial order (default 2)." },
|
|
62
62
|
period: { type: "integer", minimum: 2, description: "Moving-average period in points (default 2)." },
|
|
63
63
|
forward: { type: "number", minimum: 0, description: "Extend the line this many x units past the last point (default 0)." },
|
|
@@ -74,13 +74,13 @@ var ERROR_BARS = (what) => ({
|
|
|
74
74
|
properties: {
|
|
75
75
|
type: {
|
|
76
76
|
type: "string",
|
|
77
|
-
enum: [...
|
|
77
|
+
enum: [..._chunkI4AHLP7Fcjs.CHART_ERROR_BAR_TYPES],
|
|
78
78
|
description: "fixed: the same amount at every point; percent: a percentage of each value; stddev: value standard deviations of the series, drawn around the series mean (as Excel does); stderr: the standard error of the series at every point; custom: per-point plus / minus amounts."
|
|
79
79
|
},
|
|
80
80
|
value: { type: "number", minimum: 0, description: "Amount in data units for fixed (default 1), percent of each value for percent (default 5), number of standard deviations for stddev (default 1). Not for stderr or custom." },
|
|
81
81
|
plus: { type: "array", items: VALUE, description: "custom only: amount above each point, one per category, in data units (0 or more; null for none)." },
|
|
82
82
|
minus: { type: "array", items: VALUE, description: "custom only: amount below each point, one per category (default: the plus amounts)." },
|
|
83
|
-
direction: { type: "string", enum: [...
|
|
83
|
+
direction: { type: "string", enum: [..._chunkI4AHLP7Fcjs.CHART_ERROR_BAR_DIRECTIONS], description: "both (default), plus (only above) or minus (only below)." },
|
|
84
84
|
cap: { type: "boolean", description: "Draw end caps (default true)." }
|
|
85
85
|
},
|
|
86
86
|
required: ["type"],
|
|
@@ -90,21 +90,21 @@ var SERIES_PROPS = {
|
|
|
90
90
|
name: { type: "string", description: "Series name (legend and data grid header)." },
|
|
91
91
|
values: { type: "array", items: VALUE, description: "One value per category, in category order (padded with gaps)." },
|
|
92
92
|
color: { type: ["string", "null"], description: "CSS colour, or null for the palette colour." },
|
|
93
|
-
type: { type: ["string", "null"], enum: [...
|
|
93
|
+
type: { type: ["string", "null"], enum: [..._chunkI4AHLP7Fcjs.CHART_SERIES_TYPES, null], description: "Draw this series as bar, line, area or scatter (a combo chart); null follows the chart type." },
|
|
94
94
|
hidden: { type: "boolean", description: "Hide the series (its data is kept)." },
|
|
95
95
|
axis: { type: ["string", "null"], enum: ["primary", "secondary", null], description: "Value axis: secondary is drawn on the right with its own scale." },
|
|
96
96
|
x: { type: ["array", "null"], items: VALUE, description: "Numeric x per category, for scatter and bubble charts." },
|
|
97
97
|
sizes: { type: ["array", "null"], items: VALUE, description: "Bubble sizes per category (area is proportional to size)." },
|
|
98
98
|
pointColors: { type: ["array", "null"], items: { type: ["string", "null"] }, description: "Colour per category (null keeps the series colour)." },
|
|
99
|
-
marker: { type: ["string", "null"], enum: [...
|
|
100
|
-
curve: { type: ["string", "null"], enum: [...
|
|
99
|
+
marker: { type: ["string", "null"], enum: [..._chunkI4AHLP7Fcjs.CHART_MARKERS, null], description: "Point marker shape for line, area and scatter series." },
|
|
100
|
+
curve: { type: ["string", "null"], enum: [..._chunkI4AHLP7Fcjs.CHART_CURVES, null], description: "Line shape for this series: linear, smooth or step." },
|
|
101
101
|
dataLabels: { type: ["boolean", "null"], description: "Value labels for this series (null follows the chart)." },
|
|
102
102
|
format: { ...FORMAT, type: ["object", "null"], description: "How this series' labels are written (null follows the value axis)." },
|
|
103
103
|
errorBars: ERROR_BARS("Error bars along the value axis (bar, line, area and scatter series; on stacked charts they sit on the stack top)."),
|
|
104
104
|
xErrorBars: ERROR_BARS("Error bars along the x axis (scatter and bubble charts with numeric x values; amounts in x units).")
|
|
105
105
|
};
|
|
106
106
|
var CHART_UPDATE_PROPERTIES = {
|
|
107
|
-
type: { type: "string", enum: [...
|
|
107
|
+
type: { type: "string", enum: [..._chunkI4AHLP7Fcjs.CHART_TYPES], description: "Chart type." },
|
|
108
108
|
title: { type: "string", description: 'Title ("" for none).' },
|
|
109
109
|
subtitle: { type: "string", description: 'Subtitle ("" for none).' },
|
|
110
110
|
xAxis: AXIS("Category axis (or numeric x axis of scatter / bubble charts)."),
|
|
@@ -113,15 +113,15 @@ var CHART_UPDATE_PROPERTIES = {
|
|
|
113
113
|
legend: {
|
|
114
114
|
type: "object",
|
|
115
115
|
description: "Legend.",
|
|
116
|
-
properties: { show: { type: "boolean", description: "Show the legend." }, position: { type: "string", enum: [...
|
|
116
|
+
properties: { show: { type: "boolean", description: "Show the legend." }, position: { type: "string", enum: [..._chunkI4AHLP7Fcjs.CHART_LEGEND_POSITIONS], description: "Where the legend goes." } },
|
|
117
117
|
additionalProperties: false
|
|
118
118
|
},
|
|
119
|
-
stacking: { type: "string", enum: [...
|
|
120
|
-
orientation: { type: "string", enum: [...
|
|
121
|
-
curve: { type: "string", enum: [...
|
|
119
|
+
stacking: { type: "string", enum: [..._chunkI4AHLP7Fcjs.CHART_STACKINGS], description: "none, stacked, or percent (each category scaled to 100%)." },
|
|
120
|
+
orientation: { type: "string", enum: [..._chunkI4AHLP7Fcjs.CHART_ORIENTATIONS], description: "horizontal draws bars sideways." },
|
|
121
|
+
curve: { type: "string", enum: [..._chunkI4AHLP7Fcjs.CHART_CURVES], description: "Line shape: linear, smooth or step." },
|
|
122
122
|
points: { type: "boolean", description: "Dots on line and area series." },
|
|
123
123
|
dataLabels: { type: "boolean", description: "Value labels on bars, points and slices." },
|
|
124
|
-
labelPosition: { type: "string", enum: [...
|
|
124
|
+
labelPosition: { type: "string", enum: [..._chunkI4AHLP7Fcjs.CHART_LABEL_POSITIONS], description: "Bar label position; auto drops labels that do not fit." },
|
|
125
125
|
palette: { type: "array", items: { type: "string" }, minItems: 1, description: "Series colours in order (CSS colours)." },
|
|
126
126
|
innerRadius: { type: "number", minimum: 0, maximum: 0.9, description: "Donut hole as a fraction of the radius." },
|
|
127
127
|
gapWidth: { type: "number", minimum: 0, maximum: 0.9, description: "Space between bar groups as a fraction of the category (default 0.28)." },
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
unionBounds,
|
|
19
19
|
vectorGradientPoints,
|
|
20
20
|
widthProfileAt
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-FLOGD3QB.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-KY3FYKP3.js";
|
|
33
33
|
|
|
34
34
|
// src/vector/blend.ts
|
|
35
35
|
var lerpN = (a, b, t) => a + (b - a) * t;
|