superdoc 1.0.0-beta.3 → 1.0.0-beta.31

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 (44) hide show
  1. package/dist/chunks/{PdfViewer-CxHbcDGx.cjs → PdfViewer-C8iiBtQt.cjs} +2 -2
  2. package/dist/chunks/{PdfViewer-CKzs9Ct5.es.js → PdfViewer-jGctuklH.es.js} +2 -2
  3. package/dist/chunks/{eventemitter3-ByBH0NYV.es.js → eventemitter3-CcXAdeql.es.js} +1 -1
  4. package/dist/chunks/{eventemitter3-CFCpOk3d.cjs → eventemitter3-DQmQUge-.cjs} +1 -1
  5. package/dist/chunks/{index-DukSDI8_.es.js → index-Bu5UUj9S.es.js} +15 -10
  6. package/dist/chunks/{index-Dp3rVMnX.cjs → index-ELjoBC86.cjs} +15 -10
  7. package/dist/chunks/{index-CJUy3fVi-BGLfCP5B.cjs → index-eG-VYUeN-CG3M1n5T.cjs} +1 -1
  8. package/dist/chunks/{index-CJUy3fVi-D8zt9F3Z.es.js → index-eG-VYUeN-CIuOnW8W.es.js} +1 -1
  9. package/dist/chunks/{jszip-BwsONqK5.es.js → jszip-5vvIqAEE.es.js} +1 -1
  10. package/dist/chunks/{jszip-B99MTu59.cjs → jszip-BdEez1WM.cjs} +1 -1
  11. package/dist/chunks/{super-editor.es-BRKZG90h.es.js → super-editor.es-BAKZgAuj.es.js} +17984 -2962
  12. package/dist/chunks/{super-editor.es-CDiTp9Fe.cjs → super-editor.es-DatOA_vA.cjs} +17984 -2962
  13. package/dist/chunks/{vue-CztqUvm1.es.js → vue-Dysv_7z5.es.js} +101 -12
  14. package/dist/chunks/{vue-ARQSyfaw.cjs → vue-jWLMl8Ts.cjs} +89 -0
  15. package/dist/chunks/xml-js-ClO_jHnq.es.js +2 -0
  16. package/dist/chunks/xml-js-Dz51sEbr.cjs +3 -0
  17. package/dist/packages/superdoc/src/components/CommentsLayer/use-comment.d.ts.map +1 -1
  18. package/dist/packages/superdoc/src/core/SuperDoc.d.ts +2 -2
  19. package/dist/packages/superdoc/src/core/SuperDoc.d.ts.map +1 -1
  20. package/dist/packages/superdoc/src/core/types/index.d.ts +2 -2
  21. package/dist/packages/superdoc/src/stores/comments-store.d.ts.map +1 -1
  22. package/dist/style.css +66 -27
  23. package/dist/super-editor/ai-writer.es.js +2 -2
  24. package/dist/super-editor/chunks/{converter-B9YfBdcc.js → converter-CRKt1TG_.js} +7060 -760
  25. package/dist/super-editor/chunks/{docx-zipper-V16OzZ7a.js → docx-zipper-CgVw58T-.js} +1 -1
  26. package/dist/super-editor/chunks/{editor-DlvlVSbc.js → editor-COQCS1pn.js} +10400 -2207
  27. package/dist/super-editor/chunks/{index-CJUy3fVi.js → index-eG-VYUeN.js} +1 -1
  28. package/dist/super-editor/chunks/{toolbar-cNDvtryE.js → toolbar-B3CSV2yT.js} +39 -24
  29. package/dist/super-editor/converter.es.js +1 -1
  30. package/dist/super-editor/docx-zipper.es.js +2 -2
  31. package/dist/super-editor/editor.es.js +3 -3
  32. package/dist/super-editor/file-zipper.es.js +2 -2
  33. package/dist/super-editor/style.css +66 -27
  34. package/dist/super-editor/super-editor.es.js +878 -215
  35. package/dist/super-editor/toolbar.es.js +2 -2
  36. package/dist/super-editor.cjs +4 -4
  37. package/dist/super-editor.es.js +2 -2
  38. package/dist/superdoc.cjs +2 -2
  39. package/dist/superdoc.es.js +2 -2
  40. package/dist/superdoc.umd.js +17950 -2847
  41. package/dist/superdoc.umd.js.map +1 -1
  42. package/package.json +1 -1
  43. package/dist/chunks/xml-js-BZPSMmVo.es.js +0 -2
  44. package/dist/chunks/xml-js-DQa4Ye5C.cjs +0 -3
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const vue = require("./vue-ARQSyfaw.cjs");
4
- const superdoc = require("./index-Dp3rVMnX.cjs");
3
+ const vue = require("./vue-jWLMl8Ts.cjs");
4
+ const superdoc = require("./index-ELjoBC86.cjs");
5
5
  function self(vars) {
6
6
  const {
7
7
  opacityDisabled,
@@ -1,5 +1,5 @@
1
- import { y as defineComponent, z as h, O as Transition, $ as process$1, J as watchEffect, a as computed, r as ref, j as onMounted, W as onUnmounted, b as createElementBlock, o as openBlock, f as createBaseVNode, e as createCommentVNode, u as createVNode, v as unref } from "./vue-CztqUvm1.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-DukSDI8_.es.js";
1
+ import { y as defineComponent, z as h, O as Transition, a0 as process$1, J as watchEffect, a as computed, r as ref, j as onMounted, W as onUnmounted, b as createElementBlock, o as openBlock, f as createBaseVNode, e as createCommentVNode, u as createVNode, v as unref } from "./vue-Dysv_7z5.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-Bu5UUj9S.es.js";
3
3
  function self(vars) {
4
4
  const {
5
5
  opacityDisabled,
@@ -1,4 +1,4 @@
1
- import { g as getDefaultExportFromCjs } from "./jszip-BwsONqK5.es.js";
1
+ import { g as getDefaultExportFromCjs } from "./jszip-5vvIqAEE.es.js";
2
2
  var eventemitter3 = { exports: {} };
3
3
  var hasRequiredEventemitter3;
4
4
  function requireEventemitter3() {
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const jszip = require("./jszip-B99MTu59.cjs");
2
+ const jszip = require("./jszip-BdEez1WM.cjs");
3
3
  var eventemitter3 = { exports: {} };
4
4
  var hasRequiredEventemitter3;
5
5
  function requireEventemitter3() {
@@ -1,11 +1,11 @@
1
- import { q as index, C as CommentsPluginKey, h as TrackChangesBasePluginKey, E as Editor, n as getRichTextExtensions, f as SuperInput, P as PresentationEditor, e as SuperEditor, A as AIWriter, g as SuperToolbar, i as createZip } from "./super-editor.es-BRKZG90h.es.js";
1
+ import { q as index, C as CommentsPluginKey, h as TrackChangesBasePluginKey, E as Editor, n as getRichTextExtensions, f as SuperInput, P as PresentationEditor, e as SuperEditor, A as AIWriter, g as SuperToolbar, i as createZip } from "./super-editor.es-BAKZgAuj.es.js";
2
2
  import { B as BlankDOCX } from "./blank-docx-ABm6XYAA.es.js";
3
- import { E as EventEmitter } from "./eventemitter3-ByBH0NYV.es.js";
3
+ import { E as EventEmitter } from "./eventemitter3-CcXAdeql.es.js";
4
4
  import { HocuspocusProvider, HocuspocusProviderWebsocket } from "@hocuspocus/provider";
5
- import { a0 as effectScope, r as ref, X as markRaw, $ as process$1, a1 as toRaw, a as computed, a2 as isRef, a3 as isReactive, E as toRef, i as inject, m as getCurrentInstance, l as watch, v as unref, a4 as hasInjectionContext, M as reactive, q as nextTick, a5 as getCurrentScope, a6 as onScopeDispose, a7 as toRefs, g as global$1, B as shallowRef, N as readonly, j as onMounted, k as onBeforeUnmount, h as onBeforeMount, S as onActivated, p as onDeactivated, D as createTextVNode, F as Fragment, Q as Comment, y as defineComponent, G as provide, I as withDirectives, z as h, U as Teleport, R as renderSlot, V as isVNode, J as watchEffect, O as Transition, a8 as TransitionGroup, A as mergeProps, P as vShow, H as cloneVNode, T as Text, b as createElementBlock, o as openBlock, t as toDisplayString, u as createVNode, C as withCtx, f as createBaseVNode, x as normalizeStyle, e as createCommentVNode, s as createBlock, w as withModifiers, n as normalizeClass, a9 as resolveDirective, d as renderList, c as createApp, Y as resolveDynamicComponent, aa as defineAsyncComponent } from "./vue-CztqUvm1.es.js";
5
+ import { a1 as effectScope, r as ref, X as markRaw, a0 as process$1, a2 as toRaw, a as computed, a3 as isRef, a4 as isReactive, E as toRef, i as inject, m as getCurrentInstance, l as watch, v as unref, a5 as hasInjectionContext, M as reactive, q as nextTick, a6 as getCurrentScope, a7 as onScopeDispose, a8 as toRefs, g as global$1, B as shallowRef, N as readonly, j as onMounted, k as onBeforeUnmount, h as onBeforeMount, S as onActivated, p as onDeactivated, D as createTextVNode, F as Fragment, Q as Comment, y as defineComponent, G as provide, I as withDirectives, z as h, U as Teleport, R as renderSlot, V as isVNode, J as watchEffect, O as Transition, a9 as TransitionGroup, A as mergeProps, P as vShow, H as cloneVNode, T as Text, b as createElementBlock, o as openBlock, t as toDisplayString, u as createVNode, C as withCtx, f as createBaseVNode, x as normalizeStyle, e as createCommentVNode, s as createBlock, w as withModifiers, n as normalizeClass, aa as resolveDirective, d as renderList, c as createApp, Y as resolveDynamicComponent, ab as defineAsyncComponent } from "./vue-Dysv_7z5.es.js";
6
6
  import * as Y from "yjs";
7
7
  import { Doc, Map as Map$2 } from "yjs";
8
- import { B as Buffer$2 } from "./jszip-BwsONqK5.es.js";
8
+ import { B as Buffer$2 } from "./jszip-5vvIqAEE.es.js";
9
9
  import { v as v4 } from "./uuid-CjlX8hrF.es.js";
10
10
  const DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
11
11
  const PDF = "application/pdf";
@@ -3465,6 +3465,7 @@ function useComment(params2) {
3465
3465
  const creatorImage = params2.creatorImage;
3466
3466
  const createdTime = params2.createdTime || Date.now();
3467
3467
  const importedAuthor = ref(params2.importedAuthor || null);
3468
+ const docxCommentJSON = params2.docxCommentJSON || null;
3468
3469
  const commentText = ref(params2.commentText || "");
3469
3470
  const selection = params2.selection ? useSelection(params2.selection) : useSelection({
3470
3471
  documentId: fileId,
@@ -3579,6 +3580,7 @@ function useComment(params2) {
3579
3580
  creatorImage,
3580
3581
  createdTime,
3581
3582
  importedAuthor: importedAuthor.value,
3583
+ docxCommentJSON,
3582
3584
  isInternal: isInternal.value,
3583
3585
  commentText: commentText.value,
3584
3586
  selection: selection ? selection.getValues() : null,
@@ -3617,6 +3619,7 @@ function useComment(params2) {
3617
3619
  resolvedByEmail,
3618
3620
  resolvedByName,
3619
3621
  importedAuthor,
3622
+ docxCommentJSON,
3620
3623
  // Actions
3621
3624
  setText,
3622
3625
  getValues,
@@ -4198,6 +4201,7 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
4198
4201
  const newComment = useComment({
4199
4202
  fileId: documentId,
4200
4203
  fileType: document2.type,
4204
+ docxCommentJSON: comment.textJson,
4201
4205
  commentId: comment.commentId,
4202
4206
  isInternal: false,
4203
4207
  parentCommentId: comment.parentCommentId,
@@ -4258,7 +4262,7 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
4258
4262
  commentsList.value.forEach((comment) => {
4259
4263
  const values = comment.getValues();
4260
4264
  const richText = values.commentText;
4261
- const schema = convertHtmlToSchema(richText);
4265
+ const schema = values.docxCommentJSON || convertHtmlToSchema(richText);
4262
4266
  processedComments.push({
4263
4267
  ...values,
4264
4268
  commentJSON: schema
@@ -17210,7 +17214,7 @@ const _sfc_main = {
17210
17214
  __name: "SuperDoc",
17211
17215
  emits: ["selection-update"],
17212
17216
  setup(__props, { emit: __emit }) {
17213
- const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-CKzs9Ct5.es.js"));
17217
+ const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-jGctuklH.es.js"));
17214
17218
  const superdocStore = useSuperdocStore();
17215
17219
  const commentsStore = useCommentsStore();
17216
17220
  const {
@@ -18063,7 +18067,7 @@ class SuperDoc extends EventEmitter {
18063
18067
  this.config.colors = shuffleArray(this.config.colors);
18064
18068
  this.userColorMap = /* @__PURE__ */ new Map();
18065
18069
  this.colorIndex = 0;
18066
- this.version = "1.0.0-beta.3";
18070
+ this.version = "1.0.0-beta.31";
18067
18071
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
18068
18072
  this.superdocId = config.superdocId || v4();
18069
18073
  this.colors = this.config.colors;
@@ -18411,7 +18415,6 @@ class SuperDoc extends EventEmitter {
18411
18415
  */
18412
18416
  addCommentsList(element) {
18413
18417
  if (!this.config?.modules?.comments || this.config.role === "viewer") return;
18414
- this.#log("🦋 [superdoc] Adding comments list to:", element);
18415
18418
  if (element) this.config.modules.comments.element = element;
18416
18419
  this.commentsList = new SuperComments(this.config.modules?.comments, this);
18417
18420
  if (this.config.onCommentsListChange) this.config.onCommentsListChange({ isRendered: true });
@@ -18474,7 +18477,9 @@ class SuperDoc extends EventEmitter {
18474
18477
  editing: () => this.#setModeEditing(),
18475
18478
  suggesting: () => this.#setModeSuggesting()
18476
18479
  };
18477
- if (types[type]) types[type]();
18480
+ if (types[type]) {
18481
+ types[type]();
18482
+ }
18478
18483
  }
18479
18484
  /**
18480
18485
  * Set the document mode on a document's editor (PresentationEditor or Editor).
@@ -18546,7 +18551,7 @@ class SuperDoc extends EventEmitter {
18546
18551
  }
18547
18552
  #setModeViewing() {
18548
18553
  this.toolbar.activeEditor = null;
18549
- this.setTrackedChangesPreferences({ mode: "final", enabled: false });
18554
+ this.setTrackedChangesPreferences({ mode: "original", enabled: false });
18550
18555
  this.superdocStore.documents.forEach((doc) => {
18551
18556
  doc.removeComments();
18552
18557
  this.#applyDocumentMode(doc, "viewing");
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
- const superEditor_es = require("./super-editor.es-CDiTp9Fe.cjs");
2
+ const superEditor_es = require("./super-editor.es-DatOA_vA.cjs");
3
3
  const blankDocx = require("./blank-docx-DfW3Eeh2.cjs");
4
- const eventemitter3 = require("./eventemitter3-CFCpOk3d.cjs");
4
+ const eventemitter3 = require("./eventemitter3-DQmQUge-.cjs");
5
5
  const provider = require("@hocuspocus/provider");
6
- const vue = require("./vue-ARQSyfaw.cjs");
6
+ const vue = require("./vue-jWLMl8Ts.cjs");
7
7
  const Y = require("yjs");
8
- const jszip = require("./jszip-B99MTu59.cjs");
8
+ const jszip = require("./jszip-BdEez1WM.cjs");
9
9
  const uuid = require("./uuid-R7L08bOx.cjs");
10
10
  function _interopNamespaceDefault(e) {
11
11
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
@@ -3482,6 +3482,7 @@ function useComment(params2) {
3482
3482
  const creatorImage = params2.creatorImage;
3483
3483
  const createdTime = params2.createdTime || Date.now();
3484
3484
  const importedAuthor = vue.ref(params2.importedAuthor || null);
3485
+ const docxCommentJSON = params2.docxCommentJSON || null;
3485
3486
  const commentText = vue.ref(params2.commentText || "");
3486
3487
  const selection = params2.selection ? useSelection(params2.selection) : useSelection({
3487
3488
  documentId: fileId,
@@ -3596,6 +3597,7 @@ function useComment(params2) {
3596
3597
  creatorImage,
3597
3598
  createdTime,
3598
3599
  importedAuthor: importedAuthor.value,
3600
+ docxCommentJSON,
3599
3601
  isInternal: isInternal.value,
3600
3602
  commentText: commentText.value,
3601
3603
  selection: selection ? selection.getValues() : null,
@@ -3634,6 +3636,7 @@ function useComment(params2) {
3634
3636
  resolvedByEmail,
3635
3637
  resolvedByName,
3636
3638
  importedAuthor,
3639
+ docxCommentJSON,
3637
3640
  // Actions
3638
3641
  setText,
3639
3642
  getValues,
@@ -4215,6 +4218,7 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
4215
4218
  const newComment = useComment({
4216
4219
  fileId: documentId,
4217
4220
  fileType: document2.type,
4221
+ docxCommentJSON: comment.textJson,
4218
4222
  commentId: comment.commentId,
4219
4223
  isInternal: false,
4220
4224
  parentCommentId: comment.parentCommentId,
@@ -4275,7 +4279,7 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
4275
4279
  commentsList.value.forEach((comment) => {
4276
4280
  const values = comment.getValues();
4277
4281
  const richText = values.commentText;
4278
- const schema = convertHtmlToSchema(richText);
4282
+ const schema = values.docxCommentJSON || convertHtmlToSchema(richText);
4279
4283
  processedComments.push({
4280
4284
  ...values,
4281
4285
  commentJSON: schema
@@ -17227,7 +17231,7 @@ const _sfc_main = {
17227
17231
  __name: "SuperDoc",
17228
17232
  emits: ["selection-update"],
17229
17233
  setup(__props, { emit: __emit }) {
17230
- const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-CxHbcDGx.cjs")));
17234
+ const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-C8iiBtQt.cjs")));
17231
17235
  const superdocStore = useSuperdocStore();
17232
17236
  const commentsStore = useCommentsStore();
17233
17237
  const {
@@ -18080,7 +18084,7 @@ class SuperDoc extends eventemitter3.EventEmitter {
18080
18084
  this.config.colors = shuffleArray(this.config.colors);
18081
18085
  this.userColorMap = /* @__PURE__ */ new Map();
18082
18086
  this.colorIndex = 0;
18083
- this.version = "1.0.0-beta.3";
18087
+ this.version = "1.0.0-beta.31";
18084
18088
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
18085
18089
  this.superdocId = config.superdocId || uuid.v4();
18086
18090
  this.colors = this.config.colors;
@@ -18428,7 +18432,6 @@ class SuperDoc extends eventemitter3.EventEmitter {
18428
18432
  */
18429
18433
  addCommentsList(element) {
18430
18434
  if (!this.config?.modules?.comments || this.config.role === "viewer") return;
18431
- this.#log("🦋 [superdoc] Adding comments list to:", element);
18432
18435
  if (element) this.config.modules.comments.element = element;
18433
18436
  this.commentsList = new SuperComments(this.config.modules?.comments, this);
18434
18437
  if (this.config.onCommentsListChange) this.config.onCommentsListChange({ isRendered: true });
@@ -18491,7 +18494,9 @@ class SuperDoc extends eventemitter3.EventEmitter {
18491
18494
  editing: () => this.#setModeEditing(),
18492
18495
  suggesting: () => this.#setModeSuggesting()
18493
18496
  };
18494
- if (types[type]) types[type]();
18497
+ if (types[type]) {
18498
+ types[type]();
18499
+ }
18495
18500
  }
18496
18501
  /**
18497
18502
  * Set the document mode on a document's editor (PresentationEditor or Editor).
@@ -18563,7 +18568,7 @@ class SuperDoc extends eventemitter3.EventEmitter {
18563
18568
  }
18564
18569
  #setModeViewing() {
18565
18570
  this.toolbar.activeEditor = null;
18566
- this.setTrackedChangesPreferences({ mode: "final", enabled: false });
18571
+ this.setTrackedChangesPreferences({ mode: "original", enabled: false });
18567
18572
  this.superdocStore.documents.forEach((doc) => {
18568
18573
  doc.removeComments();
18569
18574
  this.#applyDocumentMode(doc, "viewing");
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const superEditor_es = require("./super-editor.es-CDiTp9Fe.cjs");
3
+ const superEditor_es = require("./super-editor.es-DatOA_vA.cjs");
4
4
  const indexCvBqQJbG = require("./index-CvBqQJbG-Dwm0THD7.cjs");
5
5
  function bail(error) {
6
6
  if (error) {
@@ -1,4 +1,4 @@
1
- import { s as getDefaultExportFromCjs$2 } from "./super-editor.es-BRKZG90h.es.js";
1
+ import { s as getDefaultExportFromCjs$2 } from "./super-editor.es-BAKZgAuj.es.js";
2
2
  import { V as VFile } from "./index-CvBqQJbG-CvBqQJbG.es.js";
3
3
  function bail(error) {
4
4
  if (error) {
@@ -1,4 +1,4 @@
1
- import "./vue-CztqUvm1.es.js";
1
+ import "./vue-Dysv_7z5.es.js";
2
2
  function getDefaultExportFromCjs(x) {
3
3
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
4
4
  }
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- require("./vue-ARQSyfaw.cjs");
2
+ require("./vue-jWLMl8Ts.cjs");
3
3
  function getDefaultExportFromCjs(x) {
4
4
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
5
5
  }