superdoc 0.34.4 → 0.34.5

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 (31) hide show
  1. package/dist/chunks/{PdfViewer-CcDvbfeP.cjs → PdfViewer-DRQmW5MW.cjs} +1 -1
  2. package/dist/chunks/{PdfViewer-CL_-YyBC.es.js → PdfViewer-DTAOrhGM.es.js} +1 -1
  3. package/dist/chunks/{index-DPjn4rpi-Bs9-iTbY.cjs → index-BO0dc2dg-BiqxnA1k.cjs} +1 -1
  4. package/dist/chunks/{index-DPjn4rpi-BwmVppCt.es.js → index-BO0dc2dg-DpvJHkle.es.js} +1 -1
  5. package/dist/chunks/{index-Cp_Yy4vP.cjs → index-C_RM2IcG.cjs} +3 -3
  6. package/dist/chunks/{index-oLU8CBCH.es.js → index-wvwkg6PD.es.js} +3 -3
  7. package/dist/chunks/{super-editor.es-C350__qM.es.js → super-editor.es-CfMROBHl.es.js} +52 -16
  8. package/dist/chunks/{super-editor.es-C2FJLfJa.cjs → super-editor.es-VtmcJzKs.cjs} +52 -16
  9. package/dist/super-editor/ai-writer.es.js +2 -2
  10. package/dist/super-editor/chunks/{converter-KW3z-Mzc.js → converter-PA_XpTWF.js} +20 -6
  11. package/dist/super-editor/chunks/{docx-zipper-CYtxqNuc.js → docx-zipper-gaQWcuwh.js} +1 -1
  12. package/dist/super-editor/chunks/{editor-CTHJwQNA.js → editor-CAqYW4R2.js} +34 -12
  13. package/dist/super-editor/chunks/{index-DPjn4rpi.js → index-BO0dc2dg.js} +1 -1
  14. package/dist/super-editor/chunks/{toolbar-BUz0UuKQ.js → toolbar-BgNvrbei.js} +2 -2
  15. package/dist/super-editor/converter.es.js +1 -1
  16. package/dist/super-editor/docx-zipper.es.js +2 -2
  17. package/dist/super-editor/editor.es.js +3 -3
  18. package/dist/super-editor/file-zipper.es.js +1 -1
  19. package/dist/super-editor/super-editor/src/core/super-converter/v3/handlers/w/del/del-translator.d.ts.map +1 -1
  20. package/dist/super-editor/super-editor/src/core/super-converter/v3/handlers/w/ins/ins-translator.d.ts.map +1 -1
  21. package/dist/super-editor/super-editor/src/extensions/structured-content/structured-content-commands.d.ts +5 -0
  22. package/dist/super-editor/super-editor/src/extensions/structured-content/structured-content-commands.d.ts.map +1 -1
  23. package/dist/super-editor/super-editor.es.js +6 -6
  24. package/dist/super-editor/toolbar.es.js +2 -2
  25. package/dist/super-editor.cjs +1 -1
  26. package/dist/super-editor.es.js +1 -1
  27. package/dist/superdoc.cjs +2 -2
  28. package/dist/superdoc.es.js +2 -2
  29. package/dist/superdoc.umd.js +54 -18
  30. package/dist/superdoc.umd.js.map +1 -1
  31. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { J as JSZip } from "./chunks/docx-zipper-CYtxqNuc.js";
