@superdoc-dev/cli 0.16.0-next.12 → 0.16.0-next.13

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 (2) hide show
  1. package/dist/index.js +115 -36
  2. package/package.json +8 -8
package/dist/index.js CHANGED
@@ -68110,7 +68110,7 @@ var init_remark_gfm_BhnWr3yf_es = __esm(() => {
68110
68110
  emptyOptions2 = {};
68111
68111
  });
68112
68112
 
68113
- // ../../packages/superdoc/dist/chunks/SuperConverter-BoqEhvrr.es.js
68113
+ // ../../packages/superdoc/dist/chunks/SuperConverter-CcHCWpfX.es.js
68114
68114
  function getExtensionConfigField(extension$1, field, context = { name: "" }) {
68115
68115
  const fieldValue = extension$1.config[field];
68116
68116
  if (typeof fieldValue === "function")
@@ -104611,9 +104611,15 @@ function paragraphToFlowBlocks({ para, nextBlockId, positions, storyKey, tracked
104611
104611
  else {
104612
104612
  const run$1 = inlineConverter(inlineConverterParams);
104613
104613
  if (run$1) {
104614
- currentRuns.push(run$1);
104615
- if (node3.type === "tab")
104614
+ if (node3.type === "tab") {
104615
+ const tabRun = run$1;
104616
+ if (tabRun.fontSize == null)
104617
+ tabRun.fontSize = defaultSize;
104618
+ if (tabRun.fontFamily == null)
104619
+ tabRun.fontFamily = defaultFont;
104616
104620
  tabOrdinal += 1;
104621
+ }
104622
+ currentRuns.push(run$1);
104617
104623
  }
104618
104624
  }
104619
104625
  } catch (error3) {
@@ -130800,7 +130806,7 @@ var isRegExp = (value) => {
130800
130806
  state.kern = kernNode.attributes["w:val"];
130801
130807
  }
130802
130808
  }, SuperConverter;
130803
- var init_SuperConverter_BoqEhvrr_es = __esm(() => {
130809
+ var init_SuperConverter_CcHCWpfX_es = __esm(() => {
130804
130810
  init_rolldown_runtime_Bg48TavK_es();
130805
130811
  init_jszip_C49i9kUs_es();
130806
130812
  init_xml_js_CqGKpaft_es();
@@ -169574,7 +169580,7 @@ var init_SuperConverter_BoqEhvrr_es = __esm(() => {
169574
169580
  };
169575
169581
  });
169576
169582
 
169577
- // ../../packages/superdoc/dist/chunks/create-headless-toolbar-BrbwjtJZ.es.js
169583
+ // ../../packages/superdoc/dist/chunks/create-headless-toolbar-DKwoydAR.es.js
169578
169584
  function parseSizeUnit(val = "0") {
169579
169585
  const length3 = val.toString() || "0";
169580
169586
  const value = Number.parseFloat(length3);
@@ -179905,8 +179911,8 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, normalizeActorId = (value) => {
179905
179911
  }
179906
179912
  };
179907
179913
  };
179908
- var init_create_headless_toolbar_BrbwjtJZ_es = __esm(() => {
179909
- init_SuperConverter_BoqEhvrr_es();
179914
+ var init_create_headless_toolbar_DKwoydAR_es = __esm(() => {
179915
+ init_SuperConverter_CcHCWpfX_es();
179910
179916
  init_uuid_qzgm05fK_es();
179911
179917
  init_constants_D_X7xF4s_es();
179912
179918
  init_dist_B8HfvhaK_es();
@@ -229069,7 +229075,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
229069
229075
  init_remark_gfm_BhnWr3yf_es();
229070
229076
  });
229071
229077
 
229072
- // ../../packages/superdoc/dist/chunks/src-HGVtAenV.es.js
229078
+ // ../../packages/superdoc/dist/chunks/src-C8mTdIvv.es.js
229073
229079
  function deleteProps(obj, propOrProps) {
229074
229080
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
229075
229081
  const removeNested = (target, pathParts, index2 = 0) => {
@@ -283532,8 +283538,8 @@ async function measureParagraphBlock(block, maxWidth) {
283532
283538
  const ctx$1 = getCanvasContext();
283533
283539
  const wordLayout = block.attrs?.wordLayout;
283534
283540
  const firstTextRunWithSize = block.runs.find((run2) => isTextRun$22(run2) && ("fontSize" in run2) && run2.fontSize != null);
283535
- const fallbackFontSize = normalizeFontSize2(firstTextRunWithSize?.fontSize, DEFAULT_PARAGRAPH_FONT_SIZE);
283536
- const fallbackFontFamily = block.runs.find((run2) => isTextRun$22(run2) && typeof run2.fontFamily === "string" && run2.fontFamily.trim().length > 0)?.fontFamily ?? DEFAULT_PARAGRAPH_FONT_FAMILY;
283541
+ const fallbackFontSize = normalizeFontSize2((firstTextRunWithSize ?? block.runs.find((run2) => typeof run2.fontSize === "number" && run2.fontSize > 0))?.fontSize, DEFAULT_PARAGRAPH_FONT_SIZE);
283542
+ const fallbackFontFamily = (block.runs.find((run2) => isTextRun$22(run2) && typeof run2.fontFamily === "string" && run2.fontFamily.trim().length > 0) ?? block.runs.find((run2) => typeof run2.fontFamily === "string" && run2.fontFamily.trim().length > 0))?.fontFamily ?? DEFAULT_PARAGRAPH_FONT_FAMILY;
283537
283543
  const normalizedRuns = normalizeRunsForMeasurement(block.runs, fallbackFontSize, fallbackFontFamily);
283538
283544
  const markerInfo = wordLayout?.marker ? (() => {
283539
283545
  const { font: markerFont } = buildFontString({
@@ -295407,6 +295413,34 @@ var Node$13 = class Node$14 {
295407
295413
  if (left$1)
295408
295414
  return left$1;
295409
295415
  return ctx$1.graph.segments.find((segment) => segment.side === SegmentSide.Inserted && segment.from === pos && isSameUserForRefinement(ctx$1, segment)) ?? null;
295416
+ }, findAdjacentDeletedSegment = (ctx$1, from$1, to) => {
295417
+ const sameUserDeleted = (segment) => segment.side === SegmentSide.Deleted && !segment.attrs?.replacementGroupId && !segment.attrs?.overlapParentId && isSameUserForRefinement(ctx$1, segment);
295418
+ const exactLeft = ctx$1.graph.segments.find((segment) => sameUserDeleted(segment) && segment.to === from$1);
295419
+ if (exactLeft)
295420
+ return exactLeft;
295421
+ const exactRight = ctx$1.graph.segments.find((segment) => sameUserDeleted(segment) && segment.from === to);
295422
+ if (exactRight)
295423
+ return exactRight;
295424
+ let nearest = null;
295425
+ let nearestDistance = Infinity;
295426
+ for (const segment of ctx$1.graph.segments) {
295427
+ if (!sameUserDeleted(segment))
295428
+ continue;
295429
+ if (segment.from > to) {
295430
+ const distance2 = segment.from - to;
295431
+ if (distance2 < nearestDistance && isCoalescibleDeletionGap(ctx$1, to, segment.from)) {
295432
+ nearest = segment;
295433
+ nearestDistance = distance2;
295434
+ }
295435
+ } else if (segment.to < from$1) {
295436
+ const distance2 = from$1 - segment.to;
295437
+ if (distance2 < nearestDistance && isCoalescibleDeletionGap(ctx$1, segment.to, from$1)) {
295438
+ nearest = segment;
295439
+ nearestDistance = distance2;
295440
+ }
295441
+ }
295442
+ }
295443
+ return nearest;
295410
295444
  }, isEmptyStructuralGap = (ctx$1, from$1, to) => {
295411
295445
  if (to <= from$1)
295412
295446
  return false;
@@ -295426,6 +295460,25 @@ var Node$13 = class Node$14 {
295426
295460
  }
295427
295461
  });
295428
295462
  return !hasInlineLeaf;
295463
+ }, ZERO_WIDTH_ANCHOR_NODE_NAMES, isCoalescibleDeletionGap = (ctx$1, from$1, to) => {
295464
+ if (to <= from$1)
295465
+ return false;
295466
+ if (!sharesTextblock(ctx$1.tr.doc, from$1, to))
295467
+ return false;
295468
+ if (ctx$1.graph.segmentsInRange(from$1, to).length)
295469
+ return false;
295470
+ if (ctx$1.tr.doc.textBetween(from$1, to, "", ""))
295471
+ return false;
295472
+ let blocked = false;
295473
+ ctx$1.tr.doc.nodesBetween(from$1, to, (node3, pos) => {
295474
+ if (pos < from$1 || pos >= to)
295475
+ return;
295476
+ if (node3.isInline && node3.isLeaf && !ZERO_WIDTH_ANCHOR_NODE_NAMES.has(node3.type.name)) {
295477
+ blocked = true;
295478
+ return false;
295479
+ }
295480
+ });
295481
+ return !blocked;
295429
295482
  }, sharesTextblock = (doc$12, from$1, to) => {
295430
295483
  const left$1 = textblockStart(doc$12, from$1);
295431
295484
  const right$1 = textblockStart(doc$12, to);
@@ -295577,15 +295630,19 @@ var Node$13 = class Node$14 {
295577
295630
  return failure$3("INVALID_TARGET", `text-delete range [${intent.from}, ${intent.to}] out of bounds.`);
295578
295631
  if (intent.from === intent.to)
295579
295632
  return failure$3("INVALID_TARGET", "text-delete requires a non-empty range.");
295633
+ const coalesceTarget = intent.replacementGroupHint || intent.preserveExistingReviewState ? null : findAdjacentDeletedSegment(ctx$1, intent.from, intent.to);
295634
+ const sharedDeletionId = intent.replacementGroupHint || coalesceTarget?.changeId || null;
295580
295635
  const result = applyTrackedDelete(ctx$1, intent.from, intent.to, {
295581
295636
  replacementGroupId: "",
295582
295637
  replacementSideId: "",
295583
- sharedDeletionId: intent.replacementGroupHint || null,
295638
+ sharedDeletionId,
295584
295639
  recordSharedDeletionId: Boolean(intent.replacementGroupHint),
295585
295640
  reassignExistingDeletions: intent.source !== "native" && !intent.preserveExistingReviewState ? "different-user" : false
295586
295641
  });
295587
295642
  if (result.ok === false)
295588
295643
  return result;
295644
+ if (coalesceTarget && !ctx$1.updatedChangeIds.includes(coalesceTarget.changeId))
295645
+ ctx$1.updatedChangeIds.push(coalesceTarget.changeId);
295589
295646
  return {
295590
295647
  ok: true,
295591
295648
  tr: ctx$1.tr,
@@ -309204,7 +309261,7 @@ menclose::after {
309204
309261
  const detail = sources && sources.length ? ` from ${sources.join(", ")}` : "";
309205
309262
  console.warn(`[superdoc] font asset failed to load for "${family$1}"${detail}. Check fonts.assetBaseUrl / fonts.resolveAssetUrl so the bundled .woff2 are served.`);
309206
309263
  }
309207
- }, registriesByFontSet, domlessRegistry = null, DEFAULT_SUPERSCRIPT_RAISE_RATIO = 0.33, DEFAULT_SUBSCRIPT_LOWER_RATIO = 0.14, hasVerticalPositioning = (run2) => normalizeBaselineShift(run2.baselineShift) != null || run2.vertAlign === "superscript" || run2.vertAlign === "subscript", applyRunVerticalPositioning = (element3, run2) => {
309264
+ }, registriesByFontSet, domlessRegistry = null, DEFAULT_SUPERSCRIPT_RAISE_RATIO = 0.33, DEFAULT_SUBSCRIPT_LOWER_RATIO = 0.14, underlineThicknessPx = (fontSize) => Math.max(1, Math.round(fontSize / 14)), hasVerticalPositioning = (run2) => normalizeBaselineShift(run2.baselineShift) != null || run2.vertAlign === "superscript" || run2.vertAlign === "subscript", applyRunVerticalPositioning = (element3, run2) => {
309208
309265
  if (hasVerticalPositioning(run2))
309209
309266
  element3.style.lineHeight = "1";
309210
309267
  const explicitBaselineShift = normalizeBaselineShift(run2.baselineShift);
@@ -309246,6 +309303,7 @@ menclose::after {
309246
309303
  decorations.push("underline");
309247
309304
  const u = run2.underline;
309248
309305
  element3.style.textDecorationStyle = u.style && u.style !== "single" ? u.style : "solid";
309306
+ element3.style.textDecorationThickness = `${underlineThicknessPx(run2.fontSize)}px`;
309249
309307
  if (u.color)
309250
309308
  element3.style.textDecorationColor = u.color;
309251
309309
  }
@@ -310010,9 +310068,14 @@ menclose::after {
310010
310068
  const tabWidth = run2.width ?? 48;
310011
310069
  tabEl.style.display = "inline-block";
310012
310070
  tabEl.style.width = `${tabWidth}px`;
310013
- tabEl.style.height = `${line.lineHeight}px`;
310014
- tabEl.style.verticalAlign = "bottom";
310015
- applyTabUnderline(tabEl, run2);
310071
+ if (run2.underline) {
310072
+ tabEl.style.height = `${underlineOffsetFromLineTop(line)}px`;
310073
+ tabEl.style.verticalAlign = "top";
310074
+ } else {
310075
+ tabEl.style.height = `${line.lineHeight}px`;
310076
+ tabEl.style.verticalAlign = "bottom";
310077
+ }
310078
+ applyTabUnderlineBorder(tabEl, run2);
310016
310079
  if (styleId)
310017
310080
  tabEl.setAttribute("styleid", styleId);
310018
310081
  if (run2.pmStart != null)
@@ -310030,11 +310093,11 @@ menclose::after {
310030
310093
  tabEl.style.left = `${tabStartX + indentOffset}px`;
310031
310094
  tabEl.style.top = "0px";
310032
310095
  tabEl.style.width = `${actualTabWidth}px`;
310033
- tabEl.style.height = `${line.lineHeight}px`;
310096
+ tabEl.style.height = run2.underline ? `${underlineOffsetFromLineTop(line)}px` : `${line.lineHeight}px`;
310034
310097
  tabEl.style.display = "inline-block";
310035
310098
  tabEl.style.pointerEvents = "none";
310036
310099
  tabEl.style.zIndex = "1";
310037
- applyTabUnderline(tabEl, run2);
310100
+ applyTabUnderlineBorder(tabEl, run2);
310038
310101
  if (!run2.underline)
310039
310102
  tabEl.style.visibility = "hidden";
310040
310103
  if (styleId)
@@ -310049,13 +310112,16 @@ menclose::after {
310049
310112
  tabEndX,
310050
310113
  actualTabWidth
310051
310114
  };
310052
- }, applyTabUnderline = (tabEl, run2) => {
310053
- if (run2.underline) {
310054
- const underlineStyle = run2.underline.style ?? "single";
310055
- const underlineColor = run2.underline.color ?? "#000000";
310056
- const borderStyle = underlineStyle === "double" ? "double" : "solid";
310057
- tabEl.style.borderBottom = `1px ${borderStyle} ${underlineColor}`;
310058
- }
310115
+ }, underlineOffsetFromLineTop = (line) => {
310116
+ return Math.max(0, (line.lineHeight - line.ascent - line.descent) / 2) + line.ascent + Math.min(line.descent, line.lineHeight * 0.08);
310117
+ }, applyTabUnderlineBorder = (tabEl, run2) => {
310118
+ if (!run2.underline)
310119
+ return;
310120
+ const underlineStyle = run2.underline.style ?? "single";
310121
+ const underlineColor = run2.underline.color ?? "#000000";
310122
+ const borderStyle = underlineStyle === "double" ? "double" : "solid";
310123
+ const fontSize = run2.fontSize ?? 16;
310124
+ tabEl.style.borderBottom = `${underlineThicknessPx(fontSize)}px ${borderStyle} ${underlineColor}`;
310059
310125
  }, applyStyles$1 = (el, styles) => {
310060
310126
  Object.entries(styles).forEach(([key2, value]) => {
310061
310127
  if (value != null && value !== "" && key2 in el.style)
@@ -313359,7 +313425,12 @@ menclose::after {
313359
313425
  if (run2.kind === "lineBreak")
313360
313426
  return "linebreak";
313361
313427
  if (run2.kind === "tab")
313362
- return [run2.text ?? "", "tab"].join(",");
313428
+ return [
313429
+ run2.text ?? "",
313430
+ "tab",
313431
+ run2.underline?.style ?? "",
313432
+ run2.underline?.color ?? ""
313433
+ ].join(",");
313363
313434
  if (run2.kind === "fieldAnnotation") {
313364
313435
  const fieldRun = run2;
313365
313436
  const size$1 = fieldRun.size ? `${fieldRun.size.width ?? ""}x${fieldRun.size.height ?? ""}` : "";
@@ -322193,13 +322264,13 @@ menclose::after {
322193
322264
  return;
322194
322265
  console.log(...args$1);
322195
322266
  }, HEADER_FOOTER_INIT_BUDGET_MS = 200, MAX_ZOOM_WARNING_THRESHOLD = 10, MAX_SELECTION_RECTS_PER_USER = 100, SEMANTIC_RESIZE_DEBOUNCE_MS = 120, MIN_SEMANTIC_CONTENT_WIDTH_PX = 1, GLOBAL_PERFORMANCE, PresentationEditor, ICONS, TEXTS, tableActionsOptions, TRACKED_MARK_NAMES;
322196
- var init_src_HGVtAenV_es = __esm(() => {
322267
+ var init_src_C8mTdIvv_es = __esm(() => {
322197
322268
  init_rolldown_runtime_Bg48TavK_es();
322198
- init_SuperConverter_BoqEhvrr_es();
322269
+ init_SuperConverter_CcHCWpfX_es();
322199
322270
  init_jszip_C49i9kUs_es();
322200
322271
  init_xml_js_CqGKpaft_es();
322201
322272
  init_uuid_qzgm05fK_es();
322202
- init_create_headless_toolbar_BrbwjtJZ_es();
322273
+ init_create_headless_toolbar_DKwoydAR_es();
322203
322274
  init_constants_D_X7xF4s_es();
322204
322275
  init_dist_B8HfvhaK_es();
322205
322276
  init_unified_Dsuw2be5_es();
@@ -339188,6 +339259,14 @@ function print() { __p += __j.call(arguments, '') }
339188
339259
  "format-apply",
339189
339260
  "format-remove"
339190
339261
  ]);
339262
+ ZERO_WIDTH_ANCHOR_NODE_NAMES = new Set([
339263
+ "commentRangeStart",
339264
+ "commentRangeEnd",
339265
+ "commentReference",
339266
+ "bookmarkEnd",
339267
+ "permStart",
339268
+ "permEnd"
339269
+ ]);
339191
339270
  COMPOSITION_INPUT_TYPES = new Set(["insertCompositionText", "deleteCompositionText"]);
339192
339271
  COMBINING_MARK_REGEX = /^\p{Mark}$/u;
339193
339272
  graphemeSegmenter = typeof Intl !== "undefined" && typeof Intl.Segmenter === "function" ? new Intl.Segmenter(undefined, { granularity: "grapheme" }) : null;
@@ -356541,11 +356620,11 @@ function print() { __p += __j.call(arguments, '') }
356541
356620
  ]);
356542
356621
  });
356543
356622
 
356544
- // ../../packages/superdoc/dist/chunks/create-super-doc-ui-SRtgJ7Vz.es.js
356623
+ // ../../packages/superdoc/dist/chunks/create-super-doc-ui-CEjelItp.es.js
356545
356624
  var MOD_ALIASES, ALT_ALIASES, CTRL_ALIASES, SHIFT_ALIASES, BUILTIN_CONTEXT_MENU_GROUPS, BUILTIN_GROUP_ORDER, RESERVED_PROXY_PROPERTY_NAMES, ALL_TOOLBAR_COMMAND_IDS, EMPTY_ACTIVE_IDS;
356546
- var init_create_super_doc_ui_SRtgJ7Vz_es = __esm(() => {
356547
- init_SuperConverter_BoqEhvrr_es();
356548
- init_create_headless_toolbar_BrbwjtJZ_es();
356625
+ var init_create_super_doc_ui_CEjelItp_es = __esm(() => {
356626
+ init_SuperConverter_CcHCWpfX_es();
356627
+ init_create_headless_toolbar_DKwoydAR_es();
356549
356628
  MOD_ALIASES = new Set([
356550
356629
  "Mod",
356551
356630
  "Meta",
@@ -356587,16 +356666,16 @@ var init_zipper_yaJVJ4z9_es = __esm(() => {
356587
356666
 
356588
356667
  // ../../packages/superdoc/dist/super-editor.es.js
356589
356668
  var init_super_editor_es = __esm(() => {
356590
- init_src_HGVtAenV_es();
356591
- init_SuperConverter_BoqEhvrr_es();
356669
+ init_src_C8mTdIvv_es();
356670
+ init_SuperConverter_CcHCWpfX_es();
356592
356671
  init_jszip_C49i9kUs_es();
356593
356672
  init_xml_js_CqGKpaft_es();
356594
- init_create_headless_toolbar_BrbwjtJZ_es();
356673
+ init_create_headless_toolbar_DKwoydAR_es();
356595
356674
  init_constants_D_X7xF4s_es();
356596
356675
  init_dist_B8HfvhaK_es();
356597
356676
  init_unified_Dsuw2be5_es();
356598
356677
  init_DocxZipper_nv_KfOqb_es();
356599
- init_create_super_doc_ui_SRtgJ7Vz_es();
356678
+ init_create_super_doc_ui_CEjelItp_es();
356600
356679
  init_ui_C5PAS9hY_es();
356601
356680
  init_eventemitter3_BnGqBE_Q_es();
356602
356681
  init_errors_CNaD6vcg_es();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc-dev/cli",
3
- "version": "0.16.0-next.12",
3
+ "version": "0.16.0-next.13",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "superdoc": "./dist/index.js"
@@ -25,19 +25,19 @@
25
25
  "@types/ws": "^8.5.13",
26
26
  "typescript": "^5.9.2",
27
27
  "@superdoc/document-api": "0.0.1",
28
- "superdoc": "1.38.0",
29
- "@superdoc/super-editor": "0.0.1"
28
+ "@superdoc/super-editor": "0.0.1",
29
+ "superdoc": "1.38.0"
30
30
  },
31
31
  "module": "src/index.ts",
32
32
  "publishConfig": {
33
33
  "access": "public"
34
34
  },
35
35
  "optionalDependencies": {
36
- "@superdoc-dev/cli-darwin-arm64": "0.16.0-next.12",
37
- "@superdoc-dev/cli-darwin-x64": "0.16.0-next.12",
38
- "@superdoc-dev/cli-linux-x64": "0.16.0-next.12",
39
- "@superdoc-dev/cli-linux-arm64": "0.16.0-next.12",
40
- "@superdoc-dev/cli-windows-x64": "0.16.0-next.12"
36
+ "@superdoc-dev/cli-darwin-arm64": "0.16.0-next.13",
37
+ "@superdoc-dev/cli-darwin-x64": "0.16.0-next.13",
38
+ "@superdoc-dev/cli-linux-x64": "0.16.0-next.13",
39
+ "@superdoc-dev/cli-windows-x64": "0.16.0-next.13",
40
+ "@superdoc-dev/cli-linux-arm64": "0.16.0-next.13"
41
41
  },
42
42
  "scripts": {
43
43
  "predev": "node scripts/ensure-superdoc-build.js",