@harbour-enterprises/superdoc 1.0.0-next.6 → 1.0.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.
Files changed (27) hide show
  1. package/dist/chunks/{PdfViewer-BYeEi4Kx.es.js → PdfViewer-BpJTAUeT.es.js} +1 -1
  2. package/dist/chunks/{PdfViewer-CF4W_li8.cjs → PdfViewer-DVL0SRPs.cjs} +1 -1
  3. package/dist/chunks/{index-BcHbK1Ip.cjs → index-D-MAmimV.cjs} +3 -3
  4. package/dist/chunks/{index-CKb2zoi7-BEMsbmpK.cjs → index-DQd4iefd-BfbLCMZZ.cjs} +1 -1
  5. package/dist/chunks/{index-CKb2zoi7-aboErZCf.es.js → index-DQd4iefd-qCZ-Mcie.es.js} +1 -1
  6. package/dist/chunks/{index-CocFivpQ.es.js → index-WYp7dt-q.es.js} +3 -3
  7. package/dist/chunks/{super-editor.es-C7JZxENm.es.js → super-editor.es-BDJ97wfW.es.js} +363 -264
  8. package/dist/chunks/{super-editor.es-TXxmZOAu.cjs → super-editor.es-DzMe-1gi.cjs} +363 -264
  9. package/dist/super-editor/ai-writer.es.js +2 -2
  10. package/dist/super-editor/chunks/{converter-CyZvCMe8.js → converter-BH40Zd-y.js} +1 -1
  11. package/dist/super-editor/chunks/{docx-zipper-DPV5rnMJ.js → docx-zipper-DP41TnQj.js} +1 -1
  12. package/dist/super-editor/chunks/{editor-uiCiCr8n.js → editor-C81JiIaN.js} +330 -252
  13. package/dist/super-editor/chunks/{index-CKb2zoi7.js → index-DQd4iefd.js} +1 -1
  14. package/dist/super-editor/chunks/{toolbar-Icc3CdW0.js → toolbar-BmUYOo96.js} +2 -2
  15. package/dist/super-editor/converter.es.js +1 -1
  16. package/dist/super-editor/docx-zipper.es.js +2 -2
  17. package/dist/super-editor/editor.es.js +3 -3
  18. package/dist/super-editor/file-zipper.es.js +1 -1
  19. package/dist/super-editor/super-editor.es.js +40 -19
  20. package/dist/super-editor/toolbar.es.js +2 -2
  21. package/dist/super-editor.cjs +1 -1
  22. package/dist/super-editor.es.js +1 -1
  23. package/dist/superdoc.cjs +2 -2
  24. package/dist/superdoc.es.js +2 -2
  25. package/dist/superdoc.umd.js +365 -266
  26. package/dist/superdoc.umd.js.map +1 -1
  27. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { aK as getDefaultExportFromCjs } from "./converter-CyZvCMe8.js";
1
+ import { aK as getDefaultExportFromCjs } from "./converter-BH40Zd-y.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-CyZvCMe8.js";
3
- import { g as global$1, _ as _export_sfc, u as useHighContrastMode } from "./editor-uiCiCr8n.js";
2
+ import { p as process$1 } from "./converter-BH40Zd-y.js";
3
+ import { g as global$1, _ as _export_sfc, u as useHighContrastMode } from "./editor-C81JiIaN.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-CyZvCMe8.js";
1
+ import { ac } from "./chunks/converter-BH40Zd-y.js";
2
2
  export {
3
3
  ac as SuperConverter
4
4
  };
@@ -1,5 +1,5 @@
1
- import "./chunks/converter-CyZvCMe8.js";
2
- import { D } from "./chunks/docx-zipper-DPV5rnMJ.js";
1
+ import "./chunks/converter-BH40Zd-y.js";
2
+ import { D } from "./chunks/docx-zipper-DP41TnQj.js";
3
3
  export {
4
4
  D as default
5
5
  };
