@pixerate/editor 0.140.0 → 0.140.1

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 (59) hide show
  1. package/dist/agent/index.cjs +39 -31
  2. package/dist/agent/index.js +13 -5
  3. package/dist/bridge/cli.cjs +4 -3
  4. package/dist/bridge/cli.js +3 -2
  5. package/dist/bridge/index.cjs +4 -3
  6. package/dist/bridge/index.js +3 -2
  7. package/dist/chunk-2BSBFBOA.cjs +46 -0
  8. package/dist/{chunk-SWZTQWY7.js → chunk-2INPJDNY.js} +1 -1
  9. package/dist/{chunk-CCKP4XAN.cjs → chunk-34RQAGWI.cjs} +27 -7
  10. package/dist/{chunk-HXCBQ7A6.cjs → chunk-3AJMR7EG.cjs} +7 -4
  11. package/dist/{chunk-NKBUVQJW.cjs → chunk-5WOY52O6.cjs} +15 -15
  12. package/dist/{chunk-5G3KYRER.js → chunk-6GAYGQDC.js} +8 -7
  13. package/dist/{chunk-HZZXBTLB.js → chunk-6IN474P4.js} +25 -5
  14. package/dist/{chunk-HDCH35UM.cjs → chunk-AGCD3EHB.cjs} +7 -7
  15. package/dist/{chunk-6I63VZ45.js → chunk-CXXKJBQZ.js} +5 -1
  16. package/dist/{chunk-6NXVDJDR.cjs → chunk-G43MNQ4C.cjs} +5 -5
  17. package/dist/{chunk-ZAOOIJ6I.cjs → chunk-HDK3T2QS.cjs} +4 -1
  18. package/dist/chunk-HF5QZS7Z.js +46 -0
  19. package/dist/{chunk-S7I3RI5Z.cjs → chunk-HMGWFXEC.cjs} +27 -24
  20. package/dist/{chunk-RPW7YL3D.cjs → chunk-L434J57V.cjs} +8 -7
  21. package/dist/{chunk-UCRL6JEV.cjs → chunk-L5OWG2NA.cjs} +8 -3
  22. package/dist/{chunk-RWML7TWG.cjs → chunk-PUR6BZFA.cjs} +112 -111
  23. package/dist/{chunk-WBKLYLZE.js → chunk-RB62U6MS.js} +4 -1
  24. package/dist/{chunk-KIBEEN5K.js → chunk-UMS6YFA6.js} +1 -1
  25. package/dist/{chunk-4LGWAJDI.js → chunk-V5OOP74P.js} +5 -2
  26. package/dist/{chunk-UOJS6PUP.js → chunk-WBJ6BG4R.js} +23 -22
  27. package/dist/{chunk-WIYAOZZU.js → chunk-WHKNYFM2.js} +7 -2
  28. package/dist/{chunk-F652BKMS.cjs → chunk-YN6JKAUE.cjs} +6 -2
  29. package/dist/{chunk-YTGF4TJR.js → chunk-ZLZKGHSZ.js} +5 -2
  30. package/dist/{chunk-USU2FL3N.js → chunk-ZNHB5RG6.js} +1 -1
  31. package/dist/compare/index.cjs +4 -3
  32. package/dist/compare/index.js +3 -2
  33. package/dist/export/index.cjs +4 -3
  34. package/dist/export/index.js +3 -2
  35. package/dist/extensions/index.cjs +11 -8
  36. package/dist/extensions/index.d.cts +1 -0
  37. package/dist/extensions/index.d.ts +1 -0
  38. package/dist/extensions/index.js +10 -7
  39. package/dist/extensions/safe-merge-attributes.d.cts +10 -0
  40. package/dist/extensions/safe-merge-attributes.d.ts +10 -0
  41. package/dist/image-editor/index.cjs +4 -3
  42. package/dist/image-editor/index.js +2 -1
  43. package/dist/index.cjs +42 -29
  44. package/dist/index.d.cts +1 -0
  45. package/dist/index.d.ts +1 -0
  46. package/dist/index.js +22 -9
  47. package/dist/persistence/index.cjs +3 -2
  48. package/dist/persistence/index.js +2 -1
  49. package/dist/serializers/index.cjs +5 -4
  50. package/dist/serializers/index.js +4 -3
  51. package/dist/tools/index.cjs +11 -3
  52. package/dist/tools/index.d.cts +1 -0
  53. package/dist/tools/index.d.ts +1 -0
  54. package/dist/tools/index.js +10 -2
  55. package/dist/tools/safe-json.d.cts +27 -0
  56. package/dist/tools/safe-json.d.ts +27 -0
  57. package/package.json +28 -28
  58. /package/dist/{chunk-MCTQXUXR.js → chunk-K73HMKQP.js} +0 -0
  59. /package/dist/{chunk-R6DFK5OX.cjs → chunk-LACYURUW.cjs} +0 -0
@@ -5,7 +5,7 @@ var _chunkJLWLX52Lcjs = require('./chunk-JLWLX52L.cjs');
5
5
 
6
6
 
7
7
 
8
- var _chunkF652BKMScjs = require('./chunk-F652BKMS.cjs');
8
+ var _chunkYN6JKAUEcjs = require('./chunk-YN6JKAUE.cjs');
9
9
 
10
10
 
11
11
 
@@ -316,7 +316,7 @@ function threadsOf(source) {
316
316
  return Array.isArray(value.threads) ? [...value.threads] : [];
317
317
  }
