@harbour-enterprises/superdoc 0.15.5-next.2 → 0.15.5-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.
@@ -26636,6 +26636,9 @@ function translateFieldAnnotation(params2) {
26636
26636
  if (!annotationHandler) return {};
26637
26637
  let processedNode;
26638
26638
  let sdtContentElements;
26639
+ if ((attrs.type === "image" || attrs.type === "signature") && !attrs.hash) {
26640
+ attrs.hash = generateDocxRandomId(4);
26641
+ }
26639
26642
  if (isFinalDoc) {
26640
26643
  return annotationHandler(params2);
26641
26644
  } else {
@@ -26657,7 +26660,8 @@ function translateFieldAnnotation(params2) {
26657
26660
  fieldFontFamily: attrs.fontFamily,
26658
26661
  fieldFontSize: attrs.fontSize,
26659
26662
  fieldTextColor: attrs.textColor,
26660
- fieldTextHighlight: attrs.textHighlight
26663
+ fieldTextHighlight: attrs.textHighlight,
26664
+ hash: attrs.hash
26661
26665
  };
26662
26666
  const annotationAttrsJson = JSON.stringify(annotationAttrs);
26663
26667
  const result = {
@@ -27725,7 +27729,8 @@ const handleAnnotationNode = (params2) => {
27725
27729
  fontFamily: parsedAttrs.fieldFontFamily,
27726
27730
  fontSize: parsedAttrs.fieldFontSize,
27727
27731
  textColor: parsedAttrs.fieldTextColor,
27728
- textHighlight: parsedAttrs.fieldTextHighlight
27732
+ textHighlight: parsedAttrs.fieldTextHighlight,
27733
+ hash: parsedAttrs.hash
27729
27734
  };
27730
27735
  attrs = attrsFromJSON;
27731
27736
  } else {
@@ -27734,7 +27739,7 @@ const handleAnnotationNode = (params2) => {
27734
27739
  }
27735
27740
  const { attrs: marksAsAttrs, marks } = parseAnnotationMarks(sdtContent);
27736
27741
  const allAttrs = { ...attrs, ...marksAsAttrs };
27737
- allAttrs.hash = generateDocxRandomId(4);
27742
+ if (!allAttrs.hash) allAttrs.hash = generateDocxRandomId(4);
27738
27743
  if (!attrs.fieldId || !attrs.displayLabel) {
27739
27744
  return { nodes: [], consumed: 0 };
27740
27745
  }
@@ -28778,7 +28783,7 @@ const _SuperConverter = class _SuperConverter2 {
28778
28783
  return;
28779
28784
  }
28780
28785
  }
28781
- static updateDocumentVersion(docx = this.convertedXml, version2 = "0.15.5-next.2") {
28786
+ static updateDocumentVersion(docx = this.convertedXml, version2 = "0.15.5-next.3") {
28782
28787
  const customLocation = "docProps/custom.xml";
28783
28788
  if (!docx[customLocation]) {
28784
28789
  docx[customLocation] = generateCustomXml();
@@ -29173,7 +29178,7 @@ exportProcessNewRelationships_fn = function(rels = []) {
29173
29178
  exportProcessMediaFiles_fn = async function(media, editor) {
29174
29179
  const processedData = {};
29175
29180
  for (const filePath in media) {
29176
- if (typeof media[filePath] !== "string") return;
29181
+ if (typeof media[filePath] !== "string") continue;
29177
29182
  const name = filePath.split("/").pop();
29178
29183
  processedData[name] = await getArrayBufferFromUrl(media[filePath], editor.options.isHeadless);
29179
29184
  }
@@ -29257,7 +29262,7 @@ function storeSuperdocVersion(docx) {
29257
29262
  function generateCustomXml() {
29258
29263
  return DEFAULT_CUSTOM_XML;
29259
29264
  }
29260
- function generateSuperdocVersion(pid = 2, version2 = "0.15.5-next.2") {
29265
+ function generateSuperdocVersion(pid = 2, version2 = "0.15.5-next.3") {
29261
29266
  return {
29262
29267
  type: "element",
29263
29268
  name: "property",
@@ -45440,7 +45445,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
45440
45445
  * @returns {Object | void} Migration results
45441
45446
  */
45442
45447
  processCollaborationMigrations() {
45443
- console.debug("[checkVersionMigrations] Current editor version", "0.15.5-next.2");
45448
+ console.debug("[checkVersionMigrations] Current editor version", "0.15.5-next.3");
45444
45449
  if (!this.options.ydoc) return;
45445
45450
  const metaMap = this.options.ydoc.getMap("meta");
45446
45451
  let docVersion = metaMap.get("version");
@@ -52416,12 +52421,12 @@ const FieldAnnotation = Node$1.create({
52416
52421
  currentMarks = currentMarks.length ? [...currentMarks] : null;
52417
52422
  let formatAttrs = getFormatAttrsFromMarks(currentMarks);
52418
52423
  let defaultDisplayLabel = attrs.defaultDisplayLabel ? attrs.defaultDisplayLabel : attrs.displayLabel || "";
52419
- attrs.hash = generateDocxRandomId(4);
52420
52424
  let node2 = schema.nodes[this.name].create(
52421
52425
  {
52422
52426
  ...attrs,
52423
52427
  ...formatAttrs,
52424
- defaultDisplayLabel
52428
+ defaultDisplayLabel,
52429
+ hash: attrs.hash || generateDocxRandomId(4)
52425
52430
  },
52426
52431
  null,
52427
52432
  null
@@ -52462,7 +52467,8 @@ const FieldAnnotation = Node$1.create({
52462
52467
  let node2 = schema.nodes[this.name].create(
52463
52468
  {
52464
52469
  ...attrs,
52465
- defaultDisplayLabel
52470
+ defaultDisplayLabel,
52471
+ hash: attrs.hash || generateDocxRandomId(4)
52466
52472
  },
52467
52473
  null,
52468
52474
  null
@@ -52546,7 +52552,8 @@ const FieldAnnotation = Node$1.create({
52546
52552
  // reset attrs for specific types.
52547
52553
  imageSrc: null,
52548
52554
  rawHtml: null,
52549
- linkUrl: null
52555
+ linkUrl: null,
52556
+ hash: null
52550
52557
  });
52551
52558
  }
52552
52559
  });
@@ -26653,6 +26653,9 @@ function translateFieldAnnotation(params2) {
26653
26653
  if (!annotationHandler) return {};
26654
26654
  let processedNode;
26655
26655
  let sdtContentElements;
26656
+ if ((attrs.type === "image" || attrs.type === "signature") && !attrs.hash) {
26657
+ attrs.hash = generateDocxRandomId(4);
26658
+ }
26656
26659
  if (isFinalDoc) {
26657
26660
  return annotationHandler(params2);
26658
26661
  } else {
@@ -26674,7 +26677,8 @@ function translateFieldAnnotation(params2) {
26674
26677
  fieldFontFamily: attrs.fontFamily,
26675
26678
  fieldFontSize: attrs.fontSize,
26676
26679
  fieldTextColor: attrs.textColor,
26677
- fieldTextHighlight: attrs.textHighlight
26680
+ fieldTextHighlight: attrs.textHighlight,
26681
+ hash: attrs.hash
26678
26682
  };
26679
26683
  const annotationAttrsJson = JSON.stringify(annotationAttrs);
26680
26684
  const result = {
@@ -27742,7 +27746,8 @@ const handleAnnotationNode = (params2) => {
27742
27746
  fontFamily: parsedAttrs.fieldFontFamily,
27743
27747
  fontSize: parsedAttrs.fieldFontSize,
27744
27748
  textColor: parsedAttrs.fieldTextColor,
27745
- textHighlight: parsedAttrs.fieldTextHighlight
27749
+ textHighlight: parsedAttrs.fieldTextHighlight,
27750
+ hash: parsedAttrs.hash
27746
27751
  };
27747
27752
  attrs = attrsFromJSON;
27748
27753
  } else {
@@ -27751,7 +27756,7 @@ const handleAnnotationNode = (params2) => {
27751
27756
  }
27752
27757
  const { attrs: marksAsAttrs, marks } = parseAnnotationMarks(sdtContent);
27753
27758
  const allAttrs = { ...attrs, ...marksAsAttrs };
27754
- allAttrs.hash = generateDocxRandomId(4);
27759
+ if (!allAttrs.hash) allAttrs.hash = generateDocxRandomId(4);
27755
27760
  if (!attrs.fieldId || !attrs.displayLabel) {
27756
27761
  return { nodes: [], consumed: 0 };
27757
27762
  }
@@ -28795,7 +28800,7 @@ const _SuperConverter = class _SuperConverter2 {
28795
28800
  return;
28796
28801
  }
28797
28802
  }
28798
- static updateDocumentVersion(docx = this.convertedXml, version2 = "0.15.5-next.2") {
28803
+ static updateDocumentVersion(docx = this.convertedXml, version2 = "0.15.5-next.3") {
28799
28804
  const customLocation = "docProps/custom.xml";
28800
28805
  if (!docx[customLocation]) {
28801
28806
  docx[customLocation] = generateCustomXml();
@@ -29190,7 +29195,7 @@ exportProcessNewRelationships_fn = function(rels = []) {
29190
29195
  exportProcessMediaFiles_fn = async function(media, editor) {
29191
29196
  const processedData = {};
29192
29197
  for (const filePath in media) {
29193
- if (typeof media[filePath] !== "string") return;
29198
+ if (typeof media[filePath] !== "string") continue;
29194
29199
  const name = filePath.split("/").pop();
29195
29200
  processedData[name] = await getArrayBufferFromUrl(media[filePath], editor.options.isHeadless);
29196
29201
  }
@@ -29274,7 +29279,7 @@ function storeSuperdocVersion(docx) {
29274
29279
  function generateCustomXml() {
29275
29280
  return DEFAULT_CUSTOM_XML;
29276
29281
  }
29277
- function generateSuperdocVersion(pid = 2, version2 = "0.15.5-next.2") {
29282
+ function generateSuperdocVersion(pid = 2, version2 = "0.15.5-next.3") {
29278
29283
  return {
29279
29284
  type: "element",
29280
29285
  name: "property",
@@ -45457,7 +45462,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
45457
45462
  * @returns {Object | void} Migration results
45458
45463
  */
45459
45464
  processCollaborationMigrations() {
45460
- console.debug("[checkVersionMigrations] Current editor version", "0.15.5-next.2");
45465
+ console.debug("[checkVersionMigrations] Current editor version", "0.15.5-next.3");
45461
45466
  if (!this.options.ydoc) return;
45462
45467
  const metaMap = this.options.ydoc.getMap("meta");
45463
45468
  let docVersion = metaMap.get("version");
@@ -52433,12 +52438,12 @@ const FieldAnnotation = Node$1.create({
52433
52438
  currentMarks = currentMarks.length ? [...currentMarks] : null;
52434
52439
  let formatAttrs = getFormatAttrsFromMarks(currentMarks);
52435
52440
  let defaultDisplayLabel = attrs.defaultDisplayLabel ? attrs.defaultDisplayLabel : attrs.displayLabel || "";
52436
- attrs.hash = generateDocxRandomId(4);
52437
52441
  let node2 = schema.nodes[this.name].create(
52438
52442
  {
52439
52443
  ...attrs,
52440
52444
  ...formatAttrs,
52441
- defaultDisplayLabel
52445
+ defaultDisplayLabel,
52446
+ hash: attrs.hash || generateDocxRandomId(4)
52442
52447
  },
52443
52448
  null,
52444
52449
  null
@@ -52479,7 +52484,8 @@ const FieldAnnotation = Node$1.create({
52479
52484
  let node2 = schema.nodes[this.name].create(
52480
52485
  {
52481
52486
  ...attrs,
52482
- defaultDisplayLabel
52487
+ defaultDisplayLabel,
52488
+ hash: attrs.hash || generateDocxRandomId(4)
52483
52489
  },
52484
52490
  null,
52485
52491
  null
@@ -52563,7 +52569,8 @@ const FieldAnnotation = Node$1.create({
52563
52569
  // reset attrs for specific types.
52564
52570
  imageSrc: null,
52565
52571
  rawHtml: null,
52566
- linkUrl: null
52572
+ linkUrl: null,
52573
+ hash: null
52567
52574
  });
52568
52575
  }
52569
52576
  });
@@ -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-CE735VKL.js";
3
- import { _ as _export_sfc } from "./chunks/editor-DPbOzyDd.js";
2
+ import { T as TextSelection } from "./chunks/converter-BZrVpwZe.js";
3
+ import { _ as _export_sfc } from "./chunks/editor-D4DHvC_L.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 = {}) {
@@ -26634,6 +26634,9 @@ function translateFieldAnnotation(params) {
26634
26634
  if (!annotationHandler) return {};
26635
26635
  let processedNode;
26636
26636
  let sdtContentElements;
26637
+ if ((attrs.type === "image" || attrs.type === "signature") && !attrs.hash) {
26638
+ attrs.hash = generateDocxRandomId(4);
26639
+ }
26637
26640
  if (isFinalDoc) {
26638
26641
  return annotationHandler(params);
26639
26642
  } else {
@@ -26655,7 +26658,8 @@ function translateFieldAnnotation(params) {
26655
26658
  fieldFontFamily: attrs.fontFamily,
26656
26659
  fieldFontSize: attrs.fontSize,
26657
26660
  fieldTextColor: attrs.textColor,
26658
- fieldTextHighlight: attrs.textHighlight
26661
+ fieldTextHighlight: attrs.textHighlight,
26662
+ hash: attrs.hash
26659
26663
  };
26660
26664
  const annotationAttrsJson = JSON.stringify(annotationAttrs);
26661
26665
  const result = {
@@ -27723,7 +27727,8 @@ const handleAnnotationNode = (params) => {
27723
27727
  fontFamily: parsedAttrs.fieldFontFamily,
27724
27728
  fontSize: parsedAttrs.fieldFontSize,
27725
27729
  textColor: parsedAttrs.fieldTextColor,
27726
- textHighlight: parsedAttrs.fieldTextHighlight
27730
+ textHighlight: parsedAttrs.fieldTextHighlight,
27731
+ hash: parsedAttrs.hash
27727
27732
  };
27728
27733
  attrs = attrsFromJSON;
27729
27734
  } else {
@@ -27732,7 +27737,7 @@ const handleAnnotationNode = (params) => {
27732
27737
  }
27733
27738
  const { attrs: marksAsAttrs, marks } = parseAnnotationMarks(sdtContent);
27734
27739
  const allAttrs = { ...attrs, ...marksAsAttrs };
27735
- allAttrs.hash = generateDocxRandomId(4);
27740
+ if (!allAttrs.hash) allAttrs.hash = generateDocxRandomId(4);
27736
27741
  if (!attrs.fieldId || !attrs.displayLabel) {
27737
27742
  return { nodes: [], consumed: 0 };
27738
27743
  }
@@ -28776,7 +28781,7 @@ const _SuperConverter = class _SuperConverter {
28776
28781
  return;
28777
28782
  }
28778
28783
  }
28779
- static updateDocumentVersion(docx = this.convertedXml, version = "0.15.5-next.2") {
28784
+ static updateDocumentVersion(docx = this.convertedXml, version = "0.15.5-next.3") {
28780
28785
  const customLocation = "docProps/custom.xml";
28781
28786
  if (!docx[customLocation]) {
28782
28787
  docx[customLocation] = generateCustomXml();
@@ -29174,7 +29179,7 @@ exportProcessNewRelationships_fn = function(rels = []) {
29174
29179
  exportProcessMediaFiles_fn = async function(media, editor) {
29175
29180
  const processedData = {};
29176
29181
  for (const filePath in media) {
29177
- if (typeof media[filePath] !== "string") return;
29182
+ if (typeof media[filePath] !== "string") continue;
29178
29183
  const name = filePath.split("/").pop();
29179
29184
  processedData[name] = await getArrayBufferFromUrl(media[filePath], editor.options.isHeadless);
29180
29185
  }
@@ -29258,7 +29263,7 @@ function storeSuperdocVersion(docx) {
29258
29263
  function generateCustomXml() {
29259
29264
  return DEFAULT_CUSTOM_XML;
29260
29265
  }
29261
- function generateSuperdocVersion(pid = 2, version = "0.15.5-next.2") {
29266
+ function generateSuperdocVersion(pid = 2, version = "0.15.5-next.3") {
29262
29267
  return {
29263
29268
  type: "element",
29264
29269
  name: "property",
@@ -1,4 +1,4 @@
1
- import { H as process$1, at as commonjsGlobal, I as Buffer, au as getDefaultExportFromCjs, av as getContentTypesFromXml, aw as xmljs } from "./converter-CE735VKL.js";
1
+ import { H as process$1, at as commonjsGlobal, I as Buffer, au as getDefaultExportFromCjs, av as getContentTypesFromXml, aw as xmljs } from "./converter-BZrVpwZe.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, dispatchTransaction_fn, handleNodeSelection_fn, prepareDocumentForImport_fn, prepareDocumentForExport_fn, endCollaboration_fn, _ListItemNodeView_instances, init_fn2, _FieldAnnotationView_instances, createAnnotation_fn, _AutoPageNumberNodeView_instances, renderDom_fn, scheduleUpdateNodeStyle_fn, _DocumentSectionView_instances, init_fn3, addToolTip_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, g as getExtensionConfigField, b as getMarkType, d as getMarksFromSelection, e as getNodeType, f as getSchemaTypeNameByName, S as Schema$1, h as cleanSchemaItem, T as TextSelection, i as canSplit, l as liftTarget, A as AllSelection, j as canJoin, k as joinPoint, N as NodeSelection, m as Selection, r as replaceStep$1, F as Fragment, R as ReplaceAroundStep$1, n as Slice, o as defaultBlockAt$1, p as isTextSelection, q as getMarkRange, s as isMarkActive, t as isNodeActive, u as deleteProps, D as DOMParser$1, v as ReplaceStep, w as NodeRange, x as findWrapping, y as findParentNode, L as ListHelpers, z as isMacOS, B as isIOS, C as DOMSerializer, E as Mark$1, G as dropPoint, H as process$1, I as Buffer2, J as getSchemaTypeByName, K as inputRulesPlugin, O as TrackDeleteMarkName, Q as TrackInsertMarkName, U as v4, V as TrackFormatMarkName, W as comments_module_events, X as findMark, Y as objectIncludes, Z as AddMarkStep, _ as RemoveMarkStep, $ as twipsToLines, a0 as pixelsToTwips, a1 as findParentNodeClosestToPos, a2 as helpers, a3 as posToDOMRect, a4 as CommandService, a5 as SuperConverter, a6 as createDocument, a7 as EditorState, a8 as hasSomeParentWithClass, a9 as isActive, aa as unflattenListsInHtml, ab as parseSizeUnit, ac as minMax, ad as getLineHeightValueString, ae as InputRule, af as kebabCase, ag as generateOrderedListIndex, ah as getListItemStyleDefinitions, ai as docxNumberigHelpers, aj as parseIndentElement, ak as combineIndents, al as getColStyleDeclaration, am as SelectionRange, an as Transform, ao as isInTable$1, ap as createColGroup, aq as generateDocxRandomId, ar as SectionHelpers, as as htmlHandler } from "./converter-CE735VKL.js";
15
+ import { P as PluginKey, a as Plugin, M as Mapping, c as callOrGet, g as getExtensionConfigField, b as getMarkType, d as getMarksFromSelection, e as getNodeType, f as getSchemaTypeNameByName, S as Schema$1, h as cleanSchemaItem, T as TextSelection, i as canSplit, l as liftTarget, A as AllSelection, j as canJoin, k as joinPoint, N as NodeSelection, m as Selection, r as replaceStep$1, F as Fragment, R as ReplaceAroundStep$1, n as Slice, o as defaultBlockAt$1, p as isTextSelection, q as getMarkRange, s as isMarkActive, t as isNodeActive, u as deleteProps, D as DOMParser$1, v as ReplaceStep, w as NodeRange, x as findWrapping, y as findParentNode, L as ListHelpers, z as isMacOS, B as isIOS, C as DOMSerializer, E as Mark$1, G as dropPoint, H as process$1, I as Buffer2, J as getSchemaTypeByName, K as inputRulesPlugin, O as TrackDeleteMarkName, Q as TrackInsertMarkName, U as v4, V as TrackFormatMarkName, W as comments_module_events, X as findMark, Y as objectIncludes, Z as AddMarkStep, _ as RemoveMarkStep, $ as twipsToLines, a0 as pixelsToTwips, a1 as findParentNodeClosestToPos, a2 as helpers, a3 as posToDOMRect, a4 as CommandService, a5 as SuperConverter, a6 as createDocument, a7 as EditorState, a8 as hasSomeParentWithClass, a9 as isActive, aa as unflattenListsInHtml, ab as parseSizeUnit, ac as minMax, ad as getLineHeightValueString, ae as InputRule, af as kebabCase, ag as generateOrderedListIndex, ah as getListItemStyleDefinitions, ai as docxNumberigHelpers, aj as parseIndentElement, ak as combineIndents, al as getColStyleDeclaration, am as SelectionRange, an as Transform, ao as isInTable$1, ap as createColGroup, aq as generateDocxRandomId, ar as SectionHelpers, as as htmlHandler } from "./converter-BZrVpwZe.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-BkMHQVwL.js";
17
+ import { D as DocxZipper } from "./docx-zipper-Bir25vwA.js";
18
18
  var GOOD_LEAF_SIZE = 200;
19
19
  var RopeSequence = function RopeSequence2() {
20
20
  };
@@ -13685,7 +13685,7 @@ const _Editor = class _Editor extends EventEmitter {
13685
13685
  * @returns {Object | void} Migration results
13686
13686
  */
13687
13687
  processCollaborationMigrations() {
13688
- console.debug("[checkVersionMigrations] Current editor version", "0.15.5-next.2");
13688
+ console.debug("[checkVersionMigrations] Current editor version", "0.15.5-next.3");
13689
13689
  if (!this.options.ydoc) return;
13690
13690
  const metaMap = this.options.ydoc.getMap("meta");
13691
13691
  let docVersion = metaMap.get("version");
@@ -20798,12 +20798,12 @@ const FieldAnnotation = Node$1.create({
20798
20798
  currentMarks = currentMarks.length ? [...currentMarks] : null;
20799
20799
  let formatAttrs = getFormatAttrsFromMarks(currentMarks);
20800
20800
  let defaultDisplayLabel = attrs.defaultDisplayLabel ? attrs.defaultDisplayLabel : attrs.displayLabel || "";
20801
- attrs.hash = generateDocxRandomId(4);
20802
20801
  let node = schema.nodes[this.name].create(
20803
20802
  {
20804
20803
  ...attrs,
20805
20804
  ...formatAttrs,
20806
- defaultDisplayLabel
20805
+ defaultDisplayLabel,
20806
+ hash: attrs.hash || generateDocxRandomId(4)
20807
20807
  },
20808
20808
  null,
20809
20809
  null
@@ -20844,7 +20844,8 @@ const FieldAnnotation = Node$1.create({
20844
20844
  let node = schema.nodes[this.name].create(
20845
20845
  {
20846
20846
  ...attrs,
20847
- defaultDisplayLabel
20847
+ defaultDisplayLabel,
20848
+ hash: attrs.hash || generateDocxRandomId(4)
20848
20849
  },
20849
20850
  null,
20850
20851
  null
@@ -20928,7 +20929,8 @@ const FieldAnnotation = Node$1.create({
20928
20929
  // reset attrs for specific types.
20929
20930
  imageSrc: null,
20930
20931
  rawHtml: null,
20931
- linkUrl: null
20932
+ linkUrl: null,
20933
+ hash: null
20932
20934
  });
20933
20935
  }
20934
20936
  });
@@ -1,6 +1,6 @@
1
1
  import { computed, createElementBlock, openBlock, createElementVNode, createCommentVNode, normalizeClass, normalizeStyle, ref, withKeys, unref, withModifiers, createBlock, toDisplayString, withDirectives, vModelText, nextTick, getCurrentInstance, createVNode, readonly, watch, onMounted, onBeforeUnmount, reactive, onBeforeMount, inject, onActivated, onDeactivated, createTextVNode, Fragment, Comment, defineComponent, provide, h, Teleport, toRef, renderSlot, isVNode, shallowRef, watchEffect, mergeProps, Transition, vShow, cloneVNode, Text, renderList, withCtx } from "vue";
2
- import { H as process$1 } from "./converter-CE735VKL.js";
3
- import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-DPbOzyDd.js";
2
+ import { H as process$1 } from "./converter-BZrVpwZe.js";
3
+ import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-D4DHvC_L.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 { a5 } from "./chunks/converter-CE735VKL.js";
1
+ import { a5 } from "./chunks/converter-BZrVpwZe.js";
2
2
  export {
3
3
  a5 as SuperConverter
4
4
  };
@@ -1 +1 @@
1
- {"version":3,"file":"exporter.d.ts","sourceRoot":"","sources":["../../../src/core/super-converter/exporter.js"],"names":[],"mappings":"AA0BA;;;;;GAKG;AAEH;;;;;;;;;;;;GAYG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;;GAIG;AAEH;;;;;GAKG;AACH,2CAHW,YAAY,GACV,YAAY,CAyCxB;AA+DD;;;;;GAKG;AACH,qDAFa,YAAY,CA2BxB;AA6lED;;;;;;;;;EAgBC;AAyFD;IACE,4BAEC;IADC,eAA0B;IAG5B,gDAGC;;CAsEF;;;;;;;;;;;;;mBAh8Ea,KAAQ;;;;;;UAKR,MAAM;;;;aACN,KAAK,CAAC,UAAU,CAAC;;;;;;;;;;;;;UAMjB,MAAM;;;;cACN,KAAK,CAAC,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;UAgBnB,MAAM"}
1
+ {"version":3,"file":"exporter.d.ts","sourceRoot":"","sources":["../../../src/core/super-converter/exporter.js"],"names":[],"mappings":"AA0BA;;;;;GAKG;AAEH;;;;;;;;;;;;GAYG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;;GAIG;AAEH;;;;;GAKG;AACH,2CAHW,YAAY,GACV,YAAY,CAyCxB;AA+DD;;;;;GAKG;AACH,qDAFa,YAAY,CA2BxB;AAkmED;;;;;;;;;EAgBC;AAyFD;IACE,4BAEC;IADC,eAA0B;IAG5B,gDAGC;;CAsEF;;;;;;;;;;;;;mBAr8Ea,KAAQ;;;;;;UAKR,MAAM;;;;aACN,KAAK,CAAC,UAAU,CAAC;;;;;;;;;;;;;UAMjB,MAAM;;;;cACN,KAAK,CAAC,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;UAgBnB,MAAM"}
@@ -1 +1 @@
1
- {"version":3,"file":"annotationImporter.d.ts","sourceRoot":"","sources":["../../../../../src/core/super-converter/v2/importer/annotationImporter.js"],"names":[],"mappings":"AAIA;;GAEG;AACH,uCAsEE;AAOK,yDA2CN;AAoCD;;GAEG;AACH,8CAGE"}
1
+ {"version":3,"file":"annotationImporter.d.ts","sourceRoot":"","sources":["../../../../../src/core/super-converter/v2/importer/annotationImporter.js"],"names":[],"mappings":"AAIA;;GAEG;AACH,uCAuEE;AAOK,yDA2CN;AAoCD;;GAEG;AACH,8CAGE"}
@@ -1,5 +1,5 @@
1
- import "./chunks/converter-CE735VKL.js";
2
- import { D } from "./chunks/docx-zipper-BkMHQVwL.js";
1
+ import "./chunks/converter-BZrVpwZe.js";
2
+ import { D } from "./chunks/docx-zipper-Bir25vwA.js";
3
3
  export {
4
4
  D as default
5
5
  };
@@ -1,6 +1,6 @@
1
- import { E } from "./chunks/editor-DPbOzyDd.js";
2
- import "./chunks/converter-CE735VKL.js";
3
- import "./chunks/docx-zipper-BkMHQVwL.js";
1
+ import { E } from "./chunks/editor-D4DHvC_L.js";
2
+ import "./chunks/converter-BZrVpwZe.js";
3
+ import "./chunks/docx-zipper-Bir25vwA.js";
4
4
  export {
5
5
  E as Editor
6
6
  };
@@ -1 +1 @@
1
- {"version":3,"file":"field-annotation.d.ts","sourceRoot":"","sources":["../../../src/extensions/field-annotation/field-annotation.js"],"names":[],"mappings":"AAaA,kCAAmC,iBAAiB,CAAC;AACrD,8BAA+B,YAAY,CAAC;AAC5C,qCAAsC,oBAAoB,CAAC;AAE3D,kCAomCG"}
1
+ {"version":3,"file":"field-annotation.d.ts","sourceRoot":"","sources":["../../../src/extensions/field-annotation/field-annotation.js"],"names":[],"mappings":"AAaA,kCAAmC,iBAAiB,CAAC;AACrD,8BAA+B,YAAY,CAAC;AAC5C,qCAAsC,oBAAoB,CAAC;AAE3D,kCAqmCG"}
@@ -1,4 +1,4 @@
1
- import { J as JSZip } from "./chunks/docx-zipper-BkMHQVwL.js";
1
+ import { J as JSZip } from "./chunks/docx-zipper-Bir25vwA.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 { au as getDefaultExportFromCjs, U as v4, T as TextSelection$1, q as getMarkRange, ax as vClickOutside, y as findParentNode, ay as getActiveFormatting, ao as isInTable, az as readFromClipboard, aA as handleClipboardPaste, a as Plugin } from "./chunks/converter-CE735VKL.js";
13
- import { ar, a5, d, a2 } from "./chunks/converter-CE735VKL.js";
14
- import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, c as getFileOpener, s as startImageUpload, y as yUndoPluginKey, d as undoDepth, r as redoDepth, S as SlashMenuPluginKey, E as Editor, e as getStarterExtensions, P as Placeholder, f as getRichTextExtensions, M as Mark, h as Extension, A as Attribute, N as Node } from "./chunks/editor-DPbOzyDd.js";
15
- import { k, C, T, i, l, j } from "./chunks/editor-DPbOzyDd.js";
12
+ import { au as getDefaultExportFromCjs, U as v4, T as TextSelection$1, q as getMarkRange, ax as vClickOutside, y as findParentNode, ay as getActiveFormatting, ao as isInTable, az as readFromClipboard, aA as handleClipboardPaste, a as Plugin } from "./chunks/converter-BZrVpwZe.js";
13
+ import { ar, a5, d, a2 } from "./chunks/converter-BZrVpwZe.js";
14
+ import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, c as getFileOpener, s as startImageUpload, y as yUndoPluginKey, d as undoDepth, r as redoDepth, S as SlashMenuPluginKey, E as Editor, e as getStarterExtensions, P as Placeholder, f as getRichTextExtensions, M as Mark, h as Extension, A as Attribute, N as Node } from "./chunks/editor-D4DHvC_L.js";
15
+ import { k, C, T, i, l, j } from "./chunks/editor-D4DHvC_L.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, reactive, onUnmounted, renderSlot, shallowRef, createBlock, withCtx, resolveDynamicComponent, normalizeProps, guardReactiveProps } from "vue";
17
- import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, m as magicWandIcon, p as plusIconSvg, a as trashIconSvg, l as linkIconSvg, b as tableIconSvg, c as scissorsIconSvg, d as copyIconSvg, e as pasteIconSvg, f as borderNoneIconSvg, g as arrowsToDotIconSvg, h as arrowsLeftRightIconSvg, w as wrenchIconSvg, N as NSkeleton } from "./chunks/toolbar-B3yMPU4P.js";
17
+ import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, m as magicWandIcon, p as plusIconSvg, a as trashIconSvg, l as linkIconSvg, b as tableIconSvg, c as scissorsIconSvg, d as copyIconSvg, e as pasteIconSvg, f as borderNoneIconSvg, g as arrowsToDotIconSvg, h as arrowsLeftRightIconSvg, w as wrenchIconSvg, N as NSkeleton } from "./chunks/toolbar-BUw87QWg.js";
18
18
  import AIWriter from "./ai-writer.es.js";
19
- import { D } from "./chunks/docx-zipper-BkMHQVwL.js";
19
+ import { D } from "./chunks/docx-zipper-Bir25vwA.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-B3yMPU4P.js";
3
- import "./chunks/editor-DPbOzyDd.js";
2
+ import { T } from "./chunks/toolbar-BUw87QWg.js";
3
+ import "./chunks/editor-D4DHvC_L.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-Bdf_jgkg.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-Cspq0ug1.cjs");
4
4
  require("./chunks/vue-CfKg12kH.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, q } from "./chunks/super-editor.es-DyA8_U6m.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, q } from "./chunks/super-editor.es-BEKNKiXM.es.js";
2
2
  import "./chunks/vue-B_OPNNfX.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-Bdf_jgkg.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-Cspq0ug1.cjs");
4
4
  const vue = require("./chunks/vue-CfKg12kH.cjs");
5
5
  const jszip = require("./chunks/jszip-DWfnW2xV.cjs");
6
6
  const blankDocx = require("./chunks/blank-docx-CPqX9RF5.cjs");
@@ -47833,7 +47833,7 @@ class SuperDoc extends eventemitter3.EventEmitter {
47833
47833
  this.config.colors = shuffleArray(this.config.colors);
47834
47834
  this.userColorMap = /* @__PURE__ */ new Map();
47835
47835
  this.colorIndex = 0;
47836
- this.version = "0.15.5-next.2";
47836
+ this.version = "0.15.5-next.3";
47837
47837
  console.debug("🦋 [superdoc] Using SuperDoc version:", this.version);
47838
47838
  this.superdocId = config.superdocId || uuid.v4();
47839
47839
  this.colors = this.config.colors;
@@ -1,5 +1,5 @@
1
- import { q as index$1, C as CommentsPluginKey, h as TrackChangesBasePluginKey, E as Editor, n as getRichTextExtensions, f as SuperInput, e as SuperEditor, A as AIWriter, g as SuperToolbar, i as createZip } from "./chunks/super-editor.es-DyA8_U6m.es.js";
2
- import { a, S, d, j, p } from "./chunks/super-editor.es-DyA8_U6m.es.js";
1
+ import { q as index$1, C as CommentsPluginKey, h as TrackChangesBasePluginKey, E as Editor, n as getRichTextExtensions, f as SuperInput, e as SuperEditor, A as AIWriter, g as SuperToolbar, i as createZip } from "./chunks/super-editor.es-BEKNKiXM.es.js";
2
+ import { a, S, d, j, p } from "./chunks/super-editor.es-BEKNKiXM.es.js";
3
3
  import { a0 as effectScope, r as ref, $ as markRaw, p as process$1, a1 as toRaw, a as computed, a2 as isRef, a3 as isReactive, D as toRef, i as inject, q as getCurrentInstance, l as watch, y as unref, a4 as hasInjectionContext, N as reactive, u as nextTick, a5 as getCurrentScope, a6 as onScopeDispose, a7 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, a8 as resolveDirective, d as renderList, c as createApp, X as onUnmounted, Y as resolveDynamicComponent } from "./chunks/vue-B_OPNNfX.es.js";
4
4
  import { B as Buffer$2 } from "./chunks/jszip-BwJb6_S5.es.js";
5
5
  import { B as BlankDOCX } from "./chunks/blank-docx-iwdyG9RH.es.js";
@@ -47816,7 +47816,7 @@ class SuperDoc extends EventEmitter {
47816
47816
  this.config.colors = shuffleArray(this.config.colors);
47817
47817
  this.userColorMap = /* @__PURE__ */ new Map();
47818
47818
  this.colorIndex = 0;
47819
- this.version = "0.15.5-next.2";
47819
+ this.version = "0.15.5-next.3";
47820
47820
  console.debug("🦋 [superdoc] Using SuperDoc version:", this.version);
47821
47821
  this.superdocId = config.superdocId || v4();
47822
47822
  this.colors = this.config.colors;
@@ -34031,6 +34031,9 @@
34031
34031
  if (!annotationHandler) return {};
34032
34032
  let processedNode;
34033
34033
  let sdtContentElements;
34034
+ if ((attrs.type === "image" || attrs.type === "signature") && !attrs.hash) {
34035
+ attrs.hash = generateDocxRandomId(4);
34036
+ }
34034
34037
  if (isFinalDoc) {
34035
34038
  return annotationHandler(params2);
34036
34039
  } else {
@@ -34052,7 +34055,8 @@
34052
34055
  fieldFontFamily: attrs.fontFamily,
34053
34056
  fieldFontSize: attrs.fontSize,
34054
34057
  fieldTextColor: attrs.textColor,
34055
- fieldTextHighlight: attrs.textHighlight
34058
+ fieldTextHighlight: attrs.textHighlight,
34059
+ hash: attrs.hash
34056
34060
  };
34057
34061
  const annotationAttrsJson = JSON.stringify(annotationAttrs);
34058
34062
  const result = {
@@ -35120,7 +35124,8 @@
35120
35124
  fontFamily: parsedAttrs.fieldFontFamily,
35121
35125
  fontSize: parsedAttrs.fieldFontSize,
35122
35126
  textColor: parsedAttrs.fieldTextColor,
35123
- textHighlight: parsedAttrs.fieldTextHighlight
35127
+ textHighlight: parsedAttrs.fieldTextHighlight,
35128
+ hash: parsedAttrs.hash
35124
35129
  };
35125
35130
  attrs = attrsFromJSON;
35126
35131
  } else {
@@ -35129,7 +35134,7 @@
35129
35134
  }
35130
35135
  const { attrs: marksAsAttrs, marks } = parseAnnotationMarks(sdtContent);
35131
35136
  const allAttrs = { ...attrs, ...marksAsAttrs };
35132
- allAttrs.hash = generateDocxRandomId(4);
35137
+ if (!allAttrs.hash) allAttrs.hash = generateDocxRandomId(4);
35133
35138
  if (!attrs.fieldId || !attrs.displayLabel) {
35134
35139
  return { nodes: [], consumed: 0 };
35135
35140
  }
@@ -36173,7 +36178,7 @@
36173
36178
  return;
36174
36179
  }
36175
36180
  }
36176
- static updateDocumentVersion(docx = this.convertedXml, version2 = "0.15.5-next.2") {
36181
+ static updateDocumentVersion(docx = this.convertedXml, version2 = "0.15.5-next.3") {
36177
36182
  const customLocation = "docProps/custom.xml";
36178
36183
  if (!docx[customLocation]) {
36179
36184
  docx[customLocation] = generateCustomXml();
@@ -36568,7 +36573,7 @@
36568
36573
  exportProcessMediaFiles_fn = async function(media, editor) {
36569
36574
  const processedData = {};
36570
36575
  for (const filePath in media) {
36571
- if (typeof media[filePath] !== "string") return;
36576
+ if (typeof media[filePath] !== "string") continue;
36572
36577
  const name = filePath.split("/").pop();
36573
36578
  processedData[name] = await getArrayBufferFromUrl(media[filePath], editor.options.isHeadless);
36574
36579
  }
@@ -36652,7 +36657,7 @@
36652
36657
  function generateCustomXml() {
36653
36658
  return DEFAULT_CUSTOM_XML;
36654
36659
  }
36655
- function generateSuperdocVersion(pid = 2, version2 = "0.15.5-next.2") {
36660
+ function generateSuperdocVersion(pid = 2, version2 = "0.15.5-next.3") {
36656
36661
  return {
36657
36662
  type: "element",
36658
36663
  name: "property",
@@ -52835,7 +52840,7 @@
52835
52840
  * @returns {Object | void} Migration results
52836
52841
  */
52837
52842
  processCollaborationMigrations() {
52838
- console.debug("[checkVersionMigrations] Current editor version", "0.15.5-next.2");
52843
+ console.debug("[checkVersionMigrations] Current editor version", "0.15.5-next.3");
52839
52844
  if (!this.options.ydoc) return;
52840
52845
  const metaMap = this.options.ydoc.getMap("meta");
52841
52846
  let docVersion = metaMap.get("version");
@@ -59811,12 +59816,12 @@
59811
59816
  currentMarks = currentMarks.length ? [...currentMarks] : null;
59812
59817
  let formatAttrs = getFormatAttrsFromMarks(currentMarks);
59813
59818
  let defaultDisplayLabel = attrs.defaultDisplayLabel ? attrs.defaultDisplayLabel : attrs.displayLabel || "";
59814
- attrs.hash = generateDocxRandomId(4);
59815
59819
  let node2 = schema.nodes[this.name].create(
59816
59820
  {
59817
59821
  ...attrs,
59818
59822
  ...formatAttrs,
59819
- defaultDisplayLabel
59823
+ defaultDisplayLabel,
59824
+ hash: attrs.hash || generateDocxRandomId(4)
59820
59825
  },
59821
59826
  null,
59822
59827
  null
@@ -59857,7 +59862,8 @@
59857
59862
  let node2 = schema.nodes[this.name].create(
59858
59863
  {
59859
59864
  ...attrs,
59860
- defaultDisplayLabel
59865
+ defaultDisplayLabel,
59866
+ hash: attrs.hash || generateDocxRandomId(4)
59861
59867
  },
59862
59868
  null,
59863
59869
  null
@@ -59941,7 +59947,8 @@
59941
59947
  // reset attrs for specific types.
59942
59948
  imageSrc: null,
59943
59949
  rawHtml: null,
59944
- linkUrl: null
59950
+ linkUrl: null,
59951
+ hash: null
59945
59952
  });
59946
59953
  }
59947
59954
  });
@@ -99355,7 +99362,7 @@ ${style2}
99355
99362
  this.config.colors = shuffleArray(this.config.colors);
99356
99363
  this.userColorMap = /* @__PURE__ */ new Map();
99357
99364
  this.colorIndex = 0;
99358
- this.version = "0.15.5-next.2";
99365
+ this.version = "0.15.5-next.3";
99359
99366
  console.debug("🦋 [superdoc] Using SuperDoc version:", this.version);
99360
99367
  this.superdocId = config.superdocId || v4();
99361
99368
  this.colors = this.config.colors;