1
+ import { J as JSZip } from "./chunks/docx-zipper-gaQWcuwh.js";
2
2
  async function createZip(blobs, fileNames) {
3
3
  const zip = new JSZip();
4
4
  blobs.forEach((blob, index) => {
@@ -1 +1 @@
1
- {"version":3,"file":"del-translator.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/core/super-converter/v3/handlers/w/del/del-translator.js"],"names":[],"mappings":"AAkFA,yDAAyD;AACzD,qBADW,OAAO,aAAa,EAAE,oBAAoB,CAQnD;AAEF;;;GAGG;AACH,yBAFU,OAAO,aAAa,EAAE,cAAc,CAEQ"}
1
+ {"version":3,"file":"del-translator.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/core/super-converter/v3/handlers/w/del/del-translator.js"],"names":[],"mappings":"AAyFA,yDAAyD;AACzD,qBADW,OAAO,aAAa,EAAE,oBAAoB,CAQnD;AAEF;;;GAGG;AACH,yBAFU,OAAO,aAAa,EAAE,cAAc,CAEQ"}
@@ -1 +1 @@
1
- {"version":3,"file":"ins-translator.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/core/super-converter/v3/handlers/w/ins/ins-translator.js"],"names":[],"mappings":"AAgFA,yDAAyD;AACzD,qBADW,OAAO,aAAa,EAAE,oBAAoB,CAQnD;AAEF;;;GAGG;AACH,yBAFU,OAAO,aAAa,EAAE,cAAc,CAEQ"}
1
+ {"version":3,"file":"ins-translator.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/core/super-converter/v3/handlers/w/ins/ins-translator.js"],"names":[],"mappings":"AAsFA,yDAAyD;AACzD,qBADW,OAAO,aAAa,EAAE,oBAAoB,CAQnD;AAEF;;;GAGG;AACH,yBAFU,OAAO,aAAa,EAAE,cAAc,CAEQ"}
@@ -18,6 +18,7 @@
18
18
  * @property {string} [html] - Replace content with HTML (only for structured content block)
19
19
  * @property {Object} [json] - Replace content with ProseMirror JSON (overrides html)
20
20
  * @property {Object} [attrs] - Update attributes only (preserves content)
21
+ * @property {boolean} [keepTextNodeStyles] - When true, preserves marks from the first text node (only applies with text option)
21
22
  */
22
23
  /**
23
24
  * @typedef {Object} StructuredContentTableAppendRowsOptions
@@ -76,6 +77,10 @@ export type StructuredContentUpdate = {
76
77
  * - Update attributes only (preserves content)
77
78
  */
78
79
  attrs?: any;
80
+ /**
81
+ * - When true, preserves marks from the first text node (only applies with text option)
82
+ */
83
+ keepTextNodeStyles?: boolean;
79
84
  };
80
85
  export type StructuredContentTableAppendRowsOptions = {
81
86
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"structured-content-commands.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/structured-content/structured-content-commands.js"],"names":[],"mappings":"AAYA;;;;;;GAMG;AAEH;;;;;;GAMG;AAEH;;;;;;GAMG;AAEH;;;;;;GAMG;AAEH,kDA2cG;;;;;WAzeW,MAAM;;;;;;;;YAGjB;QAA0B,KAAK,GAApB,MAAM;KACnB;;;;;;WAIa,MAAM;;;;;;;;YAGjB;QAA0B,KAAK,GAApB,MAAM;KACnB;;;;;;WAIa,MAAM;;;;WACN,MAAM;;;;;;;;;;;;;;QAON,MAAM;;;;iBACN,MAAM;;;;UACN,KAAK,CAAC,MAAM,EAAE,CAAC,GAAC,KAAK,CAAC,MAAM,CAAC;;;;mBAC7B,OAAO;;0BAxCK,aAAa"}
1
+ {"version":3,"file":"structured-content-commands.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/structured-content/structured-content-commands.js"],"names":[],"mappings":"AAYA;;;;;;GAMG;AAEH;;;;;;GAMG;AAEH;;;;;;;GAOG;AAEH;;;;;;GAMG;AAEH,kDAgfG;;;;;WA/gBW,MAAM;;;;;;;;YAGjB;QAA0B,KAAK,GAApB,MAAM;KACnB;;;;;;WAIa,MAAM;;;;;;;;YAGjB;QAA0B,KAAK,GAApB,MAAM;KACnB;;;;;;WAIa,MAAM;;;;WACN,MAAM;;;;;;;;;;;;yBAGN,OAAO;;;;;;QAKP,MAAM;;;;iBACN,MAAM;;;;UACN,KAAK,CAAC,MAAM,EAAE,CAAC,GAAC,KAAK,CAAC,MAAM,CAAC;;;;mBAC7B,OAAO;;0BAzCK,aAAa"}
@@ -9,14 +9,14 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
9
9
  var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
