@harbour-enterprises/superdoc 0.19.0-next.3 → 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.
@@ -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-Bgbca9Qo.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-Dg8DEGbE.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-BbN2QJLe.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-BXpR6HYz.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 {
@@ -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-Dga1v3zZ.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-e5Sqf3uK.es.js"));
17344
+ const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-Df9H8xeA.es.js"));
17266
17345
  const superdocStore = useSuperdocStore();
17267
17346
  const commentsStore = useCommentsStore();
17268
17347
  const {
@@ -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() {
@@ -81010,7 +81010,7 @@ const _sfc_main$1 = {
81010
81010
  required: false
81011
81011
  },
81012
81012
  fileSource: {
81013
- type: File,
81013
+ type: [File, Blob],
81014
81014
  required: false
81015
81015
  },
81016
81016
  state: {
@@ -81290,7 +81290,7 @@ const _sfc_main$1 = {
81290
81290
  };
81291
81291
  }
81292
81292
  };
81293
- 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"]]);
81294
81294
  const _hoisted_1 = ["innerHTML"];
81295
81295
  const _sfc_main = {
81296
81296
  __name: "SuperInput",
@@ -80993,7 +80993,7 @@ const _sfc_main$1 = {
80993
80993
  required: false
80994
80994
  },
80995
80995
  fileSource: {
80996
- type: File,
80996
+ type: [File, Blob],
80997
80997
  required: false
80998
80998
  },
80999
80999
  state: {
@@ -81273,7 +81273,7 @@ const _sfc_main$1 = {
81273
81273
  };
81274
81274
  }
81275
81275
  };
81276
- 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"]]);
81277
81277
  const _hoisted_1 = ["innerHTML"];
81278
81278
  const _sfc_main = {
81279
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,kBAAkB,GAAG,SAAS,CAC/D;IAET,qBAAqB;IACrB,QADW,MAAM,CAwDf;IAiBA,4BAA6B;IAC7B,mBAAmB;IAMnB,gBAA+C;IAC/C,iBAAgC;IAehC,WAA4B;IAE5B,YAAkB;IAElB,eAAuC;IAEvC;;;;;;;;;;;;0BAqqB8kid,aAAa;;;;;;;;;;;6BAA8vJ,aAAa;;;;;;;;;;;;;;;;mCAAmnU,aAAa;0BAA5snB,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;iDAAo68B,UAAU;kDAAuV,UAAU,aAA+E,UAAU;oCAAgZ,UAAU;;;;;;;;;MArqBjh3e;IACxB,gBAAkB;I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BAC7C,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"}
package/dist/style.css CHANGED
@@ -2172,10 +2172,10 @@ on the right if it is inside shape textbox.
2172
2172
  min-height: 40px;
2173
2173
  }
2174
2174
 
2175
- .editor-element[data-v-dc9f9cb3] {
2175
+ .editor-element[data-v-8b2f8c17] {
2176
2176
  position: relative;
2177
2177
  }
2178
- .super-editor-container[data-v-dc9f9cb3] {
2178
+ .super-editor-container[data-v-8b2f8c17] {
2179
2179
  width: auto;
2180
2180
  height: auto;
2181
2181
  min-width: 8in;
@@ -2184,13 +2184,13 @@ on the right if it is inside shape textbox.
2184
2184
  display: flex;
2185
2185
  flex-direction: column;
2186
2186
  }
2187
- .ruler[data-v-dc9f9cb3] {
2187
+ .ruler[data-v-8b2f8c17] {
2188
2188
  margin-bottom: 2px;
2189
2189
  }
2190
- .super-editor[data-v-dc9f9cb3] {
2190
+ .super-editor[data-v-8b2f8c17] {
2191
2191
  color: initial;
2192
2192
  }
2193
- .placeholder-editor[data-v-dc9f9cb3] {
2193
+ .placeholder-editor[data-v-8b2f8c17] {
2194
2194
  position: absolute;
2195
2195
  top: 0;
2196
2196
  left: 0;
@@ -2202,7 +2202,7 @@ on the right if it is inside shape textbox.
2202
2202
  background-color: white;
2203
2203
  box-sizing: border-box;
2204
2204
  }
2205
- .placeholder-title[data-v-dc9f9cb3] {
2205
+ .placeholder-title[data-v-8b2f8c17] {
2206
2206
  display: flex;
2207
2207
  justify-content: center;
2208
2208
  margin-bottom: 40px;
@@ -2340,18 +2340,18 @@ img[data-v-7dd69850] {
2340
2340
  border-color: transparent;
2341
2341
  }
2342
2342
 
2343
- .superdoc-html-viewer[data-v-7bd2cb5d] {
2343
+ .superdoc-html-viewer[data-v-da3494ba] {
2344
2344
  font-family: initial;
2345
2345
  color: initial;
2346
2346
  width: 100%;
2347
2347
  height: auto;
2348
2348
  position: relative;
2349
2349
  }
2350
- .superdoc-html-viewer__document[data-v-7bd2cb5d] {
2350
+ .superdoc-html-viewer__document[data-v-da3494ba] {
2351
2351
  width: 100%;
2352
2352
  height: auto;
2353
2353
  }
2354
- .superdoc-html-viewer__content[data-v-7bd2cb5d] {
2354
+ .superdoc-html-viewer__content[data-v-da3494ba] {
2355
2355
  width: 100%;
2356
2356
  min-width: 800px;
2357
2357
  padding: 38px 75px 75px;
@@ -45,7 +45,7 @@
45
45
  * @property {string} [role='editor'] - User role ('editor', 'viewer', 'suggester')
46
46
  * @property {Array} [colors=[]] - Available colors
47
47
  * @property {Object} [converter] - Document converter
48
- * @property {Object} [fileSource] - Source of the file
48
+ * @property {File|Blob|Buffer} [fileSource] - Source of the file (File/Blob in browser, Buffer in Node.js)
49
49
  * @property {Object} [initialState] - Initial editor state
50
50
  * @property {string} [documentId] - Unique document identifier
51
51
  * @property {Array} [extensions=[]] - Editor extensions
@@ -647,9 +647,9 @@ export type EditorOptions = {
647
647
  */
648
648
  converter?: any;
649
649
  /**
650
- * - Source of the file
650
+ * - Source of the file (File/Blob in browser, Buffer in Node.js)
651
651
  */
652
- fileSource?: any;
652
+ fileSource?: File | Blob | Buffer;
653
653
  /**
654
654
  * - Initial editor state
655
655
  */
@@ -1798,10 +1798,10 @@ on the right if it is inside shape textbox.
1798
1798
  min-height: 40px;
1799
1799
  }
1800
1800
 
1801
- .editor-element[data-v-dc9f9cb3] {
1801
+ .editor-element[data-v-8b2f8c17] {
1802
1802
  position: relative;
1803
1803
  }
1804
- .super-editor-container[data-v-dc9f9cb3] {
1804
+ .super-editor-container[data-v-8b2f8c17] {
1805
1805
  width: auto;
1806
1806
  height: auto;
1807
1807
  min-width: 8in;
@@ -1810,13 +1810,13 @@ on the right if it is inside shape textbox.
1810
1810
  display: flex;
1811
1811
  flex-direction: column;
1812
1812
  }
1813
- .ruler[data-v-dc9f9cb3] {
1813
+ .ruler[data-v-8b2f8c17] {
1814
1814
  margin-bottom: 2px;
1815
1815
  }
1816
- .super-editor[data-v-dc9f9cb3] {
1816
+ .super-editor[data-v-8b2f8c17] {
1817
1817
  color: initial;
1818
1818
  }
1819
- .placeholder-editor[data-v-dc9f9cb3] {
1819
+ .placeholder-editor[data-v-8b2f8c17] {
1820
1820
  position: absolute;
1821
1821
  top: 0;
1822
1822
  left: 0;
@@ -1828,7 +1828,7 @@ on the right if it is inside shape textbox.
1828
1828
  background-color: white;
1829
1829
  box-sizing: border-box;
1830
1830
  }
1831
- .placeholder-title[data-v-dc9f9cb3] {
1831
+ .placeholder-title[data-v-8b2f8c17] {
1832
1832
  display: flex;
1833
1833
  justify-content: center;
1834
1834
  margin-bottom: 40px;