@pixerate/editor 0.146.0 → 0.148.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.
Files changed (132) hide show
  1. package/README.md +3 -1
  2. package/THIRD_PARTY_NOTICES.md +1 -1
  3. package/dist/agent/index.cjs +36 -34
  4. package/dist/agent/index.js +7 -5
  5. package/dist/animation/index.cjs +5 -3
  6. package/dist/animation/index.js +4 -2
  7. package/dist/animation-editor/index.cjs +62 -60
  8. package/dist/animation-editor/index.js +6 -4
  9. package/dist/canvas/index.cjs +36 -34
  10. package/dist/canvas/index.js +19 -17
  11. package/dist/chart/index.cjs +88 -86
  12. package/dist/chart/index.js +7 -5
  13. package/dist/{chunk-WBJ6BG4R.js → chunk-2AQL4JHM.js} +6 -6
  14. package/dist/{chunk-HLMF3E53.cjs → chunk-2WDZI6QD.cjs} +15 -15
  15. package/dist/{chunk-ZNHB5RG6.js → chunk-37RLSNQ3.js} +2 -2
  16. package/dist/{chunk-5WOY52O6.cjs → chunk-4YQKRHMI.cjs} +8 -8
  17. package/dist/chunk-6ONMQ6WF.js +113 -0
  18. package/dist/{chunk-L434J57V.cjs → chunk-6QTON3VW.cjs} +16 -16
  19. package/dist/chunk-AA34BA7G.js +1913 -0
  20. package/dist/{chunk-QX25HWFL.js → chunk-AY65VQSU.js} +1 -1
  21. package/dist/{chunk-ONZJD2OD.cjs → chunk-BROJYMWU.cjs} +57 -153
  22. package/dist/{chunk-YM75DN54.js → chunk-DSZCDNTM.js} +1 -1
  23. package/dist/{chunk-PUR6BZFA.cjs → chunk-DVLMW3GB.cjs} +53 -53
  24. package/dist/{chunk-ALUWD3FG.js → chunk-EIUTJPEL.js} +1 -1
  25. package/dist/{chunk-X65C4DWV.js → chunk-EQ4SF4X4.js} +1 -1
  26. package/dist/{chunk-77SG47WT.js → chunk-FLOGD3QB.js} +1 -1
  27. package/dist/{chunk-AJSW5GMP.js → chunk-HVQVHUTV.js} +19 -115
  28. package/dist/{chunk-UR37VCIR.cjs → chunk-I4AHLP7F.cjs} +16 -35
  29. package/dist/chunk-IPJ3TEYR.cjs +113 -0
  30. package/dist/chunk-KY3FYKP3.js +52 -0
  31. package/dist/chunk-LEUZ4FRC.cjs +52 -0
  32. package/dist/{chunk-H6FX45CP.cjs → chunk-LIXLD433.cjs} +37 -37
  33. package/dist/{chunk-6GAYGQDC.js → chunk-O5ML2I6O.js} +3 -3
  34. package/dist/{chunk-KI2VBONS.js → chunk-OET45HIR.js} +2 -2
  35. package/dist/{chunk-XNZWATSB.cjs → chunk-QCEQIRJQ.cjs} +85 -85
  36. package/dist/{chunk-HRI3ZMDM.cjs → chunk-RHXW4TA5.cjs} +3 -3
  37. package/dist/{chunk-UUTTJK77.cjs → chunk-SUF6WRXR.cjs} +2 -2
  38. package/dist/{chunk-RN767PO6.js → chunk-SUVZJ2CP.js} +15 -34
  39. package/dist/{chunk-FLUTRPLY.cjs → chunk-TLMRGLQQ.cjs} +16 -16
  40. package/dist/{chunk-DAS7M4RY.js → chunk-UILRJQFD.js} +2 -2
  41. package/dist/chunk-UKCJ43YL.cjs +1913 -0
  42. package/dist/{chunk-XQ33O5BC.cjs → chunk-X35BV5YT.cjs} +44 -44
  43. package/dist/{chunk-6HMEHNWW.cjs → chunk-XTU6QO2W.cjs} +26 -26
  44. package/dist/{chunk-VM6JYWXQ.js → chunk-ZQUANEK4.js} +2 -2
  45. package/dist/cms/index.cjs +5 -3
  46. package/dist/cms/index.js +18 -16
  47. package/dist/color/contrast.d.cts +14 -0
  48. package/dist/color/contrast.d.ts +14 -0
  49. package/dist/color/convert.d.cts +30 -0
  50. package/dist/color/convert.d.ts +30 -0
  51. package/dist/color/dual.d.cts +98 -0
  52. package/dist/color/dual.d.ts +98 -0
  53. package/dist/color/format.d.cts +12 -0
  54. package/dist/color/format.d.ts +12 -0
  55. package/dist/color/gamut.d.cts +12 -0
  56. package/dist/color/gamut.d.ts +12 -0
  57. package/dist/color/harmony.d.cts +22 -0
  58. package/dist/color/harmony.d.ts +22 -0
  59. package/dist/color/index.cjs +115 -0
  60. package/dist/color/index.d.cts +18 -0
  61. package/dist/color/index.d.ts +18 -0
  62. package/dist/color/index.js +115 -0
  63. package/dist/color/mix.d.cts +11 -0
  64. package/dist/color/mix.d.ts +11 -0
  65. package/dist/color/named.d.cts +5 -0
  66. package/dist/color/named.d.ts +5 -0
  67. package/dist/color/parse.d.cts +11 -0
  68. package/dist/color/parse.d.ts +11 -0
  69. package/dist/color/picker.d.cts +52 -0
  70. package/dist/color/picker.d.ts +52 -0
  71. package/dist/color/recent.d.cts +8 -0
  72. package/dist/color/recent.d.ts +8 -0
  73. package/dist/color/tools.d.cts +15 -0
  74. package/dist/color/tools.d.ts +15 -0
  75. package/dist/color/types.d.cts +41 -0
  76. package/dist/color/types.d.ts +41 -0
  77. package/dist/color/vision.d.cts +36 -0
  78. package/dist/color/vision.d.ts +36 -0
  79. package/dist/effects/authoring-session.d.cts +25 -0
  80. package/dist/effects/authoring-session.d.ts +25 -0
  81. package/dist/effects/authoring-tools.d.cts +31 -0
  82. package/dist/effects/authoring-tools.d.ts +31 -0
  83. package/dist/effects/authoring.d.cts +152 -0
  84. package/dist/effects/authoring.d.ts +152 -0
  85. package/dist/effects/conformance.d.cts +2 -0
  86. package/dist/effects/conformance.d.ts +2 -0
  87. package/dist/effects/fake.d.cts +2 -0
  88. package/dist/effects/fake.d.ts +2 -0
  89. package/dist/effects/index.cjs +1216 -9
  90. package/dist/effects/index.d.cts +3 -0
  91. package/dist/effects/index.d.ts +3 -0
  92. package/dist/effects/index.js +1210 -3
  93. package/dist/effects/types.d.cts +9 -2
  94. package/dist/effects/types.d.ts +9 -2
  95. package/dist/effects/ui.d.cts +8 -0
  96. package/dist/effects/ui.d.ts +8 -0
  97. package/dist/export/index.cjs +6 -4
  98. package/dist/export/index.js +5 -3
  99. package/dist/extensions/index.cjs +10 -8
  100. package/dist/extensions/index.js +9 -7
  101. package/dist/gradient/controller.d.cts +109 -0
  102. package/dist/gradient/controller.d.ts +109 -0
  103. package/dist/gradient/editor.d.cts +38 -0
  104. package/dist/gradient/editor.d.ts +38 -0
  105. package/dist/gradient/index.cjs +1549 -0
  106. package/dist/gradient/index.d.cts +5 -0
  107. package/dist/gradient/index.d.ts +5 -0
  108. package/dist/gradient/index.js +1549 -0
  109. package/dist/gradient/model.d.cts +94 -0
  110. package/dist/gradient/model.d.ts +94 -0
  111. package/dist/gradient/tools.d.cts +11 -0
  112. package/dist/gradient/tools.d.ts +11 -0
  113. package/dist/gradient/types.d.cts +44 -0
  114. package/dist/gradient/types.d.ts +44 -0
  115. package/dist/image-editor/index.cjs +649 -647
  116. package/dist/image-editor/index.js +6 -4
  117. package/dist/index.cjs +19 -17
  118. package/dist/index.js +16 -14
  119. package/dist/paint-editor/color.d.cts +3 -13
  120. package/dist/paint-editor/color.d.ts +3 -13
  121. package/dist/paint-editor/index.cjs +23 -68
  122. package/dist/paint-editor/index.js +15 -60
  123. package/dist/vector/index.cjs +950 -948
  124. package/dist/vector/index.js +5 -3
  125. package/dist/video-editor/index.cjs +5 -3
  126. package/dist/video-editor/index.js +4 -2
  127. package/package.json +21 -1
  128. package/skills/README.md +2 -0
  129. package/skills/pixerate-color/SKILL.md +69 -0
  130. package/skills/pixerate-effect-authoring/SKILL.md +80 -0
  131. package/dist/chunk-45VRG4RB.js +0 -65
  132. package/dist/chunk-5FXOR7F2.cjs +0 -65
