@harbour-enterprises/superdoc 0.27.0-next.4 → 0.27.1-next.1

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 (27) hide show
  1. package/dist/chunks/{PdfViewer-CsMYG9jY.cjs → PdfViewer-D1wcDnR4.cjs} +1 -1
  2. package/dist/chunks/{PdfViewer-BH326izt.es.js → PdfViewer-dcU8F_uX.es.js} +1 -1
  3. package/dist/chunks/{index-DlKmbda5.cjs → index-D8RQjzAM.cjs} +8 -3
  4. package/dist/chunks/{index-D4gqW11N.es.js → index-VdXS4BGS.es.js} +8 -3
  5. package/dist/chunks/{super-editor.es-BOSseISU.cjs → super-editor.es-BTccp5sI.cjs} +29 -24
  6. package/dist/chunks/{super-editor.es-IuxTXi0S.es.js → super-editor.es-BWP2VUoh.es.js} +29 -24
  7. package/dist/super-editor/ai-writer.es.js +2 -2
  8. package/dist/super-editor/chunks/{converter-DW0ykKpx.js → converter-DwGV6AKh.js} +25 -20
  9. package/dist/super-editor/chunks/{docx-zipper-eWjTV-8Q.js → docx-zipper-BWiHkJHs.js} +1 -1
  10. package/dist/super-editor/chunks/{editor-CUz7q8Xz.js → editor-DrYNbZWD.js} +6 -6
  11. package/dist/super-editor/chunks/{toolbar-DglPzsaY.js → toolbar-DGd07o4Z.js} +2 -2
  12. package/dist/super-editor/converter.es.js +1 -1
  13. package/dist/super-editor/docx-zipper.es.js +2 -2
  14. package/dist/super-editor/editor.es.js +3 -3
  15. package/dist/super-editor/file-zipper.es.js +1 -1
  16. package/dist/super-editor/super-editor/src/core/super-converter/helpers.d.ts +1 -1
  17. package/dist/super-editor/super-editor/src/core/super-converter/v3/handlers/wp/helpers/encode-image-node-helpers.d.ts +1 -3
  18. package/dist/super-editor/super-editor/src/extensions/vector-shape/VectorShapeView.d.ts +1 -1
  19. package/dist/super-editor/super-editor.es.js +6 -6
  20. package/dist/super-editor/toolbar.es.js +2 -2
  21. package/dist/super-editor.cjs +1 -1
  22. package/dist/super-editor.es.js +1 -1
  23. package/dist/superdoc.cjs +2 -2
  24. package/dist/superdoc.es.js +2 -2
  25. package/dist/superdoc.umd.js +35 -25
  26. package/dist/superdoc.umd.js.map +1 -1
  27. package/package.json +1 -1
@@ -9,14 +9,14 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
9
9
  var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
10
10
  var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
11
11
  var _SuperToolbar_instances, initToolbarGroups_fn, _interceptedCommands, makeToolbarItems_fn, initDefaultFonts_fn, updateHighlightColors_fn, deactivateAll_fn, updateToolbarHistory_fn, enrichTrackedChanges_fn, runCommandWithArgumentOnly_fn;
