@pixerate/editor 0.155.0 → 0.157.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 (73) hide show
  1. package/dist/agent/index.cjs +34 -34
  2. package/dist/agent/index.js +5 -5
  3. package/dist/animation-editor/index.cjs +58 -58
  4. package/dist/animation-editor/index.js +4 -4
  5. package/dist/{brushstrokeRender-YAZVQUXY.cjs → brushstrokeRender-5WANQIG4.cjs} +10 -10
  6. package/dist/{brushstrokeRender-EUDQTDYS.js → brushstrokeRender-Q4LI22QV.js} +3 -3
  7. package/dist/canvas/index.cjs +14 -14
  8. package/dist/canvas/index.js +3 -3
  9. package/dist/chart/index.cjs +90 -88
  10. package/dist/chart/index.js +9 -7
  11. package/dist/chart/spec.d.cts +2 -1
  12. package/dist/chart/spec.d.ts +2 -1
  13. package/dist/chart/types.d.cts +5 -0
  14. package/dist/chart/types.d.ts +5 -0
  15. package/dist/{chunk-AGZ47XY2.js → chunk-2N2QPO3H.js} +6 -2
  16. package/dist/{chunk-NMXPOKF3.js → chunk-45XXVHVG.js} +1 -1
  17. package/dist/{chunk-2WDZI6QD.cjs → chunk-4T44CJ5K.cjs} +15 -15
  18. package/dist/{chunk-XTU6QO2W.cjs → chunk-4YWAEV4W.cjs} +36 -27
  19. package/dist/{chunk-4YQKRHMI.cjs → chunk-57JLBGJ5.cjs} +8 -8
  20. package/dist/{chunk-SVINJIGK.js → chunk-5QBRAIVK.js} +3 -3
  21. package/dist/{chunk-R3PECGTQ.cjs → chunk-6LUYFHHN.cjs} +51 -51
  22. package/dist/{chunk-FLOGD3QB.js → chunk-6UPGM3JB.js} +2 -2
  23. package/dist/{chunk-6FUAHCVI.cjs → chunk-7NW46N7I.cjs} +16 -16
  24. package/dist/{chunk-ORDXMBD4.js → chunk-A5UCR2TO.js} +10 -3
  25. package/dist/{chunk-ML2II3Y3.cjs → chunk-AKDWAWSY.cjs} +58 -46
  26. package/dist/{chunk-PI45JMP7.cjs → chunk-CD7PLU77.cjs} +81 -81
  27. package/dist/{chunk-EQ4SF4X4.js → chunk-DBIVICAO.js} +1 -1
  28. package/dist/{chunk-LRRCMRSL.cjs → chunk-EBDCRTZI.cjs} +20 -16
  29. package/dist/{chunk-OLCYQLFE.js → chunk-EL5PAHNP.js} +1 -1
  30. package/dist/{chunk-PUC43JPT.cjs → chunk-EYVVIZJ3.cjs} +1 -1
  31. package/dist/{chunk-SUVZJ2CP.js → chunk-H5XX4KHB.js} +11 -1
  32. package/dist/{chunk-BXMIBMVG.cjs → chunk-JGKCC5OF.cjs} +65 -58
  33. package/dist/{chunk-LIXLD433.cjs → chunk-MHEXLG3M.cjs} +35 -35
  34. package/dist/{chunk-37RLSNQ3.js → chunk-Q6PA362P.js} +2 -2
  35. package/dist/{chunk-RHXW4TA5.cjs → chunk-QMI5HZWA.cjs} +7 -7
  36. package/dist/{chunk-DSZCDNTM.js → chunk-R3QY7PPL.js} +11 -2
  37. package/dist/{chunk-4RF2H3N3.js → chunk-SSCL7QQ4.js} +15 -3
  38. package/dist/{chunk-TLMRGLQQ.cjs → chunk-TVO6W2Q6.cjs} +20 -17
  39. package/dist/{chunk-EIUTJPEL.js → chunk-UM3RPYC5.js} +5 -2
  40. package/dist/{chunk-UILRJQFD.js → chunk-WNAAWLZ5.js} +1 -1
  41. package/dist/{chunk-I4AHLP7F.cjs → chunk-WPPJH6X4.cjs} +12 -2
  42. package/dist/{chunk-RZJCYJWO.cjs → chunk-XNQ5EFB4.cjs} +16 -16
  43. package/dist/{chunk-R6HNWN7B.js → chunk-YABNLNY7.js} +3 -3
  44. package/dist/{chunk-Y64YPIFT.js → chunk-ZQWLWDZI.js} +1 -1
  45. package/dist/export/index.cjs +4 -4
  46. package/dist/export/index.js +3 -3
  47. package/dist/extensions/index.cjs +7 -7
  48. package/dist/extensions/index.js +6 -6
  49. package/dist/image-editor/index.cjs +686 -686
  50. package/dist/image-editor/index.js +5 -5
  51. package/dist/index.cjs +13 -13
  52. package/dist/index.js +7 -7
  53. package/dist/paint/grain.d.cts +7 -0
  54. package/dist/paint/grain.d.ts +7 -0
  55. package/dist/paint/index.cjs +3 -3
  56. package/dist/paint/index.js +2 -2
  57. package/dist/paint-editor/controller.d.cts +30 -0
  58. package/dist/paint-editor/controller.d.ts +30 -0
  59. package/dist/paint-editor/document.d.cts +8 -0
  60. package/dist/paint-editor/document.d.ts +8 -0
  61. package/dist/paint-editor/index.cjs +403 -256
  62. package/dist/paint-editor/index.js +158 -11
  63. package/dist/paint-editor/paper.d.cts +8 -0
  64. package/dist/paint-editor/paper.d.ts +8 -0
  65. package/dist/paint-editor/stencils.d.cts +2 -0
  66. package/dist/paint-editor/stencils.d.ts +2 -0
  67. package/dist/paint-editor/wet.d.cts +1 -0
  68. package/dist/paint-editor/wet.d.ts +1 -0
  69. package/dist/vector/index.cjs +950 -950
  70. package/dist/vector/index.js +4 -4
  71. package/package.json +1 -1
  72. package/skills/pixerate-chart/SKILL.md +4 -1
  73. package/skills/pixerate-paint-editor/SKILL.md +9 -1