10
10
  var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
11
11
  var _SuperToolbar_instances, initToolbarGroups_fn, _interceptedCommands, makeToolbarItems_fn, initDefaultFonts_fn, updateHighlightColors_fn, deactivateAll_fn, updateToolbarHistory_fn, enrichTrackedChanges_fn, runCommandWithArgumentOnly_fn;
12
- import { aA as getDefaultExportFromCjs, V as v4, T as TextSelection$1, v as getMarkRange, aD as vClickOutside, aE as getActiveFormatting, av as isInTable, aF as readFromClipboard, aG as handleClipboardPaste, aH as getFileObject, aI as runPropertyTranslators, aJ as translator, aK as translator$1, aL as translator$2, aM as translator$3, aN as translator$4, aO as translator$5, aP as translator$6, aQ as translator$7, aR as translator$8, aS as translator$9, aT as translator$a, aU as translator$b, aV as translator$c, aW as translator$d, aX as translator$e, aY as commentRangeEndTranslator, aZ as commentRangeStartTranslator, a_ as translator$f, a$ as translator$g, b0 as translator$h, b1 as translator$i, b2 as translator$j, b3 as translator$k, b4 as translator$l, b5 as translator$m, b6 as translator$n, b7 as translator$o, b8 as translator$p, b9 as translator$q, ba as translator$r, bb as translator$s, bc as translator$t, bd as translator$u, be as translator$v, bf as translator$w, bg as translator$x, bh as translator$y, bi as translator$z, bj as translator$A, bk as translator$B, bl as translator$C, bm as translator$D, bn as translator$E, bo as translator$F, bp as translator$G, bq as translator$H, br as translator$I, bs as translator$J, bt as translator$K, bu as translator$L, bv as translator$M, bw as translator$N, bx as translator$O, by as translator$P, bz as translator$Q, bA as translator$R, bB as translator$S, bC as translator$T, bD as translator$U, bE as translator$V, bF as translator$W, bG as translator$X, bH as translator$Y, bI as translator$Z, bJ as translator$_, bK as translator$$, bL as translator$10, bM as translator$11, bN as translator$12, bO as translator$13, bP as translator$14, bQ as translator$15, bR as translator$16, bS as translator$17, bT as translator$18, bU as translator$19, bV as translator$1a, bW as translator$1b, bX as translator$1c, bY as translator$1d, bZ as translator$1e, b_ as translator$1f, b$ as translator$1g, c0 as translator$1h, P as PluginKey, a as Plugin } from "./chunks/converter-KW3z-Mzc.js";
13
- import { a5, i, a2 } from "./chunks/converter-KW3z-Mzc.js";
14
- import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, c as collectTargetListItemPositions, d as getFileOpener, e as checkAndProcessImage, r as replaceSelectionWithImagePlaceholder, f as uploadAndInsertImage, h as collectTrackedChanges, i as isTrackedChangeActionAllowed, y as yUndoPluginKey, j as undoDepth, k as redoDepth, l as collectTrackedChangesForContext, s as shouldBypassContextMenu, S as SlashMenuPluginKey, m as isHeadless, E as Editor, n as getStarterExtensions, P as Placeholder, o as getRichTextExtensions, D as DecorationSet, p as Decoration, M as Mark, q as Extension, A as Attribute, N as Node } from "./chunks/editor-CTHJwQNA.js";
15
- import { w, C, x, T, t, z, v } from "./chunks/editor-CTHJwQNA.js";
12
+ import { aA as getDefaultExportFromCjs, V as v4, T as TextSelection$1, v as getMarkRange, aD as vClickOutside, aE as getActiveFormatting, av as isInTable, aF as readFromClipboard, aG as handleClipboardPaste, aH as getFileObject, aI as runPropertyTranslators, aJ as translator, aK as translator$1, aL as translator$2, aM as translator$3, aN as translator$4, aO as translator$5, aP as translator$6, aQ as translator$7, aR as translator$8, aS as translator$9, aT as translator$a, aU as translator$b, aV as translator$c, aW as translator$d, aX as translator$e, aY as commentRangeEndTranslator, aZ as commentRangeStartTranslator, a_ as translator$f, a$ as translator$g, b0 as translator$h, b1 as translator$i, b2 as translator$j, b3 as translator$k, b4 as translator$l, b5 as translator$m, b6 as translator$n, b7 as translator$o, b8 as translator$p, b9 as translator$q, ba as translator$r, bb as translator$s, bc as translator$t, bd as translator$u, be as translator$v, bf as translator$w, bg as translator$x, bh as translator$y, bi as translator$z, bj as translator$A, bk as translator$B, bl as translator$C, bm as translator$D, bn as translator$E, bo as translator$F, bp as translator$G, bq as translator$H, br as translator$I, bs as translator$J, bt as translator$K, bu as translator$L, bv as translator$M, bw as translator$N, bx as translator$O, by as translator$P, bz as translator$Q, bA as translator$R, bB as translator$S, bC as translator$T, bD as translator$U, bE as translator$V, bF as translator$W, bG as translator$X, bH as translator$Y, bI as translator$Z, bJ as translator$_, bK as translator$$, bL as translator$10, bM as translator$11, bN as translator$12, bO as translator$13, bP as translator$14, bQ as translator$15, bR as translator$16, bS as translator$17, bT as translator$18, bU as translator$19, bV as translator$1a, bW as translator$1b, bX as translator$1c, bY as translator$1d, bZ as translator$1e, b_ as translator$1f, b$ as translator$1g, c0 as translator$1h, P as PluginKey, a as Plugin } from "./chunks/converter-PA_XpTWF.js";
13
+ import { a5, i, a2 } from "./chunks/converter-PA_XpTWF.js";
14
+ import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, c as collectTargetListItemPositions, d as getFileOpener, e as checkAndProcessImage, r as replaceSelectionWithImagePlaceholder, f as uploadAndInsertImage, h as collectTrackedChanges, i as isTrackedChangeActionAllowed, y as yUndoPluginKey, j as undoDepth, k as redoDepth, l as collectTrackedChangesForContext, s as shouldBypassContextMenu, S as SlashMenuPluginKey, m as isHeadless, E as Editor, n as getStarterExtensions, P as Placeholder, o as getRichTextExtensions, D as DecorationSet, p as Decoration, M as Mark, q as Extension, A as Attribute, N as Node } from "./chunks/editor-CAqYW4R2.js";
15
+ import { w, C, x, T, t, z, v } from "./chunks/editor-CAqYW4R2.js";
16
16
  import { ref, onMounted, createElementBlock, openBlock, normalizeClass, unref, Fragment, renderList, createElementVNode, withModifiers, toDisplayString, createCommentVNode, normalizeStyle, computed, watch, withDirectives, withKeys, vModelText, createTextVNode, createVNode, h, createApp, markRaw, nextTick, onBeforeUnmount, defineComponent, reactive, onUnmounted, renderSlot, shallowRef, createBlock, withCtx, resolveDynamicComponent, normalizeProps, guardReactiveProps } from "vue";
