@harbour-enterprises/superdoc 0.14.6-next.1 → 0.14.6-next.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 (34) hide show
  1. package/dist/chunks/{index-BvK-G6B1.es.js → index-BMwK7kM5.es.js} +2 -2
  2. package/dist/chunks/{index-CCRVYhTn.cjs → index-CZuIe8A3.cjs} +1 -1
  3. package/dist/chunks/{index-oHslWah4.es.js → index-MJ-5Yknb.es.js} +1 -1
  4. package/dist/chunks/{index-CgJ5KVh6.cjs → index-Oz4X1zyg.cjs} +2 -2
  5. package/dist/chunks/{super-editor.es-CrgVVH1z.cjs → super-editor.es-Do3auYDx.cjs} +14 -41
  6. package/dist/chunks/{super-editor.es-C5w6Wuc4.es.js → super-editor.es-Doj47_Uk.es.js} +14 -41
  7. package/dist/chunks/{url-BG1Z_Z2_.cjs → url-CRVat8D5.cjs} +1 -1
  8. package/dist/chunks/{url-Dvx6wrNT.es.js → url-Cqg2Hljl.es.js} +1 -1
  9. package/dist/chunks/{xml-js-DNISVjNF.es.js → xml-js-D78KIQHL.es.js} +4 -11
  10. package/dist/chunks/{xml-js-BHJlXtfU.cjs → xml-js-t28wMlyv.cjs} +4 -11
  11. package/dist/core/SuperDoc.d.ts +5 -0
  12. package/dist/core/SuperDoc.d.ts.map +1 -1
  13. package/dist/style.css +33 -33
  14. package/dist/super-editor/ai-writer.es.js +2 -2
  15. package/dist/super-editor/chunks/{converter-CHxfAokc.js → converter-Ro5dTlZK.js} +3 -31
  16. package/dist/super-editor/chunks/{docx-zipper-BaVeoXq1.js → docx-zipper-Bw5bp8Iy.js} +1 -1
  17. package/dist/super-editor/chunks/{editor-DyLiwM3q.js → editor-CxB6pOHC.js} +6 -3
  18. package/dist/super-editor/chunks/{toolbar-C6CR9aUj.js → toolbar-BAcW5u42.js} +2 -2
  19. package/dist/super-editor/components/slash-menu/menuItems.d.ts.map +1 -1
  20. package/dist/super-editor/converter.es.js +1 -1
  21. package/dist/super-editor/docx-zipper.es.js +2 -2
  22. package/dist/super-editor/editor.es.js +3 -3
  23. package/dist/super-editor/extensions/slash-menu/slash-menu.d.ts.map +1 -1
  24. package/dist/super-editor/file-zipper.es.js +1 -1
  25. package/dist/super-editor/style.css +6 -6
  26. package/dist/super-editor/super-editor.es.js +14 -18
  27. package/dist/super-editor/toolbar.es.js +2 -2
  28. package/dist/super-editor.cjs +1 -1
  29. package/dist/super-editor.es.js +1 -1
  30. package/dist/superdoc.cjs +10 -7
  31. package/dist/superdoc.es.js +11 -8
  32. package/dist/superdoc.umd.js +20 -44
  33. package/dist/superdoc.umd.js.map +1 -1
  34. package/package.json +1 -1
