superdoc 1.0.0-beta.16 → 1.0.0-beta.17
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.
- package/dist/chunks/{PdfViewer-93eWvs8z.cjs → PdfViewer-BIlJaTm7.cjs} +1 -1
- package/dist/chunks/{PdfViewer-ODeuH1gb.es.js → PdfViewer-cvzMUtBh.es.js} +1 -1
- package/dist/chunks/{index-DW5_UKLM.es.js → index-CrIfBvBN.es.js} +3 -3
- package/dist/chunks/{index-RquHXtgI.cjs → index-DDx90Dl3.cjs} +3 -3
- package/dist/chunks/{index-DexFffM7-XZD_g6eY.cjs → index-VCeRjVPO-DjkejB6t.cjs} +1 -1
- package/dist/chunks/{index-DexFffM7-Cbdy0Zy6.es.js → index-VCeRjVPO-FBgR9qxX.es.js} +1 -1
- package/dist/chunks/{super-editor.es-Dg5uoFkw.es.js → super-editor.es-00SpI-wK.es.js} +690 -146
- package/dist/chunks/{super-editor.es-BLKWkx5G.cjs → super-editor.es-Mlj7AGyt.cjs} +690 -146
- package/dist/style.css +6 -6
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-C_R_BK8X.js → converter-B9zUZjYT.js} +71 -34
- package/dist/super-editor/chunks/{docx-zipper-BvQAYmi1.js → docx-zipper-r5KdE_SA.js} +1 -1
- package/dist/super-editor/chunks/{editor-DFFvalb1.js → editor-D2k2BwSG.js} +524 -105
- package/dist/super-editor/chunks/{index-DexFffM7.js → index-VCeRjVPO.js} +1 -1
- package/dist/super-editor/chunks/{toolbar-DLPfegtw.js → toolbar-8o_LgoiW.js} +2 -2
- package/dist/super-editor/converter.es.js +1 -1
- package/dist/super-editor/docx-zipper.es.js +2 -2
- package/dist/super-editor/editor.es.js +3 -3
- package/dist/super-editor/file-zipper.es.js +1 -1
- package/dist/super-editor/style.css +6 -6
- package/dist/super-editor/super-editor.es.js +131 -42
- package/dist/super-editor/toolbar.es.js +2 -2
- package/dist/super-editor.cjs +1 -1
- package/dist/super-editor.es.js +1 -1
- package/dist/superdoc.cjs +2 -2
- package/dist/superdoc.es.js +2 -2
- package/dist/superdoc.umd.js +692 -148
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { computed, createElementBlock, openBlock, createElementVNode, createCommentVNode, normalizeClass, normalizeStyle, ref, withKeys, unref, withModifiers, createBlock, toDisplayString, withDirectives, vModelText, nextTick, getCurrentInstance, onMounted, onBeforeUnmount, createVNode, readonly, watch, 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 { p as process$1 } from "./converter-
|
|
3
|
-
import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-
|
|
2
|
+
import { p as process$1 } from "./converter-B9zUZjYT.js";
|
|
3
|
+
import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-D2k2BwSG.js";
|
|
4
4
|
const sanitizeNumber = (value, defaultNumber) => {
|
|
5
5
|
let sanitized = value.replace(/[^0-9.]/g, "");
|
|
6
6
|
sanitized = parseFloat(sanitized);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { E } from "./chunks/editor-
|
|
2
|
-
import "./chunks/converter-
|
|
3
|
-
import "./chunks/docx-zipper-
|
|
1
|
+
import { E } from "./chunks/editor-D2k2BwSG.js";
|
|
2
|
+
import "./chunks/converter-B9zUZjYT.js";
|
|
3
|
+
import "./chunks/docx-zipper-r5KdE_SA.js";
|
|
4
4
|
export {
|
|
5
5
|
E as Editor
|
|
6
6
|
};
|
|
@@ -1889,18 +1889,18 @@ https://github.com/ProseMirror/prosemirror-tables/blob/master/demo/index.html
|
|
|
1889
1889
|
min-height: 40px;
|
|
1890
1890
|
}
|
|
1891
1891
|
|
|
1892
|
-
.superdoc-table-resize-overlay[data-v-
|
|
1892
|
+
.superdoc-table-resize-overlay[data-v-2fdf7836] {
|
|
1893
1893
|
position: absolute;
|
|
1894
1894
|
pointer-events: none;
|
|
1895
1895
|
user-select: none;
|
|
1896
1896
|
}
|
|
1897
|
-
.resize-handle[data-v-
|
|
1897
|
+
.resize-handle[data-v-2fdf7836] {
|
|
1898
1898
|
position: absolute;
|
|
1899
1899
|
cursor: col-resize;
|
|
1900
1900
|
user-select: none;
|
|
1901
1901
|
z-index: 15;
|
|
1902
1902
|
}
|
|
1903
|
-
.resize-handle[data-v-
|
|
1903
|
+
.resize-handle[data-v-2fdf7836]::before {
|
|
1904
1904
|
content: '';
|
|
1905
1905
|
position: absolute;
|
|
1906
1906
|
left: 50%;
|
|
@@ -1913,17 +1913,17 @@ https://github.com/ProseMirror/prosemirror-tables/blob/master/demo/index.html
|
|
|
1913
1913
|
background-color 0.2s ease,
|
|
1914
1914
|
width 0.2s ease;
|
|
1915
1915
|
}
|
|
1916
|
-
.resize-handle[data-v-
|
|
1916
|
+
.resize-handle[data-v-2fdf7836]:hover::before {
|
|
1917
1917
|
background-color: #4a90e2;
|
|
1918
1918
|
width: 3px;
|
|
1919
1919
|
transform: translateX(-1.5px);
|
|
1920
1920
|
}
|
|
1921
|
-
.resize-handle--active[data-v-
|
|
1921
|
+
.resize-handle--active[data-v-2fdf7836]::before {
|
|
1922
1922
|
background-color: #4a90e2;
|
|
1923
1923
|
width: 2px;
|
|
1924
1924
|
transform: translateX(-1px);
|
|
1925
1925
|
}
|
|
1926
|
-
.resize-guideline[data-v-
|
|
1926
|
+
.resize-guideline[data-v-2fdf7836] {
|
|
1927
1927
|
position: absolute;
|
|
1928
1928
|
background-color: #4a90e2;
|
|
1929
1929
|
pointer-events: none;
|
|
@@ -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 {
|
|
13
|
-
import { ac, i, a9,
|
|
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 measureCache, n as isHeadless, E as Editor, o as getStarterExtensions, P as PresentationEditor, p as Placeholder, q as getRichTextExtensions, D as DecorationSet, t as Decoration, M as Mark, v as Extension, A as Attribute, N as Node } from "./chunks/editor-
|
|
15
|
-
import { z, F, B, T, w, C, x } from "./chunks/editor-
|
|
12
|
+
import { aK as getDefaultExportFromCjs, a0 as v4, T as TextSelection$1, v as getMarkRange, aN as vClickOutside, aO as getActiveFormatting, aD as isInTable, U as findParentNode, ar as calculateResolvedParagraphProperties, a7 as twipsToLines, V as isList, al as parseSizeUnit, a8 as pixelsToTwips, aP as getFileObject, P as PluginKey, a as Plugin } from "./chunks/converter-B9zUZjYT.js";
|
|
13
|
+
import { ac, i, a9, aQ } from "./chunks/converter-B9zUZjYT.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 measureCache, n as isHeadless, E as Editor, o as getStarterExtensions, P as PresentationEditor, p as Placeholder, q as getRichTextExtensions, D as DecorationSet, t as Decoration, M as Mark, v as Extension, A as Attribute, N as Node } from "./chunks/editor-D2k2BwSG.js";
|
|
15
|
+
import { z, F, B, T, w, C, x } from "./chunks/editor-D2k2BwSG.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, 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-
|
|
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-8o_LgoiW.js";
|
|
18
18
|
import AIWriter from "./ai-writer.es.js";
|
|
19
|
-
import { D } from "./chunks/docx-zipper-
|
|
19
|
+
import { D } from "./chunks/docx-zipper-r5KdE_SA.js";
|
|
20
20
|
import { createZip } from "./file-zipper.es.js";
|
|
21
21
|
var eventemitter3 = { exports: {} };
|
|
22
22
|
var hasRequiredEventemitter3;
|
|
@@ -4877,6 +4877,12 @@ const _sfc_main$4 = {
|
|
|
4877
4877
|
};
|
|
4878
4878
|
const GenericPopover = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-cbddcc0f"]]);
|
|
4879
4879
|
const _hoisted_1$3 = ["data-boundary-index", "data-boundary-type", "onMousedown"];
|
|
4880
|
+
const RESIZE_HANDLE_WIDTH_PX = 9;
|
|
4881
|
+
const RESIZE_HANDLE_OFFSET_PX = 4;
|
|
4882
|
+
const DRAG_OVERLAY_EXTENSION_PX = 1e3;
|
|
4883
|
+
const MIN_DRAG_OVERLAY_WIDTH_PX = 2e3;
|
|
4884
|
+
const THROTTLE_INTERVAL_MS = 16;
|
|
4885
|
+
const MIN_RESIZE_DELTA_PX = 1;
|
|
4880
4886
|
const _sfc_main$3 = {
|
|
4881
4887
|
__name: "TableResizeOverlay",
|
|
4882
4888
|
props: {
|
|
@@ -4900,26 +4906,73 @@ const _sfc_main$3 = {
|
|
|
4900
4906
|
setup(__props, { emit: __emit }) {
|
|
4901
4907
|
const props = __props;
|
|
4902
4908
|
const emit = __emit;
|
|
4909
|
+
const overlayRect = ref(null);
|
|
4903
4910
|
const tableMetadata = ref(null);
|
|
4904
4911
|
const dragState = ref(null);
|
|
4905
4912
|
const forcedCleanup = ref(false);
|
|
4913
|
+
let rafId = null;
|
|
4914
|
+
let isUnmounted = false;
|
|
4915
|
+
function startOverlayTracking() {
|
|
4916
|
+
if (rafId !== null) return;
|
|
4917
|
+
const step = () => {
|
|
4918
|
+
updateOverlayRect();
|
|
4919
|
+
rafId = requestAnimationFrame(step);
|
|
4920
|
+
};
|
|
4921
|
+
rafId = requestAnimationFrame(step);
|
|
4922
|
+
}
|
|
4923
|
+
function stopOverlayTracking() {
|
|
4924
|
+
if (rafId !== null) {
|
|
4925
|
+
cancelAnimationFrame(rafId);
|
|
4926
|
+
rafId = null;
|
|
4927
|
+
}
|
|
4928
|
+
}
|
|
4906
4929
|
const overlayStyle = computed(() => {
|
|
4907
|
-
if (!props.tableElement) return {};
|
|
4908
|
-
const rect =
|
|
4930
|
+
if (!overlayRect.value || !props.tableElement) return {};
|
|
4931
|
+
const rect = overlayRect.value;
|
|
4909
4932
|
let overlayWidth = rect.width;
|
|
4910
4933
|
if (dragState.value) {
|
|
4911
|
-
overlayWidth = Math.max(rect.width +
|
|
4934
|
+
overlayWidth = Math.max(rect.width + DRAG_OVERLAY_EXTENSION_PX, MIN_DRAG_OVERLAY_WIDTH_PX);
|
|
4912
4935
|
}
|
|
4913
4936
|
return {
|
|
4914
4937
|
position: "absolute",
|
|
4915
|
-
left: `${
|
|
4916
|
-
top: `${
|
|
4938
|
+
left: `${rect.left}px`,
|
|
4939
|
+
top: `${rect.top}px`,
|
|
4917
4940
|
width: `${overlayWidth}px`,
|
|
4918
4941
|
height: `${rect.height}px`,
|
|
4919
4942
|
pointerEvents: dragState.value ? "auto" : "none",
|
|
4920
4943
|
zIndex: 10
|
|
4921
4944
|
};
|
|
4922
4945
|
});
|
|
4946
|
+
function updateOverlayRect() {
|
|
4947
|
+
if (!props.tableElement) {
|
|
4948
|
+
overlayRect.value = null;
|
|
4949
|
+
return;
|
|
4950
|
+
}
|
|
4951
|
+
const parent = props.tableElement.offsetParent;
|
|
4952
|
+
const tableRect = props.tableElement.getBoundingClientRect();
|
|
4953
|
+
if (tableRect.width === 0 || tableRect.height === 0) {
|
|
4954
|
+
overlayRect.value = null;
|
|
4955
|
+
return;
|
|
4956
|
+
}
|
|
4957
|
+
if (parent) {
|
|
4958
|
+
const parentRect = parent.getBoundingClientRect();
|
|
4959
|
+
const left = tableRect.left - parentRect.left + (parent.scrollLeft || 0);
|
|
4960
|
+
const top = tableRect.top - parentRect.top + (parent.scrollTop || 0);
|
|
4961
|
+
overlayRect.value = {
|
|
4962
|
+
left,
|
|
4963
|
+
top,
|
|
4964
|
+
width: tableRect.width,
|
|
4965
|
+
height: tableRect.height
|
|
4966
|
+
};
|
|
4967
|
+
} else {
|
|
4968
|
+
overlayRect.value = {
|
|
4969
|
+
left: props.tableElement.offsetLeft,
|
|
4970
|
+
top: props.tableElement.offsetTop,
|
|
4971
|
+
width: tableRect.width,
|
|
4972
|
+
height: tableRect.height
|
|
4973
|
+
};
|
|
4974
|
+
}
|
|
4975
|
+
}
|
|
4923
4976
|
const resizableBoundaries = computed(() => {
|
|
4924
4977
|
if (!tableMetadata.value?.columns) {
|
|
4925
4978
|
return [];
|
|
@@ -4958,9 +5011,9 @@ const _sfc_main$3 = {
|
|
|
4958
5011
|
if (!colSegments || colSegments.length === 0) {
|
|
4959
5012
|
return [];
|
|
4960
5013
|
}
|
|
4961
|
-
return colSegments.map((seg) => ({
|
|
4962
|
-
y: seg.y,
|
|
4963
|
-
h: seg.h
|
|
5014
|
+
return colSegments.filter((seg) => seg && typeof seg === "object").map((seg) => ({
|
|
5015
|
+
y: typeof seg.y === "number" ? seg.y : 0,
|
|
5016
|
+
h: seg.h !== null && typeof seg.h === "number" ? seg.h : null
|
|
4964
5017
|
}));
|
|
4965
5018
|
}
|
|
4966
5019
|
function getSegmentHandleStyle(boundary, segment) {
|
|
@@ -4968,16 +5021,16 @@ const _sfc_main$3 = {
|
|
|
4968
5021
|
position: "absolute",
|
|
4969
5022
|
left: `${boundary.x}px`,
|
|
4970
5023
|
top: segment.y != null ? `${segment.y}px` : "0",
|
|
4971
|
-
width:
|
|
5024
|
+
width: `${RESIZE_HANDLE_WIDTH_PX}px`,
|
|
4972
5025
|
height: segment.h != null ? `${segment.h}px` : "100%",
|
|
4973
|
-
transform:
|
|
5026
|
+
transform: `translateX(-${RESIZE_HANDLE_OFFSET_PX}px)`,
|
|
4974
5027
|
cursor: "col-resize",
|
|
4975
5028
|
pointerEvents: "auto"
|
|
4976
5029
|
};
|
|
4977
5030
|
}
|
|
4978
5031
|
const guidelineStyle = computed(() => {
|
|
4979
5032
|
if (!dragState.value || !tableMetadata.value) return { display: "none" };
|
|
4980
|
-
const initialBoundary = resizableBoundaries.value[dragState.value.
|
|
5033
|
+
const initialBoundary = resizableBoundaries.value[dragState.value.resizableBoundaryIndex];
|
|
4981
5034
|
if (!initialBoundary) return { display: "none" };
|
|
4982
5035
|
const newX = initialBoundary.x + dragState.value.constrainedDelta;
|
|
4983
5036
|
return {
|
|
@@ -5034,11 +5087,11 @@ const _sfc_main$3 = {
|
|
|
5034
5087
|
});
|
|
5035
5088
|
}
|
|
5036
5089
|
}
|
|
5037
|
-
function onHandleMouseDown(event,
|
|
5090
|
+
function onHandleMouseDown(event, resizableBoundaryIndex) {
|
|
5038
5091
|
event.preventDefault();
|
|
5039
5092
|
event.stopPropagation();
|
|
5040
5093
|
if (!tableMetadata.value?.columns) return;
|
|
5041
|
-
const boundary = resizableBoundaries.value[
|
|
5094
|
+
const boundary = resizableBoundaries.value[resizableBoundaryIndex];
|
|
5042
5095
|
if (!boundary) return;
|
|
5043
5096
|
const columns = tableMetadata.value.columns;
|
|
5044
5097
|
const isRightEdge = boundary.type === "right-edge";
|
|
@@ -5046,7 +5099,7 @@ const _sfc_main$3 = {
|
|
|
5046
5099
|
const rightColumn = isRightEdge ? null : columns[boundary.index + 1];
|
|
5047
5100
|
dragState.value = {
|
|
5048
5101
|
columnIndex: boundary.index,
|
|
5049
|
-
|
|
5102
|
+
resizableBoundaryIndex,
|
|
5050
5103
|
isRightEdge,
|
|
5051
5104
|
initialX: event.clientX,
|
|
5052
5105
|
initialWidths: columns.map((col) => col.w),
|
|
@@ -5060,15 +5113,28 @@ const _sfc_main$3 = {
|
|
|
5060
5113
|
} : null,
|
|
5061
5114
|
constrainedDelta: 0
|
|
5062
5115
|
};
|
|
5116
|
+
if (!props.editor?.view?.dom) {
|
|
5117
|
+
emit("resize-error", { error: "Editor view not available" });
|
|
5118
|
+
dragState.value = null;
|
|
5119
|
+
return;
|
|
5120
|
+
}
|
|
5063
5121
|
const pmView = props.editor.view.dom;
|
|
5064
5122
|
pmView.style.pointerEvents = "none";
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
|
|
5123
|
+
try {
|
|
5124
|
+
document.addEventListener("mousemove", onDocumentMouseMove);
|
|
5125
|
+
document.addEventListener("mouseup", onDocumentMouseUp);
|
|
5126
|
+
emit("resize-start", {
|
|
5127
|
+
columnIndex: boundary.index,
|
|
5128
|
+
isRightEdge,
|
|
5129
|
+
initialWidths: dragState.value.initialWidths
|
|
5130
|
+
});
|
|
5131
|
+
} catch (error) {
|
|
5132
|
+
document.removeEventListener("mousemove", onDocumentMouseMove);
|
|
5133
|
+
document.removeEventListener("mouseup", onDocumentMouseUp);
|
|
5134
|
+
pmView.style.pointerEvents = "auto";
|
|
5135
|
+
dragState.value = null;
|
|
5136
|
+
emit("resize-error", { error: error instanceof Error ? error.message : String(error) });
|
|
5137
|
+
}
|
|
5072
5138
|
}
|
|
5073
5139
|
function throttle(func, limit) {
|
|
5074
5140
|
let inThrottle;
|
|
@@ -5093,7 +5159,7 @@ const _sfc_main$3 = {
|
|
|
5093
5159
|
return { throttled, cancel };
|
|
5094
5160
|
}
|
|
5095
5161
|
const mouseMoveThrottle = throttle((event) => {
|
|
5096
|
-
if (!dragState.value) return;
|
|
5162
|
+
if (isUnmounted || !dragState.value) return;
|
|
5097
5163
|
const delta = event.clientX - dragState.value.initialX;
|
|
5098
5164
|
const minDelta = -(dragState.value.leftColumn.width - dragState.value.leftColumn.minWidth);
|
|
5099
5165
|
let maxDelta;
|
|
@@ -5119,7 +5185,7 @@ const _sfc_main$3 = {
|
|
|
5119
5185
|
columnIndex: dragState.value.columnIndex,
|
|
5120
5186
|
delta: constrainedDelta
|
|
5121
5187
|
});
|
|
5122
|
-
},
|
|
5188
|
+
}, THROTTLE_INTERVAL_MS);
|
|
5123
5189
|
const onDocumentMouseMove = mouseMoveThrottle.throttled;
|
|
5124
5190
|
function onDocumentMouseUp(event) {
|
|
5125
5191
|
if (!dragState.value) return;
|
|
@@ -5134,13 +5200,11 @@ const _sfc_main$3 = {
|
|
|
5134
5200
|
}
|
|
5135
5201
|
document.removeEventListener("mousemove", onDocumentMouseMove);
|
|
5136
5202
|
document.removeEventListener("mouseup", onDocumentMouseUp);
|
|
5137
|
-
if (props.editor?.view) {
|
|
5203
|
+
if (props.editor?.view?.dom) {
|
|
5138
5204
|
const pmView = props.editor.view.dom;
|
|
5139
|
-
|
|
5140
|
-
pmView.style.pointerEvents = "auto";
|
|
5141
|
-
}
|
|
5205
|
+
pmView.style.pointerEvents = "auto";
|
|
5142
5206
|
}
|
|
5143
|
-
if (!forcedCleanup.value && Math.abs(finalDelta) >
|
|
5207
|
+
if (!forcedCleanup.value && Math.abs(finalDelta) > MIN_RESIZE_DELTA_PX) {
|
|
5144
5208
|
dispatchResizeTransaction(columnIndex, newWidths);
|
|
5145
5209
|
emit("resize-end", {
|
|
5146
5210
|
columnIndex,
|
|
@@ -5203,7 +5267,14 @@ const _sfc_main$3 = {
|
|
|
5203
5267
|
if (!pmElement) {
|
|
5204
5268
|
return null;
|
|
5205
5269
|
}
|
|
5206
|
-
const
|
|
5270
|
+
const pmStartAttr = pmElement.getAttribute("data-pm-start");
|
|
5271
|
+
if (!pmStartAttr) {
|
|
5272
|
+
return null;
|
|
5273
|
+
}
|
|
5274
|
+
const pmStart = parseInt(pmStartAttr, 10);
|
|
5275
|
+
if (!Number.isFinite(pmStart)) {
|
|
5276
|
+
return null;
|
|
5277
|
+
}
|
|
5207
5278
|
let tablePos = null;
|
|
5208
5279
|
state.doc.descendants((node, pos) => {
|
|
5209
5280
|
if (node.type.name === "table") {
|
|
@@ -5255,6 +5326,12 @@ const _sfc_main$3 = {
|
|
|
5255
5326
|
() => props.tableElement,
|
|
5256
5327
|
() => {
|
|
5257
5328
|
parseTableMetadata();
|
|
5329
|
+
updateOverlayRect();
|
|
5330
|
+
if (props.visible && props.tableElement) {
|
|
5331
|
+
startOverlayTracking();
|
|
5332
|
+
} else if (!props.tableElement) {
|
|
5333
|
+
stopOverlayTracking();
|
|
5334
|
+
}
|
|
5258
5335
|
},
|
|
5259
5336
|
{ immediate: true }
|
|
5260
5337
|
);
|
|
@@ -5263,7 +5340,10 @@ const _sfc_main$3 = {
|
|
|
5263
5340
|
(visible) => {
|
|
5264
5341
|
if (visible) {
|
|
5265
5342
|
parseTableMetadata();
|
|
5343
|
+
updateOverlayRect();
|
|
5344
|
+
startOverlayTracking();
|
|
5266
5345
|
} else {
|
|
5346
|
+
stopOverlayTracking();
|
|
5267
5347
|
if (dragState.value) {
|
|
5268
5348
|
forcedCleanup.value = true;
|
|
5269
5349
|
onDocumentMouseUp(new MouseEvent("mouseup"));
|
|
@@ -5272,8 +5352,15 @@ const _sfc_main$3 = {
|
|
|
5272
5352
|
}
|
|
5273
5353
|
}
|
|
5274
5354
|
);
|
|
5355
|
+
onMounted(() => {
|
|
5356
|
+
window.addEventListener("scroll", updateOverlayRect, true);
|
|
5357
|
+
window.addEventListener("resize", updateOverlayRect);
|
|
5358
|
+
updateOverlayRect();
|
|
5359
|
+
});
|
|
5275
5360
|
onBeforeUnmount(() => {
|
|
5361
|
+
isUnmounted = true;
|
|
5276
5362
|
mouseMoveThrottle.cancel();
|
|
5363
|
+
stopOverlayTracking();
|
|
5277
5364
|
if (dragState.value) {
|
|
5278
5365
|
document.removeEventListener("mousemove", onDocumentMouseMove);
|
|
5279
5366
|
document.removeEventListener("mouseup", onDocumentMouseUp);
|
|
@@ -5281,6 +5368,8 @@ const _sfc_main$3 = {
|
|
|
5281
5368
|
props.editor.view.dom.style.pointerEvents = "auto";
|
|
5282
5369
|
}
|
|
5283
5370
|
}
|
|
5371
|
+
window.removeEventListener("scroll", updateOverlayRect, true);
|
|
5372
|
+
window.removeEventListener("resize", updateOverlayRect);
|
|
5284
5373
|
});
|
|
5285
5374
|
return (_ctx, _cache) => {
|
|
5286
5375
|
return __props.visible && tableMetadata.value ? (openBlock(), createElementBlock("div", {
|
|
@@ -5290,21 +5379,21 @@ const _sfc_main$3 = {
|
|
|
5290
5379
|
onMousedown: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
5291
5380
|
}, ["stop"]))
|
|
5292
5381
|
}, [
|
|
5293
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(resizableBoundaries.value, (boundary,
|
|
5382
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(resizableBoundaries.value, (boundary, resizableBoundaryIndex) => {
|
|
5294
5383
|
return openBlock(), createElementBlock(Fragment, {
|
|
5295
|
-
key: `boundary-${
|
|
5384
|
+
key: `boundary-${resizableBoundaryIndex}`
|
|
5296
5385
|
}, [
|
|
5297
5386
|
(openBlock(true), createElementBlock(Fragment, null, renderList(getBoundarySegments(boundary), (segment, segmentIndex) => {
|
|
5298
5387
|
return openBlock(), createElementBlock("div", {
|
|
5299
5388
|
key: `handle-${boundary.type}-${boundary.index}-${segmentIndex}`,
|
|
5300
5389
|
class: normalizeClass(["resize-handle", {
|
|
5301
|
-
"resize-handle--active": dragState.value && dragState.value.
|
|
5390
|
+
"resize-handle--active": dragState.value && dragState.value.resizableBoundaryIndex === resizableBoundaryIndex,
|
|
5302
5391
|
"resize-handle--edge": boundary.type === "right-edge"
|
|
5303
5392
|
}]),
|
|
5304
|
-
"data-boundary-index":
|
|
5393
|
+
"data-boundary-index": resizableBoundaryIndex,
|
|
5305
5394
|
"data-boundary-type": boundary.type,
|
|
5306
5395
|
style: normalizeStyle(getSegmentHandleStyle(boundary, segment)),
|
|
5307
|
-
onMousedown: ($event) => onHandleMouseDown($event,
|
|
5396
|
+
onMousedown: ($event) => onHandleMouseDown($event, resizableBoundaryIndex)
|
|
5308
5397
|
}, null, 46, _hoisted_1$3);
|
|
5309
5398
|
}), 128))
|
|
5310
5399
|
], 64);
|
|
@@ -5318,7 +5407,7 @@ const _sfc_main$3 = {
|
|
|
5318
5407
|
};
|
|
5319
5408
|
}
|
|
5320
5409
|
};
|
|
5321
|
-
const TableResizeOverlay = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-
|
|
5410
|
+
const TableResizeOverlay = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-2fdf7836"]]);
|
|
5322
5411
|
const _hoisted_1$2 = ["data-handle-position", "onMousedown"];
|
|
5323
5412
|
const OVERLAY_EXPANSION_PX = 2e3;
|
|
5324
5413
|
const RESIZE_HANDLE_SIZE_PX = 12;
|
|
@@ -6302,6 +6391,6 @@ export {
|
|
|
6302
6391
|
getRichTextExtensions,
|
|
6303
6392
|
getStarterExtensions,
|
|
6304
6393
|
a9 as helpers,
|
|
6305
|
-
|
|
6394
|
+
aQ as registeredHandlers,
|
|
6306
6395
|
x as trackChangesHelpers
|
|
6307
6396
|
};
|
package/dist/super-editor.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-
|
|
3
|
+
const superEditor_es = require("./chunks/super-editor.es-Mlj7AGyt.cjs");
|
|
4
4
|
require("./chunks/vue-jWLMl8Ts.cjs");
|
|
5
5
|
exports.AIWriter = superEditor_es.AIWriter;
|
|
6
6
|
exports.AnnotatorHelpers = superEditor_es.AnnotatorHelpers;
|
package/dist/super-editor.es.js
CHANGED
|
@@ -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-
|
|
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-00SpI-wK.es.js";
|
|
2
2
|
import "./chunks/vue-Dysv_7z5.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-
|
|
4
|
-
const superdoc = require("./chunks/index-
|
|
3
|
+
const superEditor_es = require("./chunks/super-editor.es-Mlj7AGyt.cjs");
|
|
4
|
+
const superdoc = require("./chunks/index-DDx90Dl3.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;
|
package/dist/superdoc.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-
|
|
2
|
-
import { D, H, P, S as S2, m, l } from "./chunks/index-
|
|
1
|
+
import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-00SpI-wK.es.js";
|
|
2
|
+
import { D, H, P, S as S2, m, l } from "./chunks/index-CrIfBvBN.es.js";
|
|
3
3
|
import { B } from "./chunks/blank-docx-ABm6XYAA.es.js";
|
|
4
4
|
export {
|
|
5
5
|
a as AnnotatorHelpers,
|