@@ -1,6 +1,6 @@
1
- import { E } from "./chunks/editor-uiCiCr8n.js";
2
- import "./chunks/converter-CyZvCMe8.js";
3
- import "./chunks/docx-zipper-DPV5rnMJ.js";
1
+ import { E } from "./chunks/editor-C81JiIaN.js";
2
+ import "./chunks/converter-BH40Zd-y.js";
3
+ import "./chunks/docx-zipper-DP41TnQj.js";
4
4
  export {
5
5
  E as Editor
6
6
  };
@@ -1,4 +1,4 @@
1
- import { J as JSZip } from "./chunks/docx-zipper-DPV5rnMJ.js";
1
+ import { J as JSZip } from "./chunks/docx-zipper-DP41TnQj.js";
2
2
  async function createZip(blobs, fileNames) {
3
3
  const zip = new JSZip();
4
4
  blobs.forEach((blob, index) => {
@@ -9,14 +9,14 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
9
9
  var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
10
10
  var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
11
11
  var _MARK_TOGGLE_NAMES, _SuperToolbar_instances, initToolbarGroups_fn, _interceptedCommands, makeToolbarItems_fn, initDefaultFonts_fn, updateHighlightColors_fn, deactivateAll_fn, updateToolbarHistory_fn, enrichTrackedChanges_fn, runCommandWithArgumentOnly_fn, syncStickyMarksFromState_fn, restoreStickyMarksIfNeeded_fn, ensureStoredMarksForMarkToggle_fn;
12
- import { aK as getDefaultExportFromCjs, a0 as v4, T as TextSelection$1, v as getMarkRange, aN as vClickOutside, aO as getActiveFormatting, aD as isInTable, O as findParentNode, at as calculateResolvedParagraphProperties, a7 as twipsToLines, Q as isList, an as parseSizeUnit, a8 as pixelsToTwips, aP as getFileObject, P as PluginKey, a as Plugin } from "./chunks/converter-CyZvCMe8.js";
13
- import { ac, i, a9, aQ } from "./chunks/converter-CyZvCMe8.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-uiCiCr8n.js";
15
- import { F, I, G, T, B, H, C } from "./chunks/editor-uiCiCr8n.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, a8 as pixelsToTwips, aP as getFileObject, P as PluginKey, a as Plugin } from "./chunks/converter-BH40Zd-y.js";
13
+ import { ac, i, a9, aQ } from "./chunks/converter-BH40Zd-y.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-C81JiIaN.js";
15
+ import { F, I, G, T, B, H, C } from "./chunks/editor-C81JiIaN.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-Icc3CdW0.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-BmUYOo96.js";
18
18
  import AIWriter from "./ai-writer.es.js";
19
- import { D } from "./chunks/docx-zipper-DPV5rnMJ.js";
19
+ import { D } from "./chunks/docx-zipper-DP41TnQj.js";
20
20
  import { createZip } from "./file-zipper.es.js";
21
21
  var eventemitter3 = { exports: {} };
22
22
  var hasRequiredEventemitter3;
@@ -4071,9 +4071,9 @@ function getItems(context, customItems = [], includeDefaultItems = true) {
4071
4071
  action: (editor2) => {
4072
4072
  editor2.commands.createDocumentSection();
4073
4073
  },
4074
- showWhen: (context2) => {
4075
- const { trigger } = context2;
4076
- return trigger === TRIGGERS.click;
4074
+ // TODO: Temporarily disabled - restore original: `return trigger === TRIGGERS.click;`
4075
+ showWhen: () => {
4076
+ return false;
4077
4077
  }
4078
4078
  },
4079
4079
  {
@@ -4411,19 +4411,31 @@ const _sfc_main$8 = {
4411
4411
  return;
4412
4412
  }
4413
4413
  event.preventDefault();
4414
- moveCursorToMouseEvent(event, props.editor);
4414
+ const editorState = props.editor?.state;
4415
+ const hasRangeSelection = editorState?.selection?.from !== editorState?.selection?.to;
4416
+ let isClickInsideSelection = false;
4417
+ if (hasRangeSelection && Number.isFinite(event.clientX) && Number.isFinite(event.clientY)) {
4418
+ const hit = props.editor?.posAtCoords?.({ left: event.clientX, top: event.clientY });
4419
+ if (typeof hit?.pos === "number") {
4420
+ const { from, to } = editorState.selection;
4421
+ isClickInsideSelection = hit.pos >= from && hit.pos <= to;
4422
+ }
4423
+ }
4424
+ if (!isClickInsideSelection) {
4425
+ moveCursorToMouseEvent(event, props.editor);
4426
+ }
4415
4427
  try {
4416
4428
  const context = await getEditorContext(props.editor, event);
4417
4429
  currentContext.value = context;
4418
4430
  sections.value = getItems({ ...context, trigger: "click" });
4419
4431
  selectedId.value = flattenedItems.value[0]?.id || null;
4420
4432
  searchQuery.value = "";
4421
- const state = props.editor.state;
4422
- if (!state) return;
4433
+ const currentState = props.editor.state;
4434
+ if (!currentState) return;
4423
4435
  props.editor.dispatch(
4424
- state.tr.setMeta(SlashMenuPluginKey, {
4436
+ currentState.tr.setMeta(SlashMenuPluginKey, {
4425
4437
  type: "open",
4426
- pos: context?.pos ?? state.selection.from,
4438
+ pos: context?.pos ?? currentState.selection.from,
4427
4439
  clientX: event.clientX,
4428
4440
  clientY: event.clientY
4429
4441
  })
@@ -4436,12 +4448,21 @@ const _sfc_main$8 = {
4436
4448
  if (props.editor) {
4437
4449
  item.action ? await item.action(props.editor, currentContext.value) : null;
4438
4450
  if (item.component) {
4439
- menuRef.value;
4451
+ const menuElement = menuRef.value;
4440
4452
  const componentProps = getPropsByItemId(item.id, props);
4441
- props.openPopover(markRaw(item.component), componentProps, {
4442
- left: menuPosition.value.left,
4443
- top: menuPosition.value.top
4444
- });
4453
+ let popoverPosition = { left: menuPosition.value.left, top: menuPosition.value.top };
4454
+ if (menuElement) {
4455
+ const menuRect = menuElement.getBoundingClientRect();
4456
+ const container = menuElement.closest(".super-editor");
4457
+ if (container) {
4458
+ const containerRect = container.getBoundingClientRect();
4459
+ popoverPosition = {
4460
+ left: `${menuRect.left - containerRect.left}px`,
4461
+ top: `${menuRect.top - containerRect.top}px`
4462
+ };
4463
+ }
4464
+ }
4465
+ props.openPopover(markRaw(item.component), componentProps, popoverPosition);
4445
4466
  closeMenu({ restoreCursor: false });
4446
4467
  } else {
4447
4468
  const shouldRestoreCursor = item.id !== "paste";
@@ -1,6 +1,6 @@
1
1
  import "vue";
2
- import { T } from "./chunks/toolbar-Icc3CdW0.js";
3
- import "./chunks/editor-uiCiCr8n.js";
2
+ import { T } from "./chunks/toolbar-BmUYOo96.js";
3
+ import "./chunks/editor-C81JiIaN.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-TXxmZOAu.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-DzMe-1gi.cjs");
4
4
  require("./chunks/vue-jWLMl8Ts.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-C7JZxENm.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-BDJ97wfW.es.js";
2
2
  import "./chunks/vue-BuPTonTJ.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-TXxmZOAu.cjs");
4
- const superdoc = require("./chunks/index-BcHbK1Ip.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-DzMe-1gi.cjs");
4
+ const superdoc = require("./chunks/index-D-MAmimV.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-C7JZxENm.es.js";
2
- import { D, H, P, S as S2, m, l } from "./chunks/index-CocFivpQ.es.js";
1
+ import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-BDJ97wfW.es.js";
2
+ import { D, H, P, S as S2, m, l } from "./chunks/index-WYp7dt-q.es.js";
3
3
  import { B } from "./chunks/blank-docx-ABm6XYAA.es.js";
4
4
  export {
5
5
  a as AnnotatorHelpers,