@pixerate/editor 0.166.0 → 0.168.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 (58) hide show
  1. package/THIRD_PARTY_NOTICES.md +11 -0
  2. package/dist/agent/index.cjs +34 -34
  3. package/dist/agent/index.js +5 -5
  4. package/dist/canvas/index.cjs +6 -6
  5. package/dist/canvas/index.js +2 -2
  6. package/dist/chart/index.cjs +236 -185
  7. package/dist/chart/index.d.cts +1 -0
  8. package/dist/chart/index.d.ts +1 -0
  9. package/dist/chart/index.js +57 -6
  10. package/dist/chart/layout-families.d.cts +8 -0
  11. package/dist/chart/layout-families.d.ts +8 -0
  12. package/dist/chart/maps.d.cts +43 -0
  13. package/dist/chart/maps.d.ts +43 -0
  14. package/dist/chart/spec.d.cts +1 -1
  15. package/dist/chart/spec.d.ts +1 -1
  16. package/dist/chart/types.d.cts +10 -2
  17. package/dist/chart/types.d.ts +10 -2
  18. package/dist/chart-maps/europe.d.cts +7 -0
  19. package/dist/chart-maps/europe.d.ts +7 -0
  20. package/dist/chart-maps/index.cjs +66 -0
  21. package/dist/chart-maps/index.d.cts +1 -0
  22. package/dist/chart-maps/index.d.ts +1 -0
  23. package/dist/chart-maps/index.js +66 -0
  24. package/dist/{chunk-V5L2G22R.cjs → chunk-2F4GAZL5.cjs} +109 -95
  25. package/dist/{chunk-5UNQDC3Q.js → chunk-34UCPHYO.js} +5 -2
  26. package/dist/{chunk-6DM3PUQD.cjs → chunk-CYKWYP6D.cjs} +20 -2
  27. package/dist/{chunk-HXOBOHH2.cjs → chunk-E45AIIWY.cjs} +8 -8
  28. package/dist/{chunk-NQQDGGXY.js → chunk-FKYGM35R.js} +2 -2
  29. package/dist/{chunk-6FYIFGBW.cjs → chunk-GD34ICEX.cjs} +16 -16
  30. package/dist/{chunk-MZFZSVUJ.cjs → chunk-GTF4RYXJ.cjs} +25 -22
  31. package/dist/{chunk-ZGOHKS3X.js → chunk-HCC2LBCW.js} +20 -2
  32. package/dist/{chunk-ITANXMZD.js → chunk-M52UCHVZ.js} +127 -3
  33. package/dist/{chunk-YUFTVNLX.js → chunk-N3ACT6VJ.js} +16 -2
  34. package/dist/{chunk-XNU45TYA.js → chunk-OLCHKGGO.js} +4 -1
  35. package/dist/{chunk-FR432ROA.js → chunk-ORZF4JOO.js} +23 -4
  36. package/dist/{chunk-BPX4Z3N3.cjs → chunk-OUO3DSRT.cjs} +23 -4
  37. package/dist/{chunk-CHLV7UFP.cjs → chunk-SBAPXFPB.cjs} +51 -51
  38. package/dist/{chunk-VB2CY6EG.js → chunk-T62BRXMS.js} +3 -3
  39. package/dist/{chunk-SZWVMB3B.cjs → chunk-VKHJJUBK.cjs} +21 -18
  40. package/dist/{chunk-UUUTEVX6.cjs → chunk-WOIXNDHV.cjs} +172 -48
  41. package/dist/{chunk-DFCAR7AW.js → chunk-ZUPP4NKM.js} +3 -3
  42. package/dist/effects/authoring-session.d.cts +5 -0
  43. package/dist/effects/authoring-session.d.ts +5 -0
  44. package/dist/effects/authoring.d.cts +6 -0
  45. package/dist/effects/authoring.d.ts +6 -0
  46. package/dist/effects/index.cjs +12 -6
  47. package/dist/effects/index.js +10 -4
  48. package/dist/export/index.cjs +4 -4
  49. package/dist/export/index.js +3 -3
  50. package/dist/extensions/index.cjs +7 -7
  51. package/dist/extensions/index.js +6 -6
  52. package/dist/index.cjs +13 -13
  53. package/dist/index.js +7 -7
  54. package/dist/video-editor/index.cjs +2 -2
  55. package/dist/video-editor/index.js +1 -1
  56. package/package.json +11 -1
  57. package/skills/pixerate-chart/SKILL.md +18 -2
  58. package/skills/pixerate-effect-authoring/SKILL.md +11 -4
