@harbour-enterprises/superdoc 2.0.0-next.4 → 2.0.0-next.6

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 (30) hide show
  1. package/dist/chunks/{PdfViewer-D3PZ6zBK.es.js → PdfViewer-BPIxxJx1.es.js} +1 -1
  2. package/dist/chunks/{PdfViewer-DW9Jjot9.cjs → PdfViewer-BznIC9kN.cjs} +1 -1
  3. package/dist/chunks/{index-NcWPPbrQ.es.js → index-C8DpZaYe.es.js} +3 -3
  4. package/dist/chunks/{index-YoL4XmHs-DnigArXx.es.js → index-CjcK6uv5-_OL7V7hX.es.js} +1 -1
  5. package/dist/chunks/{index-YoL4XmHs-DgX6YU__.cjs → index-CjcK6uv5-igEsQh5Z.cjs} +1 -1
  6. package/dist/chunks/{index-VXujz1iS.cjs → index-CjroI_aV.cjs} +3 -3
  7. package/dist/chunks/{super-editor.es-CeYiIfGN.cjs → super-editor.es-CwbjhJ-l.cjs} +37 -7
  8. package/dist/chunks/{super-editor.es-o4f9FxT-.es.js → super-editor.es-Rg5N0oRz.es.js} +37 -7
  9. package/dist/packages/superdoc/src/core/SuperDoc.d.ts.map +1 -1
  10. package/dist/style.css +6 -6
  11. package/dist/super-editor/ai-writer.es.js +2 -2
  12. package/dist/super-editor/chunks/{converter-Cv-PWHhI.js → converter-CkaVRpl3.js} +1 -1
  13. package/dist/super-editor/chunks/{docx-zipper-aIZi_y1u.js → docx-zipper-kpJAPGdW.js} +1 -1
  14. package/dist/super-editor/chunks/{editor-R1nZ8Y4J.js → editor-Of8Mcai_.js} +25 -5
  15. package/dist/super-editor/chunks/{index-YoL4XmHs.js → index-CjcK6uv5.js} +1 -1
  16. package/dist/super-editor/chunks/{toolbar-DTrmhth_.js → toolbar-DSV5sJpY.js} +2 -2
  17. package/dist/super-editor/converter.es.js +1 -1
  18. package/dist/super-editor/docx-zipper.es.js +2 -2
  19. package/dist/super-editor/editor.es.js +3 -3
  20. package/dist/super-editor/file-zipper.es.js +1 -1
  21. package/dist/super-editor/style.css +6 -6
  22. package/dist/super-editor/super-editor.es.js +19 -9
  23. package/dist/super-editor/toolbar.es.js +2 -2
  24. package/dist/super-editor.cjs +1 -1
  25. package/dist/super-editor.es.js +1 -1
  26. package/dist/superdoc.cjs +2 -2
  27. package/dist/superdoc.es.js +2 -2
  28. package/dist/superdoc.umd.js +39 -9
  29. package/dist/superdoc.umd.js.map +1 -1
  30. 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 _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, a8 as pixelsToTwips, aP as getFileObject, P as PluginKey, a as Plugin } from "./chunks/converter-Cv-PWHhI.js";
13
- import { ac, i, a9, aQ } from "./chunks/converter-Cv-PWHhI.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-R1nZ8Y4J.js";
15
- import { G, J, H, T, C, I, F } from "./chunks/editor-R1nZ8Y4J.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-CkaVRpl3.js";
13
+ import { ac, i, a9, aQ } from "./chunks/converter-CkaVRpl3.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-Of8Mcai_.js";
15
+ import { G, J, H, T, C, I, F } from "./chunks/editor-Of8Mcai_.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-DTrmhth_.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-DSV5sJpY.js";
18
18
  import AIWriter from "./ai-writer.es.js";
19
- import { D } from "./chunks/docx-zipper-aIZi_y1u.js";
19
+ import { D } from "./chunks/docx-zipper-kpJAPGdW.js";
20
20
  import { createZip } from "./file-zipper.es.js";
21
21
  var eventemitter3 = { exports: {} };
22
22
  var hasRequiredEventemitter3;
@@ -4294,7 +4294,7 @@ const _sfc_main$8 = {
4294
4294
  if (open) {
4295
4295
  nextTick(() => {
4296
4296
  if (searchInput.value) {
4297
- searchInput.value.focus();
4297
+ searchInput.value.focus({ preventScroll: true });
4298
4298
  }
4299
4299
  });
4300
4300
  }
@@ -4399,7 +4399,11 @@ const _sfc_main$8 = {
4399
4399
  };
4400
4400
  const handleGlobalOutsideClick = (event) => {
4401
4401
  if (isOpen.value && menuRef.value && !menuRef.value.contains(event.target)) {
4402
- moveCursorToMouseEvent(event, props.editor);
4402
+ const isCtrlClickOnMac = event.ctrlKey && isMacOS();
4403
+ const isLeftClick = event.button === 0 && !isCtrlClickOnMac;
4404
+ if (isLeftClick) {
4405
+ moveCursorToMouseEvent(event, props.editor);
4406
+ }
4403
4407
  closeMenu({ restoreCursor: false });
4404
4408
  }
4405
4409
  };
@@ -6521,6 +6525,12 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
6521
6525
  if (props.options?.suppressSkeletonLoader || !props.options?.collaborationProvider) editorReady.value = true;
6522
6526
  });
