superdoc 1.13.0-next.1 → 1.13.0-next.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const vue = require("./vue-BkoOkkmT.cjs");
4
- const superdoc = require("./index-BLUZjwF7.cjs");
5
- const index = require("./index-D7frFHbT.cjs");
4
+ const superdoc = require("./index-BZkAxnBF.cjs");
5
+ const index = require("./index-C6wGg96l.cjs");
6
6
  function self(vars) {
7
7
  const {
8
8
  opacityDisabled,
@@ -1,6 +1,6 @@
1
1
  import { d as defineComponent, h, T as Transition, p as process$1, w as watchEffect, b as computed, r as ref, e as onMounted, f as onUnmounted, o as openBlock, c as createElementBlock, a as createBaseVNode, g as createVNode, u as unref, i as createCommentVNode } from "./vue-DiPLN5sT.es.js";
2
- import { N as NBaseLoading, u as useSuperdocStore, s as storeToRefs, a as useSelection } from "./index-DSlk6z0W.es.js";
3
- import { o as derived, p as c, q as cB, r as fadeInTransition, s as cM, w as warnOnce, u as useConfig, t as useTheme, v as pxfy, x as createKey, y as useThemeClass, z as useCompitable, B as _export_sfc } from "./index-DcthayPS.es.js";
2
+ import { N as NBaseLoading, u as useSuperdocStore, s as storeToRefs, a as useSelection } from "./index-BojzLfgF.es.js";
3
+ import { o as derived, p as c, q as cB, r as fadeInTransition, s as cM, w as warnOnce, u as useConfig, t as useTheme, v as pxfy, x as createKey, y as useThemeClass, z as useCompitable, B as _export_sfc } from "./index-CIlQXD5D.es.js";
4
4
  function self(vars) {
5
5
  const {
6
6
  opacityDisabled,
@@ -33817,7 +33817,7 @@ class SuperConverter {
33817
33817
  static getStoredSuperdocVersion(docx) {
33818
33818
  return SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
33819
33819
  }
33820
- static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.13.0-next.1") {
33820
+ static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.13.0-next.3") {
33821
33821
  return SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
33822
33822
  }
33823
33823
  /**
@@ -33818,7 +33818,7 @@ class SuperConverter {
33818
33818
  static getStoredSuperdocVersion(docx) {
33819
33819
  return SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
33820
33820
  }
33821
- static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.13.0-next.1") {
33821
+ static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.13.0-next.3") {
33822
33822
  return SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
33823
33823
  }
33824
33824
  /**
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
- const index = require("./index-D7frFHbT.cjs");
2
+ const index = require("./index-C6wGg96l.cjs");
3
3
  const blankDocx = require("./blank-docx-DfW3Eeh2.cjs");
4
4
  require("./helpers-OFep8CYR.cjs");
5
- require("./SuperConverter-CDhRc7-3.cjs");
5
+ require("./SuperConverter-BjnzdfRz.cjs");
6
6
  const eventemitter3 = require("./eventemitter3-D-UiF04J.cjs");
7
7
  const vue = require("./vue-BkoOkkmT.cjs");
8
8
  require("./jszip.min-oAFpNMh5.cjs");
@@ -8169,7 +8169,7 @@ const _sfc_main = {
8169
8169
  __name: "SuperDoc",
8170
8170
  emits: ["selection-update"],
8171
8171
  setup(__props, { emit: __emit }) {
8172
- const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-BHckfZFZ.cjs")));
8172
+ const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-Bkuhd6zA.cjs")));
8173
8173
  const superdocStore = useSuperdocStore();
8174
8174
  const commentsStore = useCommentsStore();
8175
8175
  const {
@@ -21642,7 +21642,7 @@ class SuperDoc extends eventemitter3.EventEmitter {
21642
21642
  this.config.colors = shuffleArray(this.config.colors);
21643
21643
  this.userColorMap = /* @__PURE__ */ new Map();
21644
21644
  this.colorIndex = 0;
21645
- this.version = "1.13.0-next.1";
21645
+ this.version = "1.13.0-next.3";
21646
21646
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
21647
21647
  this.superdocId = config.superdocId || uuid.v4();
21648
21648
  this.colors = this.config.colors;
@@ -1,7 +1,7 @@
1
- import { D as BIT8, F as MAX_SAFE_INTEGER, G as create, H as BITS7, I as utf8TextDecoder, J as create$1, K as setIfUndefined, L as create$2, O as from, Q as floor$1, R as equalityDeep, U as writeVarUint, V as writeVarString, W as toUint8Array, X as createEncoder, Y as createInjectionKey, Z as toString, $ as throwError, a0 as useSsrAdapter, a1 as configProviderInjectionKey, a2 as cssrAnchorMetaName, a3 as globalStyle, q as cB, p as c, a4 as isMounted, a5 as commonVariables$2, s as cM, a6 as cNotM, a7 as cE, o as derived, a8 as changeColor, a9 as insideModal, aa as insidePopover, ab as resolveWrappedSlot, ac as on, w as warnOnce, u as useConfig, ad as useMergedState, ae as useMemo, t as useTheme, af as useRtl, x as createKey, y as useThemeClass, ag as createId, ah as call, ai as render, aj as messageProviderInjectionKey, ak as messageApiInjectionKey, l as getStarterExtensions, k as getRichTextExtensions, E as Editor, al as fromBase64, am as onChange, an as varStorage, ao as toBase64, ap as createUint8ArrayFromArrayBuffer, aq as offChange, ar as writeVarUint8Array, as as map, at as length, au as isNode, av as min, aw as pow, ax as comments_module_events, ay as getFileObject, az as getTrackChanges, C as CommentsPluginKey, f as TrackChangesBasePluginKey, aA as ellipsisVerticalSvg, aB as xmarkIconSvg, aC as checkIconSvg, aD as caretDownIconSvg, aE as commentIconSvg, B as _export_sfc, aF as NDropdown, d as SuperInput, aG as vClickOutside, P as PresentationEditor, c as SuperEditor, A as AIWriter, aH as NConfigProvider, aI as COMMUNITY_LICENSE_KEY, e as SuperToolbar } from "./index-DcthayPS.es.js";
1
+ import { D as BIT8, F as MAX_SAFE_INTEGER, G as create, H as BITS7, I as utf8TextDecoder, J as create$1, K as setIfUndefined, L as create$2, O as from, Q as floor$1, R as equalityDeep, U as writeVarUint, V as writeVarString, W as toUint8Array, X as createEncoder, Y as createInjectionKey, Z as toString, $ as throwError, a0 as useSsrAdapter, a1 as configProviderInjectionKey, a2 as cssrAnchorMetaName, a3 as globalStyle, q as cB, p as c, a4 as isMounted, a5 as commonVariables$2, s as cM, a6 as cNotM, a7 as cE, o as derived, a8 as changeColor, a9 as insideModal, aa as insidePopover, ab as resolveWrappedSlot, ac as on, w as warnOnce, u as useConfig, ad as useMergedState, ae as useMemo, t as useTheme, af as useRtl, x as createKey, y as useThemeClass, ag as createId, ah as call, ai as render, aj as messageProviderInjectionKey, ak as messageApiInjectionKey, l as getStarterExtensions, k as getRichTextExtensions, E as Editor, al as fromBase64, am as onChange, an as varStorage, ao as toBase64, ap as createUint8ArrayFromArrayBuffer, aq as offChange, ar as writeVarUint8Array, as as map, at as length, au as isNode, av as min, aw as pow, ax as comments_module_events, ay as getFileObject, az as getTrackChanges, C as CommentsPluginKey, f as TrackChangesBasePluginKey, aA as ellipsisVerticalSvg, aB as xmarkIconSvg, aC as checkIconSvg, aD as caretDownIconSvg, aE as commentIconSvg, B as _export_sfc, aF as NDropdown, d as SuperInput, aG as vClickOutside, P as PresentationEditor, c as SuperEditor, A as AIWriter, aH as NConfigProvider, aI as COMMUNITY_LICENSE_KEY, e as SuperToolbar } from "./index-CIlQXD5D.es.js";
2
2
  import { B as BlankDOCX } from "./blank-docx-ABm6XYAA.es.js";
3
3
  import "./helpers-BqdwtJE0.es.js";
4
- import "./SuperConverter-B8z8Qau2.es.js";
4
+ import "./SuperConverter-B7RWzYID.es.js";
5
5
  import { E as EventEmitter$1 } from "./eventemitter3-DdGu2UnW.es.js";
6
6
  import { j as inject, k as provide, b as computed, l as onBeforeUnmount, p as process$1, m as onBeforeMount, d as defineComponent, h, t as toRef, T as Transition, n as TransitionGroup, w as watchEffect, r as ref, e as onMounted, q as Teleport, F as Fragment, s as reactive, v as effectScope, x as markRaw, y as toRaw, z as isRef, A as isReactive, B as watch, u as unref, C as hasInjectionContext, D as nextTick, E as getCurrentInstance, G as getCurrentScope, H as onScopeDispose, I as toRefs, J as global, K as shallowRef, o as openBlock, c as createElementBlock, g as createVNode, L as withCtx, a as createBaseVNode, M as toDisplayString, N as normalizeStyle, i as createCommentVNode, O as withModifiers, P as createBlock, Q as normalizeClass, R as resolveDirective, S as withDirectives, U as renderList, V as createApp, W as resolveDynamicComponent, X as defineAsyncComponent } from "./vue-DiPLN5sT.es.js";
7
7
  import "./jszip.min-BCZQ7Wq2.es.js";
@@ -8152,7 +8152,7 @@ const _sfc_main = {
8152
8152
  __name: "SuperDoc",
8153
8153
  emits: ["selection-update"],
8154
8154
  setup(__props, { emit: __emit }) {
8155
- const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-DoG_fVDu.es.js"));
8155
+ const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-CAIsgOCy.es.js"));
8156
8156
  const superdocStore = useSuperdocStore();
8157
8157
  const commentsStore = useCommentsStore();
8158
8158
  const {
@@ -21625,7 +21625,7 @@ class SuperDoc extends EventEmitter$1 {
21625
21625
  this.config.colors = shuffleArray(this.config.colors);
21626
21626
  this.userColorMap = /* @__PURE__ */ new Map();
21627
21627
  this.colorIndex = 0;
21628
- this.version = "1.13.0-next.1";
21628
+ this.version = "1.13.0-next.3";
21629
21629
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
21630
21630
  this.superdocId = config.superdocId || v4();
21631
21631
  this.colors = this.config.colors;
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const superEditor_converter = require("./SuperConverter-CDhRc7-3.cjs");
2
+ const superEditor_converter = require("./SuperConverter-BjnzdfRz.cjs");
3
3
  const helpers$1 = require("./helpers-OFep8CYR.cjs");
4
4
  const vue = require("./vue-BkoOkkmT.cjs");
5
5
  require("./jszip.min-oAFpNMh5.cjs");
@@ -993,7 +993,7 @@ const DEFAULT_ENDPOINT = "https://ingest.superdoc.dev/v1/collect";
993
993
  const COMMUNITY_LICENSE_KEY = "community-and-eval-agplv3";
994
994
  function getSuperdocVersion() {
995
995
  try {
996
- return true ? "1.13.0-next.1" : "unknown";
996
+ return true ? "1.13.0-next.3" : "unknown";
997
997
  } catch {
998
998
  return "unknown";
999
999
  }
@@ -14982,8 +14982,17 @@ const createOrUpdateTrackedChangeComment = ({ event, marks, deletionNodes, nodes
14982
14982
  });
14983
14983
  let nodesToUse;
14984
14984
  if (isDeletionInsertion) {
14985
- const allNodes = [...nodesWithMark, ...nodes, ...deletionNodes || []];
14986
- nodesToUse = Array.from(new Set(allNodes));
14985
+ const hasInsertNode = nodesWithMark.some(
14986
+ (node2) => node2.marks.find((nodeMark) => nodeMark.type.name === superEditor_converter.TrackInsertMarkName)
14987
+ );
14988
+ const hasDeleteNode = nodesWithMark.some(
14989
+ (node2) => node2.marks.find((nodeMark) => nodeMark.type.name === superEditor_converter.TrackDeleteMarkName)
14990
+ );
14991
+ const fallbackNodes = [
14992
+ ...!hasInsertNode && nodes?.length ? nodes : [],
14993
+ ...!hasDeleteNode && deletionNodes?.length ? deletionNodes : []
14994
+ ];
14995
+ nodesToUse = Array.from(/* @__PURE__ */ new Set([...nodesWithMark, ...fallbackNodes]));
14987
14996
  } else {
14988
14997
  nodesToUse = nodesWithMark.length ? nodesWithMark : node ? [node] : [];
14989
14998
  }
@@ -17092,7 +17101,7 @@ const canUseDOM = () => {
17092
17101
  return false;
17093
17102
  }
17094
17103
  };
17095
- const summaryVersion = "1.13.0-next.1";
17104
+ const summaryVersion = "1.13.0-next.3";
17096
17105
  const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
17097
17106
  const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
17098
17107
  function mapAttributes(attrs) {
@@ -19899,7 +19908,7 @@ class Editor extends EventEmitter {
19899
19908
  * Process collaboration migrations
19900
19909
  */
19901
19910
  processCollaborationMigrations() {
19902
- console.debug("[checkVersionMigrations] Current editor version", "1.13.0-next.1");
19911
+ console.debug("[checkVersionMigrations] Current editor version", "1.13.0-next.3");
19903
19912
  if (!this.options.ydoc) return;
19904
19913
  const metaMap = this.options.ydoc.getMap("meta");
19905
19914
  let docVersion = metaMap.get("version");
@@ -46469,6 +46478,7 @@ function layoutDrawingBlock({
46469
46478
  state.page.fragments.push(fragment);
46470
46479
  state.cursorY += requiredHeight;
46471
46480
  }
46481
+ const ANCHORED_TABLE_FULL_WIDTH_RATIO = 0.99;
46472
46482
  function getTableIndentWidth(attrs) {
46473
46483
  if (!attrs) {
46474
46484
  return 0;
@@ -46839,8 +46849,13 @@ function layoutTableBlock({
46839
46849
  advanceColumn,
46840
46850
  columnX
46841
46851
  }) {
46852
+ let treatAsInline = false;
46842
46853
  if (block.anchor?.isAnchored) {
46843
- return;
46854
+ const totalWidth = measure.totalWidth ?? 0;
46855
+ treatAsInline = columnWidth > 0 && totalWidth >= columnWidth * ANCHORED_TABLE_FULL_WIDTH_RATIO;
46856
+ if (!treatAsInline) {
46857
+ return;
46858
+ }
46844
46859
  }
46845
46860
  const tableProps = block.attrs?.tableProperties;
46846
46861
  const floatingProps = tableProps?.floatingTableProperties;
@@ -48495,18 +48510,6 @@ function layoutDocument(blocks, measures, options = {}) {
48495
48510
  }
48496
48511
  const anchorsForPara = anchoredByParagraph.get(index2);
48497
48512
  const tablesForPara = anchoredTablesByParagraph.get(index2);
48498
- if (tablesForPara) {
48499
- const state = paginator.ensurePage();
48500
- for (const { block: tableBlock, measure: tableMeasure } of tablesForPara) {
48501
- if (placedAnchoredTableIds.has(tableBlock.id)) continue;
48502
- floatManager.registerTable(tableBlock, tableMeasure, state.cursorY, state.columnIndex, state.page.number);
48503
- const anchorX = tableBlock.anchor?.offsetH ?? columnX(state.columnIndex);
48504
- const anchorY = state.cursorY + (tableBlock.anchor?.offsetV ?? 0);
48505
- const tableFragment = createAnchoredTableFragment(tableBlock, tableMeasure, anchorX, anchorY);
48506
- state.page.fragments.push(tableFragment);
48507
- placedAnchoredTableIds.add(tableBlock.id);
48508
- }
48509
- }
48510
48513
  const chain = keepNextChains.get(index2);
48511
48514
  if (midChainIndices.has(index2)) ;
48512
48515
  else if (chain) {
@@ -48579,6 +48582,7 @@ function layoutDocument(blocks, measures, options = {}) {
48579
48582
  }
48580
48583
  }
48581
48584
  }
48585
+ const paragraphStartY = paginator.ensurePage().cursorY;
48582
48586
  layoutParagraphBlock(
48583
48587
  {
48584
48588
  block,
@@ -48604,6 +48608,29 @@ function layoutDocument(blocks, measures, options = {}) {
48604
48608
  placedAnchoredIds
48605
48609
  } : void 0
48606
48610
  );
48611
+ if (tablesForPara) {
48612
+ const state = paginator.ensurePage();
48613
+ const columnWidthForTable = getCurrentColumns().width;
48614
+ let tableBottomY = state.cursorY;
48615
+ for (const { block: tableBlock, measure: tableMeasure } of tablesForPara) {
48616
+ if (placedAnchoredTableIds.has(tableBlock.id)) continue;
48617
+ const totalWidth = tableMeasure.totalWidth ?? 0;
48618
+ if (columnWidthForTable > 0 && totalWidth >= columnWidthForTable * ANCHORED_TABLE_FULL_WIDTH_RATIO) continue;
48619
+ const offsetV = tableBlock.anchor?.offsetV ?? 0;
48620
+ const anchorY = Math.max(paragraphStartY + offsetV, state.cursorY);
48621
+ floatManager.registerTable(tableBlock, tableMeasure, anchorY, state.columnIndex, state.page.number);
48622
+ const anchorX = tableBlock.anchor?.offsetH ?? columnX(state.columnIndex);
48623
+ const tableFragment = createAnchoredTableFragment(tableBlock, tableMeasure, anchorX, anchorY);
48624
+ state.page.fragments.push(tableFragment);
48625
+ placedAnchoredTableIds.add(tableBlock.id);
48626
+ const wrapType = tableBlock.wrap?.type ?? "None";
48627
+ if (wrapType !== "None") {
48628
+ const bottom2 = anchorY + (tableMeasure.totalHeight ?? 0);
48629
+ if (bottom2 > tableBottomY) tableBottomY = bottom2;
48630
+ }
48631
+ }
48632
+ state.cursorY = tableBottomY;
48633
+ }
48607
48634
  continue;
48608
48635
  }
48609
48636
  if (block.kind === "image") {
@@ -1,4 +1,4 @@
1
- import { g as generateDocxRandomId, T as TextSelection$1, o as objectIncludes, w as wrapTextsInRuns, D as DOMParser$1, c as createDocFromMarkdown, a as createDocFromHTML, F as Fragment, b as chainableEditorState, d as convertMarkdownToHTML, f as findParentNode, e as findParentNodeClosestToPos, h as generateRandom32BitHex, i as generateRandomSigned32BitIntStrId, P as Plugin, j as PluginKey, M as Mapping, N as NodeSelection, k as Selection, l as Slice, m as DOMSerializer, n as Mark$1, p as dropPoint, A as AllSelection, q as Schema$2, s as canSplit, t as resolveRunProperties, u as encodeMarksFromRPr, v as liftTarget, x as replaceStep$1, y as canJoin, z as joinPoint, R as ReplaceAroundStep$1, B as htmlHandler, C as ReplaceStep, E as getResolvedParagraphProperties, G as changeListLevel, H as isList$1, I as updateNumberingProperties, L as ListHelpers, J as inputRulesPlugin, K as TrackDeleteMarkName, O as TrackInsertMarkName, Q as TrackFormatMarkName, U as AddMarkStep, V as RemoveMarkStep, W as CommandService, S as SuperConverter, X as EditorState, Y as unflattenListsInHtml, Z as SelectionRange, _ as Transform, $ as resolveParagraphProperties, a0 as resolveDocxFontFamily, a1 as _getReferencedTableStyles, a2 as resolveTableCellProperties, a3 as decodeRPrFromMarks, a4 as carbonCopy, a5 as calculateResolvedParagraphProperties, a6 as encodeCSSFromPPr, a7 as encodeCSSFromRPr, a8 as generateOrderedListIndex, a9 as docxNumberingHelpers, aa as InputRule, ab as insertNewRelationship, ac as kebabCase$1, ad as getUnderlineCssString, ae as handleClipboardPaste } from "./SuperConverter-B8z8Qau2.es.js";
1
+ import { g as generateDocxRandomId, T as TextSelection$1, o as objectIncludes, w as wrapTextsInRuns, D as DOMParser$1, c as createDocFromMarkdown, a as createDocFromHTML, F as Fragment, b as chainableEditorState, d as convertMarkdownToHTML, f as findParentNode, e as findParentNodeClosestToPos, h as generateRandom32BitHex, i as generateRandomSigned32BitIntStrId, P as Plugin, j as PluginKey, M as Mapping, N as NodeSelection, k as Selection, l as Slice, m as DOMSerializer, n as Mark$1, p as dropPoint, A as AllSelection, q as Schema$2, s as canSplit, t as resolveRunProperties, u as encodeMarksFromRPr, v as liftTarget, x as replaceStep$1, y as canJoin, z as joinPoint, R as ReplaceAroundStep$1, B as htmlHandler, C as ReplaceStep, E as getResolvedParagraphProperties, G as changeListLevel, H as isList$1, I as updateNumberingProperties, L as ListHelpers, J as inputRulesPlugin, K as TrackDeleteMarkName, O as TrackInsertMarkName, Q as TrackFormatMarkName, U as AddMarkStep, V as RemoveMarkStep, W as CommandService, S as SuperConverter, X as EditorState, Y as unflattenListsInHtml, Z as SelectionRange, _ as Transform, $ as resolveParagraphProperties, a0 as resolveDocxFontFamily, a1 as _getReferencedTableStyles, a2 as resolveTableCellProperties, a3 as decodeRPrFromMarks, a4 as carbonCopy, a5 as calculateResolvedParagraphProperties, a6 as encodeCSSFromPPr, a7 as encodeCSSFromRPr, a8 as generateOrderedListIndex, a9 as docxNumberingHelpers, aa as InputRule, ab as insertNewRelationship, ac as kebabCase$1, ad as getUnderlineCssString, ae as handleClipboardPaste } from "./SuperConverter-B7RWzYID.es.js";
2
2
  import { j as twipsToInches, m as inchesToTwips, p as ptToTwips, d as linesToTwips, f as twipsToLines, k as pixelsToTwips, z as resolveOpcTargetPath, B as Buffer$3, D as getArrayBufferFromUrl, h as halfPointToPoints, c as twipsToPixels$2, E as convertSizeToCSS, F as inchesToPixels } from "./helpers-BqdwtJE0.es.js";
3
3
  import { p as process$1$2, r as ref, b as computed, c as createElementBlock, F as Fragment$1, U as renderList, O as withModifiers, o as openBlock, Q as normalizeClass, M as toDisplayString, i as createCommentVNode, a as createBaseVNode, V as createApp, e as onMounted, f as onUnmounted, u as unref, S as withDirectives, Y as vModelText, D as nextTick, N as normalizeStyle, B as watch, Z as withKeys, _ as createTextVNode, g as createVNode, h as h$1, $ as readonly, E as getCurrentInstance, l as onBeforeUnmount, s as reactive, m as onBeforeMount, j as inject, a0 as onActivated, a1 as onDeactivated, a2 as Comment, d as defineComponent, k as provide, q as Teleport, t as toRef, a3 as renderSlot, a4 as isVNode, K as shallowRef, w as watchEffect, J as global$2, T as Transition, a5 as mergeProps, a6 as vShow, a7 as cloneVNode, a8 as Text$2, x as markRaw, P as createBlock, L as withCtx, a9 as useCssVars, W as resolveDynamicComponent, aa as normalizeProps, ab as guardReactiveProps } from "./vue-DiPLN5sT.es.js";
4
4
  import "./jszip.min-BCZQ7Wq2.es.js";
@@ -976,7 +976,7 @@ const DEFAULT_ENDPOINT = "https://ingest.superdoc.dev/v1/collect";
976
976
  const COMMUNITY_LICENSE_KEY = "community-and-eval-agplv3";
977
977
  function getSuperdocVersion() {
978
978
  try {
979
- return true ? "1.13.0-next.1" : "unknown";
979
+ return true ? "1.13.0-next.3" : "unknown";
980
980
  } catch {
981
981
  return "unknown";
982
982
  }
@@ -14965,8 +14965,17 @@ const createOrUpdateTrackedChangeComment = ({ event, marks, deletionNodes, nodes
14965
14965
  });
14966
14966
  let nodesToUse;
14967
14967
  if (isDeletionInsertion) {
14968
- const allNodes = [...nodesWithMark, ...nodes, ...deletionNodes || []];
14969
- nodesToUse = Array.from(new Set(allNodes));
14968
+ const hasInsertNode = nodesWithMark.some(
14969
+ (node2) => node2.marks.find((nodeMark) => nodeMark.type.name === TrackInsertMarkName)
14970
+ );
14971
+ const hasDeleteNode = nodesWithMark.some(
14972
+ (node2) => node2.marks.find((nodeMark) => nodeMark.type.name === TrackDeleteMarkName)
14973
+ );
14974
+ const fallbackNodes = [
14975
+ ...!hasInsertNode && nodes?.length ? nodes : [],
14976
+ ...!hasDeleteNode && deletionNodes?.length ? deletionNodes : []
14977
+ ];
14978
+ nodesToUse = Array.from(/* @__PURE__ */ new Set([...nodesWithMark, ...fallbackNodes]));
14970
14979
  } else {
14971
14980
  nodesToUse = nodesWithMark.length ? nodesWithMark : node ? [node] : [];
14972
14981
  }
@@ -17075,7 +17084,7 @@ const canUseDOM = () => {
17075
17084
  return false;
17076
17085
  }
17077
17086
  };
17078
- const summaryVersion = "1.13.0-next.1";
17087
+ const summaryVersion = "1.13.0-next.3";
17079
17088
  const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
17080
17089
  const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
17081
17090
  function mapAttributes(attrs) {
@@ -19882,7 +19891,7 @@ class Editor extends EventEmitter {
19882
19891
  * Process collaboration migrations
19883
19892
  */
19884
19893
  processCollaborationMigrations() {
19885
- console.debug("[checkVersionMigrations] Current editor version", "1.13.0-next.1");
19894
+ console.debug("[checkVersionMigrations] Current editor version", "1.13.0-next.3");
19886
19895
  if (!this.options.ydoc) return;
19887
19896
  const metaMap = this.options.ydoc.getMap("meta");
19888
19897
  let docVersion = metaMap.get("version");
@@ -46452,6 +46461,7 @@ function layoutDrawingBlock({
46452
46461
  state.page.fragments.push(fragment);
46453
46462
  state.cursorY += requiredHeight;
46454
46463
  }
46464
+ const ANCHORED_TABLE_FULL_WIDTH_RATIO = 0.99;
46455
46465
  function getTableIndentWidth(attrs) {
46456
46466
  if (!attrs) {
46457
46467
  return 0;
@@ -46822,8 +46832,13 @@ function layoutTableBlock({
46822
46832
  advanceColumn,
46823
46833
  columnX
46824
46834
  }) {
46835
+ let treatAsInline = false;
46825
46836
  if (block.anchor?.isAnchored) {
46826
- return;
46837
+ const totalWidth = measure.totalWidth ?? 0;
46838
+ treatAsInline = columnWidth > 0 && totalWidth >= columnWidth * ANCHORED_TABLE_FULL_WIDTH_RATIO;
46839
+ if (!treatAsInline) {
46840
+ return;
46841
+ }
46827
46842
  }
46828
46843
  const tableProps = block.attrs?.tableProperties;
46829
46844
  const floatingProps = tableProps?.floatingTableProperties;
@@ -48478,18 +48493,6 @@ function layoutDocument(blocks, measures, options = {}) {
48478
48493
  }
48479
48494
  const anchorsForPara = anchoredByParagraph.get(index2);
48480
48495
  const tablesForPara = anchoredTablesByParagraph.get(index2);
48481
- if (tablesForPara) {
48482
- const state = paginator.ensurePage();
48483
- for (const { block: tableBlock, measure: tableMeasure } of tablesForPara) {
48484
- if (placedAnchoredTableIds.has(tableBlock.id)) continue;
48485
- floatManager.registerTable(tableBlock, tableMeasure, state.cursorY, state.columnIndex, state.page.number);
48486
- const anchorX = tableBlock.anchor?.offsetH ?? columnX(state.columnIndex);
48487
- const anchorY = state.cursorY + (tableBlock.anchor?.offsetV ?? 0);
48488
- const tableFragment = createAnchoredTableFragment(tableBlock, tableMeasure, anchorX, anchorY);
48489
- state.page.fragments.push(tableFragment);
48490
- placedAnchoredTableIds.add(tableBlock.id);
48491
- }
48492
- }
48493
48496
  const chain = keepNextChains.get(index2);
48494
48497
  if (midChainIndices.has(index2)) ;
48495
48498
  else if (chain) {
@@ -48562,6 +48565,7 @@ function layoutDocument(blocks, measures, options = {}) {
48562
48565
  }
48563
48566
  }
48564
48567
  }
48568
+ const paragraphStartY = paginator.ensurePage().cursorY;
48565
48569
  layoutParagraphBlock(
48566
48570
  {
48567
48571
  block,
@@ -48587,6 +48591,29 @@ function layoutDocument(blocks, measures, options = {}) {
48587
48591
  placedAnchoredIds
48588
48592
  } : void 0
48589
48593
  );
48594
+ if (tablesForPara) {
48595
+ const state = paginator.ensurePage();
48596
+ const columnWidthForTable = getCurrentColumns().width;
48597
+ let tableBottomY = state.cursorY;
48598
+ for (const { block: tableBlock, measure: tableMeasure } of tablesForPara) {
48599
+ if (placedAnchoredTableIds.has(tableBlock.id)) continue;
48600
+ const totalWidth = tableMeasure.totalWidth ?? 0;
48601
+ if (columnWidthForTable > 0 && totalWidth >= columnWidthForTable * ANCHORED_TABLE_FULL_WIDTH_RATIO) continue;
48602
+ const offsetV = tableBlock.anchor?.offsetV ?? 0;
48603
+ const anchorY = Math.max(paragraphStartY + offsetV, state.cursorY);
48604
+ floatManager.registerTable(tableBlock, tableMeasure, anchorY, state.columnIndex, state.page.number);
48605
+ const anchorX = tableBlock.anchor?.offsetH ?? columnX(state.columnIndex);
48606
+ const tableFragment = createAnchoredTableFragment(tableBlock, tableMeasure, anchorX, anchorY);
48607
+ state.page.fragments.push(tableFragment);
48608
+ placedAnchoredTableIds.add(tableBlock.id);
48609
+ const wrapType = tableBlock.wrap?.type ?? "None";
48610
+ if (wrapType !== "None") {
48611
+ const bottom2 = anchorY + (tableMeasure.totalHeight ?? 0);
48612
+ if (bottom2 > tableBottomY) tableBottomY = bottom2;
48613
+ }
48614
+ }
48615
+ state.cursorY = tableBottomY;
48616
+ }
48590
48617
  continue;
48591
48618
  }
48592
48619
  if (block.kind === "image") {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  require("../chunks/helpers-OFep8CYR.cjs");
4
- const superEditor_converter = require("../chunks/SuperConverter-CDhRc7-3.cjs");
4
+ const superEditor_converter = require("../chunks/SuperConverter-BjnzdfRz.cjs");
5
5
  require("../chunks/uuid-R7L08bOx.cjs");
6
6
  exports.SuperConverter = superEditor_converter.SuperConverter;
@@ -1,5 +1,5 @@
1
1
  import "../chunks/helpers-BqdwtJE0.es.js";
2
- import { S } from "../chunks/SuperConverter-B8z8Qau2.es.js";
2
+ import { S } from "../chunks/SuperConverter-B7RWzYID.es.js";
3
3
  import "../chunks/uuid-CjlX8hrF.es.js";
4
4
  export {
5
5
  S as SuperConverter
@@ -1 +1 @@
1
- {"version":3,"file":"comments-plugin.d.ts","sourceRoot":"","sources":["../../../src/extensions/comment/comments-plugin.js"],"names":[],"mappings":"AAqBA,+CAA2D;AAE3D,qFAkjBG;;;;;;;;;0BAzkB8C,mBAAmB;0BAC1C,oBAAoB;AAumB9C;;;;;;;GAOG;AACH,yDAHW,SAAS,GACP,SAAS,IAAI,CAyEzB;AAED;;;;;cA4BC;AAED,oIAuDC;AAED;;;;;;;;;EAkCC;AAED;;;;;;;;;;;;;;;;;;;;;;EAqGC;AAED;;;EAyBC"}
1
+ {"version":3,"file":"comments-plugin.d.ts","sourceRoot":"","sources":["../../../src/extensions/comment/comments-plugin.js"],"names":[],"mappings":"AAqBA,+CAA2D;AAE3D,qFAkjBG;;;;;;;;;0BAzkB8C,mBAAmB;0BAC1C,oBAAoB;AAumB9C;;;;;;;GAOG;AACH,yDAHW,SAAS,GACP,SAAS,IAAI,CAyEzB;AAED;;;;;cA4BC;AAED,oIAuDC;AAED;;;;;;;;;EAkCC;AAED;;;;;;;;;;;;;;;;;;;;;;EAgHC;AAED;;;EAyBC"}
@@ -1 +1 @@
1
- {"version":3,"file":"comments-plugin.d.ts","sourceRoot":"","sources":["../../../../src/extensions/comment/comments-plugin.js"],"names":[],"mappings":"AAqBA,+CAA2D;AAE3D,qFAkjBG;;;;;;;;;0BAzkB8C,mBAAmB;0BAC1C,oBAAoB;AAumB9C;;;;;;;GAOG;AACH,yDAHW,SAAS,GACP,SAAS,IAAI,CAyEzB;AAED;;;;;cA4BC;AAED,oIAuDC;AAED;;;;;;;;;EAkCC;AAED;;;;;;;;;;;;;;;;;;;;;;EAqGC;AAED;;;EAyBC"}
1
+ {"version":3,"file":"comments-plugin.d.ts","sourceRoot":"","sources":["../../../../src/extensions/comment/comments-plugin.js"],"names":[],"mappings":"AAqBA,+CAA2D;AAE3D,qFAkjBG;;;;;;;;;0BAzkB8C,mBAAmB;0BAC1C,oBAAoB;AAumB9C;;;;;;;GAOG;AACH,yDAHW,SAAS,GACP,SAAS,IAAI,CAyEzB;AAED;;;;;cA4BC;AAED,oIAuDC;AAED;;;;;;;;;EAkCC;AAED;;;;;;;;;;;;;;;;;;;;;;EAgHC;AAED;;;EAyBC"}