@harbour-enterprises/superdoc 0.23.0-next.14 → 0.23.0-next.15

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 (36) hide show
  1. package/dist/chunks/{PdfViewer-D3cgkd9j.cjs → PdfViewer-1MZFKzXW.cjs} +1 -1
  2. package/dist/chunks/{PdfViewer-BaaVD5bX.es.js → PdfViewer-NEyAcxt7.es.js} +1 -1
  3. package/dist/chunks/{eventemitter3-CR2eBWft.es.js → eventemitter3-BWEnUdTY.es.js} +1 -1
  4. package/dist/chunks/{eventemitter3-DSRogsNq.cjs → eventemitter3-DkXkH2rT.cjs} +1 -1
  5. package/dist/chunks/{index-CAHkANZY.cjs → index-CGtSnLpQ.cjs} +160 -465
  6. package/dist/chunks/{index-CESuSQe2.es.js → index-DAT3_wPu.es.js} +27 -332
  7. package/dist/chunks/{super-editor.es-BYutUrPg.cjs → super-editor.es-C7TgrpFl.cjs} +616 -116
  8. package/dist/chunks/{super-editor.es-BKb7p4fi.es.js → super-editor.es-Ctq_imo8.es.js} +616 -116
  9. package/dist/chunks/{xml-js-CWV8R-ek.cjs → xml-js-D_ZIzxu0.cjs} +1 -1
  10. package/dist/chunks/xml-js-Dx4FIjnp.es.js +2 -0
  11. package/dist/core/types/index.d.ts +19 -1
  12. package/dist/core/types/index.d.ts.map +1 -1
  13. package/dist/super-editor/ai-writer.es.js +2 -2
  14. package/dist/super-editor/chunks/{converter-DD7uNz2k.js → converter-vEmAnrOg.js} +665 -249
  15. package/dist/super-editor/chunks/{docx-zipper-DraPR30Z.js → docx-zipper-DA00N7eN.js} +1 -1
  16. package/dist/super-editor/chunks/{editor-xzhKWRFZ.js → editor-Das_uwlq.js} +94 -10
  17. package/dist/super-editor/chunks/{toolbar-D6SJTVWT.js → toolbar-CKugkxNQ.js} +2 -2
  18. package/dist/super-editor/converter.es.js +1 -1
  19. package/dist/super-editor/docx-zipper.es.js +2 -2
  20. package/dist/super-editor/editor.es.js +3 -3
  21. package/dist/super-editor/file-zipper.es.js +1 -1
  22. package/dist/super-editor/src/core/Editor.d.ts +57 -3
  23. package/dist/super-editor/src/core/super-converter/SuperConverter.d.ts +58 -2
  24. package/dist/super-editor/src/core/super-converter/exporter-docx-defs.d.ts +28 -39
  25. package/dist/super-editor/super-editor.es.js +6 -6
  26. package/dist/super-editor/toolbar.es.js +2 -2
  27. package/dist/super-editor.cjs +1 -1
  28. package/dist/super-editor.es.js +1 -1
  29. package/dist/superdoc.cjs +2 -3
  30. package/dist/superdoc.es.js +2 -3
  31. package/dist/superdoc.umd.js +641 -446
  32. package/dist/superdoc.umd.js.map +1 -1
  33. package/package.json +1 -1
  34. package/dist/chunks/xml-js-Bbc0NeKa.es.js +0 -2
  35. package/dist/chunks/{jszip-DAXEPCUv.es.js → jszip-BDk3JBqp.es.js} +3 -3
  36. package/dist/chunks/{jszip-B4LDL19y.cjs → jszip-u4dvXAKa.cjs} +3 -3
@@ -1,11 +1,11 @@
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-BKb7p4fi.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-Ctq_imo8.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
- import { B as Buffer$2 } from "./jszip-DAXEPCUv.es.js";
4
3
  import { B as BlankDOCX } from "./blank-docx-iwdyG9RH.es.js";
5
- import { E as EventEmitter } from "./eventemitter3-CR2eBWft.es.js";
4
+ import { E as EventEmitter } from "./eventemitter3-BWEnUdTY.es.js";
6
5
  import { HocuspocusProvider, HocuspocusProviderWebsocket } from "@hocuspocus/provider";
7
6
  import * as Y from "yjs";
8
7
  import { Doc, Map as Map$2 } from "yjs";
8
+ import { B as Buffer$2 } from "./jszip-BDk3JBqp.es.js";
9
9
  import { v as v4 } from "./uuid-DIIKH5Zc.es.js";
