oasis-editor 0.0.109 → 0.0.111

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-vuSkxc37.js").then((m) => {
2542
+ import("./OasisEditorApp-MEaOb4ut.js").then((m) => {
2543
2543
  cancelled = true;
2544
2544
  setProgress(1);
2545
2545
  setTimeout(() => setApp(() => m.OasisEditorApp), 180);
@@ -3119,6 +3119,8 @@ const EMU_PER_PX = 9525;
3119
3119
  const EMU_PER_PT = 12700;
3120
3120
  const TWIPS_PER_INCH = 1440;
3121
3121
  const TWIPS_PER_POINT = 20;
3122
+ const OOXML_PERCENT_DENOMINATOR = 1e5;
3123
+ const OOXML_ROTATION_UNITS = 6e4;
3122
3124
  const DEFAULT_FONT_SIZE_PX = 14.6667;
3123
3125
  function asRequired(value) {
3124
3126
  return value;
@@ -16270,6 +16272,7 @@ class PaginationTrack {
16270
16272
  }
16271
16273
  }
16272
16274
  const TEXT_BOX_AUTOFIT_SAFETY_PX$1 = 2;
16275
+ const PARAGRAPH_FIT_HEIGHT_TOLERANCE_PX = 1.5;
16273
16276
  function registerParagraphFloatingExclusions(options) {
16274
16277
  const exclusions = collectParagraphFloatingExclusions({
16275
16278
  fragments: options.layout.fragments,
@@ -16478,11 +16481,10 @@ function paginateParagraphBlock(track, params, sourceBlock, nextBlock, index) {
16478
16481
  lineEndIndex === paragraphLayout.lines.length - 1,
16479
16482
  styles
16480
16483
  );
16481
- const tolerance = 1.5;
16482
- if (candidateFitHeight > remainingHeight + tolerance && lineEndIndex === startLineIndex && track.blocks.length > 0) {
16484
+ if (candidateFitHeight > remainingHeight + PARAGRAPH_FIT_HEIGHT_TOLERANCE_PX && lineEndIndex === startLineIndex && track.blocks.length > 0) {
16483
16485
  break;
16484
16486
  }
16485
- if (candidateFitHeight > remainingHeight + tolerance && lineEndIndex > startLineIndex) {
16487
+ if (candidateFitHeight > remainingHeight + PARAGRAPH_FIT_HEIGHT_TOLERANCE_PX && lineEndIndex > startLineIndex) {
16486
16488
  break;
16487
16489
  }
16488
16490
  segmentHeight = candidateHeight;
@@ -20080,6 +20082,97 @@ function drawFloatingTextBoxesForParagraph(options) {
20080
20082
  }
20081
20083
  }
20082
20084
  }
20085
+ function resolveInlineObjectRect(params) {
20086
+ return {
20087
+ left: params.originLeft + params.slotLeft,
20088
+ top: params.originTop + params.lineTop + params.lineHeight - params.objectHeight,
20089
+ width: params.objectWidth,
20090
+ height: params.objectHeight
20091
+ };
20092
+ }
20093
+ function collectInlineImagesFromLines(options) {
20094
+ const inlineImages = [];
20095
+ for (const line of options.lines) {
20096
+ for (const fragment of line.fragments) {
20097
+ if (!fragment.image || fragment.image.floating) {
20098
+ continue;
20099
+ }
20100
+ const imageStartOffset = fragment.startOffset;
20101
+ const imageEndOffset = fragment.endOffset > imageStartOffset ? fragment.endOffset : imageStartOffset + 1;
20102
+ const slot = line.slots.find((candidate) => candidate.offset === imageStartOffset) ?? line.slots.find((candidate) => candidate.offset >= imageStartOffset);
20103
+ if (!slot) {
20104
+ continue;
20105
+ }
20106
+ const rect = resolveInlineObjectRect({
20107
+ originLeft: options.lineLeftOffset,
20108
+ originTop: options.lineTopOffset,
20109
+ lineTop: line.top,
20110
+ lineHeight: line.height,
20111
+ slotLeft: slot.left,
20112
+ objectWidth: fragment.image.width,
20113
+ objectHeight: fragment.image.height
20114
+ });
20115
+ inlineImages.push({
20116
+ paragraphId: options.paragraphId,
20117
+ paragraphIndex: options.paragraphIndex,
20118
+ zone: options.zone,
20119
+ footnoteId: options.footnoteId,
20120
+ pageIndex: options.pageIndex,
20121
+ startOffset: imageStartOffset,
20122
+ endOffset: imageEndOffset,
20123
+ left: rect.left,
20124
+ top: rect.top,
20125
+ width: rect.width,
20126
+ height: rect.height,
20127
+ rotation: fragment.image.rotation
20128
+ });
20129
+ }
20130
+ }
20131
+ return inlineImages;
20132
+ }
20133
+ function collectInlineTextBoxesFromLines(options) {
20134
+ const inlineTextBoxes = [];
20135
+ for (const line of options.lines) {
20136
+ for (const fragment of line.fragments) {
20137
+ if (!fragment.textBox || fragment.textBox.floating) {
20138
+ continue;
20139
+ }
20140
+ const startOffset = fragment.startOffset;
20141
+ const endOffset = fragment.endOffset > startOffset ? fragment.endOffset : startOffset + 1;
20142
+ const slot = line.slots.find((candidate) => candidate.offset === startOffset) ?? line.slots.find((candidate) => candidate.offset >= startOffset);
20143
+ if (!slot) {
20144
+ continue;
20145
+ }
20146
+ const height = options.resolveHeight(
20147
+ fragment.textBox
20148
+ );
20149
+ const rect = resolveInlineObjectRect({
20150
+ originLeft: options.lineLeftOffset,
20151
+ originTop: options.lineTopOffset,
20152
+ lineTop: line.top,
20153
+ lineHeight: line.height,
20154
+ slotLeft: slot.left,
20155
+ objectWidth: fragment.textBox.width,
20156
+ objectHeight: height
20157
+ });
20158
+ inlineTextBoxes.push({
20159
+ paragraphId: options.paragraphId,
20160
+ paragraphIndex: options.paragraphIndex,
20161
+ zone: options.zone,
20162
+ footnoteId: options.footnoteId,
20163
+ pageIndex: options.pageIndex,
20164
+ startOffset,
20165
+ endOffset,
20166
+ left: rect.left,
20167
+ top: rect.top,
20168
+ width: rect.width,
20169
+ height: rect.height,
20170
+ rotation: fragment.textBox.rotation
20171
+ });
20172
+ }
20173
+ }
20174
+ return inlineTextBoxes;
20175
+ }
20083
20176
  function underlineStyleToCssDecorationStyle(underlineStyle) {
20084
20177
  switch (underlineStyle) {
20085
20178
  case "double":
@@ -20175,6 +20268,8 @@ function underlineStyleDashArray(underlineStyle) {
20175
20268
  return void 0;
20176
20269
  }
20177
20270
  }
20271
+ const CANVAS_DASH_DASHED = [5, 3];
20272
+ const CANVAS_DASH_DOTTED = [1, 3];
20178
20273
  function drawEdge(ctx, border, x1, y1, x2, y2) {
20179
20274
  if (!border || border.type === "none" || border.width <= 0) {
20180
20275
  return;
@@ -20184,9 +20279,9 @@ function drawEdge(ctx, border, x1, y1, x2, y2) {
20184
20279
  ctx.strokeStyle = border.color;
20185
20280
  ctx.lineWidth = border.width;
20186
20281
  if (border.type === "dashed") {
20187
- ctx.setLineDash([5, 3]);
20282
+ ctx.setLineDash(CANVAS_DASH_DASHED);
20188
20283
  } else if (border.type === "dotted") {
20189
- ctx.setLineDash([1, 3]);
20284
+ ctx.setLineDash(CANVAS_DASH_DOTTED);
20190
20285
  } else {
20191
20286
  ctx.setLineDash([]);
20192
20287
  }
@@ -20205,6 +20300,10 @@ function drawBorderBox(ctx, left, top, width, height, borders) {
20205
20300
  drawEdge(ctx, borders.topLeftToBottomRight, left, top, right, bottom);
20206
20301
  drawEdge(ctx, borders.topRightToBottomLeft, right, top, left, bottom);
20207
20302
  }
20303
+ const DOUBLE_STRIKE_OFFSET_PX = 1.3;
20304
+ const DOUBLE_UNDERLINE_OFFSET_PX = 1.5;
20305
+ const WAVY_UNDERLINE_AMPLITUDE_PX = 1.5;
20306
+ const WAVY_UNDERLINE_WAVELENGTH_PX = 4;
20208
20307
  const canvasTextLogger = createEditorLogger("canvas-text");
20209
20308
  const loggedCanvasFontKeys = /* @__PURE__ */ new Set();
20210
20309
  const MAX_CANVAS_FONT_LOGS = 40;
@@ -20257,9 +20356,9 @@ function drawTabLeader(ctx, leader, x1, x2, y) {
20257
20356
  ctx.lineWidth = leader === "heavy" ? 1.5 : 1;
20258
20357
  ctx.strokeStyle = ctx.fillStyle;
20259
20358
  if (leader === "dot" || leader === "middleDot") {
20260
- ctx.setLineDash([1, 3]);
20359
+ ctx.setLineDash(CANVAS_DASH_DOTTED);
20261
20360
  } else if (leader === "hyphen") {
20262
- ctx.setLineDash([5, 3]);
20361
+ ctx.setLineDash(CANVAS_DASH_DASHED);
20263
20362
  } else {
20264
20363
  ctx.setLineDash([]);
20265
20364
  }
@@ -20485,13 +20584,16 @@ function drawParagraph(ctx, paragraph, lines, state, originX, originY, onUpdate,
20485
20584
  const src = resolveImageSrc(state.document, fragment.image.src);
20486
20585
  const img = getCachedCanvasImage(src, onUpdate);
20487
20586
  if (img.complete && img.naturalWidth > 0) {
20488
- drawImageFragment(
20489
- ctx,
20490
- img,
20491
- fragment.image,
20492
- originX + slot.left,
20493
- originY + line.top + line.height - fragment.image.height
20494
- );
20587
+ const rect = resolveInlineObjectRect({
20588
+ originLeft: originX,
20589
+ originTop: originY,
20590
+ lineTop: line.top,
20591
+ lineHeight: line.height,
20592
+ slotLeft: slot.left,
20593
+ objectWidth: fragment.image.width,
20594
+ objectHeight: fragment.image.height
20595
+ });
20596
+ drawImageFragment(ctx, img, fragment.image, rect.left, rect.top);
20495
20597
  }
20496
20598
  }
20497
20599
  } else if (fragment.textBox && !fragment.textBox.floating) {
@@ -20499,17 +20601,23 @@ function drawParagraph(ctx, paragraph, lines, state, originX, originY, onUpdate,
20499
20601
  if (slot) {
20500
20602
  const textBox = fragment.textBox;
20501
20603
  const height = resolveTextBoxRenderHeight(textBox, state, pageIndex);
20502
- const x = originX + slot.left;
20503
- const y = originY + line.top + line.height - height;
20504
- const width = textBox.width;
20604
+ const rect = resolveInlineObjectRect({
20605
+ originLeft: originX,
20606
+ originTop: originY,
20607
+ lineTop: line.top,
20608
+ lineHeight: line.height,
20609
+ slotLeft: slot.left,
20610
+ objectWidth: textBox.width,
20611
+ objectHeight: height
20612
+ });
20505
20613
  paintTextBox(
20506
20614
  ctx,
20507
20615
  textBox,
20508
20616
  state,
20509
- x,
20510
- y,
20511
- width,
20512
- height,
20617
+ rect.left,
20618
+ rect.top,
20619
+ rect.width,
20620
+ rect.height,
20513
20621
  pageIndex,
20514
20622
  onUpdate,
20515
20623
  painters
@@ -20966,14 +21074,13 @@ function drawTextDecoration(ctx, line, fragment, originX, originY, kind, underli
20966
21074
  if (kind === "underline") {
20967
21075
  drawUnderlineWithStyle(ctx, x1, x2, y, underlineStyle);
20968
21076
  } else if (kind === "doubleStrike") {
20969
- const offset = 1.3;
20970
21077
  ctx.beginPath();
20971
21078
  ctx.lineWidth = 1;
20972
21079
  ctx.setLineDash([]);
20973
- ctx.moveTo(x1, y - offset);
20974
- ctx.lineTo(x2, y - offset);
20975
- ctx.moveTo(x1, y + offset);
20976
- ctx.lineTo(x2, y + offset);
21080
+ ctx.moveTo(x1, y - DOUBLE_STRIKE_OFFSET_PX);
21081
+ ctx.lineTo(x2, y - DOUBLE_STRIKE_OFFSET_PX);
21082
+ ctx.moveTo(x1, y + DOUBLE_STRIKE_OFFSET_PX);
21083
+ ctx.lineTo(x2, y + DOUBLE_STRIKE_OFFSET_PX);
20977
21084
  ctx.stroke();
20978
21085
  } else {
20979
21086
  ctx.beginPath();
@@ -20989,12 +21096,11 @@ function drawUnderlineWithStyle(ctx, x1, x2, y, underlineStyle) {
20989
21096
  ctx.setLineDash([]);
20990
21097
  ctx.lineWidth = underlineStyleLineWidthPx(underlineStyle);
20991
21098
  if (isDoubleUnderlineStyle(underlineStyle)) {
20992
- const offset = 1.5;
20993
21099
  ctx.beginPath();
20994
- ctx.moveTo(x1, y - offset);
20995
- ctx.lineTo(x2, y - offset);
20996
- ctx.moveTo(x1, y + offset);
20997
- ctx.lineTo(x2, y + offset);
21100
+ ctx.moveTo(x1, y - DOUBLE_UNDERLINE_OFFSET_PX);
21101
+ ctx.lineTo(x2, y - DOUBLE_UNDERLINE_OFFSET_PX);
21102
+ ctx.moveTo(x1, y + DOUBLE_UNDERLINE_OFFSET_PX);
21103
+ ctx.lineTo(x2, y + DOUBLE_UNDERLINE_OFFSET_PX);
20998
21104
  ctx.stroke();
20999
21105
  return;
21000
21106
  }
@@ -21013,12 +21119,10 @@ function drawUnderlineWithStyle(ctx, x1, x2, y, underlineStyle) {
21013
21119
  ctx.setLineDash([]);
21014
21120
  }
21015
21121
  function drawWavyLine(ctx, x1, x2, y) {
21016
- const amplitude = 1.5;
21017
- const wavelength = 4;
21018
21122
  ctx.beginPath();
21019
21123
  ctx.moveTo(x1, y);
21020
21124
  for (let x = x1; x <= x2; x += 1) {
21021
- const dy = Math.sin((x - x1) / wavelength * Math.PI) * amplitude;
21125
+ const dy = Math.sin((x - x1) / WAVY_UNDERLINE_WAVELENGTH_PX * Math.PI) * WAVY_UNDERLINE_AMPLITUDE_PX;
21022
21126
  ctx.lineTo(x, y + dy);
21023
21127
  }
21024
21128
  ctx.stroke();
@@ -21101,7 +21205,7 @@ function drawTable(ctx, table, tableSegment, state, originX, originY, contentWid
21101
21205
  ctx.save();
21102
21206
  ctx.strokeStyle = color;
21103
21207
  ctx.lineWidth = 2;
21104
- ctx.setLineDash([5, 3]);
21208
+ ctx.setLineDash(CANVAS_DASH_DASHED);
21105
21209
  ctx.strokeRect(
21106
21210
  cell.left + 1,
21107
21211
  cell.top + 1,
@@ -32046,8 +32150,6 @@ function resolveThemeFont(fonts, themeFonts) {
32046
32150
  const normalizedThemeKey = themeKey === "majorAscii" || themeKey === "majorHAnsi" ? "majorHAnsi" : themeKey === "minorAscii" || themeKey === "minorHAnsi" ? "minorHAnsi" : themeKey === "majorEastAsia" ? "majorEastAsia" : themeKey === "minorEastAsia" ? "minorEastAsia" : themeKey === "majorBidi" ? "majorBidi" : themeKey === "minorBidi" ? "minorBidi" : void 0;
32047
32151
  return normalizedThemeKey ? themeFonts[normalizedThemeKey] : void 0;
32048
32152
  }
32049
- const OOXML_PERCENT_DENOMINATOR$1 = 1e5;
32050
- const OOXML_ROTATION_UNITS$1 = 6e4;
32051
32153
  const PAGE_BREAK_MARKER = "\f";
32052
32154
  const DOCX_IMPLICIT_SINGLE_LINE_HEIGHT = 1.1;
32053
32155
  function twipsToPx(value, fallback) {
@@ -32624,7 +32726,7 @@ function parseW14TextFill(fillEl) {
32624
32726
  const gs = node;
32625
32727
  if (gs.namespaceURI !== WORD14_NS || gs.localName !== "gs") continue;
32626
32728
  const posVal = getAttributeValue(gs, "pos");
32627
- const pos = posVal !== null ? Number(posVal) / OOXML_PERCENT_DENOMINATOR$1 : NaN;
32729
+ const pos = posVal !== null ? Number(posVal) / OOXML_PERCENT_DENOMINATOR : NaN;
32628
32730
  if (!Number.isFinite(pos)) continue;
32629
32731
  const srgbClr = getFirstChildByTagNameNS(gs, WORD14_NS, "srgbClr");
32630
32732
  if (!srgbClr) continue;
@@ -32634,7 +32736,7 @@ function parseW14TextFill(fillEl) {
32634
32736
  if (!color) continue;
32635
32737
  const alphaEl = getFirstChildByTagNameNS(srgbClr, WORD14_NS, "alpha");
32636
32738
  const alphaRaw = alphaEl ? getAttributeValue(alphaEl, "val") : null;
32637
- const alpha = alphaRaw !== null ? Number(alphaRaw) / OOXML_PERCENT_DENOMINATOR$1 : void 0;
32739
+ const alpha = alphaRaw !== null ? Number(alphaRaw) / OOXML_PERCENT_DENOMINATOR : void 0;
32638
32740
  const stop = { position: pos, color };
32639
32741
  if (alpha !== void 0 && Number.isFinite(alpha)) stop.alpha = alpha;
32640
32742
  stops.push(stop);
@@ -32642,7 +32744,7 @@ function parseW14TextFill(fillEl) {
32642
32744
  if (stops.length > 0) {
32643
32745
  const linEl = getFirstChildByTagNameNS(gradFill, WORD14_NS, "lin");
32644
32746
  const angRaw = linEl ? getAttributeValue(linEl, "ang") : null;
32645
- const angle = angRaw !== null ? Number(angRaw) / OOXML_ROTATION_UNITS$1 : void 0;
32747
+ const angle = angRaw !== null ? Number(angRaw) / OOXML_ROTATION_UNITS : void 0;
32646
32748
  const result = { type: "gradient", stops };
32647
32749
  if (angle !== void 0 && Number.isFinite(angle)) result.angle = angle;
32648
32750
  return result;
@@ -32659,7 +32761,7 @@ function parseW14ColorEl(el) {
32659
32761
  if (!color) return null;
32660
32762
  const alphaEl = getFirstChildByTagNameNS(srgbClr, WORD14_NS, "alpha");
32661
32763
  const alphaRaw = alphaEl ? getAttributeValue(alphaEl, "val") : null;
32662
- const alpha = alphaRaw !== null && Number.isFinite(Number(alphaRaw)) ? Number(alphaRaw) / OOXML_PERCENT_DENOMINATOR$1 : void 0;
32764
+ const alpha = alphaRaw !== null && Number.isFinite(Number(alphaRaw)) ? Number(alphaRaw) / OOXML_PERCENT_DENOMINATOR : void 0;
32663
32765
  return { color, ...alpha !== void 0 ? { alpha } : {} };
32664
32766
  }
32665
32767
  function parseW14Shadow(el) {
@@ -32670,7 +32772,7 @@ function parseW14Shadow(el) {
32670
32772
  const dirRaw = el.getAttributeNS(WORD14_NS, "dir");
32671
32773
  const blurPt = blurRaw ? Number(blurRaw) / EMU_PER_PT : 0;
32672
32774
  const distPt = distRaw ? Number(distRaw) / EMU_PER_PT : 0;
32673
- const dirDeg = dirRaw ? Number(dirRaw) / OOXML_ROTATION_UNITS$1 : 0;
32775
+ const dirDeg = dirRaw ? Number(dirRaw) / OOXML_ROTATION_UNITS : 0;
32674
32776
  return {
32675
32777
  color: colorData.color,
32676
32778
  ...colorData.alpha !== void 0 ? { alpha: colorData.alpha } : {},
@@ -32699,10 +32801,10 @@ function parseW14Reflection(el) {
32699
32801
  const distRaw = el.getAttributeNS(WORD14_NS, "dist");
32700
32802
  return {
32701
32803
  blurPt: blurRaw ? Number(blurRaw) / EMU_PER_PT : 0,
32702
- startAlpha: stARaw !== null ? Number(stARaw) / OOXML_PERCENT_DENOMINATOR$1 : 0.55,
32703
- startPos: stPosRaw !== null ? Number(stPosRaw) / OOXML_PERCENT_DENOMINATOR$1 : 0,
32704
- endAlpha: endARaw !== null ? Number(endARaw) / OOXML_PERCENT_DENOMINATOR$1 : 0,
32705
- endPos: endPosRaw !== null ? Number(endPosRaw) / OOXML_PERCENT_DENOMINATOR$1 : 1,
32804
+ startAlpha: stARaw !== null ? Number(stARaw) / OOXML_PERCENT_DENOMINATOR : 0.55,
32805
+ startPos: stPosRaw !== null ? Number(stPosRaw) / OOXML_PERCENT_DENOMINATOR : 0,
32806
+ endAlpha: endARaw !== null ? Number(endARaw) / OOXML_PERCENT_DENOMINATOR : 0,
32807
+ endPos: endPosRaw !== null ? Number(endPosRaw) / OOXML_PERCENT_DENOMINATOR : 1,
32706
32808
  distPt: distRaw ? Number(distRaw) / EMU_PER_PT : 0
32707
32809
  };
32708
32810
  }
@@ -34278,8 +34380,35 @@ function applyDocGridLinePitch(blocks, linePitchPx, mode, docGridType, settings)
34278
34380
  }
34279
34381
  }
34280
34382
  }
34281
- const OOXML_PERCENT_DENOMINATOR = 1e5;
34282
- const OOXML_ROTATION_UNITS = 6e4;
34383
+ const HEX6_PATTERN = /^[0-9a-fA-F]{6}$/;
34384
+ function stripHashPrefix(color) {
34385
+ return color.trim().replace(/^#/, "");
34386
+ }
34387
+ function normalizeHex6(color) {
34388
+ if (!color) {
34389
+ return null;
34390
+ }
34391
+ const body = stripHashPrefix(color);
34392
+ return HEX6_PATTERN.test(body) ? body.toUpperCase() : null;
34393
+ }
34394
+ function parseHexColorToRgb255(color) {
34395
+ if (!color) {
34396
+ return null;
34397
+ }
34398
+ const normalized = stripHashPrefix(color);
34399
+ if (!HEX6_PATTERN.test(normalized)) {
34400
+ return null;
34401
+ }
34402
+ return [
34403
+ Number.parseInt(normalized.slice(0, 2), 16),
34404
+ Number.parseInt(normalized.slice(2, 4), 16),
34405
+ Number.parseInt(normalized.slice(4, 6), 16)
34406
+ ];
34407
+ }
34408
+ function rgb255ToHex(r, g2, b) {
34409
+ const toHex2 = (value) => Math.max(0, Math.min(255, Math.round(value))).toString(16).padStart(2, "0");
34410
+ return `#${toHex2(r)}${toHex2(g2)}${toHex2(b)}`;
34411
+ }
34283
34412
  const VML_FRACTION_DENOMINATOR = 65536;
34284
34413
  function emuToPx(value) {
34285
34414
  const emu = parseOptionalInt$1(value);
@@ -34323,11 +34452,8 @@ function parseCssLengthToPx(value) {
34323
34452
  }
34324
34453
  }
34325
34454
  function normalizeHexColor(value) {
34326
- const trimmed = value == null ? void 0 : value.trim();
34327
- if (!trimmed || !/^[0-9a-fA-F]{6}$/.test(trimmed)) {
34328
- return void 0;
34329
- }
34330
- return `#${trimmed.toUpperCase()}`;
34455
+ const body = normalizeHex6(value);
34456
+ return body ? `#${body}` : void 0;
34331
34457
  }
34332
34458
  const EXTENSION_TO_MIME = {
34333
34459
  png: "image/png",
@@ -36833,7 +36959,7 @@ function importDocxInWorker(buffer, options = {}) {
36833
36959
  const worker = new Worker(
36834
36960
  new URL(
36835
36961
  /* @vite-ignore */
36836
- "" + new URL("assets/importDocxWorker-BF8VtQ9h.js", import.meta.url).href,
36962
+ "" + new URL("assets/importDocxWorker-DyYGjoXG.js", import.meta.url).href,
36837
36963
  import.meta.url
36838
36964
  ),
36839
36965
  {
@@ -38186,71 +38312,6 @@ function collectFloatingTextBoxesFromLines(options) {
38186
38312
  }
38187
38313
  return result;
38188
38314
  }
38189
- function collectInlineImagesFromLines(options) {
38190
- const inlineImages = [];
38191
- for (const line of options.lines) {
38192
- for (const fragment of line.fragments) {
38193
- if (!fragment.image || fragment.image.floating) {
38194
- continue;
38195
- }
38196
- const imageStartOffset = fragment.startOffset;
38197
- const imageEndOffset = fragment.endOffset > imageStartOffset ? fragment.endOffset : imageStartOffset + 1;
38198
- const slot = line.slots.find((candidate) => candidate.offset === imageStartOffset) ?? line.slots.find((candidate) => candidate.offset >= imageStartOffset);
38199
- if (!slot) {
38200
- continue;
38201
- }
38202
- inlineImages.push({
38203
- paragraphId: options.paragraphId,
38204
- paragraphIndex: options.paragraphIndex,
38205
- zone: options.zone,
38206
- footnoteId: options.footnoteId,
38207
- pageIndex: options.pageIndex,
38208
- startOffset: imageStartOffset,
38209
- endOffset: imageEndOffset,
38210
- left: options.lineLeftOffset + slot.left,
38211
- top: options.lineTopOffset + line.top + line.height - fragment.image.height,
38212
- width: fragment.image.width,
38213
- height: fragment.image.height,
38214
- rotation: fragment.image.rotation
38215
- });
38216
- }
38217
- }
38218
- return inlineImages;
38219
- }
38220
- function collectInlineTextBoxesFromLines(options) {
38221
- const inlineTextBoxes = [];
38222
- for (const line of options.lines) {
38223
- for (const fragment of line.fragments) {
38224
- if (!fragment.textBox || fragment.textBox.floating) {
38225
- continue;
38226
- }
38227
- const startOffset = fragment.startOffset;
38228
- const endOffset = fragment.endOffset > startOffset ? fragment.endOffset : startOffset + 1;
38229
- const slot = line.slots.find((candidate) => candidate.offset === startOffset) ?? line.slots.find((candidate) => candidate.offset >= startOffset);
38230
- if (!slot) {
38231
- continue;
38232
- }
38233
- const height = options.resolveHeight(
38234
- fragment.textBox
38235
- );
38236
- inlineTextBoxes.push({
38237
- paragraphId: options.paragraphId,
38238
- paragraphIndex: options.paragraphIndex,
38239
- zone: options.zone,
38240
- footnoteId: options.footnoteId,
38241
- pageIndex: options.pageIndex,
38242
- startOffset,
38243
- endOffset,
38244
- left: options.lineLeftOffset + slot.left,
38245
- top: options.lineTopOffset + line.top + line.height - height,
38246
- width: fragment.textBox.width,
38247
- height,
38248
- rotation: fragment.textBox.rotation
38249
- });
38250
- }
38251
- }
38252
- return inlineTextBoxes;
38253
- }
38254
38315
  function getCanvasPageElements(surface) {
38255
38316
  const pages = Array.from(
38256
38317
  surface.querySelectorAll(
@@ -42556,7 +42617,7 @@ export {
42556
42617
  resolveImageSrc as Z,
42557
42618
  listKindForTag as _,
42558
42619
  getPageContentWidth as a,
42559
- resolveOpenTypeFeatureTags as a$,
42620
+ getImageFloatingGeometry as a$,
42560
42621
  collectInlineRuns as a0,
42561
42622
  parseParagraphStyle as a1,
42562
42623
  getRunImage as a2,
@@ -42571,29 +42632,29 @@ export {
42571
42632
  TWIPS_PER_POINT as aB,
42572
42633
  PX_PER_INCH as aC,
42573
42634
  TWIPS_PER_INCH as aD,
42574
- resolveEffectiveParagraphStyle as aE,
42575
- resolveEffectiveTextStyleForParagraph as aF,
42576
- EMU_PER_PT as aG,
42577
- EMU_PER_PX as aH,
42578
- getRunFootnoteReference as aI,
42579
- getRunEndnoteReference as aJ,
42580
- iterateFootnoteReferenceRuns as aK,
42581
- iterateEndnoteReferenceRuns as aL,
42582
- imageContentTypeDefaults as aM,
42583
- getRunFieldChar as aN,
42584
- getRunFieldInstruction as aO,
42585
- createEditorRun as aP,
42586
- JSZip as aQ,
42587
- imageExtensionFromMime as aR,
42588
- pxToPt as aS,
42589
- resolveFloatingObjectRect as aT,
42590
- getTextBoxFloatingGeometry as aU,
42591
- getPresetPathSegments as aV,
42592
- buildListLabels as aW,
42593
- getImageFloatingGeometry as aX,
42594
- textStyleToFontSizePt as aY,
42595
- PX_PER_POINT as aZ,
42596
- DEFAULT_FONT_SIZE_PX as a_,
42635
+ normalizeHex6 as aE,
42636
+ resolveEffectiveParagraphStyle as aF,
42637
+ resolveEffectiveTextStyleForParagraph as aG,
42638
+ EMU_PER_PT as aH,
42639
+ OOXML_ROTATION_UNITS as aI,
42640
+ OOXML_PERCENT_DENOMINATOR as aJ,
42641
+ parseHexColorToRgb255 as aK,
42642
+ EMU_PER_PX as aL,
42643
+ getRunFootnoteReference as aM,
42644
+ getRunEndnoteReference as aN,
42645
+ iterateFootnoteReferenceRuns as aO,
42646
+ iterateEndnoteReferenceRuns as aP,
42647
+ imageContentTypeDefaults as aQ,
42648
+ getRunFieldChar as aR,
42649
+ getRunFieldInstruction as aS,
42650
+ createEditorRun as aT,
42651
+ JSZip as aU,
42652
+ imageExtensionFromMime as aV,
42653
+ pxToPt as aW,
42654
+ resolveFloatingObjectRect as aX,
42655
+ getTextBoxFloatingGeometry as aY,
42656
+ getPresetPathSegments as aZ,
42657
+ buildListLabels as a_,
42597
42658
  CaretOverlay as aa,
42598
42659
  Show as ab,
42599
42660
  createRenderEffect as ac,
@@ -42621,128 +42682,133 @@ export {
42621
42682
  setPreciseFontPreference as ay,
42622
42683
  setWelcomeSeen as az,
42623
42684
  getPageBodyTop as b,
42624
- nextFontSizePt as b$,
42625
- isDoubleUnderlineStyle as b0,
42626
- isWavyUnderlineStyle as b1,
42627
- underlineStyleLineWidthPx as b2,
42628
- underlineStyleDashArray as b3,
42629
- resolveListLabel as b4,
42630
- getListLabelInset as b5,
42631
- getAlignedListLabelInset as b6,
42632
- getParagraphBorderInsets as b7,
42633
- buildSegmentTable as b8,
42634
- buildCanvasTableLayout as b9,
42635
- debounce as bA,
42636
- unwrap as bB,
42637
- perfTimer as bC,
42638
- getRunTextBox as bD,
42639
- createEditorDocument as bE,
42640
- resolveResizedDimensions as bF,
42641
- resolveTextBoxRenderHeight as bG,
42642
- getToolbarStyleState as bH,
42643
- getCachedCanvasImage as bI,
42644
- measureParagraphMinContentWidthPx as bJ,
42645
- getEditableBlocksForZone as bK,
42646
- findParagraphLocation as bL,
42647
- createSectionBoundaryParagraph as bM,
42648
- normalizePageSettings as bN,
42649
- DEFAULT_EDITOR_PAGE_SETTINGS as bO,
42650
- markStart as bP,
42651
- markEnd as bQ,
42652
- getParagraphEntries as bR,
42653
- getParagraphById as bS,
42654
- createEditorFootnote as bT,
42655
- createFootnoteReferenceRun as bU,
42656
- renumberFootnotes as bV,
42657
- getHeadingLevel as bW,
42658
- preciseFontModeVersion as bX,
42659
- isPreciseFontModeEnabled as bY,
42660
- resolveNamedTextStyle as bZ,
42661
- togglePreciseFontMode as b_,
42662
- resolveCanvasTableWidth as ba,
42663
- resolveFloatingTableRect as bb,
42664
- normalizeFamily as bc,
42665
- ROBOTO_FONT_FILES as bd,
42666
- loadFontAsset as be,
42667
- OFFICE_COMPAT_FONT_FAMILIES as bf,
42668
- BinaryReader as bg,
42669
- buildSfnt as bh,
42670
- defaultFontDecoderRegistry as bi,
42671
- SfntFontProgram as bj,
42672
- collectPdfFontFamilies as bk,
42673
- outlineFrom as bl,
42674
- getPageHeaderZoneTop as bm,
42675
- getPageColumnRects as bn,
42676
- findFootnoteReference as bo,
42677
- FOOTNOTE_MARKER_GUTTER_PX as bp,
42678
- resolveImporterForFile as bq,
42679
- getDocumentSectionsCanonical as br,
42680
- getDocumentParagraphsCanonical as bs,
42681
- getDocumentParagraphs as bt,
42682
- getDocumentPageSettings as bu,
42683
- getTableCellContentWidthForParagraph as bv,
42684
- layoutMetricsEpoch as bw,
42685
- bumpLayoutMetricsEpoch as bx,
42686
- createCanvasLayoutSnapshotProvider as by,
42687
- on as bz,
42685
+ getHeadingLevel as b$,
42686
+ textStyleToFontSizePt as b0,
42687
+ PX_PER_POINT as b1,
42688
+ DEFAULT_FONT_SIZE_PX as b2,
42689
+ resolveOpenTypeFeatureTags as b3,
42690
+ rgb255ToHex as b4,
42691
+ isDoubleUnderlineStyle as b5,
42692
+ isWavyUnderlineStyle as b6,
42693
+ underlineStyleLineWidthPx as b7,
42694
+ underlineStyleDashArray as b8,
42695
+ resolveListLabel as b9,
42696
+ getTableCellContentWidthForParagraph as bA,
42697
+ layoutMetricsEpoch as bB,
42698
+ bumpLayoutMetricsEpoch as bC,
42699
+ createCanvasLayoutSnapshotProvider as bD,
42700
+ on as bE,
42701
+ debounce as bF,
42702
+ unwrap as bG,
42703
+ perfTimer as bH,
42704
+ getRunTextBox as bI,
42705
+ createEditorDocument as bJ,
42706
+ resolveResizedDimensions as bK,
42707
+ resolveTextBoxRenderHeight as bL,
42708
+ getToolbarStyleState as bM,
42709
+ getCachedCanvasImage as bN,
42710
+ measureParagraphMinContentWidthPx as bO,
42711
+ getEditableBlocksForZone as bP,
42712
+ findParagraphLocation as bQ,
42713
+ createSectionBoundaryParagraph as bR,
42714
+ normalizePageSettings as bS,
42715
+ DEFAULT_EDITOR_PAGE_SETTINGS as bT,
42716
+ markStart as bU,
42717
+ markEnd as bV,
42718
+ getParagraphEntries as bW,
42719
+ getParagraphById as bX,
42720
+ createEditorFootnote as bY,
42721
+ createFootnoteReferenceRun as bZ,
42722
+ renumberFootnotes as b_,
42723
+ getListLabelInset as ba,
42724
+ getAlignedListLabelInset as bb,
42725
+ getParagraphBorderInsets as bc,
42726
+ buildSegmentTable as bd,
42727
+ buildCanvasTableLayout as be,
42728
+ resolveCanvasTableWidth as bf,
42729
+ resolveFloatingTableRect as bg,
42730
+ normalizeFamily as bh,
42731
+ ROBOTO_FONT_FILES as bi,
42732
+ loadFontAsset as bj,
42733
+ OFFICE_COMPAT_FONT_FAMILIES as bk,
42734
+ BinaryReader as bl,
42735
+ buildSfnt as bm,
42736
+ defaultFontDecoderRegistry as bn,
42737
+ SfntFontProgram as bo,
42738
+ collectPdfFontFamilies as bp,
42739
+ outlineFrom as bq,
42740
+ getPageHeaderZoneTop as br,
42741
+ getPageColumnRects as bs,
42742
+ findFootnoteReference as bt,
42743
+ FOOTNOTE_MARKER_GUTTER_PX as bu,
42744
+ resolveImporterForFile as bv,
42745
+ getDocumentSectionsCanonical as bw,
42746
+ getDocumentParagraphsCanonical as bx,
42747
+ getDocumentParagraphs as by,
42748
+ getDocumentPageSettings as bz,
42688
42749
  getPageBodyBottom as c,
42689
- previousFontSizePt as c0,
42690
- fontSizePtToPx as c1,
42691
- createDefaultToolbarPreset as c2,
42692
- MenuRegistry as c3,
42693
- createToolbarRegistry as c4,
42694
- Editor as c5,
42695
- resolveCommandRef as c6,
42696
- commandRefName as c7,
42697
- createOasisEditorClient as c8,
42698
- createEditorZoom as c9,
42699
- OasisEditorContainer as cA,
42700
- PluginCollection as cB,
42701
- Popover as cC,
42702
- RIBBON_TABS as cD,
42703
- Select as cE,
42704
- SelectField as cF,
42705
- Separator as cG,
42706
- SidePanel as cH,
42707
- SidePanelBody as cI,
42708
- SidePanelFooter as cJ,
42709
- SidePanelHeader as cK,
42710
- SplitButton as cL,
42711
- StyleGallery as cM,
42712
- TextField as cN,
42713
- Button$1 as cO,
42714
- buildRibbonTabDefinitions as cP,
42715
- createEditorCommandBus as cQ,
42716
- createOasisEditor as cR,
42717
- createOasisEditorContainer as cS,
42718
- mount as cT,
42719
- registerToolbarRenderer as cU,
42720
- startLongTaskObserver as ca,
42721
- installGlobalReport as cb,
42722
- applyStoredPreciseFontPreference as cc,
42723
- getWelcomeSeen as cd,
42724
- isLocalFontAccessSupported as ce,
42725
- EDITOR_SCROLL_PADDING_PX as cf,
42726
- Toolbar as cg,
42727
- OasisEditorLoading as ch,
42728
- I18nProvider as ci,
42729
- createTranslator as cj,
42730
- createEditorLogger as ck,
42731
- registerDomStatsSurface as cl,
42732
- Button as cm,
42733
- Checkbox as cn,
42734
- ColorPicker as co,
42735
- CommandRegistry as cp,
42736
- DEFAULT_PALETTE as cq,
42737
- DialogFooter as cr,
42738
- FloatingActionButton as cs,
42739
- GridPicker as ct,
42740
- IconButton as cu,
42741
- Menu as cv,
42742
- OASIS_BUILTIN_COMMANDS as cw,
42743
- OASIS_MENU_ITEMS as cx,
42744
- OASIS_TOOLBAR_ITEMS as cy,
42745
- OasisEditorAppLazy as cz,
42750
+ preciseFontModeVersion as c0,
42751
+ isPreciseFontModeEnabled as c1,
42752
+ resolveNamedTextStyle as c2,
42753
+ togglePreciseFontMode as c3,
42754
+ nextFontSizePt as c4,
42755
+ previousFontSizePt as c5,
42756
+ fontSizePtToPx as c6,
42757
+ createDefaultToolbarPreset as c7,
42758
+ MenuRegistry as c8,
42759
+ createToolbarRegistry as c9,
42760
+ Menu as cA,
42761
+ OASIS_BUILTIN_COMMANDS as cB,
42762
+ OASIS_MENU_ITEMS as cC,
42763
+ OASIS_TOOLBAR_ITEMS as cD,
42764
+ OasisEditorAppLazy as cE,
42765
+ OasisEditorContainer as cF,
42766
+ PluginCollection as cG,
42767
+ Popover as cH,
42768
+ RIBBON_TABS as cI,
42769
+ Select as cJ,
42770
+ SelectField as cK,
42771
+ Separator as cL,
42772
+ SidePanel as cM,
42773
+ SidePanelBody as cN,
42774
+ SidePanelFooter as cO,
42775
+ SidePanelHeader as cP,
42776
+ SplitButton as cQ,
42777
+ StyleGallery as cR,
42778
+ TextField as cS,
42779
+ Button$1 as cT,
42780
+ buildRibbonTabDefinitions as cU,
42781
+ createEditorCommandBus as cV,
42782
+ createOasisEditor as cW,
42783
+ createOasisEditorContainer as cX,
42784
+ mount as cY,
42785
+ registerToolbarRenderer as cZ,
42786
+ Editor as ca,
42787
+ resolveCommandRef as cb,
42788
+ commandRefName as cc,
42789
+ createOasisEditorClient as cd,
42790
+ createEditorZoom as ce,
42791
+ startLongTaskObserver as cf,
42792
+ installGlobalReport as cg,
42793
+ applyStoredPreciseFontPreference as ch,
42794
+ getWelcomeSeen as ci,
42795
+ isLocalFontAccessSupported as cj,
42796
+ EDITOR_SCROLL_PADDING_PX as ck,
42797
+ Toolbar as cl,
42798
+ OasisEditorLoading as cm,
42799
+ I18nProvider as cn,
42800
+ createTranslator as co,
42801
+ createEditorLogger as cp,
42802
+ registerDomStatsSurface as cq,
42803
+ Button as cr,
42804
+ Checkbox as cs,
42805
+ ColorPicker as ct,
42806
+ CommandRegistry as cu,
42807
+ DEFAULT_PALETTE as cv,
42808
+ DialogFooter as cw,
42809
+ FloatingActionButton as cx,
42810
+ GridPicker as cy,
42811
+ IconButton as cz,
42746
42812
  domTextMeasurer as d,
42747
42813
  estimateTableBlockHeight as e,
42748
42814
  getFootnoteDisplayMarker as f,