@harbour-enterprises/superdoc 0.26.0-next.1 → 0.26.0-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.
Files changed (30) hide show
  1. package/dist/chunks/{PdfViewer-BdAhZa5N.cjs → PdfViewer-Ddo_DM5d.cjs} +1 -1
  2. package/dist/chunks/{PdfViewer-BKHHNbny.es.js → PdfViewer-juhTQvgB.es.js} +1 -1
  3. package/dist/chunks/{index-ClUzozbw.es.js → index-CV1DF2JY.es.js} +18 -4
  4. package/dist/chunks/{index-CAVKoWDJ.cjs → index-CgZ_A5Ca.cjs} +18 -4
  5. package/dist/chunks/{super-editor.es-DZb1VLxX.cjs → super-editor.es-CGKyR4l8.cjs} +5057 -4930
  6. package/dist/chunks/{super-editor.es-BewiNPbf.es.js → super-editor.es-zFJj_1tC.es.js} +5057 -4930
  7. package/dist/core/SuperDoc.d.ts.map +1 -1
  8. package/dist/core/collaboration/helpers.d.ts.map +1 -1
  9. package/dist/core/types/index.d.ts.map +1 -1
  10. package/dist/super-editor/ai-writer.es.js +2 -2
  11. package/dist/super-editor/chunks/{converter-khE-H7hH.js → converter-CTSH6ApH.js} +5056 -4972
  12. package/dist/super-editor/chunks/{docx-zipper-KoUEtzIj.js → docx-zipper-B9s4CP-_.js} +1 -1
  13. package/dist/super-editor/chunks/{editor-CeTu_f0L.js → editor-CwtMgXx9.js} +119 -52
  14. package/dist/super-editor/chunks/{toolbar-D1RxvV5u.js → toolbar-C66Pu-nq.js} +2 -2
  15. package/dist/super-editor/converter.es.js +1 -1
  16. package/dist/super-editor/docx-zipper.es.js +2 -2
  17. package/dist/super-editor/editor.es.js +3 -3
  18. package/dist/super-editor/file-zipper.es.js +1 -1
  19. package/dist/super-editor/super-editor/src/core/super-converter/v2/importer/listImporter.d.ts +2 -2
  20. package/dist/super-editor/super-editor/src/core/super-converter/v2/importer/numberingCache.d.ts +37 -0
  21. package/dist/super-editor/super-editor/src/extensions/list-item/ListItemNodeView.d.ts +8 -2
  22. package/dist/super-editor/super-editor.es.js +6 -6
  23. package/dist/super-editor/toolbar.es.js +2 -2
  24. package/dist/super-editor.cjs +1 -1
  25. package/dist/super-editor.es.js +1 -1
  26. package/dist/superdoc.cjs +2 -2
  27. package/dist/superdoc.es.js +2 -2
  28. package/dist/superdoc.umd.js +5073 -4932
  29. package/dist/superdoc.umd.js.map +1 -1
  30. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const vue = require("./vue-DKMj1I9B.cjs");