10
10
  const DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
11
11
  const PDF = "application/pdf";
@@ -60,306 +60,6 @@ const vClickOutside = {
60
60
  delete el.__clickOutsideHandler;
61
61
  }
62
62
  };
63
- function getDefaultExportFromCjs(x) {
64
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
65
- }
66
- const CRC_TABLE = new Int32Array([
67
- 0,
68
- 1996959894,
69
- 3993919788,
70
- 2567524794,
71
- 124634137,
72
- 1886057615,
73
- 3915621685,
74
- 2657392035,
75
- 249268274,
76
- 2044508324,
77
- 3772115230,
78
- 2547177864,
79
- 162941995,
80
- 2125561021,
81
- 3887607047,
82
- 2428444049,
83
- 498536548,
84
- 1789927666,
85
- 4089016648,
86
- 2227061214,
87
- 450548861,
88
- 1843258603,
89
- 4107580753,
90
- 2211677639,
91
- 325883990,
92
- 1684777152,
93
- 4251122042,
94
- 2321926636,
95
- 335633487,
96
- 1661365465,
97
- 4195302755,
98
- 2366115317,
99
- 997073096,
100
- 1281953886,
101
- 3579855332,
102
- 2724688242,
103
- 1006888145,
104
- 1258607687,
105
- 3524101629,
106
- 2768942443,
107
- 901097722,
108
- 1119000684,
109
- 3686517206,
110
- 2898065728,
111
- 853044451,
112
- 1172266101,
113
- 3705015759,
114
- 2882616665,
115
- 651767980,
116
- 1373503546,
117
- 3369554304,
118
- 3218104598,
119
- 565507253,
120
- 1454621731,
121
- 3485111705,
122
- 3099436303,
123
- 671266974,
124
- 1594198024,
125
- 3322730930,
126
- 2970347812,
127
- 795835527,
128
- 1483230225,
129
- 3244367275,
130
- 3060149565,
131
- 1994146192,
132
- 31158534,
133
- 2563907772,
134
- 4023717930,
135
- 1907459465,
136
- 112637215,
137
- 2680153253,
138
- 3904427059,
139
- 2013776290,
140
- 251722036,
141
- 2517215374,
142
- 3775830040,
143
- 2137656763,
144
- 141376813,
145
- 2439277719,
146
- 3865271297,
147
- 1802195444,
148
- 476864866,
149
- 2238001368,
150
- 4066508878,
151
- 1812370925,
152
- 453092731,
153
- 2181625025,
154
- 4111451223,
155
- 1706088902,
156
- 314042704,
157
- 2344532202,
158
- 4240017532,
159
- 1658658271,
160
- 366619977,
161
- 2362670323,
162
- 4224994405,
163
- 1303535960,
164
- 984961486,
165
- 2747007092,
166
- 3569037538,
167
- 1256170817,
168
- 1037604311,
169
- 2765210733,
170
- 3554079995,
171
- 1131014506,
172
- 879679996,
173
- 2909243462,
174
- 3663771856,
175
- 1141124467,
176
- 855842277,
177
- 2852801631,
178
- 3708648649,
179
- 1342533948,
180
- 654459306,
181
- 3188396048,
182
- 3373015174,
183
- 1466479909,
184
- 544179635,
185
- 3110523913,
186
- 3462522015,
187
- 1591671054,
188
- 702138776,
189
- 2966460450,
190
- 3352799412,
191
- 1504918807,
192
- 783551873,
193
- 3082640443,
194
- 3233442989,
195
- 3988292384,
196
- 2596254646,
197
- 62317068,
198
- 1957810842,
199
- 3939845945,
200
- 2647816111,
201
- 81470997,
202
- 1943803523,
203
- 3814918930,
204
- 2489596804,
205
- 225274430,
206
- 2053790376,
207
- 3826175755,
208
- 2466906013,
209
- 167816743,
210
- 2097651377,
211
- 4027552580,
212
- 2265490386,
213
- 503444072,
214
- 1762050814,
215
- 4150417245,
216
- 2154129355,
217
- 426522225,
218
- 1852507879,
219
- 4275313526,
220
- 2312317920,
221
- 282753626,
222
- 1742555852,
223
- 4189708143,
224
- 2394877945,
225
- 397917763,
226
- 1622183637,
227
- 3604390888,
228
- 2714866558,
229
- 953729732,
230
- 1340076626,
231
- 3518719985,
232
- 2797360999,
233
- 1068828381,
234
- 1219638859,
235
- 3624741850,
236
- 2936675148,
237
- 906185462,
238
- 1090812512,
239
- 3747672003,
240
- 2825379669,
241
- 829329135,
242
- 1181335161,
243
- 3412177804,
244
- 3160834842,
245
- 628085408,
246
- 1382605366,
247
- 3423369109,
248
- 3138078467,
249
- 570562233,
250
- 1426400815,
251
- 3317316542,
252
- 2998733608,
253
- 733239954,
254
- 1555261956,
255
- 3268935591,
256
- 3050360625,
257
- 752459403,
258
- 1541320221,
259
- 2607071920,
260
- 3965973030,
261
- 1969922972,
262
- 40735498,
263
- 2617837225,
264
- 3943577151,
265
- 1913087877,
266
- 83908371,
267
- 2512341634,
268
- 3803740692,
269
- 2075208622,
270
- 213261112,
271
- 2463272603,
272
- 3855990285,
273
- 2094854071,
274
- 198958881,
275
- 2262029012,
276
- 4057260610,
277
- 1759359992,
278
- 534414190,
279
- 2176718541,
280
- 4139329115,
281
- 1873836001,
282
- 414664567,
283
- 2282248934,
284
- 4279200368,
285
- 1711684554,
286
- 285281116,
287
- 2405801727,
288
- 4167216745,
289
- 1634467795,
290
- 376229701,
291
- 2685067896,
292
- 3608007406,
293
- 1308918612,
294
- 956543938,
295
- 2808555105,
296
- 3495958263,
297
- 1231636301,
298
- 1047427035,
299
- 2932959818,
300
- 3654703836,
301
- 1088359270,
302
- 936918e3,
303
- 2847714899,
304
- 3736837829,
305
- 1202900863,
306
- 817233897,
307
- 3183342108,
308
- 3401237130,
309
- 1404277552,
310
- 615818150,
311
- 3134207493,
312
- 3453421203,
313
- 1423857449,
314
- 601450431,
315
- 3009837614,
316
- 3294710456,
317
- 1567103746,
318
- 711928724,
319
- 3020668471,
320
- 3272380065,
321
- 1510334235,
322
- 755167117
323
- ]);
324
- function ensureBuffer(input) {
325
- if (Buffer$2.isBuffer(input)) {
326
- return input;
327
- }
328
- if (typeof input === "number") {
329
- return Buffer$2.alloc(input);
330
- } else if (typeof input === "string") {
331
- return Buffer$2.from(input);
332
- } else {
333
- throw new Error("input must be buffer, number, or string, received " + typeof input);
334
- }
335
- }
336
- function bufferizeInt(num) {
337
- const tmp = ensureBuffer(4);
338
- tmp.writeInt32BE(num, 0);
339
- return tmp;
340
- }
341
- function _crc32(buf, previous) {
342
- buf = ensureBuffer(buf);
343
- if (Buffer$2.isBuffer(previous)) {
344
- previous = previous.readUInt32BE(0);
345
- }
346
- let crc = ~~previous ^ -1;
347
- for (var n = 0; n < buf.length; n++) {
348
- crc = CRC_TABLE[(crc ^ buf[n]) & 255] ^ crc >>> 8;
349
- }
350
- return crc ^ -1;
351
- }
352
- function crc32() {
353
- return bufferizeInt(_crc32.apply(null, arguments));
354
- }
355
- crc32.signed = function() {
356
- return _crc32.apply(null, arguments);
357
- };
358
- crc32.unsigned = function() {
359
- return _crc32.apply(null, arguments) >>> 0;
360
- };
361
- var bufferCrc32 = crc32;
362
- const index = /* @__PURE__ */ getDefaultExportFromCjs(bufferCrc32);
363
63
  function randomBytes(length2) {
364
64
  const array = new Uint8Array(length2);
365
65
  for (let i = 0; i < length2; i++) {
@@ -371,7 +71,9 @@ class Telemetry {
371
71
  /** @type {boolean} */
372
72
  enabled;
373
73
  /** @type {string} */
374
- superdocId;
74
+ documentGuid;
75
+ /** @type {string} */
76
+ documentIdentifier;
375
77
  /** @type {string} */
376
78
  superdocVersion;
377
79
  /** @type {string} */
@@ -412,7 +114,8 @@ class Telemetry {
412
114
  this.enabled = config.enabled ?? true;
413
115
  this.licenseKey = config.licenseKey ?? Telemetry.COMMUNITY_LICENSE_KEY;
414
116
  this.endpoint = config.endpoint ?? Telemetry.DEFAULT_ENDPOINT;
415
- this.superdocId = config.superdocId;
117
+ this.documentGuid = config.documentGuid;
118
+ this.documentIdentifier = config.documentIdentifier;
416
119
  this.superdocVersion = config.superdocVersion;
417
120
  this.sessionId = this.generateId();
418
121
  }
@@ -444,7 +147,10 @@ class Telemetry {
444
147
  type: "usage",
445
148
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
446
149
  sessionId: this.sessionId,
447
- superdocId: this.superdocId,
150
+ documentGuid: this.documentGuid,
151
+ // Updated field name
152
+ documentIdentifier: this.documentIdentifier,
153
+ // Include both
448
154
  superdocVersion: this.superdocVersion,
449
155
  file: this.documentInfo,
450
156
  browser: this.getBrowserInfo(),
@@ -511,13 +217,17 @@ class Telemetry {
511
217
  * Track file structure
512
218
  * @param {Object} structure - File structure information
513
219
  * @param {File} fileSource - original file
514
- * @param {String} documentId - document ID
515
- * @param {string} internalId - document ID form settings.xml
220
+ * @param {String} documentId - document GUID
221
+ * @param {string} documentIdentifier - document identifier (GUID or hash)
222
+ * @param {string} internalId - document ID from settings.xml
516
223
  */
517
- async trackFileStructure(structure, fileSource, documentId, internalId) {
224
+ async trackFileStructure(structure, fileSource, documentId, documentIdentifier, internalId) {
518
225
  this.fileStructure = structure;
519
226
  this.documentInfo = await this.processDocument(fileSource, {
520
- id: documentId,
227
+ guid: documentId,
228
+ // Updated parameter name
229
+ identifier: documentIdentifier,
230
+ // New parameter
521
231
  internalId
522
232
  });
523
233
  }
@@ -532,34 +242,19 @@ class Telemetry {
532
242
  console.warn("Telemetry: missing file source");
533
243
  return {};
534
244
  }
535
- let hash = "";
536
- try {
537
- hash = await this.generateCrc32Hash(file);
538
- } catch (error) {
539
- console.error("Failed to generate file hash:", error);
540
- }
541
245
  return {
542
- id: options.id,
246
+ guid: options.guid,
247
+ // Updated from 'id'
248
+ identifier: options.identifier,
249
+ // New field
543
250
  name: file.name,
544
251
  size: file.size,
545
- crc32: hash,
546
252
  lastModified: file.lastModified ? new Date(file.lastModified).toISOString() : null,
547
253
  type: file.type || "docx",
548
254
  internalId: options.internalId
255
+ // Microsoft's GUID if present
549
256
  };
550
257
  }
551
- /**
552
- * Generate CRC32 hash for a file
553
- * @param {File} file - File to hash
554
- * @returns {Promise<string>} CRC32 hash
555
- * @private
556
- */
557
- async generateCrc32Hash(file) {
558
- const arrayBuffer = await file.arrayBuffer();
559
- const buffer = Buffer$2.from(arrayBuffer);
560
- const hashBuffer = index(buffer);
561
- return hashBuffer.toString("hex");
562
- }
563
258
  isTelemetryDataChanged() {
564
259
  const initialStatistics = {};
565
260
  const initialFileStructure = {};
@@ -4466,7 +4161,7 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
4466
4161
  }, 0);
4467
4162
  };
4468
4163
  const createCommentForTrackChanges = (editor) => {
4469
- let trackedChanges = index$1.getTrackChanges(editor.state);
4164
+ let trackedChanges = index.getTrackChanges(editor.state);
4470
4165
  const groupedChanges = groupChanges(trackedChanges);
4471
4166
  const { tr } = editor.view.state;
4472
4167
  const { dispatch } = editor.view;
@@ -17404,7 +17099,7 @@ const _sfc_main = {
17404
17099
  __name: "SuperDoc",
17405
17100
  emits: ["selection-update"],
17406
17101
  setup(__props, { emit: __emit }) {
17407
- const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-BaaVD5bX.es.js"));
17102
+ const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-NEyAcxt7.es.js"));
17408
17103
  const superdocStore = useSuperdocStore();
17409
17104
  const commentsStore = useCommentsStore();
17410
17105
  const {