@@ -7,7 +7,7 @@ import {
7
7
  TRENDLINE_PROPS,
8
8
  VALUE,
9
9
  WIDTH
10
- } from "../chunk-ALUWD3FG.js";
10
+ } from "../chunk-EIUTJPEL.js";
11
11
  import {
12
12
  CHART_OOXML_CONTENT_TYPE,
13
13
  CHART_OOXML_NS,
@@ -15,7 +15,7 @@ import {
15
15
  chartFormatToCode,
16
16
  chartFromOoxml,
17
17
  chartToOoxml
18
- } from "../chunk-X65C4DWV.js";
18
+ } from "../chunk-EQ4SF4X4.js";
19
19
  import {
20
20
  CHART_COLOR_SCHEMES,
21
21
  CHART_LAYOUT_PRESETS,
@@ -37,7 +37,7 @@ import {
37
37
  monochromeChartPalette,
38
38
  sparklineToSvg,
39
39
  summarizeChart
40
- } from "../chunk-KI2VBONS.js";
40
+ } from "../chunk-OET45HIR.js";
41
41
  import {
42
42
  CHART_DATE_STEPS,
43
43
  MAX_CHART_DATA_LABELS,
@@ -76,7 +76,7 @@ import {
76
76
  stepDecimals,
77
77
  summarizeChartSeries,
78
78
  trendNumberText
79
- } from "../chunk-YM75DN54.js";
79
+ } from "../chunk-DSZCDNTM.js";
80
80
  import {
81
81
  CHART_AXIS_KINDS,
82
82
  CHART_AXIS_SCALES,
@@ -137,7 +137,7 @@ import {
137
137
  shadeChartColor,
138
138
  simulateChartVision,
139
139
  uniqueChartSeriesId
140
- } from "../chunk-RN767PO6.js";
140
+ } from "../chunk-SUVZJ2CP.js";
141
141
  import "../chunk-II2WIF5Z.js";
