@harbour-enterprises/superdoc 1.0.0-next.9 → 1.0.2

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 (37) hide show
  1. package/dist/chunks/{PdfViewer-C7Wo4VVN.es.js → PdfViewer-C51KNTCu.es.js} +2 -2
  2. package/dist/chunks/{PdfViewer-QwjK1Tx6.cjs → PdfViewer-Dk7wI3bm.cjs} +2 -2
  3. package/dist/chunks/{eventemitter3-DQmQUge-.cjs → eventemitter3-DIclNhoR.cjs} +1 -1
  4. package/dist/chunks/{eventemitter3-44XulWQe.es.js → eventemitter3-D_2kqkfV.es.js} +1 -1
  5. package/dist/chunks/{index-DI2R4qz8.cjs → index-Cf7hdzkm.cjs} +20 -15
  6. package/dist/chunks/{index-DNIymDRK-CzsYNHvC.cjs → index-DDZ1ZT8N-DzepXBTN.cjs} +1 -1
  7. package/dist/chunks/{index-DNIymDRK-BMrUTNeb.es.js → index-DDZ1ZT8N-MJzqg0qg.es.js} +1 -1
  8. package/dist/chunks/{index-CfSkb15j.es.js → index-rtbawgUA.es.js} +20 -15
  9. package/dist/chunks/{jszip-VP334ufO.es.js → jszip-B690S4j-.es.js} +1 -1
  10. package/dist/chunks/{jszip-BdEez1WM.cjs → jszip-qHp7FC78.cjs} +1 -1
  11. package/dist/chunks/{super-editor.es-BI8ByUNm.cjs → super-editor.es-BijxiFs9.cjs} +1671 -353
  12. package/dist/chunks/{super-editor.es-B42HV1fg.es.js → super-editor.es-DFXddrgb.es.js} +1671 -353
  13. package/dist/chunks/{vue-BuPTonTJ.es.js → vue-CLFbn_1r.es.js} +209 -185
  14. package/dist/chunks/{vue-jWLMl8Ts.cjs → vue-gvuFr0vx.cjs} +209 -185
  15. package/dist/chunks/xml-js-BXUvL-Mz.es.js +2 -0
  16. package/dist/chunks/xml-js-CCH4ckfW.cjs +3 -0
  17. package/dist/super-editor/ai-writer.es.js +2 -2
  18. package/dist/super-editor/chunks/{converter-a3CAItrf.js → converter-VYPiNbpo.js} +1 -1
  19. package/dist/super-editor/chunks/{docx-zipper-BsmzO0LG.js → docx-zipper-D8Tzq3RX.js} +1 -1
  20. package/dist/super-editor/chunks/{editor-qn0f9LDg.js → editor-mgoEnsBi.js} +1635 -288
  21. package/dist/super-editor/chunks/{index-DNIymDRK.js → index-DDZ1ZT8N.js} +1 -1
  22. package/dist/super-editor/chunks/{toolbar-DW8hTxsF.js → toolbar-DULgxvjl.js} +2 -2
  23. package/dist/super-editor/converter.es.js +1 -1
  24. package/dist/super-editor/docx-zipper.es.js +2 -2
  25. package/dist/super-editor/editor.es.js +3 -3
  26. package/dist/super-editor/file-zipper.es.js +1 -1
  27. package/dist/super-editor/super-editor.es.js +6 -6
  28. package/dist/super-editor/toolbar.es.js +2 -2
  29. package/dist/super-editor.cjs +2 -2
  30. package/dist/super-editor.es.js +2 -2
  31. package/dist/superdoc.cjs +2 -2
  32. package/dist/superdoc.es.js +2 -2
  33. package/dist/superdoc.umd.js +1913 -572
  34. package/dist/superdoc.umd.js.map +1 -1
  35. package/package.json +1 -1
  36. package/dist/chunks/xml-js-Dz51sEbr.cjs +0 -3
  37. package/dist/chunks/xml-js-LkEmUa9-.es.js +0 -2
