@harbour-enterprises/superdoc 1.0.0-beta.19 → 1.0.0-beta.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist/chunks/{PdfViewer-D_4g-jsZ.es.js → PdfViewer-CPnD95lv.es.js} +1 -1
  2. package/dist/chunks/{PdfViewer-BLFV17De.cjs → PdfViewer-DbSf6FKU.cjs} +1 -1
  3. package/dist/chunks/{index-NPXppXmC.es.js → index-BSHAWPko.es.js} +3 -3
  4. package/dist/chunks/{index-CRpn1mWd-B4eH8Zok.es.js → index-DHhKY9FZ-CyEU4GWR.es.js} +1 -1
  5. package/dist/chunks/{index-CRpn1mWd-BUbbd3Jq.cjs → index-DHhKY9FZ-DORT-UR6.cjs} +1 -1
  6. package/dist/chunks/{index-k02voMEs.cjs → index-DLco7m-w.cjs} +3 -3
  7. package/dist/chunks/{super-editor.es-C_Gk8cDd.cjs → super-editor.es-B6lsvAAY.cjs} +117 -38
  8. package/dist/chunks/{super-editor.es-CHU4dmes.es.js → super-editor.es-C0tdU_gq.es.js} +117 -38
  9. package/dist/style.css +6 -6
  10. package/dist/super-editor/ai-writer.es.js +2 -2
  11. package/dist/super-editor/chunks/{converter-Cu26_LdN.js → converter-m2x13P8G.js} +2 -2
  12. package/dist/super-editor/chunks/{docx-zipper-C8lozSFd.js → docx-zipper-CRSKJF-o.js} +1 -1
  13. package/dist/super-editor/chunks/{editor-BXC2Hzba.js → editor-C9r_Jbbg.js} +56 -35
  14. package/dist/super-editor/chunks/{index-CRpn1mWd.js → index-DHhKY9FZ.js} +1 -1
  15. package/dist/super-editor/chunks/{toolbar-BglLOe8y.js → toolbar-fnptYAcU.js} +2 -2
  16. package/dist/super-editor/converter.es.js +1 -1
  17. package/dist/super-editor/docx-zipper.es.js +2 -2
  18. package/dist/super-editor/editor.es.js +3 -3
  19. package/dist/super-editor/file-zipper.es.js +1 -1
  20. package/dist/super-editor/style.css +6 -6
  21. package/dist/super-editor/super-editor.es.js +67 -9
  22. package/dist/super-editor/toolbar.es.js +2 -2
  23. package/dist/super-editor.cjs +1 -1
  24. package/dist/super-editor.es.js +1 -1
  25. package/dist/superdoc.cjs +2 -2
  26. package/dist/superdoc.es.js +2 -2
  27. package/dist/superdoc.umd.js +119 -40
  28. package/dist/superdoc.umd.js.map +1 -1
  29. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
- import { E } from "./chunks/editor-BXC2Hzba.js";
2
- import "./chunks/converter-Cu26_LdN.js";
3
- import "./chunks/docx-zipper-C8lozSFd.js";
1
+ import { E } from "./chunks/editor-C9r_Jbbg.js";
2
+ import "./chunks/converter-m2x13P8G.js";
3
+ import "./chunks/docx-zipper-CRSKJF-o.js";
4
4
  export {
5
5
  E as Editor
6
6
  };