12
- import { aA as getDefaultExportFromCjs, V as v4, T as TextSelection$1, v as getMarkRange, aD as vClickOutside, H as findParentNode, aE as getActiveFormatting, av as isInTable, aF as readFromClipboard, aG as handleClipboardPaste, aH as getFileObject, aI as runPropertyTranslators, aJ as translator, aK as translator$1, aL as translator$2, aM as translator$3, aN as translator$4, aO as translator$5, aP as translator$6, aQ as translator$7, aR as translator$8, aS as translator$9, aT as translator$a, aU as translator$b, aV as translator$c, aW as translator$d, aX as translator$e, aY as commentRangeEndTranslator, aZ as commentRangeStartTranslator, a_ as translator$f, a$ as translator$g, b0 as translator$h, b1 as translator$i, b2 as translator$j, b3 as translator$k, b4 as translator$l, b5 as translator$m, b6 as translator$n, b7 as translator$o, b8 as translator$p, b9 as translator$q, ba as translator$r, bb as translator$s, bc as translator$t, bd as translator$u, be as translator$v, bf as translator$w, bg as translator$x, bh as translator$y, bi as translator$z, bj as translator$A, bk as translator$B, bl as translator$C, bm as translator$D, bn as translator$E, bo as translator$F, bp as translator$G, bq as translator$H, br as translator$I, bs as translator$J, bt as translator$K, bu as translator$L, bv as translator$M, bw as translator$N, bx as translator$O, by as translator$P, bz as translator$Q, bA as translator$R, bB as translator$S, bC as translator$T, bD as translator$U, bE as translator$V, bF as translator$W, bG as translator$X, bH as translator$Y, bI as translator$Z, bJ as translator$_, bK as translator$$, bL as translator$10, bM as translator$11, bN as translator$12, bO as translator$13, bP as translator$14, bQ as translator$15, bR as translator$16, bS as translator$17, bT as translator$18, bU as translator$19, bV as translator$1a, bW as translator$1b, bX as translator$1c, bY as translator$1d, bZ as translator$1e, b_ as translator$1f, b$ as translator$1g, c0 as translator$1h, P as PluginKey, a as Plugin } from "./chunks/converter-DW0ykKpx.js";
13
- import { c1, a5, i, a2 } from "./chunks/converter-DW0ykKpx.js";
14
- import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, c as getFileOpener, d as checkAndProcessImage, r as replaceSelectionWithImagePlaceholder, e as uploadAndInsertImage, f as collectTrackedChanges, i as isTrackedChangeActionAllowed, y as yUndoPluginKey, h as undoDepth, j as redoDepth, k as collectTrackedChangesForContext, s as shouldBypassContextMenu, S as SlashMenuPluginKey, E as Editor, l as getStarterExtensions, P as Placeholder, m as getRichTextExtensions, D as DecorationSet, n as Decoration, M as Mark, o as Extension, A as Attribute, N as Node } from "./chunks/editor-CUz7q8Xz.js";
15
- import { t, C, v, T, p, w, q } from "./chunks/editor-CUz7q8Xz.js";
12
+ import { aA as getDefaultExportFromCjs, V as v4, T as TextSelection$1, v as getMarkRange, aD as vClickOutside, H as findParentNode, aE as getActiveFormatting, av as isInTable, aF as readFromClipboard, aG as handleClipboardPaste, aH as getFileObject, aI as runPropertyTranslators, aJ as translator, aK as translator$1, aL as translator$2, aM as translator$3, aN as translator$4, aO as translator$5, aP as translator$6, aQ as translator$7, aR as translator$8, aS as translator$9, aT as translator$a, aU as translator$b, aV as translator$c, aW as translator$d, aX as translator$e, aY as commentRangeEndTranslator, aZ as commentRangeStartTranslator, a_ as translator$f, a$ as translator$g, b0 as translator$h, b1 as translator$i, b2 as translator$j, b3 as translator$k, b4 as translator$l, b5 as translator$m, b6 as translator$n, b7 as translator$o, b8 as translator$p, b9 as translator$q, ba as translator$r, bb as translator$s, bc as translator$t, bd as translator$u, be as translator$v, bf as translator$w, bg as translator$x, bh as translator$y, bi as translator$z, bj as translator$A, bk as translator$B, bl as translator$C, bm as translator$D, bn as translator$E, bo as translator$F, bp as translator$G, bq as translator$H, br as translator$I, bs as translator$J, bt as translator$K, bu as translator$L, bv as translator$M, bw as translator$N, bx as translator$O, by as translator$P, bz as translator$Q, bA as translator$R, bB as translator$S, bC as translator$T, bD as translator$U, bE as translator$V, bF as translator$W, bG as translator$X, bH as translator$Y, bI as translator$Z, bJ as translator$_, bK as translator$$, bL as translator$10, bM as translator$11, bN as translator$12, bO as translator$13, bP as translator$14, bQ as translator$15, bR as translator$16, bS as translator$17, bT as translator$18, bU as translator$19, bV as translator$1a, bW as translator$1b, bX as translator$1c, bY as translator$1d, bZ as translator$1e, b_ as translator$1f, b$ as translator$1g, c0 as translator$1h, P as PluginKey, a as Plugin } from "./chunks/converter-DwGV6AKh.js";
13
+ import { c1, a5, i, a2 } from "./chunks/converter-DwGV6AKh.js";
14
+ import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, c as getFileOpener, d as checkAndProcessImage, r as replaceSelectionWithImagePlaceholder, e as uploadAndInsertImage, f as collectTrackedChanges, i as isTrackedChangeActionAllowed, y as yUndoPluginKey, h as undoDepth, j as redoDepth, k as collectTrackedChangesForContext, s as shouldBypassContextMenu, S as SlashMenuPluginKey, E as Editor, l as getStarterExtensions, P as Placeholder, m as getRichTextExtensions, D as DecorationSet, n as Decoration, M as Mark, o as Extension, A as Attribute, N as Node } from "./chunks/editor-DrYNbZWD.js";
15
+ import { t, C, v, T, p, w, q } from "./chunks/editor-DrYNbZWD.js";
16
16
  import { ref, onMounted, createElementBlock, openBlock, normalizeClass, unref, Fragment, renderList, createElementVNode, withModifiers, toDisplayString, createCommentVNode, normalizeStyle, computed, watch, withDirectives, withKeys, vModelText, createTextVNode, createVNode, h, createApp, markRaw, nextTick, onBeforeUnmount, reactive, onUnmounted, renderSlot, shallowRef, createBlock, withCtx, resolveDynamicComponent, normalizeProps, guardReactiveProps } from "vue";
