@superdoc-dev/cli 0.17.0-next.23 → 0.17.0-next.25

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 +785 -94
  2. package/package.json +7 -7
package/dist/index.js CHANGED
@@ -68327,7 +68327,7 @@ var init_remark_gfm_BhnWr3yf_es = __esm(() => {
68327
68327
  emptyOptions2 = {};
68328
68328
  });
68329
68329
 
68330
- // ../../packages/superdoc/dist/chunks/SuperConverter-CLuVUp7o.es.js
68330
+ // ../../packages/superdoc/dist/chunks/SuperConverter-CCgGAnXY.es.js
68331
68331
  function getExtensionConfigField(extension$1, field, context = { name: "" }) {
68332
68332
  const fieldValue = extension$1.config[field];
68333
68333
  if (typeof fieldValue === "function")
@@ -103257,11 +103257,13 @@ function getFontRegistryFor(fontSet, FontFaceCtor) {
103257
103257
  }
103258
103258
  return registry;
103259
103259
  }
103260
- function classifyOffering(policyAction, verdict, physicalFamily, bundled) {
103260
+ function classifyOffering(logicalFamily, policyAction, verdict, physicalFamily, bundled) {
103261
103261
  if (policyAction === "preserve_only")
103262
103262
  return "preserve_only";
103263
103263
  if (policyAction === "customer_supplied" || physicalFamily == null)
103264
103264
  return "customer_supplied";
103265
+ if (bundled && SUPPORTED_ALIAS_FAMILIES.has(logicalFamily))
103266
+ return "supported_alias";
103265
103267
  if (policyAction === "category_fallback")
103266
103268
  return "category_fallback";
103267
103269
  if (!bundled)
@@ -103275,7 +103277,7 @@ function deriveOfferings() {
103275
103277
  logicalFamily: row.logicalFamily,
103276
103278
  physicalFamily: row.physicalFamily,
103277
103279
  generic: row.generic,
103278
- offering: classifyOffering(row.policyAction, row.verdict, row.physicalFamily, bundled),
103280
+ offering: classifyOffering(row.logicalFamily, row.policyAction, row.verdict, row.physicalFamily, bundled),
103279
103281
  bundled,
103280
103282
  verdict: row.verdict,
103281
103283
  evidenceId: row.evidenceId
@@ -130756,7 +130758,7 @@ var isRegExp = (value) => {
130756
130758
  const detail = sources && sources.length ? ` from ${sources.join(", ")}` : "";
130757
130759
  console.warn(`[superdoc] font asset failed to load for "${family$1}"${detail}. Check fonts.assetBaseUrl / fonts.resolveAssetUrl so the bundled .woff2 are served.`);
130758
130760
  }
130759
- }, registriesByFontSet, domlessRegistry = null, BUNDLED_FAMILIES, ADVERTISED_BUILT_IN_TOOLBAR_FAMILIES, FONT_OFFERINGS, prepareCommentParaIds = (comment) => {
130761
+ }, registriesByFontSet, domlessRegistry = null, BUNDLED_FAMILIES, SUPPORTED_ALIAS_FAMILIES, ADVERTISED_BUILT_IN_TOOLBAR_FAMILIES, FONT_OFFERINGS, prepareCommentParaIds = (comment) => {
130760
130762
  return {
130761
130763
  ...comment,
130762
130764
  commentParaId: generateDocxRandomId()
@@ -134911,7 +134913,7 @@ var isRegExp = (value) => {
134911
134913
  state.kern = kernNode.attributes["w:val"];
134912
134914
  }
134913
134915
  }, SuperConverter;
134914
- var init_SuperConverter_CLuVUp7o_es = __esm(() => {
134916
+ var init_SuperConverter_CCgGAnXY_es = __esm(() => {
134915
134917
  init_rolldown_runtime_Bg48TavK_es();
134916
134918
  init_jszip_C49i9kUs_es();
134917
134919
  init_xml_js_CqGKpaft_es();
@@ -172331,6 +172333,62 @@ var init_SuperConverter_CLuVUp7o_es = __esm(() => {
172331
172333
  },
172332
172334
  candidateLicense: "OFL-1.1"
172333
172335
  },
172336
+ {
172337
+ evidenceId: "arial-mt",
172338
+ generic: "sans-serif",
172339
+ logicalFamily: "Arial MT",
172340
+ physicalFamily: "Liberation Sans",
172341
+ verdict: "metric_safe",
172342
+ faces: {
172343
+ regular: true,
172344
+ bold: true,
172345
+ italic: true,
172346
+ boldItalic: true
172347
+ },
172348
+ gates: {
172349
+ static: "pass",
172350
+ metric: "pass",
172351
+ layout: "not_run",
172352
+ ship: "pass"
172353
+ },
172354
+ policyAction: "substitute",
172355
+ measurementRefs: [
172356
+ "arial-mt_regular__liberation-sans#regular#w400#analytic_advance#2026-06-10",
172357
+ "arial-mt_bold__liberation-sans#bold#w700#analytic_advance#2026-06-10",
172358
+ "arial-mt_italic__liberation-sans#italic#w400#analytic_advance#2026-06-10",
172359
+ "arial-mt_boldItalic__liberation-sans#boldItalic#w700#analytic_advance#2026-06-10"
172360
+ ],
172361
+ exportRule: "preserve_original_name",
172362
+ advance: {
172363
+ basis: "latin_text",
172364
+ meanDelta: 0,
172365
+ maxDelta: 0
172366
+ },
172367
+ candidateLicense: "OFL-1.1"
172368
+ },
172369
+ {
172370
+ evidenceId: "arial-unicode-ms",
172371
+ generic: "sans-serif",
172372
+ logicalFamily: "Arial Unicode MS",
172373
+ physicalFamily: null,
172374
+ verdict: "customer_supplied",
172375
+ faces: {
172376
+ regular: false,
172377
+ bold: false,
172378
+ italic: false,
172379
+ boldItalic: false
172380
+ },
172381
+ gates: {
172382
+ static: "not_run",
172383
+ metric: "not_run",
172384
+ layout: "not_run",
172385
+ ship: "not_run"
172386
+ },
172387
+ policyAction: "customer_supplied",
172388
+ measurementRefs: ["arial-unicode-ms#broad_unicode_no_open_substitute#2026-06-10"],
172389
+ exportRule: "preserve_original_name",
172390
+ candidateLicense: null
172391
+ },
172334
172392
  {
172335
172393
  evidenceId: "times-new-roman",
172336
172394
  generic: "serif",
@@ -172359,6 +172417,51 @@ var init_SuperConverter_CLuVUp7o_es = __esm(() => {
172359
172417
  },
172360
172418
  candidateLicense: "OFL-1.1"
172361
172419
  },
172420
+ {
172421
+ evidenceId: "times",
172422
+ generic: "serif",
172423
+ logicalFamily: "Times",
172424
+ physicalFamily: "Liberation Serif",
172425
+ verdict: "visual_only",
172426
+ faces: {
172427
+ regular: true,
172428
+ bold: true,
172429
+ italic: true,
172430
+ boldItalic: true
172431
+ },
172432
+ gates: {
172433
+ static: "pass",
172434
+ metric: "pass",
172435
+ layout: "not_run",
172436
+ ship: "pass"
172437
+ },
172438
+ policyAction: "substitute",
172439
+ measurementRefs: [
172440
+ "times_regular__liberation-serif#regular#w400#analytic_advance#2026-06-10",
172441
+ "times_bold__liberation-serif#bold#w700#analytic_advance#2026-06-10",
172442
+ "times_italic__liberation-serif#italic#w400#analytic_advance#2026-06-10",
172443
+ "times_boldItalic__liberation-serif#boldItalic#w700#analytic_advance#2026-06-10"
172444
+ ],
172445
+ exportRule: "preserve_original_name",
172446
+ advance: {
172447
+ basis: "latin_text",
172448
+ meanDelta: 0.00098877,
172449
+ maxDelta: 0.1171875
172450
+ },
172451
+ candidateLicense: "OFL-1.1",
172452
+ faceVerdicts: {
172453
+ regular: "metric_safe",
172454
+ bold: "metric_safe",
172455
+ italic: "metric_safe",
172456
+ boldItalic: "visual_only"
172457
+ },
172458
+ glyphExceptions: [{
172459
+ slot: "boldItalic",
172460
+ codepoint: 239,
172461
+ advanceDelta: 0.1172,
172462
+ note: "Times Bold Italic vs Liberation Serif Bold Italic: small i diaeresis (U+00EF) advance differs ~11.7%; lines containing it can reflow. Regular, bold, and italic faces are metric_safe on the text sample."
172463
+ }]
172464
+ },
172362
172465
  {
172363
172466
  evidenceId: "courier-new",
172364
172467
  generic: "monospace",
@@ -172387,6 +172490,66 @@ var init_SuperConverter_CLuVUp7o_es = __esm(() => {
172387
172490
  },
172388
172491
  candidateLicense: "OFL-1.1"
172389
172492
  },
172493
+ {
172494
+ evidenceId: "courier",
172495
+ generic: "monospace",
172496
+ logicalFamily: "Courier",
172497
+ physicalFamily: "Liberation Mono",
172498
+ verdict: "visual_only",
172499
+ faces: {
172500
+ regular: true,
172501
+ bold: true,
172502
+ italic: true,
172503
+ boldItalic: true
172504
+ },
172505
+ gates: {
172506
+ static: "pass",
172507
+ metric: "fail",
172508
+ layout: "not_run",
172509
+ ship: "pass"
172510
+ },
172511
+ policyAction: "category_fallback",
172512
+ measurementRefs: ["courier__liberation-mono#monospace_cell#analytic_advance#2026-06-10"],
172513
+ exportRule: "preserve_original_name",
172514
+ advance: {
172515
+ basis: "monospace_cell",
172516
+ meanDelta: 0.0016,
172517
+ maxDelta: 0.2002
172518
+ },
172519
+ candidateLicense: "OFL-1.1",
172520
+ faceVerdicts: {
172521
+ regular: "visual_only",
172522
+ bold: "visual_only",
172523
+ italic: "visual_only",
172524
+ boldItalic: "visual_only"
172525
+ },
172526
+ glyphExceptions: [
172527
+ {
172528
+ slot: "regular",
172529
+ codepoint: 176,
172530
+ advanceDelta: 0.2002,
172531
+ note: "Courier Regular vs Liberation Mono Regular: degree sign (U+00B0) advance differs ~20%; plus-minus (U+00B1) and division sign (U+00F7) also exceed the direct threshold."
172532
+ },
172533
+ {
172534
+ slot: "bold",
172535
+ codepoint: 176,
172536
+ advanceDelta: 0.2002,
172537
+ note: "Courier Bold vs Liberation Mono Bold: degree sign (U+00B0) advance differs ~20%; plus-minus (U+00B1) and division sign (U+00F7) also exceed the direct threshold."
172538
+ },
172539
+ {
172540
+ slot: "italic",
172541
+ codepoint: 176,
172542
+ advanceDelta: 0.2002,
172543
+ note: "Courier Italic vs Liberation Mono Italic: degree sign (U+00B0) advance differs ~20%; plus-minus (U+00B1) and division sign (U+00F7) also exceed the direct threshold."
172544
+ },
172545
+ {
172546
+ slot: "boldItalic",
172547
+ codepoint: 176,
172548
+ advanceDelta: 0.2002,
172549
+ note: "Courier Bold Italic vs Liberation Mono Bold Italic: degree sign (U+00B0) advance differs ~20%; plus-minus (U+00B1) and division sign (U+00F7) also exceed the direct threshold."
172550
+ }
172551
+ ]
172552
+ },
172390
172553
  {
172391
172554
  evidenceId: "georgia",
172392
172555
  generic: "serif",
@@ -172692,6 +172855,52 @@ var init_SuperConverter_CLuVUp7o_es = __esm(() => {
172692
172855
  note: "Century Schoolbook Bold vs C059 Bold: macron (U+00AF) advance differs ~16.7%; yen (U+00A5), micro sign (U+00B5), plus-minus (U+00B1), and division sign (U+00F7) also exceed the direct threshold. Body-text Latin sample is metric_safe."
172693
172856
  }]
172694
172857
  },
172858
+ {
172859
+ evidenceId: "century-gothic",
172860
+ generic: "sans-serif",
172861
+ logicalFamily: "Century Gothic",
172862
+ physicalFamily: "URW Gothic",
172863
+ verdict: "visual_only",
172864
+ faces: {
172865
+ regular: true,
172866
+ bold: true,
172867
+ italic: true,
172868
+ boldItalic: true
172869
+ },
172870
+ gates: {
172871
+ static: "pass",
172872
+ metric: "fail",
172873
+ layout: "not_run",
172874
+ ship: "fail"
172875
+ },
172876
+ policyAction: "category_fallback",
172877
+ measurementRefs: [
172878
+ "century-gothic_regular__urw-gothic#regular#w400#analytic_advance#2026-06-10",
172879
+ "century-gothic_bold__urw-gothic#bold#w700#analytic_advance#2026-06-10",
172880
+ "century-gothic_italic__urw-gothic#italic#w400#analytic_advance#2026-06-10",
172881
+ "century-gothic_boldItalic__urw-gothic#boldItalic#w700#analytic_advance#2026-06-10",
172882
+ "century-gothic__urw-gothic#visual_review#2026-06-10"
172883
+ ],
172884
+ exportRule: "preserve_original_name",
172885
+ advance: {
172886
+ basis: "latin_text",
172887
+ meanDelta: 0.0013,
172888
+ maxDelta: 0.1662
172889
+ },
172890
+ candidateLicense: "AGPL-3.0-only WITH PS-or-PDF-font-exception-20170817",
172891
+ faceVerdicts: {
172892
+ regular: "visual_only",
172893
+ bold: "visual_only",
172894
+ italic: "visual_only",
172895
+ boldItalic: "visual_only"
172896
+ },
172897
+ glyphExceptions: [{
172898
+ slot: "regular",
172899
+ codepoint: 35,
172900
+ advanceDelta: 0.1662,
172901
+ note: "Century Gothic Regular vs URW Gothic Book: number sign (U+0023) advance differs ~16.6%; caret (U+005E) and plus-minus (U+00B1) also exceed the direct threshold. Body text is close, but not line-break safe."
172902
+ }]
172903
+ },
172695
172904
  {
172696
172905
  evidenceId: "garamond",
172697
172906
  generic: "serif",
@@ -172810,6 +173019,45 @@ var init_SuperConverter_CLuVUp7o_es = __esm(() => {
172810
173019
  exportRule: "preserve_original_name",
172811
173020
  candidateLicense: "OFL-1.1"
172812
173021
  },
173022
+ {
173023
+ evidenceId: "segoe-ui",
173024
+ generic: "sans-serif",
173025
+ logicalFamily: "Segoe UI",
173026
+ physicalFamily: "Selawik",
173027
+ verdict: "visual_only",
173028
+ faces: {
173029
+ regular: true,
173030
+ bold: true,
173031
+ italic: false,
173032
+ boldItalic: false
173033
+ },
173034
+ faceSources: {
173035
+ italic: {
173036
+ kind: "synthetic",
173037
+ from: "regular"
173038
+ },
173039
+ boldItalic: {
173040
+ kind: "synthetic",
173041
+ from: "bold"
173042
+ }
173043
+ },
173044
+ gates: {
173045
+ static: "pass",
173046
+ metric: "fail",
173047
+ layout: "not_run",
173048
+ ship: "fail"
173049
+ },
173050
+ policyAction: "category_fallback",
173051
+ measurementRefs: ["segoe-ui__selawik#coverage_limited_advance_probe#2026-06-10"],
173052
+ exportRule: "preserve_original_name",
173053
+ candidateLicense: "OFL-1.1",
173054
+ faceVerdicts: {
173055
+ regular: "visual_only",
173056
+ bold: "visual_only",
173057
+ italic: "visual_only",
173058
+ boldItalic: "visual_only"
173059
+ }
173060
+ },
172813
173061
  {
172814
173062
  evidenceId: "trebuchet-ms",
172815
173063
  generic: "sans-serif",
@@ -173022,6 +173270,182 @@ var init_SuperConverter_CLuVUp7o_es = __esm(() => {
173022
173270
  boldItalic: "visual_only"
173023
173271
  }
173024
173272
  },
173273
+ {
173274
+ evidenceId: "yu-mincho",
173275
+ generic: "serif",
173276
+ logicalFamily: "Yu Mincho",
173277
+ physicalFamily: "BIZ UDMincho",
173278
+ verdict: "visual_only",
173279
+ faces: {
173280
+ regular: true,
173281
+ bold: true,
173282
+ italic: false,
173283
+ boldItalic: false
173284
+ },
173285
+ faceSources: {
173286
+ italic: {
173287
+ kind: "synthetic",
173288
+ from: "regular"
173289
+ },
173290
+ boldItalic: {
173291
+ kind: "synthetic",
173292
+ from: "bold"
173293
+ }
173294
+ },
173295
+ gates: {
173296
+ static: "pass",
173297
+ metric: "fail",
173298
+ layout: "not_run",
173299
+ ship: "fail"
173300
+ },
173301
+ policyAction: "category_fallback",
173302
+ measurementRefs: ["yu-mincho_regular__biz-udmincho#regular#w400#cjk_jp_text#analytic_advance#2026-06-10"],
173303
+ exportRule: "preserve_original_name",
173304
+ advance: {
173305
+ basis: "cjk_jp_text",
173306
+ meanDelta: 0.0425,
173307
+ maxDelta: 0.4829
173308
+ },
173309
+ candidateLicense: "OFL-1.1",
173310
+ faceVerdicts: {
173311
+ regular: "visual_only",
173312
+ bold: "visual_only",
173313
+ italic: "visual_only",
173314
+ boldItalic: "visual_only"
173315
+ }
173316
+ },
173317
+ {
173318
+ evidenceId: "ms-mincho",
173319
+ generic: "serif",
173320
+ logicalFamily: "MS Mincho",
173321
+ physicalFamily: "BIZ UDMincho",
173322
+ verdict: "visual_only",
173323
+ faces: {
173324
+ regular: true,
173325
+ bold: true,
173326
+ italic: false,
173327
+ boldItalic: false
173328
+ },
173329
+ faceSources: {
173330
+ italic: {
173331
+ kind: "synthetic",
173332
+ from: "regular"
173333
+ },
173334
+ boldItalic: {
173335
+ kind: "synthetic",
173336
+ from: "bold"
173337
+ }
173338
+ },
173339
+ gates: {
173340
+ static: "pass",
173341
+ metric: "pass",
173342
+ layout: "not_run",
173343
+ ship: "fail"
173344
+ },
173345
+ policyAction: "category_fallback",
173346
+ measurementRefs: ["ms-mincho_regular__biz-udmincho#regular#w400#cjk_jp_text#analytic_advance#2026-06-10"],
173347
+ exportRule: "preserve_original_name",
173348
+ advance: {
173349
+ basis: "cjk_jp_text",
173350
+ meanDelta: 0,
173351
+ maxDelta: 0
173352
+ },
173353
+ candidateLicense: "OFL-1.1",
173354
+ faceVerdicts: {
173355
+ regular: "cell_width_only",
173356
+ bold: "visual_only",
173357
+ italic: "visual_only",
173358
+ boldItalic: "visual_only"
173359
+ }
173360
+ },
173361
+ {
173362
+ evidenceId: "ms-gothic",
173363
+ generic: "sans-serif",
173364
+ logicalFamily: "MS Gothic",
173365
+ physicalFamily: "BIZ UDGothic",
173366
+ verdict: "visual_only",
173367
+ faces: {
173368
+ regular: true,
173369
+ bold: true,
173370
+ italic: false,
173371
+ boldItalic: false
173372
+ },
173373
+ faceSources: {
173374
+ italic: {
173375
+ kind: "synthetic",
173376
+ from: "regular"
173377
+ },
173378
+ boldItalic: {
173379
+ kind: "synthetic",
173380
+ from: "bold"
173381
+ }
173382
+ },
173383
+ gates: {
173384
+ static: "pass",
173385
+ metric: "pass",
173386
+ layout: "not_run",
173387
+ ship: "fail"
173388
+ },
173389
+ policyAction: "category_fallback",
173390
+ measurementRefs: ["ms-gothic_regular__biz-udgothic#regular#w400#cjk_jp_text#analytic_advance#2026-06-10"],
173391
+ exportRule: "preserve_original_name",
173392
+ advance: {
173393
+ basis: "cjk_jp_text",
173394
+ meanDelta: 0,
173395
+ maxDelta: 0
173396
+ },
173397
+ candidateLicense: "OFL-1.1",
173398
+ faceVerdicts: {
173399
+ regular: "cell_width_only",
173400
+ bold: "visual_only",
173401
+ italic: "visual_only",
173402
+ boldItalic: "visual_only"
173403
+ }
173404
+ },
173405
+ {
173406
+ evidenceId: "yu-gothic",
173407
+ generic: "sans-serif",
173408
+ logicalFamily: "Yu Gothic",
173409
+ physicalFamily: "BIZ UDGothic",
173410
+ verdict: "visual_only",
173411
+ faces: {
173412
+ regular: true,
173413
+ bold: true,
173414
+ italic: false,
173415
+ boldItalic: false
173416
+ },
173417
+ faceSources: {
173418
+ italic: {
173419
+ kind: "synthetic",
173420
+ from: "regular"
173421
+ },
173422
+ boldItalic: {
173423
+ kind: "synthetic",
173424
+ from: "bold"
173425
+ }
173426
+ },
173427
+ gates: {
173428
+ static: "pass",
173429
+ metric: "fail",
173430
+ layout: "not_run",
173431
+ ship: "fail"
173432
+ },
173433
+ policyAction: "category_fallback",
173434
+ measurementRefs: ["yu-gothic_regular__biz-udgothic#regular#w400#cjk_jp_text#analytic_advance#2026-06-10", "yu-gothic_bold__biz-udgothic#bold#w700#cjk_jp_text#analytic_advance#2026-06-10"],
173435
+ exportRule: "preserve_original_name",
173436
+ advance: {
173437
+ basis: "cjk_jp_text",
173438
+ meanDelta: 0.0415,
173439
+ maxDelta: 0.4521
173440
+ },
173441
+ candidateLicense: "OFL-1.1",
173442
+ faceVerdicts: {
173443
+ regular: "visual_only",
173444
+ bold: "visual_only",
173445
+ italic: "visual_only",
173446
+ boldItalic: "visual_only"
173447
+ }
173448
+ },
173025
173449
  {
173026
173450
  evidenceId: "aptos-display",
173027
173451
  generic: "sans-serif",
@@ -173301,6 +173725,28 @@ var init_SuperConverter_CLuVUp7o_es = __esm(() => {
173301
173725
  file: "C059-BdIta.woff2"
173302
173726
  }
173303
173727
  ]),
173728
+ familyWithFaces("URW Gothic", "AGPL-3.0-only WITH PS-or-PDF-font-exception-20170817", [
173729
+ {
173730
+ weight: "normal",
173731
+ style: "normal",
173732
+ file: "URWGothic-Book.woff2"
173733
+ },
173734
+ {
173735
+ weight: "bold",
173736
+ style: "normal",
173737
+ file: "URWGothic-Demi.woff2"
173738
+ },
173739
+ {
173740
+ weight: "normal",
173741
+ style: "italic",
173742
+ file: "URWGothic-BookOblique.woff2"
173743
+ },
173744
+ {
173745
+ weight: "bold",
173746
+ style: "italic",
173747
+ file: "URWGothic-DemiOblique.woff2"
173748
+ }
173749
+ ]),
173304
173750
  familyWithFaces("Bacasime Antique", "OFL-1.1", [{
173305
173751
  weight: "normal",
173306
173752
  style: "normal",
@@ -173339,6 +173785,15 @@ var init_SuperConverter_CLuVUp7o_es = __esm(() => {
173339
173785
  file: "ComicRelief-Bold.woff2"
173340
173786
  }]),
173341
173787
  family("Noto Sans", "NotoSans", "OFL-1.1"),
173788
+ familyWithFaces("Selawik", "OFL-1.1", [{
173789
+ weight: "normal",
173790
+ style: "normal",
173791
+ file: "Selawik-Regular.woff2"
173792
+ }, {
173793
+ weight: "bold",
173794
+ style: "normal",
173795
+ file: "Selawik-Bold.woff2"
173796
+ }]),
173342
173797
  familyWithFaces("Noto Sans Mono", "OFL-1.1", [{
173343
173798
  weight: "normal",
173344
173799
  style: "normal",
@@ -173383,6 +173838,11 @@ var init_SuperConverter_CLuVUp7o_es = __esm(() => {
173383
173838
  OS2_MIN_LENGTH = OS2_FSSELECTION + 2;
173384
173839
  registriesByFontSet = /* @__PURE__ */ new WeakMap;
173385
173840
  BUNDLED_FAMILIES = new Set(BUNDLED_MANIFEST.map((f2) => f2.family));
173841
+ SUPPORTED_ALIAS_FAMILIES = new Set([
173842
+ "Arial MT",
173843
+ "Courier",
173844
+ "Times"
173845
+ ]);
173386
173846
  ADVERTISED_BUILT_IN_TOOLBAR_FAMILIES = new Set([
173387
173847
  "Arial Black",
173388
173848
  "Arial Narrow",
@@ -173390,12 +173850,14 @@ var init_SuperConverter_CLuVUp7o_es = __esm(() => {
173390
173850
  "Bookman Old Style",
173391
173851
  "Brush Script MT",
173392
173852
  "Century",
173853
+ "Century Gothic",
173393
173854
  "Cooper Black",
173394
173855
  "Comic Sans MS",
173395
173856
  "Garamond",
173396
173857
  "Georgia",
173397
173858
  "Gill Sans MT Condensed",
173398
173859
  "Lucida Console",
173860
+ "Segoe UI",
173399
173861
  "Tahoma",
173400
173862
  "Trebuchet MS",
173401
173863
  "Verdana"
@@ -175195,7 +175657,7 @@ var init_SuperConverter_CLuVUp7o_es = __esm(() => {
175195
175657
  };
175196
175658
  });
175197
175659
 
175198
- // ../../packages/superdoc/dist/chunks/create-headless-toolbar-Dga1mSBS.es.js
175660
+ // ../../packages/superdoc/dist/chunks/create-headless-toolbar-BvrKiWf0.es.js
175199
175661
  function parseSizeUnit(val = "0") {
175200
175662
  const length3 = val.toString() || "0";
175201
175663
  const value = Number.parseFloat(length3);
@@ -185590,8 +186052,8 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, normalizeActorId = (value) => {
185590
186052
  }
185591
186053
  };
185592
186054
  };
185593
- var init_create_headless_toolbar_Dga1mSBS_es = __esm(() => {
185594
- init_SuperConverter_CLuVUp7o_es();
186055
+ var init_create_headless_toolbar_BvrKiWf0_es = __esm(() => {
186056
+ init_SuperConverter_CCgGAnXY_es();
185595
186057
  init_uuid_B2wVPhPi_es();
185596
186058
  init_constants_D9qj59G2_es();
185597
186059
  init_dist_B8HfvhaK_es();
@@ -234760,7 +235222,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
234760
235222
  init_remark_gfm_BhnWr3yf_es();
234761
235223
  });
234762
235224
 
234763
- // ../../packages/superdoc/dist/chunks/src-DhR654Bl.es.js
235225
+ // ../../packages/superdoc/dist/chunks/src-BB0n1coY.es.js
234764
235226
  function deleteProps(obj, propOrProps) {
234765
235227
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
234766
235228
  const removeNested = (target, pathParts, index2 = 0) => {
@@ -285846,10 +286308,10 @@ function clickToPositionGeometry(layout, blocks2, measures, containerPoint, opti
285846
286308
  lineIndex
285847
286309
  };
285848
286310
  }
285849
- const firstRun = cellBlock.runs?.[0];
285850
- if (firstRun && firstRun.pmStart != null)
286311
+ const fallbackPos = cellBlock.runs?.[0]?.pmStart ?? blockPmRangeFromAttrs(cellBlock).pmStart;
286312
+ if (fallbackPos != null)
285851
286313
  return {
285852
- pos: firstRun.pmStart,
286314
+ pos: fallbackPos,
285853
286315
  layoutEpoch,
285854
286316
  blockId: tableHit.fragment.blockId,
285855
286317
  pageIndex,
@@ -285910,6 +286372,15 @@ function percentile(sortedValues, p$12) {
285910
286372
  const weight = index2 - lower;
285911
286373
  return sortedValues[lower] * (1 - weight) + sortedValues[upper] * weight;
285912
286374
  }
286375
+ function pushEmptyLineSelectionBand(rects, opts) {
286376
+ rects.push({
286377
+ x: opts.x,
286378
+ y: opts.y,
286379
+ width: Math.max(1, opts.width),
286380
+ height: opts.height,
286381
+ pageIndex: opts.pageIndex
286382
+ });
286383
+ }
285913
286384
  function selectionToRects(layout, blocks2, measures, from$1, to, geometryHelper) {
285914
286385
  if (from$1 === to)
285915
286386
  return [];
@@ -285936,8 +286407,17 @@ function selectionToRects(layout, blocks2, measures, from$1, to, geometryHelper)
285936
286407
  return;
285937
286408
  const sliceFrom = Math.max(range.pmStart, from$1);
285938
286409
  const sliceTo = Math.min(range.pmEnd, to);
285939
- if (sliceFrom >= sliceTo)
286410
+ if (sliceFrom >= sliceTo) {
286411
+ const emptyLineOffset = lineHeightBeforeIndex$1(measure, index2) - lineHeightBeforeIndex$1(measure, fragment2.fromLine);
286412
+ pushEmptyLineSelectionBand(rects, {
286413
+ x: fragment2.x,
286414
+ y: fragment2.y + emptyLineOffset + pageTopY,
286415
+ width: fragment2.width,
286416
+ height: line.lineHeight,
286417
+ pageIndex
286418
+ });
285940
286419
  return;
286420
+ }
285941
286421
  pmPosToCharOffset(block, line, sliceFrom);
285942
286422
  pmPosToCharOffset(block, line, sliceTo);
285943
286423
  const visualCharOffsetFrom = pmPosToVisualCharOffset(block, line, sliceFrom);
@@ -286115,8 +286595,17 @@ function selectionToRects(layout, blocks2, measures, from$1, to, geometryHelper)
286115
286595
  return;
286116
286596
  const sliceFrom = Math.max(range.pmStart, from$1);
286117
286597
  const sliceTo = Math.min(range.pmEnd, to);
286118
- if (sliceFrom >= sliceTo)
286598
+ if (sliceFrom >= sliceTo) {
286599
+ const emptyLineOffset = lineHeightBeforeIndex$1(info.measure, index2) - lineHeightBeforeIndex$1(info.measure, info.startLine);
286600
+ pushEmptyLineSelectionBand(rects, {
286601
+ x: fragment2.x + contentOffsetX + cellX + padding.left,
286602
+ y: fragment2.y + contentOffsetY + rowOffset + blockTopCursor + effectiveSpacingBeforePx + emptyLineOffset + pageTopY,
286603
+ width: cellMeasure.width - padding.left - padding.right,
286604
+ height: line.lineHeight,
286605
+ pageIndex
286606
+ });
286119
286607
  return;
286608
+ }
286120
286609
  pmPosToCharOffset(info.block, line, sliceFrom);
286121
286610
  pmPosToCharOffset(info.block, line, sliceTo);
286122
286611
  const visualCharOffsetFrom = pmPosToVisualCharOffset(info.block, line, sliceFrom);
@@ -286445,6 +286934,57 @@ function calculateExtendedSelection(blocks2, anchor, head, mode) {
286445
286934
  selHead: head
286446
286935
  };
286447
286936
  }
286937
+ function selectionCollapsesAcrossTableCells(doc$12, anchor, head) {
286938
+ if (anchor === head)
286939
+ return false;
286940
+ try {
286941
+ const size$1 = doc$12.content.size;
286942
+ if (anchor < 0 || head < 0 || anchor > size$1 || head > size$1)
286943
+ return false;
286944
+ const $from = doc$12.resolve(Math.min(anchor, head));
286945
+ const $to = doc$12.resolve(Math.max(anchor, head));
286946
+ const cellAncestor = (pos) => {
286947
+ for (let depth = pos.depth;depth > 0; depth--) {
286948
+ const role = pos.node(depth).type.spec.tableRole;
286949
+ if (role === "cell" || role === "header_cell")
286950
+ return pos.node(depth);
286951
+ }
286952
+ return null;
286953
+ };
286954
+ return cellAncestor($from) !== cellAncestor($to) && $to.parentOffset === 0;
286955
+ } catch {
286956
+ return false;
286957
+ }
286958
+ }
286959
+ function stabilizeTextSelectionAcrossTableCells(doc$12, anchor, head) {
286960
+ if (!selectionCollapsesAcrossTableCells(doc$12, anchor, head))
286961
+ return {
286962
+ selAnchor: anchor,
286963
+ selHead: head
286964
+ };
286965
+ try {
286966
+ const anchorIsUpper = anchor > head;
286967
+ const upperPos = anchorIsUpper ? anchor : head;
286968
+ if (upperPos < 0 || upperPos >= doc$12.content.size)
286969
+ return null;
286970
+ const $upper = doc$12.resolve(upperPos);
286971
+ if (!$upper.parent.inlineContent || $upper.parent.content.size !== 0)
286972
+ return null;
286973
+ const stabilizedUpperPos = upperPos + 1;
286974
+ if (stabilizedUpperPos > doc$12.content.size)
286975
+ return null;
286976
+ const selAnchor = anchorIsUpper ? stabilizedUpperPos : anchor;
286977
+ const selHead = anchorIsUpper ? head : stabilizedUpperPos;
286978
+ if (selectionCollapsesAcrossTableCells(doc$12, selAnchor, selHead))
286979
+ return null;
286980
+ return {
286981
+ selAnchor,
286982
+ selHead
286983
+ };
286984
+ } catch {
286985
+ return null;
286986
+ }
286987
+ }
286448
286988
  function registerPointerClick(event, previous3, options) {
286449
286989
  const time = event.timeStamp ?? performance.now();
286450
286990
  const withinTime = time - previous3.lastClickTime <= options.timeThresholdMs;
@@ -286860,14 +287400,16 @@ function computeSelectionRectsFromDom(options, from$1, to) {
286860
287400
  missingEntries.push(entry);
286861
287401
  }
286862
287402
  } catch {}
286863
- if (missingEntries && missingEntries.length > 0) {
287403
+ const spansMultipleLines = countDistinctLines(pageEntries) > 1;
287404
+ if (spansMultipleLines || missingEntries && missingEntries.length > 0) {
286864
287405
  if (isVerbose)
286865
- debugLog("verbose", `DOM selection rects: range missing entries ${JSON.stringify({
287406
+ debugLog("verbose", `DOM selection rects: switching to per-line rects ${JSON.stringify({
286866
287407
  pageIndex,
286867
287408
  sliceFrom,
286868
287409
  sliceTo,
286869
- missingCount: missingEntries.length,
286870
- missingPreview: missingEntries.slice(0, 20).map(entryDebugInfo)
287410
+ spansMultipleLines,
287411
+ missingCount: missingEntries?.length ?? 0,
287412
+ missingPreview: (missingEntries ?? []).slice(0, 20).map(entryDebugInfo)
286871
287413
  })}`);
286872
287414
  rawRects = collectClientRectsByLine(doc$12, pageEntries, sliceFrom, sliceTo);
286873
287415
  if (dumpRects)
@@ -286937,10 +287479,17 @@ function collectClientRectsByLine(doc$12, entries2, sliceFrom, sliceTo) {
286937
287479
  else
286938
287480
  lineMap.set(lineEl, [entry]);
286939
287481
  }
286940
- for (const [, lineEntries] of lineMap) {
287482
+ for (const [lineEl, lineEntries] of lineMap) {
286941
287483
  lineEntries.sort((a2, b$1) => a2.pmStart - b$1.pmStart !== 0 ? a2.pmStart - b$1.pmStart : a2.pmEnd - b$1.pmEnd);
286942
287484
  const linePmStart = lineEntries[0]?.pmStart ?? Infinity;
286943
287485
  const linePmEnd = lineEntries[lineEntries.length - 1]?.pmEnd ?? -Infinity;
287486
+ if (sliceFrom < linePmStart && linePmEnd < sliceTo && lineEl.isConnected) {
287487
+ const boxRect = lineEl.getBoundingClientRect();
287488
+ if (boxRect.width > 0 && boxRect.height > 0) {
287489
+ rects.push(boxRect);
287490
+ continue;
287491
+ }
287492
+ }
286944
287493
  if (!Number.isFinite(linePmStart) || !Number.isFinite(linePmEnd) || linePmEnd <= linePmStart)
286945
287494
  continue;
286946
287495
  const lineFrom = Math.max(sliceFrom, linePmStart);
@@ -286978,6 +287527,18 @@ function collectClientRectsByLine(doc$12, entries2, sliceFrom, sliceTo) {
286978
287527
  }
286979
287528
  return rects;
286980
287529
  }
287530
+ function countDistinctLines(entries2) {
287531
+ const lines = /* @__PURE__ */ new Set;
287532
+ let hasLoose = false;
287533
+ for (const entry of entries2) {
287534
+ const lineEl = entry.el.closest(".superdoc-line");
287535
+ if (lineEl)
287536
+ lines.add(lineEl);
287537
+ else
287538
+ hasLoose = true;
287539
+ }
287540
+ return lines.size + (hasLoose ? 1 : 0);
287541
+ }
286981
287542
  function setDomRangeStart(range, entry, pos) {
286982
287543
  const el = entry.el;
286983
287544
  const pmStart = entry.pmStart;
@@ -288313,6 +288874,94 @@ function resolvePointerPositionHit(options) {
288313
288874
  }
288314
288875
  return clickToPositionGeometry(layout, blocks2, measures, containerPoint, { geometryHelper });
288315
288876
  }
288877
+ function getTableBlocks(blocks2) {
288878
+ return blocks2.filter((block) => block.kind === "table");
288879
+ }
288880
+ function getTopLevelTablePosByIndex(doc$12, targetTableIndex) {
288881
+ if (!Number.isInteger(targetTableIndex) || targetTableIndex < 0)
288882
+ return null;
288883
+ let tablePos = null;
288884
+ let currentTableIndex = 0;
288885
+ doc$12.descendants((node3, pos) => {
288886
+ if (tablePos !== null)
288887
+ return false;
288888
+ if (node3.type.name !== "table")
288889
+ return true;
288890
+ if (currentTableIndex === targetTableIndex)
288891
+ tablePos = pos;
288892
+ currentTableIndex += 1;
288893
+ return false;
288894
+ });
288895
+ return tablePos;
288896
+ }
288897
+ function getTopLevelTableIndexAtPos(doc$12, targetTablePos) {
288898
+ if (!Number.isFinite(targetTablePos) || targetTablePos < 0 || targetTablePos > doc$12.content.size)
288899
+ return null;
288900
+ let tableIndex = null;
288901
+ let currentTableIndex = 0;
288902
+ doc$12.descendants((node3, pos) => {
288903
+ if (tableIndex !== null)
288904
+ return false;
288905
+ if (node3.type.name !== "table")
288906
+ return true;
288907
+ if (pos === targetTablePos)
288908
+ tableIndex = currentTableIndex;
288909
+ currentTableIndex += 1;
288910
+ return false;
288911
+ });
288912
+ return tableIndex;
288913
+ }
288914
+ function getCellCoordinatesFromCellPos(doc$12, tablePos, cellPos) {
288915
+ const tableNode = doc$12.nodeAt(tablePos);
288916
+ if (!tableNode || tableNode.type.name !== "table")
288917
+ return null;
288918
+ let rowPos = tablePos + 1;
288919
+ for (let rowIndex = 0;rowIndex < tableNode.childCount; rowIndex += 1) {
288920
+ const rowNode = tableNode.child(rowIndex);
288921
+ let currentCellPos = rowPos + 1;
288922
+ for (let cellColIndex = 0;cellColIndex < rowNode.childCount; cellColIndex += 1) {
288923
+ if (currentCellPos === cellPos)
288924
+ return {
288925
+ rowIndex,
288926
+ cellColIndex
288927
+ };
288928
+ currentCellPos += rowNode.child(cellColIndex).nodeSize;
288929
+ }
288930
+ rowPos += rowNode.nodeSize;
288931
+ }
288932
+ return null;
288933
+ }
288934
+ function getTopLevelTableBlockAtPos(doc$12, blocks2, tablePos) {
288935
+ if (!doc$12)
288936
+ return null;
288937
+ const tableIndex = getTopLevelTableIndexAtPos(doc$12, tablePos);
288938
+ if (tableIndex === null)
288939
+ return null;
288940
+ return getTableBlocks(blocks2)[tableIndex] ?? null;
288941
+ }
288942
+ function resolveCellAnchorStateFromCellPos(doc$12, blocks2, cellPos) {
288943
+ if (!doc$12 || !Number.isFinite(cellPos) || cellPos < 0 || cellPos > doc$12.content.size)
288944
+ return null;
288945
+ const tableRole = doc$12.nodeAt(cellPos)?.type.spec.tableRole;
288946
+ if (tableRole !== "cell" && tableRole !== "header_cell")
288947
+ return null;
288948
+ const context = resolveCellContext(doc$12, Math.min(cellPos + 1, doc$12.content.size));
288949
+ if (!context || context.cellPos !== cellPos)
288950
+ return null;
288951
+ const tableBlock = getTopLevelTableBlockAtPos(doc$12, blocks2, context.tablePos);
288952
+ if (!tableBlock)
288953
+ return null;
288954
+ const cellCoordinates = getCellCoordinatesFromCellPos(doc$12, context.tablePos, cellPos);
288955
+ if (!cellCoordinates)
288956
+ return null;
288957
+ return {
288958
+ tablePos: context.tablePos,
288959
+ cellPos,
288960
+ tableBlockId: tableBlock.id,
288961
+ cellRowIndex: cellCoordinates.rowIndex,
288962
+ cellColIndex: cellCoordinates.cellColIndex
288963
+ };
288964
+ }
288316
288965
  function getCellPosFromTableHit(tableHit, doc$12, blocks2) {
288317
288966
  if (!tableHit || !tableHit.block || typeof tableHit.block.id !== "string") {
288318
288967
  console.warn("[getCellPosFromTableHit] Invalid tableHit input:", tableHit);
@@ -288327,22 +288976,12 @@ function getCellPosFromTableHit(tableHit, doc$12, blocks2) {
288327
288976
  }
288328
288977
  if (!doc$12)
288329
288978
  return null;
288330
- const targetTableIndex = blocks2.filter((b$1) => b$1.kind === "table").findIndex((b$1) => b$1.id === tableHit.block.id);
288979
+ const targetTableIndex = getTableBlocks(blocks2).findIndex((b$1) => b$1.id === tableHit.block.id);
288331
288980
  if (targetTableIndex === -1)
288332
288981
  return null;
288333
288982
  let tablePos = null;
288334
- let currentTableIndex = 0;
288335
288983
  try {
288336
- doc$12.descendants((node3, pos) => {
288337
- if (node3.type.name === "table") {
288338
- if (currentTableIndex === targetTableIndex) {
288339
- tablePos = pos;
288340
- return false;
288341
- }
288342
- currentTableIndex++;
288343
- }
288344
- return true;
288345
- });
288984
+ tablePos = getTopLevelTablePosByIndex(doc$12, targetTableIndex);
288346
288985
  } catch (error3) {
288347
288986
  console.error("[getCellPosFromTableHit] Error during document traversal:", error3);
288348
288987
  return null;
@@ -288390,22 +289029,51 @@ function getCellPosFromTableHit(tableHit, doc$12, blocks2) {
288390
289029
  function getTablePosFromHit(tableHit, doc$12, blocks2) {
288391
289030
  if (!doc$12)
288392
289031
  return null;
288393
- const targetTableIndex = blocks2.filter((b$1) => b$1.kind === "table").findIndex((b$1) => b$1.id === tableHit.block.id);
289032
+ const targetTableIndex = getTableBlocks(blocks2).findIndex((b$1) => b$1.id === tableHit.block.id);
288394
289033
  if (targetTableIndex === -1)
288395
289034
  return null;
288396
- let tablePos = null;
288397
- let currentTableIndex = 0;
288398
- doc$12.descendants((node3, pos) => {
288399
- if (node3.type.name === "table") {
288400
- if (currentTableIndex === targetTableIndex) {
288401
- tablePos = pos;
288402
- return false;
288403
- }
288404
- currentTableIndex++;
289035
+ return getTopLevelTablePosByIndex(doc$12, targetTableIndex);
289036
+ }
289037
+ function resolveCellContext(doc$12, pos) {
289038
+ if (!doc$12 || !Number.isFinite(pos) || pos < 0 || pos > doc$12.content.size)
289039
+ return null;
289040
+ let $pos;
289041
+ try {
289042
+ $pos = doc$12.resolve(pos);
289043
+ } catch {
289044
+ return null;
289045
+ }
289046
+ let cellDepth = -1;
289047
+ let tableDepth = -1;
289048
+ for (let depth = $pos.depth;depth > 0; depth--) {
289049
+ const role = $pos.node(depth).type.spec.tableRole;
289050
+ if (cellDepth === -1 && (role === "cell" || role === "header_cell"))
289051
+ cellDepth = depth;
289052
+ if (cellDepth !== -1 && role === "table") {
289053
+ tableDepth = depth;
289054
+ break;
288405
289055
  }
288406
- return true;
288407
- });
288408
- return tablePos;
289056
+ }
289057
+ if (cellDepth === -1 || tableDepth === -1)
289058
+ return null;
289059
+ return {
289060
+ cellPos: $pos.before(cellDepth),
289061
+ tablePos: $pos.before(tableDepth)
289062
+ };
289063
+ }
289064
+ function resolveCrossCellSelection(doc$12, anchorPos, headPos) {
289065
+ const anchor = resolveCellContext(doc$12, anchorPos);
289066
+ const head = resolveCellContext(doc$12, headPos);
289067
+ if (!anchor || !head)
289068
+ return null;
289069
+ if (anchor.tablePos !== head.tablePos)
289070
+ return null;
289071
+ if (anchor.cellPos === head.cellPos)
289072
+ return null;
289073
+ return {
289074
+ anchorCellPos: anchor.cellPos,
289075
+ headCellPos: head.cellPos
289076
+ };
288409
289077
  }
288410
289078
  function shouldUseCellSelection(currentTableHit, cellAnchor, cellDragMode) {
288411
289079
  if (!cellAnchor)
@@ -288868,15 +289536,8 @@ function renderCellSelectionOverlay({ selection, layout, localSelectionLayer, bl
288868
289536
  let tableBlock;
288869
289537
  if (cellAnchorTableBlockId)
288870
289538
  tableBlock = blocks2.find((block) => block.kind === "table" && block.id === cellAnchorTableBlockId);
288871
- if (!tableBlock) {
288872
- const expectedBlockId = `${tableStart}-table`;
288873
- tableBlock = blocks2.find((block) => block.kind === "table" && block.id === expectedBlockId);
288874
- }
288875
- if (!tableBlock) {
288876
- const tableBlocks = blocks2.filter((block) => block.kind === "table");
288877
- if (tableBlocks.length === 1)
288878
- tableBlock = tableBlocks[0];
288879
- }
289539
+ if (!tableBlock)
289540
+ tableBlock = getTopLevelTableBlockAtPos($anchorCell.node(0), blocks2, tableStart) ?? undefined;
288880
289541
  if (!tableBlock)
288881
289542
  return;
288882
289543
  const tableFragments = [];
@@ -327682,18 +328343,45 @@ menclose::after {
327682
328343
  const layoutState = this.#deps?.getLayoutState();
327683
328344
  return getTablePosFromHit(tableHit, editor?.state?.doc ?? null, layoutState?.blocks ?? []);
327684
328345
  }
328346
+ #setCellAnchorState(cellAnchor, mode = "pending") {
328347
+ this.#cellAnchor = cellAnchor;
328348
+ this.#cellDragMode = mode;
328349
+ }
327685
328350
  #setCellAnchor(tableHit, tablePos) {
327686
328351
  const cellPos = this.#getCellPosFromTableHit(tableHit);
327687
328352
  if (cellPos === null)
327688
328353
  return;
327689
- this.#cellAnchor = {
328354
+ this.#setCellAnchorState({
327690
328355
  tablePos,
327691
328356
  cellPos,
327692
328357
  cellRowIndex: tableHit.cellRowIndex,
327693
328358
  cellColIndex: tableHit.cellColIndex,
327694
328359
  tableBlockId: tableHit.block.id
327695
- };
327696
- this.#cellDragMode = "pending";
328360
+ }, "pending");
328361
+ }
328362
+ #setCellAnchorFromCellPos(cellPos, mode = "pending") {
328363
+ const editor = this.#deps?.getEditor();
328364
+ const layoutState = this.#deps?.getLayoutState();
328365
+ const cellAnchor = resolveCellAnchorStateFromCellPos(editor?.state?.doc ?? null, layoutState?.blocks ?? [], cellPos);
328366
+ if (!cellAnchor)
328367
+ return false;
328368
+ this.#setCellAnchorState(cellAnchor, mode);
328369
+ return true;
328370
+ }
328371
+ #dispatchExtendedTextSelection(editor, anchor, head) {
328372
+ const { selAnchor, selHead } = this.#calculateExtendedSelection(anchor, head, this.#dragExtensionMode);
328373
+ const stabilized = stabilizeTextSelectionAcrossTableCells(editor.state.doc, selAnchor, selHead);
328374
+ if (!stabilized)
328375
+ return false;
328376
+ try {
328377
+ const tr = editor.state.tr.setSelection(TextSelection.create(editor.state.doc, stabilized.selAnchor, stabilized.selHead));
328378
+ editor.view?.dispatch(tr);
328379
+ this.#callbacks.scheduleSelectionUpdate?.();
328380
+ return true;
328381
+ } catch (error3) {
328382
+ console.warn("[SELECTION] Failed to extend text selection:", error3);
328383
+ return false;
328384
+ }
327697
328385
  }
327698
328386
  #hitTestTable(x, y$1) {
327699
328387
  return this.#callbacks.hitTestTable?.(x, y$1) ?? null;
@@ -328295,6 +328983,8 @@ menclose::after {
328295
328983
  this.#pendingMarginClick = null;
328296
328984
  const dragAnchor = this.#dragAnchor;
328297
328985
  const dragMode = this.#dragExtensionMode;
328986
+ if ((!pendingMarginClick || pendingMarginClick.pointerId !== event.pointerId) && dragAnchor != null && this.#dragThresholdExceeded)
328987
+ this.#handleDragSelectionAt(event.clientX, event.clientY);
328298
328988
  const dragUsedFallback = this.#dragUsedPageNotMountedFallback;
328299
328989
  const dragPointer = this.#dragLastPointer;
328300
328990
  this.#isDragging = false;
@@ -328777,14 +329467,7 @@ menclose::after {
328777
329467
  if (!editor)
328778
329468
  return;
328779
329469
  const anchor = editor.state.selection.anchor;
328780
- const { selAnchor, selHead } = this.#calculateExtendedSelection(anchor, headPos, this.#dragExtensionMode);
328781
- try {
328782
- const tr = editor.state.tr.setSelection(TextSelection.create(editor.state.doc, selAnchor, selHead));
328783
- editor.view?.dispatch(tr);
328784
- this.#callbacks.scheduleSelectionUpdate?.();
328785
- } catch (error3) {
328786
- console.warn("[SELECTION] Failed to extend selection on shift+click:", error3);
328787
- }
329470
+ this.#dispatchExtendedTextSelection(editor, anchor, headPos);
328788
329471
  this.#focusEditor();
328789
329472
  }
328790
329473
  #handleDragSelectionAt(clientX, clientY) {
@@ -328845,17 +329528,28 @@ menclose::after {
328845
329528
  }
328846
329529
  const anchor = this.#dragAnchor;
328847
329530
  const head = hit.pos;
328848
- const { selAnchor, selHead } = this.#calculateExtendedSelection(anchor, head, this.#dragExtensionMode);
328849
- try {
328850
- const tr = editor.state.tr.setSelection(TextSelection.create(editor.state.doc, selAnchor, selHead));
328851
- editor.view?.dispatch(tr);
328852
- this.#callbacks.scheduleSelectionUpdate?.();
328853
- } catch (error3) {
328854
- console.warn("[SELECTION] Failed to extend selection during drag:", error3);
329531
+ if (!useActiveSurfaceHitTest) {
329532
+ const crossCell = resolveCrossCellSelection(editor.state.doc, anchor, head);
329533
+ if (crossCell)
329534
+ try {
329535
+ const tr = editor.state.tr.setSelection(CellSelection.create(editor.state.doc, crossCell.anchorCellPos, crossCell.headCellPos));
329536
+ editor.view?.dispatch(tr);
329537
+ if (!this.#setCellAnchorFromCellPos(crossCell.anchorCellPos, "active"))
329538
+ console.warn("[CELL-SELECTION] Failed to cache anchor state for cross-cell drag selection.");
329539
+ this.#callbacks.scheduleSelectionUpdate?.();
329540
+ return;
329541
+ } catch (error3) {
329542
+ console.warn("[SELECTION] Failed to create cross-cell CellSelection during drag:", error3);
329543
+ }
328855
329544
  }
329545
+ this.#dispatchExtendedTextSelection(editor, anchor, head);
328856
329546
  }
328857
329547
  #handleCellDragSelection(currentTableHit, hit) {
328858
- const headCellPos = currentTableHit ? this.#getCellPosFromTableHit(currentTableHit) : null;
329548
+ if (!this.#cellAnchor)
329549
+ return;
329550
+ if (!currentTableHit || currentTableHit.block.id !== this.#cellAnchor.tableBlockId)
329551
+ return;
329552
+ const headCellPos = this.#getCellPosFromTableHit(currentTableHit);
328859
329553
  if (headCellPos === null)
328860
329554
  return;
328861
329555
  if (this.#cellDragMode !== "active")
@@ -328875,13 +329569,7 @@ menclose::after {
328875
329569
  } catch (error3) {
328876
329570
  console.warn("[CELL-SELECTION] Failed to create CellSelection, falling back to TextSelection:", error3);
328877
329571
  const anchor = this.#dragAnchor;
328878
- const head = hit.pos;
328879
- const { selAnchor, selHead } = this.#calculateExtendedSelection(anchor, head, this.#dragExtensionMode);
328880
- try {
328881
- const tr = editor.state.tr.setSelection(TextSelection.create(editor.state.doc, selAnchor, selHead));
328882
- editor.view?.dispatch(tr);
328883
- this.#callbacks.scheduleSelectionUpdate?.();
328884
- } catch {}
329572
+ this.#dispatchExtendedTextSelection(editor, anchor, hit.pos);
328885
329573
  }
328886
329574
  }
328887
329575
  #handleHover(normalized) {
@@ -332766,13 +333454,13 @@ menclose::after {
332766
333454
  return;
332767
333455
  console.log(...args$1);
332768
333456
  }, 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;
332769
- var init_src_DhR654Bl_es = __esm(() => {
333457
+ var init_src_BB0n1coY_es = __esm(() => {
332770
333458
  init_rolldown_runtime_Bg48TavK_es();
332771
- init_SuperConverter_CLuVUp7o_es();
333459
+ init_SuperConverter_CCgGAnXY_es();
332772
333460
  init_jszip_C49i9kUs_es();
332773
333461
  init_xml_js_CqGKpaft_es();
332774
333462
  init_uuid_B2wVPhPi_es();
332775
- init_create_headless_toolbar_Dga1mSBS_es();
333463
+ init_create_headless_toolbar_BvrKiWf0_es();
332776
333464
  init_constants_D9qj59G2_es();
332777
333465
  init_dist_B8HfvhaK_es();
332778
333466
  init_unified_Dsuw2be5_es();
@@ -367181,14 +367869,17 @@ function print() { __p += __j.call(arguments, '') }
367181
367869
  return;
367182
367870
  }
367183
367871
  const head = Math.max(0, Math.min(mappedHead.pos, doc$12.content.size));
367184
- const { selAnchor, selHead } = this.#calculateExtendedSelection(anchor, head, mode);
367872
+ const extended = this.#calculateExtendedSelection(anchor, head, mode);
367873
+ const stabilized = stabilizeTextSelectionAcrossTableCells(doc$12, extended.selAnchor, extended.selHead);
367874
+ if (!stabilized)
367875
+ return;
367185
367876
  const current = this.#editor.state.selection;
367186
- const desiredFrom = Math.min(selAnchor, selHead);
367187
- const desiredTo = Math.max(selAnchor, selHead);
367877
+ const desiredFrom = Math.min(stabilized.selAnchor, stabilized.selHead);
367878
+ const desiredTo = Math.max(stabilized.selAnchor, stabilized.selHead);
367188
367879
  if (current.from === desiredFrom && current.to === desiredTo)
367189
367880
  return;
367190
367881
  try {
367191
- const tr = this.#editor.state.tr.setSelection(TextSelection.create(this.#editor.state.doc, selAnchor, selHead));
367882
+ const tr = this.#editor.state.tr.setSelection(TextSelection.create(this.#editor.state.doc, stabilized.selAnchor, stabilized.selHead));
367192
367883
  this.#editor.view?.dispatch(tr);
367193
367884
  this.#scheduleSelectionUpdate();
367194
367885
  } catch {}
@@ -368554,11 +369245,11 @@ function print() { __p += __j.call(arguments, '') }
368554
369245
  ]);
368555
369246
  });
368556
369247
 
368557
- // ../../packages/superdoc/dist/chunks/create-super-doc-ui-DEBNcUWy.es.js
369248
+ // ../../packages/superdoc/dist/chunks/create-super-doc-ui-C_J_pCF0.es.js
368558
369249
  var DEFAULT_TEXT_ALIGN_OPTIONS, DEFAULT_LINE_HEIGHT_OPTIONS, DEFAULT_ZOOM_OPTIONS, DEFAULT_DOCUMENT_MODE_OPTIONS, DEFAULT_FONT_SIZE_OPTIONS, headlessToolbarConstants, 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, FONT_SIZE_OPTIONS;
368559
- var init_create_super_doc_ui_DEBNcUWy_es = __esm(() => {
368560
- init_SuperConverter_CLuVUp7o_es();
368561
- init_create_headless_toolbar_Dga1mSBS_es();
369250
+ var init_create_super_doc_ui_C_J_pCF0_es = __esm(() => {
369251
+ init_SuperConverter_CCgGAnXY_es();
369252
+ init_create_headless_toolbar_BvrKiWf0_es();
368562
369253
  DEFAULT_TEXT_ALIGN_OPTIONS = [
368563
369254
  {
368564
369255
  label: "Left",
@@ -368849,16 +369540,16 @@ var init_zipper_yaJVJ4z9_es = __esm(() => {
368849
369540
 
368850
369541
  // ../../packages/superdoc/dist/super-editor.es.js
368851
369542
  var init_super_editor_es = __esm(() => {
368852
- init_src_DhR654Bl_es();
368853
- init_SuperConverter_CLuVUp7o_es();
369543
+ init_src_BB0n1coY_es();
369544
+ init_SuperConverter_CCgGAnXY_es();
368854
369545
  init_jszip_C49i9kUs_es();
368855
369546
  init_xml_js_CqGKpaft_es();
368856
- init_create_headless_toolbar_Dga1mSBS_es();
369547
+ init_create_headless_toolbar_BvrKiWf0_es();
368857
369548
  init_constants_D9qj59G2_es();
368858
369549
  init_dist_B8HfvhaK_es();
368859
369550
  init_unified_Dsuw2be5_es();
368860
369551
  init_DocxZipper_FUsfThjV_es();
368861
- init_create_super_doc_ui_DEBNcUWy_es();
369552
+ init_create_super_doc_ui_C_J_pCF0_es();
368862
369553
  init_ui_C5PAS9hY_es();
368863
369554
  init_eventemitter3_BnGqBE_Q_es();
368864
369555
  init_errors_CNaD6vcg_es();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superdoc-dev/cli",
3
- "version": "0.17.0-next.23",
3
+ "version": "0.17.0-next.25",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "superdoc": "./dist/index.js"
@@ -24,8 +24,8 @@
24
24
  "@types/node": "22.19.2",
25
25
  "@types/ws": "^8.5.13",
26
26
  "typescript": "^5.9.2",
27
- "@superdoc/super-editor": "0.0.1",
28
27
  "@superdoc/document-api": "0.0.1",
28
+ "@superdoc/super-editor": "0.0.1",
29
29
  "superdoc": "1.39.0"
30
30
  },
31
31
  "module": "src/index.ts",
@@ -33,11 +33,11 @@
33
33
  "access": "public"
34
34
  },
35
35
  "optionalDependencies": {
36
- "@superdoc-dev/cli-darwin-x64": "0.17.0-next.23",
37
- "@superdoc-dev/cli-darwin-arm64": "0.17.0-next.23",
38
- "@superdoc-dev/cli-linux-arm64": "0.17.0-next.23",
39
- "@superdoc-dev/cli-linux-x64": "0.17.0-next.23",
40
- "@superdoc-dev/cli-windows-x64": "0.17.0-next.23"
36
+ "@superdoc-dev/cli-darwin-arm64": "0.17.0-next.25",
37
+ "@superdoc-dev/cli-darwin-x64": "0.17.0-next.25",
38
+ "@superdoc-dev/cli-linux-arm64": "0.17.0-next.25",
39
+ "@superdoc-dev/cli-windows-x64": "0.17.0-next.25",
40
+ "@superdoc-dev/cli-linux-x64": "0.17.0-next.25"
41
41
  },
42
42
  "scripts": {
43
43
  "predev": "node scripts/ensure-superdoc-build.js",