@@ -7,7 +7,7 @@ var _chunkYN6JKAUEcjs = require('./chunk-YN6JKAUE.cjs');
7
7
 
8
8
 
9
9
 
10
- var _chunk2WDZI6QDcjs = require('./chunk-2WDZI6QD.cjs');
10
+ var _chunk4T44CJ5Kcjs = require('./chunk-4T44CJ5K.cjs');
11
11
 
12
12
 
13
13
  var _chunkHMGWFXECcjs = require('./chunk-HMGWFXEC.cjs');
@@ -34,10 +34,10 @@ var _chunkHMGWFXECcjs = require('./chunk-HMGWFXEC.cjs');
34
34
 
35
35
 
36
36
 
37
- var _chunkRZJCYJWOcjs = require('./chunk-RZJCYJWO.cjs');
37
+ var _chunkXNQ5EFB4cjs = require('./chunk-XNQ5EFB4.cjs');
38
38
 
39
39
 
40
- var _chunkI4AHLP7Fcjs = require('./chunk-I4AHLP7F.cjs');
40
+ var _chunkWPPJH6X4cjs = require('./chunk-WPPJH6X4.cjs');
41
41
 
42
42
 
43
43
 
@@ -2464,13 +2464,13 @@ async function loadCharts(zip, Parser, root, rels, options) {
2464
2464
  const charts = /* @__PURE__ */ new Map();
2465
2465
  if (options.charts === false) return charts;
2466
2466
  for (const el of descendants(root, "chart")) {
2467
- if (el.namespaceURI !== _chunk2WDZI6QDcjs.CHART_OOXML_NS) continue;
2467
+ if (el.namespaceURI !== _chunk4T44CJ5Kcjs.CHART_OOXML_NS) continue;
2468
2468
  const id = attr(el, "id");
2469
2469
  const rel = id ? rels.get(id) : void 0;
2470
2470
  if (!id || !rel || rel.external || charts.has(id)) continue;
2471
2471
  const entry = zip.get(rel.target);
2472
2472
  if (!entry) continue;
2473
- const read = _chunk2WDZI6QDcjs.chartFromOoxml.call(void 0, await zip.readText(entry), { DOMParser: Parser });
2473
+ const read = _chunk4T44CJ5Kcjs.chartFromOoxml.call(void 0, await zip.readText(entry), { DOMParser: Parser });
2474
2474
  charts.set(id, {
2475
2475
  id: `chart-${charts.size + 1}`,
2476
2476
  path: rel.target,
@@ -2484,7 +2484,7 @@ async function loadCharts(zip, Parser, root, rels, options) {
2484
2484
  return charts;
2485
2485
  }
2486
2486
  function chartBlockHtml(chart) {
2487
- const [head, ...rows] = _chunkI4AHLP7Fcjs.chartDataToTable.call(void 0, chart.spec);
2487
+ const [head, ...rows] = _chunkWPPJH6X4cjs.chartDataToTable.call(void 0, chart.spec);
2488
2488
  const cell = (v, tag) => `<${tag}><p>${_chunkG43MNQ4Ccjs.escapeHtml.call(void 0, v === null || v === void 0 ? "" : String(v))}</p></${tag}>`;
2489
2489
  const table = `<table><tbody><tr>${head.map((h) => cell(h, "th")).join("")}</tr>${rows.map((r) => `<tr>${r.map((v, i) => cell(v, i ? "td" : "th")).join("")}</tr>`).join("")}</tbody></table>`;
2490
2490
  const caption = `<p>${_chunkG43MNQ4Ccjs.escapeHtml.call(void 0, `[Chart: ${chart.title || "untitled"}]`)}</p>`;
@@ -3137,7 +3137,7 @@ var ParagraphRenderer = (_class2 = class {
3137
3137
  };
3138
3138
  if (child.localName === "AlternateContent") {
3139
3139
  const branch = childElements(child).find(
3140
- (b) => descendants(b, "blip").length || descendants(b, "imagedata").length || descendants(b, "chart").some((el) => el.namespaceURI === _chunk2WDZI6QDcjs.CHART_OOXML_NS)
3140
+ (b) => descendants(b, "blip").length || descendants(b, "imagedata").length || descendants(b, "chart").some((el) => el.namespaceURI === _chunk4T44CJ5Kcjs.CHART_OOXML_NS)
3141
3141
  );
3142
3142
  if (branch) this.image(branch, format, push);
3143
3143
  return;
@@ -3204,7 +3204,7 @@ var ParagraphRenderer = (_class2 = class {
3204
3204
  /** Charts this paragraph contains, in order. */
3205
3205
  __init4() {this.charts = []}
3206
3206
  image(container, format, push) {
3207
- const chartRef = descendants(container, "chart").find((el) => el.namespaceURI === _chunk2WDZI6QDcjs.CHART_OOXML_NS);
3207
+ const chartRef = descendants(container, "chart").find((el) => el.namespaceURI === _chunk4T44CJ5Kcjs.CHART_OOXML_NS);
3208
3208
  const chart = chartRef ? this.part.charts.get(_nullishCoalesce(attr(chartRef, "id"), () => ( ""))) : void 0;
3209
3209
  if (chart) {
3210
3210
  if (!this.ctx.charts.includes(chart)) this.ctx.charts.push(chart);
@@ -3643,9 +3643,9 @@ function insertImportedDocument(target, content, options = {}) {
3643
3643
  if (!htmlSlice && from === to && !state.doc.resolve(from).parent.inlineContent) {
3644
3644
  from = to = _state.Selection.near(state.doc.resolve(from)).from;
3645
3645
  }
3646
- if (htmlSlice && _chunkRZJCYJWOcjs.sliceContainsTable.call(void 0, htmlSlice) && _chunkRZJCYJWOcjs.outermostTableDepth.call(void 0, state.doc.resolve(from)) >= 0) {
3646
+ if (htmlSlice && _chunkXNQ5EFB4cjs.sliceContainsTable.call(void 0, htmlSlice) && _chunkXNQ5EFB4cjs.outermostTableDepth.call(void 0, state.doc.resolve(from)) >= 0) {
3647
3647
  const tr2 = state.tr;
3648
- const end2 = _chunkRZJCYJWOcjs.insertSliceAfterTable.call(void 0, tr2, from, to, htmlSlice);
3648
+ const end2 = _chunkXNQ5EFB4cjs.insertSliceAfterTable.call(void 0, tr2, from, to, htmlSlice);
3649
3649
  if (end2 !== null) {
3650
3650
  if (options.at === void 0) tr2.setSelection(_state.Selection.near(tr2.doc.resolve(end2), -1));
3651
3651
  view.dispatch(tr2.scrollIntoView().setMeta("uiEvent", "drop"));
@@ -3822,7 +3822,7 @@ var RichClipboard = _core.Extension.create({
3822
3822
  const slice = _chunk3AJMR7EGcjs.readRichClipboard.call(void 0, event, view.state.schema, mimeType);
3823
3823
  if (!slice) return false;
3824
3824
  event.preventDefault();
3825
- if (_chunkRZJCYJWOcjs.handleTablePasteWithoutNesting.call(void 0, view, event, slice)) return true;
3825
+ if (_chunkXNQ5EFB4cjs.handleTablePasteWithoutNesting.call(void 0, view, event, slice)) return true;
3826
3826
  view.dispatch(
3827
3827
  view.state.tr.replaceSelection(slice).scrollIntoView().setMeta("paste", true).setMeta("uiEvent", "paste")
3828
3828
  );
@@ -4223,7 +4223,7 @@ function createOutlineStore(editor) {
4223
4223
  if (!editor || editor.isDestroyed) return EMPTY_SNAPSHOT;
4224
4224
  const headings = getOutline(editor);
4225
4225
  const activeId = _nullishCoalesce(_optionalChain([getActiveHeading, 'call', _161 => _161(editor, headings), 'optionalAccess', _162 => _162.id]), () => ( null));
4226
- const sameStructure = _chunkRZJCYJWOcjs.arraysEqual.call(void 0, snapshot.headings, headings, sameHeading);
4226
+ const sameStructure = _chunkXNQ5EFB4cjs.arraysEqual.call(void 0, snapshot.headings, headings, sameHeading);
4227
4227
  if (sameStructure && snapshot.activeId === activeId) return snapshot;
4228
4228
  return {
4229
4229
  headings: sameStructure ? snapshot.headings : headings,
@@ -4271,7 +4271,7 @@ function navigateToHeading(editor, heading, options = {}) {
4271
4271
  editor.view.dispatch(tr);
4272
4272
  editor.view.focus();
4273
4273
  }
4274
- _chunkRZJCYJWOcjs.scrollDomAtPos.call(void 0, editor.view, current.pos, behavior);
4274
+ _chunkXNQ5EFB4cjs.scrollDomAtPos.call(void 0, editor.view, current.pos, behavior);
4275
4275
  return true;
4276
4276
  }
4277
4277
  function assignHeadingIds(state, types, generateId) {
@@ -4296,11 +4296,11 @@ function assignHeadingIds(state, types, generateId) {
4296
4296
  }
4297
4297
  var Outline = _core.Extension.create({
4298
4298
  name: "outline",
4299
- priority: _chunkRZJCYJWOcjs.STRUCTURE_PRIORITY,
4299
+ priority: _chunkXNQ5EFB4cjs.STRUCTURE_PRIORITY,
4300
4300
  addOptions() {
4301
4301
  return {
4302
4302
  types: ["heading"],
4303
- generateId: () => _chunkRZJCYJWOcjs.generateStructureId.call(void 0, "h"),
4303
+ generateId: () => _chunkXNQ5EFB4cjs.generateStructureId.call(void 0, "h"),
4304
4304
  onUpdate: void 0
4305
4305
  };
4306
4306
  },
@@ -4333,14 +4333,14 @@ var Outline = _core.Extension.create({
4333
4333
  tr.scrollIntoView();
4334
4334
  _optionalChain([view, 'optionalAccess', _169 => _169.focus, 'optionalCall', _170 => _170()]);
4335
4335
  }
4336
- _chunkRZJCYJWOcjs.scrollDomAtPos.call(void 0, view, heading.pos, options.behavior);
4336
+ _chunkXNQ5EFB4cjs.scrollDomAtPos.call(void 0, view, heading.pos, options.behavior);
4337
4337
  }
4338
4338
  return true;
4339
4339
  },
4340
4340
  scrollToHeading: (id, options = {}) => ({ state, dispatch, view }) => {
4341
4341
  const heading = findHeading(state, id);
4342
4342
  if (!heading) return false;
4343
- if (dispatch) _chunkRZJCYJWOcjs.scrollDomAtPos.call(void 0, view, heading.pos, options.behavior);
4343
+ if (dispatch) _chunkXNQ5EFB4cjs.scrollDomAtPos.call(void 0, view, heading.pos, options.behavior);
4344
4344
  return true;
4345
4345
  }
4346
4346
  };
@@ -4361,7 +4361,7 @@ var Outline = _core.Extension.create({
4361
4361
  apply: (tr, prev, _oldState, newState) => {
4362
4362
  if (!tr.docChanged) return prev;
4363
4363
  const next = computeOutline(newState.doc, types);
4364
- if (_chunkRZJCYJWOcjs.arraysEqual.call(void 0, prev, next, sameHeading)) return prev;
4364
+ if (_chunkXNQ5EFB4cjs.arraysEqual.call(void 0, prev, next, sameHeading)) return prev;
4365
4365
  storage.headings = next;
4366
4366
  _optionalChain([onUpdate, 'call', _171 => _171(), 'optionalCall', _172 => _172(next)]);
4367
4367
  return next;
@@ -4379,7 +4379,7 @@ var Outline = _core.Extension.create({
4379
4379
  },
4380
4380
  onBeforeCreate() {
4381
4381
  const { types, generateId } = this.options;
4382
- _chunkRZJCYJWOcjs.syncInitialContent.call(void 0, this.editor, (state) => assignHeadingIds(state, types, generateId));
4382
+ _chunkXNQ5EFB4cjs.syncInitialContent.call(void 0, this.editor, (state) => assignHeadingIds(state, types, generateId));
4383
4383
  }
4384
4384
  });
4385
4385
 
@@ -4549,7 +4549,7 @@ function syncTableOfContents(state, headingTypes) {
4549
4549
  node.attrs.minLevel,
4550
4550
  node.attrs.maxLevel
4551
4551
  );
4552
- if (!_chunkRZJCYJWOcjs.arraysEqual.call(void 0, _nullishCoalesce(node.attrs.entries, () => ( [])), entries, sameEntry)) {
4552
+ if (!_chunkXNQ5EFB4cjs.arraysEqual.call(void 0, _nullishCoalesce(node.attrs.entries, () => ( [])), entries, sameEntry)) {
4553
4553
  tr = _nullishCoalesce(tr, () => ( state.tr));
4554
4554
  tr.setNodeMarkup(pos, void 0, { ...node.attrs, entries });
4555
4555
  }
@@ -4561,7 +4561,7 @@ function syncTableOfContents(state, headingTypes) {
4561
4561
  }
4562
4562
  var TableOfContents = _core.Node.create({
4563
4563
  name: "tableOfContents",
4564
- priority: _chunkRZJCYJWOcjs.STRUCTURE_PRIORITY - 5,
4564
+ priority: _chunkXNQ5EFB4cjs.STRUCTURE_PRIORITY - 5,
4565
4565
  group: "block",
4566
4566
  atom: true,
4567
4567
  selectable: true,
@@ -4672,7 +4672,7 @@ var TableOfContents = _core.Node.create({
4672
4672
  return [
4673
4673
  new (0, _state.Plugin)({
4674
4674
  key: tableOfContentsPluginKey,
4675
- state: _chunkRZJCYJWOcjs.presenceStateSpec.call(void 0, [this.name]),
4675
+ state: _chunkXNQ5EFB4cjs.presenceStateSpec.call(void 0, [this.name]),
4676
4676
  appendTransaction: (transactions, _oldState, newState) => {
4677
4677
  if (!transactions.some((tr) => tr.docChanged)) return null;
4678
4678
  if (!tableOfContentsPluginKey.getState(newState)) return null;
@@ -4696,7 +4696,7 @@ var TableOfContents = _core.Node.create({
4696
4696
  );
4697
4697
  view.focus();
4698
4698
  }
4699
- _chunkRZJCYJWOcjs.scrollDomAtPos.call(void 0, view, heading.pos);
4699
+ _chunkXNQ5EFB4cjs.scrollDomAtPos.call(void 0, view, heading.pos);
4700
4700
  return true;
4701
4701
  }
4702
4702
  }
@@ -4706,7 +4706,7 @@ var TableOfContents = _core.Node.create({
4706
4706
  },
4707
4707
  onBeforeCreate() {
4708
4708
  const { headingTypes } = this.options;
4709
- _chunkRZJCYJWOcjs.syncInitialContent.call(void 0, this.editor, (state) => syncTableOfContents(state, headingTypes));
4709
+ _chunkXNQ5EFB4cjs.syncInitialContent.call(void 0, this.editor, (state) => syncTableOfContents(state, headingTypes));
4710
4710
  }
4711
4711
  });
4712
4712
 
@@ -4764,7 +4764,7 @@ function syncFootnotes(tr, options = {}) {
4764
4764
  const listType = schema.nodes[LIST];
4765
4765
  const itemType = schema.nodes[ITEM];
4766
4766
  if (!listType || !itemType) return false;
4767
- const generateId = _nullishCoalesce(options.generateId, () => ( (() => _chunkRZJCYJWOcjs.generateStructureId.call(void 0, "fn"))));
4767
+ const generateId = _nullishCoalesce(options.generateId, () => ( (() => _chunkXNQ5EFB4cjs.generateStructureId.call(void 0, "fn"))));
4768
4768
  const refs = [];
4769
4769
  const lists = [];
4770
4770
  const existing = /* @__PURE__ */ new Map();
@@ -4848,7 +4848,7 @@ function findReferences(doc, id) {
4848
4848
  }
4849
4849
  var FootnoteReference = _core.Node.create({
4850
4850
  name: REFERENCE,
4851
- priority: _chunkRZJCYJWOcjs.STRUCTURE_PRIORITY - 5,
4851
+ priority: _chunkXNQ5EFB4cjs.STRUCTURE_PRIORITY - 5,
4852
4852
  group: "inline",
4853
4853
  inline: true,
4854
4854
  atom: true,
@@ -4856,7 +4856,7 @@ var FootnoteReference = _core.Node.create({
4856
4856
  addOptions() {
4857
4857
  return {
4858
4858
  HTMLAttributes: {},
4859
- generateId: () => _chunkRZJCYJWOcjs.generateStructureId.call(void 0, "fn")
4859
+ generateId: () => _chunkXNQ5EFB4cjs.generateStructureId.call(void 0, "fn")
4860
4860
  };
4861
4861
  },
4862
4862
  addAttributes() {
@@ -4967,7 +4967,7 @@ var FootnoteReference = _core.Node.create({
4967
4967
  _state.TextSelection.create(tr.doc, footnote.pos + footnote.node.nodeSize - 2)
4968
4968
  );
4969
4969
  tr.scrollIntoView();
4970
- _chunkRZJCYJWOcjs.scrollDomAtPos.call(void 0, view, footnote.pos);
4970
+ _chunkXNQ5EFB4cjs.scrollDomAtPos.call(void 0, view, footnote.pos);
4971
4971
  }
4972
4972
  return true;
4973
4973
  },
@@ -4977,7 +4977,7 @@ var FootnoteReference = _core.Node.create({
4977
4977
  if (dispatch) {
4978
4978
  tr.setSelection(_state.NodeSelection.create(tr.doc, ref.pos));
4979
4979
  tr.scrollIntoView();
4980
- _chunkRZJCYJWOcjs.scrollDomAtPos.call(void 0, view, ref.pos);
4980
+ _chunkXNQ5EFB4cjs.scrollDomAtPos.call(void 0, view, ref.pos);
4981
4981
  }
4982
4982
  return true;
4983
4983
  }
@@ -4989,7 +4989,7 @@ var FootnoteReference = _core.Node.create({
4989
4989
  return [
4990
4990
  new (0, _state.Plugin)({
4991
4991
  key: footnotesPluginKey,
4992
- state: _chunkRZJCYJWOcjs.presenceStateSpec.call(void 0, [REFERENCE, LIST]),
4992
+ state: _chunkXNQ5EFB4cjs.presenceStateSpec.call(void 0, [REFERENCE, LIST]),
4993
4993
  appendTransaction: (transactions, _oldState, newState) => {
4994
4994
  if (!transactions.some((tr2) => tr2.docChanged)) return null;
4995
4995
  if (!footnotesPluginKey.getState(newState)) return null;
@@ -5010,7 +5010,7 @@ var FootnoteReference = _core.Node.create({
5010
5010
  },
5011
5011
  onBeforeCreate() {
5012
5012
  const { generateId } = this.options;
5013
- _chunkRZJCYJWOcjs.syncInitialContent.call(void 0, this.editor, (state) => {
5013
+ _chunkXNQ5EFB4cjs.syncInitialContent.call(void 0, this.editor, (state) => {
5014
5014
  const tr = state.tr;
5015
5015
  return syncFootnotes(tr, { generateId }) ? tr : null;
5016
5016
  });
@@ -5150,7 +5150,7 @@ var Bookmark = _core.Mark.create({
5150
5150
  addOptions() {
5151
5151
  return {
5152
5152
  HTMLAttributes: {},
5153
- generateId: () => _chunkRZJCYJWOcjs.generateStructureId.call(void 0, "bm")
5153
+ generateId: () => _chunkXNQ5EFB4cjs.generateStructureId.call(void 0, "bm")
5154
5154
  };
5155
5155
  },
5156
5156
  addAttributes() {
@@ -5235,7 +5235,7 @@ var Bookmark = _core.Mark.create({
5235
5235
  tr.setSelection(_state.TextSelection.create(tr.doc, bookmark.from, bookmark.to));
5236
5236
  tr.scrollIntoView();
5237
5237
  const domPos = state.doc.resolve(bookmark.from);
5238
- _chunkRZJCYJWOcjs.scrollDomAtPos.call(void 0, view, domPos.before(domPos.depth));
5238
+ _chunkXNQ5EFB4cjs.scrollDomAtPos.call(void 0, view, domPos.before(domPos.depth));
5239
5239
  }
5240
5240
  return true;
5241
5241
  }
@@ -5300,7 +5300,7 @@ function syncCrossReferences(state, headingTypes) {
5300
5300
  }
5301
5301
  var CrossReference = _core.Node.create({
5302
5302
  name: NAME,
5303
- priority: _chunkRZJCYJWOcjs.STRUCTURE_PRIORITY - 5,
5303
+ priority: _chunkXNQ5EFB4cjs.STRUCTURE_PRIORITY - 5,
5304
5304
  group: "inline",
5305
5305
  inline: true,
5306
5306
  atom: true,
@@ -5402,7 +5402,7 @@ var CrossReference = _core.Node.create({
5402
5402
  if (dispatch) {
5403
5403
  tr.setSelection(_state.TextSelection.create(tr.doc, range.from, range.to));
5404
5404
  tr.scrollIntoView();
5405
- _chunkRZJCYJWOcjs.scrollDomAtPos.call(void 0, view, range.blockPos);
5405
+ _chunkXNQ5EFB4cjs.scrollDomAtPos.call(void 0, view, range.blockPos);
5406
5406
  }
5407
5407
  return true;
5408
5408
  }
@@ -5414,7 +5414,7 @@ var CrossReference = _core.Node.create({
5414
5414
  return [
5415
5415
  new (0, _state.Plugin)({
5416
5416
  key: crossReferencePluginKey,
5417
- state: _chunkRZJCYJWOcjs.presenceStateSpec.call(void 0, [NAME]),
5417
+ state: _chunkXNQ5EFB4cjs.presenceStateSpec.call(void 0, [NAME]),
5418
5418
  appendTransaction: (transactions, _oldState, newState) => {
5419
5419
  if (!transactions.some((tr) => tr.docChanged)) return null;
5420
5420
  if (!crossReferencePluginKey.getState(newState)) return null;
@@ -5433,7 +5433,7 @@ var CrossReference = _core.Node.create({
5433
5433
  },
5434
5434
  onBeforeCreate() {
5435
5435
  const { headingTypes } = this.options;
5436
- _chunkRZJCYJWOcjs.syncInitialContent.call(void 0, this.editor, (state) => syncCrossReferences(state, headingTypes));
5436
+ _chunkXNQ5EFB4cjs.syncInitialContent.call(void 0, this.editor, (state) => syncCrossReferences(state, headingTypes));
5437
5437
  }
5438
5438
  });
5439
5439
 
@@ -5688,7 +5688,7 @@ var FindReplace = _core.Extension.create({
5688
5688
  if (!s || !s.active || s.currentIndex < 0 || !s.matches[s.currentIndex]) return false;
5689
5689
  if (dispatch) {
5690
5690
  _history.closeHistory.call(void 0, tr);
5691
- const [end] = _chunkRZJCYJWOcjs.applyReplacements.call(void 0, tr, [s.matches[s.currentIndex]]);
5691
+ const [end] = _chunkXNQ5EFB4cjs.applyReplacements.call(void 0, tr, [s.matches[s.currentIndex]]);
5692
5692
  tr.setSelection(_state.TextSelection.create(tr.doc, end)).scrollIntoView();
5693
5693
  meta(tr, { type: "replaced", anchor: end, count: 1 });
5694
5694
  }
@@ -5699,7 +5699,7 @@ var FindReplace = _core.Extension.create({
5699
5699
  if (!s || !s.active || !s.matches.length) return false;
5700
5700
  if (dispatch) {
5701
5701
  _history.closeHistory.call(void 0, tr);
5702
- const ends = _chunkRZJCYJWOcjs.applyReplacements.call(void 0, tr, s.matches);
5702
+ const ends = _chunkXNQ5EFB4cjs.applyReplacements.call(void 0, tr, s.matches);
5703
5703
  meta(tr, { type: "replaced", anchor: ends[ends.length - 1], count: s.matches.length });
5704
5704
  }
5705
5705
  return true;
@@ -5731,7 +5731,7 @@ var FindReplace = _core.Extension.create({
5731
5731
  if (!s.active || !s.query) {
5732
5732
  return { ...s, matches: [], currentIndex: -1, error: null, truncated: false };
5733
5733
  }
5734
- const result = _chunkRZJCYJWOcjs.searchDocument.call(void 0, doc, s.query, s.options, {
5734
+ const result = _chunkXNQ5EFB4cjs.searchDocument.call(void 0, doc, s.query, s.options, {
5735
5735
  replacement: s.replacement,
5736
5736
  clipboardText: safeClipboard(options.getClipboardText),
5737
5737
  timeLimitMs: options.timeLimitMs,
@@ -6318,7 +6318,7 @@ function createRichTextPreset(options = {}) {
6318
6318
  })
6319
6319
  ];
6320
6320
  if (options.table !== false) {
6321
- extensions2.push(..._chunkRZJCYJWOcjs.createTableExtensions.call(void 0, optionObject(options.table)));
6321
+ extensions2.push(..._chunkXNQ5EFB4cjs.createTableExtensions.call(void 0, optionObject(options.table)));
6322
6322
  }
6323
6323
  if (characterLimit) {
6324
6324
  extensions2.push(
@@ -6425,8 +6425,8 @@ function createRichTextPreset(options = {}) {
6425
6425
  }
6426
6426
  if (options.chart) {
6427
6427
  const { sparkline = true, ...chartOptions } = optionObject(options.chart);
6428
- extensions2.push(_chunkRZJCYJWOcjs.Chart.configure(chartOptions));
6429
- if (sparkline) extensions2.push(_chunkRZJCYJWOcjs.Sparkline.configure(optionObject(sparkline)));
6428
+ extensions2.push(_chunkXNQ5EFB4cjs.Chart.configure(chartOptions));
6429
+ if (sparkline) extensions2.push(_chunkXNQ5EFB4cjs.Sparkline.configure(optionObject(sparkline)));
6430
6430
  }
6431
6431
  if (options.paragraphStyles) {
6432
6432
  extensions2.push(ParagraphStyles.configure(optionObject(options.paragraphStyles)));
@@ -6567,7 +6567,7 @@ function createFindReplaceCommands(editor, options = {}) {
6567
6567
  ];
6568
6568
  }
6569
6569
  function validateFindPattern(query, options = {}) {
6570
- const result = _chunkRZJCYJWOcjs.compileFindPattern.call(void 0, query, options);
6570
+ const result = _chunkXNQ5EFB4cjs.compileFindPattern.call(void 0, query, options);
6571
6571
  return result.ok ? null : result.error;
6572
6572
  }
6573
6573
 
@@ -6576,8 +6576,8 @@ var PARAMS = {
6576
6576
  insertTable: {
6577
6577
  type: "object",
6578
6578
  properties: {
6579
- rows: { type: "integer", minimum: 1, maximum: _chunkRZJCYJWOcjs.MAX_TABLE_ROWS, description: "Rows (default 3)." },
6580
- cols: { type: "integer", minimum: 1, maximum: _chunkRZJCYJWOcjs.MAX_TABLE_COLUMNS, description: "Columns (default 3)." },
6579
+ rows: { type: "integer", minimum: 1, maximum: _chunkXNQ5EFB4cjs.MAX_TABLE_ROWS, description: "Rows (default 3)." },
6580
+ cols: { type: "integer", minimum: 1, maximum: _chunkXNQ5EFB4cjs.MAX_TABLE_COLUMNS, description: "Columns (default 3)." },
6581
6581
  withHeaderRow: { type: "boolean", description: "Make the first row a header row (default true)." }
6582
6582
  },
6583
6583
  additionalProperties: false
@@ -6608,7 +6608,7 @@ function createTableCommands(editor, options = {}) {
6608
6608
  const group = _nullishCoalesce(options.group, () => ( "Table"));
6609
6609
  const scope = options.scope ? { scope: options.scope } : {};
6610
6610
  const focus = _nullishCoalesce(options.focus, () => ( true));
6611
- return _chunkRZJCYJWOcjs.TABLE_ACTIONS.map(({ action, label, description, keywords }) => {
6611
+ return _chunkXNQ5EFB4cjs.TABLE_ACTIONS.map(({ action, label, description, keywords }) => {
6612
6612
  const params = PARAMS[action];
6613
6613
  return {
6614
6614
  id: `${prefix}${action}`,
@@ -6618,13 +6618,13 @@ function createTableCommands(editor, options = {}) {
6618
6618
  description,
6619
6619
  ...params ? { params } : {},
6620
6620
  ...scope,
6621
- enabled: (_ctx, p) => _chunkRZJCYJWOcjs.getTableActionState.call(void 0, editor, action, _nullishCoalesce(p, () => ( {}))),
6621
+ enabled: (_ctx, p) => _chunkXNQ5EFB4cjs.getTableActionState.call(void 0, editor, action, _nullishCoalesce(p, () => ( {}))),
6622
6622
  run: (_ctx, p) => {
6623
- if (!_chunkRZJCYJWOcjs.runTableAction.call(void 0, editor, action, _nullishCoalesce(p, () => ( {})), { focus })) {
6624
- const reason = _chunkRZJCYJWOcjs.getTableActionState.call(void 0, editor, action, _nullishCoalesce(p, () => ( {})));
6623
+ if (!_chunkXNQ5EFB4cjs.runTableAction.call(void 0, editor, action, _nullishCoalesce(p, () => ( {})), { focus })) {
6624
+ const reason = _chunkXNQ5EFB4cjs.getTableActionState.call(void 0, editor, action, _nullishCoalesce(p, () => ( {})));
6625
6625
  throw new Error(reason === true ? `${label} did not change the document.` : reason);
6626
6626
  }
6627
- const state = _chunkRZJCYJWOcjs.getTableState.call(void 0, editor);
6627
+ const state = _chunkXNQ5EFB4cjs.getTableState.call(void 0, editor);
6628
6628
  return {
6629
6629
  done: true,
6630
6630
  table: state.inTable ? { rows: state.rows, columns: state.columns, row: state.row, column: state.column } : null
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  BUILTIN_BRUSHES
3
- } from "./chunk-ORDXMBD4.js";
3
+ } from "./chunk-A5UCR2TO.js";
4
4
  import {
5
5
  parseProvenance
6
6
  } from "./chunk-M6DNZNVY.js";
@@ -47,7 +47,7 @@ import {
47
47
  GRAIN_PATTERNS,
48
48
  brushstrokeDataUrl,
49
49
  isBrushstrokeBrush
50
- } from "./chunk-AGZ47XY2.js";
50
+ } from "./chunk-2N2QPO3H.js";
51
51
  import {
52
52
  oklabToRgb,
53
53
  rgbToOklab
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
 
8
- var _chunkLRRCMRSLcjs = require('./chunk-LRRCMRSL.cjs');
8
+ var _chunkEBDCRTZIcjs = require('./chunk-EBDCRTZI.cjs');
9
9
 
10
10
 
11
11
 
@@ -795,9 +795,9 @@ function applyRetouchToTile(coverage, tileData, channels, tx, ty, paint, s, opti
795
795
  const g0 = rgb[1];
796
796
  const b0 = rgb[2];
797
797
  paint.tone(rgb);
798
- _chunkLRRCMRSLcjs.put255.call(void 0, out, i, r0 + (rgb[0] - r0) * k);
799
- _chunkLRRCMRSLcjs.put255.call(void 0, out, i + 1, g0 + (rgb[1] - g0) * k);
800
- _chunkLRRCMRSLcjs.put255.call(void 0, out, i + 2, b0 + (rgb[2] - b0) * k);
798
+ _chunkEBDCRTZIcjs.put255.call(void 0, out, i, r0 + (rgb[0] - r0) * k);
799
+ _chunkEBDCRTZIcjs.put255.call(void 0, out, i + 1, g0 + (rgb[1] - g0) * k);
800
+ _chunkEBDCRTZIcjs.put255.call(void 0, out, i + 2, b0 + (rgb[2] - b0) * k);
801
801
  continue;
802
802
  }
803
803
  if (s.lockTransparency && a === 0) continue;
@@ -812,10 +812,10 @@ function applyRetouchToTile(coverage, tileData, channels, tx, ty, paint, s, opti
812
812
  cs[ch] = src[ch] / 255;
813
813
  }
814
814
  const o = _chunkCWM3CUUXcjs.blendPixel.call(void 0, blend, cb, cs, k);
815
- _chunkLRRCMRSLcjs.put255.call(void 0, out, i, o[0]);
816
- _chunkLRRCMRSLcjs.put255.call(void 0, out, i + 1, o[1]);
817
- _chunkLRRCMRSLcjs.put255.call(void 0, out, i + 2, o[2]);
818
- if (!s.lockTransparency) _chunkLRRCMRSLcjs.put255.call(void 0, out, i + 3, o[3]);
815
+ _chunkEBDCRTZIcjs.put255.call(void 0, out, i, o[0]);
816
+ _chunkEBDCRTZIcjs.put255.call(void 0, out, i + 1, o[1]);
817
+ _chunkEBDCRTZIcjs.put255.call(void 0, out, i + 2, o[2]);
818
+ if (!s.lockTransparency) _chunkEBDCRTZIcjs.put255.call(void 0, out, i + 3, o[3]);
819
819
  }
820
820
  }
821
821
  return out;
@@ -963,8 +963,8 @@ var RetouchDabStroke = (_class3 = class {
963
963
  constructor(brush, target, effect) {;_class3.prototype.__init5.call(this);_class3.prototype.__init6.call(this);_class3.prototype.__init7.call(this);_class3.prototype.__init8.call(this);
964
964
  this.brush = brush;
965
965
  this.effect = effect;
966
- this.walker = new (0, _chunkLRRCMRSLcjs.DabWalker)(brush);
967
- this.medium = new (0, _chunkLRRCMRSLcjs.TileMedium)(target);
966
+ this.walker = new (0, _chunkEBDCRTZIcjs.DabWalker)(brush);
967
+ this.medium = new (0, _chunkEBDCRTZIcjs.TileMedium)(target);
968
968
  }
969
969
 
970
970
 
@@ -995,11 +995,11 @@ var RetouchDabStroke = (_class3 = class {
995
995
  paint(dabs) {
996
996
  const rects = [];
997
997
  for (const d of dabs) {
998
- const rect = _chunkLRRCMRSLcjs.dabRect.call(void 0, d, this.brush.hardness);
998
+ const rect = _chunkEBDCRTZIcjs.dabRect.call(void 0, d, this.brush.hardness);
999
999
  const n = rect.width * rect.height;
1000
1000
  if (this.buf.length < n) this.buf = new Float32Array(n);
1001
1001
  const cov = this.buf.subarray(0, n);
1002
- _chunkLRRCMRSLcjs.rasterizeDab.call(void 0, { ...d, alpha: 1 }, this.brush.hardness, rect, cov);
1002
+ _chunkEBDCRTZIcjs.rasterizeDab.call(void 0, { ...d, alpha: 1 }, this.brush.hardness, rect, cov);
1003
1003
  this.medium.reset();
1004
1004
  this.effect(this.medium, d, rect, cov);
1005
1005
  rects.push(rect);
@@ -1011,7 +1011,7 @@ var RetouchDabStroke = (_class3 = class {
1011
1011
  }, _class3);
1012
1012
  function smudgeEffect(brush, strength, mixing = "rgb") {
1013
1013
  const s = Math.min(1, Math.max(0, strength));
1014
- const tip = new (0, _chunkLRRCMRSLcjs.SmudgeTip)({ strength: s, length: s, mixing }, brush.size);
1014
+ const tip = new (0, _chunkEBDCRTZIcjs.SmudgeTip)({ strength: s, length: s, mixing }, brush.size);
1015
1015
  return (medium, d, rect, cov) => tip.dab(medium, { x: d.x, y: d.y, radius: d.radius, opacity: d.opacity * d.alpha }, rect, cov);
1016
1016
  }
1017
1017
  function spongeEffect(brush, saturate, vibrance) {
@@ -1034,9 +1034,9 @@ function spongeEffect(brush, saturate, vibrance) {
1034
1034
  rgb[1] = px[i + 1] / 255;
1035
1035
  rgb[2] = px[i + 2] / 255;
1036
1036
  sponge(rgb, k, saturate, vibrance);
1037
- _chunkLRRCMRSLcjs.put255.call(void 0, px, i, rgb[0]);
1038
- _chunkLRRCMRSLcjs.put255.call(void 0, px, i + 1, rgb[1]);
1039
- _chunkLRRCMRSLcjs.put255.call(void 0, px, i + 2, rgb[2]);
1037
+ _chunkEBDCRTZIcjs.put255.call(void 0, px, i, rgb[0]);
1038
+ _chunkEBDCRTZIcjs.put255.call(void 0, px, i + 1, rgb[1]);
1039
+ _chunkEBDCRTZIcjs.put255.call(void 0, px, i + 2, rgb[2]);
1040
1040
  }
1041
1041
  }
1042
1042
  };
@@ -20,7 +20,7 @@ import {
20
20
  randSigned,
21
21
  rasterizeDab,
22
22
  readPaintSource
23
- } from "./chunk-AGZ47XY2.js";
23
+ } from "./chunk-2N2QPO3H.js";
24
24
  import {
25
25
  TILE,
26
26
  TiledSurface,
@@ -73,7 +73,13 @@ function paperPreset(id) {
73
73
  return p ? clonePaper(p) : void 0;
74
74
  }
75
75
  function clonePaper(p) {
76
- return { ...p, dry: { ...p.dry }, wet: { ...p.wet } };
76
+ return { ...p, dry: { ...p.dry }, wet: { ...p.wet }, ...p.offset ? { offset: { ...p.offset } } : {} };
77
+ }
78
+ function readOffset(raw, d) {
79
+ const o = raw && typeof raw === "object" ? raw : null;
80
+ const x = o && typeof o.x === "number" && Number.isFinite(o.x) ? Math.round(o.x) : d?.x ?? 0;
81
+ const y = o && typeof o.y === "number" && Number.isFinite(o.y) ? Math.round(o.y) : d?.y ?? 0;
82
+ return x || y ? { offset: { x, y } } : {};
77
83
  }
78
84
  function readTuning(raw, d) {
79
85
  const r = raw && typeof raw === "object" ? raw : {};
@@ -98,7 +104,8 @@ function normalizePaper(raw = {}, base) {
98
104
  absorption: unit(r.absorption, b.absorption),
99
105
  permeability: unit(r.permeability, b.permeability),
100
106
  roughness: unit(r.roughness, b.roughness),
101
- ...unit(r.metallic, b.metallic ?? 0) > 0 ? { metallic: unit(r.metallic, b.metallic ?? 0) } : {}
107
+ ...unit(r.metallic, b.metallic ?? 0) > 0 ? { metallic: unit(r.metallic, b.metallic ?? 0) } : {},
108
+ ...readOffset(r.offset, b.offset)
102
109
  };
103
110
  }
104
111
  function hexToRgb8(hex) {