@harbour-enterprises/superdoc 0.19.0-next.2 → 0.19.0-next.4

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 (32) hide show
  1. package/dist/chunks/{PdfViewer-D59q6eRC.es.js → PdfViewer-Df9H8xeA.es.js} +1 -1
  2. package/dist/chunks/{PdfViewer-D-X0_rBI.cjs → PdfViewer-DmC4Qg1S.cjs} +1 -1
  3. package/dist/chunks/{index-Q9QnSj8V.cjs → index-CWQGBk3Z.cjs} +108 -8
  4. package/dist/chunks/{index-DYxO8sGC.es.js → index-C_oHQN7n.es.js} +108 -8
  5. package/dist/chunks/{super-editor.es-DfRBE7HT.cjs → super-editor.es-B_u6OGsf.cjs} +6 -10
  6. package/dist/chunks/{super-editor.es-DcrpYhcf.es.js → super-editor.es-C2QwEj1z.es.js} +6 -10
  7. package/dist/core/SuperDoc.d.ts +6 -6
  8. package/dist/core/SuperDoc.d.ts.map +1 -1
  9. package/dist/core/helpers/file.d.ts +44 -0
  10. package/dist/core/helpers/file.d.ts.map +1 -0
  11. package/dist/stores/superdoc-store.d.ts.map +1 -1
  12. package/dist/style.css +9 -9
  13. package/dist/super-editor/ai-writer.es.js +2 -2
  14. package/dist/super-editor/chunks/{converter-C8B4S-1x.js → converter-CMajoq-M.js} +2 -2
  15. package/dist/super-editor/chunks/{docx-zipper-BOcyXVbk.js → docx-zipper-C5rg6GNf.js} +1 -1
  16. package/dist/super-editor/chunks/{editor-DSLtHYXL.js → editor-CH3sE8Fq.js} +4 -8
  17. package/dist/super-editor/chunks/{toolbar-bgMTmwZ7.js → toolbar-BHnLBr61.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 +3 -3
  23. package/dist/super-editor/style.css +6 -6
  24. package/dist/super-editor/super-editor.es.js +8 -8
  25. package/dist/super-editor/toolbar.es.js +2 -2
  26. package/dist/super-editor.cjs +1 -1
  27. package/dist/super-editor.es.js +1 -1
  28. package/dist/superdoc.cjs +2 -2
  29. package/dist/superdoc.es.js +2 -2
  30. package/dist/superdoc.umd.js +112 -16
  31. package/dist/superdoc.umd.js.map +1 -1
  32. package/package.json +2 -2
@@ -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-CXxsqYcP.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-DYxO8sGC.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-C_oHQN7n.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
3
  const vue = require("./vue-DWle4Cai.cjs");
4
- const superdoc = require("./index-Q9QnSj8V.cjs");
4
+ const superdoc = require("./index-CWQGBk3Z.cjs");
5
5
  function self(vars) {
6
6
  const {
7
7
  opacityDisabled,
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const superEditor_es = require("./super-editor.es-DfRBE7HT.cjs");
2
+ const superEditor_es = require("./super-editor.es-B_u6OGsf.cjs");
3
3
  const vue = require("./vue-DWle4Cai.cjs");
4
4
  const jszip = require("./jszip-b7l8QkfH.cjs");
5
5
  const blankDocx = require("./blank-docx-CPqX9RF5.cjs");
@@ -2138,6 +2138,59 @@ function storeToRefs(store) {
2138
2138
  return refs;
2139
2139
  }
2140
2140
  }
2141
+ const extractBrowserFile = (input) => {
2142
+ if (!input) return null;
2143
+ if (typeof File === "function" && input instanceof File) return input;
2144
+ if (typeof Blob === "function" && input instanceof Blob) {
2145
+ const hasFileCtor = typeof File === "function";
2146
+ if (hasFileCtor) {
2147
+ const name = input.name || "document";
2148
+ return new File([input], name, { type: input.type });
2149
+ }
2150
+ return input;
2151
+ }
2152
+ if (input.originFileObj) return extractBrowserFile(input.originFileObj);
2153
+ if (input.file) return extractBrowserFile(input.file);
2154
+ if (input.raw) return extractBrowserFile(input.raw);
2155
+ return null;
2156
+ };
2157
+ const inferTypeFromName = (name = "") => {
2158
+ const lower = String(name).toLowerCase();
2159
+ if (lower.endsWith(".docx")) return DOCX;
2160
+ if (lower.endsWith(".pdf")) return PDF;
2161
+ if (lower.endsWith(".html") || lower.endsWith(".htm")) return HTML;
2162
+ if (lower.endsWith(".md") || lower.endsWith(".markdown")) return "text/markdown";
2163
+ return "";
2164
+ };
2165
+ const normalizeDocumentEntry = (entry) => {
2166
+ const maybeFile = extractBrowserFile(entry);
2167
+ if (maybeFile) {
2168
+ const name = (
2169
+ /** @type {any} */
2170
+ maybeFile.name || entry && entry.name || "document"
2171
+ );
2172
+ const type = maybeFile.type || inferTypeFromName(name) || DOCX;
2173
+ return {
2174
+ type,
2175
+ data: maybeFile,
2176
+ name,
2177
+ isNewFile: true
2178
+ };
2179
+ }
2180
+ if (entry && typeof entry === "object" && "data" in entry) {
2181
+ const file = extractBrowserFile(entry.data);
2182
+ if (file) {
2183
+ const type = entry.type || file.type || inferTypeFromName(file.name) || DOCX;
2184
+ return {
2185
+ ...entry,
2186
+ type,
2187
+ data: file,
2188
+ name: entry.name || file.name || "document"
2189
+ };
2190
+ }
2191
+ }
2192
+ return entry;
2193
+ };
2141
2194
  function useFieldValueWatcher(field, originalValue) {
2142
2195
  const fieldId = field.itemid;
2143
2196
  const rawField = field;
@@ -3991,13 +4044,39 @@ const useSuperdocStore = /* @__PURE__ */ defineStore("superdoc", () => {
3991
4044
  }
3992
4045
  }
3993
4046
  };
4047
+ const _blobToFile = (blob, name, type) => {
4048
+ return new File([blob], name, { type });
4049
+ };
3994
4050
  const _initializeDocumentData = async (doc) => {
4051
+ doc = normalizeDocumentEntry(doc);
3995
4052
  if (currentConfig.value?.html) doc.html = currentConfig.value.html;
3996
4053
  if (!doc.data && doc.url && !doc.type) doc.type = DOCX;
3997
4054
  if (currentConfig.value?.modules.collaboration && !doc.isNewFile) {
3998
4055
  return { ...doc, data: null, url: null };
3999
4056
  }
4000
- if (doc.data) return doc;
4057
+ if (doc.data instanceof File) {
4058
+ let fileName = doc.name;
4059
+ const extension = doc.type === DOCX ? ".docx" : doc.type === PDF ? ".pdf" : ".bin";
4060
+ if (!fileName) {
4061
+ fileName = `document${extension}`;
4062
+ } else if (!fileName.includes(".")) {
4063
+ fileName = `${fileName}${extension}`;
4064
+ }
4065
+ if (doc.data.name !== fileName) {
4066
+ const fileObject = _blobToFile(doc.data, fileName, doc.data.type || doc.type);
4067
+ return { ...doc, name: fileName, data: fileObject };
4068
+ }
4069
+ if (!doc.name) return { ...doc, name: fileName };
4070
+ return doc;
4071
+ } else if (doc.data instanceof Blob) {
4072
+ let fileName = doc.name;
4073
+ if (!fileName) {
4074
+ const extension = doc.type === DOCX ? ".docx" : doc.type === PDF ? ".pdf" : ".bin";
4075
+ fileName = `document${extension}`;
4076
+ }
4077
+ const fileObject = _blobToFile(doc.data, fileName, doc.data.type || doc.type);
4078
+ return { ...doc, data: fileObject };
4079
+ } else if (doc.data) return doc;
4001
4080
  else if (doc.url && doc.type) {
4002
4081
  if (doc.type.toLowerCase() === "docx") doc.type = DOCX;
4003
4082
  else if (doc.type.toLowerCase() === "pdf") doc.type = PDF;
@@ -17039,7 +17118,7 @@ const _sfc_main$2 = {
17039
17118
  __name: "HtmlViewer",
17040
17119
  props: {
17041
17120
  fileSource: {
17042
- type: File,
17121
+ type: [File, Blob],
17043
17122
  required: true
17044
17123
  },
17045
17124
  documentId: {
@@ -17094,7 +17173,7 @@ const _sfc_main$2 = {
17094
17173
  };
17095
17174
  }
17096
17175
  };
17097
- const HtmlViewer = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-7bd2cb5d"]]);
17176
+ const HtmlViewer = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-da3494ba"]]);
17098
17177
  const _hoisted_1$1 = {
17099
17178
  class: "ai-highlight-container",
17100
17179
  id: "aiHighlightContainer"
@@ -17279,7 +17358,7 @@ const _sfc_main = {
17279
17358
  __name: "SuperDoc",
17280
17359
  emits: ["selection-update"],
17281
17360
  setup(__props, { emit: __emit }) {
17282
- const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-D-X0_rBI.cjs")));
17361
+ const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-DmC4Qg1S.cjs")));
17283
17362
  const superdocStore = useSuperdocStore();
17284
17363
  const commentsStore = useCommentsStore();
17285
17364
  const {
@@ -17923,7 +18002,7 @@ class SuperDoc extends eventemitter3.EventEmitter {
17923
18002
  this.config.colors = shuffleArray(this.config.colors);
17924
18003
  this.userColorMap = /* @__PURE__ */ new Map();
17925
18004
  this.colorIndex = 0;
17926
- this.version = "0.19.0-next.0";
18005
+ this.version = "0.18.1";
17927
18006
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
17928
18007
  this.superdocId = config.superdocId || uuid.v4();
17929
18008
  this.colors = this.config.colors;
@@ -17972,13 +18051,15 @@ class SuperDoc extends eventemitter3.EventEmitter {
17972
18051
  const doc = this.config.document;
17973
18052
  const hasDocumentConfig = !!doc && typeof doc === "object" && Object.keys(this.config.document)?.length;
17974
18053
  const hasDocumentUrl = !!doc && typeof doc === "string" && doc.length > 0;
17975
- const hasDocumentFile = !!doc && doc instanceof File;
18054
+ const hasDocumentFile = !!doc && typeof File === "function" && doc instanceof File;
18055
+ const hasDocumentBlob = !!doc && doc instanceof Blob && !(doc instanceof File);
17976
18056
  const hasListOfDocuments = this.config.documents && this.config.documents?.length;
17977
18057
  if (hasDocumentConfig && hasListOfDocuments) {
17978
18058
  console.warn("🦋 [superdoc] You can only provide one of document or documents");
17979
18059
  }
17980
18060
  if (hasDocumentConfig) {
17981
- this.config.documents = [this.config.document];
18061
+ const normalized = normalizeDocumentEntry(this.config.document);
18062
+ this.config.documents = [normalized];
17982
18063
  } else if (hasDocumentUrl) {
17983
18064
  this.config.documents = [
17984
18065
  {
@@ -17997,6 +18078,25 @@ class SuperDoc extends eventemitter3.EventEmitter {
17997
18078
  isNewFile: true
17998
18079
  }
17999
18080
  ];
18081
+ } else if (hasDocumentBlob) {
18082
+ const docType = this.config.document.type || DOCX;
18083
+ let extension = ".docx";
18084
+ if (docType === PDF) {
18085
+ extension = ".pdf";
18086
+ } else if (docType === HTML) {
18087
+ extension = ".html";
18088
+ }
18089
+ this.config.documents = [
18090
+ {
18091
+ type: docType,
18092
+ data: this.config.document,
18093
+ name: `document${extension}`,
18094
+ isNewFile: true
18095
+ }
18096
+ ];
18097
+ }
18098
+ if (Array.isArray(this.config.documents) && this.config.documents.length > 0) {
18099
+ this.config.documents = this.config.documents.map((d) => normalizeDocumentEntry(d));
18000
18100
  }
18001
18101
  }
18002
18102
  #initVueApp() {
@@ -1,4 +1,4 @@
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-DcrpYhcf.es.js";
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-C2QwEj1z.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-CXxsqYcP.es.js";
3
3
  import { B as Buffer$2 } from "./jszip-B8KIZSNe.es.js";
4
4
  import { B as BlankDOCX } from "./blank-docx-iwdyG9RH.es.js";
@@ -2121,6 +2121,59 @@ function storeToRefs(store) {
2121
2121
  return refs;
2122
2122
  }
2123
2123
  }
2124
+ const extractBrowserFile = (input) => {
2125
+ if (!input) return null;
2126
+ if (typeof File === "function" && input instanceof File) return input;
2127
+ if (typeof Blob === "function" && input instanceof Blob) {
2128
+ const hasFileCtor = typeof File === "function";
2129
+ if (hasFileCtor) {
2130
+ const name = input.name || "document";
2131
+ return new File([input], name, { type: input.type });
2132
+ }
2133
+ return input;
2134
+ }
2135
+ if (input.originFileObj) return extractBrowserFile(input.originFileObj);
2136
+ if (input.file) return extractBrowserFile(input.file);
2137
+ if (input.raw) return extractBrowserFile(input.raw);
2138
+ return null;
2139
+ };
2140
+ const inferTypeFromName = (name = "") => {
2141
+ const lower = String(name).toLowerCase();
2142
+ if (lower.endsWith(".docx")) return DOCX;
2143
+ if (lower.endsWith(".pdf")) return PDF;
2144
+ if (lower.endsWith(".html") || lower.endsWith(".htm")) return HTML;
2145
+ if (lower.endsWith(".md") || lower.endsWith(".markdown")) return "text/markdown";
2146
+ return "";
2147
+ };
2148
+ const normalizeDocumentEntry = (entry) => {
2149
+ const maybeFile = extractBrowserFile(entry);
2150
+ if (maybeFile) {
2151
+ const name = (
2152
+ /** @type {any} */
2153
+ maybeFile.name || entry && entry.name || "document"
2154
+ );
2155
+ const type = maybeFile.type || inferTypeFromName(name) || DOCX;
2156
+ return {
2157
+ type,
2158
+ data: maybeFile,
2159
+ name,
2160
+ isNewFile: true
2161
+ };
2162
+ }
2163
+ if (entry && typeof entry === "object" && "data" in entry) {
2164
+ const file = extractBrowserFile(entry.data);
2165
+ if (file) {
2166
+ const type = entry.type || file.type || inferTypeFromName(file.name) || DOCX;
2167
+ return {
2168
+ ...entry,
2169
+ type,
2170
+ data: file,
2171
+ name: entry.name || file.name || "document"
2172
+ };
2173
+ }
2174
+ }
2175
+ return entry;
2176
+ };
2124
2177
  function useFieldValueWatcher(field, originalValue) {
2125
2178
  const fieldId = field.itemid;
2126
2179
  const rawField = field;
@@ -3974,13 +4027,39 @@ const useSuperdocStore = /* @__PURE__ */ defineStore("superdoc", () => {
3974
4027
  }
3975
4028
  }
3976
4029
  };
4030
+ const _blobToFile = (blob, name, type) => {
4031
+ return new File([blob], name, { type });
4032
+ };
3977
4033
  const _initializeDocumentData = async (doc) => {
4034
+ doc = normalizeDocumentEntry(doc);
3978
4035
  if (currentConfig.value?.html) doc.html = currentConfig.value.html;
3979
4036
  if (!doc.data && doc.url && !doc.type) doc.type = DOCX;
3980
4037
  if (currentConfig.value?.modules.collaboration && !doc.isNewFile) {
3981
4038
  return { ...doc, data: null, url: null };
3982
4039
  }
3983
- if (doc.data) return doc;
4040
+ if (doc.data instanceof File) {
4041
+ let fileName = doc.name;
4042
+ const extension = doc.type === DOCX ? ".docx" : doc.type === PDF ? ".pdf" : ".bin";
4043
+ if (!fileName) {
4044
+ fileName = `document${extension}`;
4045
+ } else if (!fileName.includes(".")) {
4046
+ fileName = `${fileName}${extension}`;
4047
+ }
4048
+ if (doc.data.name !== fileName) {
4049
+ const fileObject = _blobToFile(doc.data, fileName, doc.data.type || doc.type);
4050
+ return { ...doc, name: fileName, data: fileObject };
4051
+ }
4052
+ if (!doc.name) return { ...doc, name: fileName };
4053
+ return doc;
4054
+ } else if (doc.data instanceof Blob) {
4055
+ let fileName = doc.name;
4056
+ if (!fileName) {
4057
+ const extension = doc.type === DOCX ? ".docx" : doc.type === PDF ? ".pdf" : ".bin";
4058
+ fileName = `document${extension}`;
4059
+ }
4060
+ const fileObject = _blobToFile(doc.data, fileName, doc.data.type || doc.type);
4061
+ return { ...doc, data: fileObject };
4062
+ } else if (doc.data) return doc;
3984
4063
  else if (doc.url && doc.type) {
3985
4064
  if (doc.type.toLowerCase() === "docx") doc.type = DOCX;
3986
4065
  else if (doc.type.toLowerCase() === "pdf") doc.type = PDF;
@@ -17022,7 +17101,7 @@ const _sfc_main$2 = {
17022
17101
  __name: "HtmlViewer",
17023
17102
  props: {
17024
17103
  fileSource: {
17025
- type: File,
17104
+ type: [File, Blob],
17026
17105
  required: true
17027
17106
  },
17028
17107
  documentId: {
@@ -17077,7 +17156,7 @@ const _sfc_main$2 = {
17077
17156
  };
17078
17157
  }
17079
17158
  };
17080
- const HtmlViewer = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-7bd2cb5d"]]);
17159
+ const HtmlViewer = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-da3494ba"]]);
17081
17160
  const _hoisted_1$1 = {
17082
17161
  class: "ai-highlight-container",
17083
17162
  id: "aiHighlightContainer"
@@ -17262,7 +17341,7 @@ const _sfc_main = {
17262
17341
  __name: "SuperDoc",
17263
17342
  emits: ["selection-update"],
17264
17343
  setup(__props, { emit: __emit }) {
17265
- const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-D59q6eRC.es.js"));
17344
+ const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-Df9H8xeA.es.js"));
17266
17345
  const superdocStore = useSuperdocStore();
17267
17346
  const commentsStore = useCommentsStore();
17268
17347
  const {
@@ -17906,7 +17985,7 @@ class SuperDoc extends EventEmitter {
17906
17985
  this.config.colors = shuffleArray(this.config.colors);
17907
17986
  this.userColorMap = /* @__PURE__ */ new Map();
17908
17987
  this.colorIndex = 0;
17909
- this.version = "0.19.0-next.0";
17988
+ this.version = "0.18.1";
17910
17989
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
17911
17990
  this.superdocId = config.superdocId || v4();
17912
17991
  this.colors = this.config.colors;
@@ -17955,13 +18034,15 @@ class SuperDoc extends EventEmitter {
17955
18034
  const doc = this.config.document;
17956
18035
  const hasDocumentConfig = !!doc && typeof doc === "object" && Object.keys(this.config.document)?.length;
17957
18036
  const hasDocumentUrl = !!doc && typeof doc === "string" && doc.length > 0;
17958
- const hasDocumentFile = !!doc && doc instanceof File;
18037
+ const hasDocumentFile = !!doc && typeof File === "function" && doc instanceof File;
18038
+ const hasDocumentBlob = !!doc && doc instanceof Blob && !(doc instanceof File);
17959
18039
  const hasListOfDocuments = this.config.documents && this.config.documents?.length;
17960
18040
  if (hasDocumentConfig && hasListOfDocuments) {
17961
18041
  console.warn("🦋 [superdoc] You can only provide one of document or documents");
17962
18042
  }
17963
18043
  if (hasDocumentConfig) {
17964
- this.config.documents = [this.config.document];
18044
+ const normalized = normalizeDocumentEntry(this.config.document);
18045
+ this.config.documents = [normalized];
17965
18046
  } else if (hasDocumentUrl) {
17966
18047
  this.config.documents = [
17967
18048
  {
@@ -17980,6 +18061,25 @@ class SuperDoc extends EventEmitter {
17980
18061
  isNewFile: true
17981
18062
  }
17982
18063
  ];
18064
+ } else if (hasDocumentBlob) {
18065
+ const docType = this.config.document.type || DOCX;
18066
+ let extension = ".docx";
18067
+ if (docType === PDF) {
18068
+ extension = ".pdf";
18069
+ } else if (docType === HTML) {
18070
+ extension = ".html";
18071
+ }
18072
+ this.config.documents = [
18073
+ {
18074
+ type: docType,
18075
+ data: this.config.document,
18076
+ name: `document${extension}`,
18077
+ isNewFile: true
18078
+ }
18079
+ ];
18080
+ }
18081
+ if (Array.isArray(this.config.documents) && this.config.documents.length > 0) {
18082
+ this.config.documents = this.config.documents.map((d) => normalizeDocumentEntry(d));
17983
18083
  }
17984
18084
  }
17985
18085
  #initVueApp() {
@@ -30786,7 +30786,7 @@ const _SuperConverter = class _SuperConverter2 {
30786
30786
  return;
30787
30787
  }
30788
30788
  }
30789
- static updateDocumentVersion(docx = this.convertedXml, version2 = "0.19.0-next.0") {
30789
+ static updateDocumentVersion(docx = this.convertedXml, version2 = "0.18.1") {
30790
30790
  const customLocation = "docProps/custom.xml";
30791
30791
  if (!docx[customLocation]) {
30792
30792
  docx[customLocation] = generateCustomXml();
@@ -31268,7 +31268,7 @@ function storeSuperdocVersion(docx) {
31268
31268
  function generateCustomXml() {
31269
31269
  return DEFAULT_CUSTOM_XML;
31270
31270
  }
31271
- function generateSuperdocVersion(pid = 2, version2 = "0.19.0-next.0") {
31271
+ function generateSuperdocVersion(pid = 2, version2 = "0.18.1") {
31272
31272
  return {
31273
31273
  type: "element",
31274
31274
  name: "property",
@@ -48442,7 +48442,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
48442
48442
  * @returns {Object | void} Migration results
48443
48443
  */
48444
48444
  processCollaborationMigrations() {
48445
- console.debug("[checkVersionMigrations] Current editor version", "0.19.0-next.0");
48445
+ console.debug("[checkVersionMigrations] Current editor version", "0.18.1");
48446
48446
  if (!this.options.ydoc) return;
48447
48447
  const metaMap = this.options.ydoc.getMap("meta");
48448
48448
  let docVersion = metaMap.get("version");
@@ -58888,11 +58888,7 @@ const ContentBlock = Node$1.create({
58888
58888
  ];
58889
58889
  },
58890
58890
  renderDOM({ htmlAttributes }) {
58891
- return [
58892
- "div",
58893
- Attribute2.mergeAttributes(this.options.htmlAttributes, htmlAttributes, { "data-type": this.name }),
58894
- 0
58895
- ];
58891
+ return ["div", Attribute2.mergeAttributes(this.options.htmlAttributes, htmlAttributes, { "data-type": this.name })];
58896
58892
  },
58897
58893
  addCommands() {
58898
58894
  return {
@@ -81014,7 +81010,7 @@ const _sfc_main$1 = {
81014
81010
  required: false
81015
81011
  },
81016
81012
  fileSource: {
81017
- type: File,
81013
+ type: [File, Blob],
81018
81014
  required: false
81019
81015
  },
81020
81016
  state: {
@@ -81294,7 +81290,7 @@ const _sfc_main$1 = {
81294
81290
  };
81295
81291
  }
81296
81292
  };
81297
- const SuperEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-dc9f9cb3"]]);
81293
+ const SuperEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-8b2f8c17"]]);
81298
81294
  const _hoisted_1 = ["innerHTML"];
81299
81295
  const _sfc_main = {
81300
81296
  __name: "SuperInput",
@@ -30769,7 +30769,7 @@ const _SuperConverter = class _SuperConverter2 {
30769
30769
  return;
30770
30770
  }
30771
30771
  }
30772
- static updateDocumentVersion(docx = this.convertedXml, version2 = "0.19.0-next.0") {
30772
+ static updateDocumentVersion(docx = this.convertedXml, version2 = "0.18.1") {
30773
30773
  const customLocation = "docProps/custom.xml";
30774
30774
  if (!docx[customLocation]) {
30775
30775
  docx[customLocation] = generateCustomXml();
@@ -31251,7 +31251,7 @@ function storeSuperdocVersion(docx) {
31251
31251
  function generateCustomXml() {
31252
31252
  return DEFAULT_CUSTOM_XML;
31253
31253
  }
31254
- function generateSuperdocVersion(pid = 2, version2 = "0.19.0-next.0") {
31254
+ function generateSuperdocVersion(pid = 2, version2 = "0.18.1") {
31255
31255
  return {
31256
31256
  type: "element",
31257
31257
  name: "property",
@@ -48425,7 +48425,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
48425
48425
  * @returns {Object | void} Migration results
48426
48426
  */
48427
48427
  processCollaborationMigrations() {
48428
- console.debug("[checkVersionMigrations] Current editor version", "0.19.0-next.0");
48428
+ console.debug("[checkVersionMigrations] Current editor version", "0.18.1");
48429
48429
  if (!this.options.ydoc) return;
48430
48430
  const metaMap = this.options.ydoc.getMap("meta");
48431
48431
  let docVersion = metaMap.get("version");
@@ -58871,11 +58871,7 @@ const ContentBlock = Node$1.create({
58871
58871
  ];
58872
58872
  },
58873
58873
  renderDOM({ htmlAttributes }) {
58874
- return [
58875
- "div",
58876
- Attribute2.mergeAttributes(this.options.htmlAttributes, htmlAttributes, { "data-type": this.name }),
58877
- 0
58878
- ];
58874
+ return ["div", Attribute2.mergeAttributes(this.options.htmlAttributes, htmlAttributes, { "data-type": this.name })];
58879
58875
  },
58880
58876
  addCommands() {
58881
58877
  return {
@@ -80997,7 +80993,7 @@ const _sfc_main$1 = {
80997
80993
  required: false
80998
80994
  },
80999
80995
  fileSource: {
81000
- type: File,
80996
+ type: [File, Blob],
81001
80997
  required: false
81002
80998
  },
81003
80999
  state: {
@@ -81277,7 +81273,7 @@ const _sfc_main$1 = {
81277
81273
  };
81278
81274
  }
81279
81275
  };
81280
- const SuperEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-dc9f9cb3"]]);
81276
+ const SuperEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-8b2f8c17"]]);
81281
81277
  const _hoisted_1 = ["innerHTML"];
81282
81278
  const _sfc_main = {
81283
81279
  __name: "SuperInput",
@@ -15,7 +15,7 @@
15
15
  * @typedef {Object} Document
16
16
  * @property {string} [id] The ID of the document
17
17
  * @property {string} type The type of the document
18
- * @property {File | null} [data] The initial data of the document
18
+ * @property {File | Blob | null} [data] The initial data of the document (File, Blob, or null)
19
19
  * @property {string} [name] The name of the document
20
20
  * @property {string} [url] The URL of the document
21
21
  * @property {boolean} [isNewFile] Whether the document is a new file
@@ -44,7 +44,7 @@
44
44
  * @property {string} selector The selector to mount the SuperDoc into
45
45
  * @property {DocumentMode} documentMode The mode of the document
46
46
  * @property {'editor' | 'viewer' | 'suggester'} [role] The role of the user in this SuperDoc
47
- * @property {Object | string} [document] The document to load. If a string, it will be treated as a URL
47
+ * @property {Object | string | File | Blob} [document] The document to load. If a string, it will be treated as a URL. If a File or Blob, it will be used directly.
48
48
  * @property {Array<Document>} documents The documents to load
49
49
  * @property {User} [user] The current user of this SuperDoc
50
50
  * @property {Array<User>} [users] All users of this SuperDoc (can be used for "@"-mentions)
@@ -450,9 +450,9 @@ export type Document = {
450
450
  */
451
451
  type: string;
452
452
  /**
453
- * The initial data of the document
453
+ * The initial data of the document (File, Blob, or null)
454
454
  */
455
- data?: File | null;
455
+ data?: File | Blob | null;
456
456
  /**
457
457
  * The name of the document
458
458
  */
@@ -592,9 +592,9 @@ export type Config = {
592
592
  */
593
593
  role?: "editor" | "viewer" | "suggester";
594
594
  /**
595
- * The document to load. If a string, it will be treated as a URL
595
+ * The document to load. If a string, it will be treated as a URL. If a File or Blob, it will be used directly.
596
596
  */
597
- document?: any | string;
597
+ document?: any | string | File | Blob;
598
598
  /**
599
599
  * The documents to load
600
600
  */
@@ -1 +1 @@
1
- {"version":3,"file":"SuperDoc.d.ts","sourceRoot":"","sources":["../../src/core/SuperDoc.js"],"names":[],"mappings":"AAeA;;;;;GAKG;AAEH;;;;;;GAMG;AAEH;;;;;;;;;;GAUG;AAEH;;;;;;;;GAQG;AAEH,2EAA2E;AAE3E;;;;;GAKG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AAEH;;;;;;GAMG;AACH;IACE,4BAA4B;IAC5B,qBADW,KAAK,CAAC,MAAM,CAAC,CACgB;IAwExC;;OAEG;IACH,oBAFW,MAAM,EAKhB;IA5ED,qBAAqB;IACrB,SADW,MAAM,CACT;IAER,qBAAqB;IACrB,OADW,IAAI,EAAE,CACX;IAEN,4CAA4C;IAC5C,MADW,OAAO,KAAK,EAAE,GAAG,GAAG,SAAS,CACnC;IAEL,4EAA4E;IAC5E,UADW,OAAO,sBAAsB,EAAE,kBAA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E,OAAO,CAAA;KAAE,KAAK,IAAI;;;;8BACzC,CAAC,MAAM,EAAE,EAAE,KAAC,GAAA;;;;aACZ,MAAM;;;;uBACN,KAAQ;;;;iBACR,OAAO;;;;YACP,MAAM;;;;oBACN,KAAQ;;;;eACR,OAAO;;;;wBACP,CAAS,IAAI,EAAJ,IAAI,KAAG,OAAO,CAAC,MAAM,CAAC;;;;eAC/B,IAAI;;;;aACJ,OAAO;;;;gCACP,OAAO;;;;;;;;yBAEP,OAAO;;;;WACP,MAAM;;;;eACN,MAAM;;;;cACN,OAAO;;6BA7GQ,eAAe;0BASlB,0CAA0C;6BAJ5B,mCAAmC;8BAC7C,iEAAiE"}
@@ -0,0 +1,44 @@
1
+ export function extractBrowserFile(input: File | Blob | UploadWrapper | any): File | Blob | null;
2
+ export function normalizeDocumentEntry(entry: File | Blob | UploadWrapper | DocumentEntry | any): DocumentEntry | any;
3
+ export type UploadWrapper = {
4
+ /**
5
+ * Underlying file reference used by some uploaders
6
+ */
7
+ originFileObj?: File | Blob;
8
+ /**
9
+ * Underlying file reference used by some uploaders
10
+ */
11
+ file?: File | Blob;
12
+ /**
13
+ * Underlying file reference used by some uploaders
14
+ */
15
+ raw?: File | Blob;
16
+ /**
17
+ * Optional unique id from uploaders (ignored)
18
+ */
19
+ uid?: string | number;
20
+ /**
21
+ * Display name (not always reliable for the native file)
22
+ */
23
+ name?: string;
24
+ };
25
+ export type DocumentEntry = {
26
+ /**
27
+ * Mime type or shorthand ('docx' | 'pdf' | 'html')
28
+ */
29
+ type?: string;
30
+ /**
31
+ * Filename to display
32
+ */
33
+ name?: string;
34
+ /**
35
+ * File-like data; normalized to File when available, otherwise Blob
36
+ */
37
+ data?: File | Blob | UploadWrapper;
38
+ /**
39
+ * Remote URL to fetch; left as-is for URL flows
40
+ */
41
+ url?: string;
42
+ isNewFile?: boolean;
43
+ };
44
+ //# sourceMappingURL=file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../../src/core/helpers/file.js"],"names":[],"mappings":"AA2BO,0CAHI,IAAI,GAAC,IAAI,GAAC,aAAa,GAAC,GAAG,GACzB,IAAI,GAAC,IAAI,GAAC,IAAI,CA2B1B;AAwBM,8CAHI,IAAI,GAAC,IAAI,GAAC,aAAa,GAAC,aAAa,GAAC,GAAG,GACvC,aAAa,GAAC,GAAG,CAgC7B;;;;;oBAtGa,IAAI,GAAC,IAAI;;;;WACT,IAAI,GAAC,IAAI;;;;UACT,IAAI,GAAC,IAAI;;;;UACT,MAAM,GAAC,MAAM;;;;WACb,MAAM;;;;;;WAKN,MAAM;;;;WACN,MAAM;;;;WACN,IAAI,GAAC,IAAI,GAAC,aAAa;;;;UACvB,MAAM;gBACN,OAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"superdoc-store.d.ts","sourceRoot":"","sources":["../../src/stores/superdoc-store.js"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SA8LG"}
1
+ {"version":3,"file":"superdoc-store.d.ts","sourceRoot":"","sources":["../../src/stores/superdoc-store.js"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAyOG"}