@harbour-enterprises/superdoc 2.0.0-next.15 → 2.0.0-next.16

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-BmTqUXHe.es.js → PdfViewer-CdrC8sun.es.js} +1 -1
  2. package/dist/chunks/{PdfViewer-DK5jEu1K.cjs → PdfViewer-DLkwuY7-.cjs} +1 -1
  3. package/dist/chunks/{index-B14ZiJ2S.cjs → index-1i4nXznH.cjs} +3 -3
  4. package/dist/chunks/{index-DgGQUbNh-_ef55vRc.es.js → index-Cmw9APX9-BVfkx11h.es.js} +1 -1
  5. package/dist/chunks/{index-DgGQUbNh-xpdP4M-B.cjs → index-Cmw9APX9-BtDxXnRC.cjs} +1 -1
  6. package/dist/chunks/{index-nxK0aRdv.es.js → index-Cp0Emzrz.es.js} +3 -3
  7. package/dist/chunks/{super-editor.es-Ds9GHHHL.es.js → super-editor.es-DBJog8Zb.es.js} +55 -41
  8. package/dist/chunks/{super-editor.es-DL9CVTke.cjs → super-editor.es-KrYbeR9r.cjs} +55 -41
  9. package/dist/super-editor/ai-writer.es.js +2 -2
  10. package/dist/super-editor/chunks/{converter-BvxISp2B.js → converter-DjhAJLsQ.js} +5 -5
  11. package/dist/super-editor/chunks/{docx-zipper-BuXfTs6z.js → docx-zipper-BL4GcFvY.js} +1 -1
  12. package/dist/super-editor/chunks/{editor-Bgi8FGSM.js → editor-D7HY7SfB.js} +56 -42
  13. package/dist/super-editor/chunks/{index-DgGQUbNh.js → index-Cmw9APX9.js} +1 -1
  14. package/dist/super-editor/chunks/{toolbar-C5SxMMRv.js → toolbar-CH6U-8TG.js} +2 -2
  15. package/dist/super-editor/converter.es.js +1 -1
  16. package/dist/super-editor/docx-zipper.es.js +2 -2
  17. package/dist/super-editor/editor.es.js +3 -3
  18. package/dist/super-editor/file-zipper.es.js +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 +57 -43
  26. package/dist/superdoc.umd.js.map +1 -1
  27. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
- import { E } from "./chunks/editor-Bgi8FGSM.js";
2
- import "./chunks/converter-BvxISp2B.js";
3
- import "./chunks/docx-zipper-BuXfTs6z.js";
1
+ import { E } from "./chunks/editor-D7HY7SfB.js";
2
+ import "./chunks/converter-DjhAJLsQ.js";
3
+ import "./chunks/docx-zipper-BL4GcFvY.js";
4
4
  export {
5
5
  E as Editor
6
6
  };