@@ -1,5 +1,5 @@
1
- import { y as defineComponent, A as h, P as Transition, a0 as process$1, K as watchEffect, a as computed, r as ref, j as onMounted, X as onUnmounted, b as createElementBlock, o as openBlock, f as createBaseVNode, e as createCommentVNode, s as createVNode, x as unref } from "./vue-BuPTonTJ.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-CfSkb15j.es.js";
1
+ import { y as defineComponent, A as h, P as Transition, a0 as process$1, K as watchEffect, a as computed, r as ref, j as onMounted, X as onUnmounted, b as createElementBlock, o as openBlock, f as createBaseVNode, e as createCommentVNode, s as createVNode, x as unref } from "./vue-CLFbn_1r.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-rtbawgUA.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-jWLMl8Ts.cjs");
4
- const superdoc = require("./index-DI2R4qz8.cjs");
3
+ const vue = require("./vue-gvuFr0vx.cjs");
4
+ const superdoc = require("./index-Cf7hdzkm.cjs");
5
5
  function self(vars) {
6
6
  const {
7
7
  opacityDisabled,
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const jszip = require("./jszip-BdEez1WM.cjs");
2
+ const jszip = require("./jszip-qHp7FC78.cjs");
3
3
  var eventemitter3 = { exports: {} };
4
4
  var hasRequiredEventemitter3;
5
5
  function requireEventemitter3() {
@@ -1,4 +1,4 @@
1
- import { g as getDefaultExportFromCjs } from "./jszip-VP334ufO.es.js";
1
+ import { g as getDefaultExportFromCjs } from "./jszip-B690S4j-.es.js";
2
2
  var eventemitter3 = { exports: {} };
3
3
  var hasRequiredEventemitter3;
4
4
  function requireEventemitter3() {
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
- const superEditor_es = require("./super-editor.es-BI8ByUNm.cjs");
2
+ const superEditor_es = require("./super-editor.es-BijxiFs9.cjs");
3
3
  const blankDocx = require("./blank-docx-DfW3Eeh2.cjs");
4
- const eventemitter3 = require("./eventemitter3-DQmQUge-.cjs");
4
+ const eventemitter3 = require("./eventemitter3-DIclNhoR.cjs");
5
5
  const provider = require("@hocuspocus/provider");
6
- const vue = require("./vue-jWLMl8Ts.cjs");
6
+ const vue = require("./vue-gvuFr0vx.cjs");
7
7
  const Y = require("yjs");
8
- const jszip = require("./jszip-BdEez1WM.cjs");
8
+ const jszip = require("./jszip-qHp7FC78.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" } });
@@ -2140,6 +2140,7 @@ const offChange = (eventHandler) => usePolyfill || removeEventListener(
2140
2140
  /** @type {any} */
2141
2141
  eventHandler
2142
2142
  );
2143
+ const EqualityTraitSymbol = Symbol("Equality");
2143
2144
  const keys$1 = Object.keys;
2144
2145
  const map$1 = (obj, f) => {
2145
2146
  const results = [];
@@ -2148,14 +2149,13 @@ const map$1 = (obj, f) => {
2148
2149
  }
2149
2150
  return results;
2150
2151
  };
2151
- const length$1 = (obj) => keys$1(obj).length;
2152
+ const size$1 = (obj) => keys$1(obj).length;
2152
2153
  const hasProperty = (obj, key) => Object.prototype.hasOwnProperty.call(obj, key);
2153
- const EqualityTraitSymbol = Symbol("Equality");
2154
2154
  const equalityDeep = (a, b) => {
2155
2155
  if (a === b) {
2156
2156
  return true;
2157
2157
  }
2158
- if (a == null || b == null || a.constructor !== b.constructor) {
2158
+ if (a == null || b == null || a.constructor !== b.constructor && (a.constructor || Object) !== (b.constructor || Object)) {
2159
2159
  return false;
2160
2160
  }
2161
2161
  if (a[EqualityTraitSymbol] != null) {
@@ -2199,8 +2199,9 @@ const equalityDeep = (a, b) => {
2199
2199
  }
2200
2200
  break;
2201
2201
  }
2202
+ case void 0:
2202
2203
  case Object:
2203
- if (length$1(a) !== length$1(b)) {
2204
+ if (size$1(a) !== size$1(b)) {
2204
2205
  return false;
2205
2206
  }
2206
2207
  for (const key in a) {
@@ -2372,7 +2373,7 @@ const errorUnexpectedEndOfArray = create("Unexpected end of array");
2372
2373
  const errorIntegerOutOfRange = create("Integer out of Range");
2373
2374
  class Decoder {
2374
2375
  /**
2375
- * @param {Uint8Array} uint8Array Binary data to decode
2376
+ * @param {Uint8Array<Buf>} uint8Array Binary data to decode
2376
2377
  */
2377
2378
  constructor(uint8Array) {
2378
2379
  this.arr = uint8Array;
@@ -2523,10 +2524,14 @@ const writeSyncStep2 = (encoder, doc, encodedStateVector) => {
2523
2524
  writeVarUint8Array(encoder, Y__namespace.encodeStateAsUpdate(doc, encodedStateVector));
2524
2525
  };
2525
2526
  const readSyncStep1 = (decoder, encoder, doc) => writeSyncStep2(encoder, doc, readVarUint8Array(decoder));
2526
- const readSyncStep2 = (decoder, doc, transactionOrigin) => {
2527
+ const readSyncStep2 = (decoder, doc, transactionOrigin, errorHandler) => {
2527
2528
  try {
2528
2529
  Y__namespace.applyUpdate(doc, readVarUint8Array(decoder), transactionOrigin);
2529
2530
  } catch (error) {
2531
+ if (errorHandler != null) errorHandler(
2532
+ /** @type {Error} */
2533
+ error
2534
+ );
2530
2535
  console.error("Caught error while handling a Yjs update", error);
2531
2536
  }
2532
2537
  };
@@ -2535,17 +2540,17 @@ const writeUpdate = (encoder, update) => {
2535
2540
  writeVarUint8Array(encoder, update);
2536
2541
  };
2537
2542
  const readUpdate = readSyncStep2;
2538
- const readSyncMessage = (decoder, encoder, doc, transactionOrigin) => {
2543
+ const readSyncMessage = (decoder, encoder, doc, transactionOrigin, errorHandler) => {
2539
2544
  const messageType = readVarUint(decoder);
2540
2545
  switch (messageType) {
2541
2546
  case messageYjsSyncStep1:
2542
2547
  readSyncStep1(decoder, encoder, doc);
2543
2548
  break;
2544
2549
  case messageYjsSyncStep2:
2545
- readSyncStep2(decoder, doc, transactionOrigin);
2550
+ readSyncStep2(decoder, doc, transactionOrigin, errorHandler);
2546
2551
  break;
2547
2552
  case messageYjsUpdate:
2548
- readUpdate(decoder, doc, transactionOrigin);
2553
+ readUpdate(decoder, doc, transactionOrigin, errorHandler);
2549
2554
  break;
2550
2555
  default:
2551
2556
  throw new Error("Unknown message type");
@@ -17482,7 +17487,7 @@ const _sfc_main = {
17482
17487
  __name: "SuperDoc",
17483
17488
  emits: ["selection-update"],
17484
17489
  setup(__props, { emit: __emit }) {
17485
- const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-QwjK1Tx6.cjs")));
17490
+ const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-Dk7wI3bm.cjs")));
17486
17491
  const superdocStore = useSuperdocStore();
17487
17492
  const commentsStore = useCommentsStore();
17488
17493
  const {
@@ -18386,7 +18391,7 @@ class SuperDoc extends eventemitter3.EventEmitter {
18386
18391
  this.config.colors = shuffleArray(this.config.colors);
18387
18392
  this.userColorMap = /* @__PURE__ */ new Map();
18388
18393
  this.colorIndex = 0;
18389
- this.version = "1.0.0-next.9";
18394
+ this.version = "1.0.2";
18390
18395
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
18391
18396
  this.superdocId = config.superdocId || uuid.v4();
18392
18397
  this.colors = this.config.colors;
@@ -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-BI8ByUNm.cjs");
3
+ const superEditor_es = require("./super-editor.es-BijxiFs9.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-B42HV1fg.es.js";
1
+ import { s as getDefaultExportFromCjs$2 } from "./super-editor.es-DFXddrgb.es.js";
2
2
  import { V as VFile } from "./index-CvBqQJbG-CvBqQJbG.es.js";
3
3
  function bail(error) {
4
4
  if (error) {
@@ -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-B42HV1fg.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-DFXddrgb.es.js";
2
2
  import { B as BlankDOCX } from "./blank-docx-ABm6XYAA.es.js";
3
- import { E as EventEmitter } from "./eventemitter3-44XulWQe.es.js";
3
+ import { E as EventEmitter } from "./eventemitter3-D_2kqkfV.es.js";
4
4
  import { HocuspocusProvider, HocuspocusProviderWebsocket } from "@hocuspocus/provider";
5
- import { a1 as effectScope, r as ref, D as markRaw, a0 as process$1, a2 as toRaw, a as computed, a3 as isRef, a4 as isReactive, H as toRef, i as inject, m as getCurrentInstance, l as watch, x as unref, a5 as hasInjectionContext, N as reactive, q as nextTick, a6 as getCurrentScope, a7 as onScopeDispose, a8 as toRefs, g as global$1, C as shallowRef, b as createElementBlock, o as openBlock, t as toDisplayString, O as readonly, j as onMounted, k as onBeforeUnmount, h as onBeforeMount, U as onActivated, p as onDeactivated, G as createTextVNode, F as Fragment, R as Comment, y as defineComponent, E as provide, J as withDirectives, A as h, V as Teleport, S as renderSlot, W as isVNode, K as watchEffect, P as Transition, a9 as TransitionGroup, B as mergeProps, Q as vShow, I as cloneVNode, T as Text, s as createVNode, u as withCtx, f as createBaseVNode, z as normalizeStyle, e as createCommentVNode, v 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-BuPTonTJ.es.js";
5
+ import { a1 as effectScope, r as ref, D as markRaw, a0 as process$1, a2 as toRaw, a as computed, a3 as isRef, a4 as isReactive, H as toRef, i as inject, m as getCurrentInstance, l as watch, x as unref, a5 as hasInjectionContext, N as reactive, q as nextTick, a6 as getCurrentScope, a7 as onScopeDispose, a8 as toRefs, g as global$1, C as shallowRef, b as createElementBlock, o as openBlock, t as toDisplayString, O as readonly, j as onMounted, k as onBeforeUnmount, h as onBeforeMount, U as onActivated, p as onDeactivated, G as createTextVNode, F as Fragment, R as Comment, y as defineComponent, E as provide, J as withDirectives, A as h, V as Teleport, S as renderSlot, W as isVNode, K as watchEffect, P as Transition, a9 as TransitionGroup, B as mergeProps, Q as vShow, I as cloneVNode, T as Text, s as createVNode, u as withCtx, f as createBaseVNode, z as normalizeStyle, e as createCommentVNode, v 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-CLFbn_1r.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-VP334ufO.es.js";
8
+ import { B as Buffer$2 } from "./jszip-B690S4j-.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";
@@ -2123,6 +2123,7 @@ const offChange = (eventHandler) => usePolyfill || removeEventListener(
2123
2123
  /** @type {any} */
2124
2124
  eventHandler
2125
2125
  );
2126
+ const EqualityTraitSymbol = Symbol("Equality");
2126
2127
  const keys$1 = Object.keys;
2127
2128
  const map$1 = (obj, f) => {
2128
2129
  const results = [];
@@ -2131,14 +2132,13 @@ const map$1 = (obj, f) => {
2131
2132
  }
2132
2133
  return results;
2133
2134
  };
2134
- const length$1 = (obj) => keys$1(obj).length;
2135
+ const size$1 = (obj) => keys$1(obj).length;
2135
2136
  const hasProperty = (obj, key) => Object.prototype.hasOwnProperty.call(obj, key);
2136
- const EqualityTraitSymbol = Symbol("Equality");
2137
2137
  const equalityDeep = (a, b) => {
2138
2138
  if (a === b) {
2139
2139
  return true;
2140
2140
  }
2141
- if (a == null || b == null || a.constructor !== b.constructor) {
2141
+ if (a == null || b == null || a.constructor !== b.constructor && (a.constructor || Object) !== (b.constructor || Object)) {
2142
2142
  return false;
2143
2143
  }
2144
2144
  if (a[EqualityTraitSymbol] != null) {
@@ -2182,8 +2182,9 @@ const equalityDeep = (a, b) => {
2182
2182
  }
2183
2183
  break;
2184
2184
  }
2185
+ case void 0:
2185
2186
  case Object:
2186
- if (length$1(a) !== length$1(b)) {
2187
+ if (size$1(a) !== size$1(b)) {
2187
2188
  return false;
2188
2189
  }
2189
2190
  for (const key in a) {
@@ -2355,7 +2356,7 @@ const errorUnexpectedEndOfArray = create("Unexpected end of array");
2355
2356
  const errorIntegerOutOfRange = create("Integer out of Range");
2356
2357
  class Decoder {
2357
2358
  /**
2358
- * @param {Uint8Array} uint8Array Binary data to decode
2359
+ * @param {Uint8Array<Buf>} uint8Array Binary data to decode
2359
2360
  */
2360
2361
  constructor(uint8Array) {
2361
2362
  this.arr = uint8Array;
@@ -2506,10 +2507,14 @@ const writeSyncStep2 = (encoder, doc, encodedStateVector) => {
2506
2507
  writeVarUint8Array(encoder, Y.encodeStateAsUpdate(doc, encodedStateVector));
2507
2508
  };
2508
2509
  const readSyncStep1 = (decoder, encoder, doc) => writeSyncStep2(encoder, doc, readVarUint8Array(decoder));
2509
- const readSyncStep2 = (decoder, doc, transactionOrigin) => {
2510
+ const readSyncStep2 = (decoder, doc, transactionOrigin, errorHandler) => {
2510
2511
  try {
2511
2512
  Y.applyUpdate(doc, readVarUint8Array(decoder), transactionOrigin);
2512
2513
  } catch (error) {
2514
+ if (errorHandler != null) errorHandler(
2515
+ /** @type {Error} */
2516
+ error
2517
+ );
2513
2518
  console.error("Caught error while handling a Yjs update", error);
2514
2519
  }
2515
2520
  };
@@ -2518,17 +2523,17 @@ const writeUpdate = (encoder, update) => {
2518
2523
  writeVarUint8Array(encoder, update);
2519
2524
  };
2520
2525
  const readUpdate = readSyncStep2;
2521
- const readSyncMessage = (decoder, encoder, doc, transactionOrigin) => {
2526
+ const readSyncMessage = (decoder, encoder, doc, transactionOrigin, errorHandler) => {
2522
2527
  const messageType = readVarUint(decoder);
2523
2528
  switch (messageType) {
2524
2529
  case messageYjsSyncStep1:
2525
2530
  readSyncStep1(decoder, encoder, doc);
2526
2531
  break;
2527
2532
  case messageYjsSyncStep2:
2528
- readSyncStep2(decoder, doc, transactionOrigin);
2533
+ readSyncStep2(decoder, doc, transactionOrigin, errorHandler);
2529
2534
  break;
2530
2535
  case messageYjsUpdate:
2531
- readUpdate(decoder, doc, transactionOrigin);
2536
+ readUpdate(decoder, doc, transactionOrigin, errorHandler);
2532
2537
  break;
2533
2538
  default:
2534
2539
  throw new Error("Unknown message type");
@@ -17465,7 +17470,7 @@ const _sfc_main = {
17465
17470
  __name: "SuperDoc",
17466
17471
  emits: ["selection-update"],
17467
17472
  setup(__props, { emit: __emit }) {
17468
- const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-C7Wo4VVN.es.js"));
17473
+ const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-C51KNTCu.es.js"));
17469
17474
  const superdocStore = useSuperdocStore();
17470
17475
  const commentsStore = useCommentsStore();
17471
17476
  const {
@@ -18369,7 +18374,7 @@ class SuperDoc extends EventEmitter {
18369
18374
  this.config.colors = shuffleArray(this.config.colors);
18370
18375
  this.userColorMap = /* @__PURE__ */ new Map();
18371
18376
  this.colorIndex = 0;
18372
- this.version = "1.0.0-next.9";
18377
+ this.version = "1.0.2";
18373
18378
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
18374
18379
  this.superdocId = config.superdocId || v4();
18375
18380
  this.colors = this.config.colors;
@@ -1,4 +1,4 @@
1
- import "./vue-BuPTonTJ.es.js";
1
+ import "./vue-CLFbn_1r.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-jWLMl8Ts.cjs");
2
+ require("./vue-gvuFr0vx.cjs");
3
3
  function getDefaultExportFromCjs(x) {
4
4
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
5
5
  }