@harbour-enterprises/superdoc 0.23.0-next.18 → 0.23.0-next.19

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,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-ZWZLQtoU.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-CASMW4Gt.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-H3dscFSf.es.js";
3
3
  function self(vars) {
4
4
  const {
5
5
  opacityDisabled,
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const vue = require("./vue-DKMj1I9B.cjs");
4
- const superdoc = require("./index-Ua6WmvV9.cjs");
4
+ const superdoc = require("./index-DDWD3Ala.cjs");
5
5
  function self(vars) {
6
6
  const {
7
7
  opacityDisabled,
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const superEditor_es = require("./super-editor.es-BHP7saSr.cjs");
2
+ const superEditor_es = require("./super-editor.es-CHGawnS5.cjs");
3
3
  const vue = require("./vue-DKMj1I9B.cjs");
4
4
  const blankDocx = require("./blank-docx-CPqX9RF5.cjs");
5
5
  const eventemitter3 = require("./eventemitter3-DkXkH2rT.cjs");
@@ -17116,7 +17116,7 @@ const _sfc_main = {
17116
17116
  __name: "SuperDoc",
17117
17117
  emits: ["selection-update"],
17118
17118
  setup(__props, { emit: __emit }) {
17119
- const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-CDdQi-IL.cjs")));
17119
+ const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-BzfXAaWt.cjs")));
17120
17120
  const superdocStore = useSuperdocStore();
17121
17121
  const commentsStore = useCommentsStore();
17122
17122
  const {
@@ -1,4 +1,4 @@
1
- import { q as index, 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-JTB_jHfC.es.js";
1
+ import { q as index, 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-DKYU5AbZ.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-ZWZLQtoU.es.js";
3
3
  import { B as BlankDOCX } from "./blank-docx-iwdyG9RH.es.js";
4
4
  import { E as EventEmitter } from "./eventemitter3-BWEnUdTY.es.js";
@@ -17099,7 +17099,7 @@ const _sfc_main = {
17099
17099
  __name: "SuperDoc",
17100
17100
  emits: ["selection-update"],
17101
17101
  setup(__props, { emit: __emit }) {
17102
- const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-DxaT6YJk.es.js"));
17102
+ const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-B2uwyIlo.es.js"));
17103
17103
  const superdocStore = useSuperdocStore();
17104
17104
  const commentsStore = useCommentsStore();
17105
17105
  const {
@@ -66202,29 +66202,50 @@ const getChangesByIdToResolve = (state2, id) => {
66202
66202
  const changeIndex = trackedChanges.findIndex(({ mark }) => mark.attrs.id === id);
66203
66203
  if (changeIndex === -1) return;
66204
66204
  const matchingChange = trackedChanges[changeIndex];
66205
- const prev = trackedChanges[changeIndex - 1];
66206
- const next = trackedChanges[changeIndex + 1];
66207
- const matchingMarkType = matchingChange.mark.type.name;
66208
- let linkedChange;
66209
- if (prev && matchingChange.from === prev.to) {
66210
- const prevMarkType = prev.mark.type.name;
66211
- if (matchingMarkType === TrackDeleteMarkName && prevMarkType === TrackInsertMarkName || matchingMarkType === TrackInsertMarkName && prevMarkType === TrackDeleteMarkName) {
66212
- const hasContentBetween = state2.doc.textBetween(prev.from, matchingChange.to, "\n").length > prev.to - prev.from + (matchingChange.to - matchingChange.from);
66213
- if (!hasContentBetween) {
66214
- linkedChange = prev;
66215
- }
66205
+ const matchingId = matchingChange.mark.attrs.id;
66206
+ const getSegmentSize = ({ from: from2, to }) => to - from2;
66207
+ const areDirectlyConnected = (left2, right2) => {
66208
+ if (!left2 || !right2) {
66209
+ return false;
66216
66210
  }
66217
- }
66218
- if (!linkedChange && next && matchingChange.to === next.from) {
66219
- const nextMarkType = next.mark.type.name;
66220
- if (matchingMarkType === TrackDeleteMarkName && nextMarkType === TrackInsertMarkName || matchingMarkType === TrackInsertMarkName && nextMarkType === TrackDeleteMarkName) {
66221
- const hasContentBetween = state2.doc.textBetween(matchingChange.from, next.to, "\n").length > matchingChange.to - matchingChange.from + (next.to - next.from);
66222
- if (!hasContentBetween) {
66223
- linkedChange = next;
66211
+ if (left2.to !== right2.from) {
66212
+ return false;
66213
+ }
66214
+ const hasContentBetween = state2.doc.textBetween(left2.from, right2.to, "\n").length > getSegmentSize(left2) + getSegmentSize(right2);
66215
+ return !hasContentBetween;
66216
+ };
66217
+ const isComplementaryPair = (firstType, secondType) => firstType === TrackDeleteMarkName && secondType === TrackInsertMarkName || firstType === TrackInsertMarkName && secondType === TrackDeleteMarkName;
66218
+ const linkedBefore = [];
66219
+ const linkedAfter = [];
66220
+ const collectDirection = (direction, collection) => {
66221
+ let currentIndex = changeIndex;
66222
+ let currentChange = matchingChange;
66223
+ while (true) {
66224
+ const neighborIndex = currentIndex + direction;
66225
+ const neighbor = trackedChanges[neighborIndex];
66226
+ if (!neighbor) {
66227
+ break;
66228
+ }
66229
+ const [left2, right2] = direction < 0 ? [neighbor, currentChange] : [currentChange, neighbor];
66230
+ if (!areDirectlyConnected(left2, right2)) {
66231
+ break;
66232
+ }
66233
+ const sharesId = neighbor.mark.attrs.id === matchingId;
66234
+ const complementary = isComplementaryPair(currentChange.mark.type.name, neighbor.mark.type.name);
66235
+ if (!sharesId && !complementary) {
66236
+ break;
66237
+ }
66238
+ collection.push(neighbor);
66239
+ currentIndex = neighborIndex;
66240
+ currentChange = neighbor;
66241
+ if (!sharesId) {
66242
+ break;
66224
66243
  }
66225
66244
  }
66226
- }
66227
- return [matchingChange, linkedChange].filter(Boolean);
66245
+ };
66246
+ collectDirection(-1, linkedBefore);
66247
+ collectDirection(1, linkedAfter);
66248
+ return [matchingChange, ...linkedAfter, ...linkedBefore];
66228
66249
  };
66229
66250
  const TextTransform = Extension.create({
66230
66251
  name: "textTransform",
@@ -66185,29 +66185,50 @@ const getChangesByIdToResolve = (state2, id) => {
66185
66185
  const changeIndex = trackedChanges.findIndex(({ mark }) => mark.attrs.id === id);
66186
66186
  if (changeIndex === -1) return;
66187
66187
  const matchingChange = trackedChanges[changeIndex];
66188
- const prev = trackedChanges[changeIndex - 1];
66189
- const next = trackedChanges[changeIndex + 1];
66190
- const matchingMarkType = matchingChange.mark.type.name;
66191
- let linkedChange;
66192
- if (prev && matchingChange.from === prev.to) {
66193
- const prevMarkType = prev.mark.type.name;
66194
- if (matchingMarkType === TrackDeleteMarkName && prevMarkType === TrackInsertMarkName || matchingMarkType === TrackInsertMarkName && prevMarkType === TrackDeleteMarkName) {
66195
- const hasContentBetween = state2.doc.textBetween(prev.from, matchingChange.to, "\n").length > prev.to - prev.from + (matchingChange.to - matchingChange.from);
66196
- if (!hasContentBetween) {
66197
- linkedChange = prev;
66198
- }
66188
+ const matchingId = matchingChange.mark.attrs.id;
66189
+ const getSegmentSize = ({ from: from2, to }) => to - from2;
66190
+ const areDirectlyConnected = (left2, right2) => {
66191
+ if (!left2 || !right2) {
66192
+ return false;
66199
66193
  }
66200
- }
66201
- if (!linkedChange && next && matchingChange.to === next.from) {
66202
- const nextMarkType = next.mark.type.name;
66203
- if (matchingMarkType === TrackDeleteMarkName && nextMarkType === TrackInsertMarkName || matchingMarkType === TrackInsertMarkName && nextMarkType === TrackDeleteMarkName) {
66204
- const hasContentBetween = state2.doc.textBetween(matchingChange.from, next.to, "\n").length > matchingChange.to - matchingChange.from + (next.to - next.from);
66205
- if (!hasContentBetween) {
66206
- linkedChange = next;
66194
+ if (left2.to !== right2.from) {
66195
+ return false;
66196
+ }
66197
+ const hasContentBetween = state2.doc.textBetween(left2.from, right2.to, "\n").length > getSegmentSize(left2) + getSegmentSize(right2);
66198
+ return !hasContentBetween;
66199
+ };
66200
+ const isComplementaryPair = (firstType, secondType) => firstType === TrackDeleteMarkName && secondType === TrackInsertMarkName || firstType === TrackInsertMarkName && secondType === TrackDeleteMarkName;
66201
+ const linkedBefore = [];
66202
+ const linkedAfter = [];
66203
+ const collectDirection = (direction, collection) => {
66204
+ let currentIndex = changeIndex;
66205
+ let currentChange = matchingChange;
66206
+ while (true) {
66207
+ const neighborIndex = currentIndex + direction;
66208
+ const neighbor = trackedChanges[neighborIndex];
66209
+ if (!neighbor) {
66210
+ break;
66211
+ }
66212
+ const [left2, right2] = direction < 0 ? [neighbor, currentChange] : [currentChange, neighbor];
66213
+ if (!areDirectlyConnected(left2, right2)) {
66214
+ break;
66215
+ }
66216
+ const sharesId = neighbor.mark.attrs.id === matchingId;
66217
+ const complementary = isComplementaryPair(currentChange.mark.type.name, neighbor.mark.type.name);
66218
+ if (!sharesId && !complementary) {
66219
+ break;
66220
+ }
66221
+ collection.push(neighbor);
66222
+ currentIndex = neighborIndex;
66223
+ currentChange = neighbor;
66224
+ if (!sharesId) {
66225
+ break;
66207
66226
  }
66208
66227
  }
66209
- }
66210
- return [matchingChange, linkedChange].filter(Boolean);
66228
+ };
66229
+ collectDirection(-1, linkedBefore);
66230
+ collectDirection(1, linkedAfter);
66231
+ return [matchingChange, ...linkedAfter, ...linkedBefore];
66211
66232
  };
66212
66233
  const TextTransform = Extension.create({
66213
66234
  name: "textTransform",
@@ -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-wrgxIFCy.js";
3
- import { _ as _export_sfc } from "./chunks/editor-D8ueJVyp.js";
3
+ import { _ as _export_sfc } from "./chunks/editor-C_9lsXSt.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 = {}) {
@@ -28864,29 +28864,50 @@ const getChangesByIdToResolve = (state, id) => {
28864
28864
  const changeIndex = trackedChanges.findIndex(({ mark }) => mark.attrs.id === id);
28865
28865
  if (changeIndex === -1) return;
28866
28866
  const matchingChange = trackedChanges[changeIndex];
28867
- const prev = trackedChanges[changeIndex - 1];
28868
- const next = trackedChanges[changeIndex + 1];
28869
- const matchingMarkType = matchingChange.mark.type.name;
28870
- let linkedChange;
28871
- if (prev && matchingChange.from === prev.to) {
28872
- const prevMarkType = prev.mark.type.name;
28873
- if (matchingMarkType === TrackDeleteMarkName && prevMarkType === TrackInsertMarkName || matchingMarkType === TrackInsertMarkName && prevMarkType === TrackDeleteMarkName) {
28874
- const hasContentBetween = state.doc.textBetween(prev.from, matchingChange.to, "\n").length > prev.to - prev.from + (matchingChange.to - matchingChange.from);
28875
- if (!hasContentBetween) {
28876
- linkedChange = prev;
28877
- }
28867
+ const matchingId = matchingChange.mark.attrs.id;
28868
+ const getSegmentSize = ({ from: from2, to }) => to - from2;
28869
+ const areDirectlyConnected = (left2, right2) => {
28870
+ if (!left2 || !right2) {
28871
+ return false;
28878
28872
  }
28879
- }
28880
- if (!linkedChange && next && matchingChange.to === next.from) {
28881
- const nextMarkType = next.mark.type.name;
28882
- if (matchingMarkType === TrackDeleteMarkName && nextMarkType === TrackInsertMarkName || matchingMarkType === TrackInsertMarkName && nextMarkType === TrackDeleteMarkName) {
28883
- const hasContentBetween = state.doc.textBetween(matchingChange.from, next.to, "\n").length > matchingChange.to - matchingChange.from + (next.to - next.from);
28884
- if (!hasContentBetween) {
28885
- linkedChange = next;
28873
+ if (left2.to !== right2.from) {
28874
+ return false;
28875
+ }
28876
+ const hasContentBetween = state.doc.textBetween(left2.from, right2.to, "\n").length > getSegmentSize(left2) + getSegmentSize(right2);
28877
+ return !hasContentBetween;
28878
+ };
28879
+ const isComplementaryPair = (firstType, secondType) => firstType === TrackDeleteMarkName && secondType === TrackInsertMarkName || firstType === TrackInsertMarkName && secondType === TrackDeleteMarkName;
28880
+ const linkedBefore = [];
28881
+ const linkedAfter = [];
28882
+ const collectDirection = (direction, collection) => {
28883
+ let currentIndex = changeIndex;
28884
+ let currentChange = matchingChange;
28885
+ while (true) {
28886
+ const neighborIndex = currentIndex + direction;
28887
+ const neighbor = trackedChanges[neighborIndex];
28888
+ if (!neighbor) {
28889
+ break;
28890
+ }
28891
+ const [left2, right2] = direction < 0 ? [neighbor, currentChange] : [currentChange, neighbor];
28892
+ if (!areDirectlyConnected(left2, right2)) {
28893
+ break;
28894
+ }
28895
+ const sharesId = neighbor.mark.attrs.id === matchingId;
28896
+ const complementary = isComplementaryPair(currentChange.mark.type.name, neighbor.mark.type.name);
28897
+ if (!sharesId && !complementary) {
28898
+ break;
28899
+ }
28900
+ collection.push(neighbor);
28901
+ currentIndex = neighborIndex;
28902
+ currentChange = neighbor;
28903
+ if (!sharesId) {
28904
+ break;
28886
28905
  }
28887
28906
  }
28888
- }
28889
- return [matchingChange, linkedChange].filter(Boolean);
28907
+ };
28908
+ collectDirection(-1, linkedBefore);
28909
+ collectDirection(1, linkedAfter);
28910
+ return [matchingChange, ...linkedAfter, ...linkedBefore];
28890
28911
  };
28891
28912
  const TextTransform = Extension.create({
28892
28913
  name: "textTransform",
@@ -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-wrgxIFCy.js";
3
- import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-D8ueJVyp.js";
3
+ import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-C_9lsXSt.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-D8ueJVyp.js";
1
+ import { E } from "./chunks/editor-C_9lsXSt.js";
2
2
  import "./chunks/converter-wrgxIFCy.js";
3
3
  import "./chunks/docx-zipper-DIilDv93.js";
4
4
  export {
@@ -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 { ax as getDefaultExportFromCjs, V as v4, T as TextSelection$1, v as getMarkRange, aA as vClickOutside, H as findParentNode, aB as getActiveFormatting, at as isInTable, aC as readFromClipboard, aD as handleClipboardPaste, aE as getFileObject, aF as runPropertyTranslators, aG as commentRangeEndTranslator, aH as commentRangeStartTranslator, aI as translator, aJ as translator$1, aK as translator$2, aL as translator$3, aM as translator$4, aN as translator$5, aO as translator$6, aP as translator$7, aQ as translator$8, aR as translator$9, aS as translator$a, aT as translator$b, aU as translator$c, aV as translator$d, aW as translator$e, aX as translator$f, aY as translator$g, aZ as translator$h, a_ as translator$i, a$ as translator$j, b0 as translator$k, b1 as translator$l, b2 as translator$m, b3 as translator$n, b4 as translator$o, b5 as translator$p, b6 as translator$q, b7 as translator$r, b8 as translator$s, b9 as translator$t, ba as translator$u, bb as translator$v, bc as translator$w, bd as translator$x, be as translator$y, bf as translator$z, bg as translator$A, bh as translator$B, bi as translator$C, bj as translator$D, bk as translator$E, bl as translator$F, bm as translator$G, bn as translator$H, bo as translator$I, bp as translator$J, bq as translator$K, br as translator$L, bs as translator$M, bt as translator$N, bu as translator$O, bv as translator$P, bw as translator$Q, bx as translator$R, by as translator$S, bz as translator$T, bA as translator$U, bB as translator$V, bC as translator$W, bD as translator$X, bE as translator$Y, bF as translator$Z, bG as translator$_, bH as translator$$, bI as translator$10, bJ as translator$11, bK as translator$12, a as Plugin } from "./chunks/converter-wrgxIFCy.js";
13
13
  import { bL, a5, i, a2 } from "./chunks/converter-wrgxIFCy.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 shouldBypassContextMenu, 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-D8ueJVyp.js";
15
- import { n, C, o, T, l, p, m } from "./chunks/editor-D8ueJVyp.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 shouldBypassContextMenu, 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-C_9lsXSt.js";
15
+ import { n, C, o, T, l, p, m } from "./chunks/editor-C_9lsXSt.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-CXzGZEvz.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-BS-RUJ1x.js";
18
18
  import AIWriter from "./ai-writer.es.js";
19
19
  import { D } from "./chunks/docx-zipper-DIilDv93.js";
20
20
  import { createZip } from "./file-zipper.es.js";
@@ -1,6 +1,6 @@
1
1
  import "vue";
2
- import { T } from "./chunks/toolbar-CXzGZEvz.js";
3
- import "./chunks/editor-D8ueJVyp.js";
2
+ import { T } from "./chunks/toolbar-BS-RUJ1x.js";
3
+ import "./chunks/editor-C_9lsXSt.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-BHP7saSr.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-CHGawnS5.cjs");
4
4
  require("./chunks/vue-DKMj1I9B.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-JTB_jHfC.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-DKYU5AbZ.es.js";
2
2
  import "./chunks/vue-ZWZLQtoU.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-BHP7saSr.cjs");
4
- const superdoc = require("./chunks/index-Ua6WmvV9.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-CHGawnS5.cjs");
4
+ const superdoc = require("./chunks/index-DDWD3Ala.cjs");
5
5
  require("./chunks/vue-DKMj1I9B.cjs");
6
6
  const blankDocx = require("./chunks/blank-docx-CPqX9RF5.cjs");
7
7
  exports.AnnotatorHelpers = superEditor_es.AnnotatorHelpers;
@@ -1,5 +1,5 @@
1
- import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-JTB_jHfC.es.js";
2
- import { D, H, P, S as S2, m, l } from "./chunks/index-CASMW4Gt.es.js";
1
+ import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-DKYU5AbZ.es.js";
2
+ import { D, H, P, S as S2, m, l } from "./chunks/index-H3dscFSf.es.js";
3
3
  import "./chunks/vue-ZWZLQtoU.es.js";
4
4
  import { B } from "./chunks/blank-docx-iwdyG9RH.es.js";
5
5
  export {
@@ -73900,29 +73900,50 @@ Please report this to https://github.com/markedjs/marked.`, e) {
73900
73900
  const changeIndex = trackedChanges.findIndex(({ mark }) => mark.attrs.id === id);
73901
73901
  if (changeIndex === -1) return;
73902
73902
  const matchingChange = trackedChanges[changeIndex];
73903
- const prev = trackedChanges[changeIndex - 1];
73904
- const next = trackedChanges[changeIndex + 1];
73905
- const matchingMarkType = matchingChange.mark.type.name;
73906
- let linkedChange;
73907
- if (prev && matchingChange.from === prev.to) {
73908
- const prevMarkType = prev.mark.type.name;
73909
- if (matchingMarkType === TrackDeleteMarkName && prevMarkType === TrackInsertMarkName || matchingMarkType === TrackInsertMarkName && prevMarkType === TrackDeleteMarkName) {
73910
- const hasContentBetween = state2.doc.textBetween(prev.from, matchingChange.to, "\n").length > prev.to - prev.from + (matchingChange.to - matchingChange.from);
73911
- if (!hasContentBetween) {
73912
- linkedChange = prev;
73913
- }
73903
+ const matchingId = matchingChange.mark.attrs.id;
73904
+ const getSegmentSize = ({ from: from2, to }) => to - from2;
73905
+ const areDirectlyConnected = (left2, right2) => {
73906
+ if (!left2 || !right2) {
73907
+ return false;
73914
73908
  }
73915
- }
73916
- if (!linkedChange && next && matchingChange.to === next.from) {
73917
- const nextMarkType = next.mark.type.name;
73918
- if (matchingMarkType === TrackDeleteMarkName && nextMarkType === TrackInsertMarkName || matchingMarkType === TrackInsertMarkName && nextMarkType === TrackDeleteMarkName) {
73919
- const hasContentBetween = state2.doc.textBetween(matchingChange.from, next.to, "\n").length > matchingChange.to - matchingChange.from + (next.to - next.from);
73920
- if (!hasContentBetween) {
73921
- linkedChange = next;
73909
+ if (left2.to !== right2.from) {
73910
+ return false;
73911
+ }
73912
+ const hasContentBetween = state2.doc.textBetween(left2.from, right2.to, "\n").length > getSegmentSize(left2) + getSegmentSize(right2);
73913
+ return !hasContentBetween;
73914
+ };
73915
+ const isComplementaryPair = (firstType, secondType) => firstType === TrackDeleteMarkName && secondType === TrackInsertMarkName || firstType === TrackInsertMarkName && secondType === TrackDeleteMarkName;
73916
+ const linkedBefore = [];
73917
+ const linkedAfter = [];
73918
+ const collectDirection = (direction, collection) => {
73919
+ let currentIndex = changeIndex;
73920
+ let currentChange = matchingChange;
73921
+ while (true) {
73922
+ const neighborIndex = currentIndex + direction;
73923
+ const neighbor = trackedChanges[neighborIndex];
73924
+ if (!neighbor) {
73925
+ break;
73926
+ }
73927
+ const [left2, right2] = direction < 0 ? [neighbor, currentChange] : [currentChange, neighbor];
73928
+ if (!areDirectlyConnected(left2, right2)) {
73929
+ break;
73930
+ }
73931
+ const sharesId = neighbor.mark.attrs.id === matchingId;
73932
+ const complementary = isComplementaryPair(currentChange.mark.type.name, neighbor.mark.type.name);
73933
+ if (!sharesId && !complementary) {
73934
+ break;
73935
+ }
73936
+ collection.push(neighbor);
73937
+ currentIndex = neighborIndex;
73938
+ currentChange = neighbor;
73939
+ if (!sharesId) {
73940
+ break;
73922
73941
  }
73923
73942
  }
73924
- }
73925
- return [matchingChange, linkedChange].filter(Boolean);
73943
+ };
73944
+ collectDirection(-1, linkedBefore);
73945
+ collectDirection(1, linkedAfter);
73946
+ return [matchingChange, ...linkedAfter, ...linkedBefore];
73926
73947
  };
73927
73948
  const TextTransform = Extension.create({
73928
73949
  name: "textTransform",