17
- import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, p as plusIconSvg, a as trashIconSvg, b as borderNoneIconSvg, c as arrowsToDotIconSvg, d as arrowsLeftRightIconSvg, w as wrenchIconSvg, m as magicWandIcon, e as checkIconSvg$1, x as xMarkIconSvg, l as linkIconSvg, f as tableIconSvg, g as scissorsIconSvg, h as copyIconSvg, i as pasteIconSvg, u as useMessage, N as NSkeleton } from "./chunks/toolbar-BUz0UuKQ.js";
17
+ import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, p as plusIconSvg, a as trashIconSvg, b as borderNoneIconSvg, c as arrowsToDotIconSvg, d as arrowsLeftRightIconSvg, w as wrenchIconSvg, m as magicWandIcon, e as checkIconSvg$1, x as xMarkIconSvg, l as linkIconSvg, f as tableIconSvg, g as scissorsIconSvg, h as copyIconSvg, i as pasteIconSvg, u as useMessage, N as NSkeleton } from "./chunks/toolbar-BgNvrbei.js";
18
18
  import AIWriter from "./ai-writer.es.js";
19
- import { D } from "./chunks/docx-zipper-CYtxqNuc.js";
19
+ import { D } from "./chunks/docx-zipper-gaQWcuwh.js";
20
20
  import { createZip } from "./file-zipper.es.js";