318
318
  function stylesOf(source) {
319
- if (!source) return { styles: _chunkF652BKMScjs.DEFAULT_STYLES.map((s) => ({ ...s })), defaults: {} };
319
+ if (!source) return { styles: _chunkYN6JKAUEcjs.DEFAULT_STYLES.map((s) => ({ ...s })), defaults: {} };
320
320
  if (Array.isArray(source)) return { styles: [...source], defaults: {} };
321
321
  const value = source;
322
322
  const json = typeof value.toJSON === "function" ? value.toJSON() : value;
@@ -384,7 +384,7 @@ function runFormatOf(marks) {
384
384
  break;
385
385
  }
386
386
  case "characterStyle":
387
- if (_chunkF652BKMScjs.isValidStyleId.call(void 0, attrs2.styleId)) format.charStyle = attrs2.styleId;
387
+ if (_chunkYN6JKAUEcjs.isValidStyleId.call(void 0, attrs2.styleId)) format.charStyle = attrs2.styleId;
388
388
  break;
389
389
  case "link":
390
390
  format.charStyle ??= "Hyperlink";
@@ -522,7 +522,7 @@ var DocxBuilder = (_class2 = class {
522
522
  this.styles = styles;
523
523
  this.anonymous = options.privacy === "strip-authors";
524
524
  this.defaultAuthor = authorOf(options.author);
525
- this.styleIds = new Set(styles.styles.filter((s) => _chunkF652BKMScjs.isValidStyleId.call(void 0, s.id)).map((s) => s.id));
525
+ this.styleIds = new Set(styles.styles.filter((s) => _chunkYN6JKAUEcjs.isValidStyleId.call(void 0, s.id)).map((s) => s.id));
526
526
  }
527
527
 
528
528
 
@@ -713,7 +713,7 @@ var DocxBuilder = (_class2 = class {
713
713
  styleFor(node, ctx, opts) {
714
714
  const own = _optionalChain([node, 'access', _37 => _37.attrs, 'optionalAccess', _38 => _38.styleId]);
715
715
  if (own) {
716
- if (_chunkF652BKMScjs.isValidStyleId.call(void 0, own) && this.styleIds.has(own)) return own;
716
+ if (_chunkYN6JKAUEcjs.isValidStyleId.call(void 0, own) && this.styleIds.has(own)) return own;
717
717
  this.drop("style", String(own), "style is not in the registry");
718
718
  }
719
719
  if (opts.heading) return this.needStyle(`Heading${opts.heading}`);
@@ -730,7 +730,7 @@ var DocxBuilder = (_class2 = class {
730
730
  previousStyle(previous) {
731
731
  if (!previous) return void 0;
732
732
  const id = _optionalChain([previous, 'access', _39 => _39.attrs, 'optionalAccess', _40 => _40.styleId]);
733
- if (_chunkF652BKMScjs.isValidStyleId.call(void 0, id) && this.styleIds.has(id)) return id;
733
+ if (_chunkYN6JKAUEcjs.isValidStyleId.call(void 0, id) && this.styleIds.has(id)) return id;
734
734
  if (previous.type === "heading") return this.needStyle(`Heading${Math.max(1, Math.min(6, Number(_optionalChain([previous, 'access', _41 => _41.attrs, 'optionalAccess', _42 => _42.level])) || 1))}`);
735
735
  if (previous.type === "codeBlock") return this.needStyle("Code");
736
736
  return void 0;
@@ -1200,7 +1200,7 @@ var DocxBuilder = (_class2 = class {
1200
1200
  if (defaults.paragraph && Object.keys(defaults.paragraph).length) writeParagraphFormat(w, defaults.paragraph);
1201
1201
  else w.empty("w:spacing", { "w:after": 160, "w:line": 259, "w:lineRule": "auto" });
1202
1202
  w.close("w:pPr").close("w:pPrDefault").close("w:docDefaults");
1203
- const byId = new Map(this.styles.styles.filter((s) => _chunkF652BKMScjs.isValidStyleId.call(void 0, s.id)).map((s) => [s.id, s]));
1203
+ const byId = new Map(this.styles.styles.filter((s) => _chunkYN6JKAUEcjs.isValidStyleId.call(void 0, s.id)).map((s) => [s.id, s]));
1204
1204
  const written = /* @__PURE__ */ new Set();
1205
1205
  const blockOf = (style) => {
1206
1206
  let current = style;
@@ -1213,7 +1213,7 @@ var DocxBuilder = (_class2 = class {
1213
1213
  const writeStyle = (style) => {
1214
1214
  if (written.has(style.id)) return;
1215
1215
  written.add(style.id);
1216
- const isNormal = style.kind === "paragraph" && style.id === _chunkF652BKMScjs.NORMAL_STYLE_ID;
1216
+ const isNormal = style.kind === "paragraph" && style.id === _chunkYN6JKAUEcjs.NORMAL_STYLE_ID;
1217
1217
  w.open("w:style", {
1218
1218
  "w:type": style.kind === "character" ? "character" : "paragraph",
1219
1219
  "w:default": isNormal ? 1 : void 0,
@@ -1255,7 +1255,7 @@ var DocxBuilder = (_class2 = class {
1255
1255
  byId.forEach((style) => visit(style));
1256
1256
  for (const id of this.extraStyles) {
1257
1257
  if (written.has(id)) continue;
1258
- const extra = _nullishCoalesce(EXTRA_STYLES[id], () => ( { id, name: id, kind: "paragraph", basedOn: _chunkF652BKMScjs.NORMAL_STYLE_ID }));
1258
+ const extra = _nullishCoalesce(EXTRA_STYLES[id], () => ( { id, name: id, kind: "paragraph", basedOn: _chunkYN6JKAUEcjs.NORMAL_STYLE_ID }));
1259
1259
  byId.set(id, extra);
1260
1260
  writeStyle(extra);
1261
1261
  }
@@ -1425,7 +1425,7 @@ var EXTRA_STYLES = {
1425
1425
  id: "BlockText",
1426
1426
  name: "Block Text",
1427
1427
  kind: "paragraph",
1428
- basedOn: _chunkF652BKMScjs.NORMAL_STYLE_ID,
1428
+ basedOn: _chunkYN6JKAUEcjs.NORMAL_STYLE_ID,
1429
1429
  paragraph: { indentLeft: "0.5in", indentRight: "0.5in" },
1430
1430
  character: { italic: true },
1431
1431
  priority: 99,
@@ -1435,7 +1435,7 @@ var EXTRA_STYLES = {
1435
1435
  id: "ListParagraph",
1436
1436
  name: "List Paragraph",
1437
1437
  kind: "paragraph",
1438
- basedOn: _chunkF652BKMScjs.NORMAL_STYLE_ID,
1438
+ basedOn: _chunkYN6JKAUEcjs.NORMAL_STYLE_ID,
1439
1439
  paragraph: { indentLeft: "0.5in" },
1440
1440
  priority: 34,
1441
1441
  quick: true,
@@ -1445,7 +1445,7 @@ var EXTRA_STYLES = {
1445
1445
  id: "Code",
1446
1446
  name: "Code",
1447
1447
  kind: "paragraph",
1448
- basedOn: _chunkF652BKMScjs.NORMAL_STYLE_ID,
1448
+ basedOn: _chunkYN6JKAUEcjs.NORMAL_STYLE_ID,
1449
1449
  block: { type: "codeBlock" },
1450
1450
  character: { fontFamily: "Consolas", fontSize: "10pt" },
1451
1451
  paragraph: { spaceAfter: "0pt", lineHeight: "1" },
@@ -1473,7 +1473,7 @@ var EXTRA_STYLES = {
1473
1473
  id: "CommentText",
1474
1474
  name: "annotation text",
1475
1475
  kind: "paragraph",
1476
- basedOn: _chunkF652BKMScjs.NORMAL_STYLE_ID,
1476
+ basedOn: _chunkYN6JKAUEcjs.NORMAL_STYLE_ID,
1477
1477
  character: { fontSize: "10pt" },
1478
1478
  priority: 99,
1479
1479
  hidden: true,
@@ -1485,8 +1485,8 @@ for (let level = 1; level <= 6; level++) {
1485
1485
  id: `Heading${level}`,
1486
1486
  name: `Heading ${level}`,
1487
1487
  kind: "paragraph",
1488
- basedOn: _chunkF652BKMScjs.NORMAL_STYLE_ID,
1489
- next: _chunkF652BKMScjs.NORMAL_STYLE_ID,
1488
+ basedOn: _chunkYN6JKAUEcjs.NORMAL_STYLE_ID,
1489
+ next: _chunkYN6JKAUEcjs.NORMAL_STYLE_ID,
1490
1490
  block: { type: "heading", attrs: { level } },
1491
1491
  character: { bold: true },
1492
1492
  priority: 9,
@@ -15,11 +15,12 @@ import {
15
15
  } from "./chunk-RN767PO6.js";
16
16
  import {
17
17
  plainTextToSlice
18
- } from "./chunk-SWZTQWY7.js";
18
+ } from "./chunk-2INPJDNY.js";
19
19
  import {
20
20
  TRACK_CHANGES_SKIP_META,
21
- isTrackChangesEnabled
22
- } from "./chunk-HZZXBTLB.js";
21
+ isTrackChangesEnabled,
22
+ safeMergeAttributes
23
+ } from "./chunk-6IN474P4.js";
23
24
 
24
25
  // src/extensions/table/nesting.ts
25
26
  import { Fragment, Slice } from "@tiptap/pm/model";
@@ -1332,7 +1333,7 @@ function createChartNodeView(mount, renderStatic) {
1332
1333
  }
1333
1334
 
1334
1335
  // src/extensions/chart/chart-node.ts
1335
- import { Node, mergeAttributes } from "@tiptap/core";
1336
+ import { Node } from "@tiptap/core";
1336
1337
  import { Plugin as Plugin2, PluginKey as PluginKey2 } from "@tiptap/pm/state";
1337
1338
 
1338
1339
  // src/extensions/document-structure/utils.ts
@@ -1550,7 +1551,7 @@ var Chart = Node.create({
1550
1551
  const svg = staticChartSvg(node, this.options);
1551
1552
  return [
1552
1553
  "div",
1553
- mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, {
1554
+ safeMergeAttributes(this.options.HTMLAttributes, HTMLAttributes, {
1554
1555
  "data-type": "chart",
1555
1556
  class: "pixerate-chart"
1556
1557
  }),
@@ -1630,7 +1631,7 @@ var Chart = Node.create({
1630
1631
  });
1631
1632
 
1632
1633
  // src/extensions/chart/sparkline-node.ts
1633
- import { Node as Node2, mergeAttributes as mergeAttributes2 } from "@tiptap/core";
1634
+ import { Node as Node2 } from "@tiptap/core";
1634
1635
  var SPARKLINE_KINDS = ["line", "column", "win-loss"];
1635
1636
  var MAX_SPARKLINE_VALUES = 1e3;
1636
1637
  function normalizeSparklineValues(values) {
@@ -1717,7 +1718,7 @@ var Sparkline = Node2.create({
1717
1718
  });
1718
1719
  return [
1719
1720
  "span",
1720
- mergeAttributes2(this.options.HTMLAttributes, HTMLAttributes, {
1721
+ safeMergeAttributes(this.options.HTMLAttributes, HTMLAttributes, {
1721
1722
  "data-type": "sparkline",
1722
1723
  class: "pixerate-sparkline"
1723
1724
  }),
@@ -1,3 +1,22 @@
1
+ import {
2
+ isUnsafeJsonKey,
3
+ stripPrototypeKeys
4
+ } from "./chunk-HF5QZS7Z.js";
5
+
6
+ // src/extensions/safe-merge-attributes.ts
7
+ import { mergeAttributes } from "@tiptap/core";
8
+ function safeMergeAttributes(...objects) {
9
+ return mergeAttributes(
10
+ ...objects.filter((item) => !!item).map((item) => {
11
+ const keys = Object.keys(item);
12
+ if (!keys.some(isUnsafeJsonKey)) return item;
13
+ const copy = {};
14
+ for (const key of keys) if (!isUnsafeJsonKey(key)) copy[key] = item[key];
15
+ return copy;
16
+ })
17
+ );
18
+ }
19
+
1
20
  // src/extensions/comment-store.ts
2
21
  var idCounter = 0;
3
22
  function createReviewId(prefix = "c") {
@@ -44,7 +63,7 @@ var CommentStore = class _CommentStore {
44
63
  }
45
64
  /** Parses `toJSON()` output (or a plain thread array). */
46
65
  static parse(json) {
47
- const value = typeof json === "string" ? JSON.parse(json) : json;
66
+ const value = stripPrototypeKeys(typeof json === "string" ? JSON.parse(json) : json);
48
67
  const list = Array.isArray(value) ? value : value?.threads;
49
68
  if (!Array.isArray(list)) return [];
50
69
  return list.filter((t) => t && t.id != null).map(normalizeThread);
@@ -237,7 +256,7 @@ function formatReviewTime(timestamp, now = Date.now()) {
237
256
  }
238
257
 
239
258
  // src/extensions/track-changes.ts
240
- import { Extension, Mark, mergeAttributes } from "@tiptap/core";
259
+ import { Extension, Mark } from "@tiptap/core";
241
260
  import {
242
261
  Plugin,
243
262
  PluginKey,
@@ -369,7 +388,7 @@ var TrackedInsertion = Mark.create({
369
388
  const base = mark.attrs[MOVE_ID_ATTRIBUTE] ? this.options.moveHTMLAttributes : this.options.HTMLAttributes;
370
389
  return [
371
390
  "ins",
372
- mergeAttributes(base, HTMLAttributes, {
391
+ safeMergeAttributes(base, HTMLAttributes, {
373
392
  "data-change-type": "insertion"
374
393
  }),
375
394
  0
@@ -403,7 +422,7 @@ var TrackedDeletion = Mark.create({
403
422
  const base = mark.attrs[MOVE_ID_ATTRIBUTE] ? this.options.moveHTMLAttributes : this.options.HTMLAttributes;
404
423
  return [
405
424
  "del",
406
- mergeAttributes(base, HTMLAttributes, {
425
+ safeMergeAttributes(base, HTMLAttributes, {
407
426
  "data-change-type": "deletion"
408
427
  }),
409
428
  0
@@ -444,7 +463,7 @@ var TrackedFormatChange = Mark.create({
444
463
  renderHTML({ HTMLAttributes }) {
445
464
  return [
446
465
  "span",
447
- mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, {
466
+ safeMergeAttributes(this.options.HTMLAttributes, HTMLAttributes, {
448
467
  "data-change-type": "format"
449
468
  }),
450
469
  0
@@ -1931,6 +1950,7 @@ var TrackChanges = Extension.create({
1931
1950
  });
1932
1951
 
1933
1952
  export {
1953
+ safeMergeAttributes,
1934
1954
  createReviewId,
1935
1955
  CommentStore,
1936
1956
  createCommentStore,
@@ -3,7 +3,7 @@
3
3
 
4
4
 
5
5
 
6
- var _chunkZAOOIJ6Icjs = require('./chunk-ZAOOIJ6I.cjs');
6
+ var _chunkHDK3T2QScjs = require('./chunk-HDK3T2QS.cjs');
7
7
 
8
8
  // src/bridge/index.ts
9
9
  var _http = require('http');
@@ -197,7 +197,7 @@ var SKILL_INSTRUCTIONS = "Each editor's tools are documented by an agent skill (
197
197
  async function createToolBridge(options) {
198
198
  const log = _nullishCoalesce(options.log, () => ( ((message) => process.stderr.write(`[${options.name}] ${message}
199
199
  `))));
200
- const port = _nullishCoalesce(options.port, () => ( _chunkZAOOIJ6Icjs.TOOL_BRIDGE_DEFAULT_PORT));
200
+ const port = _nullishCoalesce(options.port, () => ( _chunkHDK3T2QScjs.TOOL_BRIDGE_DEFAULT_PORT));
201
201
  const retryMs = _nullishCoalesce(options.retryMs, () => ( 2e3));
202
202
  const timeoutMs = _nullishCoalesce(options.timeoutMs, () => ( 6e4));
203
203
  const extraOrigins = new Set(_nullishCoalesce(options.origins, () => ( [])));
@@ -211,7 +211,7 @@ async function createToolBridge(options) {
211
211
  let closed = false;
212
212
  let retry;
213
213
  const send = (editor, message) => editor.socket.send(JSON.stringify(message));
214
- const registry = new (0, _chunkZAOOIJ6Icjs.ToolRegistry)();
214
+ const registry = new (0, _chunkHDK3T2QScjs.ToolRegistry)();
215
215
  const listeners = /* @__PURE__ */ new Set();
216
216
  const toolsChanged = () => listeners.forEach((l) => l());
217
217
  const describeEditors = () => [...editors.values()].map((e) => `${e.id} (${e.name})`).join(", ");
@@ -319,13 +319,13 @@ async function createToolBridge(options) {
319
319
  return;
320
320
  }
321
321
  if (message.t === "hello") {
322
- if (message.v !== _chunkZAOOIJ6Icjs.TOOL_BRIDGE_PROTOCOL) {
322
+ if (message.v !== _chunkHDK3T2QScjs.TOOL_BRIDGE_PROTOCOL) {
323
323
  log(`refused an editor speaking protocol v${String(message.v)}`);
324
- return ws.close(1008, `This bridge speaks protocol v${_chunkZAOOIJ6Icjs.TOOL_BRIDGE_PROTOCOL}; update @pixerate/editor.`);
324
+ return ws.close(1008, `This bridge speaks protocol v${_chunkHDK3T2QScjs.TOOL_BRIDGE_PROTOCOL}; update @pixerate/editor.`);
325
325
  }
326
326
  editor = { id: `e${++editorCounter}`, name: String(message.name || "Editor"), ...message.kind ? { kind: message.kind } : {}, socket: ws, tools: Array.isArray(message.tools) ? message.tools : [], activeAt: Date.now(), activeSeq: ++activity };
327
327
  editors.set(editor.id, editor);
328
- ws.send(JSON.stringify({ t: "welcome", v: _chunkZAOOIJ6Icjs.TOOL_BRIDGE_PROTOCOL, id: editor.id }));
328
+ ws.send(JSON.stringify({ t: "welcome", v: _chunkHDK3T2QScjs.TOOL_BRIDGE_PROTOCOL, id: editor.id }));
329
329
  log(`editor ${editor.id} connected: ${editor.name} (${editor.tools.length} tools)`);
330
330
  toolsChanged();
331
331
  } else if (message.t === "tools" && editor) {
@@ -381,7 +381,7 @@ async function createToolBridge(options) {
381
381
  `)]);
382
382
  const skills = options.skills === false ? {} : _nullishCoalesce(options.skills, () => ( loadSkillFiles()));
383
383
  const hasSkills = Object.keys(skills).length > 0;
384
- const mcp = _chunkZAOOIJ6Icjs.createMcpServer.call(void 0, registry, {
384
+ const mcp = _chunkHDK3T2QScjs.createMcpServer.call(void 0, registry, {
385
385
  name: options.name,
386
386
  version: _nullishCoalesce(options.version, () => ( "0.1.0")),
387
387
  instructions: [options.instructions, BRIDGE_INSTRUCTIONS, hasSkills ? SKILL_INSTRUCTIONS : ""].filter(Boolean).join("\n\n"),
@@ -1,3 +1,7 @@
1
+ import {
2
+ isUnsafeJsonKey
3
+ } from "./chunk-HF5QZS7Z.js";
4
+
1
5
  // src/extensions/paragraph-styles/registry.ts
2
6
  var MAX_CHAIN = 32;
3
7
  var STYLE_ID = /^[A-Za-z][A-Za-z0-9_-]{0,63}$/;
@@ -154,7 +158,7 @@ function overlay(base, patch) {
154
158
  if (!patch) return base;
155
159
  const out = { ...base };
156
160
  Object.entries(patch).forEach(([key, value]) => {
157
- if (value !== void 0 && value !== null) out[key] = value;
161
+ if (value !== void 0 && value !== null && !isUnsafeJsonKey(key)) out[key] = value;
158
162
  });
159
163
  return out;
160
164
  }
@@ -8,7 +8,7 @@ var _chunkJG5VGCKPcjs = require('./chunk-JG5VGCKP.cjs');
8
8
 
9
9
 
10
10
 
11
- var _chunkCCKP4XANcjs = require('./chunk-CCKP4XAN.cjs');
11
+ var _chunk34RQAGWIcjs = require('./chunk-34RQAGWI.cjs');
12
12
 
13
13
  // src/serializers/plain-text.ts
14
14
  var _model = require('@tiptap/pm/model');
@@ -261,16 +261,16 @@ function resolvedBlockOperationsHtml(editor, view) {
261
261
  doc.descendants((node) => {
262
262
  if (found) return false;
263
263
  if (node.isTextblock) {
264
- if (_optionalChain([node, 'access', _3 => _3.attrs, 'optionalAccess', _4 => _4[_chunkCCKP4XANcjs.BLOCK_CHANGE_ATTRIBUTE], 'optionalAccess', _5 => _5.operation])) found = true;
264
+ if (_optionalChain([node, 'access', _3 => _3.attrs, 'optionalAccess', _4 => _4[_chunk34RQAGWIcjs.BLOCK_CHANGE_ATTRIBUTE], 'optionalAccess', _5 => _5.operation])) found = true;
265
265
  else node.forEach((child) => {
266
- if (child.marks.some((mark) => _optionalChain([mark, 'access', _6 => _6.attrs, 'optionalAccess', _7 => _7[_chunkCCKP4XANcjs.MOVE_ID_ATTRIBUTE]]))) found = true;
266
+ if (child.marks.some((mark) => _optionalChain([mark, 'access', _6 => _6.attrs, 'optionalAccess', _7 => _7[_chunk34RQAGWIcjs.MOVE_ID_ATTRIBUTE]]))) found = true;
267
267
  });
268
268
  return false;
269
269
  }
270
270
  return true;
271
271
  });
272
272
  if (!found) return null;
273
- const resolved = _chunkCCKP4XANcjs.resolveTrackedChanges.call(void 0, doc, view);
273
+ const resolved = _chunk34RQAGWIcjs.resolveTrackedChanges.call(void 0, doc, view);
274
274
  const container = document.createElement("div");
275
275
  container.appendChild(_model.DOMSerializer.fromSchema(doc.type.schema).serializeFragment(resolved.content));
276
276
  return container.innerHTML;
@@ -818,7 +818,7 @@ function getEditorMarkdown(editor, options = {}) {
818
818
  if (typeof _optionalChain([markdown, 'optionalAccess', _50 => _50.getMarkdown]) === "function") {
819
819
  const doc = _optionalChain([editor, 'access', _51 => _51.state, 'optionalAccess', _52 => _52.doc]);
820
820
  if (doc && typeof _optionalChain([markdown, 'access', _53 => _53.serializer, 'optionalAccess', _54 => _54.serialize]) === "function") {
821
- const resolved = _chunkCCKP4XANcjs.resolveTrackedChanges.call(void 0, doc, _nullishCoalesce(options.trackedChanges, () => ( "accepted")));
821
+ const resolved = _chunk34RQAGWIcjs.resolveTrackedChanges.call(void 0, doc, _nullishCoalesce(options.trackedChanges, () => ( "accepted")));
822
822
  if (resolved !== doc) return markdown.serializer.serialize(resolved);
823
823
  }
824
824
  return markdown.getMarkdown();
@@ -1,5 +1,8 @@
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;
2
2
 
3
+ var _chunk2BSBFBOAcjs = require('./chunk-2BSBFBOA.cjs');
4
+
5
+
3
6
  var _chunkWOFXZ3XUcjs = require('./chunk-WOFXZ3XU.cjs');
4
7
 
5
8
  // src/tools/skills.ts
@@ -593,7 +596,7 @@ var ToolRegistry = (_class2 = class {
593
596
  return errorResult({ code: "unknown_tool", message: unknownToolMessage(name, match.candidates), tool: name });
594
597
  }
595
598
  name = found.name;
596
- const input = _nullishCoalesce(args, () => ( {}));
599
+ const input = _chunk2BSBFBOAcjs.stripPrototypeKeys.call(void 0, _nullishCoalesce(args, () => ( {})));
597
600
  if (this.options.validateArguments) {
598
601
  const details = _chunkWOFXZ3XUcjs.validateJsonSchema.call(void 0, input, found.tool.inputSchema);
599
602
  if (details.length > 0) {
@@ -0,0 +1,46 @@
1
+ // src/tools/safe-json.ts
2
+ var UNSAFE_JSON_KEYS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
3
+ var isUnsafeJsonKey = (key) => UNSAFE_JSON_KEYS.has(key);
4
+ var isPlainObject = (value) => {
5
+ if (value === null || typeof value !== "object") return false;
6
+ const proto = Object.getPrototypeOf(value);
7
+ return proto === Object.prototype || proto === null;
8
+ };
9
+ function hasUnsafeKeys(value, seen) {
10
+ if (value === null || typeof value !== "object" || seen.has(value)) return false;
11
+ seen.add(value);
12
+ if (Array.isArray(value)) return value.some((item) => hasUnsafeKeys(item, seen));
13
+ if (!isPlainObject(value)) return false;
14
+ for (const key of Object.keys(value)) {
15
+ if (isUnsafeJsonKey(key) || hasUnsafeKeys(value[key], seen)) return true;
16
+ }
17
+ return false;
18
+ }
19
+ function strip(value, seen) {
20
+ if (value === null || typeof value !== "object") return value;
21
+ if (seen.has(value)) return seen.get(value);
22
+ if (Array.isArray(value)) {
23
+ const out2 = [];
24
+ seen.set(value, out2);
25
+ for (const item of value) out2.push(strip(item, seen));
26
+ return out2;
27
+ }
28
+ if (!isPlainObject(value)) return value;
29
+ const out = {};
30
+ seen.set(value, out);
31
+ for (const key of Object.keys(value)) {
32
+ if (isUnsafeJsonKey(key)) continue;
33
+ out[key] = strip(value[key], seen);
34
+ }
35
+ return out;
36
+ }
37
+ function stripPrototypeKeys(value) {
38
+ if (!hasUnsafeKeys(value, /* @__PURE__ */ new Set())) return value;
39
+ return strip(value, /* @__PURE__ */ new Map());
40
+ }
41
+
42
+ export {
43
+ UNSAFE_JSON_KEYS,
44
+ isUnsafeJsonKey,
45
+ stripPrototypeKeys
46
+ };
@@ -7,7 +7,10 @@
7
7
 
8
8
 
9
9
 
10
- var _chunkCCKP4XANcjs = require('./chunk-CCKP4XAN.cjs');
10
+ var _chunk34RQAGWIcjs = require('./chunk-34RQAGWI.cjs');
11
+
12
+
13
+ var _chunk2BSBFBOAcjs = require('./chunk-2BSBFBOA.cjs');
11
14
 
12
15
  // src/compare/diff.ts
13
16
  var EQUAL = 0;
@@ -257,9 +260,9 @@ var _core = require('@tiptap/core');
257
260
 
258
261
  var _model = require('@tiptap/pm/model');
259
262
  var REVIEW_MARK_NAMES = /* @__PURE__ */ new Set([
260
- _chunkCCKP4XANcjs.INSERTION_MARK_NAME,
261
- _chunkCCKP4XANcjs.DELETION_MARK_NAME,
262
- _chunkCCKP4XANcjs.FORMAT_CHANGE_MARK_NAME,
263
+ _chunk34RQAGWIcjs.INSERTION_MARK_NAME,
264
+ _chunk34RQAGWIcjs.DELETION_MARK_NAME,
265
+ _chunk34RQAGWIcjs.FORMAT_CHANGE_MARK_NAME,
263
266
  "comment",
264
267
  "bookmark"
265
268
  ]);
@@ -286,7 +289,7 @@ function toNode(source, schema) {
286
289
  const node = source;
287
290
  return node.type.schema === schema ? node : schema.nodeFromJSON(node.toJSON());
288
291
  }
289
- return schema.nodeFromJSON(source);
292
+ return schema.nodeFromJSON(_chunk2BSBFBOAcjs.stripPrototypeKeys.call(void 0, source));
290
293
  }
291
294
  function newAttributes(ctx) {
292
295
  return {
@@ -303,7 +306,7 @@ function lazyAttributes(ctx) {
303
306
  }
304
307
  function stripBlockChange(attrs) {
305
308
  const copy = { ...attrs };
306
- delete copy[_chunkCCKP4XANcjs.BLOCK_CHANGE_ATTRIBUTE];
309
+ delete copy[_chunk34RQAGWIcjs.BLOCK_CHANGE_ATTRIBUTE];
307
310
  return copy;
308
311
  }
309
312
  function wrapperOf(node) {
@@ -316,7 +319,7 @@ function filteredAttributes(attrs, ctx) {
316
319
  return stableStringify(
317
320
  Object.fromEntries(
318
321
  Object.entries(_nullishCoalesce(attrs, () => ( {}))).filter(
319
- ([key]) => key !== _chunkCCKP4XANcjs.BLOCK_CHANGE_ATTRIBUTE && !ctx.ignoredAttributes.has(key)
322
+ ([key]) => key !== _chunk34RQAGWIcjs.BLOCK_CHANGE_ATTRIBUTE && !ctx.ignoredAttributes.has(key)
320
323
  )
321
324
  )
322
325
  );
@@ -327,7 +330,7 @@ function sameBlock(a, b, ctx) {
327
330
  if (a.wrappers.length !== b.wrappers.length) return false;
328
331
  return a.wrappers.every((w, i) => w.type === b.wrappers[i].type);
329
332
  }
330
- var hasBlockChange = (node) => !!node.type.spec.attrs && _chunkCCKP4XANcjs.BLOCK_CHANGE_ATTRIBUTE in node.type.spec.attrs;
333
+ var hasBlockChange = (node) => !!node.type.spec.attrs && _chunk34RQAGWIcjs.BLOCK_CHANGE_ATTRIBUTE in node.type.spec.attrs;
331
334
  var label = (node) => node.type.name;
332
335
  function normalize(text, ctx) {
333
336
  let result = ctx.ignoreWhitespace ? text.replace(/\s+/g, " ") : text;
@@ -380,12 +383,12 @@ function wholeBlock(node, operation, wrappers, attrs, ctx) {
380
383
  previous: snapshot(node, wrappers),
381
384
  operation
382
385
  };
383
- return [node.type.create({ ...node.attrs, [_chunkCCKP4XANcjs.BLOCK_CHANGE_ATTRIBUTE]: record }, node.content, node.marks)];
386
+ return [node.type.create({ ...node.attrs, [_chunk34RQAGWIcjs.BLOCK_CHANGE_ATTRIBUTE]: record }, node.content, node.marks)];
384
387
  }
385
388
  const markType = operation === "insert" ? ctx.insertion : ctx.deletion;
386
389
  if (markType && node.type.allowsMarkType(markType) && node.content.size > 0) {
387
390
  ctx.notes.add(
388
- `${verb} ${label(node)} blocks have no "${_chunkCCKP4XANcjs.BLOCK_CHANGE_ATTRIBUTE}" attribute: only their text is tracked, so an empty block remains when the change is ${operation === "insert" ? "rejected" : "accepted"}.`
391
+ `${verb} ${label(node)} blocks have no "${_chunk34RQAGWIcjs.BLOCK_CHANGE_ATTRIBUTE}" attribute: only their text is tracked, so an empty block remains when the change is ${operation === "insert" ? "rejected" : "accepted"}.`
389
392
  );
390
393
  return [node.type.create(node.attrs, markInline(node.content, markType.create(attrs())), node.marks)];
391
394
  }
@@ -484,7 +487,7 @@ function formattingOf(marks, ctx) {
484
487
  }
485
488
  function withoutReviewMarks(marks) {
486
489
  return marks.filter(
487
- (mark) => mark.type.name !== _chunkCCKP4XANcjs.INSERTION_MARK_NAME && mark.type.name !== _chunkCCKP4XANcjs.DELETION_MARK_NAME && mark.type.name !== _chunkCCKP4XANcjs.FORMAT_CHANGE_MARK_NAME
490
+ (mark) => mark.type.name !== _chunk34RQAGWIcjs.INSERTION_MARK_NAME && mark.type.name !== _chunk34RQAGWIcjs.DELETION_MARK_NAME && mark.type.name !== _chunk34RQAGWIcjs.FORMAT_CHANGE_MARK_NAME
488
491
  );
489
492
  }
490
493
  function mergeInline(original, revised, parentType, ctx) {
@@ -580,12 +583,12 @@ function mergeTextblocks(original, revised, oPath, rPath, ctx) {
580
583
  if (hasBlockChange(revised)) {
581
584
  const onlyWrappers = ctx.wrapperChange && sameBlock(previous, { ...snapshot(revised, rPath), wrappers: previous.wrappers }, ctx);
582
585
  const base = onlyWrappers ? ctx.wrapperChange() : newAttributes(ctx);
583
- attrs = { ...attrs, [_chunkCCKP4XANcjs.BLOCK_CHANGE_ATTRIBUTE]: { ...base, previous } };
586
+ attrs = { ...attrs, [_chunk34RQAGWIcjs.BLOCK_CHANGE_ATTRIBUTE]: { ...base, previous } };
584
587
  } else {
585
588
  ctx.notes.add(`Block changes to ${label(revised)} blocks cannot be tracked.`);
586
589
  }
587
- } else if (_chunkCCKP4XANcjs.BLOCK_CHANGE_ATTRIBUTE in attrs) {
588
- attrs[_chunkCCKP4XANcjs.BLOCK_CHANGE_ATTRIBUTE] = null;
590
+ } else if (_chunk34RQAGWIcjs.BLOCK_CHANGE_ATTRIBUTE in attrs) {
591
+ attrs[_chunk34RQAGWIcjs.BLOCK_CHANGE_ATTRIBUTE] = null;
589
592
  }
590
593
  const type = revised.type;
591
594
  const inlineTracking = !!ctx.insertion && !!ctx.deletion && type.allowsMarkType(ctx.insertion) && type.allowsMarkType(ctx.deletion);
@@ -679,7 +682,7 @@ function detectMovedBlocks(children, ctx) {
679
682
  const keyOf = (node) => `${node.type.name}\0${filteredAttributes(node.attrs, ctx)}\0${stableStringify(node.content.toJSON())}`;
680
683
  const candidates = /* @__PURE__ */ new Map();
681
684
  children.forEach((node, index) => {
682
- const operation = _optionalChain([node, 'access', _2 => _2.attrs, 'optionalAccess', _3 => _3[_chunkCCKP4XANcjs.BLOCK_CHANGE_ATTRIBUTE], 'optionalAccess', _4 => _4.operation]);
685
+ const operation = _optionalChain([node, 'access', _2 => _2.attrs, 'optionalAccess', _3 => _3[_chunk34RQAGWIcjs.BLOCK_CHANGE_ATTRIBUTE], 'optionalAccess', _4 => _4.operation]);
683
686
  if (!operation || !node.isTextblock || !node.textContent.trim()) return;
684
687
  if (!node.type.allowsMarkType(ctx.insertion) || !node.type.allowsMarkType(ctx.deletion)) return;
685
688
  const key = keyOf(node);
@@ -691,11 +694,11 @@ function detectMovedBlocks(children, ctx) {
691
694
  candidates.forEach(({ del, ins }) => {
692
695
  if (del.length !== 1 || ins.length !== 1) return;
693
696
  const attrs = newAttributes(ctx);
694
- const moved = { ...attrs, [_chunkCCKP4XANcjs.MOVE_ID_ATTRIBUTE]: attrs.changeId };
697
+ const moved = { ...attrs, [_chunk34RQAGWIcjs.MOVE_ID_ATTRIBUTE]: attrs.changeId };
695
698
  const relink = (index, markType) => {
696
699
  const node = out[index];
697
700
  out[index] = node.type.create(
698
- { ...node.attrs, [_chunkCCKP4XANcjs.BLOCK_CHANGE_ATTRIBUTE]: null },
701
+ { ...node.attrs, [_chunk34RQAGWIcjs.BLOCK_CHANGE_ATTRIBUTE]: null },
699
702
  markInline(node.content, markType.create(moved)),
700
703
  node.marks
701
704
  );
@@ -714,7 +717,7 @@ function summarize(doc, notes) {
714
717
  moves: 0,
715
718
  notHonoured: [...notes]
716
719
  };
717
- _chunkCCKP4XANcjs.getTrackedChanges.call(void 0, doc).forEach((change) => {
720
+ _chunk34RQAGWIcjs.getTrackedChanges.call(void 0, doc).forEach((change) => {
718
721
  if (change.type === "move") summary.moves++;
719
722
  else if (change.type === "insertion" || _optionalChain([change, 'access', _5 => _5.block, 'optionalAccess', _6 => _6.operation]) === "insert") summary.insertions++;
720
723
  else if (change.type === "deletion" || _optionalChain([change, 'access', _7 => _7.block, 'optionalAccess', _8 => _8.operation]) === "delete") summary.deletions++;
@@ -730,7 +733,7 @@ function compareDocuments(original, revised, options = {}) {
730
733
  schema,
731
734
  author: _nullishCoalesce(options.author, () => ( { id: "compare", name: "Compare" })),
732
735
  createdAt: toTime(options.date),
733
- generateId: _nullishCoalesce(options.generateId, () => ( (() => _chunkCCKP4XANcjs.createReviewId.call(void 0, "change")))),
736
+ generateId: _nullishCoalesce(options.generateId, () => ( (() => _chunk34RQAGWIcjs.createReviewId.call(void 0, "change")))),
734
737
  granularity: _nullishCoalesce(options.granularity, () => ( "word")),
735
738
  ignoreCase: !!options.ignoreCase,
736
739
  ignoreWhitespace: !!options.ignoreWhitespace,
@@ -738,9 +741,9 @@ function compareDocuments(original, revised, options = {}) {
738
741
  maxCharDiff: _nullishCoalesce(options.maxCharDiff, () => ( 2e3)),
739
742
  ignoredMarks: new Set(_nullishCoalesce(options.ignoredMarks, () => ( []))),
740
743
  ignoredAttributes: new Set(_nullishCoalesce(options.ignoredBlockAttributes, () => ( ["id"]))),
741
- insertion: schema.marks[_chunkCCKP4XANcjs.INSERTION_MARK_NAME],
742
- deletion: schema.marks[_chunkCCKP4XANcjs.DELETION_MARK_NAME],
743
- format: schema.marks[_chunkCCKP4XANcjs.FORMAT_CHANGE_MARK_NAME],
744
+ insertion: schema.marks[_chunk34RQAGWIcjs.INSERTION_MARK_NAME],
745
+ deletion: schema.marks[_chunk34RQAGWIcjs.DELETION_MARK_NAME],
746
+ format: schema.marks[_chunk34RQAGWIcjs.FORMAT_CHANGE_MARK_NAME],
744
747
  notes: /* @__PURE__ */ new Set(),
745
748
  keys: /* @__PURE__ */ new Map(),
746
749
  wrapperChange: null
@@ -753,9 +756,9 @@ function compareDocuments(original, revised, options = {}) {
753
756
  }
754
757
  const prepare = (source) => {
755
758
  const doc2 = toNode(source, schema);
756
- if (_chunkCCKP4XANcjs.getTrackedChanges.call(void 0, doc2).length === 0) return doc2;
759
+ if (_chunk34RQAGWIcjs.getTrackedChanges.call(void 0, doc2).length === 0) return doc2;
757
760
  ctx.notes.add("Tracked changes already in the documents were accepted before comparing.");
758
- return _chunkCCKP4XANcjs.resolveTrackedChanges.call(void 0, doc2, "accepted");
761
+ return _chunk34RQAGWIcjs.resolveTrackedChanges.call(void 0, doc2, "accepted");
759
762
  };
760
763
  const a = prepare(original);
761
764
  const b = prepare(revised);
@@ -15,11 +15,12 @@ var _chunk6HMEHNWWcjs = require('./chunk-6HMEHNWW.cjs');
15
15
  var _chunkUR37VCIRcjs = require('./chunk-UR37VCIR.cjs');
16
16
 
17
17
 
18
- var _chunk6NXVDJDRcjs = require('./chunk-6NXVDJDR.cjs');
18
+ var _chunkG43MNQ4Ccjs = require('./chunk-G43MNQ4C.cjs');
19
19
 
20
20
 
21
21
 
22
- var _chunkCCKP4XANcjs = require('./chunk-CCKP4XAN.cjs');
22
+
23
+ var _chunk34RQAGWIcjs = require('./chunk-34RQAGWI.cjs');
23
24
 
24
25
  // src/extensions/table/nesting.ts
25
26
  var _model = require('@tiptap/pm/model');
@@ -1550,7 +1551,7 @@ var Chart = _core.Node.create({
1550
1551
  const svg = staticChartSvg(node, this.options);
1551
1552
  return [
1552
1553
  "div",
1553
- _core.mergeAttributes.call(void 0, this.options.HTMLAttributes, HTMLAttributes, {
1554
+ _chunk34RQAGWIcjs.safeMergeAttributes.call(void 0, this.options.HTMLAttributes, HTMLAttributes, {
1554
1555
  "data-type": "chart",
1555
1556
  class: "pixerate-chart"
1556
1557
  }),
@@ -1717,7 +1718,7 @@ var Sparkline = _core.Node.create({
1717
1718
  });
1718
1719
  return [
1719
1720
  "span",
1720
- _core.mergeAttributes.call(void 0, this.options.HTMLAttributes, HTMLAttributes, {
1721
+ _chunk34RQAGWIcjs.safeMergeAttributes.call(void 0, this.options.HTMLAttributes, HTMLAttributes, {
1721
1722
  "data-type": "sparkline",
1722
1723
  class: "pixerate-sparkline"
1723
1724
  }),
@@ -1836,7 +1837,7 @@ function getTableActionState(editor, action, params = {}) {
1836
1837
  switch (action) {
1837
1838
  case "mergeCells":
1838
1839
  case "splitCell": {
1839
- if (_chunkCCKP4XANcjs.isTrackChangesEnabled.call(void 0, editor)) {
1840
+ if (_chunk34RQAGWIcjs.isTrackChangesEnabled.call(void 0, editor)) {
1840
1841
  return `${action === "mergeCells" ? "Merging" : "Splitting"} cells cannot be tracked: turn off Track Changes first.`;
1841
1842
  }
1842
1843
  if (action === "mergeCells") {
@@ -2154,9 +2155,9 @@ function getAgentCarets(state) {
2154
2155
  return _nullishCoalesce(_optionalChain([agentCaretPluginKey, 'access', _77 => _77.getState, 'call', _78 => _78(state), 'optionalAccess', _79 => _79.carets]), () => ( []));
2155
2156
  }
2156
2157
  function replaceWithTextTransaction(state, from, to, text) {
2157
- return /[\r\n]/.test(text) ? state.tr.replace(from, to, _chunk6NXVDJDRcjs.plainTextToSlice.call(void 0, text, state.schema)) : text ? state.tr.insertText(text, from, to) : state.tr.delete(from, to);
2158
+ return /[\r\n]/.test(text) ? state.tr.replace(from, to, _chunkG43MNQ4Ccjs.plainTextToSlice.call(void 0, text, state.schema)) : text ? state.tr.insertText(text, from, to) : state.tr.delete(from, to);
2158
2159
  }
2159
- var NO_HISTORY = (tr) => tr.setMeta("addToHistory", false).setMeta(_chunkCCKP4XANcjs.TRACK_CHANGES_SKIP_META, true);
2160
+ var NO_HISTORY = (tr) => tr.setMeta("addToHistory", false).setMeta(_chunk34RQAGWIcjs.TRACK_CHANGES_SKIP_META, true);
2160
2161
  var cannotAnimate = () => typeof document === "undefined" || document.hidden === true;
2161
2162
  async function typeAgentText(editor, options) {
2162
2163
  const { from, to, text, caret, signal } = options;