@harbour-enterprises/superdoc 0.22.0-next.8 → 0.22.0

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 (38) hide show
  1. package/dist/chunks/{PdfViewer-C1tow4Hk.es.js → PdfViewer-BNWaI4WI.es.js} +1 -1
  2. package/dist/chunks/{PdfViewer-BBQm50V3.cjs → PdfViewer-DpkgwUPi.cjs} +1 -1
  3. package/dist/chunks/{index-BkpP-c9A.cjs → index-BbGPYtNy.cjs} +16 -9
  4. package/dist/chunks/{index-CJUwCOxd.es.js → index-DWKEKmiB.es.js} +16 -9
  5. package/dist/chunks/{super-editor.es-Bg0-F_x5.es.js → super-editor.es-BVxfhpAJ.es.js} +1562 -1267
  6. package/dist/chunks/{super-editor.es-D6u8E2n4.cjs → super-editor.es-BoUJEZaF.cjs} +1562 -1267
  7. package/dist/core/types/index.d.ts.map +1 -1
  8. package/dist/stores/comments-store.d.ts +4 -1
  9. package/dist/stores/comments-store.d.ts.map +1 -1
  10. package/dist/style.css +45 -44
  11. package/dist/super-editor/ai-writer.es.js +2 -2
  12. package/dist/super-editor/chunks/{converter-BgedUNCW.js → converter-C-yWLpFM.js} +150 -105
  13. package/dist/super-editor/chunks/{docx-zipper-ByLK3trM.js → docx-zipper-CmGlSUQM.js} +1 -1
  14. package/dist/super-editor/chunks/{editor-M2L6bDyC.js → editor-BBnC1DzI.js} +1532 -1280
  15. package/dist/super-editor/chunks/{toolbar-DsPK5x8a.js → toolbar-QJANo61B.js} +2 -2
  16. package/dist/super-editor/converter.es.js +1 -1
  17. package/dist/super-editor/docx-zipper.es.js +2 -2
  18. package/dist/super-editor/editor.es.js +3 -3
  19. package/dist/super-editor/file-zipper.es.js +1 -1
  20. package/dist/super-editor/src/core/helpers/generateDocxRandomId.d.ts +5 -0
  21. package/dist/super-editor/src/extensions/index.d.ts +2 -1
  22. package/dist/super-editor/src/extensions/structured-content/index.d.ts +1 -0
  23. package/dist/super-editor/src/extensions/structured-content/structured-content-commands.d.ts +67 -0
  24. package/dist/super-editor/src/extensions/structured-content/structuredContentHelpers/getStructuredContentBlockTags.d.ts +6 -0
  25. package/dist/super-editor/src/extensions/structured-content/structuredContentHelpers/getStructuredContentInlineTags.d.ts +6 -0
  26. package/dist/super-editor/src/extensions/structured-content/structuredContentHelpers/getStructuredContentTags.d.ts +6 -0
  27. package/dist/super-editor/src/extensions/structured-content/structuredContentHelpers/getStructuredContentTagsById.d.ts +7 -0
  28. package/dist/super-editor/src/extensions/structured-content/structuredContentHelpers/index.d.ts +4 -0
  29. package/dist/super-editor/style.css +1 -0
  30. package/dist/super-editor/super-editor.es.js +7 -7
  31. package/dist/super-editor/toolbar.es.js +2 -2
  32. package/dist/super-editor.cjs +1 -1
  33. package/dist/super-editor.es.js +1 -1
  34. package/dist/superdoc.cjs +2 -2
  35. package/dist/superdoc.es.js +2 -2
  36. package/dist/superdoc.umd.js +1573 -1271
  37. package/dist/superdoc.umd.js.map +1 -1
  38. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { m as defineComponent, B as h, O as Transition, $ as process$1, I as watchEffect, d as computed, r as ref, j as onMounted, W as onUnmounted, c as createElementBlock, o as openBlock, a as createBaseVNode, f as createCommentVNode, v as createVNode, x as unref } from "./vue-CXxsqYcP.es.js";