21
21
  var eventemitter3 = { exports: {} };
22
22
  var hasRequiredEventemitter3;
@@ -1,6 +1,6 @@
1
1
  import "vue";
2
- import { T } from "./chunks/toolbar-BUz0UuKQ.js";
3
- import "./chunks/editor-CTHJwQNA.js";
2
+ import { T } from "./chunks/toolbar-BgNvrbei.js";
3
+ import "./chunks/editor-CAqYW4R2.js";
4
4
  export {
5
5
  T as default
6
6
  };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const superEditor_es = require("./chunks/super-editor.es-C2FJLfJa.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-VtmcJzKs.cjs");
4
4
  require("./chunks/vue-Cwv-wUpm.cjs");
5
5
  exports.AIWriter = superEditor_es.AIWriter;
6
6
  exports.AnnotatorHelpers = superEditor_es.AnnotatorHelpers;
@@ -1,4 +1,4 @@
1
- import { A, a, _, C, D, E, b, S, c, d, e, f, g, T, h, i, j, k, l, m, n, o, p, r, q } from "./chunks/super-editor.es-C350__qM.es.js";
1
+ import { A, a, _, C, D, E, b, S, c, d, e, f, g, T, h, i, j, k, l, m, n, o, p, r, q } from "./chunks/super-editor.es-CfMROBHl.es.js";
2
2
  import "./chunks/vue-CKmzTNVs.es.js";
3
3
  export {
4
4
  A as AIWriter,
package/dist/superdoc.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const superEditor_es = require("./chunks/super-editor.es-C2FJLfJa.cjs");
4
- const superdoc = require("./chunks/index-Cp_Yy4vP.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-VtmcJzKs.cjs");
4
+ const superdoc = require("./chunks/index-C_RM2IcG.cjs");
5
5
  const blankDocx = require("./chunks/blank-docx-DfW3Eeh2.cjs");
6
6
  exports.AnnotatorHelpers = superEditor_es.AnnotatorHelpers;
7
7
  exports.Editor = superEditor_es.Editor;
@@ -1,5 +1,5 @@
1
- import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-C350__qM.es.js";
2
- import { D, H, P, S as S2, m, l } from "./chunks/index-oLU8CBCH.es.js";
1
+ import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-CfMROBHl.es.js";
2
+ import { D, H, P, S as S2, m, l } from "./chunks/index-wvwkg6PD.es.js";
3
3
  import { B } from "./chunks/blank-docx-ABm6XYAA.es.js";
4
4
  export {
5
5
  a as AnnotatorHelpers,
@@ -32359,8 +32359,15 @@ Please report this to https://github.com/markedjs/marked.`, e) {
32359
32359
  });
32360
32360
  encodedAttrs.importedAuthor = `${encodedAttrs.author} (imported)`;
32361
32361
  subs.forEach((subElement) => {
32362
- if (subElement.marks === void 0) subElement.marks = [];
32363
- subElement.marks.push({ type: "trackDelete", attrs: encodedAttrs });
32362
+ subElement.marks = [];
32363
+ if (subElement?.content?.[0]) {
32364
+ if (subElement.content[0].marks === void 0) {
32365
+ subElement.content[0].marks = [];
32366
+ }
32367
+ if (subElement.content[0].type === "text") {
32368
+ subElement.content[0].marks.push({ type: "trackDelete", attrs: encodedAttrs });
32369
+ }
32370
+ }
32364
32371
  });
32365
32372
  return subs;
32366
32373
  };
@@ -32419,8 +32426,15 @@ Please report this to https://github.com/markedjs/marked.`, e) {
32419
32426
  });
32420
32427
  encodedAttrs.importedAuthor = `${encodedAttrs.author} (imported)`;
