superdoc 1.0.0-beta.2 → 1.0.0-beta.20

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-saAhozRR.es.js → PdfViewer-CPnD95lv.es.js} +2 -2
  2. package/dist/chunks/{PdfViewer-CeuX3gOe.cjs → PdfViewer-DbSf6FKU.cjs} +2 -2
  3. package/dist/chunks/{eventemitter3-BZXKb7j7.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-C0OeGje6.es.js → index-BSHAWPko.es.js} +11 -7
  6. package/dist/chunks/{index-Sn-JVHIg-BCItIT88.es.js → index-DHhKY9FZ-CyEU4GWR.es.js} +1 -1
  7. package/dist/chunks/{index-Sn-JVHIg-BxOp3gSx.cjs → index-DHhKY9FZ-DORT-UR6.cjs} +1 -1
  8. package/dist/chunks/{index-Dh5oVJua.cjs → index-DLco7m-w.cjs} +11 -7
  9. package/dist/chunks/{jszip-Duxs2YMV.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-BKljkYUU.cjs → super-editor.es-B6lsvAAY.cjs} +11449 -2706
  12. package/dist/chunks/{super-editor.es-Dcz39nKY.es.js → super-editor.es-C0tdU_gq.es.js} +11449 -2706
  13. package/dist/chunks/{vue-B5QAf5pA.es.js → vue-Dysv_7z5.es.js} +118 -29
  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 +37 -4
  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-BFGB7hqj.js → converter-m2x13P8G.js} +1217 -387
  25. package/dist/super-editor/chunks/{docx-zipper-OPbzIk16.js → docx-zipper-CRSKJF-o.js} +1 -1
  26. package/dist/super-editor/chunks/{editor-CtI4XnMw.js → editor-C9r_Jbbg.js} +9373 -2162
  27. package/dist/super-editor/chunks/{index-Sn-JVHIg.js → index-DHhKY9FZ.js} +1 -1
  28. package/dist/super-editor/chunks/{toolbar-BydALv4o.js → toolbar-fnptYAcU.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 +1085 -250
  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 +11521 -2698
  41. package/dist/superdoc.umd.js.map +1 -1
  42. package/package.json +1 -1
  43. package/dist/chunks/xml-js-CVyfrKaV.es.js +0 -2
  44. package/dist/chunks/xml-js-DQa4Ye5C.cjs +0 -3
@@ -1,5 +1,5 @@
1
- import { m as defineComponent, y 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, v as createVNode, x as unref } from "./vue-B5QAf5pA.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-C0OeGje6.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-BSHAWPko.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
- const vue = require("./vue-ARQSyfaw.cjs");
4
- const superdoc = require("./index-Dh5oVJua.cjs");
3
+ const vue = require("./vue-jWLMl8Ts.cjs");
4
+ const superdoc = require("./index-DLco7m-w.cjs");
5
5
  function self(vars) {
6
6
  const {
7
7
  opacityDisabled,
@@ -1,4 +1,4 @@
1
- import { g as getDefaultExportFromCjs } from "./jszip-Duxs2YMV.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-Dcz39nKY.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-C0tdU_gq.es.js";
2
2
  import { B as BlankDOCX } from "./blank-docx-ABm6XYAA.es.js";
3
- import { E as EventEmitter } from "./eventemitter3-BZXKb7j7.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, _ as markRaw, $ as process$1, a1 as toRaw, a as computed, a2 as isRef, a3 as isReactive, E 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, A as shallowRef, N as readonly, j as onMounted, k as onBeforeUnmount, h as onBeforeMount, S as onActivated, q as onDeactivated, C as createTextVNode, F as Fragment, Q as Comment, m as defineComponent, G as provide, I as withDirectives, y as h, U as Teleport, R as renderSlot, V as isVNode, J as watchEffect, O as Transition, a8 as TransitionGroup, z as mergeProps, P as vShow, H as cloneVNode, T as Text, b as createElementBlock, o as openBlock, t as toDisplayString, v as createVNode, B as withCtx, f as createBaseVNode, D as normalizeStyle, e as createCommentVNode, u as createBlock, w as withModifiers, n as normalizeClass, a9 as resolveDirective, d as renderList, c as createApp, X as resolveDynamicComponent, aa as defineAsyncComponent } from "./vue-B5QAf5pA.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-Duxs2YMV.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-saAhozRR.es.js"));
17217
+ const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-CPnD95lv.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.2";
18070
+ this.version = "1.0.0-beta.20";
18067
18071
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
18068
18072
  this.superdocId = config.superdocId || v4();
18069
18073
  this.colors = this.config.colors;
@@ -1,4 +1,4 @@
1
- import { s as getDefaultExportFromCjs$2 } from "./super-editor.es-Dcz39nKY.es.js";
1
+ import { s as getDefaultExportFromCjs$2 } from "./super-editor.es-C0tdU_gq.es.js";
2
2
  import { V as VFile } from "./index-CvBqQJbG-CvBqQJbG.es.js";
3
3
  function bail(error) {
4
4
  if (error) {
@@ -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-BKljkYUU.cjs");
3
+ const superEditor_es = require("./super-editor.es-B6lsvAAY.cjs");
4
4
  const indexCvBqQJbG = require("./index-CvBqQJbG-Dwm0THD7.cjs");
5
5
  function bail(error) {
6
6
  if (error) {
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
- const superEditor_es = require("./super-editor.es-BKljkYUU.cjs");
2
+ const superEditor_es = require("./super-editor.es-B6lsvAAY.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-CeuX3gOe.cjs")));
17234
+ const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-DbSf6FKU.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.2";
18087
+ this.version = "1.0.0-beta.20";
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;
@@ -1,4 +1,4 @@
1
- import "./vue-B5QAf5pA.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
  }