6523
6527
  const handleMarginClick = (event) => {
6528
+ if (event.button !== 0) {
6529
+ return;
6530
+ }
6531
+ if (event.ctrlKey && isMacOS()) {
6532
+ return;
6533
+ }
6524
6534
  if (event.target.classList.contains("ProseMirror")) return;
6525
6535
  onMarginClickCursorChange(event, activeEditor.value);
6526
6536
  };
@@ -6659,7 +6669,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
6659
6669
  };
6660
6670
  }
6661
6671
  });
6662
- const SuperEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-209a1e8b"]]);
6672
+ const SuperEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-c9a3c876"]]);
6663
6673
  const _hoisted_1 = ["innerHTML"];
6664
6674
  const _sfc_main = {
6665
6675
  __name: "SuperInput",
@@ -1,6 +1,6 @@
1
1
  import "vue";
2
- import { T } from "./chunks/toolbar-DTrmhth_.js";
3
- import "./chunks/editor-R1nZ8Y4J.js";
2
+ import { T } from "./chunks/toolbar-DSV5sJpY.js";
3
+ import "./chunks/editor-Of8Mcai_.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-CeYiIfGN.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-CwbjhJ-l.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-o4f9FxT-.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-Rg5N0oRz.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-CeYiIfGN.cjs");
4
- const superdoc = require("./chunks/index-VXujz1iS.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-CwbjhJ-l.cjs");
4
+ const superdoc = require("./chunks/index-CjroI_aV.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-o4f9FxT-.es.js";
2
- import { D, H, P, S as S2, m, l } from "./chunks/index-NcWPPbrQ.es.js";
1
+ import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-Rg5N0oRz.es.js";
2
+ import { D, H, P, S as S2, m, l } from "./chunks/index-C8DpZaYe.es.js";
3
3
  import { B } from "./chunks/blank-docx-ABm6XYAA.es.js";
4
4
  export {
5
5
  a as AnnotatorHelpers,
@@ -42428,7 +42428,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
42428
42428
  static getStoredSuperdocVersion(docx) {
42429
42429
  return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
42430
42430
  }
42431
- static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "2.0.0-next.4") {
42431
+ static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "2.0.0-next.6") {
42432
42432
  return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
42433
42433
  }
42434
42434
  /**
@@ -68384,7 +68384,7 @@ ${err.toString()}`);
68384
68384
  const shouldSkipNodeView = (editor) => {
68385
68385
  return isHeadless(editor);
68386
68386
  };
68387
- const summaryVersion = "2.0.0-next.4";
68387
+ const summaryVersion = "2.0.0-next.6";
68388
68388
  const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
68389
68389
  const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
68390
68390
  function mapAttributes(attrs) {
@@ -69173,7 +69173,7 @@ ${err.toString()}`);
69173
69173
  { default: remarkStringify2 },
69174
69174
  { default: remarkGfm2 }
69175
69175
  ] = await Promise.all([
69176
- Promise.resolve().then(() => indexYoL4XmHs),
69176
+ Promise.resolve().then(() => indexCjcK6uv5),
69177
69177
  Promise.resolve().then(() => indexDRCvimau),
69178
69178
  Promise.resolve().then(() => indexC_x_N6Uh),
69179
69179
  Promise.resolve().then(() => indexD_sWOSiG),
@@ -69378,7 +69378,7 @@ ${err.toString()}`);
69378
69378
  * Process collaboration migrations
69379
69379
  */
69380
69380
  processCollaborationMigrations() {
69381
- console.debug("[checkVersionMigrations] Current editor version", "2.0.0-next.4");
69381
+ console.debug("[checkVersionMigrations] Current editor version", "2.0.0-next.6");
69382
69382
  if (!this.options.ydoc) return;
69383
69383
  const metaMap = this.options.ydoc.getMap("meta");
69384
69384
  let docVersion = metaMap.get("version");
@@ -85498,6 +85498,9 @@ ${l}
85498
85498
  if (!Number.isFinite(height) || height <= 0) {
85499
85499
  throw new Error("layoutHeaderFooter: height must be positive");
85500
85500
  }
85501
+ const maxBehindDocOverflow = Math.max(192, height * 4);
85502
+ const minBehindDocY = -maxBehindDocOverflow;
85503
+ const maxBehindDocY = height + maxBehindDocOverflow;
85501
85504
  const marginLeft = constraints.margins?.left ?? 0;
85502
85505
  const transformedBlocks = marginLeft > 0 ? blocks2.map((block) => {
85503
85506
  const hasPageRelativeAnchor = (block.kind === "image" || block.kind === "drawing") && block.anchor?.hRelativeFrom === "page" && block.anchor.offsetH != null;
@@ -85528,6 +85531,18 @@ ${l}
85528
85531
  if (idx == null) continue;
85529
85532
  const block = blocks2[idx];
85530
85533
  const measure = measures[idx];
85534
+ const isAnchoredFragment = (fragment.kind === "image" || fragment.kind === "drawing") && fragment.isAnchored === true;
85535
+ if (isAnchoredFragment) {
85536
+ if (block.kind !== "image" && block.kind !== "drawing") {
85537
+ throw new Error(
85538
+ `Type mismatch: fragment kind is ${fragment.kind} but block kind is ${block.kind} for block ${block.id}`
85539
+ );
85540
+ }
85541
+ const anchoredBlock = block;
85542
+ if (anchoredBlock.anchor?.behindDoc && (fragment.y < minBehindDocY || fragment.y > maxBehindDocY)) {
85543
+ continue;
85544
+ }
85545
+ }
85531
85546
  if (fragment.y < minY) minY = fragment.y;
85532
85547
  let bottom2 = fragment.y;
85533
85548
  if (fragment.kind === "para" && measure?.kind === "paragraph") {
@@ -101226,6 +101241,9 @@ ${l}
101226
101241
  if (event.button !== 0) {
101227
101242
  return;
101228
101243
  }
101244
+ if (event.ctrlKey && navigator.platform.includes("Mac")) {
101245
+ return;
101246
+ }
101229
101247
  __privateSet(this, _pendingMarginClick, null);
101230
101248
  const target = event.target;
101231
101249
  if (target?.closest?.(".superdoc-ruler-handle") != null) {
@@ -106635,6 +106653,8 @@ ${l}
106635
106653
  const cbRect = containingBlock.getBoundingClientRect();
106636
106654
  left2 -= cbRect.left;
106637
106655
  top2 -= cbRect.top;
106656
+ left2 += containingBlock.scrollLeft || 0;
106657
+ top2 += containingBlock.scrollTop || 0;
106638
106658
  } catch (error) {
106639
106659
  console.warn("SlashMenu: Failed to adjust for containing block", error);
106640
106660
  }
@@ -137973,7 +137993,7 @@ ${style2}
137973
137993
  if (open) {
137974
137994
  nextTick(() => {
137975
137995
  if (searchInput.value) {
137976
- searchInput.value.focus();
137996
+ searchInput.value.focus({ preventScroll: true });
137977
137997
  }
137978
137998
  });
137979
137999
  }
@@ -138078,7 +138098,11 @@ ${style2}
138078
138098
  };
138079
138099
  const handleGlobalOutsideClick = (event) => {
138080
138100
  if (isOpen.value && menuRef.value && !menuRef.value.contains(event.target)) {
138081
- moveCursorToMouseEvent(event, props.editor);
138101
+ const isCtrlClickOnMac = event.ctrlKey && isMacOS();
138102
+ const isLeftClick = event.button === 0 && !isCtrlClickOnMac;
138103
+ if (isLeftClick) {
138104
+ moveCursorToMouseEvent(event, props.editor);
138105
+ }
138082
138106
  closeMenu({ restoreCursor: false });
138083
138107
  }
138084
138108
  };
@@ -140173,6 +140197,12 @@ ${style2}
140173
140197
  if (props.options?.suppressSkeletonLoader || !props.options?.collaborationProvider) editorReady.value = true;
140174
140198
  });
140175
140199
  const handleMarginClick = (event) => {
140200
+ if (event.button !== 0) {
140201
+ return;
140202
+ }
140203
+ if (event.ctrlKey && isMacOS()) {
140204
+ return;
140205
+ }
140176
140206
  if (event.target.classList.contains("ProseMirror")) return;
140177
140207
  onMarginClickCursorChange(event, activeEditor.value);
140178
140208
  };
@@ -140311,7 +140341,7 @@ ${style2}
140311
140341
  };
140312
140342
  }
