@harbour-enterprises/superdoc 0.9.9 → 0.9.10

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.
@@ -22052,7 +22052,7 @@ Actual: ` + h3.attribValue
22052
22052
  return;
22053
22053
  }
22054
22054
  }
22055
- static updateDocumentVersion(e = this.convertedXml, t = "0.9.9") {
22055
+ static updateDocumentVersion(e = this.convertedXml, t = "0.9.10") {
22056
22056
  const n = "docProps/custom.xml";
22057
22057
  e[n] || (e[n] = yu$2());
22058
22058
  const i3 = e["docProps/custom.xml"];
@@ -22252,7 +22252,7 @@ Actual: ` + h3.attribValue
22252
22252
  function yu$2() {
22253
22253
  return Tf$2;
22254
22254
  }
22255
- function wu$2(r22 = 2, e = "0.9.9") {
22255
+ function wu$2(r22 = 2, e = "0.9.10") {
22256
22256
  return {
22257
22257
  type: "element",
22258
22258
  name: "property",
@@ -33264,7 +33264,7 @@ Actual: ` + h3.attribValue
33264
33264
  * @returns {Y.Doc | undefined} Updated Y.Doc if any, otherwise undefined
33265
33265
  */
33266
33266
  processCollaborationMigrations() {
33267
- if (console.debug("[checkVersionMigrations] Current editor version", "0.9.9"), !this.options.ydoc) return;
33267
+ if (console.debug("[checkVersionMigrations] Current editor version", "0.9.10"), !this.options.ydoc) return;
33268
33268
  let r = this.options.ydoc.getMap("meta").get("version");
33269
33269
  r || (r = "initial"), console.debug("[checkVersionMigrations] Document version", r);
33270
33270
  const o = Fa$1(r) || [], s = this.state.plugins.find((c3) => c3.key.startsWith("y-sync"));
@@ -52921,6 +52921,8 @@ ${t}
52921
52921
  const getFloatingComments = computed(() => {
52922
52922
  const comments = getGroupedComments.value?.parentComments.filter((c3) => !c3.resolvedTime).filter((c3) => {
52923
52923
  const keys2 = Object.keys(editorCommentPositions.value);
52924
+ const isPdfComment = c3.selection?.source !== "super-editor";
52925
+ if (isPdfComment) return true;
52924
52926
  return keys2.includes(c3.commentId);
52925
52927
  });
52926
52928
  return comments;
@@ -64300,12 +64302,18 @@ ${style2}
64300
64302
  nextTick(() => {
64301
64303
  const id2 = commentId;
64302
64304
  if (renderedSizes.value.some((item) => item.id == id2)) return;
64305
+ const editorBounds = props.parent.getBoundingClientRect();
64303
64306
  const comment = getFloatingComments.value.find((c3) => c3.commentId === id2 || c3.importedId == id2);
64304
- const position = editorCommentPositions.value[id2]?.bounds;
64307
+ let position = editorCommentPositions.value[id2]?.bounds || {};
64308
+ if (props.currentDocument.type === "application/pdf") {
64309
+ Object.entries(comment.selection?.selectionBounds).forEach(([key, value]) => {
64310
+ position[key] = Number(value);
64311
+ });
64312
+ position.top += editorBounds.top;
64313
+ }
64305
64314
  if (!position) return;
64306
64315
  const scrollParent = findScrollParent(props.parent);
64307
64316
  scrollParent === window ? window.scrollY : scrollParent.scrollTop;
64308
- const editorBounds = props.parent.getBoundingClientRect();
64309
64317
  const bounds = elementRef.value?.getBoundingClientRect();
64310
64318
  const placement = {
64311
64319
  id: id2,
@@ -64402,7 +64410,7 @@ ${style2}
64402
64410
  };
64403
64411
  }
64404
64412
  };
64405
- const FloatingComments = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-76d3706b"]]);
64413
+ const FloatingComments = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-e6543c90"]]);
64406
64414
  const _sfc_main$7 = {
64407
64415
  __name: "TextField",
64408
64416
  props: {
@@ -64646,7 +64654,7 @@ ${style2}
64646
64654
  const pageContainer = document.getElementById(`${id2}-page-${page + 1}`);
64647
64655
  if (!pageContainer) return;
64648
64656
  const pageBounds = pageContainer.getBoundingClientRect();
64649
- const pageInfo = doc2.pageContainers.find((p3) => p3.page === page + 1);
64657
+ const pageInfo = doc2.pageContainers.find((p3) => p3.page === page);
64650
64658
  const scale = pageBounds.height / pageInfo.containerBounds.originalHeight;
64651
64659
  const pageBottom = pageBounds.bottom - bounds.top;
64652
64660
  const pageLeft = pageBounds.left - bounds.left;
@@ -64874,6 +64882,7 @@ ${style2}
64874
64882
  if (!proxy.$superdoc.config.collaboration) isReady.value = true;
64875
64883
  }
64876
64884
  isFloatingCommentsReady.value = true;
64885
+ hasInitializedLocations.value = true;
64877
64886
  proxy.$superdoc.broadcastPdfDocumentReady();
64878
64887
  };
64879
64888
  const handleToolClick = (tool) => {
@@ -65304,7 +65313,7 @@ ${style2}
65304
65313
  };
65305
65314
  }
65306
65315
  };
65307
- const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-3731e285"]]);
65316
+ const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-58b14292"]]);
65308
65317
  const createSuperdocVueApp = () => {
65309
65318
  const app = createApp(App);
65310
65319
  const pinia = createPinia();
@@ -65396,7 +65405,7 @@ ${style2}
65396
65405
  this.config.colors = shuffleArray(this.config.colors);
65397
65406
  this.userColorMap = /* @__PURE__ */ new Map();
65398
65407
  this.colorIndex = 0;
65399
- this.version = "0.9.9";
65408
+ this.version = "0.9.10";
65400
65409
  console.debug("🦋 [superdoc] Using SuperDoc version:", this.version);
65401
65410
  this.superdocId = config.superdocId || v4();
65402
65411
  this.colors = this.config.colors;