32421
32428
  subs.forEach((subElement) => {
32422
- if (subElement.marks === void 0) subElement.marks = [];
32423
- subElement.marks.push({ type: "trackInsert", attrs: encodedAttrs });
32429
+ subElement.marks = [];
32430
+ if (subElement?.content?.[0]) {
32431
+ if (subElement.content[0].marks === void 0) {
32432
+ subElement.content[0].marks = [];
32433
+ }
32434
+ if (subElement.content[0].type === "text") {
32435
+ subElement.content[0].marks.push({ type: "trackInsert", attrs: encodedAttrs });
32436
+ }
32437
+ }
32424
32438
  });
32425
32439
  return subs;
32426
32440
  };
@@ -35463,7 +35477,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
35463
35477
  name: "w16cex:commentExtensible",
35464
35478
  attributes: {
35465
35479
  "w16cex:durableId": newDurableId,
35466
- "w16cex:dateUtc": toIsoNoFractional()
35480
+ "w16cex:dateUtc": toIsoNoFractional(comment2.createdTime)
35467
35481
  }
35468
35482
  };
35469
35483
  extensibleUpdated.elements[0].elements.push(newExtensible);
@@ -35776,7 +35790,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
35776
35790
  static getStoredSuperdocVersion(docx) {
35777
35791
  return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
35778
35792
  }
35779
- static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "0.34.4") {
35793
+ static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "0.34.5") {
35780
35794
  return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
35781
35795
  }
35782
35796
  /**
@@ -61813,7 +61827,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
61813
61827
  { default: remarkStringify2 },
61814
61828
  { default: remarkGfm2 }
61815
61829
  ] = await Promise.all([
61816
- Promise.resolve().then(() => indexDPjn4rpi),
61830
+ Promise.resolve().then(() => indexBO0dc2dg),
61817
61831
  Promise.resolve().then(() => indexDRCvimau),
61818
61832
  Promise.resolve().then(() => indexC_x_N6Uh),
61819
61833
  Promise.resolve().then(() => indexD_sWOSiG),
@@ -62031,7 +62045,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
62031
62045
  * @returns {Object | void} Migration results
62032
62046
  */
62033
62047
  processCollaborationMigrations() {
62034
- console.debug("[checkVersionMigrations] Current editor version", "0.34.4");
62048
+ console.debug("[checkVersionMigrations] Current editor version", "0.34.5");
62035
62049
  if (!this.options.ydoc) return;
62036
62050
  const metaMap = this.options.ydoc.getMap("meta");
62037
62051
  let docVersion = metaMap.get("version");
@@ -64668,7 +64682,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
64668
64682
  * @param {string} id - Unique identifier of the field
64669
64683
  * @param {StructuredContentUpdate} options
64670
64684
  * @example
64671
- * editor.commands.updateStructuredContentById('123', { text: 'Jane Doe' });
64685
+ * editor.commands.updateStructuredContentById('123', { text: 'Jane Doe', keepTextNodeStyles: true });
64672
64686
  * editor.commands.updateStructuredContentById('123', {
64673
64687
  * json: { type: 'text', text: 'Jane Doe' },
64674
64688
  * });
@@ -64689,7 +64703,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
64689
64703
  const posTo = pos + node2.nodeSize;
64690
64704
  let content2 = null;
64691
64705
  if (options.text) {
64692
- content2 = schema.text(options.text);
64706
+ const firstTextNode = options.keepTextNodeStyles === true ? node2.content.content.find((n) => n.type.name === "text") : null;
64707
+ const textMarks = firstTextNode ? firstTextNode.marks : [];
64708
+ content2 = schema.text(options.text, textMarks);
64693
64709
  }
64694
64710
  if (options.html) {
64695
64711
  const html2 = htmlHandler(options.html, editor);
@@ -64703,6 +64719,13 @@ Please report this to https://github.com/markedjs/marked.`, e) {
64703
64719
  content2 = node2.content;
64704
64720
  }
64705
64721
  const updatedNode = node2.type.create({ ...node2.attrs, ...options.attrs }, content2, node2.marks);
64722
+ try {
64723
+ const nodeForValidation = editor.validateJSON(updatedNode.toJSON());
64724
+ nodeForValidation.check();
64725
+ } catch (error) {
64726
+ console.error("Invalid content.", "Passed value:", content2, "Error:", error);
64727
+ return false;
64728
+ }
64706
64729
  tr.replaceWith(posFrom, posTo, updatedNode);
64707
64730
  }
