@pixerate/editor 0.163.0 → 0.165.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 +54 -39
- package/dist/agent/index.js +24 -9
- package/dist/animation/index.cjs +6 -5
- package/dist/animation/index.js +5 -4
- package/dist/animation-editor/index.cjs +65 -64
- package/dist/animation-editor/index.js +8 -7
- package/dist/bridge/cli.cjs +3 -3
- package/dist/bridge/cli.js +2 -2
- package/dist/bridge/index.cjs +3 -3
- package/dist/bridge/index.js +2 -2
- package/dist/canvas/displacement.d.cts +34 -2
- package/dist/canvas/displacement.d.ts +34 -2
- package/dist/canvas/explosion-tools.d.cts +43 -0
- package/dist/canvas/explosion-tools.d.ts +43 -0
- package/dist/canvas/explosionLayout.d.cts +50 -0
- package/dist/canvas/explosionLayout.d.ts +50 -0
- package/dist/canvas/explosionState.d.cts +52 -0
- package/dist/canvas/explosionState.d.ts +52 -0
- package/dist/canvas/index.cjs +512 -168
- package/dist/canvas/index.d.cts +3 -0
- package/dist/canvas/index.d.ts +3 -0
- package/dist/canvas/index.js +434 -90
- package/dist/canvas/types.d.cts +27 -2
- package/dist/canvas/types.d.ts +27 -2
- package/dist/chart/controller.d.cts +31 -2
- package/dist/chart/controller.d.ts +31 -2
- package/dist/chart/index.cjs +504 -132
- package/dist/chart/index.d.cts +2 -0
- package/dist/chart/index.d.ts +2 -0
- package/dist/chart/index.js +386 -14
- package/dist/chart/layout-families.d.cts +7 -0
- package/dist/chart/layout-families.d.ts +7 -0
- package/dist/chart/links.d.cts +34 -0
- package/dist/chart/links.d.ts +34 -0
- package/dist/chart/mermaid.d.cts +9 -6
- package/dist/chart/mermaid.d.ts +9 -6
- package/dist/chart/schemas.d.cts +3 -0
- package/dist/chart/schemas.d.ts +3 -0
- package/dist/chart/spec.d.cts +3 -2
- package/dist/chart/spec.d.ts +3 -2
- package/dist/chart/style.d.cts +33 -0
- package/dist/chart/style.d.ts +33 -0
- package/dist/chart/types.d.cts +24 -2
- package/dist/chart/types.d.ts +24 -2
- package/dist/{chunk-TALQONZ5.js → chunk-2J5VLJHC.js} +3 -3
- package/dist/{chunk-3NEZJCBY.js → chunk-2ZRN43IN.js} +340 -201
- package/dist/{chunk-ZVNAMTFO.cjs → chunk-3FSUJIXN.cjs} +18 -174
- package/dist/{chunk-RQCMSEM5.cjs → chunk-4QUUHTGJ.cjs} +2 -2
- package/dist/{chunk-CIPIESX4.cjs → chunk-4ZC5QJE2.cjs} +3 -3
- package/dist/{chunk-S6X2QRVU.cjs → chunk-5UEFBM2M.cjs} +1 -138
- package/dist/{chunk-YSAGBIRW.cjs → chunk-64VWWR5U.cjs} +16 -16
- package/dist/{chunk-QYZGBVNC.js → chunk-7272D3K2.js} +10 -8
- package/dist/{chunk-462WGGXX.cjs → chunk-AMX23CSN.cjs} +27 -16
- package/dist/{chunk-3VLOOO3G.js → chunk-BDIM6NVW.js} +1 -1
- package/dist/{chunk-POR54B55.js → chunk-CRFSQWKQ.js} +4 -1
- package/dist/{chunk-GZ2FM3ZB.js → chunk-DKNEQX7T.js} +6 -162
- package/dist/{chunk-JCXMJUQO.cjs → chunk-EGZM52EO.cjs} +3 -3
- package/dist/{chunk-ES3UEVUT.cjs → chunk-EUIDTZNQ.cjs} +112 -110
- package/dist/{chunk-H3OEM3Q2.js → chunk-F6R67I3A.js} +1 -1
- package/dist/{chunk-5FNGLV2D.js → chunk-FEU2XVQH.js} +15 -3
- package/dist/{chunk-SZA42R4N.js → chunk-FRBRLKNQ.js} +154 -16
- package/dist/chunk-HIDFL5LQ.js +484 -0
- package/dist/{chunk-MKTDELCD.js → chunk-I5MRJW7B.js} +1 -1
- package/dist/{chunk-SDHZG5TF.js → chunk-ILP77UD6.js} +160 -2
- package/dist/{chunk-GKNEJ6EN.cjs → chunk-IMRXC7OA.cjs} +241 -103
- package/dist/chunk-KGRZMHZB.js +204 -0
- package/dist/{chunk-SET6KJOP.js → chunk-LPIKXPBM.js} +1 -1
- package/dist/{chunk-BQWGN5WH.js → chunk-M2TPMYJE.js} +1 -1
- package/dist/{chunk-GTELFJRE.cjs → chunk-M5GLQQWG.cjs} +2 -2
- package/dist/{chunk-4VU4CP7R.js → chunk-MHLU6GRJ.js} +1 -138
- package/dist/{chunk-D54JHQK2.cjs → chunk-MKXK6E4O.cjs} +51 -51
- package/dist/{chunk-DAPQGA55.js → chunk-N7NBGT2Y.js} +2 -2
- package/dist/chunk-O6OGNDND.js +164 -0
- package/dist/{chunk-22KLZZGH.cjs → chunk-ODFCS7HF.cjs} +8 -8
- package/dist/{chunk-PA3IMPPS.cjs → chunk-OVYQAYGH.cjs} +81 -81
- package/dist/{chunk-YXOW456B.js → chunk-PPEDZ5WR.js} +1 -1
- package/dist/{chunk-YGG7WDWT.cjs → chunk-Q25WAFTD.cjs} +21 -18
- package/dist/{chunk-SBQVEBSU.cjs → chunk-QO2T6KA5.cjs} +165 -67
- package/dist/{chunk-24M7VD6M.cjs → chunk-S4EIAIEW.cjs} +7 -7
- package/dist/{chunk-M4MIZPQI.cjs → chunk-SJ2CPTQC.cjs} +189 -15
- package/dist/chunk-TFF2GTGN.cjs +153 -0
- package/dist/chunk-TTCJPX4U.cjs +204 -0
- package/dist/{chunk-NZD2MZJC.cjs → chunk-TVQW26AV.cjs} +35 -23
- package/dist/{chunk-R3P2M7HU.cjs → chunk-UVXTOZ2B.cjs} +346 -207
- package/dist/{chunk-WI7QJA7A.cjs → chunk-UXETV2NC.cjs} +161 -3
- package/dist/{chunk-Z4P2RBMJ.js → chunk-V5GSY3NC.js} +101 -3
- package/dist/{chunk-QY4KUDMY.js → chunk-VRXXAXUT.js} +2 -2
- package/dist/chunk-VU6WQSMB.cjs +164 -0
- package/dist/{chunk-OXERWBKE.js → chunk-X5W645RI.js} +3 -3
- package/dist/{chunk-NHLYK3AX.js → chunk-XBQX76CT.js} +182 -8
- package/dist/{chunk-5AARIS3R.cjs → chunk-XCDGM7TD.cjs} +37 -37
- package/dist/{chunk-EVXQNQND.js → chunk-XZB3TJ6K.js} +16 -5
- package/dist/chunk-YBAPT7NL.js +153 -0
- package/dist/chunk-Z2UQYMPS.cjs +484 -0
- package/dist/color/index.cjs +5 -3
- package/dist/color/index.js +12 -10
- package/dist/diagram/index.cjs +55 -243
- package/dist/diagram/index.js +12 -200
- package/dist/export/index.cjs +7 -6
- package/dist/export/index.js +6 -5
- package/dist/extensions/index.cjs +12 -9
- package/dist/extensions/index.js +11 -8
- package/dist/gradient/index.cjs +29 -27
- package/dist/gradient/index.js +6 -4
- package/dist/image-editor/index.cjs +644 -643
- package/dist/image-editor/index.js +7 -6
- package/dist/index.cjs +21 -18
- package/dist/index.js +14 -11
- package/dist/paint-editor/index.cjs +19 -18
- package/dist/paint-editor/index.js +7 -6
- package/dist/parameters/index.cjs +2 -2
- package/dist/parameters/index.js +1 -1
- package/dist/persistence/assetWrites.d.cts +22 -0
- package/dist/persistence/assetWrites.d.ts +22 -0
- package/dist/persistence/assets.d.cts +71 -0
- package/dist/persistence/assets.d.ts +71 -0
- package/dist/persistence/documentStore.d.cts +17 -1
- package/dist/persistence/documentStore.d.ts +17 -1
- package/dist/persistence/documentTools.d.cts +5 -1
- package/dist/persistence/documentTools.d.ts +5 -1
- package/dist/persistence/editorAutosave.d.cts +7 -0
- package/dist/persistence/editorAutosave.d.ts +7 -0
- package/dist/persistence/index.cjs +141 -21
- package/dist/persistence/index.js +130 -10
- package/dist/persistence/storage.d.cts +13 -1
- package/dist/persistence/storage.d.ts +13 -1
- package/dist/spreadsheet/index.cjs +3 -3
- package/dist/spreadsheet/index.js +2 -2
- package/dist/tokens/index.cjs +11 -3
- package/dist/tokens/index.d.cts +1 -0
- package/dist/tokens/index.d.ts +1 -0
- package/dist/tokens/index.js +10 -2
- package/dist/tokens/style.d.cts +36 -0
- package/dist/tokens/style.d.ts +36 -0
- package/dist/tools/index.cjs +15 -3
- package/dist/tools/index.d.cts +2 -0
- package/dist/tools/index.d.ts +2 -0
- package/dist/tools/index.js +14 -2
- package/dist/tools/style-tools.d.cts +19 -0
- package/dist/tools/style-tools.d.ts +19 -0
- package/dist/tools/style.d.cts +212 -0
- package/dist/tools/style.d.ts +212 -0
- package/dist/tools/view.d.cts +6 -0
- package/dist/tools/view.d.ts +6 -0
- package/dist/typography/index.cjs +8 -6
- package/dist/typography/index.js +5 -3
- package/dist/vector/index.cjs +953 -952
- package/dist/vector/index.js +7 -6
- package/dist/video-editor/index.cjs +8 -7
- package/dist/video-editor/index.js +6 -5
- package/package.json +1 -1
- package/skills/README.md +12 -0
- package/skills/pixerate-agent-tools/SKILL.md +34 -1
- package/skills/pixerate-chart/SKILL.md +41 -9
- package/skills/pixerate-image-editor/SKILL.md +2 -0
- package/skills/pixerate-paint-editor/SKILL.md +2 -0
- package/skills/pixerate-tokens/SKILL.md +5 -0
- package/dist/chunk-ERAGQL2N.cjs +0 -68
- package/dist/chunk-KMU6QJB7.js +0 -68
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkUVXTOZ2Bcjs = require('./chunk-UVXTOZ2B.cjs');
|
|
12
12
|
|
|
13
13
|
// src/chart/ooxml.ts
|
|
14
14
|
var CHART_OOXML_NS = "http://schemas.openxmlformats.org/drawingml/2006/chart";
|
|
@@ -111,11 +111,11 @@ function chartFromOoxml(xml, options = {}) {
|
|
|
111
111
|
try {
|
|
112
112
|
doc = new (parser(options))().parseFromString(xml, "application/xml");
|
|
113
113
|
} catch (error) {
|
|
114
|
-
return { spec:
|
|
114
|
+
return { spec: _chunkUVXTOZ2Bcjs.normalizeChartSpec.call(void 0, {}).spec, issues: [{ path: "", message: `The chart XML could not be read: ${error.message}` }], unsupported, lossless: false };
|
|
115
115
|
}
|
|
116
116
|
const root = doc.documentElement;
|
|
117
117
|
if (!root || root.localName !== "chartSpace" || doc.getElementsByTagName("parsererror").length) {
|
|
118
|
-
return { spec:
|
|
118
|
+
return { spec: _chunkUVXTOZ2Bcjs.normalizeChartSpec.call(void 0, {}).spec, issues: [{ path: "", message: "This is not a chart part: expected a c:chartSpace (or cx:chartSpace) root element." }], unsupported, lossless: false };
|
|
119
119
|
}
|
|
120
120
|
if (_optionalChain([root, 'access', _14 => _14.namespaceURI, 'optionalAccess', _15 => _15.includes, 'call', _16 => _16("chartex")]) || kid(root, "chartData")) return readChartex(root, issues, unsupported);
|
|
121
121
|
const chart = kid(root, "chart");
|
|
@@ -280,7 +280,7 @@ function chartFromOoxml(xml, options = {}) {
|
|
|
280
280
|
}
|
|
281
281
|
if (!types.length) {
|
|
282
282
|
issues.push({ path: "plotArea", message: unsupported.length ? `The chart type is not supported: ${unsupported.join(", ")}.` : "The chart has no plot groups." });
|
|
283
|
-
return { spec:
|
|
283
|
+
return { spec: _chunkUVXTOZ2Bcjs.normalizeChartSpec.call(void 0, input).spec, issues, unsupported, lossless: false };
|
|
284
284
|
}
|
|
285
285
|
const first = types[0];
|
|
286
286
|
const combo = types.some((t) => t !== first);
|
|
@@ -290,14 +290,14 @@ function chartFromOoxml(xml, options = {}) {
|
|
|
290
290
|
if (!combo) {
|
|
291
291
|
for (const s of series) if (s.axis) issues.push({ path: "series", message: `"${s.name}" is on a second value axis.` });
|
|
292
292
|
}
|
|
293
|
-
if (types.some((t) => !
|
|
293
|
+
if (types.some((t) => !_chunkUVXTOZ2Bcjs.isCartesianChart.call(void 0, t)) && combo) unsupported.push("a pie or radar mixed with other chart types");
|
|
294
294
|
input.series = series;
|
|
295
295
|
input.categories = categories.length ? categories : Array.from({ length: Math.max(0, ...series.map((s) => s.values.length)) }, (_, i) => `${i + 1}`);
|
|
296
296
|
input.stacking = stacking;
|
|
297
297
|
input.orientation = orientation;
|
|
298
298
|
input.dataLabels = dataLabels;
|
|
299
299
|
input.points = points || first !== "line";
|
|
300
|
-
if (bool(val(groups[0], "varyColors")) && !combo &&
|
|
300
|
+
if (bool(val(groups[0], "varyColors")) && !combo && _chunkUVXTOZ2Bcjs.isCartesianChart.call(void 0, first) && series.length === 1) input.varyColors = true;
|
|
301
301
|
const readAxis = (a, fallback) => {
|
|
302
302
|
const axis = { ...fallback, format: {} };
|
|
303
303
|
if (!a) return axis;
|
|
@@ -324,12 +324,12 @@ function chartFromOoxml(xml, options = {}) {
|
|
|
324
324
|
};
|
|
325
325
|
const xy = first === "scatter" || first === "bubble";
|
|
326
326
|
const catAxis = _nullishCoalesce(_nullishCoalesce(kid(plot, "catAx"), () => ( kid(plot, "dateAx"))), () => ( (xy ? valAxes.find((a) => !vertical(a)) : void 0)));
|
|
327
|
-
input.xAxis = readAxis(catAxis,
|
|
327
|
+
input.xAxis = readAxis(catAxis, _chunkUVXTOZ2Bcjs.defaultChartAxis.call(void 0, false));
|
|
328
328
|
if (kid(plot, "dateAx")) input.xAxis.kind = "date";
|
|
329
|
-
input.yAxis = readAxis(_nullishCoalesce(_nullishCoalesce(primaryAxis, () => ( valAxes.find(vertical))), () => ( valAxes[0])),
|
|
329
|
+
input.yAxis = readAxis(_nullishCoalesce(_nullishCoalesce(primaryAxis, () => ( valAxes.find(vertical))), () => ( valAxes[0])), _chunkUVXTOZ2Bcjs.defaultChartAxis.call(void 0, true));
|
|
330
330
|
const secondaryAxis = valAxes.find((a) => a !== primaryAxis && (xy ? vertical(a) && a !== primaryAxis : true) && a !== catAxis);
|
|
331
|
-
if (series.some((s) => s.axis === "secondary") && secondaryAxis) input.yAxis2 = readAxis(secondaryAxis,
|
|
332
|
-
const { spec, issues: specIssues } =
|
|
331
|
+
if (series.some((s) => s.axis === "secondary") && secondaryAxis) input.yAxis2 = readAxis(secondaryAxis, _chunkUVXTOZ2Bcjs.defaultChartAxis.call(void 0, false));
|
|
332
|
+
const { spec, issues: specIssues } = _chunkUVXTOZ2Bcjs.normalizeChartSpec.call(void 0, input);
|
|
333
333
|
issues.push(...specIssues);
|
|
334
334
|
const uniq = [...new Set(unsupported)];
|
|
335
335
|
return { spec, issues, unsupported: uniq, lossless: uniq.length === 0 && specIssues.length === 0 };
|
|
@@ -382,7 +382,7 @@ function readChartex(root, issues, unsupported) {
|
|
|
382
382
|
const type = layouts[layout];
|
|
383
383
|
if (!type) {
|
|
384
384
|
issues.push({ path: "plotArea", message: `The chart layout "${layout || "unknown"}" is not supported.` });
|
|
385
|
-
return { spec:
|
|
385
|
+
return { spec: _chunkUVXTOZ2Bcjs.normalizeChartSpec.call(void 0, {}).spec, issues, unsupported: [layout || "unknown chartex layout"], lossless: false };
|
|
386
386
|
}
|
|
387
387
|
if (layout === "paretoLine") unsupported.push("pareto line");
|
|
388
388
|
const series = [];
|
|
@@ -409,18 +409,18 @@ function readChartex(root, issues, unsupported) {
|
|
|
409
409
|
const first = data.get(_nullishCoalesce(_optionalChain([kid, 'call', _35 => _35(seriesEls[0], "dataId"), 'optionalAccess', _36 => _36.getAttribute, 'call', _37 => _37("val")]), () => ( "0")));
|
|
410
410
|
if ((type === "treemap" || type === "sunburst") && _optionalChain([first, 'optionalAccess', _38 => _38.paths])) {
|
|
411
411
|
const treeIssues = [];
|
|
412
|
-
input.tree =
|
|
412
|
+
input.tree = _chunkUVXTOZ2Bcjs.chartTreeFromRows.call(void 0, first.paths.map((path2, i) => ({ path: path2, value: _nullishCoalesce(first.values[i], () => ( 0)) })), treeIssues);
|
|
413
413
|
for (const t of treeIssues) issues.push({ path: "chartData", message: t.message });
|
|
414
414
|
}
|
|
415
|
-
const { spec, issues: specIssues } =
|
|
415
|
+
const { spec, issues: specIssues } = _chunkUVXTOZ2Bcjs.normalizeChartSpec.call(void 0, input);
|
|
416
416
|
issues.push(...specIssues);
|
|
417
417
|
return { spec, issues, unsupported, lossless: unsupported.length === 0 && specIssues.length === 0 };
|
|
418
418
|
}
|
|
419
419
|
var esc = (s) => s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
420
420
|
var hex = (color) => {
|
|
421
421
|
if (!color) return null;
|
|
422
|
-
const rgb =
|
|
423
|
-
return rgb ?
|
|
422
|
+
const rgb = _chunkUVXTOZ2Bcjs.parseChartColor.call(void 0, color);
|
|
423
|
+
return rgb ? _chunkUVXTOZ2Bcjs.chartRgbToHex.call(void 0, rgb).slice(1).toUpperCase() : null;
|
|
424
424
|
};
|
|
425
425
|
var fillXml = (color, line = false) => {
|
|
426
426
|
const h = hex(color);
|
|
@@ -464,7 +464,7 @@ function errBarsXml(bars, dir) {
|
|
|
464
464
|
var MARKER_OUT = { circle: "circle", square: "square", diamond: "diamond", triangle: "triangle", cross: "x", none: "none" };
|
|
465
465
|
function chartToOoxml(spec) {
|
|
466
466
|
const issues = [];
|
|
467
|
-
const family =
|
|
467
|
+
const family = _chunkUVXTOZ2Bcjs.chartFamily.call(void 0, spec);
|
|
468
468
|
let type = spec.type;
|
|
469
469
|
if (family === "waterfall" || family === "histogram" || family === "box" || family === "funnel") {
|
|
470
470
|
issues.push(`${spec.type} charts are written as bar charts: DrawingML has no ${spec.type} type (Office 2016 stores it as chartex).`);
|
|
@@ -475,6 +475,9 @@ function chartToOoxml(spec) {
|
|
|
475
475
|
} else if (family === "sunburst") {
|
|
476
476
|
issues.push(`Sunburst charts are written as doughnut charts of the ${spec.tree.length ? "top-level group totals" : "values"}: DrawingML has no sunburst type (Office 2016 stores it as chartex).`);
|
|
477
477
|
type = "donut";
|
|
478
|
+
} else if (family === "sankey") {
|
|
479
|
+
issues.push("Sankey diagrams are written as bar charts of how much passes through each node: DrawingML has no flows.");
|
|
480
|
+
type = "bar";
|
|
478
481
|
} else if (family === "parliament") {
|
|
479
482
|
issues.push("Parliament charts are written as doughnut charts of the seats: DrawingML has no parliament type.");
|
|
480
483
|
type = "donut";
|
|
@@ -499,7 +502,7 @@ function chartToOoxml(spec) {
|
|
|
499
502
|
const ids = { cat: 500000001, val: 500000002, cat2: 500000003, val2: 500000004 };
|
|
500
503
|
const xy = family === "xy" || type === "scatter" || type === "bubble";
|
|
501
504
|
const pieLike = type === "pie" || type === "donut";
|
|
502
|
-
const typed = (s) => pieLike || type === "radar" ? type : type === "bubble" ? "bubble" : xy ? "scatter" :
|
|
505
|
+
const typed = (s) => pieLike || type === "radar" ? type : type === "bubble" ? "bubble" : xy ? "scatter" : _chunkUVXTOZ2Bcjs.chartSeriesType.call(void 0, { type }, s);
|
|
503
506
|
const groups = [];
|
|
504
507
|
visible.forEach((s) => {
|
|
505
508
|
const kind = typed(s);
|
|
@@ -562,7 +565,7 @@ function chartToOoxml(spec) {
|
|
|
562
565
|
return `<c:ser>${parts.join("")}</c:ser>`;
|
|
563
566
|
};
|
|
564
567
|
const dLbls = `<c:dLbls><c:showLegendKey val="0"/><c:showVal val="${spec.dataLabels ? 1 : 0}"/><c:showCatName val="0"/><c:showSerName val="0"/><c:showPercent val="0"/><c:showBubbleSize val="0"/></c:dLbls>`;
|
|
565
|
-
const vary =
|
|
568
|
+
const vary = _chunkUVXTOZ2Bcjs.chartVariesColors.call(void 0, spec) ? 1 : 0;
|
|
566
569
|
const groupXml = groups.map((g) => {
|
|
567
570
|
const axes2 = g.secondary ? `<c:axId val="${ids.cat2}"/><c:axId val="${ids.val2}"/>` : `<c:axId val="${ids.cat}"/><c:axId val="${ids.val}"/>`;
|
|
568
571
|
const sers = g.series.map(({ s, index }) => serXml(g.kind, s, index)).join("");
|