@harbour-enterprises/superdoc 0.12.36-next.1 → 0.12.36-next.3

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 (32) hide show
  1. package/dist/chunks/{index-Dsg_Fwfp.cjs → index-B1MhwjTC.cjs} +2 -2
  2. package/dist/chunks/{index-O7So9dPw.es.js → index-BrSjd1Id.es.js} +1 -1
  3. package/dist/chunks/{index-6-GlnZRv.cjs → index-CMBtuT02.cjs} +1 -1
  4. package/dist/chunks/{index-BxV_npYq.es.js → index-SKpROzLW.es.js} +2 -2
  5. package/dist/chunks/{super-editor.es-BgGd5JMJ.cjs → super-editor.es-C0CYAawq.cjs} +65 -10
  6. package/dist/chunks/{super-editor.es-97KMYuev.es.js → super-editor.es-CJ7JYnTb.es.js} +65 -10
  7. package/dist/chunks/{url-C0Uy3mGF.es.js → url-CAZQTNP3.es.js} +1 -1
  8. package/dist/chunks/{url-CrApKLrN.cjs → url-DuggQ5JR.cjs} +1 -1
  9. package/dist/chunks/{xml-js-0gk9Cp_o.cjs → xml-js-B7Vccv2s.cjs} +93 -86
  10. package/dist/chunks/{xml-js-BsXb2vLz.es.js → xml-js-BV-kCPOA.es.js} +93 -86
  11. package/dist/super-editor/ai-writer.es.js +2 -2
  12. package/dist/super-editor/chunks/{converter-CgDrYGaI.js → converter-CgZg2BnJ.js} +3 -8
  13. package/dist/super-editor/chunks/{docx-zipper-CKPolIhW.js → docx-zipper-af8QSGql.js} +1 -1
  14. package/dist/super-editor/chunks/{editor-BWF8HE4W.js → editor-DsMCF0TV.js} +64 -4
  15. package/dist/super-editor/chunks/{toolbar-BH-Alf-j.js → toolbar-n4Ej7u3_.js} +2 -2
  16. package/dist/super-editor/converter.es.js +1 -1
  17. package/dist/super-editor/core/helpers/annotator.d.ts +2 -0
  18. package/dist/super-editor/core/helpers/annotator.d.ts.map +1 -1
  19. package/dist/super-editor/core/super-converter/v2/importer/paragraphNodeImporter.d.ts +3 -3
  20. package/dist/super-editor/core/super-converter/v2/importer/paragraphNodeImporter.d.ts.map +1 -1
  21. package/dist/super-editor/docx-zipper.es.js +2 -2
  22. package/dist/super-editor/editor.es.js +3 -3
  23. package/dist/super-editor/file-zipper.es.js +1 -1
  24. package/dist/super-editor/super-editor.es.js +6 -6
  25. package/dist/super-editor/toolbar.es.js +2 -2
  26. package/dist/super-editor.cjs +1 -1
  27. package/dist/super-editor.es.js +1 -1
  28. package/dist/superdoc.cjs +5 -5
  29. package/dist/superdoc.es.js +6 -6
  30. package/dist/superdoc.umd.js +66 -11
  31. package/dist/superdoc.umd.js.map +1 -1
  32. package/package.json +1 -1
@@ -456,7 +456,7 @@ var type = TypeError;
456
456
  var uri = URIError;
457
457
  var abs$1 = Math.abs;
458
458
  var floor$1 = Math.floor;
459
- var max$2 = Math.max;
459
+ var max$1 = Math.max;
460
460
  var min$1 = Math.min;
461
461
  var pow$1 = Math.pow;
462
462
  var round$1 = Math.round;
@@ -514,86 +514,93 @@ function requireHasSymbols() {
514
514
  return hasSymbols$1;
515
515
  }
516
516
  var Reflect_getPrototypeOf = typeof Reflect !== "undefined" && Reflect.getPrototypeOf || null;
