superdoc 1.0.1 → 1.0.3

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 (32) hide show
  1. package/dist/chunks/{PdfViewer-blXLHgB7.cjs → PdfViewer-2wYU1nQs.cjs} +1 -1
  2. package/dist/chunks/{PdfViewer-DRwVaKAR.es.js → PdfViewer-Brf64q-p.es.js} +1 -1
  3. package/dist/chunks/{index-BvhLTOBv-BiV5weR9.cjs → index-BFesQTtm-DF8MwT73.cjs} +1 -1
  4. package/dist/chunks/{index-BvhLTOBv-BqXHHksu.es.js → index-BFesQTtm-DNeH374x.es.js} +1 -1
  5. package/dist/chunks/{index-C75YAr6z.cjs → index-DeETxTrW.cjs} +5 -9
  6. package/dist/chunks/{index-p_DqFX8u.es.js → index-KBIvw6xZ.es.js} +5 -9
  7. package/dist/chunks/{super-editor.es-dXHQ_lfB.cjs → super-editor.es-C_LoTWvJ.cjs} +687 -136
  8. package/dist/chunks/{super-editor.es-DfwLAyUW.es.js → super-editor.es-DWpzsMUa.es.js} +687 -136
  9. package/dist/packages/superdoc/src/core/SuperDoc.d.ts.map +1 -1
  10. package/dist/packages/superdoc/src/helpers/group-changes.d.ts +1 -1
  11. package/dist/packages/superdoc/src/helpers/group-changes.d.ts.map +1 -1
  12. package/dist/style.css +6 -6
  13. package/dist/super-editor/ai-writer.es.js +2 -2
  14. package/dist/super-editor/chunks/{converter-xC5Gh59u.js → converter-BhELnOP5.js} +1 -1
  15. package/dist/super-editor/chunks/{docx-zipper-BPQOwtye.js → docx-zipper-Bwi8bTEB.js} +1 -1
  16. package/dist/super-editor/chunks/{editor-DhCpqM2w.js → editor-Dyj08tpz.js} +684 -150
  17. package/dist/super-editor/chunks/{index-BvhLTOBv.js → index-BFesQTtm.js} +1 -1
  18. package/dist/super-editor/chunks/{toolbar-iWV3eW-g.js → toolbar-DRFf1nRv.js} +2 -2
  19. package/dist/super-editor/converter.es.js +1 -1
  20. package/dist/super-editor/docx-zipper.es.js +2 -2
  21. package/dist/super-editor/editor.es.js +3 -3
  22. package/dist/super-editor/file-zipper.es.js +1 -1
  23. package/dist/super-editor/style.css +6 -6
  24. package/dist/super-editor/super-editor.es.js +41 -17
  25. package/dist/super-editor/toolbar.es.js +2 -2
  26. package/dist/super-editor.cjs +1 -1
  27. package/dist/super-editor.es.js +1 -1
  28. package/dist/superdoc.cjs +2 -2
  29. package/dist/superdoc.es.js +2 -2
  30. package/dist/superdoc.umd.js +691 -144
  31. package/dist/superdoc.umd.js.map +1 -1
  32. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { aK as getDefaultExportFromCjs } from "./converter-xC5Gh59u.js";
1
+ import { aK as getDefaultExportFromCjs } from "./converter-BhELnOP5.js";
2
2
  import { V as VFile } from "./index-CvBqQJbG.js";