142
142
  import {
143
143
  parseCsv
@@ -154,6 +154,8 @@ import {
154
154
  readZip
155
155
  } from "../chunk-CIQIM2IP.js";
156
156
  import "../chunk-RNSANXPT.js";
157
+ import "../chunk-AA34BA7G.js";
158
+ import "../chunk-6ONMQ6WF.js";
157
159
 
158
160
  // src/chart/raster.ts
159
161
  var CHART_RASTER_MAX_SIZE = 1024;
@@ -1,6 +1,3 @@
1
- import {
2
- compareDocuments
3
- } from "./chunk-V5OOP74P.js";
4
1
  import {
5
2
  DEFAULT_STYLES,
6
3
  NORMAL_STYLE_ID,
@@ -10,7 +7,10 @@ import {
10
7
  import {
11
8
  CHART_OOXML_NS,
12
9
  chartFromOoxml
13
- } from "./chunk-X65C4DWV.js";
10
+ } from "./chunk-EQ4SF4X4.js";
11
+ import {
12
+ compareDocuments
13
+ } from "./chunk-V5OOP74P.js";
14
14
  import {
15
15
  Chart,
16
16
  MAX_TABLE_COLUMNS,
@@ -34,10 +34,10 @@ import {
34
34
  searchDocument,
35
35
  sliceContainsTable,
36
36
  syncInitialContent
37
- } from "./chunk-6GAYGQDC.js";
37
+ } from "./chunk-O5ML2I6O.js";
38
38
  import {
39
39
  chartDataToTable
40
- } from "./chunk-RN767PO6.js";
40
+ } from "./chunk-SUVZJ2CP.js";
41
41
  import {
42
42
  PIXERATE_DOCUMENT_MIME,
43
43
  getClipboardData,
@@ -6,7 +6,7 @@
6
6
 
7
7
 
8
8
 
9
- var _chunkUR37VCIRcjs = require('./chunk-UR37VCIR.cjs');
9
+ var _chunkI4AHLP7Fcjs = require('./chunk-I4AHLP7F.cjs');
10
10
 
11
11
  // src/chart/ooxml.ts
12
12
  var CHART_OOXML_NS = "http://schemas.openxmlformats.org/drawingml/2006/chart";
@@ -109,11 +109,11 @@ function chartFromOoxml(xml, options = {}) {
109
109
  try {
110
110
  doc = new (parser(options))().parseFromString(xml, "application/xml");
111
111
  } catch (error) {
112
- return { spec: _chunkUR37VCIRcjs.normalizeChartSpec.call(void 0, {}).spec, issues: [{ path: "", message: `The chart XML could not be read: ${error.message}` }], unsupported, lossless: false };
112
+ return { spec: _chunkI4AHLP7Fcjs.normalizeChartSpec.call(void 0, {}).spec, issues: [{ path: "", message: `The chart XML could not be read: ${error.message}` }], unsupported, lossless: false };
113
113
  }
114
114
  const root = doc.documentElement;
115
115
  if (!root || root.localName !== "chartSpace" || doc.getElementsByTagName("parsererror").length) {
116
- return { spec: _chunkUR37VCIRcjs.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 };
116
+ return { spec: _chunkI4AHLP7Fcjs.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 };
117
117
  }
118
118
  if (_optionalChain([root, 'access', _14 => _14.namespaceURI, 'optionalAccess', _15 => _15.includes, 'call', _16 => _16("chartex")]) || kid(root, "chartData")) return readChartex(root, issues, unsupported);
119
119
  const chart = kid(root, "chart");
@@ -278,7 +278,7 @@ function chartFromOoxml(xml, options = {}) {
278
278
  }
279
279
  if (!types.length) {
280
280
  issues.push({ path: "plotArea", message: unsupported.length ? `The chart type is not supported: ${unsupported.join(", ")}.` : "The chart has no plot groups." });
281
- return { spec: _chunkUR37VCIRcjs.normalizeChartSpec.call(void 0, input).spec, issues, unsupported, lossless: false };
281
+ return { spec: _chunkI4AHLP7Fcjs.normalizeChartSpec.call(void 0, input).spec, issues, unsupported, lossless: false };
282
282
  }
283
283
  const first = types[0];
284
284
  const combo = types.some((t) => t !== first);
@@ -288,7 +288,7 @@ function chartFromOoxml(xml, options = {}) {
288
288
  if (!combo) {
289
289
  for (const s of series) if (s.axis) issues.push({ path: "series", message: `"${s.name}" is on a second value axis.` });
290
290
  }
291
- if (types.some((t) => !_chunkUR37VCIRcjs.isCartesianChart.call(void 0, t)) && combo) unsupported.push("a pie or radar mixed with other chart types");
291
+ if (types.some((t) => !_chunkI4AHLP7Fcjs.isCartesianChart.call(void 0, t)) && combo) unsupported.push("a pie or radar mixed with other chart types");
292
292
  input.series = series;
293
293
  input.categories = categories.length ? categories : Array.from({ length: Math.max(0, ...series.map((s) => s.values.length)) }, (_, i) => `${i + 1}`);
294
294
  input.stacking = stacking;
@@ -322,12 +322,12 @@ function chartFromOoxml(xml, options = {}) {
322
322
  };
323
323
  const xy = first === "scatter" || first === "bubble";
324
324
  const catAxis = _nullishCoalesce(_nullishCoalesce(kid(plot, "catAx"), () => ( kid(plot, "dateAx"))), () => ( (xy ? valAxes.find((a) => !vertical(a)) : void 0)));
325
- input.xAxis = readAxis(catAxis, _chunkUR37VCIRcjs.defaultChartAxis.call(void 0, false));
325
+ input.xAxis = readAxis(catAxis, _chunkI4AHLP7Fcjs.defaultChartAxis.call(void 0, false));
326
326
  if (kid(plot, "dateAx")) input.xAxis.kind = "date";
327
- input.yAxis = readAxis(_nullishCoalesce(_nullishCoalesce(primaryAxis, () => ( valAxes.find(vertical))), () => ( valAxes[0])), _chunkUR37VCIRcjs.defaultChartAxis.call(void 0, true));
327
+ input.yAxis = readAxis(_nullishCoalesce(_nullishCoalesce(primaryAxis, () => ( valAxes.find(vertical))), () => ( valAxes[0])), _chunkI4AHLP7Fcjs.defaultChartAxis.call(void 0, true));
328
328
  const secondaryAxis = valAxes.find((a) => a !== primaryAxis && (xy ? vertical(a) && a !== primaryAxis : true) && a !== catAxis);
329
- if (series.some((s) => s.axis === "secondary") && secondaryAxis) input.yAxis2 = readAxis(secondaryAxis, _chunkUR37VCIRcjs.defaultChartAxis.call(void 0, false));
330
- const { spec, issues: specIssues } = _chunkUR37VCIRcjs.normalizeChartSpec.call(void 0, input);
329
+ if (series.some((s) => s.axis === "secondary") && secondaryAxis) input.yAxis2 = readAxis(secondaryAxis, _chunkI4AHLP7Fcjs.defaultChartAxis.call(void 0, false));
330
+ const { spec, issues: specIssues } = _chunkI4AHLP7Fcjs.normalizeChartSpec.call(void 0, input);
331
331
  issues.push(...specIssues);
332
332
  const uniq = [...new Set(unsupported)];
333
333
  return { spec, issues, unsupported: uniq, lossless: uniq.length === 0 && specIssues.length === 0 };
@@ -357,7 +357,7 @@ function readChartex(root, issues, unsupported) {
357
357
  const type = layouts[layout];
358
358
  if (!type) {
359
359
  issues.push({ path: "plotArea", message: `The chart layout "${layout || "unknown"}" is not supported.` });
360
- return { spec: _chunkUR37VCIRcjs.normalizeChartSpec.call(void 0, {}).spec, issues, unsupported: [layout || "unknown chartex layout"], lossless: false };
360
+ return { spec: _chunkI4AHLP7Fcjs.normalizeChartSpec.call(void 0, {}).spec, issues, unsupported: [layout || "unknown chartex layout"], lossless: false };
361
361
  }
362
362
  if (layout === "sunburst") unsupported.push("sunburst (drawn as a treemap of the innermost level)");
363
363
  if (layout === "paretoLine") unsupported.push("pareto line");
@@ -382,15 +382,15 @@ function readChartex(root, issues, unsupported) {
382
382
  categories: categories.length >= longest ? categories : Array.from({ length: longest }, (_, i) => _nullishCoalesce(categories[i], () => ( `${i + 1}`)))
383
383
  };
384
384
  if (type === "waterfall") input.showTotal = false;
385
- const { spec, issues: specIssues } = _chunkUR37VCIRcjs.normalizeChartSpec.call(void 0, input);
385
+ const { spec, issues: specIssues } = _chunkI4AHLP7Fcjs.normalizeChartSpec.call(void 0, input);
386
386
  issues.push(...specIssues);
387
387
  return { spec, issues, unsupported, lossless: unsupported.length === 0 && specIssues.length === 0 };
388
388
  }
389
389
  var esc = (s) => s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
390
390
  var hex = (color) => {
391
391
  if (!color) return null;
392
- const rgb = _chunkUR37VCIRcjs.parseChartColor.call(void 0, color);
393
- return rgb ? _chunkUR37VCIRcjs.chartRgbToHex.call(void 0, rgb).slice(1).toUpperCase() : null;
392
+ const rgb = _chunkI4AHLP7Fcjs.parseChartColor.call(void 0, color);
393
+ return rgb ? _chunkI4AHLP7Fcjs.chartRgbToHex.call(void 0, rgb).slice(1).toUpperCase() : null;
394
394
  };
395
395
  var fillXml = (color, line = false) => {
396
396
  const h = hex(color);
@@ -434,7 +434,7 @@ function errBarsXml(bars, dir) {
434
434
  var MARKER_OUT = { circle: "circle", square: "square", diamond: "diamond", triangle: "triangle", cross: "x", none: "none" };
435
435
  function chartToOoxml(spec) {
436
436
  const issues = [];
437
- const family = _chunkUR37VCIRcjs.chartFamily.call(void 0, spec);
437
+ const family = _chunkI4AHLP7Fcjs.chartFamily.call(void 0, spec);
438
438
  let type = spec.type;
439
439
  if (family === "waterfall" || family === "histogram" || family === "box" || family === "funnel") {
440
440
  issues.push(`${spec.type} charts are written as bar charts: DrawingML has no ${spec.type} type (Office 2016 stores it as chartex).`);
@@ -449,7 +449,7 @@ function chartToOoxml(spec) {
449
449
  const ids = { cat: 500000001, val: 500000002, cat2: 500000003, val2: 500000004 };
450
450
  const xy = family === "xy" || type === "scatter" || type === "bubble";
451
451
  const pieLike = type === "pie" || type === "donut";
452
- const typed = (s) => pieLike || type === "radar" ? type : type === "bubble" ? "bubble" : xy ? "scatter" : _chunkUR37VCIRcjs.chartSeriesType.call(void 0, { type }, s);
452
+ const typed = (s) => pieLike || type === "radar" ? type : type === "bubble" ? "bubble" : xy ? "scatter" : _chunkI4AHLP7Fcjs.chartSeriesType.call(void 0, { type }, s);
453
453
  const groups = [];
454
454
  visible.forEach((s) => {
455
455
  const kind = typed(s);
@@ -11,10 +11,10 @@ import {
11
11
  CHART_OOXML_NS,
12
12
  CHART_OOXML_RELATIONSHIP,
13
13
  chartToOoxml
14
- } from "./chunk-X65C4DWV.js";
14
+ } from "./chunk-EQ4SF4X4.js";
15
15
  import {
16
16
  normalizeChartSpec
17
- } from "./chunk-RN767PO6.js";
17
+ } from "./chunk-SUVZJ2CP.js";
18
18
 
19
19
  // src/export/images.ts
20
20
  var DOCX_IMAGE_TYPES = {
@@ -11,10 +11,10 @@ var _chunkYN6JKAUEcjs = require('./chunk-YN6JKAUE.cjs');
11
11
 
12
12
 
13
13
 
14
- var _chunkHLMF3E53cjs = require('./chunk-HLMF3E53.cjs');
14
+ var _chunk2WDZI6QDcjs = require('./chunk-2WDZI6QD.cjs');
15
15
 
16
16
 
17
- var _chunkUR37VCIRcjs = require('./chunk-UR37VCIR.cjs');
17
+ var _chunkI4AHLP7Fcjs = require('./chunk-I4AHLP7F.cjs');
18
18
 
19
19
  // src/export/images.ts
20
20
  var DOCX_IMAGE_TYPES = {
@@ -1028,12 +1028,12 @@ var DocxBuilder = (_class2 = class {
1028
1028
  this.drop("node", "chart", "chart has no spec");
1029
1029
  return;
1030
1030
  }
1031
- const spec = _chunkUR37VCIRcjs.normalizeChartSpec.call(void 0, raw).spec;
1032
- const written = _chunkHLMF3E53cjs.chartToOoxml.call(void 0, spec);
1031
+ const spec = _chunkI4AHLP7Fcjs.normalizeChartSpec.call(void 0, raw).spec;
1032
+ const written = _chunk2WDZI6QDcjs.chartToOoxml.call(void 0, spec);
1033
1033
  for (const issue of written.issues) this.drop("node", "chart", issue);
1034
1034
  const name = `chart${this.charts.length + 1}.xml`;
1035
1035
  this.charts.push(written.xml);
1036
- const relId = this.rels.add(_chunkHLMF3E53cjs.CHART_OOXML_RELATIONSHIP, `charts/${name}`);
1036
+ const relId = this.rels.add(_chunk2WDZI6QDcjs.CHART_OOXML_RELATIONSHIP, `charts/${name}`);
1037
1037
  let width = _nullishCoalesce(pixelAttr(_optionalChain([node, 'access', _91 => _91.attrs, 'optionalAccess', _92 => _92.width])), () => ( MAX_IMAGE_WIDTH_PX));
1038
1038
  let height = _nullishCoalesce(pixelAttr(_optionalChain([node, 'access', _93 => _93.attrs, 'optionalAccess', _94 => _94.height])), () => ( 320));
1039
1039
  if (width > MAX_IMAGE_WIDTH_PX) {
@@ -1050,8 +1050,8 @@ var DocxBuilder = (_class2 = class {
1050
1050
  drawing.empty("wp:extent", { cx, cy }).empty("wp:effectExtent", { l: 0, t: 0, r: 0, b: 0 });
1051
1051
  drawing.empty("wp:docPr", { id, name: `Chart ${id}`, descr: title || void 0, title: title || void 0 });
1052
1052
  drawing.empty("wp:cNvGraphicFramePr");
1053
- drawing.open("a:graphic").open("a:graphicData", { uri: _chunkHLMF3E53cjs.CHART_OOXML_NS });
1054
- drawing.empty("c:chart", { "xmlns:c": _chunkHLMF3E53cjs.CHART_OOXML_NS, "r:id": relId });
1053
+ drawing.open("a:graphic").open("a:graphicData", { uri: _chunk2WDZI6QDcjs.CHART_OOXML_NS });
1054
+ drawing.empty("c:chart", { "xmlns:c": _chunk2WDZI6QDcjs.CHART_OOXML_NS, "r:id": relId });
1055
1055
  drawing.close("a:graphicData").close("a:graphic").close("wp:inline").close("w:drawing").close("w:r");
1056
1056
  this.report.written.paragraphs++;
1057
1057
  w.open("w:p");
@@ -1384,7 +1384,7 @@ var DocxBuilder = (_class2 = class {
1384
1384
  if (people) add("word/people.xml", people, `${CT_WML}people+xml`);
1385
1385
  parts.push({ name: "word/_rels/document.xml.rels", data: this.rels.xml() });
1386
1386
  for (const file of this.media) parts.push({ name: `word/media/${file.name}`, data: file.bytes });
1387
- this.charts.forEach((xml, i) => add(`word/charts/chart${i + 1}.xml`, xml, _chunkHLMF3E53cjs.CHART_OOXML_CONTENT_TYPE));
1387
+ this.charts.forEach((xml, i) => add(`word/charts/chart${i + 1}.xml`, xml, _chunk2WDZI6QDcjs.CHART_OOXML_CONTENT_TYPE));
1388
1388
  add("docProps/core.xml", this.coreXml(now), "application/vnd.openxmlformats-package.core-properties+xml");
1389
1389
  const app = new XmlWriter();
1390
1390
  app.open("Properties", { xmlns: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" });
@@ -0,0 +1,113 @@
1
+ // src/cms/math.ts
2
+ var D50 = [0.9642, 1, 0.8249];
3
+ var D65_XY = [0.3127, 0.329];
4
+ var IDENTITY = [
5
+ [1, 0, 0],
6
+ [0, 1, 0],
7
+ [0, 0, 1]
8
+ ];
9
+ function mul(a, b) {
10
+ const o = [
11
+ [0, 0, 0],
12
+ [0, 0, 0],
13
+ [0, 0, 0]
14
+ ];
15
+ for (let i = 0; i < 3; i++) for (let j = 0; j < 3; j++) o[i][j] = a[i][0] * b[0][j] + a[i][1] * b[1][j] + a[i][2] * b[2][j];
16
+ return o;
17
+ }
18
+ function apply(m, v) {
19
+ return [m[0][0] * v[0] + m[0][1] * v[1] + m[0][2] * v[2], m[1][0] * v[0] + m[1][1] * v[1] + m[1][2] * v[2], m[2][0] * v[0] + m[2][1] * v[1] + m[2][2] * v[2]];
20
+ }
21
+ function det(m) {
22
+ return m[0][0] * (m[1][1] * m[2][2] - m[1][2] * m[2][1]) - m[0][1] * (m[1][0] * m[2][2] - m[1][2] * m[2][0]) + m[0][2] * (m[1][0] * m[2][1] - m[1][1] * m[2][0]);
23
+ }
24
+ function invert(m) {
25
+ const d = det(m);
26
+ if (!Number.isFinite(d) || Math.abs(d) < 1e-12) return null;
27
+ const k = 1 / d;
28
+ return [
29
+ [(m[1][1] * m[2][2] - m[1][2] * m[2][1]) * k, (m[0][2] * m[2][1] - m[0][1] * m[2][2]) * k, (m[0][1] * m[1][2] - m[0][2] * m[1][1]) * k],
30
+ [(m[1][2] * m[2][0] - m[1][0] * m[2][2]) * k, (m[0][0] * m[2][2] - m[0][2] * m[2][0]) * k, (m[0][2] * m[1][0] - m[0][0] * m[1][2]) * k],
31
+ [(m[1][0] * m[2][1] - m[1][1] * m[2][0]) * k, (m[0][1] * m[2][0] - m[0][0] * m[2][1]) * k, (m[0][0] * m[1][1] - m[0][1] * m[1][0]) * k]
32
+ ];
33
+ }
34
+ function xyToXyz(xy) {
35
+ const [x, y] = xy;
36
+ return [x / y, 1, (1 - x - y) / y];
37
+ }
38
+ var BRADFORD = [
39
+ [0.8951, 0.2664, -0.1614],
40
+ [-0.7502, 1.7135, 0.0367],
41
+ [0.0389, -0.0685, 1.0296]
42
+ ];
43
+ function bradford(src, dst) {
44
+ const inv = invert(BRADFORD);
45
+ const s = apply(BRADFORD, src);
46
+ const d = apply(BRADFORD, dst);
47
+ const scale = [
48
+ [d[0] / s[0], 0, 0],
49
+ [0, d[1] / s[1], 0],
50
+ [0, 0, d[2] / s[2]]
51
+ ];
52
+ return mul(inv, mul(scale, BRADFORD));
53
+ }
54
+ function rgbToXyzMatrix(r, g, b, white) {
55
+ const xr = xyToXyz(r);
56
+ const xg = xyToXyz(g);
57
+ const xb = xyToXyz(b);
58
+ const m = [
59
+ [xr[0], xg[0], xb[0]],
60
+ [xr[1], xg[1], xb[1]],
61
+ [xr[2], xg[2], xb[2]]
62
+ ];
63
+ const inv = invert(m);
64
+ if (!inv) return null;
65
+ const s = apply(inv, white);
66
+ return [
67
+ [m[0][0] * s[0], m[0][1] * s[1], m[0][2] * s[2]],
68
+ [m[1][0] * s[0], m[1][1] * s[1], m[1][2] * s[2]],
69
+ [m[2][0] * s[0], m[2][1] * s[1], m[2][2] * s[2]]
70
+ ];
71
+ }
72
+ var EPS = 216 / 24389;
73
+ var KAPPA = 24389 / 27;
74
+ var labF = (t) => t > EPS ? Math.cbrt(t) : (KAPPA * t + 16) / 116;
75
+ var labFinv = (f) => {
76
+ const f3 = f * f * f;
77
+ return f3 > EPS ? f3 : (116 * f - 16) / KAPPA;
78
+ };
79
+ function xyzToLab(xyz, white = D50) {
80
+ const fx = labF(xyz[0] / white[0]);
81
+ const fy = labF(xyz[1] / white[1]);
82
+ const fz = labF(xyz[2] / white[2]);
83
+ return [116 * fy - 16, 500 * (fx - fy), 200 * (fy - fz)];
84
+ }
85
+ function labToXyz(lab, white = D50) {
86
+ const fy = (lab[0] + 16) / 116;
87
+ const fx = fy + lab[1] / 500;
88
+ const fz = fy - lab[2] / 200;
89
+ return [labFinv(fx) * white[0], labFinv(fy) * white[1], labFinv(fz) * white[2]];
90
+ }
91
+ function deltaE76(a, b) {
92
+ return Math.hypot(a[0] - b[0], a[1] - b[1], a[2] - b[2]);
93
+ }
94
+ var s15f16Round = (v) => Math.round(v * 65536) / 65536;
95
+ var d50Quantized = () => [s15f16Round(D50[0]), s15f16Round(D50[1]), s15f16Round(D50[2])];
96
+
97
+ export {
98
+ D50,
99
+ D65_XY,
100
+ IDENTITY,
101
+ mul,
102
+ apply,
103
+ det,
104
+ invert,
105
+ xyToXyz,
106
+ bradford,
107
+ rgbToXyzMatrix,
108
+ xyzToLab,
109
+ labToXyz,
110
+ deltaE76,
111
+ s15f16Round,
112
+ d50Quantized
113
+ };
@@ -5,14 +5,14 @@
5
5
 
6
6
 
7
7
 
8
- var _chunkXQ33O5BCcjs = require('./chunk-XQ33O5BC.cjs');
8
+ var _chunkX35BV5YTcjs = require('./chunk-X35BV5YT.cjs');
9
9
 
10
10
 
11
- var _chunk6HMEHNWWcjs = require('./chunk-6HMEHNWW.cjs');
11
+ var _chunkXTU6QO2Wcjs = require('./chunk-XTU6QO2W.cjs');
12
12
 
13
13
 
14
14
 
15
- var _chunkUR37VCIRcjs = require('./chunk-UR37VCIR.cjs');
15
+ var _chunkI4AHLP7Fcjs = require('./chunk-I4AHLP7F.cjs');
16
16
 
17
17
 
18
18
  var _chunkG43MNQ4Ccjs = require('./chunk-G43MNQ4C.cjs');
@@ -1211,7 +1211,7 @@ var ChartNodeView = (_class = class {
1211
1211
  this.dom.contentEditable = "false";
1212
1212
  this.syncAttributes();
1213
1213
  this.key = specKey(this.node.attrs.spec);
1214
- this.controller = new (0, _chunkXQ33O5BCcjs.ChartController)({ spec: this.node.attrs.spec });
1214
+ this.controller = new (0, _chunkX35BV5YTcjs.ChartController)({ spec: this.node.attrs.spec });
1215
1215
  this.unsubscribe = this.controller.subscribe((state) => {
1216
1216
  if (!state.gesture) this.writeBack();
1217
1217
  });
@@ -1444,7 +1444,7 @@ function readSpec(value) {
1444
1444
  }
1445
1445
  }
1446
1446
  if (!input || typeof input !== "object" || Array.isArray(input)) return null;
1447
- return _chunkUR37VCIRcjs.normalizeChartSpec.call(void 0, input).spec;
1447
+ return _chunkI4AHLP7Fcjs.normalizeChartSpec.call(void 0, input).spec;
1448
1448
  }
1449
1449
  var readSize = (value) => {
1450
1450
  const n = value === null ? NaN : Number(value);
@@ -1470,10 +1470,10 @@ function staticChartSvg(node, options) {
1470
1470
  const spec = node.attrs.spec;
1471
1471
  const width = _nullishCoalesce(node.attrs.width, () => ( options.defaultWidth));
1472
1472
  const height = _nullishCoalesce(node.attrs.height, () => ( options.defaultHeight));
1473
- const scene = _chunk6HMEHNWWcjs.layoutChart.call(void 0, spec, { width, height, theme: options.theme, selection: null });
1474
- return _chunkXQ33O5BCcjs.chartSceneToDomSpec.call(void 0, scene, {
1473
+ const scene = _chunkXTU6QO2Wcjs.layoutChart.call(void 0, spec, { width, height, theme: options.theme, selection: null });
1474
+ return _chunkX35BV5YTcjs.chartSceneToDomSpec.call(void 0, scene, {
1475
1475
  ariaLabel: spec.title || "Chart",
1476
- description: _chunkXQ33O5BCcjs.describeChart.call(void 0, spec),
1476
+ description: _chunkX35BV5YTcjs.describeChart.call(void 0, spec),
1477
1477
  attrs: { style: "max-width: 100%; height: auto; display: block" }
1478
1478
  });
1479
1479
  }
@@ -1489,7 +1489,7 @@ var Chart = _core.Node.create({
1489
1489
  return {
1490
1490
  HTMLAttributes: {},
1491
1491
  nodeView: null,
1492
- theme: _chunkUR37VCIRcjs.DEFAULT_CHART_THEME,
1492
+ theme: _chunkI4AHLP7Fcjs.DEFAULT_CHART_THEME,
1493
1493
  defaultWidth: 640,
1494
1494
  defaultHeight: 320,
1495
1495
  generateId: () => generateStructureId("chart")
@@ -1503,7 +1503,7 @@ var Chart = _core.Node.create({
1503
1503
  renderHTML: (attributes) => attributes.id ? { "data-chart-id": attributes.id } : {}
1504
1504
  },
1505
1505
  spec: {
1506
- default: _chunkUR37VCIRcjs.normalizeChartSpec.call(void 0, {}).spec,
1506
+ default: _chunkI4AHLP7Fcjs.normalizeChartSpec.call(void 0, {}).spec,
1507
1507
  // null (no `data-chart`) keeps what the parse rule found, e.g. a mermaid block's spec.
1508
1508
  parseHTML: (element) => readSpec(element.getAttribute("data-chart")),
1509
1509
  renderHTML: (attributes) => ({
@@ -1541,7 +1541,7 @@ var Chart = _core.Node.create({
1541
1541
  const code = element.querySelector("code");
1542
1542
  const language = _nullishCoalesce(_nullishCoalesce(_optionalChain([code, 'optionalAccess', _34 => _34.getAttribute, 'call', _35 => _35("class")]), () => ( element.getAttribute("data-language"))), () => ( ""));
1543
1543
  if (!/(?:^|\s)language-mermaid(?:\s|$)/.test(language) && language !== "mermaid") return false;
1544
- const result = _chunkXQ33O5BCcjs.chartFromMermaid.call(void 0, _nullishCoalesce((_nullishCoalesce(code, () => ( element))).textContent, () => ( "")));
1544
+ const result = _chunkX35BV5YTcjs.chartFromMermaid.call(void 0, _nullishCoalesce((_nullishCoalesce(code, () => ( element))).textContent, () => ( "")));
1545
1545
  return result.family ? { spec: result.spec } : false;
1546
1546
  }
1547
1547
  }
@@ -1565,7 +1565,7 @@ var Chart = _core.Node.create({
1565
1565
  return {
1566
1566
  markdown: {
1567
1567
  serialize(state, node) {
1568
- const text = _chunkXQ33O5BCcjs.chartToMermaid.call(void 0, node.attrs.spec);
1568
+ const text = _chunkX35BV5YTcjs.chartToMermaid.call(void 0, node.attrs.spec);
1569
1569
  const fence = "`".repeat(Math.max(3, longestBacktickRun(text) + 1));
1570
1570
  state.write(`${fence}mermaid
1571
1571
  `);
@@ -1587,7 +1587,7 @@ var Chart = _core.Node.create({
1587
1587
  type: this.name,
1588
1588
  attrs: {
1589
1589
  id: _nullishCoalesce(options.id, () => ( this.options.generateId())),
1590
- spec: _chunkUR37VCIRcjs.normalizeChartSpec.call(void 0, _nullishCoalesce(options.spec, () => ( {}))).spec,
1590
+ spec: _chunkI4AHLP7Fcjs.normalizeChartSpec.call(void 0, _nullishCoalesce(options.spec, () => ( {}))).spec,
1591
1591
  width: _nullishCoalesce(options.width, () => ( null)),
1592
1592
  height: _nullishCoalesce(options.height, () => ( this.options.defaultHeight))
1593
1593
  }
@@ -1598,7 +1598,7 @@ var Chart = _core.Node.create({
1598
1598
  if (dispatch) {
1599
1599
  tr.setNodeMarkup(chart.pos, void 0, {
1600
1600
  ...chart.node.attrs,
1601
- ...changes.spec !== void 0 ? { spec: _chunkUR37VCIRcjs.normalizeChartSpec.call(void 0, changes.spec).spec } : {},
1601
+ ...changes.spec !== void 0 ? { spec: _chunkI4AHLP7Fcjs.normalizeChartSpec.call(void 0, changes.spec).spec } : {},
1602
1602
  ...changes.width !== void 0 ? { width: changes.width } : {},
1603
1603
  ...changes.height !== void 0 ? { height: changes.height } : {}
1604
1604
  });
@@ -1705,14 +1705,14 @@ var Sparkline = _core.Node.create({
1705
1705
  return [{ tag: 'span[data-type="sparkline"]', priority: 60 }];
1706
1706
  },
1707
1707
  renderHTML({ node, HTMLAttributes }) {
1708
- const scene = _chunkXQ33O5BCcjs.layoutSparkline.call(void 0, node.attrs.values, {
1708
+ const scene = _chunkX35BV5YTcjs.layoutSparkline.call(void 0, node.attrs.values, {
1709
1709
  kind: node.attrs.kind,
1710
1710
  width: node.attrs.width,
1711
1711
  height: node.attrs.height,
1712
1712
  color: _nullishCoalesce(node.attrs.color, () => ( this.options.color)),
1713
1713
  negativeColor: this.options.negativeColor
1714
1714
  });
1715
- const svg = _chunkXQ33O5BCcjs.chartSceneToDomSpec.call(void 0, scene, {
1715
+ const svg = _chunkX35BV5YTcjs.chartSceneToDomSpec.call(void 0, scene, {
1716
1716
  ariaLabel: sparklineLabel(node),
1717
1717
  attrs: { style: "display: inline-block; vertical-align: middle" }
1718
1718
  });