17
- import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, p as plusIconSvg, a as trashIconSvg, b as borderNoneIconSvg, c as arrowsToDotIconSvg, d as arrowsLeftRightIconSvg, w as wrenchIconSvg, m as magicWandIcon, e as checkIconSvg$1, x as xMarkIconSvg, l as linkIconSvg, f as tableIconSvg, g as scissorsIconSvg, h as copyIconSvg, i as pasteIconSvg, u as useMessage, N as NSkeleton } from "./chunks/toolbar-DglPzsaY.js";
17
+ import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, p as plusIconSvg, a as trashIconSvg, b as borderNoneIconSvg, c as arrowsToDotIconSvg, d as arrowsLeftRightIconSvg, w as wrenchIconSvg, m as magicWandIcon, e as checkIconSvg$1, x as xMarkIconSvg, l as linkIconSvg, f as tableIconSvg, g as scissorsIconSvg, h as copyIconSvg, i as pasteIconSvg, u as useMessage, N as NSkeleton } from "./chunks/toolbar-DGd07o4Z.js";
18
18
  import AIWriter from "./ai-writer.es.js";
19
- import { D } from "./chunks/docx-zipper-eWjTV-8Q.js";
19
+ import { D } from "./chunks/docx-zipper-BWiHkJHs.js";
20
20
  import { createZip } from "./file-zipper.es.js";
21
21
  var eventemitter3 = { exports: {} };
22
22
  var hasRequiredEventemitter3;
@@ -1,6 +1,6 @@
1
1
  import "vue";
2
- import { T } from "./chunks/toolbar-DglPzsaY.js";
3
- import "./chunks/editor-CUz7q8Xz.js";
2
+ import { T } from "./chunks/toolbar-DGd07o4Z.js";
3
+ import "./chunks/editor-DrYNbZWD.js";
4
4
  export {
5
5
  T as default
6
6
  };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const superEditor_es = require("./chunks/super-editor.es-BOSseISU.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-BTccp5sI.cjs");
4
4
  require("./chunks/vue-DKMj1I9B.cjs");
5
5
  exports.AIWriter = superEditor_es.AIWriter;
6
6
  exports.AnnotatorHelpers = superEditor_es.AnnotatorHelpers;
@@ -1,4 +1,4 @@
1
- import { A, a, _, C, D, E, b, S, c, d, e, f, g, T, h, i, j, k, l, m, n, o, p, r, q } from "./chunks/super-editor.es-IuxTXi0S.es.js";
1
+ import { A, a, _, C, D, E, b, S, c, d, e, f, g, T, h, i, j, k, l, m, n, o, p, r, q } from "./chunks/super-editor.es-BWP2VUoh.es.js";
2
2
  import "./chunks/vue-ZWZLQtoU.es.js";
