@harbour-enterprises/superdoc 0.21.0-next.7 → 0.21.0-next.8

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,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const vue = require("./vue-DWle4Cai.cjs");
4
- const superdoc = require("./index-Bpp8Ruyf.cjs");
4
+ const superdoc = require("./index-BNA5J__D.cjs");
5
5
  function self(vars) {
6
6
  const {
7
7
  opacityDisabled,
@@ -1,5 +1,5 @@
1
1
  import { m as defineComponent, B as h, O as Transition, $ as process$1, I as watchEffect, d as computed, r as ref, j as onMounted, W as onUnmounted, c as createElementBlock, o as openBlock, a as createBaseVNode, f as createCommentVNode, v as createVNode, x as unref } from "./vue-CXxsqYcP.es.js";
2
- import { d as derived, c, a as cB, f as fadeInTransition, b as cM, N as NBaseLoading, w as warnOnce, u as useConfig, e as useTheme, p as pxfy, g as createKey, h as useThemeClass, i as useCompitable, _ as _export_sfc, j as useSuperdocStore, s as storeToRefs, k as useSelection } from "./index-CLGEbkfW.es.js";
2
+ import { d as derived, c, a as cB, f as fadeInTransition, b as cM, N as NBaseLoading, w as warnOnce, u as useConfig, e as useTheme, p as pxfy, g as createKey, h as useThemeClass, i as useCompitable, _ as _export_sfc, j as useSuperdocStore, s as storeToRefs, k as useSelection } from "./index-CjQDYBP2.es.js";
3
3
  function self(vars) {
4
4
  const {
5
5
  opacityDisabled,
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const superEditor_es = require("./super-editor.es-aBw27Tag.cjs");
2
+ const superEditor_es = require("./super-editor.es-Ct59l8tt.cjs");
3
3
  const vue = require("./vue-DWle4Cai.cjs");
4
4
  const jszip = require("./jszip-b7l8QkfH.cjs");
5
5
  const blankDocx = require("./blank-docx-CPqX9RF5.cjs");
@@ -17409,7 +17409,7 @@ const _sfc_main = {
17409
17409
  __name: "SuperDoc",
17410
17410
  emits: ["selection-update"],
17411
17411
  setup(__props, { emit: __emit }) {
17412
- const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-DWWRw_re.cjs")));
17412
+ const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-BR9iwva-.cjs")));
17413
17413
  const superdocStore = useSuperdocStore();
17414
17414
  const commentsStore = useCommentsStore();
17415
17415
  const {
@@ -1,4 +1,4 @@
1
- import { q as index$1, C as CommentsPluginKey, h as TrackChangesBasePluginKey, E as Editor, n as getRichTextExtensions, f as SuperInput, e as SuperEditor, A as AIWriter, g as SuperToolbar, i as createZip } from "./super-editor.es-DWm41myg.es.js";
1
+ import { q as index$1, C as CommentsPluginKey, h as TrackChangesBasePluginKey, E as Editor, n as getRichTextExtensions, f as SuperInput, e as SuperEditor, A as AIWriter, g as SuperToolbar, i as createZip } from "./super-editor.es-C5dhT0uU.es.js";
2
2
  import { a0 as effectScope, r as ref, _ as markRaw, $ as process$1, a1 as toRaw, d as computed, a2 as isRef, a3 as isReactive, C as toRef, i as inject, p as getCurrentInstance, l as watch, x as unref, a4 as hasInjectionContext, M as reactive, s as nextTick, a5 as getCurrentScope, a6 as onScopeDispose, a7 as toRefs, g as global$1, J as shallowRef, N as readonly, j as onMounted, k as onBeforeUnmount, h as onBeforeMount, S as onActivated, q as onDeactivated, z as createTextVNode, F as Fragment, Q as Comment, m as defineComponent, D as provide, H as withDirectives, B as h, U as Teleport, R as renderSlot, V as isVNode, I as watchEffect, O as Transition, a8 as TransitionGroup, E as mergeProps, P as vShow, G as cloneVNode, T as Text, c as createElementBlock, o as openBlock, t as toDisplayString, v as createVNode, y as withCtx, a as createBaseVNode, A as normalizeStyle, f as createCommentVNode, u as createBlock, w as withModifiers, n as normalizeClass, a9 as resolveDirective, e as renderList, b as createApp, X as resolveDynamicComponent, aa as defineAsyncComponent } from "./vue-CXxsqYcP.es.js";
3
3
  import { B as Buffer$2 } from "./jszip-B8KIZSNe.es.js";
4
4
  import { B as BlankDOCX } from "./blank-docx-iwdyG9RH.es.js";
@@ -17392,7 +17392,7 @@ const _sfc_main = {
17392
17392
  __name: "SuperDoc",
17393
17393
  emits: ["selection-update"],
17394
17394
  setup(__props, { emit: __emit }) {
17395
- const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-B8R1j6LP.es.js"));
17395
+ const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-CwVW7MVJ.es.js"));
17396
17396
  const superdocStore = useSuperdocStore();
17397
17397
  const commentsStore = useCommentsStore();
17398
17398
  const {
@@ -53575,6 +53575,14 @@ const intToJapaneseCounting = (num) => {
53575
53575
  return result;
53576
53576
  };
53577
53577
  const CustomSelectionPluginKey = new PluginKey("CustomSelection");
53578
+ const shouldAllowNativeContextMenu = (event) => {
53579
+ if (!event) return false;
53580
+ if (event.ctrlKey || event.metaKey) {
53581
+ return true;
53582
+ }
53583
+ const isKeyboardInvocation = event.type === "contextmenu" && typeof event.detail === "number" && event.detail === 0 && (event.button === 0 || event.button === void 0) && event.clientX === 0 && event.clientY === 0;
53584
+ return Boolean(isKeyboardInvocation);
53585
+ };
53578
53586
  const handleClickOutside = (event, editor) => {
53579
53587
  const editorElem = editor?.options?.element;
53580
53588
  if (!editorElem) return;
@@ -53636,6 +53644,9 @@ const CustomSelection = Extension.create({
53636
53644
  props: {
53637
53645
  handleDOMEvents: {
53638
53646
  contextmenu: (view, event) => {
53647
+ if (shouldAllowNativeContextMenu(event)) {
53648
+ return false;
53649
+ }
53639
53650
  event.preventDefault();
53640
53651
  const { selection } = view.state;
53641
53652
  if (!selection.empty) {
@@ -53654,6 +53665,9 @@ const CustomSelection = Extension.create({
53654
53665
  },
53655
53666
  mousedown: (view, event) => {
53656
53667
  if (event.button === 2) {
53668
+ if (shouldAllowNativeContextMenu(event)) {
53669
+ return false;
53670
+ }
53657
53671
  event.preventDefault();
53658
53672
  const { selection: selection2 } = view.state;
53659
53673
  if (!selection2.empty) {
@@ -84132,6 +84146,14 @@ function getStructureFromResolvedPos(state2, pos) {
84132
84146
  return null;
84133
84147
  }
84134
84148
  }
84149
+ const shouldBypassContextMenu = (event) => {
84150
+ if (!event) return false;
84151
+ if (event.ctrlKey || event.metaKey) {
84152
+ return true;
84153
+ }
84154
+ const isKeyboardInvocation = event.type === "contextmenu" && typeof event.detail === "number" && event.detail === 0 && (event.button === 0 || event.button === void 0) && event.clientX === 0 && event.clientY === 0;
84155
+ return Boolean(isKeyboardInvocation);
84156
+ };
84135
84157
  const isModuleEnabled = (editorOptions, moduleName) => {
84136
84158
  switch (moduleName) {
84137
84159
  case "ai":
@@ -84506,8 +84528,7 @@ const _sfc_main$4 = {
84506
84528
  };
84507
84529
  const handleRightClick = async (event) => {
84508
84530
  const readOnly = !props.editor?.isEditable;
84509
- const isHoldingCtrl = event.ctrlKey;
84510
- if (readOnly || isHoldingCtrl) {
84531
+ if (readOnly || shouldBypassContextMenu(event)) {
84511
84532
  return;
84512
84533
  }
84513
84534
  event.preventDefault();
@@ -53592,6 +53592,14 @@ const intToJapaneseCounting = (num) => {
53592
53592
  return result;
53593
53593
  };
53594
53594
  const CustomSelectionPluginKey = new PluginKey("CustomSelection");
53595
+ const shouldAllowNativeContextMenu = (event) => {
53596
+ if (!event) return false;
53597
+ if (event.ctrlKey || event.metaKey) {
53598
+ return true;
53599
+ }
53600
+ const isKeyboardInvocation = event.type === "contextmenu" && typeof event.detail === "number" && event.detail === 0 && (event.button === 0 || event.button === void 0) && event.clientX === 0 && event.clientY === 0;
53601
+ return Boolean(isKeyboardInvocation);
53602
+ };
53595
53603
  const handleClickOutside = (event, editor) => {
53596
53604
  const editorElem = editor?.options?.element;
53597
53605
  if (!editorElem) return;
@@ -53653,6 +53661,9 @@ const CustomSelection = Extension.create({
53653
53661
  props: {
53654
53662
  handleDOMEvents: {
53655
53663
  contextmenu: (view, event) => {
53664
+ if (shouldAllowNativeContextMenu(event)) {
53665
+ return false;
53666
+ }
53656
53667
  event.preventDefault();
53657
53668
  const { selection } = view.state;
53658
53669
  if (!selection.empty) {
@@ -53671,6 +53682,9 @@ const CustomSelection = Extension.create({
53671
53682
  },
53672
53683
  mousedown: (view, event) => {
53673
53684
  if (event.button === 2) {
53685
+ if (shouldAllowNativeContextMenu(event)) {
53686
+ return false;
53687
+ }
53674
53688
  event.preventDefault();
53675
53689
  const { selection: selection2 } = view.state;
53676
53690
  if (!selection2.empty) {
@@ -84149,6 +84163,14 @@ function getStructureFromResolvedPos(state2, pos) {
84149
84163
  return null;
84150
84164
  }
84151
84165
  }
84166
+ const shouldBypassContextMenu = (event) => {
84167
+ if (!event) return false;
84168
+ if (event.ctrlKey || event.metaKey) {
84169
+ return true;
84170
+ }
84171
+ const isKeyboardInvocation = event.type === "contextmenu" && typeof event.detail === "number" && event.detail === 0 && (event.button === 0 || event.button === void 0) && event.clientX === 0 && event.clientY === 0;
84172
+ return Boolean(isKeyboardInvocation);
84173
+ };
84152
84174
  const isModuleEnabled = (editorOptions, moduleName) => {
84153
84175
  switch (moduleName) {
84154
84176
  case "ai":
@@ -84523,8 +84545,7 @@ const _sfc_main$4 = {
84523
84545
  };
84524
84546
  const handleRightClick = async (event) => {
84525
84547
  const readOnly = !props.editor?.isEditable;
84526
- const isHoldingCtrl = event.ctrlKey;
84527
- if (readOnly || isHoldingCtrl) {
84548
+ if (readOnly || shouldBypassContextMenu(event)) {
84528
84549
  return;
84529
84550
  }
84530
84551
  event.preventDefault();
@@ -1,6 +1,6 @@
1
1
  import { ref, onMounted, onUnmounted, computed, createElementBlock, openBlock, withModifiers, createElementVNode, withDirectives, unref, vModelText, createCommentVNode, nextTick } from "vue";
2
2
  import { T as TextSelection } from "./chunks/converter-DYAHhSrg.js";
3
- import { _ as _export_sfc } from "./chunks/editor-VW8eKYoK.js";
3
+ import { _ as _export_sfc } from "./chunks/editor-B1W7AdgQ.js";
4
4
  const DEFAULT_API_ENDPOINT = "https://sd-dev-express-gateway-i6xtm.ondigitalocean.app/insights";
5
5
  const SYSTEM_PROMPT = "You are an expert copywriter and you are immersed in a document editor. You are to provide document related text responses based on the user prompts. Only write what is asked for. Do not provide explanations. Try to keep placeholders as short as possible. Do not output your prompt. Your instructions are: ";
6
6
  async function baseInsightsFetch(payload, options = {}) {
@@ -17481,6 +17481,14 @@ const intToJapaneseCounting = (num) => {
17481
17481
  return result;
17482
17482
  };
17483
17483
  const CustomSelectionPluginKey = new PluginKey("CustomSelection");
17484
+ const shouldAllowNativeContextMenu = (event) => {
17485
+ if (!event) return false;
17486
+ if (event.ctrlKey || event.metaKey) {
17487
+ return true;
17488
+ }
17489
+ const isKeyboardInvocation = event.type === "contextmenu" && typeof event.detail === "number" && event.detail === 0 && (event.button === 0 || event.button === void 0) && event.clientX === 0 && event.clientY === 0;
17490
+ return Boolean(isKeyboardInvocation);
17491
+ };
17484
17492
  const handleClickOutside = (event, editor) => {
17485
17493
  const editorElem = editor?.options?.element;
17486
17494
  if (!editorElem) return;
@@ -17542,6 +17550,9 @@ const CustomSelection = Extension.create({
17542
17550
  props: {
17543
17551
  handleDOMEvents: {
17544
17552
  contextmenu: (view, event) => {
17553
+ if (shouldAllowNativeContextMenu(event)) {
17554
+ return false;
17555
+ }
17545
17556
  event.preventDefault();
17546
17557
  const { selection } = view.state;
17547
17558
  if (!selection.empty) {
@@ -17560,6 +17571,9 @@ const CustomSelection = Extension.create({
17560
17571
  },
17561
17572
  mousedown: (view, event) => {
17562
17573
  if (event.button === 2) {
17574
+ if (shouldAllowNativeContextMenu(event)) {
17575
+ return false;
17576
+ }
17563
17577
  event.preventDefault();
17564
17578
  const { selection: selection2 } = view.state;
17565
17579
  if (!selection2.empty) {
@@ -1,6 +1,6 @@
1
1
  import { computed, createElementBlock, openBlock, createElementVNode, createCommentVNode, normalizeClass, normalizeStyle, ref, withKeys, unref, withModifiers, createBlock, toDisplayString, withDirectives, vModelText, nextTick, getCurrentInstance, createVNode, readonly, watch, onMounted, onBeforeUnmount, reactive, onBeforeMount, inject, onActivated, onDeactivated, createTextVNode, Fragment, Comment, defineComponent, provide, h, Teleport, toRef, renderSlot, isVNode, shallowRef, watchEffect, mergeProps, Transition, vShow, cloneVNode, Text, renderList, withCtx } from "vue";
2
2
  import { p as process$1 } from "./converter-DYAHhSrg.js";
3
- import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-VW8eKYoK.js";
3
+ import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-B1W7AdgQ.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 { E } from "./chunks/editor-VW8eKYoK.js";
1
+ import { E } from "./chunks/editor-B1W7AdgQ.js";
2
2
  import "./chunks/converter-DYAHhSrg.js";
3
3
  import "./chunks/docx-zipper-BDbCmfbE.js";
4
4
  export {
@@ -0,0 +1 @@
1
+ export function shouldBypassContextMenu(event: any): boolean;
@@ -22,6 +22,7 @@
22
22
  * @private
23
23
  */
24
24
  export const CustomSelectionPluginKey: PluginKey<any>;
25
+ export function shouldAllowNativeContextMenu(event: MouseEvent): boolean;
25
26
  /**
26
27
  * @module CustomSelection
27
28
  * @sidebarTitle Custom Selection
@@ -11,10 +11,10 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
11
11
  var _SuperToolbar_instances, initToolbarGroups_fn, _interceptedCommands, makeToolbarItems_fn, initDefaultFonts_fn, updateHighlightColors_fn, deactivateAll_fn, updateToolbarHistory_fn, runCommandWithArgumentOnly_fn;
12
12
  import { av as getDefaultExportFromCjs, V as v4, T as TextSelection$1, v as getMarkRange, ay as vClickOutside, H as findParentNode, az as getActiveFormatting, ap as isInTable, aA as readFromClipboard, aB as handleClipboardPaste, aC as getFileObject, aD as runPropertyTranslators, aE as translator, aF as translator$1, aG as translator$2, aH as translator$3, aI as translator$4, aJ as translator$5, aK as translator$6, aL as translator$7, aM as translator$8, aN as translator$9, aO as translator$a, aP as translator$b, aQ as translator$c, aR as translator$d, aS as translator$e, aT as translator$f, aU as translator$g, aV as translator$h, aW as translator$i, aX as translator$j, aY as translator$k, aZ as translator$l, a_ as translator$m, a$ as translator$n, b0 as translator$o, b1 as translator$p, b2 as translator$q, b3 as translator$r, b4 as translator$s, b5 as translator$t, b6 as translator$u, b7 as translator$v, b8 as translator$w, b9 as translator$x, ba as translator$y, bb as translator$z, bc as translator$A, bd as translator$B, be as translator$C, bf as translator$D, bg as translator$E, bh as translator$F, bi as translator$G, bj as translator$H, bk as translator$I, bl as translator$J, bm as translator$K, bn as translator$L, bo as translator$M, bp as translator$N, bq as translator$O, br as translator$P, bs as translator$Q, bt as translator$R, bu as translator$S, bv as translator$T, bw as translator$U, bx as translator$V, by as translator$W, bz as translator$X, bA as translator$Y, bB as translator$Z, bC as translator$_, bD as translator$$, bE as translator$10, a as Plugin } from "./chunks/converter-DYAHhSrg.js";
13
13
  import { bF, a5, i, a2 } from "./chunks/converter-DYAHhSrg.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, y as yUndoPluginKey, f as undoDepth, h as redoDepth, S as SlashMenuPluginKey, E as Editor, i as getStarterExtensions, P as Placeholder, j as getRichTextExtensions, M as Mark, k as Extension, A as Attribute, N as Node } from "./chunks/editor-VW8eKYoK.js";
15
- import { n, C, o, T, l, p, m } from "./chunks/editor-VW8eKYoK.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, y as yUndoPluginKey, f as undoDepth, h as redoDepth, S as SlashMenuPluginKey, E as Editor, i as getStarterExtensions, P as Placeholder, j as getRichTextExtensions, M as Mark, k as Extension, A as Attribute, N as Node } from "./chunks/editor-B1W7AdgQ.js";
15
+ import { n, C, o, T, l, p, m } from "./chunks/editor-B1W7AdgQ.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, m as magicWandIcon, p as plusIconSvg, a as trashIconSvg, l as linkIconSvg, b as tableIconSvg, c as scissorsIconSvg, d as copyIconSvg, e as pasteIconSvg, f as borderNoneIconSvg, g as arrowsToDotIconSvg, h as arrowsLeftRightIconSvg, w as wrenchIconSvg, u as useMessage, N as NSkeleton } from "./chunks/toolbar-B1up5fYV.js";
17
+ import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, m as magicWandIcon, p as plusIconSvg, a as trashIconSvg, l as linkIconSvg, b as tableIconSvg, c as scissorsIconSvg, d as copyIconSvg, e as pasteIconSvg, f as borderNoneIconSvg, g as arrowsToDotIconSvg, h as arrowsLeftRightIconSvg, w as wrenchIconSvg, u as useMessage, N as NSkeleton } from "./chunks/toolbar-CCvglB_X.js";
18
18
  import AIWriter from "./ai-writer.es.js";
19
19
  import { D } from "./chunks/docx-zipper-BDbCmfbE.js";
20
20
  import { createZip } from "./file-zipper.es.js";
@@ -3695,6 +3695,14 @@ function getStructureFromResolvedPos(state, pos) {
3695
3695
  return null;
3696
3696
  }
3697
3697
  }
3698
+ const shouldBypassContextMenu = (event) => {
3699
+ if (!event) return false;
3700
+ if (event.ctrlKey || event.metaKey) {
3701
+ return true;
3702
+ }
3703
+ const isKeyboardInvocation = event.type === "contextmenu" && typeof event.detail === "number" && event.detail === 0 && (event.button === 0 || event.button === void 0) && event.clientX === 0 && event.clientY === 0;
3704
+ return Boolean(isKeyboardInvocation);
3705
+ };
3698
3706
  const isModuleEnabled = (editorOptions, moduleName) => {
3699
3707
  switch (moduleName) {
3700
3708
  case "ai":
@@ -4069,8 +4077,7 @@ const _sfc_main$4 = {
4069
4077
  };
4070
4078
  const handleRightClick = async (event) => {
4071
4079
  const readOnly = !props.editor?.isEditable;
4072
- const isHoldingCtrl = event.ctrlKey;
4073
- if (readOnly || isHoldingCtrl) {
4080
+ if (readOnly || shouldBypassContextMenu(event)) {
4074
4081
  return;
4075
4082
  }
4076
4083
  event.preventDefault();
@@ -1,6 +1,6 @@
1
1
  import "vue";
2
- import { T } from "./chunks/toolbar-B1up5fYV.js";
3
- import "./chunks/editor-VW8eKYoK.js";
2
+ import { T } from "./chunks/toolbar-CCvglB_X.js";
3
+ import "./chunks/editor-B1W7AdgQ.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-aBw27Tag.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-Ct59l8tt.cjs");
4
4
  require("./chunks/vue-DWle4Cai.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-DWm41myg.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-C5dhT0uU.es.js";
2
2
  import "./chunks/vue-CXxsqYcP.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-aBw27Tag.cjs");
4
- const superdoc = require("./chunks/index-Bpp8Ruyf.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-Ct59l8tt.cjs");
4
+ const superdoc = require("./chunks/index-BNA5J__D.cjs");
5
5
  require("./chunks/vue-DWle4Cai.cjs");
6
6
  require("./chunks/jszip-b7l8QkfH.cjs");
7
7
  const blankDocx = require("./chunks/blank-docx-CPqX9RF5.cjs");
@@ -1,5 +1,5 @@
1
- import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-DWm41myg.es.js";
2
- import { D, H, P, S as S2, m, l } from "./chunks/index-CLGEbkfW.es.js";
1
+ import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-C5dhT0uU.es.js";
2
+ import { D, H, P, S as S2, m, l } from "./chunks/index-CjQDYBP2.es.js";
3
3
  import "./chunks/vue-CXxsqYcP.es.js";
4
4
  import "./chunks/jszip-B8KIZSNe.es.js";
5
5
  import { B } from "./chunks/blank-docx-iwdyG9RH.es.js";
@@ -61290,6 +61290,14 @@ Please report this to https://github.com/markedjs/marked.`, e) {
61290
61290
  return result;
61291
61291
  };
61292
61292
  const CustomSelectionPluginKey = new PluginKey("CustomSelection");
61293
+ const shouldAllowNativeContextMenu = (event) => {
61294
+ if (!event) return false;
61295
+ if (event.ctrlKey || event.metaKey) {
61296
+ return true;
61297
+ }
61298
+ const isKeyboardInvocation = event.type === "contextmenu" && typeof event.detail === "number" && event.detail === 0 && (event.button === 0 || event.button === void 0) && event.clientX === 0 && event.clientY === 0;
61299
+ return Boolean(isKeyboardInvocation);
61300
+ };
61293
61301
  const handleClickOutside = (event, editor) => {
61294
61302
  const editorElem = editor?.options?.element;
61295
61303
  if (!editorElem) return;
@@ -61351,6 +61359,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
61351
61359
  props: {
61352
61360
  handleDOMEvents: {
61353
61361
  contextmenu: (view, event) => {
61362
+ if (shouldAllowNativeContextMenu(event)) {
61363
+ return false;
61364
+ }
61354
61365
  event.preventDefault();
61355
61366
  const { selection } = view.state;
61356
61367
  if (!selection.empty) {
@@ -61369,6 +61380,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
61369
61380
  },
61370
61381
  mousedown: (view, event) => {
61371
61382
  if (event.button === 2) {
61383
+ if (shouldAllowNativeContextMenu(event)) {
61384
+ return false;
61385
+ }
61372
61386
  event.preventDefault();
61373
61387
  const { selection: selection2 } = view.state;
61374
61388
  if (!selection2.empty) {
@@ -91847,6 +91861,14 @@ ${style2}
91847
91861
  return null;
91848
91862
  }
91849
91863
  }
91864
+ const shouldBypassContextMenu = (event) => {
91865
+ if (!event) return false;
91866
+ if (event.ctrlKey || event.metaKey) {
91867
+ return true;
91868
+ }
91869
+ const isKeyboardInvocation = event.type === "contextmenu" && typeof event.detail === "number" && event.detail === 0 && (event.button === 0 || event.button === void 0) && event.clientX === 0 && event.clientY === 0;
91870
+ return Boolean(isKeyboardInvocation);
91871
+ };
91850
91872
  const isModuleEnabled = (editorOptions, moduleName) => {
91851
91873
  switch (moduleName) {
91852
91874
  case "ai":
@@ -92221,8 +92243,7 @@ ${style2}
92221
92243
  };
92222
92244
  const handleRightClick = async (event) => {
92223
92245
  const readOnly = !props.editor?.isEditable;
92224
- const isHoldingCtrl = event.ctrlKey;
92225
- if (readOnly || isHoldingCtrl) {
92246
+ if (readOnly || shouldBypassContextMenu(event)) {
92226
92247
  return;
92227
92248
  }
92228
92249
  event.preventDefault();