@@ -1,4 +1,4 @@
1
- import { J as JSZip } from "./chunks/docx-zipper-BuXfTs6z.js";
1
+ import { J as JSZip } from "./chunks/docx-zipper-BL4GcFvY.js";
2
2
  async function createZip(blobs, fileNames) {
3
3
  const zip = new JSZip();
4
4
  blobs.forEach((blob, index) => {
@@ -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 _MARK_TOGGLE_NAMES, _SuperToolbar_instances, initToolbarGroups_fn, _interceptedCommands, makeToolbarItems_fn, initDefaultFonts_fn, updateHighlightColors_fn, deactivateAll_fn, updateToolbarHistory_fn, enrichTrackedChanges_fn, runCommandWithArgumentOnly_fn, syncStickyMarksFromState_fn, restoreStickyMarksIfNeeded_fn, ensureStoredMarksForMarkToggle_fn;
12
- import { aK as getDefaultExportFromCjs, a0 as v4, T as TextSelection$1, v as getMarkRange, aN as vClickOutside, aO as getActiveFormatting, aD as isInTable, O as findParentNode, at as calculateResolvedParagraphProperties, a7 as twipsToLines, Q as isList, an as parseSizeUnit, W as isMacOS, a8 as pixelsToTwips, aP as getFileObject, P as PluginKey, a as Plugin } from "./chunks/converter-BvxISp2B.js";
13
- import { ac, i, a9, aQ } from "./chunks/converter-BvxISp2B.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 getEditorSurfaceElement, l as collectTrackedChangesForContext, S as SLASH_MENU_HANDLED_FLAG, m as SlashMenuPluginKey, s as shouldBypassContextMenu, n as generateRulerDefinition, o as clampHandlePosition, p as calculateMarginFromHandle, q as measureCache, t as isHeadless, E as Editor, v as getStarterExtensions, P as PresentationEditor, w as Placeholder, x as getRichTextExtensions, D as DecorationSet, z as Decoration, M as Mark, A as Extension, B as Attribute, N as Node } from "./chunks/editor-Bgi8FGSM.js";
15
- import { G, J, H, T, C, I, F } from "./chunks/editor-Bgi8FGSM.js";
12
+ import { aK as getDefaultExportFromCjs, a0 as v4, T as TextSelection$1, v as getMarkRange, aN as vClickOutside, aO as getActiveFormatting, aD as isInTable, O as findParentNode, at as calculateResolvedParagraphProperties, a7 as twipsToLines, Q as isList, an as parseSizeUnit, W as isMacOS, a8 as pixelsToTwips, aP as getFileObject, P as PluginKey, a as Plugin } from "./chunks/converter-DjhAJLsQ.js";
13
+ import { ac, i, a9, aQ } from "./chunks/converter-DjhAJLsQ.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 getEditorSurfaceElement, l as collectTrackedChangesForContext, S as SLASH_MENU_HANDLED_FLAG, m as SlashMenuPluginKey, s as shouldBypassContextMenu, n as generateRulerDefinition, o as clampHandlePosition, p as calculateMarginFromHandle, q as measureCache, t as isHeadless, E as Editor, v as getStarterExtensions, P as PresentationEditor, w as Placeholder, x as getRichTextExtensions, D as DecorationSet, z as Decoration, M as Mark, A as Extension, B as Attribute, N as Node } from "./chunks/editor-D7HY7SfB.js";
15
+ import { G, J, H, T, C, I, F } from "./chunks/editor-D7HY7SfB.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, defineComponent, reactive, onUnmounted, renderSlot, useCssVars, shallowRef, createBlock, Teleport, 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-C5SxMMRv.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-CH6U-8TG.js";
18
18
  import AIWriter from "./ai-writer.es.js";
19
- import { D } from "./chunks/docx-zipper-BuXfTs6z.js";
19
+ import { D } from "./chunks/docx-zipper-BL4GcFvY.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-C5SxMMRv.js";
3
- import "./chunks/editor-Bgi8FGSM.js";
2
+ import { T } from "./chunks/toolbar-CH6U-8TG.js";
3
+ import "./chunks/editor-D7HY7SfB.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-DL9CVTke.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-KrYbeR9r.cjs");
4
4
  require("./chunks/vue-gvuFr0vx.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, P, S, c, d, e, f, g, T, h, i, j, k, l, m, n, o, p, r, q } from "./chunks/super-editor.es-Ds9GHHHL.es.js";
1
+ import { A, a, _, C, D, E, b, P, S, c, d, e, f, g, T, h, i, j, k, l, m, n, o, p, r, q } from "./chunks/super-editor.es-DBJog8Zb.es.js";
2
2
  import "./chunks/vue-CLFbn_1r.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-DL9CVTke.cjs");
4
- const superdoc = require("./chunks/index-B14ZiJ2S.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-KrYbeR9r.cjs");
4
+ const superdoc = require("./chunks/index-1i4nXznH.cjs");
5
5
  const blankDocx = require("./chunks/blank-docx-DfW3Eeh2.cjs");
6
6
  exports.AnnotatorHelpers = superEditor_es.AnnotatorHelpers;
7
7
  exports.Editor = superEditor_es.Editor;
@@ -1,5 +1,5 @@
1
- import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-Ds9GHHHL.es.js";
2
- import { D, H, P, S as S2, m, l } from "./chunks/index-nxK0aRdv.es.js";
1
+ import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-DBJog8Zb.es.js";
2
+ import { D, H, P, S as S2, m, l } from "./chunks/index-Cp0Emzrz.es.js";
3
3
  import { B } from "./chunks/blank-docx-ABm6XYAA.es.js";
4
4
  export {
5
5
  a as AnnotatorHelpers,
@@ -42468,7 +42468,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
42468
42468
  static getStoredSuperdocVersion(docx) {
42469
42469
  return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
42470
42470
  }
42471
- static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "2.0.0-next.15") {
42471
+ static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "2.0.0-next.16") {
42472
42472
  return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
42473
42473
  }
42474
42474
  /**
@@ -65491,6 +65491,9 @@ ${err.toString()}`);
65491
65491
  return null;
65492
65492
  }
65493
65493
  const actualMark = start2.node.marks.find((mark2) => mark2.type.name === markName);
65494
+ if (!actualMark) {
65495
+ return null;
65496
+ }
65494
65497
  let startIndex = $pos.index();
65495
65498
  let startPos = $pos.start() + start2.offset;
65496
65499
  while (startIndex > 0 && actualMark.isInSet(parent.child(startIndex - 1).marks)) {
@@ -66643,47 +66646,58 @@ ${err.toString()}`);
66643
66646
  return from2 !== null && to !== null ? { from: from2, to } : null;
66644
66647
  }
66645
66648
  const replaceStep = ({ state: state2, tr, step, newTr, map: map2, user, date, originalStep, originalStepIndex }) => {
66646
- const deletionMarkSchema = state2.schema.marks[TrackDeleteMarkName$1];
66647
- const deletionMark = findMark(state2, deletionMarkSchema, false);
66648
- const positionTo = deletionMark ? deletionMark.to : step.to;
66649
- const newStep = new ReplaceStep(
66650
- positionTo,
66651
- // We insert all the same steps, but with "from"/"to" both set to "to" in order not to delete content. Mapped as needed.
66652
- positionTo,
66653
- step.slice,
66654
- step.structure
66655
- );
66656
- const invertStep = originalStep.invert(tr.docs[originalStepIndex]).map(map2);
66657
- map2.appendMap(invertStep.getMap());
66658
- const meta2 = {};
66659
- if (newStep) {
66660
- const trTemp = state2.apply(newTr).tr;
66661
- if (trTemp.maybeStep(newStep).failed) {
66662
- return;
66663
- }
66664
- const mappedNewStepTo = newStep.getMap().map(newStep.to);
66665
- const insertedMark = markInsertion({
66666
- tr: trTemp,
66667
- from: newStep.from,
66668
- to: mappedNewStepTo,
66669
- user,
66670
- date
66671
- });
66672
- const condensedStep = new ReplaceStep(newStep.from, newStep.to, trTemp.doc.slice(newStep.from, mappedNewStepTo));
66673
- newTr.step(condensedStep);
66674
- const mirrorIndex = map2.maps.length - 1;
66675
- map2.appendMap(condensedStep.getMap(), mirrorIndex);
66676
- if (newStep.from !== mappedNewStepTo) {
66677
- meta2.insertedMark = insertedMark;
66678
- meta2.step = condensedStep;
66649
+ const trTemp = state2.apply(newTr).tr;
66650
+ let positionTo = step.to;
66651
+ const probePos = Math.max(step.from, step.to - 1);
66652
+ const deletionSpan = findMarkPosition(trTemp.doc, probePos, TrackDeleteMarkName$1);
66653
+ if (deletionSpan && deletionSpan.to > positionTo) {
66654
+ positionTo = deletionSpan.to;
66655
+ }
66656
+ const tryInsert = (slice2) => {
66657
+ const insertionStep = new ReplaceStep(positionTo, positionTo, slice2, false);
66658
+ if (trTemp.maybeStep(insertionStep).failed) return null;
66659
+ return {
66660
+ insertedFrom: insertionStep.from,
66661
+ insertedTo: insertionStep.getMap().map(insertionStep.to, 1)
66662
+ };
66663
+ };
66664
+ const insertion = tryInsert(step.slice) || tryInsert(Slice.maxOpen(step.slice.content, true));
66665
+ if (!insertion) {
66666
+ if (!newTr.maybeStep(step).failed) {
66667
+ map2.appendMap(step.getMap());
66679
66668
  }
66680
- if (!newTr.selection.eq(trTemp.selection)) {
66681
- newTr.setSelection(trTemp.selection);
66669
+ return;
66670
+ }
66671
+ const meta2 = {};
66672
+ const insertedMark = markInsertion({
66673
+ tr: trTemp,
66674
+ from: insertion.insertedFrom,
66675
+ to: insertion.insertedTo,
66676
+ user,
66677
+ date
66678
+ });
66679
+ const trackedInsertedSlice = trTemp.doc.slice(insertion.insertedFrom, insertion.insertedTo);
66680
+ const condensedStep = new ReplaceStep(positionTo, positionTo, trackedInsertedSlice, false);
66681
+ if (newTr.maybeStep(condensedStep).failed) {
66682
+ if (!newTr.maybeStep(step).failed) {
66683
+ map2.appendMap(step.getMap());
66682
66684
  }
66685
+ return;
66686
+ }
66687
+ const invertStep = originalStep.invert(tr.docs[originalStepIndex]).map(map2);
66688
+ map2.appendMap(invertStep.getMap());
66689
+ const mirrorIndex = map2.maps.length - 1;
66690
+ map2.appendMap(condensedStep.getMap(), mirrorIndex);
66691
+ if (insertion.insertedFrom !== insertion.insertedTo) {
66692
+ meta2.insertedMark = insertedMark;
66693
+ meta2.step = condensedStep;
66694
+ }
66695
+ if (!newTr.selection.eq(trTemp.selection)) {
66696
+ newTr.setSelection(trTemp.selection);
66683
66697
  }
66684
66698
  if (step.from !== step.to) {
66685
66699
  const {
66686
- deletionMark: deletionMark2,
66700
+ deletionMark,
66687
66701
  deletionMap,
66688
66702
  nodes: deletionNodes
66689
66703
  } = markDeletion({
@@ -66695,7 +66709,7 @@ ${err.toString()}`);
66695
66709
  id: meta2.insertedMark?.attrs?.id
66696
66710
  });
66697
66711
  meta2.deletionNodes = deletionNodes;
66698
- meta2.deletionMark = deletionMark2;
66712
+ meta2.deletionMark = deletionMark;
66699
66713
  map2.appendMapping(deletionMap);
66700
66714
  }
66701
66715
  newTr.setMeta(TrackChangesBasePluginKey, meta2);
@@ -68516,7 +68530,7 @@ ${err.toString()}`);
68516
68530
  const shouldSkipNodeView = (editor) => {
68517
68531
  return isHeadless(editor);
68518
68532
  };
68519
- const summaryVersion = "2.0.0-next.15";
68533
+ const summaryVersion = "2.0.0-next.16";
68520
68534
  const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
68521
68535
  const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
68522
68536
  function mapAttributes(attrs) {
@@ -69305,7 +69319,7 @@ ${err.toString()}`);
69305
69319
  { default: remarkStringify2 },
69306
69320
  { default: remarkGfm2 }
69307
69321
  ] = await Promise.all([
69308
- Promise.resolve().then(() => indexDgGQUbNh),
69322
+ Promise.resolve().then(() => indexCmw9APX9),
69309
69323
  Promise.resolve().then(() => indexDRCvimau),
69310
69324
  Promise.resolve().then(() => indexC_x_N6Uh),
69311
69325
  Promise.resolve().then(() => indexD_sWOSiG),
@@ -69510,7 +69524,7 @@ ${err.toString()}`);
69510
69524
  * Process collaboration migrations
69511
69525
  */
69512
69526
  processCollaborationMigrations() {
69513
- console.debug("[checkVersionMigrations] Current editor version", "2.0.0-next.15");
69527
+ console.debug("[checkVersionMigrations] Current editor version", "2.0.0-next.16");
69514
69528
  if (!this.options.ydoc) return;
69515
69529
  const metaMap = this.options.ydoc.getMap("meta");
69516
69530
  let docVersion = metaMap.get("version");
@@ -157958,7 +157972,7 @@ ${style2}
157958
157972
  this.config.colors = shuffleArray(this.config.colors);
157959
157973
  this.userColorMap = /* @__PURE__ */ new Map();
157960
157974
  this.colorIndex = 0;
157961
- this.version = "2.0.0-next.15";
157975
+ this.version = "2.0.0-next.16";
157962
157976
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
157963
157977
  this.superdocId = config2.superdocId || v4();
157964
157978
  this.colors = this.config.colors;
@@ -160431,7 +160445,7 @@ ${style2}
160431
160445
  value && typeof value === "object" && "byteLength" in value && "byteOffset" in value
160432
160446
  );
160433
160447
  }
160434
- const indexDgGQUbNh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
160448
+ const indexCmw9APX9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
160435
160449
  __proto__: null,
160436
160450
  unified
160437
160451
  }, Symbol.toStringTag, { value: "Module" }));