@harbour-enterprises/superdoc 1.5.0 → 1.6.0-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.
@@ -1,5 +1,5 @@
1
- import { B as BIT8, M as MAX_SAFE_INTEGER, c as create, a as BITS7, u as utf8TextDecoder, b as create$1, s as setIfUndefined, d as create$2, f as from, e as floor$1, g as equalityDeep, w as writeVarUint, h as writeVarString, t as toUint8Array, i as createEncoder, j as createInjectionKey, k as toString, l as throwError, m as useSsrAdapter, n as configProviderInjectionKey, o as cssrAnchorMetaName, p as globalStyle, q as cB, r as c, v as isMounted, x as commonVariables$2, y as cM, z as cNotM, A as cE, C as derived, D as changeColor, E as insideModal, F as insidePopover, G as resolveWrappedSlot, H as on, I as warnOnce, J as useConfig, K as useMergedState, L as useMemo, N as useTheme, O as useRtl, P as createKey, Q as useThemeClass, R as createId, S as call, T as render, U as messageProviderInjectionKey, V as messageApiInjectionKey, W as fromBase64, X as onChange, Y as varStorage, Z as toBase64, _ as createUint8ArrayFromArrayBuffer, $ as offChange, a0 as writeVarUint8Array, a1 as map, a2 as length, a3 as isNode, a4 as min, a5 as pow, a6 as comments_module_events, a7 as getFileObject, a8 as getTrackChanges, a9 as CommentsPluginKey, aa as TrackChangesBasePluginKey, ab as Editor, ac as getRichTextExtensions, ad as ellipsisVerticalSvg, ae as xmarkIconSvg, af as checkIconSvg, ag as caretDownIconSvg, ah as commentIconSvg, ai as _export_sfc, aj as NDropdown, ak as SuperInput, al as vClickOutside, am as PresentationEditor, an as SuperEditor, ao as AIWriter, ap as NConfigProvider, aq as SuperToolbar } from "./index-B6UxxE5v.es.js";
2
- import "./SuperConverter-Dfxp14RO.es.js";
1
+ import { B as BIT8, M as MAX_SAFE_INTEGER, c as create, a as BITS7, u as utf8TextDecoder, b as create$1, s as setIfUndefined, d as create$2, f as from, e as floor$1, g as equalityDeep, w as writeVarUint, h as writeVarString, t as toUint8Array, i as createEncoder, j as createInjectionKey, k as toString, l as throwError, m as useSsrAdapter, n as configProviderInjectionKey, o as cssrAnchorMetaName, p as globalStyle, q as cB, r as c, v as isMounted, x as commonVariables$2, y as cM, z as cNotM, A as cE, C as derived, D as changeColor, E as insideModal, F as insidePopover, G as resolveWrappedSlot, H as on, I as warnOnce, J as useConfig, K as useMergedState, L as useMemo, N as useTheme, O as useRtl, P as createKey, Q as useThemeClass, R as createId, S as call, T as render, U as messageProviderInjectionKey, V as messageApiInjectionKey, W as fromBase64, X as onChange, Y as varStorage, Z as toBase64, _ as createUint8ArrayFromArrayBuffer, $ as offChange, a0 as writeVarUint8Array, a1 as map, a2 as length, a3 as isNode, a4 as min, a5 as pow, a6 as comments_module_events, a7 as getFileObject, a8 as getTrackChanges, a9 as CommentsPluginKey, aa as TrackChangesBasePluginKey, ab as Editor, ac as getRichTextExtensions, ad as ellipsisVerticalSvg, ae as xmarkIconSvg, af as checkIconSvg, ag as caretDownIconSvg, ah as commentIconSvg, ai as _export_sfc, aj as NDropdown, ak as SuperInput, al as vClickOutside, am as PresentationEditor, an as SuperEditor, ao as AIWriter, ap as NConfigProvider, aq as SuperToolbar } from "./index-C7KECpDt.es.js";
2
+ import "./SuperConverter-Cyn9peRO.es.js";
3
3
  import { B as BlankDOCX } from "./blank-docx-ABm6XYAA.es.js";
4
4
  import { E as EventEmitter } from "./eventemitter3-CwrdEv8r.es.js";
5
5
  import { HocuspocusProvider, HocuspocusProviderWebsocket } from "@hocuspocus/provider";