64708
64731
  return true;
@@ -64787,7 +64810,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
64787
64810
  * @param {StructuredContentUpdate} options
64788
64811
  * @example
64789
64812
  * // Update all fields in the customer-info group
64790
- * editor.commands.updateStructuredContentByGroup('customer-info', { text: 'Jane Doe' });
64813
+ * editor.commands.updateStructuredContentByGroup('customer-info', { text: 'Jane Doe', keepTextNodeStyles: true });
64791
64814
  *
64792
64815
  * // Update block content in a group
64793
64816
  * editor.commands.updateStructuredContentByGroup('terms-section', {
@@ -64801,13 +64824,14 @@ Please report this to https://github.com/markedjs/marked.`, e) {
64801
64824
  }
64802
64825
  const { schema } = editor;
64803
64826
  if (dispatch) {
64804
- structuredContentTags.forEach((structuredContent) => {
64827
+ const updates = [];
64828
+ for (const structuredContent of structuredContentTags) {
64805
64829
  const { pos, node: node2 } = structuredContent;
64806
- const posFrom = tr.mapping.map(pos);
64807
- const posTo = tr.mapping.map(pos + node2.nodeSize);
64808
64830
  let content2 = null;
64809
64831
  if (options.text) {
64810
- content2 = schema.text(options.text);
64832
+ const firstTextNode = options.keepTextNodeStyles === true ? node2.content.content.find((n) => n.type.name === "text") : null;
64833
+ const textMarks = firstTextNode ? firstTextNode.marks : [];
64834
+ content2 = schema.text(options.text, textMarks);
64811
64835
  }
64812
64836
  if (options.html) {
64813
64837
  const html2 = htmlHandler(options.html, editor);
@@ -64821,11 +64845,23 @@ Please report this to https://github.com/markedjs/marked.`, e) {
64821
64845
  content2 = node2.content;
64822
64846
  }
64823
64847
  const updatedNode = node2.type.create({ ...node2.attrs, ...options.attrs }, content2, node2.marks);
64848
+ try {
64849
+ const nodeForValidation = editor.validateJSON(updatedNode.toJSON());
64850
+ nodeForValidation.check();
64851
+ } catch (error) {
64852
+ console.error("Invalid content.", "Passed value:", content2, "Error:", error);
64853
+ return false;
64854
+ }
64855
+ updates.push({ pos, node: node2, updatedNode });
64856
+ }
64857
+ for (const { pos, node: node2, updatedNode } of updates) {
64858
+ const posFrom = tr.mapping.map(pos);
64859
+ const posTo = tr.mapping.map(pos + node2.nodeSize);
64824
64860
  const currentNode = tr.doc.nodeAt(posFrom);
64825
64861
  if (currentNode && node2.eq(currentNode)) {
64826
64862
  tr.replaceWith(posFrom, posTo, updatedNode);
64827
64863
  }
64828
- });
64864
+ }
64829
64865
  }
64830
64866
  return true;
64831
64867
  },
@@ -118478,7 +118514,7 @@ ${style2}
118478
118514
  this.config.colors = shuffleArray(this.config.colors);
118479
118515
  this.userColorMap = /* @__PURE__ */ new Map();
118480
118516
  this.colorIndex = 0;
118481
- this.version = "0.34.4";
118517
+ this.version = "0.34.5";
118482
118518
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
118483
118519
  this.superdocId = config2.superdocId || v4();
118484
118520
  this.colors = this.config.colors;
@@ -120878,7 +120914,7 @@ ${style2}
120878
120914
  value && typeof value === "object" && "byteLength" in value && "byteOffset" in value
120879
120915
  );
120880
120916
  }
120881
- const indexDPjn4rpi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
120917
+ const indexBO0dc2dg = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
120882
120918
  __proto__: null,
120883
120919
  unified
120884
120920
  }, Symbol.toStringTag, { value: "Module" }));