517
- var Object_getPrototypeOf;
518
- var hasRequiredObject_getPrototypeOf;
519
- function requireObject_getPrototypeOf() {
520
- if (hasRequiredObject_getPrototypeOf) return Object_getPrototypeOf;
521
- hasRequiredObject_getPrototypeOf = 1;
522
- var $Object2 = esObjectAtoms;
523
- Object_getPrototypeOf = $Object2.getPrototypeOf || null;
524
- return Object_getPrototypeOf;
525
- }
526
- var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
527
- var toStr$3 = Object.prototype.toString;
528
- var max$1 = Math.max;
529
- var funcType = "[object Function]";
530
- var concatty = function concatty2(a, b) {
531
- var arr = [];
532
- for (var i = 0; i < a.length; i += 1) {
533
- arr[i] = a[i];
534
- }
535
- for (var j = 0; j < b.length; j += 1) {
536
- arr[j + a.length] = b[j];
537
- }
538
- return arr;
539
- };
540
- var slicy = function slicy2(arrLike, offset) {
541
- var arr = [];
542
- for (var i = offset, j = 0; i < arrLike.length; i += 1, j += 1) {
543
- arr[j] = arrLike[i];
544
- }
545
- return arr;
546
- };
547
- var joiny = function(arr, joiner) {
548
- var str = "";
549
- for (var i = 0; i < arr.length; i += 1) {
550
- str += arr[i];
551
- if (i + 1 < arr.length) {
552
- str += joiner;
517
+ var $Object$2 = esObjectAtoms;
518
+ var Object_getPrototypeOf = $Object$2.getPrototypeOf || null;
519
+ var implementation;
520
+ var hasRequiredImplementation;
521
+ function requireImplementation() {
522
+ if (hasRequiredImplementation) return implementation;
523
+ hasRequiredImplementation = 1;
524
+ var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
525
+ var toStr2 = Object.prototype.toString;
526
+ var max2 = Math.max;
527
+ var funcType = "[object Function]";
528
+ var concatty = function concatty2(a, b) {
529
+ var arr = [];
530
+ for (var i = 0; i < a.length; i += 1) {
531
+ arr[i] = a[i];
532
+ }
533
+ for (var j = 0; j < b.length; j += 1) {
534
+ arr[j + a.length] = b[j];
535
+ }
536
+ return arr;
537
+ };
538
+ var slicy = function slicy2(arrLike, offset) {
539
+ var arr = [];
540
+ for (var i = offset, j = 0; i < arrLike.length; i += 1, j += 1) {
541
+ arr[j] = arrLike[i];
553
542
  }
554
- }
555
- return str;
556
- };
557
- var implementation$1 = function bind(that) {
558
- var target = this;
559
- if (typeof target !== "function" || toStr$3.apply(target) !== funcType) {
560
- throw new TypeError(ERROR_MESSAGE + target);
561
- }
562
- var args = slicy(arguments, 1);
563
- var bound;
564
- var binder = function() {
565
- if (this instanceof bound) {
566
- var result = target.apply(
567
- this,
568
- concatty(args, arguments)
569
- );
570
- if (Object(result) === result) {
571
- return result;
543
+ return arr;
544
+ };
545
+ var joiny = function(arr, joiner) {
546
+ var str = "";
547
+ for (var i = 0; i < arr.length; i += 1) {
548
+ str += arr[i];
549
+ if (i + 1 < arr.length) {
550
+ str += joiner;
572
551
  }
573
- return this;
574
552
  }
575
- return target.apply(
576
- that,
577
- concatty(args, arguments)
578
- );
553
+ return str;
579
554
  };
580
- var boundLength = max$1(0, target.length - args.length);
581
- var boundArgs = [];
582
- for (var i = 0; i < boundLength; i++) {
583
- boundArgs[i] = "$" + i;
584
- }
585
- bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
586
- if (target.prototype) {
587
- var Empty = function Empty2() {
555
+ implementation = function bind2(that) {
556
+ var target = this;
557
+ if (typeof target !== "function" || toStr2.apply(target) !== funcType) {
558
+ throw new TypeError(ERROR_MESSAGE + target);
559
+ }
560
+ var args = slicy(arguments, 1);
561
+ var bound;
562
+ var binder = function() {
563
+ if (this instanceof bound) {
564
+ var result = target.apply(
565
+ this,
566
+ concatty(args, arguments)
567
+ );
568
+ if (Object(result) === result) {
569
+ return result;
570
+ }
571
+ return this;
572
+ }
573
+ return target.apply(
574
+ that,
575
+ concatty(args, arguments)
576
+ );
588
577
  };
589
- Empty.prototype = target.prototype;
590
- bound.prototype = new Empty();
591
- Empty.prototype = null;
592
- }
593
- return bound;
594
- };
595
- var implementation = implementation$1;
596
- var functionBind = Function.prototype.bind || implementation;
578
+ var boundLength = max2(0, target.length - args.length);
579
+ var boundArgs = [];
580
+ for (var i = 0; i < boundLength; i++) {
581
+ boundArgs[i] = "$" + i;
582
+ }
583
+ bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
584
+ if (target.prototype) {
585
+ var Empty = function Empty2() {
586
+ };
587
+ Empty.prototype = target.prototype;
588
+ bound.prototype = new Empty();
589
+ Empty.prototype = null;
590
+ }
591
+ return bound;
592
+ };
593
+ return implementation;
594
+ }
595
+ var functionBind;
596
+ var hasRequiredFunctionBind;
597
+ function requireFunctionBind() {
598
+ if (hasRequiredFunctionBind) return functionBind;
599
+ hasRequiredFunctionBind = 1;
600
+ var implementation2 = requireImplementation();
601
+ functionBind = Function.prototype.bind || implementation2;
602
+ return functionBind;
603
+ }
597
604
  var functionCall;
598
605
  var hasRequiredFunctionCall;
599
606
  function requireFunctionCall() {
@@ -611,12 +618,12 @@ function requireFunctionApply() {
611
618
  return functionApply;
612
619
  }
613
620
  var reflectApply$1 = typeof Reflect !== "undefined" && Reflect && Reflect.apply;
614
- var bind$3 = functionBind;
621
+ var bind$3 = requireFunctionBind();
615
622
  var $apply$2 = requireFunctionApply();
616
623
  var $call$2 = requireFunctionCall();
617
624
  var $reflectApply = reflectApply$1;
618
625
  var actualApply$1 = $reflectApply || bind$3.call($call$2, $apply$2);
619
- var bind$2 = functionBind;
626
+ var bind$2 = requireFunctionBind();
620
627
  var $TypeError$4 = type;
621
628
  var $call$1 = requireFunctionCall();
622
629
  var $actualApply = actualApply$1;
@@ -651,7 +658,7 @@ var get = desc && typeof desc.get === "function" ? callBind$2([desc.get]) : type
651
658
  }
652
659
  ) : false;
653
660
  var reflectGetProto = Reflect_getPrototypeOf;
654
- var originalGetProto = requireObject_getPrototypeOf();
661
+ var originalGetProto = Object_getPrototypeOf;
655
662
  var getDunderProto = get;
656
663
  var getProto$3 = reflectGetProto ? function getProto(O) {
657
664
  return reflectGetProto(O);
@@ -670,8 +677,8 @@ function requireHasown() {
670
677
  hasRequiredHasown = 1;
671
678
  var call = Function.prototype.call;
672
679
  var $hasOwn = Object.prototype.hasOwnProperty;
673
- var bind3 = functionBind;
674
- hasown = bind3.call(call, $hasOwn);
680
+ var bind2 = requireFunctionBind();
681
+ hasown = bind2.call(call, $hasOwn);
675
682
  return hasown;
676
683
  }
677
684
  var undefined$1;
@@ -685,7 +692,7 @@ var $TypeError$3 = type;
685
692
  var $URIError = uri;
686
693
  var abs = abs$1;
687
694
  var floor = floor$1;
688
- var max = max$2;
695
+ var max = max$1;
689
696
  var min = min$1;
690
697
  var pow = pow$1;
691
698
  var round = round$1;
@@ -716,7 +723,7 @@ var ThrowTypeError = $gOPD ? function() {
716
723
  }() : throwTypeError;
717
724
  var hasSymbols2 = requireHasSymbols()();
718
725
  var getProto$2 = getProto$3;
719
- var $ObjectGPO = requireObject_getPrototypeOf();
726
+ var $ObjectGPO = Object_getPrototypeOf;
720
727
  var $ReflectGPO = Reflect_getPrototypeOf;
721
728
  var $apply$1 = requireFunctionApply();
722
729
  var $call = requireFunctionCall();
@@ -890,7 +897,7 @@ var LEGACY_ALIASES = {
890
897
  "%WeakMapPrototype%": ["WeakMap", "prototype"],
891
898
  "%WeakSetPrototype%": ["WeakSet", "prototype"]
892
899
  };
893
- var bind$1 = functionBind;
900
+ var bind$1 = requireFunctionBind();
894
901
  var hasOwn$1 = requireHasown();
895
902
  var $concat = bind$1.call($call, Array.prototype.concat);
896
903
  var $spliceApply = bind$1.call($apply$1, Array.prototype.splice);
@@ -1432,11 +1439,11 @@ var setFunctionLength = function setFunctionLength2(fn2, length) {
1432
1439
  }
1433
1440
  return fn2;
1434
1441
  };
1435
- var bind2 = functionBind;
1442
+ var bind = requireFunctionBind();
1436
1443
  var $apply = requireFunctionApply();
1437
1444
  var actualApply = actualApply$1;
1438
1445
  var applyBind = function applyBind2() {
1439
- return actualApply(bind2, $apply, arguments);
1446
+ return actualApply(bind, $apply, arguments);
1440
1447
  };
1441
1448
  (function(module) {
1442
1449
  var setFunctionLength$1 = setFunctionLength;
@@ -1,6 +1,6 @@
1
1
  import { ref, onMounted, onUnmounted, computed, createElementBlock, openBlock, withModifiers, createElementVNode, withDirectives, unref, vModelText, createCommentVNode, nextTick } from "vue";
2
- import { T as TextSelection } from "./chunks/converter-CgDrYGaI.js";
3
- import { _ as _export_sfc } from "./chunks/editor-BWF8HE4W.js";
2
+ import { T as TextSelection } from "./chunks/converter-CgZg2BnJ.js";
3
+ import { _ as _export_sfc } from "./chunks/editor-DsMCF0TV.js";
4
4
  const DEFAULT_API_ENDPOINT = "https://sd-dev-express-gateway-i6xtm.ondigitalocean.app/insights";
5
5
  const SYSTEM_PROMPT = "You are an expert copywriter and you are immersed in a document editor. You are to provide document related text responses based on the user prompts. Only write what is asked for. Do not provide explanations. Try to keep placeholders as short as possible. Do not output your prompt. Your instructions are: ";
6
6
  async function baseInsightsFetch(payload, options = {}) {
@@ -22057,12 +22057,7 @@ const getParagraphIndent = (node2, docx, styleId = "") => {
22057
22057
  return indent;
22058
22058
  };
22059
22059
  const getParagraphSpacing = (node2, docx, styleId = "", marks = []) => {
22060
- const spacing = {
22061
- lineSpaceAfter: 0,
22062
- lineSpaceBefore: 0,
22063
- line: 0,
22064
- lineRule: null
22065
- };
22060
+ const spacing = {};
22066
22061
  const { spacing: pDefaultSpacing = {} } = getDefaultParagraphStyle(docx, styleId);
22067
22062
  let lineSpaceAfter, lineSpaceBefore, line, lineRuleStyle;
22068
22063
  const pPr = node2.elements?.find((el) => el.name === "w:pPr");
@@ -23311,7 +23306,7 @@ const _SuperConverter = class _SuperConverter {
23311
23306
  return;
23312
23307
  }
23313
23308
  }
23314
- static updateDocumentVersion(docx = this.convertedXml, version = "0.12.36-next.1") {
23309
+ static updateDocumentVersion(docx = this.convertedXml, version = "0.12.36-next.3") {
23315
23310
  const customLocation = "docProps/custom.xml";
23316
23311
  if (!docx[customLocation]) {
23317
23312
  docx[customLocation] = generateCustomXml();
@@ -23781,7 +23776,7 @@ function storeSuperdocVersion(docx) {
23781
23776
  function generateCustomXml() {
23782
23777
  return DEFAULT_CUSTOM_XML;
23783
23778
  }
23784
- function generateSuperdocVersion(pid = 2, version = "0.12.36-next.1") {
23779
+ function generateSuperdocVersion(pid = 2, version = "0.12.36-next.3") {
23785
23780
  return {
23786
23781
  type: "element",
23787
23782
  name: "property",
@@ -1,4 +1,4 @@
1
- import { x as process$1, a1 as commonjsGlobal, B as Buffer, a2 as getDefaultExportFromCjs, a3 as getContentTypesFromXml, a4 as xmljs } from "./converter-CgDrYGaI.js";
1
+ import { x as process$1, a1 as commonjsGlobal, B as Buffer, a2 as getDefaultExportFromCjs, a3 as getContentTypesFromXml, a4 as xmljs } from "./converter-CgZg2BnJ.js";
2
2
  function commonjsRequire(path) {
3
3
  throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
4
4
  }
@@ -12,9 +12,9 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
12
12
  var _Attribute_static, getGlobalAttributes_fn, getNodeAndMarksAttributes_fn, _Schema_static, createNodesSchema_fn, createMarksSchema_fn, _events, _ExtensionService_instances, setupExtensions_fn, attachEditorEvents_fn, _commandService, _css, _Editor_instances, initContainerElement_fn, init_fn, initRichText_fn, onFocus_fn, checkHeadless_fn, insertNewFileData_fn, registerPluginByNameIfNotExists_fn, createExtensionService_fn, createCommandService_fn, createConverter_fn, initMedia_fn, initFonts_fn, createSchema_fn, generatePmData_fn, createDocFromHTML_fn, createView_fn, onCollaborationReady_fn, initComments_fn, initPagination_fn, dispatchTransaction_fn, prepareDocumentForImport_fn, prepareDocumentForExport_fn, endCollaboration_fn, _FieldAnnotationView_instances, createAnnotation_fn;
13
13
  import * as Y from "yjs";
14
14
  import { UndoManager, Item as Item$1, ContentType, Text as Text$1, XmlElement, encodeStateAsUpdate } from "yjs";
15
- import { P as PluginKey, a as Plugin, M as Mapping, c as callOrGet, i as isEmptyObject, S as Schema$1, T as TextSelection, b as canSplit, l as liftTarget, A as AllSelection, d as canJoin, j as joinPoint, N as NodeSelection, r as replaceStep$1, e as Selection, F as Fragment, R as ReplaceAroundStep, f as Slice, o as objectIncludes, g as deleteProps, D as DOMParser$1, h as ReplaceStep, k as NodeRange, m as findWrapping, n as isMacOS, p as isIOS, q as generateDocxRandomId, s as minMax, t as generateRandom32BitHex, u as DOMSerializer, v as Mark$1, w as dropPoint, x as process$1, B as Buffer2, y as isRegExp, z as TrackDeleteMarkName, C as TrackInsertMarkName, E as v4, G as TrackFormatMarkName, H as comments_module_events, I as AddMarkStep, J as RemoveMarkStep, K as twipsToLines, L as pixelsToTwips, O as SuperConverter, Q as EditorState, U as hasSomeParentWithClass, V as parseSizeUnit, W as getLineHeightValueString, X as toKebabCase, Y as kebabCase, Z as getColStyleDeclaration, _ as SelectionRange, $ as Transform, a0 as createColGroup } from "./converter-CgDrYGaI.js";
15
+ import { P as PluginKey, a as Plugin, M as Mapping, c as callOrGet, i as isEmptyObject, S as Schema$1, T as TextSelection, b as canSplit, l as liftTarget, A as AllSelection, d as canJoin, j as joinPoint, N as NodeSelection, r as replaceStep$1, e as Selection, F as Fragment, R as ReplaceAroundStep, f as Slice, o as objectIncludes, g as deleteProps, D as DOMParser$1, h as ReplaceStep, k as NodeRange, m as findWrapping, n as isMacOS, p as isIOS, q as generateDocxRandomId, s as minMax, t as generateRandom32BitHex, u as DOMSerializer, v as Mark$1, w as dropPoint, x as process$1, B as Buffer2, y as isRegExp, z as TrackDeleteMarkName, C as TrackInsertMarkName, E as v4, G as TrackFormatMarkName, H as comments_module_events, I as AddMarkStep, J as RemoveMarkStep, K as twipsToLines, L as pixelsToTwips, O as SuperConverter, Q as EditorState, U as hasSomeParentWithClass, V as parseSizeUnit, W as getLineHeightValueString, X as toKebabCase, Y as kebabCase, Z as getColStyleDeclaration, _ as SelectionRange, $ as Transform, a0 as createColGroup } from "./converter-CgZg2BnJ.js";
16
16
  import { ref, computed, createElementBlock, openBlock, withModifiers, Fragment as Fragment$1, renderList, normalizeClass, createCommentVNode, toDisplayString, createElementVNode, createApp } from "vue";
17
- import { D as DocxZipper } from "./docx-zipper-CKPolIhW.js";
17
+ import { D as DocxZipper } from "./docx-zipper-af8QSGql.js";
18
18
  function getMarksFromSelection(state) {
19
19
  const { from: from2, to, empty: empty2 } = state.selection;
20
20
  const marks = [];
@@ -13950,6 +13950,65 @@ const deleteHeaderFooterFieldAnnotations = ({ editor, fieldIdOrArray }) => {
13950
13950
  );
13951
13951
  });
13952
13952
  };
13953
+ const cleanUpListsWithAnnotations = (fieldsToDelete = [], editor) => {
13954
+ if (!Array.isArray(fieldsToDelete)) fieldsToDelete = [fieldsToDelete];
13955
+ const { doc: doc2 } = editor.state;
13956
+ const docxAnnotations = getAllFieldAnnotations(editor.state) || [];
13957
+ const nodesToDelete = [];
13958
+ fieldsToDelete.forEach((fieldId) => {
13959
+ const matched = docxAnnotations.find((a) => a.node.attrs.fieldId === fieldId);
13960
+ if (!matched) return;
13961
+ const listItem = findParentNodeClosestToPos(
13962
+ doc2.resolve(matched.pos),
13963
+ (node2) => node2.type.name === "listItem"
13964
+ );
13965
+ if (!listItem) return;
13966
+ if (listItem.node.childCount !== 1) {
13967
+ let remainingNodes = listItem.node.childCount;
13968
+ let matchingNodesFound = 0;
13969
+ let hasOtherNodes = false;
13970
+ listItem.node.children.forEach((child, index2) => {
13971
+ const { type } = child;
13972
+ if (type.name !== "paragraph") return;
13973
+ child.children.forEach((inline) => {
13974
+ const isFieldToDelete = fieldsToDelete.includes(inline.attrs.fieldId);
13975
+ const isMatchingField = inline.type.name === "fieldAnnotation" && isFieldToDelete;
13976
+ const isEmpty2 = inline.childCount === 0;
13977
+ if (!isEmpty2 && !isMatchingField) hasOtherNodes = true;
13978
+ if (isMatchingField) matchingNodesFound += 1;
13979
+ });
13980
+ });
13981
+ if (!hasOtherNodes && matchingNodesFound > 0) {
13982
+ remainingNodes -= matchingNodesFound;
13983
+ }
13984
+ if (remainingNodes > 0) {
13985
+ return;
13986
+ }
13987
+ }
13988
+ let { pos, node, depth } = listItem;
13989
+ let $pos = doc2.resolve(pos);
13990
+ while (depth > 0) {
13991
+ const parent = $pos.node(depth - 1);
13992
+ if (parent.childCount === 1) {
13993
+ depth -= 1;
13994
+ pos = $pos.before(depth);
13995
+ node = parent;
13996
+ $pos = doc2.resolve(pos);
13997
+ } else {
13998
+ break;
13999
+ }
14000
+ }
14001
+ if (!nodesToDelete.some((n) => n.pos === pos)) {
14002
+ nodesToDelete.push({ pos, node });
14003
+ }
14004
+ });
14005
+ if (!nodesToDelete.length) return;
14006
+ const tr = editor.state.tr;
14007
+ nodesToDelete.sort((a, b) => b.pos - a.pos).forEach(({ pos, node }) => {
14008
+ tr.delete(pos, pos + node.nodeSize);
14009
+ });
14010
+ editor.view.dispatch(tr);
14011
+ };
13953
14012
  const AnnotatorHelpers = {
13954
14013
  getFieldAttrs,
13955
14014
  processTables,
@@ -13957,7 +14016,8 @@ const AnnotatorHelpers = {
13957
14016
  annotateHeadersAndFooters,
13958
14017
  getAllHeaderFooterEditors,
13959
14018
  updateHeaderFooterFieldAnnotations,
13960
- deleteHeaderFooterFieldAnnotations
14019
+ deleteHeaderFooterFieldAnnotations,
14020
+ cleanUpListsWithAnnotations
13961
14021
  };
13962
14022
  const CollaborationPluginKey = new PluginKey("collaboration");
13963
14023
  const Collaboration = Extension.create({
@@ -14795,7 +14855,7 @@ const _Editor = class _Editor extends EventEmitter {
14795
14855
  * @returns {Object | void} Migration results
14796
14856
  */
14797
14857
  processCollaborationMigrations() {
14798
- console.debug("[checkVersionMigrations] Current editor version", "0.12.36-next.1");
14858
+ console.debug("[checkVersionMigrations] Current editor version", "0.12.36-next.3");
14799
14859
  if (!this.options.ydoc) return;
14800
14860
  const metaMap = this.options.ydoc.getMap("meta");
14801
14861
  let docVersion = metaMap.get("version");
@@ -1,6 +1,6 @@
1
1
  import { computed, createElementBlock, openBlock, createElementVNode, createCommentVNode, normalizeClass, normalizeStyle, ref, withKeys, unref, withModifiers, createBlock, toDisplayString, withDirectives, vModelText, getCurrentInstance, createVNode, readonly, watch, onMounted, onBeforeUnmount, reactive, onBeforeMount, inject, onActivated, onDeactivated, createTextVNode, Fragment, Comment, defineComponent, provide, h, Teleport, toRef, nextTick, renderSlot, isVNode, shallowRef, watchEffect, mergeProps, Transition, vShow, cloneVNode, Text, renderList, withCtx } from "vue";
2
- import { x as process$1 } from "./converter-CgDrYGaI.js";
3
- import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-BWF8HE4W.js";
2
+ import { x as process$1 } from "./converter-CgZg2BnJ.js";
3
+ import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-DsMCF0TV.js";
4
4
  const sanitizeNumber = (value, defaultNumber) => {
5
5
  let sanitized = value.replace(/[^0-9.]/g, "");
6
6
  sanitized = parseFloat(sanitized);
@@ -1,4 +1,4 @@
1
- import { O } from "./chunks/converter-CgDrYGaI.js";
1
+ import { O } from "./chunks/converter-CgZg2BnJ.js";
2
2
  export {
3
3
  O as SuperConverter
4
4
  };
@@ -12,6 +12,7 @@ export function annotateDocument({ annotationValues, hiddenFieldIds, removeEmpty
12
12
  tr: any;
13
13
  editor: any;
14
14
  }): any;
15
+ export function cleanUpListsWithAnnotations(fieldsToDelete: any[], editor: any): void;
15
16
  export namespace AnnotatorHelpers {
16
17
  export { getFieldAttrs };
17
18
  export { processTables };
@@ -20,6 +21,7 @@ export namespace AnnotatorHelpers {
20
21
  export { getAllHeaderFooterEditors };
21
22
  export { updateHeaderFooterFieldAnnotations };
22
23
  export { deleteHeaderFooterFieldAnnotations };
24
+ export { cleanUpListsWithAnnotations };
23
25
  }
24
26
  /**
25
27
  * Annotate headers and footers in the document
@@ -1 +1 @@
1
- {"version":3,"file":"annotator.d.ts","sourceRoot":"","sources":["../../../src/core/helpers/annotator.js"],"names":[],"mappings":"AAWO,uEAiBN;AAiCM,+DAHJ;IAAuB,MAAM;IACP,gBAAgB;CACxC,OAkBA;AA8FM,kDAHI,MAAM,GACJ,KAAQ,CAsCpB;AAwBM;;;;;;;QAyFN;;;;;;;;;;AA/GD;;;;;;;;GAQG;AACH,4GALG;IAAuB,MAAM;IACP,gBAAgB;IAChB,cAAc;CACpC,GAAU,IAAI,CAahB;AAuHD;;;;SAeC;AAED;;;SAeC"}
1
+ {"version":3,"file":"annotator.d.ts","sourceRoot":"","sources":["../../../src/core/helpers/annotator.js"],"names":[],"mappings":"AAYO,uEAiBN;AAiCM,+DAHJ;IAAuB,MAAM;IACP,gBAAgB;CACxC,OAkBA;AA8FM,kDAHI,MAAM,GACJ,KAAQ,CAsCpB;AAwBM;;;;;;;QAyFN;AA+DM,sFA8EN;;;;;;;;;;;AA5PD;;;;;;;;GAQG;AACH,4GALG;IAAuB,MAAM;IACP,gBAAgB;IAChB,cAAc;CACpC,GAAU,IAAI,CAahB;AAuHD;;;;SAeC;AAED;;;SAgBC"}
@@ -54,10 +54,10 @@ export function getParagraphIndent(node: any, docx: any, styleId?: string): {
54
54
  textIndent: number;
55
55
  };
56
56
  export function getParagraphSpacing(node: any, docx: any, styleId?: string, marks?: any[]): {
57
- lineSpaceAfter: number;
58
- lineSpaceBefore: number;
59
- line: number;
57
+ line: string | number;
60
58
  lineRule: any;
59
+ lineSpaceBefore: number;
60
+ lineSpaceAfter: number;
61
61
  };
62
62
  /**
63
63
  * @type {import("docxImporter").NodeHandlerEntry}
@@ -1 +1 @@
1
- {"version":3,"file":"paragraphNodeImporter.d.ts","sourceRoot":"","sources":["../../../../../src/core/super-converter/v2/importer/paragraphNodeImporter.js"],"names":[],"mappings":"AA0SA;;;GAGG;AACH,0DAHW,MAAM,QACN,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;EAuGpB;AAED;;;;;;GAMG;AACH,kDAHW,OAAO,EAAE,SA4CnB;AA9bD;;;;;;;GAOG;AACH,sCAqIE;AAEK;;;;;;EAwCN;AAEM;;;;;EAkDN;AAgDD;;GAEG;AACH,6CAGE"}
1
+ {"version":3,"file":"paragraphNodeImporter.d.ts","sourceRoot":"","sources":["../../../../../src/core/super-converter/v2/importer/paragraphNodeImporter.js"],"names":[],"mappings":"AAqSA;;;GAGG;AACH,0DAHW,MAAM,QACN,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;EAuGpB;AAED;;;;;;GAMG;AACH,kDAHW,OAAO,EAAE,SA4CnB;AAzbD;;;;;;;GAOG;AACH,sCAqIE;AAEK;;;;;;EAwCN;AAEM;;;;;EA6CN;AAgDD;;GAEG;AACH,6CAGE"}
@@ -1,5 +1,5 @@
1
- import "./chunks/converter-CgDrYGaI.js";
2
- import { D } from "./chunks/docx-zipper-CKPolIhW.js";
1
+ import "./chunks/converter-CgZg2BnJ.js";
2
+ import { D } from "./chunks/docx-zipper-af8QSGql.js";
3
3
  export {
4
4
  D as default
5
5
  };
@@ -1,6 +1,6 @@
1
- import { E } from "./chunks/editor-BWF8HE4W.js";
2
- import "./chunks/converter-CgDrYGaI.js";
3
- import "./chunks/docx-zipper-CKPolIhW.js";
1
+ import { E } from "./chunks/editor-DsMCF0TV.js";
2
+ import "./chunks/converter-CgZg2BnJ.js";
3
+ import "./chunks/docx-zipper-af8QSGql.js";
4
4
  export {
5
5
  E as Editor
6
6
  };
@@ -1,4 +1,4 @@
1
- import { J as JSZip } from "./chunks/docx-zipper-CKPolIhW.js";
1
+ import { J as JSZip } from "./chunks/docx-zipper-af8QSGql.js";
2
2
  async function createZip(blobs, fileNames) {
3
3
  const zip = new JSZip();
4
4
  blobs.forEach((blob, index) => {
@@ -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, runCommandWithArgumentOnly_fn;
12
- import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, I as ImagePlaceholderPluginKey, f as findPlaceholder, c as findParentNode, d as getActiveFormatting, i as isInTable, e as undoDepth, r as redoDepth, E as Editor, h as getStarterExtensions, P as Placeholder, j as getRichTextExtensions, M as Mark, k as Extension, A as Attribute, N as Node } from "./chunks/editor-BWF8HE4W.js";
13
- import { o, C, T, m, p, l, n } from "./chunks/editor-BWF8HE4W.js";
14
- import { a2 as getDefaultExportFromCjs, E as v4, a5 as vClickOutside, T as TextSelection, a as Plugin } from "./chunks/converter-CgDrYGaI.js";
15
- import { O } from "./chunks/converter-CgDrYGaI.js";
12
+ import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, I as ImagePlaceholderPluginKey, f as findPlaceholder, c as findParentNode, d as getActiveFormatting, i as isInTable, e as undoDepth, r as redoDepth, E as Editor, h as getStarterExtensions, P as Placeholder, j as getRichTextExtensions, M as Mark, k as Extension, A as Attribute, N as Node } from "./chunks/editor-DsMCF0TV.js";
13
+ import { o, C, T, m, p, l, n } from "./chunks/editor-DsMCF0TV.js";
14
+ import { a2 as getDefaultExportFromCjs, E as v4, a5 as vClickOutside, T as TextSelection, a as Plugin } from "./chunks/converter-CgZg2BnJ.js";
15
+ import { O } from "./chunks/converter-CgZg2BnJ.js";
16
16
  import { ref, createElementBlock, openBlock, normalizeClass, unref, createElementVNode, getCurrentInstance, computed, watch, onMounted, createCommentVNode, withDirectives, withKeys, withModifiers, vModelText, createTextVNode, toDisplayString, Fragment, renderList, normalizeStyle, createVNode, h, createApp, reactive, onUnmounted, shallowRef, onBeforeUnmount, createBlock } from "vue";
17
- import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, N as NSkeleton } from "./chunks/toolbar-BH-Alf-j.js";
17
+ import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, N as NSkeleton } from "./chunks/toolbar-n4Ej7u3_.js";
18
18
  import AIWriter from "./ai-writer.es.js";
19
- import { D } from "./chunks/docx-zipper-CKPolIhW.js";
19
+ import { D } from "./chunks/docx-zipper-af8QSGql.js";
20
20
  import { createZip } from "./file-zipper.es.js";
21
21
  var eventemitter3 = { exports: {} };
22
22
  (function(module) {
@@ -1,6 +1,6 @@
1
1
  import "vue";
2
- import { T } from "./chunks/toolbar-BH-Alf-j.js";
3
- import "./chunks/editor-BWF8HE4W.js";
2
+ import { T } from "./chunks/toolbar-n4Ej7u3_.js";
3
+ import "./chunks/editor-DsMCF0TV.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-BgGd5JMJ.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-C0CYAawq.cjs");
4
4
  require("./chunks/vue-DPZkajuO.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, T, f, g, i, h, j, k, l, m, n, o } from "./chunks/super-editor.es-97KMYuev.es.js";
1
+ import { A, a, _, C, D, E, b, S, c, d, e, T, f, g, i, h, j, k, l, m, n, o } from "./chunks/super-editor.es-CJ7JYnTb.es.js";
2
2
  import "./chunks/vue-IIIZMHTg.es.js";
3
3
  export {
4
4
  A as AIWriter,
package/dist/superdoc.cjs CHANGED
@@ -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-BgGd5JMJ.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-C0CYAawq.cjs");
4
4
  const vue = require("./chunks/vue-DPZkajuO.cjs");
5
5
  const jszip = require("./chunks/jszip-Bwu_om3F.cjs");
6
6
  const blankDocx = require("./chunks/blank-docx-CPqX9RF5.cjs");
@@ -23172,13 +23172,13 @@ var __webpack_exports__$1 = globalThis.pdfjsLib = {};
23172
23172
  "./chunks/empty-lth7LH78.cjs"
23173
23173
  )), http = await Promise.resolve().then(() => require(
23174
23174
  /*webpackIgnore: true*/
23175
- "./chunks/index-Dsg_Fwfp.cjs"
23175
+ "./chunks/index-B1MhwjTC.cjs"
23176
23176
  )).then((n) => n.index), https = await Promise.resolve().then(() => require(
23177
23177
  /*webpackIgnore: true*/
23178
- "./chunks/index-6-GlnZRv.cjs"
23178
+ "./chunks/index-CMBtuT02.cjs"
23179
23179
  )).then((n) => n.index), url = await Promise.resolve().then(() => require(
23180
23180
  /*webpackIgnore: true*/
23181
- "./chunks/url-CrApKLrN.cjs"
23181
+ "./chunks/url-DuggQ5JR.cjs"
23182
23182
  )).then((n) => n.url);
23183
23183
  let canvas, path2d;
23184
23184
  try {
@@ -46571,7 +46571,7 @@ class SuperDoc extends eventemitter3.EventEmitter {
46571
46571
  this.config.colors = shuffleArray(this.config.colors);
46572
46572
  this.userColorMap = /* @__PURE__ */ new Map();
46573
46573
  this.colorIndex = 0;
46574
- this.version = "0.12.36-next.1";
46574
+ this.version = "0.12.36-next.3";
46575
46575
  console.debug("🦋 [superdoc] Using SuperDoc version:", this.version);
46576
46576
  this.superdocId = config.superdocId || uuid.v4();
46577
46577
  this.colors = this.config.colors;
@@ -1,5 +1,5 @@
1
- import { o as index$1, C as CommentsPluginKey, f as TrackChangesBasePluginKey, E as Editor, l as getRichTextExtensions, d as SuperInput, A as AIWriter, c as SuperEditor, e as SuperToolbar, g as createZip } from "./chunks/super-editor.es-97KMYuev.es.js";
2
- import { a, S, i, n } from "./chunks/super-editor.es-97KMYuev.es.js";
1
+ import { o as index$1, C as CommentsPluginKey, f as TrackChangesBasePluginKey, E as Editor, l as getRichTextExtensions, d as SuperInput, A as AIWriter, c as SuperEditor, e as SuperToolbar, g as createZip } from "./chunks/super-editor.es-CJ7JYnTb.es.js";
2
+ import { a, S, i, n } from "./chunks/super-editor.es-CJ7JYnTb.es.js";
3
3
  import { Y as effectScope, r as ref, Z as markRaw, p as process$1, _ as toRaw, a as computed, $ as isRef, a0 as isReactive, D as toRef, i as inject, q as getCurrentInstance, l as watch, y as unref, a1 as hasInjectionContext, N as reactive, u as nextTick, a2 as getCurrentScope, a3 as onScopeDispose, a4 as toRefs, g as global$1, K as shallowRef, O as readonly, j as onMounted, k as onBeforeUnmount, h as onBeforeMount, U as onActivated, s as onDeactivated, A as createTextVNode, F as Fragment, R as Comment, m as defineComponent, E as provide, I as withDirectives, C as h, V as Teleport, S as renderSlot, W as isVNode, J as watchEffect, P as Transition, G as mergeProps, Q as vShow, H as cloneVNode, T as Text, b as createElementBlock, o as openBlock, t as toDisplayString, x as createVNode, z as withCtx, f as createBaseVNode, B as normalizeStyle, e as createCommentVNode, v as createBlock, w as withModifiers, n as normalizeClass, a5 as resolveDirective, d as renderList, c as createApp, X as onUnmounted, a6 as resolveDynamicComponent } from "./chunks/vue-IIIZMHTg.es.js";
4
4
  import { B as Buffer$2 } from "./chunks/jszip-BmWWPxfF.es.js";
5
5
  import { B as BlankDOCX } from "./chunks/blank-docx-iwdyG9RH.es.js";
@@ -23171,13 +23171,13 @@ var __webpack_exports__$1 = globalThis.pdfjsLib = {};
23171
23171
  "./chunks/empty-smM22Y5N.es.js"
23172
23172
  ), http = await import(
23173
23173
  /*webpackIgnore: true*/
23174
- "./chunks/index-BxV_npYq.es.js"
23174
+ "./chunks/index-SKpROzLW.es.js"
23175
23175
  ).then((n2) => n2.i), https = await import(
23176
23176
  /*webpackIgnore: true*/
23177
- "./chunks/index-O7So9dPw.es.js"
23177
+ "./chunks/index-BrSjd1Id.es.js"
23178
23178
  ).then((n2) => n2.i), url = await import(
23179
23179
  /*webpackIgnore: true*/
23180
- "./chunks/url-C0Uy3mGF.es.js"
23180
+ "./chunks/url-CAZQTNP3.es.js"
23181
23181
  ).then((n2) => n2.u);
23182
23182
  let canvas, path2d;
23183
23183
  try {
@@ -46570,7 +46570,7 @@ class SuperDoc extends EventEmitter {
46570
46570
  this.config.colors = shuffleArray(this.config.colors);
46571
46571
  this.userColorMap = /* @__PURE__ */ new Map();
46572
46572
  this.colorIndex = 0;
46573
- this.version = "0.12.36-next.1";
46573
+ this.version = "0.12.36-next.3";
46574
46574
  console.debug("🦋 [superdoc] Using SuperDoc version:", this.version);
46575
46575
  this.superdocId = config.superdocId || v4();
46576
46576
  this.colors = this.config.colors;