@pixerate/editor 0.46.0 → 0.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD_PARTY_NOTICES.md +20 -0
- package/dist/agent/index.cjs +20 -19
- package/dist/agent/index.cjs.map +1 -1
- package/dist/agent/index.d.cts +2 -2
- package/dist/agent/index.d.ts +2 -2
- package/dist/agent/index.js +4 -3
- package/dist/agent/index.js.map +1 -1
- package/dist/{builtins-DghNQbT-.d.ts → builtins-D2nMtw2W.d.ts} +1 -1
- package/dist/{builtins-CZW-aYKS.d.cts → builtins-xs7rK6ys.d.cts} +1 -1
- package/dist/chart/index.cjs +3965 -821
- package/dist/chart/index.cjs.map +1 -1
- package/dist/chart/index.d.cts +964 -240
- package/dist/chart/index.d.ts +964 -240
- package/dist/chart/index.js +3922 -778
- package/dist/chart/index.js.map +1 -1
- package/dist/{chunk-PQM5W7ZN.js → chunk-4FX5ACVG.js} +29 -2
- package/dist/{chunk-PQM5W7ZN.js.map → chunk-4FX5ACVG.js.map} +1 -1
- package/dist/{chunk-3RPOW4CS.js → chunk-5VXI5GED.js} +12 -10
- package/dist/{chunk-3RPOW4CS.js.map → chunk-5VXI5GED.js.map} +1 -1
- package/dist/{chunk-HHQ4XJWT.js → chunk-AMWXSYCI.js} +2 -2
- package/dist/{chunk-U7VGDSNY.cjs → chunk-BBRK6MOI.cjs} +101 -99
- package/dist/chunk-BBRK6MOI.cjs.map +1 -0
- package/dist/chunk-C3NWJE3K.js +1182 -0
- package/dist/chunk-C3NWJE3K.js.map +1 -0
- package/dist/{chunk-N4MLNJPO.cjs → chunk-H4PICYNL.cjs} +59 -12
- package/dist/chunk-H4PICYNL.cjs.map +1 -0
- package/dist/chunk-LYGEEDNR.cjs +1895 -0
- package/dist/chunk-LYGEEDNR.cjs.map +1 -0
- package/dist/chunk-NEOO6QJD.cjs +1182 -0
- package/dist/chunk-NEOO6QJD.cjs.map +1 -0
- package/dist/{chunk-Q25ZS4F7.js → chunk-PQFAHT5O.js} +53 -6
- package/dist/chunk-PQFAHT5O.js.map +1 -0
- package/dist/{chunk-ZRNHGAQT.js → chunk-REAGGLXS.js} +43 -1891
- package/dist/chunk-REAGGLXS.js.map +1 -0
- package/dist/{chunk-EFDCLENW.cjs → chunk-RIWPYSKU.cjs} +29 -2
- package/dist/chunk-RIWPYSKU.cjs.map +1 -0
- package/dist/{chunk-EWCOFSCQ.cjs → chunk-SQC26VQV.cjs} +252 -2100
- package/dist/chunk-SQC26VQV.cjs.map +1 -0
- package/dist/{chunk-K2LVZ4FA.cjs → chunk-XFYUFVAX.cjs} +3 -3
- package/dist/{chunk-K2LVZ4FA.cjs.map → chunk-XFYUFVAX.cjs.map} +1 -1
- package/dist/chunk-ZFBBVGCI.js +1895 -0
- package/dist/chunk-ZFBBVGCI.js.map +1 -0
- package/dist/commands/index.cjs +93 -11
- package/dist/commands/index.cjs.map +1 -1
- package/dist/commands/index.d.cts +9 -7
- package/dist/commands/index.d.ts +9 -7
- package/dist/commands/index.js +92 -10
- package/dist/commands/index.js.map +1 -1
- package/dist/extensions/index.cjs +3 -2
- package/dist/extensions/index.cjs.map +1 -1
- package/dist/extensions/index.d.cts +3 -2
- package/dist/extensions/index.d.ts +3 -2
- package/dist/extensions/index.js +2 -1
- package/dist/generation/index.cjs +2 -2
- package/dist/generation/index.js +1 -1
- package/dist/{index-jwJ_onWf.d.ts → index-CSUCQYAH.d.ts} +23 -2
- package/dist/{index-CfOQf70b.d.cts → index-QrqMmZ75.d.cts} +23 -2
- package/dist/index.cjs +12 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -3
- package/dist/index.d.ts +9 -3
- package/dist/index.js +26 -23
- package/dist/index.js.map +1 -1
- package/dist/parameters/index.d.cts +1 -1
- package/dist/parameters/index.d.ts +1 -1
- package/dist/{registry-vz6HOiiy.d.cts → registry-CaR7LC6W.d.cts} +2 -0
- package/dist/{registry-BfVD-vVg.d.ts → registry-rVtFJjRM.d.ts} +2 -0
- package/dist/spreadsheet/index.cjs +5 -3
- package/dist/spreadsheet/index.cjs.map +1 -1
- package/dist/spreadsheet/index.js +24 -22
- package/dist/tools/index.cjs +3 -3
- package/dist/tools/index.js +2 -2
- package/dist/types-BVqWm3d1.d.cts +320 -0
- package/dist/types-BVqWm3d1.d.ts +320 -0
- package/dist/vector/index.d.cts +1 -1
- package/dist/vector/index.d.ts +1 -1
- package/package.json +3 -2
- package/dist/chunk-EFDCLENW.cjs.map +0 -1
- package/dist/chunk-EWCOFSCQ.cjs.map +0 -1
- package/dist/chunk-N4MLNJPO.cjs.map +0 -1
- package/dist/chunk-Q25ZS4F7.js.map +0 -1
- package/dist/chunk-U7VGDSNY.cjs.map +0 -1
- package/dist/chunk-ZRNHGAQT.js.map +0 -1
- /package/dist/{chunk-HHQ4XJWT.js.map → chunk-AMWXSYCI.js.map} +0 -0
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chart kinds.
|
|
3
|
+
*
|
|
4
|
+
* - `bar`, `line`, `area` and `scatter` are cartesian: categories along one axis, values along
|
|
5
|
+
* the other, and series may mix them (a combo chart). A scatter chart whose series carry
|
|
6
|
+
* numeric `x` values plots them on a numeric x axis instead.
|
|
7
|
+
* - `bubble` plots `x`, `y` (the values) and `sizes` per series.
|
|
8
|
+
* - `pie` and `donut` draw the first visible series, one slice per category.
|
|
9
|
+
* - `radar` draws each series as a polygon over one spoke per category.
|
|
10
|
+
* - `waterfall` draws the first series as running increases and decreases.
|
|
11
|
+
* - `histogram` bins every value of the visible series; `box` draws one box and whiskers per series.
|
|
12
|
+
* - `funnel` and `treemap` draw the first series, one bar or rectangle per category.
|
|
13
|
+
*/
|
|
14
|
+
type ChartType = 'bar' | 'line' | 'area' | 'scatter' | 'bubble' | 'pie' | 'donut' | 'radar' | 'waterfall' | 'histogram' | 'box' | 'funnel' | 'treemap';
|
|
15
|
+
/** How a series is drawn in a cartesian chart. */
|
|
16
|
+
type ChartSeriesType = 'bar' | 'line' | 'area' | 'scatter';
|
|
17
|
+
/** One data value; `null` is a gap (missing value). */
|
|
18
|
+
type ChartValue = number | null;
|
|
19
|
+
/** Point marker shapes for line, area and scatter series. */
|
|
20
|
+
type ChartMarker = 'circle' | 'square' | 'diamond' | 'triangle' | 'cross' | 'none';
|
|
21
|
+
/** Trendline fits (as in spreadsheets). */
|
|
22
|
+
type ChartTrendlineType = 'linear' | 'exponential' | 'logarithmic' | 'power' | 'polynomial' | 'moving-average';
|
|
23
|
+
interface ChartTrendline {
|
|
24
|
+
type: ChartTrendlineType;
|
|
25
|
+
/** Polynomial order, 2–6 (default 2). */
|
|
26
|
+
order?: number;
|
|
27
|
+
/** Moving-average period, 2 or more (default 2). */
|
|
28
|
+
period?: number;
|
|
29
|
+
/** Extend the line this many x units past the last point (default 0). */
|
|
30
|
+
forward?: number;
|
|
31
|
+
/** Extend the line this many x units before the first point (default 0). */
|
|
32
|
+
backward?: number;
|
|
33
|
+
/** Force the line through this y at x = 0 (linear, polynomial and exponential only). */
|
|
34
|
+
intercept?: number | null;
|
|
35
|
+
/** Write the fitted equation on the chart. */
|
|
36
|
+
showEquation?: boolean;
|
|
37
|
+
/** Write R² on the chart. */
|
|
38
|
+
showR2?: boolean;
|
|
39
|
+
/** Legend name (default: e.g. "Linear (Sales)"). */
|
|
40
|
+
name?: string;
|
|
41
|
+
/** CSS colour (default: the series colour). */
|
|
42
|
+
color?: string;
|
|
43
|
+
}
|
|
44
|
+
interface ChartSeries {
|
|
45
|
+
/** Stable id (unique within the chart). */
|
|
46
|
+
id: string;
|
|
47
|
+
name: string;
|
|
48
|
+
/** One value per category (the y values of a scatter or bubble chart). */
|
|
49
|
+
values: ChartValue[];
|
|
50
|
+
/** CSS colour (default: the palette colour for the series' position). */
|
|
51
|
+
color?: string;
|
|
52
|
+
/** Overrides the chart type for this series (cartesian charts only). */
|
|
53
|
+
type?: ChartSeriesType;
|
|
54
|
+
/** Hidden series keep their data but are not drawn or scaled. */
|
|
55
|
+
hidden?: boolean;
|
|
56
|
+
/** Plot against the secondary value axis (on the right). */
|
|
57
|
+
axis?: 'primary' | 'secondary';
|
|
58
|
+
/** Numeric x per category (scatter and bubble charts). */
|
|
59
|
+
x?: ChartValue[];
|
|
60
|
+
/** Bubble sizes per category (bubble charts; area is proportional to size). */
|
|
61
|
+
sizes?: ChartValue[];
|
|
62
|
+
/** Colour overrides per category (`null` keeps the series colour). */
|
|
63
|
+
pointColors?: (string | null)[];
|
|
64
|
+
/** Point marker (default: circles on lines when `points` is on). */
|
|
65
|
+
marker?: ChartMarker;
|
|
66
|
+
/** Line interpolation for this series (default: the chart's `curve`). */
|
|
67
|
+
curve?: ChartCurve;
|
|
68
|
+
/** Value labels for this series (default: the chart's `dataLabels`). */
|
|
69
|
+
dataLabels?: boolean;
|
|
70
|
+
/** How this series' data labels are written (default: the value axis format). */
|
|
71
|
+
format?: ChartNumberFormat;
|
|
72
|
+
/** Fitted lines drawn over the series. */
|
|
73
|
+
trendlines?: ChartTrendline[];
|
|
74
|
+
}
|
|
75
|
+
interface ChartNumberFormat {
|
|
76
|
+
/** `number` (default), `percent` (0.25 → 25%), `currency` or `compact` (1.2K). */
|
|
77
|
+
style?: 'number' | 'percent' | 'currency' | 'compact';
|
|
78
|
+
/** Fixed decimals (default: as many as the ticks need, up to 2). */
|
|
79
|
+
decimals?: number;
|
|
80
|
+
/** ISO currency code for `currency` (default `USD`). */
|
|
81
|
+
currency?: string;
|
|
82
|
+
prefix?: string;
|
|
83
|
+
suffix?: string;
|
|
84
|
+
/**
|
|
85
|
+
* A spreadsheet format code such as `#,##0.0,,"M"` or `0.0%;[Red]-0.0%`. When set it
|
|
86
|
+
* wins over the other fields. Supports sections (positive;negative;zero), digit
|
|
87
|
+
* placeholders, thousands separators and scaling, percent, scientific and literal text.
|
|
88
|
+
*/
|
|
89
|
+
code?: string;
|
|
90
|
+
}
|
|
91
|
+
interface ChartAxis {
|
|
92
|
+
/** Draw the axis line, ticks and labels (default `true`). */
|
|
93
|
+
show: boolean;
|
|
94
|
+
title: string;
|
|
95
|
+
/** Fixed lower bound (default: from the data, including 0 for bars and areas). */
|
|
96
|
+
min: number | null;
|
|
97
|
+
/** Fixed upper bound (default: from the data). */
|
|
98
|
+
max: number | null;
|
|
99
|
+
/** Fixed distance between ticks (default: a round number from the plot size). */
|
|
100
|
+
step: number | null;
|
|
101
|
+
/** Grid lines at each tick (default: on for the value axis). */
|
|
102
|
+
gridlines: boolean;
|
|
103
|
+
/** How tick and data labels are written (value axes, and the x axis of scatter charts). */
|
|
104
|
+
format: ChartNumberFormat;
|
|
105
|
+
/**
|
|
106
|
+
* Category axis only: `date` reads the categories as dates (ISO `2024-03-01`, `2024-03`,
|
|
107
|
+
* `2024`), labels them with calendar steps that fit, and thins the rest.
|
|
108
|
+
*/
|
|
109
|
+
kind?: 'category' | 'date';
|
|
110
|
+
}
|
|
111
|
+
type ChartLegendPosition = 'top' | 'bottom' | 'left' | 'right';
|
|
112
|
+
interface ChartLegend {
|
|
113
|
+
show: boolean;
|
|
114
|
+
position: ChartLegendPosition;
|
|
115
|
+
}
|
|
116
|
+
type ChartStacking = 'none' | 'stacked' | 'percent';
|
|
117
|
+
type ChartOrientation = 'vertical' | 'horizontal';
|
|
118
|
+
type ChartCurve = 'linear' | 'smooth' | 'step';
|
|
119
|
+
/** Where bar labels go: `auto` puts them outside, or centred on stacked segments, and drops ones that do not fit. */
|
|
120
|
+
type ChartLabelPosition = 'auto' | 'inside' | 'outside' | 'center';
|
|
121
|
+
/** A whole chart: data plus presentation. Plain JSON, safe to persist. */
|
|
122
|
+
interface ChartSpec {
|
|
123
|
+
version: 1;
|
|
124
|
+
type: ChartType;
|
|
125
|
+
title: string;
|
|
126
|
+
subtitle: string;
|
|
127
|
+
/** Category labels (the x axis, or pie slices). */
|
|
128
|
+
categories: string[];
|
|
129
|
+
series: ChartSeries[];
|
|
130
|
+
/** The category axis (or the numeric x axis of a scatter or bubble chart). */
|
|
131
|
+
xAxis: ChartAxis;
|
|
132
|
+
/** The value axis. */
|
|
133
|
+
yAxis: ChartAxis;
|
|
134
|
+
/** The secondary value axis, drawn on the right when a visible series uses it. */
|
|
135
|
+
yAxis2: ChartAxis;
|
|
136
|
+
legend: ChartLegend;
|
|
137
|
+
/** Stack bars and areas (`percent` scales each category to 100%). */
|
|
138
|
+
stacking: ChartStacking;
|
|
139
|
+
/** `horizontal` draws bars sideways (bar charts only). */
|
|
140
|
+
orientation: ChartOrientation;
|
|
141
|
+
/** Line and area interpolation. */
|
|
142
|
+
curve: ChartCurve;
|
|
143
|
+
/** Dots on line and area series. */
|
|
144
|
+
points: boolean;
|
|
145
|
+
/** Value labels on bars, points and slices. */
|
|
146
|
+
dataLabels: boolean;
|
|
147
|
+
/** Where bar value labels go. */
|
|
148
|
+
labelPosition: ChartLabelPosition;
|
|
149
|
+
/** Series colours in order (cycled through lighter and darker shades once used up). */
|
|
150
|
+
palette: string[];
|
|
151
|
+
/** Donut hole as a fraction of the radius (0–0.9). */
|
|
152
|
+
innerRadius: number;
|
|
153
|
+
/** Empty space between category groups, as a fraction of the category width (0–0.9). */
|
|
154
|
+
gapWidth: number;
|
|
155
|
+
/** How much bars in a group overlap, as a fraction of a bar's width (-1 to 1; negative is a gap). */
|
|
156
|
+
overlap: number;
|
|
157
|
+
/** Histogram bin count (`null`: √n, between 1 and 100). */
|
|
158
|
+
bins: number | null;
|
|
159
|
+
/** Waterfall: append a running-total bar (categories labelled "total" are always totals). */
|
|
160
|
+
showTotal: boolean;
|
|
161
|
+
}
|
|
162
|
+
/** What a click selects. */
|
|
163
|
+
type ChartSelection = {
|
|
164
|
+
kind: 'chart';
|
|
165
|
+
} | {
|
|
166
|
+
kind: 'title';
|
|
167
|
+
} | {
|
|
168
|
+
kind: 'subtitle';
|
|
169
|
+
} | {
|
|
170
|
+
kind: 'legend';
|
|
171
|
+
} | {
|
|
172
|
+
kind: 'axis';
|
|
173
|
+
axis: 'x' | 'y' | 'y2';
|
|
174
|
+
} | {
|
|
175
|
+
kind: 'series';
|
|
176
|
+
seriesId: string;
|
|
177
|
+
} | {
|
|
178
|
+
kind: 'point';
|
|
179
|
+
seriesId: string;
|
|
180
|
+
index: number;
|
|
181
|
+
} | {
|
|
182
|
+
kind: 'category';
|
|
183
|
+
index: number;
|
|
184
|
+
} | {
|
|
185
|
+
kind: 'trendline';
|
|
186
|
+
seriesId: string;
|
|
187
|
+
index: number;
|
|
188
|
+
};
|
|
189
|
+
/** Colours and type used to lay out a chart. Any CSS colour strings work. */
|
|
190
|
+
interface ChartTheme {
|
|
191
|
+
/** Fill behind the chart (`transparent` lets the page show through). */
|
|
192
|
+
background: string;
|
|
193
|
+
/** The page colour: slice separators and hollow points (set it when `background` is transparent). */
|
|
194
|
+
surface: string;
|
|
195
|
+
text: string;
|
|
196
|
+
mutedText: string;
|
|
197
|
+
grid: string;
|
|
198
|
+
axis: string;
|
|
199
|
+
/** Outline drawn around the selected mark. */
|
|
200
|
+
selection: string;
|
|
201
|
+
/** Waterfall increases. */
|
|
202
|
+
positive: string;
|
|
203
|
+
/** Waterfall decreases. */
|
|
204
|
+
negative: string;
|
|
205
|
+
fontFamily: string;
|
|
206
|
+
fontSize: number;
|
|
207
|
+
titleSize: number;
|
|
208
|
+
}
|
|
209
|
+
interface ChartRect {
|
|
210
|
+
x: number;
|
|
211
|
+
y: number;
|
|
212
|
+
width: number;
|
|
213
|
+
height: number;
|
|
214
|
+
}
|
|
215
|
+
/** What a mark is, for styling and tests. */
|
|
216
|
+
type ChartMarkRole = 'background' | 'title' | 'subtitle' | 'grid' | 'axis' | 'tick' | 'tick-label' | 'axis-title' | 'bar' | 'line' | 'area' | 'point' | 'slice' | 'cell' | 'box' | 'whisker' | 'outlier' | 'connector' | 'trendline' | 'trendline-label' | 'data-label' | 'legend-swatch' | 'legend-label' | 'drag-readout' | 'selection' | 'empty';
|
|
217
|
+
interface ChartMarkBase {
|
|
218
|
+
/** Unique within the scene (a stable key for frameworks). */
|
|
219
|
+
key: string;
|
|
220
|
+
role: ChartMarkRole;
|
|
221
|
+
/** What clicking this mark selects (none: not clickable). */
|
|
222
|
+
target?: ChartSelection;
|
|
223
|
+
/** Mark belongs to the current selection. */
|
|
224
|
+
selected?: boolean;
|
|
225
|
+
opacity?: number;
|
|
226
|
+
}
|
|
227
|
+
interface ChartRectMark extends ChartMarkBase {
|
|
228
|
+
kind: 'rect';
|
|
229
|
+
x: number;
|
|
230
|
+
y: number;
|
|
231
|
+
width: number;
|
|
232
|
+
height: number;
|
|
233
|
+
fill: string;
|
|
234
|
+
stroke?: string;
|
|
235
|
+
strokeWidth?: number;
|
|
236
|
+
radius?: number;
|
|
237
|
+
}
|
|
238
|
+
interface ChartPathMark extends ChartMarkBase {
|
|
239
|
+
kind: 'path';
|
|
240
|
+
d: string;
|
|
241
|
+
fill?: string;
|
|
242
|
+
stroke?: string;
|
|
243
|
+
strokeWidth?: number;
|
|
244
|
+
dash?: string;
|
|
245
|
+
}
|
|
246
|
+
interface ChartCircleMark extends ChartMarkBase {
|
|
247
|
+
kind: 'circle';
|
|
248
|
+
cx: number;
|
|
249
|
+
cy: number;
|
|
250
|
+
r: number;
|
|
251
|
+
fill: string;
|
|
252
|
+
stroke?: string;
|
|
253
|
+
strokeWidth?: number;
|
|
254
|
+
}
|
|
255
|
+
interface ChartLineMark extends ChartMarkBase {
|
|
256
|
+
kind: 'line';
|
|
257
|
+
x1: number;
|
|
258
|
+
y1: number;
|
|
259
|
+
x2: number;
|
|
260
|
+
y2: number;
|
|
261
|
+
stroke: string;
|
|
262
|
+
strokeWidth?: number;
|
|
263
|
+
dash?: string;
|
|
264
|
+
}
|
|
265
|
+
interface ChartTextMark extends ChartMarkBase {
|
|
266
|
+
kind: 'text';
|
|
267
|
+
x: number;
|
|
268
|
+
y: number;
|
|
269
|
+
text: string;
|
|
270
|
+
anchor: 'start' | 'middle' | 'end';
|
|
271
|
+
/** Vertical alignment of the text box to `y`. */
|
|
272
|
+
baseline: 'top' | 'middle' | 'bottom';
|
|
273
|
+
size: number;
|
|
274
|
+
weight?: number;
|
|
275
|
+
fill: string;
|
|
276
|
+
/** Degrees, around (x, y). */
|
|
277
|
+
rotate?: number;
|
|
278
|
+
}
|
|
279
|
+
type ChartMark = ChartRectMark | ChartPathMark | ChartCircleMark | ChartLineMark | ChartTextMark;
|
|
280
|
+
/** Maps between data values and scene pixels along one axis of the plot. */
|
|
281
|
+
interface ChartValueScale {
|
|
282
|
+
/** `y` for vertical charts, `x` for horizontal bars and the numeric x axis of scatter charts. */
|
|
283
|
+
axis: 'x' | 'y';
|
|
284
|
+
domain: [number, number];
|
|
285
|
+
range: [number, number];
|
|
286
|
+
ticks: number[];
|
|
287
|
+
}
|
|
288
|
+
/** Something the layout had to leave out or shorten, as a sentence (for agents and screen readers). */
|
|
289
|
+
interface ChartWarning {
|
|
290
|
+
code: 'labels-hidden' | 'labels-truncated' | 'legend-truncated' | 'points-decimated' | 'values-skipped' | 'data-labels-hidden' | 'type-fallback';
|
|
291
|
+
message: string;
|
|
292
|
+
}
|
|
293
|
+
/** A laid-out chart: drawing primitives in scene pixels, ready for SVG, canvas or anything else. */
|
|
294
|
+
interface ChartScene {
|
|
295
|
+
width: number;
|
|
296
|
+
height: number;
|
|
297
|
+
/** The plot area (inside the axes). Empty for pies. */
|
|
298
|
+
plot: ChartRect;
|
|
299
|
+
/** Draw in order. */
|
|
300
|
+
marks: ChartMark[];
|
|
301
|
+
/** The value scale of a cartesian chart (absent for pies and empty charts). */
|
|
302
|
+
valueScale?: ChartValueScale;
|
|
303
|
+
/** The secondary value scale, when a visible series uses it. */
|
|
304
|
+
valueScale2?: ChartValueScale;
|
|
305
|
+
/** The numeric x scale of a scatter or bubble chart with x values. */
|
|
306
|
+
xScale?: ChartValueScale;
|
|
307
|
+
/** Percent-stacked: values are shown as shares, so dragging is disabled. */
|
|
308
|
+
percent: boolean;
|
|
309
|
+
theme: ChartTheme;
|
|
310
|
+
/** What was left out or shortened (hidden labels, decimated lines, …). */
|
|
311
|
+
warnings: ChartWarning[];
|
|
312
|
+
}
|
|
313
|
+
interface ChartIssue {
|
|
314
|
+
path: string;
|
|
315
|
+
message: string;
|
|
316
|
+
/** 1-based source line, for text formats such as Mermaid. */
|
|
317
|
+
line?: number;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
export type { ChartMarkRole as A, ChartPathMark as B, ChartAxis as C, ChartRectMark as D, ChartCurve as a, ChartLabelPosition as b, ChartLegendPosition as c, ChartMarker as d, ChartNumberFormat as e, ChartOrientation as f, ChartSeriesType as g, ChartStacking as h, ChartTrendlineType as i, ChartType as j, ChartTheme as k, ChartSeries as l, ChartIssue as m, ChartSpec as n, ChartTrendline as o, ChartValue as p, ChartRect as q, ChartSelection as r, ChartScene as s, ChartTextMark as t, ChartWarning as u, ChartLegend as v, ChartValueScale as w, ChartCircleMark as x, ChartLineMark as y, ChartMark as z };
|
package/dist/vector/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { C as CanvasGradientDef, A as AffineMatrix, B as BezierPathInput, a as BezierPath, S as SvgGradientDef, b as StrokeJoin, c as StrokeCap, d as BezierSegment, P as PlanarMap, e as PathfinderOperation, f as PathfinderShape } from '../pathfinder-DKRcXiLS.cjs';
|
|
2
2
|
import { P as Point } from '../types-BFkYA4eF.cjs';
|
|
3
3
|
import { H as HistoryManager } from '../HistoryManager-DeQQMBCj.cjs';
|
|
4
|
-
import { C as CommandSpec } from '../registry-
|
|
4
|
+
import { C as CommandSpec } from '../registry-CaR7LC6W.cjs';
|
|
5
5
|
import { A as AnimationEasing } from '../easing-DTmX99QG.cjs';
|
|
6
6
|
import '../types-DsiXGmjo.cjs';
|
|
7
7
|
import '../schema-Di0CS6Pe.cjs';
|
package/dist/vector/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { C as CanvasGradientDef, A as AffineMatrix, B as BezierPathInput, a as BezierPath, S as SvgGradientDef, b as StrokeJoin, c as StrokeCap, d as BezierSegment, P as PlanarMap, e as PathfinderOperation, f as PathfinderShape } from '../pathfinder-D98S2lV5.js';
|
|
2
2
|
import { P as Point } from '../types-BFkYA4eF.js';
|
|
3
3
|
import { H as HistoryManager } from '../HistoryManager-DWSLd6Tf.js';
|
|
4
|
-
import { C as CommandSpec } from '../registry-
|
|
4
|
+
import { C as CommandSpec } from '../registry-rVtFJjRM.js';
|
|
5
5
|
import { A as AnimationEasing } from '../easing-DTmX99QG.js';
|
|
6
6
|
import '../types-DsiXGmjo.js';
|
|
7
7
|
import '../schema-Di0CS6Pe.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pixerate/editor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.47.0",
|
|
4
4
|
"description": "UI-agnostic rich text and media editing core library",
|
|
5
5
|
"author": "Pixerate",
|
|
6
6
|
"license": "MIT",
|
|
@@ -144,7 +144,7 @@
|
|
|
144
144
|
"@tiptap/suggestion": "^2.11.5",
|
|
145
145
|
"markdown-it": "^15.0.2",
|
|
146
146
|
"markdown-it-task-lists": "^2.1.1",
|
|
147
|
-
"prosemirror-markdown": "^1.13.
|
|
147
|
+
"prosemirror-markdown": "^1.13.8"
|
|
148
148
|
},
|
|
149
149
|
"devDependencies": {
|
|
150
150
|
"@dagrejs/dagre": "^1.1.8",
|
|
@@ -153,6 +153,7 @@
|
|
|
153
153
|
"@types/dagre": "^0.7.54",
|
|
154
154
|
"@types/markdown-it": "^14.2.0",
|
|
155
155
|
"@types/node": "^24.0.0",
|
|
156
|
+
"mermaid": "12.0.0",
|
|
156
157
|
"tiptap-markdown": "^0.8.10",
|
|
157
158
|
"tsup": "^8.4.0",
|
|
158
159
|
"typescript": "^5.7.3",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/editor/editor/packages/core/dist/chunk-EFDCLENW.cjs","../src/tools/schema.ts"],"names":[],"mappings":"AAAA;AC6CA,SAAS,MAA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AA;AACD,IAAA;AACD,EAAA;AAEO,EAAA;AACR;ADjFgD;AACA;AACA;AACA","file":"/home/runner/work/editor/editor/packages/core/dist/chunk-EFDCLENW.cjs","sourcesContent":[null,"/**\n * JSON-Schema-lite: the subset of JSON Schema used by MCP tool `inputSchema`s,\n * plus a small validator for tool-call arguments. Unknown keywords are ignored.\n */\nexport type JsonSchemaType = 'string' | 'number' | 'integer' | 'boolean' | 'object' | 'array' | 'null';\n\nexport interface JsonSchema {\n\ttype?: JsonSchemaType | readonly JsonSchemaType[];\n\tdescription?: string;\n\ttitle?: string;\n\tenum?: readonly unknown[];\n\tconst?: unknown;\n\tdefault?: unknown;\n\tproperties?: { readonly [key: string]: JsonSchema };\n\trequired?: readonly string[];\n\tadditionalProperties?: boolean | JsonSchema;\n\titems?: JsonSchema;\n\tminItems?: number;\n\tmaxItems?: number;\n\tminimum?: number;\n\tmaximum?: number;\n\texclusiveMinimum?: number;\n\texclusiveMaximum?: number;\n\tmultipleOf?: number;\n\tuniqueItems?: boolean;\n\tanyOf?: readonly JsonSchema[];\n\toneOf?: readonly JsonSchema[];\n\tallOf?: readonly JsonSchema[];\n\tnot?: JsonSchema;\n\t/** Local reference only: `#`, `#/$defs/<name>` or `#/definitions/<name>`. */\n\t$ref?: string;\n\t$defs?: { readonly [key: string]: JsonSchema };\n\tdefinitions?: { readonly [key: string]: JsonSchema };\n\tminLength?: number;\n\tmaxLength?: number;\n\tpattern?: string;\n\t[keyword: string]: unknown;\n}\n\nexport interface SchemaValidationError {\n\t/** JSON-pointer-like path to the offending value, e.g. `/node/id` (`\"\"` is the root). */\n\tpath: string;\n\tmessage: string;\n}\n\nfunction typeOf(value: unknown): JsonSchemaType | 'undefined' {\n\tif (value === null) return 'null';\n\tif (Array.isArray(value)) return 'array';\n\tif (typeof value === 'number') return Number.isInteger(value) ? 'integer' : 'number';\n\tif (typeof value === 'string' || typeof value === 'boolean' || typeof value === 'object') {\n\t\treturn typeof value as JsonSchemaType;\n\t}\n\treturn 'undefined';\n}\n\nfunction matchesType(value: unknown, type: JsonSchemaType): boolean {\n\tconst actual = typeOf(value);\n\tif (type === 'number') return actual === 'number' || actual === 'integer';\n\treturn actual === type;\n}\n\nconst isEqual = (a: unknown, b: unknown) => a === b || JSON.stringify(a) === JSON.stringify(b);\n\n/** Resolves a local `$ref` (`#`, `#/$defs/a`, `#/definitions/a/properties/b`, ...) against `root`. */\nfunction resolveRef(ref: string, root: JsonSchema): JsonSchema | undefined {\n\tif (ref === '#') return root;\n\tif (!ref.startsWith('#/')) return undefined;\n\tlet node: unknown = root;\n\tfor (const raw of ref.slice(2).split('/')) {\n\t\tconst key = decodeURIComponent(raw).replace(/~1/g, '/').replace(/~0/g, '~');\n\t\tif (!node || typeof node !== 'object') return undefined;\n\t\tnode = (node as Record<string, unknown>)[key];\n\t}\n\treturn node && typeof node === 'object' ? (node as JsonSchema) : undefined;\n}\n\n/** Most `$ref` hops followed before a reference cycle is reported. */\nconst MAX_REF_DEPTH = 32;\n\n/**\n * Validates `value` against `schema` and returns every error found (an empty\n * array means valid). Supports `type` (incl. arrays of types), `enum`, `const`,\n * `properties`, `required`, `additionalProperties`, `items`, `minItems`,\n * `maxItems`, `uniqueItems`, `minimum`, `maximum`, `exclusiveMinimum`,\n * `exclusiveMaximum`, `multipleOf`, `minLength`, `maxLength`, `pattern`,\n * `anyOf`, `oneOf`, `allOf`, `not` and local `$ref`s (`#/$defs/...`).\n * Other keywords (`format`, `if`/`then`, `patternProperties`, remote refs...)\n * are ignored.\n *\n * When no `anyOf` / `oneOf` branch matches, the errors of the closest branch\n * (the one with the fewest errors) are reported, so a caller sees what to fix\n * rather than only \"no branch matched\".\n */\nexport function validateJsonSchema(\n\tvalue: unknown,\n\tschema: JsonSchema | undefined,\n\tpath = '',\n\troot: JsonSchema | undefined = schema,\n\trefDepth = 0\n): SchemaValidationError[] {\n\tif (!schema || typeof schema !== 'object') return [];\n\tconst errors: SchemaValidationError[] = [];\n\tconst at = path || '/';\n\tconst recurse = (child: unknown, childSchema: JsonSchema | undefined, childPath: string) =>\n\t\tvalidateJsonSchema(child, childSchema, childPath, root, refDepth);\n\n\tif (typeof schema.$ref === 'string') {\n\t\tconst target = root ? resolveRef(schema.$ref, root) : undefined;\n\t\tif (!target) {\n\t\t\terrors.push({ path: at, message: `Unresolvable schema reference ${schema.$ref}.` });\n\t\t} else if (refDepth >= MAX_REF_DEPTH) {\n\t\t\terrors.push({ path: at, message: `Schema reference ${schema.$ref} is nested too deeply.` });\n\t\t} else {\n\t\t\terrors.push(...validateJsonSchema(value, target, path, root, refDepth + 1));\n\t\t}\n\t\t// Sibling keywords still apply (2019-09+ semantics).\n\t}\n\n\tif (schema.allOf) {\n\t\tfor (const branch of schema.allOf) errors.push(...recurse(value, branch, path));\n\t}\n\tif (schema.anyOf || schema.oneOf) {\n\t\tconst branches = (schema.anyOf ?? schema.oneOf)!;\n\t\tconst results = branches.map((branch) => recurse(value, branch, path));\n\t\tconst matching = results.filter((r) => r.length === 0).length;\n\t\tif (matching === 0 && results.length > 0) {\n\t\t\tconst closest = results.reduce((best, r) => (r.length < best.length ? r : best));\n\t\t\terrors.push(\n\t\t\t\t{ path: at, message: `Does not match any allowed shape (${branches.length} options); closest match failed with:` },\n\t\t\t\t...closest\n\t\t\t);\n\t\t} else if (schema.oneOf && !schema.anyOf && matching > 1) {\n\t\t\terrors.push({ path: at, message: `Matches ${matching} shapes; exactly one is allowed.` });\n\t\t}\n\t}\n\tif (schema.not && recurse(value, schema.not, path).length === 0) {\n\t\terrors.push({ path: at, message: 'Matches a disallowed shape.' });\n\t}\n\n\tif (schema.type !== undefined) {\n\t\tconst types = (Array.isArray(schema.type) ? schema.type : [schema.type]) as JsonSchemaType[];\n\t\tif (!types.some((t) => matchesType(value, t))) {\n\t\t\terrors.push({ path: at, message: `Expected ${types.join(' | ')}, got ${typeOf(value)}.` });\n\t\t\treturn errors;\n\t\t}\n\t}\n\tif (schema.const !== undefined && !isEqual(value, schema.const)) {\n\t\terrors.push({ path: at, message: `Expected ${JSON.stringify(schema.const)}.` });\n\t}\n\tif (schema.enum && !schema.enum.some((option) => isEqual(value, option))) {\n\t\terrors.push({\n\t\t\tpath: at,\n\t\t\tmessage: `Expected one of ${schema.enum.map((o) => JSON.stringify(o)).join(', ')}, got ${JSON.stringify(value)}.`\n\t\t});\n\t}\n\n\tif (typeof value === 'string') {\n\t\tif (schema.minLength !== undefined && value.length < schema.minLength) {\n\t\t\terrors.push({ path: at, message: `Must be at least ${schema.minLength} characters.` });\n\t\t}\n\t\tif (schema.maxLength !== undefined && value.length > schema.maxLength) {\n\t\t\terrors.push({ path: at, message: `Must be at most ${schema.maxLength} characters.` });\n\t\t}\n\t\tif (schema.pattern !== undefined) {\n\t\t\tlet regex: RegExp | null = null;\n\t\t\ttry {\n\t\t\t\tregex = new RegExp(schema.pattern, 'u');\n\t\t\t} catch {\n\t\t\t\t// An invalid pattern in the schema is not the caller's fault.\n\t\t\t}\n\t\t\tif (regex && !regex.test(value)) {\n\t\t\t\terrors.push({ path: at, message: `Must match pattern ${schema.pattern}.` });\n\t\t\t}\n\t\t}\n\t}\n\n\tif (typeof value === 'number') {\n\t\tif (schema.minimum !== undefined && value < schema.minimum) {\n\t\t\terrors.push({ path: at, message: `Must be >= ${schema.minimum}.` });\n\t\t}\n\t\tif (schema.maximum !== undefined && value > schema.maximum) {\n\t\t\terrors.push({ path: at, message: `Must be <= ${schema.maximum}.` });\n\t\t}\n\t\tif (typeof schema.exclusiveMinimum === 'number' && value <= schema.exclusiveMinimum) {\n\t\t\terrors.push({ path: at, message: `Must be > ${schema.exclusiveMinimum}.` });\n\t\t}\n\t\tif (typeof schema.exclusiveMaximum === 'number' && value >= schema.exclusiveMaximum) {\n\t\t\terrors.push({ path: at, message: `Must be < ${schema.exclusiveMaximum}.` });\n\t\t}\n\t\tif (schema.multipleOf !== undefined && schema.multipleOf > 0) {\n\t\t\tconst quotient = value / schema.multipleOf;\n\t\t\tif (Math.abs(quotient - Math.round(quotient)) > 1e-9) {\n\t\t\t\terrors.push({ path: at, message: `Must be a multiple of ${schema.multipleOf}.` });\n\t\t\t}\n\t\t}\n\t}\n\n\tif (Array.isArray(value)) {\n\t\tif (schema.minItems !== undefined && value.length < schema.minItems) {\n\t\t\terrors.push({ path: at, message: `Must have at least ${schema.minItems} items.` });\n\t\t}\n\t\tif (schema.maxItems !== undefined && value.length > schema.maxItems) {\n\t\t\terrors.push({ path: at, message: `Must have at most ${schema.maxItems} items.` });\n\t\t}\n\t\tif (schema.uniqueItems) {\n\t\t\tconst seen = new Set<string>();\n\t\t\tvalue.forEach((item, index) => {\n\t\t\t\tconst key = JSON.stringify(item);\n\t\t\t\tif (seen.has(key)) errors.push({ path: `${path}/${index}`, message: 'Duplicate item; items must be unique.' });\n\t\t\t\tseen.add(key);\n\t\t\t});\n\t\t}\n\t\tif (schema.items) {\n\t\t\tvalue.forEach((item, index) => {\n\t\t\t\terrors.push(...recurse(item, schema.items, `${path}/${index}`));\n\t\t\t});\n\t\t}\n\t}\n\n\tif (typeOf(value) === 'object') {\n\t\tconst obj = value as Record<string, unknown>;\n\t\tfor (const key of schema.required ?? []) {\n\t\t\tif (obj[key] === undefined) {\n\t\t\t\terrors.push({ path: `${path}/${key}`, message: `Missing required property \"${key}\".` });\n\t\t\t}\n\t\t}\n\t\tconst properties = schema.properties ?? {};\n\t\tfor (const [key, child] of Object.entries(obj)) {\n\t\t\tif (child === undefined) continue;\n\t\t\tif (key in properties) {\n\t\t\t\terrors.push(...recurse(child, properties[key], `${path}/${key}`));\n\t\t\t} else if (schema.additionalProperties === false) {\n\t\t\t\tconst known = Object.keys(properties);\n\t\t\t\terrors.push({\n\t\t\t\t\tpath: `${path}/${key}`,\n\t\t\t\t\tmessage: `Unknown property \"${key}\".${known.length ? ` Allowed: ${known.join(', ')}.` : ''}`\n\t\t\t\t});\n\t\t\t} else if (typeof schema.additionalProperties === 'object') {\n\t\t\t\terrors.push(...recurse(child, schema.additionalProperties, `${path}/${key}`));\n\t\t\t}\n\t\t}\n\t}\n\n\treturn errors;\n}\n"]}
|