140313
140343
  });
140314
- const SuperEditor = /* @__PURE__ */ _export_sfc$1(_sfc_main$1$1, [["__scopeId", "data-v-209a1e8b"]]);
140344
+ const SuperEditor = /* @__PURE__ */ _export_sfc$1(_sfc_main$1$1, [["__scopeId", "data-v-c9a3c876"]]);
140315
140345
  const _hoisted_1$h = ["innerHTML"];
140316
140346
  const _sfc_main$i = {
140317
140347
  __name: "SuperInput",
@@ -157765,7 +157795,7 @@ ${style2}
157765
157795
  this.config.colors = shuffleArray(this.config.colors);
157766
157796
  this.userColorMap = /* @__PURE__ */ new Map();
157767
157797
  this.colorIndex = 0;
157768
- this.version = "2.0.0-next.4";
157798
+ this.version = "2.0.0-next.6";
157769
157799
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
157770
157800
  this.superdocId = config2.superdocId || v4();
157771
157801
  this.colors = this.config.colors;
@@ -160238,7 +160268,7 @@ ${style2}
160238
160268
  value && typeof value === "object" && "byteLength" in value && "byteOffset" in value
160239
160269
  );
160240
160270
  }
160241
- const indexYoL4XmHs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
160271
+ const indexCjcK6uv5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
160242
160272
  __proto__: null,
160243
160273
  unified
160244
160274
  }, Symbol.toStringTag, { value: "Module" }));