3
3
  export {
4
4
  A as AIWriter,
package/dist/superdoc.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const superEditor_es = require("./chunks/super-editor.es-BOSseISU.cjs");
4
- const superdoc = require("./chunks/index-DlKmbda5.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-BTccp5sI.cjs");
4
+ const superdoc = require("./chunks/index-D8RQjzAM.cjs");
5
5
  require("./chunks/vue-DKMj1I9B.cjs");
6
6
  const blankDocx = require("./chunks/blank-docx-DfW3Eeh2.cjs");
7
7
  exports.AnnotatorHelpers = superEditor_es.AnnotatorHelpers;
@@ -1,5 +1,5 @@
1
- import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-IuxTXi0S.es.js";
2
- import { D, H, P, S as S2, m, l } from "./chunks/index-D4gqW11N.es.js";
1
+ import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-BWP2VUoh.es.js";
2
+ import { D, H, P, S as S2, m, l } from "./chunks/index-VdXS4BGS.es.js";
3
3
  import "./chunks/vue-ZWZLQtoU.es.js";
4
4
  import { B } from "./chunks/blank-docx-ABm6XYAA.es.js";
5
5
  export {
@@ -22974,7 +22974,7 @@
22974
22974
  };
22975
22975
  const REMOTE_RESOURCE_PATTERN = /^https?:|^blob:|^file:/i;
22976
22976
  const DATA_URI_PATTERN = /^data:/i;
22977
- const getArrayBufferFromUrl = async (input, _isHeadless) => {
22977
+ const getArrayBufferFromUrl = async (input) => {
22978
22978
  if (input == null) {
22979
22979
  return new ArrayBuffer(0);
22980
22980
  }
@@ -22985,6 +22985,9 @@
22985
22985
  const view = input;
22986
22986
  return view.buffer.slice(view.byteOffset, view.byteOffset + view.byteLength);
22987
22987
  }
22988
+ if (typeof Blob !== "undefined" && input instanceof Blob) {
22989
+ return await input.arrayBuffer();
22990
+ }
22988
22991
  if (typeof input !== "string") {
22989
22992
  throw new TypeError("Unsupported media input type");
22990
22993
  }
@@ -23115,13 +23118,9 @@
23115
23118
  return element.parentNode && hasSomeParentWithClass(element.parentNode, classname);
23116
23119
  };
23117
23120
  function generateDocxRandomId(length2 = 8) {
23118
- const characters = "0123456789abcdef";
23119
- let id = [];
23120
- for (let i2 = 0; i2 < length2; i2++) {
23121
- const randomIndex = Math.floor(Math.random() * characters.length);
23122
- id.push(characters[randomIndex]);
23123
- }
23124
- return id.join("");
23121
+ const max2 = 2147483647;
23122
+ const value = Math.floor(Math.random() * (max2 + 1));
23123
+ return value.toString(16).padStart(length2, "0").slice(0, length2);
23125
23124
  }
23126
23125
  function generateRandomSigned32BitIntStrId() {
23127
23126
  const val = Math.floor(Math.random() * 2147483647);
@@ -36970,7 +36969,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
36970
36969
  return getRectangleShape(params2, spPr);
36971
36970
  }
36972
36971
  if (shapeType && !textBoxContent) {
36973
- const result = getVectorShape({ params: params2, node, graphicData });
36972
+ const result = getVectorShape({ params: params2, graphicData });
36974
36973
  if (result) return result;
36975
36974
  }
36976
36975
  if (!textBoxContent) {
@@ -37051,7 +37050,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
37051
37050
  attrs
37052
37051
  };
37053
37052
  };
