@harbour-enterprises/superdoc 0.19.0-next.3 → 0.19.0-next.5

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 (65) hide show
  1. package/dist/chunks/{PdfViewer-e5Sqf3uK.es.js → PdfViewer-C2898kqZ.es.js} +1 -1
  2. package/dist/chunks/{PdfViewer-BXpR6HYz.cjs → PdfViewer-DaZtoNpm.cjs} +1 -1
  3. package/dist/chunks/{index-Bgbca9Qo.es.js → index-CkJ5hnvC.es.js} +107 -7
  4. package/dist/chunks/{index-Dg8DEGbE.cjs → index-Di9R4Aas.cjs} +107 -7
  5. package/dist/chunks/{super-editor.es-BbN2QJLe.cjs → super-editor.es-DG-S6GN9.cjs} +503 -208
  6. package/dist/chunks/{super-editor.es-Dga1v3zZ.es.js → super-editor.es-kuaVTS8t.es.js} +503 -208
  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-CMajoq-M.js → converter-CrJvpQ8J.js} +456 -203
  15. package/dist/super-editor/chunks/{docx-zipper-C5rg6GNf.js → docx-zipper-CHHaFCfj.js} +1 -1
  16. package/dist/super-editor/chunks/{editor-CH3sE8Fq.js → editor-DlzGbfD-.js} +45 -3
  17. package/dist/super-editor/chunks/{toolbar-BHnLBr61.js → toolbar-DeKOVf4h.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/src/core/super-converter/exporter.d.ts +0 -7
  24. package/dist/super-editor/src/core/super-converter/v2/importer/tableImporter.d.ts +0 -22
  25. package/dist/super-editor/src/core/super-converter/v3/handlers/utils.d.ts +37 -0
  26. package/dist/super-editor/src/core/super-converter/v3/handlers/w/cantSplit/cantSplit-translator.d.ts +6 -0
  27. package/dist/super-editor/src/core/super-converter/v3/handlers/w/cantSplit/index.d.ts +1 -0
  28. package/dist/super-editor/src/core/super-converter/v3/handlers/w/cnfStyle/cnfStyle-translator.d.ts +7 -0
  29. package/dist/super-editor/src/core/super-converter/v3/handlers/w/cnfStyle/index.d.ts +1 -0
  30. package/dist/super-editor/src/core/super-converter/v3/handlers/w/divId/divId-translator.d.ts +6 -0
  31. package/dist/super-editor/src/core/super-converter/v3/handlers/w/divId/index.d.ts +1 -0
  32. package/dist/super-editor/src/core/super-converter/v3/handlers/w/gridAfter/gridAfter-translator.d.ts +6 -0
  33. package/dist/super-editor/src/core/super-converter/v3/handlers/w/gridAfter/index.d.ts +1 -0
  34. package/dist/super-editor/src/core/super-converter/v3/handlers/w/gridBefore/gridBefore-translator.d.ts +6 -0
  35. package/dist/super-editor/src/core/super-converter/v3/handlers/w/gridBefore/index.d.ts +1 -0
  36. package/dist/super-editor/src/core/super-converter/v3/handlers/w/hidden/hidden-translator.d.ts +6 -0
  37. package/dist/super-editor/src/core/super-converter/v3/handlers/w/hidden/index.d.ts +1 -0
  38. package/dist/super-editor/src/core/super-converter/v3/handlers/w/jc/index.d.ts +1 -0
  39. package/dist/super-editor/src/core/super-converter/v3/handlers/w/jc/jc-translator.d.ts +6 -0
  40. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tblCellSpacing/index.d.ts +1 -0
  41. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tblCellSpacing/tblCellSpacing-translator.d.ts +6 -0
  42. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tblHeader/index.d.ts +1 -0
  43. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tblHeader/tblHeader-translator.d.ts +6 -0
  44. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tr/index.d.ts +1 -0
  45. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tr/tr-translator.d.ts +7 -0
  46. package/dist/super-editor/src/core/super-converter/v3/handlers/w/trHeight/index.d.ts +1 -0
  47. package/dist/super-editor/src/core/super-converter/v3/handlers/w/trHeight/trHeight-translator.d.ts +6 -0
  48. package/dist/super-editor/src/core/super-converter/v3/handlers/w/trPr/index.d.ts +1 -0
  49. package/dist/super-editor/src/core/super-converter/v3/handlers/w/trPr/trPr-translator.d.ts +5 -0
  50. package/dist/super-editor/src/core/super-converter/v3/handlers/w/wAfter/index.d.ts +1 -0
  51. package/dist/super-editor/src/core/super-converter/v3/handlers/w/wAfter/wAfter-translator.d.ts +6 -0
  52. package/dist/super-editor/src/core/super-converter/v3/handlers/w/wBefore/index.d.ts +1 -0
  53. package/dist/super-editor/src/core/super-converter/v3/handlers/w/wBefore/wBefore-translator.d.ts +6 -0
  54. package/dist/super-editor/src/core/super-converter/v3/node-translator/node-translator.d.ts +2 -1
  55. package/dist/super-editor/src/extensions/table-row/table-row.d.ts +149 -0
  56. package/dist/super-editor/style.css +6 -6
  57. package/dist/super-editor/super-editor.es.js +8 -8
  58. package/dist/super-editor/toolbar.es.js +2 -2
  59. package/dist/super-editor.cjs +1 -1
  60. package/dist/super-editor.es.js +1 -1
  61. package/dist/superdoc.cjs +2 -2
  62. package/dist/superdoc.es.js +2 -2
  63. package/dist/superdoc.umd.js +608 -213
  64. package/dist/superdoc.umd.js.map +1 -1
  65. package/package.json +1 -1
@@ -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-CkJ5hnvC.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-Di9R4Aas.cjs");
5
5
  function self(vars) {
6
6
  const {
7
7
  opacityDisabled,
@@ -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-kuaVTS8t.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-C2898kqZ.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() {
@@ -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-DG-S6GN9.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-DaZtoNpm.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() {