oasis-editor 0.0.112 → 0.0.114

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.
@@ -2539,7 +2539,7 @@ function OasisEditorAppLazy(props = {}) {
2539
2539
  onCleanup(() => {
2540
2540
  cancelled = true;
2541
2541
  });
2542
- import("./OasisEditorApp-p9k7O_1i.js").then((m) => {
2542
+ import("./OasisEditorApp-XloOiKSu.js").then((m) => {
2543
2543
  cancelled = true;
2544
2544
  setProgress(1);
2545
2545
  setTimeout(() => setApp(() => m.OasisEditorApp), 180);
@@ -3057,6 +3057,88 @@ function createStore(...[store, options]) {
3057
3057
  }
3058
3058
  return [wrappedStore, setStore];
3059
3059
  }
3060
+ const $ROOT = Symbol("store-root");
3061
+ function applyState(target, parent, property, merge, key) {
3062
+ const previous = parent[property];
3063
+ if (target === previous) return;
3064
+ const isArray = Array.isArray(target);
3065
+ if (property !== $ROOT && (!isWrappable(target) || !isWrappable(previous) || isArray !== Array.isArray(previous) || key && target[key] !== previous[key])) {
3066
+ setProperty(parent, property, target);
3067
+ return;
3068
+ }
3069
+ if (isArray) {
3070
+ if (target.length && previous.length && (!merge || key && target[0] && target[0][key] != null)) {
3071
+ let i, j, start, end, newEnd, item, newIndicesNext, keyVal;
3072
+ for (start = 0, end = Math.min(previous.length, target.length); start < end && (previous[start] === target[start] || key && previous[start] && target[start] && previous[start][key] && previous[start][key] === target[start][key]); start++) {
3073
+ applyState(target[start], previous, start, merge, key);
3074
+ }
3075
+ const temp = new Array(target.length), newIndices = /* @__PURE__ */ new Map();
3076
+ for (end = previous.length - 1, newEnd = target.length - 1; end >= start && newEnd >= start && (previous[end] === target[newEnd] || key && previous[end] && target[newEnd] && previous[end][key] && previous[end][key] === target[newEnd][key]); end--, newEnd--) {
3077
+ temp[newEnd] = previous[end];
3078
+ }
3079
+ if (start > newEnd || start > end) {
3080
+ for (j = start; j <= newEnd; j++) setProperty(previous, j, target[j]);
3081
+ for (; j < target.length; j++) {
3082
+ setProperty(previous, j, temp[j]);
3083
+ applyState(target[j], previous, j, merge, key);
3084
+ }
3085
+ if (previous.length > target.length) setProperty(previous, "length", target.length);
3086
+ return;
3087
+ }
3088
+ newIndicesNext = new Array(newEnd + 1);
3089
+ for (j = newEnd; j >= start; j--) {
3090
+ item = target[j];
3091
+ keyVal = key && item ? item[key] : item;
3092
+ i = newIndices.get(keyVal);
3093
+ newIndicesNext[j] = i === void 0 ? -1 : i;
3094
+ newIndices.set(keyVal, j);
3095
+ }
3096
+ for (i = start; i <= end; i++) {
3097
+ item = previous[i];
3098
+ keyVal = key && item ? item[key] : item;
3099
+ j = newIndices.get(keyVal);
3100
+ if (j !== void 0 && j !== -1) {
3101
+ temp[j] = previous[i];
3102
+ j = newIndicesNext[j];
3103
+ newIndices.set(keyVal, j);
3104
+ }
3105
+ }
3106
+ for (j = start; j < target.length; j++) {
3107
+ if (j in temp) {
3108
+ setProperty(previous, j, temp[j]);
3109
+ applyState(target[j], previous, j, merge, key);
3110
+ } else setProperty(previous, j, target[j]);
3111
+ }
3112
+ } else {
3113
+ for (let i = 0, len = target.length; i < len; i++) {
3114
+ applyState(target[i], previous, i, merge, key);
3115
+ }
3116
+ }
3117
+ if (previous.length > target.length) setProperty(previous, "length", target.length);
3118
+ return;
3119
+ }
3120
+ const targetKeys = Object.keys(target);
3121
+ for (let i = 0, len = targetKeys.length; i < len; i++) {
3122
+ applyState(target[targetKeys[i]], previous, targetKeys[i], merge, key);
3123
+ }
3124
+ const previousKeys = Object.keys(previous);
3125
+ for (let i = 0, len = previousKeys.length; i < len; i++) {
3126
+ if (target[previousKeys[i]] === void 0) setProperty(previous, previousKeys[i], void 0);
3127
+ }
3128
+ }
3129
+ function reconcile(value, options = {}) {
3130
+ const {
3131
+ merge,
3132
+ key = "id"
3133
+ } = options, v = unwrap(value);
3134
+ return (state) => {
3135
+ if (!isWrappable(state) || !isWrappable(v)) return v;
3136
+ const res = applyState(v, {
3137
+ [$ROOT]: state
3138
+ }, $ROOT, merge, key);
3139
+ return res === void 0 ? state : res;
3140
+ };
3141
+ }
3060
3142
  function assertNever(value, label = "value") {
3061
3143
  const tag = value && typeof value === "object" && "type" in value ? value.type : value;
3062
3144
  throw new Error(`Unhandled ${label}: ${String(tag)}`);
@@ -16271,6 +16353,30 @@ class PaginationTrack {
16271
16353
  return this.pages;
16272
16354
  }
16273
16355
  }
16356
+ function paginateSegments(track, sourceId, segmenter) {
16357
+ var _a, _b;
16358
+ let segmentIndex = 0;
16359
+ while (segmenter.hasMore()) {
16360
+ const segmentId = `${sourceId}:segment:${segmentIndex}`;
16361
+ const remaining = track.currentMaxHeight - track.height;
16362
+ let block = segmenter.fit(segmentId, remaining);
16363
+ if (block === null && track.blocks.length > 0) {
16364
+ (_a = segmenter.onBeforeFlush) == null ? void 0 : _a.call(segmenter);
16365
+ track.flush();
16366
+ continue;
16367
+ }
16368
+ if (block === null) {
16369
+ block = segmenter.force(segmentId);
16370
+ }
16371
+ track.blocks.push(block);
16372
+ track.height += block.estimatedHeight;
16373
+ (_b = segmenter.onAfterPush) == null ? void 0 : _b.call(segmenter, block, segmentIndex);
16374
+ segmentIndex += 1;
16375
+ if (segmenter.hasMore()) {
16376
+ track.flush();
16377
+ }
16378
+ }
16379
+ }
16274
16380
  const TEXT_BOX_AUTOFIT_SAFETY_PX$1 = 2;
16275
16381
  const PARAGRAPH_FIT_HEIGHT_TOLERANCE_PX = 1.5;
16276
16382
  function registerParagraphFloatingExclusions(options) {
@@ -16457,93 +16563,13 @@ function paginateParagraphBlock(track, params, sourceBlock, nextBlock, index) {
16457
16563
  return;
16458
16564
  }
16459
16565
  let startLineIndex = 0;
16460
- let segmentIndex = 0;
16461
- while (startLineIndex < paragraphLayout.lines.length) {
16462
- const remainingHeight = track.currentMaxHeight - track.height;
16463
- let lineEndIndex = startLineIndex;
16464
- let segmentHeight = 0;
16465
- while (lineEndIndex < paragraphLayout.lines.length) {
16466
- const candidateLines = paragraphLayout.lines.slice(
16467
- startLineIndex,
16468
- lineEndIndex + 1
16469
- );
16470
- const candidateHeight = getParagraphSegmentHeight(
16471
- sourceBlock,
16472
- candidateLines,
16473
- startLineIndex === 0,
16474
- lineEndIndex === paragraphLayout.lines.length - 1,
16475
- styles,
16476
- !collapseWithPrevious
16477
- );
16478
- const candidateFitHeight = getParagraphSegmentFitHeight(
16479
- sourceBlock,
16480
- candidateHeight,
16481
- lineEndIndex === paragraphLayout.lines.length - 1,
16482
- styles
16483
- );
16484
- if (candidateFitHeight > remainingHeight + PARAGRAPH_FIT_HEIGHT_TOLERANCE_PX && lineEndIndex === startLineIndex && track.blocks.length > 0) {
16485
- break;
16486
- }
16487
- if (candidateFitHeight > remainingHeight + PARAGRAPH_FIT_HEIGHT_TOLERANCE_PX && lineEndIndex > startLineIndex) {
16488
- break;
16489
- }
16490
- segmentHeight = candidateHeight;
16491
- lineEndIndex += 1;
16492
- }
16493
- if (lineEndIndex === startLineIndex && track.blocks.length > 0) {
16494
- if (contextualAdjustedPreviousBlock && contextualAdjustedAmount > 0) {
16495
- contextualAdjustedPreviousBlock.estimatedHeight += contextualAdjustedAmount;
16496
- track.height += contextualAdjustedAmount;
16497
- contextualAdjustedPreviousBlock = void 0;
16498
- contextualAdjustedAmount = 0;
16499
- }
16500
- collapseWithPrevious = false;
16501
- track.flush();
16502
- continue;
16503
- }
16504
- if (lineEndIndex === startLineIndex) {
16505
- lineEndIndex = Math.min(paragraphLayout.lines.length, startLineIndex + 1);
16506
- segmentHeight = getParagraphSegmentHeight(
16507
- sourceBlock,
16508
- paragraphLayout.lines.slice(startLineIndex, lineEndIndex),
16509
- startLineIndex === 0,
16510
- lineEndIndex === paragraphLayout.lines.length,
16511
- styles,
16512
- !collapseWithPrevious
16513
- );
16514
- }
16515
- if (lineEndIndex < paragraphLayout.lines.length) {
16516
- const widowOrphanAdjusted = applyWidowOrphanControl(
16517
- sourceBlock,
16518
- paragraphLayout.lines,
16519
- startLineIndex,
16520
- lineEndIndex,
16521
- styles,
16522
- !collapseWithPrevious,
16523
- true,
16524
- track.blocks.length > 0
16525
- );
16526
- lineEndIndex = widowOrphanAdjusted.endLineIndexExclusive;
16527
- segmentHeight = widowOrphanAdjusted.height;
16528
- if (lineEndIndex === startLineIndex) {
16529
- if (contextualAdjustedPreviousBlock && contextualAdjustedAmount > 0) {
16530
- contextualAdjustedPreviousBlock.estimatedHeight += contextualAdjustedAmount;
16531
- track.height += contextualAdjustedAmount;
16532
- contextualAdjustedPreviousBlock = void 0;
16533
- contextualAdjustedAmount = 0;
16534
- }
16535
- collapseWithPrevious = false;
16536
- track.flush();
16537
- continue;
16538
- }
16539
- }
16566
+ const buildSegmentBlock = (originalStart, lineEndIndex, segmentHeight, segmentId) => {
16540
16567
  const segmentLayout = createParagraphSegmentLayout(
16541
16568
  paragraphLayout,
16542
- startLineIndex,
16569
+ originalStart,
16543
16570
  lineEndIndex
16544
16571
  );
16545
- const segmentId = `${sourceBlock.id}:segment:${segmentIndex}`;
16546
- const isWholeParagraphSegment = startLineIndex === 0 && lineEndIndex === paragraphLayout.lines.length;
16572
+ const isWholeParagraphSegment = originalStart === 0 && lineEndIndex === paragraphLayout.lines.length;
16547
16573
  const rawMeasuredHeight = getParagraphMeasuredHeight(
16548
16574
  measuredHeights,
16549
16575
  sourceBlock.id,
@@ -16552,8 +16578,8 @@ function paginateParagraphBlock(track, params, sourceBlock, nextBlock, index) {
16552
16578
  segmentHeight
16553
16579
  );
16554
16580
  const hasMeasuredHeight = (measuredHeights == null ? void 0 : measuredHeights[segmentId]) !== void 0 || isWholeParagraphSegment && (measuredHeights == null ? void 0 : measuredHeights[sourceBlock.id]) !== void 0;
16555
- const measuredHeight = collapseWithPrevious && startLineIndex === 0 && hasMeasuredHeight ? Math.max(0, rawMeasuredHeight - (paragraphStyle.spacingBefore ?? 0)) : rawMeasuredHeight;
16556
- track.blocks.push({
16581
+ const measuredHeight = collapseWithPrevious && originalStart === 0 && hasMeasuredHeight ? Math.max(0, rawMeasuredHeight - (paragraphStyle.spacingBefore ?? 0)) : rawMeasuredHeight;
16582
+ return {
16557
16583
  blockId: segmentId,
16558
16584
  sourceBlockId: sourceBlock.id,
16559
16585
  blockType: sourceBlock.type,
@@ -16562,23 +16588,111 @@ function paginateParagraphBlock(track, params, sourceBlock, nextBlock, index) {
16562
16588
  estimatedHeight: measuredHeight,
16563
16589
  layout: segmentLayout,
16564
16590
  sourceBlock
16565
- });
16566
- track.height += measuredHeight;
16567
- if (startLineIndex === 0) {
16568
- registerParagraphFloatingExclusions({
16569
- track,
16570
- layout: segmentLayout,
16571
- blockTop: track.height - measuredHeight + (paragraphStyle.spacingBefore ?? 0),
16572
- params,
16573
- resolveTextBoxHeight
16574
- });
16575
- }
16576
- startLineIndex = lineEndIndex;
16577
- segmentIndex += 1;
16578
- if (startLineIndex < paragraphLayout.lines.length) {
16579
- track.flush();
16591
+ };
16592
+ };
16593
+ paginateSegments(track, sourceBlock.id, {
16594
+ hasMore: () => startLineIndex < paragraphLayout.lines.length,
16595
+ fit(segmentId, remaining) {
16596
+ const originalStart = startLineIndex;
16597
+ let lineEndIndex = originalStart;
16598
+ let segmentHeight = 0;
16599
+ while (lineEndIndex < paragraphLayout.lines.length) {
16600
+ const candidateLines = paragraphLayout.lines.slice(
16601
+ originalStart,
16602
+ lineEndIndex + 1
16603
+ );
16604
+ const candidateHeight = getParagraphSegmentHeight(
16605
+ sourceBlock,
16606
+ candidateLines,
16607
+ originalStart === 0,
16608
+ lineEndIndex === paragraphLayout.lines.length - 1,
16609
+ styles,
16610
+ !collapseWithPrevious
16611
+ );
16612
+ const candidateFitHeight = getParagraphSegmentFitHeight(
16613
+ sourceBlock,
16614
+ candidateHeight,
16615
+ lineEndIndex === paragraphLayout.lines.length - 1,
16616
+ styles
16617
+ );
16618
+ if (candidateFitHeight > remaining + PARAGRAPH_FIT_HEIGHT_TOLERANCE_PX && lineEndIndex === originalStart && track.blocks.length > 0) {
16619
+ break;
16620
+ }
16621
+ if (candidateFitHeight > remaining + PARAGRAPH_FIT_HEIGHT_TOLERANCE_PX && lineEndIndex > originalStart) {
16622
+ break;
16623
+ }
16624
+ segmentHeight = candidateHeight;
16625
+ lineEndIndex += 1;
16626
+ }
16627
+ if (lineEndIndex === originalStart) return null;
16628
+ if (lineEndIndex < paragraphLayout.lines.length) {
16629
+ const widowOrphanAdjusted = applyWidowOrphanControl(
16630
+ sourceBlock,
16631
+ paragraphLayout.lines,
16632
+ originalStart,
16633
+ lineEndIndex,
16634
+ styles,
16635
+ !collapseWithPrevious,
16636
+ true,
16637
+ track.blocks.length > 0
16638
+ );
16639
+ lineEndIndex = widowOrphanAdjusted.endLineIndexExclusive;
16640
+ segmentHeight = widowOrphanAdjusted.height;
16641
+ if (lineEndIndex === originalStart) return null;
16642
+ }
16643
+ const block = buildSegmentBlock(
16644
+ originalStart,
16645
+ lineEndIndex,
16646
+ segmentHeight,
16647
+ segmentId
16648
+ );
16649
+ startLineIndex = lineEndIndex;
16650
+ return block;
16651
+ },
16652
+ force(segmentId) {
16653
+ const originalStart = startLineIndex;
16654
+ const lineEndIndex = Math.min(
16655
+ paragraphLayout.lines.length,
16656
+ originalStart + 1
16657
+ );
16658
+ const segmentHeight = getParagraphSegmentHeight(
16659
+ sourceBlock,
16660
+ paragraphLayout.lines.slice(originalStart, lineEndIndex),
16661
+ originalStart === 0,
16662
+ lineEndIndex === paragraphLayout.lines.length,
16663
+ styles,
16664
+ !collapseWithPrevious
16665
+ );
16666
+ const block = buildSegmentBlock(
16667
+ originalStart,
16668
+ lineEndIndex,
16669
+ segmentHeight,
16670
+ segmentId
16671
+ );
16672
+ startLineIndex = lineEndIndex;
16673
+ return block;
16674
+ },
16675
+ onBeforeFlush() {
16676
+ if (contextualAdjustedPreviousBlock && contextualAdjustedAmount > 0) {
16677
+ contextualAdjustedPreviousBlock.estimatedHeight += contextualAdjustedAmount;
16678
+ track.height += contextualAdjustedAmount;
16679
+ contextualAdjustedPreviousBlock = void 0;
16680
+ contextualAdjustedAmount = 0;
16681
+ }
16682
+ collapseWithPrevious = false;
16683
+ },
16684
+ onAfterPush(block, si) {
16685
+ if (si === 0) {
16686
+ registerParagraphFloatingExclusions({
16687
+ track,
16688
+ layout: block.layout,
16689
+ blockTop: track.height - block.estimatedHeight + (paragraphStyle.spacingBefore ?? 0),
16690
+ params,
16691
+ resolveTextBoxHeight
16692
+ });
16693
+ }
16580
16694
  }
16581
- }
16695
+ });
16582
16696
  }
16583
16697
  function normalizeCellStartPositions(row, starts, legacyStarts) {
16584
16698
  return row.cells.map((_, cellIdx) => {
@@ -16867,139 +16981,192 @@ function paginateTableBlock(track, params, sourceBlock, index) {
16867
16981
  rowGroups
16868
16982
  );
16869
16983
  let groupStartIndex = 0;
16870
- let segmentIndex = 0;
16871
16984
  let currentCellBlockPositions;
16872
- while (groupStartIndex < rowGroups.length) {
16873
- const startRowIndex = rowGroups[groupStartIndex].startRowIndex;
16874
- const repeatedHeaderRowCount = startRowIndex > 0 ? headerRowCount : 0;
16875
- const remainingHeight = track.currentMaxHeight - track.height;
16876
- let groupEndIndex = groupStartIndex;
16877
- let segmentHeight = 0;
16878
- let splitEnds;
16879
- let splitEndPositions;
16880
- let isLastRowSplit = false;
16881
- while (groupEndIndex < rowGroups.length) {
16882
- const candidateEndRowIndex = rowGroups[groupEndIndex].endRowIndexExclusive;
16883
- let candidateHeight = 0;
16884
- if (groupEndIndex === groupStartIndex && currentCellBlockPositions) {
16885
- const firstRow2 = sourceBlock.rows[startRowIndex];
16886
- const starts = normalizeCellStartPositions(
16887
- firstRow2,
16888
- currentCellBlockPositions,
16889
- void 0
16890
- );
16891
- const ends = firstRow2.cells.map((cell) => ({
16892
- blockIndex: cell.blocks.length
16893
- }));
16894
- const slicedFirstRow = buildRowSliceFromPositions(
16895
- firstRow2,
16896
- starts,
16897
- ends
16898
- );
16899
- candidateHeight = getTableSegmentHeight(
16900
- {
16901
- ...sourceBlock,
16902
- rows: [slicedFirstRow]
16903
- },
16904
- 0,
16905
- 1,
16906
- repeatedHeaderRowCount,
16907
- styles,
16908
- contentWidth,
16909
- measurer,
16910
- defaultTabStop
16911
- );
16985
+ const buildTableBlock = (segmentId, startRowIndex, groupEndIndex, repeatedHeaderRowCount, segmentHeight, splitEnds, splitEndPositions, startCellPositions) => {
16986
+ const endRowIndex = rowGroups[groupEndIndex - 1].endRowIndexExclusive;
16987
+ const measuredSegmentHeight = (measuredHeights == null ? void 0 : measuredHeights[segmentId]) ?? segmentHeight;
16988
+ return {
16989
+ blockId: segmentId,
16990
+ sourceBlockId: sourceBlock.id,
16991
+ blockType: sourceBlock.type,
16992
+ globalIndex: index,
16993
+ estimatedHeight: measuredSegmentHeight,
16994
+ tableSegment: {
16995
+ startRowIndex,
16996
+ endRowIndex,
16997
+ repeatedHeaderRowCount,
16998
+ startRowCellBlockStarts: positionsToBlockIndexes(startCellPositions),
16999
+ endRowCellBlockEnds: splitEnds,
17000
+ startRowCellBlockPositions: hasPartialPositions(startCellPositions) ? startCellPositions : void 0,
17001
+ endRowCellBlockPositions: hasPartialPositions(splitEndPositions) ? splitEndPositions : void 0
17002
+ },
17003
+ sourceBlock
17004
+ };
17005
+ };
17006
+ const advanceCursor = (groupEndIndex, isLastRowSplit, splitEnds, splitEndPositions) => {
17007
+ if (isLastRowSplit) {
17008
+ const lastRowIndex = rowGroups[groupEndIndex - 1].startRowIndex;
17009
+ const lastRow = sourceBlock.rows[lastRowIndex];
17010
+ const ends = splitEndPositions ?? (splitEnds == null ? void 0 : splitEnds.map((blockIndex) => ({ blockIndex }))) ?? [];
17011
+ if (positionsFinishedRow(lastRow, ends)) {
17012
+ currentCellBlockPositions = void 0;
17013
+ groupStartIndex = groupEndIndex;
16912
17014
  } else {
16913
- candidateHeight = getTableSegmentHeight(
16914
- sourceBlock,
16915
- startRowIndex,
16916
- candidateEndRowIndex,
16917
- repeatedHeaderRowCount,
16918
- styles,
16919
- contentWidth,
16920
- measurer,
16921
- defaultTabStop
16922
- );
16923
- }
16924
- if (candidateHeight <= remainingHeight) {
16925
- segmentHeight = candidateHeight;
16926
- groupEndIndex += 1;
16927
- continue;
17015
+ currentCellBlockPositions = ends;
17016
+ groupStartIndex = groupEndIndex - 1;
16928
17017
  }
16929
- const isSingleRowGroup = candidateEndRowIndex === rowGroups[groupEndIndex].startRowIndex + 1;
16930
- const targetRow = sourceBlock.rows[rowGroups[groupEndIndex].startRowIndex];
16931
- const isSplitCandidate = isSingleRowGroup && canSplitTableRow(targetRow);
16932
- if (isSplitCandidate) {
16933
- const precedingHeight = groupEndIndex > groupStartIndex ? getTableSegmentHeight(
16934
- sourceBlock,
16935
- startRowIndex,
16936
- rowGroups[groupEndIndex].startRowIndex,
16937
- repeatedHeaderRowCount,
16938
- styles,
16939
- contentWidth,
16940
- measurer,
16941
- defaultTabStop
16942
- ) : 0;
16943
- const availableForSplitRow = remainingHeight - precedingHeight;
16944
- if (availableForSplitRow > 0) {
17018
+ } else {
17019
+ currentCellBlockPositions = void 0;
17020
+ groupStartIndex = groupEndIndex;
17021
+ }
17022
+ };
17023
+ paginateSegments(track, sourceBlock.id, {
17024
+ hasMore: () => groupStartIndex < rowGroups.length,
17025
+ fit(segmentId, remaining) {
17026
+ const startRowIndex = rowGroups[groupStartIndex].startRowIndex;
17027
+ const repeatedHeaderRowCount = startRowIndex > 0 ? headerRowCount : 0;
17028
+ const startCellPositions = currentCellBlockPositions;
17029
+ let groupEndIndex = groupStartIndex;
17030
+ let segmentHeight = 0;
17031
+ let splitEnds;
17032
+ let splitEndPositions;
17033
+ let isLastRowSplit = false;
17034
+ while (groupEndIndex < rowGroups.length) {
17035
+ const candidateEndRowIndex = rowGroups[groupEndIndex].endRowIndexExclusive;
17036
+ let candidateHeight = 0;
17037
+ if (groupEndIndex === groupStartIndex && currentCellBlockPositions) {
17038
+ const firstRow2 = sourceBlock.rows[startRowIndex];
16945
17039
  const starts = normalizeCellStartPositions(
16946
- targetRow,
16947
- groupEndIndex === groupStartIndex ? currentCellBlockPositions : void 0,
17040
+ firstRow2,
17041
+ currentCellBlockPositions,
16948
17042
  void 0
16949
17043
  );
16950
- const ends = targetRow.cells.map(
16951
- (_, cellIdx) => findCellSplitEndPosition(
16952
- targetRow,
16953
- cellIdx,
16954
- starts[cellIdx] ?? { blockIndex: 0 },
16955
- availableForSplitRow,
16956
- styles,
16957
- measurer,
16958
- defaultTabStop,
16959
- contentWidth,
16960
- sourceBlock,
16961
- rowGroups[groupEndIndex].startRowIndex
16962
- )
17044
+ const ends = firstRow2.cells.map((cell) => ({
17045
+ blockIndex: cell.blocks.length
17046
+ }));
17047
+ const slicedFirstRow = buildRowSliceFromPositions(
17048
+ firstRow2,
17049
+ starts,
17050
+ ends
17051
+ );
17052
+ candidateHeight = getTableSegmentHeight(
17053
+ { ...sourceBlock, rows: [slicedFirstRow] },
17054
+ 0,
17055
+ 1,
17056
+ repeatedHeaderRowCount,
17057
+ styles,
17058
+ contentWidth,
17059
+ measurer,
17060
+ defaultTabStop
17061
+ );
17062
+ } else {
17063
+ candidateHeight = getTableSegmentHeight(
17064
+ sourceBlock,
17065
+ startRowIndex,
17066
+ candidateEndRowIndex,
17067
+ repeatedHeaderRowCount,
17068
+ styles,
17069
+ contentWidth,
17070
+ measurer,
17071
+ defaultTabStop
16963
17072
  );
16964
- const canProgress = positionsProgressed(starts, ends);
16965
- if (canProgress) {
16966
- splitEnds = positionsToBlockIndexes(ends);
16967
- isLastRowSplit = true;
16968
- const slicedLastRow = buildRowSliceFromPositions(
17073
+ }
17074
+ if (candidateHeight <= remaining) {
17075
+ segmentHeight = candidateHeight;
17076
+ groupEndIndex += 1;
17077
+ continue;
17078
+ }
17079
+ const isSingleRowGroup = candidateEndRowIndex === rowGroups[groupEndIndex].startRowIndex + 1;
17080
+ const targetRow = sourceBlock.rows[rowGroups[groupEndIndex].startRowIndex];
17081
+ const isSplitCandidate = isSingleRowGroup && canSplitTableRow(targetRow);
17082
+ if (isSplitCandidate) {
17083
+ const precedingHeight = groupEndIndex > groupStartIndex ? getTableSegmentHeight(
17084
+ sourceBlock,
17085
+ startRowIndex,
17086
+ rowGroups[groupEndIndex].startRowIndex,
17087
+ repeatedHeaderRowCount,
17088
+ styles,
17089
+ contentWidth,
17090
+ measurer,
17091
+ defaultTabStop
17092
+ ) : 0;
17093
+ const availableForSplitRow = remaining - precedingHeight;
17094
+ if (availableForSplitRow > 0) {
17095
+ const starts = normalizeCellStartPositions(
16969
17096
  targetRow,
16970
- starts,
16971
- ends
17097
+ groupEndIndex === groupStartIndex ? currentCellBlockPositions : void 0,
17098
+ void 0
16972
17099
  );
16973
- const segmentRows = [
16974
- ...sourceBlock.rows.slice(
16975
- startRowIndex,
17100
+ const ends = targetRow.cells.map(
17101
+ (_, cellIdx) => findCellSplitEndPosition(
17102
+ targetRow,
17103
+ cellIdx,
17104
+ starts[cellIdx] ?? { blockIndex: 0 },
17105
+ availableForSplitRow,
17106
+ styles,
17107
+ measurer,
17108
+ defaultTabStop,
17109
+ contentWidth,
17110
+ sourceBlock,
16976
17111
  rowGroups[groupEndIndex].startRowIndex
16977
- ),
16978
- slicedLastRow
16979
- ];
16980
- segmentHeight = getTableSegmentHeight(
16981
- { ...sourceBlock, rows: segmentRows },
16982
- 0,
16983
- segmentRows.length,
16984
- repeatedHeaderRowCount,
16985
- styles,
16986
- contentWidth,
16987
- measurer,
16988
- defaultTabStop
17112
+ )
16989
17113
  );
16990
- splitEndPositions = ends;
16991
- groupEndIndex += 1;
16992
- break;
17114
+ if (positionsProgressed(starts, ends)) {
17115
+ splitEnds = positionsToBlockIndexes(ends);
17116
+ isLastRowSplit = true;
17117
+ const slicedLastRow = buildRowSliceFromPositions(
17118
+ targetRow,
17119
+ starts,
17120
+ ends
17121
+ );
17122
+ const segmentRows = [
17123
+ ...sourceBlock.rows.slice(
17124
+ startRowIndex,
17125
+ rowGroups[groupEndIndex].startRowIndex
17126
+ ),
17127
+ slicedLastRow
17128
+ ];
17129
+ segmentHeight = getTableSegmentHeight(
17130
+ { ...sourceBlock, rows: segmentRows },
17131
+ 0,
17132
+ segmentRows.length,
17133
+ repeatedHeaderRowCount,
17134
+ styles,
17135
+ contentWidth,
17136
+ measurer,
17137
+ defaultTabStop
17138
+ );
17139
+ splitEndPositions = ends;
17140
+ groupEndIndex += 1;
17141
+ break;
17142
+ }
16993
17143
  }
16994
17144
  }
17145
+ break;
16995
17146
  }
16996
- break;
16997
- }
16998
- if (groupEndIndex === groupStartIndex && track.blocks.length > 0) {
16999
- track.flush();
17000
- continue;
17001
- }
17002
- if (groupEndIndex === groupStartIndex) {
17147
+ if (groupEndIndex === groupStartIndex) return null;
17148
+ const block = buildTableBlock(
17149
+ segmentId,
17150
+ startRowIndex,
17151
+ groupEndIndex,
17152
+ repeatedHeaderRowCount,
17153
+ segmentHeight,
17154
+ splitEnds,
17155
+ splitEndPositions,
17156
+ startCellPositions
17157
+ );
17158
+ advanceCursor(groupEndIndex, isLastRowSplit, splitEnds, splitEndPositions);
17159
+ return block;
17160
+ },
17161
+ force(segmentId) {
17162
+ const startRowIndex = rowGroups[groupStartIndex].startRowIndex;
17163
+ const repeatedHeaderRowCount = startRowIndex > 0 ? headerRowCount : 0;
17164
+ const startCellPositions = currentCellBlockPositions;
17165
+ let groupEndIndex = groupStartIndex;
17166
+ let segmentHeight = 0;
17167
+ let splitEnds;
17168
+ let splitEndPositions;
17169
+ let isLastRowSplit = false;
17003
17170
  const targetRow = sourceBlock.rows[startRowIndex];
17004
17171
  const isSingleRowGroup = rowGroups[groupStartIndex].endRowIndexExclusive === startRowIndex + 1;
17005
17172
  const isSplitCandidate = isSingleRowGroup && canSplitTableRow(targetRow);
@@ -17034,11 +17201,7 @@ function paginateTableBlock(track, params, sourceBlock, index) {
17034
17201
  splitEnds = positionsToBlockIndexes(ends);
17035
17202
  splitEndPositions = ends;
17036
17203
  isLastRowSplit = true;
17037
- const slicedLastRow = buildRowSliceFromPositions(
17038
- targetRow,
17039
- starts,
17040
- ends
17041
- );
17204
+ const slicedLastRow = buildRowSliceFromPositions(targetRow, starts, ends);
17042
17205
  segmentHeight = getTableSegmentHeight(
17043
17206
  { ...sourceBlock, rows: [slicedLastRow] },
17044
17207
  0,
@@ -17063,53 +17226,20 @@ function paginateTableBlock(track, params, sourceBlock, index) {
17063
17226
  defaultTabStop
17064
17227
  );
17065
17228
  }
17066
- }
17067
- const segmentId = `${sourceBlock.id}:segment:${segmentIndex}`;
17068
- const measuredSegmentHeight = (measuredHeights == null ? void 0 : measuredHeights[segmentId]) ?? segmentHeight;
17069
- const endRowIndex = rowGroups[groupEndIndex - 1].endRowIndexExclusive;
17070
- track.blocks.push({
17071
- blockId: segmentId,
17072
- sourceBlockId: sourceBlock.id,
17073
- blockType: sourceBlock.type,
17074
- globalIndex: index,
17075
- estimatedHeight: measuredSegmentHeight,
17076
- tableSegment: {
17229
+ const block = buildTableBlock(
17230
+ segmentId,
17077
17231
  startRowIndex,
17078
- endRowIndex,
17232
+ groupEndIndex,
17079
17233
  repeatedHeaderRowCount,
17080
- startRowCellBlockStarts: positionsToBlockIndexes(
17081
- currentCellBlockPositions
17082
- ),
17083
- endRowCellBlockEnds: splitEnds,
17084
- startRowCellBlockPositions: hasPartialPositions(
17085
- currentCellBlockPositions
17086
- ) ? currentCellBlockPositions : void 0,
17087
- endRowCellBlockPositions: hasPartialPositions(splitEndPositions) ? splitEndPositions : void 0
17088
- },
17089
- sourceBlock
17090
- });
17091
- track.height += measuredSegmentHeight;
17092
- segmentIndex += 1;
17093
- if (isLastRowSplit) {
17094
- const lastRowIndex = rowGroups[groupEndIndex - 1].startRowIndex;
17095
- const lastRow = sourceBlock.rows[lastRowIndex];
17096
- const ends = splitEndPositions ?? (splitEnds == null ? void 0 : splitEnds.map((blockIndex) => ({ blockIndex }))) ?? [];
17097
- const isFinished = positionsFinishedRow(lastRow, ends);
17098
- if (isFinished) {
17099
- currentCellBlockPositions = void 0;
17100
- groupStartIndex = groupEndIndex;
17101
- } else {
17102
- currentCellBlockPositions = ends;
17103
- groupStartIndex = groupEndIndex - 1;
17104
- }
17105
- } else {
17106
- currentCellBlockPositions = void 0;
17107
- groupStartIndex = groupEndIndex;
17108
- }
17109
- if (groupStartIndex < rowGroups.length) {
17110
- track.flush();
17234
+ segmentHeight,
17235
+ splitEnds,
17236
+ splitEndPositions,
17237
+ startCellPositions
17238
+ );
17239
+ advanceCursor(groupEndIndex, isLastRowSplit, splitEnds, splitEndPositions);
17240
+ return block;
17111
17241
  }
17112
- }
17242
+ });
17113
17243
  }
17114
17244
  function projectBlocksLayout(context2) {
17115
17245
  const columns = context2.pageSettings.columns;
@@ -17519,6 +17649,19 @@ function applyCanvasTextFeatureHints(ctx, styles, fontSizePx) {
17519
17649
  featureCtx.textRendering = (styles == null ? void 0 : styles.ligatures) && styles.ligatures !== "none" ? "optimizeLegibility" : "optimizeSpeed";
17520
17650
  }
17521
17651
  }
17652
+ function resolveCanvasRunPaintStyle(styles) {
17653
+ const fontSize = (styles == null ? void 0 : styles.fontSize) ?? DEFAULT_FONT_SIZE_PX;
17654
+ const fontFamily = resolveCanvasFontFamily(styles == null ? void 0 : styles.fontFamily);
17655
+ const fontWeight = (styles == null ? void 0 : styles.bold) ? "700" : "400";
17656
+ const fontStyle = (styles == null ? void 0 : styles.italic) ? "italic" : "normal";
17657
+ const renderMetrics = resolveCanvasTextRenderMetrics(styles, fontSize);
17658
+ return {
17659
+ font: `${fontStyle} ${fontWeight} ${renderMetrics.fontSize}px ${fontFamily}`,
17660
+ fillStyle: (styles == null ? void 0 : styles.color) ?? "#000000",
17661
+ renderMetrics,
17662
+ scale: (styles == null ? void 0 : styles.characterScale) && styles.characterScale > 0 ? styles.characterScale / 100 : 1
17663
+ };
17664
+ }
17522
17665
  function resolveVerticalMode(direction) {
17523
17666
  switch (direction) {
17524
17667
  case "tbRl":
@@ -17649,10 +17792,8 @@ function layoutStackedGlyphs(paragraph, state, box, startColumn, columnsRtl = tr
17649
17792
  state.document.styles
17650
17793
  );
17651
17794
  const fontSize = styles.fontSize ?? DEFAULT_FONT_SIZE_PX;
17652
- const metrics = resolveCanvasTextRenderMetrics(styles, fontSize);
17795
+ const { font, fillStyle: color } = resolveCanvasRunPaintStyle(styles);
17653
17796
  const glyphHeight = fontSize * STACK_LINE_FACTOR;
17654
- const font = `${styles.italic ? "italic" : "normal"} ${styles.bold ? "700" : "400"} ${metrics.fontSize}px ${resolveCanvasFontFamily(styles.fontFamily)}`;
17655
- const color = styles.color ?? "#000000";
17656
17797
  for (const char of run.text) {
17657
17798
  if (char === "\n") {
17658
17799
  newColumn();
@@ -17998,7 +18139,8 @@ function buildCanvasTableLayout(options) {
17998
18139
  const isStacked = verticalMode === "stack";
17999
18140
  const isFitText = !!((_w = cell.style) == null ? void 0 : _w.fitText) && !isRotated && !isStacked;
18000
18141
  const explicitRowHeightPx = parseDimensionToPx(effectiveRow.height);
18001
- const wrapWidth = isRotated || ((_x = cell.style) == null ? void 0 : _x.noWrap) ? isRotated && explicitRowHeightPx !== null && explicitRowHeightPx > 0 ? Math.max(
18142
+ const hasExplicitRowHeight = explicitRowHeightPx !== null && explicitRowHeightPx > 0;
18143
+ const wrapWidth = isRotated || ((_x = cell.style) == null ? void 0 : _x.noWrap) ? isRotated && hasExplicitRowHeight ? Math.max(
18002
18144
  MIN_TABLE_CELL_CONTENT_WIDTH_PX,
18003
18145
  explicitRowHeightPx - borders.top.width - borders.bottom.width - padding.top - padding.bottom
18004
18146
  ) : NO_WRAP_WIDTH_PX : contentWidthPx;
@@ -18040,7 +18182,6 @@ function buildCanvasTableLayout(options) {
18040
18182
  spacingBefore,
18041
18183
  spacingAfter
18042
18184
  });
18043
- const hasExplicitRowHeight = explicitRowHeightPx !== null && explicitRowHeightPx > 0;
18044
18185
  const paragraphStyleSize = ((_A = (_z = paragraph.runs[0]) == null ? void 0 : _z.styles) == null ? void 0 : _A.fontSize) ?? DEFAULT_FONT_SIZE_PX;
18045
18186
  contentNaturalHeightPx = Math.max(
18046
18187
  contentNaturalHeightPx,
@@ -18103,7 +18244,6 @@ function buildCanvasTableLayout(options) {
18103
18244
  });
18104
18245
  if (isRotated) {
18105
18246
  const lineThickness = projected.lines.length > 0 ? Math.max(...projected.lines.map((line) => line.height)) : paragraphHeight;
18106
- const hasExplicitRowHeight = explicitRowHeightPx !== null && explicitRowHeightPx > 0;
18107
18247
  const flowLength = projected.lines.length ? Math.max(
18108
18248
  ...projected.lines.map((line) => {
18109
18249
  const last = line.slots[line.slots.length - 1];
@@ -18273,6 +18413,35 @@ function PageBreak(props) {
18273
18413
  return _el$;
18274
18414
  })();
18275
18415
  }
18416
+ const HEX6_PATTERN = /^[0-9a-fA-F]{6}$/;
18417
+ function stripHashPrefix(color) {
18418
+ return color.trim().replace(/^#/, "");
18419
+ }
18420
+ function normalizeHex6(color) {
18421
+ if (!color) {
18422
+ return null;
18423
+ }
18424
+ const body = stripHashPrefix(color);
18425
+ return HEX6_PATTERN.test(body) ? body.toUpperCase() : null;
18426
+ }
18427
+ function parseHexColorToRgb255(color) {
18428
+ if (!color) {
18429
+ return null;
18430
+ }
18431
+ const normalized = stripHashPrefix(color);
18432
+ if (!HEX6_PATTERN.test(normalized)) {
18433
+ return null;
18434
+ }
18435
+ return [
18436
+ Number.parseInt(normalized.slice(0, 2), 16),
18437
+ Number.parseInt(normalized.slice(2, 4), 16),
18438
+ Number.parseInt(normalized.slice(4, 6), 16)
18439
+ ];
18440
+ }
18441
+ function rgb255ToHex(r, g2, b) {
18442
+ const toHex2 = (value) => Math.max(0, Math.min(255, Math.round(value))).toString(16).padStart(2, "0");
18443
+ return `#${toHex2(r)}${toHex2(g2)}${toHex2(b)}`;
18444
+ }
18276
18445
  const imageCache = /* @__PURE__ */ new Map();
18277
18446
  function getCachedCanvasImage(src, onUpdate) {
18278
18447
  const cached = imageCache.get(src);
@@ -19817,6 +19986,39 @@ function buildPresetPath(preset, x, y, width, height) {
19817
19986
  }
19818
19987
  return path;
19819
19988
  }
19989
+ const DEG_TO_RAD = Math.PI / 180;
19990
+ const CANVAS_DASH_DASHED = [5, 3];
19991
+ const CANVAS_DASH_DOTTED = [1, 3];
19992
+ function drawEdge(ctx, border, x1, y1, x2, y2) {
19993
+ if (!border || border.type === "none" || border.width <= 0) {
19994
+ return;
19995
+ }
19996
+ ctx.save();
19997
+ ctx.beginPath();
19998
+ ctx.strokeStyle = border.color;
19999
+ ctx.lineWidth = border.width;
20000
+ if (border.type === "dashed") {
20001
+ ctx.setLineDash(CANVAS_DASH_DASHED);
20002
+ } else if (border.type === "dotted") {
20003
+ ctx.setLineDash(CANVAS_DASH_DOTTED);
20004
+ } else {
20005
+ ctx.setLineDash([]);
20006
+ }
20007
+ ctx.moveTo(x1, y1);
20008
+ ctx.lineTo(x2, y2);
20009
+ ctx.stroke();
20010
+ ctx.restore();
20011
+ }
20012
+ function drawBorderBox(ctx, left, top, width, height, borders) {
20013
+ const right = left + width;
20014
+ const bottom = top + height;
20015
+ drawEdge(ctx, borders.top, left, top, right, top);
20016
+ drawEdge(ctx, borders.right, right, top, right, bottom);
20017
+ drawEdge(ctx, borders.bottom, left, bottom, right, bottom);
20018
+ drawEdge(ctx, borders.left, left, top, left, bottom);
20019
+ drawEdge(ctx, borders.topLeftToBottomRight, left, top, right, bottom);
20020
+ drawEdge(ctx, borders.topRightToBottomLeft, right, top, left, bottom);
20021
+ }
19820
20022
  const TEXT_BOX_AUTOFIT_MEASURE_HEIGHT = 1e5;
19821
20023
  const TEXT_BOX_AUTOFIT_SAFETY_PX = 2;
19822
20024
  function getTextBoxPadding(textBox) {
@@ -20001,7 +20203,7 @@ function paintTextBox(ctx, textBox, state, x, y, width, height, pageIndex, onUpd
20001
20203
  if (rotation) {
20002
20204
  ctx.save();
20003
20205
  ctx.translate(x + width / 2, y + height / 2);
20004
- ctx.rotate(rotation * Math.PI / 180);
20206
+ ctx.rotate(rotation * DEG_TO_RAD);
20005
20207
  ctx.translate(-(x + width / 2), -(y + height / 2));
20006
20208
  }
20007
20209
  drawTextBoxShape(ctx, textBox, x, y, width, height);
@@ -20203,6 +20405,8 @@ function isDoubleUnderlineStyle(underlineStyle) {
20203
20405
  function isWavyUnderlineStyle(underlineStyle) {
20204
20406
  return underlineStyle === "wave" || underlineStyle === "wavyHeavy";
20205
20407
  }
20408
+ const WAVY_UNDERLINE_AMPLITUDE_PX = 1.5;
20409
+ const WAVY_UNDERLINE_WAVELENGTH_PX = 4;
20206
20410
  function underlineStyleLineWidthPx(underlineStyle) {
20207
20411
  switch (underlineStyle) {
20208
20412
  case "thick":
@@ -20268,42 +20472,12 @@ function underlineStyleDashArray(underlineStyle) {
20268
20472
  return void 0;
20269
20473
  }
20270
20474
  }
20271
- const CANVAS_DASH_DASHED = [5, 3];
20272
- const CANVAS_DASH_DOTTED = [1, 3];
20273
- function drawEdge(ctx, border, x1, y1, x2, y2) {
20274
- if (!border || border.type === "none" || border.width <= 0) {
20275
- return;
20276
- }
20277
- ctx.save();
20278
- ctx.beginPath();
20279
- ctx.strokeStyle = border.color;
20280
- ctx.lineWidth = border.width;
20281
- if (border.type === "dashed") {
20282
- ctx.setLineDash(CANVAS_DASH_DASHED);
20283
- } else if (border.type === "dotted") {
20284
- ctx.setLineDash(CANVAS_DASH_DOTTED);
20285
- } else {
20286
- ctx.setLineDash([]);
20287
- }
20288
- ctx.moveTo(x1, y1);
20289
- ctx.lineTo(x2, y2);
20290
- ctx.stroke();
20291
- ctx.restore();
20292
- }
20293
- function drawBorderBox(ctx, left, top, width, height, borders) {
20294
- const right = left + width;
20295
- const bottom = top + height;
20296
- drawEdge(ctx, borders.top, left, top, right, top);
20297
- drawEdge(ctx, borders.right, right, top, right, bottom);
20298
- drawEdge(ctx, borders.bottom, left, bottom, right, bottom);
20299
- drawEdge(ctx, borders.left, left, top, left, bottom);
20300
- drawEdge(ctx, borders.topLeftToBottomRight, left, top, right, bottom);
20301
- drawEdge(ctx, borders.topRightToBottomLeft, right, top, left, bottom);
20302
- }
20303
20475
  const DOUBLE_STRIKE_OFFSET_PX = 1.3;
20304
20476
  const DOUBLE_UNDERLINE_OFFSET_PX = 1.5;
20305
- const WAVY_UNDERLINE_AMPLITUDE_PX = 1.5;
20306
- const WAVY_UNDERLINE_WAVELENGTH_PX = 4;
20477
+ function hexToRgba(color, alpha) {
20478
+ const [r, g2, b] = parseHexColorToRgb255(color) ?? [0, 0, 0];
20479
+ return `rgba(${r},${g2},${b},${alpha})`;
20480
+ }
20307
20481
  const canvasTextLogger = createEditorLogger("canvas-text");
20308
20482
  const loggedCanvasFontKeys = /* @__PURE__ */ new Set();
20309
20483
  const MAX_CANVAS_FONT_LOGS = 40;
@@ -20382,7 +20556,7 @@ function drawImageFragment(ctx, img, image, x, y) {
20382
20556
  if (hasTransform) {
20383
20557
  ctx.translate(x + width / 2, y + height / 2);
20384
20558
  if (rotation) {
20385
- ctx.rotate(rotation * Math.PI / 180);
20559
+ ctx.rotate(rotation * DEG_TO_RAD);
20386
20560
  }
20387
20561
  ctx.scale(flipH ? -1 : 1, flipV ? -1 : 1);
20388
20562
  ctx.translate(-(x + width / 2), -(y + height / 2));
@@ -20416,7 +20590,7 @@ function drawImageFragment(ctx, img, image, x, y) {
20416
20590
  ctx.save();
20417
20591
  ctx.translate(x + width / 2, y + height / 2);
20418
20592
  if (rotation) {
20419
- ctx.rotate(rotation * Math.PI / 180);
20593
+ ctx.rotate(rotation * DEG_TO_RAD);
20420
20594
  }
20421
20595
  ctx.scale(flipH ? -1 : 1, flipV ? -1 : 1);
20422
20596
  ctx.drawImage(img, sx, sy, sw, sh, -width / 2, -height / 2, width, height);
@@ -20490,13 +20664,10 @@ function drawParagraph(ctx, paragraph, lines, state, originX, originY, onUpdate,
20490
20664
  (_b = paragraph.style) == null ? void 0 : _b.styleId,
20491
20665
  state.document.styles
20492
20666
  );
20493
- const prefixFontSize = prefixStyles.fontSize ?? DEFAULT_FONT_SIZE_PX;
20494
- const prefixWeight = prefixStyles.bold ? "700" : "400";
20495
- const prefixStyle = prefixStyles.italic ? "italic" : "normal";
20496
- const prefixFamily = resolveCanvasFontFamily(prefixStyles.fontFamily);
20667
+ const { font: prefixFont, fillStyle: prefixFillStyle } = resolveCanvasRunPaintStyle(prefixStyles);
20497
20668
  ctx.save();
20498
- ctx.font = `${prefixStyle} ${prefixWeight} ${prefixFontSize}px ${prefixFamily}`;
20499
- ctx.fillStyle = prefixStyles.color ?? "#000000";
20669
+ ctx.font = prefixFont;
20670
+ ctx.fillStyle = prefixFillStyle;
20500
20671
  const first = line.slots[0];
20501
20672
  const gap = ctx.measureText(`${listPrefix} `).width;
20502
20673
  const labelInset = getListLabelInset(paragraph, state.document.styles);
@@ -20524,12 +20695,9 @@ function drawParagraph(ctx, paragraph, lines, state, originX, originY, onUpdate,
20524
20695
  const metricFamily = resolveMetricCompatibleFamily(
20525
20696
  styles.fontFamily ?? "Calibri"
20526
20697
  );
20527
- const fontFamily = resolveCanvasFontFamily(styles.fontFamily);
20528
- const fontWeight = styles.bold ? "700" : "400";
20529
- const fontStyle = styles.italic ? "italic" : "normal";
20530
- const renderMetrics = resolveCanvasTextRenderMetrics(styles, fontSize);
20698
+ const { font, renderMetrics } = resolveCanvasRunPaintStyle(styles);
20531
20699
  ctx.save();
20532
- ctx.font = `${fontStyle} ${fontWeight} ${renderMetrics.fontSize}px ${fontFamily}`;
20700
+ ctx.font = font;
20533
20701
  applyCanvasTextFeatureHints(ctx, styles, fontSize);
20534
20702
  logCanvasFontUse({
20535
20703
  requestedFamily: styles.fontFamily,
@@ -20698,18 +20866,10 @@ function drawParagraph(ctx, paragraph, lines, state, originX, originY, onUpdate,
20698
20866
  state.document.styles
20699
20867
  );
20700
20868
  if (!styles.hidden) {
20701
- const fontSize = styles.fontSize ?? DEFAULT_FONT_SIZE_PX;
20702
- const fontFamily = resolveCanvasFontFamily(styles.fontFamily);
20703
- const fontWeight = styles.bold ? "700" : "400";
20704
- const fontStyle = styles.italic ? "italic" : "normal";
20705
- const renderMetrics = resolveCanvasTextRenderMetrics(
20706
- styles,
20707
- fontSize
20708
- );
20709
- const scale = styles.characterScale && styles.characterScale > 0 ? styles.characterScale / 100 : 1;
20869
+ const { font, fillStyle, renderMetrics, scale } = resolveCanvasRunPaintStyle(styles);
20710
20870
  ctx.save();
20711
- ctx.font = `${fontStyle} ${fontWeight} ${renderMetrics.fontSize}px ${fontFamily}`;
20712
- ctx.fillStyle = styles.color ?? "#000000";
20871
+ ctx.font = font;
20872
+ ctx.fillStyle = fillStyle;
20713
20873
  drawStyledText(
20714
20874
  ctx,
20715
20875
  "-",
@@ -20737,11 +20897,11 @@ function drawParagraph(ctx, paragraph, lines, state, originX, originY, onUpdate,
20737
20897
  }
20738
20898
  }
20739
20899
  }
20740
- function drawFragmentHighlight(ctx, line, fragment, originX, originY, color) {
20900
+ function drawFragmentColorRect(ctx, line, fragment, originX, originY, color, alpha) {
20741
20901
  const bounds = resolveFragmentPaintBounds(line, fragment);
20742
20902
  if (!bounds) return;
20743
20903
  ctx.save();
20744
- ctx.globalAlpha = 0.35;
20904
+ if (alpha !== void 0) ctx.globalAlpha = alpha;
20745
20905
  ctx.fillStyle = color;
20746
20906
  ctx.fillRect(
20747
20907
  originX + bounds.left,
@@ -20751,6 +20911,9 @@ function drawFragmentHighlight(ctx, line, fragment, originX, originY, color) {
20751
20911
  );
20752
20912
  ctx.restore();
20753
20913
  }
20914
+ function drawFragmentHighlight(ctx, line, fragment, originX, originY, color) {
20915
+ drawFragmentColorRect(ctx, line, fragment, originX, originY, color, 0.35);
20916
+ }
20754
20917
  function resolveFragmentPaintBounds(line, fragment) {
20755
20918
  const slotByOffset = new Map(
20756
20919
  line.slots.map((slot) => [slot.offset, slot])
@@ -20773,17 +20936,7 @@ function resolveFragmentPaintBounds(line, fragment) {
20773
20936
  };
20774
20937
  }
20775
20938
  function drawFragmentShading(ctx, line, fragment, originX, originY, color) {
20776
- const bounds = resolveFragmentPaintBounds(line, fragment);
20777
- if (!bounds) return;
20778
- ctx.save();
20779
- ctx.fillStyle = color;
20780
- ctx.fillRect(
20781
- originX + bounds.left,
20782
- originY + line.top + 2,
20783
- Math.max(0, bounds.right - bounds.left),
20784
- Math.max(2, line.height - 4)
20785
- );
20786
- ctx.restore();
20939
+ drawFragmentColorRect(ctx, line, fragment, originX, originY, color);
20787
20940
  }
20788
20941
  function getRenderedChar(char, styles) {
20789
20942
  return styles.allCaps ? char.toUpperCase() : char;
@@ -20813,16 +20966,12 @@ function resolveCanvasTextFill(ctx, styles, line, fragment, originX, originY) {
20813
20966
  const cx = (x0 + x1) / 2;
20814
20967
  const cy = (y0 + y1) / 2;
20815
20968
  const angleDeg = fill.angle ?? 0;
20816
- const rad = angleDeg * Math.PI / 180;
20969
+ const rad = angleDeg * DEG_TO_RAD;
20817
20970
  const dx = Math.cos(rad) * (x1 - x0) / 2;
20818
20971
  const dy = Math.sin(rad) * (y1 - y0) / 2;
20819
20972
  const gradient = ctx.createLinearGradient(cx - dx, cy - dy, cx + dx, cy + dy);
20820
20973
  for (const stop of fill.stops) {
20821
- const alpha = stop.alpha ?? 1;
20822
- const r = Number.parseInt(stop.color.slice(1, 3), 16);
20823
- const g2 = Number.parseInt(stop.color.slice(3, 5), 16);
20824
- const b = Number.parseInt(stop.color.slice(5, 7), 16);
20825
- gradient.addColorStop(stop.position, `rgba(${r},${g2},${b},${alpha})`);
20974
+ gradient.addColorStop(stop.position, hexToRgba(stop.color, stop.alpha ?? 1));
20826
20975
  }
20827
20976
  return gradient;
20828
20977
  }
@@ -20843,23 +20992,15 @@ function drawStyledText(ctx, text, x, y, scale, styles) {
20843
20992
  ctx.save();
20844
20993
  if (styles.textShadow) {
20845
20994
  const ts = styles.textShadow;
20846
- const dirRad = ts.dirDeg * Math.PI / 180;
20995
+ const dirRad = ts.dirDeg * DEG_TO_RAD;
20847
20996
  const distPx = ts.distPt * PX_PER_POINT;
20848
- const alpha = ts.alpha ?? 1;
20849
- const r = Number.parseInt(ts.color.slice(1, 3), 16);
20850
- const g2 = Number.parseInt(ts.color.slice(3, 5), 16);
20851
- const b = Number.parseInt(ts.color.slice(5, 7), 16);
20852
- ctx.shadowColor = `rgba(${r},${g2},${b},${alpha})`;
20997
+ ctx.shadowColor = hexToRgba(ts.color, ts.alpha ?? 1);
20853
20998
  ctx.shadowBlur = ts.blurPt * PX_PER_POINT;
20854
20999
  ctx.shadowOffsetX = Math.cos(dirRad) * distPx;
20855
21000
  ctx.shadowOffsetY = Math.sin(dirRad) * distPx;
20856
21001
  } else if (styles.glow) {
20857
21002
  const gl = styles.glow;
20858
- const alpha = gl.alpha ?? 0.7;
20859
- const r = Number.parseInt(gl.color.slice(1, 3), 16);
20860
- const g2 = Number.parseInt(gl.color.slice(3, 5), 16);
20861
- const b = Number.parseInt(gl.color.slice(5, 7), 16);
20862
- ctx.shadowColor = `rgba(${r},${g2},${b},${alpha})`;
21003
+ ctx.shadowColor = hexToRgba(gl.color, gl.alpha ?? 0.7);
20863
21004
  ctx.shadowBlur = gl.radiusPt * PX_PER_POINT;
20864
21005
  ctx.shadowOffsetX = 0;
20865
21006
  ctx.shadowOffsetY = 0;
@@ -21248,18 +21389,14 @@ function drawDropCapForParagraph(options) {
21248
21389
  return;
21249
21390
  }
21250
21391
  const style2 = dropCap.style;
21251
- const fontSize = (style2 == null ? void 0 : style2.fontSize) ?? DEFAULT_FONT_SIZE_PX;
21252
- const bodyLineHeight = ((_a = lines[0]) == null ? void 0 : _a.height) ?? fontSize;
21253
- const renderMetrics = resolveCanvasTextRenderMetrics(style2, fontSize);
21254
- const fontWeight = (style2 == null ? void 0 : style2.bold) ? "700" : "400";
21255
- const fontStyle = (style2 == null ? void 0 : style2.italic) ? "italic" : "normal";
21256
- const fontFamily = resolveCanvasFontFamily(style2 == null ? void 0 : style2.fontFamily);
21392
+ const { font, fillStyle, renderMetrics } = resolveCanvasRunPaintStyle(style2);
21393
+ const bodyLineHeight = ((_a = lines[0]) == null ? void 0 : _a.height) ?? ((style2 == null ? void 0 : style2.fontSize) ?? DEFAULT_FONT_SIZE_PX);
21257
21394
  const glyphWidth = measureDropCapWidth(dropCap);
21258
21395
  const x = dropCap.type === "margin" ? originX - glyphWidth : originX;
21259
21396
  const baselineY = paragraphTop + (dropCap.lines - 0.2) * bodyLineHeight + renderMetrics.baselineOffset;
21260
21397
  ctx.save();
21261
- ctx.font = `${fontStyle} ${fontWeight} ${renderMetrics.fontSize}px ${fontFamily}`;
21262
- ctx.fillStyle = (style2 == null ? void 0 : style2.color) ?? "#000000";
21398
+ ctx.font = font;
21399
+ ctx.fillStyle = fillStyle;
21263
21400
  ctx.textBaseline = "alphabetic";
21264
21401
  ctx.fillText(dropCap.text, x, baselineY);
21265
21402
  ctx.restore();
@@ -34388,35 +34525,6 @@ function applyDocGridLinePitch(blocks, linePitchPx, mode, docGridType, settings)
34388
34525
  }
34389
34526
  }
34390
34527
  }
34391
- const HEX6_PATTERN = /^[0-9a-fA-F]{6}$/;
34392
- function stripHashPrefix(color) {
34393
- return color.trim().replace(/^#/, "");
34394
- }
34395
- function normalizeHex6(color) {
34396
- if (!color) {
34397
- return null;
34398
- }
34399
- const body = stripHashPrefix(color);
34400
- return HEX6_PATTERN.test(body) ? body.toUpperCase() : null;
34401
- }
34402
- function parseHexColorToRgb255(color) {
34403
- if (!color) {
34404
- return null;
34405
- }
34406
- const normalized = stripHashPrefix(color);
34407
- if (!HEX6_PATTERN.test(normalized)) {
34408
- return null;
34409
- }
34410
- return [
34411
- Number.parseInt(normalized.slice(0, 2), 16),
34412
- Number.parseInt(normalized.slice(2, 4), 16),
34413
- Number.parseInt(normalized.slice(4, 6), 16)
34414
- ];
34415
- }
34416
- function rgb255ToHex(r, g2, b) {
34417
- const toHex2 = (value) => Math.max(0, Math.min(255, Math.round(value))).toString(16).padStart(2, "0");
34418
- return `#${toHex2(r)}${toHex2(g2)}${toHex2(b)}`;
34419
- }
34420
34528
  const VML_FRACTION_DENOMINATOR = 65536;
34421
34529
  function emuToPx(value) {
34422
34530
  const emu = parseOptionalInt$1(value);
@@ -36741,41 +36849,15 @@ async function importDocxToEditorDocument(buffer, options = {}) {
36741
36849
  );
36742
36850
  const hasAssets = Object.keys(assets.assets).length > 0;
36743
36851
  const finalize = (doc2) => {
36744
- if (docSettings.defaultTabStop !== void 0) {
36745
- doc2.settings = {
36746
- ...doc2.settings ?? {},
36747
- defaultTabStop: docSettings.defaultTabStop
36748
- };
36749
- }
36750
- if (docSettings.allowSpaceOfSameStyleInTable) {
36751
- doc2.settings = {
36752
- ...doc2.settings ?? {},
36753
- allowSpaceOfSameStyleInTable: true
36754
- };
36755
- }
36756
- if (docSettings.autoHyphenation) {
36757
- doc2.settings = {
36758
- ...doc2.settings ?? {},
36759
- autoHyphenation: true
36760
- };
36761
- }
36762
- if (docSettings.doNotHyphenateCaps) {
36763
- doc2.settings = {
36764
- ...doc2.settings ?? {},
36765
- doNotHyphenateCaps: true
36766
- };
36767
- }
36768
- if (docSettings.consecutiveHyphenLimit !== void 0) {
36769
- doc2.settings = {
36770
- ...doc2.settings ?? {},
36771
- consecutiveHyphenLimit: docSettings.consecutiveHyphenLimit
36772
- };
36773
- }
36774
- if (docSettings.hyphenationZone !== void 0) {
36775
- doc2.settings = {
36776
- ...doc2.settings ?? {},
36777
- hyphenationZone: docSettings.hyphenationZone
36778
- };
36852
+ const settingsPatch = {};
36853
+ if (docSettings.defaultTabStop !== void 0) settingsPatch.defaultTabStop = docSettings.defaultTabStop;
36854
+ if (docSettings.allowSpaceOfSameStyleInTable) settingsPatch.allowSpaceOfSameStyleInTable = true;
36855
+ if (docSettings.autoHyphenation) settingsPatch.autoHyphenation = true;
36856
+ if (docSettings.doNotHyphenateCaps) settingsPatch.doNotHyphenateCaps = true;
36857
+ if (docSettings.consecutiveHyphenLimit !== void 0) settingsPatch.consecutiveHyphenLimit = docSettings.consecutiveHyphenLimit;
36858
+ if (docSettings.hyphenationZone !== void 0) settingsPatch.hyphenationZone = docSettings.hyphenationZone;
36859
+ if (Object.keys(settingsPatch).length > 0) {
36860
+ doc2.settings = { ...doc2.settings ?? {}, ...settingsPatch };
36779
36861
  }
36780
36862
  if (fontTable) {
36781
36863
  doc2.fontTable = fontTable;
@@ -36863,8 +36945,19 @@ function buildEditorComments(ranges, bodies) {
36863
36945
  }
36864
36946
  return order.length > 0 ? { items, order } : void 0;
36865
36947
  }
36866
- function remapImportedFootnoteRefsInSections(sections, byDocxId) {
36948
+ function walkSectionBlocks(sections, visit) {
36867
36949
  var _a, _b, _c, _d, _e, _f;
36950
+ for (const section of sections) {
36951
+ section.blocks.forEach(visit);
36952
+ (_a = section.header) == null ? void 0 : _a.forEach(visit);
36953
+ (_b = section.firstPageHeader) == null ? void 0 : _b.forEach(visit);
36954
+ (_c = section.evenPageHeader) == null ? void 0 : _c.forEach(visit);
36955
+ (_d = section.footer) == null ? void 0 : _d.forEach(visit);
36956
+ (_e = section.firstPageFooter) == null ? void 0 : _e.forEach(visit);
36957
+ (_f = section.evenPageFooter) == null ? void 0 : _f.forEach(visit);
36958
+ }
36959
+ }
36960
+ function remapImportedFootnoteRefsInSections(sections, byDocxId) {
36868
36961
  const remapBlock = (block) => {
36869
36962
  if (block.type === "paragraph") {
36870
36963
  block.runs.forEach((run, index) => {
@@ -36898,18 +36991,9 @@ function remapImportedFootnoteRefsInSections(sections, byDocxId) {
36898
36991
  }
36899
36992
  }
36900
36993
  };
36901
- for (const section of sections) {
36902
- section.blocks.forEach(remapBlock);
36903
- (_a = section.header) == null ? void 0 : _a.forEach(remapBlock);
36904
- (_b = section.firstPageHeader) == null ? void 0 : _b.forEach(remapBlock);
36905
- (_c = section.evenPageHeader) == null ? void 0 : _c.forEach(remapBlock);
36906
- (_d = section.footer) == null ? void 0 : _d.forEach(remapBlock);
36907
- (_e = section.firstPageFooter) == null ? void 0 : _e.forEach(remapBlock);
36908
- (_f = section.evenPageFooter) == null ? void 0 : _f.forEach(remapBlock);
36909
- }
36994
+ walkSectionBlocks(sections, remapBlock);
36910
36995
  }
36911
36996
  function remapImportedEndnoteRefsInSections(sections, byDocxId) {
36912
- var _a, _b, _c, _d, _e, _f;
36913
36997
  const remapBlock = (block) => {
36914
36998
  if (block.type === "paragraph") {
36915
36999
  block.runs.forEach((run, index) => {
@@ -36943,15 +37027,7 @@ function remapImportedEndnoteRefsInSections(sections, byDocxId) {
36943
37027
  }
36944
37028
  }
36945
37029
  };
36946
- for (const section of sections) {
36947
- section.blocks.forEach(remapBlock);
36948
- (_a = section.header) == null ? void 0 : _a.forEach(remapBlock);
36949
- (_b = section.firstPageHeader) == null ? void 0 : _b.forEach(remapBlock);
36950
- (_c = section.evenPageHeader) == null ? void 0 : _c.forEach(remapBlock);
36951
- (_d = section.footer) == null ? void 0 : _d.forEach(remapBlock);
36952
- (_e = section.firstPageFooter) == null ? void 0 : _e.forEach(remapBlock);
36953
- (_f = section.evenPageFooter) == null ? void 0 : _f.forEach(remapBlock);
36954
- }
37030
+ walkSectionBlocks(sections, remapBlock);
36955
37031
  }
36956
37032
  let nextRequestId = 1;
36957
37033
  function canUseDocxWorker() {
@@ -36967,7 +37043,7 @@ function importDocxInWorker(buffer, options = {}) {
36967
37043
  const worker = new Worker(
36968
37044
  new URL(
36969
37045
  /* @vite-ignore */
36970
- "" + new URL("assets/importDocxWorker-Bz2kZOBO.js", import.meta.url).href,
37046
+ "" + new URL("assets/importDocxWorker-D0F0jbcF.js", import.meta.url).href,
36971
37047
  import.meta.url
36972
37048
  ),
36973
37049
  {
@@ -42625,7 +42701,7 @@ export {
42625
42701
  resolveImageSrc as Z,
42626
42702
  listKindForTag as _,
42627
42703
  getPageContentWidth as a,
42628
- getPresetPathSegments as a$,
42704
+ resolveFloatingObjectRect as a$,
42629
42705
  collectInlineRuns as a0,
42630
42706
  parseParagraphStyle as a1,
42631
42707
  getRunImage as a2,
@@ -42636,33 +42712,33 @@ export {
42636
42712
  getCaretRectFromSnapshot as a7,
42637
42713
  getParagraphRectFromSnapshot as a8,
42638
42714
  createComponent as a9,
42639
- enablePreciseFontMode as aA,
42640
- TWIPS_PER_POINT as aB,
42641
- PX_PER_INCH as aC,
42642
- TWIPS_PER_INCH as aD,
42643
- normalizeHex6 as aE,
42644
- TABLE_CONDITIONAL_FLAG_ATTRIBUTES as aF,
42645
- TABLE_BORDER_EDGE_KEYS as aG,
42646
- resolveEffectiveParagraphStyle as aH,
42647
- resolveEffectiveTextStyleForParagraph as aI,
42648
- EMU_PER_PT as aJ,
42649
- OOXML_ROTATION_UNITS as aK,
42650
- OOXML_PERCENT_DENOMINATOR as aL,
42651
- parseHexColorToRgb255 as aM,
42652
- EMU_PER_PX as aN,
42653
- getRunFootnoteReference as aO,
42654
- getRunEndnoteReference as aP,
42655
- iterateFootnoteReferenceRuns as aQ,
42656
- iterateEndnoteReferenceRuns as aR,
42657
- imageContentTypeDefaults as aS,
42658
- getRunFieldChar as aT,
42659
- getRunFieldInstruction as aU,
42660
- createEditorRun as aV,
42661
- JSZip as aW,
42662
- imageExtensionFromMime as aX,
42663
- pxToPt as aY,
42664
- resolveFloatingObjectRect as aZ,
42665
- getTextBoxFloatingGeometry as a_,
42715
+ setPreciseFontPreference as aA,
42716
+ setWelcomeSeen as aB,
42717
+ enablePreciseFontMode as aC,
42718
+ TWIPS_PER_POINT as aD,
42719
+ PX_PER_INCH as aE,
42720
+ TWIPS_PER_INCH as aF,
42721
+ normalizeHex6 as aG,
42722
+ TABLE_CONDITIONAL_FLAG_ATTRIBUTES as aH,
42723
+ TABLE_BORDER_EDGE_KEYS as aI,
42724
+ resolveEffectiveParagraphStyle as aJ,
42725
+ resolveEffectiveTextStyleForParagraph as aK,
42726
+ EMU_PER_PT as aL,
42727
+ OOXML_ROTATION_UNITS as aM,
42728
+ OOXML_PERCENT_DENOMINATOR as aN,
42729
+ parseHexColorToRgb255 as aO,
42730
+ EMU_PER_PX as aP,
42731
+ getRunFootnoteReference as aQ,
42732
+ getRunEndnoteReference as aR,
42733
+ iterateFootnoteReferenceRuns as aS,
42734
+ iterateEndnoteReferenceRuns as aT,
42735
+ imageContentTypeDefaults as aU,
42736
+ getRunFieldChar as aV,
42737
+ getRunFieldInstruction as aW,
42738
+ createEditorRun as aX,
42739
+ JSZip as aY,
42740
+ imageExtensionFromMime as aZ,
42741
+ pxToPt as a_,
42666
42742
  CaretOverlay as aa,
42667
42743
  Show as ab,
42668
42744
  createRenderEffect as ac,
@@ -42671,155 +42747,159 @@ export {
42671
42747
  setStyleProperty as af,
42672
42748
  memo as ag,
42673
42749
  template as ah,
42674
- useI18n as ai,
42675
- createEffect as aj,
42676
- insert as ak,
42677
- use as al,
42678
- addEventListener as am,
42679
- Dialog as an,
42680
- delegateEvents as ao,
42750
+ addEventListener as ai,
42751
+ insert as aj,
42752
+ delegateEvents as ak,
42753
+ useI18n as al,
42754
+ createEffect as am,
42755
+ use as an,
42756
+ Dialog as ao,
42681
42757
  className as ap,
42682
42758
  For as aq,
42683
42759
  UNDERLINE_STYLE_OPTIONS as ar,
42684
42760
  Tabs as as,
42685
- onMount as at,
42686
- onCleanup as au,
42687
- PluginUiHost as av,
42688
- OasisEditorEditor as aw,
42689
- OasisBrandMark as ax,
42690
- setPreciseFontPreference as ay,
42691
- setWelcomeSeen as az,
42761
+ createStore as at,
42762
+ reconcile as au,
42763
+ onMount as av,
42764
+ onCleanup as aw,
42765
+ PluginUiHost as ax,
42766
+ OasisEditorEditor as ay,
42767
+ OasisBrandMark as az,
42692
42768
  getPageBodyTop as b,
42693
- createFootnoteReferenceRun as b$,
42694
- buildListLabels as b0,
42695
- getImageFloatingGeometry as b1,
42696
- textStyleToFontSizePt as b2,
42697
- PX_PER_POINT as b3,
42698
- DEFAULT_FONT_SIZE_PX as b4,
42699
- resolveOpenTypeFeatureTags as b5,
42700
- rgb255ToHex as b6,
42701
- isDoubleUnderlineStyle as b7,
42702
- isWavyUnderlineStyle as b8,
42703
- underlineStyleLineWidthPx as b9,
42704
- getDocumentParagraphs as bA,
42705
- getDocumentPageSettings as bB,
42706
- getTableCellContentWidthForParagraph as bC,
42707
- layoutMetricsEpoch as bD,
42708
- bumpLayoutMetricsEpoch as bE,
42709
- createCanvasLayoutSnapshotProvider as bF,
42710
- on as bG,
42711
- debounce as bH,
42712
- unwrap as bI,
42713
- perfTimer as bJ,
42714
- getRunTextBox as bK,
42715
- createEditorDocument as bL,
42716
- resolveResizedDimensions as bM,
42717
- resolveTextBoxRenderHeight as bN,
42718
- getToolbarStyleState as bO,
42719
- getCachedCanvasImage as bP,
42720
- measureParagraphMinContentWidthPx as bQ,
42721
- getEditableBlocksForZone as bR,
42722
- findParagraphLocation as bS,
42723
- createSectionBoundaryParagraph as bT,
42724
- normalizePageSettings as bU,
42725
- DEFAULT_EDITOR_PAGE_SETTINGS as bV,
42726
- markStart as bW,
42727
- markEnd as bX,
42728
- getParagraphEntries as bY,
42729
- getParagraphById as bZ,
42730
- createEditorFootnote as b_,
42731
- underlineStyleDashArray as ba,
42732
- resolveListLabel as bb,
42733
- getListLabelInset as bc,
42734
- getAlignedListLabelInset as bd,
42735
- getParagraphBorderInsets as be,
42736
- buildSegmentTable as bf,
42737
- buildCanvasTableLayout as bg,
42738
- resolveCanvasTableWidth as bh,
42739
- resolveFloatingTableRect as bi,
42740
- normalizeFamily as bj,
42741
- ROBOTO_FONT_FILES as bk,
42742
- loadFontAsset as bl,
42743
- OFFICE_COMPAT_FONT_FAMILIES as bm,
42744
- BinaryReader as bn,
42745
- buildSfnt as bo,
42746
- defaultFontDecoderRegistry as bp,
42747
- SfntFontProgram as bq,
42748
- collectPdfFontFamilies as br,
42749
- outlineFrom as bs,
42750
- getPageHeaderZoneTop as bt,
42751
- getPageColumnRects as bu,
42752
- findFootnoteReference as bv,
42753
- FOOTNOTE_MARKER_GUTTER_PX as bw,
42754
- resolveImporterForFile as bx,
42755
- getDocumentSectionsCanonical as by,
42756
- getDocumentParagraphsCanonical as bz,
42769
+ markEnd as b$,
42770
+ getTextBoxFloatingGeometry as b0,
42771
+ getPresetPathSegments as b1,
42772
+ buildListLabels as b2,
42773
+ getImageFloatingGeometry as b3,
42774
+ textStyleToFontSizePt as b4,
42775
+ PX_PER_POINT as b5,
42776
+ DEFAULT_FONT_SIZE_PX as b6,
42777
+ resolveOpenTypeFeatureTags as b7,
42778
+ rgb255ToHex as b8,
42779
+ isDoubleUnderlineStyle as b9,
42780
+ FOOTNOTE_MARKER_GUTTER_PX as bA,
42781
+ resolveImporterForFile as bB,
42782
+ getDocumentSectionsCanonical as bC,
42783
+ getDocumentParagraphsCanonical as bD,
42784
+ getDocumentParagraphs as bE,
42785
+ getDocumentPageSettings as bF,
42786
+ getTableCellContentWidthForParagraph as bG,
42787
+ layoutMetricsEpoch as bH,
42788
+ bumpLayoutMetricsEpoch as bI,
42789
+ createCanvasLayoutSnapshotProvider as bJ,
42790
+ on as bK,
42791
+ debounce as bL,
42792
+ unwrap as bM,
42793
+ perfTimer as bN,
42794
+ getRunTextBox as bO,
42795
+ createEditorDocument as bP,
42796
+ resolveResizedDimensions as bQ,
42797
+ resolveTextBoxRenderHeight as bR,
42798
+ getToolbarStyleState as bS,
42799
+ getCachedCanvasImage as bT,
42800
+ measureParagraphMinContentWidthPx as bU,
42801
+ getEditableBlocksForZone as bV,
42802
+ findParagraphLocation as bW,
42803
+ createSectionBoundaryParagraph as bX,
42804
+ normalizePageSettings as bY,
42805
+ DEFAULT_EDITOR_PAGE_SETTINGS as bZ,
42806
+ markStart as b_,
42807
+ isWavyUnderlineStyle as ba,
42808
+ underlineStyleLineWidthPx as bb,
42809
+ WAVY_UNDERLINE_WAVELENGTH_PX as bc,
42810
+ WAVY_UNDERLINE_AMPLITUDE_PX as bd,
42811
+ underlineStyleDashArray as be,
42812
+ resolveListLabel as bf,
42813
+ getListLabelInset as bg,
42814
+ getAlignedListLabelInset as bh,
42815
+ getParagraphBorderInsets as bi,
42816
+ buildSegmentTable as bj,
42817
+ buildCanvasTableLayout as bk,
42818
+ resolveCanvasTableWidth as bl,
42819
+ resolveFloatingTableRect as bm,
42820
+ normalizeFamily as bn,
42821
+ ROBOTO_FONT_FILES as bo,
42822
+ loadFontAsset as bp,
42823
+ OFFICE_COMPAT_FONT_FAMILIES as bq,
42824
+ BinaryReader as br,
42825
+ buildSfnt as bs,
42826
+ defaultFontDecoderRegistry as bt,
42827
+ SfntFontProgram as bu,
42828
+ collectPdfFontFamilies as bv,
42829
+ outlineFrom as bw,
42830
+ getPageHeaderZoneTop as bx,
42831
+ getPageColumnRects as by,
42832
+ findFootnoteReference as bz,
42757
42833
  getPageBodyBottom as c,
42758
- registerToolbarRenderer as c$,
42759
- renumberFootnotes as c0,
42760
- getHeadingLevel as c1,
42761
- preciseFontModeVersion as c2,
42762
- isPreciseFontModeEnabled as c3,
42763
- resolveNamedTextStyle as c4,
42764
- togglePreciseFontMode as c5,
42765
- nextFontSizePt as c6,
42766
- previousFontSizePt as c7,
42767
- fontSizePtToPx as c8,
42768
- createDefaultToolbarPreset as c9,
42769
- GridPicker as cA,
42770
- IconButton as cB,
42771
- Menu as cC,
42772
- OASIS_BUILTIN_COMMANDS as cD,
42773
- OASIS_MENU_ITEMS as cE,
42774
- OASIS_TOOLBAR_ITEMS as cF,
42775
- OasisEditorAppLazy as cG,
42776
- OasisEditorContainer as cH,
42777
- PluginCollection as cI,
42778
- Popover as cJ,
42779
- RIBBON_TABS as cK,
42780
- Select as cL,
42781
- SelectField as cM,
42782
- Separator as cN,
42783
- SidePanel as cO,
42784
- SidePanelBody as cP,
42785
- SidePanelFooter as cQ,
42786
- SidePanelHeader as cR,
42787
- SplitButton as cS,
42788
- StyleGallery as cT,
42789
- TextField as cU,
42790
- Button$1 as cV,
42791
- buildRibbonTabDefinitions as cW,
42792
- createEditorCommandBus as cX,
42793
- createOasisEditor as cY,
42794
- createOasisEditorContainer as cZ,
42795
- mount as c_,
42796
- MenuRegistry as ca,
42797
- createToolbarRegistry as cb,
42798
- Editor as cc,
42799
- resolveCommandRef as cd,
42800
- commandRefName as ce,
42801
- createOasisEditorClient as cf,
42802
- createEditorZoom as cg,
42803
- startLongTaskObserver as ch,
42804
- installGlobalReport as ci,
42805
- applyStoredPreciseFontPreference as cj,
42806
- getWelcomeSeen as ck,
42807
- isLocalFontAccessSupported as cl,
42808
- EDITOR_SCROLL_PADDING_PX as cm,
42809
- Toolbar as cn,
42810
- OasisEditorLoading as co,
42811
- I18nProvider as cp,
42812
- createTranslator as cq,
42813
- createEditorLogger as cr,
42814
- registerDomStatsSurface as cs,
42815
- Button as ct,
42816
- Checkbox as cu,
42817
- ColorPicker as cv,
42818
- CommandRegistry as cw,
42819
- DEFAULT_PALETTE as cx,
42820
- DialogFooter as cy,
42821
- FloatingActionButton as cz,
42834
+ createEditorCommandBus as c$,
42835
+ getParagraphEntries as c0,
42836
+ getParagraphById as c1,
42837
+ createEditorFootnote as c2,
42838
+ createFootnoteReferenceRun as c3,
42839
+ renumberFootnotes as c4,
42840
+ getHeadingLevel as c5,
42841
+ preciseFontModeVersion as c6,
42842
+ isPreciseFontModeEnabled as c7,
42843
+ resolveNamedTextStyle as c8,
42844
+ togglePreciseFontMode as c9,
42845
+ CommandRegistry as cA,
42846
+ DEFAULT_PALETTE as cB,
42847
+ DialogFooter as cC,
42848
+ FloatingActionButton as cD,
42849
+ GridPicker as cE,
42850
+ IconButton as cF,
42851
+ Menu as cG,
42852
+ OASIS_BUILTIN_COMMANDS as cH,
42853
+ OASIS_MENU_ITEMS as cI,
42854
+ OASIS_TOOLBAR_ITEMS as cJ,
42855
+ OasisEditorAppLazy as cK,
42856
+ OasisEditorContainer as cL,
42857
+ PluginCollection as cM,
42858
+ Popover as cN,
42859
+ RIBBON_TABS as cO,
42860
+ Select as cP,
42861
+ SelectField as cQ,
42862
+ Separator as cR,
42863
+ SidePanel as cS,
42864
+ SidePanelBody as cT,
42865
+ SidePanelFooter as cU,
42866
+ SidePanelHeader as cV,
42867
+ SplitButton as cW,
42868
+ StyleGallery as cX,
42869
+ TextField as cY,
42870
+ Button$1 as cZ,
42871
+ buildRibbonTabDefinitions as c_,
42872
+ nextFontSizePt as ca,
42873
+ previousFontSizePt as cb,
42874
+ fontSizePtToPx as cc,
42875
+ createDefaultToolbarPreset as cd,
42876
+ MenuRegistry as ce,
42877
+ createToolbarRegistry as cf,
42878
+ Editor as cg,
42879
+ resolveCommandRef as ch,
42880
+ commandRefName as ci,
42881
+ createOasisEditorClient as cj,
42882
+ createEditorZoom as ck,
42883
+ startLongTaskObserver as cl,
42884
+ installGlobalReport as cm,
42885
+ applyStoredPreciseFontPreference as cn,
42886
+ getWelcomeSeen as co,
42887
+ isLocalFontAccessSupported as cp,
42888
+ EDITOR_SCROLL_PADDING_PX as cq,
42889
+ Toolbar as cr,
42890
+ OasisEditorLoading as cs,
42891
+ I18nProvider as ct,
42892
+ createTranslator as cu,
42893
+ createEditorLogger as cv,
42894
+ registerDomStatsSurface as cw,
42895
+ Button as cx,
42896
+ Checkbox as cy,
42897
+ ColorPicker as cz,
42822
42898
  domTextMeasurer as d,
42899
+ createOasisEditor as d0,
42900
+ createOasisEditorContainer as d1,
42901
+ mount as d2,
42902
+ registerToolbarRenderer as d3,
42823
42903
  estimateTableBlockHeight as e,
42824
42904
  getFootnoteDisplayMarker as f,
42825
42905
  getProjectedParagraphBlockHeight as g,