37054
- function getVectorShape({ params: params2, node, graphicData }) {
37053
+ function getVectorShape({ params: params2, graphicData }) {
37055
37054
  const schemaAttrs = {};
37056
37055
  const drawingNode = params2.nodes?.[0];
37057
37056
  if (drawingNode?.name === "w:drawing") {
@@ -40820,6 +40819,11 @@ Please report this to https://github.com/markedjs/marked.`, e) {
40820
40819
  CHANGE_REJECTED: "change-rejected"
40821
40820
  });
40822
40821
  const getFileObject$1 = async (fileUrl, name, type2) => {
40822
+ if (fileUrl.startsWith("data:") && fileUrl.includes(";base64,")) {
40823
+ const binary = atob(fileUrl.split(",")[1]);
40824
+ const bytes = Uint8Array.from(binary, (c2) => c2.charCodeAt(0));
40825
+ return new File([bytes], name, { type: type2 });
40826
+ }
40823
40827
  const response = await fetch(fileUrl);
40824
40828
  const blob = await response.blob();
40825
40829
  return new File([blob], name, { type: type2 });
@@ -43192,7 +43196,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
43192
43196
  static getStoredSuperdocVersion(docx) {
43193
43197
  return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
43194
43198
  }
43195
- static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "0.26.0") {
43199
+ static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "0.27.0") {
43196
43200
  return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
43197
43201
  }
43198
43202
  /**
@@ -43716,18 +43720,19 @@ Please report this to https://github.com/markedjs/marked.`, e) {
43716
43720
  });
43717
43721
  relationships.elements = [...relationships.elements, ...newRels];
43718
43722
  };
43719
- exportProcessMediaFiles_fn = async function(media, editor) {
43720
- const processedData = {};
43721
- for (const filePath in media) {
43722
- if (typeof media[filePath] !== "string") continue;
43723
- processedData[filePath] = await getArrayBufferFromUrl(media[filePath], editor.options.isHeadless);
43723
+ exportProcessMediaFiles_fn = async function(media = {}, editor) {
43724
+ const processedData = {
43725
+ ...this.convertedXml.media || {}
43726
+ };
43727
+ for (const [filePath, value] of Object.entries(media)) {
43728
+ if (value == null) continue;
43729
+ processedData[filePath] = await getArrayBufferFromUrl(value);
43724
43730
  }
43725
- this.convertedXml.media = {
43726
- ...this.convertedXml.media,
43731
+ this.convertedXml.media = processedData;
43732
+ this.media = this.convertedXml.media;
43733
+ this.addedMedia = {
43727
43734
  ...processedData
43728
43735
  };
43729
- this.media = this.convertedXml.media;
43730
- this.addedMedia = processedData;
43731
43736
  };
43732
43737
  __publicField$2(_SuperConverter, "allowedElements", Object.freeze({
43733
43738
  "w:document": "doc",
@@ -61383,7 +61388,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
61383
61388
  * @returns {Object | void} Migration results
61384
61389
  */
61385
61390
  processCollaborationMigrations() {
61386
- console.debug("[checkVersionMigrations] Current editor version", "0.26.0");
61391
+ console.debug("[checkVersionMigrations] Current editor version", "0.27.0");
61387
61392
  if (!this.options.ydoc) return;
61388
61393
  const metaMap = this.options.ydoc.getMap("meta");
61389
61394
  let docVersion = metaMap.get("version");
@@ -76865,9 +76870,9 @@ ${l}
76865
76870
  this.editor = props.editor;
76866
76871
  this.extension = props.extension;
76867
76872
  this.htmlAttributes = props.htmlAttributes;
76868
- this.mount(props);
76873
+ this.mount();
76869
76874
  }
76870
- mount(props) {
76875
+ mount() {
76871
76876
  this.buildView();
76872
76877
  }
76873
76878
  get dom() {
@@ -76922,7 +76927,7 @@ ${l}
76922
76927
  strokeWidth: strokeWidth || 0
76923
76928
  }
76924
76929
  });
76925
- } catch (error) {
76930
+ } catch {
76926
76931
  return null;
76927
76932
  }
76928
76933
  }
@@ -99668,6 +99673,11 @@ ${style2}
99668
99673
  CHANGE_REJECTED: "change-rejected"
99669
99674
  });
99670
99675
  const getFileObject = async (fileUrl, name, type2) => {
99676
+ if (fileUrl.startsWith("data:") && fileUrl.includes(";base64,")) {
99677
+ const binary = atob(fileUrl.split(",")[1]);
99678
+ const bytes = Uint8Array.from(binary, (c2) => c2.charCodeAt(0));
99679
+ return new File([bytes], name, { type: type2 });
99680
+ }
99671
99681
  const response = await fetch(fileUrl);
99672
99682
  const blob = await response.blob();
99673
99683
  return new File([blob], name, { type: type2 });
@@ -116811,7 +116821,7 @@ ${style2}
116811
116821
  this.config.colors = shuffleArray(this.config.colors);
116812
116822
  this.userColorMap = /* @__PURE__ */ new Map();
116813
116823
  this.colorIndex = 0;
116814
- this.version = "0.26.0";
116824
+ this.version = "0.27.0";
116815
116825
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
116816
116826
  this.superdocId = config2.superdocId || v4();
116817
116827
  this.colors = this.config.colors;