package/dist/index.js CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  exportDocx,
13
13
  exportDocxBlob,
14
14
  stripInvalidXmlChars
15
- } from "./chunk-NQQDGGXY.js";
15
+ } from "./chunk-FKYGM35R.js";
16
16
  import {
17
17
  deflateRaw,
18
18
  writeZip
@@ -165,7 +165,7 @@ import {
165
165
  updateImageSrc,
166
166
  validateFindPattern,
167
167
  writeRichClipboard
168
- } from "./chunk-VB2CY6EG.js";
168
+ } from "./chunk-T62BRXMS.js";
169
169
  import {
170
170
  DEFAULT_STYLES,
171
171
  NORMAL_STYLE_ID,
@@ -174,7 +174,7 @@ import {
174
174
  isValidStyleId,
175
175
  safeCSSValue
176
176
  } from "./chunk-CXXKJBQZ.js";
177
- import "./chunk-XNU45TYA.js";
177
+ import "./chunk-OLCHKGGO.js";
178
178
  import {
179
179
  compareDocuments,
180
180
  compareHtml,
@@ -246,11 +246,11 @@ import {
246
246
  tableNestingPluginKey,
247
247
  typeAgentText,
248
248
  unnestTables
249
- } from "./chunk-DFCAR7AW.js";
250
- import "./chunk-YUFTVNLX.js";
249
+ } from "./chunk-ZUPP4NKM.js";
250
+ import "./chunk-N3ACT6VJ.js";
251
251
  import "./chunk-KGRZMHZB.js";
252
- import "./chunk-ITANXMZD.js";
253
- import "./chunk-FR432ROA.js";
252
+ import "./chunk-M52UCHVZ.js";
253
+ import "./chunk-ORZF4JOO.js";
254
254
  import "./chunk-O6OGNDND.js";
255
255
  import "./chunk-6T4BV5B4.js";
256
256
  import {
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3; var _class4; var _class5; var _class6; var _class7;
2
2
 
3
- var _chunk6DM3PUQDcjs = require('../chunk-6DM3PUQD.cjs');
3
+ var _chunkCYKWYP6Dcjs = require('../chunk-CYKWYP6D.cjs');
4
4
 
5
5
 
6
6
 
@@ -6136,7 +6136,7 @@ async function openVideoClipEffectAuthoring(controller, clip, instance, options
6136
6136
  const at = _chunk3OSXHLITcjs.findVideoClip.call(void 0, controller.getProject(), clip);
6137
6137
  if (!at) throw new Error(`There is no clip "${clip}".`);
6138
6138
  const doc = videoClipEffectDocument(at.clip, instance, provider.id);
6139
- const session = await _chunk6DM3PUQDcjs.createEffectAuthoringSession.call(void 0, { document: doc }, { ...options, provider });
6139
+ const session = await _chunkCYKWYP6Dcjs.createEffectAuthoringSession.call(void 0, { document: doc }, { ...options, provider });
6140
6140
  return {
6141
6141
  clip,
6142
6142
  instance,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createEffectAuthoringSession
3
- } from "../chunk-ZGOHKS3X.js";
3
+ } from "../chunk-HCC2LBCW.js";
4
4
  import {
5
5
  VIDEO_ADJUSTMENT_SCOPES,
6
6
  VIDEO_BLEND_MODES,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pixerate/editor",
3
- "version": "0.166.0",
3
+ "version": "0.168.0",
4
4
  "description": "UI-agnostic rich text and media editing core library",
5
5
  "author": "Pixerate",
6
6
  "license": "MIT",
@@ -304,6 +304,16 @@
304
304
  "default": "./dist/chart/index.cjs"
305
305
  }
306
306
  },
307
+ "./chart-maps": {
308
+ "import": {
309
+ "types": "./dist/chart-maps/index.d.ts",
310
+ "default": "./dist/chart-maps/index.js"
311
+ },
312
+ "require": {
313
+ "types": "./dist/chart-maps/index.d.cts",
314
+ "default": "./dist/chart-maps/index.cjs"
315
+ }
316
+ },
307
317
  "./effects": {
308
318
  "import": {
309
319
  "types": "./dist/effects/index.d.ts",
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: pixerate-chart
3
- description: How to build, edit and check charts in the Pixerate chart editor through its agent tools and chart.* commands - bar, column, line, area, scatter, bubble, pie, donut, radar, waterfall, histogram, box plot, funnel, treemap (flat or grouped), sunburst, Sankey, slope, Likert (survey), parliament and bar chart race charts; series, categories, stacking, secondary axis, log axis, number formats, data labels, legend, trendline, error bars, reference lines and target bands, callouts, highlighting, footnotes, colour palettes and colour-blind checks, CSV and Mermaid import, Office chart XML export, and reading charts out of open .xlsx, .pptx and .docx files. Use when a chart editor's tools (get_chart, update_chart, set_chart_values, list_file_charts...) are available or the user asks to make, restyle, fix or explain a chart.
3
+ description: How to build, edit and check charts in the Pixerate chart editor through its agent tools and chart.* commands - bar, column, line, area, scatter, bubble, pie, donut, radar, waterfall, histogram, box plot, funnel, treemap (flat or grouped), sunburst, Sankey, slope, Likert (survey), parliament, bar chart race and choropleth map charts; series, categories, stacking, secondary axis, log axis, number formats, data labels, legend, trendline, error bars, reference lines and target bands, callouts, highlighting, footnotes, colour palettes and colour-blind checks, CSV and Mermaid import, Office chart XML export, and reading charts out of open .xlsx, .pptx and .docx files. Use when a chart editor's tools (get_chart, update_chart, set_chart_values, list_file_charts...) are available or the user asks to make, restyle, fix or explain a chart.
4
4
  ---
5
5
 
6
6
  # Charts
@@ -24,6 +24,11 @@ and the first series their totals, so a treemap nests the groups, a sunburst dra
24
24
  rings, and any other type draws the totals. Nodes are addressed by `path`, the names from the
25
25
  top down (`["Europe", "France"]`); `get_chart` returns them as `treeTable`.
26
26
 
27
+ A choropleth (`choropleth`) shades the regions of a map (`map`, `europe` by default) by the
28
+ first series: each category names a region by code (ISO alpha-3 for countries, such as FRA;
29
+ Kosovo is XKX) or by name (France). The host registers the map outlines; when no map is
30
+ registered or no category matches, the chart draws bars and warns.
31
+
27
32
  A bar race (`barrace`) reads the ordinary table differently: each category is a time point
28
33
  and each series a name, and it draws the top `raceTopN` names at one moment as ranked bars.
29
34
  Which moment is shown is view state (`set_chart_race_frame`, `play_chart_race`), not part of
@@ -88,6 +93,8 @@ Charts inside a rich-text document are not edited with these tools: use `insert_
88
93
  rows of source, target, value with `import_chart_links_csv` or `set_chart_links`.
89
94
  A ranking that changes over time (sales by product per year, top cities per decade): barrace,
90
95
  with time points as categories and one series per name; keep `raceTopN` to about 10.
96
+ A value by country across Europe: choropleth. Call `list_chart_map_regions` for the codes,
97
+ load one row per country with `set_chart_data`, and keep to about five classes.
91
98
  Seats or votes per group with a majority: parliament (`parliamentMajority`,
92
99
  `parliamentArc`, `parliamentLabel`).
93
100
  - **Bars start at zero.** Bar length encodes the value, so never set a non-zero `min` on the
@@ -150,6 +157,7 @@ Charts inside a rich-text document are not edited with these tools: use `insert_
150
157
  | `recommend_chart` | Ranked chart types with a reason each, from `csv` when given, else the current data (series count, points, dates, negative values). Use before choosing a type. |
151
158
  | `get_chart_trendline` | Read a trendline's fit (`series`, `index`): coefficients, R2, equation and point count, or the moving-average points. Fails when the fit needs more or positive values. |
152
159
  | `get_chart_race_ranking` | Read who leads a bar race at a moment (`time`: a category label or index, fractional between time points; default the moment shown): the top `raceTopN` with rank, series id and value. Read-only; use it to describe the race instead of rendering frames. |
160
+ | `list_chart_map_regions` | List the registered maps and the regions of one (default the chart's map) with the ids and names categories may use, plus which of the chart's categories matched a region and which did not. Call it before loading map data and after, to fix unmatched labels. |
153
161
  | `list_chart_presets` | List the quick layouts (`standard`, `minimal`, `labelled`, `legend-right`, `presentation`, `analysis`) and colour schemes (such as `default`, `okabe-ito`, `office`, monochrome) with what each changes. |
154
162
  | `export_chart_mermaid` | Get the chart as Mermaid for Markdown or chat: `xychart-beta`, `pie` or `radar-beta`, `sankey-beta` for Sankey diagrams with flows (title in frontmatter), `treemap-beta` for treemaps and sunbursts with their levels. With `meta` (default true) a `%% @pixerate` comment keeps everything Mermaid cannot express so `import_chart_mermaid` restores it exactly. |
155
163
  | `export_chart_ooxml` | Get a DrawingML `c:chartSpace` part for Word or PowerPoint, plus sentences for anything that could not be written. |
@@ -164,7 +172,7 @@ it changed.
164
172
 
165
173
  | Tool | Use it to |
166
174
  | --- | --- |
167
- | `update_chart` | Change presentation in one all-or-nothing call: `type`, `title`, `subtitle`, `xAxis` / `yAxis` / `yAxis2` (show, title, min, max, step, gridlines, format, kind `"date"`, scale `"log"`, logBase, reverse), `legend` (show, position top / bottom / left / right), `stacking` (none / stacked / percent), `orientation`, `curve`, `points`, `dataLabels`, `labelPosition`, `palette`, `innerRadius` (donut hole, 0-0.9), `gapWidth`, `overlap`, `bins`, `showTotal`, `radarTicks` (radar ring count 1-50, null for round numbers), `radarGraticule` (radar rings as `polygon` or `circle`), `note` (footnote, "" for none), `highlight` (whole list of names), `referenceLines` / `referenceBands` (whole lists; prefer the add tools), `varyColors` (one colour per category on a one-series chart), `likertNeutral` (`split` / `separate`), `likertSort` (`none` / `positive` / `negative`), `parliamentArc` (90-360 degrees), `parliamentMajority` (seats, null for half plus one), `parliamentLabel` (caption under the total), `sunburstLabel` (caption under a sunburst's total), `sankeyLinkColor` (`source` / `target` / `gray`), `sankeyNodes` (node stacking order), `raceTopN` (bars per moment, 1-30). Invalid values change nothing and come back as sentences. Returns the spec. |
175
+ | `update_chart` | Change presentation in one all-or-nothing call: `type`, `title`, `subtitle`, `xAxis` / `yAxis` / `yAxis2` (show, title, min, max, step, gridlines, format, kind `"date"`, scale `"log"`, logBase, reverse), `legend` (show, position top / bottom / left / right), `stacking` (none / stacked / percent), `orientation`, `curve`, `points`, `dataLabels`, `labelPosition`, `palette`, `innerRadius` (donut hole, 0-0.9), `gapWidth`, `overlap`, `bins`, `showTotal`, `radarTicks` (radar ring count 1-50, null for round numbers), `radarGraticule` (radar rings as `polygon` or `circle`), `note` (footnote, "" for none), `highlight` (whole list of names), `referenceLines` / `referenceBands` (whole lists; prefer the add tools), `varyColors` (one colour per category on a one-series chart), `likertNeutral` (`split` / `separate`), `likertSort` (`none` / `positive` / `negative`), `parliamentArc` (90-360 degrees), `parliamentMajority` (seats, null for half plus one), `parliamentLabel` (caption under the total), `sunburstLabel` (caption under a sunburst's total), `sankeyLinkColor` (`source` / `target` / `gray`), `sankeyNodes` (node stacking order), `raceTopN` (bars per moment, 1-30), `map` (registered map id), `mapSteps` (2-9 equal colour classes), `mapThresholds` (ascending class breaks instead). Invalid values change nothing and come back as sentences. Returns the spec. |
168
176
  | `set_chart_data` | Replace `categories` and / or all `series` (each with `name`, `values` and optional settings). Values are padded with gaps to the categories. Use for whole tables and for re-sorting. Returns the table and series ids. |
169
177
  | `set_chart_values` | Set individual `cells` (`series`, `category`, `value`) all-or-nothing. Values may be numbers, numeric text (`"1,200"`, `"12%"`, `"$40"`, `"(3)"`) or `null` for a gap. Returns the stored values. Acted out with a cursor when the host has a director. |
170
178
  | `add_chart_series` | Add a series (`name` required; `values`, `color`, `type` for a combo, `axis: "secondary"`, `x` / `sizes` for scatter and bubble, marker, format, error bars, `id`, `at`). Selects it and returns its id. |
@@ -259,6 +267,7 @@ several charts may register them with another prefix.
259
267
  | `chart.addLink` | Add a flow; returns its index. |
260
268
  | `chart.updateLink` | Change a flow by index. |
261
269
  | `chart.removeLink` | Delete a flow by index. |
270
+ | `chart.mapRegions` | List a map's regions and the unmatched categories (as `list_chart_map_regions`). |
262
271
  | `chart.raceRanking` | Read a bar race ranking (as `get_chart_race_ranking`). |
263
272
  | `chart.setRaceFrame` | Show a bar race moment. |
264
273
  | `chart.playRace` | Play the bar race. |
@@ -297,6 +306,13 @@ several charts may register them with another prefix.
297
306
  categories, `transpose_chart`) are refused, because the totals come from the tree or flows.
298
307
  Edit the nodes or flows, or replace the data (`set_chart_data`, `import_chart_csv`), which
299
308
  clears them.
309
+ - On a choropleth, a value is a shade, not a size: use it for rates and shares (per person,
310
+ per cent), not raw totals, which make big countries look important. Say the unit in the
311
+ title. Equal classes (`mapSteps`) suit evenly spread values; set `mapThresholds` for
312
+ meaningful breaks (targets, round numbers) or skewed data. Regions without data are grey.
313
+ - Microstates (Malta, Luxembourg, Andorra, Monaco, San Marino, Liechtenstein, Vatican City)
314
+ are drawn as markers so they can be seen and clicked.
315
+ - Office export has no maps: it writes the values as bars and says so.
300
316
  - A bar race fills gaps with the last known value (0 before a name's first), and values and
301
317
  places ease between time points, so a name can sit between two places mid-swap. `render_chart`
302
318
  takes `time` to draw one moment. Office and Mermaid export cannot animate: they get every
@@ -21,7 +21,9 @@ For general error reporting and undo conventions, see `pixerate-agent-tools`.
21
21
 
22
22
  1. **Inspect first.** Run `effect_authoring_describe` to inspect the effect name, kind, source
23
23
  language (`glsl`, `svg`, or null when the effect has no source to edit), control parameter schemas, current
24
- values, existing tracks, and compile issues.
24
+ values, existing tracks, playhead `time`, compile issues and `previewError`.
25
+ A session opens with its playhead at half the effect's length (where entrance-style effects and
26
+ transitions show), so values set on an animated control key that time unless you seek first.
25
27
  2. **Read or update source code.** If `sourceLanguage` is non-null, use `effect_authoring_get_source`
26
28
  to read the shader or script code. Use `effect_authoring_set_source` to recompile with new code
27
29
  and immediately inspect any reported syntax or compilation issues with line numbers.
@@ -38,7 +40,10 @@ For general error reporting and undo conventions, see `pixerate-agent-tools`.
38
40
  6. **Save presets.** When an interesting look is achieved, save it with `effect_authoring_save_preset`
39
41
  or restore known presets with `effect_authoring_apply_preset`.
40
42
  7. **Verify visually.** When `effect_authoring_view` is available, capture rendered preview frames
41
- at specific times to visually confirm effect appearance.
43
+ at specific times to visually confirm effect appearance. When `effect_authoring_describe` reports a
44
+ `previewError` (typically a `vector` effect whose provider only draws it as SVG), there is no pixel
45
+ preview: `effect_authoring_view` is refused with that reason, but values, presets, keyframes and
46
+ timing still work. Judge the result from the values instead of retrying the view.
42
47
 
43
48
  ## Best practices
44
49
 
@@ -56,7 +61,7 @@ For general error reporting and undo conventions, see `pixerate-agent-tools`.
56
61
 
57
62
  | Tool | Description and usage |
58
63
  | --- | --- |
59
- | `effect_authoring_describe` | Reads the currently open effect session: name, kind, source language, controls schema and current values, presets, animated tracks with keyframe counts, duration, loop, and compile issues. |
64
+ | `effect_authoring_describe` | Reads the currently open effect session: name, kind, source language, controls schema and current values, presets, animated tracks with keyframe counts, playhead `time`, duration, loop, compile issues, and `previewError` (why there is no pixel preview, or null). Call it first. |
60
65
  | `effect_authoring_get_source` | Retrieves shader or script source code and language for code-backed effects. Refused if `sourceLanguage` is null. |
61
66
  | `effect_authoring_set_source` | Recompiles the effect with new shader or script source code. Returns compiler issues with line numbers and messages. Available only when supported by the session. |
62
67
  | `effect_authoring_set_values` | Sets one or more control values at the current playhead time as a single undo step. Rejects all changes if any control name or value is invalid. |
@@ -70,11 +75,13 @@ For general error reporting and undo conventions, see `pixerate-agent-tools`.
70
75
  | `effect_authoring_seek` | Moves the preview playhead to a specific timeline position in milliseconds (clamped to 0..duration) and returns values at that time. |
71
76
  | `effect_authoring_undo` | Undoes the most recent edit in the authoring session. |
72
77
  | `effect_authoring_redo` | Redoes the most recently undone edit in the authoring session. |
73
- | `effect_authoring_view` | Captures a preview image of the effect at the current playhead or a specified timestamp. Available when preview capture is supported. |
78
+ | `effect_authoring_view` | Captures a preview image of the effect at the current playhead or a specified timestamp. Available when preview capture is supported. Refused, with the reason, when `effect_authoring_describe` shows a `previewError`. |
74
79
 
75
80
  ## Pitfalls
76
81
 
77
82
  - Calling authoring tools when no authoring session is open returns an error explaining that a session must be opened first.
78
83
  - Animated controls calculate their values dynamically from keyframes; clearing a track reverts the parameter to static behavior.
79
84
  - Compiling invalid shader code produces issues in `effect_authoring_set_source`; inspect the line numbers and messages to correct syntax.
85
+ - A `vector` effect may have no pixel preview (the provider refuses a pixel renderer); check `previewError` rather than reading a blank capture as a broken effect.
86
+ - The playhead does not start at 0. Pass explicit `time`s to `effect_authoring_set_keyframe`, or `effect_authoring_seek` before setting values on an animated control.
80
87
  - Control values must match their schema types and bounds; colours must be `#rrggbb` (or `#rrggbbaa`), and numbers must fall within `[min, max]`.