3
3
  function bail(error) {
4
4
  if (error) {
@@ -1,6 +1,6 @@
1
1
  import { ref, readonly, watch, computed, getCurrentInstance, onMounted, onBeforeUnmount, reactive, onBeforeMount, inject, onActivated, onDeactivated, createTextVNode, Fragment, Comment, defineComponent, provide, withDirectives, h, Teleport, toRef, nextTick, renderSlot, isVNode, shallowRef, watchEffect, mergeProps, Transition, vShow, cloneVNode, Text, markRaw, createElementBlock, openBlock, createElementVNode, createCommentVNode, normalizeClass, normalizeStyle, withKeys, unref, withModifiers, createBlock, toDisplayString, vModelText, createVNode, renderList, withCtx } from "vue";
2
- import { p as process$1 } from "./converter-xC5Gh59u.js";
3
- import { g as global$1, _ as _export_sfc, u as useHighContrastMode } from "./editor-DhCpqM2w.js";
2
+ import { p as process$1 } from "./converter-BhELnOP5.js";
3
+ import { g as global$1, _ as _export_sfc, u as useHighContrastMode } from "./editor-Dyj08tpz.js";
4
4
  const sanitizeNumber = (value, defaultNumber) => {
5
5
  let sanitized = value.replace(/[^0-9.]/g, "");
6
6
  sanitized = parseFloat(sanitized);
@@ -1,4 +1,4 @@
1
- import { ac } from "./chunks/converter-xC5Gh59u.js";
1
+ import { ac } from "./chunks/converter-BhELnOP5.js";
2
2
  export {
3
3
  ac as SuperConverter
4
4
  };
@@ -1,5 +1,5 @@
1
- import "./chunks/converter-xC5Gh59u.js";
2
- import { D } from "./chunks/docx-zipper-BPQOwtye.js";
1
+ import "./chunks/converter-BhELnOP5.js";
2
+ import { D } from "./chunks/docx-zipper-Bwi8bTEB.js";
3
3
  export {
4
4
  D as default
5
5
  };
@@ -1,6 +1,6 @@
1
- import { E } from "./chunks/editor-DhCpqM2w.js";
2
- import "./chunks/converter-xC5Gh59u.js";
3
- import "./chunks/docx-zipper-BPQOwtye.js";
1
+ import { E } from "./chunks/editor-Dyj08tpz.js";
2
+ import "./chunks/converter-BhELnOP5.js";
3
+ import "./chunks/docx-zipper-Bwi8bTEB.js";
4
4
  export {
5
5
  E as Editor
6
6
  };
@@ -1,4 +1,4 @@
1
- import { J as JSZip } from "./chunks/docx-zipper-BPQOwtye.js";
1
+ import { J as JSZip } from "./chunks/docx-zipper-Bwi8bTEB.js";
2
2
  async function createZip(blobs, fileNames) {
3
3
  const zip = new JSZip();
4
4
  blobs.forEach((blob, index) => {
@@ -1957,10 +1957,10 @@ https://github.com/ProseMirror/prosemirror-tables/blob/master/demo/index.html
1957
1957
  box-shadow: 0 0 4px rgba(74, 144, 226, 0.5);
1958
1958
  }
1959
1959
 
1960
- .editor-element[data-v-209a1e8b] {
1960
+ .editor-element[data-v-c9a3c876] {
1961
1961
  position: relative;
1962
1962
  }
1963
- .super-editor-container[data-v-209a1e8b] {
1963
+ .super-editor-container[data-v-c9a3c876] {
1964
1964
  width: auto;
1965
1965
  height: auto;
1966
1966
  min-width: 8in;
@@ -1969,14 +1969,14 @@ https://github.com/ProseMirror/prosemirror-tables/blob/master/demo/index.html
1969
1969
  display: flex;
1970
1970
  flex-direction: column;
1971
1971
  }
1972
- .ruler[data-v-209a1e8b] {
1972
+ .ruler[data-v-c9a3c876] {
1973
1973
  margin-bottom: 2px;
1974
1974
  }
1975
- .super-editor[data-v-209a1e8b] {
1975
+ .super-editor[data-v-c9a3c876] {
1976
1976
  color: initial;
1977
1977
  overflow: hidden;
1978
1978
  }
1979
- .placeholder-editor[data-v-209a1e8b] {
1979
+ .placeholder-editor[data-v-c9a3c876] {
1980
1980
  position: absolute;
1981
1981
  top: 0;
1982
1982
  left: 0;
@@ -1988,7 +1988,7 @@ https://github.com/ProseMirror/prosemirror-tables/blob/master/demo/index.html
1988
1988
  background-color: white;
1989
1989
  box-sizing: border-box;
1990
1990
  }
1991
- .placeholder-title[data-v-209a1e8b] {
1991
+ .placeholder-title[data-v-c9a3c876] {
1992
1992
  display: flex;
1993
1993
  justify-content: center;
1994
1994
  margin-bottom: 40px;
@@ -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-xC5Gh59u.js";
13
- import { ac, i, a9, aQ } from "./chunks/converter-xC5Gh59u.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 shouldBypassContextMenu, S as SlashMenuPluginKey, m as generateRulerDefinition, n as clampHandlePosition, o as calculateMarginFromHandle, p as measureCache, q as isHeadless, E as Editor, t as getStarterExtensions, P as PresentationEditor, v as Placeholder, w as getRichTextExtensions, D as DecorationSet, x as Decoration, M as Mark, z as Extension, A as Attribute, N as Node } from "./chunks/editor-DhCpqM2w.js";
15
- import { F, I, G, T, B, H, C } from "./chunks/editor-DhCpqM2w.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-BhELnOP5.js";
13
+ import { ac, i, a9, aQ } from "./chunks/converter-BhELnOP5.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-Dyj08tpz.js";
15
+ import { G, J, H, T, C, I, F } from "./chunks/editor-Dyj08tpz.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-iWV3eW-g.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-DRFf1nRv.js";
18
18
  import AIWriter from "./ai-writer.es.js";
19
- import { D } from "./chunks/docx-zipper-BPQOwtye.js";
19
+ import { D } from "./chunks/docx-zipper-Bwi8bTEB.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,15 +4399,31 @@ 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
  };
4406
- const handleRightClick = async (event) => {
4410
+ const shouldHandleContextMenu = (event) => {
4407
4411
  const readOnly = !props.editor?.isEditable;
4408
4412
  const contextMenuDisabled = props.editor?.options?.disableContextMenu;
4409
4413
  const bypass = shouldBypassContextMenu(event);
4410
- if (readOnly || contextMenuDisabled || bypass) {
4414
+ return !readOnly && !contextMenuDisabled && !bypass;
4415
+ };
4416
+ const handleRightClickCapture = (event) => {
4417
+ try {
4418
+ if (shouldHandleContextMenu(event)) {
4419
+ event[SLASH_MENU_HANDLED_FLAG] = true;
4420
+ }
4421
+ } catch (error) {
4422
+ console.warn("[SlashMenu] Error in capture phase context menu handler:", error);
4423
+ }
4424
+ };
4425
+ const handleRightClick = async (event) => {
4426
+ if (!shouldHandleContextMenu(event)) {
4411
4427
  return;
4412
4428
  }
4413
4429
  event.preventDefault();
@@ -4518,6 +4534,7 @@ const _sfc_main$8 = {
4518
4534
  props.editor.on("slashMenu:open", slashMenuOpenHandler);
4519
4535
  contextMenuTarget = getEditorSurfaceElement(props.editor);
4520
4536
  if (contextMenuTarget) {
4537
+ contextMenuTarget.addEventListener("contextmenu", handleRightClickCapture, true);
4521
4538
  contextMenuTarget.addEventListener("contextmenu", handleRightClick);
4522
4539
  }
4523
4540
  slashMenuCloseHandler = () => {
@@ -4541,6 +4558,7 @@ const _sfc_main$8 = {
4541
4558
  props.editor.off("slashMenu:close", slashMenuCloseHandler);
4542
4559
  }
4543
4560
  props.editor.off("update", handleEditorUpdate);
4561
+ contextMenuTarget?.removeEventListener("contextmenu", handleRightClickCapture, true);
4544
4562
  contextMenuTarget?.removeEventListener("contextmenu", handleRightClick);
4545
4563
  } catch (error) {
4546
4564
  console.warn("[SlashMenu] Error during cleanup:", error);
@@ -6507,6 +6525,12 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
6507
6525
  if (props.options?.suppressSkeletonLoader || !props.options?.collaborationProvider) editorReady.value = true;
6508
6526
  });
6509
6527
  const handleMarginClick = (event) => {
6528
+ if (event.button !== 0) {
6529
+ return;
6530
+ }
6531
+ if (event.ctrlKey && isMacOS()) {
6532
+ return;
6533
+ }
6510
6534
  if (event.target.classList.contains("ProseMirror")) return;
6511
6535
  onMarginClickCursorChange(event, activeEditor.value);
6512
6536
  };
@@ -6645,7 +6669,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
6645
6669
  };
6646
6670
  }
6647
6671
  });
6648
- 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"]]);
6649
6673
  const _hoisted_1 = ["innerHTML"];
6650
6674
  const _sfc_main = {
6651
6675
  __name: "SuperInput",
@@ -6750,14 +6774,14 @@ const Extensions = {
6750
6774
  };
6751
6775
  export {
6752
6776
  AIWriter,
6753
- F as AnnotatorHelpers,
6777
+ G as AnnotatorHelpers,
6754
6778
  _sfc_main$7 as BasicUpload,
6755
- I as CommentsPluginKey,
6779
+ J as CommentsPluginKey,
6756
6780
  D as DocxZipper,
6757
6781
  Editor,
6758
6782
  Extensions,
6759
6783
  PresentationEditor,
6760
- G as SectionHelpers,
6784
+ H as SectionHelpers,
6761
6785
  _sfc_main$8 as SlashMenu,
6762
6786
  ac as SuperConverter,
6763
6787
  SuperEditor,
@@ -6766,13 +6790,13 @@ export {
6766
6790
  Toolbar,
6767
6791
  T as TrackChangesBasePluginKey,
6768
6792
  createZip,
6769
- B as fieldAnnotationHelpers,
6793
+ C as fieldAnnotationHelpers,
6770
6794
  getActiveFormatting,
6771
- H as getAllowedImageDimensions,
6795
+ I as getAllowedImageDimensions,
6772
6796
  i as getMarksFromSelection,
6773
6797
  getRichTextExtensions,
6774
6798
  getStarterExtensions,
6775
6799
  a9 as helpers,
6776
6800
  aQ as registeredHandlers,
6777
- C as trackChangesHelpers
6801
+ F as trackChangesHelpers
6778
6802
  };
@@ -1,6 +1,6 @@
1
1
  import "vue";
2
- import { T } from "./chunks/toolbar-iWV3eW-g.js";
3
- import "./chunks/editor-DhCpqM2w.js";
2
+ import { T } from "./chunks/toolbar-DRFf1nRv.js";
3
+ import "./chunks/editor-Dyj08tpz.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-dXHQ_lfB.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-C_LoTWvJ.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-DfwLAyUW.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-DWpzsMUa.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-dXHQ_lfB.cjs");
4
- const superdoc = require("./chunks/index-C75YAr6z.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-C_LoTWvJ.cjs");
4
+ const superdoc = require("./chunks/index-DeETxTrW.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-DfwLAyUW.es.js";
2
- import { D, H, P, S as S2, m, l } from "./chunks/index-p_DqFX8u.es.js";
1
+ import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-DWpzsMUa.es.js";
2
+ import { D, H, P, S as S2, m, l } from "./chunks/index-KBIvw6xZ.es.js";
3
3
  import { B } from "./chunks/blank-docx-ABm6XYAA.es.js";
4
4
  export {
5
5
  a as AnnotatorHelpers,