@@ -7513,7 +7513,7 @@ const _sfc_main = {
7513
7513
  __name: "SuperDoc",
7514
7514
  emits: ["selection-update"],
7515
7515
  setup(__props, { emit: __emit }) {
7516
- const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-DOsj8296.es.js"));
7516
+ const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-DzppMlfu.es.js"));
7517
7517
  const superdocStore = useSuperdocStore();
7518
7518
  const commentsStore = useCommentsStore();
7519
7519
  const {
@@ -8467,7 +8467,7 @@ class SuperDoc extends EventEmitter {
8467
8467
  this.config.colors = shuffleArray(this.config.colors);
8468
8468
  this.userColorMap = /* @__PURE__ */ new Map();
8469
8469
  this.colorIndex = 0;
8470
- this.version = "1.5.0";
8470
+ this.version = "1.6.0-next.1";
8471
8471
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
8472
8472
  this.superdocId = config.superdocId || v4();
8473
8473
  this.colors = this.config.colors;
package/dist/style.css CHANGED
@@ -362,6 +362,13 @@ https://github.com/ProseMirror/prosemirror-tables/blob/master/demo/index.html
362
362
  mix-blend-mode: multiply;
363
363
  }
364
364
  /* Presentation Editor Remote Cursors - end */
365
+ /* Footnotes */
366
+ .sd-footnote-ref {
367
+ font-size: 0.75em;
368
+ line-height: 1;
369
+ vertical-align: super;
370
+ user-select: none;
371
+ }
365
372
  /* Image placeholder */
366
373
  .ProseMirror placeholder {
367
374
  display: inline;
@@ -2,6 +2,6 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  require("../chunks/jszip-C8_CqJxM.cjs");
4
4
  require("../chunks/helpers-nOdwpmwb.cjs");
5
- const superEditor_converter = require("../chunks/SuperConverter-DmX1tktl.cjs");
5
+ const superEditor_converter = require("../chunks/SuperConverter-DpKjVrPl.cjs");
6
6
  require("../chunks/uuid-R7L08bOx.cjs");
7
7
  exports.SuperConverter = superEditor_converter.SuperConverter;
@@ -1,6 +1,6 @@
1
1
  import "../chunks/jszip-B1fkPkPJ.es.js";
2
2
  import "../chunks/helpers-C8e9wR5l.es.js";
3
- import { S } from "../chunks/SuperConverter-Dfxp14RO.es.js";
3
+ import { S } from "../chunks/SuperConverter-Cyn9peRO.es.js";
4
4
  import "../chunks/uuid-CjlX8hrF.es.js";
5
5
  export {
6
6
  S as SuperConverter
@@ -144,6 +144,9 @@ class DocxZipper {
144
144
  (el) => el.name === "Override" && el.attributes.PartName === "/word/commentsExtensible.xml"
145
145
  );
146
146
  const hasFile = (filename) => {
147
+ if (updatedDocs && Object.prototype.hasOwnProperty.call(updatedDocs, filename)) {
148
+ return true;
149
+ }
147
150
  if (!docx?.files) return false;
148
151
  if (!fromJson) return Boolean(docx.files[filename]);
149
152
  if (Array.isArray(docx.files)) return docx.files.some((file) => file.name === filename);
@@ -165,6 +168,13 @@ class DocxZipper {
165
168
  const commentsExtendedDef = `<Override PartName="/word/commentsExtensible.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtensible+xml" />`;
166
169
  if (!hasCommentsExtensible) typesString += commentsExtendedDef;
167
170
  }
171
+ const hasFootnotes = types.elements?.some(
172
+ (el) => el.name === "Override" && el.attributes.PartName === "/word/footnotes.xml"
173
+ );
174
+ if (hasFile("word/footnotes.xml")) {
175
+ const footnotesDef = `<Override PartName="/word/footnotes.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml" />`;
176
+ if (!hasFootnotes) typesString += footnotesDef;
177
+ }
168
178
  const partNames = new Set(additionalPartNames);
169
179
  if (docx?.files) {
170
180
  if (fromJson && Array.isArray(docx.files)) {
@@ -143,6 +143,9 @@ class DocxZipper {
143
143
  (el) => el.name === "Override" && el.attributes.PartName === "/word/commentsExtensible.xml"
144
144
  );
145
145
  const hasFile = (filename) => {
146
+ if (updatedDocs && Object.prototype.hasOwnProperty.call(updatedDocs, filename)) {
147
+ return true;
148
+ }
146
149
  if (!docx?.files) return false;
147
150
  if (!fromJson) return Boolean(docx.files[filename]);
148
151
  if (Array.isArray(docx.files)) return docx.files.some((file) => file.name === filename);
@@ -164,6 +167,13 @@ class DocxZipper {
164
167
  const commentsExtendedDef = `<Override PartName="/word/commentsExtensible.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtensible+xml" />`;
165
168
  if (!hasCommentsExtensible) typesString += commentsExtendedDef;
166
169
  }
170
+ const hasFootnotes = types.elements?.some(
171
+ (el) => el.name === "Override" && el.attributes.PartName === "/word/footnotes.xml"
172
+ );
173
+ if (hasFile("word/footnotes.xml")) {
174
+ const footnotesDef = `<Override PartName="/word/footnotes.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml" />`;
175
+ if (!hasFootnotes) typesString += footnotesDef;
176
+ }
167
177
  const partNames = new Set(additionalPartNames);
168
178
  if (docx?.files) {
169
179
  if (fromJson && Array.isArray(docx.files)) {
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("./chunks/index-BFU5qWH7.cjs");
3
+ const index = require("./chunks/index-Cto-XsBE.cjs");
4
4
  const superEditor_docxZipper = require("./super-editor/docx-zipper.cjs");
5
5
  const superEditor_fileZipper = require("./super-editor/file-zipper.cjs");
6
6
  const vue = require("./chunks/vue-De9wkgLl.cjs");
7
- const superEditor_converter = require("./chunks/SuperConverter-DmX1tktl.cjs");
7
+ const superEditor_converter = require("./chunks/SuperConverter-DpKjVrPl.cjs");
8
8
  function isNodeType(node, name) {
9
9
  return node.type.name === name;
10
10
  }
@@ -1,9 +1,9 @@
1
- import { ax as Node, ay as Mark } from "./chunks/index-B6UxxE5v.es.js";
2
- import { ao, au, a9, ab, aw, am, av, aA, an, ak, aq, az, aa, as, aC, aE, aB, ac, aD, ar, at } from "./chunks/index-B6UxxE5v.es.js";
1
+ import { ax as Node, ay as Mark } from "./chunks/index-C7KECpDt.es.js";
2
+ import { ao, au, a9, ab, aw, am, av, aA, an, ak, aq, az, aa, as, aC, aE, aB, ac, aD, ar, at } from "./chunks/index-C7KECpDt.es.js";
3
3
  import { default as default2 } from "./super-editor/docx-zipper.es.js";
4
4
  import { createZip } from "./super-editor/file-zipper.es.js";
5
5
  import { d as defineComponent, E as createElementBlock, G as openBlock, K as createBaseVNode } from "./chunks/vue-BnBKJwCW.es.js";
6
- import { S, r } from "./chunks/SuperConverter-Dfxp14RO.es.js";
6
+ import { S, r } from "./chunks/SuperConverter-Cyn9peRO.es.js";
7
7
  function isNodeType(node, name) {
8
8
  return node.type.name === name;
9
9
  }
package/dist/superdoc.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("./chunks/index-BFU5qWH7.cjs");
4
- const superdoc = require("./chunks/index-BqmzYr4Q.cjs");
5
- const superEditor_converter = require("./chunks/SuperConverter-DmX1tktl.cjs");
3
+ const index = require("./chunks/index-Cto-XsBE.cjs");
4
+ const superdoc = require("./chunks/index-CmZ15rIJ.cjs");
5
+ const superEditor_converter = require("./chunks/SuperConverter-DpKjVrPl.cjs");
6
6
  const blankDocx = require("./chunks/blank-docx-DfW3Eeh2.cjs");
7
7
  require("./chunks/jszip-C8_CqJxM.cjs");
8
8
  require("./chunks/helpers-nOdwpmwb.cjs");
@@ -1,6 +1,6 @@
1
- import { au, ab, aw, av, as, a7, ac, ar, at } from "./chunks/index-B6UxxE5v.es.js";
2
- import { D, H, P, S, c } from "./chunks/index-zeVoYVRM.es.js";
3
- import { S as S2, r } from "./chunks/SuperConverter-Dfxp14RO.es.js";
1
+ import { au, ab, aw, av, as, a7, ac, ar, at } from "./chunks/index-C7KECpDt.es.js";
2
+ import { D, H, P, S, c } from "./chunks/index-DrcLOCfC.es.js";
3
+ import { S as S2, r } from "./chunks/SuperConverter-Cyn9peRO.es.js";
4
4
  import { B } from "./chunks/blank-docx-ABm6XYAA.es.js";
5
5
  import "./chunks/jszip-B1fkPkPJ.es.js";
6
6
  import "./chunks/helpers-C8e9wR5l.es.js";