@@ -15941,32 +15941,6 @@ function parseSizeUnit(val = "0") {
15941
15941
  function minMax(value = 0, min2 = 0, max2 = 0) {
15942
15942
  return Math.min(Math.max(value, min2), max2);
15943
15943
  }
15944
- function serializeSelectionToClipboard(state2) {
15945
- const { from, to } = state2.selection;
15946
- const slice = state2.selection.content();
15947
- const htmlContainer = document.createElement("div");
15948
- htmlContainer.appendChild(
15949
- DOMSerializer.fromSchema(state2.schema).serializeFragment(slice.content)
15950
- );
15951
- const htmlString = htmlContainer.innerHTML;
15952
- const text = state2.doc.textBetween(from, to);
15953
- return { htmlString, text };
15954
- }
15955
- async function writeToClipboard({ htmlString, text }) {
15956
- try {
15957
- if (navigator.clipboard && window.ClipboardItem) {
15958
- const clipboardItem = new window.ClipboardItem({
15959
- "text/html": new Blob([htmlString], { type: "text/html" }),
15960
- "text/plain": new Blob([text], { type: "text/plain" })
15961
- });
15962
- await navigator.clipboard.write([clipboardItem]);
15963
- } else {
15964
- await navigator.clipboard.writeText(text);
15965
- }
15966
- } catch (e) {
15967
- console.error("Error writing to clipboard", e);
15968
- }
15969
- }
15970
15944
  async function readFromClipboard(state2) {
15971
15945
  let html = "";
15972
15946
  let text = "";
@@ -24350,7 +24324,7 @@ const _SuperConverter = class _SuperConverter {
24350
24324
  return;
24351
24325
  }
24352
24326
  }
24353
- static updateDocumentVersion(docx = this.convertedXml, version = "0.14.6-next.1") {
24327
+ static updateDocumentVersion(docx = this.convertedXml, version = "0.14.6-next.3") {
24354
24328
  const customLocation = "docProps/custom.xml";
24355
24329
  if (!docx[customLocation]) {
24356
24330
  docx[customLocation] = generateCustomXml();
@@ -24829,7 +24803,7 @@ function storeSuperdocVersion(docx) {
24829
24803
  function generateCustomXml() {
24830
24804
  return DEFAULT_CUSTOM_XML;
24831
24805
  }
24832
- function generateSuperdocVersion(pid = 2, version = "0.14.6-next.1") {
24806
+ function generateSuperdocVersion(pid = 2, version = "0.14.6-next.3") {
24833
24807
  return {
24834
24808
  type: "element",
24835
24809
  name: "property",
@@ -24898,9 +24872,7 @@ export {
24898
24872
  xmljs as ad,
24899
24873
  vClickOutside as ae,
24900
24874
  readFromClipboard as af,
24901
- serializeSelectionToClipboard as ag,
24902
- writeToClipboard as ah,
24903
- handleClipboardPaste as ai,
24875
+ handleClipboardPaste as ag,
24904
24876
  canSplit as b,
24905
24877
  callOrGet as c,
24906
24878
  canJoin as d,
@@ -1,4 +1,4 @@
1
- import { C as process$1, aa as commonjsGlobal, E as Buffer, ab as getDefaultExportFromCjs, ac as getContentTypesFromXml, ad as xmljs } from "./converter-CHxfAokc.js";
1
+ import { C as process$1, aa as commonjsGlobal, E as Buffer, ab as getDefaultExportFromCjs, ac as getContentTypesFromXml, ad as xmljs } from "./converter-Ro5dTlZK.js";
2
2
  function commonjsRequire(path) {
3
3
  throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
4
4
  }
@@ -12,9 +12,9 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
12
12
  var _Attribute_static, getGlobalAttributes_fn, getNodeAndMarksAttributes_fn, _Schema_static, createNodesSchema_fn, createMarksSchema_fn, _events, _ExtensionService_instances, setupExtensions_fn, attachEditorEvents_fn, _commandService, _css, _Editor_instances, initContainerElement_fn, init_fn, initRichText_fn, onFocus_fn, checkHeadless_fn, insertNewFileData_fn, registerPluginByNameIfNotExists_fn, createExtensionService_fn, createCommandService_fn, createConverter_fn, initMedia_fn, initFonts_fn, createSchema_fn, generatePmData_fn, createDocFromHTML_fn, createView_fn, onCollaborationReady_fn, initComments_fn, dispatchTransaction_fn, handleNodeSelection_fn, prepareDocumentForImport_fn, prepareDocumentForExport_fn, endCollaboration_fn, _ListItemNodeView_instances, init_fn2, _FieldAnnotationView_instances, createAnnotation_fn, _AutoPageNumberNodeView_instances, renderDom_fn, scheduleUpdateNodeStyle_fn;
13
13
  import * as Y from "yjs";
14
14
  import { UndoManager, Item as Item$1, ContentType, Text as Text$1, XmlElement, encodeStateAsUpdate } from "yjs";
15
- import { P as PluginKey, a as Plugin, M as Mapping, c as callOrGet, i as isEmptyObject, S as Schema$1, T as TextSelection, b as canSplit, l as liftTarget, A as AllSelection, d as canJoin, j as joinPoint, N as NodeSelection, e as Selection, r as replaceStep$1, F as Fragment, R as ReplaceAroundStep$1, f as Slice, o as objectIncludes, g as deleteProps, D as DOMParser$1, h as ReplaceStep, k as NodeRange, m as findWrapping, n as generateDocxRandomId, p as minMax, q as chainableEditorState, s as generateRandom32BitHex, t as getStyleTagFromStyleId, u as getAbstractDefinition, v as getDefinitionForLevel, w as isMacOS, x as isIOS, y as DOMSerializer, z as Mark$1, B as dropPoint, C as process$1, E as Buffer2, G as inputRulesPlugin, H as TrackDeleteMarkName, I as TrackInsertMarkName, J as v4, K as TrackFormatMarkName, L as comments_module_events, O as AddMarkStep, Q as RemoveMarkStep, U as twipsToLines, V as pixelsToTwips, W as CommandService, X as SuperConverter, Y as EditorState, Z as hasSomeParentWithClass, _ as parseSizeUnit, $ as getLineHeightValueString, a0 as InputRule, a1 as toKebabCase, a2 as kebabCase, a3 as docxNumberigHelpers, a4 as parseIndentElement, a5 as combineIndents, a6 as getColStyleDeclaration, a7 as SelectionRange, a8 as Transform, a9 as createColGroup } from "./converter-CHxfAokc.js";
15
+ import { P as PluginKey, a as Plugin, M as Mapping, c as callOrGet, i as isEmptyObject, S as Schema$1, T as TextSelection, b as canSplit, l as liftTarget, A as AllSelection, d as canJoin, j as joinPoint, N as NodeSelection, e as Selection, r as replaceStep$1, F as Fragment, R as ReplaceAroundStep$1, f as Slice, o as objectIncludes, g as deleteProps, D as DOMParser$1, h as ReplaceStep, k as NodeRange, m as findWrapping, n as generateDocxRandomId, p as minMax, q as chainableEditorState, s as generateRandom32BitHex, t as getStyleTagFromStyleId, u as getAbstractDefinition, v as getDefinitionForLevel, w as isMacOS, x as isIOS, y as DOMSerializer, z as Mark$1, B as dropPoint, C as process$1, E as Buffer2, G as inputRulesPlugin, H as TrackDeleteMarkName, I as TrackInsertMarkName, J as v4, K as TrackFormatMarkName, L as comments_module_events, O as AddMarkStep, Q as RemoveMarkStep, U as twipsToLines, V as pixelsToTwips, W as CommandService, X as SuperConverter, Y as EditorState, Z as hasSomeParentWithClass, _ as parseSizeUnit, $ as getLineHeightValueString, a0 as InputRule, a1 as toKebabCase, a2 as kebabCase, a3 as docxNumberigHelpers, a4 as parseIndentElement, a5 as combineIndents, a6 as getColStyleDeclaration, a7 as SelectionRange, a8 as Transform, a9 as createColGroup } from "./converter-Ro5dTlZK.js";
16
16
  import { ref, computed, createElementBlock, openBlock, withModifiers, Fragment as Fragment$1, renderList, normalizeClass, createCommentVNode, toDisplayString, createElementVNode, createApp } from "vue";
17
- import { D as DocxZipper } from "./docx-zipper-BaVeoXq1.js";
17
+ import { D as DocxZipper } from "./docx-zipper-Bw5bp8Iy.js";
18
18
  function getMarksFromSelection(state) {
19
19
  const { from: from2, to, empty: empty2 } = state.selection;
20
20
  const marks = [];
@@ -15112,7 +15112,7 @@ const _Editor = class _Editor extends EventEmitter {
15112
15112
  * @returns {Object | void} Migration results
15113
15113
  */
15114
15114
  processCollaborationMigrations() {
15115
- console.debug("[checkVersionMigrations] Current editor version", "0.14.6-next.1");
15115
+ console.debug("[checkVersionMigrations] Current editor version", "0.14.6-next.3");
15116
15116
  if (!this.options.ydoc) return;
15117
15117
  const metaMap = this.options.ydoc.getMap("meta");
15118
15118
  let docVersion = metaMap.get("version");
@@ -16831,6 +16831,9 @@ const SlashMenuPluginKey = new PluginKey("slashMenu");
16831
16831
  const SlashMenu = Extension.create({
16832
16832
  name: "slashMenu",
16833
16833
  addPmPlugins() {
16834
+ if (this.editor.options?.disableContextMenu) {
16835
+ return [];
16836
+ }
16834
16837
  const editor = this.editor;
16835
16838
  let slashCooldown = false;
16836
16839
  let slashCooldownTimeout = null;
@@ -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
- import { C as process$1 } from "./converter-CHxfAokc.js";
3
- import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-DyLiwM3q.js";
2
+ import { C as process$1 } from "./converter-Ro5dTlZK.js";
3
+ import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-CxB6pOHC.js";
4
4
  const sanitizeNumber = (value, defaultNumber) => {
5
5
  let sanitized = value.replace(/[^0-9.]/g, "");
6
6
  sanitized = parseFloat(sanitized);
@@ -1 +1 @@
1
- {"version":3,"file":"menuItems.d.ts","sourceRoot":"","sources":["../../../src/components/slash-menu/menuItems.js"],"names":[],"mappings":"AAgCA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wCAhBa,KAAK,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,KAAK,CAAC;QACX,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,SAAS,CAAC,EAAE,SAAS,CAAC;QACtB,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;QAClC,eAAe,EAAE,KAAK,CAAC,OAAO,GAAC,OAAO,CAAC,CAAC;QACxC,iBAAiB,CAAC,EAAE,OAAO,CAAC;QAC5B,iBAAiB,CAAC,EAAE,OAAO,CAAA;QAC3B,mBAAmB,CAAC,EAAE,OAAO,CAAA;QAC7B,cAAc,CAAC,EAAE,MAAM,CAAA;KACxB,CAAC,CAAA;CACH,CAAC,CA2JJ"}
1
+ {"version":3,"file":"menuItems.d.ts","sourceRoot":"","sources":["../../../src/components/slash-menu/menuItems.js"],"names":[],"mappings":"AAgCA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wCAhBa,KAAK,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,KAAK,CAAC;QACX,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,SAAS,CAAC,EAAE,SAAS,CAAC;QACtB,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;QAClC,eAAe,EAAE,KAAK,CAAC,OAAO,GAAC,OAAO,CAAC,CAAC;QACxC,iBAAiB,CAAC,EAAE,OAAO,CAAC;QAC5B,iBAAiB,CAAC,EAAE,OAAO,CAAA;QAC3B,mBAAmB,CAAC,EAAE,OAAO,CAAA;QAC7B,cAAc,CAAC,EAAE,MAAM,CAAA;KACxB,CAAC,CAAA;CACH,CAAC,CAuJJ"}
@@ -1,4 +1,4 @@
1
- import { X } from "./chunks/converter-CHxfAokc.js";
1
+ import { X } from "./chunks/converter-Ro5dTlZK.js";
2
2
  export {
3
3
  X as SuperConverter
4
4
  };
@@ -1,5 +1,5 @@
1
- import "./chunks/converter-CHxfAokc.js";
2
- import { D } from "./chunks/docx-zipper-BaVeoXq1.js";
1
+ import "./chunks/converter-Ro5dTlZK.js";
2
+ import { D } from "./chunks/docx-zipper-Bw5bp8Iy.js";
3
3
  export {
4
4
  D as default
5
5
  };
@@ -1,6 +1,6 @@
1
- import { E } from "./chunks/editor-DyLiwM3q.js";
2
- import "./chunks/converter-CHxfAokc.js";
3
- import "./chunks/docx-zipper-BaVeoXq1.js";
1
+ import { E } from "./chunks/editor-CxB6pOHC.js";
2
+ import "./chunks/converter-Ro5dTlZK.js";
3
+ import "./chunks/docx-zipper-Bw5bp8Iy.js";
4
4
  export {
5
5
  E as Editor
6
6
  };
@@ -1 +1 @@
1
- {"version":3,"file":"slash-menu.d.ts","sourceRoot":"","sources":["../../../src/extensions/slash-menu/slash-menu.js"],"names":[],"mappings":"AA6BA,gDAA6D;AAE7D,4BAoKG;0BAnM+B,mBAAmB"}
1
+ {"version":3,"file":"slash-menu.d.ts","sourceRoot":"","sources":["../../../src/extensions/slash-menu/slash-menu.js"],"names":[],"mappings":"AA6BA,gDAA6D;AAE7D,4BAuKG;0BAtM+B,mBAAmB"}
@@ -1,4 +1,4 @@
1
- import { J as JSZip } from "./chunks/docx-zipper-BaVeoXq1.js";
1
+ import { J as JSZip } from "./chunks/docx-zipper-Bw5bp8Iy.js";
2
2
  async function createZip(blobs, fileNames) {
3
3
  const zip = new JSZip();
4
4
  blobs.forEach((blob, index) => {
@@ -1700,10 +1700,10 @@ on the right if it is inside shape textbox.
1700
1700
  min-height: 40px;
1701
1701
  }
1702
1702
 
1703
- .editor-element[data-v-d4ce5f62] {
1703
+ .editor-element[data-v-14919226] {
1704
1704
  position: relative;
1705
1705
  }
1706
- .super-editor-container[data-v-d4ce5f62] {
1706
+ .super-editor-container[data-v-14919226] {
1707
1707
  width: auto;
1708
1708
  height: auto;
1709
1709
  min-width: 8in;
@@ -1712,13 +1712,13 @@ on the right if it is inside shape textbox.
1712
1712
  display: flex;
1713
1713
  flex-direction: column;
1714
1714
  }
1715
- .ruler[data-v-d4ce5f62] {
1715
+ .ruler[data-v-14919226] {
1716
1716
  margin-bottom: 2px;
1717
1717
  }
1718
- .super-editor[data-v-d4ce5f62] {
1718
+ .super-editor[data-v-14919226] {
1719
1719
  color: initial;
1720
1720
  }
1721
- .placeholder-editor[data-v-d4ce5f62] {
1721
+ .placeholder-editor[data-v-14919226] {
1722
1722
  position: absolute;
1723
1723
  top: 0;
1724
1724
  left: 0;
@@ -1730,7 +1730,7 @@ on the right if it is inside shape textbox.
1730
1730
  background-color: white;
1731
1731
  box-sizing: border-box;
1732
1732
  }
1733
- .placeholder-title[data-v-d4ce5f62] {
1733
+ .placeholder-title[data-v-14919226] {
1734
1734
  display: flex;
1735
1735
  justify-content: center;
1736
1736
  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 _SuperToolbar_instances, initToolbarGroups_fn, _interceptedCommands, makeToolbarItems_fn, initDefaultFonts_fn, updateHighlightColors_fn, deactivateAll_fn, updateToolbarHistory_fn, runCommandWithArgumentOnly_fn;
12
- import { ab as getDefaultExportFromCjs, J as v4, T as TextSelection$1, ae as vClickOutside, af as readFromClipboard, ag as serializeSelectionToClipboard, ah as writeToClipboard, ai as handleClipboardPaste, a as Plugin } from "./chunks/converter-CHxfAokc.js";
13
- import { X } from "./chunks/converter-CHxfAokc.js";
14
- import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, c as getMarkRange, f as findParentNode, d as getFileOpener, s as startImageUpload, e as getActiveFormatting, i as isInTable, h as undoDepth, r as redoDepth, S as SlashMenuPluginKey, E as Editor, j as getStarterExtensions, P as Placeholder, k as getRichTextExtensions, M as Mark, l as Extension, A as Attribute, N as Node } from "./chunks/editor-DyLiwM3q.js";
15
- import { p, C, T, n, t, q, m, o } from "./chunks/editor-DyLiwM3q.js";
12
+ import { ab as getDefaultExportFromCjs, J as v4, T as TextSelection$1, ae as vClickOutside, af as readFromClipboard, ag as handleClipboardPaste, a as Plugin } from "./chunks/converter-Ro5dTlZK.js";
13
+ import { X } from "./chunks/converter-Ro5dTlZK.js";
14
+ import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, c as getMarkRange, f as findParentNode, d as getFileOpener, s as startImageUpload, e as getActiveFormatting, i as isInTable, h as undoDepth, r as redoDepth, S as SlashMenuPluginKey, E as Editor, j as getStarterExtensions, P as Placeholder, k as getRichTextExtensions, M as Mark, l as Extension, A as Attribute, N as Node } from "./chunks/editor-CxB6pOHC.js";
15
+ import { p, C, T, n, t, q, m, o } from "./chunks/editor-CxB6pOHC.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, l as linkIconSvg, a as tableIconSvg, b as scissorsIconSvg, c as copyIconSvg, p as pasteIconSvg, N as NSkeleton } from "./chunks/toolbar-C6CR9aUj.js";
17
+ import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, m as magicWandIcon, l as linkIconSvg, a as tableIconSvg, b as scissorsIconSvg, c as copyIconSvg, p as pasteIconSvg, N as NSkeleton } from "./chunks/toolbar-BAcW5u42.js";
18
18
  import AIWriter from "./ai-writer.es.js";
19
- import { D } from "./chunks/docx-zipper-BaVeoXq1.js";
19
+ import { D } from "./chunks/docx-zipper-Bw5bp8Iy.js";
20
20
  import { createZip } from "./file-zipper.es.js";
21
21
  var eventemitter3 = { exports: {} };
22
22
  (function(module) {
@@ -3344,12 +3344,9 @@ function getItems(context) {
3344
3344
  id: "cut",
3345
3345
  label: TEXTS.cut,
3346
3346
  icon: ICONS.cut,
3347
- action: async (editor2) => {
3348
- const { state, dispatch } = editor2.view;
3349
- const { htmlString, text } = serializeSelectionToClipboard(state);
3350
- await writeToClipboard({ htmlString, text });
3351
- const { from, to } = state.selection;
3352
- dispatch(state.tr.delete(from, to));
3347
+ action: (editor2) => {
3348
+ editor2.view.focus();
3349
+ document.execCommand("cut");
3353
3350
  },
3354
3351
  allowedTriggers: [TRIGGERS.click],
3355
3352
  requiresSelection: true
@@ -3358,10 +3355,9 @@ function getItems(context) {
3358
3355
  id: "copy",
3359
3356
  label: TEXTS.copy,
3360
3357
  icon: ICONS.copy,
3361
- action: async (editor2) => {
3362
- const { state } = editor2.view;
3363
- const { htmlString, text } = serializeSelectionToClipboard(state);
3364
- await writeToClipboard({ htmlString, text });
3358
+ action: (editor2) => {
3359
+ editor2.view.focus();
3360
+ document.execCommand("copy");
3365
3361
  },
3366
3362
  allowedTriggers: [TRIGGERS.click],
3367
3363
  requiresSelection: true
@@ -4177,7 +4173,7 @@ const _sfc_main$2 = {
4177
4173
  class: "editor-element super-editor__element",
4178
4174
  role: "presentation"
4179
4175
  }, null, 512),
4180
- editorReady.value && editor.value ? (openBlock(), createBlock(_sfc_main$5, {
4176
+ !props.options.disableContextMenu && editorReady.value && editor.value ? (openBlock(), createBlock(_sfc_main$5, {
4181
4177
  key: 0,
4182
4178
  editor: editor.value,
4183
4179
  popoverControls,
@@ -4246,7 +4242,7 @@ const _sfc_main$2 = {
4246
4242
  };
4247
4243
  }
4248
4244
  };
4249
- const SuperEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-d4ce5f62"]]);
4245
+ const SuperEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-14919226"]]);
4250
4246
  const _sfc_main$1 = {
4251
4247
  __name: "BasicUpload",
4252
4248
  emits: ["file-change"],
@@ -1,6 +1,6 @@
1
1
  import "vue";
2
- import { T } from "./chunks/toolbar-C6CR9aUj.js";
3
- import "./chunks/editor-DyLiwM3q.js";
2
+ import { T } from "./chunks/toolbar-BAcW5u42.js";
3
+ import "./chunks/editor-CxB6pOHC.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-CrgVVH1z.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-Do3auYDx.cjs");
4
4
  require("./chunks/vue-tQYF719J.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, c, S, d, e, f, T, g, h, i, j, k, l, m, n, o, p } from "./chunks/super-editor.es-C5w6Wuc4.es.js";
1
+ import { A, a, _, C, D, E, b, c, S, d, e, f, T, g, h, i, j, k, l, m, n, o, p } from "./chunks/super-editor.es-Doj47_Uk.es.js";
2
2
  import "./chunks/vue-lU0o_RlU.es.js";
3
3
  export {
4
4
  A as AIWriter,
package/dist/superdoc.cjs CHANGED
@@ -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-CrgVVH1z.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-Do3auYDx.cjs");
4
4
  const vue = require("./chunks/vue-tQYF719J.cjs");
5
5
  const jszip = require("./chunks/jszip-D5XoMX4C.cjs");
6
6
  const blankDocx = require("./chunks/blank-docx-CPqX9RF5.cjs");
@@ -24406,13 +24406,13 @@ var __webpack_exports__$1 = globalThis.pdfjsLib = {};
24406
24406
  "./chunks/empty-lth7LH78.cjs"
24407
24407
  )), http = await Promise.resolve().then(() => require(
24408
24408
  /*webpackIgnore: true*/
24409
- "./chunks/index-CgJ5KVh6.cjs"
24409
+ "./chunks/index-Oz4X1zyg.cjs"
24410
24410
  )).then((n) => n.index), https = await Promise.resolve().then(() => require(
24411
24411
  /*webpackIgnore: true*/
24412
- "./chunks/index-CCRVYhTn.cjs"
24412
+ "./chunks/index-CZuIe8A3.cjs"
24413
24413
  )).then((n) => n.index), url = await Promise.resolve().then(() => require(
24414
24414
  /*webpackIgnore: true*/
24415
- "./chunks/url-BG1Z_Z2_.cjs"
24415
+ "./chunks/url-CRVat8D5.cjs"
24416
24416
  )).then((n) => n.url);
24417
24417
  let canvas, path2d;
24418
24418
  try {
@@ -47381,6 +47381,7 @@ const _sfc_main = {
47381
47381
  telemetry: proxy.$superdoc.telemetry,
47382
47382
  externalExtensions: proxy.$superdoc.config.editorExtensions || [],
47383
47383
  suppressDefaultDocxStyles: proxy.$superdoc.config.suppressDefaultDocxStyles,
47384
+ disableContextMenu: proxy.$superdoc.config.disableContextMenu,
47384
47385
  jsonOverride: proxy.$superdoc.config.jsonOverride
47385
47386
  };
47386
47387
  return options;
@@ -47708,7 +47709,7 @@ const _sfc_main = {
47708
47709
  };
47709
47710
  }
47710
47711
  };
47711
- const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-f1c59a62"]]);
47712
+ const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-bedc7a86"]]);
47712
47713
  const createSuperdocVueApp = () => {
47713
47714
  const app = vue.createApp(App);
47714
47715
  const pinia = createPinia();
@@ -47790,7 +47791,9 @@ class SuperDoc extends eventemitter3.EventEmitter {
47790
47791
  onException: () => null,
47791
47792
  // Image upload handler
47792
47793
  // async (file) => url;
47793
- handleImageUpload: null
47794
+ handleImageUpload: null,
47795
+ // Disable context menus (slash and right-click) globally
47796
+ disableContextMenu: false
47794
47797
  };
47795
47798
  /**
47796
47799
  * @param {Config} config
@@ -47807,7 +47810,7 @@ class SuperDoc extends eventemitter3.EventEmitter {
47807
47810
  this.config.colors = shuffleArray(this.config.colors);
47808
47811
  this.userColorMap = /* @__PURE__ */ new Map();
47809
47812
  this.colorIndex = 0;
47810
- this.version = "0.14.6-next.1";
47813
+ this.version = "0.14.6-next.3";
47811
47814
  console.debug("🦋 [superdoc] Using SuperDoc version:", this.version);
47812
47815
  this.superdocId = config.superdocId || uuid.v4();
47813
47816
  this.colors = this.config.colors;
@@ -1,5 +1,5 @@
1
- import { p as index$1, C as CommentsPluginKey, g as TrackChangesBasePluginKey, E as Editor, m as getRichTextExtensions, e as SuperInput, d as SuperEditor, A as AIWriter, f as SuperToolbar, h as createZip } from "./chunks/super-editor.es-C5w6Wuc4.es.js";
2
- import { a, S, i, o } from "./chunks/super-editor.es-C5w6Wuc4.es.js";
1
+ import { p as index$1, C as CommentsPluginKey, g as TrackChangesBasePluginKey, E as Editor, m as getRichTextExtensions, e as SuperInput, d as SuperEditor, A as AIWriter, f as SuperToolbar, h as createZip } from "./chunks/super-editor.es-Doj47_Uk.es.js";
2
+ import { a, S, i, o } from "./chunks/super-editor.es-Doj47_Uk.es.js";
3
3
  import { a0 as effectScope, r as ref, $ as markRaw, p as process$1, a1 as toRaw, a as computed, a2 as isRef, a3 as isReactive, D as toRef, i as inject, q as getCurrentInstance, l as watch, y as unref, a4 as hasInjectionContext, N as reactive, u as nextTick, a5 as getCurrentScope, a6 as onScopeDispose, a7 as toRefs, g as global$1, K as shallowRef, O as readonly, j as onMounted, k as onBeforeUnmount, h as onBeforeMount, U as onActivated, s as onDeactivated, A as createTextVNode, F as Fragment, R as Comment, m as defineComponent, E as provide, I as withDirectives, C as h, V as Teleport, S as renderSlot, W as isVNode, J as watchEffect, P as Transition, G as mergeProps, Q as vShow, H as cloneVNode, T as Text, b as createElementBlock, o as openBlock, t as toDisplayString, x as createVNode, z as withCtx, f as createBaseVNode, B as normalizeStyle, e as createCommentVNode, v as createBlock, w as withModifiers, n as normalizeClass, a8 as resolveDirective, d as renderList, c as createApp, X as onUnmounted, Y as resolveDynamicComponent } from "./chunks/vue-lU0o_RlU.es.js";
4
4
  import { B as Buffer$2 } from "./chunks/jszip-CYDYUNnI.es.js";
5
5
  import { B as BlankDOCX } from "./chunks/blank-docx-iwdyG9RH.es.js";
@@ -24389,13 +24389,13 @@ var __webpack_exports__$1 = globalThis.pdfjsLib = {};
24389
24389
  "./chunks/empty-smM22Y5N.es.js"
24390
24390
  ), http = await import(
24391
24391
  /*webpackIgnore: true*/
24392
- "./chunks/index-BvK-G6B1.es.js"
24392
+ "./chunks/index-BMwK7kM5.es.js"
24393
24393
  ).then((n) => n.i), https = await import(
24394
24394
  /*webpackIgnore: true*/
24395
- "./chunks/index-oHslWah4.es.js"
24395
+ "./chunks/index-MJ-5Yknb.es.js"
24396
24396
  ).then((n) => n.i), url = await import(
24397
24397
  /*webpackIgnore: true*/
24398
- "./chunks/url-Dvx6wrNT.es.js"
24398
+ "./chunks/url-Cqg2Hljl.es.js"
24399
24399
  ).then((n) => n.u);
24400
24400
  let canvas, path2d;
24401
24401
  try {
@@ -47364,6 +47364,7 @@ const _sfc_main = {
47364
47364
  telemetry: proxy.$superdoc.telemetry,
47365
47365
  externalExtensions: proxy.$superdoc.config.editorExtensions || [],
47366
47366
  suppressDefaultDocxStyles: proxy.$superdoc.config.suppressDefaultDocxStyles,
47367
+ disableContextMenu: proxy.$superdoc.config.disableContextMenu,
47367
47368
  jsonOverride: proxy.$superdoc.config.jsonOverride
47368
47369
  };
47369
47370
  return options;
@@ -47691,7 +47692,7 @@ const _sfc_main = {
47691
47692
  };
47692
47693
  }
47693
47694
  };
47694
- const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-f1c59a62"]]);
47695
+ const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-bedc7a86"]]);
47695
47696
  const createSuperdocVueApp = () => {
47696
47697
  const app = createApp(App);
47697
47698
  const pinia = createPinia();
@@ -47773,7 +47774,9 @@ class SuperDoc extends EventEmitter {
47773
47774
  onException: () => null,
47774
47775
  // Image upload handler
47775
47776
  // async (file) => url;
47776
- handleImageUpload: null
47777
+ handleImageUpload: null,
47778
+ // Disable context menus (slash and right-click) globally
47779
+ disableContextMenu: false
47777
47780
  };
47778
47781
  /**
47779
47782
  * @param {Config} config
@@ -47790,7 +47793,7 @@ class SuperDoc extends EventEmitter {
47790
47793
  this.config.colors = shuffleArray(this.config.colors);
47791
47794
  this.userColorMap = /* @__PURE__ */ new Map();
47792
47795
  this.colorIndex = 0;
47793
- this.version = "0.14.6-next.1";
47796
+ this.version = "0.14.6-next.3";
47794
47797
  console.debug("🦋 [superdoc] Using SuperDoc version:", this.version);
47795
47798
  this.superdocId = config.superdocId || v4();
47796
47799
  this.colors = this.config.colors;
@@ -23317,32 +23317,6 @@
23317
23317
  function minMax(value = 0, min2 = 0, max2 = 0) {
23318
23318
  return Math.min(Math.max(value, min2), max2);
23319
23319
  }
23320
- function serializeSelectionToClipboard(state2) {
23321
- const { from: from2, to } = state2.selection;
23322
- const slice = state2.selection.content();
23323
- const htmlContainer = document.createElement("div");
23324
- htmlContainer.appendChild(
23325
- DOMSerializer.fromSchema(state2.schema).serializeFragment(slice.content)
23326
- );
23327
- const htmlString = htmlContainer.innerHTML;
23328
- const text = state2.doc.textBetween(from2, to);
23329
- return { htmlString, text };
23330
- }
23331
- async function writeToClipboard({ htmlString, text }) {
23332
- try {
23333
- if (navigator.clipboard && window.ClipboardItem) {
23334
- const clipboardItem = new window.ClipboardItem({
23335
- "text/html": new Blob([htmlString], { type: "text/html" }),
23336
- "text/plain": new Blob([text], { type: "text/plain" })
23337
- });
23338
- await navigator.clipboard.write([clipboardItem]);
23339
- } else {
23340
- await navigator.clipboard.writeText(text);
23341
- }
23342
- } catch (e) {
23343
- console.error("Error writing to clipboard", e);
23344
- }
23345
- }
23346
23320
  async function readFromClipboard(state2) {
23347
23321
  let html = "";
23348
23322
  let text = "";
@@ -31726,7 +31700,7 @@
31726
31700
  return;
31727
31701
  }
31728
31702
  }
31729
- static updateDocumentVersion(docx = this.convertedXml, version2 = "0.14.6-next.1") {
31703
+ static updateDocumentVersion(docx = this.convertedXml, version2 = "0.14.6-next.3") {
31730
31704
  const customLocation = "docProps/custom.xml";
31731
31705
  if (!docx[customLocation]) {
31732
31706
  docx[customLocation] = generateCustomXml();
@@ -32202,7 +32176,7 @@
32202
32176
  function generateCustomXml() {
32203
32177
  return DEFAULT_CUSTOM_XML;
32204
32178
  }
32205
- function generateSuperdocVersion(pid = 2, version2 = "0.14.6-next.1") {
32179
+ function generateSuperdocVersion(pid = 2, version2 = "0.14.6-next.3") {
32206
32180
  return {
32207
32181
  type: "element",
32208
32182
  name: "property",
@@ -49796,7 +49770,7 @@
49796
49770
  * @returns {Object | void} Migration results
49797
49771
  */
49798
49772
  processCollaborationMigrations() {
49799
- console.debug("[checkVersionMigrations] Current editor version", "0.14.6-next.1");
49773
+ console.debug("[checkVersionMigrations] Current editor version", "0.14.6-next.3");
49800
49774
  if (!this.options.ydoc) return;
49801
49775
  const metaMap = this.options.ydoc.getMap("meta");
49802
49776
  let docVersion = metaMap.get("version");
@@ -51378,6 +51352,9 @@
51378
51352
  const SlashMenu = Extension.create({
51379
51353
  name: "slashMenu",
51380
51354
  addPmPlugins() {
51355
+ if (this.editor.options?.disableContextMenu) {
51356
+ return [];
51357
+ }
51381
51358
  const editor = this.editor;
51382
51359
  let slashCooldown = false;
51383
51360
  let slashCooldownTimeout = null;
@@ -78465,12 +78442,9 @@ ${style2}
78465
78442
  id: "cut",
78466
78443
  label: TEXTS.cut,
78467
78444
  icon: ICONS.cut,
78468
- action: async (editor2) => {
78469
- const { state: state2, dispatch } = editor2.view;
78470
- const { htmlString, text } = serializeSelectionToClipboard(state2);
78471
- await writeToClipboard({ htmlString, text });
78472
- const { from: from2, to } = state2.selection;
78473
- dispatch(state2.tr.delete(from2, to));
78445
+ action: (editor2) => {
78446
+ editor2.view.focus();
78447
+ document.execCommand("cut");
78474
78448
  },
78475
78449
  allowedTriggers: [TRIGGERS.click],
78476
78450
  requiresSelection: true
@@ -78479,10 +78453,9 @@ ${style2}
78479
78453
  id: "copy",
78480
78454
  label: TEXTS.copy,
78481
78455
  icon: ICONS.copy,
78482
- action: async (editor2) => {
78483
- const { state: state2 } = editor2.view;
78484
- const { htmlString, text } = serializeSelectionToClipboard(state2);
78485
- await writeToClipboard({ htmlString, text });
78456
+ action: (editor2) => {
78457
+ editor2.view.focus();
78458
+ document.execCommand("copy");
78486
78459
  },
78487
78460
  allowedTriggers: [TRIGGERS.click],
78488
78461
  requiresSelection: true
@@ -79298,7 +79271,7 @@ ${style2}
79298
79271
  class: "editor-element super-editor__element",
79299
79272
  role: "presentation"
79300
79273
  }, null, 512),
79301
- editorReady.value && editor.value ? (openBlock(), createBlock(_sfc_main$5$1, {
79274
+ !props.options.disableContextMenu && editorReady.value && editor.value ? (openBlock(), createBlock(_sfc_main$5$1, {
79302
79275
  key: 0,
79303
79276
  editor: editor.value,
79304
79277
  popoverControls,
@@ -79367,7 +79340,7 @@ ${style2}
79367
79340
  };
79368
79341
  }
79369
79342
  };
79370
- const SuperEditor = /* @__PURE__ */ _export_sfc$1(_sfc_main$2$1, [["__scopeId", "data-v-d4ce5f62"]]);
79343
+ const SuperEditor = /* @__PURE__ */ _export_sfc$1(_sfc_main$2$1, [["__scopeId", "data-v-14919226"]]);
79371
79344
  const _hoisted_1$h = ["innerHTML"];
79372
79345
  const _sfc_main$i = {
79373
79346
  __name: "SuperInput",
@@ -95256,6 +95229,7 @@ ${style2}
95256
95229
  telemetry: proxy.$superdoc.telemetry,
95257
95230
  externalExtensions: proxy.$superdoc.config.editorExtensions || [],
95258
95231
  suppressDefaultDocxStyles: proxy.$superdoc.config.suppressDefaultDocxStyles,
95232
+ disableContextMenu: proxy.$superdoc.config.disableContextMenu,
95259
95233
  jsonOverride: proxy.$superdoc.config.jsonOverride
95260
95234
  };
95261
95235
  return options2;
@@ -95583,7 +95557,7 @@ ${style2}
95583
95557
  };
95584
95558
  }
95585
95559
  };
95586
- const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-f1c59a62"]]);
95560
+ const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-bedc7a86"]]);
95587
95561
  const createSuperdocVueApp = () => {
95588
95562
  const app = createApp(App);
95589
95563
  const pinia = createPinia();
@@ -95665,7 +95639,9 @@ ${style2}
95665
95639
  onException: () => null,
95666
95640
  // Image upload handler
95667
95641
  // async (file) => url;
95668
- handleImageUpload: null
95642
+ handleImageUpload: null,
95643
+ // Disable context menus (slash and right-click) globally
95644
+ disableContextMenu: false
95669
95645
  };
95670
95646
  /**
95671
95647
  * @param {Config} config
@@ -95682,7 +95658,7 @@ ${style2}
95682
95658
  this.config.colors = shuffleArray(this.config.colors);
95683
95659
  this.userColorMap = /* @__PURE__ */ new Map();
95684
95660
  this.colorIndex = 0;
95685
- this.version = "0.14.6-next.1";
95661
+ this.version = "0.14.6-next.3";
95686
95662
  console.debug("🦋 [superdoc] Using SuperDoc version:", this.version);
95687
95663
  this.superdocId = config.superdocId || v4();
95688
95664
  this.colors = this.config.colors;