4
- const superdoc = require("./index-CAVKoWDJ.cjs");
4
+ const superdoc = require("./index-CgZ_A5Ca.cjs");
5
5
  function self(vars) {
6
6
  const {
7
7
  opacityDisabled,
@@ -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-ZWZLQtoU.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-ClUzozbw.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-CV1DF2JY.es.js";
3
3
  function self(vars) {
4
4
  const {
5
5
  opacityDisabled,
@@ -1,4 +1,4 @@
1
- import { q as index, 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-BewiNPbf.es.js";
1
+ import { q as index, 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-zFJj_1tC.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-ZWZLQtoU.es.js";
3
3
  import { B as BlankDOCX } from "./blank-docx-ABm6XYAA.es.js";
4
4
  import { E as EventEmitter } from "./eventemitter3-BWEnUdTY.es.js";
@@ -3291,7 +3291,6 @@ const initCollaborationComments = (superdoc2) => {
3291
3291
  const currentUser = superdoc2.config.user;
3292
3292
  const { user = {} } = event.transaction.origin;
3293
3293
  if (currentUser.name === user.name && currentUser.email === user.email) return;
3294
- console.debug("[initCollaborationComments] commentsArray.observe", commentsArray.toJSON());
3295
3294
  const comments = commentsArray.toJSON();
3296
3295
  const seen = /* @__PURE__ */ new Set();
3297
3296
  const filtered = [];
@@ -3341,7 +3340,6 @@ const makeDocumentsCollaborative = (superdoc2) => {
3341
3340
  };
3342
3341
  const syncCommentsToClients = (superdoc2, event) => {
3343
3342
  if (!superdoc2.isCollaborative || !superdoc2.config.modules.comments) return;
3344
- console.debug("[comments] syncCommentsToClients", event);
3345
3343
  const yArray = superdoc2.ydoc.getArray("comments");
3346
3344
  switch (event.type) {
3347
3345
  case "add":
@@ -17147,7 +17145,7 @@ const _sfc_main = {
17147
17145
  __name: "SuperDoc",
17148
17146
  emits: ["selection-update"],
17149
17147
  setup(__props, { emit: __emit }) {
17150
- const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-BKHHNbny.es.js"));
17148
+ const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-juhTQvgB.es.js"));
17151
17149
  const superdocStore = useSuperdocStore();
17152
17150
  const commentsStore = useCommentsStore();
17153
17151
  const {
@@ -17810,6 +17808,10 @@ const cleanName = (currentName) => {
17810
17808
  }
17811
17809
  return currentName;
17812
17810
  };
17811
+ const DEFAULT_USER = Object.freeze({
17812
+ name: "Default SuperDoc user",
17813
+ email: null
17814
+ });
17813
17815
  class SuperDoc extends EventEmitter {
17814
17816
  /** @type {Array<string>} */
17815
17817
  static allowedTypes = [DOCX, PDF, HTML];
@@ -17888,6 +17890,18 @@ class SuperDoc extends EventEmitter {
17888
17890
  ...this.config,
17889
17891
  ...config
17890
17892
  };
17893
+ const incomingUser = this.config.user;
17894
+ if (!incomingUser || typeof incomingUser !== "object") {
17895
+ this.config.user = { ...DEFAULT_USER };
17896
+ } else {
17897
+ this.config.user = {
17898
+ ...DEFAULT_USER,
17899
+ ...incomingUser
17900
+ };
17901
+ if (!this.config.user.name) {
17902
+ this.config.user.name = DEFAULT_USER.name;
17903
+ }
17904
+ }
17891
17905
  this.config.modules = this.config.modules || {};
17892
17906
  if (!Object.prototype.hasOwnProperty.call(this.config.modules, "comments")) {
17893
17907
  this.config.modules.comments = {};
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const superEditor_es = require("./super-editor.es-DZb1VLxX.cjs");
2
+ const superEditor_es = require("./super-editor.es-CGKyR4l8.cjs");
3
3
  const vue = require("./vue-DKMj1I9B.cjs");
4
4
  const blankDocx = require("./blank-docx-DfW3Eeh2.cjs");
5
5
  const eventemitter3 = require("./eventemitter3-DkXkH2rT.cjs");
@@ -3308,7 +3308,6 @@ const initCollaborationComments = (superdoc2) => {
3308
3308
  const currentUser = superdoc2.config.user;
3309
3309
  const { user = {} } = event.transaction.origin;
3310
3310
  if (currentUser.name === user.name && currentUser.email === user.email) return;
3311
- console.debug("[initCollaborationComments] commentsArray.observe", commentsArray.toJSON());
3312
3311
  const comments = commentsArray.toJSON();
3313
3312
  const seen = /* @__PURE__ */ new Set();
3314
3313
  const filtered = [];
@@ -3358,7 +3357,6 @@ const makeDocumentsCollaborative = (superdoc2) => {
3358
3357
  };
3359
3358
  const syncCommentsToClients = (superdoc2, event) => {
3360
3359
  if (!superdoc2.isCollaborative || !superdoc2.config.modules.comments) return;
3361
- console.debug("[comments] syncCommentsToClients", event);
3362
3360
  const yArray = superdoc2.ydoc.getArray("comments");
3363
3361
  switch (event.type) {
3364
3362
  case "add":
@@ -17164,7 +17162,7 @@ const _sfc_main = {
17164
17162
  __name: "SuperDoc",
17165
17163
  emits: ["selection-update"],
17166
17164
  setup(__props, { emit: __emit }) {
17167
- const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-BdAhZa5N.cjs")));
17165
+ const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-Ddo_DM5d.cjs")));
17168
17166
  const superdocStore = useSuperdocStore();
17169
17167
  const commentsStore = useCommentsStore();
17170
17168
  const {
@@ -17827,6 +17825,10 @@ const cleanName = (currentName) => {
17827
17825
  }
17828
17826
  return currentName;
17829
17827
  };
17828
+ const DEFAULT_USER = Object.freeze({
17829
+ name: "Default SuperDoc user",
17830
+ email: null
17831
+ });
17830
17832
  class SuperDoc extends eventemitter3.EventEmitter {
17831
17833
  /** @type {Array<string>} */
17832
17834
  static allowedTypes = [DOCX, PDF, HTML];
@@ -17905,6 +17907,18 @@ class SuperDoc extends eventemitter3.EventEmitter {
17905
17907
  ...this.config,
17906
17908
  ...config
17907
17909
  };
17910
+ const incomingUser = this.config.user;
17911
+ if (!incomingUser || typeof incomingUser !== "object") {
17912
+ this.config.user = { ...DEFAULT_USER };
17913
+ } else {
17914
+ this.config.user = {
17915
+ ...DEFAULT_USER,
17916
+ ...incomingUser
17917
+ };
17918
+ if (!this.config.user.name) {
17919
+ this.config.user.name = DEFAULT_USER.name;
17920
+ }
17921
+ }
17908
17922
  this.config.modules = this.config.modules || {};
17909
17923
  if (!Object.prototype.hasOwnProperty.call(this.config.modules, "comments")) {
17910
17924
  this.config.modules.comments = {};