@harbour-enterprises/superdoc 1.15.0-next.25 → 1.15.0-next.26

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.
@@ -32457,9 +32457,44 @@ function translateContentBlock(params) {
32457
32457
  if (vmlAttributes || horizontalRule) return translateVRectContentBlock(params);
32458
32458
  return wrapTextInRun(translator$24.decode(params));
32459
32459
  }
32460
+ var FULL_WIDTH_PT = "468pt";
32461
+ var FULL_WIDTH_PT_VALUE = 468;
32462
+ var PX_PER_PT = 1.33;
32463
+ function pxToPt(px) {
32464
+ return `${Math.round(px / PX_PER_PT * 10) / 10}pt`;
32465
+ }
32466
+ function sizeToPt(value, options = {}) {
32467
+ const { allowPercent = false } = options;
32468
+ if (typeof value === "number") return Number.isFinite(value) ? pxToPt(value) : null;
32469
+ if (typeof value !== "string") return null;
32470
+ const trimmed = value.trim();
32471
+ if (!trimmed) return null;
32472
+ if (allowPercent && trimmed.endsWith("%")) {
32473
+ const percent = Number.parseFloat(trimmed.slice(0, -1));
32474
+ if (!Number.isFinite(percent) || percent <= 0) return null;
32475
+ if (percent >= 100) return FULL_WIDTH_PT;
32476
+ return `${Math.round(FULL_WIDTH_PT_VALUE * percent / 100 * 10) / 10}pt`;
32477
+ }
32478
+ const normalized = trimmed.endsWith("px") ? trimmed.slice(0, -2) : trimmed;
32479
+ const px = Number.parseFloat(normalized);
32480
+ if (!Number.isFinite(px)) return null;
32481
+ return pxToPt(px);
32482
+ }
32483
+ function synthesizeVmlStyle(size) {
32484
+ const parts = [];
32485
+ if (size.width != null) {
32486
+ const widthPt = sizeToPt(size.width, { allowPercent: true });
32487
+ if (widthPt) parts.push(`width:${widthPt}`);
32488
+ }
32489
+ if (size.height != null) {
32490
+ const heightPt = sizeToPt(size.height);
32491
+ if (heightPt) parts.push(`height:${heightPt}`);
32492
+ }
32493
+ return parts.join(";");
32494
+ }
32460
32495
  function translateVRectContentBlock(params) {
32461
32496
  const { node } = params;
32462
- const { vmlAttributes, background, attributes, style } = node.attrs;
32497
+ const { horizontalRule, vmlAttributes, background, attributes, style, size } = node.attrs;
32463
32498
  const rectAttrs = { id: attributes?.id || `_x0000_i${Math.floor(Math.random() * 1e4)}` };
32464
32499
  if (style) rectAttrs.style = style;
32465
32500
  if (background) rectAttrs.fillcolor = background;
@@ -32472,6 +32507,16 @@ function translateVRectContentBlock(params) {
32472
32507
  if (attributes) Object.entries(attributes).forEach(([key, value]) => {
32473
32508
  if (!rectAttrs[key] && value !== void 0) rectAttrs[key] = value;
32474
32509
  });
32510
+ if (!rectAttrs.style && horizontalRule && size) {
32511
+ const synthesized = synthesizeVmlStyle(size);
32512
+ if (synthesized) rectAttrs.style = synthesized;
32513
+ }
32514
+ if (horizontalRule) {
32515
+ if (rectAttrs["o:hr"] == null) rectAttrs["o:hr"] = "t";
32516
+ if (rectAttrs["o:hrstd"] == null) rectAttrs["o:hrstd"] = "t";
32517
+ if (rectAttrs["o:hralign"] == null) rectAttrs["o:hralign"] = "center";
32518
+ if (rectAttrs.stroked == null) rectAttrs.stroked = "f";
32519
+ }
32475
32520
  const rect = {
32476
32521
  name: "v:rect",
32477
32522
  attributes: rectAttrs
@@ -33908,7 +33953,7 @@ var SuperConverter = class SuperConverter {
33908
33953
  static getStoredSuperdocVersion(docx) {
33909
33954
  return SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
33910
33955
  }
33911
- static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.15.0-next.25") {
33956
+ static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.15.0-next.26") {
33912
33957
  return SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
33913
33958
  }
33914
33959
  static generateWordTimestamp() {
@@ -32442,9 +32442,44 @@ function translateContentBlock(params) {
32442
32442
  if (vmlAttributes || horizontalRule) return translateVRectContentBlock(params);
32443
32443
  return wrapTextInRun(translator$24.decode(params));
32444
32444
  }
32445
+ var FULL_WIDTH_PT = "468pt";
32446
+ var FULL_WIDTH_PT_VALUE = 468;
32447
+ var PX_PER_PT = 1.33;
32448
+ function pxToPt(px) {
32449
+ return `${Math.round(px / PX_PER_PT * 10) / 10}pt`;
32450
+ }
32451
+ function sizeToPt(value, options = {}) {
32452
+ const { allowPercent = false } = options;
32453
+ if (typeof value === "number") return Number.isFinite(value) ? pxToPt(value) : null;
32454
+ if (typeof value !== "string") return null;
32455
+ const trimmed = value.trim();
32456
+ if (!trimmed) return null;
32457
+ if (allowPercent && trimmed.endsWith("%")) {
32458
+ const percent = Number.parseFloat(trimmed.slice(0, -1));
32459
+ if (!Number.isFinite(percent) || percent <= 0) return null;
32460
+ if (percent >= 100) return FULL_WIDTH_PT;
32461
+ return `${Math.round(FULL_WIDTH_PT_VALUE * percent / 100 * 10) / 10}pt`;
32462
+ }
32463
+ const normalized = trimmed.endsWith("px") ? trimmed.slice(0, -2) : trimmed;
32464
+ const px = Number.parseFloat(normalized);
32465
+ if (!Number.isFinite(px)) return null;
32466
+ return pxToPt(px);
32467
+ }
32468
+ function synthesizeVmlStyle(size) {
32469
+ const parts = [];
32470
+ if (size.width != null) {
32471
+ const widthPt = sizeToPt(size.width, { allowPercent: true });
32472
+ if (widthPt) parts.push(`width:${widthPt}`);
32473
+ }
32474
+ if (size.height != null) {
32475
+ const heightPt = sizeToPt(size.height);
32476
+ if (heightPt) parts.push(`height:${heightPt}`);
32477
+ }
32478
+ return parts.join(";");
32479
+ }
32445
32480
  function translateVRectContentBlock(params) {
32446
32481
  const { node } = params;
32447
- const { vmlAttributes, background, attributes, style } = node.attrs;
32482
+ const { horizontalRule, vmlAttributes, background, attributes, style, size } = node.attrs;
32448
32483
  const rectAttrs = { id: attributes?.id || `_x0000_i${Math.floor(Math.random() * 1e4)}` };
32449
32484
  if (style) rectAttrs.style = style;
32450
32485
  if (background) rectAttrs.fillcolor = background;
@@ -32457,6 +32492,16 @@ function translateVRectContentBlock(params) {
32457
32492
  if (attributes) Object.entries(attributes).forEach(([key, value]) => {
32458
32493
  if (!rectAttrs[key] && value !== void 0) rectAttrs[key] = value;
32459
32494
  });
32495
+ if (!rectAttrs.style && horizontalRule && size) {
32496
+ const synthesized = synthesizeVmlStyle(size);
32497
+ if (synthesized) rectAttrs.style = synthesized;
32498
+ }
32499
+ if (horizontalRule) {
32500
+ if (rectAttrs["o:hr"] == null) rectAttrs["o:hr"] = "t";
32501
+ if (rectAttrs["o:hrstd"] == null) rectAttrs["o:hrstd"] = "t";
32502
+ if (rectAttrs["o:hralign"] == null) rectAttrs["o:hralign"] = "center";
32503
+ if (rectAttrs.stroked == null) rectAttrs.stroked = "f";
32504
+ }
32460
32505
  const rect = {
32461
32506
  name: "v:rect",
32462
32507
  attributes: rectAttrs
@@ -33890,7 +33935,7 @@ var SuperConverter = class SuperConverter {
33890
33935
  static getStoredSuperdocVersion(docx) {
33891
33936
  return SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
33892
33937
  }
33893
- static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.15.0-next.25") {
33938
+ static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.15.0-next.26") {
33894
33939
  return SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
33895
33940
  }
33896
33941
  static generateWordTimestamp() {
@@ -1,5 +1,5 @@
1
1
  import { a as __toCommonJS, n as __esmMin, r as __export, t as __commonJSMin } from "./rolldown-runtime-B2q5OVn9.es.js";
2
- import { $ as TextSelection$1, A as findMark, At as Mark$1, B as defaultBlockAt$1, C as docxNumberingHelpers, Ct as TrackDeleteMarkName, D as posToDOMRect, Dt as DOMParser$1, E as isInTable, Et as carbonCopy, F as isMarkActive, Ft as getExtensionConfigField, G as createDocument, H as getNodeType, I as getMarkRange, J as NodeSelection, K as AllSelection, L as isTextSelection, M as isActive, Mt as Slice, N as isNodeActive, Nt as minMax, O as findChildren$1, Ot as DOMSerializer, P as getSchemaTypeNameByName, Pt as callOrGet, Q as SelectionRange, R as findParentNode, S as getResolvedParagraphProperties, St as getUnderlineCssString, T as CommandService, Tt as TrackInsertMarkName, U as cleanSchemaItem, V as getMarkType, W as getSchemaTypeByName, X as PluginKey, Y as Plugin, Z as Selection, _ as ListHelpers, _t as encodeMarksFromRPr, a as _getReferencedTableStyles, at as Transform, b as isList, bt as resolveRunProperties, c as processContent, ct as dropPoint, d as createCellBorders, dt as replaceStep$1, et as AddMarkStep, f as InputRule, ft as generateDocxRandomId, g as unflattenListsInHtml, gt as encodeCSSFromRPr, h as inputRulesPlugin, ht as encodeCSSFromPPr, it as ReplaceStep, j as getMarksFromSelection, jt as Schema$1, k as getActiveFormatting, kt as Fragment$1, l as createDocFromMarkdown, lt as joinPoint, m as htmlHandler, mt as decodeRPrFromMarks, n as kebabCase$1, nt as RemoveMarkStep, o as helpers_exports, ot as canJoin, p as handleClipboardPaste, pt as generateRandomSigned32BitIntStrId, q as EditorState, r as insertNewRelationship, rt as ReplaceAroundStep$1, s as updateDOMAttributes, st as canSplit, t as SuperConverter, tt as Mapping, u as createDocFromHTML, ut as liftTarget, v as changeListLevel, vt as resolveDocxFontFamily, w as generateOrderedListIndex, wt as TrackFormatMarkName, x as calculateResolvedParagraphProperties, xt as resolveTableCellProperties, y as updateNumberingProperties, yt as resolveParagraphProperties, z as findParentNodeClosestToPos } from "./SuperConverter-DDdU4Vd0.es.js";
2
+ import { $ as TextSelection$1, A as findMark, At as Mark$1, B as defaultBlockAt$1, C as docxNumberingHelpers, Ct as TrackDeleteMarkName, D as posToDOMRect, Dt as DOMParser$1, E as isInTable, Et as carbonCopy, F as isMarkActive, Ft as getExtensionConfigField, G as createDocument, H as getNodeType, I as getMarkRange, J as NodeSelection, K as AllSelection, L as isTextSelection, M as isActive, Mt as Slice, N as isNodeActive, Nt as minMax, O as findChildren$1, Ot as DOMSerializer, P as getSchemaTypeNameByName, Pt as callOrGet, Q as SelectionRange, R as findParentNode, S as getResolvedParagraphProperties, St as getUnderlineCssString, T as CommandService, Tt as TrackInsertMarkName, U as cleanSchemaItem, V as getMarkType, W as getSchemaTypeByName, X as PluginKey, Y as Plugin, Z as Selection, _ as ListHelpers, _t as encodeMarksFromRPr, a as _getReferencedTableStyles, at as Transform, b as isList, bt as resolveRunProperties, c as processContent, ct as dropPoint, d as createCellBorders, dt as replaceStep$1, et as AddMarkStep, f as InputRule, ft as generateDocxRandomId, g as unflattenListsInHtml, gt as encodeCSSFromRPr, h as inputRulesPlugin, ht as encodeCSSFromPPr, it as ReplaceStep, j as getMarksFromSelection, jt as Schema$1, k as getActiveFormatting, kt as Fragment$1, l as createDocFromMarkdown, lt as joinPoint, m as htmlHandler, mt as decodeRPrFromMarks, n as kebabCase$1, nt as RemoveMarkStep, o as helpers_exports, ot as canJoin, p as handleClipboardPaste, pt as generateRandomSigned32BitIntStrId, q as EditorState, r as insertNewRelationship, rt as ReplaceAroundStep$1, s as updateDOMAttributes, st as canSplit, t as SuperConverter, tt as Mapping, u as createDocFromHTML, ut as liftTarget, v as changeListLevel, vt as resolveDocxFontFamily, w as generateOrderedListIndex, wt as TrackFormatMarkName, x as calculateResolvedParagraphProperties, xt as resolveTableCellProperties, y as updateNumberingProperties, yt as resolveParagraphProperties, z as findParentNodeClosestToPos } from "./SuperConverter-Dz7jNJpY.es.js";
3
3
  import { a as init_dist$2, i as global, n as init_dist, o as Buffer$3, r as process$1, s as init_dist$1 } from "./jszip-ChlR43oI.es.js";
4
4
  import { t as v4_default } from "./uuid-2IzDu5nl.es.js";
5
5
  import { A as twipsToLines, T as resolveOpcTargetPath, c as getArrayBufferFromUrl, f as halfPointToPoints, g as linesToTwips, j as twipsToPixels, k as twipsToInches, m as inchesToTwips, p as inchesToPixels, r as convertSizeToCSS, w as ptToTwips, x as pixelsToTwips } from "./helpers-BGD_wEOi.es.js";
@@ -242,7 +242,7 @@ var v_click_outside_default = {
242
242
  var DEFAULT_ENDPOINT = "https://ingest.superdoc.dev/v1/collect";
243
243
  function getSuperdocVersion() {
244
244
  try {
245
- return "1.15.0-next.25";
245
+ return "1.15.0-next.26";
246
246
  } catch {
247
247
  return "unknown";
248
248
  }
@@ -20672,7 +20672,7 @@ const canUseDOM = () => {
20672
20672
  return false;
20673
20673
  }
20674
20674
  };
20675
- var summaryVersion = "1.15.0-next.25";
20675
+ var summaryVersion = "1.15.0-next.26";
20676
20676
  var nodeKeys = [
20677
20677
  "group",
20678
20678
  "content",
@@ -24468,23 +24468,107 @@ function mapFootnoteRefNode(candidate) {
24468
24468
  properties: { noteId: typeof attrs.id === "string" ? attrs.id : void 0 }
24469
24469
  };
24470
24470
  }
24471
+ function parseBooleanToken(value) {
24472
+ const normalized = value.trim().toLowerCase();
24473
+ if (!normalized) return void 0;
24474
+ if (normalized === "0" || normalized === "false" || normalized === "off" || normalized === "none") return false;
24475
+ if (normalized === "1" || normalized === "true" || normalized === "on" || normalized === "single") return true;
24476
+ }
24477
+ function resolveBooleanLike(value) {
24478
+ if (typeof value === "boolean") return value;
24479
+ if (typeof value === "number") return value !== 0;
24480
+ if (typeof value === "string") return parseBooleanToken(value);
24481
+ if (value && typeof value === "object") {
24482
+ const record = value;
24483
+ const explicit = resolveBooleanLike(record.val ?? record.value ?? record.type ?? record["w:val"] ?? record["w:value"]);
24484
+ if (explicit != null) return explicit;
24485
+ return true;
24486
+ }
24487
+ }
24488
+ function resolveUnderlineLike(values) {
24489
+ for (const value of values) {
24490
+ if (value == null) continue;
24491
+ if (typeof value === "string") {
24492
+ const normalized = value.trim().toLowerCase();
24493
+ if (!normalized) continue;
24494
+ return normalized !== "none" && normalized !== "false" && normalized !== "0";
24495
+ }
24496
+ const resolved = resolveBooleanLike(value);
24497
+ if (resolved != null) return resolved;
24498
+ }
24499
+ }
24500
+ function resolveColorValue(value) {
24501
+ if (typeof value === "string") return value;
24502
+ if (value && typeof value === "object") {
24503
+ const record = value;
24504
+ if (typeof record.val === "string") return record.val;
24505
+ if (typeof record.value === "string") return record.value;
24506
+ if (typeof record["w:val"] === "string") return record["w:val"];
24507
+ }
24508
+ }
24509
+ function resolveHighlightValue(value) {
24510
+ if (typeof value === "string") return value;
24511
+ if (value && typeof value === "object") {
24512
+ const record = value;
24513
+ const highlightValue = record.val ?? record.value ?? record["w:val"];
24514
+ if (typeof highlightValue === "string") {
24515
+ const normalized = highlightValue.trim();
24516
+ if (!normalized) return void 0;
24517
+ if (normalized.toLowerCase() === "none") return "transparent";
24518
+ return normalized;
24519
+ }
24520
+ const fill = record.fill ?? record["w:fill"];
24521
+ if (typeof fill === "string") {
24522
+ const normalized = fill.trim();
24523
+ if (!normalized || normalized.toLowerCase() === "auto") return void 0;
24524
+ return normalized.startsWith("#") ? normalized : `#${normalized}`;
24525
+ }
24526
+ }
24527
+ }
24528
+ function resolveFontValue(runProperties) {
24529
+ const fromRFonts = runProperties.rFonts;
24530
+ if (fromRFonts && typeof fromRFonts === "object") {
24531
+ const fonts = fromRFonts;
24532
+ const selected = fonts.ascii ?? fonts.hAnsi ?? fonts.eastAsia ?? fonts.cs;
24533
+ if (typeof selected === "string") return selected;
24534
+ }
24535
+ const fromFontFamily = runProperties.fontFamily;
24536
+ if (typeof fromFontFamily === "string") return fromFontFamily;
24537
+ if (fromFontFamily && typeof fromFontFamily === "object") {
24538
+ const fonts = fromFontFamily;
24539
+ const selected = fonts.ascii ?? fonts.hAnsi ?? fonts.eastAsia ?? fonts.cs;
24540
+ if (typeof selected === "string") return selected;
24541
+ }
24542
+ }
24543
+ function resolveFontSizeValue(runProperties) {
24544
+ const candidate = runProperties.sz ?? runProperties.size ?? runProperties.fontSize;
24545
+ if (typeof candidate === "number") return candidate;
24546
+ if (typeof candidate === "string") {
24547
+ const parsed = Number.parseFloat(candidate);
24548
+ return Number.isFinite(parsed) ? parsed : void 0;
24549
+ }
24550
+ }
24471
24551
  function mapRunNode(candidate) {
24472
- const runProperties = (candidate.node?.attrs ?? candidate.attrs ?? {}).runProperties ?? void 0;
24473
- const underline = Boolean(runProperties?.underline === true || runProperties?.u?.val === "single" || typeof runProperties?.underline === "object" && typeof runProperties?.underline?.val === "string" && runProperties.underline.val !== "none");
24474
- const font = runProperties?.rFonts?.ascii ?? runProperties?.rFonts?.hAnsi ?? runProperties?.rFonts?.eastAsia ?? runProperties?.rFonts?.cs;
24552
+ const attrs = candidate.node?.attrs ?? candidate.attrs ?? {};
24553
+ const runProperties = attrs.runProperties && typeof attrs.runProperties === "object" ? attrs.runProperties : void 0;
24554
+ const underline = resolveUnderlineLike([runProperties?.underline, runProperties?.u]);
24555
+ const strike = resolveBooleanLike(runProperties?.strike) ?? resolveBooleanLike(runProperties?.dstrike) ?? void 0;
24556
+ const languageRaw = runProperties?.lang;
24557
+ const language = typeof languageRaw === "string" ? languageRaw : languageRaw && typeof languageRaw === "object" && typeof languageRaw.val === "string" ? languageRaw.val : void 0;
24475
24558
  return {
24476
24559
  nodeType: "run",
24477
24560
  kind: "inline",
24478
24561
  properties: {
24479
- bold: runProperties?.bold ?? void 0,
24480
- italic: runProperties?.italic ?? void 0,
24481
- underline: underline || void 0,
24482
- font: typeof font === "string" ? font : void 0,
24483
- size: typeof runProperties?.sz === "number" ? runProperties.sz : void 0,
24484
- color: runProperties?.color?.val ?? void 0,
24485
- highlight: runProperties?.highlight ?? void 0,
24486
- styleId: runProperties?.rStyle ?? void 0,
24487
- language: runProperties?.lang?.val ?? void 0
24562
+ bold: resolveBooleanLike(runProperties?.bold) ?? void 0,
24563
+ italic: resolveBooleanLike(runProperties?.italic) ?? void 0,
24564
+ underline: underline ?? void 0,
24565
+ strike,
24566
+ font: runProperties ? resolveFontValue(runProperties) : void 0,
24567
+ size: runProperties ? resolveFontSizeValue(runProperties) : void 0,
24568
+ color: resolveColorValue(runProperties?.color),
24569
+ highlight: resolveHighlightValue(runProperties?.highlight),
24570
+ styleId: typeof runProperties?.rStyle === "string" ? runProperties.rStyle : typeof runProperties?.styleId === "string" ? runProperties.styleId : void 0,
24571
+ language
24488
24572
  }
24489
24573
  };
24490
24574
  }
@@ -27078,7 +27162,7 @@ var Editor = class Editor extends EventEmitter$1 {
27078
27162
  return migrations.length > 0;
27079
27163
  }
27080
27164
  processCollaborationMigrations() {
27081
- console.debug("[checkVersionMigrations] Current editor version", "1.15.0-next.25");
27165
+ console.debug("[checkVersionMigrations] Current editor version", "1.15.0-next.26");
27082
27166
  if (!this.options.ydoc) return;
27083
27167
  let docVersion = this.options.ydoc.getMap("meta").get("version");
27084
27168
  if (!docVersion) docVersion = "initial";
@@ -70642,6 +70726,16 @@ const ShapeTextbox = Node$1.create({
70642
70726
  ];
70643
70727
  }
70644
70728
  });
70729
+ function createDefaultHorizontalRuleAttrs() {
70730
+ return {
70731
+ horizontalRule: true,
70732
+ size: {
70733
+ width: "100%",
70734
+ height: 2
70735
+ },
70736
+ background: "#e5e7eb"
70737
+ };
70738
+ }
70645
70739
  const ContentBlock = Node$1.create({
70646
70740
  name: "contentBlock",
70647
70741
  group: "inline",
@@ -70698,7 +70792,13 @@ const ContentBlock = Node$1.create({
70698
70792
  };
70699
70793
  },
70700
70794
  parseDOM() {
70701
- return [{ tag: `div[data-type="${this.name}"]` }];
70795
+ return [{
70796
+ tag: `div[data-type="${this.name}"]`,
70797
+ priority: 60
70798
+ }, {
70799
+ tag: "hr",
70800
+ getAttrs: () => createDefaultHorizontalRuleAttrs()
70801
+ }];
70702
70802
  },
70703
70803
  renderDOM({ htmlAttributes }) {
70704
70804
  return ["div", Attribute.mergeAttributes(this.options.htmlAttributes, htmlAttributes, { "data-type": this.name })];
@@ -70708,14 +70808,7 @@ const ContentBlock = Node$1.create({
70708
70808
  insertHorizontalRule: () => ({ commands: commands$1 }) => {
70709
70809
  return commands$1.insertContent({
70710
70810
  type: this.name,
70711
- attrs: {
70712
- horizontalRule: true,
70713
- size: {
70714
- width: "100%",
70715
- height: 2
70716
- },
70717
- background: "#e5e7eb"
70718
- }
70811
+ attrs: createDefaultHorizontalRuleAttrs()
70719
70812
  });
70720
70813
  },
70721
70814
  insertContentBlock: (config) => ({ commands: commands$1 }) => {
@@ -1,5 +1,5 @@
1
1
  const require_rolldown_runtime = require("./rolldown-runtime-Dp2H1eGw.cjs");
2
- const require_SuperConverter = require("./SuperConverter-BahRv-GR.cjs");
2
+ const require_SuperConverter = require("./SuperConverter-DvOu0a_D.cjs");
3
3
  const require_jszip = require("./jszip-DCT9QYaK.cjs");
4
4
  const require_uuid = require("./uuid-CHj_rjgt.cjs");
5
5
  const require_helpers = require("./helpers-Cs_Zz44i.cjs");
@@ -243,7 +243,7 @@ var DEFAULT_ENDPOINT = "https://ingest.superdoc.dev/v1/collect";
243
243
  const COMMUNITY_LICENSE_KEY = "community-and-eval-agplv3";
244
244
  function getSuperdocVersion() {
245
245
  try {
246
- return "1.15.0-next.25";
246
+ return "1.15.0-next.26";
247
247
  } catch {
248
248
  return "unknown";
249
249
  }
@@ -20691,7 +20691,7 @@ const canUseDOM = () => {
20691
20691
  return false;
20692
20692
  }
20693
20693
  };
20694
- var summaryVersion = "1.15.0-next.25";
20694
+ var summaryVersion = "1.15.0-next.26";
20695
20695
  var nodeKeys = [
20696
20696
  "group",
20697
20697
  "content",
@@ -24704,23 +24704,107 @@ function mapFootnoteRefNode(candidate) {
24704
24704
  properties: { noteId: typeof attrs.id === "string" ? attrs.id : void 0 }
24705
24705
  };
24706
24706
  }
24707
+ function parseBooleanToken(value) {
24708
+ const normalized = value.trim().toLowerCase();
24709
+ if (!normalized) return void 0;
24710
+ if (normalized === "0" || normalized === "false" || normalized === "off" || normalized === "none") return false;
24711
+ if (normalized === "1" || normalized === "true" || normalized === "on" || normalized === "single") return true;
24712
+ }
24713
+ function resolveBooleanLike(value) {
24714
+ if (typeof value === "boolean") return value;
24715
+ if (typeof value === "number") return value !== 0;
24716
+ if (typeof value === "string") return parseBooleanToken(value);
24717
+ if (value && typeof value === "object") {
24718
+ const record = value;
24719
+ const explicit = resolveBooleanLike(record.val ?? record.value ?? record.type ?? record["w:val"] ?? record["w:value"]);
24720
+ if (explicit != null) return explicit;
24721
+ return true;
24722
+ }
24723
+ }
24724
+ function resolveUnderlineLike(values) {
24725
+ for (const value of values) {
24726
+ if (value == null) continue;
24727
+ if (typeof value === "string") {
24728
+ const normalized = value.trim().toLowerCase();
24729
+ if (!normalized) continue;
24730
+ return normalized !== "none" && normalized !== "false" && normalized !== "0";
24731
+ }
24732
+ const resolved = resolveBooleanLike(value);
24733
+ if (resolved != null) return resolved;
24734
+ }
24735
+ }
24736
+ function resolveColorValue(value) {
24737
+ if (typeof value === "string") return value;
24738
+ if (value && typeof value === "object") {
24739
+ const record = value;
24740
+ if (typeof record.val === "string") return record.val;
24741
+ if (typeof record.value === "string") return record.value;
24742
+ if (typeof record["w:val"] === "string") return record["w:val"];
24743
+ }
24744
+ }
24745
+ function resolveHighlightValue(value) {
24746
+ if (typeof value === "string") return value;
24747
+ if (value && typeof value === "object") {
24748
+ const record = value;
24749
+ const highlightValue = record.val ?? record.value ?? record["w:val"];
24750
+ if (typeof highlightValue === "string") {
24751
+ const normalized = highlightValue.trim();
24752
+ if (!normalized) return void 0;
24753
+ if (normalized.toLowerCase() === "none") return "transparent";
24754
+ return normalized;
24755
+ }
24756
+ const fill = record.fill ?? record["w:fill"];
24757
+ if (typeof fill === "string") {
24758
+ const normalized = fill.trim();
24759
+ if (!normalized || normalized.toLowerCase() === "auto") return void 0;
24760
+ return normalized.startsWith("#") ? normalized : `#${normalized}`;
24761
+ }
24762
+ }
24763
+ }
24764
+ function resolveFontValue(runProperties) {
24765
+ const fromRFonts = runProperties.rFonts;
24766
+ if (fromRFonts && typeof fromRFonts === "object") {
24767
+ const fonts = fromRFonts;
24768
+ const selected = fonts.ascii ?? fonts.hAnsi ?? fonts.eastAsia ?? fonts.cs;
24769
+ if (typeof selected === "string") return selected;
24770
+ }
24771
+ const fromFontFamily = runProperties.fontFamily;
24772
+ if (typeof fromFontFamily === "string") return fromFontFamily;
24773
+ if (fromFontFamily && typeof fromFontFamily === "object") {
24774
+ const fonts = fromFontFamily;
24775
+ const selected = fonts.ascii ?? fonts.hAnsi ?? fonts.eastAsia ?? fonts.cs;
24776
+ if (typeof selected === "string") return selected;
24777
+ }
24778
+ }
24779
+ function resolveFontSizeValue(runProperties) {
24780
+ const candidate = runProperties.sz ?? runProperties.size ?? runProperties.fontSize;
24781
+ if (typeof candidate === "number") return candidate;
24782
+ if (typeof candidate === "string") {
24783
+ const parsed = Number.parseFloat(candidate);
24784
+ return Number.isFinite(parsed) ? parsed : void 0;
24785
+ }
24786
+ }
24707
24787
  function mapRunNode(candidate) {
24708
- const runProperties = (candidate.node?.attrs ?? candidate.attrs ?? {}).runProperties ?? void 0;
24709
- const underline = Boolean(runProperties?.underline === true || runProperties?.u?.val === "single" || typeof runProperties?.underline === "object" && typeof runProperties?.underline?.val === "string" && runProperties.underline.val !== "none");
24710
- const font = runProperties?.rFonts?.ascii ?? runProperties?.rFonts?.hAnsi ?? runProperties?.rFonts?.eastAsia ?? runProperties?.rFonts?.cs;
24788
+ const attrs = candidate.node?.attrs ?? candidate.attrs ?? {};
24789
+ const runProperties = attrs.runProperties && typeof attrs.runProperties === "object" ? attrs.runProperties : void 0;
24790
+ const underline = resolveUnderlineLike([runProperties?.underline, runProperties?.u]);
24791
+ const strike = resolveBooleanLike(runProperties?.strike) ?? resolveBooleanLike(runProperties?.dstrike) ?? void 0;
24792
+ const languageRaw = runProperties?.lang;
24793
+ const language = typeof languageRaw === "string" ? languageRaw : languageRaw && typeof languageRaw === "object" && typeof languageRaw.val === "string" ? languageRaw.val : void 0;
24711
24794
  return {
24712
24795
  nodeType: "run",
24713
24796
  kind: "inline",
24714
24797
  properties: {
24715
- bold: runProperties?.bold ?? void 0,
24716
- italic: runProperties?.italic ?? void 0,
24717
- underline: underline || void 0,
24718
- font: typeof font === "string" ? font : void 0,
24719
- size: typeof runProperties?.sz === "number" ? runProperties.sz : void 0,
24720
- color: runProperties?.color?.val ?? void 0,
24721
- highlight: runProperties?.highlight ?? void 0,
24722
- styleId: runProperties?.rStyle ?? void 0,
24723
- language: runProperties?.lang?.val ?? void 0
24798
+ bold: resolveBooleanLike(runProperties?.bold) ?? void 0,
24799
+ italic: resolveBooleanLike(runProperties?.italic) ?? void 0,
24800
+ underline: underline ?? void 0,
24801
+ strike,
24802
+ font: runProperties ? resolveFontValue(runProperties) : void 0,
24803
+ size: runProperties ? resolveFontSizeValue(runProperties) : void 0,
24804
+ color: resolveColorValue(runProperties?.color),
24805
+ highlight: resolveHighlightValue(runProperties?.highlight),
24806
+ styleId: typeof runProperties?.rStyle === "string" ? runProperties.rStyle : typeof runProperties?.styleId === "string" ? runProperties.styleId : void 0,
24807
+ language
24724
24808
  }
24725
24809
  };
24726
24810
  }
@@ -27315,7 +27399,7 @@ var Editor = class Editor extends EventEmitter$1 {
27315
27399
  return migrations.length > 0;
27316
27400
  }
27317
27401
  processCollaborationMigrations() {
27318
- console.debug("[checkVersionMigrations] Current editor version", "1.15.0-next.25");
27402
+ console.debug("[checkVersionMigrations] Current editor version", "1.15.0-next.26");
27319
27403
  if (!this.options.ydoc) return;
27320
27404
  let docVersion = this.options.ydoc.getMap("meta").get("version");
27321
27405
  if (!docVersion) docVersion = "initial";
@@ -70910,6 +70994,16 @@ const ShapeTextbox = Node$1.create({
70910
70994
  ];
70911
70995
  }
70912
70996
  });
70997
+ function createDefaultHorizontalRuleAttrs() {
70998
+ return {
70999
+ horizontalRule: true,
71000
+ size: {
71001
+ width: "100%",
71002
+ height: 2
71003
+ },
71004
+ background: "#e5e7eb"
71005
+ };
71006
+ }
70913
71007
  const ContentBlock = Node$1.create({
70914
71008
  name: "contentBlock",
70915
71009
  group: "inline",
@@ -70966,7 +71060,13 @@ const ContentBlock = Node$1.create({
70966
71060
  };
70967
71061
  },
70968
71062
  parseDOM() {
70969
- return [{ tag: `div[data-type="${this.name}"]` }];
71063
+ return [{
71064
+ tag: `div[data-type="${this.name}"]`,
71065
+ priority: 60
71066
+ }, {
71067
+ tag: "hr",
71068
+ getAttrs: () => createDefaultHorizontalRuleAttrs()
71069
+ }];
70970
71070
  },
70971
71071
  renderDOM({ htmlAttributes }) {
70972
71072
  return ["div", Attribute.mergeAttributes(this.options.htmlAttributes, htmlAttributes, { "data-type": this.name })];
@@ -70976,14 +71076,7 @@ const ContentBlock = Node$1.create({
70976
71076
  insertHorizontalRule: () => ({ commands: commands$1 }) => {
70977
71077
  return commands$1.insertContent({
70978
71078
  type: this.name,
70979
- attrs: {
70980
- horizontalRule: true,
70981
- size: {
70982
- width: "100%",
70983
- height: 2
70984
- },
70985
- background: "#e5e7eb"
70986
- }
71079
+ attrs: createDefaultHorizontalRuleAttrs()
70987
71080
  });
70988
71081
  },
70989
71082
  insertContentBlock: (config) => ({ commands: commands$1 }) => {
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_rolldown_runtime = require("../chunks/rolldown-runtime-Dp2H1eGw.cjs");
3
- const require_SuperConverter = require("../chunks/SuperConverter-BahRv-GR.cjs");
3
+ const require_SuperConverter = require("../chunks/SuperConverter-DvOu0a_D.cjs");
4
4
  require("../chunks/jszip-DCT9QYaK.cjs");
5
5
  require("../chunks/xml-js--DznO7Gk.cjs");
6
6
  require("../chunks/helpers-Cs_Zz44i.cjs");
@@ -1,4 +1,4 @@
1
- import { t as SuperConverter } from "../chunks/SuperConverter-DDdU4Vd0.es.js";
1
+ import { t as SuperConverter } from "../chunks/SuperConverter-Dz7jNJpY.es.js";
2
2
  import "../chunks/jszip-ChlR43oI.es.js";
3
3
  import "../chunks/xml-js-DLE8mr0n.es.js";
4
4
  import "../chunks/helpers-BGD_wEOi.es.js";
@@ -1 +1 @@
1
- {"version":3,"file":"translate-content-block.d.ts","sourceRoot":"","sources":["../../../../../../../../../../../super-editor/src/core/super-converter/v3/handlers/w/pict/helpers/translate-content-block.js"],"names":[],"mappings":"AAIA;;;GAGG;AACH,8CAHW,MAAM,GACJ,MAAM,CAalB;AAED;;;GAGG;AACH,mDAHW,MAAM,GACJ,MAAM,CAiDlB"}
1
+ {"version":3,"file":"translate-content-block.d.ts","sourceRoot":"","sources":["../../../../../../../../../../../super-editor/src/core/super-converter/v3/handlers/w/pict/helpers/translate-content-block.js"],"names":[],"mappings":"AAIA;;;GAGG;AACH,8CAHW,MAAM,GACJ,MAAM,CAalB;AAyFD;;;GAGG;AACH,mDAHW,MAAM,GACJ,MAAM,CAmElB"}
@@ -1 +1 @@
1
- {"version":3,"file":"node-info-mapper.d.ts","sourceRoot":"","sources":["../../../../../../super-editor/src/document-api-adapters/helpers/node-info-mapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAClF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAGpE,OAAO,KAAK,EAYV,QAAQ,EACR,QAAQ,EAST,MAAM,wBAAwB,CAAC;AAmUhC;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,cAAc,GAAG,eAAe,EAAE,YAAY,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAgE1G"}
1
+ {"version":3,"file":"node-info-mapper.d.ts","sourceRoot":"","sources":["../../../../../../super-editor/src/document-api-adapters/helpers/node-info-mapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAClF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAGpE,OAAO,KAAK,EAYV,QAAQ,EACR,QAAQ,EAST,MAAM,wBAAwB,CAAC;AAiahC;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,cAAc,GAAG,eAAe,EAAE,YAAY,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAgE1G"}
@@ -36,6 +36,13 @@ import { Node } from '../../core/index.js';
36
36
  * background: '#e5e7eb'
37
37
  * })
38
38
  */
39
+ /**
40
+ * Default attributes for a horizontal rule content block.
41
+ * Single source of truth shared by both `parseDOM` (for `<hr>` tags)
42
+ * and the `insertHorizontalRule` command.
43
+ * @returns {ContentBlockAttributes}
44
+ */
45
+ export function createDefaultHorizontalRuleAttrs(): ContentBlockAttributes;
39
46
  /**
40
47
  * @module ContentBlock
41
48
  * @sidebarTitle Content Block
@@ -1 +1 @@
1
- {"version":3,"file":"content-block.d.ts","sourceRoot":"","sources":["../../../../../../super-editor/src/extensions/content-block/content-block.js"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AAEH;;;;;;GAMG;AAEH;;;;;GAKG;AAEH;;;;;;;;;;;;;;;GAeG;AAEH;;;;GAIG;AACH,uGA4JG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCAvLU,MAAM;;;;qCAON,MAAM;qBA5Ba,gBAAgB"}
1
+ {"version":3,"file":"content-block.d.ts","sourceRoot":"","sources":["../../../../../../super-editor/src/extensions/content-block/content-block.js"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AAEH;;;;;;GAMG;AAEH;;;;;GAKG;AAEH;;;;;;;;;;;;;;;GAeG;AAEH;;;;;GAKG;AACH,oDAFa,sBAAsB,CAQlC;AAED;;;;GAIG;AACH,uGAgKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCAzMU,MAAM;;;;qCAON,MAAM;qBA5Ba,gBAAgB"}
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_rolldown_runtime = require("./chunks/rolldown-runtime-Dp2H1eGw.cjs");
3
- const require_src = require("./chunks/src-D1a6RepU.cjs");
4
- const require_SuperConverter = require("./chunks/SuperConverter-BahRv-GR.cjs");
3
+ const require_src = require("./chunks/src-C8JxCjao.cjs");
4
+ const require_SuperConverter = require("./chunks/SuperConverter-DvOu0a_D.cjs");
5
5
  require("./chunks/jszip-DCT9QYaK.cjs");
6
6
  require("./chunks/xml-js--DznO7Gk.cjs");
7
7
  require("./chunks/helpers-Cs_Zz44i.cjs");
@@ -1,5 +1,5 @@
1
- import { $ as getAllowedImageDimensions, Bt as isMarkType, Ht as isNodeType, Q as trackChangesHelpers_exports, Rt as defineMark, Vt as assertNodeType, X as getRichTextExtensions, Y as AIWriter_default, Z as getStarterExtensions, a as BasicUpload_default, at as CommentsPluginKey, c as Toolbar_default, et as SectionHelpers, i as SuperEditor_default, it as AnnotatorHelpers, n as SlashMenu, nt as Editor, o as ContextMenu_default, ot as TrackChangesBasePluginKey, r as SuperInput_default, rt as fieldAnnotationHelpers_exports, s as SuperToolbar, t as Extensions, tt as PresentationEditor, zt as defineNode } from "./chunks/src-D9QCOAb6.es.js";
2
- import { i as registeredHandlers, j as getMarksFromSelection, k as getActiveFormatting, o as helpers_exports, t as SuperConverter } from "./chunks/SuperConverter-DDdU4Vd0.es.js";
1
+ import { $ as getAllowedImageDimensions, Bt as isMarkType, Ht as isNodeType, Q as trackChangesHelpers_exports, Rt as defineMark, Vt as assertNodeType, X as getRichTextExtensions, Y as AIWriter_default, Z as getStarterExtensions, a as BasicUpload_default, at as CommentsPluginKey, c as Toolbar_default, et as SectionHelpers, i as SuperEditor_default, it as AnnotatorHelpers, n as SlashMenu, nt as Editor, o as ContextMenu_default, ot as TrackChangesBasePluginKey, r as SuperInput_default, rt as fieldAnnotationHelpers_exports, s as SuperToolbar, t as Extensions, tt as PresentationEditor, zt as defineNode } from "./chunks/src-C374LFvx.es.js";
2
+ import { i as registeredHandlers, j as getMarksFromSelection, k as getActiveFormatting, o as helpers_exports, t as SuperConverter } from "./chunks/SuperConverter-Dz7jNJpY.es.js";
3
3
  import "./chunks/jszip-ChlR43oI.es.js";
4
4
  import "./chunks/xml-js-DLE8mr0n.es.js";
5
5
  import "./chunks/helpers-BGD_wEOi.es.js";
package/dist/superdoc.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_rolldown_runtime = require("./chunks/rolldown-runtime-Dp2H1eGw.cjs");
3
- const require_src = require("./chunks/src-D1a6RepU.cjs");
4
- const require_SuperConverter = require("./chunks/SuperConverter-BahRv-GR.cjs");
3
+ const require_src = require("./chunks/src-C8JxCjao.cjs");
4
+ const require_SuperConverter = require("./chunks/SuperConverter-DvOu0a_D.cjs");
5
5
  const require_jszip = require("./chunks/jszip-DCT9QYaK.cjs");
6
6
  require("./chunks/xml-js--DznO7Gk.cjs");
7
7
  const require_uuid = require("./chunks/uuid-CHj_rjgt.cjs");
@@ -19904,7 +19904,7 @@ var SuperDoc = class extends require_eventemitter3.import_eventemitter3.default
19904
19904
  this.config.colors = shuffleArray(this.config.colors);
19905
19905
  this.userColorMap = /* @__PURE__ */ new Map();
19906
19906
  this.colorIndex = 0;
19907
- this.version = "1.15.0-next.25";
19907
+ this.version = "1.15.0-next.26";
19908
19908
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
19909
19909
  this.superdocId = config.superdocId || require_uuid.v4_default();
19910
19910
  this.colors = this.config.colors;