2
- import { d as derived, c, a as cB, f as fadeInTransition, b as cM, N as NBaseLoading, w as warnOnce, u as useConfig, e as useTheme, p as pxfy, g as createKey, h as useThemeClass, i as useCompitable, _ as _export_sfc, j as useSuperdocStore, s as storeToRefs, k as useSelection } from "./index-CJUwCOxd.es.js";
2
+ import { d as derived, c, a as cB, f as fadeInTransition, b as cM, N as NBaseLoading, w as warnOnce, u as useConfig, e as useTheme, p as pxfy, g as createKey, h as useThemeClass, i as useCompitable, _ as _export_sfc, j as useSuperdocStore, s as storeToRefs, k as useSelection } from "./index-DWKEKmiB.es.js";
3
3
  function self(vars) {
4
4
  const {
5
5
  opacityDisabled,
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const vue = require("./vue-DWle4Cai.cjs");
4
- const superdoc = require("./index-BkpP-c9A.cjs");
4
+ const superdoc = require("./index-BbGPYtNy.cjs");
5
5
  function self(vars) {
6
6
  const {
7
7
  opacityDisabled,
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const superEditor_es = require("./super-editor.es-D6u8E2n4.cjs");
2
+ const superEditor_es = require("./super-editor.es-BoUJEZaF.cjs");
3
3
  const vue = require("./vue-DWle4Cai.cjs");
4
4
  const jszip = require("./jszip-b7l8QkfH.cjs");
5
5
  const blankDocx = require("./blank-docx-CPqX9RF5.cjs");
@@ -4178,7 +4178,7 @@ const groupChanges = (changes) => {
4178
4178
  const c1 = changes[i];
4179
4179
  const c2 = changes[i + 1];
4180
4180
  const c1Key = markMetaKeys[c1.mark.type.name];
4181
- if (c1 && c2 && c1.to === c2.from) {
4181
+ if (c1 && c2 && c1.to === c2.from && c1.mark.attrs.id === c2.mark.attrs.id) {
4182
4182
  const c2Key = markMetaKeys[c2.mark.type.name];
4183
4183
  grouped.push({
4184
4184
  from: c1.from,
@@ -4223,6 +4223,7 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
4223
4223
  const isCommentsListVisible = vue.ref(false);
4224
4224
  const editorCommentIds = vue.ref([]);
4225
4225
  const editorCommentPositions = vue.ref({});
4226
+ const isCommentHighlighted = vue.ref(false);
4226
4227
  const floatingCommentsOffset = vue.ref(0);
4227
4228
  const sortedConversations = vue.ref([]);
4228
4229
  const visibleConversations = vue.ref([]);
@@ -4501,8 +4502,8 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
4501
4502
  tr.setMeta(superEditor_es.CommentsPluginKey, { type: "forceTrackChanges" });
4502
4503
  tr.setMeta(superEditor_es.TrackChangesBasePluginKey, trackChangesPayload);
4503
4504
  }
4505
+ dispatch(tr);
4504
4506
  });
4505
- dispatch(tr);
4506
4507
  };
4507
4508
  const translateCommentsForExport = () => {
4508
4509
  const processedComments = [];
@@ -4572,6 +4573,7 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
4572
4573
  try {
4573
4574
  const normalizedContent = normalizeCommentForEditor(commentTextJson);
4574
4575
  const schemaContent = Array.isArray(normalizedContent) ? normalizedContent[0] : normalizedContent;
4576
+ if (!schemaContent.content.length) return null;
4575
4577
  const editor = new superEditor_es.Editor({
4576
4578
  mode: "text",
4577
4579
  isHeadless: true,
@@ -4605,6 +4607,7 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
4605
4607
  commentsParentElement,
4606
4608
  editorCommentPositions,
4607
4609
  hasInitializedLocations,
4610
+ isCommentHighlighted,
4608
4611
  // Floating comments
4609
4612
  floatingCommentsOffset,
4610
4613
  sortedConversations,
@@ -16131,7 +16134,8 @@ const _sfc_main$c = {
16131
16134
  currentCommentText,
16132
16135
  isDebugging,
16133
16136
  editingCommentId,
16134
- editorCommentPositions
16137
+ editorCommentPositions,
16138
+ isCommentHighlighted
16135
16139
  } = storeToRefs(commentsStore);
16136
16140
  const { activeZoom } = storeToRefs(superdocStore);
16137
16141
  const isInternal = vue.ref(true);
@@ -16193,13 +16197,14 @@ const _sfc_main$c = {
16193
16197
  "track-format",
16194
16198
  "track-format-dec"
16195
16199
  ];
16196
- if (excludedClasses.some((className) => e.target.classList.contains(className))) return;
16200
+ if (excludedClasses.some((className) => e.target.classList.contains(className)) || isCommentHighlighted.value) return;
16197
16201
  if (activeComment.value === props.comment.commentId) {
16198
16202
  floatingCommentsOffset.value = 0;
16199
16203
  emit("dialog-exit");
16200
16204
  }
16201
16205
  activeComment.value = null;
16202
16206
  commentsStore.setActiveComment(proxy.$superdoc, activeComment.value);
16207
+ isCommentHighlighted.value = false;
16203
16208
  };
16204
16209
  const handleAddComment = () => {
16205
16210
  const options = {
@@ -16412,7 +16417,7 @@ const _sfc_main$c = {
16412
16417
  };
16413
16418
  }
16414
16419
  };
16415
- const CommentDialog = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-dc5e6675"]]);
16420
+ const CommentDialog = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-e07f3426"]]);
16416
16421
  const _hoisted_1$a = { class: "comments-list" };
16417
16422
  const _hoisted_2$5 = { key: 0 };
16418
16423
  const _hoisted_3$3 = { class: "comment-item" };
@@ -17409,7 +17414,7 @@ const _sfc_main = {
17409
17414
  __name: "SuperDoc",
17410
17415
  emits: ["selection-update"],
17411
17416
  setup(__props, { emit: __emit }) {
17412
- const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-BBQm50V3.cjs")));
17417
+ const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-DpkgwUPi.cjs")));
17413
17418
  const superdocStore = useSuperdocStore();
17414
17419
  const commentsStore = useCommentsStore();
17415
17420
  const {
@@ -17435,7 +17440,8 @@ const _sfc_main = {
17435
17440
  getFloatingComments,
17436
17441
  hasSyncedCollaborationComments,
17437
17442
  editorCommentPositions,
17438
- hasInitializedLocations
17443
+ hasInitializedLocations,
17444
+ isCommentHighlighted
17439
17445
  } = storeToRefs(commentsStore);
17440
17446
  const { showAddComment, handleEditorLocationsUpdate, handleTrackedChangeUpdate } = commentsStore;
17441
17447
  const { proxy } = vue.getCurrentInstance();
@@ -17630,6 +17636,7 @@ const _sfc_main = {
17630
17636
  vue.nextTick(() => {
17631
17637
  if (pendingComment.value) return;
17632
17638
  commentsStore.setActiveComment(proxy.$superdoc, activeCommentId);
17639
+ isCommentHighlighted.value = true;
17633
17640
  });
17634
17641
  if (typeof proxy.$superdoc.config.onCommentsUpdate === "function") {
17635
17642
  proxy.$superdoc.config.onCommentsUpdate(params2);
@@ -17952,7 +17959,7 @@ const _sfc_main = {
17952
17959
  };
17953
17960
  }
17954
17961
  };
17955
- const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-dbfba5b9"]]);
17962
+ const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-3f71b1bf"]]);
17956
17963
  const createSuperdocVueApp = () => {
17957
17964
  const app = vue.createApp(App);
17958
17965
  const pinia = createPinia();
@@ -1,4 +1,4 @@
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 "./super-editor.es-Bg0-F_x5.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 "./super-editor.es-BVxfhpAJ.es.js";
2
2
  import { a0 as effectScope, r as ref, _ as markRaw, $ as process$1, a1 as toRaw, d as computed, a2 as isRef, a3 as isReactive, C as toRef, i as inject, p as getCurrentInstance, l as watch, x as unref, a4 as hasInjectionContext, M as reactive, s as nextTick, a5 as getCurrentScope, a6 as onScopeDispose, a7 as toRefs, g as global$1, J as shallowRef, N as readonly, j as onMounted, k as onBeforeUnmount, h as onBeforeMount, S as onActivated, q as onDeactivated, z as createTextVNode, F as Fragment, Q as Comment, m as defineComponent, D as provide, H as withDirectives, B as h, U as Teleport, R as renderSlot, V as isVNode, I as watchEffect, O as Transition, a8 as TransitionGroup, E as mergeProps, P as vShow, G as cloneVNode, T as Text, c as createElementBlock, o as openBlock, t as toDisplayString, v as createVNode, y as withCtx, a as createBaseVNode, A as normalizeStyle, f as createCommentVNode, u as createBlock, w as withModifiers, n as normalizeClass, a9 as resolveDirective, e as renderList, b as createApp, X as resolveDynamicComponent, aa as defineAsyncComponent } from "./vue-CXxsqYcP.es.js";
3
3
  import { B as Buffer$2 } from "./jszip-B8KIZSNe.es.js";
4
4
  import { B as BlankDOCX } from "./blank-docx-iwdyG9RH.es.js";
@@ -4161,7 +4161,7 @@ const groupChanges = (changes) => {
4161
4161
  const c1 = changes[i];
4162
4162
  const c2 = changes[i + 1];
4163
4163
  const c1Key = markMetaKeys[c1.mark.type.name];
4164
- if (c1 && c2 && c1.to === c2.from) {
4164
+ if (c1 && c2 && c1.to === c2.from && c1.mark.attrs.id === c2.mark.attrs.id) {
4165
4165
  const c2Key = markMetaKeys[c2.mark.type.name];
4166
4166
  grouped.push({
4167
4167
  from: c1.from,
@@ -4206,6 +4206,7 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
4206
4206
  const isCommentsListVisible = ref(false);
4207
4207
  const editorCommentIds = ref([]);
4208
4208
  const editorCommentPositions = ref({});
4209
+ const isCommentHighlighted = ref(false);
4209
4210
  const floatingCommentsOffset = ref(0);
4210
4211
  const sortedConversations = ref([]);
4211
4212
  const visibleConversations = ref([]);
@@ -4484,8 +4485,8 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
4484
4485
  tr.setMeta(CommentsPluginKey, { type: "forceTrackChanges" });
4485
4486
  tr.setMeta(TrackChangesBasePluginKey, trackChangesPayload);
4486
4487
  }
4488
+ dispatch(tr);
4487
4489
  });
4488
- dispatch(tr);
4489
4490
  };
4490
4491
  const translateCommentsForExport = () => {
4491
4492
  const processedComments = [];
@@ -4555,6 +4556,7 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
4555
4556
  try {
4556
4557
  const normalizedContent = normalizeCommentForEditor(commentTextJson);
4557
4558
  const schemaContent = Array.isArray(normalizedContent) ? normalizedContent[0] : normalizedContent;
4559
+ if (!schemaContent.content.length) return null;
4558
4560
  const editor = new Editor({
4559
4561
  mode: "text",
4560
4562
  isHeadless: true,
@@ -4588,6 +4590,7 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
4588
4590
  commentsParentElement,
4589
4591
  editorCommentPositions,
4590
4592
  hasInitializedLocations,
4593
+ isCommentHighlighted,
4591
4594
  // Floating comments
4592
4595
  floatingCommentsOffset,
4593
4596
  sortedConversations,
@@ -16114,7 +16117,8 @@ const _sfc_main$c = {
16114
16117
  currentCommentText,
16115
16118
  isDebugging,
16116
16119
  editingCommentId,
16117
- editorCommentPositions
16120
+ editorCommentPositions,
16121
+ isCommentHighlighted
16118
16122
  } = storeToRefs(commentsStore);
16119
16123
  const { activeZoom } = storeToRefs(superdocStore);
16120
16124
  const isInternal = ref(true);
@@ -16176,13 +16180,14 @@ const _sfc_main$c = {
16176
16180
  "track-format",
16177
16181
  "track-format-dec"
16178
16182
  ];
16179
- if (excludedClasses.some((className) => e.target.classList.contains(className))) return;
16183
+ if (excludedClasses.some((className) => e.target.classList.contains(className)) || isCommentHighlighted.value) return;
16180
16184
  if (activeComment.value === props.comment.commentId) {
16181
16185
  floatingCommentsOffset.value = 0;
16182
16186
  emit("dialog-exit");
16183
16187
  }
16184
16188
  activeComment.value = null;
16185
16189
  commentsStore.setActiveComment(proxy.$superdoc, activeComment.value);
16190
+ isCommentHighlighted.value = false;
16186
16191
  };
16187
16192
  const handleAddComment = () => {
16188
16193
  const options = {
@@ -16395,7 +16400,7 @@ const _sfc_main$c = {
16395
16400
  };
16396
16401
  }
16397
16402
  };
16398
- const CommentDialog = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-dc5e6675"]]);
16403
+ const CommentDialog = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-e07f3426"]]);
16399
16404
  const _hoisted_1$a = { class: "comments-list" };
16400
16405
  const _hoisted_2$5 = { key: 0 };
16401
16406
  const _hoisted_3$3 = { class: "comment-item" };
@@ -17392,7 +17397,7 @@ const _sfc_main = {
17392
17397
  __name: "SuperDoc",
17393
17398
  emits: ["selection-update"],
17394
17399
  setup(__props, { emit: __emit }) {
17395
- const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-C1tow4Hk.es.js"));
17400
+ const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-BNWaI4WI.es.js"));
17396
17401
  const superdocStore = useSuperdocStore();
17397
17402
  const commentsStore = useCommentsStore();
17398
17403
  const {
@@ -17418,7 +17423,8 @@ const _sfc_main = {
17418
17423
  getFloatingComments,
17419
17424
  hasSyncedCollaborationComments,
17420
17425
  editorCommentPositions,
17421
- hasInitializedLocations
17426
+ hasInitializedLocations,
17427
+ isCommentHighlighted
17422
17428
  } = storeToRefs(commentsStore);
17423
17429
  const { showAddComment, handleEditorLocationsUpdate, handleTrackedChangeUpdate } = commentsStore;
17424
17430
  const { proxy } = getCurrentInstance();
@@ -17613,6 +17619,7 @@ const _sfc_main = {
17613
17619
  nextTick(() => {
17614
17620
  if (pendingComment.value) return;
17615
17621
  commentsStore.setActiveComment(proxy.$superdoc, activeCommentId);
17622
+ isCommentHighlighted.value = true;
17616
17623
  });
17617
17624
  if (typeof proxy.$superdoc.config.onCommentsUpdate === "function") {
17618
17625
  proxy.$superdoc.config.onCommentsUpdate(params2);
@@ -17935,7 +17942,7 @@ const _sfc_main = {
17935
17942
  };
17936
17943
  }
17937
17944
  };
17938
- const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-dbfba5b9"]]);
17945
+ const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-3f71b1bf"]]);
17939
17946
  const createSuperdocVueApp = () => {
17940
17947
  const app = createApp(App);
17941
17948
  const pinia = createPinia();