@@ -1,4 +1,4 @@
1
- import { J as JSZip } from "./chunks/docx-zipper-C8lozSFd.js";
1
+ import { J as JSZip } from "./chunks/docx-zipper-CRSKJF-o.js";
2
2
  async function createZip(blobs, fileNames) {
3
3
  const zip = new JSZip();
4
4
  blobs.forEach((blob, index) => {
@@ -1969,10 +1969,10 @@ https://github.com/ProseMirror/prosemirror-tables/blob/master/demo/index.html
1969
1969
  box-shadow: 0 0 4px rgba(74, 144, 226, 0.5);
1970
1970
  }
1971
1971
 
1972
- .editor-element[data-v-08b32c3d] {
1972
+ .editor-element[data-v-ed5a08ee] {
1973
1973
  position: relative;
1974
1974
  }
1975
- .super-editor-container[data-v-08b32c3d] {
1975
+ .super-editor-container[data-v-ed5a08ee] {
1976
1976
  width: auto;
1977
1977
  height: auto;
1978
1978
  min-width: 8in;
@@ -1981,14 +1981,14 @@ https://github.com/ProseMirror/prosemirror-tables/blob/master/demo/index.html
1981
1981
  display: flex;
1982
1982
  flex-direction: column;
1983
1983
  }
1984
- .ruler[data-v-08b32c3d] {
1984
+ .ruler[data-v-ed5a08ee] {
1985
1985
  margin-bottom: 2px;
1986
1986
  }
1987
- .super-editor[data-v-08b32c3d] {
1987
+ .super-editor[data-v-ed5a08ee] {
1988
1988
  color: initial;
1989
1989
  overflow: hidden;
1990
1990
  }
1991
- .placeholder-editor[data-v-08b32c3d] {
1991
+ .placeholder-editor[data-v-ed5a08ee] {
1992
1992
  position: absolute;
1993
1993
  top: 0;
1994
1994
  left: 0;
@@ -2000,7 +2000,7 @@ https://github.com/ProseMirror/prosemirror-tables/blob/master/demo/index.html
2000
2000
  background-color: white;
2001
2001
  box-sizing: border-box;
2002
2002
  }
2003
- .placeholder-title[data-v-08b32c3d] {
2003
+ .placeholder-title[data-v-ed5a08ee] {
2004
2004
  display: flex;
2005
2005
  justify-content: center;
2006
2006
  margin-bottom: 40px;
@@ -9,14 +9,14 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
9
9
  var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
10
10
  var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
11
11
  var _MARK_TOGGLE_NAMES, _SuperToolbar_instances, initToolbarGroups_fn, _interceptedCommands, makeToolbarItems_fn, initDefaultFonts_fn, updateHighlightColors_fn, deactivateAll_fn, updateToolbarHistory_fn, enrichTrackedChanges_fn, runCommandWithArgumentOnly_fn, syncStickyMarksFromState_fn, restoreStickyMarksIfNeeded_fn, ensureStoredMarksForMarkToggle_fn;
12
- import { aK as getDefaultExportFromCjs, a0 as v4, T as TextSelection$1, v as getMarkRange, aN as vClickOutside, aO as getActiveFormatting, aD as isInTable, 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-Cu26_LdN.js";
13
- import { ac, i, a9, aQ } from "./chunks/converter-Cu26_LdN.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-BXC2Hzba.js";
15
- import { z, F, B, T, w, C, x } from "./chunks/editor-BXC2Hzba.js";
12
+ import { aK as getDefaultExportFromCjs, a0 as v4, T as TextSelection$1, v as getMarkRange, aN as vClickOutside, aO as getActiveFormatting, aD as isInTable, 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-m2x13P8G.js";
13
+ import { ac, i, a9, aQ } from "./chunks/converter-m2x13P8G.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-C9r_Jbbg.js";
15
+ import { z, F, B, T, w, C, x } from "./chunks/editor-C9r_Jbbg.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-BglLOe8y.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-fnptYAcU.js";
18
18
  import AIWriter from "./ai-writer.es.js";
19
- import { D } from "./chunks/docx-zipper-C8lozSFd.js";
19
+ import { D } from "./chunks/docx-zipper-CRSKJF-o.js";
20
20
  import { createZip } from "./file-zipper.es.js";
21
21
  var eventemitter3 = { exports: {} };
22
22
  var hasRequiredEventemitter3;
@@ -5939,6 +5939,8 @@ const _hoisted_2 = {
5939
5939
  };
5940
5940
  const _hoisted_3 = { class: "placeholder-title" };
5941
5941
  const DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
5942
+ const TABLE_RESIZE_HOVER_THRESHOLD = 8;
5943
+ const TABLE_RESIZE_THROTTLE_MS = 16;
5942
5944
  const _sfc_main$1 = {
5943
5945
  __name: "SuperEditor",
5944
5946
  props: {
@@ -6008,7 +6010,58 @@ const _sfc_main$1 = {
6008
6010
  imageElement: null,
6009
6011
  blockId: null
6010
6012
  });
6013
+ let lastUpdateTableResizeTimestamp = 0;
6014
+ const isNearColumnBoundary = (event, tableElement) => {
6015
+ if (!event || typeof event.clientX !== "number" || typeof event.clientY !== "number") {
6016
+ console.warn("[isNearColumnBoundary] Invalid event: missing clientX or clientY", event);
6017
+ return false;
6018
+ }
6019
+ if (!tableElement || !(tableElement instanceof HTMLElement)) {
6020
+ console.warn("[isNearColumnBoundary] Invalid tableElement: not an HTMLElement", tableElement);
6021
+ return false;
6022
+ }
6023
+ const boundariesAttr = tableElement.getAttribute("data-table-boundaries");
6024
+ if (!boundariesAttr) return false;
6025
+ try {
6026
+ const metadata = JSON.parse(boundariesAttr);
6027
+ if (!metadata.columns || !Array.isArray(metadata.columns)) return false;
6028
+ const tableRect = tableElement.getBoundingClientRect();
6029
+ const mouseX = event.clientX - tableRect.left;
6030
+ const mouseY = event.clientY - tableRect.top;
6031
+ for (let i2 = 0; i2 < metadata.columns.length; i2++) {
6032
+ const col = metadata.columns[i2];
6033
+ const boundaryX = col.x + col.w;
6034
+ if (Math.abs(mouseX - boundaryX) <= TABLE_RESIZE_HOVER_THRESHOLD) {
6035
+ const segmentColIndex = i2 + 1;
6036
+ const segments = metadata.segments?.[segmentColIndex];
6037
+ if (!segments || segments.length === 0) {
6038
+ if (i2 === metadata.columns.length - 1) return true;
6039
+ continue;
6040
+ }
6041
+ for (const seg of segments) {
6042
+ const segTop = seg.y || 0;
6043
+ const segBottom = seg.h != null ? segTop + seg.h : tableRect.height;
6044
+ if (mouseY >= segTop && mouseY <= segBottom) {
6045
+ return true;
6046
+ }
6047
+ }
6048
+ }
6049
+ }
6050
+ if (Math.abs(mouseX) <= TABLE_RESIZE_HOVER_THRESHOLD) {
6051
+ return true;
6052
+ }
6053
+ return false;
6054
+ } catch (e) {
6055
+ console.warn("[isNearColumnBoundary] Failed to parse table boundary metadata:", e);
6056
+ return false;
6057
+ }
6058
+ };
6011
6059
  const updateTableResizeOverlay = (event) => {
6060
+ const now = Date.now();
6061
+ if (now - lastUpdateTableResizeTimestamp < TABLE_RESIZE_THROTTLE_MS) {
6062
+ return;
6063
+ }
6064
+ lastUpdateTableResizeTimestamp = now;
6012
6065
  if (!editorElem.value) return;
6013
6066
  let target = event.target;
6014
6067
  while (target && target !== editorElem.value) {
@@ -6016,8 +6069,13 @@ const _sfc_main$1 = {
6016
6069
  return;
6017
6070
  }
6018
6071
  if (target.classList?.contains("superdoc-table-fragment") && target.hasAttribute("data-table-boundaries")) {
6019
- tableResizeState.visible = true;
6020
- tableResizeState.tableElement = target;
6072
+ if (isNearColumnBoundary(event, target)) {
6073
+ tableResizeState.visible = true;
6074
+ tableResizeState.tableElement = target;
6075
+ } else {
6076
+ tableResizeState.visible = false;
6077
+ tableResizeState.tableElement = null;
6078
+ }
6021
6079
  return;
6022
6080
  }
6023
6081
  target = target.parentElement;
@@ -6344,7 +6402,7 @@ const _sfc_main$1 = {
6344
6402
  };
6345
6403
  }
6346
6404
  };
6347
- const SuperEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-08b32c3d"]]);
6405
+ const SuperEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-ed5a08ee"]]);
6348
6406
  const _hoisted_1 = ["innerHTML"];
6349
6407
  const _sfc_main = {
6350
6408
  __name: "SuperInput",
@@ -1,6 +1,6 @@
1
1
  import "vue";
2
- import { T } from "./chunks/toolbar-BglLOe8y.js";
3
- import "./chunks/editor-BXC2Hzba.js";
2
+ import { T } from "./chunks/toolbar-fnptYAcU.js";
3
+ import "./chunks/editor-C9r_Jbbg.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-C_Gk8cDd.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-B6lsvAAY.cjs");
4
4
  require("./chunks/vue-jWLMl8Ts.cjs");
5
5
  exports.AIWriter = superEditor_es.AIWriter;
6
6
  exports.AnnotatorHelpers = superEditor_es.AnnotatorHelpers;
@@ -1,4 +1,4 @@
1
- import { A, a, _, C, D, E, b, P, S, c, d, e, f, g, T, h, i, j, k, l, m, n, o, p, r, q } from "./chunks/super-editor.es-CHU4dmes.es.js";
1
+ import { A, a, _, C, D, E, b, P, S, c, d, e, f, g, T, h, i, j, k, l, m, n, o, p, r, q } from "./chunks/super-editor.es-C0tdU_gq.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-C_Gk8cDd.cjs");
4
- const superdoc = require("./chunks/index-k02voMEs.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-B6lsvAAY.cjs");
4
+ const superdoc = require("./chunks/index-DLco7m-w.cjs");
5
5
  const blankDocx = require("./chunks/blank-docx-DfW3Eeh2.cjs");
6
6
  exports.AnnotatorHelpers = superEditor_es.AnnotatorHelpers;
7
7
  exports.Editor = superEditor_es.Editor;
@@ -1,5 +1,5 @@
1
- import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-CHU4dmes.es.js";
2
- import { D, H, P, S as S2, m, l } from "./chunks/index-NPXppXmC.es.js";
1
+ import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-C0tdU_gq.es.js";
2
+ import { D, H, P, S as S2, m, l } from "./chunks/index-BSHAWPko.es.js";
3
3
  import { B } from "./chunks/blank-docx-ABm6XYAA.es.js";
4
4
  export {
5
5
  a as AnnotatorHelpers,
@@ -33486,7 +33486,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
33486
33486
  text2 = elements[0].text;
33487
33487
  const xmlSpace = encodedAttrs.xmlSpace ?? elements[0]?.attributes?.["xml:space"];
33488
33488
  if (xmlSpace !== "preserve" && typeof text2 === "string") {
33489
- text2 = text2.replace(/^\s+/, "").replace(/\s+$/, "");
33489
+ text2 = text2.replace(/^[ \t\n\r]+/, "").replace(/[ \t\n\r]+$/, "");
33490
33490
  }
33491
33491
  text2 = text2.replace(/\[\[sdspace\]\]/g, "");
33492
33492
  } else if (!elements.length && encodedAttrs.xmlSpace === "preserve") {
@@ -36389,7 +36389,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
36389
36389
  static getStoredSuperdocVersion(docx) {
36390
36390
  return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
36391
36391
  }
36392
- static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.19") {
36392
+ static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.20") {
36393
36393
  return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
36394
36394
  }
36395
36395
  /**
@@ -61363,7 +61363,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
61363
61363
  const shouldSkipNodeView = (editor) => {
61364
61364
  return isHeadless(editor);
61365
61365
  };
61366
- const summaryVersion = "1.0.0-beta.19";
61366
+ const summaryVersion = "1.0.0-beta.20";
61367
61367
  const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
61368
61368
  const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
61369
61369
  function mapAttributes(attrs) {
@@ -62139,7 +62139,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
62139
62139
  { default: remarkStringify2 },
62140
62140
  { default: remarkGfm2 }
62141
62141
  ] = await Promise.all([
62142
- Promise.resolve().then(() => indexCRpn1mWd),
62142
+ Promise.resolve().then(() => indexDHhKY9FZ),
62143
62143
  Promise.resolve().then(() => indexDRCvimau),
62144
62144
  Promise.resolve().then(() => indexC_x_N6Uh),
62145
62145
  Promise.resolve().then(() => indexD_sWOSiG),
@@ -62344,7 +62344,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
62344
62344
  * Process collaboration migrations
62345
62345
  */
62346
62346
  processCollaborationMigrations() {
62347
- console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.19");
62347
+ console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.20");
62348
62348
  if (!this.options.ydoc) return;
62349
62349
  const metaMap = this.options.ydoc.getMap("meta");
62350
62350
  let docVersion = metaMap.get("version");
@@ -64358,6 +64358,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
64358
64358
  run2.letterSpacing = spacing;
64359
64359
  }
64360
64360
  }
64361
+ if (typeof attrs.textTransform === "string") {
64362
+ const transform = attrs.textTransform;
64363
+ if (transform === "uppercase" || transform === "lowercase" || transform === "capitalize" || transform === "none") {
64364
+ run2.textTransform = transform;
64365
+ }
64366
+ }
64361
64367
  };
64362
64368
  const DEFAULT_HYPERLINK_CONFIG = {
64363
64369
  enableRichHyperlinks: false
@@ -66366,6 +66372,16 @@ Please report this to https://github.com/markedjs/marked.`, e) {
66366
66372
  const num = typeof value === "number" ? value : Number.parseInt(String(value), 10);
66367
66373
  return Number.isFinite(num) ? num : void 0;
66368
66374
  };
66375
+ const mergeSpacingSources = (base2, paragraphProps, attrs) => {
66376
+ const isObject2 = (v2) => v2 !== null && typeof v2 === "object";
66377
+ const baseObj = isObject2(base2) ? base2 : {};
66378
+ const propsObj = isObject2(paragraphProps) ? paragraphProps : {};
66379
+ const attrsObj = isObject2(attrs) ? attrs : {};
66380
+ if (Object.keys(baseObj).length === 0 && Object.keys(propsObj).length === 0 && Object.keys(attrsObj).length === 0) {
66381
+ return void 0;
66382
+ }
66383
+ return { ...baseObj, ...propsObj, ...attrsObj };
66384
+ };
66369
66385
  const normalizeNumFmt = (value) => {
66370
66386
  if (typeof value !== "string") return void 0;
66371
66387
  switch (value) {
@@ -66900,8 +66916,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
66900
66916
  const attrs = para.attrs ?? {};
66901
66917
  const paragraphProps = typeof attrs.paragraphProperties === "object" && attrs.paragraphProperties !== null ? attrs.paragraphProperties : {};
66902
66918
  const hydrated = hydrationOverride ?? hydrateParagraphStyleAttrs(para, converterContext);
66903
- const spacingSource = attrs.spacing !== void 0 ? attrs.spacing : paragraphProps.spacing !== void 0 ? paragraphProps.spacing : hydrated?.spacing;
66904
- const normalizedSpacing = normalizeParagraphSpacing(spacingSource);
66919
+ const mergedSpacing = mergeSpacingSources(hydrated?.spacing, paragraphProps.spacing, attrs.spacing);
66920
+ const normalizedSpacing = normalizeParagraphSpacing(mergedSpacing);
66905
66921
  const indentSource = attrs.indent ?? paragraphProps.indent ?? hydrated?.indent;
66906
66922
  const normalizedIndent = normalizePxIndent(indentSource) ?? normalizeParagraphIndent(indentSource ?? attrs.textIndent);
66907
66923
  const unwrapTabStops = (tabStops) => {
@@ -77320,6 +77336,12 @@ ${l}
77320
77336
  fromLine,
77321
77337
  toLine
77322
77338
  } = deps;
77339
+ const attrs = cell2?.attrs;
77340
+ const padding = attrs?.padding || { top: 2, left: 4, right: 4, bottom: 2 };
77341
+ const paddingLeft = padding.left ?? 4;
77342
+ const paddingTop = padding.top ?? 2;
77343
+ const paddingRight = padding.right ?? 4;
77344
+ const paddingBottom = padding.bottom ?? 2;
77323
77345
  const cellEl = doc2.createElement("div");
77324
77346
  cellEl.style.position = "absolute";
77325
77347
  cellEl.style.left = `${x2}px`;
@@ -77328,39 +77350,25 @@ ${l}
77328
77350
  cellEl.style.height = `${rowHeight}px`;
77329
77351
  cellEl.style.boxSizing = "border-box";
77330
77352
  cellEl.style.overflow = "hidden";
77353
+ cellEl.style.paddingLeft = `${paddingLeft}px`;
77354
+ cellEl.style.paddingTop = `${paddingTop}px`;
77355
+ cellEl.style.paddingRight = `${paddingRight}px`;
77356
+ cellEl.style.paddingBottom = `${paddingBottom}px`;
77331
77357
  if (borders) {
77332
77358
  applyCellBorders(cellEl, borders);
77333
77359
  }
77334
77360
  if (cell2?.attrs?.background) {
77335
77361
  cellEl.style.backgroundColor = cell2.attrs.background;
77336
77362
  }
77337
- if (cell2?.attrs?.verticalAlign) {
77338
- cellEl.style.display = "flex";
77339
- cellEl.style.flexDirection = "column";
77340
- cellEl.style.justifyContent = cell2.attrs.verticalAlign === "top" ? "flex-start" : cell2.attrs.verticalAlign === "bottom" ? "flex-end" : "center";
77341
- }
77342
- let contentElement;
77343
- const attrs = cell2?.attrs;
77344
- const padding = attrs?.padding || { top: 2, left: 4, right: 4, bottom: 2 };
77345
- const paddingLeft = padding.left ?? 4;
77346
- const paddingTop = padding.top ?? 2;
77347
- const paddingRight = padding.right ?? 4;
77348
- const paddingBottom = padding.bottom ?? 2;
77349
77363
  const cellBlocks = cell2?.blocks ?? (cell2?.paragraph ? [cell2.paragraph] : []);
77350
77364
  const blockMeasures = cellMeasure?.blocks ?? (cellMeasure?.paragraph ? [cellMeasure.paragraph] : []);
77351
77365
  if (cellBlocks.length > 0 && blockMeasures.length > 0) {
77352
77366
  const content2 = doc2.createElement("div");
77353
- content2.style.position = "absolute";
77354
- content2.style.left = `${x2 + paddingLeft}px`;
77355
- content2.style.top = `${y2 + paddingTop}px`;
77356
- const contentWidth = Math.max(0, cellMeasure.width - paddingLeft - paddingRight);
77357
- const contentHeight = Math.max(0, rowHeight - paddingTop - paddingBottom);
77358
- content2.style.width = `${contentWidth + 1}px`;
77359
- content2.style.height = `${contentHeight}px`;
77367
+ content2.style.position = "relative";
77368
+ content2.style.width = "100%";
77369
+ content2.style.height = "100%";
77360
77370
  content2.style.display = "flex";
77361
77371
  content2.style.flexDirection = "column";
77362
- content2.style.overflowX = "visible";
77363
- content2.style.overflowY = "hidden";
77364
77372
  if (cell2?.attrs?.verticalAlign === "center") {
77365
77373
  content2.style.justifyContent = "center";
77366
77374
  } else if (cell2?.attrs?.verticalAlign === "bottom") {
@@ -77368,6 +77376,7 @@ ${l}
77368
77376
  } else {
77369
77377
  content2.style.justifyContent = "flex-start";
77370
77378
  }
77379
+ cellEl.appendChild(content2);
77371
77380
  const blockLineCounts = [];
77372
77381
  for (let i2 = 0; i2 < Math.min(blockMeasures.length, cellBlocks.length); i2++) {
77373
77382
  const bm = blockMeasures[i2];
@@ -77419,14 +77428,19 @@ ${l}
77419
77428
  if (renderedHeight > 0) {
77420
77429
  paraWrapper.style.height = `${renderedHeight}px`;
77421
77430
  }
77431
+ if (renderedEntireBlock) {
77432
+ const spacingAfter = block.attrs?.spacing?.after;
77433
+ if (typeof spacingAfter === "number" && spacingAfter > 0) {
77434
+ paraWrapper.style.marginBottom = `${spacingAfter}px`;
77435
+ }
77436
+ }
77422
77437
  cumulativeLineCount += blockLineCount;
77423
77438
  } else {
77424
77439
  cumulativeLineCount += 0;
77425
77440
  }
77426
77441
  }
77427
- contentElement = content2;
77428
77442
  }
77429
- return { cellElement: cellEl, contentElement };
77443
+ return { cellElement: cellEl };
77430
77444
  };
77431
77445
  const renderTableRow = (deps) => {
77432
77446
  const {
@@ -77529,7 +77543,7 @@ ${l}
77529
77543
  }
77530
77544
  const fromLine = partialRow?.fromLineByCell?.[cellIndex];
77531
77545
  const toLine = partialRow?.toLineByCell?.[cellIndex];
77532
- const { cellElement, contentElement } = renderTableCell({
77546
+ const { cellElement } = renderTableCell({
77533
77547
  doc: doc2,
77534
77548
  x: x2,
77535
77549
  y: y2,
@@ -77544,9 +77558,6 @@ ${l}
77544
77558
  toLine
77545
77559
  });
77546
77560
  container.appendChild(cellElement);
77547
- if (contentElement) {
77548
- container.appendChild(contentElement);
77549
- }
77550
77561
  }
77551
77562
  };
77552
77563
  const renderTableFragment = (deps) => {
@@ -80389,6 +80400,9 @@ ${l}
80389
80400
  if (run2.highlight) {
80390
80401
  element2.style.backgroundColor = run2.highlight;
80391
80402
  }
80403
+ if (run2.textTransform) {
80404
+ element2.style.textTransform = run2.textTransform;
80405
+ }
80392
80406
  const decorations = [];
80393
80407
  if (run2.underline) {
80394
80408
  decorations.push("underline");
@@ -81505,11 +81519,18 @@ ${l}
81505
81519
  const blockMeasures = [];
81506
81520
  let contentHeight = 0;
81507
81521
  const cellBlocks = cell2.blocks ?? (cell2.paragraph ? [cell2.paragraph] : []);
81508
- for (const block2 of cellBlocks) {
81522
+ for (let blockIndex = 0; blockIndex < cellBlocks.length; blockIndex++) {
81523
+ const block2 = cellBlocks[blockIndex];
81509
81524
  const measure = await measureBlock(block2, { maxWidth: contentWidth, maxHeight: Infinity });
81510
81525
  blockMeasures.push(measure);
81511
81526
  const blockHeight = "totalHeight" in measure ? measure.totalHeight : "height" in measure ? measure.height : 0;
81512
81527
  contentHeight += blockHeight;
81528
+ if (block2.kind === "paragraph") {
81529
+ const spacingAfter = block2.attrs?.spacing?.after;
81530
+ if (typeof spacingAfter === "number" && spacingAfter > 0) {
81531
+ contentHeight += spacingAfter;
81532
+ }
81533
+ }
81513
81534
  }
81514
81535
  const totalCellHeight = contentHeight + paddingTop + paddingBottom;
81515
81536
  cellMeasures.push({
@@ -121845,6 +121866,8 @@ ${style2}
121845
121866
  };
121846
121867
  const _hoisted_3$8 = { class: "placeholder-title" };
121847
121868
  const DOCX$1 = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
121869
+ const TABLE_RESIZE_HOVER_THRESHOLD = 8;
121870
+ const TABLE_RESIZE_THROTTLE_MS = 16;
121848
121871
  const _sfc_main$1$1 = {
121849
121872
  __name: "SuperEditor",
121850
121873
  props: {
@@ -121914,7 +121937,58 @@ ${style2}
121914
121937
  imageElement: null,
121915
121938
  blockId: null
121916
121939
  });
121940
+ let lastUpdateTableResizeTimestamp = 0;
121941
+ const isNearColumnBoundary = (event, tableElement) => {
121942
+ if (!event || typeof event.clientX !== "number" || typeof event.clientY !== "number") {
121943
+ console.warn("[isNearColumnBoundary] Invalid event: missing clientX or clientY", event);
121944
+ return false;
121945
+ }
121946
+ if (!tableElement || !(tableElement instanceof HTMLElement)) {
121947
+ console.warn("[isNearColumnBoundary] Invalid tableElement: not an HTMLElement", tableElement);
121948
+ return false;
121949
+ }
121950
+ const boundariesAttr = tableElement.getAttribute("data-table-boundaries");
121951
+ if (!boundariesAttr) return false;
121952
+ try {
121953
+ const metadata = JSON.parse(boundariesAttr);
121954
+ if (!metadata.columns || !Array.isArray(metadata.columns)) return false;
121955
+ const tableRect = tableElement.getBoundingClientRect();
121956
+ const mouseX = event.clientX - tableRect.left;
121957
+ const mouseY = event.clientY - tableRect.top;
121958
+ for (let i2 = 0; i2 < metadata.columns.length; i2++) {
121959
+ const col = metadata.columns[i2];
121960
+ const boundaryX = col.x + col.w;
121961
+ if (Math.abs(mouseX - boundaryX) <= TABLE_RESIZE_HOVER_THRESHOLD) {
121962
+ const segmentColIndex = i2 + 1;
121963
+ const segments = metadata.segments?.[segmentColIndex];
121964
+ if (!segments || segments.length === 0) {
121965
+ if (i2 === metadata.columns.length - 1) return true;
121966
+ continue;
121967
+ }
121968
+ for (const seg of segments) {
121969
+ const segTop = seg.y || 0;
121970
+ const segBottom = seg.h != null ? segTop + seg.h : tableRect.height;
121971
+ if (mouseY >= segTop && mouseY <= segBottom) {
121972
+ return true;
121973
+ }
121974
+ }
121975
+ }
121976
+ }
121977
+ if (Math.abs(mouseX) <= TABLE_RESIZE_HOVER_THRESHOLD) {
121978
+ return true;
121979
+ }
121980
+ return false;
121981
+ } catch (e) {
121982
+ console.warn("[isNearColumnBoundary] Failed to parse table boundary metadata:", e);
121983
+ return false;
121984
+ }
121985
+ };
121917
121986
  const updateTableResizeOverlay = (event) => {
121987
+ const now = Date.now();
121988
+ if (now - lastUpdateTableResizeTimestamp < TABLE_RESIZE_THROTTLE_MS) {
121989
+ return;
121990
+ }
121991
+ lastUpdateTableResizeTimestamp = now;
121918
121992
  if (!editorElem.value) return;
121919
121993
  let target = event.target;
121920
121994
  while (target && target !== editorElem.value) {
@@ -121922,8 +121996,13 @@ ${style2}
121922
121996
  return;
121923
121997
  }
121924
121998
  if (target.classList?.contains("superdoc-table-fragment") && target.hasAttribute("data-table-boundaries")) {
121925
- tableResizeState.visible = true;
121926
- tableResizeState.tableElement = target;
121999
+ if (isNearColumnBoundary(event, target)) {
122000
+ tableResizeState.visible = true;
122001
+ tableResizeState.tableElement = target;
122002
+ } else {
122003
+ tableResizeState.visible = false;
122004
+ tableResizeState.tableElement = null;
122005
+ }
121927
122006
  return;
121928
122007
  }
121929
122008
  target = target.parentElement;
@@ -122250,7 +122329,7 @@ ${style2}
122250
122329
  };
122251
122330
  }
122252
122331
  };
122253
- const SuperEditor = /* @__PURE__ */ _export_sfc$1(_sfc_main$1$1, [["__scopeId", "data-v-08b32c3d"]]);
122332
+ const SuperEditor = /* @__PURE__ */ _export_sfc$1(_sfc_main$1$1, [["__scopeId", "data-v-ed5a08ee"]]);
122254
122333
  const _hoisted_1$h = ["innerHTML"];
122255
122334
  const _sfc_main$i = {
122256
122335
  __name: "SuperInput",
@@ -139397,7 +139476,7 @@ ${style2}
139397
139476
  this.config.colors = shuffleArray(this.config.colors);
139398
139477
  this.userColorMap = /* @__PURE__ */ new Map();
139399
139478
  this.colorIndex = 0;
139400
- this.version = "1.0.0-beta.19";
139479
+ this.version = "1.0.0-beta.20";
139401
139480
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
139402
139481
  this.superdocId = config2.superdocId || v4();
139403
139482
  this.colors = this.config.colors;
@@ -141840,7 +141919,7 @@ ${style2}
141840
141919
  value && typeof value === "object" && "byteLength" in value && "byteOffset" in value
141841
141920
  );
141842
141921
  }
141843
- const indexCRpn1mWd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
141922
+ const indexDHhKY9FZ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
141844
141923
  __proto__: null,
141845
141924
  unified
141846
141925
  }, Symbol.toStringTag, { value: "Module" }));