@harbour-enterprises/superdoc 0.28.0-next.6 → 0.28.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.
@@ -9788,38 +9788,93 @@ const toggleList = (listType) => ({ editor, state, tr, dispatch }) => {
9788
9788
  if (dispatch) dispatch(tr);
9789
9789
  return true;
9790
9790
  };
9791
- const decreaseListIndent = () => ({ editor, tr }) => {
9791
+ const LIST_NODE_NAMES = /* @__PURE__ */ new Set(["orderedList", "bulletList"]);
9792
+ const parseLevel = (value) => {
9793
+ if (typeof value === "number") return value;
9794
+ const parsed = parseInt(value, 10);
9795
+ return Number.isNaN(parsed) ? 0 : parsed;
9796
+ };
9797
+ const resolveParentList = ($pos) => {
9798
+ if (!$pos) return null;
9799
+ for (let depth = $pos.depth; depth >= 0; depth--) {
9800
+ const node2 = $pos.node(depth);
9801
+ if (node2?.type && LIST_NODE_NAMES.has(node2.type.name)) {
9802
+ return node2;
9803
+ }
9804
+ }
9805
+ return null;
9806
+ };
9807
+ const collectTargetListItemPositions = (state, fallbackPos) => {
9808
+ const doc2 = state?.doc;
9809
+ const listItemType = state?.schema?.nodes?.listItem;
9810
+ if (!doc2 || !listItemType) {
9811
+ return typeof fallbackPos === "number" ? [fallbackPos] : [];
9812
+ }
9813
+ const candidates = [];
9814
+ const { from: from2, to } = state.selection;
9815
+ doc2.nodesBetween(from2, to, (node2, pos) => {
9816
+ if (node2.type === listItemType) {
9817
+ const size = typeof node2.nodeSize === "number" ? node2.nodeSize : 0;
9818
+ candidates.push({ node: node2, pos, end: pos + size });
9819
+ }
9820
+ });
9821
+ if (!candidates.length && typeof fallbackPos === "number") {
9822
+ return [fallbackPos];
9823
+ }
9824
+ const filtered = candidates.filter(({ pos, end: end2 }) => {
9825
+ return !candidates.some((other) => other.pos > pos && other.pos < end2);
9826
+ });
9827
+ const sorted = filtered.map(({ pos }) => pos).sort((a2, b) => a2 - b);
9828
+ return sorted.filter((pos, index2) => index2 === 0 || pos !== sorted[index2 - 1]);
9829
+ };
9830
+ const decreaseListIndent = (_targetPositions) => ({ editor, tr }) => {
9792
9831
  const { state } = editor;
9793
9832
  const currentItem = ListHelpers.getCurrentListItem && ListHelpers.getCurrentListItem(state) || findParentNode((n) => n.type && n.type.name === "listItem")(state.selection);
9794
- if (!currentItem) return false;
9795
- const parentOrdered = ListHelpers.getParentOrderedList && ListHelpers.getParentOrderedList(state);
9796
- const parentBullet = ListHelpers.getParentBulletList && ListHelpers.getParentBulletList(state);
9797
- const parentList = parentOrdered || parentBullet || findParentNode((n) => n.type && (n.type.name === "orderedList" || n.type.name === "bulletList"))(state.selection);
9798
- if (!parentList) return false;
9799
- const attrs = currentItem.node.attrs || {};
9800
- const currLevel = typeof attrs.level === "number" ? attrs.level : 0;
9801
- if (currLevel <= 0) return true;
9802
- const newLevel = currLevel - 1;
9803
- const parentNumId = parentList.node?.attrs?.listId ?? null;
9804
- let numId = parentNumId ?? attrs.numId ?? null;
9805
- let createdNewId = false;
9806
- if (numId == null && ListHelpers.getNewListId) {
9807
- numId = ListHelpers.getNewListId(editor);
9808
- createdNewId = true;
9809
- }
9810
- if (createdNewId && numId != null && ListHelpers.generateNewListDefinition) {
9811
- ListHelpers.generateNewListDefinition({
9812
- numId,
9813
- listType: parentList.node.type,
9814
- editor
9833
+ const parentOrderedHelper = ListHelpers.getParentOrderedList && ListHelpers.getParentOrderedList(state);
9834
+ const parentBulletHelper = ListHelpers.getParentBulletList && ListHelpers.getParentBulletList(state);
9835
+ const targetPositions = _targetPositions || collectTargetListItemPositions(state, currentItem?.pos);
9836
+ if (!targetPositions.length) return false;
9837
+ let parentListsMap = {};
9838
+ const mappedNodes = targetPositions.map((originalPos) => {
9839
+ const mappedPos = tr.mapping ? tr.mapping.map(originalPos) : originalPos;
9840
+ const node2 = tr.doc && tr.doc.nodeAt(mappedPos) || (currentItem && originalPos === currentItem.pos ? currentItem.node : null);
9841
+ return { originalPos, mappedPos, node: node2 };
9842
+ });
9843
+ const validNodes = mappedNodes.filter(({ node: node2 }) => node2 && node2.type.name === "listItem");
9844
+ validNodes.forEach(({ mappedPos, node: node2 }) => {
9845
+ const attrs = node2.attrs || {};
9846
+ const currLevel = parseLevel(attrs.level);
9847
+ if (currLevel <= 0) {
9848
+ return;
9849
+ }
9850
+ const newLevel = currLevel - 1;
9851
+ const $pos = tr.doc ? tr.doc.resolve(mappedPos) : null;
9852
+ const parentListNode = resolveParentList($pos) || parentOrderedHelper?.node || parentBulletHelper?.node || parentOrderedHelper || parentBulletHelper;
9853
+ parentListsMap[mappedPos] = parentListNode;
9854
+ if (!parentListNode) {
9855
+ return;
9856
+ }
9857
+ const fallbackListId = parentListNode.attrs?.listId ?? null;
9858
+ let numId = fallbackListId ?? attrs.numId ?? null;
9859
+ let createdNewId = false;
9860
+ if (numId == null && ListHelpers.getNewListId) {
9861
+ numId = ListHelpers.getNewListId(editor);
9862
+ createdNewId = numId != null;
9863
+ }
9864
+ if (createdNewId && numId != null && ListHelpers.generateNewListDefinition) {
9865
+ ListHelpers.generateNewListDefinition({
9866
+ numId,
9867
+ listType: parentListNode.type,
9868
+ editor
9869
+ });
9870
+ }
9871
+ tr.setNodeMarkup(mappedPos, null, {
9872
+ ...attrs,
9873
+ level: newLevel,
9874
+ numId
9815
9875
  });
9816
- }
9817
- tr.setNodeMarkup(currentItem.pos, null, {
9818
- ...attrs,
9819
- level: newLevel,
9820
- numId
9821
9876
  });
9822
- return true;
9877
+ return Object.values(parentListsMap).length ? !Object.values(parentListsMap).every((pos) => !pos) : true;
9823
9878
  };
9824
9879
  function isVisuallyEmptyParagraph(node2) {
9825
9880
  if (!node2 || node2.type.name !== "paragraph") return false;
@@ -10061,30 +10116,49 @@ const deleteListItem = () => (props) => {
10061
10116
  tr.setSelection(TextSelection.near($pos));
10062
10117
  return true;
10063
10118
  };
10064
- const increaseListIndent = () => ({ editor, tr }) => {
10119
+ const increaseListIndent = (_targetPositions) => ({ editor, tr }) => {
10065
10120
  const { state } = editor;
10066
10121
  const currentItem = ListHelpers.getCurrentListItem && ListHelpers.getCurrentListItem(state) || findParentNode((n) => n.type && n.type.name === "listItem")(state.selection);
10067
- if (!currentItem) return false;
10068
- const parentOrdered = ListHelpers.getParentOrderedList && ListHelpers.getParentOrderedList(state);
10069
- const parentBullet = ListHelpers.getParentBulletList && ListHelpers.getParentBulletList(state);
10070
- const parentList = parentOrdered || parentBullet || findParentNode((n) => n.type && (n.type.name === "orderedList" || n.type.name === "bulletList"))(state.selection);
10071
- if (!parentList) return false;
10072
- const currAttrs = currentItem.node.attrs || {};
10073
- const newLevel = (typeof currAttrs.level === "number" ? currAttrs.level : 0) + 1;
10074
- let numId = currAttrs.numId;
10075
- if (numId == null) {
10076
- numId = parentList.node?.attrs?.listId ?? ListHelpers.getNewListId(editor);
10077
- if (ListHelpers.generateNewListDefinition) {
10078
- const listType = parentList.node.type === editor.schema.nodes.orderedList ? editor.schema.nodes.orderedList : editor.schema.nodes.bulletList;
10079
- ListHelpers.generateNewListDefinition({ numId, listType, editor });
10080
- }
10081
- }
10082
- tr.setNodeMarkup(currentItem.pos, null, {
10083
- ...currAttrs,
10084
- level: newLevel,
10085
- numId
10122
+ const parentOrderedHelper = ListHelpers.getParentOrderedList && ListHelpers.getParentOrderedList(state);
10123
+ const parentBulletHelper = ListHelpers.getParentBulletList && ListHelpers.getParentBulletList(state);
10124
+ const targetPositions = _targetPositions || collectTargetListItemPositions(state, currentItem?.pos);
10125
+ if (!targetPositions.length) return false;
10126
+ let parentListsMap = {};
10127
+ const mappedNodes = targetPositions.map((originalPos) => {
10128
+ const mappedPos = tr.mapping ? tr.mapping.map(originalPos) : originalPos;
10129
+ const node2 = tr.doc && tr.doc.nodeAt(mappedPos) || (currentItem && originalPos === currentItem.pos ? currentItem.node : null);
10130
+ return { originalPos, mappedPos, node: node2 };
10086
10131
  });
10087
- return true;
10132
+ const validNodes = mappedNodes.filter(({ node: node2 }) => node2 && node2.type.name === "listItem");
10133
+ validNodes.forEach(({ mappedPos, node: node2 }) => {
10134
+ const attrs = node2.attrs || {};
10135
+ const currentLevel = parseLevel(attrs.level);
10136
+ const newLevel = currentLevel + 1;
10137
+ const $pos = tr.doc ? tr.doc.resolve(mappedPos) : null;
10138
+ const parentListNode = resolveParentList($pos) || parentOrderedHelper?.node || parentBulletHelper?.node || parentOrderedHelper || parentBulletHelper;
10139
+ parentListsMap[mappedPos] = parentListNode;
10140
+ if (!parentListNode) {
10141
+ return;
10142
+ }
10143
+ let numId = attrs.numId;
10144
+ if (numId == null) {
10145
+ const fallbackListId = parentListNode.attrs?.listId ?? null;
10146
+ numId = fallbackListId ?? (ListHelpers.getNewListId ? ListHelpers.getNewListId(editor) : null);
10147
+ if (numId != null && ListHelpers.generateNewListDefinition) {
10148
+ ListHelpers.generateNewListDefinition({
10149
+ numId,
10150
+ listType: parentListNode.type,
10151
+ editor
10152
+ });
10153
+ }
10154
+ }
10155
+ tr.setNodeMarkup(mappedPos, null, {
10156
+ ...attrs,
10157
+ level: newLevel,
10158
+ numId
10159
+ });
10160
+ });
10161
+ return Object.values(parentListsMap).length ? !Object.values(parentListsMap).every((pos) => !pos) : true;
10088
10162
  };
10089
10163
  const isList = (n) => !!n && (n.type?.name === "orderedList" || n.type?.name === "bulletList");
10090
10164
  const findNodePosition = (doc2, targetNode) => {
@@ -30191,7 +30265,8 @@ const removeMarkStep = ({ state, step, newTr, doc: doc2, user, date }) => {
30191
30265
  const trackedTransaction = ({ tr, state, user }) => {
30192
30266
  const onlyInputTypeMeta = ["inputType", "uiEvent", "paste", "pointer"];
30193
30267
  const notAllowedMeta = ["historyUndo", "historyRedo", "acceptReject"];
30194
- if (!tr.steps.length || tr.meta && !Object.keys(tr.meta).every((meta2) => onlyInputTypeMeta.includes(meta2)) || notAllowedMeta.includes(tr.getMeta("inputType")) || tr.getMeta(CommentsPluginKey)) {
30268
+ const isProgrammaticInput = tr.getMeta("inputType") === "programmatic";
30269
+ if (!tr.steps.length || tr.meta && !Object.keys(tr.meta).every((meta2) => onlyInputTypeMeta.includes(meta2)) && !isProgrammaticInput || notAllowedMeta.includes(tr.getMeta("inputType")) || tr.getMeta(CommentsPluginKey)) {
30195
30270
  return tr;
30196
30271
  }
30197
30272
  const newTr = state.tr;
@@ -49629,7 +49704,7 @@ const TrackChanges = Extension.create({
49629
49704
  const trackedChanges = collectTrackedChanges({ state, from: from2, to });
49630
49705
  if (!isTrackedChangeActionAllowed({ editor, action: "accept", trackedChanges })) return false;
49631
49706
  let { tr, doc: doc2 } = state;
49632
- tr.setMeta("acceptReject", true);
49707
+ tr.setMeta("inputType", "acceptReject");
49633
49708
  const map3 = new Mapping();
49634
49709
  doc2.nodesBetween(from2, to, (node2, pos) => {
49635
49710
  if (node2.marks && node2.marks.find((mark2) => mark2.type.name === TrackDeleteMarkName)) {
@@ -49669,7 +49744,7 @@ const TrackChanges = Extension.create({
49669
49744
  const trackedChanges = collectTrackedChanges({ state, from: from2, to });
49670
49745
  if (!isTrackedChangeActionAllowed({ editor, action: "reject", trackedChanges })) return false;
49671
49746
  const { tr, doc: doc2 } = state;
49672
- tr.setMeta("acceptReject", true);
49747
+ tr.setMeta("inputType", "acceptReject");
49673
49748
  const map3 = new Mapping();
49674
49749
  doc2.nodesBetween(from2, to, (node2, pos) => {
49675
49750
  if (node2.marks && node2.marks.find((mark2) => mark2.type.name === TrackDeleteMarkName)) {
@@ -55431,26 +55506,27 @@ export {
55431
55506
  _export_sfc as _,
55432
55507
  getQuickFormatList as a,
55433
55508
  generateLinkedStyleString as b,
55434
- getFileOpener as c,
55435
- checkAndProcessImage as d,
55436
- uploadAndInsertImage as e,
55437
- collectTrackedChanges as f,
55509
+ collectTargetListItemPositions as c,
55510
+ getFileOpener as d,
55511
+ checkAndProcessImage as e,
55512
+ uploadAndInsertImage as f,
55438
55513
  global as g,
55439
- undoDepth as h,
55514
+ collectTrackedChanges as h,
55440
55515
  isTrackedChangeActionAllowed as i,
55441
- redoDepth as j,
55442
- collectTrackedChangesForContext as k,
55443
- getStarterExtensions as l,
55444
- getRichTextExtensions as m,
55445
- Decoration as n,
55446
- Extension as o,
55447
- index$1 as p,
55448
- index as q,
55516
+ undoDepth as j,
55517
+ redoDepth as k,
55518
+ collectTrackedChangesForContext as l,
55519
+ getStarterExtensions as m,
55520
+ getRichTextExtensions as n,
55521
+ Decoration as o,
55522
+ Extension as p,
55523
+ index$1 as q,
55449
55524
  replaceSelectionWithImagePlaceholder as r,
55450
55525
  shouldBypassContextMenu as s,
55451
- AnnotatorHelpers as t,
55526
+ index as t,
55452
55527
  useHighContrastMode as u,
55453
- SectionHelpers as v,
55454
- getAllowedImageDimensions as w,
55528
+ AnnotatorHelpers as v,
55529
+ SectionHelpers as w,
55530
+ getAllowedImageDimensions as x,
55455
55531
  yUndoPluginKey as y
55456
55532
  };
@@ -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-kpd0gAZh.js";
3
- import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-CYrnVag5.js";
3
+ import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-BJuWMr-a.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-CYrnVag5.js";
1
+ import { E } from "./chunks/editor-BJuWMr-a.js";
2
2
  import "./chunks/converter-kpd0gAZh.js";
3
3
  import "./chunks/docx-zipper-1SfZh-7P.js";
4
4
  export {
@@ -1 +1 @@
1
- export function decreaseListIndent(): Function;
1
+ export function decreaseListIndent(_targetPositions?: any[]): Function;
@@ -1,4 +1,4 @@
1
- export function increaseListIndent(): ({ editor, tr }: {
1
+ export function increaseListIndent(_targetPositions?: any[]): ({ editor, tr }: {
2
2
  editor: any;
3
3
  tr: any;
4
4
  }) => boolean;
@@ -0,0 +1,3 @@
1
+ export function parseLevel(value: any): number;
2
+ export function resolveParentList($pos: any): any;
3
+ export function collectTargetListItemPositions(state: any, fallbackPos: any): any[];
@@ -9,12 +9,12 @@ 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, enrichTrackedChanges_fn, runCommandWithArgumentOnly_fn;
12
- import { K as getDefaultExportFromCjs, W as v4, T as TextSelection$1, v as getMarkRange, aD as vClickOutside, H as findParentNode, aE as getActiveFormatting, aw as isInTable, aF as readFromClipboard, aG as handleClipboardPaste, aH as getFileObject, aI as runPropertyTranslators, aJ as translator, aK as translator$1, aL as translator$2, aM as translator$3, aN as translator$4, aO as translator$5, aP as translator$6, aQ as translator$7, aR as translator$8, aS as translator$9, aT as translator$a, aU as translator$b, aV as translator$c, aW as translator$d, aX as translator$e, aY as commentRangeEndTranslator, aZ as commentRangeStartTranslator, a_ as translator$f, a$ as translator$g, b0 as translator$h, b1 as translator$i, b2 as translator$j, b3 as translator$k, b4 as translator$l, b5 as translator$m, b6 as translator$n, b7 as translator$o, b8 as translator$p, b9 as translator$q, ba as translator$r, bb as translator$s, bc as translator$t, bd as translator$u, be as translator$v, bf as translator$w, bg as translator$x, bh as translator$y, bi as translator$z, bj as translator$A, bk as translator$B, bl as translator$C, bm as translator$D, bn as translator$E, bo as translator$F, bp as translator$G, bq as translator$H, br as translator$I, bs as translator$J, bt as translator$K, bu as translator$L, bv as translator$M, bw as translator$N, bx as translator$O, by as translator$P, bz as translator$Q, bA as translator$R, bB as translator$S, bC as translator$T, bD as translator$U, bE as translator$V, bF as translator$W, bG as translator$X, bH as translator$Y, bI as translator$Z, bJ as translator$_, bK as translator$$, bL as translator$10, bM as translator$11, bN as translator$12, bO as translator$13, bP as translator$14, bQ as translator$15, bR as translator$16, bS as translator$17, bT as translator$18, bU as translator$19, bV as translator$1a, bW as translator$1b, bX as translator$1c, bY as translator$1d, bZ as translator$1e, b_ as translator$1f, b$ as translator$1g, c0 as translator$1h, P as PluginKey, a as Plugin } from "./chunks/converter-kpd0gAZh.js";
12
+ import { K as getDefaultExportFromCjs, W as v4, T as TextSelection$1, v as getMarkRange, aD as vClickOutside, aE as getActiveFormatting, aw as isInTable, aF as readFromClipboard, aG as handleClipboardPaste, aH as getFileObject, aI as runPropertyTranslators, aJ as translator, aK as translator$1, aL as translator$2, aM as translator$3, aN as translator$4, aO as translator$5, aP as translator$6, aQ as translator$7, aR as translator$8, aS as translator$9, aT as translator$a, aU as translator$b, aV as translator$c, aW as translator$d, aX as translator$e, aY as commentRangeEndTranslator, aZ as commentRangeStartTranslator, a_ as translator$f, a$ as translator$g, b0 as translator$h, b1 as translator$i, b2 as translator$j, b3 as translator$k, b4 as translator$l, b5 as translator$m, b6 as translator$n, b7 as translator$o, b8 as translator$p, b9 as translator$q, ba as translator$r, bb as translator$s, bc as translator$t, bd as translator$u, be as translator$v, bf as translator$w, bg as translator$x, bh as translator$y, bi as translator$z, bj as translator$A, bk as translator$B, bl as translator$C, bm as translator$D, bn as translator$E, bo as translator$F, bp as translator$G, bq as translator$H, br as translator$I, bs as translator$J, bt as translator$K, bu as translator$L, bv as translator$M, bw as translator$N, bx as translator$O, by as translator$P, bz as translator$Q, bA as translator$R, bB as translator$S, bC as translator$T, bD as translator$U, bE as translator$V, bF as translator$W, bG as translator$X, bH as translator$Y, bI as translator$Z, bJ as translator$_, bK as translator$$, bL as translator$10, bM as translator$11, bN as translator$12, bO as translator$13, bP as translator$14, bQ as translator$15, bR as translator$16, bS as translator$17, bT as translator$18, bU as translator$19, bV as translator$1a, bW as translator$1b, bX as translator$1c, bY as translator$1d, bZ as translator$1e, b_ as translator$1f, b$ as translator$1g, c0 as translator$1h, P as PluginKey, a as Plugin } from "./chunks/converter-kpd0gAZh.js";
13
13
  import { c1, a6, i, a3 } from "./chunks/converter-kpd0gAZh.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 collectTrackedChangesForContext, s as shouldBypassContextMenu, S as SlashMenuPluginKey, E as Editor, l as getStarterExtensions, P as Placeholder, m as getRichTextExtensions, D as DecorationSet, n as Decoration, M as Mark, o as Extension, A as Attribute, N as Node } from "./chunks/editor-CYrnVag5.js";
15
- import { t, C, v, T, p, w, q } from "./chunks/editor-CYrnVag5.js";
14
+ import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, c as collectTargetListItemPositions, d as getFileOpener, e as checkAndProcessImage, r as replaceSelectionWithImagePlaceholder, f as uploadAndInsertImage, h as collectTrackedChanges, i as isTrackedChangeActionAllowed, y as yUndoPluginKey, j as undoDepth, k as redoDepth, l as collectTrackedChangesForContext, s as shouldBypassContextMenu, S as SlashMenuPluginKey, E as Editor, m as getStarterExtensions, P as Placeholder, n as getRichTextExtensions, D as DecorationSet, o as Decoration, M as Mark, p as Extension, A as Attribute, N as Node } from "./chunks/editor-BJuWMr-a.js";
15
+ import { v, C, w, T, q, x, t } from "./chunks/editor-BJuWMr-a.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, 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-CpbUFrBH.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-D3k3-Nw8.js";
18
18
  import AIWriter from "./ai-writer.es.js";
19
19
  import { D } from "./chunks/docx-zipper-1SfZh-7P.js";
20
20
  import { createZip } from "./file-zipper.es.js";
@@ -2726,11 +2726,11 @@ class SuperToolbar extends EventEmitter {
2726
2726
  * @returns {void}
2727
2727
  */
2728
2728
  increaseTextIndent: ({ item, argument }) => {
2729
- let command = item.command;
2730
- let { state } = this.activeEditor;
2731
- let listItem = findParentNode((node) => node.type.name === "listItem")(state.selection);
2732
- if (listItem) {
2733
- return this.activeEditor.commands.increaseListIndent();
2729
+ const command = item.command;
2730
+ const { state } = this.activeEditor;
2731
+ const listItemsInSelection = collectTargetListItemPositions(state);
2732
+ if (listItemsInSelection.length) {
2733
+ return this.activeEditor.commands.increaseListIndent(listItemsInSelection);
2734
2734
  }
2735
2735
  if (command in this.activeEditor.commands) {
2736
2736
  this.activeEditor.commands[command](argument);
@@ -2746,9 +2746,9 @@ class SuperToolbar extends EventEmitter {
2746
2746
  decreaseTextIndent: ({ item, argument }) => {
2747
2747
  let command = item.command;
2748
2748
  let { state } = this.activeEditor;
2749
- let listItem = findParentNode((node) => node.type.name === "listItem")(state.selection);
2750
- if (listItem) {
2751
- return this.activeEditor.commands.decreaseListIndent();
2749
+ const listItemsInSelection = collectTargetListItemPositions(state);
2750
+ if (listItemsInSelection.length) {
2751
+ return this.activeEditor.commands.decreaseListIndent(listItemsInSelection);
2752
2752
  }
2753
2753
  if (command in this.activeEditor.commands) {
2754
2754
  this.activeEditor.commands[command](argument);
@@ -3266,7 +3266,7 @@ runCommandWithArgumentOnly_fn = function({ item, argument, noArgumentCallback =
3266
3266
  };
3267
3267
  const onMarginClickCursorChange = (event, editor) => {
3268
3268
  const y = event.clientY;
3269
- const x = event.clientX;
3269
+ const x2 = event.clientX;
3270
3270
  const { view } = editor;
3271
3271
  const editorRect = view.dom.getBoundingClientRect();
3272
3272
  let coords = {
@@ -3274,10 +3274,10 @@ const onMarginClickCursorChange = (event, editor) => {
3274
3274
  top: y
3275
3275
  };
3276
3276
  let isRightMargin = false;
3277
- if (x > editorRect.right) {
3277
+ if (x2 > editorRect.right) {
3278
3278
  coords.left = editorRect.left + editorRect.width - 1;
3279
3279
  isRightMargin = true;
3280
- } else if (x < editorRect.left) {
3280
+ } else if (x2 < editorRect.left) {
3281
3281
  coords.left = editorRect.left;
3282
3282
  }
3283
3283
  const pos = view.posAtCoords(coords)?.pos;
@@ -5188,13 +5188,13 @@ const Extensions = {
5188
5188
  };
5189
5189
  export {
5190
5190
  AIWriter,
5191
- t as AnnotatorHelpers,
5191
+ v as AnnotatorHelpers,
5192
5192
  c1 as BasicUpload,
5193
5193
  C as CommentsPluginKey,
5194
5194
  D as DocxZipper,
5195
5195
  Editor,
5196
5196
  Extensions,
5197
- v as SectionHelpers,
5197
+ w as SectionHelpers,
5198
5198
  _sfc_main$4 as SlashMenu,
5199
5199
  a6 as SuperConverter,
5200
5200
  SuperEditor,
@@ -5203,13 +5203,13 @@ export {
5203
5203
  Toolbar,
5204
5204
  T as TrackChangesBasePluginKey,
5205
5205
  createZip,
5206
- p as fieldAnnotationHelpers,
5206
+ q as fieldAnnotationHelpers,
5207
5207
  getActiveFormatting,
5208
- w as getAllowedImageDimensions,
5208
+ x as getAllowedImageDimensions,
5209
5209
  i as getMarksFromSelection,
5210
5210
  getRichTextExtensions,
5211
5211
  getStarterExtensions,
5212
5212
  a3 as helpers,
5213
5213
  registeredHandlers,
5214
- q as trackChangesHelpers
5214
+ t as trackChangesHelpers
5215
5215
  };
@@ -1,6 +1,6 @@
1
1
  import "vue";
2
- import { T } from "./chunks/toolbar-CpbUFrBH.js";
3
- import "./chunks/editor-CYrnVag5.js";
2
+ import { T } from "./chunks/toolbar-D3k3-Nw8.js";
3
+ import "./chunks/editor-BJuWMr-a.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-CygP0ohb.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-QwnGCo9w.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-DeIVissN.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-WQ06yk3i.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-CygP0ohb.cjs");
4
- const superdoc = require("./chunks/index-D4INS8Lk.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-QwnGCo9w.cjs");
4
+ const superdoc = require("./chunks/index-BnHtoBRm.cjs");
5
5
  require("./chunks/vue-DKMj1I9B.cjs");
6
6
  const blankDocx = require("./chunks/blank-docx-DfW3Eeh2.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-DeIVissN.es.js";
2
- import { D, H, P, S as S2, m, l } from "./chunks/index-D5_BGWdx.es.js";
1
+ import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-WQ06yk3i.es.js";
2
+ import { D, H, P, S as S2, m, l } from "./chunks/index-P8al9Mo-.es.js";
3
3
  import "./chunks/vue-ZWZLQtoU.es.js";
4
4
  import { B } from "./chunks/blank-docx-ABm6XYAA.es.js";
5
5
  export {